@stackmemoryai/stackmemory 0.5.59 → 0.5.62
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 +105 -1
- package/dist/scripts/initialize.js +68 -1
- package/dist/scripts/initialize.js.map +2 -2
- package/dist/src/cli/claude-sm.js +130 -50
- package/dist/src/cli/claude-sm.js.map +2 -2
- package/dist/src/cli/index.js +18 -3
- package/dist/src/cli/index.js.map +3 -3
- package/dist/src/core/extensions/custom-tools.js +567 -0
- package/dist/src/core/extensions/custom-tools.js.map +7 -0
- package/dist/src/core/extensions/index.js +55 -0
- package/dist/src/core/extensions/index.js.map +7 -0
- package/dist/src/core/extensions/loader.js +709 -0
- package/dist/src/core/extensions/loader.js.map +7 -0
- package/dist/src/core/extensions/plugin-system.js +506 -0
- package/dist/src/core/extensions/plugin-system.js.map +7 -0
- package/dist/src/core/extensions/provider-adapter.js +617 -0
- package/dist/src/core/extensions/provider-adapter.js.map +7 -0
- package/dist/src/core/extensions/sandbox-runtime.js +664 -0
- package/dist/src/core/extensions/sandbox-runtime.js.map +7 -0
- package/dist/src/core/retrieval/index.js +2 -0
- package/dist/src/core/retrieval/index.js.map +2 -2
- package/dist/src/core/retrieval/privacy-filter.js +129 -0
- package/dist/src/core/retrieval/privacy-filter.js.map +7 -0
- package/dist/src/core/retrieval/unified-context-assembler.js +273 -0
- package/dist/src/core/retrieval/unified-context-assembler.js.map +7 -0
- package/dist/src/core/storage/chromadb-adapter.js +32 -6
- package/dist/src/core/storage/chromadb-adapter.js.map +2 -2
- package/dist/src/hooks/diffmem-hooks.js +377 -0
- package/dist/src/hooks/diffmem-hooks.js.map +7 -0
- package/dist/src/integrations/diffmem/client.js +209 -0
- package/dist/src/integrations/diffmem/client.js.map +7 -0
- package/dist/src/integrations/diffmem/config.js +15 -0
- package/dist/src/integrations/diffmem/config.js.map +7 -0
- package/dist/{core/session → src/integrations/diffmem}/index.js +5 -8
- package/dist/src/integrations/diffmem/index.js.map +7 -0
- package/dist/src/integrations/mcp/handlers/diffmem-handlers.js +456 -0
- package/dist/src/integrations/mcp/handlers/diffmem-handlers.js.map +7 -0
- package/dist/src/integrations/mcp/server.js +121 -0
- package/dist/src/integrations/mcp/server.js.map +2 -2
- package/dist/src/skills/repo-ingestion-skill.js +35 -12
- package/dist/src/skills/repo-ingestion-skill.js.map +2 -2
- package/package.json +13 -7
- package/scripts/background-sync-manager.js +145 -83
- package/scripts/claude-sm-autostart.js +17 -12
- package/scripts/gepa/README.md +275 -0
- package/scripts/gepa/config.json +53 -0
- package/scripts/gepa/evals/coding-tasks.jsonl +5 -0
- package/scripts/gepa/evals/fixtures/buggy-loop.js +18 -0
- package/scripts/gepa/evals/fixtures/callback-hell.js +53 -0
- package/scripts/gepa/generations/gen-000/baseline.md +124 -0
- package/scripts/gepa/hooks/auto-optimize.js +494 -0
- package/scripts/gepa/hooks/eval-tracker.js +203 -0
- package/scripts/gepa/hooks/reflect.js +311 -0
- package/scripts/gepa/optimize.js +611 -0
- package/scripts/gepa/state.json +14 -0
- package/scripts/initialize.ts +83 -1
- package/scripts/test-pre-publish-quick.sh +1 -1
- package/dist/agents/core/agent-task-manager.js +0 -527
- package/dist/agents/core/agent-task-manager.js.map +0 -7
- package/dist/agents/testing-agent.js +0 -614
- package/dist/agents/testing-agent.js.map +0 -7
- package/dist/agents/verifiers/base-verifier.js +0 -133
- package/dist/agents/verifiers/base-verifier.js.map +0 -7
- package/dist/agents/verifiers/formatter-verifier.js +0 -130
- package/dist/agents/verifiers/formatter-verifier.js.map +0 -7
- package/dist/agents/verifiers/llm-judge.js +0 -252
- package/dist/agents/verifiers/llm-judge.js.map +0 -7
- package/dist/cli/auto-detect.js +0 -321
- package/dist/cli/auto-detect.js.map +0 -7
- package/dist/cli/browser-test.js +0 -33
- package/dist/cli/browser-test.js.map +0 -7
- package/dist/cli/claude-sm-danger.js +0 -21
- package/dist/cli/claude-sm-danger.js.map +0 -7
- package/dist/cli/claude-sm.js +0 -1156
- package/dist/cli/claude-sm.js.map +0 -7
- package/dist/cli/codex-sm-danger.js +0 -21
- package/dist/cli/codex-sm-danger.js.map +0 -7
- package/dist/cli/codex-sm.js +0 -349
- package/dist/cli/codex-sm.js.map +0 -7
- package/dist/cli/commands/api.js +0 -232
- package/dist/cli/commands/api.js.map +0 -7
- package/dist/cli/commands/auto-background.js +0 -180
- package/dist/cli/commands/auto-background.js.map +0 -7
- package/dist/cli/commands/cleanup-processes.js +0 -68
- package/dist/cli/commands/cleanup-processes.js.map +0 -7
- package/dist/cli/commands/clear.js +0 -202
- package/dist/cli/commands/clear.js.map +0 -7
- package/dist/cli/commands/config.js +0 -445
- package/dist/cli/commands/config.js.map +0 -7
- package/dist/cli/commands/context-rehydrate.js +0 -751
- package/dist/cli/commands/context-rehydrate.js.map +0 -7
- package/dist/cli/commands/context.js +0 -343
- package/dist/cli/commands/context.js.map +0 -7
- package/dist/cli/commands/daemon.js +0 -392
- package/dist/cli/commands/daemon.js.map +0 -7
- package/dist/cli/commands/dashboard.js +0 -210
- package/dist/cli/commands/dashboard.js.map +0 -7
- package/dist/cli/commands/db.js +0 -147
- package/dist/cli/commands/db.js.map +0 -7
- package/dist/cli/commands/decision.js +0 -266
- package/dist/cli/commands/decision.js.map +0 -7
- package/dist/cli/commands/discovery.js +0 -279
- package/dist/cli/commands/discovery.js.map +0 -7
- package/dist/cli/commands/handoff.js +0 -624
- package/dist/cli/commands/handoff.js.map +0 -7
- package/dist/cli/commands/hooks.js +0 -298
- package/dist/cli/commands/hooks.js.map +0 -7
- package/dist/cli/commands/linear-unified.js +0 -353
- package/dist/cli/commands/linear-unified.js.map +0 -7
- package/dist/cli/commands/linear.js +0 -529
- package/dist/cli/commands/linear.js.map +0 -7
- package/dist/cli/commands/log.js +0 -169
- package/dist/cli/commands/log.js.map +0 -7
- package/dist/cli/commands/login.js +0 -172
- package/dist/cli/commands/login.js.map +0 -7
- package/dist/cli/commands/migrate.js +0 -240
- package/dist/cli/commands/migrate.js.map +0 -7
- package/dist/cli/commands/model.js +0 -533
- package/dist/cli/commands/model.js.map +0 -7
- package/dist/cli/commands/monitor.js +0 -313
- package/dist/cli/commands/monitor.js.map +0 -7
- package/dist/cli/commands/onboard.js +0 -536
- package/dist/cli/commands/onboard.js.map +0 -7
- package/dist/cli/commands/projects.js +0 -199
- package/dist/cli/commands/projects.js.map +0 -7
- package/dist/cli/commands/quality.js +0 -413
- package/dist/cli/commands/quality.js.map +0 -7
- package/dist/cli/commands/ralph.js +0 -909
- package/dist/cli/commands/ralph.js.map +0 -7
- package/dist/cli/commands/retrieval.js +0 -248
- package/dist/cli/commands/retrieval.js.map +0 -7
- package/dist/cli/commands/search.js +0 -173
- package/dist/cli/commands/search.js.map +0 -7
- package/dist/cli/commands/service.js +0 -749
- package/dist/cli/commands/service.js.map +0 -7
- package/dist/cli/commands/session.js +0 -200
- package/dist/cli/commands/session.js.map +0 -7
- package/dist/cli/commands/settings.js +0 -306
- package/dist/cli/commands/settings.js.map +0 -7
- package/dist/cli/commands/setup.js +0 -701
- package/dist/cli/commands/setup.js.map +0 -7
- package/dist/cli/commands/shell.js +0 -249
- package/dist/cli/commands/shell.js.map +0 -7
- package/dist/cli/commands/signup.js +0 -50
- package/dist/cli/commands/signup.js.map +0 -7
- package/dist/cli/commands/skills.js +0 -470
- package/dist/cli/commands/skills.js.map +0 -7
- package/dist/cli/commands/sms-notify.js +0 -795
- package/dist/cli/commands/sms-notify.js.map +0 -7
- package/dist/cli/commands/storage-tier.js +0 -183
- package/dist/cli/commands/storage-tier.js.map +0 -7
- package/dist/cli/commands/storage.js +0 -360
- package/dist/cli/commands/storage.js.map +0 -7
- package/dist/cli/commands/sweep.js +0 -249
- package/dist/cli/commands/sweep.js.map +0 -7
- package/dist/cli/commands/tasks.js +0 -213
- package/dist/cli/commands/tasks.js.map +0 -7
- package/dist/cli/commands/test.js +0 -286
- package/dist/cli/commands/test.js.map +0 -7
- package/dist/cli/commands/workflow.js +0 -142
- package/dist/cli/commands/workflow.js.map +0 -7
- package/dist/cli/commands/worktree.js +0 -319
- package/dist/cli/commands/worktree.js.map +0 -7
- package/dist/cli/index.js +0 -594
- package/dist/cli/index.js.map +0 -7
- package/dist/cli/opencode-sm.js +0 -448
- package/dist/cli/opencode-sm.js.map +0 -7
- package/dist/cli/utils/viewer.js +0 -96
- package/dist/cli/utils/viewer.js.map +0 -7
- package/dist/core/analytics/team-analytics.js +0 -378
- package/dist/core/analytics/team-analytics.js.map +0 -7
- package/dist/core/config/config-manager.js +0 -398
- package/dist/core/config/config-manager.js.map +0 -7
- package/dist/core/config/feature-flags.js +0 -76
- package/dist/core/config/feature-flags.js.map +0 -7
- package/dist/core/config/storage-config.js +0 -115
- package/dist/core/config/storage-config.js.map +0 -7
- package/dist/core/config/types.js +0 -144
- package/dist/core/config/types.js.map +0 -7
- package/dist/core/context/auto-context.js +0 -80
- package/dist/core/context/auto-context.js.map +0 -7
- package/dist/core/context/dual-stack-manager.js +0 -870
- package/dist/core/context/dual-stack-manager.js.map +0 -7
- package/dist/core/context/enhanced-rehydration.js +0 -994
- package/dist/core/context/enhanced-rehydration.js.map +0 -7
- package/dist/core/context/frame-database.js +0 -479
- package/dist/core/context/frame-database.js.map +0 -7
- package/dist/core/context/frame-digest.js +0 -250
- package/dist/core/context/frame-digest.js.map +0 -7
- package/dist/core/context/frame-handoff-manager.js +0 -778
- package/dist/core/context/frame-handoff-manager.js.map +0 -7
- package/dist/core/context/frame-lifecycle-hooks.js +0 -119
- package/dist/core/context/frame-lifecycle-hooks.js.map +0 -7
- package/dist/core/context/frame-manager.js +0 -1069
- package/dist/core/context/frame-manager.js.map +0 -7
- package/dist/core/context/frame-recovery.js +0 -302
- package/dist/core/context/frame-recovery.js.map +0 -7
- package/dist/core/context/frame-stack.js +0 -314
- package/dist/core/context/frame-stack.js.map +0 -7
- package/dist/core/context/frame-types.js +0 -5
- package/dist/core/context/frame-types.js.map +0 -7
- package/dist/core/context/incremental-gc.js +0 -290
- package/dist/core/context/incremental-gc.js.map +0 -7
- package/dist/core/context/index.js +0 -25
- package/dist/core/context/index.js.map +0 -7
- package/dist/core/context/model-aware-compaction.js +0 -623
- package/dist/core/context/model-aware-compaction.js.map +0 -7
- package/dist/core/context/permission-manager.js +0 -185
- package/dist/core/context/permission-manager.js.map +0 -7
- package/dist/core/context/recursive-context-manager.js +0 -592
- package/dist/core/context/recursive-context-manager.js.map +0 -7
- package/dist/core/context/refactored-frame-manager.js +0 -754
- package/dist/core/context/refactored-frame-manager.js.map +0 -7
- package/dist/core/context/shared-context-layer.js +0 -621
- package/dist/core/context/shared-context-layer.js.map +0 -7
- package/dist/core/context/stack-merge-resolver.js +0 -749
- package/dist/core/context/stack-merge-resolver.js.map +0 -7
- package/dist/core/context/validation.js +0 -130
- package/dist/core/context/validation.js.map +0 -7
- package/dist/core/database/batch-operations.js +0 -384
- package/dist/core/database/batch-operations.js.map +0 -7
- package/dist/core/database/connection-pool.js +0 -330
- package/dist/core/database/connection-pool.js.map +0 -7
- package/dist/core/database/database-adapter.js +0 -60
- package/dist/core/database/database-adapter.js.map +0 -7
- package/dist/core/database/migration-manager.js +0 -614
- package/dist/core/database/migration-manager.js.map +0 -7
- package/dist/core/database/paradedb-adapter.js +0 -990
- package/dist/core/database/paradedb-adapter.js.map +0 -7
- package/dist/core/database/query-cache.js +0 -298
- package/dist/core/database/query-cache.js.map +0 -7
- package/dist/core/database/query-router.js +0 -430
- package/dist/core/database/query-router.js.map +0 -7
- package/dist/core/database/sqlite-adapter.js +0 -738
- package/dist/core/database/sqlite-adapter.js.map +0 -7
- package/dist/core/digest/enhanced-hybrid-digest.js +0 -277
- package/dist/core/digest/enhanced-hybrid-digest.js.map +0 -7
- package/dist/core/digest/frame-digest-integration.js +0 -176
- package/dist/core/digest/frame-digest-integration.js.map +0 -7
- package/dist/core/digest/hybrid-digest-generator.js +0 -553
- package/dist/core/digest/hybrid-digest-generator.js.map +0 -7
- package/dist/core/digest/index.js +0 -9
- package/dist/core/digest/index.js.map +0 -7
- package/dist/core/digest/types.js +0 -25
- package/dist/core/digest/types.js.map +0 -7
- package/dist/core/errors/error-utils.js +0 -208
- package/dist/core/errors/error-utils.js.map +0 -7
- package/dist/core/errors/index.js +0 -521
- package/dist/core/errors/index.js.map +0 -7
- package/dist/core/errors/recovery.js +0 -269
- package/dist/core/errors/recovery.js.map +0 -7
- package/dist/core/execution/parallel-executor.js +0 -258
- package/dist/core/execution/parallel-executor.js.map +0 -7
- package/dist/core/frame/workflow-templates.js +0 -319
- package/dist/core/frame/workflow-templates.js.map +0 -7
- package/dist/core/merge/conflict-detector.js +0 -431
- package/dist/core/merge/conflict-detector.js.map +0 -7
- package/dist/core/merge/index.js +0 -9
- package/dist/core/merge/index.js.map +0 -7
- package/dist/core/merge/resolution-engine.js +0 -558
- package/dist/core/merge/resolution-engine.js.map +0 -7
- package/dist/core/merge/stack-diff.js +0 -532
- package/dist/core/merge/stack-diff.js.map +0 -7
- package/dist/core/merge/unified-merge-resolver.js +0 -303
- package/dist/core/merge/unified-merge-resolver.js.map +0 -7
- package/dist/core/models/fallback-monitor.js +0 -232
- package/dist/core/models/fallback-monitor.js.map +0 -7
- package/dist/core/models/model-router.js +0 -340
- package/dist/core/models/model-router.js.map +0 -7
- package/dist/core/monitoring/error-handler.js +0 -49
- package/dist/core/monitoring/error-handler.js.map +0 -7
- package/dist/core/monitoring/logger.js +0 -202
- package/dist/core/monitoring/logger.js.map +0 -7
- package/dist/core/monitoring/metrics.js +0 -172
- package/dist/core/monitoring/metrics.js.map +0 -7
- package/dist/core/monitoring/progress-tracker.js +0 -189
- package/dist/core/monitoring/progress-tracker.js.map +0 -7
- package/dist/core/monitoring/session-monitor.js +0 -300
- package/dist/core/monitoring/session-monitor.js.map +0 -7
- package/dist/core/performance/context-cache.js +0 -273
- package/dist/core/performance/context-cache.js.map +0 -7
- package/dist/core/performance/index.js +0 -11
- package/dist/core/performance/index.js.map +0 -7
- package/dist/core/performance/lazy-context-loader.js +0 -327
- package/dist/core/performance/lazy-context-loader.js.map +0 -7
- package/dist/core/performance/monitor.js +0 -221
- package/dist/core/performance/monitor.js.map +0 -7
- package/dist/core/performance/optimized-frame-context.js +0 -345
- package/dist/core/performance/optimized-frame-context.js.map +0 -7
- package/dist/core/performance/performance-benchmark.js +0 -277
- package/dist/core/performance/performance-benchmark.js.map +0 -7
- package/dist/core/performance/performance-profiler.js +0 -370
- package/dist/core/performance/performance-profiler.js.map +0 -7
- package/dist/core/performance/streaming-jsonl-parser.js +0 -195
- package/dist/core/performance/streaming-jsonl-parser.js.map +0 -7
- package/dist/core/persistence/postgres-adapter.js +0 -349
- package/dist/core/persistence/postgres-adapter.js.map +0 -7
- package/dist/core/projects/project-isolation.js +0 -201
- package/dist/core/projects/project-isolation.js.map +0 -7
- package/dist/core/projects/project-manager.js +0 -697
- package/dist/core/projects/project-manager.js.map +0 -7
- package/dist/core/query/query-parser.js +0 -370
- package/dist/core/query/query-parser.js.map +0 -7
- package/dist/core/query/query-templates.js +0 -321
- package/dist/core/query/query-templates.js.map +0 -7
- package/dist/core/retrieval/context-retriever.js +0 -479
- package/dist/core/retrieval/context-retriever.js.map +0 -7
- package/dist/core/retrieval/graph-retrieval.js +0 -662
- package/dist/core/retrieval/graph-retrieval.js.map +0 -7
- package/dist/core/retrieval/hierarchical-retrieval.js +0 -656
- package/dist/core/retrieval/hierarchical-retrieval.js.map +0 -7
- package/dist/core/retrieval/index.js +0 -8
- package/dist/core/retrieval/index.js.map +0 -7
- package/dist/core/retrieval/llm-context-retrieval.js +0 -613
- package/dist/core/retrieval/llm-context-retrieval.js.map +0 -7
- package/dist/core/retrieval/llm-provider.js +0 -151
- package/dist/core/retrieval/llm-provider.js.map +0 -7
- package/dist/core/retrieval/retrieval-audit.js +0 -236
- package/dist/core/retrieval/retrieval-audit.js.map +0 -7
- package/dist/core/retrieval/retrieval-benchmarks.js +0 -521
- package/dist/core/retrieval/retrieval-benchmarks.js.map +0 -7
- package/dist/core/retrieval/summary-generator.js +0 -589
- package/dist/core/retrieval/summary-generator.js.map +0 -7
- package/dist/core/retrieval/types.js +0 -21
- package/dist/core/retrieval/types.js.map +0 -7
- package/dist/core/security/index.js +0 -35
- package/dist/core/security/index.js.map +0 -7
- package/dist/core/security/input-sanitizer.js +0 -321
- package/dist/core/security/input-sanitizer.js.map +0 -7
- package/dist/core/session/clear-survival.js +0 -465
- package/dist/core/session/clear-survival.js.map +0 -7
- package/dist/core/session/enhanced-handoff.js +0 -792
- package/dist/core/session/enhanced-handoff.js.map +0 -7
- package/dist/core/session/handoff-generator.js +0 -343
- package/dist/core/session/handoff-generator.js.map +0 -7
- package/dist/core/session/index.js.map +0 -7
- package/dist/core/session/session-manager.js +0 -347
- package/dist/core/session/session-manager.js.map +0 -7
- package/dist/core/skills/index.js +0 -7
- package/dist/core/skills/index.js.map +0 -7
- package/dist/core/skills/skill-storage.js +0 -764
- package/dist/core/skills/skill-storage.js.map +0 -7
- package/dist/core/skills/types.js +0 -193
- package/dist/core/skills/types.js.map +0 -7
- package/dist/core/storage/chromadb-adapter.js +0 -354
- package/dist/core/storage/chromadb-adapter.js.map +0 -7
- package/dist/core/storage/infinite-storage.js +0 -510
- package/dist/core/storage/infinite-storage.js.map +0 -7
- package/dist/core/storage/railway-optimized-storage.js +0 -591
- package/dist/core/storage/railway-optimized-storage.js.map +0 -7
- package/dist/core/storage/remote-storage.js +0 -489
- package/dist/core/storage/remote-storage.js.map +0 -7
- package/dist/core/storage/two-tier-storage.js +0 -766
- package/dist/core/storage/two-tier-storage.js.map +0 -7
- package/dist/core/trace/cli-trace-wrapper.js +0 -132
- package/dist/core/trace/cli-trace-wrapper.js.map +0 -7
- package/dist/core/trace/db-trace-wrapper.js +0 -247
- package/dist/core/trace/db-trace-wrapper.js.map +0 -7
- package/dist/core/trace/debug-trace.js +0 -417
- package/dist/core/trace/debug-trace.js.map +0 -7
- package/dist/core/trace/index.js +0 -109
- package/dist/core/trace/index.js.map +0 -7
- package/dist/core/trace/linear-api-wrapper.js +0 -178
- package/dist/core/trace/linear-api-wrapper.js.map +0 -7
- package/dist/core/trace/trace-demo.js +0 -154
- package/dist/core/trace/trace-demo.js.map +0 -7
- package/dist/core/trace/trace-detector.demo.js +0 -142
- package/dist/core/trace/trace-detector.demo.js.map +0 -7
- package/dist/core/trace/trace-detector.js +0 -528
- package/dist/core/trace/trace-detector.js.map +0 -7
- package/dist/core/trace/trace-store.js +0 -345
- package/dist/core/trace/trace-store.js.map +0 -7
- package/dist/core/trace/types.js +0 -77
- package/dist/core/trace/types.js.map +0 -7
- package/dist/core/utils/async-mutex.js +0 -114
- package/dist/core/utils/async-mutex.js.map +0 -7
- package/dist/core/utils/compression.js +0 -83
- package/dist/core/utils/compression.js.map +0 -7
- package/dist/core/utils/update-checker.js +0 -218
- package/dist/core/utils/update-checker.js.map +0 -7
- package/dist/core/worktree/worktree-manager.js +0 -465
- package/dist/core/worktree/worktree-manager.js.map +0 -7
- package/dist/daemon/daemon-config.js +0 -149
- package/dist/daemon/daemon-config.js.map +0 -7
- package/dist/daemon/services/context-service.js +0 -122
- package/dist/daemon/services/context-service.js.map +0 -7
- package/dist/daemon/services/linear-service.js +0 -136
- package/dist/daemon/services/linear-service.js.map +0 -7
- package/dist/daemon/session-daemon.js +0 -312
- package/dist/daemon/session-daemon.js.map +0 -7
- package/dist/daemon/unified-daemon.js +0 -276
- package/dist/daemon/unified-daemon.js.map +0 -7
- package/dist/features/analytics/api/analytics-api.js +0 -287
- package/dist/features/analytics/api/analytics-api.js.map +0 -7
- package/dist/features/analytics/core/analytics-service.js +0 -282
- package/dist/features/analytics/core/analytics-service.js.map +0 -7
- package/dist/features/analytics/index.js +0 -18
- package/dist/features/analytics/index.js.map +0 -7
- package/dist/features/analytics/queries/metrics-queries.js +0 -277
- package/dist/features/analytics/queries/metrics-queries.js.map +0 -7
- package/dist/features/analytics/types/metrics.js +0 -5
- package/dist/features/analytics/types/metrics.js.map +0 -7
- package/dist/features/browser/browser-mcp.js +0 -492
- package/dist/features/browser/browser-mcp.js.map +0 -7
- package/dist/features/sweep/index.js +0 -20
- package/dist/features/sweep/index.js.map +0 -7
- package/dist/features/sweep/prediction-client.js +0 -155
- package/dist/features/sweep/prediction-client.js.map +0 -7
- package/dist/features/sweep/prompt-builder.js +0 -85
- package/dist/features/sweep/prompt-builder.js.map +0 -7
- package/dist/features/sweep/pty-wrapper.js +0 -171
- package/dist/features/sweep/pty-wrapper.js.map +0 -7
- package/dist/features/sweep/state-watcher.js +0 -87
- package/dist/features/sweep/state-watcher.js.map +0 -7
- package/dist/features/sweep/status-bar.js +0 -88
- package/dist/features/sweep/status-bar.js.map +0 -7
- package/dist/features/sweep/sweep-server-manager.js +0 -226
- package/dist/features/sweep/sweep-server-manager.js.map +0 -7
- package/dist/features/sweep/tab-interceptor.js +0 -38
- package/dist/features/sweep/tab-interceptor.js.map +0 -7
- package/dist/features/sweep/types.js +0 -18
- package/dist/features/sweep/types.js.map +0 -7
- package/dist/features/tasks/linear-task-manager.js +0 -487
- package/dist/features/tasks/linear-task-manager.js.map +0 -7
- package/dist/features/tasks/task-aware-context.js +0 -410
- package/dist/features/tasks/task-aware-context.js.map +0 -7
- package/dist/features/tui/simple-monitor.js +0 -116
- package/dist/features/tui/simple-monitor.js.map +0 -7
- package/dist/features/tui/swarm-monitor.js +0 -648
- package/dist/features/tui/swarm-monitor.js.map +0 -7
- package/dist/features/web/client/stores/task-store.js +0 -26
- package/dist/features/web/client/stores/task-store.js.map +0 -7
- package/dist/features/web/server/index.js +0 -194
- package/dist/features/web/server/index.js.map +0 -7
- package/dist/hooks/auto-background.js +0 -151
- package/dist/hooks/auto-background.js.map +0 -7
- package/dist/hooks/claude-code-whatsapp-hook.js +0 -197
- package/dist/hooks/claude-code-whatsapp-hook.js.map +0 -7
- package/dist/hooks/config.js +0 -150
- package/dist/hooks/config.js.map +0 -7
- package/dist/hooks/daemon.js +0 -364
- package/dist/hooks/daemon.js.map +0 -7
- package/dist/hooks/events.js +0 -58
- package/dist/hooks/events.js.map +0 -7
- package/dist/hooks/index.js +0 -12
- package/dist/hooks/index.js.map +0 -7
- package/dist/hooks/linear-task-picker.js +0 -186
- package/dist/hooks/linear-task-picker.js.map +0 -7
- package/dist/hooks/schemas.js +0 -197
- package/dist/hooks/schemas.js.map +0 -7
- package/dist/hooks/secure-fs.js +0 -49
- package/dist/hooks/secure-fs.js.map +0 -7
- package/dist/hooks/security-logger.js +0 -155
- package/dist/hooks/security-logger.js.map +0 -7
- package/dist/hooks/session-summary.js +0 -222
- package/dist/hooks/session-summary.js.map +0 -7
- package/dist/hooks/sms-action-runner.js +0 -371
- package/dist/hooks/sms-action-runner.js.map +0 -7
- package/dist/hooks/sms-notify.js +0 -506
- package/dist/hooks/sms-notify.js.map +0 -7
- package/dist/hooks/sms-watcher.js +0 -93
- package/dist/hooks/sms-watcher.js.map +0 -7
- package/dist/hooks/sms-webhook.js +0 -555
- package/dist/hooks/sms-webhook.js.map +0 -7
- package/dist/hooks/whatsapp-commands.js +0 -479
- package/dist/hooks/whatsapp-commands.js.map +0 -7
- package/dist/hooks/whatsapp-scheduler.js +0 -317
- package/dist/hooks/whatsapp-scheduler.js.map +0 -7
- package/dist/hooks/whatsapp-sync.js +0 -409
- package/dist/hooks/whatsapp-sync.js.map +0 -7
- package/dist/index.js +0 -25
- package/dist/index.js.map +0 -7
- package/dist/integrations/anthropic/client.js +0 -263
- package/dist/integrations/anthropic/client.js.map +0 -7
- package/dist/integrations/claude-code/agent-bridge.js +0 -768
- package/dist/integrations/claude-code/agent-bridge.js.map +0 -7
- package/dist/integrations/claude-code/enhanced-pre-clear-hooks.js +0 -459
- package/dist/integrations/claude-code/enhanced-pre-clear-hooks.js.map +0 -7
- package/dist/integrations/claude-code/lifecycle-hooks.js +0 -254
- package/dist/integrations/claude-code/lifecycle-hooks.js.map +0 -7
- package/dist/integrations/claude-code/post-task-hooks.js +0 -545
- package/dist/integrations/claude-code/post-task-hooks.js.map +0 -7
- package/dist/integrations/claude-code/subagent-client-stub.js +0 -20
- package/dist/integrations/claude-code/subagent-client-stub.js.map +0 -7
- package/dist/integrations/claude-code/subagent-client.js +0 -511
- package/dist/integrations/claude-code/subagent-client.js.map +0 -7
- package/dist/integrations/claude-code/task-coordinator.js +0 -360
- package/dist/integrations/claude-code/task-coordinator.js.map +0 -7
- package/dist/integrations/linear/auth.js +0 -337
- package/dist/integrations/linear/auth.js.map +0 -7
- package/dist/integrations/linear/auto-sync.js +0 -258
- package/dist/integrations/linear/auto-sync.js.map +0 -7
- package/dist/integrations/linear/client.js +0 -634
- package/dist/integrations/linear/client.js.map +0 -7
- package/dist/integrations/linear/config.js +0 -130
- package/dist/integrations/linear/config.js.map +0 -7
- package/dist/integrations/linear/migration.js +0 -361
- package/dist/integrations/linear/migration.js.map +0 -7
- package/dist/integrations/linear/oauth-server.js +0 -454
- package/dist/integrations/linear/oauth-server.js.map +0 -7
- package/dist/integrations/linear/rest-client.js +0 -213
- package/dist/integrations/linear/rest-client.js.map +0 -7
- package/dist/integrations/linear/sync-manager.js +0 -236
- package/dist/integrations/linear/sync-manager.js.map +0 -7
- package/dist/integrations/linear/sync-service.js +0 -231
- package/dist/integrations/linear/sync-service.js.map +0 -7
- package/dist/integrations/linear/sync.js +0 -782
- package/dist/integrations/linear/sync.js.map +0 -7
- package/dist/integrations/linear/types.js +0 -5
- package/dist/integrations/linear/types.js.map +0 -7
- package/dist/integrations/linear/unified-sync.js +0 -589
- package/dist/integrations/linear/unified-sync.js.map +0 -7
- package/dist/integrations/linear/webhook-handler.js +0 -219
- package/dist/integrations/linear/webhook-handler.js.map +0 -7
- package/dist/integrations/linear/webhook-server.js +0 -218
- package/dist/integrations/linear/webhook-server.js.map +0 -7
- package/dist/integrations/linear/webhook.js +0 -291
- package/dist/integrations/linear/webhook.js.map +0 -7
- package/dist/integrations/mcp/handlers/code-execution-handlers.js +0 -266
- package/dist/integrations/mcp/handlers/code-execution-handlers.js.map +0 -7
- package/dist/integrations/mcp/handlers/context-handlers.js +0 -257
- package/dist/integrations/mcp/handlers/context-handlers.js.map +0 -7
- package/dist/integrations/mcp/handlers/discovery-handlers.js +0 -497
- package/dist/integrations/mcp/handlers/discovery-handlers.js.map +0 -7
- package/dist/integrations/mcp/handlers/index.js +0 -166
- package/dist/integrations/mcp/handlers/index.js.map +0 -7
- package/dist/integrations/mcp/handlers/linear-handlers.js +0 -247
- package/dist/integrations/mcp/handlers/linear-handlers.js.map +0 -7
- package/dist/integrations/mcp/handlers/skill-handlers.js +0 -529
- package/dist/integrations/mcp/handlers/skill-handlers.js.map +0 -7
- package/dist/integrations/mcp/handlers/task-handlers.js +0 -239
- package/dist/integrations/mcp/handlers/task-handlers.js.map +0 -7
- package/dist/integrations/mcp/handlers/trace-handlers.js +0 -308
- package/dist/integrations/mcp/handlers/trace-handlers.js.map +0 -7
- package/dist/integrations/mcp/index.js +0 -23
- package/dist/integrations/mcp/index.js.map +0 -7
- package/dist/integrations/mcp/middleware/tool-scoring.js +0 -356
- package/dist/integrations/mcp/middleware/tool-scoring.js.map +0 -7
- package/dist/integrations/mcp/refactored-server.js +0 -374
- package/dist/integrations/mcp/refactored-server.js.map +0 -7
- package/dist/integrations/mcp/remote-server.js +0 -682
- package/dist/integrations/mcp/remote-server.js.map +0 -7
- package/dist/integrations/mcp/schemas.js +0 -147
- package/dist/integrations/mcp/schemas.js.map +0 -7
- package/dist/integrations/mcp/server.js +0 -1975
- package/dist/integrations/mcp/server.js.map +0 -7
- package/dist/integrations/mcp/tool-definitions-code.js +0 -125
- package/dist/integrations/mcp/tool-definitions-code.js.map +0 -7
- package/dist/integrations/mcp/tool-definitions.js +0 -702
- package/dist/integrations/mcp/tool-definitions.js.map +0 -7
- package/dist/integrations/mcp/trace-test.js +0 -48
- package/dist/integrations/mcp/trace-test.js.map +0 -7
- package/dist/integrations/pg-aiguide/embedding-provider.js +0 -189
- package/dist/integrations/pg-aiguide/embedding-provider.js.map +0 -7
- package/dist/integrations/pg-aiguide/semantic-search.js +0 -187
- package/dist/integrations/pg-aiguide/semantic-search.js.map +0 -7
- package/dist/integrations/pg-aiguide/timescale-analytics.js +0 -224
- package/dist/integrations/pg-aiguide/timescale-analytics.js.map +0 -7
- package/dist/integrations/ralph/bridge/ralph-stackmemory-bridge.js +0 -860
- package/dist/integrations/ralph/bridge/ralph-stackmemory-bridge.js.map +0 -7
- package/dist/integrations/ralph/context/context-budget-manager.js +0 -301
- package/dist/integrations/ralph/context/context-budget-manager.js.map +0 -7
- package/dist/integrations/ralph/context/stackmemory-context-loader.js +0 -360
- package/dist/integrations/ralph/context/stackmemory-context-loader.js.map +0 -7
- package/dist/integrations/ralph/coordination/enhanced-coordination.js +0 -410
- package/dist/integrations/ralph/coordination/enhanced-coordination.js.map +0 -7
- package/dist/integrations/ralph/index.js +0 -18
- package/dist/integrations/ralph/index.js.map +0 -7
- package/dist/integrations/ralph/learning/pattern-learner.js +0 -401
- package/dist/integrations/ralph/learning/pattern-learner.js.map +0 -7
- package/dist/integrations/ralph/lifecycle/iteration-lifecycle.js +0 -448
- package/dist/integrations/ralph/lifecycle/iteration-lifecycle.js.map +0 -7
- package/dist/integrations/ralph/monitoring/swarm-dashboard.js +0 -294
- package/dist/integrations/ralph/monitoring/swarm-dashboard.js.map +0 -7
- package/dist/integrations/ralph/monitoring/swarm-registry.js +0 -108
- package/dist/integrations/ralph/monitoring/swarm-registry.js.map +0 -7
- package/dist/integrations/ralph/orchestration/multi-loop-orchestrator.js +0 -463
- package/dist/integrations/ralph/orchestration/multi-loop-orchestrator.js.map +0 -7
- package/dist/integrations/ralph/patterns/compounding-engineering-pattern.js +0 -400
- package/dist/integrations/ralph/patterns/compounding-engineering-pattern.js.map +0 -7
- package/dist/integrations/ralph/patterns/extended-coherence-sessions.js +0 -473
- package/dist/integrations/ralph/patterns/extended-coherence-sessions.js.map +0 -7
- package/dist/integrations/ralph/patterns/oracle-worker-pattern.js +0 -388
- package/dist/integrations/ralph/patterns/oracle-worker-pattern.js.map +0 -7
- package/dist/integrations/ralph/performance/performance-optimizer.js +0 -358
- package/dist/integrations/ralph/performance/performance-optimizer.js.map +0 -7
- package/dist/integrations/ralph/ralph-integration-demo.js +0 -182
- package/dist/integrations/ralph/ralph-integration-demo.js.map +0 -7
- package/dist/integrations/ralph/recovery/crash-recovery.js +0 -462
- package/dist/integrations/ralph/recovery/crash-recovery.js.map +0 -7
- package/dist/integrations/ralph/state/state-reconciler.js +0 -404
- package/dist/integrations/ralph/state/state-reconciler.js.map +0 -7
- package/dist/integrations/ralph/swarm/git-workflow-manager.js +0 -428
- package/dist/integrations/ralph/swarm/git-workflow-manager.js.map +0 -7
- package/dist/integrations/ralph/swarm/swarm-coordinator.js +0 -996
- package/dist/integrations/ralph/swarm/swarm-coordinator.js.map +0 -7
- package/dist/integrations/ralph/types.js +0 -5
- package/dist/integrations/ralph/types.js.map +0 -7
- package/dist/integrations/ralph/visualization/ralph-debugger.js +0 -585
- package/dist/integrations/ralph/visualization/ralph-debugger.js.map +0 -7
- package/dist/mcp/stackmemory-mcp-server.js +0 -554
- package/dist/mcp/stackmemory-mcp-server.js.map +0 -7
- package/dist/middleware/exponential-rate-limiter.js +0 -289
- package/dist/middleware/exponential-rate-limiter.js.map +0 -7
- package/dist/models/user.model.js +0 -358
- package/dist/models/user.model.js.map +0 -7
- package/dist/servers/production/auth-middleware.js +0 -528
- package/dist/servers/production/auth-middleware.js.map +0 -7
- package/dist/servers/railway/config.js +0 -55
- package/dist/servers/railway/config.js.map +0 -7
- package/dist/servers/railway/index-enhanced.js +0 -160
- package/dist/servers/railway/index-enhanced.js.map +0 -7
- package/dist/servers/railway/index.js +0 -1349
- package/dist/servers/railway/index.js.map +0 -7
- package/dist/servers/railway/simple.js +0 -64
- package/dist/servers/railway/simple.js.map +0 -7
- package/dist/servers/railway/storage-test.js +0 -459
- package/dist/servers/railway/storage-test.js.map +0 -7
- package/dist/services/config-service.js +0 -65
- package/dist/services/config-service.js.map +0 -7
- package/dist/services/context-service.js +0 -194
- package/dist/services/context-service.js.map +0 -7
- package/dist/skills/api-discovery.js +0 -354
- package/dist/skills/api-discovery.js.map +0 -7
- package/dist/skills/api-skill.js +0 -475
- package/dist/skills/api-skill.js.map +0 -7
- package/dist/skills/claude-skills.js +0 -1061
- package/dist/skills/claude-skills.js.map +0 -7
- package/dist/skills/dashboard-launcher.js +0 -216
- package/dist/skills/dashboard-launcher.js.map +0 -7
- package/dist/skills/recursive-agent-orchestrator.js +0 -575
- package/dist/skills/recursive-agent-orchestrator.js.map +0 -7
- package/dist/skills/repo-ingestion-skill.js +0 -609
- package/dist/skills/repo-ingestion-skill.js.map +0 -7
- package/dist/skills/security-secrets-scanner.js +0 -284
- package/dist/skills/security-secrets-scanner.js.map +0 -7
- package/dist/skills/unified-rlm-orchestrator.js +0 -404
- package/dist/skills/unified-rlm-orchestrator.js.map +0 -7
- package/dist/types/task.js +0 -5
- package/dist/types/task.js.map +0 -7
- package/dist/utils/env.js +0 -50
- package/dist/utils/env.js.map +0 -7
- package/dist/utils/formatting.js +0 -62
- package/dist/utils/formatting.js.map +0 -7
- package/dist/utils/process-cleanup.js +0 -136
- package/dist/utils/process-cleanup.js.map +0 -7
- package/dist/validation/schemas.js +0 -222
- package/dist/validation/schemas.js.map +0 -7
- /package/dist/{core/merge → src/core/extensions}/types.js +0 -0
- /package/dist/{core/merge → src/core/extensions}/types.js.map +0 -0
- /package/dist/{core → src/integrations/diffmem}/types.js +0 -0
- /package/dist/{core → src/integrations/diffmem}/types.js.map +0 -0
|
@@ -1,1061 +0,0 @@
|
|
|
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 { logger } from "../core/monitoring/logger.js";
|
|
6
|
-
import {
|
|
7
|
-
RepoIngestionSkill
|
|
8
|
-
} from "./repo-ingestion-skill.js";
|
|
9
|
-
import {
|
|
10
|
-
RecursiveAgentOrchestrator
|
|
11
|
-
} from "./recursive-agent-orchestrator.js";
|
|
12
|
-
import { getAPISkill } from "./api-skill.js";
|
|
13
|
-
import * as fs from "fs";
|
|
14
|
-
import * as path from "path";
|
|
15
|
-
import * as os from "os";
|
|
16
|
-
class HandoffSkill {
|
|
17
|
-
constructor(context) {
|
|
18
|
-
this.context = context;
|
|
19
|
-
}
|
|
20
|
-
async execute(targetUser, message, options) {
|
|
21
|
-
try {
|
|
22
|
-
const activeStack = this.context.dualStackManager.getActiveStack();
|
|
23
|
-
let framesToHandoff = options?.frames || [];
|
|
24
|
-
if (options?.autoDetect !== false && framesToHandoff.length === 0) {
|
|
25
|
-
const allFrames = await activeStack.getAllFrames();
|
|
26
|
-
const relevantFrames = allFrames.filter(
|
|
27
|
-
(f) => f.state === "completed" || f.outputs && Array.isArray(f.outputs) && f.outputs.some((o) => o.type === "error")
|
|
28
|
-
);
|
|
29
|
-
framesToHandoff = relevantFrames.slice(-5).map((f) => f.frameId);
|
|
30
|
-
}
|
|
31
|
-
if (framesToHandoff.length === 0) {
|
|
32
|
-
return {
|
|
33
|
-
success: false,
|
|
34
|
-
message: "No frames to handoff. Specify frames or complete some work first."
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
const frameDetails = await Promise.all(
|
|
38
|
-
framesToHandoff.map((id) => activeStack.getFrame(id))
|
|
39
|
-
);
|
|
40
|
-
const summary = this.generateHandoffSummary(frameDetails, message);
|
|
41
|
-
const metadata = {
|
|
42
|
-
initiatedAt: /* @__PURE__ */ new Date(),
|
|
43
|
-
initiatorId: this.context.userId,
|
|
44
|
-
targetUserId: targetUser,
|
|
45
|
-
frameContext: {
|
|
46
|
-
totalFrames: framesToHandoff.length,
|
|
47
|
-
frameTypes: [
|
|
48
|
-
...new Set(frameDetails.map((f) => f?.type || "unknown"))
|
|
49
|
-
],
|
|
50
|
-
estimatedSize: JSON.stringify(frameDetails).length,
|
|
51
|
-
dependencies: this.extractDependencies(frameDetails)
|
|
52
|
-
},
|
|
53
|
-
businessContext: {
|
|
54
|
-
priority: options?.priority || "medium",
|
|
55
|
-
stakeholders: [targetUser]
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
const availableStacks = await this.context.dualStackManager.getAvailableStacks();
|
|
59
|
-
let targetStackId = availableStacks.find(
|
|
60
|
-
(s) => s.type === "shared"
|
|
61
|
-
)?.stackId;
|
|
62
|
-
if (!targetStackId) {
|
|
63
|
-
targetStackId = await this.context.dualStackManager.createSharedStack(
|
|
64
|
-
"team",
|
|
65
|
-
`Handoff: ${message.slice(0, 50)}`,
|
|
66
|
-
this.context.userId
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
const handoffId = await this.context.handoffManager.initiateHandoff(
|
|
70
|
-
targetStackId,
|
|
71
|
-
framesToHandoff,
|
|
72
|
-
metadata,
|
|
73
|
-
targetUser,
|
|
74
|
-
summary
|
|
75
|
-
);
|
|
76
|
-
const actionItems = this.generateActionItems(frameDetails);
|
|
77
|
-
return {
|
|
78
|
-
success: true,
|
|
79
|
-
message: `Handoff initiated to @${targetUser}`,
|
|
80
|
-
data: {
|
|
81
|
-
handoffId,
|
|
82
|
-
frameCount: framesToHandoff.length,
|
|
83
|
-
priority: options?.priority || "medium",
|
|
84
|
-
actionItems,
|
|
85
|
-
targetStack: targetStackId
|
|
86
|
-
},
|
|
87
|
-
action: `Notified ${targetUser}. Handoff ID: ${handoffId}`
|
|
88
|
-
};
|
|
89
|
-
} catch (error) {
|
|
90
|
-
logger.error("Handoff skill error:", error);
|
|
91
|
-
return {
|
|
92
|
-
success: false,
|
|
93
|
-
message: `Failed to initiate handoff: ${error.message}`
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
generateHandoffSummary(frames, message) {
|
|
98
|
-
const completed = frames.filter((f) => f?.state === "completed").length;
|
|
99
|
-
const blocked = frames.filter(
|
|
100
|
-
(f) => f?.outputs?.some((o) => o.type === "error")
|
|
101
|
-
).length;
|
|
102
|
-
return `
|
|
103
|
-
## Handoff Summary
|
|
104
|
-
**Message**: ${message}
|
|
105
|
-
**Frames**: ${frames.length} total (${completed} completed, ${blocked} blocked)
|
|
106
|
-
|
|
107
|
-
### Work Completed:
|
|
108
|
-
${frames.filter((f) => f?.state === "completed").map((f) => `- ${f.name}: ${f.digest_deterministic?.summary || "No summary"}`).join("\n")}
|
|
109
|
-
|
|
110
|
-
### Attention Required:
|
|
111
|
-
${frames.filter((f) => f?.outputs?.some((o) => o.type === "error")).map(
|
|
112
|
-
(f) => `- ${f.name}: ${f.outputs.find((o) => o.type === "error")?.content || "Error"}`
|
|
113
|
-
).join("\n") || "None"}
|
|
114
|
-
|
|
115
|
-
### Context:
|
|
116
|
-
${frames.map((f) => f?.digest_ai?.context || "").filter(Boolean).join("\n")}
|
|
117
|
-
`.trim();
|
|
118
|
-
}
|
|
119
|
-
extractDependencies(frames) {
|
|
120
|
-
const deps = /* @__PURE__ */ new Set();
|
|
121
|
-
frames.forEach((frame) => {
|
|
122
|
-
if (frame?.inputs?.dependencies) {
|
|
123
|
-
if (Array.isArray(frame.inputs.dependencies)) {
|
|
124
|
-
frame.inputs.dependencies.forEach((d) => deps.add(d));
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
if (frame?.outputs) {
|
|
128
|
-
frame.outputs.forEach((output) => {
|
|
129
|
-
if (output.type === "dependency") {
|
|
130
|
-
deps.add(output.content);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
return Array.from(deps);
|
|
136
|
-
}
|
|
137
|
-
generateActionItems(frames) {
|
|
138
|
-
const items = [];
|
|
139
|
-
frames.forEach((frame) => {
|
|
140
|
-
if (frame?.outputs) {
|
|
141
|
-
frame.outputs.forEach((output) => {
|
|
142
|
-
if (output.type === "todo" || output.content?.includes("TODO")) {
|
|
143
|
-
items.push(output.content);
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
if (frame?.outputs?.some((o) => o.type === "error")) {
|
|
148
|
-
items.push(`Resolve error in ${frame.name}`);
|
|
149
|
-
}
|
|
150
|
-
if (frame?.inputs?.tests === "pending" || frame?.type === "implementation" || frame?.name && frame.name.toLowerCase().includes("implementation")) {
|
|
151
|
-
items.push(`Write tests for ${frame.name}`);
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
return items;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
class CheckpointSkill {
|
|
158
|
-
constructor(context) {
|
|
159
|
-
this.context = context;
|
|
160
|
-
this.checkpointDir = path.join(
|
|
161
|
-
os.homedir(),
|
|
162
|
-
".stackmemory",
|
|
163
|
-
"checkpoints",
|
|
164
|
-
context.projectId
|
|
165
|
-
);
|
|
166
|
-
fs.mkdirSync(this.checkpointDir, { recursive: true });
|
|
167
|
-
}
|
|
168
|
-
checkpointDir;
|
|
169
|
-
async create(description, options) {
|
|
170
|
-
try {
|
|
171
|
-
const timestamp = Date.now();
|
|
172
|
-
const checkpointId = `checkpoint-${timestamp}-${Math.random().toString(36).slice(2, 8)}`;
|
|
173
|
-
const activeStack = this.context.dualStackManager.getActiveStack();
|
|
174
|
-
const currentContext = this.context.dualStackManager.getCurrentContext();
|
|
175
|
-
const allFrames = await activeStack.getAllFrames();
|
|
176
|
-
const checkpoint = {
|
|
177
|
-
id: checkpointId,
|
|
178
|
-
timestamp,
|
|
179
|
-
description,
|
|
180
|
-
context: {
|
|
181
|
-
stackId: currentContext.stackId,
|
|
182
|
-
stackType: currentContext.type,
|
|
183
|
-
userId: this.context.userId,
|
|
184
|
-
projectId: this.context.projectId
|
|
185
|
-
},
|
|
186
|
-
frames: allFrames,
|
|
187
|
-
metadata: {
|
|
188
|
-
...options?.metadata,
|
|
189
|
-
frameCount: allFrames.length,
|
|
190
|
-
activeFrames: allFrames.filter((f) => f.state === "active").length,
|
|
191
|
-
completedFrames: allFrames.filter((f) => f.state === "completed").length
|
|
192
|
-
},
|
|
193
|
-
files: options?.includeFiles || []
|
|
194
|
-
};
|
|
195
|
-
const checkpointPath = path.join(
|
|
196
|
-
this.checkpointDir,
|
|
197
|
-
`${checkpointId}.json`
|
|
198
|
-
);
|
|
199
|
-
fs.writeFileSync(checkpointPath, JSON.stringify(checkpoint, null, 2));
|
|
200
|
-
if (options?.includeFiles && options.includeFiles.length > 0) {
|
|
201
|
-
const filesDir = path.join(this.checkpointDir, checkpointId, "files");
|
|
202
|
-
fs.mkdirSync(filesDir, { recursive: true });
|
|
203
|
-
for (const file of options.includeFiles) {
|
|
204
|
-
if (fs.existsSync(file)) {
|
|
205
|
-
const basename = path.basename(file);
|
|
206
|
-
const backupPath = path.join(filesDir, basename);
|
|
207
|
-
fs.copyFileSync(file, backupPath);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
if (options?.autoDetectRisky) {
|
|
212
|
-
const riskyPatterns = [
|
|
213
|
-
"migration",
|
|
214
|
-
"database",
|
|
215
|
-
"deploy",
|
|
216
|
-
"production",
|
|
217
|
-
"delete",
|
|
218
|
-
"remove",
|
|
219
|
-
"drop",
|
|
220
|
-
"migrate"
|
|
221
|
-
// Add more specific pattern
|
|
222
|
-
];
|
|
223
|
-
const isRisky = allFrames.some((frame) => {
|
|
224
|
-
const nameMatches = frame.name && riskyPatterns.some(
|
|
225
|
-
(pattern) => frame.name.toLowerCase().includes(pattern)
|
|
226
|
-
);
|
|
227
|
-
const commandMatches = frame.inputs?.command && riskyPatterns.some(
|
|
228
|
-
(pattern) => frame.inputs.command.toLowerCase().includes(pattern)
|
|
229
|
-
);
|
|
230
|
-
return nameMatches || commandMatches;
|
|
231
|
-
});
|
|
232
|
-
if (isRisky) {
|
|
233
|
-
checkpoint.metadata.riskyOperation = true;
|
|
234
|
-
checkpoint.metadata.autoCheckpoint = true;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
fs.writeFileSync(checkpointPath, JSON.stringify(checkpoint, null, 2));
|
|
238
|
-
logger.info(`Created checkpoint: ${checkpointId}`);
|
|
239
|
-
return {
|
|
240
|
-
success: true,
|
|
241
|
-
message: `Checkpoint created: ${description}`,
|
|
242
|
-
data: {
|
|
243
|
-
checkpointId,
|
|
244
|
-
timestamp: new Date(timestamp).toISOString(),
|
|
245
|
-
frameCount: checkpoint.metadata.frameCount,
|
|
246
|
-
location: checkpointPath
|
|
247
|
-
},
|
|
248
|
-
action: `Saved checkpoint ${checkpointId}`
|
|
249
|
-
};
|
|
250
|
-
} catch (error) {
|
|
251
|
-
logger.error("Checkpoint creation error:", error);
|
|
252
|
-
return {
|
|
253
|
-
success: false,
|
|
254
|
-
message: `Failed to create checkpoint: ${error.message}`
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
async restore(checkpointId) {
|
|
259
|
-
try {
|
|
260
|
-
const checkpointPath = path.join(
|
|
261
|
-
this.checkpointDir,
|
|
262
|
-
`${checkpointId}.json`
|
|
263
|
-
);
|
|
264
|
-
if (!fs.existsSync(checkpointPath)) {
|
|
265
|
-
const files = fs.readdirSync(this.checkpointDir);
|
|
266
|
-
const match = files.find((f) => f.includes(checkpointId));
|
|
267
|
-
if (match) {
|
|
268
|
-
checkpointId = match.replace(".json", "");
|
|
269
|
-
} else {
|
|
270
|
-
return {
|
|
271
|
-
success: false,
|
|
272
|
-
message: `Checkpoint not found: ${checkpointId}`
|
|
273
|
-
};
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
const checkpoint = JSON.parse(fs.readFileSync(checkpointPath, "utf-8"));
|
|
277
|
-
await this.context.dualStackManager.switchToStack(
|
|
278
|
-
checkpoint.context.stackId
|
|
279
|
-
);
|
|
280
|
-
const filesDir = path.join(this.checkpointDir, checkpointId, "files");
|
|
281
|
-
if (fs.existsSync(filesDir)) {
|
|
282
|
-
const files = fs.readdirSync(filesDir);
|
|
283
|
-
for (const file of files) {
|
|
284
|
-
const backupPath = path.join(filesDir, file);
|
|
285
|
-
const originalPath = checkpoint.files.find(
|
|
286
|
-
(f) => path.basename(f) === file
|
|
287
|
-
);
|
|
288
|
-
if (originalPath && fs.existsSync(backupPath)) {
|
|
289
|
-
fs.copyFileSync(backupPath, originalPath);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
logger.info(`Restored checkpoint: ${checkpointId}`);
|
|
294
|
-
return {
|
|
295
|
-
success: true,
|
|
296
|
-
message: `Restored to checkpoint: ${checkpoint.description}`,
|
|
297
|
-
data: {
|
|
298
|
-
checkpointId,
|
|
299
|
-
timestamp: new Date(checkpoint.timestamp).toISOString(),
|
|
300
|
-
frameCount: checkpoint.metadata.frameCount,
|
|
301
|
-
filesRestored: checkpoint.files.length
|
|
302
|
-
},
|
|
303
|
-
action: `Restored checkpoint from ${new Date(checkpoint.timestamp).toLocaleString()}`
|
|
304
|
-
};
|
|
305
|
-
} catch (error) {
|
|
306
|
-
logger.error("Checkpoint restoration error:", error);
|
|
307
|
-
return {
|
|
308
|
-
success: false,
|
|
309
|
-
message: `Failed to restore checkpoint: ${error.message}`
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
async list(options) {
|
|
314
|
-
try {
|
|
315
|
-
const files = fs.readdirSync(this.checkpointDir).filter((f) => f.endsWith(".json")).map((f) => {
|
|
316
|
-
const checkpointPath = path.join(this.checkpointDir, f);
|
|
317
|
-
const checkpoint = JSON.parse(
|
|
318
|
-
fs.readFileSync(checkpointPath, "utf-8")
|
|
319
|
-
);
|
|
320
|
-
return checkpoint;
|
|
321
|
-
}).filter((c) => !options?.since || c.timestamp > options.since.getTime()).sort((a, b) => b.timestamp - a.timestamp).slice(0, options?.limit || 10);
|
|
322
|
-
return {
|
|
323
|
-
success: true,
|
|
324
|
-
message: `Found ${files.length} checkpoints`,
|
|
325
|
-
data: files.map((c) => ({
|
|
326
|
-
id: c.id,
|
|
327
|
-
description: c.description,
|
|
328
|
-
timestamp: new Date(c.timestamp).toISOString(),
|
|
329
|
-
frameCount: c.metadata.frameCount,
|
|
330
|
-
risky: c.metadata.riskyOperation || false
|
|
331
|
-
}))
|
|
332
|
-
};
|
|
333
|
-
} catch (error) {
|
|
334
|
-
logger.error("Checkpoint list error:", error);
|
|
335
|
-
return {
|
|
336
|
-
success: false,
|
|
337
|
-
message: `Failed to list checkpoints: ${error.message}`
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
async diff(checkpoint1, checkpoint2) {
|
|
342
|
-
try {
|
|
343
|
-
const cp1 = await this.loadCheckpoint(checkpoint1);
|
|
344
|
-
const cp2 = await this.loadCheckpoint(checkpoint2);
|
|
345
|
-
if (!cp1 || !cp2) {
|
|
346
|
-
return {
|
|
347
|
-
success: false,
|
|
348
|
-
message: "One or both checkpoints not found"
|
|
349
|
-
};
|
|
350
|
-
}
|
|
351
|
-
const diff = {
|
|
352
|
-
timeDiff: Math.abs(cp2.timestamp - cp1.timestamp),
|
|
353
|
-
framesDiff: cp2.frames.length - cp1.frames.length,
|
|
354
|
-
newFrames: cp2.frames.filter(
|
|
355
|
-
(f2) => !cp1.frames.some((f1) => f1.frameId === f2.frameId)
|
|
356
|
-
),
|
|
357
|
-
removedFrames: cp1.frames.filter(
|
|
358
|
-
(f1) => !cp2.frames.some((f2) => f2.frameId === f1.frameId)
|
|
359
|
-
),
|
|
360
|
-
modifiedFrames: cp2.frames.filter((f2) => {
|
|
361
|
-
const f1 = cp1.frames.find((f) => f.frameId === f2.frameId);
|
|
362
|
-
return f1 && JSON.stringify(f1) !== JSON.stringify(f2);
|
|
363
|
-
})
|
|
364
|
-
};
|
|
365
|
-
return {
|
|
366
|
-
success: true,
|
|
367
|
-
message: `Diff between ${cp1.description} and ${cp2.description}`,
|
|
368
|
-
data: {
|
|
369
|
-
timeDiff: `${Math.round(diff.timeDiff / 1e3 / 60)} minutes`,
|
|
370
|
-
framesDiff: diff.framesDiff > 0 ? `+${diff.framesDiff}` : `${diff.framesDiff}`,
|
|
371
|
-
newFrames: diff.newFrames.length,
|
|
372
|
-
removedFrames: diff.removedFrames.length,
|
|
373
|
-
modifiedFrames: diff.modifiedFrames.length,
|
|
374
|
-
details: diff
|
|
375
|
-
}
|
|
376
|
-
};
|
|
377
|
-
} catch (error) {
|
|
378
|
-
logger.error("Checkpoint diff error:", error);
|
|
379
|
-
return {
|
|
380
|
-
success: false,
|
|
381
|
-
message: `Failed to diff checkpoints: ${error.message}`
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
async loadCheckpoint(checkpointId) {
|
|
386
|
-
const checkpointPath = path.join(
|
|
387
|
-
this.checkpointDir,
|
|
388
|
-
`${checkpointId}.json`
|
|
389
|
-
);
|
|
390
|
-
if (fs.existsSync(checkpointPath)) {
|
|
391
|
-
return JSON.parse(fs.readFileSync(checkpointPath, "utf-8"));
|
|
392
|
-
}
|
|
393
|
-
const files = fs.readdirSync(this.checkpointDir);
|
|
394
|
-
const match = files.find((f) => f.includes(checkpointId));
|
|
395
|
-
if (match) {
|
|
396
|
-
const path2 = path2.join(this.checkpointDir, match);
|
|
397
|
-
return JSON.parse(fs.readFileSync(path2, "utf-8"));
|
|
398
|
-
}
|
|
399
|
-
return null;
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
class ArchaeologistSkill {
|
|
403
|
-
constructor(context) {
|
|
404
|
-
this.context = context;
|
|
405
|
-
}
|
|
406
|
-
async dig(query, options) {
|
|
407
|
-
try {
|
|
408
|
-
const depth = this.parseDepth(options?.depth || "30days");
|
|
409
|
-
const since = new Date(Date.now() - depth);
|
|
410
|
-
const results = await this.context.contextRetriever.retrieve({
|
|
411
|
-
query,
|
|
412
|
-
projectId: this.context.projectId,
|
|
413
|
-
limit: 50,
|
|
414
|
-
minScore: 0.3
|
|
415
|
-
});
|
|
416
|
-
const filtered = results.filter(
|
|
417
|
-
(r) => !depth || new Date(r.timestamp) > since
|
|
418
|
-
);
|
|
419
|
-
let patterns = [];
|
|
420
|
-
if (options?.patterns) {
|
|
421
|
-
patterns = this.extractPatterns(filtered);
|
|
422
|
-
}
|
|
423
|
-
let decisions = [];
|
|
424
|
-
if (options?.decisions) {
|
|
425
|
-
decisions = this.extractDecisions(filtered);
|
|
426
|
-
}
|
|
427
|
-
let timeline = [];
|
|
428
|
-
if (options?.timeline) {
|
|
429
|
-
timeline = this.generateTimeline(filtered);
|
|
430
|
-
}
|
|
431
|
-
const topResults = filtered.slice(0, 10);
|
|
432
|
-
const summary = this.generateArchaeologySummary(
|
|
433
|
-
topResults,
|
|
434
|
-
patterns,
|
|
435
|
-
decisions,
|
|
436
|
-
timeline
|
|
437
|
-
);
|
|
438
|
-
return {
|
|
439
|
-
success: true,
|
|
440
|
-
message: `Found ${filtered.length} relevant results`,
|
|
441
|
-
data: {
|
|
442
|
-
totalResults: filtered.length,
|
|
443
|
-
timeRange: {
|
|
444
|
-
from: since.toISOString(),
|
|
445
|
-
to: (/* @__PURE__ */ new Date()).toISOString()
|
|
446
|
-
},
|
|
447
|
-
topResults: topResults.map((r) => ({
|
|
448
|
-
frameId: r.frameId,
|
|
449
|
-
score: r.score,
|
|
450
|
-
timestamp: r.timestamp,
|
|
451
|
-
summary: r.content.slice(0, 100) + "..."
|
|
452
|
-
})),
|
|
453
|
-
patterns,
|
|
454
|
-
decisions,
|
|
455
|
-
timeline,
|
|
456
|
-
summary
|
|
457
|
-
},
|
|
458
|
-
action: `Analyzed ${filtered.length} frames from ${options?.depth || "30days"} of history`
|
|
459
|
-
};
|
|
460
|
-
} catch (error) {
|
|
461
|
-
logger.error("Archaeology skill error:", error);
|
|
462
|
-
return {
|
|
463
|
-
success: false,
|
|
464
|
-
message: `Failed to dig through context: ${error.message}`
|
|
465
|
-
};
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
parseDepth(depth) {
|
|
469
|
-
const match = depth.match(/^(\d+)(days?|weeks?|months?|years?|all)$/i);
|
|
470
|
-
if (!match) {
|
|
471
|
-
return 30 * 24 * 60 * 60 * 1e3;
|
|
472
|
-
}
|
|
473
|
-
const [, num, unit] = match;
|
|
474
|
-
const value = parseInt(num);
|
|
475
|
-
switch (unit.toLowerCase()) {
|
|
476
|
-
case "day":
|
|
477
|
-
case "days":
|
|
478
|
-
return value * 24 * 60 * 60 * 1e3;
|
|
479
|
-
case "week":
|
|
480
|
-
case "weeks":
|
|
481
|
-
return value * 7 * 24 * 60 * 60 * 1e3;
|
|
482
|
-
case "month":
|
|
483
|
-
case "months":
|
|
484
|
-
return value * 30 * 24 * 60 * 60 * 1e3;
|
|
485
|
-
case "year":
|
|
486
|
-
case "years":
|
|
487
|
-
return value * 365 * 24 * 60 * 60 * 1e3;
|
|
488
|
-
case "all":
|
|
489
|
-
return Number.MAX_SAFE_INTEGER;
|
|
490
|
-
default:
|
|
491
|
-
return 30 * 24 * 60 * 60 * 1e3;
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
extractPatterns(results) {
|
|
495
|
-
const patterns = /* @__PURE__ */ new Map();
|
|
496
|
-
const patternTypes = [
|
|
497
|
-
{ regex: /test.*then.*implement/i, name: "TDD" },
|
|
498
|
-
{ regex: /refactor/i, name: "Refactoring" },
|
|
499
|
-
{ regex: /debug|fix|error|bug/i, name: "Debugging" },
|
|
500
|
-
{ regex: /implement.*feature/i, name: "Feature Development" },
|
|
501
|
-
{ regex: /review|code review/i, name: "Code Review" },
|
|
502
|
-
{ regex: /deploy|release/i, name: "Deployment" },
|
|
503
|
-
{ regex: /optimize|performance/i, name: "Optimization" }
|
|
504
|
-
];
|
|
505
|
-
results.forEach((result) => {
|
|
506
|
-
patternTypes.forEach((pattern) => {
|
|
507
|
-
if (pattern.regex.test(result.content)) {
|
|
508
|
-
patterns.set(pattern.name, (patterns.get(pattern.name) || 0) + 1);
|
|
509
|
-
}
|
|
510
|
-
});
|
|
511
|
-
});
|
|
512
|
-
return Array.from(patterns.entries()).map(([name, count]) => ({ name, count })).sort((a, b) => b.count - a.count);
|
|
513
|
-
}
|
|
514
|
-
extractDecisions(results) {
|
|
515
|
-
const decisions = [];
|
|
516
|
-
const decisionKeywords = [
|
|
517
|
-
"decided",
|
|
518
|
-
"chose",
|
|
519
|
-
"selected",
|
|
520
|
-
"will use",
|
|
521
|
-
"going with",
|
|
522
|
-
"approach",
|
|
523
|
-
"strategy",
|
|
524
|
-
"solution"
|
|
525
|
-
];
|
|
526
|
-
results.forEach((result) => {
|
|
527
|
-
const content = result.content.toLowerCase();
|
|
528
|
-
if (decisionKeywords.some((keyword) => content.includes(keyword))) {
|
|
529
|
-
const sentences = result.content.split(/[.!?]+/);
|
|
530
|
-
const decisionSentence = sentences.find(
|
|
531
|
-
(s) => decisionKeywords.some((k) => s.toLowerCase().includes(k))
|
|
532
|
-
);
|
|
533
|
-
if (decisionSentence) {
|
|
534
|
-
decisions.push({
|
|
535
|
-
frameId: result.frameId,
|
|
536
|
-
timestamp: result.timestamp,
|
|
537
|
-
decision: decisionSentence.trim(),
|
|
538
|
-
context: result.content.slice(0, 200)
|
|
539
|
-
});
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
});
|
|
543
|
-
return decisions.slice(0, 10);
|
|
544
|
-
}
|
|
545
|
-
generateTimeline(results) {
|
|
546
|
-
const timeline = /* @__PURE__ */ new Map();
|
|
547
|
-
results.forEach((result) => {
|
|
548
|
-
const date = new Date(result.timestamp).toDateString();
|
|
549
|
-
if (!timeline.has(date)) {
|
|
550
|
-
timeline.set(date, []);
|
|
551
|
-
}
|
|
552
|
-
const dateItems = timeline.get(date);
|
|
553
|
-
if (dateItems) {
|
|
554
|
-
dateItems.push(result);
|
|
555
|
-
}
|
|
556
|
-
});
|
|
557
|
-
return Array.from(timeline.entries()).map(([date, items]) => ({
|
|
558
|
-
date,
|
|
559
|
-
itemCount: items.length,
|
|
560
|
-
highlights: items.slice(0, 3).map((item) => ({
|
|
561
|
-
frameId: item.frameId,
|
|
562
|
-
summary: item.content.slice(0, 50) + "..."
|
|
563
|
-
}))
|
|
564
|
-
})).sort((a, b) => new Date(b.date).getTime() - new Date(a.date).getTime());
|
|
565
|
-
}
|
|
566
|
-
generateArchaeologySummary(results, patterns, decisions, timeline) {
|
|
567
|
-
let summary = "## Context Archaeology Report\n\n";
|
|
568
|
-
if (results.length > 0) {
|
|
569
|
-
summary += `### Most Relevant Context (${results.length} results)
|
|
570
|
-
`;
|
|
571
|
-
results.slice(0, 3).forEach((r) => {
|
|
572
|
-
summary += `- **${new Date(r.timestamp).toLocaleDateString()}**: ${r.content.slice(0, 100)}...
|
|
573
|
-
`;
|
|
574
|
-
});
|
|
575
|
-
summary += "\n";
|
|
576
|
-
}
|
|
577
|
-
if (patterns.length > 0) {
|
|
578
|
-
summary += `### Detected Patterns
|
|
579
|
-
`;
|
|
580
|
-
patterns.slice(0, 5).forEach((p) => {
|
|
581
|
-
summary += `- ${p.name}: ${p.count} occurrences
|
|
582
|
-
`;
|
|
583
|
-
});
|
|
584
|
-
summary += "\n";
|
|
585
|
-
}
|
|
586
|
-
if (decisions.length > 0) {
|
|
587
|
-
summary += `### Key Decisions
|
|
588
|
-
`;
|
|
589
|
-
decisions.slice(0, 5).forEach((d) => {
|
|
590
|
-
summary += `- **${new Date(d.timestamp).toLocaleDateString()}**: ${d.decision}
|
|
591
|
-
`;
|
|
592
|
-
});
|
|
593
|
-
summary += "\n";
|
|
594
|
-
}
|
|
595
|
-
if (timeline.length > 0) {
|
|
596
|
-
summary += `### Activity Timeline
|
|
597
|
-
`;
|
|
598
|
-
timeline.slice(0, 5).forEach((t) => {
|
|
599
|
-
summary += `- **${t.date}**: ${t.itemCount} activities
|
|
600
|
-
`;
|
|
601
|
-
});
|
|
602
|
-
}
|
|
603
|
-
return summary;
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
class ClaudeSkillsManager {
|
|
607
|
-
constructor(context) {
|
|
608
|
-
this.context = context;
|
|
609
|
-
this.handoffSkill = new HandoffSkill(context);
|
|
610
|
-
this.checkpointSkill = new CheckpointSkill(context);
|
|
611
|
-
this.archaeologistSkill = new ArchaeologistSkill(context);
|
|
612
|
-
this.apiSkill = getAPISkill();
|
|
613
|
-
import("./dashboard-launcher.js").then((module) => {
|
|
614
|
-
this.dashboardLauncher = new module.DashboardLauncherSkill();
|
|
615
|
-
logger.info("Dashboard launcher initialized (manual launch required)");
|
|
616
|
-
});
|
|
617
|
-
const chromaConfig = {
|
|
618
|
-
apiKey: process.env["CHROMADB_API_KEY"] || "",
|
|
619
|
-
tenant: process.env["CHROMADB_TENANT"] || "",
|
|
620
|
-
database: process.env["CHROMADB_DATABASE"] || "stackmemory",
|
|
621
|
-
collectionName: process.env["CHROMADB_COLLECTION"] || "stackmemory_repos"
|
|
622
|
-
};
|
|
623
|
-
if (chromaConfig.apiKey && chromaConfig.tenant) {
|
|
624
|
-
this.repoIngestionSkill = new RepoIngestionSkill(
|
|
625
|
-
chromaConfig,
|
|
626
|
-
context.userId,
|
|
627
|
-
process.env["CHROMADB_TEAM_ID"]
|
|
628
|
-
);
|
|
629
|
-
this.repoIngestionSkill.initialize().catch((error) => {
|
|
630
|
-
logger.warn("Repo ingestion skill initialization failed:", error);
|
|
631
|
-
});
|
|
632
|
-
}
|
|
633
|
-
import("../features/tasks/linear-task-manager.js").then((module) => {
|
|
634
|
-
const taskStore = new module.LinearTaskManager();
|
|
635
|
-
const frameManager = context.frameManager;
|
|
636
|
-
if (!frameManager) {
|
|
637
|
-
throw new Error(
|
|
638
|
-
"FrameManager not provided in context - required for RLM orchestrator"
|
|
639
|
-
);
|
|
640
|
-
}
|
|
641
|
-
this.rlmOrchestrator = new RecursiveAgentOrchestrator(
|
|
642
|
-
frameManager,
|
|
643
|
-
context.dualStackManager,
|
|
644
|
-
context.contextRetriever,
|
|
645
|
-
taskStore
|
|
646
|
-
);
|
|
647
|
-
logger.info("RLM Orchestrator initialized");
|
|
648
|
-
}).catch((error) => {
|
|
649
|
-
logger.warn("RLM Orchestrator initialization failed:", error);
|
|
650
|
-
});
|
|
651
|
-
}
|
|
652
|
-
handoffSkill;
|
|
653
|
-
checkpointSkill;
|
|
654
|
-
archaeologistSkill;
|
|
655
|
-
dashboardLauncher;
|
|
656
|
-
repoIngestionSkill = null;
|
|
657
|
-
rlmOrchestrator = null;
|
|
658
|
-
apiSkill;
|
|
659
|
-
async executeSkill(skillName, args, options) {
|
|
660
|
-
switch (skillName) {
|
|
661
|
-
case "handoff":
|
|
662
|
-
return this.handoffSkill.execute(args[0], args[1], options);
|
|
663
|
-
case "checkpoint":
|
|
664
|
-
const subcommand = args[0];
|
|
665
|
-
switch (subcommand) {
|
|
666
|
-
case "create":
|
|
667
|
-
return this.checkpointSkill.create(args[1], options);
|
|
668
|
-
case "restore":
|
|
669
|
-
return this.checkpointSkill.restore(args[1]);
|
|
670
|
-
case "list":
|
|
671
|
-
return this.checkpointSkill.list(options);
|
|
672
|
-
case "diff":
|
|
673
|
-
return this.checkpointSkill.diff(args[1], args[2]);
|
|
674
|
-
default:
|
|
675
|
-
return {
|
|
676
|
-
success: false,
|
|
677
|
-
message: `Unknown checkpoint subcommand: ${subcommand}`
|
|
678
|
-
};
|
|
679
|
-
}
|
|
680
|
-
case "dig":
|
|
681
|
-
return this.archaeologistSkill.dig(args[0], options);
|
|
682
|
-
case "lint":
|
|
683
|
-
if (!this.rlmOrchestrator) {
|
|
684
|
-
return {
|
|
685
|
-
success: false,
|
|
686
|
-
message: "RLM Orchestrator not initialized. Please wait a moment and try again."
|
|
687
|
-
};
|
|
688
|
-
}
|
|
689
|
-
const lintPath = args[0] || process.cwd();
|
|
690
|
-
const lintOptions = {
|
|
691
|
-
...options,
|
|
692
|
-
// Force use of linting agent
|
|
693
|
-
agents: ["linting"],
|
|
694
|
-
maxParallel: 1,
|
|
695
|
-
reviewStages: 1,
|
|
696
|
-
verboseLogging: true
|
|
697
|
-
};
|
|
698
|
-
const lintTask = `Perform comprehensive linting on ${lintPath}: Check for syntax errors, type issues, formatting violations, security vulnerabilities, performance anti-patterns, and unused code. Provide actionable fixes.`;
|
|
699
|
-
try {
|
|
700
|
-
const result = await this.rlmOrchestrator.execute(
|
|
701
|
-
lintTask,
|
|
702
|
-
{ path: lintPath, ...options },
|
|
703
|
-
lintOptions
|
|
704
|
-
);
|
|
705
|
-
return {
|
|
706
|
-
success: result.success,
|
|
707
|
-
message: `Linting ${result.success ? "completed" : "failed"}`,
|
|
708
|
-
data: {
|
|
709
|
-
issuesFound: result.issuesFound,
|
|
710
|
-
issuesFixed: result.issuesFixed,
|
|
711
|
-
duration: `${result.duration}ms`,
|
|
712
|
-
totalTokens: result.totalTokens,
|
|
713
|
-
details: result.rootNode
|
|
714
|
-
}
|
|
715
|
-
};
|
|
716
|
-
} catch (error) {
|
|
717
|
-
return {
|
|
718
|
-
success: false,
|
|
719
|
-
message: `Linting failed: ${error.message}`
|
|
720
|
-
};
|
|
721
|
-
}
|
|
722
|
-
case "rlm":
|
|
723
|
-
if (!this.rlmOrchestrator) {
|
|
724
|
-
return {
|
|
725
|
-
success: false,
|
|
726
|
-
message: "RLM Orchestrator not initialized. Please wait a moment and try again."
|
|
727
|
-
};
|
|
728
|
-
}
|
|
729
|
-
return this.rlmOrchestrator.execute(args[0], options);
|
|
730
|
-
case "repo":
|
|
731
|
-
case "ingest":
|
|
732
|
-
if (!this.repoIngestionSkill) {
|
|
733
|
-
return {
|
|
734
|
-
success: false,
|
|
735
|
-
message: "Repo ingestion skill not initialized. Please configure ChromaDB."
|
|
736
|
-
};
|
|
737
|
-
}
|
|
738
|
-
const repoCommand = args[0];
|
|
739
|
-
switch (repoCommand) {
|
|
740
|
-
case "ingest":
|
|
741
|
-
const repoPath = args[1] || process.cwd();
|
|
742
|
-
const repoName = args[2] || path.basename(repoPath);
|
|
743
|
-
return await this.repoIngestionSkill.ingestRepository(
|
|
744
|
-
repoPath,
|
|
745
|
-
repoName,
|
|
746
|
-
options
|
|
747
|
-
);
|
|
748
|
-
case "update":
|
|
749
|
-
const updatePath = args[1] || process.cwd();
|
|
750
|
-
const updateName = args[2] || path.basename(updatePath);
|
|
751
|
-
return await this.repoIngestionSkill.updateRepository(
|
|
752
|
-
updatePath,
|
|
753
|
-
updateName,
|
|
754
|
-
options
|
|
755
|
-
);
|
|
756
|
-
case "search":
|
|
757
|
-
const query = args[1];
|
|
758
|
-
if (!query) {
|
|
759
|
-
return {
|
|
760
|
-
success: false,
|
|
761
|
-
message: "Search query required"
|
|
762
|
-
};
|
|
763
|
-
}
|
|
764
|
-
const results = await this.repoIngestionSkill.searchCode(query, {
|
|
765
|
-
repoName: options?.repoName,
|
|
766
|
-
language: options?.language,
|
|
767
|
-
limit: options?.limit,
|
|
768
|
-
includeContext: options?.includeContext
|
|
769
|
-
});
|
|
770
|
-
return {
|
|
771
|
-
success: true,
|
|
772
|
-
message: `Found ${results.length} results`,
|
|
773
|
-
data: results
|
|
774
|
-
};
|
|
775
|
-
case "stats":
|
|
776
|
-
const stats = await this.repoIngestionSkill.getRepoStats(args[1]);
|
|
777
|
-
return {
|
|
778
|
-
success: true,
|
|
779
|
-
message: "Repository statistics",
|
|
780
|
-
data: stats
|
|
781
|
-
};
|
|
782
|
-
default:
|
|
783
|
-
return {
|
|
784
|
-
success: false,
|
|
785
|
-
message: `Unknown repo command: ${repoCommand}. Use: ingest, update, search, or stats`
|
|
786
|
-
};
|
|
787
|
-
}
|
|
788
|
-
case "dashboard":
|
|
789
|
-
const dashboardCmd = args[0];
|
|
790
|
-
if (!this.dashboardLauncher) {
|
|
791
|
-
return {
|
|
792
|
-
success: false,
|
|
793
|
-
message: "Dashboard launcher not yet initialized"
|
|
794
|
-
};
|
|
795
|
-
}
|
|
796
|
-
switch (dashboardCmd) {
|
|
797
|
-
case "launch":
|
|
798
|
-
await this.dashboardLauncher.launch();
|
|
799
|
-
return {
|
|
800
|
-
success: true,
|
|
801
|
-
message: "Dashboard launched",
|
|
802
|
-
action: "open-browser"
|
|
803
|
-
};
|
|
804
|
-
case "stop":
|
|
805
|
-
await this.dashboardLauncher.stop();
|
|
806
|
-
return {
|
|
807
|
-
success: true,
|
|
808
|
-
message: "Dashboard stopped"
|
|
809
|
-
};
|
|
810
|
-
default:
|
|
811
|
-
await this.dashboardLauncher.launch();
|
|
812
|
-
return {
|
|
813
|
-
success: true,
|
|
814
|
-
message: "Dashboard launched",
|
|
815
|
-
action: "open-browser"
|
|
816
|
-
};
|
|
817
|
-
}
|
|
818
|
-
case "recursive":
|
|
819
|
-
if (!this.rlmOrchestrator) {
|
|
820
|
-
return {
|
|
821
|
-
success: false,
|
|
822
|
-
message: "RLM Orchestrator not initialized. Please wait a moment and try again."
|
|
823
|
-
};
|
|
824
|
-
}
|
|
825
|
-
const task = args.join(" ") || "Analyze and improve the current code";
|
|
826
|
-
const rlmOptions = options;
|
|
827
|
-
try {
|
|
828
|
-
logger.info("Starting RLM execution", { task });
|
|
829
|
-
const result = await this.rlmOrchestrator.execute(
|
|
830
|
-
task,
|
|
831
|
-
{
|
|
832
|
-
files: rlmOptions.files || [],
|
|
833
|
-
query: task
|
|
834
|
-
},
|
|
835
|
-
rlmOptions
|
|
836
|
-
);
|
|
837
|
-
return {
|
|
838
|
-
success: result.success,
|
|
839
|
-
message: `RLM execution ${result.success ? "completed" : "failed"}`,
|
|
840
|
-
data: {
|
|
841
|
-
duration: `${result.duration}ms`,
|
|
842
|
-
totalTokens: result.totalTokens,
|
|
843
|
-
totalCost: `$${result.totalCost.toFixed(2)}`,
|
|
844
|
-
testsGenerated: result.testsGenerated,
|
|
845
|
-
improvements: result.improvements.length,
|
|
846
|
-
issuesFound: result.issuesFound,
|
|
847
|
-
issuesFixed: result.issuesFixed,
|
|
848
|
-
executionTree: result.rootNode
|
|
849
|
-
}
|
|
850
|
-
};
|
|
851
|
-
} catch (error) {
|
|
852
|
-
logger.error("RLM execution error:", error);
|
|
853
|
-
return {
|
|
854
|
-
success: false,
|
|
855
|
-
message: `RLM execution failed: ${error.message}`
|
|
856
|
-
};
|
|
857
|
-
}
|
|
858
|
-
case "api":
|
|
859
|
-
const apiCmd = args[0];
|
|
860
|
-
switch (apiCmd) {
|
|
861
|
-
case "add":
|
|
862
|
-
return this.apiSkill.add(args[1], args[2], {
|
|
863
|
-
spec: options?.spec,
|
|
864
|
-
authType: options?.authType,
|
|
865
|
-
headerName: options?.headerName,
|
|
866
|
-
envVar: options?.envVar
|
|
867
|
-
});
|
|
868
|
-
case "list":
|
|
869
|
-
return this.apiSkill.list();
|
|
870
|
-
case "describe":
|
|
871
|
-
return this.apiSkill.describe(args[1], args[2]);
|
|
872
|
-
case "exec":
|
|
873
|
-
const execParams = {};
|
|
874
|
-
for (let i = 3; i < args.length; i += 2) {
|
|
875
|
-
if (args[i] && args[i + 1]) {
|
|
876
|
-
execParams[args[i].replace("--", "")] = args[i + 1];
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
return this.apiSkill.exec(args[1], args[2], execParams, {
|
|
880
|
-
raw: options?.raw,
|
|
881
|
-
filter: options?.filter
|
|
882
|
-
});
|
|
883
|
-
case "auth":
|
|
884
|
-
return this.apiSkill.auth(args[1], {
|
|
885
|
-
token: options?.token,
|
|
886
|
-
envVar: options?.envVar,
|
|
887
|
-
oauth: options?.oauth,
|
|
888
|
-
scopes: options?.scopes?.split(",")
|
|
889
|
-
});
|
|
890
|
-
case "sync":
|
|
891
|
-
return this.apiSkill.sync(args[1]);
|
|
892
|
-
case "remove":
|
|
893
|
-
return this.apiSkill.remove(args[1]);
|
|
894
|
-
case "help":
|
|
895
|
-
default:
|
|
896
|
-
return {
|
|
897
|
-
success: true,
|
|
898
|
-
message: this.apiSkill.getHelp()
|
|
899
|
-
};
|
|
900
|
-
}
|
|
901
|
-
default:
|
|
902
|
-
return {
|
|
903
|
-
success: false,
|
|
904
|
-
message: `Unknown skill: ${skillName}`
|
|
905
|
-
};
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
getAvailableSkills() {
|
|
909
|
-
const skills = ["handoff", "checkpoint", "dig", "dashboard", "api"];
|
|
910
|
-
if (this.repoIngestionSkill) {
|
|
911
|
-
skills.push("repo");
|
|
912
|
-
}
|
|
913
|
-
if (this.rlmOrchestrator) {
|
|
914
|
-
skills.push("rlm", "lint");
|
|
915
|
-
}
|
|
916
|
-
return skills;
|
|
917
|
-
}
|
|
918
|
-
getSkillHelp(skillName) {
|
|
919
|
-
switch (skillName) {
|
|
920
|
-
case "handoff":
|
|
921
|
-
return `
|
|
922
|
-
/handoff @user "message" [--priority high] [--frames frame1,frame2]
|
|
923
|
-
Streamline frame handoffs between team members
|
|
924
|
-
`;
|
|
925
|
-
case "checkpoint":
|
|
926
|
-
return `
|
|
927
|
-
/checkpoint create "description" [--files file1,file2] [--auto-detect-risky]
|
|
928
|
-
/checkpoint restore <id>
|
|
929
|
-
/checkpoint list [--limit 10] [--since "2024-01-01"]
|
|
930
|
-
/checkpoint diff <id1> <id2>
|
|
931
|
-
Create and manage recovery points
|
|
932
|
-
`;
|
|
933
|
-
case "dig":
|
|
934
|
-
return `
|
|
935
|
-
/dig "query" [--depth 6months] [--patterns] [--decisions] [--timeline]
|
|
936
|
-
Deep historical context retrieval across sessions
|
|
937
|
-
`;
|
|
938
|
-
case "lint":
|
|
939
|
-
return `
|
|
940
|
-
/lint [path] [options]
|
|
941
|
-
Perform comprehensive code linting and quality checks
|
|
942
|
-
|
|
943
|
-
Automatically checks for:
|
|
944
|
-
- Syntax errors and type issues
|
|
945
|
-
- Code formatting and style violations
|
|
946
|
-
- Security vulnerabilities
|
|
947
|
-
- Performance anti-patterns
|
|
948
|
-
- Unused imports and dead code
|
|
949
|
-
- Code smells and complexity issues
|
|
950
|
-
|
|
951
|
-
Usage:
|
|
952
|
-
stackmemory skills lint # Lint current directory
|
|
953
|
-
stackmemory skills lint src/ # Lint specific directory
|
|
954
|
-
stackmemory skills lint src/file.ts # Lint specific file
|
|
955
|
-
|
|
956
|
-
Options:
|
|
957
|
-
--fix Automatically fix issues where possible
|
|
958
|
-
--format Focus on formatting issues
|
|
959
|
-
--security Focus on security vulnerabilities
|
|
960
|
-
--performance Focus on performance issues
|
|
961
|
-
--verbose Show detailed output
|
|
962
|
-
|
|
963
|
-
Examples:
|
|
964
|
-
stackmemory skills lint --fix
|
|
965
|
-
stackmemory skills lint src/ --security --verbose
|
|
966
|
-
`;
|
|
967
|
-
case "rlm":
|
|
968
|
-
return `
|
|
969
|
-
/rlm "task description" [options]
|
|
970
|
-
Execute complex tasks with recursive agent orchestration
|
|
971
|
-
|
|
972
|
-
Options:
|
|
973
|
-
--max-parallel <n> Max concurrent subagents (default: 5)
|
|
974
|
-
--max-recursion <n> Max recursion depth (default: 4)
|
|
975
|
-
--max-tokens-per-agent <n> Token budget per agent (default: 30000)
|
|
976
|
-
--review-stages <n> Review iterations (default: 3)
|
|
977
|
-
--quality-threshold <n> Target quality 0-1 (default: 0.85)
|
|
978
|
-
--test-mode <mode> unit/integration/e2e/all (default: all)
|
|
979
|
-
--verbose Show all operations
|
|
980
|
-
--timeout-per-agent <s> Timeout in seconds (default: 300)
|
|
981
|
-
|
|
982
|
-
Examples:
|
|
983
|
-
stackmemory skills rlm "Generate tests for API endpoints"
|
|
984
|
-
stackmemory skills rlm "Refactor auth system" --quality-threshold 0.95
|
|
985
|
-
`;
|
|
986
|
-
case "dashboard":
|
|
987
|
-
return `
|
|
988
|
-
/dashboard [launch|stop]
|
|
989
|
-
Launch the StackMemory web dashboard for real-time monitoring
|
|
990
|
-
- launch: Start the web dashboard and open in browser (default)
|
|
991
|
-
- stop: Stop the dashboard server
|
|
992
|
-
Auto-launches on new sessions when configured
|
|
993
|
-
`;
|
|
994
|
-
case "repo":
|
|
995
|
-
return `
|
|
996
|
-
/repo ingest [path] [name] [--incremental] [--include-tests] [--include-docs]
|
|
997
|
-
/repo update [path] [name] [--force-update]
|
|
998
|
-
/repo search "query" [--repo-name name] [--language lang] [--limit n]
|
|
999
|
-
/repo stats [repo-name]
|
|
1000
|
-
|
|
1001
|
-
Ingest and search code repositories in ChromaDB:
|
|
1002
|
-
- ingest: Index a new repository (defaults to current directory)
|
|
1003
|
-
- update: Update an existing repository with changes
|
|
1004
|
-
- search: Semantic search across ingested code
|
|
1005
|
-
- stats: View statistics about ingested repositories
|
|
1006
|
-
|
|
1007
|
-
Options:
|
|
1008
|
-
- --incremental: Only process changed files
|
|
1009
|
-
- --include-tests: Include test files in indexing
|
|
1010
|
-
- --include-docs: Include documentation files
|
|
1011
|
-
- --force-update: Force re-indexing of all files
|
|
1012
|
-
- --language: Filter search by programming language
|
|
1013
|
-
- --limit: Maximum search results (default: 20)
|
|
1014
|
-
`;
|
|
1015
|
-
case "recursive":
|
|
1016
|
-
return `
|
|
1017
|
-
/rlm "task description" [options]
|
|
1018
|
-
|
|
1019
|
-
Recursive Language Model orchestration using Claude Code's Task tool:
|
|
1020
|
-
- Decomposes complex tasks into parallel/sequential subtasks
|
|
1021
|
-
- Spawns specialized Claude subagents for each task type
|
|
1022
|
-
- Automatic test generation and multi-stage review
|
|
1023
|
-
- Handles large codebases through intelligent chunking
|
|
1024
|
-
|
|
1025
|
-
Subagent Types:
|
|
1026
|
-
- Planning: Task decomposition and strategy
|
|
1027
|
-
- Code: Implementation and refactoring
|
|
1028
|
-
- Testing: Comprehensive test generation (unit/integration/E2E)
|
|
1029
|
-
- Linting: Code quality and formatting
|
|
1030
|
-
- Review: Multi-stage code review and quality scoring
|
|
1031
|
-
- Improve: Implement review suggestions
|
|
1032
|
-
- Context: Information retrieval
|
|
1033
|
-
- Publish: NPM/GitHub releases
|
|
1034
|
-
|
|
1035
|
-
Options:
|
|
1036
|
-
- --max-parallel N: Max concurrent subagents (default: 5)
|
|
1037
|
-
- --max-recursion N: Max recursion depth (default: 4)
|
|
1038
|
-
- --review-stages N: Number of review iterations (default: 3)
|
|
1039
|
-
- --quality-threshold N: Target quality score 0-1 (default: 0.85)
|
|
1040
|
-
- --test-mode [unit|integration|e2e|all]: Test generation mode (default: all)
|
|
1041
|
-
- --verbose: Show all recursive operations
|
|
1042
|
-
|
|
1043
|
-
Examples:
|
|
1044
|
-
/rlm "Refactor the authentication system with full test coverage"
|
|
1045
|
-
/rlm "Generate comprehensive tests for the API endpoints" --test-mode integration
|
|
1046
|
-
/rlm "Review and improve code quality" --review-stages 5 --quality-threshold 0.95
|
|
1047
|
-
`;
|
|
1048
|
-
case "api":
|
|
1049
|
-
return this.apiSkill.getHelp();
|
|
1050
|
-
default:
|
|
1051
|
-
return `Unknown skill: ${skillName}`;
|
|
1052
|
-
}
|
|
1053
|
-
}
|
|
1054
|
-
}
|
|
1055
|
-
export {
|
|
1056
|
-
ArchaeologistSkill,
|
|
1057
|
-
CheckpointSkill,
|
|
1058
|
-
ClaudeSkillsManager,
|
|
1059
|
-
HandoffSkill
|
|
1060
|
-
};
|
|
1061
|
-
//# sourceMappingURL=claude-skills.js.map
|