@deepseek-ai/dsh-tool-cordis 0.1.3-alpha.2 → 0.1.5-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.i18n.yaml CHANGED
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/extensions/tool-cordis/README.md
5
- README.md: 574a98ed7fe75e8af108906d80b2cd0c2e043fe8
6
- README.zh.md: d48d7539f8724834a2272eb7bed7e9b353f27edc
5
+ README.md: b6a3de0fec47dea42e0462101186138c256b88d2
6
+ README.zh.md: 374bc9a554d258d305bd1d80e51a5e94884b9d9c
package/README.md CHANGED
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
9
9
 
10
10
  ## Summary
11
11
 
12
- `dsh-tool-cordis` gives the model seven tools over the live Cordis runtime of the current DSH process: inspect what is loaded and what a dynamic package may use, define a package with a host half, a browser half, or both, run it, stop it, and remove it. Packages are versioned — a plugin holds immutable package versions, and the model can append a corrected package and update to it after a failure. Definitions live only in process memory and vanish on DSH restart; nothing here writes repository files, installs packages, or changes `cordis.yml`. It also adds a system-prompt section that teaches the workflow; compose it with `@deepseek-ai/dsh-cordis-host-runner`, the package that runs the sandbox and the run round trip.
12
+ `dsh-tool-cordis` lets a model inspect the live Cordis runtime and create, run, stop, update, or remove temporary dynamic packages with host code, browser code, or both. Package versions are immutable, so a failed package can be corrected by adding a new version and updating the active one. Definitions exist only in process memory and disappear when DSH restarts; the package does not write repository files, install dependencies, or change `cordis.yml`. It also teaches the model this workflow. Compose it with `@deepseek-ai/dsh-cordis-host-runner`, which provides the sandbox and run round trip.
13
13
 
14
14
  ## Table of Contents
15
15
 
package/README.zh.md CHANGED
@@ -9,7 +9,7 @@ kind: "package-reference"
9
9
 
10
10
  ## 概述
11
11
 
12
- `dsh-tool-cordis` 给模型提供七个作用于当前 DSH 进程实时 Cordis 运行时的工具:检查已加载的内容与动态包可用之物,定义包含 host 半、浏览器半或两者的包,运行它、停止它并移除它。包带版本——插件持有若干不可变的包版本,模型在失败后可以追加修正版并更新过去。定义只存在于进程内存中,DSH 重启即消失;本包不写仓库文件、不安装任何包、不改 `cordis.yml`。它还增加一个教这套工作流的系统提示词章节;把它与 `@deepseek-ai/dsh-cordis-host-runner` 一同组合,后者负责沙箱与运行往返。
12
+ `dsh-tool-cordis` 让模型检查实时 Cordis 运行时,并创建、运行、停止、更新或移除包含 host 代码、浏览器代码或两者的临时动态包。包版本不可变,因此包失败后,模型可以添加新版本并更新当前运行的版本。定义只存在于进程内存中,DSH 重启即消失;本包不写仓库文件、不安装依赖,也不改 `cordis.yml`。它还会把这套工作流教给模型。请与 `@deepseek-ai/dsh-cordis-host-runner` 一同组合,后者提供沙箱与运行往返。
13
13
 
14
14
  ## 目录
15
15
 
package/lib/index.js CHANGED
@@ -73,7 +73,7 @@ const SERVICE_API = [
73
73
  description: "caller context that structurally owns the lifecycle."
74
74
  }, {
75
75
  name: "options",
76
- description: "identities, session seed/metadata, loop options, setup, and cancellation."
76
+ description: "identities, optional live parent, session seed/metadata, loop options, setup, and cancellation."
77
77
  }],
78
78
  returns: "the published handle."
79
79
  },
@@ -85,7 +85,7 @@ const SERVICE_API = [
85
85
  description: "caller context that owns load, setup, and the live lifecycle."
86
86
  }, {
87
87
  name: "options",
88
- description: "persisted identity, loop options, setup, and cancellation."
88
+ description: "persisted identity, optional live parent, loop options, setup, and cancellation."
89
89
  }],
90
90
  returns: "the published handle."
91
91
  }
@@ -294,7 +294,7 @@ const SERVICE_API = [
294
294
  methods: [
295
295
  {
296
296
  signature: "currentInitiator(): Agent | undefined",
297
- description: "Read the Agent that initiated the inherited asynchronous driver chain. Use this optional form for logging, tracing, metrics, or host attribution that also supports agentless calls. When a parent creates a child, setup reports the causal parent while `agentCtx.agent` identifies the child.",
297
+ description: "Read the Agent that initiated the inherited asynchronous driver chain. Use this optional form for logging, tracing, metrics, or host attribution that also supports agentless calls. When a parent creates a child, setup reports the causal parent while the setup callback's Agent parameter identifies the child.",
298
298
  parameters: [],
299
299
  returns: "the inherited Agent, or `undefined` outside an initiator boundary and inside an explicit clearing boundary.",
300
300
  throws: ["when this service instance has been disposed."]
@@ -343,7 +343,7 @@ const SERVICE_API = [
343
343
  description: "Create and publish a new agent through the registered factory. Distinct from register (which records an already-constructed agent): this constructs the agent and its session. Rejects if no factory is registered or creation/setup fails. The resolved AgentHandle lets the owner tear down exactly this agent.",
344
344
  parameters: [{
345
345
  name: "options",
346
- description: "shared identity, session seed/metadata, and agent options."
346
+ description: "shared identity, optional live parent, session seed/metadata, and agent options."
347
347
  }],
348
348
  returns: "the handle after setup, rollback-covered publication, and loop start complete."
349
349
  },
@@ -352,13 +352,13 @@ const SERVICE_API = [
352
352
  description: "Load a persisted session and resume an agent on it through the registered factory. Rejects if no factory is registered; the factory rejects if session persistence is not configured or persistence/setup fails.",
353
353
  parameters: [{
354
354
  name: "options",
355
- description: "persisted identity, configuration, and optional setup."
355
+ description: "persisted identity, optional live parent, configuration, and setup."
356
356
  }],
357
357
  returns: "the handle after setup, rollback-covered publication, and loop start complete."
358
358
  },
359
359
  {
360
360
  signature: "register(agent: Agent): () => void",
361
- description: "Register a live agent. Throws if an agent with the same id is already registered. Emits `agent/created` on registration and `agent/disposed` when the calling fiber is disposed — both with the agent's scope carrier (`scopeTarget(agent, agent)`): the subject is the agent in hand, so the emits are scope-filtered regardless of which context invoked `register` (calling through `agent.ctx` scopes EFFECTS; dispatch scoping always requires passing the carrier). Returns the disposer.",
361
+ description: "Register a live agent. Throws if an agent with the same id is already registered. Emits `agent/created` on registration and `agent/disposed` when the calling fiber is disposed — both with the agent's scope carrier (`scopeTarget(agent, agent)`): the subject is the agent in hand, so the emits are scope-filtered regardless of which context invoked `register` (calling through `agent.ctx` scopes EFFECTS; dispatch scoping always requires passing the carrier). The entry is a runtime root; factory-backed creation uses `options.parentAgent` for child ownership. Returns the disposer.",
362
362
  parameters: [{
363
363
  name: "agent",
364
364
  description: "the already-constructed agent to record in the store."
@@ -373,7 +373,7 @@ const SERVICE_API = [
373
373
  description: "the prepared, unpublished agent."
374
374
  }, {
375
375
  name: "owner",
376
- description: "live agent whose scoped context created this agent, or undefined for a top-level runtime root. This is runtime ownership, not the resumed session's durable parent lineage."
376
+ description: "explicitly supplied live runtime owner, or undefined for a top-level runtime root. This is runtime ownership, not the resumed session's durable parent lineage."
377
377
  }],
378
378
  returns: "an idempotent closure that removes this exact entry and emits `agent/disposed` with listener failures contained. When called from a synchronous `agent/created` listener, removal and disposal wait until that creation dispatch unwinds."
379
379
  },
@@ -845,6 +845,15 @@ const SERVICE_API = [
845
845
  }],
846
846
  returns: "the path, or undefined for an unknown id."
847
847
  },
848
+ {
849
+ signature: "fetchBundle(request: Request): Response",
850
+ description: "Serve an advertised revisioned bundle or source map without a Web server. Unknown URLs return 404, unsupported methods return 405, and `HEAD` returns the same immutable headers without a body.",
851
+ parameters: [{
852
+ name: "request",
853
+ description: "shell-carrier request for a `/plugins` resource."
854
+ }],
855
+ returns: "the exact response also exposed by the optional Web route."
856
+ },
848
857
  {
849
858
  signature: "artifactBaseline(id: string): ClientArtifactBaseline | undefined",
850
859
  description: "Filesystem baseline captured before an entry's current bytes were read. HMR compares it with the live files when installing a watch, so a write between startup composition and watch installation cannot disappear into the watcher's initial state.",
@@ -1514,6 +1523,25 @@ const SERVICE_API = [
1514
1523
  ],
1515
1524
  returns: "the full raw content, at most `maxBytes` long."
1516
1525
  },
1526
+ {
1527
+ signature: "abstract readByteRange(target: FsTarget, range: { offset: number; length: number }, signal?: AbortSignal): Promise<Uint8Array>",
1528
+ description: "Read one byte window of the regular file as raw bytes with no decoding or binary rejection: the bytes at `[offset, offset + length)`, shorter when the file ends inside the window and empty when `offset` lies at or past its end. The window is the bound here, not the file: a backend transfers at most `length` bytes of content beyond the prefix it skips to reach `offset` and never buffers the whole file, so the caller's cap on `length` is the guard against unbounded buffering.",
1529
+ parameters: [
1530
+ {
1531
+ name: "target",
1532
+ description: "the resolved target to read."
1533
+ },
1534
+ {
1535
+ name: "range",
1536
+ description: "`offset`, the 0-based first byte, and `length`, the largest byte count; both non-negative integers."
1537
+ },
1538
+ {
1539
+ name: "signal",
1540
+ description: "aborts the read."
1541
+ }
1542
+ ],
1543
+ returns: "the window's bytes, at most `length` long."
1544
+ },
1517
1545
  {
1518
1546
  signature: "abstract listDir(target: FsTarget, signal?: AbortSignal): Promise<FsDirEntry[]>",
1519
1547
  description: "List direct children of a directory in stable name order. Returns resolved child targets plus cheap metadata only; never reads file contents.",
@@ -1588,7 +1616,7 @@ const SERVICE_API = [
1588
1616
  description: "Goal service (`ctx.goals`) backed exclusively by the owning session log.",
1589
1617
  methods: [
1590
1618
  {
1591
- signature: "get(agent: Agent): GoalView | undefined",
1619
+ signature: "@Remote('get') get(agent: Agent): GoalView | undefined",
1592
1620
  description: "Read the current goal for one exact live agent.",
1593
1621
  parameters: [{
1594
1622
  name: "agent",
@@ -3649,11 +3677,11 @@ const SERVICE_API = [
3649
3677
  },
3650
3678
  {
3651
3679
  key: "subagentModelSelection",
3652
- summary: "Singleton settings owner read by delegation tools when an Agent is published.",
3653
- description: "Singleton settings owner read by delegation tools when an Agent is published.",
3680
+ summary: "Singleton settings owner read when delegation tools are composed for a Session.",
3681
+ description: "Singleton settings owner read when delegation tools are composed for a Session.",
3654
3682
  methods: [{
3655
3683
  signature: "current(): SubagentModelSelectionSettings",
3656
- description: "Read a detached selection preference for the next eligible Agent publication.",
3684
+ description: "Read a detached selection preference for the next eligible Session composition.",
3657
3685
  parameters: [],
3658
3686
  returns: "the enabled state and exact allowed routes."
3659
3687
  }]
@@ -4144,7 +4172,7 @@ const SERVICE_API = [
4144
4172
  description: "Replay owner for one service-wide estimator and isolated per-session folds.",
4145
4173
  methods: [{
4146
4174
  signature: "measure(session: Session, requestHeader?: EpochHeader): TokenMeasurement",
4147
- description: "Measure current request pressure and surface through the durable tail.\n\nThe effective envelope's routed provider/model selects the request-image pricing every node is priced under: a route whose adapter declares image pricing charges each retained image its visual tokens plus its model-visible text, while other routes keep the fixed heuristic. Provider usage is reused only when the latest successful call's canonical request envelope matches `requestHeader` and its total is no lower than that call's full route-priced anchor; otherwise the complete envelope and surface are repriced.\n\n`requestHeader` replaces the latest logged envelope for pressure and node pricing; the node set always describes the current session surface. Every call clones those positional nodes, so measurement is O(surface).",
4175
+ description: "Measure current request pressure and surface through the durable tail.\n\nThe effective envelope's routed provider/model selects the request-image pricing every node is priced under: a route whose adapter declares image pricing charges each retained image its visual tokens plus its model-visible text, while other routes keep the fixed heuristic. Provider usage is reused only when the latest successful call's canonical request envelope matches `requestHeader` and its total is no lower than that call's full route-priced anchor; otherwise the complete envelope and surface are repriced. The anchor includes all surface nodes immediately before the assistant message, including inputs admitted after step/start.\n\n`requestHeader` replaces the latest logged envelope for pressure and node pricing; the node set always describes the current session surface. Every call clones those positional nodes, so measurement is O(surface).",
4148
4176
  parameters: [{
4149
4177
  name: "session",
4150
4178
  description: "session to replay through its current durable tail."
@@ -4642,6 +4670,109 @@ const SERVICE_API = [
4642
4670
  }
4643
4671
  ]
4644
4672
  },
4673
+ {
4674
+ key: "workspaceFiles",
4675
+ summary: "Host Remote service over the composed filesystem, confined to one workspace.",
4676
+ description: "Host Remote service over the composed filesystem, confined to one workspace.",
4677
+ methods: [
4678
+ {
4679
+ signature: "@Remote async read(agent: Agent, path: string, range: WorkspaceFileRange, signal: AbortSignal): Promise<WorkspaceFileText>",
4680
+ description: "Read one page of lines from a UTF-8 text file inside the Agent's workspace.",
4681
+ parameters: [
4682
+ {
4683
+ name: "agent",
4684
+ description: "target Agent resolved from the Session identity on the wire."
4685
+ },
4686
+ {
4687
+ name: "path",
4688
+ description: "workspace path, absolute or relative to the workspace root."
4689
+ },
4690
+ {
4691
+ name: "range",
4692
+ description: "the line window; omitted fields take the page defaults."
4693
+ },
4694
+ {
4695
+ name: "signal",
4696
+ description: "caller cancellation."
4697
+ }
4698
+ ],
4699
+ returns: "the page, the file's version at the stat before it, and whether it reaches the last line."
4700
+ },
4701
+ {
4702
+ signature: "@Remote async readBytes(agent: Agent, path: string, range: WorkspaceByteRange, signal: AbortSignal): Promise<WorkspaceFileBytes>",
4703
+ description: "Read one byte window of a regular file inside the Agent's workspace: raw bytes, no text decoding and no binary rejection.",
4704
+ parameters: [
4705
+ {
4706
+ name: "agent",
4707
+ description: "target Agent resolved from the Session identity on the wire."
4708
+ },
4709
+ {
4710
+ name: "path",
4711
+ description: "workspace path, absolute or relative to the workspace root."
4712
+ },
4713
+ {
4714
+ name: "range",
4715
+ description: "the byte window; omitted fields take the window defaults."
4716
+ },
4717
+ {
4718
+ name: "signal",
4719
+ description: "caller cancellation."
4720
+ }
4721
+ ],
4722
+ returns: "the window in base64, the file's version and size at the stat before it, and whether it reaches the last byte."
4723
+ },
4724
+ {
4725
+ signature: "@Remote async stat(agent: Agent, path: string, signal: AbortSignal): Promise<WorkspaceFileStat>",
4726
+ description: "Report one regular file's identity, version, and size without its content.",
4727
+ parameters: [
4728
+ {
4729
+ name: "agent",
4730
+ description: "target Agent resolved from the Session identity on the wire."
4731
+ },
4732
+ {
4733
+ name: "path",
4734
+ description: "workspace path, absolute or relative to the workspace root."
4735
+ },
4736
+ {
4737
+ name: "signal",
4738
+ description: "caller cancellation."
4739
+ }
4740
+ ],
4741
+ returns: "the file's absolute path, current version, and byte size."
4742
+ },
4743
+ {
4744
+ signature: "@Remote async list(agent: Agent, path: string, signal: AbortSignal): Promise<WorkspaceDirectoryListing>",
4745
+ description: "List the direct children of one directory inside the Agent's workspace.",
4746
+ parameters: [
4747
+ {
4748
+ name: "agent",
4749
+ description: "target Agent resolved from the Session identity on the wire."
4750
+ },
4751
+ {
4752
+ name: "path",
4753
+ description: "workspace path, absolute or relative to the workspace root."
4754
+ },
4755
+ {
4756
+ name: "signal",
4757
+ description: "caller cancellation."
4758
+ }
4759
+ ],
4760
+ returns: "the directory's children in the backend's stable name order, bounded by the entry cap."
4761
+ },
4762
+ {
4763
+ signature: "@Remote({ mode: 'stream' }) changes(agent: Agent, signal: AbortSignal): AsyncIterable<WorkspaceFileWatchFrame>",
4764
+ description: "Stream every `fs/observed` observation of a file inside the Agent's workspace. Only Agent filesystem operations report here; the OS is not watched.",
4765
+ parameters: [{
4766
+ name: "agent",
4767
+ description: "target Agent resolved from the Session identity on the wire."
4768
+ }, {
4769
+ name: "signal",
4770
+ description: "generation cancellation."
4771
+ }],
4772
+ returns: "`ready` once the Host observation queue is active and the workspace root is resolved, then queued and live observations in emission order."
4773
+ }
4774
+ ]
4775
+ },
4645
4776
  {
4646
4777
  key: "workspaceRegistry",
4647
4778
  summary: "Durable workspace registry.",
@@ -4836,7 +4967,7 @@ const EVENT_API = [
4836
4967
  mode: "waterfall",
4837
4968
  signature: "'agent/request'(this: Scoped<Agent>, payload: { agent: Agent; turn: number; step: number; signal: AbortSignal }, next: () => Promise<LlmCallConfig>): Promise<LlmCallConfig>",
4838
4969
  summary: "Replace the frozen call configuration.",
4839
- description: "Replace the frozen call configuration. `await next()` yields the config the machine would use (agent options on the first request, the logged header afterwards); return a replacement to switch. Model-visible content must use logged channels; this waterfall cannot mutate messages.",
4970
+ description: "Replace the frozen call configuration. `await next()` yields the config the machine would use (agent options on the first request, the logged header afterwards); return a replacement to switch. On step admission, this runs after assembly and `step/start`, before the system prompt and accepted user batch are committed. Cancellation here or during subsequent `prepareCall()` resolution commits neither. The prepared call capability governs prompt admission. Model-visible content must use logged channels; this waterfall cannot mutate messages.",
4840
4971
  parameters: [{
4841
4972
  name: "payload",
4842
4973
  description: ".signal - the current turn's explicit abort signal. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent."
@@ -5142,6 +5273,17 @@ const EVENT_API = [
5142
5273
  description: "the opaque tool-execution context the decider keys off."
5143
5274
  }]
5144
5275
  },
5276
+ {
5277
+ name: "goal/activation-changed",
5278
+ mode: "emit",
5279
+ signature: "'goal/activation-changed'(payload: GoalActivationChanged): void",
5280
+ summary: "Process-local goal activation changed for one session.",
5281
+ description: "Process-local goal activation changed for one session.",
5282
+ parameters: [{
5283
+ name: "payload",
5284
+ description: "session id and the exact current goal activation, or no goal after a clear."
5285
+ }]
5286
+ },
5145
5287
  {
5146
5288
  name: "goal/changed",
5147
5289
  mode: "emit",
@@ -5391,8 +5533,8 @@ const EVENT_API = [
5391
5533
  name: "tools/ptc-dispatch-log",
5392
5534
  mode: "waterfall",
5393
5535
  signature: "'tools/ptc-dispatch-log'(this: Scoped<ToolRuntime>, dispatch: PtcDispatchLog, next: () => Promise<ContentBlock[]>): Promise<ContentBlock[]>",
5394
- summary: "Allow a listener to replace content in the DURABLE LOG COPY of one `run_code` sub-dispatch outcome before the bridge appends its `tool/code-dispatch` event.",
5395
- description: "Allow a listener to replace content in the DURABLE LOG COPY of one `run_code` sub-dispatch outcome before the bridge appends its `tool/code-dispatch` event. `next()` keeps the content unchanged; a listener may return replacement blocks (e.g. the spill policy's preview + locator for an oversized text result). Only the logged copy is affected — the program already received the complete value, and the model sees neither. A throwing listener is contained: the bridge falls back to logging the original settled content. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent's dispatches.",
5536
+ summary: "Allow a listener to replace content in the DURABLE LOG COPY of one `run_code` sub-dispatch outcome before the bridge appends its `tool/ptc-dispatch` event.",
5537
+ description: "Allow a listener to replace content in the DURABLE LOG COPY of one `run_code` sub-dispatch outcome before the bridge appends its `tool/ptc-dispatch` event. `next()` keeps the content unchanged; a listener may return replacement blocks (e.g. the spill policy's preview + locator for an oversized text result). Only the logged copy is affected — the program already received the complete value, and the model sees neither. A throwing listener is contained: the bridge falls back to logging the original settled content. Scope-filtered dispatch (`@deepseek-ai/dsh-scope`): agent-scoped listeners receive only that agent's dispatches.",
5396
5538
  parameters: [{
5397
5539
  name: "dispatch",
5398
5540
  description: "the parent execution, sub-call identity, and the settled content to log."
@@ -5580,7 +5722,7 @@ const TYPE_API = [
5580
5722
  },
5581
5723
  {
5582
5724
  name: "AgentSetup",
5583
- declaration: "export type AgentSetup = (agentCtx: Context) => AgentSetupCommit | Promise<AgentSetupCommit | void> | void;"
5725
+ declaration: "export type AgentSetup = (agentCtx: Context, agent: Agent) => AgentSetupCommit | Promise<AgentSetupCommit | void> | void;"
5584
5726
  },
5585
5727
  {
5586
5728
  name: "AgentSetupCommit",
@@ -5968,7 +6110,7 @@ const TYPE_API = [
5968
6110
  },
5969
6111
  {
5970
6112
  name: "CreateAgentOptions",
5971
- declaration: "export interface CreateAgentOptions {\n readonly sessionId: SessionId;\n readonly meta?: {\n readonly cwd?: string;\n readonly parentSession?: SessionId;\n readonly isSeeded?: boolean;\n readonly origin?: 'subagent';\n readonly delegationDepth?: number;\n readonly agentPreset?: string;\n };\n readonly inheritedEventCount?: SessionLogOffset;\n readonly seed?: readonly SessionEvent[];\n readonly agentOptions?: AgentOptions;\n readonly signal?: AbortSignal;\n readonly setup?: AgentSetup;\n}"
6113
+ declaration: "export interface CreateAgentOptions {\n readonly sessionId: SessionId;\n readonly parentAgent?: Agent;\n readonly meta?: {\n readonly cwd?: string;\n readonly parentSession?: SessionId;\n readonly isSeeded?: boolean;\n readonly origin?: 'subagent';\n readonly delegationDepth?: number;\n readonly agentPreset?: string;\n };\n readonly inheritedEventCount?: SessionLogOffset;\n readonly seed?: readonly SessionEvent[];\n readonly agentOptions?: AgentOptions;\n readonly signal?: AbortSignal;\n readonly setup?: AgentSetup;\n}"
5972
6114
  },
5973
6115
  {
5974
6116
  name: "CreateGoalRequest",
@@ -6148,7 +6290,7 @@ const TYPE_API = [
6148
6290
  },
6149
6291
  {
6150
6292
  name: "EpochHeader",
6151
- declaration: "export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n system?: string;\n tools?: ToolSchema[];\n}"
6293
+ declaration: "export interface EpochHeader {\n config: LlmCallConfig;\n adapterDefaults?: LlmCallConfigAdapterDefaults;\n tools?: ToolSchema[];\n}"
6152
6294
  },
6153
6295
  {
6154
6296
  name: "FiberState",
@@ -6250,6 +6392,10 @@ const TYPE_API = [
6250
6392
  name: "GoalActivation",
6251
6393
  declaration: "export type GoalActivation = 'armed' | 'disarmed';"
6252
6394
  },
6395
+ {
6396
+ name: "GoalActivationChanged",
6397
+ declaration: "export interface GoalActivationChanged {\n readonly sessionId: SessionId;\n readonly goal?: {\n readonly id: GoalId;\n readonly revision: number;\n readonly activation: GoalActivation;\n };\n}"
6398
+ },
6253
6399
  {
6254
6400
  name: "GoalBlockReason",
6255
6401
  declaration: "export interface GoalBlockReason {\n readonly code: string;\n readonly message: string;\n}"
@@ -6500,7 +6646,7 @@ const TYPE_API = [
6500
6646
  },
6501
6647
  {
6502
6648
  name: "LlmResolvedModelInfo",
6503
- declaration: "export interface LlmResolvedModelInfo extends LlmModelInfo {\n context?: LlmModelContext;\n defaultMaxTokens?: number;\n reasoning?: LlmModelReasoningInfo;\n}"
6649
+ declaration: "export interface LlmResolvedModelInfo extends LlmModelInfo {\n context?: LlmModelContext;\n defaultMaxTokens?: number;\n reasoning?: LlmModelReasoningInfo;\n systemPromptUpdate?: SystemPromptUpdate;\n}"
6504
6650
  },
6505
6651
  {
6506
6652
  name: "LlmRuntime",
@@ -6712,7 +6858,7 @@ const TYPE_API = [
6712
6858
  },
6713
6859
  {
6714
6860
  name: "PreparedLlmCall",
6715
- declaration: "export interface PreparedLlmCall {\n readonly config: LlmCallConfig;\n readonly retryPolicy: ResolvedRetryPolicy;\n readonly context?: LlmModelContext;\n readonly inputModalities?: readonly ModelModality[];\n readonly adapterDefaults: LlmCallConfigAdapterDefaults;\n stream(options: GenerateOptions): AsyncIterable<StreamChunk>;\n}"
6861
+ declaration: "export interface PreparedLlmCall {\n readonly config: LlmCallConfig;\n readonly retryPolicy: ResolvedRetryPolicy;\n readonly context?: LlmModelContext;\n readonly inputModalities?: readonly ModelModality[];\n readonly systemPromptUpdate?: SystemPromptUpdate;\n readonly adapterDefaults: LlmCallConfigAdapterDefaults;\n stream(options: GenerateOptions): AsyncIterable<StreamChunk>;\n}"
6716
6862
  },
6717
6863
  {
6718
6864
  name: "PreparedReferencedMessage",
@@ -6844,7 +6990,7 @@ const TYPE_API = [
6844
6990
  },
6845
6991
  {
6846
6992
  name: "RequestContext",
6847
- declaration: "export interface RequestContext {\n provider: string;\n model: string;\n contextWindow?: number;\n}"
6993
+ declaration: "export interface RequestContext {\n provider: string;\n model: string;\n contextWindow?: number;\n systemPromptUpdate?: SystemPromptUpdate;\n}"
6848
6994
  },
6849
6995
  {
6850
6996
  name: "RequestErrorAction",
@@ -6892,7 +7038,7 @@ const TYPE_API = [
6892
7038
  },
6893
7039
  {
6894
7040
  name: "ResumeAgentOptions",
6895
- declaration: "export interface ResumeAgentOptions {\n readonly resumeSessionId: SessionId;\n readonly agentOptions?: AgentOptions;\n readonly signal?: AbortSignal;\n readonly setup?: AgentSetup;\n}"
7041
+ declaration: "export interface ResumeAgentOptions {\n readonly resumeSessionId: SessionId;\n readonly parentAgent?: Agent;\n readonly agentOptions?: AgentOptions;\n readonly signal?: AbortSignal;\n readonly setup?: AgentSetup;\n}"
6896
7042
  },
6897
7043
  {
6898
7044
  name: "RunnerFailureRule",
@@ -7040,7 +7186,7 @@ const TYPE_API = [
7040
7186
  },
7041
7187
  {
7042
7188
  name: "SessionEvent",
7043
- declaration: "export type SessionEvent<T extends SessionEventType = SessionEventType> = {\n [K in SessionEventType]: {\n type: K;\n seq: SessionSeq;\n time: number;\n data: SessionEventMap[K];\n ignorable?: true;\n } & (K extends SurfaceEventType ? {\n sourceEventSeqs?: SessionSeq[];\n surfaceOp?: SurfaceOp;\n } : object);\n}[T];"
7189
+ declaration: "export type SessionEvent<T extends SessionEventType = SessionEventType> = {\n [K in SessionEventType]: {\n type: K;\n seq: SessionSeq;\n time: number;\n data: SessionEventMap[K];\n ignorable?: true;\n } & (K extends SurfaceEventType ? SurfaceIntent<K> : {\n surfaceOp?: never;\n sourceEventSeqs?: never;\n });\n}[T];"
7044
7190
  },
7045
7191
  {
7046
7192
  name: "SessionEventEntry",
@@ -7048,7 +7194,7 @@ const TYPE_API = [
7048
7194
  },
7049
7195
  {
7050
7196
  name: "SessionEventMap",
7051
- declaration: "export interface SessionEventMap {\n 'turn/start': {\n turn: number;\n };\n 'turn/end': {\n turn: number;\n reason: TurnEndReason;\n };\n 'step/start': {\n turn: number;\n step: number;\n };\n 'step/end': {\n turn: number;\n step: number;\n };\n 'user/message': UserMessage;\n 'assistant/message': {\n turn: number;\n step: number;\n message: AssistantMessage;\n stream: AssistantStreamRecord[];\n usage?: TokenUsage;\n interrupted?: true;\n };\n 'assistant/attempt': {\n turn: number;\n step: number;\n stream: AssistantStreamRecord[];\n };\n 'tool/call': {\n turn: number;\n step: number;\n callId: ToolCallId;\n name: string;\n arguments: string;\n };\n 'tool/result': {\n turn: number;\n step: number;\n message: ToolResultMessage;\n error?: {\n name: string;\n code: string;\n };\n meta?: JsonValue;\n };\n 'request/header': {\n header: EpochHeader;\n reason: RequestHeaderReason;\n startsSeries?: true;\n };\n 'request/context': RequestContext;\n 'session/end-seed': {\n inherited?: true;\n };\n}"
7197
+ declaration: "export interface SessionEventMap {\n 'turn/start': {\n turn: number;\n };\n 'turn/end': {\n turn: number;\n reason: TurnEndReason;\n };\n 'step/start': {\n turn: number;\n step: number;\n };\n 'step/end': {\n turn: number;\n step: number;\n };\n 'user/message': UserMessage;\n 'system/message': {\n turn: number;\n step: number;\n message: SystemMessage;\n };\n 'assistant/message': {\n turn: number;\n step: number;\n message: AssistantMessage;\n stream: AssistantStreamRecord[];\n usage?: TokenUsage;\n interrupted?: true;\n };\n 'assistant/attempt': {\n turn: number;\n step: number;\n stream: AssistantStreamRecord[];\n };\n 'tool/call': {\n turn: number;\n step: number;\n callId: ToolCallId;\n name: string;\n arguments: string;\n };\n 'tool/result': {\n turn: number;\n step: number;\n message: ToolResultMessage;\n error?: {\n name: string;\n code: string;\n };\n meta?: JsonValue;\n };\n 'request/header': {\n header: EpochHeader;\n reason: RequestHeaderReason;\n startsSeries?: true;\n };\n 'request/context': RequestContext;\n 'session/end-seed': {\n inherited?: true;\n };\n}"
7052
7198
  },
7053
7199
  {
7054
7200
  name: "SessionEventMetadataFilter",
@@ -7444,16 +7590,12 @@ const TYPE_API = [
7444
7590
  },
7445
7591
  {
7446
7592
  name: "SessionWireEvent",
7447
- declaration: "export interface SessionWireEvent {\n readonly type: string;\n readonly seq: number;\n readonly time: number;\n readonly data: JsonValue;\n readonly ignorable?: true;\n readonly sourceEventSeqs?: number[];\n readonly surfaceOp?: SessionWireSurfaceOp;\n}"
7593
+ declaration: "export interface SessionWireEvent {\n readonly type: string;\n readonly seq: number;\n readonly time: number;\n readonly data: JsonValue;\n readonly ignorable?: true;\n readonly sourceEventSeqs?: JsonValue;\n readonly surfaceOp?: JsonValue;\n}"
7448
7594
  },
7449
7595
  {
7450
7596
  name: "SessionWireHeader",
7451
7597
  declaration: "export interface SessionWireHeader {\n readonly version: number;\n readonly id: SessionId;\n readonly createdAt: number;\n readonly cwd?: string;\n readonly parentSession?: SessionId;\n readonly isSeeded: boolean;\n readonly origin?: 'subagent';\n readonly delegationDepth?: number;\n readonly agentPreset?: string;\n}"
7452
7598
  },
7453
- {
7454
- name: "SessionWireSurfaceOp",
7455
- declaration: "export type SessionWireSurfaceOp = 'append' | {\n readonly op: 'replace';\n readonly start: number;\n readonly end: number;\n};"
7456
- },
7457
7599
  {
7458
7600
  name: "SettingsApplies",
7459
7601
  declaration: "export type SettingsApplies = 'live' | 'restart';"
@@ -7780,11 +7922,11 @@ const TYPE_API = [
7780
7922
  },
7781
7923
  {
7782
7924
  name: "SurfaceEvent",
7783
- declaration: "export type SurfaceEvent = SessionEvent<SurfaceEventType> & {\n surfaceOp: SurfaceOp;\n};"
7925
+ declaration: "export type SurfaceEvent = SessionEvent<SurfaceEventType>;"
7784
7926
  },
7785
7927
  {
7786
7928
  name: "SurfaceEventType",
7787
- declaration: "export type SurfaceEventType = 'user/message' | 'assistant/message' | 'tool/result';"
7929
+ declaration: "export type SurfaceEventType = 'system/message' | 'user/message' | 'assistant/message' | 'tool/result';"
7788
7930
  },
7789
7931
  {
7790
7932
  name: "SurfaceIntent",
@@ -7792,12 +7934,20 @@ const TYPE_API = [
7792
7934
  },
7793
7935
  {
7794
7936
  name: "SurfaceOp",
7795
- declaration: "export type SurfaceOp = 'append' | {\n op: 'replace';\n start: SessionSeq;\n end: SessionSeq;\n};"
7937
+ declaration: "export type SurfaceOp = 'append' | {\n op: 'replace';\n startSeq: SessionSeq;\n endSeq: SessionSeq;\n};"
7938
+ },
7939
+ {
7940
+ name: "SystemMessage",
7941
+ declaration: "export interface SystemMessage extends Message {\n readonly role: 'system';\n readonly source: MessageSourceMap['plugin'];\n}"
7796
7942
  },
7797
7943
  {
7798
7944
  name: "SystemPrompt",
7799
7945
  declaration: "export class SystemPrompt extends Service {\n static Config: z<Config>;\n constructor(ctx: Context, config: Config);\n section(section: PromptSection): () => void;\n getSectionOrder(name: PromptSectionOrderName): number;\n getContextOrder(name: PromptContextOrderName): number;\n context(context: PromptContext): () => void;\n suppressRuntimeContext(): () => void;\n tools(provider: (context: AssembleContext) => ToolProviderResult): () => void;\n variable(name: string, provider: (context: AssembleContext) => string | undefined): () => void;\n async assemble(context: AssembleContext = {}): Promise<PromptAssembly>;\n}"
7800
7946
  },
7947
+ {
7948
+ name: "SystemPromptUpdate",
7949
+ declaration: "export type SystemPromptUpdate = 'in-history';"
7950
+ },
7801
7951
  {
7802
7952
  name: "TableKeyOf",
7803
7953
  declaration: "export type TableKeyOf<S extends DomainSpec, N extends keyof S['tables']> = S['tables'][N] extends DomainTableSpec<infer K> ? K : never;"
@@ -8120,7 +8270,7 @@ const TYPE_API = [
8120
8270
  },
8121
8271
  {
8122
8272
  name: "TypertRemoteEventContext",
8123
- declaration: "export interface TypertRemoteEventContext {\n readonly value: Context;\n readonly subject: object;\n}"
8273
+ declaration: "export interface TypertRemoteEventContext {\n readonly value: Context;\n readonly subject: object;\n readonly agentId: string;\n}"
8124
8274
  },
8125
8275
  {
8126
8276
  name: "TypertRemoteEventDispatch",
@@ -8346,6 +8496,10 @@ const TYPE_API = [
8346
8496
  name: "WorkspaceBaseline",
8347
8497
  declaration: "export interface WorkspaceBaseline {\n readonly items: readonly WorkspaceView[];\n readonly archivedSessionIds: readonly SessionId[];\n}"
8348
8498
  },
8499
+ {
8500
+ name: "WorkspaceByteRange",
8501
+ declaration: "export interface WorkspaceByteRange {\n readonly offset?: number;\n readonly length?: number;\n}"
8502
+ },
8349
8503
  {
8350
8504
  name: "WorkspaceCreateRequest",
8351
8505
  declaration: "export interface WorkspaceCreateRequest {\n readonly path: string;\n}"
@@ -8362,6 +8516,38 @@ const TYPE_API = [
8362
8516
  name: "WorkspaceDeleteValue",
8363
8517
  declaration: "export interface WorkspaceDeleteValue {\n readonly deleted: true;\n}"
8364
8518
  },
8519
+ {
8520
+ name: "WorkspaceDirectoryEntry",
8521
+ declaration: "export interface WorkspaceDirectoryEntry {\n readonly name: string;\n readonly type: 'file' | 'directory' | 'other';\n readonly size?: number;\n}"
8522
+ },
8523
+ {
8524
+ name: "WorkspaceDirectoryListing",
8525
+ declaration: "export interface WorkspaceDirectoryListing {\n readonly path: string;\n readonly entries: readonly WorkspaceDirectoryEntry[];\n readonly truncated: boolean;\n}"
8526
+ },
8527
+ {
8528
+ name: "WorkspaceFileBytes",
8529
+ declaration: "export interface WorkspaceFileBytes extends WorkspaceFileStat {\n readonly offset: number;\n readonly data: string;\n readonly eof: boolean;\n}"
8530
+ },
8531
+ {
8532
+ name: "WorkspaceFileChange",
8533
+ declaration: "export type WorkspaceFileChange = {\n readonly absolutePath: string;\n readonly version: string;\n} | {\n readonly absolutePath: string;\n readonly absent: true;\n};"
8534
+ },
8535
+ {
8536
+ name: "WorkspaceFileRange",
8537
+ declaration: "export interface WorkspaceFileRange {\n readonly offset?: number;\n readonly limit?: number;\n}"
8538
+ },
8539
+ {
8540
+ name: "WorkspaceFileStat",
8541
+ declaration: "export interface WorkspaceFileStat {\n readonly absolutePath: string;\n readonly version: string;\n readonly bytes?: number;\n}"
8542
+ },
8543
+ {
8544
+ name: "WorkspaceFileText",
8545
+ declaration: "export interface WorkspaceFileText extends WorkspaceFileStat {\n readonly offset: number;\n readonly text: string;\n readonly lines: number;\n readonly eof: boolean;\n}"
8546
+ },
8547
+ {
8548
+ name: "WorkspaceFileWatchFrame",
8549
+ declaration: "export type WorkspaceFileWatchFrame = {\n readonly kind: 'ready';\n} | {\n readonly kind: 'change';\n readonly change: WorkspaceFileChange;\n};"
8550
+ },
8365
8551
  {
8366
8552
  name: "WorkspaceFollowFrame",
8367
8553
  declaration: "export type WorkspaceFollowFrame = {\n readonly type: 'baseline';\n readonly value: WorkspaceBaseline;\n} | WorkspaceFollowIncrement;"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-tool-cordis",
3
3
  "description": "Self-referential cordis toolset: inspect the live runtime, mount and dispose model-written plugins",
4
- "version": "0.1.3-alpha.2",
4
+ "version": "0.1.5-alpha.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -27,24 +27,24 @@
27
27
  ],
28
28
  "license": "MIT",
29
29
  "peerDependencies": {
30
- "@deepseek-ai/dsh-cordis-host-runner": "^0.1.3-alpha.2",
31
- "@deepseek-ai/dsh-agent": "^0.1.3-alpha.2",
32
- "@deepseek-ai/dsh-llm": "^0.1.3-alpha.2",
33
- "@deepseek-ai/dsh-scope": "^0.1.3-alpha.2",
34
- "@deepseek-ai/dsh-session": "^0.1.3-alpha.2",
35
- "@deepseek-ai/dsh-system-prompt": "^0.1.3-alpha.2",
36
- "@deepseek-ai/dsh-tools": "^0.1.3-alpha.2",
37
- "@deepseek-ai/cordis": "^4.0.2"
30
+ "@deepseek-ai/dsh-cordis-host-runner": "^0.1.5-alpha.1",
31
+ "@deepseek-ai/dsh-agent": "^0.1.5-alpha.1",
32
+ "@deepseek-ai/dsh-llm": "^0.1.5-alpha.1",
33
+ "@deepseek-ai/dsh-scope": "^0.1.5-alpha.1",
34
+ "@deepseek-ai/dsh-session": "^0.1.5-alpha.1",
35
+ "@deepseek-ai/dsh-system-prompt": "^0.1.5-alpha.1",
36
+ "@deepseek-ai/cordis": "^4.0.2",
37
+ "@deepseek-ai/dsh-tools": "^0.1.5-alpha.1"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@deepseek-ai/cordis-plugin-loader": "^1.0.3",
41
- "@deepseek-ai/dsh-agent": "^0.1.3-alpha.2",
42
- "@deepseek-ai/dsh-llm": "^0.1.3-alpha.2",
43
- "@deepseek-ai/dsh-scope": "^0.1.3-alpha.2",
44
- "@deepseek-ai/dsh-session": "^0.1.3-alpha.2",
45
- "@deepseek-ai/dsh-cordis-host-runner": "^0.1.3-alpha.2",
46
- "@deepseek-ai/dsh-system-prompt": "^0.1.3-alpha.2",
47
- "@deepseek-ai/dsh-tools": "^0.1.3-alpha.2",
41
+ "@deepseek-ai/dsh-cordis-host-runner": "^0.1.5-alpha.1",
42
+ "@deepseek-ai/dsh-llm": "^0.1.5-alpha.1",
43
+ "@deepseek-ai/dsh-session": "^0.1.5-alpha.1",
44
+ "@deepseek-ai/dsh-agent": "^0.1.5-alpha.1",
45
+ "@deepseek-ai/dsh-scope": "^0.1.5-alpha.1",
46
+ "@deepseek-ai/dsh-system-prompt": "^0.1.5-alpha.1",
47
+ "@deepseek-ai/dsh-tools": "^0.1.5-alpha.1",
48
48
  "@deepseek-ai/cordis": "^4.0.2"
49
49
  }
50
50
  }