diff options
| author | Adam Malczewski <[email protected]> | 2026-06-25 11:32:14 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-25 11:32:14 +0900 |
| commit | 0b154bdad4f75a091db3ca46424abd17fbbc23ff (patch) | |
| tree | c9c0f1feb7a46fc0a4e89f7d266b87efb3c027bf /packages/kernel/src | |
| parent | b870855aa7a3d8df963a36d0b5323dfcd642bcee (diff) | |
| download | dispatch-0b154bdad4f75a091db3ca46424abd17fbbc23ff.tar.gz dispatch-0b154bdad4f75a091db3ca46424abd17fbbc23ff.zip | |
feat(ssh): wave 0 — kernel contract seam (computerId)
Add additive optional `computerId` field to ToolExecuteContext + RunTurnInput.
The kernel never interprets it (forwards verbatim to tools, like cwd) — it never
enters the model prompt (no prompt-cache impact). When omitted/undefined,
execution is LOCAL (today's behavior), so this is fully backward compatible.
This is the orchestrator-authored seam (ORCHESTRATOR.md §2a) that lets Wave 1's
producers (wire Computer types, exec-backend contract) and the consumer
(kernel runtime threading) run in parallel against a fixed type.
Refs: notes/ssh-support-plan.md (decisions resolved in §0.5/§13).
No merge or push.
Diffstat (limited to 'packages/kernel/src')
| -rw-r--r-- | packages/kernel/src/contracts/runtime.ts | 11 | ||||
| -rw-r--r-- | packages/kernel/src/contracts/tool.ts | 12 |
2 files changed, 23 insertions, 0 deletions
diff --git a/packages/kernel/src/contracts/runtime.ts b/packages/kernel/src/contracts/runtime.ts index 02fc446..03e62c2 100644 --- a/packages/kernel/src/contracts/runtime.ts +++ b/packages/kernel/src/contracts/runtime.ts @@ -85,6 +85,17 @@ export interface RunTurnInput { readonly cwd?: string; /** + * The computer to execute this turn's tools on (SSH support). Omitted/undefined + * = LOCAL (today's behavior). When set, it is an SSH config alias; the kernel + * does NOT interpret it — it forwards the value verbatim to each + * `ToolExecuteContext.computerId`, exactly like `cwd`. It never enters the + * model prompt, so it does not affect prompt caching. Tools resolve their + * execution backend (local vs. remote) from this; see + * `notes/ssh-support-plan.md`. + */ + readonly computerId?: string; + + /** * Optional logger for structured span instrumentation. The runtime opens * turn/step/tool-call spans using this logger. If omitted, no spans are * emitted (backward-compatible with callers that don't yet pass a logger). diff --git a/packages/kernel/src/contracts/tool.ts b/packages/kernel/src/contracts/tool.ts index d5a835c..589fbd0 100644 --- a/packages/kernel/src/contracts/tool.ts +++ b/packages/kernel/src/contracts/tool.ts @@ -78,6 +78,18 @@ export interface ToolExecuteContext { * a tool has no conversation scope (e.g. a global tool). */ readonly conversationId?: string; + + /** + * The computer this tool-call executes on (SSH support). When + * omitted/undefined, execution is LOCAL (today's behavior — the tool uses + * the local node fs/child_process). When set, it is an SSH config alias + * (see `notes/ssh-support-plan.md` §3); a tool resolves a remote + * `ExecBackend` for it via its injected resolver. The kernel never + * interprets it — it forwards the value verbatim from + * `RunTurnInput.computerId`, exactly like `cwd`. It never enters the model + * prompt, so it does not affect prompt caching. + */ + readonly computerId?: string; } /** |
