@theokit/sdk 4.38.0 → 4.39.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +285 -0
- package/dist/a2a/index.cjs +3 -3
- package/dist/a2a/index.js +1 -1
- package/dist/a2a/subagent.d.cts +1 -0
- package/dist/a2a/subagent.d.ts +1 -0
- package/dist/agent-6ULDAQT7.js +46 -0
- package/dist/{agent-3H3UKD6U.js.map → agent-6ULDAQT7.js.map} +1 -1
- package/dist/{agent-U3lBX-5t.d.cts → agent-D7bRK9Kg.d.cts} +70 -5
- package/dist/agent-PVUKI3BB.cjs +55 -0
- package/dist/{agent-2GZC4W2A.cjs.map → agent-PVUKI3BB.cjs.map} +1 -1
- package/dist/{agent-C3AEtM-W.d.ts → agent-ZCZa7YQv.d.ts} +70 -5
- package/dist/agent-session-store-N4TVKHBU.cjs +23 -0
- package/dist/agent-session-store-N4TVKHBU.cjs.map +1 -0
- package/dist/agent-session-store-RHMHP5DG.js +6 -0
- package/dist/agent-session-store-RHMHP5DG.js.map +1 -0
- package/dist/agent.d.ts +37 -1
- package/dist/auth/index.cjs +15 -15
- package/dist/auth/index.js +4 -4
- package/dist/{batch-LXSALQC3.js → batch-6KQM3EBA.js} +12 -12
- package/dist/batch-6KQM3EBA.js.map +1 -0
- package/dist/{batch-NZGN6SFV.cjs → batch-X6JKGDPK.cjs} +26 -26
- package/dist/batch-X6JKGDPK.cjs.map +1 -0
- package/dist/chunk-2RW7K6FN.cjs +34 -0
- package/dist/chunk-2RW7K6FN.cjs.map +1 -0
- package/dist/chunk-3I4B3OIX.js +105 -0
- package/dist/chunk-3I4B3OIX.js.map +1 -0
- package/dist/{chunk-KWXC6ERT.js → chunk-42IFCKQZ.js} +5 -5
- package/dist/{chunk-KWXC6ERT.js.map → chunk-42IFCKQZ.js.map} +1 -1
- package/dist/{chunk-4APWS2YF.js → chunk-4F7JQZOX.js} +9 -36
- package/dist/chunk-4F7JQZOX.js.map +1 -0
- package/dist/{chunk-VYD6BGKK.js → chunk-4JSZYSGW.js} +3 -3
- package/dist/{chunk-VYD6BGKK.js.map → chunk-4JSZYSGW.js.map} +1 -1
- package/dist/{chunk-A6GXYF2Q.js → chunk-65ONFZWM.js} +7 -6
- package/dist/chunk-65ONFZWM.js.map +1 -0
- package/dist/{chunk-SGTMDQ4O.js → chunk-6EEYRFJC.js} +5 -5
- package/dist/{chunk-SGTMDQ4O.js.map → chunk-6EEYRFJC.js.map} +1 -1
- package/dist/{chunk-M4OGSS66.cjs → chunk-6LGQECT7.cjs} +11 -11
- package/dist/{chunk-M4OGSS66.cjs.map → chunk-6LGQECT7.cjs.map} +1 -1
- package/dist/{chunk-KTXOHCAE.cjs → chunk-6NEHIHFU.cjs} +4 -4
- package/dist/{chunk-KTXOHCAE.cjs.map → chunk-6NEHIHFU.cjs.map} +1 -1
- package/dist/chunk-6YNYA7GD.cjs +103 -0
- package/dist/chunk-6YNYA7GD.cjs.map +1 -0
- package/dist/{chunk-2R6NBT5F.cjs → chunk-74D7KSBP.cjs} +11 -11
- package/dist/{chunk-2R6NBT5F.cjs.map → chunk-74D7KSBP.cjs.map} +1 -1
- package/dist/{chunk-6OIO4FYX.cjs → chunk-75DSEWTJ.cjs} +7 -7
- package/dist/{chunk-6OIO4FYX.cjs.map → chunk-75DSEWTJ.cjs.map} +1 -1
- package/dist/{chunk-3XRXORBS.cjs → chunk-7OLG7VI4.cjs} +4 -4
- package/dist/{chunk-3XRXORBS.cjs.map → chunk-7OLG7VI4.cjs.map} +1 -1
- package/dist/chunk-7U2HAAWB.cjs +199 -0
- package/dist/chunk-7U2HAAWB.cjs.map +1 -0
- package/dist/{chunk-QJQ2MAZF.cjs → chunk-7YBJZS5P.cjs} +8 -8
- package/dist/{chunk-QJQ2MAZF.cjs.map → chunk-7YBJZS5P.cjs.map} +1 -1
- package/dist/{chunk-A4XXV2C6.js → chunk-7YSRCQDE.js} +5 -72
- package/dist/chunk-7YSRCQDE.js.map +1 -0
- package/dist/{chunk-ZFZYPLQI.js → chunk-AECV3G5Z.js} +4 -4
- package/dist/{chunk-ZFZYPLQI.js.map → chunk-AECV3G5Z.js.map} +1 -1
- package/dist/{chunk-QFWQLXCL.js → chunk-AR5MQZ3J.js} +3 -3
- package/dist/{chunk-QFWQLXCL.js.map → chunk-AR5MQZ3J.js.map} +1 -1
- package/dist/{chunk-G2F67XUR.cjs → chunk-B4YA6BRS.cjs} +13 -14
- package/dist/chunk-B4YA6BRS.cjs.map +1 -0
- package/dist/{chunk-BE3W4HYV.cjs → chunk-BCQ3E2ZG.cjs} +12 -3
- package/dist/chunk-BCQ3E2ZG.cjs.map +1 -0
- package/dist/{chunk-XJ5TMOGA.js → chunk-BQDUEG4C.js} +3 -3
- package/dist/{chunk-XJ5TMOGA.js.map → chunk-BQDUEG4C.js.map} +1 -1
- package/dist/{chunk-OFWU6UKF.cjs → chunk-C7OP3FAK.cjs} +47 -11
- package/dist/chunk-C7OP3FAK.cjs.map +1 -0
- package/dist/{chunk-UZBA6YYP.cjs → chunk-CAFV7WPQ.cjs} +540 -534
- package/dist/chunk-CAFV7WPQ.cjs.map +1 -0
- package/dist/{chunk-BUGVDCI5.cjs → chunk-CEIHCKTO.cjs} +4 -4
- package/dist/chunk-CEIHCKTO.cjs.map +1 -0
- package/dist/{chunk-3BSP7LSG.cjs → chunk-CN6UX5EV.cjs} +28 -56
- package/dist/chunk-CN6UX5EV.cjs.map +1 -0
- package/dist/{chunk-5BVBNE2F.js → chunk-D7IULBF2.js} +3 -3
- package/dist/{chunk-5BVBNE2F.js.map → chunk-D7IULBF2.js.map} +1 -1
- package/dist/{chunk-G7X2Y7Y2.cjs → chunk-DAXEQELR.cjs} +186 -236
- package/dist/chunk-DAXEQELR.cjs.map +1 -0
- package/dist/{chunk-YVI4YPUP.cjs → chunk-DGLLVCNB.cjs} +4 -4
- package/dist/{chunk-YVI4YPUP.cjs.map → chunk-DGLLVCNB.cjs.map} +1 -1
- package/dist/{chunk-JI34KBNC.js → chunk-DKFGUOWL.js} +3 -3
- package/dist/{chunk-JI34KBNC.js.map → chunk-DKFGUOWL.js.map} +1 -1
- package/dist/{chunk-ZET34IZE.cjs → chunk-DMTZ3FII.cjs} +5 -5
- package/dist/{chunk-ZET34IZE.cjs.map → chunk-DMTZ3FII.cjs.map} +1 -1
- package/dist/{chunk-6XZBKFQ7.js → chunk-DU7DE543.js} +3 -3
- package/dist/{chunk-6XZBKFQ7.js.map → chunk-DU7DE543.js.map} +1 -1
- package/dist/{chunk-VVMLMKYZ.cjs → chunk-DWY25VLP.cjs} +9 -9
- package/dist/{chunk-VVMLMKYZ.cjs.map → chunk-DWY25VLP.cjs.map} +1 -1
- package/dist/{chunk-R4AMI7KD.cjs → chunk-E4IUN3JB.cjs} +15 -15
- package/dist/{chunk-R4AMI7KD.cjs.map → chunk-E4IUN3JB.cjs.map} +1 -1
- package/dist/{chunk-TKDWD3MU.cjs → chunk-ECHGWE47.cjs} +4 -4
- package/dist/{chunk-TKDWD3MU.cjs.map → chunk-ECHGWE47.cjs.map} +1 -1
- package/dist/{chunk-KL7E244K.cjs → chunk-ECW2MLEW.cjs} +4 -4
- package/dist/{chunk-KL7E244K.cjs.map → chunk-ECW2MLEW.cjs.map} +1 -1
- package/dist/{chunk-EDI7DBWO.js → chunk-ET6PHZRX.js} +3 -3
- package/dist/{chunk-EDI7DBWO.js.map → chunk-ET6PHZRX.js.map} +1 -1
- package/dist/{chunk-HLK35TD7.cjs → chunk-FOZC5H7V.cjs} +24 -24
- package/dist/{chunk-HLK35TD7.cjs.map → chunk-FOZC5H7V.cjs.map} +1 -1
- package/dist/{chunk-SRIF7HMN.cjs → chunk-FWBSDQZ7.cjs} +5 -5
- package/dist/{chunk-SRIF7HMN.cjs.map → chunk-FWBSDQZ7.cjs.map} +1 -1
- package/dist/{chunk-XKBJT7WI.cjs → chunk-G2Q3ZC6C.cjs} +4 -4
- package/dist/{chunk-XKBJT7WI.cjs.map → chunk-G2Q3ZC6C.cjs.map} +1 -1
- package/dist/{chunk-4MWBKBS4.cjs → chunk-G4XUXSRN.cjs} +12 -12
- package/dist/{chunk-4MWBKBS4.cjs.map → chunk-G4XUXSRN.cjs.map} +1 -1
- package/dist/{chunk-EE24WJJR.js → chunk-GTVJIGAH.js} +5 -5
- package/dist/{chunk-EE24WJJR.js.map → chunk-GTVJIGAH.js.map} +1 -1
- package/dist/{chunk-VUDH4D2M.js → chunk-H3BOKK42.js} +282 -276
- package/dist/chunk-H3BOKK42.js.map +1 -0
- package/dist/{chunk-BT6DFWZB.cjs → chunk-HIQFVHC6.cjs} +9 -9
- package/dist/{chunk-BT6DFWZB.cjs.map → chunk-HIQFVHC6.cjs.map} +1 -1
- package/dist/{chunk-HI6G3SNY.js → chunk-HSPVMV6T.js} +76 -125
- package/dist/chunk-HSPVMV6T.js.map +1 -0
- package/dist/{chunk-UWEALKAN.js → chunk-HWNVAUK4.js} +3 -3
- package/dist/{chunk-UWEALKAN.js.map → chunk-HWNVAUK4.js.map} +1 -1
- package/dist/{chunk-3VKTDQMX.cjs → chunk-I53ZQHU6.cjs} +4 -4
- package/dist/{chunk-3VKTDQMX.cjs.map → chunk-I53ZQHU6.cjs.map} +1 -1
- package/dist/{chunk-A3MHE2MQ.cjs → chunk-IHFNRNTJ.cjs} +8 -8
- package/dist/{chunk-A3MHE2MQ.cjs.map → chunk-IHFNRNTJ.cjs.map} +1 -1
- package/dist/{chunk-KCZW75PI.js → chunk-IVSD7L22.js} +12 -4
- package/dist/chunk-IVSD7L22.js.map +1 -0
- package/dist/{chunk-JCXIDFRI.js → chunk-J3UK2GMN.js} +3 -3
- package/dist/{chunk-JCXIDFRI.js.map → chunk-J3UK2GMN.js.map} +1 -1
- package/dist/{chunk-IBDE4R5L.cjs → chunk-J6T5LWJ4.cjs} +10 -9
- package/dist/chunk-J6T5LWJ4.cjs.map +1 -0
- package/dist/{chunk-AOZYORH7.js → chunk-JRLXEYR4.js} +21 -5
- package/dist/chunk-JRLXEYR4.js.map +1 -0
- package/dist/{chunk-EUB7YLU2.js → chunk-JZUPMTJY.js} +3 -3
- package/dist/{chunk-EUB7YLU2.js.map → chunk-JZUPMTJY.js.map} +1 -1
- package/dist/{chunk-ZK3BJ4XQ.js → chunk-KE6XKRLQ.js} +3 -3
- package/dist/{chunk-ZK3BJ4XQ.js.map → chunk-KE6XKRLQ.js.map} +1 -1
- package/dist/{chunk-4NVV3GRU.js → chunk-KGRIHEDT.js} +5 -5
- package/dist/{chunk-4NVV3GRU.js.map → chunk-KGRIHEDT.js.map} +1 -1
- package/dist/{chunk-LGCEYEU2.js → chunk-KX7JV5KM.js} +3 -3
- package/dist/{chunk-LGCEYEU2.js.map → chunk-KX7JV5KM.js.map} +1 -1
- package/dist/{chunk-2K7PRHDB.cjs → chunk-LALG2K33.cjs} +8 -8
- package/dist/{chunk-2K7PRHDB.cjs.map → chunk-LALG2K33.cjs.map} +1 -1
- package/dist/{chunk-4WIJSKFA.js → chunk-LGILIGV3.js} +3 -3
- package/dist/{chunk-4WIJSKFA.js.map → chunk-LGILIGV3.js.map} +1 -1
- package/dist/{chunk-7QDTZJRV.js → chunk-LJX2SQV2.js} +6 -6
- package/dist/{chunk-7QDTZJRV.js.map → chunk-LJX2SQV2.js.map} +1 -1
- package/dist/{chunk-ACHGT3D2.js → chunk-MC5EINBV.js} +44 -8
- package/dist/chunk-MC5EINBV.js.map +1 -0
- package/dist/{chunk-M6UUTNDT.js → chunk-ML5A5DOJ.js} +4 -4
- package/dist/{chunk-M6UUTNDT.js.map → chunk-ML5A5DOJ.js.map} +1 -1
- package/dist/{chunk-3MUIYMUG.cjs → chunk-N475ETD6.cjs} +17 -17
- package/dist/{chunk-3MUIYMUG.cjs.map → chunk-N475ETD6.cjs.map} +1 -1
- package/dist/chunk-OXNYIMZZ.js +31 -0
- package/dist/chunk-OXNYIMZZ.js.map +1 -0
- package/dist/{chunk-YCHC45BY.js → chunk-PI4RO4GR.js} +3 -3
- package/dist/{chunk-YCHC45BY.js.map → chunk-PI4RO4GR.js.map} +1 -1
- package/dist/chunk-QKE556YD.js +197 -0
- package/dist/chunk-QKE556YD.js.map +1 -0
- package/dist/{chunk-FV3YEMQ7.js → chunk-RP5HQVLD.js} +13 -14
- package/dist/chunk-RP5HQVLD.js.map +1 -0
- package/dist/chunk-SCFW5MJZ.js +100 -0
- package/dist/chunk-SCFW5MJZ.js.map +1 -0
- package/dist/{chunk-ZYOHF37V.js → chunk-SG5ZWT6C.js} +3 -3
- package/dist/{chunk-ZYOHF37V.js.map → chunk-SG5ZWT6C.js.map} +1 -1
- package/dist/{chunk-ED7ANP6W.cjs → chunk-TIMPJL5V.cjs} +4 -4
- package/dist/{chunk-ED7ANP6W.cjs.map → chunk-TIMPJL5V.cjs.map} +1 -1
- package/dist/{chunk-3XKVRLR2.js → chunk-TOTP24P6.js} +4 -4
- package/dist/{chunk-3XKVRLR2.js.map → chunk-TOTP24P6.js.map} +1 -1
- package/dist/{chunk-PG3QQLWS.cjs → chunk-USZTVNUQ.cjs} +5 -5
- package/dist/{chunk-PG3QQLWS.cjs.map → chunk-USZTVNUQ.cjs.map} +1 -1
- package/dist/{chunk-XS7SKY2F.js → chunk-V2RBCCN5.js} +3 -3
- package/dist/chunk-V2RBCCN5.js.map +1 -0
- package/dist/{chunk-D3SJLXYZ.cjs → chunk-VJYSQXN6.cjs} +10 -10
- package/dist/{chunk-D3SJLXYZ.cjs.map → chunk-VJYSQXN6.cjs.map} +1 -1
- package/dist/{chunk-6ZGD7R27.cjs → chunk-VWI3CDEW.cjs} +8 -75
- package/dist/chunk-VWI3CDEW.cjs.map +1 -0
- package/dist/{chunk-MXRBNJ6D.cjs → chunk-W4WKVOOQ.cjs} +11 -11
- package/dist/{chunk-MXRBNJ6D.cjs.map → chunk-W4WKVOOQ.cjs.map} +1 -1
- package/dist/chunk-XYOHKCYG.cjs +109 -0
- package/dist/chunk-XYOHKCYG.cjs.map +1 -0
- package/dist/{chunk-UD2T7ISG.js → chunk-YP67XZES.js} +4 -4
- package/dist/{chunk-UD2T7ISG.js.map → chunk-YP67XZES.js.map} +1 -1
- package/dist/{chunk-HHUDNTZC.js → chunk-YRXY2A5L.js} +4 -4
- package/dist/{chunk-HHUDNTZC.js.map → chunk-YRXY2A5L.js.map} +1 -1
- package/dist/{chunk-6OKPJZMX.cjs → chunk-Z2CUEBXV.cjs} +25 -9
- package/dist/chunk-Z2CUEBXV.cjs.map +1 -0
- package/dist/compact-session-GKA7GFVT.js +18 -0
- package/dist/{compact-session-RR3ILTES.js.map → compact-session-GKA7GFVT.js.map} +1 -1
- package/dist/compact-session-XMP6OGY3.cjs +55 -0
- package/dist/{compact-session-YOWJJPPB.cjs.map → compact-session-XMP6OGY3.cjs.map} +1 -1
- package/dist/compaction.cjs +16 -16
- package/dist/compaction.js +3 -3
- package/dist/concurrency.cjs +6 -6
- package/dist/concurrency.js +4 -4
- package/dist/context-2FZSC6VQ.cjs +22 -0
- package/dist/{context-Q6ISOCN2.cjs.map → context-2FZSC6VQ.cjs.map} +1 -1
- package/dist/context-ATJJAFOS.js +5 -0
- package/dist/{context-ZDBBPIHY.js.map → context-ATJJAFOS.js.map} +1 -1
- package/dist/{cron-ChQ6zcW2.d.ts → cron-Bx7tzm5R.d.ts} +54 -2
- package/dist/{cron-BdXOZco9.d.cts → cron-D-DVjGQe.d.cts} +54 -2
- package/dist/cron.cjs +33 -29
- package/dist/cron.d.cts +3 -3
- package/dist/cron.d.ts +3 -3
- package/dist/cron.js +32 -28
- package/dist/{errors-BUVjJGJA.d.cts → errors-DMY-gLSK.d.cts} +1 -1
- package/dist/{errors-CZIUKLHt.d.ts → errors-DjBQ4Tn8.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 +41 -36
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +37 -32
- package/dist/eval.js.map +1 -1
- package/dist/{executor-DPCBSI35.cjs → executor-BMRICN46.cjs} +26 -25
- package/dist/executor-BMRICN46.cjs.map +1 -0
- package/dist/{executor-ASDDIM2X.js → executor-T65PPOPT.js} +10 -9
- package/dist/executor-T65PPOPT.js.map +1 -0
- package/dist/filesystem/index.cjs +7 -7
- package/dist/filesystem/index.js +3 -3
- package/dist/fs-session-store-J5MCFFUM.cjs +19 -0
- package/dist/{fs-session-store-T5ZLQX42.cjs.map → fs-session-store-J5MCFFUM.cjs.map} +1 -1
- package/dist/fs-session-store-O6FNHECD.js +10 -0
- package/dist/{fs-session-store-K5QUPNJZ.js.map → fs-session-store-O6FNHECD.js.map} +1 -1
- package/dist/generate-object-UF6WIZLF.cjs +20 -0
- package/dist/{generate-object-F56VIZ6U.cjs.map → generate-object-UF6WIZLF.cjs.map} +1 -1
- package/dist/generate-object-XDCBYVK3.js +7 -0
- package/dist/{generate-object-LPSO6GVW.js.map → generate-object-XDCBYVK3.js.map} +1 -1
- package/dist/index-manager-N7RQYUKT.cjs +20 -0
- package/dist/{index-manager-DBJ55ZSO.cjs.map → index-manager-N7RQYUKT.cjs.map} +1 -1
- package/dist/index-manager-ZVZUHPP7.js +11 -0
- package/dist/{index-manager-F2H2RCZU.js.map → index-manager-ZVZUHPP7.js.map} +1 -1
- package/dist/index.cjs +138 -132
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +167 -9
- package/dist/index.d.ts +167 -9
- package/dist/index.js +47 -44
- package/dist/index.js.map +1 -1
- package/dist/{inject-session-RKNLUE72.js → inject-session-7P4CZGDT.js} +7 -6
- package/dist/inject-session-7P4CZGDT.js.map +1 -0
- package/dist/{inject-session-25EC74WV.cjs → inject-session-CC4KBYF6.cjs} +9 -8
- package/dist/inject-session-CC4KBYF6.cjs.map +1 -0
- package/dist/internal/agent-loop/loop-thinking-steps.d.ts +28 -0
- package/dist/internal/agent-loop/message-builders.d.ts +12 -3
- package/dist/internal/diagnostics.d.ts +24 -11
- package/dist/internal/llm/anthropic-shared.d.ts +4 -4
- package/dist/internal/llm/types.d.ts +49 -9
- package/dist/internal/local-agent/mcp-pool.d.ts +7 -3
- package/dist/internal/memory/adapters/azure-openai-embedding.d.cts +2 -0
- package/dist/internal/memory/adapters/catalog.d.cts +1 -0
- package/dist/internal/memory/adapters/cohere-embedding.d.cts +2 -0
- package/dist/internal/memory/adapters/deepinfra-embedding.d.cts +2 -0
- package/dist/internal/memory/adapters/gemini-embedding.d.cts +2 -0
- package/dist/internal/memory/adapters/index.cjs +28 -0
- package/dist/internal/memory/adapters/index.cjs.map +1 -0
- package/dist/internal/memory/adapters/index.d.cts +16 -0
- package/dist/internal/memory/adapters/index.d.ts +16 -0
- package/dist/internal/memory/adapters/index.js +11 -0
- package/dist/internal/memory/adapters/index.js.map +1 -0
- package/dist/internal/memory/adapters/jina-embedding.d.cts +2 -0
- package/dist/internal/memory/adapters/mistral-embedding.d.cts +2 -0
- package/dist/internal/memory/adapters/ollama-embedding.d.cts +34 -0
- package/dist/internal/memory/adapters/openai-compatible.d.cts +51 -0
- package/dist/internal/memory/adapters/openai-compatible.d.ts +28 -0
- package/dist/internal/memory/adapters/openai-embedding.d.cts +2 -0
- package/dist/internal/memory/adapters/openrouter-embedding.d.cts +2 -0
- package/dist/internal/memory/adapters/voyage-embedding.d.cts +2 -0
- package/dist/internal/memory/dreaming/diary.d.ts +4 -0
- package/dist/internal/memory/dreaming/phases.d.ts +15 -0
- package/dist/internal/memory/dreaming/run.d.ts +10 -0
- package/dist/internal/memory/migrate-sqlite-to-lance.d.ts +15 -0
- package/dist/internal/memory/sdk-memory-peer-loader.d.ts +21 -0
- package/dist/internal/persistence/index.cjs +25 -25
- package/dist/internal/persistence/index.js +6 -6
- package/dist/internal/persistence/session-transcript.d.cts +6 -0
- package/dist/internal/persistence/session-transcript.d.ts +6 -0
- package/dist/internal/runtime/concurrency/subagent-credentials.d.ts +35 -0
- package/dist/internal/security/index.cjs +13 -13
- package/dist/internal/security/index.js +3 -3
- package/dist/internal/session/agent-session-store.d.ts +1 -0
- package/dist/internal/session/session-types.d.ts +6 -1
- package/dist/judge-call-NA2G6ZMJ.js +5 -0
- package/dist/{judge-call-3S3T6O2Z.js.map → judge-call-NA2G6ZMJ.js.map} +1 -1
- package/dist/judge-call-U2D33JOW.cjs +22 -0
- package/dist/{judge-call-XIQJ5GIE.cjs.map → judge-call-U2D33JOW.cjs.map} +1 -1
- package/dist/models.cjs +20 -20
- package/dist/models.js +5 -5
- package/dist/path-safety.cjs +10 -10
- package/dist/path-safety.js +3 -3
- package/dist/persistence.cjs +35 -35
- package/dist/persistence.js +7 -7
- package/dist/project.cjs +5 -5
- package/dist/project.js +3 -3
- package/dist/registry-CAS6Y5ZY.js +9 -0
- package/dist/{registry-KMI5RA22.js.map → registry-CAS6Y5ZY.js.map} +1 -1
- package/dist/registry-JSDI4WKA.cjs +46 -0
- package/dist/{registry-BA3SLAN7.cjs.map → registry-JSDI4WKA.cjs.map} +1 -1
- package/dist/retry.cjs +4 -4
- package/dist/retry.js +3 -3
- package/dist/{run-vJHg2eGw.d.cts → run-i2-fUohR.d.cts} +16 -0
- package/dist/{run-vJHg2eGw.d.ts → run-i2-fUohR.d.ts} +16 -0
- package/dist/sandbox/index.cjs +6 -6
- package/dist/sandbox/index.js +2 -2
- 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-3B52DKTG.js +5 -0
- package/dist/{session-transcript-MMPWCESR.js.map → session-transcript-3B52DKTG.js.map} +1 -1
- package/dist/session-transcript-H7NUFXXM.cjs +50 -0
- package/dist/{session-transcript-DFGX6WNL.cjs.map → session-transcript-H7NUFXXM.cjs.map} +1 -1
- package/dist/skills.cjs +7 -7
- package/dist/skills.js +5 -5
- package/dist/stream-object-4FDU76YW.cjs +20 -0
- package/dist/{stream-object-YPXZ4F5P.cjs.map → stream-object-4FDU76YW.cjs.map} +1 -1
- package/dist/stream-object-HWDEEQN4.js +7 -0
- package/dist/{stream-object-AFERZU63.js.map → stream-object-HWDEEQN4.js.map} +1 -1
- package/dist/subagents-loader-A4W6C3QP.cjs +15 -0
- package/dist/subagents-loader-A4W6C3QP.cjs.map +1 -0
- package/dist/subagents-loader-X33KH2SZ.js +6 -0
- package/dist/subagents-loader-X33KH2SZ.js.map +1 -0
- 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.d.ts +68 -3
- package/dist/types/conversation.d.ts +7 -0
- package/dist/types/messages.d.ts +9 -0
- package/dist/types/session-message.d.ts +59 -0
- package/dist/types/workflow.d.ts +36 -0
- package/dist/workflow.cjs +27 -27
- package/dist/workflow.d.cts +17 -1
- package/dist/workflow.d.ts +17 -1
- package/dist/workflow.js +6 -6
- package/docs/harness-capability-map.md +22 -0
- package/package.json +11 -1
- package/dist/agent-2GZC4W2A.cjs +0 -51
- package/dist/agent-3H3UKD6U.js +0 -42
- package/dist/batch-LXSALQC3.js.map +0 -1
- package/dist/batch-NZGN6SFV.cjs.map +0 -1
- package/dist/chunk-3BSP7LSG.cjs.map +0 -1
- package/dist/chunk-4APWS2YF.js.map +0 -1
- package/dist/chunk-6OKPJZMX.cjs.map +0 -1
- package/dist/chunk-6ZGD7R27.cjs.map +0 -1
- package/dist/chunk-A4XXV2C6.js.map +0 -1
- package/dist/chunk-A6GXYF2Q.js.map +0 -1
- package/dist/chunk-ACHGT3D2.js.map +0 -1
- package/dist/chunk-AOZYORH7.js.map +0 -1
- package/dist/chunk-BE3W4HYV.cjs.map +0 -1
- package/dist/chunk-BUGVDCI5.cjs.map +0 -1
- package/dist/chunk-FV3YEMQ7.js.map +0 -1
- package/dist/chunk-G2F67XUR.cjs.map +0 -1
- package/dist/chunk-G7X2Y7Y2.cjs.map +0 -1
- package/dist/chunk-HI6G3SNY.js.map +0 -1
- package/dist/chunk-IBDE4R5L.cjs.map +0 -1
- package/dist/chunk-KCZW75PI.js.map +0 -1
- package/dist/chunk-OFWU6UKF.cjs.map +0 -1
- package/dist/chunk-UZBA6YYP.cjs.map +0 -1
- package/dist/chunk-VUDH4D2M.js.map +0 -1
- package/dist/chunk-XS7SKY2F.js.map +0 -1
- package/dist/compact-session-RR3ILTES.js +0 -17
- package/dist/compact-session-YOWJJPPB.cjs +0 -54
- package/dist/context-Q6ISOCN2.cjs +0 -22
- package/dist/context-ZDBBPIHY.js +0 -5
- package/dist/executor-ASDDIM2X.js.map +0 -1
- package/dist/executor-DPCBSI35.cjs.map +0 -1
- package/dist/fs-session-store-K5QUPNJZ.js +0 -10
- package/dist/fs-session-store-T5ZLQX42.cjs +0 -19
- package/dist/generate-object-F56VIZ6U.cjs +0 -20
- package/dist/generate-object-LPSO6GVW.js +0 -7
- package/dist/index-manager-DBJ55ZSO.cjs +0 -19
- package/dist/index-manager-F2H2RCZU.js +0 -10
- package/dist/inject-session-25EC74WV.cjs.map +0 -1
- package/dist/inject-session-RKNLUE72.js.map +0 -1
- package/dist/judge-call-3S3T6O2Z.js +0 -5
- package/dist/judge-call-XIQJ5GIE.cjs +0 -22
- package/dist/registry-BA3SLAN7.cjs +0 -46
- package/dist/registry-KMI5RA22.js +0 -9
- package/dist/session-transcript-DFGX6WNL.cjs +0 -50
- package/dist/session-transcript-MMPWCESR.js +0 -5
- package/dist/stream-object-AFERZU63.js +0 -7
- package/dist/stream-object-YPXZ4F5P.cjs +0 -20
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { enqueueSessionWrite } from './chunk-
|
|
1
|
+
import { enqueueSessionWrite } from './chunk-7YSRCQDE.js';
|
|
2
2
|
import { invalidateSessionCache } from './chunk-5KOW3GLE.js';
|
|
3
|
-
import
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-
|
|
3
|
+
import './chunk-3I4B3OIX.js';
|
|
4
|
+
import { SessionTranscript } from './chunk-JRLXEYR4.js';
|
|
5
|
+
import './chunk-KX7JV5KM.js';
|
|
6
|
+
import './chunk-IVSD7L22.js';
|
|
6
7
|
|
|
7
8
|
// src/internal/session/inject-session.ts
|
|
8
9
|
async function injectSessionTurn(opts) {
|
|
@@ -21,5 +22,5 @@ async function injectSessionTurn(opts) {
|
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export { injectSessionTurn };
|
|
24
|
-
//# sourceMappingURL=inject-session-
|
|
25
|
-
//# sourceMappingURL=inject-session-
|
|
25
|
+
//# sourceMappingURL=inject-session-7P4CZGDT.js.map
|
|
26
|
+
//# sourceMappingURL=inject-session-7P4CZGDT.js.map
|
|
@@ -0,0 +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-7P4CZGDT.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"]}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkVWI3CDEW_cjs = require('./chunk-VWI3CDEW.cjs');
|
|
4
4
|
var chunkBURYFNOM_cjs = require('./chunk-BURYFNOM.cjs');
|
|
5
|
-
|
|
6
|
-
require('./chunk-
|
|
7
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-XYOHKCYG.cjs');
|
|
6
|
+
var chunkZ2CUEBXV_cjs = require('./chunk-Z2CUEBXV.cjs');
|
|
7
|
+
require('./chunk-DGLLVCNB.cjs');
|
|
8
|
+
require('./chunk-BCQ3E2ZG.cjs');
|
|
8
9
|
|
|
9
10
|
// src/internal/session/inject-session.ts
|
|
10
11
|
async function injectSessionTurn(opts) {
|
|
11
|
-
await
|
|
12
|
+
await chunkVWI3CDEW_cjs.enqueueSessionWrite(opts.loc.cwd, opts.loc.agentId, async () => {
|
|
12
13
|
const prior = await opts.store.readRecords(opts.loc.agentId);
|
|
13
|
-
const transcript =
|
|
14
|
+
const transcript = chunkZ2CUEBXV_cjs.SessionTranscript.fromRecords(prior, {
|
|
14
15
|
cwd: opts.loc.cwd,
|
|
15
16
|
sessionId: opts.sessionId,
|
|
16
17
|
model: opts.loc.model ?? "unknown"
|
|
@@ -23,5 +24,5 @@ async function injectSessionTurn(opts) {
|
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
exports.injectSessionTurn = injectSessionTurn;
|
|
26
|
-
//# sourceMappingURL=inject-session-
|
|
27
|
-
//# sourceMappingURL=inject-session-
|
|
27
|
+
//# sourceMappingURL=inject-session-CC4KBYF6.cjs.map
|
|
28
|
+
//# sourceMappingURL=inject-session-CC4KBYF6.cjs.map
|
|
@@ -0,0 +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-CC4KBYF6.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"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* theokit#122 — where a round's thinking block becomes a conversation step.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from `loop.ts` when it crossed the G8 400-LoC cap. These two belong together: both
|
|
5
|
+
* answer "the round produced a thinking block — where does it land in the persisted conversation",
|
|
6
|
+
* and the answer differs by which path closes the round.
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
import type { LlmThinkingPart } from "../llm/types.js";
|
|
11
|
+
import type { LoopContext } from "./loop-context-init.js";
|
|
12
|
+
/**
|
|
13
|
+
* theokit#122 — the round's thinking block as a conversation step.
|
|
14
|
+
*
|
|
15
|
+
* Shared by the two paths that can close a round: the assistant-text path and the tool_use path.
|
|
16
|
+
* The tool_use path is the one that matters — a round of thinking + a tool call with NO preamble
|
|
17
|
+
* text is the common Anthropic shape, and it is exactly the case the first version of this fix
|
|
18
|
+
* dropped (the block stayed on the context and was persisted against the NEXT round's text).
|
|
19
|
+
*/
|
|
20
|
+
export declare function thinkingStep(thinking: LlmThinkingPart): ConversationStep;
|
|
21
|
+
/**
|
|
22
|
+
* theokit#122 — persist the block for a round that called a tool and said nothing.
|
|
23
|
+
*
|
|
24
|
+
* Such a round emits no assistant-text step, so without this the block is never recorded for it —
|
|
25
|
+
* which is exactly how the first version of this fix let round N's signature reach round N+1.
|
|
26
|
+
* No-op when the round had text (the text path already recorded it) or produced no thinking.
|
|
27
|
+
*/
|
|
28
|
+
export declare function recordThinkingOnSilentToolRound(ctx: LoopContext, text: string, thinking: LlmThinkingPart | undefined): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SDKAssistantMessage, SDKThinkingMessage, SDKUserMessageEvent } from "../../types/messages.js";
|
|
2
|
-
import type { LlmMessage, LlmToolCallPart } from "../llm/types.js";
|
|
2
|
+
import type { LlmMessage, LlmThinkingPart, LlmToolCallPart } from "../llm/types.js";
|
|
3
3
|
import type { AgentLoopInputs } from "./loop-types.js";
|
|
4
4
|
export declare function buildUserEvent(inputs: AgentLoopInputs): SDKUserMessageEvent;
|
|
5
5
|
export declare function buildAssistantEvent(inputs: AgentLoopInputs, text: string): SDKAssistantMessage;
|
|
@@ -8,5 +8,14 @@ export declare function buildAssistantEvent(inputs: AgentLoopInputs, text: strin
|
|
|
8
8
|
* issue #48: when the reasoning duration was measured, carry it as `thinking_duration_ms`
|
|
9
9
|
* so a `Run.stream()` replay can render how long the model reasoned.
|
|
10
10
|
*/
|
|
11
|
-
export declare function buildThinkingEvent(inputs: AgentLoopInputs, text: string, thinkingDurationMs?: number): SDKThinkingMessage;
|
|
12
|
-
|
|
11
|
+
export declare function buildThinkingEvent(inputs: AgentLoopInputs, text: string, thinkingDurationMs?: number, signature?: string): SDKThinkingMessage;
|
|
12
|
+
/**
|
|
13
|
+
* theokit#122 — `thinking` is FIRST, and that ordering is a provider requirement, not a preference.
|
|
14
|
+
*
|
|
15
|
+
* Anthropic verifies the signed block on the next request and requires it to lead the assistant
|
|
16
|
+
* message it belongs to. Omitting it (which this builder did until theokit#122's follow-up) makes
|
|
17
|
+
* round 2 of any thinking + tools run fail with `400 "thinking blocks cannot be modified"` — the
|
|
18
|
+
* exact failure the issue exists to remove. An unsigned block is passed through here and dropped at
|
|
19
|
+
* the wire by `thinkingToWireBlock`, which is where that policy belongs.
|
|
20
|
+
*/
|
|
21
|
+
export declare function buildAssistantTurn(text: string, toolCalls: LlmToolCallPart[], thinking?: LlmThinkingPart): LlmMessage;
|
|
@@ -16,20 +16,33 @@
|
|
|
16
16
|
*
|
|
17
17
|
* - **`setDiagnosticsSink(fn)`** hands the messages to the application, which decides where to put
|
|
18
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,
|
|
19
|
+
* - **With no sink, nothing is emitted.** A library does not own the host's terminal.
|
|
20
20
|
*
|
|
21
|
-
* ##
|
|
21
|
+
* ## Silent by default, and how 36 suites survived the flip
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
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.
|
|
23
|
+
* The default WAS `stderr`, and 36 test files spy on `process.stderr.write` to assert a given
|
|
24
|
+
* warning is emitted. That contract is real and had to survive; migrating all 36 by hand, across
|
|
25
|
+
* four different spy styles, is how you weaken 36 suites in one commit.
|
|
28
26
|
*
|
|
29
|
-
* So
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
27
|
+
* So the flip happened at the default, and `vitest.setup.ts` installs a sink that FORWARDS to
|
|
28
|
+
* `stderr` for the duration of every test. Those assertions still test what they always tested —
|
|
29
|
+
* "this condition emits a diagnostic" — through the channel a host would use, while production
|
|
30
|
+
* emits nothing unless asked.
|
|
31
|
+
*
|
|
32
|
+
* The cost is stated rather than hidden: no test observes the production default by accident, so
|
|
33
|
+
* `tests/diagnostics-public-entry.test.ts` pins it explicitly by clearing the sink first.
|
|
34
|
+
*
|
|
35
|
+
* ## Coverage is the whole guarantee
|
|
36
|
+
*
|
|
37
|
+
* The first sweep migrated the 92 sites under `internal/` and left `src/`'s own modules —
|
|
38
|
+
* `event-bus.ts`, `batch.ts`, `compaction.ts`, `internal/workflow/step-branch.ts`. A host could
|
|
39
|
+
* therefore install a sink and still have its frame corrupted by a batch run, which is the reported
|
|
40
|
+
* defect with a smaller blast radius. Those are routed here too, and
|
|
41
|
+
* `tests/lint/no-direct-terminal-write.test.ts` is what keeps the next hot path from
|
|
42
|
+
* reintroducing one. "Mostly interceptable" is not interceptable.
|
|
43
|
+
*
|
|
44
|
+
* The remaining direct writers are allowlisted there with a reason, and every one of them is a seam
|
|
45
|
+
* whose destination the CALLER already chooses (`opts.warn`, `opts.logger`, the Workflow logger).
|
|
33
46
|
*
|
|
34
47
|
* ## What this is NOT
|
|
35
48
|
*
|
|
@@ -25,10 +25,6 @@ export interface AnthropicResponseLike {
|
|
|
25
25
|
export declare function extractAnthropicText(response: AnthropicResponseLike): string;
|
|
26
26
|
export declare function extractAnthropicToolCalls(response: AnthropicResponseLike): LlmToolCallPart[];
|
|
27
27
|
export declare function mapAnthropicStopReason(reason: string | null): LlmStopReason;
|
|
28
|
-
/**
|
|
29
|
-
* Convert an SDK `LlmMessage` to the Anthropic Messages wire shape.
|
|
30
|
-
* Identical across the three Anthropic-compatible clients (D289/D292).
|
|
31
|
-
*/
|
|
32
28
|
export declare function toAnthropicWireMessage(message: LlmMessage): Record<string, unknown>;
|
|
33
29
|
/**
|
|
34
30
|
* Build the common body shape for Anthropic Messages requests. Caller
|
|
@@ -93,4 +89,8 @@ export declare function buildAnthropicCommonBody(request: LlmRequest): {
|
|
|
93
89
|
description: string;
|
|
94
90
|
input_schema: unknown;
|
|
95
91
|
}>;
|
|
92
|
+
thinking?: {
|
|
93
|
+
type: "enabled";
|
|
94
|
+
budget_tokens: number;
|
|
95
|
+
};
|
|
96
96
|
};
|
|
@@ -43,7 +43,24 @@ export interface LlmImagePart {
|
|
|
43
43
|
url: string;
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
/**
|
|
47
|
+
* theokit#122 — an extended-thinking block, carried WITH its provider-issued signature.
|
|
48
|
+
*
|
|
49
|
+
* The signature is the whole reason this part exists. Anthropic requires a resumed conversation to
|
|
50
|
+
* replay each `thinking` block byte-identically, signature included; replaying the text alone is
|
|
51
|
+
* rejected with `400 "thinking blocks cannot be modified"` (anthropics/claude-code#63147). So a
|
|
52
|
+
* session that used extended thinking could be persisted but never resumed.
|
|
53
|
+
*
|
|
54
|
+
* `signature` is optional because not every provider issues one — the OpenAI-compatible reasoning
|
|
55
|
+
* channel streams `reasoning`/`reasoning_content` text with no signature at all. A part without a
|
|
56
|
+
* signature is display-only history; it must not be replayed to Anthropic as a thinking block.
|
|
57
|
+
*/
|
|
58
|
+
export interface LlmThinkingPart {
|
|
59
|
+
type: "thinking";
|
|
60
|
+
text: string;
|
|
61
|
+
signature?: string;
|
|
62
|
+
}
|
|
63
|
+
export type LlmContentPart = LlmTextPart | LlmToolCallPart | LlmToolResultPart | LlmImagePart | LlmThinkingPart;
|
|
47
64
|
export interface LlmMessage {
|
|
48
65
|
role: "system" | "user" | "assistant";
|
|
49
66
|
content: LlmContentPart[];
|
|
@@ -122,20 +139,36 @@ export interface LlmRequest {
|
|
|
122
139
|
*/
|
|
123
140
|
toolChoice?: "auto" | "none" | "required";
|
|
124
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* What a provider stream reports WHILE it is running. Tool calls are deliberately absent.
|
|
144
|
+
*
|
|
145
|
+
* theokit#144: this union used to declare `tool_use` and `stop` variants. Only two providers ever
|
|
146
|
+
* yielded them (`responses.ts`, `fault-injection.ts`), the loop's collector
|
|
147
|
+
* (`loop-llm-stream.ts`) never read them, and the tool calls they carried were duplicates of what
|
|
148
|
+
* `LlmFinish.toolCalls` already returned. So they were not a live tool channel — they were a
|
|
149
|
+
* declaration of one, which is worse: it told implementers a provider-level channel existed and
|
|
150
|
+
* cost `@theokit/agents` a workaround (holding every `text_delta` until the stream drained, which
|
|
151
|
+
* broke live token streaming on text-only turns — issue #47).
|
|
152
|
+
*
|
|
153
|
+
* Wiring them instead of deleting them was rejected: `openai.ts` and `anthropic.ts` cannot produce
|
|
154
|
+
* them at all (their tool calls only resolve at completion), so a live provider-level channel would
|
|
155
|
+
* exist on some providers and not others — a worse contract than a uniform one.
|
|
156
|
+
*
|
|
157
|
+
* **The canonical live tool channel is `onDelta`**: `tool-call-started` / `tool-call-completed`
|
|
158
|
+
* `InteractionUpdate`s, emitted by `runToolWithLifecycle` (`agent-loop/tool-dispatch.ts`) between
|
|
159
|
+
* LLM rounds. It is uniform across providers, carries a `callId` correlating the two ends, and
|
|
160
|
+
* fires before the post-tool answer text. `Run.events()` (theokit#140) merges it with the
|
|
161
|
+
* structural `SDKMessage`s into one ordered timeline.
|
|
162
|
+
*
|
|
163
|
+
* The stop reason is not an event either — it is returned once, on `LlmFinish.stopReason`.
|
|
164
|
+
*/
|
|
125
165
|
export type LlmEvent = {
|
|
126
166
|
type: "text_delta";
|
|
127
167
|
text: string;
|
|
128
168
|
} | {
|
|
129
169
|
type: "reasoning_delta";
|
|
130
170
|
text: string;
|
|
131
|
-
|
|
132
|
-
type: "tool_use";
|
|
133
|
-
id: string;
|
|
134
|
-
name: string;
|
|
135
|
-
input: Record<string, unknown>;
|
|
136
|
-
} | {
|
|
137
|
-
type: "stop";
|
|
138
|
-
reason: LlmStopReason;
|
|
171
|
+
signature?: string;
|
|
139
172
|
} | {
|
|
140
173
|
type: "error";
|
|
141
174
|
message: string;
|
|
@@ -153,6 +186,13 @@ export interface LlmFinish {
|
|
|
153
186
|
cacheWriteTokens?: number;
|
|
154
187
|
/** Reasoning tokens (OpenAI o-series). ADR D376. */
|
|
155
188
|
reasoningTokens?: number;
|
|
189
|
+
/**
|
|
190
|
+
* theokit#122 — the turn's extended-thinking block, with the provider's signature when it issued
|
|
191
|
+
* one. Returned on the finish value rather than reconstructed from the `reasoning_delta` text,
|
|
192
|
+
* because the signature arrives once for the whole block and only the provider adapter knows
|
|
193
|
+
* which block it belongs to.
|
|
194
|
+
*/
|
|
195
|
+
thinking?: LlmThinkingPart;
|
|
156
196
|
}
|
|
157
197
|
export interface LlmClient {
|
|
158
198
|
readonly name: string;
|
|
@@ -3,9 +3,13 @@
|
|
|
3
3
|
*
|
|
4
4
|
* `buildMcpMap` (`real-local-run.ts`) builds a fresh `McpClient` on every run, so each `send` pays
|
|
5
5
|
* spawn + handshake again: 193 / 138 / 134 ms per turn, measured. The reference anchors this at the
|
|
6
|
-
* session — Codex keeps its `
|
|
7
|
-
* (`core/src/state/service.rs:
|
|
8
|
-
* across turns"*, and REPLACES the runtime rather than rebuilding it.
|
|
6
|
+
* session — Codex keeps its `mcp_runtime: Arc<McpRuntime>` in `SessionServices`
|
|
7
|
+
* (`codex-rs/core/src/state/service.rs:51-58`), next to a field commented *"Session-scoped model
|
|
8
|
+
* client shared across turns"*, and REPLACES the runtime rather than rebuilding it.
|
|
9
|
+
*
|
|
10
|
+
* theokit#155: pooling the client OBJECT was never enough — the turn also has to stop closing what
|
|
11
|
+
* it does not own. See `runOwnsMcpClients` (`real-local-run.ts`) and the idempotent
|
|
12
|
+
* `StdioMcpClient.initialize()`.
|
|
9
13
|
*
|
|
10
14
|
* Generic over the client type on purpose: this file knows about keys, reuse and idleness, and
|
|
11
15
|
* nothing about MCP. That keeps it unit-testable without spawning a server, and keeps `McpClient`'s
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk7U2HAAWB_cjs = require('../../../chunk-7U2HAAWB.cjs');
|
|
4
|
+
require('../../../chunk-6YNYA7GD.cjs');
|
|
5
|
+
var chunk2RW7K6FN_cjs = require('../../../chunk-2RW7K6FN.cjs');
|
|
6
|
+
require('../../../chunk-MUUQ2WFJ.cjs');
|
|
7
|
+
require('../../../chunk-7OLG7VI4.cjs');
|
|
8
|
+
require('../../../chunk-TIMPJL5V.cjs');
|
|
9
|
+
require('../../../chunk-7YBJZS5P.cjs');
|
|
10
|
+
require('../../../chunk-IHFNRNTJ.cjs');
|
|
11
|
+
require('../../../chunk-BCQ3E2ZG.cjs');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
Object.defineProperty(exports, "createOpenAiCompatibleRuntime", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return chunk7U2HAAWB_cjs.createOpenAiCompatibleRuntime; }
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "LruEmbeddingCache", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return chunk2RW7K6FN_cjs.LruEmbeddingCache; }
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports, "globalEmbeddingCache", {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () { return chunk2RW7K6FN_cjs.globalEmbeddingCache; }
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=index.cjs.map
|
|
28
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* theokit#160 — the ONE embedding runtime, shared with `@theokit/sdk-memory`.
|
|
3
|
+
*
|
|
4
|
+
* The satellite used to carry a full copy of `createOpenAiCompatibleRuntime`, and the peer's catalog
|
|
5
|
+
* REPLACES core's at runtime when installed — so the copy that ran was not the copy most people
|
|
6
|
+
* read. That duplication produced theokit#128 (four adapters present in one copy, missing from the
|
|
7
|
+
* other, for two months), and every fix since had to be applied twice by hand: the `{model}` path
|
|
8
|
+
* substitution, then all three provider dialects.
|
|
9
|
+
*
|
|
10
|
+
* This is the shared leaf both packages now import. Semver-exempt, exactly like the
|
|
11
|
+
* `internal/persistence` and `internal/security` sub-paths that exist for the same reason: extracted
|
|
12
|
+
* packages need primitives that are not part of the stable public contract.
|
|
13
|
+
*
|
|
14
|
+
* @internal — semver-exempt. Not part of the stable `@theokit/sdk` API.
|
|
15
|
+
*/
|
|
16
|
+
export { createOpenAiCompatibleRuntime, type EmbeddingDialect, type OpenAiCompatibleConfig, } from "./openai-compatible.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* theokit#160 — the ONE embedding runtime, shared with `@theokit/sdk-memory`.
|
|
3
|
+
*
|
|
4
|
+
* The satellite used to carry a full copy of `createOpenAiCompatibleRuntime`, and the peer's catalog
|
|
5
|
+
* REPLACES core's at runtime when installed — so the copy that ran was not the copy most people
|
|
6
|
+
* read. That duplication produced theokit#128 (four adapters present in one copy, missing from the
|
|
7
|
+
* other, for two months), and every fix since had to be applied twice by hand: the `{model}` path
|
|
8
|
+
* substitution, then all three provider dialects.
|
|
9
|
+
*
|
|
10
|
+
* This is the shared leaf both packages now import. Semver-exempt, exactly like the
|
|
11
|
+
* `internal/persistence` and `internal/security` sub-paths that exist for the same reason: extracted
|
|
12
|
+
* packages need primitives that are not part of the stable public contract.
|
|
13
|
+
*
|
|
14
|
+
* @internal — semver-exempt. Not part of the stable `@theokit/sdk` API.
|
|
15
|
+
*/
|
|
16
|
+
export { createOpenAiCompatibleRuntime, type EmbeddingDialect, type OpenAiCompatibleConfig, } from "./openai-compatible.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { createOpenAiCompatibleRuntime } from '../../../chunk-QKE556YD.js';
|
|
2
|
+
import '../../../chunk-SCFW5MJZ.js';
|
|
3
|
+
export { LruEmbeddingCache, globalEmbeddingCache } from '../../../chunk-OXNYIMZZ.js';
|
|
4
|
+
import '../../../chunk-FD2UT76F.js';
|
|
5
|
+
import '../../../chunk-LGILIGV3.js';
|
|
6
|
+
import '../../../chunk-PI4RO4GR.js';
|
|
7
|
+
import '../../../chunk-J3UK2GMN.js';
|
|
8
|
+
import '../../../chunk-SG5ZWT6C.js';
|
|
9
|
+
import '../../../chunk-IVSD7L22.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ollama embedding adapter (T3.1, ADR D183).
|
|
3
|
+
*
|
|
4
|
+
* Targets Ollama's OpenAI-compatible `/v1/embeddings` endpoint and reuses
|
|
5
|
+
* the shared `createOpenAiCompatibleRuntime` factory. The differentiating
|
|
6
|
+
* bits:
|
|
7
|
+
*
|
|
8
|
+
* - `authType: "none"` — Ollama local ignores `Authorization`. Sentinel
|
|
9
|
+
* `"ollama-local"` is passed as apiKey to satisfy the factory contract
|
|
10
|
+
* (mirrors peer-project `OLLAMA_DEFAULT_API_KEY = "ollama-local"`).
|
|
11
|
+
* - `OLLAMA_HOST` overrides the default `http://localhost:11434`.
|
|
12
|
+
* - `OLLAMA_API_KEY` (optional) overrides the sentinel for Ollama Cloud
|
|
13
|
+
* or reverse-proxy auth setups.
|
|
14
|
+
* - Default model: `nomic-embed-text` (768 dim, ~274MB). User can opt
|
|
15
|
+
* into `all-minilm` (384 dim, ~45MB) or any other locally-installed
|
|
16
|
+
* embedding model.
|
|
17
|
+
*
|
|
18
|
+
* EC-B MUST FIX (edge-case review 2026-05-21): empty text is rejected
|
|
19
|
+
* upstream in the shared factory (`classifyEntry` short-circuits to a
|
|
20
|
+
* zero vector). That behavior is acceptable here because the zero
|
|
21
|
+
* vector is identical for any empty input — downstream similarity
|
|
22
|
+
* calcs ignore zero-norm vectors via the existing `cosineSimilarity`
|
|
23
|
+
* guard. No additional fail-fast needed.
|
|
24
|
+
*
|
|
25
|
+
* EC-A MUST FIX (edge-case review 2026-05-21): dimension is locked
|
|
26
|
+
* by the `DIMENSION_BY_MODEL` table; an unknown model id throws
|
|
27
|
+
* `ConfigurationError(code: "embedding_unknown_model")` per the
|
|
28
|
+
* factory's EC-4 contract. Future model versions with different
|
|
29
|
+
* dimensions are added to the table here without breaking changes.
|
|
30
|
+
*
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
export declare const DEFAULT_OLLAMA_EMBEDDING_MODEL = "nomic-embed-text";
|
|
34
|
+
export declare const ollamaMemoryEmbeddingProviderAdapter: MemoryEmbeddingProviderAdapter;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { CreateAdapterOptions, EmbeddingRuntime } from "../embedding-adapter.js";
|
|
2
|
+
export interface OpenAiCompatibleConfig {
|
|
3
|
+
id: string;
|
|
4
|
+
defaultBaseUrl: string;
|
|
5
|
+
apiKeyEnv: string;
|
|
6
|
+
baseUrlEnv?: string;
|
|
7
|
+
defaultModel: string;
|
|
8
|
+
/**
|
|
9
|
+
* Dimension hint by model id. The chosen model MUST be in this table —
|
|
10
|
+
* unknown models throw `ConfigurationError(code: "embedding_unknown_model")`
|
|
11
|
+
* (EC-4 fix). This prevents vec0 virtual-table dimension mismatches that
|
|
12
|
+
* surface as cryptic errors downstream.
|
|
13
|
+
*/
|
|
14
|
+
dimensionByModel: Record<string, number>;
|
|
15
|
+
/**
|
|
16
|
+
* Path component appended to `baseUrl` for the embeddings endpoint.
|
|
17
|
+
* Default `"/v1/embeddings"` (OpenAI canonical). REPLACES the default —
|
|
18
|
+
* does NOT concatenate. Used by DeepInfra (`"/v1/openai/embeddings"`),
|
|
19
|
+
* etc. (EC-2 fix).
|
|
20
|
+
*/
|
|
21
|
+
embeddingsPath?: string;
|
|
22
|
+
/**
|
|
23
|
+
* theokit#159 — per-provider deviations from the OpenAI wire.
|
|
24
|
+
*
|
|
25
|
+
* The runtime was rigidly OpenAI-shaped: one auth header, one body, one response shape. Three of
|
|
26
|
+
* the ten catalog providers do not speak it, so every call they made was rejected — Azure
|
|
27
|
+
* authenticates with an `api-key` header and puts the deployment in the path, Cohere's `/v2/embed`
|
|
28
|
+
* takes `texts` and answers `{embeddings:{float}}`. Advertising a provider that cannot work is
|
|
29
|
+
* worse than not advertising it.
|
|
30
|
+
*
|
|
31
|
+
* Every hook is optional and its default is exactly the previous behaviour, so the seven
|
|
32
|
+
* providers that DO speak OpenAI are untouched.
|
|
33
|
+
*/
|
|
34
|
+
dialect?: EmbeddingDialect;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* theokit#159 — the three points where a provider may deviate from the OpenAI embedding wire.
|
|
38
|
+
*
|
|
39
|
+
* Deliberately three narrow hooks rather than a general "transform the request" seam: these are the
|
|
40
|
+
* only axes on which the supported providers actually differ, and a wider seam would invite
|
|
41
|
+
* per-provider logic that belongs in the adapter.
|
|
42
|
+
*/
|
|
43
|
+
export interface EmbeddingDialect {
|
|
44
|
+
/** Replaces `authorization: Bearer <key>`. */
|
|
45
|
+
authHeaders?: (apiKey: string) => Record<string, string>;
|
|
46
|
+
/** Replaces the `{ model, input }` request body. */
|
|
47
|
+
body?: (model: string, inputs: ReadonlyArray<string>) => Record<string, unknown>;
|
|
48
|
+
/** Replaces reading vectors from `json.data[].embedding`. Return `undefined` when unparseable. */
|
|
49
|
+
vectors?: (json: unknown) => number[][] | undefined;
|
|
50
|
+
}
|
|
51
|
+
export declare function createOpenAiCompatibleRuntime(cfg: OpenAiCompatibleConfig, options: CreateAdapterOptions): Promise<EmbeddingRuntime>;
|
|
@@ -19,5 +19,33 @@ export interface OpenAiCompatibleConfig {
|
|
|
19
19
|
* etc. (EC-2 fix).
|
|
20
20
|
*/
|
|
21
21
|
embeddingsPath?: string;
|
|
22
|
+
/**
|
|
23
|
+
* theokit#159 — per-provider deviations from the OpenAI wire.
|
|
24
|
+
*
|
|
25
|
+
* The runtime was rigidly OpenAI-shaped: one auth header, one body, one response shape. Three of
|
|
26
|
+
* the ten catalog providers do not speak it, so every call they made was rejected — Azure
|
|
27
|
+
* authenticates with an `api-key` header and puts the deployment in the path, Cohere's `/v2/embed`
|
|
28
|
+
* takes `texts` and answers `{embeddings:{float}}`. Advertising a provider that cannot work is
|
|
29
|
+
* worse than not advertising it.
|
|
30
|
+
*
|
|
31
|
+
* Every hook is optional and its default is exactly the previous behaviour, so the seven
|
|
32
|
+
* providers that DO speak OpenAI are untouched.
|
|
33
|
+
*/
|
|
34
|
+
dialect?: EmbeddingDialect;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* theokit#159 — the three points where a provider may deviate from the OpenAI embedding wire.
|
|
38
|
+
*
|
|
39
|
+
* Deliberately three narrow hooks rather than a general "transform the request" seam: these are the
|
|
40
|
+
* only axes on which the supported providers actually differ, and a wider seam would invite
|
|
41
|
+
* per-provider logic that belongs in the adapter.
|
|
42
|
+
*/
|
|
43
|
+
export interface EmbeddingDialect {
|
|
44
|
+
/** Replaces `authorization: Bearer <key>`. */
|
|
45
|
+
authHeaders?: (apiKey: string) => Record<string, string>;
|
|
46
|
+
/** Replaces the `{ model, input }` request body. */
|
|
47
|
+
body?: (model: string, inputs: ReadonlyArray<string>) => Record<string, unknown>;
|
|
48
|
+
/** Replaces reading vectors from `json.data[].embedding`. Return `undefined` when unparseable. */
|
|
49
|
+
vectors?: (json: unknown) => number[][] | undefined;
|
|
22
50
|
}
|
|
23
51
|
export declare function createOpenAiCompatibleRuntime(cfg: OpenAiCompatibleConfig, options: CreateAdapterOptions): Promise<EmbeddingRuntime>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function diaryPath(cwd: string): string;
|
|
2
|
+
export declare function renderDiaryEntry(entry: DiaryEntry): string;
|
|
3
|
+
export declare function appendDiaryEntry(cwd: string, entry: DiaryEntry): Promise<void>;
|
|
4
|
+
export declare function entryHash(entry: DiaryEntry): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { EmbeddingRuntime } from "../embedding-adapter.js";
|
|
2
|
+
import type { MemoryFact } from "../types.js";
|
|
3
|
+
export interface Cluster {
|
|
4
|
+
representativeText: string;
|
|
5
|
+
members: ReadonlyArray<MemoryFact>;
|
|
6
|
+
}
|
|
7
|
+
export interface ClusterResult {
|
|
8
|
+
clusters: Cluster[];
|
|
9
|
+
}
|
|
10
|
+
/** Light phase — drop facts whose embedding is too similar to one already kept. */
|
|
11
|
+
export declare function lightPhase(facts: ReadonlyArray<MemoryFact>, embedding: EmbeddingRuntime, threshold?: number): Promise<DedupResult>;
|
|
12
|
+
/** REM phase — single-link agglomerative clustering by cosine similarity. */
|
|
13
|
+
export declare function remPhase(facts: ReadonlyArray<MemoryFact>, embedding: EmbeddingRuntime, threshold?: number, maxFactsPerSweep?: number): Promise<ClusterResult>;
|
|
14
|
+
/** Deep phase — render consolidated markdown for the dreamed note. */
|
|
15
|
+
export declare function deepPhase(clusters: ReadonlyArray<Cluster>, timestampMs: number): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface DreamingResult {
|
|
2
|
+
status: "ok" | "skipped" | "error";
|
|
3
|
+
factsBefore: number;
|
|
4
|
+
factsAfter: number;
|
|
5
|
+
duplicatesRemoved: number;
|
|
6
|
+
clustersCreated: number;
|
|
7
|
+
notesWritten: number;
|
|
8
|
+
diaryEntryHash: string | undefined;
|
|
9
|
+
}
|
|
10
|
+
export declare function runDreamingSweep(options: DreamingOptions): Promise<DreamingResult>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface MigrateResult {
|
|
2
|
+
countSqlite: number;
|
|
3
|
+
countLance: number;
|
|
4
|
+
/** Set when validation succeeded (or dryRun); false on validation failure. */
|
|
5
|
+
validated: boolean;
|
|
6
|
+
/** Per-fact compare results (size = sample count, up to 10). */
|
|
7
|
+
sampleComparisons: ReadonlyArray<{
|
|
8
|
+
id: string;
|
|
9
|
+
match: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
/** Lance storage location (final, after migration). */
|
|
12
|
+
lancePath: string;
|
|
13
|
+
/** Was the migration committed (false for dry-run). */
|
|
14
|
+
committed: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SDK 2.0 Phase 4 (Stage 4) — Optional peer loader for
|
|
3
|
+
* `@theokit/sdk-memory`.
|
|
4
|
+
*
|
|
5
|
+
* The Memory class public API in `src/memory.ts` keeps its surface
|
|
6
|
+
* stable but routes through sdk-memory when installed. When sdk-memory
|
|
7
|
+
* is NOT installed, methods fall back to sdk-core's legacy
|
|
8
|
+
* `internal/memory/*` implementations — preserving v1.x back-compat.
|
|
9
|
+
*
|
|
10
|
+
* Pattern mirrors sdk-handoff's optional-peer dynamic import: try
|
|
11
|
+
* `await import("@theokit/sdk-memory")` once, cache the result (the
|
|
12
|
+
* module OR `null` for "definitively missing"), and let the caller
|
|
13
|
+
* route.
|
|
14
|
+
*
|
|
15
|
+
* Iter 76 (Stage 4 #1): foundation helper for the Memory class
|
|
16
|
+
* delegation refactor. No behavior changes yet — this iter only
|
|
17
|
+
* adds the loader; iter 77+ wires Memory class methods to use it.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export {};
|