@stackmemoryai/stackmemory 0.5.64 → 0.5.67
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/README.md +69 -346
- package/bin/claude-sm +1 -1
- package/bin/claude-smd +1 -1
- package/bin/codex-sm +6 -0
- package/bin/codex-smd +1 -1
- package/bin/opencode-sm +1 -1
- package/dist/src/cli/claude-sm.js +162 -25
- package/dist/src/cli/claude-sm.js.map +2 -2
- package/dist/src/cli/commands/ping.js +14 -0
- package/dist/src/cli/commands/ping.js.map +7 -0
- package/dist/src/cli/commands/ralph.js +103 -1
- package/dist/src/cli/commands/ralph.js.map +2 -2
- package/dist/src/cli/commands/retrieval.js +1 -1
- package/dist/src/cli/commands/retrieval.js.map +2 -2
- package/dist/src/cli/commands/skills.js +300 -1
- package/dist/src/cli/commands/skills.js.map +2 -2
- package/dist/src/cli/index.js +362 -20
- package/dist/src/cli/index.js.map +2 -2
- package/dist/src/core/digest/types.js +1 -1
- package/dist/src/core/digest/types.js.map +1 -1
- package/dist/src/core/extensions/provider-adapter.js +2 -5
- package/dist/src/core/extensions/provider-adapter.js.map +2 -2
- package/dist/src/core/retrieval/llm-provider.js +2 -2
- package/dist/src/core/retrieval/llm-provider.js.map +1 -1
- package/dist/src/core/retrieval/types.js +1 -1
- package/dist/src/core/retrieval/types.js.map +1 -1
- package/dist/src/features/sweep/pty-wrapper.js +15 -5
- package/dist/src/features/sweep/pty-wrapper.js.map +2 -2
- package/dist/src/features/workers/tmux-manager.js +71 -0
- package/dist/src/features/workers/tmux-manager.js.map +7 -0
- package/dist/src/features/workers/worker-registry.js +52 -0
- package/dist/src/features/workers/worker-registry.js.map +7 -0
- package/dist/src/integrations/linear/webhook-handler.js +82 -0
- package/dist/src/integrations/linear/webhook-handler.js.map +2 -2
- package/dist/src/integrations/mcp/pending-utils.js +33 -0
- package/dist/src/integrations/mcp/pending-utils.js.map +7 -0
- package/dist/src/integrations/mcp/server.js +571 -1
- package/dist/src/integrations/mcp/server.js.map +2 -2
- package/dist/src/integrations/ralph/patterns/oracle-worker-pattern.js +2 -2
- package/dist/src/integrations/ralph/patterns/oracle-worker-pattern.js.map +2 -2
- package/dist/src/orchestrators/multimodal/constants.js +17 -0
- package/dist/src/orchestrators/multimodal/constants.js.map +7 -0
- package/dist/src/orchestrators/multimodal/harness.js +292 -0
- package/dist/src/orchestrators/multimodal/harness.js.map +7 -0
- package/dist/src/orchestrators/multimodal/providers.js +98 -0
- package/dist/src/orchestrators/multimodal/providers.js.map +7 -0
- package/dist/src/orchestrators/multimodal/types.js +5 -0
- package/dist/src/orchestrators/multimodal/types.js.map +7 -0
- package/dist/src/orchestrators/multimodal/utils.js +25 -0
- package/dist/src/orchestrators/multimodal/utils.js.map +7 -0
- package/dist/src/skills/claude-skills.js +116 -1
- package/dist/src/skills/claude-skills.js.map +2 -2
- package/dist/src/skills/linear-task-runner.js +262 -0
- package/dist/src/skills/linear-task-runner.js.map +7 -0
- package/dist/src/skills/recursive-agent-orchestrator.js +114 -85
- package/dist/src/skills/recursive-agent-orchestrator.js.map +2 -2
- package/dist/src/skills/spec-generator-skill.js +441 -0
- package/dist/src/skills/spec-generator-skill.js.map +7 -0
- package/package.json +14 -9
- package/scripts/claude-code-wrapper.sh +18 -30
- package/scripts/demos/ralph-integration-demo.ts +14 -13
- package/scripts/demos/trace-demo.ts +7 -21
- package/scripts/demos/trace-test.ts +20 -8
- package/scripts/install-claude-hooks.sh +2 -2
- package/scripts/verify-dist.cjs +83 -0
- package/templates/claude-hooks/post-edit-sweep.js +7 -10
|
@@ -23,6 +23,28 @@ import {
|
|
|
23
23
|
DatabaseError,
|
|
24
24
|
ErrorCode
|
|
25
25
|
} from "../../core/errors/index.js";
|
|
26
|
+
import { readFileSync } from "fs";
|
|
27
|
+
import { fileURLToPath } from "url";
|
|
28
|
+
let _version;
|
|
29
|
+
function getVersion() {
|
|
30
|
+
if (_version) return _version;
|
|
31
|
+
try {
|
|
32
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
33
|
+
let dir = __dirname;
|
|
34
|
+
for (let i = 0; i < 6; i++) {
|
|
35
|
+
const candidate = path.join(dir, "package.json");
|
|
36
|
+
try {
|
|
37
|
+
_version = JSON.parse(readFileSync(candidate, "utf-8")).version;
|
|
38
|
+
return _version;
|
|
39
|
+
} catch {
|
|
40
|
+
dir = path.dirname(dir);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
} catch {
|
|
44
|
+
}
|
|
45
|
+
_version = "0.0.0";
|
|
46
|
+
return _version;
|
|
47
|
+
}
|
|
26
48
|
function getEnv(key, defaultValue) {
|
|
27
49
|
const value = process.env[key];
|
|
28
50
|
if (value === void 0) {
|
|
@@ -270,6 +292,109 @@ function createSkillsCommand() {
|
|
|
270
292
|
process.exit(1);
|
|
271
293
|
}
|
|
272
294
|
});
|
|
295
|
+
skillsCmd.command("spike").description(
|
|
296
|
+
"Run multi-agent spike (planner: Claude, implementer: Codex/Claude, critic: Claude)"
|
|
297
|
+
).option("-t, --task <desc>", "Task description", "Spike harness").option(
|
|
298
|
+
"--planner-model <name>",
|
|
299
|
+
"Claude model for planning",
|
|
300
|
+
"claude-sonnet-4-20250514"
|
|
301
|
+
).option(
|
|
302
|
+
"--reviewer-model <name>",
|
|
303
|
+
"Claude model for review",
|
|
304
|
+
"claude-sonnet-4-20250514"
|
|
305
|
+
).option("--implementer <name>", "codex|claude", "codex").option("--max-iters <n>", "Retry loop iterations", "2").option(
|
|
306
|
+
"--execute",
|
|
307
|
+
"Execute implementer (codex-sm) instead of dry-run",
|
|
308
|
+
false
|
|
309
|
+
).option("--audit-dir <path>", "Persist spike results to directory").option("--record-frame", "Record as real frame with anchors", false).option(
|
|
310
|
+
"--record",
|
|
311
|
+
"Record plan & critique into StackMemory context",
|
|
312
|
+
false
|
|
313
|
+
).option("--json", "Emit single JSON result (UI-friendly)", false).option("--quiet", "Minimal output (default)", true).option("--verbose", "Verbose sectioned output", false).action(async (options) => {
|
|
314
|
+
const spinner = ora("Planning with Claude...").start();
|
|
315
|
+
try {
|
|
316
|
+
const { runSpike } = await import("../../orchestrators/multimodal/harness.js");
|
|
317
|
+
const result = await runSpike(
|
|
318
|
+
{
|
|
319
|
+
task: options.task,
|
|
320
|
+
repoPath: process.cwd()
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
plannerModel: options.plannerModel,
|
|
324
|
+
reviewerModel: options.reviewerModel,
|
|
325
|
+
implementer: options.implementer,
|
|
326
|
+
maxIters: parseInt(options.maxIters),
|
|
327
|
+
dryRun: !options.execute,
|
|
328
|
+
auditDir: options.auditDir,
|
|
329
|
+
recordFrame: Boolean(options.recordFrame),
|
|
330
|
+
record: Boolean(options.record)
|
|
331
|
+
}
|
|
332
|
+
);
|
|
333
|
+
spinner.stop();
|
|
334
|
+
if (options.json) {
|
|
335
|
+
console.log(JSON.stringify(result));
|
|
336
|
+
} else if (options.verbose) {
|
|
337
|
+
console.log(chalk.gray(`StackMemory v${getVersion()}`));
|
|
338
|
+
console.log(chalk.cyan("\n=== Plan ==="));
|
|
339
|
+
console.log(JSON.stringify(result.plan, null, 2));
|
|
340
|
+
console.log(chalk.cyan("\n=== Iterations ==="));
|
|
341
|
+
(result.iterations || []).forEach((it, idx) => {
|
|
342
|
+
console.log(chalk.gray(`
|
|
343
|
+
-- Attempt ${idx + 1} --`));
|
|
344
|
+
console.log(`Command: ${it.command}`);
|
|
345
|
+
console.log(`OK: ${it.ok}`);
|
|
346
|
+
console.log("Critique:", JSON.stringify(it.critique));
|
|
347
|
+
});
|
|
348
|
+
console.log(chalk.cyan("\n=== Final ==="));
|
|
349
|
+
console.log(JSON.stringify(result.implementation, null, 2));
|
|
350
|
+
console.log(chalk.cyan("\n=== Critique ==="));
|
|
351
|
+
console.log(JSON.stringify(result.critique, null, 2));
|
|
352
|
+
} else if (!options.quiet) {
|
|
353
|
+
console.log(
|
|
354
|
+
`Plan steps: ${result.plan.steps.length}, Approved: ${result.critique.approved}`
|
|
355
|
+
);
|
|
356
|
+
}
|
|
357
|
+
if (!result.implementation.success) process.exitCode = 1;
|
|
358
|
+
} catch (error) {
|
|
359
|
+
spinner.stop();
|
|
360
|
+
console.error(chalk.red("Spike failed:"), error?.message || error);
|
|
361
|
+
process.exit(1);
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
skillsCmd.command("plan <task>").description("Generate an implementation plan (no code execution)").option(
|
|
365
|
+
"--planner-model <name>",
|
|
366
|
+
"Claude model for planning",
|
|
367
|
+
"claude-sonnet-4-20250514"
|
|
368
|
+
).option("--json", "Emit JSON (default)", true).option("--pretty", "Pretty-print JSON", false).option(
|
|
369
|
+
"--compact",
|
|
370
|
+
"Compact output (summary + step titles + criteria)",
|
|
371
|
+
false
|
|
372
|
+
).action(async (task, options) => {
|
|
373
|
+
const spinner = ora("Planning with Claude...").start();
|
|
374
|
+
try {
|
|
375
|
+
const { runPlanOnly } = await import("../../orchestrators/multimodal/harness.js");
|
|
376
|
+
const plan = await runPlanOnly(
|
|
377
|
+
{ task, repoPath: process.cwd() },
|
|
378
|
+
{ plannerModel: options.plannerModel }
|
|
379
|
+
);
|
|
380
|
+
spinner.stop();
|
|
381
|
+
const compacted = options.compact ? {
|
|
382
|
+
summary: plan?.summary,
|
|
383
|
+
steps: Array.isArray(plan?.steps) ? plan.steps.map((s) => ({
|
|
384
|
+
id: s.id,
|
|
385
|
+
title: s.title,
|
|
386
|
+
acceptanceCriteria: s.acceptanceCriteria
|
|
387
|
+
})) : [],
|
|
388
|
+
risks: plan?.risks
|
|
389
|
+
} : plan;
|
|
390
|
+
const payload = JSON.stringify(compacted, null, options.pretty ? 2 : 0);
|
|
391
|
+
console.log(payload);
|
|
392
|
+
} catch (error) {
|
|
393
|
+
spinner.stop();
|
|
394
|
+
console.error(chalk.red("Plan failed:"), error?.message || error);
|
|
395
|
+
process.exit(1);
|
|
396
|
+
}
|
|
397
|
+
});
|
|
273
398
|
skillsCmd.command("dig <query>").description("Deep historical context retrieval").option(
|
|
274
399
|
"-d, --depth <depth>",
|
|
275
400
|
"Search depth (e.g., 30days, 6months, all)",
|
|
@@ -400,6 +525,174 @@ Searched ${result.data.timeRange.from} to ${result.data.timeRange.to}`
|
|
|
400
525
|
process.exit(1);
|
|
401
526
|
}
|
|
402
527
|
});
|
|
528
|
+
const specCmd = skillsCmd.command("spec").description("Generate iterative spec documents");
|
|
529
|
+
specCmd.command("generate <type> <title>").description(
|
|
530
|
+
"Generate a spec document (one-pager, dev-spec, prompt-plan, agents)"
|
|
531
|
+
).action(async (type, title) => {
|
|
532
|
+
const spinner = ora(`Generating ${type}...`).start();
|
|
533
|
+
try {
|
|
534
|
+
const { context, unifiedOrchestrator } = await initializeSkillContext();
|
|
535
|
+
const result = await unifiedOrchestrator.executeSkill(
|
|
536
|
+
"spec",
|
|
537
|
+
["generate", type, title],
|
|
538
|
+
{}
|
|
539
|
+
);
|
|
540
|
+
spinner.stop();
|
|
541
|
+
if (result.success) {
|
|
542
|
+
console.log(chalk.green("\u2713"), result.message);
|
|
543
|
+
} else {
|
|
544
|
+
console.log(chalk.red("\u2717"), result.message);
|
|
545
|
+
}
|
|
546
|
+
await context.database.disconnect();
|
|
547
|
+
} catch (error) {
|
|
548
|
+
spinner.stop();
|
|
549
|
+
console.error(chalk.red("Error:"), error.message);
|
|
550
|
+
process.exit(1);
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
specCmd.command("list").description("List existing spec documents").action(async () => {
|
|
554
|
+
try {
|
|
555
|
+
const { context, unifiedOrchestrator } = await initializeSkillContext();
|
|
556
|
+
const result = await unifiedOrchestrator.executeSkill(
|
|
557
|
+
"spec",
|
|
558
|
+
["list"],
|
|
559
|
+
{}
|
|
560
|
+
);
|
|
561
|
+
if (result.success) {
|
|
562
|
+
console.log(chalk.green("\u2713"), result.message);
|
|
563
|
+
if (result.data) {
|
|
564
|
+
console.log(JSON.stringify(result.data, null, 2));
|
|
565
|
+
}
|
|
566
|
+
} else {
|
|
567
|
+
console.log(chalk.red("\u2717"), result.message);
|
|
568
|
+
}
|
|
569
|
+
await context.database.disconnect();
|
|
570
|
+
} catch (error) {
|
|
571
|
+
console.error(chalk.red("Error:"), error.message);
|
|
572
|
+
process.exit(1);
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
specCmd.command("validate <path>").description("Validate spec document completeness").action(async (filePath) => {
|
|
576
|
+
try {
|
|
577
|
+
const { context, unifiedOrchestrator } = await initializeSkillContext();
|
|
578
|
+
const result = await unifiedOrchestrator.executeSkill(
|
|
579
|
+
"spec",
|
|
580
|
+
["validate", filePath],
|
|
581
|
+
{}
|
|
582
|
+
);
|
|
583
|
+
if (result.success) {
|
|
584
|
+
console.log(chalk.green("\u2713"), result.message);
|
|
585
|
+
} else {
|
|
586
|
+
console.log(chalk.red("\u2717"), result.message);
|
|
587
|
+
}
|
|
588
|
+
await context.database.disconnect();
|
|
589
|
+
} catch (error) {
|
|
590
|
+
console.error(chalk.red("Error:"), error.message);
|
|
591
|
+
process.exit(1);
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
const linearRunCmd = skillsCmd.command("linear-run").description("Execute Linear tasks via RLM orchestrator");
|
|
595
|
+
linearRunCmd.command("next").description("Execute the next highest-priority Linear task").option("--priority <level>", "Filter by priority").option("--tag <tag>", "Filter by tag").option("--dry-run", "Preview without executing").action(async (options) => {
|
|
596
|
+
const spinner = ora("Fetching next task...").start();
|
|
597
|
+
try {
|
|
598
|
+
const { context, unifiedOrchestrator } = await initializeSkillContext();
|
|
599
|
+
const result = await unifiedOrchestrator.executeSkill(
|
|
600
|
+
"linear-run",
|
|
601
|
+
["next"],
|
|
602
|
+
{
|
|
603
|
+
priority: options.priority,
|
|
604
|
+
tag: options.tag,
|
|
605
|
+
dryRun: options.dryRun
|
|
606
|
+
}
|
|
607
|
+
);
|
|
608
|
+
spinner.stop();
|
|
609
|
+
if (result.success) {
|
|
610
|
+
console.log(chalk.green("\u2713"), result.message);
|
|
611
|
+
if (result.data) {
|
|
612
|
+
console.log(JSON.stringify(result.data, null, 2));
|
|
613
|
+
}
|
|
614
|
+
} else {
|
|
615
|
+
console.log(chalk.red("\u2717"), result.message);
|
|
616
|
+
}
|
|
617
|
+
await context.database.disconnect();
|
|
618
|
+
} catch (error) {
|
|
619
|
+
spinner.stop();
|
|
620
|
+
console.error(chalk.red("Error:"), error.message);
|
|
621
|
+
process.exit(1);
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
linearRunCmd.command("all").description("Execute all active Linear tasks iteratively").option("--max-concurrent <n>", "Max concurrent tasks", "1").option("--dry-run", "Preview without executing").action(async (options) => {
|
|
625
|
+
const spinner = ora("Running all tasks...").start();
|
|
626
|
+
try {
|
|
627
|
+
const { context, unifiedOrchestrator } = await initializeSkillContext();
|
|
628
|
+
const result = await unifiedOrchestrator.executeSkill(
|
|
629
|
+
"linear-run",
|
|
630
|
+
["all"],
|
|
631
|
+
{
|
|
632
|
+
maxConcurrent: parseInt(options.maxConcurrent),
|
|
633
|
+
dryRun: options.dryRun
|
|
634
|
+
}
|
|
635
|
+
);
|
|
636
|
+
spinner.stop();
|
|
637
|
+
if (result.success) {
|
|
638
|
+
console.log(chalk.green("\u2713"), result.message);
|
|
639
|
+
if (result.data) {
|
|
640
|
+
console.log(JSON.stringify(result.data, null, 2));
|
|
641
|
+
}
|
|
642
|
+
} else {
|
|
643
|
+
console.log(chalk.red("\u2717"), result.message);
|
|
644
|
+
}
|
|
645
|
+
await context.database.disconnect();
|
|
646
|
+
} catch (error) {
|
|
647
|
+
spinner.stop();
|
|
648
|
+
console.error(chalk.red("Error:"), error.message);
|
|
649
|
+
process.exit(1);
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
linearRunCmd.command("task <taskId>").description("Execute a specific Linear task by ID").action(async (taskId) => {
|
|
653
|
+
const spinner = ora(`Executing task ${taskId}...`).start();
|
|
654
|
+
try {
|
|
655
|
+
const { context, unifiedOrchestrator } = await initializeSkillContext();
|
|
656
|
+
const result = await unifiedOrchestrator.executeSkill(
|
|
657
|
+
"linear-run",
|
|
658
|
+
["task", taskId],
|
|
659
|
+
{}
|
|
660
|
+
);
|
|
661
|
+
spinner.stop();
|
|
662
|
+
if (result.success) {
|
|
663
|
+
console.log(chalk.green("\u2713"), result.message);
|
|
664
|
+
} else {
|
|
665
|
+
console.log(chalk.red("\u2717"), result.message);
|
|
666
|
+
}
|
|
667
|
+
await context.database.disconnect();
|
|
668
|
+
} catch (error) {
|
|
669
|
+
spinner.stop();
|
|
670
|
+
console.error(chalk.red("Error:"), error.message);
|
|
671
|
+
process.exit(1);
|
|
672
|
+
}
|
|
673
|
+
});
|
|
674
|
+
linearRunCmd.command("preview [taskId]").description("Show execution plan without running").action(async (taskId) => {
|
|
675
|
+
try {
|
|
676
|
+
const { context, unifiedOrchestrator } = await initializeSkillContext();
|
|
677
|
+
const result = await unifiedOrchestrator.executeSkill(
|
|
678
|
+
"linear-run",
|
|
679
|
+
["preview", taskId || ""],
|
|
680
|
+
{}
|
|
681
|
+
);
|
|
682
|
+
if (result.success) {
|
|
683
|
+
console.log(chalk.green("\u2713"), result.message);
|
|
684
|
+
if (result.data) {
|
|
685
|
+
console.log(JSON.stringify(result.data, null, 2));
|
|
686
|
+
}
|
|
687
|
+
} else {
|
|
688
|
+
console.log(chalk.red("\u2717"), result.message);
|
|
689
|
+
}
|
|
690
|
+
await context.database.disconnect();
|
|
691
|
+
} catch (error) {
|
|
692
|
+
console.error(chalk.red("Error:"), error.message);
|
|
693
|
+
process.exit(1);
|
|
694
|
+
}
|
|
695
|
+
});
|
|
403
696
|
skillsCmd.command("help [skill]").description("Show help for a specific skill").action(async (skill) => {
|
|
404
697
|
if (skill) {
|
|
405
698
|
switch (skill) {
|
|
@@ -451,7 +744,13 @@ Options:
|
|
|
451
744
|
console.log(" review - Multi-stage code review and improvements");
|
|
452
745
|
console.log(" refactor - Refactor code for better architecture");
|
|
453
746
|
console.log(" publish - Prepare and execute releases");
|
|
454
|
-
console.log(" rlm - Direct recursive agent orchestration
|
|
747
|
+
console.log(" rlm - Direct recursive agent orchestration");
|
|
748
|
+
console.log(
|
|
749
|
+
" spec - Generate iterative spec docs (one-pager, dev-spec, prompt-plan, agents)"
|
|
750
|
+
);
|
|
751
|
+
console.log(
|
|
752
|
+
" linear-run - Execute Linear tasks via RLM orchestrator\n"
|
|
753
|
+
);
|
|
455
754
|
console.log(
|
|
456
755
|
chalk.yellow(
|
|
457
756
|
"\nAll skills now use RLM orchestration for intelligent task decomposition"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/commands/skills.ts"],
|
|
4
|
-
"sourcesContent": ["#!/usr/bin/env node\n/**\n * Claude Skills CLI Commands\n * Integrates Claude skills into the stackmemory CLI\n */\n\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport {\n ClaudeSkillsManager,\n type SkillContext,\n} from '../../skills/claude-skills.js';\nimport {\n UnifiedRLMOrchestrator,\n initializeUnifiedOrchestrator,\n} from '../../skills/unified-rlm-orchestrator.js';\nimport { DualStackManager } from '../../core/context/dual-stack-manager.js';\nimport { FrameHandoffManager } from '../../core/context/frame-handoff-manager.js';\nimport { FrameManager } from '../../core/context/index.js';\nimport { ContextRetriever } from '../../core/retrieval/context-retriever.js';\nimport { SQLiteAdapter } from '../../core/database/sqlite-adapter.js';\nimport { LinearTaskManager } from '../../features/tasks/linear-task-manager.js';\nimport { ConfigManager } from '../../core/config/config-manager.js';\nimport * as path from 'path';\nimport * as os from 'os';\nimport {\n SystemError,\n DatabaseError,\n ErrorCode,\n} from '../../core/errors/index.js';\n\n// Type-safe environment variable access\nfunction getEnv(key: string, defaultValue?: string): string {\n const value = process.env[key];\n if (value === undefined) {\n if (defaultValue !== undefined) return defaultValue;\n throw new SystemError(\n `Environment variable ${key} is required`,\n ErrorCode.CONFIGURATION_ERROR,\n { variable: key }\n );\n }\n return value;\n}\n\nfunction getOptionalEnv(key: string): string | undefined {\n return process.env[key];\n}\n\nasync function initializeSkillContext(): Promise<{\n context: SkillContext;\n unifiedOrchestrator: UnifiedRLMOrchestrator;\n}> {\n const config = ConfigManager.getInstance();\n const projectId = config.get('project.id') || 'default-project';\n const userId = config.get('user.id') || process.env['USER'] || 'default';\n\n const dbPath = path.join(\n os.homedir(),\n '.stackmemory',\n 'data',\n projectId,\n 'stackmemory.db'\n );\n\n const database = new SQLiteAdapter(projectId, { dbPath });\n await database.connect();\n\n // Get raw database for FrameManager\n const rawDatabase = database.getRawDatabase();\n if (!rawDatabase) {\n throw new DatabaseError(\n 'Failed to get raw database connection',\n ErrorCode.DB_CONNECTION_FAILED,\n { projectId, operation: 'initializeSkillContext' }\n );\n }\n\n // Validate database has required methods\n if (typeof rawDatabase.exec !== 'function') {\n throw new DatabaseError(\n `Invalid database instance: missing exec() method. Got: ${typeof rawDatabase.exec}`,\n ErrorCode.DB_CONNECTION_FAILED,\n { projectId, operation: 'initializeSkillContext' }\n );\n }\n\n // Test database connectivity\n try {\n rawDatabase.exec('SELECT 1');\n } catch (err) {\n throw new DatabaseError(\n `Database connection test failed: ${(err as Error).message}`,\n ErrorCode.DB_CONNECTION_FAILED,\n { projectId, operation: 'initializeSkillContext' },\n err as Error\n );\n }\n\n const dualStackManager = new DualStackManager(database, projectId, userId);\n const handoffManager = new FrameHandoffManager(dualStackManager);\n const contextRetriever = new ContextRetriever(database);\n const frameManager = new FrameManager(rawDatabase, projectId);\n const taskStore = new LinearTaskManager();\n\n const context: SkillContext = {\n projectId,\n userId,\n dualStackManager,\n handoffManager,\n contextRetriever,\n database,\n frameManager,\n };\n\n // Initialize unified RLM orchestrator\n const unifiedOrchestrator = initializeUnifiedOrchestrator(\n frameManager,\n dualStackManager,\n contextRetriever,\n taskStore,\n context\n );\n\n return { context, unifiedOrchestrator };\n}\n\nexport function createSkillsCommand(): Command {\n const skillsCmd = new Command('skills').description(\n 'Execute Claude skills for enhanced workflow'\n );\n\n // Handoff skill command\n skillsCmd\n .command('handoff <targetUser> <message>')\n .description('Streamline frame handoffs between team members')\n .option(\n '-p, --priority <level>',\n 'Set priority (low, medium, high, critical)',\n 'medium'\n )\n .option('-f, --frames <frames...>', 'Specific frames to handoff')\n .option('--no-auto-detect', 'Disable auto-detection of frames')\n .action(async (targetUser, message, options) => {\n const spinner = ora('Initiating handoff...').start();\n\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n\n // Use unified RLM orchestrator for RLM-first execution\n const result = await unifiedOrchestrator.executeSkill(\n 'handoff',\n [targetUser, message],\n {\n priority: options.priority,\n frames: options.frames,\n autoDetect: options.autoDetect !== false,\n }\n );\n\n spinner.stop();\n\n if (result.success) {\n console.log(chalk.green('\u2713'), result.message);\n if (result.data) {\n console.log(chalk.cyan('\\nHandoff Details:'));\n console.log(` ID: ${result.data.handoffId}`);\n console.log(` Frames: ${result.data.frameCount}`);\n console.log(` Priority: ${result.data.priority}`);\n if (result.data.actionItems?.length > 0) {\n console.log(chalk.yellow('\\n Action Items:'));\n result.data.actionItems.forEach((item) => {\n console.log(` \u2022 ${item}`);\n });\n }\n }\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n\n await context.database.disconnect();\n } catch (error: unknown) {\n spinner.stop();\n console.error(chalk.red('Error:'), error.message);\n process.exit(1);\n }\n });\n\n // Checkpoint skill commands\n const checkpointCmd = skillsCmd\n .command('checkpoint')\n .description('Create and manage recovery points');\n\n checkpointCmd\n .command('create <description>')\n .description('Create a new checkpoint')\n .option('--files <files...>', 'Include specific files in checkpoint')\n .option('--auto-detect-risky', 'Auto-detect risky operations')\n .action(async (description, options) => {\n const spinner = ora('Creating checkpoint...').start();\n\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n\n const result = await unifiedOrchestrator.executeSkill(\n 'checkpoint',\n ['create', description],\n {\n includeFiles: options.files,\n autoDetectRisky: options.autoDetectRisky,\n }\n );\n\n spinner.stop();\n\n if (result.success) {\n console.log(chalk.green('\u2713'), result.message);\n if (result.data) {\n console.log(chalk.cyan('\\nCheckpoint Info:'));\n console.log(` ID: ${result.data.checkpointId}`);\n console.log(` Time: ${result.data.timestamp}`);\n console.log(` Frames: ${result.data.frameCount}`);\n }\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n\n await context.database.disconnect();\n } catch (error: unknown) {\n spinner.stop();\n console.error(chalk.red('Error:'), error.message);\n process.exit(1);\n }\n });\n\n checkpointCmd\n .command('restore <checkpointId>')\n .description('Restore from a checkpoint')\n .action(async (checkpointId) => {\n const spinner = ora('Restoring checkpoint...').start();\n\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n\n const result = await unifiedOrchestrator.executeSkill('checkpoint', [\n 'restore',\n checkpointId,\n ]);\n\n spinner.stop();\n\n if (result.success) {\n console.log(chalk.green('\u2713'), result.message);\n if (result.data) {\n console.log(chalk.cyan('\\nRestored:'));\n console.log(` Frames: ${result.data.frameCount}`);\n console.log(` Files: ${result.data.filesRestored}`);\n }\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n\n await context.database.disconnect();\n } catch (error: unknown) {\n spinner.stop();\n console.error(chalk.red('Error:'), error.message);\n process.exit(1);\n }\n });\n\n checkpointCmd\n .command('list')\n .description('List available checkpoints')\n .option('-l, --limit <number>', 'Limit number of results', '10')\n .option('-s, --since <date>', 'Show checkpoints since date')\n .action(async (options) => {\n const spinner = ora('Loading checkpoints...').start();\n\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n\n const result = await unifiedOrchestrator.executeSkill(\n 'checkpoint',\n ['list'],\n {\n limit: parseInt(options.limit),\n since: options.since ? new Date(options.since) : undefined,\n }\n );\n\n spinner.stop();\n\n if (result.success) {\n console.log(chalk.cyan('Available Checkpoints:\\n'));\n if (result.data && result.data.length > 0) {\n result.data.forEach((cp: any) => {\n const riskIndicator = cp.risky ? chalk.yellow(' [RISKY]') : '';\n console.log(`${chalk.bold(cp.id)}${riskIndicator}`);\n console.log(` ${cp.description}`);\n console.log(\n chalk.gray(` ${cp.timestamp} (${cp.frameCount} frames)\\n`)\n );\n });\n } else {\n console.log(chalk.gray('No checkpoints found'));\n }\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n\n await context.database.disconnect();\n } catch (error: unknown) {\n spinner.stop();\n console.error(chalk.red('Error:'), error.message);\n process.exit(1);\n }\n });\n\n checkpointCmd\n .command('diff <checkpoint1> <checkpoint2>')\n .description('Show differences between two checkpoints')\n .action(async (checkpoint1, checkpoint2) => {\n const spinner = ora('Comparing checkpoints...').start();\n\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n\n const result = await unifiedOrchestrator.executeSkill('checkpoint', [\n 'diff',\n checkpoint1,\n checkpoint2,\n ]);\n\n spinner.stop();\n\n if (result.success) {\n console.log(chalk.cyan('Checkpoint Diff:\\n'));\n if (result.data) {\n console.log(` Time difference: ${result.data.timeDiff}`);\n console.log(` Frame difference: ${result.data.framesDiff}`);\n console.log(` New frames: ${result.data.newFrames}`);\n console.log(` Removed frames: ${result.data.removedFrames}`);\n console.log(` Modified frames: ${result.data.modifiedFrames}`);\n }\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n\n await context.database.disconnect();\n } catch (error: unknown) {\n spinner.stop();\n console.error(chalk.red('Error:'), error.message);\n process.exit(1);\n }\n });\n\n // Context Archaeologist skill command\n skillsCmd\n .command('dig <query>')\n .description('Deep historical context retrieval')\n .option(\n '-d, --depth <depth>',\n 'Search depth (e.g., 30days, 6months, all)',\n '30days'\n )\n .option('--patterns', 'Extract patterns from results')\n .option('--decisions', 'Extract key decisions')\n .option('--timeline', 'Generate activity timeline')\n .action(async (query, options) => {\n const spinner = ora('Digging through context...').start();\n\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n\n const result = await unifiedOrchestrator.executeSkill('dig', [query], {\n depth: options.depth,\n patterns: options.patterns,\n decisions: options.decisions,\n timeline: options.timeline,\n });\n\n spinner.stop();\n\n if (result.success) {\n console.log(chalk.green('\u2713'), result.message);\n\n if (result.data) {\n console.log(\n chalk.cyan(\n `\\nSearched ${result.data.timeRange.from} to ${result.data.timeRange.to}`\n )\n );\n\n if (result.data.summary) {\n console.log('\\n' + result.data.summary);\n } else {\n // Display top results\n if (result.data.topResults?.length > 0) {\n console.log(chalk.cyan('\\nTop Results:'));\n result.data.topResults.forEach((r: any) => {\n console.log(\n ` ${chalk.yellow(`[${r.score.toFixed(2)}]`)} ${r.summary}`\n );\n });\n }\n\n // Display patterns if found\n if (result.data.patterns?.length > 0) {\n console.log(chalk.cyan('\\nDetected Patterns:'));\n result.data.patterns.forEach((p: any) => {\n console.log(` ${p.name}: ${p.count} occurrences`);\n });\n }\n\n // Display decisions if found\n if (result.data.decisions?.length > 0) {\n console.log(chalk.cyan('\\nKey Decisions:'));\n result.data.decisions.slice(0, 5).forEach((d: any) => {\n console.log(\n ` ${chalk.gray(new Date(d.timestamp).toLocaleDateString())}: ${d.decision}`\n );\n });\n }\n\n // Display timeline if generated\n if (result.data.timeline?.length > 0) {\n console.log(chalk.cyan('\\nActivity Timeline:'));\n result.data.timeline.slice(0, 5).forEach((t: any) => {\n console.log(` ${t.date}: ${t.itemCount} activities`);\n });\n }\n }\n }\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n\n await context.database.disconnect();\n } catch (error: unknown) {\n spinner.stop();\n console.error(chalk.red('Error:'), error.message);\n process.exit(1);\n }\n });\n\n // RLM (Recursive Language Model) skill command\n skillsCmd\n .command('rlm <task>')\n .description('Execute complex tasks with recursive agent orchestration')\n .option('--max-parallel <number>', 'Maximum concurrent subagents', '5')\n .option('--max-recursion <number>', 'Maximum recursion depth', '4')\n .option(\n '--max-tokens-per-agent <number>',\n 'Token budget per subagent',\n '30000'\n )\n .option('--review-stages <number>', 'Number of review iterations', '3')\n .option(\n '--quality-threshold <number>',\n 'Target quality score (0-1)',\n '0.85'\n )\n .option(\n '--test-mode <mode>',\n 'Test generation mode (unit/integration/e2e/all)',\n 'all'\n )\n .option('--verbose', 'Show all recursive operations', false)\n .option(\n '--share-context-realtime',\n 'Share discoveries between agents',\n true\n )\n .option('--retry-failed-agents', 'Retry on failure', true)\n .option('--timeout-per-agent <number>', 'Timeout in seconds', '300')\n .action(async (task, options) => {\n const spinner = ora('Initializing RLM orchestrator...').start();\n\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n\n spinner.text = 'Decomposing task...';\n\n const result = await unifiedOrchestrator.executeSkill('rlm', [task], {\n maxParallel: parseInt(options.maxParallel),\n maxRecursionDepth: parseInt(options.maxRecursion),\n maxTokensPerAgent: parseInt(options.maxTokensPerAgent),\n reviewStages: parseInt(options.reviewStages),\n qualityThreshold: parseFloat(options.qualityThreshold),\n testGenerationMode: options.testMode,\n verboseLogging: options.verbose,\n shareContextRealtime: options.shareContextRealtime,\n retryFailedAgents: options.retryFailedAgents,\n timeoutPerAgent: parseInt(options.timeoutPerAgent) * 1000,\n });\n\n spinner.stop();\n\n if (result.success) {\n console.log(chalk.green('\u2713'), 'RLM execution completed');\n\n if (result.data) {\n console.log(chalk.cyan('\\nExecution Summary:'));\n console.log(` Total tokens: ${result.data.totalTokens}`);\n console.log(\n ` Estimated cost: $${result.data.totalCost.toFixed(2)}`\n );\n console.log(` Duration: ${result.data.duration}ms`);\n console.log(` Tests generated: ${result.data.testsGenerated}`);\n console.log(` Issues found: ${result.data.issuesFound}`);\n console.log(` Issues fixed: ${result.data.issuesFixed}`);\n\n if (result.data.improvements?.length > 0) {\n console.log(chalk.cyan('\\nImprovements:'));\n result.data.improvements.forEach((imp: string) => {\n console.log(` \u2022 ${imp}`);\n });\n }\n }\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n\n await context.database.disconnect();\n } catch (error: unknown) {\n spinner.stop();\n console.error(chalk.red('Error:'), error.message);\n process.exit(1);\n }\n });\n\n // Help command for skills\n skillsCmd\n .command('help [skill]')\n .description('Show help for a specific skill')\n .action(async (skill) => {\n if (skill) {\n // Show specific skill help\n switch (skill) {\n case 'lint':\n console.log(`\nlint (RLM-Orchestrated)\nPrimary Agent: linting\nSecondary Agents: improve\n\nComprehensive linting of code: Check syntax, types, formatting, security, performance, and dead code. Provide fixes.\n\nThis skill is executed through RLM orchestration for:\n- Automatic task decomposition\n- Parallel agent execution\n- Multi-stage quality review\n- Comprehensive result aggregation\n\nUsage:\n stackmemory skills lint # Lint current directory\n stackmemory skills lint src/ # Lint specific directory\n stackmemory skills lint src/file.ts # Lint specific file\n\nOptions:\n --fix Automatically fix issues where possible\n --format Focus on formatting issues\n --security Focus on security vulnerabilities\n --performance Focus on performance issues\n --verbose Show detailed output\n`);\n break;\n default:\n console.log(\n `Unknown skill: ${skill}. Use \"stackmemory skills help\" to see all available skills.`\n );\n }\n } else {\n console.log(\n chalk.cyan('Available Claude Skills (RLM-Orchestrated):\\n')\n );\n console.log(\n ' handoff - Streamline frame handoffs between team members'\n );\n console.log(' checkpoint - Create and manage recovery points');\n console.log(' dig - Deep historical context retrieval');\n console.log(\n ' lint - Comprehensive code linting and quality checks'\n );\n console.log(' test - Generate comprehensive test suites');\n console.log(' review - Multi-stage code review and improvements');\n console.log(' refactor - Refactor code for better architecture');\n console.log(' publish - Prepare and execute releases');\n console.log(' rlm - Direct recursive agent orchestration\\n');\n console.log(\n chalk.yellow(\n '\\nAll skills now use RLM orchestration for intelligent task decomposition'\n )\n );\n console.log(\n 'Use \"stackmemory skills help <skill>\" for detailed help on each skill'\n );\n }\n });\n\n return skillsCmd;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;AAMA,SAAS,eAAe;AACxB,OAAO,WAAW;AAClB,OAAO,SAAS;AAKhB;AAAA,EAEE;AAAA,OACK;AACP,SAAS,wBAAwB;AACjC,SAAS,2BAA2B;AACpC,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB;AACjC,SAAS,qBAAqB;AAC9B,SAAS,yBAAyB;AAClC,SAAS,qBAAqB;AAC9B,YAAY,UAAU;AACtB,YAAY,QAAQ;AACpB;AAAA,EACE;AAAA,EACA;AAAA,EACA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/usr/bin/env node\n/**\n * Claude Skills CLI Commands\n * Integrates Claude skills into the stackmemory CLI\n */\n\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport ora from 'ora';\nimport {\n ClaudeSkillsManager,\n type SkillContext,\n} from '../../skills/claude-skills.js';\nimport {\n UnifiedRLMOrchestrator,\n initializeUnifiedOrchestrator,\n} from '../../skills/unified-rlm-orchestrator.js';\nimport { DualStackManager } from '../../core/context/dual-stack-manager.js';\nimport { FrameHandoffManager } from '../../core/context/frame-handoff-manager.js';\nimport { FrameManager } from '../../core/context/index.js';\nimport { ContextRetriever } from '../../core/retrieval/context-retriever.js';\nimport { SQLiteAdapter } from '../../core/database/sqlite-adapter.js';\nimport { LinearTaskManager } from '../../features/tasks/linear-task-manager.js';\nimport { ConfigManager } from '../../core/config/config-manager.js';\nimport * as path from 'path';\nimport * as os from 'os';\nimport {\n SystemError,\n DatabaseError,\n ErrorCode,\n} from '../../core/errors/index.js';\nimport { readFileSync } from 'fs';\nimport { fileURLToPath } from 'url';\n// VERSION is only used for verbose spike output \u2014 resolve lazily\nlet _version: string | undefined;\nfunction getVersion(): string {\n if (_version) return _version;\n try {\n const __dirname = path.dirname(fileURLToPath(import.meta.url));\n // Walk up to project root from src/cli/commands/ (or dist/src/cli/commands/)\n let dir = __dirname;\n for (let i = 0; i < 6; i++) {\n const candidate = path.join(dir, 'package.json');\n try {\n _version = JSON.parse(readFileSync(candidate, 'utf-8')).version;\n return _version!;\n } catch {\n dir = path.dirname(dir);\n }\n }\n } catch {\n // fallback\n }\n _version = '0.0.0';\n return _version;\n}\n\n// Type-safe environment variable access\nfunction getEnv(key: string, defaultValue?: string): string {\n const value = process.env[key];\n if (value === undefined) {\n if (defaultValue !== undefined) return defaultValue;\n throw new SystemError(\n `Environment variable ${key} is required`,\n ErrorCode.CONFIGURATION_ERROR,\n { variable: key }\n );\n }\n return value;\n}\n\nfunction getOptionalEnv(key: string): string | undefined {\n return process.env[key];\n}\n\nasync function initializeSkillContext(): Promise<{\n context: SkillContext;\n unifiedOrchestrator: UnifiedRLMOrchestrator;\n}> {\n const config = ConfigManager.getInstance();\n const projectId = config.get('project.id') || 'default-project';\n const userId = config.get('user.id') || process.env['USER'] || 'default';\n\n const dbPath = path.join(\n os.homedir(),\n '.stackmemory',\n 'data',\n projectId,\n 'stackmemory.db'\n );\n\n const database = new SQLiteAdapter(projectId, { dbPath });\n await database.connect();\n\n // Get raw database for FrameManager\n const rawDatabase = database.getRawDatabase();\n if (!rawDatabase) {\n throw new DatabaseError(\n 'Failed to get raw database connection',\n ErrorCode.DB_CONNECTION_FAILED,\n { projectId, operation: 'initializeSkillContext' }\n );\n }\n\n // Validate database has required methods\n if (typeof rawDatabase.exec !== 'function') {\n throw new DatabaseError(\n `Invalid database instance: missing exec() method. Got: ${typeof rawDatabase.exec}`,\n ErrorCode.DB_CONNECTION_FAILED,\n { projectId, operation: 'initializeSkillContext' }\n );\n }\n\n // Test database connectivity\n try {\n rawDatabase.exec('SELECT 1');\n } catch (err) {\n throw new DatabaseError(\n `Database connection test failed: ${(err as Error).message}`,\n ErrorCode.DB_CONNECTION_FAILED,\n { projectId, operation: 'initializeSkillContext' },\n err as Error\n );\n }\n\n const dualStackManager = new DualStackManager(database, projectId, userId);\n const handoffManager = new FrameHandoffManager(dualStackManager);\n const contextRetriever = new ContextRetriever(database);\n const frameManager = new FrameManager(rawDatabase, projectId);\n const taskStore = new LinearTaskManager();\n\n const context: SkillContext = {\n projectId,\n userId,\n dualStackManager,\n handoffManager,\n contextRetriever,\n database,\n frameManager,\n };\n\n // Initialize unified RLM orchestrator\n const unifiedOrchestrator = initializeUnifiedOrchestrator(\n frameManager,\n dualStackManager,\n contextRetriever,\n taskStore,\n context\n );\n\n return { context, unifiedOrchestrator };\n}\n\nexport function createSkillsCommand(): Command {\n const skillsCmd = new Command('skills').description(\n 'Execute Claude skills for enhanced workflow'\n );\n\n // Handoff skill command\n skillsCmd\n .command('handoff <targetUser> <message>')\n .description('Streamline frame handoffs between team members')\n .option(\n '-p, --priority <level>',\n 'Set priority (low, medium, high, critical)',\n 'medium'\n )\n .option('-f, --frames <frames...>', 'Specific frames to handoff')\n .option('--no-auto-detect', 'Disable auto-detection of frames')\n .action(async (targetUser, message, options) => {\n const spinner = ora('Initiating handoff...').start();\n\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n\n // Use unified RLM orchestrator for RLM-first execution\n const result = await unifiedOrchestrator.executeSkill(\n 'handoff',\n [targetUser, message],\n {\n priority: options.priority,\n frames: options.frames,\n autoDetect: options.autoDetect !== false,\n }\n );\n\n spinner.stop();\n\n if (result.success) {\n console.log(chalk.green('\u2713'), result.message);\n if (result.data) {\n console.log(chalk.cyan('\\nHandoff Details:'));\n console.log(` ID: ${result.data.handoffId}`);\n console.log(` Frames: ${result.data.frameCount}`);\n console.log(` Priority: ${result.data.priority}`);\n if (result.data.actionItems?.length > 0) {\n console.log(chalk.yellow('\\n Action Items:'));\n result.data.actionItems.forEach((item) => {\n console.log(` \u2022 ${item}`);\n });\n }\n }\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n\n await context.database.disconnect();\n } catch (error: unknown) {\n spinner.stop();\n console.error(chalk.red('Error:'), error.message);\n process.exit(1);\n }\n });\n\n // Checkpoint skill commands\n const checkpointCmd = skillsCmd\n .command('checkpoint')\n .description('Create and manage recovery points');\n\n checkpointCmd\n .command('create <description>')\n .description('Create a new checkpoint')\n .option('--files <files...>', 'Include specific files in checkpoint')\n .option('--auto-detect-risky', 'Auto-detect risky operations')\n .action(async (description, options) => {\n const spinner = ora('Creating checkpoint...').start();\n\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n\n const result = await unifiedOrchestrator.executeSkill(\n 'checkpoint',\n ['create', description],\n {\n includeFiles: options.files,\n autoDetectRisky: options.autoDetectRisky,\n }\n );\n\n spinner.stop();\n\n if (result.success) {\n console.log(chalk.green('\u2713'), result.message);\n if (result.data) {\n console.log(chalk.cyan('\\nCheckpoint Info:'));\n console.log(` ID: ${result.data.checkpointId}`);\n console.log(` Time: ${result.data.timestamp}`);\n console.log(` Frames: ${result.data.frameCount}`);\n }\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n\n await context.database.disconnect();\n } catch (error: unknown) {\n spinner.stop();\n console.error(chalk.red('Error:'), error.message);\n process.exit(1);\n }\n });\n\n checkpointCmd\n .command('restore <checkpointId>')\n .description('Restore from a checkpoint')\n .action(async (checkpointId) => {\n const spinner = ora('Restoring checkpoint...').start();\n\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n\n const result = await unifiedOrchestrator.executeSkill('checkpoint', [\n 'restore',\n checkpointId,\n ]);\n\n spinner.stop();\n\n if (result.success) {\n console.log(chalk.green('\u2713'), result.message);\n if (result.data) {\n console.log(chalk.cyan('\\nRestored:'));\n console.log(` Frames: ${result.data.frameCount}`);\n console.log(` Files: ${result.data.filesRestored}`);\n }\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n\n await context.database.disconnect();\n } catch (error: unknown) {\n spinner.stop();\n console.error(chalk.red('Error:'), error.message);\n process.exit(1);\n }\n });\n\n checkpointCmd\n .command('list')\n .description('List available checkpoints')\n .option('-l, --limit <number>', 'Limit number of results', '10')\n .option('-s, --since <date>', 'Show checkpoints since date')\n .action(async (options) => {\n const spinner = ora('Loading checkpoints...').start();\n\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n\n const result = await unifiedOrchestrator.executeSkill(\n 'checkpoint',\n ['list'],\n {\n limit: parseInt(options.limit),\n since: options.since ? new Date(options.since) : undefined,\n }\n );\n\n spinner.stop();\n\n if (result.success) {\n console.log(chalk.cyan('Available Checkpoints:\\n'));\n if (result.data && result.data.length > 0) {\n result.data.forEach((cp: any) => {\n const riskIndicator = cp.risky ? chalk.yellow(' [RISKY]') : '';\n console.log(`${chalk.bold(cp.id)}${riskIndicator}`);\n console.log(` ${cp.description}`);\n console.log(\n chalk.gray(` ${cp.timestamp} (${cp.frameCount} frames)\\n`)\n );\n });\n } else {\n console.log(chalk.gray('No checkpoints found'));\n }\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n\n await context.database.disconnect();\n } catch (error: unknown) {\n spinner.stop();\n console.error(chalk.red('Error:'), error.message);\n process.exit(1);\n }\n });\n\n checkpointCmd\n .command('diff <checkpoint1> <checkpoint2>')\n .description('Show differences between two checkpoints')\n .action(async (checkpoint1, checkpoint2) => {\n const spinner = ora('Comparing checkpoints...').start();\n\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n\n const result = await unifiedOrchestrator.executeSkill('checkpoint', [\n 'diff',\n checkpoint1,\n checkpoint2,\n ]);\n\n spinner.stop();\n\n if (result.success) {\n console.log(chalk.cyan('Checkpoint Diff:\\n'));\n if (result.data) {\n console.log(` Time difference: ${result.data.timeDiff}`);\n console.log(` Frame difference: ${result.data.framesDiff}`);\n console.log(` New frames: ${result.data.newFrames}`);\n console.log(` Removed frames: ${result.data.removedFrames}`);\n console.log(` Modified frames: ${result.data.modifiedFrames}`);\n }\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n\n await context.database.disconnect();\n } catch (error: unknown) {\n spinner.stop();\n console.error(chalk.red('Error:'), error.message);\n process.exit(1);\n }\n });\n\n // Multi-modal spike (planner/implementer/critic)\n skillsCmd\n .command('spike')\n .description(\n 'Run multi-agent spike (planner: Claude, implementer: Codex/Claude, critic: Claude)'\n )\n .option('-t, --task <desc>', 'Task description', 'Spike harness')\n .option(\n '--planner-model <name>',\n 'Claude model for planning',\n 'claude-sonnet-4-20250514'\n )\n .option(\n '--reviewer-model <name>',\n 'Claude model for review',\n 'claude-sonnet-4-20250514'\n )\n .option('--implementer <name>', 'codex|claude', 'codex')\n .option('--max-iters <n>', 'Retry loop iterations', '2')\n .option(\n '--execute',\n 'Execute implementer (codex-sm) instead of dry-run',\n false\n )\n .option('--audit-dir <path>', 'Persist spike results to directory')\n .option('--record-frame', 'Record as real frame with anchors', false)\n .option(\n '--record',\n 'Record plan & critique into StackMemory context',\n false\n )\n .option('--json', 'Emit single JSON result (UI-friendly)', false)\n .option('--quiet', 'Minimal output (default)', true)\n .option('--verbose', 'Verbose sectioned output', false)\n .action(async (options) => {\n const spinner = ora('Planning with Claude...').start();\n\n try {\n const { runSpike } =\n await import('../../orchestrators/multimodal/harness.js');\n const result = await runSpike(\n {\n task: options.task,\n repoPath: process.cwd(),\n },\n {\n plannerModel: options.plannerModel,\n reviewerModel: options.reviewerModel,\n implementer: options.implementer,\n maxIters: parseInt(options.maxIters),\n dryRun: !options.execute,\n auditDir: options.auditDir,\n recordFrame: Boolean(options.recordFrame),\n record: Boolean(options.record),\n }\n );\n\n spinner.stop();\n\n if (options.json) {\n console.log(JSON.stringify(result));\n } else if (options.verbose) {\n console.log(chalk.gray(`StackMemory v${getVersion()}`));\n console.log(chalk.cyan('\\n=== Plan ==='));\n console.log(JSON.stringify(result.plan, null, 2));\n console.log(chalk.cyan('\\n=== Iterations ==='));\n (result.iterations || []).forEach((it, idx) => {\n console.log(chalk.gray(`\\n-- Attempt ${idx + 1} --`));\n console.log(`Command: ${it.command}`);\n console.log(`OK: ${it.ok}`);\n console.log('Critique:', JSON.stringify(it.critique));\n });\n console.log(chalk.cyan('\\n=== Final ==='));\n console.log(JSON.stringify(result.implementation, null, 2));\n console.log(chalk.cyan('\\n=== Critique ==='));\n console.log(JSON.stringify(result.critique, null, 2));\n } else if (!options.quiet) {\n console.log(\n `Plan steps: ${result.plan.steps.length}, Approved: ${result.critique.approved}`\n );\n }\n\n if (!result.implementation.success) process.exitCode = 1;\n } catch (error: any) {\n spinner.stop();\n console.error(chalk.red('Spike failed:'), error?.message || error);\n process.exit(1);\n }\n });\n\n // Context Archaeologist skill command\n // Lightweight planning helper\n skillsCmd\n .command('plan <task>')\n .description('Generate an implementation plan (no code execution)')\n .option(\n '--planner-model <name>',\n 'Claude model for planning',\n 'claude-sonnet-4-20250514'\n )\n .option('--json', 'Emit JSON (default)', true)\n .option('--pretty', 'Pretty-print JSON', false)\n .option(\n '--compact',\n 'Compact output (summary + step titles + criteria)',\n false\n )\n .action(async (task, options) => {\n const spinner = ora('Planning with Claude...').start();\n try {\n const { runPlanOnly } =\n await import('../../orchestrators/multimodal/harness.js');\n const plan = await runPlanOnly(\n { task, repoPath: process.cwd() },\n { plannerModel: options.plannerModel }\n );\n spinner.stop();\n const compacted = options.compact\n ? {\n summary: plan?.summary,\n steps: Array.isArray((plan as any)?.steps)\n ? (plan as any).steps.map((s: any) => ({\n id: s.id,\n title: s.title,\n acceptanceCriteria: s.acceptanceCriteria,\n }))\n : [],\n risks: (plan as any)?.risks,\n }\n : plan;\n const payload = JSON.stringify(compacted, null, options.pretty ? 2 : 0);\n console.log(payload);\n } catch (error: any) {\n spinner.stop();\n console.error(chalk.red('Plan failed:'), error?.message || error);\n process.exit(1);\n }\n });\n\n skillsCmd\n .command('dig <query>')\n .description('Deep historical context retrieval')\n .option(\n '-d, --depth <depth>',\n 'Search depth (e.g., 30days, 6months, all)',\n '30days'\n )\n .option('--patterns', 'Extract patterns from results')\n .option('--decisions', 'Extract key decisions')\n .option('--timeline', 'Generate activity timeline')\n .action(async (query, options) => {\n const spinner = ora('Digging through context...').start();\n\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n\n const result = await unifiedOrchestrator.executeSkill('dig', [query], {\n depth: options.depth,\n patterns: options.patterns,\n decisions: options.decisions,\n timeline: options.timeline,\n });\n\n spinner.stop();\n\n if (result.success) {\n console.log(chalk.green('\u2713'), result.message);\n\n if (result.data) {\n console.log(\n chalk.cyan(\n `\\nSearched ${result.data.timeRange.from} to ${result.data.timeRange.to}`\n )\n );\n\n if (result.data.summary) {\n console.log('\\n' + result.data.summary);\n } else {\n // Display top results\n if (result.data.topResults?.length > 0) {\n console.log(chalk.cyan('\\nTop Results:'));\n result.data.topResults.forEach((r: any) => {\n console.log(\n ` ${chalk.yellow(`[${r.score.toFixed(2)}]`)} ${r.summary}`\n );\n });\n }\n\n // Display patterns if found\n if (result.data.patterns?.length > 0) {\n console.log(chalk.cyan('\\nDetected Patterns:'));\n result.data.patterns.forEach((p: any) => {\n console.log(` ${p.name}: ${p.count} occurrences`);\n });\n }\n\n // Display decisions if found\n if (result.data.decisions?.length > 0) {\n console.log(chalk.cyan('\\nKey Decisions:'));\n result.data.decisions.slice(0, 5).forEach((d: any) => {\n console.log(\n ` ${chalk.gray(new Date(d.timestamp).toLocaleDateString())}: ${d.decision}`\n );\n });\n }\n\n // Display timeline if generated\n if (result.data.timeline?.length > 0) {\n console.log(chalk.cyan('\\nActivity Timeline:'));\n result.data.timeline.slice(0, 5).forEach((t: any) => {\n console.log(` ${t.date}: ${t.itemCount} activities`);\n });\n }\n }\n }\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n\n await context.database.disconnect();\n } catch (error: unknown) {\n spinner.stop();\n console.error(chalk.red('Error:'), error.message);\n process.exit(1);\n }\n });\n\n // RLM (Recursive Language Model) skill command\n skillsCmd\n .command('rlm <task>')\n .description('Execute complex tasks with recursive agent orchestration')\n .option('--max-parallel <number>', 'Maximum concurrent subagents', '5')\n .option('--max-recursion <number>', 'Maximum recursion depth', '4')\n .option(\n '--max-tokens-per-agent <number>',\n 'Token budget per subagent',\n '30000'\n )\n .option('--review-stages <number>', 'Number of review iterations', '3')\n .option(\n '--quality-threshold <number>',\n 'Target quality score (0-1)',\n '0.85'\n )\n .option(\n '--test-mode <mode>',\n 'Test generation mode (unit/integration/e2e/all)',\n 'all'\n )\n .option('--verbose', 'Show all recursive operations', false)\n .option(\n '--share-context-realtime',\n 'Share discoveries between agents',\n true\n )\n .option('--retry-failed-agents', 'Retry on failure', true)\n .option('--timeout-per-agent <number>', 'Timeout in seconds', '300')\n .action(async (task, options) => {\n const spinner = ora('Initializing RLM orchestrator...').start();\n\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n\n spinner.text = 'Decomposing task...';\n\n const result = await unifiedOrchestrator.executeSkill('rlm', [task], {\n maxParallel: parseInt(options.maxParallel),\n maxRecursionDepth: parseInt(options.maxRecursion),\n maxTokensPerAgent: parseInt(options.maxTokensPerAgent),\n reviewStages: parseInt(options.reviewStages),\n qualityThreshold: parseFloat(options.qualityThreshold),\n testGenerationMode: options.testMode,\n verboseLogging: options.verbose,\n shareContextRealtime: options.shareContextRealtime,\n retryFailedAgents: options.retryFailedAgents,\n timeoutPerAgent: parseInt(options.timeoutPerAgent) * 1000,\n });\n\n spinner.stop();\n\n if (result.success) {\n console.log(chalk.green('\u2713'), 'RLM execution completed');\n\n if (result.data) {\n console.log(chalk.cyan('\\nExecution Summary:'));\n console.log(` Total tokens: ${result.data.totalTokens}`);\n console.log(\n ` Estimated cost: $${result.data.totalCost.toFixed(2)}`\n );\n console.log(` Duration: ${result.data.duration}ms`);\n console.log(` Tests generated: ${result.data.testsGenerated}`);\n console.log(` Issues found: ${result.data.issuesFound}`);\n console.log(` Issues fixed: ${result.data.issuesFixed}`);\n\n if (result.data.improvements?.length > 0) {\n console.log(chalk.cyan('\\nImprovements:'));\n result.data.improvements.forEach((imp: string) => {\n console.log(` \u2022 ${imp}`);\n });\n }\n }\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n\n await context.database.disconnect();\n } catch (error: unknown) {\n spinner.stop();\n console.error(chalk.red('Error:'), error.message);\n process.exit(1);\n }\n });\n\n // Spec generator skill\n const specCmd = skillsCmd\n .command('spec')\n .description('Generate iterative spec documents');\n\n specCmd\n .command('generate <type> <title>')\n .description(\n 'Generate a spec document (one-pager, dev-spec, prompt-plan, agents)'\n )\n .action(async (type, title) => {\n const spinner = ora(`Generating ${type}...`).start();\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n const result = await unifiedOrchestrator.executeSkill(\n 'spec',\n ['generate', type, title],\n {}\n );\n spinner.stop();\n if (result.success) {\n console.log(chalk.green('\u2713'), result.message);\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n await context.database.disconnect();\n } catch (error: unknown) {\n spinner.stop();\n console.error(chalk.red('Error:'), (error as Error).message);\n process.exit(1);\n }\n });\n\n specCmd\n .command('list')\n .description('List existing spec documents')\n .action(async () => {\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n const result = await unifiedOrchestrator.executeSkill(\n 'spec',\n ['list'],\n {}\n );\n if (result.success) {\n console.log(chalk.green('\u2713'), result.message);\n if (result.data) {\n console.log(JSON.stringify(result.data, null, 2));\n }\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n await context.database.disconnect();\n } catch (error: unknown) {\n console.error(chalk.red('Error:'), (error as Error).message);\n process.exit(1);\n }\n });\n\n specCmd\n .command('validate <path>')\n .description('Validate spec document completeness')\n .action(async (filePath) => {\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n const result = await unifiedOrchestrator.executeSkill(\n 'spec',\n ['validate', filePath],\n {}\n );\n if (result.success) {\n console.log(chalk.green('\u2713'), result.message);\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n await context.database.disconnect();\n } catch (error: unknown) {\n console.error(chalk.red('Error:'), (error as Error).message);\n process.exit(1);\n }\n });\n\n // Linear task runner skill\n const linearRunCmd = skillsCmd\n .command('linear-run')\n .description('Execute Linear tasks via RLM orchestrator');\n\n linearRunCmd\n .command('next')\n .description('Execute the next highest-priority Linear task')\n .option('--priority <level>', 'Filter by priority')\n .option('--tag <tag>', 'Filter by tag')\n .option('--dry-run', 'Preview without executing')\n .action(async (options) => {\n const spinner = ora('Fetching next task...').start();\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n const result = await unifiedOrchestrator.executeSkill(\n 'linear-run',\n ['next'],\n {\n priority: options.priority,\n tag: options.tag,\n dryRun: options.dryRun,\n }\n );\n spinner.stop();\n if (result.success) {\n console.log(chalk.green('\u2713'), result.message);\n if (result.data) {\n console.log(JSON.stringify(result.data, null, 2));\n }\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n await context.database.disconnect();\n } catch (error: unknown) {\n spinner.stop();\n console.error(chalk.red('Error:'), (error as Error).message);\n process.exit(1);\n }\n });\n\n linearRunCmd\n .command('all')\n .description('Execute all active Linear tasks iteratively')\n .option('--max-concurrent <n>', 'Max concurrent tasks', '1')\n .option('--dry-run', 'Preview without executing')\n .action(async (options) => {\n const spinner = ora('Running all tasks...').start();\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n const result = await unifiedOrchestrator.executeSkill(\n 'linear-run',\n ['all'],\n {\n maxConcurrent: parseInt(options.maxConcurrent),\n dryRun: options.dryRun,\n }\n );\n spinner.stop();\n if (result.success) {\n console.log(chalk.green('\u2713'), result.message);\n if (result.data) {\n console.log(JSON.stringify(result.data, null, 2));\n }\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n await context.database.disconnect();\n } catch (error: unknown) {\n spinner.stop();\n console.error(chalk.red('Error:'), (error as Error).message);\n process.exit(1);\n }\n });\n\n linearRunCmd\n .command('task <taskId>')\n .description('Execute a specific Linear task by ID')\n .action(async (taskId) => {\n const spinner = ora(`Executing task ${taskId}...`).start();\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n const result = await unifiedOrchestrator.executeSkill(\n 'linear-run',\n ['task', taskId],\n {}\n );\n spinner.stop();\n if (result.success) {\n console.log(chalk.green('\u2713'), result.message);\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n await context.database.disconnect();\n } catch (error: unknown) {\n spinner.stop();\n console.error(chalk.red('Error:'), (error as Error).message);\n process.exit(1);\n }\n });\n\n linearRunCmd\n .command('preview [taskId]')\n .description('Show execution plan without running')\n .action(async (taskId) => {\n try {\n const { context, unifiedOrchestrator } = await initializeSkillContext();\n const result = await unifiedOrchestrator.executeSkill(\n 'linear-run',\n ['preview', taskId || ''],\n {}\n );\n if (result.success) {\n console.log(chalk.green('\u2713'), result.message);\n if (result.data) {\n console.log(JSON.stringify(result.data, null, 2));\n }\n } else {\n console.log(chalk.red('\u2717'), result.message);\n }\n await context.database.disconnect();\n } catch (error: unknown) {\n console.error(chalk.red('Error:'), (error as Error).message);\n process.exit(1);\n }\n });\n\n // Help command for skills\n skillsCmd\n .command('help [skill]')\n .description('Show help for a specific skill')\n .action(async (skill) => {\n if (skill) {\n // Show specific skill help\n switch (skill) {\n case 'lint':\n console.log(`\nlint (RLM-Orchestrated)\nPrimary Agent: linting\nSecondary Agents: improve\n\nComprehensive linting of code: Check syntax, types, formatting, security, performance, and dead code. Provide fixes.\n\nThis skill is executed through RLM orchestration for:\n- Automatic task decomposition\n- Parallel agent execution\n- Multi-stage quality review\n- Comprehensive result aggregation\n\nUsage:\n stackmemory skills lint # Lint current directory\n stackmemory skills lint src/ # Lint specific directory\n stackmemory skills lint src/file.ts # Lint specific file\n\nOptions:\n --fix Automatically fix issues where possible\n --format Focus on formatting issues\n --security Focus on security vulnerabilities\n --performance Focus on performance issues\n --verbose Show detailed output\n`);\n break;\n default:\n console.log(\n `Unknown skill: ${skill}. Use \"stackmemory skills help\" to see all available skills.`\n );\n }\n } else {\n console.log(\n chalk.cyan('Available Claude Skills (RLM-Orchestrated):\\n')\n );\n console.log(\n ' handoff - Streamline frame handoffs between team members'\n );\n console.log(' checkpoint - Create and manage recovery points');\n console.log(' dig - Deep historical context retrieval');\n console.log(\n ' lint - Comprehensive code linting and quality checks'\n );\n console.log(' test - Generate comprehensive test suites');\n console.log(' review - Multi-stage code review and improvements');\n console.log(' refactor - Refactor code for better architecture');\n console.log(' publish - Prepare and execute releases');\n console.log(' rlm - Direct recursive agent orchestration');\n console.log(\n ' spec - Generate iterative spec docs (one-pager, dev-spec, prompt-plan, agents)'\n );\n console.log(\n ' linear-run - Execute Linear tasks via RLM orchestrator\\n'\n );\n console.log(\n chalk.yellow(\n '\\nAll skills now use RLM orchestration for intelligent task decomposition'\n )\n );\n console.log(\n 'Use \"stackmemory skills help <skill>\" for detailed help on each skill'\n );\n }\n });\n\n return skillsCmd;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAMA,SAAS,eAAe;AACxB,OAAO,WAAW;AAClB,OAAO,SAAS;AAKhB;AAAA,EAEE;AAAA,OACK;A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