@archmax-ai/harness 0.3.2 → 0.4.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.
Files changed (120) hide show
  1. package/README.md +3 -1
  2. package/dist/assembly/compose.d.ts +40 -3
  3. package/dist/assembly/compose.js +85 -8
  4. package/dist/assembly/compose.js.map +1 -1
  5. package/dist/assembly/delegation-registry.js +5 -2
  6. package/dist/assembly/delegation-registry.js.map +1 -1
  7. package/dist/assembly/image-reads.d.ts +53 -0
  8. package/dist/assembly/image-reads.js +163 -0
  9. package/dist/assembly/image-reads.js.map +1 -0
  10. package/dist/assembly/index.d.ts +21 -0
  11. package/dist/assembly/index.js +7 -1
  12. package/dist/assembly/index.js.map +1 -1
  13. package/dist/assembly/plain.js +10 -4
  14. package/dist/assembly/plain.js.map +1 -1
  15. package/dist/authoring-skill/archmax-harness/references/backend-integration.md +59 -1
  16. package/dist/authoring-skill/archmax-harness/references/hook-and-test-scripts.md +27 -1
  17. package/dist/authoring-skill/archmax-harness/references/workflow-schema.md +71 -22
  18. package/dist/authoring-skill/archmax-harness/references/workflow-yaml.md +24 -5
  19. package/dist/core/binary-read.d.ts +44 -0
  20. package/dist/core/binary-read.js +93 -0
  21. package/dist/core/binary-read.js.map +1 -0
  22. package/dist/core/binary-types.d.ts +19 -0
  23. package/dist/core/binary-types.js +54 -0
  24. package/dist/core/binary-types.js.map +1 -0
  25. package/dist/core/file-operations.d.ts +43 -0
  26. package/dist/core/file-operations.js +368 -0
  27. package/dist/core/file-operations.js.map +1 -0
  28. package/dist/core/path-mapping.d.ts +17 -3
  29. package/dist/core/path-mapping.js +32 -1
  30. package/dist/core/path-mapping.js.map +1 -1
  31. package/dist/core/platform-prompt.generated.js +1 -1
  32. package/dist/core/platform-prompt.generated.js.map +1 -1
  33. package/dist/core/prompt.d.ts +27 -0
  34. package/dist/core/prompt.js +65 -5
  35. package/dist/core/prompt.js.map +1 -1
  36. package/dist/core/raw-download.d.ts +16 -0
  37. package/dist/core/raw-download.js +56 -0
  38. package/dist/core/raw-download.js.map +1 -0
  39. package/dist/core/session-zone.d.ts +9 -1
  40. package/dist/core/session-zone.js +15 -0
  41. package/dist/core/session-zone.js.map +1 -1
  42. package/dist/core/tool-context.d.ts +27 -0
  43. package/dist/core/tool-context.js +14 -0
  44. package/dist/core/tool-context.js.map +1 -0
  45. package/dist/core/tool-telemetry.js +2 -1
  46. package/dist/core/tool-telemetry.js.map +1 -1
  47. package/dist/core/workspace-context.js +1 -0
  48. package/dist/core/workspace-context.js.map +1 -1
  49. package/dist/core/workspace-router.d.ts +30 -1
  50. package/dist/core/workspace-router.js +80 -3
  51. package/dist/core/workspace-router.js.map +1 -1
  52. package/dist/index.d.ts +11 -1
  53. package/dist/index.js +3 -1
  54. package/dist/index.js.map +1 -1
  55. package/dist/kernel/kernel.js +198 -119
  56. package/dist/kernel/kernel.js.map +1 -1
  57. package/dist/machine/allow.d.ts +22 -0
  58. package/dist/machine/allow.js +47 -15
  59. package/dist/machine/allow.js.map +1 -1
  60. package/dist/machine/lint-spec.js +12 -3
  61. package/dist/machine/lint-spec.js.map +1 -1
  62. package/dist/machine/machine.d.ts +15 -1
  63. package/dist/machine/machine.js +43 -8
  64. package/dist/machine/machine.js.map +1 -1
  65. package/dist/machine/spec-schema.js +14 -0
  66. package/dist/machine/spec-schema.js.map +1 -1
  67. package/dist/machine/tool-names.d.ts +27 -7
  68. package/dist/machine/tool-names.js +43 -13
  69. package/dist/machine/tool-names.js.map +1 -1
  70. package/dist/machine/tool-paths.d.ts +64 -0
  71. package/dist/machine/tool-paths.js +155 -0
  72. package/dist/machine/tool-paths.js.map +1 -0
  73. package/dist/public/spec.d.ts +11 -1
  74. package/dist/public/spec.js +10 -1
  75. package/dist/public/spec.js.map +1 -1
  76. package/dist/validate/validate.js +10 -5
  77. package/dist/validate/validate.js.map +1 -1
  78. package/dist/workflow/agent-tools.d.ts +20 -1
  79. package/dist/workflow/agent-tools.js +35 -1
  80. package/dist/workflow/agent-tools.js.map +1 -1
  81. package/dist/workflow/control-tools.d.ts +4 -1
  82. package/dist/workflow/control-tools.js +16 -9
  83. package/dist/workflow/control-tools.js.map +1 -1
  84. package/dist/workflow/governance.d.ts +2 -0
  85. package/dist/workflow/governance.js +1 -0
  86. package/dist/workflow/governance.js.map +1 -1
  87. package/dist/workflow/middleware.d.ts +2 -0
  88. package/dist/workflow/middleware.js +27 -12
  89. package/dist/workflow/middleware.js.map +1 -1
  90. package/dist/workflow/on-error.js +3 -2
  91. package/dist/workflow/on-error.js.map +1 -1
  92. package/dist/workflow/parks.js +5 -5
  93. package/dist/workflow/parks.js.map +1 -1
  94. package/dist/workflow/render-prompt.d.ts +2 -0
  95. package/dist/workflow/render-prompt.js +9 -3
  96. package/dist/workflow/render-prompt.js.map +1 -1
  97. package/dist/workflow/returns-check.d.ts +35 -0
  98. package/dist/workflow/returns-check.js +10 -0
  99. package/dist/workflow/returns-check.js.map +1 -0
  100. package/dist/workflow/signature-checks.d.ts +26 -1
  101. package/dist/workflow/signature-checks.js +35 -10
  102. package/dist/workflow/signature-checks.js.map +1 -1
  103. package/dist/workflow/state.d.ts +75 -1
  104. package/dist/workflow/state.js +83 -0
  105. package/dist/workflow/state.js.map +1 -1
  106. package/dist/workflow/sub-workflow.d.ts +16 -5
  107. package/dist/workflow/sub-workflow.js +84 -37
  108. package/dist/workflow/sub-workflow.js.map +1 -1
  109. package/dist/workflow/tool-service.js +57 -10
  110. package/dist/workflow/tool-service.js.map +1 -1
  111. package/dist/workflow/turn-boundary.d.ts +8 -7
  112. package/dist/workflow/turn-boundary.js +10 -9
  113. package/dist/workflow/turn-boundary.js.map +1 -1
  114. package/dist/workflow/workflow-tools.js +5 -1
  115. package/dist/workflow/workflow-tools.js.map +1 -1
  116. package/package.json +1 -1
  117. package/skills/archmax-harness/references/backend-integration.md +59 -1
  118. package/skills/archmax-harness/references/hook-and-test-scripts.md +27 -1
  119. package/skills/archmax-harness/references/workflow-schema.md +71 -22
  120. package/skills/archmax-harness/references/workflow-yaml.md +24 -5
@@ -15,12 +15,26 @@ import type { BackendProtocolV2 } from "deepagents";
15
15
  * agent-visible listings, so it is stripped on the way out.
16
16
  *
17
17
  * Inbound: `/x` → `/<prefix>/x`. Outbound: every `path` a result carries
18
- * (`ls`/`glob` entries, `grep` matches, `write`/`edit` results) is mapped back.
18
+ * (`ls`/`glob` entries, `grep` matches, `write`/`edit`/`delete` results,
19
+ * download and upload responses) is mapped back.
19
20
  * A result path that does not start with the prefix is left untouched — the
20
21
  * inner backend is free to report paths we did not ask about.
21
22
  */
22
23
  /** The prefix in effect for a call: a fixed string, or resolved per call. */
23
24
  export type PrefixResolver = () => string | undefined;
25
+ /**
26
+ * A mapped backend. The protocol's optional methods stay optional — Deep Agents
27
+ * feature-detects them — so each is present only where it can answer every path
28
+ * it is asked about, and none throws for want of support:
29
+ *
30
+ * - `downloadFiles` is always present: the wrapped store's own when it has one,
31
+ * else read through `readRaw` (`core/raw-download.ts`), exact bytes or an error.
32
+ * - `uploadFiles` is present when the wrapped store has it, or on a read-only
33
+ * mount, which refuses every file.
34
+ * - `delete` is always present; a store without it answers an error, as
35
+ * `CompositeBackend` does.
36
+ */
37
+ export type MappedBackend = BackendProtocolV2 & Required<Pick<BackendProtocolV2, "downloadFiles" | "delete">>;
24
38
  /**
25
39
  * Wrap `backend` so it is addressed under `prefix` from the outside, mapping
26
40
  * paths in both directions. `prefix` may be a resolver, returning `undefined`
@@ -35,7 +49,7 @@ export type PrefixResolver = () => string | undefined;
35
49
  export declare function mountSubtree(backend: BackendProtocolV2, prefix: string | PrefixResolver, options?: {
36
50
  passthrough?: (relPath: string, prefix: string) => boolean;
37
51
  /**
38
- * Refuse `write`/`edit` at the mount instead of delegating. Read-only is a
52
+ * Refuse `write`/`edit`/`uploadFiles`/`delete` at the mount instead of delegating. Read-only is a
39
53
  * property of the mount, so an authored mount cannot be written through even
40
54
  * by a caller that bypasses governance — the kernel's `zone.read-only` rule
41
55
  * remains the agent-facing diagnostic, not the only enforcement.
@@ -49,4 +63,4 @@ export declare function mountSubtree(backend: BackendProtocolV2, prefix: string
49
63
  * which is exactly the confusion that makes it retry with invented paths.
50
64
  */
51
65
  displayPrefix?: string;
52
- }): BackendProtocolV2;
66
+ }): MappedBackend;
@@ -1,3 +1,4 @@
1
+ import { downloadViaReadRaw } from "./raw-download.js";
1
2
  import { normalizeRelPath } from "./workspace.js";
2
3
  function relPrefix(prefix) {
3
4
  return normalizeRelPath(prefix).replace(/\/+$/, "");
@@ -59,7 +60,7 @@ export function mountSubtree(backend, prefix, options = {}) {
59
60
  return hadSlash ? `/${stripped}` : stripped;
60
61
  };
61
62
  const mapFiles = (files, active) => files?.map((file) => ({ ...file, path: mapOut(file.path, active) }));
62
- return {
63
+ const mapped = {
63
64
  async ls(path) {
64
65
  const active = prefixFor(path);
65
66
  const res = await backend.ls(mapIn(path, active));
@@ -102,7 +103,37 @@ export function mountSubtree(backend, prefix, options = {}) {
102
103
  const res = await backend.edit(mapIn(filePath, active), oldString, newString, replaceAll);
103
104
  return res.path === undefined ? res : { ...res, path: mapOut(res.path, active) };
104
105
  },
106
+ // Raw-byte transfer: the store's own channel, else `readRaw` path by path.
107
+ async downloadFiles(paths) {
108
+ const actives = paths.map(prefixFor);
109
+ const inner = paths.map((path, i) => mapIn(path, actives[i]));
110
+ const res = backend.downloadFiles
111
+ ? await backend.downloadFiles(inner)
112
+ : await Promise.all(inner.map((path) => downloadViaReadRaw(backend, path)));
113
+ return res.map((entry, i) => ({ ...entry, path: mapOut(entry.path, actives[i]) }));
114
+ },
115
+ async delete(filePath) {
116
+ if (options.readOnly)
117
+ return readOnlyError("delete", filePath);
118
+ if (!backend.delete)
119
+ return { error: `Cannot delete '${displayPath(filePath)}': the store serving it cannot delete.` };
120
+ const active = prefixFor(filePath);
121
+ const res = await backend.delete(mapIn(filePath, active));
122
+ return res.path === undefined ? res : { ...res, path: mapOut(res.path, active) };
123
+ },
105
124
  };
125
+ if (options.readOnly) {
126
+ mapped.uploadFiles = async (files) => files.map(([path]) => ({ path, error: "permission_denied" }));
127
+ }
128
+ else if (backend.uploadFiles) {
129
+ const uploadFiles = backend.uploadFiles.bind(backend);
130
+ mapped.uploadFiles = async (files) => {
131
+ const actives = files.map(([path]) => prefixFor(path));
132
+ const res = await uploadFiles(files.map(([path, content], i) => [mapIn(path, actives[i]), content]));
133
+ return res.map((entry, i) => ({ ...entry, path: mapOut(entry.path, actives[i]) }));
134
+ };
135
+ }
136
+ return mapped;
106
137
  }
107
138
  function optionalRel(prefix) {
108
139
  if (prefix == null)
@@ -1 +1 @@
1
- {"version":3,"file":"path-mapping.js","sourceRoot":"","sources":["../../src/core/path-mapping.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AA0BlD,SAAS,SAAS,CAAC,MAAc;IAC/B,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACtD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAC1B,OAA0B,EAC1B,MAA+B,EAC/B,UAiBI,EAAE;IAEN,MAAM,aAAa,GACjB,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACvF,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IACxC;;;OAGG;IACH,MAAM,WAAW,GAAG,CAAC,IAAY,EAAU,EAAE;QAC3C,MAAM,GAAG,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC;QACtD,IAAI,CAAC,MAAM;YAAE,OAAO,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,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AAI,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACrF,CAAC,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,WAAW,CAAC,MAA0B;IAC7C,IAAI,MAAM,IAAI,IAAI;QAAE,OAAO,SAAS,CAAC;IACrC,MAAM,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IAC9B,OAAO,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC;AACtC,CAAC"}
@@ -1,4 +1,4 @@
1
1
  // Generated from platform-prompt.md by scripts/generate-platform-prompt.mjs. Do not edit.
2
2
  /** The bundled platform prompt: how to move through the graph and which tools are the runtime's. */
3
- export const PLATFORM_PROMPT = "# Graph state execution\n\nYou run inside a **declarative workflow graph**: you occupy one **state** at a\ntime, and its spec governs which tools you may call and which files you may read\nor write.\n\n## How you move\n\n1. **Name the run first.** Before anything else in your first turn, call\n **`archmax_set_variables({ \"variables\": { \"title\": \"<a few words>\" } })`** — see\n \"Naming the run\" below.\n2. Do the current state's work. Write files where its instructions or listed\n mounts say; `scratchpad/`, always writable, is only the default.\n3. Call **`archmax_advance({ \"to\": \"<next>\", \"reason\": \"<one sentence>\" })`**,\n choosing `to` from the transitions under \"Current state\" by their descriptions.\n `to` takes the target's **slug** — the backticked token on the transition line.\n A parenthesized note gives the edge's type (`approve`, `reject`, `refine`) and\n marks a **human decision node** or a **terminal** target. A state with no\n transitions says so: the run ends there, so finish its work and stop.\n4. The runtime validates the edge and runs this state's `after` hook and then the\n target's `before` hook — either may send you back to correct or veto the move —\n before the next state's tools unlock.\n\n**One transition per message.** A second `archmax_advance` in the same message is\nrefused; chain states over successive turns.\n\n**Text alone ends your turn.** A message with no tool call is the last thing you\ndo until someone writes again: the run stays where it is, and whatever you meant\nto do next never happens. So when the work is to tell the person something *and\nthen* advance, wait or raise, write that text and make the call in the **same\nmessage**.\n\n**A conversation keeps its position.** A new message finds you in the state your\nlast turn ended in. If that state cannot serve it — no transition reaches what\nwas asked, or an earlier turn took a wrong path — call\n**`archmax_reset({ \"reason\": \"<one sentence>\" })`** to return to the state the\nconversation began in. The conversation and every file written so far are kept.\n\n**A terminal state never serves a follow-up.** When a message lands on a run that\nwas *already sitting* in a terminal state, reset **before** answering, or you skip\nevery state the answer depends on. Two cases are not follow-ups: a run you parked\nwith `archmax_wait`, which resumes where it was on purpose, and a terminal state\nyou were routed into *this turn*, by your own advance or a person's decision — do\nits work, then stop. Never reset out of a state you just arrived in, and never\n`archmax_wait` for the runtime to move you.\n\n### Waiting and deciding\n\n- Something has to **arrive** from outside the run — an event, a callback, a reply\n someone sends in their own time → call\n **`archmax_wait({ \"reason\": \"<what you are waiting for>\" })`** and stop. You\n resume in **this same state**, with what arrived in your transcript and any\n values it carried in the variables. Waiting for a *time*? Add `\"until\": \"1d\"` (a\n duration or an ISO-8601 instant); an earlier event still resumes you.\n- Someone has to **decide**, approve, review or choose → `archmax_advance` into the\n **human decision node** the author declared for it. The runtime parks the run\n there and presents the options itself: do the work its transitions require,\n advance in, and stop. Never advance out of one yourself, and never `archmax_wait`\n to ask for a decision.\n\n### When the work fails\n\nIf the task **cannot be completed** — a system it depends on keeps failing, what it\nneeds does not exist, the request is one this workflow cannot serve — try to\nrecover once or twice (a retry, another tool, another approach). If that fails\ntoo, call **`archmax_raise({ \"code\": \"<short-token>\", \"reason\": \"<what failed>\" })`**:\nit ends the session as a failure from any state, and whoever started the run\nreads your `code` (e.g. `orders-unavailable`) and `reason`. **When you are about to\ntell the person the task cannot be done, make that call in the same message**: the\nmessage's text is what they read, and no other tool call goes with it. A reply\nthat only explains the failure ends the run as a success. Never raise to finish\nwork that worked, or in place of `archmax_wait`, `archmax_reset` or a human node.\n\n### The state you are in\n\nThe active state's **`instructions`** arrive under a \"Current state\" heading:\nfollow them. You are shown the edges out of this state and nothing else of the\ngraph — there is no map of the workflow to consult. Do not guess at slugs, and do\nnot treat a state named anywhere else (a message, a file, your own earlier turns)\nas somewhere you can move to. Skills the state may use are listed under \"Skills\navailable in this state\", each naming the `SKILL.md` to read first.\n\n**`before`/`after` hooks** run on their own and may approve, ask for a\ncorrection, or block the run: fix the work rather than arguing with it.\n\n## Tools\n\nTool access is **closed by default**: you see only the active state's tools, and\na state may narrow a tool's arguments (e.g. `write_file` to one path). Tools named\n`archmax_*` are the runtime's controls. A blocked call names the tool, the state\nand the policy: fix the call, or advance if you are done.\n\n**Write code instead of many calls.** **`archmax_eval({ \"code\": \"…\" })`**, in\nevery state, runs JavaScript in a sandbox where `tools.*` calls your tools,\ngoverned exactly as your own calls are. Reach for it by default for loops,\nfilters, arithmetic, or more than about two calls whose results feed each other:\n**only your last expression and whatever you `console.log` come back to you**, so\nthe rest of what those tools returned never enters the conversation. The REPL\nkeeps its state between calls. Your code cannot read the run's variables:\ninterpolate a scalar one into it with `${{name}}` (below), or use\n**`archmax_run({ \"file_path\": \"…\" })`**, the same sandbox subject to the state's\npath constraints, whose script receives whole structured values as\n`args.variables`.\n\n**Naming the run.** `title` is a reserved run variable: a one-line label of a few\nwords (`Refund for order A-1042`) that tells this run apart in a list of runs.\nThis is step 1 above, and it is not optional. Write it from what the request\nalready says, **before** the state's own work and before any other tool call — it\nis a label, not a plan, so never read anything to produce one — and it still goes\nfirst when the state's instructions tell you to do something else first. Update\nit when the task turns into something the old title no longer describes. Never\npass `lock` with it: that call is refused.\n\n**Reference a run variable instead of retyping it.** In any text argument,\n`${{name}}` (or `${{name.path.to.value}}`) is replaced with that variable's value\nbefore the call runs, also **inside** a longer string and as often as you like:\n\n```\n\"Thanks — your refund is on its way.\n\n--- Original message ---\n\n${{inbound.text}}\"\n```\n\nPrefer the reference to writing the value out: the value is what you spend tokens\non, and a reference cannot paraphrase, truncate or mistype it.\n`archmax_get_variables` shows what is set; a reference that does not resolve\nrefuses the call and says why. To write `${{…}}` literally, double the dollar:\n`$${{name}}`.\n";
3
+ export const PLATFORM_PROMPT = "# Graph state execution\n\nYou run inside a **declarative workflow graph**: you occupy one **state** at a\ntime, and its spec governs which tools you may call and which files you may read\nor write.\n\n## How you move\n\n<!-- top-level-only -->\n1. **Name the run first.** Before anything else in your first turn, call\n **`archmax_set_variables({ \"variables\": { \"title\": \"<a few words>\" } })`** — see\n \"Naming the run\" below.\n<!-- /top-level-only -->\n2. Do the current state's work. Write files where its instructions or listed\n mounts say; `scratchpad/`, always writable, is only the default.\n3. Call **`archmax_advance({ \"to\": \"<next>\", \"reason\": \"<one sentence>\" })`**,\n choosing `to` from the transitions under \"Current state\" by their descriptions.\n `to` takes the target's **slug** — the backticked token on the transition line.\n A parenthesized note gives the edge's type (`approve`, `reject`, `refine`) and\n marks a **human decision node** or a **terminal** target. A state with no\n transitions says so: the run ends there, so finish its work and stop.\n4. The runtime validates the edge and runs this state's `after` hook and then the\n target's `before` hook — either may send you back to correct or veto the move —\n before the next state's tools unlock.\n\n**One transition per message.** A second `archmax_advance` in the same message is\nrefused; chain states over successive turns.\n\n**Text alone ends your turn.** A message with no tool call is the last thing you\ndo until someone writes again: the run stays where it is, and whatever you meant\nto do next never happens. So when the work is to tell the person something *and\nthen* advance, wait or raise, write that text and make the call in the **same\nmessage**.\n\n**A conversation keeps its position.** A new message finds you in the state your\nlast turn ended in. If that state cannot serve it — no transition reaches what\nwas asked, or an earlier turn took a wrong path — call\n**`archmax_reset({ \"reason\": \"<one sentence>\" })`** to return to the state the\nconversation began in. The conversation and every file written so far are kept.\n\n**A terminal state never serves a follow-up.** When a message lands on a run that\nwas *already sitting* in a terminal state, reset **before** answering, or you skip\nevery state the answer depends on. Two cases are not follow-ups: a run you parked\nwith `archmax_wait`, which resumes where it was on purpose, and a terminal state\nyou were routed into *this turn*, by your own advance or a person's decision — do\nits work, then stop. Never reset out of a state you just arrived in, and never\n`archmax_wait` for the runtime to move you.\n\n### Waiting and deciding\n\n- Something has to **arrive** from outside the run — an event, a callback, a reply\n someone sends in their own time → call\n **`archmax_wait({ \"reason\": \"<what you are waiting for>\" })`** and stop. You\n resume in **this same state**, with what arrived in your transcript and any\n values it carried in the variables. Waiting for a *time*? Add `\"until\": \"1d\"` (a\n duration or an ISO-8601 instant); an earlier event still resumes you.\n- Someone has to **decide**, approve, review or choose → `archmax_advance` into the\n **human decision node** the author declared for it. The runtime parks the run\n there and presents the options itself: do the work its transitions require,\n advance in, and stop. Never advance out of one yourself, and never `archmax_wait`\n to ask for a decision.\n\n### When the work fails\n\nIf the task **cannot be completed** — a system it depends on keeps failing, what it\nneeds does not exist, the request is one this workflow cannot serve — try to\nrecover once or twice (a retry, another tool, another approach). If that fails\ntoo, call **`archmax_raise({ \"code\": \"<short-token>\", \"reason\": \"<what failed>\" })`**:\nit ends the session as a failure from any state, and whoever started the run\nreads your `code` (e.g. `orders-unavailable`) and `reason`. **When you are about to\ntell the person the task cannot be done, make that call in the same message**: the\nmessage's text is what they read, and no other tool call goes with it. A reply\nthat only explains the failure ends the run as a success. Never raise to finish\nwork that worked, or in place of `archmax_wait`, `archmax_reset` or a human node.\n\n### The state you are in\n\nThe active state's **`instructions`** arrive under a \"Current state\" heading:\nfollow them. You are shown the edges out of this state and nothing else of the\ngraph — there is no map of the workflow to consult. Do not guess at slugs, and do\nnot treat a state named anywhere else (a message, a file, your own earlier turns)\nas somewhere you can move to. Skills the state may use are listed under \"Skills\navailable in this state\", each naming the `SKILL.md` to read first.\n\n**`before`/`after` hooks** run on their own and may approve, ask for a\ncorrection, or block the run: fix the work rather than arguing with it.\n\n## Tools\n\nTool access is **closed by default**: you see only the active state's tools, and\na state may narrow a tool's arguments (e.g. `write_file` to one path). Tools named\n`archmax_*` are the runtime's controls. A blocked call names the tool, the state\nand the policy: fix the call, or advance if you are done.\n\n**Write code instead of many calls.** **`archmax_eval({ \"code\": \"…\" })`**, in\nevery state, runs JavaScript in a sandbox where `tools.*` calls your tools,\ngoverned exactly as your own calls are. Reach for it by default for loops,\nfilters, arithmetic, or more than about two calls whose results feed each other:\n**only your last expression and whatever you `console.log` come back to you**, so\nthe rest of what those tools returned never enters the conversation. The REPL\nkeeps its state between calls. Your code cannot read the run's variables:\ninterpolate a scalar one into it with `${{name}}` (below), or use\n**`archmax_run({ \"file_path\": \"…\" })`**, the same sandbox subject to the state's\npath constraints, whose script receives whole structured values as\n`args.variables`.\n\n<!-- top-level-only -->\n**Naming the run.** `title` is a reserved run variable: a one-line label of a few\nwords (`Refund for order A-1042`) that tells this run apart in a list of runs.\nThis is step 1 above, and it is not optional. Write it from what the request\nalready says, **before** the state's own work and before any other tool call — it\nis a label, not a plan, so never read anything to produce one — and it still goes\nfirst when the state's instructions tell you to do something else first. Update\nit when the task turns into something the old title no longer describes. Never\npass `lock` with it: that call is refused.\n\n<!-- /top-level-only -->\n**Reference a run variable instead of retyping it.** In any text argument,\n`${{name}}` (or `${{name.path.to.value}}`) is replaced with that variable's value\nbefore the call runs, also **inside** a longer string and as often as you like:\n\n```\n\"Thanks — your refund is on its way.\n\n--- Original message ---\n\n${{inbound.text}}\"\n```\n\nPrefer the reference to writing the value out: the value is what you spend tokens\non, and a reference cannot paraphrase, truncate or mistype it.\n`archmax_get_variables` shows what is set; a reference that does not resolve\nrefuses the call and says why. To write `${{…}}` literally, double the dollar:\n`$${{name}}`.\n";
4
4
  //# sourceMappingURL=platform-prompt.generated.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform-prompt.generated.js","sourceRoot":"","sources":["../../src/core/platform-prompt.generated.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAE1F,oGAAoG;AACpG,MAAM,CAAC,MAAM,eAAe,GAAW,ovOAAovO,CAAC"}
1
+ {"version":3,"file":"platform-prompt.generated.js","sourceRoot":"","sources":["../../src/core/platform-prompt.generated.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAE1F,oGAAoG;AACpG,MAAM,CAAC,MAAM,eAAe,GAAW,01OAA01O,CAAC"}
@@ -10,6 +10,12 @@ export interface ResolveSystemPromptOptions {
10
10
  * for it to explain.
11
11
  */
12
12
  platformBackendPath: string | null;
13
+ /**
14
+ * The prompt is a sub-workflow's child session's: the platform layer leaves
15
+ * out its top-level-only passages (see {@link platformPromptFor}). Omitted, it
16
+ * is a top-level session's.
17
+ */
18
+ child?: boolean;
13
19
  /**
14
20
  * Pre-assembled workflow prompt text: the spec-rendered workflow header
15
21
  * followed by any `WORKFLOW.md` prose addendum (the caller composes both —
@@ -38,5 +44,26 @@ export interface SystemPromptParts {
38
44
  }
39
45
  /** Join the prompt layers, skipping absent ones. */
40
46
  export declare function buildSystemPrompt(parts: SystemPromptParts): string;
47
+ /** Opens a platform-prompt passage only a top-level session reads; alone on its line. */
48
+ export declare const TOP_LEVEL_ONLY_OPEN = "<!-- top-level-only -->";
49
+ /** Closes a passage {@link TOP_LEVEL_ONLY_OPEN} opened; alone on its line. */
50
+ export declare const TOP_LEVEL_ONLY_CLOSE = "<!-- /top-level-only -->";
51
+ /** Which session a prompt is for: one a host started, or a sub-workflow's child. */
52
+ export type PromptSession = "top-level" | "child";
53
+ /**
54
+ * The platform prompt as `session` reads it. A passage between
55
+ * {@link TOP_LEVEL_ONLY_OPEN} and {@link TOP_LEVEL_ONLY_CLOSE}, each alone on
56
+ * its line, is kept for a top-level session and left out for a child session,
57
+ * which does not name itself: its title would describe a session nothing
58
+ * lists. The marker lines reach neither, so a top-level session reads the text
59
+ * exactly as it did before the markers existed. Where a left-out passage held
60
+ * items of an ordered list, the items after it in that list are renumbered. An
61
+ * opening marker with no closing one leaves everything after it in place.
62
+ *
63
+ * The same rule applies to a workspace's override, so one copied from the
64
+ * bundled prompt keeps the omission and one without markers reads the same in
65
+ * both sessions.
66
+ */
67
+ export declare function platformPromptFor(text: string, session: PromptSession): string;
41
68
  /** Load the prompt layers from the backend and merge them. */
42
69
  export declare function resolveSystemPrompt(workspace: Workspace, opts: ResolveSystemPromptOptions): Promise<string>;
@@ -11,7 +11,8 @@
11
11
  * It ships inside the code (`platform-prompt.md`, generated into
12
12
  * `platform-prompt.generated.ts`); a workspace may override it at
13
13
  * `.platform/system/GRAPH_STATE.md`. A plain agent has no machine for it to
14
- * explain, so it gets no platform layer.
14
+ * explain, so it gets no platform layer. A sub-workflow's child session
15
+ * reads it without its top-level-only passages (see {@link platformPromptFor}).
15
16
  * 4. Workspace zones — rendered from the assembly's resolved mount table.
16
17
  * 5. The workflow header — the spec's `title` and root `instructions`, and no
17
18
  * state of the graph: the graph is disclosed only from where the agent
@@ -51,17 +52,76 @@ export function buildSystemPrompt(parts) {
51
52
  .filter(Boolean)
52
53
  .join("\n\n");
53
54
  }
54
- /** The workspace's override when it serves one, else the bundled prompt. */
55
- async function readPlatformPrompt(workspace, backendPath) {
55
+ /** Opens a platform-prompt passage only a top-level session reads; alone on its line. */
56
+ export const TOP_LEVEL_ONLY_OPEN = "<!-- top-level-only -->";
57
+ /** Closes a passage {@link TOP_LEVEL_ONLY_OPEN} opened; alone on its line. */
58
+ export const TOP_LEVEL_ONLY_CLOSE = "<!-- /top-level-only -->";
59
+ const ORDERED_ITEM = /^(\d+)\.(?=\s)/;
60
+ /**
61
+ * The platform prompt as `session` reads it. A passage between
62
+ * {@link TOP_LEVEL_ONLY_OPEN} and {@link TOP_LEVEL_ONLY_CLOSE}, each alone on
63
+ * its line, is kept for a top-level session and left out for a child session,
64
+ * which does not name itself: its title would describe a session nothing
65
+ * lists. The marker lines reach neither, so a top-level session reads the text
66
+ * exactly as it did before the markers existed. Where a left-out passage held
67
+ * items of an ordered list, the items after it in that list are renumbered. An
68
+ * opening marker with no closing one leaves everything after it in place.
69
+ *
70
+ * The same rule applies to a workspace's override, so one copied from the
71
+ * bundled prompt keeps the omission and one without markers reads the same in
72
+ * both sessions.
73
+ */
74
+ export function platformPromptFor(text, session) {
75
+ if (!text.includes(TOP_LEVEL_ONLY_OPEN))
76
+ return text;
77
+ const kept = [];
78
+ /** The lines of the passage being read, or `null` outside one. */
79
+ let passage = null;
80
+ /** How many items of the ordered list being read a left-out passage held. */
81
+ let dropped = 0;
82
+ for (const line of text.split("\n")) {
83
+ const marker = line.trim();
84
+ if (passage === null && marker === TOP_LEVEL_ONLY_OPEN) {
85
+ passage = [];
86
+ continue;
87
+ }
88
+ if (passage !== null) {
89
+ if (marker !== TOP_LEVEL_ONLY_CLOSE) {
90
+ passage.push(line);
91
+ continue;
92
+ }
93
+ if (session === "top-level")
94
+ kept.push(...passage);
95
+ else
96
+ dropped += passage.filter((held) => ORDERED_ITEM.test(held)).length;
97
+ passage = null;
98
+ continue;
99
+ }
100
+ const item = ORDERED_ITEM.exec(line);
101
+ if (item && dropped > 0) {
102
+ kept.push(`${Number(item[1]) - dropped}${line.slice(item[1].length)}`);
103
+ continue;
104
+ }
105
+ // Any other unindented text ends the list a passage cut items from.
106
+ if (line.trim() !== "" && !/^\s/.test(line))
107
+ dropped = 0;
108
+ kept.push(line);
109
+ }
110
+ if (passage !== null)
111
+ kept.push(...passage);
112
+ return kept.join("\n");
113
+ }
114
+ /** The workspace's override when it serves one, else the bundled prompt, as `session` reads it. */
115
+ async function readPlatformPrompt(workspace, backendPath, session) {
56
116
  if (backendPath === null)
57
117
  return null;
58
- return (await workspace.readText(backendPath)) || PLATFORM_PROMPT;
118
+ return platformPromptFor((await workspace.readText(backendPath)) || PLATFORM_PROMPT, session);
59
119
  }
60
120
  /** Load the prompt layers from the backend and merge them. */
61
121
  export async function resolveSystemPrompt(workspace, opts) {
62
122
  const agentsPath = opts.agentsPath ?? "AGENTS.md";
63
123
  const [platform, agents] = await Promise.all([
64
- readPlatformPrompt(workspace, opts.platformBackendPath),
124
+ readPlatformPrompt(workspace, opts.platformBackendPath, opts.child ? "child" : "top-level"),
65
125
  workspace.readText(agentsPath),
66
126
  ]);
67
127
  return buildSystemPrompt({
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/core/prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,OA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AG,OAAO,CAAC,CAAC;IAC5C,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACzB,CAAC;AAED,mGAAmG;AACnG,KAAK,UAAU,kBAAkB,CAC/B,SAAoB,EACpB,WAA0B,EAC1B,OAAsB;IAEtB,IAAI,WAAW,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACtC,OAAO,iBAAiB,CAAC,CAAC,MAAM,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,IAAI,eAAe,EAAE,OAAO,CAAC,CAAC;AAChG,CAAC;AAED,8DAA8D;AAC9D,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,SAAoB,EACpB,IAAgC;IAEhC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,WAAW,CAAC;IAClD,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC3C,kBAAkB,CAAC,SAAS,EAAE,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC;QAC3F,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC;KAC/B,CAAC,CAAC;IAEH,OAAO,iBAAiB,CAAC;QACvB,MAAM;QACN,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,QAAQ;QACR,SAAS,EAAE,oBAAoB,CAAC,IAAI,CAAC,aAAa,IAAI,SAAS,CAAC;QAChE,QAAQ,EAAE,IAAI,CAAC,cAAc,IAAI,IAAI;KACtC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { BackendProtocolV2, FileDownloadResponse } from "deepagents";
2
+ /**
3
+ * `downloadFiles` for a store without the raw channel, through `readRaw`.
4
+ *
5
+ * Deep Agents makes `downloadFiles` optional and its own code feature-detects
6
+ * it (the skills loader reads every `SKILL.md` through it when present), so a
7
+ * wrapper that defines it must answer every path it can read, not throw. The
8
+ * answer is the file's exact bytes or an error, never something else:
9
+ *
10
+ * - bytes from `readRaw` (a binary-typed file) are the file's bytes;
11
+ * - text is the store's decoding of the file, which is exact only when the file
12
+ * was UTF-8. Encoded back, it is the file's bytes unless decoding replaced
13
+ * some: text holding U+FFFD is refused with `permission_denied`, because the
14
+ * store cannot hand over those bytes unchanged.
15
+ */
16
+ export declare function downloadViaReadRaw(backend: Pick<BackendProtocolV2, "readRaw">, path: string): Promise<FileDownloadResponse>;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * `downloadFiles` for a store without the raw channel, through `readRaw`.
3
+ *
4
+ * Deep Agents makes `downloadFiles` optional and its own code feature-detects
5
+ * it (the skills loader reads every `SKILL.md` through it when present), so a
6
+ * wrapper that defines it must answer every path it can read, not throw. The
7
+ * answer is the file's exact bytes or an error, never something else:
8
+ *
9
+ * - bytes from `readRaw` (a binary-typed file) are the file's bytes;
10
+ * - text is the store's decoding of the file, which is exact only when the file
11
+ * was UTF-8. Encoded back, it is the file's bytes unless decoding replaced
12
+ * some: text holding U+FFFD is refused with `permission_denied`, because the
13
+ * store cannot hand over those bytes unchanged.
14
+ */
15
+ export async function downloadViaReadRaw(backend, path) {
16
+ try {
17
+ const res = await backend.readRaw(path);
18
+ const content = fileContentOf(res);
19
+ if (content === undefined)
20
+ return refused(path, errorCodeOf(res?.error));
21
+ if (ArrayBuffer.isView(content)) {
22
+ return { path, content: new Uint8Array(content.buffer, content.byteOffset, content.byteLength), error: null };
23
+ }
24
+ const text = Array.isArray(content) ? content.join("\n") : String(content ?? "");
25
+ if (text.includes("�"))
26
+ return refused(path, "permission_denied");
27
+ return { path, content: new TextEncoder().encode(text), error: null };
28
+ }
29
+ catch (err) {
30
+ return refused(path, errorCodeOf(err instanceof Error ? err.message : err));
31
+ }
32
+ }
33
+ const refused = (path, error) => ({ path, content: null, error });
34
+ /** The content a `readRaw` result carries: v2's `{ data }`, or a v1 store's bare `FileData`. */
35
+ function fileContentOf(res) {
36
+ if (res === null || typeof res !== "object")
37
+ return undefined;
38
+ const result = res;
39
+ if (result.error)
40
+ return undefined;
41
+ if (result.data !== undefined)
42
+ return result.data.content;
43
+ return "content" in result ? result.content : undefined;
44
+ }
45
+ /** A store's refusal as the protocol's error code; a read that found nothing is `file_not_found`. */
46
+ function errorCodeOf(detail) {
47
+ const text = typeof detail === "string" ? detail : "";
48
+ if (/EISDIR|is_directory|is a directory/i.test(text))
49
+ return "is_directory";
50
+ if (/EACCES|EPERM|permission/i.test(text))
51
+ return "permission_denied";
52
+ if (/invalid_path|invalid path/i.test(text))
53
+ return "invalid_path";
54
+ return "file_not_found";
55
+ }
56
+ //# sourceMappingURL=raw-download.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"raw-download.js","sourceRoot":"","sources":["../../src/core/raw-download.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAA2C,EAC3C,IAAY;IAEZ,IAAI,CAAC;QACH,MAAM,GAAG,GAAY,MAAM,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACjD,MAAM,OAAO,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,OAAO,KAAK,SAAS;YAAE,OAAO,OAAO,CAAC,IAAI,EAAE,WAAW,CAAE,GAA2B,EAAE,KAAK,CAAC,CAAC,CAAC;QAClG,IAAI,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;YAChC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QAChH,CAAC;QACD,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,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C,IAAI,CAAC;QAAE,OAAO,cAAc,CAAC;IAC5E,IAAI,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,mBAAmB,CAAC;IACtE,IAAI,4BAA4B,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,cAAc,CAAC;IACnE,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { BackendProtocolV2 } from "deepagents";
1
+ import type { BackendProtocolV2, FileUploadResponse } from "deepagents";
2
2
  /**
3
3
  * The session zone — the agent's workspace **root**: durable per-session
4
4
  * checkpoints, observability artifacts, the agent's `scratchpad/…` working area, the
@@ -33,6 +33,12 @@ import type { BackendProtocolV2 } from "deepagents";
33
33
  export declare class SessionZoneRouter implements BackendProtocolV2 {
34
34
  private readonly binding;
35
35
  private readonly routed;
36
+ /**
37
+ * Present exactly when the session store has it: Deep Agents' history offload
38
+ * appends through `uploadFiles` when the workspace has one and through `edit`
39
+ * otherwise, so a stand-in that refused would break the append.
40
+ */
41
+ readonly uploadFiles?: (files: Array<[string, Uint8Array]>) => Promise<FileUploadResponse[]>;
36
42
  constructor(backend: BackendProtocolV2);
37
43
  /**
38
44
  * Bind id-free run-root addressing to `sessionId` for everything `fn` does
@@ -51,4 +57,6 @@ export declare class SessionZoneRouter implements BackendProtocolV2 {
51
57
  glob(pattern: string, path?: string): import("deepagents").MaybePromise<import("deepagents").GlobResult>;
52
58
  write(filePath: string, content: string): import("deepagents").MaybePromise<import("deepagents").WriteResult>;
53
59
  edit(filePath: string, oldString: string, newString: string, replaceAll?: boolean): import("deepagents").MaybePromise<import("deepagents").EditResult>;
60
+ downloadFiles(paths: string[]): import("deepagents").MaybePromise<import("deepagents").FileDownloadResponse[]>;
61
+ delete(filePath: string): import("deepagents").MaybePromise<import("deepagents").DeleteResult>;
54
62
  }
@@ -35,6 +35,12 @@ import { isSessionAgnosticPath } from "./zones.js";
35
35
  export class SessionZoneRouter {
36
36
  binding = new AsyncLocalStorage();
37
37
  routed;
38
+ /**
39
+ * Present exactly when the session store has it: Deep Agents' history offload
40
+ * appends through `uploadFiles` when the workspace has one and through `edit`
41
+ * otherwise, so a stand-in that refused would break the append.
42
+ */
43
+ uploadFiles;
38
44
  constructor(backend) {
39
45
  this.routed = mountSubtree(backend, () => this.binding.getStore(), {
40
46
  // Session-agnostic prefixes resolve to the run-store root whether or not a
@@ -42,6 +48,9 @@ export class SessionZoneRouter {
42
48
  // session index has to be readable before a session is chosen at all.
43
49
  passthrough: (rel, prefix) => rel === prefix || rel.startsWith(`${prefix}/`) || isSessionAgnosticPath(rel),
44
50
  });
51
+ const upload = this.routed.uploadFiles;
52
+ if (upload)
53
+ this.uploadFiles = async (files) => upload(files);
45
54
  }
46
55
  /**
47
56
  * Bind id-free run-root addressing to `sessionId` for everything `fn` does
@@ -78,5 +87,11 @@ export class SessionZoneRouter {
78
87
  edit(filePath, oldString, newString, replaceAll) {
79
88
  return this.routed.edit(filePath, oldString, newString, replaceAll);
80
89
  }
90
+ downloadFiles(paths) {
91
+ return this.routed.downloadFiles(paths);
92
+ }
93
+ delete(filePath) {
94
+ return this.routed.delete(filePath);
95
+ }
81
96
  }
82
97
  //# sourceMappingURL=session-zone.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"session-zone.js","sourceRoot":"","sources":["../../src/core/session-zone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,OAAO,iBAAiB;IACX,OAAO,GAAG,IAAI,iBAAiB,EAAU,CAAC;IAC1C,MAAM,CAAoB;IAE3C,YAAY,OAA0B;QACpC,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC,OAAO,EAAE,GAAG,EAAE,CA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C;IAC1C,CAAC;IAED,MAAM,CAAC,QAAgB;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACtC,CAAC;CACF"}
@@ -0,0 +1,27 @@
1
+ import type { BackendProtocolV2 } from "deepagents";
2
+ /**
3
+ * What a host tool's handler is handed besides its input: the turn's
4
+ * workspace, so a host tool resolves paths exactly as the built-in file tools
5
+ * do instead of rebuilding the mount table beside the SDK.
6
+ */
7
+ export interface ToolContext {
8
+ /**
9
+ * The turn's workspace: the host's mounts with their read-only posture and the
10
+ * session zone at the root, bound to this session — the same instance
11
+ * `read_file` resolves through. Besides text `read`/`write`, it carries raw
12
+ * bytes and `delete`, each optional in the protocol and degrading rather than
13
+ * throwing: `downloadFiles` always (through `readRaw` where a store has no raw
14
+ * channel), `uploadFiles` when the session store has it, `delete` answering an
15
+ * error where a store cannot. A read-only mount refuses every write, upload
16
+ * and delete. Outside a turn, reading it throws; the property is
17
+ * non-enumerable there.
18
+ */
19
+ workspace: BackendProtocolV2;
20
+ }
21
+ /**
22
+ * Run `fn` with `context` as the tool context of everything it does. Bound per
23
+ * turn, beside the session binding, by both compositions.
24
+ */
25
+ export declare function runWithToolContext<T>(context: ToolContext, fn: () => Promise<T>): Promise<T>;
26
+ /** The tool context of the turn in progress, or `undefined` outside one. */
27
+ export declare function currentToolContext(): ToolContext | undefined;
@@ -0,0 +1,14 @@
1
+ import { AsyncLocalStorage } from "node:async_hooks";
2
+ const current = new AsyncLocalStorage();
3
+ /**
4
+ * Run `fn` with `context` as the tool context of everything it does. Bound per
5
+ * turn, beside the session binding, by both compositions.
6
+ */
7
+ export function runWithToolContext(context, fn) {
8
+ return current.run(context, fn);
9
+ }
10
+ /** The tool context of the turn in progress, or `undefined` outside one. */
11
+ export function currentToolContext() {
12
+ return current.getStore();
13
+ }
14
+ //# sourceMappingURL=tool-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-context.js","sourceRoot":"","sources":["../../src/core/tool-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAuBrD,MAAM,OAAO,GAAG,IAAI,iBAAiB,EAAe,CAAC;AAErD;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAI,OAAoB,EAAE,EAAoB;IAC9E,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;AAClC,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,kBAAkB;IAChC,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAC;AAC5B,CAAC"}
@@ -30,7 +30,8 @@ export function toolOutputPreview(value) {
30
30
  }
31
31
  /** A concise, single-value hint for a tool call (e.g. its `file_path`), for the CLI. */
32
32
  export function toolCallDetail(args) {
33
- for (const key of ["file_path", "path", "to", "pattern", "command", "url"]) {
33
+ // A copy is named by where it lands, as a write is.
34
+ for (const key of ["file_path", "destination", "path", "to", "pattern", "command", "url"]) {
34
35
  const value = args[key];
35
36
  if (typeof value === "string" && value.trim())
36
37
  return value;
@@ -1 +1 @@
1
- {"version":3,"file":"tool-telemetry.js","sourceRoot":"","sources":["../../src/core/tool-telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD;;;;;;GAMG;AAEH,oFAAoF;AACpF,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAE5C,oEAAoE;AACpE,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,IAAI,IAAY,CAAC;IACjB,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;QACjC,IAAI,GAAG,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACjG,CAAC;SAAM,IAAI,OAAO,KAAK,KAAK,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O,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;IACjG,CAAC;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACrC,IAAI,GAAG,KAAK,CAAC;IACf,CAAC;SAAM,CAAC;QACN,IAAI,CAAC;YACH,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;QAChD,CAAC;QAAC,MAAM,CAAC;YACP,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;IACD,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,GAAG,uBAAuB,CAAC;IACxD,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,uBAAuB,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC;AAC1F,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,cAAc,CAAC,IAA6B;IAC1D,oDAAoD;IACpD,KAAK,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC;QAC1F,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE;YAAE,OAAO,KAAK,CAAC;IAC9D,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -122,6 +122,7 @@ export function createWorkspaceContext(options = {}) {
122
122
  const unsearchableRoutes = new Map(unsearchable.map((m) => [m.name, routes[m.key]]));
123
123
  const backend = createWorkspaceRouter({
124
124
  composite,
125
+ defaultRoute: sessionZone,
125
126
  searchComposite,
126
127
  unsearchableRoutes,
127
128
  fileMounts,
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-context.js","sourceRoot":"","sources":["../../src/core/workspace-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAA0B,MAAM,YAAY,CAAC;AACzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EACL,4BAA4B,EAC5B,oBAAoB,EACpB,yBAAyB,GAE1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACL,aAAa,EACb,aAAa,GAId,MAAM,aAAa,CAAC;AA6DrB;;;;;GAKG;AACH,MAAM,OAAO,4BAA6B,SAAQ,KAAK;IAChC;IAArB,YAAqB,GAAW;QAC9B,KAAK,CACH,UAAU,GAAG,4EAA4E;YACvF,2FAA2F;YAC3F,sBAAsB,CACzB,CAAC;QALiB,QAAG,GAAH,GAAG,CAAQ;QAM9B,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;IAC7C,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,OAAO,0BAA2B,SAAQ,KAAK;IAC9B;IAArB,YAAqB,MAA+C;QAClE,KAAK,CACH,2DAA2D,MAAM,eAAe;YAC9E,oFAAoF;YACpF,0CAA0C,MAAM,aAAa,CAChE,CAAC;QALiB,WAAM,GAAN,MAAM,CAAyC;QAMlE,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;IAC3C,CAAC;CACF;AA6CD;;;;;;GAMG;AACH,MAAM,UA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