nolo-cli 0.98.0-alpha.4 → 0.98.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.
Files changed (205) hide show
  1. package/README.md +1 -1
  2. package/{_executeModel-HYZ4NXRJ.js → _executeModel-YEIQBSEM.js} +74 -67
  3. package/action-PNPQLJHG.js +20 -0
  4. package/{addContentAction-O7R66HEX.js → addContentAction-RBOUD7SJ.js} +12 -11
  5. package/{addDialogAgentAction-74OA7KYP.js → addDialogAgentAction-IODCR6TB.js} +18 -19
  6. package/{agentDeleteCommand-2YAHAZFJ.js → agentDeleteCommand-4PLHGGLA.js} +47 -42
  7. package/{agentEmailCommands-SLEQANTK.js → agentEmailCommands-NXWEK7QA.js} +97 -87
  8. package/agentListCommands-VRVS3BJL.js +742 -0
  9. package/{agentMachineCommands-KBI77S35.js → agentMachineCommands-DJH5VXOD.js} +48 -43
  10. package/{agentProviderCommands-GNPTL5XR.js → agentProviderCommands-IRNZXVGE.js} +1 -1
  11. package/{agentPullCommand-O5MPVJ5E.js → agentPullCommand-B4T2DJ5H.js} +1 -1
  12. package/agentRecordCommands-SQCFY7TA.js +138 -0
  13. package/agentRunCommand-3HT2JILG.js +167 -0
  14. package/{agentRunControl-AVJR4JW4.js → agentRunControl-3HWA2LLQ.js} +2 -2
  15. package/{agentRuntimeLocal-VXZSDIGT.js → agentRuntimeLocal-7TFUAJON.js} +48 -39
  16. package/{agentSlice-ZOYISPZD.js → agentSlice-XTZIXRNX.js} +14 -13
  17. package/{appDeleteCommands-32MHLR4L.js → appDeleteCommands-EZLI7EIO.js} +46 -41
  18. package/{appDeployCommands-WCQOUSOB.js → appDeployCommands-QBWG5BGL.js} +46 -41
  19. package/{appDeployStatusCommands-6QKB7DYN.js → appDeployStatusCommands-ZLG46B3T.js} +46 -41
  20. package/{appGetCommands-SFAPP5PB.js → appGetCommands-P4D34JD2.js} +46 -41
  21. package/{appListCommands-EKUBDRUO.js → appListCommands-JMYHZBQH.js} +46 -41
  22. package/{authCommand-F4EFRRX6.js → authCommand-NHDLY3IB.js} +118 -24
  23. package/{authCommands-RGOGCPP6.js → authCommands-UDBJVSZU.js} +7 -5
  24. package/{builtinSkillRegistry-FUAVTRVZ.js → builtinSkillRegistry-MAR5LPAC.js} +10 -8
  25. package/{chromeCommands-FZYAU75D.js → chromeCommands-K27J4OVZ.js} +124 -28
  26. package/{chromeOpsCommands-62P2Q2YB.js → chromeOpsCommands-IXRLN57H.js} +4 -3
  27. package/{chunk-6OZ36FXI.js → chunk-27ONFIEY.js} +22 -4
  28. package/{chunk-JEDZAO7L.js → chunk-2SYTUTLI.js} +257 -37
  29. package/{chunk-53HEEOTT.js → chunk-2WJ57RJA.js} +83 -16
  30. package/{chunk-OIVSQH2O.js → chunk-3BXNTXYI.js} +299 -5
  31. package/{chunk-2D66PZ54.js → chunk-3WHINT3R.js} +24 -77
  32. package/{chunk-ABQYVJBJ.js → chunk-46Y5D2BZ.js} +5 -5
  33. package/{chunk-EYAQT56M.js → chunk-4DPP773Q.js} +2 -2
  34. package/{chunk-H62HCIUP.js → chunk-4FFUDT6D.js} +24 -21
  35. package/chunk-4LCOCOR5.js +50 -0
  36. package/{chunk-2GRGFCF6.js → chunk-4VJAC32I.js} +2 -1
  37. package/{chunk-IIVGDG4I.js → chunk-4YSOUKUR.js} +13 -7
  38. package/{chunk-MC4XLIJ7.js → chunk-523DITKR.js} +1 -1
  39. package/{chunk-E4MARS3Q.js → chunk-5GVBDNTO.js} +1 -1
  40. package/chunk-5J3PYNUP.js +255 -0
  41. package/chunk-5MMAK75Q.js +15 -0
  42. package/{chunk-JPGCXHNM.js → chunk-5OA5HMTL.js} +1 -1
  43. package/{chunk-42V6BK2E.js → chunk-62IL3KQV.js} +4 -34
  44. package/{chunk-3BMYXEUW.js → chunk-6O4IK4V2.js} +1 -1
  45. package/{chunk-GQBOR3G6.js → chunk-7KVZ5LDQ.js} +2 -2
  46. package/{chunk-DNCEALKX.js → chunk-7MMSLEPA.js} +22 -29
  47. package/{chunk-L5UXH3B2.js → chunk-7TKWCTSY.js} +22 -6
  48. package/chunk-A4SQRTZ6.js +15 -0
  49. package/{chunk-7S4YWN7P.js → chunk-ADBZWMFB.js} +4 -4
  50. package/chunk-AGIM7IMJ.js +147 -0
  51. package/{chunk-5UTFL4QJ.js → chunk-AOTBKDRK.js} +7 -0
  52. package/{chunk-Q554LLSI.js → chunk-AUDNYVRC.js} +1 -1
  53. package/chunk-BMQ2MJUK.js +153 -0
  54. package/{chunk-6YTOJY35.js → chunk-BZ7NPA6G.js} +35 -2
  55. package/chunk-CHOZJMJS.js +78 -0
  56. package/{chunk-ACTMNVHM.js → chunk-CYSYR67N.js} +1 -1
  57. package/{chunk-37NKTC3Q.js → chunk-CYYWWZV7.js} +1 -1
  58. package/{chunk-GBRG75BQ.js → chunk-D2MDMY2M.js} +1 -0
  59. package/chunk-DZ7R5V3Y.js +164 -0
  60. package/{chunk-3VNWWVKB.js → chunk-E3YWHWCR.js} +50 -18
  61. package/{chunk-V4MJDUSR.js → chunk-E73ON47R.js} +2 -2
  62. package/{chunk-KQ4ONNQD.js → chunk-EKPKW6RM.js} +155 -8
  63. package/{chunk-TRV2MIDW.js → chunk-EXAJ6DCR.js} +1 -0
  64. package/{chunk-HJUYAD4A.js → chunk-FJ5BGMNM.js} +5 -5
  65. package/{chunk-2F7RJC6L.js → chunk-FOXQ7BAB.js} +1 -1
  66. package/{chunk-6IG4XSS6.js → chunk-FY7DCYW7.js} +88 -17
  67. package/{chunk-J4MOO56S.js → chunk-GARACBQB.js} +10 -2
  68. package/chunk-GMZLP5DV.js +82 -0
  69. package/{chunk-FDTR4QJ6.js → chunk-H6A6X4EK.js} +32 -1
  70. package/{chunk-DVINR3PL.js → chunk-HDLLCBRF.js} +1 -1
  71. package/{chunk-QOKAKDPE.js → chunk-HIM3FCLF.js} +0 -1
  72. package/{chunk-ONXOABJR.js → chunk-HNGRBWYF.js} +3 -0
  73. package/{chunk-VLTIYV3X.js → chunk-HP57OUJO.js} +4 -4
  74. package/{chunk-G4EBXCWF.js → chunk-IM6ZMFRL.js} +550 -515
  75. package/{chunk-34BLIAHQ.js → chunk-JY3XHK42.js} +47 -67
  76. package/{chunk-GPCZ7UXG.js → chunk-K6U4NKFJ.js} +1 -1
  77. package/{chunk-6VFARHZW.js → chunk-KQQMCLDJ.js} +934 -1091
  78. package/{chunk-T37GTQYU.js → chunk-KVKYLJOA.js} +20 -11
  79. package/{chunk-4OEFYTWL.js → chunk-LKERWYPX.js} +67 -48
  80. package/{chunk-OEVAY4J6.js → chunk-LNVJHIGA.js} +18 -20
  81. package/{chunk-LS2ZANRJ.js → chunk-LOCNXNOU.js} +1 -1
  82. package/chunk-M6NBAHCD.js +7881 -0
  83. package/{chunk-PUOC4YRO.js → chunk-M7VLQGQP.js} +11 -0
  84. package/chunk-NFG4GW2E.js +13536 -0
  85. package/{chunk-BFU6C242.js → chunk-NMFV26UG.js} +1 -1
  86. package/{chunk-FZGV4FGK.js → chunk-NUHHBEJC.js} +378 -187
  87. package/chunk-NWENLDMM.js +42 -0
  88. package/{chunk-AEOE4Z6Q.js → chunk-NZWAO6LH.js} +13 -15
  89. package/chunk-OCZKATRC.js +129 -0
  90. package/chunk-OW4APERY.js +870 -0
  91. package/{chunk-KQHGZWSV.js → chunk-OXME3PEE.js} +1 -1
  92. package/{chunk-TOP2VXOR.js → chunk-PCF3QU5Q.js} +5 -5
  93. package/{chunk-WV42OMV7.js → chunk-PTDYOADJ.js} +8 -8
  94. package/{chunk-PKUGW3X6.js → chunk-SDUYSRTJ.js} +23 -28
  95. package/{chunk-5H7KJX7J.js → chunk-SEB5HAUU.js} +5 -5
  96. package/{chunk-6D6VBVEW.js → chunk-SNMQMOD2.js} +80 -14
  97. package/{chunk-ITM7D3UQ.js → chunk-TN3SIMJZ.js} +11 -9
  98. package/{chunk-BYMV6QZG.js → chunk-TNIX77YM.js} +4 -0
  99. package/{chunk-Z77CRGTW.js → chunk-TVCAR26G.js} +1 -1
  100. package/chunk-TY3TIUJK.js +89 -0
  101. package/{chunk-I3TQJXQ7.js → chunk-U3C3IA32.js} +9 -2
  102. package/{chunk-RG6JBBX5.js → chunk-U7XXEI5R.js} +166 -13
  103. package/{chunk-UZGQNTVW.js → chunk-UA324D4O.js} +8 -6
  104. package/{chunk-V7BKTIF6.js → chunk-UFUTWXPR.js} +19 -17
  105. package/chunk-UJXNKP5V.js +760 -0
  106. package/{chunk-UKZDAFYT.js → chunk-UM4PH574.js} +6 -10
  107. package/{chunk-XDJFSBVV.js → chunk-UUMRZHVT.js} +24 -5
  108. package/{chunk-GEPUP7OO.js → chunk-UVKDJUTL.js} +3 -3
  109. package/{chunk-5ZYCLPXL.js → chunk-V4BX25AC.js} +873 -227
  110. package/{chunk-ZCYXJSTU.js → chunk-V5OWQOJZ.js} +19 -88
  111. package/{chunk-NA35QHCF.js → chunk-V7Y6KRAH.js} +1 -1
  112. package/{chunk-3DII57IT.js → chunk-VCAQFMVN.js} +1 -1
  113. package/{chunk-JRQFUXY7.js → chunk-VEYL5MO5.js} +99 -22
  114. package/chunk-VIWDGTDA.js +8 -0
  115. package/chunk-VJVNU77E.js +83 -0
  116. package/{chunk-UKWGR5SS.js → chunk-VY6VFGKR.js} +194 -1144
  117. package/{chunk-BP4XNZRM.js → chunk-W72ISAKC.js} +4 -4
  118. package/{chunk-DHDMC6FO.js → chunk-WCGC6S77.js} +14 -9
  119. package/{chunk-QDSINZM3.js → chunk-WJ3B6FX6.js} +1 -14
  120. package/{chunk-HVURBGF3.js → chunk-XFUBXRVI.js} +6 -6
  121. package/{chunk-O6OSWFZQ.js → chunk-XUWRURDF.js} +6 -0
  122. package/{chunk-Q67DOFOO.js → chunk-Y3PMXGLH.js} +2 -0
  123. package/{chunk-ETI2NYVF.js → chunk-YPOPJAKN.js} +4 -4
  124. package/{chunk-SH43IESU.js → chunk-YUNJN43V.js} +44 -9
  125. package/chunk-YV25TM3R.js +780 -0
  126. package/{chunk-PDIBG2WC.js → chunk-ZDXOUUPB.js} +67 -45
  127. package/{chunk-YRPASJCG.js → chunk-ZH7YLZC5.js} +10 -10
  128. package/chunk-ZRAU6T47.js +56 -0
  129. package/commandRegistry-YXINJIJK.js +833 -0
  130. package/{contentThunks-G55OKUFE.js → contentThunks-ZZVD2LBR.js} +36 -34
  131. package/{cooldownCommands-REAWYVTY.js → cooldownCommands-ZLEPIB4A.js} +2 -2
  132. package/{createAgentAutomationAction-D2J2O5GS.js → createAgentAutomationAction-B2TFWNDC.js} +38 -36
  133. package/createDialogAction-DVG2MYBF.js +69 -0
  134. package/{createPageAction-FHZBN7DJ.js → createPageAction-UXBWURHH.js} +45 -42
  135. package/{chunk-AJ3A3445.js → cursorProvider-YGGNMVWX.js} +2496 -9897
  136. package/{dbSlice-XVWBAGYN.js → dbSlice-Q25STFGJ.js} +11 -10
  137. package/{deleteFile-YG6QMJLU.js → deleteFile-AJ2EZMHT.js} +7 -6
  138. package/{dialogCommands-5J56DFWN.js → dialogCommands-243UITH3.js} +49 -45
  139. package/{dialogSlice-D4V3HURH.js → dialogSlice-B77ICP3A.js} +40 -33
  140. package/{dist-VODFSGNG.js → dist-NJC2W7I4.js} +61 -54
  141. package/{docCreateCommands-KYI2DC2U.js → docCreateCommands-RT6AVFDR.js} +48 -43
  142. package/{docDeleteCommands-67REUSRY.js → docDeleteCommands-TMKHOR5F.js} +49 -44
  143. package/{docReadCommands-HOSVSBDJ.js → docReadCommands-KIDSKS6N.js} +47 -42
  144. package/{docStore-5LROPEEP.js → docStore-NBER5SWJ.js} +16 -12
  145. package/{docUpdateCommands-EMGCSMXY.js → docUpdateCommands-C6OCR767.js} +48 -43
  146. package/{fetchMessages-EIU7UFFK.js → fetchMessages-I5ICDDHM.js} +5 -5
  147. package/{getPricing-LUSEABA6.js → getPricing-NMMFT3YI.js} +4 -4
  148. package/{handleSendMessageAction-QBPDYSLZ.js → handleSendMessageAction-4DBKTZDW.js} +110 -86
  149. package/index.js +87 -884
  150. package/{localDialogRead-BTFJ4V2I.js → localDialogRead-ZHZ3KXDM.js} +2 -2
  151. package/{localRuntimeAuthority-6IR6BBXE.js → localRuntimeAuthority-TU6OBC76.js} +9 -6
  152. package/{localRuntimeDb-SYQGUF4U.js → localRuntimeDb-VKWVOPPI.js} +1 -1
  153. package/{machineCommands-4ISPVTPN.js → machineCommands-Y2BN2TCO.js} +91 -81
  154. package/machineWsRunDispatch-POB6IF6W.js +154 -0
  155. package/{memberThunks-QGFLFVCI.js → memberThunks-R75S3RWP.js} +20 -18
  156. package/{models-T3SG6MJ5.js → models-ZPU5EDF4.js} +2 -2
  157. package/oauthTokenStore-ITEB663N.js +23 -0
  158. package/package.json +1 -1
  159. package/pdf-U6KSUEZZ.js +26435 -0
  160. package/processSpawn-SOAV3FEV.js +11 -0
  161. package/profileConfig-ZGOFORWV.js +43 -0
  162. package/{providerPresetApply-FG6NZ57W.js → providerPresetApply-TEBH7FDX.js} +7 -7
  163. package/{providerRegistry-757OWH3O.js → providerRegistry-CBJLNCET.js} +11 -7
  164. package/{read-COE3ZYR6.js → read-SRQMNO26.js} +7 -6
  165. package/{readDocTool-5USN4A6V.js → readDocTool-RC3JUNJ2.js} +5 -3
  166. package/{readlineWorkspace-JFADM567.js → readlineWorkspace-OLCGKYLQ.js} +2704 -2060
  167. package/{removeDialogAgentAction-IX3MN2ZO.js → removeDialogAgentAction-46XQV5Q7.js} +21 -25
  168. package/{runAgentClientLoop-JFFIFP7N.js → runAgentClientLoop-BFVCLCBO.js} +75 -69
  169. package/{runtimeDoctorCommands-X6WDBEQX.js → runtimeDoctorCommands-PIVSBZRZ.js} +4 -4
  170. package/runtimeModeArgs-2Y7BALTO.js +31 -0
  171. package/{setDialogExtraReferencesAction-X4HCPNZL.js → setDialogExtraReferencesAction-J4V5ADQF.js} +15 -13
  172. package/{setPrimaryDialogAgentAction-4GMIQLOD.js → setPrimaryDialogAgentAction-UHHV2QZW.js} +22 -26
  173. package/{chunk-AFUORTY4.js → settingThunks-PPZZZOWN.js} +226 -940
  174. package/{skillDiscovery-CYUCJMAG.js → skillDiscovery-ZBU76COE.js} +3 -3
  175. package/{slateUtils-RIZES3PV.js → slateUtils-NGV2NMKM.js} +1 -1
  176. package/{spaceCommands-NKJVJCQQ.js → spaceCommands-WQBSC4VD.js} +51 -46
  177. package/{streamAgentChatTurn-HFVTDCFD.js → streamAgentChatTurn-M7V35IXY.js} +199 -104
  178. package/{switchDialogAgentAction-N52LRPA3.js → switchDialogAgentAction-A2TMVGAE.js} +18 -19
  179. package/{tableCommands-O6NWHFKV.js → tableCommands-6U4BMLRR.js} +10 -10
  180. package/{toolApiClient-QVJ6HDNN.js → toolApiClient-EJT6TMFG.js} +3 -3
  181. package/tools-4XIEV6FW.js +116 -0
  182. package/{tuiSummaryLlmCaller-WFRWERGK.js → tuiSummaryLlmCaller-Q65IBDGO.js} +24 -21
  183. package/{updateCommands-2M74UL7P.js → updateCommands-4EHDLF5J.js} +3 -3
  184. package/{updateDialogTitleAction-PER2C6MR.js → updateDialogTitleAction-TFQFP7FE.js} +82 -44
  185. package/action-YVYQEAAV.js +0 -31
  186. package/agentListCommands-KMS675GZ.js +0 -406
  187. package/agentRecordCommands-IPPPUHG4.js +0 -128
  188. package/agentRunCommand-24XO4RDT.js +0 -155
  189. package/browser-image-compression-MFDTD7K6.js +0 -1763
  190. package/chatQueueReduxAdapter-PMAMSHG7.js +0 -186
  191. package/chunk-M76ECQRD.js +0 -13658
  192. package/chunk-MEYIRKDN.js +0 -8967
  193. package/chunk-OCSGDPAT.js +0 -18885
  194. package/chunk-Q5FJJ6XI.js +0 -103
  195. package/chunk-S7Z2HMCN.js +0 -25
  196. package/chunk-Y5GCAMGP.js +0 -9
  197. package/chunk-YPREESF4.js +0 -225
  198. package/createDialogAction-E2EVICIE.js +0 -65
  199. package/machineWsRunDispatch-L4MKXQAO.js +0 -144
  200. package/settingSlice-ZQZVUPKK.js +0 -204
  201. package/syncMapping-N6RGXGBW.js +0 -437
  202. package/tools-BBBCUOUZ.js +0 -110
  203. package/{chunk-VMFTFOWF.js → chunk-3AH7LNUB.js} +7 -7
  204. package/{chunk-X7HHHIOZ.js → chunk-Y6ROFCZO.js} +0 -0
  205. package/{db-WK5MDZVN.js → db-VQSAOWAO.js} +1 -1
@@ -3,21 +3,28 @@ import {
3
3
  } from "./chunk-YYLHWIW6.js";
4
4
  import {
5
5
  compareAgentSelection
6
- } from "./chunk-IIVGDG4I.js";
6
+ } from "./chunk-4YSOUKUR.js";
7
+ import {
8
+ isAgentUnavailableNow
9
+ } from "./chunk-H6A6X4EK.js";
10
+ import {
11
+ isSubscriptionEndpoint,
12
+ isSubscriptionOAuthCredential
13
+ } from "./chunk-EKPKW6RM.js";
7
14
  import {
8
15
  isAntigravityOAuthAgent
9
- } from "./chunk-UZGQNTVW.js";
16
+ } from "./chunk-UA324D4O.js";
10
17
  import {
11
18
  getModelAbility
12
- } from "./chunk-ACTMNVHM.js";
19
+ } from "./chunk-CYSYR67N.js";
20
+ import {
21
+ fnv1a32Hex
22
+ } from "./chunk-UJXNKP5V.js";
13
23
  import {
14
24
  isOwnedAgentKey,
15
25
  ownedAgentKey,
16
26
  publicAgentKey
17
27
  } from "./chunk-M2EJHDJP.js";
18
- import {
19
- fnv1a32Hex
20
- } from "./chunk-UKWGR5SS.js";
21
28
 
22
29
  // packages/ai/agent/agentBilling.ts
23
30
  function resolveBillingSource(candidate) {
@@ -36,6 +43,9 @@ function resolveBillingSource(candidate) {
36
43
  }
37
44
  if (candidate?.isOAuth === true || candidate?.billingSource === "user_subscription" || candidate?.apiSource === "oauth" || isOAuthApiKeyRef(candidate?.apiKeyRef)) return "user_subscription";
38
45
  if (candidate?.apiSource === "custom" || candidate?.billingSource === "user_api") {
46
+ if (isSubscriptionEndpoint(candidate?.customProviderUrl) || isSubscriptionOAuthCredential(candidate?.apiKeyRef)) {
47
+ return "user_subscription";
48
+ }
39
49
  return "user_api";
40
50
  }
41
51
  return "platform_credits";
@@ -227,6 +237,16 @@ function deriveCredentialGroup(ref) {
227
237
  credentialKind: "api-key"
228
238
  };
229
239
  }
240
+ function deriveCustomProviderCredentialGroup(userId, customProviderUrl) {
241
+ if (typeof customProviderUrl !== "string" || !customProviderUrl.trim()) {
242
+ return void 0;
243
+ }
244
+ const basis = `${userId ?? ""}|${customProviderUrl.trim().toLowerCase()}`;
245
+ return {
246
+ credentialGroup: `custom-${fnv1a32Hex(basis)}`,
247
+ credentialKind: "api-key"
248
+ };
249
+ }
230
250
  function summarizeCredentialGroups(agents, now = Date.now()) {
231
251
  const groups = /* @__PURE__ */ new Map();
232
252
  for (const agent of agents) {
@@ -327,6 +347,15 @@ function resolveFavoriteStatus(record, options) {
327
347
  }
328
348
  return { isFavorite: false, favoritedAt: null };
329
349
  }
350
+ function isOwnedAgentRecord(record, userId) {
351
+ if (!userId) return false;
352
+ if (typeof record?.userId === "string" && record.userId === userId || typeof record?.ownerId === "string" && record.ownerId === userId) {
353
+ return true;
354
+ }
355
+ return [record?.dbKey, record?.privateKey].some(
356
+ (key) => isOwnedAgentKey(key, userId)
357
+ );
358
+ }
330
359
  function toSafeAgentSummary(record, options) {
331
360
  const rawId = parseAgentRecordId(
332
361
  typeof record?.privateKey === "string" ? record.privateKey : record?.dbKey,
@@ -356,12 +385,13 @@ function toSafeAgentSummary(record, options) {
356
385
  const isPublic = record?.isPublic === true || record?.isPublicFlag === true || record?.publicRecordExists === true;
357
386
  const updatedAt = safeTimestamp(record?.updatedAt ?? record?.createdAt ?? record?.created);
358
387
  const nextAvailableAt = typeof record?.nextAvailableAt === "number" && Number.isFinite(record.nextAvailableAt) ? record.nextAvailableAt : void 0;
388
+ const rawQuota = record?.quota;
389
+ const quota = rawQuota && typeof rawQuota === "object" && Array.isArray(rawQuota.windows) && typeof rawQuota.observedAt === "number" && Number.isFinite(rawQuota.observedAt) ? rawQuota : void 0;
359
390
  const currentUserId = options?.userId;
360
- const isOwnedByRecord = Boolean(currentUserId) && (typeof record?.userId === "string" && record.userId === currentUserId || typeof record?.ownerId === "string" && record.ownerId === currentUserId);
361
391
  const ownedKey = currentUserId ? [record?.dbKey, record?.privateKey].find(
362
392
  (key) => isOwnedAgentKey(key, currentUserId)
363
393
  ) : void 0;
364
- const isOwned = isOwnedByRecord || Boolean(ownedKey);
394
+ const isOwned = isOwnedAgentRecord(record, currentUserId);
365
395
  const isOAuth = isOAuthApiKeyRef(record?.apiKeyRef);
366
396
  const billingSource = resolveBillingSource({
367
397
  ...record,
@@ -418,6 +448,7 @@ function toSafeAgentSummary(record, options) {
418
448
  isOwned,
419
449
  isOAuth,
420
450
  ...nextAvailableAt !== void 0 ? { nextAvailableAt } : {},
451
+ ...quota !== void 0 ? { quota } : {},
421
452
  ...credentialGroup !== void 0 ? { credentialGroup } : {},
422
453
  ...credentialKind !== void 0 ? { credentialKind } : {},
423
454
  // 「未知 ≠ 独立」:无 credentialGroup 时显式 credentialed:false,调用方
@@ -448,6 +479,8 @@ var COMPACT_AGENT_SUMMARY_FIELDS = [
448
479
  // 决策信息(CLI --show-unavailable 场景);默认列表已把这类 agent 过滤掉,
449
480
  // 所以通常根本不占字节。
450
481
  "nextAvailableAt",
482
+ // 额度快照:只有上游真上报过窗口的 agent 才带(通常是小对象)。
483
+ "quota",
451
484
  "credentialGroup",
452
485
  "credentialKind",
453
486
  "credentialed"
@@ -481,6 +514,7 @@ var UNAVAILABLE_AGENT_SUMMARY_FIELDS = [
481
514
  "isOAuth",
482
515
  "isOwned",
483
516
  "nextAvailableAt",
517
+ "quota",
484
518
  "favoritedAt",
485
519
  "updatedAt"
486
520
  ];
@@ -500,12 +534,131 @@ function toUnavailableAgentSummary(summary) {
500
534
  return item;
501
535
  }
502
536
 
537
+ // packages/ai/agent/agentDiscovery.ts
538
+ function isPreferredAgent(agent) {
539
+ return agent.isFavorite === true || agent.isOwned === true || agent.isOAuth === true || agent.billingSource === "user_subscription" || agent.billingSource === "user_api" || agent.billingSource === "local";
540
+ }
541
+ function isPublicDiscoveryAgent(agent) {
542
+ return agent.isPublic === true && !isPreferredAgent(agent);
543
+ }
544
+ function resolveDiscoveryScope(args) {
545
+ const rawScope = typeof args?.scope === "string" ? args.scope.trim().toLowerCase() : void 0;
546
+ const hasScope = rawScope !== void 0 && rawScope !== "";
547
+ const hasPublicOnly = typeof args?.publicOnly === "boolean";
548
+ const publicOnly = args?.publicOnly === true;
549
+ if (hasScope) {
550
+ if (rawScope !== "preferred" && rawScope !== "public" && rawScope !== "all") {
551
+ throw new Error(`Invalid scope '${args?.scope}': must be 'preferred', 'public', or 'all'.`);
552
+ }
553
+ const scope = rawScope;
554
+ if (hasPublicOnly) {
555
+ if (publicOnly && scope !== "public") {
556
+ throw new Error(
557
+ `Conflicting arguments: scope='${args?.scope}' conflicts with publicOnly=true.`
558
+ );
559
+ }
560
+ if (!publicOnly && scope === "public") {
561
+ throw new Error(
562
+ `Conflicting arguments: scope='${args?.scope}' conflicts with publicOnly=false.`
563
+ );
564
+ }
565
+ }
566
+ return scope;
567
+ }
568
+ if (hasPublicOnly && publicOnly) {
569
+ return "public";
570
+ }
571
+ return "preferred";
572
+ }
573
+ function agentIdentityKeys(agent) {
574
+ return [agent.agentKey, agent.publicKey, agent.id].filter(
575
+ (key) => typeof key === "string" && key.length > 0
576
+ );
577
+ }
578
+ function deduplicateAgentSummaries(agents) {
579
+ const byIdentity = /* @__PURE__ */ new Map();
580
+ for (const agent of agents) {
581
+ const keys = agentIdentityKeys(agent);
582
+ const existing = keys.map((key) => byIdentity.get(key)).find(Boolean);
583
+ if (!existing) {
584
+ for (const key of keys) byIdentity.set(key, agent);
585
+ continue;
586
+ }
587
+ const winner = isPreferredAgent(agent) && !isPreferredAgent(existing) ? agent : existing;
588
+ for (const key of /* @__PURE__ */ new Set([...agentIdentityKeys(existing), ...keys])) byIdentity.set(key, winner);
589
+ }
590
+ return [...new Set(byIdentity.values())];
591
+ }
592
+ function filterAgentsByScope(agents, scope) {
593
+ const unique = deduplicateAgentSummaries(agents);
594
+ if (scope === "preferred") return unique.filter((agent) => isPreferredAgent(agent));
595
+ if (scope === "public") return unique.filter((agent) => isPublicDiscoveryAgent(agent));
596
+ return unique.filter((agent) => isPreferredAgent(agent) || agent.isPublic === true);
597
+ }
598
+ function matchesAgentQuery(agent, query) {
599
+ if (!query || typeof query !== "string") return true;
600
+ const q = query.trim().toLowerCase();
601
+ if (!q) return true;
602
+ const candidates = [
603
+ agent.name,
604
+ agent.model,
605
+ agent.provider,
606
+ agent.handle,
607
+ agent.agentKey,
608
+ agent.publicKey,
609
+ agent.id
610
+ ];
611
+ return candidates.some((text) => typeof text === "string" && text.toLowerCase().includes(q));
612
+ }
613
+ function buildAgentDiscoveryResult(options) {
614
+ const scope = resolveDiscoveryScope({
615
+ scope: options.scope,
616
+ publicOnly: options.publicOnly
617
+ });
618
+ const now = options.now ?? Date.now();
619
+ let scopedAgents = filterAgentsByScope(options.agents, scope);
620
+ if (options.query && typeof options.query === "string" && options.query.trim()) {
621
+ scopedAgents = scopedAgents.filter((a) => matchesAgentQuery(a, options.query));
622
+ }
623
+ const unavailableList = scopedAgents.filter((a) => isAgentUnavailableNow(a, now));
624
+ const unavailableCount = unavailableList.length;
625
+ const unavailableAgents = sortSafeAgentSummaries(unavailableList).map(toUnavailableAgentSummary);
626
+ const credentialGroups = summarizeCredentialGroups(scopedAgents, now);
627
+ if (options.showUnavailable !== true) {
628
+ scopedAgents = scopedAgents.filter((a) => !isAgentUnavailableNow(a, now));
629
+ }
630
+ const sortedAgents = sortSafeAgentSummaries(scopedAgents);
631
+ const projectedAgents = options.verbose === true ? sortedAgents.map(omitNullishAgentSummaryFields) : sortedAgents.map(toCompactAgentSummary);
632
+ return {
633
+ total: projectedAgents.length,
634
+ unavailableCount,
635
+ unavailableAgents,
636
+ credentialGroups,
637
+ agents: projectedAgents
638
+ };
639
+ }
640
+ function toDiscoverySafeAgentSummary(record, options) {
641
+ const mergedOptions = record?.publicRecordExists === true ? { ...options, publicRecordExists: true } : options;
642
+ return toSafeAgentSummary(record, mergedOptions);
643
+ }
644
+ function assembleAgentDiscoveryResult(options) {
645
+ const { records, summaryOptions, ...discoveryOptions } = options;
646
+ const agents = records.map(
647
+ (record) => toDiscoverySafeAgentSummary(
648
+ record,
649
+ typeof summaryOptions === "function" ? summaryOptions(record) : summaryOptions
650
+ )
651
+ );
652
+ return buildAgentDiscoveryResult({ ...discoveryOptions, agents });
653
+ }
654
+
503
655
  export {
504
656
  deriveCredentialGroup,
657
+ deriveCustomProviderCredentialGroup,
505
658
  summarizeCredentialGroups,
506
- toSafeAgentSummary,
507
- sortSafeAgentSummaries,
508
- omitNullishAgentSummaryFields,
509
- toCompactAgentSummary,
510
- toUnavailableAgentSummary
659
+ resolveDiscoveryScope,
660
+ matchesAgentQuery,
661
+ buildAgentDiscoveryResult,
662
+ toDiscoverySafeAgentSummary,
663
+ assembleAgentDiscoveryResult
511
664
  };
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  trimTrailingSlash
3
- } from "./chunk-6OZ36FXI.js";
3
+ } from "./chunk-27ONFIEY.js";
4
4
  import {
5
5
  toErrorMessage
6
6
  } from "./chunk-HNMXYYJR.js";
7
- import {
8
- asOptionalFiniteNumber
9
- } from "./chunk-WWC7I6TA.js";
10
7
  import {
11
8
  asTrimmedLowercaseString
12
9
  } from "./chunk-QSJ3HFEF.js";
10
+ import {
11
+ asOptionalFiniteNumber
12
+ } from "./chunk-WWC7I6TA.js";
13
13
  import {
14
14
  asOptionalTrimmedString
15
15
  } from "./chunk-G3SUCT4W.js";
@@ -41,7 +41,7 @@ var ANTIGRAVITY_CLOUD_CODE_BASE_URL = "https://daily-cloudcode-pa.googleapis.com
41
41
  var ANTIGRAVITY_CLOUD_CODE_HOST = "cloudcode-pa.googleapis.com";
42
42
  var ANTIGRAVITY_LEGACY_GENERIC_BASE_RE = /^https?:\/\/cloudcode-pa\.googleapis\.com$/i;
43
43
  function getAntigravityUserAgent() {
44
- const version = process.env.NOLO_ANTIGRAVITY_VERSION || "2.1.4";
44
+ const version = process.env.NOLO_ANTIGRAVITY_VERSION || "2.18.1";
45
45
  const os = process.platform === "win32" ? "windows" : process.platform;
46
46
  const arch = process.arch === "x64" ? "amd64" : process.arch === "ia32" ? "386" : process.arch;
47
47
  return `antigravity/hub/${version} ${os}/${arch}`;
@@ -129,7 +129,9 @@ async function refreshAntigravityToken(credential, deps = {}) {
129
129
  payload = {};
130
130
  }
131
131
  if (!response.ok) {
132
- const detail = typeof payload.error_description === "string" && payload.error_description.trim() ? payload.error_description.trim() : typeof payload.error === "string" && payload.error.trim() ? payload.error.trim() : rawBodyText.trim() || `HTTP ${response.status}`;
132
+ const errorCode = typeof payload.error === "string" && payload.error.trim() ? payload.error.trim() : void 0;
133
+ const errorDescription = typeof payload.error_description === "string" && payload.error_description.trim() ? payload.error_description.trim() : void 0;
134
+ const detail = (errorCode && errorDescription && errorDescription !== errorCode ? `${errorCode}: ${errorDescription}` : errorCode ?? errorDescription ?? rawBodyText.trim()) || `HTTP ${response.status}`;
133
135
  throw new Error(`Antigravity token refresh failed: ${detail}`);
134
136
  }
135
137
  if (typeof payload.access_token !== "string" || !payload.access_token.trim()) {
@@ -1,26 +1,25 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-AJ3A3445.js";
4
+ } from "./chunk-M6NBAHCD.js";
5
5
  import {
6
6
  clipMultilineText
7
- } from "./chunk-G4EBXCWF.js";
7
+ } from "./chunk-IM6ZMFRL.js";
8
8
  import {
9
9
  runLocalAgentTurn
10
- } from "./chunk-6VFARHZW.js";
10
+ } from "./chunk-KQQMCLDJ.js";
11
11
  import {
12
12
  applyToolSurfaceConstraints
13
- } from "./chunk-IIVGDG4I.js";
13
+ } from "./chunk-4YSOUKUR.js";
14
14
  import {
15
15
  resolveLocalRuntimeEnvFromPolicy
16
- } from "./chunk-HVURBGF3.js";
16
+ } from "./chunk-XFUBXRVI.js";
17
+ import {
18
+ asRecordOrEmpty
19
+ } from "./chunk-KX6YBIHG.js";
17
20
  import {
18
21
  toErrorMessage
19
22
  } from "./chunk-HNMXYYJR.js";
20
- import {
21
- readPipeText,
22
- spawnProcess
23
- } from "./chunk-X7HHHIOZ.js";
24
23
  import {
25
24
  parseUserIdFromAuthToken
26
25
  } from "./chunk-A7GB5UGH.js";
@@ -28,11 +27,9 @@ import {
28
27
  DEFAULT_NOLO_SERVER_URL
29
28
  } from "./chunk-OLZBQWZU.js";
30
29
  import {
31
- asRecordOrEmpty
32
- } from "./chunk-KX6YBIHG.js";
33
- import {
34
- asTrimmedNonEmptyStringArray
35
- } from "./chunk-VMFTFOWF.js";
30
+ readPipeText,
31
+ spawnProcess
32
+ } from "./chunk-Y6ROFCZO.js";
36
33
  import {
37
34
  ownedAgentKey
38
35
  } from "./chunk-M2EJHDJP.js";
@@ -40,11 +37,14 @@ import {
40
37
  isRecord
41
38
  } from "./chunk-KUG52IAP.js";
42
39
  import {
43
- asTrimmedString
44
- } from "./chunk-3EUW3WEO.js";
40
+ asTrimmedNonEmptyStringArray
41
+ } from "./chunk-3AH7LNUB.js";
45
42
  import {
46
43
  asOptionalPositiveFiniteNumber
47
44
  } from "./chunk-U6VC4MU4.js";
45
+ import {
46
+ asTrimmedString
47
+ } from "./chunk-3EUW3WEO.js";
48
48
  import {
49
49
  asOptionalTrimmedString
50
50
  } from "./chunk-G3SUCT4W.js";
@@ -781,7 +781,9 @@ async function runChatgptWebImageLocalJob(input, deps = {}) {
781
781
  });
782
782
  assertOutputImage(outPath);
783
783
  const userAuthToken = input.userAuthToken?.trim() || "";
784
- const userId = parseUserIdFromAuthToken(userAuthToken) || "default";
784
+ if (!userAuthToken) throw new Error("Cannot upload generated image without a user authentication token.");
785
+ const userId = parseUserIdFromAuthToken(userAuthToken);
786
+ if (!userId) throw new Error("Cannot determine authenticated user from the user authentication token.");
785
787
  const serverBase = (input.serverBase?.trim() || DEFAULT_NOLO_SERVER_URL).replace(/\/+$/, "");
786
788
  const uploaded = await uploadPngToNoloFs({
787
789
  outPath,