@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
|
@@ -7,7 +7,7 @@ import { createInterface } from "readline";
|
|
|
7
7
|
import { Transform, pipeline } from "stream";
|
|
8
8
|
import { promisify } from "util";
|
|
9
9
|
import { logger } from "../monitoring/logger.js";
|
|
10
|
-
const
|
|
10
|
+
const _pipelineAsync = promisify(pipeline);
|
|
11
11
|
class StreamingJSONLParser {
|
|
12
12
|
DEFAULT_BATCH_SIZE = 100;
|
|
13
13
|
DEFAULT_MAX_LINE_LENGTH = 1024 * 1024;
|
|
@@ -79,7 +79,7 @@ class ProjectManager {
|
|
|
79
79
|
});
|
|
80
80
|
return project;
|
|
81
81
|
} catch (error) {
|
|
82
|
-
const
|
|
82
|
+
const _wrappedError = errorHandler(error, {
|
|
83
83
|
projectPath: path,
|
|
84
84
|
operation: "detectProject"
|
|
85
85
|
});
|
|
@@ -120,7 +120,7 @@ class ProjectManager {
|
|
|
120
120
|
*/
|
|
121
121
|
getGitInfo(projectPath) {
|
|
122
122
|
const info = {};
|
|
123
|
-
const
|
|
123
|
+
const _errorHandler = createErrorHandler({
|
|
124
124
|
operation: "getGitInfo",
|
|
125
125
|
projectPath
|
|
126
126
|
});
|
|
@@ -349,7 +349,7 @@ class ProjectManager {
|
|
|
349
349
|
CREATE INDEX IF NOT EXISTS idx_contexts_project ON project_contexts(project_id);
|
|
350
350
|
`);
|
|
351
351
|
} catch (error) {
|
|
352
|
-
const
|
|
352
|
+
const _dbError = errorHandler(error, {
|
|
353
353
|
dbPath,
|
|
354
354
|
operation: "initializeDatabase"
|
|
355
355
|
});
|
|
@@ -450,7 +450,7 @@ class ProjectManager {
|
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
452
|
} catch (error) {
|
|
453
|
-
const
|
|
453
|
+
const _wrappedError = errorHandler(error, {
|
|
454
454
|
operation: "autoDiscoverOrganizations"
|
|
455
455
|
});
|
|
456
456
|
logger.error(
|
|
@@ -604,7 +604,7 @@ class ProjectManager {
|
|
|
604
604
|
`);
|
|
605
605
|
stmt.run(org.name, org.type, org.accountType, JSON.stringify(org));
|
|
606
606
|
} catch (error) {
|
|
607
|
-
const
|
|
607
|
+
const _wrappedError = errorHandler(error, {
|
|
608
608
|
orgName: org.name,
|
|
609
609
|
operation: "saveOrganization"
|
|
610
610
|
});
|
|
@@ -31,7 +31,7 @@ class ClearSurvival {
|
|
|
31
31
|
try {
|
|
32
32
|
const frames = await this.frameManager.getAllFrames();
|
|
33
33
|
const activeFrames = frames.filter((f) => f.status === "open").length;
|
|
34
|
-
const
|
|
34
|
+
const _sessionId = await this.dbManager.getCurrentSessionId();
|
|
35
35
|
const estimatedTokens = frames.length * 100;
|
|
36
36
|
const maxTokens = 1e4;
|
|
37
37
|
const percentageUsed = Math.min(100, estimatedTokens / maxTokens * 100);
|
|
@@ -41,7 +41,7 @@ class ClearSurvival {
|
|
|
41
41
|
sessionCount: 1,
|
|
42
42
|
percentageUsed
|
|
43
43
|
};
|
|
44
|
-
} catch
|
|
44
|
+
} catch {
|
|
45
45
|
return {
|
|
46
46
|
totalFrames: 50,
|
|
47
47
|
activeFrames: 3,
|
|
@@ -405,7 +405,7 @@ class ClearSurvival {
|
|
|
405
405
|
);
|
|
406
406
|
const content = await fs.readFile(latestPath, "utf-8");
|
|
407
407
|
return JSON.parse(content);
|
|
408
|
-
} catch
|
|
408
|
+
} catch {
|
|
409
409
|
return null;
|
|
410
410
|
}
|
|
411
411
|
}
|
|
@@ -293,7 +293,7 @@ class HandoffGenerator {
|
|
|
293
293
|
extractSuccessfulStrategies(approaches) {
|
|
294
294
|
return approaches.filter((a) => a.outcome === "successful").map((a) => a.approach);
|
|
295
295
|
}
|
|
296
|
-
async suggestNextActions(tasks, blockers,
|
|
296
|
+
async suggestNextActions(tasks, blockers, _framePath) {
|
|
297
297
|
const suggestions = [];
|
|
298
298
|
const inProgress = tasks.filter((t) => t.status === "in_progress");
|
|
299
299
|
if (inProgress.length > 0) {
|
|
@@ -7,7 +7,7 @@ import * as fs from "fs/promises";
|
|
|
7
7
|
import * as path from "path";
|
|
8
8
|
import { logger } from "../monitoring/logger.js";
|
|
9
9
|
import { SystemError, ErrorCode } from "../errors/index.js";
|
|
10
|
-
function
|
|
10
|
+
function _getEnv(key, defaultValue) {
|
|
11
11
|
const value = process.env[key];
|
|
12
12
|
if (value === void 0) {
|
|
13
13
|
if (defaultValue !== void 0) return defaultValue;
|
|
@@ -15,7 +15,7 @@ function getEnv(key, defaultValue) {
|
|
|
15
15
|
}
|
|
16
16
|
return value;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function _getOptionalEnv(key) {
|
|
19
19
|
return process.env[key];
|
|
20
20
|
}
|
|
21
21
|
var FrameQueryMode = /* @__PURE__ */ ((FrameQueryMode2) => {
|
|
@@ -132,7 +132,7 @@ class SessionManager {
|
|
|
132
132
|
const sessionPath = path.join(this.sessionsDir, `${sessionId}.json`);
|
|
133
133
|
const data = await fs.readFile(sessionPath, "utf-8");
|
|
134
134
|
return JSON.parse(data);
|
|
135
|
-
} catch
|
|
135
|
+
} catch {
|
|
136
136
|
try {
|
|
137
137
|
const historyPath = path.join(
|
|
138
138
|
this.sessionsDir,
|
|
@@ -264,7 +264,7 @@ class SessionManager {
|
|
|
264
264
|
async getProjectHash(projectPath) {
|
|
265
265
|
try {
|
|
266
266
|
const cwd = projectPath || process.cwd();
|
|
267
|
-
const
|
|
267
|
+
const _pathModule = await import("path");
|
|
268
268
|
let identifier;
|
|
269
269
|
try {
|
|
270
270
|
const { execSync } = await import("child_process");
|
|
@@ -6,7 +6,7 @@ import "dotenv/config";
|
|
|
6
6
|
import Redis from "ioredis";
|
|
7
7
|
import { v4 as uuidv4 } from "uuid";
|
|
8
8
|
import { logger } from "../monitoring/logger.js";
|
|
9
|
-
function
|
|
9
|
+
function _getEnv(key, defaultValue) {
|
|
10
10
|
const value = process.env[key];
|
|
11
11
|
if (value === void 0) {
|
|
12
12
|
if (defaultValue !== void 0) return defaultValue;
|
|
@@ -14,7 +14,7 @@ function getEnv(key, defaultValue) {
|
|
|
14
14
|
}
|
|
15
15
|
return value;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function _getOptionalEnv(key) {
|
|
18
18
|
return process.env[key];
|
|
19
19
|
}
|
|
20
20
|
import {
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "@aws-sdk/client-s3";
|
|
10
10
|
import { Storage } from "@google-cloud/storage";
|
|
11
11
|
import { logger } from "../monitoring/logger.js";
|
|
12
|
-
function
|
|
12
|
+
function _getEnv(key, defaultValue) {
|
|
13
13
|
const value = process.env[key];
|
|
14
14
|
if (value === void 0) {
|
|
15
15
|
if (defaultValue !== void 0) return defaultValue;
|
|
@@ -17,7 +17,7 @@ function getEnv(key, defaultValue) {
|
|
|
17
17
|
}
|
|
18
18
|
return value;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function _getOptionalEnv(key) {
|
|
21
21
|
return process.env[key];
|
|
22
22
|
}
|
|
23
23
|
var StorageTier = /* @__PURE__ */ ((StorageTier2) => {
|
|
@@ -4,7 +4,7 @@ const __filename = __fileURLToPath(import.meta.url);
|
|
|
4
4
|
const __dirname = __pathDirname(__filename);
|
|
5
5
|
import { trace } from "./debug-trace.js";
|
|
6
6
|
import { logger } from "../monitoring/logger.js";
|
|
7
|
-
function
|
|
7
|
+
function _getEnv(key, defaultValue) {
|
|
8
8
|
const value = process.env[key];
|
|
9
9
|
if (value === void 0) {
|
|
10
10
|
if (defaultValue !== void 0) return defaultValue;
|
|
@@ -12,7 +12,7 @@ function getEnv(key, defaultValue) {
|
|
|
12
12
|
}
|
|
13
13
|
return value;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function _getOptionalEnv(key) {
|
|
16
16
|
return process.env[key];
|
|
17
17
|
}
|
|
18
18
|
function wrapCommand(command) {
|
|
@@ -36,7 +36,7 @@ function wrapCommand(command) {
|
|
|
36
36
|
logger.info(`CLI Command: ${commandPath}`, context);
|
|
37
37
|
await trace.command(commandPath, context, async () => {
|
|
38
38
|
try {
|
|
39
|
-
const
|
|
39
|
+
const _result = await originalAction.apply(null, args);
|
|
40
40
|
logger.info(`CLI Command Completed: ${commandPath}`, {
|
|
41
41
|
duration: trace.exportTraces().find((t) => t.name === commandPath)?.duration
|
|
42
42
|
});
|
|
@@ -7,7 +7,7 @@ import { logger } from "../monitoring/logger.js";
|
|
|
7
7
|
import * as fs from "fs";
|
|
8
8
|
import * as path from "path";
|
|
9
9
|
import { v4 as uuidv4 } from "uuid";
|
|
10
|
-
function
|
|
10
|
+
function _getEnv(key, defaultValue) {
|
|
11
11
|
const value = process.env[key];
|
|
12
12
|
if (value === void 0) {
|
|
13
13
|
if (defaultValue !== void 0) return defaultValue;
|
|
@@ -15,7 +15,7 @@ function getEnv(key, defaultValue) {
|
|
|
15
15
|
}
|
|
16
16
|
return value;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function _getOptionalEnv(key) {
|
|
19
19
|
return process.env[key];
|
|
20
20
|
}
|
|
21
21
|
class TraceContext {
|
|
@@ -44,7 +44,7 @@ class TraceDetector {
|
|
|
44
44
|
* Add a tool call and check if it belongs to current trace
|
|
45
45
|
*/
|
|
46
46
|
addToolCall(tool) {
|
|
47
|
-
const
|
|
47
|
+
const _now = Date.now();
|
|
48
48
|
if (this.shouldStartNewTrace(tool)) {
|
|
49
49
|
if (this.activeTrace.length > 0) {
|
|
50
50
|
this.finalizeTrace();
|
|
@@ -186,7 +186,7 @@ class WorktreeManager {
|
|
|
186
186
|
branches: worktrees.map((w) => w.branch).filter(Boolean)
|
|
187
187
|
});
|
|
188
188
|
return worktrees;
|
|
189
|
-
} catch
|
|
189
|
+
} catch {
|
|
190
190
|
logger.debug("Not a git repository or git worktree not available");
|
|
191
191
|
return [];
|
|
192
192
|
}
|
|
@@ -380,7 +380,7 @@ class WorktreeManager {
|
|
|
380
380
|
/**
|
|
381
381
|
* Merge contexts into target database
|
|
382
382
|
*/
|
|
383
|
-
mergeContexts(contexts, targetDb,
|
|
383
|
+
mergeContexts(contexts, targetDb, _bidirectional) {
|
|
384
384
|
const stmt = targetDb.prepare(`
|
|
385
385
|
INSERT OR REPLACE INTO contexts (id, type, content, metadata, created_at)
|
|
386
386
|
VALUES (?, ?, ?, ?, ?)
|
|
@@ -9,7 +9,7 @@ import Database from "better-sqlite3";
|
|
|
9
9
|
import path from "path";
|
|
10
10
|
import fs from "fs";
|
|
11
11
|
import os from "os";
|
|
12
|
-
function
|
|
12
|
+
function _getEnv(key, defaultValue) {
|
|
13
13
|
const value = process.env[key];
|
|
14
14
|
if (value === void 0) {
|
|
15
15
|
if (defaultValue !== void 0) return defaultValue;
|
|
@@ -17,7 +17,7 @@ function getEnv(key, defaultValue) {
|
|
|
17
17
|
}
|
|
18
18
|
return value;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function _getOptionalEnv(key) {
|
|
21
21
|
return process.env[key];
|
|
22
22
|
}
|
|
23
23
|
class AnalyticsService {
|
|
@@ -52,7 +52,7 @@ class MetricsQueries {
|
|
|
52
52
|
CREATE INDEX IF NOT EXISTS idx_task_assignee ON task_analytics(assignee_id);
|
|
53
53
|
`);
|
|
54
54
|
} catch (error) {
|
|
55
|
-
const
|
|
55
|
+
const _dbError = errorHandler(error, {
|
|
56
56
|
operation: "initializeTables",
|
|
57
57
|
schema: "task_analytics"
|
|
58
58
|
});
|
|
@@ -12,7 +12,7 @@ import { FrameManager } from "../../../core/context/index.js";
|
|
|
12
12
|
import Database from "better-sqlite3";
|
|
13
13
|
import { existsSync } from "fs";
|
|
14
14
|
import { join } from "path";
|
|
15
|
-
function
|
|
15
|
+
function _getEnv(key, defaultValue) {
|
|
16
16
|
const value = process.env[key];
|
|
17
17
|
if (value === void 0) {
|
|
18
18
|
if (defaultValue !== void 0) return defaultValue;
|
|
@@ -20,7 +20,7 @@ function getEnv(key, defaultValue) {
|
|
|
20
20
|
}
|
|
21
21
|
return value;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function _getOptionalEnv(key) {
|
|
24
24
|
return process.env[key];
|
|
25
25
|
}
|
|
26
26
|
const app = express();
|
|
@@ -63,7 +63,7 @@ app.get("/api/tasks", (req, res) => {
|
|
|
63
63
|
try {
|
|
64
64
|
const tasks = taskReader.getTasks();
|
|
65
65
|
res.json({ tasks, total: tasks.length });
|
|
66
|
-
} catch
|
|
66
|
+
} catch {
|
|
67
67
|
res.status(500).json({ error: "Failed to fetch tasks" });
|
|
68
68
|
}
|
|
69
69
|
});
|
|
@@ -71,7 +71,7 @@ app.get("/api/tasks/active", (req, res) => {
|
|
|
71
71
|
try {
|
|
72
72
|
const tasks = taskReader.getActiveTasks();
|
|
73
73
|
res.json({ tasks, total: tasks.length });
|
|
74
|
-
} catch
|
|
74
|
+
} catch {
|
|
75
75
|
res.status(500).json({ error: "Failed to fetch active tasks" });
|
|
76
76
|
}
|
|
77
77
|
});
|
|
@@ -79,7 +79,7 @@ app.get("/api/tasks/by-state/:state", (req, res) => {
|
|
|
79
79
|
try {
|
|
80
80
|
const tasks = taskReader.getTasksByState(req.params.state);
|
|
81
81
|
res.json({ tasks, total: tasks.length });
|
|
82
|
-
} catch
|
|
82
|
+
} catch {
|
|
83
83
|
res.status(500).json({ error: "Failed to fetch tasks by state" });
|
|
84
84
|
}
|
|
85
85
|
});
|
|
@@ -87,7 +87,7 @@ app.get("/api/sessions", (req, res) => {
|
|
|
87
87
|
try {
|
|
88
88
|
const sessions = sessionManager?.getActiveSessions ? sessionManager.getActiveSessions() : [];
|
|
89
89
|
res.json({ sessions, total: sessions.length });
|
|
90
|
-
} catch
|
|
90
|
+
} catch {
|
|
91
91
|
res.status(500).json({ error: "Failed to fetch sessions" });
|
|
92
92
|
}
|
|
93
93
|
});
|
|
@@ -99,7 +99,7 @@ app.get("/api/frames", (req, res) => {
|
|
|
99
99
|
}
|
|
100
100
|
const frames = frameManager.getAllFrames();
|
|
101
101
|
res.json({ frames, total: frames.length });
|
|
102
|
-
} catch
|
|
102
|
+
} catch {
|
|
103
103
|
res.status(500).json({ error: "Failed to fetch frames" });
|
|
104
104
|
}
|
|
105
105
|
});
|
|
@@ -145,7 +145,7 @@ app.get("/api/analytics", (req, res) => {
|
|
|
145
145
|
}
|
|
146
146
|
};
|
|
147
147
|
res.json(analytics);
|
|
148
|
-
} catch
|
|
148
|
+
} catch {
|
|
149
149
|
res.status(500).json({ error: "Failed to fetch analytics" });
|
|
150
150
|
}
|
|
151
151
|
});
|
|
@@ -91,7 +91,7 @@ class AnthropicClient {
|
|
|
91
91
|
/**
|
|
92
92
|
* Mock response generators
|
|
93
93
|
*/
|
|
94
|
-
mockPlanningResponse(
|
|
94
|
+
mockPlanningResponse(_prompt) {
|
|
95
95
|
return JSON.stringify(
|
|
96
96
|
{
|
|
97
97
|
plan: {
|
|
@@ -135,7 +135,7 @@ class AnthropicClient {
|
|
|
135
135
|
2
|
|
136
136
|
);
|
|
137
137
|
}
|
|
138
|
-
mockCodeResponse(
|
|
138
|
+
mockCodeResponse(_prompt) {
|
|
139
139
|
return `
|
|
140
140
|
// Mock implementation
|
|
141
141
|
export function processTask(input: string): string {
|
|
@@ -149,7 +149,7 @@ export function validateInput(input: unknown): boolean {
|
|
|
149
149
|
}
|
|
150
150
|
`.trim();
|
|
151
151
|
}
|
|
152
|
-
mockTestingResponse(
|
|
152
|
+
mockTestingResponse(_prompt) {
|
|
153
153
|
return `
|
|
154
154
|
import { describe, test, expect } from 'vitest';
|
|
155
155
|
import { processTask, validateInput } from './implementation';
|
|
@@ -176,7 +176,7 @@ describe('validateInput', () => {
|
|
|
176
176
|
});
|
|
177
177
|
`.trim();
|
|
178
178
|
}
|
|
179
|
-
mockReviewResponse(
|
|
179
|
+
mockReviewResponse(_prompt) {
|
|
180
180
|
return JSON.stringify(
|
|
181
181
|
{
|
|
182
182
|
quality: 0.75,
|
|
@@ -228,7 +228,7 @@ class PostTaskHooks extends EventEmitter {
|
|
|
228
228
|
/**
|
|
229
229
|
* Run linter on changed files
|
|
230
230
|
*/
|
|
231
|
-
async runLinter(
|
|
231
|
+
async runLinter(_files) {
|
|
232
232
|
const start = Date.now();
|
|
233
233
|
try {
|
|
234
234
|
if (!this.config.testFrameworks.lintCommand) {
|
|
@@ -264,7 +264,7 @@ class PostTaskHooks extends EventEmitter {
|
|
|
264
264
|
/**
|
|
265
265
|
* Run tests
|
|
266
266
|
*/
|
|
267
|
-
async runTests(
|
|
267
|
+
async runTests(_files) {
|
|
268
268
|
const start = Date.now();
|
|
269
269
|
try {
|
|
270
270
|
if (!this.config.testFrameworks.testCommand) {
|
|
@@ -300,7 +300,7 @@ class PostTaskHooks extends EventEmitter {
|
|
|
300
300
|
/**
|
|
301
301
|
* Check test coverage
|
|
302
302
|
*/
|
|
303
|
-
async checkTestCoverage(
|
|
303
|
+
async checkTestCoverage(_files) {
|
|
304
304
|
const start = Date.now();
|
|
305
305
|
try {
|
|
306
306
|
if (!this.config.testFrameworks.coverageCommand) {
|
|
@@ -424,7 +424,7 @@ Context (JSON): ${JSON.stringify(request.context)}`;
|
|
|
424
424
|
/**
|
|
425
425
|
* Get mock response for testing
|
|
426
426
|
*/
|
|
427
|
-
async getMockResponse(request, startTime,
|
|
427
|
+
async getMockResponse(request, startTime, _subagentId) {
|
|
428
428
|
await new Promise(
|
|
429
429
|
(resolve) => setTimeout(resolve, Math.random() * 20 + 10)
|
|
430
430
|
);
|
|
@@ -536,7 +536,7 @@ function greetUser(name: string): string {
|
|
|
536
536
|
if (fs.existsSync(filePath)) {
|
|
537
537
|
try {
|
|
538
538
|
fs.unlinkSync(filePath);
|
|
539
|
-
} catch
|
|
539
|
+
} catch {
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
542
|
}
|
|
@@ -39,7 +39,7 @@ class DiffMemClient {
|
|
|
39
39
|
});
|
|
40
40
|
clearTimeout(timeoutId);
|
|
41
41
|
if (!response.ok) {
|
|
42
|
-
const
|
|
42
|
+
const _errorBody = await response.text().catch(() => "");
|
|
43
43
|
throw new DiffMemClientError(
|
|
44
44
|
`Request failed: ${response.statusText}`,
|
|
45
45
|
"HTTP_ERROR",
|
|
@@ -8,7 +8,7 @@ import { logger } from "../../core/monitoring/logger.js";
|
|
|
8
8
|
import { LinearAuthManager } from "./auth.js";
|
|
9
9
|
import chalk from "chalk";
|
|
10
10
|
import { IntegrationError, ErrorCode } from "../../core/errors/index.js";
|
|
11
|
-
function
|
|
11
|
+
function _getEnv(key, defaultValue) {
|
|
12
12
|
const value = process.env[key];
|
|
13
13
|
if (value === void 0) {
|
|
14
14
|
if (defaultValue !== void 0) return defaultValue;
|
|
@@ -19,7 +19,7 @@ function getEnv(key, defaultValue) {
|
|
|
19
19
|
}
|
|
20
20
|
return value;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function _getOptionalEnv(key) {
|
|
23
23
|
return process.env[key];
|
|
24
24
|
}
|
|
25
25
|
class LinearOAuthServer {
|
|
@@ -472,7 +472,7 @@ Frame: ${task.frame_id}`
|
|
|
472
472
|
this.mappings.set(mapping.stackmemoryId, mapping);
|
|
473
473
|
}
|
|
474
474
|
logger.info(`Loaded ${this.mappings.size} task mappings from disk`);
|
|
475
|
-
} catch
|
|
475
|
+
} catch {
|
|
476
476
|
logger.warn("Failed to load mappings, starting fresh");
|
|
477
477
|
}
|
|
478
478
|
}
|
|
@@ -9,7 +9,7 @@ import { IntegrationError, ErrorCode } from "../../core/errors/index.js";
|
|
|
9
9
|
import { logger } from "../../core/monitoring/logger.js";
|
|
10
10
|
import { ClaudeCodeSubagentClient } from "../claude-code/subagent-client.js";
|
|
11
11
|
const AUTOMATION_LABELS = ["automated", "claude-code", "stackmemory"];
|
|
12
|
-
function
|
|
12
|
+
function _getEnv(key, defaultValue) {
|
|
13
13
|
const value = process.env[key];
|
|
14
14
|
if (value === void 0) {
|
|
15
15
|
if (defaultValue !== void 0) return defaultValue;
|
|
@@ -20,7 +20,7 @@ function getEnv(key, defaultValue) {
|
|
|
20
20
|
}
|
|
21
21
|
return value;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function _getOptionalEnv(key) {
|
|
24
24
|
return process.env[key];
|
|
25
25
|
}
|
|
26
26
|
class LinearWebhookHandler {
|
|
@@ -9,7 +9,7 @@ import { LinearSyncService } from "./sync-service.js";
|
|
|
9
9
|
import { IntegrationError, ErrorCode } from "../../core/errors/index.js";
|
|
10
10
|
import { logger } from "../../core/monitoring/logger.js";
|
|
11
11
|
import chalk from "chalk";
|
|
12
|
-
function
|
|
12
|
+
function _getEnv(key, defaultValue) {
|
|
13
13
|
const value = process.env[key];
|
|
14
14
|
if (value === void 0) {
|
|
15
15
|
if (defaultValue !== void 0) return defaultValue;
|
|
@@ -20,7 +20,7 @@ function getEnv(key, defaultValue) {
|
|
|
20
20
|
}
|
|
21
21
|
return value;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function _getOptionalEnv(key) {
|
|
24
24
|
return process.env[key];
|
|
25
25
|
}
|
|
26
26
|
class LinearWebhookServer {
|
|
@@ -5,7 +5,7 @@ const __dirname = __pathDirname(__filename);
|
|
|
5
5
|
import { logger } from "../../core/monitoring/logger.js";
|
|
6
6
|
import { IntegrationError, ErrorCode } from "../../core/errors/index.js";
|
|
7
7
|
import crypto from "crypto";
|
|
8
|
-
function
|
|
8
|
+
function _getEnv(key, defaultValue) {
|
|
9
9
|
const value = process.env[key];
|
|
10
10
|
if (value === void 0) {
|
|
11
11
|
if (defaultValue !== void 0) return defaultValue;
|
|
@@ -16,7 +16,7 @@ function getEnv(key, defaultValue) {
|
|
|
16
16
|
}
|
|
17
17
|
return value;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function _getOptionalEnv(key) {
|
|
20
20
|
return process.env[key];
|
|
21
21
|
}
|
|
22
22
|
class LinearWebhookHandler {
|
|
@@ -279,7 +279,7 @@ class DiscoveryHandlers {
|
|
|
279
279
|
}
|
|
280
280
|
return Array.from(files);
|
|
281
281
|
}
|
|
282
|
-
async searchCodebase(keywords, includePatterns, excludePatterns, depth,
|
|
282
|
+
async searchCodebase(keywords, includePatterns, excludePatterns, depth, _maxFiles) {
|
|
283
283
|
const files = [];
|
|
284
284
|
const maxResults = depth === "shallow" ? 10 : depth === "medium" ? 25 : 50;
|
|
285
285
|
for (const keyword of keywords.slice(0, 10)) {
|
|
@@ -322,8 +322,8 @@ class DiscoveryHandlers {
|
|
|
322
322
|
}
|
|
323
323
|
return files;
|
|
324
324
|
}
|
|
325
|
-
rankFiles(discovered, recent,
|
|
326
|
-
const
|
|
325
|
+
rankFiles(discovered, recent, _keywords) {
|
|
326
|
+
const _recentSet = new Set(recent);
|
|
327
327
|
for (const recentFile of recent) {
|
|
328
328
|
const existing = discovered.find((f) => f.path === recentFile);
|
|
329
329
|
if (existing) {
|
|
@@ -3,7 +3,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
3
3
|
const __filename = __fileURLToPath(import.meta.url);
|
|
4
4
|
const __dirname = __pathDirname(__filename);
|
|
5
5
|
import { logger } from "../../../core/monitoring/logger.js";
|
|
6
|
-
function
|
|
6
|
+
function _getEnv(key, defaultValue) {
|
|
7
7
|
const value = process.env[key];
|
|
8
8
|
if (value === void 0) {
|
|
9
9
|
if (defaultValue !== void 0) return defaultValue;
|
|
@@ -11,7 +11,7 @@ function getEnv(key, defaultValue) {
|
|
|
11
11
|
}
|
|
12
12
|
return value;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function _getOptionalEnv(key) {
|
|
15
15
|
return process.env[key];
|
|
16
16
|
}
|
|
17
17
|
import {
|
|
@@ -109,7 +109,7 @@ class TaskHandlers {
|
|
|
109
109
|
const {
|
|
110
110
|
status,
|
|
111
111
|
priority,
|
|
112
|
-
|
|
112
|
+
_limit = 20,
|
|
113
113
|
include_completed = false,
|
|
114
114
|
tags = [],
|
|
115
115
|
search
|
|
@@ -168,7 +168,7 @@ ${summaryText}`
|
|
|
168
168
|
/**
|
|
169
169
|
* Get task metrics and analytics
|
|
170
170
|
*/
|
|
171
|
-
async handleGetTaskMetrics(
|
|
171
|
+
async handleGetTaskMetrics(_args) {
|
|
172
172
|
try {
|
|
173
173
|
const metrics = await this.deps.taskStore.getMetrics();
|
|
174
174
|
const metricsText = `
|
|
@@ -240,7 +240,7 @@ Navigated to: ${url}`
|
|
|
240
240
|
*/
|
|
241
241
|
async handleExecuteScript(args) {
|
|
242
242
|
try {
|
|
243
|
-
const { session_id, script, args:
|
|
243
|
+
const { session_id, script, args: _scriptArgs = [] } = args;
|
|
244
244
|
if (!session_id) {
|
|
245
245
|
throw new Error("Session ID is required");
|
|
246
246
|
}
|
|
@@ -24,7 +24,7 @@ import { logger } from "../../core/monitoring/logger.js";
|
|
|
24
24
|
import { MCPHandlerFactory } from "./handlers/index.js";
|
|
25
25
|
import { MCPToolDefinitions } from "./tool-definitions.js";
|
|
26
26
|
import { ToolScoringMiddleware } from "./middleware/tool-scoring.js";
|
|
27
|
-
function
|
|
27
|
+
function _getEnv(key, defaultValue) {
|
|
28
28
|
const value = process.env[key];
|
|
29
29
|
if (value === void 0) {
|
|
30
30
|
if (defaultValue !== void 0) return defaultValue;
|
|
@@ -32,7 +32,7 @@ function getEnv(key, defaultValue) {
|
|
|
32
32
|
}
|
|
33
33
|
return value;
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function _getOptionalEnv(key) {
|
|
36
36
|
return process.env[key];
|
|
37
37
|
}
|
|
38
38
|
class StackMemoryMCP {
|
|
@@ -376,7 +376,7 @@ ${summary}...`, 0.8);
|
|
|
376
376
|
);
|
|
377
377
|
}
|
|
378
378
|
async handleGetContext(args) {
|
|
379
|
-
const {
|
|
379
|
+
const { _query = "", limit = 10 } = args;
|
|
380
380
|
const contexts = Array.from(this.contexts.values()).sort((a, b) => b.importance - a.importance).slice(0, limit);
|
|
381
381
|
const response = contexts.map(
|
|
382
382
|
(ctx) => `[${ctx.type.toUpperCase()}] (importance: ${ctx.importance.toFixed(2)})
|