### Setup Commands for Isolated Cordis Tutorial Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/cordisplugins/hello-world.md Shell commands to initialize the upstream submodule, install dependencies with corepack pnpm, and create the tutorial directory. Run from the repository root after the submodule is installed. ```sh git submodule update --init --recursive cd deepseek-harness corepack pnpm install --frozen-lockfile mkdir -p tmp/cordis-tutorial ``` -------------------------------- ### Clone and Install Repository Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/cordis-tutorial/index.md Initial setup commands to clone the DeepSeek Harness repository and install necessary dependencies. ```sh git clone https://github.com/deepseek-ai/deepseek-harness.git cd deepseek-harness pnpm install ``` -------------------------------- ### Install the SDK Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/user/guide/python-sdk.md Clone the repository, set up a virtual environment, and install the SDK with its bundled runtime. ```sh git clone https://github.com/deepseek-ai/deepseek-harness.git cd deepseek-harness python -m venv .venv . .venv/bin/activate python -m pip install deepseek-harness-sdk ``` -------------------------------- ### Setup MCP Reference Memory provider Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/examples/mcp-memory/README.md Install the MCP reference server globally and start DSH with the corresponding overlay. This server stores a local knowledge graph in a JSONL file. ```sh npm install --global @modelcontextprotocol/server-memory@2026.7.4 dsh web --patch "$PWD/examples/mcp-memory/mcp-reference-memory.cordis.yml" ``` -------------------------------- ### Setup Engram provider Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/examples/mcp-memory/README.md Install the Engram binary and start DSH with the Engram overlay. Engram manages its own storage and project detection. ```sh go install github.com/Gentleman-Programming/engram/cmd/engram@v1.20.0 dsh web --patch "$PWD/examples/mcp-memory/engram.cordis.yml" ``` -------------------------------- ### Install dependencies and launch the ACRYL Desktop checkout Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/cordisplugins/hello-world.md Run from the repository root after quitting the installed ACRYL app. Enables Corepack, installs dependencies immutably, then builds and starts Electron against ~/.dsh-acryl with a separate user-data folder. First build can take a while. ```sh corepack enable corepack yarn install --immutable corepack yarn local ``` -------------------------------- ### Setup Memorix provider Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/examples/mcp-memory/README.md Install the Memorix package globally and start DSH with the Memorix overlay. Memorix operates in local heuristic mode. ```sh npm install --global memorix@1.3.0 dsh web --patch "$PWD/examples/mcp-memory/memorix.cordis.yml" ``` -------------------------------- ### Install dependencies Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/development.md Install all project dependencies from the repository root. ```sh pnpm install ``` -------------------------------- ### Run the checked-in example Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/user/guide/python-sdk.md Execute a task against an isolated workspace using the minimal example script. ```sh python examples/jsonrpc-agent/minimal.py \ --workspace /absolute/path/to/workspace \ --session-root /absolute/path/to/sessions \ --session-id example-001 \ "Inspect the repository and fix the failing tests." ``` -------------------------------- ### Verify and boot profile Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/user/develop/basic/publish.md Commands to inspect the generated configuration layer and start the profile. ```sh dsh --profile demo --dump-config # shows a "# == dsh-hello-plugin" layer dsh --profile demo ``` -------------------------------- ### Setup Cordis environment Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md Initialize the project dependencies and directory structure from the repository root. ```sh pnpm install mkdir -p tmp/cordis-system-guide cd tmp/cordis-system-guide ``` -------------------------------- ### Start Desktop Development Mode Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/cordisplugins/hello-world-plugin-guide.md Command to launch the graphical application for development. ```sh corepack yarn dev ``` -------------------------------- ### Start Web UI with patch Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/user/develop/basic/index.md Launch the Web UI using the specified patch file. ```sh pnpm dsh web --patch ./scratch-plugin/cordis.yml ``` -------------------------------- ### Example feature component mapping Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md An example showing how a single feature, such as a Git provider, maps across Plugin, Service, Tool, and Event concepts. ```text Plugin: Git provider plugin Service: ctx.git Tool: git_status Events: git/pre-operation, git/result ``` -------------------------------- ### Run typecheck Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/development.md Verify the project setup by running the typechecker after a fresh clone. ```sh pnpm run typecheck ``` -------------------------------- ### Bundle structure example Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md Shows the file structure of a bundle package with package.json, cordis.patch.yml, and index.js. ```text my-plugin/ ├── package.json ├── cordis.patch.yml └── index.js ``` -------------------------------- ### Create temporary directories for dsh web Hello World Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/cordisplugins/hello-world.md Creates the throwaway home and plugin directories for the dsh web example. Do not point this at your production ~/.dsh. ```sh mkdir -p /tmp/dsh-hello-plugin /tmp/dsh-hello-home ``` -------------------------------- ### Run browser interface Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/examples/web-cordis/README.md Starts the browser interface for the web-cordis demonstration. Requires the DEEPSEEK_API_KEY environment variable. ```sh pnpm run demo:cordis ``` -------------------------------- ### Example YAML configuration Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md A sample YAML configuration file defining a plugin entry with an ID, module name, and configuration object. ```yaml - id: greeter name: ./greeter.ts config: greeting: Hello targets: - alpha - beta ``` -------------------------------- ### Filesystem watcher effect example Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md An example of managing a filesystem watcher resource. ```ts ctx.effect(() => { const watcher = watch(path, handler) return () => watcher.close() }) ``` -------------------------------- ### Start Host and Client Watcher Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/api-gateway.md Commands to start the Host source via tsx and the Client plugin watcher in separate terminals. ```sh pnpm dsh web pnpm run dev:web ``` -------------------------------- ### Install plugin into profile Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md Shows the command to add a plugin to a profile. ```sh dsh plugin --profile demo add ./my-plugin ``` -------------------------------- ### Run Hello World Plugin Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/cordisplugins/hello-world.md Commands to run the plugin from the tutorial directory. Requires tsx to be available; if missing, run corepack pnpm install in deepseek-harness. Expected output is '[hello-world] loaded'. ```sh cd tmp/cordis-tutorial node --import tsx ../../vendor/cordis/bin.js ``` -------------------------------- ### Adding a plugin from GitHub Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/user/develop/basic/publish.md Command to install a plugin directly from a GitHub repository. ```sh dsh plugin --profile demo add github:you/hello-plugin ``` -------------------------------- ### start(spec: JobStart): JobId Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/subsystems/jobs.md Preflight access, validation, owner cleanup, and implementation-owned admission before starting and atomically registering work. Any preflight rejection leaves no job id or execution resource; a throwing starter leaves nothing registered. ```APIDOC ## start(spec: JobStart): JobId ### Description Preflight access, validation, owner cleanup, and implementation-owned admission before starting and atomically registering work. Any preflight rejection leaves no job id or execution resource. A throwing starter leaves nothing registered; after it returns, registration cannot fail. Settlement records the outcome, notifies listeners, and releases waiters. ### Parameters - **spec** (JobStart) - Required - Job identity, owner, and synchronous starter. ### Returns - **JobId** - The registry-issued `-N` id. ``` -------------------------------- ### Better: async setup inside ctx.effect() Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md Uses ctx.effect(async () => ...) to keep ownership within the effect, leveraging Harness's lifecycle hardening for re-entrant/async setup. ```TypeScript export function apply(ctx: Context) { ctx.effect(async () => { const connection = await connect() return () => connection.close() }) } ``` -------------------------------- ### Accessing Services on Context Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md Example showing how named capabilities are exposed on the ctx object. ```ts ctx.tools ctx.llm ctx.database ``` -------------------------------- ### Example: logging plugin Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/user/develop/framework/events.md A complete example plugin that logs tool calls and results using the tools/result event. ```APIDOC ## Example: logging plugin ### Description A complete example plugin that logs tool calls and results using the tools/result event. ### Method Plugin definition ### Parameters - **ctx** (Context) - Required - The Cordis context. ### Request Example ```ts import type { Context } from '@deepseek-ai/cordis' import '@deepseek-ai/dsh-tools' export const name = 'tool-logger' export function apply(ctx: Context) { ctx.on('tools/result', (exec, result) => { console.log(`[tool] ${exec.name}(${JSON.stringify(exec.arguments)})`) const text = result.content .map(block => block.type === 'text' ? block.text : '') .join('') console.log(`[tool result] ${text.slice(0, 100)}`) }) } ``` ### Response No return value. ``` -------------------------------- ### Conceptual group usage examples Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md Examples of scenarios where grouping entries is appropriate. ```text one agent profile one tenant one workspace one adapter bundle one provider stack one feature set ``` -------------------------------- ### Typical HMR configuration Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md Example YAML configuration for setting up the HMR plugin with a timer. ```yaml - id: timer name: '@cordisjs/plugin-timer' - id: hmr name: '@cordisjs/plugin-hmr' config: root: - . ``` -------------------------------- ### Loader configuration fields Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md Examples of setting plugin configuration and the disabled flag. ```yaml config: timeout: 5000 ``` ```yaml disabled: true ``` -------------------------------- ### Verify package installation and quality checks Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/cookbook/adding-a-package.md Run these commands to register the workspace, sync documentation, and execute constraints, type checking, linting, build, and hygiene scripts. ```sh pnpm install # registers the workspace pnpm run doc-sync pnpm run constraints && pnpm run typecheck && pnpm run lint pnpm run build && pnpm run hygiene ``` -------------------------------- ### Manual Startup Sequence (Anti-pattern) Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md An example of manual startup control that Cordis aims to replace with reactive dependency injection. ```ts await startDatabase() await startApi() await startWorkers() ``` -------------------------------- ### Define and Provide a Custom Service Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md Example of creating a GreeterService by extending the Service class and applying it as a plugin. ```ts import { Service, type Context } from '@deepseek-ai/cordis' declare module '@deepseek-ai/cordis' { interface Context { greeter: GreeterService } } export class GreeterService extends Service { constructor(ctx: Context) { super(ctx, 'greeter') } greet(name: string) { return `Hello, ${name}!` } } export const name = 'greeter-provider' export function apply(ctx: Context) { ctx.plugin(GreeterService) } ``` -------------------------------- ### WorkflowEngine start method definition Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/subsystems/workflow.md Defines the abstract start method for the WorkflowEngine, which accepts a WorkflowStartRequest and returns a WorkflowRun. The result of the returned run resolves once the script settles. ```ts /** * Parse and execute a workflow script. * @param request - the script, its `args`, the parent agent, and an * optional cancel signal. * @returns the live run; its `result` resolves when the script settles. */ abstract start(request: WorkflowStartRequest): WorkflowRun ``` -------------------------------- ### Recommended HMR Configuration Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md Example YAML configuration for setting up HMR with logger and timer plugins. ```yaml - id: logger-console name: '@cordisjs/plugin-logger-console' - id: timer name: '@cordisjs/plugin-timer' - id: hmr name: '@cordisjs/plugin-hmr' config: root: - . ``` -------------------------------- ### Mounting a provider plugin in a bundle Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/user/develop/basic/publish.md Example configuration for a bundle that defines a runnable app by mounting a provider plugin. ```yaml - id: hello-startup name: 'dsh-hello-plugin/startup' ``` -------------------------------- ### start(name, request) Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/subsystems/subagent.md Establishes a published child on the named provider. Capability and semantic checks run before delegation. Returns the published holder-owned run. ```APIDOC ## start(name, request) ### Description Establishes a published child on the named provider. Capability and semantic checks run before delegation. Provider ownership lasts until its promise fulfills; a rejection therefore has no run for the caller to dispose and emits no run lifecycle events. Post-publication turn and infrastructure failures settle through the returned run. ### Method async start ### Signature async start(name: string, request: SubagentStartRequest): Promise ### Parameters - **name** (string) - Required - The provider to use. - **request** (SubagentStartRequest) - Required - Child label, prompt, parent, signal, and optional capabilities. ### Returns - **Promise** - The published holder-owned run. ``` -------------------------------- ### Build Desktop Environment Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/cordisplugins/hello-world-plugin-guide.md Commands to prepare toolchains and build the Desktop application from the repository root. ```sh corepack yarn install --immutable corepack yarn upstream:install corepack yarn upstream:build corepack yarn build ``` -------------------------------- ### Register tool for database access Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md Example of registering a tool that consumes a database service. ```ts ctx.tools.register(defineTool(...)) ``` -------------------------------- ### Example watcher with ctx.effect() Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md Shows how to wrap a filesystem watcher in ctx.effect(), returning a cleanup function that closes the watcher. ```TypeScript ctx.effect(() => { const watcher = watch(directory, onChange) return () => watcher.close() }) ``` -------------------------------- ### Expected output from running the example Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/cordis-tutorial/04-events.md Shows the console output produced by the reporter plugin after the three bump calls. The listener logs each event with the name and count. ```text [stats] tool_call -> 1 [stats] tool_call -> 2 [stats] prompt -> 1 ``` -------------------------------- ### Compose stats.ts and reporter.ts Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/cordis-tutorial/04-events.md YAML configuration that composes the stats service and reporter plugin together. This is the setup required to run the example. ```YAML - name: './stats.ts' - name: './reporter.ts' ``` -------------------------------- ### Complete service definition Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md A full example combining type declaration, service class definition, and plugin application. ```ts import { Service, type Context } from 'cordis' declare module 'cordis' { interface Context { greeter: GreeterService } } export class GreeterService extends Service { constructor(ctx: Context) { super(ctx, 'greeter') } greet(name: string) { return `Hello, ${name}!` } } export function apply(ctx: Context) { ctx.plugin(GreeterService) } ``` -------------------------------- ### StreamChunk protocol for text Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md An example of the canonical text stream using the StreamChunk protocol, showing block start, text deltas, block end, usage, and finish chunks. ```ts async function* stream(): AsyncIterable { yield { type: 'block-start', index: 0, blockType: 'text', } yield { type: 'text-delta', index: 0, text: 'Hello', } yield { type: 'text-delta', index: 0, text: ' world', } yield { type: 'block-end', index: 0, block: { type: 'text', text: 'Hello world', }, } yield { type: 'usage', usage: { inputTokens: 100, outputTokens: 2, }, } yield { type: 'finish', reason: { kind: 'stop' }, } } ``` -------------------------------- ### Verification commands for vendored package Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/cookbook/adding-a-vendored-package.md Run pnpm install to register the workspace, then typecheck, build, and constraints. The source paths map lives once in tsconfig.base.json and serves every graph. ```sh pnpm install # registers the workspace pnpm run typecheck pnpm run build && pnpm run constraints ``` -------------------------------- ### Register an invariant installer with ctx.invariants Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/subsystems/invariants.md Registers a package's invariant installer, which runs in a child fiber. Failure of the installer disposes the fiber and releases the reservation. ```ts /** * Register one package's invariant installer. The package name is reserved * even when filtering disables its checks. Enabled installers run in a child * fiber; failure disposes that fiber and releases the reservation. * @param packageName - full npm package name that owns the contribution. * @param installer - listener or startup-check installer for the child context. * @returns an effect-scoped disposer for the registration. */ register(packageName: string, installer: InvariantInstaller): () => void ``` -------------------------------- ### Manually install Lefthook hooks Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/development.md Run this script if Lefthook integrations are missing after dependency restoration or skipped postinstall. ```sh node scripts/install-lefthook.mjs ``` -------------------------------- ### Run hello plugin and verify output Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md Execute the Cordis launcher and verify the expected console output. ```sh node --import tsx ../../vendor/cordis/bin.js ``` ```text [hello] active ``` -------------------------------- ### Process signal effect example Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md An example of managing a process signal listener. ```ts ctx.effect(() => { const handler = () => shutdown() process.on('SIGTERM', handler) return () => { process.off('SIGTERM', handler) } }) ``` -------------------------------- ### Example lifecycle with console output Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/user/develop/framework/index.md A plugin that logs loading, effect registration, and cleanup. Loading prints 'plugin loading' and 'effect registered'; unloading prints 'effect cleaned up'. ```typescript export function apply(ctx: Context) { console.log('plugin loading') ctx.effect(() => { console.log('effect registered') return () => console.log('effect cleaned up') }) } ``` ```text plugin loading effect registered ``` ```text effect cleaned up ``` -------------------------------- ### Spatial composability dependency graph example Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md A conceptual diagram showing how a consumer reacts to a provider change in the dependency graph. ```text consumer injects 'llm' │ └── currently resolved to Provider A Provider A disappears Provider B appears ``` -------------------------------- ### Configure LLM adapter in cordis.yml Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/user/develop/practice/llm-adapter.md Example configuration for defining an LLM adapter and an agent loop using that provider in the cordis.yml file. ```yaml - id: my-llm name: './src/my-llm-adapter.ts' config: apiKey: !!js process.env.MY_API_KEY providers: - my-provider - id: agent-loop name: '@deepseek-ai/dsh-agent-loop' config: agents: - id: main provider: my-provider model: my-model-v1 ``` -------------------------------- ### Socket effect example Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md An example of managing a socket connection with an asynchronous cleanup function. ```ts ctx.effect(() => { const socket = connect() socket.on('message', onMessage) return async () => { socket.off('message', onMessage) await socket.close() } }) ``` -------------------------------- ### Plugin shape decision guide Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md A quick reference for choosing between function, object, and class plugin forms. ```text Need lifecycle only? → function plugin Need structured object form? → object plugin Need to provide service API? → Service class ``` -------------------------------- ### Waterfall listener example: transform Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md Example of a waterfall listener that calls next() and transforms the result. ```TypeScript ctx.on('demo/transform', async (input, next) => { const result = await next() return result.trim() }) ``` -------------------------------- ### Waterfall Listener Example - Wrapping Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md Example listener that wraps the downstream call and transforms the result. ```APIDOC ## Waterfall Listener Example - Wrapping ### Description Example listener that wraps the downstream call and transforms the result. ### Code ```ts ctx.on('demo/transform', async (input, next) => { const result = await next() return result.toUpperCase() }) ``` ``` -------------------------------- ### register(packageName, installer) Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/subsystems/invariants.md Registers one package's invariant installer. The package name is reserved even when filtering disables its checks. Enabled installers run in a child fiber; failure disposes that fiber and releases the reservation. ```APIDOC ## register(packageName: string, installer: InvariantInstaller): () => void ### Description Registers one package's invariant installer. The package name is reserved even when filtering disables its checks. Enabled installers run in a child fiber; failure disposes that fiber and releases the reservation. ### Method register ### Parameters - **packageName** (string) - Required - Full npm package name that owns the contribution. - **installer** (InvariantInstaller) - Required - Listener or startup-check installer for the child context. ### Returns - **() => void** - An effect-scoped disposer for the registration. ### Source packages/runtime-diagnostics/invariants/src/index.ts ``` -------------------------------- ### Temporal composability example problem Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md A conceptual representation of a plugin lifecycle scenario requiring revertible effects to ensure clean unloading. ```text Plugin A registers tool A Plugin B registers tool B Plugin A registers event listener A Plugin A starts timer A later: unload A ``` -------------------------------- ### Cordis/DSH sandbox initialization Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_spec.md Commands to clone the DeepSeek harness repository and prepare the tutorial directory. ```sh git clone https://github.com/deepseek-ai/deepseek-harness.git cd deepseek-harness pnpm install mkdir -p tmp/cordis-tutorial cd tmp/cordis-tutorial ``` -------------------------------- ### Create root context Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md Step 1: Initialize the root dependency, service, and lifecycle container. ```ts const ctx = new Context() ``` -------------------------------- ### Waterfall Listener Example - Veto Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md Example listener that can veto the operation by returning a value without calling next. ```APIDOC ## Waterfall Listener Example - Veto ### Description Example listener that can veto the operation by returning a value without calling next. ### Code ```ts ctx.on('demo/transform', async (input, next) => { if (input === 'forbidden') { return 'BLOCKED' } return next() }) ``` ``` -------------------------------- ### ctx.authorization.begin(request) Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/subsystems/credentials.md Runs one attempt to authorize a key and reports how it ended. One attempt per key at a time; a second caller is refused. ```APIDOC ## ctx.authorization.begin(request) ### Description Runs one attempt to authorize a key and reports how it ended. One attempt per key at a time; a second caller is refused. ### Method Async function call ### Endpoint N/A - SDK method ### Parameters - **request** (AuthorizationRequest) - Required - The key, the method, the surface, and the cancel signal. ### Returns - **Promise** - `authorized` once the flow's record is committed during this attempt and observed, or `cancelled` when the human declined or the caller withdrew. ### Throws - **AuthorizationError** - code `NO_FLOW` when nothing claims the key, `UNKNOWN_METHOD` when the named method is not one the flow offers, `ALREADY_IN_FLIGHT` when an attempt is already running for the key, or `NOT_COMMITTED` when the flow resolved without committing a record during the attempt. ``` -------------------------------- ### Bad return value example Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md An example of returning prose instead of a structured object, which is discouraged for downstream code consumption. ```ts return `Created file at ${path} with id ${id}` ``` -------------------------------- ### ctx.workflowEngine.start Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/subsystems/workflow.md Parse and execute a workflow script. This is the primary entry point for starting a workflow run, accepting a WorkflowStartRequest and returning a WorkflowRun whose result resolves when the script settles. ```APIDOC ## ctx.workflowEngine.start ### Description Parse and execute a workflow script. This method is part of the Workflow Service Definition contract and is the primary way to start a workflow run. ### Method start (abstract method) ### Signature ```ts abstract start(request: WorkflowStartRequest): WorkflowRun ``` ### Parameters - **request** (WorkflowStartRequest) - Required - The script, its `args`, the parent agent, and an optional cancel signal. ### Returns - **WorkflowRun** - The live run; its `result` resolves when the script settles. ### Behavior Notes - Invalid requests throw before publication. - A live run is holder-owned, its result never rejects. - Cancellation and disposal are bounded, and disposal waits for child cleanup within that bound. - Lifecycle listener failures are contained. - `workflow/end` fires exactly once as the result settles. ``` -------------------------------- ### External side effect example Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md An example of a raw side effect that lacks cleanup, potentially leading to memory leaks or duplicate work. ```ts const timer = setInterval(work, 1000) ``` -------------------------------- ### Create plugin directory Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/user/develop/basic/publish.md Initialize the directory structure for the new plugin. ```sh mkdir -p hello-plugin ``` -------------------------------- ### Example emitter with ctx.effect() Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md Shows how to wrap an event emitter subscription in ctx.effect(), returning a cleanup function that removes the listener. ```TypeScript ctx.effect(() => { emitter.on('data', onData) return () => emitter.off('data', onData) }) ``` -------------------------------- ### Anti-pattern: fire-and-forget asynchronous setup (bad) Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md Bad pattern where asynchronous setup is not owned by ctx.effect(), leaving ownership ambiguous if the plugin unloads before resolution. ```TypeScript export function apply(ctx: Context) { void connect().then(connection => { // Now who owns this if the plugin unloaded before connect resolved? }) } ``` -------------------------------- ### Initialize submodules for existing clone Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/README.md Runs the initialization script for an existing repository clone. ```bash ./scripts/init-submodules.sh ``` -------------------------------- ### Create plugin entry point index.js Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/user/develop/basic/publish.md Define the plugin logic in the index.js file. ```js export const name = 'hello-plugin' export function apply() { console.log('[hello-plugin] plugin loaded!') } ``` -------------------------------- ### Simple Cordis plugin configuration Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_spec.md A basic example of defining plugin composition in cordis.yml using id, name, and config fields. ```yaml - id: logger name: '@deepseek-ai/cordis-plugin-logger-console' - id: my-agent-provider name: './plugins/agent-provider.ts' config: provider: claude-code ``` -------------------------------- ### get(id) Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/subsystems/session.md Looks up a live session by its id. ```APIDOC ## get(id) ### Description Looks up a live session by its id. ### Method get ### Signature get(id: SessionId): Session | undefined ### Parameters - **id** (SessionId) - Required - The session id to look up. ### Returns - **session** (Session | undefined) - The session, or undefined when no live session has that id. ``` -------------------------------- ### Register the settings namespace (Host half) Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/cookbook/adding-a-settings-card.md Use 'installSettingsSection' to register a plugin's configuration namespace. This example demonstrates defining the configuration schema and applying the settings section with validation and change handlers. ```ts import type { Context } from '@deepseek-ai/cordis' import { installSettingsSection, settingsNamespace } from '@deepseek-ai/dsh-settings' import z from '@deepseek-ai/schemastery' declare function assertReachable(endpoint: string | undefined): void declare function rebuildFromSettings(config: Config): void export const MY_PLUGIN_NS = settingsNamespace('my-plugin') export interface Config { endpoint?: string retries?: number } export const Config: z = z.object({ endpoint: z.string(), retries: z.number().step(1).min(0).default(3), }) export function apply(ctx: Context, config: Config) { let source = () => config installSettingsSection(ctx, MY_PLUGIN_NS, Config, config, { // Constraints the schema cannot express refuse the write, not the next use. validate: value => void assertReachable(value.endpoint), setSource: (current) => { source = current }, onChange: () => { rebuildFromSettings(source()) }, }) } ``` -------------------------------- ### Use the SDK in your own program Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/user/guide/python-sdk.md Initialize the DeepSeekHarness context manager to run tasks programmatically. ```python from pathlib import Path from deepseek_harness import DeepSeekHarness config = Path("examples/jsonrpc-agent/minimal.cordis.yml").resolve() workspace = Path("/absolute/path/to/workspace").resolve() sessions = Path("/absolute/path/to/sessions").resolve() with DeepSeekHarness( provider="deepseek-official", model="deepseek-v4-flash", max_tokens=49_152, cwd=str(workspace), session_root=str(sessions), cordis=str(config), ) as harness: result = harness.run( "Inspect the repository and fix the failing tests.", session_id="example-001", ) print(result.final_response) ``` -------------------------------- ### Event interception points Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_spec.md Examples of event interception points. ```text agent/request tool/execute approval/request relay/before-handoff ``` -------------------------------- ### Create scratch project directory Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/user/develop/basic/index.md Initialize the directory structure for a new plugin project. ```sh mkdir -p scratch-plugin/src ``` -------------------------------- ### Query database service Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md Example of consuming a database service capability. ```ts await ctx.database.query(...) ``` -------------------------------- ### Application architecture comparison Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md Comparison between manual subsystem imports and the recommended configuration-driven approach. ```text BAD: main.ts manually imports and starts every application subsystem GOOD: main.ts starts Cordis + Loader configuration declares the application ``` -------------------------------- ### get(agent: Agent) Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/subsystems/plan.md Reads the logged plan state and any selected state awaiting the next accepted in-turn pre-step for the given agent. ```APIDOC ## get(agent: Agent) ### Description Read the logged plan state and any selected state awaiting the next accepted in-turn pre-step. ### Parameters - **agent** (Agent) - Required - The agent to read. ### Returns - **active** (boolean) - Current logged state. - **pending** (boolean, optional) - A pending selection, when present. ``` -------------------------------- ### get Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/subsystems/settings.zh.md Reads one registered namespace's resolved value. ```APIDOC ## get(ns) ### Description Reads one registered namespace's resolved value. ### Method get ### Endpoint ctx.settings.get(ns) ### Parameters #### Parameters - **ns** (SettingsNamespace) - Required - The namespace to read. ### Returns - **unknown** - The resolved value, or `undefined` while unregistered. ### Example ```ts const value = ctx.settings.get('myNamespace'); ``` ``` -------------------------------- ### Anti-pattern 3: Manually encoded startup choreography Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md Avoid manual startup sequences. Define dependencies using the injection system instead. ```text await loadDatabase() await loadApi() await loadWorker() ``` ```text api injects database worker injects api ``` -------------------------------- ### loader/entry-init Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/cordis-api/inherited.md A config entry is being initialized. ```APIDOC ## loader/entry-init ### Description A config entry is being initialized. ### Event Name loader/entry-init ### Payload - **entry** (Object) - Required - The config entry ``` -------------------------------- ### Example: logging plugin Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/user/develop/framework/events.md A complete plugin that logs tool calls and results. It listens to the 'tools/result' event and prints the tool name, arguments, and the first 100 characters of the result text. ```TypeScript import type { Context } from '@deepseek-ai/cordis' import '@deepseek-ai/dsh-tools' export const name = 'tool-logger' export function apply(ctx: Context) { ctx.on('tools/result', (exec, result) => { console.log(`[tool] ${exec.name}(${JSON.stringify(exec.arguments)})`) const text = result.content .map(block => block.type === 'text' ? block.text : '') .join('') console.log(`[tool result] ${text.slice(0, 100)}`) }) } ``` -------------------------------- ### Compare manual plugin loading vs Loader Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md Demonstrates the difference between manually calling ctx.plugin and using a declarative Loader configuration. ```ts ctx.plugin(A) ctx.plugin(B) ctx.plugin(C) ``` ```yaml - id: a name: ./a.ts - id: b name: ./b.ts - id: c name: ./c.ts ``` -------------------------------- ### Create Scratch Directory Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/cordis-tutorial/index.md Commands to create a gitignored directory for tutorial work. ```sh mkdir -p tmp/cordis-tutorial cd tmp/cordis-tutorial ``` -------------------------------- ### Build the project Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/development.md Run the build command to generate artifacts and bind environment variables to the output. ```sh pnpm run build ``` -------------------------------- ### ShellExecutor abstract methods: resolve, run, start Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/subsystems/shell.md Abstract methods for the ShellExecutor seam. resolve applies defaults and caps to a request; run executes in the foreground and resolves with a ShellRunResult for nonzero exits, timeout kills, and abort kills; start launches a background process and returns a ShellProcess handle immediately. ```TypeScript /** * Apply implementation-owned defaults and caps to a request before execution. * @param request - the caller's request; omitted fields get this * implementation's defaults, capped fields are clamped. * @returns the fully-specified spec to hand to {@link run}/{@link start}. */ abstract resolve(request: ShellExecRequest): ShellExecSpec /** * Run a command in the foreground; resolves when it finishes. * @param spec - a resolved spec from {@link resolve}, never a raw request. * @returns the outcome; nonzero exits, timeout kills, and abort kills * resolve with a descriptive result rather than reject. */ abstract run(spec: ShellExecSpec): Promise /** * Start a background process and return its handle immediately. * @param spec - a resolved spec from {@link resolve}, never a raw request. * @returns the live process handle (reads, kill, quiescence promise). */ abstract start(spec: ShellExecSpec): ShellProcess ``` -------------------------------- ### Anti-pattern context graph dependency Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md Examples of concrete implementations that should not be imported directly by consumers. ```text OmniGraph SDK concrete client Lat.md concrete implementation ``` -------------------------------- ### Run the application Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/cordis-tutorial/01-first-plugin.md Executes the Cordis application using the provided launcher and displays the expected output. ```sh node --import tsx ../../vendor/cordis/bin.js ``` ```bash hello from my first plugin ``` -------------------------------- ### Compose and run plugins in cordis.yml Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/cordis-tutorial/03-services.md Configure the application to load the greeter and consumer plugins. The output confirms the service is successfully consumed. ```yaml - name: './greeter.ts' - name: './consumer.ts' ``` ```text Hello, world! ``` -------------------------------- ### Service Injection and Optional Service Access Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/examples/acp-agent/tests/snapshots/advanced-toolchain/system-prompt.expected.md Demonstrates how to declare hard dependencies using inject and safely access optional services using ctx.get with an undefined check. ```javascript return { inject: ['requiredService'], apply(ctx) { ctx.requiredService.someMethod() const optionalService = ctx.get('optionalService') if (optionalService !== undefined) optionalService.someMethod() }, } ``` -------------------------------- ### Create and configure hello plugin Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md Define a basic plugin in hello.ts and register it in cordis.yml. ```ts import type { Context } from '@deepseek-ai/cordis' export const name = 'hello' export function apply(ctx: Context) { console.log('[hello] active') } ``` ```yaml - id: hello name: './hello.ts' ``` -------------------------------- ### StreamChunk protocol for tool calls Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md An example of the tool-call block pattern within the StreamChunk protocol. ```ts yield { type: 'block-start', index: 1, blockType: 'tool-call', } yield { type: 'tool-call-delta', index: 1, id: CallId('call-123'), name: 'greet', argumentsDelta: '{"name":"Ada"}', } yield { type: 'block-end', index: 1, block: { type: 'tool-call', id: CallId('call-123'), name: 'greet', arguments: '{"name":"Ada"}', }, } yield { type: 'finish', reason: { kind: 'tool-calls' }, } ``` -------------------------------- ### Common Disposer Implementations Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md Examples of simple synchronous cleanup functions used to release resources. ```ts () => clearTimeout(timer) () => socket.close() () => watcher.close() () => registry.delete(key) () => abortController.abort() ``` -------------------------------- ### Effect ledger registration Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/paper-A-Programming-Paradigm-for-Spatiotemporal-Composability-Yifan-Shi-Wei-Zhang-Tianyi-Cui-Peking University-DeepSeek-AI.md Example of an inverse-first mutation API where mutations register a disposer locally. ```ts const dispose = ctx.effect(() => { const handle = registerTool(tool) return () => unregisterTool(handle) }) ``` -------------------------------- ### Broker-style capability examples Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/paper-A-Programming-Paradigm-for-Spatiotemporal-Composability-Yifan-Shi-Wei-Zhang-Tianyi-Cui-Peking University-DeepSeek-AI.md List of capability types that utilize exclusive binding in the ACRYL framework. ```text model.inference agent.worker retrieval.search memory.write sandbox.executor ``` -------------------------------- ### Dependency injection anti-pattern Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_spec.md An example of bad practice where a plugin imports a specific implementation directly. ```ts import FooMemory from './foo-memory' ``` -------------------------------- ### Loader configuration for Group Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md Example YAML configuration for using the group plugin within a Loader. ```yaml - id: my-group name: '@cordisjs/plugin-group' group: true config: - ... ``` -------------------------------- ### Create hello-plugin file Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/user/develop/basic/index.md A simple plugin that logs a message upon loading. ```ts import type { Context } from '@deepseek-ai/cordis' export const name = 'hello-plugin' export function apply(ctx: Context) { // Required dependencies are ready before apply runs. console.log('[hello-plugin] plugin loaded!') } ``` -------------------------------- ### Launch Web profile with patch Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/cordisplugins/hello-world-plugin-guide.md Executes the Web profile using the specified patch file to apply the ephemeral plugin overlay. ```sh corepack pnpm dsh web --patch /absolute/path/to/acryl/scratch-plugin/cordis.yml ``` -------------------------------- ### Rejecting arbitrary self-editing architecture Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_spec.md An example of an anti-pattern where an agent edits production files directly. ```text agent decides improvement -> edits arbitrary production source files -> hopes application survives ``` -------------------------------- ### Avoid concrete provider imports Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_spec.md An example of an anti-pattern where a consumer imports a concrete provider directly. ```typescript import { ClaudeAdapter } from '../providers/claude' ``` -------------------------------- ### Run profile Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md Shows the command to run a profile. ```sh dsh --profile demo ``` -------------------------------- ### Stable identity warning Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md Example of how missing stable IDs can lead to confusing reconciliation logs. ```text old entry removed + new entry added ``` ```text same entry updated ``` -------------------------------- ### Run the one-shot Headless coding agent Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/development.md Requires DEEPSEEK_API_KEY in the environment or repo-root .env. Invokes the headless profile with a prompt. ```sh pnpm dsh --profile headless "summarize this workspace" ``` -------------------------------- ### ctx.subprocess.spawn Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/subsystems/subprocess.md Starts one managed child process from a fully-specified spec. This seam applies no defaults. ```APIDOC ## spawn(spec) ### Description Starts one managed child process from a fully-specified spec. This seam applies no defaults. ### Method abstract spawn(spec: SubprocessSpawnSpec): SubprocessHandle ### Parameters - **spec** (SubprocessSpawnSpec) - Required - argv, directory, stdio dispositions, grace, cancellation, and environment. ### Returns - **SubprocessHandle** - The live process handle (streams/readers, signalling, outcome promise). ### Example ```ts const handle = ctx.subprocess.spawn({ command: 'ls', args: ['-la'] }); ``` ``` -------------------------------- ### copy(from, id, name?) Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/subsystems/core.zh.md Creates a locally authored preset by copying an existing one whole. Copy is the only authoring write, and the copy is NOT mounted to validate. ```APIDOC ## copy(from, id, name?) ### Description Creates a locally authored preset by copying an existing one whole. Copy is the only authoring write. The copy is NOT mounted to validate. ### Method copy (async) ### Parameters - **from** (string) - Required - The preset the copy starts from; shipped presets are the primary source. - **id** (string) - Required - The new preset's id, which becomes its directory name. - **name** (string) - Optional - Display name for the copy; absent falls back to the id. ### Returns - **Promise** ### Throws - When the source is unknown, the id is unusable or already taken, or the deployment configures no writable root. ``` -------------------------------- ### Allowing build scripts in pnpm-workspace.yaml Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/user/develop/basic/publish.md Configuration to allow a git dependency to execute its prepare script during installation. ```yaml allowBuilds: dsh-hello-plugin: true ``` -------------------------------- ### Emit session title change event Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_system_guide_for_coding_agents.md Example of notifying plugins about a state change using an event. ```ts ctx.emit('session/title-changed', ...) ``` -------------------------------- ### Clone repository with submodules Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/README.md Initializes the repository and its submodules using the recursive clone command. ```bash git clone --recurse-submodules ``` -------------------------------- ### Access stable service keys Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_spec.md Examples of stable keys used to access services within a context. ```typescript ctx.tools ctx.llm ctx.sessions ctx.agents ``` -------------------------------- ### Loader module specifiers Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md Examples of defining the module name using local paths or npm packages. ```yaml name: ./plugin.ts ``` ```yaml name: some-npm-package ``` -------------------------------- ### Event Naming Conventions Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md Examples of preferred namespaced event names versus discouraged generic names. ```text agent/step tool/result stats/report session/updated policy/check ``` ```text update change done ``` -------------------------------- ### list() Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/subsystems/session.md Returns all live sessions in creation order. ```APIDOC ## list() ### Description Returns all live sessions in creation order. ### Method list ### Signature list(): Session[] ### Returns - **sessions** (Session[]) - A fresh array of all live sessions; mutating it does not affect the store. ``` -------------------------------- ### ctx.subprocess.spawnTerminal Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/subsystems/subprocess.md Allocates a real terminal and starts one owned process session. This is the only non-pipe process primitive. ```APIDOC ## spawnTerminal(spec) ### Description Allocates a real terminal and starts one owned process session. This is the only non-pipe process primitive: implementations own terminal byte I/O, foreground groups, signals, and complete session-tree cleanup. ### Method abstract spawnTerminal(spec: SubprocessTerminalSpawnSpec): Promise ### Parameters - **spec** (SubprocessTerminalSpawnSpec) - Required - Fully specified argv, cwd, environment, dimensions, grace, and allocation cancellation. ### Returns - **Promise** - The live terminal handle after allocation succeeds. ### Example ```ts const term = await ctx.subprocess.spawnTerminal({ command: 'bash', cols: 80, rows: 24 }); ``` ``` -------------------------------- ### agent/created (emit) Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/subsystems/core.zh.md Emitted when a fully configured agent and live session were published. Setup is composition-only; agent/session-start is the first startup-driving extension point. Synchronous listener failure vetoes publication, while returned-promise rejection is reported. Detach requested during dispatch waits until every creation listener has observed the stable entry. ```APIDOC ## agent/created (emit) ### Description Emitted when a fully configured agent and live session were published. Setup is composition-only; agent/session-start is the first startup-driving extension point. Synchronous listener failure vetoes publication, while returned-promise rejection is reported. Detach requested during dispatch waits until every creation listener has observed the stable entry. ### Event Name `agent/created` ### Mode emit ### Listener Signature `'agent/created'(this: Scoped, payload: { agent: Agent }): void` ### Payload - **agent** (Agent) - The newly registered agent with its live session and completed setup. ### Notes Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent. ``` -------------------------------- ### Metadata-merged get and interception Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/visuals/cordis-paper-spatiotemporal-composability.html Uses metadata to modify capability usage and intercepts keys to attenuate capabilities. ```text /* (30) metadata-merged get */ get(k, μ)(ι, σ) = σ(k)( μ ⊕ₖ ι(k) ) intercept(k, ν)(ι, σ) = (ι[k↦ι(k)⊕ₖν], σ) ``` -------------------------------- ### Create Package Name Source: https://github.com/acryldev/cordis-meta-framework-spatiotemporal-composability/blob/main/cordis-docs/onboarding/cordis_practical_tutorial_spec.md The name of the project scaffolding CLI package. ```text create-cordis ```