substrate-ai 0.2.10 → 0.2.11
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 { createLogger, deepMask } from "../logger-C6n1g8uP.js";
|
|
3
3
|
import { AdapterRegistry, createEventBus } from "../event-bus-J-bw-pkp.js";
|
|
4
4
|
import { CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, PartialSubstrateConfigSchema, SUPPORTED_CONFIG_FORMAT_VERSIONS, SubstrateConfigSchema, defaultConfigMigrator } from "../version-manager-impl-BpVx2DkY.js";
|
|
5
|
-
import { DatabaseWrapper, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, buildPipelineStatusOutput, createContextCompiler, createDispatcher, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getSubstrateDefaultSettings, parseDbTimestampAsUtc, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, runAnalysisPhase, runMigrations, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-
|
|
5
|
+
import { DatabaseWrapper, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, buildPipelineStatusOutput, createContextCompiler, createDispatcher, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getSubstrateDefaultSettings, parseDbTimestampAsUtc, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, runAnalysisPhase, runMigrations, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-L-R_XYNT.js";
|
|
6
6
|
import { ConfigError, ConfigIncompatibleFormatError } from "../errors-BPqtzQ4U.js";
|
|
7
7
|
import { addTokenUsage, createDecision, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getTokenUsageSummary, listRequirements, updatePipelineRun } from "../decisions-DNYByk0U.js";
|
|
8
8
|
import { aggregateTokenUsageForRun, compareRunMetrics, getBaselineRunMetrics, getRunMetrics, getStoryMetricsForRun, incrementRunRestarts, listRunMetrics, tagRunAsBaseline } from "../metrics-BSg8VIHd.js";
|
|
@@ -2833,7 +2833,7 @@ async function runSupervisorAction(options, deps = {}) {
|
|
|
2833
2833
|
const expDb = expDbWrapper.db;
|
|
2834
2834
|
const { runRunAction: runPipeline } = await import(
|
|
2835
2835
|
/* @vite-ignore */
|
|
2836
|
-
"../run-
|
|
2836
|
+
"../run-C8aOWnKG.js"
|
|
2837
2837
|
);
|
|
2838
2838
|
const runStoryFn = async (opts) => {
|
|
2839
2839
|
const exitCode = await runPipeline({
|
|
@@ -2973,6 +2973,7 @@ async function runSupervisorAction(options, deps = {}) {
|
|
|
2973
2973
|
function registerSupervisorCommand(program, _version = "0.0.0", projectRoot = process.cwd()) {
|
|
2974
2974
|
program.command("supervisor").description("Monitor a pipeline run and automatically recover from stalls").option("--poll-interval <seconds>", "Health poll interval in seconds", (v) => parseInt(v, 10), 60).option("--stall-threshold <seconds>", "Staleness in seconds before killing a stalled pipeline", (v) => parseInt(v, 10), 600).option("--max-restarts <n>", "Maximum automatic restarts before aborting", (v) => parseInt(v, 10), 3).option("--run-id <id>", "Pipeline run ID to monitor (defaults to latest)").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("--experiment", "After post-run analysis, enter experiment mode: create branches, apply modifications, run single-story experiments, and report verdicts (Story 17-4)", false).option("--max-experiments <n>", "Maximum number of experiments to run per analysis cycle (default: 2, Story 17-4 AC6)", (v) => parseInt(v, 10), 2).action(async (opts) => {
|
|
2975
2975
|
const outputFormat = opts.outputFormat === "json" ? "json" : "human";
|
|
2976
|
+
if (opts.stallThreshold < 120) console.warn(`Warning: --stall-threshold ${opts.stallThreshold}s is below 120s. Agent steps typically take 45-90s. This may cause false stall detections and wasted restarts.`);
|
|
2976
2977
|
const exitCode = await runSupervisorAction({
|
|
2977
2978
|
pollInterval: opts.pollInterval,
|
|
2978
2979
|
stallThreshold: opts.stallThreshold,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./logger-C6n1g8uP.js";
|
|
2
2
|
import "./event-bus-J-bw-pkp.js";
|
|
3
|
-
import { registerRunCommand, runRunAction } from "./run-
|
|
3
|
+
import { registerRunCommand, runRunAction } from "./run-L-R_XYNT.js";
|
|
4
4
|
import "./decisions-DNYByk0U.js";
|
|
5
5
|
import "./metrics-BSg8VIHd.js";
|
|
6
6
|
|
|
@@ -2215,10 +2215,14 @@ Options:
|
|
|
2215
2215
|
- \`--stories <keys>\` — Comma-separated story keys to process (e.g., \`7-1,7-2\`)
|
|
2216
2216
|
- \`--verbose\` — Enable verbose logging output
|
|
2217
2217
|
- \`--pack <name>\` — Methodology pack name (default: bmad)
|
|
2218
|
-
- \`--from <phase>\` — Start from this phase: analysis, planning, solutioning, implementation
|
|
2218
|
+
- \`--from <phase>\` — Start from this phase: research, analysis, planning, solutioning, implementation
|
|
2219
2219
|
- \`--stop-after <phase>\` — Stop pipeline after this phase completes
|
|
2220
2220
|
- \`--concurrency <n>\` — Maximum parallel conflict groups (default: 3)
|
|
2221
2221
|
- \`--output-format <format>\` — Output format: human (default) or json
|
|
2222
|
+
- \`--concept <text>\` — Inline concept text (required when --from analysis)
|
|
2223
|
+
- \`--research\` — Enable the research phase even if not set in the pack config
|
|
2224
|
+
- \`--skip-research\` — Skip the research phase even if enabled in the pack config
|
|
2225
|
+
- \`--skip-ux\` — Skip the UX design phase even if enabled in the pack config
|
|
2222
2226
|
- \`--help-agent\` — Print this agent instruction fragment and exit
|
|
2223
2227
|
|
|
2224
2228
|
Examples:
|
|
@@ -2285,12 +2289,51 @@ Options:
|
|
|
2285
2289
|
- \`--analysis <run-id>\` — Read and output the analysis report with optimization recommendations for a specific run
|
|
2286
2290
|
- \`--output-format <format>\` — Output format: human (default) or json
|
|
2287
2291
|
|
|
2292
|
+
### substrate export
|
|
2293
|
+
Export decision store contents as human-readable markdown files.
|
|
2294
|
+
|
|
2295
|
+
\`\`\`
|
|
2296
|
+
substrate export [options]
|
|
2297
|
+
\`\`\`
|
|
2298
|
+
|
|
2299
|
+
Options:
|
|
2300
|
+
- \`--run-id <id>\` — Pipeline run ID to export (defaults to latest run)
|
|
2301
|
+
- \`--output-dir <path>\` — Directory to write exported files to (default: _bmad-output/planning-artifacts/)
|
|
2302
|
+
- \`--output-format <format>\` — Output format: human (default) or json
|
|
2303
|
+
|
|
2288
2304
|
### substrate health
|
|
2289
2305
|
Check pipeline health, stall detection, and process status.
|
|
2290
2306
|
|
|
2291
2307
|
\`\`\`
|
|
2292
2308
|
substrate health [--output-format json]
|
|
2293
2309
|
\`\`\`
|
|
2310
|
+
|
|
2311
|
+
### substrate cost
|
|
2312
|
+
Show cost breakdown for the current session.
|
|
2313
|
+
|
|
2314
|
+
\`\`\`
|
|
2315
|
+
substrate cost [--output-format json]
|
|
2316
|
+
\`\`\`
|
|
2317
|
+
|
|
2318
|
+
### substrate amend
|
|
2319
|
+
Run an amendment pipeline against a completed run.
|
|
2320
|
+
|
|
2321
|
+
\`\`\`
|
|
2322
|
+
substrate amend [options]
|
|
2323
|
+
\`\`\`
|
|
2324
|
+
|
|
2325
|
+
### substrate brainstorm
|
|
2326
|
+
Interactive multi-persona brainstorm session with Pragmatic Engineer, Product Thinker, and Devil's Advocate.
|
|
2327
|
+
|
|
2328
|
+
\`\`\`
|
|
2329
|
+
substrate brainstorm [options]
|
|
2330
|
+
\`\`\`
|
|
2331
|
+
|
|
2332
|
+
Session commands: \`!wrap\` (save & exit), \`!quit\` (exit without saving), \`!help\`
|
|
2333
|
+
|
|
2334
|
+
## Environment Variables
|
|
2335
|
+
|
|
2336
|
+
- \`SUBSTRATE_MEMORY_THRESHOLD_MB\` — Override the free-memory threshold (in MB) for agent dispatch. Default: 512. On macOS, the conservative memory detection may report low availability even when ample RAM exists. Lower this (e.g., 256) if pipelines stall due to memory pressure false positives.
|
|
2294
2337
|
`;
|
|
2295
2338
|
}
|
|
2296
2339
|
/**
|
|
@@ -2842,7 +2885,14 @@ const logger$12 = createLogger("agent-dispatch");
|
|
|
2842
2885
|
const SHUTDOWN_GRACE_MS = 1e4;
|
|
2843
2886
|
const SHUTDOWN_MAX_WAIT_MS = 3e4;
|
|
2844
2887
|
const CHARS_PER_TOKEN = 4;
|
|
2845
|
-
const MIN_FREE_MEMORY_BYTES =
|
|
2888
|
+
const MIN_FREE_MEMORY_BYTES = (() => {
|
|
2889
|
+
const envMB = process.env.SUBSTRATE_MEMORY_THRESHOLD_MB;
|
|
2890
|
+
if (envMB) {
|
|
2891
|
+
const parsed = parseInt(envMB, 10);
|
|
2892
|
+
if (!isNaN(parsed) && parsed >= 0) return parsed * 1024 * 1024;
|
|
2893
|
+
}
|
|
2894
|
+
return 512 * 1024 * 1024;
|
|
2895
|
+
})();
|
|
2846
2896
|
const MEMORY_PRESSURE_POLL_MS = 1e4;
|
|
2847
2897
|
/**
|
|
2848
2898
|
* Get available system memory in bytes, accounting for platform differences.
|
|
@@ -11103,4 +11153,4 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
|
|
|
11103
11153
|
|
|
11104
11154
|
//#endregion
|
|
11105
11155
|
export { DatabaseWrapper, SUBSTRATE_OWNED_SETTINGS_KEYS, VALID_PHASES, buildPipelineStatusOutput, createContextCompiler, createDispatcher, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getSubstrateDefaultSettings, parseDbTimestampAsUtc, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, runAnalysisPhase, runMigrations, runPlanningPhase, runRunAction, runSolutioningPhase, validateStopAfterFromConflict };
|
|
11106
|
-
//# sourceMappingURL=run-
|
|
11156
|
+
//# sourceMappingURL=run-L-R_XYNT.js.map
|