tenjin-cli 0.1.0-alpha.33 → 0.1.0-alpha.35
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/NOTICE.md +110 -0
- package/README.md +87 -81
- package/dist/{_esm-BIN7VY2L.js → _esm-2KST7HQ7.js} +7 -7
- package/dist/alive-5TV22PNF.js +51 -0
- package/dist/auth-XI7BJFLW.js +47 -0
- package/dist/{auto-update-Y24UL56V.js → auto-update-7L24KDWA.js} +4 -5
- package/dist/balance-DFHC6XEU.js +71 -0
- package/dist/{ccip-DHDFKTQV.js → ccip-HOW3DZYF.js} +4 -4
- package/dist/chunk-24XKUN2S.js +202 -0
- package/dist/chunk-24XKUN2S.js.map +1 -0
- package/dist/chunk-2L7TDGLV.js +56 -0
- package/dist/chunk-2L7TDGLV.js.map +1 -0
- package/dist/{chunk-C2Q76BVM.js → chunk-2U7H35IP.js} +29 -7
- package/dist/chunk-2U7H35IP.js.map +1 -0
- package/dist/chunk-2W4DQQUU.js +176 -0
- package/dist/chunk-2W4DQQUU.js.map +1 -0
- package/dist/{chunk-LRW6S53P.js → chunk-34SAECKZ.js} +35 -11
- package/dist/chunk-34SAECKZ.js.map +1 -0
- package/dist/{chunk-2I4QTOLB.js → chunk-3MZ7DYRO.js} +1 -1
- package/dist/chunk-3MZ7DYRO.js.map +1 -0
- package/dist/{chunk-RVPYTUP4.js → chunk-3Y2EHT4F.js} +13 -9
- package/dist/chunk-3Y2EHT4F.js.map +1 -0
- package/dist/chunk-3Y6BHIN6.js +169 -0
- package/dist/chunk-3Y6BHIN6.js.map +1 -0
- package/dist/{chunk-4K7TQHNP.js → chunk-3YPL6T3P.js} +17 -33
- package/dist/chunk-3YPL6T3P.js.map +1 -0
- package/dist/{chunk-E7SW44LM.js → chunk-44MVIRZH.js} +121 -6
- package/dist/chunk-44MVIRZH.js.map +1 -0
- package/dist/chunk-45MMSBHA.js +321 -0
- package/dist/chunk-45MMSBHA.js.map +1 -0
- package/dist/{chunk-3FMZGI7I.js → chunk-4CE6TMI5.js} +1 -1
- package/dist/chunk-4CE6TMI5.js.map +1 -0
- package/dist/{chunk-QXP3Z3JN.js → chunk-4MBCJFY4.js} +35 -3
- package/dist/chunk-4MBCJFY4.js.map +1 -0
- package/dist/chunk-4TPL54KW.js +227 -0
- package/dist/chunk-4TPL54KW.js.map +1 -0
- package/dist/chunk-54ELBTKE.js +1615 -0
- package/dist/chunk-54ELBTKE.js.map +1 -0
- package/dist/{chunk-NDGZDTSJ.js → chunk-5F4OB5B3.js} +115 -57
- package/dist/chunk-5F4OB5B3.js.map +1 -0
- package/dist/chunk-5HN4KVQU.js +3348 -0
- package/dist/chunk-5HN4KVQU.js.map +1 -0
- package/dist/{chunk-ZDZERB6L.js → chunk-5J4E5GYI.js} +572 -407
- package/dist/chunk-5J4E5GYI.js.map +1 -0
- package/dist/{chunk-ZNNXRNFD.js → chunk-5N4GGUBN.js} +48 -6
- package/dist/chunk-5N4GGUBN.js.map +1 -0
- package/dist/chunk-5USBZ2MU.js +58 -0
- package/dist/chunk-5USBZ2MU.js.map +1 -0
- package/dist/chunk-64WOMNYR.js +183 -0
- package/dist/chunk-64WOMNYR.js.map +1 -0
- package/dist/{chunk-ILNIZ5I2.js → chunk-65RS4LQS.js} +1825 -1715
- package/dist/chunk-65RS4LQS.js.map +1 -0
- package/dist/{chunk-IE7P2BZE.js → chunk-6QMDUDF2.js} +3 -3
- package/dist/{chunk-IADZOXKN.js → chunk-7SLOTLO7.js} +19 -697
- package/dist/chunk-7SLOTLO7.js.map +1 -0
- package/dist/{chunk-WFSPCCVW.js → chunk-7V25UAQO.js} +99 -99
- package/dist/{chunk-WFSPCCVW.js.map → chunk-7V25UAQO.js.map} +1 -1
- package/dist/chunk-BGA4DO5M.js +719 -0
- package/dist/chunk-BGA4DO5M.js.map +1 -0
- package/dist/chunk-BVP7YK2J.js +706 -0
- package/dist/chunk-BVP7YK2J.js.map +1 -0
- package/dist/chunk-C265QIMJ.js +83 -0
- package/dist/chunk-C265QIMJ.js.map +1 -0
- package/dist/{chunk-XQJXNMSB.js → chunk-CRG54LEB.js} +1 -1
- package/dist/chunk-CRG54LEB.js.map +1 -0
- package/dist/{chunk-KG3D7FIF.js → chunk-CZJOMUBP.js} +2 -2
- package/dist/{chunk-36RVGZNY.js → chunk-D6M3ZK66.js} +22 -39
- package/dist/chunk-D6M3ZK66.js.map +1 -0
- package/dist/{chunk-3UCIG4TG.js → chunk-DI4QAGRZ.js} +1 -11
- package/dist/chunk-DI4QAGRZ.js.map +1 -0
- package/dist/{chunk-JKKAIPTU.js → chunk-DIH2G3YG.js} +47 -10
- package/dist/chunk-DIH2G3YG.js.map +1 -0
- package/dist/chunk-DJ36BM62.js +78 -0
- package/dist/chunk-DJ36BM62.js.map +1 -0
- package/dist/chunk-DTEWAVNE.js +114 -0
- package/dist/chunk-DTEWAVNE.js.map +1 -0
- package/dist/chunk-F2KJAJ7T.js +13 -0
- package/dist/chunk-F2KJAJ7T.js.map +1 -0
- package/dist/{chunk-BF4XHEQK.js → chunk-F3QPGYOY.js} +6 -6
- package/dist/chunk-F3QPGYOY.js.map +1 -0
- package/dist/{chunk-3GNJXKIT.js → chunk-F43CV6UC.js} +2 -2
- package/dist/{chunk-J57UC3DD.js → chunk-FKVJKLPI.js} +3 -3
- package/dist/{chunk-V2LQLN5H.js → chunk-FYFHH7V5.js} +59 -8
- package/dist/{chunk-V2LQLN5H.js.map → chunk-FYFHH7V5.js.map} +1 -1
- package/dist/chunk-GAJC4BQZ.js +1096 -0
- package/dist/chunk-GAJC4BQZ.js.map +1 -0
- package/dist/{chunk-DOQGNFHM.js → chunk-GH5UKMZD.js} +2 -12
- package/dist/{chunk-DOQGNFHM.js.map → chunk-GH5UKMZD.js.map} +1 -1
- package/dist/{chunk-WYXUQGOL.js → chunk-HAZAN4UM.js} +7 -6
- package/dist/chunk-HAZAN4UM.js.map +1 -0
- package/dist/chunk-HI5XQOX2.js +393 -0
- package/dist/chunk-HI5XQOX2.js.map +1 -0
- package/dist/chunk-HKGUKAQW.js +488 -0
- package/dist/chunk-HKGUKAQW.js.map +1 -0
- package/dist/{chunk-SO3XRZPX.js → chunk-HPRVFJPM.js} +6 -6
- package/dist/{chunk-L6JEXB3E.js → chunk-HQR4BWKX.js} +3 -131
- package/dist/chunk-HQR4BWKX.js.map +1 -0
- package/dist/chunk-HZKANST2.js +177 -0
- package/dist/chunk-HZKANST2.js.map +1 -0
- package/dist/{chunk-UUGOUOVT.js → chunk-I557SAOM.js} +8 -2
- package/dist/chunk-I557SAOM.js.map +1 -0
- package/dist/{chunk-TC2WZLSC.js → chunk-IGLWLH73.js} +8 -7
- package/dist/chunk-IGLWLH73.js.map +1 -0
- package/dist/chunk-ILWCKCOI.js +58 -0
- package/dist/chunk-ILWCKCOI.js.map +1 -0
- package/dist/{chunk-2GP3HRYK.js → chunk-INSIW65E.js} +182 -182
- package/dist/{chunk-MPZUYCAP.js → chunk-IULCDMVG.js} +12 -1
- package/dist/chunk-IULCDMVG.js.map +1 -0
- package/dist/{chunk-INTFHMU4.js → chunk-IVNSUAVC.js} +25 -26
- package/dist/chunk-IVNSUAVC.js.map +1 -0
- package/dist/chunk-JDQZCREI.js +87 -0
- package/dist/chunk-JDQZCREI.js.map +1 -0
- package/dist/chunk-JHFFUVON.js +1050 -0
- package/dist/chunk-JHFFUVON.js.map +1 -0
- package/dist/{chunk-RL5UUDT4.js → chunk-JNUKLSMZ.js} +3 -3
- package/dist/chunk-JTILUN4W.js +2933 -0
- package/dist/chunk-JTILUN4W.js.map +1 -0
- package/dist/{chunk-OJNTCYQQ.js → chunk-JTX3BUDK.js} +37 -53
- package/dist/chunk-JTX3BUDK.js.map +1 -0
- package/dist/{chunk-X5ZBP3IY.js → chunk-JUUBBBY5.js} +2 -2
- package/dist/chunk-JUUBBBY5.js.map +1 -0
- package/dist/chunk-JWAK7JQB.js +15 -0
- package/dist/chunk-JWAK7JQB.js.map +1 -0
- package/dist/{chunk-UXZONNEQ.js → chunk-K5KNGC4I.js} +34 -31
- package/dist/chunk-K5KNGC4I.js.map +1 -0
- package/dist/chunk-KAQ4Q3TO.js +135 -0
- package/dist/chunk-KAQ4Q3TO.js.map +1 -0
- package/dist/chunk-KFVJYLVL.js +125 -0
- package/dist/chunk-KFVJYLVL.js.map +1 -0
- package/dist/chunk-KGUE5AVX.js +69 -0
- package/dist/chunk-KGUE5AVX.js.map +1 -0
- package/dist/{chunk-FVIGCDSV.js → chunk-KLDMLWXT.js} +11 -85
- package/dist/chunk-KLDMLWXT.js.map +1 -0
- package/dist/chunk-KNKDMTHU.js +453 -0
- package/dist/chunk-KNKDMTHU.js.map +1 -0
- package/dist/chunk-LDA6TAYQ.js +95 -0
- package/dist/chunk-LDA6TAYQ.js.map +1 -0
- package/dist/chunk-LWSSIZOY.js +347 -0
- package/dist/chunk-LWSSIZOY.js.map +1 -0
- package/dist/{chunk-ZURZHELF.js → chunk-MAHNZA6C.js} +158 -41
- package/dist/chunk-MAHNZA6C.js.map +1 -0
- package/dist/chunk-MEWZCIA6.js +220 -0
- package/dist/chunk-MEWZCIA6.js.map +1 -0
- package/dist/{chunk-2SNUOHAT.js → chunk-MEZJ3I63.js} +49 -1
- package/dist/chunk-MEZJ3I63.js.map +1 -0
- package/dist/chunk-MJDO4EXD.js +353 -0
- package/dist/chunk-MJDO4EXD.js.map +1 -0
- package/dist/chunk-NJA6NT3A.js +6595 -0
- package/dist/chunk-NJA6NT3A.js.map +1 -0
- package/dist/{chunk-LHHMV4GU.js → chunk-NVSKJPRC.js} +1 -1
- package/dist/{chunk-LHHMV4GU.js.map → chunk-NVSKJPRC.js.map} +1 -1
- package/dist/{chunk-4YOZGGTZ.js → chunk-OC7K2DVZ.js} +5 -5
- package/dist/chunk-OC7K2DVZ.js.map +1 -0
- package/dist/chunk-ODRPASFP.js +2078 -0
- package/dist/chunk-ODRPASFP.js.map +1 -0
- package/dist/chunk-OJJFANO6.js +133 -0
- package/dist/chunk-OJJFANO6.js.map +1 -0
- package/dist/{chunk-JNJWBTU2.js → chunk-OQWPRFAC.js} +332 -882
- package/dist/chunk-OQWPRFAC.js.map +1 -0
- package/dist/chunk-P4I7BFNJ.js +11 -0
- package/dist/chunk-P4I7BFNJ.js.map +1 -0
- package/dist/{chunk-SNNSAGMT.js → chunk-P6YQWIT2.js} +4058 -4039
- package/dist/chunk-P6YQWIT2.js.map +1 -0
- package/dist/{chunk-JRGFKVAZ.js → chunk-PETQ5WEA.js} +2 -2
- package/dist/{chunk-HMWYAUA6.js → chunk-Q6RSJCXB.js} +29 -69
- package/dist/chunk-Q6RSJCXB.js.map +1 -0
- package/dist/{chunk-U3IKUGRP.js → chunk-QKEUKBRK.js} +17 -23
- package/dist/chunk-QKEUKBRK.js.map +1 -0
- package/dist/{chunk-2RWB7RKE.js → chunk-QKYUCITR.js} +174 -5814
- package/dist/chunk-QKYUCITR.js.map +1 -0
- package/dist/chunk-QQDPRTLP.js +127 -0
- package/dist/chunk-QQDPRTLP.js.map +1 -0
- package/dist/chunk-QQYCYAKI.js +79 -0
- package/dist/chunk-QQYCYAKI.js.map +1 -0
- package/dist/chunk-R4KDH477.js +1064 -0
- package/dist/chunk-R4KDH477.js.map +1 -0
- package/dist/chunk-R5TR2DIK.js +119 -0
- package/dist/chunk-R5TR2DIK.js.map +1 -0
- package/dist/chunk-R62PKTAG.js +66 -0
- package/dist/chunk-R62PKTAG.js.map +1 -0
- package/dist/{chunk-BFDQ4WNW.js → chunk-RFZA7PSM.js} +4 -5
- package/dist/chunk-RFZA7PSM.js.map +1 -0
- package/dist/chunk-RGCPELQN.js +219 -0
- package/dist/chunk-RGCPELQN.js.map +1 -0
- package/dist/chunk-RGVCOG2S.js +910 -0
- package/dist/chunk-RGVCOG2S.js.map +1 -0
- package/dist/chunk-SOLNJ3AZ.js +209 -0
- package/dist/chunk-SOLNJ3AZ.js.map +1 -0
- package/dist/chunk-TFT2X7SH.js +77 -0
- package/dist/chunk-TFT2X7SH.js.map +1 -0
- package/dist/chunk-TUCKEEXE.js +2 -0
- package/dist/chunk-TVWCLUBI.js +293 -0
- package/dist/chunk-TVWCLUBI.js.map +1 -0
- package/dist/chunk-U4TRWSVE.js +78 -0
- package/dist/chunk-U4TRWSVE.js.map +1 -0
- package/dist/chunk-UIB33QQP.js +379 -0
- package/dist/chunk-UIB33QQP.js.map +1 -0
- package/dist/chunk-V6GIVALQ.js +1889 -0
- package/dist/chunk-V6GIVALQ.js.map +1 -0
- package/dist/chunk-VHXCPXUS.js +366 -0
- package/dist/chunk-VHXCPXUS.js.map +1 -0
- package/dist/{chunk-HGZEPQUT.js → chunk-VU6GMWF6.js} +17 -8
- package/dist/chunk-VU6GMWF6.js.map +1 -0
- package/dist/chunk-VWZYE3NC.js +8415 -0
- package/dist/chunk-VWZYE3NC.js.map +1 -0
- package/dist/{chunk-AGMVASXZ.js → chunk-W2GXIARJ.js} +88 -11
- package/dist/chunk-W2GXIARJ.js.map +1 -0
- package/dist/chunk-W4G3K3V7.js +288 -0
- package/dist/chunk-W4G3K3V7.js.map +1 -0
- package/dist/chunk-W74LJ5OT.js +588 -0
- package/dist/chunk-W74LJ5OT.js.map +1 -0
- package/dist/chunk-W7ELYLYK.js +233 -0
- package/dist/chunk-W7ELYLYK.js.map +1 -0
- package/dist/{chunk-BPMWXTFX.js → chunk-WFZX352D.js} +7 -7
- package/dist/chunk-WXA3WTPF.js +20 -0
- package/dist/chunk-WXA3WTPF.js.map +1 -0
- package/dist/chunk-XRGFH7FI.js +454 -0
- package/dist/chunk-XRGFH7FI.js.map +1 -0
- package/dist/chunk-XSCGUO2U.js +330 -0
- package/dist/chunk-XSCGUO2U.js.map +1 -0
- package/dist/chunk-XWROSMI5.js +1039 -0
- package/dist/chunk-XWROSMI5.js.map +1 -0
- package/dist/chunk-Y2EXZ47H.js +40 -0
- package/dist/chunk-Y2EXZ47H.js.map +1 -0
- package/dist/chunk-YJGEVBKZ.js +47 -0
- package/dist/chunk-YJGEVBKZ.js.map +1 -0
- package/dist/{chunk-6CMM6YCB.js → chunk-YWWMISDY.js} +2 -2
- package/dist/{chunk-WXA2BWTE.js → chunk-ZCT5DJ3G.js} +2 -48
- package/dist/chunk-ZCT5DJ3G.js.map +1 -0
- package/dist/chunk-ZEYA2WWX.js +982 -0
- package/dist/chunk-ZEYA2WWX.js.map +1 -0
- package/dist/chunk-ZRC7Z5X3.js +82 -0
- package/dist/chunk-ZRC7Z5X3.js.map +1 -0
- package/dist/{chunk-3AIHRXKO.js → chunk-ZS7JIUJ3.js} +12 -10
- package/dist/chunk-ZS7JIUJ3.js.map +1 -0
- package/dist/{clack-EZ7TDWQU.js → clack-Q4RNC5VE.js} +2 -6
- package/dist/{claude-cli-2YKABJJZ.js → claude-cli-GIIHOBGT.js} +4 -2
- package/dist/claude-install-BAUSJMW3.js +64 -0
- package/dist/{cli-E36SPKBW.js → cli-QY4KKA3D.js} +632 -150
- package/dist/cli-QY4KKA3D.js.map +1 -0
- package/dist/client-3YQKORVK.js +710 -0
- package/dist/client-3YQKORVK.js.map +1 -0
- package/dist/{codex-event-ZO2GEFE6.js → codex-event-EUTCAOTQ.js} +3 -5
- package/dist/{codex-host-KECJVTA2.js → codex-host-ZON3S6HU.js} +7 -7
- package/dist/{codex-install-HQZDGFXW.js → codex-install-HZV2DOAB.js} +242 -88
- package/dist/codex-install-HZV2DOAB.js.map +1 -0
- package/dist/config-QZOBMTEL.js +57 -0
- package/dist/config-names-Z5NZD5R2.js +224 -0
- package/dist/config-names-Z5NZD5R2.js.map +1 -0
- package/dist/config-rules-YOYHS6YL.js +55 -0
- package/dist/config-subagents-WQV2ZAD5.js +362 -0
- package/dist/config-subagents-WQV2ZAD5.js.map +1 -0
- package/dist/connect-YDWTYU4B.js +1020 -0
- package/dist/connect-YDWTYU4B.js.map +1 -0
- package/dist/core-0a66n3e7-TTP554XV.js +127 -0
- package/dist/core-0a66n3e7-TTP554XV.js.map +1 -0
- package/dist/core-0bmnpbz2-C2JIRVZO.js +10790 -0
- package/dist/core-0bmnpbz2-C2JIRVZO.js.map +1 -0
- package/dist/core-9je8ee1j-74DGHWPV.js +30 -0
- package/dist/core-9je8ee1j-74DGHWPV.js.map +1 -0
- package/dist/core-wadgcjfh-TSZFQZGH.js +666 -0
- package/dist/core-wadgcjfh-TSZFQZGH.js.map +1 -0
- package/dist/core-zg882d22-LKV5DZYW.js +37 -0
- package/dist/core-zg882d22-LKV5DZYW.js.map +1 -0
- package/dist/decision-QSKHOGCO.js +145 -0
- package/dist/{doctor-I6XQEKWD.js → doctor-ZWJXRD75.js} +162 -148
- package/dist/doctor-ZWJXRD75.js.map +1 -0
- package/dist/{env-proxy-R6ZMLQTT.js → env-proxy-XLSLHBKQ.js} +2 -2
- package/dist/{ethersCompat-Df4a6QIZ-X6YZWAML.js → ethersCompat-Df4a6QIZ-K3DMHR6Y.js} +5 -5
- package/dist/explicit-ME2NRADQ.js +371 -0
- package/dist/explicit-ME2NRADQ.js.map +1 -0
- package/dist/flush-stdio-NYIJ3QXT.js +18 -0
- package/dist/fund-VF7TLDJH.js +722 -0
- package/dist/fund-VF7TLDJH.js.map +1 -0
- package/dist/hook-command-VZ27MGWO.js +49 -0
- package/dist/hosts/claude/.claude-plugin/marketplace.json +2 -2
- package/dist/hosts/claude/tenjin/.claude-plugin/plugin.json +2 -2
- package/dist/hosts/claude/tenjin/hooks/hook-data.ts +152 -0
- package/dist/hosts/claude/tenjin/hooks/hooks.json +7 -0
- package/dist/hosts/claude/tenjin/hooks/model-viewer.tsx +2987 -0
- package/dist/hosts/claude/tenjin/hooks/register.tsx +527 -56
- package/dist/hosts/claude/tenjin/skills/tenjin-pay/SKILL.md +14 -4
- package/dist/hosts/claude/tenjin/types/index.d.ts +144 -1
- package/dist/{hosts-DVQJ32QC.js → hosts-3EMTVM4H.js} +7 -6
- package/dist/index.js +18 -15
- package/dist/index.js.map +1 -1
- package/dist/install-ZA7L2UF3.js +115 -0
- package/dist/install-funding-JDGYTF72.js +30 -0
- package/dist/install-identity-FFAYEFLX.js +30 -0
- package/dist/{install-wallet-5M4OTYLX.js → install-wallet-2SFOVE3Q.js} +68 -53
- package/dist/install-wallet-2SFOVE3Q.js.map +1 -0
- package/dist/mcp-36S6MK3C.js +67642 -0
- package/dist/mcp-36S6MK3C.js.map +1 -0
- package/dist/new-install-5L4GY3LN.js +51 -0
- package/dist/{package-IJFGMWEV.js → package-BONDXSV3.js} +2 -2
- package/dist/{passphrase-IFTDS3CU.js → passphrase-T4ULBN4M.js} +16 -12
- package/dist/{paths-XCSAKISU.js → paths-O2KDWZ76.js} +18 -28
- package/dist/pay-CMV5KL74.js +74 -0
- package/dist/{payments-HFPPWHTV.js → payments-Z6UBZL4Z.js} +36 -26
- package/dist/payments-Z6UBZL4Z.js.map +1 -0
- package/dist/reclaim-subagent-credit-ABSF67SJ.js +105 -0
- package/dist/reclaim-subagent-credit-ABSF67SJ.js.map +1 -0
- package/dist/{redact-D7ASVWKL.js → redact-LOTHE5TS.js} +2 -8
- package/dist/redact-LOTHE5TS.js.map +1 -0
- package/dist/routing-quote-AHLAREXR.js +40 -0
- package/dist/routing-quote-AHLAREXR.js.map +1 -0
- package/dist/run-JH7ELYAM.js +88 -0
- package/dist/run-JH7ELYAM.js.map +1 -0
- package/dist/runtime-2GX4ALJP.js +410 -0
- package/dist/runtime-2GX4ALJP.js.map +1 -0
- package/dist/runtime-activate-IDQ2NCSP.js +39 -0
- package/dist/runtime-activate-IDQ2NCSP.js.map +1 -0
- package/dist/{runtime-fetch-ZSSSK72Y.js → runtime-fetch-6LOBHBEN.js} +4 -4
- package/dist/runtime-fetch-6LOBHBEN.js.map +1 -0
- package/dist/runtime-launchers-YAPKCBHV.js +31 -0
- package/dist/runtime-launchers-YAPKCBHV.js.map +1 -0
- package/dist/{runtime-layout-WIDILZ6K.js → runtime-layout-QHZQJV7C.js} +5 -4
- package/dist/runtime-layout-QHZQJV7C.js.map +1 -0
- package/dist/runtime-place-4POL4KK4.js +37 -0
- package/dist/runtime-place-4POL4KK4.js.map +1 -0
- package/dist/runtime-provenance-MNJGVBV2.js +12 -0
- package/dist/runtime-provenance-MNJGVBV2.js.map +1 -0
- package/dist/{secp256k1-ZZZT2CAX.js → secp256k1-N5P2GVGF.js} +3 -3
- package/dist/secp256k1-N5P2GVGF.js.map +1 -0
- package/dist/{send-GCVEAQKL.js → send-ELXFKEKY.js} +35 -32
- package/dist/send-ELXFKEKY.js.map +1 -0
- package/dist/status-FXUFWJDM.js +404 -0
- package/dist/status-FXUFWJDM.js.map +1 -0
- package/dist/{status-line-OPCXDHL2.js → status-line-IH5JBWBC.js} +51 -43
- package/dist/status-line-IH5JBWBC.js.map +1 -0
- package/dist/streamableHttp-CP2ZQBIK.js +768 -0
- package/dist/streamableHttp-CP2ZQBIK.js.map +1 -0
- package/dist/{uninstall-BAWRBXXQ.js → uninstall-LJZUKM4D.js} +76 -76
- package/dist/uninstall-LJZUKM4D.js.map +1 -0
- package/dist/update-EUIX72IX.js +68 -0
- package/dist/update-EUIX72IX.js.map +1 -0
- package/dist/usage-EKDC7LUC.js +180 -0
- package/dist/usage-EKDC7LUC.js.map +1 -0
- package/dist/{usdc-VG4CIOUK.js → usdc-YIHK2OMC.js} +8 -12
- package/dist/usdc-YIHK2OMC.js.map +1 -0
- package/dist/{viemAdapter-By13KInL-DOFTEIJV.js → viemAdapter-By13KInL-PRLSIESK.js} +5 -5
- package/dist/viemAdapter-By13KInL-PRLSIESK.js.map +1 -0
- package/dist/wallet-HSW757W6.js +80 -0
- package/dist/wallet-HSW757W6.js.map +1 -0
- package/dist/wallet-kdf-worker.mjs +1433 -818
- package/docs/agent-permissions.md +88 -155
- package/docs/router-reference.md +236 -0
- package/docs/safety-model.md +31 -33
- package/docs/subagents-internals.md +97 -0
- package/docs/subagents.md +348 -0
- package/docs/troubleshooting.md +10 -6
- package/package.json +12 -8
- package/scripts/installers/install.sh +7 -1
- package/dist/alive-GSOWKUOY.js +0 -38
- package/dist/chunk-2I4QTOLB.js.map +0 -1
- package/dist/chunk-2M2VPI2E.js +0 -560
- package/dist/chunk-2M2VPI2E.js.map +0 -1
- package/dist/chunk-2RWB7RKE.js.map +0 -1
- package/dist/chunk-2SNUOHAT.js.map +0 -1
- package/dist/chunk-3623BLPV.js +0 -184
- package/dist/chunk-3623BLPV.js.map +0 -1
- package/dist/chunk-36RVGZNY.js.map +0 -1
- package/dist/chunk-3AIHRXKO.js.map +0 -1
- package/dist/chunk-3FMZGI7I.js.map +0 -1
- package/dist/chunk-3UCIG4TG.js.map +0 -1
- package/dist/chunk-4K7TQHNP.js.map +0 -1
- package/dist/chunk-4LMUQMBH.js +0 -29
- package/dist/chunk-4LMUQMBH.js.map +0 -1
- package/dist/chunk-4USCZ2NI.js +0 -228
- package/dist/chunk-4USCZ2NI.js.map +0 -1
- package/dist/chunk-4YOZGGTZ.js.map +0 -1
- package/dist/chunk-62KNUYWD.js +0 -111
- package/dist/chunk-62KNUYWD.js.map +0 -1
- package/dist/chunk-A5GKIG5O.js +0 -2037
- package/dist/chunk-A5GKIG5O.js.map +0 -1
- package/dist/chunk-AGMVASXZ.js.map +0 -1
- package/dist/chunk-BF4XHEQK.js.map +0 -1
- package/dist/chunk-BFDQ4WNW.js.map +0 -1
- package/dist/chunk-C2Q76BVM.js.map +0 -1
- package/dist/chunk-CEXSOI5R.js +0 -808
- package/dist/chunk-CEXSOI5R.js.map +0 -1
- package/dist/chunk-E7SW44LM.js.map +0 -1
- package/dist/chunk-EDJWHDDL.js +0 -33
- package/dist/chunk-EDJWHDDL.js.map +0 -1
- package/dist/chunk-FVIGCDSV.js.map +0 -1
- package/dist/chunk-GTTUCOPD.js +0 -105
- package/dist/chunk-GTTUCOPD.js.map +0 -1
- package/dist/chunk-HDPUXS3Z.js +0 -122
- package/dist/chunk-HDPUXS3Z.js.map +0 -1
- package/dist/chunk-HGGWCP7W.js +0 -120
- package/dist/chunk-HGGWCP7W.js.map +0 -1
- package/dist/chunk-HGZEPQUT.js.map +0 -1
- package/dist/chunk-HMWYAUA6.js.map +0 -1
- package/dist/chunk-IADZOXKN.js.map +0 -1
- package/dist/chunk-ILNIZ5I2.js.map +0 -1
- package/dist/chunk-INTFHMU4.js.map +0 -1
- package/dist/chunk-JKKAIPTU.js.map +0 -1
- package/dist/chunk-JNJWBTU2.js.map +0 -1
- package/dist/chunk-KM7RY2ZS.js +0 -246
- package/dist/chunk-KM7RY2ZS.js.map +0 -1
- package/dist/chunk-KOGZDMHO.js +0 -21
- package/dist/chunk-KOGZDMHO.js.map +0 -1
- package/dist/chunk-L6JEXB3E.js.map +0 -1
- package/dist/chunk-LRW6S53P.js.map +0 -1
- package/dist/chunk-LXAYUOXI.js +0 -511
- package/dist/chunk-LXAYUOXI.js.map +0 -1
- package/dist/chunk-MEFB5KHA.js +0 -59
- package/dist/chunk-MEFB5KHA.js.map +0 -1
- package/dist/chunk-MPZUYCAP.js.map +0 -1
- package/dist/chunk-NDGZDTSJ.js.map +0 -1
- package/dist/chunk-OJNTCYQQ.js.map +0 -1
- package/dist/chunk-P3LFTKE7.js +0 -58
- package/dist/chunk-P3LFTKE7.js.map +0 -1
- package/dist/chunk-QXP3Z3JN.js.map +0 -1
- package/dist/chunk-RVPYTUP4.js.map +0 -1
- package/dist/chunk-SNNSAGMT.js.map +0 -1
- package/dist/chunk-TC2WZLSC.js.map +0 -1
- package/dist/chunk-TKPF35W6.js +0 -29
- package/dist/chunk-TKPF35W6.js.map +0 -1
- package/dist/chunk-U3IKUGRP.js.map +0 -1
- package/dist/chunk-UUGOUOVT.js.map +0 -1
- package/dist/chunk-UXZONNEQ.js.map +0 -1
- package/dist/chunk-WXA2BWTE.js.map +0 -1
- package/dist/chunk-WYXUQGOL.js.map +0 -1
- package/dist/chunk-X5ZBP3IY.js.map +0 -1
- package/dist/chunk-XKESD27X.js +0 -10
- package/dist/chunk-XKESD27X.js.map +0 -1
- package/dist/chunk-XQJXNMSB.js.map +0 -1
- package/dist/chunk-Y527D4TV.js +0 -56
- package/dist/chunk-Y527D4TV.js.map +0 -1
- package/dist/chunk-ZDZERB6L.js.map +0 -1
- package/dist/chunk-ZNNXRNFD.js.map +0 -1
- package/dist/chunk-ZURZHELF.js.map +0 -1
- package/dist/cli-E36SPKBW.js.map +0 -1
- package/dist/codex-install-HQZDGFXW.js.map +0 -1
- package/dist/config-HY2E4GGW.js +0 -55
- package/dist/doctor-I6XQEKWD.js.map +0 -1
- package/dist/fund-2QRO7OJL.js +0 -378
- package/dist/fund-2QRO7OJL.js.map +0 -1
- package/dist/hook-command-2UBCSZG6.js +0 -43
- package/dist/install-ILUX5C4A.js +0 -107
- package/dist/install-identity-TZKGY6LQ.js +0 -31
- package/dist/install-wallet-5M4OTYLX.js.map +0 -1
- package/dist/mcp-LE4DUS22.js +0 -14127
- package/dist/mcp-LE4DUS22.js.map +0 -1
- package/dist/pay-WCG3IH4R.js +0 -55
- package/dist/payments-HFPPWHTV.js.map +0 -1
- package/dist/plugin-registration-PZFI5GZW.js +0 -68
- package/dist/runtime-UZOKSUZX.js +0 -1321
- package/dist/runtime-UZOKSUZX.js.map +0 -1
- package/dist/send-GCVEAQKL.js.map +0 -1
- package/dist/status-HCVAOCN7.js +0 -150
- package/dist/status-HCVAOCN7.js.map +0 -1
- package/dist/status-line-OPCXDHL2.js.map +0 -1
- package/dist/uninstall-BAWRBXXQ.js.map +0 -1
- package/dist/update-CACXLQLR.js +0 -56
- package/dist/wallet-QL4UUXEZ.js +0 -55
- /package/dist/{_esm-BIN7VY2L.js.map → _esm-2KST7HQ7.js.map} +0 -0
- /package/dist/{alive-GSOWKUOY.js.map → alive-5TV22PNF.js.map} +0 -0
- /package/dist/{auto-update-Y24UL56V.js.map → auth-XI7BJFLW.js.map} +0 -0
- /package/dist/{ccip-DHDFKTQV.js.map → auto-update-7L24KDWA.js.map} +0 -0
- /package/dist/{clack-EZ7TDWQU.js.map → balance-DFHC6XEU.js.map} +0 -0
- /package/dist/{claude-cli-2YKABJJZ.js.map → ccip-HOW3DZYF.js.map} +0 -0
- /package/dist/{chunk-IE7P2BZE.js.map → chunk-6QMDUDF2.js.map} +0 -0
- /package/dist/{chunk-KG3D7FIF.js.map → chunk-CZJOMUBP.js.map} +0 -0
- /package/dist/{chunk-3GNJXKIT.js.map → chunk-F43CV6UC.js.map} +0 -0
- /package/dist/{chunk-J57UC3DD.js.map → chunk-FKVJKLPI.js.map} +0 -0
- /package/dist/{chunk-SO3XRZPX.js.map → chunk-HPRVFJPM.js.map} +0 -0
- /package/dist/{chunk-2GP3HRYK.js.map → chunk-INSIW65E.js.map} +0 -0
- /package/dist/{chunk-RL5UUDT4.js.map → chunk-JNUKLSMZ.js.map} +0 -0
- /package/dist/{chunk-JRGFKVAZ.js.map → chunk-PETQ5WEA.js.map} +0 -0
- /package/dist/{codex-event-ZO2GEFE6.js.map → chunk-TUCKEEXE.js.map} +0 -0
- /package/dist/{chunk-BPMWXTFX.js.map → chunk-WFZX352D.js.map} +0 -0
- /package/dist/{chunk-6CMM6YCB.js.map → chunk-YWWMISDY.js.map} +0 -0
- /package/dist/{codex-host-KECJVTA2.js.map → clack-Q4RNC5VE.js.map} +0 -0
- /package/dist/{config-HY2E4GGW.js.map → claude-cli-GIIHOBGT.js.map} +0 -0
- /package/dist/{env-proxy-R6ZMLQTT.js.map → claude-install-BAUSJMW3.js.map} +0 -0
- /package/dist/{ethersCompat-Df4a6QIZ-X6YZWAML.js.map → codex-event-EUTCAOTQ.js.map} +0 -0
- /package/dist/{hook-command-2UBCSZG6.js.map → codex-host-ZON3S6HU.js.map} +0 -0
- /package/dist/{hosts-DVQJ32QC.js.map → config-QZOBMTEL.js.map} +0 -0
- /package/dist/{install-ILUX5C4A.js.map → config-rules-YOYHS6YL.js.map} +0 -0
- /package/dist/{install-identity-TZKGY6LQ.js.map → decision-QSKHOGCO.js.map} +0 -0
- /package/dist/{package-IJFGMWEV.js.map → env-proxy-XLSLHBKQ.js.map} +0 -0
- /package/dist/{passphrase-IFTDS3CU.js.map → ethersCompat-Df4a6QIZ-K3DMHR6Y.js.map} +0 -0
- /package/dist/{paths-XCSAKISU.js.map → flush-stdio-NYIJ3QXT.js.map} +0 -0
- /package/dist/{pay-WCG3IH4R.js.map → hook-command-VZ27MGWO.js.map} +0 -0
- /package/dist/{plugin-registration-PZFI5GZW.js.map → hosts-3EMTVM4H.js.map} +0 -0
- /package/dist/{redact-D7ASVWKL.js.map → install-ZA7L2UF3.js.map} +0 -0
- /package/dist/{runtime-fetch-ZSSSK72Y.js.map → install-funding-JDGYTF72.js.map} +0 -0
- /package/dist/{runtime-layout-WIDILZ6K.js.map → install-identity-FFAYEFLX.js.map} +0 -0
- /package/dist/{secp256k1-ZZZT2CAX.js.map → new-install-5L4GY3LN.js.map} +0 -0
- /package/dist/{update-CACXLQLR.js.map → package-BONDXSV3.js.map} +0 -0
- /package/dist/{usdc-VG4CIOUK.js.map → passphrase-T4ULBN4M.js.map} +0 -0
- /package/dist/{viemAdapter-By13KInL-DOFTEIJV.js.map → paths-O2KDWZ76.js.map} +0 -0
- /package/dist/{wallet-QL4UUXEZ.js.map → pay-CMV5KL74.js.map} +0 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
normalizeChannelId
|
|
4
|
+
} from "./chunk-6QMDUDF2.js";
|
|
5
|
+
import {
|
|
6
|
+
ROUTING_DEPOSIT_KEY,
|
|
7
|
+
payerDir
|
|
8
|
+
} from "./chunk-HZKANST2.js";
|
|
9
|
+
|
|
10
|
+
// src/router/channel-credit.ts
|
|
11
|
+
import { readdir } from "node:fs/promises";
|
|
12
|
+
import { join as join4 } from "node:path";
|
|
13
|
+
|
|
14
|
+
// node_modules/.pnpm/@x402+evm@2.28.0_typescript@6.0.3/node_modules/@x402/evm/dist/esm/chunk-3632HGL3.mjs
|
|
15
|
+
import { mkdir, readFile, rename, unlink, writeFile } from "fs/promises";
|
|
16
|
+
import { dirname, join, resolve, sep } from "path";
|
|
17
|
+
function resolveWithinDir(baseDir, filename) {
|
|
18
|
+
const base = resolve(baseDir);
|
|
19
|
+
const target = resolve(base, filename);
|
|
20
|
+
if (target !== base && !target.startsWith(base + sep)) {
|
|
21
|
+
throw new Error("resolved channel path escapes storage root");
|
|
22
|
+
}
|
|
23
|
+
return target;
|
|
24
|
+
}
|
|
25
|
+
function isNodeEnoent(err) {
|
|
26
|
+
if (!err || typeof err !== "object" || !("code" in err)) return false;
|
|
27
|
+
return err.code === "ENOENT";
|
|
28
|
+
}
|
|
29
|
+
async function readJsonFile(filePath) {
|
|
30
|
+
try {
|
|
31
|
+
const raw = await readFile(filePath, "utf8");
|
|
32
|
+
return JSON.parse(raw);
|
|
33
|
+
} catch (err) {
|
|
34
|
+
if (isNodeEnoent(err)) return void 0;
|
|
35
|
+
throw err;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async function writeJsonAtomic(filePath, value) {
|
|
39
|
+
const dir = dirname(filePath);
|
|
40
|
+
await mkdir(dir, { recursive: true });
|
|
41
|
+
const tmp = join(dir, `.${process.pid}.${Date.now()}.${Math.random().toString(36).slice(2)}.tmp`);
|
|
42
|
+
const body = `${JSON.stringify(value, null, 2)}
|
|
43
|
+
`;
|
|
44
|
+
await writeFile(tmp, body, "utf8");
|
|
45
|
+
try {
|
|
46
|
+
await rename(tmp, filePath);
|
|
47
|
+
} catch {
|
|
48
|
+
await unlink(filePath).catch(() => {
|
|
49
|
+
});
|
|
50
|
+
await rename(tmp, filePath);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// node_modules/.pnpm/@x402+evm@2.28.0_typescript@6.0.3/node_modules/@x402/evm/dist/esm/batch-settlement/client/file-storage.mjs
|
|
55
|
+
import { unlink as unlink2 } from "fs/promises";
|
|
56
|
+
import { join as join2 } from "path";
|
|
57
|
+
var FileClientChannelStorage = class {
|
|
58
|
+
/**
|
|
59
|
+
* Creates file-backed client channel storage under the given root directory.
|
|
60
|
+
*
|
|
61
|
+
* @param options - Configuration including the storage root directory.
|
|
62
|
+
*/
|
|
63
|
+
constructor(options) {
|
|
64
|
+
this.root = options.directory;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Loads the stored client context for a channel, if present.
|
|
68
|
+
*
|
|
69
|
+
* @param key - Channel storage key (typically a lowercased channelId).
|
|
70
|
+
* @returns Parsed context or `undefined` when the file is missing.
|
|
71
|
+
*/
|
|
72
|
+
async get(key) {
|
|
73
|
+
return readJsonFile(this.filePath(key));
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Persists the client context for a channel.
|
|
77
|
+
*
|
|
78
|
+
* @param key - Channel storage key.
|
|
79
|
+
* @param context - Context record to write.
|
|
80
|
+
*/
|
|
81
|
+
async set(key, context) {
|
|
82
|
+
await writeJsonAtomic(this.filePath(key), context);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Removes the persisted context file for a channel, if it exists.
|
|
86
|
+
*
|
|
87
|
+
* @param key - Channel storage key.
|
|
88
|
+
*/
|
|
89
|
+
async delete(key) {
|
|
90
|
+
try {
|
|
91
|
+
await unlink2(this.filePath(key));
|
|
92
|
+
} catch (err) {
|
|
93
|
+
if (isNodeEnoent(err)) return;
|
|
94
|
+
throw err;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Absolute path to the JSON file for a channel.
|
|
99
|
+
*
|
|
100
|
+
* @param key - Channel storage key (a canonical `bytes32` channel id).
|
|
101
|
+
* @returns Filesystem path under `{root}/client/...`.
|
|
102
|
+
* @throws When `key` is not a canonical `bytes32` string or escapes the storage root.
|
|
103
|
+
*/
|
|
104
|
+
filePath(key) {
|
|
105
|
+
const id = normalizeChannelId(key);
|
|
106
|
+
return resolveWithinDir(join2(this.root, "client"), `${id}.json`);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
// src/router/model-channel.ts
|
|
111
|
+
import { createHash } from "node:crypto";
|
|
112
|
+
import { join as join3 } from "node:path";
|
|
113
|
+
function modelChannelLane(path) {
|
|
114
|
+
return path === "/api/model-router/route" ? "model-routing" : "model-inference";
|
|
115
|
+
}
|
|
116
|
+
function modelChannelScope(origin, lane) {
|
|
117
|
+
const canonicalOrigin = new URL(origin).origin;
|
|
118
|
+
const id = createHash("sha256").update(JSON.stringify(["tenjin-model-channel", 1, canonicalOrigin, lane])).digest("hex");
|
|
119
|
+
return { origin: canonicalOrigin, id, salt: `0x${id}` };
|
|
120
|
+
}
|
|
121
|
+
function modelChannelDir(dataDir, address, lane, origin) {
|
|
122
|
+
return join3(payerDir(dataDir, address), lane, modelChannelScope(origin, lane).id);
|
|
123
|
+
}
|
|
124
|
+
function modelInferenceRunScope(origin, runId) {
|
|
125
|
+
const canonicalOrigin = new URL(origin).origin;
|
|
126
|
+
const id = createHash("sha256").update(JSON.stringify(["tenjin-model-channel", 2, canonicalOrigin, "model-inference", runId])).digest("hex");
|
|
127
|
+
return { origin: canonicalOrigin, id, salt: `0x${id}` };
|
|
128
|
+
}
|
|
129
|
+
function modelInferenceRunDir(dataDir, address, origin, runId) {
|
|
130
|
+
return join3(
|
|
131
|
+
payerDir(dataDir, address),
|
|
132
|
+
"model-inference",
|
|
133
|
+
modelInferenceRunScope(origin, runId).id
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
function legacySharedInferenceChannel(origin, slot) {
|
|
137
|
+
const canonicalOrigin = new URL(origin).origin;
|
|
138
|
+
const id = createHash("sha256").update(
|
|
139
|
+
JSON.stringify([
|
|
140
|
+
"tenjin-model-channel",
|
|
141
|
+
1,
|
|
142
|
+
canonicalOrigin,
|
|
143
|
+
"model-inference",
|
|
144
|
+
...slot === 1 ? [1] : []
|
|
145
|
+
])
|
|
146
|
+
).digest("hex");
|
|
147
|
+
return { id, salt: `0x${id}` };
|
|
148
|
+
}
|
|
149
|
+
function modelRunDepositKeys(origin, runId) {
|
|
150
|
+
const { id } = modelInferenceRunScope(origin, runId);
|
|
151
|
+
return { prefix: `${ROUTING_DEPOSIT_KEY}run:${id}:`, kept: `${ROUTING_DEPOSIT_KEY}kept:${id}` };
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// src/router/channel-credit.ts
|
|
155
|
+
async function channels(dir) {
|
|
156
|
+
const storage = new FileClientChannelStorage({ directory: dir });
|
|
157
|
+
const out = [];
|
|
158
|
+
for (const name of await readdir(join4(dir, "client")).catch(() => [])) {
|
|
159
|
+
const id = /^(0x[0-9a-f]{64})\.json$/.exec(name)?.[1];
|
|
160
|
+
const channel = id === void 0 ? void 0 : await storage.get(id).catch(() => void 0);
|
|
161
|
+
if (channel === void 0) continue;
|
|
162
|
+
const depositedAtomic = BigInt(channel.balance ?? "0");
|
|
163
|
+
const left = depositedAtomic - BigInt(channel.chargedCumulativeAmount ?? "0");
|
|
164
|
+
out.push({ depositedAtomic, leftAtomic: left > 0n ? left : 0n });
|
|
165
|
+
}
|
|
166
|
+
return out;
|
|
167
|
+
}
|
|
168
|
+
async function bestCredit(dir) {
|
|
169
|
+
let best = 0n;
|
|
170
|
+
for (const { leftAtomic } of await channels(dir)) {
|
|
171
|
+
if (leftAtomic > best) best = leftAtomic;
|
|
172
|
+
}
|
|
173
|
+
return best;
|
|
174
|
+
}
|
|
175
|
+
async function channelCredit(dataDir, address, lane = "tool", origin) {
|
|
176
|
+
if (lane === "tool") return bestCredit(payerDir(dataDir, address));
|
|
177
|
+
if (!origin) throw new Error("Model credit requires its server origin");
|
|
178
|
+
return bestCredit(
|
|
179
|
+
modelChannelDir(dataDir, address, lane === "model" ? "model-inference" : lane, origin)
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
async function routingSpent(dataDir, address) {
|
|
183
|
+
let total = 0n;
|
|
184
|
+
for (const { depositedAtomic, leftAtomic } of await channels(payerDir(dataDir, address))) {
|
|
185
|
+
total += depositedAtomic - leftAtomic;
|
|
186
|
+
}
|
|
187
|
+
return total;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
export {
|
|
191
|
+
FileClientChannelStorage,
|
|
192
|
+
modelChannelLane,
|
|
193
|
+
modelChannelScope,
|
|
194
|
+
modelChannelDir,
|
|
195
|
+
modelInferenceRunScope,
|
|
196
|
+
modelInferenceRunDir,
|
|
197
|
+
legacySharedInferenceChannel,
|
|
198
|
+
modelRunDepositKeys,
|
|
199
|
+
channelCredit,
|
|
200
|
+
routingSpent
|
|
201
|
+
};
|
|
202
|
+
//# sourceMappingURL=chunk-24XKUN2S.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/router/channel-credit.ts","../node_modules/.pnpm/@x402+evm@2.28.0_typescript@6.0.3/node_modules/@x402/evm/src/batch-settlement/storage-utils.ts","../node_modules/.pnpm/@x402+evm@2.28.0_typescript@6.0.3/node_modules/@x402/evm/src/batch-settlement/client/fileStorage.ts","../src/router/model-channel.ts"],"sourcesContent":["import { readdir } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { FileClientChannelStorage } from '@x402/evm/batch-settlement/client/file-storage';\nimport { payerDir } from './fee';\nimport { modelChannelDir } from './model-channel';\n\n/**\n * The wallet's routing channels, from the SDK's own files: what each one was\n * deposited (`balance`) and what the router has charged against it\n * (`chargedCumulativeAmount`). Local estimates, with no chain read.\n *\n * Not hook-safe (it loads the x402 SDK's storage), so `fee.ts` does not carry it.\n */\nasync function channels(dir: string): Promise<{ depositedAtomic: bigint; leftAtomic: bigint }[]> {\n const storage = new FileClientChannelStorage({ directory: dir });\n const out: { depositedAtomic: bigint; leftAtomic: bigint }[] = [];\n for (const name of await readdir(join(dir, 'client')).catch(() => [] as string[])) {\n const id = /^(0x[0-9a-f]{64})\\.json$/.exec(name)?.[1];\n const channel = id === undefined ? undefined : await storage.get(id).catch(() => undefined);\n if (channel === undefined) continue;\n const depositedAtomic = BigInt(channel.balance ?? '0');\n const left = depositedAtomic - BigInt(channel.chargedCumulativeAmount ?? '0');\n out.push({ depositedAtomic, leftAtomic: left > 0n ? left : 0n });\n }\n return out;\n}\n\nasync function bestCredit(dir: string): Promise<bigint> {\n let best = 0n;\n for (const { leftAtomic } of await channels(dir)) {\n if (leftAtomic > best) best = leftAtomic;\n }\n return best;\n}\n\n/**\n * What the wallet has set aside in the active routing channel, or in the\n * reusable inference channel. Each directory may contain earlier channel\n * records, so take its largest available balance.\n */\nexport async function channelCredit(\n dataDir: string,\n address: string,\n lane: 'tool' | 'model' | 'model-routing' = 'tool',\n origin?: string,\n): Promise<bigint> {\n if (lane === 'tool') return bestCredit(payerDir(dataDir, address));\n if (!origin) throw new Error('Model credit requires its server origin');\n return bestCredit(\n modelChannelDir(dataDir, address, lane === 'model' ? 'model-inference' : lane, origin),\n );\n}\n\n/**\n * WHAT ROUTING HAS COST, the routing total status and wallet balance show:\n * the deposits sent less the credit they still hold, over every channel file\n * this wallet has here. Offers show no fee, so this is where a person finds it.\n */\nexport async function routingSpent(dataDir: string, address: string): Promise<bigint> {\n let total = 0n;\n for (const { depositedAtomic, leftAtomic } of await channels(payerDir(dataDir, address))) {\n total += depositedAtomic - leftAtomic;\n }\n return total;\n}\n","import { mkdir, readFile, rename, unlink, writeFile } from \"node:fs/promises\";\nimport { dirname, join, resolve, sep } from \"node:path\";\n\n/**\n * Resolves `filename` under `baseDir` and asserts the result stays within `baseDir`.\n *\n * @param baseDir - Directory that must contain the resolved path.\n * @param filename - Filename to resolve against `baseDir`.\n * @returns The absolute resolved path.\n * @throws When the resolved path escapes `baseDir` (e.g. via `..` or separators).\n */\nexport function resolveWithinDir(baseDir: string, filename: string): string {\n const base = resolve(baseDir);\n const target = resolve(base, filename);\n if (target !== base && !target.startsWith(base + sep)) {\n throw new Error(\"resolved channel path escapes storage root\");\n }\n return target;\n}\n\n/**\n * Returns true when `err` is a Node.js `ENOENT` filesystem error (file does not exist).\n *\n * @param err - The thrown value to inspect.\n * @returns `true` for `ENOENT`, `false` for any other value or error code.\n */\nexport function isNodeEnoent(err: unknown): boolean {\n if (!err || typeof err !== \"object\" || !(\"code\" in err)) return false;\n return (err as NodeJS.ErrnoException).code === \"ENOENT\";\n}\n\n/**\n * Reads a JSON file and parses it. Returns `undefined` if the file does not exist.\n * Other errors (permission, malformed JSON) are rethrown.\n *\n * @param filePath - Path to the JSON file.\n * @returns Parsed value, or `undefined` for `ENOENT`.\n */\nexport async function readJsonFile<T>(filePath: string): Promise<T | undefined> {\n try {\n const raw = await readFile(filePath, \"utf8\");\n return JSON.parse(raw) as T;\n } catch (err: unknown) {\n if (isNodeEnoent(err)) return undefined;\n throw err;\n }\n}\n\n/**\n * Writes JSON to `filePath` atomically (temp file in the same directory, then rename).\n * Creates parent directories as needed.\n *\n * @param filePath - Destination file path; parent dirs are created if missing.\n * @param value - JSON-serializable value to persist.\n */\nexport async function writeJsonAtomic(filePath: string, value: unknown): Promise<void> {\n const dir = dirname(filePath);\n await mkdir(dir, { recursive: true });\n const tmp = join(dir, `.${process.pid}.${Date.now()}.${Math.random().toString(36).slice(2)}.tmp`);\n const body = `${JSON.stringify(value, null, 2)}\\n`;\n await writeFile(tmp, body, \"utf8\");\n try {\n await rename(tmp, filePath);\n } catch {\n // On Windows, rename() onto an existing file throws EEXIST; unlink + rename is intentional.\n await unlink(filePath).catch(() => {});\n await rename(tmp, filePath);\n }\n}\n","import { unlink } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nimport { isNodeEnoent, readJsonFile, resolveWithinDir, writeJsonAtomic } from \"../storage-utils\";\nimport { normalizeChannelId } from \"../utils\";\nimport type { FileChannelStorageOptions } from \"../types\";\nimport type { ClientChannelStorage, BatchSettlementClientContext } from \"./storage\";\n\nexport type { FileChannelStorageOptions };\n\n/**\n * Node.js file-backed {@link ClientChannelStorage} for the batched client scheme.\n * Each channel's context is persisted as `{root}/client/{channelId}.json` so that channel\n * records survive process restarts.\n */\nexport class FileClientChannelStorage implements ClientChannelStorage {\n private readonly root: string;\n\n /**\n * Creates file-backed client channel storage under the given root directory.\n *\n * @param options - Configuration including the storage root directory.\n */\n constructor(options: FileChannelStorageOptions) {\n this.root = options.directory;\n }\n\n /**\n * Loads the stored client context for a channel, if present.\n *\n * @param key - Channel storage key (typically a lowercased channelId).\n * @returns Parsed context or `undefined` when the file is missing.\n */\n async get(key: string): Promise<BatchSettlementClientContext | undefined> {\n return readJsonFile<BatchSettlementClientContext>(this.filePath(key));\n }\n\n /**\n * Persists the client context for a channel.\n *\n * @param key - Channel storage key.\n * @param context - Context record to write.\n */\n async set(key: string, context: BatchSettlementClientContext): Promise<void> {\n await writeJsonAtomic(this.filePath(key), context);\n }\n\n /**\n * Removes the persisted context file for a channel, if it exists.\n *\n * @param key - Channel storage key.\n */\n async delete(key: string): Promise<void> {\n try {\n await unlink(this.filePath(key));\n } catch (err: unknown) {\n if (isNodeEnoent(err)) return;\n throw err;\n }\n }\n\n /**\n * Absolute path to the JSON file for a channel.\n *\n * @param key - Channel storage key (a canonical `bytes32` channel id).\n * @returns Filesystem path under `{root}/client/...`.\n * @throws When `key` is not a canonical `bytes32` string or escapes the storage root.\n */\n private filePath(key: string): string {\n const id = normalizeChannelId(key);\n return resolveWithinDir(join(this.root, \"client\"), `${id}.json`);\n }\n}\n","import { createHash } from 'node:crypto';\nimport { join } from 'node:path';\nimport { payerDir, ROUTING_DEPOSIT_KEY } from './fee';\n\nexport type ModelPaymentPath = '/api/model-router/route' | '/api/model-proxy/messages';\nexport type ModelChannelLane = 'model-routing' | 'model-inference';\n\nexport function modelChannelLane(path: ModelPaymentPath): ModelChannelLane {\n return path === '/api/model-router/route' ? 'model-routing' : 'model-inference';\n}\n\n/** URL is not part of the SDK's channel ID. Scope its supported salt ourselves,\n * so independent local/production ledgers cannot fork one onchain channel. */\nexport function modelChannelScope(origin: string, lane: ModelChannelLane) {\n const canonicalOrigin = new URL(origin).origin;\n const id = createHash('sha256')\n .update(JSON.stringify(['tenjin-model-channel', 1, canonicalOrigin, lane]))\n .digest('hex');\n return { origin: canonicalOrigin, id, salt: `0x${id}` as `0x${string}` };\n}\n\nexport function modelChannelDir(\n dataDir: string,\n address: string,\n lane: ModelChannelLane,\n origin: string,\n) {\n return join(payerDir(dataDir, address), lane, modelChannelScope(origin, lane).id);\n}\n\n/** A new channel for every accepted run, including a continuation of a paid job. */\nexport function modelInferenceRunScope(origin: string, runId: string) {\n const canonicalOrigin = new URL(origin).origin;\n const id = createHash('sha256')\n .update(JSON.stringify(['tenjin-model-channel', 2, canonicalOrigin, 'model-inference', runId]))\n .digest('hex');\n return { origin: canonicalOrigin, id, salt: `0x${id}` as `0x${string}` };\n}\n\nexport function modelInferenceRunDir(\n dataDir: string,\n address: string,\n origin: string,\n runId: string,\n) {\n return join(\n payerDir(dataDir, address),\n 'model-inference',\n modelInferenceRunScope(origin, runId).id,\n );\n}\n\n/**\n * THE OLD SHARED INFERENCE CHANNELS of earlier dev builds: two per wallet and router, slot 0\n * (the scope `modelChannelScope(origin, 'model-inference')` still names) and slot 1, which\n * had a `1` in its scope. Nothing opens or pays on them any more; only the one-time recovery\n * of what they hold reads them (`tenjin wallet reclaim-subagent-credit`). Delete with it.\n */\nexport function legacySharedInferenceChannel(origin: string, slot: 0 | 1) {\n const canonicalOrigin = new URL(origin).origin;\n const id = createHash('sha256')\n .update(\n JSON.stringify([\n 'tenjin-model-channel',\n 1,\n canonicalOrigin,\n 'model-inference',\n ...(slot === 1 ? [1] : []),\n ]),\n )\n .digest('hex');\n return { id, salt: `0x${id}` as `0x${string}` };\n}\n\n/**\n * THE LEDGER KEYS OF ONE RUN'S DEPOSITS. A run's own channel is refunded when the run\n * ends, so its deposits are counted under the run (`prefix`): a confirmed refund gives\n * back that run's own exposure and no other spend. What the run kept is then counted\n * under `kept`, still a routing deposit to `tenjin status`.\n */\nexport function modelRunDepositKeys(origin: string, runId: string) {\n const { id } = modelInferenceRunScope(origin, runId);\n return { prefix: `${ROUTING_DEPOSIT_KEY}run:${id}:`, kept: `${ROUTING_DEPOSIT_KEY}kept:${id}` };\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAS,eAAe;AACxB,SAAS,QAAAA,aAAY;;;ACDrB,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EAAE,iBAAiB,YAAY,OAAO,KAAK,OAAO,GAAG,CAAC;AAAA,EACjE;AACA,SAAO;AACT;AAEA,eAAe,WAAW,KAA8B;AACtD,MAAI,OAAO;AACX,aAAW,EAAE,WAAW,KAAK,MAAM,SAAS,GAAG,GAAG;AAChD,QAAI,aAAa,KAAM,QAAO;AAAA,EAChC;AACA,SAAO;AACT;AAOA,eAAsB,cACpB,SACA,SACA,OAA2C,QAC3C,QACiB;AACjB,MAAI,SAAS,OAAQ,QAAO,WAAW,SAAS,SAAS,OAAO,CAAC;AACjE,MAAI,CAAC,OAAQ,OAAM,IAAI,MAAM,yCAAyC;AACtE,SAAO;AAAA,IACL,gBAAgB,SAAS,SAAS,SAAS,UAAU,oBAAoB,MAAM,MAAM;AAAA,EACvF;AACF;AAOA,eAAsB,aAAa,SAAiB,SAAkC;AACpF,MAAI,QAAQ;AACZ,aAAW,EAAE,iBAAiB,WAAW,KAAK,MAAM,SAAS,SAAS,SAAS,OAAO,CAAC,GAAG;AACxF,aAAS,kBAAkB;AAAA,EAC7B;AACA,SAAO;AACT;","names":["join","unlink","join","join","join","join"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
jt
|
|
4
|
+
} from "./chunk-W4G3K3V7.js";
|
|
5
|
+
import {
|
|
6
|
+
_
|
|
7
|
+
} from "./chunk-VWZYE3NC.js";
|
|
8
|
+
|
|
9
|
+
// node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.3.325_@anthropic-ai+sdk@0.137.0_zod@4.6.7__@modelconte_6201ba81a17d8b6bc4087a6afdf0345f/node_modules/@anthropic-ai/claude-agent-sdk/core-fxa8mwbm.mjs
|
|
10
|
+
import { execFile as f } from "child_process";
|
|
11
|
+
import { promisify as m } from "util";
|
|
12
|
+
import { existsSync as n, lstatSync as s, readdirSync as l, statSync as a } from "fs";
|
|
13
|
+
import { isAbsolute as c, join as p } from "path";
|
|
14
|
+
if (typeof Symbol.dispose !== "symbol") {
|
|
15
|
+
try {
|
|
16
|
+
Symbol.dispose = /* @__PURE__ */ Symbol.for("Symbol.dispose");
|
|
17
|
+
} catch {
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (typeof Symbol.asyncDispose !== "symbol") {
|
|
21
|
+
try {
|
|
22
|
+
Symbol.asyncDispose = /* @__PURE__ */ Symbol.for("Symbol.asyncDispose");
|
|
23
|
+
} catch {
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function i(r, e) {
|
|
27
|
+
if (process.platform !== "darwin" || Boolean(e.DEVELOPER_DIR)) return false;
|
|
28
|
+
try {
|
|
29
|
+
return (r.includes("/") ? r : (e.PATH ?? "").split(":").filter((t) => c(t)).map((t) => p(t, r)).find((t) => n(t))) === "/usr/bin/git" && a("/Library/Developer/CommandLineTools", { throwIfNoEntry: false }) === void 0 && s("/var/db/xcode_select_link", { throwIfNoEntry: false }) === void 0 && !l("/Applications").some((t) => /^Xcode.*\.app$/i.test(t));
|
|
30
|
+
} catch {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
var d = m(f);
|
|
35
|
+
async function qe(r) {
|
|
36
|
+
let e = jt("git");
|
|
37
|
+
if (e === null || i(e, process.env)) return [];
|
|
38
|
+
try {
|
|
39
|
+
let { stdout: o } = await d(e, ["-c", "core.hooksPath=/dev/null", "-c", "core.fsmonitor=", "worktree", "list", "--porcelain"], { cwd: r, timeout: 5e3, windowsHide: true });
|
|
40
|
+
if (!o) return [];
|
|
41
|
+
return o.split(`
|
|
42
|
+
`).filter((t) => t.startsWith("worktree ")).map((t) => _(t.slice(9)));
|
|
43
|
+
} catch {
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
qe
|
|
50
|
+
};
|
|
51
|
+
/*! Bundled license information:
|
|
52
|
+
|
|
53
|
+
@anthropic-ai/claude-agent-sdk/core-fxa8mwbm.mjs:
|
|
54
|
+
(*! symbol-dispose-prelude: defines Symbol.dispose and Symbol.asyncDispose if missing, for this bundle's `using`. *)
|
|
55
|
+
*/
|
|
56
|
+
//# sourceMappingURL=chunk-2L7TDGLV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../node_modules/.pnpm/@anthropic-ai+claude-agent-sdk@0.3.325_@anthropic-ai+sdk@0.137.0_zod@4.6.7__@modelconte_6201ba81a17d8b6bc4087a6afdf0345f/node_modules/@anthropic-ai/claude-agent-sdk/core-fxa8mwbm.mjs"],"sourcesContent":["// (c) Anthropic PBC. All rights reserved. Use is subject to the Legal Agreements outlined here: https://code.claude.com/docs/en/legal-and-compliance.\n\n// Version: 0.3.325\n\n//! symbol-dispose-prelude: defines Symbol.dispose and Symbol.asyncDispose if missing, for this bundle's `using`.\nif (typeof Symbol.dispose !== 'symbol') {\n try {\n Symbol.dispose = Symbol.for('Symbol.dispose')\n } catch {}\n}\nif (typeof Symbol.asyncDispose !== 'symbol') {\n try {\n Symbol.asyncDispose = Symbol.for('Symbol.asyncDispose')\n } catch {}\n}\nimport{_}from\"./core-msnqqcc2.mjs\";import{jt}from\"./core-gbbw9cgm.mjs\";import{execFile as f}from\"child_process\";import{promisify as m}from\"util\";import{existsSync as n,lstatSync as s,readdirSync as l,statSync as a}from\"fs\";import{isAbsolute as c,join as p}from\"path\";function i(r,e){if(process.platform!==\"darwin\"||Boolean(e.DEVELOPER_DIR))return!1;try{return(r.includes(\"/\")?r:(e.PATH??\"\").split(\":\").filter((t)=>c(t)).map((t)=>p(t,r)).find((t)=>n(t)))===\"/usr/bin/git\"&&a(\"/Library/Developer/CommandLineTools\",{throwIfNoEntry:!1})===void 0&&s(\"/var/db/xcode_select_link\",{throwIfNoEntry:!1})===void 0&&!l(\"/Applications\").some((t)=>/^Xcode.*\\.app$/i.test(t))}catch{return!1}}var d=m(f);async function qe(r){let e=jt(\"git\");if(e===null||i(e,process.env))return[];try{let{stdout:o}=await d(e,[\"-c\",\"core.hooksPath=/dev/null\",\"-c\",\"core.fsmonitor=\",\"worktree\",\"list\",\"--porcelain\"],{cwd:r,timeout:5000,windowsHide:!0});if(!o)return[];return o.split(`\n`).filter((t)=>t.startsWith(\"worktree \")).map((t)=>_(t.slice(9)))}catch{return[]}}\nexport{qe};\n"],"mappings":";;;;;;;;;AAeuE,SAAO,YAAY,SAAM;AAAgB,SAAO,aAAa,SAAM;AAAO,SAAO,cAAc,GAAE,aAAa,GAAE,eAAe,GAAE,YAAY,SAAM;AAAK,SAAO,cAAc,GAAE,QAAQ,SAAM;AAVpQ,IAAI,OAAO,OAAO,YAAY,UAAU;AACtC,MAAI;AACF,WAAO,UAAU,uBAAO,IAAI,gBAAgB;AAAA,EAC9C,QAAQ;AAAA,EAAC;AACX;AACA,IAAI,OAAO,OAAO,iBAAiB,UAAU;AAC3C,MAAI;AACF,WAAO,eAAe,uBAAO,IAAI,qBAAqB;AAAA,EACxD,QAAQ;AAAA,EAAC;AACX;AAC2Q,SAAS,EAAE,GAAE,GAAE;AAAC,MAAG,QAAQ,aAAW,YAAU,QAAQ,EAAE,aAAa,EAAE,QAAM;AAAG,MAAG;AAAC,YAAO,EAAE,SAAS,GAAG,IAAE,KAAG,EAAE,QAAM,IAAI,MAAM,GAAG,EAAE,OAAO,CAAC,MAAI,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,MAAI,EAAE,GAAE,CAAC,CAAC,EAAE,KAAK,CAAC,MAAI,EAAE,CAAC,CAAC,OAAK,kBAAgB,EAAE,uCAAsC,EAAC,gBAAe,MAAE,CAAC,MAAI,UAAQ,EAAE,6BAA4B,EAAC,gBAAe,MAAE,CAAC,MAAI,UAAQ,CAAC,EAAE,eAAe,EAAE,KAAK,CAAC,MAAI,kBAAkB,KAAK,CAAC,CAAC;AAAA,EAAC,QAAM;AAAC,WAAM;AAAA,EAAE;AAAC;AAAC,IAAI,IAAE,EAAE,CAAC;AAAE,eAAe,GAAG,GAAE;AAAC,MAAI,IAAE,GAAG,KAAK;AAAE,MAAG,MAAI,QAAM,EAAE,GAAE,QAAQ,GAAG,EAAE,QAAM,CAAC;AAAE,MAAG;AAAC,QAAG,EAAC,QAAO,EAAC,IAAE,MAAM,EAAE,GAAE,CAAC,MAAK,4BAA2B,MAAK,mBAAkB,YAAW,QAAO,aAAa,GAAE,EAAC,KAAI,GAAE,SAAQ,KAAK,aAAY,KAAE,CAAC;AAAE,QAAG,CAAC,EAAE,QAAM,CAAC;AAAE,WAAO,EAAE,MAAM;AAAA,CACn7B,EAAE,OAAO,CAAC,MAAI,EAAE,WAAW,WAAW,CAAC,EAAE,IAAI,CAAC,MAAI,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;AAAA,EAAC,QAAM;AAAC,WAAM,CAAC;AAAA,EAAC;AAAC;","names":[]}
|
|
@@ -16,6 +16,7 @@ var SESSION_FILE = "session.json";
|
|
|
16
16
|
var REDIRECT_PREFIX = "redirect-";
|
|
17
17
|
var NOTE_PREFIX = "note-";
|
|
18
18
|
var QUERY_PREFIX = "query-";
|
|
19
|
+
var DECIDED_PREFIX = "decided-";
|
|
19
20
|
var CALL_FILE_RE = /^[a-f0-9]{64}\.json$/;
|
|
20
21
|
var STALE_AFTER_MS = 9e4;
|
|
21
22
|
var RECENT_MS = 1e4;
|
|
@@ -38,7 +39,7 @@ function sanitize(value, limit) {
|
|
|
38
39
|
);
|
|
39
40
|
}
|
|
40
41
|
async function clean(value, limit) {
|
|
41
|
-
const { mask } = await import("./redact-
|
|
42
|
+
const { mask } = await import("./redact-LOTHE5TS.js");
|
|
42
43
|
return sanitize(mask(value), limit);
|
|
43
44
|
}
|
|
44
45
|
async function endpointOf(value) {
|
|
@@ -81,13 +82,24 @@ async function markOffered(dataDir, sessionId, toolUseId, offer, now = Date.now(
|
|
|
81
82
|
at: now,
|
|
82
83
|
...offer.offerId !== void 0 && OFFER_ID_RE.test(offer.offerId) ? { offerId: offer.offerId } : {},
|
|
83
84
|
...offer.label !== void 0 ? { label: sanitize(offer.label, 32) } : {},
|
|
84
|
-
|
|
85
|
+
...offer.priceAtomic !== void 0 && /^\d{1,78}$/.test(offer.priceAtomic) ? { priceAtomic: offer.priceAtomic } : {},
|
|
86
|
+
...offer.swap === true ? { swap: true } : {}
|
|
85
87
|
};
|
|
86
88
|
await write(
|
|
87
89
|
join(sessionDir(dataDir, sessionId), `${OFFER_PREFIX}${digest(toolUseId)}.json`),
|
|
88
90
|
saved
|
|
89
91
|
);
|
|
90
92
|
}
|
|
93
|
+
async function markHandedBack(dataDir, sessionId, toolUseId, now = Date.now()) {
|
|
94
|
+
const saved = { version: 1, at: now };
|
|
95
|
+
await write(
|
|
96
|
+
join(sessionDir(dataDir, sessionId), `${OFFER_PREFIX}${digest(toolUseId)}.json`),
|
|
97
|
+
saved
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
function promptOfferKey(prompt) {
|
|
101
|
+
return `prompt:${prompt}`;
|
|
102
|
+
}
|
|
91
103
|
async function wasOffered(dataDir, sessionId, toolUseId, now = Date.now()) {
|
|
92
104
|
const path = join(sessionDir(dataDir, sessionId), `${OFFER_PREFIX}${digest(toolUseId)}.json`);
|
|
93
105
|
const stamp = await readStamp(path);
|
|
@@ -95,7 +107,13 @@ async function wasOffered(dataDir, sessionId, toolUseId, now = Date.now()) {
|
|
|
95
107
|
}
|
|
96
108
|
async function markNoted(dataDir, sessionId, toolUseId, note, now = Date.now()) {
|
|
97
109
|
if (!OFFER_ID_RE.test(note.offerId) || !note.line.includes(note.offerId)) return false;
|
|
98
|
-
const saved = {
|
|
110
|
+
const saved = {
|
|
111
|
+
version: 1,
|
|
112
|
+
at: now,
|
|
113
|
+
offerId: note.offerId,
|
|
114
|
+
line: note.line,
|
|
115
|
+
...note.ids !== void 0 ? { ids: note.ids } : {}
|
|
116
|
+
};
|
|
99
117
|
if (Buffer.byteLength(JSON.stringify(saved), "utf8") > MAX_RECORD_BYTES) return false;
|
|
100
118
|
return write(notePath(dataDir, sessionId, toolUseId), saved);
|
|
101
119
|
}
|
|
@@ -103,12 +121,13 @@ async function noteOf(dataDir, sessionId, toolUseId, now = Date.now()) {
|
|
|
103
121
|
const row = await readJson(notePath(dataDir, sessionId, toolUseId));
|
|
104
122
|
const stamp = stampOf(row);
|
|
105
123
|
if (row === null || stamp === null || now - stamp.at > EXPIRY_MS) return null;
|
|
106
|
-
const { offerId, line: line2 } = row;
|
|
124
|
+
const { offerId, line: line2, ids } = row;
|
|
107
125
|
if (typeof offerId !== "string" || !OFFER_ID_RE.test(offerId)) return null;
|
|
108
126
|
if (typeof line2 !== "string" || /[\p{Cc}\p{Cf}]/u.test(line2) || !line2.includes(offerId)) {
|
|
109
127
|
return null;
|
|
110
128
|
}
|
|
111
|
-
|
|
129
|
+
const offered = Array.isArray(ids) && ids.every((id) => typeof id === "string" && OFFER_ID_RE.test(id)) ? ids : void 0;
|
|
130
|
+
return { offerId, line: line2, ...offered !== void 0 ? { ids: offered } : {} };
|
|
112
131
|
}
|
|
113
132
|
function notePath(dataDir, sessionId, toolUseId) {
|
|
114
133
|
return join(sessionDir(dataDir, sessionId), `${NOTE_PREFIX}${digest(toolUseId)}.json`);
|
|
@@ -245,7 +264,7 @@ async function pruneProgress(directory, now = Date.now()) {
|
|
|
245
264
|
}
|
|
246
265
|
}
|
|
247
266
|
function agesByMtime(name) {
|
|
248
|
-
return name.startsWith(".");
|
|
267
|
+
return name.startsWith(".") || name.startsWith(DECIDED_PREFIX);
|
|
249
268
|
}
|
|
250
269
|
async function mtimeOf(path) {
|
|
251
270
|
try {
|
|
@@ -376,11 +395,14 @@ async function readJson(path) {
|
|
|
376
395
|
}
|
|
377
396
|
|
|
378
397
|
export {
|
|
398
|
+
DECIDED_PREFIX,
|
|
379
399
|
sessionDir,
|
|
380
400
|
newCallId,
|
|
381
401
|
noteSession,
|
|
382
402
|
bindDecision,
|
|
383
403
|
markOffered,
|
|
404
|
+
markHandedBack,
|
|
405
|
+
promptOfferKey,
|
|
384
406
|
wasOffered,
|
|
385
407
|
markNoted,
|
|
386
408
|
noteOf,
|
|
@@ -394,4 +416,4 @@ export {
|
|
|
394
416
|
pruneSessions,
|
|
395
417
|
renderProgress
|
|
396
418
|
};
|
|
397
|
-
//# sourceMappingURL=chunk-
|
|
419
|
+
//# sourceMappingURL=chunk-2U7H35IP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/router/progress.ts"],"sourcesContent":["import { createHash, randomUUID } from 'node:crypto';\nimport { constants } from 'node:fs';\nimport { lstat, open, opendir, rm } from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { writeFileAtomic, writeFileAtomicExclusive } from '../lib/atomic-json';\n\n/**\n * The live status line's evidence: what this session is looking up right now,\n * which provider is actually being called, and what it cost.\n *\n * DISPLAY ONLY, AND STRICTLY DOWNSTREAM. Nothing here is read by the gate, the\n * decision, the spend policy or the paying leg; every write is best effort and\n * every failure is swallowed, so a full disk or a read-only data dir loses the\n * footer and changes no routing or payment outcome. That is the whole contract\n * this module has to keep. Two markers are read back by the hooks, the offer\n * mark and the redirect claims, and both only ever make a hook say less: losing\n * either routes a call exactly as a session with no record would, and a claim\n * that cannot be written denies nothing. The free-docs\n * records are the same kind: a lost note record is a search with no line\n * after it, and a lost query claim is one more line.\n *\n * KEYED TO THE SESSION, NEVER GUESSED FROM IT. A record lives under the SHA-256\n * of the harness's own `session_id`, so the renderer for one session cannot see\n * another's. The hook knows that id; the tool, which runs inside the MCP server\n * process, does not, so it resolves the session in one of exactly two ways:\n *\n * - BY BINDING. An `execute` decision leaves an `id-<hash>.json` marker in the\n * session that produced it, and the model passes that id back on the tool\n * call. Resolving through the marker is proof, not inference.\n * - BY SOLE ACTIVITY. With no id, the request belongs to the only session that\n * has been active recently, and when two have been, it belongs to neither as\n * far as this module is concerned: {@link resolveProgressSession} returns\n * null and nothing is written. A missing footer is the correct failure;\n * showing one session's lookup in another session's terminal is not.\n */\n\nconst PROGRESS_DIR = 'progress';\n/** The binding marker's prefix, so it can never be read back as a call record. */\nconst BINDING_PREFIX = 'id-';\n/** A pre-call redirect's marker, keyed by the harness's `tool_use_id`. */\nconst OFFER_PREFIX = 'offer-';\n/** The session's own liveness touch, likewise outside the call-record pattern. */\nconst SESSION_FILE = 'session.json';\n/** A pre-call redirect, one file per agent and target in the session. */\nconst REDIRECT_PREFIX = 'redirect-';\n/** A search the pre-call hook noted a free lookup on, keyed by its `tool_use_id`. */\nconst NOTE_PREFIX = 'note-';\n/** One agent's search query that was noted, one file per window, so the same\n * one is not noted twice. */\nconst QUERY_PREFIX = 'query-';\n/** A native call's routing decision, kept for the pre-call hook when the swap\n * hands it back (`decided.ts`). Its size is the router's, so it ages by mtime. */\nexport const DECIDED_PREFIX = 'decided-';\n/** Call records are named by a 64-hex digest and nothing else is read as one. */\nconst CALL_FILE_RE = /^[a-f0-9]{64}\\.json$/;\n\n/** An in-flight call older than this is shown as stale, never as running. */\nexport const STALE_AFTER_MS = 90_000;\n/**\n * How long a state stays on the footer once nothing has replaced it. The demo\n * holds each one for about ten seconds, which is what makes a decision that\n * takes a second readable at a one-second refresh; after that the line is\n * `x402 · ready` again.\n */\nexport const RECENT_MS = 10_000;\n/** Older than this and a record is ignored by the renderer and pruned on write. */\nexport const EXPIRY_MS = 10 * 60_000;\n/** How recently a session must have been touched to claim an id-less request. */\nexport const SESSION_ACTIVE_MS = 10 * 60_000;\n/** How long one agent's identical search is not given the same note again. */\nexport const NOTE_REPEAT_MS = 5 * 60_000;\n/** Above this many files a session directory is reported rather than scanned. */\nconst MAX_RECORDS = 256;\n/** A ceiling on the root scan. {@link pruneSessions} keeps it far below this:\n * a directory is one LIVE session, not one session this machine ever had. */\nconst MAX_SESSIONS = 4_096;\n/** A record larger than this is damaged or not ours; it is skipped unread. */\nconst MAX_RECORD_BYTES = 4_096;\n/** An offer id as a record keeps one: the server's opaque handle. */\nconst OFFER_ID_RE = /^[\\w.:-]{1,200}$/;\n\nexport type ProgressPhase = 'routing' | 'calling' | 'done';\n\n/** The two markers: a session's liveness touch and a decision-id binding. */\ninterface Stamp {\n version: 1;\n at: number;\n}\n\n/** What one call looks like on disk. Every string is already masked and bounded. */\ninterface SavedProgress extends Stamp {\n phase: ProgressPhase;\n /** The tool whose activity this is, as the footer names it. */\n operation: string;\n /** What the state SAYS: the outcome on `done`, and on an in-flight record the\n * stage, when it is not the tool's own `selecting service`. */\n outcome?: string;\n /** Host plus path of the provider actually called, without a scheme. */\n endpoint?: string;\n /** The service's display name as the server gave it. */\n label?: string;\n /** The call's parameters as compact JSON. */\n parameters?: string;\n /** What the provider was paid, as USD. */\n price?: string;\n}\n\n/**\n * THE NOTE RECORD, one per WebSearch the pre-call hook let run with a free\n * offer, keyed by its `tool_use_id`: the offer's id and the server's line,\n * which the after-call hook shows once the search has run, and every id the\n * line offers, which it keeps untaken then (`untaken.ts`). The CLI's alone:\n * the mod draws nothing on the search.\n */\ninterface SavedNote extends Stamp {\n offerId: string;\n line: string;\n ids?: string[];\n}\n\n/** What a note record names: the offer, its line and the ids that line offers. */\nexport interface NotedOffer {\n offerId: string;\n line: string;\n ids?: string[];\n}\n\n/**\n * THE OFFER RECORD, one per native call a hook redirected, keyed by its\n * `tool_use_id`, and one per prompt the prompt hook made an offer on, keyed by\n * {@link promptOfferKey}: when it was made, the offer's id, its `label` when the\n * decision carried one, and its price in atomic USDC. Part of the state\n * contract between this CLI and the plugin's mod (`mod-state.ts`), which reads\n * it to draw the redirected row and to find the `request` call that takes the\n * offer up by its id; it never parses the reason the model read. Version 1\n * grows by optional fields only, so a reader ignores one it does not know, and\n * an older CLI's prune still reads it as a record.\n */\ninterface SavedOffer extends Stamp {\n offerId?: string;\n label?: string;\n priceAtomic?: string;\n /** The offer ran in the native call's place (the swap), not held. */\n swap?: true;\n}\n\n/** What the offer record names: the offer's id, display name and price, and\n * whether it ran in the native call's place. */\nexport interface OfferedTerms {\n offerId?: string;\n label?: string;\n /** Absent for an offer on the user's own account, which their plan pays. */\n priceAtomic?: string;\n swap?: true;\n}\n\nexport interface ProgressStep {\n phase: ProgressPhase;\n operation?: string;\n outcome?: string;\n /** The executed provider's URL. It can differ from the hint's suggestion. */\n provider?: string;\n /** The service's display name, from its decision, shown in place of the URL. */\n label?: string;\n parameters?: unknown;\n price?: string;\n}\n\nconst digest = (value: string): string => createHash('sha256').update(value).digest('hex');\n\nfunction bounded(value: string, limit: number): string {\n const chars = Array.from(value);\n return chars.length <= limit ? value : `${chars.slice(0, limit - 1).join('')}…`;\n}\n\n/**\n * Provider text reaches a terminal here, so it is treated as hostile: control\n * characters, format characters and directional overrides are replaced before\n * anything is written, and again before anything is printed. A footer that can\n * be made to repaint the line above it is a spoofing surface, not a display.\n */\nexport function sanitize(value: string, limit: number): string {\n return bounded(\n value\n .replace(/[\\p{Cc}\\p{Cf}]/gu, ' ')\n .replace(/\\s+/g, ' ')\n .trim(),\n limit,\n );\n}\n\n/**\n * The CLI's own redaction, behind a dynamic import ON PURPOSE: the rule corpus\n * and the BIP-39 wordlist are a real parse cost, the renderer runs once a\n * second, and only the write path needs them. `dist-chunks.test.ts` pins it.\n */\nasync function clean(value: string, limit: number): Promise<string> {\n const { mask } = await import('../lib/redact');\n return sanitize(mask(value), limit);\n}\n\n/** Host plus path, which is what names a provider to a person watching. */\nasync function endpointOf(value: string): Promise<string> {\n let url: URL;\n try {\n url = new URL(value);\n } catch {\n return 'invalid endpoint';\n }\n if (url.username !== '' || url.password !== '') return 'invalid endpoint';\n return clean(`${url.host}${url.pathname === '/' ? '' : url.pathname}`, 110);\n}\n\nasync function parametersOf(value: unknown): Promise<string | undefined> {\n let json: string | undefined;\n try {\n json = JSON.stringify(value);\n } catch {\n return undefined;\n }\n return json === undefined ? undefined : clean(json, 180);\n}\n\nexport function sessionDir(dataDir: string, sessionId: string): string {\n return join(dataDir, PROGRESS_DIR, digest(sessionId));\n}\n\n/** A fresh key for one call, so two overlapping lookups never share a record. */\nexport function newCallId(): string {\n return randomUUID();\n}\n\n/**\n * Mark this session live, so an id-less tool call made from it can be\n * attributed. Written on every hook event, including the ones that route\n * nothing: an open session has to be distinguishable from a closed one.\n */\nexport async function noteSession(\n dataDir: string,\n sessionId: string,\n now = Date.now(),\n): Promise<void> {\n await write(join(sessionDir(dataDir, sessionId), SESSION_FILE), { version: 1, at: now });\n}\n\n/** Record that this decision id was produced in this session. */\nexport async function bindDecision(\n dataDir: string,\n sessionId: string,\n decisionId: string,\n now = Date.now(),\n): Promise<void> {\n await write(join(sessionDir(dataDir, sessionId), `${BINDING_PREFIX}${digest(decisionId)}.json`), {\n version: 1,\n at: now,\n });\n}\n\n/**\n * ONE ROUTING ANSWER PER LOOKUP. The pre-call hook marks the native call it\n * redirected, by the harness's own `tool_use_id`, and the after-call hook reads\n * the mark before it asks again about the same call. Expires and is pruned like every\n * other record here.\n */\nexport async function markOffered(\n dataDir: string,\n sessionId: string,\n toolUseId: string,\n offer: OfferedTerms,\n now = Date.now(),\n): Promise<void> {\n const saved: SavedOffer = {\n version: 1,\n at: now,\n ...(offer.offerId !== undefined && OFFER_ID_RE.test(offer.offerId)\n ? { offerId: offer.offerId }\n : {}),\n ...(offer.label !== undefined ? { label: sanitize(offer.label, 32) } : {}),\n ...(offer.priceAtomic !== undefined && /^\\d{1,78}$/.test(offer.priceAtomic)\n ? { priceAtomic: offer.priceAtomic }\n : {}),\n ...(offer.swap === true ? { swap: true as const } : {}),\n };\n await write(\n join(sessionDir(dataDir, sessionId), `${OFFER_PREFIX}${digest(toolUseId)}.json`),\n saved,\n );\n}\n\n/**\n * THE SWAP HANDED A CLAIMED CALL BACK, so the native call runs after all: its\n * offer record keeps only its stamp. The after-call arm still sees the call\n * as offered once, and the mod, finding no offer id in it, draws the native\n * call and its result as the engine does, never as a lookup that ran.\n */\nexport async function markHandedBack(\n dataDir: string,\n sessionId: string,\n toolUseId: string,\n now = Date.now(),\n): Promise<void> {\n const saved: SavedOffer = { version: 1, at: now };\n await write(\n join(sessionDir(dataDir, sessionId), `${OFFER_PREFIX}${digest(toolUseId)}.json`),\n saved,\n );\n}\n\n/** The offer record's key for an offer the prompt hook made on `prompt`. */\nexport function promptOfferKey(prompt: string): string {\n return `prompt:${prompt}`;\n}\n\nexport async function wasOffered(\n dataDir: string,\n sessionId: string,\n toolUseId: string,\n now = Date.now(),\n): Promise<boolean> {\n const path = join(sessionDir(dataDir, sessionId), `${OFFER_PREFIX}${digest(toolUseId)}.json`);\n const stamp = await readStamp(path);\n return stamp !== null && now - stamp.at <= EXPIRY_MS;\n}\n\n/**\n * A FREE LOOKUP NOTED ON A SEARCH. The pre-call hook keeps the server's line\n * under the harness's own `tool_use_id`, for the after-call hook to show once\n * the search has run. False when nothing was written: the offer id is not an\n * id, the record would pass the 4,096-byte bound every read here holds, or\n * the write failed. That search then gets no line and no tail.\n */\nexport async function markNoted(\n dataDir: string,\n sessionId: string,\n toolUseId: string,\n note: NotedOffer,\n now = Date.now(),\n): Promise<boolean> {\n if (!OFFER_ID_RE.test(note.offerId) || !note.line.includes(note.offerId)) return false;\n const saved: SavedNote = {\n version: 1,\n at: now,\n offerId: note.offerId,\n line: note.line,\n ...(note.ids !== undefined ? { ids: note.ids } : {}),\n };\n if (Buffer.byteLength(JSON.stringify(saved), 'utf8') > MAX_RECORD_BYTES) return false;\n return write(notePath(dataDir, sessionId, toolUseId), saved);\n}\n\n/**\n * The note {@link markNoted} left for this call, or null: none, expired,\n * damaged, or a line that does not carry its own offer id. What is on disk is\n * input, so every field is checked again.\n */\nexport async function noteOf(\n dataDir: string,\n sessionId: string,\n toolUseId: string,\n now = Date.now(),\n): Promise<NotedOffer | null> {\n const row = await readJson(notePath(dataDir, sessionId, toolUseId));\n const stamp = stampOf(row);\n if (row === null || stamp === null || now - stamp.at > EXPIRY_MS) return null;\n const { offerId, line, ids } = row;\n if (typeof offerId !== 'string' || !OFFER_ID_RE.test(offerId)) return null;\n if (typeof line !== 'string' || /[\\p{Cc}\\p{Cf}]/u.test(line) || !line.includes(offerId)) {\n return null;\n }\n const offered =\n Array.isArray(ids) && ids.every((id) => typeof id === 'string' && OFFER_ID_RE.test(id))\n ? (ids as string[])\n : undefined;\n return { offerId, line, ...(offered !== undefined ? { ids: offered } : {}) };\n}\n\nfunction notePath(dataDir: string, sessionId: string, toolUseId: string): string {\n return join(sessionDir(dataDir, sessionId), `${NOTE_PREFIX}${digest(toolUseId)}.json`);\n}\n\n/**\n * ONE NOTE PER QUERY. True, once, when this agent has not had this exact\n * search noted in the last {@link NOTE_REPEAT_MS}, and the claim is now its.\n * The same window-named exclusive create as {@link claimRedirect}, so two\n * parallel copies of one search get one note, after the window too.\n */\nexport async function claimNote(\n dataDir: string,\n sessionId: string,\n agentId: string | undefined,\n query: string,\n now = Date.now(),\n): Promise<boolean> {\n return claimOnce(\n (window) => {\n const key = digest(JSON.stringify([agentId ?? '', query, window]));\n return join(sessionDir(dataDir, sessionId), `${QUERY_PREFIX}${key}.json`);\n },\n NOTE_REPEAT_MS,\n now,\n );\n}\n\n/**\n * ONE RECORD PER AGENT, TARGET AND WINDOW. Subagents share the session id, so\n * the agent is in the key, and the main agent's part is the empty string, which\n * no `agent_id` can be: the decoder refuses an empty one. The target is in it\n * too, one file each, so parallel calls never share a record: one call's\n * redirect can be neither overwritten nor spent by another's. And so is the\n * {@link EXPIRY_MS} window the claim was made in, so a claim is only ever\n * created, never replaced: see {@link claimRedirect}.\n */\nfunction redirectPath(\n dataDir: string,\n sessionId: string,\n agentId: string | undefined,\n target: string,\n window: number,\n): string {\n const key = digest(JSON.stringify([agentId ?? '', target, window]));\n return join(sessionDir(dataDir, sessionId), `${REDIRECT_PREFIX}${key}.json`);\n}\n\n/**\n * NEVER REDIRECTED TWICE FOR ONE TARGET. True, once, when this agent has not\n * been redirected on this exact search or URL in the last {@link EXPIRY_MS},\n * and the claim is now its; the pre-call hook denies only on true. So the\n * agent's own retry of a redirected call runs, whether the lookup it was sent\n * to delivered, failed or was never called, and whatever other calls ran in\n * between.\n *\n * ONLY EVER AN EXCLUSIVE CREATE. Replacing an expired claim let two parallel\n * copies of one call both read the old stamp and both write, and both deny.\n * The claim's file is named by its window instead, so the one create per\n * window decides, and the previous window's claim, while it is still inside\n * {@link EXPIRY_MS}, is read and never touched: a claim made just before a\n * boundary still lasts its full span. A claim that cannot be written is false:\n * the call runs.\n */\nexport async function claimRedirect(\n dataDir: string,\n sessionId: string,\n agentId: string | undefined,\n target: string,\n now = Date.now(),\n): Promise<boolean> {\n return claimOnce(\n (window) => redirectPath(dataDir, sessionId, agentId, target, window),\n EXPIRY_MS,\n now,\n );\n}\n\n/**\n * The one create both claims make: the file named by the `span` window `now`\n * falls in, refused while the previous window's claim is inside its span. A\n * claim that cannot be written is false.\n */\nasync function claimOnce(\n pathFor: (window: number) => string,\n span: number,\n now: number,\n): Promise<boolean> {\n const window = Math.floor(now / span);\n const previous = await readStamp(pathFor(window - 1));\n if (previous !== null && now - previous.at <= span) return false;\n const stamp: Stamp = { version: 1, at: now };\n try {\n await writeFileAtomicExclusive(pathFor(window), JSON.stringify(stamp), {\n mode: 0o600,\n dirMode: 0o700,\n });\n return true;\n } catch {\n // Taken in this window, which is always inside the span, or not writable.\n return false;\n }\n}\n\n/**\n * THE READ HALF OF {@link claimRedirect}: true when this agent already holds a\n * live claim on this exact search or URL. The pre-call arms ask it BEFORE the\n * router, so the retry of a call they already redirected, which they would\n * only withhold, costs no decision and leaves no offer nobody sees. It never\n * writes and never decides on its own: a false here still goes through the\n * exclusive create, which is what keeps two parallel copies to one deny.\n */\nexport async function redirectClaimed(\n dataDir: string,\n sessionId: string,\n agentId: string | undefined,\n target: string,\n now = Date.now(),\n): Promise<boolean> {\n const window = Math.floor(now / EXPIRY_MS);\n for (const at of [window, window - 1]) {\n const stamp = await readStamp(redirectPath(dataDir, sessionId, agentId, target, at));\n if (stamp !== null && now - stamp.at <= EXPIRY_MS) return true;\n }\n return false;\n}\n\n/**\n * Which session directory a tool call belongs to, or null for \"cannot tell\".\n * Null is a normal answer and its only consequence is a footer that stays quiet.\n */\nexport async function resolveProgressSession(\n dataDir: string,\n opts: { id?: string; now?: number } = {},\n): Promise<string | null> {\n const now = opts.now ?? Date.now();\n const root = join(dataDir, PROGRESS_DIR);\n let names: string[];\n try {\n const directory = await opendir(root);\n names = [];\n for await (const entry of directory) {\n if (entry.isDirectory() && /^[a-f0-9]{64}$/.test(entry.name)) names.push(entry.name);\n if (names.length >= MAX_SESSIONS) break;\n }\n } catch {\n return null;\n }\n if (opts.id !== undefined && opts.id.length > 0) {\n const marker = `${BINDING_PREFIX}${digest(opts.id)}.json`;\n for (const name of names) {\n const bound = await readStamp(join(root, name, marker));\n if (bound !== null && now - bound.at <= EXPIRY_MS) return join(root, name);\n }\n // A stale or unknown id says nothing about which session asked, so the\n // sole-activity rule below still applies rather than a wrong attribution.\n }\n const live: string[] = [];\n for (const name of names) {\n const touched = await readStamp(join(root, name, SESSION_FILE));\n if (touched !== null && now - touched.at <= SESSION_ACTIVE_MS) live.push(name);\n if (live.length > 1) return null;\n }\n return live.length === 1 ? join(root, live[0] as string) : null;\n}\n\n/**\n * Record one step of one call. The caller holds the directory (from\n * {@link sessionDir} or {@link resolveProgressSession}) and the call id, so a\n * step never has to re-resolve anything on the hot path.\n */\nexport async function writeProgress(\n directory: string,\n callId: string,\n step: ProgressStep,\n now = Date.now(),\n): Promise<void> {\n const endpoint = step.provider === undefined ? undefined : await endpointOf(step.provider);\n const parameters =\n step.parameters === undefined ? undefined : await parametersOf(step.parameters);\n const saved: SavedProgress = {\n version: 1,\n at: now,\n phase: step.phase,\n operation: sanitize(step.operation ?? 'request', 24) || 'request',\n ...(step.outcome !== undefined ? { outcome: sanitize(step.outcome, 40) } : {}),\n ...(endpoint !== undefined ? { endpoint } : {}),\n ...(step.label !== undefined ? { label: sanitize(step.label, 32) } : {}),\n ...(parameters !== undefined ? { parameters } : {}),\n ...(step.price !== undefined ? { price: sanitize(step.price, 24) } : {}),\n };\n await write(join(directory, `${digest(callId)}.json`), saved);\n}\n\nexport interface LookupFooter {\n /** A decision is in flight. */\n routing(): Promise<void>;\n /** The EXECUTED provider, which can differ from what the hint suggested. */\n calling(step: { provider: string; label?: string; parameters?: unknown }): Promise<void>;\n /** The outcome, and what the provider was paid for it. */\n done(\n outcome: string,\n step?: { provider?: string; label?: string; parameters?: unknown; price?: string },\n ): Promise<void>;\n}\n\n/** A footer for a session this call cannot be attributed to, or for one step\n * of a call whose own footer speaks for it: it writes nothing. */\nexport const SILENT_FOOTER: LookupFooter = {\n routing: async () => undefined,\n calling: async () => undefined,\n done: async () => undefined,\n};\n\n/**\n * The `request` tool's footer: the session is resolved ONCE, at the top of the\n * call, and each later step is one small write. An unresolvable session yields\n * {@link SILENT_FOOTER}, and the lookup runs exactly as it would have.\n */\nexport async function openLookupFooter(\n dataDir: string,\n opts: { id?: string; operation?: string; now?: () => number } = {},\n): Promise<LookupFooter> {\n const now = opts.now ?? Date.now;\n const directory = await resolveProgressSession(dataDir, {\n ...(opts.id !== undefined ? { id: opts.id } : {}),\n now: now(),\n }).catch(() => null);\n if (directory === null) return SILENT_FOOTER;\n const callId = newCallId();\n const operation = opts.operation ?? 'request';\n const step = async (patch: ProgressStep): Promise<void> => {\n await writeProgress(directory, callId, { operation, ...patch }, now());\n };\n return {\n routing: async () => {\n await step({ phase: 'routing' });\n await pruneProgress(directory, now());\n },\n calling: async (calling) => step({ phase: 'calling', ...calling }),\n done: async (outcome, detail) => step({ phase: 'done', outcome, ...detail }),\n };\n}\n\n/**\n * Remove records past {@link EXPIRY_MS}. Run from a writer, never from the\n * renderer: the footer refreshes once a second and must stay read-only.\n */\nexport async function pruneProgress(directory: string, now = Date.now()): Promise<void> {\n try {\n const dir = await opendir(directory);\n let count = 0;\n for await (const entry of dir) {\n if (++count > MAX_RECORDS) return;\n if (!entry.isFile() || entry.name === SESSION_FILE) continue;\n const path = join(directory, entry.name);\n const record = agesByMtime(entry.name) ? await mtimeOf(path) : await readStamp(path);\n if (record === null || now - record.at > EXPIRY_MS) {\n await rm(path, { force: true }).catch(() => undefined);\n }\n }\n } catch {\n // Housekeeping only. Nothing downstream depends on it having run.\n }\n}\n\n/**\n * A FILE THAT IS NOT A WHOLE RECORD is aged by its mtime, never read as one: a\n * temp file between its write and its rename (every writer here names them\n * `.<name>.<suffix>`). Read as a record it is damaged, and the prune deleted\n * it out from under a parallel hook's rename. A docs body an older build left\n * (`augment-*.docs`) reads as damaged, and goes.\n */\nfunction agesByMtime(name: string): boolean {\n return name.startsWith('.') || name.startsWith(DECIDED_PREFIX);\n}\n\nasync function mtimeOf(path: string): Promise<Stamp | null> {\n try {\n return { version: 1, at: (await lstat(path)).mtimeMs };\n } catch {\n return null;\n }\n}\n\n/**\n * Remove the directories of sessions that are over.\n *\n * WITHOUT THIS THE ROOT ONLY GROWS, one directory per session this machine has\n * ever had, and a root big enough to hit {@link MAX_SESSIONS} would leave\n * {@link resolveProgressSession} scanning an arbitrary subset that need not\n * contain the session asking. Run from the hook, which is the one writer that\n * fires on every turn; a directory whose session is still live is never touched.\n */\nexport async function pruneSessions(dataDir: string, now = Date.now()): Promise<void> {\n const root = join(dataDir, PROGRESS_DIR);\n try {\n const directory = await opendir(root);\n let seen = 0;\n for await (const entry of directory) {\n if (++seen > MAX_SESSIONS) return;\n if (!entry.isDirectory() || !/^[a-f0-9]{64}$/.test(entry.name)) continue;\n const path = join(root, entry.name);\n const session = await readStamp(join(path, SESSION_FILE));\n if (session !== null && now - session.at <= SESSION_ACTIVE_MS) continue;\n // The touch is gone or old, so the only thing that can keep this\n // directory is a record still inside the renderer's window.\n if (await hasLiveRecord(path, now)) continue;\n await rm(path, { recursive: true, force: true }).catch(() => undefined);\n }\n } catch {\n // Housekeeping only. Nothing downstream depends on it having run.\n }\n}\n\nasync function hasLiveRecord(directory: string, now: number): Promise<boolean> {\n try {\n const dir = await opendir(directory);\n let count = 0;\n for await (const entry of dir) {\n if (++count > MAX_RECORDS) return true;\n if (!entry.isFile() || entry.name === SESSION_FILE) continue;\n const record = await readStamp(join(directory, entry.name));\n if (record !== null && now - record.at <= EXPIRY_MS) return true;\n }\n } catch {\n return true;\n }\n return false;\n}\n\n/**\n * The footer for one session: one line, bounded, sanitized, and empty of\n * everything but this session's own calls. Read-only by construction.\n */\nexport async function renderProgress(\n dataDir: string,\n sessionId: string,\n options: { now?: number; columns?: number } = {},\n): Promise<string> {\n const now = options.now ?? Date.now();\n // The harness truncates to the real terminal width, and `COLUMNS` rarely\n // survives into a status-line process, so the default is a wide terminal\n // rather than a narrow one: cutting a provider's path off at 80 columns on a\n // 200-column terminal loses exactly the part worth reading.\n const columns = Math.max(45, Math.min(400, options.columns || 160));\n const directory = sessionDir(dataDir, sessionId);\n const records: SavedProgress[] = [];\n try {\n const dir = await opendir(directory);\n let count = 0;\n for await (const entry of dir) {\n if (++count > MAX_RECORDS) return bounded('x402 · activity exceeds display limit', columns);\n if (!entry.isFile() || !CALL_FILE_RE.test(entry.name)) continue;\n const record = await readCall(join(directory, entry.name));\n if (record !== null && now - record.at <= EXPIRY_MS) records.push(record);\n }\n } catch (error) {\n // A SESSION WITH NO DIRECTORY IS IDLE, not broken: it has simply not looked\n // anything up yet, and the router being on is the thing the idle line says.\n // Any OTHER read failure is this display failing, and a display that failed\n // prints nothing rather than a status it did not read.\n return (error as NodeJS.ErrnoException).code === 'ENOENT' ? READY : '';\n }\n const running = records\n .filter((row) => row.phase !== 'done' && now - row.at <= holdMs(row))\n .sort((a, b) => b.at - a.at);\n // Only a LOOKUP goes stale out loud. A hook decision has a five-second budget,\n // so one still in flight after its hold is a dead hook, and the footer says\n // ready rather than naming a stage nothing is working on.\n const stale = records.filter(\n (row) => row.phase !== 'done' && now - row.at > holdMs(row) && row.operation === 'request',\n );\n const finished = records\n .filter((row) => row.phase === 'done' && now - row.at <= RECENT_MS)\n .sort((a, b) => b.at - a.at);\n const head = running[0] ?? finished[0] ?? stale.sort((a, b) => b.at - a.at)[0];\n if (head === undefined) return READY;\n // OVERLAPPING CALLS ARE COUNTED, NOT HIDDEN. The newest running call is the\n // one worth naming; the rest are a count, because a second endpoint and its\n // parameters do not fit a line beside the first.\n const alsoRunning = running.length - (running[0] === head ? 1 : 0);\n const suffix = alsoRunning > 0 ? ` · +${alsoRunning} more` : '';\n return bounded(`${line(head, now)}${suffix}`, columns);\n}\n\n/** What the footer says when this session has nothing running or just finished.\n * It is the visible proof that the router is on, so it is never blank. */\nconst READY = 'x402 · ready';\n\n/**\n * How long this state holds the line. A lookup in flight holds it until it\n * lands, because a provider call can take a minute; everything else holds it\n * for {@link RECENT_MS}, which is how the demo reads: one state per second or\n * so, each one still there when the next arrives.\n */\nfunction holdMs(row: SavedProgress): number {\n return row.phase !== 'done' && row.operation === 'request' ? STALE_AFTER_MS : RECENT_MS;\n}\n\n/**\n * One call, as the footer says it: `x402 · <tool>: <state> <label or host/path>\n * · <parameters> · <price>`. Every field is sanitized AGAIN here, because what is\n * on disk is input to this process even when this process wrote it.\n */\nfunction line(row: SavedProgress, now: number): string {\n const operation = sanitize(row.operation, 24) || 'request';\n if (row.phase !== 'done' && now - row.at > STALE_AFTER_MS) {\n return `x402 · ${operation}: stale, no outcome recorded`;\n }\n // `selecting service` is the demo's own word for a decision in flight, and a\n // stage the hook names for itself wins over it.\n const state =\n row.phase === 'routing'\n ? sanitize(row.outcome ?? 'selecting service', 40)\n : row.phase === 'calling'\n ? 'calling'\n : sanitize(row.outcome ?? 'done', 40);\n return (\n `x402 · ${operation}: ${state}` +\n // The service's name where its decision gave one, else the URL called.\n (row.label !== undefined\n ? ` ${sanitize(row.label, 32)}`\n : row.endpoint !== undefined\n ? ` ${sanitize(row.endpoint, 110)}`\n : '') +\n (row.parameters !== undefined ? ` · ${sanitize(row.parameters, 180)}` : '') +\n (row.price !== undefined ? ` · ${sanitize(row.price, 24)}` : '')\n );\n}\n\n/** Whether it landed. Every caller but the note record ignores the answer. */\nasync function write(path: string, body: Stamp | SavedProgress | SavedNote): Promise<boolean> {\n try {\n await writeFileAtomic(path, JSON.stringify(body), { mode: 0o600, dirMode: 0o700 });\n return true;\n } catch {\n // The footer is the only thing that can be lost here, by design.\n return false;\n }\n}\n\n/** A marker's timestamp, or null for absent, damaged or not ours. */\nasync function readStamp(path: string): Promise<Stamp | null> {\n return stampOf(await readJson(path));\n}\n\nfunction stampOf(row: Record<string, unknown> | null): Stamp | null {\n if (row === null) return null;\n return row.version === 1 && typeof row.at === 'number' && Number.isFinite(row.at)\n ? { version: 1, at: row.at }\n : null;\n}\n\n/** A call record, or null. Every field is re-checked: what is on disk is input. */\nasync function readCall(path: string): Promise<SavedProgress | null> {\n const row = await readJson(path);\n const stamp = stampOf(row);\n if (row === null || stamp === null || typeof row.operation !== 'string') return null;\n if (!['routing', 'calling', 'done'].includes(row.phase as string)) return null;\n const optional = ['outcome', 'endpoint', 'label', 'parameters', 'price'] as const;\n if (!optional.every((key) => row[key] === undefined || typeof row[key] === 'string')) return null;\n return {\n ...stamp,\n phase: row.phase as ProgressPhase,\n operation: row.operation,\n ...Object.fromEntries(\n optional.filter((key) => row[key] !== undefined).map((key) => [key, row[key]]),\n ),\n };\n}\n\n/**\n * One bounded JSON object, or null. `O_NOFOLLOW` because these files live under\n * a directory the user can write: a symlink planted here must not turn a footer\n * read into a read of something else.\n */\nasync function readJson(path: string): Promise<Record<string, unknown> | null> {\n const file = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW).catch(() => undefined);\n if (file === undefined) return null;\n try {\n if ((await file.stat()).size > MAX_RECORD_BYTES) return null;\n const buffer = Buffer.alloc(MAX_RECORD_BYTES + 1);\n const { bytesRead } = await file.read(buffer, 0, buffer.length, 0);\n if (bytesRead > MAX_RECORD_BYTES) return null;\n const parsed: unknown = JSON.parse(buffer.subarray(0, bytesRead).toString('utf8'));\n return parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)\n ? null\n : (parsed as Record<string, unknown>);\n } catch {\n return null;\n } finally {\n await file.close().catch(() => undefined);\n }\n}\n"],"mappings":";;;;;;;AAAA,SAAS,YAAY,kBAAkB;AAC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