@sixb/agent 0.2.3 → 0.2.5

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 (149) hide show
  1. package/README.md +3 -3
  2. package/dist/agent-prompt.d.ts.map +1 -1
  3. package/dist/artifacts/layout-check/layout-check.d.ts +21 -24
  4. package/dist/artifacts/layout-check/layout-check.d.ts.map +1 -1
  5. package/dist/artifacts/publish-tool.d.ts +26 -44
  6. package/dist/artifacts/publish-tool.d.ts.map +1 -1
  7. package/dist/ask-tool.d.ts +62 -0
  8. package/dist/ask-tool.d.ts.map +1 -0
  9. package/dist/attachments.d.ts +1 -1
  10. package/dist/attachments.d.ts.map +1 -1
  11. package/dist/background-commands.d.ts +3 -3
  12. package/dist/background-commands.d.ts.map +1 -1
  13. package/dist/background-notices.d.ts.map +1 -1
  14. package/dist/child-files.d.ts +1 -1
  15. package/dist/child-questions.d.ts +1 -1
  16. package/dist/index.d.ts +1 -2
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +10457 -7971
  19. package/dist/index.js.map +46 -38
  20. package/dist/run-agent-turn.d.ts +3 -14
  21. package/dist/run-agent-turn.d.ts.map +1 -1
  22. package/dist/run-conversation-turn.d.ts.map +1 -1
  23. package/dist/run-environment.d.ts +4 -1
  24. package/dist/run-environment.d.ts.map +1 -1
  25. package/dist/run-subagent.d.ts +1 -1
  26. package/dist/run-subagent.d.ts.map +1 -1
  27. package/dist/sandbox-api-context.d.ts.map +1 -1
  28. package/dist/search-script.d.ts +7 -0
  29. package/dist/search-script.d.ts.map +1 -0
  30. package/dist/skills/built-in.d.ts.map +1 -1
  31. package/dist/subagent-tools.d.ts +20 -1
  32. package/dist/subagent-tools.d.ts.map +1 -1
  33. package/dist/tools/background.d.ts +50 -18
  34. package/dist/tools/background.d.ts.map +1 -1
  35. package/dist/tools/bash.d.ts +1 -0
  36. package/dist/tools/bash.d.ts.map +1 -1
  37. package/dist/tools/edit-text.d.ts +22 -0
  38. package/dist/tools/edit-text.d.ts.map +1 -0
  39. package/dist/tools/edit.d.ts +54 -0
  40. package/dist/tools/edit.d.ts.map +1 -0
  41. package/dist/tools/file-writes.d.ts +52 -0
  42. package/dist/tools/file-writes.d.ts.map +1 -0
  43. package/dist/tools/glob.d.ts +41 -0
  44. package/dist/tools/glob.d.ts.map +1 -0
  45. package/dist/tools/grep.d.ts +64 -0
  46. package/dist/tools/grep.d.ts.map +1 -0
  47. package/dist/tools/model-spec.d.ts.map +1 -1
  48. package/dist/tools/read.d.ts +16 -3
  49. package/dist/tools/read.d.ts.map +1 -1
  50. package/dist/tools/sandbox-search.d.ts +26 -0
  51. package/dist/tools/sandbox-search.d.ts.map +1 -0
  52. package/dist/tools/search/command.d.ts +15 -0
  53. package/dist/tools/search/command.d.ts.map +1 -0
  54. package/dist/tools/search/gitignore.d.ts +28 -0
  55. package/dist/tools/search/gitignore.d.ts.map +1 -0
  56. package/dist/tools/search/glob.d.ts +15 -0
  57. package/dist/tools/search/glob.d.ts.map +1 -0
  58. package/dist/tools/search/main.d.ts +2 -0
  59. package/dist/tools/search/main.d.ts.map +1 -0
  60. package/dist/tools/search/match.d.ts +30 -0
  61. package/dist/tools/search/match.d.ts.map +1 -0
  62. package/dist/tools/search/pattern.d.ts +19 -0
  63. package/dist/tools/search/pattern.d.ts.map +1 -0
  64. package/dist/tools/search/read.d.ts +62 -0
  65. package/dist/tools/search/read.d.ts.map +1 -0
  66. package/dist/tools/search/request.d.ts +80 -0
  67. package/dist/tools/search/request.d.ts.map +1 -0
  68. package/dist/tools/search/search.d.ts +4 -0
  69. package/dist/tools/search/search.d.ts.map +1 -0
  70. package/dist/tools/search/walk.d.ts +43 -0
  71. package/dist/tools/search/walk.d.ts.map +1 -0
  72. package/dist/tools/tool-outputs.d.ts.map +1 -1
  73. package/dist/tools/view-file.d.ts +20 -23
  74. package/dist/tools/view-file.d.ts.map +1 -1
  75. package/dist/tools/web-fetch/tool.d.ts +1 -0
  76. package/dist/tools/web-fetch/tool.d.ts.map +1 -1
  77. package/dist/tools/web-search.d.ts +1 -0
  78. package/dist/tools/web-search.d.ts.map +1 -1
  79. package/dist/tools/write.d.ts +36 -0
  80. package/dist/tools/write.d.ts.map +1 -0
  81. package/dist/turn-inbox.d.ts +75 -0
  82. package/dist/turn-inbox.d.ts.map +1 -0
  83. package/package.json +6 -4
  84. package/src/agent-prompt.ts +10 -9
  85. package/src/agent-runtime/preflight.ts +1 -0
  86. package/src/artifacts/layout-check/check.cjs +176 -95
  87. package/src/artifacts/layout-check/layout-check.ts +118 -76
  88. package/src/artifacts/publish-tool.ts +123 -192
  89. package/src/ask-tool.ts +223 -0
  90. package/src/attachments.ts +7 -6
  91. package/src/background-commands.ts +5 -5
  92. package/src/background-notices.ts +5 -12
  93. package/src/child-files.ts +1 -1
  94. package/src/child-questions.ts +1 -1
  95. package/src/context-compaction.ts +4 -1
  96. package/src/generated/search.mjs +985 -0
  97. package/src/index.ts +1 -2
  98. package/src/run-agent-turn.ts +99 -133
  99. package/src/run-child.ts +1 -1
  100. package/src/run-conversation-turn.ts +8 -5
  101. package/src/run-environment.ts +40 -21
  102. package/src/run-subagent.ts +4 -4
  103. package/src/sandbox-api-context.ts +3 -0
  104. package/src/search-script-assets.d.ts +5 -0
  105. package/src/search-script.ts +9 -0
  106. package/src/skills/built-in.ts +16 -0
  107. package/src/skills/sixb-artifacts/SKILL.md +13 -13
  108. package/src/skills/sixb-artifacts/canvas.md +5 -4
  109. package/src/skills/sixb-artifacts/document.md +92 -5
  110. package/src/skills/sixb-artifacts/examples/document/service-proposal/design.css +114 -0
  111. package/src/skills/sixb-artifacts/examples/document/service-proposal/document.html +159 -0
  112. package/src/skills/sixb-artifacts/examples/document/service-proposal/images/fieldwise.svg +1 -0
  113. package/src/skills/sixb-artifacts/examples/document/service-proposal/images/harbor-pine.svg +1 -0
  114. package/src/skills/sixb-artifacts/page.md +2 -2
  115. package/src/skills/sixb-artifacts/queries.md +2 -1
  116. package/src/skills/sixb-artifacts/slides.md +2 -2
  117. package/src/subagent-tools.ts +115 -81
  118. package/src/tools/background.ts +227 -67
  119. package/src/tools/bash.ts +2 -1
  120. package/src/tools/edit-text.ts +241 -0
  121. package/src/tools/edit.ts +166 -0
  122. package/src/tools/file-writes.ts +270 -0
  123. package/src/tools/glob.ts +124 -0
  124. package/src/tools/grep.ts +190 -0
  125. package/src/tools/model-spec.ts +13 -13
  126. package/src/tools/read.ts +75 -9
  127. package/src/tools/sandbox-search.ts +219 -0
  128. package/src/tools/search/command.ts +116 -0
  129. package/src/tools/search/gitignore.ts +101 -0
  130. package/src/tools/search/glob.ts +90 -0
  131. package/src/tools/search/main.ts +9 -0
  132. package/src/tools/search/match.ts +278 -0
  133. package/src/tools/search/pattern.ts +178 -0
  134. package/src/tools/search/read.ts +237 -0
  135. package/src/tools/search/request.ts +101 -0
  136. package/src/tools/search/search.ts +297 -0
  137. package/src/tools/search/walk.ts +145 -0
  138. package/src/tools/tool-outputs.ts +9 -4
  139. package/src/tools/view-file.ts +78 -80
  140. package/src/tools/web-fetch/tool.ts +2 -1
  141. package/src/tools/web-search.ts +1 -0
  142. package/src/tools/write.ts +95 -0
  143. package/src/turn-inbox.ts +283 -0
  144. package/dist/artifacts/board-previews.d.ts +0 -41
  145. package/dist/artifacts/board-previews.d.ts.map +0 -1
  146. package/dist/ask-parent-tool.d.ts +0 -36
  147. package/dist/ask-parent-tool.d.ts.map +0 -1
  148. package/src/artifacts/board-previews.ts +0 -218
  149. package/src/ask-parent-tool.ts +0 -100
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grep.d.ts","sourceRoot":"","sources":["../../src/tools/grep.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyB,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAW3D,OAAO,KAAK,EAAE,SAAS,EAAoB,MAAM,kBAAkB,CAAA;AAEnE,eAAO,MAAM,cAAc;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AAE,SAAS,aAAa,EAAE,EACtC,OAAO,GAAE;IACP,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,GAAG,CAAC,EAAE,eAAe,CAAA;IAC9B,QAAQ,CAAC,aAAa,CAAC,EAAE,oBAAoB,CAAA;CACzC,GACL,SAAS,aAAa,EAAE,CAc1B;AAED,8FAA8F;AAC9F,wBAAgB,UAAU,CACxB,GAAG,EAAE,eAAe,GAAG,SAAS,EAChC,aAAa,EAAE,oBAAoB,GAAG,SAAS,GAC9C,OAAO,CAET"}
1
+ {"version":3,"file":"model-spec.d.ts","sourceRoot":"","sources":["../../src/tools/model-spec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAChF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAYhE;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,SAAS,aAAa,EAAE,EACtC,OAAO,GAAE;IACP,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,GAAG,CAAC,EAAE,eAAe,CAAA;IAC9B,QAAQ,CAAC,aAAa,CAAC,EAAE,oBAAoB,CAAA;CACzC,GACL,SAAS,aAAa,EAAE,CAe1B;AAED,8FAA8F;AAC9F,wBAAgB,UAAU,CACxB,GAAG,EAAE,eAAe,GAAG,SAAS,EAChC,aAAa,EAAE,oBAAoB,GAAG,SAAS,GAC9C,OAAO,CAET"}
@@ -1,8 +1,11 @@
1
1
  import type { ModelTool } from "@sixb/core/models";
2
2
  import { type AgentSandboxHandle } from "../sandbox-handle";
3
+ import { type FileReadLedger } from "./file-writes";
4
+ import { type SandboxFileViewer } from "./view-file";
3
5
  export declare const READ_TOOL_SPEC: {
4
6
  readonly name: "read";
5
- readonly description: "Read a UTF-8 text file relative to the sandbox working directory. Returns at most 2,000 lines or 50 KiB and includes nextOffset when more content remains. Prefer this over bash for reading files.";
7
+ readonly strict: true;
8
+ readonly description: "Read a file, or list a directory. Text comes as at most 2,000 lines or 50 KiB, with nextOffset when more remains; an image or a PDF comes as itself; a directory as its entries, folders ending in /. Prefer this over bash for reading files.";
6
9
  readonly inputSchema: {
7
10
  type: string;
8
11
  properties: {
@@ -30,6 +33,12 @@ export interface ReadToolInput {
30
33
  readonly offset?: number;
31
34
  readonly limit?: number;
32
35
  }
36
+ /** A directory's entries, names only, folders ending in `/`. */
37
+ export interface ReadDirectoryOutput {
38
+ readonly path: string;
39
+ readonly entries: readonly string[];
40
+ readonly truncated?: true;
41
+ }
33
42
  export interface ReadToolOutput {
34
43
  readonly path: string;
35
44
  readonly content: string;
@@ -38,6 +47,10 @@ export interface ReadToolOutput {
38
47
  readonly truncated: boolean;
39
48
  readonly nextOffset?: number;
40
49
  }
41
- /** Build the bounded UTF-8 file reader from the run's lazy sandbox resolver. */
42
- export declare function createReadTool(resolveSandbox: () => Promise<AgentSandboxHandle>): ModelTool<ReadToolInput>;
50
+ /** Build the reader from the run's lazy sandbox resolver. */
51
+ export declare function createReadTool(resolveSandbox: () => Promise<AgentSandboxHandle>,
52
+ /** Where each read is recorded, so `edit` and `write` change only a file the run has read. */
53
+ ledger?: FileReadLedger,
54
+ /** Shows images, PDFs and other files that are not text; without it, they are refused. */
55
+ viewer?: SandboxFileViewer): ModelTool<ReadToolInput>;
43
56
  //# sourceMappingURL=read.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../src/tools/read.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAyB,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAGzE,OAAO,EAAE,KAAK,kBAAkB,EAAe,MAAM,mBAAmB,CAAA;AAOxE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;CAsBjB,CAAA;AAEV,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAA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C,QAAQ,CAAC,SAAS,CAAC,EAAE,IAAI,CAAA;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED,6DAA6D;AAC7D,wBAAgB,cAAc,CAC5B,cAAc,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC;AACjD,8FAA8F;AAC9F,MAAM,CAAC,EAAE,cAAc;AACvB,0FAA0F;AAC1F,MAAM,CAAC,EAAE,iBAAiB,GACzB,SAAS,CAAC,aAAa,CAAC,CA2E1B"}
@@ -0,0 +1,26 @@
1
+ import { AgentToolPublicError } from "@sixb/core";
2
+ import { type AgentSandboxHandle } from "../sandbox-handle";
3
+ import type { GlobSearchRequest, GrepSearchRequest } from "./search/request";
4
+ type SearchTool = "glob" | "grep";
5
+ type SandboxSearchRequest = Omit<GlobSearchRequest, "contextDirectory" | "timeoutMs"> | Omit<GrepSearchRequest, "contextDirectory" | "timeoutMs">;
6
+ /**
7
+ * Search with the run's `lib/search.mjs`, the same in every sandbox and on a computer. The script
8
+ * confines the search to the working directory and the context directory, as `read` does, and
9
+ * prints one JSON line. Returns that result, unchecked.
10
+ *
11
+ * A search that ran too long, or a script that could not search, is the model's to know: it can
12
+ * narrow the search, or fall back to bash.
13
+ */
14
+ export declare function runSandboxSearch(handle: AgentSandboxHandle, request: SandboxSearchRequest, signal: AbortSignal): Promise<unknown>;
15
+ /**
16
+ * A search the run's script could not make: the model reads why, in words of ours rather than the
17
+ * sandbox's, and the way out. The script's own words stay in the cause.
18
+ */
19
+ export declare function searchUnavailable(tool: SearchTool, reason: string, cause: unknown): AgentToolPublicError;
20
+ /** An optional value left out: models send `"null"` or `"undefined"` for one. */
21
+ export declare function isLeftOut(value: unknown): boolean;
22
+ export declare function optionalPathInput(value: unknown, tool: SearchTool): string | undefined;
23
+ export declare const INCOMPLETE_SEARCH_FOOTER = "(The search stopped after 20 seconds, before it looked everywhere: narrow the pattern or the path)";
24
+ export declare function isRecord(value: unknown): value is Record<string, unknown>;
25
+ export {};
26
+ //# sourceMappingURL=sandbox-search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox-search.d.ts","sourceRoot":"","sources":["../../src/tools/sandbox-search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAsB,MAAM,YAAY,CAAA;AAErE,OAAO,EAAE,KAAK,kBAAkB,EAAe,MAAM,mBAAmB,CAAA;AAGxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAmB,MAAM,kBAAkB,CAAA;AAO7F,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,CAAA;AAEjC,KAAK,oBAAoB,GACrB,IAAI,CAAC,iBAAiB,EAAE,kBAAkB,GAAG,WAAW,CAAC,GACzD,IAAI,CAAC,iBAAiB,EAAE,kBAAkB,GAAG,WAAW,CAAC,CAAA;AAE7D;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,kBAAkB,EAC1B,OAAO,EAAE,oBAAoB,EAC7B,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,OAAO,CAAC,CAkDlB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,GACb,oBAAoB,CAKtB;AAWD,iFAAiF;AACjF,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAQjD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,CAEtF;AAED,eAAO,MAAM,wBAAwB,uGACiE,CAAA;AAyEtG,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE"}
@@ -0,0 +1,15 @@
1
+ /** What the process prints, and the code it exits with. */
2
+ export interface SearchCommandResult {
3
+ readonly exitCode: number;
4
+ readonly stdout: string;
5
+ readonly stderr: string;
6
+ }
7
+ /**
8
+ * `search.mjs '<request JSON>'`: the Agent's `glob` and `grep`, the same in every sandbox. The
9
+ * request is one JSON argument, so no shell quoting reaches a pattern; the result is one JSON
10
+ * line. A search that cannot run exits 2 with `{"error":{"code","message"}}` on stderr: a request
11
+ * it does not understand is `invalid_arguments`, and a search the request names wrongly has its
12
+ * own code ({@link SearchError}). Anything else exits 3, as `internal_error`.
13
+ */
14
+ export declare function runSearchCommand(args: readonly string[], workingDirectory: string): Promise<SearchCommandResult>;
15
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/tools/search/command.ts"],"names":[],"mappings":"AAeA,2DAA2D;AAC3D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,mBAAmB,CAAC,CAgB9B"}
@@ -0,0 +1,28 @@
1
+ /** One line of a `.gitignore`. */
2
+ export interface IgnoreRule {
3
+ /** `!pattern`: brings back what an earlier rule excluded. */
4
+ readonly negated: boolean;
5
+ /** `pattern/`: matches folders only. */
6
+ readonly folderOnly: boolean;
7
+ /** No `/` but a trailing one: matches a name at any depth below the file's folder. */
8
+ readonly anyDepth: boolean;
9
+ readonly regex: RegExp;
10
+ }
11
+ /** A `.gitignore` and the folder it applies to, an absolute path. */
12
+ export interface IgnoreFile {
13
+ readonly folder: string;
14
+ readonly rules: readonly IgnoreRule[];
15
+ }
16
+ /**
17
+ * Parse a `.gitignore` as git reads it. A line that is not a valid pattern is skipped, as git
18
+ * skips it.
19
+ */
20
+ export declare function parseGitignore(text: string): IgnoreRule[];
21
+ /**
22
+ * Whether the `.gitignore` files that apply exclude an entry, given as an absolute path. Files
23
+ * come from the outermost folder in, and a later rule wins over an earlier one, so a deeper file
24
+ * overrides its parents. What lies inside an excluded folder is never asked about: the walk does
25
+ * not enter it, so a rule cannot bring it back, as in git.
26
+ */
27
+ export declare function isIgnored(files: readonly IgnoreFile[], path: string, isFolder: boolean): boolean;
28
+ //# sourceMappingURL=gitignore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitignore.d.ts","sourceRoot":"","sources":["../../../src/tools/search/gitignore.ts"],"names":[],"mappings":"AAEA,kCAAkC;AAClC,MAAM,WAAW,UAAU;IACzB,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,wCAAwC;IACxC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAA;IAC5B,sFAAsF;IACtF,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED,qEAAqE;AACrE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAA;CACtC;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,CAYzD;AAyCD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAkBhG"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * A `glob` pattern, matched against paths relative to where the search starts. A pattern without
3
+ * `/` matches a name at any depth (`*.md` finds every Markdown file), as in `.gitignore`; one with
4
+ * `/` matches from the start, with `**` for any number of folders.
5
+ */
6
+ export interface GlobMatcher {
7
+ matches(relativePath: string): boolean;
8
+ /** Whether a folder, relative to where the search starts, may hold a match. */
9
+ mayContain(relativeFolder: string): boolean;
10
+ /** A segment starts with `.`: the pattern looks for hidden files. */
11
+ readonly namesHidden: boolean;
12
+ readonly namesNodeModules: boolean;
13
+ }
14
+ export declare function compileGlob(pattern: string): GlobMatcher;
15
+ //# sourceMappingURL=glob.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../../../src/tools/search/glob.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAA;IACtC,+EAA+E;IAC/E,UAAU,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAA;IAC3C,qEAAqE;IACrE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;IAC7B,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAA;CACnC;AASD,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CA0CxD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/tools/search/main.ts"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ /** Where a line first matched `grep`'s pattern, in UTF-16 units. */
2
+ export interface LineMatch {
3
+ readonly index: number;
4
+ readonly length: number;
5
+ }
6
+ export interface TextMatcher {
7
+ /**
8
+ * Where a line first matches, over its first {@link SEARCH_LIMITS.matchCharacters} characters.
9
+ */
10
+ line(line: string): LineMatch | undefined;
11
+ /**
12
+ * Whether any line of a file may match: false only when none does, so a file that cannot match
13
+ * is never split into lines. It may say true of a file with no matching line.
14
+ */
15
+ mayMatch(text: string): boolean;
16
+ }
17
+ /**
18
+ * `grep`'s pattern, matched line by line. Case is smart: ignored when the pattern has no uppercase
19
+ * letter. Literal text is a plain substring search, which no line can slow down.
20
+ */
21
+ export declare function textMatcher(pattern: string, literal: boolean): TextMatcher;
22
+ /** A file's lines, without their `\n` or `\r\n`. */
23
+ export declare function lines(text: string): string[];
24
+ /**
25
+ * A line as `grep` shows it: whole when it fits, else cut to {@link SEARCH_LIMITS.lineCharacters}
26
+ * characters around its first match, so a match far into a minified line is still seen. A cut
27
+ * never splits a character written as two units.
28
+ */
29
+ export declare function cutLine(line: string, match: LineMatch): string;
30
+ //# sourceMappingURL=match.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"match.d.ts","sourceRoot":"","sources":["../../../src/tools/search/match.ts"],"names":[],"mappings":"AAEA,oEAAoE;AACpE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACxB;AAED,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;IACzC;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CAChC;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,WAAW,CAE1E;AAiND,oDAAoD;AACpD,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAI5C;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,MAAM,CAkB9D"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Path patterns, as `glob` and `.gitignore` write them: `*` and `?` within a name, `[abc]`,
3
+ * `[!abc]` and `[^abc]`, `**` as a whole segment for any number of folders, `\` to escape.
4
+ * `{a,b}` belongs to `glob` alone and is expanded before compiling ({@link expandBraces}).
5
+ */
6
+ export declare class PatternError extends Error {
7
+ }
8
+ /** A pattern's regular expression source, for a whole path relative to where it applies. */
9
+ export declare function pathPatternSource(pattern: string): string;
10
+ /** One name's source: never crosses a `/`. */
11
+ export declare function segmentSource(segment: string): string;
12
+ /**
13
+ * Expand `{a,b}` into its alternatives, nested ones included. A brace without a comma, or that
14
+ * never closes, is a literal brace.
15
+ */
16
+ export declare function expandBraces(pattern: string): string[];
17
+ /** Compile a regular expression source, or say why the pattern is not one. */
18
+ export declare function compilePattern(source: string, flags?: string): RegExp;
19
+ //# sourceMappingURL=pattern.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../../../src/tools/search/pattern.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,qBAAa,YAAa,SAAQ,KAAK;CAAG;AAE1C,4FAA4F;AAC5F,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAkBzD;AAED,8CAA8C;AAC9C,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA4BrD;AAmCD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAItD;AA0DD,8EAA8E;AAC9E,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,MAAM,CAMjE"}
@@ -0,0 +1,62 @@
1
+ export type FileText = {
2
+ readonly text: string;
3
+ } | {
4
+ readonly skipped: "binary" | "too_large" | "unreadable";
5
+ };
6
+ /** A read that knows what it will hold before it holds it. */
7
+ export interface PendingRead<R> {
8
+ /** The bytes the read holds once started, until its result is taken. */
9
+ readonly bytes: number;
10
+ /** Never rejects. */
11
+ read(): Promise<R>;
12
+ /** Lets go of a read never started. Never rejects. */
13
+ close(): Promise<void>;
14
+ }
15
+ /**
16
+ * A file opened to be read: one open, and its size from that descriptor. Its text comes from
17
+ * {@link PendingRead.read}, unless it is too large or unreadable, which is known already.
18
+ */
19
+ export declare function openText(path: string, strict: boolean): Promise<PendingRead<FileText>>;
20
+ /**
21
+ * How far reads run ahead of the file searched. Reading is most of a search's time, and mostly
22
+ * waiting: reads in flight overlap that wait. At most {@link READ_AHEAD} files are open, and a read
23
+ * starts only while the reads started hold at most {@link READ_AHEAD_BYTES} of file with it, but
24
+ * for the next file in line, which always starts: one file of 10 MiB past the bound at most. A
25
+ * binary file's bytes are let go once its first bytes show it is one.
26
+ *
27
+ * Memory: the texts read ahead take up to twice their bytes once decoded (a string with one
28
+ * character beyond Latin-1 takes two bytes for each): 52 MiB at worst, plus the file searched and
29
+ * the copies its search makes. 16 MiB reads a source tree as fast as 32 did, and holds half as
30
+ * much over a folder of large files.
31
+ */
32
+ export declare const READ_AHEAD = 32;
33
+ export declare const READ_AHEAD_BYTES: number;
34
+ /**
35
+ * Files read ahead of the one searched, handed back in the order they come, so a search finds the
36
+ * same lines, in the same order, as reading one file at a time. Files are opened as they come,
37
+ * and read as soon as they are open and their bytes fit. A search that stops reads no further than
38
+ * {@link READ_AHEAD} files past where it stopped.
39
+ */
40
+ export declare class ReadAhead<T, R> {
41
+ #private;
42
+ private readonly items;
43
+ /** Never rejects. */
44
+ private readonly open;
45
+ /** What a read that holds nothing once done looks like, a binary file. */
46
+ private readonly holdsNothing;
47
+ constructor(items: Iterator<T>,
48
+ /** Never rejects. */
49
+ open: (item: T) => Promise<PendingRead<R>>,
50
+ /** What a read that holds nothing once done looks like, a binary file. */
51
+ holdsNothing?: (result: R) => boolean);
52
+ next(): Promise<{
53
+ readonly item: T;
54
+ readonly read: R;
55
+ } | undefined>;
56
+ /**
57
+ * Starts no other read, waits for those in flight and closes the files never read: no file
58
+ * stays open past the search.
59
+ */
60
+ stop(): Promise<void>;
61
+ }
62
+ //# sourceMappingURL=read.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../src/tools/search/read.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,QAAQ,GAChB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,GAAG,WAAW,GAAG,YAAY,CAAA;CAAE,CAAA;AAE/D,8DAA8D;AAC9D,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,wEAAwE;IACxE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,qBAAqB;IACrB,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,CAAA;IAClB,sDAAsD;IACtD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACvB;AAED;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAsB5F;AAsED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,KAAK,CAAA;AAC5B,eAAO,MAAM,gBAAgB,QAAmB,CAAA;AAahD;;;;;GAKG;AACH,qBAAa,SAAS,CAAC,CAAC,EAAE,CAAC;;IAOvB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,qBAAqB;IACrB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,0EAA0E;IAC1E,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAJZ,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;IACnC,qBAAqB;IACJ,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC3D,0EAA0E;IACzD,YAAY,GAAE,CAAC,MAAM,EAAE,CAAC,KAAK,OAAqB;IAG/D,IAAI,IAAI,OAAO,CAAC;QAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA;KAAE,GAAG,SAAS,CAAC;IAiBzE;;;OAGG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAuD5B"}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * What `search.mjs` takes and prints: the contract between the `glob` and `grep` tools and the
3
+ * engine the run installs.
4
+ */
5
+ /** How much a search returns, and which files `grep` reads. */
6
+ export declare const SEARCH_LIMITS: {
7
+ readonly files: 100;
8
+ readonly lines: 100;
9
+ readonly linesPerFile: 20;
10
+ readonly lineCharacters: 500;
11
+ /** How much of a cut line shows before its first match. */
12
+ readonly matchLead: 40;
13
+ /**
14
+ * How much of a line `grep` matches. A backtracking regex can take seconds on one long line of a
15
+ * minified file; past this, a match is missed rather than the search stalled.
16
+ */
17
+ readonly matchCharacters: 4000;
18
+ /** What `grep`'s matches may add to its model text, in UTF-8 bytes, before it is truncated. */
19
+ readonly textBytes: number;
20
+ readonly fileBytes: number;
21
+ /** A NUL byte in this many first bytes makes a file binary. */
22
+ readonly binaryProbeBytes: number;
23
+ };
24
+ interface SearchScopeRequest {
25
+ /** Relative to the working directory, or absolute. Default: the working directory. */
26
+ readonly path?: string;
27
+ /**
28
+ * The run's context directory: the second root a search may start from. A search that starts
29
+ * outside it never enters it.
30
+ */
31
+ readonly contextDirectory?: string;
32
+ /** How long the walk may take before it stops with what it found. */
33
+ readonly timeoutMs: number;
34
+ }
35
+ export interface GlobSearchRequest extends SearchScopeRequest {
36
+ readonly tool: "glob";
37
+ readonly pattern: string;
38
+ }
39
+ export interface GrepSearchRequest extends SearchScopeRequest {
40
+ readonly tool: "grep";
41
+ /** A JavaScript regular expression, or the text itself with `literal`. */
42
+ readonly pattern: string;
43
+ /** A `glob` pattern the files searched must match. */
44
+ readonly include?: string;
45
+ readonly literal?: boolean;
46
+ }
47
+ export type SearchRequest = GlobSearchRequest | GrepSearchRequest;
48
+ /**
49
+ * Paths are relative to the working directory when they are under it, absolute otherwise.
50
+ * `incomplete` says the walk stopped at its deadline.
51
+ */
52
+ export interface GlobSearchResult {
53
+ readonly files: string[];
54
+ readonly truncated: boolean;
55
+ readonly incomplete?: true;
56
+ }
57
+ export interface GrepMatch {
58
+ readonly path: string;
59
+ /** One-based. */
60
+ readonly line: number;
61
+ readonly text: string;
62
+ }
63
+ export interface GrepSearchResult {
64
+ readonly matches: GrepMatch[];
65
+ /** How many files the matches are in. */
66
+ readonly files: number;
67
+ /** Matching lines counted past what a file shows, by path. */
68
+ readonly more?: Record<string, number>;
69
+ /** Another file matches past the cap. */
70
+ readonly truncated: boolean;
71
+ readonly incomplete?: true;
72
+ }
73
+ export type SearchErrorCode = "path_missing" | "path_outside" | "path_is_file" | "path_not_searchable" | "invalid_pattern" | "invalid_include" | "file_binary" | "file_too_large";
74
+ /** A search that cannot run as asked: the caller says why in its own words. */
75
+ export declare class SearchError extends Error {
76
+ readonly code: SearchErrorCode;
77
+ constructor(code: SearchErrorCode, message: string);
78
+ }
79
+ export {};
80
+ //# sourceMappingURL=request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/tools/search/request.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,+DAA+D;AAC/D,eAAO,MAAM,aAAa;;;;;IAKxB,2DAA2D;;IAE3D;;;OAGG;;IAEH,+FAA+F;;;IAG/F,+DAA+D;;CAEvD,CAAA;AAEV,UAAU,kBAAkB;IAC1B,sFAAsF;IACtF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB;;;OAGG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAClC,qEAAqE;IACrE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;I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AAa,GACb,gBAAgB,CAAA;AAEpB,+EAA+E;AAC/E,qBAAa,WAAY,SAAQ,KAAK;IAElC,QAAQ,CAAC,IAAI,EAAE,eAAe;gBAArB,IAAI,EAAE,eAAe,EAC9B,OAAO,EAAE,MAAM;CAKlB"}
@@ -0,0 +1,4 @@
1
+ import { type GlobSearchRequest, type GlobSearchResult, type GrepSearchRequest, type GrepSearchResult } from "./request";
2
+ export declare function globFiles(request: GlobSearchRequest, workingDirectory: string): GlobSearchResult;
3
+ export declare function grepFiles(request: GrepSearchRequest, workingDirectory: string): Promise<GrepSearchResult>;
4
+ //# sourceMappingURL=search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/tools/search/search.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAErB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EAKtB,MAAM,WAAW,CAAA;AAGlB,wBAAgB,SAAS,CAAC,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,GAAG,gBAAgB,CAmBhG;AAED,wBAAsB,SAAS,CAC7B,OAAO,EAAE,iBAAiB,EAC1B,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,gBAAgB,CAAC,CAmG3B"}
@@ -0,0 +1,43 @@
1
+ import { type IgnoreFile } from "./gitignore";
2
+ export interface WalkOptions {
3
+ /** The folder to walk: a real, absolute path. */
4
+ readonly root: string;
5
+ /** The `.gitignore` files of the folders above the root that apply, outermost first. */
6
+ readonly ignoreFiles: readonly IgnoreFile[];
7
+ /** Enter folders and list files whose name starts with `.`. */
8
+ readonly hidden: boolean;
9
+ readonly nodeModules: boolean;
10
+ /** Real, absolute paths of folders never entered: the run's context directory. */
11
+ readonly skipFolders: ReadonlySet<string>;
12
+ /** Whether a folder, relative to the root, may hold what the search looks for. */
13
+ readonly mayContain?: (relativeFolder: string) => boolean;
14
+ /** The time, in epoch milliseconds, at which the walk stops. */
15
+ readonly deadline: number;
16
+ }
17
+ export interface WalkedFile {
18
+ readonly path: string;
19
+ /** From the root, with `/`. */
20
+ readonly relative: string;
21
+ /** A link to a file: listed, but its target may be anywhere. */
22
+ readonly symlink: boolean;
23
+ }
24
+ /**
25
+ * The files under a folder, in byte order of their paths, so that the first results of a capped
26
+ * search are the same on every run. `.git`, hidden entries and `node_modules` unless asked for,
27
+ * what `.gitignore` files exclude, and unreadable entries are skipped. Links to folders are not
28
+ * followed. Past its deadline, the walk stops and says it is {@link incomplete}.
29
+ */
30
+ export declare class FileWalk {
31
+ #private;
32
+ private readonly options;
33
+ constructor(options: WalkOptions);
34
+ get incomplete(): boolean;
35
+ files(): Generator<WalkedFile>;
36
+ }
37
+ /**
38
+ * A folder's `.gitignore`, or another ignore file applying from it, when it is a regular file it
39
+ * can read. A link is not followed, as git does not, and a device or a FIFO is never opened.
40
+ */
41
+ export declare function readIgnoreFile(folder: string, name?: string): IgnoreFile | undefined;
42
+ export declare function childPath(folder: string, name: string): string;
43
+ //# sourceMappingURL=walk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walk.d.ts","sourceRoot":"","sources":["../../../src/tools/search/walk.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAA6B,MAAM,aAAa,CAAA;AAExE,MAAM,WAAW,WAAW;IAC1B,iDAAiD;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,wFAAwF;IACxF,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAA;IAC3C,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAA;IAC7B,kFAAkF;IAClF,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IACzC,kFAAkF;IAClF,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,K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AAK,EAAE,UAAU,EACjB,IAAI,EAAE;QAAE,QAAQ,CAAC,SAAS,EAAE,wBAAwB,CAAC;QAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAClF,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,MAAM,CAAC;YAMJ,IAAI;YAeJ,KAAK;CAkCpB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,GAAG,iBAAiB,EAAE,CAejG;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAAC,KAAK,EAAE;IACnD,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAA;IACnC,QAAQ,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAA;IAC5C,QAAQ,CAAC,WAAW,EAAE,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAA;IACrD,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;CAC7B,GAAG,OAAO,CAAC,IAAI,CAAC,CAiChB;AAoCD,oFAAoF;AACpF,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEpE"}
@@ -1,29 +1,15 @@
1
1
  import type { AgentToolFiles, JsonValue } from "@sixb/core";
2
- import type { ModelTool } from "@sixb/core/models";
3
2
  import type { PreparedAgentAttachmentContext } from "../attachments";
4
3
  import type { AgentSandboxFileRegistry } from "../sandbox-file-registry";
5
4
  import type { AgentSandboxHandle } from "../sandbox-handle";
6
5
  import type { AgentToolModelOutput } from "./result-output";
7
- export declare const VIEW_FILE_TOOL_SPEC: {
8
- readonly name: "view_file";
9
- readonly description: "Inspect a file in the current run sandbox. Use this for historical attachments and files created by bash. Paths must stay inside the working directory or the run's context directory. Images are prepared for visual input when supported; other formats return bounded text or metadata.";
10
- readonly inputSchema: {
11
- type: string;
12
- properties: {
13
- path: {
14
- type: string;
15
- minLength: number;
16
- };
17
- };
18
- required: string[];
19
- additionalProperties: false;
20
- };
21
- };
22
- interface ViewFileInput {
23
- readonly path: string;
24
- }
25
- export declare function createViewFileTool(input: {
26
- readonly resolveSandbox: () => Promise<AgentSandboxHandle>;
6
+ /**
7
+ * What `read` took over: earlier threads hold calls to `view_file`, and their results replay as
8
+ * they were stored, images included.
9
+ */
10
+ export declare const LEGACY_VIEW_FILE_TOOL = "view_file";
11
+ /** What `read` needs to show a file as itself, an image or a PDF, rather than as text. */
12
+ export interface SandboxFileViewer {
27
13
  readonly attachments: PreparedAgentAttachmentContext;
28
14
  readonly registry: AgentSandboxFileRegistry;
29
15
  readonly filesForToolCall: (options: {
@@ -35,6 +21,17 @@ export declare function createViewFileTool(input: {
35
21
  readonly signal: AbortSignal;
36
22
  readonly toolCallId: string;
37
23
  }) => AgentToolModelOutput | Promise<AgentToolModelOutput>;
38
- }): ModelTool<ViewFileInput>;
39
- export {};
24
+ }
25
+ /**
26
+ * A sandbox file as a rich result: the file itself, stored with the call, which the run's media
27
+ * bridge shows the model as an image or a document when it can, and as metadata otherwise. An
28
+ * attachment, or a file a tool stored, is the snapshot it already is.
29
+ */
30
+ export declare function viewSandboxFile(viewer: SandboxFileViewer, handle: AgentSandboxHandle, input: {
31
+ readonly path: string;
32
+ readonly toolCallId: string;
33
+ readonly signal: AbortSignal;
34
+ }): Promise<JsonValue>;
35
+ /** Whether `path` names an attachment or a file a tool stored, which `read` shows as itself. */
36
+ export declare function isKnownSandboxFile(viewer: SandboxFileViewer, handle: AgentSandboxHandle, path: string): boolean;
40
37
  //# sourceMappingURL=view-file.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"view-file.d.ts","sourceRoot":"","sources":["../../src/tools/view-file.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAW,SAAS,EAAE,MAAM,YAAY,CAAA;AAGpE,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC9D,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,g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CH_TOOL_SPEC: {
8
8
  readonly name: "web_fetch";
9
+ readonly strict: true;
9
10
  readonly description: "Read a web page, PDF or image by URL. A large page is saved to a file. Pass a question to get an answer from the page.";
10
11
  readonly inputSchema: {
11
12
  type: string;
@@ -1 +1 @@
1
- {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../src/tools/web-fetch/tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAAiC,MAAM,4BAA4B,CAAA;AAGhG,OAAO,EAEL,KAAK,aAAa,EAKlB,KAAK,SAAS,EAEd,KAAK,eAAe,EACrB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAEhE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAsB,aAAa,EAAoB,MAAM,SAAS,CAAA;AAE7E,OAAO,EAAiD,KAAK,eAAe,EAAE,MAAM,WAAW,CAAA;AAkC/F,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;CAUtB,CAAA;AAEV,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAC3B;AAED,kDAAkD;AAClD,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED,iGAAiG;AACjG,MAAM,WAAW,kBAAkB;IACjC,6FAA6F;IAC7F,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,8EAA8E;IAC9E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,2DAA2D;IAC3D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,4FAA4F;IAC5F,QAAQ,CAA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AAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,sEAAsE;IACtE,QAAQ,CAAC,eAAe,CAAC,EAAE,IAAI,CAAA;IAC/B,uFAAuF;IACvF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,qEAAqE;IACrE,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,qFAAqF;IACrF,QAAQ,CAAC,QAAQ,CAAC,EAAE;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CACtE;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAA;IAC7B,sEAAsE;IACtE,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAA;IACjC;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,oBAAoB,CAAA;IAC7C,sDAAsD;IACtD,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAA;IAC9C;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAA;IAC7B,4BAA4B;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,aAAa,CAAA;CAC/B;AAKD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,SAAS,CAAC,iBAAiB,CAAC,CAmF7F;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,kBAAkB,GAAG,eAAe,CAoC/E"}
@@ -2,6 +2,7 @@ import { type AgentRunModels, type AgentRunWebPlan } from "@sixb/core/internal/a
2
2
  import type { ModelTool, ModelToolOutput, WebSearchHit } from "@sixb/core/models";
3
3
  export declare const WEB_SEARCH_TOOL_SPEC: {
4
4
  readonly name: "web_search";
5
+ readonly strict: true;
5
6
  readonly description: "Search the web for current or external information. Returns up to 8 results, each a title, URL, date and snippet.";
6
7
  readonly inputSchema: {
7
8
  type: string;
@@ -1 +1 @@
1
- {"version":3,"file":"web-search.d.ts","sourceRoot":"","sources":["../../src/tools/web-search.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,eAAe,EAErB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,KAAK,EAAc,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAQ7F,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;CAUvB,CAAA;AAEV,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED,gGAAgG;AAChG,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAA;CAC1C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE;IACzC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC,WAAW,CAAC,CAAA;IAC5C,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAA;CAC9B,GAAG,SAAS,CAAC,kBAAkB,CAAC,CA6BhC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,mBAAmB,GAAG,eAAe,CAejF"}
1
+ {"version":3,"file":"web-search.d.ts","sourceRoot":"","sources":["../../src/tools/web-search.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,eAAe,EAErB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,KAAK,EAAc,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAQ7F,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;CAWvB,CAAA;AAEV,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED,gGAAgG;AAChG,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAA;CAC1C;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE;IACzC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC,WAAW,CAAC,CAAA;IAC5C,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAA;CAC9B,GAAG,SAAS,CAAC,kBAAkB,CAAC,CA6BhC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,mBAAmB,GAAG,eAAe,CAejF"}
@@ -0,0 +1,36 @@
1
+ import type { ModelTool } from "@sixb/core/models";
2
+ import type { AgentSandboxHandle } from "../sandbox-handle";
3
+ import { type FileReadLedger } from "./file-writes";
4
+ export declare const WRITE_TOOL_SPEC: {
5
+ readonly name: "write";
6
+ readonly strict: true;
7
+ readonly description: "Create a file, or replace one whole; missing parent directories are created. Replacing an existing file needs a read of it first. To change part of a file, use edit.";
8
+ readonly inputSchema: {
9
+ type: string;
10
+ properties: {
11
+ path: {
12
+ type: string;
13
+ description: string;
14
+ };
15
+ content: {
16
+ type: string;
17
+ description: string;
18
+ };
19
+ };
20
+ required: string[];
21
+ additionalProperties: false;
22
+ };
23
+ };
24
+ export interface WriteToolInput {
25
+ readonly path: string;
26
+ readonly content: string;
27
+ }
28
+ export interface WriteToolOutput {
29
+ readonly path: string;
30
+ /** True when the file did not exist before. */
31
+ readonly created: boolean;
32
+ readonly lines: number;
33
+ readonly bytes: number;
34
+ }
35
+ export declare function createWriteTool(resolveSandbox: () => Promise<AgentSandboxHandle>, ledger: FileReadLedger): ModelTool<WriteToolInput>;
36
+ //# sourceMappingURL=write.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"write.d.ts","sourceRoot":"","sources":["../../src/tools/write.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyB,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAEL,KAAK,cAAc,EAIpB,MAAM,eAAe,CAAA;AAEtB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;CAkBlB,CAAA;AAEV,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,+CAA+C;IAC/C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED,wBAAgB,eAAe,CAC7B,cAAc,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,EACjD,MAAM,EAAE,cAAc,GACrB,SAAS,CAAC,cAAc,CAAC,CAiC3B"}