@stackmemoryai/stackmemory 1.6.2 → 1.8.0
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/src/agents/core/agent-task-manager.js +3 -3
- package/dist/src/agents/verifiers/formatter-verifier.js +1 -1
- package/dist/src/agents/verifiers/llm-judge.js +2 -2
- package/dist/src/cli/commands/conductor-traces.js +314 -0
- package/dist/src/cli/commands/context-rehydrate.js +2 -2
- package/dist/src/cli/commands/log.js +1 -1
- package/dist/src/cli/commands/onboard.js +4 -4
- package/dist/src/cli/commands/orchestrate.js +328 -27
- package/dist/src/cli/commands/orchestrator.js +50 -3
- package/dist/src/cli/commands/search.js +3 -3
- package/dist/src/cli/commands/setup.js +1 -1
- package/dist/src/cli/commands/signup.js +1 -1
- package/dist/src/cli/commands/skills.js +2 -2
- package/dist/src/cli/commands/worktree.js +1 -1
- package/dist/src/core/config/config-manager.js +3 -1
- package/dist/src/core/config/types.js +7 -0
- package/dist/src/core/context/dual-stack-manager.js +2 -2
- package/dist/src/core/context/frame-database.js +38 -0
- package/dist/src/core/context/frame-enrichment.js +93 -0
- package/dist/src/core/context/frame-handoff-manager.js +1 -1
- package/dist/src/core/context/frame-manager.js +4 -4
- package/dist/src/core/context/rehydration.js +6 -6
- package/dist/src/core/database/sqlite-adapter.js +136 -15
- package/dist/src/core/digest/frame-digest-integration.js +1 -1
- package/dist/src/core/digest/hybrid-digest-generator.js +1 -1
- package/dist/src/core/digest/hybrid-digest.js +3 -3
- package/dist/src/core/errors/recovery.js +1 -1
- package/dist/src/core/extensions/loader.js +10 -10
- package/dist/src/core/extensions/plugin-system.js +1 -1
- package/dist/src/core/monitoring/logger.js +2 -2
- package/dist/src/core/monitoring/metrics.js +2 -2
- package/dist/src/core/monitoring/progress-tracker.js +2 -2
- package/dist/src/core/performance/lazy-context-loader.js +1 -1
- package/dist/src/core/performance/performance-benchmark.js +8 -8
- package/dist/src/core/performance/performance-profiler.js +2 -2
- package/dist/src/core/performance/streaming-jsonl-parser.js +1 -1
- package/dist/src/core/projects/project-isolation.js +1 -1
- package/dist/src/core/projects/project-manager.js +5 -5
- package/dist/src/core/session/clear-survival.js +3 -3
- package/dist/src/core/session/handoff-generator.js +1 -1
- package/dist/src/core/session/session-manager.js +4 -4
- package/dist/src/core/skills/skill-storage.js +2 -2
- package/dist/src/core/storage/remote-storage.js +2 -2
- package/dist/src/core/trace/cli-trace-wrapper.js +3 -3
- package/dist/src/core/trace/debug-trace.js +2 -2
- package/dist/src/core/trace/trace-detector.js +1 -1
- package/dist/src/core/worktree/worktree-manager.js +2 -2
- package/dist/src/features/analytics/api/analytics-api.js +1 -1
- package/dist/src/features/analytics/core/analytics-service.js +2 -2
- package/dist/src/features/analytics/queries/metrics-queries.js +1 -1
- package/dist/src/features/web/server/index.js +8 -8
- package/dist/src/integrations/anthropic/client.js +4 -4
- package/dist/src/integrations/claude-code/post-task-hooks.js +3 -3
- package/dist/src/integrations/claude-code/subagent-client.js +2 -2
- package/dist/src/integrations/diffmem/client.js +1 -1
- package/dist/src/integrations/linear/client.js +1 -1
- package/dist/src/integrations/linear/migration.js +1 -1
- package/dist/src/integrations/linear/oauth-server.js +2 -2
- package/dist/src/integrations/linear/sync.js +1 -1
- package/dist/src/integrations/linear/webhook-handler.js +2 -2
- package/dist/src/integrations/linear/webhook-server.js +2 -2
- package/dist/src/integrations/linear/webhook.js +2 -2
- package/dist/src/integrations/mcp/handlers/discovery-handlers.js +3 -3
- package/dist/src/integrations/mcp/handlers/linear-handlers.js +1 -1
- package/dist/src/integrations/mcp/handlers/skill-handlers.js +2 -2
- package/dist/src/integrations/mcp/handlers/task-handlers.js +2 -2
- package/dist/src/integrations/mcp/handlers/trace-handlers.js +1 -1
- package/dist/src/integrations/mcp/refactored-server.js +2 -2
- package/dist/src/integrations/mcp/remote-server.js +1 -1
- package/dist/src/integrations/mcp/server.js +4 -4
- package/dist/src/integrations/ralph/bridge/ralph-stackmemory-bridge.js +13 -13
- package/dist/src/integrations/ralph/context/stackmemory-context-loader.js +1 -1
- package/dist/src/integrations/ralph/learning/pattern-learner.js +3 -3
- package/dist/src/integrations/ralph/orchestration/multi-loop-orchestrator.js +1 -1
- package/dist/src/integrations/ralph/patterns/compounding-engineering-pattern.js +2 -2
- package/dist/src/integrations/ralph/patterns/extended-coherence-sessions.js +19 -19
- package/dist/src/integrations/ralph/patterns/oracle-worker-pattern.js +5 -5
- package/dist/src/integrations/ralph/performance/performance-optimizer.js +1 -1
- package/dist/src/integrations/ralph/recovery/crash-recovery.js +1 -1
- package/dist/src/integrations/ralph/state/state-reconciler.js +1 -1
- package/dist/src/integrations/ralph/swarm/git-workflow-manager.js +4 -4
- package/dist/src/integrations/ralph/swarm/swarm-coordinator.js +8 -8
- package/dist/src/integrations/ralph/visualization/ralph-debugger.js +3 -3
- package/dist/src/orchestrators/multimodal/harness.js +3 -3
- package/dist/src/servers/production/auth-middleware.js +2 -2
- package/package.json +1 -1
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
DEFAULT_IMPLEMENTER,
|
|
53
53
|
DEFAULT_MAX_ITERS
|
|
54
54
|
} from "../../orchestrators/multimodal/constants.js";
|
|
55
|
-
function
|
|
55
|
+
function _getEnv(key, defaultValue) {
|
|
56
56
|
const value = process.env[key];
|
|
57
57
|
if (value === void 0) {
|
|
58
58
|
if (defaultValue !== void 0) return defaultValue;
|
|
@@ -60,7 +60,7 @@ function getEnv(key, defaultValue) {
|
|
|
60
60
|
}
|
|
61
61
|
return value;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function _getOptionalEnv(key) {
|
|
64
64
|
return process.env[key];
|
|
65
65
|
}
|
|
66
66
|
class LocalStackMemoryMCP {
|
|
@@ -2701,7 +2701,7 @@ ${formattedTraces.map(
|
|
|
2701
2701
|
]
|
|
2702
2702
|
};
|
|
2703
2703
|
}
|
|
2704
|
-
async handleGetTraceStatistics(
|
|
2704
|
+
async handleGetTraceStatistics(_args) {
|
|
2705
2705
|
this.traceDetector.flush();
|
|
2706
2706
|
const stats = this.traceDetector.getStatistics();
|
|
2707
2707
|
const typeBreakdown = Object.entries(stats.tracesByType).map(([type, count]) => ` ${type}: ${count}`).join("\n");
|
|
@@ -2723,7 +2723,7 @@ ${typeBreakdown}`
|
|
|
2723
2723
|
]
|
|
2724
2724
|
};
|
|
2725
2725
|
}
|
|
2726
|
-
async handleFlushTraces(
|
|
2726
|
+
async handleFlushTraces(_args) {
|
|
2727
2727
|
this.traceDetector.flush();
|
|
2728
2728
|
return {
|
|
2729
2729
|
content: [
|
|
@@ -137,7 +137,7 @@ class RalphStackMemoryBridge {
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
this.state.activeLoop = reconciledState;
|
|
140
|
-
const
|
|
140
|
+
const _context = await this.loadIterationContext(reconciledState);
|
|
141
141
|
logger.info("Loop resumed", {
|
|
142
142
|
loopId,
|
|
143
143
|
iteration: reconciledState.iteration,
|
|
@@ -376,7 +376,7 @@ class RalphStackMemoryBridge {
|
|
|
376
376
|
/**
|
|
377
377
|
* Setup lifecycle hooks
|
|
378
378
|
*/
|
|
379
|
-
setupLifecycleHooks(
|
|
379
|
+
setupLifecycleHooks(_options) {
|
|
380
380
|
const hooks = {
|
|
381
381
|
preIteration: async (context) => {
|
|
382
382
|
logger.debug("Pre-iteration hook", {
|
|
@@ -612,7 +612,7 @@ class RalphStackMemoryBridge {
|
|
|
612
612
|
*/
|
|
613
613
|
async generateIterationPlan(context, analysis) {
|
|
614
614
|
const task = context.task.task || "Complete assigned work";
|
|
615
|
-
const
|
|
615
|
+
const _criteria = context.task.criteria || "Meet completion criteria";
|
|
616
616
|
const steps = [];
|
|
617
617
|
if (!analysis.testsPass) {
|
|
618
618
|
steps.push("Fix failing tests");
|
|
@@ -642,7 +642,7 @@ class RalphStackMemoryBridge {
|
|
|
642
642
|
/**
|
|
643
643
|
* Execute planned changes
|
|
644
644
|
*/
|
|
645
|
-
async executeIterationChanges(plan,
|
|
645
|
+
async executeIterationChanges(plan, _context) {
|
|
646
646
|
const changes = [];
|
|
647
647
|
for (let i = 0; i < plan.steps.length; i++) {
|
|
648
648
|
const step = plan.steps[i];
|
|
@@ -664,7 +664,7 @@ class RalphStackMemoryBridge {
|
|
|
664
664
|
/**
|
|
665
665
|
* Validate iteration results
|
|
666
666
|
*/
|
|
667
|
-
async validateIterationResults(
|
|
667
|
+
async validateIterationResults(_changes) {
|
|
668
668
|
const validation = {
|
|
669
669
|
testsPass: true,
|
|
670
670
|
lintClean: true,
|
|
@@ -683,7 +683,7 @@ class RalphStackMemoryBridge {
|
|
|
683
683
|
const { execSync: execSync2 } = await import("child_process");
|
|
684
684
|
execSync2("npm run lint", { stdio: "pipe", timeout: 3e4 });
|
|
685
685
|
validation.lintClean = true;
|
|
686
|
-
} catch
|
|
686
|
+
} catch {
|
|
687
687
|
validation.lintClean = false;
|
|
688
688
|
validation.warnings.push("Lint warnings detected");
|
|
689
689
|
}
|
|
@@ -693,7 +693,7 @@ class RalphStackMemoryBridge {
|
|
|
693
693
|
const { execSync: execSync2 } = await import("child_process");
|
|
694
694
|
execSync2("npm run build", { stdio: "pipe", timeout: 6e4 });
|
|
695
695
|
validation.buildSuccess = true;
|
|
696
|
-
} catch
|
|
696
|
+
} catch {
|
|
697
697
|
validation.buildSuccess = false;
|
|
698
698
|
validation.errors.push("Build failed");
|
|
699
699
|
}
|
|
@@ -819,10 +819,10 @@ class RalphStackMemoryBridge {
|
|
|
819
819
|
return `Still need to address:
|
|
820
820
|
${evaluation.unmet.map((c) => `- ${c}`).join("\n")}`;
|
|
821
821
|
}
|
|
822
|
-
async loadRelevantFrames(
|
|
822
|
+
async loadRelevantFrames(_loopId) {
|
|
823
823
|
return [];
|
|
824
824
|
}
|
|
825
|
-
async loadRecentIterations(
|
|
825
|
+
async loadRecentIterations(_loopId) {
|
|
826
826
|
return [];
|
|
827
827
|
}
|
|
828
828
|
async loadGitCommits() {
|
|
@@ -831,7 +831,7 @@ ${evaluation.unmet.map((c) => `- ${c}`).join("\n")}`;
|
|
|
831
831
|
async loadChangedFiles() {
|
|
832
832
|
return [];
|
|
833
833
|
}
|
|
834
|
-
async loadSessionFrames(
|
|
834
|
+
async loadSessionFrames(_sessionId) {
|
|
835
835
|
return [];
|
|
836
836
|
}
|
|
837
837
|
async reconstructLoopState(frame) {
|
|
@@ -848,13 +848,13 @@ ${evaluation.unmet.map((c) => `- ${c}`).join("\n")}`;
|
|
|
848
848
|
async buildContextFromFrames(frames, state) {
|
|
849
849
|
return await this.loadIterationContext(state);
|
|
850
850
|
}
|
|
851
|
-
async updateStateFrame(
|
|
851
|
+
async updateStateFrame(_oldState, _newState) {
|
|
852
852
|
logger.debug("State frame updated");
|
|
853
853
|
}
|
|
854
|
-
async saveErrorFrame(
|
|
854
|
+
async saveErrorFrame(_error, _context) {
|
|
855
855
|
logger.debug("Error frame saved");
|
|
856
856
|
}
|
|
857
|
-
async closeRootFrame(
|
|
857
|
+
async closeRootFrame(_state) {
|
|
858
858
|
logger.debug("Root frame closed");
|
|
859
859
|
}
|
|
860
860
|
}
|
|
@@ -396,13 +396,13 @@ class PatternLearner {
|
|
|
396
396
|
metadata: { criteriaWord: word }
|
|
397
397
|
}));
|
|
398
398
|
}
|
|
399
|
-
extractSuccessFactors(
|
|
399
|
+
extractSuccessFactors(_loops) {
|
|
400
400
|
return [];
|
|
401
401
|
}
|
|
402
|
-
analyzeFailurePoints(
|
|
402
|
+
analyzeFailurePoints(_loops) {
|
|
403
403
|
return [];
|
|
404
404
|
}
|
|
405
|
-
analyzeIterationSequences(
|
|
405
|
+
analyzeIterationSequences(_loops) {
|
|
406
406
|
return [];
|
|
407
407
|
}
|
|
408
408
|
groupByTaskType(loops) {
|
|
@@ -243,7 +243,7 @@ class MultiLoopOrchestrator {
|
|
|
243
243
|
);
|
|
244
244
|
if (phase.parallelExecution && phase.tasks.length > 1) {
|
|
245
245
|
const parallelResult = await this.executeParallelLoops(phase.tasks);
|
|
246
|
-
for (const [
|
|
246
|
+
for (const [_taskId, taskResult] of parallelResult.results) {
|
|
247
247
|
if (taskResult.success) {
|
|
248
248
|
result.completedLoops.push(taskResult.loopId);
|
|
249
249
|
} else {
|
|
@@ -69,7 +69,7 @@ class CompoundingEngineeringManager {
|
|
|
69
69
|
/**
|
|
70
70
|
* Extract actionable learnings from development session
|
|
71
71
|
*/
|
|
72
|
-
async extractLearningsFromSession(id, featureName, sessionData, agentOutputs,
|
|
72
|
+
async extractLearningsFromSession(id, featureName, sessionData, agentOutputs, _userFeedback) {
|
|
73
73
|
const successes = this.identifySuccesses(sessionData, agentOutputs);
|
|
74
74
|
const failures = this.identifyFailures(sessionData, agentOutputs);
|
|
75
75
|
const patterns = this.extractPatterns(sessionData, agentOutputs);
|
|
@@ -293,7 +293,7 @@ export async function ${hookName.replace(/-/g, "")}Hook() {
|
|
|
293
293
|
try {
|
|
294
294
|
const content = await fs.readFile(knowledgePath, "utf-8");
|
|
295
295
|
this.knowledgeBase = JSON.parse(content);
|
|
296
|
-
} catch
|
|
296
|
+
} catch {
|
|
297
297
|
logger.info("Starting fresh knowledge base");
|
|
298
298
|
}
|
|
299
299
|
}
|
|
@@ -129,7 +129,7 @@ class ExtendedCoherenceManager {
|
|
|
129
129
|
* Monitor active sessions for coherence degradation
|
|
130
130
|
*/
|
|
131
131
|
async monitorActiveSessionsHealth() {
|
|
132
|
-
for (const [
|
|
132
|
+
for (const [_sessionId, session] of this.activeSessions) {
|
|
133
133
|
if (session.state.status === "active") {
|
|
134
134
|
await this.assessSessionCoherence(session);
|
|
135
135
|
}
|
|
@@ -253,7 +253,7 @@ class ExtendedCoherenceManager {
|
|
|
253
253
|
}
|
|
254
254
|
session.interventions.push(intervention);
|
|
255
255
|
session.state.interventionCount++;
|
|
256
|
-
const
|
|
256
|
+
const _previousStatus = session.state.status;
|
|
257
257
|
session.state.status = "degraded";
|
|
258
258
|
setTimeout(async () => {
|
|
259
259
|
const newMetrics = await this.calculateCoherenceMetrics(session);
|
|
@@ -410,37 +410,37 @@ Begin your extended coherence work session now.
|
|
|
410
410
|
`;
|
|
411
411
|
}
|
|
412
412
|
// Placeholder implementations for helper methods
|
|
413
|
-
async getRecentAgentOutputs(
|
|
413
|
+
async getRecentAgentOutputs(_session) {
|
|
414
414
|
return [];
|
|
415
415
|
}
|
|
416
|
-
assessOutputQuality(
|
|
416
|
+
assessOutputQuality(_outputs) {
|
|
417
417
|
return 0.8;
|
|
418
418
|
}
|
|
419
|
-
assessContextRetention(
|
|
419
|
+
assessContextRetention(_outputs, _task) {
|
|
420
420
|
return 0.7;
|
|
421
421
|
}
|
|
422
|
-
assessTaskRelevance(
|
|
422
|
+
assessTaskRelevance(_outputs, _task) {
|
|
423
423
|
return 0.9;
|
|
424
424
|
}
|
|
425
|
-
calculateRepetitionRate(
|
|
425
|
+
calculateRepetitionRate(_outputs) {
|
|
426
426
|
return 0.1;
|
|
427
427
|
}
|
|
428
|
-
calculateDivergenceRate(
|
|
428
|
+
calculateDivergenceRate(_outputs, _task) {
|
|
429
429
|
return 0.05;
|
|
430
430
|
}
|
|
431
|
-
calculateErrorRate(
|
|
431
|
+
calculateErrorRate(_outputs) {
|
|
432
432
|
return 0.02;
|
|
433
433
|
}
|
|
434
|
-
calculateProgressRate(
|
|
434
|
+
calculateProgressRate(_session) {
|
|
435
435
|
return 2.5;
|
|
436
436
|
}
|
|
437
|
-
async getMemoryUsage(
|
|
437
|
+
async getMemoryUsage(_session) {
|
|
438
438
|
return 150;
|
|
439
439
|
}
|
|
440
|
-
async getContextWindowUsage(
|
|
440
|
+
async getContextWindowUsage(_session) {
|
|
441
441
|
return 65;
|
|
442
442
|
}
|
|
443
|
-
generateBreakpoints(
|
|
443
|
+
generateBreakpoints(_taskConfig) {
|
|
444
444
|
return [
|
|
445
445
|
"Initial analysis complete",
|
|
446
446
|
"Core implementation finished",
|
|
@@ -451,19 +451,19 @@ Begin your extended coherence work session now.
|
|
|
451
451
|
async generateContextSummary(session) {
|
|
452
452
|
return `Session ${session.id} context summary`;
|
|
453
453
|
}
|
|
454
|
-
async generateContextRefreshPrompt(
|
|
454
|
+
async generateContextRefreshPrompt(_session) {
|
|
455
455
|
return "Context refresh prompt";
|
|
456
456
|
}
|
|
457
|
-
async applyContextRefresh(
|
|
457
|
+
async applyContextRefresh(_session, _prompt) {
|
|
458
458
|
}
|
|
459
|
-
async loadLatestCheckpoint(
|
|
459
|
+
async loadLatestCheckpoint(_session) {
|
|
460
460
|
return null;
|
|
461
461
|
}
|
|
462
|
-
async restartAgentFromCheckpoint(
|
|
462
|
+
async restartAgentFromCheckpoint(_session, _checkpoint) {
|
|
463
463
|
}
|
|
464
|
-
async restartAgentFromBeginning(
|
|
464
|
+
async restartAgentFromBeginning(_session) {
|
|
465
465
|
}
|
|
466
|
-
async provideGuidance(
|
|
466
|
+
async provideGuidance(_session, _reason) {
|
|
467
467
|
}
|
|
468
468
|
/**
|
|
469
469
|
* Get extended coherence capabilities
|
|
@@ -168,7 +168,7 @@ Remember: Your intelligence is expensive. Focus on high-value strategic thinking
|
|
|
168
168
|
const allocatedTasks = [];
|
|
169
169
|
for (const task of decomposition) {
|
|
170
170
|
const workerModel = this.selectWorkerForTask(task);
|
|
171
|
-
const
|
|
171
|
+
const _workerPrompt = this.buildWorkerPrompt(task, workerModel);
|
|
172
172
|
allocatedTasks.push({
|
|
173
173
|
...task,
|
|
174
174
|
assignedModel: "worker"
|
|
@@ -196,7 +196,7 @@ Remember: Your intelligence is expensive. Focus on high-value strategic thinking
|
|
|
196
196
|
/**
|
|
197
197
|
* Build focused prompt for worker models
|
|
198
198
|
*/
|
|
199
|
-
buildWorkerPrompt(task,
|
|
199
|
+
buildWorkerPrompt(task, _worker) {
|
|
200
200
|
return `
|
|
201
201
|
# WORKER ROLE: Focused Task Execution
|
|
202
202
|
|
|
@@ -265,7 +265,7 @@ Execute your task now.
|
|
|
265
265
|
/**
|
|
266
266
|
* Integrate worker results under Oracle coordination
|
|
267
267
|
*/
|
|
268
|
-
async integrateResults(workerResults,
|
|
268
|
+
async integrateResults(workerResults, _reviewResult) {
|
|
269
269
|
const swarmId = uuidv4();
|
|
270
270
|
const successfulTasks = workerResults.filter(
|
|
271
271
|
(result) => result.status === "fulfilled"
|
|
@@ -281,7 +281,7 @@ Execute your task now.
|
|
|
281
281
|
/**
|
|
282
282
|
* Parse task decomposition from Oracle output
|
|
283
283
|
*/
|
|
284
|
-
parseTaskDecomposition(
|
|
284
|
+
parseTaskDecomposition(_output) {
|
|
285
285
|
return [];
|
|
286
286
|
}
|
|
287
287
|
/**
|
|
@@ -309,7 +309,7 @@ Execute your task now.
|
|
|
309
309
|
* Calculate what this would cost with all-Oracle approach
|
|
310
310
|
*/
|
|
311
311
|
calculateTraditionalCost() {
|
|
312
|
-
const
|
|
312
|
+
const _totalSpent = this.costTracker.oracleSpent + this.costTracker.workerSpent + this.costTracker.reviewerSpent;
|
|
313
313
|
const avgWorkerCost = this.workerPool[0]?.costPerToken || 1e-3;
|
|
314
314
|
const workerTokensAsOracle = this.costTracker.workerSpent / avgWorkerCost;
|
|
315
315
|
return this.costTracker.oracleSpent + workerTokensAsOracle * this.oracle.costPerToken;
|
|
@@ -250,7 +250,7 @@ class CrashRecoverySystem {
|
|
|
250
250
|
{
|
|
251
251
|
errorType: "git_conflict",
|
|
252
252
|
condition: (error) => error.message.includes("git") || error.message.includes("branch"),
|
|
253
|
-
action: async (
|
|
253
|
+
action: async (_report, _recovery) => {
|
|
254
254
|
logger.info("Attempting git conflict resolution");
|
|
255
255
|
try {
|
|
256
256
|
const { execSync } = await import("child_process");
|
|
@@ -117,7 +117,7 @@ class StateReconciler {
|
|
|
117
117
|
const currentCommit = execSync("git rev-parse HEAD", {
|
|
118
118
|
encoding: "utf8"
|
|
119
119
|
}).trim();
|
|
120
|
-
const
|
|
120
|
+
const _branch = execSync("git branch --show-current", {
|
|
121
121
|
encoding: "utf8"
|
|
122
122
|
}).trim();
|
|
123
123
|
const uncommittedChanges = execSync("git status --porcelain", {
|
|
@@ -29,7 +29,7 @@ class GitWorkflowManager {
|
|
|
29
29
|
try {
|
|
30
30
|
this.baselineBranch = this.getCurrentBranch();
|
|
31
31
|
this.mainBranch = this.getMainBranch();
|
|
32
|
-
} catch
|
|
32
|
+
} catch {
|
|
33
33
|
logger.warn("Git not initialized, workflow features disabled");
|
|
34
34
|
this.config.enableGitWorkflow = false;
|
|
35
35
|
}
|
|
@@ -178,7 +178,7 @@ class GitWorkflowManager {
|
|
|
178
178
|
execSync(`git checkout --theirs ${file}`, { encoding: "utf8" });
|
|
179
179
|
execSync(`git add ${file}`, { encoding: "utf8" });
|
|
180
180
|
}
|
|
181
|
-
} catch
|
|
181
|
+
} catch {
|
|
182
182
|
logger.error(`Could not auto-resolve conflict in ${file}`);
|
|
183
183
|
}
|
|
184
184
|
}
|
|
@@ -299,7 +299,7 @@ class GitWorkflowManager {
|
|
|
299
299
|
deleteBranch(branchName) {
|
|
300
300
|
try {
|
|
301
301
|
execSync(`git branch -d ${branchName}`, { encoding: "utf8" });
|
|
302
|
-
} catch
|
|
302
|
+
} catch {
|
|
303
303
|
execSync(`git branch -D ${branchName}`, { encoding: "utf8" });
|
|
304
304
|
}
|
|
305
305
|
}
|
|
@@ -370,7 +370,7 @@ class GitWorkflowManager {
|
|
|
370
370
|
);
|
|
371
371
|
}, intervalMs);
|
|
372
372
|
}
|
|
373
|
-
async createPullRequest(agent, task,
|
|
373
|
+
async createPullRequest(agent, task, _branchName) {
|
|
374
374
|
try {
|
|
375
375
|
const title = `[Swarm ${agent.role}] ${task.title}`;
|
|
376
376
|
const body = `
|
|
@@ -117,7 +117,7 @@ class SwarmCoordinator {
|
|
|
117
117
|
/**
|
|
118
118
|
* Launch a swarm of agents to work on a complex project
|
|
119
119
|
*/
|
|
120
|
-
async launchSwarm(projectDescription, agents,
|
|
120
|
+
async launchSwarm(projectDescription, agents, _coordination) {
|
|
121
121
|
logger.info("Launching swarm", {
|
|
122
122
|
project: projectDescription.substring(0, 100),
|
|
123
123
|
agentCount: agents.length
|
|
@@ -236,7 +236,7 @@ class SwarmCoordinator {
|
|
|
236
236
|
/**
|
|
237
237
|
* Initialize specialized agents with role-specific configurations
|
|
238
238
|
*/
|
|
239
|
-
async initializeSpecializedAgents(specifications,
|
|
239
|
+
async initializeSpecializedAgents(specifications, _tasks) {
|
|
240
240
|
const agents = [];
|
|
241
241
|
for (const spec of specifications) {
|
|
242
242
|
const agent = {
|
|
@@ -704,7 +704,7 @@ You are a PROJECT COORDINATOR. Your role is to:
|
|
|
704
704
|
complexity: "medium"
|
|
705
705
|
};
|
|
706
706
|
}
|
|
707
|
-
extractCoreFeatures(
|
|
707
|
+
extractCoreFeatures(_description) {
|
|
708
708
|
return [
|
|
709
709
|
{
|
|
710
710
|
name: "Core Feature",
|
|
@@ -760,7 +760,7 @@ You are a PROJECT COORDINATOR. Your role is to:
|
|
|
760
760
|
agentCanHandle(agent, role) {
|
|
761
761
|
return agent.role === role || agent.capabilities.includes(role);
|
|
762
762
|
}
|
|
763
|
-
selectOptimalAgent(agents,
|
|
763
|
+
selectOptimalAgent(agents, _task) {
|
|
764
764
|
return agents.reduce((best, current) => {
|
|
765
765
|
const bestLoad = best.currentTask ? 1 : 0;
|
|
766
766
|
const currentLoad = current.currentTask ? 1 : 0;
|
|
@@ -792,18 +792,18 @@ You are a PROJECT COORDINATOR. Your role is to:
|
|
|
792
792
|
};
|
|
793
793
|
return iterations[task.estimatedEffort] || 10;
|
|
794
794
|
}
|
|
795
|
-
async getSwarmContext(
|
|
795
|
+
async getSwarmContext(_task) {
|
|
796
796
|
const relatedTasks = Array.from(this.activeAgents.values()).filter((a) => a.currentTask).map((a) => `- Agent ${a.role} is working on task ${a.currentTask}`).join("\n");
|
|
797
797
|
return relatedTasks || "No other agents currently active";
|
|
798
798
|
}
|
|
799
|
-
getCoordinationInstructions(
|
|
799
|
+
getCoordinationInstructions(_agent) {
|
|
800
800
|
return `
|
|
801
801
|
- Save progress to shared context regularly
|
|
802
802
|
- Check for updates from collaborators
|
|
803
803
|
- Request help if blocked for more than 2 iterations
|
|
804
804
|
- Report completion immediately`;
|
|
805
805
|
}
|
|
806
|
-
setupAgentCoordination(agent,
|
|
806
|
+
setupAgentCoordination(agent, _ralph, _assignment) {
|
|
807
807
|
logger.debug(`Setting up coordination for agent ${agent.id}`);
|
|
808
808
|
}
|
|
809
809
|
updateAgentPerformance(agent, success) {
|
|
@@ -839,7 +839,7 @@ You are a PROJECT COORDINATOR. Your role is to:
|
|
|
839
839
|
});
|
|
840
840
|
}
|
|
841
841
|
}
|
|
842
|
-
async detectTunnelVision(
|
|
842
|
+
async detectTunnelVision(_agent) {
|
|
843
843
|
return false;
|
|
844
844
|
}
|
|
845
845
|
async provideAlternativeApproach(agent) {
|
|
@@ -200,11 +200,11 @@ class RalphDebugger {
|
|
|
200
200
|
try {
|
|
201
201
|
const statePath = path.join(session.ralphDir, "state.json");
|
|
202
202
|
const iterationPath = path.join(session.ralphDir, "iteration.txt");
|
|
203
|
-
let
|
|
203
|
+
let _currentState = {};
|
|
204
204
|
let currentIteration = 0;
|
|
205
205
|
try {
|
|
206
206
|
const stateData = await fs.readFile(statePath, "utf8");
|
|
207
|
-
|
|
207
|
+
_currentState = JSON.parse(stateData);
|
|
208
208
|
const iterData = await fs.readFile(iterationPath, "utf8");
|
|
209
209
|
currentIteration = parseInt(iterData.trim()) || 0;
|
|
210
210
|
} catch {
|
|
@@ -435,7 +435,7 @@ class RalphDebugger {
|
|
|
435
435
|
return exportPath;
|
|
436
436
|
}
|
|
437
437
|
// Helper methods
|
|
438
|
-
determineIterationPhase(
|
|
438
|
+
determineIterationPhase(_ralphDir) {
|
|
439
439
|
return "working";
|
|
440
440
|
}
|
|
441
441
|
async calculateContextSize(ralphDir) {
|
|
@@ -81,7 +81,7 @@ Constraints: Keep the plan minimal and implementable in a single PR.`;
|
|
|
81
81
|
const iterations = [];
|
|
82
82
|
let approved = false;
|
|
83
83
|
let lastCommand = "";
|
|
84
|
-
let
|
|
84
|
+
let _lastOutput = "";
|
|
85
85
|
let lastCritique = {
|
|
86
86
|
approved: true,
|
|
87
87
|
issues: [],
|
|
@@ -106,14 +106,14 @@ Incorporate reviewer suggestions: ${lastCritique.suggestions.join("; ")}`;
|
|
|
106
106
|
);
|
|
107
107
|
ok = impl.ok;
|
|
108
108
|
lastCommand = impl.command;
|
|
109
|
-
|
|
109
|
+
_lastOutput = impl.output;
|
|
110
110
|
} else {
|
|
111
111
|
const impl = await implementWithClaude(implPrompt, {
|
|
112
112
|
model: options.plannerModel
|
|
113
113
|
});
|
|
114
114
|
ok = impl.ok;
|
|
115
115
|
lastCommand = `claude:${options.plannerModel || "sonnet"} prompt`;
|
|
116
|
-
|
|
116
|
+
_lastOutput = impl.output;
|
|
117
117
|
}
|
|
118
118
|
const diff = options.dryRun !== false ? "(dry run \u2014 no diff)" : captureGitDiff(input.repoPath);
|
|
119
119
|
const checks = options.dryRun !== false ? null : runPostImplChecks(input.repoPath);
|
|
@@ -10,7 +10,7 @@ import BetterSqlite3 from "better-sqlite3";
|
|
|
10
10
|
import { logger } from "../../core/monitoring/logger.js";
|
|
11
11
|
import { metrics } from "../../core/monitoring/metrics.js";
|
|
12
12
|
import { getUserModel } from "../../models/user.model.js";
|
|
13
|
-
function
|
|
13
|
+
function _getEnv(key, defaultValue) {
|
|
14
14
|
const value = process.env[key];
|
|
15
15
|
if (value === void 0) {
|
|
16
16
|
if (defaultValue !== void 0) return defaultValue;
|
|
@@ -18,7 +18,7 @@ function getEnv(key, defaultValue) {
|
|
|
18
18
|
}
|
|
19
19
|
return value;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function _getOptionalEnv(key) {
|
|
22
22
|
return process.env[key];
|
|
23
23
|
}
|
|
24
24
|
class AuthMiddleware {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackmemoryai/stackmemory",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Lossless, project-scoped memory for AI coding tools. Durable context across sessions with 56 MCP tools, FTS5 search, conductor orchestrator, loop/watch monitoring, snapshot capture, pre-flight overlap checks, Claude/Codex/OpenCode wrappers, Linear sync, and automatic hooks.",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20.0.0",
|