substrate-ai 0.17.0 → 0.17.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
@@ -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, EXPERIMENT_RESULT, 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, listRequirements, listRunMetrics, loadParentRunDecisions, supersedeDecision, tagRunAsBaseline, updatePipelineRun } from "../dist-CLvAwmT7.js";
6
6
  import "../adapter-registry-DXLMTmfD.js";
7
- import { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, GitClient, GrammarLoader, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-DZwHUMeE.js";
7
+ import { AdapterTelemetryPersistence, AppError, DoltRepoMapMetaRepository, DoltSymbolRepository, ERR_REPO_MAP_STORAGE_WRITE, GitClient, GrammarLoader, RepoMapInjector, RepoMapModule, RepoMapQueryEngine, RepoMapStorage, SymbolParser, createContextCompiler, createDispatcher, createEventEmitter, createImplementationOrchestrator, createPackLoader, createPhaseOrchestrator, createStopAfterGate, createTelemetryAdvisor, formatPhaseCompletionSummary, getFactoryRunSummaries, getScenarioResultsForRun, getTwinRunsForRun, listGraphRuns, registerFactoryCommand, registerRunCommand, registerScenariosCommand, resolveStoryKeys, runAnalysisPhase, runPlanningPhase, runSolutioningPhase, validateStopAfterFromConflict } from "../run-Bku8fmY3.js";
8
8
  import "../errors-D1LU8CZ9.js";
9
9
  import "../routing-CcBOCuC9.js";
10
10
  import "../decisions-C0pz9Clx.js";
@@ -1757,14 +1757,16 @@ function clearBmadCommandFiles(commandsDir) {
1757
1757
  }
1758
1758
  async function compileBmadAgents(bmadDir) {
1759
1759
  const _require = createRequire(join(__dirname, "synthetic.js"));
1760
- let compilerPath;
1760
+ let compileAgent;
1761
1761
  try {
1762
1762
  const pkgJsonPath = _require.resolve("bmad-method/package.json");
1763
- compilerPath = join(dirname(pkgJsonPath), "tools", "cli", "lib", "agent", "compiler.js");
1763
+ const compilerPath = join(dirname(pkgJsonPath), "tools", "cli", "lib", "agent", "compiler.js");
1764
+ if (!existsSync$1(compilerPath)) return 0;
1765
+ const mod = _require(compilerPath);
1766
+ compileAgent = mod.compileAgent;
1764
1767
  } catch {
1765
1768
  return 0;
1766
1769
  }
1767
- const { compileAgent } = _require(compilerPath);
1768
1770
  const agentDirs = [];
1769
1771
  const coreAgentsDir = join(bmadDir, "core", "agents");
1770
1772
  if (existsSync$1(coreAgentsDir)) agentDirs.push(coreAgentsDir);
@@ -1822,17 +1824,39 @@ async function scaffoldClaudeCommands(projectRoot, outputFormat) {
1822
1824
  if (def && typeof def[name] === "function") return def[name];
1823
1825
  throw new Error(`${name} is not a constructor`);
1824
1826
  };
1825
- const agentMod = _require(join(installerLibPath, "ide", "shared", "agent-command-generator.js"));
1827
+ const agentGenPath = join(installerLibPath, "ide", "shared", "agent-command-generator.js");
1828
+ const workflowGenPath = join(installerLibPath, "ide", "shared", "workflow-command-generator.js");
1829
+ const taskToolGenPath = join(installerLibPath, "ide", "shared", "task-tool-command-generator.js");
1830
+ const manifestGenPath = join(installerLibPath, "core", "manifest-generator.js");
1831
+ const pathUtilsPath = join(installerLibPath, "ide", "shared", "path-utils.js");
1832
+ if (!existsSync$1(agentGenPath)) {
1833
+ logger$15.info("bmad-method generators not available (requires bmad-method with agent/workflow/task-tool generators)");
1834
+ return;
1835
+ }
1836
+ const agentMod = _require(agentGenPath);
1826
1837
  const AgentCommandGenerator = resolveExport(agentMod, "AgentCommandGenerator");
1827
- const workflowMod = _require(join(installerLibPath, "ide", "shared", "workflow-command-generator.js"));
1828
- const WorkflowCommandGenerator = resolveExport(workflowMod, "WorkflowCommandGenerator");
1829
- const taskToolMod = _require(join(installerLibPath, "ide", "shared", "task-tool-command-generator.js"));
1830
- const TaskToolCommandGenerator = resolveExport(taskToolMod, "TaskToolCommandGenerator");
1831
- const manifestMod = _require(join(installerLibPath, "core", "manifest-generator.js"));
1832
- const ManifestGenerator = resolveExport(manifestMod, "ManifestGenerator");
1833
- const pathUtilsMod = _require(join(installerLibPath, "ide", "shared", "path-utils.js"));
1834
- const pathUtils = { toDashPath: pathUtilsMod.toDashPath ?? pathUtilsMod.default?.toDashPath };
1838
+ let WorkflowCommandGenerator = null;
1839
+ let TaskToolCommandGenerator = null;
1840
+ if (existsSync$1(workflowGenPath)) {
1841
+ const workflowMod = _require(workflowGenPath);
1842
+ WorkflowCommandGenerator = resolveExport(workflowMod, "WorkflowCommandGenerator");
1843
+ } else logger$15.info("bmad-method workflow-command-generator not available; skipping workflow commands");
1844
+ if (existsSync$1(taskToolGenPath)) {
1845
+ const taskToolMod = _require(taskToolGenPath);
1846
+ TaskToolCommandGenerator = resolveExport(taskToolMod, "TaskToolCommandGenerator");
1847
+ } else logger$15.info("bmad-method task-tool-command-generator not available; skipping task/tool commands");
1848
+ let ManifestGenerator = null;
1849
+ if (existsSync$1(manifestGenPath)) {
1850
+ const manifestMod = _require(manifestGenPath);
1851
+ ManifestGenerator = resolveExport(manifestMod, "ManifestGenerator");
1852
+ }
1853
+ let pathUtils = null;
1854
+ if (existsSync$1(pathUtilsPath)) {
1855
+ const pathUtilsMod = _require(pathUtilsPath);
1856
+ pathUtils = { toDashPath: pathUtilsMod.toDashPath ?? pathUtilsMod.default?.toDashPath };
1857
+ }
1835
1858
  const writeDashFallback = async (baseDir, artifacts, acceptTypes) => {
1859
+ if (!pathUtils) return 0;
1836
1860
  let written = 0;
1837
1861
  for (const artifact of artifacts) {
1838
1862
  if (!acceptTypes.includes(artifact.type)) continue;
@@ -1848,7 +1872,7 @@ async function scaffoldClaudeCommands(projectRoot, outputFormat) {
1848
1872
  };
1849
1873
  const nonCoreModules = scanBmadModules(bmadDir);
1850
1874
  const allModules = ["core", ...nonCoreModules];
1851
- try {
1875
+ if (ManifestGenerator) try {
1852
1876
  const manifestGen = new ManifestGenerator();
1853
1877
  await manifestGen.generateManifests(bmadDir, allModules, [], { ides: ["claude-code"] });
1854
1878
  } catch (manifestErr) {
@@ -1860,12 +1884,18 @@ async function scaffoldClaudeCommands(projectRoot, outputFormat) {
1860
1884
  const agentGen = new AgentCommandGenerator("_bmad");
1861
1885
  const { artifacts: agentArtifacts } = await agentGen.collectAgentArtifacts(bmadDir, nonCoreModules);
1862
1886
  const agentCount = typeof agentGen.writeDashArtifacts === "function" ? await agentGen.writeDashArtifacts(commandsDir, agentArtifacts) : await writeDashFallback(commandsDir, agentArtifacts, ["agent-launcher"]);
1863
- const workflowGen = new WorkflowCommandGenerator("_bmad");
1864
- const { artifacts: workflowArtifacts } = await workflowGen.collectWorkflowArtifacts(bmadDir);
1865
- const workflowCount = typeof workflowGen.writeDashArtifacts === "function" ? await workflowGen.writeDashArtifacts(commandsDir, workflowArtifacts) : await writeDashFallback(commandsDir, workflowArtifacts, ["workflow-command", "workflow-launcher"]);
1866
- const taskToolGen = new TaskToolCommandGenerator("_bmad");
1867
- const { artifacts: taskToolArtifacts } = await taskToolGen.collectTaskToolArtifacts(bmadDir);
1868
- const taskToolCount = typeof taskToolGen.writeDashArtifacts === "function" ? await taskToolGen.writeDashArtifacts(commandsDir, taskToolArtifacts) : await writeDashFallback(commandsDir, taskToolArtifacts, ["task", "tool"]);
1887
+ let workflowCount = 0;
1888
+ if (WorkflowCommandGenerator) {
1889
+ const workflowGen = new WorkflowCommandGenerator("_bmad");
1890
+ const { artifacts: workflowArtifacts } = await workflowGen.collectWorkflowArtifacts(bmadDir);
1891
+ workflowCount = typeof workflowGen.writeDashArtifacts === "function" ? await workflowGen.writeDashArtifacts(commandsDir, workflowArtifacts) : await writeDashFallback(commandsDir, workflowArtifacts, ["workflow-command", "workflow-launcher"]);
1892
+ }
1893
+ let taskToolCount = 0;
1894
+ if (TaskToolCommandGenerator) {
1895
+ const taskToolGen = new TaskToolCommandGenerator("_bmad");
1896
+ const { artifacts: taskToolArtifacts } = await taskToolGen.collectTaskToolArtifacts(bmadDir);
1897
+ taskToolCount = typeof taskToolGen.writeDashArtifacts === "function" ? await taskToolGen.writeDashArtifacts(commandsDir, taskToolArtifacts) : await writeDashFallback(commandsDir, taskToolArtifacts, ["task", "tool"]);
1898
+ }
1869
1899
  const total = agentCount + workflowCount + taskToolCount;
1870
1900
  if (outputFormat !== "json") process.stdout.write(`Generated ${String(total)} Claude Code commands (${String(agentCount)} agents, ${String(workflowCount)} workflows, ${String(taskToolCount)} tasks/tools)\n`);
1871
1901
  logger$15.info({
@@ -2130,7 +2160,7 @@ async function runInitAction(options) {
2130
2160
  if (doltMode === "auto") await checkDoltInstalled();
2131
2161
  await initializeDolt({
2132
2162
  projectRoot,
2133
- schemaPath: fileURLToPath$1(new URL("../../modules/state/schema.sql", import.meta.url))
2163
+ schemaPath: fileURLToPath$1(new URL("../schema.sql", import.meta.url))
2134
2164
  });
2135
2165
  doltInitialized = true;
2136
2166
  } catch (err) {
@@ -4359,7 +4389,7 @@ async function runSupervisorAction(options, deps = {}) {
4359
4389
  await initSchema(expAdapter);
4360
4390
  const { runRunAction: runPipeline } = await import(
4361
4391
  /* @vite-ignore */
4362
- "../run-DUzRmgk5.js"
4392
+ "../run-N5rHJu-Y.js"
4363
4393
  );
4364
4394
  const runStoryFn = async (opts) => {
4365
4395
  const exitCode = await runPipeline({