@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
@@ -0,0 +1,93 @@
1
+ import { binaryMimeTypeOf } from "./binary-types.js";
2
+ /**
3
+ * Reads are text only. Deep Agents' `read_file` hands a non-text file to the
4
+ * model as a base64 multimodal block (`image`, `audio`, `video`, `file`), which
5
+ * an OpenAI-compatible tool message cannot carry and which would otherwise
6
+ * ride in every checkpoint, script result and event preview; and it decodes a
7
+ * binary file whose extension it does not know as UTF-8 garbage. The workspace
8
+ * router refuses both with the notice built here, and the `read_file`
9
+ * description the model is handed says so.
10
+ *
11
+ * The classification is `read_file`'s own — the route's `mimeType`, else the
12
+ * extension's, through `isTextMimeType` — plus two content checks: bytes, and a
13
+ * NUL character (git's and ripgrep's rule), which survives the backend's UTF-8
14
+ * decoding of an unknown extension.
15
+ */
16
+ export { BINARY_MIME_TYPES, binaryMimeTypeOf } from "./binary-types.js";
17
+ /**
18
+ * The image types the model may be shown (`images` assembly option): the ones
19
+ * chat-completions vision accepts. HEIC/HEIF are binary but not among them, so
20
+ * they stay refused like every other binary file.
21
+ */
22
+ export const SHOWN_IMAGE_MIME_TYPES = new Set(["image/png", "image/jpeg", "image/gif", "image/webp"]);
23
+ /** The MIME type of a path the model may be shown as an image, or `undefined`. */
24
+ export function shownImageMimeTypeOf(path) {
25
+ const mime = binaryMimeTypeOf(path);
26
+ return mime !== undefined && SHOWN_IMAGE_MIME_TYPES.has(mime) ? mime : undefined;
27
+ }
28
+ /** Deep Agents' `isTextMimeType`: the types `read_file` renders as text. */
29
+ export function isTextMimeType(mimeType) {
30
+ return (mimeType.startsWith("text/") ||
31
+ mimeType === "application/json" ||
32
+ mimeType === "application/javascript" ||
33
+ mimeType === "image/svg+xml");
34
+ }
35
+ /** Byte length of non-string content: bytes, or the numeric-key object they become once serialized. */
36
+ function byteLength(content) {
37
+ if (ArrayBuffer.isView(content))
38
+ return content.byteLength;
39
+ if (content !== null && typeof content === "object")
40
+ return Object.keys(content).length;
41
+ return undefined;
42
+ }
43
+ /** A byte count as a person reads it: `512 B`, `24.1 KB`, `3.2 MB`. */
44
+ export function formatSize(bytes) {
45
+ if (bytes < 1024)
46
+ return `${bytes} B`;
47
+ if (bytes < 1024 * 1024)
48
+ return `${(bytes / 1024).toFixed(1)} KB`;
49
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
50
+ }
51
+ /**
52
+ * The binary notice for a successful read of `path`, or `null` when the result
53
+ * is text. A result carrying an `error` is the route's own answer and is never
54
+ * classified.
55
+ */
56
+ export function binaryReadError(path, result) {
57
+ if (result.error)
58
+ return null;
59
+ const { content } = result;
60
+ const declared = result.mimeType ?? binaryMimeTypeOf(path) ?? "text/plain";
61
+ const typed = !isTextMimeType(declared);
62
+ const bytes = content !== undefined && typeof content !== "string";
63
+ const nul = typeof content === "string" && content.includes("\u0000");
64
+ if (!typed && !bytes && !nul)
65
+ return null;
66
+ const mime = typed ? declared : "application/octet-stream";
67
+ const size = bytes ? byteLength(content) : undefined;
68
+ const detail = size === undefined ? mime : `${mime}, ${formatSize(size)}`;
69
+ const shown = path.replace(/^\/+/, "");
70
+ return `'${shown}' is a binary file (${detail}) and was not read; read_file returns text files only.`;
71
+ }
72
+ /** The line the `read_file` description carries in place of Deep Agents' multimodal promise. */
73
+ export const READ_FILE_TEXT_ONLY_LINE = "- Text files only: a binary file (an image, audio, video, a PDF, an archive, …) is not returned; " +
74
+ "the result says the file is binary and was not read.";
75
+ /** The same line for an agent whose model is shown the images it reads (`images` option). */
76
+ export const READ_FILE_IMAGES_LINE = "- Text files, and images (PNG, JPEG, GIF, WebP): an image is shown to you right after the tool " +
77
+ "result. Any other binary file (audio, video, a PDF, an archive, …) is not returned; the result " +
78
+ "says the file is binary and was not read.";
79
+ const MULTIMODAL_LINE = /^- Images \(.*multimodal content blocks.*$/m;
80
+ const BINARY_PAGINATION_LINE = /^- For images and PDFs, pagination.*(?:\n|$)/m;
81
+ /**
82
+ * Deep Agents' `read_file` description with its binary-file lines replaced by
83
+ * `line` ({@link READ_FILE_TEXT_ONLY_LINE} by default), or `null` when the multimodal line is not
84
+ * there (reworded upstream) — the caller then keeps the description and warns.
85
+ */
86
+ export function textOnlyReadFileDescription(description, line = READ_FILE_TEXT_ONLY_LINE) {
87
+ if (description.includes(line))
88
+ return description;
89
+ if (!MULTIMODAL_LINE.test(description))
90
+ return null;
91
+ return description.replace(MULTIMODAL_LINE, line).replace(BINARY_PAGINATION_LINE, "");
92
+ }
93
+ //# sourceMappingURL=binary-read.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binary-read.js","sourceRoot":"","sources":["../../src/core/binary-read.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAExE;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAwB,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC;AAE3H,kFAAkF;AAClF,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,MAAM,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACpC,OAAO,IAAI,KAAK,SAAS,IAAI,sBAAsB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AACnF,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,OAAO,CACL,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC;QAC5B,QAAQ,KAAK,kBAAkB;QAC/B,QAAQ,KAAK,wBAAwB;QACrC,QAAQ,KAAK,eAAe,CAC7B,CAAC;AACJ,CAAC;AAED,uGAAuG;AACvG,SAAS,UAAU,CAAC,OAAgB;IAClC,IAAI,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC;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,CAAC,0BAA0B,CAAC;IAC3D,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACrD,MAAM,MAAM,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;IAC1E,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACvC,OAAO,IAAI,KAAK,uBAAuB,MAAM,wDAAwD,CAAC;AACxG,CAAC;AAED,gGAAgG;AAChG,MAAM,CAAC,MAAM,wBAAwB,GACnC,mGAAmG;IACnG,sDAAsD,CAAC;AAEzD,6FAA6F;AAC7F,MAAM,CAAC,MAAM,qBAAqB,GAChC,iGAAiG;IACjG,iGAAiG;IACjG,2CAA2C,CAAC;AAE9C,MAAM,eAAe,GAAG,6CAA6C,CAAC;AACtE,MAAM,sBAAsB,GAAG,+CAA+C,CAAC;AAE/E;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CACzC,WAAmB,EACnB,OAAe,wBAAwB;IAEvC,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,WAAW,CAAC;IACnD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC;QAAE,OAAO,IAAI,CAAC;IACpD,OAAO,WAAW,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,sBAAsB,EAAE,EAAE,CAAC,CAAC;AACxF,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The binary types of Deep Agents' v2 file format: the extensions `read_file`
3
+ * treats as non-text, and the paths a `write` addresses with base64 that the
4
+ * store decodes. Pure — no `node:*` — so the spec subpath can export it to a
5
+ * host store that honours the convention (`@archmax-ai/harness/spec`).
6
+ */
7
+ /**
8
+ * The non-text entries of Deep Agents' extension table (`backends/utils.ts`,
9
+ * identical in 1.13.4 and 1.14.2), which it does not export. Every other
10
+ * extension maps to a text type, or to `text/plain` by default, so only these
11
+ * decide anything. Pinned against `FilesystemBackend` by `binary-read.test.ts`.
12
+ */
13
+ export declare const BINARY_MIME_TYPES: Readonly<Record<string, string>>;
14
+ /**
15
+ * The MIME type for a path's binary extension, or `undefined` when Deep Agents
16
+ * would read it as text. A `write` to a path this names carries base64, which a
17
+ * store honouring Deep Agents' convention decodes to the bytes.
18
+ */
19
+ export declare function binaryMimeTypeOf(path: string): string | undefined;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * The binary types of Deep Agents' v2 file format: the extensions `read_file`
3
+ * treats as non-text, and the paths a `write` addresses with base64 that the
4
+ * store decodes. Pure — no `node:*` — so the spec subpath can export it to a
5
+ * host store that honours the convention (`@archmax-ai/harness/spec`).
6
+ */
7
+ /**
8
+ * The non-text entries of Deep Agents' extension table (`backends/utils.ts`,
9
+ * identical in 1.13.4 and 1.14.2), which it does not export. Every other
10
+ * extension maps to a text type, or to `text/plain` by default, so only these
11
+ * decide anything. Pinned against `FilesystemBackend` by `binary-read.test.ts`.
12
+ */
13
+ export const BINARY_MIME_TYPES = {
14
+ ".png": "image/png",
15
+ ".jpg": "image/jpeg",
16
+ ".jpeg": "image/jpeg",
17
+ ".gif": "image/gif",
18
+ ".webp": "image/webp",
19
+ ".heic": "image/heic",
20
+ ".heif": "image/heif",
21
+ ".mp3": "audio/mpeg",
22
+ ".wav": "audio/wav",
23
+ ".aiff": "audio/aiff",
24
+ ".aac": "audio/aac",
25
+ ".ogg": "audio/ogg",
26
+ ".flac": "audio/flac",
27
+ ".mp4": "video/mp4",
28
+ ".webm": "video/webm",
29
+ ".mpeg": "video/mpeg",
30
+ ".mov": "video/quicktime",
31
+ ".avi": "video/x-msvideo",
32
+ ".flv": "video/x-flv",
33
+ ".mpg": "video/mpeg",
34
+ ".wmv": "video/x-ms-wmv",
35
+ ".3gpp": "video/3gpp",
36
+ ".pdf": "application/pdf",
37
+ ".ppt": "application/vnd.ms-powerpoint",
38
+ ".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
39
+ };
40
+ /** A path's extension as `node:path`'s `extname` reads it: from the last dot of the last segment, not a leading one. */
41
+ function extensionOf(path) {
42
+ const name = path.slice(path.lastIndexOf("/") + 1);
43
+ const dot = name.lastIndexOf(".");
44
+ return dot > 0 ? name.slice(dot) : "";
45
+ }
46
+ /**
47
+ * The MIME type for a path's binary extension, or `undefined` when Deep Agents
48
+ * would read it as text. A `write` to a path this names carries base64, which a
49
+ * store honouring Deep Agents' convention decodes to the bytes.
50
+ */
51
+ export function binaryMimeTypeOf(path) {
52
+ return BINARY_MIME_TYPES[extensionOf(path).toLocaleLowerCase()];
53
+ }
54
+ //# sourceMappingURL=binary-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binary-types.js","sourceRoot":"","sources":["../../src/core/binary-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAqC;IACjE,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,YAAY;IACrB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,iBAAiB;IACzB,MAAM,EAAE,iBAAiB;IACzB,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,gBAAgB;IACxB,OAAO,EAAE,YAAY;IACrB,MAAM,EAAE,iBAAiB;IACzB,MAAM,EAAE,+BAA+B;IACvC,OAAO,EAAE,2EAA2E;CACrF,CAAC;AAEF,wHAAwH;AACxH,SAAS,WAAW,CAAC,IAAY;IAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACnD,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACxC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,iBAAiB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,iBAAiB,EAAE,CAAC,CAAC;AAClE,CAAC"}
@@ -0,0 +1,43 @@
1
+ import type { StructuredTool } from "@langchain/core/tools";
2
+ import type { BackendProtocolV2 } from "deepagents";
3
+ import type { MountPrefixes } from "./mounts.js";
4
+ /** A successful operation, in workspace form. */
5
+ export interface FileOperationDone {
6
+ source: string;
7
+ destination?: string;
8
+ bytes?: number;
9
+ }
10
+ export type FileOperationResult = FileOperationDone | {
11
+ error: string;
12
+ };
13
+ /** Copy one workspace file. Paths in any spelling; the result names them in canonical form. */
14
+ export declare function copyWorkspaceFile(backend: BackendProtocolV2, source: string, destination: string, options?: {
15
+ overwrite?: boolean;
16
+ }): Promise<FileOperationResult>;
17
+ /**
18
+ * Move one workspace file: the destination is written (and verified) before the
19
+ * source is removed, so a failure leaves a duplicate rather than a loss. A
20
+ * source the workspace serves read-only is refused before anything is written —
21
+ * the kernel refuses it too, but an ungoverned agent has only this.
22
+ */
23
+ export declare function moveWorkspaceFile(backend: BackendProtocolV2, source: string, destination: string, options?: {
24
+ overwrite?: boolean;
25
+ mountPrefixes?: MountPrefixes;
26
+ }): Promise<FileOperationResult>;
27
+ /** Remove one workspace file — a file, never a folder. */
28
+ export declare function removeWorkspaceFile(backend: BackendProtocolV2, path: string): Promise<FileOperationResult>;
29
+ /** The descriptions the model is handed. */
30
+ export declare const FILE_OPERATION_DESCRIPTIONS: {
31
+ readonly copy_file: string;
32
+ readonly move_file: string;
33
+ readonly remove_file: string;
34
+ };
35
+ /**
36
+ * The runtime's file operations over `ctx.backend` — the assembly's workspace
37
+ * backend, which resolves agent paths against the session bound for the turn,
38
+ * as Deep Agents' own file tools do.
39
+ */
40
+ export declare function createFileOperationTools(ctx: {
41
+ backend: BackendProtocolV2;
42
+ mountPrefixes: MountPrefixes;
43
+ }): StructuredTool[];
@@ -0,0 +1,368 @@
1
+ import { tool } from "langchain";
2
+ import { z } from "zod";
3
+ import { COPY_FILE_TOOL, MOVE_FILE_TOOL, REMOVE_FILE_TOOL } from "../machine/tool-names.js";
4
+ import { binaryMimeTypeOf, formatSize } from "./binary-read.js";
5
+ import { canonicalizeRelPath } from "./workspace.js";
6
+ import { classifyWorkspacePath } from "./zones.js";
7
+ /** Why the store refused a path, from whatever it said or threw. */
8
+ function classify(detail) {
9
+ if (/read-only mount/.test(detail))
10
+ return "it is served by a read-only mount";
11
+ if (/symlink|symbolic link|ELOOP/i.test(detail))
12
+ return "it is a symbolic link, which the workspace does not follow";
13
+ if (/EISDIR|is_directory|is a directory/i.test(detail))
14
+ return "it is a directory; this tool works on one file";
15
+ if (/ENOENT|not found|file_not_found/i.test(detail))
16
+ return "it does not exist";
17
+ if (/EACCES|EPERM|permission/i.test(detail))
18
+ return "permission was denied";
19
+ if (/cannot delete|not support|not available/i.test(detail))
20
+ return "the store serving it cannot do that";
21
+ return "the store refused it";
22
+ }
23
+ const message = (err) => (err instanceof Error ? err.message : String(err));
24
+ /** A workspace-form path as every backend accepts it. */
25
+ const keyOf = (path) => `/${path}`;
26
+ /** `TextDecoder` that refuses invalid UTF-8 and keeps a byte-order mark. */
27
+ const strictUtf8 = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true });
28
+ function asText(bytes) {
29
+ try {
30
+ return strictUtf8.decode(bytes);
31
+ }
32
+ catch {
33
+ return null;
34
+ }
35
+ }
36
+ function sameBytes(a, b) {
37
+ if (a.byteLength !== b.byteLength)
38
+ return false;
39
+ for (let i = 0; i < a.byteLength; i++)
40
+ if (a[i] !== b[i])
41
+ return false;
42
+ return true;
43
+ }
44
+ /** One path's raw bytes, or `null` when the backend has no raw transfer or it failed. */
45
+ async function download(backend, path) {
46
+ if (!backend.downloadFiles)
47
+ return null;
48
+ try {
49
+ const [res] = await backend.downloadFiles([keyOf(path)]);
50
+ return res?.content ?? null;
51
+ }
52
+ catch {
53
+ return null;
54
+ }
55
+ }
56
+ /**
57
+ * `readRaw` as a gate: the file's content, or the refusal any read of it meets.
58
+ * A filesystem `readRaw` reports a directory as not found; the raw channel names
59
+ * it, and is consulted for the reason only.
60
+ */
61
+ async function gate(backend, path, verb) {
62
+ let refusal;
63
+ try {
64
+ const res = await backend.readRaw(keyOf(path));
65
+ if (!res.error && res.data)
66
+ return { content: res.data.content };
67
+ refusal = res.error ?? "not found";
68
+ }
69
+ catch (err) {
70
+ refusal = message(err);
71
+ }
72
+ let reason = classify(refusal);
73
+ if (reason === "it does not exist" && backend.downloadFiles) {
74
+ try {
75
+ const [res] = await backend.downloadFiles([keyOf(path)]);
76
+ if (res?.error === "is_directory")
77
+ reason = classify(res.error);
78
+ }
79
+ catch {
80
+ // No raw transfer: the first reason stands.
81
+ }
82
+ }
83
+ return { error: `Cannot ${verb} '${path}': ${reason}.` };
84
+ }
85
+ /** Whether a file is already at `path` (a refusal to read it says nothing either way). */
86
+ async function fileExists(backend, path) {
87
+ try {
88
+ const res = await backend.readRaw(keyOf(path));
89
+ return !res.error && res.data !== undefined;
90
+ }
91
+ catch {
92
+ return false;
93
+ }
94
+ }
95
+ /** The source's exact bytes, gated by `readRaw`'s refusals. */
96
+ async function readSource(backend, path, verb) {
97
+ const read = await gate(backend, path, verb);
98
+ if ("error" in read)
99
+ return read;
100
+ const { content } = read;
101
+ if (ArrayBuffer.isView(content)) {
102
+ return { bytes: new Uint8Array(content.buffer, content.byteOffset, content.byteLength) };
103
+ }
104
+ // Text: the backend decoded it, which loses whatever was not UTF-8. The path
105
+ // has passed `readRaw`'s refusals, so its raw bytes may now be taken.
106
+ const exact = await download(backend, path);
107
+ if (exact)
108
+ return { bytes: exact };
109
+ const text = Array.isArray(content) ? content.join("\n") : String(content ?? "");
110
+ // Without the raw channel, a replacement character is where decoding may have
111
+ // lost bytes: refuse rather than write something the source never held.
112
+ if (text.includes("�")) {
113
+ return {
114
+ error: `Cannot ${verb} '${path}': it is not UTF-8 text, and the store serving it cannot hand over ` +
115
+ `its bytes unchanged.`,
116
+ };
117
+ }
118
+ return { bytes: new TextEncoder().encode(text) };
119
+ }
120
+ /** A `write`/`uploadFiles` outcome as the refusal, or `null` when it succeeded. */
121
+ async function attempt(path, verb, op) {
122
+ try {
123
+ const res = await op();
124
+ return res?.error ? `Cannot ${verb} to '${path}': ${classify(res.error)}.` : null;
125
+ }
126
+ catch (err) {
127
+ return `Cannot ${verb} to '${path}': ${classify(message(err))}.`;
128
+ }
129
+ }
130
+ /**
131
+ * What the store now holds at `path`, read back to confirm a write: the raw
132
+ * bytes when it can download them, else what `readRaw` returns (bytes, or text
133
+ * encoded as UTF-8). `null` when it cannot be read back at all.
134
+ */
135
+ async function readBack(backend, path) {
136
+ const raw = await download(backend, path);
137
+ if (raw)
138
+ return raw;
139
+ try {
140
+ const res = await backend.readRaw(keyOf(path));
141
+ if (res.error || !res.data)
142
+ return null;
143
+ const { content } = res.data;
144
+ if (ArrayBuffer.isView(content))
145
+ return new Uint8Array(content.buffer, content.byteOffset, content.byteLength);
146
+ return new TextEncoder().encode(Array.isArray(content) ? content.join("\n") : String(content));
147
+ }
148
+ catch {
149
+ return null;
150
+ }
151
+ }
152
+ /**
153
+ * Write `bytes` at `path` and confirm the store kept them, or say why not.
154
+ *
155
+ * The text channel goes first whenever it can carry the bytes: base64 for a
156
+ * binary-typed path (Deep Agents' convention — the store decodes it), the text
157
+ * itself when the bytes are valid UTF-8. A store that kept something else — the
158
+ * base64 string as given, a decoded variant — gets the raw channel next, when it
159
+ * has one. Bytes no text channel carries claim the path with an empty `write`
160
+ * first, because the upload follows a symlink and a write does not. Every write
161
+ * is read back; a destination the operation created and could not fill is
162
+ * removed again, so a refusal leaves nothing behind.
163
+ */
164
+ async function writeDestination(backend, path, bytes, verb, fresh) {
165
+ const binaryType = binaryMimeTypeOf(path) !== undefined;
166
+ const text = binaryType ? null : asText(bytes);
167
+ const kept = async () => {
168
+ const back = await readBack(backend, path);
169
+ return back !== null && sameBytes(back, bytes);
170
+ };
171
+ if (binaryType || text !== null) {
172
+ const content = binaryType ? Buffer.from(bytes).toString("base64") : text;
173
+ const refused = await attempt(path, verb, async () => backend.write(keyOf(path), content));
174
+ if (refused)
175
+ return refused;
176
+ if (await kept())
177
+ return null;
178
+ }
179
+ else {
180
+ const claimed = await attempt(path, verb, async () => backend.write(keyOf(path), ""));
181
+ if (claimed)
182
+ return claimed;
183
+ }
184
+ if (backend.uploadFiles) {
185
+ const uploadFiles = backend.uploadFiles.bind(backend);
186
+ const refused = await attempt(path, verb, async () => (await uploadFiles([[keyOf(path), bytes]]))[0]);
187
+ if (refused)
188
+ return refused + (await leftBehind(backend, path, fresh));
189
+ if (await kept())
190
+ return null;
191
+ }
192
+ const why = binaryType
193
+ ? "a write to a binary-typed path carries base64, which the store must decode, and it did not"
194
+ : text === null
195
+ ? "it holds files of this type as text, and this file is not text"
196
+ : "what it holds differs from what was written";
197
+ return (`Cannot ${verb} to '${path}': the store serving it did not keep the file's bytes — ${why}.` +
198
+ (await leftBehind(backend, path, fresh)));
199
+ }
200
+ /** Undo a failed write the operation created; the sentence saying what is left. */
201
+ async function leftBehind(backend, path, fresh) {
202
+ if (fresh && (await removeAt(backend, path)) === null)
203
+ return " Nothing was kept.";
204
+ return ` '${path}' was left as the store wrote it.`;
205
+ }
206
+ /** Canonical workspace form of each path, or the refusal of the first that has none. */
207
+ function canonicalPaths(verb, ...given) {
208
+ const paths = [];
209
+ for (const path of given) {
210
+ const resolved = canonicalizeRelPath(path);
211
+ if (resolved.escapes)
212
+ return { error: `Cannot ${verb} '${path}': it resolves outside the workspace root.` };
213
+ if (resolved.path === "")
214
+ return { error: `Cannot ${verb} '${path}': it names the workspace root, not a file.` };
215
+ paths.push(resolved.path);
216
+ }
217
+ return { paths };
218
+ }
219
+ /** The checks a copy and a move share before any byte moves. */
220
+ async function precheckTransfer(backend, verb, source, destination, overwrite) {
221
+ const canonical = canonicalPaths(verb, source, destination);
222
+ if ("error" in canonical)
223
+ return canonical;
224
+ const [from, to] = canonical.paths;
225
+ if (from === to) {
226
+ return { error: `Cannot ${verb} '${from}' onto itself: the source and the destination are the same file.` };
227
+ }
228
+ const existed = await fileExists(backend, to);
229
+ if (existed && !overwrite) {
230
+ return {
231
+ error: `Cannot ${verb} to '${to}': a file is already there. Pass overwrite: true to replace it, or ` +
232
+ `choose another destination.`,
233
+ };
234
+ }
235
+ return { from, to, fresh: !existed };
236
+ }
237
+ /** Copy one workspace file. Paths in any spelling; the result names them in canonical form. */
238
+ export async function copyWorkspaceFile(backend, source, destination, options = {}) {
239
+ const checked = await precheckTransfer(backend, "copy", source, destination, options.overwrite === true);
240
+ if ("error" in checked)
241
+ return checked;
242
+ const read = await readSource(backend, checked.from, "copy");
243
+ if ("error" in read)
244
+ return read;
245
+ const refused = await writeDestination(backend, checked.to, read.bytes, "copy", checked.fresh);
246
+ if (refused)
247
+ return { error: refused };
248
+ return { source: checked.from, destination: checked.to, bytes: read.bytes.byteLength };
249
+ }
250
+ /**
251
+ * Move one workspace file: the destination is written (and verified) before the
252
+ * source is removed, so a failure leaves a duplicate rather than a loss. A
253
+ * source the workspace serves read-only is refused before anything is written —
254
+ * the kernel refuses it too, but an ungoverned agent has only this.
255
+ */
256
+ export async function moveWorkspaceFile(backend, source, destination, options = {}) {
257
+ const checked = await precheckTransfer(backend, "move", source, destination, options.overwrite === true);
258
+ if ("error" in checked)
259
+ return checked;
260
+ const { from, to, fresh } = checked;
261
+ if (classifyWorkspacePath(from, options.mountPrefixes) === "authored") {
262
+ return {
263
+ error: `Cannot move '${from}': it is served by a read-only mount, so it cannot be removed. Use ` +
264
+ `copy_file to copy it instead.`,
265
+ };
266
+ }
267
+ const read = await readSource(backend, from, "move");
268
+ if ("error" in read)
269
+ return read;
270
+ const refused = await writeDestination(backend, to, read.bytes, "move", fresh);
271
+ if (refused)
272
+ return { error: refused };
273
+ const removed = await removeAt(backend, from);
274
+ if (removed) {
275
+ return {
276
+ error: `Copied '${from}' to '${to}', but could not remove '${from}': ${removed}. Both files now ` +
277
+ `exist.`,
278
+ };
279
+ }
280
+ return { source: from, destination: to, bytes: read.bytes.byteLength };
281
+ }
282
+ /** Delete the file at `path`; the reason it was refused, or `null`. */
283
+ async function removeAt(backend, path) {
284
+ if (!backend.delete)
285
+ return "the store serving it cannot delete";
286
+ try {
287
+ const res = await backend.delete(keyOf(path));
288
+ return res.error ? classify(res.error) : null;
289
+ }
290
+ catch (err) {
291
+ return classify(message(err));
292
+ }
293
+ }
294
+ /** Remove one workspace file — a file, never a folder. */
295
+ export async function removeWorkspaceFile(backend, path) {
296
+ const canonical = canonicalPaths("remove", path);
297
+ if ("error" in canonical)
298
+ return canonical;
299
+ const [target] = canonical.paths;
300
+ // The same refusals a read meets: a folder, a missing file, a symlink.
301
+ const read = await gate(backend, target, "remove");
302
+ if ("error" in read)
303
+ return read;
304
+ const refused = await removeAt(backend, target);
305
+ if (refused)
306
+ return { error: `Cannot remove '${target}': ${refused}.` };
307
+ return { source: target };
308
+ }
309
+ /** The descriptions the model is handed. */
310
+ export const FILE_OPERATION_DESCRIPTIONS = {
311
+ [COPY_FILE_TOOL]: [
312
+ "Copies one file to another path, byte for byte — text or binary (an image, a PDF, a .docx) — " +
313
+ "without reading it into the conversation. Creates the destination's folders and leaves the " +
314
+ "source untouched.",
315
+ "",
316
+ "Usage:",
317
+ "- Use it to start from a template or asset (e.g. one in a skill's assets/) instead of " +
318
+ "read_file followed by write_file.",
319
+ "- A file already at destination is refused unless overwrite is true.",
320
+ "- It copies a single file, not a folder.",
321
+ ].join("\n"),
322
+ [MOVE_FILE_TOOL]: [
323
+ "Moves one file to another path, byte for byte, without reading it into the conversation. The " +
324
+ "destination is written before the source is removed, so a failure leaves a copy, never a loss.",
325
+ "",
326
+ "Usage:",
327
+ "- A file already at destination is refused unless overwrite is true.",
328
+ "- A file in a read-only folder cannot be moved; use copy_file for it.",
329
+ "- It moves a single file, not a folder.",
330
+ ].join("\n"),
331
+ [REMOVE_FILE_TOOL]: [
332
+ "Deletes one file.",
333
+ "",
334
+ "Usage:",
335
+ "- It deletes a single file, not a folder.",
336
+ "- A file in a read-only folder cannot be removed.",
337
+ ].join("\n"),
338
+ };
339
+ const transferSchema = (verb) => z.object({
340
+ source: z.string().describe(`Path of the file to ${verb}`),
341
+ destination: z.string().describe(`Path to ${verb} it to`),
342
+ overwrite: z
343
+ .boolean()
344
+ .optional()
345
+ .describe("Replace a file already at destination (default false: such a destination is refused)"),
346
+ });
347
+ /** One line for the model: the success sentence, or `Error: …`. */
348
+ function render(res, done) {
349
+ return "error" in res ? `Error: ${res.error}` : done(res);
350
+ }
351
+ /**
352
+ * The runtime's file operations over `ctx.backend` — the assembly's workspace
353
+ * backend, which resolves agent paths against the session bound for the turn,
354
+ * as Deep Agents' own file tools do.
355
+ */
356
+ export function createFileOperationTools(ctx) {
357
+ const { backend, mountPrefixes } = ctx;
358
+ return [
359
+ tool(async ({ source, destination, overwrite }) => render(await copyWorkspaceFile(backend, source, destination, { overwrite: overwrite === true }), (ok) => `Copied '${ok.source}' to '${ok.destination}' (${formatSize(ok.bytes ?? 0)}).`), { name: COPY_FILE_TOOL, description: FILE_OPERATION_DESCRIPTIONS[COPY_FILE_TOOL], schema: transferSchema("copy") }),
360
+ tool(async ({ source, destination, overwrite }) => render(await moveWorkspaceFile(backend, source, destination, { overwrite: overwrite === true, mountPrefixes }), (ok) => `Moved '${ok.source}' to '${ok.destination}' (${formatSize(ok.bytes ?? 0)}).`), { name: MOVE_FILE_TOOL, description: FILE_OPERATION_DESCRIPTIONS[MOVE_FILE_TOOL], schema: transferSchema("move") }),
361
+ tool(async ({ file_path }) => render(await removeWorkspaceFile(backend, file_path), (ok) => `Removed '${ok.source}'.`), {
362
+ name: REMOVE_FILE_TOOL,
363
+ description: FILE_OPERATION_DESCRIPTIONS[REMOVE_FILE_TOOL],
364
+ schema: z.object({ file_path: z.string().describe("Path of the file to delete") }),
365
+ }),
366
+ ];
367
+ }
368
+ //# sourceMappingURL=file-operations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-operations.js","sourceRoot":"","sources":["../../src/core/file-operations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AA4CnD,oEAAoE;AACpE,SAAS,QAAQ,CAAC,MAAc;IAC9B,IAAI,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,OAAO,mCAAmC,CAAC;IAC/E,IAAI,8BAA8B,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,OAAO,4DAA4D,CAAC;IACrH,IAAI,qCAAqC,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,OAAO,gDAAgD,CAAC;IAChH,IAAI,kCAAkC,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,OAAO,mBAAmB,CAAC;IAChF,IAAI,0BAA0B,CAA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