nolo-cli 0.211.0 → 0.212.0-alpha.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-VVQEOY3D.js → _executeModel-KE6MBNUJ.js} +51 -48
- package/{action-U235TV4P.js → action-DF5UYSJF.js} +4 -4
- package/{addContentAction-7C76J7ST.js → addContentAction-N2YC5IL3.js} +8 -8
- package/{addDialogAgentAction-KTYANUEC.js → addDialogAgentAction-3NKVQCEC.js} +15 -12
- package/{agentDeleteCommand-WHRU6VDJ.js → agentDeleteCommand-NWK7VU4N.js} +71 -67
- package/{agentEmailCommands-ALLHXPW3.js → agentEmailCommands-UZ4DHEX2.js} +77 -72
- package/{agentListCommands-POKMEKMS.js → agentListCommands-HE7L2A6L.js} +190 -77
- package/{agentMachineCommands-WJLZLBPI.js → agentMachineCommands-6TE4MBMP.js} +30 -29
- package/{agentProviderCommands-MN3ABDME.js → agentProviderCommands-Q5O33MED.js} +33 -4
- package/{agentRecordCommands-OULZW3KM.js → agentRecordCommands-L3QQ7HZ4.js} +66 -61
- package/{agentRunCommand-ZNG4LGNQ.js → agentRunCommand-2IFGQHCO.js} +68 -64
- package/{agentRunControl-AF7BMR22.js → agentRunControl-OI3LOENH.js} +7 -6
- package/{agentRuntimeLocal-YMUHFV5M.js → agentRuntimeLocal-HL526DNQ.js} +28 -25
- package/{agentSlice-WNGUIMQZ.js → agentSlice-TMYP2UEA.js} +12 -12
- package/{appDeleteCommands-6MXPLAVF.js → appDeleteCommands-ZERW4AXY.js} +30 -29
- package/{appDeployCommands-ERRSVASW.js → appDeployCommands-DUWSMYHL.js} +30 -29
- package/{appDeployStatusCommands-ULICISLI.js → appDeployStatusCommands-N2KIE4BF.js} +30 -29
- package/{appGetCommands-WYYYWROF.js → appGetCommands-YVR4NPVY.js} +30 -29
- package/{appListCommands-DFCUCRCV.js → appListCommands-JS6HOHZS.js} +30 -29
- package/{authCommand-ZJMWXFMA.js → authCommand-FE2C3ZUM.js} +14 -14
- package/{authCommands-WK6E42L2.js → authCommands-HV3EAU3V.js} +2 -2
- package/{builtinSkillRegistry-HH75G5J3.js → builtinSkillRegistry-3YOIGEF6.js} +5 -4
- package/{chunk-JKW6LERJ.js → chunk-22CIEBYO.js} +14 -14
- package/{chunk-6HVBI6TI.js → chunk-25JZEIXN.js} +1 -218
- package/{chunk-TRZP7JZ7.js → chunk-2QHFH3DR.js} +1 -0
- package/{chunk-4LEGTOSR.js → chunk-3AKFVZ2I.js} +1 -1
- package/{chunk-XE4Q46FF.js → chunk-3CGG2PAL.js} +1 -1
- package/{chunk-25M2K6OA.js → chunk-3FOQHGHN.js} +3 -3
- package/{chunk-BSISWVB4.js → chunk-4I7ERB7F.js} +1 -1
- package/{chunk-TCTSYFDM.js → chunk-4KH4J3G5.js} +19 -6
- package/{chunk-NEZGPBL7.js → chunk-5AQR3DGV.js} +2 -2
- package/{chunk-YLTLB5A7.js → chunk-5RYBGBQH.js} +7 -6
- package/{chunk-RIALQUSF.js → chunk-6NSSLV67.js} +5 -5
- package/{chunk-RXCCWVA2.js → chunk-6OQUPIQF.js} +3 -3
- package/chunk-6VLJ6YA7.js +11751 -0
- package/{chunk-27E2CBBY.js → chunk-7OCO4TDT.js} +1 -1
- package/chunk-7RFNTILS.js +2213 -0
- package/{chunk-4WCEC56C.js → chunk-AVTVGMDY.js} +1 -1
- package/{chunk-3J3U3KXB.js → chunk-B7NJ3T4A.js} +4 -4
- package/{chunk-UMEGDH6A.js → chunk-BFM34N54.js} +7 -7
- package/chunk-CJEIOP3E.js +0 -0
- package/{chunk-YXOBCDNW.js → chunk-CJRONOYL.js} +5 -5
- package/{chunk-LT3EAHJY.js → chunk-CQ46IRNN.js} +38 -36
- package/{chunk-NTSRCTUX.js → chunk-CTPXME7U.js} +2 -2
- package/{chunk-M4NTDZG3.js → chunk-D5RCRX4A.js} +134 -141
- package/{chunk-25OB36GU.js → chunk-DM6UMOEL.js} +4 -4
- package/{chunk-TPCDYNJK.js → chunk-EYUBHHFB.js} +1 -1
- package/{chunk-Y6M7KJOA.js → chunk-EZFQ6XRV.js} +2 -2
- package/{chunk-ZOO3WJIE.js → chunk-FHU44LN3.js} +711 -40
- package/chunk-FY7F4Q6X.js +127 -0
- package/chunk-G7MLNNEX.js +84 -0
- package/{chunk-RYWO5AKN.js → chunk-GNDJKC4B.js} +10 -10
- package/{chunk-V3M6IXQI.js → chunk-GPO7FCEZ.js} +187 -36
- package/{chunk-RQ22OZD7.js → chunk-H2TJUNCH.js} +1 -1
- package/{chunk-C2XZM3K4.js → chunk-HIRC32DV.js} +5 -24
- package/{chunk-QQM464AL.js → chunk-HPFCI4SK.js} +3 -3
- package/chunk-HRMJUN5J.js +26 -0
- package/{chunk-HD3WR3TD.js → chunk-IAPCBNEE.js} +1 -1
- package/{chunk-XDMGY5IU.js → chunk-IF45XG7K.js} +220 -9
- package/{chunk-NLT32XBZ.js → chunk-IIQ6JGRI.js} +2 -2
- package/{chunk-OP7PTBAJ.js → chunk-IJXYFTV7.js} +8 -8
- package/{chunk-IIHY4ZAI.js → chunk-INSBKSBB.js} +8 -4
- package/{chunk-PAFTGNWA.js → chunk-JIT6FSXJ.js} +1 -1
- package/{chunk-WTKYP6QO.js → chunk-JTDORD5P.js} +5 -5
- package/{chunk-ECX3NKRD.js → chunk-JY5NGFFH.js} +11 -0
- package/chunk-KC4XDTT3.js +227 -0
- package/{chunk-PLYWH7XM.js → chunk-KIM6CLW5.js} +7 -7
- package/{chunk-SCYQJPGA.js → chunk-M6RL5JCD.js} +147 -20
- package/chunk-MMA3LZ3W.js +105 -0
- package/{chunk-I5PBXF7O.js → chunk-MMNYUVLW.js} +1 -1
- package/{chunk-NHQKWPLP.js → chunk-NJR3WKVP.js} +24 -22
- package/{chunk-W5VC7F7V.js → chunk-NOMIGOST.js} +59 -60
- package/{chunk-WI6OGHXJ.js → chunk-NRFKLKRU.js} +5 -5
- package/{chunk-NXCGNS4N.js → chunk-OHNELDTO.js} +1 -1
- package/{chunk-7IYBN7IA.js → chunk-OOF4UPC5.js} +22 -13
- package/{chunk-UIOEHFF6.js → chunk-OQHIVPG4.js} +1 -0
- package/{chunk-X4F26D5K.js → chunk-P5L7CXOC.js} +58 -33
- package/{chunk-5ORJGHTL.js → chunk-PDGKOTO7.js} +5 -5
- package/{chunk-UCPAVEQB.js → chunk-PYRUW7XN.js} +1 -1
- package/{chunk-SU3QL7YG.js → chunk-QT6PKHYJ.js} +1 -1
- package/{chunk-SN5XE6GQ.js → chunk-RPQXPZZF.js} +4 -4
- package/{chunk-ZN5AH4BY.js → chunk-RU4SD66C.js} +6 -6
- package/{chunk-YKFP6UGT.js → chunk-SOHTHFV2.js} +14 -14
- package/{chunk-CKOO42G5.js → chunk-UHJGXRJ4.js} +4 -4
- package/{chunk-CVCRAO6Q.js → chunk-UTV2AYEG.js} +9 -7
- package/{chunk-DQLB4NQ3.js → chunk-VPAZOH2D.js} +2 -2
- package/{chunk-MBS6CTZB.js → chunk-VZKUKCA6.js} +236 -1993
- package/{chunk-LNYHAKBP.js → chunk-W4S457LU.js} +1 -1
- package/chunk-WPORQFYN.js +74 -0
- package/{chunk-ET2CWLIJ.js → chunk-WXYLV624.js} +3 -3
- package/chunk-XFYFMTOM.js +92 -0
- package/{chunk-NV572QM3.js → chunk-YJMRHHGY.js} +15 -15
- package/{chunk-JBOUVTZX.js → chunk-YOIW77S2.js} +13 -2
- package/{chunk-ADBWFYJD.js → chunk-YPD3VJZW.js} +9 -9
- package/{chunk-DA7CTWT4.js → chunk-YWSEPJ7C.js} +5 -5
- package/{chunk-3V2QMRNN.js → chunk-ZL5RAEEB.js} +3 -3
- package/cliAgentConfigHelpers-WJBZQTLW.js +41 -0
- package/{commandRegistry-FI2IOQ3U.js → commandRegistry-VVMTPFAX.js} +85 -81
- package/{contentThunks-5LKNNDGY.js → contentThunks-N52O67MI.js} +25 -24
- package/{createAgentAutomationAction-TI4QG4CY.js → createAgentAutomationAction-ZC57YRSV.js} +25 -24
- package/{createDialogAction-TJ3JKLO4.js → createDialogAction-VQW5WDYX.js} +27 -26
- package/{createPageAction-GKXT6WEH.js → createPageAction-M5VDA7SC.js} +26 -25
- package/{dbSlice-LPMZ2DGJ.js → dbSlice-HP7G4LX3.js} +7 -7
- package/{deleteFile-EPUQHKPA.js → deleteFile-7VQGLK2V.js} +3 -3
- package/{dialogCommands-IWPXIZ5P.js → dialogCommands-JHMR2N2Y.js} +32 -30
- package/{dialogSlice-ZWNNS7GZ.js → dialogSlice-GRSVGDTF.js} +23 -22
- package/{dialogUsageCommand-ZCPPHPJ5.js → dialogUsageCommand-7KCPYGHG.js} +1 -1
- package/{docCreateCommands-HFSPKJSI.js → docCreateCommands-F2K3UPSQ.js} +28 -27
- package/{docDeleteCommands-CRL62POH.js → docDeleteCommands-XGXB5RFT.js} +29 -28
- package/{docReadCommands-QOTOX3XW.js → docReadCommands-7HWZZV6J.js} +28 -27
- package/{docStore-WYLRB7ED.js → docStore-KNZK6Y2G.js} +10 -10
- package/{docUpdateCommands-7BMH4MCA.js → docUpdateCommands-OZZ7NQII.js} +28 -27
- package/{fetchMessages-YY4SATNR.js → fetchMessages-M3QU7ZCQ.js} +1 -1
- package/{getPricing-OQXBJ6VZ.js → getPricing-2MNMXEVG.js} +3 -3
- package/{handleSendMessageAction-P27YP2DQ.js → handleSendMessageAction-SHIH74GJ.js} +46 -44
- package/hostCredentialCreate-X64WK4JD.js +357 -0
- package/index.js +5 -5
- package/{keys-P4ZDOVJW.js → keys-BEGDOTRL.js} +3 -1
- package/{localDialogRead-5VCMQQZF.js → localDialogRead-XRLAH4CZ.js} +1 -1
- package/{localRuntimeAdapter-GP6ZSSO3.js → localRuntimeAdapter-A7K3ABA6.js} +73 -66
- package/{machineCommands-6Z6H4BFX.js → machineCommands-DE3MR7CJ.js} +65 -60
- package/{machineWsRunDispatch-F2ZIXMYM.js → machineWsRunDispatch-R26P5V36.js} +65 -60
- package/{memberThunks-YSEFJF47.js → memberThunks-7WJAY5V6.js} +8 -8
- package/package.json +1 -1
- package/{projectArchive-PIGEOX3D.js → projectArchive-GGL5HLMD.js} +26 -25
- package/{providerPresetApply-ZYMLQA46.js → providerPresetApply-YXGV6NXB.js} +4 -4
- package/{providerRegistry-E34XWDLJ.js → providerRegistry-S6UL6UNA.js} +4 -4
- package/{read-DIIQBOOO.js → read-4VZQODSN.js} +3 -3
- package/{readDocTool-HXYGOEA7.js → readDocTool-AVD32RUJ.js} +1 -1
- package/{readlineWorkspace-UG25G7KC.js → readlineWorkspace-XKYKNL2I.js} +157 -100
- package/{removeDialogAgentAction-ALJDUJ2E.js → removeDialogAgentAction-FKL4BYMR.js} +17 -14
- package/{runAgentClientLoop-IO5F7TCZ.js → runAgentClientLoop-V7E2WBVM.js} +49 -46
- package/{runtimeDoctorCommands-PGAA47G5.js → runtimeDoctorCommands-QAI3MBKQ.js} +6 -6
- package/{secretCommands-ZCZ4KVET.js → secretCommands-4QS3HCA2.js} +3 -3
- package/{setDialogExtraReferencesAction-O3SVMD5A.js → setDialogExtraReferencesAction-TLIOLWWI.js} +10 -10
- package/{setPrimaryDialogAgentAction-HE7RVFFF.js → setPrimaryDialogAgentAction-2OLWRFYR.js} +18 -15
- package/{settingThunks-BWWJQG4L.js → settingThunks-UGBPCNYF.js} +12 -11
- package/{spaceCommands-UAELIFEI.js → spaceCommands-4KSLKVNF.js} +28 -27
- package/{streamAgentChatTurn-VUKZQYJR.js → streamAgentChatTurn-7FR7X2NU.js} +57 -54
- package/{switchDialogAgentAction-3VZS7SOS.js → switchDialogAgentAction-UZSAG2N5.js} +15 -12
- package/{tools-VRXJAVYI.js → tools-ZLKCC25W.js} +43 -40
- package/{tuiSummaryLlmCaller-TGCHZLSW.js → tuiSummaryLlmCaller-WC54MVGP.js} +10 -10
- package/{updateCommands-Q6CYAEYJ.js → updateCommands-4744PL3P.js} +3 -1
- package/{updateDialogTitleAction-MULWCJCW.js → updateDialogTitleAction-U53ZT7PJ.js} +38 -70
- package/usageCommand-F4IPVMIZ.js +32 -0
- package/usageRebuildCommand-HAW2AD5N.js +626 -0
- package/chunk-4LCOCOR5.js +0 -50
- package/chunk-7AUQ3WCW.js +0 -51
- package/chunk-ZRAU6T47.js +0 -56
- package/{agentFavoriteCommands-GAFEXKKP.js → agentFavoriteCommands-EDK743YA.js} +1 -1
- package/{agentGrantCommands-V5FOQKFD.js → agentGrantCommands-RQWK2TEV.js} +1 -1
- package/{agentPullCommand-2JMJP5BS.js → agentPullCommand-6EM3URVK.js} +1 -1
- package/{chunk-BTYQAODF.js → chunk-CZM5YTZ7.js} +3 -3
- package/{chunk-A2ZMIRLN.js → chunk-INN4LTAJ.js} +5 -5
- package/{chunk-XPHZK3PJ.js → chunk-JNKSDZFS.js} +3 -3
- package/{chunk-PV6JJAUB.js → chunk-TCZHTTUU.js} +8 -8
- package/{chunk-AKE53VMW.js → chunk-ZCWRMUWT.js} +0 -0
- package/{tableCommands-D7WR4QSM.js → tableCommands-MP6VFSVT.js} +3 -3
|
@@ -10,61 +10,60 @@ import {
|
|
|
10
10
|
listRemotePublicAgents,
|
|
11
11
|
normalizeListedAgent,
|
|
12
12
|
parseAgentListArgs
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import {
|
|
15
|
-
refreshSubscriptionQuotas
|
|
16
|
-
} from "./chunk-YGILMZ7N.js";
|
|
13
|
+
} from "./chunk-WXYLV624.js";
|
|
17
14
|
import {
|
|
18
15
|
buildSpaceLookup,
|
|
19
16
|
getSpaceContentKeys
|
|
20
17
|
} from "./chunk-ID4G2MAR.js";
|
|
21
18
|
import {
|
|
22
19
|
readLiveDbRecordAfterTombstoneMerge
|
|
23
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-3AKFVZ2I.js";
|
|
21
|
+
import {
|
|
22
|
+
refreshSubscriptionQuotas
|
|
23
|
+
} from "./chunk-YGILMZ7N.js";
|
|
24
24
|
import {
|
|
25
25
|
getReadableCliDb
|
|
26
26
|
} from "./chunk-J5JTMQIA.js";
|
|
27
|
-
import {
|
|
28
|
-
queryUserRecords,
|
|
29
|
-
readDbRecord
|
|
30
|
-
} from "./chunk-XDMGY5IU.js";
|
|
31
27
|
import {
|
|
32
28
|
applyCredentialAvailability,
|
|
33
29
|
clearCredentialAvailabilityIfMarkedAt,
|
|
34
30
|
readCredentialAvailability,
|
|
35
31
|
readEffectiveCredentialEntry
|
|
36
32
|
} from "./chunk-GSQNH63I.js";
|
|
37
|
-
import
|
|
38
|
-
|
|
33
|
+
import {
|
|
34
|
+
queryUserRecords,
|
|
35
|
+
readDbRecord
|
|
36
|
+
} from "./chunk-IF45XG7K.js";
|
|
39
37
|
import "./chunk-LKZPX6YH.js";
|
|
38
|
+
import "./chunk-NBTY7YJF.js";
|
|
40
39
|
import {
|
|
41
40
|
buildAgentDiscoveryResult,
|
|
42
41
|
matchesAgentQuery,
|
|
43
42
|
resolvePaginationArgs,
|
|
44
43
|
summarizeCredentialGroups,
|
|
45
44
|
toDiscoverySafeAgentSummary
|
|
46
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-CJRONOYL.js";
|
|
47
46
|
import "./chunk-OXME3PEE.js";
|
|
48
47
|
import {
|
|
49
48
|
resolveNoloHome
|
|
50
49
|
} from "./chunk-GLKOYSRU.js";
|
|
51
50
|
import "./chunk-UEILX4EV.js";
|
|
52
51
|
import "./chunk-D2MDMY2M.js";
|
|
53
|
-
import "./chunk-
|
|
52
|
+
import "./chunk-FHU44LN3.js";
|
|
54
53
|
import "./chunk-ZNFJWEN4.js";
|
|
55
|
-
import "./chunk-
|
|
56
|
-
import "./chunk-
|
|
54
|
+
import "./chunk-4KH4J3G5.js";
|
|
55
|
+
import "./chunk-CTPXME7U.js";
|
|
57
56
|
import "./chunk-HNUWUO75.js";
|
|
58
57
|
import "./chunk-CHOZJMJS.js";
|
|
59
58
|
import "./chunk-PWTNI4N7.js";
|
|
60
59
|
import "./chunk-Y63ZSOR6.js";
|
|
61
|
-
import "./chunk-
|
|
60
|
+
import "./chunk-W4S457LU.js";
|
|
62
61
|
import "./chunk-4KB6WQUL.js";
|
|
63
62
|
import "./chunk-56GBUMO5.js";
|
|
64
|
-
import "./chunk-
|
|
65
|
-
import "./chunk-
|
|
63
|
+
import "./chunk-NOMIGOST.js";
|
|
64
|
+
import "./chunk-UTV2AYEG.js";
|
|
66
65
|
import "./chunk-E2BESSAW.js";
|
|
67
|
-
import "./chunk-
|
|
66
|
+
import "./chunk-25JZEIXN.js";
|
|
68
67
|
import {
|
|
69
68
|
DEFAULT_PROVIDER_RETRY_MS,
|
|
70
69
|
formatQuotaSummary,
|
|
@@ -74,34 +73,35 @@ import {
|
|
|
74
73
|
resolveCredentialKeyWithFallback,
|
|
75
74
|
shouldClearCooldownFromQuota
|
|
76
75
|
} from "./chunk-YUXQAVRD.js";
|
|
76
|
+
import "./chunk-KC4XDTT3.js";
|
|
77
77
|
import "./chunk-2WZXXAQD.js";
|
|
78
|
-
import "./chunk-
|
|
78
|
+
import "./chunk-YWSEPJ7C.js";
|
|
79
79
|
import "./chunk-WJZOQR2J.js";
|
|
80
|
-
import "./chunk-
|
|
80
|
+
import "./chunk-UHJGXRJ4.js";
|
|
81
81
|
import "./chunk-2MBTWINN.js";
|
|
82
|
-
import "./chunk-
|
|
83
|
-
import "./chunk-
|
|
84
|
-
import "./chunk-BTYQAODF.js";
|
|
82
|
+
import "./chunk-JTDORD5P.js";
|
|
83
|
+
import "./chunk-CZM5YTZ7.js";
|
|
85
84
|
import "./chunk-H57T64RA.js";
|
|
85
|
+
import "./chunk-5ZUL4CUO.js";
|
|
86
86
|
import "./chunk-UKZX3NHN.js";
|
|
87
87
|
import "./chunk-5MMAK75Q.js";
|
|
88
|
-
import "./chunk-
|
|
89
|
-
import "./chunk-
|
|
88
|
+
import "./chunk-2QHFH3DR.js";
|
|
89
|
+
import "./chunk-OQHIVPG4.js";
|
|
90
90
|
import "./chunk-KX6YBIHG.js";
|
|
91
91
|
import "./chunk-DWLEOOGR.js";
|
|
92
92
|
import "./chunk-7DPNBQSV.js";
|
|
93
|
-
import "./chunk-
|
|
93
|
+
import "./chunk-T43B7LB2.js";
|
|
94
94
|
import "./chunk-ZRSNONOB.js";
|
|
95
95
|
import "./chunk-4VJAC32I.js";
|
|
96
|
-
import "./chunk-
|
|
96
|
+
import "./chunk-CJEIOP3E.js";
|
|
97
|
+
import "./chunk-ZCWRMUWT.js";
|
|
97
98
|
import "./chunk-ZC3CMUKU.js";
|
|
98
99
|
import "./chunk-LOEO7LRC.js";
|
|
99
100
|
import "./chunk-M2EJHDJP.js";
|
|
100
|
-
import "./chunk-
|
|
101
|
-
import "./chunk-
|
|
101
|
+
import "./chunk-KIM6CLW5.js";
|
|
102
|
+
import "./chunk-JNKSDZFS.js";
|
|
102
103
|
import "./chunk-PSCNXBYA.js";
|
|
103
|
-
import "./chunk-
|
|
104
|
-
import "./chunk-PV6JJAUB.js";
|
|
104
|
+
import "./chunk-TCZHTTUU.js";
|
|
105
105
|
import "./chunk-YUA6OAH5.js";
|
|
106
106
|
import "./chunk-SM3NSZJV.js";
|
|
107
107
|
import "./chunk-JRTNUU5Z.js";
|
|
@@ -109,6 +109,8 @@ import {
|
|
|
109
109
|
toErrorMessage
|
|
110
110
|
} from "./chunk-HNMXYYJR.js";
|
|
111
111
|
import "./chunk-KUG52IAP.js";
|
|
112
|
+
import "./chunk-GOO6G4PY.js";
|
|
113
|
+
import "./chunk-QSJ3HFEF.js";
|
|
112
114
|
import {
|
|
113
115
|
parseUserIdFromAuthToken,
|
|
114
116
|
readOption,
|
|
@@ -124,25 +126,25 @@ import "./chunk-4O22PGNQ.js";
|
|
|
124
126
|
import {
|
|
125
127
|
t
|
|
126
128
|
} from "./chunk-3RQVYR4B.js";
|
|
129
|
+
import "./chunk-G7Y4GXTY.js";
|
|
130
|
+
import "./chunk-6UBGXX2W.js";
|
|
127
131
|
import {
|
|
128
132
|
createKey,
|
|
129
133
|
createTokenKey
|
|
130
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-JY5NGFFH.js";
|
|
131
135
|
import "./chunk-XJWWBO34.js";
|
|
132
136
|
import "./chunk-I42VC5KR.js";
|
|
133
137
|
import "./chunk-U6VC4MU4.js";
|
|
134
138
|
import "./chunk-WWC7I6TA.js";
|
|
135
139
|
import "./chunk-3EUW3WEO.js";
|
|
136
140
|
import "./chunk-G3SUCT4W.js";
|
|
137
|
-
import "./chunk-T43B7LB2.js";
|
|
138
|
-
import "./chunk-GOO6G4PY.js";
|
|
139
|
-
import "./chunk-QSJ3HFEF.js";
|
|
140
141
|
import "./chunk-4VNS5WPM.js";
|
|
141
142
|
|
|
142
143
|
// packages/ai/agent/speedSampleCache.ts
|
|
143
144
|
var SPEED_SAMPLE_DISK_CACHE_TTL_MS = 10 * 6e4;
|
|
144
|
-
var SPEED_SAMPLE_SCAN_BUDGET_MS =
|
|
145
|
-
var SPEED_SAMPLE_CACHE_VERSION =
|
|
145
|
+
var SPEED_SAMPLE_SCAN_BUDGET_MS = 2500;
|
|
146
|
+
var SPEED_SAMPLE_CACHE_VERSION = 2;
|
|
147
|
+
var SPEED_SAMPLE_LEGACY_CACHE_VERSION = 1;
|
|
146
148
|
var isFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value);
|
|
147
149
|
var sanitizeSample = (value) => {
|
|
148
150
|
if (!value || typeof value !== "object") return null;
|
|
@@ -151,23 +153,25 @@ var sanitizeSample = (value) => {
|
|
|
151
153
|
if (isFiniteNumber(sample.firstOutputMs)) clean.firstOutputMs = sample.firstOutputMs;
|
|
152
154
|
if (isFiniteNumber(sample.callDurationMs)) clean.callDurationMs = sample.callDurationMs;
|
|
153
155
|
if (isFiniteNumber(sample.output_tokens)) clean.output_tokens = sample.output_tokens;
|
|
156
|
+
if (isFiniteNumber(sample.t)) clean.t = sample.t;
|
|
154
157
|
return clean.firstOutputMs === void 0 && clean.callDurationMs === void 0 ? null : clean;
|
|
155
158
|
};
|
|
156
|
-
|
|
157
|
-
|
|
159
|
+
var SPEED_SAMPLE_STALE_SNAPSHOT_MAX_MS = 7 * 24 * 60 * 6e4;
|
|
160
|
+
async function parseCacheFile(cachePath, userId) {
|
|
158
161
|
try {
|
|
159
162
|
const fs = await import("node:fs/promises");
|
|
160
163
|
const raw = await fs.readFile(cachePath, "utf8");
|
|
161
164
|
const parsed = JSON.parse(raw);
|
|
162
165
|
if (!parsed || typeof parsed !== "object") return null;
|
|
163
|
-
|
|
164
|
-
if (
|
|
166
|
+
const version = parsed.version;
|
|
167
|
+
if (version !== SPEED_SAMPLE_CACHE_VERSION && version !== SPEED_SAMPLE_LEGACY_CACHE_VERSION) {
|
|
168
|
+
return null;
|
|
169
|
+
}
|
|
170
|
+
if (parsed.userId !== userId) return null;
|
|
165
171
|
if (!isFiniteNumber(parsed.at)) return null;
|
|
166
|
-
const age = options.now - parsed.at;
|
|
167
|
-
if (age < 0 || age >= ttlMs) return null;
|
|
168
|
-
const samples = /* @__PURE__ */ new Map();
|
|
169
172
|
const source = parsed.samples;
|
|
170
173
|
if (!source || typeof source !== "object") return null;
|
|
174
|
+
const samples = /* @__PURE__ */ new Map();
|
|
171
175
|
for (const [model, list] of Object.entries(source)) {
|
|
172
176
|
if (!model || !Array.isArray(list)) continue;
|
|
173
177
|
const cleaned = [];
|
|
@@ -177,17 +181,42 @@ async function readSpeedSamplesCache(cachePath, options) {
|
|
|
177
181
|
}
|
|
178
182
|
samples.set(model, cleaned);
|
|
179
183
|
}
|
|
180
|
-
|
|
184
|
+
const complete = version === SPEED_SAMPLE_LEGACY_CACHE_VERSION ? true : parsed.complete === true;
|
|
185
|
+
const cursor = typeof parsed.cursor === "string" && parsed.cursor.length > 0 ? parsed.cursor : void 0;
|
|
186
|
+
return { samples, at: parsed.at, complete, cursor: complete ? void 0 : cursor };
|
|
181
187
|
} catch {
|
|
182
188
|
return null;
|
|
183
189
|
}
|
|
184
190
|
}
|
|
191
|
+
async function readSpeedSamplesSnapshot(cachePath, options) {
|
|
192
|
+
const maxAgeMs = isFiniteNumber(options.maxAgeMs) ? options.maxAgeMs : SPEED_SAMPLE_STALE_SNAPSHOT_MAX_MS;
|
|
193
|
+
const parsed = await parseCacheFile(cachePath, options.userId);
|
|
194
|
+
if (!parsed || !parsed.complete) return null;
|
|
195
|
+
const age = options.now - parsed.at;
|
|
196
|
+
if (age < 0 || age >= maxAgeMs) return null;
|
|
197
|
+
return { samples: parsed.samples, ageMs: age };
|
|
198
|
+
}
|
|
199
|
+
async function readSpeedSamplesProgress(cachePath, userId) {
|
|
200
|
+
const parsed = await parseCacheFile(cachePath, userId);
|
|
201
|
+
if (!parsed) return null;
|
|
202
|
+
return {
|
|
203
|
+
samples: parsed.samples,
|
|
204
|
+
at: parsed.at,
|
|
205
|
+
complete: parsed.complete,
|
|
206
|
+
...parsed.cursor === void 0 ? {} : { cursor: parsed.cursor }
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
function resolveSpeedSamplesProgressPath(cachePath) {
|
|
210
|
+
return `${cachePath}.progress`;
|
|
211
|
+
}
|
|
185
212
|
async function writeSpeedSamplesCache(cachePath, payload) {
|
|
186
213
|
try {
|
|
187
214
|
const fs = await import("node:fs/promises");
|
|
188
215
|
const path2 = await import("node:path");
|
|
189
216
|
await fs.mkdir(path2.dirname(cachePath), { recursive: true });
|
|
190
|
-
|
|
217
|
+
const tmpPath = `${cachePath}.tmp-${process.pid}-${Math.random().toString(36).slice(2, 8)}`;
|
|
218
|
+
await fs.writeFile(tmpPath, JSON.stringify(payload), "utf8");
|
|
219
|
+
await fs.rename(tmpPath, cachePath);
|
|
191
220
|
} catch {
|
|
192
221
|
}
|
|
193
222
|
}
|
|
@@ -242,18 +271,28 @@ function resolveCandidateSpeedFacts(models, samplesByModel) {
|
|
|
242
271
|
}
|
|
243
272
|
var formatSeconds = (ms) => `${(ms / 1e3).toFixed(1)}s`;
|
|
244
273
|
var formatTps = (tps) => String(Math.round(tps));
|
|
245
|
-
var SPEED_CONTEXT_HEADER = "speed (observed=\u672C\u7528\u6237\
|
|
246
|
-
function
|
|
274
|
+
var SPEED_CONTEXT_HEADER = "speed (observed=\u672C\u7528\u6237\u5B9E\u6D4B\u8C03\u7528\u4E2D\u4F4D\u6570, firstOutput \u542B\u63A8\u7406\u8F93\u51FA; tps=generation\uFF08\u4E0D\u542B\u7AEF\u5230\u7AEF\u53E3\u5F84\uFF09, tps=n/a \u8868\u793A\u65E0\u53EF\u4FE1\u541E\u5410\u6837\u672C\u3002\u672A\u5217\u51FA\u7684 model \u8868\u793A\u6CA1\u6709\u5B9E\u6D4B\u6837\u672C\uFF0C\u4E0D\u4EE3\u8868\u6162):";
|
|
275
|
+
function formatSnapshotAge(ageMs) {
|
|
276
|
+
const minutes = Math.floor(ageMs / 6e4);
|
|
277
|
+
if (minutes < 1) return "<1min";
|
|
278
|
+
if (minutes < 60) return `${minutes}min`;
|
|
279
|
+
const hours = Math.floor(minutes / 60);
|
|
280
|
+
if (hours < 24) return `${hours}h`;
|
|
281
|
+
return `${Math.floor(hours / 24)}d`;
|
|
282
|
+
}
|
|
283
|
+
function formatCandidateSpeedFacts(facts, options = {}) {
|
|
247
284
|
if (facts.length === 0) return null;
|
|
248
285
|
const lines = facts.map((fact) => {
|
|
249
286
|
const tps = fact.outputTps !== void 0 ? formatTps(fact.outputTps) : "n/a";
|
|
250
287
|
return ` ${fact.model}: firstOutput=${formatSeconds(fact.firstOutputMs ?? 0)} tps=${tps} [observed n=${fact.firstOutputSamples ?? 0} tpsN=${fact.tpsSamples ?? 0}]`;
|
|
251
288
|
});
|
|
252
|
-
|
|
289
|
+
const age = options.snapshotAgeMs;
|
|
290
|
+
const note = typeof age === "number" && age > 0 ? ` (snapshot=${formatSnapshotAge(age)}\u524D\u91C7\u96C6\u7684\u5B8C\u6574\u7A97\u53E3, \u975E\u672C\u6B21\u5B9E\u65F6\u626B\u63CF)` : "";
|
|
291
|
+
return `${SPEED_CONTEXT_HEADER}${note}
|
|
253
292
|
${lines.join("\n")}`;
|
|
254
293
|
}
|
|
255
|
-
function buildCandidateSpeedContext(models, samplesByModel) {
|
|
256
|
-
return formatCandidateSpeedFacts(resolveCandidateSpeedFacts(models, samplesByModel));
|
|
294
|
+
function buildCandidateSpeedContext(models, samplesByModel, options = {}) {
|
|
295
|
+
return formatCandidateSpeedFacts(resolveCandidateSpeedFacts(models, samplesByModel), options);
|
|
257
296
|
}
|
|
258
297
|
var SPEED_SAMPLE_PAGE_SIZE = 2e3;
|
|
259
298
|
var eventTime = (value) => {
|
|
@@ -275,13 +314,14 @@ function collectSample(collected, value) {
|
|
|
275
314
|
});
|
|
276
315
|
collected.set(model, list);
|
|
277
316
|
}
|
|
278
|
-
function finalizeSamples(collected) {
|
|
317
|
+
function finalizeSamples(collected, keepTime = false) {
|
|
279
318
|
const result = /* @__PURE__ */ new Map();
|
|
280
319
|
for (const [model, list] of collected) {
|
|
281
320
|
list.sort((a, b) => b.t - a.t);
|
|
321
|
+
const window = list.slice(0, OBSERVED_SPEED_WINDOW);
|
|
282
322
|
result.set(
|
|
283
323
|
model,
|
|
284
|
-
|
|
324
|
+
keepTime ? window : window.map(({ t: _t, ...sample }) => sample)
|
|
285
325
|
);
|
|
286
326
|
}
|
|
287
327
|
return result;
|
|
@@ -293,8 +333,9 @@ async function collectRecentSpeedSamples(db, userId, options = {}) {
|
|
|
293
333
|
const failedPrefix = createKey("token", userId, "failed-call", "");
|
|
294
334
|
const collected = /* @__PURE__ */ new Map();
|
|
295
335
|
const startedAt = Date.now();
|
|
296
|
-
let lastKey;
|
|
336
|
+
let lastKey = options.startAfter;
|
|
297
337
|
let budgetExhausted = false;
|
|
338
|
+
let scanned = 0;
|
|
298
339
|
while (true) {
|
|
299
340
|
if (Date.now() - startedAt >= budgetMs) {
|
|
300
341
|
budgetExhausted = true;
|
|
@@ -311,6 +352,7 @@ async function collectRecentSpeedSamples(db, userId, options = {}) {
|
|
|
311
352
|
if (typeof key !== "string") continue;
|
|
312
353
|
if (lastKey !== void 0 && key <= lastKey) continue;
|
|
313
354
|
accepted += 1;
|
|
355
|
+
scanned += 1;
|
|
314
356
|
newestKey = key;
|
|
315
357
|
if (key.startsWith(failedPrefix)) continue;
|
|
316
358
|
if (!raw || typeof raw !== "object") continue;
|
|
@@ -319,31 +361,75 @@ async function collectRecentSpeedSamples(db, userId, options = {}) {
|
|
|
319
361
|
if (accepted === 0 || accepted < pageSize) break;
|
|
320
362
|
lastKey = newestKey;
|
|
321
363
|
}
|
|
322
|
-
return {
|
|
364
|
+
return {
|
|
365
|
+
samples: finalizeSamples(collected, options.keepTime === true),
|
|
366
|
+
budgetExhausted,
|
|
367
|
+
scanned,
|
|
368
|
+
...budgetExhausted && lastKey !== void 0 ? { nextCursor: lastKey } : {}
|
|
369
|
+
};
|
|
323
370
|
}
|
|
324
|
-
|
|
325
|
-
const
|
|
326
|
-
|
|
371
|
+
function mergeNewestSamples(into, from) {
|
|
372
|
+
for (const [model, list] of from) {
|
|
373
|
+
const merged = [...into.get(model) ?? [], ...list];
|
|
374
|
+
merged.sort(
|
|
375
|
+
(a, b) => (b.t ?? 0) - (a.t ?? 0)
|
|
376
|
+
);
|
|
377
|
+
into.set(model, merged.slice(0, OBSERVED_SPEED_WINDOW));
|
|
378
|
+
}
|
|
327
379
|
}
|
|
328
380
|
async function loadSpeedSamplesWithDiskCache(db, userId, now, cache) {
|
|
329
381
|
try {
|
|
330
382
|
const ttlMs = isFiniteNumber2(cache.ttlMs) ? cache.ttlMs : SPEED_SAMPLE_DISK_CACHE_TTL_MS;
|
|
331
|
-
const
|
|
332
|
-
if (
|
|
333
|
-
const
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
383
|
+
const snapshot = await readSpeedSamplesSnapshot(cache.cachePath, { userId, now });
|
|
384
|
+
if (snapshot && snapshot.ageMs < ttlMs) return { samples: snapshot.samples };
|
|
385
|
+
const progressPath = resolveSpeedSamplesProgressPath(cache.cachePath);
|
|
386
|
+
const progress = await readSpeedSamplesProgress(progressPath, userId);
|
|
387
|
+
const resumable = progress && !progress.complete && progress.cursor ? progress : void 0;
|
|
388
|
+
const collected = new Map(resumable?.samples ?? []);
|
|
389
|
+
let step;
|
|
390
|
+
try {
|
|
391
|
+
step = await collectRecentSpeedSamples(db, userId, {
|
|
392
|
+
pageSize: cache.pageSize,
|
|
393
|
+
budgetMs: isFiniteNumber2(cache.budgetMs) ? cache.budgetMs : SPEED_SAMPLE_SCAN_BUDGET_MS,
|
|
394
|
+
keepTime: true,
|
|
395
|
+
...resumable?.cursor ? { startAfter: resumable.cursor } : {}
|
|
396
|
+
});
|
|
397
|
+
} catch {
|
|
398
|
+
return snapshot ? { samples: snapshot.samples, snapshotAgeMs: snapshot.ageMs } : { samples: /* @__PURE__ */ new Map() };
|
|
399
|
+
}
|
|
400
|
+
if (!resumable && step.scanned === 0 && !step.budgetExhausted) {
|
|
401
|
+
return snapshot ? { samples: snapshot.samples, snapshotAgeMs: snapshot.ageMs } : { samples: /* @__PURE__ */ new Map() };
|
|
402
|
+
}
|
|
403
|
+
mergeNewestSamples(collected, step.samples);
|
|
404
|
+
if (!step.budgetExhausted) {
|
|
405
|
+
await writeSpeedSamplesCache(cache.cachePath, {
|
|
406
|
+
version: SPEED_SAMPLE_CACHE_VERSION,
|
|
407
|
+
userId,
|
|
408
|
+
at: now,
|
|
409
|
+
complete: true,
|
|
410
|
+
samples: Object.fromEntries(collected)
|
|
411
|
+
});
|
|
412
|
+
await writeSpeedSamplesCache(progressPath, {
|
|
413
|
+
version: SPEED_SAMPLE_CACHE_VERSION,
|
|
414
|
+
userId,
|
|
415
|
+
at: now,
|
|
416
|
+
complete: true,
|
|
417
|
+
samples: {}
|
|
418
|
+
});
|
|
419
|
+
return { samples: collected };
|
|
420
|
+
}
|
|
421
|
+
await writeSpeedSamplesCache(progressPath, {
|
|
339
422
|
version: SPEED_SAMPLE_CACHE_VERSION,
|
|
340
423
|
userId,
|
|
341
|
-
|
|
342
|
-
|
|
424
|
+
// Progress keeps the cycle's collection start so a later stale label stays honest.
|
|
425
|
+
at: resumable?.at ?? now,
|
|
426
|
+
complete: false,
|
|
427
|
+
samples: Object.fromEntries(collected),
|
|
428
|
+
...step.nextCursor ? { cursor: step.nextCursor } : {}
|
|
343
429
|
});
|
|
344
|
-
return samples;
|
|
430
|
+
return snapshot ? { samples: snapshot.samples, snapshotAgeMs: snapshot.ageMs } : { samples: /* @__PURE__ */ new Map() };
|
|
345
431
|
} catch {
|
|
346
|
-
return /* @__PURE__ */ new Map();
|
|
432
|
+
return { samples: /* @__PURE__ */ new Map() };
|
|
347
433
|
}
|
|
348
434
|
}
|
|
349
435
|
var samplesCache = /* @__PURE__ */ new Map();
|
|
@@ -359,12 +445,36 @@ function writeSamplesCache(userId, now, samples) {
|
|
|
359
445
|
samplesCache.delete(oldest);
|
|
360
446
|
}
|
|
361
447
|
}
|
|
448
|
+
var SPEED_SAMPLE_REFRESH_BUDGET_MS = 6e4;
|
|
449
|
+
var snapshotRefreshes = /* @__PURE__ */ new Map();
|
|
450
|
+
function startSpeedSnapshotRefresh(db, userId, now = Date.now()) {
|
|
451
|
+
const inFlight = snapshotRefreshes.get(userId);
|
|
452
|
+
if (inFlight) return inFlight;
|
|
453
|
+
const job = (async () => {
|
|
454
|
+
try {
|
|
455
|
+
const { samples, budgetExhausted } = await collectRecentSpeedSamples(db, userId, {
|
|
456
|
+
budgetMs: SPEED_SAMPLE_REFRESH_BUDGET_MS
|
|
457
|
+
});
|
|
458
|
+
if (!budgetExhausted) writeSamplesCache(userId, now, samples);
|
|
459
|
+
} catch {
|
|
460
|
+
}
|
|
461
|
+
})().finally(() => {
|
|
462
|
+
snapshotRefreshes.delete(userId);
|
|
463
|
+
});
|
|
464
|
+
snapshotRefreshes.set(userId, job);
|
|
465
|
+
return job;
|
|
466
|
+
}
|
|
362
467
|
async function loadCachedSpeedSamples(db, userId, now) {
|
|
363
468
|
const hit = samplesCache.get(userId);
|
|
364
|
-
if (hit
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
469
|
+
if (hit) {
|
|
470
|
+
const age = now - hit.at;
|
|
471
|
+
if (age >= 0 && age < SPEED_SAMPLE_STALE_SNAPSHOT_MAX_MS) {
|
|
472
|
+
if (age >= SPEED_SAMPLES_CACHE_TTL_MS) void startSpeedSnapshotRefresh(db, userId);
|
|
473
|
+
return age >= SPEED_SAMPLES_CACHE_TTL_MS ? { samples: hit.samples, snapshotAgeMs: age } : { samples: hit.samples };
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
void startSpeedSnapshotRefresh(db, userId);
|
|
477
|
+
return { samples: /* @__PURE__ */ new Map() };
|
|
368
478
|
}
|
|
369
479
|
async function injectSpeedContextIntoListAgentsResult(result, options = {}) {
|
|
370
480
|
try {
|
|
@@ -379,15 +489,18 @@ async function injectSpeedContextIntoListAgentsResult(result, options = {}) {
|
|
|
379
489
|
if (models.length === 0) return result;
|
|
380
490
|
const now = options.now ?? Date.now();
|
|
381
491
|
let samples = /* @__PURE__ */ new Map();
|
|
492
|
+
let snapshotAgeMs;
|
|
382
493
|
const userId = typeof options.userId === "string" ? options.userId.trim() : "";
|
|
383
494
|
if (options.db && userId) {
|
|
384
495
|
try {
|
|
385
|
-
|
|
496
|
+
const loaded = options.diskCache ? await loadSpeedSamplesWithDiskCache(options.db, userId, now, options.diskCache) : await loadCachedSpeedSamples(options.db, userId, now);
|
|
497
|
+
samples = loaded.samples;
|
|
498
|
+
snapshotAgeMs = loaded.snapshotAgeMs;
|
|
386
499
|
} catch {
|
|
387
500
|
samples = /* @__PURE__ */ new Map();
|
|
388
501
|
}
|
|
389
502
|
}
|
|
390
|
-
const speedContext = buildCandidateSpeedContext(models, samples);
|
|
503
|
+
const speedContext = buildCandidateSpeedContext(models, samples, { snapshotAgeMs });
|
|
391
504
|
return speedContext ? JSON.stringify({ ...parsed, speedContext }) : result;
|
|
392
505
|
} catch {
|
|
393
506
|
return result;
|
|
@@ -9,59 +9,59 @@ import {
|
|
|
9
9
|
readAgentRecord,
|
|
10
10
|
resolveAgentRecordFromHybridStore,
|
|
11
11
|
writeAgentRecord
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-7AUQ3WCW.js";
|
|
12
|
+
} from "./chunk-IF45XG7K.js";
|
|
14
13
|
import {
|
|
15
14
|
resolveCliAgentKeyInput
|
|
16
15
|
} from "./chunk-NBTY7YJF.js";
|
|
17
16
|
import "./chunk-NF64D32W.js";
|
|
18
17
|
import "./chunk-3L2WKC3W.js";
|
|
19
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-FHU44LN3.js";
|
|
20
19
|
import "./chunk-ZNFJWEN4.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-4KH4J3G5.js";
|
|
21
|
+
import "./chunk-CTPXME7U.js";
|
|
23
22
|
import "./chunk-HNUWUO75.js";
|
|
24
23
|
import "./chunk-CHOZJMJS.js";
|
|
25
24
|
import "./chunk-PWTNI4N7.js";
|
|
26
25
|
import "./chunk-Y63ZSOR6.js";
|
|
27
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-W4S457LU.js";
|
|
28
27
|
import "./chunk-4KB6WQUL.js";
|
|
29
28
|
import "./chunk-56GBUMO5.js";
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-NOMIGOST.js";
|
|
30
|
+
import "./chunk-UTV2AYEG.js";
|
|
32
31
|
import "./chunk-E2BESSAW.js";
|
|
33
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-25JZEIXN.js";
|
|
34
33
|
import "./chunk-YUXQAVRD.js";
|
|
34
|
+
import "./chunk-KC4XDTT3.js";
|
|
35
35
|
import "./chunk-2WZXXAQD.js";
|
|
36
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-YWSEPJ7C.js";
|
|
37
37
|
import "./chunk-WJZOQR2J.js";
|
|
38
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-UHJGXRJ4.js";
|
|
39
39
|
import "./chunk-2MBTWINN.js";
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-BTYQAODF.js";
|
|
40
|
+
import "./chunk-JTDORD5P.js";
|
|
41
|
+
import "./chunk-CZM5YTZ7.js";
|
|
43
42
|
import "./chunk-H57T64RA.js";
|
|
43
|
+
import "./chunk-5ZUL4CUO.js";
|
|
44
44
|
import "./chunk-UKZX3NHN.js";
|
|
45
45
|
import "./chunk-5MMAK75Q.js";
|
|
46
|
-
import "./chunk-
|
|
47
|
-
import "./chunk-
|
|
46
|
+
import "./chunk-2QHFH3DR.js";
|
|
47
|
+
import "./chunk-OQHIVPG4.js";
|
|
48
48
|
import {
|
|
49
49
|
asRecordOrEmpty
|
|
50
50
|
} from "./chunk-KX6YBIHG.js";
|
|
51
51
|
import "./chunk-DWLEOOGR.js";
|
|
52
52
|
import "./chunk-7DPNBQSV.js";
|
|
53
|
-
import "./chunk-
|
|
53
|
+
import "./chunk-T43B7LB2.js";
|
|
54
54
|
import "./chunk-ZRSNONOB.js";
|
|
55
55
|
import "./chunk-4VJAC32I.js";
|
|
56
|
-
import "./chunk-
|
|
56
|
+
import "./chunk-CJEIOP3E.js";
|
|
57
|
+
import "./chunk-ZCWRMUWT.js";
|
|
57
58
|
import "./chunk-ZC3CMUKU.js";
|
|
58
59
|
import "./chunk-LOEO7LRC.js";
|
|
59
60
|
import "./chunk-M2EJHDJP.js";
|
|
60
|
-
import "./chunk-
|
|
61
|
-
import "./chunk-
|
|
61
|
+
import "./chunk-KIM6CLW5.js";
|
|
62
|
+
import "./chunk-JNKSDZFS.js";
|
|
62
63
|
import "./chunk-PSCNXBYA.js";
|
|
63
|
-
import "./chunk-
|
|
64
|
-
import "./chunk-PV6JJAUB.js";
|
|
64
|
+
import "./chunk-TCZHTTUU.js";
|
|
65
65
|
import "./chunk-YUA6OAH5.js";
|
|
66
66
|
import "./chunk-SM3NSZJV.js";
|
|
67
67
|
import "./chunk-JRTNUU5Z.js";
|
|
@@ -69,6 +69,10 @@ import {
|
|
|
69
69
|
toErrorMessage
|
|
70
70
|
} from "./chunk-HNMXYYJR.js";
|
|
71
71
|
import "./chunk-KUG52IAP.js";
|
|
72
|
+
import "./chunk-GOO6G4PY.js";
|
|
73
|
+
import {
|
|
74
|
+
asTrimmedLowercaseString
|
|
75
|
+
} from "./chunk-QSJ3HFEF.js";
|
|
72
76
|
import {
|
|
73
77
|
parseUserIdFromAuthToken,
|
|
74
78
|
readOption,
|
|
@@ -80,18 +84,15 @@ import "./chunk-LCBAMY2M.js";
|
|
|
80
84
|
import "./chunk-4SN6J65J.js";
|
|
81
85
|
import "./chunk-CF7PE763.js";
|
|
82
86
|
import "./chunk-4O22PGNQ.js";
|
|
83
|
-
import "./chunk-
|
|
87
|
+
import "./chunk-G7Y4GXTY.js";
|
|
88
|
+
import "./chunk-6UBGXX2W.js";
|
|
89
|
+
import "./chunk-JY5NGFFH.js";
|
|
84
90
|
import "./chunk-XJWWBO34.js";
|
|
85
91
|
import "./chunk-I42VC5KR.js";
|
|
86
92
|
import "./chunk-U6VC4MU4.js";
|
|
87
93
|
import "./chunk-WWC7I6TA.js";
|
|
88
94
|
import "./chunk-3EUW3WEO.js";
|
|
89
95
|
import "./chunk-G3SUCT4W.js";
|
|
90
|
-
import "./chunk-T43B7LB2.js";
|
|
91
|
-
import "./chunk-GOO6G4PY.js";
|
|
92
|
-
import {
|
|
93
|
-
asTrimmedLowercaseString
|
|
94
|
-
} from "./chunk-QSJ3HFEF.js";
|
|
95
96
|
import "./chunk-4VNS5WPM.js";
|
|
96
97
|
|
|
97
98
|
// packages/cli/agentMachineCommands.ts
|
|
@@ -100,7 +101,7 @@ async function defaultExecuteCli(provider, prompt, options) {
|
|
|
100
101
|
return executeCli(provider, prompt, options);
|
|
101
102
|
}
|
|
102
103
|
async function forwardConnectorRunMessage(machine, message, pushMessage, executeCli, env, fetchImpl) {
|
|
103
|
-
const { handleConnectorRunMessage } = await import("./machineWsRunDispatch-
|
|
104
|
+
const { handleConnectorRunMessage } = await import("./machineWsRunDispatch-R26P5V36.js");
|
|
104
105
|
return handleConnectorRunMessage(message, pushMessage, executeCli, env, fetchImpl);
|
|
105
106
|
}
|
|
106
107
|
async function detectLaunchableMachineInfo() {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
normalizeOrigin
|
|
3
|
+
} from "./chunk-XFYFMTOM.js";
|
|
1
4
|
import {
|
|
2
5
|
customNativeAuthHeaders,
|
|
3
6
|
detectDeclaredCustomNativeWire
|
|
@@ -71,7 +74,7 @@ ${AGENT_MODELS_USAGE}`);
|
|
|
71
74
|
let diagnostic;
|
|
72
75
|
if (res.status === 409 || body?.code === "PRESET_NOT_WHITELISTED") {
|
|
73
76
|
try {
|
|
74
|
-
const { ALL_PROVIDER_REGISTRY } = await import("./providerRegistry-
|
|
77
|
+
const { ALL_PROVIDER_REGISTRY } = await import("./providerRegistry-S6UL6UNA.js");
|
|
75
78
|
const provider = ALL_PROVIDER_REGISTRY.find((p) => p.id === presetId) ?? ALL_PROVIDER_REGISTRY.find((p) => p.provider === presetId);
|
|
76
79
|
const isOpenAICompatBearer = provider && provider.kind === "api_key_template" && "baseUrl" in provider && typeof provider.baseUrl === "string" && provider.baseUrl && (!("apiKeyHeader" in provider) || !provider.apiKeyHeader || provider.apiKeyHeader.toLowerCase() === "authorization");
|
|
77
80
|
if (isOpenAICompatBearer) {
|
|
@@ -241,10 +244,26 @@ function extractVerifyReply(data) {
|
|
|
241
244
|
if (responsesReply) return responsesReply;
|
|
242
245
|
return (data.content ?? []).map((part) => typeof part?.text === "string" ? part.text : "").join("").trim();
|
|
243
246
|
}
|
|
247
|
+
function redactVerifyReason(error, apiKey) {
|
|
248
|
+
const raw = toErrorMessage(error);
|
|
249
|
+
if (!apiKey) return raw;
|
|
250
|
+
return raw.split(apiKey).join("[REDACTED:SECRET]");
|
|
251
|
+
}
|
|
244
252
|
async function verifyCustomProvider(options) {
|
|
245
253
|
const { providerUrl, apiKey, model, prompt = "\u53EA\u56DE\u590D OK" } = options;
|
|
246
254
|
const fetchImpl = options.fetchImpl ?? fetch;
|
|
247
255
|
const provider = providerUrl?.replace(/\/+$/, "") ?? "";
|
|
256
|
+
if (options.allowedOrigin) {
|
|
257
|
+
const origin = normalizeOrigin(provider);
|
|
258
|
+
if (!origin || origin !== options.allowedOrigin) {
|
|
259
|
+
return {
|
|
260
|
+
ok: false,
|
|
261
|
+
providerUrl: provider,
|
|
262
|
+
model,
|
|
263
|
+
reason: "blocked-cross-origin: request target is not the authorized provider origin"
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
}
|
|
248
267
|
if (!provider || !apiKey || !model) {
|
|
249
268
|
return {
|
|
250
269
|
ok: false,
|
|
@@ -266,13 +285,23 @@ async function verifyCustomProvider(options) {
|
|
|
266
285
|
const res = await fetchImpl(targetUrl, {
|
|
267
286
|
method: "POST",
|
|
268
287
|
headers,
|
|
269
|
-
body: JSON.stringify(probeBody)
|
|
288
|
+
body: JSON.stringify(probeBody),
|
|
289
|
+
...options.allowedOrigin ? { redirect: "manual" } : {}
|
|
270
290
|
});
|
|
291
|
+
if (options.allowedOrigin && res.status >= 300 && res.status < 400) {
|
|
292
|
+
return {
|
|
293
|
+
ok: false,
|
|
294
|
+
status: res.status,
|
|
295
|
+
providerUrl: provider,
|
|
296
|
+
model,
|
|
297
|
+
reason: "blocked-redirect: provider answered with a redirect"
|
|
298
|
+
};
|
|
299
|
+
}
|
|
271
300
|
const data = await res.json().catch(() => null);
|
|
272
301
|
const reply = extractVerifyReply(data);
|
|
273
302
|
return { ok: res.ok, status: res.status, providerUrl: provider, model, reply };
|
|
274
303
|
} catch (error) {
|
|
275
|
-
return { ok: false, providerUrl: provider, model, reason:
|
|
304
|
+
return { ok: false, providerUrl: provider, model, reason: redactVerifyReason(error, apiKey) };
|
|
276
305
|
}
|
|
277
306
|
}
|
|
278
307
|
async function runAgentProvidersCommand(args, deps = {}) {
|
|
@@ -287,7 +316,7 @@ async function runAgentProvidersCommand(args, deps = {}) {
|
|
|
287
316
|
const {
|
|
288
317
|
CUSTOM_API_KEY_TEMPLATES,
|
|
289
318
|
SUBSCRIPTION_OAUTH_PROVIDERS
|
|
290
|
-
} = await import("./providerRegistry-
|
|
319
|
+
} = await import("./providerRegistry-S6UL6UNA.js");
|
|
291
320
|
const keyTemplates = CUSTOM_API_KEY_TEMPLATES.map((p) => ({
|
|
292
321
|
id: p.id,
|
|
293
322
|
label: p.label,
|