substrate-ai 0.6.8 → 0.6.9

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.
@@ -0,0 +1,30 @@
1
+ import { createRequire } from "module";
2
+
3
+ //#region rolldown:runtime
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __commonJS = (cb, mod) => function() {
11
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
15
+ key = keys[i];
16
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
17
+ get: ((k) => from[k]).bind(null, key),
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ return to;
22
+ };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
+ value: mod,
25
+ enumerable: true
26
+ }) : target, mod));
27
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
28
+
29
+ //#endregion
30
+ export { __commonJS, __require, __toESM };
package/dist/cli/index.js CHANGED
@@ -1,15 +1,16 @@
1
1
  #!/usr/bin/env node
2
- import { AdapterTelemetryPersistence, AppError, DEFAULT_CONFIG, DEFAULT_ROUTING_POLICY, DoltClient, DoltNotInstalled, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, FileStateStore, GitClient, GrammarLoader, IngestionServer, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SUBSTRATE_OWNED_SETTINGS_KEYS, SymbolParser, VALID_PHASES, WorkGraphRepository, buildPipelineStatusOutput, checkDoltInstalled, createConfigSystem, createContextCompiler, createDatabaseAdapter, createDispatcher, createDoltClient, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStateStore, createStopAfterGate, createTelemetryAdvisor, detectCycles, findPackageRoot, formatOutput, formatPhaseCompletionSummary, formatPipelineStatusHuman, formatPipelineSummary, formatTokenTelemetry, getAllDescendantPids, getAutoHealthData, getSubstrateDefaultSettings, initSchema, initializeDolt, isSyncAdapter, parseDbTimestampAsUtc, registerHealthCommand, registerRunCommand, resolveBmadMethodSrcPath, resolveBmadMethodVersion, resolveMainRepoRoot, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-tB6yG6o8.js";
3
2
  import { createLogger } from "../logger-D2fS2ccL.js";
4
3
  import { AdapterRegistry } from "../adapter-registry-D2zdMwVu.js";
5
- import { CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, PartialSubstrateConfigSchema } from "../config-migrator-DtZW1maj.js";
6
- import { ConfigError, createEventBus } from "../helpers-BihqWgVe.js";
7
- import { RoutingRecommender } from "../routing-CobBiKeV.js";
8
- import { addTokenUsage, createDecision, createPipelineRun, getDecisionsByCategory, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getTokenUsageSummary, listRequirements, updatePipelineRun } from "../decisions-C6MF2Cax.js";
9
- import { ESCALATION_DIAGNOSIS, EXPERIMENT_RESULT, OPERATIONAL_FINDING, STORY_METRICS, aggregateTokenUsageForRun, compareRunMetrics, getBaselineRunMetrics, getRunMetrics, getStoryMetricsForRun, incrementRunRestarts, listRunMetrics, tagRunAsBaseline } from "../operational-BRpT8MYF.js";
10
- import { abortMerge, createWorktree, getConflictingFiles, getMergedFiles, getOrphanedWorktrees, performMerge, removeBranch, removeWorktree, simulateMerge, verifyGitVersion } from "../git-utils-C-fdrHF_.js";
11
- import "../version-manager-impl-DTlmGvHb.js";
12
- import { registerUpgradeCommand } from "../upgrade-C8_VcI8B.js";
4
+ 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-D3wByPiv.js";
5
+ import { CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, PartialSubstrateConfigSchema } from "../config-migrator-CtGelIsG.js";
6
+ 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-D0lhVJ5C.js";
7
+ import { ConfigError, createEventBus } from "../helpers-DtzxPR0u.js";
8
+ import { RoutingRecommender } from "../routing-DCWkD4MK.js";
9
+ import { addTokenUsage, createDecision, createPipelineRun, getDecisionsByCategory, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getTokenUsageSummary, listRequirements, updatePipelineRun } from "../decisions-BtgXk_My.js";
10
+ import { ESCALATION_DIAGNOSIS, EXPERIMENT_RESULT, OPERATIONAL_FINDING, STORY_METRICS, aggregateTokenUsageForRun, compareRunMetrics, getBaselineRunMetrics, getRunMetrics, getStoryMetricsForRun, incrementRunRestarts, listRunMetrics, tagRunAsBaseline } from "../operational-ChLdRgux.js";
11
+ import { abortMerge, createWorktree, getConflictingFiles, getMergedFiles, getOrphanedWorktrees, performMerge, removeBranch, removeWorktree, simulateMerge, verifyGitVersion } from "../git-utils-DeIYLwa4.js";
12
+ import "../version-manager-impl-CjDZblzf.js";
13
+ import { registerUpgradeCommand } from "../upgrade-CTGnrq33.js";
13
14
  import { Command } from "commander";
14
15
  import { fileURLToPath } from "url";
15
16
  import { dirname, join, resolve } from "path";
@@ -2075,6 +2076,22 @@ async function runStatusAction(options) {
2075
2076
  if (runId !== void 0 && runId !== "") run = await getPipelineRunById(adapter, runId);
2076
2077
  else run = await getLatestRun(adapter);
2077
2078
  if (run === void 0) {
2079
+ const { inspectProcessTree } = await import("../health-gUqQUzBJ.js");
2080
+ const substrateDirPath = join(projectRoot, ".substrate");
2081
+ const processInfo = inspectProcessTree({
2082
+ projectRoot,
2083
+ substrateDirPath
2084
+ });
2085
+ if (processInfo.orchestrator_pid !== null) {
2086
+ const syntheticStatus = {
2087
+ status: "running",
2088
+ message: "Pipeline process detected (no DB state available)",
2089
+ process: processInfo
2090
+ };
2091
+ if (outputFormat === "json") process.stdout.write(formatOutput(syntheticStatus, "json", true) + "\n");
2092
+ else process.stdout.write(`Pipeline is running (PID ${processInfo.orchestrator_pid}) but no DB state available.\n`);
2093
+ return 0;
2094
+ }
2078
2095
  const errorMsg = runId !== void 0 ? `Pipeline run '${runId}' not found.` : "No pipeline runs found. Run `substrate run --events` to start a pipeline first.";
2079
2096
  if (outputFormat === "json") process.stdout.write(formatOutput(null, "json", false, errorMsg) + "\n");
2080
2097
  else process.stderr.write(`Error: ${errorMsg}\n`);
@@ -3472,11 +3489,11 @@ async function runSupervisorAction(options, deps = {}) {
3472
3489
  try {
3473
3490
  const { createExperimenter } = await import(
3474
3491
  /* @vite-ignore */
3475
- "../experimenter-CjfzjmwY.js"
3492
+ "../experimenter-CJ421I-b.js"
3476
3493
  );
3477
3494
  const { getLatestRun: getLatest } = await import(
3478
3495
  /* @vite-ignore */
3479
- "../decisions-BxYj_a1X.js"
3496
+ "../decisions-D7TA7Utm.js"
3480
3497
  );
3481
3498
  const expAdapter = createDatabaseAdapter({
3482
3499
  backend: "auto",
@@ -3486,7 +3503,7 @@ async function runSupervisorAction(options, deps = {}) {
3486
3503
  await initSchema(expAdapter);
3487
3504
  const { runRunAction: runPipeline } = await import(
3488
3505
  /* @vite-ignore */
3489
- "../run-ME16n4N_.js"
3506
+ "../run-BQ8lXoyf.js"
3490
3507
  );
3491
3508
  const runStoryFn = async (opts) => {
3492
3509
  const exitCode = await runPipeline({
@@ -4002,7 +4019,7 @@ async function runMetricsAction(options) {
4002
4019
  const routingConfigPath = join(dbDir, "routing.yml");
4003
4020
  let routingConfig = null;
4004
4021
  if (existsSync(routingConfigPath)) try {
4005
- const { loadModelRoutingConfig } = await import("../routing-CpsRPjLE.js");
4022
+ const { loadModelRoutingConfig } = await import("../routing-Cl1TgNvZ.js");
4006
4023
  routingConfig = loadModelRoutingConfig(routingConfigPath);
4007
4024
  } catch {}
4008
4025
  if (routingConfig === null) routingConfig = {
@@ -8909,8 +8926,8 @@ async function createProgram() {
8909
8926
  /** Fire-and-forget startup version check (story 8.3, AC3/AC5) */
8910
8927
  function checkForUpdatesInBackground(currentVersion) {
8911
8928
  if (process.env.SUBSTRATE_NO_UPDATE_CHECK === "1") return;
8912
- import("../upgrade-njy4XENS.js").then(async () => {
8913
- const { createVersionManager } = await import("../version-manager-impl-QwroczYS.js");
8929
+ import("../upgrade-CBSusHh-.js").then(async () => {
8930
+ const { createVersionManager } = await import("../version-manager-impl-AcT89lmM.js");
8914
8931
  const vm = createVersionManager();
8915
8932
  const result = await vm.checkForUpdates();
8916
8933
  if (result.updateAvailable) {
@@ -247,4 +247,4 @@ const defaultConfigMigrator = new ConfigMigrator();
247
247
 
248
248
  //#endregion
249
249
  export { CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, PartialSubstrateConfigSchema, SUPPORTED_CONFIG_FORMAT_VERSIONS, SUPPORTED_TASK_GRAPH_VERSIONS, SubstrateConfigSchema, defaultConfigMigrator };
250
- //# sourceMappingURL=config-migrator-DtZW1maj.js.map
250
+ //# sourceMappingURL=config-migrator-CtGelIsG.js.map
@@ -394,4 +394,4 @@ async function getTokenUsageSummary(adapter, runId) {
394
394
 
395
395
  //#endregion
396
396
  export { addTokenUsage, createDecision, createPipelineRun, createRequirement, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunningPipelineRuns, getTokenUsageSummary, listRequirements, registerArtifact, updateDecision, updatePipelineRun, updatePipelineRunConfig, upsertDecision };
397
- //# sourceMappingURL=decisions-C6MF2Cax.js.map
397
+ //# sourceMappingURL=decisions-BtgXk_My.js.map
@@ -1,3 +1,3 @@
1
- import { addTokenUsage, createDecision, createPipelineRun, createRequirement, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunningPipelineRuns, getTokenUsageSummary, listRequirements, registerArtifact, updateDecision, updatePipelineRun, updatePipelineRunConfig, upsertDecision } from "./decisions-C6MF2Cax.js";
1
+ import { addTokenUsage, createDecision, createPipelineRun, createRequirement, getArtifactByTypeForRun, getArtifactsByRun, getDecisionsByCategory, getDecisionsByPhase, getDecisionsByPhaseForRun, getLatestRun, getPipelineRunById, getRunningPipelineRuns, getTokenUsageSummary, listRequirements, registerArtifact, updateDecision, updatePipelineRun, updatePipelineRunConfig, upsertDecision } from "./decisions-BtgXk_My.js";
2
2
 
3
3
  export { getLatestRun };
@@ -1,7 +1,7 @@
1
1
  import "./logger-D2fS2ccL.js";
2
- import { createDecision } from "./decisions-C6MF2Cax.js";
3
- import { EXPERIMENT_RESULT, getRunMetrics, getStoryMetricsForRun } from "./operational-BRpT8MYF.js";
4
- import { spawnGit } from "./git-utils-C-fdrHF_.js";
2
+ import { createDecision } from "./decisions-BtgXk_My.js";
3
+ import { EXPERIMENT_RESULT, getRunMetrics, getStoryMetricsForRun } from "./operational-ChLdRgux.js";
4
+ import { spawnGit } from "./git-utils-DeIYLwa4.js";
5
5
  import { spawn } from "node:child_process";
6
6
  import { join } from "node:path";
7
7
  import { mkdir, readFile, writeFile } from "node:fs/promises";
@@ -500,4 +500,4 @@ function createExperimenter(config, deps) {
500
500
 
501
501
  //#endregion
502
502
  export { createExperimenter };
503
- //# sourceMappingURL=experimenter-CjfzjmwY.js.map
503
+ //# sourceMappingURL=experimenter-CJ421I-b.js.map
@@ -362,4 +362,4 @@ async function getMergedFiles(cwd) {
362
362
 
363
363
  //#endregion
364
364
  export { abortMerge, createWorktree, getConflictingFiles, getMergedFiles, getOrphanedWorktrees, performMerge, removeBranch, removeWorktree, simulateMerge, spawnGit, verifyGitVersion };
365
- //# sourceMappingURL=git-utils-C-fdrHF_.js.map
365
+ //# sourceMappingURL=git-utils-DeIYLwa4.js.map