nolo-cli 0.227.0-alpha.1 → 0.228.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-JKQGZ3HU.js → _executeModel-WZKT6XEU.js} +76 -77
- package/{action-CK64LS6S.js → action-GDZDXPMB.js} +9 -9
- package/{addContentAction-CARFID6E.js → addContentAction-7RO4AMRI.js} +14 -14
- package/{addDialogAgentAction-APLZLFW5.js → addDialogAgentAction-EVYBGTXB.js} +16 -16
- package/{agentDeleteCommand-NVR2V2HH.js → agentDeleteCommand-PZWRHNXY.js} +113 -114
- package/{agentEmailCommands-UCVOWD3S.js → agentEmailCommands-QTKMEICX.js} +116 -117
- package/{agentFavoriteCommands-4PDOP3GW.js → agentFavoriteCommands-7LOP3HUD.js} +6 -6
- package/{agentGrantCommands-FLCEXLUH.js → agentGrantCommands-L6O2HVJI.js} +7 -7
- package/{agentListCommands-C65UESYM.js → agentListCommands-GUGMORTK.js} +72 -71
- package/{agentMachineCommands-V3DGEJU4.js → agentMachineCommands-7QGICJLM.js} +57 -56
- package/{agentProviderCommands-7QBFRFRK.js → agentProviderCommands-STI3DQ6A.js} +7 -7
- package/{agentPullCommand-E6JBGBVG.js → agentPullCommand-KHV4EELF.js} +6 -6
- package/{agentRecordCommands-6RCJS2EY.js → agentRecordCommands-SLLADS5C.js} +104 -105
- package/{agentRunCommand-P3GRKXKS.js → agentRunCommand-OFQLOF5Y.js} +110 -111
- package/{agentRunControl-SNZZ5XP4.js → agentRunControl-MBG4U6SL.js} +23 -17
- package/{agentRuntimeLocal-GOX2DIY7.js → agentRuntimeLocal-TU4LA353.js} +44 -44
- package/{agentSlice-N7H2FRJA.js → agentSlice-L4SBGWTB.js} +17 -17
- package/{appDeleteCommands-LZDN26FU.js → appDeleteCommands-JWP3XPUA.js} +52 -51
- package/{appDeployCommands-6IO6TTZH.js → appDeployCommands-6E4TQCWI.js} +52 -51
- package/{appDeployStatusCommands-FG3LX24J.js → appDeployStatusCommands-ALU4SADG.js} +52 -51
- package/{appGetCommands-NAKVDVD4.js → appGetCommands-JEY4L6L4.js} +52 -51
- package/{appListCommands-KL56RN73.js → appListCommands-PCAVHU7M.js} +52 -51
- package/{authCommand-AUN5MXV2.js → authCommand-CGRIIOOV.js} +30 -31
- package/{authCommands-D2IPS6ES.js → authCommands-55OGQGCR.js} +12 -13
- package/{builtinSkillRegistry-UQGLKRYP.js → builtinSkillRegistry-BAE2LDXF.js} +4 -4
- package/{chromeOpsCommands-UJWN5HWH.js → chromeOpsCommands-WAA45NCS.js} +8 -8
- package/{chunk-OB6DVWPF.js → chunk-262R3XNN.js} +16 -2
- package/{chunk-KMRKZNGT.js → chunk-2MCB7CD7.js} +13 -12
- package/{chunk-YPPKC6FL.js → chunk-2NPD3FTX.js} +3 -3
- package/{chunk-UN7HIYMH.js → chunk-2X7WFDT6.js} +1 -1
- package/{chunk-XI2BWJM5.js → chunk-324FWHUA.js} +20 -3
- package/{chunk-JWXITTQB.js → chunk-3P54D2E4.js} +1 -1
- package/{chunk-RU6DULV4.js → chunk-3U44JB3O.js} +1 -1
- package/{chunk-EUCFKKDM.js → chunk-4I2MXV5Q.js} +38 -10
- package/{chunk-PLPLH2XZ.js → chunk-4ZGPHFLE.js} +2 -2
- package/{chunk-NO3VBWTL.js → chunk-547ENH5T.js} +1 -1
- package/chunk-5ZUOVCKT.js +32 -0
- package/{chunk-XZODOEKU.js → chunk-6QHKRARD.js} +2 -2
- package/{chunk-YGMBIXCF.js → chunk-6XRPBZRS.js} +4 -2
- package/{chunk-VPAZ6BEN.js → chunk-7JGMNKKG.js} +18 -14
- package/{chunk-3VFYQH3I.js → chunk-AGYPUBFW.js} +14 -39
- package/{chunk-5HL4KC4A.js → chunk-ALAES342.js} +57 -86
- package/{chunk-VREDDN25.js → chunk-ATEKLSLR.js} +1 -1
- package/{chunk-CQVGR3MX.js → chunk-AUAJTAFM.js} +8 -8
- package/chunk-BIDSIRTS.js +307 -0
- package/chunk-BIWI5M4E.js +62 -0
- package/{chunk-L5I543VB.js → chunk-BNMPUQW6.js} +1 -1
- package/{chunk-UCFPVYP7.js → chunk-BP5ZJ6B4.js} +1 -1
- package/{chunk-2G3YSVO6.js → chunk-CBUZ6DKA.js} +3 -3
- package/{chunk-KYH7XW3K.js → chunk-CD3RU7XL.js} +16 -1
- package/{chunk-SFTTXGPM.js → chunk-CMMI3DAT.js} +16 -16
- package/{chunk-VZW34YUL.js → chunk-CYWNWA77.js} +5 -5
- package/{chunk-5LQDHFBN.js → chunk-D6YNCNM6.js} +14 -11
- package/{chunk-UVUVQVZ6.js → chunk-DBUR22G5.js} +2 -2
- package/{chunk-7Z3WUZ4Q.js → chunk-DDC6P6EH.js} +24 -24
- package/{chunk-G6HJUMST.js → chunk-DEA37IUY.js} +2 -2
- package/{chunk-5RKRXQ2H.js → chunk-DGYCDA6W.js} +2 -2
- package/{chunk-3HTP4WZQ.js → chunk-DUUDXSLX.js} +21 -7
- package/{chunk-KFHREHUQ.js → chunk-DXWGFL2Z.js} +89 -1
- package/{chunk-TOKPHZ55.js → chunk-EEOOBRA7.js} +5 -5
- package/{chunk-UAPNPNSG.js → chunk-EXJK7TQO.js} +1040 -582
- package/{chunk-OXA5GWHU.js → chunk-F6Z6ZCUV.js} +2 -2
- package/{chunk-X2KRQP7V.js → chunk-FJSNBZXR.js} +1 -1
- package/{chunk-KRRE4A7D.js → chunk-G7IUT2V3.js} +3 -2
- package/{chunk-VIHDJ3FK.js → chunk-GACR7H6T.js} +14 -14
- package/{chunk-GOLPOTG5.js → chunk-GOCSSER3.js} +3 -3
- package/{chunk-NAOO4PVX.js → chunk-GPOV42YM.js} +16 -16
- package/{chunk-C2B7M567.js → chunk-GUXZK7SE.js} +5 -5
- package/{chunk-TINJKQSO.js → chunk-GYS5FUYR.js} +20 -20
- package/{chunk-IAJJYHIB.js → chunk-H6L2NFHY.js} +7 -7
- package/{chunk-45LZIYXB.js → chunk-HBRDSQ3M.js} +1 -1
- package/{chunk-T5N6NHAT.js → chunk-HHFGE2WF.js} +3 -3
- package/{chunk-IX2BXN2K.js → chunk-HSSBDZLD.js} +3 -3
- package/{chunk-MWHOH4RJ.js → chunk-HYLRQDEE.js} +4 -4
- package/{chunk-ZYA2YDB6.js → chunk-IAAIUH64.js} +16 -16
- package/{chunk-LXTC53TN.js → chunk-IXG6YXQM.js} +143 -123
- package/{chunk-CVERLOJM.js → chunk-JUSHVFNF.js} +236 -182
- package/{chunk-ABGULE7H.js → chunk-K67C2JUC.js} +12 -12
- package/{chunk-T2BEPTAG.js → chunk-L32W3PRP.js} +47 -17
- package/{chunk-M3Y4IBIR.js → chunk-M4SFKP5L.js} +4 -4
- package/{chunk-ZI5SZ3MV.js → chunk-MDZWUD3R.js} +20 -20
- package/{chunk-F5AY2UZL.js → chunk-NHY322ZU.js} +8 -8
- package/{chunk-KJAAPGBE.js → chunk-OBIC6EG7.js} +6 -6
- package/{chunk-4OKTPFNX.js → chunk-OG6MQOQG.js} +105 -37
- package/{chunk-AXYH4734.js → chunk-OOJNQK6V.js} +13 -13
- package/{chunk-XIEYGCN6.js → chunk-OWKNSIXL.js} +149 -48
- package/{chunk-JHF6VLVL.js → chunk-OYU2MA5S.js} +29 -29
- package/{chunk-6XIE5ZGI.js → chunk-PDCV7P5W.js} +1 -1
- package/{chunk-CKT6QUE2.js → chunk-Q3IVPFVO.js} +1 -1
- package/{chunk-PHOSZT3E.js → chunk-QBZCGP34.js} +1 -1
- package/{chunk-CLCXHIBS.js → chunk-QCB42576.js} +1 -1
- package/{chunk-HOCHUZQ7.js → chunk-QJTZ76CP.js} +24 -6
- package/{chunk-YQETUZ5V.js → chunk-QRGDJA4B.js} +11 -11
- package/{chunk-ULAQPRHX.js → chunk-QYB23WUH.js} +1 -1
- package/{chunk-PVAWNHP5.js → chunk-R3NEQZ53.js} +295 -102
- package/{chunk-CSW7IPVD.js → chunk-R6Z5S5GA.js} +11 -11
- package/{chunk-MK2Q7ZJD.js → chunk-R7XWZDOH.js} +58 -24
- package/{chunk-GUVXQSFZ.js → chunk-RBPUNSG5.js} +1 -1
- package/{chunk-GOQ6ZVTN.js → chunk-RG2DGNL6.js} +3 -3
- package/{chunk-6EDAMVG6.js → chunk-RTHFJZ6M.js} +10 -10
- package/{chunk-YOT437BH.js → chunk-RYOLWYBK.js} +122 -118
- package/{chunk-WJP4TH6U.js → chunk-S6FDXXZV.js} +1 -1
- package/{chunk-SW6OD4KE.js → chunk-SMJEXX2S.js} +123 -12
- package/{chunk-LJSNEV7M.js → chunk-SRCCSTIM.js} +7 -7
- package/{chunk-FKEZOMIF.js → chunk-STJ6LSQE.js} +453 -193
- package/{chunk-L42CBKBZ.js → chunk-TGNIKIHR.js} +3 -3
- package/{chunk-AK5O76CC.js → chunk-TI2EPRHE.js} +2 -2
- package/{chunk-SRG5CNLC.js → chunk-TSPMLCWI.js} +6 -6
- package/{chunk-YGILMZ7N.js → chunk-TUSTONB3.js} +1 -1
- package/{chunk-2SKTCNWO.js → chunk-UE2EVEYS.js} +2 -2
- package/{chunk-ZADGPNTV.js → chunk-UWAIJOF2.js} +29 -29
- package/{chunk-HVUDBOQG.js → chunk-VMJVAJ6W.js} +9 -6
- package/{chunk-LA7JYAKF.js → chunk-VSYTM22R.js} +3 -3
- package/{chunk-FIYSMXHY.js → chunk-WWTSEBDF.js} +1 -1
- package/{chunk-E2BESSAW.js → chunk-X4O7FJF5.js} +2 -0
- package/{chunk-GRXSJR2Z.js → chunk-XJPLSAPJ.js} +21 -21
- package/{chunk-HYKGIXNO.js → chunk-XSW4EXQV.js} +85 -21
- package/{chunk-T43K75CK.js → chunk-YKY4OVOX.js} +15 -15
- package/{chunk-5RKUPJYL.js → chunk-ZH3KXFHS.js} +11 -3
- package/chunk-ZOHO6MOF.js +376 -0
- package/{chunk-PXKF5CV4.js → chunk-ZXF6D3I6.js} +10 -8
- package/{cliAgentConfigHelpers-QVSQYTKC.js → cliAgentConfigHelpers-BTRHMPW2.js} +14 -14
- package/{cliEnvHelpers-D6HMC46Z.js → cliEnvHelpers-CNMP3RDX.js} +2 -2
- package/{cliExecutor-4MAX3PZL.js → cliExecutor-K6FDZTQ2.js} +3 -1
- package/{cliLocalAgentRecordReader-SPKAJYME.js → cliLocalAgentRecordReader-M3F76NIP.js} +46 -46
- package/{commandRegistry-TKR6OWXP.js → commandRegistry-ZLWHQVAI.js} +93 -93
- package/{contentThunks-BQWRPCTM.js → contentThunks-4ZX2TO7C.js} +36 -35
- package/{cooldownCommands-FZYQOWI5.js → cooldownCommands-YB5H5BBK.js} +3 -3
- package/{createAgentAutomationAction-GFI6SJZV.js → createAgentAutomationAction-L4CYUZJG.js} +36 -35
- package/{createDialogAction-MMBIHFFU.js → createDialogAction-QTU2R2Q3.js} +37 -37
- package/{createPageAction-EEYUE5FB.js → createPageAction-F3GJTHW2.js} +39 -38
- package/{db-CS4ZJQKV.js → db-M7FU2GNK.js} +9 -6
- package/{dbSlice-X4Z4E4QU.js → dbSlice-XRUZOGSU.js} +13 -13
- package/{deleteFile-QOOP2UK7.js → deleteFile-6URDHYRB.js} +9 -9
- package/{dialogCommands-OXBQ73DD.js → dialogCommands-NRLCOPJR.js} +56 -56
- package/{dialogNotifyCommand-VWS5G4OO.js → dialogNotifyCommand-SHGPCU22.js} +17 -17
- package/{dialogSlice-KGYIABDY.js → dialogSlice-P2S4LXQD.js} +34 -33
- package/{dialogUsageCommand-FEWCN7IA.js → dialogUsageCommand-W2WCSGKF.js} +6 -6
- package/{docCreateCommands-LS32VKY3.js → docCreateCommands-YJRDA3RX.js} +51 -50
- package/{docDeleteCommands-JTYR5RPH.js → docDeleteCommands-A5QIHZNF.js} +53 -52
- package/{docReadCommands-E5LTVKWN.js → docReadCommands-CF2LTMYH.js} +51 -50
- package/{docStore-TVS2FNER.js → docStore-6O7NYL6A.js} +15 -15
- package/{docUpdateCommands-I3J3JDZ2.js → docUpdateCommands-QRKV4ZXE.js} +51 -50
- package/{fetchMessages-Q3INLN5F.js → fetchMessages-TQEUZD7H.js} +3 -3
- package/{getPricing-VNGFM4PN.js → getPricing-LF5C4XSI.js} +6 -6
- package/{handleSendMessageAction-SSON36TJ.js → handleSendMessageAction-7IHLR37A.js} +66 -66
- package/{hostCredentialCreate-WTW4THJF.js → hostCredentialCreate-VNCQUAFT.js} +104 -105
- package/index.js +54 -16
- package/keys-RWF7UCB4.js +1 -1
- package/{localDialogRead-V36DX2Q2.js → localDialogRead-CCOCVGAP.js} +2 -2
- package/{localRuntimeAdapter-MI2JGXSF.js → localRuntimeAdapter-FOWVNMIK.js} +111 -112
- package/{machineCommands-3LROJZDK.js → machineCommands-ZGC3J4JB.js} +115 -116
- package/{machineWsRunDispatch-BUUJRUUB.js → machineWsRunDispatch-KK5U4M3G.js} +102 -103
- package/{memberThunks-CFEPHAND.js → memberThunks-7Y3OYSJQ.js} +17 -17
- package/{memoryCommands-JQMEJO7J.js → memoryCommands-BC6REPQB.js} +6 -6
- package/{overlay-THLKYIWY.js → overlay-BBQZXGYI.js} +5 -3
- package/package.json +1 -1
- package/{projectArchive-3X54XFVN.js → projectArchive-7ZDYBXAX.js} +44 -43
- package/{providerPresetApply-FO36N5TX.js → providerPresetApply-WHAMP2D5.js} +9 -9
- package/{providerRegistry-U2BSFE6K.js → providerRegistry-ZI2KORJ7.js} +9 -9
- package/{read-KA3L2V7O.js → read-TYMBGEXO.js} +9 -9
- package/{readDocTool-AMAZAPAW.js → readDocTool-SKQVHBLO.js} +1 -1
- package/{readlineWorkspace-Z3YUH4SX.js → readlineWorkspace-YHT4SX2C.js} +4391 -4161
- package/{removeDialogAgentAction-JQOJSUM7.js → removeDialogAgentAction-F5QE2O2B.js} +19 -19
- package/{runAgentClientLoop-4FCFLMDJ.js → runAgentClientLoop-H4ED5V3K.js} +70 -71
- package/{runtimeDoctorCommands-CXOCVDPU.js → runtimeDoctorCommands-RRKPBGVO.js} +16 -16
- package/{secretCommands-GGUAWAE7.js → secretCommands-KZWBZIYS.js} +2 -2
- package/{setDialogExtraReferencesAction-YXQTGXIN.js → setDialogExtraReferencesAction-72L27ERM.js} +15 -15
- package/{setPrimaryDialogAgentAction-YNLB66WE.js → setPrimaryDialogAgentAction-GJJDUSGJ.js} +19 -19
- package/{settingThunks-E6N7RSSS.js → settingThunks-ZRGWVGZD.js} +18 -18
- package/{skillDiscovery-B5V23AXP.js → skillDiscovery-I37M5KJC.js} +3 -3
- package/{spaceCommands-DB5DKC2J.js → spaceCommands-MEH3HJBC.js} +53 -52
- package/{store-JRVN62NM.js → store-Z53ICFL3.js} +3 -1
- package/{streamAgentChatTurn-FCBGMD4D.js → streamAgentChatTurn-ZXPOXU33.js} +91 -92
- package/{switchDialogAgentAction-LAHLUECU.js → switchDialogAgentAction-IIJBPND3.js} +16 -16
- package/{tableCommands-VNSXHAMG.js → tableCommands-FTAOCBTX.js} +12 -12
- package/{tools-6JD36D6K.js → tools-2MRWA2PP.js} +59 -60
- package/tuiRestart-2IL37YIB.js +41 -0
- package/{tuiSummaryLlmCaller-UHZIPGAX.js → tuiSummaryLlmCaller-W2QN4VAC.js} +21 -21
- package/{updateCommands-KZ54HCU5.js → updateCommands-CPATDG6J.js} +8 -6
- package/{updateDialogTitleAction-RV3EUEN3.js → updateDialogTitleAction-RZ3KZSGQ.js} +36 -35
- package/{usageCommand-KFVV6UL3.js → usageCommand-2BF74MKF.js} +2 -2
- package/{usageRebuildCommand-HHFSNK46.js → usageRebuildCommand-UHB55BQM.js} +3 -3
- package/{windowsSelfUpdate-KERHIAB4.js → windowsSelfUpdate-ZFD6J5HF.js} +2 -2
- package/chunk-BJF2MHJ3.js +0 -118
- package/chunk-KEPOVMF4.js +0 -91
- package/chunk-PMDVQBGA.js +0 -100
- package/chunk-WACI5I6V.js +0 -147
- package/{accountResolver-EK2S4PWF.js → accountResolver-QETKNC7T.js} +4 -4
- package/{chunk-AGP3YSEC.js → chunk-4N6G2CKP.js} +3 -3
- package/{chunk-VXL2FZTP.js → chunk-HXER7YJF.js} +3 -3
- package/{chunk-BLVSFYQ3.js → chunk-LISC7BD4.js} +3 -3
- package/{chunk-SSGTV4FC.js → chunk-USGHJSGO.js} +5 -5
- package/{chunk-IC2I373Q.js → chunk-VS276URX.js} +3 -3
- package/{chunk-AETZ7AD6.js → chunk-W6RFEDN4.js} +3 -3
- package/{offlineMarxistsAgentCommand-AGA2X5E4.js → offlineMarxistsAgentCommand-XVXUE6G5.js} +5 -5
- package/{workloadLifecycle-O2I3NZ2Q.js → workloadLifecycle-HFJIN5IZ.js} +8 -8
|
@@ -1,25 +1,30 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveRuntimeAuthToken,
|
|
3
3
|
resolveRuntimeServerUrl
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2X7WFDT6.js";
|
|
5
5
|
import {
|
|
6
6
|
isAgentRunTerminalStatus,
|
|
7
7
|
normalizeRunTitle,
|
|
8
8
|
shortAgentKey
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OOJNQK6V.js";
|
|
10
10
|
import {
|
|
11
11
|
findPowerShellExecutable
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VMJVAJ6W.js";
|
|
13
13
|
import {
|
|
14
14
|
AUTH_ERROR_PATTERNS
|
|
15
15
|
} from "./chunk-EWQ3HGNZ.js";
|
|
16
|
+
import {
|
|
17
|
+
AGENT_RUN_PROTOCOL,
|
|
18
|
+
HOST_RUNTIME_CONTENT_IDENTITY,
|
|
19
|
+
RuntimeVersionMismatchError,
|
|
20
|
+
getHostRuntimeExecutable,
|
|
21
|
+
isCompiledBinary,
|
|
22
|
+
resolveCliEntrypointPath,
|
|
23
|
+
resolveExactRuntimeEntrypoint
|
|
24
|
+
} from "./chunk-BIDSIRTS.js";
|
|
16
25
|
import {
|
|
17
26
|
isRecord
|
|
18
27
|
} from "./chunk-KUG52IAP.js";
|
|
19
|
-
import {
|
|
20
|
-
isCompiledBinary,
|
|
21
|
-
resolveCliEntrypointPath
|
|
22
|
-
} from "./chunk-WACI5I6V.js";
|
|
23
28
|
|
|
24
29
|
// packages/cli/client/originShellApprovalTransport.ts
|
|
25
30
|
import { realpathSync } from "node:fs";
|
|
@@ -2022,6 +2027,34 @@ function listRunRecords(deps = {}) {
|
|
|
2022
2027
|
(a, b) => new Date(b.startedAt).getTime() - new Date(a.startedAt).getTime()
|
|
2023
2028
|
);
|
|
2024
2029
|
}
|
|
2030
|
+
async function listRunRecordsAsync(deps = {}) {
|
|
2031
|
+
const dir = resolveRunsDir(deps.env, deps.homedir);
|
|
2032
|
+
let entries;
|
|
2033
|
+
try {
|
|
2034
|
+
entries = await nodeFs2.promises.readdir(dir);
|
|
2035
|
+
} catch {
|
|
2036
|
+
return [];
|
|
2037
|
+
}
|
|
2038
|
+
const records = new Array(entries.length);
|
|
2039
|
+
let next = 0;
|
|
2040
|
+
const readNext = async () => {
|
|
2041
|
+
while (next < entries.length) {
|
|
2042
|
+
const index = next++;
|
|
2043
|
+
const entry = entries[index];
|
|
2044
|
+
if (!entry.endsWith(".json")) continue;
|
|
2045
|
+
const path = resolveRunRecordPath(entry.slice(0, -5), deps.env, deps.homedir);
|
|
2046
|
+
for (let attempt = 0; attempt < 2; attempt++) {
|
|
2047
|
+
try {
|
|
2048
|
+
records[index] = JSON.parse(await nodeFs2.promises.readFile(path, "utf8"));
|
|
2049
|
+
break;
|
|
2050
|
+
} catch {
|
|
2051
|
+
}
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
};
|
|
2055
|
+
await Promise.all(Array.from({ length: Math.min(16, entries.length) }, readNext));
|
|
2056
|
+
return records.filter((record) => Boolean(record)).sort((a, b) => new Date(b.startedAt).getTime() - new Date(a.startedAt).getTime());
|
|
2057
|
+
}
|
|
2025
2058
|
function findRunRecordByPid(pid, deps = {}) {
|
|
2026
2059
|
return listRunRecords(deps).find((record) => record.pid === pid);
|
|
2027
2060
|
}
|
|
@@ -2215,38 +2248,22 @@ function rewriteMsgFileArg(args, messagePath) {
|
|
|
2215
2248
|
return result;
|
|
2216
2249
|
}
|
|
2217
2250
|
function resolveValidCliEntrypoint(cliEntrypointPath, fs = nodeFs2) {
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
const fallback = resolveCliEntrypointPath();
|
|
2222
|
-
if (fs.existsSync(fallback)) {
|
|
2223
|
-
return fallback;
|
|
2224
|
-
}
|
|
2225
|
-
const candidates = [
|
|
2226
|
-
join2(dirname(fallback), "cli", "index.ts"),
|
|
2227
|
-
join2(dirname(fallback), "cli", "index.js"),
|
|
2228
|
-
join2(dirname(fallback), "..", "packages", "cli", "index.ts"),
|
|
2229
|
-
join2(dirname(fallback), "..", "packages", "cli", "index.js"),
|
|
2230
|
-
join2(dirname(fallback), "..", "index.js")
|
|
2231
|
-
];
|
|
2232
|
-
for (const cand of candidates) {
|
|
2233
|
-
if (fs.existsSync(cand)) {
|
|
2234
|
-
return cand;
|
|
2235
|
-
}
|
|
2236
|
-
}
|
|
2237
|
-
return fallback;
|
|
2251
|
+
const entrypoint = cliEntrypointPath ?? resolveCliEntrypointPath();
|
|
2252
|
+
if (!fs.existsSync(entrypoint)) throw new RuntimeVersionMismatchError("runtime entrypoint missing");
|
|
2253
|
+
return fs === nodeFs2 ? resolveExactRuntimeEntrypoint(entrypoint) : String(fs.realpathSync?.(entrypoint) ?? entrypoint);
|
|
2238
2254
|
}
|
|
2239
2255
|
function buildAgentRunChildCommand(options, deps = {}) {
|
|
2240
2256
|
const fs = deps.fs ?? nodeFs2;
|
|
2241
|
-
const execPath =
|
|
2257
|
+
const execPath = getHostRuntimeExecutable();
|
|
2242
2258
|
const commandParts = options.commandPath ?? [];
|
|
2243
2259
|
let strippedArgs = stripBackgroundFlag(options.rawArgs);
|
|
2244
2260
|
if (options.messagePath) {
|
|
2245
2261
|
strippedArgs = rewriteMsgFileArg(strippedArgs, options.messagePath);
|
|
2246
2262
|
}
|
|
2247
2263
|
strippedArgs = absolutizeSkillArgs(strippedArgs);
|
|
2248
|
-
if (isCompiledBinary() || options.cliEntrypointPath === execPath) {
|
|
2249
|
-
|
|
2264
|
+
if (isCompiledBinary() || options.cliEntrypointPath === process.execPath || options.cliEntrypointPath === execPath) {
|
|
2265
|
+
const fixed = resolveValidCliEntrypoint(isCompiledBinary() ? execPath : options.cliEntrypointPath ?? execPath, fs);
|
|
2266
|
+
return { execPath: fixed, childArgs: [...commandParts, ...strippedArgs] };
|
|
2250
2267
|
}
|
|
2251
2268
|
const entrypoint = resolveValidCliEntrypoint(options.cliEntrypointPath, fs);
|
|
2252
2269
|
if (entrypoint === execPath) {
|
|
@@ -2534,6 +2551,48 @@ function releaseUnspawnedLocalWriterClaim(runId, deps) {
|
|
|
2534
2551
|
}, { strict: true });
|
|
2535
2552
|
if (!released) throw new Error(`[local-writer-resource] release lock busy: ${runId}`);
|
|
2536
2553
|
}
|
|
2554
|
+
async function recordRunStartup(runId, phase, deps = {}) {
|
|
2555
|
+
const attempt = () => withRunRecordLock(runId, deps, () => {
|
|
2556
|
+
const record = readRunRecord(runId, deps);
|
|
2557
|
+
if (!record || isRunTerminalStatus(record.status)) return true;
|
|
2558
|
+
record.startup = { protocol: AGENT_RUN_PROTOCOL, phase };
|
|
2559
|
+
writeRunRecord(record, deps);
|
|
2560
|
+
return true;
|
|
2561
|
+
}, { strict: true });
|
|
2562
|
+
const deadline = Date.now() + 2e3;
|
|
2563
|
+
while (!attempt()) {
|
|
2564
|
+
if (Date.now() >= deadline) throw new Error(`Startup evidence lock busy: ${runId}`);
|
|
2565
|
+
await new Promise((resolve2) => setTimeout(resolve2, 20));
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2568
|
+
async function settleBackgroundProcessExit(runId, code, signal, deps = {}) {
|
|
2569
|
+
const deadline = Date.now() + 2e3;
|
|
2570
|
+
while (true) {
|
|
2571
|
+
const settled = withRunRecordLock(runId, deps, () => {
|
|
2572
|
+
const record = readRunRecord(runId, deps);
|
|
2573
|
+
if (!record) return true;
|
|
2574
|
+
if (isRunTerminalStatus(record.status)) {
|
|
2575
|
+
record.processExit = { code, signal };
|
|
2576
|
+
writeRunRecord(record, deps);
|
|
2577
|
+
return true;
|
|
2578
|
+
}
|
|
2579
|
+
return false;
|
|
2580
|
+
}, { strict: true });
|
|
2581
|
+
if (settled === true) return;
|
|
2582
|
+
if (settled === false) {
|
|
2583
|
+
const result = transitionRunToTerminal(runId, {
|
|
2584
|
+
status: signal === "SIGTERM" || signal === "SIGKILL" ? "killed" : "failed",
|
|
2585
|
+
exitCode: code ?? 1,
|
|
2586
|
+
processExit: { code, signal },
|
|
2587
|
+
failureReason: signal === "SIGTERM" || signal === "SIGKILL" ? "cancelled" : "startup_failed",
|
|
2588
|
+
note: `Child exited without terminal result (code=${code}, signal=${signal})`
|
|
2589
|
+
}, deps);
|
|
2590
|
+
if (result.kind !== "contended") return;
|
|
2591
|
+
}
|
|
2592
|
+
if (Date.now() >= deadline) throw new Error(`Process exit settlement lock busy: ${runId}`);
|
|
2593
|
+
await (deps.sleep ?? defaultSleep)(20);
|
|
2594
|
+
}
|
|
2595
|
+
}
|
|
2537
2596
|
async function spawnLocalBackgroundRun(input, deps = {}) {
|
|
2538
2597
|
const homedir = deps.homedir ?? nodeHomedir;
|
|
2539
2598
|
const env = deps.env ?? (deps.homedir ? { ...process.env, NOLO_HOME: join2(homedir(), ".nolo") } : process.env);
|
|
@@ -2606,6 +2665,7 @@ async function spawnLocalBackgroundRun(input, deps = {}) {
|
|
|
2606
2665
|
...input.evidenceScope ? { evidenceScope: input.evidenceScope } : {},
|
|
2607
2666
|
...input.dispatchSpeedProvenance ? { dispatchSpeedProvenance: input.dispatchSpeedProvenance } : {},
|
|
2608
2667
|
runId,
|
|
2668
|
+
startup: { protocol: AGENT_RUN_PROTOCOL, phase: "spawn" },
|
|
2609
2669
|
agentKey: input.agentKey,
|
|
2610
2670
|
agentName: input.agentName?.trim() || shortAgentKey(input.agentKey),
|
|
2611
2671
|
...title ? { title } : {},
|
|
@@ -2636,17 +2696,32 @@ async function spawnLocalBackgroundRun(input, deps = {}) {
|
|
|
2636
2696
|
const rawArgsWithQueue = (input.rawArgs ?? []).some(
|
|
2637
2697
|
(arg) => arg === "--queue-file" || arg.startsWith("--queue-file=")
|
|
2638
2698
|
) ? input.rawArgs : [...input.rawArgs ?? [], "--queue-file", queuePath];
|
|
2639
|
-
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2699
|
+
let childCommand;
|
|
2700
|
+
try {
|
|
2701
|
+
childCommand = buildAgentRunChildCommand(
|
|
2702
|
+
{
|
|
2703
|
+
rawArgs: rawArgsWithQueue,
|
|
2704
|
+
commandPath: input.commandPath,
|
|
2705
|
+
cliEntrypointPath: input.cliEntrypointPath,
|
|
2706
|
+
messagePath
|
|
2707
|
+
},
|
|
2708
|
+
deps
|
|
2709
|
+
);
|
|
2710
|
+
} catch (error) {
|
|
2711
|
+
const result = await settleRunTerminalAuthoritatively(runId, {
|
|
2712
|
+
status: "failed",
|
|
2713
|
+
exitCode: 1,
|
|
2714
|
+
failureReason: error instanceof RuntimeVersionMismatchError ? "runtime_version_mismatch" : "startup_failed",
|
|
2715
|
+
note: String(error)
|
|
2716
|
+
}, resolvedDeps, (id, update, d) => transitionRunToTerminal(id, update, d));
|
|
2717
|
+
if (result.kind === "contended") throw new Error(`Startup settlement lock busy: ${runId}; ${error}`);
|
|
2718
|
+
throw error;
|
|
2719
|
+
}
|
|
2720
|
+
const { execPath, childArgs } = childCommand;
|
|
2648
2721
|
const childEnv = {
|
|
2649
2722
|
...env,
|
|
2723
|
+
NOLO_AGENT_RUN_PROTOCOL: AGENT_RUN_PROTOCOL,
|
|
2724
|
+
NOLO_AGENT_RUN_CONTENT_IDENTITY: HOST_RUNTIME_CONTENT_IDENTITY,
|
|
2650
2725
|
NOLO_AGENT_RUN_CHILD: "1",
|
|
2651
2726
|
NOLO_AGENT_RUN_ID: runId,
|
|
2652
2727
|
...record.writerLaunch ? { NOLO_WRITER_LAUNCH_ATTEMPT: record.writerLaunch.attemptId } : {}
|
|
@@ -2699,24 +2774,42 @@ async function spawnLocalBackgroundRun(input, deps = {}) {
|
|
|
2699
2774
|
reservation?.release("spawn_sync_failed");
|
|
2700
2775
|
if (input.claimLocalWrites) releaseUnspawnedLocalWriterClaim(runId, resolvedDeps);
|
|
2701
2776
|
} finally {
|
|
2702
|
-
finalizeRunRecord(runId, { status: "failed", exitCode: 1, note: String(error) }, resolvedDeps);
|
|
2777
|
+
finalizeRunRecord(runId, { status: "failed", exitCode: 1, failureReason: error instanceof RuntimeVersionMismatchError ? "runtime_version_mismatch" : "startup_failed", note: String(error) }, resolvedDeps);
|
|
2703
2778
|
}
|
|
2704
2779
|
throw error;
|
|
2705
2780
|
} finally {
|
|
2706
2781
|
fs.closeSync?.(logFd);
|
|
2707
2782
|
}
|
|
2708
2783
|
proc.once?.("error", (error) => {
|
|
2784
|
+
let note = String(error);
|
|
2709
2785
|
try {
|
|
2710
2786
|
reservation.release("child_error");
|
|
2711
2787
|
} catch (releaseError) {
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2788
|
+
note += `; reservation release failed: ${releaseError}`;
|
|
2789
|
+
}
|
|
2790
|
+
void settleRunTerminalAuthoritatively(runId, {
|
|
2791
|
+
status: "failed",
|
|
2792
|
+
exitCode: 1,
|
|
2793
|
+
failureReason: "startup_failed",
|
|
2794
|
+
note
|
|
2795
|
+
}, resolvedDeps, (id, update, d) => transitionRunToTerminal(id, update, d)).then((result) => {
|
|
2796
|
+
if (result.kind === "contended") throw new Error(`Startup settlement lock busy: ${runId}`);
|
|
2797
|
+
}).catch((error2) => {
|
|
2798
|
+
input.output?.write(`[nolo] background error settlement failed: ${error2}
|
|
2799
|
+
`);
|
|
2800
|
+
});
|
|
2801
|
+
});
|
|
2802
|
+
proc.once?.("exit", (code, signal) => {
|
|
2803
|
+
void settleBackgroundProcessExit(runId, code, signal, resolvedDeps).catch((error) => {
|
|
2804
|
+
input.output?.write(`[nolo] background exit settlement failed: ${error}
|
|
2805
|
+
`);
|
|
2806
|
+
});
|
|
2807
|
+
try {
|
|
2808
|
+
reservation.release("child_exit");
|
|
2809
|
+
} catch (error) {
|
|
2810
|
+
input.output?.write(`[nolo] reservation release failed: ${error}
|
|
2811
|
+
`);
|
|
2718
2812
|
}
|
|
2719
|
-
finalizeRunRecord(runId, { status: "failed", exitCode: 1, note: String(error) }, resolvedDeps);
|
|
2720
2813
|
});
|
|
2721
2814
|
const hostMemoryNotice = emitHostMemoryNotice(hostMemory, input.output);
|
|
2722
2815
|
if (typeof proc.pid === "number") {
|
|
@@ -2871,10 +2964,15 @@ function transitionRunToTerminal(runId, update, deps = {}, options = {}) {
|
|
|
2871
2964
|
if (!record2) return { kind: "not_found" };
|
|
2872
2965
|
const orphanCorrection = options.allowOverOrphaned === true && record2.status === "orphaned" && (update.status === "done" || update.status === "failed");
|
|
2873
2966
|
if (isAgentRunTerminalStatus(record2.status) && !orphanCorrection) {
|
|
2967
|
+
if (update.processExit) {
|
|
2968
|
+
record2.processExit = update.processExit;
|
|
2969
|
+
writeRunRecord(record2, deps);
|
|
2970
|
+
}
|
|
2874
2971
|
return { kind: "kept", record: record2 };
|
|
2875
2972
|
}
|
|
2876
2973
|
const now = deps.now ?? (() => /* @__PURE__ */ new Date());
|
|
2877
2974
|
record2.status = update.status;
|
|
2975
|
+
if (update.processExit) record2.processExit = update.processExit;
|
|
2878
2976
|
if (typeof update.exitCode === "number") record2.exitCode = update.exitCode;
|
|
2879
2977
|
if (update.dialogId) record2.dialogId = update.dialogId;
|
|
2880
2978
|
if (typeof update.credits === "number" && Number.isFinite(update.credits)) {
|
|
@@ -2928,7 +3026,7 @@ function transitionRunToTerminal(runId, update, deps = {}, options = {}) {
|
|
|
2928
3026
|
};
|
|
2929
3027
|
record2.resultArtifacts = [...(record2.resultArtifacts ?? []).filter((a) => a.path !== path), artifact];
|
|
2930
3028
|
};
|
|
2931
|
-
if (typeof update.lastAssistantText === "string" && update.lastAssistantText || update.acceptance?.checks.observations?.length) {
|
|
3029
|
+
if (typeof update.lastAssistantText === "string" && update.lastAssistantText || update.acceptance?.checks.observations?.length || update.failureReason === "startup_failed" || update.failureReason === "runtime_protocol_mismatch" || update.failureReason === "runtime_version_mismatch") {
|
|
2932
3030
|
try {
|
|
2933
3031
|
const fs = deps.fs ?? nodeFs2;
|
|
2934
3032
|
const resultFile = join2(resolveRunsDir(deps.env, deps.homedir), `${runId}.result.md`);
|
|
@@ -3678,6 +3776,7 @@ export {
|
|
|
3678
3776
|
readRunRecord,
|
|
3679
3777
|
backfillRunRecordParentDialog,
|
|
3680
3778
|
listRunRecords,
|
|
3779
|
+
listRunRecordsAsync,
|
|
3681
3780
|
findRunRecordByPid,
|
|
3682
3781
|
findRunRecord,
|
|
3683
3782
|
DEFAULT_LIST_LIMIT,
|
|
@@ -3695,6 +3794,8 @@ export {
|
|
|
3695
3794
|
awaitLocalWriterChild,
|
|
3696
3795
|
resolveLocalContinuation,
|
|
3697
3796
|
registerLocalForegroundWriter,
|
|
3797
|
+
recordRunStartup,
|
|
3798
|
+
settleBackgroundProcessExit,
|
|
3698
3799
|
spawnLocalBackgroundRun,
|
|
3699
3800
|
ackRunRecord,
|
|
3700
3801
|
DEFAULT_ACK_LEASE_TTL_MS,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildStaticUserPolicyContext,
|
|
3
3
|
resolveSpaceContextPreloadPlan
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZXF6D3I6.js";
|
|
5
5
|
import {
|
|
6
6
|
fetchReferenceContents,
|
|
7
7
|
mergeReferences,
|
|
8
8
|
resolveReferenceAssets,
|
|
9
9
|
resolveToolsFromKeys
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-MDZWUD3R.js";
|
|
11
11
|
import {
|
|
12
12
|
UI_CARD_ENVELOPE_MAX_BYTES,
|
|
13
13
|
getAllToolRuns,
|
|
@@ -18,32 +18,32 @@ import {
|
|
|
18
18
|
selectSpaceContextLevel,
|
|
19
19
|
selectUserTonePreset,
|
|
20
20
|
uiCardFallback
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import {
|
|
23
|
-
getDocState
|
|
24
|
-
} from "./chunk-LA7JYAKF.js";
|
|
21
|
+
} from "./chunk-XJPLSAPJ.js";
|
|
25
22
|
import {
|
|
26
23
|
resolveToolBaseUrl
|
|
27
24
|
} from "./chunk-4JVNURX4.js";
|
|
25
|
+
import {
|
|
26
|
+
getDocState
|
|
27
|
+
} from "./chunk-VSYTM22R.js";
|
|
28
28
|
import {
|
|
29
29
|
getTableState
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-GYS5FUYR.js";
|
|
31
|
+
import {
|
|
32
|
+
getCurrentSpaceIdRaw,
|
|
33
|
+
getViewMode
|
|
34
|
+
} from "./chunk-547ENH5T.js";
|
|
31
35
|
import {
|
|
32
36
|
PERSONALIZATION_DIALOG_CATEGORY,
|
|
33
37
|
buildPersonalizationDialogPolicyContext,
|
|
34
38
|
selectAllMsgs
|
|
35
|
-
} from "./chunk-
|
|
36
|
-
import {
|
|
37
|
-
getCurrentSpaceIdRaw,
|
|
38
|
-
getViewMode
|
|
39
|
-
} from "./chunk-NO3VBWTL.js";
|
|
39
|
+
} from "./chunk-R3NEQZ53.js";
|
|
40
40
|
import {
|
|
41
41
|
selectPendingFiles
|
|
42
42
|
} from "./chunk-S2NTVGA2.js";
|
|
43
43
|
import {
|
|
44
44
|
read,
|
|
45
45
|
selectById
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-CMMI3DAT.js";
|
|
47
47
|
import {
|
|
48
48
|
getSessionSnapshotForState,
|
|
49
49
|
selectIdentityUserBalance,
|
|
@@ -54,22 +54,22 @@ import {
|
|
|
54
54
|
getModelPricing,
|
|
55
55
|
getPrices,
|
|
56
56
|
hasExplicitAgentPricing
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-SRCCSTIM.js";
|
|
58
58
|
import {
|
|
59
59
|
projectToolMessageContent
|
|
60
60
|
} from "./chunk-2WZXXAQD.js";
|
|
61
61
|
import {
|
|
62
62
|
resolveAgentRecommendedSkillNames,
|
|
63
63
|
resolveAgentRequiredPackIds
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-FJSNBZXR.js";
|
|
65
65
|
import {
|
|
66
66
|
attachmentKind,
|
|
67
67
|
extractReferenceKeysFromMessage,
|
|
68
68
|
normalizeAttachmentPart
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-QRGDJA4B.js";
|
|
70
70
|
import {
|
|
71
71
|
getModelContextWindow
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-L32W3PRP.js";
|
|
73
73
|
import {
|
|
74
74
|
asRecordOrEmpty
|
|
75
75
|
} from "./chunk-KX6YBIHG.js";
|
|
@@ -85,7 +85,7 @@ import {
|
|
|
85
85
|
expandEnabledPackPromptPatches,
|
|
86
86
|
expandEnabledPacks,
|
|
87
87
|
resolveEffectiveEnabledPacks
|
|
88
|
-
} from "./chunk-
|
|
88
|
+
} from "./chunk-G7IUT2V3.js";
|
|
89
89
|
import {
|
|
90
90
|
canonicalizeToolNames,
|
|
91
91
|
prioritizeToolNames
|
|
@@ -93,26 +93,26 @@ import {
|
|
|
93
93
|
import {
|
|
94
94
|
extractCustomId
|
|
95
95
|
} from "./chunk-M2EJHDJP.js";
|
|
96
|
-
import {
|
|
97
|
-
getModelConfig,
|
|
98
|
-
getProviderByModelName
|
|
99
|
-
} from "./chunk-KYH7XW3K.js";
|
|
100
|
-
import {
|
|
101
|
-
isRecord
|
|
102
|
-
} from "./chunk-KUG52IAP.js";
|
|
103
|
-
import {
|
|
104
|
-
buildLinkedSpacesSection,
|
|
105
|
-
buildSpaceContextLayer
|
|
106
|
-
} from "./chunk-JWXITTQB.js";
|
|
107
96
|
import {
|
|
108
97
|
metaKey
|
|
109
98
|
} from "./chunk-SYTHYBMI.js";
|
|
110
99
|
import {
|
|
111
100
|
asNonEmptyStringArray
|
|
112
101
|
} from "./chunk-I42VC5KR.js";
|
|
102
|
+
import {
|
|
103
|
+
buildLinkedSpacesSection,
|
|
104
|
+
buildSpaceContextLayer
|
|
105
|
+
} from "./chunk-3P54D2E4.js";
|
|
113
106
|
import {
|
|
114
107
|
asTrimmedString
|
|
115
108
|
} from "./chunk-3EUW3WEO.js";
|
|
109
|
+
import {
|
|
110
|
+
getModelConfig,
|
|
111
|
+
getProviderByModelName
|
|
112
|
+
} from "./chunk-CD3RU7XL.js";
|
|
113
|
+
import {
|
|
114
|
+
isRecord
|
|
115
|
+
} from "./chunk-KUG52IAP.js";
|
|
116
116
|
import {
|
|
117
117
|
asOptionalFiniteNumber
|
|
118
118
|
} from "./chunk-WWC7I6TA.js";
|
|
@@ -79,14 +79,17 @@ function mergeWindow(into, win) {
|
|
|
79
79
|
existing.source = win.source;
|
|
80
80
|
}
|
|
81
81
|
function parseQuotaWindowScope(scope) {
|
|
82
|
-
const matched = /^(gemini|3p)-(.+)$/.exec(scope);
|
|
82
|
+
const matched = /^(gemini|3p|hydrogen|argon)-(.+)$/.exec(scope);
|
|
83
83
|
return matched ? { family: matched[1], period: matched[2] } : { period: scope };
|
|
84
84
|
}
|
|
85
85
|
function resolveQuotaWindowFamily(model) {
|
|
86
86
|
if (typeof model !== "string" || !model.trim()) return void 0;
|
|
87
|
+
if (/(?:^|[/-])gemini-[^/]*hydrogen(?:-|$)/i.test(model)) return "hydrogen";
|
|
88
|
+
if (/(?:^|[/-])gemini-[^/]*argon(?:-|$)/i.test(model)) return "argon";
|
|
87
89
|
return /gemini/i.test(model) ? "gemini" : "3p";
|
|
88
90
|
}
|
|
89
|
-
function isQuotaWindowRelevantToFamily(scope, family) {
|
|
91
|
+
function isQuotaWindowRelevantToFamily(scope, family, source) {
|
|
92
|
+
if (scope === "gemini-5h" && source?.endsWith(":fetchAvailableModels")) return false;
|
|
90
93
|
if (typeof scope !== "string") return true;
|
|
91
94
|
const scopeFamily = parseQuotaWindowScope(scope).family;
|
|
92
95
|
return scopeFamily === void 0 || family === void 0 || scopeFamily === family;
|
|
@@ -95,7 +98,7 @@ function selectQuotaWindowsForModel(quota, now, model) {
|
|
|
95
98
|
if (!quota || !Array.isArray(quota.windows)) return [];
|
|
96
99
|
const family = resolveQuotaWindowFamily(model);
|
|
97
100
|
return quota.windows.filter(
|
|
98
|
-
(window) => !isQuotaWindowExpired(window, now) && isQuotaWindowRelevantToFamily(window?.scope, family)
|
|
101
|
+
(window) => !isQuotaWindowExpired(window, now) && isQuotaWindowRelevantToFamily(window?.scope, family, window?.source)
|
|
99
102
|
);
|
|
100
103
|
}
|
|
101
104
|
function isQuotaWindowExpired(window, now) {
|
|
@@ -373,7 +376,7 @@ function shouldClearCooldownFromQuota(entry, quota, now, options) {
|
|
|
373
376
|
if (!quota || !(quota.observedAt > entry.markedAt)) return false;
|
|
374
377
|
const family = resolveQuotaWindowFamily(options?.model);
|
|
375
378
|
const relevantWindows = quota.windows.filter(
|
|
376
|
-
(window) => isQuotaWindowRelevantToFamily(window.scope, family)
|
|
379
|
+
(window) => isQuotaWindowRelevantToFamily(window.scope, family, window.source)
|
|
377
380
|
);
|
|
378
381
|
const subscriptionWindows = relevantWindows.filter(isSubscriptionPeriodWindow);
|
|
379
382
|
if (subscriptionWindows.length === 0) return false;
|
|
@@ -409,7 +412,7 @@ function resolveAgentAvailability(agent, now = Date.now()) {
|
|
|
409
412
|
const hasObservedAt = Boolean(quota) && typeof quota?.observedAt === "number" && Number.isFinite(quota.observedAt);
|
|
410
413
|
const family = resolveQuotaWindowFamily(agent?.model);
|
|
411
414
|
const relevantWindows = (quota?.windows ?? []).filter(
|
|
412
|
-
(window) => isQuotaWindowRelevantToFamily(window?.scope, family)
|
|
415
|
+
(window) => isQuotaWindowRelevantToFamily(window?.scope, family, window?.source)
|
|
413
416
|
);
|
|
414
417
|
const hasWindows = relevantWindows.length > 0;
|
|
415
418
|
const hasValidQuota = isAdmissible && hasWindows;
|
|
@@ -647,6 +650,7 @@ function resolveCredentialCandidateKeys(key) {
|
|
|
647
650
|
if (!key) return [];
|
|
648
651
|
const trimmed = key.trim();
|
|
649
652
|
if (!trimmed) return [];
|
|
653
|
+
if (/\|quota:(?:gemini|3p|hydrogen|argon)$/.test(trimmed)) return [trimmed];
|
|
650
654
|
const candidates = [trimmed];
|
|
651
655
|
const atIndex = trimmed.lastIndexOf("@");
|
|
652
656
|
if (atIndex > 0) {
|
|
@@ -677,7 +681,21 @@ function resolveCredentialKey(agent) {
|
|
|
677
681
|
function resolveCredentialKeyWithFallback(agent) {
|
|
678
682
|
if (isPublicOrSystemAgentRecord(agent)) return void 0;
|
|
679
683
|
const byRef = resolveCredentialKey(agent);
|
|
680
|
-
if (byRef)
|
|
684
|
+
if (byRef) {
|
|
685
|
+
const ref = byRef.split("@")[0]?.trim().toLowerCase();
|
|
686
|
+
const provider = agent?.provider;
|
|
687
|
+
let cloudCode = false;
|
|
688
|
+
try {
|
|
689
|
+
const host = new URL(String(agent?.customProviderUrl ?? "")).hostname;
|
|
690
|
+
cloudCode = /^(?:daily-|daily-sandbox-)?cloudcode-pa\.googleapis\.com$/.test(host);
|
|
691
|
+
} catch {
|
|
692
|
+
}
|
|
693
|
+
if (ref === "antigravity" || ref === "gemini" || provider === "google-antigravity" || cloudCode) {
|
|
694
|
+
const family = resolveQuotaWindowFamily(typeof agent?.model === "string" ? agent.model : void 0);
|
|
695
|
+
if (family) return `${byRef}|quota:${family}`;
|
|
696
|
+
}
|
|
697
|
+
return byRef;
|
|
698
|
+
}
|
|
681
699
|
if (!agent || typeof agent !== "object") return void 0;
|
|
682
700
|
const endpoint = agent.customProviderUrl;
|
|
683
701
|
if (typeof endpoint === "string") {
|
|
@@ -3,13 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-5ZUL4CUO.js";
|
|
4
4
|
import {
|
|
5
5
|
getModelContextWindow
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-L32W3PRP.js";
|
|
7
7
|
import {
|
|
8
8
|
BUILTIN_NOLO_AGENT_KEY
|
|
9
9
|
} from "./chunk-ILHQ2AXT.js";
|
|
10
|
-
import {
|
|
11
|
-
isRecord
|
|
12
|
-
} from "./chunk-KUG52IAP.js";
|
|
13
10
|
import {
|
|
14
11
|
isPageKey,
|
|
15
12
|
isTableMetaKey
|
|
@@ -20,6 +17,9 @@ import {
|
|
|
20
17
|
import {
|
|
21
18
|
asTrimmedString
|
|
22
19
|
} from "./chunk-3EUW3WEO.js";
|
|
20
|
+
import {
|
|
21
|
+
isRecord
|
|
22
|
+
} from "./chunk-KUG52IAP.js";
|
|
23
23
|
import {
|
|
24
24
|
asOptionalTrimmedString
|
|
25
25
|
} from "./chunk-G3SUCT4W.js";
|
|
@@ -493,13 +493,6 @@ function resolveTruncatedReasoningTailLog(reason, reasoning_content) {
|
|
|
493
493
|
}
|
|
494
494
|
|
|
495
495
|
export {
|
|
496
|
-
DEFAULT_AUTO_EXECUTION_PROFILE,
|
|
497
|
-
resolveAutoExecutionProfile,
|
|
498
|
-
ATTACHMENT_PART_TYPE,
|
|
499
|
-
ATTACHMENT_PART_VERSION,
|
|
500
|
-
normalizeAttachmentPart,
|
|
501
|
-
attachmentKind,
|
|
502
|
-
describeAttachmentForModel,
|
|
503
496
|
isCodexOAuthAgent,
|
|
504
497
|
resolveCodexOAuthEffectiveModel,
|
|
505
498
|
CODEX_OAUTH_CATALOG_TTL_MS,
|
|
@@ -511,6 +504,13 @@ export {
|
|
|
511
504
|
codexOAuthCatalogWindow,
|
|
512
505
|
devinChannelContextWindow,
|
|
513
506
|
resolveAgentContextWindow,
|
|
507
|
+
DEFAULT_AUTO_EXECUTION_PROFILE,
|
|
508
|
+
resolveAutoExecutionProfile,
|
|
509
|
+
ATTACHMENT_PART_TYPE,
|
|
510
|
+
ATTACHMENT_PART_VERSION,
|
|
511
|
+
normalizeAttachmentPart,
|
|
512
|
+
attachmentKind,
|
|
513
|
+
describeAttachmentForModel,
|
|
514
514
|
asOptionalJsonRecord,
|
|
515
515
|
extractReferenceKeysFromMessage,
|
|
516
516
|
EMPTY_ASSISTANT_REPAIR_PROMPT,
|