nolo-cli 0.158.0-alpha.1 → 0.158.0

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 (148) hide show
  1. package/{_executeModel-6BMU3URY.js → _executeModel-AGVQAILR.js} +47 -47
  2. package/accountResolver-55EDKEIK.js +1 -1
  3. package/action-GPPJC5TI.js +1 -1
  4. package/{addContentAction-BI6RDRTQ.js → addContentAction-XJQEJ4XW.js} +6 -6
  5. package/{addDialogAgentAction-4RJYUSIK.js → addDialogAgentAction-5WZX5CAY.js} +5 -5
  6. package/{agentDeleteCommand-Q2XWGBC2.js → agentDeleteCommand-56DO7V2R.js} +66 -67
  7. package/{agentEmailCommands-XFBE2A3F.js → agentEmailCommands-BPUATKQ6.js} +69 -70
  8. package/{agentListCommands-OROMT4P3.js → agentListCommands-KS5VUGOW.js} +63 -40
  9. package/{agentMachineCommands-ULK5YKKJ.js → agentMachineCommands-HSJS7IQK.js} +32 -30
  10. package/{agentProviderCommands-MKG2OOEY.js → agentProviderCommands-CXBHNONN.js} +5 -5
  11. package/{agentPullCommand-FA43RBRU.js → agentPullCommand-GXXEDOSA.js} +4 -4
  12. package/{agentRecordCommands-3VHBLS6P.js → agentRecordCommands-IDGVLDMB.js} +63 -64
  13. package/{agentRunCommand-LCIMEAQY.js → agentRunCommand-LGMDPPPA.js} +65 -66
  14. package/{agentRunControl-2C5GM3BW.js → agentRunControl-QWFFIAQY.js} +9 -7
  15. package/{agentRuntimeLocal-NPJS2QDP.js → agentRuntimeLocal-QL4SHNJJ.js} +21 -19
  16. package/{agentSlice-VRAPG6CH.js → agentSlice-WPXWY6BV.js} +6 -6
  17. package/{appDeleteCommands-AZ3KS4HK.js → appDeleteCommands-FLCTFYZB.js} +31 -29
  18. package/{appDeployCommands-BTV22ICJ.js → appDeployCommands-UU4Z7DT3.js} +31 -29
  19. package/{appDeployStatusCommands-JSW3HPIW.js → appDeployStatusCommands-GKLZTHTX.js} +31 -29
  20. package/{appGetCommands-5KTTFIMV.js → appGetCommands-DPQ2MVJC.js} +31 -29
  21. package/{appListCommands-3BJPAE2U.js → appListCommands-J6QMEBNL.js} +31 -29
  22. package/{authCommand-NIV3DKPF.js → authCommand-OVBMDPIF.js} +20 -20
  23. package/{authCommands-AMNIAKEG.js → authCommands-QOCKVPX3.js} +5 -5
  24. package/{builtinSkillRegistry-H3AY27TR.js → builtinSkillRegistry-LJV7FHNI.js} +4 -4
  25. package/{chunk-O4ZERG3M.js → chunk-2HG7O7QF.js} +8 -8
  26. package/{chunk-EQGFFDNA.js → chunk-323QA7RW.js} +3 -3
  27. package/{chunk-2SOS7OSQ.js → chunk-3GCLICFW.js} +37 -4
  28. package/{chunk-US6MKPE7.js → chunk-3L5MSPWX.js} +1 -1
  29. package/{chunk-QLQ573SU.js → chunk-3M52COK5.js} +120 -0
  30. package/{chunk-2BKUVRC5.js → chunk-4VDSF5NQ.js} +9 -9
  31. package/{chunk-NKPAHRMA.js → chunk-4XHZ4QXL.js} +15 -15
  32. package/{chunk-ZEY4NJRE.js → chunk-5IKRTRRR.js} +5 -5
  33. package/{chunk-P5QACQDK.js → chunk-62TBKWTV.js} +1 -1
  34. package/{chunk-IYBIRCQV.js → chunk-6BNW7WC4.js} +29 -11
  35. package/{chunk-TRW43TSC.js → chunk-6EQD4AQL.js} +41 -1
  36. package/{chunk-YLMMECCH.js → chunk-6XIE5ZGI.js} +1 -1
  37. package/{chunk-JPJGMOIM.js → chunk-7JO3ZACS.js} +2 -2
  38. package/{chunk-L6EQV5OC.js → chunk-7NKZA46B.js} +3 -3
  39. package/{chunk-WXFZ4P6O.js → chunk-AO2T6MWY.js} +12 -12
  40. package/{chunk-2MTE2PEH.js → chunk-ASSNAASW.js} +5 -739
  41. package/{chunk-J2ATF74A.js → chunk-BAWAKW7X.js} +1 -1
  42. package/{chunk-7RF4O6AT.js → chunk-BL4HFN6L.js} +1 -1
  43. package/{chunk-ICRRXBRN.js → chunk-BWIR5QBI.js} +6 -3
  44. package/{chunk-ZVQHBIWV.js → chunk-CDLP56BS.js} +7 -7
  45. package/{chunk-6TF64IF2.js → chunk-DI7ZFGDQ.js} +16 -2
  46. package/{chunk-C3OK72G3.js → chunk-DJ2BOPJY.js} +1 -1
  47. package/{chunk-OON4OBWI.js → chunk-DLV3H464.js} +7 -7
  48. package/{chunk-LV4LV2B4.js → chunk-DOBOKBKS.js} +7 -5
  49. package/{chunk-IRTOYSA2.js → chunk-ESMZW5PE.js} +1 -1
  50. package/{chunk-HB4XPBC7.js → chunk-EWO77ZGF.js} +9 -11
  51. package/{chunk-FY4SDK2E.js → chunk-FDLDMJTM.js} +1 -1
  52. package/{chunk-IE5PXKVU.js → chunk-G3VYRPTV.js} +5 -5
  53. package/{chunk-AJ4V34SG.js → chunk-HCZOSYTL.js} +19 -19
  54. package/{chunk-C6FY7HWI.js → chunk-HEC32F3G.js} +46 -1
  55. package/{chunk-WTFRBJT5.js → chunk-HSY7F4PP.js} +32 -34
  56. package/{chunk-UFYBYB26.js → chunk-I7S63QUU.js} +1 -1
  57. package/{chunk-CON6SI7N.js → chunk-IF7V3CBU.js} +1 -1
  58. package/{chunk-4RJJDA57.js → chunk-IW64YHXL.js} +154 -30
  59. package/chunk-JLR5NWP2.js +548 -0
  60. package/{chunk-K43ZF2C3.js → chunk-JPPQ3GUO.js} +1 -1
  61. package/{chunk-M2P3OGXZ.js → chunk-JWEXJ573.js} +2 -2
  62. package/{chunk-3C2QLERX.js → chunk-KMDDG73K.js} +1 -1
  63. package/{chunk-KKKHAF3P.js → chunk-KMKVQNFH.js} +3 -3
  64. package/{chunk-ZBXIKCZ4.js → chunk-KQT46A27.js} +368 -91
  65. package/{chunk-5MM7NNO6.js → chunk-KSTEXKL6.js} +78 -39
  66. package/{chunk-MM3662RS.js → chunk-LPO6AMQU.js} +780 -64
  67. package/{chunk-YTXQ2U2X.js → chunk-M3IBEHBT.js} +144 -44
  68. package/{chunk-SPKLALBU.js → chunk-MAYW6V3E.js} +1 -1
  69. package/{chunk-IPAW7XLD.js → chunk-MFVOJ6KF.js} +2 -2
  70. package/{chunk-UCLSOLX4.js → chunk-MLEANT7D.js} +13 -13
  71. package/{chunk-NDZOXXIM.js → chunk-NHEWV5FD.js} +1 -1
  72. package/{chunk-4UOEOHY3.js → chunk-OE4FM66I.js} +5 -5
  73. package/chunk-OHRQXEON.js +2685 -0
  74. package/{chunk-SUKSWFLP.js → chunk-PIG2IUVZ.js} +1 -1
  75. package/{chunk-6MXDOUMH.js → chunk-R4BMKAR5.js} +70 -8
  76. package/{chunk-S72LMV7T.js → chunk-RCZMREV2.js} +4793 -3390
  77. package/chunk-SAZSXMTR.js +188 -0
  78. package/{chunk-DC3SZCRR.js → chunk-SH3XD4E2.js} +2 -2
  79. package/{chunk-JGRPBIZZ.js → chunk-SQX235S2.js} +1 -1
  80. package/{chunk-2AB2HA4M.js → chunk-TDX2L4W2.js} +8 -2
  81. package/{chunk-G476FQ7Q.js → chunk-TSTLLGAC.js} +4 -4
  82. package/{chunk-3TBHZPNG.js → chunk-TTVMMYVH.js} +295 -55
  83. package/{chunk-I2RMFLLH.js → chunk-V7PCFWX3.js} +1 -1
  84. package/{chunk-QPY264HO.js → chunk-W7FGZRLK.js} +1 -1
  85. package/{chunk-BYQOCH75.js → chunk-XYW6JSRD.js} +2 -2
  86. package/{chunk-KLA62VVE.js → chunk-Y45LLH6C.js} +42 -11
  87. package/{chunk-CDWHHLK5.js → chunk-Y7F4Q7YP.js} +4 -4
  88. package/{chunk-JZX2XLKC.js → chunk-YCRROBDY.js} +1 -1
  89. package/{chunk-GAVUTXM5.js → chunk-YFEVODB4.js} +18 -194
  90. package/{chunk-G2WP7VPD.js → chunk-YKTAUOS7.js} +18 -6
  91. package/{chunk-YANF2RR4.js → chunk-ZPKUJROL.js} +1 -1
  92. package/{commandRegistry-D6JTVYKG.js → commandRegistry-HHTMBO55.js} +85 -85
  93. package/{contentThunks-DYQO4CTI.js → contentThunks-ZSKJTGS7.js} +17 -18
  94. package/{cooldownCommands-JFKTYS2D.js → cooldownCommands-NS63RGBO.js} +2 -2
  95. package/{createAgentAutomationAction-LW26KIBP.js → createAgentAutomationAction-KYHXEVZF.js} +17 -18
  96. package/{createDialogAction-VLLBRD52.js → createDialogAction-JKB3V4YP.js} +21 -22
  97. package/{createPageAction-PDACOLI6.js → createPageAction-CRVW6Z65.js} +20 -22
  98. package/{dbSlice-DC2J53RC.js → dbSlice-6PVPY44C.js} +5 -5
  99. package/{deleteFile-KYWEMNFX.js → deleteFile-YM6NDPAR.js} +3 -3
  100. package/{dialogCommands-F3Y4KCPZ.js → dialogCommands-2NVLHDZP.js} +32 -30
  101. package/{dialogSlice-ERMZYMS6.js → dialogSlice-SOEMTPH4.js} +16 -17
  102. package/{dist-NJC2W7I4.js → dist-Q2JSMAKA.js} +7 -361
  103. package/{docCreateCommands-YMWZLW64.js → docCreateCommands-BL4YBQOD.js} +32 -30
  104. package/{docDeleteCommands-6KJ3ESK4.js → docDeleteCommands-NTRYV5OH.js} +33 -31
  105. package/{docReadCommands-YQGFVLWI.js → docReadCommands-MJGISD7D.js} +32 -30
  106. package/{docStore-HXKI6W5D.js → docStore-YXIN3UVQ.js} +6 -6
  107. package/{docUpdateCommands-QLSGXUEX.js → docUpdateCommands-C2AIMWBR.js} +32 -30
  108. package/{getPricing-TX35D7PI.js → getPricing-XQ3N3RBP.js} +2 -2
  109. package/{handleSendMessageAction-2XCOZPXY.js → handleSendMessageAction-JXA7PBY2.js} +35 -32
  110. package/index.js +7 -7
  111. package/{localRuntimeAdapter-VOFUPXNF.js → localRuntimeAdapter-QAXXJCDM.js} +61 -60
  112. package/{localRuntimeAuthority-JDAD7CB6.js → localRuntimeAuthority-BPN5OAQG.js} +2 -2
  113. package/{localRuntimeDb-CVC62PM5.js → localRuntimeDb-QIVAXMUL.js} +1 -1
  114. package/{machineCommands-IN5O7CIO.js → machineCommands-TKOOPU7X.js} +66 -67
  115. package/{machineWsRunDispatch-TH3GMSR3.js → machineWsRunDispatch-AQ3KTB7U.js} +61 -62
  116. package/{memberThunks-2DWKLE6W.js → memberThunks-AZINUM4S.js} +8 -8
  117. package/package.json +6 -2
  118. package/{providerPresetApply-GSJI4JBJ.js → providerPresetApply-PKUOHQJT.js} +5 -5
  119. package/{providerRegistry-TSSTPGWF.js → providerRegistry-HNQLIFN2.js} +5 -5
  120. package/{read-L7QEJETH.js → read-7JPIWRBQ.js} +3 -3
  121. package/{readDocTool-QELXV2GW.js → readDocTool-AAQTB2Y3.js} +1 -1
  122. package/{readlineWorkspace-EIEQUTEZ.js → readlineWorkspace-7G2FBC53.js} +96 -134
  123. package/{removeDialogAgentAction-376XSUP2.js → removeDialogAgentAction-RMVRILLK.js} +6 -6
  124. package/{runAgentClientLoop-3KHKKBZI.js → runAgentClientLoop-NKCVEOOU.js} +45 -45
  125. package/{runtimeDoctorCommands-56NWKNON.js → runtimeDoctorCommands-MMCP4B4U.js} +12 -12
  126. package/{setDialogExtraReferencesAction-QBDSH63D.js → setDialogExtraReferencesAction-L3V7JTMG.js} +6 -6
  127. package/{setPrimaryDialogAgentAction-537QFGW3.js → setPrimaryDialogAgentAction-X52JQGTJ.js} +6 -6
  128. package/{settingThunks-4Z43ZSAT.js → settingThunks-N6XFWPOU.js} +5 -5
  129. package/{spaceCommands-T5Z4U7HP.js → spaceCommands-44R7DU34.js} +29 -27
  130. package/{streamAgentChatTurn-DMXXSEVX.js → streamAgentChatTurn-V7GZPMO4.js} +143 -84
  131. package/{switchDialogAgentAction-CSO6AKRL.js → switchDialogAgentAction-ZJ5CGU7J.js} +5 -5
  132. package/{tools-RMT7NAMC.js → tools-SNXGTJMT.js} +35 -37
  133. package/{tuiSummaryLlmCaller-KLK6K3Q3.js → tuiSummaryLlmCaller-FQOEF4IE.js} +7 -7
  134. package/{updateCommands-LXZLG44Y.js → updateCommands-FJHGWD3Q.js} +5 -3
  135. package/{updateDialogTitleAction-Z4WNUH6Y.js → updateDialogTitleAction-QKWRDIK3.js} +17 -18
  136. package/chunk-3MZAGMYY.js +0 -239
  137. package/chunk-IA7TRNNR.js +0 -11
  138. package/chunk-UKZX3NHN.js +0 -48
  139. package/chunk-VDEVDGEM.js +0 -7018
  140. package/clipboardy-GCO3GT3I.js +0 -11793
  141. package/{agentGrantCommands-HOJ3JBBQ.js → agentGrantCommands-5DPHYEKP.js} +3 -3
  142. package/{chromeOpsCommands-3Z34RKSE.js → chromeOpsCommands-GZVVK7HU.js} +4 -4
  143. package/{chunk-2SGAI64X.js → chunk-43OFVLWJ.js} +4 -4
  144. package/{chunk-XETG4RIX.js → chunk-AETZ7AD6.js} +4 -4
  145. package/{chunk-2IXDJNZI.js → chunk-GAGGEA7D.js} +3 -3
  146. package/{memoryCommands-CUNBFRVS.js → memoryCommands-ZS3VQJAL.js} +3 -3
  147. package/{offlineMarxistsAgentCommand-2QTHJCHV.js → offlineMarxistsAgentCommand-3GLX4QQY.js} +3 -3
  148. package/{tableCommands-LBH3QPPO.js → tableCommands-IVC5S7Y3.js} +11 -11
@@ -2,7 +2,7 @@ import {
2
2
  deleteDbRecord,
3
3
  queryUserRecords,
4
4
  readDbRecord
5
- } from "./chunk-ZEY4NJRE.js";
5
+ } from "./chunk-5IKRTRRR.js";
6
6
  import {
7
7
  mergeAndDedupUserData
8
8
  } from "./chunk-OXME3PEE.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  toolRegistry
3
- } from "./chunk-YTXQ2U2X.js";
3
+ } from "./chunk-M3IBEHBT.js";
4
4
  import {
5
5
  runtime_default
6
- } from "./chunk-WTFRBJT5.js";
6
+ } from "./chunk-HSY7F4PP.js";
7
7
  import {
8
8
  canonicalizeToolNames
9
9
  } from "./chunk-5EBLANFT.js";
@@ -1,30 +1,32 @@
1
- import {
2
- isOAuthApiKeyRef
3
- } from "./chunk-UKZX3NHN.js";
4
1
  import {
5
2
  fnv1a32Hex
6
3
  } from "./chunk-UEILX4EV.js";
7
4
  import {
8
5
  compareAgentSelection
9
- } from "./chunk-QLQ573SU.js";
6
+ } from "./chunk-3M52COK5.js";
10
7
  import {
11
- isAgentUnavailableNow
12
- } from "./chunk-3MZAGMYY.js";
8
+ DEFAULT_PROVIDER_RETRY_MS,
9
+ isAgentUnavailableNow,
10
+ resolveAgentAvailability
11
+ } from "./chunk-JLR5NWP2.js";
12
+ import {
13
+ isOAuthApiKeyRef
14
+ } from "./chunk-HEC32F3G.js";
13
15
  import {
14
16
  isOwnedAgentKey,
15
17
  ownedAgentKey,
16
18
  publicAgentKey
17
19
  } from "./chunk-M2EJHDJP.js";
20
+ import {
21
+ getModelAbility
22
+ } from "./chunk-FYYSDHVQ.js";
18
23
  import {
19
24
  isSubscriptionEndpoint,
20
25
  isSubscriptionOAuthCredential
21
- } from "./chunk-HB4XPBC7.js";
26
+ } from "./chunk-EWO77ZGF.js";
22
27
  import {
23
28
  isAntigravityOAuthAgent
24
- } from "./chunk-JGRPBIZZ.js";
25
- import {
26
- getModelAbility
27
- } from "./chunk-FYYSDHVQ.js";
29
+ } from "./chunk-SQX235S2.js";
28
30
 
29
31
  // packages/ai/agent/agentBilling.ts
30
32
  function resolveBillingSource(candidate) {
@@ -444,6 +446,10 @@ function toSafeAgentSummary(record, options) {
444
446
  const credentialGroup = record?.credentialGroup ?? credInfo?.credentialGroup;
445
447
  const credentialKind = record?.credentialKind ?? credInfo?.credentialKind;
446
448
  const { tier } = resolveDefaultAgentTier(record?.model);
449
+ const availability = resolveAgentAvailability(
450
+ { nextAvailableAt, quota },
451
+ options?.now ?? Date.now()
452
+ );
447
453
  return {
448
454
  id,
449
455
  ...agentKey !== void 0 ? { agentKey } : {},
@@ -468,6 +474,8 @@ function toSafeAgentSummary(record, options) {
468
474
  isOwned,
469
475
  isOAuth,
470
476
  ...nextAvailableAt !== void 0 ? { nextAvailableAt } : {},
477
+ availabilityStatus: availability.status,
478
+ availabilityReason: availability.reason,
471
479
  ...quota !== void 0 ? { quota } : {},
472
480
  ...credentialGroup !== void 0 ? { credentialGroup } : {},
473
481
  ...credentialKind !== void 0 ? { credentialKind } : {},
@@ -503,6 +511,8 @@ var COMPACT_AGENT_SUMMARY_FIELDS = [
503
511
  "nextAvailableAt",
504
512
  // 额度快照:只有上游真上报过窗口的 agent 才带(通常是小对象)。
505
513
  "quota",
514
+ "availabilityStatus",
515
+ "availabilityReason",
506
516
  "credentialGroup",
507
517
  "credentialKind",
508
518
  "credentialed"
@@ -536,6 +546,8 @@ var UNAVAILABLE_AGENT_SUMMARY_FIELDS = [
536
546
  "isOAuth",
537
547
  "isOwned",
538
548
  "nextAvailableAt",
549
+ "availabilityStatus",
550
+ "availabilityReason",
539
551
  "quota",
540
552
  "favoritedAt",
541
553
  "updatedAt"
@@ -642,6 +654,25 @@ function buildAgentDiscoveryResult(options) {
642
654
  if (options.query && typeof options.query === "string" && options.query.trim()) {
643
655
  scopedAgents = scopedAgents.filter((a) => matchesAgentQuery(a, options.query));
644
656
  }
657
+ scopedAgents = scopedAgents.map((agent) => {
658
+ const decision = resolveAgentAvailability(agent, now);
659
+ if (decision.status === "quota_exhausted") {
660
+ const resetAt = decision.resetAt ?? now + DEFAULT_PROVIDER_RETRY_MS;
661
+ const nextAvailableAt = typeof agent.nextAvailableAt === "number" && agent.nextAvailableAt > resetAt ? agent.nextAvailableAt : resetAt;
662
+ return {
663
+ ...agent,
664
+ nextAvailableAt,
665
+ availableAt: nextAvailableAt,
666
+ availabilityStatus: decision.status,
667
+ availabilityReason: decision.reason
668
+ };
669
+ }
670
+ return {
671
+ ...agent,
672
+ availabilityStatus: decision.status,
673
+ availabilityReason: decision.reason
674
+ };
675
+ });
645
676
  const unavailableList = scopedAgents.filter((a) => isAgentUnavailableNow(a, now));
646
677
  const unavailableCount = unavailableList.length;
647
678
  const unavailableAgents = sortSafeAgentSummaries(unavailableList).map(toUnavailableAgentSummary);
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-VYNMQ6HW.js";
9
9
  import {
10
10
  fetchAndCacheTableRows
11
- } from "./chunk-VDEVDGEM.js";
11
+ } from "./chunk-OHRQXEON.js";
12
12
  import {
13
13
  require_react
14
14
  } from "./chunk-YDH3FDFQ.js";
@@ -22,7 +22,7 @@ import {
22
22
  import {
23
23
  resolveBuiltinCapability,
24
24
  resolveBuiltinSkillEntry
25
- } from "./chunk-DC3SZCRR.js";
25
+ } from "./chunk-SH3XD4E2.js";
26
26
  import {
27
27
  DEFAULT_SYSTEM_AGENT_CAPABILITIES
28
28
  } from "./chunk-EUGTFFO6.js";
@@ -521,7 +521,7 @@ var executeToolRun = createAsyncThunk(
521
521
  if (!executionInput) {
522
522
  throw new Error(`ToolRun ${id} has no input to execute with.`);
523
523
  }
524
- const { findToolExecutor } = await import("./tools-RMT7NAMC.js");
524
+ const { findToolExecutor } = await import("./tools-SNXGTJMT.js");
525
525
  const { executor } = findToolExecutor(run.toolName);
526
526
  toolRunStarted({
527
527
  id: run.id,
@@ -545,7 +545,7 @@ var executeToolRun = createAsyncThunk(
545
545
  const latestState = thunkApi.getState();
546
546
  const userId = selectIdentityUserId(latestState);
547
547
  if (userId) {
548
- const { fetchUserSpaceMemberships } = await import("./memberThunks-2DWKLE6W.js");
548
+ const { fetchUserSpaceMemberships } = await import("./memberThunks-AZINUM4S.js");
549
549
  await thunkApi.dispatch(fetchUserSpaceMemberships(userId));
550
550
  }
551
551
  }
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-EUGTFFO6.js";
5
5
  import {
6
6
  buildSkillDocMarkdown
7
- } from "./chunk-XETG4RIX.js";
7
+ } from "./chunk-AETZ7AD6.js";
8
8
  import {
9
9
  CHROME_CONNECTOR_ACCEPTED_TOOL_NAMES
10
10
  } from "./chunk-NYYFIKHI.js";
@@ -3,16 +3,13 @@ import {
3
3
  } from "./chunk-HS7MLR74.js";
4
4
  import {
5
5
  performServerProxyFetchWithRetry
6
- } from "./chunk-2BKUVRC5.js";
7
- import {
8
- shouldUseServerProxy
9
- } from "./chunk-UKZX3NHN.js";
6
+ } from "./chunk-4VDSF5NQ.js";
10
7
  import {
11
8
  fetchServerSyncedCredential
12
- } from "./chunk-4UOEOHY3.js";
9
+ } from "./chunk-OE4FM66I.js";
13
10
  import {
14
11
  buildSkillGuidancePromptBlock
15
- } from "./chunk-DC3SZCRR.js";
12
+ } from "./chunk-SH3XD4E2.js";
16
13
  import {
17
14
  CREDENTIAL_HYGIENE_RULE,
18
15
  DELETE_SAFETY_RED_LINE,
@@ -26,7 +23,7 @@ import {
26
23
  compileContextLayers,
27
24
  detectDispatchIntentFromMessages,
28
25
  resolveToolGuidedSections
29
- } from "./chunk-LV4LV2B4.js";
26
+ } from "./chunk-DOBOKBKS.js";
30
27
  import {
31
28
  convertMessagesToResponsesInput,
32
29
  getUsageRequestOptions,
@@ -35,32 +32,33 @@ import {
35
32
  resolveReasoningReplayOptions,
36
33
  shouldStripReasoningContentForOutbound,
37
34
  stablePromptCacheKey
38
- } from "./chunk-6TF64IF2.js";
35
+ } from "./chunk-DI7ZFGDQ.js";
36
+ import {
37
+ resolveAgentCallPlan,
38
+ resolveClientWire
39
+ } from "./chunk-SAZSXMTR.js";
39
40
  import {
40
41
  createFileCredentialBroker
41
42
  } from "./chunk-UHTDNB5Y.js";
43
+ import {
44
+ MEMORY_USE_GUIDANCE,
45
+ buildUserResponseLanguageContext,
46
+ wrapHistoricalSummaryWithReplayGuard
47
+ } from "./chunk-4VJAC32I.js";
42
48
  import {
43
49
  canonicalizeToolNames
44
50
  } from "./chunk-5EBLANFT.js";
45
51
  import {
46
- ANTIGRAVITY_CLOUD_CODE_BASE_URL,
47
- isAntigravityCloudCodeBaseUrl,
48
- isAntigravityOAuthAgent
49
- } from "./chunk-JGRPBIZZ.js";
52
+ API_ENDPOINTS
53
+ } from "./chunk-LCBAMY2M.js";
50
54
  import {
51
55
  buildProviderAuthHeaders
52
- } from "./chunk-SUKSWFLP.js";
53
- import {
54
- isOpenAiResponsesModel,
55
- resolvePlatformChatCompletionsEndpoint,
56
- resolvePlatformResponsesEndpoint
57
- } from "./chunk-I2RMFLLH.js";
56
+ } from "./chunk-PIG2IUVZ.js";
58
57
  import {
59
58
  clampReasoningEffort,
60
- findModelConfig,
61
59
  getModelConfig,
62
60
  isModelSupportReasoningEffort
63
- } from "./chunk-TRW43TSC.js";
61
+ } from "./chunk-6EQD4AQL.js";
64
62
  import {
65
63
  isRecord
66
64
  } from "./chunk-KUG52IAP.js";
@@ -70,9 +68,6 @@ import {
70
68
  import {
71
69
  toErrorMessage
72
70
  } from "./chunk-HNMXYYJR.js";
73
- import {
74
- API_ENDPOINTS
75
- } from "./chunk-LCBAMY2M.js";
76
71
  import {
77
72
  isLoopbackUrl
78
73
  } from "./chunk-4SN6J65J.js";
@@ -85,14 +80,6 @@ import {
85
80
  isPlatformMimoProviderModel,
86
81
  resolveFireworksKimiModel
87
82
  } from "./chunk-CGFNDIKK.js";
88
- import {
89
- asTrimmedLowercaseString
90
- } from "./chunk-QSJ3HFEF.js";
91
- import {
92
- MEMORY_USE_GUIDANCE,
93
- buildUserResponseLanguageContext,
94
- wrapHistoricalSummaryWithReplayGuard
95
- } from "./chunk-4VJAC32I.js";
96
83
 
97
84
  // packages/agent-runtime/responsesConversationState.ts
98
85
  function supportsResponsesConversationState(agent) {
@@ -133,167 +120,6 @@ function isResponsesConversationStateRejection(status, responseBody) {
133
120
  return mentionsResponseState && rejectsState;
134
121
  }
135
122
 
136
- // packages/agent-runtime/agentCallPlan.ts
137
- var CODEX_RESPONSES_URL = "https://chatgpt.com/backend-api/codex/responses";
138
- var CURSOR_AGENT_URL = "https://api2.cursor.sh/agent.v1.AgentService/Run";
139
- var DEVIN_CONNECT_URL = "https://server.codeium.com/exa.api_server_pb.ApiServerService/GetChatMessage";
140
- function resolveClientWire(plan) {
141
- if (plan.upstreamWire === "gemini-cca") return "chat.completions";
142
- if (plan.upstreamWire === "anthropic-messages") return "chat.completions";
143
- if (plan.upstreamWire === "cursor-connect") return "chat.completions";
144
- if (plan.upstreamWire === "devin-connect") return "chat.completions";
145
- if (plan.upstreamWire === "custom-gemini") return "chat.completions";
146
- if (plan.upstreamWire === "custom-openai-responses") return "chat.completions";
147
- if (plan.upstreamWire === "custom-anthropic-messages") return "chat.completions";
148
- if (plan.upstreamWire === "responses" && plan.authMethod.kind === "oauth" && plan.authMethod.ref === "chatgpt") {
149
- return "chat.completions";
150
- }
151
- return plan.upstreamWire;
152
- }
153
- var XAI_CHAT_COMPLETIONS_URL = "https://api.x.ai/v1/chat/completions";
154
- var ANTHROPIC_MESSAGES_URL = "https://api.anthropic.com/v1/messages";
155
- var CODEX_REQUIRED_HEADERS = [
156
- "chatgpt-account-id",
157
- "OpenAI-Beta",
158
- "originator",
159
- "version"
160
- ];
161
- var ANTIGRAVITY_REQUIRED_HEADERS = [
162
- "User-Agent"
163
- // antigravity-specific UA (matches getAntigravityUserAgent)
164
- ];
165
- function agentShouldUseServerProxy(agentConfig) {
166
- return shouldUseServerProxy(agentConfig);
167
- }
168
- function resolveCustomUpstreamWire(endpoint, nativeProtocol) {
169
- const responsesEndpoint = endpoint.includes("/responses");
170
- if (nativeProtocol === "openai-responses" && responsesEndpoint) return "responses";
171
- if (nativeProtocol === "gemini") return "custom-gemini";
172
- if (nativeProtocol === "openai-responses") return "custom-openai-responses";
173
- if (nativeProtocol === "anthropic-messages") return "custom-anthropic-messages";
174
- return responsesEndpoint ? "responses" : "chat.completions";
175
- }
176
- function hasOwnCustomProviderKey(agentConfig) {
177
- const endpoint = asOptionalTrimmedString(agentConfig.customProviderUrl);
178
- if (!endpoint) return false;
179
- if (isAntigravityCloudCodeBaseUrl(endpoint)) return false;
180
- return Boolean(asOptionalTrimmedString(agentConfig.apiKey));
181
- }
182
- function resolveAgentCallPlan(agentConfig, _env) {
183
- const apiKeyRef = asTrimmedLowercaseString(agentConfig.apiKeyRef);
184
- const provider = asTrimmedLowercaseString(
185
- agentConfig.provider ?? agentConfig.apiSource
186
- );
187
- const ownCustomKeyWins = hasOwnCustomProviderKey(agentConfig);
188
- const oauthApiKeyRef = ownCustomKeyWins ? "" : apiKeyRef;
189
- if (!ownCustomKeyWins && isAntigravityOAuthAgent(agentConfig)) {
190
- return {
191
- authMethod: { kind: "oauth", ref: "antigravity" },
192
- transport: "server-proxy",
193
- upstreamWire: "gemini-cca",
194
- endpoint: ANTIGRAVITY_CLOUD_CODE_BASE_URL,
195
- requiredHeaders: [...ANTIGRAVITY_REQUIRED_HEADERS],
196
- vendor: provider || "google-antigravity"
197
- };
198
- }
199
- if (oauthApiKeyRef === "chatgpt") {
200
- return {
201
- authMethod: { kind: "oauth", ref: "chatgpt" },
202
- transport: "server-proxy",
203
- upstreamWire: "responses",
204
- endpoint: CODEX_RESPONSES_URL,
205
- requiredHeaders: [...CODEX_REQUIRED_HEADERS],
206
- vendor: provider || "openai"
207
- };
208
- }
209
- if (oauthApiKeyRef === "claude") {
210
- return {
211
- authMethod: { kind: "oauth", ref: "claude" },
212
- transport: "server-proxy",
213
- upstreamWire: "anthropic-messages",
214
- endpoint: ANTHROPIC_MESSAGES_URL,
215
- requiredHeaders: ["anthropic-version", "anthropic-beta"],
216
- vendor: provider || "anthropic"
217
- };
218
- }
219
- if (oauthApiKeyRef === "xai") {
220
- return {
221
- authMethod: { kind: "oauth", ref: "xai" },
222
- transport: "server-proxy",
223
- upstreamWire: "chat.completions",
224
- endpoint: XAI_CHAT_COMPLETIONS_URL,
225
- requiredHeaders: [],
226
- vendor: provider || "xai"
227
- };
228
- }
229
- if (oauthApiKeyRef === "cursor") {
230
- return {
231
- authMethod: { kind: "oauth", ref: "cursor" },
232
- transport: "server-proxy",
233
- upstreamWire: "cursor-connect",
234
- endpoint: CURSOR_AGENT_URL,
235
- requiredHeaders: [
236
- "x-cursor-client-version",
237
- "x-cursor-client-type",
238
- "x-ghost-mode"
239
- ],
240
- vendor: provider || "cursor"
241
- };
242
- }
243
- if (oauthApiKeyRef === "devin" || !ownCustomKeyWins && provider === "devin") {
244
- return {
245
- authMethod: { kind: "oauth", ref: "devin" },
246
- transport: "server-proxy",
247
- upstreamWire: "devin-connect",
248
- endpoint: DEVIN_CONNECT_URL,
249
- requiredHeaders: ["connect-protocol-version"],
250
- vendor: provider || "devin"
251
- };
252
- }
253
- if (agentConfig.cliProvider || agentConfig.apiSource === "cli" || provider === "cli") {
254
- return {
255
- authMethod: { kind: "cli", provider: agentConfig.cliProvider || provider || "codex" },
256
- transport: "direct",
257
- upstreamWire: "cli",
258
- endpoint: "",
259
- requiredHeaders: [],
260
- vendor: provider || "cli"
261
- };
262
- }
263
- if (agentConfig.customProviderUrl || agentConfig.apiSource === "custom") {
264
- const transport2 = agentShouldUseServerProxy(agentConfig) ? "server-proxy" : "direct";
265
- const endpoint2 = asOptionalTrimmedString(agentConfig.customProviderUrl) ?? "";
266
- const upstreamWire2 = resolveCustomUpstreamWire(
267
- endpoint2,
268
- findModelConfig(provider, agentConfig.model ?? "")?.nativeProtocol
269
- );
270
- return {
271
- authMethod: { kind: "custom-key" },
272
- transport: transport2,
273
- upstreamWire: upstreamWire2,
274
- endpoint: endpoint2,
275
- requiredHeaders: [],
276
- vendor: provider || "custom"
277
- };
278
- }
279
- const transport = agentShouldUseServerProxy(agentConfig) ? "server-proxy" : "direct";
280
- const useResponses = isOpenAiResponsesModel({
281
- provider,
282
- model: agentConfig.model,
283
- endpointKey: agentConfig.endpointKey
284
- });
285
- const upstreamWire = useResponses ? "responses" : "chat.completions";
286
- const endpoint = upstreamWire === "responses" ? resolvePlatformResponsesEndpoint(provider, agentConfig.model) ?? "" : resolvePlatformChatCompletionsEndpoint(provider, agentConfig.model) ?? "";
287
- return {
288
- authMethod: { kind: "platform-key" },
289
- transport,
290
- upstreamWire,
291
- endpoint,
292
- requiredHeaders: [],
293
- vendor: provider || "openai"
294
- };
295
- }
296
-
297
123
  // packages/ai/agent/buildSystemPrompt.ts
298
124
  var CLARIFICATION_MODE_INSTRUCTIONS = `\u5728\u4F60\u8FD8\u4E0D\u4E86\u89E3\u7528\u6237\u610F\u56FE\u65F6\uFF0C\u901A\u8FC7\u63D0\u95EE\u6765\u6F84\u6E05\u9700\u6C42\uFF0C\u800C\u4E0D\u662F\u4ED3\u4FC3\u7ED9\u51FA\u7B54\u6848\u3002`;
299
125
  var isBrowser = typeof window !== "undefined";
@@ -1401,8 +1227,6 @@ export {
1401
1227
  selectResponsesConversationState,
1402
1228
  updateResponsesConversationState,
1403
1229
  isResponsesConversationStateRejection,
1404
- resolveClientWire,
1405
- resolveAgentCallPlan,
1406
1230
  generateRequestBody,
1407
1231
  CONFIRMATION_INPUT_KEYS,
1408
1232
  stripModelToolArgs,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveAgentImageInputSupport
3
- } from "./chunk-IYBIRCQV.js";
3
+ } from "./chunk-6BNW7WC4.js";
4
4
  import {
5
5
  asOptionalFiniteNumber
6
6
  } from "./chunk-WWC7I6TA.js";
@@ -33,9 +33,13 @@ function hasImageInRuntimeMessages(messages) {
33
33
  var IMAGE_OMITTED_PLACEHOLDER = "[Image content omitted: model does not support image input]";
34
34
  function stripImagePartsFromContent(content) {
35
35
  if (!Array.isArray(content)) return content;
36
- const filtered = content.filter((part) => part?.type !== "image_url");
37
- if (filtered.length === 0) return IMAGE_OMITTED_PLACEHOLDER;
38
- return filtered;
36
+ const hasImage = content.some((part) => part && typeof part === "object" && part.type === "image_url");
37
+ if (!hasImage) return content;
38
+ const hasNonImage = content.some((part) => part && typeof part === "object" && part.type !== "image_url");
39
+ if (!hasNonImage) return IMAGE_OMITTED_PLACEHOLDER;
40
+ return content.map(
41
+ (part) => part && typeof part === "object" && part.type === "image_url" ? { type: "text", text: IMAGE_OMITTED_PLACEHOLDER } : part
42
+ );
39
43
  }
40
44
  function stripImagePartsFromMessages(messages) {
41
45
  return messages.map((msg) => ({
@@ -45,8 +49,15 @@ function stripImagePartsFromMessages(messages) {
45
49
  }
46
50
  async function stripImagePartsForTextOnlyAgent(messages, agentConfig) {
47
51
  const supportsVision = resolveAgentImageInputSupport(agentConfig);
48
- const hasImages = hasImageInRuntimeMessages(messages);
49
- return { messages: !supportsVision && hasImages ? stripImagePartsFromMessages(messages) : messages };
52
+ const runtimeMessages = messages;
53
+ const hasImages = hasImageInRuntimeMessages(runtimeMessages);
54
+ const shouldStrip = !supportsVision && hasImages;
55
+ const omittedImageCount = shouldStrip ? extractImageUrlsFromMessages(runtimeMessages).length : 0;
56
+ return {
57
+ messages: shouldStrip ? stripImagePartsFromMessages(messages) : messages,
58
+ downgraded: shouldStrip,
59
+ omittedImageCount
60
+ };
50
61
  }
51
62
 
52
63
  // packages/agent-runtime/agentRecordConfig.ts
@@ -414,6 +425,7 @@ function assertDesktopAgentRuntimeTurnBodyHasNoRawSecrets(body) {
414
425
  }
415
426
 
416
427
  export {
428
+ extractImageUrlsFromMessages,
417
429
  hasImageInRuntimeMessages,
418
430
  stripImagePartsFromMessages,
419
431
  stripImagePartsForTextOnlyAgent,
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-WWC7I6TA.js";
13
13
  import {
14
14
  getModelConfig
15
- } from "./chunk-TRW43TSC.js";
15
+ } from "./chunk-6EQD4AQL.js";
16
16
  import {
17
17
  isPlatformHostedImageModel,
18
18
  isPlatformManagedProvider,