@yjjeong/omg 0.1.0
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/CHANGELOG.md +85 -0
- package/LICENSE +21 -0
- package/README.md +153 -0
- package/dist/cli/args.d.ts +39 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/args.js +129 -0
- package/dist/cli/args.js.map +1 -0
- package/dist/cli/autoCommit.d.ts +20 -0
- package/dist/cli/autoCommit.d.ts.map +1 -0
- package/dist/cli/autoCommit.js +121 -0
- package/dist/cli/autoCommit.js.map +1 -0
- package/dist/cli/bgTasks.d.ts +57 -0
- package/dist/cli/bgTasks.d.ts.map +1 -0
- package/dist/cli/bgTasks.js +193 -0
- package/dist/cli/bgTasks.js.map +1 -0
- package/dist/cli/compactor.d.ts +48 -0
- package/dist/cli/compactor.d.ts.map +1 -0
- package/dist/cli/compactor.js +73 -0
- package/dist/cli/compactor.js.map +1 -0
- package/dist/cli/doctor.d.ts +77 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +279 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/gitStatus.d.ts +7 -0
- package/dist/cli/gitStatus.d.ts.map +1 -0
- package/dist/cli/gitStatus.js +70 -0
- package/dist/cli/gitStatus.js.map +1 -0
- package/dist/cli/handoff.d.ts +36 -0
- package/dist/cli/handoff.d.ts.map +1 -0
- package/dist/cli/handoff.js +60 -0
- package/dist/cli/handoff.js.map +1 -0
- package/dist/cli/interactive/brokers.d.ts +31 -0
- package/dist/cli/interactive/brokers.d.ts.map +1 -0
- package/dist/cli/interactive/brokers.js +259 -0
- package/dist/cli/interactive/brokers.js.map +1 -0
- package/dist/cli/interactive/index.d.ts +8 -0
- package/dist/cli/interactive/index.d.ts.map +1 -0
- package/dist/cli/interactive/index.js +731 -0
- package/dist/cli/interactive/index.js.map +1 -0
- package/dist/cli/interactive/proxyQuestions.d.ts +15 -0
- package/dist/cli/interactive/proxyQuestions.d.ts.map +1 -0
- package/dist/cli/interactive/proxyQuestions.js +48 -0
- package/dist/cli/interactive/proxyQuestions.js.map +1 -0
- package/dist/cli/interactive/tabManager.d.ts +32 -0
- package/dist/cli/interactive/tabManager.d.ts.map +1 -0
- package/dist/cli/interactive/tabManager.js +244 -0
- package/dist/cli/interactive/tabManager.js.map +1 -0
- package/dist/cli/interactive/teamHint.d.ts +2 -0
- package/dist/cli/interactive/teamHint.d.ts.map +1 -0
- package/dist/cli/interactive/teamHint.js +14 -0
- package/dist/cli/interactive/teamHint.js.map +1 -0
- package/dist/cli/login.d.ts +13 -0
- package/dist/cli/login.d.ts.map +1 -0
- package/dist/cli/login.js +53 -0
- package/dist/cli/login.js.map +1 -0
- package/dist/cli/modes/demo.d.ts +12 -0
- package/dist/cli/modes/demo.d.ts.map +1 -0
- package/dist/cli/modes/demo.js +48 -0
- package/dist/cli/modes/demo.js.map +1 -0
- package/dist/cli/modes/doctor.d.ts +28 -0
- package/dist/cli/modes/doctor.d.ts.map +1 -0
- package/dist/cli/modes/doctor.js +79 -0
- package/dist/cli/modes/doctor.js.map +1 -0
- package/dist/cli/modes/login.d.ts +5 -0
- package/dist/cli/modes/login.d.ts.map +1 -0
- package/dist/cli/modes/login.js +40 -0
- package/dist/cli/modes/login.js.map +1 -0
- package/dist/cli/modes/mcpServe.d.ts +9 -0
- package/dist/cli/modes/mcpServe.d.ts.map +1 -0
- package/dist/cli/modes/mcpServe.js +112 -0
- package/dist/cli/modes/mcpServe.js.map +1 -0
- package/dist/cli/modes/orchestrator.d.ts +14 -0
- package/dist/cli/modes/orchestrator.d.ts.map +1 -0
- package/dist/cli/modes/orchestrator.js +64 -0
- package/dist/cli/modes/orchestrator.js.map +1 -0
- package/dist/cli/modes/team.d.ts +14 -0
- package/dist/cli/modes/team.d.ts.map +1 -0
- package/dist/cli/modes/team.js +87 -0
- package/dist/cli/modes/team.js.map +1 -0
- package/dist/cli/registry.d.ts +3 -0
- package/dist/cli/registry.d.ts.map +1 -0
- package/dist/cli/registry.js +15 -0
- package/dist/cli/registry.js.map +1 -0
- package/dist/cli/slash/core.d.ts +3 -0
- package/dist/cli/slash/core.d.ts.map +1 -0
- package/dist/cli/slash/core.js +509 -0
- package/dist/cli/slash/core.js.map +1 -0
- package/dist/cli/slash/index.d.ts +3 -0
- package/dist/cli/slash/index.d.ts.map +1 -0
- package/dist/cli/slash/index.js +28 -0
- package/dist/cli/slash/index.js.map +1 -0
- package/dist/cli/slash/modes.d.ts +3 -0
- package/dist/cli/slash/modes.d.ts.map +1 -0
- package/dist/cli/slash/modes.js +530 -0
- package/dist/cli/slash/modes.js.map +1 -0
- package/dist/cli/slash/session.d.ts +3 -0
- package/dist/cli/slash/session.d.ts.map +1 -0
- package/dist/cli/slash/session.js +376 -0
- package/dist/cli/slash/session.js.map +1 -0
- package/dist/cli/slash/shared.d.ts +43 -0
- package/dist/cli/slash/shared.d.ts.map +1 -0
- package/dist/cli/slash/shared.js +6 -0
- package/dist/cli/slash/shared.js.map +1 -0
- package/dist/cli/slash/tabs.d.ts +3 -0
- package/dist/cli/slash/tabs.d.ts.map +1 -0
- package/dist/cli/slash/tabs.js +497 -0
- package/dist/cli/slash/tabs.js.map +1 -0
- package/dist/cli/slash/team.d.ts +3 -0
- package/dist/cli/slash/team.d.ts.map +1 -0
- package/dist/cli/slash/team.js +85 -0
- package/dist/cli/slash/team.js.map +1 -0
- package/dist/cli/slash.d.ts +3 -0
- package/dist/cli/slash.d.ts.map +1 -0
- package/dist/cli/slash.js +8 -0
- package/dist/cli/slash.js.map +1 -0
- package/dist/cli/teamPipeline.d.ts +42 -0
- package/dist/cli/teamPipeline.d.ts.map +1 -0
- package/dist/cli/teamPipeline.js +406 -0
- package/dist/cli/teamPipeline.js.map +1 -0
- package/dist/cli/touchedFiles.d.ts +14 -0
- package/dist/cli/touchedFiles.d.ts.map +1 -0
- package/dist/cli/touchedFiles.js +66 -0
- package/dist/cli/touchedFiles.js.map +1 -0
- package/dist/cli/turn.d.ts +47 -0
- package/dist/cli/turn.d.ts.map +1 -0
- package/dist/cli/turn.js +626 -0
- package/dist/cli/turn.js.map +1 -0
- package/dist/cli/types.d.ts +47 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +5 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli/uiSession.d.ts +10 -0
- package/dist/cli/uiSession.d.ts.map +1 -0
- package/dist/cli/uiSession.js +66 -0
- package/dist/cli/uiSession.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +128 -0
- package/dist/cli.js.map +1 -0
- package/dist/core/adapter.d.ts +47 -0
- package/dist/core/adapter.d.ts.map +1 -0
- package/dist/core/adapter.js +48 -0
- package/dist/core/adapter.js.map +1 -0
- package/dist/core/adapters/anthropic.d.ts +35 -0
- package/dist/core/adapters/anthropic.d.ts.map +1 -0
- package/dist/core/adapters/anthropic.js +203 -0
- package/dist/core/adapters/anthropic.js.map +1 -0
- package/dist/core/adapters/claudeCli.d.ts +126 -0
- package/dist/core/adapters/claudeCli.d.ts.map +1 -0
- package/dist/core/adapters/claudeCli.js +584 -0
- package/dist/core/adapters/claudeCli.js.map +1 -0
- package/dist/core/adapters/cliAdapterBase.d.ts +48 -0
- package/dist/core/adapters/cliAdapterBase.d.ts.map +1 -0
- package/dist/core/adapters/cliAdapterBase.js +105 -0
- package/dist/core/adapters/cliAdapterBase.js.map +1 -0
- package/dist/core/adapters/cliStderr.d.ts +35 -0
- package/dist/core/adapters/cliStderr.d.ts.map +1 -0
- package/dist/core/adapters/cliStderr.js +87 -0
- package/dist/core/adapters/cliStderr.js.map +1 -0
- package/dist/core/adapters/codexCli.d.ts +113 -0
- package/dist/core/adapters/codexCli.d.ts.map +1 -0
- package/dist/core/adapters/codexCli.js +424 -0
- package/dist/core/adapters/codexCli.js.map +1 -0
- package/dist/core/adapters/gemini.d.ts +17 -0
- package/dist/core/adapters/gemini.d.ts.map +1 -0
- package/dist/core/adapters/gemini.js +133 -0
- package/dist/core/adapters/gemini.js.map +1 -0
- package/dist/core/adapters/geminiCli.d.ts +91 -0
- package/dist/core/adapters/geminiCli.d.ts.map +1 -0
- package/dist/core/adapters/geminiCli.js +276 -0
- package/dist/core/adapters/geminiCli.js.map +1 -0
- package/dist/core/adapters/nudges.d.ts +21 -0
- package/dist/core/adapters/nudges.d.ts.map +1 -0
- package/dist/core/adapters/nudges.js +75 -0
- package/dist/core/adapters/nudges.js.map +1 -0
- package/dist/core/adapters/openai.d.ts +17 -0
- package/dist/core/adapters/openai.d.ts.map +1 -0
- package/dist/core/adapters/openai.js +138 -0
- package/dist/core/adapters/openai.js.map +1 -0
- package/dist/core/adapters/parseFailures.d.ts +10 -0
- package/dist/core/adapters/parseFailures.d.ts.map +1 -0
- package/dist/core/adapters/parseFailures.js +35 -0
- package/dist/core/adapters/parseFailures.js.map +1 -0
- package/dist/core/adapters/utils.d.ts +11 -0
- package/dist/core/adapters/utils.d.ts.map +1 -0
- package/dist/core/adapters/utils.js +33 -0
- package/dist/core/adapters/utils.js.map +1 -0
- package/dist/core/askBroker.d.ts +11 -0
- package/dist/core/askBroker.d.ts.map +1 -0
- package/dist/core/askBroker.js +78 -0
- package/dist/core/askBroker.js.map +1 -0
- package/dist/core/atomicWrite.d.ts +5 -0
- package/dist/core/atomicWrite.d.ts.map +1 -0
- package/dist/core/atomicWrite.js +18 -0
- package/dist/core/atomicWrite.js.map +1 -0
- package/dist/core/brokers/askBroker.d.ts +11 -0
- package/dist/core/brokers/askBroker.d.ts.map +1 -0
- package/dist/core/brokers/askBroker.js +78 -0
- package/dist/core/brokers/askBroker.js.map +1 -0
- package/dist/core/brokers/permissionBroker.d.ts +7 -0
- package/dist/core/brokers/permissionBroker.d.ts.map +1 -0
- package/dist/core/brokers/permissionBroker.js +63 -0
- package/dist/core/brokers/permissionBroker.js.map +1 -0
- package/dist/core/brokers/socketBroker.d.ts +35 -0
- package/dist/core/brokers/socketBroker.d.ts.map +1 -0
- package/dist/core/brokers/socketBroker.js +74 -0
- package/dist/core/brokers/socketBroker.js.map +1 -0
- package/dist/core/clipboard.d.ts +4 -0
- package/dist/core/clipboard.d.ts.map +1 -0
- package/dist/core/clipboard.js +46 -0
- package/dist/core/clipboard.js.map +1 -0
- package/dist/core/compactor.d.ts +32 -0
- package/dist/core/compactor.d.ts.map +1 -0
- package/dist/core/compactor.js +91 -0
- package/dist/core/compactor.js.map +1 -0
- package/dist/core/consensusEngine.d.ts +21 -0
- package/dist/core/consensusEngine.d.ts.map +1 -0
- package/dist/core/consensusEngine.js +116 -0
- package/dist/core/consensusEngine.js.map +1 -0
- package/dist/core/context/contextCompressor.d.ts +10 -0
- package/dist/core/context/contextCompressor.d.ts.map +1 -0
- package/dist/core/context/contextCompressor.js +54 -0
- package/dist/core/context/contextCompressor.js.map +1 -0
- package/dist/core/context/contextWindows.d.ts +25 -0
- package/dist/core/context/contextWindows.d.ts.map +1 -0
- package/dist/core/context/contextWindows.js +101 -0
- package/dist/core/context/contextWindows.js.map +1 -0
- package/dist/core/context/summarizer.d.ts +65 -0
- package/dist/core/context/summarizer.d.ts.map +1 -0
- package/dist/core/context/summarizer.js +184 -0
- package/dist/core/context/summarizer.js.map +1 -0
- package/dist/core/context/usageCache.d.ts +19 -0
- package/dist/core/context/usageCache.d.ts.map +1 -0
- package/dist/core/context/usageCache.js +157 -0
- package/dist/core/context/usageCache.js.map +1 -0
- package/dist/core/context/usageWindow.d.ts +19 -0
- package/dist/core/context/usageWindow.d.ts.map +1 -0
- package/dist/core/context/usageWindow.js +73 -0
- package/dist/core/context/usageWindow.js.map +1 -0
- package/dist/core/contextCompressor.d.ts +10 -0
- package/dist/core/contextCompressor.d.ts.map +1 -0
- package/dist/core/contextCompressor.js +54 -0
- package/dist/core/contextCompressor.js.map +1 -0
- package/dist/core/contextWindows.d.ts +5 -0
- package/dist/core/contextWindows.d.ts.map +1 -0
- package/dist/core/contextWindows.js +60 -0
- package/dist/core/contextWindows.js.map +1 -0
- package/dist/core/continuum/digest.d.ts +35 -0
- package/dist/core/continuum/digest.d.ts.map +1 -0
- package/dist/core/continuum/digest.js +91 -0
- package/dist/core/continuum/digest.js.map +1 -0
- package/dist/core/continuum/index.d.ts +6 -0
- package/dist/core/continuum/index.d.ts.map +1 -0
- package/dist/core/continuum/index.js +7 -0
- package/dist/core/continuum/index.js.map +1 -0
- package/dist/core/continuum/inject.d.ts +9 -0
- package/dist/core/continuum/inject.d.ts.map +1 -0
- package/dist/core/continuum/inject.js +78 -0
- package/dist/core/continuum/inject.js.map +1 -0
- package/dist/core/continuum/projectId.d.ts +10 -0
- package/dist/core/continuum/projectId.d.ts.map +1 -0
- package/dist/core/continuum/projectId.js +60 -0
- package/dist/core/continuum/projectId.js.map +1 -0
- package/dist/core/continuum/store.d.ts +24 -0
- package/dist/core/continuum/store.d.ts.map +1 -0
- package/dist/core/continuum/store.js +144 -0
- package/dist/core/continuum/store.js.map +1 -0
- package/dist/core/continuum/types.d.ts +87 -0
- package/dist/core/continuum/types.d.ts.map +1 -0
- package/dist/core/continuum/types.js +9 -0
- package/dist/core/continuum/types.js.map +1 -0
- package/dist/core/dag.d.ts +21 -0
- package/dist/core/dag.d.ts.map +1 -0
- package/dist/core/dag.js +71 -0
- package/dist/core/dag.js.map +1 -0
- package/dist/core/director.d.ts +11 -0
- package/dist/core/director.d.ts.map +1 -0
- package/dist/core/director.js +37 -0
- package/dist/core/director.js.map +1 -0
- package/dist/core/hookedToolBroker.d.ts +25 -0
- package/dist/core/hookedToolBroker.d.ts.map +1 -0
- package/dist/core/hookedToolBroker.js +95 -0
- package/dist/core/hookedToolBroker.js.map +1 -0
- package/dist/core/langHint.d.ts +9 -0
- package/dist/core/langHint.d.ts.map +1 -0
- package/dist/core/langHint.js +33 -0
- package/dist/core/langHint.js.map +1 -0
- package/dist/core/mcp/mcpClient.d.ts +42 -0
- package/dist/core/mcp/mcpClient.d.ts.map +1 -0
- package/dist/core/mcp/mcpClient.js +134 -0
- package/dist/core/mcp/mcpClient.js.map +1 -0
- package/dist/core/mcp/mcpConfig.d.ts +58 -0
- package/dist/core/mcp/mcpConfig.d.ts.map +1 -0
- package/dist/core/mcp/mcpConfig.js +148 -0
- package/dist/core/mcp/mcpConfig.js.map +1 -0
- package/dist/core/mcp/mcpManager.d.ts +31 -0
- package/dist/core/mcp/mcpManager.d.ts.map +1 -0
- package/dist/core/mcp/mcpManager.js +83 -0
- package/dist/core/mcp/mcpManager.js.map +1 -0
- package/dist/core/mcpClient.d.ts +42 -0
- package/dist/core/mcpClient.d.ts.map +1 -0
- package/dist/core/mcpClient.js +134 -0
- package/dist/core/mcpClient.js.map +1 -0
- package/dist/core/mcpConfig.d.ts +24 -0
- package/dist/core/mcpConfig.d.ts.map +1 -0
- package/dist/core/mcpConfig.js +74 -0
- package/dist/core/mcpConfig.js.map +1 -0
- package/dist/core/mcpManager.d.ts +31 -0
- package/dist/core/mcpManager.d.ts.map +1 -0
- package/dist/core/mcpManager.js +83 -0
- package/dist/core/mcpManager.js.map +1 -0
- package/dist/core/memory.d.ts +22 -0
- package/dist/core/memory.d.ts.map +1 -0
- package/dist/core/memory.js +102 -0
- package/dist/core/memory.js.map +1 -0
- package/dist/core/omgToolManifest.d.ts +34 -0
- package/dist/core/omgToolManifest.d.ts.map +1 -0
- package/dist/core/omgToolManifest.js +59 -0
- package/dist/core/omgToolManifest.js.map +1 -0
- package/dist/core/orchestration/consensusEngine.d.ts +21 -0
- package/dist/core/orchestration/consensusEngine.d.ts.map +1 -0
- package/dist/core/orchestration/consensusEngine.js +116 -0
- package/dist/core/orchestration/consensusEngine.js.map +1 -0
- package/dist/core/orchestration/dag.d.ts +21 -0
- package/dist/core/orchestration/dag.d.ts.map +1 -0
- package/dist/core/orchestration/dag.js +71 -0
- package/dist/core/orchestration/dag.js.map +1 -0
- package/dist/core/orchestration/director.d.ts +11 -0
- package/dist/core/orchestration/director.d.ts.map +1 -0
- package/dist/core/orchestration/director.js +37 -0
- package/dist/core/orchestration/director.js.map +1 -0
- package/dist/core/orchestration/orchestrator.d.ts +32 -0
- package/dist/core/orchestration/orchestrator.d.ts.map +1 -0
- package/dist/core/orchestration/orchestrator.js +214 -0
- package/dist/core/orchestration/orchestrator.js.map +1 -0
- package/dist/core/orchestration/roleRouter.d.ts +28 -0
- package/dist/core/orchestration/roleRouter.d.ts.map +1 -0
- package/dist/core/orchestration/roleRouter.js +64 -0
- package/dist/core/orchestration/roleRouter.js.map +1 -0
- package/dist/core/orchestration/teamRunner.d.ts +69 -0
- package/dist/core/orchestration/teamRunner.d.ts.map +1 -0
- package/dist/core/orchestration/teamRunner.js +477 -0
- package/dist/core/orchestration/teamRunner.js.map +1 -0
- package/dist/core/orchestration/types.d.ts +115 -0
- package/dist/core/orchestration/types.d.ts.map +1 -0
- package/dist/core/orchestration/types.js +71 -0
- package/dist/core/orchestration/types.js.map +1 -0
- package/dist/core/orchestrator.d.ts +32 -0
- package/dist/core/orchestrator.d.ts.map +1 -0
- package/dist/core/orchestrator.js +214 -0
- package/dist/core/orchestrator.js.map +1 -0
- package/dist/core/permissionBroker.d.ts +7 -0
- package/dist/core/permissionBroker.d.ts.map +1 -0
- package/dist/core/permissionBroker.js +63 -0
- package/dist/core/permissionBroker.js.map +1 -0
- package/dist/core/planConfig.d.ts +15 -0
- package/dist/core/planConfig.d.ts.map +1 -0
- package/dist/core/planConfig.js +98 -0
- package/dist/core/planConfig.js.map +1 -0
- package/dist/core/presetPersistence.d.ts +4 -0
- package/dist/core/presetPersistence.d.ts.map +1 -0
- package/dist/core/presetPersistence.js +64 -0
- package/dist/core/presetPersistence.js.map +1 -0
- package/dist/core/roleRouter.d.ts +26 -0
- package/dist/core/roleRouter.d.ts.map +1 -0
- package/dist/core/roleRouter.js +62 -0
- package/dist/core/roleRouter.js.map +1 -0
- package/dist/core/sessionList.d.ts +26 -0
- package/dist/core/sessionList.d.ts.map +1 -0
- package/dist/core/sessionList.js +278 -0
- package/dist/core/sessionList.js.map +1 -0
- package/dist/core/slugify.d.ts +2 -0
- package/dist/core/slugify.d.ts.map +1 -0
- package/dist/core/slugify.js +17 -0
- package/dist/core/slugify.js.map +1 -0
- package/dist/core/socketBroker.d.ts +19 -0
- package/dist/core/socketBroker.d.ts.map +1 -0
- package/dist/core/socketBroker.js +48 -0
- package/dist/core/socketBroker.js.map +1 -0
- package/dist/core/state/agentsMdScaffold.d.ts +15 -0
- package/dist/core/state/agentsMdScaffold.d.ts.map +1 -0
- package/dist/core/state/agentsMdScaffold.js +118 -0
- package/dist/core/state/agentsMdScaffold.js.map +1 -0
- package/dist/core/state/atomicWrite.d.ts +5 -0
- package/dist/core/state/atomicWrite.d.ts.map +1 -0
- package/dist/core/state/atomicWrite.js +18 -0
- package/dist/core/state/atomicWrite.js.map +1 -0
- package/dist/core/state/handoff.d.ts +20 -0
- package/dist/core/state/handoff.d.ts.map +1 -0
- package/dist/core/state/handoff.js +71 -0
- package/dist/core/state/handoff.js.map +1 -0
- package/dist/core/state/mcpCatalog.d.ts +11 -0
- package/dist/core/state/mcpCatalog.d.ts.map +1 -0
- package/dist/core/state/mcpCatalog.js +51 -0
- package/dist/core/state/mcpCatalog.js.map +1 -0
- package/dist/core/state/mcpRecommendations.d.ts +7 -0
- package/dist/core/state/mcpRecommendations.d.ts.map +1 -0
- package/dist/core/state/mcpRecommendations.js +57 -0
- package/dist/core/state/mcpRecommendations.js.map +1 -0
- package/dist/core/state/memory.d.ts +22 -0
- package/dist/core/state/memory.d.ts.map +1 -0
- package/dist/core/state/memory.js +102 -0
- package/dist/core/state/memory.js.map +1 -0
- package/dist/core/state/planConfig.d.ts +15 -0
- package/dist/core/state/planConfig.d.ts.map +1 -0
- package/dist/core/state/planConfig.js +98 -0
- package/dist/core/state/planConfig.js.map +1 -0
- package/dist/core/state/presetPersistence.d.ts +4 -0
- package/dist/core/state/presetPersistence.d.ts.map +1 -0
- package/dist/core/state/presetPersistence.js +67 -0
- package/dist/core/state/presetPersistence.js.map +1 -0
- package/dist/core/state/sessionList.d.ts +26 -0
- package/dist/core/state/sessionList.d.ts.map +1 -0
- package/dist/core/state/sessionList.js +278 -0
- package/dist/core/state/sessionList.js.map +1 -0
- package/dist/core/state/stackDetect.d.ts +8 -0
- package/dist/core/state/stackDetect.d.ts.map +1 -0
- package/dist/core/state/stackDetect.js +40 -0
- package/dist/core/state/stackDetect.js.map +1 -0
- package/dist/core/state/tabPersistence.d.ts +29 -0
- package/dist/core/state/tabPersistence.d.ts.map +1 -0
- package/dist/core/state/tabPersistence.js +65 -0
- package/dist/core/state/tabPersistence.js.map +1 -0
- package/dist/core/tabPersistence.d.ts +29 -0
- package/dist/core/tabPersistence.d.ts.map +1 -0
- package/dist/core/tabPersistence.js +65 -0
- package/dist/core/tabPersistence.js.map +1 -0
- package/dist/core/teamRunner.d.ts +42 -0
- package/dist/core/teamRunner.d.ts.map +1 -0
- package/dist/core/teamRunner.js +248 -0
- package/dist/core/teamRunner.js.map +1 -0
- package/dist/core/toolGate.d.ts +23 -0
- package/dist/core/toolGate.d.ts.map +1 -0
- package/dist/core/toolGate.js +51 -0
- package/dist/core/toolGate.js.map +1 -0
- package/dist/core/toolInterceptor.d.ts +7 -0
- package/dist/core/toolInterceptor.d.ts.map +1 -0
- package/dist/core/toolInterceptor.js +108 -0
- package/dist/core/toolInterceptor.js.map +1 -0
- package/dist/core/tools/hookedToolBroker.d.ts +25 -0
- package/dist/core/tools/hookedToolBroker.d.ts.map +1 -0
- package/dist/core/tools/hookedToolBroker.js +95 -0
- package/dist/core/tools/hookedToolBroker.js.map +1 -0
- package/dist/core/tools/omgToolManifest.d.ts +42 -0
- package/dist/core/tools/omgToolManifest.d.ts.map +1 -0
- package/dist/core/tools/omgToolManifest.js +66 -0
- package/dist/core/tools/omgToolManifest.js.map +1 -0
- package/dist/core/tools/toolGate.d.ts +23 -0
- package/dist/core/tools/toolGate.d.ts.map +1 -0
- package/dist/core/tools/toolGate.js +51 -0
- package/dist/core/tools/toolGate.js.map +1 -0
- package/dist/core/tools/toolInterceptor.d.ts +7 -0
- package/dist/core/tools/toolInterceptor.d.ts.map +1 -0
- package/dist/core/tools/toolInterceptor.js +108 -0
- package/dist/core/tools/toolInterceptor.js.map +1 -0
- package/dist/core/tools/tools.d.ts +34 -0
- package/dist/core/tools/tools.d.ts.map +1 -0
- package/dist/core/tools/tools.js +328 -0
- package/dist/core/tools/tools.js.map +1 -0
- package/dist/core/tools.d.ts +34 -0
- package/dist/core/tools.d.ts.map +1 -0
- package/dist/core/tools.js +300 -0
- package/dist/core/tools.js.map +1 -0
- package/dist/core/types.d.ts +107 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +55 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/usageCache.d.ts +19 -0
- package/dist/core/usageCache.d.ts.map +1 -0
- package/dist/core/usageCache.js +157 -0
- package/dist/core/usageCache.js.map +1 -0
- package/dist/core/usageWindow.d.ts +19 -0
- package/dist/core/usageWindow.d.ts.map +1 -0
- package/dist/core/usageWindow.js +73 -0
- package/dist/core/usageWindow.js.map +1 -0
- package/dist/core/util/bgProtocol.d.ts +5 -0
- package/dist/core/util/bgProtocol.d.ts.map +1 -0
- package/dist/core/util/bgProtocol.js +20 -0
- package/dist/core/util/bgProtocol.js.map +1 -0
- package/dist/core/util/clipboard.d.ts +4 -0
- package/dist/core/util/clipboard.d.ts.map +1 -0
- package/dist/core/util/clipboard.js +46 -0
- package/dist/core/util/clipboard.js.map +1 -0
- package/dist/core/util/clipboardImage.d.ts +3 -0
- package/dist/core/util/clipboardImage.d.ts.map +1 -0
- package/dist/core/util/clipboardImage.js +58 -0
- package/dist/core/util/clipboardImage.js.map +1 -0
- package/dist/core/util/langHint.d.ts +9 -0
- package/dist/core/util/langHint.d.ts.map +1 -0
- package/dist/core/util/langHint.js +33 -0
- package/dist/core/util/langHint.js.map +1 -0
- package/dist/core/util/slugify.d.ts +2 -0
- package/dist/core/util/slugify.d.ts.map +1 -0
- package/dist/core/util/slugify.js +28 -0
- package/dist/core/util/slugify.js.map +1 -0
- package/dist/hooks/hookedToolProxy.mjs +118 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/ipc/dispatcher.d.ts +21 -0
- package/dist/ipc/dispatcher.d.ts.map +1 -0
- package/dist/ipc/dispatcher.js +160 -0
- package/dist/ipc/dispatcher.js.map +1 -0
- package/dist/ipc/events.d.ts +33 -0
- package/dist/ipc/events.d.ts.map +1 -0
- package/dist/ipc/events.js +42 -0
- package/dist/ipc/events.js.map +1 -0
- package/dist/ipc/rpc.d.ts +31 -0
- package/dist/ipc/rpc.d.ts.map +1 -0
- package/dist/ipc/rpc.js +110 -0
- package/dist/ipc/rpc.js.map +1 -0
- package/dist/ipc/stdio.d.ts +11 -0
- package/dist/ipc/stdio.d.ts.map +1 -0
- package/dist/ipc/stdio.js +52 -0
- package/dist/ipc/stdio.js.map +1 -0
- package/dist/mcp/askClient.d.ts +9 -0
- package/dist/mcp/askClient.d.ts.map +1 -0
- package/dist/mcp/askClient.js +70 -0
- package/dist/mcp/askClient.js.map +1 -0
- package/dist/mcp/constants.d.ts +6 -0
- package/dist/mcp/constants.d.ts.map +1 -0
- package/dist/mcp/constants.js +8 -0
- package/dist/mcp/constants.js.map +1 -0
- package/dist/mcp/permissionClient.d.ts +5 -0
- package/dist/mcp/permissionClient.d.ts.map +1 -0
- package/dist/mcp/permissionClient.js +71 -0
- package/dist/mcp/permissionClient.js.map +1 -0
- package/dist/mcp/schemas.d.ts +9 -0
- package/dist/mcp/schemas.d.ts.map +1 -0
- package/dist/mcp/schemas.js +121 -0
- package/dist/mcp/schemas.js.map +1 -0
- package/dist/mcp/server.d.ts +41 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +204 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/policy/loader.d.ts +27 -0
- package/dist/policy/loader.d.ts.map +1 -0
- package/dist/policy/loader.js +89 -0
- package/dist/policy/loader.js.map +1 -0
- package/dist/policy/team-claude-only.yaml +46 -0
- package/dist/policy/team-codex-only.yaml +46 -0
- package/dist/policy/team-codex.yaml +54 -0
- package/dist/policy/team.yaml +104 -0
- package/dist/toolhook/hookedToolProxy.mjs +118 -0
- package/dist/ui/components/App.d.ts +14 -0
- package/dist/ui/components/App.d.ts.map +1 -0
- package/dist/ui/components/App.js +803 -0
- package/dist/ui/components/App.js.map +1 -0
- package/dist/ui/components/AskPicker.d.ts +8 -0
- package/dist/ui/components/AskPicker.d.ts.map +1 -0
- package/dist/ui/components/AskPicker.js +202 -0
- package/dist/ui/components/AskPicker.js.map +1 -0
- package/dist/ui/components/CommandInput.d.ts +63 -0
- package/dist/ui/components/CommandInput.d.ts.map +1 -0
- package/dist/ui/components/CommandInput.js +994 -0
- package/dist/ui/components/CommandInput.js.map +1 -0
- package/dist/ui/components/DiffView.d.ts +19 -0
- package/dist/ui/components/DiffView.d.ts.map +1 -0
- package/dist/ui/components/DiffView.js +93 -0
- package/dist/ui/components/DiffView.js.map +1 -0
- package/dist/ui/components/Dock.d.ts +49 -0
- package/dist/ui/components/Dock.d.ts.map +1 -0
- package/dist/ui/components/Dock.js +52 -0
- package/dist/ui/components/Dock.js.map +1 -0
- package/dist/ui/components/EventLog.d.ts +42 -0
- package/dist/ui/components/EventLog.d.ts.map +1 -0
- package/dist/ui/components/EventLog.js +450 -0
- package/dist/ui/components/EventLog.js.map +1 -0
- package/dist/ui/components/FileSuggest.d.ts +8 -0
- package/dist/ui/components/FileSuggest.d.ts.map +1 -0
- package/dist/ui/components/FileSuggest.js +19 -0
- package/dist/ui/components/FileSuggest.js.map +1 -0
- package/dist/ui/components/HRule.d.ts +27 -0
- package/dist/ui/components/HRule.d.ts.map +1 -0
- package/dist/ui/components/HRule.js +75 -0
- package/dist/ui/components/HRule.js.map +1 -0
- package/dist/ui/components/HintBar.d.ts +2 -0
- package/dist/ui/components/HintBar.d.ts.map +1 -0
- package/dist/ui/components/HintBar.js +19 -0
- package/dist/ui/components/HintBar.js.map +1 -0
- package/dist/ui/components/MarkdownText.d.ts +13 -0
- package/dist/ui/components/MarkdownText.d.ts.map +1 -0
- package/dist/ui/components/MarkdownText.js +255 -0
- package/dist/ui/components/MarkdownText.js.map +1 -0
- package/dist/ui/components/PermissionPrompt.d.ts +8 -0
- package/dist/ui/components/PermissionPrompt.d.ts.map +1 -0
- package/dist/ui/components/PermissionPrompt.js +37 -0
- package/dist/ui/components/PermissionPrompt.js.map +1 -0
- package/dist/ui/components/SessionPicker.d.ts +16 -0
- package/dist/ui/components/SessionPicker.d.ts.map +1 -0
- package/dist/ui/components/SessionPicker.js +116 -0
- package/dist/ui/components/SessionPicker.js.map +1 -0
- package/dist/ui/components/SlashPalette.d.ts +8 -0
- package/dist/ui/components/SlashPalette.d.ts.map +1 -0
- package/dist/ui/components/SlashPalette.js +41 -0
- package/dist/ui/components/SlashPalette.js.map +1 -0
- package/dist/ui/components/Spinner.d.ts +37 -0
- package/dist/ui/components/Spinner.d.ts.map +1 -0
- package/dist/ui/components/Spinner.js +139 -0
- package/dist/ui/components/Spinner.js.map +1 -0
- package/dist/ui/components/StatusBar.d.ts +92 -0
- package/dist/ui/components/StatusBar.d.ts.map +1 -0
- package/dist/ui/components/StatusBar.js +268 -0
- package/dist/ui/components/StatusBar.js.map +1 -0
- package/dist/ui/components/TabChip.d.ts +11 -0
- package/dist/ui/components/TabChip.d.ts.map +1 -0
- package/dist/ui/components/TabChip.js +23 -0
- package/dist/ui/components/TabChip.js.map +1 -0
- package/dist/ui/components/TeamIndicator.d.ts +6 -0
- package/dist/ui/components/TeamIndicator.d.ts.map +1 -0
- package/dist/ui/components/TeamIndicator.js +17 -0
- package/dist/ui/components/TeamIndicator.js.map +1 -0
- package/dist/ui/components/TeamStatusPanel.d.ts +14 -0
- package/dist/ui/components/TeamStatusPanel.d.ts.map +1 -0
- package/dist/ui/components/TeamStatusPanel.js +65 -0
- package/dist/ui/components/TeamStatusPanel.js.map +1 -0
- package/dist/ui/components/ThinkingBlock.d.ts +10 -0
- package/dist/ui/components/ThinkingBlock.d.ts.map +1 -0
- package/dist/ui/components/ThinkingBlock.js +21 -0
- package/dist/ui/components/ThinkingBlock.js.map +1 -0
- package/dist/ui/components/TodoIndicator.d.ts +11 -0
- package/dist/ui/components/TodoIndicator.d.ts.map +1 -0
- package/dist/ui/components/TodoIndicator.js +37 -0
- package/dist/ui/components/TodoIndicator.js.map +1 -0
- package/dist/ui/components/ToolCallCard.d.ts +16 -0
- package/dist/ui/components/ToolCallCard.d.ts.map +1 -0
- package/dist/ui/components/ToolCallCard.js +195 -0
- package/dist/ui/components/ToolCallCard.js.map +1 -0
- package/dist/ui/components/Welcome.d.ts +8 -0
- package/dist/ui/components/Welcome.d.ts.map +1 -0
- package/dist/ui/components/Welcome.js +53 -0
- package/dist/ui/components/Welcome.js.map +1 -0
- package/dist/ui/cursorState.d.ts +29 -0
- package/dist/ui/cursorState.d.ts.map +1 -0
- package/dist/ui/cursorState.js +49 -0
- package/dist/ui/cursorState.js.map +1 -0
- package/dist/ui/diff.d.ts +34 -0
- package/dist/ui/diff.d.ts.map +1 -0
- package/dist/ui/diff.js +184 -0
- package/dist/ui/diff.js.map +1 -0
- package/dist/ui/diffLang.d.ts +2 -0
- package/dist/ui/diffLang.d.ts.map +1 -0
- package/dist/ui/diffLang.js +36 -0
- package/dist/ui/diffLang.js.map +1 -0
- package/dist/ui/emoji.d.ts +4 -0
- package/dist/ui/emoji.d.ts.map +1 -0
- package/dist/ui/emoji.js +73 -0
- package/dist/ui/emoji.js.map +1 -0
- package/dist/ui/fileMentions.d.ts +41 -0
- package/dist/ui/fileMentions.d.ts.map +1 -0
- package/dist/ui/fileMentions.js +135 -0
- package/dist/ui/fileMentions.js.map +1 -0
- package/dist/ui/hooks/useLineEditor.d.ts +44 -0
- package/dist/ui/hooks/useLineEditor.d.ts.map +1 -0
- package/dist/ui/hooks/useLineEditor.js +142 -0
- package/dist/ui/hooks/useLineEditor.js.map +1 -0
- package/dist/ui/inputHistory.d.ts +8 -0
- package/dist/ui/inputHistory.d.ts.map +1 -0
- package/dist/ui/inputHistory.js +56 -0
- package/dist/ui/inputHistory.js.map +1 -0
- package/dist/ui/jsonrpc.d.ts +17 -0
- package/dist/ui/jsonrpc.d.ts.map +1 -0
- package/dist/ui/jsonrpc.js +41 -0
- package/dist/ui/jsonrpc.js.map +1 -0
- package/dist/ui/launcher.d.ts +20 -0
- package/dist/ui/launcher.d.ts.map +1 -0
- package/dist/ui/launcher.js +185 -0
- package/dist/ui/launcher.js.map +1 -0
- package/dist/ui/markdown.d.ts +104 -0
- package/dist/ui/markdown.d.ts.map +1 -0
- package/dist/ui/markdown.js +449 -0
- package/dist/ui/markdown.js.map +1 -0
- package/dist/ui/mouse.d.ts +22 -0
- package/dist/ui/mouse.d.ts.map +1 -0
- package/dist/ui/mouse.js +31 -0
- package/dist/ui/mouse.js.map +1 -0
- package/dist/ui/outbound.d.ts +20 -0
- package/dist/ui/outbound.d.ts.map +1 -0
- package/dist/ui/outbound.js +49 -0
- package/dist/ui/outbound.js.map +1 -0
- package/dist/ui/screenMode.d.ts +25 -0
- package/dist/ui/screenMode.d.ts.map +1 -0
- package/dist/ui/screenMode.js +43 -0
- package/dist/ui/screenMode.js.map +1 -0
- package/dist/ui/slashCatalog.d.ts +18 -0
- package/dist/ui/slashCatalog.d.ts.map +1 -0
- package/dist/ui/slashCatalog.js +243 -0
- package/dist/ui/slashCatalog.js.map +1 -0
- package/dist/ui/syntax.d.ts +11 -0
- package/dist/ui/syntax.d.ts.map +1 -0
- package/dist/ui/syntax.js +78 -0
- package/dist/ui/syntax.js.map +1 -0
- package/dist/ui/theme.d.ts +165 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +394 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/ui/types.d.ts +203 -0
- package/dist/ui/types.d.ts.map +1 -0
- package/dist/ui/types.js +53 -0
- package/dist/ui/types.js.map +1 -0
- package/package.json +104 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ContinuumManifest } from "./types.js";
|
|
2
|
+
export declare const DEFAULT_DIGEST_THRESHOLD = 50;
|
|
3
|
+
/** Returns true when `manifest.turnCount - manifest.summaryRangeEnd`
|
|
4
|
+
* has grown past the threshold — i.e. enough new conversation has
|
|
5
|
+
* accumulated since the last digest to make another pass worthwhile. */
|
|
6
|
+
export declare function shouldRunDigest(manifest: ContinuumManifest | null, threshold?: number): boolean;
|
|
7
|
+
interface RunDigestResult {
|
|
8
|
+
ran: boolean;
|
|
9
|
+
/** Reason a "ran:false" digest didn't proceed (debugging aid). */
|
|
10
|
+
reason?: string;
|
|
11
|
+
/** Number of turns the summary now covers (i.e. new summaryRangeEnd). */
|
|
12
|
+
turnsCovered?: number;
|
|
13
|
+
/** Length of the summary text produced. */
|
|
14
|
+
summaryChars?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface RunDigestOptions {
|
|
17
|
+
home?: string;
|
|
18
|
+
/** Override the digest model. Defaults to claude-cli/haiku — cheap
|
|
19
|
+
* + fast + works on any project regardless of active team preset. */
|
|
20
|
+
provider?: string;
|
|
21
|
+
model?: string;
|
|
22
|
+
/** Test seam: inject a custom summarizer so tests don't spawn a
|
|
23
|
+
* real claude-cli child. Receives the {role,text}[] and returns
|
|
24
|
+
* the summary string. */
|
|
25
|
+
summarize?: (messages: ReadonlyArray<{
|
|
26
|
+
role: "user" | "assistant";
|
|
27
|
+
text: string;
|
|
28
|
+
}>) => Promise<string>;
|
|
29
|
+
}
|
|
30
|
+
/** Run one digest pass. Idempotent-ish — calling repeatedly without
|
|
31
|
+
* new turns yields `ran:false`. Returns metadata; callers don't need
|
|
32
|
+
* the result for correctness. */
|
|
33
|
+
export declare function runDigest(projectId: string, opts?: RunDigestOptions): Promise<RunDigestResult>;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=digest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"digest.d.ts","sourceRoot":"","sources":["../../../src/core/continuum/digest.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAkB,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpE,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAE3C;;yEAEyE;AACzE,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,iBAAiB,GAAG,IAAI,EAClC,SAAS,GAAE,MAAiC,GAC3C,OAAO,CAIT;AAED,UAAU,eAAe;IACvB,GAAG,EAAE,OAAO,CAAC;IACb,kEAAkE;IAClE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAiBD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;0EACsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;8BAE0B;IAC1B,SAAS,CAAC,EAAE,CACV,QAAQ,EAAE,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,KAClE,OAAO,CAAC,MAAM,CAAC,CAAC;CACtB;AAED;;kCAEkC;AAClC,wBAAsB,SAAS,CAC7B,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,gBAAqB,GAC1B,OAAO,CAAC,eAAe,CAAC,CAqD1B"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// Phase 201e: continuum auto-digest.
|
|
2
|
+
//
|
|
3
|
+
// When the project transcript grows past a threshold of un-digested
|
|
4
|
+
// turns, a background haiku call folds the old block into a single
|
|
5
|
+
// summary on the manifest. The next /model swap that fires
|
|
6
|
+
// buildInjection() picks up the summary automatically, so the new
|
|
7
|
+
// provider sees a paragraph instead of a 100-turn raw dump.
|
|
8
|
+
//
|
|
9
|
+
// Trigger is a fire-and-forget from turn.ts; failure is silent. The
|
|
10
|
+
// digest never blocks a turn, never costs more than one haiku call,
|
|
11
|
+
// and never mutates the jsonl (summary lives only in the manifest).
|
|
12
|
+
import { summarizeMessages } from "../context/summarizer.js";
|
|
13
|
+
import { loadManifest, readRecent, saveManifest } from "./store.js";
|
|
14
|
+
export const DEFAULT_DIGEST_THRESHOLD = 50;
|
|
15
|
+
/** Returns true when `manifest.turnCount - manifest.summaryRangeEnd`
|
|
16
|
+
* has grown past the threshold — i.e. enough new conversation has
|
|
17
|
+
* accumulated since the last digest to make another pass worthwhile. */
|
|
18
|
+
export function shouldRunDigest(manifest, threshold = DEFAULT_DIGEST_THRESHOLD) {
|
|
19
|
+
if (manifest === null)
|
|
20
|
+
return false;
|
|
21
|
+
const undigested = manifest.turnCount - manifest.summaryRangeEnd;
|
|
22
|
+
return undigested >= threshold;
|
|
23
|
+
}
|
|
24
|
+
/** Format raw continuum entries into a {role, text}[] that the
|
|
25
|
+
* `summarizeMessages` helper understands. Skips tool / meta / summary
|
|
26
|
+
* / decision entries — they're not part of the user/assistant flow. */
|
|
27
|
+
function entriesToMessages(entries) {
|
|
28
|
+
const out = [];
|
|
29
|
+
for (const e of entries) {
|
|
30
|
+
if (e.kind === "user")
|
|
31
|
+
out.push({ role: "user", text: e.text });
|
|
32
|
+
else if (e.kind === "assistant")
|
|
33
|
+
out.push({ role: "assistant", text: e.text });
|
|
34
|
+
}
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
/** Run one digest pass. Idempotent-ish — calling repeatedly without
|
|
38
|
+
* new turns yields `ran:false`. Returns metadata; callers don't need
|
|
39
|
+
* the result for correctness. */
|
|
40
|
+
export async function runDigest(projectId, opts = {}) {
|
|
41
|
+
const manifest = loadManifest(projectId, opts.home);
|
|
42
|
+
if (manifest === null) {
|
|
43
|
+
return { ran: false, reason: "no manifest" };
|
|
44
|
+
}
|
|
45
|
+
const undigested = manifest.turnCount - manifest.summaryRangeEnd;
|
|
46
|
+
if (undigested <= 0) {
|
|
47
|
+
return { ran: false, reason: "no new turns" };
|
|
48
|
+
}
|
|
49
|
+
// Pull a generous window. The jsonl has tool/decision/meta lines
|
|
50
|
+
// mixed in, so we over-fetch aggressively and let entriesToMessages
|
|
51
|
+
// filter. The Math.max keeps small projects safe even when their
|
|
52
|
+
// ratio of conversational : non-conversational entries is bad
|
|
53
|
+
// (e.g. lots of tool calls between user/assistant pairs).
|
|
54
|
+
const raw = readRecent(projectId, Math.max(undigested * 5, 50), opts.home);
|
|
55
|
+
const convo = entriesToMessages(raw);
|
|
56
|
+
if (convo.length === 0) {
|
|
57
|
+
return { ran: false, reason: "empty conversation slice" };
|
|
58
|
+
}
|
|
59
|
+
let summary;
|
|
60
|
+
try {
|
|
61
|
+
if (opts.summarize) {
|
|
62
|
+
summary = await opts.summarize(convo);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
summary = await summarizeMessages(convo, (opts.provider ?? "claude-cli"), opts.model ?? "haiku", { disableTools: true, enableSessionResume: false });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return { ran: false, reason: "summarizer threw" };
|
|
70
|
+
}
|
|
71
|
+
summary = summary.trim();
|
|
72
|
+
if (summary.length === 0) {
|
|
73
|
+
return { ran: false, reason: "empty summary" };
|
|
74
|
+
}
|
|
75
|
+
// Race-tolerant: re-load the manifest right before save so a
|
|
76
|
+
// concurrent decision write isn't clobbered.
|
|
77
|
+
const fresh = loadManifest(projectId, opts.home) ?? manifest;
|
|
78
|
+
const updated = {
|
|
79
|
+
...fresh,
|
|
80
|
+
summary,
|
|
81
|
+
summaryRangeEnd: manifest.turnCount,
|
|
82
|
+
lastUpdated: Date.now(),
|
|
83
|
+
};
|
|
84
|
+
saveManifest(updated, opts.home);
|
|
85
|
+
return {
|
|
86
|
+
ran: true,
|
|
87
|
+
turnsCovered: manifest.turnCount,
|
|
88
|
+
summaryChars: summary.length,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=digest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"digest.js","sourceRoot":"","sources":["../../../src/core/continuum/digest.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,EAAE;AACF,oEAAoE;AACpE,mEAAmE;AACnE,2DAA2D;AAC3D,kEAAkE;AAClE,4DAA4D;AAC5D,EAAE;AACF,oEAAoE;AACpE,oEAAoE;AACpE,oEAAoE;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAGpE,MAAM,CAAC,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAE3C;;yEAEyE;AACzE,MAAM,UAAU,eAAe,CAC7B,QAAkC,EAClC,YAAoB,wBAAwB;IAE5C,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACpC,MAAM,UAAU,GAAG,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,eAAe,CAAC;IACjE,OAAO,UAAU,IAAI,SAAS,CAAC;AACjC,CAAC;AAYD;;wEAEwE;AACxE,SAAS,iBAAiB,CACxB,OAAkC;IAElC,MAAM,GAAG,GAAwD,EAAE,CAAC;IACpE,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM;YAAE,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;aAC3D,IAAI,CAAC,CAAC,IAAI,KAAK,WAAW;YAC7B,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAg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AAE,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,CACnD,CAAC;QACJ,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;IACpD,CAAC;IACD,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IACzB,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC;IACjD,CAAC;IACD,6DAA6D;IAC7D,6CAA6C;IAC7C,MAAM,KAAK,GAAG,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC;IAC7D,MAAM,OAAO,GAAsB;QACjC,GAAG,KAAK;QACR,OAAO;QACP,eAAe,EAAE,QAAQ,CAAC,SAAS;QACnC,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE;KACxB,CAAC;IACF,YAAY,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACjC,OAAO;QACL,GAAG,EAAE,IAAI;QACT,YAAY,EAAE,QAAQ,CAAC,SAAS;QAChC,YAAY,EAAE,OAAO,CAAC,MAAM;KAC7B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./types.js";
|
|
2
|
+
export { resolveProjectId, type ProjectId, type ProjectIdMethod, } from "./projectId.js";
|
|
3
|
+
export { continuumDir, jsonlPath, manifestPath, appendEntry, loadManifest, saveManifest, ensureContinuum, appendDecision, bumpTurn, readRecent, } from "./store.js";
|
|
4
|
+
export { buildInjection } from "./inject.js";
|
|
5
|
+
export { shouldRunDigest, runDigest, DEFAULT_DIGEST_THRESHOLD, type RunDigestOptions, } from "./digest.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/continuum/index.ts"],"names":[],"mappings":"AAEA,cAAc,YAAY,CAAC;AAC3B,OAAO,EACL,gBAAgB,EAChB,KAAK,SAAS,EACd,KAAK,eAAe,GACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,cAAc,EACd,QAAQ,EACR,UAAU,GACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,eAAe,EACf,SAAS,EACT,wBAAwB,EACxB,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Phase 201a: continuum module barrel.
|
|
2
|
+
export * from "./types.js";
|
|
3
|
+
export { resolveProjectId, } from "./projectId.js";
|
|
4
|
+
export { continuumDir, jsonlPath, manifestPath, appendEntry, loadManifest, saveManifest, ensureContinuum, appendDecision, bumpTurn, readRecent, } from "./store.js";
|
|
5
|
+
export { buildInjection } from "./inject.js";
|
|
6
|
+
export { shouldRunDigest, runDigest, DEFAULT_DIGEST_THRESHOLD, } from "./digest.js";
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/continuum/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AAEvC,cAAc,YAAY,CAAC;AAC3B,OAAO,EACL,gBAAgB,GAGjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,SAAS,EACT,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,cAAc,EACd,QAAQ,EACR,UAAU,GACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,eAAe,EACf,SAAS,EACT,wBAAwB,GAEzB,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ContinuumInjection } from "./types.js";
|
|
2
|
+
/** Build the continuum injection for a fresh provider on a given
|
|
3
|
+
* project. Returns empty text when the project is brand new (no
|
|
4
|
+
* manifest, no decisions, no turns). */
|
|
5
|
+
export declare function buildInjection(projectId: string, opts?: {
|
|
6
|
+
recentTurns?: number;
|
|
7
|
+
home?: string;
|
|
8
|
+
}): ContinuumInjection;
|
|
9
|
+
//# sourceMappingURL=inject.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject.d.ts","sourceRoot":"","sources":["../../../src/core/continuum/inject.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAEV,kBAAkB,EAEnB,MAAM,YAAY,CAAC;AA8BpB;;yCAEyC;AACzC,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,GACjD,kBAAkB,CAmCpB"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Phase 201d: build the context block prepended to the new adapter's
|
|
2
|
+
// first turn after a provider switch.
|
|
3
|
+
//
|
|
4
|
+
// Composition:
|
|
5
|
+
// - All decisions from the manifest (always; they're small + the most
|
|
6
|
+
// load-bearing knowledge to preserve across providers).
|
|
7
|
+
// - Compressed summary, if a prior digest pass set one (Phase 201e).
|
|
8
|
+
// - The last N raw user/assistant turns verbatim from the jsonl.
|
|
9
|
+
//
|
|
10
|
+
// Wrapped in <omg-continuum> tags so the model sees a clear boundary
|
|
11
|
+
// and can ignore the block when the user's actual prompt starts.
|
|
12
|
+
import { loadManifest, readRecent } from "./store.js";
|
|
13
|
+
const DEFAULT_RECENT_TURNS = 15;
|
|
14
|
+
function formatDecisions(decisions) {
|
|
15
|
+
if (decisions.length === 0)
|
|
16
|
+
return "";
|
|
17
|
+
const lines = decisions.map((d) => {
|
|
18
|
+
const date = new Date(d.ts).toISOString().slice(0, 10);
|
|
19
|
+
return ` - ${date} [${d.source}] ${d.text}`;
|
|
20
|
+
});
|
|
21
|
+
return ["Decisions on record:", ...lines].join("\n");
|
|
22
|
+
}
|
|
23
|
+
function formatRecent(entries) {
|
|
24
|
+
// Only user/assistant turns are useful as recent context; skip tool
|
|
25
|
+
// and meta and summary entries (those duplicate the summary block
|
|
26
|
+
// or aren't conversational).
|
|
27
|
+
const lines = [];
|
|
28
|
+
for (const e of entries) {
|
|
29
|
+
if (e.kind === "user") {
|
|
30
|
+
lines.push(`User: ${e.text}`);
|
|
31
|
+
}
|
|
32
|
+
else if (e.kind === "assistant") {
|
|
33
|
+
const tag = e.model ? `${e.provider}/${e.model}` : e.provider;
|
|
34
|
+
lines.push(`Assistant (${tag}): ${e.text}`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (lines.length === 0)
|
|
38
|
+
return "";
|
|
39
|
+
return ["Recent turns:", ...lines].join("\n\n");
|
|
40
|
+
}
|
|
41
|
+
/** Build the continuum injection for a fresh provider on a given
|
|
42
|
+
* project. Returns empty text when the project is brand new (no
|
|
43
|
+
* manifest, no decisions, no turns). */
|
|
44
|
+
export function buildInjection(projectId, opts = {}) {
|
|
45
|
+
const recentTurns = opts.recentTurns ?? DEFAULT_RECENT_TURNS;
|
|
46
|
+
const manifest = loadManifest(projectId, opts.home);
|
|
47
|
+
if (manifest === null) {
|
|
48
|
+
return { text: "", carriedTurns: 0, carriedDecisions: 0 };
|
|
49
|
+
}
|
|
50
|
+
const decisions = formatDecisions(manifest.decisions);
|
|
51
|
+
const summary = manifest.summary
|
|
52
|
+
? `Summary of earlier turns:\n${manifest.summary}`
|
|
53
|
+
: "";
|
|
54
|
+
// readRecent grabs the last N entries of any kind; the formatter
|
|
55
|
+
// drops non-conversational ones, so over-fetch a little to keep N
|
|
56
|
+
// user/assistant turns even if some tool entries are mixed in.
|
|
57
|
+
const raw = readRecent(projectId, recentTurns * 3, opts.home);
|
|
58
|
+
// Trim back to the last `recentTurns` of user/assistant only.
|
|
59
|
+
const convo = raw.filter((e) => e.kind === "user" || e.kind === "assistant");
|
|
60
|
+
const trimmed = convo.slice(-recentTurns);
|
|
61
|
+
const recent = formatRecent(trimmed);
|
|
62
|
+
const sections = [decisions, summary, recent].filter((s) => s.length > 0);
|
|
63
|
+
if (sections.length === 0) {
|
|
64
|
+
return { text: "", carriedTurns: 0, carriedDecisions: 0 };
|
|
65
|
+
}
|
|
66
|
+
const body = sections.join("\n\n");
|
|
67
|
+
const text = "<omg-continuum>\n" +
|
|
68
|
+
"Carrying conversation context from this project across a provider switch.\n" +
|
|
69
|
+
"Treat this as background; the user's actual prompt follows the closing tag.\n\n" +
|
|
70
|
+
body +
|
|
71
|
+
"\n</omg-continuum>\n\n";
|
|
72
|
+
return {
|
|
73
|
+
text,
|
|
74
|
+
carriedTurns: trimmed.length,
|
|
75
|
+
carriedDecisions: manifest.decisions.length,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=inject.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inject.js","sourceRoot":"","sources":["../../../src/core/continuum/inject.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,EAAE;AACF,eAAe;AACf,wEAAwE;AACxE,4DAA4D;AAC5D,uEAAuE;AACvE,mEAAmE;AACnE,EAAE;AACF,qEAAqE;AACrE,iEAAiE;AAEjE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAOtD,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEhC,SAAS,eAAe,CAAC,SAAoC;IAC3D,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACtC,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC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D,CAAC;IACD,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,IAAI,GACR,mBAAmB;QACnB,6EAA6E;QAC7E,iFAAiF;QACjF,IAAI;QACJ,wBAAwB,CAAC;IAC3B,OAAO;QACL,IAAI;QACJ,YAAY,EAAE,OAAO,CAAC,MAAM;QAC5B,gBAAgB,EAAE,QAAQ,CAAC,SAAS,CAAC,MAAM;KAC5C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type ProjectIdMethod = "file" | "git" | "path";
|
|
2
|
+
export interface ProjectId {
|
|
3
|
+
id: string;
|
|
4
|
+
method: ProjectIdMethod;
|
|
5
|
+
}
|
|
6
|
+
/** Resolve the continuum project id for a given working directory.
|
|
7
|
+
* Never throws — falls back to the abspath hash when both higher
|
|
8
|
+
* signals are missing. */
|
|
9
|
+
export declare function resolveProjectId(cwd: string): ProjectId;
|
|
10
|
+
//# sourceMappingURL=projectId.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projectId.d.ts","sourceRoot":"","sources":["../../../src/core/continuum/projectId.ts"],"names":[],"mappings":"AAeA,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAEtD,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,eAAe,CAAC;CACzB;AAgCD;;2BAE2B;AAC3B,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAavD"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// Phase 201a: project identity resolver for the continuum.
|
|
2
|
+
//
|
|
3
|
+
// Cascade order (most stable → least):
|
|
4
|
+
// 1. <cwd>/.omg/project-id (explicit anchor; commit to repo)
|
|
5
|
+
// 2. git config --get remote.origin.url (stable across renames/moves)
|
|
6
|
+
// 3. SHA1(abspath) (fallback; breaks on move)
|
|
7
|
+
//
|
|
8
|
+
// A short (16-char) hex hash is used so the continuum filename stays
|
|
9
|
+
// filesystem-friendly while still collision-resistant in practice.
|
|
10
|
+
import { execSync } from "node:child_process";
|
|
11
|
+
import { createHash } from "node:crypto";
|
|
12
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
13
|
+
import { join } from "node:path";
|
|
14
|
+
const ID_LENGTH = 16;
|
|
15
|
+
function shortHash(input) {
|
|
16
|
+
return createHash("sha1").update(input).digest("hex").slice(0, ID_LENGTH);
|
|
17
|
+
}
|
|
18
|
+
function tryReadProjectIdFile(cwd) {
|
|
19
|
+
const path = join(cwd, ".omg", "project-id");
|
|
20
|
+
if (!existsSync(path))
|
|
21
|
+
return null;
|
|
22
|
+
try {
|
|
23
|
+
const raw = readFileSync(path, "utf-8").trim();
|
|
24
|
+
return raw.length > 0 ? raw : null;
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function tryGitRemoteUrl(cwd) {
|
|
31
|
+
try {
|
|
32
|
+
const out = execSync("git config --get remote.origin.url", {
|
|
33
|
+
cwd,
|
|
34
|
+
encoding: "utf-8",
|
|
35
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
36
|
+
}).trim();
|
|
37
|
+
return out.length > 0 ? out : null;
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** Resolve the continuum project id for a given working directory.
|
|
44
|
+
* Never throws — falls back to the abspath hash when both higher
|
|
45
|
+
* signals are missing. */
|
|
46
|
+
export function resolveProjectId(cwd) {
|
|
47
|
+
const fileRaw = tryReadProjectIdFile(cwd);
|
|
48
|
+
if (fileRaw !== null) {
|
|
49
|
+
// The id in the file is taken verbatim — the user owns it. Just
|
|
50
|
+
// hash it to enforce a stable filename shape regardless of what
|
|
51
|
+
// characters they used.
|
|
52
|
+
return { id: shortHash(fileRaw), method: "file" };
|
|
53
|
+
}
|
|
54
|
+
const remote = tryGitRemoteUrl(cwd);
|
|
55
|
+
if (remote !== null) {
|
|
56
|
+
return { id: shortHash(remote), method: "git" };
|
|
57
|
+
}
|
|
58
|
+
return { id: shortHash(cwd), method: "path" };
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=projectId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projectId.js","sourceRoot":"","sources":["../../../src/core/continuum/projectId.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,EAAE;AACF,uCAAuC;AACvC,iEAAiE;AACjE,0EAA0E;AAC1E,wEAAwE;AACxE,EAAE;AACF,qEAAqE;AACrE,mEAAmE;AAEnE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AASjC,MAAM,SAAS,GAAG,EAAE,CAAC;AAErB,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;AAC5E,CAAC;AAED,SAAS,oBAAoB,CAAC,GAAW;IACvC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;IAC7C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACnC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;QAC/C,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,GAAW;IAClC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,QAAQ,CAAC,oCAAoC,EAAE;YACzD,GAAG;YACH,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC;SACpC,CAAC,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;2BAE2B;AAC3B,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,MAAM,OAAO,GAAG,oBAAoB,CAAC,GAAG,CAAC,CAAC;IAC1C,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,gEAAgE;QAChE,gEAAgE;QAChE,wBAAwB;QACxB,OAAO,EAAE,EAAE,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACpD,CAAC;IACD,MAAM,MAAM,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;IACpC,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO,EAAE,EAAE,EAAE,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAClD,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ContinuumEntry, type ContinuumManifest, type DecisionRecord } from "./types.js";
|
|
2
|
+
export declare function continuumDir(home?: string): string;
|
|
3
|
+
export declare function jsonlPath(projectId: string, home?: string): string;
|
|
4
|
+
export declare function manifestPath(projectId: string, home?: string): string;
|
|
5
|
+
/** Append one entry as a single line of JSON. Uses appendFileSync
|
|
6
|
+
* (O_APPEND) — atomic at the OS level for these < PIPE_BUF writes. */
|
|
7
|
+
export declare function appendEntry(projectId: string, entry: ContinuumEntry, home?: string): void;
|
|
8
|
+
export declare function loadManifest(projectId: string, home?: string): ContinuumManifest | null;
|
|
9
|
+
export declare function saveManifest(manifest: ContinuumManifest, home?: string): void;
|
|
10
|
+
/** Initialize a manifest for a brand-new continuum. Writes the meta
|
|
11
|
+
* entry to the jsonl and the manifest in one step. Idempotent: if
|
|
12
|
+
* a manifest already exists, returns it untouched. */
|
|
13
|
+
export declare function ensureContinuum(projectId: string, projectIdMethod: ContinuumManifest["projectIdMethod"], home?: string): ContinuumManifest;
|
|
14
|
+
/** Add a decision to the manifest + write the entry to the jsonl in
|
|
15
|
+
* one atomic-feeling step. Returns the updated manifest. */
|
|
16
|
+
export declare function appendDecision(projectId: string, decision: DecisionRecord, home?: string): ContinuumManifest;
|
|
17
|
+
/** Bump turnCount + lastUpdated on the manifest after appending a
|
|
18
|
+
* user/assistant turn pair. The jsonl appends themselves go through
|
|
19
|
+
* appendEntry; this is the manifest bookkeeping. */
|
|
20
|
+
export declare function bumpTurn(projectId: string, home?: string): ContinuumManifest;
|
|
21
|
+
/** Read the most recent `n` entries from the jsonl by tailing from the
|
|
22
|
+
* end. Returns chronological order (oldest first within the slice). */
|
|
23
|
+
export declare function readRecent(projectId: string, n: number, home?: string): ContinuumEntry[];
|
|
24
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/core/continuum/store.ts"],"names":[],"mappings":"AAkBA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AAIp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4
|
+
// plus one read-mostly manifest (~/.omg/continuums/<id>.manifest.json).
|
|
5
|
+
// Writes go through:
|
|
6
|
+
// - appendEntry: append a single ContinuumEntry to the jsonl
|
|
7
|
+
// (POSIX O_APPEND is atomic for the small writes here, no temp-
|
|
8
|
+
// file dance needed for the append path)
|
|
9
|
+
// - saveManifest: atomic rename via the Phase 200b helper.
|
|
10
|
+
//
|
|
11
|
+
// Reads are lazy — the manifest is the fast path; readRecent tails
|
|
12
|
+
// the jsonl byte-by-byte from the end to grab the last N entries
|
|
13
|
+
// without loading the whole file.
|
|
14
|
+
import { appendFileSync, existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
15
|
+
import { homedir } from "node:os";
|
|
16
|
+
import { join } from "node:path";
|
|
17
|
+
import { atomicWriteSync } from "../state/atomicWrite.js";
|
|
18
|
+
import { CONTINUUM_SCHEMA_VERSION, } from "./types.js";
|
|
19
|
+
const DEFAULT_HOME = () => process.env.HOME ?? homedir();
|
|
20
|
+
export function continuumDir(home = DEFAULT_HOME()) {
|
|
21
|
+
return join(home, ".omg", "continuums");
|
|
22
|
+
}
|
|
23
|
+
export function jsonlPath(projectId, home = DEFAULT_HOME()) {
|
|
24
|
+
return join(continuumDir(home), `${projectId}.jsonl`);
|
|
25
|
+
}
|
|
26
|
+
export function manifestPath(projectId, home = DEFAULT_HOME()) {
|
|
27
|
+
return join(continuumDir(home), `${projectId}.manifest.json`);
|
|
28
|
+
}
|
|
29
|
+
function ensureDir(home) {
|
|
30
|
+
const dir = continuumDir(home);
|
|
31
|
+
if (!existsSync(dir))
|
|
32
|
+
mkdirSync(dir, { recursive: true });
|
|
33
|
+
}
|
|
34
|
+
/** Append one entry as a single line of JSON. Uses appendFileSync
|
|
35
|
+
* (O_APPEND) — atomic at the OS level for these < PIPE_BUF writes. */
|
|
36
|
+
export function appendEntry(projectId, entry, home = DEFAULT_HOME()) {
|
|
37
|
+
ensureDir(home);
|
|
38
|
+
appendFileSync(jsonlPath(projectId, home), JSON.stringify(entry) + "\n", "utf-8");
|
|
39
|
+
}
|
|
40
|
+
export function loadManifest(projectId, home = DEFAULT_HOME()) {
|
|
41
|
+
const path = manifestPath(projectId, home);
|
|
42
|
+
if (!existsSync(path))
|
|
43
|
+
return null;
|
|
44
|
+
try {
|
|
45
|
+
const obj = JSON.parse(readFileSync(path, "utf-8"));
|
|
46
|
+
if (obj.version !== CONTINUUM_SCHEMA_VERSION) {
|
|
47
|
+
process.stderr.write(`[omg] unknown continuum manifest schema version ` +
|
|
48
|
+
`${String(obj.version)}; treating ${projectId} as fresh.\n`);
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
return obj;
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export function saveManifest(manifest, home = DEFAULT_HOME()) {
|
|
58
|
+
ensureDir(home);
|
|
59
|
+
atomicWriteSync(manifestPath(manifest.projectId, home), JSON.stringify(manifest, null, 2));
|
|
60
|
+
}
|
|
61
|
+
/** Initialize a manifest for a brand-new continuum. Writes the meta
|
|
62
|
+
* entry to the jsonl and the manifest in one step. Idempotent: if
|
|
63
|
+
* a manifest already exists, returns it untouched. */
|
|
64
|
+
export function ensureContinuum(projectId, projectIdMethod, home = DEFAULT_HOME()) {
|
|
65
|
+
const existing = loadManifest(projectId, home);
|
|
66
|
+
if (existing !== null)
|
|
67
|
+
return existing;
|
|
68
|
+
const now = Date.now();
|
|
69
|
+
const manifest = {
|
|
70
|
+
version: 1,
|
|
71
|
+
projectId,
|
|
72
|
+
projectIdMethod,
|
|
73
|
+
createdAt: now,
|
|
74
|
+
lastUpdated: now,
|
|
75
|
+
turnCount: 0,
|
|
76
|
+
decisions: [],
|
|
77
|
+
summary: "",
|
|
78
|
+
summaryRangeEnd: 0,
|
|
79
|
+
};
|
|
80
|
+
appendEntry(projectId, { version: 1, kind: "meta", projectId, createdAt: now }, home);
|
|
81
|
+
saveManifest(manifest, home);
|
|
82
|
+
return manifest;
|
|
83
|
+
}
|
|
84
|
+
/** Add a decision to the manifest + write the entry to the jsonl in
|
|
85
|
+
* one atomic-feeling step. Returns the updated manifest. */
|
|
86
|
+
export function appendDecision(projectId, decision, home = DEFAULT_HOME()) {
|
|
87
|
+
const current = loadManifest(projectId, home) ?? ensureContinuum(projectId, "path", home);
|
|
88
|
+
appendEntry(projectId, {
|
|
89
|
+
version: 1,
|
|
90
|
+
kind: "decision",
|
|
91
|
+
text: decision.text,
|
|
92
|
+
ts: decision.ts,
|
|
93
|
+
source: decision.source,
|
|
94
|
+
}, home);
|
|
95
|
+
const next = {
|
|
96
|
+
...current,
|
|
97
|
+
lastUpdated: Date.now(),
|
|
98
|
+
decisions: [...current.decisions, decision],
|
|
99
|
+
};
|
|
100
|
+
saveManifest(next, home);
|
|
101
|
+
return next;
|
|
102
|
+
}
|
|
103
|
+
/** Bump turnCount + lastUpdated on the manifest after appending a
|
|
104
|
+
* user/assistant turn pair. The jsonl appends themselves go through
|
|
105
|
+
* appendEntry; this is the manifest bookkeeping. */
|
|
106
|
+
export function bumpTurn(projectId, home = DEFAULT_HOME()) {
|
|
107
|
+
const current = loadManifest(projectId, home) ?? ensureContinuum(projectId, "path", home);
|
|
108
|
+
const next = {
|
|
109
|
+
...current,
|
|
110
|
+
lastUpdated: Date.now(),
|
|
111
|
+
turnCount: current.turnCount + 1,
|
|
112
|
+
};
|
|
113
|
+
saveManifest(next, home);
|
|
114
|
+
return next;
|
|
115
|
+
}
|
|
116
|
+
/** Read the most recent `n` entries from the jsonl by tailing from the
|
|
117
|
+
* end. Returns chronological order (oldest first within the slice). */
|
|
118
|
+
export function readRecent(projectId, n, home = DEFAULT_HOME()) {
|
|
119
|
+
const path = jsonlPath(projectId, home);
|
|
120
|
+
if (!existsSync(path))
|
|
121
|
+
return [];
|
|
122
|
+
if (n <= 0)
|
|
123
|
+
return [];
|
|
124
|
+
// Simple tailing: read the whole file, split by newline, take last n.
|
|
125
|
+
// Files are expected to be small-to-medium (<20MB). A byte-offset
|
|
126
|
+
// tail is a later optimisation if needed.
|
|
127
|
+
const lines = readFileSync(path, "utf-8")
|
|
128
|
+
.split("\n")
|
|
129
|
+
.filter((l) => l.length > 0);
|
|
130
|
+
const out = [];
|
|
131
|
+
const start = Math.max(0, lines.length - n);
|
|
132
|
+
for (let i = start; i < lines.length; i++) {
|
|
133
|
+
try {
|
|
134
|
+
const obj = JSON.parse(lines[i]);
|
|
135
|
+
if (obj.version === CONTINUUM_SCHEMA_VERSION)
|
|
136
|
+
out.push(obj);
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
// Skip a malformed line; not fatal.
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return out;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../../src/core/continuum/store.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,EAAE;AACF,qEAAqE;AACrE,wEAAwE;AACxE,qBAAqB;AACrB,+DAA+D;AAC/D,oEAAoE;AACpE,6CAA6C;AAC7C,6DAA6D;AAC7D,EAAE;AACF,mEAAmE;AACnE,iEAAiE;AACjE,kCAAkC;AAElC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACL,wBAAwB,GAIzB,MAAM,YAAY,CAAC;AAEpB,MAAM,YAAY,GAAG,GAAW,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,OAAO,EAAE,CAAC;AAEjE,MAAM,UAAU,YAAY,CAAC,OAAe,YAAY,EAAE;IACxD,OAAO,IAAI,CAAC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E,IAAI,CAAC,CAAC;IACxC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IACjC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IACtB,sEAAsE;IACtE,kEAAkE;IAClE,0CAA0C;IAC1C,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC;SACtC,KAAK,CAAC,IAAI,CAAC;SACX,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/B,MAAM,GAAG,GAAqB,EAAE,CAAC;IACjC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC5C,KAAK,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC1C,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAmB,CAAC;YACnD,IAAI,GAAG,CAAC,OAAO,KAAK,wBAAwB;gBAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC9D,CAAC;QAAC,MAAM,CAAC;YACP,oCAAoC;QACtC,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export declare const CONTINUUM_SCHEMA_VERSION = 1;
|
|
2
|
+
/** Source of a decision entry — manual slash, model self-record via
|
|
3
|
+
* MCP tool, or auto-curated from a digest pass. */
|
|
4
|
+
export type DecisionSource = "manual" | "model" | "auto";
|
|
5
|
+
/** A line in the .jsonl. Each line is one of these. */
|
|
6
|
+
export type ContinuumEntry = {
|
|
7
|
+
version: 1;
|
|
8
|
+
kind: "meta";
|
|
9
|
+
projectId: string;
|
|
10
|
+
createdAt: number;
|
|
11
|
+
} | {
|
|
12
|
+
version: 1;
|
|
13
|
+
kind: "user";
|
|
14
|
+
text: string;
|
|
15
|
+
ts: number;
|
|
16
|
+
tabName?: string;
|
|
17
|
+
} | {
|
|
18
|
+
version: 1;
|
|
19
|
+
kind: "assistant";
|
|
20
|
+
provider: string;
|
|
21
|
+
model?: string;
|
|
22
|
+
text: string;
|
|
23
|
+
ts: number;
|
|
24
|
+
tabName?: string;
|
|
25
|
+
} | {
|
|
26
|
+
version: 1;
|
|
27
|
+
kind: "tool";
|
|
28
|
+
provider: string;
|
|
29
|
+
name: string;
|
|
30
|
+
input: Record<string, unknown>;
|
|
31
|
+
result?: {
|
|
32
|
+
ok: boolean;
|
|
33
|
+
value: string;
|
|
34
|
+
};
|
|
35
|
+
ts: number;
|
|
36
|
+
tabName?: string;
|
|
37
|
+
} | {
|
|
38
|
+
version: 1;
|
|
39
|
+
kind: "decision";
|
|
40
|
+
text: string;
|
|
41
|
+
ts: number;
|
|
42
|
+
source: DecisionSource;
|
|
43
|
+
tabName?: string;
|
|
44
|
+
} | {
|
|
45
|
+
version: 1;
|
|
46
|
+
kind: "summary";
|
|
47
|
+
rangeStart: number;
|
|
48
|
+
rangeEnd: number;
|
|
49
|
+
text: string;
|
|
50
|
+
ts: number;
|
|
51
|
+
};
|
|
52
|
+
/** Decision view used by manifest + injection. */
|
|
53
|
+
export interface DecisionRecord {
|
|
54
|
+
text: string;
|
|
55
|
+
ts: number;
|
|
56
|
+
source: DecisionSource;
|
|
57
|
+
}
|
|
58
|
+
/** Manifest sits next to the jsonl. It's the read-fast index — start
|
|
59
|
+
* of session reads only this, lazy-loads jsonl on demand. */
|
|
60
|
+
export interface ContinuumManifest {
|
|
61
|
+
version: 1;
|
|
62
|
+
projectId: string;
|
|
63
|
+
/** How the project id was resolved — useful for telling users why
|
|
64
|
+
* their continuum split when a project moved. */
|
|
65
|
+
projectIdMethod: "file" | "git" | "path";
|
|
66
|
+
createdAt: number;
|
|
67
|
+
lastUpdated: number;
|
|
68
|
+
turnCount: number;
|
|
69
|
+
decisions: readonly DecisionRecord[];
|
|
70
|
+
/** Compressed summary of turns up to summaryRangeEnd. Future digest
|
|
71
|
+
* passes update this. Empty string on a fresh continuum. */
|
|
72
|
+
summary: string;
|
|
73
|
+
/** Number of turns that have been folded into `summary`. The jsonl
|
|
74
|
+
* beyond this point is the "recent verbatim" window. */
|
|
75
|
+
summaryRangeEnd: number;
|
|
76
|
+
}
|
|
77
|
+
/** What `/switch-provider` (Phase 201d) feeds to the new adapter on
|
|
78
|
+
* its first turn. Pre-rendered as a single text block. */
|
|
79
|
+
export interface ContinuumInjection {
|
|
80
|
+
/** Composed string ready to prepend to the user's prompt. Empty
|
|
81
|
+
* when there's nothing to carry over (fresh project). */
|
|
82
|
+
text: string;
|
|
83
|
+
/** Counts surfaced to the slash response, e.g. "23 turns carried". */
|
|
84
|
+
carriedTurns: number;
|
|
85
|
+
carriedDecisions: number;
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/continuum/types.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C;oDACoD;AACpD,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAEzD,uDAAuD;AACvD,MAAM,MAAM,cAAc,GACtB;IAAE,OAAO,EAAE,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAClE;IAAE,OAAO,EAAE,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACxE;IACE,OAA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AK,GAAG,MAAM,CAAC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;IACrC;iEAC6D;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB;6DACyD;IACzD,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;2DAC2D;AAC3D,MAAM,WAAW,kBAAkB;IACjC;8DAC0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb,sEAAsE;IACtE,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Phase 201a: Continuum data model.
|
|
2
|
+
//
|
|
3
|
+
// A Continuum is a provider-neutral, project-scoped record of turns,
|
|
4
|
+
// tool calls, decisions, and digest summaries. Lives at
|
|
5
|
+
// ~/.omg/continuums/<project-id>.jsonl (append-only) with a sibling
|
|
6
|
+
// .manifest.json (mutable summary index). Adapters come and go; the
|
|
7
|
+
// continuum carries cross-provider, cross-session knowledge.
|
|
8
|
+
export const CONTINUUM_SCHEMA_VERSION = 1;
|
|
9
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/core/continuum/types.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,EAAE;AACF,qEAAqE;AACrE,wDAAwD;AACxD,oEAAoE;AACpE,oEAAoE;AACpE,6DAA6D;AAE7D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC"}
|