2026-07-05 00:45:06 +08:00
<!-- Generated by scripts/gen-cordis-catalog.ts — do not edit by hand.
Run `pnpm run gen-cordis-catalog` to regenerate. -->
# Cordis Services Catalog
Every `ctx.<key>` service a plugin can call: the exact public interface plus the class JSDoc. This is one axis of the **wiring ** reference a plugin author works against — the events a plugin listens to are the sibling [events catalog ](events.md ), and [core-data-structures/ ](../core-data-structures/core.md ) catalogs the * data structures * these signatures move around. An abstract seam (e.g. `ctx.bash` ) is implemented by a separate package; the interface is what consumers code against.
This file is GENERATED from source (`scripts/gen-cordis-catalog.ts` ) and verified fresh by `pnpm run verify-cordis-catalog` (part of `doc-sync` ) — do not edit it by hand. Signature blocks use a `ts cordis-catalog` fence (skipped by doc-typecheck, since a bare signature is not standalone-compilable). Type names in a signature link to the page that documents them.
The **harness tier ** below (the `@deepseek-ai/dsh-*` packages) is the vocabulary this repo owns. The **inherited tier ** at the end is the cordis-core + loader/hmr/timer `ctx` surface a plugin also sees — pinned vendor source, summarized tersely.
## `ctx.agentLoop` — `AgentLoop`
2026-07-14 02:32:35 +08:00
Concrete agent factory and driver service.
2026-07-05 00:45:06 +08:00
```ts cordis-catalog
2026-07-14 02:32:35 +08:00
create(id: SessionId, options: AgentOptions = {}, meta: Pick<SessionHeader, 'cwd'> = {}): Agent
2026-07-12 08:57:05 +08:00
async createAgent(ownerCtx: Context, options: CreateAgentOptions): Promise<AgentHandle>
async resume(ownerCtx: Context, options: ResumeAgentOptions): Promise<AgentHandle>
2026-07-05 00:45:06 +08:00
` ``
2026-07-16 02:35:31 +08:00
Types: [Agent](../core-data-structures/core.md)
2026-07-19 01:57:18 +08:00
Source: [` packages/core/agent-loop/src/index.ts:407`](../../packages/core/agent-loop/src/index.ts)
2026-07-05 00:45:06 +08:00
## ` ctx.agents` — ` AgentRegistry`
2026-07-11 22:55:40 +08:00
Agent registry (` ctx.agents`): tracks live agents so UI, hook, and orchestrator plugins can find them without depending on the concrete loop package. Agent *creation* is provided by whichever plugin implements the AgentFactory (` @deepseek -ai/dsh-agent-loop`), registered via setFactory.
2026-07-05 00:45:06 +08:00
` ``ts cordis-catalog
2026-07-13 11:58:55 +08:00
setFactory(factory: AgentFactory): () => void
2026-07-11 22:55:40 +08:00
async create(options: CreateAgentOptions): Promise<AgentHandle>
2026-07-05 00:45:06 +08:00
async resume(options: ResumeAgentOptions): Promise<AgentHandle>
2026-07-13 11:58:55 +08:00
register(agent: Agent): () => void
2026-07-14 07:13:42 +08:00
enter(agent: Agent, owner: Agent | undefined): () => void
2026-07-11 22:55:40 +08:00
announce(agent: Agent): void
2026-07-14 01:59:21 +08:00
get(id: SessionId): Agent | undefined
2026-07-14 09:46:05 +08:00
isOwnedBy(id: SessionId, owner: Agent): boolean
2026-07-05 00:45:06 +08:00
list(): Agent[]
2026-07-14 07:13:42 +08:00
roots(): Agent[]
2026-07-05 00:45:06 +08:00
` ``
Types: [Agent](../core-data-structures/core.md)
2026-07-14 07:13:42 +08:00
Source: [` packages/core/agent/src/index.ts:201`](../../packages/core/agent/src/index.ts)
2026-07-05 00:45:06 +08:00
2026-07-09 15:25:18 +08:00
## ` ctx.approval` — ` ApprovalService`
2026-07-14 16:21:41 +08:00
Approval service that applies session policy before answerers and logs every ask/outcome pair to the requesting session. It exposes deterministic policy changes to the model through prompt and pre-step notices.
2026-07-09 16:41:03 +08:00
2026-07-09 15:25:18 +08:00
` ``ts cordis-catalog
async request(req: ApprovalRequest): Promise<ApprovalOutcome>
` ``
2026-07-11 21:37:38 +08:00
Types: [ApprovalOutcome](../core-data-structures/approval.md) · [ApprovalRequest](../core-data-structures/approval.md)
2026-07-13 23:27:00 +08:00
Source: [` packages/ui/user-approval/src/index.ts:229`](../../packages/ui/user-approval/src/index.ts)
2026-07-09 15:25:18 +08:00
2026-07-05 00:45:06 +08:00
## ` ctx.bash` — ` BashExecutor` (abstract seam)
Abstract bash execution service. Subclass, implement the abstract methods, and load the subclass as a plugin — it registers as ` ctx.bash` (one implementation per context; loading a second throws, which is cordis' standard duplicate-service behavior).
2026-07-15 21:08:58 +08:00
Implementations must honor these semantics:
2026-07-05 00:45:06 +08:00
2026-07-15 21:08:58 +08:00
- run rejects only for infrastructure failures. Nonzero exits, timeout kills, and abort kills resolve with a BashRunResult.
- start returns immediately; no timeout applies to background processes. ` done` settles at process close and never rejects; spawn failures settle as ` killed` with the error on stderr.
- BashProcess.readOutput is incremental: consecutive reads never repeat output. Lossy reads report truncation and available spill files.
- Disposal kills all running background processes and awaits their exit.
2026-07-05 00:45:06 +08:00
` ``ts cordis-catalog
abstract resolve(request: BashExecRequest): BashExecSpec
abstract run(spec: BashExecSpec): Promise<BashRunResult>
2026-07-09 21:22:54 +08:00
abstract start(spec: BashExecSpec): BashProcess
2026-07-05 00:45:06 +08:00
` ``
2026-07-09 21:22:54 +08:00
Types: [BashExecRequest](../core-data-structures/bash.md) · [BashExecSpec](../core-data-structures/bash.md) · [BashRunResult](../core-data-structures/bash.md)
2026-07-05 00:45:06 +08:00
2026-07-16 16:45:52 +08:00
Source: [` packages/bash/bash/src/index.ts:49`](../../packages/bash/bash/src/index.ts)
2026-07-12 15:41:42 +08:00
## ` ctx.bashEnv` — ` BashEnvRegistry`
Registry (` ctx.bashEnv`) for trusted, per-execution ` DSH_*` variables. The namespace is rebuilt for every model bash call: ambient ` DSH_*` values are discarded by the executor, then the registry's current snapshot is injected. Built-in shell facts remain owned by the registry itself while plugins can register additional, enumerable facts with effect-scoped disposal.
` ``ts cordis-catalog
register(contributor: BashEnvContributor): () => void
collect(execution: ToolExecution): DshEnvironment
list(): BashEnvVariableInfo[]
` ``
Types: [ToolExecution](../core-data-structures/tools.md)
2026-07-16 16:45:52 +08:00
Source: [` packages/bash/tool-bash/src/index.ts:102`](../../packages/bash/tool-bash/src/index.ts)
2026-07-05 00:45:06 +08:00
2026-07-08 02:17:24 +08:00
## ` ctx.codeRuntime` — ` CodeRuntime` (abstract seam)
2026-07-13 23:27:00 +08:00
Registers one ` ctx.codeRuntime` implementation. Program, budget, abort, and substrate failures resolve in CodeRunResult; only seam misuse rejects. Implementations bridge structured-cloneable bindings while treating programs as hostile peers, isolate runs from one another, and terminate and await in-flight runs during disposal.
2026-07-08 02:17:24 +08:00
` ``ts cordis-catalog
abstract run(request: CodeRunRequest): Promise<CodeRunResult>
` ``
2026-07-08 02:38:47 +08:00
Types: [CodeRunRequest](../core-data-structures/code-runtime.md) · [CodeRunResult](../core-data-structures/code-runtime.md)
2026-07-14 19:05:23 +08:00
Source: [` packages/code-runtime/code-runtime/src/index.ts:30`](../../packages/code-runtime/code-runtime/src/index.ts)
2026-07-08 02:17:24 +08:00
2026-07-05 00:45:06 +08:00
## ` ctx.compact` — ` CompactService` (abstract seam)
2026-07-15 14:47:29 +08:00
Abstract compaction service. Implementations own trigger policy, retention, and summarization, and may consume a separate measurement service. A successful run replaces the selected surface span with one summary node and prevents concurrent compaction of the same session. Load one implementation per context as ` ctx.compact`.
2026-07-05 00:45:06 +08:00
` ``ts cordis-catalog
2026-07-08 20:30:10 +08:00
abstract compactIfNeeded( agent: CompactAgentContext, fullSystemPrompt: string, sessionPrefix: readonly Message[], signal: AbortSignal, ): Promise<CompactionResult | null>
2026-07-14 01:24:20 +08:00
abstract compactRegion( start: number, end: number, agent: CompactAgentContext, signal?: AbortSignal, ): Promise<CompactionResult>
2026-07-05 00:45:06 +08:00
` ``
2026-07-08 20:30:10 +08:00
Types: [Message](../core-data-structures/core.md)
2026-07-15 14:47:29 +08:00
Source: [` packages/compact/compact/src/index.ts:38`](../../packages/compact/compact/src/index.ts)
2026-07-05 00:45:06 +08:00
## ` ctx.fs` — ` FileSystem` (abstract seam)
2026-07-13 23:27:00 +08:00
Abstract filesystem provider. Targets must preserve identity across aliases; reads expose regular UTF-8 text or typed errors, listings are stable and content-free, and mutations are atomic. Optional guards add stale protection without changing the unguarded provider contract.
2026-07-05 00:45:06 +08:00
` ``ts cordis-catalog
2026-07-13 16:31:03 +08:00
abstract resolve(path: string, opts?: { cwd?: string; signal?: AbortSignal }): Promise<FsTarget>
2026-07-05 00:45:06 +08:00
abstract stat(target: FsTarget, signal?: AbortSignal): Promise<FsInfo | undefined>
2026-07-06 13:55:20 +08:00
abstract lstat(path: string, opts?: { cwd?: string }, signal?: AbortSignal): Promise<FsPathInfo | undefined>
2026-07-05 00:45:06 +08:00
abstract readText(target: FsTarget, signal?: AbortSignal): Promise<string>
abstract streamText(target: FsTarget, signal?: AbortSignal): Promise<AsyncIterable<string>>
abstract listDir(target: FsTarget, signal?: AbortSignal): Promise<FsDirEntry[]>
abstract writeText(target: FsTarget, content: string, expected?: FsWriteIntent, signal?: AbortSignal): Promise<FsWriteOutcome>
abstract editText(target: FsTarget, edit: FsEditRequest, expected?: { version: FsVersion }, signal?: AbortSignal): Promise<FsEditOutcome>
` ``
Types: [FsEditOutcome](../core-data-structures/filesystem.md) · [FsEditRequest](../core-data-structures/filesystem.md) · [FsInfo](../core-data-structures/filesystem.md) · [FsTarget](../core-data-structures/filesystem.md) · [FsVersion](../core-data-structures/filesystem.md) · [FsWriteIntent](../core-data-structures/filesystem.md) · [FsWriteOutcome](../core-data-structures/filesystem.md)
2026-07-14 19:50:25 +08:00
Source: [` packages/fs/fs/src/index.ts:80`](../../packages/fs/fs/src/index.ts)
2026-07-05 00:45:06 +08:00
## ` ctx.llm` — ` LlmService`
The abstract ` llm` service: an adapter registry plus a streaming model-call surface, interceptable via the ` llm/stream` waterfall.
` ``ts cordis-catalog
2026-07-14 21:57:52 +08:00
registerAdapter(providers: string[], adapter: LlmAdapter): () => void
2026-07-15 13:33:42 +08:00
listProviders(): LlmProviderInfo[]
async listModels(provider: string): Promise<LlmModelInfo[]>
2026-07-05 00:45:06 +08:00
stream(options: GenerateOptions): AsyncIterable<StreamChunk>
` ``
Types: [GenerateOptions](../core-data-structures/core.md) · [StreamChunk](../core-data-structures/llm-streaming.md)
2026-07-18 11:55:12 +08:00
Source: [` packages/llm/llm/src/index.ts:94`](../../packages/llm/llm/src/index.ts)
2026-07-05 00:45:06 +08:00
2026-07-12 21:03:41 +08:00
## ` ctx.permission` — ` PermissionService`
2026-07-14 12:34:14 +08:00
Owns the deployment's permission presets and their write path. Requires a confining ` ctx.bash` executor and ` ctx.approval`; unmatched knob values are reported as CUSTOM_PRESET, not an error.
2026-07-12 21:03:41 +08:00
` ``ts cordis-catalog
current(events: readonly SessionEvent[]): string
resolve(name: string): PresetSpec
optionOf(name: string): PresetOption
set(session: Session, name: string): void
` ``
Types: [SessionEvent](../core-data-structures/core.md)
2026-07-14 12:34:14 +08:00
Source: [` packages/ui/permission/src/index.ts:94`](../../packages/ui/permission/src/index.ts)
2026-07-12 21:03:41 +08:00
2026-07-09 15:42:37 +08:00
## ` ctx.sandbox` — ` SandboxProvider` (abstract seam)
2026-07-13 23:27:00 +08:00
Abstract process-sandbox service. confine must return enforcing argv or fail closed at wrap or runner-execution time; silent unconfined passthrough is forbidden. Functional probes arbitrate multi-runner chains and may be skipped for a sole candidate, whose own refusal remains the fail-closed end.
2026-07-09 15:42:37 +08:00
` ``ts cordis-catalog
abstract confine(argv: readonly string[], policy: SandboxPolicy): ConfinedArgv
` ``
2026-07-11 21:37:38 +08:00
Types: [ConfinedArgv](../core-data-structures/sandbox.md) · [SandboxPolicy](../core-data-structures/sandbox.md)
2026-07-14 14:37:16 +08:00
Source: [` packages/sandbox/sandbox/src/index.ts:111`](../../packages/sandbox/sandbox/src/index.ts)
2026-07-09 15:42:37 +08:00
2026-07-05 00:45:06 +08:00
## ` ctx.sessionPersistence` — ` SessionPersistence` (abstract seam)
2026-07-13 16:24:32 +08:00
Durable append-only session storage. Implementations preserve contiguous, losslessly JSON-serializable events; append resolves only after durability, and load balances a complete interrupted tail without rewriting committed events.
2026-07-05 00:45:06 +08:00
` ``ts cordis-catalog
2026-07-10 20:52:27 +08:00
abstract locate(meta: SessionHeader): SessionLocation | undefined
2026-07-05 00:45:06 +08:00
abstract create(meta: SessionHeader): Promise<void>
abstract append(id: SessionId, events: readonly SessionEvent[]): Promise<void>
abstract load(id: SessionId): Promise<{ meta: SessionHeader; events: SessionEvent[] }>
abstract list(): Promise<SessionHeader[]>
` ``
Types: [SessionEvent](../core-data-structures/core.md)
2026-07-15 11:12:39 +08:00
Source: [` packages/session-persistence/session-persistence/src/index.ts:42`](../../packages/session-persistence/session-persistence/src/index.ts)
2026-07-05 00:45:06 +08:00
2026-07-10 16:51:19 +08:00
## ` ctx.sessionQuery` — ` SessionQueryService`
2026-07-13 13:44:01 +08:00
Live-preferred logical-corpus exact-read and relationship-tracing service.
2026-07-10 16:51:19 +08:00
` ``ts cordis-catalog
listSessions(): Promise<SessionRecord[]>
async listEvents(sessionId: SessionId): Promise<SessionEventRecord[]>
2026-07-13 13:44:01 +08:00
async traceSession(sessionId: SessionId): Promise<SessionLineageTrace>
async traceEvent(request: SessionEventTraceRequest): Promise<SessionEventTrace>
2026-07-10 16:51:19 +08:00
async readEvent(request: SessionEventReadRequest): Promise<SessionEventWindow>
` ``
2026-07-13 13:44:01 +08:00
Source: [` packages/session-query/session-query/src/index.ts:38`](../../packages/session-query/session-query/src/index.ts)
2026-07-05 00:45:06 +08:00
## ` ctx.sessions` — ` SessionStore`
In-memory session store (` ctx.sessions`).
Persistence is intentionally not implemented here — persistence plugins subscribe to ` session/event` and flush on ` session/flush` / dispose.
` ``ts cordis-catalog
create(id?: SessionId, options?: CreateSessionOptions): Session
prepare(id?: SessionId, options?: CreateSessionOptions): Session
enter(session: Session): () => void
announce(session: Session): void
2026-07-09 01:21:27 +08:00
async flush(session: Session): Promise<void>
2026-07-05 00:45:06 +08:00
get(id: SessionId): Session | undefined
list(): Session[]
2026-07-07 09:04:49 +08:00
fork(source: SessionForkSource, boundary?: number, childSessionId?: SessionId): Session
2026-07-05 00:45:06 +08:00
` ``
2026-07-19 11:36:07 +08:00
Source: [` packages/core/session/src/index.ts:577`](../../packages/core/session/src/index.ts)
2026-07-05 00:45:06 +08:00
2026-07-05 16:50:29 +08:00
## ` ctx.skills` — ` SkillService`
2026-07-10 14:19:06 +08:00
Registry of skill providers. It merges provider catalogs with stable first-wins duplicate handling, exposes sorted model-visible summaries, and loads full skill bodies on demand.
2026-07-05 16:50:29 +08:00
` ``ts cordis-catalog
2026-07-13 11:58:55 +08:00
registerProvider(provider: SkillProvider): () => void
register(skill: SkillRegistration): () => void
2026-07-05 16:50:29 +08:00
async list(options: SkillLookupOptions = {}): Promise<SkillSummary[]>
async get(name: string, options: SkillLookupOptions = {}): Promise<SkillDefinition | undefined>
` ``
2026-07-14 04:32:40 +08:00
Source: [` packages/skill/skill/src/index.ts:141`](../../packages/skill/skill/src/index.ts)
2026-07-05 16:50:29 +08:00
2026-07-13 11:07:27 +08:00
## ` ctx.spillStore` — ` SpillStore` (abstract seam)
2026-07-08 19:20:50 +08:00
2026-07-13 11:07:27 +08:00
Abstract spill storage service. Subclass, implement saveText, and load the subclass as a plugin — it registers as ` ctx.spillStore` (one implementation per context; loading a second throws, cordis' standard duplicate-service behavior).
2026-07-08 19:20:50 +08:00
Semantics every implementation must honor:
2026-07-13 11:07:27 +08:00
- saveText persists the FULL ` content` verbatim and returns an opaque locator, exact byte length, and model-facing retrieval guidance.
2026-07-08 19:20:50 +08:00
- Storage is scoped by the request's SaveTextSpill.owner session; the backend chooses a private (not world-readable) location and a collision-free name derived from — never equal to — the caller's ` suggestedName`.
- ` saveText` REJECTS on a real storage failure (permissions, ENOSPC, backend unavailable); the caller decides how to degrade (the spill policy treats a rejection as best-effort and keeps the inline result).
` ``ts cordis-catalog
abstract saveText(input: SaveTextSpill): Promise<SpillRef>
` ``
2026-07-13 11:07:27 +08:00
Source: [` packages/spill/spill/src/index.ts:45`](../../packages/spill/spill/src/index.ts)
2026-07-08 19:20:50 +08:00
2026-07-05 00:45:06 +08:00
## ` ctx.subagents` — ` SubagentService`
2026-07-12 22:49:46 +08:00
Named provider registry and capability-checked start surface.
2026-07-05 00:45:06 +08:00
` ``ts cordis-catalog
2026-07-13 11:58:55 +08:00
registerProvider(provider: SubagentProvider): () => void
2026-07-05 00:45:06 +08:00
getProvider(name: string): SubagentProvider | undefined
list(): string[]
2026-07-12 22:49:46 +08:00
async start(name: string, request: SubagentStartRequest): Promise<SubagentRun>
2026-07-05 00:45:06 +08:00
` ``
2026-07-18 14:26:14 +08:00
Source: [` packages/subagent/subagent/src/index.ts:153`](../../packages/subagent/subagent/src/index.ts)
2026-07-05 00:45:06 +08:00
## ` ctx.systemPrompt` — ` SystemPrompt`
2026-07-13 16:24:32 +08:00
Registry service for the prompt inputs assembled before each model step.
2026-07-05 00:45:06 +08:00
` ``ts cordis-catalog
2026-07-13 11:58:55 +08:00
section(section: PromptSection): () => void
tools(provider: (context: AssembleContext) => ToolProviderResult): () => void
variable(name: string, provider: (context: AssembleContext) => string | undefined): () => void
2026-07-07 20:48:41 +08:00
async assemble(context: AssembleContext = {}): Promise<PromptAssembly>
2026-07-05 00:45:06 +08:00
` ``
2026-07-14 19:06:25 +08:00
Source: [` packages/core/system-prompt/src/index.ts:209`](../../packages/core/system-prompt/src/index.ts)
2026-07-05 00:45:06 +08:00
2026-07-09 21:22:54 +08:00
## ` ctx.tasks` — ` TaskService`
The ` tasks` service: the runtime-global background task registry. See the module doc for the ownership, isolation, and lifecycle contracts.
` ``ts cordis-catalog
2026-07-09 21:53:48 +08:00
start(spec: TaskStart): TaskId
2026-07-09 21:22:54 +08:00
list(caller?: Agent): TaskSnapshot[]
get(id: TaskId, caller?: Agent): TaskSnapshot
read(id: TaskId, caller?: Agent): TaskRead
2026-07-15 21:45:30 +08:00
kill(id: TaskId, caller?: Agent, reason?: string): 'requested' | 'already-finished'
2026-07-09 21:22:54 +08:00
async wait(id: TaskId, timeoutMs: number, caller?: Agent, signal?: AbortSignal): Promise<TaskSnapshot>
onTaskDone(listener: TaskDoneListener): () => void
attachSurface(name: string): () => void
` ``
Types: [Agent](../core-data-structures/core.md)
2026-07-15 21:45:30 +08:00
Source: [` packages/tasks/tasks/src/index.ts:76`](../../packages/tasks/tasks/src/index.ts)
2026-07-09 21:22:54 +08:00
2026-07-15 14:47:29 +08:00
## ` ctx.tokenMeter` — ` TokenMeterService`
2026-07-16 12:58:07 +08:00
Replay owner for one service-wide estimator and isolated per-session folds.
2026-07-15 14:47:29 +08:00
` ``ts cordis-catalog
2026-07-16 12:58:07 +08:00
measure(session: Session, requestHeader?: EpochHeader): TokenMeasurement
estimateMessage(message: Message): number
2026-07-15 14:47:29 +08:00
` ``
2026-07-16 12:58:07 +08:00
Types: [Message](../core-data-structures/core.md)
2026-07-16 14:38:24 +08:00
Source: [` packages/llm/token-meter/src/index.ts:106`](../../packages/llm/token-meter/src/index.ts)
2026-07-15 14:47:29 +08:00
2026-07-05 00:45:06 +08:00
## ` ctx.tools` — ` ToolRegistry`
2026-07-13 16:24:32 +08:00
Tool registry and execution pipeline. Scoped registrations shadow globals; one visibility resolver feeds presentation, lookup, and dispatch.
2026-07-09 01:21:27 +08:00
2026-07-05 00:45:06 +08:00
` ``ts cordis-catalog
2026-07-13 11:58:55 +08:00
register(definition: ToolDefinition): () => void
restrict(filter: ToolRestriction): () => void
guard(guard: ToolGuard): () => void
2026-07-09 01:21:27 +08:00
get(name: string, scope?: ScopeKey): ToolDefinition | undefined
schemas(scope?: ScopeKey): ToolSchema[]
2026-07-13 14:28:32 +08:00
executionMode(exec: ToolExecutionInput): ToolExecutionMode
2026-07-11 22:55:40 +08:00
async execute(exec: ToolExecutionInput): Promise<ToolExecutionResult>
2026-07-05 00:45:06 +08:00
` ``
2026-07-13 14:28:32 +08:00
Types: [ToolDefinition](../core-data-structures/tools.md) · [ToolExecutionInput](../core-data-structures/tools.md) · [ToolExecutionMode](../core-data-structures/tools.md) · [ToolExecutionResult](../core-data-structures/tools.md)
2026-07-05 00:45:06 +08:00
2026-07-18 14:59:26 +08:00
Source: [` packages/core/tools/src/index.ts:438`](../../packages/core/tools/src/index.ts)
2026-07-05 00:45:06 +08:00
2026-07-05 17:05:33 +08:00
## ` ctx.userInteraction` — ` UserInteractionService`
` ctx.userInteraction`: one active UI provider plus an ` ask()` surface.
` ``ts cordis-catalog
registerProvider(provider: UserInteractionProvider): () => void
async ask(request: AskUserQuestionRequest): Promise<AskUserQuestionAnswer>
` ``
2026-07-09 17:55:01 +08:00
Source: [` packages/ui/user-interaction/src/index.ts:82`](../../packages/ui/user-interaction/src/index.ts)
2026-07-05 00:45:06 +08:00
## ` ctx.web` — ` WebService`
The web access service. Registered as ` ctx.web` (one instance per context).
Selection semantics (resolved at execution time, never order-dependent):
2026-07-14 04:17:38 +08:00
- A configured id that is registered and ` available()` → that provider.
2026-07-05 00:45:06 +08:00
- A configured id not registered → ` WEB_PROVIDER_CONFIGURED_MISSING`.
- A configured id registered but unavailable → ` WEB_PROVIDER_CONFIGURED_UNAVAILABLE`.
- No id configured, exactly one registered usable provider → that provider.
- No id configured, multiple usable providers → ` WEB_PROVIDER_AMBIGUOUS`.
- No id configured, no usable provider → ` WEB_PROVIDER_UNAVAILABLE`.
` ``ts cordis-catalog
registerSearchProvider(provider: WebSearchProvider): () => void
registerFetchProvider(provider: WebFetchProvider): () => void
2026-07-14 04:17:38 +08:00
async search(request: WebSearchRequest, signal?: AbortSignal): Promise<WebSearchResult>
async fetch(request: WebFetchRequest, signal?: AbortSignal): Promise<WebFetchResult>
2026-07-05 00:45:06 +08:00
` ``
2026-07-14 17:57:50 +08:00
Source: [` packages/web/web/src/index.ts:74`](../../packages/web/web/src/index.ts)
2026-07-05 00:45:06 +08:00
2026-07-05 13:29:35 +08:00
## ` ctx.workflows` — ` WorkflowService` (abstract seam)
2026-07-13 23:44:44 +08:00
Workflow execution seam. 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, and ` workflow/end` fires exactly once as the result settles.
2026-07-05 13:29:35 +08:00
` ``ts cordis-catalog
abstract start(request: WorkflowStartRequest): WorkflowRun
` ``
2026-07-13 23:44:44 +08:00
Source: [` packages/workflow/workflow/src/index.ts:159`](../../packages/workflow/workflow/src/index.ts)
2026-07-05 13:29:35 +08:00
2026-07-05 00:45:06 +08:00
## Inherited ` ctx` members (cordis core + loader/hmr/timer)
The framework ` ctx` surface every plugin also sees, beyond the harness services above. This is pinned vendor source ([vendoring policy](../../vendor/README.md)); it is summarized here so the page is a complete picture of what ` ctx` offers, without elevating framework internals to the harness tier's prominence.
2026-07-16 18:12:36 +08:00
- ` ctx.on / ctx.once` — Register an event listener (disposable). ([` vendor/cordis/src/events.ts:34`](../../vendor/cordis/src/events.ts))
- ` ctx.emit / ctx.parallel / ctx.serial / ctx.bail / ctx.waterfall` — Dispatch an event (sync / awaited / first-bail / veto-chain). ([` vendor/cordis/src/events.ts:34`](../../vendor/cordis/src/events.ts))
- ` ctx.plugin / ctx.inject` — Load a plugin / declare required services. ([` vendor/cordis/src/registry.ts:164`](../../vendor/cordis/src/registry.ts))
2026-07-05 00:45:06 +08:00
- ` ctx.effect` — Register a disposable side effect tied to the fiber. ([` vendor/cordis/src/fiber.ts:9`](../../vendor/cordis/src/fiber.ts))
- ` ctx.get / ctx.set / ctx.provide / ctx.accessor / ctx.mixin` — Low-level service-store access and binding. ([` vendor/cordis/src/reflect.ts:7`](../../vendor/cordis/src/reflect.ts))
2026-07-16 18:12:36 +08:00
- ` ctx.extend / ctx.isolate / ctx.intercept` — Derive a child context (scoped services / isolation / interception). ([` vendor/cordis/src/context.ts:42`](../../vendor/cordis/src/context.ts))
2026-07-05 00:45:06 +08:00
- ` ctx.root / ctx.scope / ctx.fiber / ctx.registry / ctx.reflect / ctx.events / ctx.logger` — Ambient handles onto the running context graph. ([` vendor/cordis/src/context.ts:16`](../../vendor/cordis/src/context.ts))
- ` ctx.timer (+ interval / timeout / throttle / debounce / setTimeout / setInterval)` — Disposable timer helpers. The ` timer` key is provided at runtime; the six helpers are mixed onto ctx directly (declared via Pick). ([` vendor/timer/src/index.ts:4`](../../vendor/timer/src/index.ts))
- ` ctx.loader` — The config Loader that booted the app (present under the loader). ([` vendor/loader/src/index.ts:30`](../../vendor/loader/src/index.ts))
- ` ctx.hmr` — The hot-module-reload watcher (present under the hmr plugin). ([` vendor/hmr/src/index.ts:15`](../../vendor/hmr/src/index.ts))