@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
package/INSTALL.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-contract.d.ts","sourceRoot":"","sources":["../src/agent-contract.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,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};
|
|
25
|
+
const DIAGNOSTICS = {
|
|
26
|
+
name: "--diagnostics", kind: "boolean",
|
|
27
|
+
summary: "Optional structured read progress, resource decisions and cache reuse on stderr; stdout is unchanged",
|
|
28
|
+
};
|
|
25
29
|
const JSON_FLAG = {
|
|
26
30
|
name: "--json",
|
|
27
31
|
kind: "boolean",
|
|
@@ -44,7 +48,7 @@ const NO_DIR = {
|
|
|
44
48
|
summary: "Disable the working-directory filter (overrides the cwd default). Estimates every selected source root",
|
|
45
49
|
};
|
|
46
50
|
function buildCommands() {
|
|
47
|
-
const scanFlags = [SOURCE_ROOT, SOURCE, LIMIT_FILES, SAFE, JSON_FLAG];
|
|
51
|
+
const scanFlags = [SOURCE_ROOT, SOURCE, LIMIT_FILES, SAFE, DIAGNOSTICS, JSON_FLAG];
|
|
48
52
|
return {
|
|
49
53
|
sources: {
|
|
50
54
|
name: "sources",
|
|
@@ -109,25 +113,48 @@ function buildCommands() {
|
|
|
109
113
|
},
|
|
110
114
|
stats: {
|
|
111
115
|
name: "stats",
|
|
112
|
-
summary: "
|
|
113
|
-
usage: "cchistory-lite stats [--by source|project|model|day] [--project <ref>] [--dir <path>] [options]",
|
|
116
|
+
summary: "Multi-dimensional Project × Model × Source × Time token, cost, multiplier, and quota aggregation",
|
|
117
|
+
usage: "cchistory-lite stats [--by source|project|model|day|week|month[,...]] [--project <ref>] [--model <pattern>] [--since <window>] [--from <time>] [--to <time>] [--dir <path>] [options]",
|
|
114
118
|
flags: [
|
|
115
119
|
...scanFlags,
|
|
116
|
-
{
|
|
117
|
-
|
|
120
|
+
{
|
|
121
|
+
name: "--by",
|
|
122
|
+
kind: "value",
|
|
123
|
+
repeatable: true,
|
|
124
|
+
values: ["source", "project", "model", "day", "week", "month"],
|
|
125
|
+
summary: "Roll up or matrix-group usage by one or comma-separated dimensions (e.g. project,model,source,day)",
|
|
126
|
+
},
|
|
127
|
+
{ name: "--project", kind: "value", repeatable: true, summary: "Scope to one or more projects (pass unassigned for unlinked usage)" },
|
|
128
|
+
{ name: "--model", kind: "value", repeatable: true, summary: "Filter to models matching substring/name (repeatable)" },
|
|
129
|
+
{ name: "--since", kind: "value", summary: "Relative window: all, today, 24h, 7d, 30d, week, month, Nd, Nh" },
|
|
130
|
+
{ name: "--from", kind: "value", summary: "Start boundary (YYYY-MM-DD, ISO timestamp, or relative preset)" },
|
|
131
|
+
{ name: "--to", kind: "value", summary: "End boundary (YYYY-MM-DD inclusive in timezone, or ISO timestamp)" },
|
|
132
|
+
{ name: "--tz", kind: "value", default: "local", summary: "IANA timezone or local/UTC for day/week/month buckets" },
|
|
133
|
+
{ name: "--week-mode", kind: "value", values: ["rolling_7d", "iso_week", "custom_reset"], default: "rolling_7d", summary: "Weekly bucket and quota reset boundary mode" },
|
|
134
|
+
{ name: "--sort", kind: "value", values: ["adjusted_cost", "list_cost", "tokens", "turns", "label"], default: "adjusted_cost", summary: "Sort order for multi-dimension matrix rows" },
|
|
135
|
+
{ name: "--pricing", kind: "value", repeatable: true, summary: "Local JSON pricing/multiplier/quota file (cchistory-lite-pricing/v1 or models.dev api.json)" },
|
|
136
|
+
{ name: "--alias", kind: "value", repeatable: true, summary: "Map a local model name to a catalog model (<raw>=<target>)" },
|
|
137
|
+
{ name: "--multiplier", kind: "value", repeatable: true, summary: "Overall cost multiplier (<model>=<factor> or <factor> for default)" },
|
|
138
|
+
{ name: "--cache-read-multiplier", kind: "value", repeatable: true, summary: "Cache-read cost multiplier (<model>=<factor> or <factor>)" },
|
|
139
|
+
{ name: "--cache-write-multiplier", kind: "value", repeatable: true, summary: "Cache-write cost multiplier (<model>=<factor> or <factor>)" },
|
|
140
|
+
{ name: "--quota", kind: "value", summary: "Period quota limit in USD for quota % comparison" },
|
|
141
|
+
{ name: "--explain-pricing", kind: "boolean", summary: "Include per-model catalog match, unit $/1M prices, and active multipliers" },
|
|
142
|
+
{ name: "--export-pricing", kind: "value", summary: "Write an editable cchistory-lite-pricing/v1 template with observed models to <file> or -" },
|
|
118
143
|
DIR,
|
|
119
144
|
NO_DIR,
|
|
120
145
|
],
|
|
146
|
+
notes: "Defaults to --dir=$PWD; pass --no-dir for machine-wide spend and quota reconciliation. Uses bundled offline models.dev reference prices plus local --pricing / CCHISTORY_PRICING_CONFIG overrides; never fetches network at runtime.",
|
|
121
147
|
},
|
|
122
148
|
query: {
|
|
123
149
|
name: "query",
|
|
124
|
-
summary: "
|
|
150
|
+
summary: "Read bounded conversation evidence, search answers, or query canonical rows; JSON-only",
|
|
125
151
|
usage: "cchistory-lite query --request <file|-> | --sql <text> | --sql-file <file|-> [options]",
|
|
126
152
|
flags: [
|
|
127
153
|
SOURCE_ROOT,
|
|
128
154
|
SOURCE,
|
|
129
155
|
LIMIT_FILES,
|
|
130
156
|
SAFE,
|
|
157
|
+
DIAGNOSTICS,
|
|
131
158
|
{ ...JSON_NO_CANONICAL, summary: "Accepted; query output is always JSON. =canonical is rejected." },
|
|
132
159
|
{ name: "--request", kind: "value", summary: "JSON batch query request (v2 operations or v3 SQL); - reads stdin" },
|
|
133
160
|
{ name: "--sql", kind: "value", summary: "Finite SELECT over sessions or turns; explicit LIMIT required" },
|
|
@@ -137,14 +164,14 @@ function buildCommands() {
|
|
|
137
164
|
DIR,
|
|
138
165
|
NO_DIR,
|
|
139
166
|
],
|
|
140
|
-
notes: "
|
|
167
|
+
notes: "v2 operations include read (exactly one session_ref or turn_ref; max_chars 256–64000, default 8000; limit 1–100, default 20; cursor for continuation) and search with content: conversation (full masked user/reply text including delegated work; bounded excerpts). Use group_by: message to page older matches within a session; default session grouping is unchanged. read_status summarizes known gaps separately from SQL coverage. SQL validates before scanning; LIMIT bounds rows, not scan work. Operation errors exit 1 with other results intact. See docs/guide/agent-evidence.md.",
|
|
141
168
|
},
|
|
142
169
|
shell: {
|
|
143
170
|
name: "shell",
|
|
144
171
|
summary: "Hold one directory-scoped snapshot for SQL and commands over JSON-lines or a human REPL",
|
|
145
172
|
usage: "cchistory-lite shell [--dir <path>] [options]",
|
|
146
173
|
flags: [...scanFlags, DIR, NO_DIR, { name: "--idle-timeout", kind: "value", default: "300", summary: "Idle expiry in seconds; 0 disables it (maximum 86400)" }],
|
|
147
|
-
notes: "Opening does not scan
|
|
174
|
+
notes: "Opening does not scan. JSON-lines mode with --json or non-TTY stdin. Send {kind: read, session_ref: <id>} to read bounded questions and answers. Conversation search prepares masked text once. Details reuse up to four snapshots under a 16 MiB retained-data estimate; oversized entries are not cached. read.id/prepared_at identify each read. Successful refresh replaces the collection and clears details; failed refresh preserves them. Exit, EOF, and idle expiry release all snapshots.",
|
|
148
175
|
},
|
|
149
176
|
export: {
|
|
150
177
|
name: "export",
|
|
@@ -155,6 +182,7 @@ function buildCommands() {
|
|
|
155
182
|
SOURCE,
|
|
156
183
|
LIMIT_FILES,
|
|
157
184
|
SAFE,
|
|
185
|
+
DIAGNOSTICS,
|
|
158
186
|
{ ...JSON_NO_CANONICAL, summary: "Accepted; export encoding comes from --format. =canonical is rejected." },
|
|
159
187
|
{ name: "--format", kind: "value", values: ["jsonl", "json", "markdown"], default: "jsonl", summary: "Export encoding" },
|
|
160
188
|
{ name: "--out", kind: "value", default: "-", summary: "Export destination; - writes stdout" },
|
|
@@ -169,6 +197,8 @@ function buildCommands() {
|
|
|
169
197
|
SOURCE,
|
|
170
198
|
LIMIT_FILES,
|
|
171
199
|
SAFE,
|
|
200
|
+
{ name: "--pricing", kind: "value", repeatable: true, summary: "Local JSON pricing/multiplier/quota file forwarded to TUI stats" },
|
|
201
|
+
{ name: "--quota", kind: "value", summary: "Initial period quota limit in USD forwarded to TUI stats" },
|
|
172
202
|
{ ...JSON_FLAG, summary: "Accepted for script compatibility; the TUI is interactive and ignores it." },
|
|
173
203
|
],
|
|
174
204
|
},
|
|
@@ -212,8 +242,10 @@ export function buildAgentContract(version) {
|
|
|
212
242
|
{ name: "FORCE_COLOR", effect: "Force ANSI color in the TUI when set to a non-zero value." },
|
|
213
243
|
{ name: "CCHISTORY_SHOW_RUNTIME_WARNINGS", effect: "Set to 1 to show Node runtime warnings (for example the node:sqlite experimental warning) that Lite suppresses by default." },
|
|
214
244
|
{ name: "CCHISTORY_SCAN_GUARD", effect: "Set to 0 to disable the scan guard (advisory lock, pre-flight estimate, native-byte admission, watchdog)." },
|
|
245
|
+
{ name: "CCHISTORY_PRICING_CONFIG", effect: "Path to a local JSON pricing/multiplier/quota file (cchistory-lite-pricing/v1 or models.dev api.json) loaded before --pricing flags." },
|
|
215
246
|
],
|
|
216
247
|
output_schemas: [
|
|
248
|
+
{ id: "cchistory-lite-diagnostic/v1", file: "schemas/cchistory-lite-diagnostic-v1.schema.json", description: "Optional metadata-only read progress and resource/cache decisions on stderr (--diagnostics)." },
|
|
217
249
|
{ id: "cchistory-lite-source-inventory/v1", file: "schemas/cchistory-lite-source-inventory-v1.schema.json", description: "Metadata-only source discovery; history counts are null until a counted scan is requested." },
|
|
218
250
|
{ id: "cchistory-lite/v2", file: "schemas/cchistory-lite-v2.schema.json", description: "Compact agent-facing read output (--json)." },
|
|
219
251
|
{ id: "cchistory-lite-canonical/v1", file: "schemas/cchistory-lite-canonical-v1.schema.json", description: "Full canonical evidence output (--json=canonical)." },
|
|
@@ -238,7 +270,7 @@ export function buildAgentContract(version) {
|
|
|
238
270
|
"Never runs resume_command or any text recovered from history.",
|
|
239
271
|
],
|
|
240
272
|
cost_model: {
|
|
241
|
-
process_model: "Discovery does not scan; shell prepares on
|
|
273
|
+
process_model: "Discovery does not scan; shell prepares collections on the first valid collection read and targets known sessions for detail. Shell retains one collection snapshot and a bounded detail cache until refresh/close. Conversation search retains masked user/reply text, not full tool context. One-shots have no cross-command cache.",
|
|
242
274
|
heap_ceiling: {
|
|
243
275
|
policy: "adaptive_default_or_explicit", automatic_reexec: true,
|
|
244
276
|
description: "Launchers grow the default heap to half the available-memory estimate when that materially exceeds the Node default. Explicit Node flags and NODE_OPTIONS are preserved; library calls keep the caller heap.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-contract.js","sourceRoot":"","sources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AoB,EAAE,oBAAoB,EAAE,sBAAsB,CAAC;aAClF;YACD,QAAQ,EAAE;gBACR,yMAAyM;gBACzM,oHAAoH;gBACpH,qFAAqF;gBACrF,4IAA4I;gBAC5I,gNAAgN;gBAChN,2QAA2Q;aAC5Q;SACF;QACD,IAAI,EAAE;YACJ,WAAW,EAAE,0BAA0B;YACvC,SAAS,EAAE,oBAAoB;YAC/B,KAAK,EAAE,sCAAsC;YAC7C,WAAW,EAAE;gBACX,KAAK,EAAE,yEAAyE;gBAChF,KAAK,EAAE,6DAA6D;aACrE;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-journeys.test.d.ts","sourceRoot":"","sources":["../src/agent-journeys.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { unlinkSync } from "node:fs";
|
|
3
|
+
import { cp, mkdtemp, readFile, rm, stat, utimes, writeFile } from "node:fs/promises";
|
|
4
|
+
import os from "node:os";
|
|
5
|
+
import path from "node:path";
|
|
6
|
+
import test from "node:test";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
import { LiveHistoryReader, LiveHistorySnapshot, scanLiteHistory } from "@cchistory/live-runtime";
|
|
9
|
+
import { runLiteCli } from "./index.js";
|
|
10
|
+
import { executeQuery, parseQueryRequest, prepareQuerySnapshot, QUERY_REQUEST_SCHEMA } from "./query.js";
|
|
11
|
+
import { runLiteShell } from "./shell.js";
|
|
12
|
+
const fixture = fileURLToPath(new URL("../../../mock_data/fixtures/agent-evidence", import.meta.url));
|
|
13
|
+
const directory = "/fixture/agent-project";
|
|
14
|
+
const parent = "sess:codex:evidence-parent";
|
|
15
|
+
const child = "sess:codex:evidence-child";
|
|
16
|
+
function options(baseDir = fixture) {
|
|
17
|
+
return { homeDir: baseDir, hostname: "agent-evidence-fixture", sourceRefs: ["codex"], sourceRoots: [{ sourceRef: "codex", baseDir }],
|
|
18
|
+
directoryScope: directory, safeMode: true, scanGuard: { profile: "light" } };
|
|
19
|
+
}
|
|
20
|
+
function capture(overrides = {}) {
|
|
21
|
+
const out = [], err = [];
|
|
22
|
+
return { out, err, io: { cwd: directory, homeDir: fixture, isTTY: false, stdout: (v) => { out.push(v); },
|
|
23
|
+
stderr: (v) => { err.push(v); }, ...overrides } };
|
|
24
|
+
}
|
|
25
|
+
function request(operations) { return JSON.stringify({ schema: QUERY_REQUEST_SCHEMA, operations }); }
|
|
26
|
+
test("agent journey: latest, read and repeated replies use stable IDs and two scans", async () => {
|
|
27
|
+
const scans = [];
|
|
28
|
+
const captured = capture();
|
|
29
|
+
let step = 0;
|
|
30
|
+
const code = await runLiteShell({ jsonLines: true, directoryScope: directory,
|
|
31
|
+
scan: async (overrides = {}) => { scans.push(overrides); return scanLiteHistory({ ...options(), ...overrides }); },
|
|
32
|
+
io: { ...captured.io, readLine: async () => {
|
|
33
|
+
if (step++ === 0)
|
|
34
|
+
return JSON.stringify({ kind: "latest", limit: 10 });
|
|
35
|
+
if (step === 2)
|
|
36
|
+
return JSON.stringify({ kind: "read", session_ref: parent, max_chars: 512, limit: 1 });
|
|
37
|
+
const first = JSON.parse(captured.out[1]);
|
|
38
|
+
const turn = first.operations[0].result.messages[0].turn_id;
|
|
39
|
+
if (step === 3 || step === 4)
|
|
40
|
+
return JSON.stringify({ kind: "replies", turn_refs: [turn] });
|
|
41
|
+
if (step === 5)
|
|
42
|
+
return JSON.stringify({ kind: "latest", limit: 10 });
|
|
43
|
+
return null;
|
|
44
|
+
} },
|
|
45
|
+
});
|
|
46
|
+
assert.equal(code, 0, captured.err.join(""));
|
|
47
|
+
assert.equal(scans.length, 2);
|
|
48
|
+
assert.deepEqual(scans[1].sessionRefs, [parent]);
|
|
49
|
+
const results = captured.out.map(line => JSON.parse(line));
|
|
50
|
+
assert.equal(results[0].read.id, results[4].read.id);
|
|
51
|
+
assert.equal(results[1].read.id, results[2].read.id);
|
|
52
|
+
assert.equal(results[2].read.id, results[3].read.id);
|
|
53
|
+
const sessions = results[0].operations[0].result.sessions;
|
|
54
|
+
assert.ok(sessions.some((s) => s.id === parent));
|
|
55
|
+
assert.ok(sessions.some((s) => s.id === "sess:codex:evidence-duplicate"));
|
|
56
|
+
assert.ok(!sessions.some((s) => [child, "sess:codex:evidence-empty", "sess:codex:evidence-other"].includes(s.id)));
|
|
57
|
+
assert.match(results[2].operations[0].result.turns[0].assistant_replies[0].canonical_text, /exponential backoff/);
|
|
58
|
+
});
|
|
59
|
+
test("agent journey: answer search and cited turn reading share one context-light scan", async () => {
|
|
60
|
+
let scans = 0, step = 0;
|
|
61
|
+
const captured = capture();
|
|
62
|
+
const code = await runLiteShell({ jsonLines: true, directoryScope: directory,
|
|
63
|
+
scan: async (overrides) => {
|
|
64
|
+
scans++;
|
|
65
|
+
const snapshot = await scanLiteHistory({ ...options(), ...overrides });
|
|
66
|
+
assert.deepEqual(snapshot.data.contexts, []);
|
|
67
|
+
assert.deepEqual(snapshot.projectionIssues, []);
|
|
68
|
+
return snapshot;
|
|
69
|
+
},
|
|
70
|
+
io: { ...captured.io, readLine: async () => {
|
|
71
|
+
if (step++ === 0)
|
|
72
|
+
return JSON.stringify({ kind: "search", query: "exponential backoff", content: "conversation" });
|
|
73
|
+
if (step === 2)
|
|
74
|
+
return JSON.stringify({ kind: "read", turn_ref: JSON.parse(captured.out[0]).operations[0].result.results[0].turn_id });
|
|
75
|
+
return null;
|
|
76
|
+
} },
|
|
77
|
+
});
|
|
78
|
+
assert.equal(code, 0);
|
|
79
|
+
assert.equal(scans, 1);
|
|
80
|
+
const [found, read] = captured.out.map(line => JSON.parse(line));
|
|
81
|
+
assert.equal(found.operations[0].result.total, 1);
|
|
82
|
+
assert.equal(found.operations[0].result.results[0].role, "assistant");
|
|
83
|
+
assert.equal(found.read.id, read.read.id);
|
|
84
|
+
assert.deepEqual(read.operations[0].result.messages.map((m) => m.role), ["user", "assistant"]);
|
|
85
|
+
assert.match(read.operations[0].result.messages[1].text, /rejected fixed delay/);
|
|
86
|
+
});
|
|
87
|
+
test("delegated hits stay under their parent and cite the child; scope and empty sessions remain explicit", async () => {
|
|
88
|
+
const snapshot = await scanLiteHistory({ ...options(), directoryScope: undefined, contextMode: "none", retainConversationEvidence: true });
|
|
89
|
+
const found = snapshot.searchConversation({ query: "checksum", directoryScope: directory });
|
|
90
|
+
assert.equal(found.results.length, 1);
|
|
91
|
+
assert.equal(found.results[0].session_id, parent);
|
|
92
|
+
assert.equal(found.results[0].matched_session_id, child);
|
|
93
|
+
assert.equal(found.results[0].turn_id, null);
|
|
94
|
+
assert.equal(snapshot.getSession(child).turn_count, 0);
|
|
95
|
+
const read = snapshot.readEvidence({ kind: "session", ref: found.results[0].matched_session_id }, {}, directory);
|
|
96
|
+
assert.ok(read.messages.every(m => m.session_id === child));
|
|
97
|
+
assert.equal(snapshot.readEvidence({ kind: "session", ref: "sess:codex:evidence-other" }, {}, directory), undefined);
|
|
98
|
+
assert.deepEqual(snapshot.readEvidence({ kind: "session", ref: "sess:codex:evidence-empty" }, {}, directory).messages, []);
|
|
99
|
+
assert.equal(snapshot.searchConversation({ query: "unrelated", directoryScope: directory }).total, 0);
|
|
100
|
+
assert.deepEqual(snapshot.projectionIssues, []);
|
|
101
|
+
});
|
|
102
|
+
test("long fixture evidence is searchable after 16 KiB and bounded pages reconstruct the source", async () => {
|
|
103
|
+
const scratch = await mkdtemp(path.join(os.tmpdir(), "lite-agent-long-"));
|
|
104
|
+
try {
|
|
105
|
+
await cp(fixture, scratch, { recursive: true });
|
|
106
|
+
const file = path.join(scratch, "parent.jsonl"), before = await stat(file);
|
|
107
|
+
const records = (await readFile(file, "utf8")).trim().split("\n").map(line => JSON.parse(line));
|
|
108
|
+
const user = records.find(r => r.payload.role === "user");
|
|
109
|
+
user.payload.content[0].text = records.find(r => r.payload.role === "user" && r.payload.content[0].text.includes("emoji")).payload.content[0].text.repeat(400) + " tail-evidence-marker";
|
|
110
|
+
await writeFile(file, records.map(r => JSON.stringify(r)).join("\n") + "\n");
|
|
111
|
+
await utimes(file, before.atime, new Date(before.mtimeMs + 2000));
|
|
112
|
+
const snapshot = await scanLiteHistory({ ...options(scratch), contextMode: "none", retainConversationEvidence: true });
|
|
113
|
+
const hit = snapshot.searchConversation({ query: "tail-evidence-marker", directoryScope: directory }).results[0];
|
|
114
|
+
assert.equal(hit.session_id, parent);
|
|
115
|
+
assert.ok(hit.start > 16 * 1024);
|
|
116
|
+
let cursor, reconstructed = "", pages = 0;
|
|
117
|
+
do {
|
|
118
|
+
const page = snapshot.readEvidence({ kind: "turn", ref: hit.turn_id }, { max_chars: 511, limit: 1, cursor }, directory);
|
|
119
|
+
assert.ok(page.returned_chars <= 511);
|
|
120
|
+
for (const message of page.messages)
|
|
121
|
+
if (message.role === "user")
|
|
122
|
+
reconstructed += message.text;
|
|
123
|
+
cursor = page.next_cursor ?? undefined;
|
|
124
|
+
assert.ok(++pages < 100);
|
|
125
|
+
} while (cursor);
|
|
126
|
+
assert.equal(reconstructed, snapshot.getTurn(hit.turn_id).canonical_text);
|
|
127
|
+
const op = { id: "read", kind: "read", turn_ref: hit.turn_id, max_chars: 511 };
|
|
128
|
+
const result = executeQuery(parseQueryRequest(request([op])), snapshot, directory);
|
|
129
|
+
assert.ok(Buffer.byteLength(JSON.stringify(result.payload)) < 8000);
|
|
130
|
+
assert.deepEqual(snapshot.projectionIssues, []);
|
|
131
|
+
}
|
|
132
|
+
finally {
|
|
133
|
+
await rm(scratch, { recursive: true, force: true });
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
test("successful refresh invalidates detail and cursor; failed refresh preserves usable reads", async () => {
|
|
137
|
+
const original = await scanLiteHistory({ ...options(), contextMode: "full" });
|
|
138
|
+
const changed = new LiveHistorySnapshot({ ...original.data, turns: original.data.turns.map(t => ({ ...t, canonical_text: t.canonical_text + " Updated fixture." })) });
|
|
139
|
+
let current = original, fail = false, scans = 0;
|
|
140
|
+
const reader = new LiveHistoryReader(async () => { scans++; if (fail)
|
|
141
|
+
throw new Error("fixture refresh failed"); return current; });
|
|
142
|
+
try {
|
|
143
|
+
const detail = await reader.detail([{ kind: "session", ref: parent }]);
|
|
144
|
+
const cursor = detail.readEvidence({ kind: "session", ref: parent }, { limit: 1 }, directory).next_cursor;
|
|
145
|
+
fail = true;
|
|
146
|
+
await assert.rejects(reader.refresh(), /fixture refresh failed/);
|
|
147
|
+
assert.equal(await reader.detail([{ kind: "session", ref: parent }]), detail);
|
|
148
|
+
assert.equal(scans, 2);
|
|
149
|
+
fail = false;
|
|
150
|
+
current = changed;
|
|
151
|
+
await reader.refresh();
|
|
152
|
+
const next = await reader.detail([{ kind: "session", ref: parent }]);
|
|
153
|
+
assert.notEqual(next.readIdentity.id, detail.readIdentity.id);
|
|
154
|
+
assert.throws(() => next.readEvidence({ kind: "session", ref: parent }, { cursor }, directory), /changed/);
|
|
155
|
+
}
|
|
156
|
+
finally {
|
|
157
|
+
reader.close();
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
test("detail cache respects entry and retained-data limits and releases on close", async () => {
|
|
161
|
+
const snapshot = await scanLiteHistory({ ...options(), contextMode: "full" });
|
|
162
|
+
let scans = 0;
|
|
163
|
+
const scan = async () => { scans++; return snapshot; };
|
|
164
|
+
const reader = new LiveHistoryReader(scan, 0);
|
|
165
|
+
await reader.detail([{ kind: "session", ref: parent }]);
|
|
166
|
+
await reader.detail([{ kind: "session", ref: parent }]);
|
|
167
|
+
assert.equal(scans, 2);
|
|
168
|
+
reader.close();
|
|
169
|
+
const cached = new LiveHistoryReader(scan);
|
|
170
|
+
await cached.detail([{ kind: "session", ref: parent }]);
|
|
171
|
+
await cached.detail([{ kind: "session", ref: parent }]);
|
|
172
|
+
assert.equal(scans, 3);
|
|
173
|
+
cached.close();
|
|
174
|
+
await cached.detail([{ kind: "session", ref: parent }]);
|
|
175
|
+
assert.equal(scans, 4);
|
|
176
|
+
cached.close();
|
|
177
|
+
let targetedScans = 0;
|
|
178
|
+
const bounded = new LiveHistoryReader(async (overrides) => {
|
|
179
|
+
targetedScans++;
|
|
180
|
+
return scanLiteHistory({ ...options(), ...overrides });
|
|
181
|
+
}, 16 * 1024 * 1024, 1);
|
|
182
|
+
try {
|
|
183
|
+
await bounded.detail([{ kind: "session", ref: parent }]);
|
|
184
|
+
await bounded.detail([{ kind: "session", ref: "sess:codex:evidence-duplicate" }]);
|
|
185
|
+
await bounded.detail([{ kind: "session", ref: parent }]);
|
|
186
|
+
assert.equal(targetedScans, 3, "the oldest detail was evicted at the entry limit");
|
|
187
|
+
}
|
|
188
|
+
finally {
|
|
189
|
+
bounded.close();
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
test("partial detail caches and warm collections preserve ambiguous session candidates", async () => {
|
|
193
|
+
for (const warmCollection of [false, true]) {
|
|
194
|
+
const reader = new LiveHistoryReader(overrides => scanLiteHistory({ ...options(), ...overrides }));
|
|
195
|
+
try {
|
|
196
|
+
if (warmCollection)
|
|
197
|
+
await reader.collection();
|
|
198
|
+
await reader.detail([{ kind: "session", ref: parent }], { evidenceOnly: true });
|
|
199
|
+
const operations = [{ id: "ambiguous", kind: "read", session_ref: "Review the fixture decision." },
|
|
200
|
+
{ id: "valid", kind: "read", session_ref: parent }];
|
|
201
|
+
const snapshot = await reader.detail(operations.map(op => ({ kind: "session", ref: op.session_ref })), { evidenceOnly: true });
|
|
202
|
+
const result = executeQuery(parseQueryRequest(request(operations)), snapshot, directory);
|
|
203
|
+
const payload = JSON.parse(JSON.stringify(result.payload));
|
|
204
|
+
assert.equal(payload.operations[0].error.code, "ambiguous_reference");
|
|
205
|
+
assert.deepEqual(payload.operations[0].error.candidates.map((candidate) => candidate.id).sort(), [parent, "sess:codex:evidence-duplicate"].sort());
|
|
206
|
+
assert.equal(payload.operations[1].status, "ok");
|
|
207
|
+
assert.ok(payload.operations[1].result.messages.every((message) => message.session_id === parent));
|
|
208
|
+
}
|
|
209
|
+
finally {
|
|
210
|
+
reader.close();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
test("one-shot missing session references preserve valid batch results", async () => {
|
|
215
|
+
for (const missing of ["sess:codex:missing", "sess:claude_code:missing"]) {
|
|
216
|
+
const captured = capture({ readStdin: async () => request([
|
|
217
|
+
{ id: "valid", kind: "read", session_ref: parent },
|
|
218
|
+
{ id: "missing", kind: "read", session_ref: missing },
|
|
219
|
+
]) });
|
|
220
|
+
const code = await runLiteCli(["query", "--request", "-", "--dir", directory,
|
|
221
|
+
"--source", "codex", "--source-root", `codex=${fixture}`, "--safe"], captured.io);
|
|
222
|
+
assert.equal(code, 1);
|
|
223
|
+
assert.equal(captured.err.join(""), "");
|
|
224
|
+
const payload = JSON.parse(captured.out.join(""));
|
|
225
|
+
assert.equal(payload.operations[0].status, "ok");
|
|
226
|
+
assert.ok(payload.operations[0].result.messages.some((message) => message.text.includes("exponential backoff")));
|
|
227
|
+
assert.equal(payload.operations[1].status, "error");
|
|
228
|
+
assert.equal(payload.operations[1].error.code, "reference_not_found");
|
|
229
|
+
assert.deepEqual(payload.projection_issues, []);
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
test("cold and warm shells keep missing session references at the operation level", async () => {
|
|
233
|
+
for (const warmCollection of [false, true]) {
|
|
234
|
+
const captured = capture();
|
|
235
|
+
const lines = [
|
|
236
|
+
...(warmCollection ? [JSON.stringify({ kind: "latest", limit: 10 })] : []),
|
|
237
|
+
request([{ id: "valid", kind: "read", session_ref: parent },
|
|
238
|
+
{ id: "missing", kind: "read", session_ref: "sess:codex:missing" }]),
|
|
239
|
+
JSON.stringify({ kind: "read", session_ref: "sess:claude_code:missing" }),
|
|
240
|
+
JSON.stringify({ kind: "read", session_ref: parent }),
|
|
241
|
+
];
|
|
242
|
+
const code = await runLiteShell({ jsonLines: true, directoryScope: directory,
|
|
243
|
+
scan: overrides => scanLiteHistory({ ...options(), ...overrides }),
|
|
244
|
+
io: { ...captured.io, readLine: async () => lines.shift() ?? null },
|
|
245
|
+
});
|
|
246
|
+
assert.equal(code, 1);
|
|
247
|
+
const payloads = captured.out.map(line => JSON.parse(line)).slice(warmCollection ? 1 : 0);
|
|
248
|
+
assert.equal(payloads[0].kind, "query_result");
|
|
249
|
+
assert.equal(payloads[0].operations[0].status, "ok");
|
|
250
|
+
assert.equal(payloads[0].operations[1].error.code, "reference_not_found");
|
|
251
|
+
assert.equal(payloads[1].kind, "query_result");
|
|
252
|
+
assert.equal(payloads[1].operations[0].error.code, "reference_not_found");
|
|
253
|
+
assert.equal(payloads[2].operations[0].status, "ok");
|
|
254
|
+
assert.deepEqual(payloads[0].projection_issues, []);
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
test("targeted scan failures propagate without a matching-scan retry", async () => {
|
|
258
|
+
const failure = new Error("fixture scan failed");
|
|
259
|
+
let scans = 0;
|
|
260
|
+
const reader = new LiveHistoryReader(async () => { scans++; throw failure; });
|
|
261
|
+
try {
|
|
262
|
+
await assert.rejects(reader.detail([{ kind: "session", ref: parent }]), error => error === failure);
|
|
263
|
+
assert.equal(scans, 1);
|
|
264
|
+
}
|
|
265
|
+
finally {
|
|
266
|
+
reader.close();
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
test("mixed legacy replies and evidence reads retain unanchored delegated answers", async () => {
|
|
270
|
+
const reader = new LiveHistoryReader(overrides => scanLiteHistory({ ...options(), ...overrides }));
|
|
271
|
+
try {
|
|
272
|
+
const legacy = await reader.detail([{ kind: "session", ref: parent }]);
|
|
273
|
+
assert.equal(legacy.data.conversation_evidence, undefined);
|
|
274
|
+
const turnId = legacy.listSessionTurns(parent)[0].id;
|
|
275
|
+
const query = parseQueryRequest(request([{ id: "reply", kind: "replies", turn_refs: [turnId] },
|
|
276
|
+
{ id: "child", kind: "read", session_ref: child }]));
|
|
277
|
+
const prepared = await prepareQuerySnapshot(query, reader);
|
|
278
|
+
const result = executeQuery(query, prepared, directory);
|
|
279
|
+
const payload = JSON.parse(JSON.stringify(result.payload));
|
|
280
|
+
assert.equal(result.hasOperationErrors, false);
|
|
281
|
+
assert.ok(payload.operations[1].result.messages.some((message) => message.turn_id === null && message.text.includes("checksum")));
|
|
282
|
+
}
|
|
283
|
+
finally {
|
|
284
|
+
reader.close();
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
test("invalid evidence requests fail before scanning", async () => {
|
|
288
|
+
const invalid = [
|
|
289
|
+
{ kind: "read", session_ref: parent, turn_ref: "turn" }, { kind: "read" },
|
|
290
|
+
{ kind: "read", session_ref: parent, max_chars: 1 }, { kind: "read", session_ref: parent, limit: 101 },
|
|
291
|
+
{ kind: "read", session_ref: parent, cursor: "bad-cursor" },
|
|
292
|
+
{ kind: "search", query: "fixture", content: "conversation", max_chars: 64001 },
|
|
293
|
+
{ kind: "search", query: "fixture", content: "all" },
|
|
294
|
+
{ kind: "search", query: "fixture", group_by: "message" },
|
|
295
|
+
{ kind: "search", query: "fixture", content: "conversation", group_by: "turn" },
|
|
296
|
+
];
|
|
297
|
+
let scans = 0;
|
|
298
|
+
for (const operation of invalid) {
|
|
299
|
+
const captured = capture({ readStdin: async () => request([{ id: "bad", ...operation }]), scan: async () => { scans++; throw new Error("unexpected scan"); } });
|
|
300
|
+
assert.equal(await runLiteCli(["query", "--request", "-", "--dir", directory], captured.io), 2, captured.err.join(""));
|
|
301
|
+
}
|
|
302
|
+
assert.equal(scans, 0);
|
|
303
|
+
});
|
|
304
|
+
test("older decision, later mention and reversal remain individually addressable in one shell scan", async () => {
|
|
305
|
+
const scratch = await mkdtemp(path.join(os.tmpdir(), "lite-old-decisions-"));
|
|
306
|
+
try {
|
|
307
|
+
await cp(fixture, scratch, { recursive: true });
|
|
308
|
+
const file = path.join(scratch, "parent.jsonl"), before = await stat(file);
|
|
309
|
+
const rows = (await readFile(file, "utf8")).trim().split("\n").map(line => JSON.parse(line));
|
|
310
|
+
const original = rows[2].payload.content[0].text;
|
|
311
|
+
rows[4].payload.content[0].text = "Mention exponential backoff with jitter in the migration notes.";
|
|
312
|
+
rows.push({ ...rows[1], timestamp: "2026-04-12T10:07:00Z", payload: { ...rows[1].payload,
|
|
313
|
+
content: [{ type: "input_text", text: "Record the revised retry decision." }] } });
|
|
314
|
+
rows.push({ ...rows[2], timestamp: "2026-04-12T10:08:00Z", payload: { ...rows[2].payload,
|
|
315
|
+
content: [{ type: "output_text", text: "Reversal: replace exponential backoff with jitter with the server retry-after schedule." }] } });
|
|
316
|
+
await writeFile(file, rows.map(row => JSON.stringify(row)).join("\n") + "\n");
|
|
317
|
+
await utimes(file, before.atime, new Date(before.mtimeMs + 2000));
|
|
318
|
+
const captured = capture();
|
|
319
|
+
let step = 0, scans = 0;
|
|
320
|
+
const code = await runLiteShell({ jsonLines: true, directoryScope: directory,
|
|
321
|
+
scan: async (overrides) => { scans++; return scanLiteHistory({ ...options(scratch), ...overrides }); },
|
|
322
|
+
io: { ...captured.io, readLine: async () => {
|
|
323
|
+
if (step++ === 0)
|
|
324
|
+
return JSON.stringify({ kind: "search", query: "exponential backoff", content: "conversation", group_by: "message", limit: 1 });
|
|
325
|
+
if (step <= 3)
|
|
326
|
+
return JSON.stringify({ kind: "search", query: "exponential backoff", content: "conversation", group_by: "message", limit: 1,
|
|
327
|
+
offset: JSON.parse(captured.out[step - 2]).operations[0].result.next_offset });
|
|
328
|
+
if (step === 4)
|
|
329
|
+
return JSON.stringify({ kind: "read", turn_ref: JSON.parse(captured.out[2]).operations[0].result.results[0].turn_id });
|
|
330
|
+
return null;
|
|
331
|
+
} } });
|
|
332
|
+
assert.equal(code, 0, captured.err.join(""));
|
|
333
|
+
assert.equal(scans, 1);
|
|
334
|
+
const responses = captured.out.map(line => JSON.parse(line));
|
|
335
|
+
const hits = responses.slice(0, 3).map(response => response.operations[0].result.results[0]);
|
|
336
|
+
assert.equal(new Set(hits.map(hit => hit.message_id)).size, 3);
|
|
337
|
+
assert.match(hits[0].text, /Reversal/);
|
|
338
|
+
assert.match(hits[1].text, /Mention/);
|
|
339
|
+
assert.equal(hits[2].text, original);
|
|
340
|
+
assert.ok(hits.every(hit => hit.session_id === parent && hit.matched_session_id === parent && hit.turn_id));
|
|
341
|
+
assert.equal(new Set(responses.map(response => response.read.id)).size, 1);
|
|
342
|
+
assert.ok(responses[3].operations[0].result.messages.some((message) => message.message_id === hits[2].message_id && message.text === original));
|
|
343
|
+
const snapshot = await scanLiteHistory({ ...options(scratch), contextMode: "none", retainConversationEvidence: true });
|
|
344
|
+
assert.equal(snapshot.searchConversation({ query: "exponential backoff" }).total, 1, "default grouping stays compatible");
|
|
345
|
+
const childHit = snapshot.searchConversation({ query: "checksum", group_by: "message" }).results[0];
|
|
346
|
+
assert.equal(childHit.matched_session_id, child);
|
|
347
|
+
assert.equal(childHit.turn_id, null);
|
|
348
|
+
assert.deepEqual(snapshot.projectionIssues, []);
|
|
349
|
+
}
|
|
350
|
+
finally {
|
|
351
|
+
await rm(scratch, { recursive: true, force: true });
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
test("opt-in diagnostics emit metadata JSONL, preserve stdout results and explain SQL work and shell reuse", async () => {
|
|
355
|
+
const args = ["query", "--sql", "SELECT id FROM sessions LIMIT 2", "--complete", "--source", "codex", "--source-root", `codex=${fixture}`, "--dir", directory];
|
|
356
|
+
const ordinary = capture(), diagnosed = capture();
|
|
357
|
+
assert.equal(await runLiteCli(args, ordinary.io), 0, ordinary.err.join(""));
|
|
358
|
+
assert.equal(await runLiteCli([...args, "--diagnostics"], diagnosed.io), 0, diagnosed.err.join(""));
|
|
359
|
+
assert.deepEqual(JSON.parse(diagnosed.out.join("")).operations, JSON.parse(ordinary.out.join("")).operations);
|
|
360
|
+
assert.equal(ordinary.err.length, 0);
|
|
361
|
+
const events = diagnosed.err.flatMap(chunk => chunk.trim().split("\n").map(line => JSON.parse(line)));
|
|
362
|
+
assert.ok(events.every(event => event.schema === "cchistory-lite-diagnostic/v1"));
|
|
363
|
+
for (const kind of ["read_start", "progress", "budget", "query_work", "read_done"])
|
|
364
|
+
assert.ok(events.some(event => event.kind === kind), kind);
|
|
365
|
+
assert.ok(events.some(event => event.kind === "progress" && event.count_unit === "sessions"));
|
|
366
|
+
assert.ok(events.filter(event => event.attempt_id).every(event => Number.isFinite(event.rss_bytes) && Number.isFinite(event.heap_used_bytes)));
|
|
367
|
+
assert.doesNotMatch(diagnosed.err.join(""), /exponential backoff|checksum|rejected fixed delay/);
|
|
368
|
+
const snapshot = await scanLiteHistory({ ...options(), contextMode: "none", retainConversationEvidence: true });
|
|
369
|
+
const cacheEvents = [];
|
|
370
|
+
const reader = new LiveHistoryReader(async () => snapshot, undefined, undefined, event => cacheEvents.push(event));
|
|
371
|
+
await reader.collection(true);
|
|
372
|
+
await reader.detail([{ kind: "session", ref: parent }], { evidenceOnly: true });
|
|
373
|
+
await reader.refresh();
|
|
374
|
+
reader.close();
|
|
375
|
+
assert.deepEqual(cacheEvents.map(event => event.decision), ["miss", "hit", "refresh", "closed"]);
|
|
376
|
+
const failures = [];
|
|
377
|
+
await assert.rejects(scanLiteHistory({ ...options(), contextMode: "matching", onDiagnostic: event => failures.push(event) }), /requires/);
|
|
378
|
+
assert.equal(failures.at(-1)?.kind, "read_error");
|
|
379
|
+
});
|
|
380
|
+
test("agent journey: SQL success with a lost file reports partial history at the top level", async () => {
|
|
381
|
+
const scratch = await mkdtemp(path.join(os.tmpdir(), "lite-agent-loss-"));
|
|
382
|
+
try {
|
|
383
|
+
await cp(fixture, scratch, { recursive: true });
|
|
384
|
+
let removed = false;
|
|
385
|
+
const captured = capture({ scan: async (overrides) => scanLiteHistory({ ...options(scratch), ...overrides,
|
|
386
|
+
sourceRefs: ["codex"], sourceRoots: [{ sourceRef: "codex", baseDir: scratch }],
|
|
387
|
+
onProgress: e => { if (!removed && e.stage === "file_start") {
|
|
388
|
+
removed = true;
|
|
389
|
+
unlinkSync(path.join(scratch, "duplicate-title.jsonl"));
|
|
390
|
+
} },
|
|
391
|
+
}) });
|
|
392
|
+
assert.equal(await runLiteCli(["query", "--sql", "SELECT id FROM sessions LIMIT 10", "--complete", "--dir", directory], captured.io), 0, captured.err.join(""));
|
|
393
|
+
const result = JSON.parse(captured.out.join(""));
|
|
394
|
+
assert.equal(result.operations[0].result.coverage.execution, "complete");
|
|
395
|
+
assert.equal(result.read_status.status, "partial");
|
|
396
|
+
assert.ok(result.read_status.reasons.includes("read_loss"));
|
|
397
|
+
assert.ok(result.diagnostics.loss_audits.length > 0);
|
|
398
|
+
}
|
|
399
|
+
finally {
|
|
400
|
+
await rm(scratch, { recursive: true, force: true });
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
//# sourceMappingURL=agent-journeys.test.js.map
|