nolo-cli 0.211.0 → 0.213.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 (173) hide show
  1. package/{_executeModel-VVQEOY3D.js → _executeModel-CUJLCFWR.js} +57 -54
  2. package/{action-U235TV4P.js → action-DF5UYSJF.js} +4 -4
  3. package/{addContentAction-7C76J7ST.js → addContentAction-WERAONNY.js} +9 -9
  4. package/{addDialogAgentAction-KTYANUEC.js → addDialogAgentAction-7VI7YRML.js} +16 -13
  5. package/{agentDeleteCommand-WHRU6VDJ.js → agentDeleteCommand-XJORXPGU.js} +80 -76
  6. package/{agentEmailCommands-ALLHXPW3.js → agentEmailCommands-XTYYFR6Z.js} +85 -80
  7. package/{agentListCommands-POKMEKMS.js → agentListCommands-OBLRBLHS.js} +237 -115
  8. package/{agentMachineCommands-WJLZLBPI.js → agentMachineCommands-5FMT3OT5.js} +33 -31
  9. package/{agentProviderCommands-MN3ABDME.js → agentProviderCommands-Q5O33MED.js} +33 -4
  10. package/{agentRecordCommands-OULZW3KM.js → agentRecordCommands-ZQ7SVYGG.js} +75 -70
  11. package/{agentRunCommand-ZNG4LGNQ.js → agentRunCommand-WS7IGO2W.js} +77 -73
  12. package/{agentRunControl-AF7BMR22.js → agentRunControl-TAMHJQSR.js} +8 -7
  13. package/{agentRuntimeLocal-YMUHFV5M.js → agentRuntimeLocal-SOO2OPJG.js} +30 -27
  14. package/{agentSlice-WNGUIMQZ.js → agentSlice-CHR6KOZN.js} +13 -13
  15. package/{appDeleteCommands-6MXPLAVF.js → appDeleteCommands-GUP6P5YE.js} +34 -32
  16. package/{appDeployCommands-ERRSVASW.js → appDeployCommands-MH2FX4O5.js} +34 -32
  17. package/{appDeployStatusCommands-ULICISLI.js → appDeployStatusCommands-SUHN3HPJ.js} +34 -32
  18. package/{appGetCommands-WYYYWROF.js → appGetCommands-YWDEX6Z4.js} +34 -32
  19. package/{appListCommands-DFCUCRCV.js → appListCommands-ZQVMLPAY.js} +34 -32
  20. package/{authCommand-ZJMWXFMA.js → authCommand-PWX2ZNUP.js} +15 -15
  21. package/{authCommands-WK6E42L2.js → authCommands-HV3EAU3V.js} +2 -2
  22. package/{builtinSkillRegistry-HH75G5J3.js → builtinSkillRegistry-2QETTQPM.js} +5 -4
  23. package/{chromeOpsCommands-HEN5AX2J.js → chromeOpsCommands-DIVM2K3T.js} +1 -1
  24. package/{chunk-TRZP7JZ7.js → chunk-2QHFH3DR.js} +1 -0
  25. package/{chunk-XE4Q46FF.js → chunk-3CGG2PAL.js} +1 -1
  26. package/{chunk-YUXQAVRD.js → chunk-3UKL3HPD.js} +251 -14
  27. package/{chunk-BSISWVB4.js → chunk-4I7ERB7F.js} +1 -1
  28. package/{chunk-5ORJGHTL.js → chunk-4T2WNOY7.js} +6 -6
  29. package/{chunk-W5VC7F7V.js → chunk-5MQRBSMW.js} +84 -91
  30. package/{chunk-YLTLB5A7.js → chunk-6DWMYIUY.js} +7 -6
  31. package/chunk-6VLJ6YA7.js +11751 -0
  32. package/{chunk-KSTEXKL6.js → chunk-75XIDFBW.js} +4 -3
  33. package/{chunk-BTYQAODF.js → chunk-7BT37FK3.js} +196 -308
  34. package/{chunk-27E2CBBY.js → chunk-7OCO4TDT.js} +1 -1
  35. package/{chunk-V3M6IXQI.js → chunk-7QTZCMKL.js} +335 -131
  36. package/chunk-7RFNTILS.js +2213 -0
  37. package/{chunk-NHQKWPLP.js → chunk-7Y4YTDQF.js} +25 -23
  38. package/{chunk-CKAHAVMK.js → chunk-A7TFUNZO.js} +35 -25
  39. package/{chunk-PJNFNEJE.js → chunk-ALQ3657A.js} +28 -2
  40. package/{chunk-NV572QM3.js → chunk-BBJ22CLB.js} +15 -15
  41. package/chunk-CJEIOP3E.js +0 -0
  42. package/{chunk-4WCEC56C.js → chunk-COFEN36Z.js} +2 -2
  43. package/{chunk-25OB36GU.js → chunk-CRHOO2ZR.js} +4 -4
  44. package/{chunk-NTSRCTUX.js → chunk-CTPXME7U.js} +2 -2
  45. package/{chunk-TPCDYNJK.js → chunk-EHGEOAHI.js} +3 -3
  46. package/{chunk-Y2WUYX4I.js → chunk-EHSZD5OI.js} +1 -1
  47. package/{chunk-SU3QL7YG.js → chunk-FUGMREBO.js} +2 -2
  48. package/{chunk-UMEGDH6A.js → chunk-FW6YHHLI.js} +8 -8
  49. package/chunk-FY7F4Q6X.js +127 -0
  50. package/{chunk-25M2K6OA.js → chunk-G2BQWAVT.js} +3 -3
  51. package/chunk-G7MLNNEX.js +84 -0
  52. package/{chunk-DQLB4NQ3.js → chunk-GPVRUGGY.js} +2 -2
  53. package/{chunk-RQ22OZD7.js → chunk-H2TJUNCH.js} +1 -1
  54. package/{chunk-XPHZK3PJ.js → chunk-H4UOTUOX.js} +165 -51
  55. package/{chunk-CVCRAO6Q.js → chunk-H5HF7TJA.js} +9 -7
  56. package/{chunk-OP7PTBAJ.js → chunk-H7PPIYWP.js} +9 -9
  57. package/{chunk-QQM464AL.js → chunk-HPFCI4SK.js} +3 -3
  58. package/chunk-HRMJUN5J.js +26 -0
  59. package/{chunk-WI6OGHXJ.js → chunk-HSVBJRF4.js} +5 -5
  60. package/{chunk-RYWO5AKN.js → chunk-HUBHAQK2.js} +10 -10
  61. package/{chunk-LKDF3ATR.js → chunk-INUFILG6.js} +1 -1
  62. package/{chunk-NXCGNS4N.js → chunk-IXNGOHV5.js} +2 -2
  63. package/{chunk-ET2CWLIJ.js → chunk-J2NHJ7WX.js} +4 -4
  64. package/{chunk-ECX3NKRD.js → chunk-JY5NGFFH.js} +11 -0
  65. package/chunk-KC4XDTT3.js +227 -0
  66. package/{chunk-ADBWFYJD.js → chunk-KFLT5KAD.js} +9 -9
  67. package/{chunk-PLYWH7XM.js → chunk-KIM6CLW5.js} +7 -7
  68. package/{chunk-7IYBN7IA.js → chunk-LLRPJECG.js} +22 -13
  69. package/{chunk-3J3U3KXB.js → chunk-MDB67IWP.js} +5 -5
  70. package/chunk-MMA3LZ3W.js +105 -0
  71. package/{chunk-XDMGY5IU.js → chunk-MOIJOHA5.js} +227 -11
  72. package/{chunk-NLT32XBZ.js → chunk-NJLL224W.js} +2 -2
  73. package/{chunk-JBOUVTZX.js → chunk-NOKUNJON.js} +15 -4
  74. package/{chunk-C2XZM3K4.js → chunk-NSAPDIN2.js} +12 -27
  75. package/{chunk-PAFTGNWA.js → chunk-O2TZF4AI.js} +2 -2
  76. package/{chunk-UIOEHFF6.js → chunk-OQHIVPG4.js} +1 -0
  77. package/{chunk-TCTSYFDM.js → chunk-OQPKUBPB.js} +19 -6
  78. package/{chunk-X4F26D5K.js → chunk-P5L7CXOC.js} +58 -33
  79. package/{chunk-OXME3PEE.js → chunk-PCLE46CE.js} +1 -1
  80. package/{chunk-UCPAVEQB.js → chunk-PYRUW7XN.js} +1 -1
  81. package/{chunk-YXOBCDNW.js → chunk-QG4AOSON.js} +12 -49
  82. package/{chunk-RXCCWVA2.js → chunk-QHPRUL4O.js} +3 -3
  83. package/{chunk-I5PBXF7O.js → chunk-R5O4QAWG.js} +1 -1
  84. package/{chunk-HD3WR3TD.js → chunk-RLBNLZVC.js} +1 -1
  85. package/{chunk-SN5XE6GQ.js → chunk-RPQXPZZF.js} +4 -4
  86. package/{chunk-ZOO3WJIE.js → chunk-RSHTSUEG.js} +948 -108
  87. package/{chunk-6HVBI6TI.js → chunk-RZOV7OMV.js} +12 -229
  88. package/{chunk-D2MDMY2M.js → chunk-SVYO6AO7.js} +7 -1
  89. package/{chunk-IIHY4ZAI.js → chunk-TAKB25RM.js} +8 -4
  90. package/{chunk-ZN5AH4BY.js → chunk-TX5EYMGT.js} +6 -6
  91. package/{chunk-CKOO42G5.js → chunk-UHJGXRJ4.js} +4 -4
  92. package/{chunk-M4NTDZG3.js → chunk-UYD5HQ6T.js} +857 -295
  93. package/{chunk-WTKYP6QO.js → chunk-V5Y3R6BT.js} +114 -6
  94. package/{chunk-3RQVYR4B.js → chunk-VNYYOX3V.js} +59 -20
  95. package/{chunk-4LEGTOSR.js → chunk-VO4WSAVP.js} +3 -3
  96. package/{chunk-LNYHAKBP.js → chunk-W4S457LU.js} +1 -1
  97. package/{chunk-RIALQUSF.js → chunk-WMTBPBMP.js} +6 -6
  98. package/chunk-WPORQFYN.js +74 -0
  99. package/{chunk-Y6M7KJOA.js → chunk-WRYQ35LQ.js} +5 -5
  100. package/{chunk-YKFP6UGT.js → chunk-WYDI6TGM.js} +17 -17
  101. package/{chunk-SCYQJPGA.js → chunk-X7SDOJUM.js} +147 -20
  102. package/chunk-XFYFMTOM.js +92 -0
  103. package/{chunk-LT3EAHJY.js → chunk-XHQC4PXX.js} +65 -49
  104. package/{chunk-2WZXXAQD.js → chunk-YB3YZK56.js} +67 -1
  105. package/{chunk-JKW6LERJ.js → chunk-YJAFKXMU.js} +14 -14
  106. package/{chunk-GSQNH63I.js → chunk-YTF4WH7J.js} +3 -19
  107. package/{chunk-DA7CTWT4.js → chunk-YWSEPJ7C.js} +5 -5
  108. package/{chunk-3V2QMRNN.js → chunk-ZL5RAEEB.js} +3 -3
  109. package/{chunk-NEZGPBL7.js → chunk-ZNWI6OVT.js} +2 -2
  110. package/{chunk-MBS6CTZB.js → chunk-ZXOUUDCG.js} +266 -2014
  111. package/cliAgentConfigHelpers-WJBZQTLW.js +41 -0
  112. package/{commandRegistry-FI2IOQ3U.js → commandRegistry-W63CYRZJ.js} +91 -87
  113. package/{contentThunks-5LKNNDGY.js → contentThunks-U7PL5MQD.js} +27 -26
  114. package/{cooldownCommands-YXLWOXWR.js → cooldownCommands-TIGUHXTD.js} +3 -3
  115. package/{createAgentAutomationAction-TI4QG4CY.js → createAgentAutomationAction-OLBQDD6R.js} +27 -26
  116. package/{createDialogAction-TJ3JKLO4.js → createDialogAction-SVH6B3SB.js} +29 -28
  117. package/{createPageAction-GKXT6WEH.js → createPageAction-F4DIWZ2Z.js} +29 -28
  118. package/{dbSlice-LPMZ2DGJ.js → dbSlice-BVH2YZPQ.js} +8 -8
  119. package/{deleteFile-EPUQHKPA.js → deleteFile-5YOEKV4U.js} +4 -4
  120. package/{dialogCommands-IWPXIZ5P.js → dialogCommands-KHIEPY3M.js} +38 -36
  121. package/{dialogSlice-ZWNNS7GZ.js → dialogSlice-ZCTDV2PZ.js} +25 -24
  122. package/{dialogUsageCommand-ZCPPHPJ5.js → dialogUsageCommand-7KCPYGHG.js} +1 -1
  123. package/{docCreateCommands-HFSPKJSI.js → docCreateCommands-DPMZI7G5.js} +32 -30
  124. package/{docDeleteCommands-CRL62POH.js → docDeleteCommands-IRQQLUBT.js} +34 -33
  125. package/{docReadCommands-QOTOX3XW.js → docReadCommands-LK37XH6L.js} +32 -30
  126. package/{docStore-WYLRB7ED.js → docStore-V2KECILA.js} +11 -11
  127. package/{docUpdateCommands-7BMH4MCA.js → docUpdateCommands-O6T3HJHH.js} +32 -30
  128. package/{fetchMessages-YY4SATNR.js → fetchMessages-NR4KNQLO.js} +3 -3
  129. package/{getPricing-OQXBJ6VZ.js → getPricing-2MNMXEVG.js} +3 -3
  130. package/{handleSendMessageAction-P27YP2DQ.js → handleSendMessageAction-2PE25WM3.js} +49 -47
  131. package/hostCredentialCreate-S233UMAP.js +357 -0
  132. package/index.js +7 -7
  133. package/{keys-P4ZDOVJW.js → keys-BEGDOTRL.js} +3 -1
  134. package/{localDialogRead-5VCMQQZF.js → localDialogRead-7NNDVVF7.js} +1 -1
  135. package/{localRuntimeAdapter-GP6ZSSO3.js → localRuntimeAdapter-KY6WXNBR.js} +82 -75
  136. package/{machineCommands-6Z6H4BFX.js → machineCommands-Q6HA3IXF.js} +74 -69
  137. package/{machineWsRunDispatch-F2ZIXMYM.js → machineWsRunDispatch-WWJQ6WR3.js} +74 -69
  138. package/{memberThunks-YSEFJF47.js → memberThunks-7EDJADWU.js} +9 -9
  139. package/package.json +1 -1
  140. package/{projectArchive-PIGEOX3D.js → projectArchive-DRTDIMEV.js} +29 -28
  141. package/{providerPresetApply-ZYMLQA46.js → providerPresetApply-YXGV6NXB.js} +4 -4
  142. package/{providerRegistry-E34XWDLJ.js → providerRegistry-S6UL6UNA.js} +4 -4
  143. package/{read-DIIQBOOO.js → read-4V2RMG7N.js} +4 -4
  144. package/{readDocTool-HXYGOEA7.js → readDocTool-BH6ATGQO.js} +1 -1
  145. package/{readlineWorkspace-UG25G7KC.js → readlineWorkspace-2W4WRCOU.js} +437 -217
  146. package/{removeDialogAgentAction-ALJDUJ2E.js → removeDialogAgentAction-LYAZGNKW.js} +18 -15
  147. package/{runAgentClientLoop-IO5F7TCZ.js → runAgentClientLoop-J2VQBS2Z.js} +55 -52
  148. package/{runtimeDoctorCommands-PGAA47G5.js → runtimeDoctorCommands-QAI3MBKQ.js} +6 -6
  149. package/{secretCommands-ZCZ4KVET.js → secretCommands-LXDWOLZ6.js} +4 -4
  150. package/{setDialogExtraReferencesAction-O3SVMD5A.js → setDialogExtraReferencesAction-OCRPGPYH.js} +11 -11
  151. package/{setPrimaryDialogAgentAction-HE7RVFFF.js → setPrimaryDialogAgentAction-HFJDQIBU.js} +19 -16
  152. package/{settingThunks-BWWJQG4L.js → settingThunks-RAMHMTGM.js} +13 -12
  153. package/{spaceCommands-UAELIFEI.js → spaceCommands-KVJZVKVO.js} +32 -31
  154. package/{streamAgentChatTurn-VUKZQYJR.js → streamAgentChatTurn-GHBMJJ6S.js} +63 -60
  155. package/{switchDialogAgentAction-3VZS7SOS.js → switchDialogAgentAction-EBRMW3RA.js} +16 -13
  156. package/{tools-VRXJAVYI.js → tools-EWKCPKMS.js} +49 -46
  157. package/{tuiSummaryLlmCaller-TGCHZLSW.js → tuiSummaryLlmCaller-ALQYUUWB.js} +48 -19
  158. package/{updateCommands-Q6CYAEYJ.js → updateCommands-ZQYU6SCI.js} +5 -3
  159. package/{updateDialogTitleAction-MULWCJCW.js → updateDialogTitleAction-5GGMBTDF.js} +40 -72
  160. package/usageCommand-F4IPVMIZ.js +32 -0
  161. package/usageRebuildCommand-HAW2AD5N.js +626 -0
  162. package/{windowsSelfUpdate-XSQVF2GK.js → windowsSelfUpdate-257DV2T6.js} +2 -2
  163. package/{workloadLifecycle-4BEQHMSD.js → workloadLifecycle-4C42SVBD.js} +1 -0
  164. package/chunk-4LCOCOR5.js +0 -50
  165. package/chunk-7AUQ3WCW.js +0 -51
  166. package/chunk-ZRAU6T47.js +0 -56
  167. package/{agentFavoriteCommands-GAFEXKKP.js → agentFavoriteCommands-EDK743YA.js} +1 -1
  168. package/{agentGrantCommands-V5FOQKFD.js → agentGrantCommands-RQWK2TEV.js} +1 -1
  169. package/{agentPullCommand-2JMJP5BS.js → agentPullCommand-6EM3URVK.js} +1 -1
  170. package/{chunk-A2ZMIRLN.js → chunk-INN4LTAJ.js} +5 -5
  171. package/{chunk-PV6JJAUB.js → chunk-TCZHTTUU.js} +8 -8
  172. package/{chunk-AKE53VMW.js → chunk-ZCWRMUWT.js} +0 -0
  173. package/{tableCommands-D7WR4QSM.js → tableCommands-MP6VFSVT.js} +3 -3
@@ -0,0 +1,105 @@
1
+ import {
2
+ __commonJS
3
+ } from "./chunk-4VNS5WPM.js";
4
+
5
+ // node_modules/@babel/runtime/helpers/interopRequireDefault.js
6
+ var require_interopRequireDefault = __commonJS({
7
+ "node_modules/@babel/runtime/helpers/interopRequireDefault.js"(exports, module) {
8
+ function _interopRequireDefault(e) {
9
+ return e && e.__esModule ? e : {
10
+ "default": e
11
+ };
12
+ }
13
+ module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
14
+ }
15
+ });
16
+
17
+ // node_modules/date-fns/_lib/requiredArgs/index.js
18
+ var require_requiredArgs = __commonJS({
19
+ "node_modules/date-fns/_lib/requiredArgs/index.js"(exports, module) {
20
+ "use strict";
21
+ Object.defineProperty(exports, "__esModule", {
22
+ value: true
23
+ });
24
+ exports.default = requiredArgs;
25
+ function requiredArgs(required, args) {
26
+ if (args.length < required) {
27
+ throw new TypeError(required + " argument" + (required > 1 ? "s" : "") + " required, but only " + args.length + " present");
28
+ }
29
+ }
30
+ module.exports = exports.default;
31
+ }
32
+ });
33
+
34
+ // node_modules/@babel/runtime/helpers/typeof.js
35
+ var require_typeof = __commonJS({
36
+ "node_modules/@babel/runtime/helpers/typeof.js"(exports, module) {
37
+ function _typeof(o) {
38
+ "@babel/helpers - typeof";
39
+ return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
40
+ return typeof o2;
41
+ } : function(o2) {
42
+ return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
43
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
44
+ }
45
+ module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
46
+ }
47
+ });
48
+
49
+ // node_modules/date-fns/toDate/index.js
50
+ var require_toDate = __commonJS({
51
+ "node_modules/date-fns/toDate/index.js"(exports, module) {
52
+ "use strict";
53
+ var _interopRequireDefault = require_interopRequireDefault().default;
54
+ Object.defineProperty(exports, "__esModule", {
55
+ value: true
56
+ });
57
+ exports.default = toDate;
58
+ var _typeof2 = _interopRequireDefault(require_typeof());
59
+ var _index = _interopRequireDefault(require_requiredArgs());
60
+ function toDate(argument) {
61
+ (0, _index.default)(1, arguments);
62
+ var argStr = Object.prototype.toString.call(argument);
63
+ if (argument instanceof Date || (0, _typeof2.default)(argument) === "object" && argStr === "[object Date]") {
64
+ return new Date(argument.getTime());
65
+ } else if (typeof argument === "number" || argStr === "[object Number]") {
66
+ return new Date(argument);
67
+ } else {
68
+ if ((typeof argument === "string" || argStr === "[object String]") && typeof console !== "undefined") {
69
+ console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments");
70
+ console.warn(new Error().stack);
71
+ }
72
+ return /* @__PURE__ */ new Date(NaN);
73
+ }
74
+ }
75
+ module.exports = exports.default;
76
+ }
77
+ });
78
+
79
+ // node_modules/date-fns/_lib/addLeadingZeros/index.js
80
+ var require_addLeadingZeros = __commonJS({
81
+ "node_modules/date-fns/_lib/addLeadingZeros/index.js"(exports, module) {
82
+ "use strict";
83
+ Object.defineProperty(exports, "__esModule", {
84
+ value: true
85
+ });
86
+ exports.default = addLeadingZeros;
87
+ function addLeadingZeros(number, targetLength) {
88
+ var sign = number < 0 ? "-" : "";
89
+ var output = Math.abs(number).toString();
90
+ while (output.length < targetLength) {
91
+ output = "0" + output;
92
+ }
93
+ return sign + output;
94
+ }
95
+ module.exports = exports.default;
96
+ }
97
+ });
98
+
99
+ export {
100
+ require_interopRequireDefault,
101
+ require_typeof,
102
+ require_requiredArgs,
103
+ require_toDate,
104
+ require_addLeadingZeros
105
+ };
@@ -1,12 +1,25 @@
1
- import {
2
- buildLocalAgentLookupKeys,
3
- classifyAgentApiKeyRef,
4
- formatUnsupportedAgentApiKeyRefMessage,
5
- shouldReadAgentKeyRemotely
6
- } from "./chunk-7AUQ3WCW.js";
7
1
  import {
8
2
  resolveCliAgentKeyInput
9
3
  } from "./chunk-NBTY7YJF.js";
4
+ import {
5
+ buildRestorePatch
6
+ } from "./chunk-SVYO6AO7.js";
7
+ import {
8
+ createHostCredentialBrokerChain,
9
+ createStrictHostCredentialBroker
10
+ } from "./chunk-RSHTSUEG.js";
11
+ import {
12
+ buildAgentRuntimeAgentLookupKeys,
13
+ shouldFetchAgentRuntimeRecordRemotely
14
+ } from "./chunk-RZOV7OMV.js";
15
+ import {
16
+ buildAgentApiKeyCredentialRef,
17
+ migrateAgentSecrets
18
+ } from "./chunk-2QHFH3DR.js";
19
+ import {
20
+ assertCredentialRef,
21
+ createFileCredentialBroker
22
+ } from "./chunk-OQHIVPG4.js";
10
23
  import {
11
24
  toErrorMessage
12
25
  } from "./chunk-HNMXYYJR.js";
@@ -23,16 +36,85 @@ import {
23
36
  } from "./chunk-4O22PGNQ.js";
24
37
  import {
25
38
  createAgentKey
26
- } from "./chunk-ECX3NKRD.js";
39
+ } from "./chunk-JY5NGFFH.js";
40
+
41
+ // packages/agent-runtime/sessionCredentialBroker.ts
42
+ function createSessionMemoryCredentialBroker() {
43
+ const store = /* @__PURE__ */ new Map();
44
+ return {
45
+ get(ref) {
46
+ return store.get(assertCredentialRef(ref)) ?? null;
47
+ },
48
+ put(ref, secret) {
49
+ const safe = assertCredentialRef(ref);
50
+ const value = typeof secret === "string" ? secret.trim() : "";
51
+ if (!value) throw new Error("Cannot store an empty credential secret.");
52
+ store.set(safe, value);
53
+ },
54
+ delete(ref) {
55
+ store.delete(assertCredentialRef(ref));
56
+ },
57
+ has(ref) {
58
+ return store.has(assertCredentialRef(ref));
59
+ },
60
+ size() {
61
+ return store.size;
62
+ }
63
+ };
64
+ }
65
+ var sharedSessionBroker;
66
+ function getSharedSessionCredentialBroker() {
67
+ if (!sharedSessionBroker) sharedSessionBroker = createSessionMemoryCredentialBroker();
68
+ return sharedSessionBroker;
69
+ }
27
70
 
28
71
  // packages/cli/agentRecordHelpers.ts
29
72
  import { readFileSync } from "node:fs";
30
73
 
74
+ // packages/agent-runtime/oauthProviderRefs.ts
75
+ var OAUTH_PROVIDER_REFS = [
76
+ "chatgpt",
77
+ "xai",
78
+ "antigravity",
79
+ "claude",
80
+ "cursor",
81
+ "devin"
82
+ ];
83
+ var METERED_API_KEY_REF_PREFIX = "api-key:";
84
+ var normalizeRef = (ref) => typeof ref === "string" ? ref.trim().toLowerCase() : "";
85
+ var isKnownOAuthProviderRef = (ref) => OAUTH_PROVIDER_REFS.includes(normalizeRef(ref));
86
+ var isMeteredApiKeyRef = (ref) => {
87
+ const trimmed = typeof ref === "string" ? ref.trim() : "";
88
+ return trimmed.length > METERED_API_KEY_REF_PREFIX.length && trimmed.slice(0, METERED_API_KEY_REF_PREFIX.length).toLowerCase() === METERED_API_KEY_REF_PREFIX;
89
+ };
90
+ var OAUTH_PROVIDER_REF_LIST_COPY = OAUTH_PROVIDER_REFS.join(" / ");
91
+ function classifyAgentApiKeyRef(raw) {
92
+ const trimmed = typeof raw === "string" ? raw.trim() : "";
93
+ if (!trimmed) return { ok: true, kind: "empty" };
94
+ if (isKnownOAuthProviderRef(trimmed)) {
95
+ return {
96
+ ok: true,
97
+ kind: "oauth-provider",
98
+ provider: normalizeRef(trimmed)
99
+ };
100
+ }
101
+ if (isMeteredApiKeyRef(trimmed)) return { ok: true, kind: "metered-api-key" };
102
+ return { ok: false, kind: "unsupported-oauth-provider", ref: trimmed };
103
+ }
104
+ function formatUnsupportedAgentApiKeyRefMessage(raw) {
105
+ const shown = typeof raw === "string" ? raw.trim() : "";
106
+ return `apiKeyRef "${shown}" \u4E0D\u662F\u53D7\u652F\u6301\u7684\u53D6\u503C\uFF0C\u8BB0\u5F55\u672A\u5199\u5165\u3002\u5408\u6CD5\u53D6\u503C\uFF1AOAuth provider ref\uFF08${OAUTH_PROVIDER_REF_LIST_COPY}\uFF09\uFF0C\u6216\u8BA1\u91CF/\u8BBE\u5907 broker ref\uFF08\u4EE5 "${METERED_API_KEY_REF_PREFIX}" \u5F00\u5934\uFF0C\u5982 ${METERED_API_KEY_REF_PREFIX}agent-...\uFF09\u3002\u6539\u6CD5\uFF1A\u628A apiKeyRef \u6539\u6210\u4E0A\u9762\u67D0\u4E2A\u53D7\u652F\u6301\u7684\u53D6\u503C\uFF0C\u6216\u6539\u7528 ${METERED_API_KEY_REF_PREFIX}<id>\uFF1B\u82E5\u8981\u7528\u81EA\u5E26 API key\uFF0C\u8BF7\u6E05\u7A7A apiKeyRef \u5E76\u586B\u5199 apiKey\u3002`;
107
+ }
108
+
31
109
  // packages/core/agentHandle.ts
32
110
  function normalizeAgentHandle(value) {
33
111
  return typeof value === "string" && value.trim() ? value.trim().toLowerCase().replace(/\s+/g, " ") : void 0;
34
112
  }
35
113
 
114
+ // packages/cli/client/localAgentRecords.ts
115
+ var buildLocalAgentLookupKeys = buildAgentRuntimeAgentLookupKeys;
116
+ var shouldReadAgentKeyRemotely = shouldFetchAgentRuntimeRecordRemotely;
117
+
36
118
  // packages/cli/agentRecordHelpers.ts
37
119
  var PROVIDER_COPY_FIELDS = [
38
120
  "apiSource",
@@ -243,6 +325,7 @@ function assertSupportedAgentApiKeyRef(record) {
243
325
  }
244
326
  async function writeAgentRecord(args) {
245
327
  assertSupportedAgentApiKeyRef(args.record);
328
+ const remoteRecord = args.remoteIncludeApiKey === false ? Object.fromEntries(Object.entries(args.record).filter(([field]) => field !== "apiKey")) : args.record;
246
329
  const res = await fetchWithTransportFallback(`${args.serverUrl}/api/v1/db/write/`, {
247
330
  method: "POST",
248
331
  headers: {
@@ -253,7 +336,7 @@ async function writeAgentRecord(args) {
253
336
  customKey: args.agentKey,
254
337
  userId: args.userId,
255
338
  data: {
256
- ...args.record,
339
+ ...remoteRecord,
257
340
  dbKey: args.agentKey
258
341
  }
259
342
  })
@@ -494,6 +577,72 @@ function normalizeAgentRecordForOutput(agentKey, authToken, agent) {
494
577
  record: sanitizedRecord
495
578
  };
496
579
  }
580
+ var INBOUND_CRED_REF_PREFIX = "$nolo_cred:";
581
+ var VAULT_REF_PATTERN = /^vault-cred-[A-Za-z0-9]+$/;
582
+ function detectVaultCredentialId(value) {
583
+ const trimmed = typeof value === "string" ? value.trim() : "";
584
+ const candidate = trimmed.startsWith(INBOUND_CRED_REF_PREFIX) ? trimmed.slice(INBOUND_CRED_REF_PREFIX.length).trim() : trimmed;
585
+ return VAULT_REF_PATTERN.test(candidate) ? candidate : null;
586
+ }
587
+ var hostCredentialBrokerOverride;
588
+ var credentialStorageWarnings = [];
589
+ var CREDENTIAL_STORE_SESSION_FALLBACK_WARNING = "\u7CFB\u7EDF\u5B89\u5168\u533A\u4E0D\u53EF\u7528\uFF0C\u672C\u6B21\u4F1A\u8BDD\u5185\u6709\u6548\uFF0C\u672A\u6301\u4E45\u5316\uFF1B\u91CD\u542F\u540E\u9700\u91CD\u65B0\u63D0\u4F9B\u8BE5\u51ED\u636E\u3002";
590
+ var CREDENTIAL_STORE_FALLBACK_WARNING = "\u7CFB\u7EDF\u5B89\u5168\u533A\u4E0D\u53EF\u7528\uFF0C\u5DF2\u56DE\u9000\u5230\u672C\u5730\u6587\u4EF6\u5B58\u50A8\uFF080600 \u660E\u6587\uFF09\u3002\u5EFA\u8BAE\u542F\u7528\u7CFB\u7EDF\u94A5\u5319\u4E32\uFF08Linux: Secret Service / gnome-keyring\uFF09\u3002";
591
+ function resolveStrictCredentialBroker(broker) {
592
+ return broker ?? hostCredentialBrokerOverride ?? createStrictHostCredentialBroker();
593
+ }
594
+ var legacyReadNoticed = /* @__PURE__ */ new Set();
595
+ function resolveHostCredentialBroker(broker) {
596
+ if (broker || hostCredentialBrokerOverride) return resolveStrictCredentialBroker(broker);
597
+ return createHostCredentialBrokerChain({
598
+ strict: createStrictHostCredentialBroker(),
599
+ session: getSharedSessionCredentialBroker(),
600
+ legacy: createFileCredentialBroker({ migration: { enableLegacyMigration: true } }),
601
+ notifySessionFallback: () => {
602
+ try {
603
+ process.stderr.write(`[nolo] Warning: ${CREDENTIAL_STORE_SESSION_FALLBACK_WARNING}
604
+ `);
605
+ } catch {
606
+ }
607
+ },
608
+ notifyLegacyHit: (ref) => {
609
+ if (legacyReadNoticed.has(ref)) return;
610
+ legacyReadNoticed.add(ref);
611
+ try {
612
+ process.stderr.write(
613
+ `[nolo] Warning: \u51ED\u636E "${ref}" \u6765\u81EA\u9057\u7559\u672C\u5730\u660E\u6587\u5B58\u50A8\uFF08\u53EA\u8BFB\u56DE\u9000\uFF09\u3002\u5EFA\u8BAE\u91CD\u65B0\u5F55\u5165\u8BE5 API key \u4EE5\u8FC1\u5165\u7CFB\u7EDF\u5B89\u5168\u533A\u3002
614
+ `
615
+ );
616
+ } catch {
617
+ }
618
+ }
619
+ });
620
+ }
621
+ async function storeAgentCredential(args) {
622
+ const broker = resolveStrictCredentialBroker(args.broker);
623
+ const credentialRef = buildAgentApiKeyCredentialRef(args.agentKey);
624
+ await migrateAgentSecrets({
625
+ agent: { key: args.agentKey, apiKey: args.secret, apiKeyRef: credentialRef },
626
+ broker
627
+ });
628
+ if (!await broker.has(credentialRef)) {
629
+ throw new Error(`failed to store the credential in the host credential store (${credentialRef}).`);
630
+ }
631
+ return { credentialRef };
632
+ }
633
+ async function bindVaultCredentialToAgent(args) {
634
+ const broker = resolveHostCredentialBroker(args.broker);
635
+ const secret = await broker.get(args.vaultId);
636
+ if (!secret) {
637
+ throw new Error(
638
+ `--api-key received a vault credential id (${args.vaultId}) but no secret is stored for it on this device. Re-paste the key in the chat so the runtime can isolate it again, or ask the user to run \`nolo secret set <name> --prompt\`.`
639
+ );
640
+ }
641
+ return await storeAgentCredential({ agentKey: args.agentKey, secret, broker: args.broker });
642
+ }
643
+ async function readBoundAgentCredential(credentialRef, broker) {
644
+ return await resolveHostCredentialBroker(broker).get(credentialRef);
645
+ }
497
646
  function parseAgentUpdateArgs(args) {
498
647
  const agentInput = readOption(args, "--agent") ?? readOption(args, "--id") ?? args[0]?.trim();
499
648
  if (!agentInput || agentInput === "--help" || agentInput === "-h") return null;
@@ -552,13 +701,57 @@ function parseAgentUpdateArgs(args) {
552
701
  }
553
702
  return { agentInput, updates, promptDoc, copyProviderFrom, verify, verifyPrompt, presetId };
554
703
  }
704
+ function looksLikePlaintextApiKey(value) {
705
+ const trimmed = typeof value === "string" ? value.trim() : "";
706
+ if (trimmed.length < 12) return false;
707
+ if (/^(?:api-key:|vault-cred-)/i.test(trimmed)) return false;
708
+ const verdict = classifyAgentApiKeyRef(trimmed);
709
+ if (verdict.ok && verdict.kind !== "empty") return false;
710
+ return true;
711
+ }
712
+ async function applyVaultCredentialBinding(updates, agentKey, broker, fallbackProviderUrl, preservePlaintextApiKey) {
713
+ const vaultId = detectVaultCredentialId(updates.apiKey);
714
+ if (!vaultId) {
715
+ const rawApiKey = updates.apiKey;
716
+ if (!looksLikePlaintextApiKey(rawApiKey)) return;
717
+ try {
718
+ const { credentialRef: credentialRef2 } = await storeAgentCredential({
719
+ agentKey,
720
+ secret: String(rawApiKey).trim(),
721
+ broker
722
+ });
723
+ delete updates.apiKey;
724
+ updates.credentialRef = credentialRef2;
725
+ updates.apiKeyRef = credentialRef2;
726
+ if (preservePlaintextApiKey && typeof rawApiKey === "string") {
727
+ updates.apiKey = rawApiKey;
728
+ }
729
+ return;
730
+ } catch {
731
+ credentialStorageWarnings.push(CREDENTIAL_STORE_FALLBACK_WARNING);
732
+ process.stderr.write(`[nolo] Warning: ${CREDENTIAL_STORE_FALLBACK_WARNING}
733
+ `);
734
+ return;
735
+ }
736
+ }
737
+ delete updates.apiKey;
738
+ const target = typeof updates.customProviderUrl === "string" && updates.customProviderUrl.trim() ? updates.customProviderUrl.trim() : (fallbackProviderUrl ?? "").trim();
739
+ if (!target) {
740
+ throw new Error(
741
+ "--api-key received a vault credential id, but no provider target was given. Pass --custom-provider-url <base> (or --preset <id>) so the credential has a known destination."
742
+ );
743
+ }
744
+ const { credentialRef } = await bindVaultCredentialToAgent({ agentKey, vaultId, broker });
745
+ updates.credentialRef = credentialRef;
746
+ updates.apiKeyRef = credentialRef;
747
+ }
555
748
  async function buildCreatedAgentRecord(args) {
556
749
  const serverUrl = args.cliArgs ? resolveServerUrl(args.cliArgs, args.env) : resolveServerUrl(args.env);
557
750
  const userId = parseUserIdFromAuthToken(args.authToken);
558
751
  const resolvedAgentInput = resolveCliAgentKeyInput(args.parsed.agentInput);
559
752
  const agentKey = resolvedAgentInput.startsWith("agent-") ? resolvedAgentInput : createAgentKey.private(userId || "local", resolvedAgentInput);
560
753
  if (args.parsed.presetId) {
561
- const { resolveProviderPresetFields } = await import("./providerPresetApply-ZYMLQA46.js");
754
+ const { resolveProviderPresetFields } = await import("./providerPresetApply-YXGV6NXB.js");
562
755
  const fields = resolveProviderPresetFields(args.parsed.presetId);
563
756
  if (fields.kind === "manual") {
564
757
  throw new Error(
@@ -617,13 +810,22 @@ async function buildCreatedAgentRecord(args) {
617
810
  if (args.parsed.updates.customProviderUrl && !args.parsed.updates.apiSource) {
618
811
  args.parsed.updates.apiSource = "custom";
619
812
  }
813
+ await applyVaultCredentialBinding(
814
+ args.parsed.updates,
815
+ agentKey,
816
+ args.credentialBroker,
817
+ void 0,
818
+ !args.hostApproval?.gateId
819
+ );
820
+ const now = Date.now();
620
821
  const nextRecord = {
621
822
  ...args.parsed.updates,
622
823
  dbKey: agentKey,
623
824
  key: agentKey,
624
825
  type: "agent" /* AGENT */,
625
- createdAt: Date.now(),
626
- updatedAt: Date.now(),
826
+ ...buildRestorePatch(new Date(now).toISOString()),
827
+ createdAt: now,
828
+ updatedAt: now,
627
829
  userId
628
830
  };
629
831
  return {
@@ -686,6 +888,15 @@ async function buildUpdatedAgentRecord(args) {
686
888
  }
687
889
  args.parsed.updates.prompt = promptBody;
688
890
  }
891
+ await applyVaultCredentialBinding(
892
+ args.parsed.updates,
893
+ agentKey,
894
+ args.credentialBroker,
895
+ typeof currentRecord?.customProviderUrl === "string" ? currentRecord.customProviderUrl : void 0,
896
+ // update 的来源判定与 create 一致:宿主代执行 → 严格(删明文只留 ref);
897
+ // 用户自己终端敲 → 保持既有行为(明文照旧写进记录)。
898
+ !args.hostApproval?.gateId
899
+ );
689
900
  const nextRecord = {
690
901
  ...currentRecord,
691
902
  ...args.parsed.updates,
@@ -701,6 +912,9 @@ async function buildUpdatedAgentRecord(args) {
701
912
  }
702
913
 
703
914
  export {
915
+ getSharedSessionCredentialBroker,
916
+ OAUTH_PROVIDER_REFS,
917
+ buildLocalAgentLookupKeys,
704
918
  fetchWithTransportFallback,
705
919
  readAgentRecord,
706
920
  readDbRecord,
@@ -713,6 +927,8 @@ export {
713
927
  agentRecordHasConfiguredCredential,
714
928
  sanitizeAgentRecordForCliOutput,
715
929
  normalizeAgentRecordForOutput,
930
+ CREDENTIAL_STORE_SESSION_FALLBACK_WARNING,
931
+ readBoundAgentCredential,
716
932
  parseAgentUpdateArgs,
717
933
  buildCreatedAgentRecord,
718
934
  buildUpdatedAgentRecord
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  selectCurrentServer
3
- } from "./chunk-BSISWVB4.js";
3
+ } from "./chunk-4I7ERB7F.js";
4
4
  import {
5
5
  patch
6
- } from "./chunk-UMEGDH6A.js";
6
+ } from "./chunk-FW6YHHLI.js";
7
7
  import {
8
8
  getIsDesktopApp
9
9
  } from "./chunk-AGP3YSEC.js";
@@ -15,10 +15,10 @@ import {
15
15
  } from "./chunk-4O22PGNQ.js";
16
16
  import {
17
17
  scheduleWindowsSelfUpdate
18
- } from "./chunk-LKDF3ATR.js";
18
+ } from "./chunk-INUFILG6.js";
19
19
  import {
20
20
  t
21
- } from "./chunk-3RQVYR4B.js";
21
+ } from "./chunk-VNYYOX3V.js";
22
22
 
23
23
  // packages/cli/updateCommands.ts
24
24
  import { existsSync, readFileSync, accessSync, constants } from "node:fs";
@@ -79,8 +79,17 @@ function resolveStandaloneBundleRepoBase(channel) {
79
79
  }
80
80
  function buildStandaloneManualUpdateHint(channel) {
81
81
  const repoBase = resolveStandaloneBundleRepoBase(channel);
82
+ if (channel === "alpha") {
83
+ return `curl -fsSL ${repoBase}/install-nolo.sh | NOLO_INSTALL_CHANNEL=alpha sh`;
84
+ }
82
85
  return `curl -fsSL ${repoBase}/install-nolo.sh | sh`;
83
86
  }
87
+ function buildStandaloneBundleTarballName(tarballName, channel) {
88
+ if (channel !== "alpha") return tarballName;
89
+ const suffix = ".tar.gz";
90
+ const stem = tarballName.endsWith(suffix) ? tarballName.slice(0, -suffix.length) : tarballName;
91
+ return `${stem}-alpha.tar.gz`;
92
+ }
84
93
  function resolveStandaloneInstallDir() {
85
94
  const candidates = [
86
95
  "/usr/local/bin",
@@ -356,8 +365,9 @@ async function runStandaloneBundleUpdate(options) {
356
365
  }
357
366
  const { tarballName, extractSubdir } = platform;
358
367
  const repoBase = resolveStandaloneBundleRepoBase(channel);
359
- const tarballUrl = `${repoBase}/public/downloads/${tarballName}`;
360
- const fallbackUrl = `https://nolo.chat/public/downloads/${tarballName}`;
368
+ const bundleName = buildStandaloneBundleTarballName(tarballName, channel);
369
+ const tarballUrl = `${repoBase}/public/downloads/${bundleName}`;
370
+ const fallbackUrl = `https://nolo.chat/public/downloads/${bundleName}`;
361
371
  const extractDir = join(homedir(), ".nolo", extractSubdir);
362
372
  const installDir = resolveStandaloneInstallDir();
363
373
  const symlinkPath = join(installDir, "nolo");
@@ -569,6 +579,7 @@ export {
569
579
  resolveStandaloneBundlePlatform,
570
580
  resolveStandaloneBundleRepoBase,
571
581
  buildStandaloneManualUpdateHint,
582
+ buildStandaloneBundleTarballName,
572
583
  readPackageInfo,
573
584
  buildCliVersionText,
574
585
  buildSelfUpdateCommand,
@@ -1,13 +1,14 @@
1
+ import {
2
+ resolveRuntimeAuthToken,
3
+ resolveRuntimeServerUrl
4
+ } from "./chunk-HRMJUN5J.js";
1
5
  import {
2
6
  isAgentRunTerminalStatus,
3
7
  normalizeRunTitle
4
- } from "./chunk-PJNFNEJE.js";
8
+ } from "./chunk-ALQ3657A.js";
5
9
  import {
6
10
  findPowerShellExecutable
7
- } from "./chunk-XPHZK3PJ.js";
8
- import {
9
- resolvePlatformAuthToken
10
- } from "./chunk-PV6JJAUB.js";
11
+ } from "./chunk-H4UOTUOX.js";
11
12
  import {
12
13
  isRecord
13
14
  } from "./chunk-KUG52IAP.js";
@@ -1073,22 +1074,6 @@ function reserveHostMemory(deps) {
1073
1074
  throw new Error("[host-memory-reservation] exclusive lock required");
1074
1075
  }
1075
1076
 
1076
- // packages/cli/client/localRuntimeHelpers.ts
1077
- var REMOTE_DIALOG_SYNC_TIMEOUT_MS = 1e4;
1078
- var remoteDialogSyncTimeoutMsForTest;
1079
- function setRemoteDialogSyncTimeoutForTest(ms) {
1080
- remoteDialogSyncTimeoutMsForTest = ms;
1081
- }
1082
- function remoteDialogSyncTimeout() {
1083
- return remoteDialogSyncTimeoutMsForTest ?? REMOTE_DIALOG_SYNC_TIMEOUT_MS;
1084
- }
1085
- function resolveRuntimeServerUrl(env) {
1086
- return (env?.NOLO_SERVER_URL || env?.NOLO_SERVER || env?.BASE_URL || "").replace(/\/+$/, "");
1087
- }
1088
- function resolveRuntimeAuthToken(env) {
1089
- return resolvePlatformAuthToken(env ?? {});
1090
- }
1091
-
1092
1077
  // packages/cli/agentRunResultFile.ts
1093
1078
  function resolveResultServerMeta(input) {
1094
1079
  const serverUrl = resolveRuntimeServerUrl(input.env);
@@ -2308,7 +2293,11 @@ async function spawnLocalBackgroundRun(input, deps = {}) {
2308
2293
  const childEnv = {
2309
2294
  ...env,
2310
2295
  NOLO_AGENT_RUN_CHILD: "1",
2311
- NOLO_AGENT_RUN_ID: runId
2296
+ NOLO_AGENT_RUN_ID: runId,
2297
+ ...input.subtaskBudgetLimits ? {
2298
+ NOLO_SUBTASK_MAX_TOOL_CALLS: String(input.subtaskBudgetLimits.maxToolCalls),
2299
+ NOLO_SUBTASK_MAX_WALL_CLOCK_MS: String(input.subtaskBudgetLimits.maxWallClockMs)
2300
+ } : {}
2312
2301
  };
2313
2302
  let hostMemory = null;
2314
2303
  let reservation;
@@ -3148,14 +3137,10 @@ async function runAgentKillCommand(args, deps) {
3148
3137
  }
3149
3138
 
3150
3139
  export {
3151
- TAIL_LINES_MAX,
3152
3140
  createShellApprovalChild,
3141
+ TAIL_LINES_MAX,
3153
3142
  readHostMemory,
3154
3143
  assertHostMemoryAdmission,
3155
- setRemoteDialogSyncTimeoutForTest,
3156
- remoteDialogSyncTimeout,
3157
- resolveRuntimeServerUrl,
3158
- resolveRuntimeAuthToken,
3159
3144
  resolveResultServerMeta,
3160
3145
  recordRunResultHeaderMeta,
3161
3146
  getRunResultHeaderMeta,
@@ -7,7 +7,7 @@ import {
7
7
  scheduleExistingRecordReplication,
8
8
  shouldReplaceLocalWithRemoteRecord,
9
9
  shouldReplicateLocalRecord
10
- } from "./chunk-UCPAVEQB.js";
10
+ } from "./chunk-PYRUW7XN.js";
11
11
  import {
12
12
  fetchFromClientDb,
13
13
  fetchFromServer,
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk-AGP3YSEC.js";
17
17
  import {
18
18
  shouldReplaceWithNextRecord
19
- } from "./chunk-D2MDMY2M.js";
19
+ } from "./chunk-SVYO6AO7.js";
20
20
  import {
21
21
  isAbortError
22
22
  } from "./chunk-7DPNBQSV.js";
@@ -136,5 +136,6 @@ function createFileCredentialBroker(options = {}) {
136
136
  }
137
137
 
138
138
  export {
139
+ assertCredentialRef,
139
140
  createFileCredentialBroker
140
141
  };
@@ -22,15 +22,16 @@ import {
22
22
  extractToolCallsFromResponseOutput,
23
23
  getUsageRequestOptions,
24
24
  hasImageParts,
25
+ resolveReasoningReplayOptions,
25
26
  sanitizeForOutbound,
26
27
  shouldStripReasoningContentForOutbound,
27
28
  stablePromptCacheKey,
28
29
  toOpenAiCompatibleMessages,
29
30
  toResponsesTools
30
- } from "./chunk-CVCRAO6Q.js";
31
+ } from "./chunk-H5HF7TJA.js";
31
32
  import {
32
33
  resolveToolImagePolicy
33
- } from "./chunk-DA7CTWT4.js";
34
+ } from "./chunk-YWSEPJ7C.js";
34
35
  import {
35
36
  isMeaningfulChatCompletionOutput,
36
37
  isMeaningfulResponsesOutput
@@ -47,7 +48,7 @@ import {
47
48
  resolvePlatformAuthToken,
48
49
  resolvePlatformServerUrl,
49
50
  resolveProviderTransportDecision
50
- } from "./chunk-PV6JJAUB.js";
51
+ } from "./chunk-TCZHTTUU.js";
51
52
  import {
52
53
  isRecord
53
54
  } from "./chunk-KUG52IAP.js";
@@ -518,10 +519,15 @@ function buildPlatformChatCompletionRequest(args) {
518
519
  }
519
520
  const usesResponsesApi = isResponsesEndpoint(args.providerConfig.endpoint);
520
521
  const requestOptions = usesResponsesApi ? toResponsesRequestOptions(args.providerConfig.requestOptions) : args.providerConfig.requestOptions;
521
- const shouldStripReasoning = shouldStripReasoningContentForOutbound(
522
+ const shouldStripReasoning = !usesResponsesApi && shouldStripReasoningContentForOutbound(
522
523
  args.providerConfig.provider,
523
524
  args.providerConfig.model
524
525
  );
526
+ const reasoningReplayOptions = resolveReasoningReplayOptions(
527
+ args.providerConfig.provider,
528
+ args.providerConfig.model,
529
+ shouldStripReasoning
530
+ );
525
531
  const sanitizedMessages = sanitizeForOutbound(args.messages, args.tools);
526
532
  const body = {
527
533
  model: args.providerConfig.model,
@@ -537,8 +543,15 @@ function buildPlatformChatCompletionRequest(args) {
537
543
  model: args.providerConfig.model,
538
544
  customProviderUrl: args.providerConfig.endpoint,
539
545
  hasVision: args.providerConfig.hasVision
540
- })
541
- })
546
+ }),
547
+ // 占位必须在**这一层**注入,不能只交给 responsesHelpers:
548
+ // `toOpenAiCompatibleMessages` 会用 preserveAgentStateFields 重建对象,
549
+ // 而非枚举 Symbol 标记(DOWNGRADED_TOOL_TURN_ORIGIN)不会跟着走,
550
+ // 所以「整体降级成纯文本的工具轮」到了 Responses 转换器那里已经认不出来。
551
+ // 在这里注入后,转换器只需读非空 reasoning_content 这条既有真值路径。
552
+ ...reasoningReplayOptions
553
+ }),
554
+ reasoningReplayOptions
542
555
  )
543
556
  } : {
544
557
  messages: toOpenAiCompatibleMessages(sanitizedMessages, {