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,1050 @@
|
|
|
1
|
+
import { createRequire as __tenjinCreateRequire } from 'node:module'; const require = __tenjinCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
MAX_CALL_WAIT_MS,
|
|
4
|
+
costLines,
|
|
5
|
+
deliverResult,
|
|
6
|
+
endAccountJob,
|
|
7
|
+
fail,
|
|
8
|
+
keepAccountJob,
|
|
9
|
+
mergedInput,
|
|
10
|
+
paidRecord,
|
|
11
|
+
readAccountJob,
|
|
12
|
+
reportOutcome,
|
|
13
|
+
runSpec,
|
|
14
|
+
settingsFail,
|
|
15
|
+
showSpec,
|
|
16
|
+
specInputProblems,
|
|
17
|
+
specText,
|
|
18
|
+
unsavedWords
|
|
19
|
+
} from "./chunk-5HN4KVQU.js";
|
|
20
|
+
import {
|
|
21
|
+
AccountBadInput,
|
|
22
|
+
AccountLimited,
|
|
23
|
+
AccountRefusal,
|
|
24
|
+
AccountRefused,
|
|
25
|
+
accountCredential,
|
|
26
|
+
openAccountSession,
|
|
27
|
+
said
|
|
28
|
+
} from "./chunk-VHXCPXUS.js";
|
|
29
|
+
import {
|
|
30
|
+
readVaultHeader
|
|
31
|
+
} from "./chunk-XSCGUO2U.js";
|
|
32
|
+
import {
|
|
33
|
+
maskDeep,
|
|
34
|
+
recordAccountRow
|
|
35
|
+
} from "./chunk-MAHNZA6C.js";
|
|
36
|
+
import {
|
|
37
|
+
UNREADABLE,
|
|
38
|
+
claimSpecPayment,
|
|
39
|
+
hashRefusal,
|
|
40
|
+
rulesNow,
|
|
41
|
+
settleAccountRun,
|
|
42
|
+
storeAccountOffer,
|
|
43
|
+
storeSpecs
|
|
44
|
+
} from "./chunk-HKGUKAQW.js";
|
|
45
|
+
import {
|
|
46
|
+
validateResultBody
|
|
47
|
+
} from "./chunk-R4KDH477.js";
|
|
48
|
+
import {
|
|
49
|
+
defaultExecFor
|
|
50
|
+
} from "./chunk-XRGFH7FI.js";
|
|
51
|
+
import {
|
|
52
|
+
toMoney
|
|
53
|
+
} from "./chunk-MEZJ3I63.js";
|
|
54
|
+
import {
|
|
55
|
+
openLookupFooter
|
|
56
|
+
} from "./chunk-2U7H35IP.js";
|
|
57
|
+
import {
|
|
58
|
+
accountLacks,
|
|
59
|
+
personalSettingsAt
|
|
60
|
+
} from "./chunk-W2GXIARJ.js";
|
|
61
|
+
import {
|
|
62
|
+
savedAccount
|
|
63
|
+
} from "./chunk-TFT2X7SH.js";
|
|
64
|
+
import {
|
|
65
|
+
sourceVaultPath
|
|
66
|
+
} from "./chunk-JTX3BUDK.js";
|
|
67
|
+
import {
|
|
68
|
+
INPUT_PLACEHOLDER,
|
|
69
|
+
RESULT_PLACEHOLDER,
|
|
70
|
+
isAccountSpec,
|
|
71
|
+
requestRefused
|
|
72
|
+
} from "./chunk-ZEYA2WWX.js";
|
|
73
|
+
|
|
74
|
+
// src/router/accounts/call.ts
|
|
75
|
+
import { existsSync } from "node:fs";
|
|
76
|
+
var DROP = /* @__PURE__ */ Symbol("drop");
|
|
77
|
+
var Missing = class {
|
|
78
|
+
constructor(path) {
|
|
79
|
+
this.path = path;
|
|
80
|
+
}
|
|
81
|
+
path;
|
|
82
|
+
};
|
|
83
|
+
function valueAt(value, path) {
|
|
84
|
+
let at = value;
|
|
85
|
+
for (const name of path.split(".")) {
|
|
86
|
+
if (at === null || typeof at !== "object" || Array.isArray(at)) return void 0;
|
|
87
|
+
if (!Object.hasOwn(at, name)) return void 0;
|
|
88
|
+
at = at[name];
|
|
89
|
+
}
|
|
90
|
+
return at;
|
|
91
|
+
}
|
|
92
|
+
function inState(value, state) {
|
|
93
|
+
const at = valueAt(value, state.path);
|
|
94
|
+
const text = typeof at === "string" ? at : typeof at === "number" || typeof at === "boolean" ? String(at) : void 0;
|
|
95
|
+
return text !== void 0 && state.values.includes(text);
|
|
96
|
+
}
|
|
97
|
+
function fillValue(template, input, first) {
|
|
98
|
+
if (typeof template === "string") {
|
|
99
|
+
const field = INPUT_PLACEHOLDER.exec(template)?.[1];
|
|
100
|
+
if (field !== void 0) return Object.hasOwn(input, field) ? input[field] : DROP;
|
|
101
|
+
const path = RESULT_PLACEHOLDER.exec(template)?.[1];
|
|
102
|
+
if (path !== void 0) {
|
|
103
|
+
const found = first === void 0 ? void 0 : valueAt(first, path);
|
|
104
|
+
if (found === void 0) throw new Missing(path);
|
|
105
|
+
return found;
|
|
106
|
+
}
|
|
107
|
+
return template;
|
|
108
|
+
}
|
|
109
|
+
if (Array.isArray(template))
|
|
110
|
+
return template.map((item) => fillValue(item, input, first)).filter((item) => item !== DROP);
|
|
111
|
+
if (template !== null && typeof template === "object") {
|
|
112
|
+
const out = {};
|
|
113
|
+
for (const [key, item] of Object.entries(template)) {
|
|
114
|
+
const filled = fillValue(item, input, first);
|
|
115
|
+
if (filled !== DROP) out[key] = filled;
|
|
116
|
+
}
|
|
117
|
+
return out;
|
|
118
|
+
}
|
|
119
|
+
return template;
|
|
120
|
+
}
|
|
121
|
+
function fillArgs(template, input, first) {
|
|
122
|
+
try {
|
|
123
|
+
return { value: fillValue(template, input, first) };
|
|
124
|
+
} catch (err) {
|
|
125
|
+
if (err instanceof Missing) return { missing: err.path };
|
|
126
|
+
throw err;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
var textItems = (content) => (content ?? []).flatMap((item) => {
|
|
130
|
+
const entry = item;
|
|
131
|
+
return entry?.type === "text" && typeof entry.text === "string" ? [entry.text] : [];
|
|
132
|
+
});
|
|
133
|
+
var contentLines = (content) => (content ?? []).flatMap((item) => {
|
|
134
|
+
const entry = item;
|
|
135
|
+
if (entry?.type === "text" && typeof entry.text === "string") return [entry.text];
|
|
136
|
+
if (entry?.type === "resource" && typeof entry.resource?.text === "string")
|
|
137
|
+
return [entry.resource.text];
|
|
138
|
+
if (entry?.type === "resource_link" && typeof entry.uri === "string")
|
|
139
|
+
return [typeof entry.name === "string" ? `${entry.name}: ${entry.uri}` : entry.uri];
|
|
140
|
+
return [];
|
|
141
|
+
});
|
|
142
|
+
function readResult(result, mode) {
|
|
143
|
+
if (mode === "structured") {
|
|
144
|
+
const value2 = result.structuredContent;
|
|
145
|
+
if (value2 === void 0) return { problem: "its answer had no structured result" };
|
|
146
|
+
return { value: value2, text: JSON.stringify(value2), media: [] };
|
|
147
|
+
}
|
|
148
|
+
if (mode === "json-text") {
|
|
149
|
+
const text2 = textItems(result.content).join("");
|
|
150
|
+
try {
|
|
151
|
+
const value2 = JSON.parse(text2);
|
|
152
|
+
return { value: value2, text: JSON.stringify(value2), media: [] };
|
|
153
|
+
} catch {
|
|
154
|
+
return { problem: "its answer was not the JSON its map expects" };
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const media = [];
|
|
158
|
+
for (const item of result.content ?? []) {
|
|
159
|
+
const entry = item;
|
|
160
|
+
if ((entry?.type === "image" || entry?.type === "audio") && typeof entry.data === "string" && typeof entry.mimeType === "string") {
|
|
161
|
+
media.push({ bytes: Buffer.from(entry.data, "base64"), contentType: entry.mimeType });
|
|
162
|
+
}
|
|
163
|
+
if (entry?.type === "resource" && typeof entry.resource?.blob === "string" && typeof entry.resource.mimeType === "string") {
|
|
164
|
+
media.push({
|
|
165
|
+
bytes: Buffer.from(entry.resource.blob, "base64"),
|
|
166
|
+
contentType: entry.resource.mimeType
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
const text = contentLines(result.content).join("\n");
|
|
171
|
+
let value = text;
|
|
172
|
+
try {
|
|
173
|
+
value = JSON.parse(text);
|
|
174
|
+
} catch {
|
|
175
|
+
}
|
|
176
|
+
return { value, text, media };
|
|
177
|
+
}
|
|
178
|
+
function readNamedResult(result) {
|
|
179
|
+
const content = readResult(result, "content");
|
|
180
|
+
const value = result.structuredContent;
|
|
181
|
+
if (value === void 0 || "problem" in content) return content;
|
|
182
|
+
return { value, text: JSON.stringify(value), media: content.media };
|
|
183
|
+
}
|
|
184
|
+
function errorText(result) {
|
|
185
|
+
return textItems(result.content).join(" ").replace(/\s+/g, " ").trim().slice(0, 300);
|
|
186
|
+
}
|
|
187
|
+
function refusalIn(text) {
|
|
188
|
+
if (/\b(unauthori[sz]ed|unauthenticated|invalid (api )?(key|token)|token (has )?expired|expired token|not authenticated|forbidden)\b/i.test(
|
|
189
|
+
text
|
|
190
|
+
))
|
|
191
|
+
return "signin_expired";
|
|
192
|
+
if (/\b(rate[ -]?limit(ed)?|too many requests)\b/i.test(text)) return "rate_limited";
|
|
193
|
+
if (/\b(insufficient (credits?|funds|balance)|out of credits?|no credits?|credits? (are |is )?(used up|exhausted|depleted)|quota|payment required|usage limit|plan limit|monthly limit|upgrade your (plan|subscription)|exceeded (your|the) .{0,30}limit)\b/i.test(
|
|
194
|
+
text
|
|
195
|
+
))
|
|
196
|
+
return "credit";
|
|
197
|
+
return void 0;
|
|
198
|
+
}
|
|
199
|
+
var CALL_TIMEOUT_MS = 12e4;
|
|
200
|
+
var SAID_CHARS = 300;
|
|
201
|
+
var Connection = class {
|
|
202
|
+
constructor(account, deps) {
|
|
203
|
+
this.account = account;
|
|
204
|
+
this.deps = deps;
|
|
205
|
+
}
|
|
206
|
+
account;
|
|
207
|
+
deps;
|
|
208
|
+
#session;
|
|
209
|
+
#credential;
|
|
210
|
+
#retried = false;
|
|
211
|
+
/** The account this connection is for. */
|
|
212
|
+
get accountId() {
|
|
213
|
+
return this.account.id;
|
|
214
|
+
}
|
|
215
|
+
async open() {
|
|
216
|
+
for (; ; ) {
|
|
217
|
+
try {
|
|
218
|
+
if (this.#session !== void 0) return this.#session;
|
|
219
|
+
this.#credential ??= await accountCredential(
|
|
220
|
+
this.account.id,
|
|
221
|
+
this.account.label,
|
|
222
|
+
this.deps
|
|
223
|
+
);
|
|
224
|
+
this.#session = await (this.deps.openSession ?? openAccountSession)(
|
|
225
|
+
this.#credential.mcpUrl,
|
|
226
|
+
this.#credential.headers,
|
|
227
|
+
{
|
|
228
|
+
...this.deps.fetchImpl !== void 0 ? { fetchImpl: this.deps.fetchImpl } : {},
|
|
229
|
+
...this.#credential.typed === true ? { typed: true } : {},
|
|
230
|
+
timeoutMs: this.deps.callTimeoutMs ?? CALL_TIMEOUT_MS
|
|
231
|
+
}
|
|
232
|
+
);
|
|
233
|
+
return this.#session;
|
|
234
|
+
} catch (err) {
|
|
235
|
+
await this.#retry(err);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
async call(tool, args) {
|
|
240
|
+
for (; ; ) {
|
|
241
|
+
const session = await this.open();
|
|
242
|
+
try {
|
|
243
|
+
return await session.callTool(tool, args, {
|
|
244
|
+
timeoutMs: this.deps.callTimeoutMs ?? CALL_TIMEOUT_MS
|
|
245
|
+
});
|
|
246
|
+
} catch (err) {
|
|
247
|
+
await this.#retry(err);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
async list() {
|
|
252
|
+
for (; ; ) {
|
|
253
|
+
const session = await this.open();
|
|
254
|
+
try {
|
|
255
|
+
return await session.listTools();
|
|
256
|
+
} catch (err) {
|
|
257
|
+
await this.#retry(err);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
/** A refused credential once more, fresh; anything else is the caller's. */
|
|
262
|
+
async #retry(err) {
|
|
263
|
+
if (err instanceof AccountRefused) {
|
|
264
|
+
await this.close();
|
|
265
|
+
if (this.#retried) throw new AccountRefusal("signin_expired");
|
|
266
|
+
this.#retried = true;
|
|
267
|
+
this.#credential = await accountCredential(this.account.id, this.account.label, this.deps, {
|
|
268
|
+
...this.#credential !== void 0 ? { refused: this.#credential.sent } : {}
|
|
269
|
+
});
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
if (err instanceof AccountLimited)
|
|
273
|
+
throw new AccountRefusal(err.status === 429 ? "rate_limited" : "credit");
|
|
274
|
+
throw err;
|
|
275
|
+
}
|
|
276
|
+
async close() {
|
|
277
|
+
const session = this.#session;
|
|
278
|
+
this.#session = void 0;
|
|
279
|
+
await session?.close().catch(() => void 0);
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
async function listAccountTools(account, deps) {
|
|
283
|
+
const connection2 = new Connection(account, deps);
|
|
284
|
+
try {
|
|
285
|
+
return { tools: await connection2.list() };
|
|
286
|
+
} catch (err) {
|
|
287
|
+
return refusedBy(err, false);
|
|
288
|
+
} finally {
|
|
289
|
+
await connection2.close();
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
function refusedBy(err, sent) {
|
|
293
|
+
if (err instanceof AccountRefusal)
|
|
294
|
+
return {
|
|
295
|
+
kind: "refused",
|
|
296
|
+
reason: err.reason,
|
|
297
|
+
...err.detail !== void 0 ? { detail: err.detail } : {},
|
|
298
|
+
sent
|
|
299
|
+
};
|
|
300
|
+
return { kind: "refused", reason: "unreachable", detail: said(err, SAID_CHARS), sent };
|
|
301
|
+
}
|
|
302
|
+
async function runAccountCall(account, call, input, deps, resume, opts = {}) {
|
|
303
|
+
const now = () => deps.now?.() ?? Date.now();
|
|
304
|
+
const connection2 = new Connection(account, deps);
|
|
305
|
+
const { next } = call;
|
|
306
|
+
try {
|
|
307
|
+
let first;
|
|
308
|
+
let firstAt;
|
|
309
|
+
if (resume !== void 0) {
|
|
310
|
+
if (next === void 0)
|
|
311
|
+
return { kind: "failed", why: "its map has no follow-up to finish it" };
|
|
312
|
+
({ first, firstAt } = resume);
|
|
313
|
+
} else {
|
|
314
|
+
const args = opts.literal === true ? { value: call.args } : fillArgs(call.args, input);
|
|
315
|
+
if ("missing" in args)
|
|
316
|
+
return { kind: "failed", why: "its map reads a result before there is one" };
|
|
317
|
+
try {
|
|
318
|
+
await connection2.open();
|
|
319
|
+
} catch (err) {
|
|
320
|
+
return refusedBy(err, false);
|
|
321
|
+
}
|
|
322
|
+
firstAt = now();
|
|
323
|
+
let result;
|
|
324
|
+
try {
|
|
325
|
+
result = await connection2.call(call.tool, args.value);
|
|
326
|
+
} catch (err) {
|
|
327
|
+
if (err instanceof AccountRefusal) return refusedBy(err, true);
|
|
328
|
+
if (err instanceof AccountBadInput) return { kind: "input", detail: said(err, SAID_CHARS) };
|
|
329
|
+
return {
|
|
330
|
+
kind: "failed",
|
|
331
|
+
why: "Tenjin couldn't tell whether it ran",
|
|
332
|
+
detail: said(err, SAID_CHARS)
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
if (result.isError === true) {
|
|
336
|
+
const detail = errorText(result);
|
|
337
|
+
const reason = refusalIn(detail);
|
|
338
|
+
return { kind: "declined", detail, ...reason !== void 0 ? { reason } : {} };
|
|
339
|
+
}
|
|
340
|
+
const read = opts.literal === true ? readNamedResult(result) : readResult(result, call.result);
|
|
341
|
+
if ("problem" in read) return { kind: "failed", why: read.problem };
|
|
342
|
+
if (next === void 0 || next.when !== void 0 && !inState(read.value, next.when))
|
|
343
|
+
return { kind: "done", ...read };
|
|
344
|
+
first = read.value;
|
|
345
|
+
await deps.onStarted?.({ first, firstAt });
|
|
346
|
+
}
|
|
347
|
+
return await followUp(connection2, next, input, first, firstAt, deps);
|
|
348
|
+
} finally {
|
|
349
|
+
await connection2.close();
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
async function followUp(connection2, next, input, first, firstAt, deps) {
|
|
353
|
+
const now = () => deps.now?.() ?? Date.now();
|
|
354
|
+
const sleep = deps.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
355
|
+
const running = (stopped2, opts = {}) => ({
|
|
356
|
+
kind: "running",
|
|
357
|
+
first,
|
|
358
|
+
firstAt,
|
|
359
|
+
...opts.finished === true ? { finished: true } : {},
|
|
360
|
+
...opts.providerError !== void 0 ? { providerError: opts.providerError } : {},
|
|
361
|
+
...stopped2 !== void 0 ? {
|
|
362
|
+
reason: stopped2.reason,
|
|
363
|
+
...stopped2.detail !== void 0 ? { detail: stopped2.detail } : {}
|
|
364
|
+
} : {}
|
|
365
|
+
});
|
|
366
|
+
const gone = (finished2 = false) => existsSync(sourceVaultPath(connection2.accountId, deps.dataDir)) ? void 0 : running(new AccountRefusal("not_connected"), { finished: finished2 });
|
|
367
|
+
const ask = async (tool, args2, finished2) => {
|
|
368
|
+
let result;
|
|
369
|
+
try {
|
|
370
|
+
result = await connection2.call(tool, args2);
|
|
371
|
+
} catch (err) {
|
|
372
|
+
const stopped2 = err instanceof AccountRefusal ? err : new AccountRefusal("unreachable", said(err, SAID_CHARS));
|
|
373
|
+
return { stop: running(stopped2, { finished: finished2 }) };
|
|
374
|
+
}
|
|
375
|
+
if (result.isError !== true) return { result };
|
|
376
|
+
const text = errorText(result);
|
|
377
|
+
const reason = refusalIn(text);
|
|
378
|
+
return {
|
|
379
|
+
stop: running(reason !== void 0 ? new AccountRefusal(reason) : void 0, {
|
|
380
|
+
finished: finished2,
|
|
381
|
+
providerError: text
|
|
382
|
+
})
|
|
383
|
+
};
|
|
384
|
+
};
|
|
385
|
+
const { poll } = next;
|
|
386
|
+
if (poll !== void 0) {
|
|
387
|
+
const end = firstAt + poll.maxWaitS * 1e3;
|
|
388
|
+
for (let n = 0; ; n += 1) {
|
|
389
|
+
if (n > 0) {
|
|
390
|
+
const at = now() + poll.everyS * 1e3;
|
|
391
|
+
if (at > end || at > deps.deadline) return running();
|
|
392
|
+
await sleep(poll.everyS * 1e3);
|
|
393
|
+
}
|
|
394
|
+
await deps.onPoll?.();
|
|
395
|
+
const stopped2 = gone();
|
|
396
|
+
if (stopped2 !== void 0) return stopped2;
|
|
397
|
+
const args2 = fillArgs(poll.args, input, first);
|
|
398
|
+
if ("missing" in args2)
|
|
399
|
+
return {
|
|
400
|
+
kind: "failed",
|
|
401
|
+
why: `its answer didn't name the job to follow (${args2.missing})`
|
|
402
|
+
};
|
|
403
|
+
const asked2 = await ask(poll.tool, args2.value, false);
|
|
404
|
+
if ("stop" in asked2) return asked2.stop;
|
|
405
|
+
const read2 = readResult(asked2.result, poll.result);
|
|
406
|
+
if ("problem" in read2) return { kind: "failed", why: read2.problem };
|
|
407
|
+
if (poll.failed !== void 0 && inState(read2.value, poll.failed))
|
|
408
|
+
return {
|
|
409
|
+
kind: "failed",
|
|
410
|
+
why: `its job ended as ${String(valueAt(read2.value, poll.failed.path))}`
|
|
411
|
+
};
|
|
412
|
+
if (!inState(read2.value, poll.running)) break;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
const finished = poll !== void 0;
|
|
416
|
+
const stopped = gone(finished);
|
|
417
|
+
if (stopped !== void 0) return stopped;
|
|
418
|
+
const args = fillArgs(next.args, input, first);
|
|
419
|
+
if ("missing" in args)
|
|
420
|
+
return { kind: "failed", why: `its answer didn't name the result to fetch (${args.missing})` };
|
|
421
|
+
const asked = await ask(next.tool, args.value, finished);
|
|
422
|
+
if ("stop" in asked) return asked.stop;
|
|
423
|
+
const read = readResult(asked.result, next.result);
|
|
424
|
+
if ("problem" in read) return { kind: "failed", why: read.problem };
|
|
425
|
+
return { kind: "done", ...read };
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// src/router/accounts/run.ts
|
|
429
|
+
var worded = (said2, step, retryIn) => ({
|
|
430
|
+
said: said2,
|
|
431
|
+
fix: `${step}.`,
|
|
432
|
+
step,
|
|
433
|
+
...retryIn !== void 0 ? { retryIn } : {}
|
|
434
|
+
});
|
|
435
|
+
function refusalWords(reason, account, detail) {
|
|
436
|
+
const { label, id } = account;
|
|
437
|
+
const reconnect = `Reconnect with \`tenjin connect ${id}\``;
|
|
438
|
+
switch (reason) {
|
|
439
|
+
case "signin_expired":
|
|
440
|
+
return worded(`Your ${label} sign-in has expired.`, reconnect);
|
|
441
|
+
case "not_connected":
|
|
442
|
+
return worded(
|
|
443
|
+
`${label} isn't connected on this machine.`,
|
|
444
|
+
`Connect it with \`tenjin connect ${id}\``
|
|
445
|
+
);
|
|
446
|
+
case "store_locked":
|
|
447
|
+
return worded(
|
|
448
|
+
`Tenjin couldn't read your ${label} sign-in: your keychain didn't answer.`,
|
|
449
|
+
"Unlock the keychain, then try again"
|
|
450
|
+
);
|
|
451
|
+
case "credit":
|
|
452
|
+
return worded(
|
|
453
|
+
`Your ${label} account's plan or credit has run out.`,
|
|
454
|
+
`Add credit or change the plan at ${label}`
|
|
455
|
+
);
|
|
456
|
+
case "rate_limited":
|
|
457
|
+
return worded(
|
|
458
|
+
`Your ${label} account is over its rate limit right now.`,
|
|
459
|
+
"Try again in a minute",
|
|
460
|
+
"minute"
|
|
461
|
+
);
|
|
462
|
+
case "busy": {
|
|
463
|
+
const said2 = `Another Tenjin process was refreshing your ${label} sign-in and didn't finish.`;
|
|
464
|
+
return detail !== void 0 ? worded(said2, `Try again; if no other Tenjin process is running, remove ${detail} first`) : worded(said2, "Try again in a moment", "moment");
|
|
465
|
+
}
|
|
466
|
+
case "unreachable":
|
|
467
|
+
return worded(
|
|
468
|
+
`Tenjin couldn't reach your ${label} account.`,
|
|
469
|
+
"Try again in a moment",
|
|
470
|
+
"moment"
|
|
471
|
+
);
|
|
472
|
+
case "missing":
|
|
473
|
+
return worded(
|
|
474
|
+
`This ${label} account doesn't have what this job needs: a tool it calls was missing when it was connected.`,
|
|
475
|
+
`If the account changed since, ${reconnect.toLowerCase()}`
|
|
476
|
+
);
|
|
477
|
+
case "declined":
|
|
478
|
+
return worded(
|
|
479
|
+
`Your ${label} account answered with an error; its answer is in providerError.`,
|
|
480
|
+
"Check the input, or the account itself"
|
|
481
|
+
);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
var SWITCHABLE = /* @__PURE__ */ new Set(["signin_expired", "credit", "rate_limited"]);
|
|
485
|
+
var RAN_NOTHING = /* @__PURE__ */ new Set(["native", "needs_input", "needs_approval"]);
|
|
486
|
+
function ranNothing({ envelope }) {
|
|
487
|
+
return RAN_NOTHING.has(String(envelope.status));
|
|
488
|
+
}
|
|
489
|
+
function accountResult(status, summary, reason, label, extras) {
|
|
490
|
+
const { extra, ran, routed, ...rest } = extras;
|
|
491
|
+
const base = fail(status, reason, rest);
|
|
492
|
+
return {
|
|
493
|
+
...base,
|
|
494
|
+
summary,
|
|
495
|
+
envelope: {
|
|
496
|
+
...base.envelope,
|
|
497
|
+
cost: ran === "maybe" ? [
|
|
498
|
+
routed === true ? `your ${label} plan may have charged for this` : `your ${label} plan may have charged for this, not the Tenjin balance`
|
|
499
|
+
] : routed === true ? costLines(0n) : ["nothing charged"],
|
|
500
|
+
...extra
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
var runsAgain = (label) => `Don't call again for this: it would run on your ${label} account again.`;
|
|
505
|
+
function unsavedAnswer(label, delivered2, why, job) {
|
|
506
|
+
const finished = `Your ${label} account finished it`;
|
|
507
|
+
if (job !== void 0) {
|
|
508
|
+
const words2 = unsavedWords(finished, why, { job: job.id });
|
|
509
|
+
return accountResult("needs_input", words2.summary, words2.summary, label, {
|
|
510
|
+
nextStep: words2.nextStep,
|
|
511
|
+
parameters: job.parameters,
|
|
512
|
+
ran: "maybe",
|
|
513
|
+
extra: { status: "running", job: job.id }
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
const words = unsavedWords(finished, why, {
|
|
517
|
+
otherwise: `Tell the user why it was not saved. ${runsAgain(label)}`
|
|
518
|
+
});
|
|
519
|
+
return {
|
|
520
|
+
...delivered2,
|
|
521
|
+
summary: `${delivered2.summary}
|
|
522
|
+
${words.summary}`,
|
|
523
|
+
envelope: { ...delivered2.envelope, note: words.said, nextStep: words.nextStep }
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
function offerWords(offer) {
|
|
527
|
+
const price = offer.priceVaries ? `up to $${toMoney(offer.maxAmountAtomic).usd}` : `$${toMoney(offer.priceAtomic).usd}`;
|
|
528
|
+
const name = offer.label ?? offer.provider;
|
|
529
|
+
const id = JSON.stringify(offer.id);
|
|
530
|
+
return {
|
|
531
|
+
said: `Tenjin has ${name} for ${price}: request({id: ${id}, input}) to run it.`,
|
|
532
|
+
next: `If the user picks Tenjin's tool, call request({id: ${id}, input: {...}}) with the inputs above.`,
|
|
533
|
+
spec: specText(offer.id, offer),
|
|
534
|
+
envelope: { offer: { id: offer.id, label: name, price } }
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
function fittedInput(input, offer) {
|
|
538
|
+
const properties = offer.input.properties;
|
|
539
|
+
if (properties === null || typeof properties !== "object") return void 0;
|
|
540
|
+
const kept = Object.fromEntries(
|
|
541
|
+
Object.entries(input).filter(([name]) => Object.hasOwn(properties, name))
|
|
542
|
+
);
|
|
543
|
+
const problems = specInputProblems(offer, mergedInput(offer, kept));
|
|
544
|
+
return problems !== void 0 && problems.length === 0 ? kept : void 0;
|
|
545
|
+
}
|
|
546
|
+
async function reask(refused, deps, routing) {
|
|
547
|
+
const { dataDir } = deps.ctx;
|
|
548
|
+
const here = await personalSettingsAt(dataDir).catch(() => void 0);
|
|
549
|
+
if (here?.wire.status !== "ok") return { offer: null, routed: false };
|
|
550
|
+
const route = deps.route?.(routing.baseUrl);
|
|
551
|
+
const answer = await requestRefused(refused, {
|
|
552
|
+
ctx: deps.ctx,
|
|
553
|
+
baseUrl: routing.baseUrl,
|
|
554
|
+
acceptsBazaar: routing.acceptsBazaar === true,
|
|
555
|
+
harness: routing.harness ?? "claude",
|
|
556
|
+
settings: here.wire.settings,
|
|
557
|
+
...routing.fetchImpl !== void 0 ? { fetchImpl: routing.fetchImpl } : {},
|
|
558
|
+
...route !== void 0 ? { route } : {}
|
|
559
|
+
}).catch(() => null);
|
|
560
|
+
const routed = answer?.status !== "skipped";
|
|
561
|
+
if (answer?.status !== "decided") return { offer: null, routed };
|
|
562
|
+
const { decision, settingsHash } = answer.decision;
|
|
563
|
+
if (decision.action !== "spec" || isAccountSpec(decision.spec)) return { offer: null, routed };
|
|
564
|
+
const offer = { ...decision.spec, id: decision.id };
|
|
565
|
+
await storeSpecs(dataDir, [offer], settingsHash, { replaces: refused });
|
|
566
|
+
return { offer: { ...offer, ...settingsHash !== void 0 ? { settingsHash } : {} }, routed };
|
|
567
|
+
}
|
|
568
|
+
async function runInPlaceOf(refused, id, run, dataDir) {
|
|
569
|
+
const held = await claimSpecPayment(dataDir, refused) === null;
|
|
570
|
+
let result;
|
|
571
|
+
try {
|
|
572
|
+
result = await run();
|
|
573
|
+
} catch (err) {
|
|
574
|
+
if (held) await settleAccountRun(dataDir, refused, false);
|
|
575
|
+
throw err;
|
|
576
|
+
}
|
|
577
|
+
if (held) await settleAccountRun(dataDir, refused, ranNothing(result) ? false : { to: id });
|
|
578
|
+
return result;
|
|
579
|
+
}
|
|
580
|
+
function runDeps(deps) {
|
|
581
|
+
const now = deps.now ?? Date.now;
|
|
582
|
+
const started = deps.startedAt ?? now();
|
|
583
|
+
const seams = deps.accounts ?? {};
|
|
584
|
+
return {
|
|
585
|
+
dataDir: deps.ctx.dataDir,
|
|
586
|
+
exec: seams.exec ?? defaultExecFor(),
|
|
587
|
+
...seams.platform !== void 0 ? { platform: seams.platform } : {},
|
|
588
|
+
...seams.openSession !== void 0 ? { openSession: seams.openSession } : {},
|
|
589
|
+
...seams.lockTimeoutMs !== void 0 ? { lockTimeoutMs: seams.lockTimeoutMs } : {},
|
|
590
|
+
...deps.fetchImpl !== void 0 ? { fetchImpl: deps.fetchImpl } : {},
|
|
591
|
+
...deps.now !== void 0 ? { now: deps.now } : {},
|
|
592
|
+
...deps.sleep !== void 0 ? { sleep: deps.sleep } : {},
|
|
593
|
+
...deps.onPoll !== void 0 ? { onPoll: deps.onPoll } : {},
|
|
594
|
+
// A host that waits for jobs waits for the map's own bound; any other
|
|
595
|
+
// gets this call's, and a resume for the rest.
|
|
596
|
+
deadline: deps.waitsForJobs === true ? Number.POSITIVE_INFINITY : started + MAX_CALL_WAIT_MS
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
async function accountOf(spec, dataDir) {
|
|
600
|
+
const id = spec.source;
|
|
601
|
+
const saved = await savedAccount(dataDir, id);
|
|
602
|
+
const header = await readVaultHeader(dataDir, id).catch(() => null);
|
|
603
|
+
return {
|
|
604
|
+
id,
|
|
605
|
+
label: saved?.label ?? spec.provider,
|
|
606
|
+
...header !== null ? { mcpUrl: header.mcpUrl } : {},
|
|
607
|
+
saved: saved !== void 0
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
var UNCONFIRMED = {
|
|
611
|
+
code: "settings_unconfirmed",
|
|
612
|
+
reason: "Tenjin's router did not confirm it applied your Tenjin settings to this offer on your own account, so it was not run and nothing was sent.",
|
|
613
|
+
nextStep: "Call request again with the query (request({query})) for an offer under the current settings."
|
|
614
|
+
};
|
|
615
|
+
async function accountCheck(spec, account, dataDir) {
|
|
616
|
+
const now = await rulesNow(dataDir);
|
|
617
|
+
if ("problem" in now) return { settings: UNREADABLE };
|
|
618
|
+
const stale = hashRefusal(now.wire, spec.settingsHash);
|
|
619
|
+
if (stale !== null) return { settings: stale };
|
|
620
|
+
if (spec.settingsHash === void 0) return { settings: UNCONFIRMED };
|
|
621
|
+
return connection(spec, account, now.wire);
|
|
622
|
+
}
|
|
623
|
+
function connection(spec, account, wire) {
|
|
624
|
+
if (!account.saved || account.mcpUrl === void 0) return { reason: "not_connected" };
|
|
625
|
+
if (!wire.settings.sources.includes(spec.source)) return { reason: "not_connected" };
|
|
626
|
+
return null;
|
|
627
|
+
}
|
|
628
|
+
async function showAccountSpec(id, spec, dataDir, hint) {
|
|
629
|
+
const { label } = await accountOf(spec, dataDir);
|
|
630
|
+
const lines = [specText(id, spec, label)];
|
|
631
|
+
if (hint !== void 0) lines.push(`Next: ${hint}`);
|
|
632
|
+
return {
|
|
633
|
+
isError: false,
|
|
634
|
+
summary: lines.join("\n"),
|
|
635
|
+
envelope: {
|
|
636
|
+
status: "spec",
|
|
637
|
+
id,
|
|
638
|
+
nextStep: hint ?? `Call request({id: ${JSON.stringify(id)}, input: {...}}) with the inputs above.`,
|
|
639
|
+
cost: ["nothing charged"]
|
|
640
|
+
}
|
|
641
|
+
};
|
|
642
|
+
}
|
|
643
|
+
async function offerAccountLead(lead, settingsHash, deps, routing, hint) {
|
|
644
|
+
const { dataDir } = deps.ctx;
|
|
645
|
+
if (!await accountLacks(dataDir, lead)) {
|
|
646
|
+
await storeAccountOffer(dataDir, lead, settingsHash);
|
|
647
|
+
return showAccountSpec(lead.id, lead, dataDir, hint);
|
|
648
|
+
}
|
|
649
|
+
const account = await accountOf(lead, dataDir);
|
|
650
|
+
const words = refusalWords("missing", account, void 0);
|
|
651
|
+
const { offer, routed } = await reask(lead.id, deps, routing);
|
|
652
|
+
if (offer === null) {
|
|
653
|
+
const reason = `${words.said} Nothing was sent.`;
|
|
654
|
+
return accountResult("native", reason, reason, account.label, {
|
|
655
|
+
nextStep: `Continue with your own tools. ${words.fix}`,
|
|
656
|
+
routed
|
|
657
|
+
});
|
|
658
|
+
}
|
|
659
|
+
const shown = showSpec(offer.id, offer);
|
|
660
|
+
const note = `${words.said} Tenjin's own tool for this task is below, paid from the Tenjin balance.`;
|
|
661
|
+
return { ...shown, summary: `${note}
|
|
662
|
+
${shown.summary}`, envelope: { ...shown.envelope, note } };
|
|
663
|
+
}
|
|
664
|
+
var report = (at, outcome) => reportOutcome(
|
|
665
|
+
at.reportDeps,
|
|
666
|
+
at.id,
|
|
667
|
+
at.deps.via !== void 0 ? { ...outcome, via: at.deps.via } : outcome,
|
|
668
|
+
at.startedAt
|
|
669
|
+
);
|
|
670
|
+
var shownOf = (at) => ({
|
|
671
|
+
provider: at.account.label,
|
|
672
|
+
...at.spec.label !== void 0 ? { label: at.spec.label } : {},
|
|
673
|
+
parameters: at.sentInput
|
|
674
|
+
});
|
|
675
|
+
async function refusedBySettings(at, refusal2) {
|
|
676
|
+
report(at, { status: "unpaid", reason: "terms" });
|
|
677
|
+
await at.footer.done("needs_input");
|
|
678
|
+
return settingsFail(refusal2);
|
|
679
|
+
}
|
|
680
|
+
async function runAccountSpec(id, spec, input, deps, footer, reportDeps) {
|
|
681
|
+
const { dataDir } = deps.ctx;
|
|
682
|
+
const merged = mergedInput(spec, input);
|
|
683
|
+
const at = {
|
|
684
|
+
id,
|
|
685
|
+
spec,
|
|
686
|
+
account: await accountOf(spec, dataDir),
|
|
687
|
+
input,
|
|
688
|
+
merged,
|
|
689
|
+
sentInput: maskDeep(merged),
|
|
690
|
+
deps,
|
|
691
|
+
footer,
|
|
692
|
+
reportDeps,
|
|
693
|
+
startedAt: Date.now()
|
|
694
|
+
};
|
|
695
|
+
const { account, sentInput } = at;
|
|
696
|
+
const problems = specInputProblems(spec, merged);
|
|
697
|
+
if (problems === void 0) {
|
|
698
|
+
report(at, { status: "unpaid", reason: "terms" });
|
|
699
|
+
await footer.done("failed");
|
|
700
|
+
const reason = `The spec for ${spec.provider} has an input schema this build cannot check, so nothing was sent to your ${account.label} account.`;
|
|
701
|
+
return accountResult("failed", reason, reason, account.label, {
|
|
702
|
+
nextStep: "Continue with your own tools.",
|
|
703
|
+
parameters: sentInput
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
if (problems.length > 0) {
|
|
707
|
+
report(at, { status: "unpaid", reason: "input" });
|
|
708
|
+
await footer.done("needs_input");
|
|
709
|
+
const reason = `The input does not fit ${spec.provider}: ${problems.join("; ")}.`;
|
|
710
|
+
return accountResult(
|
|
711
|
+
"needs_input",
|
|
712
|
+
`More input needed: ${reason}
|
|
713
|
+
|
|
714
|
+
${specText(id, spec, account.label)}`,
|
|
715
|
+
reason,
|
|
716
|
+
account.label,
|
|
717
|
+
{
|
|
718
|
+
nextStep: `Fix the input from the spec above and call request({id: ${JSON.stringify(id)}, input: {...}}) again; nothing was sent.`,
|
|
719
|
+
parameters: sentInput
|
|
720
|
+
}
|
|
721
|
+
);
|
|
722
|
+
}
|
|
723
|
+
const checked = await accountCheck(spec, account, dataDir);
|
|
724
|
+
if (checked !== null && "settings" in checked) return refusedBySettings(at, checked.settings);
|
|
725
|
+
if (checked !== null) return refusal(at, checked.reason, false);
|
|
726
|
+
if (await accountLacks(dataDir, spec)) return refusal(at, "missing", false);
|
|
727
|
+
const earlier = await claimSpecPayment(dataDir, id);
|
|
728
|
+
if (earlier !== null) {
|
|
729
|
+
await footer.done("needs_input");
|
|
730
|
+
const job = await readAccountJob(dataDir, id);
|
|
731
|
+
const reason = job !== null ? `This offer already went to your ${account.label} account, and its job is kept on this machine, so nothing was sent again.` : earlier.state === "account" ? `This offer was already sent to your ${account.label} account at ${earlier.at}, so nothing was sent again. Its answer is in the earlier request result for this id.` : earlier.state === "switched" ? `Tenjin's own tool already ran this job at ${earlier.at}, in your ${account.label} account's place, so nothing was sent to the account. Its answer is in the earlier request result for this id.` : earlier.state === "unrecorded" ? `This machine could not record this call, so nothing was sent to your ${account.label} account.` : "A call for this offer already started, so nothing was sent again. Use that call's result.";
|
|
732
|
+
const again = `For another call, send request({query}) for a new offer; this id (${id}) runs once.`;
|
|
733
|
+
return accountResult("needs_input", reason, reason, account.label, {
|
|
734
|
+
nextStep: job !== null ? `Call request({job: ${JSON.stringify(id)}}) for its result; nothing is sent to the account again.` : earlier.state === "switched" ? `If Tenjin's tool was still running, call request({job: ${JSON.stringify(earlier.to)}}) for its result. ${again}` : again
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
at.claimed = true;
|
|
738
|
+
const boundary = await accountCheck(spec, account, dataDir);
|
|
739
|
+
if (boundary !== null) {
|
|
740
|
+
await settleAccountRun(dataDir, id, false);
|
|
741
|
+
at.claimed = false;
|
|
742
|
+
if ("settings" in boundary) return refusedBySettings(at, boundary.settings);
|
|
743
|
+
return refusal(at, boundary.reason, false);
|
|
744
|
+
}
|
|
745
|
+
await footer.calling(shownOf(at));
|
|
746
|
+
const run = await runAccountCall({ id: account.id, label: account.label }, spec.mcp, merged, {
|
|
747
|
+
...runDeps(deps),
|
|
748
|
+
// THE JOB IS KEPT AS SOON AS IT STARTED, with its ledger row: a process
|
|
749
|
+
// that exits mid-poll leaves a job `request({job})` picks up, never a
|
|
750
|
+
// paid result nobody can reach.
|
|
751
|
+
onStarted: async (started) => {
|
|
752
|
+
await keepJob(at, started);
|
|
753
|
+
await keepAccountRow(at);
|
|
754
|
+
}
|
|
755
|
+
});
|
|
756
|
+
if (run.kind !== "refused") {
|
|
757
|
+
await settleAccountRun(dataDir, id, run.kind !== "input");
|
|
758
|
+
at.claimed = false;
|
|
759
|
+
}
|
|
760
|
+
return finish(run, at);
|
|
761
|
+
}
|
|
762
|
+
async function finish(run, at) {
|
|
763
|
+
const { id, spec, account, sentInput, footer } = at;
|
|
764
|
+
const { dataDir } = at.deps.ctx;
|
|
765
|
+
switch (run.kind) {
|
|
766
|
+
case "refused":
|
|
767
|
+
return refusal(at, run.reason, run.sent, run.detail);
|
|
768
|
+
case "declined":
|
|
769
|
+
await keepAccountRow(at);
|
|
770
|
+
return refusal(at, run.reason ?? "declined", true, run.detail, { answered: true });
|
|
771
|
+
case "input": {
|
|
772
|
+
report(at, { status: "unpaid", reason: "input" });
|
|
773
|
+
await footer.done("needs_input", shownOf(at));
|
|
774
|
+
const reason = `Your ${account.label} account didn't take this input; its answer is in providerError.`;
|
|
775
|
+
return accountResult(
|
|
776
|
+
"needs_input",
|
|
777
|
+
`More input needed: ${reason}
|
|
778
|
+
|
|
779
|
+
${specText(id, spec, account.label)}`,
|
|
780
|
+
reason,
|
|
781
|
+
account.label,
|
|
782
|
+
{
|
|
783
|
+
providerError: run.detail,
|
|
784
|
+
nextStep: `Fix the input and call request({id: ${JSON.stringify(id)}, input: {...}}) again; nothing ran.`,
|
|
785
|
+
parameters: sentInput
|
|
786
|
+
}
|
|
787
|
+
);
|
|
788
|
+
}
|
|
789
|
+
case "running": {
|
|
790
|
+
const kept = await keepJob(at, run);
|
|
791
|
+
await keepAccountRow(at);
|
|
792
|
+
report(at, { status: "running" });
|
|
793
|
+
await footer.done("running", { ...shownOf(at), price: "your account" });
|
|
794
|
+
const { label } = account;
|
|
795
|
+
const stopped = run.reason !== void 0 ? refusalWords(run.reason, account, run.detail) : void 0;
|
|
796
|
+
const lead = run.finished === true ? `Your ${label} job finished, but its result didn't come back.` : stopped !== void 0 || run.providerError !== void 0 ? `Tenjin couldn't check on your ${label} job.` : `Still running on your ${label} account.`;
|
|
797
|
+
const repeats = run.finished !== true && run.reason === "unreachable";
|
|
798
|
+
const why = (repeats ? void 0 : stopped?.said) ?? (run.providerError !== void 0 && run.reason === void 0 ? `Your ${label} account answered with an error; it's in providerError.` : void 0);
|
|
799
|
+
const pickUp = `request({job: ${JSON.stringify(id)}}) for its result; nothing is sent to the account again.`;
|
|
800
|
+
const soon = stopped?.retryIn;
|
|
801
|
+
const next = !kept ? `This machine could not keep the job, so it can't be picked up here. ${runsAgain(label)}` : soon !== void 0 ? `In a ${soon}, call ${pickUp}` : stopped !== void 0 ? `${stopped.fix} Then call ${pickUp}` : `Call ${pickUp}`;
|
|
802
|
+
const summary = [lead, why, next].filter((s) => s !== void 0).join(" ");
|
|
803
|
+
return accountResult("needs_input", summary, summary, label, {
|
|
804
|
+
nextStep: next,
|
|
805
|
+
parameters: sentInput,
|
|
806
|
+
ran: "maybe",
|
|
807
|
+
...run.providerError !== void 0 ? { providerError: run.providerError } : {},
|
|
808
|
+
extra: { status: "running", ...kept ? { job: id } : {} }
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
case "failed": {
|
|
812
|
+
await endAccountJob(dataDir, id);
|
|
813
|
+
await keepAccountRow(at);
|
|
814
|
+
report(at, { status: "failed" });
|
|
815
|
+
await footer.done("failed", { ...shownOf(at), price: "your account" });
|
|
816
|
+
const { offer: offered, routed } = await reask(id, at.deps, at.reportDeps);
|
|
817
|
+
const offer = offered !== null ? offerWords(offered) : void 0;
|
|
818
|
+
const reason = `Your ${account.label} account ran this, but ${run.why}. It may have billed your ${account.label} plan.`;
|
|
819
|
+
return accountResult(
|
|
820
|
+
"failed",
|
|
821
|
+
`${reason}${offer !== void 0 ? ` ${offer.said}
|
|
822
|
+
|
|
823
|
+
${offer.spec}` : ""}`,
|
|
824
|
+
reason,
|
|
825
|
+
account.label,
|
|
826
|
+
{
|
|
827
|
+
...run.detail !== void 0 ? { providerError: run.detail } : {},
|
|
828
|
+
nextStep: `Tell the user it may have run on their ${account.label} account; don't call it again for this.${offer !== void 0 ? ` ${offer.next}` : ""}`,
|
|
829
|
+
parameters: sentInput,
|
|
830
|
+
ran: "maybe",
|
|
831
|
+
routed,
|
|
832
|
+
...offer !== void 0 ? { extra: offer.envelope } : {}
|
|
833
|
+
}
|
|
834
|
+
);
|
|
835
|
+
}
|
|
836
|
+
case "done":
|
|
837
|
+
return delivered(run, at);
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
function keepJob(at, started) {
|
|
841
|
+
return keepAccountJob(at.deps.ctx.dataDir, {
|
|
842
|
+
version: 1,
|
|
843
|
+
offerId: at.id,
|
|
844
|
+
spec: stripKept(at.spec),
|
|
845
|
+
input: at.merged,
|
|
846
|
+
first: started.first,
|
|
847
|
+
firstAt: started.firstAt
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
function stripKept(spec) {
|
|
851
|
+
const rest = {
|
|
852
|
+
...spec
|
|
853
|
+
};
|
|
854
|
+
delete rest.id;
|
|
855
|
+
delete rest.settingsHash;
|
|
856
|
+
return rest;
|
|
857
|
+
}
|
|
858
|
+
function callOf(at) {
|
|
859
|
+
const { id, spec, account, sentInput } = at;
|
|
860
|
+
return {
|
|
861
|
+
capabilityId: spec.capabilityId,
|
|
862
|
+
provider: spec.provider,
|
|
863
|
+
...spec.label !== void 0 ? { label: spec.label } : {},
|
|
864
|
+
// In a native call's place (`swap.ts`): kept on its ledger row.
|
|
865
|
+
...at.deps.via !== void 0 ? { via: at.deps.via } : {},
|
|
866
|
+
media: spec.output === "media",
|
|
867
|
+
parameters: sentInput,
|
|
868
|
+
sent: JSON.stringify(sentInput),
|
|
869
|
+
...spec.outputSchema !== void 0 ? { project: { id, schema: spec.outputSchema } } : {},
|
|
870
|
+
request: { url: account.mcpUrl ?? "" }
|
|
871
|
+
};
|
|
872
|
+
}
|
|
873
|
+
async function keepAccountRow(at) {
|
|
874
|
+
const call = callOf(at);
|
|
875
|
+
await recordAccountRow(at.deps.ctx.dataDir, {
|
|
876
|
+
...paidRecord(call, call.request.url, call.sent, 0n, {
|
|
877
|
+
savedFiles: [],
|
|
878
|
+
account: at.account.id,
|
|
879
|
+
...at.deps.now !== void 0 ? { now: at.deps.now } : {}
|
|
880
|
+
}),
|
|
881
|
+
job: at.id,
|
|
882
|
+
charge: "unknown"
|
|
883
|
+
});
|
|
884
|
+
}
|
|
885
|
+
async function delivered(run, at) {
|
|
886
|
+
const { id, spec, account } = at;
|
|
887
|
+
const { dataDir } = at.deps.ctx;
|
|
888
|
+
const check = spec.resultSchema !== void 0 && run.media.length === 0 ? validateResultBody(spec.resultSchema, run.text) : { valid: true };
|
|
889
|
+
const call = callOf(at);
|
|
890
|
+
const done = await deliverResult(
|
|
891
|
+
call,
|
|
892
|
+
at.deps,
|
|
893
|
+
at.footer,
|
|
894
|
+
{
|
|
895
|
+
bodyText: run.text,
|
|
896
|
+
...run.media.length > 0 ? { files: run.media } : {},
|
|
897
|
+
...!check.valid ? {
|
|
898
|
+
resultUnverified: true,
|
|
899
|
+
...check.reason !== void 0 ? { resultCaveat: check.reason } : {}
|
|
900
|
+
} : {}
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
providerAtomic: 0n,
|
|
904
|
+
// One row per offer: a job kept on the ledger while it ran is finished.
|
|
905
|
+
ledger: { job: id },
|
|
906
|
+
account: {
|
|
907
|
+
label: account.label,
|
|
908
|
+
source: account.id,
|
|
909
|
+
...spec.returns !== void 0 ? { returns: spec.returns } : {}
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
);
|
|
913
|
+
if (done.unsaved !== void 0 && await readAccountJob(dataDir, id) !== null) {
|
|
914
|
+
report(at, { status: "running" });
|
|
915
|
+
await at.footer.done("running", { ...shownOf(at), price: "your account" });
|
|
916
|
+
return unsavedAnswer(account.label, done.result, done.unsaved, {
|
|
917
|
+
id,
|
|
918
|
+
parameters: at.sentInput
|
|
919
|
+
});
|
|
920
|
+
}
|
|
921
|
+
await endAccountJob(dataDir, id);
|
|
922
|
+
report(at, done.outcome);
|
|
923
|
+
return done.unsaved !== void 0 ? unsavedAnswer(account.label, done.result, done.unsaved) : done.result;
|
|
924
|
+
}
|
|
925
|
+
async function refusal(at, reason, sent, detail, opts = {}) {
|
|
926
|
+
const { account, footer } = at;
|
|
927
|
+
report(at, {
|
|
928
|
+
status: "unpaid",
|
|
929
|
+
reason: reason === "unreachable" ? "unreachable" : reason === "missing" ? "terms" : "provider"
|
|
930
|
+
});
|
|
931
|
+
const words = refusalWords(reason, account, detail);
|
|
932
|
+
const answered = opts.answered === true;
|
|
933
|
+
const { offer, routed } = reason === "not_connected" ? { offer: null, routed: false } : await reask(at.id, at.deps, at.reportDeps);
|
|
934
|
+
const switchable = !answered && at.deps.via === void 0 && SWITCHABLE.has(reason) && offer !== null && (await savedAccount(at.deps.ctx.dataDir, account.id))?.onRefusal === "tenjin";
|
|
935
|
+
const fitted = switchable ? fittedInput(at.input, offer) : void 0;
|
|
936
|
+
if (switchable && fitted !== void 0) {
|
|
937
|
+
const switched = await runSpec(offer.id, offer, fitted, at.deps, footer, at.reportDeps);
|
|
938
|
+
const ran = !ranNothing(switched);
|
|
939
|
+
await settleRefused(at, ran ? { to: offer.id } : false);
|
|
940
|
+
const note = `${words.said} Tenjin ran its own tool for this job instead, as you set for ${account.label}.`;
|
|
941
|
+
return {
|
|
942
|
+
...switched,
|
|
943
|
+
summary: `${note}
|
|
944
|
+
${switched.summary}`,
|
|
945
|
+
envelope: {
|
|
946
|
+
...switched.envelope,
|
|
947
|
+
switched: { from: account.label, to: offer.label ?? offer.provider, reason },
|
|
948
|
+
note
|
|
949
|
+
}
|
|
950
|
+
};
|
|
951
|
+
}
|
|
952
|
+
await settleRefused(at, false);
|
|
953
|
+
await footer.done("needs_input", shownOf(at));
|
|
954
|
+
const text = sent ? words.said : `${words.said} Nothing was sent to your ${account.label} account.`;
|
|
955
|
+
const refused = { account: account.label, reason, reconnect: `tenjin connect ${account.id}` };
|
|
956
|
+
if (switchable && fitted === void 0) {
|
|
957
|
+
const fid = JSON.stringify(offer.id);
|
|
958
|
+
return accountResult(
|
|
959
|
+
"needs_input",
|
|
960
|
+
`${text} You set Tenjin's tool to stand in when ${account.label} refuses, and it takes other inputs:
|
|
961
|
+
|
|
962
|
+
${specText(offer.id, offer)}`,
|
|
963
|
+
text,
|
|
964
|
+
account.label,
|
|
965
|
+
{
|
|
966
|
+
nextStep: `The user chose Tenjin's tool for when ${account.label} refuses: call request({id: ${fid}, input: {...}}) now with the inputs above, without asking. ${words.fix}`,
|
|
967
|
+
parameters: at.sentInput,
|
|
968
|
+
routed,
|
|
969
|
+
extra: { refused, ...offerWords(offer).envelope, switching: true }
|
|
970
|
+
}
|
|
971
|
+
);
|
|
972
|
+
}
|
|
973
|
+
const named = offer !== null ? offerWords(offer) : void 0;
|
|
974
|
+
return accountResult(
|
|
975
|
+
"needs_input",
|
|
976
|
+
`${text} ${words.fix}${named !== void 0 ? ` ${named.said}
|
|
977
|
+
|
|
978
|
+
${named.spec}` : ""}`,
|
|
979
|
+
text,
|
|
980
|
+
account.label,
|
|
981
|
+
{
|
|
982
|
+
nextStep: named !== void 0 ? `Ask the user whether to fix it (${words.step}) or use Tenjin's tool instead. ${named.next}` : `Tell the user: ${words.fix} Otherwise continue with your own tools.`,
|
|
983
|
+
parameters: at.sentInput,
|
|
984
|
+
...answered && detail !== void 0 ? { providerError: detail } : {},
|
|
985
|
+
...answered ? { ran: "maybe" } : {},
|
|
986
|
+
routed,
|
|
987
|
+
extra: { refused, ...named?.envelope ?? {} }
|
|
988
|
+
}
|
|
989
|
+
);
|
|
990
|
+
}
|
|
991
|
+
async function settleRefused(at, ran) {
|
|
992
|
+
if (at.claimed !== true) return;
|
|
993
|
+
at.claimed = false;
|
|
994
|
+
await settleAccountRun(at.deps.ctx.dataDir, at.id, ran);
|
|
995
|
+
}
|
|
996
|
+
async function resumeAccountJob(job, deps, reportDeps) {
|
|
997
|
+
const { dataDir } = deps.ctx;
|
|
998
|
+
const footer = await openLookupFooter(dataDir, { id: job.offerId });
|
|
999
|
+
await footer.routing();
|
|
1000
|
+
const spec = { ...job.spec, id: job.offerId };
|
|
1001
|
+
const at = {
|
|
1002
|
+
id: job.offerId,
|
|
1003
|
+
spec,
|
|
1004
|
+
account: await accountOf(spec, dataDir),
|
|
1005
|
+
input: job.input,
|
|
1006
|
+
merged: job.input,
|
|
1007
|
+
sentInput: maskDeep(job.input),
|
|
1008
|
+
deps,
|
|
1009
|
+
footer,
|
|
1010
|
+
reportDeps,
|
|
1011
|
+
startedAt: Date.now()
|
|
1012
|
+
};
|
|
1013
|
+
const resume = { first: job.first, firstAt: job.firstAt };
|
|
1014
|
+
const now = await rulesNow(dataDir);
|
|
1015
|
+
const checked = "problem" in now ? { settings: UNREADABLE } : connection(spec, at.account, now.wire);
|
|
1016
|
+
if (checked !== null && "settings" in checked) {
|
|
1017
|
+
await footer.done("needs_input");
|
|
1018
|
+
const { label } = at.account;
|
|
1019
|
+
const reason = `${checked.settings.reason} Tenjin did not check the job on your ${label} account again.`;
|
|
1020
|
+
return accountResult("needs_input", reason, reason, label, {
|
|
1021
|
+
nextStep: `${checked.settings.nextStep} Once they're fixed, call request({job: ${JSON.stringify(job.offerId)}}) for its result; nothing is sent to the account again.`,
|
|
1022
|
+
ran: "maybe"
|
|
1023
|
+
});
|
|
1024
|
+
}
|
|
1025
|
+
await footer.calling(shownOf(at));
|
|
1026
|
+
const run = checked !== null ? { kind: "running", ...resume, reason: "not_connected" } : await runAccountCall(
|
|
1027
|
+
{ id: at.account.id, label: at.account.label },
|
|
1028
|
+
spec.mcp,
|
|
1029
|
+
job.input,
|
|
1030
|
+
runDeps(deps),
|
|
1031
|
+
resume
|
|
1032
|
+
);
|
|
1033
|
+
return finish(run, at);
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
export {
|
|
1037
|
+
listAccountTools,
|
|
1038
|
+
runAccountCall,
|
|
1039
|
+
refusalWords,
|
|
1040
|
+
ranNothing,
|
|
1041
|
+
accountResult,
|
|
1042
|
+
unsavedAnswer,
|
|
1043
|
+
runInPlaceOf,
|
|
1044
|
+
runDeps,
|
|
1045
|
+
showAccountSpec,
|
|
1046
|
+
offerAccountLead,
|
|
1047
|
+
runAccountSpec,
|
|
1048
|
+
resumeAccountJob
|
|
1049
|
+
};
|
|
1050
|
+
//# sourceMappingURL=chunk-JHFFUVON.js.map
|