@cortexkit/opencode-magic-context 0.49.34 → 0.49.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/auto-search-worker.js +163 -155
- package/dist/chunk-embedding-write-worker.js +70 -66
- package/dist/{compaction-marker-candidates-31h86ph0.js → compaction-marker-candidates-5p1qkve9.js} +5 -2
- package/dist/compaction-marker-candidates-worker.js +24 -23
- package/dist/{compartment-chunk-embedding-5q5gj67r.js → compartment-chunk-embedding-ypktm0tk.js} +10 -8
- package/dist/{conflict-warning-hook-xgskea1v.js → conflict-warning-hook-b75jn458.js} +11 -9
- package/dist/{context-p3xrarzt.js → context-969z683s.js} +1839 -746
- package/dist/{derive-budgets-pqybnx09.js → derive-budgets-htj16n4x.js} +3 -2
- package/dist/embedding-backfill-rma0v2ct.js +28 -0
- package/dist/embedding-worker-process.js +2 -1
- package/dist/embedding-worker.js +6 -5
- package/dist/expand-attachments-h33jbgyz.js +21 -0
- package/dist/features/magic-context/auto-search-diagnostics.d.ts +21 -0
- package/dist/features/magic-context/auto-search-diagnostics.d.ts.map +1 -0
- package/dist/features/magic-context/compaction-marker-candidates.d.ts.map +1 -1
- package/dist/features/magic-context/compaction-marker.d.ts +5 -3
- package/dist/features/magic-context/compaction-marker.d.ts.map +1 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts +1 -1
- package/dist/features/magic-context/compartment-chunk-embedding.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/task-gates.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify-gate.d.ts +2 -0
- package/dist/features/magic-context/dreamer/verify-gate.d.ts.map +1 -1
- package/dist/features/magic-context/dreamer/verify-state.d.ts +9 -0
- package/dist/features/magic-context/dreamer/verify-state.d.ts.map +1 -0
- package/dist/features/magic-context/dreamer/verify.d.ts +2 -1
- package/dist/features/magic-context/dreamer/verify.d.ts.map +1 -1
- package/dist/features/magic-context/migration-worker-client.d.ts +3 -0
- package/dist/features/magic-context/migration-worker-client.d.ts.map +1 -1
- package/dist/features/magic-context/migration-worker.d.ts +15 -0
- package/dist/features/magic-context/migration-worker.d.ts.map +1 -1
- package/dist/features/magic-context/overflow-detection.d.ts +2 -2
- package/dist/features/magic-context/overflow-detection.d.ts.map +1 -1
- package/dist/features/magic-context/search-rerank.d.ts.map +1 -1
- package/dist/features/magic-context/search.d.ts +4 -0
- package/dist/features/magic-context/search.d.ts.map +1 -1
- package/dist/features/magic-context/storage-meta-persisted.d.ts +1 -0
- package/dist/features/magic-context/storage-meta-persisted.d.ts.map +1 -1
- package/dist/features/magic-context/storage-tags.d.ts +4 -0
- package/dist/features/magic-context/storage-tags.d.ts.map +1 -1
- package/dist/features/magic-context/store-generation-rebase-labels.d.ts +6 -0
- package/dist/features/magic-context/store-generation-rebase-labels.d.ts.map +1 -0
- package/dist/features/magic-context/store-generation-rebase.d.ts.map +1 -1
- package/dist/features/magic-context/work-metrics-carry-storage.d.ts +10 -0
- package/dist/features/magic-context/work-metrics-carry-storage.d.ts.map +1 -0
- package/dist/{history-owner-36wp3mkb.js → history-owner-0z620wgz.js} +3 -2
- package/dist/hooks/magic-context/apply-operations.d.ts +20 -3
- package/dist/hooks/magic-context/apply-operations.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-observation.d.ts +13 -0
- package/dist/hooks/magic-context/auto-search-observation.d.ts.map +1 -0
- package/dist/hooks/magic-context/auto-search-runner.d.ts.map +1 -1
- package/dist/hooks/magic-context/auto-search-worker-client.d.ts +10 -2
- package/dist/hooks/magic-context/auto-search-worker-client.d.ts.map +1 -1
- package/dist/hooks/magic-context/compaction-marker-publication.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-commit-hashes.d.ts +4 -0
- package/dist/hooks/magic-context/compartment-commit-hashes.d.ts.map +1 -0
- package/dist/hooks/magic-context/compartment-runner-historian.d.ts.map +1 -1
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts +1 -0
- package/dist/hooks/magic-context/compartment-runner-validation.d.ts.map +1 -1
- package/dist/hooks/magic-context/event-resolvers.d.ts.map +1 -1
- package/dist/hooks/magic-context/final-wire-completeness.d.ts +15 -0
- package/dist/hooks/magic-context/final-wire-completeness.d.ts.map +1 -0
- package/dist/hooks/magic-context/final-wire-token-estimate.d.ts.map +1 -1
- package/dist/hooks/magic-context/issue-423-fixture.d.ts +1 -1
- package/dist/hooks/magic-context/issue-423-fixture.d.ts.map +1 -1
- package/dist/hooks/magic-context/issue-424-fixture.d.ts +1 -1
- package/dist/hooks/magic-context/issue-424-fixture.d.ts.map +1 -1
- package/dist/hooks/magic-context/project-structural-sentinels.d.ts +25 -0
- package/dist/hooks/magic-context/project-structural-sentinels.d.ts.map +1 -0
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts +8 -1
- package/dist/hooks/magic-context/protected-tail-boundary.d.ts.map +1 -1
- package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts +1 -0
- package/dist/hooks/magic-context/raw-ordinal-warmup.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-chunk.d.ts +11 -0
- package/dist/hooks/magic-context/read-session-chunk.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-formatting.d.ts +2 -0
- package/dist/hooks/magic-context/read-session-formatting.d.ts.map +1 -1
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts +2 -0
- package/dist/hooks/magic-context/read-session-true-raw-tokens.d.ts.map +1 -1
- package/dist/hooks/magic-context/release-recovery-prefix.d.ts +9 -0
- package/dist/hooks/magic-context/release-recovery-prefix.d.ts.map +1 -0
- package/dist/hooks/magic-context/strip-structural-noise.d.ts +6 -3
- package/dist/hooks/magic-context/strip-structural-noise.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-context-state.d.ts +3 -0
- package/dist/hooks/magic-context/transform-context-state.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts +3 -0
- package/dist/hooks/magic-context/transform-postprocess-phase.d.ts.map +1 -1
- package/dist/hooks/magic-context/transform.d.ts.map +1 -1
- package/dist/{index-cpjk5jd2.js → index-1d042x6w.js} +16 -14
- package/dist/{index-2743x98y.js → index-21fgrfrf.js} +35 -142
- package/dist/index-2amn2s73.js +123 -0
- package/dist/{index-c7phnbvk.js → index-2p37txes.js} +1 -1
- package/dist/index-2qbtqg1w.js +529 -0
- package/dist/{index-9gpw8hrm.js → index-2rs7912w.js} +4 -4
- package/dist/{index-m1x9ghk5.js → index-4ks89h5a.js} +37 -7
- package/dist/{index-b88dwwrh.js → index-4xyjr62e.js} +1 -1
- package/dist/index-4y35msh5.js +531 -0
- package/dist/index-66a50f3e.js +777 -0
- package/dist/index-72czy45z.js +4557 -0
- package/dist/index-7v05d9b7.js +58 -0
- package/dist/{index-qgh1qwjj.js → index-850vthn3.js} +9 -3
- package/dist/{index-np3rgfw4.js → index-8jjjmhab.js} +15 -4
- package/dist/index-96ztjvkn.js +204 -0
- package/dist/{index-fm36bjv4.js → index-9fgmkfaf.js} +22 -277
- package/dist/{index-atekmqef.js → index-9tdvbdv1.js} +508 -5547
- package/dist/{index-xrnsygfq.js → index-9wnbnx8f.js} +1 -1
- package/dist/{index-waktfbjy.js → index-ae1ar4v1.js} +4 -4
- package/dist/{index-v15ne3a3.js → index-b1ydbp95.js} +2 -2
- package/dist/{index-nxrsns5x.js → index-c5dzns43.js} +75 -75
- package/dist/{index-v7287tzq.js → index-dcjkw41m.js} +19 -8
- package/dist/{index-hbx7m8he.js → index-dfdg2cgg.js} +338 -86
- package/dist/{index-spwjbkc7.js → index-dnqqqc5f.js} +1 -1
- package/dist/{index-04z754rd.js → index-dz48h1wx.js} +33 -5
- package/dist/{index-rrv26qjz.js → index-fw42ms3m.js} +1 -1
- package/dist/{index-t5pck3ss.js → index-fxbk7gk3.js} +1 -1
- package/dist/{index-wfybj1dw.js → index-g4t7850m.js} +2 -2
- package/dist/{index-97spytxq.js → index-gnmhbyyc.js} +583 -474
- package/dist/{index-4pnsgvfk.js → index-hacf2tyx.js} +1 -1
- package/dist/index-j105mf16.js +270 -0
- package/dist/{index-gkee6p4g.js → index-jggt5gf2.js} +3 -3
- package/dist/{index-s1n8dd2n.js → index-jkanybgq.js} +2 -2
- package/dist/{index-h7tgn49j.js → index-jrfre9ah.js} +5 -222
- package/dist/{index-kfyb3k6n.js → index-jz5bk7xd.js} +2 -2
- package/dist/{index-7kkphb6c.js → index-nj360hcs.js} +4 -4
- package/dist/{index-07vskjn8.js → index-pp8vdn01.js} +15 -13
- package/dist/index-prw8apnc.js +194 -0
- package/dist/{index-rverk2vz.js → index-r2epb000.js} +34 -4
- package/dist/{index-7g9dr8gy.js → index-tn9drm1a.js} +125 -143
- package/dist/{index-kq5w68dp.js → index-txs8tce6.js} +1 -1
- package/dist/{index-rfxzazzy.js → index-ty4vhe4n.js} +5 -5
- package/dist/{index-y1qwzvxn.js → index-vd2ywmfe.js} +2 -2
- package/dist/{index-0677w9sd.js → index-wcwhhtdh.js} +58 -23
- package/dist/index-wh9fxds5.js +265 -0
- package/dist/{index-51rdvtkz.js → index-xd2p95m7.js} +3 -3
- package/dist/{index-as2amvn3.js → index-xnm0wq1r.js} +6 -531
- package/dist/{index-ftr84kkv.js → index-ys7j6679.js} +7 -5
- package/dist/index-z4p0ry94.js +222 -0
- package/dist/index-z9zygwse.js +89 -0
- package/dist/index.js +86 -74
- package/dist/{logger-94kew5wm.js → logger-qwnbcfj9.js} +2 -1
- package/dist/{message-fts-rowid-map-va36knh4.js → message-fts-rowid-map-t6qsyg9s.js} +7 -5
- package/dist/{message-index-bounded-qh91fdr3.js → message-index-bounded-wfk6aqxk.js} +15 -13
- package/dist/{message-time-backfill-4qva0b4f.js → message-time-backfill-39bm498k.js} +3 -2
- package/dist/migration-worker.js +55 -48
- package/dist/plugin/rpc-handlers.d.ts.map +1 -1
- package/dist/{project-embedding-registry-6yex0r9f.js → project-embedding-registry-3yyegjma.js} +16 -13
- package/dist/raw-ordinal-warmup-worker.js +114 -113
- package/dist/{read-session-chunk-kaghtr75.js → read-session-chunk-26yrrhyz.js} +18 -12
- package/dist/{read-session-raw-b2sd67v4.js → read-session-raw-j7c9w57v.js} +5 -3
- package/dist/recomp-orchestrator-wk509qkp.js +69 -0
- package/dist/render-h1qarr8a.js +44 -0
- package/dist/{safe-notification-target-mkr9yzvr.js → safe-notification-target-wztd7bgk.js} +3 -2
- package/dist/search-5h9fydyq.js +54 -0
- package/dist/search-archive-q79hyqxs.js +29 -0
- package/dist/{send-session-notification-vz86nt79.js → send-session-notification-14p3yje4.js} +9 -7
- package/dist/shared/model-suggestion-retry.d.ts +7 -0
- package/dist/shared/model-suggestion-retry.d.ts.map +1 -1
- package/dist/shared/prompt-async-transport.d.ts.map +1 -1
- package/dist/shared/reusable-worker-entry.d.ts +4 -0
- package/dist/shared/reusable-worker-entry.d.ts.map +1 -0
- package/dist/shared/reusable-worker.d.ts +6 -0
- package/dist/shared/reusable-worker.d.ts.map +1 -0
- package/dist/shared/reusable-worker.fixture.d.ts +2 -0
- package/dist/shared/reusable-worker.fixture.d.ts.map +1 -0
- package/dist/shared/worker-shutdown.d.ts +1 -1
- package/dist/shared/worker-shutdown.d.ts.map +1 -1
- package/dist/{storage-tags-6hvkk01c.js → storage-tags-vj0yj7ed.js} +5 -4
- package/dist/store-reader-yh19h38c.js +14 -0
- package/dist/store-s3eykdjt.js +21 -0
- package/dist/tools/ctx-expand/render.d.ts +5 -3
- package/dist/tools/ctx-expand/render.d.ts.map +1 -1
- package/dist/tools/ctx-expand/search-archive.d.ts.map +1 -1
- package/dist/tools/ctx-expand/tools.d.ts +2 -0
- package/dist/tools/ctx-expand/tools.d.ts.map +1 -1
- package/dist/tools/ctx-expand/v2-archive-reader.d.ts +33 -0
- package/dist/tools/ctx-expand/v2-archive-reader.d.ts.map +1 -0
- package/dist/{transform-postprocess-phase-ph38mhrs.js → transform-postprocess-phase-4gj0mtcg.js} +39 -32
- package/dist/v2/auto-search-worker.js +163 -155
- package/dist/v2/chunk-embedding-write-worker.js +71 -67
- package/dist/v2/compaction-marker-candidates-worker.js +24 -23
- package/dist/v2/{compaction-marker-candidates-m4vmye3w.js → compaction-marker-candidates-yeb2ky46.js} +6 -3
- package/dist/v2/{compartment-chunk-embedding-rc31e6md.js → compartment-chunk-embedding-qfk791bd.js} +11 -9
- package/dist/v2/{context-s60hcatx.js → context-bxr039be.js} +2678 -1246
- package/dist/v2/{derive-budgets-knf763tt.js → derive-budgets-sa0v7bz0.js} +4 -3
- package/dist/v2/embedding-backfill-00tw59rx.js +27 -0
- package/dist/v2/embedding-worker-process.js +2 -1
- package/dist/v2/embedding-worker.js +6 -5
- package/dist/v2/expand-attachments-h33jbgyz.js +21 -0
- package/dist/v2/fold/code-mode-catalog.d.ts +3 -0
- package/dist/v2/fold/code-mode-catalog.d.ts.map +1 -0
- package/dist/v2/fold/idle.d.ts +16 -0
- package/dist/v2/fold/idle.d.ts.map +1 -0
- package/dist/v2/fold/manual-baseline.d.ts +8 -0
- package/dist/v2/fold/manual-baseline.d.ts.map +1 -0
- package/dist/v2/fold/native-replay-v3.d.ts +75 -0
- package/dist/v2/fold/native-replay-v3.d.ts.map +1 -0
- package/dist/v2/fold/native-replay.d.ts +81 -8
- package/dist/v2/fold/native-replay.d.ts.map +1 -1
- package/dist/v2/fold/policy.d.ts +2 -1
- package/dist/v2/fold/policy.d.ts.map +1 -1
- package/dist/v2/fold/restore.d.ts.map +1 -1
- package/dist/v2/fold/summary.d.ts +4 -0
- package/dist/v2/fold/summary.d.ts.map +1 -0
- package/dist/v2/hidden-completion.d.ts.map +1 -1
- package/dist/v2/{history-owner-ad0crnrn.js → history-owner-fpka43cn.js} +3 -2
- package/dist/v2/hooks/channel2.d.ts +6 -0
- package/dist/v2/hooks/channel2.d.ts.map +1 -1
- package/dist/v2/hooks/context.d.ts.map +1 -1
- package/dist/v2/hooks/expand-attachments.d.ts +8 -0
- package/dist/v2/hooks/expand-attachments.d.ts.map +1 -0
- package/dist/v2/hooks/overflow-recovery.d.ts +45 -0
- package/dist/v2/hooks/overflow-recovery.d.ts.map +1 -0
- package/dist/v2/hooks/restore-rows.d.ts +12 -2
- package/dist/v2/hooks/restore-rows.d.ts.map +1 -1
- package/dist/v2/hooks/store.d.ts +7 -2
- package/dist/v2/hooks/store.d.ts.map +1 -1
- package/dist/v2/hooks/synthetic-admission.d.ts +7 -0
- package/dist/v2/hooks/synthetic-admission.d.ts.map +1 -0
- package/dist/v2/hooks/usage-persist.d.ts.map +1 -1
- package/dist/v2/{logger-p34mjtja.js → logger-4cj6d03m.js} +2 -1
- package/dist/v2/{message-fts-rowid-map-78awh03v.js → message-fts-rowid-map-z86avy0n.js} +8 -6
- package/dist/v2/{message-index-bounded-4htdr1j6.js → message-index-bounded-w14496s9.js} +16 -14
- package/dist/v2/{message-time-backfill-zvthw6xb.js → message-time-backfill-0c4h7sg6.js} +3 -2
- package/dist/v2/migration-worker.js +56 -49
- package/dist/v2/ordinal-range.fixture.d.ts +7 -0
- package/dist/v2/ordinal-range.fixture.d.ts.map +1 -0
- package/dist/v2/{project-embedding-registry-1x5qe2fy.js → project-embedding-registry-jqq2qeqb.js} +17 -14
- package/dist/v2/raw-ordinal-warmup-worker.js +114 -113
- package/dist/v2/{read-session-chunk-1fa9qzwb.js → read-session-chunk-tqnh1ret.js} +18 -12
- package/dist/v2/{read-session-raw-5x088amc.js → read-session-raw-qpp6x9kg.js} +6 -4
- package/dist/v2/recomp-orchestrator-9cjk6aej.js +68 -0
- package/dist/v2/render-5dz1knf2.js +43 -0
- package/dist/v2/{safe-notification-target-khnzg57c.js → safe-notification-target-gphhast7.js} +3 -2
- package/dist/v2/search-8yfet25y.js +52 -0
- package/dist/v2/search-archive-z6z9jqwf.js +28 -0
- package/dist/v2/{send-session-notification-x5nzy34v.js → send-session-notification-kxp47tsw.js} +9 -7
- package/dist/v2/{server-cpjk5jd2.js → server-1d042x6w.js} +16 -14
- package/dist/v2/server-2amn2s73.js +123 -0
- package/dist/v2/{server-6g98c227.js → server-3schkz95.js} +4 -4
- package/dist/v2/server-468mya5v.js +209 -0
- package/dist/v2/{server-z2wft9zv.js → server-5by3vdzs.js} +562 -5560
- package/dist/v2/{server-qjvk4a9t.js → server-69m30b21.js} +1 -1
- package/dist/v2/server-6emy0v9a.js +531 -0
- package/dist/v2/{server-vr4szghm.js → server-6vzh6wej.js} +3 -3
- package/dist/v2/{server-ajxhrgjv.js → server-7094pk3w.js} +80 -19
- package/dist/v2/{server-ab8017gw.js → server-7acq7815.js} +34 -141
- package/dist/v2/server-7v05d9b7.js +58 -0
- package/dist/v2/{server-24g8r2d0.js → server-7zacmty5.js} +75 -75
- package/dist/v2/{server-3mz2qh5a.js → server-969cdpmg.js} +1 -1
- package/dist/v2/server-96ztjvkn.js +204 -0
- package/dist/v2/{server-grakwy1v.js → server-a9w5f0yw.js} +37 -7
- package/dist/v2/{server-835q39kd.js → server-avdveykk.js} +3 -3
- package/dist/v2/{server-qc915kw2.js → server-bez34e60.js} +4 -4
- package/dist/v2/{server-h1byrhwx.js → server-cp1a03vc.js} +19 -8
- package/dist/v2/{server-bsgd4dk1.js → server-dcws5831.js} +2 -2
- package/dist/v2/{server-m1pfg2d4.js → server-dfq5vb8j.js} +4 -4
- package/dist/v2/server-e51xmr4d.js +194 -0
- package/dist/v2/server-ef1mskas.js +777 -0
- package/dist/v2/{server-1bw1wcbp.js → server-f0j864ma.js} +1 -1
- package/dist/v2/{server-jw5qe9y8.js → server-g3gqq4ac.js} +18 -217
- package/dist/v2/{server-2aasmpsp.js → server-gkse1wyz.js} +5 -5
- package/dist/v2/{server-6495nmn9.js → server-jb6tjyeb.js} +5 -222
- package/dist/v2/{server-qvy4qavp.js → server-jd7vzwn4.js} +125 -143
- package/dist/v2/{server-a7x00tw8.js → server-mfn1yf9d.js} +1 -1
- package/dist/v2/{server-awr8qa4c.js → server-nmyganc8.js} +2 -2
- package/dist/v2/{server-tkdabx8q.js → server-nq3cb7be.js} +5 -530
- package/dist/v2/server-qjyp27vf.js +270 -0
- package/dist/v2/{server-gyy4k6mf.js → server-qmmkhz2z.js} +1 -1
- package/dist/v2/{server-29qp8nz4.js → server-qxzbmtqt.js} +1 -1
- package/dist/v2/{server-806rzhs6.js → server-r4430x9m.js} +10 -4
- package/dist/v2/{server-53eh1r8r.js → server-sd8hvzte.js} +2 -2
- package/dist/v2/{server-k3t06fxr.js → server-sefxj8k1.js} +1 -1
- package/dist/v2/server-t8y64xj7.js +4513 -0
- package/dist/v2/{server-6vd2n183.js → server-tnzbk64q.js} +35 -5
- package/dist/v2/{server-v77xa5wj.js → server-tpt7bwq8.js} +1 -1
- package/dist/v2/{server-51779zs2.js → server-v0p37hm2.js} +4 -1
- package/dist/v2/{server-nxas8v1d.js → server-xfjjbrkt.js} +15 -4
- package/dist/v2/{server-cqjvxyrp.js → server-xy7w7hrd.js} +2 -2
- package/dist/v2/server-ypf1ap0v.js +529 -0
- package/dist/v2/server-z4p0ry94.js +222 -0
- package/dist/v2/server-z9zygwse.js +89 -0
- package/dist/v2/{server-ab1g0wn9.js → server-zzgtgqmd.js} +2 -2
- package/dist/v2/server.js +7 -6
- package/dist/v2/{storage-tags-18nbaanf.js → storage-tags-cw07ky67.js} +5 -4
- package/dist/v2/store-reader-cgx47zkp.js +14 -0
- package/dist/v2/store-reader.d.ts +9 -2
- package/dist/v2/store-reader.d.ts.map +1 -1
- package/dist/v2/store-z3qe67cg.js +21 -0
- package/dist/v2/v2-archive-reader-z7wr42ry.js +11 -0
- package/dist/v2/{wrapup-orchestrator-wxf7n5k6.js → wrapup-orchestrator-j1v62bkj.js} +50 -42
- package/dist/v2-archive-reader-028z6kck.js +11 -0
- package/dist/wrapup-orchestrator-xg9avt2p.js +56 -0
- package/package.json +1 -1
- package/src/shared/model-suggestion-retry.ts +1 -1
- package/src/shared/prompt-async-transport.test.ts +64 -3
- package/src/shared/prompt-async-transport.ts +61 -16
- package/src/shared/reusable-worker-entry.ts +58 -0
- package/src/shared/reusable-worker-reset.test.ts +108 -0
- package/src/shared/reusable-worker.fixture.ts +35 -0
- package/src/shared/reusable-worker.test.ts +253 -0
- package/src/shared/reusable-worker.ts +240 -0
- package/src/shared/sqlite-transaction-mode-guard.test.ts +2 -0
- package/src/shared/worker-shutdown.ts +21 -17
- package/dist/embedding-backfill-0jgtqxen.js +0 -25
- package/dist/recomp-orchestrator-0y983w7h.js +0 -62
- package/dist/search-archive-1kw2rp19.js +0 -26
- package/dist/search-p684j8ww.js +0 -50
- package/dist/v2/embedding-backfill-f43hd8y6.js +0 -24
- package/dist/v2/recomp-orchestrator-7q9nvxte.js +0 -61
- package/dist/v2/search-archive-xfp51s0g.js +0 -25
- package/dist/v2/search-wf8rqxhm.js +0 -48
- package/dist/wrapup-orchestrator-ys2nrkkb.js +0 -49
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import {
|
|
2
|
+
estimateTokens
|
|
3
|
+
} from "./index-4xyjr62e.js";
|
|
4
|
+
import {
|
|
5
|
+
expandToolPart,
|
|
6
|
+
visitRawSessionMessages2,
|
|
7
|
+
readRawSessionMessageById2
|
|
8
|
+
} from "./index-tn9drm1a.js";
|
|
9
|
+
import {
|
|
10
|
+
getTagById2
|
|
11
|
+
} from "./index-8jjjmhab.js";
|
|
12
|
+
|
|
13
|
+
// src/tools/ctx-expand/render.ts
|
|
14
|
+
import { createHash } from "node:crypto";
|
|
15
|
+
function recoveryParts(sessionId, message, attachments) {
|
|
16
|
+
return attachments ? [...message.parts, ...attachments(sessionId, message.id)] : message.parts;
|
|
17
|
+
}
|
|
18
|
+
function attachmentNotice(part) {
|
|
19
|
+
const field = (value) => typeof value === "string" ? value.trim().replace(/[\r\n]+/g, " ") : "";
|
|
20
|
+
const source = isRecord(part.source) ? part.source : {};
|
|
21
|
+
const location = [part.url, part.path, source.uri, source.url, source.path].map(field).find((value) => value && !/^(data|blob):/i.test(value));
|
|
22
|
+
const name = field(part.filename) || field(part.name);
|
|
23
|
+
const mime = field(part.mime) || field(part.mimeType) || field(part.mediaType);
|
|
24
|
+
return `[file]${name ? ` ${name}` : ""}${mime ? ` (${mime})` : ""}` + `${location ? ` — stored location: ${location}` : ""}` + "; content not recovered. If needed, ask the user to attach it again.";
|
|
25
|
+
}
|
|
26
|
+
function isRecord(value) {
|
|
27
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
28
|
+
}
|
|
29
|
+
function roleLabel(role) {
|
|
30
|
+
if (role === "assistant")
|
|
31
|
+
return "A (assistant)";
|
|
32
|
+
if (role === "user")
|
|
33
|
+
return "U (user)";
|
|
34
|
+
return role;
|
|
35
|
+
}
|
|
36
|
+
function verboseRoleLabel(msg) {
|
|
37
|
+
if (msg.role === "user" && msg.parts.length > 0 && msg.parts.every((part) => {
|
|
38
|
+
if (!isRecord(part))
|
|
39
|
+
return false;
|
|
40
|
+
if (part.type === "tool_result")
|
|
41
|
+
return true;
|
|
42
|
+
return part.type === "tool" && asToolPart(part)?.output != null;
|
|
43
|
+
}))
|
|
44
|
+
return "tool results";
|
|
45
|
+
return roleLabel(msg.role);
|
|
46
|
+
}
|
|
47
|
+
function truncate(value, max) {
|
|
48
|
+
const t = value.trim();
|
|
49
|
+
return t.length <= max ? t : `${t.slice(0, max)}…`;
|
|
50
|
+
}
|
|
51
|
+
function keyArg(input) {
|
|
52
|
+
if (!input)
|
|
53
|
+
return "";
|
|
54
|
+
for (const k of ["filePath", "path", "pattern", "query", "symbol", "module", "action"]) {
|
|
55
|
+
const v = input[k];
|
|
56
|
+
if (typeof v === "string" && v.length > 0)
|
|
57
|
+
return truncate(v, 60);
|
|
58
|
+
}
|
|
59
|
+
if (typeof input.description === "string")
|
|
60
|
+
return truncate(input.description, 60);
|
|
61
|
+
return "";
|
|
62
|
+
}
|
|
63
|
+
function asToolPart(part) {
|
|
64
|
+
const type = typeof part.type === "string" ? part.type : "";
|
|
65
|
+
if (type === "tool") {
|
|
66
|
+
const state = isRecord(part.state) ? part.state : null;
|
|
67
|
+
const output = state && typeof state.output === "string" ? state.output : state && state.output != null ? JSON.stringify(state.output) : null;
|
|
68
|
+
const metadata = state && isRecord(state.metadata) ? state.metadata : null;
|
|
69
|
+
const title = state && typeof state.title === "string" && state.title || metadata && typeof metadata.title === "string" && metadata.title || null;
|
|
70
|
+
return {
|
|
71
|
+
name: typeof part.tool === "string" ? part.tool : "tool",
|
|
72
|
+
callId: typeof part.callID === "string" ? part.callID : "",
|
|
73
|
+
title,
|
|
74
|
+
input: state && isRecord(state.input) ? state.input : null,
|
|
75
|
+
output
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
if (type === "tool_use") {
|
|
79
|
+
return {
|
|
80
|
+
name: typeof part.name === "string" ? part.name : "tool",
|
|
81
|
+
callId: typeof part.id === "string" ? part.id : "",
|
|
82
|
+
title: null,
|
|
83
|
+
input: isRecord(part.input) ? part.input : null,
|
|
84
|
+
output: null
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
if (type === "tool_result") {
|
|
88
|
+
const content = part.content;
|
|
89
|
+
const output = typeof content === "string" ? content : content != null ? JSON.stringify(content) : null;
|
|
90
|
+
return {
|
|
91
|
+
name: "tool_result",
|
|
92
|
+
callId: typeof part.tool_use_id === "string" ? part.tool_use_id : "",
|
|
93
|
+
title: null,
|
|
94
|
+
input: null,
|
|
95
|
+
output
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
function textOf(part) {
|
|
101
|
+
if (part.type === "text" && typeof part.text === "string")
|
|
102
|
+
return part.text;
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
function reasoningOf(part) {
|
|
106
|
+
if ((part.type === "reasoning" || part.type === "thinking") && typeof part.text === "string") {
|
|
107
|
+
return part.text;
|
|
108
|
+
}
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
function renderPartPreview(part, expandTools) {
|
|
112
|
+
if (!isRecord(part))
|
|
113
|
+
return null;
|
|
114
|
+
const expansion = expandToolPart(part, expandTools, true);
|
|
115
|
+
if (expansion !== null)
|
|
116
|
+
return ` • tool ${part.tool}: ${expansion}`;
|
|
117
|
+
const text = textOf(part);
|
|
118
|
+
if (text !== null) {
|
|
119
|
+
const t = truncate(text, 200);
|
|
120
|
+
return t.length > 0 ? ` • ${t}` : null;
|
|
121
|
+
}
|
|
122
|
+
const tool = asToolPart(part);
|
|
123
|
+
if (tool) {
|
|
124
|
+
const arg = keyArg(tool.input);
|
|
125
|
+
const head = arg ? `${tool.name}(${arg})` : tool.name;
|
|
126
|
+
return tool.output !== null ? ` • tool ${head} → output ~${estimateTokens(tool.output)} tok` : ` • tool ${head}`;
|
|
127
|
+
}
|
|
128
|
+
const reasoning = reasoningOf(part);
|
|
129
|
+
if (reasoning !== null)
|
|
130
|
+
return ` • [reasoning] ${truncate(reasoning, 120)}`;
|
|
131
|
+
const type = typeof part.type === "string" ? part.type : "part";
|
|
132
|
+
if (type === "file" || type === "image")
|
|
133
|
+
return ` • ${attachmentNotice(part)}`;
|
|
134
|
+
if (type === "step-start" || type === "step-finish")
|
|
135
|
+
return null;
|
|
136
|
+
return ` • [${type}]`;
|
|
137
|
+
}
|
|
138
|
+
function renderPartFull(part) {
|
|
139
|
+
if (!isRecord(part))
|
|
140
|
+
return null;
|
|
141
|
+
const text = textOf(part);
|
|
142
|
+
if (text !== null) {
|
|
143
|
+
return text.trim().length > 0 ? ` [text]
|
|
144
|
+
${text}` : null;
|
|
145
|
+
}
|
|
146
|
+
const tool = asToolPart(part);
|
|
147
|
+
if (tool) {
|
|
148
|
+
const lines = [];
|
|
149
|
+
const idSuffix = tool.callId ? ` #${tool.callId}` : "";
|
|
150
|
+
lines.push(` [tool: ${tool.name}${idSuffix}]`);
|
|
151
|
+
if (tool.title && tool.title.trim().length > 0) {
|
|
152
|
+
lines.push(` description: ${tool.title.trim()}`);
|
|
153
|
+
}
|
|
154
|
+
if (tool.input)
|
|
155
|
+
lines.push(` input: ${JSON.stringify(tool.input)}`);
|
|
156
|
+
if (tool.output !== null)
|
|
157
|
+
lines.push(` output:
|
|
158
|
+
${tool.output}`);
|
|
159
|
+
return lines.join(`
|
|
160
|
+
`);
|
|
161
|
+
}
|
|
162
|
+
const type = typeof part.type === "string" ? part.type : "part";
|
|
163
|
+
if (type === "file" || type === "image")
|
|
164
|
+
return ` ${attachmentNotice(part)}`;
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
function renderMessageByOrdinal2(sessionId, ordinal, attachments) {
|
|
168
|
+
const found = [];
|
|
169
|
+
visitRawSessionMessages2(sessionId, ordinal, ordinal, (m) => {
|
|
170
|
+
if (m.ordinal === ordinal)
|
|
171
|
+
found.push(m);
|
|
172
|
+
return false;
|
|
173
|
+
});
|
|
174
|
+
const msg = found[0];
|
|
175
|
+
if (!msg) {
|
|
176
|
+
return `No message at ordinal ${ordinal} in this session's stored history — it was deleted ` + `(session prune/revert) or the ordinal is wrong, so it can't be recovered. ` + `Re-run the tool if you still need the data.`;
|
|
177
|
+
}
|
|
178
|
+
const rendered = recoveryParts(sessionId, msg, attachments).map(renderPartFull).filter((l) => l !== null);
|
|
179
|
+
const lines = [`[${msg.ordinal}] ${roleLabel(msg.role)} — full recovery:`, ""];
|
|
180
|
+
if (rendered.length === 0) {
|
|
181
|
+
lines.push(" (no recoverable content — message had only structural/reasoning parts)");
|
|
182
|
+
} else {
|
|
183
|
+
lines.push(...rendered);
|
|
184
|
+
}
|
|
185
|
+
return lines.join(`
|
|
186
|
+
`);
|
|
187
|
+
}
|
|
188
|
+
function renderVerboseRange(sessionId, start, end, tokenBudget, expandTools, attachments) {
|
|
189
|
+
const out = [];
|
|
190
|
+
let usedTokens = 0;
|
|
191
|
+
let lastOrdinal = start - 1;
|
|
192
|
+
let truncated = false;
|
|
193
|
+
visitRawSessionMessages2(sessionId, start, end, (msg) => {
|
|
194
|
+
const header = `[${msg.ordinal}] ${verboseRoleLabel(msg)}`;
|
|
195
|
+
const partLines = recoveryParts(sessionId, msg, attachments).map((part) => renderPartPreview(part, expandTools)).filter((l) => l !== null);
|
|
196
|
+
const block = partLines.length > 0 ? `${header}
|
|
197
|
+
${partLines.join(`
|
|
198
|
+
`)}` : header;
|
|
199
|
+
const blockTokens = estimateTokens(block);
|
|
200
|
+
if (usedTokens + blockTokens > tokenBudget && out.length > 0) {
|
|
201
|
+
truncated = true;
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
out.push(block);
|
|
205
|
+
usedTokens += blockTokens;
|
|
206
|
+
lastOrdinal = msg.ordinal;
|
|
207
|
+
return true;
|
|
208
|
+
});
|
|
209
|
+
return { text: out.join(`
|
|
210
|
+
|
|
211
|
+
`), lastOrdinal, truncated };
|
|
212
|
+
}
|
|
213
|
+
function renderVerboseRangeForTool2(sessionId, start, end, tokenBudget, expandTools, attachments) {
|
|
214
|
+
const v = renderVerboseRange(sessionId, start, end, tokenBudget, expandTools, attachments);
|
|
215
|
+
if (!v.text) {
|
|
216
|
+
return `No messages found in range ${start}-${end}. The range may be outside this session's history.`;
|
|
217
|
+
}
|
|
218
|
+
const out = [
|
|
219
|
+
`Messages ${start}-${v.lastOrdinal} (verbose). Recover any one in full with ctx_expand(message=<ordinal>):`,
|
|
220
|
+
"",
|
|
221
|
+
v.text
|
|
222
|
+
];
|
|
223
|
+
if (v.truncated) {
|
|
224
|
+
out.push("", `Truncated at message ${v.lastOrdinal} (budget: ~${tokenBudget} tokens). Call again with start=${v.lastOrdinal + 1} end=${end} verbose=true for more.`);
|
|
225
|
+
}
|
|
226
|
+
return out.join(`
|
|
227
|
+
`);
|
|
228
|
+
}
|
|
229
|
+
function renderItemByTag2(db, sessionId, number, textIndexDomain = "part", attachments) {
|
|
230
|
+
const tag = getTagById2(db, sessionId, number);
|
|
231
|
+
if (!tag)
|
|
232
|
+
return `no tag ${number} in this session; if ${number} came from a <session-history> heading or a ctx_search hit, it is an ordinal: use message=${number}`;
|
|
233
|
+
if (tag.type === "tool") {
|
|
234
|
+
const owner = tag.toolOwnerMessageId;
|
|
235
|
+
if (!owner)
|
|
236
|
+
return `Tag ${number}'s tool owner is unknown; its original call cannot be resolved safely.`;
|
|
237
|
+
const message = readRawSessionMessageById2(sessionId, owner);
|
|
238
|
+
if (!message)
|
|
239
|
+
return `Tag ${number}'s original tool owner is no longer in stored history.`;
|
|
240
|
+
const parts = message?.parts.filter((part) => isRecord(part) && asToolPart(part)?.callId === tag.messageId) ?? [];
|
|
241
|
+
if (!parts.some((part) => isRecord(part) && asToolPart(part)?.output !== null)) {
|
|
242
|
+
visitRawSessionMessages2(sessionId, message.ordinal + 1, Number.MAX_SAFE_INTEGER, (candidate) => {
|
|
243
|
+
const matching = candidate.parts.filter((part) => isRecord(part) && asToolPart(part)?.callId === tag.messageId);
|
|
244
|
+
if (matching.some((part) => isRecord(part) && part.type === "tool_use"))
|
|
245
|
+
return false;
|
|
246
|
+
parts.push(...matching);
|
|
247
|
+
return matching.length === 0;
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
const rendered = parts.map(renderPartFull).filter((part) => part !== null);
|
|
251
|
+
return rendered.length ? rendered.join(`
|
|
252
|
+
`) : `Tag ${number}'s original tool call is no longer in stored history.`;
|
|
253
|
+
}
|
|
254
|
+
const scoped = /^(.*):(?:p|file)(\d+)$/.exec(tag.messageId);
|
|
255
|
+
const derived = /^(.*):mc-text-v1:([a-f0-9]+):([a-f0-9]+):o(\d+)$/.exec(tag.messageId);
|
|
256
|
+
const owner = scoped?.[1] ?? derived?.[1] ?? tag.messageId;
|
|
257
|
+
const message = readRawSessionMessageById2(sessionId, owner);
|
|
258
|
+
if (!message)
|
|
259
|
+
return `Tag ${number}'s original text is no longer in stored history.`;
|
|
260
|
+
const index = scoped ? Number(scoped[2]) : 0;
|
|
261
|
+
const attached = attachments?.(sessionId, message.id) ?? [];
|
|
262
|
+
const parts = [...message.parts, ...attached];
|
|
263
|
+
const piText = parts.filter((part) => isRecord(part) && part.type === "text");
|
|
264
|
+
const part = tag.type === "file" ? attached.find((part) => isRecord(part) && part.partIndex === index) ?? message.parts[index] : parts[index];
|
|
265
|
+
const matching = derived ? piText.filter((part) => isRecord(part) && typeof part.text === "string" && createHash("sha256").update(part.text).digest("hex") === derived[3]) : [];
|
|
266
|
+
const selected = derived ? matching[Number(derived[4])] : textIndexDomain === "text" && tag.type !== "file" ? piText[index] : part;
|
|
267
|
+
return selected ? renderPartFull(selected) ?? "" : `Tag ${number}'s original text part is no longer in stored history.`;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export { renderMessageByOrdinal2, renderVerboseRangeForTool2, renderItemByTag2 };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
importPluginModule,
|
|
3
3
|
log2
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-jrfre9ah.js";
|
|
5
5
|
import {
|
|
6
6
|
sendStatusNotification2
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-ae1ar4v1.js";
|
|
8
8
|
import {
|
|
9
9
|
formatConflictShort
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-hacf2tyx.js";
|
|
11
11
|
|
|
12
12
|
// src/plugin/conflict-warning-hook.ts
|
|
13
13
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -4,232 +4,15 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
getMagicContextLogPath
|
|
6
6
|
} from "./index-g2q4htwp.js";
|
|
7
|
+
import {
|
|
8
|
+
sanitizeDiagnosticText,
|
|
9
|
+
sanitizeConfigValue
|
|
10
|
+
} from "./index-z4p0ry94.js";
|
|
7
11
|
|
|
8
12
|
// src/shared/logger.ts
|
|
9
13
|
import * as fs from "node:fs";
|
|
10
14
|
import * as path from "node:path";
|
|
11
15
|
|
|
12
|
-
// src/shared/redaction.ts
|
|
13
|
-
import { homedir, userInfo } from "node:os";
|
|
14
|
-
function escapeRegex(value) {
|
|
15
|
-
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
16
|
-
}
|
|
17
|
-
var SECRET_WORDS = [
|
|
18
|
-
"key",
|
|
19
|
-
"token",
|
|
20
|
-
"secret",
|
|
21
|
-
"password",
|
|
22
|
-
"auth",
|
|
23
|
-
"authorization",
|
|
24
|
-
"bearer",
|
|
25
|
-
"credential"
|
|
26
|
-
];
|
|
27
|
-
var SECRET_SEGMENT_PATTERN = new RegExp(`^(?:${SECRET_WORDS.map((w) => `${w}s?`).join("|")})$`, "i");
|
|
28
|
-
var TRAILING_DESCRIPTORS = new Set(["id", "ids", "value", "values", "header", "headers"]);
|
|
29
|
-
function redactionTypeForKey(key) {
|
|
30
|
-
const normalized = key.trim().toLowerCase().replace(/[^a-z0-9_.-]+/g, "_");
|
|
31
|
-
const suffix = normalized.split(".").filter(Boolean).at(-1) ?? normalized;
|
|
32
|
-
return suffix || "secret";
|
|
33
|
-
}
|
|
34
|
-
function isNonSecretScalarValue(value) {
|
|
35
|
-
const v = value.trim();
|
|
36
|
-
if (v === "true" || v === "false" || v === "null" || v === "undefined")
|
|
37
|
-
return true;
|
|
38
|
-
return /^[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?$/.test(v);
|
|
39
|
-
}
|
|
40
|
-
var SECRET_QUALIFIERS = new Set([
|
|
41
|
-
"api",
|
|
42
|
-
"access",
|
|
43
|
-
"private",
|
|
44
|
-
"client",
|
|
45
|
-
"auth",
|
|
46
|
-
"authorization",
|
|
47
|
-
"secret",
|
|
48
|
-
"bearer",
|
|
49
|
-
"session",
|
|
50
|
-
"refresh",
|
|
51
|
-
"service",
|
|
52
|
-
"x",
|
|
53
|
-
"openai",
|
|
54
|
-
"anthropic",
|
|
55
|
-
"google",
|
|
56
|
-
"github",
|
|
57
|
-
"huggingface",
|
|
58
|
-
"aws",
|
|
59
|
-
"azure",
|
|
60
|
-
"id"
|
|
61
|
-
]);
|
|
62
|
-
var UNQUALIFIED_SECRET_SEGMENT_PATTERN = /^(?:password|secret|credential|bearer|authorization)s?$/;
|
|
63
|
-
function isSecretKey(key) {
|
|
64
|
-
const segments = key.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toLowerCase().split(/[._-]+/).filter(Boolean);
|
|
65
|
-
if (segments.length === 0)
|
|
66
|
-
return false;
|
|
67
|
-
if (segments.length === 1) {
|
|
68
|
-
const first = segments[0];
|
|
69
|
-
return Boolean(first && SECRET_SEGMENT_PATTERN.test(first));
|
|
70
|
-
}
|
|
71
|
-
for (let i = 0;i < segments.length; i++) {
|
|
72
|
-
const seg = segments[i];
|
|
73
|
-
if (!seg || !SECRET_SEGMENT_PATTERN.test(seg))
|
|
74
|
-
continue;
|
|
75
|
-
let trailingOk = true;
|
|
76
|
-
for (let j = i + 1;j < segments.length; j++) {
|
|
77
|
-
const tail = segments[j];
|
|
78
|
-
if (!tail)
|
|
79
|
-
continue;
|
|
80
|
-
if (TRAILING_DESCRIPTORS.has(tail))
|
|
81
|
-
continue;
|
|
82
|
-
if (SECRET_SEGMENT_PATTERN.test(tail))
|
|
83
|
-
continue;
|
|
84
|
-
trailingOk = false;
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
if (!trailingOk)
|
|
88
|
-
continue;
|
|
89
|
-
if (UNQUALIFIED_SECRET_SEGMENT_PATTERN.test(seg))
|
|
90
|
-
return true;
|
|
91
|
-
for (let k = i - 1;k >= 0; k--) {
|
|
92
|
-
const lead = segments[k];
|
|
93
|
-
if (lead && SECRET_QUALIFIERS.has(lead))
|
|
94
|
-
return true;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return false;
|
|
98
|
-
}
|
|
99
|
-
function sanitizePathString(value) {
|
|
100
|
-
const home = process.env.HOME || process.env.USERPROFILE || homedir();
|
|
101
|
-
const username = userInfo().username;
|
|
102
|
-
let sanitized = value;
|
|
103
|
-
if (home) {
|
|
104
|
-
sanitized = sanitized.replace(new RegExp(escapeRegex(home), "g"), "~");
|
|
105
|
-
}
|
|
106
|
-
sanitized = sanitized.replace(/\/Users\/[^/]+\//g, "/Users/<USER>/");
|
|
107
|
-
sanitized = sanitized.replace(/\/home\/[^/]+\//g, "/home/<USER>/");
|
|
108
|
-
sanitized = sanitized.replace(/C:\\Users\\[^\\]+\\/g, "C:\\Users\\<USER>\\");
|
|
109
|
-
if (username) {
|
|
110
|
-
sanitized = sanitized.replace(new RegExp(escapeRegex(username), "g"), "<USER>");
|
|
111
|
-
}
|
|
112
|
-
return sanitized;
|
|
113
|
-
}
|
|
114
|
-
var SECRET_TEXT_PATTERNS = [
|
|
115
|
-
{
|
|
116
|
-
pattern: /\bsk-ant-(?:api03-)?[A-Za-z0-9_-]{32,}/g,
|
|
117
|
-
replacement: "<ANTHROPIC_API_KEY_REDACTED>"
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
pattern: /\bsk-(?:proj-)?[A-Za-z0-9_-]{12,}/g,
|
|
121
|
-
replacement: "<OPENAI_API_KEY_REDACTED>"
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
pattern: /\bgithub_pat_[A-Za-z0-9_]{20,}/g,
|
|
125
|
-
replacement: "<GITHUB_PAT_REDACTED>"
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
pattern: /\b(?:gh[opsu]|ghr)_[A-Za-z0-9_-]{30,}/g,
|
|
129
|
-
replacement: "<GITHUB_TOKEN_REDACTED>"
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
pattern: /\bhf_[A-Za-z0-9]{30,}/g,
|
|
133
|
-
replacement: "<HUGGINGFACE_TOKEN_REDACTED>"
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
pattern: /\b(?:AKIA|ASIA)[0-9A-Z]{16}\b/g,
|
|
137
|
-
replacement: "<AWS_ACCESS_KEY_ID_REDACTED>"
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
pattern: /\bxox[abprsuvc]-[A-Za-z0-9-]{10,}/g,
|
|
141
|
-
replacement: "<SLACK_TOKEN_REDACTED>"
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
pattern: /\bAIza[A-Za-z0-9_-]{35}\b/g,
|
|
145
|
-
replacement: "<GOOGLE_API_KEY_REDACTED>"
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
pattern: /\b(Authorization\s*:\s*Bearer\s+)([A-Za-z0-9._~+/=-]{8,})/gi,
|
|
149
|
-
replacement: (_full, prefix) => `${prefix}<REDACTED:bearer>`
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
pattern: /\b((?:Proxy-)?Authorization\s*:\s*(?:Basic|Digest|Token|Negotiate|NTLM)\s+)([A-Za-z0-9._~+/=-]{4,})/gi,
|
|
153
|
-
replacement: (_full, prefix) => `${prefix}<REDACTED:authorization>`
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
pattern: /\b((?:x-)?(?:api-?key|api-?token|auth-?token|access-?token)\s*:\s*)([^\s'"`,;<>]{6,})/gi,
|
|
157
|
-
replacement: (full, prefix, value) => isNonSecretScalarValue(value) ? full : `${prefix}<REDACTED:api_key>`
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
pattern: /\b((?:api[_-]?key|client[_-]?secret|access[_-]?token|token|secret|password|passwd|pwd)\s*:\s*)([^\s'"`,;<>]{6,})/gi,
|
|
161
|
-
replacement: (full, prefix, value) => isNonSecretScalarValue(value) ? full : `${prefix}<REDACTED:credential>`
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
pattern: /\b([a-z][a-z0-9+.-]*:\/\/[^\s/:@]+:)([^\s/@]+)(@)/gi,
|
|
165
|
-
replacement: (_full, prefix, _password, at) => `${prefix}<REDACTED:password>${at}`
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
pattern: /\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+/g,
|
|
169
|
-
replacement: "<JWT_REDACTED>"
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
pattern: /(["'])([^"']*(?:key|token|secret|password|auth|bearer|credential)[^"']*)\1(\s*:\s*)(["'])([^"']*)\4/gi,
|
|
173
|
-
replacement: (full, quote, key, separator, valueQuote, value) => isNonSecretScalarValue(value) ? full : `${quote}${key}${quote}${separator}${valueQuote}<REDACTED:${redactionTypeForKey(key)}>${valueQuote}`
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
pattern: /\b([A-Za-z0-9_.-]*(?:key|token|secret|password|auth|bearer|credential)[A-Za-z0-9_.-]*)\s*=\s*([^\s'"`]+)/gi,
|
|
177
|
-
replacement: (full, key, value) => isNonSecretScalarValue(value) ? full : `${key}=<REDACTED:${redactionTypeForKey(key)}>`
|
|
178
|
-
}
|
|
179
|
-
];
|
|
180
|
-
function redactSecretText(value) {
|
|
181
|
-
let redacted = value;
|
|
182
|
-
for (const { pattern, replacement } of SECRET_TEXT_PATTERNS) {
|
|
183
|
-
if (typeof replacement === "string") {
|
|
184
|
-
redacted = redacted.replace(pattern, replacement);
|
|
185
|
-
} else {
|
|
186
|
-
redacted = redacted.replace(pattern, replacement);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
return redacted;
|
|
190
|
-
}
|
|
191
|
-
function sanitizeDiagnosticText(value) {
|
|
192
|
-
return redactSecretText(sanitizePathString(value));
|
|
193
|
-
}
|
|
194
|
-
var SHAREABILITY_SENSITIVE_PATTERNS = [
|
|
195
|
-
/\bC:\/Users\/[^/\s]+/i,
|
|
196
|
-
/(?:^|\s)~\/[^\s]+/,
|
|
197
|
-
/\b(?:api[_-]?key|secret|token|password|passwd|pwd|client[_-]?secret|access[_-]?key)\b\s*[:=]\s*\S+/i,
|
|
198
|
-
/\b(?:localhost|127\.0\.0\.1|0\.0\.0\.0|\[::1\])(?::\d+)?\b/i,
|
|
199
|
-
/\b(?:10|127)\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/,
|
|
200
|
-
/\b192\.168\.\d{1,3}\.\d{1,3}\b/,
|
|
201
|
-
/\b172\.(?:1[6-9]|2\d|3[01])\.\d{1,3}\.\d{1,3}\b/
|
|
202
|
-
];
|
|
203
|
-
function hasShareabilitySensitiveText(text) {
|
|
204
|
-
try {
|
|
205
|
-
if (sanitizeDiagnosticText(text) !== text)
|
|
206
|
-
return true;
|
|
207
|
-
return SHAREABILITY_SENSITIVE_PATTERNS.some((pattern) => pattern.test(text));
|
|
208
|
-
} catch {
|
|
209
|
-
return true;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
function sanitizeConfigValue(value, keyPath = []) {
|
|
213
|
-
if (value === null || typeof value === "number" || typeof value === "boolean")
|
|
214
|
-
return value;
|
|
215
|
-
const key = keyPath.at(-1) ?? "";
|
|
216
|
-
if (key && isSecretKey(key)) {
|
|
217
|
-
return `<REDACTED:${redactionTypeForKey(key)}>`;
|
|
218
|
-
}
|
|
219
|
-
if (typeof value === "string")
|
|
220
|
-
return sanitizeDiagnosticText(value);
|
|
221
|
-
if (Array.isArray(value)) {
|
|
222
|
-
return value.map((entry, index) => sanitizeConfigValue(entry, [...keyPath, String(index)]));
|
|
223
|
-
}
|
|
224
|
-
if (value && typeof value === "object") {
|
|
225
|
-
return Object.fromEntries(Object.entries(value).map(([entryKey, entry]) => [
|
|
226
|
-
entryKey,
|
|
227
|
-
sanitizeConfigValue(entry, [...keyPath, entryKey])
|
|
228
|
-
]));
|
|
229
|
-
}
|
|
230
|
-
return value;
|
|
231
|
-
}
|
|
232
|
-
|
|
233
16
|
// src/shared/stale-plugin-build.ts
|
|
234
17
|
import { posix } from "node:path";
|
|
235
18
|
import { fileURLToPath } from "node:url";
|
|
@@ -558,4 +341,4 @@ if (!isTestEnv) {
|
|
|
558
341
|
process.on("exit", flush);
|
|
559
342
|
}
|
|
560
343
|
|
|
561
|
-
export {
|
|
344
|
+
export { registerStalePluginBuildHost, classifyStalePluginBuild, importPluginModule, setLogLineForwarder2, writeForwardedLogLine2, log2, sessionLog2, getLoggerDiagnostics2, flushLogger2, getLogFilePath2 };
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./index-pavzsdc6.js";
|
|
4
4
|
import {
|
|
5
5
|
isUserHomeDirectory
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-txs8tce6.js";
|
|
7
7
|
import {
|
|
8
8
|
logSlowWriteTransaction
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-fxbk7gk3.js";
|
|
10
10
|
|
|
11
11
|
// src/features/magic-context/session-project-storage.ts
|
|
12
12
|
var SESSION_CHUNK_REPAIR_BATCH_SIZE = 100;
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
} from "./index-fr0wbhdn.js";
|
|
4
4
|
import {
|
|
5
5
|
log2
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-jrfre9ah.js";
|
|
7
7
|
import {
|
|
8
8
|
ensureColumn,
|
|
9
9
|
healAllNullColumns,
|
|
10
10
|
installV95PerfSchema
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-9wnbnx8f.js";
|
|
12
12
|
import {
|
|
13
13
|
resolveOpenCodeDbPath,
|
|
14
14
|
openCodeDbPathExists,
|
|
@@ -20,10 +20,10 @@ import {
|
|
|
20
20
|
import {
|
|
21
21
|
normalizeStoredProjectPath,
|
|
22
22
|
storedPathBelongsToIdentity
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-txs8tce6.js";
|
|
24
24
|
import {
|
|
25
25
|
logSlowWriteTransaction
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-fxbk7gk3.js";
|
|
27
27
|
|
|
28
28
|
// src/features/magic-context/lkg-prefix-chunks.ts
|
|
29
29
|
import { createHash } from "node:crypto";
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
sessionLog2
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-jrfre9ah.js";
|
|
4
4
|
import {
|
|
5
5
|
COMPARTMENT_LEASE_RENEWAL_MS,
|
|
6
6
|
acquireCompartmentLease,
|
|
7
7
|
renewCompartmentLease,
|
|
8
8
|
releaseCompartmentLeaseBestEffort,
|
|
9
9
|
getCompartments,
|
|
10
|
-
getLastCompartmentEndMessage
|
|
11
|
-
|
|
12
|
-
resolveWrapupProtectedTailBoundary,
|
|
13
|
-
hasRunnableCompartmentWindow,
|
|
14
|
-
runCompartmentAgent,
|
|
15
|
-
getActiveCompartmentRun,
|
|
16
|
-
markActiveCompartmentRunPublished,
|
|
17
|
-
registerActiveCompartmentRun
|
|
18
|
-
} from "./index-atekmqef.js";
|
|
10
|
+
getLastCompartmentEndMessage
|
|
11
|
+
} from "./index-72czy45z.js";
|
|
19
12
|
import {
|
|
20
13
|
inRootAsyncContext2
|
|
21
14
|
} from "./index-gzy5w8ya.js";
|
|
@@ -27,17 +20,26 @@ import {
|
|
|
27
20
|
getHistorianFailureState,
|
|
28
21
|
clearEmergencyRecovery,
|
|
29
22
|
prepareRawSessionOrdinals2
|
|
30
|
-
} from "./index-
|
|
23
|
+
} from "./index-tn9drm1a.js";
|
|
31
24
|
import {
|
|
32
25
|
pushNotification2
|
|
33
26
|
} from "./index-x8a7jmkh.js";
|
|
27
|
+
import {
|
|
28
|
+
describeBoundaryDiagnostics,
|
|
29
|
+
resolveWrapupProtectedTailBoundary,
|
|
30
|
+
hasRunnableCompartmentWindow,
|
|
31
|
+
runCompartmentAgent,
|
|
32
|
+
getActiveCompartmentRun,
|
|
33
|
+
markActiveCompartmentRunPublished,
|
|
34
|
+
registerActiveCompartmentRun
|
|
35
|
+
} from "./index-9tdvbdv1.js";
|
|
34
36
|
import {
|
|
35
37
|
sendStatusNotification2
|
|
36
|
-
} from "./index-
|
|
38
|
+
} from "./index-ae1ar4v1.js";
|
|
37
39
|
import {
|
|
38
40
|
setRecompStarting2,
|
|
39
41
|
setRecompTerminal2
|
|
40
|
-
} from "./index-
|
|
42
|
+
} from "./index-ys7j6679.js";
|
|
41
43
|
|
|
42
44
|
// src/hooks/magic-context/wrapup-orchestrator.ts
|
|
43
45
|
import * as crypto from "node:crypto";
|