indusagi-coding-agent 0.1.22 → 0.1.24

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 (222) hide show
  1. package/CHANGELOG.md +72 -11
  2. package/README.md +2 -36
  3. package/dist/cli/args.d.ts +117 -1
  4. package/dist/cli/args.d.ts.map +1 -1
  5. package/dist/cli/args.js +231 -64
  6. package/dist/cli/args.js.map +1 -1
  7. package/dist/cli/config-selector.d.ts +58 -2
  8. package/dist/cli/config-selector.d.ts.map +1 -1
  9. package/dist/cli/config-selector.js +130 -12
  10. package/dist/cli/config-selector.js.map +1 -1
  11. package/dist/cli/file-processor.d.ts +70 -2
  12. package/dist/cli/file-processor.d.ts.map +1 -1
  13. package/dist/cli/file-processor.js +240 -15
  14. package/dist/cli/file-processor.js.map +1 -1
  15. package/dist/cli/list-models.d.ts +63 -3
  16. package/dist/cli/list-models.d.ts.map +1 -1
  17. package/dist/cli/list-models.js +202 -27
  18. package/dist/cli/list-models.js.map +1 -1
  19. package/dist/cli/login-handler.d.ts +82 -8
  20. package/dist/cli/login-handler.d.ts.map +1 -1
  21. package/dist/cli/login-handler.js +410 -77
  22. package/dist/cli/login-handler.js.map +1 -1
  23. package/dist/cli/session-picker.d.ts +74 -2
  24. package/dist/cli/session-picker.d.ts.map +1 -1
  25. package/dist/cli/session-picker.js +236 -12
  26. package/dist/cli/session-picker.js.map +1 -1
  27. package/dist/core/agent-session.d.ts +214 -9
  28. package/dist/core/agent-session.d.ts.map +1 -1
  29. package/dist/core/agent-session.js +214 -9
  30. package/dist/core/agent-session.js.map +1 -1
  31. package/dist/core/bash-executor.d.ts +302 -12
  32. package/dist/core/bash-executor.d.ts.map +1 -1
  33. package/dist/core/bash-executor.js +302 -12
  34. package/dist/core/bash-executor.js.map +1 -1
  35. package/dist/core/diagnostics.d.ts +191 -0
  36. package/dist/core/diagnostics.d.ts.map +1 -1
  37. package/dist/core/diagnostics.js +142 -0
  38. package/dist/core/diagnostics.js.map +1 -1
  39. package/dist/core/event-bus.d.ts +146 -0
  40. package/dist/core/event-bus.d.ts.map +1 -1
  41. package/dist/core/event-bus.js +93 -0
  42. package/dist/core/event-bus.js.map +1 -1
  43. package/dist/core/export-html/ansi-to-html.d.ts +4 -0
  44. package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
  45. package/dist/core/export-html/ansi-to-html.js +4 -0
  46. package/dist/core/export-html/ansi-to-html.js.map +1 -1
  47. package/dist/core/export-html/index.d.ts +128 -0
  48. package/dist/core/export-html/index.d.ts.map +1 -1
  49. package/dist/core/export-html/index.js +128 -0
  50. package/dist/core/export-html/index.js.map +1 -1
  51. package/dist/core/export-html/tool-renderer.d.ts +4 -0
  52. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  53. package/dist/core/export-html/tool-renderer.js +4 -0
  54. package/dist/core/export-html/tool-renderer.js.map +1 -1
  55. package/dist/core/keybindings.d.ts +142 -0
  56. package/dist/core/keybindings.d.ts.map +1 -1
  57. package/dist/core/keybindings.js +142 -0
  58. package/dist/core/keybindings.js.map +1 -1
  59. package/dist/core/model-registry.d.ts +98 -1
  60. package/dist/core/model-registry.d.ts.map +1 -1
  61. package/dist/core/model-registry.js +98 -1
  62. package/dist/core/model-registry.js.map +1 -1
  63. package/dist/core/model-resolver.d.ts +99 -1
  64. package/dist/core/model-resolver.d.ts.map +1 -1
  65. package/dist/core/model-resolver.js +99 -1
  66. package/dist/core/model-resolver.js.map +1 -1
  67. package/dist/core/prompt-templates.js.map +1 -1
  68. package/dist/core/sdk.d.ts +1 -1
  69. package/dist/core/sdk.d.ts.map +1 -1
  70. package/dist/core/sdk.js +0 -2
  71. package/dist/core/sdk.js.map +1 -1
  72. package/dist/core/session-manager.d.ts +127 -0
  73. package/dist/core/session-manager.d.ts.map +1 -1
  74. package/dist/core/session-manager.js +125 -0
  75. package/dist/core/session-manager.js.map +1 -1
  76. package/dist/core/skills.js.map +1 -1
  77. package/dist/core/subagents.js.map +1 -1
  78. package/dist/core/tools/bash.d.ts +391 -11
  79. package/dist/core/tools/bash.d.ts.map +1 -1
  80. package/dist/core/tools/bash.js +269 -2
  81. package/dist/core/tools/bash.js.map +1 -1
  82. package/dist/core/tools/edit.d.ts +284 -6
  83. package/dist/core/tools/edit.d.ts.map +1 -1
  84. package/dist/core/tools/edit.js +238 -0
  85. package/dist/core/tools/edit.js.map +1 -1
  86. package/dist/core/tools/find.d.ts +169 -5
  87. package/dist/core/tools/find.d.ts.map +1 -1
  88. package/dist/core/tools/find.js +136 -0
  89. package/dist/core/tools/find.js.map +1 -1
  90. package/dist/core/tools/grep.d.ts +285 -5
  91. package/dist/core/tools/grep.d.ts.map +1 -1
  92. package/dist/core/tools/grep.js +247 -0
  93. package/dist/core/tools/grep.js.map +1 -1
  94. package/dist/core/tools/index.d.ts +0 -18
  95. package/dist/core/tools/index.d.ts.map +1 -1
  96. package/dist/core/tools/index.js +1 -23
  97. package/dist/core/tools/index.js.map +1 -1
  98. package/dist/core/tools/ls.d.ts +6 -0
  99. package/dist/core/tools/ls.d.ts.map +1 -1
  100. package/dist/core/tools/ls.js +6 -0
  101. package/dist/core/tools/ls.js.map +1 -1
  102. package/dist/core/tools/read.d.ts +308 -7
  103. package/dist/core/tools/read.d.ts.map +1 -1
  104. package/dist/core/tools/read.js +231 -0
  105. package/dist/core/tools/read.js.map +1 -1
  106. package/dist/core/tools/webfetch.d.ts +118 -3
  107. package/dist/core/tools/webfetch.d.ts.map +1 -1
  108. package/dist/core/tools/webfetch.js +118 -3
  109. package/dist/core/tools/webfetch.js.map +1 -1
  110. package/dist/core/tools/websearch.d.ts +130 -3
  111. package/dist/core/tools/websearch.d.ts.map +1 -1
  112. package/dist/core/tools/websearch.js +130 -3
  113. package/dist/core/tools/websearch.js.map +1 -1
  114. package/dist/core/tools/write.d.ts +251 -5
  115. package/dist/core/tools/write.d.ts.map +1 -1
  116. package/dist/core/tools/write.js +210 -0
  117. package/dist/core/tools/write.js.map +1 -1
  118. package/dist/modes/interactive/components/assistant-message.d.ts +164 -1
  119. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  120. package/dist/modes/interactive/components/assistant-message.js +164 -1
  121. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  122. package/dist/modes/interactive/components/bash-execution.d.ts +297 -1
  123. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  124. package/dist/modes/interactive/components/bash-execution.js +297 -1
  125. package/dist/modes/interactive/components/bash-execution.js.map +1 -1
  126. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  127. package/dist/modes/interactive/components/tool-execution.js +251 -1
  128. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  129. package/dist/modes/interactive/components/user-message.d.ts +186 -1
  130. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  131. package/dist/modes/interactive/components/user-message.js +186 -1
  132. package/dist/modes/interactive/components/user-message.js.map +1 -1
  133. package/dist/modes/interactive/interactive-mode.d.ts +1567 -13
  134. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  135. package/dist/modes/interactive/interactive-mode.js +1567 -13
  136. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  137. package/dist/modes/interactive/theme/theme.d.ts +422 -0
  138. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  139. package/dist/modes/interactive/theme/theme.js +422 -0
  140. package/dist/modes/interactive/theme/theme.js.map +1 -1
  141. package/dist/modes/print-mode.d.ts +538 -5
  142. package/dist/modes/print-mode.d.ts.map +1 -1
  143. package/dist/modes/print-mode.js +538 -5
  144. package/dist/modes/print-mode.js.map +1 -1
  145. package/dist/modes/rpc/rpc-client.d.ts +921 -8
  146. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  147. package/dist/modes/rpc/rpc-client.js +921 -8
  148. package/dist/modes/rpc/rpc-client.js.map +1 -1
  149. package/dist/modes/rpc/rpc-mode.d.ts +802 -9
  150. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  151. package/dist/modes/rpc/rpc-mode.js +802 -9
  152. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  153. package/dist/modes/rpc/rpc-types.d.ts +356 -3
  154. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  155. package/dist/modes/rpc/rpc-types.js +356 -3
  156. package/dist/modes/rpc/rpc-types.js.map +1 -1
  157. package/dist/modes/shared.d.ts +386 -0
  158. package/dist/modes/shared.d.ts.map +1 -0
  159. package/dist/modes/shared.js +543 -0
  160. package/dist/modes/shared.js.map +1 -0
  161. package/dist/utils/array.d.ts +389 -0
  162. package/dist/utils/array.d.ts.map +1 -0
  163. package/dist/utils/array.js +585 -0
  164. package/dist/utils/array.js.map +1 -0
  165. package/dist/utils/color-formatter.d.ts +318 -0
  166. package/dist/utils/color-formatter.d.ts.map +1 -0
  167. package/dist/utils/color-formatter.js +442 -0
  168. package/dist/utils/color-formatter.js.map +1 -0
  169. package/dist/utils/data-transformer.d.ts +326 -0
  170. package/dist/utils/data-transformer.d.ts.map +1 -0
  171. package/dist/utils/data-transformer.js +512 -0
  172. package/dist/utils/data-transformer.js.map +1 -0
  173. package/dist/utils/date-formatter.d.ts +281 -0
  174. package/dist/utils/date-formatter.d.ts.map +1 -0
  175. package/dist/utils/date-formatter.js +503 -0
  176. package/dist/utils/date-formatter.js.map +1 -0
  177. package/dist/utils/error-handler.d.ts +541 -0
  178. package/dist/utils/error-handler.d.ts.map +1 -0
  179. package/dist/utils/error-handler.js +726 -0
  180. package/dist/utils/error-handler.js.map +1 -0
  181. package/dist/utils/file-operations.d.ts +297 -0
  182. package/dist/utils/file-operations.d.ts.map +1 -0
  183. package/dist/utils/file-operations.js +505 -0
  184. package/dist/utils/file-operations.js.map +1 -0
  185. package/dist/utils/frontmatter.d.ts +268 -6
  186. package/dist/utils/frontmatter.d.ts.map +1 -1
  187. package/dist/utils/frontmatter.js +500 -21
  188. package/dist/utils/frontmatter.js.map +1 -1
  189. package/dist/utils/json-formatter.d.ts +259 -0
  190. package/dist/utils/json-formatter.d.ts.map +1 -0
  191. package/dist/utils/json-formatter.js +517 -0
  192. package/dist/utils/json-formatter.js.map +1 -0
  193. package/dist/utils/logger.d.ts +176 -0
  194. package/dist/utils/logger.d.ts.map +1 -0
  195. package/dist/utils/logger.js +346 -0
  196. package/dist/utils/logger.js.map +1 -0
  197. package/dist/utils/markdown-formatter.d.ts +211 -0
  198. package/dist/utils/markdown-formatter.d.ts.map +1 -0
  199. package/dist/utils/markdown-formatter.js +482 -0
  200. package/dist/utils/markdown-formatter.js.map +1 -0
  201. package/dist/utils/path-validator.d.ts +603 -0
  202. package/dist/utils/path-validator.d.ts.map +1 -0
  203. package/dist/utils/path-validator.js +870 -0
  204. package/dist/utils/path-validator.js.map +1 -0
  205. package/dist/utils/string-formatter.d.ts +609 -0
  206. package/dist/utils/string-formatter.d.ts.map +1 -0
  207. package/dist/utils/string-formatter.js +806 -0
  208. package/dist/utils/string-formatter.js.map +1 -0
  209. package/dist/utils/type-guards.d.ts +629 -0
  210. package/dist/utils/type-guards.d.ts.map +1 -0
  211. package/dist/utils/type-guards.js +662 -0
  212. package/dist/utils/type-guards.js.map +1 -0
  213. package/docs/COMPLETE-GUIDE.md +300 -0
  214. package/docs/MODES-ARCHITECTURE.md +565 -0
  215. package/docs/PRINT-MODE-GUIDE.md +456 -0
  216. package/docs/README.md +1 -2
  217. package/docs/RPC-GUIDE.md +705 -0
  218. package/docs/UTILS-IMPLEMENTATION-SUMMARY.md +647 -0
  219. package/docs/UTILS-MODULE-OVERVIEW.md +1480 -0
  220. package/docs/UTILS-QA-CHECKLIST.md +1061 -0
  221. package/docs/UTILS-USAGE-GUIDE.md +1419 -0
  222. package/package.json +3 -3
@@ -8,8 +8,6 @@ export { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, type TruncationOption
8
8
  export { createTodoReadTool, createTodoWriteTool, todoReadTool, todoWriteTool, type TodoToolDetails, } from "./todo.js";
9
9
  export { createTaskTool, taskTool, type TaskToolDetails, type TaskToolOptions, } from "./task.js";
10
10
  export { createWriteTool, type WriteOperations, type WriteToolOptions, writeTool } from "./write.js";
11
- export { createWebSearchTool, type WebSearchToolDetails, type WebSearchToolOptions, webSearchTool, } from "./websearch.js";
12
- export { createWebFetchTool, type WebFetchToolDetails, type WebFetchToolOptions, webFetchTool, } from "./webfetch.js";
13
11
  import type { AgentTool } from "indusagi/agent";
14
12
  import type { HookRunner } from "../hooks/index.js";
15
13
  import { TodoStore } from "../todo-store.js";
@@ -72,18 +70,6 @@ export declare const allTools: {
72
70
  priority: import("@sinclair/typebox").TUnsafe<"low" | "medium" | "high">;
73
71
  }>>;
74
72
  }>, import("./todo.js").TodoToolDetails>;
75
- websearch: AgentTool<import("@sinclair/typebox").TObject<{
76
- query: import("@sinclair/typebox").TString;
77
- numResults: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
78
- livecrawl: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"fallback">, import("@sinclair/typebox").TLiteral<"preferred">]>>;
79
- type: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"auto">, import("@sinclair/typebox").TLiteral<"fast">, import("@sinclair/typebox").TLiteral<"deep">]>>;
80
- contextMaxCharacters: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
81
- }>, any>;
82
- webfetch: AgentTool<import("@sinclair/typebox").TObject<{
83
- url: import("@sinclair/typebox").TString;
84
- format: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"text">, import("@sinclair/typebox").TLiteral<"markdown">, import("@sinclair/typebox").TLiteral<"html">]>>;
85
- timeout: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
86
- }>, any>;
87
73
  };
88
74
  export type ToolName = keyof typeof allTools;
89
75
  export interface ToolsOptions {
@@ -97,10 +83,6 @@ export interface ToolsOptions {
97
83
  todoStore?: TodoStore;
98
84
  /** Hook runner for tool-specific hooks */
99
85
  hookRunner?: HookRunner;
100
- /** Options for the websearch tool */
101
- websearch?: import("./websearch.js").WebSearchToolOptions;
102
- /** Options for the webfetch tool */
103
- webfetch?: import("./webfetch.js").WebFetchToolOptions;
104
86
  }
105
87
  /**
106
88
  * Create coding tools configured for a specific working directory.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,QAAQ,EACR,cAAc,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACtH,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACtH,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,KAAK,eAAe,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACtH,OAAO,EAAE,YAAY,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC1G,OAAO,EACN,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,QAAQ,GACR,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EACV,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,YAAY,EACZ,YAAY,EACZ,YAAY,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,aAAa,EACb,KAAK,eAAe,GACpB,MAAM,WAAW,CAAC;AACnB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AAEF,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,QAAQ,CAAC;AAE7C,MAAM,WAAW,YAAY;IAC5B,gCAAgC;IAChC,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,gCAAgC;IAChC,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,wCAAwC;IACxC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,UAAU,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,EAAE,CAY7E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,EAAE,CAS/E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC,QAAQ,EAAE,IAAI,CAAC,CAe1F"}
@@ -8,8 +8,6 @@ export { DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, truncateHead, truncat
8
8
  export { createTodoReadTool, createTodoWriteTool, todoReadTool, todoWriteTool, } from "./todo.js";
9
9
  export { createTaskTool, taskTool, } from "./task.js";
10
10
  export { createWriteTool, writeTool } from "./write.js";
11
- export { createWebSearchTool, webSearchTool, } from "./websearch.js";
12
- export { createWebFetchTool, webFetchTool, } from "./webfetch.js";
13
11
  import { TodoStore } from "../todo-store.js";
14
12
  import { bashTool, createBashTool } from "./bash.js";
15
13
  import { createEditTool, editTool } from "./edit.js";
@@ -20,8 +18,6 @@ import { createReadTool, readTool } from "./read.js";
20
18
  import { createTodoReadTool, createTodoWriteTool, todoReadTool, todoWriteTool } from "./todo.js";
21
19
  import { createTaskTool, taskTool } from "./task.js";
22
20
  import { createWriteTool, writeTool } from "./write.js";
23
- import { createWebSearchTool, webSearchTool } from "./websearch.js";
24
- import { createWebFetchTool, webFetchTool } from "./webfetch.js";
25
21
  // Default tools for full access mode (using process.cwd())
26
22
  export const codingTools = [
27
23
  readTool,
@@ -31,19 +27,9 @@ export const codingTools = [
31
27
  taskTool,
32
28
  todoReadTool,
33
29
  todoWriteTool,
34
- webSearchTool,
35
- webFetchTool,
36
30
  ];
37
31
  // Read-only tools for exploration without modification (using process.cwd())
38
- export const readOnlyTools = [
39
- readTool,
40
- grepTool,
41
- findTool,
42
- lsTool,
43
- todoReadTool,
44
- webSearchTool,
45
- webFetchTool,
46
- ];
32
+ export const readOnlyTools = [readTool, grepTool, findTool, lsTool, todoReadTool];
47
33
  // All available tools (using process.cwd())
48
34
  export const allTools = {
49
35
  read: readTool,
@@ -56,8 +42,6 @@ export const allTools = {
56
42
  task: taskTool,
57
43
  todoread: todoReadTool,
58
44
  todowrite: todoWriteTool,
59
- websearch: webSearchTool,
60
- webfetch: webFetchTool,
61
45
  };
62
46
  /**
63
47
  * Create coding tools configured for a specific working directory.
@@ -73,8 +57,6 @@ export function createCodingTools(cwd, options) {
73
57
  createTaskTool(taskOptions),
74
58
  createTodoReadTool(todoStore),
75
59
  createTodoWriteTool(todoStore),
76
- createWebSearchTool(options?.websearch),
77
- createWebFetchTool(options?.webfetch),
78
60
  ];
79
61
  }
80
62
  /**
@@ -88,8 +70,6 @@ export function createReadOnlyTools(cwd, options) {
88
70
  createFindTool(cwd),
89
71
  createLsTool(cwd),
90
72
  createTodoReadTool(todoStore),
91
- createWebSearchTool(options?.websearch),
92
- createWebFetchTool(options?.webfetch),
93
73
  ];
94
74
  }
95
75
  /**
@@ -109,8 +89,6 @@ export function createAllTools(cwd, options) {
109
89
  task: createTaskTool(taskOptions),
110
90
  todoread: createTodoReadTool(todoStore),
111
91
  todowrite: createTodoWriteTool(todoStore),
112
- websearch: createWebSearchTool(options?.websearch),
113
- webfetch: createWebFetchTool(options?.webfetch),
114
92
  };
115
93
  }
116
94
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,QAAQ,EACR,cAAc,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,cAAc,EAAmE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACtH,OAAO,EAAE,cAAc,EAAmE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACtH,OAAO,EAAE,cAAc,EAAmE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACtH,OAAO,EAAE,YAAY,EAA6D,MAAM,EAAE,MAAM,SAAS,CAAC;AAC1G,OAAO,EACN,cAAc,EAId,QAAQ,GACR,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,iBAAiB,EACjB,iBAAiB,EACjB,UAAU,EAGV,YAAY,EACZ,YAAY,EACZ,YAAY,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EACN,kBAAkB,EAClB,mBAAmB,EACnB,YAAY,EACZ,aAAa,GAEb,MAAM,WAAW,CAAC;AACnB,OAAO,EACN,cAAc,EACd,QAAQ,GAGR,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,eAAe,EAA+C,SAAS,EAAE,MAAM,YAAY,CAAC;AACrG,OAAO,EACN,mBAAmB,EAGnB,aAAa,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACN,kBAAkB,EAGlB,YAAY,GACZ,MAAM,eAAe,CAAC;AAIvB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAwB,QAAQ,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,W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jB,kBAAkB,CAAC,SAAS,CAAC;KAC7B,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,GAAW,EAAE,OAAsB;IACjE,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,IAAI,SAAS,EAAE,CAAC;IACxD,MAAM,WAAW,GAAG,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IACzE,OAAO;QACN,IAAI,EAAE,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC;QACxC,IAAI,EAAE,cAAc,CAAC,GAAG,EAAE,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;QAChF,IAAI,EAAE,cAAc,CAAC,GAAG,CAAC;QACzB,KAAK,EAAE,eAAe,CAAC,GAAG,CAAC;QAC3B,IAAI,EAAE,cAAc,CAAC,GAAG,CAAC;QACzB,IAAI,EAAE,cAAc,CAAC,GAAG,CAAC;QACzB,EAAE,EAAE,YAAY,CAAC,GAAG,CAAC;QACrB,IAAI,EAAE,cAAc,CAAC,WAAW,CAAC;QACjC,QAAQ,EAAE,kBAAkB,CAAC,SAAS,CAAC;QACvC,SAAS,EAAE,mBAAmB,CAAC,SAAS,CAAC;KACzC,CAAC;AACH,CAAC"}
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Ls Tool - List directory contents
3
+ *
4
+ * Based on Unix ls command and Node.js fs.readdirSync().
5
+ * Refactored for agent directory exploration.
6
+ */
1
7
  import type { AgentTool } from "indusagi/agent";
2
8
  import { type TruncationResult } from "./truncate.js";
3
9
  declare const lsSchema: import("@sinclair/typebox").TObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"ls.d.ts","sourceRoot":"","sources":["../../../src/core/tools/ls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,E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AC,EAAE,gBAAgB,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC5B,2BAA2B;IAC3B,MAAM,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC;IAC7D,qDAAqD;IACrD,IAAI,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,OAAO,CAAA;KAAE,CAAC,GAAG;QAAE,WAAW,EAAE,MAAM,OAAO,CAAA;KAAE,CAAC;IACzG,6BAA6B;IAC7B,OAAO,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC;CAChE;AAQD,MAAM,WAAW,aAAa;IAC7B,yEAAyE;IACzE,UAAU,CAAC,EAAE,YAAY,CAAC;CAC1B;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC,OAAO,QAAQ,CAAC,CAyH7F;AAED,wEAAwE;AACxE,eAAO,MAAM,MAAM;;;QAA8B,CAAC"}
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Ls Tool - List directory contents
3
+ *
4
+ * Based on Unix ls command and Node.js fs.readdirSync().
5
+ * Refactored for agent directory exploration.
6
+ */
1
7
  import { Type } from "@sinclair/typebox";
2
8
  import { existsSync, readdirSync, statSync } from "fs";
3
9
  import nodePath from "path";
@@ -1 +1 @@
1
- {"version":3,"file":"ls.js","sourceRoot":"","sources":["../../../src/core/tools/ls.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AACvD,OAAO,QAAQ,MAAM,MAAM,CAAC;AAC5B,OAAO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AAC;AACH,CAAC;AAED,wEAAwE;AACxE,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC"}
@@ -1,33 +1,334 @@
1
+ /**
2
+ * Read Tool - Read file contents with automatic image handling
3
+ *
4
+ * @module core/tools/read
5
+ * @description
6
+ * Implements the read tool for the agent. Reads file contents with:
7
+ * - Support for line-based offset/limit
8
+ * - Automatic image detection and resizing
9
+ * - Large file truncation handling
10
+ * - Remote execution support (SSH, containers)
11
+ *
12
+ * Based on file reading tools from Anthropic's Claude API and common Unix utilities.
13
+ * Refactored for agent multimodal content handling.
14
+ * - Proper path resolution and validation
15
+ *
16
+ * ## Tool Interface
17
+ *
18
+ * **Input Parameters:**
19
+ * - `path` (required): File path to read (relative or absolute)
20
+ * - `offset` (optional): Starting line number (1-indexed)
21
+ * - `limit` (optional): Maximum number of lines to read
22
+ *
23
+ * **Output:**
24
+ * - Text files: Line content as text
25
+ * - Image files: Image data with metadata
26
+ * - Large files: Truncated with temp file path
27
+ *
28
+ * **Error Behavior:**
29
+ * - File not found → Tool error "ENOENT: no such file"
30
+ * - Permission denied → Tool error "EACCES: permission denied"
31
+ * - Invalid path → Tool error "Path outside working directory"
32
+ * - Large file not truncable → Tool error "File too large"
33
+ *
34
+ * ## Usage in Agent
35
+ *
36
+ * The agent uses this tool to:
37
+ * - Read source code files for analysis
38
+ * - Check configuration files
39
+ * - Read documentation and READMEs
40
+ * - View images and diagrams
41
+ * - Inspect logs and build output
42
+ *
43
+ * ## Features
44
+ *
45
+ * **Line-based Access:**
46
+ * - offset: Start reading from line N (1-indexed)
47
+ * - limit: Read at most N lines
48
+ * - Useful for large files
49
+ *
50
+ * **Image Handling:**
51
+ * - Auto-detect image MIME type
52
+ * - Resize large images (configurable)
53
+ * - Include dimension information
54
+ * - Provide helpful notes for vision models
55
+ *
56
+ * **Truncation:**
57
+ * - Truncate large files at front (keeps last N bytes)
58
+ * - Write full content to temp file if needed
59
+ * - Return truncation info for reference
60
+ *
61
+ * **Path Safety:**
62
+ * - Resolve relative paths relative to cwd
63
+ * - Prevent path traversal attacks (no ../../../etc/passwd)
64
+ * - Validate paths are accessible
65
+ *
66
+ * ## Security
67
+ *
68
+ * **Path validation:**
69
+ * - All paths resolved relative to cwd
70
+ * - No symlink following by default
71
+ * - Directory traversal prevented
72
+ *
73
+ * **Permission checks:**
74
+ * - File must be readable
75
+ * - Working directory must exist
76
+ * - Errors returned for permission denied
77
+ *
78
+ * **Data safety:**
79
+ * - Large files truncated (not read into memory)
80
+ * - Binary files handled gracefully
81
+ * - No automatic execution of file contents
82
+ *
83
+ * ## Customization
84
+ *
85
+ * **Image Resizing:**
86
+ * ```typescript
87
+ * const tool = createReadTool(cwd, {
88
+ * autoResizeImages: true,
89
+ * imageMaxBytes: 500 * 1024, // 500KB limit
90
+ * });
91
+ * ```
92
+ *
93
+ * **Remote Execution (SSH):**
94
+ * ```typescript
95
+ * const sshTool = createReadTool(cwd, {
96
+ * operations: {
97
+ * readFile: (path) => sshExec(`cat ${path}`),
98
+ * access: (path) => sshExec(`test -r ${path}`),
99
+ * },
100
+ * });
101
+ * ```
102
+ *
103
+ * ## Examples
104
+ *
105
+ * ### Read a source file
106
+ * ```typescript
107
+ * // Agent calls: read {path: "src/main.ts"}
108
+ * // Returns: Full file content or truncated with temp file path
109
+ * ```
110
+ *
111
+ * ### Read specific lines
112
+ * ```typescript
113
+ * // Agent calls: read {path: "test.txt", offset: 10, limit: 5}
114
+ * // Returns: Lines 10-14
115
+ * ```
116
+ *
117
+ * ### Auto-resized image
118
+ * ```typescript
119
+ * // Agent calls: read {path: "diagram.png"}
120
+ * // Returns: Image content, resized if > 2MB, with dimensions
121
+ * ```
122
+ *
123
+ * ## Attribution
124
+ *
125
+ * Based on: indusagi-agent read tool
126
+ * Modifications:
127
+ * - Added image auto-detection and resizing
128
+ * - Added line-based offset/limit support
129
+ * - Added custom operations interface
130
+ * - Improved truncation handling
131
+ */
1
132
  import type { AgentTool } from "indusagi/agent";
2
133
  import { type TruncationResult } from "./truncate.js";
134
+ /**
135
+ * JSON Schema for read tool parameters
136
+ * @internal
137
+ */
3
138
  declare const readSchema: import("@sinclair/typebox").TObject<{
4
139
  path: import("@sinclair/typebox").TString;
5
140
  offset: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
6
141
  limit: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
7
142
  }>;
143
+ /**
144
+ * Tool-specific details returned with read results
145
+ */
8
146
  export interface ReadToolDetails {
147
+ /** Truncation information if file was too large */
9
148
  truncation?: TruncationResult;
10
149
  }
11
150
  /**
12
- * Pluggable operations for the read tool.
13
- * Override these to delegate file reading to remote systems (e.g., SSH).
151
+ * Pluggable interface for file reading operations
152
+ *
153
+ * Allows custom implementations for:
154
+ * - Remote file systems (SSH, cloud storage)
155
+ * - Virtual file systems (in-memory, testing)
156
+ * - Custom permission models
157
+ * - Monitoring and logging
158
+ *
159
+ * Implementations must respect working directory boundaries.
160
+ *
161
+ * @example
162
+ * ```typescript
163
+ * const sshOps: ReadOperations = {
164
+ * readFile: (path) => sshExec(`cat ${path}`),
165
+ * access: (path) => sshExec(`test -r ${path}`),
166
+ * detectImageMimeType: (path) => sshExec(`file -b --mime-type ${path}`),
167
+ * };
168
+ *
169
+ * const tool = createReadTool(cwd, { operations: sshOps });
170
+ * ```
14
171
  */
15
172
  export interface ReadOperations {
16
- /** Read file contents as a Buffer */
173
+ /**
174
+ * Read file contents as a Buffer
175
+ *
176
+ * @param absolutePath - Full path to file (already validated)
177
+ * @returns Buffer with file contents
178
+ * @throws ENOENT if file not found
179
+ * @throws EACCES if not readable
180
+ */
17
181
  readFile: (absolutePath: string) => Promise<Buffer>;
18
- /** Check if file is readable (throw if not) */
182
+ /**
183
+ * Check if file is readable
184
+ *
185
+ * @param absolutePath - Full path to file (already validated)
186
+ * @throws Error if not readable or doesn't exist
187
+ */
19
188
  access: (absolutePath: string) => Promise<void>;
20
- /** Detect image MIME type, return null/undefined for non-images */
189
+ /**
190
+ * Detect if file is an image and return MIME type
191
+ *
192
+ * @param absolutePath - Full path to file
193
+ * @returns MIME type like "image/png", or null/undefined if not an image
194
+ */
21
195
  detectImageMimeType?: (absolutePath: string) => Promise<string | null | undefined>;
22
196
  }
197
+ /**
198
+ * Configuration options for the read tool
199
+ *
200
+ * Allows customization of image handling and file reading backend.
201
+ */
23
202
  export interface ReadToolOptions {
24
- /** Whether to auto-resize images to 2000x2000 max. Default: true */
203
+ /**
204
+ * Whether to auto-resize images to 2000x2000 max
205
+ *
206
+ * When enabled, images larger than the max will be:
207
+ * - Resized to fit within 2000x2000 pixels
208
+ * - Preserved as JPEG for smaller file size
209
+ * - Included with dimension notes in output
210
+ *
211
+ * Default: true (auto-resize enabled)
212
+ *
213
+ * Set to false if:
214
+ * - Vision model needs full resolution
215
+ * - Bandwidth/latency is not a concern
216
+ * - Custom resizing is handled elsewhere
217
+ *
218
+ * @example
219
+ * ```typescript
220
+ * const tool = createReadTool(cwd, {
221
+ * autoResizeImages: false, // Keep full resolution
222
+ * });
223
+ * ```
224
+ */
25
225
  autoResizeImages?: boolean;
26
- /** Custom operations for file reading. Default: local filesystem */
226
+ /**
227
+ * Custom operations for file reading
228
+ *
229
+ * Default: Local filesystem operations
230
+ * Custom: SSH, cloud storage, testing mocks
231
+ *
232
+ * @example
233
+ * ```typescript
234
+ * const tool = createReadTool(cwd, {
235
+ * operations: {
236
+ * readFile: (path) => sshExec(`cat ${path}`),
237
+ * access: (path) => sshExec(`test -r ${path}`),
238
+ * },
239
+ * });
240
+ * ```
241
+ */
27
242
  operations?: ReadOperations;
28
243
  }
244
+ /**
245
+ * Create a read tool with custom configuration
246
+ *
247
+ * Creates an AgentTool that can read files with:
248
+ * - Line-based offset and limit
249
+ * - Automatic image detection and resizing
250
+ * - Large file truncation
251
+ * - Remote execution support
252
+ * - Proper path resolution
253
+ *
254
+ * **Tool Behavior:**
255
+ * - Resolves paths relative to working directory
256
+ * - Prevents path traversal (no ../../../etc/passwd)
257
+ * - Detects images and handles specially
258
+ * - Truncates large files at head (keeps tail)
259
+ * - Returns truncation info for reference
260
+ *
261
+ * **Tool Parameters:**
262
+ * - `path` (required): File to read
263
+ * - `offset` (optional): Starting line (1-indexed)
264
+ * - `limit` (optional): Maximum lines to read
265
+ *
266
+ * **Tool Output:**
267
+ * - Text files: File content (possibly truncated)
268
+ * - Image files: Image data with metadata
269
+ * - Details: Truncation info if file was too large
270
+ *
271
+ * **Error Handling:**
272
+ * - File not found: Tool error "ENOENT: no such file"
273
+ * - Permission denied: Tool error "EACCES: permission denied"
274
+ * - Invalid path: Tool error "Path outside working directory"
275
+ * - Other errors: Tool error with message
276
+ *
277
+ * @param cwd - Working directory for relative path resolution
278
+ * - All relative paths resolved from this directory
279
+ * - Prevents directory traversal attacks
280
+ * - Can be overridden per execution
281
+ *
282
+ * @param options - Optional configuration
283
+ * - autoResizeImages: Enable/disable image resizing (default: true)
284
+ * - operations: Custom file reading backend (default: filesystem)
285
+ *
286
+ * @returns AgentTool instance ready to use
287
+ *
288
+ * @example
289
+ * ```typescript
290
+ * // Basic tool
291
+ * const tool = createReadTool(process.cwd());
292
+ *
293
+ * // With image resizing disabled
294
+ * const noResizeTool = createReadTool(cwd, {
295
+ * autoResizeImages: false,
296
+ * });
297
+ *
298
+ * // With remote backend (SSH)
299
+ * const remoteTool = createReadTool(cwd, {
300
+ * operations: sshOperations,
301
+ * });
302
+ * ```
303
+ *
304
+ * @see ReadToolOptions for detailed configuration
305
+ * @see ReadOperations for custom backend interface
306
+ */
29
307
  export declare function createReadTool(cwd: string, options?: ReadToolOptions): AgentTool<typeof readSchema>;
30
308
  /** Default read tool using process.cwd() - for backwards compatibility */
309
+ /**
310
+ * Default read tool instance
311
+ *
312
+ * Pre-created read tool using current process working directory.
313
+ * Supports line-based reading, image resizing, and truncation.
314
+ *
315
+ * Equivalent to:
316
+ * ```typescript
317
+ * const readTool = createReadTool(process.cwd(), {
318
+ * autoResizeImages: true,
319
+ * });
320
+ * ```
321
+ *
322
+ * For custom configuration or remote backends, use createReadTool() directly.
323
+ *
324
+ * @example
325
+ * ```typescript
326
+ * import { readTool } from "./tools/read.js";
327
+ * const agent = new Agent({ tools: [readTool] });
328
+ * ```
329
+ *
330
+ * @see createReadTool for custom configuration
331
+ */
31
332
  export declare const readTool: AgentTool<import("@sinclair/typebox").TObject<{
32
333
  path: import("@sinclair/typebox").TString;
33
334
  offset: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TNumber>;
@@ -1 +1 @@
1
- {"version":3,"file":"read.d.ts","sourceRoot":"","sources":["../../../src/core/tools/read.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAQhD,OAAO,EAAoD,KAAK,gBAAgB,EAAgB,MAAM,eAAe,CAAC;AAEtH,QAAA,MAAM,UAAU;;;;EAId,CAAC;AAEH,MAAM,WAAW,eAAe;IAC/B,UAAU,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B,qCAAqC;IACrC,QAAQ,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD,+CAA+C;IAC/C,MAAM,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChD,mEAAmE;IACnE,mBAAmB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;CACnF;AAQD,MAAM,WAAW,eAAe;IAC/B,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oEAAoE;IACpE,UAAU,CAAC,EAAE,cAAc,CAAC;CAC5B;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,SAAS,CAAC,OAAO,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