substrate-ai 0.1.31 → 0.1.33
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 -19
- package/dist/index.d.ts +1 -1
- package/dist/{upgrade-4j5rZskl.js → upgrade-CIAel_WS.js} +2 -2
- package/dist/{upgrade-j7tWzbZ0.js → upgrade-CS2i2Qy5.js} +2 -2
- package/dist/{version-manager-impl-mBbvaQL2.js → version-manager-impl-CcCP8PzG.js} +8 -7
- package/dist/{version-manager-impl-CJLdocS1.js → version-manager-impl-LhLAyrCL.js} +1 -1
- 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-CY3MaJtP.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-CcCP8PzG.js";
|
|
5
|
+
import { registerUpgradeCommand } from "../upgrade-CIAel_WS.js";
|
|
6
6
|
import { createRequire } from "module";
|
|
7
7
|
import { Command } from "commander";
|
|
8
8
|
import { fileURLToPath } from "url";
|
|
@@ -1910,7 +1910,7 @@ function formatCostCsv(summary, taskEntries) {
|
|
|
1910
1910
|
*/
|
|
1911
1911
|
async function runCostAction(options) {
|
|
1912
1912
|
const { sessionId: explicitSessionId, outputFormat, byTask, byAgent, byBilling, includePlanning, projectRoot, version = "0.0.0" } = options;
|
|
1913
|
-
const dbPath = join(projectRoot, ".substrate", "
|
|
1913
|
+
const dbPath = join(projectRoot, ".substrate", "substrate.db");
|
|
1914
1914
|
if (!existsSync(dbPath)) {
|
|
1915
1915
|
process.stderr.write(`Error: No Substrate database found at ${dbPath}. Run 'substrate init' first.\n`);
|
|
1916
1916
|
return COST_EXIT_ERROR;
|
|
@@ -2270,7 +2270,7 @@ async function runStartAction(options) {
|
|
|
2270
2270
|
return START_EXIT_ERROR;
|
|
2271
2271
|
}
|
|
2272
2272
|
}
|
|
2273
|
-
const dbPath = join(projectRoot, ".substrate", "
|
|
2273
|
+
const dbPath = join(projectRoot, ".substrate", "substrate.db");
|
|
2274
2274
|
const substrateDir = join(projectRoot, ".substrate");
|
|
2275
2275
|
if (!existsSync(substrateDir)) mkdirSync(substrateDir, { recursive: true });
|
|
2276
2276
|
const eventBus = createEventBus();
|
|
@@ -2715,7 +2715,7 @@ function isTerminalStatus(status) {
|
|
|
2715
2715
|
*/
|
|
2716
2716
|
async function runStatusAction(options) {
|
|
2717
2717
|
const { sessionId: explicitSessionId, watch: watch$1, outputFormat, showGraph, pollIntervalMs, projectRoot } = options;
|
|
2718
|
-
const dbPath = join(projectRoot, ".substrate", "
|
|
2718
|
+
const dbPath = join(projectRoot, ".substrate", "substrate.db");
|
|
2719
2719
|
if (!existsSync(dbPath)) {
|
|
2720
2720
|
process.stderr.write(`Error: No Substrate database found at ${dbPath}. Run 'substrate init' first.\n`);
|
|
2721
2721
|
return STATUS_EXIT_ERROR;
|
|
@@ -2846,7 +2846,7 @@ const PAUSE_EXIT_USAGE_ERROR = 2;
|
|
|
2846
2846
|
*/
|
|
2847
2847
|
async function runPauseAction(options) {
|
|
2848
2848
|
const { sessionId, outputFormat, projectRoot, version = "0.0.0" } = options;
|
|
2849
|
-
const dbPath = join(projectRoot, ".substrate", "
|
|
2849
|
+
const dbPath = join(projectRoot, ".substrate", "substrate.db");
|
|
2850
2850
|
if (!existsSync(dbPath)) {
|
|
2851
2851
|
process.stderr.write(`Error: No Substrate database found at ${dbPath}. Run 'substrate init' first.\n`);
|
|
2852
2852
|
return PAUSE_EXIT_ERROR;
|
|
@@ -2962,7 +2962,7 @@ async function runResumeAction(options) {
|
|
|
2962
2962
|
};
|
|
2963
2963
|
return runStartAction(startOptions);
|
|
2964
2964
|
}
|
|
2965
|
-
const dbPath = join(projectRoot, ".substrate", "
|
|
2965
|
+
const dbPath = join(projectRoot, ".substrate", "substrate.db");
|
|
2966
2966
|
if (!existsSync(dbPath)) {
|
|
2967
2967
|
process.stderr.write(`Error: No Substrate database found at ${dbPath}. Run 'substrate init' first.\n`);
|
|
2968
2968
|
return RESUME_EXIT_ERROR;
|
|
@@ -3080,7 +3080,7 @@ async function promptConfirmation$1(sessionId) {
|
|
|
3080
3080
|
*/
|
|
3081
3081
|
async function runCancelAction(options) {
|
|
3082
3082
|
const { sessionId, outputFormat, yes, projectRoot, version = "0.0.0" } = options;
|
|
3083
|
-
const dbPath = join(projectRoot, ".substrate", "
|
|
3083
|
+
const dbPath = join(projectRoot, ".substrate", "substrate.db");
|
|
3084
3084
|
if (!existsSync(dbPath)) {
|
|
3085
3085
|
process.stderr.write(`Error: No Substrate database found at ${dbPath}. Run 'substrate init' first.\n`);
|
|
3086
3086
|
return CANCEL_EXIT_ERROR;
|
|
@@ -3293,7 +3293,7 @@ function validateTaskDependencies(db, _sessionId, taskId) {
|
|
|
3293
3293
|
*/
|
|
3294
3294
|
async function runRetryAction(options) {
|
|
3295
3295
|
const { sessionId, taskId: specificTaskId, dryRun, follow, outputFormat, maxRetries, projectRoot } = options;
|
|
3296
|
-
const dbPath = join(projectRoot, ".substrate", "
|
|
3296
|
+
const dbPath = join(projectRoot, ".substrate", "substrate.db");
|
|
3297
3297
|
if (!existsSync(dbPath)) {
|
|
3298
3298
|
process.stderr.write(`Error: No Substrate database found at ${dbPath}. Run 'substrate init' first.\n`);
|
|
3299
3299
|
return RETRY_EXIT_USAGE_ERROR;
|
|
@@ -3387,7 +3387,7 @@ async function runRetryAction(options) {
|
|
|
3387
3387
|
*/
|
|
3388
3388
|
async function runFollowMode(opts) {
|
|
3389
3389
|
const { sessionId, eligibleTaskIds, projectRoot, outputFormat } = opts;
|
|
3390
|
-
const dbPath = join(projectRoot, ".substrate", "
|
|
3390
|
+
const dbPath = join(projectRoot, ".substrate", "substrate.db");
|
|
3391
3391
|
const eventBus = createEventBus();
|
|
3392
3392
|
const databaseService = createDatabaseService(dbPath);
|
|
3393
3393
|
const configSystem = createConfigSystem({ projectRoot });
|
|
@@ -3807,7 +3807,7 @@ function formatLogTable(entries) {
|
|
|
3807
3807
|
*/
|
|
3808
3808
|
async function runLogAction(options) {
|
|
3809
3809
|
const { sessionId: explicitSessionId, taskId, event, limit, outputFormat, projectRoot, version = "0.0.0" } = options;
|
|
3810
|
-
const dbPath = join(projectRoot, ".substrate", "
|
|
3810
|
+
const dbPath = join(projectRoot, ".substrate", "substrate.db");
|
|
3811
3811
|
if (!existsSync(dbPath)) {
|
|
3812
3812
|
process.stderr.write(`Error: No Substrate database found at ${dbPath}. Run 'substrate init' first.\n`);
|
|
3813
3813
|
return LOG_EXIT_ERROR;
|
|
@@ -5084,7 +5084,7 @@ async function runPlanRefineAction(options) {
|
|
|
5084
5084
|
process.stderr.write("Error: feedback text is required\n");
|
|
5085
5085
|
return REFINE_EXIT_USAGE_ERROR;
|
|
5086
5086
|
}
|
|
5087
|
-
const dbPath = join(projectRoot, ".substrate", "
|
|
5087
|
+
const dbPath = join(projectRoot, ".substrate", "substrate.db");
|
|
5088
5088
|
const dbWrapper = new DatabaseWrapper(dbPath);
|
|
5089
5089
|
try {
|
|
5090
5090
|
dbWrapper.open();
|
|
@@ -5190,7 +5190,7 @@ const DIFF_EXIT_NOT_FOUND = 2;
|
|
|
5190
5190
|
*/
|
|
5191
5191
|
async function runPlanDiffAction(options) {
|
|
5192
5192
|
const { planId, fromVersion, toVersion, projectRoot, outputFormat } = options;
|
|
5193
|
-
const dbPath = join(projectRoot, ".substrate", "
|
|
5193
|
+
const dbPath = join(projectRoot, ".substrate", "substrate.db");
|
|
5194
5194
|
const dbWrapper = new DatabaseWrapper(dbPath);
|
|
5195
5195
|
try {
|
|
5196
5196
|
dbWrapper.open();
|
|
@@ -5281,7 +5281,7 @@ const ROLLBACK_EXIT_USAGE_ERROR = 2;
|
|
|
5281
5281
|
*/
|
|
5282
5282
|
async function runPlanRollbackAction(options, onEvent) {
|
|
5283
5283
|
const { planId, toVersion, projectRoot, outputFormat, autoApprove = false } = options;
|
|
5284
|
-
const dbPath = join(projectRoot, ".substrate", "
|
|
5284
|
+
const dbPath = join(projectRoot, ".substrate", "substrate.db");
|
|
5285
5285
|
const dbWrapper = new DatabaseWrapper(dbPath);
|
|
5286
5286
|
try {
|
|
5287
5287
|
dbWrapper.open();
|
|
@@ -5588,7 +5588,7 @@ async function promptApproval() {
|
|
|
5588
5588
|
}
|
|
5589
5589
|
async function savePlan(input) {
|
|
5590
5590
|
const { planId, goal, planningAgent, estimatedExecutionCost, taskCount, planYaml, projectRoot, status } = input;
|
|
5591
|
-
const dbPath = join(projectRoot, ".substrate", "
|
|
5591
|
+
const dbPath = join(projectRoot, ".substrate", "substrate.db");
|
|
5592
5592
|
const dbWrapper = new DatabaseWrapper(dbPath);
|
|
5593
5593
|
try {
|
|
5594
5594
|
dbWrapper.open();
|
|
@@ -5811,7 +5811,7 @@ async function runPlanReviewAction(options) {
|
|
|
5811
5811
|
*/
|
|
5812
5812
|
async function runPlanListAction(options) {
|
|
5813
5813
|
const { outputFormat, projectRoot } = options;
|
|
5814
|
-
const dbPath = join(projectRoot, ".substrate", "
|
|
5814
|
+
const dbPath = join(projectRoot, ".substrate", "substrate.db");
|
|
5815
5815
|
const dbWrapper = new DatabaseWrapper(dbPath);
|
|
5816
5816
|
try {
|
|
5817
5817
|
dbWrapper.open();
|
|
@@ -5840,7 +5840,7 @@ async function runPlanListAction(options) {
|
|
|
5840
5840
|
*/
|
|
5841
5841
|
async function runPlanShowAction(planId, options) {
|
|
5842
5842
|
const { outputFormat, projectRoot } = options;
|
|
5843
|
-
const dbPath = join(projectRoot, ".substrate", "
|
|
5843
|
+
const dbPath = join(projectRoot, ".substrate", "substrate.db");
|
|
5844
5844
|
const dbWrapper = new DatabaseWrapper(dbPath);
|
|
5845
5845
|
try {
|
|
5846
5846
|
dbWrapper.open();
|
|
@@ -19676,8 +19676,8 @@ async function createProgram() {
|
|
|
19676
19676
|
/** Fire-and-forget startup version check (story 8.3, AC3/AC5) */
|
|
19677
19677
|
function checkForUpdatesInBackground(currentVersion) {
|
|
19678
19678
|
if (process.env.SUBSTRATE_NO_UPDATE_CHECK === "1") return;
|
|
19679
|
-
import("../upgrade-
|
|
19680
|
-
const { createVersionManager } = await import("../version-manager-impl-
|
|
19679
|
+
import("../upgrade-CS2i2Qy5.js").then(async () => {
|
|
19680
|
+
const { createVersionManager } = await import("../version-manager-impl-LhLAyrCL.js");
|
|
19681
19681
|
const vm = createVersionManager();
|
|
19682
19682
|
const result = await vm.checkForUpdates();
|
|
19683
19683
|
if (result.updateAvailable) {
|
package/dist/index.d.ts
CHANGED
|
@@ -975,7 +975,7 @@ declare function createEventBus(): TypedEventBus;
|
|
|
975
975
|
* Configuration required to initialize the orchestrator.
|
|
976
976
|
*/
|
|
977
977
|
interface OrchestratorConfig {
|
|
978
|
-
/** Path to the SQLite database file (e.g., ".substrate/
|
|
978
|
+
/** Path to the SQLite database file (e.g., ".substrate/substrate.db") */
|
|
979
979
|
databasePath: string;
|
|
980
980
|
/** Working directory for the orchestrated project */
|
|
981
981
|
projectRoot: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createVersionManager } from "./version-manager-impl-
|
|
1
|
+
import { createVersionManager } from "./version-manager-impl-CcCP8PzG.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-CIAel_WS.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-CcCP8PzG.js";
|
|
3
|
+
import { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand } from "./upgrade-CIAel_WS.js";
|
|
4
4
|
|
|
5
5
|
export { isGlobalInstall, registerUpgradeCommand, runUpgradeCommand };
|
|
@@ -4,8 +4,9 @@ import { fileURLToPath } from "url";
|
|
|
4
4
|
import path, { dirname, resolve } from "path";
|
|
5
5
|
import { mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
6
6
|
import os from "os";
|
|
7
|
-
import
|
|
7
|
+
import * as semver$1 from "semver";
|
|
8
8
|
import * as semver from "semver";
|
|
9
|
+
import https from "https";
|
|
9
10
|
|
|
10
11
|
//#region src/modules/config/config-migrator.ts
|
|
11
12
|
/**
|
|
@@ -231,9 +232,9 @@ var UpdateChecker = class {
|
|
|
231
232
|
* @returns true if the major version increases; false if either version is invalid
|
|
232
233
|
*/
|
|
233
234
|
isBreaking(currentVersion, latestVersion) {
|
|
234
|
-
if (!semver.valid(currentVersion) || !semver.valid(latestVersion)) return false;
|
|
235
|
-
const currentMajor = semver.major(currentVersion);
|
|
236
|
-
const latestMajor = semver.major(latestVersion);
|
|
235
|
+
if (!semver$1.valid(currentVersion) || !semver$1.valid(latestVersion)) return false;
|
|
236
|
+
const currentMajor = semver$1.major(currentVersion);
|
|
237
|
+
const latestMajor = semver$1.major(latestVersion);
|
|
237
238
|
return latestMajor > currentMajor;
|
|
238
239
|
}
|
|
239
240
|
/**
|
|
@@ -390,7 +391,7 @@ var VersionManagerImpl = class {
|
|
|
390
391
|
if (!forceRefresh) {
|
|
391
392
|
const cached = this.cache.read();
|
|
392
393
|
if (cached !== null) {
|
|
393
|
-
const updateAvailable = cached.latestVersion
|
|
394
|
+
const updateAvailable = semver.gt(cached.latestVersion, currentVersion);
|
|
394
395
|
return {
|
|
395
396
|
currentVersion,
|
|
396
397
|
latestVersion: cached.latestVersion,
|
|
@@ -402,7 +403,7 @@ var VersionManagerImpl = class {
|
|
|
402
403
|
}
|
|
403
404
|
try {
|
|
404
405
|
const latestVersion = await this.updateChecker.fetchLatestVersion("substrate-ai");
|
|
405
|
-
const updateAvailable = latestVersion
|
|
406
|
+
const updateAvailable = semver.gt(latestVersion, currentVersion);
|
|
406
407
|
this.cache.write({
|
|
407
408
|
lastChecked: new Date().toISOString(),
|
|
408
409
|
latestVersion,
|
|
@@ -495,4 +496,4 @@ function createVersionManager(deps = {}) {
|
|
|
495
496
|
|
|
496
497
|
//#endregion
|
|
497
498
|
export { VersionManagerImpl, createVersionManager, defaultConfigMigrator };
|
|
498
|
-
//# sourceMappingURL=version-manager-impl-
|
|
499
|
+
//# sourceMappingURL=version-manager-impl-CcCP8PzG.js.map
|