@vinaes/succ 1.3.19
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/LICENSE +87 -0
- package/README.md +588 -0
- package/agents/succ-checkpoint-manager.md +51 -0
- package/agents/succ-code-reviewer.md +181 -0
- package/agents/succ-context-optimizer.md +83 -0
- package/agents/succ-debug.md +224 -0
- package/agents/succ-decision-auditor.md +74 -0
- package/agents/succ-deep-search.md +41 -0
- package/agents/succ-diff-reviewer.md +123 -0
- package/agents/succ-explore.md +83 -0
- package/agents/succ-general.md +109 -0
- package/agents/succ-knowledge-indexer.md +45 -0
- package/agents/succ-knowledge-mapper.md +61 -0
- package/agents/succ-memory-curator.md +43 -0
- package/agents/succ-memory-health-monitor.md +55 -0
- package/agents/succ-pattern-detective.md +62 -0
- package/agents/succ-plan.md +172 -0
- package/agents/succ-quality-improvement-coach.md +63 -0
- package/agents/succ-readiness-improver.md +62 -0
- package/agents/succ-session-handoff-orchestrator.md +54 -0
- package/agents/succ-session-reviewer.md +46 -0
- package/agents/succ-style-tracker.md +73 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +749 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/agents-md.d.ts +16 -0
- package/dist/commands/agents-md.d.ts.map +1 -0
- package/dist/commands/agents-md.js +33 -0
- package/dist/commands/agents-md.js.map +1 -0
- package/dist/commands/analyze-agents.d.ts +20 -0
- package/dist/commands/analyze-agents.d.ts.map +1 -0
- package/dist/commands/analyze-agents.js +305 -0
- package/dist/commands/analyze-agents.js.map +1 -0
- package/dist/commands/analyze-helpers.d.ts +22 -0
- package/dist/commands/analyze-helpers.d.ts.map +1 -0
- package/dist/commands/analyze-helpers.js +38 -0
- package/dist/commands/analyze-helpers.js.map +1 -0
- package/dist/commands/analyze-profile.d.ts +53 -0
- package/dist/commands/analyze-profile.d.ts.map +1 -0
- package/dist/commands/analyze-profile.js +638 -0
- package/dist/commands/analyze-profile.js.map +1 -0
- package/dist/commands/analyze-recursive.d.ts +20 -0
- package/dist/commands/analyze-recursive.d.ts.map +1 -0
- package/dist/commands/analyze-recursive.js +326 -0
- package/dist/commands/analyze-recursive.js.map +1 -0
- package/dist/commands/analyze-utils.d.ts +83 -0
- package/dist/commands/analyze-utils.d.ts.map +1 -0
- package/dist/commands/analyze-utils.js +541 -0
- package/dist/commands/analyze-utils.js.map +1 -0
- package/dist/commands/analyze.d.ts +15 -0
- package/dist/commands/analyze.d.ts.map +1 -0
- package/dist/commands/analyze.js +265 -0
- package/dist/commands/analyze.js.map +1 -0
- package/dist/commands/backfill.d.ts +22 -0
- package/dist/commands/backfill.d.ts.map +1 -0
- package/dist/commands/backfill.js +62 -0
- package/dist/commands/backfill.js.map +1 -0
- package/dist/commands/benchmark-quality.d.ts +18 -0
- package/dist/commands/benchmark-quality.d.ts.map +1 -0
- package/dist/commands/benchmark-quality.js +316 -0
- package/dist/commands/benchmark-quality.js.map +1 -0
- package/dist/commands/benchmark-sqlite-vec.d.ts +12 -0
- package/dist/commands/benchmark-sqlite-vec.d.ts.map +1 -0
- package/dist/commands/benchmark-sqlite-vec.js +281 -0
- package/dist/commands/benchmark-sqlite-vec.js.map +1 -0
- package/dist/commands/benchmark.d.ts +57 -0
- package/dist/commands/benchmark.d.ts.map +1 -0
- package/dist/commands/benchmark.js +682 -0
- package/dist/commands/benchmark.js.map +1 -0
- package/dist/commands/chat.d.ts +14 -0
- package/dist/commands/chat.d.ts.map +1 -0
- package/dist/commands/chat.js +84 -0
- package/dist/commands/chat.js.map +1 -0
- package/dist/commands/checkpoint.d.ts +27 -0
- package/dist/commands/checkpoint.d.ts.map +1 -0
- package/dist/commands/checkpoint.js +181 -0
- package/dist/commands/checkpoint.js.map +1 -0
- package/dist/commands/clear.d.ts +9 -0
- package/dist/commands/clear.d.ts.map +1 -0
- package/dist/commands/clear.js +31 -0
- package/dist/commands/clear.js.map +1 -0
- package/dist/commands/config.d.ts +26 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +247 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/consolidate.d.ts +21 -0
- package/dist/commands/consolidate.d.ts.map +1 -0
- package/dist/commands/consolidate.js +117 -0
- package/dist/commands/consolidate.js.map +1 -0
- package/dist/commands/daemon.d.ts +48 -0
- package/dist/commands/daemon.d.ts.map +1 -0
- package/dist/commands/daemon.js +218 -0
- package/dist/commands/daemon.js.map +1 -0
- package/dist/commands/embedding.d.ts +26 -0
- package/dist/commands/embedding.d.ts.map +1 -0
- package/dist/commands/embedding.js +168 -0
- package/dist/commands/embedding.js.map +1 -0
- package/dist/commands/graph.d.ts +20 -0
- package/dist/commands/graph.d.ts.map +1 -0
- package/dist/commands/graph.js +128 -0
- package/dist/commands/graph.js.map +1 -0
- package/dist/commands/index-code.d.ts +23 -0
- package/dist/commands/index-code.d.ts.map +1 -0
- package/dist/commands/index-code.js +218 -0
- package/dist/commands/index-code.js.map +1 -0
- package/dist/commands/index.d.ts +23 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +217 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/init-templates.d.ts +21 -0
- package/dist/commands/init-templates.d.ts.map +1 -0
- package/dist/commands/init-templates.js +487 -0
- package/dist/commands/init-templates.js.map +1 -0
- package/dist/commands/init.d.ts +10 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +865 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/memories.d.ts +47 -0
- package/dist/commands/memories.d.ts.map +1 -0
- package/dist/commands/memories.js +597 -0
- package/dist/commands/memories.js.map +1 -0
- package/dist/commands/migrate.d.ts +19 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +154 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/prd.d.ts +46 -0
- package/dist/commands/prd.d.ts.map +1 -0
- package/dist/commands/prd.js +378 -0
- package/dist/commands/prd.js.map +1 -0
- package/dist/commands/precompute-context.d.ts +11 -0
- package/dist/commands/precompute-context.d.ts.map +1 -0
- package/dist/commands/precompute-context.js +12 -0
- package/dist/commands/precompute-context.js.map +1 -0
- package/dist/commands/progress.d.ts +16 -0
- package/dist/commands/progress.d.ts.map +1 -0
- package/dist/commands/progress.js +38 -0
- package/dist/commands/progress.js.map +1 -0
- package/dist/commands/reindex.d.ts +17 -0
- package/dist/commands/reindex.d.ts.map +1 -0
- package/dist/commands/reindex.js +83 -0
- package/dist/commands/reindex.js.map +1 -0
- package/dist/commands/retention.d.ts +19 -0
- package/dist/commands/retention.d.ts.map +1 -0
- package/dist/commands/retention.js +162 -0
- package/dist/commands/retention.js.map +1 -0
- package/dist/commands/score.d.ts +10 -0
- package/dist/commands/score.d.ts.map +1 -0
- package/dist/commands/score.js +28 -0
- package/dist/commands/score.js.map +1 -0
- package/dist/commands/search.d.ts +7 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +89 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/session-summary.d.ts +15 -0
- package/dist/commands/session-summary.d.ts.map +1 -0
- package/dist/commands/session-summary.js +16 -0
- package/dist/commands/session-summary.js.map +1 -0
- package/dist/commands/setup.d.ts +6 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +222 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/soul.d.ts +9 -0
- package/dist/commands/soul.d.ts.map +1 -0
- package/dist/commands/soul.js +256 -0
- package/dist/commands/soul.js.map +1 -0
- package/dist/commands/stats.d.ts +18 -0
- package/dist/commands/stats.d.ts.map +1 -0
- package/dist/commands/stats.js +138 -0
- package/dist/commands/stats.js.map +1 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +145 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/train-bpe.d.ts +8 -0
- package/dist/commands/train-bpe.d.ts.map +1 -0
- package/dist/commands/train-bpe.js +35 -0
- package/dist/commands/train-bpe.js.map +1 -0
- package/dist/commands/watch.d.ts +22 -0
- package/dist/commands/watch.d.ts.map +1 -0
- package/dist/commands/watch.js +171 -0
- package/dist/commands/watch.js.map +1 -0
- package/dist/daemon/analyzer.d.ts +54 -0
- package/dist/daemon/analyzer.d.ts.map +1 -0
- package/dist/daemon/analyzer.js +362 -0
- package/dist/daemon/analyzer.js.map +1 -0
- package/dist/daemon/client.d.ts +87 -0
- package/dist/daemon/client.d.ts.map +1 -0
- package/dist/daemon/client.js +356 -0
- package/dist/daemon/client.js.map +1 -0
- package/dist/daemon/index.d.ts +12 -0
- package/dist/daemon/index.d.ts.map +1 -0
- package/dist/daemon/index.js +12 -0
- package/dist/daemon/index.js.map +1 -0
- package/dist/daemon/service.d.ts +51 -0
- package/dist/daemon/service.d.ts.map +1 -0
- package/dist/daemon/service.js +1203 -0
- package/dist/daemon/service.js.map +1 -0
- package/dist/daemon/session-processor.d.ts +85 -0
- package/dist/daemon/session-processor.d.ts.map +1 -0
- package/dist/daemon/session-processor.js +571 -0
- package/dist/daemon/session-processor.js.map +1 -0
- package/dist/daemon/sessions.d.ts +62 -0
- package/dist/daemon/sessions.d.ts.map +1 -0
- package/dist/daemon/sessions.js +192 -0
- package/dist/daemon/sessions.js.map +1 -0
- package/dist/daemon/watcher.d.ts +52 -0
- package/dist/daemon/watcher.d.ts.map +1 -0
- package/dist/daemon/watcher.js +363 -0
- package/dist/daemon/watcher.js.map +1 -0
- package/dist/lib/agents-md-generator.d.ts +33 -0
- package/dist/lib/agents-md-generator.d.ts.map +1 -0
- package/dist/lib/agents-md-generator.js +156 -0
- package/dist/lib/agents-md-generator.js.map +1 -0
- package/dist/lib/ai-readiness.d.ts +132 -0
- package/dist/lib/ai-readiness.d.ts.map +1 -0
- package/dist/lib/ai-readiness.js +702 -0
- package/dist/lib/ai-readiness.js.map +1 -0
- package/dist/lib/analyze-state.d.ts +34 -0
- package/dist/lib/analyze-state.d.ts.map +1 -0
- package/dist/lib/analyze-state.js +106 -0
- package/dist/lib/analyze-state.js.map +1 -0
- package/dist/lib/benchmark.d.ts +250 -0
- package/dist/lib/benchmark.d.ts.map +1 -0
- package/dist/lib/benchmark.js +778 -0
- package/dist/lib/benchmark.js.map +1 -0
- package/dist/lib/bm25.d.ts +114 -0
- package/dist/lib/bm25.d.ts.map +1 -0
- package/dist/lib/bm25.js +727 -0
- package/dist/lib/bm25.js.map +1 -0
- package/dist/lib/bpe.d.ts +70 -0
- package/dist/lib/bpe.d.ts.map +1 -0
- package/dist/lib/bpe.js +270 -0
- package/dist/lib/bpe.js.map +1 -0
- package/dist/lib/checkpoint.d.ts +124 -0
- package/dist/lib/checkpoint.d.ts.map +1 -0
- package/dist/lib/checkpoint.js +321 -0
- package/dist/lib/checkpoint.js.map +1 -0
- package/dist/lib/chunker.d.ts +47 -0
- package/dist/lib/chunker.d.ts.map +1 -0
- package/dist/lib/chunker.js +358 -0
- package/dist/lib/chunker.js.map +1 -0
- package/dist/lib/claude-ws-transport.d.ts +76 -0
- package/dist/lib/claude-ws-transport.d.ts.map +1 -0
- package/dist/lib/claude-ws-transport.js +487 -0
- package/dist/lib/claude-ws-transport.js.map +1 -0
- package/dist/lib/compact-briefing.d.ts +22 -0
- package/dist/lib/compact-briefing.d.ts.map +1 -0
- package/dist/lib/compact-briefing.js +180 -0
- package/dist/lib/compact-briefing.js.map +1 -0
- package/dist/lib/config-defaults.d.ts +41 -0
- package/dist/lib/config-defaults.d.ts.map +1 -0
- package/dist/lib/config-defaults.js +99 -0
- package/dist/lib/config-defaults.js.map +1 -0
- package/dist/lib/config-display.d.ts +16 -0
- package/dist/lib/config-display.d.ts.map +1 -0
- package/dist/lib/config-display.js +408 -0
- package/dist/lib/config-display.js.map +1 -0
- package/dist/lib/config-types.d.ts +601 -0
- package/dist/lib/config-types.d.ts.map +1 -0
- package/dist/lib/config-types.js +7 -0
- package/dist/lib/config-types.js.map +1 -0
- package/dist/lib/config-validation.d.ts +19 -0
- package/dist/lib/config-validation.d.ts.map +1 -0
- package/dist/lib/config-validation.js +136 -0
- package/dist/lib/config-validation.js.map +1 -0
- package/dist/lib/config.d.ts +143 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +689 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/consolidate.d.ts +115 -0
- package/dist/lib/consolidate.d.ts.map +1 -0
- package/dist/lib/consolidate.js +600 -0
- package/dist/lib/consolidate.js.map +1 -0
- package/dist/lib/db/bm25-indexes.d.ts +58 -0
- package/dist/lib/db/bm25-indexes.d.ts.map +1 -0
- package/dist/lib/db/bm25-indexes.js +333 -0
- package/dist/lib/db/bm25-indexes.js.map +1 -0
- package/dist/lib/db/bpe.d.ts +18 -0
- package/dist/lib/db/bpe.d.ts.map +1 -0
- package/dist/lib/db/bpe.js +44 -0
- package/dist/lib/db/bpe.js.map +1 -0
- package/dist/lib/db/connection.d.ts +47 -0
- package/dist/lib/db/connection.d.ts.map +1 -0
- package/dist/lib/db/connection.js +114 -0
- package/dist/lib/db/connection.js.map +1 -0
- package/dist/lib/db/documents.d.ts +58 -0
- package/dist/lib/db/documents.d.ts.map +1 -0
- package/dist/lib/db/documents.js +374 -0
- package/dist/lib/db/documents.js.map +1 -0
- package/dist/lib/db/file-hash.d.ts +26 -0
- package/dist/lib/db/file-hash.d.ts.map +1 -0
- package/dist/lib/db/file-hash.js +56 -0
- package/dist/lib/db/file-hash.js.map +1 -0
- package/dist/lib/db/global-memories.d.ts +62 -0
- package/dist/lib/db/global-memories.d.ts.map +1 -0
- package/dist/lib/db/global-memories.js +173 -0
- package/dist/lib/db/global-memories.js.map +1 -0
- package/dist/lib/db/graph.d.ts +163 -0
- package/dist/lib/db/graph.d.ts.map +1 -0
- package/dist/lib/db/graph.js +488 -0
- package/dist/lib/db/graph.js.map +1 -0
- package/dist/lib/db/helpers.d.ts +13 -0
- package/dist/lib/db/helpers.d.ts.map +1 -0
- package/dist/lib/db/helpers.js +21 -0
- package/dist/lib/db/helpers.js.map +1 -0
- package/dist/lib/db/hybrid-search.d.ts +64 -0
- package/dist/lib/db/hybrid-search.d.ts.map +1 -0
- package/dist/lib/db/hybrid-search.js +549 -0
- package/dist/lib/db/hybrid-search.js.map +1 -0
- package/dist/lib/db/index.d.ts +23 -0
- package/dist/lib/db/index.d.ts.map +1 -0
- package/dist/lib/db/index.js +23 -0
- package/dist/lib/db/index.js.map +1 -0
- package/dist/lib/db/memories.d.ts +174 -0
- package/dist/lib/db/memories.d.ts.map +1 -0
- package/dist/lib/db/memories.js +866 -0
- package/dist/lib/db/memories.js.map +1 -0
- package/dist/lib/db/retention.d.ts +64 -0
- package/dist/lib/db/retention.d.ts.map +1 -0
- package/dist/lib/db/retention.js +115 -0
- package/dist/lib/db/retention.js.map +1 -0
- package/dist/lib/db/schema.d.ts +29 -0
- package/dist/lib/db/schema.d.ts.map +1 -0
- package/dist/lib/db/schema.js +832 -0
- package/dist/lib/db/schema.js.map +1 -0
- package/dist/lib/db/skills.d.ts +65 -0
- package/dist/lib/db/skills.d.ts.map +1 -0
- package/dist/lib/db/skills.js +119 -0
- package/dist/lib/db/skills.js.map +1 -0
- package/dist/lib/db/token-frequency.d.ts +34 -0
- package/dist/lib/db/token-frequency.d.ts.map +1 -0
- package/dist/lib/db/token-frequency.js +92 -0
- package/dist/lib/db/token-frequency.js.map +1 -0
- package/dist/lib/db/token-stats.d.ts +43 -0
- package/dist/lib/db/token-stats.d.ts.map +1 -0
- package/dist/lib/db/token-stats.js +59 -0
- package/dist/lib/db/token-stats.js.map +1 -0
- package/dist/lib/db/types.d.ts +57 -0
- package/dist/lib/db/types.d.ts.map +1 -0
- package/dist/lib/db/types.js +5 -0
- package/dist/lib/db/types.js.map +1 -0
- package/dist/lib/db/web-search-history.d.ts +22 -0
- package/dist/lib/db/web-search-history.d.ts.map +1 -0
- package/dist/lib/db/web-search-history.js +107 -0
- package/dist/lib/db/web-search-history.js.map +1 -0
- package/dist/lib/debug/state.d.ts +17 -0
- package/dist/lib/debug/state.d.ts.map +1 -0
- package/dist/lib/debug/state.js +131 -0
- package/dist/lib/debug/state.js.map +1 -0
- package/dist/lib/debug/types.d.ts +74 -0
- package/dist/lib/debug/types.d.ts.map +1 -0
- package/dist/lib/debug/types.js +85 -0
- package/dist/lib/debug/types.js.map +1 -0
- package/dist/lib/embedding-pool.d.ts +37 -0
- package/dist/lib/embedding-pool.d.ts.map +1 -0
- package/dist/lib/embedding-pool.js +159 -0
- package/dist/lib/embedding-pool.js.map +1 -0
- package/dist/lib/embedding-worker.d.ts +7 -0
- package/dist/lib/embedding-worker.d.ts.map +1 -0
- package/dist/lib/embedding-worker.js +49 -0
- package/dist/lib/embedding-worker.js.map +1 -0
- package/dist/lib/embeddings.d.ts +54 -0
- package/dist/lib/embeddings.d.ts.map +1 -0
- package/dist/lib/embeddings.js +437 -0
- package/dist/lib/embeddings.js.map +1 -0
- package/dist/lib/errors.d.ts +40 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +66 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/fault-logger.d.ts +35 -0
- package/dist/lib/fault-logger.d.ts.map +1 -0
- package/dist/lib/fault-logger.js +182 -0
- package/dist/lib/fault-logger.js.map +1 -0
- package/dist/lib/graph/centrality.d.ts +34 -0
- package/dist/lib/graph/centrality.d.ts.map +1 -0
- package/dist/lib/graph/centrality.js +76 -0
- package/dist/lib/graph/centrality.js.map +1 -0
- package/dist/lib/graph/cleanup.d.ts +36 -0
- package/dist/lib/graph/cleanup.d.ts.map +1 -0
- package/dist/lib/graph/cleanup.js +96 -0
- package/dist/lib/graph/cleanup.js.map +1 -0
- package/dist/lib/graph/community-detection.d.ts +61 -0
- package/dist/lib/graph/community-detection.d.ts.map +1 -0
- package/dist/lib/graph/community-detection.js +218 -0
- package/dist/lib/graph/community-detection.js.map +1 -0
- package/dist/lib/graph/contextual-proximity.d.ts +41 -0
- package/dist/lib/graph/contextual-proximity.d.ts.map +1 -0
- package/dist/lib/graph/contextual-proximity.js +125 -0
- package/dist/lib/graph/contextual-proximity.js.map +1 -0
- package/dist/lib/graph/llm-relations.d.ts +54 -0
- package/dist/lib/graph/llm-relations.d.ts.map +1 -0
- package/dist/lib/graph/llm-relations.js +265 -0
- package/dist/lib/graph/llm-relations.js.map +1 -0
- package/dist/lib/graph-export.d.ts +13 -0
- package/dist/lib/graph-export.d.ts.map +1 -0
- package/dist/lib/graph-export.js +637 -0
- package/dist/lib/graph-export.js.map +1 -0
- package/dist/lib/graph-scheduler.d.ts +7 -0
- package/dist/lib/graph-scheduler.d.ts.map +1 -0
- package/dist/lib/graph-scheduler.js +21 -0
- package/dist/lib/graph-scheduler.js.map +1 -0
- package/dist/lib/indexer.d.ts +36 -0
- package/dist/lib/indexer.d.ts.map +1 -0
- package/dist/lib/indexer.js +226 -0
- package/dist/lib/indexer.js.map +1 -0
- package/dist/lib/learning-delta.d.ts +35 -0
- package/dist/lib/learning-delta.d.ts.map +1 -0
- package/dist/lib/learning-delta.js +53 -0
- package/dist/lib/learning-delta.js.map +1 -0
- package/dist/lib/llm.d.ts +118 -0
- package/dist/lib/llm.d.ts.map +1 -0
- package/dist/lib/llm.js +439 -0
- package/dist/lib/llm.js.map +1 -0
- package/dist/lib/lock.d.ts +27 -0
- package/dist/lib/lock.d.ts.map +1 -0
- package/dist/lib/lock.js +143 -0
- package/dist/lib/lock.js.map +1 -0
- package/dist/lib/md-fetch.d.ts +61 -0
- package/dist/lib/md-fetch.d.ts.map +1 -0
- package/dist/lib/md-fetch.js +141 -0
- package/dist/lib/md-fetch.js.map +1 -0
- package/dist/lib/mmr.d.ts +29 -0
- package/dist/lib/mmr.d.ts.map +1 -0
- package/dist/lib/mmr.js +89 -0
- package/dist/lib/mmr.js.map +1 -0
- package/dist/lib/onboarding/ai-chat.d.ts +11 -0
- package/dist/lib/onboarding/ai-chat.d.ts.map +1 -0
- package/dist/lib/onboarding/ai-chat.js +85 -0
- package/dist/lib/onboarding/ai-chat.js.map +1 -0
- package/dist/lib/onboarding/index.d.ts +7 -0
- package/dist/lib/onboarding/index.d.ts.map +1 -0
- package/dist/lib/onboarding/index.js +7 -0
- package/dist/lib/onboarding/index.js.map +1 -0
- package/dist/lib/onboarding/wizard.d.ts +11 -0
- package/dist/lib/onboarding/wizard.d.ts.map +1 -0
- package/dist/lib/onboarding/wizard.js +104 -0
- package/dist/lib/onboarding/wizard.js.map +1 -0
- package/dist/lib/ort-provider.d.ts +27 -0
- package/dist/lib/ort-provider.d.ts.map +1 -0
- package/dist/lib/ort-provider.js +83 -0
- package/dist/lib/ort-provider.js.map +1 -0
- package/dist/lib/ort-session.d.ts +32 -0
- package/dist/lib/ort-session.d.ts.map +1 -0
- package/dist/lib/ort-session.js +227 -0
- package/dist/lib/ort-session.js.map +1 -0
- package/dist/lib/patterns.d.ts +43 -0
- package/dist/lib/patterns.d.ts.map +1 -0
- package/dist/lib/patterns.js +395 -0
- package/dist/lib/patterns.js.map +1 -0
- package/dist/lib/prd/codebase-context.d.ts +27 -0
- package/dist/lib/prd/codebase-context.d.ts.map +1 -0
- package/dist/lib/prd/codebase-context.js +420 -0
- package/dist/lib/prd/codebase-context.js.map +1 -0
- package/dist/lib/prd/context.d.ts +24 -0
- package/dist/lib/prd/context.d.ts.map +1 -0
- package/dist/lib/prd/context.js +68 -0
- package/dist/lib/prd/context.js.map +1 -0
- package/dist/lib/prd/executor.d.ts +52 -0
- package/dist/lib/prd/executor.d.ts.map +1 -0
- package/dist/lib/prd/executor.js +154 -0
- package/dist/lib/prd/executor.js.map +1 -0
- package/dist/lib/prd/export.d.ts +40 -0
- package/dist/lib/prd/export.d.ts.map +1 -0
- package/dist/lib/prd/export.js +511 -0
- package/dist/lib/prd/export.js.map +1 -0
- package/dist/lib/prd/gates.d.ts +30 -0
- package/dist/lib/prd/gates.d.ts.map +1 -0
- package/dist/lib/prd/gates.js +100 -0
- package/dist/lib/prd/gates.js.map +1 -0
- package/dist/lib/prd/generate.d.ts +56 -0
- package/dist/lib/prd/generate.d.ts.map +1 -0
- package/dist/lib/prd/generate.js +357 -0
- package/dist/lib/prd/generate.js.map +1 -0
- package/dist/lib/prd/parse.d.ts +21 -0
- package/dist/lib/prd/parse.d.ts.map +1 -0
- package/dist/lib/prd/parse.js +270 -0
- package/dist/lib/prd/parse.js.map +1 -0
- package/dist/lib/prd/prompt-builder.d.ts +18 -0
- package/dist/lib/prd/prompt-builder.d.ts.map +1 -0
- package/dist/lib/prd/prompt-builder.js +61 -0
- package/dist/lib/prd/prompt-builder.js.map +1 -0
- package/dist/lib/prd/runner.d.ts +54 -0
- package/dist/lib/prd/runner.d.ts.map +1 -0
- package/dist/lib/prd/runner.js +563 -0
- package/dist/lib/prd/runner.js.map +1 -0
- package/dist/lib/prd/scheduler.d.ts +27 -0
- package/dist/lib/prd/scheduler.d.ts.map +1 -0
- package/dist/lib/prd/scheduler.js +113 -0
- package/dist/lib/prd/scheduler.js.map +1 -0
- package/dist/lib/prd/state.d.ts +77 -0
- package/dist/lib/prd/state.d.ts.map +1 -0
- package/dist/lib/prd/state.js +253 -0
- package/dist/lib/prd/state.js.map +1 -0
- package/dist/lib/prd/team-runner.d.ts +48 -0
- package/dist/lib/prd/team-runner.d.ts.map +1 -0
- package/dist/lib/prd/team-runner.js +261 -0
- package/dist/lib/prd/team-runner.js.map +1 -0
- package/dist/lib/prd/types.d.ts +169 -0
- package/dist/lib/prd/types.d.ts.map +1 -0
- package/dist/lib/prd/types.js +143 -0
- package/dist/lib/prd/types.js.map +1 -0
- package/dist/lib/prd/worktree.d.ts +54 -0
- package/dist/lib/prd/worktree.d.ts.map +1 -0
- package/dist/lib/prd/worktree.js +255 -0
- package/dist/lib/prd/worktree.js.map +1 -0
- package/dist/lib/precompute-context.d.ts +48 -0
- package/dist/lib/precompute-context.d.ts.map +1 -0
- package/dist/lib/precompute-context.js +265 -0
- package/dist/lib/precompute-context.js.map +1 -0
- package/dist/lib/pricing.d.ts +60 -0
- package/dist/lib/pricing.d.ts.map +1 -0
- package/dist/lib/pricing.js +258 -0
- package/dist/lib/pricing.js.map +1 -0
- package/dist/lib/process-registry.d.ts +30 -0
- package/dist/lib/process-registry.d.ts.map +1 -0
- package/dist/lib/process-registry.js +92 -0
- package/dist/lib/process-registry.js.map +1 -0
- package/dist/lib/progress-log.d.ts +44 -0
- package/dist/lib/progress-log.d.ts.map +1 -0
- package/dist/lib/progress-log.js +58 -0
- package/dist/lib/progress-log.js.map +1 -0
- package/dist/lib/public-api.d.ts +56 -0
- package/dist/lib/public-api.d.ts.map +1 -0
- package/dist/lib/public-api.js +63 -0
- package/dist/lib/public-api.js.map +1 -0
- package/dist/lib/quality.d.ts +66 -0
- package/dist/lib/quality.d.ts.map +1 -0
- package/dist/lib/quality.js +486 -0
- package/dist/lib/quality.js.map +1 -0
- package/dist/lib/query-expansion.d.ts +16 -0
- package/dist/lib/query-expansion.d.ts.map +1 -0
- package/dist/lib/query-expansion.js +53 -0
- package/dist/lib/query-expansion.js.map +1 -0
- package/dist/lib/readiness.d.ts +35 -0
- package/dist/lib/readiness.d.ts.map +1 -0
- package/dist/lib/readiness.js +142 -0
- package/dist/lib/readiness.js.map +1 -0
- package/dist/lib/reference-embeddings.d.ts +39 -0
- package/dist/lib/reference-embeddings.d.ts.map +1 -0
- package/dist/lib/reference-embeddings.js +95 -0
- package/dist/lib/reference-embeddings.js.map +1 -0
- package/dist/lib/reflection-synthesizer.d.ts +27 -0
- package/dist/lib/reflection-synthesizer.d.ts.map +1 -0
- package/dist/lib/reflection-synthesizer.js +149 -0
- package/dist/lib/reflection-synthesizer.js.map +1 -0
- package/dist/lib/retention.d.ts +105 -0
- package/dist/lib/retention.d.ts.map +1 -0
- package/dist/lib/retention.js +246 -0
- package/dist/lib/retention.js.map +1 -0
- package/dist/lib/sensitive-filter.d.ts +34 -0
- package/dist/lib/sensitive-filter.d.ts.map +1 -0
- package/dist/lib/sensitive-filter.js +344 -0
- package/dist/lib/sensitive-filter.js.map +1 -0
- package/dist/lib/session-observations.d.ts +59 -0
- package/dist/lib/session-observations.d.ts.map +1 -0
- package/dist/lib/session-observations.js +128 -0
- package/dist/lib/session-observations.js.map +1 -0
- package/dist/lib/session-summary.d.ts +65 -0
- package/dist/lib/session-summary.d.ts.map +1 -0
- package/dist/lib/session-summary.js +344 -0
- package/dist/lib/session-summary.js.map +1 -0
- package/dist/lib/similarity-worker.d.ts +7 -0
- package/dist/lib/similarity-worker.d.ts.map +1 -0
- package/dist/lib/similarity-worker.js +36 -0
- package/dist/lib/similarity-worker.js.map +1 -0
- package/dist/lib/skills.d.ts +78 -0
- package/dist/lib/skills.d.ts.map +1 -0
- package/dist/lib/skills.js +439 -0
- package/dist/lib/skills.js.map +1 -0
- package/dist/lib/skyll-client.d.ts +59 -0
- package/dist/lib/skyll-client.d.ts.map +1 -0
- package/dist/lib/skyll-client.js +257 -0
- package/dist/lib/skyll-client.js.map +1 -0
- package/dist/lib/storage/backends/interface.d.ts +383 -0
- package/dist/lib/storage/backends/interface.d.ts.map +1 -0
- package/dist/lib/storage/backends/interface.js +12 -0
- package/dist/lib/storage/backends/interface.js.map +1 -0
- package/dist/lib/storage/backends/postgresql.d.ts +454 -0
- package/dist/lib/storage/backends/postgresql.d.ts.map +1 -0
- package/dist/lib/storage/backends/postgresql.js +2528 -0
- package/dist/lib/storage/backends/postgresql.js.map +1 -0
- package/dist/lib/storage/benchmark.d.ts +16 -0
- package/dist/lib/storage/benchmark.d.ts.map +1 -0
- package/dist/lib/storage/benchmark.js +219 -0
- package/dist/lib/storage/benchmark.js.map +1 -0
- package/dist/lib/storage/dispatcher-export.d.ts +108 -0
- package/dist/lib/storage/dispatcher-export.d.ts.map +1 -0
- package/dist/lib/storage/dispatcher-export.js +593 -0
- package/dist/lib/storage/dispatcher-export.js.map +1 -0
- package/dist/lib/storage/dispatcher.d.ts +468 -0
- package/dist/lib/storage/dispatcher.d.ts.map +1 -0
- package/dist/lib/storage/dispatcher.js +1926 -0
- package/dist/lib/storage/dispatcher.js.map +1 -0
- package/dist/lib/storage/index.d.ts +481 -0
- package/dist/lib/storage/index.d.ts.map +1 -0
- package/dist/lib/storage/index.js +727 -0
- package/dist/lib/storage/index.js.map +1 -0
- package/dist/lib/storage/migration/export-import.d.ts +133 -0
- package/dist/lib/storage/migration/export-import.d.ts.map +1 -0
- package/dist/lib/storage/migration/export-import.js +264 -0
- package/dist/lib/storage/migration/export-import.js.map +1 -0
- package/dist/lib/storage/types.d.ts +313 -0
- package/dist/lib/storage/types.d.ts.map +1 -0
- package/dist/lib/storage/types.js +30 -0
- package/dist/lib/storage/types.js.map +1 -0
- package/dist/lib/storage/vector/interface.d.ts +89 -0
- package/dist/lib/storage/vector/interface.d.ts.map +1 -0
- package/dist/lib/storage/vector/interface.js +10 -0
- package/dist/lib/storage/vector/interface.js.map +1 -0
- package/dist/lib/storage/vector/qdrant.d.ts +221 -0
- package/dist/lib/storage/vector/qdrant.d.ts.map +1 -0
- package/dist/lib/storage/vector/qdrant.js +880 -0
- package/dist/lib/storage/vector/qdrant.js.map +1 -0
- package/dist/lib/supersession.d.ts +26 -0
- package/dist/lib/supersession.d.ts.map +1 -0
- package/dist/lib/supersession.js +97 -0
- package/dist/lib/supersession.js.map +1 -0
- package/dist/lib/temporal.d.ts +140 -0
- package/dist/lib/temporal.d.ts.map +1 -0
- package/dist/lib/temporal.js +303 -0
- package/dist/lib/temporal.js.map +1 -0
- package/dist/lib/token-budget.d.ts +79 -0
- package/dist/lib/token-budget.d.ts.map +1 -0
- package/dist/lib/token-budget.js +146 -0
- package/dist/lib/token-budget.js.map +1 -0
- package/dist/lib/token-counter.d.ts +27 -0
- package/dist/lib/token-counter.d.ts.map +1 -0
- package/dist/lib/token-counter.js +52 -0
- package/dist/lib/token-counter.js.map +1 -0
- package/dist/lib/tree-sitter/chunker-ts.d.ts +24 -0
- package/dist/lib/tree-sitter/chunker-ts.d.ts.map +1 -0
- package/dist/lib/tree-sitter/chunker-ts.js +206 -0
- package/dist/lib/tree-sitter/chunker-ts.js.map +1 -0
- package/dist/lib/tree-sitter/extractor.d.ts +43 -0
- package/dist/lib/tree-sitter/extractor.d.ts.map +1 -0
- package/dist/lib/tree-sitter/extractor.js +297 -0
- package/dist/lib/tree-sitter/extractor.js.map +1 -0
- package/dist/lib/tree-sitter/index.d.ts +13 -0
- package/dist/lib/tree-sitter/index.d.ts.map +1 -0
- package/dist/lib/tree-sitter/index.js +14 -0
- package/dist/lib/tree-sitter/index.js.map +1 -0
- package/dist/lib/tree-sitter/parser.d.ts +70 -0
- package/dist/lib/tree-sitter/parser.d.ts.map +1 -0
- package/dist/lib/tree-sitter/parser.js +354 -0
- package/dist/lib/tree-sitter/parser.js.map +1 -0
- package/dist/lib/tree-sitter/public.d.ts +28 -0
- package/dist/lib/tree-sitter/public.d.ts.map +1 -0
- package/dist/lib/tree-sitter/public.js +50 -0
- package/dist/lib/tree-sitter/public.js.map +1 -0
- package/dist/lib/tree-sitter/queries.d.ts +28 -0
- package/dist/lib/tree-sitter/queries.d.ts.map +1 -0
- package/dist/lib/tree-sitter/queries.js +383 -0
- package/dist/lib/tree-sitter/queries.js.map +1 -0
- package/dist/lib/tree-sitter/types.d.ts +69 -0
- package/dist/lib/tree-sitter/types.d.ts.map +1 -0
- package/dist/lib/tree-sitter/types.js +131 -0
- package/dist/lib/tree-sitter/types.js.map +1 -0
- package/dist/lib/working-memory-pipeline.d.ts +118 -0
- package/dist/lib/working-memory-pipeline.d.ts.map +1 -0
- package/dist/lib/working-memory-pipeline.js +344 -0
- package/dist/lib/working-memory-pipeline.js.map +1 -0
- package/dist/mcp/helpers.d.ts +44 -0
- package/dist/mcp/helpers.d.ts.map +1 -0
- package/dist/mcp/helpers.js +244 -0
- package/dist/mcp/helpers.js.map +1 -0
- package/dist/mcp/index.d.ts +10 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +15 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/resources.d.ts +12 -0
- package/dist/mcp/resources.d.ts.map +1 -0
- package/dist/mcp/resources.js +136 -0
- package/dist/mcp/resources.js.map +1 -0
- package/dist/mcp/server.d.ts +22 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +131 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools/config.d.ts +10 -0
- package/dist/mcp/tools/config.d.ts.map +1 -0
- package/dist/mcp/tools/config.js +236 -0
- package/dist/mcp/tools/config.js.map +1 -0
- package/dist/mcp/tools/dead-end.d.ts +9 -0
- package/dist/mcp/tools/dead-end.d.ts.map +1 -0
- package/dist/mcp/tools/dead-end.js +137 -0
- package/dist/mcp/tools/dead-end.js.map +1 -0
- package/dist/mcp/tools/debug.d.ts +9 -0
- package/dist/mcp/tools/debug.d.ts.map +1 -0
- package/dist/mcp/tools/debug.js +387 -0
- package/dist/mcp/tools/debug.js.map +1 -0
- package/dist/mcp/tools/graph.d.ts +9 -0
- package/dist/mcp/tools/graph.d.ts.map +1 -0
- package/dist/mcp/tools/graph.js +337 -0
- package/dist/mcp/tools/graph.js.map +1 -0
- package/dist/mcp/tools/indexing.d.ts +12 -0
- package/dist/mcp/tools/indexing.d.ts.map +1 -0
- package/dist/mcp/tools/indexing.js +289 -0
- package/dist/mcp/tools/indexing.js.map +1 -0
- package/dist/mcp/tools/memory.d.ts +14 -0
- package/dist/mcp/tools/memory.d.ts.map +1 -0
- package/dist/mcp/tools/memory.js +1170 -0
- package/dist/mcp/tools/memory.js.map +1 -0
- package/dist/mcp/tools/prd.d.ts +12 -0
- package/dist/mcp/tools/prd.d.ts.map +1 -0
- package/dist/mcp/tools/prd.js +276 -0
- package/dist/mcp/tools/prd.js.map +1 -0
- package/dist/mcp/tools/search.d.ts +9 -0
- package/dist/mcp/tools/search.d.ts.map +1 -0
- package/dist/mcp/tools/search.js +279 -0
- package/dist/mcp/tools/search.js.map +1 -0
- package/dist/mcp/tools/status.d.ts +10 -0
- package/dist/mcp/tools/status.d.ts.map +1 -0
- package/dist/mcp/tools/status.js +296 -0
- package/dist/mcp/tools/status.js.map +1 -0
- package/dist/mcp/tools/web-fetch.d.ts +10 -0
- package/dist/mcp/tools/web-fetch.d.ts.map +1 -0
- package/dist/mcp/tools/web-fetch.js +107 -0
- package/dist/mcp/tools/web-fetch.js.map +1 -0
- package/dist/mcp/tools/web-search.d.ts +14 -0
- package/dist/mcp/tools/web-search.d.ts.map +1 -0
- package/dist/mcp/tools/web-search.js +427 -0
- package/dist/mcp/tools/web-search.js.map +1 -0
- package/dist/mcp/types.d.ts +16 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +5 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/mcp-server.d.ts +9 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +9 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/prompts/analyze.d.ts +21 -0
- package/dist/prompts/analyze.d.ts.map +1 -0
- package/dist/prompts/analyze.js +27 -0
- package/dist/prompts/analyze.js.map +1 -0
- package/dist/prompts/briefing.d.ts +27 -0
- package/dist/prompts/briefing.d.ts.map +1 -0
- package/dist/prompts/briefing.js +123 -0
- package/dist/prompts/briefing.js.map +1 -0
- package/dist/prompts/chat.d.ts +8 -0
- package/dist/prompts/chat.d.ts.map +1 -0
- package/dist/prompts/chat.js +39 -0
- package/dist/prompts/chat.js.map +1 -0
- package/dist/prompts/daemon.d.ts +16 -0
- package/dist/prompts/daemon.d.ts.map +1 -0
- package/dist/prompts/daemon.js +46 -0
- package/dist/prompts/daemon.js.map +1 -0
- package/dist/prompts/extraction.d.ts +13 -0
- package/dist/prompts/extraction.d.ts.map +1 -0
- package/dist/prompts/extraction.js +93 -0
- package/dist/prompts/extraction.js.map +1 -0
- package/dist/prompts/index.d.ts +17 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +27 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/memory.d.ts +11 -0
- package/dist/prompts/memory.d.ts.map +1 -0
- package/dist/prompts/memory.js +23 -0
- package/dist/prompts/memory.js.map +1 -0
- package/dist/prompts/onboarding.d.ts +16 -0
- package/dist/prompts/onboarding.d.ts.map +1 -0
- package/dist/prompts/onboarding.js +183 -0
- package/dist/prompts/onboarding.js.map +1 -0
- package/dist/prompts/prd.d.ts +12 -0
- package/dist/prompts/prd.d.ts.map +1 -0
- package/dist/prompts/prd.js +211 -0
- package/dist/prompts/prd.js.map +1 -0
- package/dist/prompts/quality.d.ts +11 -0
- package/dist/prompts/quality.d.ts.map +1 -0
- package/dist/prompts/quality.js +11 -0
- package/dist/prompts/quality.js.map +1 -0
- package/dist/prompts/skills.d.ts +16 -0
- package/dist/prompts/skills.d.ts.map +1 -0
- package/dist/prompts/skills.js +30 -0
- package/dist/prompts/skills.js.map +1 -0
- package/hooks/succ-post-tool.cjs +227 -0
- package/hooks/succ-pre-tool.cjs +312 -0
- package/hooks/succ-session-end.cjs +85 -0
- package/hooks/succ-session-start.cjs +618 -0
- package/hooks/succ-stop-reflection.cjs +87 -0
- package/hooks/succ-user-prompt.cjs +220 -0
- package/package.json +128 -0
|
@@ -0,0 +1,637 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { getClaudeDir, getConfig, getProjectRoot } from './config.js';
|
|
4
|
+
import { getMemoryLinks, getGraphStats, getAllMemoriesForExport, getAllMemoryLinksForExport, getMemoryById, } from './storage/index.js';
|
|
5
|
+
import { calculateTemporalScore, getTemporalConfig } from './temporal.js';
|
|
6
|
+
import { logWarn } from './fault-logger.js';
|
|
7
|
+
/**
|
|
8
|
+
* Map memory type to brain vault folder
|
|
9
|
+
*/
|
|
10
|
+
function getTargetFolder(type, tags, brainDir) {
|
|
11
|
+
// Superseded/archived memories always go to archive (overrides type-based routing)
|
|
12
|
+
if (tags.includes('superseded') || tags.includes('archived')) {
|
|
13
|
+
return path.join(brainDir, 'archive');
|
|
14
|
+
}
|
|
15
|
+
// Decision memories go to project decisions folder
|
|
16
|
+
if (type === 'decision' || tags.includes('decision')) {
|
|
17
|
+
return path.join(brainDir, 'project', 'decisions');
|
|
18
|
+
}
|
|
19
|
+
// Learning and pattern memories go to knowledge
|
|
20
|
+
if (type === 'learning' ||
|
|
21
|
+
type === 'pattern' ||
|
|
22
|
+
tags.includes('learning') ||
|
|
23
|
+
tags.includes('pattern')) {
|
|
24
|
+
return path.join(brainDir, 'knowledge');
|
|
25
|
+
}
|
|
26
|
+
// Error memories go to inbox for quick review
|
|
27
|
+
if (type === 'error' || tags.includes('error') || tags.includes('bug')) {
|
|
28
|
+
return path.join(brainDir, 'inbox');
|
|
29
|
+
}
|
|
30
|
+
// Observations and everything else go to inbox
|
|
31
|
+
return path.join(brainDir, 'inbox');
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get relative path for wiki-link based on target type
|
|
35
|
+
*/
|
|
36
|
+
function getWikiLinkPath(targetType, targetTags, targetId, dateStr) {
|
|
37
|
+
const typePascal = targetType.charAt(0).toUpperCase() + targetType.slice(1);
|
|
38
|
+
// Superseded/archived memories link to archive
|
|
39
|
+
if (targetTags.includes('superseded') || targetTags.includes('archived')) {
|
|
40
|
+
return `archive/${dateStr} ${typePascal} (${targetId})`;
|
|
41
|
+
}
|
|
42
|
+
if (targetType === 'decision' || targetTags.includes('decision')) {
|
|
43
|
+
return `project/decisions/${dateStr} ${typePascal} (${targetId})`;
|
|
44
|
+
}
|
|
45
|
+
if (targetType === 'learning' ||
|
|
46
|
+
targetType === 'pattern' ||
|
|
47
|
+
targetTags.includes('learning') ||
|
|
48
|
+
targetTags.includes('pattern')) {
|
|
49
|
+
return `knowledge/${dateStr} ${typePascal} (${targetId})`;
|
|
50
|
+
}
|
|
51
|
+
return `inbox/${dateStr} ${typePascal} (${targetId})`;
|
|
52
|
+
}
|
|
53
|
+
// Debounce state for auto-export
|
|
54
|
+
let exportTimer = null;
|
|
55
|
+
let lastExportTime = 0;
|
|
56
|
+
const EXPORT_DEBOUNCE_MS = 5000; // Wait 5 seconds after last change before exporting
|
|
57
|
+
/**
|
|
58
|
+
* Schedule an auto-export if enabled in config
|
|
59
|
+
* Debounced to avoid excessive exports during bulk operations
|
|
60
|
+
*/
|
|
61
|
+
export function scheduleAutoExport() {
|
|
62
|
+
const config = getConfig();
|
|
63
|
+
if (!config.graph_auto_export) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
// Clear existing timer
|
|
67
|
+
if (exportTimer) {
|
|
68
|
+
clearTimeout(exportTimer);
|
|
69
|
+
}
|
|
70
|
+
// Schedule export after debounce period
|
|
71
|
+
exportTimer = setTimeout(async () => {
|
|
72
|
+
exportTimer = null;
|
|
73
|
+
const now = Date.now();
|
|
74
|
+
// Additional check: don't export more than once per 5 seconds
|
|
75
|
+
if (now - lastExportTime < EXPORT_DEBOUNCE_MS) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
lastExportTime = now;
|
|
79
|
+
try {
|
|
80
|
+
await exportGraphSilent(config.graph_export_format || 'obsidian', config.graph_export_path);
|
|
81
|
+
}
|
|
82
|
+
catch (err) {
|
|
83
|
+
logWarn('graph-export', 'Auto-export failed', {
|
|
84
|
+
error: err instanceof Error ? err.message : String(err),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
// Also auto-generate AGENTS.md if enabled
|
|
88
|
+
const agentsMdConfig = config.agents_md;
|
|
89
|
+
if (agentsMdConfig?.enabled) {
|
|
90
|
+
import('./agents-md-generator.js')
|
|
91
|
+
.then((mod) => mod.writeAgentsMd())
|
|
92
|
+
.catch(() => {
|
|
93
|
+
/* Silently ignore AGENTS.md errors */
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}, EXPORT_DEBOUNCE_MS);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Export graph silently (no console output) - for auto-export
|
|
100
|
+
*/
|
|
101
|
+
export async function exportGraphSilent(format = 'obsidian', outputDir) {
|
|
102
|
+
// Get all memories via dispatcher (works for both SQLite and PG)
|
|
103
|
+
const rawMemories = await getAllMemoriesForExport();
|
|
104
|
+
const memories = rawMemories
|
|
105
|
+
.filter((m) => m.invalidated_by === null) // Only active memories
|
|
106
|
+
.map((m) => ({
|
|
107
|
+
id: m.id,
|
|
108
|
+
content: m.content,
|
|
109
|
+
tags: m.tags,
|
|
110
|
+
source: m.source,
|
|
111
|
+
type: m.type,
|
|
112
|
+
created_at: m.created_at,
|
|
113
|
+
access_count: m.access_count ?? 0,
|
|
114
|
+
last_accessed: m.last_accessed,
|
|
115
|
+
valid_from: m.valid_from ?? null,
|
|
116
|
+
valid_until: m.valid_until ?? null,
|
|
117
|
+
}));
|
|
118
|
+
if (memories.length === 0) {
|
|
119
|
+
return { memoriesExported: 0, linksExported: 0 };
|
|
120
|
+
}
|
|
121
|
+
// Determine output directory - export directly to brain folder
|
|
122
|
+
const claudeDir = getClaudeDir();
|
|
123
|
+
const graphDir = outputDir || path.join(claudeDir, 'brain');
|
|
124
|
+
// Create directory if needed
|
|
125
|
+
if (!fs.existsSync(graphDir)) {
|
|
126
|
+
fs.mkdirSync(graphDir, { recursive: true });
|
|
127
|
+
}
|
|
128
|
+
if (format === 'json') {
|
|
129
|
+
return await exportToJson(memories, graphDir);
|
|
130
|
+
}
|
|
131
|
+
return await exportToObsidian(memories, graphDir);
|
|
132
|
+
}
|
|
133
|
+
async function exportToJson(memories, graphDir) {
|
|
134
|
+
const temporalConfig = getTemporalConfig();
|
|
135
|
+
const now = new Date();
|
|
136
|
+
const graphData = {
|
|
137
|
+
memories: memories.map((m) => {
|
|
138
|
+
const temporalResult = calculateTemporalScore(1.0, {
|
|
139
|
+
created_at: m.created_at,
|
|
140
|
+
last_accessed: m.last_accessed || null,
|
|
141
|
+
access_count: m.access_count || 0,
|
|
142
|
+
valid_from: m.valid_from || null,
|
|
143
|
+
valid_until: m.valid_until || null,
|
|
144
|
+
}, temporalConfig);
|
|
145
|
+
const temporalScore = temporalResult.temporalScore;
|
|
146
|
+
// Determine temporal status
|
|
147
|
+
let temporalStatus = 'active';
|
|
148
|
+
if (m.valid_until && new Date(m.valid_until) < now) {
|
|
149
|
+
temporalStatus = 'expired';
|
|
150
|
+
}
|
|
151
|
+
else if (m.valid_from && new Date(m.valid_from) > now) {
|
|
152
|
+
temporalStatus = 'future';
|
|
153
|
+
}
|
|
154
|
+
else if (temporalScore < 0.3) {
|
|
155
|
+
temporalStatus = 'fading';
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
id: m.id,
|
|
159
|
+
content: m.content,
|
|
160
|
+
tags: m.tags,
|
|
161
|
+
source: m.source,
|
|
162
|
+
type: m.type || 'observation',
|
|
163
|
+
created_at: m.created_at,
|
|
164
|
+
// Temporal fields
|
|
165
|
+
valid_from: m.valid_from,
|
|
166
|
+
valid_until: m.valid_until,
|
|
167
|
+
last_accessed: m.last_accessed,
|
|
168
|
+
access_count: m.access_count || 0,
|
|
169
|
+
temporal_status: temporalStatus,
|
|
170
|
+
decay_score: parseFloat(temporalScore.toFixed(2)),
|
|
171
|
+
};
|
|
172
|
+
}),
|
|
173
|
+
links: [],
|
|
174
|
+
stats: await getGraphStats(),
|
|
175
|
+
temporal_summary: {
|
|
176
|
+
active: 0,
|
|
177
|
+
expired: 0,
|
|
178
|
+
future: 0,
|
|
179
|
+
fading: 0,
|
|
180
|
+
},
|
|
181
|
+
exported_at: new Date().toISOString(),
|
|
182
|
+
};
|
|
183
|
+
// Count temporal statuses
|
|
184
|
+
for (const m of graphData.memories) {
|
|
185
|
+
graphData.temporal_summary[m.temporal_status]++;
|
|
186
|
+
}
|
|
187
|
+
// Get all links via dispatcher
|
|
188
|
+
const allLinks = await getAllMemoryLinksForExport();
|
|
189
|
+
graphData.links = allLinks.map((l) => ({
|
|
190
|
+
source: l.source_id,
|
|
191
|
+
target: l.target_id,
|
|
192
|
+
relation: l.relation,
|
|
193
|
+
weight: l.weight,
|
|
194
|
+
}));
|
|
195
|
+
const jsonPath = path.join(graphDir, 'memories-graph.json');
|
|
196
|
+
fs.writeFileSync(jsonPath, JSON.stringify(graphData, null, 2));
|
|
197
|
+
return { memoriesExported: memories.length, linksExported: allLinks.length };
|
|
198
|
+
}
|
|
199
|
+
async function exportToObsidian(memories, brainDir) {
|
|
200
|
+
let exported = 0;
|
|
201
|
+
let totalLinks = 0;
|
|
202
|
+
// Get temporal config for decay calculation
|
|
203
|
+
const temporalConfig = getTemporalConfig();
|
|
204
|
+
const now = new Date();
|
|
205
|
+
// Build maps for link resolution
|
|
206
|
+
const memoryTagsMap = new Map();
|
|
207
|
+
const memoryDatesMap = new Map();
|
|
208
|
+
const memoryTypesMap = new Map();
|
|
209
|
+
for (const m of memories) {
|
|
210
|
+
memoryTagsMap.set(m.id, m.tags);
|
|
211
|
+
memoryDatesMap.set(m.id, new Date(m.created_at).toISOString().split('T')[0]);
|
|
212
|
+
memoryTypesMap.set(m.id, m.type || 'observation');
|
|
213
|
+
}
|
|
214
|
+
// Clean up stale files when memories move between folders (e.g. superseded → archive)
|
|
215
|
+
const expectedFolderMap = new Map();
|
|
216
|
+
for (const m of memories) {
|
|
217
|
+
const type = m.type || 'observation';
|
|
218
|
+
expectedFolderMap.set(m.id, getTargetFolder(type, m.tags, brainDir));
|
|
219
|
+
}
|
|
220
|
+
const memoryDirs = ['inbox', 'project/decisions', 'knowledge', 'archive'];
|
|
221
|
+
const idPattern = /\((\d+)\)\.md$/;
|
|
222
|
+
for (const dir of memoryDirs) {
|
|
223
|
+
const fullDir = path.join(brainDir, dir);
|
|
224
|
+
if (!fs.existsSync(fullDir))
|
|
225
|
+
continue;
|
|
226
|
+
try {
|
|
227
|
+
const files = fs.readdirSync(fullDir);
|
|
228
|
+
for (const file of files) {
|
|
229
|
+
const match = file.match(idPattern);
|
|
230
|
+
if (!match)
|
|
231
|
+
continue;
|
|
232
|
+
const fileId = parseInt(match[1], 10);
|
|
233
|
+
const expectedDir = expectedFolderMap.get(fileId);
|
|
234
|
+
if (expectedDir && expectedDir !== fullDir) {
|
|
235
|
+
fs.unlinkSync(path.join(fullDir, file));
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
catch (err) {
|
|
240
|
+
logWarn('graph-export', `Failed to scan ${dir} for stale files: ${err instanceof Error ? err.message : err}`);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
for (const memory of memories) {
|
|
244
|
+
const tags = memory.tags;
|
|
245
|
+
const links = await getMemoryLinks(memory.id);
|
|
246
|
+
totalLinks += links.outgoing.length;
|
|
247
|
+
// Determine target folder based on type/tags
|
|
248
|
+
const type = memory.type || 'observation';
|
|
249
|
+
const targetDir = getTargetFolder(type, tags, brainDir);
|
|
250
|
+
// Create directory if needed
|
|
251
|
+
if (!fs.existsSync(targetDir)) {
|
|
252
|
+
fs.mkdirSync(targetDir, { recursive: true });
|
|
253
|
+
}
|
|
254
|
+
// Generate filename with date prefix for better sorting
|
|
255
|
+
// Format: "2026-02-02 Observation (15).md" (PascalCase type, ID in parens)
|
|
256
|
+
const date = new Date(memory.created_at);
|
|
257
|
+
const dateStr = date.toISOString().split('T')[0];
|
|
258
|
+
const typePascal = type.charAt(0).toUpperCase() + type.slice(1);
|
|
259
|
+
const safeId = `${dateStr} ${typePascal} (${memory.id})`;
|
|
260
|
+
const filename = `${safeId}.md`;
|
|
261
|
+
// Generate title from content (first line or truncated)
|
|
262
|
+
const firstLine = memory.content.split('\n')[0].trim();
|
|
263
|
+
const title = firstLine.length > 60 ? firstLine.substring(0, 57) + '...' : firstLine;
|
|
264
|
+
// Calculate temporal state and decay score
|
|
265
|
+
const temporalResult = calculateTemporalScore(1.0, {
|
|
266
|
+
created_at: memory.created_at,
|
|
267
|
+
last_accessed: memory.last_accessed || null,
|
|
268
|
+
access_count: memory.access_count || 0,
|
|
269
|
+
valid_from: memory.valid_from || null,
|
|
270
|
+
valid_until: memory.valid_until || null,
|
|
271
|
+
}, temporalConfig);
|
|
272
|
+
const temporalScore = temporalResult.temporalScore;
|
|
273
|
+
// Determine temporal status
|
|
274
|
+
let temporalStatus = 'active';
|
|
275
|
+
let statusEmoji = '🟢';
|
|
276
|
+
if (memory.valid_until && new Date(memory.valid_until) < now) {
|
|
277
|
+
temporalStatus = 'expired';
|
|
278
|
+
statusEmoji = 'âš«';
|
|
279
|
+
}
|
|
280
|
+
else if (memory.valid_from && new Date(memory.valid_from) > now) {
|
|
281
|
+
temporalStatus = 'future';
|
|
282
|
+
statusEmoji = '🔵';
|
|
283
|
+
}
|
|
284
|
+
else if (temporalScore < 0.3) {
|
|
285
|
+
temporalStatus = 'fading';
|
|
286
|
+
statusEmoji = '🟡';
|
|
287
|
+
}
|
|
288
|
+
// Build frontmatter with temporal metadata
|
|
289
|
+
const frontmatterLines = [
|
|
290
|
+
'---',
|
|
291
|
+
`id: ${memory.id}`,
|
|
292
|
+
`type: ${type}`,
|
|
293
|
+
`tags: [${tags.map((t) => `"${t}"`).join(', ')}]`,
|
|
294
|
+
`source: ${memory.source || 'unknown'}`,
|
|
295
|
+
`created: ${memory.created_at}`,
|
|
296
|
+
];
|
|
297
|
+
// Add temporal fields if present
|
|
298
|
+
if (memory.valid_from) {
|
|
299
|
+
frontmatterLines.push(`valid_from: ${memory.valid_from}`);
|
|
300
|
+
}
|
|
301
|
+
if (memory.valid_until) {
|
|
302
|
+
frontmatterLines.push(`valid_until: ${memory.valid_until}`);
|
|
303
|
+
}
|
|
304
|
+
// Add computed temporal metadata
|
|
305
|
+
frontmatterLines.push(`temporal_status: ${temporalStatus}`);
|
|
306
|
+
frontmatterLines.push(`decay_score: ${temporalScore.toFixed(2)}`);
|
|
307
|
+
if (memory.access_count && memory.access_count > 0) {
|
|
308
|
+
frontmatterLines.push(`access_count: ${memory.access_count}`);
|
|
309
|
+
}
|
|
310
|
+
if (memory.last_accessed) {
|
|
311
|
+
frontmatterLines.push(`last_accessed: ${memory.last_accessed}`);
|
|
312
|
+
}
|
|
313
|
+
// Add community assignment from tags (community:N)
|
|
314
|
+
const communityTag = tags.find((t) => t.startsWith('community:'));
|
|
315
|
+
if (communityTag) {
|
|
316
|
+
frontmatterLines.push(`community: ${communityTag.split(':')[1]}`);
|
|
317
|
+
}
|
|
318
|
+
frontmatterLines.push('---');
|
|
319
|
+
// Build content with status indicator in title
|
|
320
|
+
let content = `${frontmatterLines.join('\n')}
|
|
321
|
+
|
|
322
|
+
# ${statusEmoji} ${title}
|
|
323
|
+
|
|
324
|
+
${memory.content}
|
|
325
|
+
|
|
326
|
+
`;
|
|
327
|
+
// Add outgoing links as Obsidian wiki-links
|
|
328
|
+
if (links.outgoing.length > 0) {
|
|
329
|
+
content += `## Related\n\n`;
|
|
330
|
+
for (const link of links.outgoing) {
|
|
331
|
+
const targetType = memoryTypesMap.get(link.target_id) || (await getMemoryTypeAsync(link.target_id));
|
|
332
|
+
const targetTags = memoryTagsMap.get(link.target_id) || [];
|
|
333
|
+
const targetDate = memoryDatesMap.get(link.target_id) || dateStr;
|
|
334
|
+
const wikiPath = getWikiLinkPath(targetType, targetTags, link.target_id, targetDate);
|
|
335
|
+
content += `- [[${wikiPath}]] (${link.relation})\n`;
|
|
336
|
+
}
|
|
337
|
+
content += '\n';
|
|
338
|
+
}
|
|
339
|
+
// Add incoming links
|
|
340
|
+
if (links.incoming.length > 0) {
|
|
341
|
+
content += `## Referenced By\n\n`;
|
|
342
|
+
for (const link of links.incoming) {
|
|
343
|
+
const sourceType = memoryTypesMap.get(link.source_id) || (await getMemoryTypeAsync(link.source_id));
|
|
344
|
+
const sourceTags = memoryTagsMap.get(link.source_id) || [];
|
|
345
|
+
const sourceDate = memoryDatesMap.get(link.source_id) || dateStr;
|
|
346
|
+
const wikiPath = getWikiLinkPath(sourceType, sourceTags, link.source_id, sourceDate);
|
|
347
|
+
content += `- [[${wikiPath}]] (${link.relation})\n`;
|
|
348
|
+
}
|
|
349
|
+
content += '\n';
|
|
350
|
+
}
|
|
351
|
+
// Write file
|
|
352
|
+
const filePath = path.join(targetDir, filename);
|
|
353
|
+
fs.writeFileSync(filePath, content);
|
|
354
|
+
exported++;
|
|
355
|
+
}
|
|
356
|
+
// Create index file in brain root (Memories.md - no kebab-case)
|
|
357
|
+
const indexContent = await generateIndexContent(memories, brainDir);
|
|
358
|
+
fs.writeFileSync(path.join(brainDir, 'Memories.md'), indexContent);
|
|
359
|
+
// Collect community IDs for graph coloring
|
|
360
|
+
const communityIds = new Set();
|
|
361
|
+
for (const m of memories) {
|
|
362
|
+
const ct = m.tags.find((t) => t.startsWith('community:'));
|
|
363
|
+
if (ct)
|
|
364
|
+
communityIds.add(parseInt(ct.split(':')[1], 10));
|
|
365
|
+
}
|
|
366
|
+
// Create/update Obsidian config for graph colors
|
|
367
|
+
ensureObsidianGraphConfig(brainDir, Array.from(communityIds).sort((a, b) => a - b));
|
|
368
|
+
return { memoriesExported: exported, linksExported: totalLinks };
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Generate an HLS-based palette color as RGB integer for Obsidian graph config.
|
|
372
|
+
* Spreads hues evenly across the color wheel.
|
|
373
|
+
*/
|
|
374
|
+
function communityColor(index, total) {
|
|
375
|
+
const hue = (index / Math.max(total, 1)) * 360;
|
|
376
|
+
const s = 0.65;
|
|
377
|
+
const l = 0.55;
|
|
378
|
+
// HSL → RGB
|
|
379
|
+
const c = (1 - Math.abs(2 * l - 1)) * s;
|
|
380
|
+
const x = c * (1 - Math.abs(((hue / 60) % 2) - 1));
|
|
381
|
+
const m = l - c / 2;
|
|
382
|
+
let r = 0, g = 0, b = 0;
|
|
383
|
+
if (hue < 60) {
|
|
384
|
+
r = c;
|
|
385
|
+
g = x;
|
|
386
|
+
}
|
|
387
|
+
else if (hue < 120) {
|
|
388
|
+
r = x;
|
|
389
|
+
g = c;
|
|
390
|
+
}
|
|
391
|
+
else if (hue < 180) {
|
|
392
|
+
g = c;
|
|
393
|
+
b = x;
|
|
394
|
+
}
|
|
395
|
+
else if (hue < 240) {
|
|
396
|
+
g = x;
|
|
397
|
+
b = c;
|
|
398
|
+
}
|
|
399
|
+
else if (hue < 300) {
|
|
400
|
+
r = x;
|
|
401
|
+
b = c;
|
|
402
|
+
}
|
|
403
|
+
else {
|
|
404
|
+
r = c;
|
|
405
|
+
b = x;
|
|
406
|
+
}
|
|
407
|
+
const ri = Math.round((r + m) * 255);
|
|
408
|
+
const gi = Math.round((g + m) * 255);
|
|
409
|
+
const bi = Math.round((b + m) * 255);
|
|
410
|
+
return (ri << 16) | (gi << 8) | bi;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Ensure Obsidian graph config exists with color groups for folders, tags, and communities
|
|
414
|
+
*/
|
|
415
|
+
function ensureObsidianGraphConfig(brainDir, communityIds = []) {
|
|
416
|
+
const obsidianDir = path.join(brainDir, '.obsidian');
|
|
417
|
+
const snippetsDir = path.join(obsidianDir, 'snippets');
|
|
418
|
+
// Create directories if needed
|
|
419
|
+
if (!fs.existsSync(obsidianDir)) {
|
|
420
|
+
fs.mkdirSync(obsidianDir, { recursive: true });
|
|
421
|
+
}
|
|
422
|
+
if (!fs.existsSync(snippetsDir)) {
|
|
423
|
+
fs.mkdirSync(snippetsDir, { recursive: true });
|
|
424
|
+
}
|
|
425
|
+
// Graph config with color groups
|
|
426
|
+
const graphConfig = {
|
|
427
|
+
'collapse-filter': false,
|
|
428
|
+
search: '',
|
|
429
|
+
showTags: true,
|
|
430
|
+
showAttachments: false,
|
|
431
|
+
hideUnresolved: false,
|
|
432
|
+
showOrphans: true,
|
|
433
|
+
'collapse-color-groups': false,
|
|
434
|
+
colorGroups: [
|
|
435
|
+
// Folders
|
|
436
|
+
{ query: 'path:decisions', color: { a: 1, rgb: 16744448 } }, // Orange
|
|
437
|
+
{ query: 'path:strategy', color: { a: 1, rgb: 10494192 } }, // Purple
|
|
438
|
+
{ query: 'path:knowledge', color: { a: 1, rgb: 65382 } }, // Green
|
|
439
|
+
{ query: 'path:systems', color: { a: 1, rgb: 3447003 } }, // Cyan
|
|
440
|
+
{ query: 'path:features', color: { a: 1, rgb: 16761035 } }, // Pink
|
|
441
|
+
{ query: 'path:technical', color: { a: 1, rgb: 10066329 } }, // Silver
|
|
442
|
+
{ query: 'path:files', color: { a: 1, rgb: 6591981 } }, // Teal
|
|
443
|
+
{ query: 'path:reflections', color: { a: 1, rgb: 9109504 } }, // Dark red
|
|
444
|
+
{ query: 'path:inbox', color: { a: 1, rgb: 8421504 } }, // Gray
|
|
445
|
+
// Tags (higher priority - listed after folders)
|
|
446
|
+
{ query: 'tag:#decision', color: { a: 1, rgb: 16744448 } }, // Orange
|
|
447
|
+
{ query: 'tag:#learning', color: { a: 1, rgb: 65382 } }, // Green
|
|
448
|
+
{ query: 'tag:#pattern', color: { a: 1, rgb: 10494192 } }, // Purple
|
|
449
|
+
{ query: 'tag:#error', color: { a: 1, rgb: 16711680 } }, // Red
|
|
450
|
+
{ query: 'tag:#architecture', color: { a: 1, rgb: 3447003 } }, // Cyan
|
|
451
|
+
{ query: 'tag:#sprint', color: { a: 1, rgb: 65535 } }, // Aqua
|
|
452
|
+
// Community color groups (auto-generated from detected communities)
|
|
453
|
+
...communityIds.map((id) => ({
|
|
454
|
+
query: `tag:#community/${id}`,
|
|
455
|
+
color: { a: 1, rgb: communityColor(id, communityIds.length) },
|
|
456
|
+
})),
|
|
457
|
+
],
|
|
458
|
+
'collapse-display': false,
|
|
459
|
+
showArrow: true,
|
|
460
|
+
textFadeMultiplier: 0,
|
|
461
|
+
nodeSizeMultiplier: 1.2,
|
|
462
|
+
lineSizeMultiplier: 1,
|
|
463
|
+
'collapse-forces': false,
|
|
464
|
+
centerStrength: 0.5,
|
|
465
|
+
repelStrength: 12,
|
|
466
|
+
linkStrength: 1,
|
|
467
|
+
linkDistance: 180,
|
|
468
|
+
scale: 0.6,
|
|
469
|
+
close: false,
|
|
470
|
+
};
|
|
471
|
+
// Write graph config
|
|
472
|
+
fs.writeFileSync(path.join(obsidianDir, 'graph.json'), JSON.stringify(graphConfig, null, 2));
|
|
473
|
+
// CSS snippet for additional styling
|
|
474
|
+
const cssSnippet = `/* succ Brain Vault Graph Styling - Auto-generated */
|
|
475
|
+
|
|
476
|
+
/* Tag colors in editor */
|
|
477
|
+
.tag[href="#decision"] { background-color: rgba(255,149,0,0.2); color: #FF9500; }
|
|
478
|
+
.tag[href="#learning"] { background-color: rgba(0,255,102,0.2); color: #00FF66; }
|
|
479
|
+
.tag[href="#pattern"] { background-color: rgba(160,32,240,0.2); color: #A020F0; }
|
|
480
|
+
.tag[href="#error"] { background-color: rgba(255,0,0,0.2); color: #FF0000; }
|
|
481
|
+
.tag[href="#sprint"] { background-color: rgba(0,255,255,0.2); color: #00FFFF; }
|
|
482
|
+
.tag[href="#architecture"] { background-color: rgba(52,152,219,0.2); color: #3498DB; }
|
|
483
|
+
|
|
484
|
+
/* Temporal status indicators in titles */
|
|
485
|
+
.markdown-preview-view h1 { position: relative; }
|
|
486
|
+
|
|
487
|
+
/* Graph link visibility */
|
|
488
|
+
.graph-view .links line { stroke-opacity: 0.6; stroke-width: 1.5px; }
|
|
489
|
+
.graph-view .nodes circle:hover { stroke: #fff; stroke-width: 2px; }
|
|
490
|
+
|
|
491
|
+
/* Frontmatter styling */
|
|
492
|
+
.metadata-property[data-property-key="temporal_status"] .metadata-property-value { font-weight: bold; }
|
|
493
|
+
.metadata-property[data-property-key="decay_score"] .metadata-property-value { font-family: monospace; }
|
|
494
|
+
.metadata-property[data-property-key="community"] .metadata-property-value { font-weight: bold; color: #A020F0; }
|
|
495
|
+
`;
|
|
496
|
+
fs.writeFileSync(path.join(snippetsDir, 'succ-graph.css'), cssSnippet);
|
|
497
|
+
// Enable the snippet in appearance.json
|
|
498
|
+
const appearanceConfig = {
|
|
499
|
+
cssTheme: '',
|
|
500
|
+
enabledCssSnippets: ['succ-graph'],
|
|
501
|
+
};
|
|
502
|
+
fs.writeFileSync(path.join(obsidianDir, 'appearance.json'), JSON.stringify(appearanceConfig, null, 2));
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Get memory type by ID via dispatcher (async)
|
|
506
|
+
*/
|
|
507
|
+
async function getMemoryTypeAsync(id) {
|
|
508
|
+
const memory = await getMemoryById(id);
|
|
509
|
+
return memory?.type || 'observation';
|
|
510
|
+
}
|
|
511
|
+
async function generateIndexContent(memories, _brainDir) {
|
|
512
|
+
const stats = await getGraphStats();
|
|
513
|
+
const projectName = path.basename(getProjectRoot());
|
|
514
|
+
const temporalConfig = getTemporalConfig();
|
|
515
|
+
const now = new Date();
|
|
516
|
+
// Track temporal statistics
|
|
517
|
+
const temporalStats = {
|
|
518
|
+
active: 0,
|
|
519
|
+
expired: 0,
|
|
520
|
+
future: 0,
|
|
521
|
+
fading: 0,
|
|
522
|
+
};
|
|
523
|
+
// Group by location
|
|
524
|
+
const byLocation = {
|
|
525
|
+
Decisions: [],
|
|
526
|
+
Knowledge: [],
|
|
527
|
+
Inbox: [],
|
|
528
|
+
};
|
|
529
|
+
for (const m of memories) {
|
|
530
|
+
const type = m.type || 'observation';
|
|
531
|
+
const tags = m.tags;
|
|
532
|
+
const dateStr = new Date(m.created_at).toISOString().split('T')[0];
|
|
533
|
+
// Calculate temporal status
|
|
534
|
+
const temporalResult = calculateTemporalScore(1.0, {
|
|
535
|
+
created_at: m.created_at,
|
|
536
|
+
last_accessed: m.last_accessed || null,
|
|
537
|
+
access_count: m.access_count || 0,
|
|
538
|
+
valid_from: m.valid_from || null,
|
|
539
|
+
valid_until: m.valid_until || null,
|
|
540
|
+
}, temporalConfig);
|
|
541
|
+
const temporalScore = temporalResult.temporalScore;
|
|
542
|
+
let status = 'active';
|
|
543
|
+
if (m.valid_until && new Date(m.valid_until) < now) {
|
|
544
|
+
status = 'expired';
|
|
545
|
+
}
|
|
546
|
+
else if (m.valid_from && new Date(m.valid_from) > now) {
|
|
547
|
+
status = 'future';
|
|
548
|
+
}
|
|
549
|
+
else if (temporalScore < 0.3) {
|
|
550
|
+
status = 'fading';
|
|
551
|
+
}
|
|
552
|
+
temporalStats[status]++;
|
|
553
|
+
if (type === 'decision' || tags.includes('decision')) {
|
|
554
|
+
byLocation['Decisions'].push({ id: m.id, type, date: dateStr, status });
|
|
555
|
+
}
|
|
556
|
+
else if (type === 'learning' ||
|
|
557
|
+
type === 'pattern' ||
|
|
558
|
+
tags.includes('learning') ||
|
|
559
|
+
tags.includes('pattern')) {
|
|
560
|
+
byLocation['Knowledge'].push({ id: m.id, type, date: dateStr, status });
|
|
561
|
+
}
|
|
562
|
+
else {
|
|
563
|
+
byLocation['Inbox'].push({ id: m.id, type, date: dateStr, status });
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
let content = `# Memories
|
|
567
|
+
|
|
568
|
+
## Statistics
|
|
569
|
+
|
|
570
|
+
- **Total Memories:** ${stats.total_memories}
|
|
571
|
+
- **Total Links:** ${stats.total_links}
|
|
572
|
+
- **Avg Links/Memory:** ${stats.avg_links_per_memory.toFixed(2)}
|
|
573
|
+
- **Isolated Memories:** ${stats.isolated_memories}
|
|
574
|
+
|
|
575
|
+
## Temporal Status
|
|
576
|
+
|
|
577
|
+
| Status | Count | Description |
|
|
578
|
+
|--------|-------|-------------|
|
|
579
|
+
| 🟢 Active | ${temporalStats.active} | Currently valid memories |
|
|
580
|
+
| 🟡 Fading | ${temporalStats.fading} | Low relevance (decay < 30%) |
|
|
581
|
+
| 🔵 Future | ${temporalStats.future} | Not yet valid (scheduled) |
|
|
582
|
+
| âš« Expired | ${temporalStats.expired} | Past validity period |
|
|
583
|
+
|
|
584
|
+
## By Location
|
|
585
|
+
|
|
586
|
+
`;
|
|
587
|
+
// Helper to format type as PascalCase
|
|
588
|
+
const toPascal = (t) => t.charAt(0).toUpperCase() + t.slice(1);
|
|
589
|
+
// Decisions
|
|
590
|
+
if (byLocation['Decisions'].length > 0) {
|
|
591
|
+
content += `### 📋 Decisions (${byLocation['Decisions'].length})\n\n`;
|
|
592
|
+
content += `Located in: \`project/decisions/\`\n\n`;
|
|
593
|
+
for (const { id, type, date } of byLocation['Decisions'].slice(0, 10)) {
|
|
594
|
+
content += `- [[project/decisions/${date} ${toPascal(type)} (${id})]]\n`;
|
|
595
|
+
}
|
|
596
|
+
if (byLocation['Decisions'].length > 10) {
|
|
597
|
+
content += `- ... and ${byLocation['Decisions'].length - 10} more\n`;
|
|
598
|
+
}
|
|
599
|
+
content += '\n';
|
|
600
|
+
}
|
|
601
|
+
// Knowledge
|
|
602
|
+
if (byLocation['Knowledge'].length > 0) {
|
|
603
|
+
content += `### 📚 Knowledge (${byLocation['Knowledge'].length})\n\n`;
|
|
604
|
+
content += `Located in: \`knowledge/\`\n\n`;
|
|
605
|
+
for (const { id, type, date } of byLocation['Knowledge'].slice(0, 10)) {
|
|
606
|
+
content += `- [[knowledge/${date} ${toPascal(type)} (${id})]]\n`;
|
|
607
|
+
}
|
|
608
|
+
if (byLocation['Knowledge'].length > 10) {
|
|
609
|
+
content += `- ... and ${byLocation['Knowledge'].length - 10} more\n`;
|
|
610
|
+
}
|
|
611
|
+
content += '\n';
|
|
612
|
+
}
|
|
613
|
+
// Inbox
|
|
614
|
+
if (byLocation['Inbox'].length > 0) {
|
|
615
|
+
content += `### 📥 Inbox (${byLocation['Inbox'].length})\n\n`;
|
|
616
|
+
content += `Located in: \`inbox/\`\n\n`;
|
|
617
|
+
for (const { id, type, date } of byLocation['Inbox'].slice(0, 10)) {
|
|
618
|
+
content += `- [[inbox/${date} ${toPascal(type)} (${id})]]\n`;
|
|
619
|
+
}
|
|
620
|
+
if (byLocation['Inbox'].length > 10) {
|
|
621
|
+
content += `- ... and ${byLocation['Inbox'].length - 10} more\n`;
|
|
622
|
+
}
|
|
623
|
+
content += '\n';
|
|
624
|
+
}
|
|
625
|
+
content += `## Links by Relation
|
|
626
|
+
|
|
627
|
+
`;
|
|
628
|
+
for (const [relation, count] of Object.entries(stats.relations)) {
|
|
629
|
+
content += `- **${relation}:** ${count}\n`;
|
|
630
|
+
}
|
|
631
|
+
content += `
|
|
632
|
+
---
|
|
633
|
+
*Generated: ${new Date().toLocaleString()}*
|
|
634
|
+
`;
|
|
635
|
+
return content;
|
|
636
|
+
}
|
|
637
|
+
//# sourceMappingURL=graph-export.js.map
|