@ginkoai/cli 1.0.0 → 1.4.1
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 +19 -0
- package/dist/analysis/project-analyzer.d.ts.map +1 -1
- package/dist/analysis/project-analyzer.js +68 -4
- package/dist/analysis/project-analyzer.js.map +1 -1
- package/dist/commands/architecture/architecture-pipeline-enhanced.d.ts.map +1 -1
- package/dist/commands/architecture/architecture-pipeline-enhanced.js +10 -6
- package/dist/commands/architecture/architecture-pipeline-enhanced.js.map +1 -1
- package/dist/commands/backlog/base.d.ts.map +1 -1
- package/dist/commands/backlog/base.js +3 -0
- package/dist/commands/backlog/base.js.map +1 -1
- package/dist/commands/backlog/create.js +20 -20
- package/dist/commands/backlog/create.js.map +1 -1
- package/dist/commands/backlog/index.d.ts.map +1 -1
- package/dist/commands/backlog/index.js +6 -1
- package/dist/commands/backlog/index.js.map +1 -1
- package/dist/commands/changelog/changelog-reflection.d.ts.map +1 -1
- package/dist/commands/changelog/changelog-reflection.js +7 -3
- package/dist/commands/changelog/changelog-reflection.js.map +1 -1
- package/dist/commands/charter.d.ts +28 -0
- package/dist/commands/charter.d.ts.map +1 -0
- package/dist/commands/charter.js +434 -0
- package/dist/commands/charter.js.map +1 -0
- package/dist/commands/documentation/documentation-pipeline.d.ts.map +1 -1
- package/dist/commands/documentation/documentation-pipeline.js +15 -7
- package/dist/commands/documentation/documentation-pipeline.js.map +1 -1
- package/dist/commands/git/git-pipeline.d.ts.map +1 -1
- package/dist/commands/git/git-pipeline.js +3 -2
- package/dist/commands/git/git-pipeline.js.map +1 -1
- package/dist/commands/graph/api-client.d.ts +212 -0
- package/dist/commands/graph/api-client.d.ts.map +1 -0
- package/dist/commands/graph/api-client.js +143 -0
- package/dist/commands/graph/api-client.js.map +1 -0
- package/dist/commands/graph/config.d.ts +82 -0
- package/dist/commands/graph/config.d.ts.map +1 -0
- package/dist/commands/graph/config.js +113 -0
- package/dist/commands/graph/config.js.map +1 -0
- package/dist/commands/graph/explore.d.ts +19 -0
- package/dist/commands/graph/explore.d.ts.map +1 -0
- package/dist/commands/graph/explore.js +117 -0
- package/dist/commands/graph/explore.js.map +1 -0
- package/dist/commands/graph/index.d.ts +17 -0
- package/dist/commands/graph/index.d.ts.map +1 -0
- package/dist/commands/graph/index.js +104 -0
- package/dist/commands/graph/index.js.map +1 -0
- package/dist/commands/graph/init.d.ts +21 -0
- package/dist/commands/graph/init.d.ts.map +1 -0
- package/dist/commands/graph/init.js +173 -0
- package/dist/commands/graph/init.js.map +1 -0
- package/dist/commands/graph/load.d.ts +21 -0
- package/dist/commands/graph/load.d.ts.map +1 -0
- package/dist/commands/graph/load.js +224 -0
- package/dist/commands/graph/load.js.map +1 -0
- package/dist/commands/graph/query.d.ts +23 -0
- package/dist/commands/graph/query.d.ts.map +1 -0
- package/dist/commands/graph/query.js +145 -0
- package/dist/commands/graph/query.js.map +1 -0
- package/dist/commands/graph/status.d.ts +15 -0
- package/dist/commands/graph/status.d.ts.map +1 -0
- package/dist/commands/graph/status.js +88 -0
- package/dist/commands/graph/status.js.map +1 -0
- package/dist/commands/handoff.d.ts +14 -5
- package/dist/commands/handoff.d.ts.map +1 -1
- package/dist/commands/handoff.js +84 -142
- package/dist/commands/handoff.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +88 -41
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/knowledge/create.d.ts +24 -0
- package/dist/commands/knowledge/create.d.ts.map +1 -0
- package/dist/commands/knowledge/create.js +180 -0
- package/dist/commands/knowledge/create.js.map +1 -0
- package/dist/commands/knowledge/graph.d.ts +21 -0
- package/dist/commands/knowledge/graph.d.ts.map +1 -0
- package/dist/commands/knowledge/graph.js +199 -0
- package/dist/commands/knowledge/graph.js.map +1 -0
- package/dist/commands/knowledge/index.d.ts +25 -0
- package/dist/commands/knowledge/index.d.ts.map +1 -0
- package/dist/commands/knowledge/index.js +121 -0
- package/dist/commands/knowledge/index.js.map +1 -0
- package/dist/commands/knowledge/search.d.ts +23 -0
- package/dist/commands/knowledge/search.d.ts.map +1 -0
- package/dist/commands/knowledge/search.js +157 -0
- package/dist/commands/knowledge/search.js.map +1 -0
- package/dist/commands/knowledge/sync.d.ts +28 -0
- package/dist/commands/knowledge/sync.d.ts.map +1 -0
- package/dist/commands/knowledge/sync.js +251 -0
- package/dist/commands/knowledge/sync.js.map +1 -0
- package/dist/commands/log.d.ts +32 -0
- package/dist/commands/log.d.ts.map +1 -0
- package/dist/commands/log.js +632 -0
- package/dist/commands/log.js.map +1 -0
- package/dist/commands/login.d.ts +27 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +177 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +15 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +31 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/project/create.d.ts +22 -0
- package/dist/commands/project/create.d.ts.map +1 -0
- package/dist/commands/project/create.js +69 -0
- package/dist/commands/project/create.js.map +1 -0
- package/dist/commands/project/delete.d.ts +19 -0
- package/dist/commands/project/delete.d.ts.map +1 -0
- package/dist/commands/project/delete.js +73 -0
- package/dist/commands/project/delete.js.map +1 -0
- package/dist/commands/project/index.d.ts +22 -0
- package/dist/commands/project/index.d.ts.map +1 -0
- package/dist/commands/project/index.js +134 -0
- package/dist/commands/project/index.js.map +1 -0
- package/dist/commands/project/info.d.ts +15 -0
- package/dist/commands/project/info.d.ts.map +1 -0
- package/dist/commands/project/info.js +92 -0
- package/dist/commands/project/info.js.map +1 -0
- package/dist/commands/project/list.d.ts +20 -0
- package/dist/commands/project/list.d.ts.map +1 -0
- package/dist/commands/project/list.js +82 -0
- package/dist/commands/project/list.js.map +1 -0
- package/dist/commands/project/members.d.ts +27 -0
- package/dist/commands/project/members.d.ts.map +1 -0
- package/dist/commands/project/members.js +140 -0
- package/dist/commands/project/members.js.map +1 -0
- package/dist/commands/project/update.d.ts +24 -0
- package/dist/commands/project/update.d.ts.map +1 -0
- package/dist/commands/project/update.js +83 -0
- package/dist/commands/project/update.js.map +1 -0
- package/dist/commands/reflect.js +0 -3
- package/dist/commands/reflect.js.map +1 -1
- package/dist/commands/ship.d.ts +3 -1
- package/dist/commands/ship.d.ts.map +1 -1
- package/dist/commands/ship.js +100 -9
- package/dist/commands/ship.js.map +1 -1
- package/dist/commands/start/index.d.ts.map +1 -1
- package/dist/commands/start/index.js +5 -3
- package/dist/commands/start/index.js.map +1 -1
- package/dist/commands/start/start-reflection.d.ts +2 -1
- package/dist/commands/start/start-reflection.d.ts.map +1 -1
- package/dist/commands/start/start-reflection.js +265 -43
- package/dist/commands/start/start-reflection.js.map +1 -1
- package/dist/commands/status.d.ts +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +41 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/team/create.d.ts +15 -0
- package/dist/commands/team/create.d.ts.map +1 -0
- package/dist/commands/team/create.js +48 -0
- package/dist/commands/team/create.js.map +1 -0
- package/dist/commands/team/index.d.ts +22 -0
- package/dist/commands/team/index.d.ts.map +1 -0
- package/dist/commands/team/index.js +109 -0
- package/dist/commands/team/index.js.map +1 -0
- package/dist/commands/team/list.d.ts +15 -0
- package/dist/commands/team/list.d.ts.map +1 -0
- package/dist/commands/team/list.js +67 -0
- package/dist/commands/team/list.js.map +1 -0
- package/dist/commands/team/members.d.ts +27 -0
- package/dist/commands/team/members.d.ts.map +1 -0
- package/dist/commands/team/members.js +135 -0
- package/dist/commands/team/members.js.map +1 -0
- package/dist/commands/team/projects.d.ts +19 -0
- package/dist/commands/team/projects.d.ts.map +1 -0
- package/dist/commands/team/projects.js +107 -0
- package/dist/commands/team/projects.js.map +1 -0
- package/dist/commands/team.d.ts +22 -0
- package/dist/commands/team.d.ts.map +1 -0
- package/dist/commands/team.js +238 -0
- package/dist/commands/team.js.map +1 -0
- package/dist/commands/testing/testing-pipeline-enhanced.d.ts.map +1 -1
- package/dist/commands/testing/testing-pipeline-enhanced.js +5 -3
- package/dist/commands/testing/testing-pipeline-enhanced.js.map +1 -1
- package/dist/commands/testing/testing-pipeline.d.ts.map +1 -1
- package/dist/commands/testing/testing-pipeline.js +5 -3
- package/dist/commands/testing/testing-pipeline.js.map +1 -1
- package/dist/commands/whoami.d.ts +15 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +38 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/core/reflection-pattern.d.ts +1 -1
- package/dist/core/reflection-pattern.d.ts.map +1 -1
- package/dist/core/reflection-pattern.js +2 -12
- package/dist/core/reflection-pattern.js.map +1 -1
- package/dist/core/session-log-manager.d.ts +44 -4
- package/dist/core/session-log-manager.d.ts.map +1 -1
- package/dist/core/session-log-manager.js +132 -31
- package/dist/core/session-log-manager.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +116 -17
- package/dist/index.js.map +1 -1
- package/dist/lib/api/projects-client.d.ts +119 -0
- package/dist/lib/api/projects-client.d.ts.map +1 -0
- package/dist/lib/api/projects-client.js +125 -0
- package/dist/lib/api/projects-client.js.map +1 -0
- package/dist/lib/api/teams-client.d.ts +73 -0
- package/dist/lib/api/teams-client.d.ts.map +1 -0
- package/dist/lib/api/teams-client.js +68 -0
- package/dist/lib/api/teams-client.js.map +1 -0
- package/dist/lib/charter/charter-editor.d.ts +60 -0
- package/dist/lib/charter/charter-editor.d.ts.map +1 -0
- package/dist/lib/charter/charter-editor.js +559 -0
- package/dist/lib/charter/charter-editor.js.map +1 -0
- package/dist/lib/charter/charter-storage.d.ts +92 -0
- package/dist/lib/charter/charter-storage.d.ts.map +1 -0
- package/dist/lib/charter/charter-storage.js +501 -0
- package/dist/lib/charter/charter-storage.js.map +1 -0
- package/dist/lib/charter/charter-synthesizer.d.ts +94 -0
- package/dist/lib/charter/charter-synthesizer.d.ts.map +1 -0
- package/dist/lib/charter/charter-synthesizer.js +521 -0
- package/dist/lib/charter/charter-synthesizer.js.map +1 -0
- package/dist/lib/charter/charter-versioning.d.ts +57 -0
- package/dist/lib/charter/charter-versioning.d.ts.map +1 -0
- package/dist/lib/charter/charter-versioning.js +283 -0
- package/dist/lib/charter/charter-versioning.js.map +1 -0
- package/dist/lib/charter/confidence-scorer.d.ts +263 -0
- package/dist/lib/charter/confidence-scorer.d.ts.map +1 -0
- package/dist/lib/charter/confidence-scorer.js +737 -0
- package/dist/lib/charter/confidence-scorer.js.map +1 -0
- package/dist/lib/charter/conversation-context.d.ts +99 -0
- package/dist/lib/charter/conversation-context.d.ts.map +1 -0
- package/dist/lib/charter/conversation-context.js +297 -0
- package/dist/lib/charter/conversation-context.js.map +1 -0
- package/dist/lib/charter/conversation-facilitator.d.ts +117 -0
- package/dist/lib/charter/conversation-facilitator.d.ts.map +1 -0
- package/dist/lib/charter/conversation-facilitator.js +360 -0
- package/dist/lib/charter/conversation-facilitator.js.map +1 -0
- package/dist/lib/charter/question-templates.d.ts +82 -0
- package/dist/lib/charter/question-templates.d.ts.map +1 -0
- package/dist/lib/charter/question-templates.js +355 -0
- package/dist/lib/charter/question-templates.js.map +1 -0
- package/dist/lib/charter/signal-detection.d.ts +49 -0
- package/dist/lib/charter/signal-detection.d.ts.map +1 -0
- package/dist/lib/charter/signal-detection.js +338 -0
- package/dist/lib/charter/signal-detection.js.map +1 -0
- package/dist/lib/context-loader-events.d.ts +111 -0
- package/dist/lib/context-loader-events.d.ts.map +1 -0
- package/dist/lib/context-loader-events.js +475 -0
- package/dist/lib/context-loader-events.js.map +1 -0
- package/dist/lib/event-logger.d.ts +64 -0
- package/dist/lib/event-logger.d.ts.map +1 -0
- package/dist/lib/event-logger.js +197 -0
- package/dist/lib/event-logger.js.map +1 -0
- package/dist/lib/event-queue.d.ts +104 -0
- package/dist/lib/event-queue.d.ts.map +1 -0
- package/dist/lib/event-queue.js +274 -0
- package/dist/lib/event-queue.js.map +1 -0
- package/dist/lib/session-cursor.d.ts +80 -0
- package/dist/lib/session-cursor.d.ts.map +1 -0
- package/dist/lib/session-cursor.js +250 -0
- package/dist/lib/session-cursor.js.map +1 -0
- package/dist/lib/sync/conflict-detector.d.ts +41 -0
- package/dist/lib/sync/conflict-detector.d.ts.map +1 -0
- package/dist/lib/sync/conflict-detector.js +124 -0
- package/dist/lib/sync/conflict-detector.js.map +1 -0
- package/dist/lib/sync/logger.d.ts +89 -0
- package/dist/lib/sync/logger.d.ts.map +1 -0
- package/dist/lib/sync/logger.js +202 -0
- package/dist/lib/sync/logger.js.map +1 -0
- package/dist/lib/sync/parser.d.ts +32 -0
- package/dist/lib/sync/parser.d.ts.map +1 -0
- package/dist/lib/sync/parser.js +180 -0
- package/dist/lib/sync/parser.js.map +1 -0
- package/dist/lib/sync/scanner.d.ts +34 -0
- package/dist/lib/sync/scanner.d.ts.map +1 -0
- package/dist/lib/sync/scanner.js +97 -0
- package/dist/lib/sync/scanner.js.map +1 -0
- package/dist/lib/sync/uploader.d.ts +33 -0
- package/dist/lib/sync/uploader.d.ts.map +1 -0
- package/dist/lib/sync/uploader.js +188 -0
- package/dist/lib/sync/uploader.js.map +1 -0
- package/dist/lib/write-dispatcher/adapters/graph-adapter.d.ts +77 -0
- package/dist/lib/write-dispatcher/adapters/graph-adapter.d.ts.map +1 -0
- package/dist/lib/write-dispatcher/adapters/graph-adapter.js +178 -0
- package/dist/lib/write-dispatcher/adapters/graph-adapter.js.map +1 -0
- package/dist/lib/write-dispatcher/adapters/local-adapter.d.ts +133 -0
- package/dist/lib/write-dispatcher/adapters/local-adapter.d.ts.map +1 -0
- package/dist/lib/write-dispatcher/adapters/local-adapter.js +324 -0
- package/dist/lib/write-dispatcher/adapters/local-adapter.js.map +1 -0
- package/dist/lib/write-dispatcher/write-dispatcher.d.ts +151 -0
- package/dist/lib/write-dispatcher/write-dispatcher.d.ts.map +1 -0
- package/dist/lib/write-dispatcher/write-dispatcher.js +197 -0
- package/dist/lib/write-dispatcher/write-dispatcher.js.map +1 -0
- package/dist/types/charter.d.ts +330 -0
- package/dist/types/charter.d.ts.map +1 -0
- package/dist/types/charter.js +76 -0
- package/dist/types/charter.js.map +1 -0
- package/dist/types/config.d.ts +65 -17
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js +50 -21
- package/dist/types/config.js.map +1 -1
- package/dist/utils/api-client.d.ts +36 -0
- package/dist/utils/api-client.d.ts.map +1 -0
- package/dist/utils/api-client.js +97 -0
- package/dist/utils/api-client.js.map +1 -0
- package/dist/utils/auth-storage.d.ts +56 -0
- package/dist/utils/auth-storage.d.ts.map +1 -0
- package/dist/utils/auth-storage.js +133 -0
- package/dist/utils/auth-storage.js.map +1 -0
- package/dist/utils/cleanup.d.ts +21 -0
- package/dist/utils/cleanup.d.ts.map +1 -0
- package/dist/utils/cleanup.js +122 -0
- package/dist/utils/cleanup.js.map +1 -0
- package/dist/utils/config-loader.d.ts +76 -0
- package/dist/utils/config-loader.d.ts.map +1 -0
- package/dist/utils/config-loader.js +269 -0
- package/dist/utils/config-loader.js.map +1 -0
- package/dist/utils/context-loader.d.ts +154 -0
- package/dist/utils/context-loader.d.ts.map +1 -0
- package/dist/utils/context-loader.js +411 -0
- package/dist/utils/context-loader.js.map +1 -0
- package/dist/utils/dispatcher-logger.d.ts +30 -0
- package/dist/utils/dispatcher-logger.d.ts.map +1 -0
- package/dist/utils/dispatcher-logger.js +128 -0
- package/dist/utils/dispatcher-logger.js.map +1 -0
- package/dist/utils/ginko-root.d.ts +3 -2
- package/dist/utils/ginko-root.d.ts.map +1 -1
- package/dist/utils/ginko-root.js +35 -2
- package/dist/utils/ginko-root.js.map +1 -1
- package/dist/utils/helpers.d.ts +1 -0
- package/dist/utils/helpers.d.ts.map +1 -1
- package/dist/utils/helpers.js +3 -0
- package/dist/utils/helpers.js.map +1 -1
- package/dist/utils/log-quality.d.ts +55 -0
- package/dist/utils/log-quality.d.ts.map +1 -0
- package/dist/utils/log-quality.js +297 -0
- package/dist/utils/log-quality.js.map +1 -0
- package/dist/utils/reference-parser.d.ts +164 -0
- package/dist/utils/reference-parser.d.ts.map +1 -0
- package/dist/utils/reference-parser.js +363 -0
- package/dist/utils/reference-parser.js.map +1 -0
- package/dist/utils/synthesis.d.ts +180 -0
- package/dist/utils/synthesis.d.ts.map +1 -0
- package/dist/utils/synthesis.js +724 -0
- package/dist/utils/synthesis.js.map +1 -0
- package/dist/utils/team-awareness.d.ts +127 -0
- package/dist/utils/team-awareness.d.ts.map +1 -0
- package/dist/utils/team-awareness.js +385 -0
- package/dist/utils/team-awareness.js.map +1 -0
- package/package.json +6 -4
- package/dist/commands/handoff/handoff-reflection-pipeline.d.ts +0 -106
- package/dist/commands/handoff/handoff-reflection-pipeline.d.ts.map +0 -1
- package/dist/commands/handoff/handoff-reflection-pipeline.js +0 -534
- package/dist/commands/handoff/handoff-reflection-pipeline.js.map +0 -1
- package/dist/commands/handoff/handoff-save.d.ts +0 -16
- package/dist/commands/handoff/handoff-save.d.ts.map +0 -1
- package/dist/commands/handoff/handoff-save.js +0 -72
- package/dist/commands/handoff/handoff-save.js.map +0 -1
- package/dist/commands/handoff/index.d.ts +0 -19
- package/dist/commands/handoff/index.d.ts.map +0 -1
- package/dist/commands/handoff/index.js +0 -55
- package/dist/commands/handoff/index.js.map +0 -1
- package/dist/commands/handoff-ai-orig.d.ts +0 -27
- package/dist/commands/handoff-ai-orig.d.ts.map +0 -1
- package/dist/commands/handoff-ai-orig.js +0 -405
- package/dist/commands/handoff-ai-orig.js.map +0 -1
- package/dist/commands/handoff-ai.d.ts +0 -27
- package/dist/commands/handoff-ai.d.ts.map +0 -1
- package/dist/commands/handoff-ai.js +0 -405
- package/dist/commands/handoff-ai.js.map +0 -1
- package/dist/commands/handoff-enhanced-orig.d.ts +0 -25
- package/dist/commands/handoff-enhanced-orig.d.ts.map +0 -1
- package/dist/commands/handoff-enhanced-orig.js +0 -349
- package/dist/commands/handoff-enhanced-orig.js.map +0 -1
- package/dist/commands/handoff-enhanced.d.ts +0 -25
- package/dist/commands/handoff-enhanced.d.ts.map +0 -1
- package/dist/commands/handoff-enhanced.js +0 -349
- package/dist/commands/handoff-enhanced.js.map +0 -1
- package/dist/commands/handoff-orig.d.ts +0 -10
- package/dist/commands/handoff-orig.d.ts.map +0 -1
- package/dist/commands/handoff-orig.js +0 -167
- package/dist/commands/handoff-orig.js.map +0 -1
- package/dist/commands/init-enhanced.d.ts +0 -20
- package/dist/commands/init-enhanced.d.ts.map +0 -1
- package/dist/commands/init-enhanced.js +0 -430
- package/dist/commands/init-enhanced.js.map +0 -1
- package/dist/commands/prd/prd-reflection-enhanced.d.ts +0 -63
- package/dist/commands/prd/prd-reflection-enhanced.d.ts.map +0 -1
- package/dist/commands/prd/prd-reflection-enhanced.js +0 -310
- package/dist/commands/prd/prd-reflection-enhanced.js.map +0 -1
- package/dist/commands/start-enhanced.d.ts +0 -19
- package/dist/commands/start-enhanced.d.ts.map +0 -1
- package/dist/commands/start-enhanced.js +0 -434
- package/dist/commands/start-enhanced.js.map +0 -1
- package/dist/commands/start.d.ts +0 -10
- package/dist/commands/start.d.ts.map +0 -1
- package/dist/commands/start.js +0 -119
- package/dist/commands/start.js.map +0 -1
- package/dist/core/config/config-aware-reflection.d.ts +0 -37
- package/dist/core/config/config-aware-reflection.d.ts.map +0 -1
- package/dist/core/config/config-aware-reflection.js +0 -97
- package/dist/core/config/config-aware-reflection.js.map +0 -1
- package/dist/core/config/config-loader.d.ts +0 -154
- package/dist/core/config/config-loader.d.ts.map +0 -1
- package/dist/core/config/config-loader.js +0 -424
- package/dist/core/config/config-loader.js.map +0 -1
- package/dist/core/config/config-migrator.d.ts +0 -150
- package/dist/core/config/config-migrator.d.ts.map +0 -1
- package/dist/core/config/config-migrator.js +0 -423
- package/dist/core/config/config-migrator.js.map +0 -1
- package/dist/core/config/config-schema.d.ts +0 -276
- package/dist/core/config/config-schema.d.ts.map +0 -1
- package/dist/core/config/config-schema.js +0 -277
- package/dist/core/config/config-schema.js.map +0 -1
- package/dist/core/config/index.d.ts +0 -260
- package/dist/core/config/index.d.ts.map +0 -1
- package/dist/core/config/index.js +0 -283
- package/dist/core/config/index.js.map +0 -1
- package/dist/core/config/interactive-config.d.ts +0 -76
- package/dist/core/config/interactive-config.d.ts.map +0 -1
- package/dist/core/config/interactive-config.js +0 -315
- package/dist/core/config/interactive-config.js.map +0 -1
- package/dist/core/config/path-config.d.ts +0 -121
- package/dist/core/config/path-config.d.ts.map +0 -1
- package/dist/core/config/path-config.js +0 -210
- package/dist/core/config/path-config.js.map +0 -1
- package/dist/core/config/path-resolver.d.ts +0 -151
- package/dist/core/config/path-resolver.d.ts.map +0 -1
- package/dist/core/config/path-resolver.js +0 -343
- package/dist/core/config/path-resolver.js.map +0 -1
- package/dist/core/config/project-detector.d.ts +0 -58
- package/dist/core/config/project-detector.d.ts.map +0 -1
- package/dist/core/config/project-detector.js +0 -310
- package/dist/core/config/project-detector.js.map +0 -1
- package/dist/core/config-backup/config-aware-reflection.d.ts +0 -37
- package/dist/core/config-backup/config-aware-reflection.d.ts.map +0 -1
- package/dist/core/config-backup/config-aware-reflection.js +0 -97
- package/dist/core/config-backup/config-aware-reflection.js.map +0 -1
- package/dist/core/config-backup/config-loader.d.ts +0 -71
- package/dist/core/config-backup/config-loader.d.ts.map +0 -1
- package/dist/core/config-backup/config-loader.js +0 -288
- package/dist/core/config-backup/config-loader.js.map +0 -1
- package/dist/core/config-backup/interactive-config.d.ts +0 -76
- package/dist/core/config-backup/interactive-config.d.ts.map +0 -1
- package/dist/core/config-backup/interactive-config.js +0 -315
- package/dist/core/config-backup/interactive-config.js.map +0 -1
- package/dist/core/config-backup/path-config.d.ts +0 -121
- package/dist/core/config-backup/path-config.d.ts.map +0 -1
- package/dist/core/config-backup/path-config.js +0 -210
- package/dist/core/config-backup/path-config.js.map +0 -1
- package/dist/core/config-backup/project-detector.d.ts +0 -58
- package/dist/core/config-backup/project-detector.d.ts.map +0 -1
- package/dist/core/config-backup/project-detector.js +0 -310
- package/dist/core/config-backup/project-detector.js.map +0 -1
- package/dist/core/documents/document-manager.d.ts +0 -97
- package/dist/core/documents/document-manager.d.ts.map +0 -1
- package/dist/core/documents/document-manager.js +0 -441
- package/dist/core/documents/document-manager.js.map +0 -1
- package/dist/core/documents/document-migrator.d.ts +0 -138
- package/dist/core/documents/document-migrator.d.ts.map +0 -1
- package/dist/core/documents/document-migrator.js +0 -349
- package/dist/core/documents/document-migrator.js.map +0 -1
- package/dist/core/documents/document-namer.d.ts +0 -111
- package/dist/core/documents/document-namer.d.ts.map +0 -1
- package/dist/core/documents/document-namer.js +0 -225
- package/dist/core/documents/document-namer.js.map +0 -1
- package/dist/core/documents/examples.d.ts +0 -74
- package/dist/core/documents/examples.d.ts.map +0 -1
- package/dist/core/documents/examples.js +0 -273
- package/dist/core/documents/examples.js.map +0 -1
- package/dist/core/documents/file-system.d.ts +0 -93
- package/dist/core/documents/file-system.d.ts.map +0 -1
- package/dist/core/documents/file-system.js +0 -432
- package/dist/core/documents/file-system.js.map +0 -1
- package/dist/core/documents/index.d.ts +0 -97
- package/dist/core/documents/index.d.ts.map +0 -1
- package/dist/core/documents/index.js +0 -119
- package/dist/core/documents/index.js.map +0 -1
- package/dist/core/documents/markdown-processor.d.ts +0 -84
- package/dist/core/documents/markdown-processor.d.ts.map +0 -1
- package/dist/core/documents/markdown-processor.js +0 -302
- package/dist/core/documents/markdown-processor.js.map +0 -1
- package/dist/core/documents/sequence-manager.d.ts +0 -107
- package/dist/core/documents/sequence-manager.d.ts.map +0 -1
- package/dist/core/documents/sequence-manager.js +0 -246
- package/dist/core/documents/sequence-manager.js.map +0 -1
- package/dist/core/documents/template-engine.d.ts +0 -101
- package/dist/core/documents/template-engine.d.ts.map +0 -1
- package/dist/core/documents/template-engine.js +0 -440
- package/dist/core/documents/template-engine.js.map +0 -1
- package/dist/core/platform/hook-migration.d.ts +0 -73
- package/dist/core/platform/hook-migration.d.ts.map +0 -1
- package/dist/core/platform/hook-migration.js +0 -339
- package/dist/core/platform/hook-migration.js.map +0 -1
- package/dist/core/platform/hook-migrator.d.ts +0 -49
- package/dist/core/platform/hook-migrator.d.ts.map +0 -1
- package/dist/core/platform/hook-migrator.js +0 -305
- package/dist/core/platform/hook-migrator.js.map +0 -1
- package/dist/core/platform/path-resolver.d.ts +0 -120
- package/dist/core/platform/path-resolver.d.ts.map +0 -1
- package/dist/core/platform/path-resolver.js +0 -339
- package/dist/core/platform/path-resolver.js.map +0 -1
- package/dist/core/platform/platform-templates.d.ts +0 -62
- package/dist/core/platform/platform-templates.d.ts.map +0 -1
- package/dist/core/platform/platform-templates.js +0 -364
- package/dist/core/platform/platform-templates.js.map +0 -1
- package/dist/core/pressure-monitor.d.ts +0 -76
- package/dist/core/pressure-monitor.d.ts.map +0 -1
- package/dist/core/pressure-monitor.js +0 -156
- package/dist/core/pressure-monitor.js.map +0 -1
- package/dist/core/validators/git-validator.test.d.ts +0 -12
- package/dist/core/validators/git-validator.test.d.ts.map +0 -1
- package/dist/core/validators/git-validator.test.js +0 -40
- package/dist/core/validators/git-validator.test.js.map +0 -1
- package/dist/core/validators/temp_index.d.ts +0 -56
- package/dist/core/validators/temp_index.d.ts.map +0 -1
- package/dist/core/validators/temp_index.js +0 -94
- package/dist/core/validators/temp_index.js.map +0 -1
|
@@ -0,0 +1,724 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileType: utility
|
|
3
|
+
* @status: current
|
|
4
|
+
* @updated: 2025-10-20
|
|
5
|
+
* @tags: [synthesis, session-resumption, flow-state, context]
|
|
6
|
+
* @related: [../core/session-log-manager.ts, ../commands/start/start-reflection.ts]
|
|
7
|
+
* @priority: critical
|
|
8
|
+
* @complexity: high
|
|
9
|
+
* @dependencies: [fs, path, simple-git, session-log-manager]
|
|
10
|
+
*/
|
|
11
|
+
import * as fs from 'fs/promises';
|
|
12
|
+
import * as path from 'path';
|
|
13
|
+
import simpleGit from 'simple-git';
|
|
14
|
+
import { SessionLogManager } from '../core/session-log-manager.js';
|
|
15
|
+
/**
|
|
16
|
+
* Session Synthesis Engine
|
|
17
|
+
*
|
|
18
|
+
* Reads session logs and context to synthesize a complete picture
|
|
19
|
+
* for instant flow state on session resumption.
|
|
20
|
+
*/
|
|
21
|
+
export class SessionSynthesizer {
|
|
22
|
+
git;
|
|
23
|
+
sessionDir;
|
|
24
|
+
projectRoot;
|
|
25
|
+
constructor(sessionDir, projectRoot) {
|
|
26
|
+
this.sessionDir = sessionDir;
|
|
27
|
+
this.projectRoot = projectRoot;
|
|
28
|
+
this.git = simpleGit(projectRoot);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Synthesize from event-based LoadedContext (ADR-043)
|
|
32
|
+
*
|
|
33
|
+
* When using event-based context loading, this method converts the loaded events
|
|
34
|
+
* into a SynthesisOutput for display during session startup.
|
|
35
|
+
*
|
|
36
|
+
* @param eventContext - Loaded context from event stream (API)
|
|
37
|
+
* @param projectRoot - Project root directory for git operations
|
|
38
|
+
* @returns Synthesis output with resume point based on loaded events
|
|
39
|
+
*/
|
|
40
|
+
static async synthesizeFromEvents(eventContext, // LoadedContext from context-loader-events.ts
|
|
41
|
+
projectRoot) {
|
|
42
|
+
const { myEvents = [], sprint, cursor } = eventContext;
|
|
43
|
+
// Convert API events to LogEntry format
|
|
44
|
+
const timeline = myEvents.map((event) => ({
|
|
45
|
+
timestamp: event.timestamp,
|
|
46
|
+
category: event.category,
|
|
47
|
+
description: event.description,
|
|
48
|
+
files: event.files || [],
|
|
49
|
+
impact: event.impact || 'medium',
|
|
50
|
+
pressure: event.pressure,
|
|
51
|
+
}));
|
|
52
|
+
// Extract events by category
|
|
53
|
+
const decisions = timeline.filter(e => e.category === 'decision');
|
|
54
|
+
const insights = timeline.filter(e => e.category === 'insight');
|
|
55
|
+
const achievements = timeline.filter(e => e.category === 'achievement');
|
|
56
|
+
const gitOps = timeline.filter(e => e.category === 'git');
|
|
57
|
+
// Analyze work performed
|
|
58
|
+
const workPerformed = SessionSynthesizer.analyzeWorkPerformed(timeline, achievements);
|
|
59
|
+
// Build discoveries
|
|
60
|
+
const discoveries = {
|
|
61
|
+
decisions,
|
|
62
|
+
insights,
|
|
63
|
+
gotchas: insights
|
|
64
|
+
.filter(i => i.description.toLowerCase().includes('gotcha') ||
|
|
65
|
+
i.description.toLowerCase().includes('watch out') ||
|
|
66
|
+
i.description.toLowerCase().includes('careful'))
|
|
67
|
+
.map(i => i.description)
|
|
68
|
+
};
|
|
69
|
+
// Convert sprint to SprintContext
|
|
70
|
+
const sprintContext = sprint ? {
|
|
71
|
+
goal: sprint.title,
|
|
72
|
+
progress: sprint.progress || 0,
|
|
73
|
+
tasksCompleted: [],
|
|
74
|
+
tasksRemaining: [],
|
|
75
|
+
estimatedCompletion: 'Unknown',
|
|
76
|
+
} : null;
|
|
77
|
+
// Assess flow state
|
|
78
|
+
const flowState = SessionSynthesizer.assessFlowStateFromEvents(cursor?.last_active, timeline, achievements);
|
|
79
|
+
// Generate resume point
|
|
80
|
+
const resumePoint = SessionSynthesizer.generateResumePointFromEvents(timeline, workPerformed, sprintContext);
|
|
81
|
+
// Check for warnings (git operations)
|
|
82
|
+
const warnings = await SessionSynthesizer.checkWarningsFromGit(projectRoot);
|
|
83
|
+
return {
|
|
84
|
+
qualityTier: 'rich',
|
|
85
|
+
workPerformed,
|
|
86
|
+
discoveries,
|
|
87
|
+
sprintContext,
|
|
88
|
+
flowState,
|
|
89
|
+
resumePoint,
|
|
90
|
+
warnings
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Analyze work performed (static helper for event-based synthesis)
|
|
95
|
+
*/
|
|
96
|
+
static analyzeWorkPerformed(timeline, achievements) {
|
|
97
|
+
const completed = [];
|
|
98
|
+
const inProgress = [];
|
|
99
|
+
const blocked = [];
|
|
100
|
+
for (const entry of timeline) {
|
|
101
|
+
if (entry.category === 'achievement' || entry.category === 'fix') {
|
|
102
|
+
completed.push(entry.description);
|
|
103
|
+
}
|
|
104
|
+
else if (entry.category === 'feature') {
|
|
105
|
+
inProgress.push(entry.description);
|
|
106
|
+
}
|
|
107
|
+
// Check for blocked indicators
|
|
108
|
+
if (entry.description.toLowerCase().includes('block') ||
|
|
109
|
+
entry.description.toLowerCase().includes('stuck') ||
|
|
110
|
+
entry.description.toLowerCase().includes('waiting')) {
|
|
111
|
+
blocked.push(entry.description);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return { completed, inProgress, blocked };
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Assess flow state from events (static helper)
|
|
118
|
+
*/
|
|
119
|
+
static assessFlowStateFromEvents(lastActive, timeline, achievements) {
|
|
120
|
+
const now = new Date();
|
|
121
|
+
const lastActivityTime = lastActive || (timeline.length > 0 ? timeline[timeline.length - 1]?.timestamp : undefined);
|
|
122
|
+
const minutesAgo = lastActivityTime
|
|
123
|
+
? Math.round((now.getTime() - new Date(lastActivityTime).getTime()) / (1000 * 60))
|
|
124
|
+
: 10000;
|
|
125
|
+
// Flow score based on recency and achievements
|
|
126
|
+
let score = 5;
|
|
127
|
+
if (minutesAgo < 5)
|
|
128
|
+
score = 10;
|
|
129
|
+
else if (minutesAgo < 30)
|
|
130
|
+
score = 8;
|
|
131
|
+
else if (minutesAgo < 120)
|
|
132
|
+
score = 7;
|
|
133
|
+
else if (minutesAgo < 1440)
|
|
134
|
+
score = 5;
|
|
135
|
+
else if (minutesAgo < 10080)
|
|
136
|
+
score = 3;
|
|
137
|
+
else
|
|
138
|
+
score = 1;
|
|
139
|
+
// Boost for recent achievements
|
|
140
|
+
if (achievements.length > 0) {
|
|
141
|
+
const recentAchievement = achievements[achievements.length - 1];
|
|
142
|
+
const achievementMinutesAgo = Math.round((now.getTime() - new Date(recentAchievement.timestamp).getTime()) / (1000 * 60));
|
|
143
|
+
if (achievementMinutesAgo < 60)
|
|
144
|
+
score = Math.min(10, score + 1);
|
|
145
|
+
}
|
|
146
|
+
// Energy assessment
|
|
147
|
+
let energy;
|
|
148
|
+
if (score >= 8)
|
|
149
|
+
energy = 'Hot';
|
|
150
|
+
else if (score >= 5)
|
|
151
|
+
energy = 'Warm';
|
|
152
|
+
else if (score >= 3)
|
|
153
|
+
energy = 'Cool';
|
|
154
|
+
else
|
|
155
|
+
energy = 'Cold';
|
|
156
|
+
const emotionalTone = score >= 7 ? 'Mid-stride' : score >= 4 ? 'Fresh start' : 'Needs context';
|
|
157
|
+
return {
|
|
158
|
+
score,
|
|
159
|
+
energy,
|
|
160
|
+
emotionalTone,
|
|
161
|
+
indicators: {
|
|
162
|
+
positive: score >= 7 ? ['Recent activity', 'Good momentum'] : [],
|
|
163
|
+
negative: score < 4 ? ['Long gap since last activity'] : []
|
|
164
|
+
},
|
|
165
|
+
timeContext: SessionSynthesizer.formatTimeAgoStatic(minutesAgo)
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Generate resume point from events (static helper)
|
|
170
|
+
*/
|
|
171
|
+
static generateResumePointFromEvents(timeline, workPerformed, sprintContext) {
|
|
172
|
+
const latest = timeline[timeline.length - 1];
|
|
173
|
+
if (!latest) {
|
|
174
|
+
return {
|
|
175
|
+
summary: 'No recent work logged',
|
|
176
|
+
nextAction: 'Review sprint goals and begin work',
|
|
177
|
+
suggestedCommand: 'git status',
|
|
178
|
+
contextFiles: []
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
// Generate summary
|
|
182
|
+
let summary = latest.description;
|
|
183
|
+
if (latest.files && latest.files.length > 0) {
|
|
184
|
+
summary += ` (${latest.files[0]})`;
|
|
185
|
+
}
|
|
186
|
+
// Determine next action based on latest entry
|
|
187
|
+
let nextAction;
|
|
188
|
+
let suggestedCommand;
|
|
189
|
+
if (latest.category === 'achievement') {
|
|
190
|
+
nextAction = sprintContext
|
|
191
|
+
? `Begin next task: ${sprintContext.goal}`
|
|
192
|
+
: 'Review backlog for next task';
|
|
193
|
+
suggestedCommand = 'git status';
|
|
194
|
+
}
|
|
195
|
+
else if (latest.category === 'fix') {
|
|
196
|
+
nextAction = 'Verify fix and run tests';
|
|
197
|
+
suggestedCommand = 'npm test';
|
|
198
|
+
}
|
|
199
|
+
else if (latest.category === 'feature') {
|
|
200
|
+
nextAction = 'Continue implementing feature';
|
|
201
|
+
suggestedCommand = latest.files?.[0]
|
|
202
|
+
? `code ${latest.files[0]}`
|
|
203
|
+
: 'git status';
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
nextAction = 'Continue where you left off';
|
|
207
|
+
suggestedCommand = 'git status';
|
|
208
|
+
}
|
|
209
|
+
const contextFiles = latest.files || [];
|
|
210
|
+
return {
|
|
211
|
+
summary,
|
|
212
|
+
nextAction,
|
|
213
|
+
suggestedCommand,
|
|
214
|
+
contextFiles: contextFiles.slice(0, 3)
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Format time ago (static helper)
|
|
219
|
+
*/
|
|
220
|
+
static formatTimeAgoStatic(minutes) {
|
|
221
|
+
if (minutes < 1)
|
|
222
|
+
return 'just now';
|
|
223
|
+
if (minutes < 60)
|
|
224
|
+
return `${minutes} minute${minutes > 1 ? 's' : ''} ago`;
|
|
225
|
+
const hours = Math.floor(minutes / 60);
|
|
226
|
+
if (hours < 24)
|
|
227
|
+
return `${hours} hour${hours > 1 ? 's' : ''} ago`;
|
|
228
|
+
const days = Math.floor(hours / 24);
|
|
229
|
+
return `${days} day${days > 1 ? 's' : ''} ago`;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Check warnings from git (static helper)
|
|
233
|
+
*/
|
|
234
|
+
static async checkWarningsFromGit(projectRoot) {
|
|
235
|
+
const warnings = [];
|
|
236
|
+
try {
|
|
237
|
+
const git = simpleGit(projectRoot);
|
|
238
|
+
const status = await git.status();
|
|
239
|
+
if (status.files.length > 10) {
|
|
240
|
+
warnings.push(`${status.files.length} uncommitted files - consider committing`);
|
|
241
|
+
}
|
|
242
|
+
if (status.conflicted.length > 0) {
|
|
243
|
+
warnings.push(`${status.conflicted.length} merge conflicts need resolution`);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
// Ignore git errors
|
|
248
|
+
}
|
|
249
|
+
return warnings;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Main synthesis method with progressive fail-safe
|
|
253
|
+
*/
|
|
254
|
+
async synthesize() {
|
|
255
|
+
// Tier 1: Try session log (rich quality)
|
|
256
|
+
const sessionLog = await this.trySessionLog();
|
|
257
|
+
if (sessionLog) {
|
|
258
|
+
return sessionLog;
|
|
259
|
+
}
|
|
260
|
+
// Tier 2: Try handoff (medium quality)
|
|
261
|
+
const handoffSynthesis = await this.tryHandoff();
|
|
262
|
+
if (handoffSynthesis) {
|
|
263
|
+
return handoffSynthesis;
|
|
264
|
+
}
|
|
265
|
+
// Tier 3: Try git log (basic quality)
|
|
266
|
+
const gitSynthesis = await this.tryGitLog();
|
|
267
|
+
if (gitSynthesis) {
|
|
268
|
+
return gitSynthesis;
|
|
269
|
+
}
|
|
270
|
+
// Tier 4: Git status only (minimal quality)
|
|
271
|
+
return this.gitStatusFallback();
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Tier 1: Synthesize from session log (rich quality)
|
|
275
|
+
*/
|
|
276
|
+
async trySessionLog() {
|
|
277
|
+
try {
|
|
278
|
+
const hasLog = await SessionLogManager.hasSessionLog(this.sessionDir);
|
|
279
|
+
if (!hasLog) {
|
|
280
|
+
return null;
|
|
281
|
+
}
|
|
282
|
+
const logContent = await SessionLogManager.loadSessionLog(this.sessionDir);
|
|
283
|
+
const metadata = SessionLogManager.parseMetadata(logContent);
|
|
284
|
+
if (!metadata) {
|
|
285
|
+
return null;
|
|
286
|
+
}
|
|
287
|
+
// Extract all entries
|
|
288
|
+
const timeline = SessionLogManager.extractEntries(logContent, 'Timeline');
|
|
289
|
+
const decisions = SessionLogManager.extractEntries(logContent, 'Key Decisions');
|
|
290
|
+
const insights = SessionLogManager.extractEntries(logContent, 'Insights');
|
|
291
|
+
const gitOps = SessionLogManager.extractEntries(logContent, 'Git Operations');
|
|
292
|
+
const achievements = SessionLogManager.extractEntries(logContent, 'Achievements');
|
|
293
|
+
// Analyze work performed
|
|
294
|
+
const workPerformed = this.analyzeWorkPerformed(timeline, achievements);
|
|
295
|
+
// Extract discoveries
|
|
296
|
+
const discoveries = {
|
|
297
|
+
decisions,
|
|
298
|
+
insights,
|
|
299
|
+
gotchas: insights
|
|
300
|
+
.filter(i => i.description.toLowerCase().includes('gotcha') ||
|
|
301
|
+
i.description.toLowerCase().includes('watch out') ||
|
|
302
|
+
i.description.toLowerCase().includes('careful'))
|
|
303
|
+
.map(i => i.description)
|
|
304
|
+
};
|
|
305
|
+
// Load sprint context
|
|
306
|
+
const sprintContext = await this.loadSprintContext();
|
|
307
|
+
// Assess flow state
|
|
308
|
+
const flowState = this.assessFlowState(metadata.started, timeline, achievements);
|
|
309
|
+
// Generate resume point
|
|
310
|
+
const resumePoint = this.generateResumePoint(timeline, workPerformed, sprintContext);
|
|
311
|
+
// Check for warnings
|
|
312
|
+
const warnings = await this.checkWarnings(logContent);
|
|
313
|
+
return {
|
|
314
|
+
qualityTier: 'rich',
|
|
315
|
+
workPerformed,
|
|
316
|
+
discoveries,
|
|
317
|
+
sprintContext,
|
|
318
|
+
flowState,
|
|
319
|
+
resumePoint,
|
|
320
|
+
warnings
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
catch (error) {
|
|
324
|
+
console.error('Failed to synthesize from session log:', error);
|
|
325
|
+
return null;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Tier 2: Synthesize from handoff file (medium quality)
|
|
330
|
+
*/
|
|
331
|
+
async tryHandoff() {
|
|
332
|
+
try {
|
|
333
|
+
const currentPath = path.join(this.sessionDir, 'current.md');
|
|
334
|
+
try {
|
|
335
|
+
await fs.access(currentPath);
|
|
336
|
+
}
|
|
337
|
+
catch {
|
|
338
|
+
// Check archive
|
|
339
|
+
const archiveDir = path.join(this.sessionDir, 'archive');
|
|
340
|
+
const files = await fs.readdir(archiveDir);
|
|
341
|
+
const handoffs = files
|
|
342
|
+
.filter(f => f.endsWith('-handoff.md'))
|
|
343
|
+
.sort()
|
|
344
|
+
.reverse();
|
|
345
|
+
if (handoffs.length === 0) {
|
|
346
|
+
return null;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
const handoffContent = await fs.readFile(currentPath, 'utf-8');
|
|
350
|
+
// Parse handoff for context (simplified)
|
|
351
|
+
const workPerformed = {
|
|
352
|
+
completed: this.extractSection(handoffContent, 'Completed') || [],
|
|
353
|
+
inProgress: this.extractSection(handoffContent, 'In Progress') || [],
|
|
354
|
+
blocked: []
|
|
355
|
+
};
|
|
356
|
+
const sprintContext = await this.loadSprintContext();
|
|
357
|
+
const flowState = this.assessFlowStateFromHandoff(handoffContent);
|
|
358
|
+
const resumePoint = this.generateResumePointFromHandoff(handoffContent);
|
|
359
|
+
return {
|
|
360
|
+
qualityTier: 'medium',
|
|
361
|
+
workPerformed,
|
|
362
|
+
discoveries: { decisions: [], insights: [], gotchas: [] },
|
|
363
|
+
sprintContext,
|
|
364
|
+
flowState,
|
|
365
|
+
resumePoint,
|
|
366
|
+
warnings: ['Using handoff file - session log not found']
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
catch (error) {
|
|
370
|
+
return null;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Tier 3: Synthesize from git log (basic quality)
|
|
375
|
+
*/
|
|
376
|
+
async tryGitLog() {
|
|
377
|
+
try {
|
|
378
|
+
const log = await this.git.log({ maxCount: 10 });
|
|
379
|
+
const workPerformed = {
|
|
380
|
+
completed: log.all.map(commit => commit.message.split('\n')[0]),
|
|
381
|
+
inProgress: [],
|
|
382
|
+
blocked: []
|
|
383
|
+
};
|
|
384
|
+
const sprintContext = await this.loadSprintContext();
|
|
385
|
+
const flowState = {
|
|
386
|
+
score: 5,
|
|
387
|
+
energy: 'Mid-stride',
|
|
388
|
+
emotionalTone: 'Continuing previous work from git history',
|
|
389
|
+
indicators: { positive: ['Recent commits found'], negative: ['No session log or handoff'] },
|
|
390
|
+
timeContext: this.formatTimeAgo(new Date(log.latest?.date || ''))
|
|
391
|
+
};
|
|
392
|
+
const resumePoint = {
|
|
393
|
+
summary: `Last commit: ${log.latest?.message.split('\n')[0] || 'Unknown'}`,
|
|
394
|
+
nextAction: 'Review recent changes and continue',
|
|
395
|
+
suggestedCommand: 'git log -5 --oneline',
|
|
396
|
+
contextFiles: []
|
|
397
|
+
};
|
|
398
|
+
return {
|
|
399
|
+
qualityTier: 'basic',
|
|
400
|
+
workPerformed,
|
|
401
|
+
discoveries: { decisions: [], insights: [], gotchas: [] },
|
|
402
|
+
sprintContext,
|
|
403
|
+
flowState,
|
|
404
|
+
resumePoint,
|
|
405
|
+
warnings: ['No session log or handoff - using git history only']
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
catch (error) {
|
|
409
|
+
return null;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Tier 4: Git status only (minimal quality)
|
|
414
|
+
*/
|
|
415
|
+
async gitStatusFallback() {
|
|
416
|
+
const status = await this.git.status();
|
|
417
|
+
const workPerformed = {
|
|
418
|
+
completed: [],
|
|
419
|
+
inProgress: status.modified.concat(status.created),
|
|
420
|
+
blocked: []
|
|
421
|
+
};
|
|
422
|
+
const flowState = {
|
|
423
|
+
score: 3,
|
|
424
|
+
energy: 'Fresh start',
|
|
425
|
+
emotionalTone: 'Starting with minimal context',
|
|
426
|
+
indicators: {
|
|
427
|
+
positive: status.files.length > 0 ? ['Uncommitted work found'] : [],
|
|
428
|
+
negative: ['No session history available']
|
|
429
|
+
},
|
|
430
|
+
timeContext: 'Unknown'
|
|
431
|
+
};
|
|
432
|
+
const resumePoint = {
|
|
433
|
+
summary: 'Starting session with minimal context',
|
|
434
|
+
nextAction: 'Review uncommitted changes',
|
|
435
|
+
suggestedCommand: 'git status',
|
|
436
|
+
contextFiles: []
|
|
437
|
+
};
|
|
438
|
+
return {
|
|
439
|
+
qualityTier: 'minimal',
|
|
440
|
+
workPerformed,
|
|
441
|
+
discoveries: { decisions: [], insights: [], gotchas: [] },
|
|
442
|
+
sprintContext: await this.loadSprintContext(),
|
|
443
|
+
flowState,
|
|
444
|
+
resumePoint,
|
|
445
|
+
warnings: ['Minimal context - no session log, handoff, or git history found']
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Analyze work performed from timeline entries
|
|
450
|
+
*/
|
|
451
|
+
analyzeWorkPerformed(timeline, achievements) {
|
|
452
|
+
const completed = [];
|
|
453
|
+
const inProgress = [];
|
|
454
|
+
const blocked = [];
|
|
455
|
+
// Extract completed items from achievements
|
|
456
|
+
for (const achievement of achievements) {
|
|
457
|
+
completed.push(achievement.description);
|
|
458
|
+
}
|
|
459
|
+
// Extract in-progress from recent timeline entries
|
|
460
|
+
const recentEntries = timeline.slice(-5);
|
|
461
|
+
for (const entry of recentEntries) {
|
|
462
|
+
if (entry.category === 'feature' || entry.category === 'fix') {
|
|
463
|
+
if (!achievements.find(a => a.description.includes(entry.description))) {
|
|
464
|
+
inProgress.push(entry.description);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
// Extract blocked items (look for keywords)
|
|
469
|
+
for (const entry of timeline) {
|
|
470
|
+
if (entry.description.toLowerCase().includes('blocked') ||
|
|
471
|
+
entry.description.toLowerCase().includes('waiting') ||
|
|
472
|
+
entry.description.toLowerCase().includes('stuck')) {
|
|
473
|
+
blocked.push(entry.description);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
return { completed, inProgress, blocked };
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Load sprint context from docs/sprints/
|
|
480
|
+
*/
|
|
481
|
+
async loadSprintContext() {
|
|
482
|
+
try {
|
|
483
|
+
const sprintsDir = path.join(this.projectRoot, 'docs', 'sprints');
|
|
484
|
+
const currentSprintPath = path.join(sprintsDir, 'CURRENT-SPRINT.md');
|
|
485
|
+
// Check if CURRENT-SPRINT.md exists
|
|
486
|
+
try {
|
|
487
|
+
await fs.access(currentSprintPath);
|
|
488
|
+
const content = await fs.readFile(currentSprintPath, 'utf-8');
|
|
489
|
+
// CURRENT-SPRINT.md has all readiness info (WHY, WHAT, HOW, status)
|
|
490
|
+
// No need to read full sprint file - parse CURRENT-SPRINT.md directly
|
|
491
|
+
return this.parseSprintContent(content);
|
|
492
|
+
}
|
|
493
|
+
catch {
|
|
494
|
+
// No CURRENT-SPRINT.md, look for most recent sprint
|
|
495
|
+
const files = await fs.readdir(sprintsDir);
|
|
496
|
+
const sprints = files.filter(f => f.startsWith('SPRINT-') && f.endsWith('.md'));
|
|
497
|
+
if (sprints.length > 0) {
|
|
498
|
+
const latest = sprints.sort().reverse()[0];
|
|
499
|
+
const sprintContent = await fs.readFile(path.join(sprintsDir, latest), 'utf-8');
|
|
500
|
+
return this.parseSprintContent(sprintContent);
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
return null;
|
|
504
|
+
}
|
|
505
|
+
catch (error) {
|
|
506
|
+
return null;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* Parse sprint markdown content
|
|
511
|
+
*/
|
|
512
|
+
parseSprintContent(content) {
|
|
513
|
+
// Extract goal from "Sprint Goal" or "Overview" sections
|
|
514
|
+
const goalMatch = content.match(/##\s+Sprint Goal[\s\S]*?\n\n([^\n]+)/i) ||
|
|
515
|
+
content.match(/##\s+Overview[\s\S]*?Goal:\s*(.+)/i) ||
|
|
516
|
+
content.match(/##\s+Success Criteria[\s\S]*?-\s+\[.\]\s+(.+)/i);
|
|
517
|
+
const goal = goalMatch ? goalMatch[1].trim() : 'Continue sprint work';
|
|
518
|
+
// Count completed vs total tasks (support both [x] and ✅ styles)
|
|
519
|
+
const taskMatches = content.match(/- \[.\]/g);
|
|
520
|
+
const completedMatches = content.match(/- \[x\]/gi);
|
|
521
|
+
const emojiCompletedMatches = content.match(/- ✅/g);
|
|
522
|
+
const total = taskMatches?.length || 0;
|
|
523
|
+
const completed = (completedMatches?.length || 0) + (emojiCompletedMatches?.length || 0);
|
|
524
|
+
const progress = total > 0 ? Math.round((completed / total) * 100) : 0;
|
|
525
|
+
return {
|
|
526
|
+
goal,
|
|
527
|
+
progress,
|
|
528
|
+
tasksCompleted: [], // Could parse from markdown
|
|
529
|
+
tasksRemaining: [], // Could parse from markdown
|
|
530
|
+
estimatedCompletion: progress > 75 ? 'Nearly complete' : 'In progress'
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Assess flow state from session log metadata and entries
|
|
535
|
+
*/
|
|
536
|
+
assessFlowState(startedAt, timeline, achievements) {
|
|
537
|
+
// Use the most recent activity time, not session start time
|
|
538
|
+
const lastActivity = timeline.length > 0
|
|
539
|
+
? new Date(timeline[timeline.length - 1].timestamp)
|
|
540
|
+
: new Date(startedAt);
|
|
541
|
+
const now = new Date();
|
|
542
|
+
const hoursAgo = (now.getTime() - lastActivity.getTime()) / (1000 * 60 * 60);
|
|
543
|
+
// Calculate score (1-10)
|
|
544
|
+
let score = 7; // Default mid-high score
|
|
545
|
+
// Positive indicators
|
|
546
|
+
const positive = [];
|
|
547
|
+
const negative = [];
|
|
548
|
+
if (achievements.length > 0) {
|
|
549
|
+
score += 1;
|
|
550
|
+
positive.push('Recent achievements');
|
|
551
|
+
}
|
|
552
|
+
if (timeline.length > 5) {
|
|
553
|
+
score += 1;
|
|
554
|
+
positive.push('Active session with multiple events');
|
|
555
|
+
}
|
|
556
|
+
// Time-based adjustments
|
|
557
|
+
let energy;
|
|
558
|
+
let emotionalTone;
|
|
559
|
+
if (hoursAgo < 1) {
|
|
560
|
+
energy = 'Mid-stride';
|
|
561
|
+
emotionalTone = 'You were just working on this - momentum is hot';
|
|
562
|
+
positive.push('Recent activity');
|
|
563
|
+
}
|
|
564
|
+
else if (hoursAgo < 8) {
|
|
565
|
+
energy = 'Fresh return';
|
|
566
|
+
emotionalTone = 'Back after a break - context still warm';
|
|
567
|
+
score -= 1;
|
|
568
|
+
}
|
|
569
|
+
else if (hoursAgo < 48) {
|
|
570
|
+
energy = 'Needs warmup';
|
|
571
|
+
emotionalTone = 'Day or two away - needs context refresh';
|
|
572
|
+
score -= 2;
|
|
573
|
+
negative.push('Been away for a while');
|
|
574
|
+
}
|
|
575
|
+
else {
|
|
576
|
+
energy = 'Fresh start';
|
|
577
|
+
emotionalTone = 'Extended break - treat as fresh start';
|
|
578
|
+
score -= 3;
|
|
579
|
+
negative.push('Long gap since last session');
|
|
580
|
+
}
|
|
581
|
+
// Clamp score
|
|
582
|
+
score = Math.max(1, Math.min(10, score));
|
|
583
|
+
return {
|
|
584
|
+
score,
|
|
585
|
+
energy,
|
|
586
|
+
emotionalTone,
|
|
587
|
+
indicators: { positive, negative },
|
|
588
|
+
timeContext: this.formatTimeAgo(lastActivity)
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* Generate resume point from timeline and work context
|
|
593
|
+
*/
|
|
594
|
+
generateResumePoint(timeline, workPerformed, sprintContext) {
|
|
595
|
+
// Get most recent entry
|
|
596
|
+
const latest = timeline[timeline.length - 1];
|
|
597
|
+
if (!latest) {
|
|
598
|
+
return {
|
|
599
|
+
summary: 'No recent work logged',
|
|
600
|
+
nextAction: 'Review sprint goals and begin work',
|
|
601
|
+
suggestedCommand: 'git status',
|
|
602
|
+
contextFiles: []
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
// Generate summary
|
|
606
|
+
let summary = latest.description;
|
|
607
|
+
if (latest.files && latest.files.length > 0) {
|
|
608
|
+
summary += ` (${latest.files[0]})`;
|
|
609
|
+
}
|
|
610
|
+
// Determine next action based on latest entry
|
|
611
|
+
let nextAction;
|
|
612
|
+
let suggestedCommand;
|
|
613
|
+
if (latest.category === 'achievement') {
|
|
614
|
+
nextAction = sprintContext
|
|
615
|
+
? `Begin next task: ${sprintContext.goal}`
|
|
616
|
+
: 'Review backlog for next task';
|
|
617
|
+
suggestedCommand = 'ginko backlog list --status=proposed';
|
|
618
|
+
}
|
|
619
|
+
else if (latest.category === 'fix') {
|
|
620
|
+
nextAction = 'Verify fix and run tests';
|
|
621
|
+
suggestedCommand = 'npm test';
|
|
622
|
+
}
|
|
623
|
+
else if (latest.category === 'feature') {
|
|
624
|
+
nextAction = 'Continue implementing feature';
|
|
625
|
+
suggestedCommand = latest.files?.[0]
|
|
626
|
+
? `code ${latest.files[0]}`
|
|
627
|
+
: 'git status';
|
|
628
|
+
}
|
|
629
|
+
else {
|
|
630
|
+
nextAction = 'Continue where you left off';
|
|
631
|
+
suggestedCommand = 'git status';
|
|
632
|
+
}
|
|
633
|
+
const contextFiles = latest.files || [];
|
|
634
|
+
return {
|
|
635
|
+
summary,
|
|
636
|
+
nextAction,
|
|
637
|
+
suggestedCommand,
|
|
638
|
+
contextFiles
|
|
639
|
+
};
|
|
640
|
+
}
|
|
641
|
+
/**
|
|
642
|
+
* Check for warnings based on session state
|
|
643
|
+
*/
|
|
644
|
+
async checkWarnings(logContent) {
|
|
645
|
+
const warnings = [];
|
|
646
|
+
// Check for blocked items
|
|
647
|
+
if (logContent.toLowerCase().includes('blocked')) {
|
|
648
|
+
warnings.push('Session has blocked items - may need assistance');
|
|
649
|
+
}
|
|
650
|
+
// Check for failed tests
|
|
651
|
+
if (logContent.toLowerCase().includes('test fail') ||
|
|
652
|
+
logContent.toLowerCase().includes('tests fail')) {
|
|
653
|
+
warnings.push('Tests were failing in last session');
|
|
654
|
+
}
|
|
655
|
+
// Check for uncommitted work
|
|
656
|
+
const status = await this.git.status();
|
|
657
|
+
if (status.files.length > 5) {
|
|
658
|
+
warnings.push(`${status.files.length} uncommitted files - consider committing`);
|
|
659
|
+
}
|
|
660
|
+
return warnings;
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Helper: Format time ago
|
|
664
|
+
*/
|
|
665
|
+
formatTimeAgo(date) {
|
|
666
|
+
const now = new Date();
|
|
667
|
+
const diffMs = now.getTime() - date.getTime();
|
|
668
|
+
const diffMins = Math.floor(diffMs / (1000 * 60));
|
|
669
|
+
const diffHours = Math.floor(diffMs / (1000 * 60 * 60));
|
|
670
|
+
const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
|
|
671
|
+
if (diffMins < 60) {
|
|
672
|
+
return `${diffMins} minute${diffMins === 1 ? '' : 's'} ago`;
|
|
673
|
+
}
|
|
674
|
+
else if (diffHours < 24) {
|
|
675
|
+
return `${diffHours} hour${diffHours === 1 ? '' : 's'} ago`;
|
|
676
|
+
}
|
|
677
|
+
else {
|
|
678
|
+
return `${diffDays} day${diffDays === 1 ? '' : 's'} ago`;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* Helper: Extract section from handoff markdown
|
|
683
|
+
*/
|
|
684
|
+
extractSection(content, sectionName) {
|
|
685
|
+
const regex = new RegExp(`##\\s+${sectionName}[\\s\\S]*?([\\s\\S]*?)(?=\\n##|$)`, 'i');
|
|
686
|
+
const match = content.match(regex);
|
|
687
|
+
if (!match)
|
|
688
|
+
return null;
|
|
689
|
+
const items = match[1]
|
|
690
|
+
.split('\n')
|
|
691
|
+
.filter(line => line.trim().startsWith('-'))
|
|
692
|
+
.map(line => line.replace(/^-\s*/, '').trim());
|
|
693
|
+
return items.length > 0 ? items : null;
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* Helper: Assess flow state from handoff
|
|
697
|
+
*/
|
|
698
|
+
assessFlowStateFromHandoff(content) {
|
|
699
|
+
// Simplified flow assessment
|
|
700
|
+
return {
|
|
701
|
+
score: 6,
|
|
702
|
+
energy: 'Mid-stride',
|
|
703
|
+
emotionalTone: 'Resuming from handoff',
|
|
704
|
+
indicators: {
|
|
705
|
+
positive: ['Handoff found'],
|
|
706
|
+
negative: ['Session log not available']
|
|
707
|
+
},
|
|
708
|
+
timeContext: 'Unknown'
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* Helper: Generate resume point from handoff
|
|
713
|
+
*/
|
|
714
|
+
generateResumePointFromHandoff(content) {
|
|
715
|
+
const nextMatch = content.match(/Next Session[:\s]+(.+)/i);
|
|
716
|
+
return {
|
|
717
|
+
summary: 'Resuming from handoff',
|
|
718
|
+
nextAction: nextMatch ? nextMatch[1].trim() : 'Continue previous work',
|
|
719
|
+
suggestedCommand: 'git status',
|
|
720
|
+
contextFiles: []
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
//# sourceMappingURL=synthesis.js.map
|