nolo-cli 0.33.0-alpha.8 → 0.34.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/{_executeModel-RI6DRQTP.js → _executeModel-BUYCXZCQ.js} +65 -65
  2. package/{action-SMLG6OTB.js → action-KMBZ3LCZ.js} +12 -12
  3. package/{addContentAction-SFO244QN.js → addContentAction-KQ44UT2U.js} +10 -10
  4. package/{addDialogAgentAction-W44ZCEHB.js → addDialogAgentAction-ILSDCMYL.js} +9 -9
  5. package/{agentDeleteCommand-F2P4PF6R.js → agentDeleteCommand-WSS2IJVM.js} +40 -39
  6. package/{agentEmailCommands-BW6ZDQ3C.js → agentEmailCommands-SHTPJTSX.js} +75 -75
  7. package/{agentListCommands-IC3GH45S.js → agentListCommands-GV6UYVAF.js} +47 -37
  8. package/{agentMachineCommands-LGYGQX75.js → agentMachineCommands-FLD7TAFH.js} +37 -36
  9. package/agentProviderCommands-65ZC2WB4.js +122 -0
  10. package/{agentPullCommand-YH5GEBK4.js → agentPullCommand-TSWAJPS2.js} +1 -1
  11. package/agentRecordCommands-57W6R7QW.js +113 -0
  12. package/{agentRunCommand-F5L6GPSK.js → agentRunCommand-HJGXSMDN.js} +78 -76
  13. package/{agentRunControl-SCIVRZWX.js → agentRunControl-GXOB47YI.js} +5 -1
  14. package/{agentRuntimeLocal-B7SHOEHJ.js → agentRuntimeLocal-G7ZV55I6.js} +33 -33
  15. package/{agentSlice-GMKJKCPY.js → agentSlice-HFR7SP3B.js} +12 -12
  16. package/agentSuperviseCommands-Q64S5SPG.js +640 -0
  17. package/{appDeleteCommands-63VCZ5CT.js → appDeleteCommands-SHHE56Y2.js} +35 -34
  18. package/{appDeployCommands-YFTG2P3K.js → appDeployCommands-WUMSO2VS.js} +35 -34
  19. package/{appDeployStatusCommands-R5ENU5CQ.js → appDeployStatusCommands-VZSVN6SR.js} +35 -34
  20. package/{appGetCommands-3CH3VMUB.js → appGetCommands-ZJ2C3A5Y.js} +35 -34
  21. package/{appListCommands-Q2HVYG7J.js → appListCommands-W33L6U5X.js} +35 -34
  22. package/{authCommand-6Y5LTMZB.js → authCommand-B2XRHNJH.js} +19 -19
  23. package/{authCommands-EAPFGNHN.js → authCommands-GWABTFMR.js} +6 -6
  24. package/{chatQueueReduxAdapter-ZRFKEKD3.js → chatQueueReduxAdapter-SYIX4ODY.js} +28 -28
  25. package/{chunk-57QJXIB6.js → chunk-23KKIMD5.js} +7 -7
  26. package/{chunk-HUCT7HID.js → chunk-2KO5QQFV.js} +2 -2
  27. package/{chunk-2UECQ7RE.js → chunk-3AOLVADY.js} +1 -1
  28. package/{chunk-PVVAWIUN.js → chunk-3LWZNEGQ.js} +1 -1
  29. package/{chunk-2GKZGZBN.js → chunk-3XZUNRYF.js} +33 -158
  30. package/{chunk-M2YMQOLC.js → chunk-4APLX2RT.js} +75 -10
  31. package/{chunk-ZHYK3N56.js → chunk-4AWH4LQA.js} +3 -1
  32. package/{chunk-3GZXL6FM.js → chunk-4DMPISV6.js} +7 -3
  33. package/chunk-4HOXB6SY.js +297 -0
  34. package/{chunk-OIQPORYI.js → chunk-64KIQZA2.js} +175 -2
  35. package/{chunk-MUCM2MZB.js → chunk-6KYCG5GW.js} +1216 -690
  36. package/chunk-6XG52ZQ6.js +146 -0
  37. package/{chunk-XFV2VK7O.js → chunk-74IQ5RRO.js} +21 -8
  38. package/{chunk-FMEVI5TG.js → chunk-7CH6U3FL.js} +1 -1
  39. package/{chunk-6FNS3SQF.js → chunk-7YDKVLAE.js} +10 -10
  40. package/{chunk-LZC5YX6P.js → chunk-AUH2LTIY.js} +7 -7
  41. package/{chunk-CLP2K7U4.js → chunk-B6H5XCT2.js} +8 -8
  42. package/{chunk-NNWHHCVP.js → chunk-BMB563Y6.js} +10 -4
  43. package/{chunk-DFUPZE6V.js → chunk-C6ELZQ7H.js} +249 -34
  44. package/{chunk-XL7BR2GE.js → chunk-DX6BP4K7.js} +285 -251
  45. package/{chunk-6HYVJV7B.js → chunk-ESHYE7WU.js} +2 -1
  46. package/{chunk-JZPBVBIY.js → chunk-FD36SCCD.js} +19 -8
  47. package/{chunk-W7J5HZI7.js → chunk-FDKEDU7R.js} +14 -14
  48. package/{chunk-AOXVOC6D.js → chunk-FGLKRJDI.js} +54 -3
  49. package/{chunk-2QTEYCR7.js → chunk-FTM4KUOZ.js} +17 -17
  50. package/{chunk-U4TRT5V4.js → chunk-GEPHJJW4.js} +1 -1
  51. package/{chunk-7YYHKBJP.js → chunk-GKHV4UH5.js} +1 -1
  52. package/{chunk-2IVEXF7P.js → chunk-GUYMR3JL.js} +6 -33
  53. package/{chunk-YDTYDA5W.js → chunk-GZRMWK5R.js} +6 -4
  54. package/{chunk-KBZCACG7.js → chunk-HDT2RB7T.js} +3 -3
  55. package/{chunk-X664KVEV.js → chunk-HHBXCRJS.js} +204 -123
  56. package/{chunk-37V5LNEQ.js → chunk-IFS5CUEH.js} +1 -1
  57. package/{chunk-WLH5BAKX.js → chunk-IIOHYLIG.js} +9 -4
  58. package/{chunk-ADLYMQB6.js → chunk-IZCHPD7T.js} +52 -3
  59. package/{chunk-ITIA6OAQ.js → chunk-IZNJDUJ4.js} +5 -5
  60. package/{chunk-X2DAEZ3X.js → chunk-J5NMOM35.js} +1 -1
  61. package/{chunk-PREQU5QV.js → chunk-JI2TIPLP.js} +1 -1
  62. package/{chunk-EGRJC4ZN.js → chunk-JIADXJYU.js} +1 -1
  63. package/{chunk-IHEC7VBF.js → chunk-K4KIFRIN.js} +1 -1
  64. package/{chunk-JCGIUBE3.js → chunk-KCBK4MDT.js} +294 -54
  65. package/{chunk-WJSW43QZ.js → chunk-L3JWI7WX.js} +0 -1
  66. package/{chunk-VOBUVWP5.js → chunk-LAUUAYLK.js} +39 -2672
  67. package/{chunk-TFPUAELY.js → chunk-LD6Y6RJY.js} +4 -4
  68. package/{chunk-NKFMFT4W.js → chunk-LQ6PUHW6.js} +4195 -2631
  69. package/chunk-M3JQWYBC.js +387 -0
  70. package/{chunk-GM6PU7B6.js → chunk-MEYIRKDN.js} +0 -1
  71. package/{chunk-JZ5AMMXU.js → chunk-MGIHZ5CJ.js} +4 -4
  72. package/chunk-MI2J67UU.js +43 -0
  73. package/{chunk-JTSGWTYZ.js → chunk-MJWX4JQO.js} +2 -2
  74. package/{chunk-Q5ITEGIN.js → chunk-N4XRDM26.js} +1 -1
  75. package/{chunk-5CS33IBL.js → chunk-NQ4N4IGO.js} +11 -12
  76. package/{chunk-ZZ2MH7LE.js → chunk-O6OSWFZQ.js} +0 -1
  77. package/{chunk-ZURFOV5J.js → chunk-OFZPJ3NT.js} +13 -4
  78. package/{chunk-CHYAYZJH.js → chunk-OSCSEJJR.js} +15 -8
  79. package/{chunk-SCUETSRP.js → chunk-PV734VZX.js} +1 -1
  80. package/{chunk-7E72JMBB.js → chunk-SMPAUSX5.js} +46 -5
  81. package/{chunk-XCCGU6QB.js → chunk-U6QQLXWI.js} +1 -1
  82. package/{chunk-NUO3QFWD.js → chunk-UNHKVD2N.js} +1 -1
  83. package/{chunk-GE6IWA5N.js → chunk-UNZDCI3O.js} +126 -1
  84. package/{chunk-CPYYM4RJ.js → chunk-V5GA74HI.js} +19 -5
  85. package/{chunk-O6W5PZXA.js → chunk-VBD7W4Q6.js} +2057 -212
  86. package/{chunk-RTJWH72P.js → chunk-VD2SO4RG.js} +4 -4
  87. package/{chunk-FXFGNOT2.js → chunk-VFVCYIRQ.js} +1 -1
  88. package/{chunk-7KNERA53.js → chunk-VSA6QAGV.js} +47 -3
  89. package/{chunk-G7E4NWFE.js → chunk-W445DPVT.js} +1 -1
  90. package/{chunk-VH2F7ZB6.js → chunk-WN5AJG5I.js} +1 -1
  91. package/{chunk-KSRFVP36.js → chunk-WRN7L5CS.js} +1 -1
  92. package/{chunk-4C7K5NXX.js → chunk-WRP5TTM6.js} +4 -84
  93. package/chunk-X2K2JSO4.js +163 -0
  94. package/{chunk-OR2HNLVO.js → chunk-X6EN3KJX.js} +279 -477
  95. package/{chunk-IL545V3E.js → chunk-XQES6LXQ.js} +2 -2
  96. package/{chunk-UK5JGQVU.js → chunk-XT73C4VH.js} +26 -21
  97. package/{chunk-RY57GLGW.js → chunk-YPREESF4.js} +42 -5
  98. package/{chunk-YBPAQV37.js → chunk-YRP7LG4R.js} +4527 -4080
  99. package/{chunk-BQXOGBFN.js → chunk-YZ2WE6CW.js} +2 -2
  100. package/{chunk-3WXRAHCG.js → chunk-ZBB3MZR3.js} +3 -3
  101. package/{cliExecutor-DW3PHGEL.js → cliExecutor-BBUVQU4L.js} +2 -2
  102. package/{clipboardy-MMBYVRLF.js → clipboardy-PRUHGPGC.js} +4 -3
  103. package/{codingSkills-DY5MINPG.js → codingSkills-H6N5EKSX.js} +3 -3
  104. package/cooldownCommands-C2SZLEEO.js +90 -0
  105. package/{createAgentAutomationAction-6SE7CQ7F.js → createAgentAutomationAction-BH3D2L2H.js} +28 -30
  106. package/{createDialogAction-AROAXAPM.js → createDialogAction-U4LDV2RW.js} +31 -33
  107. package/{createPageAction-GCO3R6GR.js → createPageAction-Q2ANG535.js} +30 -32
  108. package/{dbSlice-3SD5L5H2.js → dbSlice-PIQGICNM.js} +9 -9
  109. package/{deleteFile-XQXPBFFB.js → deleteFile-NPZ64DFN.js} +4 -4
  110. package/{dialogCommands-N26NNRRD.js → dialogCommands-C556D6WD.js} +37 -36
  111. package/{dialogSlice-JVPBOMFB.js → dialogSlice-P2VSKG2X.js} +27 -27
  112. package/dist-VODFSGNG.js +7442 -0
  113. package/{docCreateCommands-PON6FF4V.js → docCreateCommands-AAVGLQWE.js} +36 -35
  114. package/{docDeleteCommands-WWRFONDS.js → docDeleteCommands-PKMKSQD2.js} +37 -36
  115. package/{docReadCommands-S4Z275LB.js → docReadCommands-2WUH7UXC.js} +36 -35
  116. package/{docStore-WGDO3I76.js → docStore-J5UWRBB4.js} +29 -31
  117. package/{docUpdateCommands-TJQB4IJ7.js → docUpdateCommands-B2N4E5HQ.js} +38 -37
  118. package/{fetchMessages-7QRCCRYK.js → fetchMessages-CUEFN4GQ.js} +4 -4
  119. package/{getPricing-L2ENXWHV.js → getPricing-P3E2WRIH.js} +5 -5
  120. package/{handleSendMessageAction-T7AS7DDY.js → handleSendMessageAction-RRZ53YYH.js} +29 -29
  121. package/index.js +92 -77
  122. package/{localDialogRead-SLMPV5SK.js → localDialogRead-P7CHFMIC.js} +1 -1
  123. package/{localRuntimeAuthority-E3R24J4T.js → localRuntimeAuthority-S77B5QVB.js} +6 -2
  124. package/{localRuntimeDb-DDZCJFQZ.js → localRuntimeDb-N3H3HQ7G.js} +1 -1
  125. package/{machineCommands-C6CPXZRR.js → machineCommands-CWKMJG33.js} +77 -77
  126. package/{machineInfo-M6KB6HZN.js → machineInfo-66ZFUMLE.js} +1 -1
  127. package/{machineWsRunDispatch-27K2P4OP.js → machineWsRunDispatch-UYNVNX4A.js} +69 -69
  128. package/{models-OX2S5C6Q.js → models-L7S2EKPM.js} +2 -2
  129. package/package.json +1 -1
  130. package/{read-6G73BMEY.js → read-6C2XD3YZ.js} +5 -5
  131. package/{readDocTool-DK4EI2GA.js → readDocTool-Y7AB365O.js} +1 -1
  132. package/{readlineWorkspace-LBWKTPJE.js → readlineWorkspace-VYELP22P.js} +2851 -1515
  133. package/{removeDialogAgentAction-E7H557UO.js → removeDialogAgentAction-KG5WMJRZ.js} +13 -13
  134. package/{runAgentClientLoop-D2T2P36H.js → runAgentClientLoop-35GKZDOZ.js} +62 -61
  135. package/{runtimeDoctorCommands-KIKM6BIO.js → runtimeDoctorCommands-HT4O2PXL.js} +6 -6
  136. package/{setDialogExtraReferencesAction-RMMGBR5F.js → setDialogExtraReferencesAction-O2NLXMSM.js} +10 -10
  137. package/{setPrimaryDialogAgentAction-FWBKKLVA.js → setPrimaryDialogAgentAction-FYYUY7PB.js} +13 -13
  138. package/{settingSlice-73PV4KG4.js → settingSlice-GPLI6E3M.js} +11 -11
  139. package/{skillDiscovery-KLLKXPUO.js → skillDiscovery-COX56OBO.js} +3 -3
  140. package/{slateUtils-VO2FU36K.js → slateUtils-RIZES3PV.js} +1 -1
  141. package/{spaceCommands-B6LO4U5R.js → spaceCommands-AAKQM2PM.js} +223 -37
  142. package/{spaceSlice-VUAEZVDS.js → spaceSlice-NSNGR4Y2.js} +28 -30
  143. package/{streamAgentChatTurn-BBPSFMTZ.js → streamAgentChatTurn-D5IDHXMV.js} +116 -129
  144. package/{switchDialogAgentAction-US6QNL3N.js → switchDialogAgentAction-GH5P6Q3Z.js} +9 -9
  145. package/{chunk-IDAU4UFS.js → syncMapping-N6RGXGBW.js} +11 -11
  146. package/{tableCommands-QE47K72R.js → tableCommands-PQUJ55AS.js} +3 -3
  147. package/{tools-NWA3J7KE.js → tools-JQOETZP5.js} +44 -45
  148. package/{tuiSummaryLlmCaller-KC7JCJBB.js → tuiSummaryLlmCaller-LH7F2SP7.js} +18 -18
  149. package/{updateCommands-AK2RDOFR.js → updateCommands-MNDUIKN7.js} +2 -2
  150. package/{updateDialogTitleAction-TDDQ4J4L.js → updateDialogTitleAction-WOTSDSFQ.js} +31 -33
  151. package/agentRecordCommands-FCQ7ZF6C.js +0 -113
  152. package/chunk-5SBK2MTI.js +0 -528
  153. package/chunk-M3JEW6N6.js +0 -193
  154. package/chunk-OOK2ZT5F.js +0 -1800
  155. package/syncMapping-RK2MANUX.js +0 -43
  156. package/{chunk-KMSZPTM6.js → chunk-2WKUUY2E.js} +3 -3
  157. package/{chunk-CWMSB67P.js → chunk-AGGIDPCZ.js} +0 -0
  158. package/{chunk-SAQQLJZ5.js → chunk-JDSUTNYY.js} +3 -3
@@ -0,0 +1,146 @@
1
+ import {
2
+ mergeAvailabilityDeadline
3
+ } from "./chunk-X2K2JSO4.js";
4
+
5
+ // packages/cli/credentialAvailability.ts
6
+ import { homedir } from "node:os";
7
+ import { join } from "node:path";
8
+ import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
9
+ var FILE_NAME = "credential-availability.json";
10
+ function resolveNoloHome(env = process.env) {
11
+ return env.NOLO_HOME?.trim() || join(homedir(), ".nolo");
12
+ }
13
+ function resolveCredentialAvailabilityPath(env = process.env) {
14
+ return join(resolveNoloHome(env), FILE_NAME);
15
+ }
16
+ function resolveCredentialKey(agent) {
17
+ if (!agent || typeof agent !== "object") return void 0;
18
+ for (const field of ["apiKeyRef", "credentialRef"]) {
19
+ const value = agent[field];
20
+ if (typeof value === "string") {
21
+ const trimmed = value.trim();
22
+ if (trimmed) return trimmed;
23
+ }
24
+ }
25
+ return void 0;
26
+ }
27
+ function parseFile(raw) {
28
+ const parsed = JSON.parse(raw);
29
+ if (!parsed || typeof parsed !== "object") return { entries: {} };
30
+ const entries = parsed.entries;
31
+ if (!entries || typeof entries !== "object") return { entries: {} };
32
+ return { entries };
33
+ }
34
+ async function readCredentialEntries(env = process.env, now = Date.now()) {
35
+ const path = resolveCredentialAvailabilityPath(env);
36
+ let raw;
37
+ try {
38
+ raw = await readFile(path, "utf8");
39
+ } catch {
40
+ return {};
41
+ }
42
+ let file;
43
+ try {
44
+ file = parseFile(raw);
45
+ } catch {
46
+ return {};
47
+ }
48
+ const live = {};
49
+ for (const [key, entry] of Object.entries(file.entries)) {
50
+ const normalized = normalizeEntry(entry);
51
+ if (normalized && normalized.nextAvailableAt > now) {
52
+ live[key] = normalized;
53
+ }
54
+ }
55
+ return live;
56
+ }
57
+ function normalizeEntry(entry) {
58
+ if (typeof entry === "number") {
59
+ return Number.isFinite(entry) ? { nextAvailableAt: entry } : void 0;
60
+ }
61
+ if (!entry || typeof entry !== "object") return void 0;
62
+ const at = entry.nextAvailableAt;
63
+ if (typeof at !== "number" || !Number.isFinite(at)) return void 0;
64
+ if ("lastProbeAt" in entry) {
65
+ const probe = entry.lastProbeAt;
66
+ if (typeof probe !== "number" || !Number.isFinite(probe)) return void 0;
67
+ return { nextAvailableAt: at, lastProbeAt: probe };
68
+ }
69
+ return { nextAvailableAt: at };
70
+ }
71
+ async function readCredentialAvailability(env = process.env, now = Date.now()) {
72
+ const entries = await readCredentialEntries(env, now);
73
+ return Object.fromEntries(
74
+ Object.entries(entries).map(([key, entry]) => [key, entry.nextAvailableAt])
75
+ );
76
+ }
77
+ async function readCredentialEntry(credentialKey, env = process.env, now = Date.now()) {
78
+ if (!credentialKey) return void 0;
79
+ const entries = await readCredentialEntries(env, now);
80
+ return entries[credentialKey];
81
+ }
82
+ async function writeCredentialAvailability(live, env = process.env) {
83
+ const path = resolveCredentialAvailabilityPath(env);
84
+ await mkdir(resolveNoloHome(env), { recursive: true }).catch(() => void 0);
85
+ const file = {
86
+ entries: live
87
+ };
88
+ const tmp = `${path}.tmp-${process.pid}-${Date.now()}`;
89
+ await writeFile(tmp, `${JSON.stringify(file, null, 2)}
90
+ `, "utf8");
91
+ await rename(tmp, path);
92
+ }
93
+ async function markCredentialUnavailable(credentialKey, nextAvailableAt, env = process.env, now = Date.now()) {
94
+ if (!credentialKey) return;
95
+ const live = await readCredentialEntries(env, now);
96
+ const existing = live[credentialKey];
97
+ const merged = mergeAvailabilityDeadline(existing?.nextAvailableAt, nextAvailableAt);
98
+ if (typeof merged !== "number" || !Number.isFinite(merged)) return;
99
+ live[credentialKey] = {
100
+ nextAvailableAt: merged,
101
+ ...existing?.lastProbeAt !== void 0 ? { lastProbeAt: existing.lastProbeAt } : {}
102
+ };
103
+ await writeCredentialAvailability(live, env);
104
+ }
105
+ async function clearCredentialAvailability(credentialKey, env = process.env, now = Date.now()) {
106
+ if (!credentialKey) return;
107
+ const live = await readCredentialEntries(env, now);
108
+ if (!(credentialKey in live)) return;
109
+ delete live[credentialKey];
110
+ await writeCredentialAvailability(live, env);
111
+ }
112
+ async function recordCredentialProbe(credentialKey, env = process.env, now = Date.now()) {
113
+ if (!credentialKey) return;
114
+ const live = await readCredentialEntries(env, now);
115
+ const existing = live[credentialKey];
116
+ if (!existing) return;
117
+ live[credentialKey] = { ...existing, lastProbeAt: now };
118
+ await writeCredentialAvailability(live, env);
119
+ }
120
+ function applyCredentialAvailability(agents, credentialAvailability) {
121
+ if (Object.keys(credentialAvailability).length === 0) return agents;
122
+ return agents.map((agent) => {
123
+ const key = resolveCredentialKey(agent);
124
+ if (!key) return agent;
125
+ const at = credentialAvailability[key];
126
+ if (typeof at !== "number") return agent;
127
+ const merged = mergeAvailabilityDeadline(
128
+ agent.nextAvailableAt,
129
+ at
130
+ );
131
+ if (typeof merged !== "number" || merged === agent.nextAvailableAt) {
132
+ return agent;
133
+ }
134
+ return { ...agent, nextAvailableAt: merged };
135
+ });
136
+ }
137
+
138
+ export {
139
+ resolveCredentialKey,
140
+ readCredentialAvailability,
141
+ readCredentialEntry,
142
+ markCredentialUnavailable,
143
+ clearCredentialAvailability,
144
+ recordCredentialProbe,
145
+ applyCredentialAvailability
146
+ };
@@ -1,6 +1,9 @@
1
+ import {
2
+ clearCliLocalRuntimePreparedAgentCache
3
+ } from "./chunk-YRP7LG4R.js";
1
4
  import {
2
5
  getReadableCliDb
3
- } from "./chunk-NUO3QFWD.js";
6
+ } from "./chunk-UNHKVD2N.js";
4
7
  import {
5
8
  buildCreatedAgentRecord,
6
9
  buildUpdatedAgentRecord,
@@ -9,10 +12,7 @@ import {
9
12
  resolveAgentRecordFromHybridStore,
10
13
  sanitizeAgentRecordForCliOutput,
11
14
  writeAgentRecord
12
- } from "./chunk-YDTYDA5W.js";
13
- import {
14
- clearCliLocalRuntimePreparedAgentCache
15
- } from "./chunk-YBPAQV37.js";
15
+ } from "./chunk-GZRMWK5R.js";
16
16
  import {
17
17
  resolveCliAgentKeyInput
18
18
  } from "./chunk-EKLRRZIN.js";
@@ -94,7 +94,7 @@ async function runAgentUpdateCommand(args, deps = {}) {
94
94
  }
95
95
  if (!parsed) {
96
96
  output.write(
97
- "Usage: nolo agent update <agent> [--model <id>] [--cli-provider <provider>] [--api-source <source>] [--max-concurrent <n>] [--expires-at <iso>] [--prompt <text> | --prompt-file <path> | --prompt-doc <pageKey>] [--tools <json>] [--copy-provider-from <agent>] [--field key=value]\n".replace("[--field key=value]", `[--handle <name>] [--field key=value] (e.g. --field disabledTools='["exa_search"]' to disable default tools)`)
97
+ "Usage: nolo agent update <agent> [--model <id>] [--cli-provider <provider>] [--api-source <source>] [--max-concurrent <n>] [--expires-at <iso>] [--prompt <text> | --prompt-file <path> | --prompt-doc <pageKey>] [--tools <json>] [--copy-provider-from <agent>] [--name <name>] [--custom-provider-url <url>] [--api-key <key>|--provider-api-key <key>] [--field key=value]\n".replace("[--field key=value]", `[--handle <name>] [--field key=value] (e.g. --field disabledTools='["exa_search"]' to disable default tools)`)
98
98
  );
99
99
  return args[0] ? 0 : 1;
100
100
  }
@@ -167,7 +167,7 @@ async function runAgentCreateCommand(args, deps = {}) {
167
167
  }
168
168
  if (!parsed) {
169
169
  output.write(
170
- "Usage: nolo agent create <agent> [--model <id>] [--cli-provider <provider>] [--api-source <source>] [--max-concurrent <n>] [--expires-at <iso>] [--prompt <text> | --prompt-file <path> | --prompt-doc <pageKey>] [--tools <json>] [--copy-provider-from <agent>] [--name <name>] [--custom-provider-url <url>] [--provider-api-key <key>] [--field key=value]\n".replace("[--field key=value]", "[--handle <name>] [--field key=value]")
170
+ "Usage: nolo agent create <agent> [--model <id>] [--cli-provider <provider>] [--api-source <source>] [--max-concurrent <n>] [--expires-at <iso>] [--prompt <text> | --prompt-file <path> | --prompt-doc <pageKey>] [--tools <json>] [--copy-provider-from <agent>] [--name <name>] [--custom-provider-url <url>] [--api-key <key>|--provider-api-key <key>] [--verify] [--field key=value]\n".replace("[--field key=value]", "[--handle <name>] [--field key=value]")
171
171
  );
172
172
  return args[0] ? 0 : 1;
173
173
  }
@@ -210,12 +210,25 @@ async function runAgentCreateCommand(args, deps = {}) {
210
210
  serverOrigin: built.serverUrl
211
211
  });
212
212
  clearCliLocalRuntimePreparedAgentCache();
213
+ let verifyResult;
214
+ if (parsed.verify) {
215
+ const { verifyCustomProvider } = await import("./agentProviderCommands-65ZC2WB4.js");
216
+ const rec = built.nextRecord;
217
+ verifyResult = await verifyCustomProvider({
218
+ providerUrl: rec.customProviderUrl,
219
+ apiKey: rec.apiKey,
220
+ model: rec.model,
221
+ prompt: parsed.verifyPrompt,
222
+ fetchImpl
223
+ });
224
+ }
213
225
  output.write(JSON.stringify({
214
226
  ok: true,
215
227
  agentKey: built.agentKey,
216
228
  baseUrl: built.serverUrl,
217
229
  updates: sanitizeAgentRecordForCliOutput(built.updates),
218
- record: sanitizeAgentRecordForCliOutput(built.nextRecord)
230
+ record: sanitizeAgentRecordForCliOutput(built.nextRecord),
231
+ ...verifyResult ? { verify: verifyResult } : {}
219
232
  }, null, 2));
220
233
  output.write("\n");
221
234
  return 0;
@@ -81,7 +81,7 @@ var MEMORY_USE_GUIDANCE = `--- \u8BB0\u5FC6\u4F7F\u7528\u65B9\u5F0F ---
81
81
  - \u63A8\u65AD\u578B\u8BB0\u5FC6\uFF08inferred\uFF09\u53EA\u7528\u4E8E\u628A\u63E1\u8BED\u6C14\u3001\u72B6\u6001\u548C\u672A\u5B8C\u6210\u4E8B\u9879\uFF0C\u4E0D\u8981\u8BF4\u6210\u201C\u4F60\u660E\u786E\u544A\u8BC9\u8FC7\u6211\u201D\u6216\u5F53\u6210\u7528\u6237\u5DF2\u6388\u6743\u4FDD\u5B58\u7684\u4E8B\u5B9E\u3002\u51B2\u7A81\u6216\u573A\u666F\u4E0D\u660E\u65F6\u8BF4\u660E\u4F9D\u636E\u6216\u7B80\u77ED\u786E\u8BA4\uFF0C\u4E0D\u8981\u786C\u5957\u3002
82
82
  - \u3010\u7F6E\u4FE1\u5EA6\u6765\u6E90\u3011\u6BCF\u6761\u8BB0\u5FC6\u6709\u6765\u6E90\uFF1Averified\uFF08\u5B9E\u6D4B\u9A8C\u8BC1\uFF0C\u9AD8\u7F6E\u4FE1\u5EA6\uFF09\u3001stated\uFF08\u7528\u6237\u9648\u8FF0\uFF0C\u4E2D\u9AD8\uFF09\u3001inferred\uFF08\u6A21\u578B\u63A8\u65AD\uFF0C\u4F4E\u2014\u2014\u5BB9\u6613\u7F16\u9020\uFF0C\u4F18\u5148\u5B58\u7591\uFF09\u3002\u53EC\u56DE\u65F6\u4F18\u5148\u4F7F\u7528 verified/stated\uFF0Cinferred \u9700\u9A8C\u8BC1\u540E\u518D\u91C7\u7EB3\u3002
83
83
  - \u3010\u53EC\u56DE\u89C4\u5219\u3011\u53EC\u56DE\u8BB0\u5FC6\u5FC5\u987B\u5E26\u5B8C\u6574\u5386\u53F2\u4E0A\u4E0B\u6587\uFF08\u6765\u6E90\u3001\u7F6E\u4FE1\u5EA6\u3001\u53D8\u66F4\u8BB0\u5F55\uFF09\uFF0C\u7981\u6B62\u81EA\u884C\u63A8\u7406\u586B\u8865\u3002\u4E0D\u8981\u51ED\u5370\u8C61\u62FC\u51FA\u672A\u9A8C\u8BC1\u7684\u4FE1\u606F\u3002
84
- - \u3010\u964D\u6743/\u5F52\u6863\u3011\u8BB0\u5FC6\u4E0D\u53EF\u7269\u7406\u5220\u9664\uFF0C\u53EA\u80FD\u964D\u6743/\u5F52\u6863\u3002\u9519\u8BEF\u7684\u8BB0\u5FC6\u5E94\u4FEE\u6B63\u5E76\u964D\u4F4E\u7F6E\u4FE1\u5EA6\uFF0C\u800C\u4E0D\u662F\u5220\u9664\u2014\u2014\u4FDD\u7559\u6863\u6848\u4F9B\u5BA1\u8BA1\u3002`;
84
+ - \u3010\u964D\u6743\u4E0E\u5220\u9664\u3011\u65E5\u5E38\u9519\u8BEF\u8BB0\u5FC6\u4F18\u5148\u964D\u6743/\u5F52\u6863\u4E0E\u8986\u76D6\uFF08\u964D\u4F4E\u7F6E\u4FE1\u5EA6\uFF09\uFF0C\u4FDD\u7559\u6863\u6848\u4F9B\u5BA1\u8BA1\uFF1B\u82E5\u7528\u6237\u660E\u786E/\u5F3A\u5236\u8981\u6C42\u5220\u9664\uFF0C\u4E14\u5728\u7528\u6237\u81EA\u8EAB\u6743\u9650\u8303\u56F4\u5185\uFF0C\u5141\u8BB8\u7269\u7406\u5220\u9664\uFF08\u4EC5\u9650\u4E8E\u5F53\u524D\u7528\u6237\u62E5\u6709\u7684\u8BB0\u5FC6\uFF0C\u4E25\u7981\u8D8A\u6743\uFF09\u3002`;
85
85
 
86
86
  export {
87
87
  buildUserResponseLanguageContext,
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  createCliLocalRuntimeAdapter,
3
3
  summarizeEndpoint
4
- } from "./chunk-YBPAQV37.js";
4
+ } from "./chunk-YRP7LG4R.js";
5
5
  import {
6
6
  clipMultilineText
7
- } from "./chunk-MUCM2MZB.js";
7
+ } from "./chunk-6KYCG5GW.js";
8
8
  import {
9
9
  runLocalAgentTurn
10
- } from "./chunk-OOK2ZT5F.js";
10
+ } from "./chunk-LQ6PUHW6.js";
11
11
  import {
12
12
  resolveLocalRuntimeEnvFromPolicy
13
- } from "./chunk-5CS33IBL.js";
13
+ } from "./chunk-NQ4N4IGO.js";
14
14
  import {
15
15
  toErrorMessage
16
16
  } from "./chunk-HNMXYYJR.js";
@@ -30,18 +30,18 @@ import {
30
30
  import {
31
31
  asTrimmedNonEmptyStringArray
32
32
  } from "./chunk-I42VC5KR.js";
33
- import {
34
- asTrimmedString
35
- } from "./chunk-3EUW3WEO.js";
36
- import {
37
- asOptionalPositiveFiniteNumber
38
- } from "./chunk-U6VC4MU4.js";
39
33
  import {
40
34
  ownedAgentKey
41
35
  } from "./chunk-BJIRLHJR.js";
42
36
  import {
43
37
  isRecord
44
38
  } from "./chunk-KUG52IAP.js";
39
+ import {
40
+ asTrimmedString
41
+ } from "./chunk-3EUW3WEO.js";
42
+ import {
43
+ asOptionalPositiveFiniteNumber
44
+ } from "./chunk-U6VC4MU4.js";
45
45
  import {
46
46
  asOptionalTrimmedString
47
47
  } from "./chunk-G3SUCT4W.js";
@@ -3,7 +3,7 @@ import {
3
3
  createFileCredentialBroker,
4
4
  migrateAgentSecrets,
5
5
  normalizeAgentRuntimeToolPolicy
6
- } from "./chunk-5CS33IBL.js";
6
+ } from "./chunk-NQ4N4IGO.js";
7
7
  import {
8
8
  asRecordOrEmpty
9
9
  } from "./chunk-KX6YBIHG.js";
@@ -11,16 +11,16 @@ import {
11
11
  patch,
12
12
  remove,
13
13
  write
14
- } from "./chunk-57QJXIB6.js";
14
+ } from "./chunk-23KKIMD5.js";
15
15
  import {
16
16
  createAgentKey,
17
17
  toTrimmedString
18
- } from "./chunk-KMSZPTM6.js";
18
+ } from "./chunk-2WKUUY2E.js";
19
19
  import {
20
20
  asyncThunkCreator,
21
21
  buildCreateSlice,
22
22
  getRuntimeServerContext
23
- } from "./chunk-X664KVEV.js";
23
+ } from "./chunk-HHBXCRJS.js";
24
24
  import {
25
25
  asTrimmedString
26
26
  } from "./chunk-3EUW3WEO.js";
@@ -304,7 +304,7 @@ var slice = createSliceWithThunks({
304
304
  const overrides = {};
305
305
  if (args.systemPromptOverride !== void 0) overrides.prompt = args.systemPromptOverride;
306
306
  if (args.toolsOverride !== void 0) overrides.tools = args.toolsOverride;
307
- const { _executeModel } = await import("./_executeModel-RI6DRQTP.js");
307
+ const { _executeModel } = await import("./_executeModel-BUYCXZCQ.js");
308
308
  return _executeModel(
309
309
  {
310
310
  isStreaming: args.isStreaming ?? false,
@@ -325,7 +325,7 @@ var slice = createSliceWithThunks({
325
325
  * - 循环直到无工具调用或触发其他运行时停止条件
326
326
  */
327
327
  runAgent: create.asyncThunk(async (args, thunkApi) => {
328
- const { runAgentClientLoop } = await import("./runAgentClientLoop-D2T2P36H.js");
328
+ const { runAgentClientLoop } = await import("./runAgentClientLoop-35GKZDOZ.js");
329
329
  const { content: loopContent, toolCallCount } = await runAgentClientLoop(
330
330
  {
331
331
  agentKey: args.agentKey,
@@ -341,7 +341,7 @@ var slice = createSliceWithThunks({
341
341
  * 聊天轮次流式 Agent 调用
342
342
  */
343
343
  streamAgentChatTurn: create.asyncThunk(async (args, thunkApi) => {
344
- const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-BBPSFMTZ.js");
344
+ const { streamAgentChatTurnHandler } = await import("./streamAgentChatTurn-D5IDHXMV.js");
345
345
  return streamAgentChatTurnHandler(args, thunkApi);
346
346
  }),
347
347
  /**
@@ -1,30 +1,30 @@
1
1
  import {
2
2
  parsePositiveFiniteNumberOrFallback
3
3
  } from "./chunk-Y5GCAMGP.js";
4
- import {
5
- asRecordOrEmpty
6
- } from "./chunk-KX6YBIHG.js";
7
4
  import {
8
5
  DEFAULT_SYSTEM_AGENT_CAPABILITIES
9
6
  } from "./chunk-UZ6XXCVR.js";
7
+ import {
8
+ asRecordOrEmpty
9
+ } from "./chunk-KX6YBIHG.js";
10
10
  import {
11
11
  patch,
12
12
  readAndWait,
13
13
  toTimestampMs,
14
14
  upsert,
15
15
  write
16
- } from "./chunk-57QJXIB6.js";
16
+ } from "./chunk-23KKIMD5.js";
17
17
  import {
18
18
  createUserKey,
19
19
  createUserPreferenceKey,
20
20
  ulid
21
- } from "./chunk-KMSZPTM6.js";
21
+ } from "./chunk-2WKUUY2E.js";
22
22
  import {
23
23
  asTrimmedLowercaseString
24
24
  } from "./chunk-QSJ3HFEF.js";
25
25
  import {
26
26
  BUILTIN_NOLO_AGENT_KEY
27
- } from "./chunk-UK5JGQVU.js";
27
+ } from "./chunk-XT73C4VH.js";
28
28
  import {
29
29
  asyncThunkCreator,
30
30
  buildCreateSlice,
@@ -32,12 +32,12 @@ import {
32
32
  createAsyncThunk,
33
33
  createSelector,
34
34
  selectIdentityUserId
35
- } from "./chunk-X664KVEV.js";
35
+ } from "./chunk-HHBXCRJS.js";
36
36
  import {
37
37
  getAllServers,
38
38
  getIsDesktopApp,
39
39
  isProduction
40
- } from "./chunk-WJSW43QZ.js";
40
+ } from "./chunk-L3JWI7WX.js";
41
41
  import {
42
42
  SERVERS
43
43
  } from "./chunk-LCBAMY2M.js";
@@ -27,14 +27,20 @@ var STREAM_USAGE_PROVIDERS = /* @__PURE__ */ new Set([
27
27
  // DeepSeek official and Ollama honor stream_options.include_usage on their
28
28
  // chat.completions endpoints. Without them, locally-configured agents lose
29
29
  // token statistics / local billing (the whitelist replaced the previous
30
- // always-on include_usage).
30
+ // always-on include_usage). ollama-cloud is the Ollama Cloud subscription
31
+ // endpoint (https://ollama.com/v1), an OpenAI-compatible API that likewise
32
+ // honors stream_options.include_usage.
31
33
  "deepseek",
32
34
  "ollama",
33
- // Platform Kimi K3 remap (provider=nolo + kimi-k3) routes to crof.ai, an
35
+ "ollama-cloud",
34
36
  // OpenAI-compatible /v1/chat/completions endpoint; the hosted branch passes
35
- // "crof" as the usage provider so K3 streams request the terminal usage
37
+ // "upstream-k3" as the usage provider so K3 streams request the terminal usage
36
38
  // chunk (same capability decision as deepinfra/vultr).
37
- "crof"
39
+ "upstream-k3",
40
+ // RunInfra hosted fallback channel: OpenAI-compatible chat.completions
41
+ // endpoint, supports stream_options.include_usage (measured to return
42
+ // prompt_tokens_details.cached_tokens).
43
+ "runinfra"
38
44
  ]);
39
45
  var EXTRA_USAGE_FIELD_PROVIDERS = /* @__PURE__ */ new Set(["openrouter"]);
40
46
  var normalizeProviderName = (providerName) => asTrimmedLowercaseString(providerName);