@lotagate/cli 0.1.24 → 0.1.25

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 (607) hide show
  1. package/README.md +70 -3
  2. package/SECURITY.md +2 -0
  3. package/dist/application/agent/agent-history.d.ts +3 -0
  4. package/dist/application/agent/agent-history.js +5 -0
  5. package/dist/application/agent/agent-input-context.d.ts +12 -0
  6. package/dist/application/agent/agent-input-context.js +5 -0
  7. package/dist/application/agent/agent-limit.d.ts +3 -0
  8. package/dist/application/agent/agent-limit.js +1 -0
  9. package/dist/application/agent/agent-run-tracker.d.ts +30 -0
  10. package/dist/application/agent/agent-run-tracker.js +1 -0
  11. package/dist/application/agent/agent-runtime-context.d.ts +22 -0
  12. package/dist/application/agent/agent-runtime-context.js +1 -0
  13. package/dist/application/agent/agent-session-store.d.ts +19 -0
  14. package/dist/application/agent/agent-session-store.js +6 -0
  15. package/dist/application/agent/capability-profile.d.ts +55 -0
  16. package/dist/application/agent/capability-profile.js +1 -0
  17. package/dist/application/agent/cli-agent-execution-service.d.ts +110 -0
  18. package/dist/application/agent/cli-agent-execution-service.js +1 -0
  19. package/dist/application/agent/cli-agent-run-request.d.ts +12 -0
  20. package/dist/application/agent/cli-agent-run-request.js +0 -0
  21. package/dist/application/agent/context-compaction-persistence.d.ts +8 -0
  22. package/dist/application/agent/context-compaction-persistence.js +1 -0
  23. package/dist/application/agent/context-compaction.d.ts +21 -0
  24. package/dist/application/agent/context-compaction.js +7 -0
  25. package/dist/application/agent/interactive-agent-guidance.d.ts +5 -0
  26. package/dist/application/agent/interactive-agent-guidance.js +2 -0
  27. package/dist/application/agent/prompt-data-safety.d.ts +14 -0
  28. package/dist/application/agent/prompt-data-safety.js +4 -0
  29. package/dist/application/agent/scoped-tool-executor.d.ts +13 -0
  30. package/dist/application/agent/scoped-tool-executor.js +1 -0
  31. package/dist/application/agent/tool-catalog.d.ts +14 -0
  32. package/dist/application/agent/tool-catalog.js +1 -0
  33. package/dist/application/agent/tool-display.d.ts +7 -0
  34. package/dist/application/agent/tool-display.js +1 -0
  35. package/dist/application/agent/tool-hook-lifecycle.d.ts +19 -0
  36. package/dist/application/agent/tool-hook-lifecycle.js +1 -0
  37. package/dist/application/auth/authentication-service.d.ts +20 -0
  38. package/dist/application/auth/authentication-service.js +1 -0
  39. package/dist/application/chat/chat-service.d.ts +12 -0
  40. package/dist/application/chat/chat-service.js +1 -0
  41. package/dist/application/chat/pending-attachment-store.d.ts +12 -0
  42. package/dist/application/chat/pending-attachment-store.js +1 -0
  43. package/dist/application/commands/application-command-executor.d.ts +23 -0
  44. package/dist/application/commands/application-command-executor.js +3 -0
  45. package/dist/application/commands/cli-args.d.ts +6 -0
  46. package/dist/application/commands/cli-args.js +1 -0
  47. package/dist/application/commands/cli-command-services.d.ts +17 -0
  48. package/dist/application/commands/cli-command-services.js +33 -0
  49. package/dist/application/commands/command-cancellation.d.ts +6 -0
  50. package/dist/application/commands/command-cancellation.js +1 -0
  51. package/dist/application/commands/command-catalog.d.ts +6 -0
  52. package/dist/application/commands/command-catalog.js +1 -0
  53. package/dist/application/commands/command-contract.d.ts +60 -0
  54. package/dist/application/commands/command-contract.js +0 -0
  55. package/dist/application/commands/command-hints.d.ts +9 -0
  56. package/dist/application/commands/command-hints.js +1 -0
  57. package/dist/application/commands/command-output.d.ts +4 -0
  58. package/dist/application/commands/command-output.js +0 -0
  59. package/dist/application/commands/command-parser.d.ts +10 -0
  60. package/dist/application/commands/command-parser.js +1 -0
  61. package/dist/application/commands/command-presentation.d.ts +7 -0
  62. package/dist/application/commands/command-presentation.js +3 -0
  63. package/dist/application/commands/command-registry.d.ts +11 -0
  64. package/dist/application/commands/command-registry.js +1 -0
  65. package/dist/application/commands/command-runtime.d.ts +2 -0
  66. package/dist/application/commands/command-runtime.js +1 -0
  67. package/dist/application/commands/goal-command-handlers.d.ts +3 -0
  68. package/dist/application/commands/goal-command-handlers.js +7 -0
  69. package/dist/application/commands/media-command-handlers.d.ts +9 -0
  70. package/dist/application/commands/media-command-handlers.js +8 -0
  71. package/dist/application/commands/media-command-output.d.ts +11 -0
  72. package/dist/application/commands/media-command-output.js +1 -0
  73. package/dist/application/commands/memory-command-handler.d.ts +29 -0
  74. package/dist/application/commands/memory-command-handler.js +12 -0
  75. package/dist/application/commands/runtime-command-handlers.d.ts +7 -0
  76. package/dist/application/commands/runtime-command-handlers.js +14 -0
  77. package/dist/application/commands/stream-output.d.ts +4 -0
  78. package/dist/application/commands/stream-output.js +1 -0
  79. package/dist/application/commands/utility-commands.d.ts +6 -0
  80. package/dist/application/commands/utility-commands.js +10 -0
  81. package/dist/application/config/execution-config.d.ts +4 -0
  82. package/dist/application/config/execution-config.js +1 -0
  83. package/dist/application/extensions/extension-list-contract.d.ts +18 -0
  84. package/dist/application/extensions/extension-list-contract.js +0 -0
  85. package/dist/application/extensions/extension-list-formatters.d.ts +38 -0
  86. package/dist/application/extensions/extension-list-formatters.js +1 -0
  87. package/dist/application/extensions/extension-list-output.d.ts +3 -0
  88. package/dist/application/extensions/extension-list-output.js +3 -0
  89. package/dist/application/extensions/plugin-contribution-registry.d.ts +31 -0
  90. package/dist/application/extensions/plugin-contribution-registry.js +1 -0
  91. package/dist/application/extensions/plugin-detail-contract.d.ts +25 -0
  92. package/dist/application/extensions/plugin-detail-contract.js +0 -0
  93. package/dist/application/extensions/plugin-detail-service.d.ts +3 -0
  94. package/dist/application/extensions/plugin-detail-service.js +1 -0
  95. package/dist/application/extensions/skill-scope-store.d.ts +23 -0
  96. package/dist/application/extensions/skill-scope-store.js +1 -0
  97. package/dist/application/formatting/compact-number.d.ts +2 -0
  98. package/dist/application/formatting/compact-number.js +1 -0
  99. package/dist/application/formatting/compact-table.d.ts +22 -0
  100. package/dist/application/formatting/compact-table.js +2 -0
  101. package/dist/application/intent/completion-gate.d.ts +6 -0
  102. package/dist/application/intent/completion-gate.js +1 -0
  103. package/dist/application/intent/evidence-ledger.d.ts +21 -0
  104. package/dist/application/intent/evidence-ledger.js +1 -0
  105. package/dist/application/intent/evidence-recording-tool-executor.d.ts +16 -0
  106. package/dist/application/intent/evidence-recording-tool-executor.js +1 -0
  107. package/dist/application/intent/intent-compiler.d.ts +11 -0
  108. package/dist/application/intent/intent-compiler.js +2 -0
  109. package/dist/application/intent/intent-execution-gate.d.ts +11 -0
  110. package/dist/application/intent/intent-execution-gate.js +1 -0
  111. package/dist/application/intent/intent-host-context.d.ts +6 -0
  112. package/dist/application/intent/intent-host-context.js +1 -0
  113. package/dist/application/intent/intent-run-controller.d.ts +56 -0
  114. package/dist/application/intent/intent-run-controller.js +3 -0
  115. package/dist/application/intent/project-policy.d.ts +16 -0
  116. package/dist/application/intent/project-policy.js +1 -0
  117. package/dist/application/media/video-operation-poller.d.ts +5 -0
  118. package/dist/application/media/video-operation-poller.js +1 -0
  119. package/dist/application/memory/memory-capture-policy.d.ts +10 -0
  120. package/dist/application/memory/memory-capture-policy.js +1 -0
  121. package/dist/application/memory/memory-consolidation-service.d.ts +12 -0
  122. package/dist/application/memory/memory-consolidation-service.js +1 -0
  123. package/dist/application/memory/memory-context-assembler.d.ts +24 -0
  124. package/dist/application/memory/memory-context-assembler.js +1 -0
  125. package/dist/application/memory/memory-extractor.d.ts +21 -0
  126. package/dist/application/memory/memory-extractor.js +2 -0
  127. package/dist/application/memory/memory-service.d.ts +34 -0
  128. package/dist/application/memory/memory-service.js +1 -0
  129. package/dist/application/model/cached-model-catalog.d.ts +13 -0
  130. package/dist/application/model/cached-model-catalog.js +1 -0
  131. package/dist/application/model/initial-model-selection.d.ts +10 -0
  132. package/dist/application/model/initial-model-selection.js +1 -0
  133. package/dist/application/model/model-catalog-service.d.ts +6 -0
  134. package/dist/application/model/model-catalog-service.js +1 -0
  135. package/dist/application/model/model-context-window.d.ts +3 -0
  136. package/dist/application/model/model-context-window.js +1 -0
  137. package/dist/application/model/model-response-retry.d.ts +9 -0
  138. package/dist/application/model/model-response-retry.js +1 -0
  139. package/dist/application/orchestration/abortable-wait.d.ts +2 -0
  140. package/dist/application/orchestration/abortable-wait.js +1 -0
  141. package/dist/application/orchestration/cli-subagent-service.d.ts +73 -0
  142. package/dist/application/orchestration/cli-subagent-service.js +13 -0
  143. package/dist/application/orchestration/cli-turn-event-projector.d.ts +15 -0
  144. package/dist/application/orchestration/cli-turn-event-projector.js +1 -0
  145. package/dist/application/orchestration/cli-turn-events.d.ts +83 -0
  146. package/dist/application/orchestration/cli-turn-events.js +1 -0
  147. package/dist/application/orchestration/cli-turn-persistence.d.ts +6 -0
  148. package/dist/application/orchestration/cli-turn-persistence.js +1 -0
  149. package/dist/application/orchestration/goal-evaluator.d.ts +18 -0
  150. package/dist/application/orchestration/goal-evaluator.js +3 -0
  151. package/dist/application/orchestration/goal-input.d.ts +3 -0
  152. package/dist/application/orchestration/goal-input.js +1 -0
  153. package/dist/application/orchestration/goal-output.d.ts +2 -0
  154. package/dist/application/orchestration/goal-output.js +2 -0
  155. package/dist/application/orchestration/goal-runner.d.ts +22 -0
  156. package/dist/application/orchestration/goal-runner.js +10 -0
  157. package/dist/application/orchestration/goal-usage.d.ts +9 -0
  158. package/dist/application/orchestration/goal-usage.js +1 -0
  159. package/dist/application/orchestration/headless-agent-turn.d.ts +35 -0
  160. package/dist/application/orchestration/headless-agent-turn.js +4 -0
  161. package/dist/application/orchestration/subagent-coordinator.d.ts +41 -0
  162. package/dist/application/orchestration/subagent-coordinator.js +1 -0
  163. package/dist/application/orchestration/subagent-handoff.d.ts +3 -0
  164. package/dist/application/orchestration/subagent-handoff.js +3 -0
  165. package/dist/application/orchestration/subagent-tool-executor.d.ts +12 -0
  166. package/dist/application/orchestration/subagent-tool-executor.js +1 -0
  167. package/dist/application/orchestration/task-graph.d.ts +13 -0
  168. package/dist/application/orchestration/task-graph.js +1 -0
  169. package/dist/application/orchestration/task-scheduler.d.ts +18 -0
  170. package/dist/application/orchestration/task-scheduler.js +1 -0
  171. package/dist/application/project/project-trust-service.d.ts +13 -0
  172. package/dist/application/project/project-trust-service.js +1 -0
  173. package/dist/application/project-intelligence/project-intelligence-service.d.ts +14 -0
  174. package/dist/application/project-intelligence/project-intelligence-service.js +1 -0
  175. package/dist/application/protocol/browser-host-tool-executor.d.ts +41 -0
  176. package/dist/application/protocol/browser-host-tool-executor.js +2 -0
  177. package/dist/application/protocol/computer-host-tool-executor.d.ts +42 -0
  178. package/dist/application/protocol/computer-host-tool-executor.js +2 -0
  179. package/dist/application/protocol/desktop-agent-command.d.ts +9 -0
  180. package/dist/application/protocol/desktop-agent-command.js +3 -0
  181. package/dist/application/protocol/desktop-agent-request-parser.d.ts +186 -0
  182. package/dist/application/protocol/desktop-agent-request-parser.js +1 -0
  183. package/dist/application/protocol/desktop-approval-broker.d.ts +16 -0
  184. package/dist/application/protocol/desktop-approval-broker.js +1 -0
  185. package/dist/application/protocol/desktop-attachment-store.d.ts +16 -0
  186. package/dist/application/protocol/desktop-attachment-store.js +1 -0
  187. package/dist/application/protocol/desktop-command-catalog.d.ts +2 -0
  188. package/dist/application/protocol/desktop-command-catalog.js +1 -0
  189. package/dist/application/protocol/desktop-command-contract.d.ts +26 -0
  190. package/dist/application/protocol/desktop-command-contract.js +1 -0
  191. package/dist/application/protocol/desktop-command-executor.d.ts +17 -0
  192. package/dist/application/protocol/desktop-command-executor.js +1 -0
  193. package/dist/application/protocol/desktop-command-output.d.ts +15 -0
  194. package/dist/application/protocol/desktop-command-output.js +1 -0
  195. package/dist/application/protocol/desktop-execution-policy.d.ts +17 -0
  196. package/dist/application/protocol/desktop-execution-policy.js +1 -0
  197. package/dist/application/protocol/desktop-extension-request-handler.d.ts +14 -0
  198. package/dist/application/protocol/desktop-extension-request-handler.js +1 -0
  199. package/dist/application/protocol/desktop-extension-service.d.ts +44 -0
  200. package/dist/application/protocol/desktop-extension-service.js +3 -0
  201. package/dist/application/protocol/desktop-host-tool-executor.d.ts +63 -0
  202. package/dist/application/protocol/desktop-host-tool-executor.js +2 -0
  203. package/dist/application/protocol/desktop-intent-event-writer.d.ts +20 -0
  204. package/dist/application/protocol/desktop-intent-event-writer.js +1 -0
  205. package/dist/application/protocol/desktop-mcp-events.d.ts +10 -0
  206. package/dist/application/protocol/desktop-mcp-events.js +1 -0
  207. package/dist/application/protocol/desktop-orchestration-events.d.ts +2 -0
  208. package/dist/application/protocol/desktop-orchestration-events.js +2 -0
  209. package/dist/application/protocol/desktop-protocol-helpers.d.ts +13 -0
  210. package/dist/application/protocol/desktop-protocol-helpers.js +1 -0
  211. package/dist/application/protocol/document-host-tool-definitions.d.ts +4 -0
  212. package/dist/application/protocol/document-host-tool-definitions.js +1 -0
  213. package/dist/application/protocol/document-host-tool-executor.d.ts +49 -0
  214. package/dist/application/protocol/document-host-tool-executor.js +2 -0
  215. package/dist/application/protocol/json-line-writer.d.ts +9 -0
  216. package/dist/application/protocol/json-line-writer.js +2 -0
  217. package/dist/application/protocol/jsonl-agent-command.d.ts +3 -0
  218. package/dist/application/protocol/jsonl-agent-command.js +3 -0
  219. package/dist/application/protocol/jsonl-protocol.d.ts +82 -0
  220. package/dist/application/protocol/jsonl-protocol.js +2 -0
  221. package/dist/application/protocol/tool-image-content.d.ts +4 -0
  222. package/dist/application/protocol/tool-image-content.js +1 -0
  223. package/dist/application/security/delegated-worker-policy.d.ts +3 -0
  224. package/dist/application/security/delegated-worker-policy.js +1 -0
  225. package/dist/application/security/desktop-tool-scope-policy.d.ts +4 -0
  226. package/dist/application/security/desktop-tool-scope-policy.js +1 -0
  227. package/dist/application/security/tool-action-risk-analyzer.d.ts +13 -0
  228. package/dist/application/security/tool-action-risk-analyzer.js +1 -0
  229. package/dist/application/security/tool-approval-service.d.ts +37 -0
  230. package/dist/application/security/tool-approval-service.js +1 -0
  231. package/dist/application/security/tool-risk-classifier.d.ts +18 -0
  232. package/dist/application/security/tool-risk-classifier.js +1 -0
  233. package/dist/application/security/workspace-permission-policy.d.ts +10 -0
  234. package/dist/application/security/workspace-permission-policy.js +1 -0
  235. package/dist/application/session/project-session-access.d.ts +8 -0
  236. package/dist/application/session/project-session-access.js +1 -0
  237. package/dist/application/session/session-compaction-service.d.ts +10 -0
  238. package/dist/application/session/session-compaction-service.js +1 -0
  239. package/dist/application/session/session-turn-lifecycle.d.ts +5 -0
  240. package/dist/application/session/session-turn-lifecycle.js +1 -0
  241. package/dist/application/workspace/session-execution-workspace.d.ts +59 -0
  242. package/dist/application/workspace/session-execution-workspace.js +3 -0
  243. package/dist/application/workspace/workspace-file-index.d.ts +15 -0
  244. package/dist/application/workspace/workspace-file-index.js +1 -0
  245. package/dist/application/workspace/workspace-file-reference-resolver.d.ts +20 -0
  246. package/dist/application/workspace/workspace-file-reference-resolver.js +17 -0
  247. package/dist/application/workspace/workspace-instruction-loader.d.ts +8 -0
  248. package/dist/application/workspace/workspace-instruction-loader.js +1 -0
  249. package/dist/bootstrap/composition-root.d.ts +6 -0
  250. package/dist/bootstrap/composition-root.js +1 -0
  251. package/dist/bootstrap/global-cli-options.d.ts +6 -0
  252. package/dist/bootstrap/global-cli-options.js +1 -0
  253. package/dist/bootstrap/native-devtools-stub.d.ts +10 -0
  254. package/dist/bootstrap/native-devtools-stub.js +1 -0
  255. package/dist/bootstrap/native-entry.d.ts +1 -0
  256. package/dist/bootstrap/native-entry.js +2 -0
  257. package/dist/bootstrap/native-tiktoken.d.ts +4 -0
  258. package/dist/bootstrap/native-tiktoken.js +1 -0
  259. package/dist/bootstrap/runtime-factory.d.ts +41 -0
  260. package/dist/bootstrap/runtime-factory.js +1 -0
  261. package/dist/bootstrap/shutdown-manager.d.ts +11 -0
  262. package/dist/bootstrap/shutdown-manager.js +1 -0
  263. package/dist/bootstrap/startup-sequence.d.ts +5 -0
  264. package/dist/bootstrap/startup-sequence.js +1 -0
  265. package/dist/domain/auth/auth-profile.d.ts +14 -0
  266. package/dist/domain/auth/auth-profile.js +1 -0
  267. package/dist/domain/config/config-schema.d.ts +24 -0
  268. package/dist/domain/config/config-schema.js +1 -0
  269. package/dist/domain/errors/cli-command-hint.d.ts +5 -0
  270. package/dist/domain/errors/cli-command-hint.js +0 -0
  271. package/dist/domain/errors/cli-error.d.ts +35 -0
  272. package/dist/domain/errors/cli-error.js +1 -0
  273. package/dist/domain/errors/error-codes.d.ts +51 -0
  274. package/dist/domain/errors/error-codes.js +1 -0
  275. package/dist/domain/extensions/extension-scope.d.ts +3 -0
  276. package/dist/domain/extensions/extension-scope.js +1 -0
  277. package/dist/domain/extensions/extension-state.d.ts +5 -0
  278. package/dist/domain/extensions/extension-state.js +1 -0
  279. package/dist/domain/extensions/hook-manifest.d.ts +13 -0
  280. package/dist/domain/extensions/hook-manifest.js +1 -0
  281. package/dist/domain/extensions/host-tool-plugin-ids.d.ts +9 -0
  282. package/dist/domain/extensions/host-tool-plugin-ids.js +1 -0
  283. package/dist/domain/extensions/mcp-config.d.ts +35 -0
  284. package/dist/domain/extensions/mcp-config.js +1 -0
  285. package/dist/domain/extensions/plugin-agent-manifest.d.ts +8 -0
  286. package/dist/domain/extensions/plugin-agent-manifest.js +1 -0
  287. package/dist/domain/extensions/plugin-manifest.d.ts +23 -0
  288. package/dist/domain/extensions/plugin-manifest.js +1 -0
  289. package/dist/domain/extensions/skill-manifest.d.ts +10 -0
  290. package/dist/domain/extensions/skill-manifest.js +3 -0
  291. package/dist/domain/extensions/yaml-subset.d.ts +9 -0
  292. package/dist/domain/extensions/yaml-subset.js +2 -0
  293. package/dist/domain/filesystem/file-change-diff.d.ts +21 -0
  294. package/dist/domain/filesystem/file-change-diff.js +3 -0
  295. package/dist/domain/intent/intent-contract.d.ts +41 -0
  296. package/dist/domain/intent/intent-contract.js +1 -0
  297. package/dist/domain/media/gateway-media-contract.d.ts +23 -0
  298. package/dist/domain/media/gateway-media-contract.js +1 -0
  299. package/dist/domain/media/media-contract.d.ts +28 -0
  300. package/dist/domain/media/media-contract.js +0 -0
  301. package/dist/domain/media/media-execution-policy.d.ts +9 -0
  302. package/dist/domain/media/media-execution-policy.js +1 -0
  303. package/dist/domain/memory/memory-kinds.d.ts +15 -0
  304. package/dist/domain/memory/memory-kinds.js +1 -0
  305. package/dist/domain/memory/memory-retrieval-policy.d.ts +3 -0
  306. package/dist/domain/memory/memory-retrieval-policy.js +1 -0
  307. package/dist/domain/memory/memory-search.d.ts +33 -0
  308. package/dist/domain/memory/memory-search.js +2 -0
  309. package/dist/domain/memory/memory.d.ts +48 -0
  310. package/dist/domain/memory/memory.js +1 -0
  311. package/dist/domain/orchestration/goal.d.ts +58 -0
  312. package/dist/domain/orchestration/goal.js +1 -0
  313. package/dist/domain/orchestration/subagent-identity.d.ts +2 -0
  314. package/dist/domain/orchestration/subagent-identity.js +1 -0
  315. package/dist/domain/orchestration/subagent.d.ts +33 -0
  316. package/dist/domain/orchestration/subagent.js +0 -0
  317. package/dist/domain/orchestration/work-plan.d.ts +77 -0
  318. package/dist/domain/orchestration/work-plan.js +1 -0
  319. package/dist/domain/project/project-identity.d.ts +6 -0
  320. package/dist/domain/project/project-identity.js +1 -0
  321. package/dist/domain/runtime/assistant-delta-normalizer.d.ts +11 -0
  322. package/dist/domain/runtime/assistant-delta-normalizer.js +1 -0
  323. package/dist/domain/runtime/resource-limits.d.ts +75 -0
  324. package/dist/domain/runtime/resource-limits.js +1 -0
  325. package/dist/domain/session/attachment.d.ts +13 -0
  326. package/dist/domain/session/attachment.js +0 -0
  327. package/dist/domain/session/session-schema.d.ts +6 -0
  328. package/dist/domain/session/session-schema.js +1 -0
  329. package/dist/domain/session/session.d.ts +27 -0
  330. package/dist/domain/session/session.js +0 -0
  331. package/dist/domain/settings/settings-document.d.ts +8 -0
  332. package/dist/domain/settings/settings-document.js +1 -0
  333. package/dist/domain/validation/record-schema.d.ts +4 -0
  334. package/dist/domain/validation/record-schema.js +1 -0
  335. package/dist/domain/workspace/workspace-settings.d.ts +12 -0
  336. package/dist/domain/workspace/workspace-settings.js +1 -0
  337. package/dist/infrastructure/agent-sdk/agent-instance-factory.d.ts +22 -0
  338. package/dist/infrastructure/agent-sdk/agent-instance-factory.js +1 -0
  339. package/dist/infrastructure/agent-sdk/model-tool-name-mapper.d.ts +13 -0
  340. package/dist/infrastructure/agent-sdk/model-tool-name-mapper.js +1 -0
  341. package/dist/infrastructure/agent-sdk/tool-calling-completion-client.d.ts +4 -0
  342. package/dist/infrastructure/agent-sdk/tool-calling-completion-client.js +1 -0
  343. package/dist/infrastructure/agent-sdk/tool-calling-model-client.d.ts +11 -0
  344. package/dist/infrastructure/agent-sdk/tool-calling-model-client.js +1 -0
  345. package/dist/infrastructure/cache/cache-policy.d.ts +7 -0
  346. package/dist/infrastructure/cache/cache-policy.js +1 -0
  347. package/dist/infrastructure/cache/file-cache-store.d.ts +17 -0
  348. package/dist/infrastructure/cache/file-cache-store.js +2 -0
  349. package/dist/infrastructure/clipboard/clipboard-adapter-factory.d.ts +11 -0
  350. package/dist/infrastructure/clipboard/clipboard-adapter-factory.js +1 -0
  351. package/dist/infrastructure/clipboard/clipboard-policy.d.ts +8 -0
  352. package/dist/infrastructure/clipboard/clipboard-policy.js +1 -0
  353. package/dist/infrastructure/clipboard/clipboard-text-adapter-factory.d.ts +10 -0
  354. package/dist/infrastructure/clipboard/clipboard-text-adapter-factory.js +1 -0
  355. package/dist/infrastructure/clipboard/image-normalizer.d.ts +12 -0
  356. package/dist/infrastructure/clipboard/image-normalizer.js +1 -0
  357. package/dist/infrastructure/clipboard/windows-clipboard-adapter.d.ts +7 -0
  358. package/dist/infrastructure/clipboard/windows-clipboard-adapter.js +1 -0
  359. package/dist/infrastructure/clipboard/windows-clipboard-text-adapter.d.ts +7 -0
  360. package/dist/infrastructure/clipboard/windows-clipboard-text-adapter.js +1 -0
  361. package/dist/infrastructure/config/config-loader.d.ts +19 -0
  362. package/dist/infrastructure/config/config-loader.js +2 -0
  363. package/dist/infrastructure/config/environment-values.d.ts +2 -0
  364. package/dist/infrastructure/config/environment-values.js +1 -0
  365. package/dist/infrastructure/credentials/composite-credential-store.d.ts +11 -0
  366. package/dist/infrastructure/credentials/composite-credential-store.js +1 -0
  367. package/dist/infrastructure/credentials/encrypted-file-credential-store.d.ts +17 -0
  368. package/dist/infrastructure/credentials/encrypted-file-credential-store.js +3 -0
  369. package/dist/infrastructure/credentials/environment-credential-store.d.ts +11 -0
  370. package/dist/infrastructure/credentials/environment-credential-store.js +1 -0
  371. package/dist/infrastructure/credentials/secret-input.d.ts +7 -0
  372. package/dist/infrastructure/credentials/secret-input.js +3 -0
  373. package/dist/infrastructure/extensions/composite-mcp-config-store.d.ts +9 -0
  374. package/dist/infrastructure/extensions/composite-mcp-config-store.js +1 -0
  375. package/dist/infrastructure/extensions/extension-directory-reader.d.ts +2 -0
  376. package/dist/infrastructure/extensions/extension-directory-reader.js +1 -0
  377. package/dist/infrastructure/extensions/extension-integrity.d.ts +7 -0
  378. package/dist/infrastructure/extensions/extension-integrity.js +1 -0
  379. package/dist/infrastructure/extensions/extension-source-resolver.d.ts +6 -0
  380. package/dist/infrastructure/extensions/extension-source-resolver.js +1 -0
  381. package/dist/infrastructure/extensions/file-mcp-config-store.d.ts +15 -0
  382. package/dist/infrastructure/extensions/file-mcp-config-store.js +2 -0
  383. package/dist/infrastructure/extensions/hook-runtime.d.ts +18 -0
  384. package/dist/infrastructure/extensions/hook-runtime.js +1 -0
  385. package/dist/infrastructure/extensions/mcp-runtime.d.ts +51 -0
  386. package/dist/infrastructure/extensions/mcp-runtime.js +1 -0
  387. package/dist/infrastructure/extensions/plugin-agent-discovery.d.ts +4 -0
  388. package/dist/infrastructure/extensions/plugin-agent-discovery.js +1 -0
  389. package/dist/infrastructure/extensions/plugin-discovery.d.ts +5 -0
  390. package/dist/infrastructure/extensions/plugin-discovery.js +1 -0
  391. package/dist/infrastructure/extensions/plugin-manager.d.ts +23 -0
  392. package/dist/infrastructure/extensions/plugin-manager.js +2 -0
  393. package/dist/infrastructure/extensions/skill-discovery.d.ts +4 -0
  394. package/dist/infrastructure/extensions/skill-discovery.js +1 -0
  395. package/dist/infrastructure/extensions/skill-installer.d.ts +9 -0
  396. package/dist/infrastructure/extensions/skill-installer.js +1 -0
  397. package/dist/infrastructure/extensions/skill-manager.d.ts +22 -0
  398. package/dist/infrastructure/extensions/skill-manager.js +2 -0
  399. package/dist/infrastructure/extensions/skill-roots.d.ts +19 -0
  400. package/dist/infrastructure/extensions/skill-roots.js +1 -0
  401. package/dist/infrastructure/extensions/skill-tool-executor.d.ts +18 -0
  402. package/dist/infrastructure/extensions/skill-tool-executor.js +2 -0
  403. package/dist/infrastructure/filesystem/atomic-file-store.d.ts +17 -0
  404. package/dist/infrastructure/filesystem/atomic-file-store.js +1 -0
  405. package/dist/infrastructure/filesystem/bounded-file-reader.d.ts +6 -0
  406. package/dist/infrastructure/filesystem/bounded-file-reader.js +1 -0
  407. package/dist/infrastructure/filesystem/bounded-json-reader.d.ts +1 -0
  408. package/dist/infrastructure/filesystem/bounded-json-reader.js +1 -0
  409. package/dist/infrastructure/filesystem/fs-errors.d.ts +2 -0
  410. package/dist/infrastructure/filesystem/fs-errors.js +1 -0
  411. package/dist/infrastructure/filesystem/gateway-media-input-reader.d.ts +12 -0
  412. package/dist/infrastructure/filesystem/gateway-media-input-reader.js +1 -0
  413. package/dist/infrastructure/filesystem/local-filesystem-tool-executor.d.ts +22 -0
  414. package/dist/infrastructure/filesystem/local-filesystem-tool-executor.js +3 -0
  415. package/dist/infrastructure/filesystem/path-resolver.d.ts +20 -0
  416. package/dist/infrastructure/filesystem/path-resolver.js +1 -0
  417. package/dist/infrastructure/filesystem/workspace-media-artifact-store.d.ts +13 -0
  418. package/dist/infrastructure/filesystem/workspace-media-artifact-store.js +1 -0
  419. package/dist/infrastructure/logging/daily-rotating-file-writer.d.ts +26 -0
  420. package/dist/infrastructure/logging/daily-rotating-file-writer.js +2 -0
  421. package/dist/infrastructure/logging/log-redactor.d.ts +2 -0
  422. package/dist/infrastructure/logging/log-redactor.js +1 -0
  423. package/dist/infrastructure/logging/logging-policy.d.ts +6 -0
  424. package/dist/infrastructure/logging/logging-policy.js +1 -0
  425. package/dist/infrastructure/logging/structured-logger.d.ts +24 -0
  426. package/dist/infrastructure/logging/structured-logger.js +4 -0
  427. package/dist/infrastructure/memory/file-memory-store.d.ts +37 -0
  428. package/dist/infrastructure/memory/file-memory-store.js +11 -0
  429. package/dist/infrastructure/network/safe-media-downloader.d.ts +23 -0
  430. package/dist/infrastructure/network/safe-media-downloader.js +1 -0
  431. package/dist/infrastructure/platform/host-platform.d.ts +14 -0
  432. package/dist/infrastructure/platform/host-platform.js +1 -0
  433. package/dist/infrastructure/platform/host-process.d.ts +29 -0
  434. package/dist/infrastructure/platform/host-process.js +1 -0
  435. package/dist/infrastructure/platform/platform-paths.d.ts +25 -0
  436. package/dist/infrastructure/platform/platform-paths.js +1 -0
  437. package/dist/infrastructure/platform/process-termination.d.ts +4 -0
  438. package/dist/infrastructure/platform/process-termination.js +1 -0
  439. package/dist/infrastructure/platform/read-only-executable.d.ts +3 -0
  440. package/dist/infrastructure/platform/read-only-executable.js +1 -0
  441. package/dist/infrastructure/project/file-project-trust-store.d.ts +12 -0
  442. package/dist/infrastructure/project/file-project-trust-store.js +2 -0
  443. package/dist/infrastructure/sdk/chat-completion-adapter.d.ts +8 -0
  444. package/dist/infrastructure/sdk/chat-completion-adapter.js +1 -0
  445. package/dist/infrastructure/sdk/lotagate-client-factory.d.ts +3 -0
  446. package/dist/infrastructure/sdk/lotagate-client-factory.js +1 -0
  447. package/dist/infrastructure/sdk/model-catalog-adapter.d.ts +19 -0
  448. package/dist/infrastructure/sdk/model-catalog-adapter.js +1 -0
  449. package/dist/infrastructure/sdk/sdk-media-gateway-client.d.ts +20 -0
  450. package/dist/infrastructure/sdk/sdk-media-gateway-client.js +1 -0
  451. package/dist/infrastructure/sessions/file-goal-store.d.ts +21 -0
  452. package/dist/infrastructure/sessions/file-goal-store.js +1 -0
  453. package/dist/infrastructure/sessions/file-session-store.d.ts +47 -0
  454. package/dist/infrastructure/sessions/file-session-store.js +4 -0
  455. package/dist/infrastructure/sessions/project-session-paths.d.ts +17 -0
  456. package/dist/infrastructure/sessions/project-session-paths.js +1 -0
  457. package/dist/infrastructure/sessions/session-index.d.ts +16 -0
  458. package/dist/infrastructure/sessions/session-index.js +3 -0
  459. package/dist/infrastructure/sessions/session-journal.d.ts +22 -0
  460. package/dist/infrastructure/sessions/session-journal.js +6 -0
  461. package/dist/infrastructure/sessions/subagent-journal-store.d.ts +28 -0
  462. package/dist/infrastructure/sessions/subagent-journal-store.js +2 -0
  463. package/dist/infrastructure/shell/shell-tool-executor.d.ts +17 -0
  464. package/dist/infrastructure/shell/shell-tool-executor.js +2 -0
  465. package/dist/infrastructure/tokens/tiktoken-token-estimator.d.ts +18 -0
  466. package/dist/infrastructure/tokens/tiktoken-token-estimator.js +1 -0
  467. package/dist/infrastructure/workspace/workspace-settings-store.d.ts +9 -0
  468. package/dist/infrastructure/workspace/workspace-settings-store.js +4 -0
  469. package/dist/main.d.ts +7 -0
  470. package/dist/main.js +3 -0
  471. package/dist/ports/cache-store.d.ts +10 -0
  472. package/dist/ports/cache-store.js +0 -0
  473. package/dist/ports/chat-model.d.ts +30 -0
  474. package/dist/ports/chat-model.js +0 -0
  475. package/dist/ports/clipboard-adapter.d.ts +7 -0
  476. package/dist/ports/clipboard-adapter.js +0 -0
  477. package/dist/ports/clipboard-text-adapter.d.ts +3 -0
  478. package/dist/ports/clipboard-text-adapter.js +0 -0
  479. package/dist/ports/credential-store.d.ts +7 -0
  480. package/dist/ports/credential-store.js +0 -0
  481. package/dist/ports/goal-store.d.ts +12 -0
  482. package/dist/ports/goal-store.js +0 -0
  483. package/dist/ports/logger.d.ts +8 -0
  484. package/dist/ports/logger.js +0 -0
  485. package/dist/ports/media-gateway-client.d.ts +54 -0
  486. package/dist/ports/media-gateway-client.js +0 -0
  487. package/dist/ports/memory-store.d.ts +26 -0
  488. package/dist/ports/memory-store.js +0 -0
  489. package/dist/ports/model-completion-client.d.ts +8 -0
  490. package/dist/ports/model-completion-client.js +0 -0
  491. package/dist/ports/model-diagnostics.d.ts +17 -0
  492. package/dist/ports/model-diagnostics.js +0 -0
  493. package/dist/ports/project-trust-store.d.ts +12 -0
  494. package/dist/ports/project-trust-store.js +0 -0
  495. package/dist/ports/session-store.d.ts +58 -0
  496. package/dist/ports/session-store.js +0 -0
  497. package/dist/ports/subagent-lifecycle.d.ts +31 -0
  498. package/dist/ports/subagent-lifecycle.js +0 -0
  499. package/dist/ports/tool-activity.d.ts +13 -0
  500. package/dist/ports/tool-activity.js +0 -0
  501. package/dist/presentation/themes/theme.d.ts +19 -0
  502. package/dist/presentation/themes/theme.js +1 -0
  503. package/dist/presentation/tui/agent-initialization-renderer.d.ts +4 -0
  504. package/dist/presentation/tui/agent-initialization-renderer.js +1 -0
  505. package/dist/presentation/tui/context-display.d.ts +21 -0
  506. package/dist/presentation/tui/context-display.js +2 -0
  507. package/dist/presentation/tui/formatters.d.ts +6 -0
  508. package/dist/presentation/tui/formatters.js +1 -0
  509. package/dist/presentation/tui/ink/choice-window.d.ts +5 -0
  510. package/dist/presentation/tui/ink/choice-window.js +1 -0
  511. package/dist/presentation/tui/ink/components/activity-animation.d.ts +3 -0
  512. package/dist/presentation/tui/ink/components/activity-animation.js +1 -0
  513. package/dist/presentation/tui/ink/components/activity-entry.d.ts +6 -0
  514. package/dist/presentation/tui/ink/components/activity-entry.js +1 -0
  515. package/dist/presentation/tui/ink/components/activity-status.d.ts +10 -0
  516. package/dist/presentation/tui/ink/components/activity-status.js +1 -0
  517. package/dist/presentation/tui/ink/components/choice-modal.d.ts +11 -0
  518. package/dist/presentation/tui/ink/components/choice-modal.js +1 -0
  519. package/dist/presentation/tui/ink/components/composer.d.ts +40 -0
  520. package/dist/presentation/tui/ink/components/composer.js +8 -0
  521. package/dist/presentation/tui/ink/components/file-diff.d.ts +6 -0
  522. package/dist/presentation/tui/ink/components/file-diff.js +1 -0
  523. package/dist/presentation/tui/ink/components/modal.d.ts +8 -0
  524. package/dist/presentation/tui/ink/components/modal.js +2 -0
  525. package/dist/presentation/tui/ink/components/shimmer-text.d.ts +8 -0
  526. package/dist/presentation/tui/ink/components/shimmer-text.js +1 -0
  527. package/dist/presentation/tui/ink/components/subagent-activity.d.ts +11 -0
  528. package/dist/presentation/tui/ink/components/subagent-activity.js +1 -0
  529. package/dist/presentation/tui/ink/components/transcript.d.ts +39 -0
  530. package/dist/presentation/tui/ink/components/transcript.js +5 -0
  531. package/dist/presentation/tui/ink/components/welcome-panel.d.ts +6 -0
  532. package/dist/presentation/tui/ink/components/welcome-panel.js +1 -0
  533. package/dist/presentation/tui/ink/lotagate-tui.d.ts +6 -0
  534. package/dist/presentation/tui/ink/lotagate-tui.js +2 -0
  535. package/dist/presentation/tui/ink/markdown-inline-renderer.d.ts +4 -0
  536. package/dist/presentation/tui/ink/markdown-inline-renderer.js +1 -0
  537. package/dist/presentation/tui/ink/markdown-inline.d.ts +13 -0
  538. package/dist/presentation/tui/ink/markdown-inline.js +1 -0
  539. package/dist/presentation/tui/ink/markdown-message.d.ts +6 -0
  540. package/dist/presentation/tui/ink/markdown-message.js +2 -0
  541. package/dist/presentation/tui/ink/markdown-table.d.ts +16 -0
  542. package/dist/presentation/tui/ink/markdown-table.js +1 -0
  543. package/dist/presentation/tui/ink/tui-bridge.d.ts +193 -0
  544. package/dist/presentation/tui/ink/tui-bridge.js +1 -0
  545. package/dist/presentation/tui/terminal-capabilities.d.ts +15 -0
  546. package/dist/presentation/tui/terminal-capabilities.js +1 -0
  547. package/dist/presentation/tui/terminal-mouse.d.ts +5 -0
  548. package/dist/presentation/tui/terminal-mouse.js +1 -0
  549. package/dist/presentation/tui/terminal-screen.d.ts +10 -0
  550. package/dist/presentation/tui/terminal-screen.js +1 -0
  551. package/dist/presentation/tui/tui-agent-event-runner.d.ts +29 -0
  552. package/dist/presentation/tui/tui-agent-event-runner.js +1 -0
  553. package/dist/presentation/tui/tui-application-contract.d.ts +10 -0
  554. package/dist/presentation/tui/tui-application-contract.js +1 -0
  555. package/dist/presentation/tui/tui-application.d.ts +64 -0
  556. package/dist/presentation/tui/tui-application.js +3 -0
  557. package/dist/presentation/tui/tui-clipboard-paste-handlers.d.ts +11 -0
  558. package/dist/presentation/tui/tui-clipboard-paste-handlers.js +1 -0
  559. package/dist/presentation/tui/tui-command-context.d.ts +3 -0
  560. package/dist/presentation/tui/tui-command-context.js +0 -0
  561. package/dist/presentation/tui/tui-command-executor.d.ts +38 -0
  562. package/dist/presentation/tui/tui-command-executor.js +4 -0
  563. package/dist/presentation/tui/tui-command-host-factory.d.ts +40 -0
  564. package/dist/presentation/tui/tui-command-host-factory.js +1 -0
  565. package/dist/presentation/tui/tui-context-compaction.d.ts +5 -0
  566. package/dist/presentation/tui/tui-context-compaction.js +1 -0
  567. package/dist/presentation/tui/tui-context-service.d.ts +34 -0
  568. package/dist/presentation/tui/tui-context-service.js +2 -0
  569. package/dist/presentation/tui/tui-extension-loader.d.ts +21 -0
  570. package/dist/presentation/tui/tui-extension-loader.js +1 -0
  571. package/dist/presentation/tui/tui-file-suggestions.d.ts +3 -0
  572. package/dist/presentation/tui/tui-file-suggestions.js +1 -0
  573. package/dist/presentation/tui/tui-goal-controller.d.ts +14 -0
  574. package/dist/presentation/tui/tui-goal-controller.js +1 -0
  575. package/dist/presentation/tui/tui-initial-model.d.ts +3 -0
  576. package/dist/presentation/tui/tui-initial-model.js +1 -0
  577. package/dist/presentation/tui/tui-lifecycle-actions.d.ts +13 -0
  578. package/dist/presentation/tui/tui-lifecycle-actions.js +1 -0
  579. package/dist/presentation/tui/tui-manual-compaction.d.ts +18 -0
  580. package/dist/presentation/tui/tui-manual-compaction.js +1 -0
  581. package/dist/presentation/tui/tui-media-model-selection.d.ts +12 -0
  582. package/dist/presentation/tui/tui-media-model-selection.js +1 -0
  583. package/dist/presentation/tui/tui-prompt-dispatcher.d.ts +16 -0
  584. package/dist/presentation/tui/tui-prompt-dispatcher.js +1 -0
  585. package/dist/presentation/tui/tui-skill-controller.d.ts +11 -0
  586. package/dist/presentation/tui/tui-skill-controller.js +3 -0
  587. package/dist/presentation/tui/tui-tool-approval.d.ts +22 -0
  588. package/dist/presentation/tui/tui-tool-approval.js +1 -0
  589. package/dist/version.d.ts +1 -0
  590. package/dist/version.js +1 -0
  591. package/package.json +12 -10
  592. package/skills/architecture-review/SKILL.md +41 -14
  593. package/skills/code-review/SKILL.md +41 -12
  594. package/skills/debugging/SKILL.md +49 -12
  595. package/skills/documentation/SKILL.md +43 -9
  596. package/skills/feature-implementation/SKILL.md +58 -19
  597. package/skills/api-contract-review/SKILL.md +0 -17
  598. package/skills/database-review/SKILL.md +0 -17
  599. package/skills/dependency-review/SKILL.md +0 -16
  600. package/skills/frontend-review/SKILL.md +0 -18
  601. package/skills/incident-response/SKILL.md +0 -18
  602. package/skills/performance-review/SKILL.md +0 -17
  603. package/skills/refactor/SKILL.md +0 -23
  604. package/skills/release-readiness/SKILL.md +0 -16
  605. package/skills/security-review/SKILL.md +0 -16
  606. package/skills/test-plan/SKILL.md +0 -22
  607. package/skills/verify/SKILL.md +0 -13
@@ -0,0 +1,5 @@
1
+ export interface StartupContext {
2
+ cwd: string;
3
+ isInteractive: boolean;
4
+ }
5
+ export declare function resolveStartupContext(argv: readonly string[], processCwd?: string): StartupContext;
@@ -0,0 +1 @@
1
+ import r from"node:path";import{parseGlobalCliOptions as e}from"./global-cli-options.js";function n(t,o=process.cwd()){const s=e(t);return{cwd:r.resolve(s.cwd??o),isInteractive:process.stdin.isTTY===!0&&process.stdout.isTTY===!0}}export{n as resolveStartupContext};
@@ -0,0 +1,14 @@
1
+ export interface AuthProfile {
2
+ name: string;
3
+ baseUrl: string;
4
+ credentialRef: string;
5
+ createdAt: string;
6
+ updatedAt: string;
7
+ }
8
+ export interface StoredCredential {
9
+ profile: AuthProfile;
10
+ apiKey: string;
11
+ }
12
+ export declare function validateProfileName(name: string): string;
13
+ export declare function validateBaseUrl(value: string): string;
14
+ export declare function validateApiKey(apiKey: string): string;
@@ -0,0 +1 @@
1
+ import{CliError as t}from"../errors/cli-error.js";import{CLI_ERROR_CODES as a}from"../errors/error-codes.js";const s=/^[a-z][a-z0-9_-]{0,31}$/;function l(r){const e=r.trim().toLowerCase();if(!s.test(e))throw new t(a.AUTH_PROFILE_NOT_FOUND,`Invalid profile name: ${r}`,{category:"auth",userMessage:"Profile names may contain lowercase letters, digits, hyphens, or underscores; maximum 32 characters."});return e}function c(r){let e;try{e=new URL(r)}catch(o){throw new t(a.AUTH_BASE_URL_INVALID,"Base URL is invalid.",{category:"auth",userMessage:"Invalid base URL.",cause:o})}if(e.protocol!=="http:"&&e.protocol!=="https:")throw new t(a.AUTH_BASE_URL_INVALID,"Base URL must use HTTP or HTTPS.",{category:"auth",userMessage:"Base URL must use HTTP or HTTPS."});return r.replace(/\/+$/,"")}function u(r){const e=r.trim();if(e.length<8||e.length>4096||/[\r\n]/.test(e))throw new t(a.AUTH_API_KEY_INVALID,"API key has an invalid shape.",{category:"auth",userMessage:"API key is invalid or contains a newline."});return e}export{u as validateApiKey,c as validateBaseUrl,l as validateProfileName};
@@ -0,0 +1,24 @@
1
+ export declare const REASONING_EFFORTS: readonly ["low", "medium", "high"];
2
+ export type ReasoningEffort = typeof REASONING_EFFORTS[number];
3
+ export declare const DEFAULT_REASONING_EFFORT: ReasoningEffort;
4
+ export declare const CONFIG_SCHEMA_VERSION = 1;
5
+ export interface CliConfig {
6
+ schemaVersion: 1;
7
+ baseUrl: string;
8
+ model: string | null;
9
+ effort: ReasoningEffort;
10
+ profile: string | null;
11
+ theme: 'dark' | 'light' | 'auto';
12
+ approvalMode: 'ask' | 'auto' | 'deny';
13
+ sandboxMode: 'workspace' | 'disabled';
14
+ telemetry: 'off' | 'opt-in';
15
+ updateChannel: 'stable' | 'preview';
16
+ memoryContext: 'enabled' | 'disabled';
17
+ memorySemanticSearch: 'enabled' | 'disabled';
18
+ memoryEmbeddingModel: string | null;
19
+ }
20
+ export type ConfigurableKey = Exclude<keyof CliConfig, 'schemaVersion'>;
21
+ export declare const CONFIGURABLE_KEYS: readonly ConfigurableKey[];
22
+ export declare const DEFAULT_CONFIG: CliConfig;
23
+ export declare function validateConfig(value: unknown): Partial<CliConfig>;
24
+ export declare function mergeConfig(...layers: readonly Partial<CliConfig>[]): CliConfig;
@@ -0,0 +1 @@
1
+ import{CliError as d}from"../errors/cli-error.js";import{CLI_ERROR_CODES as i}from"../errors/error-codes.js";import{findUnexpectedRecordKey as M,isRecord as S}from"../validation/record-schema.js";const E=["low","medium","high"],N="medium",a=1,_=["baseUrl","model","effort","profile","theme","approvalMode","sandboxMode","telemetry","updateChannel","memoryContext","memorySemanticSearch","memoryEmbeddingModel"],x=["schemaVersion",..._],O={schemaVersion:a,baseUrl:"https://api.lotagate.com",model:null,effort:N,profile:null,theme:"dark",approvalMode:"ask",sandboxMode:"workspace",telemetry:"off",updateChannel:"stable",memoryContext:"enabled",memorySemanticSearch:"disabled",memoryEmbeddingModel:null};function f(e,n){if(typeof e!="string"||e.trim().length===0)throw new d(i.CONFIG_SCHEMA_INVALID,`Invalid config field: ${n}`,{category:"config",userMessage:`Invalid configuration: field \`${n}\` must be a non-empty string.`})}function w(e){if(!S(e))throw new d(i.CONFIG_SCHEMA_INVALID,"Config must be a JSON object.",{category:"config",userMessage:"Configuration file must contain a JSON object."});const n=M(e,x);if(n!==void 0)throw b(`Unsupported configuration field: \`${n}\`.`);if(e.schemaVersion!==void 0&&e.schemaVersion!==a)throw new d(i.CONFIG_SCHEMA_INVALID,"Unsupported config schema version.",{category:"config",userMessage:`Unsupported configuration schema version: ${String(e.schemaVersion)}.`});const o=e.baseUrl;if(o!==void 0){f(o,"baseUrl");try{new URL(o)}catch(I){throw new d(i.CONFIG_SCHEMA_INVALID,"baseUrl must be a valid URL.",{category:"config",userMessage:"baseUrl must be a valid URL.",cause:I})}}const t=e.model,c=r(e.effort,"effort",E),s=e.profile;if(t!=null&&f(t,"model"),s!=null&&f(s,"profile"),typeof t=="string"&&t.length>256)throw new d(i.CONFIG_SCHEMA_INVALID,"Model id is too long.",{category:"config",userMessage:"Model id must not exceed 256 characters."});const l=r(e.theme,"theme",["dark","light","auto"]),u=r(e.approvalMode,"approvalMode",["ask","auto","deny"]),p=r(e.sandboxMode,"sandboxMode",["workspace","disabled"]),g=r(e.telemetry,"telemetry",["off","opt-in"]),h=r(e.updateChannel,"updateChannel",["stable","preview"]),y=r(e.memoryContext,"memoryContext",["enabled","disabled"]),C=r(e.memorySemanticSearch,"memorySemanticSearch",["enabled","disabled"]),m=e.memoryEmbeddingModel;return m!=null&&f(m,"memoryEmbeddingModel"),{...e.schemaVersion===void 0?{}:{schemaVersion:a},...o===void 0?{}:{baseUrl:o},...t===void 0?{}:{model:t},...c===void 0?{}:{effort:c},...s===void 0?{}:{profile:s},...l===void 0?{}:{theme:l},...u===void 0?{}:{approvalMode:u},...p===void 0?{}:{sandboxMode:p},...g===void 0?{}:{telemetry:g},...h===void 0?{}:{updateChannel:h},...y===void 0?{}:{memoryContext:y},...C===void 0?{}:{memorySemanticSearch:C},...m===void 0?{}:{memoryEmbeddingModel:m}}}function F(...e){const n=e.reduce((o,t)=>({...o,...t}),{});return{...O,...w(n),schemaVersion:a}}function r(e,n,o){if(e!==void 0){if(typeof e!="string"||!o.includes(e))throw b(`Invalid configuration: value for \`${n}\` is not supported.`);return e}}function b(e){return new d(i.CONFIG_SCHEMA_INVALID,e,{category:"config",userMessage:e})}export{_ as CONFIGURABLE_KEYS,a as CONFIG_SCHEMA_VERSION,O as DEFAULT_CONFIG,N as DEFAULT_REASONING_EFFORT,E as REASONING_EFFORTS,F as mergeConfig,w as validateConfig};
@@ -0,0 +1,5 @@
1
+ export interface CliCommandHint {
2
+ /** Runtime command action identifiers, resolved by the shared command catalog. */
3
+ readonly actionId: string;
4
+ readonly tuiActionId?: string;
5
+ }
File without changes
@@ -0,0 +1,35 @@
1
+ import type { CliErrorCode } from './error-codes.js';
2
+ import type { CliCommandHint } from './cli-command-hint.js';
3
+ export interface CliErrorOptions {
4
+ category: string;
5
+ userMessage?: string;
6
+ retryable?: boolean;
7
+ exitCode?: number;
8
+ correlationId?: string;
9
+ details?: Record<string, unknown>;
10
+ hint?: CliCommandHint;
11
+ cause?: unknown;
12
+ }
13
+ export interface CliErrorShape {
14
+ code: CliErrorCode | string;
15
+ category: string;
16
+ message: string;
17
+ userMessage: string;
18
+ retryable: boolean;
19
+ exitCode: number;
20
+ correlationId?: string;
21
+ details?: Record<string, unknown>;
22
+ }
23
+ export declare class CliError extends Error {
24
+ readonly code: CliErrorCode | string;
25
+ readonly category: string;
26
+ readonly userMessage: string;
27
+ readonly retryable: boolean;
28
+ readonly exitCode: number;
29
+ readonly correlationId: string | undefined;
30
+ readonly details: Record<string, unknown> | undefined;
31
+ readonly hint: CliCommandHint | undefined;
32
+ constructor(code: CliErrorCode | string, message: string, options: CliErrorOptions);
33
+ toJSON(): CliErrorShape;
34
+ }
35
+ export declare function asCliError(error: unknown): CliError;
@@ -0,0 +1 @@
1
+ import{CLI_ERROR_CODES as i}from"./error-codes.js";class r extends Error{code;category;userMessage;retryable;exitCode;correlationId;details;hint;constructor(t,a,s){super(a,{cause:s.cause}),this.name="CliError",this.code=t,this.category=s.category,this.userMessage=s.userMessage??a,this.retryable=s.retryable??!1,this.exitCode=s.exitCode??1,this.correlationId=s.correlationId,this.details=s.details,this.hint=s.hint}toJSON(){return{code:this.code,category:this.category,message:this.message,userMessage:this.userMessage,retryable:this.retryable,exitCode:this.exitCode,...this.correlationId!==void 0?{correlationId:this.correlationId}:{},...this.details!==void 0?{details:this.details}:{}}}}function f(e){if(e instanceof r)return e;const t=o(e),a=l(e);return t==="REQUEST_ABORTED"||c(e)?new r(i.INTERRUPTED,n(e),{category:"agent",userMessage:"The request was interrupted.",retryable:!0,...a,cause:e}):t==="REQUEST_TIMEOUT"||t==="NETWORK_ERROR"?new r(i.MEDIA_REQUEST_FAILED,n(e),{category:"media",userMessage:"The media request could not be completed. Retry the request; if it persists, check the selected model, credentials, and network connection.",retryable:!0,...a,cause:e}):t==="REQUEST_VALIDATION_ERROR"||t==="REQUEST_PAYLOAD_TOO_LARGE"?new r(i.INVALID_ARGUMENT,n(e),{category:"media",userMessage:"The media request does not satisfy a gateway validation limit. Review the command options and input file size.",...a,cause:e}):t==="RESPONSE_TOO_LARGE"?new r(i.MEDIA_RESPONSE_TOO_LARGE,n(e),{category:"media",userMessage:"The generated media exceeds the supported download size.",retryable:!1,...a,cause:e}):t==="TOOL_ARGUMENTS_INVALID"?new r(i.TOOL_ARGUMENT_INVALID,n(e),{category:"tool",userMessage:"The selected model returned malformed tool arguments. Retry the request or choose a model with reliable tool-calling support.",retryable:!0,cause:e}):t==="TOOL_DENIED"||t==="TOOL_APPROVAL_REQUIRED"?new r(i.TOOL_DENIED,n(e),{category:"tool",userMessage:"The tool action was denied by the active workspace policy. Use interactive approval or configure an explicit workspace permission.",retryable:!1,...a,cause:e}):t==="TOOL_EXECUTION_FAILED"||t==="MCP_OPERATION_FAILED"||t==="MCP_DISCONNECTED"?new r(i.TOOL_EXECUTION_FAILED,n(e),{category:"tool",userMessage:"The selected tool could not complete. Retry the request; if it persists, check the tool or MCP server connection.",retryable:!0,...a,cause:e}):t==="TOOL_NOT_FOUND"?new r(i.MODEL_STREAM_FAILED,n(e),{category:"model",userMessage:"The selected model requested a tool that is unavailable in this CLI session. Retry the request or choose another model.",retryable:!0,cause:e}):t==="AGENT_LIMIT_EXCEEDED"?new r(i.AGENT_STUCK,n(e),{category:"agent",userMessage:"The agent reached a safety limit before completing. Narrow the task and try again.",retryable:!0,cause:e}):t==="MODEL_RESPONSE_INVALID"||t==="RESPONSE_PARSE_ERROR"||d(e)?new r(i.MODEL_STREAM_FAILED,n(e),{category:"model",userMessage:"The model provider could not complete the request. Retry; if it persists, check the selected model, credentials, and base URL.",retryable:!0,cause:e}):new r(i.INTERNAL_ERROR,e instanceof Error?e.message:String(e),{category:"general",userMessage:"An internal error occurred.",hint:{actionId:"doctor"},cause:e})}function o(e){if(typeof e!="object"||e===null)return;const t=e;return typeof t.code=="string"?t.code:typeof t.errorCode=="string"?t.errorCode:void 0}function c(e){let t=e;for(let a=0;a<5&&t!==void 0&&t!==null;a+=1){if(typeof t!="object")return!1;const s=t;if(s.name==="AbortError"||s.code==="ABORT_ERR"||typeof s.message=="string"&&/\b(aborted|cancelled|canceled)\b/iu.test(s.message))return!0;t=s.cause}return!1}function l(e){if(typeof e!="object"||e===null)return{};const t=e;return{...typeof t.correlationId=="string"?{correlationId:t.correlationId}:{},...u(t.details)?{details:t.details}:{}}}function u(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function d(e){return n(e)==="Upstream AI provider request failed."}function n(e){return e instanceof Error?e.message:String(e)}export{r as CliError,f as asCliError};
@@ -0,0 +1,51 @@
1
+ export declare const CLI_ERROR_CODES: {
2
+ readonly INVALID_ARGUMENT: "CLI_INVALID_ARGUMENT";
3
+ readonly MISSING_ARGUMENT: "CLI_MISSING_ARGUMENT";
4
+ readonly INTERRUPTED: "CLI_INTERRUPTED";
5
+ readonly INTERNAL_ERROR: "CLI_INTERNAL_ERROR";
6
+ readonly CONFIG_NOT_FOUND: "CONFIG_NOT_FOUND";
7
+ readonly CONFIG_INVALID_JSON: "CONFIG_INVALID_JSON";
8
+ readonly CONFIG_SCHEMA_INVALID: "CONFIG_SCHEMA_INVALID";
9
+ readonly CONFIG_LOCKED: "CONFIG_LOCKED";
10
+ readonly PROJECT_PATH_INVALID: "PROJECT_PATH_INVALID";
11
+ readonly AUTH_API_KEY_INVALID: "AUTH_API_KEY_INVALID";
12
+ readonly AUTH_PROFILE_NOT_FOUND: "AUTH_PROFILE_NOT_FOUND";
13
+ readonly AUTH_CREDENTIAL_STORE_UNAVAILABLE: "AUTH_CREDENTIAL_STORE_UNAVAILABLE";
14
+ readonly AUTH_BASE_URL_INVALID: "AUTH_BASE_URL_INVALID";
15
+ readonly PROJECT_TRUST_REQUIRED: "PROJECT_TRUST_REQUIRED";
16
+ readonly MODEL_NOT_FOUND: "MODEL_NOT_FOUND";
17
+ readonly MODEL_STREAM_FAILED: "MODEL_STREAM_FAILED";
18
+ readonly MODEL_EMPTY_RESPONSE: "MODEL_EMPTY_RESPONSE";
19
+ readonly MODEL_PROTOCOL_EMPTY_RESPONSE: "MODEL_PROTOCOL_EMPTY_RESPONSE";
20
+ readonly MEDIA_REQUEST_FAILED: "MEDIA_REQUEST_FAILED";
21
+ readonly MEDIA_RESPONSE_TOO_LARGE: "MEDIA_RESPONSE_TOO_LARGE";
22
+ readonly MODEL_EMPTY_FINAL: "MODEL_EMPTY_FINAL";
23
+ readonly AGENT_STUCK: "AGENT_STUCK";
24
+ readonly ATTACHMENT_CLIPBOARD_UNAVAILABLE: "ATTACHMENT_CLIPBOARD_UNAVAILABLE";
25
+ readonly ATTACHMENT_FORMAT_UNSUPPORTED: "ATTACHMENT_FORMAT_UNSUPPORTED";
26
+ readonly ATTACHMENT_TOO_LARGE: "ATTACHMENT_TOO_LARGE";
27
+ readonly ATTACHMENT_INVALID_IMAGE: "ATTACHMENT_INVALID_IMAGE";
28
+ readonly TOOL_ARGUMENT_INVALID: "TOOL_ARGUMENT_INVALID";
29
+ readonly TOOL_DENIED: "CLI_TOOL_DENIED";
30
+ readonly TOOL_EXECUTION_FAILED: "CLI_TOOL_EXECUTION_FAILED";
31
+ readonly PROJECT_SYMLINK_ESCAPE: "PROJECT_SYMLINK_ESCAPE";
32
+ readonly SESSION_NOT_FOUND: "SESSION_NOT_FOUND";
33
+ readonly SESSION_LOCKED: "SESSION_LOCKED";
34
+ readonly SESSION_CORRUPTED: "SESSION_CORRUPTED";
35
+ readonly TASK_DEPENDENCY_CYCLE: "TASK_DEPENDENCY_CYCLE";
36
+ readonly TASK_SCHEDULER_OVERLOADED: "TASK_SCHEDULER_OVERLOADED";
37
+ readonly TASK_PLAN_APPROVAL_REQUIRED: "TASK_PLAN_APPROVAL_REQUIRED";
38
+ readonly PLUGIN_MANIFEST_INVALID: "PLUGIN_MANIFEST_INVALID";
39
+ readonly PLUGIN_NOT_FOUND: "PLUGIN_NOT_FOUND";
40
+ readonly SKILL_FRONTMATTER_INVALID: "SKILL_FRONTMATTER_INVALID";
41
+ readonly SKILL_NOT_FOUND: "SKILL_NOT_FOUND";
42
+ readonly MCP_CONFIG_INVALID: "MCP_CONFIG_INVALID";
43
+ readonly MCP_SERVER_NOT_FOUND: "MCP_SERVER_NOT_FOUND";
44
+ readonly GOAL_NOT_FOUND: "GOAL_NOT_FOUND";
45
+ readonly GOAL_INVALID_STATE: "GOAL_INVALID_STATE";
46
+ readonly GOAL_LIMIT_REACHED: "GOAL_LIMIT_REACHED";
47
+ readonly MEMORY_NOT_FOUND: "MEMORY_NOT_FOUND";
48
+ readonly MEMORY_INVALID: "MEMORY_INVALID";
49
+ readonly MEMORY_LIMIT_REACHED: "MEMORY_LIMIT_REACHED";
50
+ };
51
+ export type CliErrorCode = (typeof CLI_ERROR_CODES)[keyof typeof CLI_ERROR_CODES];
@@ -0,0 +1 @@
1
+ const _={INVALID_ARGUMENT:"CLI_INVALID_ARGUMENT",MISSING_ARGUMENT:"CLI_MISSING_ARGUMENT",INTERRUPTED:"CLI_INTERRUPTED",INTERNAL_ERROR:"CLI_INTERNAL_ERROR",CONFIG_NOT_FOUND:"CONFIG_NOT_FOUND",CONFIG_INVALID_JSON:"CONFIG_INVALID_JSON",CONFIG_SCHEMA_INVALID:"CONFIG_SCHEMA_INVALID",CONFIG_LOCKED:"CONFIG_LOCKED",PROJECT_PATH_INVALID:"PROJECT_PATH_INVALID",AUTH_API_KEY_INVALID:"AUTH_API_KEY_INVALID",AUTH_PROFILE_NOT_FOUND:"AUTH_PROFILE_NOT_FOUND",AUTH_CREDENTIAL_STORE_UNAVAILABLE:"AUTH_CREDENTIAL_STORE_UNAVAILABLE",AUTH_BASE_URL_INVALID:"AUTH_BASE_URL_INVALID",PROJECT_TRUST_REQUIRED:"PROJECT_TRUST_REQUIRED",MODEL_NOT_FOUND:"MODEL_NOT_FOUND",MODEL_STREAM_FAILED:"MODEL_STREAM_FAILED",MODEL_EMPTY_RESPONSE:"MODEL_EMPTY_RESPONSE",MODEL_PROTOCOL_EMPTY_RESPONSE:"MODEL_PROTOCOL_EMPTY_RESPONSE",MEDIA_REQUEST_FAILED:"MEDIA_REQUEST_FAILED",MEDIA_RESPONSE_TOO_LARGE:"MEDIA_RESPONSE_TOO_LARGE",MODEL_EMPTY_FINAL:"MODEL_EMPTY_FINAL",AGENT_STUCK:"AGENT_STUCK",ATTACHMENT_CLIPBOARD_UNAVAILABLE:"ATTACHMENT_CLIPBOARD_UNAVAILABLE",ATTACHMENT_FORMAT_UNSUPPORTED:"ATTACHMENT_FORMAT_UNSUPPORTED",ATTACHMENT_TOO_LARGE:"ATTACHMENT_TOO_LARGE",ATTACHMENT_INVALID_IMAGE:"ATTACHMENT_INVALID_IMAGE",TOOL_ARGUMENT_INVALID:"TOOL_ARGUMENT_INVALID",TOOL_DENIED:"CLI_TOOL_DENIED",TOOL_EXECUTION_FAILED:"CLI_TOOL_EXECUTION_FAILED",PROJECT_SYMLINK_ESCAPE:"PROJECT_SYMLINK_ESCAPE",SESSION_NOT_FOUND:"SESSION_NOT_FOUND",SESSION_LOCKED:"SESSION_LOCKED",SESSION_CORRUPTED:"SESSION_CORRUPTED",TASK_DEPENDENCY_CYCLE:"TASK_DEPENDENCY_CYCLE",TASK_SCHEDULER_OVERLOADED:"TASK_SCHEDULER_OVERLOADED",TASK_PLAN_APPROVAL_REQUIRED:"TASK_PLAN_APPROVAL_REQUIRED",PLUGIN_MANIFEST_INVALID:"PLUGIN_MANIFEST_INVALID",PLUGIN_NOT_FOUND:"PLUGIN_NOT_FOUND",SKILL_FRONTMATTER_INVALID:"SKILL_FRONTMATTER_INVALID",SKILL_NOT_FOUND:"SKILL_NOT_FOUND",MCP_CONFIG_INVALID:"MCP_CONFIG_INVALID",MCP_SERVER_NOT_FOUND:"MCP_SERVER_NOT_FOUND",GOAL_NOT_FOUND:"GOAL_NOT_FOUND",GOAL_INVALID_STATE:"GOAL_INVALID_STATE",GOAL_LIMIT_REACHED:"GOAL_LIMIT_REACHED",MEMORY_NOT_FOUND:"MEMORY_NOT_FOUND",MEMORY_INVALID:"MEMORY_INVALID",MEMORY_LIMIT_REACHED:"MEMORY_LIMIT_REACHED"};export{_ as CLI_ERROR_CODES};
@@ -0,0 +1,3 @@
1
+ export type ExtensionScope = 'user' | 'project';
2
+ export declare function parseExtensionScope(value: string | boolean | undefined): ExtensionScope | undefined;
3
+ export declare function requireExtensionScope(value: string | boolean | undefined): ExtensionScope;
@@ -0,0 +1 @@
1
+ import{CliError as o}from"../errors/cli-error.js";import{CLI_ERROR_CODES as s}from"../errors/error-codes.js";function n(e){if(e!==void 0){if(typeof e!="string"||e!=="user"&&e!=="project")throw new o(s.INVALID_ARGUMENT,"Extension scope must be user or project.",{category:"arguments",userMessage:"Invalid scope. Use --scope user or --scope project."});return e}}function c(e){const r=n(e);if(r===void 0)throw new o(s.MISSING_ARGUMENT,"Extension scope is required for non-interactive commands.",{category:"arguments",userMessage:"Choose a scope interactively or pass --scope user|project."});return r}export{n as parseExtensionScope,c as requireExtensionScope};
@@ -0,0 +1,5 @@
1
+ export interface ExtensionStateEntry {
2
+ enabled: boolean;
3
+ }
4
+ export type ExtensionState = Record<string, ExtensionStateEntry>;
5
+ export declare function parseExtensionState(value: unknown): ExtensionState;
@@ -0,0 +1 @@
1
+ function o(t){if(typeof t!="object"||t===null||Array.isArray(t))throw new Error("Extension state must be an object.");const n={};for(const[r,e]of Object.entries(t)){if(typeof e!="object"||e===null||Array.isArray(e)||typeof e.enabled!="boolean")throw new Error(`Invalid extension state entry: ${r}.`);n[r]={enabled:e.enabled}}return n}export{o as parseExtensionState};
@@ -0,0 +1,13 @@
1
+ export type HookEvent = 'session.start' | 'prompt.before' | 'tool.before' | 'tool.after' | 'response.after' | 'session.end';
2
+ export interface HookDefinition {
3
+ id: string;
4
+ event: HookEvent;
5
+ command: string;
6
+ args: readonly string[];
7
+ timeoutMs: number;
8
+ directory: string;
9
+ scope?: 'project' | 'plugin';
10
+ pluginName?: string;
11
+ sourceName?: string;
12
+ }
13
+ export declare function parseHookDefinition(value: unknown, directory: string, id: string): HookDefinition;
@@ -0,0 +1 @@
1
+ import{CliError as a}from"../errors/cli-error.js";import{CLI_ERROR_CODES as d}from"../errors/error-codes.js";function k(o,f,u){if(typeof o!="object"||o===null)throw e("Hook must be a JSON object.");const n=o,i=n.event,r=n.command,s=n.args,m=n.timeoutMs;if(!p(i))throw e("Hook event is not supported.");if(typeof r!="string"||r.trim().length===0||/[\r\n]/u.test(r))throw e("Hook command is invalid.");if(s!==void 0&&(!Array.isArray(s)||s.some(c=>typeof c!="string")))throw e("Hook args must be strings.");const t=m===void 0?1e4:m;if(typeof t!="number"||!Number.isInteger(t)||t<100||t>12e4)throw e("Hook timeout must be between 100 and 120000 milliseconds.");return{id:u,event:i,command:r,args:s??[],timeoutMs:t,directory:f}}function p(o){return typeof o=="string"&&["session.start","prompt.before","tool.before","tool.after","response.after","session.end"].includes(o)}function e(o){return new a(d.PLUGIN_MANIFEST_INVALID,o,{category:"extension",userMessage:`Invalid hook: ${o}`})}export{k as parseHookDefinition};
@@ -0,0 +1,9 @@
1
+ /** Public plugin identities that own optional native Desktop host capabilities. */
2
+ export declare const HOST_TOOL_PLUGIN_IDS: {
3
+ readonly browser: "browser-use";
4
+ readonly computer: "computer-use";
5
+ readonly pdf: "pdf";
6
+ readonly pptx: "pptx";
7
+ readonly excel: "excel";
8
+ readonly docs: "docs";
9
+ };
@@ -0,0 +1 @@
1
+ const e={browser:"browser-use",computer:"computer-use",pdf:"pdf",pptx:"pptx",excel:"excel",docs:"docs"};export{e as HOST_TOOL_PLUGIN_IDS};
@@ -0,0 +1,35 @@
1
+ import type { McpServerConfig } from '@lotagate/agent-sdk';
2
+ /** Persistable subset of the public Agent SDK MCP contract. */
3
+ export interface McpSecretReference {
4
+ type: 'env';
5
+ name: string;
6
+ }
7
+ export type CliSecretValue = string | McpSecretReference;
8
+ export type CliMcpServerConfig = (Omit<Extract<McpServerConfig, {
9
+ type: 'stdio';
10
+ }>, 'env'> & {
11
+ env?: Readonly<Record<string, CliSecretValue>>;
12
+ }) | (Omit<Extract<McpServerConfig, {
13
+ type: 'http' | 'sse';
14
+ }>, 'headers' | 'auth'> & {
15
+ headers?: Readonly<Record<string, CliSecretValue>>;
16
+ auth?: {
17
+ type: 'bearer';
18
+ token: McpSecretReference;
19
+ };
20
+ });
21
+ export interface CliMcpServerEntry {
22
+ enabled: boolean;
23
+ config: CliMcpServerConfig;
24
+ }
25
+ export type CliMcpConfig = Record<string, CliMcpServerEntry>;
26
+ export declare function mergeMcpConfigs(...configs: readonly CliMcpConfig[]): CliMcpConfig;
27
+ /**
28
+ * Combines ordered configuration layers where a later, more specific layer
29
+ * overrides an earlier one. Runtime callers pass user scope before project
30
+ * scope so a trusted project can intentionally override a global server with
31
+ * the same name.
32
+ */
33
+ export declare function mergeMcpConfigsWithOverride(...configs: readonly CliMcpConfig[]): CliMcpConfig;
34
+ export declare function validateMcpName(name: string): string;
35
+ export declare function validateMcpConfig(value: unknown): CliMcpConfig;
@@ -0,0 +1 @@
1
+ import{CliError as d}from"../errors/cli-error.js";import{CLI_ERROR_CODES as m}from"../errors/error-codes.js";function C(...t){const e={};for(const o of t)for(const[r,i]of Object.entries(o)){if(e[r]!==void 0)throw n(`MCP server is defined more than once: ${r}.`);e[r]=i}return e}function M(...t){const e={};for(const o of t)Object.assign(e,o);return e}function g(t){const e=t.trim().toLowerCase();if(!/^[a-z][a-z0-9_-]{0,63}$/.test(e))throw n("MCP server name must be lowercase and <= 64 characters.");return e}function A(t){if(typeof t!="object"||t===null||Array.isArray(t))throw n("MCP config must be an object.");const e={};for(const[o,r]of Object.entries(t)){const i=g(o);if(typeof r!="object"||r===null||Array.isArray(r))throw n(`Invalid MCP entry: ${i}.`);const s=r;if(typeof s.enabled!="boolean"||typeof s.config!="object"||s.config===null)throw n(`Invalid MCP entry: ${i}.`);e[i]={enabled:s.enabled,config:h(s.config)}}return e}function h(t){const e=t,o=e.type;if(o==="stdio"){if(typeof e.command!="string"||e.command.trim().length===0||/[\r\n]/.test(e.command))throw n("stdio MCP command is invalid.");if(e.args!==void 0&&(!Array.isArray(e.args)||e.args.some(r=>typeof r!="string")))throw n("stdio MCP args must be strings.");return{type:o,command:e.command,...e.args===void 0?{}:{args:e.args},...e.env===void 0?{}:{env:a(e.env,"stdio env")},...e.cwd===void 0?{}:{cwd:y(e.cwd,"stdio cwd")},...e.maxBufferSize===void 0?{}:{maxBufferSize:p(e.maxBufferSize,"stdio maxBufferSize")}}}if(o==="http"||o==="sse"){if(typeof e.url!="string")throw n("HTTP MCP URL is required.");try{const r=new URL(e.url);if(!["http:","https:"].includes(r.protocol)||r.username.length>0||r.password.length>0||[...r.searchParams.keys()].some(u))throw new Error("credentials")}catch(r){throw n("HTTP MCP URL must use HTTP or HTTPS and must not contain credentials.",r)}return{type:o,url:e.url,...e.headers===void 0?{}:{headers:a(e.headers,"HTTP headers")},...e.auth===void 0?{}:{auth:b(e.auth)}}}throw n("MCP type must be stdio, http or sse.")}function y(t,e){if(typeof t!="string"||t.length===0)throw n(`${e} must be a non-empty string.`);return t}function p(t,e){if(typeof t!="number"||!Number.isSafeInteger(t)||t<=0)throw n(`${e} must be a positive integer.`);return t}function b(t){if(typeof t!="object"||t===null||Array.isArray(t))throw n("HTTP auth must be a bearer token configuration.");const e=t;if(e.type!=="bearer")throw n("HTTP auth must be a bearer token configuration.");return{type:"bearer",token:f(e.token,"HTTP bearer token")}}function a(t,e){if(typeof t!="object"||t===null||Array.isArray(t))throw n(`${e} must be an object of string values or environment references.`);const o={};for(const[r,i]of Object.entries(t)){if(r.length===0||/[\r\n]/u.test(r))throw n(`${e} must contain valid string key/value pairs.`);o[r]=c(i)?f(i,`${e} secret reference`):u(r)?(()=>{throw n(`${e} value for ${r} must use an environment reference.`)})():w(i,`${e} value`)}return o}function f(t,e){if(!c(t)||!/^[A-Za-z_][A-Za-z0-9_]{0,127}$/u.test(t.name))throw n(`${e} must reference an environment variable name.`);return{type:"env",name:t.name}}function w(t,e){if(typeof t!="string"||/[\r\n]/u.test(t))throw n(`${e} must be a string without line breaks.`);return t}function c(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&t.type==="env"&&typeof t.name=="string"}function u(t){return/(?:api[-_]?key|authorization|auth[-_]?token|cookie|credential|key|password|secret|token)/iu.test(t)}function n(t,e){return new d(m.MCP_CONFIG_INVALID,t,{category:"mcp",userMessage:`Invalid MCP configuration: ${t}`,cause:e})}export{C as mergeMcpConfigs,M as mergeMcpConfigsWithOverride,A as validateMcpConfig,g as validateMcpName};
@@ -0,0 +1,8 @@
1
+ export interface PluginAgentDefinition {
2
+ name: string;
3
+ description: string;
4
+ instructions: string;
5
+ allowedTools: readonly string[];
6
+ directory: string;
7
+ }
8
+ export declare function parsePluginAgentDocument(raw: string, directory: string): PluginAgentDefinition;
@@ -0,0 +1 @@
1
+ import{CliError as c}from"../errors/cli-error.js";import{CLI_ERROR_CODES as p}from"../errors/error-codes.js";import{findUnexpectedRecordKey as l}from"../validation/record-schema.js";import{parseYamlList as u,parseYamlMapping as d}from"./yaml-subset.js";function A(n,a){const e=d(n,t),s=l(e,["name","description","instructions","allowed-tools"]);if(s!==void 0)throw t(`Unsupported agent field: \`${s}\`.`);const o=e.name,i=e.description,r=e.instructions;if(typeof o!="string"||!/^[a-z0-9][a-z0-9-]{0,63}$/u.test(o))throw t("Agent name must use lowercase kebab-case.");if(typeof i!="string"||i.trim().length===0)throw t("Agent requires a description.");if(typeof r!="string"||r.trim().length===0)throw t("Agent requires instructions.");return{name:o,description:i,instructions:r,allowedTools:u(e["allowed-tools"]),directory:a}}function t(n){return new c(p.PLUGIN_MANIFEST_INVALID,n,{category:"extension",userMessage:`Invalid plugin agent: ${n}`})}export{A as parsePluginAgentDocument};
@@ -0,0 +1,23 @@
1
+ export interface PluginManifest {
2
+ name: string;
3
+ displayName?: string;
4
+ version: string;
5
+ description?: string;
6
+ author?: string;
7
+ license?: string;
8
+ homepage?: string;
9
+ repository?: string;
10
+ keywords?: readonly string[];
11
+ directory: string;
12
+ }
13
+ export declare const PLUGIN_LAYOUT: {
14
+ readonly markerDirectory: ".lotagate-plugin";
15
+ readonly manifestFile: "plugin.json";
16
+ readonly skillsDirectory: "skills";
17
+ readonly agentsDirectory: "agents";
18
+ readonly hooksDirectory: "hooks";
19
+ readonly mcpDirectory: "mcp";
20
+ readonly readmeFile: "README.md";
21
+ readonly licenseFile: "LICENSE";
22
+ };
23
+ export declare function parsePluginManifest(value: unknown, directory: string): PluginManifest;
@@ -0,0 +1 @@
1
+ import{CliError as g}from"../errors/cli-error.js";import{CLI_ERROR_CODES as h}from"../errors/error-codes.js";import{findUnexpectedRecordKey as N,isRecord as w}from"../validation/record-schema.js";const y=128,b={markerDirectory:".lotagate-plugin",manifestFile:"plugin.json",skillsDirectory:"skills",agentsDirectory:"agents",hooksDirectory:"hooks",mcpDirectory:"mcp",readmeFile:"README.md",licenseFile:"LICENSE"};function v(n,t){if(!w(n))throw i("Manifest must be a JSON object.");const e=n,r=N(e,["name","displayName","version","description","author","license","homepage","repository","keywords"]);if(r!==void 0)throw i(`Unsupported manifest field: \`${r}\`.`);const s=e.name,d=A(e),a=e.version,f=o(e,"description"),c=o(e,"author"),u=o(e,"license"),l=o(e,"homepage"),m=o(e,"repository"),p=k(e,"keywords");if(typeof s!="string"||!/^[a-z0-9][a-z0-9-]{0,63}$/.test(s))throw i("Plugin name must use lowercase kebab-case.");if(typeof a!="string"||!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/.test(a))throw i("Plugin version must be semver-like.");return{name:s,...d===void 0?{}:{displayName:d},version:a,...f===void 0?{}:{description:f},...c===void 0?{}:{author:c},...u===void 0?{}:{license:u},...l===void 0?{}:{homepage:l},...m===void 0?{}:{repository:m},...p===void 0?{}:{keywords:p},directory:t}}function A(n){const t=n.displayName;if(t===void 0)return;if(typeof t!="string")throw i("Manifest field `displayName` must be a string.");const e=t.trim();if(e.length===0||e.length>y||M(e))throw i(`Manifest field \`displayName\` must be a non-empty string of at most ${y} characters.`);return e}function M(n){return[...n].some(t=>{const e=t.codePointAt(0)??0;return e<32||e===127})}function o(n,t){const e=n[t];if(e!==void 0){if(typeof e!="string")throw i(`Manifest field \`${t}\` must be a string.`);return e}}function k(n,t){const e=n[t];if(e!==void 0){if(!Array.isArray(e)||e.some(r=>typeof r!="string"||r.trim().length===0))throw i(`Manifest field \`${t}\` must be an array of non-empty strings.`);return e.map(r=>r.trim())}}function i(n){return new g(h.PLUGIN_MANIFEST_INVALID,n,{category:"extension",userMessage:`Invalid plugin: ${n}`})}export{b as PLUGIN_LAYOUT,v as parsePluginManifest};
@@ -0,0 +1,10 @@
1
+ export interface SkillManifest {
2
+ name: string;
3
+ description: string;
4
+ userInvocable: boolean;
5
+ modelInvocable: boolean;
6
+ allowedTools: readonly string[];
7
+ directory: string;
8
+ body: string;
9
+ }
10
+ export declare function parseSkillDocument(raw: string, directory: string): SkillManifest;
@@ -0,0 +1,3 @@
1
+ import{CliError as f}from"../errors/cli-error.js";import{CLI_ERROR_CODES as d}from"../errors/error-codes.js";import{parseYamlList as p,parseYamlMapping as u}from"./yaml-subset.js";function b(t,m){const n=t.replace(/^\uFEFF/,"");if(!n.startsWith(`---
2
+ `)&&!n.startsWith(`---\r
3
+ `))throw e("Skill must start with YAML frontmatter.");const r=n.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n([\s\S]*)$/);if(r===null)throw e("Skill frontmatter is not closed.");const l=r[1],a=r[2];if(l===void 0||a===void 0)throw e("Skill document is incomplete.");const o=u(l,e),i=o.name,s=o.description;if(typeof i!="string"||typeof s!="string"||s.trim().length===0)throw e("Skill requires name and description.");if(!/^[a-z0-9][a-z0-9-]{0,63}$/.test(i))throw e("Skill name must be lowercase kebab-case.");return{name:i,description:s,userInvocable:!c(o["user-invocable"]),modelInvocable:!c(o["model-invocable"]),allowedTools:p(o["allowed-tools"]),directory:m,body:a.trim()}}function c(t){return typeof t=="string"&&t.toLowerCase()==="false"}function e(t){return new f(d.SKILL_FRONTMATTER_INVALID,t,{category:"extension",userMessage:`Invalid skill: ${t}`})}export{b as parseSkillDocument};
@@ -0,0 +1,9 @@
1
+ import { CliError } from '../errors/cli-error.js';
2
+ export type YamlValue = string | readonly string[];
3
+ /**
4
+ * Parses the deliberately small YAML mapping subset used by extension metadata.
5
+ * It supports scalars, folded/literal blocks and string lists without executing
6
+ * YAML tags or constructing arbitrary objects.
7
+ */
8
+ export declare function parseYamlMapping(raw: string, invalid?: (message: string) => CliError): Record<string, YamlValue>;
9
+ export declare function parseYamlList(value: YamlValue | undefined): readonly string[];
@@ -0,0 +1,2 @@
1
+ import{CliError as f}from"../errors/cli-error.js";import{CLI_ERROR_CODES as p}from"../errors/error-codes.js";function w(t,i=g){const n=t.split(/\r?\n/),o={};for(let e=0;e<n.length;e+=1){const l=n[e]??"";if(l.trim().length===0||l.trimStart().startsWith("#"))continue;const u=l.match(/^([A-Za-z][A-Za-z0-9_-]*):(?:[ \t]*(.*))?$/u);if(u===null)throw i(`Invalid YAML metadata line: ${l}`);const a=u[1]?.toLowerCase(),s=u[2]??"";if(a===void 0)throw i("YAML metadata key is invalid.");if(s===">"||s==="|"){const r=[];for(;e+1<n.length&&h(n[e+1]??"");)r.push(d(n[++e]??""));o[a]=s===">"?r.join(" ").replace(/\s+/gu," ").trim():r.join(`
2
+ `).trimEnd();continue}if(s.trim().length===0&&e+1<n.length&&m(n[e+1]??"")){const r=[];for(;e+1<n.length&&m(n[e+1]??"");)r.push(c(n[++e].trim().slice(2).trim()));o[a]=r;continue}o[a]=c(s.trim())}return o}function A(t){if(t===void 0)return[];if(typeof t!="string")return t;const i=t.trim().replace(/^\[|\]$/g,"").trim();return i.length===0?[]:(i.includes(",")?i.split(","):i.split(/\s+/u)).map(c).map(n=>n.trim()).filter(Boolean)}function h(t){return/^\s+/.test(t)||t.trim().length===0}function m(t){return/^\s+-\s+/.test(t)}function d(t){return t.trim().length===0?"":t.replace(/^\s{2}/u,"")}function c(t){return t.replace(/^(['"])([\s\S]*)\1$/u,"$2")}function g(t){return new f(p.SKILL_FRONTMATTER_INVALID,t,{category:"extension",userMessage:`Invalid extension metadata: ${t}`})}export{A as parseYamlList,w as parseYamlMapping};
@@ -0,0 +1,21 @@
1
+ export type FileDiffLineKind = 'context' | 'addition' | 'deletion';
2
+ export interface FileDiffLine {
3
+ readonly kind: FileDiffLineKind;
4
+ readonly text: string;
5
+ readonly oldLine?: number;
6
+ readonly newLine?: number;
7
+ }
8
+ export interface FileChangeDiff {
9
+ readonly path: string;
10
+ readonly lines: readonly FileDiffLine[];
11
+ readonly additions: number;
12
+ readonly deletions: number;
13
+ readonly truncated: boolean;
14
+ }
15
+ export interface FileDiffOptions {
16
+ maxLines?: number;
17
+ maxInputLines?: number;
18
+ truncated?: boolean;
19
+ }
20
+ /** Creates a bounded, deterministic line diff suitable for terminal rendering. */
21
+ export declare function createFileChangeDiff(path: string, before: string, after: string, options?: FileDiffOptions): FileChangeDiff;
@@ -0,0 +1,3 @@
1
+ function w(i,o,s,n={}){const e=n.maxInputLines??400,x=n.maxLines??240,f=L(o),m=L(s),I=f.length>e||m.length>e,d=f.slice(0,e),r=m.slice(0,e),p=b(d,r),c=[];let h=1,u=1,t=0,l=0;for(;t<d.length||l<r.length;)t<d.length&&l<r.length&&d[t]===r[l]?(c.push({kind:"context",text:d[t]??"",oldLine:h,newLine:u}),t+=1,l+=1,h+=1,u+=1):l<r.length&&(t===d.length||(p[t+1]?.[l]??0)<(p[t]?.[l+1]??0))?(c.push({kind:"addition",text:r[l]??"",newLine:u}),l+=1,u+=1):(c.push({kind:"deletion",text:d[t]??"",oldLine:h}),t+=1,h+=1);const k=n.truncated===!0||I||c.length>x,a=c.slice(0,x);return{path:i,lines:a,additions:a.filter(g=>g.kind==="addition").length,deletions:a.filter(g=>g.kind==="deletion").length,truncated:k}}function L(i){return i.length===0?[]:i.replace(/\r\n/gu,`
2
+ `).split(`
3
+ `)}function b(i,o){const s=Array.from({length:i.length+1},()=>Array(o.length+1).fill(0));for(let n=i.length-1;n>=0;n-=1)for(let e=o.length-1;e>=0;e-=1)s[n][e]=i[n]===o[e]?(s[n+1]?.[e+1]??0)+1:Math.max(s[n+1]?.[e]??0,s[n]?.[e+1]??0);return s}export{w as createFileChangeDiff};
@@ -0,0 +1,41 @@
1
+ export declare const INTENT_KINDS: readonly ["answer", "research", "change", "automation"];
2
+ export type IntentKind = typeof INTENT_KINDS[number];
3
+ export interface IntentStep {
4
+ readonly id: string;
5
+ readonly title: string;
6
+ readonly acceptanceCriteria: readonly string[];
7
+ readonly requiresVerification: boolean;
8
+ }
9
+ export interface IntentContract {
10
+ readonly id: string;
11
+ readonly kind: IntentKind;
12
+ readonly objective: string;
13
+ readonly steps: readonly IntentStep[];
14
+ readonly createdAt: string;
15
+ }
16
+ export interface IntentCompilationInput {
17
+ readonly kind: IntentKind;
18
+ readonly objective: string;
19
+ readonly steps: readonly Omit<IntentStep, 'id'>[];
20
+ }
21
+ /**
22
+ * Applies a deterministic safety correction to the model-assisted intent
23
+ * classification. Direct information questions are answer work, even when
24
+ * the model describes them with a research-like objective such as "find".
25
+ * Explicit work requests remain unchanged and continue through host evidence
26
+ * and verification gates.
27
+ */
28
+ export declare function stabilizeIntentCompilation(prompt: string, input: IntentCompilationInput): IntentCompilationInput;
29
+ export interface CompletionAssessment {
30
+ readonly decision: 'complete' | 'continue';
31
+ readonly missing: readonly string[];
32
+ }
33
+ /**
34
+ * The host, not the model, owns the minimum verification policy for work
35
+ * that can change state or execute an operational workflow.
36
+ */
37
+ export declare function requiresHostVerification(kind: IntentKind): boolean;
38
+ export declare function createIntentContract(input: IntentCompilationInput, timestamp?: string): IntentContract;
39
+ export declare function normalizeIntentCompilation(value: unknown): IntentCompilationInput;
40
+ export declare function fallbackIntent(prompt: string): IntentContract;
41
+ export declare function isIntentKind(value: unknown): value is IntentKind;
@@ -0,0 +1 @@
1
+ import h from"node:crypto";import{CliError as u}from"../errors/cli-error.js";import{CLI_ERROR_CODES as d}from"../errors/error-codes.js";import{findUnexpectedRecordKey as c,isRecord as s}from"../validation/record-schema.js";const f=["answer","research","change","automation"];function j(t,e){return e.kind==="answer"||!b(t)?e:{...e,kind:"answer",steps:e.steps.map(i=>({...i,requiresVerification:!1}))}}function p(t){return t==="change"||t==="automation"}function m(t,e=new Date().toISOString()){const i=l(t),n=p(i.kind);return{id:h.randomUUID(),kind:i.kind,objective:i.objective,steps:i.steps.map((o,a)=>({...o,requiresVerification:n||o.requiresVerification,id:`step-${a+1}`})),createdAt:e}}function l(t){if(!s(t))throw r("Intent compilation must be an object.");const e=c(t,["kind","objective","steps"]);if(e!==void 0)throw r(`Unsupported intent field: ${e}.`);const i=t.kind,n=t.objective,o=t.steps;if(!w(i))throw r("Intent kind is invalid.");if(typeof n!="string"||n.trim().length===0||n.length>16384)throw r("Intent objective is invalid.");if(!Array.isArray(o)||o.length===0||o.length>10)throw r("Intent requires between one and ten steps.");return{kind:i,objective:n.trim(),steps:o.map(y)}}function V(t){const e=t.trim();if(e.length===0)throw r("Intent objective is required.");const i=I(e);return m({kind:i,objective:e,steps:[{title:g(i),acceptanceCriteria:[e],requiresVerification:i==="change"||i==="automation"}]})}function g(t){return t==="change"?"Implement and verify the requested change":"Address the requested outcome"}function w(t){return typeof t=="string"&&f.includes(t)}function y(t){if(!s(t))throw r("Intent step is invalid.");const e=c(t,["title","acceptanceCriteria","requiresVerification"]);if(e!==void 0)throw r(`Unsupported intent step field: ${e}.`);const i=t.title,n=t.acceptanceCriteria,o=t.requiresVerification;if(typeof i!="string"||i.trim().length===0||i.length>2048)throw r("Intent step title is invalid.");if(!Array.isArray(n)||n.length===0||n.length>16||n.some(a=>typeof a!="string"||a.trim().length===0||a.length>2048))throw r("Intent acceptance criteria are invalid.");if(typeof o!="boolean")throw r("Intent verification requirement is invalid.");return{title:i.trim(),acceptanceCriteria:n.map(a=>String(a).trim()),requiresVerification:o}}function I(t){const e=t.toLocaleLowerCase();return/(fix|implement|change|refactor|add|remove|sửa|triển khai|thêm|xóa)/u.test(e)?"change":/(research|investigate|audit|analy[sz]e|nghiên cứu|kiểm tra|đánh giá)/u.test(e)?"research":/(run|execute|deploy|monitor|automation|chạy|triển khai|theo dõi)/u.test(e)?"automation":"answer"}function b(t){const e=t.trim().toLocaleLowerCase();return e.length===0||k(e)?!1:/[?؟]/u.test(e)||/(?:^|\s)(?:what|who|where|when|why|how|which|is|are|can|do|does|là gì|ai|ở đâu|khi nào|tại sao|thế nào|như nào|nào|có phải|có .* không|cho biết|nói cho tôi biết)\b/iu.test(e)||/(?:memory|context|ghi nhớ|đã lưu|remembered|what do you know)/iu.test(e)}function k(t){return/(?:implement|fix|change|edit|write|create|remove|delete|build|run|test|audit|research|investigate|analy[sz]e|check|inspect|review|verify|validate|trace|deploy|monitor|sửa|thay đổi|viết|tạo|xóa|chạy|xem|kiểm tra|rà soát|nghiên cứu|triển khai|theo dõi)\b/iu.test(t)}function r(t){return new u(d.INVALID_ARGUMENT,t,{category:"intent",userMessage:t})}export{f as INTENT_KINDS,m as createIntentContract,V as fallbackIntent,w as isIntentKind,l as normalizeIntentCompilation,p as requiresHostVerification,j as stabilizeIntentCompilation};
@@ -0,0 +1,23 @@
1
+ /** Mirrors the gateway's public media validation contract. The gateway remains authoritative. */
2
+ export declare const GATEWAY_MEDIA_LIMITS: {
3
+ readonly imagePromptCharacters: 32000;
4
+ readonly imageCount: 16;
5
+ readonly imageEditFileBytes: number;
6
+ readonly imageEditMaskBytes: number;
7
+ readonly imageEditTotalBytes: number;
8
+ readonly audioUploadBytes: number;
9
+ readonly speechInputCharacters: 4096;
10
+ readonly speechInstructionsCharacters: 4096;
11
+ readonly speechVoiceCharacters: 64;
12
+ readonly audioPromptCharacters: 4096;
13
+ readonly transcriptionLanguageCharacters: 10;
14
+ };
15
+ /** The installed SDK buffers binary media responses to this exact upper bound. */
16
+ export declare const SDK_BINARY_MEDIA_RESPONSE_BYTES: number;
17
+ type Flags = ReadonlyMap<string, string | boolean>;
18
+ export declare function validateMediaCommandOptions(action: string, positionals: readonly string[], flags: Flags): void;
19
+ export declare function validateImageEditInputCount(paths: readonly string[]): void;
20
+ export declare function validateUploadSize(bytes: number, maximum: number, label: string): void;
21
+ export declare function validateImageEditTotalSize(bytes: number): void;
22
+ export declare function formatByteLimit(bytes: number): string;
23
+ export {};
@@ -0,0 +1 @@
1
+ import{CliError as I}from"../errors/cli-error.js";import{CLI_ERROR_CODES as l}from"../errors/error-codes.js";const c=1e3,s=1e6,u={imagePromptCharacters:32e3,imageCount:16,imageEditFileBytes:47*s,imageEditMaskBytes:4*s,imageEditTotalBytes:128*s,audioUploadBytes:50*s,speechInputCharacters:4096,speechInstructionsCharacters:4096,speechVoiceCharacters:64,audioPromptCharacters:4096,transcriptionLanguageCharacters:10},M=50*1024*1024;function O(e,i,t){v(t),(e==="image.generate"||e==="image.edit")&&C(i,t),e==="image.edit"&&E(t),e==="audio.speech"&&_(i,t),e==="audio.transcribe"&&h(t,!0),e==="audio.translate"&&h(t,!1),e==="video.generate"&&$(t)}function T(e){if(e.length===0)throw n("`--image` requires at least one workspace image path.");if(e.length>u.imageCount)throw n(`Image edits support at most ${u.imageCount} input images.`)}function A(e,i,t){if(!(e>0&&e<=i))throw n(`${t} must be between 1 byte and ${f(i)}.`)}function q(e){if(!(e<=u.imageEditTotalBytes))throw n(`Image edit uploads must not exceed ${f(u.imageEditTotalBytes)} in total.`)}function f(e){return e>=s?`${e/s} MB`:e>=c?`${e/c} KB`:`${e} bytes`}function v(e){const i=r(e,"out");if(p(e,"force")&&i===void 0)throw n("`--force` is only valid with `--out`.")}function C(e,i){d(g(e,"image"),u.imagePromptCharacters,"Image prompt");const t=w(i,"n");if(t!==void 0&&(t<1||t>u.imageCount))throw n(`--n must be an integer between 1 and ${u.imageCount}.`);if(t!==void 0&&t>1&&r(i,"out")!==void 0)throw n("--out can only be used when exactly one image artifact is requested. Use --out-dir instead.");const o=r(i,"size");if(o!==void 0&&o!=="auto"&&!/^\d{2,4}x\d{2,4}$/u.test(o))throw n("--size must be `auto` or WIDTHxHEIGHT.");o!==void 0&&o!=="auto"&&S(o);const a=r(i,"output-format"),m=w(i,"output-compression");if(m!==void 0&&(m<0||m>100))throw n("--output-compression must be an integer between 0 and 100.");if(m!==void 0&&a!=="jpeg"&&a!=="webp")throw n("--output-compression requires --output-format jpeg or webp.");d(r(i,"moderation"),64,"Moderation value"),d(r(i,"user"),255,"User value")}function E(e){if(r(e,"image")===void 0)throw n("Missing required option --image.")}function _(e,i){d(g(e,"speech"),u.speechInputCharacters,"Speech input"),d(x(i,"voice"),u.speechVoiceCharacters,"Voice"),d(r(i,"instructions"),u.speechInstructionsCharacters,"Speech instructions");const t=b(i,"speed");if(t!==void 0&&(t<.25||t>4))throw n("--speed must be between 0.25 and 4.")}function h(e,i){d(r(e,"prompt"),u.audioPromptCharacters,"Audio prompt");const t=b(e,"temperature");if(t!==void 0&&(t<0||t>1))throw n("--temperature must be between 0 and 1.");if(i&&(d(r(e,"language"),u.transcriptionLanguageCharacters,"Language code"),r(e,"timestamp-granularities")!==void 0&&r(e,"response-format")!=="verbose_json"))throw n("--timestamp-granularities requires --response-format verbose_json.")}function $(e){if(p(e,"no-wait")&&(r(e,"out")!==void 0||r(e,"out-dir")!==void 0||p(e,"force")))throw n("--no-wait cannot be combined with output options. Use video download after the operation completes.")}function S(e){const[i,t]=e.split("x"),o=Number(i),a=Number(t);if(!Number.isSafeInteger(o)||!Number.isSafeInteger(a)||o<1||a<1||o>4096||a>4096||Math.max(o,a)/Math.min(o,a)>3||o%16!==0||a%16!==0)throw n("--size must use positive dimensions up to 4096px, a maximum 3:1 aspect ratio, and multiples of 16.")}function g(e,i){const t=e.join(" ").trim();if(t.length===0)throw n(`A prompt is required for ${i}.`);return t}function x(e,i){const t=r(e,i);if(t===void 0)throw n(`Missing required option --${i}.`);return t}function d(e,i,t){if(e!==void 0&&e.length>i)throw n(`${t} must not exceed ${i} characters.`)}function w(e,i){const t=r(e,i);if(t!==void 0){if(!/^\d+$/u.test(t)||!Number.isSafeInteger(Number(t)))throw n(`--${i} must be an integer.`);return Number(t)}}function b(e,i){const t=r(e,i);if(t===void 0)return;const o=Number(t);if(!Number.isFinite(o))throw n(`--${i} must be a finite number.`);return o}function r(e,i){const t=e.get(i);return typeof t=="string"&&t.trim().length>0?t.trim():void 0}function p(e,i){return e.get(i)===!0||e.get(i)==="true"}function n(e){return new I(l.INVALID_ARGUMENT,e,{category:"media",userMessage:e})}export{u as GATEWAY_MEDIA_LIMITS,M as SDK_BINARY_MEDIA_RESPONSE_BYTES,f as formatByteLimit,T as validateImageEditInputCount,q as validateImageEditTotalSize,O as validateMediaCommandOptions,A as validateUploadSize};
@@ -0,0 +1,28 @@
1
+ export type MediaArtifactKind = 'image' | 'speech' | 'transcription' | 'translation' | 'video';
2
+ export interface MediaBinary {
3
+ readonly bytes: Uint8Array;
4
+ readonly contentType?: string;
5
+ }
6
+ export interface GeneratedImage {
7
+ readonly base64?: string;
8
+ readonly url?: string;
9
+ readonly revisedPrompt?: string;
10
+ }
11
+ export interface VideoOperation {
12
+ readonly id: string;
13
+ readonly done: boolean;
14
+ readonly errorMessage?: string;
15
+ }
16
+ export interface MediaArtifactRequest {
17
+ readonly kind: MediaArtifactKind;
18
+ readonly source: string;
19
+ readonly extension: string;
20
+ /** Filename stem without extension; the artifact store appends extension. */
21
+ readonly out?: string;
22
+ readonly outDir?: string;
23
+ readonly force: boolean;
24
+ }
25
+ export interface StoredMediaArtifact {
26
+ readonly path: string;
27
+ readonly bytes: number;
28
+ }
File without changes
@@ -0,0 +1,9 @@
1
+ export interface MediaExecutionPolicy {
2
+ readonly videoPollIntervalMs: number;
3
+ readonly videoWaitTimeoutMs: number;
4
+ readonly downloadTimeoutMs: number;
5
+ }
6
+ type Environment = Readonly<Record<string, string | undefined>>;
7
+ /** CLI-owned local resource policy. It does not alter gateway or SDK contracts. */
8
+ export declare function resolveMediaExecutionPolicy(environment?: Environment): MediaExecutionPolicy;
9
+ export {};
@@ -0,0 +1 @@
1
+ import{CliError as E}from"../errors/cli-error.js";import{CLI_ERROR_CODES as I}from"../errors/error-codes.js";const O=5e3,n=1200*1e3,A=6e4;function M(t=process.env){const _=T(t,"LOTAGATE_VIDEO_POLL_INTERVAL_MS",O),o=T(t,"LOTAGATE_VIDEO_WAIT_TIMEOUT_MS",n);if(o<_)throw r("LOTAGATE_VIDEO_WAIT_TIMEOUT_MS must not be smaller than LOTAGATE_VIDEO_POLL_INTERVAL_MS.");return{videoPollIntervalMs:_,videoWaitTimeoutMs:o,downloadTimeoutMs:T(t,"LOTAGATE_MEDIA_DOWNLOAD_TIMEOUT_MS",A)}}function T(t,_,o){const e=t[_];if(e===void 0||e.trim().length===0)return o;if(!/^\d+$/u.test(e))throw r(`${_} must be a positive integer.`);const i=Number(e);if(!Number.isSafeInteger(i)||i<=0)throw r(`${_} must be a positive integer.`);return i}function r(t){return new E(I.CONFIG_SCHEMA_INVALID,t,{category:"config",userMessage:t})}export{M as resolveMediaExecutionPolicy};
@@ -0,0 +1,15 @@
1
+ import type { IntentKind } from '../intent/intent-contract.js';
2
+ export declare const MEMORY_KINDS: readonly ["fact", "preference", "decision", "constraint", "goal", "procedure", "episodic", "lesson"];
3
+ export type MemoryKind = typeof MEMORY_KINDS[number];
4
+ export interface MemoryKindDefinition {
5
+ readonly id: MemoryKind;
6
+ readonly description: string;
7
+ readonly captureSignals: readonly string[];
8
+ readonly intentKinds: readonly IntentKind[];
9
+ readonly retrievalRole: 'grounding' | 'behavior' | 'control' | 'planning' | 'workflow' | 'experience';
10
+ readonly freshness: 'stable' | 'latest' | 'expiring' | 'decaying';
11
+ readonly consolidationPolicy: 'merge' | 'supersede' | 'retain' | 'retain-on-conflict';
12
+ }
13
+ export declare const MEMORY_KIND_DEFINITIONS: readonly MemoryKindDefinition[];
14
+ export declare function isMemoryKind(value: unknown): value is MemoryKind;
15
+ export declare function memoryKindDefinition(kind: MemoryKind): MemoryKindDefinition;
@@ -0,0 +1 @@
1
+ const o=["fact","preference","decision","constraint","goal","procedure","episodic","lesson"],i=[{id:"fact",description:"A stable declarative fact about the user, project, or environment.",captureSignals:["is","uses","has","located"],intentKinds:["answer","research","change","automation"],retrievalRole:"grounding",freshness:"stable",consolidationPolicy:"retain-on-conflict"},{id:"preference",description:"A user preference about how the agent should behave or communicate.",captureSignals:["prefer","always","do not","style"],intentKinds:["answer","research"],retrievalRole:"behavior",freshness:"latest",consolidationPolicy:"supersede"},{id:"decision",description:"An accepted choice and its rationale that can be superseded later.",captureSignals:["decided","choose","approved","will use"],intentKinds:["answer","research","change","automation"],retrievalRole:"control",freshness:"latest",consolidationPolicy:"supersede"},{id:"constraint",description:"An active rule describing what the agent must or must not do.",captureSignals:["must","must not","required","never"],intentKinds:["change","automation"],retrievalRole:"control",freshness:"stable",consolidationPolicy:"retain-on-conflict"},{id:"goal",description:"A durable future objective that is distinct from one running session goal.",captureSignals:["want to","goal","plan to","target"],intentKinds:["change","automation"],retrievalRole:"planning",freshness:"expiring",consolidationPolicy:"supersede"},{id:"procedure",description:"A reusable workflow or method for accomplishing an operation.",captureSignals:["step","workflow","run","process"],intentKinds:["change","automation"],retrievalRole:"workflow",freshness:"latest",consolidationPolicy:"supersede"},{id:"episodic",description:"A bounded past event, outcome, or failure with temporal context.",captureSignals:["completed","failed","happened","outcome"],intentKinds:["research","change","automation"],retrievalRole:"experience",freshness:"decaying",consolidationPolicy:"retain"},{id:"lesson",description:"A generalizable lesson distilled from one or more past experiences.",captureSignals:["learned","lesson","avoid","because"],intentKinds:["research","change","automation"],retrievalRole:"experience",freshness:"decaying",consolidationPolicy:"merge"}];function t(e){return typeof e=="string"&&o.includes(e)}function r(e){return i.find(n=>n.id===e)}export{o as MEMORY_KINDS,i as MEMORY_KIND_DEFINITIONS,t as isMemoryKind,r as memoryKindDefinition};
@@ -0,0 +1,3 @@
1
+ import type { IntentKind } from '../intent/intent-contract.js';
2
+ import { type MemoryKind } from './memory-kinds.js';
3
+ export declare function preferredMemoryKinds(intentKind: IntentKind | undefined): readonly MemoryKind[] | undefined;
@@ -0,0 +1 @@
1
+ import{MEMORY_KIND_DEFINITIONS as n}from"./memory-kinds.js";function i(r){return r===void 0?void 0:n.filter(e=>e.intentKinds.includes(r)).map(e=>e.id)}export{i as preferredMemoryKinds};
@@ -0,0 +1,33 @@
1
+ import type { MemoryKind } from './memory-kinds.js';
2
+ import type { MemoryRecord } from './memory.js';
3
+ export interface MemorySearchQuery {
4
+ readonly text: string;
5
+ readonly maximum: number;
6
+ readonly preferredKinds?: readonly MemoryKind[];
7
+ }
8
+ export interface MemorySearchHit {
9
+ readonly record: MemoryRecord;
10
+ readonly lexicalScore: number;
11
+ readonly rank: number;
12
+ }
13
+ export interface MemorySemanticHit {
14
+ readonly record: MemoryRecord;
15
+ readonly similarity: number;
16
+ readonly rank: number;
17
+ }
18
+ export interface MemorySearchDocument {
19
+ readonly id: string;
20
+ readonly termFrequency: Readonly<Record<string, number>>;
21
+ readonly length: number;
22
+ }
23
+ export interface MemorySearchIndex {
24
+ readonly documents: Readonly<Record<string, MemorySearchDocument>>;
25
+ readonly postings: Readonly<Record<string, readonly string[]>>;
26
+ readonly documentFrequency: Readonly<Record<string, number>>;
27
+ readonly averageDocumentLength: number;
28
+ }
29
+ export declare function buildMemorySearchIndex(records: readonly MemoryRecord[]): MemorySearchIndex;
30
+ export declare function searchMemoryIndex(recordsById: Readonly<Record<string, MemoryRecord>>, index: MemorySearchIndex, query: MemorySearchQuery): readonly MemorySearchHit[];
31
+ export declare function normalizeSearchText(value: string): string;
32
+ export declare function uniqueTokens(value: string): readonly string[];
33
+ export declare function isMemoryRetrievable(record: MemoryRecord, now?: number): boolean;