@stackmemoryai/stackmemory 0.3.0 ā 0.3.3
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 +52 -272
- package/dist/cli/codex-sm.js +48 -19
- package/dist/cli/codex-sm.js.map +2 -2
- package/dist/cli/commands/clear.js +191 -0
- package/dist/cli/commands/clear.js.map +7 -0
- package/dist/cli/commands/config.js +152 -1
- package/dist/cli/commands/config.js.map +2 -2
- package/dist/cli/commands/dashboard.js +178 -0
- package/dist/cli/commands/dashboard.js.map +7 -0
- package/dist/cli/commands/handoff.js +125 -8
- package/dist/cli/commands/handoff.js.map +2 -2
- package/dist/cli/commands/linear-create.js +132 -0
- package/dist/cli/commands/linear-create.js.map +7 -0
- package/dist/cli/commands/linear-list.js +69 -0
- package/dist/cli/commands/linear-list.js.map +7 -0
- package/dist/cli/commands/linear-migrate.js +40 -0
- package/dist/cli/commands/linear-migrate.js.map +7 -0
- package/dist/cli/commands/linear.js +185 -36
- package/dist/cli/commands/linear.js.map +2 -2
- package/dist/cli/commands/monitor.js +309 -0
- package/dist/cli/commands/monitor.js.map +7 -0
- package/dist/cli/commands/quality.js +414 -0
- package/dist/cli/commands/quality.js.map +7 -0
- package/dist/cli/commands/storage.js +275 -0
- package/dist/cli/commands/storage.js.map +7 -0
- package/dist/cli/commands/tui.js +66 -0
- package/dist/cli/commands/tui.js.map +7 -0
- package/dist/cli/commands/workflow.js +134 -0
- package/dist/cli/commands/workflow.js.map +7 -0
- package/dist/cli/index.js +105 -9
- package/dist/cli/index.js.map +3 -3
- package/dist/core/analytics/team-analytics.js +374 -0
- package/dist/core/analytics/team-analytics.js.map +7 -0
- package/dist/core/context/context-bridge.js +234 -0
- package/dist/core/context/context-bridge.js.map +7 -0
- package/dist/core/context/dual-stack-manager.js +850 -0
- package/dist/core/context/dual-stack-manager.js.map +7 -0
- package/dist/core/context/frame-handoff-manager.js +384 -0
- package/dist/core/context/frame-handoff-manager.js.map +7 -0
- package/dist/core/context/frame-manager.js +132 -12
- package/dist/core/context/frame-manager.js.map +2 -2
- package/dist/core/context/permission-manager.js +181 -0
- package/dist/core/context/permission-manager.js.map +7 -0
- package/dist/core/context/shared-context-layer.js +386 -0
- package/dist/core/context/shared-context-layer.js.map +7 -0
- package/dist/core/context/stack-merge-resolver.js +600 -0
- package/dist/core/context/stack-merge-resolver.js.map +7 -0
- package/dist/core/context/validation.js +121 -0
- package/dist/core/context/validation.js.map +7 -0
- package/dist/core/database/connection-pool.js +266 -175
- package/dist/core/database/connection-pool.js.map +2 -2
- package/dist/core/database/database-adapter.js +51 -0
- package/dist/core/database/database-adapter.js.map +7 -0
- package/dist/core/database/migration-manager.js +514 -0
- package/dist/core/database/migration-manager.js.map +7 -0
- package/dist/core/database/paradedb-adapter.js +970 -0
- package/dist/core/database/paradedb-adapter.js.map +7 -0
- package/dist/core/database/query-router.js +421 -0
- package/dist/core/database/query-router.js.map +7 -0
- package/dist/core/database/sqlite-adapter.js +547 -0
- package/dist/core/database/sqlite-adapter.js.map +7 -0
- package/dist/core/errors/index.js +21 -1
- package/dist/core/errors/index.js.map +2 -2
- package/dist/core/frame/workflow-templates-stub.js +42 -0
- package/dist/core/frame/workflow-templates-stub.js.map +7 -0
- package/dist/core/frame/workflow-templates.js +276 -0
- package/dist/core/frame/workflow-templates.js.map +7 -0
- package/dist/core/merge/conflict-detector.js +5 -2
- package/dist/core/merge/conflict-detector.js.map +2 -2
- package/dist/core/merge/resolution-engine.js +3 -14
- package/dist/core/merge/resolution-engine.js.map +2 -2
- package/dist/core/merge/stack-diff.js.map +2 -2
- package/dist/core/monitoring/logger.js +18 -3
- package/dist/core/monitoring/logger.js.map +2 -2
- package/dist/core/monitoring/session-monitor.js +296 -0
- package/dist/core/monitoring/session-monitor.js.map +7 -0
- package/dist/core/retrieval/context-retriever.js +475 -0
- package/dist/core/retrieval/context-retriever.js.map +7 -0
- package/dist/core/retrieval/graph-retrieval.js +658 -0
- package/dist/core/retrieval/graph-retrieval.js.map +7 -0
- package/dist/core/retrieval/hierarchical-retrieval.js +652 -0
- package/dist/core/retrieval/hierarchical-retrieval.js.map +7 -0
- package/dist/core/retrieval/retrieval-benchmarks.js +517 -0
- package/dist/core/retrieval/retrieval-benchmarks.js.map +7 -0
- package/dist/core/session/clear-survival-stub.js +49 -0
- package/dist/core/session/clear-survival-stub.js.map +7 -0
- package/dist/core/session/clear-survival.js +426 -0
- package/dist/core/session/clear-survival.js.map +7 -0
- package/dist/core/session/handoff-generator.js +339 -0
- package/dist/core/session/handoff-generator.js.map +7 -0
- package/dist/core/session/session-manager.js +61 -26
- package/dist/core/session/session-manager.js.map +3 -3
- package/dist/core/skills/index.js +3 -0
- package/dist/core/skills/index.js.map +7 -0
- package/dist/core/skills/skill-storage.js +749 -0
- package/dist/core/skills/skill-storage.js.map +7 -0
- package/dist/core/skills/types.js +189 -0
- package/dist/core/skills/types.js.map +7 -0
- package/dist/core/storage/railway-optimized-storage.js +550 -0
- package/dist/core/storage/railway-optimized-storage.js.map +7 -0
- package/dist/core/storage/remote-storage.js +456 -0
- package/dist/core/storage/remote-storage.js.map +7 -0
- package/dist/core/trace/trace-detector.js +136 -5
- package/dist/core/trace/trace-detector.js.map +2 -2
- package/dist/core/trace/trace-store.js.map +2 -2
- package/dist/features/tui/components/analytics-panel.js +136 -0
- package/dist/features/tui/components/analytics-panel.js.map +7 -0
- package/dist/features/tui/components/frame-visualizer.js +377 -0
- package/dist/features/tui/components/frame-visualizer.js.map +7 -0
- package/dist/features/tui/components/pr-tracker.js +123 -0
- package/dist/features/tui/components/pr-tracker.js.map +7 -0
- package/dist/features/tui/components/session-monitor.js +286 -0
- package/dist/features/tui/components/session-monitor.js.map +7 -0
- package/dist/features/tui/components/subagent-fleet.js +388 -0
- package/dist/features/tui/components/subagent-fleet.js.map +7 -0
- package/dist/features/tui/components/task-board.js +475 -0
- package/dist/features/tui/components/task-board.js.map +7 -0
- package/dist/features/tui/index.js +397 -0
- package/dist/features/tui/index.js.map +7 -0
- package/dist/features/tui/services/data-service.js +654 -0
- package/dist/features/tui/services/data-service.js.map +7 -0
- package/dist/features/tui/services/websocket-client.js +149 -0
- package/dist/features/tui/services/websocket-client.js.map +7 -0
- package/dist/features/tui/terminal-compat.js +205 -0
- package/dist/features/tui/terminal-compat.js.map +7 -0
- package/dist/features/tui/types.js +1 -0
- package/dist/features/tui/types.js.map +7 -0
- package/dist/integrations/claude-code/enhanced-pre-clear-hooks.js +455 -0
- package/dist/integrations/claude-code/enhanced-pre-clear-hooks.js.map +7 -0
- package/dist/integrations/claude-code/lifecycle-hooks.js +250 -0
- package/dist/integrations/claude-code/lifecycle-hooks.js.map +7 -0
- package/dist/integrations/claude-code/post-task-hooks.js +541 -0
- package/dist/integrations/claude-code/post-task-hooks.js.map +7 -0
- package/dist/integrations/linear/client.js +22 -4
- package/dist/integrations/linear/client.js.map +2 -2
- package/dist/integrations/linear/migration.js +299 -0
- package/dist/integrations/linear/migration.js.map +7 -0
- package/dist/integrations/linear/oauth-server.js +396 -0
- package/dist/integrations/linear/oauth-server.js.map +7 -0
- package/dist/integrations/linear/rest-client.js +199 -0
- package/dist/integrations/linear/rest-client.js.map +7 -0
- package/dist/integrations/linear/sync.js +14 -2
- package/dist/integrations/linear/sync.js.map +2 -2
- package/dist/integrations/linear/webhook-handler.js +200 -0
- package/dist/integrations/linear/webhook-handler.js.map +7 -0
- package/dist/integrations/mcp/handlers/skill-handlers.js +514 -0
- package/dist/integrations/mcp/handlers/skill-handlers.js.map +7 -0
- package/dist/integrations/mcp/middleware/tool-scoring.js +352 -0
- package/dist/integrations/mcp/middleware/tool-scoring.js.map +7 -0
- package/dist/integrations/mcp/refactored-server.js +31 -3
- package/dist/integrations/mcp/refactored-server.js.map +2 -2
- package/dist/integrations/mcp/server.js +25 -7
- package/dist/integrations/mcp/server.js.map +2 -2
- package/dist/mcp/stackmemory-mcp-server.js.map +1 -1
- package/dist/models/user.model.js +3 -0
- package/dist/models/user.model.js.map +2 -2
- package/dist/services/context-service.js.map +2 -2
- package/dist/utils/formatting.js +58 -0
- package/dist/utils/formatting.js.map +7 -0
- package/package.json +24 -5
- package/dist/cli/__tests__/index.test.js +0 -290
- package/dist/cli/__tests__/index.test.js.map +0 -7
- package/dist/core/config/__tests__/config-manager.test.js +0 -248
- package/dist/core/config/__tests__/config-manager.test.js.map +0 -7
- package/dist/core/context/__tests__/frame-manager.test.js +0 -879
- package/dist/core/context/__tests__/frame-manager.test.js.map +0 -7
- package/dist/core/digest/__tests__/enhanced-hybrid-digest.test.js +0 -379
- package/dist/core/digest/__tests__/enhanced-hybrid-digest.test.js.map +0 -7
- package/dist/core/digest/__tests__/frame-digest-integration.test.js +0 -230
- package/dist/core/digest/__tests__/frame-digest-integration.test.js.map +0 -7
- package/dist/core/errors/__tests__/error-handling.test.js +0 -270
- package/dist/core/errors/__tests__/error-handling.test.js.map +0 -7
- package/dist/core/merge/__tests__/conflict-scenarios.test.js +0 -414
- package/dist/core/merge/__tests__/conflict-scenarios.test.js.map +0 -7
- package/dist/core/query/__tests__/query-parser.test.js +0 -301
- package/dist/core/query/__tests__/query-parser.test.js.map +0 -7
- package/dist/core/query/__tests__/query-templates.test.js +0 -210
- package/dist/core/query/__tests__/query-templates.test.js.map +0 -7
- package/dist/core/trace/trace-detector.test.js +0 -401
- package/dist/core/trace/trace-detector.test.js.map +0 -7
- package/dist/features/tasks/__tests__/pebbles-task-store.test.js +0 -747
- package/dist/features/tasks/__tests__/pebbles-task-store.test.js.map +0 -7
- package/dist/integrations/linear/__tests__/auth.test.js +0 -558
- package/dist/integrations/linear/__tests__/auth.test.js.map +0 -7
- package/dist/integrations/linear/__tests__/sync-service.test.js +0 -760
- package/dist/integrations/linear/__tests__/sync-service.test.js.map +0 -7
- package/dist/integrations/mcp/__tests__/server.test.js +0 -798
- package/dist/integrations/mcp/__tests__/server.test.js.map +0 -7
- package/dist/scripts/benchmark-performance.d.ts +0 -7
- package/dist/scripts/benchmark-performance.d.ts.map +0 -1
- package/dist/scripts/benchmark-performance.js +0 -44
- package/dist/scripts/benchmark-performance.js.map +0 -1
- package/dist/scripts/cancel-duplicate-tasks.d.ts +0 -7
- package/dist/scripts/cancel-duplicate-tasks.d.ts.map +0 -1
- package/dist/scripts/cancel-duplicate-tasks.js +0 -172
- package/dist/scripts/cancel-duplicate-tasks.js.map +0 -1
- package/dist/scripts/cleanup-duplicate-tasks.d.ts +0 -12
- package/dist/scripts/cleanup-duplicate-tasks.d.ts.map +0 -1
- package/dist/scripts/cleanup-duplicate-tasks.js +0 -215
- package/dist/scripts/cleanup-duplicate-tasks.js.map +0 -1
- package/dist/scripts/initialize.d.ts +0 -6
- package/dist/scripts/initialize.d.ts.map +0 -1
- package/dist/scripts/initialize.js +0 -93
- package/dist/scripts/initialize.js.map +0 -1
- package/dist/scripts/list-linear-tasks.d.ts +0 -6
- package/dist/scripts/list-linear-tasks.d.ts.map +0 -1
- package/dist/scripts/list-linear-tasks.js +0 -121
- package/dist/scripts/list-linear-tasks.js.map +0 -1
- package/dist/scripts/merge-linear-duplicates-safe.d.ts +0 -7
- package/dist/scripts/merge-linear-duplicates-safe.d.ts.map +0 -1
- package/dist/scripts/merge-linear-duplicates-safe.js +0 -267
- package/dist/scripts/merge-linear-duplicates-safe.js.map +0 -1
- package/dist/scripts/show-linear-summary.d.ts +0 -6
- package/dist/scripts/show-linear-summary.d.ts.map +0 -1
- package/dist/scripts/show-linear-summary.js +0 -120
- package/dist/scripts/show-linear-summary.js.map +0 -1
- package/dist/scripts/status.d.ts +0 -6
- package/dist/scripts/status.d.ts.map +0 -1
- package/dist/scripts/status.js +0 -101
- package/dist/scripts/status.js.map +0 -1
- package/dist/src/agents/core/agent-task-manager.d.ts +0 -154
- package/dist/src/agents/core/agent-task-manager.d.ts.map +0 -1
- package/dist/src/agents/core/agent-task-manager.js +0 -504
- package/dist/src/agents/core/agent-task-manager.js.map +0 -1
- package/dist/src/agents/verifiers/base-verifier.d.ts +0 -112
- package/dist/src/agents/verifiers/base-verifier.d.ts.map +0 -1
- package/dist/src/agents/verifiers/base-verifier.js +0 -130
- package/dist/src/agents/verifiers/base-verifier.js.map +0 -1
- package/dist/src/agents/verifiers/formatter-verifier.d.ts +0 -14
- package/dist/src/agents/verifiers/formatter-verifier.d.ts.map +0 -1
- package/dist/src/agents/verifiers/formatter-verifier.js +0 -107
- package/dist/src/agents/verifiers/formatter-verifier.js.map +0 -1
- package/dist/src/agents/verifiers/llm-judge.d.ts +0 -46
- package/dist/src/agents/verifiers/llm-judge.d.ts.map +0 -1
- package/dist/src/agents/verifiers/llm-judge.js +0 -248
- package/dist/src/agents/verifiers/llm-judge.js.map +0 -1
- package/dist/src/cli/auto-detect.d.ts +0 -61
- package/dist/src/cli/auto-detect.d.ts.map +0 -1
- package/dist/src/cli/auto-detect.js +0 -350
- package/dist/src/cli/auto-detect.js.map +0 -1
- package/dist/src/cli/browser-test.d.ts +0 -6
- package/dist/src/cli/browser-test.d.ts.map +0 -1
- package/dist/src/cli/browser-test.js +0 -32
- package/dist/src/cli/browser-test.js.map +0 -1
- package/dist/src/cli/claude-sm.d.ts +0 -7
- package/dist/src/cli/claude-sm.d.ts.map +0 -1
- package/dist/src/cli/claude-sm.js +0 -412
- package/dist/src/cli/claude-sm.js.map +0 -1
- package/dist/src/cli/commands/agent.d.ts +0 -9
- package/dist/src/cli/commands/agent.d.ts.map +0 -1
- package/dist/src/cli/commands/agent.js +0 -303
- package/dist/src/cli/commands/agent.js.map +0 -1
- package/dist/src/cli/commands/config.d.ts +0 -6
- package/dist/src/cli/commands/config.d.ts.map +0 -1
- package/dist/src/cli/commands/config.js +0 -224
- package/dist/src/cli/commands/config.js.map +0 -1
- package/dist/src/cli/commands/context.d.ts +0 -7
- package/dist/src/cli/commands/context.d.ts.map +0 -1
- package/dist/src/cli/commands/context.js +0 -365
- package/dist/src/cli/commands/context.js.map +0 -1
- package/dist/src/cli/commands/handoff.d.ts +0 -6
- package/dist/src/cli/commands/handoff.d.ts.map +0 -1
- package/dist/src/cli/commands/handoff.js +0 -212
- package/dist/src/cli/commands/handoff.js.map +0 -1
- package/dist/src/cli/commands/linear-test.d.ts +0 -6
- package/dist/src/cli/commands/linear-test.d.ts.map +0 -1
- package/dist/src/cli/commands/linear-test.js +0 -123
- package/dist/src/cli/commands/linear-test.js.map +0 -1
- package/dist/src/cli/commands/linear.d.ts +0 -6
- package/dist/src/cli/commands/linear.d.ts.map +0 -1
- package/dist/src/cli/commands/linear.js +0 -393
- package/dist/src/cli/commands/linear.js.map +0 -1
- package/dist/src/cli/commands/log.d.ts +0 -7
- package/dist/src/cli/commands/log.d.ts.map +0 -1
- package/dist/src/cli/commands/log.js +0 -168
- package/dist/src/cli/commands/log.js.map +0 -1
- package/dist/src/cli/commands/onboard.d.ts +0 -8
- package/dist/src/cli/commands/onboard.d.ts.map +0 -1
- package/dist/src/cli/commands/onboard.js +0 -363
- package/dist/src/cli/commands/onboard.js.map +0 -1
- package/dist/src/cli/commands/projects.d.ts +0 -8
- package/dist/src/cli/commands/projects.d.ts.map +0 -1
- package/dist/src/cli/commands/projects.js +0 -220
- package/dist/src/cli/commands/projects.js.map +0 -1
- package/dist/src/cli/commands/search.d.ts +0 -7
- package/dist/src/cli/commands/search.d.ts.map +0 -1
- package/dist/src/cli/commands/search.js +0 -162
- package/dist/src/cli/commands/search.js.map +0 -1
- package/dist/src/cli/commands/session.d.ts +0 -7
- package/dist/src/cli/commands/session.d.ts.map +0 -1
- package/dist/src/cli/commands/session.js +0 -222
- package/dist/src/cli/commands/session.js.map +0 -1
- package/dist/src/cli/commands/tasks.d.ts +0 -7
- package/dist/src/cli/commands/tasks.d.ts.map +0 -1
- package/dist/src/cli/commands/tasks.js +0 -229
- package/dist/src/cli/commands/tasks.js.map +0 -1
- package/dist/src/cli/commands/webhook.d.ts +0 -3
- package/dist/src/cli/commands/webhook.d.ts.map +0 -1
- package/dist/src/cli/commands/webhook.js +0 -157
- package/dist/src/cli/commands/webhook.js.map +0 -1
- package/dist/src/cli/commands/worktree.d.ts +0 -8
- package/dist/src/cli/commands/worktree.d.ts.map +0 -1
- package/dist/src/cli/commands/worktree.js +0 -339
- package/dist/src/cli/commands/worktree.js.map +0 -1
- package/dist/src/cli/index.d.ts +0 -8
- package/dist/src/cli/index.d.ts.map +0 -1
- package/dist/src/cli/index.js +0 -995
- package/dist/src/cli/index.js.map +0 -1
- package/dist/src/cli/utils/viewer.d.ts +0 -3
- package/dist/src/cli/utils/viewer.d.ts.map +0 -1
- package/dist/src/cli/utils/viewer.js +0 -91
- package/dist/src/cli/utils/viewer.js.map +0 -1
- package/dist/src/core/config/config-manager.d.ts +0 -95
- package/dist/src/core/config/config-manager.d.ts.map +0 -1
- package/dist/src/core/config/config-manager.js +0 -359
- package/dist/src/core/config/config-manager.js.map +0 -1
- package/dist/src/core/config/types.d.ts +0 -72
- package/dist/src/core/config/types.d.ts.map +0 -1
- package/dist/src/core/config/types.js +0 -127
- package/dist/src/core/config/types.js.map +0 -1
- package/dist/src/core/context/auto-context.d.ts +0 -22
- package/dist/src/core/context/auto-context.d.ts.map +0 -1
- package/dist/src/core/context/auto-context.js +0 -77
- package/dist/src/core/context/auto-context.js.map +0 -1
- package/dist/src/core/context/compaction-handler.d.ts +0 -119
- package/dist/src/core/context/compaction-handler.d.ts.map +0 -1
- package/dist/src/core/context/compaction-handler.js +0 -306
- package/dist/src/core/context/compaction-handler.js.map +0 -1
- package/dist/src/core/context/frame-database.d.ts +0 -59
- package/dist/src/core/context/frame-database.d.ts.map +0 -1
- package/dist/src/core/context/frame-database.js +0 -333
- package/dist/src/core/context/frame-database.js.map +0 -1
- package/dist/src/core/context/frame-digest.d.ts +0 -59
- package/dist/src/core/context/frame-digest.d.ts.map +0 -1
- package/dist/src/core/context/frame-digest.js +0 -264
- package/dist/src/core/context/frame-digest.js.map +0 -1
- package/dist/src/core/context/frame-manager.d.ts +0 -112
- package/dist/src/core/context/frame-manager.d.ts.map +0 -1
- package/dist/src/core/context/frame-manager.js +0 -600
- package/dist/src/core/context/frame-manager.js.map +0 -1
- package/dist/src/core/context/frame-stack.d.ts +0 -85
- package/dist/src/core/context/frame-stack.d.ts.map +0 -1
- package/dist/src/core/context/frame-stack.js +0 -287
- package/dist/src/core/context/frame-stack.js.map +0 -1
- package/dist/src/core/context/frame-types.d.ts +0 -67
- package/dist/src/core/context/frame-types.d.ts.map +0 -1
- package/dist/src/core/context/frame-types.js +0 -6
- package/dist/src/core/context/frame-types.js.map +0 -1
- package/dist/src/core/context/index.d.ts +0 -11
- package/dist/src/core/context/index.d.ts.map +0 -1
- package/dist/src/core/context/index.js +0 -14
- package/dist/src/core/context/index.js.map +0 -1
- package/dist/src/core/context/model-aware-compaction.d.ts +0 -101
- package/dist/src/core/context/model-aware-compaction.d.ts.map +0 -1
- package/dist/src/core/context/model-aware-compaction.js +0 -616
- package/dist/src/core/context/model-aware-compaction.js.map +0 -1
- package/dist/src/core/context/refactored-frame-manager.d.ts +0 -99
- package/dist/src/core/context/refactored-frame-manager.d.ts.map +0 -1
- package/dist/src/core/context/refactored-frame-manager.js +0 -340
- package/dist/src/core/context/refactored-frame-manager.js.map +0 -1
- package/dist/src/core/database/batch-operations.d.ts +0 -118
- package/dist/src/core/database/batch-operations.d.ts.map +0 -1
- package/dist/src/core/database/batch-operations.js +0 -339
- package/dist/src/core/database/batch-operations.js.map +0 -1
- package/dist/src/core/database/connection-pool.d.ts +0 -79
- package/dist/src/core/database/connection-pool.d.ts.map +0 -1
- package/dist/src/core/database/connection-pool.js +0 -236
- package/dist/src/core/database/connection-pool.js.map +0 -1
- package/dist/src/core/database/query-cache.d.ts +0 -135
- package/dist/src/core/database/query-cache.d.ts.map +0 -1
- package/dist/src/core/database/query-cache.js +0 -294
- package/dist/src/core/database/query-cache.js.map +0 -1
- package/dist/src/core/digest/enhanced-hybrid-digest.d.ts +0 -125
- package/dist/src/core/digest/enhanced-hybrid-digest.d.ts.map +0 -1
- package/dist/src/core/digest/enhanced-hybrid-digest.js +0 -282
- package/dist/src/core/digest/enhanced-hybrid-digest.js.map +0 -1
- package/dist/src/core/digest/frame-digest-integration.d.ts +0 -67
- package/dist/src/core/digest/frame-digest-integration.d.ts.map +0 -1
- package/dist/src/core/digest/frame-digest-integration.js +0 -198
- package/dist/src/core/digest/frame-digest-integration.js.map +0 -1
- package/dist/src/core/digest/hybrid-digest-generator.d.ts +0 -76
- package/dist/src/core/digest/hybrid-digest-generator.d.ts.map +0 -1
- package/dist/src/core/digest/hybrid-digest-generator.js +0 -629
- package/dist/src/core/digest/hybrid-digest-generator.js.map +0 -1
- package/dist/src/core/digest/index.d.ts +0 -9
- package/dist/src/core/digest/index.d.ts.map +0 -1
- package/dist/src/core/digest/index.js +0 -9
- package/dist/src/core/digest/index.js.map +0 -1
- package/dist/src/core/digest/types.d.ts +0 -154
- package/dist/src/core/digest/types.d.ts.map +0 -1
- package/dist/src/core/digest/types.js +0 -18
- package/dist/src/core/digest/types.js.map +0 -1
- package/dist/src/core/errors/index.d.ts +0 -143
- package/dist/src/core/errors/index.d.ts.map +0 -1
- package/dist/src/core/errors/index.js +0 -282
- package/dist/src/core/errors/index.js.map +0 -1
- package/dist/src/core/errors/recovery.d.ts +0 -86
- package/dist/src/core/errors/recovery.d.ts.map +0 -1
- package/dist/src/core/errors/recovery.js +0 -274
- package/dist/src/core/errors/recovery.js.map +0 -1
- package/dist/src/core/merge/conflict-detector.d.ts +0 -122
- package/dist/src/core/merge/conflict-detector.d.ts.map +0 -1
- package/dist/src/core/merge/conflict-detector.js +0 -468
- package/dist/src/core/merge/conflict-detector.js.map +0 -1
- package/dist/src/core/merge/index.d.ts +0 -9
- package/dist/src/core/merge/index.d.ts.map +0 -1
- package/dist/src/core/merge/index.js +0 -9
- package/dist/src/core/merge/index.js.map +0 -1
- package/dist/src/core/merge/resolution-engine.d.ts +0 -120
- package/dist/src/core/merge/resolution-engine.d.ts.map +0 -1
- package/dist/src/core/merge/resolution-engine.js +0 -573
- package/dist/src/core/merge/resolution-engine.js.map +0 -1
- package/dist/src/core/merge/stack-diff.d.ts +0 -97
- package/dist/src/core/merge/stack-diff.d.ts.map +0 -1
- package/dist/src/core/merge/stack-diff.js +0 -516
- package/dist/src/core/merge/stack-diff.js.map +0 -1
- package/dist/src/core/merge/types.d.ts +0 -110
- package/dist/src/core/merge/types.d.ts.map +0 -1
- package/dist/src/core/merge/types.js +0 -6
- package/dist/src/core/merge/types.js.map +0 -1
- package/dist/src/core/monitoring/error-handler.d.ts +0 -46
- package/dist/src/core/monitoring/error-handler.d.ts.map +0 -1
- package/dist/src/core/monitoring/error-handler.js +0 -212
- package/dist/src/core/monitoring/error-handler.js.map +0 -1
- package/dist/src/core/monitoring/logger.d.ts +0 -24
- package/dist/src/core/monitoring/logger.d.ts.map +0 -1
- package/dist/src/core/monitoring/logger.js +0 -126
- package/dist/src/core/monitoring/logger.js.map +0 -1
- package/dist/src/core/monitoring/metrics.d.ts +0 -10
- package/dist/src/core/monitoring/metrics.d.ts.map +0 -1
- package/dist/src/core/monitoring/metrics.js +0 -152
- package/dist/src/core/monitoring/metrics.js.map +0 -1
- package/dist/src/core/monitoring/progress-tracker.d.ts +0 -95
- package/dist/src/core/monitoring/progress-tracker.d.ts.map +0 -1
- package/dist/src/core/monitoring/progress-tracker.js +0 -178
- package/dist/src/core/monitoring/progress-tracker.js.map +0 -1
- package/dist/src/core/performance/context-cache.d.ts +0 -109
- package/dist/src/core/performance/context-cache.d.ts.map +0 -1
- package/dist/src/core/performance/context-cache.js +0 -280
- package/dist/src/core/performance/context-cache.js.map +0 -1
- package/dist/src/core/performance/index.d.ts +0 -3
- package/dist/src/core/performance/index.d.ts.map +0 -1
- package/dist/src/core/performance/index.js +0 -3
- package/dist/src/core/performance/index.js.map +0 -1
- package/dist/src/core/performance/lazy-context-loader.d.ts +0 -93
- package/dist/src/core/performance/lazy-context-loader.d.ts.map +0 -1
- package/dist/src/core/performance/lazy-context-loader.js +0 -332
- package/dist/src/core/performance/lazy-context-loader.js.map +0 -1
- package/dist/src/core/performance/monitor.d.ts +0 -48
- package/dist/src/core/performance/monitor.d.ts.map +0 -1
- package/dist/src/core/performance/monitor.js +0 -226
- package/dist/src/core/performance/monitor.js.map +0 -1
- package/dist/src/core/performance/optimized-frame-context.d.ts +0 -74
- package/dist/src/core/performance/optimized-frame-context.d.ts.map +0 -1
- package/dist/src/core/performance/optimized-frame-context.js +0 -330
- package/dist/src/core/performance/optimized-frame-context.js.map +0 -1
- package/dist/src/core/performance/performance-benchmark.d.ts +0 -50
- package/dist/src/core/performance/performance-benchmark.d.ts.map +0 -1
- package/dist/src/core/performance/performance-benchmark.js +0 -290
- package/dist/src/core/performance/performance-benchmark.js.map +0 -1
- package/dist/src/core/performance/performance-profiler.d.ts +0 -151
- package/dist/src/core/performance/performance-profiler.d.ts.map +0 -1
- package/dist/src/core/performance/performance-profiler.js +0 -346
- package/dist/src/core/performance/performance-profiler.js.map +0 -1
- package/dist/src/core/performance/streaming-jsonl-parser.d.ts +0 -41
- package/dist/src/core/performance/streaming-jsonl-parser.d.ts.map +0 -1
- package/dist/src/core/performance/streaming-jsonl-parser.js +0 -193
- package/dist/src/core/performance/streaming-jsonl-parser.js.map +0 -1
- package/dist/src/core/persistence/postgres-adapter.d.ts +0 -31
- package/dist/src/core/persistence/postgres-adapter.d.ts.map +0 -1
- package/dist/src/core/persistence/postgres-adapter.js +0 -330
- package/dist/src/core/persistence/postgres-adapter.js.map +0 -1
- package/dist/src/core/projects/project-manager.d.ts +0 -130
- package/dist/src/core/projects/project-manager.d.ts.map +0 -1
- package/dist/src/core/projects/project-manager.js +0 -709
- package/dist/src/core/projects/project-manager.js.map +0 -1
- package/dist/src/core/query/query-parser.d.ts +0 -109
- package/dist/src/core/query/query-parser.d.ts.map +0 -1
- package/dist/src/core/query/query-parser.js +0 -415
- package/dist/src/core/query/query-parser.js.map +0 -1
- package/dist/src/core/query/query-templates.d.ts +0 -44
- package/dist/src/core/query/query-templates.d.ts.map +0 -1
- package/dist/src/core/query/query-templates.js +0 -326
- package/dist/src/core/query/query-templates.js.map +0 -1
- package/dist/src/core/retrieval/index.d.ts +0 -8
- package/dist/src/core/retrieval/index.d.ts.map +0 -1
- package/dist/src/core/retrieval/index.js +0 -8
- package/dist/src/core/retrieval/index.js.map +0 -1
- package/dist/src/core/retrieval/llm-context-retrieval.d.ts +0 -73
- package/dist/src/core/retrieval/llm-context-retrieval.d.ts.map +0 -1
- package/dist/src/core/retrieval/llm-context-retrieval.js +0 -597
- package/dist/src/core/retrieval/llm-context-retrieval.js.map +0 -1
- package/dist/src/core/retrieval/summary-generator.d.ts +0 -63
- package/dist/src/core/retrieval/summary-generator.d.ts.map +0 -1
- package/dist/src/core/retrieval/summary-generator.js +0 -622
- package/dist/src/core/retrieval/summary-generator.js.map +0 -1
- package/dist/src/core/retrieval/types.d.ts +0 -257
- package/dist/src/core/retrieval/types.d.ts.map +0 -1
- package/dist/src/core/retrieval/types.js +0 -18
- package/dist/src/core/retrieval/types.js.map +0 -1
- package/dist/src/core/session/index.d.ts +0 -2
- package/dist/src/core/session/index.d.ts.map +0 -1
- package/dist/src/core/session/index.js +0 -2
- package/dist/src/core/session/index.js.map +0 -1
- package/dist/src/core/session/session-manager.d.ts +0 -69
- package/dist/src/core/session/session-manager.d.ts.map +0 -1
- package/dist/src/core/session/session-manager.js +0 -311
- package/dist/src/core/session/session-manager.js.map +0 -1
- package/dist/src/core/trace/cli-trace-wrapper.d.ts +0 -23
- package/dist/src/core/trace/cli-trace-wrapper.d.ts.map +0 -1
- package/dist/src/core/trace/cli-trace-wrapper.js +0 -141
- package/dist/src/core/trace/cli-trace-wrapper.js.map +0 -1
- package/dist/src/core/trace/db-trace-wrapper.d.ts +0 -36
- package/dist/src/core/trace/db-trace-wrapper.d.ts.map +0 -1
- package/dist/src/core/trace/db-trace-wrapper.js +0 -252
- package/dist/src/core/trace/db-trace-wrapper.js.map +0 -1
- package/dist/src/core/trace/debug-trace.d.ts +0 -84
- package/dist/src/core/trace/debug-trace.d.ts.map +0 -1
- package/dist/src/core/trace/debug-trace.js +0 -402
- package/dist/src/core/trace/debug-trace.js.map +0 -1
- package/dist/src/core/trace/error-test.d.ts +0 -6
- package/dist/src/core/trace/error-test.d.ts.map +0 -1
- package/dist/src/core/trace/error-test.js +0 -128
- package/dist/src/core/trace/error-test.js.map +0 -1
- package/dist/src/core/trace/index.d.ts +0 -25
- package/dist/src/core/trace/index.d.ts.map +0 -1
- package/dist/src/core/trace/index.js +0 -121
- package/dist/src/core/trace/index.js.map +0 -1
- package/dist/src/core/trace/linear-api-wrapper.d.ts +0 -17
- package/dist/src/core/trace/linear-api-wrapper.d.ts.map +0 -1
- package/dist/src/core/trace/linear-api-wrapper.js +0 -205
- package/dist/src/core/trace/linear-api-wrapper.js.map +0 -1
- package/dist/src/core/trace/performance-test.d.ts +0 -6
- package/dist/src/core/trace/performance-test.d.ts.map +0 -1
- package/dist/src/core/trace/performance-test.js +0 -111
- package/dist/src/core/trace/performance-test.js.map +0 -1
- package/dist/src/core/trace/trace-demo.d.ts +0 -8
- package/dist/src/core/trace/trace-demo.d.ts.map +0 -1
- package/dist/src/core/trace/trace-demo.js +0 -154
- package/dist/src/core/trace/trace-demo.js.map +0 -1
- package/dist/src/core/trace/trace-detector.d.ts +0 -108
- package/dist/src/core/trace/trace-detector.d.ts.map +0 -1
- package/dist/src/core/trace/trace-detector.demo.d.ts +0 -5
- package/dist/src/core/trace/trace-detector.demo.d.ts.map +0 -1
- package/dist/src/core/trace/trace-detector.demo.js +0 -145
- package/dist/src/core/trace/trace-detector.demo.js.map +0 -1
- package/dist/src/core/trace/trace-detector.js +0 -425
- package/dist/src/core/trace/trace-detector.js.map +0 -1
- package/dist/src/core/trace/trace-store.d.ts +0 -60
- package/dist/src/core/trace/trace-store.d.ts.map +0 -1
- package/dist/src/core/trace/trace-store.js +0 -323
- package/dist/src/core/trace/trace-store.js.map +0 -1
- package/dist/src/core/trace/types.d.ts +0 -81
- package/dist/src/core/trace/types.d.ts.map +0 -1
- package/dist/src/core/trace/types.js +0 -70
- package/dist/src/core/trace/types.js.map +0 -1
- package/dist/src/core/types.d.ts +0 -35
- package/dist/src/core/types.d.ts.map +0 -1
- package/dist/src/core/types.js +0 -2
- package/dist/src/core/types.js.map +0 -1
- package/dist/src/core/utils/update-checker.d.ts +0 -38
- package/dist/src/core/utils/update-checker.d.ts.map +0 -1
- package/dist/src/core/utils/update-checker.js +0 -213
- package/dist/src/core/utils/update-checker.js.map +0 -1
- package/dist/src/core/worktree/worktree-manager.d.ts +0 -110
- package/dist/src/core/worktree/worktree-manager.d.ts.map +0 -1
- package/dist/src/core/worktree/worktree-manager.js +0 -456
- package/dist/src/core/worktree/worktree-manager.js.map +0 -1
- package/dist/src/features/analytics/api/analytics-api.d.ts +0 -24
- package/dist/src/features/analytics/api/analytics-api.d.ts.map +0 -1
- package/dist/src/features/analytics/api/analytics-api.js +0 -289
- package/dist/src/features/analytics/api/analytics-api.js.map +0 -1
- package/dist/src/features/analytics/core/analytics-service.d.ts +0 -29
- package/dist/src/features/analytics/core/analytics-service.d.ts.map +0 -1
- package/dist/src/features/analytics/core/analytics-service.js +0 -275
- package/dist/src/features/analytics/core/analytics-service.js.map +0 -1
- package/dist/src/features/analytics/index.d.ts +0 -12
- package/dist/src/features/analytics/index.d.ts.map +0 -1
- package/dist/src/features/analytics/index.js +0 -11
- package/dist/src/features/analytics/index.js.map +0 -1
- package/dist/src/features/analytics/queries/metrics-queries.d.ts +0 -11
- package/dist/src/features/analytics/queries/metrics-queries.d.ts.map +0 -1
- package/dist/src/features/analytics/queries/metrics-queries.js +0 -240
- package/dist/src/features/analytics/queries/metrics-queries.js.map +0 -1
- package/dist/src/features/analytics/types/metrics.d.ts +0 -60
- package/dist/src/features/analytics/types/metrics.d.ts.map +0 -1
- package/dist/src/features/analytics/types/metrics.js +0 -2
- package/dist/src/features/analytics/types/metrics.js.map +0 -1
- package/dist/src/features/browser/browser-mcp.d.ts +0 -94
- package/dist/src/features/browser/browser-mcp.d.ts.map +0 -1
- package/dist/src/features/browser/browser-mcp.js +0 -459
- package/dist/src/features/browser/browser-mcp.js.map +0 -1
- package/dist/src/features/tasks/pebbles-task-store.d.ts +0 -128
- package/dist/src/features/tasks/pebbles-task-store.d.ts.map +0 -1
- package/dist/src/features/tasks/pebbles-task-store.js +0 -572
- package/dist/src/features/tasks/pebbles-task-store.js.map +0 -1
- package/dist/src/features/tasks/task-aware-context.d.ts +0 -103
- package/dist/src/features/tasks/task-aware-context.d.ts.map +0 -1
- package/dist/src/features/tasks/task-aware-context.js +0 -412
- package/dist/src/features/tasks/task-aware-context.js.map +0 -1
- package/dist/src/index.d.ts +0 -21
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -9
- package/dist/src/index.js.map +0 -1
- package/dist/src/integrations/linear/auth.d.ts +0 -99
- package/dist/src/integrations/linear/auth.d.ts.map +0 -1
- package/dist/src/integrations/linear/auth.js +0 -319
- package/dist/src/integrations/linear/auth.js.map +0 -1
- package/dist/src/integrations/linear/auto-sync.d.ts +0 -77
- package/dist/src/integrations/linear/auto-sync.d.ts.map +0 -1
- package/dist/src/integrations/linear/auto-sync.js +0 -268
- package/dist/src/integrations/linear/auto-sync.js.map +0 -1
- package/dist/src/integrations/linear/client.d.ts +0 -127
- package/dist/src/integrations/linear/client.d.ts.map +0 -1
- package/dist/src/integrations/linear/client.js +0 -446
- package/dist/src/integrations/linear/client.js.map +0 -1
- package/dist/src/integrations/linear/config.d.ts +0 -51
- package/dist/src/integrations/linear/config.d.ts.map +0 -1
- package/dist/src/integrations/linear/config.js +0 -103
- package/dist/src/integrations/linear/config.js.map +0 -1
- package/dist/src/integrations/linear/sync-manager.d.ts +0 -78
- package/dist/src/integrations/linear/sync-manager.d.ts.map +0 -1
- package/dist/src/integrations/linear/sync-manager.js +0 -235
- package/dist/src/integrations/linear/sync-manager.js.map +0 -1
- package/dist/src/integrations/linear/sync-service.d.ts +0 -46
- package/dist/src/integrations/linear/sync-service.d.ts.map +0 -1
- package/dist/src/integrations/linear/sync-service.js +0 -217
- package/dist/src/integrations/linear/sync-service.js.map +0 -1
- package/dist/src/integrations/linear/sync.d.ts +0 -125
- package/dist/src/integrations/linear/sync.d.ts.map +0 -1
- package/dist/src/integrations/linear/sync.js +0 -563
- package/dist/src/integrations/linear/sync.js.map +0 -1
- package/dist/src/integrations/linear/types.d.ts +0 -90
- package/dist/src/integrations/linear/types.d.ts.map +0 -1
- package/dist/src/integrations/linear/types.js +0 -2
- package/dist/src/integrations/linear/types.js.map +0 -1
- package/dist/src/integrations/linear/webhook-server.d.ts +0 -32
- package/dist/src/integrations/linear/webhook-server.d.ts.map +0 -1
- package/dist/src/integrations/linear/webhook-server.js +0 -190
- package/dist/src/integrations/linear/webhook-server.js.map +0 -1
- package/dist/src/integrations/linear/webhook.d.ts +0 -108
- package/dist/src/integrations/linear/webhook.d.ts.map +0 -1
- package/dist/src/integrations/linear/webhook.js +0 -291
- package/dist/src/integrations/linear/webhook.js.map +0 -1
- package/dist/src/integrations/mcp/handlers/context-handlers.d.ts +0 -39
- package/dist/src/integrations/mcp/handlers/context-handlers.d.ts.map +0 -1
- package/dist/src/integrations/mcp/handlers/context-handlers.js +0 -266
- package/dist/src/integrations/mcp/handlers/context-handlers.js.map +0 -1
- package/dist/src/integrations/mcp/handlers/index.d.ts +0 -37
- package/dist/src/integrations/mcp/handlers/index.d.ts.map +0 -1
- package/dist/src/integrations/mcp/handlers/index.js +0 -134
- package/dist/src/integrations/mcp/handlers/index.js.map +0 -1
- package/dist/src/integrations/mcp/handlers/linear-handlers.d.ts +0 -33
- package/dist/src/integrations/mcp/handlers/linear-handlers.d.ts.map +0 -1
- package/dist/src/integrations/mcp/handlers/linear-handlers.js +0 -251
- package/dist/src/integrations/mcp/handlers/linear-handlers.js.map +0 -1
- package/dist/src/integrations/mcp/handlers/task-handlers.d.ts +0 -42
- package/dist/src/integrations/mcp/handlers/task-handlers.d.ts.map +0 -1
- package/dist/src/integrations/mcp/handlers/task-handlers.js +0 -238
- package/dist/src/integrations/mcp/handlers/task-handlers.js.map +0 -1
- package/dist/src/integrations/mcp/handlers/trace-handlers.d.ts +0 -41
- package/dist/src/integrations/mcp/handlers/trace-handlers.d.ts.map +0 -1
- package/dist/src/integrations/mcp/handlers/trace-handlers.js +0 -298
- package/dist/src/integrations/mcp/handlers/trace-handlers.js.map +0 -1
- package/dist/src/integrations/mcp/index.d.ts +0 -13
- package/dist/src/integrations/mcp/index.d.ts.map +0 -1
- package/dist/src/integrations/mcp/index.js +0 -17
- package/dist/src/integrations/mcp/index.js.map +0 -1
- package/dist/src/integrations/mcp/refactored-server.d.ts +0 -76
- package/dist/src/integrations/mcp/refactored-server.d.ts.map +0 -1
- package/dist/src/integrations/mcp/refactored-server.js +0 -351
- package/dist/src/integrations/mcp/refactored-server.js.map +0 -1
- package/dist/src/integrations/mcp/server.d.ts +0 -54
- package/dist/src/integrations/mcp/server.d.ts.map +0 -1
- package/dist/src/integrations/mcp/server.js +0 -1616
- package/dist/src/integrations/mcp/server.js.map +0 -1
- package/dist/src/integrations/mcp/tool-definitions.d.ts +0 -44
- package/dist/src/integrations/mcp/tool-definitions.d.ts.map +0 -1
- package/dist/src/integrations/mcp/tool-definitions.js +0 -563
- package/dist/src/integrations/mcp/tool-definitions.js.map +0 -1
- package/dist/src/integrations/mcp/trace-test.d.ts +0 -5
- package/dist/src/integrations/mcp/trace-test.d.ts.map +0 -1
- package/dist/src/integrations/mcp/trace-test.js +0 -54
- package/dist/src/integrations/mcp/trace-test.js.map +0 -1
- package/dist/src/integrations/pg-aiguide/embedding-provider.d.ts +0 -48
- package/dist/src/integrations/pg-aiguide/embedding-provider.d.ts.map +0 -1
- package/dist/src/integrations/pg-aiguide/embedding-provider.js +0 -190
- package/dist/src/integrations/pg-aiguide/embedding-provider.js.map +0 -1
- package/dist/src/integrations/pg-aiguide/semantic-search.d.ts +0 -34
- package/dist/src/integrations/pg-aiguide/semantic-search.d.ts.map +0 -1
- package/dist/src/integrations/pg-aiguide/semantic-search.js +0 -176
- package/dist/src/integrations/pg-aiguide/semantic-search.js.map +0 -1
- package/dist/src/integrations/pg-aiguide/timescale-analytics.d.ts +0 -44
- package/dist/src/integrations/pg-aiguide/timescale-analytics.d.ts.map +0 -1
- package/dist/src/integrations/pg-aiguide/timescale-analytics.js +0 -215
- package/dist/src/integrations/pg-aiguide/timescale-analytics.js.map +0 -1
- package/dist/src/mcp/stackmemory-mcp-server.d.ts +0 -9
- package/dist/src/mcp/stackmemory-mcp-server.d.ts.map +0 -1
- package/dist/src/mcp/stackmemory-mcp-server.js +0 -519
- package/dist/src/mcp/stackmemory-mcp-server.js.map +0 -1
- package/dist/src/middleware/exponential-rate-limiter.d.ts +0 -78
- package/dist/src/middleware/exponential-rate-limiter.d.ts.map +0 -1
- package/dist/src/middleware/exponential-rate-limiter.js +0 -293
- package/dist/src/middleware/exponential-rate-limiter.js.map +0 -1
- package/dist/src/models/user.model.d.ts +0 -62
- package/dist/src/models/user.model.d.ts.map +0 -1
- package/dist/src/models/user.model.js +0 -311
- package/dist/src/models/user.model.js.map +0 -1
- package/dist/src/servers/production/auth-middleware.d.ts +0 -76
- package/dist/src/servers/production/auth-middleware.d.ts.map +0 -1
- package/dist/src/servers/production/auth-middleware.js +0 -558
- package/dist/src/servers/production/auth-middleware.js.map +0 -1
- package/dist/src/servers/railway/index.d.ts +0 -7
- package/dist/src/servers/railway/index.d.ts.map +0 -1
- package/dist/src/servers/railway/index.js +0 -401
- package/dist/src/servers/railway/index.js.map +0 -1
- package/dist/src/services/config-service.d.ts +0 -44
- package/dist/src/services/config-service.d.ts.map +0 -1
- package/dist/src/services/config-service.js +0 -61
- package/dist/src/services/config-service.js.map +0 -1
- package/dist/src/services/context-service.d.ts +0 -17
- package/dist/src/services/context-service.d.ts.map +0 -1
- package/dist/src/services/context-service.js +0 -173
- package/dist/src/services/context-service.js.map +0 -1
- package/dist/src/types/task.d.ts +0 -27
- package/dist/src/types/task.d.ts.map +0 -1
- package/dist/src/types/task.js +0 -2
- package/dist/src/types/task.js.map +0 -1
- package/dist/src/utils/logger.d.ts +0 -13
- package/dist/src/utils/logger.d.ts.map +0 -1
- package/dist/src/utils/logger.js +0 -52
- package/dist/src/utils/logger.js.map +0 -1
- package/dist/src/validation/schemas.d.ts +0 -633
- package/dist/src/validation/schemas.d.ts.map +0 -1
- package/dist/src/validation/schemas.js +0 -347
- package/dist/src/validation/schemas.js.map +0 -1
package/dist/src/cli/index.js
DELETED
|
@@ -1,995 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* StackMemory CLI
|
|
4
|
-
* Command-line interface for StackMemory operations
|
|
5
|
-
*/
|
|
6
|
-
import { program } from 'commander';
|
|
7
|
-
import { logger } from '../core/monitoring/logger.js';
|
|
8
|
-
import { FrameManager } from '../core/context/frame-manager.js';
|
|
9
|
-
import { sessionManager, FrameQueryMode } from '../core/session/index.js';
|
|
10
|
-
import { PebblesTaskStore } from '../features/tasks/pebbles-task-store.js';
|
|
11
|
-
import { LinearAuthManager, LinearOAuthSetup, } from '../integrations/linear/auth.js';
|
|
12
|
-
import { LinearSyncEngine, DEFAULT_SYNC_CONFIG, } from '../integrations/linear/sync.js';
|
|
13
|
-
import { initializeAutoSync, getAutoSyncService, stopAutoSync, } from '../integrations/linear/auto-sync.js';
|
|
14
|
-
import { LinearConfigManager } from '../integrations/linear/config.js';
|
|
15
|
-
import { UpdateChecker } from '../core/utils/update-checker.js';
|
|
16
|
-
import { ProgressTracker } from '../core/monitoring/progress-tracker.js';
|
|
17
|
-
import { registerProjectCommands } from './commands/projects.js';
|
|
18
|
-
import { registerLinearCommands } from './commands/linear.js';
|
|
19
|
-
import { registerLinearTestCommand } from './commands/linear-test.js';
|
|
20
|
-
import { createSessionCommands } from './commands/session.js';
|
|
21
|
-
import { registerWorktreeCommands } from './commands/worktree.js';
|
|
22
|
-
import { registerOnboardingCommand } from './commands/onboard.js';
|
|
23
|
-
import { webhookCommand } from './commands/webhook.js';
|
|
24
|
-
import { createTaskCommands } from './commands/tasks.js';
|
|
25
|
-
import { createSearchCommand } from './commands/search.js';
|
|
26
|
-
import { createLogCommand } from './commands/log.js';
|
|
27
|
-
import { createContextCommands } from './commands/context.js';
|
|
28
|
-
import { createConfigCommand } from './commands/config.js';
|
|
29
|
-
import { createAgentCommand } from './commands/agent.js';
|
|
30
|
-
import { createHandoffCommand } from './commands/handoff.js';
|
|
31
|
-
import { ProjectManager } from '../core/projects/project-manager.js';
|
|
32
|
-
import Database from 'better-sqlite3';
|
|
33
|
-
import { join } from 'path';
|
|
34
|
-
import { existsSync, mkdirSync } from 'fs';
|
|
35
|
-
const VERSION = '0.2.7';
|
|
36
|
-
// Check for updates on CLI startup
|
|
37
|
-
UpdateChecker.checkForUpdates(VERSION, true).catch(() => {
|
|
38
|
-
// Silently ignore errors
|
|
39
|
-
});
|
|
40
|
-
program
|
|
41
|
-
.name('stackmemory')
|
|
42
|
-
.description('Lossless memory runtime for AI coding tools')
|
|
43
|
-
.version(VERSION);
|
|
44
|
-
program
|
|
45
|
-
.command('init')
|
|
46
|
-
.description('Initialize StackMemory in current project')
|
|
47
|
-
.action(async () => {
|
|
48
|
-
try {
|
|
49
|
-
const projectRoot = process.cwd();
|
|
50
|
-
const dbDir = join(projectRoot, '.stackmemory');
|
|
51
|
-
if (!existsSync(dbDir)) {
|
|
52
|
-
mkdirSync(dbDir, { recursive: true });
|
|
53
|
-
}
|
|
54
|
-
const dbPath = join(dbDir, 'context.db');
|
|
55
|
-
const db = new Database(dbPath);
|
|
56
|
-
new FrameManager(db, 'cli-project');
|
|
57
|
-
logger.info('StackMemory initialized successfully', { projectRoot });
|
|
58
|
-
console.log('ā
StackMemory initialized in', projectRoot);
|
|
59
|
-
db.close();
|
|
60
|
-
}
|
|
61
|
-
catch (error) {
|
|
62
|
-
logger.error('Failed to initialize StackMemory', error);
|
|
63
|
-
console.error('ā Initialization failed:', error.message);
|
|
64
|
-
process.exit(1);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
program
|
|
68
|
-
.command('status')
|
|
69
|
-
.description('Show current StackMemory status')
|
|
70
|
-
.option('--all', 'Show all active frames across sessions')
|
|
71
|
-
.option('--project', 'Show all active frames in current project')
|
|
72
|
-
.option('--session <id>', 'Show frames for specific session')
|
|
73
|
-
.action(async (options) => {
|
|
74
|
-
try {
|
|
75
|
-
const projectRoot = process.cwd();
|
|
76
|
-
const dbPath = join(projectRoot, '.stackmemory', 'context.db');
|
|
77
|
-
if (!existsSync(dbPath)) {
|
|
78
|
-
console.log('ā StackMemory not initialized. Run "stackmemory init" first.');
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
// Check for updates and display if available
|
|
82
|
-
await UpdateChecker.checkForUpdates(VERSION);
|
|
83
|
-
// Initialize session manager
|
|
84
|
-
await sessionManager.initialize();
|
|
85
|
-
const session = await sessionManager.getOrCreateSession({
|
|
86
|
-
projectPath: projectRoot,
|
|
87
|
-
sessionId: options.session,
|
|
88
|
-
});
|
|
89
|
-
const db = new Database(dbPath);
|
|
90
|
-
const frameManager = new FrameManager(db, session.projectId);
|
|
91
|
-
// Set query mode based on options
|
|
92
|
-
if (options.all) {
|
|
93
|
-
frameManager.setQueryMode(FrameQueryMode.ALL_ACTIVE);
|
|
94
|
-
}
|
|
95
|
-
else if (options.project) {
|
|
96
|
-
frameManager.setQueryMode(FrameQueryMode.PROJECT_ACTIVE);
|
|
97
|
-
}
|
|
98
|
-
const activeFrames = frameManager.getActiveFramePath();
|
|
99
|
-
const stackDepth = frameManager.getStackDepth();
|
|
100
|
-
// Always get total counts across all sessions
|
|
101
|
-
const totalStats = db
|
|
102
|
-
.prepare(`
|
|
103
|
-
SELECT
|
|
104
|
-
COUNT(*) as total_frames,
|
|
105
|
-
SUM(CASE WHEN state = 'active' THEN 1 ELSE 0 END) as active_frames,
|
|
106
|
-
SUM(CASE WHEN state = 'closed' THEN 1 ELSE 0 END) as closed_frames,
|
|
107
|
-
COUNT(DISTINCT run_id) as total_sessions
|
|
108
|
-
FROM frames
|
|
109
|
-
WHERE project_id = ?
|
|
110
|
-
`)
|
|
111
|
-
.get(session.projectId);
|
|
112
|
-
const contextCount = db
|
|
113
|
-
.prepare(`
|
|
114
|
-
SELECT COUNT(*) as count FROM contexts
|
|
115
|
-
`)
|
|
116
|
-
.get();
|
|
117
|
-
const eventCount = db
|
|
118
|
-
.prepare(`
|
|
119
|
-
SELECT COUNT(*) as count FROM events
|
|
120
|
-
`)
|
|
121
|
-
.get();
|
|
122
|
-
console.log('š StackMemory Status:');
|
|
123
|
-
console.log(` Session: ${session.sessionId.slice(0, 8)} (${session.state}, ${Math.round((Date.now() - session.startedAt) / 1000 / 60)}min old)`);
|
|
124
|
-
console.log(` Project: ${session.projectId}`);
|
|
125
|
-
if (session.branch) {
|
|
126
|
-
console.log(` Branch: ${session.branch}`);
|
|
127
|
-
}
|
|
128
|
-
// Show total database statistics
|
|
129
|
-
console.log(`\n Database Statistics:`);
|
|
130
|
-
console.log(` Total contexts: ${contextCount.count}`);
|
|
131
|
-
console.log(` Total frames: ${totalStats.total_frames} (${totalStats.active_frames} active, ${totalStats.closed_frames} closed)`);
|
|
132
|
-
console.log(` Total events: ${eventCount.count}`);
|
|
133
|
-
console.log(` Total sessions: ${totalStats.total_sessions}`);
|
|
134
|
-
// Show recent activity
|
|
135
|
-
const recentFrames = db
|
|
136
|
-
.prepare(`
|
|
137
|
-
SELECT name, type, state, datetime(created_at, 'unixepoch') as created
|
|
138
|
-
FROM frames
|
|
139
|
-
WHERE project_id = ?
|
|
140
|
-
ORDER BY created_at DESC
|
|
141
|
-
LIMIT 3
|
|
142
|
-
`)
|
|
143
|
-
.all(session.projectId);
|
|
144
|
-
if (recentFrames.length > 0) {
|
|
145
|
-
console.log(`\n Recent Activity:`);
|
|
146
|
-
recentFrames.forEach((f) => {
|
|
147
|
-
const stateIcon = f.state === 'active' ? 'š¢' : 'ā«';
|
|
148
|
-
console.log(` ${stateIcon} ${f.name} [${f.type}] - ${f.created}`);
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
console.log(`\n Current Session:`);
|
|
152
|
-
console.log(` Stack depth: ${stackDepth}`);
|
|
153
|
-
console.log(` Active frames: ${activeFrames.length}`);
|
|
154
|
-
if (activeFrames.length > 0) {
|
|
155
|
-
activeFrames.forEach((frame, i) => {
|
|
156
|
-
const indent = ' ' + ' '.repeat(frame.depth || i);
|
|
157
|
-
const prefix = i === 0 ? 'āā' : ' āā';
|
|
158
|
-
console.log(`${indent}${prefix} ${frame.name} [${frame.type}]`);
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
// Show other sessions if in default mode
|
|
162
|
-
if (!options.all && !options.project) {
|
|
163
|
-
const otherSessions = await sessionManager.listSessions({
|
|
164
|
-
projectId: session.projectId,
|
|
165
|
-
state: 'active',
|
|
166
|
-
});
|
|
167
|
-
const otherActive = otherSessions.filter((s) => s.sessionId !== session.sessionId);
|
|
168
|
-
if (otherActive.length > 0) {
|
|
169
|
-
console.log(`\n Other Active Sessions (same project):`);
|
|
170
|
-
otherActive.forEach((s) => {
|
|
171
|
-
const age = Math.round((Date.now() - s.lastActiveAt) / 1000 / 60 / 60);
|
|
172
|
-
console.log(` - ${s.sessionId.slice(0, 8)}: ${s.branch || 'main'}, ${age}h old`);
|
|
173
|
-
});
|
|
174
|
-
console.log(`\n Tip: Use --all to see frames across sessions`);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
db.close();
|
|
178
|
-
}
|
|
179
|
-
catch (error) {
|
|
180
|
-
logger.error('Failed to get status', error);
|
|
181
|
-
console.error('ā Status check failed:', error.message);
|
|
182
|
-
process.exit(1);
|
|
183
|
-
}
|
|
184
|
-
});
|
|
185
|
-
// Linear Integration Commands
|
|
186
|
-
const linearCommand = program
|
|
187
|
-
.command('linear')
|
|
188
|
-
.description('Linear API integration commands');
|
|
189
|
-
linearCommand
|
|
190
|
-
.command('setup')
|
|
191
|
-
.description('Setup Linear OAuth integration')
|
|
192
|
-
.action(async () => {
|
|
193
|
-
try {
|
|
194
|
-
const projectRoot = process.cwd();
|
|
195
|
-
const linearSetup = new LinearOAuthSetup(projectRoot);
|
|
196
|
-
const { authUrl, instructions } = await linearSetup.setupInteractive();
|
|
197
|
-
console.log('š Linear OAuth Setup\n');
|
|
198
|
-
instructions.forEach((instruction) => {
|
|
199
|
-
console.log(instruction);
|
|
200
|
-
});
|
|
201
|
-
if (authUrl) {
|
|
202
|
-
console.log('\nš Next step: Complete authorization and run:');
|
|
203
|
-
console.log('stackmemory linear authorize <auth-code>');
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
catch (error) {
|
|
207
|
-
logger.error('Linear setup failed', error);
|
|
208
|
-
console.error('ā Setup failed:', error.message);
|
|
209
|
-
process.exit(1);
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
linearCommand
|
|
213
|
-
.command('authorize')
|
|
214
|
-
.description('Complete Linear OAuth authorization')
|
|
215
|
-
.argument('<code>', 'Authorization code from Linear')
|
|
216
|
-
.action(async (authCode) => {
|
|
217
|
-
try {
|
|
218
|
-
const projectRoot = process.cwd();
|
|
219
|
-
const linearSetup = new LinearOAuthSetup(projectRoot);
|
|
220
|
-
const success = await linearSetup.completeAuth(authCode);
|
|
221
|
-
if (success) {
|
|
222
|
-
console.log('ā
Linear integration authorized successfully!');
|
|
223
|
-
console.log('š§Ŗ Testing connection...');
|
|
224
|
-
const connectionOk = await linearSetup.testConnection();
|
|
225
|
-
if (connectionOk) {
|
|
226
|
-
console.log('ā
Linear connection test passed!');
|
|
227
|
-
console.log('\nš You can now use:');
|
|
228
|
-
console.log('- stackmemory linear sync');
|
|
229
|
-
console.log('- stackmemory linear status');
|
|
230
|
-
}
|
|
231
|
-
else {
|
|
232
|
-
console.log('ā ļø Linear connection test failed. Check your configuration.');
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
else {
|
|
236
|
-
console.error('ā Authorization failed. Please try again.');
|
|
237
|
-
process.exit(1);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
catch (error) {
|
|
241
|
-
logger.error('Linear authorization failed', error);
|
|
242
|
-
console.error('ā Authorization failed:', error.message);
|
|
243
|
-
process.exit(1);
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
linearCommand
|
|
247
|
-
.command('status')
|
|
248
|
-
.description('Show Linear integration status')
|
|
249
|
-
.action(async () => {
|
|
250
|
-
try {
|
|
251
|
-
const projectRoot = process.cwd();
|
|
252
|
-
const authManager = new LinearAuthManager(projectRoot);
|
|
253
|
-
const isConfigured = authManager.isConfigured();
|
|
254
|
-
console.log('š Linear Integration Status:');
|
|
255
|
-
console.log(` Configured: ${isConfigured ? 'ā
' : 'ā'}`);
|
|
256
|
-
if (isConfigured) {
|
|
257
|
-
const config = authManager.loadConfig();
|
|
258
|
-
const tokens = authManager.loadTokens();
|
|
259
|
-
console.log(` Client ID: ${config?.clientId ? config.clientId.substring(0, 8) + '...' : 'Not set'}`);
|
|
260
|
-
console.log(` Tokens: ${tokens ? 'ā
Valid' : 'ā Missing'}`);
|
|
261
|
-
if (tokens) {
|
|
262
|
-
const expiresIn = Math.floor((tokens.expiresAt - Date.now()) / 1000 / 60);
|
|
263
|
-
console.log(` Token expires: ${expiresIn > 0 ? `${expiresIn} minutes` : 'Expired'}`);
|
|
264
|
-
}
|
|
265
|
-
// Test connection
|
|
266
|
-
console.log('\nš§Ŗ Testing connection...');
|
|
267
|
-
const linearSetup = new LinearOAuthSetup(projectRoot);
|
|
268
|
-
const connectionOk = await linearSetup.testConnection();
|
|
269
|
-
console.log(` Connection: ${connectionOk ? 'ā
OK' : 'ā Failed'}`);
|
|
270
|
-
}
|
|
271
|
-
else {
|
|
272
|
-
console.log('\nš” Run "stackmemory linear setup" to get started');
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
catch (error) {
|
|
276
|
-
logger.error('Linear status check failed', error);
|
|
277
|
-
console.error('ā Status check failed:', error.message);
|
|
278
|
-
process.exit(1);
|
|
279
|
-
}
|
|
280
|
-
});
|
|
281
|
-
linearCommand
|
|
282
|
-
.command('sync')
|
|
283
|
-
.description('Sync tasks with Linear')
|
|
284
|
-
.option('-d, --direction <direction>', 'Sync direction: bidirectional, to_linear, from_linear', 'bidirectional')
|
|
285
|
-
.action(async (options) => {
|
|
286
|
-
try {
|
|
287
|
-
const projectRoot = process.cwd();
|
|
288
|
-
const dbPath = join(projectRoot, '.stackmemory', 'context.db');
|
|
289
|
-
if (!existsSync(dbPath)) {
|
|
290
|
-
console.log('ā StackMemory not initialized. Run "stackmemory init" first.');
|
|
291
|
-
return;
|
|
292
|
-
}
|
|
293
|
-
const authManager = new LinearAuthManager(projectRoot);
|
|
294
|
-
// Check for API key from environment first
|
|
295
|
-
if (!process.env.LINEAR_API_KEY && !authManager.isConfigured()) {
|
|
296
|
-
console.log('ā Linear not configured. Set LINEAR_API_KEY environment variable or run "stackmemory linear setup" first.');
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
const db = new Database(dbPath);
|
|
300
|
-
const taskStore = new PebblesTaskStore(projectRoot, db);
|
|
301
|
-
const syncConfig = {
|
|
302
|
-
...DEFAULT_SYNC_CONFIG,
|
|
303
|
-
enabled: true,
|
|
304
|
-
direction: options.direction,
|
|
305
|
-
};
|
|
306
|
-
const linearSync = new LinearSyncEngine(taskStore, authManager, syncConfig);
|
|
307
|
-
console.log(`š Starting ${options.direction} sync with Linear...`);
|
|
308
|
-
const result = await linearSync.sync();
|
|
309
|
-
// Track progress
|
|
310
|
-
const progress = new ProgressTracker(projectRoot);
|
|
311
|
-
if (result.success) {
|
|
312
|
-
console.log('ā
Sync completed successfully!');
|
|
313
|
-
console.log(` To Linear: ${result.synced.toLinear} created`);
|
|
314
|
-
console.log(` From Linear: ${result.synced.fromLinear} created`);
|
|
315
|
-
console.log(` Updated: ${result.synced.updated}`);
|
|
316
|
-
// Update progress tracker
|
|
317
|
-
progress.updateLinearStatus({
|
|
318
|
-
lastSync: new Date().toISOString(),
|
|
319
|
-
tasksSynced: result.synced.toLinear +
|
|
320
|
-
result.synced.fromLinear +
|
|
321
|
-
result.synced.updated,
|
|
322
|
-
});
|
|
323
|
-
if (result.conflicts.length > 0) {
|
|
324
|
-
console.log(`\nā ļø Conflicts detected: ${result.conflicts.length}`);
|
|
325
|
-
result.conflicts.forEach((conflict) => {
|
|
326
|
-
console.log(` - ${conflict.taskId}: ${conflict.reason}`);
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
else {
|
|
331
|
-
console.log('ā Sync failed');
|
|
332
|
-
if (result.errors.length > 0) {
|
|
333
|
-
result.errors.forEach((error) => {
|
|
334
|
-
console.log(` Error: ${error}`);
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
db.close();
|
|
339
|
-
}
|
|
340
|
-
catch (error) {
|
|
341
|
-
logger.error('Linear sync failed', error);
|
|
342
|
-
console.error('ā Sync failed:', error.message);
|
|
343
|
-
process.exit(1);
|
|
344
|
-
}
|
|
345
|
-
});
|
|
346
|
-
// Auto-sync commands
|
|
347
|
-
linearCommand
|
|
348
|
-
.command('auto-sync')
|
|
349
|
-
.description('Manage automatic synchronization')
|
|
350
|
-
.option('--start', 'Start auto-sync service')
|
|
351
|
-
.option('--stop', 'Stop auto-sync service')
|
|
352
|
-
.option('--status', 'Show auto-sync status')
|
|
353
|
-
.option('--interval <minutes>', 'Set sync interval in minutes', '5')
|
|
354
|
-
.option('--direction <direction>', 'Set sync direction: bidirectional, to_linear, from_linear', 'bidirectional')
|
|
355
|
-
.option('--quiet-start <hour>', 'Start of quiet hours (0-23)', '22')
|
|
356
|
-
.option('--quiet-end <hour>', 'End of quiet hours (0-23)', '7')
|
|
357
|
-
.action(async (options) => {
|
|
358
|
-
try {
|
|
359
|
-
const projectRoot = process.cwd();
|
|
360
|
-
if (options.status) {
|
|
361
|
-
const service = getAutoSyncService();
|
|
362
|
-
if (service) {
|
|
363
|
-
const status = service.getStatus();
|
|
364
|
-
console.log('š Linear Auto-Sync Status:');
|
|
365
|
-
console.log(` Running: ${status.running ? 'ā
' : 'ā'}`);
|
|
366
|
-
console.log(` Direction: ${status.config.direction}`);
|
|
367
|
-
console.log(` Interval: ${status.config.interval} minutes`);
|
|
368
|
-
console.log(` Conflict Resolution: ${status.config.conflictResolution}`);
|
|
369
|
-
if (status.lastSyncTime > 0) {
|
|
370
|
-
const lastSync = new Date(status.lastSyncTime);
|
|
371
|
-
console.log(` Last Sync: ${lastSync.toLocaleString()}`);
|
|
372
|
-
}
|
|
373
|
-
if (status.nextSyncTime) {
|
|
374
|
-
const nextSync = new Date(status.nextSyncTime);
|
|
375
|
-
console.log(` Next Sync: ${nextSync.toLocaleString()}`);
|
|
376
|
-
}
|
|
377
|
-
if (status.config.quietHours) {
|
|
378
|
-
console.log(` Quiet Hours: ${status.config.quietHours.start}:00 - ${status.config.quietHours.end}:00`);
|
|
379
|
-
}
|
|
380
|
-
if (status.retryCount > 0) {
|
|
381
|
-
console.log(` ā ļø Retry Count: ${status.retryCount}`);
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
else {
|
|
385
|
-
console.log('š Linear Auto-Sync Status: ā Not running');
|
|
386
|
-
}
|
|
387
|
-
return;
|
|
388
|
-
}
|
|
389
|
-
if (options.start) {
|
|
390
|
-
const authManager = new LinearAuthManager(projectRoot);
|
|
391
|
-
if (!authManager.isConfigured()) {
|
|
392
|
-
console.log('ā Linear not configured. Run "stackmemory linear setup" first.');
|
|
393
|
-
return;
|
|
394
|
-
}
|
|
395
|
-
const config = {
|
|
396
|
-
interval: parseInt(options.interval),
|
|
397
|
-
direction: options.direction,
|
|
398
|
-
quietHours: {
|
|
399
|
-
start: parseInt(options.quietStart),
|
|
400
|
-
end: parseInt(options.quietEnd),
|
|
401
|
-
},
|
|
402
|
-
};
|
|
403
|
-
const service = initializeAutoSync(projectRoot, config);
|
|
404
|
-
await service.start();
|
|
405
|
-
console.log('ā
Linear auto-sync started');
|
|
406
|
-
console.log(` Interval: ${config.interval} minutes`);
|
|
407
|
-
console.log(` Direction: ${config.direction}`);
|
|
408
|
-
console.log(` Quiet Hours: ${config.quietHours.start}:00 - ${config.quietHours.end}:00`);
|
|
409
|
-
console.log('\nš” Use "stackmemory linear auto-sync --status" to check status');
|
|
410
|
-
// Keep process alive for auto-sync
|
|
411
|
-
process.on('SIGINT', () => {
|
|
412
|
-
console.log('\nš Stopping auto-sync service...');
|
|
413
|
-
service.stop();
|
|
414
|
-
process.exit(0);
|
|
415
|
-
});
|
|
416
|
-
console.log('š Auto-sync running... Press Ctrl+C to stop');
|
|
417
|
-
// Keep the process running
|
|
418
|
-
await new Promise(() => { }); // Intentionally never resolves
|
|
419
|
-
}
|
|
420
|
-
if (options.stop) {
|
|
421
|
-
stopAutoSync();
|
|
422
|
-
console.log('š Linear auto-sync stopped');
|
|
423
|
-
}
|
|
424
|
-
if (!options.start && !options.stop && !options.status) {
|
|
425
|
-
console.log('š” Usage:');
|
|
426
|
-
console.log(' --start Start auto-sync service');
|
|
427
|
-
console.log(' --stop Stop auto-sync service');
|
|
428
|
-
console.log(' --status Show current status');
|
|
429
|
-
console.log('\nExample: stackmemory linear auto-sync --start --interval 10');
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
catch (error) {
|
|
433
|
-
logger.error('Linear auto-sync command failed', error);
|
|
434
|
-
console.error('ā Auto-sync failed:', error.message);
|
|
435
|
-
process.exit(1);
|
|
436
|
-
}
|
|
437
|
-
});
|
|
438
|
-
linearCommand
|
|
439
|
-
.command('force-sync')
|
|
440
|
-
.description('Force immediate synchronization')
|
|
441
|
-
.action(async () => {
|
|
442
|
-
try {
|
|
443
|
-
const service = getAutoSyncService();
|
|
444
|
-
if (service) {
|
|
445
|
-
console.log('š Forcing immediate sync...');
|
|
446
|
-
await service.forceSync();
|
|
447
|
-
console.log('ā
Sync completed');
|
|
448
|
-
}
|
|
449
|
-
else {
|
|
450
|
-
console.log('ā Auto-sync service not running. Use manual sync instead:');
|
|
451
|
-
console.log(' stackmemory linear sync');
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
catch (error) {
|
|
455
|
-
logger.error('Force sync failed', error);
|
|
456
|
-
console.error('ā Force sync failed:', error.message);
|
|
457
|
-
process.exit(1);
|
|
458
|
-
}
|
|
459
|
-
});
|
|
460
|
-
linearCommand
|
|
461
|
-
.command('update <issueId>')
|
|
462
|
-
.description('Update Linear task status')
|
|
463
|
-
.option('-s, --status <status>', 'New status (todo, in-progress, done, canceled)')
|
|
464
|
-
.option('-t, --title <title>', 'Update task title')
|
|
465
|
-
.option('-d, --description <desc>', 'Update task description')
|
|
466
|
-
.option('-p, --priority <priority>', 'Set priority (1=urgent, 2=high, 3=medium, 4=low)')
|
|
467
|
-
.action(async (issueId, options) => {
|
|
468
|
-
try {
|
|
469
|
-
const projectRoot = process.cwd();
|
|
470
|
-
const authManager = new LinearAuthManager(projectRoot);
|
|
471
|
-
const tokens = authManager.loadTokens();
|
|
472
|
-
if (!tokens) {
|
|
473
|
-
console.error('ā Not authenticated. Run: stackmemory linear setup');
|
|
474
|
-
process.exit(1);
|
|
475
|
-
}
|
|
476
|
-
const { LinearClient } = await import('../integrations/linear/client.js');
|
|
477
|
-
const client = new LinearClient({
|
|
478
|
-
apiKey: tokens.accessToken,
|
|
479
|
-
});
|
|
480
|
-
// Find the issue first
|
|
481
|
-
let issue = await client.getIssue(issueId);
|
|
482
|
-
if (!issue) {
|
|
483
|
-
// Try finding by identifier
|
|
484
|
-
issue = await client.findIssueByIdentifier(issueId);
|
|
485
|
-
}
|
|
486
|
-
if (!issue) {
|
|
487
|
-
console.error(`ā Issue ${issueId} not found`);
|
|
488
|
-
process.exit(1);
|
|
489
|
-
}
|
|
490
|
-
const updates = {};
|
|
491
|
-
// Handle status update
|
|
492
|
-
if (options.status) {
|
|
493
|
-
const team = await client.getTeam();
|
|
494
|
-
const states = await client.getWorkflowStates(team.id);
|
|
495
|
-
const statusMap = {
|
|
496
|
-
todo: 'unstarted',
|
|
497
|
-
'in-progress': 'started',
|
|
498
|
-
done: 'completed',
|
|
499
|
-
canceled: 'cancelled',
|
|
500
|
-
};
|
|
501
|
-
const targetType = statusMap[options.status.toLowerCase()] || options.status;
|
|
502
|
-
const targetState = states.find((s) => s.type === targetType);
|
|
503
|
-
if (!targetState) {
|
|
504
|
-
console.error(`ā Invalid status: ${options.status}`);
|
|
505
|
-
console.log('Available states:');
|
|
506
|
-
states.forEach((s) => console.log(` - ${s.name} (${s.type})`));
|
|
507
|
-
process.exit(1);
|
|
508
|
-
}
|
|
509
|
-
updates.stateId = targetState.id;
|
|
510
|
-
}
|
|
511
|
-
if (options.title)
|
|
512
|
-
updates.title = options.title;
|
|
513
|
-
if (options.description)
|
|
514
|
-
updates.description = options.description;
|
|
515
|
-
if (options.priority)
|
|
516
|
-
updates.priority = parseInt(options.priority);
|
|
517
|
-
// Perform update
|
|
518
|
-
const updatedIssue = await client.updateIssue(issue.id, updates);
|
|
519
|
-
console.log(`ā
Updated ${updatedIssue.identifier}: ${updatedIssue.title}`);
|
|
520
|
-
if (options.status) {
|
|
521
|
-
console.log(` Status: ${updatedIssue.state.name}`);
|
|
522
|
-
}
|
|
523
|
-
console.log(` ${updatedIssue.url}`);
|
|
524
|
-
// Auto-sync to local tasks after update
|
|
525
|
-
console.log('\nš Syncing to local tasks...');
|
|
526
|
-
const dbPath = join(projectRoot, '.stackmemory', 'context.db');
|
|
527
|
-
if (existsSync(dbPath)) {
|
|
528
|
-
const db = new Database(dbPath);
|
|
529
|
-
const taskStore = new PebblesTaskStore(projectRoot, db);
|
|
530
|
-
const { LinearSyncEngine, DEFAULT_SYNC_CONFIG } = await import('../integrations/linear/sync.js');
|
|
531
|
-
const syncEngine = new LinearSyncEngine(taskStore, authManager, { ...DEFAULT_SYNC_CONFIG, enabled: true, direction: 'from_linear' }, projectRoot);
|
|
532
|
-
const syncResult = await syncEngine.sync();
|
|
533
|
-
if (syncResult.success) {
|
|
534
|
-
console.log(` ā
Local tasks synced (${syncResult.synced.fromLinear} new, ${syncResult.synced.updated} updated)`);
|
|
535
|
-
}
|
|
536
|
-
db.close();
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
catch (error) {
|
|
540
|
-
logger.error('Failed to update Linear task', error);
|
|
541
|
-
console.error('ā Failed to update task:', error.message);
|
|
542
|
-
process.exit(1);
|
|
543
|
-
}
|
|
544
|
-
});
|
|
545
|
-
linearCommand
|
|
546
|
-
.command('config')
|
|
547
|
-
.description('Configure auto-sync settings')
|
|
548
|
-
.option('--show', 'Show current configuration')
|
|
549
|
-
.option('--set-interval <minutes>', 'Set sync interval in minutes')
|
|
550
|
-
.option('--set-direction <direction>', 'Set sync direction: bidirectional, to_linear, from_linear')
|
|
551
|
-
.option('--set-conflict-resolution <strategy>', 'Set conflict resolution: newest_wins, linear_wins, stackmemory_wins, manual')
|
|
552
|
-
.option('--set-quiet-start <hour>', 'Set start of quiet hours (0-23)')
|
|
553
|
-
.option('--set-quiet-end <hour>', 'Set end of quiet hours (0-23)')
|
|
554
|
-
.option('--enable', 'Enable auto-sync')
|
|
555
|
-
.option('--disable', 'Disable auto-sync')
|
|
556
|
-
.option('--reset', 'Reset to default configuration')
|
|
557
|
-
.action(async (options) => {
|
|
558
|
-
try {
|
|
559
|
-
const projectRoot = process.cwd();
|
|
560
|
-
const configManager = new LinearConfigManager(projectRoot);
|
|
561
|
-
if (options.reset) {
|
|
562
|
-
configManager.resetConfig();
|
|
563
|
-
console.log('ā
Configuration reset to defaults');
|
|
564
|
-
return;
|
|
565
|
-
}
|
|
566
|
-
if (options.show) {
|
|
567
|
-
const config = configManager.loadConfig();
|
|
568
|
-
if (config) {
|
|
569
|
-
console.log('š Linear Auto-Sync Configuration:');
|
|
570
|
-
console.log(` Enabled: ${config.enabled ? 'ā
' : 'ā'}`);
|
|
571
|
-
console.log(` Interval: ${config.interval} minutes`);
|
|
572
|
-
console.log(` Direction: ${config.direction}`);
|
|
573
|
-
console.log(` Conflict Resolution: ${config.conflictResolution}`);
|
|
574
|
-
console.log(` Retry Attempts: ${config.retryAttempts}`);
|
|
575
|
-
console.log(` Retry Delay: ${config.retryDelay / 1000}s`);
|
|
576
|
-
if (config.quietHours) {
|
|
577
|
-
console.log(` Quiet Hours: ${config.quietHours.start}:00 - ${config.quietHours.end}:00`);
|
|
578
|
-
}
|
|
579
|
-
const lastUpdated = new Date(config.lastUpdated);
|
|
580
|
-
console.log(` Last Updated: ${lastUpdated.toLocaleString()}`);
|
|
581
|
-
}
|
|
582
|
-
else {
|
|
583
|
-
console.log('š No configuration found. Using defaults.');
|
|
584
|
-
const defaultConfig = configManager.getDefaultConfig();
|
|
585
|
-
console.log(` Default interval: ${defaultConfig.interval} minutes`);
|
|
586
|
-
console.log(` Default direction: ${defaultConfig.direction}`);
|
|
587
|
-
}
|
|
588
|
-
return;
|
|
589
|
-
}
|
|
590
|
-
// Update configuration
|
|
591
|
-
const updates = {};
|
|
592
|
-
if (options.setInterval) {
|
|
593
|
-
const interval = parseInt(options.setInterval);
|
|
594
|
-
if (isNaN(interval) || interval < 1) {
|
|
595
|
-
console.error('ā Interval must be a positive number');
|
|
596
|
-
process.exit(1);
|
|
597
|
-
}
|
|
598
|
-
updates.interval = interval;
|
|
599
|
-
console.log(`ā
Set interval to ${interval} minutes`);
|
|
600
|
-
}
|
|
601
|
-
if (options.setDirection) {
|
|
602
|
-
const validDirections = ['bidirectional', 'to_linear', 'from_linear'];
|
|
603
|
-
if (!validDirections.includes(options.setDirection)) {
|
|
604
|
-
console.error(`ā Invalid direction. Must be one of: ${validDirections.join(', ')}`);
|
|
605
|
-
process.exit(1);
|
|
606
|
-
}
|
|
607
|
-
updates.direction = options.setDirection;
|
|
608
|
-
console.log(`ā
Set direction to ${options.setDirection}`);
|
|
609
|
-
}
|
|
610
|
-
if (options.setConflictResolution) {
|
|
611
|
-
const validStrategies = [
|
|
612
|
-
'newest_wins',
|
|
613
|
-
'linear_wins',
|
|
614
|
-
'stackmemory_wins',
|
|
615
|
-
'manual',
|
|
616
|
-
];
|
|
617
|
-
if (!validStrategies.includes(options.setConflictResolution)) {
|
|
618
|
-
console.error(`ā Invalid strategy. Must be one of: ${validStrategies.join(', ')}`);
|
|
619
|
-
process.exit(1);
|
|
620
|
-
}
|
|
621
|
-
updates.conflictResolution = options.setConflictResolution;
|
|
622
|
-
console.log(`ā
Set conflict resolution to ${options.setConflictResolution}`);
|
|
623
|
-
}
|
|
624
|
-
if (options.setQuietStart) {
|
|
625
|
-
const hour = parseInt(options.setQuietStart);
|
|
626
|
-
if (isNaN(hour) || hour < 0 || hour > 23) {
|
|
627
|
-
console.error('ā Quiet start hour must be between 0 and 23');
|
|
628
|
-
process.exit(1);
|
|
629
|
-
}
|
|
630
|
-
const currentConfig = configManager.loadConfig() || configManager.getDefaultConfig();
|
|
631
|
-
updates.quietHours = {
|
|
632
|
-
start: hour,
|
|
633
|
-
end: currentConfig.quietHours?.end || 7,
|
|
634
|
-
};
|
|
635
|
-
console.log(`ā
Set quiet hours start to ${hour}:00`);
|
|
636
|
-
}
|
|
637
|
-
if (options.setQuietEnd) {
|
|
638
|
-
const hour = parseInt(options.setQuietEnd);
|
|
639
|
-
if (isNaN(hour) || hour < 0 || hour > 23) {
|
|
640
|
-
console.error('ā Quiet end hour must be between 0 and 23');
|
|
641
|
-
process.exit(1);
|
|
642
|
-
}
|
|
643
|
-
const currentConfig = configManager.loadConfig() || configManager.getDefaultConfig();
|
|
644
|
-
updates.quietHours = {
|
|
645
|
-
start: currentConfig.quietHours?.start || 22,
|
|
646
|
-
end: hour,
|
|
647
|
-
};
|
|
648
|
-
console.log(`ā
Set quiet hours end to ${hour}:00`);
|
|
649
|
-
}
|
|
650
|
-
if (options.enable) {
|
|
651
|
-
updates.enabled = true;
|
|
652
|
-
console.log('ā
Auto-sync enabled');
|
|
653
|
-
}
|
|
654
|
-
if (options.disable) {
|
|
655
|
-
updates.enabled = false;
|
|
656
|
-
console.log('ā Auto-sync disabled');
|
|
657
|
-
}
|
|
658
|
-
if (Object.keys(updates).length > 0) {
|
|
659
|
-
configManager.saveConfig(updates);
|
|
660
|
-
console.log('\nš” Configuration updated. Restart auto-sync service to apply changes.');
|
|
661
|
-
}
|
|
662
|
-
else if (!options.show) {
|
|
663
|
-
console.log('š” Use --show to view current configuration');
|
|
664
|
-
console.log('š” Use --help to see all configuration options');
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
catch (error) {
|
|
668
|
-
logger.error('Linear config command failed', error);
|
|
669
|
-
console.error('ā Config failed:', error.message);
|
|
670
|
-
process.exit(1);
|
|
671
|
-
}
|
|
672
|
-
});
|
|
673
|
-
program
|
|
674
|
-
.command('update-check')
|
|
675
|
-
.description('Check for StackMemory updates')
|
|
676
|
-
.action(async () => {
|
|
677
|
-
try {
|
|
678
|
-
console.log('š Checking for updates...');
|
|
679
|
-
await UpdateChecker.forceCheck(VERSION);
|
|
680
|
-
}
|
|
681
|
-
catch (error) {
|
|
682
|
-
logger.error('Update check failed', error);
|
|
683
|
-
console.error('ā Update check failed:', error.message);
|
|
684
|
-
process.exit(1);
|
|
685
|
-
}
|
|
686
|
-
});
|
|
687
|
-
program
|
|
688
|
-
.command('analytics')
|
|
689
|
-
.description('Launch task analytics dashboard')
|
|
690
|
-
.option('-p, --port <port>', 'Port for dashboard server', '3000')
|
|
691
|
-
.option('-o, --open', 'Open dashboard in browser')
|
|
692
|
-
.option('--export <format>', 'Export metrics (json|csv)')
|
|
693
|
-
.option('--sync', 'Sync with Linear before launching')
|
|
694
|
-
.option('--view', 'Show analytics in terminal')
|
|
695
|
-
.action(async (options) => {
|
|
696
|
-
try {
|
|
697
|
-
const projectRoot = process.cwd();
|
|
698
|
-
const dbPath = join(projectRoot, '.stackmemory', 'context.db');
|
|
699
|
-
if (!existsSync(dbPath)) {
|
|
700
|
-
console.log('ā StackMemory not initialized. Run "stackmemory init" first.');
|
|
701
|
-
return;
|
|
702
|
-
}
|
|
703
|
-
if (options.view) {
|
|
704
|
-
const { displayAnalyticsDashboard } = await import('./utils/viewer.js');
|
|
705
|
-
await displayAnalyticsDashboard(projectRoot);
|
|
706
|
-
return;
|
|
707
|
-
}
|
|
708
|
-
if (options.export) {
|
|
709
|
-
const { AnalyticsService } = await import('../features/analytics/index.js');
|
|
710
|
-
const service = new AnalyticsService(projectRoot);
|
|
711
|
-
if (options.sync) {
|
|
712
|
-
console.log('š Syncing with Linear...');
|
|
713
|
-
await service.syncLinearTasks();
|
|
714
|
-
}
|
|
715
|
-
const state = await service.getDashboardState();
|
|
716
|
-
if (options.export === 'csv') {
|
|
717
|
-
console.log('š Exporting metrics as CSV...');
|
|
718
|
-
// Convert to CSV format
|
|
719
|
-
const tasks = state.recentTasks;
|
|
720
|
-
const headers = [
|
|
721
|
-
'ID',
|
|
722
|
-
'Title',
|
|
723
|
-
'State',
|
|
724
|
-
'Priority',
|
|
725
|
-
'Created',
|
|
726
|
-
'Completed',
|
|
727
|
-
];
|
|
728
|
-
const rows = tasks.map((t) => [
|
|
729
|
-
t.id,
|
|
730
|
-
t.title,
|
|
731
|
-
t.state,
|
|
732
|
-
t.priority,
|
|
733
|
-
t.createdAt.toISOString(),
|
|
734
|
-
t.completedAt?.toISOString() || '',
|
|
735
|
-
]);
|
|
736
|
-
console.log(headers.join(','));
|
|
737
|
-
rows.forEach((r) => console.log(r.join(',')));
|
|
738
|
-
}
|
|
739
|
-
else {
|
|
740
|
-
console.log(JSON.stringify(state, null, 2));
|
|
741
|
-
}
|
|
742
|
-
service.close();
|
|
743
|
-
return;
|
|
744
|
-
}
|
|
745
|
-
// Launch dashboard server
|
|
746
|
-
console.log(`š Launching analytics dashboard on port ${options.port}...`);
|
|
747
|
-
const express = (await import('express')).default;
|
|
748
|
-
const { AnalyticsAPI } = await import('../features/analytics/index.js');
|
|
749
|
-
const { createServer } = await import('http');
|
|
750
|
-
const app = express();
|
|
751
|
-
// Add error handling middleware
|
|
752
|
-
app.use((err, _req, res, _next) => {
|
|
753
|
-
console.error('Express error:', err);
|
|
754
|
-
res.status(500).json({ error: err.message });
|
|
755
|
-
});
|
|
756
|
-
const analyticsAPI = new AnalyticsAPI(projectRoot);
|
|
757
|
-
if (options.sync) {
|
|
758
|
-
console.log('š Syncing with Linear...');
|
|
759
|
-
const service = new (await import('../features/analytics/index.js')).AnalyticsService(projectRoot);
|
|
760
|
-
await service.syncLinearTasks();
|
|
761
|
-
service.close();
|
|
762
|
-
}
|
|
763
|
-
app.use('/api/analytics', analyticsAPI.getRouter());
|
|
764
|
-
// Serve the HTML dashboard
|
|
765
|
-
app.get('/', async (req, res) => {
|
|
766
|
-
// Try multiple paths for the dashboard HTML
|
|
767
|
-
const possiblePaths = [
|
|
768
|
-
join(projectRoot, 'src/features/analytics/dashboard.html'),
|
|
769
|
-
join(projectRoot, 'dist/features/analytics/dashboard.html'),
|
|
770
|
-
];
|
|
771
|
-
for (const dashboardPath of possiblePaths) {
|
|
772
|
-
if (existsSync(dashboardPath)) {
|
|
773
|
-
res.sendFile(dashboardPath);
|
|
774
|
-
return;
|
|
775
|
-
}
|
|
776
|
-
}
|
|
777
|
-
// Inline fallback dashboard
|
|
778
|
-
res.send(`<!DOCTYPE html>
|
|
779
|
-
<html lang="en">
|
|
780
|
-
<head>
|
|
781
|
-
<meta charset="UTF-8">
|
|
782
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
783
|
-
<title>StackMemory Analytics</title>
|
|
784
|
-
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
|
785
|
-
<style>
|
|
786
|
-
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
787
|
-
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #1a1a2e; color: #eee; padding: 20px; }
|
|
788
|
-
.container { max-width: 1200px; margin: 0 auto; }
|
|
789
|
-
h1 { color: #667eea; margin-bottom: 20px; }
|
|
790
|
-
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
|
|
791
|
-
.card { background: #16213e; border-radius: 12px; padding: 20px; }
|
|
792
|
-
.metric-value { font-size: 2.5em; font-weight: bold; color: #667eea; }
|
|
793
|
-
.metric-label { color: #888; text-transform: uppercase; font-size: 0.8em; }
|
|
794
|
-
.task-list { max-height: 400px; overflow-y: auto; }
|
|
795
|
-
.task-item { padding: 10px; border-left: 3px solid #667eea; margin-bottom: 8px; background: #1a1a2e; }
|
|
796
|
-
.task-item.completed { border-color: #22c55e; }
|
|
797
|
-
.task-item.in_progress { border-color: #f59e0b; }
|
|
798
|
-
.status { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.8em; margin-right: 8px; }
|
|
799
|
-
.status.completed { background: #22c55e30; color: #22c55e; }
|
|
800
|
-
.status.in_progress { background: #f59e0b30; color: #f59e0b; }
|
|
801
|
-
.status.todo { background: #667eea30; color: #667eea; }
|
|
802
|
-
</style>
|
|
803
|
-
</head>
|
|
804
|
-
<body>
|
|
805
|
-
<div class="container">
|
|
806
|
-
<h1>š StackMemory Analytics</h1>
|
|
807
|
-
<div class="grid" id="metrics"></div>
|
|
808
|
-
<div class="card"><h3>Recent Tasks</h3><div class="task-list" id="tasks">Loading...</div></div>
|
|
809
|
-
</div>
|
|
810
|
-
<script>
|
|
811
|
-
async function load() {
|
|
812
|
-
const metrics = await fetch('/api/analytics/metrics').then(r => r.json());
|
|
813
|
-
const tasks = await fetch('/api/analytics/tasks').then(r => r.json());
|
|
814
|
-
|
|
815
|
-
document.getElementById('metrics').innerHTML = \`
|
|
816
|
-
<div class="card"><div class="metric-label">Total</div><div class="metric-value">\${metrics.data.metrics.totalTasks}</div></div>
|
|
817
|
-
<div class="card"><div class="metric-label">Completed</div><div class="metric-value">\${metrics.data.metrics.completedTasks}</div></div>
|
|
818
|
-
<div class="card"><div class="metric-label">In Progress</div><div class="metric-value">\${metrics.data.metrics.inProgressTasks}</div></div>
|
|
819
|
-
<div class="card"><div class="metric-label">Completion</div><div class="metric-value">\${metrics.data.metrics.completionRate.toFixed(0)}%</div></div>
|
|
820
|
-
\`;
|
|
821
|
-
|
|
822
|
-
document.getElementById('tasks').innerHTML = tasks.data.tasks.slice(0, 10).map(t => \`
|
|
823
|
-
<div class="task-item \${t.state}">
|
|
824
|
-
<span class="status \${t.state}">\${t.state}</span>
|
|
825
|
-
<strong>\${t.title}</strong>
|
|
826
|
-
</div>
|
|
827
|
-
\`).join('');
|
|
828
|
-
}
|
|
829
|
-
load();
|
|
830
|
-
setInterval(load, 30000);
|
|
831
|
-
</script>
|
|
832
|
-
</body>
|
|
833
|
-
</html>`);
|
|
834
|
-
});
|
|
835
|
-
const server = createServer(app);
|
|
836
|
-
analyticsAPI.setupWebSocket(server);
|
|
837
|
-
server.listen(options.port, async () => {
|
|
838
|
-
console.log(`ā
Analytics dashboard running at http://localhost:${options.port}`);
|
|
839
|
-
if (options.open) {
|
|
840
|
-
const { exec } = await import('child_process');
|
|
841
|
-
const url = `http://localhost:${options.port}`;
|
|
842
|
-
const command = process.platform === 'darwin'
|
|
843
|
-
? `open ${url}`
|
|
844
|
-
: process.platform === 'win32'
|
|
845
|
-
? `start ${url}`
|
|
846
|
-
: `xdg-open ${url}`;
|
|
847
|
-
exec(command);
|
|
848
|
-
}
|
|
849
|
-
});
|
|
850
|
-
process.on('SIGINT', () => {
|
|
851
|
-
console.log('\nš Shutting down analytics dashboard...');
|
|
852
|
-
analyticsAPI.close();
|
|
853
|
-
server.close();
|
|
854
|
-
process.exit(0);
|
|
855
|
-
});
|
|
856
|
-
// Keep the process alive
|
|
857
|
-
await new Promise(() => { });
|
|
858
|
-
}
|
|
859
|
-
catch (error) {
|
|
860
|
-
logger.error('Analytics command failed', error);
|
|
861
|
-
console.error('ā Analytics failed:', error.message);
|
|
862
|
-
process.exit(1);
|
|
863
|
-
}
|
|
864
|
-
});
|
|
865
|
-
program
|
|
866
|
-
.command('progress')
|
|
867
|
-
.description('Show current progress and recent changes')
|
|
868
|
-
.action(async () => {
|
|
869
|
-
try {
|
|
870
|
-
const projectRoot = process.cwd();
|
|
871
|
-
const dbPath = join(projectRoot, '.stackmemory', 'context.db');
|
|
872
|
-
if (!existsSync(dbPath)) {
|
|
873
|
-
console.log('ā StackMemory not initialized. Run "stackmemory init" first.');
|
|
874
|
-
return;
|
|
875
|
-
}
|
|
876
|
-
const progress = new ProgressTracker(projectRoot);
|
|
877
|
-
console.log(progress.getSummary());
|
|
878
|
-
}
|
|
879
|
-
catch (error) {
|
|
880
|
-
logger.error('Failed to show progress', error);
|
|
881
|
-
console.error('ā Failed to show progress:', error.message);
|
|
882
|
-
process.exit(1);
|
|
883
|
-
}
|
|
884
|
-
});
|
|
885
|
-
program
|
|
886
|
-
.command('mcp-server')
|
|
887
|
-
.description('Start StackMemory MCP server for Claude Desktop')
|
|
888
|
-
.option('-p, --project <path>', 'Project root directory', process.cwd())
|
|
889
|
-
.action(async (options) => {
|
|
890
|
-
try {
|
|
891
|
-
const { runMCPServer } = await import('../integrations/mcp/server.js');
|
|
892
|
-
// Set project root
|
|
893
|
-
process.env.PROJECT_ROOT = options.project;
|
|
894
|
-
console.log('š Starting StackMemory MCP Server...');
|
|
895
|
-
console.log(` Project: ${options.project}`);
|
|
896
|
-
console.log(` Version: ${VERSION}`);
|
|
897
|
-
// Check for updates silently
|
|
898
|
-
UpdateChecker.checkForUpdates(VERSION, true).catch(() => { });
|
|
899
|
-
// Start the MCP server
|
|
900
|
-
await runMCPServer();
|
|
901
|
-
}
|
|
902
|
-
catch (error) {
|
|
903
|
-
logger.error('Failed to start MCP server', error);
|
|
904
|
-
console.error('ā MCP server failed:', error.message);
|
|
905
|
-
process.exit(1);
|
|
906
|
-
}
|
|
907
|
-
});
|
|
908
|
-
// Add test context command
|
|
909
|
-
program
|
|
910
|
-
.command('context:test')
|
|
911
|
-
.description('Test context persistence by creating sample frames')
|
|
912
|
-
.action(async () => {
|
|
913
|
-
try {
|
|
914
|
-
const projectRoot = process.cwd();
|
|
915
|
-
const dbPath = join(projectRoot, '.stackmemory', 'context.db');
|
|
916
|
-
if (!existsSync(dbPath)) {
|
|
917
|
-
console.log('ā StackMemory not initialized. Run "stackmemory init" first.');
|
|
918
|
-
return;
|
|
919
|
-
}
|
|
920
|
-
const db = new Database(dbPath);
|
|
921
|
-
const frameManager = new FrameManager(db, 'cli-project');
|
|
922
|
-
// Create test frames
|
|
923
|
-
console.log('š Creating test context frames...');
|
|
924
|
-
const rootFrame = frameManager.createFrame({
|
|
925
|
-
type: 'task',
|
|
926
|
-
name: 'Test Session',
|
|
927
|
-
inputs: { test: true, timestamp: new Date().toISOString() },
|
|
928
|
-
});
|
|
929
|
-
const taskFrame = frameManager.createFrame({
|
|
930
|
-
type: 'subtask',
|
|
931
|
-
name: 'Sample Task',
|
|
932
|
-
inputs: { description: 'Testing context persistence' },
|
|
933
|
-
parentFrameId: rootFrame,
|
|
934
|
-
});
|
|
935
|
-
const commandFrame = frameManager.createFrame({
|
|
936
|
-
type: 'tool_scope',
|
|
937
|
-
name: 'test-command',
|
|
938
|
-
inputs: { args: ['--test'] },
|
|
939
|
-
parentFrameId: taskFrame,
|
|
940
|
-
});
|
|
941
|
-
// Add some events
|
|
942
|
-
frameManager.addEvent('observation', {
|
|
943
|
-
message: 'Test event recorded',
|
|
944
|
-
}, commandFrame);
|
|
945
|
-
console.log('ā
Test frames created!');
|
|
946
|
-
console.log(`š Stack depth: ${frameManager.getStackDepth()}`);
|
|
947
|
-
console.log(`š Active frames: ${frameManager.getActiveFramePath().length}`);
|
|
948
|
-
// Close one frame to test state changes
|
|
949
|
-
frameManager.closeFrame(commandFrame);
|
|
950
|
-
console.log(`š After closing command frame: depth = ${frameManager.getStackDepth()}`);
|
|
951
|
-
db.close();
|
|
952
|
-
}
|
|
953
|
-
catch (error) {
|
|
954
|
-
logger.error('Test context failed', error);
|
|
955
|
-
console.error('ā Test failed:', error.message);
|
|
956
|
-
process.exit(1);
|
|
957
|
-
}
|
|
958
|
-
});
|
|
959
|
-
// Register project management commands
|
|
960
|
-
// Register command modules
|
|
961
|
-
registerOnboardingCommand(program);
|
|
962
|
-
registerProjectCommands(program);
|
|
963
|
-
registerWorktreeCommands(program);
|
|
964
|
-
// Register Linear integration commands
|
|
965
|
-
registerLinearCommands(program);
|
|
966
|
-
registerLinearTestCommand(program);
|
|
967
|
-
// Register session management commands
|
|
968
|
-
program.addCommand(createSessionCommands());
|
|
969
|
-
// Register webhook command
|
|
970
|
-
program.addCommand(webhookCommand());
|
|
971
|
-
// Register enhanced CLI commands
|
|
972
|
-
program.addCommand(createTaskCommands());
|
|
973
|
-
program.addCommand(createSearchCommand());
|
|
974
|
-
program.addCommand(createLogCommand());
|
|
975
|
-
program.addCommand(createContextCommands());
|
|
976
|
-
program.addCommand(createConfigCommand());
|
|
977
|
-
program.addCommand(createAgentCommand());
|
|
978
|
-
program.addCommand(createHandoffCommand());
|
|
979
|
-
// Auto-detect current project on startup
|
|
980
|
-
if (process.argv.length > 2) {
|
|
981
|
-
const manager = ProjectManager.getInstance();
|
|
982
|
-
manager.detectProject().catch(() => {
|
|
983
|
-
// Silently fail if not in a project directory
|
|
984
|
-
});
|
|
985
|
-
}
|
|
986
|
-
// Only parse when running as main module (not when imported for testing)
|
|
987
|
-
const isMainModule = import.meta.url === `file://${process.argv[1]}` ||
|
|
988
|
-
process.argv[1]?.endsWith('/stackmemory') ||
|
|
989
|
-
process.argv[1]?.endsWith('index.ts') ||
|
|
990
|
-
process.argv[1]?.includes('tsx');
|
|
991
|
-
if (isMainModule) {
|
|
992
|
-
program.parse();
|
|
993
|
-
}
|
|
994
|
-
export { program };
|
|
995
|
-
//# sourceMappingURL=index.js.map
|