@theokit/sdk 4.37.1 → 4.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +77 -71
- package/dist/agent-2GZC4W2A.cjs +51 -0
- package/dist/{agent-4MHQUGO5.cjs.map → agent-2GZC4W2A.cjs.map} +1 -1
- package/dist/agent-3H3UKD6U.js +42 -0
- package/dist/{agent-GV36S2CF.js.map → agent-3H3UKD6U.js.map} +1 -1
- package/dist/{agent-SmxntivO.d.ts → agent-C3AEtM-W.d.ts} +39 -37
- package/dist/{agent-DGv1-d81.d.cts → agent-U3lBX-5t.d.cts} +39 -37
- package/dist/agent.d.ts +1 -1
- package/dist/auth/index.cjs +15 -15
- package/dist/auth/index.js +4 -4
- package/dist/{batch-SY5GZLFD.js → batch-LXSALQC3.js} +9 -9
- package/dist/{batch-SY5GZLFD.js.map → batch-LXSALQC3.js.map} +1 -1
- package/dist/{batch-3SEPDXCU.cjs → batch-NZGN6SFV.cjs} +23 -23
- package/dist/{batch-3SEPDXCU.cjs.map → batch-NZGN6SFV.cjs.map} +1 -1
- package/dist/{chunk-D4ZUJTFB.cjs → chunk-2K7PRHDB.cjs} +8 -8
- package/dist/{chunk-D4ZUJTFB.cjs.map → chunk-2K7PRHDB.cjs.map} +1 -1
- package/dist/chunk-2R6NBT5F.cjs +112 -0
- package/dist/chunk-2R6NBT5F.cjs.map +1 -0
- package/dist/{chunk-2423XDPT.cjs → chunk-3BSP7LSG.cjs} +26 -26
- package/dist/{chunk-2423XDPT.cjs.map → chunk-3BSP7LSG.cjs.map} +1 -1
- package/dist/{chunk-6EDQBX7U.cjs → chunk-3MUIYMUG.cjs} +17 -17
- package/dist/{chunk-6EDQBX7U.cjs.map → chunk-3MUIYMUG.cjs.map} +1 -1
- package/dist/{chunk-P34DHHYQ.cjs → chunk-3VKTDQMX.cjs} +34 -27
- package/dist/chunk-3VKTDQMX.cjs.map +1 -0
- package/dist/{chunk-77WHPVXE.js → chunk-3XKVRLR2.js} +4 -4
- package/dist/chunk-3XKVRLR2.js.map +1 -0
- package/dist/{chunk-SWIBQFPH.cjs → chunk-3XRXORBS.cjs} +4 -4
- package/dist/{chunk-SWIBQFPH.cjs.map → chunk-3XRXORBS.cjs.map} +1 -1
- package/dist/{chunk-DCJ5MCJ3.js → chunk-4APWS2YF.js} +7 -7
- package/dist/{chunk-DCJ5MCJ3.js.map → chunk-4APWS2YF.js.map} +1 -1
- package/dist/{chunk-56ZM6P7Z.cjs → chunk-4MWBKBS4.cjs} +12 -12
- package/dist/chunk-4MWBKBS4.cjs.map +1 -0
- package/dist/chunk-4NVV3GRU.js +110 -0
- package/dist/chunk-4NVV3GRU.js.map +1 -0
- package/dist/{chunk-QGDKZDPN.js → chunk-4WIJSKFA.js} +3 -3
- package/dist/{chunk-QGDKZDPN.js.map → chunk-4WIJSKFA.js.map} +1 -1
- package/dist/{chunk-VNNK6AKU.js → chunk-5BVBNE2F.js} +3 -3
- package/dist/chunk-5BVBNE2F.js.map +1 -0
- package/dist/{chunk-EEZ7CFMM.js → chunk-5KOW3GLE.js} +2 -2
- package/dist/chunk-5KOW3GLE.js.map +1 -0
- package/dist/{chunk-FK4EJD2I.cjs → chunk-6OIO4FYX.cjs} +7 -7
- package/dist/{chunk-FK4EJD2I.cjs.map → chunk-6OIO4FYX.cjs.map} +1 -1
- package/dist/{chunk-IEUDKUPM.cjs → chunk-6OKPJZMX.cjs} +8 -8
- package/dist/{chunk-IEUDKUPM.cjs.map → chunk-6OKPJZMX.cjs.map} +1 -1
- package/dist/{chunk-QFMXXUUT.js → chunk-6XZBKFQ7.js} +3 -3
- package/dist/{chunk-QFMXXUUT.js.map → chunk-6XZBKFQ7.js.map} +1 -1
- package/dist/{chunk-H5YVJB4K.cjs → chunk-6ZGD7R27.cjs} +37 -37
- package/dist/chunk-6ZGD7R27.cjs.map +1 -0
- package/dist/{chunk-HEN5WXXI.js → chunk-7QDTZJRV.js} +6 -6
- package/dist/{chunk-HEN5WXXI.js.map → chunk-7QDTZJRV.js.map} +1 -1
- package/dist/{chunk-MHCKWQR3.cjs → chunk-A3MHE2MQ.cjs} +8 -8
- package/dist/{chunk-MHCKWQR3.cjs.map → chunk-A3MHE2MQ.cjs.map} +1 -1
- package/dist/{chunk-5SB4V74H.js → chunk-A4XXV2C6.js} +18 -18
- package/dist/chunk-A4XXV2C6.js.map +1 -0
- package/dist/{chunk-6VP3XGEK.js → chunk-A6GXYF2Q.js} +9 -9
- package/dist/{chunk-6VP3XGEK.js.map → chunk-A6GXYF2Q.js.map} +1 -1
- package/dist/{chunk-SDIBMLL5.js → chunk-ACHGT3D2.js} +8 -8
- package/dist/{chunk-SDIBMLL5.js.map → chunk-ACHGT3D2.js.map} +1 -1
- package/dist/{chunk-XAEAMI5H.js → chunk-AOZYORH7.js} +4 -4
- package/dist/chunk-AOZYORH7.js.map +1 -0
- package/dist/{chunk-LTCOPATU.cjs → chunk-BE3W4HYV.cjs} +2 -2
- package/dist/chunk-BE3W4HYV.cjs.map +1 -0
- package/dist/{chunk-NQ4AC2U4.cjs → chunk-BT6DFWZB.cjs} +9 -9
- package/dist/{chunk-NQ4AC2U4.cjs.map → chunk-BT6DFWZB.cjs.map} +1 -1
- package/dist/{chunk-XAYVHS2B.cjs → chunk-BUGVDCI5.cjs} +4 -4
- package/dist/{chunk-XAYVHS2B.cjs.map → chunk-BUGVDCI5.cjs.map} +1 -1
- package/dist/{chunk-IT3PWBW4.cjs → chunk-BURYFNOM.cjs} +2 -2
- package/dist/chunk-BURYFNOM.cjs.map +1 -0
- package/dist/{chunk-NNSKJCBM.cjs → chunk-D3SJLXYZ.cjs} +10 -10
- package/dist/{chunk-NNSKJCBM.cjs.map → chunk-D3SJLXYZ.cjs.map} +1 -1
- package/dist/{chunk-MRODLUGY.cjs → chunk-ED7ANP6W.cjs} +4 -4
- package/dist/{chunk-MRODLUGY.cjs.map → chunk-ED7ANP6W.cjs.map} +1 -1
- package/dist/{chunk-MXSMAGDU.js → chunk-EDI7DBWO.js} +33 -26
- package/dist/chunk-EDI7DBWO.js.map +1 -0
- package/dist/{chunk-SSH2ZAZF.js → chunk-EE24WJJR.js} +5 -5
- package/dist/{chunk-SSH2ZAZF.js.map → chunk-EE24WJJR.js.map} +1 -1
- package/dist/{chunk-ZJN6NTHE.js → chunk-EUB7YLU2.js} +3 -3
- package/dist/{chunk-ZJN6NTHE.js.map → chunk-EUB7YLU2.js.map} +1 -1
- package/dist/{chunk-ALU3KC4G.cjs → chunk-G7X2Y7Y2.cjs} +156 -156
- package/dist/chunk-G7X2Y7Y2.cjs.map +1 -0
- package/dist/{chunk-YCXMSDSP.js → chunk-HHUDNTZC.js} +4 -4
- package/dist/{chunk-YCXMSDSP.js.map → chunk-HHUDNTZC.js.map} +1 -1
- package/dist/{chunk-GL7CFBVC.js → chunk-HI6G3SNY.js} +48 -48
- package/dist/chunk-HI6G3SNY.js.map +1 -0
- package/dist/{chunk-KDDL5HKQ.cjs → chunk-HLK35TD7.cjs} +24 -24
- package/dist/{chunk-KDDL5HKQ.cjs.map → chunk-HLK35TD7.cjs.map} +1 -1
- package/dist/{chunk-4YB7B3RP.cjs → chunk-IBDE4R5L.cjs} +13 -13
- package/dist/{chunk-4YB7B3RP.cjs.map → chunk-IBDE4R5L.cjs.map} +1 -1
- package/dist/{chunk-WDGCZDRG.js → chunk-JCXIDFRI.js} +3 -3
- package/dist/{chunk-WDGCZDRG.js.map → chunk-JCXIDFRI.js.map} +1 -1
- package/dist/{chunk-I35DI7ES.js → chunk-JI34KBNC.js} +3 -3
- package/dist/{chunk-I35DI7ES.js.map → chunk-JI34KBNC.js.map} +1 -1
- package/dist/{chunk-TAPQWDW2.js → chunk-KCZW75PI.js} +2 -2
- package/dist/chunk-KCZW75PI.js.map +1 -0
- package/dist/{chunk-U2WLFOA3.cjs → chunk-KL7E244K.cjs} +4 -4
- package/dist/{chunk-U2WLFOA3.cjs.map → chunk-KL7E244K.cjs.map} +1 -1
- package/dist/{chunk-PAEJPLVN.cjs → chunk-KTXOHCAE.cjs} +4 -4
- package/dist/{chunk-PAEJPLVN.cjs.map → chunk-KTXOHCAE.cjs.map} +1 -1
- package/dist/{chunk-2WFB5ZOX.js → chunk-KWXC6ERT.js} +5 -5
- package/dist/{chunk-2WFB5ZOX.js.map → chunk-KWXC6ERT.js.map} +1 -1
- package/dist/{chunk-56OXYUZE.js → chunk-LGCEYEU2.js} +3 -3
- package/dist/chunk-LGCEYEU2.js.map +1 -0
- package/dist/{chunk-FAY3QDGC.cjs → chunk-M4OGSS66.cjs} +11 -11
- package/dist/{chunk-FAY3QDGC.cjs.map → chunk-M4OGSS66.cjs.map} +1 -1
- package/dist/{chunk-F6Y4IEQM.js → chunk-M6UUTNDT.js} +4 -4
- package/dist/{chunk-F6Y4IEQM.js.map → chunk-M6UUTNDT.js.map} +1 -1
- package/dist/{chunk-GM7QDQ24.cjs → chunk-MXRBNJ6D.cjs} +11 -11
- package/dist/{chunk-GM7QDQ24.cjs.map → chunk-MXRBNJ6D.cjs.map} +1 -1
- package/dist/{chunk-YPQF26X7.cjs → chunk-OBA6YK2R.cjs} +2 -2
- package/dist/chunk-OBA6YK2R.cjs.map +1 -0
- package/dist/{chunk-BJMKQOY2.cjs → chunk-OFWU6UKF.cjs} +11 -11
- package/dist/{chunk-BJMKQOY2.cjs.map → chunk-OFWU6UKF.cjs.map} +1 -1
- package/dist/{chunk-3O2ELBST.cjs → chunk-PG3QQLWS.cjs} +5 -5
- package/dist/{chunk-3O2ELBST.cjs.map → chunk-PG3QQLWS.cjs.map} +1 -1
- package/dist/{chunk-2ONFGMBV.js → chunk-PY2RQOA7.js} +2 -2
- package/dist/chunk-PY2RQOA7.js.map +1 -0
- package/dist/{chunk-UQPDFW4E.js → chunk-QFWQLXCL.js} +3 -3
- package/dist/{chunk-UQPDFW4E.js.map → chunk-QFWQLXCL.js.map} +1 -1
- package/dist/{chunk-YBFDBOUN.cjs → chunk-QJQ2MAZF.cjs} +8 -8
- package/dist/{chunk-YBFDBOUN.cjs.map → chunk-QJQ2MAZF.cjs.map} +1 -1
- package/dist/{chunk-QUFSDDNU.cjs → chunk-R4AMI7KD.cjs} +15 -15
- package/dist/{chunk-QUFSDDNU.cjs.map → chunk-R4AMI7KD.cjs.map} +1 -1
- package/dist/{chunk-CSZRJ4RE.js → chunk-SGTMDQ4O.js} +5 -5
- package/dist/{chunk-CSZRJ4RE.js.map → chunk-SGTMDQ4O.js.map} +1 -1
- package/dist/{chunk-3ILFUXNE.cjs → chunk-SRIF7HMN.cjs} +5 -5
- package/dist/{chunk-3ILFUXNE.cjs.map → chunk-SRIF7HMN.cjs.map} +1 -1
- package/dist/{chunk-THEYGCYS.cjs → chunk-TKDWD3MU.cjs} +4 -4
- package/dist/chunk-TKDWD3MU.cjs.map +1 -0
- package/dist/{chunk-ZW345YOI.js → chunk-UD2T7ISG.js} +4 -4
- package/dist/{chunk-ZW345YOI.js.map → chunk-UD2T7ISG.js.map} +1 -1
- package/dist/{chunk-EXQV452X.js → chunk-UWEALKAN.js} +3 -3
- package/dist/{chunk-EXQV452X.js.map → chunk-UWEALKAN.js.map} +1 -1
- package/dist/{chunk-S3WZ7NHF.cjs → chunk-UZBA6YYP.cjs} +472 -326
- package/dist/chunk-UZBA6YYP.cjs.map +1 -0
- package/dist/{chunk-XJLGRJ7K.js → chunk-VUDH4D2M.js} +221 -75
- package/dist/chunk-VUDH4D2M.js.map +1 -0
- package/dist/{chunk-W4QN5CMG.cjs → chunk-VVMLMKYZ.cjs} +9 -9
- package/dist/{chunk-W4QN5CMG.cjs.map → chunk-VVMLMKYZ.cjs.map} +1 -1
- package/dist/{chunk-JNIWFCKI.js → chunk-VYD6BGKK.js} +3 -3
- package/dist/{chunk-JNIWFCKI.js.map → chunk-VYD6BGKK.js.map} +1 -1
- package/dist/{chunk-YHZXBDAW.js → chunk-XJ5TMOGA.js} +16 -16
- package/dist/{chunk-YHZXBDAW.js.map → chunk-XJ5TMOGA.js.map} +1 -1
- package/dist/{chunk-7DXLNNKH.cjs → chunk-XKBJT7WI.cjs} +4 -4
- package/dist/{chunk-7DXLNNKH.cjs.map → chunk-XKBJT7WI.cjs.map} +1 -1
- package/dist/{chunk-YDLNI7J6.js → chunk-XS7SKY2F.js} +3 -3
- package/dist/{chunk-YDLNI7J6.js.map → chunk-XS7SKY2F.js.map} +1 -1
- package/dist/{chunk-NFCKEBHI.js → chunk-YCHC45BY.js} +3 -3
- package/dist/{chunk-NFCKEBHI.js.map → chunk-YCHC45BY.js.map} +1 -1
- package/dist/{chunk-ICYBIC6N.cjs → chunk-YVI4YPUP.cjs} +4 -4
- package/dist/chunk-YVI4YPUP.cjs.map +1 -0
- package/dist/{chunk-TQI3KRXZ.cjs → chunk-ZET34IZE.cjs} +18 -18
- package/dist/{chunk-TQI3KRXZ.cjs.map → chunk-ZET34IZE.cjs.map} +1 -1
- package/dist/{chunk-GLUWH6JO.js → chunk-ZFZYPLQI.js} +4 -4
- package/dist/{chunk-GLUWH6JO.js.map → chunk-ZFZYPLQI.js.map} +1 -1
- package/dist/{chunk-M5ZQBOIZ.js → chunk-ZK3BJ4XQ.js} +3 -3
- package/dist/{chunk-M5ZQBOIZ.js.map → chunk-ZK3BJ4XQ.js.map} +1 -1
- package/dist/{chunk-CD73YHEH.js → chunk-ZYOHF37V.js} +3 -3
- package/dist/{chunk-CD73YHEH.js.map → chunk-ZYOHF37V.js.map} +1 -1
- package/dist/compact-session-RR3ILTES.js +17 -0
- package/dist/{compact-session-WNKKIIDW.js.map → compact-session-RR3ILTES.js.map} +1 -1
- package/dist/compact-session-YOWJJPPB.cjs +54 -0
- package/dist/{compact-session-H5TKLD55.cjs.map → compact-session-YOWJJPPB.cjs.map} +1 -1
- package/dist/compaction.cjs +19 -19
- package/dist/compaction.d.cts +9 -9
- package/dist/compaction.d.ts +9 -9
- package/dist/compaction.js +3 -3
- package/dist/concurrency.cjs +6 -6
- package/dist/concurrency.js +4 -4
- package/dist/context-Q6ISOCN2.cjs +22 -0
- package/dist/{context-ZV33V4DC.cjs.map → context-Q6ISOCN2.cjs.map} +1 -1
- package/dist/context-ZDBBPIHY.js +5 -0
- package/dist/{context-VAYLPT4O.js.map → context-ZDBBPIHY.js.map} +1 -1
- package/dist/{cron-BiK_aNJI.d.cts → cron-BdXOZco9.d.cts} +2 -2
- package/dist/{cron-Dx7B-3WB.d.ts → cron-ChQ6zcW2.d.ts} +2 -2
- package/dist/cron.cjs +29 -29
- package/dist/cron.d.cts +3 -3
- package/dist/cron.d.ts +3 -3
- package/dist/cron.js +28 -28
- package/dist/{errors-DyVbXdR4.d.cts → errors-BUVjJGJA.d.cts} +1 -1
- package/dist/{errors-Cua4WC9H.d.ts → errors-CZIUKLHt.d.ts} +1 -1
- package/dist/errors.cjs +21 -21
- package/dist/errors.d.cts +2 -2
- package/dist/errors.d.ts +2 -2
- package/dist/errors.js +2 -2
- package/dist/eval.cjs +32 -32
- package/dist/eval.js +28 -28
- package/dist/{executor-PAH72CB5.js → executor-ASDDIM2X.js} +7 -7
- package/dist/{executor-PAH72CB5.js.map → executor-ASDDIM2X.js.map} +1 -1
- package/dist/{executor-OZSYXDKF.cjs → executor-DPCBSI35.cjs} +23 -23
- package/dist/{executor-OZSYXDKF.cjs.map → executor-DPCBSI35.cjs.map} +1 -1
- package/dist/filesystem/index.cjs +7 -7
- package/dist/filesystem/index.js +3 -3
- package/dist/fs-session-store-K5QUPNJZ.js +10 -0
- package/dist/{fs-session-store-6MY7PNI2.js.map → fs-session-store-K5QUPNJZ.js.map} +1 -1
- package/dist/fs-session-store-T5ZLQX42.cjs +19 -0
- package/dist/{fs-session-store-7E7UPLF2.cjs.map → fs-session-store-T5ZLQX42.cjs.map} +1 -1
- package/dist/generate-object-F56VIZ6U.cjs +20 -0
- package/dist/{generate-object-5SCEH2EE.cjs.map → generate-object-F56VIZ6U.cjs.map} +1 -1
- package/dist/generate-object-LPSO6GVW.js +7 -0
- package/dist/{generate-object-I7UD4NWN.js.map → generate-object-LPSO6GVW.js.map} +1 -1
- package/dist/index-manager-DBJ55ZSO.cjs +19 -0
- package/dist/{index-manager-R6ZJFEZF.cjs.map → index-manager-DBJ55ZSO.cjs.map} +1 -1
- package/dist/index-manager-F2H2RCZU.js +10 -0
- package/dist/{index-manager-KKAK7NT3.js.map → index-manager-F2H2RCZU.js.map} +1 -1
- package/dist/index.cjs +140 -140
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -42
- package/dist/index.d.ts +42 -42
- package/dist/index.js +54 -54
- package/dist/index.js.map +1 -1
- package/dist/{inject-session-DM4SKTZO.cjs → inject-session-25EC74WV.cjs} +10 -10
- package/dist/{inject-session-DM4SKTZO.cjs.map → inject-session-25EC74WV.cjs.map} +1 -1
- package/dist/{inject-session-UXNJQTZ6.js → inject-session-RKNLUE72.js} +7 -7
- package/dist/{inject-session-UXNJQTZ6.js.map → inject-session-RKNLUE72.js.map} +1 -1
- package/dist/internal/agent-loop/live-events.d.ts +46 -0
- package/dist/internal/budget/compute-cost.d.ts +1 -1
- package/dist/internal/diagnostics.d.ts +31 -29
- package/dist/internal/error-mappers/anthropic.d.ts +1 -1
- package/dist/internal/global-singleton.d.ts +7 -7
- package/dist/internal/judge/judge-call.d.ts +14 -14
- package/dist/internal/llm/retrying-client.d.ts +29 -29
- package/dist/internal/llm/transport-error.d.ts +2 -2
- package/dist/internal/persistence/exclusive-create.d.cts +2 -2
- package/dist/internal/persistence/exclusive-create.d.ts +2 -2
- package/dist/internal/persistence/fs-session-store.d.cts +18 -18
- package/dist/internal/persistence/fs-session-store.d.ts +18 -18
- package/dist/internal/persistence/index.cjs +25 -25
- package/dist/internal/persistence/index.cjs.map +1 -1
- package/dist/internal/persistence/index.js +6 -6
- package/dist/internal/persistence/index.js.map +1 -1
- package/dist/internal/persistence/paths.d.cts +7 -7
- package/dist/internal/persistence/paths.d.ts +7 -7
- package/dist/internal/persistence/session-transcript.d.cts +7 -7
- package/dist/internal/persistence/session-transcript.d.ts +7 -7
- package/dist/internal/persistence/session-writer.d.cts +30 -13
- package/dist/internal/persistence/session-writer.d.ts +30 -13
- package/dist/internal/runtime/fixtures/fixture-run-base.d.ts +45 -13
- package/dist/internal/runtime/lifecycle/goal-marker.d.ts +8 -8
- package/dist/internal/security/index.cjs +13 -13
- package/dist/internal/security/index.js +3 -3
- package/dist/internal/session/agent-session.d.ts +14 -14
- package/dist/internal/session/session-cache.d.ts +9 -9
- package/dist/judge-call-3S3T6O2Z.js +5 -0
- package/dist/{judge-call-TAEIXMYG.js.map → judge-call-3S3T6O2Z.js.map} +1 -1
- package/dist/judge-call-XIQJ5GIE.cjs +22 -0
- package/dist/{judge-call-SP3G3X2Y.cjs.map → judge-call-XIQJ5GIE.cjs.map} +1 -1
- package/dist/models.cjs +20 -20
- package/dist/models.cjs.map +1 -1
- package/dist/models.js +5 -5
- package/dist/models.js.map +1 -1
- package/dist/path-safety.cjs +10 -10
- package/dist/path-safety.js +3 -3
- package/dist/persistence.cjs +34 -34
- package/dist/persistence.cjs.map +1 -1
- package/dist/persistence.d.cts +1 -1
- package/dist/persistence.d.ts +1 -1
- package/dist/persistence.js +14 -14
- package/dist/persistence.js.map +1 -1
- package/dist/project.cjs +5 -5
- package/dist/project.js +3 -3
- package/dist/registry-BA3SLAN7.cjs +46 -0
- package/dist/{registry-N3GTKYCI.cjs.map → registry-BA3SLAN7.cjs.map} +1 -1
- package/dist/registry-KMI5RA22.js +9 -0
- package/dist/{registry-SOXE4RY6.js.map → registry-KMI5RA22.js.map} +1 -1
- package/dist/retry.cjs +4 -4
- package/dist/retry.js +3 -3
- package/dist/{run-until-YZ2ODWOF.js → run-until-BK56WG4P.js} +3 -3
- package/dist/{run-until-YZ2ODWOF.js.map → run-until-BK56WG4P.js.map} +1 -1
- package/dist/{run-until-ZZ2JLPJM.cjs → run-until-L5KQD3PV.cjs} +4 -4
- package/dist/{run-until-ZZ2JLPJM.cjs.map → run-until-L5KQD3PV.cjs.map} +1 -1
- package/dist/{run-CwEJtLPE.d.ts → run-vJHg2eGw.d.cts} +201 -174
- package/dist/{run-CwEJtLPE.d.cts → run-vJHg2eGw.d.ts} +201 -174
- package/dist/sandbox/bwrap.d.cts +20 -20
- package/dist/sandbox/bwrap.d.ts +20 -20
- package/dist/sandbox/index.cjs +39 -39
- package/dist/sandbox/index.cjs.map +1 -1
- package/dist/sandbox/index.d.cts +1 -1
- package/dist/sandbox/index.d.ts +1 -1
- package/dist/sandbox/index.js +35 -35
- package/dist/sandbox/index.js.map +1 -1
- package/dist/sandbox/linux-sandbox.d.cts +26 -21
- package/dist/sandbox/linux-sandbox.d.ts +26 -21
- package/dist/server/auth/index.cjs.map +1 -1
- package/dist/server/auth/index.d.cts +6 -6
- package/dist/server/auth/index.d.ts +6 -6
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/auth/orchestrator.d.cts +2 -2
- package/dist/server/auth/orchestrator.d.ts +2 -2
- package/dist/server/auth/types.d.cts +4 -4
- package/dist/server/auth/types.d.ts +4 -4
- package/dist/server/errors-envelope.cjs +14 -14
- package/dist/server/errors-envelope.d.cts +3 -3
- package/dist/server/errors-envelope.d.ts +3 -3
- package/dist/server/errors-envelope.js +3 -3
- package/dist/session-transcript-DFGX6WNL.cjs +50 -0
- package/dist/{session-transcript-EAKR4D2W.cjs.map → session-transcript-DFGX6WNL.cjs.map} +1 -1
- package/dist/session-transcript-MMPWCESR.js +5 -0
- package/dist/{session-transcript-6WKLYIN4.js.map → session-transcript-MMPWCESR.js.map} +1 -1
- package/dist/skills.cjs +7 -7
- package/dist/skills.js +5 -5
- package/dist/stream-object-AFERZU63.js +7 -0
- package/dist/{stream-object-OFM66VUT.js.map → stream-object-AFERZU63.js.map} +1 -1
- package/dist/stream-object-YPXZ4F5P.cjs +20 -0
- package/dist/{stream-object-Y7YCX3BI.cjs.map → stream-object-YPXZ4F5P.cjs.map} +1 -1
- package/dist/subagents-loader.cjs +6 -6
- package/dist/subagents-loader.d.cts +2 -2
- package/dist/subagents-loader.d.ts +2 -2
- package/dist/subagents-loader.js +4 -4
- package/dist/subscription/index.cjs +3 -3
- package/dist/subscription/index.js +2 -2
- package/dist/task-store.cjs +7 -7
- package/dist/task-store.js +4 -4
- package/dist/types/agent-prims.d.ts +4 -4
- package/dist/types/goal-events.d.ts +24 -23
- package/dist/types/run.d.ts +27 -0
- package/dist/types/session-record.d.ts +14 -13
- package/dist/workflow.cjs +27 -27
- package/dist/workflow.js +6 -6
- package/package.json +12 -13
- package/dist/agent-4MHQUGO5.cjs +0 -51
- package/dist/agent-GV36S2CF.js +0 -42
- package/dist/chunk-2ONFGMBV.js.map +0 -1
- package/dist/chunk-56OXYUZE.js.map +0 -1
- package/dist/chunk-56ZM6P7Z.cjs.map +0 -1
- package/dist/chunk-5SB4V74H.js.map +0 -1
- package/dist/chunk-77WHPVXE.js.map +0 -1
- package/dist/chunk-ALU3KC4G.cjs.map +0 -1
- package/dist/chunk-EEZ7CFMM.js.map +0 -1
- package/dist/chunk-GL7CFBVC.js.map +0 -1
- package/dist/chunk-H5YVJB4K.cjs.map +0 -1
- package/dist/chunk-ICYBIC6N.cjs.map +0 -1
- package/dist/chunk-IT3PWBW4.cjs.map +0 -1
- package/dist/chunk-ITLS5LRF.cjs +0 -105
- package/dist/chunk-ITLS5LRF.cjs.map +0 -1
- package/dist/chunk-LTCOPATU.cjs.map +0 -1
- package/dist/chunk-MXSMAGDU.js.map +0 -1
- package/dist/chunk-P34DHHYQ.cjs.map +0 -1
- package/dist/chunk-S3WZ7NHF.cjs.map +0 -1
- package/dist/chunk-TAPQWDW2.js.map +0 -1
- package/dist/chunk-THEYGCYS.cjs.map +0 -1
- package/dist/chunk-VNNK6AKU.js.map +0 -1
- package/dist/chunk-XAEAMI5H.js.map +0 -1
- package/dist/chunk-XJLGRJ7K.js.map +0 -1
- package/dist/chunk-YPQF26X7.cjs.map +0 -1
- package/dist/chunk-YVTNFKZO.js +0 -103
- package/dist/chunk-YVTNFKZO.js.map +0 -1
- package/dist/compact-session-H5TKLD55.cjs +0 -54
- package/dist/compact-session-WNKKIIDW.js +0 -17
- package/dist/context-VAYLPT4O.js +0 -5
- package/dist/context-ZV33V4DC.cjs +0 -22
- package/dist/fs-session-store-6MY7PNI2.js +0 -10
- package/dist/fs-session-store-7E7UPLF2.cjs +0 -19
- package/dist/generate-object-5SCEH2EE.cjs +0 -20
- package/dist/generate-object-I7UD4NWN.js +0 -7
- package/dist/index-manager-KKAK7NT3.js +0 -10
- package/dist/index-manager-R6ZJFEZF.cjs +0 -19
- package/dist/judge-call-SP3G3X2Y.cjs +0 -22
- package/dist/judge-call-TAEIXMYG.js +0 -5
- package/dist/registry-N3GTKYCI.cjs +0 -46
- package/dist/registry-SOXE4RY6.js +0 -9
- package/dist/session-transcript-6WKLYIN4.js +0 -5
- package/dist/session-transcript-EAKR4D2W.cjs +0 -50
- package/dist/stream-object-OFM66VUT.js +0 -7
- package/dist/stream-object-Y7YCX3BI.cjs +0 -20
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
3
|
+
var chunk6ZGD7R27_cjs = require('./chunk-6ZGD7R27.cjs');
|
|
4
|
+
var chunkBURYFNOM_cjs = require('./chunk-BURYFNOM.cjs');
|
|
5
|
+
var chunk6OKPJZMX_cjs = require('./chunk-6OKPJZMX.cjs');
|
|
6
|
+
require('./chunk-YVI4YPUP.cjs');
|
|
7
|
+
require('./chunk-BE3W4HYV.cjs');
|
|
8
8
|
|
|
9
9
|
// src/internal/session/inject-session.ts
|
|
10
10
|
async function injectSessionTurn(opts) {
|
|
11
|
-
await
|
|
11
|
+
await chunk6ZGD7R27_cjs.enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {
|
|
12
12
|
const prior = await opts.store.readRecords(opts.loc.agentId);
|
|
13
|
-
const transcript =
|
|
13
|
+
const transcript = chunk6OKPJZMX_cjs.SessionTranscript.fromRecords(prior, {
|
|
14
14
|
cwd: opts.loc.cwd,
|
|
15
15
|
sessionId: opts.sessionId,
|
|
16
16
|
model: opts.loc.model ?? "unknown"
|
|
@@ -18,10 +18,10 @@ async function injectSessionTurn(opts) {
|
|
|
18
18
|
transcript.appendUserTurn(opts.userText);
|
|
19
19
|
transcript.appendAssistantTurn({ text: opts.assistantText });
|
|
20
20
|
await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));
|
|
21
|
-
|
|
21
|
+
chunkBURYFNOM_cjs.invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
exports.injectSessionTurn = injectSessionTurn;
|
|
26
|
-
//# sourceMappingURL=inject-session-
|
|
27
|
-
//# sourceMappingURL=inject-session-
|
|
26
|
+
//# sourceMappingURL=inject-session-25EC74WV.cjs.map
|
|
27
|
+
//# sourceMappingURL=inject-session-25EC74WV.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":["enqueueSessionWrite","SessionTranscript","invalidateSessionCache"],"mappings":";;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAMA,sCAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAaC,mCAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAAC,wCAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-
|
|
1
|
+
{"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":["enqueueSessionWrite","SessionTranscript","invalidateSessionCache"],"mappings":";;;;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAMA,sCAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAaC,mCAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAAC,wCAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-25EC74WV.cjs","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { enqueueSessionWrite } from './chunk-
|
|
2
|
-
import { invalidateSessionCache } from './chunk-
|
|
3
|
-
import { SessionTranscript } from './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
1
|
+
import { enqueueSessionWrite } from './chunk-A4XXV2C6.js';
|
|
2
|
+
import { invalidateSessionCache } from './chunk-5KOW3GLE.js';
|
|
3
|
+
import { SessionTranscript } from './chunk-AOZYORH7.js';
|
|
4
|
+
import './chunk-LGCEYEU2.js';
|
|
5
|
+
import './chunk-KCZW75PI.js';
|
|
6
6
|
|
|
7
7
|
// src/internal/session/inject-session.ts
|
|
8
8
|
async function injectSessionTurn(opts) {
|
|
@@ -21,5 +21,5 @@ async function injectSessionTurn(opts) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export { injectSessionTurn };
|
|
24
|
-
//# sourceMappingURL=inject-session-
|
|
25
|
-
//# sourceMappingURL=inject-session-
|
|
24
|
+
//# sourceMappingURL=inject-session-RKNLUE72.js.map
|
|
25
|
+
//# sourceMappingURL=inject-session-RKNLUE72.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":[],"mappings":";;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAM,oBAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAa,iBAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAA,sBAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-
|
|
1
|
+
{"version":3,"sources":["../src/internal/session/inject-session.ts"],"names":[],"mappings":";;;;;;;AAWA,eAAsB,kBAAkB,IAAA,EAMtB;AAChB,EAAA,MAAM,oBAAoB,IAAA,CAAK,GAAA,CAAI,KAAK,IAAA,CAAK,GAAA,CAAI,SAAS,YAAY;AACpE,IAAA,MAAM,QAAQ,MAAM,IAAA,CAAK,MAAM,WAAA,CAAY,IAAA,CAAK,IAAI,OAAO,CAAA;AAC3D,IAAA,MAAM,UAAA,GAAa,iBAAA,CAAkB,WAAA,CAAY,KAAA,EAAO;AAAA,MACtD,GAAA,EAAK,KAAK,GAAA,CAAI,GAAA;AAAA,MACd,WAAW,IAAA,CAAK,SAAA;AAAA,MAChB,KAAA,EAAO,IAAA,CAAK,GAAA,CAAI,KAAA,IAAS;AAAA,KAC1B,CAAA;AACD,IAAA,UAAA,CAAW,cAAA,CAAe,KAAK,QAAQ,CAAA;AACvC,IAAA,UAAA,CAAW,mBAAA,CAAoB,EAAE,IAAA,EAAM,IAAA,CAAK,eAAe,CAAA;AAC3D,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,aAAA,CAAc,IAAA,CAAK,GAAA,CAAI,OAAA,EAAS,UAAA,CAAW,OAAA,EAAQ,CAAE,KAAA,CAAM,KAAA,CAAM,MAAM,CAAC,CAAA;AACzF,IAAA,sBAAA,CAAuB,IAAA,CAAK,GAAA,CAAI,GAAA,EAAK,IAAA,CAAK,IAAI,OAAO,CAAA;AAAA,EACvD,CAAC,CAAA;AACH","file":"inject-session-RKNLUE72.js","sourcesContent":["/**\n * M51 (agent-builder) — inject a SYNTHETIC user+assistant pair into a session's persisted transcript\n * WITHOUT running an LLM turn. This is the Codex review-exit mechanism (`exit_success.xml` appended to\n * the parent thread history so follow-ups like \"fix finding 2\" work): the pair chains onto the DAG\n * leaf (M50 pattern) and the in-memory cache is invalidated so the NEXT send re-hydrates with it.\n */\nimport type { SessionStore } from \"../../types/session-store.js\";\nimport { SessionTranscript } from \"../persistence/session-transcript.js\";\nimport { enqueueSessionWrite, invalidateSessionCache } from \"./agent-session.js\";\nimport type { CompactLocation } from \"./compact-session.js\";\n\nexport async function injectSessionTurn(opts: {\n store: SessionStore;\n loc: CompactLocation;\n sessionId: string;\n userText: string;\n assistantText: string;\n}): Promise<void> {\n await enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {\n const prior = await opts.store.readRecords(opts.loc.agentId);\n const transcript = SessionTranscript.fromRecords(prior, {\n cwd: opts.loc.cwd,\n sessionId: opts.sessionId,\n model: opts.loc.model ?? \"unknown\",\n });\n transcript.appendUserTurn(opts.userText);\n transcript.appendAssistantTurn({ text: opts.assistantText });\n await opts.store.appendRecords(opts.loc.agentId, transcript.records().slice(prior.length));\n invalidateSessionCache(opts.loc.cwd, opts.loc.agentId);\n });\n}\n"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { SDKMessage } from "../../types/messages.js";
|
|
2
|
+
/**
|
|
3
|
+
* theokit#140 — the loop's event log, reporting each event AS IT HAPPENS.
|
|
4
|
+
*
|
|
5
|
+
* ## The defect this closes
|
|
6
|
+
*
|
|
7
|
+
* `runAgentLoop` collected events into a plain array and returned it, so nothing reached the run
|
|
8
|
+
* until the loop had finished. `RealLocalRun.applyAgentLoopOutput` then copied the whole batch in
|
|
9
|
+
* one pass. Meanwhile `SendOptions.onDelta` fired live from inside that same loop.
|
|
10
|
+
*
|
|
11
|
+
* Two clocks, one of which does not start until the other has stopped. A consumer that wanted tool
|
|
12
|
+
* calls interleaved with tokens in true order had to fuse both surfaces itself — which is exactly
|
|
13
|
+
* what `@theokit/agents` was doing, and the documented root of its ordering bug (theokit#47), its
|
|
14
|
+
* namespace-dedup bug (theokit#138) and its missing terminal frame (theokit#142).
|
|
15
|
+
*
|
|
16
|
+
* ## Why a subclass, and not a callback threaded through nine call sites
|
|
17
|
+
*
|
|
18
|
+
* The events are appended from nine places across `loop.ts`, `loop-llm-stream.ts` and
|
|
19
|
+
* `tool-dispatch.ts`. Threading an `onEvent` parameter to each would touch every one of them and,
|
|
20
|
+
* worse, would leave the NEXT `events.push(...)` silently un-notified — a defect that reintroduces
|
|
21
|
+
* itself by omission, which is the failure mode this whole issue is about.
|
|
22
|
+
*
|
|
23
|
+
* Extending `Array` moves the decision to the single place the log is CREATED. Every existing push
|
|
24
|
+
* becomes live with no call-site change, and any push added later is live for free.
|
|
25
|
+
*
|
|
26
|
+
* It stays a real `Array`: `AgentLoopOutput.events` is still `SDKMessage[]`, `instanceof Array`
|
|
27
|
+
* still holds, and every downstream consumer — including the batch copy in `applyAgentLoopOutput` —
|
|
28
|
+
* is unchanged. This is additive; nothing that worked before observes a difference.
|
|
29
|
+
*
|
|
30
|
+
* `push` is the only override, deliberately. The loop only ever appends; overriding the rest of the
|
|
31
|
+
* mutation surface would be guarding against callers that do not exist (YAGNI), and a subscriber
|
|
32
|
+
* that must reason about splices is a worse contract than one that receives appends.
|
|
33
|
+
*/
|
|
34
|
+
export declare class LiveEventLog extends Array<SDKMessage> {
|
|
35
|
+
#private;
|
|
36
|
+
/** Attach the live subscriber. One sink: the run that owns this loop. */
|
|
37
|
+
subscribe(sink: (event: SDKMessage) => void): void;
|
|
38
|
+
push(...events: SDKMessage[]): number;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Build the loop's event log, seeded with the events that exist before the loop starts.
|
|
42
|
+
*
|
|
43
|
+
* `LiveEventLog.from` rather than `new LiveEventLog(...seed)`: the `Array` constructor treats a
|
|
44
|
+
* single numeric argument as a length, and a seed is a list of events, never a count.
|
|
45
|
+
*/
|
|
46
|
+
export declare function createEventLog(seed: readonly SDKMessage[]): LiveEventLog;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* - "subscription_included" routes (Codex CLI, future Claude Pro) →
|
|
11
11
|
* return $0 with status="included".
|
|
12
12
|
* - Provider unknown / pricing missing → status="unknown" with
|
|
13
|
-
* undefined amountUsd (
|
|
13
|
+
* undefined amountUsd (does NOT return a false 0).
|
|
14
14
|
*
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
@@ -1,54 +1,56 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The library's single diagnostics channel — silent by default (#147).
|
|
3
3
|
*
|
|
4
4
|
* ## O problema
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
6
|
+
* The SDK wrote diagnostics straight to `process.stderr` from hot paths — 92 sites across 51
|
|
7
|
+
* files under `internal/`. In a TUI host (Ink, alternate screen), those writes interleave with the
|
|
8
|
+
* render and **corrupt the frame**. And the host had no way to intercept them: there was no
|
|
9
|
+
* injectable logger. One consumer went as far as installing `proper-lockfile` just to silence ONE
|
|
10
|
+
* of them.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* A library cannot assume `stdout`/`stderr` are free sinks. The application owns the terminal, not
|
|
13
|
+
* the dependency.
|
|
14
14
|
*
|
|
15
15
|
* ## O contrato
|
|
16
16
|
*
|
|
17
|
-
* - **`setDiagnosticsSink(fn)`**
|
|
18
|
-
* (
|
|
19
|
-
* - **
|
|
17
|
+
* - **`setDiagnosticsSink(fn)`** hands the messages to the application, which decides where to put
|
|
18
|
+
* them (a status line, a file, a panel). It is what was missing for a TUI to coexist with the SDK.
|
|
19
|
+
* - **With no sink, it goes to `stderr`** — exactly as before this change.
|
|
20
20
|
*
|
|
21
|
-
* ##
|
|
21
|
+
* ## Why the default did NOT change (yet), and why that is deliberate
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
23
|
+
* #147 asks for silence by default, and that is the right target. But **58 test files** currently
|
|
24
|
+
* assert these diagnostics reach `stderr` — they encode the contract "the warning IS emitted",
|
|
25
|
+
* which still holds and must not be lost. Flipping the default without migrating them would fail
|
|
26
|
+
* ~53 tests, and migrating them in a hurry, across four different ways of spying on `stderr`, is
|
|
27
|
+
* the recipe for weakening 58 suites at once.
|
|
28
28
|
*
|
|
29
|
-
*
|
|
29
|
+
* So this change delivers the half that UNBLOCKS the consumer — a TUI host can now
|
|
30
30
|
* interceptar, que era o bloqueio relatado ("no way to intercept these; no injectable logger") — e
|
|
31
|
-
*
|
|
31
|
+
* and leaves flipping the default as its own migration, with a measured cost. A host that wants silence
|
|
32
32
|
* hoje instala `setDiagnosticsSink(() => {})`.
|
|
33
33
|
*
|
|
34
|
-
* ##
|
|
34
|
+
* ## What this is NOT
|
|
35
35
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
36
|
+
* It is not a logger with levels, formatting or multiple destinations. It is the minimum that
|
|
37
|
+
* resolves the reported blocker; a full logger here would be inventing a requirement nobody asked
|
|
38
|
+
* for.
|
|
38
39
|
*/
|
|
39
|
-
/**
|
|
40
|
+
/** Receives each diagnostic message already formatted, with the trailing `\n`. */
|
|
40
41
|
export type DiagnosticsSink = (message: string) => void;
|
|
41
42
|
/**
|
|
42
|
-
*
|
|
43
|
+
* Installs (or removes, by passing `undefined`) the diagnostics destination.
|
|
43
44
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
45
|
+
* When a sink is present it is the ONLY destination — `stderr` gets no copy. Duplicating
|
|
46
|
+
* destinations would hand the problem back to the TUI that installed the sink precisely to get the
|
|
47
|
+
* messages out of the terminal.
|
|
46
48
|
*/
|
|
47
49
|
export declare function setDiagnosticsSink(next: DiagnosticsSink | undefined): void;
|
|
48
50
|
/**
|
|
49
|
-
*
|
|
51
|
+
* Emits a library diagnostic message.
|
|
50
52
|
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
+
* Replaces `process.stderr.write` on internal paths. Never throws: a faulty sink must not
|
|
54
|
+
* must not take down the run it merely observes.
|
|
53
55
|
*/
|
|
54
56
|
export declare function diag(message: string): void;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* `"content_filtered"` for policy.)
|
|
13
13
|
* 408 → `NetworkError` (`code: "timeout"`)
|
|
14
14
|
* 5xx → `NetworkError` (`code: "server_error"` — covers 529
|
|
15
|
-
* overloaded_error common
|
|
15
|
+
* overloaded_error common at peak
|
|
16
16
|
* de pico)
|
|
17
17
|
* other → `UnknownAgentError` (`code: "unknown"`)
|
|
18
18
|
*
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Singleton por realm, chaveado por `Symbol.for`.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* `node_modules`, ESM
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* It exists because a package can be loaded more than once in the same process (two copies in
|
|
5
|
+
* `node_modules`, ESM and CJS side by side, a monorepo with distinct versions) — and then a module-level
|
|
6
|
+
* `const x = new Map()` produces TWO caches that cannot see each other. `Symbol.for` uses the global
|
|
7
|
+
* symbol registry, which belongs to the realm and not the module, so every copy converges on one instance.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* It was copied verbatim into `providers/discovery.ts` and `providers/catalog-loader.ts`. That is
|
|
10
|
+
* duplicated KNOWLEDGE, not a coincidence of shape: the two copies have to agree on the
|
|
11
|
+
* mechanism, and one fixed without the other produces exactly the bug the function exists to avoid.
|
|
12
12
|
*/
|
|
13
13
|
export declare function globalSingleton<T>(key: string, create: () => T): T;
|
|
@@ -8,32 +8,32 @@ export interface JudgeContext {
|
|
|
8
8
|
/** Caller-supplied tuning knobs for the judge call. */
|
|
9
9
|
export interface JudgeOptions {
|
|
10
10
|
/**
|
|
11
|
-
* Judge model identifier.
|
|
12
|
-
* `"openai/gpt-4o-mini"`
|
|
11
|
+
* Judge model identifier. When absent, it DERIVES from {@link agentModel} — and only falls back to the literal
|
|
12
|
+
* `"openai/gpt-4o-mini"` when neither is provided.
|
|
13
13
|
*
|
|
14
|
-
* M80 —
|
|
15
|
-
* 404,
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* M80 — the fixed default was provider-blind: it only resolves on OpenRouter. With an Anthropic key it gives
|
|
15
|
+
* 404, with an OAuth bearer it gives 401, and in both the goal burned 3 whole turns before failing with
|
|
16
|
+
* a misleading reason. The agent-builder already worked around this by deriving on its own; the knowledge
|
|
17
|
+
* belongs here.
|
|
18
18
|
*/
|
|
19
19
|
judgeModel?: string;
|
|
20
20
|
/**
|
|
21
|
-
* M80 —
|
|
22
|
-
* chat
|
|
21
|
+
* M80 — the DRIVEN agent's model. It is the basis of the derivation: a judge running on the same model as the
|
|
22
|
+
* chat works wherever chat works.
|
|
23
23
|
*/
|
|
24
24
|
agentModel?: string;
|
|
25
25
|
/** Override env. Default `process.env.OPENROUTER_API_KEY` (EC-A). */
|
|
26
26
|
apiKey?: string;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* M80 —
|
|
29
|
+
* M80 — the judge's credential or model does not work: 401/404.
|
|
30
30
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
31
|
+
* Fails FAST by design. `rules/error-handling.md` § 2 separates recoverable from unrecoverable, and a
|
|
32
|
+
* nonexistent model does not start existing on retry — folding that into `{parseFailed: true}` made the loop
|
|
33
|
+
* try three times and report "failed" on a consecutive-failure limit, hiding that the cause was the
|
|
34
|
+
* credential. A slow, opaque failure traded for a fast, clear one.
|
|
35
35
|
*
|
|
36
|
-
*
|
|
36
|
+
* PARSE failures and network errors stay folded: they are recoverable, and the loop already decides on
|
|
37
37
|
* consecutivas.
|
|
38
38
|
*/
|
|
39
39
|
export declare class JudgeCredentialError extends TheokitAgentError {
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import type { LlmClient, LlmEvent, LlmFinish, LlmRequest } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
export declare const
|
|
2
|
+
/** Attempt ceiling. Fixed at 3 — M93's DoD names the number. */
|
|
3
|
+
export declare const MAX_ATTEMPTS = 3;
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Is the error transient — that is, can retrying change the outcome?
|
|
6
6
|
*
|
|
7
|
-
* ##
|
|
7
|
+
* ## Delegates to `isTransientError`, and states what it subtracts
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
* a re-derivation",
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
9
|
+
* The SDK **already** publishes `isTransientError` — documented as "a single source of truth rather
|
|
10
|
+
* than a re-derivation", with the explicit warning that "It never inspects `err.message`". The first
|
|
11
|
+
* version of this function ignored both: it re-derived, by regex over the message (`/\b4\d\d\b/`).
|
|
12
|
+
* Adversarial review measured the cost — `connect ECONNREFUSED 127.0.0.1:443` was classified as NOT
|
|
13
|
+
* transient, because the **port** matches the regex. The network errors retry exists for were
|
|
14
|
+
* exactly the ones excluded.
|
|
15
15
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* Reinventing here violated parsimony rung 4 with the part already at hand. What remains of this
|
|
17
|
+
* function are **three subtractions** from the owner's verdict, each with a reason:
|
|
18
18
|
*
|
|
19
|
-
* |
|
|
19
|
+
* | Subtraction | Why |
|
|
20
20
|
* |---|---|
|
|
21
|
-
* | `CredentialPoolExhaustedError` |
|
|
22
|
-
* | `code === "circuit_open"` |
|
|
23
|
-
* | `RateLimitError`
|
|
21
|
+
* | `CredentialPoolExhaustedError` | the pool already spent its own attempt and rotation budget; `nextRetryAt` is tens of seconds out. Retrying would multiply the wait by `MAX_ATTEMPTS` with no chance of success. |
|
|
22
|
+
* | `code === "circuit_open"` | the breaker exists **in order to** fail fast; wrapping it in a retry undoes from outside the decision it just made. |
|
|
23
|
+
* | `RateLimitError` with 402 | a billing quota does not resolve in milliseconds — which is why the pool's `classifyAndDecide` rotates instead of waiting. |
|
|
24
24
|
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
25
|
+
* The first two came out of the review's measurements: with them treated as transient, the entire
|
|
26
|
+
* pool was retried 3x, and a 30 s wait became ~90 s.
|
|
27
27
|
*/
|
|
28
|
-
export declare function
|
|
28
|
+
export declare function isRetriableError(err: unknown): boolean;
|
|
29
29
|
/**
|
|
30
|
-
* ##
|
|
30
|
+
* ## Why there is NO circuit breaker here
|
|
31
31
|
*
|
|
32
|
-
*
|
|
33
|
-
* `recordTimeout(key)`):
|
|
34
|
-
*
|
|
32
|
+
* The package's `CircuitBreaker` is **keyed by credential** (`recordSuccess(key)` /
|
|
33
|
+
* `recordTimeout(key)`): it exists so the pool can mark a key unhealthy and **skip** to another.
|
|
34
|
+
* With a single key there is nowhere to skip to, so a breaker here would record state nobody reads.
|
|
35
35
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
36
|
+
* Parsimony rung 1 — "does this need to exist?". No: it would be ceremony with resilience's name on
|
|
37
|
+
* it. What protects the single-key path is the attempt ceiling and the backoff, and both are below.
|
|
38
38
|
*/
|
|
39
39
|
export declare class RetryingLlmClient implements LlmClient {
|
|
40
40
|
#private;
|
|
@@ -42,10 +42,10 @@ export declare class RetryingLlmClient implements LlmClient {
|
|
|
42
42
|
rng?: () => number;
|
|
43
43
|
});
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* decorators.
|
|
48
|
-
*
|
|
45
|
+
* The decorated client. Public by the same convention as `FaultInjectingLlmClient.inner`: the
|
|
46
|
+
* router's wiring tests assert `instanceof PoolAwareLlmClient` and need to see through the
|
|
47
|
+
* decorators. Without this, adding a decorator breaks tests whose intent is still valid — which is
|
|
48
|
+
* exactly what M93 did to 4 pre-existing tests.
|
|
49
49
|
*/
|
|
50
50
|
get inner(): LlmClient;
|
|
51
51
|
get name(): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Wraps a socket failure in a {@link NetworkError}, preserving the cause.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Returns the original error — unwrapped — when it is an abort or already an SDK error.
|
|
5
5
|
*/
|
|
6
6
|
export declare function wrapTransportError(err: unknown, ctx: {
|
|
7
7
|
providerId: string;
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
* readable 0o644 under typical umask 022. Callers writing non-sensitive
|
|
12
12
|
* files can pass `mode: 0o644` explicitly.
|
|
13
13
|
*
|
|
14
|
-
* NFS
|
|
15
|
-
* `withFileLock`); SDK target
|
|
14
|
+
* NFS not honoring O_EXCL is documented (D61 — same stance as
|
|
15
|
+
* `withFileLock`); the SDK target is ext4/APFS/NTFS.
|
|
16
16
|
*
|
|
17
17
|
* @internal
|
|
18
18
|
*/
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
* readable 0o644 under typical umask 022. Callers writing non-sensitive
|
|
12
12
|
* files can pass `mode: 0o644` explicitly.
|
|
13
13
|
*
|
|
14
|
-
* NFS
|
|
15
|
-
* `withFileLock`); SDK target
|
|
14
|
+
* NFS not honoring O_EXCL is documented (D61 — same stance as
|
|
15
|
+
* `withFileLock`); the SDK target is ext4/APFS/NTFS.
|
|
16
16
|
*
|
|
17
17
|
* @internal
|
|
18
18
|
*/
|
|
@@ -32,34 +32,34 @@ export declare class FsSessionStore implements SessionStore {
|
|
|
32
32
|
readRecords(agentId: string): Promise<SessionRecord[]>;
|
|
33
33
|
appendRecords(agentId: string, records: readonly SessionRecord[]): Promise<void>;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* Takes the session's writer lease. Throws `SessionBusyError` when another process holds it.
|
|
36
36
|
*
|
|
37
|
-
* **
|
|
38
|
-
*
|
|
39
|
-
* stderr, NOT thrown to the caller (best-effort write)".
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* stderr
|
|
37
|
+
* **Explicit, and NOT inside `appendRecords`** — M95's adversarial review measured why that
|
|
38
|
+
* matters: the `SessionStore` contract states that "an `appendRecords` rejection is logged to
|
|
39
|
+
* stderr, NOT thrown to the caller (best-effort write)". Acquiring there made the
|
|
40
|
+
* `SessionBusyError` get **swallowed**, and the result was worse than the original problem:
|
|
41
|
+
* instead of two writers interleaving lines, the loser **lost the turn silently** — nothing on
|
|
42
|
+
* disk, a stderr warning invisible under the TUI, and no way for the caller to react.
|
|
43
43
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
44
|
+
* At init the error reaches someone who can act: `exec` forks to a new id, which is exactly what
|
|
45
|
+
* the error message itself prescribes. It is the difference between failing where a decision is
|
|
46
|
+
* possible and failing where only loss is.
|
|
47
47
|
*/
|
|
48
48
|
acquire(agentId: string): Promise<void>;
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
50
|
+
* Releases ONE agent's lease.
|
|
51
51
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* lease
|
|
52
|
+
* It exists because `dispose()` releases **every** lease the store holds, and a store injected by
|
|
53
|
+
* the consumer may serve several agents: an init that fails for agent B must not free agent A's
|
|
54
|
+
* lease, which is still live and writing.
|
|
55
55
|
*/
|
|
56
56
|
release(agentId: string): Promise<void>;
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
58
|
+
* Releases every lease this store holds.
|
|
59
59
|
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
60
|
+
* Without it the `.writer.lock` outlives the process and the next open would have to wait out the
|
|
61
|
+
* heartbeat window — recoverable, but 30 s of waiting after a CLEAN shutdown would be an avoidable
|
|
62
|
+
* defect. Idempotent: calling it twice is not an error.
|
|
63
63
|
*/
|
|
64
64
|
dispose(): Promise<void>;
|
|
65
65
|
}
|
|
@@ -32,34 +32,34 @@ export declare class FsSessionStore implements SessionStore {
|
|
|
32
32
|
readRecords(agentId: string): Promise<SessionRecord[]>;
|
|
33
33
|
appendRecords(agentId: string, records: readonly SessionRecord[]): Promise<void>;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* Takes the session's writer lease. Throws `SessionBusyError` when another process holds it.
|
|
36
36
|
*
|
|
37
|
-
* **
|
|
38
|
-
*
|
|
39
|
-
* stderr, NOT thrown to the caller (best-effort write)".
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* stderr
|
|
37
|
+
* **Explicit, and NOT inside `appendRecords`** — M95's adversarial review measured why that
|
|
38
|
+
* matters: the `SessionStore` contract states that "an `appendRecords` rejection is logged to
|
|
39
|
+
* stderr, NOT thrown to the caller (best-effort write)". Acquiring there made the
|
|
40
|
+
* `SessionBusyError` get **swallowed**, and the result was worse than the original problem:
|
|
41
|
+
* instead of two writers interleaving lines, the loser **lost the turn silently** — nothing on
|
|
42
|
+
* disk, a stderr warning invisible under the TUI, and no way for the caller to react.
|
|
43
43
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
44
|
+
* At init the error reaches someone who can act: `exec` forks to a new id, which is exactly what
|
|
45
|
+
* the error message itself prescribes. It is the difference between failing where a decision is
|
|
46
|
+
* possible and failing where only loss is.
|
|
47
47
|
*/
|
|
48
48
|
acquire(agentId: string): Promise<void>;
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
50
|
+
* Releases ONE agent's lease.
|
|
51
51
|
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
* lease
|
|
52
|
+
* It exists because `dispose()` releases **every** lease the store holds, and a store injected by
|
|
53
|
+
* the consumer may serve several agents: an init that fails for agent B must not free agent A's
|
|
54
|
+
* lease, which is still live and writing.
|
|
55
55
|
*/
|
|
56
56
|
release(agentId: string): Promise<void>;
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
58
|
+
* Releases every lease this store holds.
|
|
59
59
|
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
60
|
+
* Without it the `.writer.lock` outlives the process and the next open would have to wait out the
|
|
61
|
+
* heartbeat window — recoverable, but 30 s of waiting after a CLEAN shutdown would be an avoidable
|
|
62
|
+
* defect. Idempotent: calling it twice is not an error.
|
|
63
63
|
*/
|
|
64
64
|
dispose(): Promise<void>;
|
|
65
65
|
}
|