@mcoda/mswarm 0.1.56 → 0.1.60
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.
- package/README.md +20 -1
- package/dist/codali-executor.d.ts +266 -0
- package/dist/codali-executor.d.ts.map +1 -0
- package/dist/codali-executor.js +227 -0
- package/dist/codali-executor.js.map +1 -0
- package/dist/runtime.d.ts +47 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +248 -30
- package/dist/runtime.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +83 -3
- package/dist/server.js.map +1 -1
- package/dist/vendor/codali/agents/AgentProtocol.d.ts +287 -0
- package/dist/vendor/codali/agents/AgentProtocol.d.ts.map +1 -0
- package/dist/vendor/codali/agents/AgentProtocol.js +365 -0
- package/dist/vendor/codali/agents/AgentResolver.d.ts +23 -0
- package/dist/vendor/codali/agents/AgentResolver.d.ts.map +1 -0
- package/dist/vendor/codali/agents/AgentResolver.js +77 -0
- package/dist/vendor/codali/agents/PhaseAgentSelector.d.ts +23 -0
- package/dist/vendor/codali/agents/PhaseAgentSelector.d.ts.map +1 -0
- package/dist/vendor/codali/agents/PhaseAgentSelector.js +287 -0
- package/dist/vendor/codali/cli/EvalCommand.d.ts +37 -0
- package/dist/vendor/codali/cli/EvalCommand.d.ts.map +1 -0
- package/dist/vendor/codali/cli/EvalCommand.js +333 -0
- package/dist/vendor/codali/cli/FeedbackCommand.d.ts +22 -0
- package/dist/vendor/codali/cli/FeedbackCommand.d.ts.map +1 -0
- package/dist/vendor/codali/cli/FeedbackCommand.js +163 -0
- package/dist/vendor/codali/cli/RunCommand.d.ts +78 -0
- package/dist/vendor/codali/cli/RunCommand.d.ts.map +1 -0
- package/dist/vendor/codali/cli/RunCommand.js +2261 -0
- package/dist/vendor/codali/cli.d.ts +3 -0
- package/dist/vendor/codali/cli.d.ts.map +1 -0
- package/dist/vendor/codali/cli.js +109 -0
- package/dist/vendor/codali/cognitive/ArchitectPlanner.d.ts +107 -0
- package/dist/vendor/codali/cognitive/ArchitectPlanner.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ArchitectPlanner.js +1726 -0
- package/dist/vendor/codali/cognitive/BuilderOutputParser.d.ts +25 -0
- package/dist/vendor/codali/cognitive/BuilderOutputParser.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/BuilderOutputParser.js +164 -0
- package/dist/vendor/codali/cognitive/BuilderRunner.d.ts +76 -0
- package/dist/vendor/codali/cognitive/BuilderRunner.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/BuilderRunner.js +1159 -0
- package/dist/vendor/codali/cognitive/ContextAssembler.d.ts +91 -0
- package/dist/vendor/codali/cognitive/ContextAssembler.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ContextAssembler.js +4547 -0
- package/dist/vendor/codali/cognitive/ContextBudget.d.ts +19 -0
- package/dist/vendor/codali/cognitive/ContextBudget.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ContextBudget.js +35 -0
- package/dist/vendor/codali/cognitive/ContextFileLoader.d.ts +30 -0
- package/dist/vendor/codali/cognitive/ContextFileLoader.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ContextFileLoader.js +307 -0
- package/dist/vendor/codali/cognitive/ContextManager.d.ts +47 -0
- package/dist/vendor/codali/cognitive/ContextManager.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ContextManager.js +272 -0
- package/dist/vendor/codali/cognitive/ContextRedactor.d.ts +18 -0
- package/dist/vendor/codali/cognitive/ContextRedactor.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ContextRedactor.js +53 -0
- package/dist/vendor/codali/cognitive/ContextSelector.d.ts +22 -0
- package/dist/vendor/codali/cognitive/ContextSelector.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ContextSelector.js +431 -0
- package/dist/vendor/codali/cognitive/ContextSerializer.d.ts +8 -0
- package/dist/vendor/codali/cognitive/ContextSerializer.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ContextSerializer.js +882 -0
- package/dist/vendor/codali/cognitive/ContextStore.d.ts +27 -0
- package/dist/vendor/codali/cognitive/ContextStore.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ContextStore.js +79 -0
- package/dist/vendor/codali/cognitive/ContextSummarizer.d.ts +16 -0
- package/dist/vendor/codali/cognitive/ContextSummarizer.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ContextSummarizer.js +45 -0
- package/dist/vendor/codali/cognitive/CostEstimator.d.ts +31 -0
- package/dist/vendor/codali/cognitive/CostEstimator.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/CostEstimator.js +66 -0
- package/dist/vendor/codali/cognitive/CriticEvaluator.d.ts +32 -0
- package/dist/vendor/codali/cognitive/CriticEvaluator.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/CriticEvaluator.js +297 -0
- package/dist/vendor/codali/cognitive/EvidenceGate.d.ts +9 -0
- package/dist/vendor/codali/cognitive/EvidenceGate.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/EvidenceGate.js +75 -0
- package/dist/vendor/codali/cognitive/GoldenExampleIndexer.d.ts +12 -0
- package/dist/vendor/codali/cognitive/GoldenExampleIndexer.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/GoldenExampleIndexer.js +34 -0
- package/dist/vendor/codali/cognitive/GoldenSetStore.d.ts +33 -0
- package/dist/vendor/codali/cognitive/GoldenSetStore.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/GoldenSetStore.js +159 -0
- package/dist/vendor/codali/cognitive/IntentSignals.d.ts +7 -0
- package/dist/vendor/codali/cognitive/IntentSignals.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/IntentSignals.js +285 -0
- package/dist/vendor/codali/cognitive/LearningGovernance.d.ts +100 -0
- package/dist/vendor/codali/cognitive/LearningGovernance.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/LearningGovernance.js +276 -0
- package/dist/vendor/codali/cognitive/MemoryWriteback.d.ts +64 -0
- package/dist/vendor/codali/cognitive/MemoryWriteback.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/MemoryWriteback.js +287 -0
- package/dist/vendor/codali/cognitive/PatchApplier.d.ts +49 -0
- package/dist/vendor/codali/cognitive/PatchApplier.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/PatchApplier.js +199 -0
- package/dist/vendor/codali/cognitive/PatchInterpreter.d.ts +35 -0
- package/dist/vendor/codali/cognitive/PatchInterpreter.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/PatchInterpreter.js +100 -0
- package/dist/vendor/codali/cognitive/PatchOutputNormalizer.d.ts +7 -0
- package/dist/vendor/codali/cognitive/PatchOutputNormalizer.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/PatchOutputNormalizer.js +59 -0
- package/dist/vendor/codali/cognitive/PostMortemAnalyzer.d.ts +17 -0
- package/dist/vendor/codali/cognitive/PostMortemAnalyzer.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/PostMortemAnalyzer.js +131 -0
- package/dist/vendor/codali/cognitive/PreferenceExtraction.d.ts +3 -0
- package/dist/vendor/codali/cognitive/PreferenceExtraction.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/PreferenceExtraction.js +85 -0
- package/dist/vendor/codali/cognitive/Prompts.d.ts +15 -0
- package/dist/vendor/codali/cognitive/Prompts.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/Prompts.js +326 -0
- package/dist/vendor/codali/cognitive/ProviderRouting.d.ts +16 -0
- package/dist/vendor/codali/cognitive/ProviderRouting.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ProviderRouting.js +24 -0
- package/dist/vendor/codali/cognitive/QueryExtraction.d.ts +12 -0
- package/dist/vendor/codali/cognitive/QueryExtraction.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/QueryExtraction.js +262 -0
- package/dist/vendor/codali/cognitive/RunHistoryIndexer.d.ts +13 -0
- package/dist/vendor/codali/cognitive/RunHistoryIndexer.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/RunHistoryIndexer.js +125 -0
- package/dist/vendor/codali/cognitive/SmartPipeline.d.ts +92 -0
- package/dist/vendor/codali/cognitive/SmartPipeline.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/SmartPipeline.js +4804 -0
- package/dist/vendor/codali/cognitive/Types.d.ts +474 -0
- package/dist/vendor/codali/cognitive/Types.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/Types.js +7 -0
- package/dist/vendor/codali/cognitive/ValidationRunner.d.ts +57 -0
- package/dist/vendor/codali/cognitive/ValidationRunner.d.ts.map +1 -0
- package/dist/vendor/codali/cognitive/ValidationRunner.js +515 -0
- package/dist/vendor/codali/config/Config.d.ts +249 -0
- package/dist/vendor/codali/config/Config.d.ts.map +1 -0
- package/dist/vendor/codali/config/Config.js +200 -0
- package/dist/vendor/codali/config/ConfigLoader.d.ts +56 -0
- package/dist/vendor/codali/config/ConfigLoader.d.ts.map +1 -0
- package/dist/vendor/codali/config/ConfigLoader.js +1246 -0
- package/dist/vendor/codali/docdex/DocdexClient.d.ts +113 -0
- package/dist/vendor/codali/docdex/DocdexClient.d.ts.map +1 -0
- package/dist/vendor/codali/docdex/DocdexClient.js +524 -0
- package/dist/vendor/codali/eval/EvalRunner.d.ts +35 -0
- package/dist/vendor/codali/eval/EvalRunner.d.ts.map +1 -0
- package/dist/vendor/codali/eval/EvalRunner.js +38 -0
- package/dist/vendor/codali/eval/EvalTaskExecutor.d.ts +81 -0
- package/dist/vendor/codali/eval/EvalTaskExecutor.d.ts.map +1 -0
- package/dist/vendor/codali/eval/EvalTaskExecutor.js +371 -0
- package/dist/vendor/codali/eval/GateEvaluator.d.ts +31 -0
- package/dist/vendor/codali/eval/GateEvaluator.d.ts.map +1 -0
- package/dist/vendor/codali/eval/GateEvaluator.js +134 -0
- package/dist/vendor/codali/eval/MetricTypes.d.ts +28 -0
- package/dist/vendor/codali/eval/MetricTypes.d.ts.map +1 -0
- package/dist/vendor/codali/eval/MetricTypes.js +1 -0
- package/dist/vendor/codali/eval/MetricsAggregator.d.ts +4 -0
- package/dist/vendor/codali/eval/MetricsAggregator.d.ts.map +1 -0
- package/dist/vendor/codali/eval/MetricsAggregator.js +97 -0
- package/dist/vendor/codali/eval/RegressionComparator.d.ts +29 -0
- package/dist/vendor/codali/eval/RegressionComparator.d.ts.map +1 -0
- package/dist/vendor/codali/eval/RegressionComparator.js +155 -0
- package/dist/vendor/codali/eval/ReportInputAdapter.d.ts +52 -0
- package/dist/vendor/codali/eval/ReportInputAdapter.d.ts.map +1 -0
- package/dist/vendor/codali/eval/ReportInputAdapter.js +229 -0
- package/dist/vendor/codali/eval/ReportSerializer.d.ts +32 -0
- package/dist/vendor/codali/eval/ReportSerializer.d.ts.map +1 -0
- package/dist/vendor/codali/eval/ReportSerializer.js +33 -0
- package/dist/vendor/codali/eval/ReportStore.d.ts +18 -0
- package/dist/vendor/codali/eval/ReportStore.d.ts.map +1 -0
- package/dist/vendor/codali/eval/ReportStore.js +96 -0
- package/dist/vendor/codali/eval/SuiteLoader.d.ts +12 -0
- package/dist/vendor/codali/eval/SuiteLoader.d.ts.map +1 -0
- package/dist/vendor/codali/eval/SuiteLoader.js +51 -0
- package/dist/vendor/codali/eval/SuiteSchema.d.ts +56 -0
- package/dist/vendor/codali/eval/SuiteSchema.d.ts.map +1 -0
- package/dist/vendor/codali/eval/SuiteSchema.js +357 -0
- package/dist/vendor/codali/index.d.ts +11 -0
- package/dist/vendor/codali/index.d.ts.map +1 -0
- package/dist/vendor/codali/index.js +5 -0
- package/dist/vendor/codali/providers/CodexCliProvider.d.ts +8 -0
- package/dist/vendor/codali/providers/CodexCliProvider.d.ts.map +1 -0
- package/dist/vendor/codali/providers/CodexCliProvider.js +282 -0
- package/dist/vendor/codali/providers/OllamaRemoteProvider.d.ts +8 -0
- package/dist/vendor/codali/providers/OllamaRemoteProvider.d.ts.map +1 -0
- package/dist/vendor/codali/providers/OllamaRemoteProvider.js +300 -0
- package/dist/vendor/codali/providers/OpenAiCompatibleProvider.d.ts +8 -0
- package/dist/vendor/codali/providers/OpenAiCompatibleProvider.d.ts.map +1 -0
- package/dist/vendor/codali/providers/OpenAiCompatibleProvider.js +192 -0
- package/dist/vendor/codali/providers/ProviderRegistry.d.ts +12 -0
- package/dist/vendor/codali/providers/ProviderRegistry.d.ts.map +1 -0
- package/dist/vendor/codali/providers/ProviderRegistry.js +28 -0
- package/dist/vendor/codali/providers/ProviderTypes.d.ts +81 -0
- package/dist/vendor/codali/providers/ProviderTypes.d.ts.map +1 -0
- package/dist/vendor/codali/providers/ProviderTypes.js +1 -0
- package/dist/vendor/codali/runtime/CodaliRuntime.d.ts +183 -0
- package/dist/vendor/codali/runtime/CodaliRuntime.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/CodaliRuntime.js +1363 -0
- package/dist/vendor/codali/runtime/DeepInvestigationErrors.d.ts +39 -0
- package/dist/vendor/codali/runtime/DeepInvestigationErrors.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/DeepInvestigationErrors.js +57 -0
- package/dist/vendor/codali/runtime/RunContext.d.ts +27 -0
- package/dist/vendor/codali/runtime/RunContext.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/RunContext.js +51 -0
- package/dist/vendor/codali/runtime/RunLogQuery.d.ts +48 -0
- package/dist/vendor/codali/runtime/RunLogQuery.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/RunLogQuery.js +36 -0
- package/dist/vendor/codali/runtime/RunLogReader.d.ts +19 -0
- package/dist/vendor/codali/runtime/RunLogReader.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/RunLogReader.js +361 -0
- package/dist/vendor/codali/runtime/RunLogger.d.ts +71 -0
- package/dist/vendor/codali/runtime/RunLogger.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/RunLogger.js +100 -0
- package/dist/vendor/codali/runtime/RunTelemetryTypes.d.ts +117 -0
- package/dist/vendor/codali/runtime/RunTelemetryTypes.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/RunTelemetryTypes.js +299 -0
- package/dist/vendor/codali/runtime/Runner.d.ts +66 -0
- package/dist/vendor/codali/runtime/Runner.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/Runner.js +215 -0
- package/dist/vendor/codali/runtime/StoragePaths.d.ts +3 -0
- package/dist/vendor/codali/runtime/StoragePaths.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/StoragePaths.js +19 -0
- package/dist/vendor/codali/runtime/WorkspaceLock.d.ts +30 -0
- package/dist/vendor/codali/runtime/WorkspaceLock.d.ts.map +1 -0
- package/dist/vendor/codali/runtime/WorkspaceLock.js +141 -0
- package/dist/vendor/codali/session/InstructionLoader.d.ts +14 -0
- package/dist/vendor/codali/session/InstructionLoader.d.ts.map +1 -0
- package/dist/vendor/codali/session/InstructionLoader.js +107 -0
- package/dist/vendor/codali/session/SessionStore.d.ts +81 -0
- package/dist/vendor/codali/session/SessionStore.d.ts.map +1 -0
- package/dist/vendor/codali/session/SessionStore.js +244 -0
- package/dist/vendor/codali/subagents/SubagentOrchestrator.d.ts +68 -0
- package/dist/vendor/codali/subagents/SubagentOrchestrator.d.ts.map +1 -0
- package/dist/vendor/codali/subagents/SubagentOrchestrator.js +150 -0
- package/dist/vendor/codali/tools/ToolRegistry.d.ts +9 -0
- package/dist/vendor/codali/tools/ToolRegistry.d.ts.map +1 -0
- package/dist/vendor/codali/tools/ToolRegistry.js +263 -0
- package/dist/vendor/codali/tools/ToolTypes.d.ts +66 -0
- package/dist/vendor/codali/tools/ToolTypes.d.ts.map +1 -0
- package/dist/vendor/codali/tools/ToolTypes.js +32 -0
- package/dist/vendor/codali/tools/diff/DiffTool.d.ts +3 -0
- package/dist/vendor/codali/tools/diff/DiffTool.d.ts.map +1 -0
- package/dist/vendor/codali/tools/diff/DiffTool.js +34 -0
- package/dist/vendor/codali/tools/docdex/DocdexTools.d.ts +4 -0
- package/dist/vendor/codali/tools/docdex/DocdexTools.d.ts.map +1 -0
- package/dist/vendor/codali/tools/docdex/DocdexTools.js +453 -0
- package/dist/vendor/codali/tools/filesystem/FileTools.d.ts +3 -0
- package/dist/vendor/codali/tools/filesystem/FileTools.d.ts.map +1 -0
- package/dist/vendor/codali/tools/filesystem/FileTools.js +141 -0
- package/dist/vendor/codali/tools/search/SearchTool.d.ts +3 -0
- package/dist/vendor/codali/tools/search/SearchTool.d.ts.map +1 -0
- package/dist/vendor/codali/tools/search/SearchTool.js +46 -0
- package/dist/vendor/codali/tools/shell/ShellTool.d.ts +3 -0
- package/dist/vendor/codali/tools/shell/ShellTool.d.ts.map +1 -0
- package/dist/vendor/codali/tools/shell/ShellTool.js +104 -0
- package/package.json +5 -3
|
@@ -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,sB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