nolo-cli 0.11.0 → 0.12.0-alpha.2

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 (123) hide show
  1. package/{_executeModel-ZEDPX6OF.js → _executeModel-K23VU36L.js} +51 -50
  2. package/{action-AA4IJ5K2.js → action-RAXNQQKC.js} +8 -9
  3. package/{addContentAction-QYVO4SYP.js → addContentAction-ZHI7TVV3.js} +7 -9
  4. package/{addDialogAgentAction-WVVKT5WQ.js → addDialogAgentAction-JWXPKXNC.js} +9 -10
  5. package/{agentDeleteCommand-RDPGYIWF.js → agentDeleteCommand-MWB2LXG6.js} +38 -28
  6. package/{agentEmailCommands-2HJJKS5F.js → agentEmailCommands-7IBTXHNQ.js} +64 -62
  7. package/{agentListCommands-HFEVV3ZW.js → agentListCommands-SKUYB2RQ.js} +127 -31
  8. package/{agentMachineCommands-25ZOENJU.js → agentMachineCommands-5ZM2DB3X.js} +37 -26
  9. package/{agentPullCommand-GOL2S4W2.js → agentPullCommand-KRBRIFIY.js} +7 -7
  10. package/{agentRecordCommands-GTCOAM3L.js → agentRecordCommands-5IVBEJLP.js} +56 -54
  11. package/{agentRunCommand-YBS3JDLD.js → agentRunCommand-UCAEMXQF.js} +59 -59
  12. package/{agentRunControl-K4VKNEHF.js → agentRunControl-IX4F5W2C.js} +3 -3
  13. package/{agentRuntimeLocal-UQBMQI2M.js → agentRuntimeLocal-PR67XWQK.js} +30 -15
  14. package/{agentSlice-6EKOBCCS.js → agentSlice-LWIPUATN.js} +8 -9
  15. package/{authCommand-O2OWACN4.js → authCommand-DMW336GT.js} +15 -15
  16. package/{authCommands-H7365TZP.js → authCommands-GH5T6RYV.js} +6 -6
  17. package/{chunk-7D3JY6C2.js → chunk-3HHTVM6G.js} +64 -5
  18. package/{chunk-KJR5KAUQ.js → chunk-3LVXNJON.js} +20 -7
  19. package/{chunk-AFON4QUU.js → chunk-45JUQTYY.js} +19 -11
  20. package/{chunk-KQQVGRA3.js → chunk-47TVQ7LF.js} +35 -29
  21. package/{chunk-FXXSGWAJ.js → chunk-4GBNEA5B.js} +1 -1
  22. package/{chunk-PXZAAB4L.js → chunk-4LG74DRG.js} +4 -4
  23. package/{chunk-2FTTDCD4.js → chunk-4ON5AV72.js} +2 -1
  24. package/{chunk-IWX4UW2E.js → chunk-524BDL33.js} +89 -8
  25. package/{chunk-4SOKXIW4.js → chunk-5DVIMRVT.js} +8 -11
  26. package/{chunk-ISNCLGUZ.js → chunk-5NBHQD4D.js} +4 -3
  27. package/{chunk-NEM67FX7.js → chunk-672VQUVH.js} +1 -1
  28. package/{chunk-2W2VYVI5.js → chunk-6EFMBEQG.js} +528 -177
  29. package/{chunk-GBDSZATH.js → chunk-6LMFFG3K.js} +3 -3
  30. package/{chunk-CKOJQDKR.js → chunk-7JJCGV7N.js} +146 -3
  31. package/{chunk-MQI77IRB.js → chunk-7MYHLZ3F.js} +2 -2
  32. package/chunk-BYXBJQAS.js +0 -0
  33. package/{chunk-LAX2JSTX.js → chunk-CJIOTRWY.js} +20 -2
  34. package/{chunk-ZEYDOXHF.js → chunk-ESR6LPO5.js} +1467 -868
  35. package/{chunk-EVZKZF32.js → chunk-F22FKI27.js} +182 -75
  36. package/{chunk-OUI3ZHYD.js → chunk-FHTPQXHP.js} +1 -1
  37. package/{chunk-5MOUAAMK.js → chunk-FVGPOJYM.js} +194 -2580
  38. package/{chunk-AEZAORLG.js → chunk-FW4SQ6II.js} +5 -5
  39. package/chunk-IKXL2HZ3.js +70 -0
  40. package/{chunk-QNMFBBZK.js → chunk-IVAOVLM7.js} +1 -1
  41. package/{chunk-S3GS2PRL.js → chunk-JCU2JDCV.js} +597 -68
  42. package/{chunk-Q3UKJVU4.js → chunk-JJR3NP7R.js} +10 -10
  43. package/{chunk-PXQN7IBQ.js → chunk-JNMELOHI.js} +2 -2
  44. package/{chunk-XYZA7S7V.js → chunk-LNTQ7UXG.js} +6 -6
  45. package/{chunk-YOCHZD7D.js → chunk-NCGFB7NN.js} +5 -3
  46. package/{chunk-O26GI2JP.js → chunk-NITP2JDG.js} +39 -8
  47. package/{chunk-YPRZSPF3.js → chunk-OCDEWRE2.js} +1 -1
  48. package/{chunk-PNEW2Z3T.js → chunk-OHEKYYJF.js} +7 -7
  49. package/{chunk-DWGAEFJL.js → chunk-OILEWBXT.js} +1 -1
  50. package/chunk-OOIN7HSO.js +146 -0
  51. package/{chunk-C4FTUXVF.js → chunk-QLUFR47U.js} +11 -1
  52. package/{chunk-BX6U3ETE.js → chunk-RNYKVIND.js} +293 -89
  53. package/{chunk-L53FGHA4.js → chunk-RSEUHW6T.js} +1 -1
  54. package/chunk-S3UTETIC.js +4885 -0
  55. package/chunk-S73OEOHH.js +2286 -0
  56. package/{chunk-E4HNJSHC.js → chunk-TEOXBCYU.js} +81 -19
  57. package/{chunk-YTBMA7NO.js → chunk-TSKWE74T.js} +58 -8
  58. package/{chunk-5OIFWVX7.js → chunk-UG3WOFU6.js} +1 -1
  59. package/{chunk-LP65VRCI.js → chunk-UJ5L6X7H.js} +6 -6
  60. package/{chunk-4ZDM73SD.js → chunk-V2J635L5.js} +1 -1
  61. package/{chunk-IPYUUY4E.js → chunk-WPHL6ALY.js} +1 -1
  62. package/{chunk-3NSIQZZ6.js → chunk-WTYKCU4W.js} +9 -9
  63. package/{chunk-XFOLQLDN.js → chunk-XHQWJUW4.js} +2 -2
  64. package/{chunk-TACHTH5D.js → chunk-XJFP4EXZ.js} +18 -18
  65. package/{chunk-C2MDQQ4O.js → chunk-XRFEX5ZP.js} +1 -1
  66. package/{chunk-D6OQHXVG.js → chunk-YDCZVUFP.js} +7 -7
  67. package/{chunk-SV5MWASH.js → chunk-Z6ZZXQOZ.js} +12 -12
  68. package/{chunk-X2S7JTIG.js → chunk-ZR4RO4ZC.js} +1240 -136
  69. package/{chunk-ZPRK73XY.js → chunk-ZR4VHQ5D.js} +14 -13
  70. package/cliEnvHelpers-VYC2OPTB.js +30 -0
  71. package/{createAgentAutomationAction-LTI5QU35.js → createAgentAutomationAction-PJTUHFYB.js} +25 -26
  72. package/{createDialogAction-OJJ7L3L3.js → createDialogAction-QUCXTRAC.js} +26 -27
  73. package/{createPageAction-5MXWVRGY.js → createPageAction-2EWMGYFH.js} +26 -27
  74. package/{dbSlice-RQFQQVHT.js → dbSlice-WDP2ZZHK.js} +6 -7
  75. package/{deleteFile-7XP5BGC7.js → deleteFile-M7UNIUOO.js} +4 -4
  76. package/{dialogCommands-JTJ3RPPW.js → dialogCommands-BTHTTSE2.js} +33 -23
  77. package/{dialogSlice-OWROKURJ.js → dialogSlice-724QVE7A.js} +26 -27
  78. package/{docCreateCommands-WJBEW2V7.js → docCreateCommands-PQEX44Q7.js} +33 -23
  79. package/{docDeleteCommands-BVEHJOY5.js → docDeleteCommands-B3Q2M42N.js} +34 -25
  80. package/{docReadCommands-NEWOZIJV.js → docReadCommands-RCUVTX3Q.js} +33 -23
  81. package/{docStore-3DXRYBMD.js → docStore-R3US5ZU5.js} +25 -26
  82. package/{docUpdateCommands-C7WHT7UU.js → docUpdateCommands-NS5QAUAJ.js} +33 -23
  83. package/fetchMessages-KTNM7QAR.js +1 -1
  84. package/{getPricing-3E6UNPKL.js → getPricing-6TOZXPAU.js} +7 -3
  85. package/{handleSendMessageAction-B5PRR7BE.js → handleSendMessageAction-NTK7QUU2.js} +29 -30
  86. package/index.js +77 -76
  87. package/{localDialogRead-YSKFFRTT.js → localDialogRead-2VRI24F4.js} +1 -1
  88. package/{machineCommands-IIIREAEK.js → machineCommands-XOU6Q7Y2.js} +63 -61
  89. package/{machineWsRunDispatch-3SIU6ILW.js → machineWsRunDispatch-QRI3MSNV.js} +55 -53
  90. package/{memoryCommands-O4MIPIWQ.js → memoryCommands-AFMES3LN.js} +5 -5
  91. package/{models-4OPOOLFS.js → models-LSCRJJ6P.js} +2 -2
  92. package/package.json +1 -1
  93. package/{read-QJNKRROM.js → read-2MIMRBZ2.js} +4 -4
  94. package/{readDocTool-H6X6KO6X.js → readDocTool-QHVGQHUJ.js} +1 -1
  95. package/{readlineWorkspace-HGP3I3OC.js → readlineWorkspace-3MDU7AYQ.js} +1113 -678
  96. package/{removeDialogAgentAction-TCT35SOF.js → removeDialogAgentAction-GTX5AN54.js} +13 -13
  97. package/{runAgentClientLoop-EFM4PTVI.js → runAgentClientLoop-ZIQQIOUB.js} +47 -47
  98. package/{runtimeDoctorCommands-ID43Z7VX.js → runtimeDoctorCommands-QNF3J3UV.js} +6 -6
  99. package/{setDialogExtraReferencesAction-CGYLZMFH.js → setDialogExtraReferencesAction-WFQ63KYO.js} +9 -10
  100. package/{setPrimaryDialogAgentAction-F6BFQDJU.js → setPrimaryDialogAgentAction-P57FXTSU.js} +13 -13
  101. package/{settingSlice-2I5HMG47.js → settingSlice-CK5YZGNI.js} +7 -8
  102. package/{skillDiscovery-UGSQGX2U.js → skillDiscovery-SZEA7TH6.js} +3 -3
  103. package/{spaceCommands-MT7BWCIL.js → spaceCommands-VTJYPRFQ.js} +37 -29
  104. package/{spaceSlice-BS5TSW3W.js → spaceSlice-DX7Y4RUE.js} +28 -27
  105. package/{streamAgentChatTurn-I3VBFNR3.js → streamAgentChatTurn-7OF2I3KI.js} +222 -128
  106. package/{toolApiClient-C7P7YSE4.js → toolApiClient-QI3YBNWB.js} +2 -2
  107. package/{tools-XSD2BOEN.js → tools-4IILQ24N.js} +34 -34
  108. package/{tuiSummaryLlmCaller-32NRHTT2.js → tuiSummaryLlmCaller-TXLF4MEI.js} +8 -6
  109. package/{updateCommands-VOSPKXFF.js → updateCommands-XZDOOYFH.js} +13 -5
  110. package/{updateDialogTitleAction-7FYNJOGP.js → updateDialogTitleAction-GNQXACIP.js} +29 -29
  111. package/chunk-5MMAK75Q.js +0 -15
  112. package/chunk-AZPCASRE.js +0 -36
  113. package/chunk-BBYVOSU2.js +0 -792
  114. package/chunk-DCOA4QSN.js +0 -105
  115. package/chunk-UAD2WT54.js +0 -64
  116. package/{chunk-JK7VW2FN.js → chunk-5MIDPSSK.js} +3 -3
  117. package/{chunk-5CS33IBL.js → chunk-PDL2AV3E.js} +3 -3
  118. package/{chunk-5MMZUWSG.js → chunk-TOILAPLH.js} +5 -5
  119. package/{chunk-OOM6SJNR.js → chunk-TSUJOM6N.js} +6 -6
  120. package/{db-6QED3ZVO.js → db-HCJ5PRB5.js} +3 -3
  121. package/{offlineMarxistsAgentCommand-BCPJITJL.js → offlineMarxistsAgentCommand-5OOWZLJI.js} +3 -3
  122. package/{tableCommands-M3DJUETS.js → tableCommands-E4SQWDOX.js} +6 -6
  123. package/{understanding-ZOESBLF3.js → understanding-3CUQQ6SV.js} +3 -3
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  selectCurrentServer
3
- } from "./chunk-3NSIQZZ6.js";
3
+ } from "./chunk-WTYKCU4W.js";
4
4
  import {
5
5
  patch
6
- } from "./chunk-O26GI2JP.js";
6
+ } from "./chunk-NITP2JDG.js";
7
7
  import {
8
8
  selectIdentityToken
9
- } from "./chunk-OOM6SJNR.js";
9
+ } from "./chunk-TSUJOM6N.js";
10
10
  import {
11
11
  getIsDesktopApp
12
12
  } from "./chunk-OOSFSFMA.js";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-IDZTNRP2.js";
7
7
  import {
8
8
  isCompiledBinary
9
- } from "./chunk-ISNCLGUZ.js";
9
+ } from "./chunk-5NBHQD4D.js";
10
10
  import {
11
11
  DEFAULT_NOLO_SERVER_URL
12
12
  } from "./chunk-OLZBQWZU.js";
@@ -15,7 +15,8 @@ import {
15
15
  } from "./chunk-CF7PE763.js";
16
16
 
17
17
  // packages/cli/updateCommands.ts
18
- import { existsSync, readFileSync } from "node:fs";
18
+ import { existsSync, readFileSync, accessSync, constants } from "node:fs";
19
+ import { homedir } from "node:os";
19
20
  import { dirname, join } from "node:path";
20
21
  import { fileURLToPath } from "node:url";
21
22
  function resolvePackageJsonPath() {
@@ -58,6 +59,39 @@ function renderProgressBar(percent, width = 30) {
58
59
  function buildNpmSelfUpdateCommand(channel = "latest") {
59
60
  return ["npm", "install", "-g", `nolo-cli@${channel}`, "--force", "--progress"];
60
61
  }
62
+ function resolveStandaloneBundlePlatform(platform = process.platform, arch = process.arch) {
63
+ if (platform === "linux" && arch === "x64") {
64
+ return { tarballName: "nolo-linux-x64.tar.gz", extractSubdir: "nolo-linux-x64" };
65
+ }
66
+ if (platform === "darwin" && arch === "arm64") {
67
+ return { tarballName: "nolo-darwin-arm64.tar.gz", extractSubdir: "nolo-darwin-arm64" };
68
+ }
69
+ return null;
70
+ }
71
+ function resolveStandaloneBundleRepoBase(channel) {
72
+ return channel === "alpha" ? "https://us.nolo.chat" : "https://nolo.chat";
73
+ }
74
+ function buildStandaloneManualUpdateHint(channel) {
75
+ const repoBase = resolveStandaloneBundleRepoBase(channel);
76
+ return `curl -fsSL ${repoBase}/install-nolo.sh | sh`;
77
+ }
78
+ function resolveStandaloneInstallDir() {
79
+ const candidates = [
80
+ "/usr/local/bin",
81
+ join(homedir(), ".local/bin"),
82
+ join(homedir(), ".nolo/bin")
83
+ ];
84
+ for (const dir of candidates) {
85
+ if (!existsSync(dir)) continue;
86
+ try {
87
+ accessSync(dir, constants.W_OK);
88
+ return dir;
89
+ } catch {
90
+ continue;
91
+ }
92
+ }
93
+ return join(homedir(), ".nolo/bin");
94
+ }
61
95
  function readPackageInfo() {
62
96
  if (PACKAGE_JSON_PATH) {
63
97
  try {
@@ -111,7 +145,7 @@ function buildCliDoctorText(info) {
111
145
  "If direct `nolo` differs from repo-local `bun ./packages/cli/index.ts`,",
112
146
  "the global install is older than this checkout.",
113
147
  "",
114
- `Manual update: ${buildNpmSelfUpdateCommand(info.updateChannel).join(" ")}`
148
+ `Manual update: ${info.installKind === "standalone-bundle" ? buildStandaloneManualUpdateHint(info.updateChannel) : buildNpmSelfUpdateCommand(info.updateChannel).join(" ")}`
115
149
  ].join("\n");
116
150
  }
117
151
  function isRunSelfUpdateOptions(value) {
@@ -134,8 +168,113 @@ function normalizeSpawnChunk(chunk) {
134
168
  }
135
169
  return new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);
136
170
  }
171
+ async function runShellScript(script, {
172
+ output,
173
+ spawn,
174
+ env,
175
+ cwd,
176
+ useCustomSink
177
+ }) {
178
+ const proc = spawn({
179
+ cmd: ["sh", "-c", script],
180
+ cwd,
181
+ stdin: "inherit",
182
+ stdout: useCustomSink ? "pipe" : "inherit",
183
+ stderr: useCustomSink ? "pipe" : "inherit",
184
+ env
185
+ });
186
+ if (!useCustomSink) {
187
+ return proc.exited;
188
+ }
189
+ const [exitCode] = await Promise.all([
190
+ proc.exited,
191
+ forwardSpawnOutput(proc.stdout, output),
192
+ forwardSpawnOutput(proc.stderr, output)
193
+ ]);
194
+ return exitCode;
195
+ }
196
+ async function runStandaloneBundleUpdate(options) {
197
+ const output = options.output ?? process.stdout;
198
+ const spawn = options.spawn ?? resolveDefaultSpawn();
199
+ const env = options.env ?? process.env;
200
+ const serverUrl = resolveSelfUpdateServerUrl(env, options.serverUrl);
201
+ const channel = getCliInstallChannel(serverUrl);
202
+ const platform = resolveStandaloneBundlePlatform();
203
+ if (!platform) {
204
+ output.write(
205
+ `\u2717 Standalone-bundle self-update is not supported on this platform
206
+ (platform=${process.platform}, arch=${process.arch}).
207
+ Only linux-x64 and darwin-arm64 bundles are published.
208
+ Falling back is not possible from a compiled binary; reinstall via:
209
+ ${buildStandaloneManualUpdateHint(channel)}
210
+ `
211
+ );
212
+ return 1;
213
+ }
214
+ const { tarballName, extractSubdir } = platform;
215
+ const repoBase = resolveStandaloneBundleRepoBase(channel);
216
+ const tarballUrl = `${repoBase}/public/downloads/${tarballName}`;
217
+ const fallbackUrl = `https://nolo.chat/public/downloads/${tarballName}`;
218
+ const extractDir = join(homedir(), ".nolo", extractSubdir);
219
+ const installDir = resolveStandaloneInstallDir();
220
+ const symlinkPath = join(installDir, "nolo");
221
+ const script = `set -euo pipefail
222
+ TEMP_DIR=$(mktemp -d)
223
+ trap 'rm -rf "$TEMP_DIR"' EXIT
224
+
225
+ echo "Downloading nolo from ${tarballUrl}..."
226
+ if ! curl -fL --progress-bar "${tarballUrl}" -o "$TEMP_DIR/${tarballName}"; then
227
+ ${tarballUrl !== fallbackUrl ? `echo "Primary source unavailable, trying ${fallbackUrl}..."
228
+ if ! curl -fL --progress-bar "${fallbackUrl}" -o "$TEMP_DIR/${tarballName}"; then
229
+ echo "Error: download failed from ${fallbackUrl}" >&2
230
+ exit 1
231
+ fi` : `echo "Error: download failed from ${tarballUrl}" >&2
232
+ exit 1`}
233
+ fi
234
+
235
+ mkdir -p "${extractDir}"
236
+ tar -xzf "$TEMP_DIR/${tarballName}" -C "${extractDir}"
237
+ chmod +x "${extractDir}/nolo"
238
+
239
+ mkdir -p "${installDir}"
240
+ if [ -e "${symlinkPath}" ] || [ -L "${symlinkPath}" ]; then
241
+ rm -f "${symlinkPath}"
242
+ fi
243
+ ln -s "${extractDir}/nolo" "${symlinkPath}"
244
+ trap - EXIT
245
+
246
+ echo "nolo updated to ${installDir}/nolo"
247
+ `;
248
+ output.write(`
249
+ Nolo Agent CLI Installer & Updater
250
+ `);
251
+ output.write(`-----------------------------------------
252
+ `);
253
+ output.write(`\u2713 Target channel: ${channel} (standalone bundle)
254
+ `);
255
+ output.write(`\u25B8 Downloading and installing bundle...
256
+ `);
257
+ const useCustomSink = options.output !== void 0;
258
+ const exitCode = await runShellScript(script, {
259
+ output,
260
+ spawn,
261
+ env,
262
+ useCustomSink
263
+ });
264
+ if (exitCode === 0) {
265
+ output.write(` ${renderProgressBar(100)}
266
+ `);
267
+ output.write(`\u2713 Update completed successfully!
268
+
269
+ `);
270
+ }
271
+ return exitCode;
272
+ }
137
273
  async function runSelfUpdate(outputOrOptions) {
138
274
  const options = outputOrOptions === void 0 ? {} : isRunSelfUpdateOptions(outputOrOptions) ? outputOrOptions : { output: outputOrOptions };
275
+ if (isCompiledBinary()) {
276
+ return runStandaloneBundleUpdate(options);
277
+ }
139
278
  const output = options.output ?? process.stdout;
140
279
  const spawn = options.spawn ?? resolveDefaultSpawn();
141
280
  const env = options.env ?? process.env;
@@ -189,10 +328,14 @@ export {
189
328
  getCliInstallChannel,
190
329
  renderProgressBar,
191
330
  buildNpmSelfUpdateCommand,
331
+ resolveStandaloneBundlePlatform,
332
+ resolveStandaloneBundleRepoBase,
333
+ buildStandaloneManualUpdateHint,
192
334
  readPackageInfo,
193
335
  buildCliVersionText,
194
336
  buildSelfUpdateCommand,
195
337
  resolveSelfUpdateServerUrl,
196
338
  buildCliDoctorText,
339
+ runStandaloneBundleUpdate,
197
340
  runSelfUpdate
198
341
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  selectCurrentServer,
3
3
  selectRemoteServers
4
- } from "./chunk-3NSIQZZ6.js";
4
+ } from "./chunk-WTYKCU4W.js";
5
5
  import {
6
6
  createUserKey,
7
7
  extractAgentInfo,
@@ -16,7 +16,7 @@ import {
16
16
  noloWriteRequest,
17
17
  selectIdentityUser,
18
18
  selectIdentityUserId
19
- } from "./chunk-OOM6SJNR.js";
19
+ } from "./chunk-TSUJOM6N.js";
20
20
  import {
21
21
  normalizeTimeFields
22
22
  } from "./chunk-OOSFSFMA.js";
File without changes
@@ -1,10 +1,13 @@
1
1
  import {
2
2
  listUserRecordsFromServers,
3
3
  readLiveDbRecordAfterTombstoneMerge
4
- } from "./chunk-DWGAEFJL.js";
4
+ } from "./chunk-OILEWBXT.js";
5
5
  import {
6
6
  agentRecordHasConfiguredCredential
7
- } from "./chunk-AEZAORLG.js";
7
+ } from "./chunk-FW4SQ6II.js";
8
+ import {
9
+ toSafeAgentSummary
10
+ } from "./chunk-OOIN7HSO.js";
8
11
 
9
12
  // packages/cli/agentListHelpers.ts
10
13
  function parseAgentRecordId(privateKey, explicitId) {
@@ -34,6 +37,11 @@ function normalizeListedAgent(record) {
34
37
  publicKey: keys.publicKey,
35
38
  name: typeof record?.name === "string" && record.name ? record.name : "(unnamed)",
36
39
  model: typeof record?.model === "string" && record.model ? record.model : "-",
40
+ ...typeof record?.handle === "string" && record.handle ? { handle: record.handle } : {},
41
+ ...typeof record?.introduction === "string" && record.introduction ? { introduction: record.introduction } : typeof record?.description === "string" && record.description ? { introduction: record.description } : {},
42
+ ...typeof record?.provider === "string" && record.provider ? { provider: record.provider } : {},
43
+ ...typeof record?.inputPrice === "number" && Number.isFinite(record.inputPrice) ? { inputPrice: record.inputPrice } : {},
44
+ ...typeof record?.outputPrice === "number" && Number.isFinite(record.outputPrice) ? { outputPrice: record.outputPrice } : {},
37
45
  updatedAt: typeof record?.updatedAt === "string" || typeof record?.updatedAt === "number" ? record.updatedAt : typeof record?.createdAt === "string" || typeof record?.createdAt === "number" ? record.createdAt : typeof record?.created === "string" || typeof record?.created === "number" ? record.created : null,
38
46
  isPublicFlag: !!record?.isPublic,
39
47
  publicRecordExists: false,
@@ -46,6 +54,13 @@ function normalizeListedAgent(record) {
46
54
  ...typeof record?.cliProvider === "string" && record.cliProvider ? { cliProvider: record.cliProvider } : {}
47
55
  };
48
56
  }
57
+ function toSafeListedAgentSummary(agent, options) {
58
+ const summary = toSafeAgentSummary(agent, options);
59
+ if (agent.publicRecordExists === false) {
60
+ delete summary.publicKey;
61
+ }
62
+ return summary;
63
+ }
49
64
  function sortListedAgents(agents) {
50
65
  agents.sort((a, b) => {
51
66
  const ta = a.updatedAt == null ? 0 : new Date(a.updatedAt).getTime();
@@ -57,6 +72,7 @@ function sortListedAgents(agents) {
57
72
  function parseAgentListArgs(args) {
58
73
  return {
59
74
  wantJson: args.includes("--json"),
75
+ wantSafe: args.includes("--safe"),
60
76
  publicOnly: args.includes("--public-only"),
61
77
  idsOnly: args.includes("--ids-only")
62
78
  };
@@ -182,6 +198,8 @@ async function decorateAgentsWithPublicStatusAcrossServers(args) {
182
198
  }
183
199
 
184
200
  export {
201
+ normalizeListedAgent,
202
+ toSafeListedAgentSummary,
185
203
  parseAgentListArgs,
186
204
  listLocalCachedAgents,
187
205
  listRemoteAgents,