substrate-ai 0.6.3 → 0.6.4
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
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
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-CJKsY214.js";
|
|
3
3
|
import { createLogger } from "../logger-D2fS2ccL.js";
|
|
4
4
|
import { AdapterRegistry } from "../adapter-registry-D2zdMwVu.js";
|
|
5
5
|
import { CURRENT_CONFIG_FORMAT_VERSION, CURRENT_TASK_GRAPH_VERSION, PartialSubstrateConfigSchema } from "../config-migrator-DtZW1maj.js";
|
|
@@ -3486,7 +3486,7 @@ async function runSupervisorAction(options, deps = {}) {
|
|
|
3486
3486
|
await initSchema(expAdapter);
|
|
3487
3487
|
const { runRunAction: runPipeline } = await import(
|
|
3488
3488
|
/* @vite-ignore */
|
|
3489
|
-
"../run-
|
|
3489
|
+
"../run-XI1lMRHg.js"
|
|
3490
3490
|
);
|
|
3491
3491
|
const runStoryFn = async (opts) => {
|
|
3492
3492
|
const exitCode = await runPipeline({
|
|
@@ -6638,6 +6638,7 @@ const MIN_FREE_MEMORY_BYTES = (() => {
|
|
|
6638
6638
|
return 256 * 1024 * 1024;
|
|
6639
6639
|
})();
|
|
6640
6640
|
const MEMORY_PRESSURE_POLL_MS = 1e4;
|
|
6641
|
+
const MEMORY_PRESSURE_MAX_HOLD_MS = 3e5;
|
|
6641
6642
|
let _lastKnownPressureLevel = 0;
|
|
6642
6643
|
/**
|
|
6643
6644
|
* Get available system memory in bytes, accounting for platform differences.
|
|
@@ -6721,6 +6722,7 @@ var DispatcherImpl = class {
|
|
|
6721
6722
|
_queue = [];
|
|
6722
6723
|
_shuttingDown = false;
|
|
6723
6724
|
_memoryPressureTimer = null;
|
|
6725
|
+
_memoryPressureHoldStart = null;
|
|
6724
6726
|
constructor(eventBus, adapterRegistry, config) {
|
|
6725
6727
|
this._eventBus = eventBus;
|
|
6726
6728
|
this._adapterRegistry = adapterRegistry;
|
|
@@ -7134,13 +7136,28 @@ var DispatcherImpl = class {
|
|
|
7134
7136
|
_isMemoryPressured() {
|
|
7135
7137
|
const free = getAvailableMemory();
|
|
7136
7138
|
if (free < MIN_FREE_MEMORY_BYTES) {
|
|
7139
|
+
const now = Date.now();
|
|
7140
|
+
if (this._memoryPressureHoldStart === null) this._memoryPressureHoldStart = now;
|
|
7141
|
+
const holdDurationMs = now - this._memoryPressureHoldStart;
|
|
7142
|
+
if (holdDurationMs >= MEMORY_PRESSURE_MAX_HOLD_MS) {
|
|
7143
|
+
logger$23.warn({
|
|
7144
|
+
freeMB: Math.round(free / 1024 / 1024),
|
|
7145
|
+
thresholdMB: Math.round(MIN_FREE_MEMORY_BYTES / 1024 / 1024),
|
|
7146
|
+
pressureLevel: _lastKnownPressureLevel,
|
|
7147
|
+
holdDurationMs
|
|
7148
|
+
}, "Memory pressure hold exceeded max duration — forcing dispatch");
|
|
7149
|
+
this._memoryPressureHoldStart = null;
|
|
7150
|
+
return false;
|
|
7151
|
+
}
|
|
7137
7152
|
logger$23.warn({
|
|
7138
7153
|
freeMB: Math.round(free / 1024 / 1024),
|
|
7139
7154
|
thresholdMB: Math.round(MIN_FREE_MEMORY_BYTES / 1024 / 1024),
|
|
7140
|
-
pressureLevel: _lastKnownPressureLevel
|
|
7155
|
+
pressureLevel: _lastKnownPressureLevel,
|
|
7156
|
+
holdDurationMs
|
|
7141
7157
|
}, "Memory pressure detected — holding dispatch queue");
|
|
7142
7158
|
return true;
|
|
7143
7159
|
}
|
|
7160
|
+
this._memoryPressureHoldStart = null;
|
|
7144
7161
|
return false;
|
|
7145
7162
|
}
|
|
7146
7163
|
/**
|
|
@@ -23691,4 +23708,4 @@ function registerRunCommand(program, _version = "0.0.0", projectRoot = process.c
|
|
|
23691
23708
|
|
|
23692
23709
|
//#endregion
|
|
23693
23710
|
export { 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, runRunAction, runSolutioningPhase, validateStopAfterFromConflict };
|
|
23694
|
-
//# sourceMappingURL=run-
|
|
23711
|
+
//# sourceMappingURL=run-CJKsY214.js.map
|