@rryando/arcs 5.2.0 → 5.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -16
- package/dist/cli/commands/bundle.js +39 -0
- package/dist/cli/commands/bundle.js.map +1 -1
- package/dist/cli/commands/web.js +2 -2
- package/dist/cli/commands/web.js.map +1 -1
- package/dist/cli/config.d.ts +18 -0
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +46 -0
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +218 -35
- package/dist/cli/setup.js.map +1 -1
- package/dist/utils/json-schemas.d.ts +9 -9
- package/dist/utils/json-schemas.d.ts.map +1 -1
- package/dist/utils/json-schemas.js +1 -1
- package/dist/utils/json-schemas.js.map +1 -1
- package/dist/utils/run-transcript.d.ts +138 -0
- package/dist/utils/run-transcript.d.ts.map +1 -0
- package/dist/utils/run-transcript.js +146 -0
- package/dist/utils/run-transcript.js.map +1 -0
- package/dist/utils/storage-utils.d.ts +1 -1
- package/dist/utils/storage-utils.d.ts.map +1 -1
- package/dist/utils/storage-utils.js +1 -1
- package/dist/utils/storage-utils.js.map +1 -1
- package/dist/web-client/assets/{GraphCanvas-DvTmx2os.js → GraphCanvas-BgWF1rB_.js} +1 -1
- package/dist/web-client/assets/{MarkdownEditor-B8j_5lK7.js → MarkdownEditor-5buYPQ1d.js} +1 -1
- package/dist/web-client/assets/{abnfDiagram-VRR7QNED-DZ5c8NM5.js → abnfDiagram-VRR7QNED-AjQ08-zY.js} +1 -1
- package/dist/web-client/assets/architecture-TIHT7OUA-a3lTAuFS.js +1 -0
- package/dist/web-client/assets/{architectureDiagram-ZJ3FMSHR-DeNroB33.js → architectureDiagram-ZJ3FMSHR-CtW2pYEp.js} +1 -1
- package/dist/web-client/assets/{blockDiagram-677ZJIJ3-C92i1GHh.js → blockDiagram-677ZJIJ3-DE6HRcpA.js} +1 -1
- package/dist/web-client/assets/{c4Diagram-LMCZKHZV-BniYzyYJ.js → c4Diagram-LMCZKHZV-Rn6iQdUl.js} +1 -1
- package/dist/web-client/assets/channel-Rxk7gzWl.js +1 -0
- package/dist/web-client/assets/{chunk-32BRIVSS-DXA4fMwe.js → chunk-32BRIVSS-C4-ay_Qd.js} +1 -1
- package/dist/web-client/assets/{chunk-52WLFC77-DxLpDT5g.js → chunk-52WLFC77-Bib0DU0H.js} +1 -1
- package/dist/web-client/assets/{chunk-C7G6YPKG-DC22BvA6.js → chunk-C7G6YPKG-BLphnESE.js} +1 -1
- package/dist/web-client/assets/{chunk-EX3LRPZG-CP5bMsNz.js → chunk-EX3LRPZG-CzvkrPNM.js} +1 -1
- package/dist/web-client/assets/{chunk-FWX5IMBZ-CRhTkdyH.js → chunk-FWX5IMBZ-BFTR_OLz.js} +2 -2
- package/dist/web-client/assets/{chunk-HOUHSVGY-BL8xdKlN.js → chunk-HOUHSVGY-CZS3ExUR.js} +1 -1
- package/dist/web-client/assets/{chunk-ICXQ74PX-B7Ur00R9.js → chunk-ICXQ74PX-iWFpNZgv.js} +1 -1
- package/dist/web-client/assets/{chunk-MOJQB5TN-D9EnTuIj.js → chunk-MOJQB5TN-opEQCwVq.js} +1 -1
- package/dist/web-client/assets/{chunk-OGEWGWER-Dr-xsHrU.js → chunk-OGEWGWER-NCfmjyhi.js} +1 -1
- package/dist/web-client/assets/{chunk-PUDLZKDR-BIrspPOB.js → chunk-PUDLZKDR-D3_A--Z2.js} +1 -1
- package/dist/web-client/assets/{chunk-Q4XR5HBZ-Dfip_4XA.js → chunk-Q4XR5HBZ-D6s-qZLi.js} +1 -1
- package/dist/web-client/assets/{chunk-V7JOEXUC-CWqwzV_g.js → chunk-V7JOEXUC-DTqLR-bZ.js} +1 -1
- package/dist/web-client/assets/{chunk-VAUOI2AC-EosDVEFn.js → chunk-VAUOI2AC-Gsd0Itap.js} +1 -1
- package/dist/web-client/assets/{chunk-VR4S4FIN-DnMox7F5.js → chunk-VR4S4FIN-Cdo_MeDQ.js} +1 -1
- package/dist/web-client/assets/{chunk-WYO6CB5R-B3xja0Q5.js → chunk-WYO6CB5R-n7FhYrli.js} +1 -1
- package/dist/web-client/assets/{chunk-ZGVPDNZ5-BGoIOVsc.js → chunk-ZGVPDNZ5-DU1Jcue0.js} +1 -1
- package/dist/web-client/assets/classDiagram-OUVF2IWQ-BG5uYDvC.js +1 -0
- package/dist/web-client/assets/classDiagram-v2-EOCWNBFH-BG5uYDvC.js +1 -0
- package/dist/web-client/assets/{cynefin-VYW2F7L2-BlBnSViH.js → cynefin-VYW2F7L2-D-gD9LCO.js} +1 -1
- package/dist/web-client/assets/{cynefinDiagram-TSTJHNR4-jRcAddSh.js → cynefinDiagram-TSTJHNR4-BFGkcrNl.js} +1 -1
- package/dist/web-client/assets/{dagre-VKFMJZFB-D4elj7jV.js → dagre-VKFMJZFB-BUaC6fks.js} +1 -1
- package/dist/web-client/assets/{diagram-FQU43EPY-D7OKzbLh.js → diagram-FQU43EPY-Ckgu02XC.js} +1 -1
- package/dist/web-client/assets/{diagram-G47NLZAW-DBF9p-RV.js → diagram-G47NLZAW-BickHhmE.js} +1 -1
- package/dist/web-client/assets/{diagram-NH7WQ7WH-CpE02PRM.js → diagram-NH7WQ7WH-CoqgJpcU.js} +1 -1
- package/dist/web-client/assets/{diagram-OA4YK3LP-BdJ1lOcZ.js → diagram-OA4YK3LP-CTSZWqCe.js} +1 -1
- package/dist/web-client/assets/{diagram-WEI45ONY-BpPxpOcu.js → diagram-WEI45ONY-D7xd1naU.js} +1 -1
- package/dist/web-client/assets/{ebnfDiagram-CCIWWBDH-DLKdgImF.js → ebnfDiagram-CCIWWBDH-FESKYpKQ.js} +1 -1
- package/dist/web-client/assets/{erDiagram-Q63AITRT-c0bbf0vk.js → erDiagram-Q63AITRT-C-879ftU.js} +1 -1
- package/dist/web-client/assets/eventmodeling-45OFAUF4-C3kRZCei.js +1 -0
- package/dist/web-client/assets/flowDiagram-23GEKE2U-QKWFycdH.js +1 -0
- package/dist/web-client/assets/{ganttDiagram-NO4QXBWP-Ynj8Qkax.js → ganttDiagram-NO4QXBWP-mIX5nPpv.js} +1 -1
- package/dist/web-client/assets/{gitGraph-TEB2WS4Q-j-MdxZrn.js → gitGraph-TEB2WS4Q-DlEDJ1IK.js} +1 -1
- package/dist/web-client/assets/{gitGraphDiagram-IHSO6WYX-SaPe2Npn.js → gitGraphDiagram-IHSO6WYX-D2fXD4AO.js} +1 -1
- package/dist/web-client/assets/index-BsYR-C8u.js +61 -0
- package/dist/web-client/assets/index-Cc5DCTOr.css +2 -0
- package/dist/web-client/assets/{info-DKCQHKI2-DzsnPugh.js → info-DKCQHKI2-jinbCROt.js} +1 -1
- package/dist/web-client/assets/{infoDiagram-FWYZ7A6U-e6BJvSRj.js → infoDiagram-FWYZ7A6U-CM-A4TL8.js} +1 -1
- package/dist/web-client/assets/{ishikawaDiagram-FXEZZL3T-DI1KDN2v.js → ishikawaDiagram-FXEZZL3T-BdFpHwp4.js} +1 -1
- package/dist/web-client/assets/{journeyDiagram-5HDEW3XC-BQbFOIm6.js → journeyDiagram-5HDEW3XC-BwDWz25z.js} +1 -1
- package/dist/web-client/assets/{kanban-definition-HUTT4EX6-D5DV7Dh0.js → kanban-definition-HUTT4EX6-_2QXjSvx.js} +1 -1
- package/dist/web-client/assets/{line-D_qHyqs1.js → line-HCziev87.js} +1 -1
- package/dist/web-client/assets/{mermaid-parser.core-VzGX5B89.js → mermaid-parser.core-C4139mkz.js} +3 -3
- package/dist/web-client/assets/{mermaid.core-BqWcehVs.js → mermaid.core-ocHwkZiF.js} +3 -3
- package/dist/web-client/assets/{mindmap-definition-LN4V7U3C-CcZZrFcy.js → mindmap-definition-LN4V7U3C-DHyCmflp.js} +1 -1
- package/dist/web-client/assets/{packet-7NZHBO7P-DWMuocpD.js → packet-7NZHBO7P-Bk0w_irl.js} +1 -1
- package/dist/web-client/assets/{pegDiagram-2B236MQR-CQfp4S-y.js → pegDiagram-2B236MQR-D_GrmL93.js} +1 -1
- package/dist/web-client/assets/{pie-RZYD4A2V-BlI6y28n.js → pie-RZYD4A2V-B6VIAbyj.js} +1 -1
- package/dist/web-client/assets/{pieDiagram-ENE6RG2P-DEsRhIVS.js → pieDiagram-ENE6RG2P-CiR2Y8y2.js} +1 -1
- package/dist/web-client/assets/{quadrantDiagram-ABIIQ3AL-BZCSbtlm.js → quadrantDiagram-ABIIQ3AL-CLlicKmV.js} +1 -1
- package/dist/web-client/assets/{radar-I7S5WNFK-DlwfjSpa.js → radar-I7S5WNFK-B53XVRSZ.js} +1 -1
- package/dist/web-client/assets/{railroad-3IZDKUUU-Be-bZpf0.js → railroad-3IZDKUUU-Dn8TN2M-.js} +1 -1
- package/dist/web-client/assets/railroad-abnf-AHOZXSZD-UrOKy6yx.js +1 -0
- package/dist/web-client/assets/railroad-ebnf-EBAXGLYW-Bx73sfMZ.js +1 -0
- package/dist/web-client/assets/railroad-peg-LSFZ7HO6-C4QEje-y.js +1 -0
- package/dist/web-client/assets/{railroadDiagram-RFXS5EU6-ClVubHv1.js → railroadDiagram-RFXS5EU6-C6kZwOio.js} +1 -1
- package/dist/web-client/assets/{requirementDiagram-TGXJPOKE-swYyFYJk.js → requirementDiagram-TGXJPOKE-D2b1MeP8.js} +1 -1
- package/dist/web-client/assets/{sankeyDiagram-HTMAVEWB-LAu1XR2n.js → sankeyDiagram-HTMAVEWB-pS_Ufq1E.js} +1 -1
- package/dist/web-client/assets/{sequenceDiagram-DBY2YBRQ-XvIU8hX9.js → sequenceDiagram-DBY2YBRQ-BrsKXNzu.js} +1 -1
- package/dist/web-client/assets/{stateDiagram-2N3HPSRC-C3nbJ1dX.js → stateDiagram-2N3HPSRC-BuQKu3i0.js} +1 -1
- package/dist/web-client/assets/stateDiagram-v2-6OUMAXLB-BhqgaxDu.js +1 -0
- package/dist/web-client/assets/{swimlanes-5IMT3BWC-BF5fFeNe.js → swimlanes-5IMT3BWC-CzoImfTA.js} +1 -1
- package/dist/web-client/assets/swimlanesDiagram-G3AALYLV-CHOEI9hI.js +8 -0
- package/dist/web-client/assets/{timeline-definition-FHXFAJF6-CjK82kFp.js → timeline-definition-FHXFAJF6-DvezW7Fr.js} +1 -1
- package/dist/web-client/assets/{treeView-QDETBFTQ-DBRGCYnY.js → treeView-QDETBFTQ-xu58R4kS.js} +1 -1
- package/dist/web-client/assets/{treemap-6X3UGDF4-BIexMw3j.js → treemap-6X3UGDF4-DMYBAOW1.js} +1 -1
- package/dist/web-client/assets/{vennDiagram-L72KCM5P-DOjvh0XG.js → vennDiagram-L72KCM5P-l1CbC7Ig.js} +1 -1
- package/dist/web-client/assets/{wardley-OPB4EBWU-Dxw6mW95.js → wardley-OPB4EBWU-G3zmnnM0.js} +1 -1
- package/dist/web-client/assets/{wardleyDiagram-EHGQE667-D1A7JTB_.js → wardleyDiagram-EHGQE667-Dl2I79Vx.js} +1 -1
- package/dist/web-client/assets/{xychartDiagram-FW5EYKEG-CxvobQJD.js → xychartDiagram-FW5EYKEG-BWfge21N.js} +1 -1
- package/dist/web-client/index.html +2 -2
- package/dist/web-server/app.d.ts.map +1 -1
- package/dist/web-server/app.js +11 -7
- package/dist/web-server/app.js.map +1 -1
- package/dist/web-server/ask-prompt.d.ts +70 -0
- package/dist/web-server/ask-prompt.d.ts.map +1 -0
- package/dist/web-server/ask-prompt.js +238 -0
- package/dist/web-server/ask-prompt.js.map +1 -0
- package/dist/web-server/index.d.ts.map +1 -1
- package/dist/web-server/index.js +56 -3
- package/dist/web-server/index.js.map +1 -1
- package/dist/web-server/respond.d.ts.map +1 -1
- package/dist/web-server/respond.js +2 -1
- package/dist/web-server/respond.js.map +1 -1
- package/dist/web-server/routes/ask.d.ts +29 -0
- package/dist/web-server/routes/ask.d.ts.map +1 -0
- package/dist/web-server/routes/ask.js +698 -0
- package/dist/web-server/routes/ask.js.map +1 -0
- package/dist/web-server/routes/changes.d.ts +35 -0
- package/dist/web-server/routes/changes.d.ts.map +1 -0
- package/dist/web-server/routes/changes.js +93 -0
- package/dist/web-server/routes/changes.js.map +1 -0
- package/dist/web-server/routes/runners.d.ts +15 -0
- package/dist/web-server/routes/runners.d.ts.map +1 -0
- package/dist/web-server/routes/runners.js +66 -0
- package/dist/web-server/routes/runners.js.map +1 -0
- package/dist/web-server/routes/workspace.d.ts +2 -2
- package/dist/web-server/routes/workspace.js +4 -4
- package/dist/web-server/run-diff.d.ts +188 -0
- package/dist/web-server/run-diff.d.ts.map +1 -0
- package/dist/web-server/run-diff.js +739 -0
- package/dist/web-server/run-diff.js.map +1 -0
- package/dist/web-server/run-driver.d.ts +102 -2
- package/dist/web-server/run-driver.d.ts.map +1 -1
- package/dist/web-server/run-driver.js +495 -1
- package/dist/web-server/run-driver.js.map +1 -1
- package/dist/web-server/run-event-log.d.ts +13 -6
- package/dist/web-server/run-event-log.d.ts.map +1 -1
- package/dist/web-server/run-event-log.js +70 -25
- package/dist/web-server/run-event-log.js.map +1 -1
- package/dist/web-server/run-store.d.ts +201 -0
- package/dist/web-server/run-store.d.ts.map +1 -0
- package/dist/web-server/run-store.js +304 -0
- package/dist/web-server/run-store.js.map +1 -0
- package/dist/web-server/watcher.d.ts.map +1 -1
- package/dist/web-server/watcher.js +4 -0
- package/dist/web-server/watcher.js.map +1 -1
- package/opencode/arcs/manifest.json +8 -8
- package/package.json +1 -1
- package/scripts/deploy-claudecode-bundle.mjs +1 -1
- package/scripts/deploy-opencode-bundle.mjs +1 -1
- package/scripts/deploy-pi-bundle.mjs +468 -0
- package/scripts/lint-bundle.mjs +1 -1
- package/dist/shared/session-vocabulary.d.ts +0 -88
- package/dist/shared/session-vocabulary.d.ts.map +0 -1
- package/dist/shared/session-vocabulary.js +0 -114
- package/dist/shared/session-vocabulary.js.map +0 -1
- package/dist/utils/claude-transcript.d.ts +0 -206
- package/dist/utils/claude-transcript.d.ts.map +0 -1
- package/dist/utils/claude-transcript.js +0 -384
- package/dist/utils/claude-transcript.js.map +0 -1
- package/dist/utils/session-store.d.ts +0 -313
- package/dist/utils/session-store.d.ts.map +0 -1
- package/dist/utils/session-store.js +0 -513
- package/dist/utils/session-store.js.map +0 -1
- package/dist/web-client/assets/architecture-TIHT7OUA-B6H7ClR9.js +0 -1
- package/dist/web-client/assets/channel-CinHQ6_V.js +0 -1
- package/dist/web-client/assets/classDiagram-OUVF2IWQ-D_fljwRI.js +0 -1
- package/dist/web-client/assets/classDiagram-v2-EOCWNBFH-D_fljwRI.js +0 -1
- package/dist/web-client/assets/eventmodeling-45OFAUF4-DT6B-Tvn.js +0 -1
- package/dist/web-client/assets/flowDiagram-23GEKE2U-fbZofWHf.js +0 -1
- package/dist/web-client/assets/index-C1WQ25Ow.js +0 -60
- package/dist/web-client/assets/index-CHdOvANQ.css +0 -2
- package/dist/web-client/assets/railroad-abnf-AHOZXSZD-C5-D4PxJ.js +0 -1
- package/dist/web-client/assets/railroad-ebnf-EBAXGLYW-pJcCXE74.js +0 -1
- package/dist/web-client/assets/railroad-peg-LSFZ7HO6-B33ruY8f.js +0 -1
- package/dist/web-client/assets/stateDiagram-v2-6OUMAXLB-Da0ex-S_.js +0 -1
- package/dist/web-client/assets/swimlanesDiagram-G3AALYLV-cc5MstHU.js +0 -8
- package/dist/web-server/permission-policy.d.ts +0 -46
- package/dist/web-server/permission-policy.d.ts.map +0 -1
- package/dist/web-server/permission-policy.js +0 -96
- package/dist/web-server/permission-policy.js.map +0 -1
- package/dist/web-server/prompt-assembly.d.ts +0 -454
- package/dist/web-server/prompt-assembly.d.ts.map +0 -1
- package/dist/web-server/prompt-assembly.js +0 -1121
- package/dist/web-server/prompt-assembly.js.map +0 -1
- package/dist/web-server/routes/sessions.d.ts +0 -19
- package/dist/web-server/routes/sessions.d.ts.map +0 -1
- package/dist/web-server/routes/sessions.js +0 -1296
- package/dist/web-server/routes/sessions.js.map +0 -1
- package/dist/web-server/session-reconciler.d.ts +0 -162
- package/dist/web-server/session-reconciler.d.ts.map +0 -1
- package/dist/web-server/session-reconciler.js +0 -363
- package/dist/web-server/session-reconciler.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"session-vocabulary.js","sourceRoot":"","sources":["../../src/shared/session-vocabulary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAmBH;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAAC,OAA2B;IACtD,OAAO,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC;AACzC,CAAC;AAED;4EAC4E;AAC5E,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEvD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,aAAa,CAAC,OAA2B;IACvD,OAAO,WAAW,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AAChD,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAA2B;IAC3D,OAAO,eAAe,CAAC,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Claude Code transcript mirroring for the session bridge.
|
|
3
|
-
*
|
|
4
|
-
* Owns a per-session sidecar at `sessions/{normalizedId}.transcript.jsonl`
|
|
5
|
-
* that mirrors a Claude Code JSONL transcript (the runtime's single source of
|
|
6
|
-
* truth) into a derived read-model for the web UI. The sidecar is append-only
|
|
7
|
-
* and keyed by transcript line offsets so re-mirroring is idempotent; when the
|
|
8
|
-
* transcript is compacted/rewritten below the mirrored offset, the sidecar is
|
|
9
|
-
* rebuilt from line 0 while preserving ARCS-authored turns (any record with a
|
|
10
|
-
* negative id — references and web-sent user/assistant turns).
|
|
11
|
-
*
|
|
12
|
-
* Never throws: missing/unreadable/oversized/malformed inputs are silent
|
|
13
|
-
* no-ops, and the sidecar never touches `sessions/index.json`.
|
|
14
|
-
*/
|
|
15
|
-
/** A MarkdownSection payload the caller sent to the session. Preserved on the
|
|
16
|
-
* sidecar reference record verbatim so the web UI can render the section with
|
|
17
|
-
* click-through back to its source document. */
|
|
18
|
-
export interface ReferenceSection {
|
|
19
|
-
/** Heading depth of the referenced section (1-based). */
|
|
20
|
-
depth: number;
|
|
21
|
-
/** The section's rendered markdown, exactly as it was sent to the session. */
|
|
22
|
-
text: string;
|
|
23
|
-
/** Stable id of the section within its document. */
|
|
24
|
-
id: string;
|
|
25
|
-
/** Character offsets of the section within the full document text. */
|
|
26
|
-
startOffset: number;
|
|
27
|
-
endOffset: number;
|
|
28
|
-
}
|
|
29
|
-
/** Identity of the document a reference was quoted from. */
|
|
30
|
-
export interface ReferenceSource {
|
|
31
|
-
/** Which ARCS store the referenced document lives in. */
|
|
32
|
-
kind: "overview" | "knowledge" | "plan";
|
|
33
|
-
/** Human-readable name of the source document. */
|
|
34
|
-
label: string;
|
|
35
|
-
/** Optional doc identifier (e.g. knowledge entry id, plan id). */
|
|
36
|
-
doc?: string;
|
|
37
|
-
id?: string;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* A markdown document section — the ONLY reference shape that existed before
|
|
41
|
-
* the union, and therefore the shape every reference turn already on disk
|
|
42
|
-
* carries. Its `section`/`source` fields are frozen: a sidecar written by an
|
|
43
|
-
* older ARCS must keep parsing, and a doc reference written today must stay
|
|
44
|
-
* byte-identical to one written then. The tag is filled in at the schema
|
|
45
|
-
* boundary (`sessionReferenceSchema`) rather than required on the wire, because
|
|
46
|
-
* legacy bodies carry no tag at all.
|
|
47
|
-
*/
|
|
48
|
-
export interface DocReference {
|
|
49
|
-
type: "doc";
|
|
50
|
-
text: string;
|
|
51
|
-
section: ReferenceSection;
|
|
52
|
-
source: ReferenceSource;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* A line range in a workspace file, sent as a POINTER rather than as content:
|
|
56
|
-
* `excerpt` is a short human anchor, never the authoritative text — the agent
|
|
57
|
-
* reads the live file. `headRev` is the revision the slice was taken at, so a
|
|
58
|
-
* later diff can tell whether the file moved under the agent.
|
|
59
|
-
*/
|
|
60
|
-
export interface FileReference {
|
|
61
|
-
type: "file";
|
|
62
|
-
/** Workspace-relative path, as the caller sent it. */
|
|
63
|
-
path: string;
|
|
64
|
-
/** 1-based, inclusive. */
|
|
65
|
-
startLine: number;
|
|
66
|
-
endLine: number;
|
|
67
|
-
excerpt?: string;
|
|
68
|
-
headRev?: string;
|
|
69
|
-
}
|
|
70
|
-
/** A DAG entity. Carries no text slice — ARCS is the source of truth for it. */
|
|
71
|
-
export interface NodeReference {
|
|
72
|
-
type: "node";
|
|
73
|
-
kind: "task" | "plan" | "knowledge";
|
|
74
|
-
id: string;
|
|
75
|
-
}
|
|
76
|
-
/** Everything a caller can point a session at, discriminated on `type`. */
|
|
77
|
-
export type SessionReference = DocReference | FileReference | NodeReference;
|
|
78
|
-
/** The pointer kinds, which have no historical fields of their own and so ride
|
|
79
|
-
* a reference turn whole (see `TranscriptTurn.ref`). */
|
|
80
|
-
export type PointerReference = FileReference | NodeReference;
|
|
81
|
-
/**
|
|
82
|
-
* The `text` a reference TURN records — the sidecar's own label, which is what
|
|
83
|
-
* the transcript panel shows. NOT prompt text: rendering a reference for a
|
|
84
|
-
* model is `web-server/prompt-assembly.ts`'s exclusive job. Doc references keep
|
|
85
|
-
* the caller's quoted text verbatim (unchanged from before the union); the
|
|
86
|
-
* pointer kinds have no text of their own, so the turn carries their identity.
|
|
87
|
-
*/
|
|
88
|
-
export declare function referenceTurnText(reference: SessionReference): string;
|
|
89
|
-
export interface TranscriptTurn {
|
|
90
|
-
/**
|
|
91
|
-
* Absolute 0-based line index in the source transcript for mirrored turns.
|
|
92
|
-
* ARCS-authored turns (references and web-sent user/assistant turns) carry a
|
|
93
|
-
* negative id drawn from one shared monotonic sequence, so they live in a
|
|
94
|
-
* disjoint space and can never collide with transcript line indices or with
|
|
95
|
-
* each other (the panel keys TurnRow on id).
|
|
96
|
-
*/
|
|
97
|
-
id: number;
|
|
98
|
-
type: "user" | "assistant" | "reference";
|
|
99
|
-
text: string;
|
|
100
|
-
ts?: string;
|
|
101
|
-
tool?: {
|
|
102
|
-
name: string;
|
|
103
|
-
};
|
|
104
|
-
/** Reference turns only: the MarkdownSection payload the caller sent to the
|
|
105
|
-
* session, preserved for click-through rendering. */
|
|
106
|
-
section?: ReferenceSection;
|
|
107
|
-
/** Reference turns only: identity of the source document. */
|
|
108
|
-
source?: ReferenceSource;
|
|
109
|
-
/**
|
|
110
|
-
* Reference turns only, POINTER kinds only: the file-slice or DAG-node
|
|
111
|
-
* payload the caller sent, preserved whole. Doc references deliberately do
|
|
112
|
-
* NOT land here — they keep their historical `section`/`source` fields, so a
|
|
113
|
-
* record written today is byte-identical to one written before the union
|
|
114
|
-
* existed and an older sidecar still reads.
|
|
115
|
-
*/
|
|
116
|
-
ref?: PointerReference;
|
|
117
|
-
/**
|
|
118
|
-
* Run this turn was folded down from (see web-server/run-event-log.ts). Set
|
|
119
|
-
* only on ARCS-authored turns written at a run's settle, where it doubles as
|
|
120
|
-
* the fold's idempotence marker: a run whose id already appears here has
|
|
121
|
-
* been folded and is never folded again.
|
|
122
|
-
*/
|
|
123
|
-
run?: string;
|
|
124
|
-
}
|
|
125
|
-
export interface ReadTranscriptResult {
|
|
126
|
-
turns: TranscriptTurn[];
|
|
127
|
-
/** Number of record lines in the transcript (trailing newline excluded). */
|
|
128
|
-
totalLines: number;
|
|
129
|
-
}
|
|
130
|
-
export interface ReferenceTurnInput {
|
|
131
|
-
text?: string;
|
|
132
|
-
ts?: string;
|
|
133
|
-
tool?: {
|
|
134
|
-
name: string;
|
|
135
|
-
};
|
|
136
|
-
section?: ReferenceSection;
|
|
137
|
-
source?: ReferenceSource;
|
|
138
|
-
/** Pointer kinds only — see `TranscriptTurn.ref`. */
|
|
139
|
-
ref?: PointerReference;
|
|
140
|
-
}
|
|
141
|
-
/** An ARCS-authored user/assistant turn sent to the session from the web UI. */
|
|
142
|
-
export interface SessionTurnInput {
|
|
143
|
-
type: "user" | "assistant";
|
|
144
|
-
text: string;
|
|
145
|
-
ts?: string;
|
|
146
|
-
/** Tool this turn stands for — a `tool_use` folded down from a run's event
|
|
147
|
-
* log, rendered dimmed exactly like a mirrored tool turn. */
|
|
148
|
-
tool?: {
|
|
149
|
-
name: string;
|
|
150
|
-
};
|
|
151
|
-
/** Run this turn was folded down from; also the fold's idempotence marker. */
|
|
152
|
-
run?: string;
|
|
153
|
-
}
|
|
154
|
-
/** Single-read cap for transcript files; anything larger mirrors as a no-op. */
|
|
155
|
-
export declare const TRANSCRIPT_MAX_BYTES: number;
|
|
156
|
-
/**
|
|
157
|
-
* Sidecar path. The filename keys on the normalized id so it matches the
|
|
158
|
-
* session index record exactly (normalizeIdentifier round-trips UUIDs
|
|
159
|
-
* unchanged, so Claude Code session uuids survive verbatim).
|
|
160
|
-
*/
|
|
161
|
-
export declare function sessionTranscriptPath(projectDir: string, normalizedId: string): string;
|
|
162
|
-
/**
|
|
163
|
-
* Reads a Claude Code JSONL transcript and parses only lines >= fromLine.
|
|
164
|
-
* Returns the kept turns (absolute line indices) plus the transcript's total
|
|
165
|
-
* record-line count. Never throws — unreadable files yield empty results.
|
|
166
|
-
*/
|
|
167
|
-
export declare function readTranscriptTurns(filePath: string, fromLine: number): Promise<ReadTranscriptResult>;
|
|
168
|
-
/**
|
|
169
|
-
* Mirrors the transcript into the per-session sidecar (append-only, offset
|
|
170
|
-
* idempotent). When the transcript has fewer lines than the mirrored offset —
|
|
171
|
-
* Claude Code compacts/rewrites its JSONL — the sidecar is rebuilt from line 0
|
|
172
|
-
* with existing ARCS-authored turns (id < 0) preserved.
|
|
173
|
-
*
|
|
174
|
-
* Never throws: missing/unreadable/oversized/malformed inputs are silent
|
|
175
|
-
* no-ops and the sidecar stays untouched. Never writes sessions/index.json.
|
|
176
|
-
*/
|
|
177
|
-
export declare function mirrorSessionTranscript(projectDir: string, normalizedId: string, transcriptPath: string): Promise<void>;
|
|
178
|
-
/**
|
|
179
|
-
* Appends an ARCS-authored reference turn (a document section, file slice or
|
|
180
|
-
* DAG node the caller pointed the session at) to the sidecar under the same
|
|
181
|
-
* sessions/.store lock the session
|
|
182
|
-
* store uses, so appends serialize with index mutations. A failed append is a
|
|
183
|
-
* swallowed no-op — the caller has already delivered the message. The id is
|
|
184
|
-
* minted from the shared ARCS-authored negative space so it can never collide
|
|
185
|
-
* with a web-sent user/assistant turn.
|
|
186
|
-
*/
|
|
187
|
-
export declare function appendReferenceTurn(projectDir: string, normalizedId: string, turn: ReferenceTurnInput): Promise<void>;
|
|
188
|
-
/**
|
|
189
|
-
* Appends an ARCS-authored user/assistant turn (sent to the session from the
|
|
190
|
-
* web UI) to the sidecar under the same sessions/.store lock the session store
|
|
191
|
-
* and the other sidecar writers use, so appends serialize with index mutations
|
|
192
|
-
* and reference appends. A failed append is a swallowed no-op. The id is
|
|
193
|
-
* minted from the shared ARCS-authored negative space so it can never collide
|
|
194
|
-
* with a reference turn — both render through <TurnRow key={t.id}>.
|
|
195
|
-
*
|
|
196
|
-
* `tool` and `run` ride through verbatim: they are what a run's event-log
|
|
197
|
-
* fold-down writes (one turn per `tool_use`, every turn tagged with the run
|
|
198
|
-
* whose log produced it — see web-server/run-event-log.ts).
|
|
199
|
-
*/
|
|
200
|
-
export declare function appendSessionTurn(projectDir: string, normalizedId: string, turn: SessionTurnInput): Promise<void>;
|
|
201
|
-
/**
|
|
202
|
-
* Reads the sidecar for the GET route, skipping malformed lines. Returns an
|
|
203
|
-
* empty array when the sidecar is missing. Never throws.
|
|
204
|
-
*/
|
|
205
|
-
export declare function readSessionTurns(projectDir: string, normalizedId: string): Promise<TranscriptTurn[]>;
|
|
206
|
-
//# sourceMappingURL=claude-transcript.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-transcript.d.ts","sourceRoot":"","sources":["../../src/utils/claude-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAQH;;iDAEiD;AACjD,MAAM,WAAW,gBAAgB;IAC/B,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,EAAE,EAAE,MAAM,CAAC;IACX,sEAAsE;IACtE,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,4DAA4D;AAC5D,MAAM,WAAW,eAAe;IAC9B,yDAAyD;IACzD,IAAI,EAAE,UAAU,GAAG,WAAW,GAAG,MAAM,CAAC;IACxC,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,gBAAgB,CAAC;IAC1B,MAAM,EAAE,eAAe,CAAC;CACzB;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,gFAAgF;AAChF,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC;IACpC,EAAE,EAAE,MAAM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AAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;kEAC8D;IAC9D,IAAI,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACxB,8EAA8E;IAC9E,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,gFAAgF;AAChF,eAAO,MAAM,oBAAoB,QAAmB,CAAC;AAMrD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAEtF;AAyGD;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,oBAAoB,CAAC,CAiB/B;AAyFD;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAC3C,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CAoCf;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,kBAAkB,GACvB,OAAO,CAAC,IAAI,CAAC,CA2Bf;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,gBAAgB,GACrB,OAAO,CAAC,IAAI,CAAC,CAmBf;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,cAAc,EAAE,CAAC,CAM3B"}
|
|
@@ -1,384 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Claude Code transcript mirroring for the session bridge.
|
|
3
|
-
*
|
|
4
|
-
* Owns a per-session sidecar at `sessions/{normalizedId}.transcript.jsonl`
|
|
5
|
-
* that mirrors a Claude Code JSONL transcript (the runtime's single source of
|
|
6
|
-
* truth) into a derived read-model for the web UI. The sidecar is append-only
|
|
7
|
-
* and keyed by transcript line offsets so re-mirroring is idempotent; when the
|
|
8
|
-
* transcript is compacted/rewritten below the mirrored offset, the sidecar is
|
|
9
|
-
* rebuilt from line 0 while preserving ARCS-authored turns (any record with a
|
|
10
|
-
* negative id — references and web-sent user/assistant turns).
|
|
11
|
-
*
|
|
12
|
-
* Never throws: missing/unreadable/oversized/malformed inputs are silent
|
|
13
|
-
* no-ops, and the sidecar never touches `sessions/index.json`.
|
|
14
|
-
*/
|
|
15
|
-
import { appendFile, readFile, stat } from "node:fs/promises";
|
|
16
|
-
import { join } from "node:path";
|
|
17
|
-
import { withLock } from "./file-lock.js";
|
|
18
|
-
import { normalizeIdentifier } from "./slug.js";
|
|
19
|
-
import { ensureDir, nowISO, writeTextAtomic } from "./storage-utils.js";
|
|
20
|
-
/**
|
|
21
|
-
* The `text` a reference TURN records — the sidecar's own label, which is what
|
|
22
|
-
* the transcript panel shows. NOT prompt text: rendering a reference for a
|
|
23
|
-
* model is `web-server/prompt-assembly.ts`'s exclusive job. Doc references keep
|
|
24
|
-
* the caller's quoted text verbatim (unchanged from before the union); the
|
|
25
|
-
* pointer kinds have no text of their own, so the turn carries their identity.
|
|
26
|
-
*/
|
|
27
|
-
export function referenceTurnText(reference) {
|
|
28
|
-
switch (reference.type) {
|
|
29
|
-
case "file":
|
|
30
|
-
return `${reference.path}:${reference.startLine}-${reference.endLine}`;
|
|
31
|
-
case "node":
|
|
32
|
-
return `${reference.kind} ${reference.id}`;
|
|
33
|
-
default:
|
|
34
|
-
return reference.text;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
/** Single-read cap for transcript files; anything larger mirrors as a no-op. */
|
|
38
|
-
export const TRANSCRIPT_MAX_BYTES = 20 * 1024 * 1024;
|
|
39
|
-
// ---------------------------------------------------------------------------
|
|
40
|
-
// Paths & locking
|
|
41
|
-
// ---------------------------------------------------------------------------
|
|
42
|
-
/**
|
|
43
|
-
* Sidecar path. The filename keys on the normalized id so it matches the
|
|
44
|
-
* session index record exactly (normalizeIdentifier round-trips UUIDs
|
|
45
|
-
* unchanged, so Claude Code session uuids survive verbatim).
|
|
46
|
-
*/
|
|
47
|
-
export function sessionTranscriptPath(projectDir, normalizedId) {
|
|
48
|
-
return join(projectDir, "sessions", `${normalizeIdentifier(normalizedId)}.transcript.jsonl`);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* The same advisory lock the session store uses for index mutations. Kept
|
|
52
|
-
* local (not imported) because session-store's helper is private and that
|
|
53
|
-
* module is out of scope; the path mirrors its `sessions/.store` so appends
|
|
54
|
-
* here serialize with createSession/updateSession/etc.
|
|
55
|
-
*/
|
|
56
|
-
function sessionStoreLockPath(projectDir) {
|
|
57
|
-
return join(projectDir, "sessions", ".store");
|
|
58
|
-
}
|
|
59
|
-
// ---------------------------------------------------------------------------
|
|
60
|
-
// Transcript parser — verified against the real Claude Code JSONL shape
|
|
61
|
-
// ---------------------------------------------------------------------------
|
|
62
|
-
function isBlock(value) {
|
|
63
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
64
|
-
}
|
|
65
|
-
/** Concatenates non-empty text blocks; thinking/tool_use blocks are dropped. */
|
|
66
|
-
function extractTextBlocks(blocks) {
|
|
67
|
-
return blocks
|
|
68
|
-
.filter((block) => isBlock(block) &&
|
|
69
|
-
block.type === "text" &&
|
|
70
|
-
typeof block.text === "string" &&
|
|
71
|
-
block.text !== "")
|
|
72
|
-
.map((block) => block.text)
|
|
73
|
-
.join("\n");
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Parses one transcript line into a normalized turn, or null when the line is
|
|
77
|
-
* noise/malformed. Malformed JSON is skipped, never thrown.
|
|
78
|
-
*
|
|
79
|
-
* Noise rules (verified against real ~/.claude/projects JSONL transcripts):
|
|
80
|
-
* - types other than "user"/"assistant" (mode, agent-setting, permission-mode,
|
|
81
|
-
* file-history-snapshot, last-prompt, queue-operation, system, attachment…)
|
|
82
|
-
* - user entries with isMeta:true (the <local-command-caveat> wrapper)
|
|
83
|
-
* - user local-command payloads (<command-name>/<local-command-stdout>), which
|
|
84
|
-
* in practice carry NO isMeta flag at all — filtered by content marker
|
|
85
|
-
* - user entries whose content is a tool_result array (tool output echoes)
|
|
86
|
-
* - thinking blocks inside assistant content
|
|
87
|
-
* - assistant lines with neither text nor tool_use (thinking-only lines)
|
|
88
|
-
*/
|
|
89
|
-
function parseTranscriptLine(rawLine, lineIndex) {
|
|
90
|
-
if (rawLine.trim() === "")
|
|
91
|
-
return null;
|
|
92
|
-
let entry;
|
|
93
|
-
try {
|
|
94
|
-
entry = JSON.parse(rawLine);
|
|
95
|
-
}
|
|
96
|
-
catch {
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
99
|
-
if (!isBlock(entry))
|
|
100
|
-
return null;
|
|
101
|
-
if (entry.type !== "user" && entry.type !== "assistant")
|
|
102
|
-
return null;
|
|
103
|
-
const message = entry.message;
|
|
104
|
-
if (!isBlock(message))
|
|
105
|
-
return null;
|
|
106
|
-
const ts = typeof entry.timestamp === "string" ? entry.timestamp : undefined;
|
|
107
|
-
if (entry.type === "user") {
|
|
108
|
-
if (entry.isMeta === true)
|
|
109
|
-
return null;
|
|
110
|
-
const content = message.content;
|
|
111
|
-
if (typeof content === "string") {
|
|
112
|
-
const text = content.trim();
|
|
113
|
-
if (text.startsWith("<command-name>") ||
|
|
114
|
-
text.startsWith("<local-command-stdout>") ||
|
|
115
|
-
text.startsWith("<local-command-caveat>")) {
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
return { id: lineIndex, type: "user", text, ...(ts !== undefined ? { ts } : {}) };
|
|
119
|
-
}
|
|
120
|
-
if (Array.isArray(content)) {
|
|
121
|
-
// Claude Code user arrays are tool_result blocks — echoed tool output,
|
|
122
|
-
// never a real prompt. (The rare text-only array, e.g. an interruption
|
|
123
|
-
// notice, is kept.)
|
|
124
|
-
if (content.some((block) => isBlock(block) && block.type === "tool_result"))
|
|
125
|
-
return null;
|
|
126
|
-
const text = extractTextBlocks(content);
|
|
127
|
-
if (text === "")
|
|
128
|
-
return null;
|
|
129
|
-
return { id: lineIndex, type: "user", text, ...(ts !== undefined ? { ts } : {}) };
|
|
130
|
-
}
|
|
131
|
-
return null;
|
|
132
|
-
}
|
|
133
|
-
// assistant — content is a block array: keep text, dim tool_use, drop thinking.
|
|
134
|
-
if (!Array.isArray(message.content))
|
|
135
|
-
return null;
|
|
136
|
-
const text = extractTextBlocks(message.content);
|
|
137
|
-
const toolUse = message.content.find((block) => isBlock(block) && block.type === "tool_use" && typeof block.name === "string");
|
|
138
|
-
if (text === "" && toolUse === undefined)
|
|
139
|
-
return null;
|
|
140
|
-
const turn = {
|
|
141
|
-
id: lineIndex,
|
|
142
|
-
type: "assistant",
|
|
143
|
-
text,
|
|
144
|
-
...(ts !== undefined ? { ts } : {}),
|
|
145
|
-
};
|
|
146
|
-
if (toolUse !== undefined)
|
|
147
|
-
turn.tool = { name: toolUse.name };
|
|
148
|
-
return turn;
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Reads a Claude Code JSONL transcript and parses only lines >= fromLine.
|
|
152
|
-
* Returns the kept turns (absolute line indices) plus the transcript's total
|
|
153
|
-
* record-line count. Never throws — unreadable files yield empty results.
|
|
154
|
-
*/
|
|
155
|
-
export async function readTranscriptTurns(filePath, fromLine) {
|
|
156
|
-
let raw;
|
|
157
|
-
try {
|
|
158
|
-
raw = await readFile(filePath, "utf-8");
|
|
159
|
-
}
|
|
160
|
-
catch {
|
|
161
|
-
return { turns: [], totalLines: 0 };
|
|
162
|
-
}
|
|
163
|
-
const lines = raw.split("\n");
|
|
164
|
-
// A trailing newline produces one empty split element — not a record line.
|
|
165
|
-
while (lines.length > 0 && lines[lines.length - 1] === "")
|
|
166
|
-
lines.pop();
|
|
167
|
-
const totalLines = lines.length;
|
|
168
|
-
const turns = [];
|
|
169
|
-
for (let lineIndex = fromLine; lineIndex < totalLines; lineIndex++) {
|
|
170
|
-
const turn = parseTranscriptLine(lines[lineIndex] ?? "", lineIndex);
|
|
171
|
-
if (turn !== null)
|
|
172
|
-
turns.push(turn);
|
|
173
|
-
}
|
|
174
|
-
return { turns, totalLines };
|
|
175
|
-
}
|
|
176
|
-
// ---------------------------------------------------------------------------
|
|
177
|
-
// Sidecar read/write
|
|
178
|
-
// ---------------------------------------------------------------------------
|
|
179
|
-
function parseSidecarLine(rawLine) {
|
|
180
|
-
if (rawLine.trim() === "")
|
|
181
|
-
return null;
|
|
182
|
-
try {
|
|
183
|
-
const parsed = JSON.parse(rawLine);
|
|
184
|
-
if (isBlock(parsed) &&
|
|
185
|
-
(parsed.type === "user" || parsed.type === "assistant" || parsed.type === "reference")) {
|
|
186
|
-
return parsed;
|
|
187
|
-
}
|
|
188
|
-
return null;
|
|
189
|
-
}
|
|
190
|
-
catch {
|
|
191
|
-
return null;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
/** Reads the sidecar, skipping malformed lines. Never throws. */
|
|
195
|
-
async function readSidecarRecords(filePath) {
|
|
196
|
-
try {
|
|
197
|
-
const raw = await readFile(filePath, "utf-8");
|
|
198
|
-
return raw.split("\n").flatMap((line) => {
|
|
199
|
-
const record = parseSidecarLine(line);
|
|
200
|
-
return record !== null ? [record] : [];
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
catch {
|
|
204
|
-
return [];
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Resume offset = the next unmirrored transcript line. ARCS-authored turns are
|
|
209
|
-
* excluded (they are not transcript lines, and their negative ids never exceed
|
|
210
|
-
* the -1 sentinel, so they cannot push the offset), and the id of the last
|
|
211
|
-
* mirrored turn is the transcript line index it came from, so
|
|
212
|
-
* `last id + 1` is the count of transcript lines consumed. Equivalent to the
|
|
213
|
-
* sidecar line count in the noise-free case, and correct under interleaved
|
|
214
|
-
* noise and ARCS-authored turns where a raw line count would drift.
|
|
215
|
-
*/
|
|
216
|
-
function mirrorOffset(records) {
|
|
217
|
-
let lastMirroredId = -1;
|
|
218
|
-
for (const record of records) {
|
|
219
|
-
if (record.type !== "reference" &&
|
|
220
|
-
typeof record.id === "number" &&
|
|
221
|
-
record.id > lastMirroredId) {
|
|
222
|
-
lastMirroredId = record.id;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
return lastMirroredId + 1;
|
|
226
|
-
}
|
|
227
|
-
function serializeRecords(records) {
|
|
228
|
-
if (records.length === 0)
|
|
229
|
-
return "";
|
|
230
|
-
return `${records.map((record) => JSON.stringify(record)).join("\n")}\n`;
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Next id in the shared ARCS-authored negative space: min(existing id < 0) − 1.
|
|
234
|
-
* All ARCS-authored records — session user/assistant turns and references —
|
|
235
|
-
* draw from this one monotonic sequence, so a user turn and a reference can
|
|
236
|
-
* never collide on the same id (the panel renders <TurnRow key={t.id}>).
|
|
237
|
-
* No negative ids yet: first id is −1 (0 − 1).
|
|
238
|
-
*/
|
|
239
|
-
function nextNegativeTurnId(records) {
|
|
240
|
-
let minNegative = 0;
|
|
241
|
-
for (const record of records) {
|
|
242
|
-
if (typeof record.id === "number" && record.id < 0 && record.id < minNegative) {
|
|
243
|
-
minNegative = record.id;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
return minNegative - 1;
|
|
247
|
-
}
|
|
248
|
-
async function appendRecords(filePath, records) {
|
|
249
|
-
if (records.length === 0)
|
|
250
|
-
return;
|
|
251
|
-
await appendFile(filePath, serializeRecords(records), "utf-8");
|
|
252
|
-
}
|
|
253
|
-
// ---------------------------------------------------------------------------
|
|
254
|
-
// Public API
|
|
255
|
-
// ---------------------------------------------------------------------------
|
|
256
|
-
/**
|
|
257
|
-
* Mirrors the transcript into the per-session sidecar (append-only, offset
|
|
258
|
-
* idempotent). When the transcript has fewer lines than the mirrored offset —
|
|
259
|
-
* Claude Code compacts/rewrites its JSONL — the sidecar is rebuilt from line 0
|
|
260
|
-
* with existing ARCS-authored turns (id < 0) preserved.
|
|
261
|
-
*
|
|
262
|
-
* Never throws: missing/unreadable/oversized/malformed inputs are silent
|
|
263
|
-
* no-ops and the sidecar stays untouched. Never writes sessions/index.json.
|
|
264
|
-
*/
|
|
265
|
-
export async function mirrorSessionTranscript(projectDir, normalizedId, transcriptPath) {
|
|
266
|
-
try {
|
|
267
|
-
// Cap the single read: oversized transcripts are silently skipped.
|
|
268
|
-
const transcriptStat = await stat(transcriptPath);
|
|
269
|
-
if (!transcriptStat.isFile() || transcriptStat.size > TRANSCRIPT_MAX_BYTES)
|
|
270
|
-
return;
|
|
271
|
-
await withLock(sessionStoreLockPath(projectDir), async () => {
|
|
272
|
-
const sidecarPath = sessionTranscriptPath(projectDir, normalizedId);
|
|
273
|
-
const existing = await readSidecarRecords(sidecarPath);
|
|
274
|
-
const offset = mirrorOffset(existing);
|
|
275
|
-
const { turns, totalLines } = await readTranscriptTurns(transcriptPath, offset);
|
|
276
|
-
if (totalLines < offset) {
|
|
277
|
-
// Compaction/rewrite: rebuild from line 0, preserving every
|
|
278
|
-
// ARCS-authored turn (id < 0) — references and web-sent user/assistant
|
|
279
|
-
// turns both live in the negative space.
|
|
280
|
-
// SHORTCUT: compaction detection is line-count-only — a corrupted or
|
|
281
|
-
// truncated transcript that happens to shrink below the mirrored
|
|
282
|
-
// offset is treated as compaction and mirrored turns are dropped
|
|
283
|
-
// (ARCS-authored turns always survive). Upgrade when Claude Code's
|
|
284
|
-
// JSONL rewrite signals are identifiable, e.g. a marker record.
|
|
285
|
-
const arsAuthored = existing.filter((record) => typeof record.id === "number" && record.id < 0);
|
|
286
|
-
const { turns: allTurns } = await readTranscriptTurns(transcriptPath, 0);
|
|
287
|
-
await ensureDir(join(projectDir, "sessions"));
|
|
288
|
-
await writeTextAtomic(sidecarPath, serializeRecords([...arsAuthored, ...allTurns]));
|
|
289
|
-
return;
|
|
290
|
-
}
|
|
291
|
-
if (turns.length === 0)
|
|
292
|
-
return;
|
|
293
|
-
await ensureDir(join(projectDir, "sessions"));
|
|
294
|
-
await appendRecords(sidecarPath, turns);
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
catch {
|
|
298
|
-
// Never throws — every mirror failure is a swallowed no-op.
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* Appends an ARCS-authored reference turn (a document section, file slice or
|
|
303
|
-
* DAG node the caller pointed the session at) to the sidecar under the same
|
|
304
|
-
* sessions/.store lock the session
|
|
305
|
-
* store uses, so appends serialize with index mutations. A failed append is a
|
|
306
|
-
* swallowed no-op — the caller has already delivered the message. The id is
|
|
307
|
-
* minted from the shared ARCS-authored negative space so it can never collide
|
|
308
|
-
* with a web-sent user/assistant turn.
|
|
309
|
-
*/
|
|
310
|
-
export async function appendReferenceTurn(projectDir, normalizedId, turn) {
|
|
311
|
-
try {
|
|
312
|
-
await ensureDir(join(projectDir, "sessions"));
|
|
313
|
-
await withLock(sessionStoreLockPath(projectDir), async () => {
|
|
314
|
-
const sidecarPath = sessionTranscriptPath(projectDir, normalizedId);
|
|
315
|
-
const existing = await readSidecarRecords(sidecarPath);
|
|
316
|
-
const record = {
|
|
317
|
-
id: nextNegativeTurnId(existing),
|
|
318
|
-
type: "reference",
|
|
319
|
-
text: turn.text ?? "",
|
|
320
|
-
ts: turn.ts ?? nowISO(),
|
|
321
|
-
...(turn.tool !== undefined ? { tool: turn.tool } : {}),
|
|
322
|
-
...(turn.section !== undefined ? { section: turn.section } : {}),
|
|
323
|
-
...(turn.source !== undefined ? { source: turn.source } : {}),
|
|
324
|
-
// LAST for the POINTER records' sake. It buys the doc record nothing: a
|
|
325
|
-
// doc turn has `ref === undefined`, so this spread contributes no key
|
|
326
|
-
// wherever it sits, and the pre-union key order survives by that absence
|
|
327
|
-
// rather than by this position. What the position DOES fix is the pointer
|
|
328
|
-
// records' own layout — `ref` always trails `section`/`source`, so every
|
|
329
|
-
// file/node turn serializes its keys in one stable order.
|
|
330
|
-
...(turn.ref !== undefined ? { ref: turn.ref } : {}),
|
|
331
|
-
};
|
|
332
|
-
await appendRecords(sidecarPath, [record]);
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
catch {
|
|
336
|
-
// Failed append is a swallowed no-op.
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
/**
|
|
340
|
-
* Appends an ARCS-authored user/assistant turn (sent to the session from the
|
|
341
|
-
* web UI) to the sidecar under the same sessions/.store lock the session store
|
|
342
|
-
* and the other sidecar writers use, so appends serialize with index mutations
|
|
343
|
-
* and reference appends. A failed append is a swallowed no-op. The id is
|
|
344
|
-
* minted from the shared ARCS-authored negative space so it can never collide
|
|
345
|
-
* with a reference turn — both render through <TurnRow key={t.id}>.
|
|
346
|
-
*
|
|
347
|
-
* `tool` and `run` ride through verbatim: they are what a run's event-log
|
|
348
|
-
* fold-down writes (one turn per `tool_use`, every turn tagged with the run
|
|
349
|
-
* whose log produced it — see web-server/run-event-log.ts).
|
|
350
|
-
*/
|
|
351
|
-
export async function appendSessionTurn(projectDir, normalizedId, turn) {
|
|
352
|
-
try {
|
|
353
|
-
await ensureDir(join(projectDir, "sessions"));
|
|
354
|
-
await withLock(sessionStoreLockPath(projectDir), async () => {
|
|
355
|
-
const sidecarPath = sessionTranscriptPath(projectDir, normalizedId);
|
|
356
|
-
const existing = await readSidecarRecords(sidecarPath);
|
|
357
|
-
const record = {
|
|
358
|
-
id: nextNegativeTurnId(existing),
|
|
359
|
-
type: turn.type,
|
|
360
|
-
text: turn.text,
|
|
361
|
-
...(turn.ts !== undefined ? { ts: turn.ts } : {}),
|
|
362
|
-
...(turn.tool !== undefined ? { tool: turn.tool } : {}),
|
|
363
|
-
...(turn.run !== undefined ? { run: turn.run } : {}),
|
|
364
|
-
};
|
|
365
|
-
await appendRecords(sidecarPath, [record]);
|
|
366
|
-
});
|
|
367
|
-
}
|
|
368
|
-
catch {
|
|
369
|
-
// Failed append is a swallowed no-op.
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
/**
|
|
373
|
-
* Reads the sidecar for the GET route, skipping malformed lines. Returns an
|
|
374
|
-
* empty array when the sidecar is missing. Never throws.
|
|
375
|
-
*/
|
|
376
|
-
export async function readSessionTurns(projectDir, normalizedId) {
|
|
377
|
-
try {
|
|
378
|
-
return await readSidecarRecords(sessionTranscriptPath(projectDir, normalizedId));
|
|
379
|
-
}
|
|
380
|
-
catch {
|
|
381
|
-
return [];
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
//# sourceMappingURL=claude-transcript.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-transcript.js","sourceRoot":"","sources":["../../src/utils/claude-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AA2ExE;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAA2B;IAC3D,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;QACvB,KAAK,MAAM;YACT,OAAO,GAAG,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC;QACzE,KAAK,MAAM;YACT,OAAO,GAAG,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,EAAE,EAAE,CAAC;QAC7C;YACE,OAAO,SAAS,CAAC,IAAI,CAAC;IAC1B,CAAC;AACH,CAAC;AAiED,gFAAgF;AAChF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