substrate-ai 0.1.15 → 0.1.17

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.
@@ -390,13 +390,11 @@ var ClaudeCodeAdapter = class {
390
390
  supportedLanguages: ["*"]
391
391
  };
392
392
  }
393
- _detectBillingModes(versionOutput) {
393
+ _detectBillingModes(_versionOutput) {
394
394
  const explicit = process.env.ADT_BILLING_MODE;
395
395
  if (explicit === "subscription" || explicit === "api" || explicit === "free") return [explicit];
396
- const modes = [];
396
+ const modes = ["subscription"];
397
397
  if (process.env.ANTHROPIC_API_KEY) modes.push("api");
398
- if (versionOutput.toLowerCase().includes("subscription")) modes.push("subscription");
399
- if (modes.length === 0) return ["subscription", "api"];
400
398
  return modes;
401
399
  }
402
400
  _buildPlanningPrompt(request) {
@@ -6288,4 +6286,4 @@ function printNonTtyWarning() {
6288
6286
 
6289
6287
  //#endregion
6290
6288
  export { AdapterRegistry, AdtError, BudgetExceededError, ClaudeCodeAdapter, CodexCLIAdapter, ConfigError, ConfigIncompatibleFormatError, DatabaseWrapper, GeminiCLIAdapter, GitError, MonitorDatabaseImpl, ParseError, RecommendationEngine, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphFileSchema, TaskGraphIncompatibleFormatError, ValidationError, WorkerError, WorkerNotFoundError, childLogger, computeChangedKeys, createConfigWatcher, createDatabaseService, createEventBus, createGitWorktreeManager, createLogger, createMonitorAgent, createMonitorDatabase, createRoutingEngine, createTaskGraphEngine, createTuiApp, createWorkerPoolManager, deepMask, detectCycle, getAllTasks, getLatestSessionId, getLogByEvent, getSession, getSessionLog, getTaskLog, isTuiCapable, logger$12 as logger, parseGraphFile, printNonTtyWarning, queryLogFiltered, runMigrations, validateDependencies, validateGraph };
6291
- //# sourceMappingURL=app-DXNR5G_8.js.map
6289
+ //# sourceMappingURL=app-Bltq6BEm.js.map
package/dist/cli/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { AdapterRegistry, ConfigError, ConfigIncompatibleFormatError, DatabaseWrapper, MonitorDatabaseImpl, ParseError, RecommendationEngine, TaskGraphFileSchema, ValidationError, computeChangedKeys, createConfigWatcher, createDatabaseService, createEventBus, createGitWorktreeManager, createLogger, createMonitorAgent, createMonitorDatabase, createRoutingEngine, createTaskGraphEngine, createTuiApp, createWorkerPoolManager, deepMask, detectCycle, getAllTasks, getLatestSessionId, getLogByEvent, getSession, getSessionLog, getTaskLog, isTuiCapable, parseGraphFile, printNonTtyWarning, queryLogFiltered, runMigrations, validateDependencies, validateGraph } from "../app-DXNR5G_8.js";
2
+ import { AdapterRegistry, ConfigError, ConfigIncompatibleFormatError, DatabaseWrapper, MonitorDatabaseImpl, ParseError, RecommendationEngine, TaskGraphFileSchema, ValidationError, computeChangedKeys, createConfigWatcher, createDatabaseService, createEventBus, createGitWorktreeManager, createLogger, createMonitorAgent, createMonitorDatabase, createRoutingEngine, createTaskGraphEngine, createTuiApp, createWorkerPoolManager, deepMask, detectCycle, getAllTasks, getLatestSessionId, getLogByEvent, getSession, getSessionLog, getTaskLog, isTuiCapable, parseGraphFile, printNonTtyWarning, queryLogFiltered, runMigrations, validateDependencies, validateGraph } from "../app-Bltq6BEm.js";
3
3
  import { CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, PartialSubstrateConfigSchema, SUPPORTED_CONFIG_FORMAT_VERSIONS, SubstrateConfigSchema } from "../config-schema-C9tTMcm1.js";
4
- import { defaultConfigMigrator } from "../version-manager-impl-DbHmed-I.js";
5
- import { registerUpgradeCommand } from "../upgrade-BBPbOHol.js";
4
+ import { defaultConfigMigrator } from "../version-manager-impl-O25ieEjS.js";
5
+ import { registerUpgradeCommand } from "../upgrade-CHhsJc_q.js";
6
6
  import { Command } from "commander";
7
7
  import { fileURLToPath } from "url";
8
8
  import { dirname, extname, isAbsolute, join, relative, resolve } from "path";
@@ -385,6 +385,13 @@ function listTemplates() {
385
385
  //#endregion
386
386
  //#region src/cli/commands/init.ts
387
387
  const logger$30 = createLogger("init");
388
+ /**
389
+ * Detect whether the CLI was invoked via `npx substrate`.
390
+ * When true, prefix suggested commands with `npx `.
391
+ */
392
+ function isNpxInvocation() {
393
+ return process.env["npm_execpath"] !== void 0 && (process.env["npm_execpath"].includes("npx") || process.env["npm_lifecycle_event"] === void 0);
394
+ }
388
395
  const INIT_EXIT_SUCCESS = 0;
389
396
  const INIT_EXIT_ERROR = 1;
390
397
  const INIT_EXIT_ALREADY_EXISTS = 2;
@@ -603,11 +610,18 @@ async function runInit(options = {}) {
603
610
  process.stderr.write(` Error: failed to write configuration — ${message}\n`);
604
611
  return INIT_EXIT_ERROR;
605
612
  }
613
+ const prefix = isNpxInvocation() ? "npx " : "";
614
+ const apiProviders = detectedAdapters.filter((a) => {
615
+ const pk = ADAPTER_TO_PROVIDER[a.adapterId];
616
+ return pk && providers[pk]?.subscription_routing === "api";
617
+ }).map((a) => PROVIDER_KEY_ENV[ADAPTER_TO_PROVIDER[a.adapterId]]).filter(Boolean);
618
+ let nextSteps = `\n Next steps:\n 1. Run \`${prefix}substrate adapters check\` to verify your setup\n 2. Run \`${prefix}substrate config show\` to review your configuration\n`;
619
+ if (apiProviders.length > 0) nextSteps += `\n API key setup (only needed for providers using 'api' routing):\n` + apiProviders.map((env) => ` export ${env}="your-key-here"`).join("\n") + "\n";
606
620
  process.stdout.write(`
607
621
  Substrate initialized successfully!
608
622
 
609
623
  Created:
610
- ${configPath}\n ${routingPolicyPath}\n\n Next steps:\n 1. Set your API keys as environment variables:\n` + Object.entries(PROVIDER_KEY_ENV).map(([, env]) => ` export ${env}="your-key-here"`).join("\n") + "\n 2. Run `substrate adapters check` to verify your setup\n 3. Run `substrate config show` to review your configuration\n");
624
+ ${configPath}\n ${routingPolicyPath}\n` + nextSteps);
611
625
  return INIT_EXIT_SUCCESS;
612
626
  }
613
627
  /**
@@ -15793,8 +15807,8 @@ async function createProgram() {
15793
15807
  /** Fire-and-forget startup version check (story 8.3, AC3/AC5) */
15794
15808
  function checkForUpdatesInBackground(currentVersion) {
15795
15809
  if (process.env.SUBSTRATE_NO_UPDATE_CHECK === "1") return;
15796
- import("../upgrade-0Q2TKgQ4.js").then(async () => {
15797
- const { createVersionManager } = await import("../version-manager-impl-Bij9-k0W.js");
15810
+ import("../upgrade-DdBzZv_h.js").then(async () => {
15811
+ const { createVersionManager } = await import("../version-manager-impl-C0G2CEHB.js");
15798
15812
  const vm = createVersionManager();
15799
15813
  const result = await vm.checkForUpdates();
15800
15814
  if (result.updateAvailable) process.stderr.write(`\nUpdate available: ${result.currentVersion} → ${result.latestVersion}. Run \`substrate upgrade\` to update.\n`);
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { AdapterRegistry, AdtError, BudgetExceededError, ClaudeCodeAdapter, CodexCLIAdapter, ConfigError, ConfigIncompatibleFormatError, GeminiCLIAdapter, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError, childLogger, computeChangedKeys, createConfigWatcher, createDatabaseService, createEventBus, createGitWorktreeManager, createLogger, createMonitorAgent, createMonitorDatabase, createRoutingEngine, createTaskGraphEngine, createTuiApp, createWorkerPoolManager, isTuiCapable, logger, printNonTtyWarning } from "./app-DXNR5G_8.js";
1
+ import { AdapterRegistry, AdtError, BudgetExceededError, ClaudeCodeAdapter, CodexCLIAdapter, ConfigError, ConfigIncompatibleFormatError, GeminiCLIAdapter, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError, childLogger, computeChangedKeys, createConfigWatcher, createDatabaseService, createEventBus, createGitWorktreeManager, createLogger, createMonitorAgent, createMonitorDatabase, createRoutingEngine, createTaskGraphEngine, createTuiApp, createWorkerPoolManager, isTuiCapable, logger, printNonTtyWarning } from "./app-Bltq6BEm.js";
2
2
  import "./config-schema-C9tTMcm1.js";
3
3
  import { join } from "node:path";
4
4
  import { randomUUID } from "crypto";
@@ -1,4 +1,4 @@
1
- import { createVersionManager } from "./version-manager-impl-DbHmed-I.js";
1
+ import { createVersionManager } from "./version-manager-impl-O25ieEjS.js";
2
2
  import { execSync, spawn } from "child_process";
3
3
  import * as readline from "readline";
4
4
 
@@ -123,4 +123,4 @@ function registerUpgradeCommand(program) {
123
123
 
124
124
  //#endregion
125
125
  export { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand };
126
- //# sourceMappingURL=upgrade-BBPbOHol.js.map
126
+ //# sourceMappingURL=upgrade-CHhsJc_q.js.map
@@ -1,5 +1,5 @@
1
1
  import "./config-schema-C9tTMcm1.js";
2
- import "./version-manager-impl-DbHmed-I.js";
3
- import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-BBPbOHol.js";
2
+ import "./version-manager-impl-O25ieEjS.js";
3
+ import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-CHhsJc_q.js";
4
4
 
5
5
  export { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand };
@@ -1,4 +1,4 @@
1
1
  import "./config-schema-C9tTMcm1.js";
2
- import { VersionManagerImpl, createVersionManager } from "./version-manager-impl-DbHmed-I.js";
2
+ import { VersionManagerImpl, createVersionManager } from "./version-manager-impl-O25ieEjS.js";
3
3
 
4
4
  export { createVersionManager };
@@ -242,7 +242,7 @@ var UpdateChecker = class {
242
242
  * @returns A URL string pointing to the GitHub release page
243
243
  */
244
244
  getChangelog(latestVersion) {
245
- return `See https://github.com/jplanow/ai-dev-toolkit-new/releases/tag/v${latestVersion}`;
245
+ return `See https://github.com/johnplanow/substrate/releases/tag/v${latestVersion}`;
246
246
  }
247
247
  };
248
248
  function collectBody(res, resolve$1, reject) {
@@ -388,7 +388,7 @@ var VersionManagerImpl = class {
388
388
  }
389
389
  }
390
390
  try {
391
- const latestVersion = await this.updateChecker.fetchLatestVersion("substrate");
391
+ const latestVersion = await this.updateChecker.fetchLatestVersion("substrate-ai");
392
392
  const updateAvailable = latestVersion !== currentVersion;
393
393
  this.cache.write({
394
394
  lastChecked: new Date().toISOString(),
@@ -482,4 +482,4 @@ function createVersionManager(deps = {}) {
482
482
 
483
483
  //#endregion
484
484
  export { VersionManagerImpl, createVersionManager, defaultConfigMigrator };
485
- //# sourceMappingURL=version-manager-impl-DbHmed-I.js.map
485
+ //# sourceMappingURL=version-manager-impl-O25ieEjS.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "substrate-ai",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "Substrate — multi-agent orchestration daemon for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",