@stackmemoryai/stackmemory 0.5.7 → 0.5.9
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/commands/sms-notify.js +362 -0
- package/dist/cli/commands/sms-notify.js.map +7 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +2 -2
- package/dist/hooks/index.js +3 -0
- package/dist/hooks/index.js.map +2 -2
- package/dist/hooks/sms-action-runner.js +170 -0
- package/dist/hooks/sms-action-runner.js.map +7 -0
- package/dist/hooks/sms-notify.js +286 -0
- package/dist/hooks/sms-notify.js.map +7 -0
- package/dist/hooks/sms-webhook.js +144 -0
- package/dist/hooks/sms-webhook.js.map +7 -0
- package/package.json +1 -1
- package/scripts/install-notify-hook.sh +84 -0
- package/templates/claude-hooks/notify-review-hook.js +171 -0
- package/templates/claude-hooks/sms-response-handler.js +185 -0
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
2
|
+
import { dirname as __pathDirname } from 'path';
|
|
3
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
4
|
+
const __dirname = __pathDirname(__filename);
|
|
5
|
+
import { Command } from "commander";
|
|
6
|
+
import chalk from "chalk";
|
|
7
|
+
import { execSync } from "child_process";
|
|
8
|
+
import { join } from "path";
|
|
9
|
+
import {
|
|
10
|
+
loadSMSConfig,
|
|
11
|
+
saveSMSConfig,
|
|
12
|
+
sendSMSNotification,
|
|
13
|
+
notifyReviewReady,
|
|
14
|
+
notifyWithYesNo,
|
|
15
|
+
notifyTaskComplete,
|
|
16
|
+
cleanupExpiredPrompts
|
|
17
|
+
} from "../../hooks/sms-notify.js";
|
|
18
|
+
import {
|
|
19
|
+
loadActionQueue,
|
|
20
|
+
processAllPendingActions,
|
|
21
|
+
cleanupOldActions,
|
|
22
|
+
startActionWatcher
|
|
23
|
+
} from "../../hooks/sms-action-runner.js";
|
|
24
|
+
function createSMSNotifyCommand() {
|
|
25
|
+
const cmd = new Command("notify").description(
|
|
26
|
+
"SMS notification system for review alerts (optional, requires Twilio)"
|
|
27
|
+
).addHelpText(
|
|
28
|
+
"after",
|
|
29
|
+
`
|
|
30
|
+
Setup (optional):
|
|
31
|
+
1. Create Twilio account at https://twilio.com
|
|
32
|
+
2. Get Account SID, Auth Token, and phone number
|
|
33
|
+
3. Set environment variables:
|
|
34
|
+
export TWILIO_ACCOUNT_SID=your_sid
|
|
35
|
+
export TWILIO_AUTH_TOKEN=your_token
|
|
36
|
+
export TWILIO_FROM_NUMBER=+1234567890
|
|
37
|
+
export TWILIO_TO_NUMBER=+1234567890
|
|
38
|
+
4. Enable: stackmemory notify enable
|
|
39
|
+
|
|
40
|
+
Examples:
|
|
41
|
+
stackmemory notify status Check configuration
|
|
42
|
+
stackmemory notify enable Enable notifications
|
|
43
|
+
stackmemory notify test Send test message
|
|
44
|
+
stackmemory notify send "PR ready" Send custom message
|
|
45
|
+
stackmemory notify review "PR #123" Send review notification with options
|
|
46
|
+
stackmemory notify ask "Deploy?" Send yes/no prompt
|
|
47
|
+
`
|
|
48
|
+
);
|
|
49
|
+
cmd.command("status").description("Show notification configuration status").action(() => {
|
|
50
|
+
const config = loadSMSConfig();
|
|
51
|
+
console.log(chalk.blue("SMS Notification Status:"));
|
|
52
|
+
console.log();
|
|
53
|
+
const hasCreds = config.accountSid && config.authToken && config.fromNumber && config.toNumber;
|
|
54
|
+
console.log(
|
|
55
|
+
` ${chalk.gray("Enabled:")} ${config.enabled ? chalk.green("yes") : chalk.red("no")}`
|
|
56
|
+
);
|
|
57
|
+
console.log(
|
|
58
|
+
` ${chalk.gray("Configured:")} ${hasCreds ? chalk.green("yes") : chalk.yellow("no (set env vars)")}`
|
|
59
|
+
);
|
|
60
|
+
if (config.fromNumber) {
|
|
61
|
+
console.log(` ${chalk.gray("From:")} ${maskPhone(config.fromNumber)}`);
|
|
62
|
+
}
|
|
63
|
+
if (config.toNumber) {
|
|
64
|
+
console.log(` ${chalk.gray("To:")} ${maskPhone(config.toNumber)}`);
|
|
65
|
+
}
|
|
66
|
+
console.log();
|
|
67
|
+
console.log(chalk.blue("Notify On:"));
|
|
68
|
+
console.log(
|
|
69
|
+
` ${chalk.gray("Task Complete:")} ${config.notifyOn.taskComplete ? "yes" : "no"}`
|
|
70
|
+
);
|
|
71
|
+
console.log(
|
|
72
|
+
` ${chalk.gray("Review Ready:")} ${config.notifyOn.reviewReady ? "yes" : "no"}`
|
|
73
|
+
);
|
|
74
|
+
console.log(
|
|
75
|
+
` ${chalk.gray("Errors:")} ${config.notifyOn.error ? "yes" : "no"}`
|
|
76
|
+
);
|
|
77
|
+
if (config.quietHours?.enabled) {
|
|
78
|
+
console.log();
|
|
79
|
+
console.log(
|
|
80
|
+
chalk.blue(
|
|
81
|
+
`Quiet Hours: ${config.quietHours.start} - ${config.quietHours.end}`
|
|
82
|
+
)
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
console.log();
|
|
86
|
+
console.log(
|
|
87
|
+
` ${chalk.gray("Pending Prompts:")} ${config.pendingPrompts.length}`
|
|
88
|
+
);
|
|
89
|
+
console.log(
|
|
90
|
+
` ${chalk.gray("Response Timeout:")} ${config.responseTimeout}s`
|
|
91
|
+
);
|
|
92
|
+
if (!hasCreds) {
|
|
93
|
+
console.log();
|
|
94
|
+
console.log(
|
|
95
|
+
chalk.yellow("To configure, set these environment variables:")
|
|
96
|
+
);
|
|
97
|
+
console.log(chalk.gray(" export TWILIO_ACCOUNT_SID=your_sid"));
|
|
98
|
+
console.log(chalk.gray(" export TWILIO_AUTH_TOKEN=your_token"));
|
|
99
|
+
console.log(chalk.gray(" export TWILIO_FROM_NUMBER=+1234567890"));
|
|
100
|
+
console.log(chalk.gray(" export TWILIO_TO_NUMBER=+1234567890"));
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
cmd.command("enable").description("Enable SMS notifications").action(() => {
|
|
104
|
+
const config = loadSMSConfig();
|
|
105
|
+
config.enabled = true;
|
|
106
|
+
saveSMSConfig(config);
|
|
107
|
+
console.log(chalk.green("SMS notifications enabled"));
|
|
108
|
+
const hasCreds = config.accountSid && config.authToken && config.fromNumber && config.toNumber;
|
|
109
|
+
if (!hasCreds) {
|
|
110
|
+
console.log(
|
|
111
|
+
chalk.yellow(
|
|
112
|
+
"Note: Set Twilio environment variables to send messages"
|
|
113
|
+
)
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
cmd.command("disable").description("Disable SMS notifications").action(() => {
|
|
118
|
+
const config = loadSMSConfig();
|
|
119
|
+
config.enabled = false;
|
|
120
|
+
saveSMSConfig(config);
|
|
121
|
+
console.log(chalk.yellow("SMS notifications disabled"));
|
|
122
|
+
});
|
|
123
|
+
cmd.command("test").description("Send a test notification").action(async () => {
|
|
124
|
+
console.log(chalk.blue("Sending test notification..."));
|
|
125
|
+
const result = await sendSMSNotification({
|
|
126
|
+
type: "custom",
|
|
127
|
+
title: "StackMemory Test",
|
|
128
|
+
message: "This is a test notification from StackMemory."
|
|
129
|
+
});
|
|
130
|
+
if (result.success) {
|
|
131
|
+
console.log(chalk.green("Test message sent successfully!"));
|
|
132
|
+
} else {
|
|
133
|
+
console.log(chalk.red(`Failed: ${result.error}`));
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
cmd.command("send <message>").description("Send a custom notification").option("-t, --title <title>", "Message title", "StackMemory Alert").action(async (message, options) => {
|
|
137
|
+
const result = await sendSMSNotification({
|
|
138
|
+
type: "custom",
|
|
139
|
+
title: options.title,
|
|
140
|
+
message
|
|
141
|
+
});
|
|
142
|
+
if (result.success) {
|
|
143
|
+
console.log(chalk.green("Message sent!"));
|
|
144
|
+
} else {
|
|
145
|
+
console.log(chalk.red(`Failed: ${result.error}`));
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
cmd.command("review <title>").description("Send review-ready notification with options").option("-m, --message <msg>", "Description", "Ready for your review").option(
|
|
149
|
+
"-o, --options <opts>",
|
|
150
|
+
"Comma-separated options",
|
|
151
|
+
"Approve,Request Changes,Skip"
|
|
152
|
+
).action(
|
|
153
|
+
async (title, options) => {
|
|
154
|
+
const opts = options.options.split(",").map((o) => ({
|
|
155
|
+
label: o.trim()
|
|
156
|
+
}));
|
|
157
|
+
console.log(chalk.blue("Sending review notification..."));
|
|
158
|
+
const result = await notifyReviewReady(title, options.message, opts);
|
|
159
|
+
if (result.success) {
|
|
160
|
+
console.log(chalk.green("Review notification sent!"));
|
|
161
|
+
if (result.promptId) {
|
|
162
|
+
console.log(chalk.gray(`Prompt ID: ${result.promptId}`));
|
|
163
|
+
}
|
|
164
|
+
} else {
|
|
165
|
+
console.log(chalk.red(`Failed: ${result.error}`));
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
);
|
|
169
|
+
cmd.command("ask <question>").description("Send a yes/no prompt").option("-t, --title <title>", "Message title", "StackMemory").action(async (question, options) => {
|
|
170
|
+
console.log(chalk.blue("Sending yes/no prompt..."));
|
|
171
|
+
const result = await notifyWithYesNo(options.title, question);
|
|
172
|
+
if (result.success) {
|
|
173
|
+
console.log(chalk.green("Prompt sent!"));
|
|
174
|
+
if (result.promptId) {
|
|
175
|
+
console.log(chalk.gray(`Prompt ID: ${result.promptId}`));
|
|
176
|
+
}
|
|
177
|
+
} else {
|
|
178
|
+
console.log(chalk.red(`Failed: ${result.error}`));
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
cmd.command("complete <task>").description("Send task completion notification").option("-s, --summary <text>", "Task summary", "").action(async (task, options) => {
|
|
182
|
+
const result = await notifyTaskComplete(
|
|
183
|
+
task,
|
|
184
|
+
options.summary || `Task "${task}" has been completed.`
|
|
185
|
+
);
|
|
186
|
+
if (result.success) {
|
|
187
|
+
console.log(chalk.green("Completion notification sent!"));
|
|
188
|
+
} else {
|
|
189
|
+
console.log(chalk.red(`Failed: ${result.error}`));
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
cmd.command("quiet").description("Configure quiet hours").option("--enable", "Enable quiet hours").option("--disable", "Disable quiet hours").option("--start <time>", "Start time (HH:MM)", "22:00").option("--end <time>", "End time (HH:MM)", "08:00").action(
|
|
193
|
+
(options) => {
|
|
194
|
+
const config = loadSMSConfig();
|
|
195
|
+
if (!config.quietHours) {
|
|
196
|
+
config.quietHours = { enabled: false, start: "22:00", end: "08:00" };
|
|
197
|
+
}
|
|
198
|
+
if (options.enable) {
|
|
199
|
+
config.quietHours.enabled = true;
|
|
200
|
+
} else if (options.disable) {
|
|
201
|
+
config.quietHours.enabled = false;
|
|
202
|
+
}
|
|
203
|
+
if (options.start) {
|
|
204
|
+
config.quietHours.start = options.start;
|
|
205
|
+
}
|
|
206
|
+
if (options.end) {
|
|
207
|
+
config.quietHours.end = options.end;
|
|
208
|
+
}
|
|
209
|
+
saveSMSConfig(config);
|
|
210
|
+
if (config.quietHours.enabled) {
|
|
211
|
+
console.log(
|
|
212
|
+
chalk.green(
|
|
213
|
+
`Quiet hours enabled: ${config.quietHours.start} - ${config.quietHours.end}`
|
|
214
|
+
)
|
|
215
|
+
);
|
|
216
|
+
} else {
|
|
217
|
+
console.log(chalk.yellow("Quiet hours disabled"));
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
);
|
|
221
|
+
cmd.command("toggle <type>").description(
|
|
222
|
+
"Toggle notification type (taskComplete|reviewReady|error|custom)"
|
|
223
|
+
).action((type) => {
|
|
224
|
+
const config = loadSMSConfig();
|
|
225
|
+
const validTypes = ["taskComplete", "reviewReady", "error", "custom"];
|
|
226
|
+
if (!validTypes.includes(type)) {
|
|
227
|
+
console.log(chalk.red(`Invalid type. Use: ${validTypes.join(", ")}`));
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
const key = type;
|
|
231
|
+
config.notifyOn[key] = !config.notifyOn[key];
|
|
232
|
+
saveSMSConfig(config);
|
|
233
|
+
console.log(
|
|
234
|
+
chalk.green(
|
|
235
|
+
`${type} notifications ${config.notifyOn[key] ? "enabled" : "disabled"}`
|
|
236
|
+
)
|
|
237
|
+
);
|
|
238
|
+
});
|
|
239
|
+
cmd.command("pending").description("List pending prompts awaiting response").action(() => {
|
|
240
|
+
const config = loadSMSConfig();
|
|
241
|
+
if (config.pendingPrompts.length === 0) {
|
|
242
|
+
console.log(chalk.gray("No pending prompts"));
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
console.log(chalk.blue("Pending Prompts:"));
|
|
246
|
+
config.pendingPrompts.forEach((p) => {
|
|
247
|
+
const expires = new Date(p.expiresAt);
|
|
248
|
+
const remaining = Math.round((expires.getTime() - Date.now()) / 1e3);
|
|
249
|
+
console.log();
|
|
250
|
+
console.log(` ${chalk.gray("ID:")} ${p.id}`);
|
|
251
|
+
console.log(` ${chalk.gray("Type:")} ${p.type}`);
|
|
252
|
+
console.log(
|
|
253
|
+
` ${chalk.gray("Message:")} ${p.message.substring(0, 50)}...`
|
|
254
|
+
);
|
|
255
|
+
console.log(
|
|
256
|
+
` ${chalk.gray("Expires:")} ${remaining > 0 ? `${remaining}s` : chalk.red("expired")}`
|
|
257
|
+
);
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
cmd.command("cleanup").description("Remove expired pending prompts").action(() => {
|
|
261
|
+
const removed = cleanupExpiredPrompts();
|
|
262
|
+
console.log(chalk.green(`Removed ${removed} expired prompt(s)`));
|
|
263
|
+
});
|
|
264
|
+
cmd.command("timeout <seconds>").description("Set response timeout for prompts").action((seconds) => {
|
|
265
|
+
const config = loadSMSConfig();
|
|
266
|
+
const timeout = parseInt(seconds, 10);
|
|
267
|
+
if (isNaN(timeout) || timeout < 30) {
|
|
268
|
+
console.log(chalk.red("Timeout must be at least 30 seconds"));
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
config.responseTimeout = timeout;
|
|
272
|
+
saveSMSConfig(config);
|
|
273
|
+
console.log(chalk.green(`Response timeout set to ${timeout} seconds`));
|
|
274
|
+
});
|
|
275
|
+
cmd.command("actions").description("List queued actions from SMS responses").action(() => {
|
|
276
|
+
const queue = loadActionQueue();
|
|
277
|
+
if (queue.actions.length === 0) {
|
|
278
|
+
console.log(chalk.gray("No actions in queue"));
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
console.log(chalk.blue("Action Queue:"));
|
|
282
|
+
queue.actions.forEach((a) => {
|
|
283
|
+
const statusColor = a.status === "completed" ? chalk.green : a.status === "failed" ? chalk.red : a.status === "running" ? chalk.yellow : chalk.gray;
|
|
284
|
+
console.log();
|
|
285
|
+
console.log(` ${chalk.gray("ID:")} ${a.id}`);
|
|
286
|
+
console.log(` ${chalk.gray("Status:")} ${statusColor(a.status)}`);
|
|
287
|
+
console.log(
|
|
288
|
+
` ${chalk.gray("Action:")} ${a.action.substring(0, 60)}...`
|
|
289
|
+
);
|
|
290
|
+
console.log(` ${chalk.gray("Response:")} ${a.response}`);
|
|
291
|
+
if (a.error) {
|
|
292
|
+
console.log(` ${chalk.gray("Error:")} ${chalk.red(a.error)}`);
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
});
|
|
296
|
+
cmd.command("run-actions").description("Execute all pending actions from SMS responses").action(() => {
|
|
297
|
+
console.log(chalk.blue("Processing pending actions..."));
|
|
298
|
+
const result = processAllPendingActions();
|
|
299
|
+
console.log(
|
|
300
|
+
chalk.green(
|
|
301
|
+
`Processed ${result.processed} action(s): ${result.succeeded} succeeded, ${result.failed} failed`
|
|
302
|
+
)
|
|
303
|
+
);
|
|
304
|
+
});
|
|
305
|
+
cmd.command("watch").description("Watch for and execute SMS response actions").option("-i, --interval <ms>", "Check interval in milliseconds", "5000").action((options) => {
|
|
306
|
+
const interval = parseInt(options.interval, 10);
|
|
307
|
+
console.log(chalk.blue(`Watching for actions (interval: ${interval}ms)`));
|
|
308
|
+
console.log(chalk.gray("Press Ctrl+C to stop"));
|
|
309
|
+
startActionWatcher(interval);
|
|
310
|
+
});
|
|
311
|
+
cmd.command("cleanup-actions").description("Remove old completed actions").action(() => {
|
|
312
|
+
const removed = cleanupOldActions();
|
|
313
|
+
console.log(chalk.green(`Removed ${removed} old action(s)`));
|
|
314
|
+
});
|
|
315
|
+
cmd.command("install-hook").description("Install Claude Code notification hook").action(() => {
|
|
316
|
+
try {
|
|
317
|
+
const scriptPath = join(
|
|
318
|
+
__dirname,
|
|
319
|
+
"../../../scripts/install-notify-hook.sh"
|
|
320
|
+
);
|
|
321
|
+
execSync(`bash "${scriptPath}"`, { stdio: "inherit" });
|
|
322
|
+
} catch {
|
|
323
|
+
console.error(chalk.red("Failed to install hook"));
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
cmd.command("install-response-hook").description("Install Claude Code response handler hook").action(() => {
|
|
327
|
+
try {
|
|
328
|
+
const hooksDir = join(process.env["HOME"] || "~", ".claude", "hooks");
|
|
329
|
+
const hookSrc = join(
|
|
330
|
+
__dirname,
|
|
331
|
+
"../../../templates/claude-hooks/sms-response-handler.js"
|
|
332
|
+
);
|
|
333
|
+
const hookDest = join(hooksDir, "sms-response-handler.js");
|
|
334
|
+
execSync(`mkdir -p "${hooksDir}"`, { stdio: "inherit" });
|
|
335
|
+
execSync(`cp "${hookSrc}" "${hookDest}"`, { stdio: "inherit" });
|
|
336
|
+
execSync(`chmod +x "${hookDest}"`, { stdio: "inherit" });
|
|
337
|
+
console.log(chalk.green("Response handler hook installed!"));
|
|
338
|
+
console.log(chalk.gray(`Location: ${hookDest}`));
|
|
339
|
+
console.log();
|
|
340
|
+
console.log(chalk.blue("Add to ~/.claude/settings.json:"));
|
|
341
|
+
console.log(
|
|
342
|
+
chalk.gray(` "hooks": { "pre_tool_use": ["node ${hookDest}"] }`)
|
|
343
|
+
);
|
|
344
|
+
} catch {
|
|
345
|
+
console.error(chalk.red("Failed to install response hook"));
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
cmd.command("webhook").description("Start SMS webhook server for receiving responses").option("-p, --port <port>", "Port to listen on", "3456").action(async (options) => {
|
|
349
|
+
const { startWebhookServer } = await import("../../hooks/sms-webhook.js");
|
|
350
|
+
const port = parseInt(options.port, 10);
|
|
351
|
+
startWebhookServer(port);
|
|
352
|
+
});
|
|
353
|
+
return cmd;
|
|
354
|
+
}
|
|
355
|
+
function maskPhone(phone) {
|
|
356
|
+
if (phone.length < 8) return phone;
|
|
357
|
+
return phone.substring(0, 4) + "****" + phone.substring(phone.length - 2);
|
|
358
|
+
}
|
|
359
|
+
export {
|
|
360
|
+
createSMSNotifyCommand
|
|
361
|
+
};
|
|
362
|
+
//# sourceMappingURL=sms-notify.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/cli/commands/sms-notify.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * CLI command for SMS notification management\n */\n\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport { execSync } from 'child_process';\nimport { join } from 'path';\nimport {\n loadSMSConfig,\n saveSMSConfig,\n sendSMSNotification,\n notifyReviewReady,\n notifyWithYesNo,\n notifyTaskComplete,\n cleanupExpiredPrompts,\n} from '../../hooks/sms-notify.js';\nimport {\n loadActionQueue,\n processAllPendingActions,\n cleanupOldActions,\n startActionWatcher,\n} from '../../hooks/sms-action-runner.js';\n\n// __dirname provided by esbuild banner\n\nexport function createSMSNotifyCommand(): Command {\n const cmd = new Command('notify')\n .description(\n 'SMS notification system for review alerts (optional, requires Twilio)'\n )\n .addHelpText(\n 'after',\n `\nSetup (optional):\n 1. Create Twilio account at https://twilio.com\n 2. Get Account SID, Auth Token, and phone number\n 3. Set environment variables:\n export TWILIO_ACCOUNT_SID=your_sid\n export TWILIO_AUTH_TOKEN=your_token\n export TWILIO_FROM_NUMBER=+1234567890\n export TWILIO_TO_NUMBER=+1234567890\n 4. Enable: stackmemory notify enable\n\nExamples:\n stackmemory notify status Check configuration\n stackmemory notify enable Enable notifications\n stackmemory notify test Send test message\n stackmemory notify send \"PR ready\" Send custom message\n stackmemory notify review \"PR #123\" Send review notification with options\n stackmemory notify ask \"Deploy?\" Send yes/no prompt\n`\n );\n\n cmd\n .command('status')\n .description('Show notification configuration status')\n .action(() => {\n const config = loadSMSConfig();\n\n console.log(chalk.blue('SMS Notification Status:'));\n console.log();\n\n // Check if configured\n const hasCreds =\n config.accountSid &&\n config.authToken &&\n config.fromNumber &&\n config.toNumber;\n\n console.log(\n ` ${chalk.gray('Enabled:')} ${config.enabled ? chalk.green('yes') : chalk.red('no')}`\n );\n console.log(\n ` ${chalk.gray('Configured:')} ${hasCreds ? chalk.green('yes') : chalk.yellow('no (set env vars)')}`\n );\n\n if (config.fromNumber) {\n console.log(` ${chalk.gray('From:')} ${maskPhone(config.fromNumber)}`);\n }\n if (config.toNumber) {\n console.log(` ${chalk.gray('To:')} ${maskPhone(config.toNumber)}`);\n }\n\n console.log();\n console.log(chalk.blue('Notify On:'));\n console.log(\n ` ${chalk.gray('Task Complete:')} ${config.notifyOn.taskComplete ? 'yes' : 'no'}`\n );\n console.log(\n ` ${chalk.gray('Review Ready:')} ${config.notifyOn.reviewReady ? 'yes' : 'no'}`\n );\n console.log(\n ` ${chalk.gray('Errors:')} ${config.notifyOn.error ? 'yes' : 'no'}`\n );\n\n if (config.quietHours?.enabled) {\n console.log();\n console.log(\n chalk.blue(\n `Quiet Hours: ${config.quietHours.start} - ${config.quietHours.end}`\n )\n );\n }\n\n console.log();\n console.log(\n ` ${chalk.gray('Pending Prompts:')} ${config.pendingPrompts.length}`\n );\n console.log(\n ` ${chalk.gray('Response Timeout:')} ${config.responseTimeout}s`\n );\n\n if (!hasCreds) {\n console.log();\n console.log(\n chalk.yellow('To configure, set these environment variables:')\n );\n console.log(chalk.gray(' export TWILIO_ACCOUNT_SID=your_sid'));\n console.log(chalk.gray(' export TWILIO_AUTH_TOKEN=your_token'));\n console.log(chalk.gray(' export TWILIO_FROM_NUMBER=+1234567890'));\n console.log(chalk.gray(' export TWILIO_TO_NUMBER=+1234567890'));\n }\n });\n\n cmd\n .command('enable')\n .description('Enable SMS notifications')\n .action(() => {\n const config = loadSMSConfig();\n config.enabled = true;\n saveSMSConfig(config);\n console.log(chalk.green('SMS notifications enabled'));\n\n const hasCreds =\n config.accountSid &&\n config.authToken &&\n config.fromNumber &&\n config.toNumber;\n if (!hasCreds) {\n console.log(\n chalk.yellow(\n 'Note: Set Twilio environment variables to send messages'\n )\n );\n }\n });\n\n cmd\n .command('disable')\n .description('Disable SMS notifications')\n .action(() => {\n const config = loadSMSConfig();\n config.enabled = false;\n saveSMSConfig(config);\n console.log(chalk.yellow('SMS notifications disabled'));\n });\n\n cmd\n .command('test')\n .description('Send a test notification')\n .action(async () => {\n console.log(chalk.blue('Sending test notification...'));\n\n const result = await sendSMSNotification({\n type: 'custom',\n title: 'StackMemory Test',\n message: 'This is a test notification from StackMemory.',\n });\n\n if (result.success) {\n console.log(chalk.green('Test message sent successfully!'));\n } else {\n console.log(chalk.red(`Failed: ${result.error}`));\n }\n });\n\n cmd\n .command('send <message>')\n .description('Send a custom notification')\n .option('-t, --title <title>', 'Message title', 'StackMemory Alert')\n .action(async (message: string, options: { title: string }) => {\n const result = await sendSMSNotification({\n type: 'custom',\n title: options.title,\n message,\n });\n\n if (result.success) {\n console.log(chalk.green('Message sent!'));\n } else {\n console.log(chalk.red(`Failed: ${result.error}`));\n }\n });\n\n cmd\n .command('review <title>')\n .description('Send review-ready notification with options')\n .option('-m, --message <msg>', 'Description', 'Ready for your review')\n .option(\n '-o, --options <opts>',\n 'Comma-separated options',\n 'Approve,Request Changes,Skip'\n )\n .action(\n async (title: string, options: { message: string; options: string }) => {\n const opts = options.options.split(',').map((o) => ({\n label: o.trim(),\n }));\n\n console.log(chalk.blue('Sending review notification...'));\n\n const result = await notifyReviewReady(title, options.message, opts);\n\n if (result.success) {\n console.log(chalk.green('Review notification sent!'));\n if (result.promptId) {\n console.log(chalk.gray(`Prompt ID: ${result.promptId}`));\n }\n } else {\n console.log(chalk.red(`Failed: ${result.error}`));\n }\n }\n );\n\n cmd\n .command('ask <question>')\n .description('Send a yes/no prompt')\n .option('-t, --title <title>', 'Message title', 'StackMemory')\n .action(async (question: string, options: { title: string }) => {\n console.log(chalk.blue('Sending yes/no prompt...'));\n\n const result = await notifyWithYesNo(options.title, question);\n\n if (result.success) {\n console.log(chalk.green('Prompt sent!'));\n if (result.promptId) {\n console.log(chalk.gray(`Prompt ID: ${result.promptId}`));\n }\n } else {\n console.log(chalk.red(`Failed: ${result.error}`));\n }\n });\n\n cmd\n .command('complete <task>')\n .description('Send task completion notification')\n .option('-s, --summary <text>', 'Task summary', '')\n .action(async (task: string, options: { summary: string }) => {\n const result = await notifyTaskComplete(\n task,\n options.summary || `Task \"${task}\" has been completed.`\n );\n\n if (result.success) {\n console.log(chalk.green('Completion notification sent!'));\n } else {\n console.log(chalk.red(`Failed: ${result.error}`));\n }\n });\n\n cmd\n .command('quiet')\n .description('Configure quiet hours')\n .option('--enable', 'Enable quiet hours')\n .option('--disable', 'Disable quiet hours')\n .option('--start <time>', 'Start time (HH:MM)', '22:00')\n .option('--end <time>', 'End time (HH:MM)', '08:00')\n .action(\n (options: {\n enable?: boolean;\n disable?: boolean;\n start: string;\n end: string;\n }) => {\n const config = loadSMSConfig();\n\n if (!config.quietHours) {\n config.quietHours = { enabled: false, start: '22:00', end: '08:00' };\n }\n\n if (options.enable) {\n config.quietHours.enabled = true;\n } else if (options.disable) {\n config.quietHours.enabled = false;\n }\n\n if (options.start) {\n config.quietHours.start = options.start;\n }\n if (options.end) {\n config.quietHours.end = options.end;\n }\n\n saveSMSConfig(config);\n\n if (config.quietHours.enabled) {\n console.log(\n chalk.green(\n `Quiet hours enabled: ${config.quietHours.start} - ${config.quietHours.end}`\n )\n );\n } else {\n console.log(chalk.yellow('Quiet hours disabled'));\n }\n }\n );\n\n cmd\n .command('toggle <type>')\n .description(\n 'Toggle notification type (taskComplete|reviewReady|error|custom)'\n )\n .action((type: string) => {\n const config = loadSMSConfig();\n const validTypes = ['taskComplete', 'reviewReady', 'error', 'custom'];\n\n if (!validTypes.includes(type)) {\n console.log(chalk.red(`Invalid type. Use: ${validTypes.join(', ')}`));\n return;\n }\n\n const key = type as keyof typeof config.notifyOn;\n config.notifyOn[key] = !config.notifyOn[key];\n saveSMSConfig(config);\n\n console.log(\n chalk.green(\n `${type} notifications ${config.notifyOn[key] ? 'enabled' : 'disabled'}`\n )\n );\n });\n\n cmd\n .command('pending')\n .description('List pending prompts awaiting response')\n .action(() => {\n const config = loadSMSConfig();\n\n if (config.pendingPrompts.length === 0) {\n console.log(chalk.gray('No pending prompts'));\n return;\n }\n\n console.log(chalk.blue('Pending Prompts:'));\n config.pendingPrompts.forEach((p) => {\n const expires = new Date(p.expiresAt);\n const remaining = Math.round((expires.getTime() - Date.now()) / 1000);\n\n console.log();\n console.log(` ${chalk.gray('ID:')} ${p.id}`);\n console.log(` ${chalk.gray('Type:')} ${p.type}`);\n console.log(\n ` ${chalk.gray('Message:')} ${p.message.substring(0, 50)}...`\n );\n console.log(\n ` ${chalk.gray('Expires:')} ${remaining > 0 ? `${remaining}s` : chalk.red('expired')}`\n );\n });\n });\n\n cmd\n .command('cleanup')\n .description('Remove expired pending prompts')\n .action(() => {\n const removed = cleanupExpiredPrompts();\n console.log(chalk.green(`Removed ${removed} expired prompt(s)`));\n });\n\n cmd\n .command('timeout <seconds>')\n .description('Set response timeout for prompts')\n .action((seconds: string) => {\n const config = loadSMSConfig();\n const timeout = parseInt(seconds, 10);\n\n if (isNaN(timeout) || timeout < 30) {\n console.log(chalk.red('Timeout must be at least 30 seconds'));\n return;\n }\n\n config.responseTimeout = timeout;\n saveSMSConfig(config);\n console.log(chalk.green(`Response timeout set to ${timeout} seconds`));\n });\n\n // Action queue commands\n cmd\n .command('actions')\n .description('List queued actions from SMS responses')\n .action(() => {\n const queue = loadActionQueue();\n\n if (queue.actions.length === 0) {\n console.log(chalk.gray('No actions in queue'));\n return;\n }\n\n console.log(chalk.blue('Action Queue:'));\n queue.actions.forEach((a) => {\n const statusColor =\n a.status === 'completed'\n ? chalk.green\n : a.status === 'failed'\n ? chalk.red\n : a.status === 'running'\n ? chalk.yellow\n : chalk.gray;\n\n console.log();\n console.log(` ${chalk.gray('ID:')} ${a.id}`);\n console.log(` ${chalk.gray('Status:')} ${statusColor(a.status)}`);\n console.log(\n ` ${chalk.gray('Action:')} ${a.action.substring(0, 60)}...`\n );\n console.log(` ${chalk.gray('Response:')} ${a.response}`);\n if (a.error) {\n console.log(` ${chalk.gray('Error:')} ${chalk.red(a.error)}`);\n }\n });\n });\n\n cmd\n .command('run-actions')\n .description('Execute all pending actions from SMS responses')\n .action(() => {\n console.log(chalk.blue('Processing pending actions...'));\n const result = processAllPendingActions();\n\n console.log(\n chalk.green(\n `Processed ${result.processed} action(s): ${result.succeeded} succeeded, ${result.failed} failed`\n )\n );\n });\n\n cmd\n .command('watch')\n .description('Watch for and execute SMS response actions')\n .option('-i, --interval <ms>', 'Check interval in milliseconds', '5000')\n .action((options: { interval: string }) => {\n const interval = parseInt(options.interval, 10);\n console.log(chalk.blue(`Watching for actions (interval: ${interval}ms)`));\n console.log(chalk.gray('Press Ctrl+C to stop'));\n\n startActionWatcher(interval);\n });\n\n cmd\n .command('cleanup-actions')\n .description('Remove old completed actions')\n .action(() => {\n const removed = cleanupOldActions();\n console.log(chalk.green(`Removed ${removed} old action(s)`));\n });\n\n // Hook installation commands\n cmd\n .command('install-hook')\n .description('Install Claude Code notification hook')\n .action(() => {\n try {\n const scriptPath = join(\n __dirname,\n '../../../scripts/install-notify-hook.sh'\n );\n execSync(`bash \"${scriptPath}\"`, { stdio: 'inherit' });\n } catch {\n console.error(chalk.red('Failed to install hook'));\n }\n });\n\n cmd\n .command('install-response-hook')\n .description('Install Claude Code response handler hook')\n .action(() => {\n try {\n // Create install script inline\n const hooksDir = join(process.env['HOME'] || '~', '.claude', 'hooks');\n const hookSrc = join(\n __dirname,\n '../../../templates/claude-hooks/sms-response-handler.js'\n );\n const hookDest = join(hooksDir, 'sms-response-handler.js');\n\n execSync(`mkdir -p \"${hooksDir}\"`, { stdio: 'inherit' });\n execSync(`cp \"${hookSrc}\" \"${hookDest}\"`, { stdio: 'inherit' });\n execSync(`chmod +x \"${hookDest}\"`, { stdio: 'inherit' });\n\n console.log(chalk.green('Response handler hook installed!'));\n console.log(chalk.gray(`Location: ${hookDest}`));\n console.log();\n console.log(chalk.blue('Add to ~/.claude/settings.json:'));\n console.log(\n chalk.gray(` \"hooks\": { \"pre_tool_use\": [\"node ${hookDest}\"] }`)\n );\n } catch {\n console.error(chalk.red('Failed to install response hook'));\n }\n });\n\n cmd\n .command('webhook')\n .description('Start SMS webhook server for receiving responses')\n .option('-p, --port <port>', 'Port to listen on', '3456')\n .action(async (options: { port: string }) => {\n const { startWebhookServer } = await import('../../hooks/sms-webhook.js');\n const port = parseInt(options.port, 10);\n startWebhookServer(port);\n });\n\n return cmd;\n}\n\nfunction maskPhone(phone: string): string {\n if (phone.length < 8) return phone;\n return phone.substring(0, 4) + '****' + phone.substring(phone.length - 2);\n}\n"],
|
|
5
|
+
"mappings": ";;;;AAIA,SAAS,eAAe;AACxB,OAAO,WAAW;AAClB,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAIA,SAAS,yBAAkC;AAChD,QAAM,MAAM,IAAI,QAAQ,QAAQ,EAC7B;AAAA,IACC;AAAA,EACF,EACC;AAAA,IACC;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBF;AAEF,MACG,QAAQ,QAAQ,EAChB,YAAY,wCAAwC,EACpD,OAAO,MAAM;AACZ,UAAM,SAAS,cAAc;AAE7B,YAAQ,IAAI,MAAM,KAAK,0BAA0B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AA,IAC5D;AAAA,EACF,CAAC;AAEH,MACG,QAAQ,SAAS,EACjB,YAAY,kDAAkD,EAC9D,OAAO,qBAAqB,qBAAqB,MAAM,EACvD,OAAO,OAAO,YAA8B;AAC3C,UAAM,EAAE,mBAAmB,IAAI,MAAM,OAAO,4BAA4B;AACxE,UAAM,OAAO,SAAS,QAAQ,MAAM,EAAE;AACtC,uBAAmB,IAAI;AAAA,EACzB,CAAC;AAEH,SAAO;AACT;AAEA,SAAS,UAAU,OAAuB;AACxC,MAAI,MAAM,SAAS,EAAG,QAAO;AAC7B,SAAO,MAAM,UAAU,GAAG,CAAC,IAAI,SAAS,MAAM,UAAU,MAAM,SAAS,CAAC;AAC1E;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/cli/index.js
CHANGED
|
@@ -47,6 +47,7 @@ import { createShellCommand } from "./commands/shell.js";
|
|
|
47
47
|
import { createAPICommand } from "./commands/api.js";
|
|
48
48
|
import { createCleanupProcessesCommand } from "./commands/cleanup-processes.js";
|
|
49
49
|
import { createAutoBackgroundCommand } from "./commands/auto-background.js";
|
|
50
|
+
import { createSMSNotifyCommand } from "./commands/sms-notify.js";
|
|
50
51
|
import { ProjectManager } from "../core/projects/project-manager.js";
|
|
51
52
|
import Database from "better-sqlite3";
|
|
52
53
|
import { join } from "path";
|
|
@@ -439,6 +440,7 @@ program.addCommand(createShellCommand());
|
|
|
439
440
|
program.addCommand(createAPICommand());
|
|
440
441
|
program.addCommand(createCleanupProcessesCommand());
|
|
441
442
|
program.addCommand(createAutoBackgroundCommand());
|
|
443
|
+
program.addCommand(createSMSNotifyCommand());
|
|
442
444
|
program.command("dashboard").description("Display monitoring dashboard in terminal").option("-w, --watch", "Auto-refresh dashboard").option("-i, --interval <seconds>", "Refresh interval in seconds", "5").action(async (options) => {
|
|
443
445
|
const { dashboardCommand } = await import("./commands/dashboard.js");
|
|
444
446
|
await dashboardCommand.handler(options);
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/cli/index.ts"],
|
|
4
|
-
"sourcesContent": ["#!/usr/bin/env node\n/**\n * StackMemory CLI\n * Command-line interface for StackMemory operations\n */\n\n// Set environment flag for CLI usage to skip async context bridge\nprocess.env['STACKMEMORY_CLI'] = 'true';\n\n// Load environment variables\nimport 'dotenv/config';\n\n// Initialize tracing system early\nimport { initializeTracing, trace } from '../core/trace/index.js';\ninitializeTracing();\n\nimport { program } from 'commander';\nimport { logger } from '../core/monitoring/logger.js';\nimport { FrameManager } from '../core/context/frame-manager.js';\nimport { sessionManager, FrameQueryMode } from '../core/session/index.js';\nimport { sharedContextLayer } from '../core/context/shared-context-layer.js';\nimport { UpdateChecker } from '../core/utils/update-checker.js';\nimport { ProgressTracker } from '../core/monitoring/progress-tracker.js';\nimport { registerProjectCommands } from './commands/projects.js';\nimport { registerLinearCommands } from './commands/linear.js';\nimport { createSessionCommands } from './commands/session.js';\nimport { registerWorktreeCommands } from './commands/worktree.js';\nimport { registerOnboardingCommand } from './commands/onboard.js';\nimport { createTaskCommands } from './commands/tasks.js';\nimport { createSearchCommand } from './commands/search.js';\nimport { createLogCommand } from './commands/log.js';\nimport { createContextCommands } from './commands/context.js';\nimport { createConfigCommand } from './commands/config.js';\nimport { createHandoffCommand } from './commands/handoff.js';\nimport {\n createDecisionCommand,\n createMemoryCommand,\n} from './commands/decision.js';\nimport { createStorageCommand } from './commands/storage.js';\nimport { createSkillsCommand } from './commands/skills.js';\nimport { createTestCommand } from './commands/test.js';\nimport clearCommand from './commands/clear.js';\nimport createWorkflowCommand from './commands/workflow.js';\nimport monitorCommand from './commands/monitor.js';\nimport qualityCommand from './commands/quality.js';\nimport createRalphCommand from './commands/ralph.js';\nimport serviceCommand from './commands/service.js';\nimport { registerLoginCommand } from './commands/login.js';\nimport { registerSignupCommand } from './commands/signup.js';\nimport { registerLogoutCommand, registerDbCommands } from './commands/db.js';\nimport { createSweepCommand } from './commands/sweep.js';\nimport { createHooksCommand } from './commands/hooks.js';\nimport { createShellCommand } from './commands/shell.js';\nimport { createAPICommand } from './commands/api.js';\nimport { createCleanupProcessesCommand } from './commands/cleanup-processes.js';\nimport { createAutoBackgroundCommand } from './commands/auto-background.js';\nimport { ProjectManager } from '../core/projects/project-manager.js';\nimport Database from 'better-sqlite3';\nimport { join } from 'path';\nimport { existsSync, mkdirSync } from 'fs';\nimport inquirer from 'inquirer';\nimport chalk from 'chalk';\nimport {\n loadStorageConfig,\n enableChromaDB,\n getStorageModeDescription,\n} from '../core/config/storage-config.js';\n\nconst VERSION = '0.5.5';\n\n// Check for updates on CLI startup\nUpdateChecker.checkForUpdates(VERSION, true).catch(() => {\n // Silently ignore errors\n});\n\nprogram\n .name('stackmemory')\n .description(\n 'Lossless memory runtime for AI coding tools - organizes context as a call stack instead of linear chat logs, with team collaboration and infinite retention'\n )\n .version(VERSION);\n\nprogram\n .command('init')\n .description(\n `Initialize StackMemory in current project\n\nStorage Modes:\n SQLite (default): Local only, fast, no setup required\n ChromaDB (hybrid): Adds semantic search and cloud backup, requires API key`\n )\n .option('--sqlite', 'Use SQLite-only storage (default, skip prompts)')\n .option(\n '--chromadb',\n 'Enable ChromaDB for semantic search (prompts for API key)'\n )\n .option('--skip-storage-prompt', 'Skip storage configuration prompt')\n .action(async (options) => {\n try {\n const projectRoot = process.cwd();\n const dbDir = join(projectRoot, '.stackmemory');\n\n if (!existsSync(dbDir)) {\n mkdirSync(dbDir, { recursive: true });\n }\n\n // Handle storage configuration\n let storageConfig = loadStorageConfig();\n const isFirstTimeSetup =\n !storageConfig.chromadb.enabled && storageConfig.mode === 'sqlite';\n\n // Skip prompts if --sqlite flag or --skip-storage-prompt\n if (options.sqlite || options.skipStoragePrompt) {\n // Use SQLite-only (default)\n console.log(chalk.gray('Using SQLite-only storage mode.'));\n } else if (options.chromadb) {\n // User explicitly requested ChromaDB, prompt for API key\n await promptAndEnableChromaDB();\n } else if (isFirstTimeSetup && process.stdin.isTTY) {\n // Interactive mode - ask user about ChromaDB\n console.log(chalk.cyan('\\nStorage Configuration'));\n console.log(chalk.gray('StackMemory supports two storage modes:\\n'));\n console.log(chalk.white(' SQLite (default):'));\n console.log(chalk.gray(' - Local storage only'));\n console.log(chalk.gray(' - Fast and simple'));\n console.log(chalk.gray(' - No external dependencies\\n'));\n console.log(chalk.white(' ChromaDB (hybrid):'));\n console.log(chalk.gray(' - Semantic search across your context'));\n console.log(chalk.gray(' - Cloud backup capability'));\n console.log(chalk.gray(' - Requires ChromaDB API key\\n'));\n\n const { enableChroma } = await inquirer.prompt([\n {\n type: 'confirm',\n name: 'enableChroma',\n message: 'Enable ChromaDB for semantic search? (requires API key)',\n default: false,\n },\n ]);\n\n if (enableChroma) {\n await promptAndEnableChromaDB();\n } else {\n console.log(chalk.gray('Using SQLite-only storage mode.'));\n }\n }\n\n // Initialize SQLite database\n const dbPath = join(dbDir, 'context.db');\n const db = new Database(dbPath);\n new FrameManager(db, 'cli-project');\n\n logger.info('StackMemory initialized successfully', { projectRoot });\n console.log(\n chalk.green('\\n[OK] StackMemory initialized in'),\n projectRoot\n );\n\n // Show current storage mode\n storageConfig = loadStorageConfig();\n console.log(chalk.gray(`Storage mode: ${getStorageModeDescription()}`));\n\n db.close();\n } catch (error: unknown) {\n logger.error('Failed to initialize StackMemory', error as Error);\n console.error(\n chalk.red('[ERROR] Initialization failed:'),\n (error as Error).message\n );\n process.exit(1);\n }\n });\n\n/**\n * Prompt user for ChromaDB configuration and enable it\n */\nasync function promptAndEnableChromaDB(): Promise<void> {\n const answers = await inquirer.prompt([\n {\n type: 'password',\n name: 'apiKey',\n message: 'Enter your ChromaDB API key:',\n validate: (input: string) => {\n if (!input || input.trim().length === 0) {\n return 'API key is required for ChromaDB';\n }\n return true;\n },\n },\n {\n type: 'input',\n name: 'apiUrl',\n message: 'ChromaDB API URL (press Enter for default):',\n default: 'https://api.trychroma.com',\n },\n ]);\n\n enableChromaDB({\n apiKey: answers.apiKey,\n apiUrl: answers.apiUrl,\n });\n\n console.log(chalk.green('[OK] ChromaDB enabled for semantic search.'));\n console.log(\n chalk.gray('API key saved to ~/.stackmemory/storage-config.json')\n );\n}\n\nprogram\n .command('status')\n .description('Show current StackMemory status')\n .option('--all', 'Show all active frames across sessions')\n .option('--project', 'Show all active frames in current project')\n .option('--session <id>', 'Show frames for specific session')\n .action(async (options) => {\n return trace.command('stackmemory-status', options, async () => {\n try {\n const projectRoot = process.cwd();\n const dbPath = join(projectRoot, '.stackmemory', 'context.db');\n\n if (!existsSync(dbPath)) {\n console.log(\n '\u274C StackMemory not initialized. Run \"stackmemory init\" first.'\n );\n return;\n }\n\n // Check for updates and display if available\n await UpdateChecker.checkForUpdates(VERSION);\n\n // Initialize session manager and shared context\n await sessionManager.initialize();\n await sharedContextLayer.initialize();\n\n const session = await sessionManager.getOrCreateSession({\n projectPath: projectRoot,\n sessionId: options.session,\n });\n\n // Auto-discover shared context on startup\n const contextDiscovery = await sharedContextLayer.autoDiscoverContext();\n\n // Show context hints if available\n if (\n contextDiscovery.hasSharedContext &&\n contextDiscovery.sessionCount > 1\n ) {\n console.log(`\\n\uD83D\uDCA1 Shared Context Available:`);\n console.log(\n ` ${contextDiscovery.sessionCount} sessions with shared context`\n );\n\n if (contextDiscovery.recentPatterns.length > 0) {\n console.log(` Recent patterns:`);\n contextDiscovery.recentPatterns.slice(0, 3).forEach((p) => {\n console.log(\n ` \u2022 ${p.type}: ${p.pattern.slice(0, 50)} (${p.frequency}x)`\n );\n });\n }\n\n if (contextDiscovery.lastDecisions.length > 0) {\n console.log(\n ` Last decision: ${contextDiscovery.lastDecisions[0].decision.slice(0, 60)}`\n );\n }\n }\n\n const db = new Database(dbPath);\n const frameManager = new FrameManager(db, session.projectId);\n\n // Set query mode based on options\n if (options.all) {\n frameManager.setQueryMode(FrameQueryMode.ALL_ACTIVE);\n } else if (options.project) {\n frameManager.setQueryMode(FrameQueryMode.PROJECT_ACTIVE);\n }\n\n const activeFrames = frameManager.getActiveFramePath();\n const stackDepth = frameManager.getStackDepth();\n\n // Always get total counts across all sessions\n const totalStats = db\n .prepare(\n `\n SELECT \n COUNT(*) as total_frames,\n SUM(CASE WHEN state = 'active' THEN 1 ELSE 0 END) as active_frames,\n SUM(CASE WHEN state = 'closed' THEN 1 ELSE 0 END) as closed_frames,\n COUNT(DISTINCT run_id) as total_sessions\n FROM frames\n WHERE project_id = ?\n `\n )\n .get(session.projectId) as {\n total_frames: number;\n active_frames: number;\n closed_frames: number;\n total_sessions: number;\n };\n\n const contextCount = db\n .prepare(\n `\n SELECT COUNT(*) as count FROM contexts\n `\n )\n .get() as { count: number };\n\n const eventCount = db\n .prepare(\n `\n SELECT COUNT(*) as count FROM events e\n JOIN frames f ON e.frame_id = f.frame_id\n WHERE f.project_id = ?\n `\n )\n .get(session.projectId) as { count: number };\n\n console.log('\uD83D\uDCCA StackMemory Status:');\n console.log(\n ` Session: ${session.sessionId.slice(0, 8)} (${session.state}, ${Math.round((Date.now() - session.startedAt) / 1000 / 60)}min old)`\n );\n console.log(` Project: ${session.projectId}`);\n if (session.branch) {\n console.log(` Branch: ${session.branch}`);\n }\n\n // Show total database statistics\n console.log(`\\n Database Statistics (this project):`);\n console.log(\n ` Frames: ${totalStats.total_frames || 0} (${totalStats.active_frames || 0} active, ${totalStats.closed_frames || 0} closed)`\n );\n console.log(` Events: ${eventCount.count || 0}`);\n console.log(` Sessions: ${totalStats.total_sessions || 0}`);\n console.log(\n ` Cached contexts: ${contextCount.count || 0} (global)`\n );\n\n // Show recent activity\n const recentFrames = db\n .prepare(\n `\n SELECT name, type, state, datetime(created_at, 'unixepoch') as created\n FROM frames\n WHERE project_id = ?\n ORDER BY created_at DESC\n LIMIT 3\n `\n )\n .all(session.projectId) as Array<{\n name: string;\n type: string;\n state: string;\n created: string;\n }>;\n\n if (recentFrames.length > 0) {\n console.log(`\\n Recent Activity:`);\n recentFrames.forEach((f) => {\n const stateIcon = f.state === 'active' ? '\uD83D\uDFE2' : '\u26AB';\n console.log(\n ` ${stateIcon} ${f.name} [${f.type}] - ${f.created}`\n );\n });\n }\n\n console.log(`\\n Current Session:`);\n console.log(` Stack depth: ${stackDepth}`);\n console.log(` Active frames: ${activeFrames.length}`);\n\n if (activeFrames.length > 0) {\n activeFrames.forEach((frame, i) => {\n const indent = ' ' + ' '.repeat(frame.depth || i);\n const prefix = i === 0 ? '\u2514\u2500' : ' \u2514\u2500';\n console.log(`${indent}${prefix} ${frame.name} [${frame.type}]`);\n });\n }\n\n // Show other sessions if in default mode\n if (!options.all && !options.project) {\n const otherSessions = await sessionManager.listSessions({\n projectId: session.projectId,\n state: 'active',\n });\n\n const otherActive = otherSessions.filter(\n (s) => s.sessionId !== session.sessionId\n );\n if (otherActive.length > 0) {\n console.log(`\\n Other Active Sessions (same project):`);\n otherActive.forEach((s) => {\n const age = Math.round(\n (Date.now() - s.lastActiveAt) / 1000 / 60 / 60\n );\n console.log(\n ` - ${s.sessionId.slice(0, 8)}: ${s.branch || 'main'}, ${age}h old`\n );\n });\n console.log(`\\n Tip: Use --all to see frames across sessions`);\n }\n }\n\n db.close();\n } catch (error: unknown) {\n logger.error('Failed to get status', error as Error);\n console.error('\u274C Status check failed:', (error as Error).message);\n process.exit(1);\n }\n });\n });\n\nprogram\n .command('update-check')\n .description('Check for StackMemory updates')\n .action(async () => {\n try {\n console.log('\uD83D\uDD0D Checking for updates...');\n await UpdateChecker.forceCheck(VERSION);\n } catch (error: unknown) {\n logger.error('Update check failed', error as Error);\n console.error('\u274C Update check failed:', (error as Error).message);\n process.exit(1);\n }\n });\n\nprogram\n .command('progress')\n .description('Show current progress and recent changes')\n .action(async () => {\n try {\n const projectRoot = process.cwd();\n const dbPath = join(projectRoot, '.stackmemory', 'context.db');\n\n if (!existsSync(dbPath)) {\n console.log(\n '\u274C StackMemory not initialized. Run \"stackmemory init\" first.'\n );\n return;\n }\n\n const progress = new ProgressTracker(projectRoot);\n console.log(progress.getSummary());\n } catch (error: unknown) {\n logger.error('Failed to show progress', error as Error);\n console.error('\u274C Failed to show progress:', (error as Error).message);\n process.exit(1);\n }\n });\n\nprogram\n .command('mcp-server')\n .description('Start StackMemory MCP server for Claude Desktop')\n .option('-p, --project <path>', 'Project root directory', process.cwd())\n .action(async (options) => {\n try {\n const { runMCPServer } = await import('../integrations/mcp/server.js');\n\n // Set project root\n process.env['PROJECT_ROOT'] = options.project;\n\n console.log('\uD83D\uDE80 Starting StackMemory MCP Server...');\n console.log(` Project: ${options.project}`);\n console.log(` Version: ${VERSION}`);\n\n // Check for updates silently\n UpdateChecker.checkForUpdates(VERSION, true).catch(() => {});\n\n // Start the MCP server\n await runMCPServer();\n } catch (error: unknown) {\n logger.error('Failed to start MCP server', error as Error);\n console.error('\u274C MCP server failed:', (error as Error).message);\n process.exit(1);\n }\n });\n\n// Add test context command\nprogram\n .command('context:test')\n .description('Test context persistence by creating sample frames')\n .action(async () => {\n try {\n const projectRoot = process.cwd();\n const dbPath = join(projectRoot, '.stackmemory', 'context.db');\n\n if (!existsSync(dbPath)) {\n console.log(\n '\u274C StackMemory not initialized. Run \"stackmemory init\" first.'\n );\n return;\n }\n\n const db = new Database(dbPath);\n const frameManager = new FrameManager(db, 'cli-project');\n\n // Create test frames\n console.log('\uD83D\uDCDD Creating test context frames...');\n\n const rootFrame = frameManager.createFrame({\n type: 'task',\n name: 'Test Session',\n inputs: { test: true, timestamp: new Date().toISOString() },\n });\n\n const taskFrame = frameManager.createFrame({\n type: 'subtask',\n name: 'Sample Task',\n inputs: { description: 'Testing context persistence' },\n parentFrameId: rootFrame,\n });\n\n const commandFrame = frameManager.createFrame({\n type: 'tool_scope',\n name: 'test-command',\n inputs: { args: ['--test'] },\n parentFrameId: taskFrame,\n });\n\n // Add some events\n frameManager.addEvent(\n 'observation',\n {\n message: 'Test event recorded',\n },\n commandFrame\n );\n\n console.log('\u2705 Test frames created!');\n console.log(`\uD83D\uDCCA Stack depth: ${frameManager.getStackDepth()}`);\n console.log(\n `\uD83D\uDD04 Active frames: ${frameManager.getActiveFramePath().length}`\n );\n\n // Close one frame to test state changes\n frameManager.closeFrame(commandFrame);\n console.log(\n `\uD83D\uDCCA After closing command frame: depth = ${frameManager.getStackDepth()}`\n );\n\n db.close();\n } catch (error: unknown) {\n logger.error('Test context failed', error as Error);\n console.error('\u274C Test failed:', (error as Error).message);\n process.exit(1);\n }\n });\n\n// Register project management commands\n// Register command modules\nregisterOnboardingCommand(program);\nregisterSignupCommand(program);\nregisterLoginCommand(program);\nregisterLogoutCommand(program);\nregisterDbCommands(program);\nregisterProjectCommands(program);\nregisterWorktreeCommands(program);\n\n// Register Linear integration commands\nregisterLinearCommands(program);\n\n// Register session management commands\nprogram.addCommand(createSessionCommands());\n\n// Register enhanced CLI commands\nprogram.addCommand(createTaskCommands());\nprogram.addCommand(createSearchCommand());\nprogram.addCommand(createLogCommand());\nprogram.addCommand(createContextCommands());\nprogram.addCommand(createConfigCommand());\nprogram.addCommand(createHandoffCommand());\nprogram.addCommand(createDecisionCommand());\nprogram.addCommand(createMemoryCommand());\nprogram.addCommand(createStorageCommand());\nprogram.addCommand(createSkillsCommand());\nprogram.addCommand(createTestCommand());\nprogram.addCommand(clearCommand);\nprogram.addCommand(createWorkflowCommand());\nprogram.addCommand(monitorCommand);\nprogram.addCommand(qualityCommand);\nprogram.addCommand(createRalphCommand());\nprogram.addCommand(serviceCommand);\nprogram.addCommand(createSweepCommand());\nprogram.addCommand(createHooksCommand());\nprogram.addCommand(createShellCommand());\nprogram.addCommand(createAPICommand());\nprogram.addCommand(createCleanupProcessesCommand());\nprogram.addCommand(createAutoBackgroundCommand());\n\n// Register dashboard command\nprogram\n .command('dashboard')\n .description('Display monitoring dashboard in terminal')\n .option('-w, --watch', 'Auto-refresh dashboard')\n .option('-i, --interval <seconds>', 'Refresh interval in seconds', '5')\n .action(async (options) => {\n const { dashboardCommand } = await import('./commands/dashboard.js');\n await dashboardCommand.handler(options);\n });\n\n// Auto-detect current project on startup\nif (process.argv.length > 2) {\n const manager = ProjectManager.getInstance();\n manager.detectProject().catch(() => {\n // Silently fail if not in a project directory\n });\n}\n\n// Only parse when running as main module (not when imported for testing)\nconst isMainModule =\n import.meta.url === `file://${process.argv[1]}` ||\n process.argv[1]?.endsWith('/stackmemory') ||\n process.argv[1]?.endsWith('index.ts') ||\n process.argv[1]?.includes('tsx');\n\nif (isMainModule) {\n program.parse();\n}\n\nexport { program };\n"],
|
|
5
|
-
"mappings": ";;;;;AAOA,QAAQ,IAAI,iBAAiB,IAAI;AAGjC,OAAO;AAGP,SAAS,mBAAmB,aAAa;AACzC,kBAAkB;AAElB,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB,sBAAsB;AAC/C,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAC9B,SAAS,uBAAuB;AAChC,SAAS,+BAA+B;AACxC,SAAS,8BAA8B;AACvC,SAAS,6BAA6B;AACtC,SAAS,gCAAgC;AACzC,SAAS,iCAAiC;AAC1C,SAAS,0BAA0B;AACnC,SAAS,2BAA2B;AACpC,SAAS,wBAAwB;AACjC,SAAS,6BAA6B;AACtC,SAAS,2BAA2B;AACpC,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP,SAAS,4BAA4B;AACrC,SAAS,2BAA2B;AACpC,SAAS,yBAAyB;AAClC,OAAO,kBAAkB;AACzB,OAAO,2BAA2B;AAClC,OAAO,oBAAoB;AAC3B,OAAO,oBAAoB;AAC3B,OAAO,wBAAwB;AAC/B,OAAO,oBAAoB;AAC3B,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AACtC,SAAS,uBAAuB,0BAA0B;AAC1D,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AACnC,SAAS,wBAAwB;AACjC,SAAS,qCAAqC;AAC9C,SAAS,mCAAmC;AAC5C,SAAS,sBAAsB;AAC/B,OAAO,cAAc;AACrB,SAAS,YAAY;AACr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AAQ,WAAW,sBAAsB,CAAC;AAC1C,QAAQ,WAAW,cAAc;AACjC,QAAQ,WAAW,cAAc;AACjC,QAAQ,WAAW,mBAAmB,CAAC;AACvC,QAAQ,WAAW,cAAc;AACjC,QAAQ,WAAW,mBAAmB,CAAC;AACvC,QAAQ,WAAW,mBAAmB,CAAC;AACvC,QAAQ,WAAW,mBAAmB,CAAC;AACvC,QAAQ,WAAW,iBAAiB,CAAC;AACrC,QAAQ,WAAW,8BAA8B,CAAC;AAClD,QAAQ,WAAW,4BAA4B,CAAC;AAGhD,QACG,QAAQ,WAAW,EACnB,YAAY,0CAA0C,EACtD,OAAO,eAAe,wBAAwB,EAC9C,OAAO,4BAA4B,+BAA+B,GAAG,EACrE,OAAO,OAAO,YAAY;AACzB,QAAM,EAAE,iBAAiB,IAAI,MAAM,OAAO,yBAAyB;AACnE,QAAM,iBAAiB,QAAQ,OAAO;AACxC,CAAC;AAGH,IAAI,QAAQ,KAAK,SAAS,GAAG;AAC3B,QAAM,UAAU,eAAe,YAAY;AAC3C,UAAQ,cAAc,EAAE,MAAM,MAAM;AAAA,EAEpC,CAAC;AACH;AAGA,MAAM,eACJ,YAAY,QAAQ,UAAU,QAAQ,KAAK,CAAC,CAAC,MAC7C,QAAQ,KAAK,CAAC,GAAG,SAAS,cAAc,KACxC,QAAQ,KAAK,CAAC,GAAG,SAAS,UAAU,KACpC,QAAQ,KAAK,CAAC,GAAG,SAAS,KAAK;AAEjC,IAAI,cAAc;AAChB,UAAQ,MAAM;AAChB;",
|
|
4
|
+
"sourcesContent": ["#!/usr/bin/env node\n/**\n * StackMemory CLI\n * Command-line interface for StackMemory operations\n */\n\n// Set environment flag for CLI usage to skip async context bridge\nprocess.env['STACKMEMORY_CLI'] = 'true';\n\n// Load environment variables\nimport 'dotenv/config';\n\n// Initialize tracing system early\nimport { initializeTracing, trace } from '../core/trace/index.js';\ninitializeTracing();\n\nimport { program } from 'commander';\nimport { logger } from '../core/monitoring/logger.js';\nimport { FrameManager } from '../core/context/frame-manager.js';\nimport { sessionManager, FrameQueryMode } from '../core/session/index.js';\nimport { sharedContextLayer } from '../core/context/shared-context-layer.js';\nimport { UpdateChecker } from '../core/utils/update-checker.js';\nimport { ProgressTracker } from '../core/monitoring/progress-tracker.js';\nimport { registerProjectCommands } from './commands/projects.js';\nimport { registerLinearCommands } from './commands/linear.js';\nimport { createSessionCommands } from './commands/session.js';\nimport { registerWorktreeCommands } from './commands/worktree.js';\nimport { registerOnboardingCommand } from './commands/onboard.js';\nimport { createTaskCommands } from './commands/tasks.js';\nimport { createSearchCommand } from './commands/search.js';\nimport { createLogCommand } from './commands/log.js';\nimport { createContextCommands } from './commands/context.js';\nimport { createConfigCommand } from './commands/config.js';\nimport { createHandoffCommand } from './commands/handoff.js';\nimport {\n createDecisionCommand,\n createMemoryCommand,\n} from './commands/decision.js';\nimport { createStorageCommand } from './commands/storage.js';\nimport { createSkillsCommand } from './commands/skills.js';\nimport { createTestCommand } from './commands/test.js';\nimport clearCommand from './commands/clear.js';\nimport createWorkflowCommand from './commands/workflow.js';\nimport monitorCommand from './commands/monitor.js';\nimport qualityCommand from './commands/quality.js';\nimport createRalphCommand from './commands/ralph.js';\nimport serviceCommand from './commands/service.js';\nimport { registerLoginCommand } from './commands/login.js';\nimport { registerSignupCommand } from './commands/signup.js';\nimport { registerLogoutCommand, registerDbCommands } from './commands/db.js';\nimport { createSweepCommand } from './commands/sweep.js';\nimport { createHooksCommand } from './commands/hooks.js';\nimport { createShellCommand } from './commands/shell.js';\nimport { createAPICommand } from './commands/api.js';\nimport { createCleanupProcessesCommand } from './commands/cleanup-processes.js';\nimport { createAutoBackgroundCommand } from './commands/auto-background.js';\nimport { createSMSNotifyCommand } from './commands/sms-notify.js';\nimport { ProjectManager } from '../core/projects/project-manager.js';\nimport Database from 'better-sqlite3';\nimport { join } from 'path';\nimport { existsSync, mkdirSync } from 'fs';\nimport inquirer from 'inquirer';\nimport chalk from 'chalk';\nimport {\n loadStorageConfig,\n enableChromaDB,\n getStorageModeDescription,\n} from '../core/config/storage-config.js';\n\nconst VERSION = '0.5.5';\n\n// Check for updates on CLI startup\nUpdateChecker.checkForUpdates(VERSION, true).catch(() => {\n // Silently ignore errors\n});\n\nprogram\n .name('stackmemory')\n .description(\n 'Lossless memory runtime for AI coding tools - organizes context as a call stack instead of linear chat logs, with team collaboration and infinite retention'\n )\n .version(VERSION);\n\nprogram\n .command('init')\n .description(\n `Initialize StackMemory in current project\n\nStorage Modes:\n SQLite (default): Local only, fast, no setup required\n ChromaDB (hybrid): Adds semantic search and cloud backup, requires API key`\n )\n .option('--sqlite', 'Use SQLite-only storage (default, skip prompts)')\n .option(\n '--chromadb',\n 'Enable ChromaDB for semantic search (prompts for API key)'\n )\n .option('--skip-storage-prompt', 'Skip storage configuration prompt')\n .action(async (options) => {\n try {\n const projectRoot = process.cwd();\n const dbDir = join(projectRoot, '.stackmemory');\n\n if (!existsSync(dbDir)) {\n mkdirSync(dbDir, { recursive: true });\n }\n\n // Handle storage configuration\n let storageConfig = loadStorageConfig();\n const isFirstTimeSetup =\n !storageConfig.chromadb.enabled && storageConfig.mode === 'sqlite';\n\n // Skip prompts if --sqlite flag or --skip-storage-prompt\n if (options.sqlite || options.skipStoragePrompt) {\n // Use SQLite-only (default)\n console.log(chalk.gray('Using SQLite-only storage mode.'));\n } else if (options.chromadb) {\n // User explicitly requested ChromaDB, prompt for API key\n await promptAndEnableChromaDB();\n } else if (isFirstTimeSetup && process.stdin.isTTY) {\n // Interactive mode - ask user about ChromaDB\n console.log(chalk.cyan('\\nStorage Configuration'));\n console.log(chalk.gray('StackMemory supports two storage modes:\\n'));\n console.log(chalk.white(' SQLite (default):'));\n console.log(chalk.gray(' - Local storage only'));\n console.log(chalk.gray(' - Fast and simple'));\n console.log(chalk.gray(' - No external dependencies\\n'));\n console.log(chalk.white(' ChromaDB (hybrid):'));\n console.log(chalk.gray(' - Semantic search across your context'));\n console.log(chalk.gray(' - Cloud backup capability'));\n console.log(chalk.gray(' - Requires ChromaDB API key\\n'));\n\n const { enableChroma } = await inquirer.prompt([\n {\n type: 'confirm',\n name: 'enableChroma',\n message: 'Enable ChromaDB for semantic search? (requires API key)',\n default: false,\n },\n ]);\n\n if (enableChroma) {\n await promptAndEnableChromaDB();\n } else {\n console.log(chalk.gray('Using SQLite-only storage mode.'));\n }\n }\n\n // Initialize SQLite database\n const dbPath = join(dbDir, 'context.db');\n const db = new Database(dbPath);\n new FrameManager(db, 'cli-project');\n\n logger.info('StackMemory initialized successfully', { projectRoot });\n console.log(\n chalk.green('\\n[OK] StackMemory initialized in'),\n projectRoot\n );\n\n // Show current storage mode\n storageConfig = loadStorageConfig();\n console.log(chalk.gray(`Storage mode: ${getStorageModeDescription()}`));\n\n db.close();\n } catch (error: unknown) {\n logger.error('Failed to initialize StackMemory', error as Error);\n console.error(\n chalk.red('[ERROR] Initialization failed:'),\n (error as Error).message\n );\n process.exit(1);\n }\n });\n\n/**\n * Prompt user for ChromaDB configuration and enable it\n */\nasync function promptAndEnableChromaDB(): Promise<void> {\n const answers = await inquirer.prompt([\n {\n type: 'password',\n name: 'apiKey',\n message: 'Enter your ChromaDB API key:',\n validate: (input: string) => {\n if (!input || input.trim().length === 0) {\n return 'API key is required for ChromaDB';\n }\n return true;\n },\n },\n {\n type: 'input',\n name: 'apiUrl',\n message: 'ChromaDB API URL (press Enter for default):',\n default: 'https://api.trychroma.com',\n },\n ]);\n\n enableChromaDB({\n apiKey: answers.apiKey,\n apiUrl: answers.apiUrl,\n });\n\n console.log(chalk.green('[OK] ChromaDB enabled for semantic search.'));\n console.log(\n chalk.gray('API key saved to ~/.stackmemory/storage-config.json')\n );\n}\n\nprogram\n .command('status')\n .description('Show current StackMemory status')\n .option('--all', 'Show all active frames across sessions')\n .option('--project', 'Show all active frames in current project')\n .option('--session <id>', 'Show frames for specific session')\n .action(async (options) => {\n return trace.command('stackmemory-status', options, async () => {\n try {\n const projectRoot = process.cwd();\n const dbPath = join(projectRoot, '.stackmemory', 'context.db');\n\n if (!existsSync(dbPath)) {\n console.log(\n '\u274C StackMemory not initialized. Run \"stackmemory init\" first.'\n );\n return;\n }\n\n // Check for updates and display if available\n await UpdateChecker.checkForUpdates(VERSION);\n\n // Initialize session manager and shared context\n await sessionManager.initialize();\n await sharedContextLayer.initialize();\n\n const session = await sessionManager.getOrCreateSession({\n projectPath: projectRoot,\n sessionId: options.session,\n });\n\n // Auto-discover shared context on startup\n const contextDiscovery = await sharedContextLayer.autoDiscoverContext();\n\n // Show context hints if available\n if (\n contextDiscovery.hasSharedContext &&\n contextDiscovery.sessionCount > 1\n ) {\n console.log(`\\n\uD83D\uDCA1 Shared Context Available:`);\n console.log(\n ` ${contextDiscovery.sessionCount} sessions with shared context`\n );\n\n if (contextDiscovery.recentPatterns.length > 0) {\n console.log(` Recent patterns:`);\n contextDiscovery.recentPatterns.slice(0, 3).forEach((p) => {\n console.log(\n ` \u2022 ${p.type}: ${p.pattern.slice(0, 50)} (${p.frequency}x)`\n );\n });\n }\n\n if (contextDiscovery.lastDecisions.length > 0) {\n console.log(\n ` Last decision: ${contextDiscovery.lastDecisions[0].decision.slice(0, 60)}`\n );\n }\n }\n\n const db = new Database(dbPath);\n const frameManager = new FrameManager(db, session.projectId);\n\n // Set query mode based on options\n if (options.all) {\n frameManager.setQueryMode(FrameQueryMode.ALL_ACTIVE);\n } else if (options.project) {\n frameManager.setQueryMode(FrameQueryMode.PROJECT_ACTIVE);\n }\n\n const activeFrames = frameManager.getActiveFramePath();\n const stackDepth = frameManager.getStackDepth();\n\n // Always get total counts across all sessions\n const totalStats = db\n .prepare(\n `\n SELECT \n COUNT(*) as total_frames,\n SUM(CASE WHEN state = 'active' THEN 1 ELSE 0 END) as active_frames,\n SUM(CASE WHEN state = 'closed' THEN 1 ELSE 0 END) as closed_frames,\n COUNT(DISTINCT run_id) as total_sessions\n FROM frames\n WHERE project_id = ?\n `\n )\n .get(session.projectId) as {\n total_frames: number;\n active_frames: number;\n closed_frames: number;\n total_sessions: number;\n };\n\n const contextCount = db\n .prepare(\n `\n SELECT COUNT(*) as count FROM contexts\n `\n )\n .get() as { count: number };\n\n const eventCount = db\n .prepare(\n `\n SELECT COUNT(*) as count FROM events e\n JOIN frames f ON e.frame_id = f.frame_id\n WHERE f.project_id = ?\n `\n )\n .get(session.projectId) as { count: number };\n\n console.log('\uD83D\uDCCA StackMemory Status:');\n console.log(\n ` Session: ${session.sessionId.slice(0, 8)} (${session.state}, ${Math.round((Date.now() - session.startedAt) / 1000 / 60)}min old)`\n );\n console.log(` Project: ${session.projectId}`);\n if (session.branch) {\n console.log(` Branch: ${session.branch}`);\n }\n\n // Show total database statistics\n console.log(`\\n Database Statistics (this project):`);\n console.log(\n ` Frames: ${totalStats.total_frames || 0} (${totalStats.active_frames || 0} active, ${totalStats.closed_frames || 0} closed)`\n );\n console.log(` Events: ${eventCount.count || 0}`);\n console.log(` Sessions: ${totalStats.total_sessions || 0}`);\n console.log(\n ` Cached contexts: ${contextCount.count || 0} (global)`\n );\n\n // Show recent activity\n const recentFrames = db\n .prepare(\n `\n SELECT name, type, state, datetime(created_at, 'unixepoch') as created\n FROM frames\n WHERE project_id = ?\n ORDER BY created_at DESC\n LIMIT 3\n `\n )\n .all(session.projectId) as Array<{\n name: string;\n type: string;\n state: string;\n created: string;\n }>;\n\n if (recentFrames.length > 0) {\n console.log(`\\n Recent Activity:`);\n recentFrames.forEach((f) => {\n const stateIcon = f.state === 'active' ? '\uD83D\uDFE2' : '\u26AB';\n console.log(\n ` ${stateIcon} ${f.name} [${f.type}] - ${f.created}`\n );\n });\n }\n\n console.log(`\\n Current Session:`);\n console.log(` Stack depth: ${stackDepth}`);\n console.log(` Active frames: ${activeFrames.length}`);\n\n if (activeFrames.length > 0) {\n activeFrames.forEach((frame, i) => {\n const indent = ' ' + ' '.repeat(frame.depth || i);\n const prefix = i === 0 ? '\u2514\u2500' : ' \u2514\u2500';\n console.log(`${indent}${prefix} ${frame.name} [${frame.type}]`);\n });\n }\n\n // Show other sessions if in default mode\n if (!options.all && !options.project) {\n const otherSessions = await sessionManager.listSessions({\n projectId: session.projectId,\n state: 'active',\n });\n\n const otherActive = otherSessions.filter(\n (s) => s.sessionId !== session.sessionId\n );\n if (otherActive.length > 0) {\n console.log(`\\n Other Active Sessions (same project):`);\n otherActive.forEach((s) => {\n const age = Math.round(\n (Date.now() - s.lastActiveAt) / 1000 / 60 / 60\n );\n console.log(\n ` - ${s.sessionId.slice(0, 8)}: ${s.branch || 'main'}, ${age}h old`\n );\n });\n console.log(`\\n Tip: Use --all to see frames across sessions`);\n }\n }\n\n db.close();\n } catch (error: unknown) {\n logger.error('Failed to get status', error as Error);\n console.error('\u274C Status check failed:', (error as Error).message);\n process.exit(1);\n }\n });\n });\n\nprogram\n .command('update-check')\n .description('Check for StackMemory updates')\n .action(async () => {\n try {\n console.log('\uD83D\uDD0D Checking for updates...');\n await UpdateChecker.forceCheck(VERSION);\n } catch (error: unknown) {\n logger.error('Update check failed', error as Error);\n console.error('\u274C Update check failed:', (error as Error).message);\n process.exit(1);\n }\n });\n\nprogram\n .command('progress')\n .description('Show current progress and recent changes')\n .action(async () => {\n try {\n const projectRoot = process.cwd();\n const dbPath = join(projectRoot, '.stackmemory', 'context.db');\n\n if (!existsSync(dbPath)) {\n console.log(\n '\u274C StackMemory not initialized. Run \"stackmemory init\" first.'\n );\n return;\n }\n\n const progress = new ProgressTracker(projectRoot);\n console.log(progress.getSummary());\n } catch (error: unknown) {\n logger.error('Failed to show progress', error as Error);\n console.error('\u274C Failed to show progress:', (error as Error).message);\n process.exit(1);\n }\n });\n\nprogram\n .command('mcp-server')\n .description('Start StackMemory MCP server for Claude Desktop')\n .option('-p, --project <path>', 'Project root directory', process.cwd())\n .action(async (options) => {\n try {\n const { runMCPServer } = await import('../integrations/mcp/server.js');\n\n // Set project root\n process.env['PROJECT_ROOT'] = options.project;\n\n console.log('\uD83D\uDE80 Starting StackMemory MCP Server...');\n console.log(` Project: ${options.project}`);\n console.log(` Version: ${VERSION}`);\n\n // Check for updates silently\n UpdateChecker.checkForUpdates(VERSION, true).catch(() => {});\n\n // Start the MCP server\n await runMCPServer();\n } catch (error: unknown) {\n logger.error('Failed to start MCP server', error as Error);\n console.error('\u274C MCP server failed:', (error as Error).message);\n process.exit(1);\n }\n });\n\n// Add test context command\nprogram\n .command('context:test')\n .description('Test context persistence by creating sample frames')\n .action(async () => {\n try {\n const projectRoot = process.cwd();\n const dbPath = join(projectRoot, '.stackmemory', 'context.db');\n\n if (!existsSync(dbPath)) {\n console.log(\n '\u274C StackMemory not initialized. Run \"stackmemory init\" first.'\n );\n return;\n }\n\n const db = new Database(dbPath);\n const frameManager = new FrameManager(db, 'cli-project');\n\n // Create test frames\n console.log('\uD83D\uDCDD Creating test context frames...');\n\n const rootFrame = frameManager.createFrame({\n type: 'task',\n name: 'Test Session',\n inputs: { test: true, timestamp: new Date().toISOString() },\n });\n\n const taskFrame = frameManager.createFrame({\n type: 'subtask',\n name: 'Sample Task',\n inputs: { description: 'Testing context persistence' },\n parentFrameId: rootFrame,\n });\n\n const commandFrame = frameManager.createFrame({\n type: 'tool_scope',\n name: 'test-command',\n inputs: { args: ['--test'] },\n parentFrameId: taskFrame,\n });\n\n // Add some events\n frameManager.addEvent(\n 'observation',\n {\n message: 'Test event recorded',\n },\n commandFrame\n );\n\n console.log('\u2705 Test frames created!');\n console.log(`\uD83D\uDCCA Stack depth: ${frameManager.getStackDepth()}`);\n console.log(\n `\uD83D\uDD04 Active frames: ${frameManager.getActiveFramePath().length}`\n );\n\n // Close one frame to test state changes\n frameManager.closeFrame(commandFrame);\n console.log(\n `\uD83D\uDCCA After closing command frame: depth = ${frameManager.getStackDepth()}`\n );\n\n db.close();\n } catch (error: unknown) {\n logger.error('Test context failed', error as Error);\n console.error('\u274C Test failed:', (error as Error).message);\n process.exit(1);\n }\n });\n\n// Register project management commands\n// Register command modules\nregisterOnboardingCommand(program);\nregisterSignupCommand(program);\nregisterLoginCommand(program);\nregisterLogoutCommand(program);\nregisterDbCommands(program);\nregisterProjectCommands(program);\nregisterWorktreeCommands(program);\n\n// Register Linear integration commands\nregisterLinearCommands(program);\n\n// Register session management commands\nprogram.addCommand(createSessionCommands());\n\n// Register enhanced CLI commands\nprogram.addCommand(createTaskCommands());\nprogram.addCommand(createSearchCommand());\nprogram.addCommand(createLogCommand());\nprogram.addCommand(createContextCommands());\nprogram.addCommand(createConfigCommand());\nprogram.addCommand(createHandoffCommand());\nprogram.addCommand(createDecisionCommand());\nprogram.addCommand(createMemoryCommand());\nprogram.addCommand(createStorageCommand());\nprogram.addCommand(createSkillsCommand());\nprogram.addCommand(createTestCommand());\nprogram.addCommand(clearCommand);\nprogram.addCommand(createWorkflowCommand());\nprogram.addCommand(monitorCommand);\nprogram.addCommand(qualityCommand);\nprogram.addCommand(createRalphCommand());\nprogram.addCommand(serviceCommand);\nprogram.addCommand(createSweepCommand());\nprogram.addCommand(createHooksCommand());\nprogram.addCommand(createShellCommand());\nprogram.addCommand(createAPICommand());\nprogram.addCommand(createCleanupProcessesCommand());\nprogram.addCommand(createAutoBackgroundCommand());\nprogram.addCommand(createSMSNotifyCommand());\n\n// Register dashboard command\nprogram\n .command('dashboard')\n .description('Display monitoring dashboard in terminal')\n .option('-w, --watch', 'Auto-refresh dashboard')\n .option('-i, --interval <seconds>', 'Refresh interval in seconds', '5')\n .action(async (options) => {\n const { dashboardCommand } = await import('./commands/dashboard.js');\n await dashboardCommand.handler(options);\n });\n\n// Auto-detect current project on startup\nif (process.argv.length > 2) {\n const manager = ProjectManager.getInstance();\n manager.detectProject().catch(() => {\n // Silently fail if not in a project directory\n });\n}\n\n// Only parse when running as main module (not when imported for testing)\nconst isMainModule =\n import.meta.url === `file://${process.argv[1]}` ||\n process.argv[1]?.endsWith('/stackmemory') ||\n process.argv[1]?.endsWith('index.ts') ||\n process.argv[1]?.includes('tsx');\n\nif (isMainModule) {\n program.parse();\n}\n\nexport { program };\n"],
|
|
5
|
+
"mappings": ";;;;;AAOA,QAAQ,IAAI,iBA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AAW,8BAA8B,CAAC;AAClD,QAAQ,WAAW,4BAA4B,CAAC;AAChD,QAAQ,WAAW,uBAAuB,CAAC;AAG3C,QACG,QAAQ,WAAW,EACnB,YAAY,0CAA0C,EACtD,OAAO,eAAe,wBAAwB,EAC9C,OAAO,4BAA4B,+BAA+B,GAAG,EACrE,OAAO,OAAO,YAAY;AACzB,QAAM,EAAE,iBAAiB,IAAI,MAAM,OAAO,yBAAyB;AACnE,QAAM,iBAAiB,QAAQ,OAAO;AACxC,CAAC;AAGH,IAAI,QAAQ,KAAK,SAAS,GAAG;AAC3B,QAAM,UAAU,eAAe,YAAY;AAC3C,UAAQ,cAAc,EAAE,MAAM,MAAM;AAAA,EAEpC,CAAC;AACH;AAGA,MAAM,eACJ,YAAY,QAAQ,UAAU,QAAQ,KAAK,CAAC,CAAC,MAC7C,QAAQ,KAAK,CAAC,GAAG,SAAS,cAAc,KACxC,QAAQ,KAAK,CAAC,GAAG,SAAS,UAAU,KACpC,QAAQ,KAAK,CAAC,GAAG,SAAS,KAAK;AAEjC,IAAI,cAAc;AAChB,UAAQ,MAAM;AAChB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/hooks/index.js
CHANGED
|
@@ -6,4 +6,7 @@ export * from "./events.js";
|
|
|
6
6
|
export * from "./config.js";
|
|
7
7
|
export * from "./daemon.js";
|
|
8
8
|
export * from "./auto-background.js";
|
|
9
|
+
export * from "./sms-notify.js";
|
|
10
|
+
export * from "./sms-webhook.js";
|
|
11
|
+
export * from "./sms-action-runner.js";
|
|
9
12
|
//# sourceMappingURL=index.js.map
|
package/dist/hooks/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/hooks/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * StackMemory Hooks Module\n * User-configurable hook system for automation and suggestions\n */\n\nexport * from './events.js';\nexport * from './config.js';\nexport * from './daemon.js';\nexport * from './auto-background.js';\n"],
|
|
5
|
-
"mappings": ";;;;AAKA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
4
|
+
"sourcesContent": ["/**\n * StackMemory Hooks Module\n * User-configurable hook system for automation and suggestions\n */\n\nexport * from './events.js';\nexport * from './config.js';\nexport * from './daemon.js';\nexport * from './auto-background.js';\nexport * from './sms-notify.js';\nexport * from './sms-webhook.js';\nexport * from './sms-action-runner.js';\n"],
|
|
5
|
+
"mappings": ";;;;AAKA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|