substrate-ai 0.8.0 → 0.8.2
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
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { DoltClient, DoltNotInstalled, FileStateStore, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, WorkGraphRepository, buildPipelineStatusOutput, checkDoltInstalled, createDatabaseAdapter, createDoltClient, createStateStore, detectCycles, findPackageRoot, formatOutput, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, initSchema, initializeDolt, isSyncAdapter, parseDbTimestampAsUtc, registerHealthCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot } from "../health-C-VRJruD.js";
|
|
3
3
|
import { createLogger } from "../logger-D2fS2ccL.js";
|
|
4
4
|
import { AdapterRegistry } from "../adapter-registry-D2zdMwVu.js";
|
|
5
|
-
import { AdapterTelemetryPersistence, AppError, DEFAULT_CONFIG, DEFAULT_ROUTING_POLICY, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, GitClient, GrammarLoader, IngestionServer, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createConfigSystem, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, formatPhaseCompletionSummary, registerRunCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-
|
|
5
|
+
import { AdapterTelemetryPersistence, AppError, DEFAULT_CONFIG, DEFAULT_ROUTING_POLICY, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, GitClient, GrammarLoader, IngestionServer, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createConfigSystem, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, formatPhaseCompletionSummary, registerRunCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-B4n563g1.js";
|
|
6
6
|
import { CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, PartialSubstrateConfigSchema } from "../config-migrator-CtGelIsG.js";
|
|
7
7
|
import { ConfigError, createEventBus } from "../helpers-CpMs8VZX.js";
|
|
8
8
|
import { RoutingRecommender } from "../routing-BVrxrM6v.js";
|
|
@@ -15,7 +15,7 @@ import { Command } from "commander";
|
|
|
15
15
|
import { fileURLToPath } from "url";
|
|
16
16
|
import { dirname, join, resolve } from "path";
|
|
17
17
|
import { access, mkdir, readFile, writeFile } from "fs/promises";
|
|
18
|
-
import { chmodSync, cpSync, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, statSync, unlinkSync, writeFileSync } from "fs";
|
|
18
|
+
import { appendFileSync, chmodSync, cpSync, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, statSync, unlinkSync, writeFileSync } from "fs";
|
|
19
19
|
import yaml from "js-yaml";
|
|
20
20
|
import { createRequire } from "node:module";
|
|
21
21
|
import * as path$2 from "node:path";
|
|
@@ -1190,6 +1190,19 @@ async function runInitAction(options) {
|
|
|
1190
1190
|
await scaffoldStatuslineScript(projectRoot);
|
|
1191
1191
|
await scaffoldClaudeSettings(projectRoot);
|
|
1192
1192
|
await scaffoldClaudeCommands(projectRoot, outputFormat);
|
|
1193
|
+
const gitignorePath = join(projectRoot, ".gitignore");
|
|
1194
|
+
const runtimeEntries = [".substrate/orchestrator.pid", ".substrate/current-run-id"];
|
|
1195
|
+
try {
|
|
1196
|
+
const existing = existsSync(gitignorePath) ? readFileSync(gitignorePath, "utf-8") : "";
|
|
1197
|
+
const missing = runtimeEntries.filter((e) => !existing.includes(e));
|
|
1198
|
+
if (missing.length > 0) {
|
|
1199
|
+
const block = "\n# Substrate runtime files\n" + missing.join("\n") + "\n";
|
|
1200
|
+
appendFileSync(gitignorePath, block);
|
|
1201
|
+
logger$18.info({ entries: missing }, "Added substrate runtime files to .gitignore");
|
|
1202
|
+
}
|
|
1203
|
+
} catch (err) {
|
|
1204
|
+
logger$18.debug({ err }, "Could not update .gitignore (non-fatal)");
|
|
1205
|
+
}
|
|
1193
1206
|
const doltMode = options.doltMode ?? "auto";
|
|
1194
1207
|
let doltInitialized = false;
|
|
1195
1208
|
if (doltMode !== "skip") try {
|
|
@@ -3516,7 +3529,7 @@ async function runSupervisorAction(options, deps = {}) {
|
|
|
3516
3529
|
await initSchema(expAdapter);
|
|
3517
3530
|
const { runRunAction: runPipeline } = await import(
|
|
3518
3531
|
/* @vite-ignore */
|
|
3519
|
-
"../run-
|
|
3532
|
+
"../run-8Lez83bG.js"
|
|
3520
3533
|
);
|
|
3521
3534
|
const runStoryFn = async (opts) => {
|
|
3522
3535
|
const exitCode = await runPipeline({
|
package/dist/index.d.ts
CHANGED
|
@@ -586,6 +586,26 @@ interface RoutingModelSelectedEvent {
|
|
|
586
586
|
/** How the model was selected: 'phase', 'baseline', 'override' */
|
|
587
587
|
source: string;
|
|
588
588
|
}
|
|
589
|
+
/**
|
|
590
|
+
* Emitted when a pipeline phase starts during full pipeline execution.
|
|
591
|
+
*/
|
|
592
|
+
interface PipelinePhaseStartEvent {
|
|
593
|
+
type: 'pipeline:phase-start';
|
|
594
|
+
/** ISO-8601 timestamp generated at emit time */
|
|
595
|
+
ts: string;
|
|
596
|
+
/** Phase name (e.g., 'analysis', 'implementation') */
|
|
597
|
+
phase: string;
|
|
598
|
+
}
|
|
599
|
+
/**
|
|
600
|
+
* Emitted when a pipeline phase completes during full pipeline execution.
|
|
601
|
+
*/
|
|
602
|
+
interface PipelinePhaseCompleteEvent {
|
|
603
|
+
type: 'pipeline:phase-complete';
|
|
604
|
+
/** ISO-8601 timestamp generated at emit time */
|
|
605
|
+
ts: string;
|
|
606
|
+
/** Phase name (e.g., 'analysis', 'implementation') */
|
|
607
|
+
phase: string;
|
|
608
|
+
}
|
|
589
609
|
/**
|
|
590
610
|
* Discriminated union of all pipeline event types.
|
|
591
611
|
*
|
|
@@ -598,7 +618,7 @@ interface RoutingModelSelectedEvent {
|
|
|
598
618
|
* }
|
|
599
619
|
* ```
|
|
600
620
|
*/
|
|
601
|
-
type PipelineEvent = PipelineStartEvent | PipelineCompleteEvent | PipelinePreFlightFailureEvent | PipelineProfileStaleEvent | PipelineContractMismatchEvent | PipelineContractVerificationSummaryEvent | StoryPhaseEvent | StoryDoneEvent | StoryEscalationEvent | StoryWarnEvent | StoryLogEvent | PipelineHeartbeatEvent | StoryStallEvent | StoryZeroDiffEscalationEvent | StoryBuildVerificationFailedEvent | StoryBuildVerificationPassedEvent | StoryInterfaceChangeWarningEvent | StoryMetricsEvent | SupervisorPollEvent | SupervisorKillEvent | SupervisorRestartEvent | SupervisorAbortEvent | SupervisorSummaryEvent | SupervisorAnalysisCompleteEvent | SupervisorAnalysisErrorEvent | SupervisorExperimentStartEvent | SupervisorExperimentSkipEvent | SupervisorExperimentRecommendationsEvent | SupervisorExperimentCompleteEvent | SupervisorExperimentErrorEvent | RoutingModelSelectedEvent; //#endregion
|
|
621
|
+
type PipelineEvent = PipelineStartEvent | PipelineCompleteEvent | PipelinePreFlightFailureEvent | PipelineProfileStaleEvent | PipelineContractMismatchEvent | PipelineContractVerificationSummaryEvent | StoryPhaseEvent | StoryDoneEvent | StoryEscalationEvent | StoryWarnEvent | StoryLogEvent | PipelineHeartbeatEvent | StoryStallEvent | StoryZeroDiffEscalationEvent | StoryBuildVerificationFailedEvent | StoryBuildVerificationPassedEvent | StoryInterfaceChangeWarningEvent | StoryMetricsEvent | SupervisorPollEvent | SupervisorKillEvent | SupervisorRestartEvent | SupervisorAbortEvent | SupervisorSummaryEvent | SupervisorAnalysisCompleteEvent | SupervisorAnalysisErrorEvent | SupervisorExperimentStartEvent | SupervisorExperimentSkipEvent | SupervisorExperimentRecommendationsEvent | SupervisorExperimentCompleteEvent | SupervisorExperimentErrorEvent | RoutingModelSelectedEvent | PipelinePhaseStartEvent | PipelinePhaseCompleteEvent; //#endregion
|
|
602
622
|
//#region src/core/errors.d.ts
|
|
603
623
|
|
|
604
624
|
/**
|
|
@@ -1357,6 +1377,16 @@ interface OrchestratorEvents {
|
|
|
1357
1377
|
reviewCycles: number;
|
|
1358
1378
|
dispatches: number;
|
|
1359
1379
|
};
|
|
1380
|
+
/** A pipeline phase has started (emitted by full pipeline path for NDJSON visibility) */
|
|
1381
|
+
'pipeline:phase-start': {
|
|
1382
|
+
phase: string;
|
|
1383
|
+
ts: string;
|
|
1384
|
+
};
|
|
1385
|
+
/** A pipeline phase has completed (emitted by full pipeline path for NDJSON visibility) */
|
|
1386
|
+
'pipeline:phase-complete': {
|
|
1387
|
+
phase: string;
|
|
1388
|
+
ts: string;
|
|
1389
|
+
};
|
|
1360
1390
|
/**
|
|
1361
1391
|
* Emitted when a dev-story timeout has partial work on disk and the
|
|
1362
1392
|
* orchestrator captures it as a checkpoint for retry (Story 39-5).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./health-C-VRJruD.js";
|
|
2
2
|
import "./logger-D2fS2ccL.js";
|
|
3
|
-
import { registerRunCommand, runRunAction } from "./run-
|
|
3
|
+
import { registerRunCommand, runRunAction } from "./run-B4n563g1.js";
|
|
4
4
|
import "./config-migrator-CtGelIsG.js";
|
|
5
5
|
import "./helpers-CpMs8VZX.js";
|
|
6
6
|
import "./routing-BVrxrM6v.js";
|
|
@@ -1588,6 +1588,34 @@ const PIPELINE_EVENT_METADATA = [
|
|
|
1588
1588
|
}
|
|
1589
1589
|
]
|
|
1590
1590
|
},
|
|
1591
|
+
{
|
|
1592
|
+
type: "pipeline:phase-start",
|
|
1593
|
+
description: "A pipeline phase has started during full pipeline execution.",
|
|
1594
|
+
when: "When --from is used and a phase begins (analysis, planning, solutioning, implementation).",
|
|
1595
|
+
fields: [{
|
|
1596
|
+
name: "ts",
|
|
1597
|
+
type: "string",
|
|
1598
|
+
description: "Timestamp."
|
|
1599
|
+
}, {
|
|
1600
|
+
name: "phase",
|
|
1601
|
+
type: "string",
|
|
1602
|
+
description: "Phase name (e.g., analysis, implementation)."
|
|
1603
|
+
}]
|
|
1604
|
+
},
|
|
1605
|
+
{
|
|
1606
|
+
type: "pipeline:phase-complete",
|
|
1607
|
+
description: "A pipeline phase has completed during full pipeline execution.",
|
|
1608
|
+
when: "When --from is used and a phase finishes successfully.",
|
|
1609
|
+
fields: [{
|
|
1610
|
+
name: "ts",
|
|
1611
|
+
type: "string",
|
|
1612
|
+
description: "Timestamp."
|
|
1613
|
+
}, {
|
|
1614
|
+
name: "phase",
|
|
1615
|
+
type: "string",
|
|
1616
|
+
description: "Phase name (e.g., analysis, implementation)."
|
|
1617
|
+
}]
|
|
1618
|
+
},
|
|
1591
1619
|
{
|
|
1592
1620
|
type: "pipeline:pre-flight-failure",
|
|
1593
1621
|
description: "Pre-flight build check failed before any story was dispatched. Pipeline aborts immediately.",
|
|
@@ -14481,12 +14509,42 @@ function createImplementationOrchestrator(deps) {
|
|
|
14481
14509
|
}
|
|
14482
14510
|
endPhase(storyKey, "dev-story");
|
|
14483
14511
|
{
|
|
14484
|
-
|
|
14512
|
+
let buildVerifyResult = config.skipBuildVerify === true ? { status: "skipped" } : runBuildVerification({
|
|
14485
14513
|
verifyCommand: pack.manifest.verifyCommand,
|
|
14486
14514
|
verifyTimeoutMs: pack.manifest.verifyTimeoutMs,
|
|
14487
14515
|
projectRoot: projectRoot ?? process.cwd(),
|
|
14488
14516
|
changedFiles: gitDiffFiles
|
|
14489
14517
|
});
|
|
14518
|
+
if (buildVerifyResult.status === "passed") {
|
|
14519
|
+
const resolvedRootForTsc = projectRoot ?? process.cwd();
|
|
14520
|
+
const tscBin = join$1(resolvedRootForTsc, "node_modules", ".bin", "tsc");
|
|
14521
|
+
const hasTsc = existsSync$1(tscBin) && existsSync$1(join$1(resolvedRootForTsc, "tsconfig.json"));
|
|
14522
|
+
if (hasTsc) try {
|
|
14523
|
+
execSync(`"${tscBin}" --noEmit`, {
|
|
14524
|
+
cwd: resolvedRootForTsc,
|
|
14525
|
+
timeout: 12e4,
|
|
14526
|
+
encoding: "utf-8",
|
|
14527
|
+
stdio: [
|
|
14528
|
+
"pipe",
|
|
14529
|
+
"pipe",
|
|
14530
|
+
"pipe"
|
|
14531
|
+
]
|
|
14532
|
+
});
|
|
14533
|
+
logger$25.info({ storyKey }, "Secondary typecheck (tsc --noEmit) passed");
|
|
14534
|
+
} catch (tscErr) {
|
|
14535
|
+
const tscOutput = tscErr instanceof Error && "stdout" in tscErr ? String(tscErr.stdout ?? "").slice(0, 2e3) : "";
|
|
14536
|
+
logger$25.warn({
|
|
14537
|
+
storyKey,
|
|
14538
|
+
tscOutput
|
|
14539
|
+
}, "Secondary typecheck (tsc --noEmit) failed — treating as build failure");
|
|
14540
|
+
buildVerifyResult = {
|
|
14541
|
+
status: "failed",
|
|
14542
|
+
exitCode: 2,
|
|
14543
|
+
output: `tsc --noEmit failed:\n${tscOutput}`,
|
|
14544
|
+
reason: "build-verification-failed"
|
|
14545
|
+
};
|
|
14546
|
+
}
|
|
14547
|
+
}
|
|
14490
14548
|
if (buildVerifyResult.status === "passed") {
|
|
14491
14549
|
eventBus.emit("story:build-verification-passed", { storyKey });
|
|
14492
14550
|
logger$25.info({ storyKey }, "Build verification passed");
|
|
@@ -20259,14 +20317,9 @@ async function runRunAction(options) {
|
|
|
20259
20317
|
const result = readdirSync(artifactsDir, { encoding: "utf-8" });
|
|
20260
20318
|
if (Array.isArray(result)) files = result;
|
|
20261
20319
|
} catch {}
|
|
20262
|
-
if (files !== void 0)
|
|
20263
|
-
const
|
|
20264
|
-
if (
|
|
20265
|
-
const errorMsg = `Story file not found for key: ${key}`;
|
|
20266
|
-
if (outputFormat === "json") process.stdout.write(formatOutput(null, "json", false, errorMsg) + "\n");
|
|
20267
|
-
else process.stderr.write(`Error: ${errorMsg}\n`);
|
|
20268
|
-
return 1;
|
|
20269
|
-
}
|
|
20320
|
+
if (files !== void 0) {
|
|
20321
|
+
const missing = parsedStoryKeys.filter((key) => !files.some((f) => f.startsWith(`${key}-`) && f.endsWith(".md")));
|
|
20322
|
+
if (missing.length > 0) logger.info({ missing }, `Story files not found for ${missing.length} key(s) — create-story phase will generate them`);
|
|
20270
20323
|
}
|
|
20271
20324
|
}
|
|
20272
20325
|
} else {
|
|
@@ -21302,4 +21355,4 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
|
|
|
21302
21355
|
|
|
21303
21356
|
//#endregion
|
|
21304
21357
|
export { AdapterTelemetryPersistence, AppError, DEFAULT_CONFIG, DEFAULT_ROUTING_POLICY, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, GitClient, GrammarLoader, IngestionServer, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createConfigSystem, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, formatPhaseCompletionSummary, registerRunCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runRunAction, runSolutioningPhase, validateStopAfterFromConflict };
|
|
21305
|
-
//# sourceMappingURL=run-
|
|
21358
|
+
//# sourceMappingURL=run-B4n563g1.js.map
|