indusagi 0.13.5 → 0.13.7

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 (435) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +7 -1
  3. package/dist/cli.js +114 -23
  4. package/package.json +56 -45
  5. package/dist/agent.js +0 -28713
  6. package/dist/ai.js +0 -19964
  7. package/dist/capabilities.js +0 -2730
  8. package/dist/connectors-saas.js +0 -3355
  9. package/dist/index.js +0 -16644
  10. package/dist/interop.js +0 -3247
  11. package/dist/knowledge/guides/authoring-an-agent.md +0 -53
  12. package/dist/knowledge/guides/choosing-tools.md +0 -49
  13. package/dist/knowledge/guides/model-selection.md +0 -51
  14. package/dist/knowledge/guides/writing-system-prompts.md +0 -53
  15. package/dist/knowledge/index.ts +0 -19
  16. package/dist/knowledge/loader.ts +0 -200
  17. package/dist/knowledge/manifest.json +0 -29
  18. package/dist/llmgateway.js +0 -3243
  19. package/dist/mcp.js +0 -1639
  20. package/dist/memory.js +0 -0
  21. package/dist/react-host/index.js +0 -101
  22. package/dist/react-host/ink.js +0 -97
  23. package/dist/react-host/jsx-runtime.js +0 -95
  24. package/dist/react-ink.js +0 -3834
  25. package/dist/runtime.js +0 -4421
  26. package/dist/shell-app.js +0 -12333
  27. package/dist/smithy.js +0 -8033
  28. package/dist/swarm.js +0 -8818
  29. package/dist/tracing.js +0 -724
  30. package/dist/tui.js +0 -2213
  31. package/dist/types/capabilities/backends/index.d.ts +0 -10
  32. package/dist/types/capabilities/backends/node-backends.d.ts +0 -30
  33. package/dist/types/capabilities/capabilities.test.d.ts +0 -14
  34. package/dist/types/capabilities/files/diff.d.ts +0 -49
  35. package/dist/types/capabilities/files/edit.d.ts +0 -21
  36. package/dist/types/capabilities/files/ls.d.ts +0 -16
  37. package/dist/types/capabilities/files/read-state-gate.d.ts +0 -69
  38. package/dist/types/capabilities/files/read-state-gate.test.d.ts +0 -14
  39. package/dist/types/capabilities/files/read.d.ts +0 -15
  40. package/dist/types/capabilities/files/write.d.ts +0 -16
  41. package/dist/types/capabilities/index.d.ts +0 -29
  42. package/dist/types/capabilities/kernel/backends.d.ts +0 -119
  43. package/dist/types/capabilities/kernel/context.d.ts +0 -52
  44. package/dist/types/capabilities/kernel/index.d.ts +0 -24
  45. package/dist/types/capabilities/kernel/output.d.ts +0 -40
  46. package/dist/types/capabilities/kernel/registry.d.ts +0 -61
  47. package/dist/types/capabilities/kernel/spec.d.ts +0 -168
  48. package/dist/types/capabilities/planning/todo.d.ts +0 -62
  49. package/dist/types/capabilities/registry.d.ts +0 -44
  50. package/dist/types/capabilities/search/find.d.ts +0 -33
  51. package/dist/types/capabilities/search/grep.d.ts +0 -30
  52. package/dist/types/capabilities/shell/bash.d.ts +0 -18
  53. package/dist/types/capabilities/shell/process.d.ts +0 -33
  54. package/dist/types/capabilities/web/webfetch.d.ts +0 -25
  55. package/dist/types/capabilities/web/websearch.d.ts +0 -23
  56. package/dist/types/connectors-saas/connectors-saas.test.d.ts +0 -12
  57. package/dist/types/connectors-saas/index.d.ts +0 -16
  58. package/dist/types/connectors-saas/saas/adapter/composio-backend.d.ts +0 -60
  59. package/dist/types/connectors-saas/saas/control/connect.d.ts +0 -114
  60. package/dist/types/connectors-saas/saas/control/tools.d.ts +0 -67
  61. package/dist/types/connectors-saas/saas/core/builder.d.ts +0 -86
  62. package/dist/types/connectors-saas/saas/core/cache.d.ts +0 -53
  63. package/dist/types/connectors-saas/saas/core/index.d.ts +0 -14
  64. package/dist/types/connectors-saas/saas/core/port.d.ts +0 -157
  65. package/dist/types/connectors-saas/saas/core/scope-planner.d.ts +0 -74
  66. package/dist/types/connectors-saas/saas/gateway.d.ts +0 -133
  67. package/dist/types/connectors-saas/saas/render/format.d.ts +0 -54
  68. package/dist/types/connectors-saas/saas/render/index.d.ts +0 -19
  69. package/dist/types/connectors-saas/saas/render/summarizers.d.ts +0 -58
  70. package/dist/types/facade/agent.d.ts +0 -1
  71. package/dist/types/facade/ai.d.ts +0 -1
  72. package/dist/types/facade/bot/actions/bash.d.ts +0 -71
  73. package/dist/types/facade/bot/actions/bash.test.d.ts +0 -1
  74. package/dist/types/facade/bot/actions/checkpoint.d.ts +0 -49
  75. package/dist/types/facade/bot/actions/checkpoint.test.d.ts +0 -1
  76. package/dist/types/facade/bot/actions/composio/accounts.d.ts +0 -22
  77. package/dist/types/facade/bot/actions/composio/client.d.ts +0 -39
  78. package/dist/types/facade/bot/actions/composio/connect.d.ts +0 -19
  79. package/dist/types/facade/bot/actions/composio/enable.d.ts +0 -25
  80. package/dist/types/facade/bot/actions/composio/execute.d.ts +0 -26
  81. package/dist/types/facade/bot/actions/composio/helpers.d.ts +0 -16
  82. package/dist/types/facade/bot/actions/composio/index.d.ts +0 -9
  83. package/dist/types/facade/bot/actions/composio/provider.d.ts +0 -8
  84. package/dist/types/facade/bot/actions/composio/toolkits.d.ts +0 -22
  85. package/dist/types/facade/bot/actions/composio/tools.d.ts +0 -28
  86. package/dist/types/facade/bot/actions/composio/types.d.ts +0 -137
  87. package/dist/types/facade/bot/actions/crew/activity-tracker.d.ts +0 -65
  88. package/dist/types/facade/bot/actions/crew/cleanup.d.ts +0 -50
  89. package/dist/types/facade/bot/actions/crew/fs-lock.d.ts +0 -11
  90. package/dist/types/facade/bot/actions/crew/index.d.ts +0 -11
  91. package/dist/types/facade/bot/actions/crew/mailbox.d.ts +0 -20
  92. package/dist/types/facade/bot/actions/crew/model-policy.d.ts +0 -22
  93. package/dist/types/facade/bot/actions/crew/names.d.ts +0 -27
  94. package/dist/types/facade/bot/actions/crew/protocol.d.ts +0 -74
  95. package/dist/types/facade/bot/actions/crew/task-store.d.ts +0 -88
  96. package/dist/types/facade/bot/actions/crew/team-attach-claim.d.ts +0 -35
  97. package/dist/types/facade/bot/actions/crew/team-config.d.ts +0 -54
  98. package/dist/types/facade/bot/actions/crew/worktree.d.ts +0 -39
  99. package/dist/types/facade/bot/actions/edit-diff.d.ts +0 -66
  100. package/dist/types/facade/bot/actions/edit-utils.d.ts +0 -86
  101. package/dist/types/facade/bot/actions/edit.d.ts +0 -59
  102. package/dist/types/facade/bot/actions/edit.test.d.ts +0 -1
  103. package/dist/types/facade/bot/actions/find.d.ts +0 -27
  104. package/dist/types/facade/bot/actions/find.test.d.ts +0 -1
  105. package/dist/types/facade/bot/actions/grep.d.ts +0 -53
  106. package/dist/types/facade/bot/actions/grep.test.d.ts +0 -1
  107. package/dist/types/facade/bot/actions/index.d.ts +0 -316
  108. package/dist/types/facade/bot/actions/kit/hook-runner.d.ts +0 -12
  109. package/dist/types/facade/bot/actions/kit/image-resize.d.ts +0 -19
  110. package/dist/types/facade/bot/actions/kit/mime.d.ts +0 -1
  111. package/dist/types/facade/bot/actions/kit/shell.d.ts +0 -12
  112. package/dist/types/facade/bot/actions/ls.d.ts +0 -41
  113. package/dist/types/facade/bot/actions/path-utils.d.ts +0 -8
  114. package/dist/types/facade/bot/actions/process-controller.d.ts +0 -14
  115. package/dist/types/facade/bot/actions/process-manager.d.ts +0 -59
  116. package/dist/types/facade/bot/actions/process-types.d.ts +0 -73
  117. package/dist/types/facade/bot/actions/process.d.ts +0 -37
  118. package/dist/types/facade/bot/actions/read-state.d.ts +0 -83
  119. package/dist/types/facade/bot/actions/read-state.test.d.ts +0 -1
  120. package/dist/types/facade/bot/actions/read.d.ts +0 -43
  121. package/dist/types/facade/bot/actions/read.test.d.ts +0 -1
  122. package/dist/types/facade/bot/actions/registry.d.ts +0 -20
  123. package/dist/types/facade/bot/actions/sandbox-backend.d.ts +0 -99
  124. package/dist/types/facade/bot/actions/sandbox-backend.test.d.ts +0 -1
  125. package/dist/types/facade/bot/actions/todo-store.d.ts +0 -76
  126. package/dist/types/facade/bot/actions/todo-types.d.ts +0 -72
  127. package/dist/types/facade/bot/actions/todo.d.ts +0 -76
  128. package/dist/types/facade/bot/actions/truncate.d.ts +0 -78
  129. package/dist/types/facade/bot/actions/webfetch.d.ts +0 -35
  130. package/dist/types/facade/bot/actions/websearch.d.ts +0 -37
  131. package/dist/types/facade/bot/actions/websearch.test.d.ts +0 -1
  132. package/dist/types/facade/bot/actions/write.d.ts +0 -45
  133. package/dist/types/facade/bot/agent-loop.d.ts +0 -30
  134. package/dist/types/facade/bot/agent-loop.test.d.ts +0 -1
  135. package/dist/types/facade/bot/agent.d.ts +0 -140
  136. package/dist/types/facade/bot/error-handler.d.ts +0 -7
  137. package/dist/types/facade/bot/event-bus.d.ts +0 -8
  138. package/dist/types/facade/bot/index.d.ts +0 -7
  139. package/dist/types/facade/bot/messages.d.ts +0 -83
  140. package/dist/types/facade/bot/permission-gate.test.d.ts +0 -1
  141. package/dist/types/facade/bot/proxy.d.ts +0 -70
  142. package/dist/types/facade/bot/session-manager.d.ts +0 -409
  143. package/dist/types/facade/bot/state-manager.d.ts +0 -21
  144. package/dist/types/facade/bot/telemetry.d.ts +0 -6
  145. package/dist/types/facade/bot/types.d.ts +0 -267
  146. package/dist/types/facade/mcp-core/client-pool.d.ts +0 -105
  147. package/dist/types/facade/mcp-core/client.d.ts +0 -213
  148. package/dist/types/facade/mcp-core/client.test.d.ts +0 -18
  149. package/dist/types/facade/mcp-core/config.d.ts +0 -60
  150. package/dist/types/facade/mcp-core/errors.d.ts +0 -103
  151. package/dist/types/facade/mcp-core/index.d.ts +0 -55
  152. package/dist/types/facade/mcp-core/schema-converter.d.ts +0 -67
  153. package/dist/types/facade/mcp-core/server.d.ts +0 -110
  154. package/dist/types/facade/mcp-core/tool-factory.d.ts +0 -62
  155. package/dist/types/facade/mcp-core/types.d.ts +0 -298
  156. package/dist/types/facade/mcp.d.ts +0 -1
  157. package/dist/types/facade/memory.d.ts +0 -1
  158. package/dist/types/facade/ml/adapters/amazon-bedrock.d.ts +0 -32
  159. package/dist/types/facade/ml/adapters/anthropic-retry.test.d.ts +0 -1
  160. package/dist/types/facade/ml/adapters/anthropic.d.ts +0 -78
  161. package/dist/types/facade/ml/adapters/azure-openai-responses.d.ts +0 -14
  162. package/dist/types/facade/ml/adapters/google-shared.d.ts +0 -99
  163. package/dist/types/facade/ml/adapters/google-vertex.d.ts +0 -14
  164. package/dist/types/facade/ml/adapters/google.d.ts +0 -15
  165. package/dist/types/facade/ml/adapters/kimi.d.ts +0 -21
  166. package/dist/types/facade/ml/adapters/mock.d.ts +0 -9
  167. package/dist/types/facade/ml/adapters/nvidia.d.ts +0 -12
  168. package/dist/types/facade/ml/adapters/openai-codex-responses.d.ts +0 -8
  169. package/dist/types/facade/ml/adapters/openai-completions.d.ts +0 -24
  170. package/dist/types/facade/ml/adapters/openai-responses-shared.d.ts +0 -25
  171. package/dist/types/facade/ml/adapters/openai-responses.d.ts +0 -12
  172. package/dist/types/facade/ml/adapters/openai-scaffold.d.ts +0 -3
  173. package/dist/types/facade/ml/adapters/register-builtins.d.ts +0 -2
  174. package/dist/types/facade/ml/adapters/simple-options.d.ts +0 -39
  175. package/dist/types/facade/ml/adapters/simple-options.test.d.ts +0 -1
  176. package/dist/types/facade/ml/adapters/transform-messages.d.ts +0 -23
  177. package/dist/types/facade/ml/api-registry.d.ts +0 -49
  178. package/dist/types/facade/ml/cli.d.ts +0 -2
  179. package/dist/types/facade/ml/env-api-keys.d.ts +0 -19
  180. package/dist/types/facade/ml/index.d.ts +0 -27
  181. package/dist/types/facade/ml/kit/auth/anthropic.d.ts +0 -17
  182. package/dist/types/facade/ml/kit/auth/github-copilot.d.ts +0 -22
  183. package/dist/types/facade/ml/kit/auth/index.d.ts +0 -50
  184. package/dist/types/facade/ml/kit/auth/kimi.d.ts +0 -23
  185. package/dist/types/facade/ml/kit/auth/oauth-page.d.ts +0 -2
  186. package/dist/types/facade/ml/kit/auth/openai-codex.d.ts +0 -36
  187. package/dist/types/facade/ml/kit/auth/pkce.d.ts +0 -12
  188. package/dist/types/facade/ml/kit/auth/types.d.ts +0 -67
  189. package/dist/types/facade/ml/kit/base-stream-handler.d.ts +0 -30
  190. package/dist/types/facade/ml/kit/event-stream.d.ts +0 -63
  191. package/dist/types/facade/ml/kit/index.d.ts +0 -14
  192. package/dist/types/facade/ml/kit/json-parse.d.ts +0 -23
  193. package/dist/types/facade/ml/kit/message-transform.d.ts +0 -32
  194. package/dist/types/facade/ml/kit/output-factory.d.ts +0 -8
  195. package/dist/types/facade/ml/kit/overflow.d.ts +0 -9
  196. package/dist/types/facade/ml/kit/provider-adapter.d.ts +0 -56
  197. package/dist/types/facade/ml/kit/provider-client-builder.d.ts +0 -36
  198. package/dist/types/facade/ml/kit/provider-consolidation.d.ts +0 -3
  199. package/dist/types/facade/ml/kit/provider-constants.d.ts +0 -34
  200. package/dist/types/facade/ml/kit/provider-errors.d.ts +0 -52
  201. package/dist/types/facade/ml/kit/sanitize-unicode.d.ts +0 -2
  202. package/dist/types/facade/ml/kit/stream-event-helper.d.ts +0 -38
  203. package/dist/types/facade/ml/kit/stream-handler-types.d.ts +0 -46
  204. package/dist/types/facade/ml/kit/streaming-state-manager.d.ts +0 -42
  205. package/dist/types/facade/ml/kit/tool-converter.d.ts +0 -49
  206. package/dist/types/facade/ml/kit/typebox-helpers.d.ts +0 -24
  207. package/dist/types/facade/ml/kit/validation.d.ts +0 -26
  208. package/dist/types/facade/ml/models.d.ts +0 -41
  209. package/dist/types/facade/ml/models.generated.d.ts +0 -12405
  210. package/dist/types/facade/ml/stream.d.ts +0 -27
  211. package/dist/types/facade/ml/types.d.ts +0 -269
  212. package/dist/types/index.d.ts +0 -16
  213. package/dist/types/interop/index.d.ts +0 -12
  214. package/dist/types/interop/interop.test.d.ts +0 -19
  215. package/dist/types/interop/protocol-bridge/bridge.d.ts +0 -52
  216. package/dist/types/interop/protocol-bridge/contract.d.ts +0 -249
  217. package/dist/types/interop/protocol-bridge/endpoint.d.ts +0 -124
  218. package/dist/types/interop/protocol-bridge/fleet.d.ts +0 -92
  219. package/dist/types/interop/protocol-bridge/host.d.ts +0 -61
  220. package/dist/types/interop/protocol-bridge/index.d.ts +0 -16
  221. package/dist/types/interop/protocol-bridge/schema.d.ts +0 -29
  222. package/dist/types/llmgateway/catalog/cards.d.ts +0 -18
  223. package/dist/types/llmgateway/catalog/cost.d.ts +0 -15
  224. package/dist/types/llmgateway/catalog/index.d.ts +0 -7
  225. package/dist/types/llmgateway/catalog/query.d.ts +0 -40
  226. package/dist/types/llmgateway/connectors/anthropic.d.ts +0 -35
  227. package/dist/types/llmgateway/connectors/azure-openai.d.ts +0 -33
  228. package/dist/types/llmgateway/connectors/bedrock.d.ts +0 -113
  229. package/dist/types/llmgateway/connectors/google-vertex.d.ts +0 -38
  230. package/dist/types/llmgateway/connectors/google.d.ts +0 -40
  231. package/dist/types/llmgateway/connectors/index.d.ts +0 -26
  232. package/dist/types/llmgateway/connectors/kimi.d.ts +0 -28
  233. package/dist/types/llmgateway/connectors/mock.d.ts +0 -37
  234. package/dist/types/llmgateway/connectors/nvidia.d.ts +0 -27
  235. package/dist/types/llmgateway/connectors/ollama.d.ts +0 -45
  236. package/dist/types/llmgateway/connectors/openai-chat.d.ts +0 -25
  237. package/dist/types/llmgateway/connectors/openai-responses.d.ts +0 -49
  238. package/dist/types/llmgateway/contract/connector.d.ts +0 -32
  239. package/dist/types/llmgateway/contract/conversation.d.ts +0 -86
  240. package/dist/types/llmgateway/contract/emission.d.ts +0 -55
  241. package/dist/types/llmgateway/contract/errors.d.ts +0 -27
  242. package/dist/types/llmgateway/contract/index.d.ts +0 -13
  243. package/dist/types/llmgateway/contract/model-card.d.ts +0 -42
  244. package/dist/types/llmgateway/contract/options.d.ts +0 -31
  245. package/dist/types/llmgateway/contract/reply.d.ts +0 -33
  246. package/dist/types/llmgateway/conversion/index.d.ts +0 -10
  247. package/dist/types/llmgateway/conversion/mappers.d.ts +0 -65
  248. package/dist/types/llmgateway/conversion/openai-compatible.d.ts +0 -46
  249. package/dist/types/llmgateway/conversion/reduce.d.ts +0 -20
  250. package/dist/types/llmgateway/credentials/oauth.d.ts +0 -73
  251. package/dist/types/llmgateway/credentials/pkce.d.ts +0 -52
  252. package/dist/types/llmgateway/credentials/secrets.d.ts +0 -74
  253. package/dist/types/llmgateway/gateway.d.ts +0 -34
  254. package/dist/types/llmgateway/gateway.test.d.ts +0 -14
  255. package/dist/types/llmgateway/index.d.ts +0 -11
  256. package/dist/types/llmgateway/streaming/channel.d.ts +0 -24
  257. package/dist/types/llmgateway/streaming/index.d.ts +0 -10
  258. package/dist/types/llmgateway/streaming/ndjson.d.ts +0 -17
  259. package/dist/types/llmgateway/streaming/sse.d.ts +0 -31
  260. package/dist/types/react-host/index.d.ts +0 -9
  261. package/dist/types/react-host/ink.d.ts +0 -5
  262. package/dist/types/react-host/jsx-runtime.d.ts +0 -4
  263. package/dist/types/react-host/loader.d.ts +0 -3
  264. package/dist/types/react-ink/components/ChangelogBlock.d.ts +0 -8
  265. package/dist/types/react-ink/components/DisplayBlockView.d.ts +0 -8
  266. package/dist/types/react-ink/components/Footer.d.ts +0 -11
  267. package/dist/types/react-ink/components/MessageList.d.ts +0 -14
  268. package/dist/types/react-ink/components/MessageRow.d.ts +0 -13
  269. package/dist/types/react-ink/components/StatusLine.d.ts +0 -18
  270. package/dist/types/react-ink/components/TaskPanel.d.ts +0 -11
  271. package/dist/types/react-ink/components/ToolEventBlock.d.ts +0 -48
  272. package/dist/types/react-ink/components/ToolEventBlock.test.d.ts +0 -1
  273. package/dist/types/react-ink/components/dialogs/DialogFrame.d.ts +0 -8
  274. package/dist/types/react-ink/components/dialogs/LoginDialog.d.ts +0 -14
  275. package/dist/types/react-ink/components/dialogs/ModelDialog.d.ts +0 -9
  276. package/dist/types/react-ink/components/dialogs/OAuthDialog.d.ts +0 -9
  277. package/dist/types/react-ink/components/dialogs/ScopedModelsDialog.d.ts +0 -9
  278. package/dist/types/react-ink/components/dialogs/SelectableDialog.d.ts +0 -22
  279. package/dist/types/react-ink/components/dialogs/SessionDialog.d.ts +0 -13
  280. package/dist/types/react-ink/components/dialogs/SettingsDialog.d.ts +0 -14
  281. package/dist/types/react-ink/components/dialogs/StartupSessionPicker.d.ts +0 -9
  282. package/dist/types/react-ink/components/dialogs/ThemeDialog.d.ts +0 -26
  283. package/dist/types/react-ink/components/dialogs/TreeDialog.d.ts +0 -8
  284. package/dist/types/react-ink/components/dialogs/UserMessageDialog.d.ts +0 -8
  285. package/dist/types/react-ink/components/messages/AssistantMessage.d.ts +0 -12
  286. package/dist/types/react-ink/components/messages/BashMessage.d.ts +0 -8
  287. package/dist/types/react-ink/components/messages/BranchSummaryMessage.d.ts +0 -8
  288. package/dist/types/react-ink/components/messages/CompactionMessage.d.ts +0 -8
  289. package/dist/types/react-ink/components/messages/CustomMessage.d.ts +0 -9
  290. package/dist/types/react-ink/components/messages/SkillInvocationMessage.d.ts +0 -7
  291. package/dist/types/react-ink/components/messages/ToolCallMessage.d.ts +0 -8
  292. package/dist/types/react-ink/components/messages/ToolResultBlock.d.ts +0 -12
  293. package/dist/types/react-ink/components/messages/UserMessage.d.ts +0 -9
  294. package/dist/types/react-ink/diff/Diff.d.ts +0 -22
  295. package/dist/types/react-ink/diff/diff.test.d.ts +0 -1
  296. package/dist/types/react-ink/diff/structured.d.ts +0 -41
  297. package/dist/types/react-ink/diff/word-diff.d.ts +0 -27
  298. package/dist/types/react-ink/index.d.ts +0 -42
  299. package/dist/types/react-ink/markdown/Markdown.d.ts +0 -23
  300. package/dist/types/react-ink/markdown/MarkdownTable.d.ts +0 -19
  301. package/dist/types/react-ink/markdown/StreamingMarkdown.d.ts +0 -34
  302. package/dist/types/react-ink/markdown/format-token.d.ts +0 -39
  303. package/dist/types/react-ink/markdown/highlight.d.ts +0 -31
  304. package/dist/types/react-ink/theme-adapter.d.ts +0 -66
  305. package/dist/types/react-ink/types.d.ts +0 -133
  306. package/dist/types/react-ink/utils/message-groups.d.ts +0 -25
  307. package/dist/types/react-ink/utils/selection-dialog.d.ts +0 -2
  308. package/dist/types/react-ink/utils/session-browser.d.ts +0 -27
  309. package/dist/types/react-ink/utils/tool-display.d.ts +0 -37
  310. package/dist/types/runtime/cadence/cadence.test.d.ts +0 -6
  311. package/dist/types/runtime/cadence/fold.d.ts +0 -48
  312. package/dist/types/runtime/cadence/index.d.ts +0 -12
  313. package/dist/types/runtime/cadence/reducer.d.ts +0 -44
  314. package/dist/types/runtime/conductor/agent.d.ts +0 -71
  315. package/dist/types/runtime/conductor/index.d.ts +0 -11
  316. package/dist/types/runtime/contract/config.d.ts +0 -44
  317. package/dist/types/runtime/contract/effect.d.ts +0 -41
  318. package/dist/types/runtime/contract/errors.d.ts +0 -22
  319. package/dist/types/runtime/contract/events.d.ts +0 -63
  320. package/dist/types/runtime/contract/index.d.ts +0 -18
  321. package/dist/types/runtime/contract/run-state.d.ts +0 -57
  322. package/dist/types/runtime/contract/session.d.ts +0 -42
  323. package/dist/types/runtime/contract/signal.d.ts +0 -49
  324. package/dist/types/runtime/contract/tools.d.ts +0 -45
  325. package/dist/types/runtime/dispatch/index.d.ts +0 -9
  326. package/dist/types/runtime/dispatch/scheduler.d.ts +0 -53
  327. package/dist/types/runtime/index.d.ts +0 -22
  328. package/dist/types/runtime/ledger/accumulator.d.ts +0 -44
  329. package/dist/types/runtime/ledger/bus.d.ts +0 -50
  330. package/dist/types/runtime/ledger/index.d.ts +0 -11
  331. package/dist/types/runtime/memory/compactor.d.ts +0 -56
  332. package/dist/types/runtime/memory/estimate.d.ts +0 -21
  333. package/dist/types/runtime/memory/index.d.ts +0 -8
  334. package/dist/types/runtime/runtime.test.d.ts +0 -15
  335. package/dist/types/runtime/store/dag.d.ts +0 -72
  336. package/dist/types/runtime/store/hash.d.ts +0 -18
  337. package/dist/types/runtime/store/index.d.ts +0 -12
  338. package/dist/types/runtime/store/persist.d.ts +0 -49
  339. package/dist/types/runtime/turn/driver.d.ts +0 -32
  340. package/dist/types/runtime/turn/index.d.ts +0 -8
  341. package/dist/types/runtime/wire/index.d.ts +0 -10
  342. package/dist/types/runtime/wire/projectors.d.ts +0 -53
  343. package/dist/types/shell-app/auth-cli/index.d.ts +0 -9
  344. package/dist/types/shell-app/auth-cli/oauth-cli.d.ts +0 -73
  345. package/dist/types/shell-app/boot/context.d.ts +0 -108
  346. package/dist/types/shell-app/boot/index.d.ts +0 -13
  347. package/dist/types/shell-app/boot/pipeline.d.ts +0 -66
  348. package/dist/types/shell-app/boot/stages.d.ts +0 -77
  349. package/dist/types/shell-app/cli.d.ts +0 -75
  350. package/dist/types/shell-app/config/index.d.ts +0 -11
  351. package/dist/types/shell-app/config/locator.d.ts +0 -85
  352. package/dist/types/shell-app/config/settings.d.ts +0 -91
  353. package/dist/types/shell-app/index.d.ts +0 -26
  354. package/dist/types/shell-app/invocation/flags.d.ts +0 -89
  355. package/dist/types/shell-app/invocation/parse.d.ts +0 -89
  356. package/dist/types/shell-app/locate/brand.d.ts +0 -71
  357. package/dist/types/shell-app/locate/index.d.ts +0 -12
  358. package/dist/types/shell-app/locate/locator.d.ts +0 -122
  359. package/dist/types/shell-app/runners/contract.d.ts +0 -116
  360. package/dist/types/shell-app/runners/index.d.ts +0 -15
  361. package/dist/types/shell-app/runners/one-shot.d.ts +0 -21
  362. package/dist/types/shell-app/runners/registry.d.ts +0 -34
  363. package/dist/types/shell-app/runners/repl.d.ts +0 -51
  364. package/dist/types/shell-app/runners/wire.d.ts +0 -34
  365. package/dist/types/shell-app/shell-app.test.d.ts +0 -14
  366. package/dist/types/shell-app/upgrade/index.d.ts +0 -9
  367. package/dist/types/shell-app/upgrade/upgrades.d.ts +0 -62
  368. package/dist/types/smithy/config/flag-reader.d.ts +0 -128
  369. package/dist/types/smithy/config/index.d.ts +0 -9
  370. package/dist/types/smithy/forge.d.ts +0 -135
  371. package/dist/types/smithy/index.d.ts +0 -36
  372. package/dist/types/smithy/knowledge/index.d.ts +0 -10
  373. package/dist/types/smithy/knowledge/loader.d.ts +0 -64
  374. package/dist/types/smithy/persona/blueprint.d.ts +0 -75
  375. package/dist/types/smithy/persona/define-agent.d.ts +0 -51
  376. package/dist/types/smithy/persona/index.d.ts +0 -14
  377. package/dist/types/smithy/persona/profiles.d.ts +0 -44
  378. package/dist/types/smithy/runtime/index.d.ts +0 -9
  379. package/dist/types/smithy/runtime/tool-ledger.d.ts +0 -130
  380. package/dist/types/smithy/smithy.test.d.ts +0 -20
  381. package/dist/types/smithy/ui/index.d.ts +0 -11
  382. package/dist/types/smithy/ui/transcript.d.ts +0 -183
  383. package/dist/types/swarm/coordinator.d.ts +0 -192
  384. package/dist/types/swarm/index.d.ts +0 -33
  385. package/dist/types/swarm/isolation/index.d.ts +0 -14
  386. package/dist/types/swarm/isolation/runner.d.ts +0 -61
  387. package/dist/types/swarm/isolation/worktree.d.ts +0 -142
  388. package/dist/types/swarm/kernel/faults.d.ts +0 -52
  389. package/dist/types/swarm/kernel/ids.d.ts +0 -25
  390. package/dist/types/swarm/kernel/index.d.ts +0 -26
  391. package/dist/types/swarm/kernel/json-cell.d.ts +0 -113
  392. package/dist/types/swarm/kernel/jsonl-log.d.ts +0 -81
  393. package/dist/types/swarm/postbox/channel.d.ts +0 -88
  394. package/dist/types/swarm/postbox/codecs.d.ts +0 -253
  395. package/dist/types/swarm/postbox/index.d.ts +0 -16
  396. package/dist/types/swarm/roster/index.d.ts +0 -16
  397. package/dist/types/swarm/roster/manifest.d.ts +0 -185
  398. package/dist/types/swarm/swarm.test.d.ts +0 -24
  399. package/dist/types/swarm/telemetry/activity.d.ts +0 -143
  400. package/dist/types/swarm/workboard/board.d.ts +0 -174
  401. package/dist/types/swarm/workboard/dep-graph.d.ts +0 -77
  402. package/dist/types/swarm/workboard/index.d.ts +0 -12
  403. package/dist/types/tracing/adapter/index.d.ts +0 -12
  404. package/dist/types/tracing/adapter/runtime-trace.d.ts +0 -54
  405. package/dist/types/tracing/channel/index.d.ts +0 -9
  406. package/dist/types/tracing/channel/signal.d.ts +0 -93
  407. package/dist/types/tracing/index.d.ts +0 -25
  408. package/dist/types/tracing/recorder/index.d.ts +0 -12
  409. package/dist/types/tracing/recorder/recorder.d.ts +0 -75
  410. package/dist/types/tracing/recorder/sampling.d.ts +0 -55
  411. package/dist/types/tracing/redaction/index.d.ts +0 -8
  412. package/dist/types/tracing/redaction/secret-scrubber.d.ts +0 -95
  413. package/dist/types/tracing/registry/hub.d.ts +0 -57
  414. package/dist/types/tracing/registry/index.d.ts +0 -7
  415. package/dist/types/tracing/signal/handle.d.ts +0 -73
  416. package/dist/types/tracing/signal/index.d.ts +0 -12
  417. package/dist/types/tracing/signal/segment.d.ts +0 -124
  418. package/dist/types/tracing/sinks/base.d.ts +0 -51
  419. package/dist/types/tracing/sinks/console.d.ts +0 -44
  420. package/dist/types/tracing/sinks/file.d.ts +0 -47
  421. package/dist/types/tracing/sinks/index.d.ts +0 -16
  422. package/dist/types/tracing/sinks/stream.d.ts +0 -46
  423. package/dist/types/tracing/tracing.test.d.ts +0 -7
  424. package/dist/types/ui/autocomplete.d.ts +0 -59
  425. package/dist/types/ui/contracts.d.ts +0 -38
  426. package/dist/types/ui/editor-component.d.ts +0 -100
  427. package/dist/types/ui/fuzzy.d.ts +0 -29
  428. package/dist/types/ui/index.d.ts +0 -8
  429. package/dist/types/ui/keybindings.d.ts +0 -62
  430. package/dist/types/ui/keys.d.ts +0 -171
  431. package/dist/types/ui/theme-types.d.ts +0 -36
  432. package/dist/types/ui/utils.d.ts +0 -101
  433. package/dist/types/ui-bridge/InteractiveApp.d.ts +0 -38
  434. package/dist/types/ui-bridge/adapter.d.ts +0 -90
  435. package/dist/types/ui-bridge/index.d.ts +0 -37
@@ -1,85 +0,0 @@
1
- /**
2
- * Path & branding resolution for the shell application.
3
- *
4
- * Every user-visible name — the product name, the on-disk config directory, the
5
- * environment-variable prefix — derives from a single {@link Brand} object, so a
6
- * rebrand touches exactly one constant. The {@link Locator} interface is the
7
- * narrow seam the rest of the shell uses to discover *where* things live on
8
- * disk: the profile directory and the files beneath it. It is an interface
9
- * (not a concrete class) so tests can hand a fake rooted at a temp directory and
10
- * the production binding can memoize.
11
- *
12
- * This module owns no I/O. {@link NodeLocator} resolves paths against the user's
13
- * home directory using `node:os` and `node:path` but never touches the
14
- * filesystem; the upgrade and settings layers do the reading and writing.
15
- */
16
- /**
17
- * The single source of truth for every user-visible name.
18
- *
19
- * All on-disk locations and environment-variable names derive from these
20
- * fields, so changing the product's identity is a one-line edit here rather
21
- * than a hunt through scattered string literals.
22
- */
23
- export interface Brand {
24
- /** The product name (e.g. shown in `--version`, process title). */
25
- readonly name: string;
26
- /** The dotted directory under the user's home that holds all state. */
27
- readonly configDir: string;
28
- /** Prefix for environment variables this app reads (e.g. `INDUSAGI`). */
29
- readonly envPrefix: string;
30
- }
31
- /** The default brand identity for this build. */
32
- export declare const BRAND: Brand;
33
- /**
34
- * Resolves the absolute on-disk locations the shell reads and writes.
35
- *
36
- * The shape mirrors the layout under the profile directory:
37
- *
38
- * <home>/<brand.configDir>/ ← profileDir()
39
- * settings.json ← settingsPath()
40
- * auth.json ← authPath()
41
- * sessions/ ← sessionsDir()
42
- * upgrades.json ← upgradeMarkerPath()
43
- *
44
- * A separate project-scoped settings file lives in the working directory under
45
- * the same config-dir name; {@link projectSettingsPath} resolves it.
46
- *
47
- * Implementations must be pure path computation — no filesystem access — so they
48
- * are cheap to call repeatedly and trivial to fake in tests.
49
- */
50
- export interface Locator {
51
- /** The brand identity these paths derive from. */
52
- readonly brand: Brand;
53
- /** The per-user profile directory: `<home>/<configDir>`. */
54
- profileDir(): string;
55
- /** The global settings file inside the profile directory. */
56
- settingsPath(): string;
57
- /** The project-scoped settings file under `<cwd>/<configDir>`. */
58
- projectSettingsPath(cwd: string): string;
59
- /** The credential store inside the profile directory. */
60
- authPath(): string;
61
- /** The directory holding persisted sessions. */
62
- sessionsDir(): string;
63
- /** The marker file recording which upgrades have already run. */
64
- upgradeMarkerPath(): string;
65
- }
66
- /**
67
- * The production {@link Locator}, rooted at the user's home directory.
68
- *
69
- * All paths hang off a single `under(...segments)` helper so the layout is
70
- * declared once. `home` is injectable purely to make the class testable; it
71
- * defaults to {@link homedir}.
72
- */
73
- export declare class NodeLocator implements Locator {
74
- readonly brand: Brand;
75
- private readonly home;
76
- constructor(brand?: Brand, home?: string);
77
- /** Join segments under the profile directory. */
78
- private under;
79
- profileDir(): string;
80
- settingsPath(): string;
81
- projectSettingsPath(cwd: string): string;
82
- authPath(): string;
83
- sessionsDir(): string;
84
- upgradeMarkerPath(): string;
85
- }
@@ -1,91 +0,0 @@
1
- /**
2
- * Settings resolution for the shell application.
3
- *
4
- * Settings arrive from three places, lowest precedence first: the built-in
5
- * {@link DEFAULT_SETTINGS}, the per-user global file (under the profile
6
- * directory), and the per-project file (under the working directory). They are
7
- * merged shallowly with the rule "later wins", so a project file overrides the
8
- * global file, which overrides the defaults.
9
- *
10
- * The loader is deliberately forgiving. A missing file, an unreadable file, or a
11
- * file holding malformed/invalid JSON is treated as "no settings supplied at
12
- * this layer" — never an exception. Configuration problems must not stop the
13
- * agent from booting; the worst case is that the user falls back to defaults.
14
- *
15
- * Model selection is resolved separately by {@link resolveModelId}, which layers
16
- * an explicit per-invocation override on top of the configured default and a
17
- * hard-coded final fallback, validating each candidate against the catalog.
18
- */
19
- import type { ServerConfig } from "../../interop";
20
- import type { Locator } from "./locator";
21
- /**
22
- * Which built-in tool collection the agent exposes to the model.
23
- *
24
- * - `read-only` — observe-only tools (read, ls, grep, find, web).
25
- * - `coding` — read-only plus mutating/stateful tools (write, edit, bash…).
26
- * - `all` — every registered tool.
27
- *
28
- * Mirrors the `ToolCollection` names the capabilities layer defines; kept as a
29
- * standalone literal so settings need not import the capabilities package.
30
- */
31
- export type ToolCollectionName = "read-only" | "coding" | "all";
32
- /** Tool-related preferences. */
33
- export interface ToolSettings {
34
- /** Which built-in collection to expose; absent leaves the choice to the host. */
35
- readonly collection?: ToolCollectionName;
36
- }
37
- /** History-condensation preferences, mirroring the runtime's policy shape. */
38
- export interface CompactionSettings {
39
- /** Fraction of the context window (0..1) at which condensation triggers. */
40
- readonly triggerRatio?: number;
41
- /** Number of trailing turns kept untouched during condensation. */
42
- readonly keepRecent?: number;
43
- }
44
- /**
45
- * The user-tunable configuration surface.
46
- *
47
- * Every field is optional: an empty object is a valid {@link Settings}. Unknown
48
- * keys read off disk are tolerated and discarded during normalization.
49
- */
50
- export interface Settings {
51
- /** The model id bound to runs when no per-invocation override is given. */
52
- readonly defaultModel?: string;
53
- /** A system preamble prepended to every model invocation. */
54
- readonly systemPrompt?: string;
55
- /** Tool exposure preferences. */
56
- readonly tools?: ToolSettings;
57
- /** External MCP servers to connect on start-up. */
58
- readonly mcpServers?: readonly ServerConfig[];
59
- /** History-condensation tuning. */
60
- readonly compaction?: CompactionSettings;
61
- }
62
- /**
63
- * The built-in baseline every layer is merged on top of.
64
- *
65
- * Intentionally minimal: it names a sensible default collection and leaves model
66
- * selection to {@link resolveModelId}'s fallback so the catalog stays the single
67
- * source of truth for valid model ids.
68
- */
69
- export declare const DEFAULT_SETTINGS: Settings;
70
- /**
71
- * Resolve the effective settings for a working directory.
72
- *
73
- * Merges three layers in increasing precedence — built-in defaults, the global
74
- * profile file, then the project file under `cwd` — and returns the result.
75
- * Never throws: any layer that cannot be read or parsed simply contributes
76
- * nothing. Reads run concurrently; the merge order is fixed regardless.
77
- */
78
- export declare function loadSettings(locator: Locator, cwd: string): Promise<Settings>;
79
- /**
80
- * Decide which model id a run should bind to.
81
- *
82
- * Precedence, highest first:
83
- * 1. `invocationModel` — an explicit per-invocation override (e.g. a CLI flag),
84
- * used when it names a model the catalog knows.
85
- * 2. `settings.defaultModel` — the configured default, used when valid.
86
- * 3. {@link FALLBACK_MODEL_ID} — a catalog-guaranteed last resort.
87
- *
88
- * Each candidate is validated with {@link getCard}; an unknown id is skipped
89
- * rather than honored, so a stale or mistyped model never reaches the gateway.
90
- */
91
- export declare function resolveModelId(settings: Settings, invocationModel?: string): string;
@@ -1,26 +0,0 @@
1
- /**
2
- * The shell application — public surface.
3
- *
4
- * One import site for everything that turns a command line into a running agent:
5
- * the {@link main} entry point and the {@link buildBootContext} assembler, the
6
- * runner registry and its {@link selectRunner | selector}, the parser
7
- * ({@link tokenizeInvocation}) and its {@link Invocation} shape, the path/branding
8
- * {@link Locator}/{@link Brand}, the settings loader, the idempotent upgrade
9
- * runner, and the `auth` subcommand. A host embedding the shell — or a test
10
- * driving it — imports from here rather than reaching into submodules.
11
- */
12
- export { main, buildBootContext, renderUsage, resolveVersion } from "./cli";
13
- export type { CliStreams } from "./cli";
14
- export { OneShotRunner, WireRunner, ReplRunner, TextView, RUNNERS, selectRunner, NoRunnerError, EndOfInput, } from "./runners";
15
- export type { Runner, BootContext, AgentDeps, InteractiveView, } from "./runners";
16
- export { Locator, BRAND, envName } from "./locate";
17
- export type { Brand, LocatorOverrides } from "./locate";
18
- export { tokenizeInvocation, FLAG_SPECS } from "./invocation/parse";
19
- export type { Invocation, RunnerMode } from "./invocation/parse";
20
- export type { FlagSpec, FlagValue, FlagKind } from "./invocation/flags";
21
- export { loadSettings, resolveModelId, DEFAULT_SETTINGS } from "./config";
22
- export type { Settings } from "./config";
23
- export { applyUpgrades, UPGRADES } from "./upgrade";
24
- export type { Upgrade } from "./upgrade";
25
- export { runAuthCommand } from "./auth-cli";
26
- export type { AuthIO } from "./auth-cli";
@@ -1,89 +0,0 @@
1
- /**
2
- * The declarative flag-spec table.
3
- *
4
- * This module is the single source of truth for the shell app's command-line
5
- * vocabulary. Rather than scatter the knowledge of "what flags exist, what they
6
- * mean, and how to read their values" across a hand-written argument loop, every
7
- * flag is described once, as data, in {@link FLAG_SPECS}. The generic parser in
8
- * `parse.ts` reads this table; the help renderer derives its text from it; and a
9
- * new flag is added by appending one row here, never by editing parser branches.
10
- *
11
- * A {@link FlagSpec} pins down four things about a flag:
12
- * - its canonical long name and any aliases (short or long) the user may type;
13
- * - its {@link FlagKind} — whether it carries no value (`boolean`), a free
14
- * string, or a number;
15
- * - a one-line description used to generate `--help`;
16
- * - an optional default that seeds the parsed result when the flag is absent;
17
- * - an optional `repeatable` marker for flags that may appear many times and
18
- * accumulate (e.g. `--mcp`), collected into a string array by the parser.
19
- *
20
- * Nothing here touches `process`, the filesystem, or the network — it is plain
21
- * data plus a couple of pure lookup helpers, so it is trivially testable and
22
- * shareable between the parser and any tooling that wants to reason about flags.
23
- */
24
- /** The three value shapes a flag can carry. */
25
- export type FlagKind = "boolean" | "string" | "number";
26
- /**
27
- * The parsed value a flag contributes to an {@link Invocation}. Booleans land as
28
- * `true`/`false`, strings as themselves, numbers as parsed numerics, and
29
- * repeatable flags accumulate into a `string[]`.
30
- */
31
- export type FlagValue = boolean | string | number | string[];
32
- /**
33
- * One row of the flag table: the complete, declarative description of a single
34
- * command-line flag.
35
- */
36
- export interface FlagSpec {
37
- /**
38
- * The canonical long name, written *without* leading dashes (e.g. `"model"`).
39
- * This is the key the flag's value is filed under in the parsed result.
40
- */
41
- readonly name: string;
42
- /**
43
- * Every other spelling the user may type, each *with* its leading dashes
44
- * (e.g. `["-m"]` or `["--rpc", "--wire"]`). Both short (`-x`) and long
45
- * (`--xyz`) aliases are permitted. The canonical `--<name>` spelling is always
46
- * accepted and need not be listed here.
47
- */
48
- readonly aliases?: readonly string[];
49
- /** Whether the flag carries no value, a string, or a number. */
50
- readonly kind: FlagKind;
51
- /** A one-line summary used when rendering `--help`. */
52
- readonly description: string;
53
- /**
54
- * The value to seed the parsed result with when the flag is never supplied.
55
- * Omit for flags that should simply be absent when unused.
56
- */
57
- readonly default?: FlagValue;
58
- /**
59
- * When `true`, the flag may be given more than once; each occurrence is pushed
60
- * onto a `string[]` rather than overwriting the previous value. Only
61
- * meaningful for `string`-kind flags.
62
- */
63
- readonly repeatable?: boolean;
64
- }
65
- /**
66
- * The canonical flag table.
67
- *
68
- * Order matters only for help rendering (flags are shown top-to-bottom in this
69
- * order); parsing is driven by name/alias lookup, not position. Every spelling
70
- * across this table is unique — the lookup helpers below assume that.
71
- */
72
- export declare const FLAG_SPECS: readonly FlagSpec[];
73
- /**
74
- * Resolve a complete token (e.g. `"--model"`, `"-m"`, `"--rpc"`) to its spec, or
75
- * `undefined` if no flag claims that spelling.
76
- */
77
- export declare function findFlagBySpelling(spelling: string): FlagSpec | undefined;
78
- /**
79
- * Resolve a single clustered short letter (e.g. `"v"` from `-iv`) to its spec,
80
- * by matching against the `-x` form. Returns `undefined` if no flag uses that
81
- * short letter.
82
- */
83
- export declare function findShortFlag(letter: string): FlagSpec | undefined;
84
- /**
85
- * The seed result, holding the `default` of every spec that declares one. The
86
- * parser starts from a copy of this so absent-but-defaulted flags are present in
87
- * the output and repeatable flags begin as empty arrays.
88
- */
89
- export declare function defaultFlags(): Record<string, FlagValue>;
@@ -1,89 +0,0 @@
1
- /**
2
- * The generic, table-driven invocation parser.
3
- *
4
- * {@link tokenizeInvocation} turns a raw `argv` slice (the words after the
5
- * program name) into a structured {@link Invocation}: a bag of recognised flag
6
- * values, the leftover positionals, a derived free-text `prompt`, and the single
7
- * {@link RunnerMode} the launcher should dispatch to.
8
- *
9
- * The parser is fully driven by the {@link FLAG_SPECS} table in `flags.ts` — it
10
- * contains no per-flag branches. It understands the conventions a Unix CLI user
11
- * expects:
12
- *
13
- * - long flags `--name`, with the value either glued on as `--name=value` or
14
- * taken from the following token (`--name value`);
15
- * - short flags `-x`, likewise `-x=value`, `-x value`, or glued `-xvalue` for
16
- * value-taking shorts;
17
- * - clustered short booleans, so `-ip` is `-i -p`, and a value-taking short may
18
- * end a cluster (`-ipm gpt` ⇒ `-i -p -m gpt`);
19
- * - a bare `--` terminator, after which every remaining token is a positional
20
- * even if it looks like a flag;
21
- * - repeatable flags (e.g. `--mcp`) that accumulate into an array.
22
- *
23
- * It is pure: it reads only the `argv` array passed in and never touches
24
- * `process`, the environment, the filesystem, or a TTY. Whether the session is
25
- * actually interactive is *not* probed here — the caller passes that fact in via
26
- * {@link TokenizeOptions.attended} so the function stays deterministic and
27
- * testable.
28
- *
29
- * On a malformed invocation (unknown flag, missing required value, unparseable
30
- * number) it throws an {@link InvocationError}; the launcher catches it at the
31
- * edge and reports it.
32
- */
33
- import { FLAG_SPECS } from "./flags";
34
- import type { FlagValue } from "./flags";
35
- /**
36
- * The runner the launcher should hand off to, derived from the parsed flags:
37
- * - `help` — usage was requested (`--help`);
38
- * - `version` — the version was requested (`--version`);
39
- * - `wire` — the JSON line protocol over stdio (`--json`);
40
- * - `print` — a single-shot answer to stdout (a prompt plus `--print`);
41
- * - `repl` — the interactive loop (the default when unattended decisions
42
- * don't force one of the above).
43
- */
44
- export type RunnerMode = "print" | "wire" | "repl" | "help" | "version";
45
- /**
46
- * The structured result of parsing an `argv` slice.
47
- */
48
- export interface Invocation {
49
- /**
50
- * Recognised flag values, keyed by each spec's canonical `name`. Booleans are
51
- * present as `true`/`false`, strings/numbers as their parsed value, repeatable
52
- * flags as a (possibly empty) `string[]`, and defaulted flags as their seed.
53
- */
54
- readonly flags: Record<string, FlagValue>;
55
- /** Every non-flag token, in order, with the `--` terminator removed. */
56
- readonly positionals: readonly string[];
57
- /**
58
- * The positionals joined into a single free-text prompt, or `undefined` when
59
- * there were none. This is the message the user typed for one-shot/print runs.
60
- */
61
- readonly prompt?: string;
62
- /** The single runner the launcher should dispatch to. */
63
- readonly mode: RunnerMode;
64
- }
65
- /** Knobs the caller supplies that the pure parser cannot discover itself. */
66
- export interface TokenizeOptions {
67
- /**
68
- * Whether the process is attended by an interactive terminal (a TTY on
69
- * stdin/stdout). The caller probes this and passes it in so the parser stays
70
- * free of `process` access. Defaults to `false` (treat as unattended), which
71
- * biases an ambiguous, prompt-less invocation toward a non-interactive run.
72
- */
73
- readonly attended?: boolean;
74
- }
75
- /** Thrown when an `argv` slice cannot be parsed into a valid invocation. */
76
- export declare class InvocationError extends Error {
77
- constructor(message: string);
78
- }
79
- /**
80
- * Parse a raw `argv` slice into a structured {@link Invocation}.
81
- *
82
- * `argv` must already exclude the runtime and script names — pass
83
- * `process.argv.slice(2)` from the launcher. The function performs a single
84
- * left-to-right scan, classifying each token as a long flag, a short
85
- * flag/cluster, the `--` terminator, or a positional.
86
- */
87
- export declare function tokenizeInvocation(argv: readonly string[], options?: TokenizeOptions): Invocation;
88
- /** Re-export the spec table so callers can render help from one import site. */
89
- export { FLAG_SPECS };
@@ -1,71 +0,0 @@
1
- /**
2
- * The single source of naming truth for the whole application.
3
- *
4
- * Every user-visible name the product imprints on the world — the spoken app
5
- * name, the executable users type, the dot-directory it carves under `$HOME`,
6
- * the `INDUSAGI_*` prefix on its environment variables, the basenames of its
7
- * on-disk artifacts — is declared *once*, here. Nothing else in the codebase
8
- * should hard-code any of these strings; everything derives from {@link BRAND}.
9
- *
10
- * The motivation is a clean rebrand: changing the product's identity should be a
11
- * one-file edit, and the {@link Locator} (which computes filesystem locations)
12
- * reads exclusively from this module so the directory layout follows the name
13
- * automatically. Keeping the constants frozen and `readonly` means a stray
14
- * assignment is a type error rather than a silent corruption of identity.
15
- */
16
- /**
17
- * The shape of the brand record. Spelled out as an interface (rather than
18
- * inferred from the literal) so consumers can name the type and so the contract
19
- * is documented field-by-field.
20
- */
21
- export interface Brand {
22
- /** The product's spoken name, used in help banners and prose. */
23
- readonly appName: string;
24
- /** The executable name users invoke on the command line. */
25
- readonly binName: string;
26
- /**
27
- * The prefix stamped on every environment variable the app reads or writes,
28
- * including the trailing underscore (e.g. `"INDUSAGI_"`). Compose a full
29
- * variable name with {@link envName}.
30
- */
31
- readonly envPrefix: string;
32
- /**
33
- * The dot-directory carved directly under the user's home for all per-user
34
- * state (e.g. `".indusagi"`). Leading dot included so it is hidden.
35
- */
36
- readonly profileDirName: string;
37
- /** Basename of the global settings file inside the profile directory. */
38
- readonly settingsFileName: string;
39
- /** Basename of the credential/auth store file inside the profile directory. */
40
- readonly authStoreFileName: string;
41
- /** Subdirectory (under the profile) holding persisted conversation sessions. */
42
- readonly sessionsDirName: string;
43
- /** Subdirectory (under the profile) holding diagnostic and crash logs. */
44
- readonly logsDirName: string;
45
- /**
46
- * Basename of the per-project settings file. Lives in a project's working
47
- * directory (inside {@link projectDirName}), not under the home profile, so a
48
- * repository can carry its own overrides.
49
- */
50
- readonly projectSettingsFileName: string;
51
- /**
52
- * The dot-directory a project keeps in its own root for project-scoped
53
- * settings (e.g. `".indusagi"`). Mirrors {@link profileDirName} but is rooted
54
- * at the working directory rather than `$HOME`.
55
- */
56
- readonly projectDirName: string;
57
- }
58
- /**
59
- * The canonical brand for this build of the product. Frozen so the identity is
60
- * immutable at runtime; `as const` so every field narrows to its literal type.
61
- */
62
- export declare const BRAND: Brand;
63
- /**
64
- * Compose a fully-qualified environment variable name from a bare suffix.
65
- *
66
- * The suffix is upper-cased and any internal whitespace or hyphens are folded to
67
- * underscores, then the brand's {@link Brand.envPrefix} is prepended. So
68
- * `envName("api key")` yields `"INDUSAGI_API_KEY"`. Centralizing this keeps env
69
- * naming consistent and guarantees the prefix is never forgotten.
70
- */
71
- export declare function envName(suffix: string, brand?: Brand): string;
@@ -1,12 +0,0 @@
1
- /**
2
- * The locate module — public surface.
3
- *
4
- * Two halves: {@link BRAND} (the single source of naming truth — app name, bin
5
- * name, env-var prefix, directory names) and {@link Locator} (the one class that
6
- * turns those names plus the home/cwd roots into concrete filesystem paths).
7
- * Downstream code imports everything it needs from here.
8
- */
9
- export { BRAND, envName } from "./brand";
10
- export type { Brand } from "./brand";
11
- export { Locator } from "./locator";
12
- export type { LocatorOverrides } from "./locator";
@@ -1,122 +0,0 @@
1
- /**
2
- * Filesystem location resolution for the application.
3
- *
4
- * This module collapses what would otherwise be a scattered pile of free
5
- * `getProfileDir()` / `getSettingsPath()` / `getSessionsDir()` path helpers into
6
- * a single {@link Locator} class. Every location the app touches — the per-user
7
- * profile directory, the global and per-project settings files, the sessions and
8
- * logs directories, the credential store — is computed by one method, all
9
- * deriving from two roots (the user's home and the current working directory)
10
- * and the {@link BRAND} naming constants.
11
- *
12
- * The constructor takes optional overrides for `home`, `cwd`, and `env`, so a
13
- * test (or an embedder) can sandbox the locator entirely: point `home` at a
14
- * temp directory, hand it a synthetic `env`, and every resolved path lands
15
- * inside the sandbox with no global state involved. With no overrides it falls
16
- * back to {@link os.homedir}, {@link process.cwd}, and {@link process.env}.
17
- *
18
- * The path-returning methods are *pure* — they only join strings and never touch
19
- * disk. The handful of `ensure*` helpers (backed by `fs/promises`) are the only
20
- * members that perform I/O, and they exist purely so callers don't have to
21
- * `mkdir -p` a directory before writing into it.
22
- *
23
- * Environment override:
24
- * - `INDUSAGI_HOME` (i.e. `<envPrefix>HOME`) — when set and non-empty, it
25
- * supersedes the OS home directory as the root of the profile. This lets a
26
- * user relocate all per-user state without touching `$HOME` itself.
27
- */
28
- import { type Brand } from "./brand";
29
- /**
30
- * Optional roots and environment a {@link Locator} resolves against. Anything
31
- * omitted falls back to the live process: `home` → `os.homedir()`, `cwd` →
32
- * `process.cwd()`, `env` → `process.env`.
33
- */
34
- export interface LocatorOverrides {
35
- /** Root for per-user state. Defaults to the OS home directory. */
36
- readonly home?: string;
37
- /** The working directory project paths resolve against. Defaults to `process.cwd()`. */
38
- readonly cwd?: string;
39
- /** The environment table consulted for overrides. Defaults to `process.env`. */
40
- readonly env?: NodeJS.ProcessEnv;
41
- }
42
- /**
43
- * Resolves every filesystem location the application uses from a small set of
44
- * roots plus the {@link BRAND} naming constants.
45
- *
46
- * Construct one per process (or one per sandbox in tests). All path methods are
47
- * pure and cheap; the `ensure*` methods are the only ones that touch disk.
48
- */
49
- export declare class Locator {
50
- private readonly home;
51
- private readonly cwd;
52
- private readonly env;
53
- private readonly brand;
54
- /**
55
- * @param overrides Optional `home`/`cwd`/`env` to sandbox resolution. Each
56
- * field independently falls back to the live process when omitted.
57
- * @param brand The naming source of truth. Defaults to the canonical
58
- * {@link BRAND}; injectable so an alternate identity can be resolved against
59
- * without mutating the global.
60
- */
61
- constructor(overrides?: LocatorOverrides, brand?: Brand);
62
- /**
63
- * Determine the home root, in precedence order:
64
- * 1. an explicit `home` override passed to the constructor;
65
- * 2. the `<envPrefix>HOME` environment variable, if present and non-empty;
66
- * 3. the OS home directory from {@link os.homedir}.
67
- */
68
- private resolveHome;
69
- /** Read an env var through the bound table, treating empty as absent. */
70
- private readEnv;
71
- /**
72
- * The per-user profile directory — the dot-directory under the home root that
73
- * holds all per-user state (e.g. `~/.indusagi`). Every home-rooted path below
74
- * is computed relative to this.
75
- */
76
- profileDir(): string;
77
- /** The global settings file inside the profile (e.g. `~/.indusagi/settings.json`). */
78
- settingsPath(): string;
79
- /**
80
- * The per-project settings file for a given working directory.
81
- *
82
- * Resolves `cwd` against the locator's own working directory (so a relative
83
- * argument is interpreted sensibly), then places the project settings file
84
- * inside that project's dot-directory — e.g. `<project>/.indusagi/settings.json`.
85
- *
86
- * @param cwd The project root to resolve against. Defaults to the locator's
87
- * bound working directory.
88
- */
89
- projectSettingsPath(cwd?: string): string;
90
- /** Directory holding persisted conversation sessions (e.g. `~/.indusagi/sessions`). */
91
- sessionsDir(): string;
92
- /** The credential/auth store file inside the profile (e.g. `~/.indusagi/auth.json`). */
93
- authStorePath(): string;
94
- /** Directory holding diagnostic and crash logs (e.g. `~/.indusagi/logs`). */
95
- logsDir(): string;
96
- /**
97
- * Ensure the profile directory exists, creating it (and any missing parents)
98
- * if absent. Returns the directory path for convenient chaining.
99
- */
100
- ensureProfileDir(): Promise<string>;
101
- /**
102
- * Ensure the sessions directory exists, creating it if absent. Returns the
103
- * directory path.
104
- */
105
- ensureSessionsDir(): Promise<string>;
106
- /**
107
- * Ensure the logs directory exists, creating it if absent. Returns the
108
- * directory path.
109
- */
110
- ensureLogsDir(): Promise<string>;
111
- /**
112
- * Ensure the parent directory of a file path exists, then return the original
113
- * file path. Use before writing a file (settings, auth store) so the write
114
- * never fails on a missing directory.
115
- */
116
- ensureParentOf(filePath: string): Promise<string>;
117
- /**
118
- * Create a directory (and any missing parents) idempotently, returning its
119
- * path. The shared primitive behind every `ensure*` method above.
120
- */
121
- ensureDir(dir: string): Promise<string>;
122
- }