substrate-ai 0.2.21 → 0.2.23
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/dist/cli/index.js +15 -19
- package/dist/{event-bus-BMxhfxfT.js → errors-CswS7Mzg.js} +93 -715
- package/dist/event-bus-CAvDMst7.js +734 -0
- package/dist/index.js +2 -2
- package/dist/{run-BLIgARum.js → run-BaAws8IQ.js} +180 -39
- package/dist/run-BenC8JuM.js +7 -0
- package/package.json +1 -1
- package/dist/errors-BPqtzQ4U.js +0 -111
- package/dist/run-gmS6DsGT.js +0 -7
package/dist/cli/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { DatabaseWrapper, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, buildPipelineStatusOutput, createContextCompiler, createDispatcher, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, registerHealthCommand, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, runAnalysisPhase, runMigrations, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-
|
|
2
|
+
import { DatabaseWrapper, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, buildPipelineStatusOutput, createContextCompiler, createDispatcher, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, registerHealthCommand, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, runAnalysisPhase, runMigrations, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-BaAws8IQ.js";
|
|
3
3
|
import { createLogger, deepMask } from "../logger-D2fS2ccL.js";
|
|
4
|
-
import { AdapterRegistry,
|
|
4
|
+
import { AdapterRegistry, ConfigError, ConfigIncompatibleFormatError } from "../errors-CswS7Mzg.js";
|
|
5
5
|
import { CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, PartialSubstrateConfigSchema, SUPPORTED_CONFIG_FORMAT_VERSIONS, SubstrateConfigSchema, defaultConfigMigrator } from "../version-manager-impl-CZ6KF1Ds.js";
|
|
6
|
-
import {
|
|
6
|
+
import { createEventBus } from "../event-bus-CAvDMst7.js";
|
|
7
7
|
import { addTokenUsage, createDecision, createPipelineRun, getDecisionsByCategory, getDecisionsByPhaseForRun, getLatestRun, getTokenUsageSummary, listRequirements, updatePipelineRun } from "../decisions-Dq4cAA2L.js";
|
|
8
8
|
import { ESCALATION_DIAGNOSIS, EXPERIMENT_RESULT, OPERATIONAL_FINDING, STORY_METRICS, aggregateTokenUsageForRun, compareRunMetrics, getBaselineRunMetrics, getRunMetrics, getStoryMetricsForRun, incrementRunRestarts, listRunMetrics, tagRunAsBaseline } from "../operational-CnMlvWqc.js";
|
|
9
9
|
import { abortMerge, createWorktree, getConflictingFiles, getMergedFiles, getOrphanedWorktrees, performMerge, removeBranch, removeWorktree, simulateMerge, verifyGitVersion } from "../git-utils-CtmrZrHS.js";
|
|
@@ -207,8 +207,7 @@ function registerAdaptersCommand(program, version, registry) {
|
|
|
207
207
|
const adaptersCmd = program.command("adapters").description("Manage and inspect CLI agent adapters");
|
|
208
208
|
adaptersCmd.command("list").description("List all known adapters with availability status").option("--output-format <format>", "Output format: table (default) or json", "table").option("--verbose", "Show additional detail in output", false).action(async (opts) => {
|
|
209
209
|
const outputFormat = opts.outputFormat;
|
|
210
|
-
const
|
|
211
|
-
const report = await reg.discoverAndRegister();
|
|
210
|
+
const report = await registry.discoverAndRegister();
|
|
212
211
|
if (outputFormat === "json") {
|
|
213
212
|
const jsonData = report.results.map((r) => healthResultToJson(r.adapterId, r.displayName, r.healthResult));
|
|
214
213
|
const output = buildJsonOutput("substrate adapters list", jsonData, version);
|
|
@@ -231,8 +230,7 @@ function registerAdaptersCommand(program, version, registry) {
|
|
|
231
230
|
});
|
|
232
231
|
adaptersCmd.command("check").description("Run health checks on all adapters and verify headless mode").option("--output-format <format>", "Output format: table (default) or json", "table").option("--verbose", "Show additional detail including error messages", false).action(async (opts) => {
|
|
233
232
|
const outputFormat = opts.outputFormat;
|
|
234
|
-
const
|
|
235
|
-
const report = await reg.discoverAndRegister();
|
|
233
|
+
const report = await registry.discoverAndRegister();
|
|
236
234
|
const noneInstalled = report.results.length > 0 && report.results.every((r) => isNotInstalled(r.healthResult));
|
|
237
235
|
if (outputFormat === "json") {
|
|
238
236
|
const jsonData = report.results.map((r) => healthResultToJson(r.adapterId, r.displayName, r.healthResult));
|
|
@@ -641,7 +639,8 @@ async function runInitAction(options) {
|
|
|
641
639
|
if (outputFormat !== "json") process.stdout.write(` .substrate/ directory already exists at ${substrateDir}\n`);
|
|
642
640
|
}
|
|
643
641
|
if (outputFormat !== "json") process.stdout.write("\n Discovering installed AI agents...\n");
|
|
644
|
-
const registry = options.registry
|
|
642
|
+
const registry = options.registry;
|
|
643
|
+
if (!registry) throw new Error("AdapterRegistry is required — must be initialized at CLI startup");
|
|
645
644
|
let discoveryReport;
|
|
646
645
|
try {
|
|
647
646
|
discoveryReport = await registry.discoverAndRegister();
|
|
@@ -1381,11 +1380,10 @@ async function runFullPipelineFromPhase(options) {
|
|
|
1381
1380
|
}
|
|
1382
1381
|
const eventBus = createEventBus();
|
|
1383
1382
|
const contextCompiler = createContextCompiler({ db });
|
|
1384
|
-
|
|
1385
|
-
if (injectedRegistry === void 0) await adapterRegistry.discoverAndRegister();
|
|
1383
|
+
if (!injectedRegistry) throw new Error("AdapterRegistry is required — must be initialized at CLI startup");
|
|
1386
1384
|
const dispatcher = createDispatcher({
|
|
1387
1385
|
eventBus,
|
|
1388
|
-
adapterRegistry
|
|
1386
|
+
adapterRegistry: injectedRegistry
|
|
1389
1387
|
});
|
|
1390
1388
|
const phaseDeps = {
|
|
1391
1389
|
db,
|
|
@@ -2216,11 +2214,10 @@ async function runAmendAction(options) {
|
|
|
2216
2214
|
}
|
|
2217
2215
|
const eventBus = createEventBus();
|
|
2218
2216
|
const contextCompiler = createContextCompiler({ db });
|
|
2219
|
-
|
|
2220
|
-
if (injectedRegistry === void 0) await adapterRegistry.discoverAndRegister();
|
|
2217
|
+
if (!injectedRegistry) throw new Error("AdapterRegistry is required — must be initialized at CLI startup");
|
|
2221
2218
|
const dispatcher = createDispatcher({
|
|
2222
2219
|
eventBus,
|
|
2223
|
-
adapterRegistry
|
|
2220
|
+
adapterRegistry: injectedRegistry
|
|
2224
2221
|
});
|
|
2225
2222
|
const phaseDeps = {
|
|
2226
2223
|
db,
|
|
@@ -2845,7 +2842,7 @@ async function runSupervisorAction(options, deps = {}) {
|
|
|
2845
2842
|
const expDb = expDbWrapper.db;
|
|
2846
2843
|
const { runRunAction: runPipeline } = await import(
|
|
2847
2844
|
/* @vite-ignore */
|
|
2848
|
-
"../run-
|
|
2845
|
+
"../run-BenC8JuM.js"
|
|
2849
2846
|
);
|
|
2850
2847
|
const runStoryFn = async (opts) => {
|
|
2851
2848
|
const exitCode = await runPipeline({
|
|
@@ -6778,11 +6775,10 @@ async function runRetryEscalatedAction(options) {
|
|
|
6778
6775
|
});
|
|
6779
6776
|
const eventBus = createEventBus();
|
|
6780
6777
|
const contextCompiler = createContextCompiler({ db });
|
|
6781
|
-
|
|
6782
|
-
if (injectedRegistry === void 0) await adapterRegistry.discoverAndRegister();
|
|
6778
|
+
if (!injectedRegistry) throw new Error("AdapterRegistry is required — must be initialized at CLI startup");
|
|
6783
6779
|
const dispatcher = createDispatcher({
|
|
6784
6780
|
eventBus,
|
|
6785
|
-
adapterRegistry
|
|
6781
|
+
adapterRegistry: injectedRegistry
|
|
6786
6782
|
});
|
|
6787
6783
|
const orchestrator = createImplementationOrchestrator({
|
|
6788
6784
|
db,
|
|
@@ -6900,7 +6896,7 @@ async function createProgram() {
|
|
|
6900
6896
|
const registry = new AdapterRegistry();
|
|
6901
6897
|
await registry.discoverAndRegister();
|
|
6902
6898
|
registerAdaptersCommand(program, version, registry);
|
|
6903
|
-
registerInitCommand(program, version);
|
|
6899
|
+
registerInitCommand(program, version, registry);
|
|
6904
6900
|
registerConfigCommand(program, version);
|
|
6905
6901
|
registerRunCommand(program, version, process.cwd(), registry);
|
|
6906
6902
|
registerResumeCommand(program, version, process.cwd(), registry);
|