@cchistory/lite 0.6.0 → 0.8.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/INSTALL.md +1 -1
- package/apps/lite-cli/dist/agent-contract.d.ts.map +1 -1
- package/apps/lite-cli/dist/agent-contract.js +41 -9
- package/apps/lite-cli/dist/agent-contract.js.map +1 -1
- package/apps/lite-cli/dist/agent-journeys.test.d.ts +2 -0
- package/apps/lite-cli/dist/agent-journeys.test.d.ts.map +1 -0
- package/apps/lite-cli/dist/agent-journeys.test.js +403 -0
- package/apps/lite-cli/dist/agent-journeys.test.js.map +1 -0
- package/apps/lite-cli/dist/index.d.ts.map +1 -1
- package/apps/lite-cli/dist/index.js +137 -60
- package/apps/lite-cli/dist/index.js.map +1 -1
- package/apps/lite-cli/dist/index.test.js +48 -5
- package/apps/lite-cli/dist/index.test.js.map +1 -1
- package/apps/lite-cli/dist/json-v2.d.ts.map +1 -1
- package/apps/lite-cli/dist/json-v2.js +8 -1
- package/apps/lite-cli/dist/json-v2.js.map +1 -1
- package/apps/lite-cli/dist/query.d.ts +15 -2
- package/apps/lite-cli/dist/query.d.ts.map +1 -1
- package/apps/lite-cli/dist/query.js +79 -4
- package/apps/lite-cli/dist/query.js.map +1 -1
- package/apps/lite-cli/dist/shell.d.ts +2 -1
- package/apps/lite-cli/dist/shell.d.ts.map +1 -1
- package/apps/lite-cli/dist/shell.js +20 -16
- package/apps/lite-cli/dist/shell.js.map +1 -1
- package/apps/lite-cli/dist/stats-command.d.ts +52 -0
- package/apps/lite-cli/dist/stats-command.d.ts.map +1 -0
- package/apps/lite-cli/dist/stats-command.js +322 -0
- package/apps/lite-cli/dist/stats-command.js.map +1 -0
- package/apps/lite-cli/dist/stats-command.test.d.ts +2 -0
- package/apps/lite-cli/dist/stats-command.test.d.ts.map +1 -0
- package/apps/lite-cli/dist/stats-command.test.js +154 -0
- package/apps/lite-cli/dist/stats-command.test.js.map +1 -0
- package/apps/lite-cli/dist/stats-render.d.ts +21 -0
- package/apps/lite-cli/dist/stats-render.d.ts.map +1 -0
- package/apps/lite-cli/dist/stats-render.js +207 -0
- package/apps/lite-cli/dist/stats-render.js.map +1 -0
- package/apps/lite-cli/dist/version.d.ts +1 -1
- package/apps/lite-cli/dist/version.js +1 -1
- package/apps/lite-tui/dist/index.d.ts.map +1 -1
- package/apps/lite-tui/dist/index.js +75 -4
- package/apps/lite-tui/dist/index.js.map +1 -1
- package/apps/lite-tui/dist/input.d.ts.map +1 -1
- package/apps/lite-tui/dist/input.js +124 -3
- package/apps/lite-tui/dist/input.js.map +1 -1
- package/apps/lite-tui/dist/model.d.ts +29 -4
- package/apps/lite-tui/dist/model.d.ts.map +1 -1
- package/apps/lite-tui/dist/model.js +91 -8
- package/apps/lite-tui/dist/model.js.map +1 -1
- package/apps/lite-tui/dist/render.d.ts +1 -1
- package/apps/lite-tui/dist/render.d.ts.map +1 -1
- package/apps/lite-tui/dist/render.js +21 -51
- package/apps/lite-tui/dist/render.js.map +1 -1
- package/apps/lite-tui/dist/state.d.ts +3 -1
- package/apps/lite-tui/dist/state.d.ts.map +1 -1
- package/apps/lite-tui/dist/state.js +31 -13
- package/apps/lite-tui/dist/state.js.map +1 -1
- package/apps/lite-tui/dist/state.test.js +118 -0
- package/apps/lite-tui/dist/state.test.js.map +1 -1
- package/apps/lite-tui/dist/stats-dashboard.test.d.ts +2 -0
- package/apps/lite-tui/dist/stats-dashboard.test.d.ts.map +1 -0
- package/apps/lite-tui/dist/stats-dashboard.test.js +191 -0
- package/apps/lite-tui/dist/stats-dashboard.test.js.map +1 -0
- package/apps/lite-tui/dist/stats-query.d.ts +11 -0
- package/apps/lite-tui/dist/stats-query.d.ts.map +1 -0
- package/apps/lite-tui/dist/stats-query.js +104 -0
- package/apps/lite-tui/dist/stats-query.js.map +1 -0
- package/apps/lite-tui/dist/stats-render.d.ts +9 -0
- package/apps/lite-tui/dist/stats-render.d.ts.map +1 -0
- package/apps/lite-tui/dist/stats-render.js +311 -0
- package/apps/lite-tui/dist/stats-render.js.map +1 -0
- package/apps/lite-tui/dist/stats-state.d.ts +121 -0
- package/apps/lite-tui/dist/stats-state.d.ts.map +1 -0
- package/apps/lite-tui/dist/stats-state.js +335 -0
- package/apps/lite-tui/dist/stats-state.js.map +1 -0
- package/apps/lite-tui/dist/version.d.ts +1 -1
- package/apps/lite-tui/dist/version.js +1 -1
- package/docs/guide/agent-evidence.md +154 -0
- package/docs/guide/for-agents.md +29 -10
- package/docs/guide/lite.md +31 -4
- package/docs/guide/pricing.example.json +38 -0
- package/docs/guide/query.md +10 -1
- package/node_modules/@cchistory/canonical/dist/conversation-evidence.d.ts +85 -0
- package/node_modules/@cchistory/canonical/dist/conversation-evidence.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/conversation-evidence.js +191 -0
- package/node_modules/@cchistory/canonical/dist/conversation-evidence.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/conversation-evidence.test.d.ts +2 -0
- package/node_modules/@cchistory/canonical/dist/conversation-evidence.test.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/conversation-evidence.test.js +105 -0
- package/node_modules/@cchistory/canonical/dist/conversation-evidence.test.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/index.d.ts +9 -2
- package/node_modules/@cchistory/canonical/dist/index.d.ts.map +1 -1
- package/node_modules/@cchistory/canonical/dist/index.js +9 -2
- package/node_modules/@cchistory/canonical/dist/index.js.map +1 -1
- package/node_modules/@cchistory/canonical/dist/index.test.js +62 -1
- package/node_modules/@cchistory/canonical/dist/index.test.js.map +1 -1
- package/node_modules/@cchistory/canonical/dist/model-pricing-catalog.d.ts +11 -0
- package/node_modules/@cchistory/canonical/dist/model-pricing-catalog.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/model-pricing-catalog.js +96 -0
- package/node_modules/@cchistory/canonical/dist/model-pricing-catalog.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/projection-audit.d.ts +4 -3
- package/node_modules/@cchistory/canonical/dist/projection-audit.d.ts.map +1 -1
- package/node_modules/@cchistory/canonical/dist/projection-audit.js +34 -0
- package/node_modules/@cchistory/canonical/dist/projection-audit.js.map +1 -1
- package/node_modules/@cchistory/canonical/dist/query.js +1 -1
- package/node_modules/@cchistory/canonical/dist/query.js.map +1 -1
- package/node_modules/@cchistory/canonical/dist/read-order.d.ts +2 -0
- package/node_modules/@cchistory/canonical/dist/read-order.d.ts.map +1 -1
- package/node_modules/@cchistory/canonical/dist/read-order.js +10 -0
- package/node_modules/@cchistory/canonical/dist/read-order.js.map +1 -1
- package/node_modules/@cchistory/canonical/dist/read-status.d.ts +11 -0
- package/node_modules/@cchistory/canonical/dist/read-status.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/read-status.js +14 -0
- package/node_modules/@cchistory/canonical/dist/read-status.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/session-family.js +3 -3
- package/node_modules/@cchistory/canonical/dist/session-family.js.map +1 -1
- package/node_modules/@cchistory/canonical/dist/session-interpreter.d.ts +7 -3
- package/node_modules/@cchistory/canonical/dist/session-interpreter.d.ts.map +1 -1
- package/node_modules/@cchistory/canonical/dist/session-interpreter.js +40 -14
- package/node_modules/@cchistory/canonical/dist/session-interpreter.js.map +1 -1
- package/node_modules/@cchistory/canonical/dist/usage-breakdown.d.ts +37 -0
- package/node_modules/@cchistory/canonical/dist/usage-breakdown.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/usage-breakdown.js +274 -0
- package/node_modules/@cchistory/canonical/dist/usage-breakdown.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/usage-pricing-config.d.ts +11 -0
- package/node_modules/@cchistory/canonical/dist/usage-pricing-config.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/usage-pricing-config.js +297 -0
- package/node_modules/@cchistory/canonical/dist/usage-pricing-config.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/usage-pricing.d.ts +28 -0
- package/node_modules/@cchistory/canonical/dist/usage-pricing.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/usage-pricing.js +267 -0
- package/node_modules/@cchistory/canonical/dist/usage-pricing.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/usage-pricing.test.d.ts +2 -0
- package/node_modules/@cchistory/canonical/dist/usage-pricing.test.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/usage-pricing.test.js +365 -0
- package/node_modules/@cchistory/canonical/dist/usage-pricing.test.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/usage-time.d.ts +53 -0
- package/node_modules/@cchistory/canonical/dist/usage-time.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/usage-time.js +323 -0
- package/node_modules/@cchistory/canonical/dist/usage-time.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/usage.d.ts +46 -31
- package/node_modules/@cchistory/canonical/dist/usage.d.ts.map +1 -1
- package/node_modules/@cchistory/canonical/dist/usage.js +187 -96
- package/node_modules/@cchistory/canonical/dist/usage.js.map +1 -1
- package/node_modules/@cchistory/canonical/package.json +1 -1
- package/node_modules/@cchistory/domain/dist/conversation-evidence.d.ts +24 -0
- package/node_modules/@cchistory/domain/dist/conversation-evidence.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/conversation-evidence.js +2 -0
- package/node_modules/@cchistory/domain/dist/conversation-evidence.js.map +1 -0
- package/node_modules/@cchistory/domain/dist/index.d.ts +27 -2
- package/node_modules/@cchistory/domain/dist/index.d.ts.map +1 -1
- package/node_modules/@cchistory/domain/dist/index.js +1 -0
- package/node_modules/@cchistory/domain/dist/index.js.map +1 -1
- package/node_modules/@cchistory/domain/dist/usage-pricing.d.ts +145 -0
- package/node_modules/@cchistory/domain/dist/usage-pricing.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/usage-pricing.js +7 -0
- package/node_modules/@cchistory/domain/dist/usage-pricing.js.map +1 -0
- package/node_modules/@cchistory/domain/package.json +1 -1
- package/node_modules/@cchistory/live-runtime/dist/antigravity.test.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/antigravity.test.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/antigravity.test.js +104 -0
- package/node_modules/@cchistory/live-runtime/dist/antigravity.test.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/bounded-cache.d.ts +15 -0
- package/node_modules/@cchistory/live-runtime/dist/bounded-cache.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/bounded-cache.js +44 -0
- package/node_modules/@cchistory/live-runtime/dist/bounded-cache.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/bounded-cache.test.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/bounded-cache.test.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/bounded-cache.test.js +45 -0
- package/node_modules/@cchistory/live-runtime/dist/bounded-cache.test.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/diagnostics.d.ts +7 -0
- package/node_modules/@cchistory/live-runtime/dist/diagnostics.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/diagnostics.js +2 -0
- package/node_modules/@cchistory/live-runtime/dist/diagnostics.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/grok-bot.test.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/grok-bot.test.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/grok-bot.test.js +211 -0
- package/node_modules/@cchistory/live-runtime/dist/grok-bot.test.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/history-reader.d.ts +24 -0
- package/node_modules/@cchistory/live-runtime/dist/history-reader.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/history-reader.js +155 -0
- package/node_modules/@cchistory/live-runtime/dist/history-reader.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/index.d.ts +102 -5
- package/node_modules/@cchistory/live-runtime/dist/index.d.ts.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/index.js +245 -58
- package/node_modules/@cchistory/live-runtime/dist/index.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/index.test.js +43 -2
- package/node_modules/@cchistory/live-runtime/dist/index.test.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/selective-query.d.ts +2 -1
- package/node_modules/@cchistory/live-runtime/dist/selective-query.d.ts.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/selective-query.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/package.json +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/atomizer.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/atomizer.js +10 -0
- package/node_modules/@cchistory/source-adapters/dist/core/atomizer.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/conversation-seeds.d.ts +7 -0
- package/node_modules/@cchistory/source-adapters/dist/core/conversation-seeds.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/conversation-seeds.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/decoded-record.d.ts +12 -0
- package/node_modules/@cchistory/source-adapters/dist/core/decoded-record.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/decoded-record.js +32 -0
- package/node_modules/@cchistory/source-adapters/dist/core/decoded-record.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/decoded-record.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/core/decoded-record.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/decoded-record.test.js +21 -0
- package/node_modules/@cchistory/source-adapters/dist/core/decoded-record.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/discovery.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/discovery.js +16 -2
- package/node_modules/@cchistory/source-adapters/dist/core/discovery.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.d.ts +3 -1
- package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.js +56 -38
- package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.test.js +46 -1
- package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/parser.d.ts +15 -4
- package/node_modules/@cchistory/source-adapters/dist/core/parser.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/parser.js +181 -65
- package/node_modules/@cchistory/source-adapters/dist/core/parser.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/probe.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/probe.js +223 -61
- package/node_modules/@cchistory/source-adapters/dist/core/probe.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.d.ts +4 -1
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.js +4 -2
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.test.js +58 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/registry.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/core/registry.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/source-identity.d.ts +6 -2
- package/node_modules/@cchistory/source-adapters/dist/core/source-identity.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/source-identity.js +16 -5
- package/node_modules/@cchistory/source-adapters/dist/core/source-identity.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/types.d.ts +5 -2
- package/node_modules/@cchistory/source-adapters/dist/core/types.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/user-text.d.ts +9 -7
- package/node_modules/@cchistory/source-adapters/dist/core/user-text.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/user-text.js +34 -8
- package/node_modules/@cchistory/source-adapters/dist/core/user-text.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/utils.test.js +11 -0
- package/node_modules/@cchistory/source-adapters/dist/core/utils.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/index.test.d.ts +3 -0
- package/node_modules/@cchistory/source-adapters/dist/index.test.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/index.test.js +3 -0
- package/node_modules/@cchistory/source-adapters/dist/index.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/amp.test.js +49 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/amp.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/live.d.ts +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/live.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/live.js +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/live.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/protobuf.d.ts +18 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/protobuf.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/protobuf.js +105 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/protobuf.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/sqlite.d.ts +8 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/sqlite.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/sqlite.js +227 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/sqlite.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/usage.d.ts +6 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/usage.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/usage.js +22 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity/usage.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity-sqlite.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity-sqlite.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity-sqlite.test.js +145 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity-sqlite.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.d.ts +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.js +14 -5
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot/runtime.d.ts +27 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot/runtime.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot/runtime.js +262 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot/runtime.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot/title.d.ts +18 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot/title.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot/title.js +101 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot/title.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot.d.ts +17 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot.js +145 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot.test.js +423 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok-bot.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/registry.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/registry.js +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/registry.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/types.d.ts +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/types.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/types.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/types.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.js +48 -29
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/package.json +1 -1
- package/package.json +5 -5
- package/schemas/cchistory-lite-agent-v1.schema.json +8 -5
- package/schemas/cchistory-lite-canonical-v1.schema.json +82 -0
- package/schemas/cchistory-lite-diagnostic-v1.schema.json +27 -0
- package/schemas/cchistory-lite-query-result-v2.schema.json +232 -4
- package/schemas/cchistory-lite-query-result-v3.schema.json +45 -1
- package/schemas/cchistory-lite-query-v2.schema.json +150 -8
- package/schemas/cchistory-lite-v2.schema.json +82 -0
- package/skills/using-cchistory-lite/SKILL.md +86 -128
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import os from "node:os";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { readFile, stat } from "node:fs/promises";
|
|
4
|
-
import { deriveHostId, selectTailBlob } from "@cchistory/domain";
|
|
4
|
+
import { deriveHostId, isConversationActivityAtom, selectTailBlob } from "@cchistory/domain";
|
|
5
5
|
import { nowIso, stableId, pathExists, formatErrorMessage, createLossAudit, dedupeById, listSourceFiles, readGitProjectEvidence, deriveSessionId, extractSourceSessionIdFromCanonicalSessionId, buildSourceResumeCommand, minIso, maxIso, sha1, compareTimeThenSeq, collapseAntigravityUserTurnAtoms, } from "./utils.js";
|
|
6
6
|
import { getDefaultSources, resolveSourceFormatProfile } from "./discovery.js";
|
|
7
7
|
import { extractAntigravityLiveSeeds } from "../platforms/antigravity/live.js";
|
|
8
|
-
import { isAntigravityBrainSourceFile, isAntigravityHistoryIndexFile } from "../platforms/antigravity.js";
|
|
8
|
+
import { isAntigravityBrainSourceFile, isAntigravityHistoryIndexFile, isAntigravityConversationDatabase } from "../platforms/antigravity.js";
|
|
9
9
|
import { extractCursorChatStoreSeed, clearCursorWorkspaceIndexCache } from "../platforms/cursor/runtime.js";
|
|
10
10
|
import { getPlatformAdapter } from "../platforms/registry.js";
|
|
11
|
+
import { isGrokBotStorePath, isGrokBotTranscriptPath, parseGrokBotAgentIdFromPath } from "../platforms/grok-bot.js";
|
|
11
12
|
import { deriveSourceFileLogicalSessionKey, inspectSourceFileLogicalSessionMetadata, SESSION_METADATA_MAX_LINE_BYTES, } from "./session-grouping.js";
|
|
12
|
-
import { extractRecords, extractMultiSessionSeeds, buildAdapterBlobResult, captureBlob, captureBlobStreaming, fileIdentityFromStats, parseRecord, isOrdinaryResumeEligibleSourceFile, extractGenericSessionMetadata, extractGenericRole, extractGenericContentItems, extractRichTextText, collectConversationSeedsFromValue, dedupeClaudeCodeTokenUsageFragments, } from "./parser.js";
|
|
13
|
+
import { extractRecords, extractMultiSessionSeeds, iterateZcodeSeeds, buildAdapterBlobResult, createAdapterBlobBuilder, captureBlob, captureBlobStreaming, fileIdentityFromStats, parseRecord, isOrdinaryResumeEligibleSourceFile, extractGenericSessionMetadata, extractGenericRole, extractGenericContentItems, extractRichTextText, collectConversationSeedsFromValue, dedupeClaudeCodeTokenUsageFragments, } from "./parser.js";
|
|
13
14
|
import { collectJsonlRecordsStreaming, isIncrementalJsonlPlatform } from "./jsonl-records.js";
|
|
14
15
|
import { atomizeFragments, hydrateDraftFromAtoms } from "./atomizer.js";
|
|
15
16
|
import { splitUserText } from "./user-text.js";
|
|
@@ -121,11 +122,15 @@ async function finalizeSourcePayload(interpretSession, state, host, options) {
|
|
|
121
122
|
message: `Deriving projections from ${state.sessionsById.size} session candidate(s)`,
|
|
122
123
|
});
|
|
123
124
|
const deriveStartedAt = Date.now();
|
|
124
|
-
const processingCore = await processCollectedSessions(interpretSession, state.
|
|
125
|
+
const processingCore = await processCollectedSessions(interpretSession, state.source.platform === "antigravity" && options.target_session_refs?.length
|
|
126
|
+
? selectAntigravityTargetInputs(state.sessionsById, options.target_session_refs) : state.sessionsById, state.orphanBlobs, state.lossAudits, { safeMode: options.safe_mode ?? false, retainRawRecords: options.retain_raw_records !== false,
|
|
127
|
+
onInterpretedSession: count => emitProbeProgress(options, state.source, { stage: "derive_progress", count, count_unit: "sessions" }),
|
|
128
|
+
});
|
|
125
129
|
emitProbeProgress(options, state.source, {
|
|
126
130
|
stage: "derive_done",
|
|
127
131
|
message: `Derived ${processingCore.sessions.length} session(s), ${processingCore.turns.length} turn(s)`,
|
|
128
132
|
count: processingCore.turns.length,
|
|
133
|
+
count_unit: "turns",
|
|
129
134
|
elapsed_ms: Date.now() - deriveStartedAt,
|
|
130
135
|
});
|
|
131
136
|
const uniqueBlobs = dedupeById(processingCore.blobs);
|
|
@@ -182,6 +187,7 @@ async function finalizeSourcePayload(interpretSession, state, host, options) {
|
|
|
182
187
|
stage: "source_done",
|
|
183
188
|
message: `Finished ${state.source.display_name}`,
|
|
184
189
|
count: processingCore.turns.length,
|
|
190
|
+
count_unit: "turns",
|
|
185
191
|
elapsed_ms: Date.now() - state.monotonicStartedAt,
|
|
186
192
|
});
|
|
187
193
|
return payload;
|
|
@@ -294,11 +300,65 @@ export async function projectFileSessionInputs(interpretSession, source, session
|
|
|
294
300
|
async function* streamCollectedFileInputs(source, host, sourceFormatProfile, options, startedAt) {
|
|
295
301
|
const captureRunId = stableId("capture-run", source.id, startedAt);
|
|
296
302
|
const adapter = getPlatformAdapter(source.platform);
|
|
297
|
-
const
|
|
303
|
+
const previousPayload = options.previous_payloads?.[source.id];
|
|
304
|
+
const previousIndex = previousPayload?.records.some(record => record.raw_text_retained === false)
|
|
305
|
+
? undefined : buildPreviousSourceIndex(previousPayload, sourceFormatProfile);
|
|
298
306
|
const changedSinceMs = parseChangedSinceMs(options.changed_since);
|
|
299
307
|
const capturedCompanionPaths = new Set();
|
|
300
308
|
let remainingFileLimit = options.limit_files_per_source;
|
|
301
|
-
|
|
309
|
+
const sqliteSessionIds = new Set();
|
|
310
|
+
emitProbeProgress(options, source, {
|
|
311
|
+
stage: "list_files_start",
|
|
312
|
+
message: `Listing source files under ${source.base_dir}`,
|
|
313
|
+
});
|
|
314
|
+
const listFilesStartedAt = Date.now();
|
|
315
|
+
const readPlan = options.source_file_plans?.[source.id] ?? options.source_file_plans?.[source.slot_id];
|
|
316
|
+
const selectedFiles = options.source_file_paths?.[source.id] ?? options.source_file_paths?.[source.slot_id] ?? readPlan?.files;
|
|
317
|
+
const listedFiles = selectedFiles
|
|
318
|
+
? [...selectedFiles].slice(0, remainingFileLimit)
|
|
319
|
+
: await listSourceFiles(source.platform, source.base_dir, remainingFileLimit);
|
|
320
|
+
const files = options.target_session_refs?.length && !selectedFiles
|
|
321
|
+
? await selectTargetSourceFiles(source, adapter, listedFiles, options.target_session_refs)
|
|
322
|
+
: listedFiles;
|
|
323
|
+
emitProbeProgress(options, source, {
|
|
324
|
+
stage: "list_files_done",
|
|
325
|
+
message: `Found ${files.length} source file(s)`,
|
|
326
|
+
count: files.length,
|
|
327
|
+
count_unit: "files",
|
|
328
|
+
file_count: files.length,
|
|
329
|
+
elapsed_ms: Date.now() - listFilesStartedAt,
|
|
330
|
+
});
|
|
331
|
+
const preferredGrokBotAgents = new Set();
|
|
332
|
+
for (const [fileIndex, filePath] of files.entries()) {
|
|
333
|
+
const grokBotAgentId = source.platform === "grok_bot" ? parseGrokBotAgentIdFromPath(filePath) : undefined;
|
|
334
|
+
if (grokBotAgentId && isGrokBotTranscriptPath(filePath) && preferredGrokBotAgents.has(grokBotAgentId)) {
|
|
335
|
+
emitProbeProgress(options, source, {
|
|
336
|
+
stage: "file_skip",
|
|
337
|
+
message: `Skipped duplicate Grok Bot transcript after parsing store conversation: ${filePath}`,
|
|
338
|
+
file_path: filePath,
|
|
339
|
+
file_index: fileIndex + 1,
|
|
340
|
+
file_count: files.length,
|
|
341
|
+
});
|
|
342
|
+
yield { originPath: filePath, sessionInputs: [], orphanBlobs: [], lossAudits: [],
|
|
343
|
+
trustedBytesByBlobId: new Map(), skipReason: "superseded" };
|
|
344
|
+
continue;
|
|
345
|
+
}
|
|
346
|
+
for await (const collected of streamSingleFileInputs(source, host, sourceFormatProfile, options, captureRunId, adapter, previousIndex, changedSinceMs, capturedCompanionPaths, filePath, fileIndex, files.length)) {
|
|
347
|
+
if (grokBotAgentId && isGrokBotStorePath(filePath) && collected.sessionInputs.some(hasGrokBotStoreConversation)) {
|
|
348
|
+
preferredGrokBotAgents.add(grokBotAgentId);
|
|
349
|
+
}
|
|
350
|
+
if (source.platform === "antigravity" && isAntigravityConversationDatabase(filePath)) {
|
|
351
|
+
for (const input of collected.sessionInputs)
|
|
352
|
+
if (hasAntigravitySqliteConversation(input)) {
|
|
353
|
+
sqliteSessionIds.add(input.draft.id.replace(/^sess:antigravity:/u, ""));
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
yield collected;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
if (remainingFileLimit !== undefined)
|
|
360
|
+
remainingFileLimit = Math.max(remainingFileLimit - files.length, 0);
|
|
361
|
+
if (source.platform === "antigravity" && !options.safe_mode && remainingFileLimit !== 0) {
|
|
302
362
|
emitProbeProgress(options, source, {
|
|
303
363
|
stage: "live_probe_start",
|
|
304
364
|
message: "Reading Antigravity live trajectory API",
|
|
@@ -306,6 +366,7 @@ async function* streamCollectedFileInputs(source, host, sourceFormatProfile, opt
|
|
|
306
366
|
const liveCollection = await extractAntigravityLiveSeeds(source.base_dir, {
|
|
307
367
|
limit: remainingFileLimit,
|
|
308
368
|
sessionRefs: options.target_session_refs,
|
|
369
|
+
excludeCascadeIds: [...sqliteSessionIds],
|
|
309
370
|
});
|
|
310
371
|
if (liveCollection) {
|
|
311
372
|
for (const [index, seed] of liveCollection.seeds.entries()) {
|
|
@@ -329,31 +390,9 @@ async function* streamCollectedFileInputs(source, host, sourceFormatProfile, opt
|
|
|
329
390
|
stage: "live_probe_done",
|
|
330
391
|
message: `Collected ${liveCollection?.virtualPaths.length ?? 0} live item(s)`,
|
|
331
392
|
count: liveCollection?.virtualPaths.length ?? 0,
|
|
393
|
+
count_unit: "files",
|
|
332
394
|
});
|
|
333
395
|
}
|
|
334
|
-
emitProbeProgress(options, source, {
|
|
335
|
-
stage: "list_files_start",
|
|
336
|
-
message: `Listing source files under ${source.base_dir}`,
|
|
337
|
-
});
|
|
338
|
-
const listFilesStartedAt = Date.now();
|
|
339
|
-
const readPlan = options.source_file_plans?.[source.id] ?? options.source_file_plans?.[source.slot_id];
|
|
340
|
-
const selectedFiles = options.source_file_paths?.[source.id] ?? options.source_file_paths?.[source.slot_id] ?? readPlan?.files;
|
|
341
|
-
const listedFiles = selectedFiles
|
|
342
|
-
? [...selectedFiles].slice(0, remainingFileLimit)
|
|
343
|
-
: await listSourceFiles(source.platform, source.base_dir, remainingFileLimit);
|
|
344
|
-
const files = options.target_session_refs?.length && !selectedFiles
|
|
345
|
-
? await selectTargetSourceFiles(source, adapter, listedFiles, options.target_session_refs)
|
|
346
|
-
: listedFiles;
|
|
347
|
-
emitProbeProgress(options, source, {
|
|
348
|
-
stage: "list_files_done",
|
|
349
|
-
message: `Found ${files.length} source file(s)`,
|
|
350
|
-
count: files.length,
|
|
351
|
-
file_count: files.length,
|
|
352
|
-
elapsed_ms: Date.now() - listFilesStartedAt,
|
|
353
|
-
});
|
|
354
|
-
for (const [fileIndex, filePath] of files.entries()) {
|
|
355
|
-
yield* streamSingleFileInputs(source, host, sourceFormatProfile, options, captureRunId, adapter, previousIndex, changedSinceMs, capturedCompanionPaths, filePath, fileIndex, files.length);
|
|
356
|
-
}
|
|
357
396
|
}
|
|
358
397
|
async function* streamSingleFileInputs(source, host, sourceFormatProfile, options, captureRunId, adapter, previousIndex, changedSinceMs, capturedCompanionPaths, filePath, fileIndex, fileCount) {
|
|
359
398
|
let capturedBlob;
|
|
@@ -383,9 +422,13 @@ async function* streamSingleFileInputs(source, host, sourceFormatProfile, option
|
|
|
383
422
|
const isOversized = sizeBytes > maxFileBytes;
|
|
384
423
|
// Oversized files are skipped only when parsing needs the whole file in
|
|
385
424
|
// memory. Incremental JSONL streams; path-backed SQLite is opened by path.
|
|
386
|
-
const canProcessOversizedWithoutMaterializing = isOversized &&
|
|
425
|
+
const canProcessOversizedWithoutMaterializing = (isOversized || options.retain_raw_records === false &&
|
|
426
|
+
(sizeBytes > 8 * 1024 * 1024 || sizeBytes > (options.read_budget?.maximumUnitBytes?.() ?? Infinity))) &&
|
|
387
427
|
(isIncrementalJsonlPlatform(source.platform) || isPathBackedSqliteSourceFile(source.platform, filePath));
|
|
388
|
-
|
|
428
|
+
// An explicit cap remains binding. Guarded whole-file readers already price
|
|
429
|
+
// the actual allocation against live headroom; the fallback cap is not RAM capacity.
|
|
430
|
+
const hasAllocationAdmission = options.max_file_bytes === undefined && options.read_budget?.maximumUnitBytes !== undefined;
|
|
431
|
+
if (isOversized && !canProcessOversizedWithoutMaterializing && !hasAllocationAdmission) {
|
|
389
432
|
const detail = `Skipped oversized source file ${filePath}: ${sizeBytes} bytes exceeds ${maxFileBytes} byte limit`;
|
|
390
433
|
const blobRef = stableId("blob", source.id, filePath, "oversized");
|
|
391
434
|
fileLossAudits.push(createLossAudit(source.id, blobRef, "unknown_fragment", detail, {
|
|
@@ -444,7 +487,7 @@ async function* streamSingleFileInputs(source, host, sourceFormatProfile, option
|
|
|
444
487
|
capturedBlob = isPathBackedSqliteSourceFile(source.platform, filePath)
|
|
445
488
|
? await capturePathBackedBlob(source, host.id, filePath, captureRunId)
|
|
446
489
|
: canProcessOversizedWithoutMaterializing
|
|
447
|
-
? await captureBlobStreaming(source, host.id, filePath, captureRunId, options.read_budget)
|
|
490
|
+
? await captureBlobStreaming(source, host.id, filePath, captureRunId, options.read_budget, options.retain_raw_records === false)
|
|
448
491
|
: await captureBlob(source, host.id, filePath, captureRunId, options.read_budget);
|
|
449
492
|
emitProbeProgress(options, source, {
|
|
450
493
|
stage: "file_capture_done",
|
|
@@ -572,13 +615,13 @@ async function* streamSingleFileInputs(source, host, sourceFormatProfile, option
|
|
|
572
615
|
}
|
|
573
616
|
const adapterResults = appendedResults ?? (capturedBlob
|
|
574
617
|
? (capturedBlobHasFileBuffer(capturedBlob)
|
|
575
|
-
? await processBlob(source, sourceFormatProfile, filePath, capturedBlob, options.target_session_refs, options.read_budget)
|
|
618
|
+
? await processBlob(source, sourceFormatProfile, filePath, capturedBlob, options.target_session_refs, options.read_budget, options.retain_raw_records !== false)
|
|
576
619
|
: capturedBlobIsStreaming(capturedBlob)
|
|
577
|
-
? await processStreamingJsonlBlob(source, sourceFormatProfile, filePath, capturedBlob)
|
|
578
|
-
: await processPathBackedSqliteBlob(source, sourceFormatProfile, filePath, capturedBlob.blob, options.target_session_refs, options.read_budget))
|
|
620
|
+
? await processStreamingJsonlBlob(source, sourceFormatProfile, filePath, capturedBlob, options)
|
|
621
|
+
: await processPathBackedSqliteBlob(source, sourceFormatProfile, filePath, capturedBlob.blob, options.target_session_refs, options.read_budget, options.retain_raw_records !== false, count => emitProbeProgress(options, source, { stage: "file_parse_progress", file_path: filePath, count, count_unit: "sessions" })))
|
|
579
622
|
: []);
|
|
580
623
|
const sessionsById = new Map();
|
|
581
|
-
const targetedResults = options.target_session_refs?.length
|
|
624
|
+
const targetedResults = source.platform !== "antigravity" && options.target_session_refs?.length
|
|
582
625
|
? adapterResults.filter((result) => options.target_session_refs.some((ref) => targetRefMatchesSession(ref, result.draft.id, result.draft.source_session_id)) || resultReferencesTargetSession(source, result, options.target_session_refs))
|
|
583
626
|
: adapterResults;
|
|
584
627
|
for (const adapterResult of targetedResults) {
|
|
@@ -716,20 +759,27 @@ async function selectTargetSourceFiles(source, adapter, files, sessionRefs) {
|
|
|
716
759
|
function isMultiSessionContainer(platform, filePath) {
|
|
717
760
|
const basename = path.basename(filePath);
|
|
718
761
|
if (platform === "antigravity" &&
|
|
719
|
-
(isAntigravityHistoryIndexFile(filePath) || isAntigravityBrainSourceFile(filePath)
|
|
762
|
+
(isAntigravityHistoryIndexFile(filePath) || isAntigravityBrainSourceFile(filePath) ||
|
|
763
|
+
isAntigravityConversationDatabase(filePath) || basename === "conversation_summaries.db")) {
|
|
720
764
|
return true;
|
|
721
765
|
}
|
|
722
766
|
return ((platform === "openclaw" && isOpenClawCronRunFile(filePath)) ||
|
|
723
767
|
platform === "zcode" ||
|
|
724
768
|
platform === "lobechat" ||
|
|
769
|
+
(platform === "grok_bot" && basename === "store.db") ||
|
|
725
770
|
((platform === "cursor" || platform === "antigravity") &&
|
|
726
771
|
(basename === "state.vscdb" || basename === "store.db")));
|
|
727
772
|
}
|
|
728
773
|
function isPathBackedSqliteSourceFile(platform, filePath) {
|
|
729
774
|
const basename = path.basename(filePath);
|
|
775
|
+
if (platform === "antigravity" && (isAntigravityConversationDatabase(filePath) || basename === "conversation_summaries.db"))
|
|
776
|
+
return true;
|
|
730
777
|
if (platform === "zcode") {
|
|
731
778
|
return basename === "db.sqlite";
|
|
732
779
|
}
|
|
780
|
+
if (platform === "grok_bot") {
|
|
781
|
+
return basename === "store.db";
|
|
782
|
+
}
|
|
733
783
|
return ((platform === "cursor" || platform === "antigravity") &&
|
|
734
784
|
(basename === "state.vscdb" || basename === "store.db"));
|
|
735
785
|
}
|
|
@@ -832,7 +882,11 @@ function mergeSessionBuildInput(sessionsById, sessionInput) {
|
|
|
832
882
|
incomingHasComposer &&
|
|
833
883
|
currentHasTranscript &&
|
|
834
884
|
!currentHasComposer;
|
|
835
|
-
|
|
885
|
+
const preferIncomingGrokBotMeta = current.draft.source_platform === "grok_bot" &&
|
|
886
|
+
(hasGrokBotStoreConversation(sessionInput) ||
|
|
887
|
+
(!hasGrokBotStoreConversation(current) && sessionInput.blobs.some(blob => isGrokBotTranscriptPath(blob.origin_path))));
|
|
888
|
+
const preferIncomingMeta = preferIncomingComposerMeta || preferIncomingGrokBotMeta;
|
|
889
|
+
if (preferIncomingMeta) {
|
|
836
890
|
current.draft.title = sessionInput.draft.title ?? current.draft.title;
|
|
837
891
|
current.draft.canonical_title = sessionInput.draft.canonical_title ?? current.draft.canonical_title;
|
|
838
892
|
current.draft.working_directory = sessionInput.draft.working_directory ?? current.draft.working_directory;
|
|
@@ -845,7 +899,7 @@ function mergeSessionBuildInput(sessionsById, sessionInput) {
|
|
|
845
899
|
else if (current.draft.title === sessionInput.draft.title) {
|
|
846
900
|
current.draft.canonical_title = current.draft.canonical_title ?? sessionInput.draft.canonical_title;
|
|
847
901
|
}
|
|
848
|
-
if (!
|
|
902
|
+
if (!preferIncomingMeta) {
|
|
849
903
|
current.draft.working_directory = current.draft.working_directory ?? sessionInput.draft.working_directory;
|
|
850
904
|
current.draft.model = current.draft.model ?? sessionInput.draft.model;
|
|
851
905
|
}
|
|
@@ -858,6 +912,8 @@ function mergeSessionBuildInput(sessionsById, sessionInput) {
|
|
|
858
912
|
current.draft.created_at = minIso(current.draft.created_at, sessionInput.draft.created_at);
|
|
859
913
|
current.draft.updated_at = maxIso(current.draft.updated_at, sessionInput.draft.updated_at);
|
|
860
914
|
suppressOverlappingCursorConversation(current);
|
|
915
|
+
suppressOverlappingGrokBotConversation(current);
|
|
916
|
+
suppressOverlappingAntigravityConversation(current);
|
|
861
917
|
return;
|
|
862
918
|
}
|
|
863
919
|
sessionsById.set(sessionInput.draft.id, {
|
|
@@ -870,6 +926,52 @@ function mergeSessionBuildInput(sessionsById, sessionInput) {
|
|
|
870
926
|
loss_audits: [...sessionInput.loss_audits],
|
|
871
927
|
});
|
|
872
928
|
}
|
|
929
|
+
function hasAntigravitySqliteConversation(session) {
|
|
930
|
+
const databaseBlobs = new Set(session.blobs.filter(blob => isAntigravityConversationDatabase(blob.origin_path)).map(blob => blob.id));
|
|
931
|
+
const databaseRecords = new Set(session.records.filter(record => databaseBlobs.has(record.blob_id)).map(record => record.id));
|
|
932
|
+
return session.fragments.some(fragment => databaseRecords.has(fragment.record_id) && fragment.fragment_kind === "text" &&
|
|
933
|
+
(fragment.payload.actor_kind === "user" || fragment.payload.actor_kind === "assistant"));
|
|
934
|
+
}
|
|
935
|
+
function selectAntigravityTargetInputs(inputs, refs) {
|
|
936
|
+
const selected = new Set([...inputs.keys()].filter(id => refs.some(ref => targetRefMatchesSession(ref, id))));
|
|
937
|
+
// Reconcile shared summary metadata before narrowing an explicitly recorded
|
|
938
|
+
// session family. File-local filtering can discard a child's title first.
|
|
939
|
+
let changed = true;
|
|
940
|
+
while (changed) {
|
|
941
|
+
changed = false;
|
|
942
|
+
for (const [id, input] of inputs) {
|
|
943
|
+
if (selected.has(id))
|
|
944
|
+
continue;
|
|
945
|
+
if (input.fragments.some(fragment => fragment.fragment_kind === "session_relation" &&
|
|
946
|
+
typeof fragment.payload.parent_uuid === "string" && selected.has(`sess:antigravity:${fragment.payload.parent_uuid}`))) {
|
|
947
|
+
selected.add(id);
|
|
948
|
+
changed = true;
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
return new Map([...inputs].filter(([id]) => selected.has(id)));
|
|
953
|
+
}
|
|
954
|
+
function suppressOverlappingAntigravityConversation(session) {
|
|
955
|
+
if (session.draft.source_platform !== "antigravity" || !hasAntigravitySqliteConversation(session))
|
|
956
|
+
return;
|
|
957
|
+
const legacyBlobs = new Set(session.blobs.filter(blob => !isAntigravityConversationDatabase(blob.origin_path)).map(blob => blob.id));
|
|
958
|
+
const legacyRecords = new Set(session.records.filter(record => legacyBlobs.has(record.blob_id)).map(record => record.id));
|
|
959
|
+
// Offline descriptions are recovered prompts. With native conversation evidence
|
|
960
|
+
// present, retain them as source context while the SQLite steps own user turns.
|
|
961
|
+
for (const fragment of session.fragments) {
|
|
962
|
+
if (legacyRecords.has(fragment.record_id) && fragment.fragment_kind === "text" && fragment.payload.actor_kind === "user") {
|
|
963
|
+
fragment.payload = { ...fragment.payload, actor_kind: "system", origin_kind: "source_instruction", display_policy: "collapse" };
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
const legacyFragments = new Set(session.fragments.filter(fragment => legacyRecords.has(fragment.record_id)).map(fragment => fragment.id));
|
|
967
|
+
for (const atom of session.atoms) {
|
|
968
|
+
if (atom.actor_kind === "user" && atom.fragment_refs.some(ref => legacyFragments.has(ref))) {
|
|
969
|
+
atom.actor_kind = "system";
|
|
970
|
+
atom.origin_kind = "source_instruction";
|
|
971
|
+
atom.display_policy = "collapse";
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
}
|
|
873
975
|
function sessionInputHasCursorTranscript(sessionInput) {
|
|
874
976
|
return sessionInput.blobs.some((blob) => isCursorAgentTranscriptPath(blob.origin_path));
|
|
875
977
|
}
|
|
@@ -912,6 +1014,37 @@ function suppressOverlappingCursorConversation(session) {
|
|
|
912
1014
|
}
|
|
913
1015
|
}
|
|
914
1016
|
}
|
|
1017
|
+
function hasGrokBotStoreConversation(session) {
|
|
1018
|
+
if (session.draft.source_platform !== "grok_bot")
|
|
1019
|
+
return false;
|
|
1020
|
+
const storeBlobIds = new Set(session.blobs.filter(blob => isGrokBotStorePath(blob.origin_path)).map(blob => blob.id));
|
|
1021
|
+
const storeRecordIds = new Set(session.records.filter(record => storeBlobIds.has(record.blob_id)).map(record => record.id));
|
|
1022
|
+
const storeFragmentIds = new Set(session.fragments.filter(fragment => storeRecordIds.has(fragment.record_id)).map(fragment => fragment.id));
|
|
1023
|
+
return session.atoms.some(atom => isConversationActivityAtom(atom) &&
|
|
1024
|
+
atom.fragment_refs.some(ref => storeFragmentIds.has(ref)));
|
|
1025
|
+
}
|
|
1026
|
+
function suppressOverlappingGrokBotConversation(session) {
|
|
1027
|
+
if (session.draft.source_platform !== "grok_bot") {
|
|
1028
|
+
return;
|
|
1029
|
+
}
|
|
1030
|
+
const storeBlobIds = new Set(session.blobs
|
|
1031
|
+
.filter((blob) => {
|
|
1032
|
+
const normalized = blob.origin_path.replace(/\\/g, "/");
|
|
1033
|
+
return path.basename(blob.origin_path) === "store.db" && normalized.includes("/agents/");
|
|
1034
|
+
})
|
|
1035
|
+
.map((blob) => blob.id));
|
|
1036
|
+
const transcriptBlobIds = new Set(session.blobs
|
|
1037
|
+
.filter((blob) => {
|
|
1038
|
+
const normalized = blob.origin_path.replace(/\\/g, "/");
|
|
1039
|
+
return normalized.includes("/agent-transcripts/") && normalized.endsWith(".jsonl");
|
|
1040
|
+
})
|
|
1041
|
+
.map((blob) => blob.id));
|
|
1042
|
+
if (storeBlobIds.size === 0 || transcriptBlobIds.size === 0 || !hasGrokBotStoreConversation(session)) {
|
|
1043
|
+
return;
|
|
1044
|
+
}
|
|
1045
|
+
// Prefer store.db when both shapes are present for the same agent session.
|
|
1046
|
+
dropCursorConversationRecords(session, transcriptBlobIds, { keepMeta: false });
|
|
1047
|
+
}
|
|
915
1048
|
function collapseOverlappingCursorComposerConversations(session) {
|
|
916
1049
|
const composerBlobs = session.blobs.filter((blob) => path.basename(blob.origin_path) === "state.vscdb");
|
|
917
1050
|
if (composerBlobs.length < 2) {
|
|
@@ -1534,8 +1667,13 @@ async function processCollectedSessions(interpretSession, sessionsById, orphanBl
|
|
|
1534
1667
|
}
|
|
1535
1668
|
}
|
|
1536
1669
|
for (const sessionInput of sessionsById.values()) {
|
|
1670
|
+
if (options.retainRawRecords === false) {
|
|
1671
|
+
sessionInput.records = sessionInput.records.map(record => record.raw_text_retained === false ? record : {
|
|
1672
|
+
...record, raw_size_bytes: Buffer.byteLength(record.raw_json, "utf8"), raw_json: "", raw_text_retained: false,
|
|
1673
|
+
});
|
|
1674
|
+
}
|
|
1537
1675
|
sessionInput.atoms.sort(compareTimeThenSeq);
|
|
1538
|
-
if (sessionInput.draft.source_platform === "antigravity") {
|
|
1676
|
+
if (sessionInput.draft.source_platform === "antigravity" && !hasAntigravitySqliteConversation(sessionInput)) {
|
|
1539
1677
|
sessionInput.atoms = collapseAntigravityUserTurnAtoms(sessionInput.atoms);
|
|
1540
1678
|
}
|
|
1541
1679
|
const gitProjectEvidence = options.safeMode
|
|
@@ -1555,6 +1693,7 @@ async function processCollectedSessions(interpretSession, sessionsById, orphanBl
|
|
|
1555
1693
|
askUserQuestionTurns.push(...buildAskUserQuestionTurns(sessionInput.draft, sessionInput.atoms, sessionInput.edges));
|
|
1556
1694
|
}
|
|
1557
1695
|
lossAudits.push(...sessionInput.loss_audits);
|
|
1696
|
+
options.onInterpretedSession?.(sessions.length);
|
|
1558
1697
|
}
|
|
1559
1698
|
blobs.push(...orphanBlobs);
|
|
1560
1699
|
lossAudits.push(...sourceLossAudits);
|
|
@@ -1581,10 +1720,10 @@ function emitProbeProgress(options, source, event) {
|
|
|
1581
1720
|
...event,
|
|
1582
1721
|
});
|
|
1583
1722
|
}
|
|
1584
|
-
async function processPathBackedSqliteBlob(source, sourceFormatProfile, filePath, blob, targetSessionRefs, budget) {
|
|
1585
|
-
return (await tryProcessPathOpenedContainer(source, sourceFormatProfile, filePath, blob, Buffer.alloc(0), targetSessionRefs, budget)) ?? [];
|
|
1723
|
+
async function processPathBackedSqliteBlob(source, sourceFormatProfile, filePath, blob, targetSessionRefs, budget, retainRawRecords = true, onSession) {
|
|
1724
|
+
return (await tryProcessPathOpenedContainer(source, sourceFormatProfile, filePath, blob, Buffer.alloc(0), targetSessionRefs, budget, retainRawRecords, onSession)) ?? [];
|
|
1586
1725
|
}
|
|
1587
|
-
async function tryProcessPathOpenedContainer(source, sourceFormatProfile, filePath, blob, fileBuffer, targetSessionRefs, budget) {
|
|
1726
|
+
async function tryProcessPathOpenedContainer(source, sourceFormatProfile, filePath, blob, fileBuffer, targetSessionRefs, budget, retainRawRecords = true, onSession) {
|
|
1588
1727
|
const blobId = blob.id;
|
|
1589
1728
|
if (source.platform === "cursor" && path.basename(filePath) === "store.db") {
|
|
1590
1729
|
const chatStoreSeed = await extractCursorChatStoreSeed(source.platform, filePath, blob.file_modified_at ?? nowIso(), {
|
|
@@ -1640,12 +1779,16 @@ async function tryProcessPathOpenedContainer(source, sourceFormatProfile, filePa
|
|
|
1640
1779
|
}
|
|
1641
1780
|
return [];
|
|
1642
1781
|
}
|
|
1643
|
-
const multiSessionSeeds =
|
|
1782
|
+
const multiSessionSeeds = source.platform === "zcode"
|
|
1783
|
+
? iterateZcodeSeeds(source, filePath, targetSessionRefs, budget, retainRawRecords)
|
|
1784
|
+
: await extractMultiSessionSeeds(source, filePath, fileBuffer, blobId, targetSessionRefs, budget);
|
|
1644
1785
|
if (!multiSessionSeeds) {
|
|
1645
1786
|
return undefined;
|
|
1646
1787
|
}
|
|
1647
1788
|
const results = [];
|
|
1648
|
-
for (const seed of multiSessionSeeds
|
|
1789
|
+
for (const seed of multiSessionSeeds) {
|
|
1790
|
+
if (source.platform !== "antigravity" && targetSessionRefs?.length && !targetSessionRefs.some(ref => targetRefMatchesSession(ref, seed.sessionId)))
|
|
1791
|
+
continue;
|
|
1649
1792
|
results.push(buildAdapterBlobResult(source, sourceFormatProfile, blob.host_id, filePath, blob.capture_run_id, blob, seed.sessionId, seed.records.map((record, ordinal) => ({
|
|
1650
1793
|
id: stableId("record", source.id, seed.sessionId, blobId, String(ordinal), record.pointer),
|
|
1651
1794
|
source_id: source.id,
|
|
@@ -1656,17 +1799,23 @@ async function tryProcessPathOpenedContainer(source, sourceFormatProfile, filePa
|
|
|
1656
1799
|
observed_at: record.observedAt ?? nowIso(),
|
|
1657
1800
|
parseable: true,
|
|
1658
1801
|
raw_json: record.rawJson,
|
|
1802
|
+
...(record.parsedValue ? { parsed_value: record.parsedValue, raw_size_bytes: record.rawSizeBytes,
|
|
1803
|
+
raw_text_retained: false } : {}),
|
|
1659
1804
|
})), {
|
|
1660
1805
|
title: seed.title,
|
|
1661
1806
|
created_at: seed.createdAt,
|
|
1662
1807
|
updated_at: seed.updatedAt,
|
|
1663
1808
|
model: seed.model,
|
|
1664
1809
|
working_directory: seed.workingDirectory,
|
|
1665
|
-
})
|
|
1810
|
+
}, (seed.diagnostics ?? []).map(diagnostic => createLossAudit(source.id, blobId, "unknown_fragment", diagnostic.detail, {
|
|
1811
|
+
stageKind: "extract_records", diagnosticCode: diagnostic.code, severity: "warning",
|
|
1812
|
+
sessionRef: seed.sessionId, blobRef: blobId, sourceFormatProfileId: sourceFormatProfile.id,
|
|
1813
|
+
})), retainRawRecords));
|
|
1814
|
+
onSession?.(results.length);
|
|
1666
1815
|
}
|
|
1667
1816
|
return results;
|
|
1668
1817
|
}
|
|
1669
|
-
async function processBlob(source, sourceFormatProfile, filePath, capturedBlob, targetSessionRefs, budget) {
|
|
1818
|
+
async function processBlob(source, sourceFormatProfile, filePath, capturedBlob, targetSessionRefs, budget, retainRawRecords = true) {
|
|
1670
1819
|
const { blob, fileBuffer } = capturedBlob;
|
|
1671
1820
|
const pathOpened = await tryProcessPathOpenedContainer(source, sourceFormatProfile, filePath, blob, fileBuffer, targetSessionRefs, budget);
|
|
1672
1821
|
if (pathOpened) {
|
|
@@ -1674,7 +1823,16 @@ async function processBlob(source, sourceFormatProfile, filePath, capturedBlob,
|
|
|
1674
1823
|
}
|
|
1675
1824
|
const blobId = blob.id;
|
|
1676
1825
|
const profileId = sourceFormatProfile.id;
|
|
1677
|
-
|
|
1826
|
+
let decodedRoot;
|
|
1827
|
+
if (source.platform === "amp") {
|
|
1828
|
+
try {
|
|
1829
|
+
decodedRoot = { value: JSON.parse(fileBuffer.toString("utf8")) };
|
|
1830
|
+
}
|
|
1831
|
+
catch {
|
|
1832
|
+
decodedRoot = { value: undefined };
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
const sessionId = deriveSessionId(source.platform, filePath, fileBuffer, decodedRoot);
|
|
1678
1836
|
if (targetSessionRefs?.length &&
|
|
1679
1837
|
source.platform !== "codex" &&
|
|
1680
1838
|
!targetSessionRefs.some((ref) => targetRefMatchesSession(ref, sessionId)) &&
|
|
@@ -1689,7 +1847,7 @@ async function processBlob(source, sourceFormatProfile, filePath, capturedBlob,
|
|
|
1689
1847
|
sessionId,
|
|
1690
1848
|
captureRunId: blob.capture_run_id,
|
|
1691
1849
|
};
|
|
1692
|
-
const records = await extractRecords(context, blobId, fileBuffer);
|
|
1850
|
+
const records = await extractRecords(context, blobId, fileBuffer, retainRawRecords, decodedRoot);
|
|
1693
1851
|
const extractionLossAudits = [];
|
|
1694
1852
|
if (records.length === 0) {
|
|
1695
1853
|
extractionLossAudits.push(createLossAudit(source.id, blobId, "dropped_for_projection", "Blob was captured but produced no raw records", {
|
|
@@ -1729,26 +1887,30 @@ async function processBlob(source, sourceFormatProfile, filePath, capturedBlob,
|
|
|
1729
1887
|
// captured from file identity (metadata-only) and opened by path via
|
|
1730
1888
|
// processPathBackedSqliteBlob instead of being hashed into memory.
|
|
1731
1889
|
// AMP root-JSON, Gemini, and other non-JSONL shapes still take the oversized skip.
|
|
1732
|
-
async function processStreamingJsonlBlob(source, sourceFormatProfile, filePath, capturedBlob) {
|
|
1890
|
+
async function processStreamingJsonlBlob(source, sourceFormatProfile, filePath, capturedBlob, options = {}) {
|
|
1733
1891
|
const { blob } = capturedBlob;
|
|
1734
1892
|
const blobId = blob.id;
|
|
1735
1893
|
const profileId = sourceFormatProfile.id;
|
|
1736
1894
|
const head = await capturedBlob.prefixReader(SESSION_METADATA_MAX_LINE_BYTES);
|
|
1737
1895
|
const sessionId = deriveSessionId(source.platform, filePath, head);
|
|
1738
|
-
const
|
|
1739
|
-
|
|
1740
|
-
hostId: blob.host_id,
|
|
1741
|
-
filePath,
|
|
1742
|
-
profileId,
|
|
1743
|
-
sessionId,
|
|
1744
|
-
captureRunId: blob.capture_run_id,
|
|
1745
|
-
};
|
|
1896
|
+
const builder = createAdapterBlobBuilder(source, sourceFormatProfile, blob.host_id, filePath, blob.capture_run_id, blob, sessionId, {}, [], options.retain_raw_records !== false);
|
|
1897
|
+
let parsedRecords = 0;
|
|
1746
1898
|
const records = await collectJsonlRecordsStreaming(capturedBlob.streamingLineReader(), {
|
|
1747
1899
|
sourceId: source.id,
|
|
1748
1900
|
blobId,
|
|
1749
1901
|
sessionId,
|
|
1750
1902
|
}, {
|
|
1751
1903
|
observedAt: nowIso(),
|
|
1904
|
+
transformRecord: record => {
|
|
1905
|
+
const retained = builder.append(record);
|
|
1906
|
+
if (++parsedRecords % 256 === 0)
|
|
1907
|
+
emitProbeProgress(options, source, {
|
|
1908
|
+
stage: "file_parse_progress", file_path: filePath, count: parsedRecords, count_unit: "records",
|
|
1909
|
+
});
|
|
1910
|
+
return retained;
|
|
1911
|
+
},
|
|
1912
|
+
admitLineBytes: options.retain_raw_records === false
|
|
1913
|
+
? bytes => options.read_budget?.admit(bytes, `${filePath}:JSONL record`) : undefined,
|
|
1752
1914
|
sidecars: source.platform === "factory_droid"
|
|
1753
1915
|
? [
|
|
1754
1916
|
{
|
|
@@ -1788,9 +1950,9 @@ async function processStreamingJsonlBlob(source, sourceFormatProfile, filePath,
|
|
|
1788
1950
|
sourceFormatProfileId: profileId,
|
|
1789
1951
|
}));
|
|
1790
1952
|
}
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
];
|
|
1953
|
+
const result = builder.finish();
|
|
1954
|
+
result.loss_audits.push(...extractionLossAudits);
|
|
1955
|
+
return [result];
|
|
1794
1956
|
}
|
|
1795
1957
|
function buildSyntheticSeedAdapterResult(source, sourceFormatProfile, hostId, captureRunId, originPath, seed) {
|
|
1796
1958
|
const serializedSeed = JSON.stringify(seed.records);
|