@tangle-network/sandbox-cli 0.21.22 → 0.21.24
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/dist/graph-viewer/Analytics-DocMpB6T.js +953 -0
- package/dist/graph-viewer/AnswerStrip-DhwqOyxI.js +112 -0
- package/dist/graph-viewer/Checks-CbnY4tuh.js +113 -0
- package/dist/graph-viewer/Conversations-CISiWrR9.js +513 -0
- package/dist/graph-viewer/Files-Dh8p_Fpw.js +435 -0
- package/dist/graph-viewer/LiveRun-C-yKwkKs.js +190 -0
- package/dist/graph-viewer/Outputs-QET3nPPp.js +803 -0
- package/dist/graph-viewer/Overview-BaXPdCFC.js +477 -0
- package/dist/graph-viewer/RunOverview-DJQDAMIx.js +1720 -0
- package/dist/graph-viewer/RunPage-nJwCsArn.js +258 -0
- package/dist/graph-viewer/Timeline-bPjhV3il.js +293 -0
- package/dist/graph-viewer/Today-pebCsPJ1.js +653 -0
- package/dist/graph-viewer/Topology-CyhuK6XW.js +550 -0
- package/dist/graph-viewer/Traces-C5x2UvJh.js +232 -0
- package/dist/graph-viewer/WallPages-DSmRm2v3.js +658 -0
- package/dist/graph-viewer/agent-runtime.js +2293 -0
- package/dist/graph-viewer/anchor-C4i5SrB9.js +23 -0
- package/dist/graph-viewer/assessment.js +117 -0
- package/dist/graph-viewer/data-BJmP7F1M.js +247 -0
- package/dist/graph-viewer/harness-sessions.js +165 -0
- package/dist/graph-viewer/index.js +14991 -0
- package/dist/graph-viewer/lazy-pages-CpmkG5o2.js +19 -0
- package/dist/graph-viewer/outputs-model-CGdvjkQh.js +553 -0
- package/dist/graph-viewer/part-events-BrLrg_EV.js +276 -0
- package/dist/graph-viewer/plain-words-CgvxtEOa.js +17 -0
- package/dist/graph-viewer/publication.js +111 -0
- package/dist/graph-viewer/receipt.js +25 -0
- package/dist/graph-viewer/record-part-Cx9GDQeo.js +1378 -0
- package/dist/graph-viewer/record.js +336 -0
- package/dist/graph-viewer/report-viewer.js +557 -0
- package/dist/graph-viewer/report.js +392 -0
- package/dist/graph-viewer/research-publication.js +35 -0
- package/dist/graph-viewer/run-files-C1NgzM0l.js +82 -0
- package/dist/graph-viewer/run-receipt-Bvi4-KVM.js +1112 -0
- package/dist/graph-viewer/schemas/agent-record.bundle.v1.json +157 -0
- package/dist/graph-viewer/schemas/agent-record.v1.json +1025 -0
- package/dist/graph-viewer/schemas/agent-trace-assessment.v1.json +302 -0
- package/dist/graph-viewer/schemas/agent-trace-assessments.v1.json +335 -0
- package/dist/graph-viewer/schemas/agent-trace-dimensions.v1.json +131 -0
- package/dist/graph-viewer/schemas/agent-workspace.play.v1.json +8149 -0
- package/dist/graph-viewer/schemas/agent-workspace.plays.v1.json +1295 -0
- package/dist/graph-viewer/schemas/agent-workspace.run.v1.json +10907 -0
- package/dist/graph-viewer/schemas/agent-workspace.version-graph.json +1131 -0
- package/dist/graph-viewer/schemas/discovery-lab.profile-graph.json +2628 -0
- package/dist/graph-viewer/schemas/evidence.snapshot.v1.json +71 -0
- package/dist/graph-viewer/styles.css +13976 -0
- package/dist/graph-viewer/trace-spans.js +157 -0
- package/dist/graph-viewer/ui-CEhDqce8.js +906 -0
- package/dist/graph-viewer/use-file-text-BaE98QxE.js +47 -0
- package/dist/graph-viewer/viewer/AgentGraphCanvas-D7jjAE6i-DecKyUGA.js +8808 -0
- package/dist/graph-viewer/viewer/Analytics-CtKucZjs.js +954 -0
- package/dist/graph-viewer/viewer/AnswerStrip-DsI9aF-i.js +45 -0
- package/dist/graph-viewer/viewer/Checks-DZTgeYlV.js +114 -0
- package/dist/graph-viewer/viewer/Conversations-DQBCyko6.js +787 -0
- package/dist/graph-viewer/viewer/Files-B-g25gSO.js +433 -0
- package/dist/graph-viewer/viewer/LiveRun-BMQnTpTZ.js +6713 -0
- package/dist/graph-viewer/viewer/Outputs-DXnN1wEQ.js +929 -0
- package/dist/graph-viewer/viewer/Overview-u7-8-rGx.js +478 -0
- package/dist/graph-viewer/viewer/RunPage-ChipoSdO.js +257 -0
- package/dist/graph-viewer/viewer/Scores-CjriXjf_.js +414 -0
- package/dist/graph-viewer/viewer/Timeline-DzEzobA0.js +294 -0
- package/dist/graph-viewer/viewer/Today-DLHe_wTA.js +653 -0
- package/dist/graph-viewer/viewer/Topology-Dsmuu27J.js +551 -0
- package/dist/graph-viewer/viewer/Traces-BWBulSPE.js +232 -0
- package/dist/graph-viewer/viewer/WallPages-Crj-qPoK.js +657 -0
- package/dist/graph-viewer/viewer/WorkflowGraph-DYsP_Kcg-C0O7M5iH.js +1559 -0
- package/dist/graph-viewer/viewer/abap-DF4NaQCD.js +3 -0
- package/dist/graph-viewer/viewer/actionscript-3-O89o1DyQ.js +3 -0
- package/dist/graph-viewer/viewer/ada-UiOHRbSd.js +3 -0
- package/dist/graph-viewer/viewer/agent-record-Dw772ROs.css +2 -0
- package/dist/graph-viewer/viewer/agent-timeline-C-UIhXgu.js +1786 -0
- package/dist/graph-viewer/viewer/ahk-7eXkLipS.js +3 -0
- package/dist/graph-viewer/viewer/ahk2-BRygvKjG.js +3 -0
- package/dist/graph-viewer/viewer/andromeeda-CXE6Hd_y.js +4 -0
- package/dist/graph-viewer/viewer/andromeeda-D4hkA5d4.js +135 -0
- package/dist/graph-viewer/viewer/angular-html-CH3lfmUV.js +16 -0
- package/dist/graph-viewer/viewer/angular-ts-B687Yw-e.js +18 -0
- package/dist/graph-viewer/viewer/apache-zsgjHeYU.js +3 -0
- package/dist/graph-viewer/viewer/apex-DvIWVZE0.js +3 -0
- package/dist/graph-viewer/viewer/apl-MlL-eOOA.js +16 -0
- package/dist/graph-viewer/viewer/applescript-D_ETOzPj.js +3 -0
- package/dist/graph-viewer/viewer/ara-CXdsJbD3.js +3 -0
- package/dist/graph-viewer/viewer/asciidoc-CpqrUCBV.js +3 -0
- package/dist/graph-viewer/viewer/asm-DLrPCi7c.js +3 -0
- package/dist/graph-viewer/viewer/astro-CEu262ke.js +18 -0
- package/dist/graph-viewer/viewer/aurora-x-ByDc5ddl.js +4 -0
- package/dist/graph-viewer/viewer/aurora-x-DR-LXA3G.js +149 -0
- package/dist/graph-viewer/viewer/awk-452npsTH.js +3 -0
- package/dist/graph-viewer/viewer/ayu-dark-AY3FJIQr.js +125 -0
- package/dist/graph-viewer/viewer/ayu-dark-Bwg9SdAf.js +4 -0
- package/dist/graph-viewer/viewer/ayu-light-CDT1HkHg.js +125 -0
- package/dist/graph-viewer/viewer/ayu-light-DPCSrH1e.js +4 -0
- package/dist/graph-viewer/viewer/ayu-mirage-BrWHc4Mk.js +125 -0
- package/dist/graph-viewer/viewer/ayu-mirage-CArVigxm.js +4 -0
- package/dist/graph-viewer/viewer/ballerina-8wA0eHgr.js +3 -0
- package/dist/graph-viewer/viewer/bash-B3Pt0-io.js +2 -0
- package/dist/graph-viewer/viewer/bat-D5zNUOf1.js +3 -0
- package/dist/graph-viewer/viewer/beancount-BXtNUIgX.js +3 -0
- package/dist/graph-viewer/viewer/berry-oDXeVIfk.js +3 -0
- package/dist/graph-viewer/viewer/bibtex-CAeObnSR.js +3 -0
- package/dist/graph-viewer/viewer/bicep-udSZHxea.js +3 -0
- package/dist/graph-viewer/viewer/bird2-CeHO9zcD.js +3 -0
- package/dist/graph-viewer/viewer/blade-6Y8QadpX.js +20 -0
- package/dist/graph-viewer/viewer/bot-Bivadvxn.js +40 -0
- package/dist/graph-viewer/viewer/bsl-BYwMGpx9.js +5 -0
- package/dist/graph-viewer/viewer/c-CSBSx-ud.js +2 -0
- package/dist/graph-viewer/viewer/c-DAvbji88.js +5 -0
- package/dist/graph-viewer/viewer/c3-CWnhEhIf.js +3 -0
- package/dist/graph-viewer/viewer/cadence-C2DNIpxD.js +3 -0
- package/dist/graph-viewer/viewer/cairo-Be_WUhk8.js +5 -0
- package/dist/graph-viewer/viewer/catppuccin-frappe-BOyy9syt.js +254 -0
- package/dist/graph-viewer/viewer/catppuccin-frappe-XWBMtHoj.js +4 -0
- package/dist/graph-viewer/viewer/catppuccin-latte-BTeMSDF4.js +254 -0
- package/dist/graph-viewer/viewer/catppuccin-latte-CYOvCvxh.js +4 -0
- package/dist/graph-viewer/viewer/catppuccin-macchiato-BdFrVtzY.js +254 -0
- package/dist/graph-viewer/viewer/catppuccin-macchiato-Bl-TAIIg.js +4 -0
- package/dist/graph-viewer/viewer/catppuccin-mocha-BkEo6vVC.js +4 -0
- package/dist/graph-viewer/viewer/catppuccin-mocha-nwxgrdZf.js +254 -0
- package/dist/graph-viewer/viewer/ccount-8lyDUwnq.js +1116 -0
- package/dist/graph-viewer/viewer/chapel-BipHs2dR.js +5 -0
- package/dist/graph-viewer/viewer/chevron-right-WW7tFY6B.js +14 -0
- package/dist/graph-viewer/viewer/clarity-CYwjxkRS.js +3 -0
- package/dist/graph-viewer/viewer/clojure-g5hblQ59.js +3 -0
- package/dist/graph-viewer/viewer/cmake-D30WusUY.js +3 -0
- package/dist/graph-viewer/viewer/cobol-BSufitvZ.js +10 -0
- package/dist/graph-viewer/viewer/codeowners-a_Z0p9_y.js +3 -0
- package/dist/graph-viewer/viewer/codeql-BkSUw1F6.js +3 -0
- package/dist/graph-viewer/viewer/coffee-Cq8545xS.js +5 -0
- package/dist/graph-viewer/viewer/common-lisp-D2PkvS4V.js +3 -0
- package/dist/graph-viewer/viewer/coq-BLTGLocz.js +3 -0
- package/dist/graph-viewer/viewer/core-I74i0Bj-.js +3283 -0
- package/dist/graph-viewer/viewer/cpp--S2jMQNE.js +16 -0
- package/dist/graph-viewer/viewer/cpp-D1SvvKgJ.js +2 -0
- package/dist/graph-viewer/viewer/createLucideIcon-Z6KTw8ff.js +132 -0
- package/dist/graph-viewer/viewer/crystal-CwAQylTf.js +18 -0
- package/dist/graph-viewer/viewer/csharp--dn-Xz3x.js +3 -0
- package/dist/graph-viewer/viewer/csharp-CFNIW_9w.js +2 -0
- package/dist/graph-viewer/viewer/css-DDvgy_Pj.js +2 -0
- package/dist/graph-viewer/viewer/css-OZkJJXvy.js +5 -0
- package/dist/graph-viewer/viewer/csv-DFU5sVkH.js +3 -0
- package/dist/graph-viewer/viewer/cue-cdFZcSz0.js +3 -0
- package/dist/graph-viewer/viewer/cypher-DRjO_s97.js +3 -0
- package/dist/graph-viewer/viewer/d-BTgKsJ9x.js +3 -0
- package/dist/graph-viewer/viewer/dark-plus-C3f5UfGH.js +4 -0
- package/dist/graph-viewer/viewer/dark-plus-DpxqFdZb.js +133 -0
- package/dist/graph-viewer/viewer/dart-D4omMRdb.js +3 -0
- package/dist/graph-viewer/viewer/data-azhapQrS.js +5459 -0
- package/dist/graph-viewer/viewer/dax-DMzovUnU.js +3 -0
- package/dist/graph-viewer/viewer/desktop-0YG2NeB2.js +3 -0
- package/dist/graph-viewer/viewer/diff-Bqcnq92f.js +2 -0
- package/dist/graph-viewer/viewer/diff-D0WgTNQn.js +3 -0
- package/dist/graph-viewer/viewer/dist-CyOc-K4O.js +488 -0
- package/dist/graph-viewer/viewer/docker-DzSfvS0u.js +5 -0
- package/dist/graph-viewer/viewer/dockerfile-CM1sLMN0.js +2 -0
- package/dist/graph-viewer/viewer/dotenv-BSNpOEA3.js +3 -0
- package/dist/graph-viewer/viewer/dracula-BfBOnDty.js +4 -0
- package/dist/graph-viewer/viewer/dracula-DhjcxBGE.js +153 -0
- package/dist/graph-viewer/viewer/dracula-soft-C8OuVugS.js +103 -0
- package/dist/graph-viewer/viewer/dracula-soft-D6ffXinY.js +4 -0
- package/dist/graph-viewer/viewer/dream-maker-Br_aTy0D.js +3 -0
- package/dist/graph-viewer/viewer/edge-BXg6ZoA5.js +12 -0
- package/dist/graph-viewer/viewer/elixir-BP4dycnf.js +5 -0
- package/dist/graph-viewer/viewer/elk.bundled-ZJBRnwyo.js +46151 -0
- package/dist/graph-viewer/viewer/elm-XJ6BGRhm.js +5 -0
- package/dist/graph-viewer/viewer/emacs-lisp-CaNYORYC.js +3 -0
- package/dist/graph-viewer/viewer/engine-javascript-CuJOa50W.js +2400 -0
- package/dist/graph-viewer/viewer/engine-oniguruma-CUxoKLbG.js +238 -0
- package/dist/graph-viewer/viewer/erb-Cny7ijxm.js +10 -0
- package/dist/graph-viewer/viewer/erlang-CcYvFpBd.js +5 -0
- package/dist/graph-viewer/viewer/everforest-dark-1Qcrb-nR.js +4 -0
- package/dist/graph-viewer/viewer/everforest-dark-B8sohDPe.js +87 -0
- package/dist/graph-viewer/viewer/everforest-light-CwMdzDa5.js +87 -0
- package/dist/graph-viewer/viewer/everforest-light-pWd_20u5.js +4 -0
- package/dist/graph-viewer/viewer/fennel-XqmdNU54.js +3 -0
- package/dist/graph-viewer/viewer/file-text-B34N7Soo.js +47 -0
- package/dist/graph-viewer/viewer/final-output-Db2D9cMT.js +112 -0
- package/dist/graph-viewer/viewer/fish-DnIfDEl-.js +3 -0
- package/dist/graph-viewer/viewer/fluent-Dv7iXi9Q.js +3 -0
- package/dist/graph-viewer/viewer/fortran-fixed-form-CclFI1c1.js +5 -0
- package/dist/graph-viewer/viewer/fortran-free-form-B6CnEX04.js +3 -0
- package/dist/graph-viewer/viewer/fsharp-KngoBKg1.js +5 -0
- package/dist/graph-viewer/viewer/gdresource-DmwEW6Q8.js +10 -0
- package/dist/graph-viewer/viewer/gdscript-DZvGV2HF.js +3 -0
- package/dist/graph-viewer/viewer/gdshader-C-YpNGc4.js +3 -0
- package/dist/graph-viewer/viewer/genie-eGJU5Fha.js +3 -0
- package/dist/graph-viewer/viewer/gherkin-DPafK1RH.js +3 -0
- package/dist/graph-viewer/viewer/git-commit-ic1koML8.js +5 -0
- package/dist/graph-viewer/viewer/git-rebase-Cv1EDRHu.js +5 -0
- package/dist/graph-viewer/viewer/github-dark-DDdIZDt9.js +4 -0
- package/dist/graph-viewer/viewer/github-dark-JXVciwdu.js +130 -0
- package/dist/graph-viewer/viewer/github-dark-default-BdQpbWGL.js +76 -0
- package/dist/graph-viewer/viewer/github-dark-default-Dqlx6Tfn.js +4 -0
- package/dist/graph-viewer/viewer/github-dark-dimmed-Cf-YKaPv.js +4 -0
- package/dist/graph-viewer/viewer/github-dark-dimmed-W_ejuONg.js +125 -0
- package/dist/graph-viewer/viewer/github-dark-high-contrast-BfhJh7Fv.js +4 -0
- package/dist/graph-viewer/viewer/github-dark-high-contrast-Dta6H4l1.js +125 -0
- package/dist/graph-viewer/viewer/github-light-D4EN-pJE.js +130 -0
- package/dist/graph-viewer/viewer/github-light-D7vUnDjY.js +4 -0
- package/dist/graph-viewer/viewer/github-light-default-CA96ogap.js +125 -0
- package/dist/graph-viewer/viewer/github-light-default-CbQ7dbx-.js +4 -0
- package/dist/graph-viewer/viewer/github-light-high-contrast-CWkjO7j1.js +125 -0
- package/dist/graph-viewer/viewer/github-light-high-contrast-Oc7ptxOl.js +4 -0
- package/dist/graph-viewer/viewer/gleam-DDi89CaZ.js +3 -0
- package/dist/graph-viewer/viewer/glimmer-js-B4XGl72Q.js +14 -0
- package/dist/graph-viewer/viewer/glimmer-ts-Cd-JLCfl.js +14 -0
- package/dist/graph-viewer/viewer/glsl-gcTBSfUq.js +6 -0
- package/dist/graph-viewer/viewer/gn-DMs_IqO4.js +3 -0
- package/dist/graph-viewer/viewer/gnuplot-Dwu09Wsa.js +3 -0
- package/dist/graph-viewer/viewer/go-BEdBk4fh.js +3 -0
- package/dist/graph-viewer/viewer/go-DHVK1MDf.js +2 -0
- package/dist/graph-viewer/viewer/graphql-CLsas7pB.js +15 -0
- package/dist/graph-viewer/viewer/graphql-hf2jeRF3.js +2 -0
- package/dist/graph-viewer/viewer/groovy-CmZ205Qh.js +3 -0
- package/dist/graph-viewer/viewer/gruvbox-dark-hard-C03xMCtB.js +4 -0
- package/dist/graph-viewer/viewer/gruvbox-dark-hard-D6fxqIcJ.js +128 -0
- package/dist/graph-viewer/viewer/gruvbox-dark-medium-CC6ndC01.js +128 -0
- package/dist/graph-viewer/viewer/gruvbox-dark-medium-ZTNTOYs1.js +4 -0
- package/dist/graph-viewer/viewer/gruvbox-dark-soft-1zGnpoEy.js +4 -0
- package/dist/graph-viewer/viewer/gruvbox-dark-soft-DBjjA89e.js +128 -0
- package/dist/graph-viewer/viewer/gruvbox-light-hard-CNtKpSCc.js +128 -0
- package/dist/graph-viewer/viewer/gruvbox-light-hard-Rq8jWy-t.js +4 -0
- package/dist/graph-viewer/viewer/gruvbox-light-medium-DT10IcB_.js +128 -0
- package/dist/graph-viewer/viewer/gruvbox-light-medium-qoNn8l_N.js +4 -0
- package/dist/graph-viewer/viewer/gruvbox-light-soft-BugAsRiM.js +128 -0
- package/dist/graph-viewer/viewer/gruvbox-light-soft-Dnxtmee2.js +4 -0
- package/dist/graph-viewer/viewer/hack-CDch_7MP.js +10 -0
- package/dist/graph-viewer/viewer/haml-BqkvTyZm.js +11 -0
- package/dist/graph-viewer/viewer/handlebars-RDj3fZHz.js +14 -0
- package/dist/graph-viewer/viewer/haskell-DSSJ-2AO.js +3 -0
- package/dist/graph-viewer/viewer/haxe-DrA0Xrjd.js +3 -0
- package/dist/graph-viewer/viewer/hcl-BxX70ue-.js +3 -0
- package/dist/graph-viewer/viewer/highlights-Bgg6O5ub.js +1351 -0
- package/dist/graph-viewer/viewer/hjson-Znrrrv1t.js +3 -0
- package/dist/graph-viewer/viewer/hlsl-D-dP8z1U.js +3 -0
- package/dist/graph-viewer/viewer/horizon-CE4Yvsia.js +4 -0
- package/dist/graph-viewer/viewer/horizon-EI29cEvA.js +85 -0
- package/dist/graph-viewer/viewer/horizon-bright-BOLA2YFR.js +4 -0
- package/dist/graph-viewer/viewer/horizon-bright-hHpSmrYh.js +85 -0
- package/dist/graph-viewer/viewer/houston-CiDLA2oo.js +4 -0
- package/dist/graph-viewer/viewer/houston-CiUxf-HU.js +195 -0
- package/dist/graph-viewer/viewer/html-9DDE6S-h.js +2 -0
- package/dist/graph-viewer/viewer/html-D0TTaG52.js +11 -0
- package/dist/graph-viewer/viewer/html-derivative-Gg3E-n-U.js +5 -0
- package/dist/graph-viewer/viewer/http-BPgEi3D2.js +14 -0
- package/dist/graph-viewer/viewer/hurl-Sfhn3XgM.js +12 -0
- package/dist/graph-viewer/viewer/hxml-Dv3Zqri9.js +5 -0
- package/dist/graph-viewer/viewer/hy-Cd4h6N3W.js +3 -0
- package/dist/graph-viewer/viewer/imba-DdhTsO9l.js +3 -0
- package/dist/graph-viewer/viewer/ini-CmgEGOBJ.js +3 -0
- package/dist/graph-viewer/viewer/java-CgzoQF6Y.js +5 -0
- package/dist/graph-viewer/viewer/java-DnKlCRJQ.js +2 -0
- package/dist/graph-viewer/viewer/javascript-CHiBfg7Q.js +2 -0
- package/dist/graph-viewer/viewer/javascript-Du25Lw0B.js +5 -0
- package/dist/graph-viewer/viewer/jinja-CmKrofRU.js +5 -0
- package/dist/graph-viewer/viewer/jison-Bh7j04oA.js +5 -0
- package/dist/graph-viewer/viewer/json-Cd131axV.js +2 -0
- package/dist/graph-viewer/viewer/json-Cd3mvCHu.js +5 -0
- package/dist/graph-viewer/viewer/json5-D2Eltym1.js +3 -0
- package/dist/graph-viewer/viewer/jsonc-BPIJyZ7u.js +3 -0
- package/dist/graph-viewer/viewer/jsonc-DyuEwhdL.js +2 -0
- package/dist/graph-viewer/viewer/jsonl-BGkjXns2.js +3 -0
- package/dist/graph-viewer/viewer/jsonnet-DsRfEVPr.js +3 -0
- package/dist/graph-viewer/viewer/jssm-DP2pbfxn.js +3 -0
- package/dist/graph-viewer/viewer/jsx-BC18Lfga.js +5 -0
- package/dist/graph-viewer/viewer/jsx-CDweqMY2.js +2 -0
- package/dist/graph-viewer/viewer/jsx-runtime-BSzbUOFc.js +2136 -0
- package/dist/graph-viewer/viewer/julia-DWXGq3n5.js +16 -0
- package/dist/graph-viewer/viewer/just-CPEDqFxc.js +18 -0
- package/dist/graph-viewer/viewer/kanagawa-dragon-D5ZXvoAT.js +147 -0
- package/dist/graph-viewer/viewer/kanagawa-dragon-m178euzh.js +4 -0
- package/dist/graph-viewer/viewer/kanagawa-lotus-BUmV0rdY.js +147 -0
- package/dist/graph-viewer/viewer/kanagawa-lotus-C4yCdgdL.js +4 -0
- package/dist/graph-viewer/viewer/kanagawa-wave-B6YTgVPM.js +4 -0
- package/dist/graph-viewer/viewer/kanagawa-wave-C4G5CGrn.js +147 -0
- package/dist/graph-viewer/viewer/kdl-BdIUXyK8.js +3 -0
- package/dist/graph-viewer/viewer/kotlin-BYbH5_qW.js +2 -0
- package/dist/graph-viewer/viewer/kotlin-CQsNEM2o.js +3 -0
- package/dist/graph-viewer/viewer/kusto-UWPUoeE5.js +3 -0
- package/dist/graph-viewer/viewer/langs-DKPMizJR.js +1323 -0
- package/dist/graph-viewer/viewer/laserwave-BHOyZkaw.js +72 -0
- package/dist/graph-viewer/viewer/laserwave-CWOG7haO.js +4 -0
- package/dist/graph-viewer/viewer/latex-H1oLZZMa.js +5 -0
- package/dist/graph-viewer/viewer/lazy-pages-fgtpXQ00.js +20 -0
- package/dist/graph-viewer/viewer/lean-D3P_r_z_.js +3 -0
- package/dist/graph-viewer/viewer/less-9LYkHheD.js +3 -0
- package/dist/graph-viewer/viewer/lib-YfRUb5Qz.js +633 -0
- package/dist/graph-viewer/viewer/light-plus-BqoAVMwn.js +4 -0
- package/dist/graph-viewer/viewer/light-plus-mr4QmlNu.js +134 -0
- package/dist/graph-viewer/viewer/liquid-BIl6scjw.js +14 -0
- package/dist/graph-viewer/viewer/llvm-eWADufTp.js +3 -0
- package/dist/graph-viewer/viewer/loader-CJrlDBKq.js +80 -0
- package/dist/graph-viewer/viewer/log-DvQMOE69.js +3 -0
- package/dist/graph-viewer/viewer/logo-Cl5E_QyH.js +3 -0
- package/dist/graph-viewer/viewer/lua-2MenSe50.js +6 -0
- package/dist/graph-viewer/viewer/luau-7dQCidxK.js +3 -0
- package/dist/graph-viewer/viewer/make-CE9Hryyp.js +3 -0
- package/dist/graph-viewer/viewer/markdown-BpJEJUTW.js +8504 -0
- package/dist/graph-viewer/viewer/markdown-CSNMIXpG.js +2 -0
- package/dist/graph-viewer/viewer/markdown-nUtTZkU8.js +3 -0
- package/dist/graph-viewer/viewer/marko-C5vBSh9z.js +14 -0
- package/dist/graph-viewer/viewer/material-theme-B36kIseS.js +93 -0
- package/dist/graph-viewer/viewer/material-theme-D46aZ2Q0.js +4 -0
- package/dist/graph-viewer/viewer/material-theme-darker-DPrN5MJM.js +4 -0
- package/dist/graph-viewer/viewer/material-theme-darker-iFXeHXKD.js +93 -0
- package/dist/graph-viewer/viewer/material-theme-lighter-2HJjoQcP.js +4 -0
- package/dist/graph-viewer/viewer/material-theme-lighter-BBaTLa5v.js +93 -0
- package/dist/graph-viewer/viewer/material-theme-ocean-D1aXUM1Z.js +4 -0
- package/dist/graph-viewer/viewer/material-theme-ocean-Dj5vMPI8.js +93 -0
- package/dist/graph-viewer/viewer/material-theme-palenight-B6DS-lbj.js +4 -0
- package/dist/graph-viewer/viewer/material-theme-palenight-EjN7Wy3X.js +93 -0
- package/dist/graph-viewer/viewer/matlab-fM7rwTZt.js +3 -0
- package/dist/graph-viewer/viewer/mdc-IFxaehab.js +12 -0
- package/dist/graph-viewer/viewer/mdx-DswfiFg4.js +3 -0
- package/dist/graph-viewer/viewer/mdx-e70j-_I5.js +2 -0
- package/dist/graph-viewer/viewer/mermaid-CAl3BhSL.js +3 -0
- package/dist/graph-viewer/viewer/min-dark-BAW8Cmrn.js +4 -0
- package/dist/graph-viewer/viewer/min-dark-BMrfDL-S.js +110 -0
- package/dist/graph-viewer/viewer/min-light-DMqORsIf.js +110 -0
- package/dist/graph-viewer/viewer/min-light-PpFL3JTA.js +4 -0
- package/dist/graph-viewer/viewer/mipsasm-DbPELTlh.js +3 -0
- package/dist/graph-viewer/viewer/model-brand-bTcMjQtB-C9bHPsPk.js +723 -0
- package/dist/graph-viewer/viewer/mojo-B8iEg1Sv.js +3 -0
- package/dist/graph-viewer/viewer/monokai-2mdc1PFC.js +4 -0
- package/dist/graph-viewer/viewer/monokai-b6RWCwKp.js +150 -0
- package/dist/graph-viewer/viewer/moonbit-BR88EIMx.js +3 -0
- package/dist/graph-viewer/viewer/move-CpCLo8d1.js +3 -0
- package/dist/graph-viewer/viewer/narrat-9pGDjQTI.js +3 -0
- package/dist/graph-viewer/viewer/nextflow-BEOXmhnx.js +5 -0
- package/dist/graph-viewer/viewer/nextflow-groovy-Cvo9WVFK.js +3 -0
- package/dist/graph-viewer/viewer/nginx-Dx1JJUel.js +5 -0
- package/dist/graph-viewer/viewer/night-owl-B66IhhIZ.js +4 -0
- package/dist/graph-viewer/viewer/night-owl-Dgg_EwNf.js +176 -0
- package/dist/graph-viewer/viewer/night-owl-light-C6oRQ1ih.js +177 -0
- package/dist/graph-viewer/viewer/night-owl-light-D2RFQCtQ.js +4 -0
- package/dist/graph-viewer/viewer/nim-CpR9PfF3.js +20 -0
- package/dist/graph-viewer/viewer/nix-CwcLdFnB.js +3 -0
- package/dist/graph-viewer/viewer/nord-BD48P4mW.js +116 -0
- package/dist/graph-viewer/viewer/nord-Sih_lPjv.js +4 -0
- package/dist/graph-viewer/viewer/nsis-Dn88_Onr.js +3 -0
- package/dist/graph-viewer/viewer/nushell-DDaptVCJ.js +3 -0
- package/dist/graph-viewer/viewer/objective-c-DK-EKgyd.js +3 -0
- package/dist/graph-viewer/viewer/objective-cpp-CXtEgxjw.js +3 -0
- package/dist/graph-viewer/viewer/ocaml-BO-0Wjtk.js +3 -0
- package/dist/graph-viewer/viewer/odin-BDNmOx6H.js +3 -0
- package/dist/graph-viewer/viewer/one-dark-pro-DFN4GD0H.js +4 -0
- package/dist/graph-viewer/viewer/one-dark-pro-MBgmHRam.js +112 -0
- package/dist/graph-viewer/viewer/one-light-Bi4vf2dv.js +138 -0
- package/dist/graph-viewer/viewer/one-light-zI0r8mzs.js +4 -0
- package/dist/graph-viewer/viewer/openscad-B8gTrm-E.js +3 -0
- package/dist/graph-viewer/viewer/org-SBzxSGZD.js +100 -0
- package/dist/graph-viewer/viewer/page-header-C6YCPkzJ.js +72 -0
- package/dist/graph-viewer/viewer/pascal-CRtegPzh.js +3 -0
- package/dist/graph-viewer/viewer/perl-Cotj8Fvk.js +16 -0
- package/dist/graph-viewer/viewer/php-BCjZGKW5.js +2 -0
- package/dist/graph-viewer/viewer/php-DuQlfgak.js +18 -0
- package/dist/graph-viewer/viewer/pierre-dark-Dc3Ll6Hl.js +154 -0
- package/dist/graph-viewer/viewer/pierre-dark-eM2ca6q-.js +4 -0
- package/dist/graph-viewer/viewer/pierre-dark-protanopia-deuteranopia-FuOdjT6t.js +4 -0
- package/dist/graph-viewer/viewer/pierre-dark-protanopia-deuteranopia-h_4QkzS0.js +154 -0
- package/dist/graph-viewer/viewer/pierre-dark-soft-BFXGcQOC.js +4 -0
- package/dist/graph-viewer/viewer/pierre-dark-soft-DlFiKlWf.js +154 -0
- package/dist/graph-viewer/viewer/pierre-dark-tritanopia-D8Wgm6MB.js +154 -0
- package/dist/graph-viewer/viewer/pierre-dark-tritanopia-HphJrMfv.js +4 -0
- package/dist/graph-viewer/viewer/pierre-dark-vibrant-BxJmNTpB.js +154 -0
- package/dist/graph-viewer/viewer/pierre-dark-vibrant-CJwaYoBu.js +4 -0
- package/dist/graph-viewer/viewer/pierre-light-Bd7oPgtx.js +4 -0
- package/dist/graph-viewer/viewer/pierre-light-CFLGbwCM.js +154 -0
- package/dist/graph-viewer/viewer/pierre-light-protanopia-deuteranopia-BlBh_kV-.js +154 -0
- package/dist/graph-viewer/viewer/pierre-light-protanopia-deuteranopia-fUFGoRe8.js +4 -0
- package/dist/graph-viewer/viewer/pierre-light-soft-Ah2itsu1.js +154 -0
- package/dist/graph-viewer/viewer/pierre-light-soft-DobqmynA.js +4 -0
- package/dist/graph-viewer/viewer/pierre-light-tritanopia-Bpej1qhn.js +154 -0
- package/dist/graph-viewer/viewer/pierre-light-tritanopia-BrKH6xXA.js +4 -0
- package/dist/graph-viewer/viewer/pierre-light-vibrant-BjCO0blv.js +154 -0
- package/dist/graph-viewer/viewer/pierre-light-vibrant-COFDSNWf.js +4 -0
- package/dist/graph-viewer/viewer/pkl-C53Sb050.js +3 -0
- package/dist/graph-viewer/viewer/plain-words-CgvxtEOa.js +17 -0
- package/dist/graph-viewer/viewer/plastic-BKBSI3T4.js +4 -0
- package/dist/graph-viewer/viewer/plastic-BtQ0IfLu.js +125 -0
- package/dist/graph-viewer/viewer/plsql-Bx7tup_v.js +3 -0
- package/dist/graph-viewer/viewer/po-DSTB2Mz9.js +3 -0
- package/dist/graph-viewer/viewer/poimandres-DaSN2vl7.js +112 -0
- package/dist/graph-viewer/viewer/poimandres-Dbcm0FXZ.js +4 -0
- package/dist/graph-viewer/viewer/polar-E3hAEXm5.js +3 -0
- package/dist/graph-viewer/viewer/popover-DrLB9iar.js +5329 -0
- package/dist/graph-viewer/viewer/postcss-BZib8l4b.js +3 -0
- package/dist/graph-viewer/viewer/powerquery-CJblX2B2.js +3 -0
- package/dist/graph-viewer/viewer/powershell-jc6OXU_u.js +3 -0
- package/dist/graph-viewer/viewer/prisma-CBAWJppo.js +3 -0
- package/dist/graph-viewer/viewer/prolog-Ce1YjgEP.js +3 -0
- package/dist/graph-viewer/viewer/proto-DGLklcji.js +3 -0
- package/dist/graph-viewer/viewer/pug-CPAFvvT7.js +12 -0
- package/dist/graph-viewer/viewer/puppet-B2qoEJs2.js +3 -0
- package/dist/graph-viewer/viewer/purescript-Cq_6EhvO.js +3 -0
- package/dist/graph-viewer/viewer/python-BgSzeAZt.js +2 -0
- package/dist/graph-viewer/viewer/python-D0AaDoWC.js +3 -0
- package/dist/graph-viewer/viewer/qml-CAJAZclz.js +5 -0
- package/dist/graph-viewer/viewer/qmldir-BSWsNKCW.js +3 -0
- package/dist/graph-viewer/viewer/qss-CT2jsqXX.js +3 -0
- package/dist/graph-viewer/viewer/r-gNt6i8Zf.js +5 -0
- package/dist/graph-viewer/viewer/racket-B0_wXtli.js +3 -0
- package/dist/graph-viewer/viewer/raku-DKDZy5Ck.js +3 -0
- package/dist/graph-viewer/viewer/razor-CmVjd-Dh.js +10 -0
- package/dist/graph-viewer/viewer/rbs-DvNU-OQ_.js +3 -0
- package/dist/graph-viewer/viewer/react-CisnW4fB.js +4262 -0
- package/dist/graph-viewer/viewer/react-dom-C5NDYQCD.js +143 -0
- package/dist/graph-viewer/viewer/record-part-d0gKKrMI.js +1299 -0
- package/dist/graph-viewer/viewer/red-D-VJz2zz.js +154 -0
- package/dist/graph-viewer/viewer/red-DidxQpA-.js +4 -0
- package/dist/graph-viewer/viewer/reg-D6txjqBF.js +3 -0
- package/dist/graph-viewer/viewer/regexp-CJmLSLYE.js +5 -0
- package/dist/graph-viewer/viewer/rel-CY3GbSca.js +3 -0
- package/dist/graph-viewer/viewer/riscv-BKjM5F1V.js +3 -0
- package/dist/graph-viewer/viewer/rolldown-runtime-DArdT4gl.js +23 -0
- package/dist/graph-viewer/viewer/ron-DJgcWJZU.js +3 -0
- package/dist/graph-viewer/viewer/rose-pine-DN0mhTLO.js +4 -0
- package/dist/graph-viewer/viewer/rose-pine-dawn-C7BTe7Qj.js +124 -0
- package/dist/graph-viewer/viewer/rose-pine-dawn-wShSQEG_.js +4 -0
- package/dist/graph-viewer/viewer/rose-pine-moon-CXZ0x-tN.js +4 -0
- package/dist/graph-viewer/viewer/rose-pine-moon-DpdAjsWi.js +124 -0
- package/dist/graph-viewer/viewer/rose-pine-ndHcBYxH.js +124 -0
- package/dist/graph-viewer/viewer/rosmsg-BTByjkSH.js +3 -0
- package/dist/graph-viewer/viewer/rst-BNLuumiw.js +22 -0
- package/dist/graph-viewer/viewer/ruby-BPTDv07s.js +30 -0
- package/dist/graph-viewer/viewer/ruby-Dgthgv0F.js +2 -0
- package/dist/graph-viewer/viewer/rust-DCdaqFaU.js +2 -0
- package/dist/graph-viewer/viewer/rust-Dj2n2rl0.js +3 -0
- package/dist/graph-viewer/viewer/sas-DViflgLe.js +5 -0
- package/dist/graph-viewer/viewer/sass-CL6GLiPQ.js +3 -0
- package/dist/graph-viewer/viewer/scala-D9AnhX7I.js +3 -0
- package/dist/graph-viewer/viewer/scheme-BksZ4zIw.js +3 -0
- package/dist/graph-viewer/viewer/scss-7wpnG0B9.js +2 -0
- package/dist/graph-viewer/viewer/scss-DR3BWwkk.js +6 -0
- package/dist/graph-viewer/viewer/sdbl-CLOIgNSF.js +3 -0
- package/dist/graph-viewer/viewer/segmented-control-ChhLMa6h.js +142 -0
- package/dist/graph-viewer/viewer/shaderlab-BNI6l0C5.js +5 -0
- package/dist/graph-viewer/viewer/shellscript-JaF_7KS2.js +5 -0
- package/dist/graph-viewer/viewer/shellsession-BpXPWCuv.js +5 -0
- package/dist/graph-viewer/viewer/shiki-BwlTRTY6.js +488 -0
- package/dist/graph-viewer/viewer/slack-dark-BxRxM-DA.js +72 -0
- package/dist/graph-viewer/viewer/slack-dark-eYrSWFNQ.js +4 -0
- package/dist/graph-viewer/viewer/slack-ochin-BkYWF81M.js +95 -0
- package/dist/graph-viewer/viewer/slack-ochin-DnDV13wS.js +4 -0
- package/dist/graph-viewer/viewer/smalltalk-OVt5uEUD.js +3 -0
- package/dist/graph-viewer/viewer/smithy-CseSvY8s.js +3 -0
- package/dist/graph-viewer/viewer/snazzy-light-CY4buyRs.js +4 -0
- package/dist/graph-viewer/viewer/snazzy-light-nzcYE5KK.js +81 -0
- package/dist/graph-viewer/viewer/solarized-dark-CJ28ehED.js +4 -0
- package/dist/graph-viewer/viewer/solarized-dark-CNL-YE5C.js +148 -0
- package/dist/graph-viewer/viewer/solarized-light-CPffzncm.js +4 -0
- package/dist/graph-viewer/viewer/solarized-light-CkLaeXvs.js +148 -0
- package/dist/graph-viewer/viewer/solidity-CGi7NMBq.js +2 -0
- package/dist/graph-viewer/viewer/solidity-CXjfwKeT.js +3 -0
- package/dist/graph-viewer/viewer/soy-BgMg3QC4.js +5 -0
- package/dist/graph-viewer/viewer/sparql-RY7y0-Jf.js +5 -0
- package/dist/graph-viewer/viewer/splunk-MGILMmew.js +3 -0
- package/dist/graph-viewer/viewer/sql-BIIYxsxo.js +5 -0
- package/dist/graph-viewer/viewer/sql-bbpzmmG9.js +2 -0
- package/dist/graph-viewer/viewer/ssh-config-CFmUyPR7.js +3 -0
- package/dist/graph-viewer/viewer/stata-W40nJXFi.js +5 -0
- package/dist/graph-viewer/viewer/stream-tokenizer-CaVb21TO.js +99 -0
- package/dist/graph-viewer/viewer/stylus-Kh83dApl.js +3 -0
- package/dist/graph-viewer/viewer/surrealql-BvdRuViV.js +5 -0
- package/dist/graph-viewer/viewer/svelte-BIpAIvXq.js +14 -0
- package/dist/graph-viewer/viewer/swift-B7Z-rXzN.js +3 -0
- package/dist/graph-viewer/viewer/swift-CITNSfj8.js +2 -0
- package/dist/graph-viewer/viewer/synthwave-84-k9mB1wtO.js +4 -0
- package/dist/graph-viewer/viewer/synthwave-84-kUO_gAph.js +398 -0
- package/dist/graph-viewer/viewer/system-verilog-CQoMYllC.js +3 -0
- package/dist/graph-viewer/viewer/systemd-ArfzIYBi.js +3 -0
- package/dist/graph-viewer/viewer/talonscript-SIE54PtE.js +3 -0
- package/dist/graph-viewer/viewer/tasl-Ck4PO08m.js +3 -0
- package/dist/graph-viewer/viewer/tcl-DfkVwqLO.js +3 -0
- package/dist/graph-viewer/viewer/templ-CcrsYqs3.js +12 -0
- package/dist/graph-viewer/viewer/terminal-BxRacTx0.js +52 -0
- package/dist/graph-viewer/viewer/terraform-DccThf6s.js +3 -0
- package/dist/graph-viewer/viewer/tex-OxWF-6wM.js +6 -0
- package/dist/graph-viewer/viewer/themes-BxrCCwH5.js +238 -0
- package/dist/graph-viewer/viewer/tokyo-night-pVep8RHB.js +141 -0
- package/dist/graph-viewer/viewer/tokyo-night-wSZ66vL4.js +4 -0
- package/dist/graph-viewer/viewer/toml-CIQJnU5u.js +3 -0
- package/dist/graph-viewer/viewer/toml-D2vAS7BS.js +2 -0
- package/dist/graph-viewer/viewer/ts-tags-CBuzNYes.js +38 -0
- package/dist/graph-viewer/viewer/tsv-AfvsdcL-.js +3 -0
- package/dist/graph-viewer/viewer/tsx-BjEV2c_V.js +2 -0
- package/dist/graph-viewer/viewer/tsx-utlJ2eBd.js +5 -0
- package/dist/graph-viewer/viewer/turtle-D1NNZBgy.js +3 -0
- package/dist/graph-viewer/viewer/twig-BojFE3iW.js +18 -0
- package/dist/graph-viewer/viewer/typescript-S9qHhxTN.js +5 -0
- package/dist/graph-viewer/viewer/typescript-ekZNylIf.js +2 -0
- package/dist/graph-viewer/viewer/typespec-M_tZhO7D.js +3 -0
- package/dist/graph-viewer/viewer/typst-D2koCOEy.js +120 -0
- package/dist/graph-viewer/viewer/ui-ByOBsvk7.js +5 -0
- package/dist/graph-viewer/viewer/ui-CxK41KO5.js +5 -0
- package/dist/graph-viewer/viewer/ui-DZiGjPwl.js +906 -0
- package/dist/graph-viewer/viewer/v-DbYZLS97.js +3 -0
- package/dist/graph-viewer/viewer/vala-i5OYwFuH.js +3 -0
- package/dist/graph-viewer/viewer/vb-DRaXf86R.js +3 -0
- package/dist/graph-viewer/viewer/verilog-Dl3uFuBh.js +3 -0
- package/dist/graph-viewer/viewer/vesper-B2HI-Qu1.js +84 -0
- package/dist/graph-viewer/viewer/vesper-DgN5ShJZ.js +4 -0
- package/dist/graph-viewer/viewer/vhdl-UepOATuw.js +3 -0
- package/dist/graph-viewer/viewer/viml-DgaHry3T.js +3 -0
- package/dist/graph-viewer/viewer/vitesse-black-B09teiUx.js +4 -0
- package/dist/graph-viewer/viewer/vitesse-black-BLUtFdIS.js +184 -0
- package/dist/graph-viewer/viewer/vitesse-dark-CSebpMf5.js +184 -0
- package/dist/graph-viewer/viewer/vitesse-dark-CkA3-NtU.js +4 -0
- package/dist/graph-viewer/viewer/vitesse-light-DECVT8fj.js +4 -0
- package/dist/graph-viewer/viewer/vitesse-light-DJPcjfyV.js +184 -0
- package/dist/graph-viewer/viewer/vue-CiFPO7R5.js +21 -0
- package/dist/graph-viewer/viewer/vue-html-BZL30ZyU.js +5 -0
- package/dist/graph-viewer/viewer/vue-vine-CVQkz-vV.js +18 -0
- package/dist/graph-viewer/viewer/vyper-BiyGiCmH.js +3 -0
- package/dist/graph-viewer/viewer/wasm-BXdtUMGf.js +4 -0
- package/dist/graph-viewer/viewer/wasm-DXa1gtBd.js +3 -0
- package/dist/graph-viewer/viewer/wenyan-Ke6AN0BI.js +3 -0
- package/dist/graph-viewer/viewer/wgsl-Vcm3Lg52.js +3 -0
- package/dist/graph-viewer/viewer/wikitext-C4uDiSA9.js +3 -0
- package/dist/graph-viewer/viewer/wit-hbIPZwZR.js +3 -0
- package/dist/graph-viewer/viewer/wolfram-DGFnG0I5.js +3 -0
- package/dist/graph-viewer/viewer/workspace-DalRxssx.js +25100 -0
- package/dist/graph-viewer/viewer/x-B_F8B4lq.js +56 -0
- package/dist/graph-viewer/viewer/xml-C4j_mOgu.js +6 -0
- package/dist/graph-viewer/viewer/xml-SfvhYhbQ.js +2 -0
- package/dist/graph-viewer/viewer/xsl-CNv6nqtA.js +5 -0
- package/dist/graph-viewer/viewer/yaml-CS1e8wnG.js +5 -0
- package/dist/graph-viewer/viewer/yaml-CudzZ2m4.js +2 -0
- package/dist/graph-viewer/viewer/zenscript-BtXHY1aa.js +3 -0
- package/dist/graph-viewer/viewer/zig-BaU1vZRj.js +3 -0
- package/dist/graph-viewer/workspace-model-Ewf17pTW.js +1541 -0
- package/dist/graph-viewer/workspace-viewer.js +24443 -0
- package/dist/graph-viewer/workspace.js +2 -0
- package/dist/index.mjs +11 -11
- package/package.json +5 -5
|
@@ -0,0 +1,2293 @@
|
|
|
1
|
+
import { recordSchema as e } from "./record.js";
|
|
2
|
+
import { t } from "./part-events-BrLrg_EV.js";
|
|
3
|
+
import { n, t as r } from "./anchor-C4i5SrB9.js";
|
|
4
|
+
import { createHash as i } from "node:crypto";
|
|
5
|
+
import { closeSync as a, copyFileSync as o, existsSync as s, mkdtempSync as c, openSync as l, readFileSync as u, readSync as d, readdirSync as f, rmSync as p, statSync as m } from "node:fs";
|
|
6
|
+
import { tmpdir as h } from "node:os";
|
|
7
|
+
import { basename as g, dirname as _, join as v } from "node:path";
|
|
8
|
+
//#region src/adapters/agent-runtime.ts
|
|
9
|
+
var y = "2.7.0", b = 134217728;
|
|
10
|
+
function x({ maxBytes: e = 1073741824 } = {}) {
|
|
11
|
+
let t = /* @__PURE__ */ new Map(), n = 0;
|
|
12
|
+
return {
|
|
13
|
+
read(r) {
|
|
14
|
+
let i = m(r), a = `${i.dev}:${i.ino}:${i.size}:${i.mtimeMs}:${i.ctimeMs}`, o = t.get(r);
|
|
15
|
+
if (o && (t.delete(r), n -= o.bytes.length, o.key === a)) return t.set(r, o), n += o.bytes.length, o;
|
|
16
|
+
let s = u(r), c = {
|
|
17
|
+
key: a,
|
|
18
|
+
bytes: s,
|
|
19
|
+
sha256: T(s)
|
|
20
|
+
};
|
|
21
|
+
s.length <= e / 4 && (t.set(r, c), n += s.length);
|
|
22
|
+
for (let [r, i] of t) {
|
|
23
|
+
if (n <= e) break;
|
|
24
|
+
t.delete(r), n -= i.bytes.length;
|
|
25
|
+
}
|
|
26
|
+
return c;
|
|
27
|
+
},
|
|
28
|
+
heldBytes: () => n
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
var S = class extends Error {
|
|
32
|
+
exitCode = 2;
|
|
33
|
+
}, C = class extends Error {
|
|
34
|
+
exitCode = 3;
|
|
35
|
+
code = "record-too-large";
|
|
36
|
+
}, w = class extends Error {
|
|
37
|
+
exitCode = 4;
|
|
38
|
+
}, T = (e) => i("sha256").update(e).digest("hex"), E = (e) => typeof e == "string" && /^(sha256[:-])?[0-9a-f]{64}$/.test(e) ? e.slice(-64) : null, D = /(^|\/)\.claude\/projects\/[^/]+\/[^/]+\.jsonl$/, O = (e) => D.test(e) ? e.slice(e.lastIndexOf(".claude/projects/")) : null, k = /(^|\/)\.local\/share\/opencode\/opencode\.db$/, A = "evidence/native-index.jsonl", j = "evidence/live-stream", M = Date.UTC(2001, 0, 1), N = Date.UTC(2100, 0, 1), P = (e) => {
|
|
39
|
+
if (typeof e != "string" && typeof e != "number") return null;
|
|
40
|
+
let t = new Date(typeof e == "number" && e < 1e11 ? e * 1e3 : e), n = t.valueOf();
|
|
41
|
+
return Number.isFinite(n) && n >= M && n < N ? t.toISOString() : null;
|
|
42
|
+
};
|
|
43
|
+
function F(e) {
|
|
44
|
+
if (e == null) return "null";
|
|
45
|
+
if (e === !0) return "true";
|
|
46
|
+
if (e === !1) return "false";
|
|
47
|
+
if (typeof e == "number") {
|
|
48
|
+
if (!Number.isFinite(e)) return e > 0 ? "Infinity" : e < 0 ? "-Infinity" : "NaN";
|
|
49
|
+
if (Number.isInteger(e) && Math.abs(e) < 0x2386f26fc10000) return String(e);
|
|
50
|
+
let [t, n] = e.toExponential().split("e");
|
|
51
|
+
return Number(n) >= -4 && Number(n) < 16 ? /[.e]/.test(String(e)) ? String(e) : `${e}.0` : `${t}e${n[0]}${n.slice(1).padStart(2, "0")}`;
|
|
52
|
+
}
|
|
53
|
+
if (typeof e == "string") {
|
|
54
|
+
let t = "\"";
|
|
55
|
+
for (let n = 0; n < e.length; n++) {
|
|
56
|
+
let r = e.charCodeAt(n), i = e[n];
|
|
57
|
+
t += i === "\"" ? "\\\"" : i === "\\" ? "\\\\" : i === "\n" ? "\\n" : i === "\r" ? "\\r" : i === " " ? "\\t" : i === "\b" ? "\\b" : i === "\f" ? "\\f" : r < 32 || r > 126 ? `\\u${r.toString(16).padStart(4, "0")}` : i;
|
|
58
|
+
}
|
|
59
|
+
return `${t}"`;
|
|
60
|
+
}
|
|
61
|
+
return Array.isArray(e) ? `[${e.map(F).join(", ")}]` : typeof e == "object" ? `{${Object.keys(e).sort().map((t) => `${F(t)}: ${F(e[t])}`).join(", ")}}` : "null";
|
|
62
|
+
}
|
|
63
|
+
function I(e) {
|
|
64
|
+
let t = 0;
|
|
65
|
+
for (let n of e) {
|
|
66
|
+
let e = n && typeof n == "object" ? "text" in n ? n.text : "thinking" in n ? n.thinking : "" : "";
|
|
67
|
+
t += [...typeof e == "string" ? e : e === null ? "None" : String(e)].length;
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
contentSha256: T(F(e)),
|
|
71
|
+
contentCharacters: t
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
var L = (e) => typeof e == "string" ? e : e == null ? "" : JSON.stringify(e), R = (e) => typeof e == "number" && Number.isFinite(e) ? e : void 0, z = [
|
|
75
|
+
[/await|wait_?for|wait_agent|^wait$|sleep|poll|watch_events|next_event/, "waiting"],
|
|
76
|
+
[/spawn|delegate|subagent|^task$|^agent$|send_message|post_message|coordinat|assign|settle|todowrite|^todo|cancel_child|children/, "coordination"],
|
|
77
|
+
[/^(write|edit|multiedit|notebookedit|str_replace|apply_patch|patch|create_file|write_file|edit_file|file_change|replace)/, "writing"],
|
|
78
|
+
[/web_?search|web_?fetch|^fetch$|search_papers|arxiv|scholar|knowledge|retriev|literature|crossref|^read|^view|^glob$|^grep$|^ls$|list_dir|open_file|^cat$|search_files|find_files/, "literature"],
|
|
79
|
+
[/verif|^check|_check|test|lean|prove|proof|validate|assert/, "verification"],
|
|
80
|
+
[/bash|shell|exec|command|^run|python|terminal|jupyter|interpreter|compute|^sh$/, "compute"]
|
|
81
|
+
], B = [
|
|
82
|
+
[/\b(pip3? install|python3? -m pip install|npm (i|install|ci)\b|pnpm (i|install|add)\b|yarn add|apt(-get)? install|brew install|cargo install|uv (pip|add|sync)\b|conda install|git clone|elan |rustup )/, "setup"],
|
|
83
|
+
[/^\s*(sleep\b|while\b.*\bsleep\b|until\b)|\bwait\b\s*$/, "waiting"],
|
|
84
|
+
[/\b(pytest|unittest|cargo test|(npm|pnpm|yarn) (run )?test|lake (build|env)|lean\b|coqc|z3\b|verify|--check\b|sha256sum -c|diff -q)/, "verification"],
|
|
85
|
+
[/\b(curl|wget)\b[^|]*(arxiv|doi\.org|semanticscholar|scholar|crossref|openalex|https?:)/, "literature"],
|
|
86
|
+
[/^\s*(cat|head|tail|less|rg|grep|find|ls|wc|tree|file|stat|jq)\b|\bsed -n\b/, "literature"],
|
|
87
|
+
[/(^|[;&|]\s*)(cat\s*>|tee\b)|\bsed -i\b|>\s*\S+\.(md|tex|json|py|ts|mjs|txt)\b/, "writing"]
|
|
88
|
+
];
|
|
89
|
+
function V(e, t) {
|
|
90
|
+
let n = e.toLowerCase().replace(/^mcp__[^_]+(?:_[^_]+)*?__/, ""), r = /^mcp__([^_]+(?:[-_][^_]+)*?)__/.exec(e.toLowerCase())?.[1] ?? "", i = (() => {
|
|
91
|
+
if (typeof t == "string") try {
|
|
92
|
+
let e = JSON.parse(t);
|
|
93
|
+
return typeof e?.command == "string" ? e.command : typeof e?.cmd == "string" ? e.cmd : "";
|
|
94
|
+
} catch {
|
|
95
|
+
return "";
|
|
96
|
+
}
|
|
97
|
+
let e = t;
|
|
98
|
+
return typeof e?.command == "string" ? e.command : typeof e?.cmd == "string" ? e.cmd : "";
|
|
99
|
+
})(), a = "other";
|
|
100
|
+
for (let [e, t] of z) if (e.test(n)) {
|
|
101
|
+
a = t;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
if (a === "other" && /coordination/.test(r) && (a = "coordination"), (a === "compute" || a === "other") && i) {
|
|
105
|
+
for (let [e, t] of B) if (e.test(i)) return t;
|
|
106
|
+
return "compute";
|
|
107
|
+
}
|
|
108
|
+
return a;
|
|
109
|
+
}
|
|
110
|
+
function H(e, t) {
|
|
111
|
+
let n = [], r = 0, i = 1;
|
|
112
|
+
for (; r <= e.length;) {
|
|
113
|
+
let a = e.indexOf(10, r);
|
|
114
|
+
if (a < 0 && (a = e.length), !t || t(i)) {
|
|
115
|
+
let t = e.toString("utf8", r, a);
|
|
116
|
+
if (t.endsWith("\r") && (t = t.slice(0, -1)), t.trim()) {
|
|
117
|
+
let e;
|
|
118
|
+
try {
|
|
119
|
+
e = JSON.parse(t);
|
|
120
|
+
} catch {
|
|
121
|
+
e = void 0;
|
|
122
|
+
}
|
|
123
|
+
n.push({
|
|
124
|
+
line: i,
|
|
125
|
+
raw: t,
|
|
126
|
+
value: e
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
r = a + 1, i++;
|
|
131
|
+
}
|
|
132
|
+
return n;
|
|
133
|
+
}
|
|
134
|
+
var U = (e) => e ? (t) => e.some(([e, n]) => t >= e && t <= n) : void 0, W = (e) => {
|
|
135
|
+
try {
|
|
136
|
+
return f(e).sort();
|
|
137
|
+
} catch {
|
|
138
|
+
return [];
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
function G(e, t = "", n = []) {
|
|
142
|
+
for (let r of W(v(e, t))) {
|
|
143
|
+
let i = t ? `${t}/${r}` : r, a;
|
|
144
|
+
try {
|
|
145
|
+
a = m(v(e, i));
|
|
146
|
+
} catch {
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
a.isDirectory() ? G(e, i, n) : a.isFile() && n.push(i);
|
|
150
|
+
}
|
|
151
|
+
return n;
|
|
152
|
+
}
|
|
153
|
+
var K = (...e) => "/" + e.map((e) => String(e).replaceAll("~", "~0").replaceAll("/", "~1")).join("/");
|
|
154
|
+
function q(e, t, n) {
|
|
155
|
+
for (; t > 0 && t < e.length && (e[t] & 192) == 128;) t++;
|
|
156
|
+
for (; n < e.length && n > 0 && (e[n] & 192) == 128;) n--;
|
|
157
|
+
return e.subarray(t, n).toString("utf8");
|
|
158
|
+
}
|
|
159
|
+
var J = class {
|
|
160
|
+
runDir;
|
|
161
|
+
nativeRoot;
|
|
162
|
+
maxText;
|
|
163
|
+
options;
|
|
164
|
+
runId;
|
|
165
|
+
runIdBasis;
|
|
166
|
+
manifestFiles = /* @__PURE__ */ new Map();
|
|
167
|
+
claimed = /* @__PURE__ */ new Map();
|
|
168
|
+
executionOf = /* @__PURE__ */ new Map();
|
|
169
|
+
sources = /* @__PURE__ */ new Map();
|
|
170
|
+
events = [];
|
|
171
|
+
gaps = [];
|
|
172
|
+
nodes = /* @__PURE__ */ new Map();
|
|
173
|
+
fileCache = /* @__PURE__ */ new Map();
|
|
174
|
+
nativeIndexCache;
|
|
175
|
+
rootId;
|
|
176
|
+
order = 0;
|
|
177
|
+
format = "other";
|
|
178
|
+
runInput = null;
|
|
179
|
+
runInputRel = null;
|
|
180
|
+
constructor(e, t, n, r = {}) {
|
|
181
|
+
this.runDir = e, this.nativeRoot = t, this.maxText = n, this.options = r;
|
|
182
|
+
let i = typeof r.manifest?.runId == "string" && r.manifest.runId ? r.manifest.runId : void 0;
|
|
183
|
+
this.runId = r.runId ?? i ?? g(e.replace(/\/+$/, "")), this.runIdBasis = r.runId ? "option" : i ? "manifest" : "directory", this.rootId = this.runId;
|
|
184
|
+
for (let e of r.manifest?.files ?? []) this.manifestFiles.set(e.path, e);
|
|
185
|
+
}
|
|
186
|
+
sourcePath(e) {
|
|
187
|
+
return !this.options.prefix || e.startsWith("native:") ? e : `${this.options.prefix}${e}`;
|
|
188
|
+
}
|
|
189
|
+
file(e, t = v(this.runDir, e)) {
|
|
190
|
+
let n = this.fileCache.get(t);
|
|
191
|
+
if (n) return n;
|
|
192
|
+
let r = this.options.files?.read(t), i = r?.bytes ?? u(t), a, o = {
|
|
193
|
+
bytes: i,
|
|
194
|
+
sha256: r?.sha256 ?? T(i),
|
|
195
|
+
get text() {
|
|
196
|
+
return a ??= i.toString("utf8");
|
|
197
|
+
}
|
|
198
|
+
}, s = this.manifestFiles.get(this.sourcePath(e));
|
|
199
|
+
if (s && E(s.sha256) !== o.sha256) throw new w(`${e} does not match its snapshot manifest`);
|
|
200
|
+
return this.fileCache.set(t, o), o;
|
|
201
|
+
}
|
|
202
|
+
digestOnly(e, t = v(this.runDir, e)) {
|
|
203
|
+
let n = this.manifestFiles.get(this.sourcePath(e));
|
|
204
|
+
if (n) return {
|
|
205
|
+
sha256: E(n.sha256),
|
|
206
|
+
bytes: n.bytes
|
|
207
|
+
};
|
|
208
|
+
if (this.options.files) try {
|
|
209
|
+
let e = this.options.files.read(t);
|
|
210
|
+
return {
|
|
211
|
+
sha256: e.sha256,
|
|
212
|
+
bytes: e.bytes.length
|
|
213
|
+
};
|
|
214
|
+
} catch {
|
|
215
|
+
return null;
|
|
216
|
+
}
|
|
217
|
+
let r;
|
|
218
|
+
try {
|
|
219
|
+
r = l(t, "r");
|
|
220
|
+
} catch {
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
try {
|
|
224
|
+
let e = i("sha256"), t = Buffer.allocUnsafe(1 << 20), n = 0;
|
|
225
|
+
for (let i = d(r, t); i > 0; i = d(r, t)) e.update(t.subarray(0, i)), n += i;
|
|
226
|
+
return {
|
|
227
|
+
sha256: e.digest("hex"),
|
|
228
|
+
bytes: n
|
|
229
|
+
};
|
|
230
|
+
} finally {
|
|
231
|
+
a(r);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
addSource(e) {
|
|
235
|
+
let t = {
|
|
236
|
+
...e,
|
|
237
|
+
path: this.sourcePath(e.path)
|
|
238
|
+
}, n = `${t.path}\0${t.line ?? ""}\0${t.pointer ?? ""}`, r = this.sources.get(n);
|
|
239
|
+
return r?.sha256 ? r : (this.sources.set(n, t), t);
|
|
240
|
+
}
|
|
241
|
+
fileSource(e, t, n) {
|
|
242
|
+
let r = this.file(e, t);
|
|
243
|
+
return this.addSource({
|
|
244
|
+
path: e,
|
|
245
|
+
sha256: r.sha256,
|
|
246
|
+
bytes: r.bytes.length,
|
|
247
|
+
...n ? { label: n } : {}
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
listSource(e) {
|
|
251
|
+
let t = this.digestOnly(e);
|
|
252
|
+
t && this.addSource({
|
|
253
|
+
path: e,
|
|
254
|
+
...t
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
lineSource(e, t, n) {
|
|
258
|
+
let r = Buffer.from(n, "utf8");
|
|
259
|
+
return this.addSource({
|
|
260
|
+
path: e,
|
|
261
|
+
line: t,
|
|
262
|
+
sha256: T(r),
|
|
263
|
+
bytes: r.length
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
pointerSource(e, t, n, r) {
|
|
267
|
+
let i = Buffer.from(typeof n == "string" ? n : JSON.stringify(n), "utf8");
|
|
268
|
+
return this.addSource({
|
|
269
|
+
path: e,
|
|
270
|
+
pointer: t,
|
|
271
|
+
sha256: T(i),
|
|
272
|
+
bytes: i.length,
|
|
273
|
+
...r ? { label: r } : {}
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
clip(e, t) {
|
|
277
|
+
let n = Buffer.from(e, "utf8");
|
|
278
|
+
if (n.length <= this.maxText) return {
|
|
279
|
+
text: e,
|
|
280
|
+
clip: void 0
|
|
281
|
+
};
|
|
282
|
+
let r = Math.floor(this.maxText * .75), i = this.maxText - r, a = `${q(n, 0, r)}\n\n…\n\n${q(n, n.length - i, n.length)}`, o = t?.() ?? null;
|
|
283
|
+
return {
|
|
284
|
+
text: a,
|
|
285
|
+
clip: {
|
|
286
|
+
bytes: n.length,
|
|
287
|
+
sha256: o?.sha256 ?? null
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
compactValue(e, t = 0) {
|
|
292
|
+
if (typeof e == "string") {
|
|
293
|
+
let t = Math.min(this.maxText, 2048);
|
|
294
|
+
return Buffer.byteLength(e) > t ? this.clip(e, null).text.slice(0, t) + "…" : e;
|
|
295
|
+
}
|
|
296
|
+
if (Array.isArray(e)) {
|
|
297
|
+
let n = e.slice(0, 50).map((e) => this.compactValue(e, t + 1));
|
|
298
|
+
return e.length > 50 ? [...n, `… ${e.length - 50} more`] : n;
|
|
299
|
+
}
|
|
300
|
+
if (e && typeof e == "object") {
|
|
301
|
+
if (t > 6) return "…";
|
|
302
|
+
let n = {};
|
|
303
|
+
for (let [r, i] of Object.entries(e)) n[r] = this.compactValue(i, t + 1);
|
|
304
|
+
return n;
|
|
305
|
+
}
|
|
306
|
+
return e;
|
|
307
|
+
}
|
|
308
|
+
emit(e) {
|
|
309
|
+
let t = {
|
|
310
|
+
...e.source,
|
|
311
|
+
path: this.sourcePath(e.source.path)
|
|
312
|
+
};
|
|
313
|
+
this.events.push({
|
|
314
|
+
...e,
|
|
315
|
+
source: t,
|
|
316
|
+
id: n(t),
|
|
317
|
+
order: this.order++
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
claim(e, t, n) {
|
|
321
|
+
let r = this.claimed.get(e);
|
|
322
|
+
return r && r !== t ? (this.gaps.push({
|
|
323
|
+
nodeId: t,
|
|
324
|
+
code: "source-shared",
|
|
325
|
+
detail: `${this.sourcePath(n)} is already the conversation of ${r}`
|
|
326
|
+
}), !1) : (this.claimed.set(e, t), !0);
|
|
327
|
+
}
|
|
328
|
+
nodeFor(e) {
|
|
329
|
+
if (typeof e == "string") {
|
|
330
|
+
let t = e;
|
|
331
|
+
for (; t;) {
|
|
332
|
+
if (this.nodes.has(t)) return t;
|
|
333
|
+
let e = t.lastIndexOf(":s");
|
|
334
|
+
if (e <= 0) break;
|
|
335
|
+
t = t.slice(0, e);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
return this.rootId;
|
|
339
|
+
}
|
|
340
|
+
addSandbox(e, t) {
|
|
341
|
+
e && typeof t == "string" && /^sandbox-/.test(t) && !e.sandboxes.includes(t) && e.sandboxes.push(t);
|
|
342
|
+
}
|
|
343
|
+
blob(e) {
|
|
344
|
+
let t = E(e);
|
|
345
|
+
if (!t) return null;
|
|
346
|
+
let n = `blobs/sha256-${t}.json`, r = v(this.runDir, n);
|
|
347
|
+
if (!s(r)) return null;
|
|
348
|
+
try {
|
|
349
|
+
return {
|
|
350
|
+
rel: n,
|
|
351
|
+
value: JSON.parse(this.file(n).text)
|
|
352
|
+
};
|
|
353
|
+
} catch {
|
|
354
|
+
return null;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
readRunInput() {
|
|
358
|
+
let e = "run-input.json", t = v(this.runDir, e);
|
|
359
|
+
if (!s(t)) {
|
|
360
|
+
let n = /^(.*)\.v\d+$/.exec(this.runId), r = n ? v(_(this.runDir), n[1], "run-input.json") : null;
|
|
361
|
+
if (!r || !s(r)) return;
|
|
362
|
+
e = `../${n[1]}/run-input.json`, t = r;
|
|
363
|
+
}
|
|
364
|
+
try {
|
|
365
|
+
let n = this.file(e, t);
|
|
366
|
+
this.runInput = JSON.parse(n.text), this.runInputRel = e, this.fileSource(e, t);
|
|
367
|
+
} catch {
|
|
368
|
+
this.gaps.push({
|
|
369
|
+
nodeId: null,
|
|
370
|
+
code: "input-unreadable",
|
|
371
|
+
detail: `${e} is not valid JSON`
|
|
372
|
+
});
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
let n = this.runInput?.placement?.childFiles;
|
|
376
|
+
Array.isArray(n) && n.forEach((t, n) => {
|
|
377
|
+
typeof t?.content == "string" && this.pointerSource(e, K("placement", "childFiles", n, "content"), t.content, L(t.path) || void 0);
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
readJournal() {
|
|
381
|
+
let e = "spawn-journal.jsonl", t = v(this.runDir, e);
|
|
382
|
+
if (!s(t)) return [];
|
|
383
|
+
let n = this.file(e);
|
|
384
|
+
this.fileSource(e);
|
|
385
|
+
let r = H(n.bytes), i = /* @__PURE__ */ new Map();
|
|
386
|
+
for (let e of r) {
|
|
387
|
+
let t = e.value?.event;
|
|
388
|
+
if (t?.kind !== "spawned" || typeof t.id != "string" || this.nodes.has(t.id)) continue;
|
|
389
|
+
let n = t.id, r = n.lastIndexOf(":s"), a = typeof t.parent == "string" ? t.parent : r > 0 ? n.slice(0, r) : null;
|
|
390
|
+
!a && this.nodes.size === 0 && (this.rootId = n);
|
|
391
|
+
let o = L(t.label) || (a ? "worker" : "root"), s = n.startsWith(this.rootId + ":") ? n.slice(this.rootId.length + 1) : n === this.rootId ? "" : n;
|
|
392
|
+
this.nodes.set(n, {
|
|
393
|
+
id: n,
|
|
394
|
+
label: s ? `${s}${t.key ? ` · ${t.key}` : ""}` : o,
|
|
395
|
+
parent: a,
|
|
396
|
+
kind: "agent",
|
|
397
|
+
role: o,
|
|
398
|
+
model: null,
|
|
399
|
+
servedModel: null,
|
|
400
|
+
harness: null,
|
|
401
|
+
start: P(t.at) ?? void 0,
|
|
402
|
+
sandboxes: [],
|
|
403
|
+
capture: {
|
|
404
|
+
channel: "journal",
|
|
405
|
+
status: "absent",
|
|
406
|
+
reason: null
|
|
407
|
+
},
|
|
408
|
+
taskDigest: t.identity?.taskDigest,
|
|
409
|
+
profileRef: t.profileRef,
|
|
410
|
+
outRefs: [],
|
|
411
|
+
transcriptRefs: [],
|
|
412
|
+
key: typeof t.key == "string" ? t.key : void 0
|
|
413
|
+
}), typeof t.runtime == "string" && i.set(n, t.runtime);
|
|
414
|
+
}
|
|
415
|
+
if (!this.nodes.size) return r;
|
|
416
|
+
for (let e of this.nodes.values()) e.parent && !this.nodes.has(e.parent) && (e.parent = null);
|
|
417
|
+
this.format = [...i.values()].includes("tangle-sandbox") ? "cloud" : "runtime";
|
|
418
|
+
let a = null, o = 0;
|
|
419
|
+
for (let t of r) {
|
|
420
|
+
let r = t.value?.event ?? t.value;
|
|
421
|
+
if (!r || typeof r != "object") continue;
|
|
422
|
+
let i = typeof r.id == "string" ? r.id : L(t.value?.root).split("/").at(-1), s = this.nodes.get(this.nodeFor(i)), c = typeof r.id == "string" ? this.nodes.get(r.id) : void 0, l = L(r.kind) || "unknown";
|
|
423
|
+
if (l === "materialized" && c) {
|
|
424
|
+
let e = r.receipt?.model;
|
|
425
|
+
e?.status === "known" && typeof e.id == "string" && !c.model && (c.model = e.id, c.modelSource = "materialization receipt"), r.receipt?.execution?.kind === "environment" && this.addSandbox(c, r.receipt.execution.id), r.receipt?.execution?.kind === "session" && typeof r.receipt.execution.id == "string" && this.executionOf.set(r.receipt.execution.id, {
|
|
426
|
+
node: c.id,
|
|
427
|
+
line: t.line
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
if (c) {
|
|
431
|
+
this.addSandbox(c, r.environmentId), this.addSandbox(c, r.request?.source?.environmentId);
|
|
432
|
+
for (let e of Array.isArray(r.kept) ? r.kept : []) this.addSandbox(c, e?.environmentId);
|
|
433
|
+
}
|
|
434
|
+
(l === "settled" || l === "reconciled") && c && ((l === "settled" || !c.status) && (c.status = L(r.status) || c.status, c.end = P(r.at) ?? c.end), l === "reconciled" && !c.end && (c.end = P(r.at) ?? void 0)), c && typeof r.outRef == "string" && !c.outRefs.includes(r.outRef) && c.outRefs.push(r.outRef);
|
|
435
|
+
let u = r.harnessTranscript;
|
|
436
|
+
c && u && (u.status === "available" && typeof u.transcriptRef == "string" ? (c.transcriptRefs.includes(u.transcriptRef) || c.transcriptRefs.push(u.transcriptRef), typeof u.harness == "string" && (c.harness ??= u.harness)) : typeof u.reason == "string" && (c.transcriptReason = u.reason));
|
|
437
|
+
let d = P(r.at ?? t.value?.at);
|
|
438
|
+
d && (a = d);
|
|
439
|
+
let f = d ?? a;
|
|
440
|
+
if (!f || !s) {
|
|
441
|
+
o++;
|
|
442
|
+
continue;
|
|
443
|
+
}
|
|
444
|
+
let { kind: p, id: m, seq: h, at: g, ..._ } = r, v = [l.replaceAll("-", " "), r.status ?? r.signal ?? r.record?.classification ?? r.admission?.phase].filter(Boolean).join(" · "), y = L(r.reason ?? r.cause ?? r.record?.error ?? r.outcome?.error ?? r.detail), b = y ? this.clip(y, () => this.lineSource(e, t.line, t.raw)) : null, x = r.spent ?? r.spend, S = l === "metered" && typeof x?.tokens?.input == "number" ? {
|
|
445
|
+
usage: {
|
|
446
|
+
input: x.tokens.input,
|
|
447
|
+
...typeof x.tokens.output == "number" ? { output: x.tokens.output } : {}
|
|
448
|
+
},
|
|
449
|
+
usageScope: "metered"
|
|
450
|
+
} : void 0;
|
|
451
|
+
this.emit({
|
|
452
|
+
node: s.id,
|
|
453
|
+
at: f,
|
|
454
|
+
kind: l,
|
|
455
|
+
category: "lifecycle",
|
|
456
|
+
label: v,
|
|
457
|
+
source: {
|
|
458
|
+
path: e,
|
|
459
|
+
sha256: n.sha256,
|
|
460
|
+
line: t.line
|
|
461
|
+
},
|
|
462
|
+
detail: {
|
|
463
|
+
lifecycle: l,
|
|
464
|
+
...i && i !== s.id ? { subject: i } : {},
|
|
465
|
+
...d ? {} : { atBasis: "carried" },
|
|
466
|
+
...b ? {
|
|
467
|
+
publicText: b.text,
|
|
468
|
+
...b.clip ? { clip: b.clip } : {}
|
|
469
|
+
} : {},
|
|
470
|
+
...l === "settled" || l === "execution-result" ? { isError: r.status === "down" || r.outcome?.success === !1 } : {},
|
|
471
|
+
...x && (l === "settled" || l === "metered" || l === "reconciled") ? { spent: this.compactValue(x) } : {},
|
|
472
|
+
...S ?? {},
|
|
473
|
+
data: this.compactValue(_)
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
return o && this.gaps.push({
|
|
478
|
+
nodeId: null,
|
|
479
|
+
code: "journal-untimed-lines",
|
|
480
|
+
detail: `${o} spawn-journal lines carry no time and precede every timed line`
|
|
481
|
+
}), r;
|
|
482
|
+
}
|
|
483
|
+
resultJson() {
|
|
484
|
+
let e = v(this.runDir, "result.json");
|
|
485
|
+
if (!s(e)) return null;
|
|
486
|
+
try {
|
|
487
|
+
let e = JSON.parse(this.file("result.json").text);
|
|
488
|
+
return this.fileSource("result.json"), e;
|
|
489
|
+
} catch {
|
|
490
|
+
return null;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
nativeFiles(e) {
|
|
494
|
+
let t = /* @__PURE__ */ new Map(), n = 0, r = !1, i = (e, r, i, a, o) => {
|
|
495
|
+
let s;
|
|
496
|
+
try {
|
|
497
|
+
s = m(i).size;
|
|
498
|
+
} catch {
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
let c = t.get(e);
|
|
502
|
+
(!c || s > c.bytes) && t.set(e, {
|
|
503
|
+
rel: r,
|
|
504
|
+
abs: i,
|
|
505
|
+
hex: a,
|
|
506
|
+
sessionId: o,
|
|
507
|
+
bytes: s,
|
|
508
|
+
order: c?.order ?? n++
|
|
509
|
+
});
|
|
510
|
+
}, a = (e) => this.nativeCacheDir(e);
|
|
511
|
+
for (let t of e.transcriptRefs) {
|
|
512
|
+
let n = this.blob(t);
|
|
513
|
+
if (n?.value?.kind !== "retained-harness-transcript") continue;
|
|
514
|
+
let o = n.value;
|
|
515
|
+
this.fileSource(n.rel);
|
|
516
|
+
let c = E(o.snapshot?.archive?.sha256 ?? o.snapshot?.archive?.locator?.digest), l = typeof o.source?.nativeSessionId == "string" ? o.source.nativeSessionId : null;
|
|
517
|
+
e.nativeSessionId ??= l ?? void 0, typeof o.harness == "string" && (e.harness ??= o.harness), this.addSandbox(e, o.source?.environmentId);
|
|
518
|
+
let u = (Array.isArray(o.files) ? o.files : []).filter((e) => typeof e?.path == "string" && D.test(e.path)).filter((e) => !l || e.path.endsWith(`/${l}.jsonl`));
|
|
519
|
+
if (!c || !u.length) continue;
|
|
520
|
+
let d = a(c);
|
|
521
|
+
if (!d) {
|
|
522
|
+
r = !0;
|
|
523
|
+
continue;
|
|
524
|
+
}
|
|
525
|
+
for (let t of u) {
|
|
526
|
+
let n = t.path.split("/"), r = [t.path, [
|
|
527
|
+
"workspace/__retention__/sessions",
|
|
528
|
+
n[0],
|
|
529
|
+
"native",
|
|
530
|
+
...n.slice(1)
|
|
531
|
+
].join("/")].find((e) => s(v(d, e)));
|
|
532
|
+
if (!r) {
|
|
533
|
+
this.gaps.push({
|
|
534
|
+
nodeId: e.id,
|
|
535
|
+
code: "no-transcript:native-file-missing",
|
|
536
|
+
detail: `${t.path} is not in archive ${c}`
|
|
537
|
+
});
|
|
538
|
+
continue;
|
|
539
|
+
}
|
|
540
|
+
let a = v(d, r), o = `native:${c}/${r}`, u = this.file(o, a), f = E(t.sha256);
|
|
541
|
+
if (f && f !== u.sha256) {
|
|
542
|
+
this.gaps.push({
|
|
543
|
+
nodeId: e.id,
|
|
544
|
+
code: "no-transcript:native-sha256-mismatch",
|
|
545
|
+
detail: `${o} does not match its manifest`
|
|
546
|
+
});
|
|
547
|
+
continue;
|
|
548
|
+
}
|
|
549
|
+
i(O(t.path), o, a, c, l);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
let o = this.nativeIndex().get(e.id);
|
|
553
|
+
if (o) {
|
|
554
|
+
let t = E(o.snapshot?.archive);
|
|
555
|
+
this.addSandbox(e, o.environmentId), typeof o.harness == "string" && (e.harness ??= o.harness);
|
|
556
|
+
let n = t ? a(t) : void 0;
|
|
557
|
+
t && !n && (r = !0);
|
|
558
|
+
for (let e of n && Array.isArray(o.native?.sessions) ? o.native.sessions : []) {
|
|
559
|
+
let r = typeof e?.path == "string" ? O(e.path) : null;
|
|
560
|
+
if (!r || typeof e.sandboxSessionId != "string" || typeof e.rootScope != "string") continue;
|
|
561
|
+
let a = [
|
|
562
|
+
"workspace/__retention__/sessions",
|
|
563
|
+
e.sandboxSessionId,
|
|
564
|
+
"native",
|
|
565
|
+
...typeof e.sourceId == "string" ? [e.sourceId] : [],
|
|
566
|
+
e.rootScope,
|
|
567
|
+
e.path
|
|
568
|
+
].join("/");
|
|
569
|
+
i(r, `native:${t}/${a}`, v(n, a), t, null);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
if (t.size) {
|
|
573
|
+
let e = [...t.values()].sort((e, t) => e.order - t.order);
|
|
574
|
+
for (let t of e) this.fileSource(t.rel, t.abs);
|
|
575
|
+
return e;
|
|
576
|
+
}
|
|
577
|
+
return r ? "not-cached" : null;
|
|
578
|
+
}
|
|
579
|
+
nativeCacheDir(e) {
|
|
580
|
+
return this.nativeRoot ? [
|
|
581
|
+
e,
|
|
582
|
+
`sha256-${e}`,
|
|
583
|
+
`sha256:${e}`
|
|
584
|
+
].map((e) => v(this.nativeRoot, e)).find((e) => s(e)) : void 0;
|
|
585
|
+
}
|
|
586
|
+
nativeStore(e) {
|
|
587
|
+
let t = this.nativeIndex().get(e.id), n = E(t?.snapshot?.archive), r = n ? this.nativeCacheDir(n) : void 0, i = (Array.isArray(t?.native?.sessions) ? t.native.sessions : []).filter((e) => typeof e?.path == "string" && k.test(e.path) && typeof e.sandboxSessionId == "string" && typeof e.rootScope == "string");
|
|
588
|
+
if (!r || !i.length) return null;
|
|
589
|
+
let a = (e) => [
|
|
590
|
+
"workspace/__retention__/sessions",
|
|
591
|
+
e.sandboxSessionId,
|
|
592
|
+
"native",
|
|
593
|
+
...typeof e.sourceId == "string" ? [e.sourceId] : [],
|
|
594
|
+
e.rootScope,
|
|
595
|
+
e.path
|
|
596
|
+
].join("/"), o = a(i[0]), c = v(r, o);
|
|
597
|
+
if (!s(c)) return this.gaps.push({
|
|
598
|
+
nodeId: e.id,
|
|
599
|
+
code: "no-transcript:native-file-missing",
|
|
600
|
+
detail: `${o} is not in archive ${n}`
|
|
601
|
+
}), null;
|
|
602
|
+
let l = i.filter((e) => a(e) === o && !e.parentNativeSessionId && typeof e.nativeSessionId == "string").map((e) => e.nativeSessionId);
|
|
603
|
+
return {
|
|
604
|
+
rel: `native:${n}/${o}`,
|
|
605
|
+
abs: c,
|
|
606
|
+
sessionIds: l
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
nativeIndex() {
|
|
610
|
+
if (this.nativeIndexCache) return this.nativeIndexCache;
|
|
611
|
+
let e = /* @__PURE__ */ new Map(), t = v(this.runDir, A);
|
|
612
|
+
if (s(t)) {
|
|
613
|
+
this.listSource(A);
|
|
614
|
+
for (let n of H(this.options.files?.read(t).bytes ?? u(t))) {
|
|
615
|
+
let t = n.value;
|
|
616
|
+
if (t?.schema !== "disco.native-capture.v1" || typeof t.nodeId != "string") continue;
|
|
617
|
+
let r = e.get(t.nodeId);
|
|
618
|
+
(!r || String(t.at) >= String(r.at)) && e.set(t.nodeId, t);
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
return this.nativeIndexCache = e;
|
|
622
|
+
}
|
|
623
|
+
readNative(e, t) {
|
|
624
|
+
let n = !1;
|
|
625
|
+
for (let r of t) {
|
|
626
|
+
let t = this.readClaudeSession(e, r.rel, r.abs);
|
|
627
|
+
t !== null && (n ||= t.unparsable > 0);
|
|
628
|
+
}
|
|
629
|
+
e.capture = {
|
|
630
|
+
channel: "native",
|
|
631
|
+
status: n ? "lossy" : "complete",
|
|
632
|
+
reason: n ? "unparsable-lines" : null
|
|
633
|
+
}, e.harness === null && (e.harness = "claude-code");
|
|
634
|
+
}
|
|
635
|
+
readClaudeSession(e, t, n, r) {
|
|
636
|
+
let i = this.file(t, n);
|
|
637
|
+
if (!this.claim(i.sha256, e.id, t)) return null;
|
|
638
|
+
this.fileSource(t, n);
|
|
639
|
+
let a = {
|
|
640
|
+
events: 0,
|
|
641
|
+
unparsable: 0,
|
|
642
|
+
untimed: 0
|
|
643
|
+
}, o = /* @__PURE__ */ new Set(), s, c = e.start ?? null;
|
|
644
|
+
for (let n of H(i.bytes, U(r))) {
|
|
645
|
+
let r = n.value;
|
|
646
|
+
if (!r) {
|
|
647
|
+
a.unparsable++;
|
|
648
|
+
continue;
|
|
649
|
+
}
|
|
650
|
+
let l = P(r.timestamp) ?? c;
|
|
651
|
+
if (!l) {
|
|
652
|
+
a.untimed++;
|
|
653
|
+
continue;
|
|
654
|
+
}
|
|
655
|
+
c = l;
|
|
656
|
+
let u = {
|
|
657
|
+
path: t,
|
|
658
|
+
sha256: i.sha256,
|
|
659
|
+
line: n.line
|
|
660
|
+
}, d = () => this.lineSource(t, n.line, n.raw), f = typeof r.uuid == "string" ? { nativeRecordId: r.uuid } : {}, p = r.isSidechain ? { sidechain: !0 } : {}, m = r.message, h = this.events.length;
|
|
661
|
+
if (r.type === "assistant" && m) {
|
|
662
|
+
let t = Array.isArray(m.content) ? m.content : [{
|
|
663
|
+
type: "text",
|
|
664
|
+
text: L(m.content)
|
|
665
|
+
}], n = t.filter((e) => e?.type === "text").map((e) => L(e.text)).join("\n\n"), i = t.filter((e) => e?.type === "thinking").map((e) => L(e.thinking)).filter(Boolean).join("\n\n"), a = t.filter((e) => e?.type === "thinking" && !L(e.thinking)).length, c = t.filter((e) => e?.type === "redacted_thinking").length, h = t.filter((e) => e?.type === "tool_use" || e?.type === "server_tool_use"), g = m.usage, _ = typeof m.id != "string" || !o.has(m.id);
|
|
666
|
+
typeof m.id == "string" && o.add(m.id), typeof m.model == "string" && m.model !== "<synthetic>" && (e.servedModel = m.model, e.modelSource = "native response");
|
|
667
|
+
let v = n ? this.clip(n, d) : null, y = i ? this.clip(i, d) : null;
|
|
668
|
+
this.emit({
|
|
669
|
+
node: e.id,
|
|
670
|
+
at: l,
|
|
671
|
+
kind: "message",
|
|
672
|
+
category: h.length ? V(L(h[0].name), h[0].input) : "reasoning",
|
|
673
|
+
label: h.length ? `assistant · ${h.map((e) => L(e.name)).join(", ")}` : "assistant",
|
|
674
|
+
source: u,
|
|
675
|
+
detail: {
|
|
676
|
+
role: "assistant",
|
|
677
|
+
...f,
|
|
678
|
+
...v ? { publicText: v.text } : {},
|
|
679
|
+
...y ? { reasoning: y.text } : {},
|
|
680
|
+
...a ? { reasoningOmitted: a } : {},
|
|
681
|
+
...c ? { reasoningRedacted: c } : {},
|
|
682
|
+
...v?.clip ?? y?.clip ? { clip: v?.clip ?? y?.clip } : {},
|
|
683
|
+
...h.length ? { publicToolCalls: h.map((e) => {
|
|
684
|
+
let t = this.clip(JSON.stringify(e.input ?? {}), d);
|
|
685
|
+
return {
|
|
686
|
+
id: L(e.id),
|
|
687
|
+
name: L(e.name),
|
|
688
|
+
input: t.text,
|
|
689
|
+
...t.clip ? { clip: t.clip } : {}
|
|
690
|
+
};
|
|
691
|
+
}) } : {},
|
|
692
|
+
...g && _ ? { usage: {
|
|
693
|
+
input: R(g.input_tokens),
|
|
694
|
+
output: R(g.output_tokens),
|
|
695
|
+
cacheRead: R(g.cache_read_input_tokens),
|
|
696
|
+
cacheWrite: R(g.cache_creation_input_tokens)
|
|
697
|
+
} } : {},
|
|
698
|
+
...typeof m.model == "string" ? { responseReportedModel: m.model } : {},
|
|
699
|
+
...r.isApiErrorMessage ? { responseStatus: "error" } : {},
|
|
700
|
+
...p
|
|
701
|
+
}
|
|
702
|
+
}), s = this.events.at(-1);
|
|
703
|
+
} else if (r.type === "user" && m && typeof m.content == "string") {
|
|
704
|
+
let t = this.clip(m.content, d);
|
|
705
|
+
this.emit({
|
|
706
|
+
node: e.id,
|
|
707
|
+
at: l,
|
|
708
|
+
kind: "message",
|
|
709
|
+
category: "other",
|
|
710
|
+
label: "user",
|
|
711
|
+
source: u,
|
|
712
|
+
detail: {
|
|
713
|
+
role: "user",
|
|
714
|
+
...f,
|
|
715
|
+
publicText: t.text,
|
|
716
|
+
...t.clip ? { clip: t.clip } : {},
|
|
717
|
+
...p
|
|
718
|
+
}
|
|
719
|
+
});
|
|
720
|
+
} else if (r.type === "user" && m) {
|
|
721
|
+
let t = Array.isArray(m.content) ? m.content : [], n = [];
|
|
722
|
+
t.forEach((e, t) => {
|
|
723
|
+
e?.type === "tool_result" && n.push({
|
|
724
|
+
index: t,
|
|
725
|
+
block: e
|
|
726
|
+
});
|
|
727
|
+
});
|
|
728
|
+
let r = t.findIndex((e) => e?.type === "text" || e?.type === "image"), i = t.filter((e) => e?.type === "text" || e?.type === "image").map((e) => e.type === "image" ? "[image]" : L(e.text)).join("\n\n");
|
|
729
|
+
i && n.push({
|
|
730
|
+
index: r,
|
|
731
|
+
text: i
|
|
732
|
+
}), n.sort((e, t) => e.index - t.index);
|
|
733
|
+
let a = n.length > 1;
|
|
734
|
+
for (let t of n) {
|
|
735
|
+
let n = a ? {
|
|
736
|
+
...u,
|
|
737
|
+
item: t.index
|
|
738
|
+
} : u;
|
|
739
|
+
if (t.block) {
|
|
740
|
+
let r = t.block, i = typeof r.content == "string" ? r.content : Array.isArray(r.content) ? r.content.map((e) => e?.type === "text" ? L(e.text) : e?.type === "image" ? "[image]" : JSON.stringify(e)).join("\n") : L(r.content), a = this.clip(i, d);
|
|
741
|
+
this.emit({
|
|
742
|
+
node: e.id,
|
|
743
|
+
at: l,
|
|
744
|
+
kind: "tool-result",
|
|
745
|
+
category: "other",
|
|
746
|
+
label: "tool result",
|
|
747
|
+
source: n,
|
|
748
|
+
detail: {
|
|
749
|
+
role: "toolResult",
|
|
750
|
+
...f,
|
|
751
|
+
toolCallId: L(r.tool_use_id),
|
|
752
|
+
isError: r.is_error === !0,
|
|
753
|
+
publicText: a.text,
|
|
754
|
+
...a.clip ? { clip: a.clip } : {},
|
|
755
|
+
...p
|
|
756
|
+
}
|
|
757
|
+
});
|
|
758
|
+
} else {
|
|
759
|
+
let r = this.clip(t.text, d);
|
|
760
|
+
this.emit({
|
|
761
|
+
node: e.id,
|
|
762
|
+
at: l,
|
|
763
|
+
kind: "message",
|
|
764
|
+
category: "other",
|
|
765
|
+
label: "user",
|
|
766
|
+
source: n,
|
|
767
|
+
detail: {
|
|
768
|
+
role: "user",
|
|
769
|
+
...f,
|
|
770
|
+
publicText: r.text,
|
|
771
|
+
...r.clip ? { clip: r.clip } : {},
|
|
772
|
+
...p
|
|
773
|
+
}
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
r.type === "cost-state" && s && R(r.totalCostUSD) !== void 0 && (s.detail.costListUsd = r.totalCostUSD, s.detail.usdKnown = !1, s.detail.costScope = "session-total"), this.events.length === h && this.emitRecord(e, l, u, r, f), a.events += this.events.length - h;
|
|
779
|
+
}
|
|
780
|
+
return a.untimed && this.gaps.push({
|
|
781
|
+
nodeId: e.id,
|
|
782
|
+
code: "untimed-lines",
|
|
783
|
+
detail: `${a.untimed} lines of ${this.sourcePath(t)} carry no time`
|
|
784
|
+
}), a.unparsable && this.gaps.push({
|
|
785
|
+
nodeId: e.id,
|
|
786
|
+
code: "unparsable-lines",
|
|
787
|
+
detail: `${a.unparsable} lines of ${this.sourcePath(t)} are not JSON`
|
|
788
|
+
}), a;
|
|
789
|
+
}
|
|
790
|
+
emitRecord(e, t, n, r, i = {}) {
|
|
791
|
+
let a = L(r?.type) || "unknown", o = L(r?.subtype ?? r?.customType ?? r?.payload?.type), { type: s, timestamp: c, message: l, ...u } = r ?? {};
|
|
792
|
+
this.emit({
|
|
793
|
+
node: e.id,
|
|
794
|
+
at: t,
|
|
795
|
+
kind: "record",
|
|
796
|
+
category: a === "system" || a === "session" || a.endsWith("_change") ? "lifecycle" : "other",
|
|
797
|
+
label: [a.replaceAll("_", " "), o.replaceAll("_", " ")].filter(Boolean).join(" · "),
|
|
798
|
+
source: n,
|
|
799
|
+
detail: {
|
|
800
|
+
recordType: a,
|
|
801
|
+
...o ? { recordSubtype: o } : {},
|
|
802
|
+
...i,
|
|
803
|
+
data: this.compactValue(r?.message ? {
|
|
804
|
+
...u,
|
|
805
|
+
message: r.message
|
|
806
|
+
} : u)
|
|
807
|
+
}
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
readLiveStream(e) {
|
|
811
|
+
let t = `${j}/${encodeURIComponent(e.id)}`, n = G(v(this.runDir, t)).filter((e) => e.endsWith(".jsonl")), r = 0;
|
|
812
|
+
for (let i of n) {
|
|
813
|
+
let n = `${t}/${i}`, a = this.file(n);
|
|
814
|
+
if (!this.claim(a.sha256, e.id, n)) continue;
|
|
815
|
+
this.fileSource(n);
|
|
816
|
+
let o = H(a.bytes).filter((e) => e.value && typeof e.value == "object");
|
|
817
|
+
r += this.readPartEvents(e, n, a, o.map((e) => e.value), {
|
|
818
|
+
where: (e) => ({ line: o[e].line }),
|
|
819
|
+
full: (e) => this.lineSource(n, o[e].line, o[e].raw)
|
|
820
|
+
});
|
|
821
|
+
}
|
|
822
|
+
return r ? (e.capture = {
|
|
823
|
+
channel: "live",
|
|
824
|
+
status: "lossy",
|
|
825
|
+
reason: "live-stream-until-settled"
|
|
826
|
+
}, !0) : !1;
|
|
827
|
+
}
|
|
828
|
+
readOpenCode(e, t = "native-trajectory.json") {
|
|
829
|
+
let n, r;
|
|
830
|
+
try {
|
|
831
|
+
r = this.file(t), n = JSON.parse(r.text);
|
|
832
|
+
} catch {
|
|
833
|
+
return !1;
|
|
834
|
+
}
|
|
835
|
+
return !Array.isArray(n?.messages) || !Array.isArray(n?.parts) || !this.claim(r.sha256, e.id, t) ? !1 : (this.fileSource(t), this.projectOpenCode(e, n, t, r.sha256, (e, t) => K("parts", t, "data")), !0);
|
|
836
|
+
}
|
|
837
|
+
readOpenCodeStore(e, t) {
|
|
838
|
+
let n = this.file(t.rel, t.abs);
|
|
839
|
+
if (!t.sessionIds.length || !this.claim(n.sha256, e.id, t.rel)) return !1;
|
|
840
|
+
let r = process.getBuiltinModule?.("node:sqlite");
|
|
841
|
+
if (!r) return this.gaps.push({
|
|
842
|
+
nodeId: e.id,
|
|
843
|
+
code: "no-transcript:opencode-store-unreadable",
|
|
844
|
+
detail: "this Node has no node:sqlite"
|
|
845
|
+
}), !1;
|
|
846
|
+
let i = c(v(h(), "agent-record-opencode-")), a;
|
|
847
|
+
try {
|
|
848
|
+
for (let e of [
|
|
849
|
+
"",
|
|
850
|
+
"-wal",
|
|
851
|
+
"-shm"
|
|
852
|
+
]) s(t.abs + e) && o(t.abs + e, v(i, `opencode.db${e}`));
|
|
853
|
+
let e = new r.DatabaseSync(v(i, "opencode.db"), { readOnly: !0 });
|
|
854
|
+
try {
|
|
855
|
+
let n = JSON.stringify(t.sessionIds), r = "session_id IN (SELECT value FROM json_each(?))";
|
|
856
|
+
a = {
|
|
857
|
+
session: e.prepare("SELECT * FROM session WHERE id IN (SELECT value FROM json_each(?)) ORDER BY time_created, id").all(n),
|
|
858
|
+
messages: e.prepare(`SELECT id, session_id, time_created, data FROM message WHERE ${r} ORDER BY time_created, id`).all(n),
|
|
859
|
+
parts: e.prepare(`SELECT id, message_id, session_id, time_created, data FROM part WHERE ${r} ORDER BY time_created, id`).all(n)
|
|
860
|
+
};
|
|
861
|
+
} finally {
|
|
862
|
+
e.close();
|
|
863
|
+
}
|
|
864
|
+
} catch (n) {
|
|
865
|
+
return this.gaps.push({
|
|
866
|
+
nodeId: e.id,
|
|
867
|
+
code: "no-transcript:opencode-store-unreadable",
|
|
868
|
+
detail: `${this.sourcePath(t.rel)}: ${String(n?.message ?? n).slice(0, 200)}`
|
|
869
|
+
}), !1;
|
|
870
|
+
} finally {
|
|
871
|
+
p(i, {
|
|
872
|
+
recursive: !0,
|
|
873
|
+
force: !0
|
|
874
|
+
});
|
|
875
|
+
}
|
|
876
|
+
return this.fileSource(t.rel, t.abs), this.projectOpenCode(e, a, t.rel, n.sha256, (e) => K("part", L(e.id), "data")), !0;
|
|
877
|
+
}
|
|
878
|
+
projectOpenCode(e, t, n, r, i) {
|
|
879
|
+
let a = Array.isArray(t.session) ? t.session[0] : t.session;
|
|
880
|
+
if (a?.model) try {
|
|
881
|
+
let t = typeof a.model == "string" ? JSON.parse(a.model) : a.model;
|
|
882
|
+
typeof t?.id == "string" && (e.model ??= [t.providerID, t.id].filter(Boolean).join("/"));
|
|
883
|
+
} catch {}
|
|
884
|
+
typeof a?.id == "string" && (e.nativeSessionId ??= a.id), e.harness ??= "opencode";
|
|
885
|
+
let o = /* @__PURE__ */ new Map();
|
|
886
|
+
t.messages.forEach((e) => {
|
|
887
|
+
try {
|
|
888
|
+
o.set(e.id, typeof e.data == "string" ? JSON.parse(e.data) : e.data);
|
|
889
|
+
} catch {
|
|
890
|
+
o.set(e.id, {});
|
|
891
|
+
}
|
|
892
|
+
});
|
|
893
|
+
let s = t.parts.map((e, t) => ({
|
|
894
|
+
part: e,
|
|
895
|
+
index: t
|
|
896
|
+
})).sort((e, t) => (e.part.time_created ?? 0) - (t.part.time_created ?? 0) || e.index - t.index), c = /* @__PURE__ */ new Map(), l = 0, u = 0;
|
|
897
|
+
for (let { part: t, index: a } of s) {
|
|
898
|
+
let s;
|
|
899
|
+
try {
|
|
900
|
+
s = typeof t.data == "string" ? JSON.parse(t.data) : t.data;
|
|
901
|
+
} catch {
|
|
902
|
+
l++;
|
|
903
|
+
continue;
|
|
904
|
+
}
|
|
905
|
+
let d = o.get(t.message_id) ?? {}, f = d.role === "user" ? "user" : "assistant", p = i(t, a), m = {
|
|
906
|
+
path: n,
|
|
907
|
+
sha256: r,
|
|
908
|
+
pointer: p
|
|
909
|
+
}, h = () => this.pointerSource(n, p, t.data), g = P(s?.time?.start ?? t.time_created) ?? e.start;
|
|
910
|
+
if (!g) {
|
|
911
|
+
u++;
|
|
912
|
+
continue;
|
|
913
|
+
}
|
|
914
|
+
let _ = typeof t.id == "string" ? { nativeRecordId: t.id } : {};
|
|
915
|
+
if (f === "assistant" && typeof d.modelID == "string" && (e.servedModel = [d.providerID, d.modelID].filter(Boolean).join("/")), (s?.type === "text" || s?.type === "reasoning") && (L(s.text) || s.type === "text")) {
|
|
916
|
+
let n = this.clip(L(s.text), h);
|
|
917
|
+
this.emit({
|
|
918
|
+
node: e.id,
|
|
919
|
+
at: g,
|
|
920
|
+
kind: "message",
|
|
921
|
+
category: f === "user" ? "other" : "reasoning",
|
|
922
|
+
label: f,
|
|
923
|
+
source: m,
|
|
924
|
+
detail: {
|
|
925
|
+
role: f,
|
|
926
|
+
..._,
|
|
927
|
+
...s.type === "text" ? { publicText: n.text } : { reasoning: n.text },
|
|
928
|
+
...n.clip ? { clip: n.clip } : {},
|
|
929
|
+
...s.synthetic ? { synthetic: !0 } : {}
|
|
930
|
+
}
|
|
931
|
+
}), c.set(t.message_id, this.events.at(-1));
|
|
932
|
+
} else if (s?.type === "tool") {
|
|
933
|
+
let n = s.state ?? {}, r = this.clip(JSON.stringify(n.input ?? {}), h), i = P(n.time?.start) ?? g, a = P(n.time?.end), o = V(L(s.tool), n.input), l = n.status === "completed" || n.status === "error";
|
|
934
|
+
if (this.emit({
|
|
935
|
+
node: e.id,
|
|
936
|
+
at: i,
|
|
937
|
+
kind: "message",
|
|
938
|
+
category: o,
|
|
939
|
+
label: `assistant · ${L(s.tool)}`,
|
|
940
|
+
source: l ? {
|
|
941
|
+
...m,
|
|
942
|
+
item: 0
|
|
943
|
+
} : m,
|
|
944
|
+
detail: {
|
|
945
|
+
role: "assistant",
|
|
946
|
+
..._,
|
|
947
|
+
publicToolCalls: [{
|
|
948
|
+
id: L(s.callID || t.id),
|
|
949
|
+
name: L(s.tool),
|
|
950
|
+
input: r.text,
|
|
951
|
+
...r.clip ? { clip: r.clip } : {}
|
|
952
|
+
}]
|
|
953
|
+
}
|
|
954
|
+
}), c.set(t.message_id, this.events.at(-1)), l) {
|
|
955
|
+
let r = n.status === "error" ? L(n.error) : L(n.output), c = this.clip(r, h);
|
|
956
|
+
this.emit({
|
|
957
|
+
node: e.id,
|
|
958
|
+
at: a ?? i,
|
|
959
|
+
kind: "tool-result",
|
|
960
|
+
category: o,
|
|
961
|
+
label: `tool result · ${L(s.tool)}`,
|
|
962
|
+
source: {
|
|
963
|
+
...m,
|
|
964
|
+
item: 1
|
|
965
|
+
},
|
|
966
|
+
detail: {
|
|
967
|
+
role: "toolResult",
|
|
968
|
+
..._,
|
|
969
|
+
toolCallId: L(s.callID || t.id),
|
|
970
|
+
isError: n.status === "error",
|
|
971
|
+
publicText: c.text,
|
|
972
|
+
...c.clip ? { clip: c.clip } : {},
|
|
973
|
+
...a && n.time?.start ? { durationMs: Math.max(0, Number(n.time.end) - Number(n.time.start)) } : {}
|
|
974
|
+
}
|
|
975
|
+
});
|
|
976
|
+
}
|
|
977
|
+
} else {
|
|
978
|
+
if (s?.type === "step-finish") {
|
|
979
|
+
let e = c.get(t.message_id), n = s.tokens;
|
|
980
|
+
e && n && (e.detail.usage = {
|
|
981
|
+
input: R(n.input),
|
|
982
|
+
output: R(n.output),
|
|
983
|
+
cacheRead: R(n.cache?.read),
|
|
984
|
+
cacheWrite: R(n.cache?.write),
|
|
985
|
+
...R(n.reasoning) === void 0 ? {} : { reasoning: n.reasoning }
|
|
986
|
+
}, R(s.cost) !== void 0 && s.cost > 0 && (e.detail.costListUsd = s.cost, e.detail.usdKnown = !1));
|
|
987
|
+
}
|
|
988
|
+
this.emitRecord(e, g, m, {
|
|
989
|
+
...s,
|
|
990
|
+
type: L(s?.type) || "part"
|
|
991
|
+
}, _);
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
return u && this.gaps.push({
|
|
995
|
+
nodeId: e.id,
|
|
996
|
+
code: "untimed-lines",
|
|
997
|
+
detail: `${u} parts of ${this.sourcePath(n)} carry no time`
|
|
998
|
+
}), e.capture = {
|
|
999
|
+
channel: "oc",
|
|
1000
|
+
status: l ? "lossy" : "complete",
|
|
1001
|
+
reason: l ? "unparsable-parts" : null
|
|
1002
|
+
}, !0;
|
|
1003
|
+
}
|
|
1004
|
+
piSessions() {
|
|
1005
|
+
let e = v(this.runDir, "trace/pi-sessions");
|
|
1006
|
+
return s(e) ? G(e).filter((e) => e.endsWith(".jsonl")).map((e) => {
|
|
1007
|
+
let t = `trace/pi-sessions/${e}`, n = this.file(t), r = H(n.bytes), i = r.find((e) => e.value?.type === "session")?.value, a = r.find((e) => e.value?.type === "message" && e.value.message?.role === "user")?.value?.message, o = a ? typeof a.content == "string" ? a.content : Array.isArray(a.content) ? a.content.filter((e) => e?.type === "text").map((e) => L(e.text)).join("") : null : null;
|
|
1008
|
+
return {
|
|
1009
|
+
rel: t,
|
|
1010
|
+
sessionId: L(i?.id) || g(e, ".jsonl"),
|
|
1011
|
+
digest: o === null ? null : `sha256:${T(JSON.stringify(o))}`,
|
|
1012
|
+
rows: r,
|
|
1013
|
+
sha256: n.sha256
|
|
1014
|
+
};
|
|
1015
|
+
}) : [];
|
|
1016
|
+
}
|
|
1017
|
+
readPi(e, t) {
|
|
1018
|
+
e.harness ??= "pi";
|
|
1019
|
+
let n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
1020
|
+
for (let i of t) {
|
|
1021
|
+
if (!this.claim(i.sha256, e.id, i.rel)) continue;
|
|
1022
|
+
this.fileSource(i.rel), e.nativeSessionId ??= i.sessionId;
|
|
1023
|
+
let t = 0, a = null;
|
|
1024
|
+
for (let o of i.rows) {
|
|
1025
|
+
let s = o.value;
|
|
1026
|
+
if (!s) continue;
|
|
1027
|
+
let c = P(s.timestamp) ?? a;
|
|
1028
|
+
if (!c) {
|
|
1029
|
+
t++;
|
|
1030
|
+
continue;
|
|
1031
|
+
}
|
|
1032
|
+
a = c;
|
|
1033
|
+
let l = {
|
|
1034
|
+
path: i.rel,
|
|
1035
|
+
sha256: i.sha256,
|
|
1036
|
+
line: o.line
|
|
1037
|
+
}, u = typeof s.id == "string" ? { nativeRecordId: s.id } : {};
|
|
1038
|
+
if (s.type === "model_change" && typeof s.modelId == "string" && (e.model ??= s.modelId), s.type !== "message") {
|
|
1039
|
+
this.emitRecord(e, c, l, s, u);
|
|
1040
|
+
continue;
|
|
1041
|
+
}
|
|
1042
|
+
let d = s.message ?? {}, f = () => this.lineSource(i.rel, o.line, o.raw), p = Array.isArray(d.content) ? d.content : [{
|
|
1043
|
+
type: "text",
|
|
1044
|
+
text: L(d.content)
|
|
1045
|
+
}], m = p.filter((e) => e?.type === "text").map((e) => L(e.text)).join("\n\n"), h = {
|
|
1046
|
+
...typeof s.parentId == "string" ? { nativeParentId: s.parentId } : {},
|
|
1047
|
+
...I(Array.isArray(d.content) ? d.content : [{
|
|
1048
|
+
type: "text",
|
|
1049
|
+
text: d.content
|
|
1050
|
+
}])
|
|
1051
|
+
};
|
|
1052
|
+
if (d.role === "toolResult") {
|
|
1053
|
+
let t = this.clip(m, f);
|
|
1054
|
+
typeof d.toolCallId == "string" && r.add(d.toolCallId), this.emit({
|
|
1055
|
+
node: e.id,
|
|
1056
|
+
at: c,
|
|
1057
|
+
kind: "tool-result",
|
|
1058
|
+
category: "other",
|
|
1059
|
+
label: `tool result · ${L(d.toolName)}`,
|
|
1060
|
+
source: l,
|
|
1061
|
+
detail: {
|
|
1062
|
+
role: "toolResult",
|
|
1063
|
+
...u,
|
|
1064
|
+
...h,
|
|
1065
|
+
toolCallId: L(d.toolCallId),
|
|
1066
|
+
isError: d.isError === !0,
|
|
1067
|
+
publicText: t.text,
|
|
1068
|
+
...t.clip ? { clip: t.clip } : {}
|
|
1069
|
+
}
|
|
1070
|
+
});
|
|
1071
|
+
continue;
|
|
1072
|
+
}
|
|
1073
|
+
let g = p.filter((e) => e?.type === "thinking").map((e) => L(e.thinking)).filter(Boolean).join("\n\n"), _ = p.filter((e) => e?.type === "toolCall" || e?.type === "tool_use");
|
|
1074
|
+
for (let e of _) typeof e.id == "string" && n.add(e.id);
|
|
1075
|
+
typeof d.model == "string" && d.stopReason !== "error" && (e.servedModel = d.model);
|
|
1076
|
+
let v = d.role === "assistant" ? {
|
|
1077
|
+
...typeof d.model == "string" ? { responseReportedModel: d.model } : {},
|
|
1078
|
+
...typeof d.stopReason == "string" ? { responseStatus: d.stopReason } : {},
|
|
1079
|
+
...typeof d.responseId == "string" ? { responseId: d.responseId } : {}
|
|
1080
|
+
} : {}, y = m ? this.clip(m, f) : null, b = g ? this.clip(g, f) : null, x = d.usage;
|
|
1081
|
+
this.emit({
|
|
1082
|
+
node: e.id,
|
|
1083
|
+
at: c,
|
|
1084
|
+
kind: "message",
|
|
1085
|
+
category: _.length ? V(L(_[0].name), _[0].arguments ?? _[0].input) : d.role === "user" ? "other" : "reasoning",
|
|
1086
|
+
label: d.stopReason === "error" ? "failed assistant request" : _.length ? `${L(d.role)} · ${_.map((e) => L(e.name)).join(", ")}` : L(d.role),
|
|
1087
|
+
source: l,
|
|
1088
|
+
detail: {
|
|
1089
|
+
role: L(d.role),
|
|
1090
|
+
...u,
|
|
1091
|
+
...h,
|
|
1092
|
+
...v,
|
|
1093
|
+
...y ? { publicText: y.text } : {},
|
|
1094
|
+
...b ? { reasoning: b.text } : {},
|
|
1095
|
+
...y?.clip ?? b?.clip ? { clip: y?.clip ?? b?.clip } : {},
|
|
1096
|
+
..._.length ? { publicToolCalls: _.map((e) => {
|
|
1097
|
+
let t = this.clip(JSON.stringify(e.arguments ?? e.input ?? {}), f);
|
|
1098
|
+
return {
|
|
1099
|
+
id: L(e.id),
|
|
1100
|
+
name: L(e.name),
|
|
1101
|
+
input: t.text,
|
|
1102
|
+
...t.clip ? { clip: t.clip } : {}
|
|
1103
|
+
};
|
|
1104
|
+
}) } : {},
|
|
1105
|
+
...x && d.stopReason !== "error" ? { usage: {
|
|
1106
|
+
input: R(x.input),
|
|
1107
|
+
output: R(x.output),
|
|
1108
|
+
cacheRead: R(x.cacheRead),
|
|
1109
|
+
cacheWrite: R(x.cacheWrite)
|
|
1110
|
+
} } : {},
|
|
1111
|
+
...R(x?.cost?.total) !== void 0 && x.cost.total > 0 ? {
|
|
1112
|
+
costListUsd: x.cost.total,
|
|
1113
|
+
usdKnown: !1
|
|
1114
|
+
} : {}
|
|
1115
|
+
}
|
|
1116
|
+
});
|
|
1117
|
+
}
|
|
1118
|
+
t && this.gaps.push({
|
|
1119
|
+
nodeId: e.id,
|
|
1120
|
+
code: "untimed-lines",
|
|
1121
|
+
detail: `${t} lines of ${this.sourcePath(i.rel)} carry no time`
|
|
1122
|
+
});
|
|
1123
|
+
}
|
|
1124
|
+
let i = [...n].filter((e) => !r.has(e)).length;
|
|
1125
|
+
i && this.gaps.push({
|
|
1126
|
+
nodeId: e.id,
|
|
1127
|
+
code: "tool-results-not-retained",
|
|
1128
|
+
detail: `${i} tool calls have no result in the session`
|
|
1129
|
+
}), e.capture = {
|
|
1130
|
+
channel: "pi",
|
|
1131
|
+
status: i ? "lossy" : "complete",
|
|
1132
|
+
reason: i ? "tool-results-not-retained" : null
|
|
1133
|
+
};
|
|
1134
|
+
}
|
|
1135
|
+
bridgeStreams() {
|
|
1136
|
+
let e = v(this.runDir, "trace/bridge-sessions");
|
|
1137
|
+
return s(e) ? G(e).filter((e) => e.endsWith(".jsonl")).map((e) => {
|
|
1138
|
+
let t = `trace/bridge-sessions/${e}`, n = this.file(t), r = H(n.bytes), i = r.find((e) => e.value?.table === "sessions");
|
|
1139
|
+
return {
|
|
1140
|
+
rel: t,
|
|
1141
|
+
rows: r,
|
|
1142
|
+
sha256: n.sha256,
|
|
1143
|
+
sessionId: L(i?.value?.row?.external_id) || null,
|
|
1144
|
+
sessionLine: i?.line ?? null
|
|
1145
|
+
};
|
|
1146
|
+
}) : [];
|
|
1147
|
+
}
|
|
1148
|
+
readBridgeStream(e, t) {
|
|
1149
|
+
if (!this.claim(t.sha256, e.id, t.rel)) return !1;
|
|
1150
|
+
this.fileSource(t.rel);
|
|
1151
|
+
let n = 0;
|
|
1152
|
+
for (let r of t.rows) {
|
|
1153
|
+
let i = r.value;
|
|
1154
|
+
if (!i || typeof i.table != "string") continue;
|
|
1155
|
+
let a = i.row ?? {}, o = P(a.occurred_at) ?? P(a.received_at) ?? P(Number(a.created_at)) ?? P(Number(a.updated_at));
|
|
1156
|
+
if (!o) {
|
|
1157
|
+
n++;
|
|
1158
|
+
continue;
|
|
1159
|
+
}
|
|
1160
|
+
let s = {
|
|
1161
|
+
path: t.rel,
|
|
1162
|
+
sha256: t.sha256,
|
|
1163
|
+
line: r.line
|
|
1164
|
+
}, c = () => this.lineSource(t.rel, r.line, r.raw);
|
|
1165
|
+
if (i.table !== "retained_events") {
|
|
1166
|
+
this.emitRecord(e, o, s, {
|
|
1167
|
+
type: `bridge ${i.table.replaceAll("_", " ")}`,
|
|
1168
|
+
...a
|
|
1169
|
+
});
|
|
1170
|
+
continue;
|
|
1171
|
+
}
|
|
1172
|
+
let l;
|
|
1173
|
+
try {
|
|
1174
|
+
l = JSON.parse(L(a.event_json));
|
|
1175
|
+
} catch {
|
|
1176
|
+
l = null;
|
|
1177
|
+
}
|
|
1178
|
+
let u = l?.event ?? {}, d = typeof a.event_id == "string" ? { nativeRecordId: a.event_id } : {};
|
|
1179
|
+
if (typeof u.content == "string" && u.content) {
|
|
1180
|
+
let t = this.clip(u.content, c);
|
|
1181
|
+
this.emit({
|
|
1182
|
+
node: e.id,
|
|
1183
|
+
at: o,
|
|
1184
|
+
kind: "message",
|
|
1185
|
+
category: "reasoning",
|
|
1186
|
+
label: "assistant",
|
|
1187
|
+
source: s,
|
|
1188
|
+
detail: {
|
|
1189
|
+
role: "assistant",
|
|
1190
|
+
...d,
|
|
1191
|
+
publicText: t.text,
|
|
1192
|
+
...t.clip ? { clip: t.clip } : {}
|
|
1193
|
+
}
|
|
1194
|
+
});
|
|
1195
|
+
} else if (Array.isArray(u.tool_calls) && u.tool_calls.length) {
|
|
1196
|
+
let t = u.tool_calls.length > 1;
|
|
1197
|
+
u.tool_calls.forEach((n, r) => {
|
|
1198
|
+
let i = this.clip(typeof n?.arguments == "string" ? n.arguments : JSON.stringify(n?.arguments ?? {}), c);
|
|
1199
|
+
this.emit({
|
|
1200
|
+
node: e.id,
|
|
1201
|
+
at: o,
|
|
1202
|
+
kind: "message",
|
|
1203
|
+
category: V(L(n?.name), n?.arguments),
|
|
1204
|
+
label: `assistant · ${L(n?.name)}`,
|
|
1205
|
+
source: t ? {
|
|
1206
|
+
...s,
|
|
1207
|
+
item: r
|
|
1208
|
+
} : s,
|
|
1209
|
+
detail: {
|
|
1210
|
+
role: "assistant",
|
|
1211
|
+
...d,
|
|
1212
|
+
publicToolCalls: [{
|
|
1213
|
+
id: L(n?.id),
|
|
1214
|
+
name: L(n?.name),
|
|
1215
|
+
input: i.text,
|
|
1216
|
+
...i.clip ? { clip: i.clip } : {}
|
|
1217
|
+
}]
|
|
1218
|
+
}
|
|
1219
|
+
});
|
|
1220
|
+
});
|
|
1221
|
+
} else {
|
|
1222
|
+
let t = Object.keys(u)[0] ?? L(l?.type) ?? "event";
|
|
1223
|
+
this.emitRecord(e, o, s, {
|
|
1224
|
+
type: `bridge ${t.replaceAll("_", " ")}`,
|
|
1225
|
+
...u
|
|
1226
|
+
}, {
|
|
1227
|
+
...d,
|
|
1228
|
+
...u.error ? { isError: !0 } : {}
|
|
1229
|
+
});
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
return n && this.gaps.push({
|
|
1233
|
+
nodeId: e.id,
|
|
1234
|
+
code: "untimed-lines",
|
|
1235
|
+
detail: `${n} rows of ${this.sourcePath(t.rel)} carry no time`
|
|
1236
|
+
}), e.harness ??= "opencode", e.capture = {
|
|
1237
|
+
channel: "bridge",
|
|
1238
|
+
status: "lossy",
|
|
1239
|
+
reason: "bridge-stream-without-prompts-or-results"
|
|
1240
|
+
}, !0;
|
|
1241
|
+
}
|
|
1242
|
+
readCodex(e, t, n) {
|
|
1243
|
+
let r = this.file(t);
|
|
1244
|
+
if (!this.claim(r.sha256, e.id, t)) return null;
|
|
1245
|
+
this.fileSource(t), e.harness ??= "codex";
|
|
1246
|
+
let i = {
|
|
1247
|
+
unparsable: 0,
|
|
1248
|
+
untimed: 0
|
|
1249
|
+
};
|
|
1250
|
+
for (let a of H(r.bytes, U(n))) {
|
|
1251
|
+
let n = a.value;
|
|
1252
|
+
if (!n) {
|
|
1253
|
+
i.unparsable++;
|
|
1254
|
+
continue;
|
|
1255
|
+
}
|
|
1256
|
+
let o = P(n.timestamp);
|
|
1257
|
+
if (!o) {
|
|
1258
|
+
i.untimed++;
|
|
1259
|
+
continue;
|
|
1260
|
+
}
|
|
1261
|
+
let s = {
|
|
1262
|
+
path: t,
|
|
1263
|
+
sha256: r.sha256,
|
|
1264
|
+
line: a.line
|
|
1265
|
+
}, c = () => this.lineSource(t, a.line, a.raw), l = n.payload ?? {};
|
|
1266
|
+
if (n.type === "session_meta" && typeof l.id == "string" && (e.nativeSessionId ??= l.id), n.type === "turn_context" && typeof l.model == "string" && (e.model ??= l.model, e.servedModel = l.model, e.modelSource ??= "codex turn context"), n.type === "response_item" && l.type === "message") {
|
|
1267
|
+
let t = L(l.role) || "assistant", n = (Array.isArray(l.content) ? l.content : []).map((e) => e?.type === "input_image" ? "[image]" : L(e?.text)).filter(Boolean).join("\n\n"), r = this.clip(n, c);
|
|
1268
|
+
this.emit({
|
|
1269
|
+
node: e.id,
|
|
1270
|
+
at: o,
|
|
1271
|
+
kind: "message",
|
|
1272
|
+
category: t === "assistant" ? "reasoning" : "other",
|
|
1273
|
+
label: t,
|
|
1274
|
+
source: s,
|
|
1275
|
+
detail: {
|
|
1276
|
+
role: t,
|
|
1277
|
+
publicText: r.text,
|
|
1278
|
+
...r.clip ? { clip: r.clip } : {}
|
|
1279
|
+
}
|
|
1280
|
+
});
|
|
1281
|
+
continue;
|
|
1282
|
+
}
|
|
1283
|
+
if (n.type === "response_item" && l.type === "reasoning") {
|
|
1284
|
+
let t = (Array.isArray(l.summary) ? l.summary : []).map((e) => L(e?.text)).filter(Boolean).join("\n\n"), n = t ? this.clip(t, c) : null;
|
|
1285
|
+
this.emit({
|
|
1286
|
+
node: e.id,
|
|
1287
|
+
at: o,
|
|
1288
|
+
kind: "message",
|
|
1289
|
+
category: "reasoning",
|
|
1290
|
+
label: "reasoning",
|
|
1291
|
+
source: s,
|
|
1292
|
+
detail: {
|
|
1293
|
+
role: "assistant",
|
|
1294
|
+
...n ? {
|
|
1295
|
+
reasoning: n.text,
|
|
1296
|
+
...n.clip ? { clip: n.clip } : {}
|
|
1297
|
+
} : { contentOmitted: "encrypted reasoning" }
|
|
1298
|
+
}
|
|
1299
|
+
});
|
|
1300
|
+
continue;
|
|
1301
|
+
}
|
|
1302
|
+
let u = n.type === "response_item" && (l.type === "function_call" || l.type === "custom_tool_call" || l.type === "local_shell_call" || l.type === "web_search_call") ? {
|
|
1303
|
+
id: L(l.call_id ?? l.id),
|
|
1304
|
+
name: l.type === "local_shell_call" ? "shell" : l.type === "web_search_call" ? "web_search" : L(l.name),
|
|
1305
|
+
input: l.type === "function_call" ? L(l.arguments) : l.type === "custom_tool_call" ? L(l.input) : JSON.stringify(l.action ?? {})
|
|
1306
|
+
} : null;
|
|
1307
|
+
if (u) {
|
|
1308
|
+
let t = this.clip(u.input, c);
|
|
1309
|
+
this.emit({
|
|
1310
|
+
node: e.id,
|
|
1311
|
+
at: o,
|
|
1312
|
+
kind: "message",
|
|
1313
|
+
category: V(u.name, u.input),
|
|
1314
|
+
label: `assistant · ${u.name}`,
|
|
1315
|
+
source: s,
|
|
1316
|
+
detail: {
|
|
1317
|
+
role: "assistant",
|
|
1318
|
+
publicToolCalls: [{
|
|
1319
|
+
id: u.id,
|
|
1320
|
+
name: u.name,
|
|
1321
|
+
input: t.text,
|
|
1322
|
+
...t.clip ? { clip: t.clip } : {}
|
|
1323
|
+
}]
|
|
1324
|
+
}
|
|
1325
|
+
});
|
|
1326
|
+
continue;
|
|
1327
|
+
}
|
|
1328
|
+
if (n.type === "response_item" && (l.type === "function_call_output" || l.type === "custom_tool_call_output")) {
|
|
1329
|
+
let t = l.output, n = typeof t == "string" ? t : typeof t?.content == "string" ? t.content : JSON.stringify(t ?? null), r = this.clip(n, c);
|
|
1330
|
+
this.emit({
|
|
1331
|
+
node: e.id,
|
|
1332
|
+
at: o,
|
|
1333
|
+
kind: "tool-result",
|
|
1334
|
+
category: "other",
|
|
1335
|
+
label: "tool result",
|
|
1336
|
+
source: s,
|
|
1337
|
+
detail: {
|
|
1338
|
+
role: "toolResult",
|
|
1339
|
+
toolCallId: L(l.call_id),
|
|
1340
|
+
isError: t?.success === !1,
|
|
1341
|
+
publicText: r.text,
|
|
1342
|
+
...r.clip ? { clip: r.clip } : {}
|
|
1343
|
+
}
|
|
1344
|
+
});
|
|
1345
|
+
continue;
|
|
1346
|
+
}
|
|
1347
|
+
if (n.type === "event_msg" && l.type === "token_count" && l.info?.last_token_usage) {
|
|
1348
|
+
let t = l.info.last_token_usage, n = R(t.cached_input_tokens) ?? 0;
|
|
1349
|
+
this.emit({
|
|
1350
|
+
node: e.id,
|
|
1351
|
+
at: o,
|
|
1352
|
+
kind: "usage",
|
|
1353
|
+
category: "other",
|
|
1354
|
+
label: "token count",
|
|
1355
|
+
source: s,
|
|
1356
|
+
detail: {
|
|
1357
|
+
recordType: "event_msg",
|
|
1358
|
+
recordSubtype: "token_count",
|
|
1359
|
+
usage: {
|
|
1360
|
+
input: Math.max(0, (R(t.input_tokens) ?? 0) - n),
|
|
1361
|
+
output: R(t.output_tokens),
|
|
1362
|
+
cacheRead: n,
|
|
1363
|
+
...R(t.reasoning_output_tokens) === void 0 ? {} : { reasoning: t.reasoning_output_tokens }
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1366
|
+
});
|
|
1367
|
+
continue;
|
|
1368
|
+
}
|
|
1369
|
+
this.emitRecord(e, o, s, {
|
|
1370
|
+
...l,
|
|
1371
|
+
type: L(n.type) || "line",
|
|
1372
|
+
...l.type ? { subtype: l.type } : {}
|
|
1373
|
+
});
|
|
1374
|
+
}
|
|
1375
|
+
return i.untimed && this.gaps.push({
|
|
1376
|
+
nodeId: e.id,
|
|
1377
|
+
code: "untimed-lines",
|
|
1378
|
+
detail: `${i.untimed} lines of ${this.sourcePath(t)} carry no time`
|
|
1379
|
+
}), i.unparsable && this.gaps.push({
|
|
1380
|
+
nodeId: e.id,
|
|
1381
|
+
code: "unparsable-lines",
|
|
1382
|
+
detail: `${i.unparsable} lines of ${this.sourcePath(t)} are not JSON`
|
|
1383
|
+
}), e.capture = {
|
|
1384
|
+
channel: "codex",
|
|
1385
|
+
status: i.unparsable ? "lossy" : "complete",
|
|
1386
|
+
reason: i.unparsable ? "unparsable-lines" : null
|
|
1387
|
+
}, i;
|
|
1388
|
+
}
|
|
1389
|
+
readParts(e) {
|
|
1390
|
+
let t = e.outRefs.map((e) => this.blob(e)).filter((e) => Array.isArray(e?.value?.events));
|
|
1391
|
+
if (!t.length) return !1;
|
|
1392
|
+
let n = 0;
|
|
1393
|
+
for (let r of t) {
|
|
1394
|
+
let t = this.fileSource(r.rel);
|
|
1395
|
+
this.claim(t.sha256, e.id, r.rel) && (n += this.readPartEvents(e, r.rel, t, r.value.events, {
|
|
1396
|
+
where: (e) => ({ pointer: K("events", e) }),
|
|
1397
|
+
full: (e, t, n) => this.pointerSource(r.rel, K("events", e, ...t), n)
|
|
1398
|
+
}));
|
|
1399
|
+
}
|
|
1400
|
+
return n ? (e.capture = {
|
|
1401
|
+
channel: "part",
|
|
1402
|
+
status: "lossy",
|
|
1403
|
+
reason: "output-parts-final-state"
|
|
1404
|
+
}, !0) : !1;
|
|
1405
|
+
}
|
|
1406
|
+
readPartEvents(e, n, r, i, a) {
|
|
1407
|
+
return t(this, e, n, r, i, a, V);
|
|
1408
|
+
}
|
|
1409
|
+
readRootStream(e) {
|
|
1410
|
+
let t = "root-stream.jsonl", n = v(this.runDir, t);
|
|
1411
|
+
if (!s(n)) return !1;
|
|
1412
|
+
let r = this.file(t), i = H(r.bytes).filter((e) => e.value?.event);
|
|
1413
|
+
if (!i.length || !this.claim(r.sha256, e.id, t)) return !1;
|
|
1414
|
+
this.fileSource(t);
|
|
1415
|
+
let a = (e) => {
|
|
1416
|
+
let t = e.value.event;
|
|
1417
|
+
return `${t.kind}\0${t.toolCallId ?? ""}\0${T(JSON.stringify(t.text ?? t.args ?? t.result ?? ""))}`;
|
|
1418
|
+
}, o = /* @__PURE__ */ new Map();
|
|
1419
|
+
for (let e of i) {
|
|
1420
|
+
let t = Number(e.value.attempt ?? 1), n = o.get(t) ?? [];
|
|
1421
|
+
n.push(e), o.set(t, n);
|
|
1422
|
+
}
|
|
1423
|
+
let c = [], l = [], u = 0;
|
|
1424
|
+
for (let e of [...o.keys()].sort((e, t) => e - t)) {
|
|
1425
|
+
let t = o.get(e), n = 0;
|
|
1426
|
+
for (; n < t.length && n < l.length && a(t[n]) === a(l[n]);) n++;
|
|
1427
|
+
u += n, c.push(...t.slice(n)), l = t;
|
|
1428
|
+
}
|
|
1429
|
+
let d = null, f = 0, p = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set(), h = () => {
|
|
1430
|
+
if (!d) return;
|
|
1431
|
+
let n = d.rows[0], i = d.rows.map((e) => L(e.value.event.text)).join(""), a = P(n.value.at), o = d.rows.at(-1);
|
|
1432
|
+
if (a && i.trim()) {
|
|
1433
|
+
let s = this.clip(i, d.rows.length === 1 ? () => this.lineSource(t, n.line, n.raw) : null);
|
|
1434
|
+
this.emit({
|
|
1435
|
+
node: e.id,
|
|
1436
|
+
at: a,
|
|
1437
|
+
kind: "message",
|
|
1438
|
+
category: "reasoning",
|
|
1439
|
+
label: "assistant",
|
|
1440
|
+
source: {
|
|
1441
|
+
path: t,
|
|
1442
|
+
sha256: r.sha256,
|
|
1443
|
+
line: n.line
|
|
1444
|
+
},
|
|
1445
|
+
detail: {
|
|
1446
|
+
role: "assistant",
|
|
1447
|
+
...n.value.seq === void 0 ? {} : { nativeRecordId: String(n.value.seq) },
|
|
1448
|
+
...d.kind === "text_delta" ? { publicText: s.text } : { reasoning: s.text },
|
|
1449
|
+
...s.clip ? { clip: s.clip } : {},
|
|
1450
|
+
...d.rows.length > 1 ? { anchorRange: [n.line, o.line] } : {}
|
|
1451
|
+
}
|
|
1452
|
+
});
|
|
1453
|
+
}
|
|
1454
|
+
d = null;
|
|
1455
|
+
};
|
|
1456
|
+
for (let n of c) {
|
|
1457
|
+
let i = n.value.event, a = L(i.kind);
|
|
1458
|
+
if (a === "text_delta" || a === "reasoning_delta") {
|
|
1459
|
+
d && d.kind !== a && h(), d ??= {
|
|
1460
|
+
kind: a,
|
|
1461
|
+
rows: []
|
|
1462
|
+
}, d.rows.push(n);
|
|
1463
|
+
continue;
|
|
1464
|
+
}
|
|
1465
|
+
h();
|
|
1466
|
+
let o = P(n.value.at);
|
|
1467
|
+
if (!o) {
|
|
1468
|
+
f++;
|
|
1469
|
+
continue;
|
|
1470
|
+
}
|
|
1471
|
+
let s = {
|
|
1472
|
+
path: t,
|
|
1473
|
+
sha256: r.sha256,
|
|
1474
|
+
line: n.line
|
|
1475
|
+
}, c = n.value.seq === void 0 ? {} : { nativeRecordId: String(n.value.seq) }, l = () => this.lineSource(t, n.line, n.raw);
|
|
1476
|
+
if (a === "tool_call") {
|
|
1477
|
+
let t = i.args === void 0 || i.args === null ? null : this.clip(JSON.stringify(i.args), l);
|
|
1478
|
+
p.add(L(i.toolCallId)), this.emit({
|
|
1479
|
+
node: e.id,
|
|
1480
|
+
at: o,
|
|
1481
|
+
kind: "message",
|
|
1482
|
+
category: V(L(i.toolName), i.args),
|
|
1483
|
+
label: `assistant · ${L(i.toolName)}`,
|
|
1484
|
+
source: s,
|
|
1485
|
+
detail: {
|
|
1486
|
+
role: "assistant",
|
|
1487
|
+
...c,
|
|
1488
|
+
publicToolCalls: [{
|
|
1489
|
+
id: L(i.toolCallId),
|
|
1490
|
+
name: L(i.toolName),
|
|
1491
|
+
...t ? { input: t.text } : {},
|
|
1492
|
+
...t?.clip ? { clip: t.clip } : {}
|
|
1493
|
+
}]
|
|
1494
|
+
}
|
|
1495
|
+
});
|
|
1496
|
+
} else if (a === "tool_result") {
|
|
1497
|
+
let t = i.result, n = typeof t == "string" ? t : t && typeof t == "object" && typeof t.error == "string" && Object.keys(t).length === 1 ? t.error : JSON.stringify(t ?? null), r = this.clip(n, l);
|
|
1498
|
+
m.add(L(i.toolCallId)), this.emit({
|
|
1499
|
+
node: e.id,
|
|
1500
|
+
at: o,
|
|
1501
|
+
kind: "tool-result",
|
|
1502
|
+
category: V(L(i.toolName), null),
|
|
1503
|
+
label: `tool result · ${L(i.toolName)}`,
|
|
1504
|
+
source: s,
|
|
1505
|
+
detail: {
|
|
1506
|
+
role: "toolResult",
|
|
1507
|
+
...c,
|
|
1508
|
+
toolCallId: L(i.toolCallId),
|
|
1509
|
+
isError: !!(t && typeof t == "object" && ("error" in t || t.isError === !0)),
|
|
1510
|
+
publicText: r.text,
|
|
1511
|
+
...r.clip ? { clip: r.clip } : {}
|
|
1512
|
+
}
|
|
1513
|
+
});
|
|
1514
|
+
} else this.emitRecord(e, o, s, {
|
|
1515
|
+
...i,
|
|
1516
|
+
type: a || "event"
|
|
1517
|
+
}, c);
|
|
1518
|
+
}
|
|
1519
|
+
h(), f && this.gaps.push({
|
|
1520
|
+
nodeId: e.id,
|
|
1521
|
+
code: "untimed-lines",
|
|
1522
|
+
detail: `${f} rows of ${this.sourcePath(t)} carry no time`
|
|
1523
|
+
}), u && this.gaps.push({
|
|
1524
|
+
nodeId: e.id,
|
|
1525
|
+
code: "root-replay-dropped",
|
|
1526
|
+
detail: `${u} rows of a resumed attempt repeat its predecessor and are not events`
|
|
1527
|
+
});
|
|
1528
|
+
let g = [...p].filter((e) => !m.has(e)).length;
|
|
1529
|
+
return e.capture = {
|
|
1530
|
+
channel: "root",
|
|
1531
|
+
status: g || u ? "lossy" : "complete",
|
|
1532
|
+
reason: g ? "tool-results-not-streamed" : u ? "resumed-attempt-replay-dropped" : null
|
|
1533
|
+
}, !0;
|
|
1534
|
+
}
|
|
1535
|
+
readFindings(e, t = "kb/pages", n) {
|
|
1536
|
+
let r = n ?? G(v(this.runDir, t)).filter((e) => e.endsWith(".md")).map((e) => `${t}/${e}`), i = this.nodes.get(e);
|
|
1537
|
+
for (let t of r.sort()) {
|
|
1538
|
+
let n = this.file(t);
|
|
1539
|
+
this.fileSource(t);
|
|
1540
|
+
let r = /^---\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n|$)/.exec(n.text), a = (e) => (r ? RegExp(`^${e}:[ \\t]*(.*)$`, "m").exec(r[1])?.[1]?.trim() : void 0) || void 0, o = P(a("createdAt")) ?? P(a("updatedAt")), s = this.manifestFiles.get(this.sourcePath(t))?.mtime, c = o ? null : P(typeof s == "number" && s < 1e11 ? s * 1e3 : s), l = o ?? c;
|
|
1541
|
+
if (!l) {
|
|
1542
|
+
this.gaps.push({
|
|
1543
|
+
nodeId: e,
|
|
1544
|
+
code: "finding-untimed",
|
|
1545
|
+
detail: `${this.sourcePath(t)} has no createdAt and its snapshot records no mtime`
|
|
1546
|
+
});
|
|
1547
|
+
continue;
|
|
1548
|
+
}
|
|
1549
|
+
let u = r ? r.index + r[0].length : 0, d = n.text.slice(u), f = d.trim(), p = n.text.slice(0, u + (d.length - d.trimStart().length)).split("\n").length;
|
|
1550
|
+
i || (i = {
|
|
1551
|
+
id: e,
|
|
1552
|
+
label: "Recorded findings",
|
|
1553
|
+
parent: null,
|
|
1554
|
+
kind: "finding",
|
|
1555
|
+
role: "Findings",
|
|
1556
|
+
model: null,
|
|
1557
|
+
servedModel: null,
|
|
1558
|
+
harness: null,
|
|
1559
|
+
sandboxes: [],
|
|
1560
|
+
capture: {
|
|
1561
|
+
channel: "kb",
|
|
1562
|
+
status: "complete",
|
|
1563
|
+
reason: null
|
|
1564
|
+
},
|
|
1565
|
+
outRefs: [],
|
|
1566
|
+
transcriptRefs: []
|
|
1567
|
+
}, this.nodes.set(e, i));
|
|
1568
|
+
let m = this.clip(f, () => this.fileSource(t)), h = a("title")?.replace(/^(['"])(.*)\1$/, "$2");
|
|
1569
|
+
this.emit({
|
|
1570
|
+
node: e,
|
|
1571
|
+
at: l,
|
|
1572
|
+
kind: "finding-record",
|
|
1573
|
+
category: "verification",
|
|
1574
|
+
label: h ?? g(t, ".md"),
|
|
1575
|
+
source: {
|
|
1576
|
+
path: t,
|
|
1577
|
+
sha256: n.sha256
|
|
1578
|
+
},
|
|
1579
|
+
detail: {
|
|
1580
|
+
...h ? { title: h } : {},
|
|
1581
|
+
createdAt: l,
|
|
1582
|
+
...c ? { atBasis: "snapshot-mtime" } : {},
|
|
1583
|
+
...a("kind") ? { pageKind: a("kind") } : {},
|
|
1584
|
+
bodyLine: p,
|
|
1585
|
+
contentSha256: T(f),
|
|
1586
|
+
recordedClaim: m.text,
|
|
1587
|
+
...m.clip ? { clip: m.clip } : {}
|
|
1588
|
+
}
|
|
1589
|
+
});
|
|
1590
|
+
}
|
|
1591
|
+
return r.length;
|
|
1592
|
+
}
|
|
1593
|
+
convert() {
|
|
1594
|
+
let e = this.runDir, t;
|
|
1595
|
+
try {
|
|
1596
|
+
t = m(e);
|
|
1597
|
+
} catch {
|
|
1598
|
+
throw new S(`Run directory is unreadable: ${e}`);
|
|
1599
|
+
}
|
|
1600
|
+
if (!t.isDirectory()) throw new S(`Not a directory: ${e}`);
|
|
1601
|
+
this.readRunInput(), this.readJournal();
|
|
1602
|
+
let n = this.result = this.resultJson(), r = this.nodes.size > 0, i = G(v(e, "kb/pages")).filter((e) => e.endsWith(".md"));
|
|
1603
|
+
if (!r) {
|
|
1604
|
+
let t = [
|
|
1605
|
+
"result.json",
|
|
1606
|
+
"root-stream.jsonl",
|
|
1607
|
+
"native-trajectory.json",
|
|
1608
|
+
"run-input.json"
|
|
1609
|
+
].some((t) => s(v(e, t))) || G(v(e, "trace")).length > 0;
|
|
1610
|
+
this.format = s(v(e, "native-trajectory.json")) ? "bridge-native" : s(v(e, "failure.json")) ? "failure-only" : s(v(e, "ledger.jsonl")) ? "search" : !t && i.length ? "finding-only" : "other", this.format !== "finding-only" && (this.nodes.set(this.runId, {
|
|
1611
|
+
id: this.runId,
|
|
1612
|
+
label: "root",
|
|
1613
|
+
parent: null,
|
|
1614
|
+
kind: "agent",
|
|
1615
|
+
role: "root",
|
|
1616
|
+
model: null,
|
|
1617
|
+
servedModel: null,
|
|
1618
|
+
harness: null,
|
|
1619
|
+
sandboxes: [],
|
|
1620
|
+
capture: {
|
|
1621
|
+
channel: "journal",
|
|
1622
|
+
status: "absent",
|
|
1623
|
+
reason: "no-spawn-journal"
|
|
1624
|
+
},
|
|
1625
|
+
outRefs: [],
|
|
1626
|
+
transcriptRefs: []
|
|
1627
|
+
}), this.rootId = this.runId, (!t || this.format === "search") && this.gaps.push({
|
|
1628
|
+
nodeId: null,
|
|
1629
|
+
code: "unsupported-format",
|
|
1630
|
+
detail: `No spawn journal in ${this.format === "search" ? "a search ledger" : "this layout"}`
|
|
1631
|
+
}));
|
|
1632
|
+
}
|
|
1633
|
+
let a = this.nodes.get(this.rootId);
|
|
1634
|
+
a && s(v(e, "native-trajectory.json")) && this.format !== "cloud" && (this.format = "bridge-native"), a && G(v(e, "trace/pi-sessions")).some((e) => e.endsWith(".jsonl")) && (this.format = "pi-local");
|
|
1635
|
+
let o = this.runInput;
|
|
1636
|
+
if (a && o?.profile) {
|
|
1637
|
+
let e = o.profile.model;
|
|
1638
|
+
a.model = typeof e == "string" ? e : typeof e?.default == "string" ? e.default : typeof e?.id == "string" ? e.id : a.model, a.modelSource = "run input profile", typeof o.profile.harness == "string" && (a.harness = o.profile.harness);
|
|
1639
|
+
}
|
|
1640
|
+
let c = o?.task, l = typeof c == "string" ? c : typeof c?.instruction == "string" ? c.instruction : typeof c?.objective == "string" ? c.objective : null;
|
|
1641
|
+
a && l && (a.assignment = this.clip(l, null).text);
|
|
1642
|
+
for (let e of this.nodes.values()) {
|
|
1643
|
+
if (e.profileRef) {
|
|
1644
|
+
let t = this.blob(e.profileRef)?.value;
|
|
1645
|
+
if (t && typeof t == "object") {
|
|
1646
|
+
let n = t.model, r = typeof n == "string" ? n : typeof n?.default == "string" ? n.default : null;
|
|
1647
|
+
r && (e.model = r, e.modelSource = "spawn profile"), typeof t.harness == "string" && (e.harness = t.harness);
|
|
1648
|
+
}
|
|
1649
|
+
}
|
|
1650
|
+
if (e.taskDigest && !e.assignment) {
|
|
1651
|
+
let t = this.blob(e.taskDigest);
|
|
1652
|
+
t && typeof t.value == "string" && (e.assignment = this.clip(t.value, null).text);
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
a && n?.rootHarnessTranscript?.status === "available" && typeof n.rootHarnessTranscript.transcriptRef == "string" ? a.transcriptRefs.includes(n.rootHarnessTranscript.transcriptRef) || a.transcriptRefs.push(n.rootHarnessTranscript.transcriptRef) : a && typeof n?.rootHarnessTranscript?.reason == "string" && (a.transcriptReason ??= n.rootHarnessTranscript.reason);
|
|
1656
|
+
let u = this.piSessions(), d = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
|
|
1657
|
+
for (let e of this.nodes.values()) e.taskDigest && f.set(e.taskDigest, e.id);
|
|
1658
|
+
let p = /* @__PURE__ */ new Map();
|
|
1659
|
+
for (let [e, t] of this.executionOf) p.set(T(`cli-bridge/pi-session\0${e}`), {
|
|
1660
|
+
...t,
|
|
1661
|
+
sessionId: e
|
|
1662
|
+
});
|
|
1663
|
+
let h = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), _ = [];
|
|
1664
|
+
for (let e of u) {
|
|
1665
|
+
let t = /^trace\/pi-sessions\/cli-bridge\/([0-9a-f]{64})\//.exec(e.rel)?.[1], n = t ? p.get(t) : void 0, r = n?.node ?? (e.digest ? f.get(e.digest) : void 0);
|
|
1666
|
+
if (r) {
|
|
1667
|
+
let t = d.get(r) ?? [];
|
|
1668
|
+
t.push(e), d.set(r, t), n ? (h.set(r, "bridge-session-directory"), g.set(r, {
|
|
1669
|
+
journal: {
|
|
1670
|
+
path: this.sourcePath("spawn-journal.jsonl"),
|
|
1671
|
+
line: n.line
|
|
1672
|
+
},
|
|
1673
|
+
session: { path: this.sourcePath(e.rel) },
|
|
1674
|
+
sessionId: n.sessionId
|
|
1675
|
+
})) : h.has(r) || h.set(r, "task-digest");
|
|
1676
|
+
} else _.push(e);
|
|
1677
|
+
}
|
|
1678
|
+
let y = /* @__PURE__ */ new Map();
|
|
1679
|
+
for (let e of this.bridgeStreams()) {
|
|
1680
|
+
let t = e.sessionId ? this.executionOf.get(e.sessionId) : void 0;
|
|
1681
|
+
t && !y.has(t.node) ? y.set(t.node, e) : (this.fileSource(e.rel), this.gaps.push({
|
|
1682
|
+
nodeId: null,
|
|
1683
|
+
code: "bridge-stream-unjoined",
|
|
1684
|
+
detail: `${this.sourcePath(e.rel)} names no materialized session of this run`
|
|
1685
|
+
}));
|
|
1686
|
+
}
|
|
1687
|
+
for (let t of [...this.nodes.values()]) {
|
|
1688
|
+
if (!(t.status !== void 0 || t.id === this.rootId && n) && this.readLiveStream(t)) continue;
|
|
1689
|
+
let r = this.nativeFiles(t);
|
|
1690
|
+
if (Array.isArray(r)) {
|
|
1691
|
+
this.readNative(t, r);
|
|
1692
|
+
continue;
|
|
1693
|
+
}
|
|
1694
|
+
let i = this.nativeStore(t);
|
|
1695
|
+
if (i && this.readOpenCodeStore(t, i) || (r === "not-cached" && this.gaps.push({
|
|
1696
|
+
nodeId: t.id,
|
|
1697
|
+
code: "archived-not-ingested",
|
|
1698
|
+
detail: "A native transcript archive exists but is not in the native cache"
|
|
1699
|
+
}), t.id === this.rootId && s(v(e, "native-trajectory.json")) && this.readOpenCode(t))) continue;
|
|
1700
|
+
let a = d.get(t.id);
|
|
1701
|
+
if (a?.length) {
|
|
1702
|
+
t.joinBasis = h.get(t.id) ?? "task-digest", g.has(t.id) && (t.joinProof = g.get(t.id)), this.readPi(t, a);
|
|
1703
|
+
continue;
|
|
1704
|
+
}
|
|
1705
|
+
let o = y.get(t.id);
|
|
1706
|
+
if (o && this.readBridgeStream(t, o)) {
|
|
1707
|
+
t.joinBasis = "bridge-session-id", t.joinProof = {
|
|
1708
|
+
journal: {
|
|
1709
|
+
path: this.sourcePath("spawn-journal.jsonl"),
|
|
1710
|
+
line: this.executionOf.get(o.sessionId).line
|
|
1711
|
+
},
|
|
1712
|
+
stream: {
|
|
1713
|
+
path: this.sourcePath(o.rel),
|
|
1714
|
+
line: o.sessionLine
|
|
1715
|
+
},
|
|
1716
|
+
sessionId: o.sessionId
|
|
1717
|
+
};
|
|
1718
|
+
continue;
|
|
1719
|
+
}
|
|
1720
|
+
if (this.readParts(t) || t.id === this.rootId && this.readRootStream(t)) continue;
|
|
1721
|
+
let c = r === "not-cached" ? "native-archive-not-cached" : t.transcriptReason ?? (t.outRefs.length ? "no-conversation-in-output" : "no-conversation-channel");
|
|
1722
|
+
t.capture = {
|
|
1723
|
+
channel: "journal",
|
|
1724
|
+
status: "absent",
|
|
1725
|
+
reason: c
|
|
1726
|
+
}, this.gaps.push({
|
|
1727
|
+
nodeId: t.id,
|
|
1728
|
+
code: `no-transcript:${c}`,
|
|
1729
|
+
detail: "Only lifecycle events are recorded for this agent"
|
|
1730
|
+
});
|
|
1731
|
+
}
|
|
1732
|
+
this.readCoordination();
|
|
1733
|
+
for (let e of [
|
|
1734
|
+
"root-stream.jsonl",
|
|
1735
|
+
"native-trajectory.json",
|
|
1736
|
+
"observer.jsonl",
|
|
1737
|
+
"driver-attempts.jsonl",
|
|
1738
|
+
"spans.otlp.jsonl"
|
|
1739
|
+
]) this.listSource(e);
|
|
1740
|
+
for (let e of _) {
|
|
1741
|
+
let t = `pi:${e.sessionId}`;
|
|
1742
|
+
this.nodes.set(t, {
|
|
1743
|
+
id: t,
|
|
1744
|
+
label: `pi ${e.sessionId.slice(0, 8)}`,
|
|
1745
|
+
parent: null,
|
|
1746
|
+
kind: "session",
|
|
1747
|
+
role: "Session",
|
|
1748
|
+
model: null,
|
|
1749
|
+
servedModel: null,
|
|
1750
|
+
harness: "pi",
|
|
1751
|
+
sandboxes: [],
|
|
1752
|
+
capture: {
|
|
1753
|
+
channel: "pi",
|
|
1754
|
+
status: "complete",
|
|
1755
|
+
reason: null
|
|
1756
|
+
},
|
|
1757
|
+
outRefs: [],
|
|
1758
|
+
transcriptRefs: [],
|
|
1759
|
+
joinBasis: "unresolved"
|
|
1760
|
+
}), this.readPi(this.nodes.get(t), [e]), this.nodes.get(t).nativeSessionId = e.sessionId, this.gaps.push({
|
|
1761
|
+
nodeId: t,
|
|
1762
|
+
code: "pi-session-unjoined",
|
|
1763
|
+
detail: "No spawned task digest matches this session"
|
|
1764
|
+
});
|
|
1765
|
+
}
|
|
1766
|
+
i.length && this.readFindings(`finding:${this.runId}`);
|
|
1767
|
+
}
|
|
1768
|
+
readCoordination() {
|
|
1769
|
+
let e = "coordination-log.jsonl";
|
|
1770
|
+
if (!s(v(this.runDir, e))) return;
|
|
1771
|
+
let t = this.file(e);
|
|
1772
|
+
this.fileSource(e);
|
|
1773
|
+
let n = /* @__PURE__ */ new Set();
|
|
1774
|
+
for (let r of H(t.bytes)) {
|
|
1775
|
+
let i = r.value?.event?.type === "instruction" ? r.value.event.instruction : null, a = typeof i?.instruction == "string" ? i.instruction : "", o = typeof i?.toWorker == "string" ? i.toWorker : null, s = P(r.value?.at);
|
|
1776
|
+
if (!i || !s) continue;
|
|
1777
|
+
let c = o ? this.nodes.get(o)?.parent ?? (this.nodes.has(o) ? this.rootId : null) : null;
|
|
1778
|
+
if (!c || !this.nodes.has(c)) {
|
|
1779
|
+
this.gaps.push({
|
|
1780
|
+
nodeId: null,
|
|
1781
|
+
code: "coordination-target-unknown",
|
|
1782
|
+
detail: `${this.sourcePath(e)} line ${r.line} names no spawned worker (${o ?? "no toWorker"})`
|
|
1783
|
+
});
|
|
1784
|
+
continue;
|
|
1785
|
+
}
|
|
1786
|
+
let l = L(i.kind) || "instruction", u = a ? this.clip(a, () => this.lineSource(e, r.line, r.raw)) : {
|
|
1787
|
+
text: "",
|
|
1788
|
+
clip: void 0
|
|
1789
|
+
};
|
|
1790
|
+
if (this.emit({
|
|
1791
|
+
node: c,
|
|
1792
|
+
at: s,
|
|
1793
|
+
kind: "message",
|
|
1794
|
+
category: "coordination",
|
|
1795
|
+
label: `${l} → ${this.nodes.get(o).label}`,
|
|
1796
|
+
source: {
|
|
1797
|
+
path: e,
|
|
1798
|
+
sha256: t.sha256,
|
|
1799
|
+
line: r.line
|
|
1800
|
+
},
|
|
1801
|
+
detail: {
|
|
1802
|
+
role: "assistant",
|
|
1803
|
+
...u.text ? { publicText: u.text } : {},
|
|
1804
|
+
...u.clip ? { clip: u.clip } : {},
|
|
1805
|
+
coordination: {
|
|
1806
|
+
kind: l,
|
|
1807
|
+
toNode: o,
|
|
1808
|
+
receiptId: L(i.receiptId) || null,
|
|
1809
|
+
interrupt: i.interrupt === !0
|
|
1810
|
+
}
|
|
1811
|
+
}
|
|
1812
|
+
}), o && u.text && l !== "interrupt") {
|
|
1813
|
+
let n = this.events.find((e) => e.node === o && e.detail.role === "user" && e.detail.publicText === u.text && Math.abs(Date.parse(e.at) - Date.parse(s)) < 6e4);
|
|
1814
|
+
n ? (n.detail.promptKind = "steering", n.detail.promptSender = "Parent agent") : this.emit({
|
|
1815
|
+
node: o,
|
|
1816
|
+
at: s,
|
|
1817
|
+
kind: "message",
|
|
1818
|
+
category: "other",
|
|
1819
|
+
label: "Steering",
|
|
1820
|
+
source: {
|
|
1821
|
+
path: e,
|
|
1822
|
+
sha256: t.sha256,
|
|
1823
|
+
line: r.line,
|
|
1824
|
+
item: 1
|
|
1825
|
+
},
|
|
1826
|
+
detail: {
|
|
1827
|
+
role: "user",
|
|
1828
|
+
publicText: u.text,
|
|
1829
|
+
...u.clip ? { clip: u.clip } : {},
|
|
1830
|
+
promptKind: "steering",
|
|
1831
|
+
promptSender: "Parent agent",
|
|
1832
|
+
coordination: {
|
|
1833
|
+
kind: l,
|
|
1834
|
+
fromNode: c,
|
|
1835
|
+
receiptId: L(i.receiptId) || null
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1838
|
+
});
|
|
1839
|
+
}
|
|
1840
|
+
n.add(c);
|
|
1841
|
+
}
|
|
1842
|
+
for (let e of n) {
|
|
1843
|
+
let t = this.nodes.get(e);
|
|
1844
|
+
if (t.capture.status !== "absent") continue;
|
|
1845
|
+
t.capture = {
|
|
1846
|
+
channel: "coordination",
|
|
1847
|
+
status: "lossy",
|
|
1848
|
+
reason: "instructions-to-workers-only"
|
|
1849
|
+
};
|
|
1850
|
+
let n = this.gaps.findIndex((t) => t.nodeId === e && t.code.startsWith("no-transcript:")), r = {
|
|
1851
|
+
nodeId: e,
|
|
1852
|
+
code: "conversation-not-retained",
|
|
1853
|
+
detail: "Only the instructions this agent sent to its workers were retained (coordination log)"
|
|
1854
|
+
};
|
|
1855
|
+
n >= 0 ? this.gaps[n] = r : this.gaps.push(r);
|
|
1856
|
+
}
|
|
1857
|
+
}
|
|
1858
|
+
result = null;
|
|
1859
|
+
assemble(e = {}) {
|
|
1860
|
+
let t = this.nodes.get(this.rootId), n = this.result, i = this.runInput?.task, a = /* @__PURE__ */ new Map();
|
|
1861
|
+
for (let e of this.events) for (let t of e.detail.publicToolCalls ?? []) a.set(`${e.node}\0${t.id}`, e);
|
|
1862
|
+
for (let e of this.events) {
|
|
1863
|
+
let t = e.detail.toolCallId;
|
|
1864
|
+
if (typeof t != "string") continue;
|
|
1865
|
+
let n = a.get(`${e.node}\0${t}`);
|
|
1866
|
+
if (n && (e.category === "other" && (e.category = n.category), e.detail.durationMs === void 0)) {
|
|
1867
|
+
let t = Date.parse(e.at) - Date.parse(n.at);
|
|
1868
|
+
t >= 0 && e.detail.atBasis !== "carried" && (e.detail.durationMs = t);
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
let o = new Map([...this.nodes.keys()].map((e, t) => [e, t])), s = /* @__PURE__ */ new Map();
|
|
1872
|
+
for (let e of this.events) {
|
|
1873
|
+
let t = s.get(e.node);
|
|
1874
|
+
t ? (e.at < t[0] && (t[0] = e.at), e.at > t[1] && (t[1] = e.at)) : s.set(e.node, [e.at, e.at]);
|
|
1875
|
+
}
|
|
1876
|
+
for (let e of this.nodes.values()) {
|
|
1877
|
+
let t = s.get(e.id);
|
|
1878
|
+
!e.start && t && (e.start = t[0]), !e.end && t && e.kind === "session" && (e.end = t[1]);
|
|
1879
|
+
}
|
|
1880
|
+
t && n && !t.status && typeof n.kind == "string" && (t.status = n.kind, t.end ??= s.get(t.id)?.[1]), this.events.sort((e, t) => e.at < t.at ? -1 : e.at > t.at ? 1 : o.get(e.node) - o.get(t.node) || e.order - t.order);
|
|
1881
|
+
let c = /* @__PURE__ */ new Set();
|
|
1882
|
+
for (let e of this.events) {
|
|
1883
|
+
if (c.has(e.id)) throw new w(`duplicate anchor ${e.id} (${e.source.path}${e.source.line ? `:${e.source.line}` : e.source.pointer ?? ""})`);
|
|
1884
|
+
c.add(e.id);
|
|
1885
|
+
}
|
|
1886
|
+
let l = /* @__PURE__ */ new Map();
|
|
1887
|
+
for (let e of this.sources.values()) {
|
|
1888
|
+
if (!e.sha256 || e.line !== void 0 || e.pointer !== void 0) continue;
|
|
1889
|
+
let t = e.sha256.slice(0, 12), n = l.get(t);
|
|
1890
|
+
if (n && n !== e.sha256) throw new w(`object prefix ${t} names two objects`);
|
|
1891
|
+
l.set(t, e.sha256);
|
|
1892
|
+
}
|
|
1893
|
+
let u = [...this.nodes.values()].map((e) => ({
|
|
1894
|
+
nodeId: e.id,
|
|
1895
|
+
...e.capture
|
|
1896
|
+
})), d = {
|
|
1897
|
+
complete: 0,
|
|
1898
|
+
lossy: 0,
|
|
1899
|
+
absent: 0
|
|
1900
|
+
};
|
|
1901
|
+
for (let e of u) d[e.status]++;
|
|
1902
|
+
let f = u.filter((e) => this.nodes.get(e.nodeId)?.kind !== "finding"), p = new Set(this.events.filter((e) => e.kind === "message" && e.detail.role === "assistant" && e.detail.responseStatus !== "error").map((e) => e.node)), m = this.events.some((e) => R(e.detail.costListUsd) !== void 0), h = i?.knowledge, g = i?.completion;
|
|
1903
|
+
return {
|
|
1904
|
+
record: {
|
|
1905
|
+
schema: "agent-record.v1",
|
|
1906
|
+
runId: this.runId,
|
|
1907
|
+
title: e.title ?? this.runId,
|
|
1908
|
+
producer: {
|
|
1909
|
+
name: "@drewstone/agent-record/adapters/agent-runtime",
|
|
1910
|
+
version: y
|
|
1911
|
+
},
|
|
1912
|
+
idScheme: r,
|
|
1913
|
+
input: {
|
|
1914
|
+
...this.options.manifestSha256 ? { snapshot: `sha256:${this.options.manifestSha256}` } : {},
|
|
1915
|
+
runIdBasis: this.runIdBasis,
|
|
1916
|
+
...e.input
|
|
1917
|
+
},
|
|
1918
|
+
format: e.format ?? this.format,
|
|
1919
|
+
nodes: [...this.nodes.values()].map((e) => ({
|
|
1920
|
+
id: e.id,
|
|
1921
|
+
label: e.label,
|
|
1922
|
+
parent: e.parent,
|
|
1923
|
+
kind: e.kind,
|
|
1924
|
+
role: e.role,
|
|
1925
|
+
...e.assignment ? { assignment: e.assignment } : {},
|
|
1926
|
+
model: e.model,
|
|
1927
|
+
...e.modelSource ? { modelSource: e.modelSource } : {},
|
|
1928
|
+
servedModel: p.has(e.id) ? e.servedModel : null,
|
|
1929
|
+
harness: e.harness,
|
|
1930
|
+
...e.start ? { start: e.start } : {},
|
|
1931
|
+
...e.end ? { end: e.end } : {},
|
|
1932
|
+
...e.status ? { status: e.status } : {},
|
|
1933
|
+
...e.nativeSessionId ? { nativeSessionId: e.nativeSessionId } : {},
|
|
1934
|
+
...e.agentId ? { agentId: e.agentId } : {},
|
|
1935
|
+
...e.joinBasis ? { joinBasis: e.joinBasis } : {},
|
|
1936
|
+
...e.joinProof ? { joinProof: e.joinProof } : {},
|
|
1937
|
+
sandboxes: e.sandboxes,
|
|
1938
|
+
capture: e.capture
|
|
1939
|
+
})),
|
|
1940
|
+
events: this.events.map(({ order: e, ...t }) => t),
|
|
1941
|
+
sources: [...this.sources.values()].map(({ sha256: e, ...t }) => e ? {
|
|
1942
|
+
...t,
|
|
1943
|
+
sha256: e
|
|
1944
|
+
} : t).sort((e, t) => e.path < t.path ? -1 : e.path > t.path ? 1 : (e.line ?? 0) - (t.line ?? 0) || (e.pointer ?? "").localeCompare(t.pointer ?? "")),
|
|
1945
|
+
assignment: e.assignment ?? {
|
|
1946
|
+
objective: L(i?.objective),
|
|
1947
|
+
instruction: L(i?.instruction ?? (typeof i == "string" ? i : "")),
|
|
1948
|
+
knowledge: typeof h == "string" ? h : h ? JSON.stringify(h, null, 2) : "",
|
|
1949
|
+
completion: typeof g == "string" ? g : g ? JSON.stringify(g, null, 2) : "",
|
|
1950
|
+
suppliedKnowledge: typeof h == "string" ? h : h ? JSON.stringify(h, null, 2) : "",
|
|
1951
|
+
deliverables: typeof g == "string" ? g : g ? JSON.stringify(g, null, 2) : "",
|
|
1952
|
+
constraints: "",
|
|
1953
|
+
source: this.runInputRel ? {
|
|
1954
|
+
path: this.sourcePath(this.runInputRel),
|
|
1955
|
+
sha256: this.file(this.runInputRel, this.runInputRel.startsWith("../") ? v(_(this.runDir), this.runInputRel.slice(3)) : void 0).sha256,
|
|
1956
|
+
pointer: "/task"
|
|
1957
|
+
} : null
|
|
1958
|
+
},
|
|
1959
|
+
terminal: e.terminal === void 0 ? n ? {
|
|
1960
|
+
kind: typeof n.kind == "string" ? n.kind : null,
|
|
1961
|
+
reason: typeof n.reason == "string" ? n.reason : null,
|
|
1962
|
+
...typeof n.error?.message == "string" ? { error: this.clip(n.error.message, null).text } : {}
|
|
1963
|
+
} : null : e.terminal,
|
|
1964
|
+
coverage: {
|
|
1965
|
+
completeOriginalCapture: f.length > 0 && f.every((e) => e.status === "complete"),
|
|
1966
|
+
publicContent: "",
|
|
1967
|
+
categoryMethod: "Activity types are keyword matches on tool names and commands. They do not measure research value or show independent verification.",
|
|
1968
|
+
cost: m ? "List price from recorded usage; not billed." : "Not recorded",
|
|
1969
|
+
nodes: u,
|
|
1970
|
+
gaps: this.gaps.map((e) => ({
|
|
1971
|
+
runId: this.runId,
|
|
1972
|
+
...e
|
|
1973
|
+
}))
|
|
1974
|
+
}
|
|
1975
|
+
},
|
|
1976
|
+
counts: d
|
|
1977
|
+
};
|
|
1978
|
+
}
|
|
1979
|
+
build() {
|
|
1980
|
+
return this.convert(), this.assemble();
|
|
1981
|
+
}
|
|
1982
|
+
};
|
|
1983
|
+
function Y(e, t, n = "") {
|
|
1984
|
+
let r = new Map(t.files.filter((e) => e.path.startsWith(n)).map((e) => [e.path.slice(n.length), e])), o = new Set((t.links ?? []).filter((e) => e.path.startsWith(n)).map((e) => e.path.slice(n.length))), c = G(e).filter((e) => !o.has(e)), u = [];
|
|
1985
|
+
for (let e of c) r.has(e) || u.push(`${n}${e} is not in the snapshot`);
|
|
1986
|
+
for (let [t, o] of r) {
|
|
1987
|
+
let r = v(e, t);
|
|
1988
|
+
if (!s(r)) {
|
|
1989
|
+
u.push(`${n}${t} is missing`);
|
|
1990
|
+
continue;
|
|
1991
|
+
}
|
|
1992
|
+
let c = i("sha256"), f = 0, p = l(r, "r");
|
|
1993
|
+
try {
|
|
1994
|
+
let e = Buffer.allocUnsafe(1 << 20);
|
|
1995
|
+
for (let t = d(p, e); t > 0; t = d(p, e)) c.update(e.subarray(0, t)), f += t;
|
|
1996
|
+
} finally {
|
|
1997
|
+
a(p);
|
|
1998
|
+
}
|
|
1999
|
+
(c.digest("hex") !== E(o.sha256) || f !== o.bytes) && u.push(`${n}${t} does not match its sha256 or length`);
|
|
2000
|
+
}
|
|
2001
|
+
if (u.length) throw new w(`${u.length} files differ from the snapshot: ${u.slice(0, 5).join("; ")}`);
|
|
2002
|
+
}
|
|
2003
|
+
function X(t, n) {
|
|
2004
|
+
let r = e.safeParse(t);
|
|
2005
|
+
if (!r.success) throw Error(`Produced record is invalid: ${r.error.message.slice(0, 2e3)}`);
|
|
2006
|
+
let i = JSON.stringify(t), a = Buffer.byteLength(i);
|
|
2007
|
+
if (a > 134217728) throw new C(`record-too-large: ${a} bytes`);
|
|
2008
|
+
return {
|
|
2009
|
+
record: t,
|
|
2010
|
+
json: i,
|
|
2011
|
+
summary: {
|
|
2012
|
+
runId: t.runId,
|
|
2013
|
+
recordDigest: T(i),
|
|
2014
|
+
bytes: a,
|
|
2015
|
+
nodes: t.nodes.length,
|
|
2016
|
+
events: t.events.length,
|
|
2017
|
+
coverage: n
|
|
2018
|
+
}
|
|
2019
|
+
};
|
|
2020
|
+
}
|
|
2021
|
+
function Z(e, t = {}) {
|
|
2022
|
+
t.manifest && Y(e, t.manifest);
|
|
2023
|
+
let { record: n, counts: r } = new J(e, t.native, Math.max(1024, t.maxText ?? 16384), {
|
|
2024
|
+
runId: t.runId,
|
|
2025
|
+
manifest: t.manifest,
|
|
2026
|
+
manifestSha256: t.manifestSha256,
|
|
2027
|
+
files: t.files
|
|
2028
|
+
}).build();
|
|
2029
|
+
return X(n, r);
|
|
2030
|
+
}
|
|
2031
|
+
var Q = "agent-record.bundle.v1", $ = (e, t) => ({
|
|
2032
|
+
id: e,
|
|
2033
|
+
label: e,
|
|
2034
|
+
parent: null,
|
|
2035
|
+
kind: "session",
|
|
2036
|
+
role: "Session",
|
|
2037
|
+
model: null,
|
|
2038
|
+
servedModel: null,
|
|
2039
|
+
harness: null,
|
|
2040
|
+
sandboxes: [],
|
|
2041
|
+
capture: {
|
|
2042
|
+
channel: "none",
|
|
2043
|
+
status: "absent",
|
|
2044
|
+
reason: "no-conversation-channel"
|
|
2045
|
+
},
|
|
2046
|
+
outRefs: [],
|
|
2047
|
+
transcriptRefs: [],
|
|
2048
|
+
...t
|
|
2049
|
+
});
|
|
2050
|
+
function ee(e) {
|
|
2051
|
+
if (e?.schema !== "agent-record.bundle.v1") throw new S(`bundle.json is not ${Q}`);
|
|
2052
|
+
if (typeof e.recordId != "string" || !e.recordId) throw new S("bundle.json names no recordId");
|
|
2053
|
+
if (!Array.isArray(e.sessions)) throw new S("bundle.json lists no sessions");
|
|
2054
|
+
let t = (e) => typeof e == "string" && e !== "" && !e.startsWith("/") && !e.split("/").includes("..");
|
|
2055
|
+
for (let n of [
|
|
2056
|
+
...e.sessions,
|
|
2057
|
+
...e.journals ?? [],
|
|
2058
|
+
...e.runs ?? [],
|
|
2059
|
+
...e.findings ?? []
|
|
2060
|
+
]) if (!t(n?.path)) throw new S(`bundle.json path ${JSON.stringify(n?.path)} leaves the bundle`);
|
|
2061
|
+
return e;
|
|
2062
|
+
}
|
|
2063
|
+
function te(e, t = {}) {
|
|
2064
|
+
t.manifest && Y(e, t.manifest);
|
|
2065
|
+
let n = u(v(e, "bundle.json"), "utf8"), r = ee(JSON.parse(n)), i = Math.max(1024, t.maxText ?? 16384), a = new J(e, t.native, i, {
|
|
2066
|
+
runId: r.recordId,
|
|
2067
|
+
manifest: t.manifest,
|
|
2068
|
+
manifestSha256: t.manifestSha256
|
|
2069
|
+
});
|
|
2070
|
+
a.fileSource("bundle.json");
|
|
2071
|
+
for (let n of r.runs ?? []) {
|
|
2072
|
+
let r = new J(v(e, n.path), t.native, i, {
|
|
2073
|
+
runId: n.runId ?? g(n.path),
|
|
2074
|
+
manifest: t.manifest,
|
|
2075
|
+
prefix: `${n.path.replace(/\/+$/, "")}/`
|
|
2076
|
+
});
|
|
2077
|
+
r.convert();
|
|
2078
|
+
for (let [e, t] of r.nodes) {
|
|
2079
|
+
if (a.nodes.has(e)) throw new w(`node ${e} appears twice in the bundle`);
|
|
2080
|
+
a.nodes.set(e, t);
|
|
2081
|
+
}
|
|
2082
|
+
for (let e of r.events) a.events.push({
|
|
2083
|
+
...e,
|
|
2084
|
+
order: a.order++
|
|
2085
|
+
});
|
|
2086
|
+
for (let [e, t] of r.sources) a.sources.has(e) || a.sources.set(e, t);
|
|
2087
|
+
for (let e of r.gaps) a.gaps.push(e);
|
|
2088
|
+
for (let [e, t] of r.claimed) a.claimed.set(e, t);
|
|
2089
|
+
}
|
|
2090
|
+
let o = [], c = /* @__PURE__ */ new Map();
|
|
2091
|
+
for (let e of r.journals ?? []) {
|
|
2092
|
+
let t = a.file(e.path);
|
|
2093
|
+
a.fileSource(e.path);
|
|
2094
|
+
let n = g(_(e.path)), r;
|
|
2095
|
+
if (e.workflow) {
|
|
2096
|
+
a.fileSource(e.workflow);
|
|
2097
|
+
try {
|
|
2098
|
+
r = P(JSON.parse(a.file(e.workflow).text)?.timestamp) ?? void 0;
|
|
2099
|
+
} catch {}
|
|
2100
|
+
}
|
|
2101
|
+
a.nodes.has(n) || a.nodes.set(n, $(n, {
|
|
2102
|
+
label: e.label ?? n,
|
|
2103
|
+
kind: "agent",
|
|
2104
|
+
role: "workflow",
|
|
2105
|
+
harness: "claude-code-workflow",
|
|
2106
|
+
start: r,
|
|
2107
|
+
capture: {
|
|
2108
|
+
channel: "journal",
|
|
2109
|
+
status: "complete",
|
|
2110
|
+
reason: null
|
|
2111
|
+
}
|
|
2112
|
+
}));
|
|
2113
|
+
for (let r of H(t.bytes)) {
|
|
2114
|
+
let i = L(r.value?.agentId);
|
|
2115
|
+
if (!i) continue;
|
|
2116
|
+
let s = `${n}:${i}`;
|
|
2117
|
+
a.nodes.has(s) || (a.nodes.set(s, $(s, {
|
|
2118
|
+
label: `agent ${i.slice(0, 8)}`,
|
|
2119
|
+
parent: n,
|
|
2120
|
+
kind: "agent",
|
|
2121
|
+
role: "workflow agent",
|
|
2122
|
+
agentId: void 0
|
|
2123
|
+
})), c.set(i, {
|
|
2124
|
+
node: s,
|
|
2125
|
+
rel: e.path,
|
|
2126
|
+
line: r.line
|
|
2127
|
+
})), o.push({
|
|
2128
|
+
node: s,
|
|
2129
|
+
rel: e.path,
|
|
2130
|
+
sha256: t.sha256,
|
|
2131
|
+
row: r,
|
|
2132
|
+
type: L(r.value?.type) || "row",
|
|
2133
|
+
agentId: i
|
|
2134
|
+
});
|
|
2135
|
+
}
|
|
2136
|
+
}
|
|
2137
|
+
let l = /* @__PURE__ */ new Map(), d = [];
|
|
2138
|
+
for (let t of r.sessions) {
|
|
2139
|
+
let n;
|
|
2140
|
+
if (t.harness === "claude-code") {
|
|
2141
|
+
let r = H(a.file(t.path).bytes), i = r.find((e) => typeof e.value?.agentId == "string"), o = t.agentId ?? (i ? L(i.value.agentId) : ""), l = t.sessionId ?? L(r.find((e) => typeof e.value?.sessionId == "string")?.value?.sessionId), u = t.path.replace(/\.jsonl$/, ".meta.json"), d = o ? c.get(o) : void 0;
|
|
2142
|
+
if (d && i && g(t.path) === `agent-${o}.jsonl` && s(v(e, u))) n = a.nodes.get(d.node), n.joinBasis = "workflow-agent-id", n.joinProof = {
|
|
2143
|
+
journal: {
|
|
2144
|
+
path: d.rel,
|
|
2145
|
+
line: d.line
|
|
2146
|
+
},
|
|
2147
|
+
session: {
|
|
2148
|
+
path: t.path,
|
|
2149
|
+
line: i.line
|
|
2150
|
+
},
|
|
2151
|
+
meta: { path: u }
|
|
2152
|
+
}, n.nativeSessionId = l || void 0, a.fileSource(u);
|
|
2153
|
+
else {
|
|
2154
|
+
let e = `claude-code:${o || l || g(t.path, ".jsonl")}`;
|
|
2155
|
+
n = a.nodes.get(e) ?? $(e, {
|
|
2156
|
+
label: t.label ?? `claude code ${(o || l).slice(0, 8)}`,
|
|
2157
|
+
nativeSessionId: l || void 0
|
|
2158
|
+
}), a.nodes.set(e, n);
|
|
2159
|
+
}
|
|
2160
|
+
n.harness ??= "claude-code", t.label && (n.label = t.label);
|
|
2161
|
+
let f = a.readClaudeSession(n, t.path, void 0, t.lines);
|
|
2162
|
+
f && (n.capture = {
|
|
2163
|
+
channel: "native",
|
|
2164
|
+
status: f.unparsable ? "lossy" : "complete",
|
|
2165
|
+
reason: f.unparsable ? "unparsable-lines" : t.lines ? "line-window" : null
|
|
2166
|
+
});
|
|
2167
|
+
} else if (t.harness === "codex") {
|
|
2168
|
+
let e = `codex:${t.sessionId ?? g(t.path, ".jsonl")}`;
|
|
2169
|
+
n = a.nodes.get(e) ?? $(e, { label: t.label ?? `codex ${(t.sessionId ?? g(t.path)).slice(-12)}` }), a.nodes.set(e, n), a.readCodex(n, t.path, t.lines) && t.lines && (n.capture = {
|
|
2170
|
+
...n.capture,
|
|
2171
|
+
reason: n.capture.reason ?? "line-window"
|
|
2172
|
+
});
|
|
2173
|
+
} else if (t.harness === "opencode") {
|
|
2174
|
+
let e = `opencode:${t.sessionId ?? g(_(t.path))}`;
|
|
2175
|
+
n = a.nodes.get(e) ?? $(e, { label: t.label ?? e }), a.nodes.set(e, n), a.readOpenCode(n, t.path);
|
|
2176
|
+
} else if (t.harness === "opencode-bridge") {
|
|
2177
|
+
let e = a.file(t.path), r = H(e.bytes), i = r.find((e) => e.value?.table === "sessions"), o = `bridge:${t.sessionId ?? (L(i?.value?.row?.external_id) || g(t.path, ".jsonl"))}`;
|
|
2178
|
+
n = a.nodes.get(o) ?? $(o, { label: t.label ?? o }), a.nodes.set(o, n), a.readBridgeStream(n, {
|
|
2179
|
+
rel: t.path,
|
|
2180
|
+
rows: r,
|
|
2181
|
+
sha256: e.sha256
|
|
2182
|
+
});
|
|
2183
|
+
} else if (t.harness === "pi") {
|
|
2184
|
+
let e = a.file(t.path), r = H(e.bytes), i = r.find((e) => e.value?.type === "session")?.value, o = t.sessionId ?? (L(i?.id) || g(t.path, ".jsonl")), s = `pi:${o}`;
|
|
2185
|
+
n = a.nodes.get(s) ?? $(s, { label: t.label ?? `pi ${o.slice(0, 8)}` }), a.nodes.set(s, n), a.readPi(n, [{
|
|
2186
|
+
rel: t.path,
|
|
2187
|
+
sessionId: o,
|
|
2188
|
+
rows: r,
|
|
2189
|
+
sha256: e.sha256
|
|
2190
|
+
}]);
|
|
2191
|
+
} else throw new S(`bundle.json session ${t.path} has an unknown harness`);
|
|
2192
|
+
l.set(t.path, n.id), d.push({
|
|
2193
|
+
session: t,
|
|
2194
|
+
node: n
|
|
2195
|
+
});
|
|
2196
|
+
}
|
|
2197
|
+
let f = (e) => /(?:^|\/)([0-9a-f-]{36})\/subagents\//.exec(e)?.[1], p = (e, t) => {
|
|
2198
|
+
let n = f(e);
|
|
2199
|
+
return n !== void 0 && g(t, ".jsonl") === n;
|
|
2200
|
+
};
|
|
2201
|
+
for (let { session: e, node: t } of d) {
|
|
2202
|
+
if (!e.parentPath) continue;
|
|
2203
|
+
let n = l.get(e.parentPath);
|
|
2204
|
+
if (!n || !p(e.path, e.parentPath)) {
|
|
2205
|
+
a.gaps.push({
|
|
2206
|
+
nodeId: t.id,
|
|
2207
|
+
code: "parent-unproven",
|
|
2208
|
+
detail: `${e.path} does not sit under ${e.parentPath}`
|
|
2209
|
+
});
|
|
2210
|
+
continue;
|
|
2211
|
+
}
|
|
2212
|
+
let r = t.parent && a.nodes.get(t.parent)?.role === "workflow" ? a.nodes.get(t.parent) : t;
|
|
2213
|
+
r.parent && r.parent !== n || (r.parent = n, r.joinBasis ??= "session-directory");
|
|
2214
|
+
}
|
|
2215
|
+
for (let e of r.journals ?? []) {
|
|
2216
|
+
if (!e.parentPath) continue;
|
|
2217
|
+
let t = l.get(e.parentPath), n = a.nodes.get(g(_(e.path)));
|
|
2218
|
+
t && n && p(e.path, e.parentPath) ? n.parent = t : n && a.gaps.push({
|
|
2219
|
+
nodeId: n.id,
|
|
2220
|
+
code: "parent-unproven",
|
|
2221
|
+
detail: `${e.path} does not sit under ${e.parentPath}`
|
|
2222
|
+
});
|
|
2223
|
+
}
|
|
2224
|
+
let m = /* @__PURE__ */ new Map();
|
|
2225
|
+
for (let e of a.events) {
|
|
2226
|
+
let t = m.get(e.node);
|
|
2227
|
+
t ? (e.at < t[0] && (t[0] = e.at), e.at > t[1] && (t[1] = e.at)) : m.set(e.node, [e.at, e.at]);
|
|
2228
|
+
}
|
|
2229
|
+
for (let e of o) {
|
|
2230
|
+
let t = m.get(e.node);
|
|
2231
|
+
if (!t) {
|
|
2232
|
+
a.gaps.push({
|
|
2233
|
+
nodeId: e.node,
|
|
2234
|
+
code: "journal-untimed-lines",
|
|
2235
|
+
detail: `${e.rel}:${e.row.line} has no time and no joined session`
|
|
2236
|
+
});
|
|
2237
|
+
continue;
|
|
2238
|
+
}
|
|
2239
|
+
let n = a.nodes.get(e.node);
|
|
2240
|
+
e.type === "result" && (n.status ??= "settled");
|
|
2241
|
+
let { type: r, agentId: i, ...o } = e.row.value;
|
|
2242
|
+
a.emit({
|
|
2243
|
+
node: e.node,
|
|
2244
|
+
at: e.type === "started" ? t[0] : t[1],
|
|
2245
|
+
kind: e.type,
|
|
2246
|
+
category: "lifecycle",
|
|
2247
|
+
label: e.type,
|
|
2248
|
+
source: {
|
|
2249
|
+
path: e.rel,
|
|
2250
|
+
sha256: e.sha256,
|
|
2251
|
+
line: e.row.line
|
|
2252
|
+
},
|
|
2253
|
+
detail: {
|
|
2254
|
+
lifecycle: e.type,
|
|
2255
|
+
atBasis: e.type === "started" ? "session-first-event" : "session-last-event",
|
|
2256
|
+
data: a.compactValue(o)
|
|
2257
|
+
}
|
|
2258
|
+
});
|
|
2259
|
+
}
|
|
2260
|
+
for (let e of a.nodes.values()) e.role === "workflow agent" && e.capture.status === "absent" && (e.capture = {
|
|
2261
|
+
channel: "journal",
|
|
2262
|
+
status: "absent",
|
|
2263
|
+
reason: "no-session-joined"
|
|
2264
|
+
}, a.gaps.push({
|
|
2265
|
+
nodeId: e.id,
|
|
2266
|
+
code: "no-transcript:no-session-joined",
|
|
2267
|
+
detail: "No session file carries this workflow agent id"
|
|
2268
|
+
}));
|
|
2269
|
+
for (let t of r.findings ?? []) {
|
|
2270
|
+
let n = t.path.endsWith(".md") ? [t.path] : G(v(e, t.path)).filter((e) => e.endsWith(".md")).map((e) => `${t.path.replace(/\/+$/, "")}/${e}`);
|
|
2271
|
+
a.readFindings(`finding:${r.recordId}`, void 0, n);
|
|
2272
|
+
}
|
|
2273
|
+
a.rootId = "";
|
|
2274
|
+
let { record: h, counts: y } = a.assemble({
|
|
2275
|
+
title: r.title ?? r.recordId,
|
|
2276
|
+
format: "bundle",
|
|
2277
|
+
terminal: null,
|
|
2278
|
+
assignment: {
|
|
2279
|
+
objective: "",
|
|
2280
|
+
instruction: "",
|
|
2281
|
+
knowledge: "",
|
|
2282
|
+
completion: "",
|
|
2283
|
+
suppliedKnowledge: "",
|
|
2284
|
+
deliverables: "",
|
|
2285
|
+
constraints: "",
|
|
2286
|
+
source: null
|
|
2287
|
+
},
|
|
2288
|
+
input: { bundle: `sha256:${T(n)}` }
|
|
2289
|
+
});
|
|
2290
|
+
return X(h, y);
|
|
2291
|
+
}
|
|
2292
|
+
//#endregion
|
|
2293
|
+
export { y as ADAPTER_VERSION, Q as BUNDLE_SCHEMA, r as ID_SCHEME, J as Ingest, b as MAX_RECORD_BYTES, C as RecordTooLargeError, S as RunUnreadableError, w as SnapshotMismatchError, V as categoryOf, x as createFileCache, X as finishRecord, te as ingestBundle, Z as ingestRun, Y as verifySnapshot };
|