@mcoda/mswarm 0.1.57 → 0.1.61

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 (250) hide show
  1. package/README.md +19 -0
  2. package/dist/codali-executor.d.ts +278 -0
  3. package/dist/codali-executor.d.ts.map +1 -0
  4. package/dist/codali-executor.js +243 -0
  5. package/dist/codali-executor.js.map +1 -0
  6. package/dist/runtime.d.ts +46 -1
  7. package/dist/runtime.d.ts.map +1 -1
  8. package/dist/runtime.js +298 -30
  9. package/dist/runtime.js.map +1 -1
  10. package/dist/server.d.ts.map +1 -1
  11. package/dist/server.js +66 -1
  12. package/dist/server.js.map +1 -1
  13. package/dist/vendor/codali/agents/AgentProtocol.d.ts +287 -0
  14. package/dist/vendor/codali/agents/AgentProtocol.d.ts.map +1 -0
  15. package/dist/vendor/codali/agents/AgentProtocol.js +365 -0
  16. package/dist/vendor/codali/agents/AgentResolver.d.ts +23 -0
  17. package/dist/vendor/codali/agents/AgentResolver.d.ts.map +1 -0
  18. package/dist/vendor/codali/agents/AgentResolver.js +77 -0
  19. package/dist/vendor/codali/agents/PhaseAgentSelector.d.ts +23 -0
  20. package/dist/vendor/codali/agents/PhaseAgentSelector.d.ts.map +1 -0
  21. package/dist/vendor/codali/agents/PhaseAgentSelector.js +287 -0
  22. package/dist/vendor/codali/cli/EvalCommand.d.ts +37 -0
  23. package/dist/vendor/codali/cli/EvalCommand.d.ts.map +1 -0
  24. package/dist/vendor/codali/cli/EvalCommand.js +333 -0
  25. package/dist/vendor/codali/cli/FeedbackCommand.d.ts +22 -0
  26. package/dist/vendor/codali/cli/FeedbackCommand.d.ts.map +1 -0
  27. package/dist/vendor/codali/cli/FeedbackCommand.js +163 -0
  28. package/dist/vendor/codali/cli/RunCommand.d.ts +78 -0
  29. package/dist/vendor/codali/cli/RunCommand.d.ts.map +1 -0
  30. package/dist/vendor/codali/cli/RunCommand.js +2261 -0
  31. package/dist/vendor/codali/cli.d.ts +3 -0
  32. package/dist/vendor/codali/cli.d.ts.map +1 -0
  33. package/dist/vendor/codali/cli.js +109 -0
  34. package/dist/vendor/codali/cognitive/ArchitectPlanner.d.ts +107 -0
  35. package/dist/vendor/codali/cognitive/ArchitectPlanner.d.ts.map +1 -0
  36. package/dist/vendor/codali/cognitive/ArchitectPlanner.js +1726 -0
  37. package/dist/vendor/codali/cognitive/BuilderOutputParser.d.ts +25 -0
  38. package/dist/vendor/codali/cognitive/BuilderOutputParser.d.ts.map +1 -0
  39. package/dist/vendor/codali/cognitive/BuilderOutputParser.js +164 -0
  40. package/dist/vendor/codali/cognitive/BuilderRunner.d.ts +76 -0
  41. package/dist/vendor/codali/cognitive/BuilderRunner.d.ts.map +1 -0
  42. package/dist/vendor/codali/cognitive/BuilderRunner.js +1159 -0
  43. package/dist/vendor/codali/cognitive/ContextAssembler.d.ts +91 -0
  44. package/dist/vendor/codali/cognitive/ContextAssembler.d.ts.map +1 -0
  45. package/dist/vendor/codali/cognitive/ContextAssembler.js +4547 -0
  46. package/dist/vendor/codali/cognitive/ContextBudget.d.ts +19 -0
  47. package/dist/vendor/codali/cognitive/ContextBudget.d.ts.map +1 -0
  48. package/dist/vendor/codali/cognitive/ContextBudget.js +35 -0
  49. package/dist/vendor/codali/cognitive/ContextFileLoader.d.ts +30 -0
  50. package/dist/vendor/codali/cognitive/ContextFileLoader.d.ts.map +1 -0
  51. package/dist/vendor/codali/cognitive/ContextFileLoader.js +307 -0
  52. package/dist/vendor/codali/cognitive/ContextManager.d.ts +47 -0
  53. package/dist/vendor/codali/cognitive/ContextManager.d.ts.map +1 -0
  54. package/dist/vendor/codali/cognitive/ContextManager.js +272 -0
  55. package/dist/vendor/codali/cognitive/ContextRedactor.d.ts +18 -0
  56. package/dist/vendor/codali/cognitive/ContextRedactor.d.ts.map +1 -0
  57. package/dist/vendor/codali/cognitive/ContextRedactor.js +53 -0
  58. package/dist/vendor/codali/cognitive/ContextSelector.d.ts +22 -0
  59. package/dist/vendor/codali/cognitive/ContextSelector.d.ts.map +1 -0
  60. package/dist/vendor/codali/cognitive/ContextSelector.js +431 -0
  61. package/dist/vendor/codali/cognitive/ContextSerializer.d.ts +8 -0
  62. package/dist/vendor/codali/cognitive/ContextSerializer.d.ts.map +1 -0
  63. package/dist/vendor/codali/cognitive/ContextSerializer.js +882 -0
  64. package/dist/vendor/codali/cognitive/ContextStore.d.ts +27 -0
  65. package/dist/vendor/codali/cognitive/ContextStore.d.ts.map +1 -0
  66. package/dist/vendor/codali/cognitive/ContextStore.js +79 -0
  67. package/dist/vendor/codali/cognitive/ContextSummarizer.d.ts +16 -0
  68. package/dist/vendor/codali/cognitive/ContextSummarizer.d.ts.map +1 -0
  69. package/dist/vendor/codali/cognitive/ContextSummarizer.js +45 -0
  70. package/dist/vendor/codali/cognitive/CostEstimator.d.ts +31 -0
  71. package/dist/vendor/codali/cognitive/CostEstimator.d.ts.map +1 -0
  72. package/dist/vendor/codali/cognitive/CostEstimator.js +66 -0
  73. package/dist/vendor/codali/cognitive/CriticEvaluator.d.ts +32 -0
  74. package/dist/vendor/codali/cognitive/CriticEvaluator.d.ts.map +1 -0
  75. package/dist/vendor/codali/cognitive/CriticEvaluator.js +297 -0
  76. package/dist/vendor/codali/cognitive/EvidenceGate.d.ts +9 -0
  77. package/dist/vendor/codali/cognitive/EvidenceGate.d.ts.map +1 -0
  78. package/dist/vendor/codali/cognitive/EvidenceGate.js +75 -0
  79. package/dist/vendor/codali/cognitive/GoldenExampleIndexer.d.ts +12 -0
  80. package/dist/vendor/codali/cognitive/GoldenExampleIndexer.d.ts.map +1 -0
  81. package/dist/vendor/codali/cognitive/GoldenExampleIndexer.js +34 -0
  82. package/dist/vendor/codali/cognitive/GoldenSetStore.d.ts +33 -0
  83. package/dist/vendor/codali/cognitive/GoldenSetStore.d.ts.map +1 -0
  84. package/dist/vendor/codali/cognitive/GoldenSetStore.js +159 -0
  85. package/dist/vendor/codali/cognitive/IntentSignals.d.ts +7 -0
  86. package/dist/vendor/codali/cognitive/IntentSignals.d.ts.map +1 -0
  87. package/dist/vendor/codali/cognitive/IntentSignals.js +285 -0
  88. package/dist/vendor/codali/cognitive/LearningGovernance.d.ts +100 -0
  89. package/dist/vendor/codali/cognitive/LearningGovernance.d.ts.map +1 -0
  90. package/dist/vendor/codali/cognitive/LearningGovernance.js +276 -0
  91. package/dist/vendor/codali/cognitive/MemoryWriteback.d.ts +64 -0
  92. package/dist/vendor/codali/cognitive/MemoryWriteback.d.ts.map +1 -0
  93. package/dist/vendor/codali/cognitive/MemoryWriteback.js +287 -0
  94. package/dist/vendor/codali/cognitive/PatchApplier.d.ts +49 -0
  95. package/dist/vendor/codali/cognitive/PatchApplier.d.ts.map +1 -0
  96. package/dist/vendor/codali/cognitive/PatchApplier.js +199 -0
  97. package/dist/vendor/codali/cognitive/PatchInterpreter.d.ts +35 -0
  98. package/dist/vendor/codali/cognitive/PatchInterpreter.d.ts.map +1 -0
  99. package/dist/vendor/codali/cognitive/PatchInterpreter.js +100 -0
  100. package/dist/vendor/codali/cognitive/PatchOutputNormalizer.d.ts +7 -0
  101. package/dist/vendor/codali/cognitive/PatchOutputNormalizer.d.ts.map +1 -0
  102. package/dist/vendor/codali/cognitive/PatchOutputNormalizer.js +59 -0
  103. package/dist/vendor/codali/cognitive/PostMortemAnalyzer.d.ts +17 -0
  104. package/dist/vendor/codali/cognitive/PostMortemAnalyzer.d.ts.map +1 -0
  105. package/dist/vendor/codali/cognitive/PostMortemAnalyzer.js +131 -0
  106. package/dist/vendor/codali/cognitive/PreferenceExtraction.d.ts +3 -0
  107. package/dist/vendor/codali/cognitive/PreferenceExtraction.d.ts.map +1 -0
  108. package/dist/vendor/codali/cognitive/PreferenceExtraction.js +85 -0
  109. package/dist/vendor/codali/cognitive/Prompts.d.ts +15 -0
  110. package/dist/vendor/codali/cognitive/Prompts.d.ts.map +1 -0
  111. package/dist/vendor/codali/cognitive/Prompts.js +326 -0
  112. package/dist/vendor/codali/cognitive/ProviderRouting.d.ts +16 -0
  113. package/dist/vendor/codali/cognitive/ProviderRouting.d.ts.map +1 -0
  114. package/dist/vendor/codali/cognitive/ProviderRouting.js +24 -0
  115. package/dist/vendor/codali/cognitive/QueryExtraction.d.ts +12 -0
  116. package/dist/vendor/codali/cognitive/QueryExtraction.d.ts.map +1 -0
  117. package/dist/vendor/codali/cognitive/QueryExtraction.js +262 -0
  118. package/dist/vendor/codali/cognitive/RunHistoryIndexer.d.ts +13 -0
  119. package/dist/vendor/codali/cognitive/RunHistoryIndexer.d.ts.map +1 -0
  120. package/dist/vendor/codali/cognitive/RunHistoryIndexer.js +125 -0
  121. package/dist/vendor/codali/cognitive/SmartPipeline.d.ts +92 -0
  122. package/dist/vendor/codali/cognitive/SmartPipeline.d.ts.map +1 -0
  123. package/dist/vendor/codali/cognitive/SmartPipeline.js +4804 -0
  124. package/dist/vendor/codali/cognitive/Types.d.ts +474 -0
  125. package/dist/vendor/codali/cognitive/Types.d.ts.map +1 -0
  126. package/dist/vendor/codali/cognitive/Types.js +7 -0
  127. package/dist/vendor/codali/cognitive/ValidationRunner.d.ts +57 -0
  128. package/dist/vendor/codali/cognitive/ValidationRunner.d.ts.map +1 -0
  129. package/dist/vendor/codali/cognitive/ValidationRunner.js +515 -0
  130. package/dist/vendor/codali/config/Config.d.ts +249 -0
  131. package/dist/vendor/codali/config/Config.d.ts.map +1 -0
  132. package/dist/vendor/codali/config/Config.js +200 -0
  133. package/dist/vendor/codali/config/ConfigLoader.d.ts +56 -0
  134. package/dist/vendor/codali/config/ConfigLoader.d.ts.map +1 -0
  135. package/dist/vendor/codali/config/ConfigLoader.js +1246 -0
  136. package/dist/vendor/codali/docdex/DocdexClient.d.ts +158 -0
  137. package/dist/vendor/codali/docdex/DocdexClient.d.ts.map +1 -0
  138. package/dist/vendor/codali/docdex/DocdexClient.js +785 -0
  139. package/dist/vendor/codali/eval/EvalRunner.d.ts +35 -0
  140. package/dist/vendor/codali/eval/EvalRunner.d.ts.map +1 -0
  141. package/dist/vendor/codali/eval/EvalRunner.js +38 -0
  142. package/dist/vendor/codali/eval/EvalTaskExecutor.d.ts +81 -0
  143. package/dist/vendor/codali/eval/EvalTaskExecutor.d.ts.map +1 -0
  144. package/dist/vendor/codali/eval/EvalTaskExecutor.js +371 -0
  145. package/dist/vendor/codali/eval/GateEvaluator.d.ts +31 -0
  146. package/dist/vendor/codali/eval/GateEvaluator.d.ts.map +1 -0
  147. package/dist/vendor/codali/eval/GateEvaluator.js +134 -0
  148. package/dist/vendor/codali/eval/MetricTypes.d.ts +28 -0
  149. package/dist/vendor/codali/eval/MetricTypes.d.ts.map +1 -0
  150. package/dist/vendor/codali/eval/MetricTypes.js +1 -0
  151. package/dist/vendor/codali/eval/MetricsAggregator.d.ts +4 -0
  152. package/dist/vendor/codali/eval/MetricsAggregator.d.ts.map +1 -0
  153. package/dist/vendor/codali/eval/MetricsAggregator.js +97 -0
  154. package/dist/vendor/codali/eval/RegressionComparator.d.ts +29 -0
  155. package/dist/vendor/codali/eval/RegressionComparator.d.ts.map +1 -0
  156. package/dist/vendor/codali/eval/RegressionComparator.js +155 -0
  157. package/dist/vendor/codali/eval/ReportInputAdapter.d.ts +52 -0
  158. package/dist/vendor/codali/eval/ReportInputAdapter.d.ts.map +1 -0
  159. package/dist/vendor/codali/eval/ReportInputAdapter.js +229 -0
  160. package/dist/vendor/codali/eval/ReportSerializer.d.ts +32 -0
  161. package/dist/vendor/codali/eval/ReportSerializer.d.ts.map +1 -0
  162. package/dist/vendor/codali/eval/ReportSerializer.js +33 -0
  163. package/dist/vendor/codali/eval/ReportStore.d.ts +18 -0
  164. package/dist/vendor/codali/eval/ReportStore.d.ts.map +1 -0
  165. package/dist/vendor/codali/eval/ReportStore.js +96 -0
  166. package/dist/vendor/codali/eval/SuiteLoader.d.ts +12 -0
  167. package/dist/vendor/codali/eval/SuiteLoader.d.ts.map +1 -0
  168. package/dist/vendor/codali/eval/SuiteLoader.js +51 -0
  169. package/dist/vendor/codali/eval/SuiteSchema.d.ts +56 -0
  170. package/dist/vendor/codali/eval/SuiteSchema.d.ts.map +1 -0
  171. package/dist/vendor/codali/eval/SuiteSchema.js +357 -0
  172. package/dist/vendor/codali/index.d.ts +11 -0
  173. package/dist/vendor/codali/index.d.ts.map +1 -0
  174. package/dist/vendor/codali/index.js +5 -0
  175. package/dist/vendor/codali/providers/CodexCliProvider.d.ts +8 -0
  176. package/dist/vendor/codali/providers/CodexCliProvider.d.ts.map +1 -0
  177. package/dist/vendor/codali/providers/CodexCliProvider.js +282 -0
  178. package/dist/vendor/codali/providers/OllamaRemoteProvider.d.ts +8 -0
  179. package/dist/vendor/codali/providers/OllamaRemoteProvider.d.ts.map +1 -0
  180. package/dist/vendor/codali/providers/OllamaRemoteProvider.js +300 -0
  181. package/dist/vendor/codali/providers/OpenAiCompatibleProvider.d.ts +8 -0
  182. package/dist/vendor/codali/providers/OpenAiCompatibleProvider.d.ts.map +1 -0
  183. package/dist/vendor/codali/providers/OpenAiCompatibleProvider.js +192 -0
  184. package/dist/vendor/codali/providers/ProviderRegistry.d.ts +12 -0
  185. package/dist/vendor/codali/providers/ProviderRegistry.d.ts.map +1 -0
  186. package/dist/vendor/codali/providers/ProviderRegistry.js +28 -0
  187. package/dist/vendor/codali/providers/ProviderTypes.d.ts +81 -0
  188. package/dist/vendor/codali/providers/ProviderTypes.d.ts.map +1 -0
  189. package/dist/vendor/codali/providers/ProviderTypes.js +1 -0
  190. package/dist/vendor/codali/runtime/CodaliRuntime.d.ts +189 -0
  191. package/dist/vendor/codali/runtime/CodaliRuntime.d.ts.map +1 -0
  192. package/dist/vendor/codali/runtime/CodaliRuntime.js +1435 -0
  193. package/dist/vendor/codali/runtime/DeepInvestigationErrors.d.ts +39 -0
  194. package/dist/vendor/codali/runtime/DeepInvestigationErrors.d.ts.map +1 -0
  195. package/dist/vendor/codali/runtime/DeepInvestigationErrors.js +57 -0
  196. package/dist/vendor/codali/runtime/RunContext.d.ts +27 -0
  197. package/dist/vendor/codali/runtime/RunContext.d.ts.map +1 -0
  198. package/dist/vendor/codali/runtime/RunContext.js +51 -0
  199. package/dist/vendor/codali/runtime/RunLogQuery.d.ts +48 -0
  200. package/dist/vendor/codali/runtime/RunLogQuery.d.ts.map +1 -0
  201. package/dist/vendor/codali/runtime/RunLogQuery.js +36 -0
  202. package/dist/vendor/codali/runtime/RunLogReader.d.ts +19 -0
  203. package/dist/vendor/codali/runtime/RunLogReader.d.ts.map +1 -0
  204. package/dist/vendor/codali/runtime/RunLogReader.js +361 -0
  205. package/dist/vendor/codali/runtime/RunLogger.d.ts +71 -0
  206. package/dist/vendor/codali/runtime/RunLogger.d.ts.map +1 -0
  207. package/dist/vendor/codali/runtime/RunLogger.js +100 -0
  208. package/dist/vendor/codali/runtime/RunTelemetryTypes.d.ts +117 -0
  209. package/dist/vendor/codali/runtime/RunTelemetryTypes.d.ts.map +1 -0
  210. package/dist/vendor/codali/runtime/RunTelemetryTypes.js +299 -0
  211. package/dist/vendor/codali/runtime/Runner.d.ts +66 -0
  212. package/dist/vendor/codali/runtime/Runner.d.ts.map +1 -0
  213. package/dist/vendor/codali/runtime/Runner.js +215 -0
  214. package/dist/vendor/codali/runtime/StoragePaths.d.ts +3 -0
  215. package/dist/vendor/codali/runtime/StoragePaths.d.ts.map +1 -0
  216. package/dist/vendor/codali/runtime/StoragePaths.js +19 -0
  217. package/dist/vendor/codali/runtime/WorkspaceLock.d.ts +30 -0
  218. package/dist/vendor/codali/runtime/WorkspaceLock.d.ts.map +1 -0
  219. package/dist/vendor/codali/runtime/WorkspaceLock.js +141 -0
  220. package/dist/vendor/codali/session/InstructionLoader.d.ts +14 -0
  221. package/dist/vendor/codali/session/InstructionLoader.d.ts.map +1 -0
  222. package/dist/vendor/codali/session/InstructionLoader.js +107 -0
  223. package/dist/vendor/codali/session/SessionStore.d.ts +81 -0
  224. package/dist/vendor/codali/session/SessionStore.d.ts.map +1 -0
  225. package/dist/vendor/codali/session/SessionStore.js +244 -0
  226. package/dist/vendor/codali/subagents/SubagentOrchestrator.d.ts +68 -0
  227. package/dist/vendor/codali/subagents/SubagentOrchestrator.d.ts.map +1 -0
  228. package/dist/vendor/codali/subagents/SubagentOrchestrator.js +150 -0
  229. package/dist/vendor/codali/tools/ToolRegistry.d.ts +9 -0
  230. package/dist/vendor/codali/tools/ToolRegistry.d.ts.map +1 -0
  231. package/dist/vendor/codali/tools/ToolRegistry.js +293 -0
  232. package/dist/vendor/codali/tools/ToolTypes.d.ts +66 -0
  233. package/dist/vendor/codali/tools/ToolTypes.d.ts.map +1 -0
  234. package/dist/vendor/codali/tools/ToolTypes.js +40 -0
  235. package/dist/vendor/codali/tools/diff/DiffTool.d.ts +3 -0
  236. package/dist/vendor/codali/tools/diff/DiffTool.d.ts.map +1 -0
  237. package/dist/vendor/codali/tools/diff/DiffTool.js +34 -0
  238. package/dist/vendor/codali/tools/docdex/DocdexTools.d.ts +4 -0
  239. package/dist/vendor/codali/tools/docdex/DocdexTools.d.ts.map +1 -0
  240. package/dist/vendor/codali/tools/docdex/DocdexTools.js +490 -0
  241. package/dist/vendor/codali/tools/filesystem/FileTools.d.ts +3 -0
  242. package/dist/vendor/codali/tools/filesystem/FileTools.d.ts.map +1 -0
  243. package/dist/vendor/codali/tools/filesystem/FileTools.js +141 -0
  244. package/dist/vendor/codali/tools/search/SearchTool.d.ts +3 -0
  245. package/dist/vendor/codali/tools/search/SearchTool.d.ts.map +1 -0
  246. package/dist/vendor/codali/tools/search/SearchTool.js +46 -0
  247. package/dist/vendor/codali/tools/shell/ShellTool.d.ts +3 -0
  248. package/dist/vendor/codali/tools/shell/ShellTool.d.ts.map +1 -0
  249. package/dist/vendor/codali/tools/shell/ShellTool.js +104 -0
  250. package/package.json +5 -3
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export declare const runCli: (argv?: string[]) => Promise<void>;
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAkEA,eAAO,MAAM,MAAM,GAAU,OAAM,MAAM,EAA0B,KAAG,OAAO,CAAC,IAAI,CAoCjF,CAAC"}
@@ -0,0 +1,109 @@
1
+ #!/usr/bin/env node
2
+ import fs from "node:fs";
3
+ import path from "node:path";
4
+ import { fileURLToPath } from "node:url";
5
+ import { RunCommand } from "./cli/RunCommand.js";
6
+ import { FeedbackCommand } from "./cli/FeedbackCommand.js";
7
+ import { EvalCommand } from "./cli/EvalCommand.js";
8
+ const HELP_TEXT = "Usage: codali run [--workspace-root <path>] --agent <slug> [--task <file>]\n" +
9
+ " or: codali run [--workspace-root <path>] --provider <name> --model <model> [--task <file>]\n" +
10
+ " or: codali <fix|review|explain|test> [run options] [--task <file>]\n" +
11
+ " or: codali eval --suite <path> [eval options]\n" +
12
+ " or: codali learn --file <path/to/file> [--confirm <dedupe_key> ...]\n" +
13
+ " or: codali learn --confirm <dedupe_key> [--confirm <dedupe_key> ...]\n" +
14
+ "\n" +
15
+ "Commands:\n" +
16
+ " run Run a single task (advanced/general profile).\n" +
17
+ " fix Apply fix workflow profile (patch-focused output).\n" +
18
+ " review Apply review workflow profile (findings-focused output).\n" +
19
+ " explain Apply explain workflow profile (explanation-first output).\n" +
20
+ " test Apply test workflow profile (verification-first output).\n" +
21
+ " eval Run deterministic local evaluation suites and regression gates.\n" +
22
+ " learn Analyze user edits/reverts and govern candidate->enforced learning.\n" +
23
+ " doctor Print environment and install paths.\n" +
24
+ "\n" +
25
+ "Options:\n" +
26
+ " --help, -h Show help\n" +
27
+ " --version, -v Show version\n" +
28
+ " --smart Enable the cognitive pipeline (default)\n";
29
+ const resolveReal = (value) => {
30
+ try {
31
+ return fs.realpathSync(value);
32
+ }
33
+ catch {
34
+ return path.resolve(value);
35
+ }
36
+ };
37
+ const printDoctor = () => {
38
+ const scriptPath = process.argv[1] ?? "unknown";
39
+ const current = fileURLToPath(import.meta.url);
40
+ const resolvedScript = resolveReal(scriptPath);
41
+ const resolvedCurrent = resolveReal(current);
42
+ const binDir = path.dirname(resolvedScript);
43
+ const pkgRoot = path.resolve(resolvedCurrent, "..", "..");
44
+ const pkgJson = path.join(pkgRoot, "package.json");
45
+ const pathEntries = (process.env.PATH ?? "").split(path.delimiter).filter(Boolean);
46
+ const inPath = pathEntries.includes(binDir);
47
+ const lines = [
48
+ "codali doctor",
49
+ `Node: ${process.version}`,
50
+ `Platform: ${process.platform} ${process.arch}`,
51
+ `CLI Path: ${scriptPath}`,
52
+ `CLI Resolved: ${resolvedScript}`,
53
+ `Entry Resolved: ${resolvedCurrent}`,
54
+ `Bin Dir In PATH: ${inPath ? "yes" : "no"}`,
55
+ `Package Root: ${pkgRoot}`,
56
+ `Package.json: ${fs.existsSync(pkgJson) ? "found" : "missing"}`,
57
+ ];
58
+ // eslint-disable-next-line no-console
59
+ console.log(lines.join("\n"));
60
+ };
61
+ export const runCli = async (argv = process.argv.slice(2)) => {
62
+ if (argv.includes("--help") || argv.includes("-h") || argv.length === 0) {
63
+ // eslint-disable-next-line no-console
64
+ console.log(HELP_TEXT);
65
+ return;
66
+ }
67
+ const [command, ...rest] = argv;
68
+ if (command === "--version" || command === "-v" || command === "version") {
69
+ // Keep this lightweight for scaffold phase.
70
+ // eslint-disable-next-line no-console
71
+ console.log("dev");
72
+ return;
73
+ }
74
+ if (command === "doctor" || command === "--doctor") {
75
+ printDoctor();
76
+ return;
77
+ }
78
+ if (["run", "fix", "review", "explain", "test"].includes(command)) {
79
+ await RunCommand.run(["--command", command, ...rest]);
80
+ return;
81
+ }
82
+ if (command === "eval") {
83
+ await EvalCommand.run(rest);
84
+ return;
85
+ }
86
+ if (command === "learn") {
87
+ await FeedbackCommand.run(rest);
88
+ return;
89
+ }
90
+ throw new Error(HELP_TEXT);
91
+ };
92
+ const isMain = (() => {
93
+ const scriptPath = process.argv[1];
94
+ if (!scriptPath)
95
+ return false;
96
+ const current = fileURLToPath(import.meta.url);
97
+ return resolveReal(scriptPath) === resolveReal(current);
98
+ })();
99
+ if (isMain) {
100
+ runCli().catch((error) => {
101
+ // eslint-disable-next-line no-console
102
+ console.error(error instanceof Error ? error.message : String(error));
103
+ const maybeWithCode = error;
104
+ process.exitCode =
105
+ typeof maybeWithCode.exitCode === "number" && Number.isInteger(maybeWithCode.exitCode)
106
+ ? maybeWithCode.exitCode
107
+ : 1;
108
+ });
109
+ }
@@ -0,0 +1,107 @@
1
+ import type { AgentEvent, Provider, ProviderResponseFormat } from "../providers/ProviderTypes.js";
2
+ import type { RunLogger } from "../runtime/RunLogger.js";
3
+ import type { ContextBundle, Plan } from "./Types.js";
4
+ import type { ContextManager } from "./ContextManager.js";
5
+ import { type AgentRequest } from "../agents/AgentProtocol.js";
6
+ export declare const ARCHITECT_WARNING_NON_DSL = "architect_output_unstructured_plaintext";
7
+ export declare const ARCHITECT_WARNING_CONTAINS_THINK = "architect_output_contains_think";
8
+ export declare const ARCHITECT_WARNING_CONTAINS_FENCE = "architect_output_contains_fence";
9
+ export declare const ARCHITECT_WARNING_MISSING_REQUIRED_SECTIONS = "architect_output_missing_required_sections";
10
+ export declare const ARCHITECT_WARNING_MULTIPLE_SECTION_BLOCKS = "architect_output_multiple_section_blocks";
11
+ export declare const ARCHITECT_WARNING_USED_JSON_FALLBACK = "architect_output_used_json_fallback";
12
+ export declare const ARCHITECT_WARNING_USED_PLAINTEXT_FALLBACK = "architect_output_used_plaintext_fallback";
13
+ export declare const ARCHITECT_WARNING_REPAIRED = "architect_output_repaired";
14
+ export declare class PlanHintValidationError extends Error {
15
+ readonly name = "PlanHintValidationError";
16
+ readonly code = "plan_hint_validation_failed";
17
+ readonly warnings: string[];
18
+ readonly issues: string[];
19
+ readonly parseError?: string;
20
+ constructor(input: {
21
+ message: string;
22
+ warnings: string[];
23
+ issues: string[];
24
+ parseError?: string;
25
+ });
26
+ }
27
+ export interface ArchitectPlannerOptions {
28
+ temperature?: number;
29
+ logger?: RunLogger;
30
+ contextManager?: ContextManager;
31
+ laneId?: string;
32
+ model?: string;
33
+ responseFormat?: ProviderResponseFormat;
34
+ planHint?: string;
35
+ instructionHint?: string;
36
+ validatePlanHint?: boolean;
37
+ validateOnly?: boolean;
38
+ stream?: boolean;
39
+ onEvent?: (event: AgentEvent) => void;
40
+ }
41
+ export interface ArchitectPlanResult {
42
+ plan: Plan;
43
+ request?: AgentRequest;
44
+ raw: string;
45
+ warnings: string[];
46
+ }
47
+ export interface ArchitectReviewResult {
48
+ status: "PASS" | "RETRY";
49
+ feedback: string[];
50
+ reasons: string[];
51
+ raw: string;
52
+ warnings: string[];
53
+ }
54
+ export declare class ArchitectPlanner {
55
+ private provider;
56
+ private temperature?;
57
+ private logger?;
58
+ private contextManager?;
59
+ private laneId?;
60
+ private model?;
61
+ private responseFormat?;
62
+ private planHint?;
63
+ private instructionHint?;
64
+ private validatePlanHint?;
65
+ private validateOnly?;
66
+ private stream?;
67
+ private onEvent?;
68
+ constructor(provider: Provider, options?: ArchitectPlannerOptions);
69
+ plan(context: ContextBundle, options?: {
70
+ contextManager?: ContextManager;
71
+ laneId?: string;
72
+ model?: string;
73
+ responseFormat?: ProviderResponseFormat;
74
+ planHint?: string;
75
+ instructionHint?: string;
76
+ stream?: boolean;
77
+ onEvent?: (event: AgentEvent) => void;
78
+ }): Promise<Plan>;
79
+ planWithRequest(context: ContextBundle, options?: {
80
+ contextManager?: ContextManager;
81
+ laneId?: string;
82
+ model?: string;
83
+ responseFormat?: ProviderResponseFormat;
84
+ planHint?: string;
85
+ instructionHint?: string;
86
+ validatePlanHint?: boolean;
87
+ validateOnly?: boolean;
88
+ stream?: boolean;
89
+ onEvent?: (event: AgentEvent) => void;
90
+ }): Promise<ArchitectPlanResult>;
91
+ reviewBuilderOutput(plan: Plan, builderOutput: string, context: ContextBundle, options?: {
92
+ contextManager?: ContextManager;
93
+ laneId?: string;
94
+ model?: string;
95
+ responseFormat?: ProviderResponseFormat;
96
+ stream?: boolean;
97
+ onEvent?: (event: AgentEvent) => void;
98
+ }): Promise<ArchitectReviewResult>;
99
+ validatePlanWithProvider(plan: Plan, context: ContextBundle, options?: {
100
+ contextManager?: ContextManager;
101
+ laneId?: string;
102
+ model?: string;
103
+ stream?: boolean;
104
+ onEvent?: (event: AgentEvent) => void;
105
+ }): Promise<ArchitectPlanResult>;
106
+ }
107
+ //# sourceMappingURL=ArchitectPlanner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArchitectPlanner.d.ts","sourceRoot":"","sources":["../../src/cognitive/ArchitectPlanner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EAER,sBAAsB,EACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAOtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAElF,eAAO,MAAM,yBAAyB,4CAA4C,CAAC;AACnF,eAAO,MAAM,gCAAgC,oCAAoC,CAAC;AAClF,eAAO,MAAM,gCAAgC,oCAAoC,CAAC;AAClF,eAAO,MAAM,2CAA2C,+CACV,CAAC;AAC/C,eAAO,MAAM,yCAAyC,6CACV,CAAC;AAC7C,eAAO,MAAM,oCAAoC,wCAAwC,CAAC;AAC1F,eAAO,MAAM,yCAAyC,6CACV,CAAC;AAC7C,eAAO,MAAM,0BAA0B,8BAA8B,CAAC;AAm7CtE,qBAAa,uBAAwB,SAAQ,KAAK;IAChD,QAAQ,CAAC,IAAI,6BAA6B;IAC1C,QAAQ,CAAC,IAAI,iCAAiC;IAC9C,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;gBAEjB,KAAK,EAAE;Q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