substrate-ai 0.19.10 → 0.19.12
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
|
@@ -4,7 +4,7 @@ import { createLogger } from "../logger-KeHncl-f.js";
|
|
|
4
4
|
import { createEventBus } from "../helpers-CElYrONe.js";
|
|
5
5
|
import { AdapterRegistry, BudgetConfigSchema, CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, ConfigError, CostTrackerConfigSchema, DEFAULT_CONFIG, DoltClient, DoltNotInstalled, GlobalSettingsSchema, IngestionServer, MonitorDatabaseImpl, OPERATIONAL_FINDING, PartialGlobalSettingsSchema, PartialProviderConfigSchema, ProvidersSchema, RoutingRecommender, STORY_METRICS, TelemetryConfigSchema, addTokenUsage, aggregateTokenUsageForRun, checkDoltInstalled, compareRunMetrics, createAmendmentRun, createConfigSystem, createDecision, createDoltClient, createPipelineRun, getActiveDecisions, getAllCostEntriesFiltered, getBaselineRunMetrics, getDecisionsByCategory, getDecisionsByPhaseForRun, getLatestCompletedRun, getLatestRun, getPipelineRunById, getPlanningCostTotal, getRetryableEscalations, getRunMetrics, getSessionCostSummary, getSessionCostSummaryFiltered, getStoryMetricsForRun, getTokenUsageSummary, incrementRunRestarts, initSchema, initializeDolt, listRunMetrics, loadParentRunDecisions, supersedeDecision, tagRunAsBaseline, updatePipelineRun } from "../dist-adzGUKPc.js";
|
|
6
6
|
import "../adapter-registry-DXLMTmfD.js";
|
|
7
|
-
import { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GitClient, GrammarLoader, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-
|
|
7
|
+
import { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GitClient, GrammarLoader, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-1Ywys7Fy.js";
|
|
8
8
|
import "../errors-CZdr5Wqb.js";
|
|
9
9
|
import "../routing-CcBOCuC9.js";
|
|
10
10
|
import "../decisions-C0pz9Clx.js";
|
|
@@ -1155,7 +1155,8 @@ const SubstrateConfigSchema = z.object({
|
|
|
1155
1155
|
budget: BudgetConfigSchema.optional(),
|
|
1156
1156
|
token_ceilings: TokenCeilingsSchema.optional(),
|
|
1157
1157
|
dispatch_timeouts: DispatchTimeoutsSchema.optional(),
|
|
1158
|
-
telemetry: TelemetryConfigSchema.optional()
|
|
1158
|
+
telemetry: TelemetryConfigSchema.optional(),
|
|
1159
|
+
default_agent: z.string().optional()
|
|
1159
1160
|
}).strict();
|
|
1160
1161
|
const PartialSubstrateConfigSchema = z.object({
|
|
1161
1162
|
config_format_version: z.enum(["1"]).optional(),
|
|
@@ -1170,7 +1171,8 @@ const PartialSubstrateConfigSchema = z.object({
|
|
|
1170
1171
|
budget: BudgetConfigSchema.partial().optional(),
|
|
1171
1172
|
token_ceilings: TokenCeilingsSchema.optional(),
|
|
1172
1173
|
dispatch_timeouts: DispatchTimeoutsSchema.optional(),
|
|
1173
|
-
telemetry: TelemetryConfigSchema.partial().optional()
|
|
1174
|
+
telemetry: TelemetryConfigSchema.partial().optional(),
|
|
1175
|
+
default_agent: z.string().optional()
|
|
1174
1176
|
}).strict();
|
|
1175
1177
|
|
|
1176
1178
|
//#endregion
|
|
@@ -2676,7 +2678,7 @@ function mapInternalPhaseToEventPhase(internalPhase) {
|
|
|
2676
2678
|
}
|
|
2677
2679
|
}
|
|
2678
2680
|
async function runResumeAction(options) {
|
|
2679
|
-
const { runId: specifiedRunId, stopAfter, outputFormat, projectRoot, concurrency, pack: packName, events: eventsFlag, registry, maxReviewCycles = 2 } = options;
|
|
2681
|
+
const { runId: specifiedRunId, stopAfter, outputFormat, projectRoot, concurrency, pack: packName, events: eventsFlag, registry, maxReviewCycles = 2, agent: agentId } = options;
|
|
2680
2682
|
if (stopAfter !== void 0 && !VALID_PHASES.includes(stopAfter)) {
|
|
2681
2683
|
const errorMsg = `Invalid phase: "${stopAfter}". Valid phases: ${VALID_PHASES.join(", ")}`;
|
|
2682
2684
|
if (outputFormat === "json") process.stdout.write(formatOutput(null, "json", false, errorMsg) + "\n");
|
|
@@ -2760,7 +2762,8 @@ async function runResumeAction(options) {
|
|
|
2760
2762
|
existingRunId: runId,
|
|
2761
2763
|
projectRoot,
|
|
2762
2764
|
registry,
|
|
2763
|
-
stories: options.stories ?? scopedStories
|
|
2765
|
+
stories: options.stories ?? scopedStories,
|
|
2766
|
+
agentId
|
|
2764
2767
|
});
|
|
2765
2768
|
} catch (err) {
|
|
2766
2769
|
const msg = err instanceof Error ? err.message : String(err);
|
|
@@ -2775,7 +2778,7 @@ async function runResumeAction(options) {
|
|
|
2775
2778
|
}
|
|
2776
2779
|
}
|
|
2777
2780
|
async function runFullPipelineFromPhase(options) {
|
|
2778
|
-
const { packName, packPath, dbDir, dbPath, startPhase, stopAfter, concept, concurrency, outputFormat, events: eventsFlag, existingRunId, projectRoot, registry: injectedRegistry, stories: explicitStories, maxReviewCycles = 2 } = options;
|
|
2781
|
+
const { packName, packPath, dbDir, dbPath, startPhase, stopAfter, concept, concurrency, outputFormat, events: eventsFlag, existingRunId, projectRoot, registry: injectedRegistry, stories: explicitStories, maxReviewCycles = 2, agentId } = options;
|
|
2779
2782
|
if (!existsSync$1(dbDir)) mkdirSync$1(dbDir, { recursive: true });
|
|
2780
2783
|
const adapter = createDatabaseAdapter({
|
|
2781
2784
|
backend: "auto",
|
|
@@ -2805,7 +2808,8 @@ async function runFullPipelineFromPhase(options) {
|
|
|
2805
2808
|
db: adapter,
|
|
2806
2809
|
pack,
|
|
2807
2810
|
contextCompiler,
|
|
2808
|
-
dispatcher
|
|
2811
|
+
dispatcher,
|
|
2812
|
+
agentId
|
|
2809
2813
|
};
|
|
2810
2814
|
const phaseOrchestrator = createPhaseOrchestrator({
|
|
2811
2815
|
db: adapter,
|
|
@@ -2836,7 +2840,7 @@ async function runFullPipelineFromPhase(options) {
|
|
|
2836
2840
|
const costUsd = (result.tokenUsage.input * 3 + result.tokenUsage.output * 15) / 1e6;
|
|
2837
2841
|
await addTokenUsage(adapter, runId, {
|
|
2838
2842
|
phase: "analysis",
|
|
2839
|
-
agent: "claude-code",
|
|
2843
|
+
agent: agentId ?? "claude-code",
|
|
2840
2844
|
input_tokens: result.tokenUsage.input,
|
|
2841
2845
|
output_tokens: result.tokenUsage.output,
|
|
2842
2846
|
cost_usd: costUsd
|
|
@@ -2856,7 +2860,7 @@ async function runFullPipelineFromPhase(options) {
|
|
|
2856
2860
|
const costUsd = (result.tokenUsage.input * 3 + result.tokenUsage.output * 15) / 1e6;
|
|
2857
2861
|
await addTokenUsage(adapter, runId, {
|
|
2858
2862
|
phase: "planning",
|
|
2859
|
-
agent: "claude-code",
|
|
2863
|
+
agent: agentId ?? "claude-code",
|
|
2860
2864
|
input_tokens: result.tokenUsage.input,
|
|
2861
2865
|
output_tokens: result.tokenUsage.output,
|
|
2862
2866
|
cost_usd: costUsd
|
|
@@ -2876,7 +2880,7 @@ async function runFullPipelineFromPhase(options) {
|
|
|
2876
2880
|
const costUsd = (result.tokenUsage.input * 3 + result.tokenUsage.output * 15) / 1e6;
|
|
2877
2881
|
await addTokenUsage(adapter, runId, {
|
|
2878
2882
|
phase: "solutioning",
|
|
2879
|
-
agent: "claude-code",
|
|
2883
|
+
agent: agentId ?? "claude-code",
|
|
2880
2884
|
input_tokens: result.tokenUsage.input,
|
|
2881
2885
|
output_tokens: result.tokenUsage.output,
|
|
2882
2886
|
cost_usd: costUsd
|
|
@@ -2917,6 +2921,7 @@ async function runFullPipelineFromPhase(options) {
|
|
|
2917
2921
|
enableHeartbeat: eventsFlag === true
|
|
2918
2922
|
},
|
|
2919
2923
|
projectRoot,
|
|
2924
|
+
agentId,
|
|
2920
2925
|
...ingestionServer !== void 0 ? { ingestionServer } : {},
|
|
2921
2926
|
...telemetryPersistence !== void 0 ? { telemetryPersistence } : {}
|
|
2922
2927
|
});
|
|
@@ -3005,7 +3010,7 @@ async function runFullPipelineFromPhase(options) {
|
|
|
3005
3010
|
const costUsd = (input * 3 + output * 15) / 1e6;
|
|
3006
3011
|
addTokenUsage(adapter, runId, {
|
|
3007
3012
|
phase: payload.phase,
|
|
3008
|
-
agent: "claude-code",
|
|
3013
|
+
agent: agentId ?? "claude-code",
|
|
3009
3014
|
input_tokens: input,
|
|
3010
3015
|
output_tokens: output,
|
|
3011
3016
|
cost_usd: costUsd
|
|
@@ -3092,7 +3097,7 @@ async function runFullPipelineFromPhase(options) {
|
|
|
3092
3097
|
}
|
|
3093
3098
|
}
|
|
3094
3099
|
function registerResumeCommand(program, _version = "0.0.0", projectRoot = process.cwd(), registry) {
|
|
3095
|
-
program.command("resume").description("Resume a previously interrupted pipeline run").option("--run-id <id>", "Pipeline run ID to resume (defaults to latest)").option("--pack <name>", "Methodology pack name", "bmad").option("--stop-after <phase>", "Stop pipeline after this phase completes (overrides saved state)").option("--concurrency <n>", "Maximum parallel conflict groups", (v) => parseInt(v, 10), 3).option("--project-root <path>", "Project root directory", projectRoot).option("--output-format <format>", "Output format: human (default) or json", "human").option("--events", "Emit structured NDJSON events on stdout for programmatic consumption").option("--max-review-cycles <n>", "Maximum review cycles per story (default: 2)", (v) => parseInt(v, 10), 2).action(async (opts) => {
|
|
3100
|
+
program.command("resume").description("Resume a previously interrupted pipeline run").option("--run-id <id>", "Pipeline run ID to resume (defaults to latest)").option("--pack <name>", "Methodology pack name", "bmad").option("--stop-after <phase>", "Stop pipeline after this phase completes (overrides saved state)").option("--concurrency <n>", "Maximum parallel conflict groups", (v) => parseInt(v, 10), 3).option("--project-root <path>", "Project root directory", projectRoot).option("--output-format <format>", "Output format: human (default) or json", "human").option("--events", "Emit structured NDJSON events on stdout for programmatic consumption").option("--max-review-cycles <n>", "Maximum review cycles per story (default: 2)", (v) => parseInt(v, 10), 2).option("--agent <id>", "Agent backend: claude-code (default), codex, or gemini").action(async (opts) => {
|
|
3096
3101
|
const outputFormat = opts.outputFormat === "json" ? "json" : "human";
|
|
3097
3102
|
const exitCode = await runResumeAction({
|
|
3098
3103
|
runId: opts.runId,
|
|
@@ -3103,6 +3108,7 @@ function registerResumeCommand(program, _version = "0.0.0", projectRoot = proces
|
|
|
3103
3108
|
pack: opts.pack,
|
|
3104
3109
|
events: opts.events,
|
|
3105
3110
|
maxReviewCycles: opts.maxReviewCycles,
|
|
3111
|
+
agent: opts.agent,
|
|
3106
3112
|
registry
|
|
3107
3113
|
});
|
|
3108
3114
|
process.exitCode = exitCode;
|
|
@@ -3746,7 +3752,7 @@ async function runPostPhaseSupersessionDetection(adapter, amendmentRunId, curren
|
|
|
3746
3752
|
}
|
|
3747
3753
|
}
|
|
3748
3754
|
async function runAmendAction(options) {
|
|
3749
|
-
const { concept: conceptArg, conceptFile, runId: specifiedRunId, stopAfter, from: startPhase, projectRoot, pack: packName, registry: injectedRegistry } = options;
|
|
3755
|
+
const { concept: conceptArg, conceptFile, runId: specifiedRunId, stopAfter, from: startPhase, projectRoot, pack: packName, registry: injectedRegistry, agent: agentId } = options;
|
|
3750
3756
|
let concept;
|
|
3751
3757
|
if (conceptFile !== void 0 && conceptFile !== "") try {
|
|
3752
3758
|
concept = await readFile(conceptFile, "utf-8");
|
|
@@ -3844,7 +3850,8 @@ async function runAmendAction(options) {
|
|
|
3844
3850
|
db: adapter,
|
|
3845
3851
|
pack,
|
|
3846
3852
|
contextCompiler,
|
|
3847
|
-
dispatcher
|
|
3853
|
+
dispatcher,
|
|
3854
|
+
agentId
|
|
3848
3855
|
};
|
|
3849
3856
|
const phaseOrder = [
|
|
3850
3857
|
"analysis",
|
|
@@ -3888,7 +3895,7 @@ async function runAmendAction(options) {
|
|
|
3888
3895
|
const costUsd = (result.tokenUsage.input * 3 + result.tokenUsage.output * 15) / 1e6;
|
|
3889
3896
|
await addTokenUsage(adapter, amendmentRunId, {
|
|
3890
3897
|
phase: "analysis",
|
|
3891
|
-
agent: "claude-code",
|
|
3898
|
+
agent: agentId ?? "claude-code",
|
|
3892
3899
|
input_tokens: result.tokenUsage.input,
|
|
3893
3900
|
output_tokens: result.tokenUsage.output,
|
|
3894
3901
|
cost_usd: costUsd
|
|
@@ -3910,7 +3917,7 @@ async function runAmendAction(options) {
|
|
|
3910
3917
|
const costUsd = (result.tokenUsage.input * 3 + result.tokenUsage.output * 15) / 1e6;
|
|
3911
3918
|
await addTokenUsage(adapter, amendmentRunId, {
|
|
3912
3919
|
phase: "planning",
|
|
3913
|
-
agent: "claude-code",
|
|
3920
|
+
agent: agentId ?? "claude-code",
|
|
3914
3921
|
input_tokens: result.tokenUsage.input,
|
|
3915
3922
|
output_tokens: result.tokenUsage.output,
|
|
3916
3923
|
cost_usd: costUsd
|
|
@@ -3932,7 +3939,7 @@ async function runAmendAction(options) {
|
|
|
3932
3939
|
const costUsd = (result.tokenUsage.input * 3 + result.tokenUsage.output * 15) / 1e6;
|
|
3933
3940
|
await addTokenUsage(adapter, amendmentRunId, {
|
|
3934
3941
|
phase: "solutioning",
|
|
3935
|
-
agent: "claude-code",
|
|
3942
|
+
agent: agentId ?? "claude-code",
|
|
3936
3943
|
input_tokens: result.tokenUsage.input,
|
|
3937
3944
|
output_tokens: result.tokenUsage.output,
|
|
3938
3945
|
cost_usd: costUsd
|
|
@@ -4003,7 +4010,7 @@ async function runAmendAction(options) {
|
|
|
4003
4010
|
}
|
|
4004
4011
|
}
|
|
4005
4012
|
function registerAmendCommand(program, _version = "0.0.0", projectRoot = process.cwd(), registry) {
|
|
4006
|
-
program.command("amend").description("Run an amendment pipeline against a completed run and an existing run").option("--concept <text>", "Amendment concept description (inline)").option("--concept-file <path>", "Path to concept file").option("--run-id <id>", "Parent run ID (defaults to latest completed run)").option("--stop-after <phase>", "Stop pipeline after this phase completes").option("--from <phase>", "Start pipeline from this phase").option("--pack <name>", "Methodology pack name", "bmad").option("--project-root <path>", "Project root directory", projectRoot).option("--output-format <format>", "Output format: human (default) or json", "human").action(async (opts) => {
|
|
4013
|
+
program.command("amend").description("Run an amendment pipeline against a completed run and an existing run").option("--concept <text>", "Amendment concept description (inline)").option("--concept-file <path>", "Path to concept file").option("--run-id <id>", "Parent run ID (defaults to latest completed run)").option("--stop-after <phase>", "Stop pipeline after this phase completes").option("--from <phase>", "Start pipeline from this phase").option("--pack <name>", "Methodology pack name", "bmad").option("--project-root <path>", "Project root directory", projectRoot).option("--output-format <format>", "Output format: human (default) or json", "human").option("--agent <id>", "Agent backend: claude-code (default), codex, or gemini").action(async (opts) => {
|
|
4007
4014
|
const exitCode = await runAmendAction({
|
|
4008
4015
|
concept: opts.concept,
|
|
4009
4016
|
conceptFile: opts.conceptFile,
|
|
@@ -4012,6 +4019,7 @@ function registerAmendCommand(program, _version = "0.0.0", projectRoot = process
|
|
|
4012
4019
|
from: opts.from,
|
|
4013
4020
|
projectRoot: opts.projectRoot,
|
|
4014
4021
|
pack: opts.pack,
|
|
4022
|
+
agent: opts.agent,
|
|
4015
4023
|
registry
|
|
4016
4024
|
});
|
|
4017
4025
|
process.exitCode = exitCode;
|
|
@@ -4547,7 +4555,7 @@ async function runSupervisorAction(options, deps = {}) {
|
|
|
4547
4555
|
await initSchema(expAdapter);
|
|
4548
4556
|
const { runRunAction: runPipeline } = await import(
|
|
4549
4557
|
/* @vite-ignore */
|
|
4550
|
-
"../run-
|
|
4558
|
+
"../run-zc3SEWY1.js"
|
|
4551
4559
|
);
|
|
4552
4560
|
const runStoryFn = async (opts) => {
|
|
4553
4561
|
const exitCode = await runPipeline({
|
|
@@ -7159,7 +7167,7 @@ function registerBrainstormCommand(program, _version = "0.0.0", projectRoot = pr
|
|
|
7159
7167
|
//#region src/cli/commands/retry-escalated.ts
|
|
7160
7168
|
const logger$3 = createLogger("retry-escalated-cmd");
|
|
7161
7169
|
async function runRetryEscalatedAction(options) {
|
|
7162
|
-
const { runId, dryRun, force, outputFormat, projectRoot, concurrency, pack: packName, registry: injectedRegistry } = options;
|
|
7170
|
+
const { runId, dryRun, force, outputFormat, projectRoot, concurrency, pack: packName, registry: injectedRegistry, agent: agentId } = options;
|
|
7163
7171
|
const dbRoot = await resolveMainRepoRoot(projectRoot);
|
|
7164
7172
|
const dbPath = join(dbRoot, ".substrate", "substrate.db");
|
|
7165
7173
|
const doltDir = join(dbRoot, ".substrate", "state", ".dolt");
|
|
@@ -7262,7 +7270,8 @@ async function runRetryEscalatedAction(options) {
|
|
|
7262
7270
|
pipelineRunId: pipelineRun.id,
|
|
7263
7271
|
...Object.keys(perStoryContextCeilings).length > 0 ? { perStoryContextCeilings } : {}
|
|
7264
7272
|
},
|
|
7265
|
-
projectRoot
|
|
7273
|
+
projectRoot,
|
|
7274
|
+
agentId
|
|
7266
7275
|
});
|
|
7267
7276
|
eventBus.on("orchestrator:story-phase-complete", (payload) => {
|
|
7268
7277
|
try {
|
|
@@ -7272,7 +7281,7 @@ async function runRetryEscalatedAction(options) {
|
|
|
7272
7281
|
const costUsd = (input * 3 + output * 15) / 1e6;
|
|
7273
7282
|
addTokenUsage(adapter, pipelineRun.id, {
|
|
7274
7283
|
phase: payload.phase,
|
|
7275
|
-
agent: "claude-code",
|
|
7284
|
+
agent: agentId ?? "claude-code",
|
|
7276
7285
|
input_tokens: input,
|
|
7277
7286
|
output_tokens: output,
|
|
7278
7287
|
cost_usd: costUsd
|
|
@@ -7316,7 +7325,7 @@ function registerRetryEscalatedCommand(program, _version = "0.0.0", projectRoot
|
|
|
7316
7325
|
const n = parseInt(v, 10);
|
|
7317
7326
|
if (isNaN(n) || n < 1) throw new Error(`--concurrency must be a positive integer, got: ${v}`);
|
|
7318
7327
|
return n;
|
|
7319
|
-
}, 3).option("--pack <name>", "Methodology pack name", "bmad").option("--project-root <path>", "Project root directory", projectRoot).option("--output-format <format>", "Output format: human (default) or json", "human").action(async (opts) => {
|
|
7328
|
+
}, 3).option("--pack <name>", "Methodology pack name", "bmad").option("--project-root <path>", "Project root directory", projectRoot).option("--output-format <format>", "Output format: human (default) or json", "human").option("--agent <id>", "Agent backend: claude-code (default), codex, or gemini").action(async (opts) => {
|
|
7320
7329
|
const outputFormat = opts.outputFormat === "json" ? "json" : "human";
|
|
7321
7330
|
const exitCode = await runRetryEscalatedAction({
|
|
7322
7331
|
runId: opts.runId,
|
|
@@ -7326,6 +7335,7 @@ function registerRetryEscalatedCommand(program, _version = "0.0.0", projectRoot
|
|
|
7326
7335
|
projectRoot: opts.projectRoot,
|
|
7327
7336
|
concurrency: opts.concurrency,
|
|
7328
7337
|
pack: opts.pack,
|
|
7338
|
+
agent: opts.agent,
|
|
7329
7339
|
registry
|
|
7330
7340
|
});
|
|
7331
7341
|
process.exitCode = exitCode;
|
package/dist/index.d.ts
CHANGED
|
@@ -1528,6 +1528,7 @@ declare const SubstrateConfigSchema: z.ZodObject<{
|
|
|
1528
1528
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1529
1529
|
port: z.ZodDefault<z.ZodNumber>;
|
|
1530
1530
|
}, z.core.$strict>>;
|
|
1531
|
+
default_agent: z.ZodOptional<z.ZodString>;
|
|
1531
1532
|
}, z.core.$strict>;
|
|
1532
1533
|
type SubstrateConfig = z.infer<typeof SubstrateConfigSchema>;
|
|
1533
1534
|
|
|
@@ -5334,7 +5334,7 @@ async function runCreateStory(deps, params) {
|
|
|
5334
5334
|
}, "Prompt assembled for create-story");
|
|
5335
5335
|
const handle = deps.dispatcher.dispatch({
|
|
5336
5336
|
prompt,
|
|
5337
|
-
agent: "claude-code",
|
|
5337
|
+
agent: deps.agentId ?? "claude-code",
|
|
5338
5338
|
taskType: "create-story",
|
|
5339
5339
|
outputSchema: CreateStoryResultSchema,
|
|
5340
5340
|
maxTurns: 50,
|
|
@@ -6556,7 +6556,7 @@ async function runDevStory(deps, params) {
|
|
|
6556
6556
|
try {
|
|
6557
6557
|
const handle = deps.dispatcher.dispatch({
|
|
6558
6558
|
prompt,
|
|
6559
|
-
agent: "claude-code",
|
|
6559
|
+
agent: deps.agentId ?? "claude-code",
|
|
6560
6560
|
taskType: "dev-story",
|
|
6561
6561
|
timeout: DEFAULT_TIMEOUT_MS$1,
|
|
6562
6562
|
outputSchema: DevStoryResultSchema,
|
|
@@ -7025,7 +7025,7 @@ async function runCodeReview(deps, params) {
|
|
|
7025
7025
|
const { prompt } = assembleResult;
|
|
7026
7026
|
const handle = deps.dispatcher.dispatch({
|
|
7027
7027
|
prompt,
|
|
7028
|
-
agent: "claude-code",
|
|
7028
|
+
agent: deps.agentId ?? "claude-code",
|
|
7029
7029
|
taskType: "code-review",
|
|
7030
7030
|
outputSchema: CodeReviewResultSchema,
|
|
7031
7031
|
workingDirectory: deps.projectRoot,
|
|
@@ -7240,7 +7240,7 @@ async function runTestPlan(deps, params) {
|
|
|
7240
7240
|
try {
|
|
7241
7241
|
const handle = deps.dispatcher.dispatch({
|
|
7242
7242
|
prompt,
|
|
7243
|
-
agent: "claude-code",
|
|
7243
|
+
agent: deps.agentId ?? "claude-code",
|
|
7244
7244
|
taskType: "test-plan",
|
|
7245
7245
|
timeout: DEFAULT_TIMEOUT_MS,
|
|
7246
7246
|
outputSchema: TestPlanResultSchema,
|
|
@@ -7511,7 +7511,7 @@ async function runTestExpansion(deps, params) {
|
|
|
7511
7511
|
const { prompt } = assembleResult;
|
|
7512
7512
|
const handle = deps.dispatcher.dispatch({
|
|
7513
7513
|
prompt,
|
|
7514
|
-
agent: "claude-code",
|
|
7514
|
+
agent: deps.agentId ?? "claude-code",
|
|
7515
7515
|
taskType: "test-expansion",
|
|
7516
7516
|
outputSchema: TestExpansionResultSchema,
|
|
7517
7517
|
workingDirectory: deps.projectRoot,
|
|
@@ -10540,7 +10540,7 @@ function checkProfileStaleness(projectRoot) {
|
|
|
10540
10540
|
* @returns A fully-configured ImplementationOrchestrator ready to call run()
|
|
10541
10541
|
*/
|
|
10542
10542
|
function createImplementationOrchestrator(deps) {
|
|
10543
|
-
const { db, pack, contextCompiler, dispatcher, eventBus, config, projectRoot, tokenCeilings, stateStore, telemetryPersistence, ingestionServer, repoMapInjector, maxRepoMapTokens } = deps;
|
|
10543
|
+
const { db, pack, contextCompiler, dispatcher, eventBus, config, projectRoot, tokenCeilings, stateStore, telemetryPersistence, ingestionServer, repoMapInjector, maxRepoMapTokens, agentId } = deps;
|
|
10544
10544
|
const logger$22 = createLogger("implementation-orchestrator");
|
|
10545
10545
|
const telemetryAdvisor = db !== void 0 ? createTelemetryAdvisor({ db }) : void 0;
|
|
10546
10546
|
const wgRepo = new WorkGraphRepository(db);
|
|
@@ -11096,7 +11096,8 @@ function createImplementationOrchestrator(deps) {
|
|
|
11096
11096
|
dispatcher,
|
|
11097
11097
|
projectRoot,
|
|
11098
11098
|
tokenCeilings,
|
|
11099
|
-
otlpEndpoint: _otlpEndpoint
|
|
11099
|
+
otlpEndpoint: _otlpEndpoint,
|
|
11100
|
+
agentId
|
|
11100
11101
|
}, {
|
|
11101
11102
|
epicId: storyKey.split("-")[0] ?? storyKey,
|
|
11102
11103
|
storyKey,
|
|
@@ -11274,7 +11275,8 @@ function createImplementationOrchestrator(deps) {
|
|
|
11274
11275
|
dispatcher,
|
|
11275
11276
|
projectRoot,
|
|
11276
11277
|
tokenCeilings,
|
|
11277
|
-
otlpEndpoint: _otlpEndpoint
|
|
11278
|
+
otlpEndpoint: _otlpEndpoint,
|
|
11279
|
+
agentId
|
|
11278
11280
|
}, {
|
|
11279
11281
|
storyKey,
|
|
11280
11282
|
storyFilePath: storyFilePath ?? "",
|
|
@@ -11382,6 +11384,7 @@ function createImplementationOrchestrator(deps) {
|
|
|
11382
11384
|
otlpEndpoint: _otlpEndpoint,
|
|
11383
11385
|
repoMapInjector,
|
|
11384
11386
|
maxRepoMapTokens,
|
|
11387
|
+
agentId,
|
|
11385
11388
|
...config.perStoryContextCeilings?.[storyKey] !== void 0 ? { maxContextTokens: config.perStoryContextCeilings[storyKey] } : {},
|
|
11386
11389
|
...storyOptions?.optimizationDirectives !== void 0 ? { optimizationDirectives: storyOptions.optimizationDirectives } : {}
|
|
11387
11390
|
}, {
|
|
@@ -11467,6 +11470,7 @@ function createImplementationOrchestrator(deps) {
|
|
|
11467
11470
|
otlpEndpoint: _otlpEndpoint,
|
|
11468
11471
|
repoMapInjector,
|
|
11469
11472
|
maxRepoMapTokens,
|
|
11473
|
+
agentId,
|
|
11470
11474
|
...config.perStoryContextCeilings?.[storyKey] !== void 0 ? { maxContextTokens: config.perStoryContextCeilings[storyKey] } : {},
|
|
11471
11475
|
...storyOptions?.optimizationDirectives !== void 0 ? { optimizationDirectives: storyOptions.optimizationDirectives } : {}
|
|
11472
11476
|
}, {
|
|
@@ -11631,7 +11635,7 @@ function createImplementationOrchestrator(deps) {
|
|
|
11631
11635
|
startPhase(storyKey, "dev-story-retry");
|
|
11632
11636
|
const checkpointRetryHandle = dispatcher.dispatch({
|
|
11633
11637
|
prompt: checkpointRetryPrompt,
|
|
11634
|
-
agent: "claude-code",
|
|
11638
|
+
agent: deps.agentId ?? "claude-code",
|
|
11635
11639
|
taskType: "dev-story",
|
|
11636
11640
|
outputSchema: DevStoryResultSchema,
|
|
11637
11641
|
...checkpointRetryMaxTurns !== void 0 ? { maxTurns: checkpointRetryMaxTurns } : {},
|
|
@@ -11902,7 +11906,7 @@ function createImplementationOrchestrator(deps) {
|
|
|
11902
11906
|
incrementDispatches(storyKey);
|
|
11903
11907
|
const fixHandle = dispatcher.dispatch({
|
|
11904
11908
|
prompt: buildFixPrompt,
|
|
11905
|
-
agent: "claude-code",
|
|
11909
|
+
agent: deps.agentId ?? "claude-code",
|
|
11906
11910
|
taskType: "build-fix",
|
|
11907
11911
|
maxTurns: 15,
|
|
11908
11912
|
workingDirectory: projectRoot ?? process.cwd(),
|
|
@@ -12029,6 +12033,7 @@ function createImplementationOrchestrator(deps) {
|
|
|
12029
12033
|
otlpEndpoint: _otlpEndpoint,
|
|
12030
12034
|
repoMapInjector,
|
|
12031
12035
|
maxRepoMapTokens,
|
|
12036
|
+
agentId,
|
|
12032
12037
|
...config.perStoryContextCeilings?.[storyKey] !== void 0 ? { maxContextTokens: config.perStoryContextCeilings[storyKey] } : {}
|
|
12033
12038
|
}, {
|
|
12034
12039
|
storyKey,
|
|
@@ -12073,6 +12078,7 @@ function createImplementationOrchestrator(deps) {
|
|
|
12073
12078
|
otlpEndpoint: _otlpEndpoint,
|
|
12074
12079
|
repoMapInjector,
|
|
12075
12080
|
maxRepoMapTokens,
|
|
12081
|
+
agentId,
|
|
12076
12082
|
...config.perStoryContextCeilings?.[storyKey] !== void 0 ? { maxContextTokens: config.perStoryContextCeilings[storyKey] } : {}
|
|
12077
12083
|
}, {
|
|
12078
12084
|
storyKey,
|
|
@@ -12280,7 +12286,8 @@ function createImplementationOrchestrator(deps) {
|
|
|
12280
12286
|
dispatcher,
|
|
12281
12287
|
projectRoot,
|
|
12282
12288
|
tokenCeilings,
|
|
12283
|
-
otlpEndpoint: _otlpEndpoint
|
|
12289
|
+
otlpEndpoint: _otlpEndpoint,
|
|
12290
|
+
agentId
|
|
12284
12291
|
}, {
|
|
12285
12292
|
storyKey,
|
|
12286
12293
|
storyFilePath: storyFilePath ?? "",
|
|
@@ -12392,7 +12399,7 @@ function createImplementationOrchestrator(deps) {
|
|
|
12392
12399
|
}
|
|
12393
12400
|
const handle = dispatcher.dispatch({
|
|
12394
12401
|
prompt: fixPrompt,
|
|
12395
|
-
agent: "claude-code",
|
|
12402
|
+
agent: deps.agentId ?? "claude-code",
|
|
12396
12403
|
taskType: "minor-fixes",
|
|
12397
12404
|
workingDirectory: projectRoot,
|
|
12398
12405
|
...autoApproveMaxTurns !== void 0 ? { maxTurns: autoApproveMaxTurns } : {},
|
|
@@ -12551,7 +12558,7 @@ function createImplementationOrchestrator(deps) {
|
|
|
12551
12558
|
incrementDispatches(storyKey);
|
|
12552
12559
|
const handle = isMajorRework ? dispatcher.dispatch({
|
|
12553
12560
|
prompt: fixPrompt,
|
|
12554
|
-
agent: "claude-code",
|
|
12561
|
+
agent: deps.agentId ?? "claude-code",
|
|
12555
12562
|
taskType,
|
|
12556
12563
|
...fixModel !== void 0 ? { model: fixModel } : {},
|
|
12557
12564
|
outputSchema: DevStoryResultSchema,
|
|
@@ -12561,7 +12568,7 @@ function createImplementationOrchestrator(deps) {
|
|
|
12561
12568
|
..._otlpEndpoint !== void 0 ? { otlpEndpoint: _otlpEndpoint } : {}
|
|
12562
12569
|
}) : dispatcher.dispatch({
|
|
12563
12570
|
prompt: fixPrompt,
|
|
12564
|
-
agent: "claude-code",
|
|
12571
|
+
agent: deps.agentId ?? "claude-code",
|
|
12565
12572
|
taskType,
|
|
12566
12573
|
...fixModel !== void 0 ? { model: fixModel } : {},
|
|
12567
12574
|
...fixMaxTurns !== void 0 ? { maxTurns: fixMaxTurns } : {},
|
|
@@ -13771,7 +13778,7 @@ async function runCritiqueLoop(artifact, phaseId, runId, phase, deps, options =
|
|
|
13771
13778
|
try {
|
|
13772
13779
|
const handle = deps.dispatcher.dispatch({
|
|
13773
13780
|
prompt: critiquePrompt,
|
|
13774
|
-
agent: "claude-code",
|
|
13781
|
+
agent: deps.agentId ?? "claude-code",
|
|
13775
13782
|
taskType: "critique",
|
|
13776
13783
|
outputSchema: CritiqueOutputSchema
|
|
13777
13784
|
});
|
|
@@ -13882,7 +13889,7 @@ async function runCritiqueLoop(artifact, phaseId, runId, phase, deps, options =
|
|
|
13882
13889
|
try {
|
|
13883
13890
|
const refineHandle = deps.dispatcher.dispatch({
|
|
13884
13891
|
prompt: refinePrompt,
|
|
13885
|
-
agent: "claude-code",
|
|
13892
|
+
agent: deps.agentId ?? "claude-code",
|
|
13886
13893
|
taskType: "critique",
|
|
13887
13894
|
outputSchema: void 0
|
|
13888
13895
|
});
|
|
@@ -14560,7 +14567,7 @@ async function runSteps(steps, deps, runId, phase, params) {
|
|
|
14560
14567
|
}
|
|
14561
14568
|
const handle = deps.dispatcher.dispatch({
|
|
14562
14569
|
prompt,
|
|
14563
|
-
agent: "claude-code",
|
|
14570
|
+
agent: deps.agentId ?? "claude-code",
|
|
14564
14571
|
taskType: step.taskType,
|
|
14565
14572
|
outputSchema: step.outputSchema
|
|
14566
14573
|
});
|
|
@@ -14739,7 +14746,7 @@ async function runSteps(steps, deps, runId, phase, params) {
|
|
|
14739
14746
|
const elicitPrompt = elicitationTemplate.replace(/\{\{method_name\}\}/g, method.name).replace(/\{\{method_description\}\}/g, method.description).replace(/\{\{output_pattern\}\}/g, method.output_pattern).replace(/\{\{artifact_content\}\}/g, artifactContent);
|
|
14740
14747
|
const elicitHandle = deps.dispatcher.dispatch({
|
|
14741
14748
|
prompt: elicitPrompt,
|
|
14742
|
-
agent: "claude-code",
|
|
14749
|
+
agent: deps.agentId ?? "claude-code",
|
|
14743
14750
|
taskType: "elicitation",
|
|
14744
14751
|
outputSchema: ElicitationOutputSchema
|
|
14745
14752
|
});
|
|
@@ -15083,7 +15090,7 @@ async function runAnalysisPhase(deps, params) {
|
|
|
15083
15090
|
};
|
|
15084
15091
|
const handle = dispatcher.dispatch({
|
|
15085
15092
|
prompt,
|
|
15086
|
-
agent: "claude-code",
|
|
15093
|
+
agent: deps.agentId ?? "claude-code",
|
|
15087
15094
|
taskType: "analysis",
|
|
15088
15095
|
outputSchema: AnalysisOutputSchema
|
|
15089
15096
|
});
|
|
@@ -15395,7 +15402,7 @@ async function runPlanningMultiStep(deps, params) {
|
|
|
15395
15402
|
correctedPrompt = correctionPrefix + correctedPrompt;
|
|
15396
15403
|
const retryHandle = deps.dispatcher.dispatch({
|
|
15397
15404
|
prompt: correctedPrompt,
|
|
15398
|
-
agent: "claude-code",
|
|
15405
|
+
agent: deps.agentId ?? "claude-code",
|
|
15399
15406
|
taskType: "planning-nfrs",
|
|
15400
15407
|
outputSchema: PlanningNFRsOutputSchema
|
|
15401
15408
|
});
|
|
@@ -15515,7 +15522,7 @@ async function runPlanningPhase(deps, params) {
|
|
|
15515
15522
|
};
|
|
15516
15523
|
const handle = dispatcher.dispatch({
|
|
15517
15524
|
prompt,
|
|
15518
|
-
agent: "claude-code",
|
|
15525
|
+
agent: deps.agentId ?? "claude-code",
|
|
15519
15526
|
taskType: "planning",
|
|
15520
15527
|
outputSchema: PlanningOutputSchema
|
|
15521
15528
|
});
|
|
@@ -15815,7 +15822,7 @@ async function runArchitectureGeneration(deps, params) {
|
|
|
15815
15822
|
};
|
|
15816
15823
|
const handle = dispatcher.dispatch({
|
|
15817
15824
|
prompt,
|
|
15818
|
-
agent: "claude-code",
|
|
15825
|
+
agent: deps.agentId ?? "claude-code",
|
|
15819
15826
|
taskType: "architecture",
|
|
15820
15827
|
outputSchema: ArchitectureOutputSchema
|
|
15821
15828
|
});
|
|
@@ -15917,7 +15924,7 @@ async function runStoryGeneration(deps, params, gapAnalysis) {
|
|
|
15917
15924
|
};
|
|
15918
15925
|
const handle = dispatcher.dispatch({
|
|
15919
15926
|
prompt,
|
|
15920
|
-
agent: "claude-code",
|
|
15927
|
+
agent: deps.agentId ?? "claude-code",
|
|
15921
15928
|
taskType: "story-generation",
|
|
15922
15929
|
outputSchema: StoryGenerationOutputSchema
|
|
15923
15930
|
});
|
|
@@ -16095,7 +16102,7 @@ async function runReadinessCheck(deps, runId) {
|
|
|
16095
16102
|
else prompt = prompt.replace(READINESS_UX_PLACEHOLDER, "");
|
|
16096
16103
|
const handle = dispatcher.dispatch({
|
|
16097
16104
|
prompt,
|
|
16098
|
-
agent: "claude-code",
|
|
16105
|
+
agent: deps.agentId ?? "claude-code",
|
|
16099
16106
|
taskType: "readiness-check",
|
|
16100
16107
|
outputSchema: ReadinessOutputSchema
|
|
16101
16108
|
});
|
|
@@ -40374,7 +40381,7 @@ function wireNdjsonEmitter(eventBus, ndjsonEmitter) {
|
|
|
40374
40381
|
});
|
|
40375
40382
|
}
|
|
40376
40383
|
async function runRunAction(options) {
|
|
40377
|
-
const { pack: packName, from: startPhase, stopAfter, concept: conceptArg, conceptFile, stories: storiesArg, concurrency, outputFormat, projectRoot, events: eventsFlag, verbose: verboseFlag, tui: tuiFlag, skipUx, research: researchFlag, skipResearch: skipResearchFlag, skipPreflight, epic: epicNumber, dryRun, maxReviewCycles = 2, engine, registry: injectedRegistry } = options;
|
|
40384
|
+
const { pack: packName, from: startPhase, stopAfter, concept: conceptArg, conceptFile, stories: storiesArg, concurrency, outputFormat, projectRoot, events: eventsFlag, verbose: verboseFlag, tui: tuiFlag, skipUx, research: researchFlag, skipResearch: skipResearchFlag, skipPreflight, epic: epicNumber, dryRun, maxReviewCycles = 2, engine, agent: agentId, registry: injectedRegistry } = options;
|
|
40378
40385
|
const resolvedEngine = engine ?? "linear";
|
|
40379
40386
|
if (!VALID_ENGINES.includes(resolvedEngine)) {
|
|
40380
40387
|
const errorMsg = `Invalid engine '${engine}'. Valid values: ${VALID_ENGINES.join(", ")}`;
|
|
@@ -40538,7 +40545,8 @@ async function runRunAction(options) {
|
|
|
40538
40545
|
telemetryEnabled: true,
|
|
40539
40546
|
telemetryPort
|
|
40540
40547
|
} : {},
|
|
40541
|
-
maxReviewCycles
|
|
40548
|
+
maxReviewCycles,
|
|
40549
|
+
agentId
|
|
40542
40550
|
});
|
|
40543
40551
|
let storyKeys = [...parsedStoryKeys];
|
|
40544
40552
|
if (!existsSync$1(dbDir)) mkdirSync$1(dbDir, { recursive: true });
|
|
@@ -40756,7 +40764,7 @@ async function runRunAction(options) {
|
|
|
40756
40764
|
const costUsd = (input * 3 + output * 15) / 1e6;
|
|
40757
40765
|
addTokenUsage(adapter, pipelineRun.id, {
|
|
40758
40766
|
phase: payload.phase,
|
|
40759
|
-
agent: "claude-code",
|
|
40767
|
+
agent: agentId ?? "claude-code",
|
|
40760
40768
|
input_tokens: input,
|
|
40761
40769
|
output_tokens: output,
|
|
40762
40770
|
cost_usd: costUsd,
|
|
@@ -40970,7 +40978,8 @@ async function runRunAction(options) {
|
|
|
40970
40978
|
pack,
|
|
40971
40979
|
contextCompiler,
|
|
40972
40980
|
dispatcher,
|
|
40973
|
-
projectRoot
|
|
40981
|
+
projectRoot,
|
|
40982
|
+
agentId
|
|
40974
40983
|
};
|
|
40975
40984
|
const sdlcEventBus = eventBus;
|
|
40976
40985
|
const handlerRegistry = buildSdlcHandlerRegistry({
|
|
@@ -40980,7 +40989,8 @@ async function runRunAction(options) {
|
|
|
40980
40989
|
db: adapter,
|
|
40981
40990
|
pack,
|
|
40982
40991
|
contextCompiler,
|
|
40983
|
-
dispatcher
|
|
40992
|
+
dispatcher,
|
|
40993
|
+
agentId
|
|
40984
40994
|
},
|
|
40985
40995
|
phases: {
|
|
40986
40996
|
analysis: runAnalysisPhase,
|
|
@@ -41048,6 +41058,7 @@ async function runRunAction(options) {
|
|
|
41048
41058
|
},
|
|
41049
41059
|
projectRoot,
|
|
41050
41060
|
tokenCeilings,
|
|
41061
|
+
agentId,
|
|
41051
41062
|
...ingestionServer !== void 0 ? { ingestionServer } : {},
|
|
41052
41063
|
...telemetryPersistence !== void 0 ? { telemetryPersistence } : {},
|
|
41053
41064
|
...repoMapInjector !== void 0 ? {
|
|
@@ -41161,7 +41172,7 @@ async function runRunAction(options) {
|
|
|
41161
41172
|
}
|
|
41162
41173
|
}
|
|
41163
41174
|
async function runFullPipeline(options) {
|
|
41164
|
-
const { packName, packPath, dbDir, dbPath, startPhase, stopAfter, concept, concurrency, outputFormat, projectRoot, events: eventsFlag, skipUx, research: researchFlag, skipResearch: skipResearchFlag, skipPreflight, maxReviewCycles = 2, registry: injectedRegistry, tokenCeilings, stories: explicitStories, telemetryEnabled: fullTelemetryEnabled, telemetryPort: fullTelemetryPort } = options;
|
|
41175
|
+
const { packName, packPath, dbDir, dbPath, startPhase, stopAfter, concept, concurrency, outputFormat, projectRoot, events: eventsFlag, skipUx, research: researchFlag, skipResearch: skipResearchFlag, skipPreflight, maxReviewCycles = 2, registry: injectedRegistry, tokenCeilings, stories: explicitStories, telemetryEnabled: fullTelemetryEnabled, telemetryPort: fullTelemetryPort, agentId } = options;
|
|
41165
41176
|
if (!existsSync$1(dbDir)) mkdirSync$1(dbDir, { recursive: true });
|
|
41166
41177
|
const adapter = createDatabaseAdapter({
|
|
41167
41178
|
backend: "auto",
|
|
@@ -41202,7 +41213,8 @@ async function runFullPipeline(options) {
|
|
|
41202
41213
|
db: adapter,
|
|
41203
41214
|
pack,
|
|
41204
41215
|
contextCompiler,
|
|
41205
|
-
dispatcher
|
|
41216
|
+
dispatcher,
|
|
41217
|
+
agentId
|
|
41206
41218
|
};
|
|
41207
41219
|
let effectiveResearch = pack.manifest.research === true;
|
|
41208
41220
|
if (researchFlag === true) effectiveResearch = true;
|
|
@@ -41294,7 +41306,7 @@ async function runFullPipeline(options) {
|
|
|
41294
41306
|
const costUsd = (result.tokenUsage.input * 3 + result.tokenUsage.output * 15) / 1e6;
|
|
41295
41307
|
await addTokenUsage(adapter, runId, {
|
|
41296
41308
|
phase: "analysis",
|
|
41297
|
-
agent: "claude-code",
|
|
41309
|
+
agent: agentId ?? "claude-code",
|
|
41298
41310
|
input_tokens: result.tokenUsage.input,
|
|
41299
41311
|
output_tokens: result.tokenUsage.output,
|
|
41300
41312
|
cost_usd: costUsd
|
|
@@ -41319,7 +41331,7 @@ async function runFullPipeline(options) {
|
|
|
41319
41331
|
const costUsd = (result.tokenUsage.input * 3 + result.tokenUsage.output * 15) / 1e6;
|
|
41320
41332
|
await addTokenUsage(adapter, runId, {
|
|
41321
41333
|
phase: "planning",
|
|
41322
|
-
agent: "claude-code",
|
|
41334
|
+
agent: agentId ?? "claude-code",
|
|
41323
41335
|
input_tokens: result.tokenUsage.input,
|
|
41324
41336
|
output_tokens: result.tokenUsage.output,
|
|
41325
41337
|
cost_usd: costUsd
|
|
@@ -41347,7 +41359,7 @@ async function runFullPipeline(options) {
|
|
|
41347
41359
|
const costUsd = (result.tokenUsage.input * 3 + result.tokenUsage.output * 15) / 1e6;
|
|
41348
41360
|
await addTokenUsage(adapter, runId, {
|
|
41349
41361
|
phase: "research",
|
|
41350
|
-
agent: "claude-code",
|
|
41362
|
+
agent: agentId ?? "claude-code",
|
|
41351
41363
|
input_tokens: result.tokenUsage.input,
|
|
41352
41364
|
output_tokens: result.tokenUsage.output,
|
|
41353
41365
|
cost_usd: costUsd
|
|
@@ -41372,7 +41384,7 @@ async function runFullPipeline(options) {
|
|
|
41372
41384
|
const costUsd = (result.tokenUsage.input * 3 + result.tokenUsage.output * 15) / 1e6;
|
|
41373
41385
|
await addTokenUsage(adapter, runId, {
|
|
41374
41386
|
phase: "ux-design",
|
|
41375
|
-
agent: "claude-code",
|
|
41387
|
+
agent: agentId ?? "claude-code",
|
|
41376
41388
|
input_tokens: result.tokenUsage.input,
|
|
41377
41389
|
output_tokens: result.tokenUsage.output,
|
|
41378
41390
|
cost_usd: costUsd
|
|
@@ -41397,7 +41409,7 @@ async function runFullPipeline(options) {
|
|
|
41397
41409
|
const costUsd = (result.tokenUsage.input * 3 + result.tokenUsage.output * 15) / 1e6;
|
|
41398
41410
|
await addTokenUsage(adapter, runId, {
|
|
41399
41411
|
phase: "solutioning",
|
|
41400
|
-
agent: "claude-code",
|
|
41412
|
+
agent: agentId ?? "claude-code",
|
|
41401
41413
|
input_tokens: result.tokenUsage.input,
|
|
41402
41414
|
output_tokens: result.tokenUsage.output,
|
|
41403
41415
|
cost_usd: costUsd
|
|
@@ -41456,6 +41468,7 @@ async function runFullPipeline(options) {
|
|
|
41456
41468
|
},
|
|
41457
41469
|
projectRoot,
|
|
41458
41470
|
tokenCeilings,
|
|
41471
|
+
agentId,
|
|
41459
41472
|
...fpIngestionServer !== void 0 ? { ingestionServer: fpIngestionServer } : {},
|
|
41460
41473
|
...fpTelemetryPersistence !== void 0 ? { telemetryPersistence: fpTelemetryPersistence } : {}
|
|
41461
41474
|
});
|
|
@@ -41467,7 +41480,7 @@ async function runFullPipeline(options) {
|
|
|
41467
41480
|
const costUsd = (input * 3 + output * 15) / 1e6;
|
|
41468
41481
|
addTokenUsage(adapter, runId, {
|
|
41469
41482
|
phase: payload.phase,
|
|
41470
|
-
agent: "claude-code",
|
|
41483
|
+
agent: agentId ?? "claude-code",
|
|
41471
41484
|
input_tokens: input,
|
|
41472
41485
|
output_tokens: output,
|
|
41473
41486
|
cost_usd: costUsd
|
|
@@ -41588,7 +41601,7 @@ async function runFullPipeline(options) {
|
|
|
41588
41601
|
}
|
|
41589
41602
|
}
|
|
41590
41603
|
function registerRunCommand(program, _version = "0.0.0", projectRoot = process.cwd(), registry) {
|
|
41591
|
-
program.command("run").description("Run the autonomous pipeline (use --from to start from a specific phase)").option("--pack <name>", "Methodology pack name", "bmad").option("--from <phase>", "Start from this phase: analysis, planning, solutioning, implementation").option("--stop-after <phase>", "Stop pipeline after this phase completes").option("--concept <text>", "Inline concept text (required when --from analysis)").option("--concept-file <path>", "Path to a file containing the concept text").option("--stories <keys>", "Comma-separated story keys (e.g., 10-1,10-2)").option("--epic <n>", "Scope story discovery to a single epic number (e.g., 27)", (v) => parseInt(v, 10)).option("--concurrency <n>", "Maximum parallel conflict groups", (v) => parseInt(v, 10), 3).option("--project-root <path>", "Project root directory", projectRoot).option("--output-format <format>", "Output format: human (default) or json", "human").option("--events", "Emit structured NDJSON events on stdout for programmatic consumption").option("--verbose", "Show detailed pino log output").option("--help-agent", "Print a machine-optimized prompt fragment for AI agents and exit").option("--tui", "Show TUI dashboard").option("--skip-ux", "Skip the UX design phase even if enabled in the pack manifest").option("--research", "Enable the research phase even if not set in the pack manifest").option("--skip-research", "Skip the research phase even if enabled in the pack manifest").option("--skip-preflight", "Skip the pre-flight build check (escape hatch for known-broken projects)").option("--max-review-cycles <n>", "Maximum review cycles per story (default: 2)", (v) => parseInt(v, 10), 2).option("--dry-run", "Preview routing and repo-map injection without dispatching (Story 28-9)").option("--engine <type>", "Execution engine: linear (default) or graph").action(async (opts) => {
|
|
41604
|
+
program.command("run").description("Run the autonomous pipeline (use --from to start from a specific phase)").option("--pack <name>", "Methodology pack name", "bmad").option("--from <phase>", "Start from this phase: analysis, planning, solutioning, implementation").option("--stop-after <phase>", "Stop pipeline after this phase completes").option("--concept <text>", "Inline concept text (required when --from analysis)").option("--concept-file <path>", "Path to a file containing the concept text").option("--stories <keys>", "Comma-separated story keys (e.g., 10-1,10-2)").option("--epic <n>", "Scope story discovery to a single epic number (e.g., 27)", (v) => parseInt(v, 10)).option("--concurrency <n>", "Maximum parallel conflict groups", (v) => parseInt(v, 10), 3).option("--project-root <path>", "Project root directory", projectRoot).option("--output-format <format>", "Output format: human (default) or json", "human").option("--events", "Emit structured NDJSON events on stdout for programmatic consumption").option("--verbose", "Show detailed pino log output").option("--help-agent", "Print a machine-optimized prompt fragment for AI agents and exit").option("--tui", "Show TUI dashboard").option("--skip-ux", "Skip the UX design phase even if enabled in the pack manifest").option("--research", "Enable the research phase even if not set in the pack manifest").option("--skip-research", "Skip the research phase even if enabled in the pack manifest").option("--skip-preflight", "Skip the pre-flight build check (escape hatch for known-broken projects)").option("--max-review-cycles <n>", "Maximum review cycles per story (default: 2)", (v) => parseInt(v, 10), 2).option("--dry-run", "Preview routing and repo-map injection without dispatching (Story 28-9)").option("--engine <type>", "Execution engine: linear (default) or graph").option("--agent <id>", "Agent backend: claude-code (default), codex, or gemini").action(async (opts) => {
|
|
41592
41605
|
if (opts.helpAgent) {
|
|
41593
41606
|
process.exitCode = await runHelpAgent();
|
|
41594
41607
|
return;
|
|
@@ -41626,6 +41639,7 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
|
|
|
41626
41639
|
maxReviewCycles: opts.maxReviewCycles,
|
|
41627
41640
|
dryRun: opts.dryRun,
|
|
41628
41641
|
engine: opts.engine,
|
|
41642
|
+
agent: opts.agent,
|
|
41629
41643
|
registry
|
|
41630
41644
|
});
|
|
41631
41645
|
process.exitCode = exitCode;
|
|
@@ -41634,4 +41648,4 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
|
|
|
41634
41648
|
|
|
41635
41649
|
//#endregion
|
|
41636
41650
|
export { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, EpicIngester, GitClient, GrammarLoader, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, normalizeGraphSummaryToStatus, registerExportCommand, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runRunAction, runSolutioningPhase, validateStopAfterFromConflict };
|
|
41637
|
-
//# sourceMappingURL=run-
|
|
41651
|
+
//# sourceMappingURL=run-1Ywys7Fy.js.map
|
|
@@ -2,7 +2,7 @@ import "./health-DJgGZhW-.js";
|
|
|
2
2
|
import "./logger-KeHncl-f.js";
|
|
3
3
|
import "./helpers-CElYrONe.js";
|
|
4
4
|
import "./dist-adzGUKPc.js";
|
|
5
|
-
import { normalizeGraphSummaryToStatus, registerRunCommand, runRunAction } from "./run-
|
|
5
|
+
import { normalizeGraphSummaryToStatus, registerRunCommand, runRunAction } from "./run-1Ywys7Fy.js";
|
|
6
6
|
import "./routing-CcBOCuC9.js";
|
|
7
7
|
import "./decisions-C0pz9Clx.js";
|
|
8
8
|
|