substrate-ai 0.1.15 → 0.1.16
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 +19 -5
- package/dist/{upgrade-BBPbOHol.js → upgrade-CHhsJc_q.js} +2 -2
- package/dist/{upgrade-0Q2TKgQ4.js → upgrade-DdBzZv_h.js} +2 -2
- package/dist/{version-manager-impl-Bij9-k0W.js → version-manager-impl-C0G2CEHB.js} +1 -1
- package/dist/{version-manager-impl-DbHmed-I.js → version-manager-impl-O25ieEjS.js} +3 -3
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
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";
|
|
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-
|
|
5
|
-
import { registerUpgradeCommand } from "../upgrade-
|
|
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
|
|
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-
|
|
15797
|
-
const { createVersionManager } = await import("../version-manager-impl-
|
|
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`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createVersionManager } from "./version-manager-impl-
|
|
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-
|
|
126
|
+
//# sourceMappingURL=upgrade-CHhsJc_q.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./config-schema-C9tTMcm1.js";
|
|
2
|
-
import "./version-manager-impl-
|
|
3
|
-
import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-
|
|
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 };
|
|
@@ -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/
|
|
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-
|
|
485
|
+
//# sourceMappingURL=version-manager-impl-O25ieEjS.js.map
|