nolo-cli 0.228.0 → 0.228.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{_executeModel-GIFVXKDT.js → _executeModel-AKCTHGMP.js} +62 -61
- package/{action-WZTKEF5H.js → action-C6IQAKN4.js} +6 -6
- package/{addContentAction-MLI6GOBV.js → addContentAction-53364YDW.js} +10 -10
- package/{addDialogAgentAction-ARGQM22H.js → addDialogAgentAction-U5DD5EN5.js} +9 -9
- package/{agentDeleteCommand-UF7XVELS.js → agentDeleteCommand-2E5FAGUO.js} +99 -93
- package/{agentEmailCommands-SFHRPQYC.js → agentEmailCommands-UGZZAH7E.js} +99 -93
- package/{agentListCommands-IXKBP3W5.js → agentListCommands-JCTW3J2K.js} +240 -52
- package/{agentMachineCommands-7NX6PWQ6.js → agentMachineCommands-QPG5ZXF4.js} +45 -41
- package/{agentProviderCommands-C5T7C5KZ.js → agentProviderCommands-QLTABYR7.js} +2 -2
- package/{agentPullCommand-4EQZYHU4.js → agentPullCommand-2EYJ5ENC.js} +1 -1
- package/{agentRecordCommands-IUNX6XD6.js → agentRecordCommands-4NTVR6MZ.js} +98 -92
- package/{agentRunCommand-LCR4XADM.js → agentRunCommand-VHF34PYC.js} +103 -94
- package/{agentRunControl-RN2P6AOD.js → agentRunControl-QYTXUQGY.js} +10 -7
- package/{agentRuntimeLocal-LVXPQ7QA.js → agentRuntimeLocal-U54AKHXH.js} +38 -36
- package/{agentSlice-ZGMOH6TE.js → agentSlice-4JGDEXWK.js} +10 -10
- package/{appDeleteCommands-BESCJOQM.js → appDeleteCommands-XBE5QJ6P.js} +46 -42
- package/{appDeployCommands-LPTR6IOX.js → appDeployCommands-QIYLXXGA.js} +46 -42
- package/{appDeployStatusCommands-BZ7KZ5RD.js → appDeployStatusCommands-JXS6ZQZZ.js} +46 -42
- package/{appGetCommands-EDWGJV4S.js → appGetCommands-SZS7SJPK.js} +46 -42
- package/{appListCommands-OPRWYPM6.js → appListCommands-B3GBJSNV.js} +46 -42
- package/{authCommand-3C3RN4OU.js → authCommand-V6EOMZX6.js} +15 -15
- package/{authCommands-ZMVEDCQD.js → authCommands-T5FODCEG.js} +2 -2
- package/{builtinSkillRegistry-VRCMQ77Q.js → builtinSkillRegistry-ZQC3IIO2.js} +4 -3
- package/{chromeOpsCommands-NZITLHWO.js → chromeOpsCommands-OFX7ZGKP.js} +2 -2
- package/{chunk-MZVCFV3T.js → chunk-223KZUJ6.js} +4 -4
- package/{chunk-UF6J7NXV.js → chunk-2C5VN7NH.js} +1 -1
- package/{chunk-MAA42MMV.js → chunk-2FZVXOFX.js} +4 -4
- package/{chunk-ESN4WNWU.js → chunk-2JHGUL5K.js} +2 -2
- package/chunk-3A5NNQCN.js +64 -0
- package/chunk-3F2FRLIO.js +372 -0
- package/{chunk-V4IYI3SB.js → chunk-46FETNLF.js} +2 -2
- package/{chunk-RR3MB26M.js → chunk-4GYVS4PM.js} +8 -6
- package/{chunk-ZQ6K57FJ.js → chunk-4YPH5KRA.js} +1 -1
- package/{chunk-Y4NPF2UN.js → chunk-5AYP5QBB.js} +5 -5
- package/{chunk-4OXPN3WC.js → chunk-5ISNPTQH.js} +4 -4
- package/{chunk-CO6E7YK6.js → chunk-5P3PPQVP.js} +1 -1
- package/{chunk-6TVYUQRM.js → chunk-6BMTKYAO.js} +2 -2
- package/{chunk-KLAMJNKQ.js → chunk-6PAHSSD2.js} +15 -8
- package/{chunk-CTWCZKNS.js → chunk-6SOWMEAY.js} +4 -4
- package/{chunk-ARFCL53U.js → chunk-6VEO7Z3Y.js} +5 -5
- package/{chunk-ZM5AZTQG.js → chunk-7BIJFGKS.js} +20 -8
- package/{chunk-BAH3BAUZ.js → chunk-7OVOZRZF.js} +5 -5
- package/{chunk-N74XL3NI.js → chunk-7PON4LBY.js} +42 -24
- package/{chunk-LTVEOOZL.js → chunk-7WHCIA5V.js} +16 -3
- package/{chunk-HZDK56EK.js → chunk-ADYWV732.js} +34 -12
- package/{chunk-2FK2KZSL.js → chunk-AIFQKNPP.js} +1 -1
- package/{chunk-VTHWBTRE.js → chunk-BPB3T5EU.js} +5 -8
- package/{chunk-SX6AWTNK.js → chunk-BZLGPM5B.js} +3 -3
- package/{chunk-MTM4LRVG.js → chunk-BZMDWGQQ.js} +2 -2
- package/{chunk-JP2BH4NC.js → chunk-CEKRIR22.js} +1 -1
- package/{chunk-5HUO7SEX.js → chunk-D634SL2Y.js} +1 -1
- package/{chunk-SCMYAGQE.js → chunk-DHRPLRIR.js} +294 -159
- package/{chunk-VUHKG4KS.js → chunk-DNNPARJK.js} +9 -5
- package/{chunk-X22AUZKL.js → chunk-E3LSO6EI.js} +189 -88
- package/{chunk-LHCGKAFO.js → chunk-EHFBP6IK.js} +100 -48
- package/{chunk-6ASGEP5D.js → chunk-EJQE5HB7.js} +1 -1
- package/{chunk-2BKNICGK.js → chunk-EL5NRJHI.js} +1 -1
- package/chunk-EUGTFFO6.js +42 -0
- package/{chunk-YFW4H6DL.js → chunk-EVHTYVD2.js} +821 -131
- package/{chunk-6XRPBZRS.js → chunk-EYLGAEB4.js} +0 -134
- package/{chunk-E5RYFR7E.js → chunk-FEIVARWR.js} +49 -15
- package/{chunk-3DJJ4CFG.js → chunk-FLBJ7IJI.js} +9 -9
- package/{chunk-W3HSD32M.js → chunk-FXEPZKNJ.js} +2 -2
- package/{chunk-VKCPKCSS.js → chunk-FYAMUU55.js} +625 -62
- package/{chunk-JEWMQR6J.js → chunk-FZANZZ63.js} +1 -1
- package/{chunk-WWTSEBDF.js → chunk-GIXWVN2W.js} +1 -1
- package/{chunk-YHNUDTU4.js → chunk-HDKMVYNJ.js} +4 -4
- package/chunk-HEVRQGGH.js +106 -0
- package/{chunk-PBPXXMWZ.js → chunk-HFHJPHFK.js} +1 -1
- package/{chunk-WQDTSK5U.js → chunk-HPDLPEUG.js} +11 -5
- package/{chunk-SPU3L3OR.js → chunk-HQUGB2HM.js} +3 -3
- package/chunk-IVK2KT3H.js +209 -0
- package/{chunk-73PZD7JZ.js → chunk-IYLUK67R.js} +2 -2
- package/{chunk-BFKJ2RS3.js → chunk-J55F3IEZ.js} +1 -1
- package/{chunk-ADOOL3PG.js → chunk-J7JRCOIW.js} +1 -1
- package/{chunk-AEZBAFC6.js → chunk-JAKRY74O.js} +138 -8
- package/{chunk-NEG5LYK5.js → chunk-JCQ3WCQ3.js} +3 -1
- package/{chunk-W6T4FNZP.js → chunk-JLZJL3WC.js} +219 -351
- package/{chunk-PQ63BDV3.js → chunk-JPXACKSW.js} +9 -1
- package/{chunk-IIOSZAJX.js → chunk-KDBDOXOM.js} +137 -53
- package/{chunk-CIGCTSBF.js → chunk-KDDHQMSH.js} +1 -1
- package/{chunk-OAZP4TSA.js → chunk-KG27JIG4.js} +2 -2
- package/{chunk-RHBD22LV.js → chunk-KHYSFS3W.js} +80 -4
- package/{chunk-7UVVLYKC.js → chunk-KKIQAVDR.js} +5 -5
- package/{chunk-HS7MLR74.js → chunk-KZ4A7EIV.js} +3 -5
- package/{chunk-OLGFIQN2.js → chunk-LLUBUHNT.js} +1 -1
- package/{chunk-QJTZ76CP.js → chunk-LS5KAVFQ.js} +1 -0
- package/{chunk-K26XPZRB.js → chunk-LVZVSLKO.js} +29 -9
- package/{chunk-XJSEST7D.js → chunk-MNFUKRRU.js} +3 -3
- package/{chunk-R5NRFXGD.js → chunk-O3A2CHAL.js} +5 -5
- package/{chunk-4IQN6FWY.js → chunk-OB4FBZXJ.js} +4 -4
- package/{chunk-J2VIGDJN.js → chunk-OJSJJKHF.js} +3 -3
- package/{chunk-OHUYN3YU.js → chunk-OKAXQFON.js} +1 -1
- package/{chunk-CD2DK5JA.js → chunk-OKH74FML.js} +2 -1
- package/{chunk-MYYNZG2M.js → chunk-OOV5JN25.js} +4 -4
- package/{chunk-TMRJGSK2.js → chunk-OOVOAG4Q.js} +1 -1
- package/chunk-OQFOE4SJ.js +405 -0
- package/{chunk-AS6L5KSD.js → chunk-P4R5KXU7.js} +2 -2
- package/{chunk-VIYVRPMJ.js → chunk-PHREU2KZ.js} +5 -3
- package/{chunk-EDT65EUE.js → chunk-PIVTQRX6.js} +45 -15
- package/{chunk-QMNVV3YM.js → chunk-PJL7OJRC.js} +12 -11
- package/{chunk-XCA4WHX5.js → chunk-PNLDLUMO.js} +315 -360
- package/{chunk-UPOW5HTG.js → chunk-QGFLVQ6E.js} +3 -3
- package/{chunk-JU7VN4LF.js → chunk-QONAOHVW.js} +6 -6
- package/{chunk-UOUMPHS5.js → chunk-R3FZHW4Q.js} +13 -13
- package/{chunk-K7VIXYTZ.js → chunk-R3MV2GII.js} +1 -45
- package/{chunk-FE7G6DSP.js → chunk-R72QWIFO.js} +14 -4
- package/{chunk-KZAT2M2V.js → chunk-RIWKZT7E.js} +22 -0
- package/{chunk-RMWDKLBE.js → chunk-S7H4KTMB.js} +1099 -71
- package/{chunk-IJZC2KIJ.js → chunk-SA356NGW.js} +1 -1
- package/{chunk-BVEDT6DM.js → chunk-SCAC3NM5.js} +3 -3
- package/{chunk-EQZQUQ33.js → chunk-SLUN7W6S.js} +5 -5
- package/{chunk-KK3FCYZM.js → chunk-SQL7YNED.js} +7 -4
- package/{chunk-LMGFVH65.js → chunk-SSOR2EDT.js} +10 -10
- package/chunk-TRRXYFTR.js +46 -0
- package/{chunk-XNTZD4AE.js → chunk-TUOHSUK5.js} +19367 -17503
- package/chunk-TYJCIA2O.js +835 -0
- package/{chunk-FTWAOKFU.js → chunk-U3BUWDUP.js} +415 -1962
- package/{chunk-CD64YXRB.js → chunk-U6QNVOR5.js} +1 -1
- package/chunk-UAF5VQCE.js +77 -0
- package/{chunk-CIUZXD5D.js → chunk-UFGUJ2IH.js} +5 -5
- package/{chunk-CTIEJRTP.js → chunk-UP7KBWLE.js} +81 -29
- package/{chunk-GX6DITLQ.js → chunk-UUCYUN6Y.js} +1 -1
- package/{chunk-UHW6SCVK.js → chunk-UZKBVQUX.js} +1 -1
- package/{chunk-XSRSAU3O.js → chunk-V5TI7HJH.js} +3 -3
- package/{chunk-WFGNWWJI.js → chunk-VH7UO6E5.js} +252 -114
- package/{chunk-ITBX27W6.js → chunk-VJFDG3ZG.js} +30 -122
- package/{chunk-6MTVACLN.js → chunk-WC3J5SL2.js} +277 -293
- package/{chunk-HCCQEMTK.js → chunk-WD5547ZF.js} +15 -12
- package/{chunk-X3OZ655T.js → chunk-WS36XPJD.js} +2 -2
- package/{chunk-JFRJEPFI.js → chunk-WSLL7VV4.js} +2 -2
- package/chunk-XRGBJHZX.js +136 -0
- package/{chunk-KZ5OD2MO.js → chunk-Y2KWJTOZ.js} +3 -3
- package/{dialogUsageCommand-6RW2FY6K.js → chunk-Y2TCTNUD.js} +24 -17
- package/{chunk-FFFKAOJN.js → chunk-YN23INFZ.js} +1 -1
- package/{chunk-ODBYGVO2.js → chunk-YXK3GJF5.js} +5 -5
- package/{chunk-6CXQ3YNJ.js → chunk-Z2OWAYMI.js} +53 -31
- package/{chunk-6XVPMGXK.js → chunk-ZTHAJU3O.js} +10 -4
- package/{chunk-D25ONVOH.js → chunk-ZYPXOQS2.js} +1 -1
- package/{cliAgentConfigHelpers-37ZNEY5Y.js → cliAgentConfigHelpers-BXHQ3PXP.js} +8 -8
- package/{cliAuthorityBrokerClient-SFPC3WVK.js → cliAuthorityBrokerClient-TFNXJLXL.js} +1 -1
- package/cliAuthorityBrokerProcess-5ZFBTHLB.js +22 -0
- package/{cliLocalAgentRecordReader-MCQVRWBR.js → cliLocalAgentRecordReader-47PXMHPH.js} +43 -41
- package/{commandRegistry-NTH5IAN5.js → commandRegistry-CTMPAQH2.js} +93 -156
- package/{contentThunks-SPXTX5U2.js → contentThunks-CAHIIZO5.js} +25 -25
- package/{cooldownCommands-TIFCHCUN.js → cooldownCommands-WDOI5VD7.js} +3 -3
- package/{createAgentAutomationAction-KUQKCOXB.js → createAgentAutomationAction-M25XZSPD.js} +25 -25
- package/{createDialogAction-HJN5U3XS.js → createDialogAction-4SN7FKI7.js} +26 -26
- package/{createPageAction-ZAHRDOAU.js → createPageAction-N7QPDN3M.js} +28 -28
- package/{db-CMUTP3W5.js → db-VR74ADGC.js} +7 -2
- package/{dbSlice-656PMWR2.js → dbSlice-RWPSVHBC.js} +9 -9
- package/{deleteFile-ZCQESEEQ.js → deleteFile-ECU6FU5C.js} +12 -7
- package/{dialogCommands-KZTZLWPZ.js → dialogCommands-BBHWCKDP.js} +57 -47
- package/{dialogNotifyCommand-PST75COP.js → dialogNotifyCommand-IASQGEMW.js} +9 -9
- package/{dialogSlice-BXIERQHO.js → dialogSlice-JI3J22RV.js} +23 -23
- package/dialogTraceCommand-EW2KK6A4.js +961 -0
- package/dialogUsageCommand-WJ3U6KZU.js +27 -0
- package/{docCreateCommands-26HJ5NAY.js → docCreateCommands-QSX3X5U4.js} +45 -41
- package/{docDeleteCommands-UAOHH5XK.js → docDeleteCommands-63JBG2HQ.js} +46 -42
- package/{docReadCommands-4ADG7YE6.js → docReadCommands-CQFKRQUI.js} +45 -41
- package/{docStore-FZ75HWP2.js → docStore-XLBKGGNM.js} +10 -10
- package/{docUpdateCommands-OGFJZENF.js → docUpdateCommands-534LUK25.js} +45 -41
- package/ebookDownloaderAgentCommand-DYSKF5ZY.js +677 -0
- package/{getPricing-FCHYVRJU.js → getPricing-5BLZRPTM.js} +3 -3
- package/{handleSendMessageAction-KP6GGBFY.js → handleSendMessageAction-Q2VMEVOR.js} +90 -48
- package/{hostCredentialCreate-23TX56G7.js → hostCredentialCreate-C57T7YPE.js} +99 -93
- package/index.js +23 -11
- package/{localDialogRead-CIOTQM5T.js → localDialogRead-BJJT3TF5.js} +1 -1
- package/{localRuntimeAdapter-MTUWOYPN.js → localRuntimeAdapter-OALZPFZU.js} +96 -90
- package/{localRuntimeAuthority-TYHQCTZN.js → localRuntimeAuthority-UF2DAQ3F.js} +13 -3
- package/{localRuntimeDb-BO7IVWAZ.js → localRuntimeDb-ZJFGNHML.js} +1 -1
- package/{machineCommands-4WJUJQHW.js → machineCommands-N6IVWRZT.js} +109 -92
- package/{machineWsRunDispatch-V3U4JM67.js → machineWsRunDispatch-PDWYB33B.js} +97 -91
- package/{markdownToSlate-KIYM7B3P.js → markdownToSlate-PXYAIBVL.js} +1 -1
- package/{mcpLocalAuthorizeCommand-TI656UWC.js → mcpLocalAuthorizeCommand-KYI4EGF5.js} +17 -13
- package/{memberThunks-JFYC4Z5L.js → memberThunks-43B7UYC5.js} +11 -11
- package/{models-EP7VG6N2.js → models-ZX2BYIMB.js} +2 -2
- package/package.json +2 -1
- package/{projectArchive-NU2Z5HOR.js → projectArchive-TJNW5DLM.js} +28 -28
- package/{providerPresetApply-4H7YP5D7.js → providerPresetApply-NTJUINI6.js} +35 -16
- package/{providerRegistry-F3UPOTIY.js → providerRegistry-W45SLUV6.js} +5 -5
- package/{read-BRZHXUJ6.js → read-KG6INYUT.js} +12 -7
- package/{readDocTool-N7RVFQEE.js → readDocTool-N3GA52JR.js} +1 -1
- package/{readlineWorkspace-T56MRMS5.js → readlineWorkspace-PJZJVGA5.js} +1296 -1056
- package/{removeDialogAgentAction-J7XU7OUX.js → removeDialogAgentAction-EEVSOQOJ.js} +11 -11
- package/{runAgentClientLoop-O2GRCGRZ.js → runAgentClientLoop-3VC5TCDW.js} +69 -58
- package/{runtimeDoctorCommands-RDRJXMXC.js → runtimeDoctorCommands-V3M3JTUV.js} +14 -11
- package/{secretCommands-2FEMRUFM.js → secretCommands-KVVZS7A6.js} +2 -2
- package/{setDialogExtraReferencesAction-Q4V2ZZW2.js → setDialogExtraReferencesAction-DNO5POHA.js} +10 -10
- package/{setPrimaryDialogAgentAction-742H5S6T.js → setPrimaryDialogAgentAction-QABBEO4C.js} +11 -11
- package/{settingThunks-T4FXSV6M.js → settingThunks-DVKG4X4S.js} +13 -17
- package/{skillDiscovery-MDDKPTW3.js → skillDiscovery-ZMJH36AK.js} +3 -3
- package/{spaceCommands-W5TAVFDT.js → spaceCommands-AGGZXPY3.js} +218 -77
- package/{streamAgentChatTurn-OWDJMU5E.js → streamAgentChatTurn-4GTLL2OF.js} +111 -95
- package/{switchDialogAgentAction-HLDLHRRA.js → switchDialogAgentAction-KYWJSGOO.js} +9 -9
- package/{tableCommands-44GC4N6J.js → tableCommands-EFA754RE.js} +3 -3
- package/{tools-O7SGGVA3.js → tools-5AGPOPLW.js} +48 -47
- package/{tuiRestart-EOGC2BYY.js → tuiRestart-77E7PL4R.js} +9 -8
- package/{tuiSummaryLlmCaller-TM5BU73J.js → tuiSummaryLlmCaller-HROLGN4F.js} +12 -12
- package/{updateCommands-FBYA5WVG.js → updateCommands-GJGRS6JK.js} +3 -3
- package/{updateDialogTitleAction-EXSZGTLL.js → updateDialogTitleAction-5OSEDGRK.js} +25 -25
- package/{usageCommand-L4OFWXEU.js → usageCommand-WI6SQOPB.js} +2 -2
- package/{usageRebuildCommand-7JR33UHS.js → usageRebuildCommand-WQRLLZAT.js} +3 -3
- package/{windowsSelfUpdate-M4V77OUB.js → windowsSelfUpdate-C7LGVWYX.js} +2 -2
- package/{workloadLifecycle-ZCSQCHG3.js → workloadLifecycle-P2SJVV3S.js} +2 -2
- package/chunk-FGHEF6WI.js +0 -34
- package/chunk-U5LOKQ2R.js +0 -176
- package/chunk-YDRRGVT5.js +0 -142
- package/chunk-YGDYYFRX.js +0 -86
- package/chunk-Z7KE4K3H.js +0 -758
- package/lib-62SWPXNF.js +0 -21042
- /package/{chunk-ANUP75N2.js → chunk-2E4BYAUE.js} +0 -0
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
import {
|
|
2
|
+
omitNullishAgentSummaryFields,
|
|
3
|
+
promoteSharedCredentialGroupQuota,
|
|
4
|
+
sortSafeAgentSummaries,
|
|
5
|
+
summarizeCredentialGroups,
|
|
6
|
+
toCompactAgentSummary,
|
|
7
|
+
toSafeAgentSummary,
|
|
8
|
+
toUltraCompactAgentSummary
|
|
9
|
+
} from "./chunk-PNLDLUMO.js";
|
|
10
|
+
import {
|
|
11
|
+
resolveAgentSelectionPriority
|
|
12
|
+
} from "./chunk-VJFDG3ZG.js";
|
|
13
|
+
import {
|
|
14
|
+
DEFAULT_PROVIDER_RETRY_MS,
|
|
15
|
+
isAgentUnavailableNow,
|
|
16
|
+
isSubscriptionPeriodWindow,
|
|
17
|
+
resolveAgentAvailability
|
|
18
|
+
} from "./chunk-LS5KAVFQ.js";
|
|
19
|
+
import {
|
|
20
|
+
DISPATCH_TIER_RANK,
|
|
21
|
+
resolveModelTier
|
|
22
|
+
} from "./chunk-HEVRQGGH.js";
|
|
23
|
+
|
|
24
|
+
// packages/ai/agent/agentDiscovery.ts
|
|
25
|
+
function isPreferredAgent(agent) {
|
|
26
|
+
return agent.isFavorite === true || agent.isOwned === true || agent.isOAuth === true || agent.billingSource === "user_subscription" || agent.billingSource === "user_api" || agent.billingSource === "local";
|
|
27
|
+
}
|
|
28
|
+
function isPublicDiscoveryAgent(agent) {
|
|
29
|
+
return agent.isPublic === true && !isPreferredAgent(agent);
|
|
30
|
+
}
|
|
31
|
+
function resolveDiscoveryScope(args) {
|
|
32
|
+
const rawScope = typeof args?.scope === "string" ? args.scope.trim().toLowerCase() : void 0;
|
|
33
|
+
const hasScope = rawScope !== void 0 && rawScope !== "";
|
|
34
|
+
const hasPublicOnly = typeof args?.publicOnly === "boolean";
|
|
35
|
+
const publicOnly = args?.publicOnly === true;
|
|
36
|
+
if (hasScope) {
|
|
37
|
+
if (rawScope !== "preferred" && rawScope !== "public" && rawScope !== "all") {
|
|
38
|
+
throw new Error(`Invalid scope '${args?.scope}': must be 'preferred', 'public', or 'all'.`);
|
|
39
|
+
}
|
|
40
|
+
const scope = rawScope;
|
|
41
|
+
if (hasPublicOnly) {
|
|
42
|
+
if (publicOnly && scope !== "public") {
|
|
43
|
+
throw new Error(
|
|
44
|
+
`Conflicting arguments: scope='${args?.scope}' conflicts with publicOnly=true.`
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
if (!publicOnly && scope === "public") {
|
|
48
|
+
throw new Error(
|
|
49
|
+
`Conflicting arguments: scope='${args?.scope}' conflicts with publicOnly=false.`
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return scope;
|
|
54
|
+
}
|
|
55
|
+
if (hasPublicOnly && publicOnly) {
|
|
56
|
+
return "public";
|
|
57
|
+
}
|
|
58
|
+
return "all";
|
|
59
|
+
}
|
|
60
|
+
function agentIdentityKeys(agent) {
|
|
61
|
+
return [agent.agentKey, agent.publicKey, agent.id].filter(
|
|
62
|
+
(key) => typeof key === "string" && key.length > 0
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
function deduplicateAgentSummaries(agents) {
|
|
66
|
+
const byIdentity = /* @__PURE__ */ new Map();
|
|
67
|
+
for (const agent of agents) {
|
|
68
|
+
const keys = agentIdentityKeys(agent);
|
|
69
|
+
const existing = keys.map((key) => byIdentity.get(key)).find(Boolean);
|
|
70
|
+
if (!existing) {
|
|
71
|
+
for (const key of keys) byIdentity.set(key, agent);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
const winner = isPreferredAgent(agent) && !isPreferredAgent(existing) ? agent : existing;
|
|
75
|
+
for (const key of /* @__PURE__ */ new Set([...agentIdentityKeys(existing), ...keys])) byIdentity.set(key, winner);
|
|
76
|
+
}
|
|
77
|
+
return [...new Set(byIdentity.values())];
|
|
78
|
+
}
|
|
79
|
+
function filterAgentsByScope(agents, scope) {
|
|
80
|
+
const unique = deduplicateAgentSummaries(agents);
|
|
81
|
+
if (scope === "preferred") return unique.filter((agent) => isPreferredAgent(agent));
|
|
82
|
+
if (scope === "public") return unique.filter((agent) => isPublicDiscoveryAgent(agent));
|
|
83
|
+
return unique.filter((agent) => isPreferredAgent(agent) || agent.isPublic === true);
|
|
84
|
+
}
|
|
85
|
+
function resolveCallerCredentialGroup(agents, caller) {
|
|
86
|
+
const explicit = caller?.credentialGroup;
|
|
87
|
+
if (typeof explicit === "string" && explicit.trim()) return explicit.trim();
|
|
88
|
+
const callerKey = typeof caller?.agentKey === "string" && caller.agentKey.trim() ? caller.agentKey : void 0;
|
|
89
|
+
if (!callerKey) return void 0;
|
|
90
|
+
const own = agents.find((agent) => agent.agentKey === callerKey);
|
|
91
|
+
const group = own?.credentialGroup;
|
|
92
|
+
return typeof group === "string" && group.length > 0 ? group : void 0;
|
|
93
|
+
}
|
|
94
|
+
var asCallerModel = (caller) => typeof caller === "string" ? caller : caller?.model ?? null;
|
|
95
|
+
var asCallerAgentKey = (caller) => {
|
|
96
|
+
if (typeof caller === "string" || !caller) return "";
|
|
97
|
+
return typeof caller.agentKey === "string" ? caller.agentKey.trim() : "";
|
|
98
|
+
};
|
|
99
|
+
function isCallerAtFreePoolTop(caller, candidates) {
|
|
100
|
+
if (candidates.length === 0) return void 0;
|
|
101
|
+
const currentTier = resolveModelTier(asCallerModel(caller));
|
|
102
|
+
if (currentTier === "unknown") return void 0;
|
|
103
|
+
const currentRank = DISPATCH_TIER_RANK[currentTier];
|
|
104
|
+
const callerAgentKey = asCallerAgentKey(caller);
|
|
105
|
+
const external = candidates.filter(
|
|
106
|
+
(candidate) => !(typeof candidate.agentKey === "string" && candidate.agentKey && callerAgentKey && candidate.agentKey === callerAgentKey)
|
|
107
|
+
);
|
|
108
|
+
if (external.length === 0) return true;
|
|
109
|
+
const hasStrictlyHigherFree = external.some((candidate) => {
|
|
110
|
+
if (candidate.requiresPaidApproval !== false) return false;
|
|
111
|
+
const tier = resolveModelTier(candidate.model);
|
|
112
|
+
return tier !== "unknown" && DISPATCH_TIER_RANK[tier] > currentRank;
|
|
113
|
+
});
|
|
114
|
+
if (hasStrictlyHigherFree) return false;
|
|
115
|
+
const hasUnresolvableCandidate = external.some((candidate) => {
|
|
116
|
+
if (candidate.requiresPaidApproval === true) return false;
|
|
117
|
+
const tier = resolveModelTier(candidate.model);
|
|
118
|
+
if (tier === "unknown") return true;
|
|
119
|
+
if (candidate.requiresPaidApproval === void 0) {
|
|
120
|
+
return DISPATCH_TIER_RANK[tier] > currentRank;
|
|
121
|
+
}
|
|
122
|
+
return false;
|
|
123
|
+
});
|
|
124
|
+
if (hasUnresolvableCandidate) return void 0;
|
|
125
|
+
return true;
|
|
126
|
+
}
|
|
127
|
+
function recommendPlanning(agents, caller, poolComplete) {
|
|
128
|
+
const callerKey = typeof caller?.agentKey === "string" && caller.agentKey.trim() ? caller.agentKey : void 0;
|
|
129
|
+
const current = callerKey ? agents.find((a) => a.agentKey === callerKey) : void 0;
|
|
130
|
+
const currentTier = callerKey ? resolveModelTier(caller?.effectiveModel ?? current?.model) : "unknown";
|
|
131
|
+
const base = {
|
|
132
|
+
condition: "when_planning_needed_and_candidate_suitable",
|
|
133
|
+
action: "self",
|
|
134
|
+
currentTier,
|
|
135
|
+
poolComplete,
|
|
136
|
+
requiresPaidApproval: false
|
|
137
|
+
};
|
|
138
|
+
if (caller?.runKind === "subtask") return { ...base, reason: "bounded_subtask" };
|
|
139
|
+
if (!callerKey) return { ...base, reason: "caller_unknown" };
|
|
140
|
+
if (currentTier === "unknown") return { ...base, reason: "caller_tier_unknown" };
|
|
141
|
+
if (!poolComplete) return { ...base, reason: "pool_incomplete" };
|
|
142
|
+
const higher = agents.filter((a) => a.agentKey && a.agentKey !== callerKey && a.modelTier !== "unknown" && DISPATCH_TIER_RANK[a.modelTier] > DISPATCH_TIER_RANK[currentTier]);
|
|
143
|
+
const free = higher.filter((a) => a.requiresPaidApproval === false);
|
|
144
|
+
free.sort((a, b) => DISPATCH_TIER_RANK[b.modelTier] - DISPATCH_TIER_RANK[a.modelTier]);
|
|
145
|
+
const best = free[0];
|
|
146
|
+
if (best) return {
|
|
147
|
+
...base,
|
|
148
|
+
action: "delegate",
|
|
149
|
+
reason: "higher_suitable_agent",
|
|
150
|
+
agentKey: best.agentKey,
|
|
151
|
+
recommendedTier: best.modelTier
|
|
152
|
+
};
|
|
153
|
+
if (higher.length) return { ...base, reason: "paid_approval_required", requiresPaidApproval: true };
|
|
154
|
+
return { ...base, reason: "no_higher_suitable_agent" };
|
|
155
|
+
}
|
|
156
|
+
function resolvePaginationArgs(args) {
|
|
157
|
+
let limit;
|
|
158
|
+
let offset;
|
|
159
|
+
if (args?.limit !== void 0 && args?.limit !== null) {
|
|
160
|
+
const raw = args.limit;
|
|
161
|
+
if (typeof raw === "boolean") {
|
|
162
|
+
throw new Error(`Invalid limit '${raw}': must be a positive integer.`);
|
|
163
|
+
}
|
|
164
|
+
if (typeof raw === "number") {
|
|
165
|
+
if (!Number.isInteger(raw) || raw <= 0) {
|
|
166
|
+
throw new Error(`Invalid limit '${raw}': must be a positive integer.`);
|
|
167
|
+
}
|
|
168
|
+
limit = Math.min(raw, 500);
|
|
169
|
+
} else if (typeof raw === "string") {
|
|
170
|
+
if (raw.trim() !== "") {
|
|
171
|
+
if (!/^\d+$/.test(raw.trim())) {
|
|
172
|
+
throw new Error(`Invalid limit '${raw}': must be a positive integer.`);
|
|
173
|
+
}
|
|
174
|
+
const parsed = Number(raw.trim());
|
|
175
|
+
if (!Number.isInteger(parsed) || parsed <= 0) {
|
|
176
|
+
throw new Error(`Invalid limit '${raw}': must be a positive integer.`);
|
|
177
|
+
}
|
|
178
|
+
limit = Math.min(parsed, 500);
|
|
179
|
+
}
|
|
180
|
+
} else {
|
|
181
|
+
throw new Error(`Invalid limit '${String(raw)}': must be a positive integer.`);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (args?.offset !== void 0 && args?.offset !== null) {
|
|
185
|
+
const raw = args.offset;
|
|
186
|
+
if (typeof raw === "boolean") {
|
|
187
|
+
throw new Error(`Invalid offset '${raw}': must be a non-negative integer.`);
|
|
188
|
+
}
|
|
189
|
+
if (typeof raw === "number") {
|
|
190
|
+
if (!Number.isInteger(raw) || raw < 0) {
|
|
191
|
+
throw new Error(`Invalid offset '${raw}': must be a non-negative integer.`);
|
|
192
|
+
}
|
|
193
|
+
offset = raw;
|
|
194
|
+
} else if (typeof raw === "string") {
|
|
195
|
+
if (raw.trim() !== "") {
|
|
196
|
+
if (!/^\d+$/.test(raw.trim())) {
|
|
197
|
+
throw new Error(`Invalid offset '${raw}': must be a non-negative integer.`);
|
|
198
|
+
}
|
|
199
|
+
const parsed = Number(raw.trim());
|
|
200
|
+
if (!Number.isInteger(parsed) || parsed < 0) {
|
|
201
|
+
throw new Error(`Invalid offset '${raw}': must be a non-negative integer.`);
|
|
202
|
+
}
|
|
203
|
+
offset = parsed;
|
|
204
|
+
}
|
|
205
|
+
} else {
|
|
206
|
+
throw new Error(`Invalid offset '${String(raw)}': must be a non-negative integer.`);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return { limit, offset };
|
|
210
|
+
}
|
|
211
|
+
function matchesAgentQuery(agent, query) {
|
|
212
|
+
if (!query || typeof query !== "string") return true;
|
|
213
|
+
const q = query.trim().toLowerCase();
|
|
214
|
+
if (!q) return true;
|
|
215
|
+
const candidates = [
|
|
216
|
+
agent.name,
|
|
217
|
+
agent.model,
|
|
218
|
+
agent.provider,
|
|
219
|
+
agent.handle,
|
|
220
|
+
agent.agentKey,
|
|
221
|
+
agent.publicKey,
|
|
222
|
+
agent.id
|
|
223
|
+
];
|
|
224
|
+
return candidates.some((text) => typeof text === "string" && text.toLowerCase().includes(q));
|
|
225
|
+
}
|
|
226
|
+
function nearestFundedSubscriptionReset(agent, now) {
|
|
227
|
+
let nearest = Infinity;
|
|
228
|
+
if (agent.billingSource !== "user_subscription") return nearest;
|
|
229
|
+
for (const window of agent.quota?.windows ?? []) {
|
|
230
|
+
const { resetAt, remaining, utilization } = window;
|
|
231
|
+
if (typeof resetAt === "number" && resetAt > now && resetAt < nearest && isSubscriptionPeriodWindow(window) && (typeof remaining === "number" && remaining > 0 || typeof utilization === "number" && utilization < 0.95)) {
|
|
232
|
+
nearest = resetAt;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return nearest;
|
|
236
|
+
}
|
|
237
|
+
function meteredUnitPrice(agent) {
|
|
238
|
+
if (agent.billingSource === "user_subscription" || agent.billingSource === "owner_subscription") return Infinity;
|
|
239
|
+
const input = agent.inputPrice !== null && Number.isFinite(agent.inputPrice) ? agent.inputPrice : 0;
|
|
240
|
+
const output = agent.outputPrice !== null && Number.isFinite(agent.outputPrice) ? agent.outputPrice : 0;
|
|
241
|
+
return input > 0 || output > 0 ? input + output : Infinity;
|
|
242
|
+
}
|
|
243
|
+
function buildAgentDiscoveryResult(options) {
|
|
244
|
+
const scope = resolveDiscoveryScope({
|
|
245
|
+
scope: options.scope,
|
|
246
|
+
publicOnly: options.publicOnly
|
|
247
|
+
});
|
|
248
|
+
const now = options.now ?? Date.now();
|
|
249
|
+
let scopedAgents = filterAgentsByScope(options.agents, scope);
|
|
250
|
+
if (options.query && typeof options.query === "string" && options.query.trim()) {
|
|
251
|
+
scopedAgents = scopedAgents.filter((a) => matchesAgentQuery(a, options.query));
|
|
252
|
+
}
|
|
253
|
+
scopedAgents = scopedAgents.map((agent) => {
|
|
254
|
+
const decision = resolveAgentAvailability(agent, now);
|
|
255
|
+
if (decision.status === "quota_exhausted") {
|
|
256
|
+
const resetAt = decision.resetAt ?? now + DEFAULT_PROVIDER_RETRY_MS;
|
|
257
|
+
const nextAvailableAt = typeof agent.nextAvailableAt === "number" && agent.nextAvailableAt > resetAt ? agent.nextAvailableAt : resetAt;
|
|
258
|
+
return {
|
|
259
|
+
...agent,
|
|
260
|
+
nextAvailableAt,
|
|
261
|
+
availableAt: nextAvailableAt,
|
|
262
|
+
availabilityStatus: decision.status,
|
|
263
|
+
availabilityReason: decision.reason
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
return {
|
|
267
|
+
...agent,
|
|
268
|
+
availabilityStatus: decision.status,
|
|
269
|
+
availabilityReason: decision.reason
|
|
270
|
+
};
|
|
271
|
+
});
|
|
272
|
+
const unavailableCount = scopedAgents.filter((a) => isAgentUnavailableNow(a, now)).length;
|
|
273
|
+
const credentialGroups = summarizeCredentialGroups(scopedAgents, now);
|
|
274
|
+
const pagination = resolvePaginationArgs({
|
|
275
|
+
limit: options.limit,
|
|
276
|
+
offset: options.offset
|
|
277
|
+
});
|
|
278
|
+
const offset = pagination.offset;
|
|
279
|
+
const limit = pagination.limit;
|
|
280
|
+
const sortedAgents = sortSafeAgentSummaries(scopedAgents);
|
|
281
|
+
const hasQuery = Boolean(options.query && typeof options.query === "string" && options.query.trim());
|
|
282
|
+
const hasFilteredCandidates = sortedAgents.length < options.agents.length;
|
|
283
|
+
let total;
|
|
284
|
+
if (hasQuery) {
|
|
285
|
+
total = sortedAgents.length;
|
|
286
|
+
} else if (hasFilteredCandidates) {
|
|
287
|
+
total = sortedAgents.length;
|
|
288
|
+
} else if (scope === "public") {
|
|
289
|
+
total = typeof options.upstreamTotal === "number" && options.upstreamTotal > sortedAgents.length ? options.upstreamTotal : sortedAgents.length;
|
|
290
|
+
} else if (scope === "all") {
|
|
291
|
+
const privateOnlyCount = scopedAgents.filter((a) => isPreferredAgent(a) && a.isPublic !== true).length;
|
|
292
|
+
const publicPulledCount = scopedAgents.filter((a) => a.isPublic === true).length;
|
|
293
|
+
const effectivePublicTotal = typeof options.upstreamTotal === "number" && options.upstreamTotal > publicPulledCount ? options.upstreamTotal : publicPulledCount;
|
|
294
|
+
total = options.upstreamTruncated === true ? privateOnlyCount + effectivePublicTotal : sortedAgents.length;
|
|
295
|
+
} else {
|
|
296
|
+
total = typeof options.upstreamTotal === "number" && options.upstreamTotal > sortedAgents.length ? options.upstreamTotal : sortedAgents.length;
|
|
297
|
+
}
|
|
298
|
+
const isTruncated = options.upstreamTruncated === true || !hasQuery && !hasFilteredCandidates && typeof options.upstreamTotal === "number" && options.upstreamTotal > sortedAgents.length;
|
|
299
|
+
const pagedAgents = typeof limit === "number" || typeof offset === "number" ? sortedAgents.slice(
|
|
300
|
+
offset ?? 0,
|
|
301
|
+
(offset ?? 0) + (limit ?? sortedAgents.length)
|
|
302
|
+
) : sortedAgents;
|
|
303
|
+
const projectedAgents = options.verbose === true ? pagedAgents.map(omitNullishAgentSummaryFields) : options.compact === true ? pagedAgents.map(toUltraCompactAgentSummary) : pagedAgents.map(toCompactAgentSummary);
|
|
304
|
+
const compacted = options.compact === true && options.verbose !== true ? promoteSharedCredentialGroupQuota(
|
|
305
|
+
projectedAgents,
|
|
306
|
+
credentialGroups
|
|
307
|
+
) : { agents: projectedAgents, groups: credentialGroups };
|
|
308
|
+
const tierHints = {};
|
|
309
|
+
const tierHintPreferences = /* @__PURE__ */ new Map();
|
|
310
|
+
const callerCredentialGroup = resolveCallerCredentialGroup(sortedAgents, options.caller);
|
|
311
|
+
for (const agent of sortedAgents) {
|
|
312
|
+
const { agentKey, name, model, modelTier, requiresPaidApproval, availabilityStatus } = agent;
|
|
313
|
+
if (!agentKey || requiresPaidApproval !== false || modelTier === "unknown" || availabilityStatus === "quota_exhausted" || availabilityStatus === "rate_limited") continue;
|
|
314
|
+
const priority = resolveAgentSelectionPriority(agent);
|
|
315
|
+
const current = tierHintPreferences.get(modelTier);
|
|
316
|
+
if (current && current.priority !== priority) continue;
|
|
317
|
+
const differentGroup = callerCredentialGroup !== void 0 && Boolean(agent.credentialGroup) && agent.credentialGroup !== callerCredentialGroup;
|
|
318
|
+
const resetAt = nearestFundedSubscriptionReset(agent, now);
|
|
319
|
+
const price = resetAt === Infinity ? meteredUnitPrice(agent) : Infinity;
|
|
320
|
+
if (current && current.differentGroup !== differentGroup) {
|
|
321
|
+
if (current.differentGroup) continue;
|
|
322
|
+
} else if (current && (resetAt > current.resetAt || resetAt === current.resetAt && price >= current.price)) {
|
|
323
|
+
continue;
|
|
324
|
+
}
|
|
325
|
+
tierHintPreferences.set(modelTier, { priority, differentGroup, resetAt, price });
|
|
326
|
+
tierHints[modelTier] = { agentKey, name, model };
|
|
327
|
+
}
|
|
328
|
+
return {
|
|
329
|
+
total,
|
|
330
|
+
...typeof offset === "number" ? { offset } : {},
|
|
331
|
+
...typeof limit === "number" ? { limit } : {},
|
|
332
|
+
...isTruncated ? { truncated: true } : {},
|
|
333
|
+
unavailableCount,
|
|
334
|
+
availableCount: sortedAgents.length,
|
|
335
|
+
agents: compacted.agents,
|
|
336
|
+
planningRecommendation: recommendPlanning(
|
|
337
|
+
sortedAgents,
|
|
338
|
+
options.caller,
|
|
339
|
+
!isTruncated && scope === "all" && !hasQuery && !options.poolRestricted
|
|
340
|
+
),
|
|
341
|
+
...Object.keys(tierHints).length > 0 ? { tierHints } : {},
|
|
342
|
+
credentialGroups: compacted.groups
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
function toDiscoverySafeAgentSummary(record2, options) {
|
|
346
|
+
const mergedOptions = record2?.publicRecordExists === true ? { ...options, publicRecordExists: true } : options;
|
|
347
|
+
return toSafeAgentSummary(record2, mergedOptions);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// packages/ai/agent/dispatchSpeedProvenance.ts
|
|
351
|
+
var record = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
352
|
+
function isServerDispatchSpeedSource(value, dialogId, userId) {
|
|
353
|
+
const dialog = record(value);
|
|
354
|
+
const proof = record(dialog.dispatchSpeedProvenance);
|
|
355
|
+
return proof.version === 1 && proof.source === "server-startAgentRun" && proof.userId === userId && record(dialog.runtimeBinding).tenantUserId === userId && dialog.id === dialogId;
|
|
356
|
+
}
|
|
357
|
+
function isLocalDispatchSpeedSource(value, dialogId, userId) {
|
|
358
|
+
const run = record(value);
|
|
359
|
+
const proof = record(run.dispatchSpeedProvenance);
|
|
360
|
+
return proof.version === 1 && proof.source === "cli-startAgentRun" && proof.userId === userId && typeof run.runId === "string" && run.runId.length > 0 && run.dialogId === dialogId && run.ephemeral !== true;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
export {
|
|
364
|
+
resolveDiscoveryScope,
|
|
365
|
+
isCallerAtFreePoolTop,
|
|
366
|
+
resolvePaginationArgs,
|
|
367
|
+
matchesAgentQuery,
|
|
368
|
+
buildAgentDiscoveryResult,
|
|
369
|
+
toDiscoverySafeAgentSummary,
|
|
370
|
+
isServerDispatchSpeedSource,
|
|
371
|
+
isLocalDispatchSpeedSource
|
|
372
|
+
};
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
patch,
|
|
7
7
|
read
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ADYWV732.js";
|
|
9
9
|
import {
|
|
10
10
|
DEVICE_LOCAL_OWNER_ID,
|
|
11
11
|
isDeviceLocalSpaceBody
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HPDLPEUG.js";
|
|
13
13
|
import {
|
|
14
14
|
selectIdentityUserId
|
|
15
15
|
} from "./chunk-PXYBUFDB.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
requireTokenUser
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EL5NRJHI.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveServerUrl
|
|
6
6
|
} from "./chunk-BIDSIRTS.js";
|
|
7
7
|
import {
|
|
8
8
|
t
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FEIVARWR.js";
|
|
10
10
|
|
|
11
11
|
// packages/cli/cliApiClient.ts
|
|
12
12
|
var CliApiError = class extends Error {
|
|
@@ -33,9 +33,10 @@ async function cliApiRequest(args) {
|
|
|
33
33
|
if (args.body !== void 0 && args.body !== null && method !== "GET") {
|
|
34
34
|
init.body = JSON.stringify(args.body);
|
|
35
35
|
}
|
|
36
|
+
const fetchFn = args.fetchImpl ?? fetch;
|
|
36
37
|
let response;
|
|
37
38
|
try {
|
|
38
|
-
response = await
|
|
39
|
+
response = await fetchFn(url, init);
|
|
39
40
|
} catch (error) {
|
|
40
41
|
throw new CliApiError(t("api.requestFailed", error.message), "NETWORK_ERROR", 0);
|
|
41
42
|
}
|
|
@@ -49,9 +50,10 @@ async function cliApiRequest(args) {
|
|
|
49
50
|
response.status
|
|
50
51
|
);
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const
|
|
53
|
+
const isSuccessEnvelope = data.success === true || data.ok === true;
|
|
54
|
+
if (!response.ok || !isSuccessEnvelope) {
|
|
55
|
+
const errorObj = typeof data.error === "object" && data.error !== null ? data.error : {};
|
|
56
|
+
const message = errorObj.message || (typeof data.error === "string" ? data.error : "") || data.message || t("api.requestFailedHttp", String(response.status));
|
|
55
57
|
const code = errorObj.code || `HTTP_${response.status}`;
|
|
56
58
|
throw new CliApiError(message, code, response.status);
|
|
57
59
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
deriveCredentialGroup
|
|
3
|
-
} from "./chunk-XCA4WHX5.js";
|
|
4
1
|
import {
|
|
5
2
|
listUserRecordsFromServers,
|
|
6
3
|
readLiveDbRecordAfterTombstoneMerge
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FZANZZ63.js";
|
|
8
5
|
import {
|
|
9
6
|
agentRecordHasConfiguredCredential
|
|
10
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UFGUJ2IH.js";
|
|
8
|
+
import {
|
|
9
|
+
deriveCredentialGroup
|
|
10
|
+
} from "./chunk-PNLDLUMO.js";
|
|
11
11
|
import {
|
|
12
12
|
isTombstoneRecord
|
|
13
13
|
} from "./chunk-BV3FLP2L.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
resolveAgentImageInputSupport
|
|
3
|
+
} from "./chunk-BZLGPM5B.js";
|
|
1
4
|
import {
|
|
2
5
|
TOOL_HAD_IMAGES,
|
|
3
6
|
hadToolImages
|
|
4
7
|
} from "./chunk-X4O7FJF5.js";
|
|
5
|
-
import {
|
|
6
|
-
resolveAgentImageInputSupport
|
|
7
|
-
} from "./chunk-SX6AWTNK.js";
|
|
8
8
|
import {
|
|
9
9
|
isCompleteInstructionOutput,
|
|
10
10
|
sanitizeToolOutputText,
|
|
11
11
|
scrubSecrets
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VH7UO6E5.js";
|
|
13
13
|
import {
|
|
14
14
|
asTrimmedString
|
|
15
15
|
} from "./chunk-3EUW3WEO.js";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-R5GO3YZP.js";
|
|
8
8
|
import {
|
|
9
9
|
getCliLocale
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-FEIVARWR.js";
|
|
11
11
|
import {
|
|
12
12
|
ANTIGRAVITY_AUTH_URL,
|
|
13
13
|
ANTIGRAVITY_CALLBACK_PATH,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
getAntigravityUserAgent,
|
|
22
22
|
normalizeAntigravityTokenPayload,
|
|
23
23
|
refreshAntigravityToken
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-6SOWMEAY.js";
|
|
25
25
|
import {
|
|
26
26
|
toErrorMessage
|
|
27
27
|
} from "./chunk-HNMXYYJR.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCliLocalMcpConnectionRevisionWriter,
|
|
3
3
|
getDefaultCliLocalRuntimeAuthority
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OQFOE4SJ.js";
|
|
5
5
|
import {
|
|
6
6
|
createStrictHostCredentialBroker
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-EHFBP6IK.js";
|
|
8
8
|
import {
|
|
9
9
|
parseMcpCallToolInput,
|
|
10
10
|
parseMcpConnectionWrite,
|
|
@@ -8098,7 +8098,10 @@ function createMcpNetworkPolicy(options) {
|
|
|
8098
8098
|
const url2 = urlOf(req ? req.url : String(input));
|
|
8099
8099
|
const signal = AbortSignal.any([...init?.signal ?? req?.signal ? [init?.signal ?? req.signal] : [], AbortSignal.timeout(timeoutMs)]);
|
|
8100
8100
|
signal?.throwIfAborted();
|
|
8101
|
-
|
|
8101
|
+
const isExactOperatorLoopback = Boolean(
|
|
8102
|
+
options.allowOperatorLoopback && url2.origin === saved.origin && (saved.hostname === "127.0.0.1" || saved.hostname === "[::1]" || saved.hostname === "::1")
|
|
8103
|
+
);
|
|
8104
|
+
if (options.placement.kind === "server" && url2.protocol !== "https:" && !isExactOperatorLoopback) throw new Error("network_denied");
|
|
8102
8105
|
const host = url2.hostname.replace(/^\[|\]$/g, "");
|
|
8103
8106
|
const addresses = isIP(host) ? [{ address: host, family: isIP(host) }] : await new Promise((done, reject) => {
|
|
8104
8107
|
const abort = () => reject(new Error(signal.reason?.name === "TimeoutError" ? "timeout" : "cancelled"));
|
|
@@ -8110,6 +8113,7 @@ function createMcpNetworkPolicy(options) {
|
|
|
8110
8113
|
for (const entry of addresses) {
|
|
8111
8114
|
if (entry.family !== isIP(entry.address) || !entry.family) throw new Error("network_denied");
|
|
8112
8115
|
if (isMcpPublicAddress(entry.address)) continue;
|
|
8116
|
+
if (isExactOperatorLoopback && (entry.address === "127.0.0.1" || entry.address === "::1")) continue;
|
|
8113
8117
|
const lan = new BlockList();
|
|
8114
8118
|
for (const [ip, bits] of [["10.0.0.0", 8], ["127.0.0.0", 8], ["172.16.0.0", 12], ["192.168.0.0", 16]]) lan.addSubnet(ip, bits, "ipv4");
|
|
8115
8119
|
lan.addAddress("::1", "ipv6");
|
|
@@ -33156,7 +33160,7 @@ function createMcpRemoteClient(deps) {
|
|
|
33156
33160
|
if (c.schemaVersion !== 1) return fail2("unsupported_version");
|
|
33157
33161
|
if (!sameMcpPlacement(c.placement, deps.placement)) return fail2("placement_unavailable");
|
|
33158
33162
|
if (c.transport.kind !== "streamable-http") return fail2("placement_unavailable");
|
|
33159
|
-
if (!c.enabled) return fail2("disabled");
|
|
33163
|
+
if (!c.enabled && !deps.discoverUnfiltered) return fail2("disabled");
|
|
33160
33164
|
if (c.ownerUserId !== context.authenticatedUserId) return fail2("forbidden");
|
|
33161
33165
|
if (context.signal.aborted) return fail2("cancelled");
|
|
33162
33166
|
const timeout = AbortSignal.timeout(limits.timeoutMs);
|
|
@@ -33185,7 +33189,7 @@ function createMcpRemoteClient(deps) {
|
|
|
33185
33189
|
if (!live.enabled) throw new Error("disabled");
|
|
33186
33190
|
if (live.revision !== c.revision) throw new Error("revision_conflict");
|
|
33187
33191
|
if (!permitsMcpRead(live, message.params?.name, message.params?.arguments ?? {})) throw new Error("forbidden");
|
|
33188
|
-
}, placement: deps.placement, savedEndpoint: endpoint, resolve: deps.resolveDns, timeoutMs: limits.timeoutMs, maxResponseBytes: limits.maxResponseBytes });
|
|
33192
|
+
}, placement: deps.placement, savedEndpoint: endpoint, resolve: deps.resolveDns, allowOperatorLoopback: deps.allowOperatorLoopback, timeoutMs: limits.timeoutMs, maxResponseBytes: limits.maxResponseBytes });
|
|
33189
33193
|
let networkError;
|
|
33190
33194
|
const fetch2 = async (input, init) => {
|
|
33191
33195
|
try {
|
|
@@ -33256,9 +33260,11 @@ function createMcpRemoteClient(deps) {
|
|
|
33256
33260
|
for (const tool of result.tools) {
|
|
33257
33261
|
if (!tool.name || tool.name.length > 256 || names.has(tool.name)) throw new Error("untrusted_schema");
|
|
33258
33262
|
names.add(tool.name);
|
|
33259
|
-
if (!
|
|
33260
|
-
|
|
33261
|
-
|
|
33263
|
+
if (!deps.discoverUnfiltered) {
|
|
33264
|
+
if (!permitsMcpRead(context.connection, tool.name)) continue;
|
|
33265
|
+
validator.getValidator(tool.inputSchema);
|
|
33266
|
+
if (tool.outputSchema) validator.getValidator(tool.outputSchema);
|
|
33267
|
+
}
|
|
33262
33268
|
tools.push({ name: tool.name, ...tool.description !== void 0 ? { description: tool.description } : {}, inputSchema: tool.inputSchema, ...tool.outputSchema !== void 0 ? { outputSchema: tool.outputSchema } : {}, ...tool.annotations !== void 0 ? { annotations: tool.annotations } : {} });
|
|
33263
33269
|
if (tools.length > limits.maxTools) throw new Error("limit_exceeded");
|
|
33264
33270
|
}
|
|
@@ -33299,6 +33305,7 @@ function createMcpRemoteClient(deps) {
|
|
|
33299
33305
|
});
|
|
33300
33306
|
},
|
|
33301
33307
|
async callTool(context, input) {
|
|
33308
|
+
if (deps.discoverUnfiltered) return fail2("forbidden");
|
|
33302
33309
|
const parsed = parseMcpCallToolInput(input);
|
|
33303
33310
|
if (!parsed.ok) return parsed;
|
|
33304
33311
|
input = parsed.value;
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-HNMXYYJR.js";
|
|
4
4
|
import {
|
|
5
5
|
trimTrailingSlash
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LVZVSLKO.js";
|
|
7
7
|
import {
|
|
8
8
|
asOptionalFiniteNumber
|
|
9
9
|
} from "./chunk-WWC7I6TA.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
qwenTokenPlanModels,
|
|
18
18
|
stepfunModels,
|
|
19
19
|
stepfunStepPlanModels
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-OKH74FML.js";
|
|
21
21
|
import {
|
|
22
22
|
asOptionalTrimmedString
|
|
23
23
|
} from "./chunk-G3SUCT4W.js";
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
PLATFORM_HOSTED_DEEPSEEK_FLASH_PEAK_PRICE,
|
|
27
27
|
PLATFORM_HOSTED_DEEPSEEK_PRO_OFF_PEAK_PRICE,
|
|
28
28
|
PLATFORM_HOSTED_DEEPSEEK_PRO_PEAK_PRICE
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-JPXACKSW.js";
|
|
30
30
|
import {
|
|
31
31
|
asTrimmedLowercaseString
|
|
32
32
|
} from "./chunk-QSJ3HFEF.js";
|
|
@@ -506,7 +506,7 @@ var SUBSCRIPTION_OAUTH_PROVIDERS = [
|
|
|
506
506
|
kind: "oauth",
|
|
507
507
|
id: "devin-oauth",
|
|
508
508
|
label: "Devin Pro",
|
|
509
|
-
description: "Devin Pro $20/\u6708\uFF1A\u65E5/\u5468 quota \u8986\u76D6 sessions/CLI/Desktop\uFF0C\u8D85\u989D\u6309 API \u4EF7\u8D2D credits
|
|
509
|
+
description: "Devin Pro $20/\u6708\uFF1A\u65E5/\u5468 quota \u8986\u76D6 sessions/CLI/Desktop\uFF0C\u8D85\u989D\u6309 API \u4EF7\u8D2D credits",
|
|
510
510
|
apiKeyRef: "devin",
|
|
511
511
|
provider: "devin",
|
|
512
512
|
defaultModel: "swe-2-max",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
patch
|
|
3
|
-
} from "./chunk-HZDK56EK.js";
|
|
4
1
|
import {
|
|
5
2
|
selectCurrentServer
|
|
6
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BZMDWGQQ.js";
|
|
4
|
+
import {
|
|
5
|
+
patch
|
|
6
|
+
} from "./chunk-ADYWV732.js";
|
|
7
7
|
import {
|
|
8
8
|
getIsDesktopApp
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HDKMVYNJ.js";
|
|
10
10
|
import {
|
|
11
11
|
selectIdentityToken
|
|
12
12
|
} from "./chunk-PXYBUFDB.js";
|