@ironbee-ai/cli 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/README.md +167 -39
- package/dist/analysis/code-changes.js.map +1 -1
- package/dist/analysis/cross-session.js.map +1 -1
- package/dist/analysis/fix-effectiveness.js.map +1 -1
- package/dist/analysis/time-analysis.js.map +1 -1
- package/dist/analysis/verdict-details.js.map +1 -1
- package/dist/analysis/verification-quality.js.map +1 -1
- package/dist/analytics/classifier.d.ts +99 -0
- package/dist/analytics/classifier.d.ts.map +1 -0
- package/dist/analytics/classifier.js +380 -0
- package/dist/analytics/classifier.js.map +1 -0
- package/dist/analytics/emit.d.ts +67 -0
- package/dist/analytics/emit.d.ts.map +1 -0
- package/dist/analytics/emit.js +901 -0
- package/dist/analytics/emit.js.map +1 -0
- package/dist/analytics/errors.d.ts +33 -0
- package/dist/analytics/errors.d.ts.map +1 -0
- package/dist/analytics/errors.js +93 -0
- package/dist/analytics/errors.js.map +1 -0
- package/dist/analytics/hook-trigger.d.ts +39 -0
- package/dist/analytics/hook-trigger.d.ts.map +1 -0
- package/dist/analytics/hook-trigger.js +127 -0
- package/dist/analytics/hook-trigger.js.map +1 -0
- package/dist/analytics/log.d.ts +44 -0
- package/dist/analytics/log.d.ts.map +1 -0
- package/dist/analytics/log.js +158 -0
- package/dist/analytics/log.js.map +1 -0
- package/dist/analytics/merge.d.ts +40 -0
- package/dist/analytics/merge.d.ts.map +1 -0
- package/dist/analytics/merge.js +527 -0
- package/dist/analytics/merge.js.map +1 -0
- package/dist/analytics/pricing.d.ts +149 -0
- package/dist/analytics/pricing.d.ts.map +1 -0
- package/dist/analytics/pricing.js +179 -0
- package/dist/analytics/pricing.js.map +1 -0
- package/dist/analytics/projection.d.ts +356 -0
- package/dist/analytics/projection.d.ts.map +1 -0
- package/dist/analytics/projection.js +2281 -0
- package/dist/analytics/projection.js.map +1 -0
- package/dist/analytics/spawn.d.ts +28 -0
- package/dist/analytics/spawn.d.ts.map +1 -0
- package/dist/analytics/spawn.js +57 -0
- package/dist/analytics/spawn.js.map +1 -0
- package/dist/analytics/state.d.ts +58 -0
- package/dist/analytics/state.d.ts.map +1 -0
- package/dist/analytics/state.js +329 -0
- package/dist/analytics/state.js.map +1 -0
- package/dist/analytics/transcript.d.ts +150 -0
- package/dist/analytics/transcript.d.ts.map +1 -0
- package/dist/analytics/transcript.js +276 -0
- package/dist/analytics/transcript.js.map +1 -0
- package/dist/analytics/types.d.ts +875 -0
- package/dist/analytics/types.d.ts.map +1 -0
- package/dist/analytics/types.js +31 -0
- package/dist/analytics/types.js.map +1 -0
- package/dist/clients/base.d.ts +21 -2
- package/dist/clients/base.d.ts.map +1 -1
- package/dist/clients/claude/commands/ironbee-verify.md +15 -7
- package/dist/clients/claude/fragments/command-verify.node.md +33 -0
- package/dist/clients/claude/fragments/rule.node.md +29 -0
- package/dist/clients/claude/fragments/skill.node.md +77 -0
- package/dist/clients/claude/hooks/activity-end.d.ts +13 -0
- package/dist/clients/claude/hooks/activity-end.d.ts.map +1 -0
- package/dist/clients/claude/hooks/activity-end.js +42 -0
- package/dist/clients/claude/hooks/activity-end.js.map +1 -0
- package/dist/clients/claude/hooks/require-verdict.d.ts +3 -2
- package/dist/clients/claude/hooks/require-verdict.d.ts.map +1 -1
- package/dist/clients/claude/hooks/require-verdict.js +6 -5
- package/dist/clients/claude/hooks/require-verdict.js.map +1 -1
- package/dist/clients/claude/hooks/require-verification.d.ts +7 -4
- package/dist/clients/claude/hooks/require-verification.d.ts.map +1 -1
- package/dist/clients/claude/hooks/require-verification.js +44 -22
- package/dist/clients/claude/hooks/require-verification.js.map +1 -1
- package/dist/clients/claude/hooks/session-end.d.ts.map +1 -1
- package/dist/clients/claude/hooks/session-end.js +17 -2
- package/dist/clients/claude/hooks/session-end.js.map +1 -1
- package/dist/clients/claude/hooks/session-start.d.ts.map +1 -1
- package/dist/clients/claude/hooks/session-start.js +2 -1
- package/dist/clients/claude/hooks/session-start.js.map +1 -1
- package/dist/clients/claude/hooks/track-action-monitor.d.ts +27 -0
- package/dist/clients/claude/hooks/track-action-monitor.d.ts.map +1 -0
- package/dist/clients/claude/hooks/track-action-monitor.js +126 -0
- package/dist/clients/claude/hooks/track-action-monitor.js.map +1 -0
- package/dist/clients/claude/hooks/track-action.d.ts.map +1 -1
- package/dist/clients/claude/hooks/track-action.js +29 -20
- package/dist/clients/claude/hooks/track-action.js.map +1 -1
- package/dist/clients/claude/hooks/verify-gate.d.ts.map +1 -1
- package/dist/clients/claude/hooks/verify-gate.js +18 -1
- package/dist/clients/claude/hooks/verify-gate.js.map +1 -1
- package/dist/clients/claude/index.d.ts +4 -1
- package/dist/clients/claude/index.d.ts.map +1 -1
- package/dist/clients/claude/index.js +171 -94
- package/dist/clients/claude/index.js.map +1 -1
- package/dist/clients/claude/rules/ironbee-verification.md +41 -33
- package/dist/clients/claude/skills/ironbee-verification.md +93 -76
- package/dist/clients/cursor/commands/ironbee-verify/SKILL.md +18 -10
- package/dist/clients/cursor/fragments/command-verify.node.md +33 -0
- package/dist/clients/cursor/fragments/rule.node.md +29 -0
- package/dist/clients/cursor/fragments/skill.node.md +77 -0
- package/dist/clients/cursor/hooks/activity-end.d.ts +14 -0
- package/dist/clients/cursor/hooks/activity-end.d.ts.map +1 -0
- package/dist/clients/cursor/hooks/activity-end.js +45 -0
- package/dist/clients/cursor/hooks/activity-end.js.map +1 -0
- package/dist/clients/cursor/hooks/require-verdict.d.ts +1 -1
- package/dist/clients/cursor/hooks/require-verdict.js +4 -4
- package/dist/clients/cursor/hooks/require-verification.d.ts.map +1 -1
- package/dist/clients/cursor/hooks/require-verification.js +42 -16
- package/dist/clients/cursor/hooks/require-verification.js.map +1 -1
- package/dist/clients/cursor/hooks/session-end.d.ts.map +1 -1
- package/dist/clients/cursor/hooks/session-end.js +18 -2
- package/dist/clients/cursor/hooks/session-end.js.map +1 -1
- package/dist/clients/cursor/hooks/session-start.d.ts.map +1 -1
- package/dist/clients/cursor/hooks/session-start.js +2 -1
- package/dist/clients/cursor/hooks/session-start.js.map +1 -1
- package/dist/clients/cursor/hooks/track-action-monitor.d.ts +27 -0
- package/dist/clients/cursor/hooks/track-action-monitor.d.ts.map +1 -0
- package/dist/clients/cursor/hooks/track-action-monitor.js +133 -0
- package/dist/clients/cursor/hooks/track-action-monitor.js.map +1 -0
- package/dist/clients/cursor/hooks/track-action.d.ts.map +1 -1
- package/dist/clients/cursor/hooks/track-action.js +51 -23
- package/dist/clients/cursor/hooks/track-action.js.map +1 -1
- package/dist/clients/cursor/hooks/verify-gate.d.ts.map +1 -1
- package/dist/clients/cursor/hooks/verify-gate.js +14 -1
- package/dist/clients/cursor/hooks/verify-gate.js.map +1 -1
- package/dist/clients/cursor/index.d.ts +4 -1
- package/dist/clients/cursor/index.d.ts.map +1 -1
- package/dist/clients/cursor/index.js +117 -71
- package/dist/clients/cursor/index.js.map +1 -1
- package/dist/clients/cursor/rules/ironbee-verification.mdc +37 -29
- package/dist/clients/cursor/skills/ironbee-verification.md +93 -76
- package/dist/clients/registry.d.ts +14 -0
- package/dist/clients/registry.d.ts.map +1 -1
- package/dist/clients/registry.js +34 -0
- package/dist/clients/registry.js.map +1 -1
- package/dist/commands/analyze.d.ts.map +1 -1
- package/dist/commands/analyze.js +40 -0
- package/dist/commands/analyze.js.map +1 -1
- package/dist/commands/backend-toggle.d.ts +45 -0
- package/dist/commands/backend-toggle.d.ts.map +1 -0
- package/dist/commands/backend-toggle.js +192 -0
- package/dist/commands/backend-toggle.js.map +1 -0
- package/dist/commands/disable-backend.d.ts +14 -0
- package/dist/commands/disable-backend.d.ts.map +1 -0
- package/dist/commands/disable-backend.js +34 -0
- package/dist/commands/disable-backend.js.map +1 -0
- package/dist/commands/disable-verification.d.ts +16 -0
- package/dist/commands/disable-verification.d.ts.map +1 -0
- package/dist/commands/disable-verification.js +36 -0
- package/dist/commands/disable-verification.js.map +1 -0
- package/dist/commands/enable-backend.d.ts +15 -0
- package/dist/commands/enable-backend.d.ts.map +1 -0
- package/dist/commands/enable-backend.js +35 -0
- package/dist/commands/enable-backend.js.map +1 -0
- package/dist/commands/enable-verification.d.ts +14 -0
- package/dist/commands/enable-verification.d.ts.map +1 -0
- package/dist/commands/enable-verification.js +34 -0
- package/dist/commands/enable-verification.js.map +1 -0
- package/dist/commands/hook.d.ts.map +1 -1
- package/dist/commands/hook.js +60 -0
- package/dist/commands/hook.js.map +1 -1
- package/dist/commands/import.d.ts +39 -0
- package/dist/commands/import.d.ts.map +1 -0
- package/dist/commands/import.js +369 -0
- package/dist/commands/import.js.map +1 -0
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +15 -20
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/process-analytics.d.ts +18 -0
- package/dist/commands/process-analytics.d.ts.map +1 -0
- package/dist/commands/process-analytics.js +57 -0
- package/dist/commands/process-analytics.js.map +1 -0
- package/dist/commands/queue.d.ts +2 -3
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +2 -3
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +29 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/verification-toggle.d.ts +47 -0
- package/dist/commands/verification-toggle.d.ts.map +1 -0
- package/dist/commands/verification-toggle.js +113 -0
- package/dist/commands/verification-toggle.js.map +1 -0
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +28 -0
- package/dist/commands/verify.js.map +1 -1
- package/dist/hooks/core/actions.d.ts +64 -67
- package/dist/hooks/core/actions.d.ts.map +1 -1
- package/dist/hooks/core/actions.js +39 -24
- package/dist/hooks/core/actions.js.map +1 -1
- package/dist/hooks/core/activity-end.d.ts +20 -0
- package/dist/hooks/core/activity-end.d.ts.map +1 -0
- package/dist/hooks/core/activity-end.js +23 -0
- package/dist/hooks/core/activity-end.js.map +1 -0
- package/dist/hooks/core/required-tools.d.ts +30 -0
- package/dist/hooks/core/required-tools.d.ts.map +1 -0
- package/dist/hooks/core/required-tools.js +70 -0
- package/dist/hooks/core/required-tools.js.map +1 -0
- package/dist/hooks/core/session-state.d.ts +12 -3
- package/dist/hooks/core/session-state.d.ts.map +1 -1
- package/dist/hooks/core/session-state.js +59 -0
- package/dist/hooks/core/session-state.js.map +1 -1
- package/dist/hooks/core/submit-verdict.d.ts.map +1 -1
- package/dist/hooks/core/submit-verdict.js +16 -12
- package/dist/hooks/core/submit-verdict.js.map +1 -1
- package/dist/hooks/core/verify-gate.d.ts +17 -3
- package/dist/hooks/core/verify-gate.d.ts.map +1 -1
- package/dist/hooks/core/verify-gate.js +312 -116
- package/dist/hooks/core/verify-gate.js.map +1 -1
- package/dist/import/claude/analytics-runner.d.ts +42 -0
- package/dist/import/claude/analytics-runner.d.ts.map +1 -0
- package/dist/import/claude/analytics-runner.js +213 -0
- package/dist/import/claude/analytics-runner.js.map +1 -0
- package/dist/import/claude/discovery.d.ts +22 -0
- package/dist/import/claude/discovery.d.ts.map +1 -0
- package/dist/import/claude/discovery.js +197 -0
- package/dist/import/claude/discovery.js.map +1 -0
- package/dist/import/claude/encoding.d.ts +50 -0
- package/dist/import/claude/encoding.d.ts.map +1 -0
- package/dist/import/claude/encoding.js +110 -0
- package/dist/import/claude/encoding.js.map +1 -0
- package/dist/import/claude/events/file-change.d.ts +28 -0
- package/dist/import/claude/events/file-change.d.ts.map +1 -0
- package/dist/import/claude/events/file-change.js +112 -0
- package/dist/import/claude/events/file-change.js.map +1 -0
- package/dist/import/claude/events/tool-call.d.ts +61 -0
- package/dist/import/claude/events/tool-call.d.ts.map +1 -0
- package/dist/import/claude/events/tool-call.js +119 -0
- package/dist/import/claude/events/tool-call.js.map +1 -0
- package/dist/import/claude/runner.d.ts +31 -0
- package/dist/import/claude/runner.d.ts.map +1 -0
- package/dist/import/claude/runner.js +280 -0
- package/dist/import/claude/runner.js.map +1 -0
- package/dist/import/claude/summary.d.ts +23 -0
- package/dist/import/claude/summary.d.ts.map +1 -0
- package/dist/import/claude/summary.js +186 -0
- package/dist/import/claude/summary.js.map +1 -0
- package/dist/import/claude/transcript-walk.d.ts +52 -0
- package/dist/import/claude/transcript-walk.d.ts.map +1 -0
- package/dist/import/claude/transcript-walk.js +187 -0
- package/dist/import/claude/transcript-walk.js.map +1 -0
- package/dist/import/concurrent-pool.d.ts +45 -0
- package/dist/import/concurrent-pool.d.ts.map +1 -0
- package/dist/import/concurrent-pool.js +95 -0
- package/dist/import/concurrent-pool.js.map +1 -0
- package/dist/import/emitter.d.ts +29 -0
- package/dist/import/emitter.d.ts.map +1 -0
- package/dist/import/emitter.js +66 -0
- package/dist/import/emitter.js.map +1 -0
- package/dist/import/events/activity.d.ts +23 -0
- package/dist/import/events/activity.d.ts.map +1 -0
- package/dist/import/events/activity.js +45 -0
- package/dist/import/events/activity.js.map +1 -0
- package/dist/import/events/session.d.ts +24 -0
- package/dist/import/events/session.d.ts.map +1 -0
- package/dist/import/events/session.js +47 -0
- package/dist/import/events/session.js.map +1 -0
- package/dist/import/filter.d.ts +47 -0
- package/dist/import/filter.d.ts.map +1 -0
- package/dist/import/filter.js +90 -0
- package/dist/import/filter.js.map +1 -0
- package/dist/import/ids.d.ts +56 -0
- package/dist/import/ids.d.ts.map +1 -0
- package/dist/import/ids.js +87 -0
- package/dist/import/ids.js.map +1 -0
- package/dist/import/index.d.ts +29 -0
- package/dist/import/index.d.ts.map +1 -0
- package/dist/import/index.js +52 -0
- package/dist/import/index.js.map +1 -0
- package/dist/import/marker.d.ts +20 -0
- package/dist/import/marker.d.ts.map +1 -0
- package/dist/import/marker.js +71 -0
- package/dist/import/marker.js.map +1 -0
- package/dist/import/pipeline.d.ts +41 -0
- package/dist/import/pipeline.d.ts.map +1 -0
- package/dist/import/pipeline.js +47 -0
- package/dist/import/pipeline.js.map +1 -0
- package/dist/import/progress.d.ts +20 -0
- package/dist/import/progress.d.ts.map +1 -0
- package/dist/import/progress.js +69 -0
- package/dist/import/progress.js.map +1 -0
- package/dist/import/skip.d.ts +13 -0
- package/dist/import/skip.d.ts.map +1 -0
- package/dist/import/skip.js +24 -0
- package/dist/import/skip.js.map +1 -0
- package/dist/import/types.d.ts +125 -0
- package/dist/import/types.d.ts.map +1 -0
- package/dist/import/types.js +28 -0
- package/dist/import/types.js.map +1 -0
- package/dist/index.js +21 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/collector.d.ts +29 -3
- package/dist/lib/collector.d.ts.map +1 -1
- package/dist/lib/collector.js +118 -8
- package/dist/lib/collector.js.map +1 -1
- package/dist/lib/config.d.ts +240 -83
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +482 -89
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/event.d.ts +72 -0
- package/dist/lib/event.d.ts.map +1 -0
- package/dist/lib/event.js +42 -0
- package/dist/lib/event.js.map +1 -0
- package/dist/lib/gitignore.d.ts +21 -0
- package/dist/lib/gitignore.d.ts.map +1 -0
- package/dist/lib/gitignore.js +54 -0
- package/dist/lib/gitignore.js.map +1 -0
- package/dist/lib/runtime-section.d.ts +118 -0
- package/dist/lib/runtime-section.d.ts.map +1 -0
- package/dist/lib/runtime-section.js +256 -0
- package/dist/lib/runtime-section.js.map +1 -0
- package/dist/lib/telemetry.d.ts +1 -1
- package/dist/lib/telemetry.d.ts.map +1 -1
- package/dist/lib/telemetry.js +4 -1
- package/dist/lib/telemetry.js.map +1 -1
- package/dist/queue/dead-letter.d.ts +5 -1
- package/dist/queue/dead-letter.d.ts.map +1 -1
- package/dist/queue/dead-letter.js +5 -1
- package/dist/queue/dead-letter.js.map +1 -1
- package/dist/queue/drain.d.ts +3 -2
- package/dist/queue/drain.d.ts.map +1 -1
- package/dist/queue/drain.js +3 -2
- package/dist/queue/drain.js.map +1 -1
- package/dist/queue/flush.d.ts +28 -12
- package/dist/queue/flush.d.ts.map +1 -1
- package/dist/queue/flush.js +43 -18
- package/dist/queue/flush.js.map +1 -1
- package/dist/queue/handlers/send-event.d.ts.map +1 -1
- package/dist/queue/handlers/send-event.js.map +1 -1
- package/dist/queue/index.d.ts +1 -2
- package/dist/queue/index.d.ts.map +1 -1
- package/dist/queue/index.js +2 -2
- package/dist/queue/index.js.map +1 -1
- package/dist/queue/paths.d.ts +4 -2
- package/dist/queue/paths.d.ts.map +1 -1
- package/dist/queue/paths.js +4 -2
- package/dist/queue/paths.js.map +1 -1
- package/dist/queue/process-file.d.ts +5 -1
- package/dist/queue/process-file.d.ts.map +1 -1
- package/dist/queue/process-file.js +5 -1
- package/dist/queue/process-file.js.map +1 -1
- package/dist/queue/snapshot.d.ts +4 -1
- package/dist/queue/snapshot.d.ts.map +1 -1
- package/dist/queue/snapshot.js +4 -1
- package/dist/queue/snapshot.js.map +1 -1
- package/dist/queue/spawn.d.ts +1 -3
- package/dist/queue/spawn.d.ts.map +1 -1
- package/dist/queue/spawn.js +1 -3
- package/dist/queue/spawn.js.map +1 -1
- package/dist/queue/submit.d.ts +6 -1
- package/dist/queue/submit.d.ts.map +1 -1
- package/dist/queue/submit.js +6 -1
- package/dist/queue/submit.js.map +1 -1
- package/dist/queue/types.d.ts +5 -1
- package/dist/queue/types.d.ts.map +1 -1
- package/dist/queue/types.js +5 -1
- package/dist/queue/types.js.map +1 -1
- package/dist/queue/worker-log.d.ts +3 -1
- package/dist/queue/worker-log.d.ts.map +1 -1
- package/dist/queue/worker-log.js +3 -1
- package/dist/queue/worker-log.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../../src/analytics/state.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAaH,oCAEC;AAED,8BAEC;AAOD,4CA6FC;AAQD,oCA2CC;AAcD,8BAwBC;AA8DD,gCA4CC;AAGD,gDAKC;AAGD,kDAEC;AArUD,mCAAoC;AACpC,2BAAoF;AACpF,+BAAqC;AACrC,0CAAuC;AACvC,mCAAwG;A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|
|
3
|
+
*
|
|
4
|
+
* Resolves the host transcript JSONL path for a session_id and tail-parses
|
|
5
|
+
* a slice of new bytes into individual messages.
|
|
6
|
+
*
|
|
7
|
+
* Claude Code stores per-session transcripts at:
|
|
8
|
+
* ~/.claude/projects/<sanitized(projectDir)>/<session_id>.jsonl
|
|
9
|
+
*
|
|
10
|
+
* where `sanitized` replaces every non-[a-zA-Z0-9] char with `-`.
|
|
11
|
+
*
|
|
12
|
+
* For Cursor: not wired up — `findClaudeTranscriptPath` returns null and
|
|
13
|
+
* the projector skips with `transcript_source: "missing"` until a Cursor
|
|
14
|
+
* path-resolution strategy lands.
|
|
15
|
+
*
|
|
16
|
+
* The parser is "tolerant of trailing partial lines and corrupt mid-file
|
|
17
|
+
* lines": it returns `last_complete_byte` so callers can bound their
|
|
18
|
+
* boundary detection to fully-parseable bytes only.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Sanitize a project directory path the same way Claude Code does.
|
|
22
|
+
* Replaces every non-alphanumeric character with `-`.
|
|
23
|
+
*
|
|
24
|
+
* Note: Claude Code also handles paths >200 chars by appending a hash
|
|
25
|
+
* suffix; we don't reproduce that here because (a) such long paths are
|
|
26
|
+
* rare and (b) the fallback {@link findClaudeTranscriptPath} can still
|
|
27
|
+
* locate the file by scanning the projects dir for `<session_id>.jsonl`
|
|
28
|
+
* if the simple-encoded path doesn't exist.
|
|
29
|
+
*/
|
|
30
|
+
export declare function sanitizeProjectPath(projectDir: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Resolve the Claude Code transcript JSONL path for a (projectDir, session_id).
|
|
33
|
+
*
|
|
34
|
+
* Tries the deterministic encoded path first; if missing, falls back to
|
|
35
|
+
* scanning `~/.claude/projects/*` for a matching `<session_id>.jsonl`.
|
|
36
|
+
* Returns null if no file is found.
|
|
37
|
+
*/
|
|
38
|
+
export declare function findClaudeTranscriptPath(projectDir: string, sessionId: string): string | null;
|
|
39
|
+
/** How many bytes the first-KB hash covers when computing a fresh fingerprint. */
|
|
40
|
+
export declare const FIRST_KB_HASH_LENGTH: number;
|
|
41
|
+
/**
|
|
42
|
+
* Compute sha256 over the first `maxBytes` (default 1024) bytes of the file.
|
|
43
|
+
* Returns empty string if the file doesn't exist or can't be opened. The
|
|
44
|
+
* hash is used by reset detection to catch in-place truncate+refill scenarios
|
|
45
|
+
* that would otherwise leave inode + size unchanged but content different.
|
|
46
|
+
*
|
|
47
|
+
* Important: callers MUST pass the SAME `maxBytes` on the recompute side as
|
|
48
|
+
* was used on the record side — otherwise the hash range differs between
|
|
49
|
+
* calls and a growing small file (< 1024 bytes) will spuriously trigger a
|
|
50
|
+
* "content_replaced" reset just because the hash now covers more bytes.
|
|
51
|
+
*
|
|
52
|
+
* The emit pipeline records the file's size-at-hash (`transcript_size_at_last_read`,
|
|
53
|
+
* capped at 1024) and uses that on every re-check so the comparison
|
|
54
|
+
* is stable across growth.
|
|
55
|
+
*/
|
|
56
|
+
export declare function firstKbSha256(transcriptPath: string, maxBytes?: number): string;
|
|
57
|
+
export interface SliceReadResult {
|
|
58
|
+
/** The bytes actually read (may be shorter than expected on truncate). */
|
|
59
|
+
bytes: Buffer;
|
|
60
|
+
/** True if file was truncated mid-read; caller should NOT advance state. */
|
|
61
|
+
truncated: boolean;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Read [from, to) bytes from `path`. If fewer bytes than expected come back
|
|
65
|
+
* (file was truncated between stat and read), returns `truncated: true` so
|
|
66
|
+
* the caller can bail out of the trigger without advancing state. Eventual
|
|
67
|
+
* consistency: the next trigger detects via inode/size/first-KB checks.
|
|
68
|
+
*/
|
|
69
|
+
export declare function readSlice(path: string, from: number, to: number): SliceReadResult;
|
|
70
|
+
export interface FileStat {
|
|
71
|
+
inode: number;
|
|
72
|
+
size: number;
|
|
73
|
+
}
|
|
74
|
+
/** Best-effort stat → {inode, size}. Throws on missing/inaccessible file. */
|
|
75
|
+
export declare function statTranscript(path: string): FileStat;
|
|
76
|
+
/** A single parsed transcript line plus its byte position in the file. */
|
|
77
|
+
export interface ParsedLine<T = unknown> {
|
|
78
|
+
/** Byte offset (file-relative) where this line starts. */
|
|
79
|
+
start: number;
|
|
80
|
+
/** Byte offset (file-relative) where the next line starts (= start + line bytes including the trailing newline). */
|
|
81
|
+
end: number;
|
|
82
|
+
/** Parsed JSON value. Null if the line was malformed (caller may filter). */
|
|
83
|
+
parsed: T | null;
|
|
84
|
+
}
|
|
85
|
+
export interface ParseJsonlResult<T = unknown> {
|
|
86
|
+
/** Parseable lines in order. Malformed mid-file lines have `parsed: null` (caller decides). */
|
|
87
|
+
lines: ParsedLine<T>[];
|
|
88
|
+
/**
|
|
89
|
+
* Byte offset (file-relative) of the end of the last fully-parseable line.
|
|
90
|
+
* Trailing partial / unterminated bytes are EXCLUDED. If no complete line
|
|
91
|
+
* was seen, equals `base_offset`.
|
|
92
|
+
*/
|
|
93
|
+
last_complete_byte: number;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Parse a buffer of JSONL bytes that begins at file-position `baseOffset`.
|
|
97
|
+
* Splits on `\n`; for each segment with a terminating newline, attempts
|
|
98
|
+
* JSON.parse — failures get `parsed: null` (so position math still works
|
|
99
|
+
* for subsequent lines) and a debug log.
|
|
100
|
+
*
|
|
101
|
+
* The trailing segment after the last `\n` is treated as an INCOMPLETE
|
|
102
|
+
* line: it's neither parsed nor reflected in `last_complete_byte`, so the
|
|
103
|
+
* next read picks it up once more bytes arrive (or never if it's a true
|
|
104
|
+
* partial-write at SessionEnd).
|
|
105
|
+
*/
|
|
106
|
+
export declare function parseJsonl<T = unknown>(buf: Buffer, baseOffset: number): ParseJsonlResult<T>;
|
|
107
|
+
/** Minimal Claude transcript line shape this module reasons about. */
|
|
108
|
+
export interface TranscriptLine {
|
|
109
|
+
type: "user" | "assistant" | "system" | "summary" | string;
|
|
110
|
+
message?: {
|
|
111
|
+
content?: unknown;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Claude Code's structural marker for host-injected user messages (slash
|
|
115
|
+
* command bodies, Stop-hook feedback strings, etc.). Boundary detection
|
|
116
|
+
* does NOT skip these — they ARE valid turn-safe boundary candidates
|
|
117
|
+
* because they advance the agent (e.g., a hook feedback message at slice
|
|
118
|
+
* tail SHOULD defer the cut until the agent's retry response lands).
|
|
119
|
+
* Projection-time turn semantics (open new vs continuation) are decided
|
|
120
|
+
* separately in `projection.ts`.
|
|
121
|
+
*/
|
|
122
|
+
isMeta?: boolean;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Returns true iff the given line is a "human-text" user message — i.e.,
|
|
126
|
+
* a user message whose content carries actual typed text (not a tool_result).
|
|
127
|
+
*
|
|
128
|
+
* Both real user prompts AND host-injected user messages (isMeta=true) qualify
|
|
129
|
+
* here: from the boundary-detection perspective, both advance the agent and
|
|
130
|
+
* trigger response activity, so the cut should defer at either to avoid
|
|
131
|
+
* splitting a turn mid-response. Per-turn projection semantics decide
|
|
132
|
+
* separately whether an isMeta line opens a new turn or continues an open one.
|
|
133
|
+
*
|
|
134
|
+
* Detection mirrors Claude Code's extractToolStats:599-609.
|
|
135
|
+
*/
|
|
136
|
+
export declare function isHumanTextUserMessage(line: TranscriptLine | null): boolean;
|
|
137
|
+
/** Returns true iff the line is an assistant message. */
|
|
138
|
+
export declare function isAssistantMessage(line: TranscriptLine | null): boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Turn-safe boundary detection per §4.8.2:
|
|
141
|
+
*
|
|
142
|
+
* Boundary = byte position of the latest human-text user message in the
|
|
143
|
+
* new data that has NO assistant message line after it.
|
|
144
|
+
* If no such message exists, boundary = lastCompleteByte.
|
|
145
|
+
*
|
|
146
|
+
* `isFinal` overrides: at SessionEnd, return `lastCompleteByte` directly
|
|
147
|
+
* (don't defer the trailing partial-turn) — the host is done writing.
|
|
148
|
+
*/
|
|
149
|
+
export declare function findTurnSafeBoundary(lines: ParsedLine<TranscriptLine>[], lastCompleteByte: number, isFinal: boolean): number;
|
|
150
|
+
//# sourceMappingURL=transcript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript.d.ts","sourceRoot":"","sources":["../../src/analytics/transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAYH;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAsB7F;AAMD,kFAAkF;AAClF,eAAO,MAAM,oBAAoB,EAAE,MAAa,CAAC;AAEjD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,cAAc,EAAE,MAAM,EAAE,QAAQ,GAAE,MAA6B,GAAG,MAAM,CAwBrG;AAMD,MAAM,WAAW,eAAe;IAC5B,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,SAAS,EAAE,OAAO,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,eAAe,CAoBjF;AAED,MAAM,WAAW,QAAQ;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,6EAA6E;AAC7E,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAGrD;AAMD,0EAA0E;AAC1E,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,OAAO;IACnC,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,oHAAoH;IACpH,GAAG,EAAE,MAAM,CAAC;IACZ,6EAA6E;IAC7E,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB,CAAC,CAAC,GAAG,OAAO;IACzC,+FAA+F;IAC/F,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;IACvB;;;;OAIG;IACH,kBAAkB,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAgC5F;AAMD,sEAAsE;AACtE,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;IAC3D,OAAO,CAAC,EAAE;QACN,OAAO,CAAC,EAAE,OAAO,CAAC;KACrB,CAAC;IACF;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,GAAG,OAAO,CAqB3E;AAED,yDAAyD;AACzD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,GAAG,OAAO,CAEvE;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAChC,KAAK,EAAE,UAAU,CAAC,cAAc,CAAC,EAAE,EACnC,gBAAgB,EAAE,MAAM,EACxB,OAAO,EAAE,OAAO,GACjB,MAAM,CAuBR"}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* IronBee CLI — Transcript Locator + Parser
|
|
4
|
+
*
|
|
5
|
+
* Resolves the host transcript JSONL path for a session_id and tail-parses
|
|
6
|
+
* a slice of new bytes into individual messages.
|
|
7
|
+
*
|
|
8
|
+
* Claude Code stores per-session transcripts at:
|
|
9
|
+
* ~/.claude/projects/<sanitized(projectDir)>/<session_id>.jsonl
|
|
10
|
+
*
|
|
11
|
+
* where `sanitized` replaces every non-[a-zA-Z0-9] char with `-`.
|
|
12
|
+
*
|
|
13
|
+
* For Cursor: not wired up — `findClaudeTranscriptPath` returns null and
|
|
14
|
+
* the projector skips with `transcript_source: "missing"` until a Cursor
|
|
15
|
+
* path-resolution strategy lands.
|
|
16
|
+
*
|
|
17
|
+
* The parser is "tolerant of trailing partial lines and corrupt mid-file
|
|
18
|
+
* lines": it returns `last_complete_byte` so callers can bound their
|
|
19
|
+
* boundary detection to fully-parseable bytes only.
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.FIRST_KB_HASH_LENGTH = void 0;
|
|
23
|
+
exports.sanitizeProjectPath = sanitizeProjectPath;
|
|
24
|
+
exports.findClaudeTranscriptPath = findClaudeTranscriptPath;
|
|
25
|
+
exports.firstKbSha256 = firstKbSha256;
|
|
26
|
+
exports.readSlice = readSlice;
|
|
27
|
+
exports.statTranscript = statTranscript;
|
|
28
|
+
exports.parseJsonl = parseJsonl;
|
|
29
|
+
exports.isHumanTextUserMessage = isHumanTextUserMessage;
|
|
30
|
+
exports.isAssistantMessage = isAssistantMessage;
|
|
31
|
+
exports.findTurnSafeBoundary = findTurnSafeBoundary;
|
|
32
|
+
const crypto_1 = require("crypto");
|
|
33
|
+
const fs_1 = require("fs");
|
|
34
|
+
const os_1 = require("os");
|
|
35
|
+
const path_1 = require("path");
|
|
36
|
+
const logger_1 = require("../lib/logger");
|
|
37
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
38
|
+
// Path resolution
|
|
39
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
40
|
+
/**
|
|
41
|
+
* Sanitize a project directory path the same way Claude Code does.
|
|
42
|
+
* Replaces every non-alphanumeric character with `-`.
|
|
43
|
+
*
|
|
44
|
+
* Note: Claude Code also handles paths >200 chars by appending a hash
|
|
45
|
+
* suffix; we don't reproduce that here because (a) such long paths are
|
|
46
|
+
* rare and (b) the fallback {@link findClaudeTranscriptPath} can still
|
|
47
|
+
* locate the file by scanning the projects dir for `<session_id>.jsonl`
|
|
48
|
+
* if the simple-encoded path doesn't exist.
|
|
49
|
+
*/
|
|
50
|
+
function sanitizeProjectPath(projectDir) {
|
|
51
|
+
return projectDir.replace(/[^a-zA-Z0-9]/g, "-");
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Resolve the Claude Code transcript JSONL path for a (projectDir, session_id).
|
|
55
|
+
*
|
|
56
|
+
* Tries the deterministic encoded path first; if missing, falls back to
|
|
57
|
+
* scanning `~/.claude/projects/*` for a matching `<session_id>.jsonl`.
|
|
58
|
+
* Returns null if no file is found.
|
|
59
|
+
*/
|
|
60
|
+
function findClaudeTranscriptPath(projectDir, sessionId) {
|
|
61
|
+
const projectsDir = (0, path_1.join)((0, os_1.homedir)(), ".claude", "projects");
|
|
62
|
+
const directPath = (0, path_1.join)(projectsDir, sanitizeProjectPath(projectDir), `${sessionId}.jsonl`);
|
|
63
|
+
if ((0, fs_1.existsSync)(directPath)) {
|
|
64
|
+
return directPath;
|
|
65
|
+
}
|
|
66
|
+
// Fallback: scan project subdirs for a transcript with this session_id.
|
|
67
|
+
if (!(0, fs_1.existsSync)(projectsDir)) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
const subdirs = (0, fs_1.readdirSync)(projectsDir);
|
|
72
|
+
for (const sub of subdirs) {
|
|
73
|
+
const candidate = (0, path_1.join)(projectsDir, sub, `${sessionId}.jsonl`);
|
|
74
|
+
if ((0, fs_1.existsSync)(candidate)) {
|
|
75
|
+
return candidate;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch (e) {
|
|
80
|
+
logger_1.logger.debug(`transcript: scan ${projectsDir} failed: ${e instanceof Error ? e.message : e}`);
|
|
81
|
+
}
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
85
|
+
// First-KB hash (for in-place truncate+refill detection — §4.11)
|
|
86
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
87
|
+
/** How many bytes the first-KB hash covers when computing a fresh fingerprint. */
|
|
88
|
+
exports.FIRST_KB_HASH_LENGTH = 1024;
|
|
89
|
+
/**
|
|
90
|
+
* Compute sha256 over the first `maxBytes` (default 1024) bytes of the file.
|
|
91
|
+
* Returns empty string if the file doesn't exist or can't be opened. The
|
|
92
|
+
* hash is used by reset detection to catch in-place truncate+refill scenarios
|
|
93
|
+
* that would otherwise leave inode + size unchanged but content different.
|
|
94
|
+
*
|
|
95
|
+
* Important: callers MUST pass the SAME `maxBytes` on the recompute side as
|
|
96
|
+
* was used on the record side — otherwise the hash range differs between
|
|
97
|
+
* calls and a growing small file (< 1024 bytes) will spuriously trigger a
|
|
98
|
+
* "content_replaced" reset just because the hash now covers more bytes.
|
|
99
|
+
*
|
|
100
|
+
* The emit pipeline records the file's size-at-hash (`transcript_size_at_last_read`,
|
|
101
|
+
* capped at 1024) and uses that on every re-check so the comparison
|
|
102
|
+
* is stable across growth.
|
|
103
|
+
*/
|
|
104
|
+
function firstKbSha256(transcriptPath, maxBytes = exports.FIRST_KB_HASH_LENGTH) {
|
|
105
|
+
let fd = null;
|
|
106
|
+
try {
|
|
107
|
+
if (!(0, fs_1.existsSync)(transcriptPath) || maxBytes <= 0) {
|
|
108
|
+
return "";
|
|
109
|
+
}
|
|
110
|
+
fd = (0, fs_1.openSync)(transcriptPath, "r");
|
|
111
|
+
const buf = Buffer.alloc(maxBytes);
|
|
112
|
+
const n = (0, fs_1.readSync)(fd, buf, 0, maxBytes, 0);
|
|
113
|
+
const h = (0, crypto_1.createHash)("sha256");
|
|
114
|
+
h.update(buf.subarray(0, n));
|
|
115
|
+
return h.digest("hex");
|
|
116
|
+
}
|
|
117
|
+
catch (e) {
|
|
118
|
+
logger_1.logger.debug(`transcript: first-KB hash failed for ${transcriptPath}: ${e instanceof Error ? e.message : e}`);
|
|
119
|
+
return "";
|
|
120
|
+
}
|
|
121
|
+
finally {
|
|
122
|
+
if (fd !== null) {
|
|
123
|
+
try {
|
|
124
|
+
(0, fs_1.closeSync)(fd);
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
// ignore
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Read [from, to) bytes from `path`. If fewer bytes than expected come back
|
|
134
|
+
* (file was truncated between stat and read), returns `truncated: true` so
|
|
135
|
+
* the caller can bail out of the trigger without advancing state. Eventual
|
|
136
|
+
* consistency: the next trigger detects via inode/size/first-KB checks.
|
|
137
|
+
*/
|
|
138
|
+
function readSlice(path, from, to) {
|
|
139
|
+
const expected = Math.max(0, to - from);
|
|
140
|
+
if (expected === 0) {
|
|
141
|
+
return { bytes: Buffer.alloc(0), truncated: false };
|
|
142
|
+
}
|
|
143
|
+
const fd = (0, fs_1.openSync)(path, "r");
|
|
144
|
+
try {
|
|
145
|
+
const buf = Buffer.alloc(expected);
|
|
146
|
+
const n = (0, fs_1.readSync)(fd, buf, 0, expected, from);
|
|
147
|
+
return {
|
|
148
|
+
bytes: buf.subarray(0, n),
|
|
149
|
+
truncated: n < expected,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
finally {
|
|
153
|
+
try {
|
|
154
|
+
(0, fs_1.closeSync)(fd);
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
// ignore
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/** Best-effort stat → {inode, size}. Throws on missing/inaccessible file. */
|
|
162
|
+
function statTranscript(path) {
|
|
163
|
+
const s = (0, fs_1.statSync)(path);
|
|
164
|
+
return { inode: Number(s.ino), size: Number(s.size) };
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Parse a buffer of JSONL bytes that begins at file-position `baseOffset`.
|
|
168
|
+
* Splits on `\n`; for each segment with a terminating newline, attempts
|
|
169
|
+
* JSON.parse — failures get `parsed: null` (so position math still works
|
|
170
|
+
* for subsequent lines) and a debug log.
|
|
171
|
+
*
|
|
172
|
+
* The trailing segment after the last `\n` is treated as an INCOMPLETE
|
|
173
|
+
* line: it's neither parsed nor reflected in `last_complete_byte`, so the
|
|
174
|
+
* next read picks it up once more bytes arrive (or never if it's a true
|
|
175
|
+
* partial-write at SessionEnd).
|
|
176
|
+
*/
|
|
177
|
+
function parseJsonl(buf, baseOffset) {
|
|
178
|
+
const lines = [];
|
|
179
|
+
let cursor = 0;
|
|
180
|
+
let lastCompleteByte = baseOffset;
|
|
181
|
+
while (cursor < buf.length) {
|
|
182
|
+
const nlIdx = buf.indexOf(0x0a /* '\n' */, cursor);
|
|
183
|
+
if (nlIdx === -1) {
|
|
184
|
+
// Trailing incomplete line — leave for next read.
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
const lineBytes = buf.subarray(cursor, nlIdx);
|
|
188
|
+
const start = baseOffset + cursor;
|
|
189
|
+
const end = baseOffset + nlIdx + 1;
|
|
190
|
+
const text = lineBytes.toString("utf-8");
|
|
191
|
+
let parsed = null;
|
|
192
|
+
if (text.length > 0) {
|
|
193
|
+
try {
|
|
194
|
+
parsed = JSON.parse(text);
|
|
195
|
+
}
|
|
196
|
+
catch (e) {
|
|
197
|
+
logger_1.logger.debug(`transcript: dropped malformed line at byte ${start}: ${e instanceof Error ? e.message : e}`);
|
|
198
|
+
parsed = null;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
lines.push({ start, end, parsed });
|
|
202
|
+
lastCompleteByte = end;
|
|
203
|
+
cursor = nlIdx + 1;
|
|
204
|
+
}
|
|
205
|
+
return { lines, last_complete_byte: lastCompleteByte };
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Returns true iff the given line is a "human-text" user message — i.e.,
|
|
209
|
+
* a user message whose content carries actual typed text (not a tool_result).
|
|
210
|
+
*
|
|
211
|
+
* Both real user prompts AND host-injected user messages (isMeta=true) qualify
|
|
212
|
+
* here: from the boundary-detection perspective, both advance the agent and
|
|
213
|
+
* trigger response activity, so the cut should defer at either to avoid
|
|
214
|
+
* splitting a turn mid-response. Per-turn projection semantics decide
|
|
215
|
+
* separately whether an isMeta line opens a new turn or continues an open one.
|
|
216
|
+
*
|
|
217
|
+
* Detection mirrors Claude Code's extractToolStats:599-609.
|
|
218
|
+
*/
|
|
219
|
+
function isHumanTextUserMessage(line) {
|
|
220
|
+
if (line === null || line.type !== "user" || line.message === undefined) {
|
|
221
|
+
return false;
|
|
222
|
+
}
|
|
223
|
+
const content = line.message.content;
|
|
224
|
+
if (typeof content === "string") {
|
|
225
|
+
return content.trim().length > 0;
|
|
226
|
+
}
|
|
227
|
+
if (Array.isArray(content)) {
|
|
228
|
+
for (const block of content) {
|
|
229
|
+
if (block !== null
|
|
230
|
+
&& typeof block === "object"
|
|
231
|
+
&& block.type === "text"
|
|
232
|
+
&& "text" in block) {
|
|
233
|
+
return true;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return false;
|
|
238
|
+
}
|
|
239
|
+
/** Returns true iff the line is an assistant message. */
|
|
240
|
+
function isAssistantMessage(line) {
|
|
241
|
+
return line !== null && line.type === "assistant";
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Turn-safe boundary detection per §4.8.2:
|
|
245
|
+
*
|
|
246
|
+
* Boundary = byte position of the latest human-text user message in the
|
|
247
|
+
* new data that has NO assistant message line after it.
|
|
248
|
+
* If no such message exists, boundary = lastCompleteByte.
|
|
249
|
+
*
|
|
250
|
+
* `isFinal` overrides: at SessionEnd, return `lastCompleteByte` directly
|
|
251
|
+
* (don't defer the trailing partial-turn) — the host is done writing.
|
|
252
|
+
*/
|
|
253
|
+
function findTurnSafeBoundary(lines, lastCompleteByte, isFinal) {
|
|
254
|
+
if (isFinal) {
|
|
255
|
+
return lastCompleteByte;
|
|
256
|
+
}
|
|
257
|
+
// Walk lines once, recording the position of the latest human-text user
|
|
258
|
+
// line and tracking whether any assistant line follows it.
|
|
259
|
+
let latestHumanTextStart = -1;
|
|
260
|
+
let hasAssistantAfterLatest = false;
|
|
261
|
+
for (const ln of lines) {
|
|
262
|
+
if (isHumanTextUserMessage(ln.parsed)) {
|
|
263
|
+
latestHumanTextStart = ln.start;
|
|
264
|
+
hasAssistantAfterLatest = false;
|
|
265
|
+
}
|
|
266
|
+
else if (latestHumanTextStart !== -1
|
|
267
|
+
&& isAssistantMessage(ln.parsed)) {
|
|
268
|
+
hasAssistantAfterLatest = true;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
if (latestHumanTextStart === -1 || hasAssistantAfterLatest) {
|
|
272
|
+
return lastCompleteByte;
|
|
273
|
+
}
|
|
274
|
+
return latestHumanTextStart;
|
|
275
|
+
}
|
|
276
|
+
//# sourceMappingURL=transcript.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript.js","sourceRoot":"","sources":["../../src/analytics/transcript.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAsBH,kDAEC;AASD,4DAsBC;AAwBD,sCAwBC;AAmBD,8BAoBC;AAQD,wCAGC;AAsCD,gCAgCC;AAoCD,wDAqBC;AAGD,gDAEC;AAYD,oDA2BC;AAlUD,mCAAoC;AACpC,2BAA6F;AAC7F,2BAA6B;AAC7B,+BAA4B;AAC5B,0CAAuC;AAEvC,4EAA4E;AAC5E,kBAAkB;AAClB,4EAA4E;AAE5E;;;;;;;;;GASG;AACH,SAAgB,mBAAmB,CAAC,UAAkB;IAClD,OAAO,UAAU,CAAC,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;AACpD,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,wBAAwB,CAAC,UAAkB,EAAE,SAAiB;IAC1E,MAAM,WAAW,GAAW,IAAA,WAAI,EAAC,IAAA,YAAO,GAAE,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;IACnE,MAAM,UAAU,GAAW,IAAA,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