nolo-cli 0.35.0-alpha.1 → 0.36.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 (57) hide show
  1. package/{_executeModel-RV52PPE3.js → _executeModel-2S6HNTBF.js} +11 -11
  2. package/{agentDeleteCommand-FBBW3IIM.js → agentDeleteCommand-EJ6RRIGV.js} +2 -2
  3. package/{agentEmailCommands-7F4PCABZ.js → agentEmailCommands-APU6G6PK.js} +11 -11
  4. package/{agentListCommands-ZQXPSB6U.js → agentListCommands-HSWVSDLI.js} +2 -2
  5. package/{agentMachineCommands-E3NB67GM.js → agentMachineCommands-G7JQUUDC.js} +3 -3
  6. package/{agentRecordCommands-7PXWHCQM.js → agentRecordCommands-PUFDQBQ5.js} +11 -11
  7. package/{agentRunCommand-Z4654ONK.js → agentRunCommand-AS4N52UF.js} +11 -11
  8. package/{agentRuntimeLocal-OBKWKEKW.js → agentRuntimeLocal-GTNYV7LH.js} +2 -2
  9. package/{agentSlice-B2IMSPH5.js → agentSlice-LAILHBMM.js} +1 -1
  10. package/{appDeleteCommands-72BE7DSA.js → appDeleteCommands-YDXSR75I.js} +2 -2
  11. package/{appDeployCommands-XJBLKCYO.js → appDeployCommands-4X5SN3EF.js} +2 -2
  12. package/{appDeployStatusCommands-EC4HWCBQ.js → appDeployStatusCommands-TK3JKBHH.js} +2 -2
  13. package/{appGetCommands-62BAATPL.js → appGetCommands-ZKQHHJYB.js} +2 -2
  14. package/{appListCommands-5EZCONM7.js → appListCommands-JRDOEEGV.js} +2 -2
  15. package/{chatQueueReduxAdapter-SSF3DNBX.js → chatQueueReduxAdapter-DQWFZYNL.js} +2 -2
  16. package/{chunk-ZOEE4OVX.js → chunk-2BKJBSQ4.js} +9 -5
  17. package/{chunk-Z7D7MBWR.js → chunk-3SNGK3FB.js} +1 -1
  18. package/{chunk-7KY6U7MW.js → chunk-ARFXKWJH.js} +8 -8
  19. package/{chunk-55C3UZSC.js → chunk-CVXDBLYH.js} +3 -3
  20. package/{chunk-OCJNJUR4.js → chunk-D72M3G32.js} +2 -2
  21. package/{chunk-KPJYUEPE.js → chunk-EJAL5LSG.js} +1 -1
  22. package/{chunk-RUVWTAK7.js → chunk-FXZBSLFK.js} +4 -4
  23. package/{chunk-LFOILL6R.js → chunk-HRSIJO5A.js} +1 -1
  24. package/{chunk-5Q4DXT47.js → chunk-JK7UM3LT.js} +9 -9
  25. package/{chunk-INXNBCEY.js → chunk-KR74XLMV.js} +2 -2
  26. package/{chunk-EFN2AFWF.js → chunk-LBZHTQTD.js} +164 -10
  27. package/{chunk-P62APAXL.js → chunk-NT3QRCVS.js} +2 -2
  28. package/{chunk-OGPQ3AMC.js → chunk-RPPRK6EZ.js} +6 -6
  29. package/{chunk-M3JQWYBC.js → chunk-T2BZICLK.js} +3 -1
  30. package/chunk-T5HJEUQN.js +956 -0
  31. package/{chunk-SDAPQUSO.js → chunk-YNAGAUJT.js} +6 -6
  32. package/{chunk-ZZDWMZFU.js → chunk-ZQ3IDY66.js} +3 -3
  33. package/{clipboardy-PRUHGPGC.js → clipboardy-BX4NMYHE.js} +7 -5
  34. package/{createAgentAutomationAction-IDIY6K45.js → createAgentAutomationAction-767ZITQJ.js} +3 -3
  35. package/{createDialogAction-5LB4YBPS.js → createDialogAction-H75NDXYH.js} +4 -4
  36. package/{createPageAction-TJWVDPZD.js → createPageAction-KYJYZPLC.js} +3 -3
  37. package/{dialogCommands-44NGBPJJ.js → dialogCommands-VYH2BY5H.js} +2 -2
  38. package/{dialogSlice-62JC4ZMX.js → dialogSlice-YJV3AVFM.js} +2 -2
  39. package/{docCreateCommands-IOGYJ7F7.js → docCreateCommands-JS7A3OHQ.js} +2 -2
  40. package/{docDeleteCommands-RO4BZWFP.js → docDeleteCommands-HG5HNKZR.js} +2 -2
  41. package/{docReadCommands-F2KNOJFW.js → docReadCommands-BH4WN6HH.js} +2 -2
  42. package/{docStore-ZRNKZZXU.js → docStore-JOODSWDW.js} +4 -4
  43. package/{docUpdateCommands-2VG4AYOC.js → docUpdateCommands-TAXC7LHJ.js} +2 -2
  44. package/{handleSendMessageAction-YB64A32O.js → handleSendMessageAction-DGL6H4E4.js} +2 -2
  45. package/index.js +59 -46
  46. package/{machineCommands-6WPICTON.js → machineCommands-DSFTSYUL.js} +11 -11
  47. package/{machineWsRunDispatch-4OGEZTYG.js → machineWsRunDispatch-ZOAJQHTU.js} +11 -11
  48. package/package.json +1 -1
  49. package/{readlineWorkspace-BZAZ5YXM.js → readlineWorkspace-5G3UFHYG.js} +53 -30
  50. package/{runAgentClientLoop-SOZS3YTQ.js → runAgentClientLoop-B3TTKXIX.js} +9 -9
  51. package/{spaceCommands-WEASK3IV.js → spaceCommands-Y33JLAKF.js} +2 -2
  52. package/{spaceSlice-2QNUKRN6.js → spaceSlice-ZKUZSVYD.js} +3 -3
  53. package/{streamAgentChatTurn-BYI7UXAA.js → streamAgentChatTurn-PLTB7RMV.js} +10 -10
  54. package/{tools-E6FEUNZY.js → tools-KQXDW66A.js} +6 -6
  55. package/{updateCommands-MNDUIKN7.js → updateCommands-IYKLF3JX.js} +3 -1
  56. package/{updateDialogTitleAction-2A3BEXSP.js → updateDialogTitleAction-OTYEQJAK.js} +3 -3
  57. package/chunk-VFVCYIRQ.js +0 -407
package/chunk-VFVCYIRQ.js DELETED
@@ -1,407 +0,0 @@
1
- import {
2
- loadProfileConfig
3
- } from "./chunk-UNZDCI3O.js";
4
- import {
5
- resolveDefaultSpawn
6
- } from "./chunk-IDZTNRP2.js";
7
- import {
8
- isCompiledBinary
9
- } from "./chunk-A7GB5UGH.js";
10
- import {
11
- DEFAULT_NOLO_SERVER_URL
12
- } from "./chunk-OLZBQWZU.js";
13
- import {
14
- normalizeServerOrigin
15
- } from "./chunk-CF7PE763.js";
16
-
17
- // packages/cli/updateCommands.ts
18
- import { existsSync, readFileSync, accessSync, constants } from "node:fs";
19
- import { homedir } from "node:os";
20
- import { dirname, join } from "node:path";
21
- import { fileURLToPath } from "node:url";
22
- function resolvePackageJsonPath() {
23
- if (isCompiledBinary()) {
24
- const execDir = dirname(process.execPath);
25
- const candidate2 = join(execDir, "package.json");
26
- if (existsSync(candidate2)) return candidate2;
27
- return null;
28
- }
29
- const CLI_DIR = dirname(fileURLToPath(import.meta.url));
30
- const candidate = join(CLI_DIR, "package.json");
31
- return existsSync(candidate) ? candidate : null;
32
- }
33
- var PACKAGE_JSON_PATH = resolvePackageJsonPath();
34
- function getCliInstallChannel(serverUrl) {
35
- const normalized = normalizeServerOrigin(serverUrl);
36
- if (!normalized) {
37
- return "latest";
38
- }
39
- try {
40
- const hostname = new URL(normalized).hostname.toLowerCase();
41
- if (hostname === "us.nolo.chat" || hostname.endsWith(".us.nolo.chat")) {
42
- return "alpha";
43
- }
44
- } catch {
45
- if (/us\.nolo\.chat/i.test(normalized)) {
46
- return "alpha";
47
- }
48
- }
49
- return "latest";
50
- }
51
- function renderProgressBar(percent, width = 30) {
52
- const pct = Math.max(0, Math.min(100, percent));
53
- const filledLen = Math.round(width * pct / 100);
54
- const emptyLen = width - filledLen;
55
- const bar = "#".repeat(filledLen) + " ".repeat(emptyLen);
56
- const pctText = pct.toFixed(1).padStart(5, " ");
57
- return `[${bar}] ${pctText}%`;
58
- }
59
- function buildNpmSelfUpdateCommand(channel = "latest") {
60
- return ["npm", "install", "-g", `nolo-cli@${channel}`, "--force", "--progress"];
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
- }
95
- function readPackageInfo() {
96
- if (PACKAGE_JSON_PATH) {
97
- try {
98
- const raw = readFileSync(PACKAGE_JSON_PATH, "utf8");
99
- const parsed = JSON.parse(raw);
100
- return {
101
- name: parsed.name || "nolo-cli",
102
- version: parsed.version || "0.0.0"
103
- };
104
- } catch {
105
- }
106
- }
107
- return {
108
- name: process.env.NOLO_CLI_PACKAGE_NAME || "nolo-cli",
109
- version: process.env.NOLO_CLI_VERSION || "0.0.0"
110
- };
111
- }
112
- function buildCliVersionText(info) {
113
- return `${info.name} ${info.version}`;
114
- }
115
- function buildSelfUpdateCommand(serverUrl) {
116
- return buildNpmSelfUpdateCommand(getCliInstallChannel(serverUrl));
117
- }
118
- function resolveSelfUpdateServerUrl(env = process.env, override) {
119
- if (override?.trim()) {
120
- return normalizeServerOrigin(override);
121
- }
122
- const fromEnv = env.NOLO_SERVER || env.BASE_URL;
123
- if (typeof fromEnv === "string" && fromEnv.trim()) {
124
- return normalizeServerOrigin(fromEnv);
125
- }
126
- const profile = loadProfileConfig();
127
- const profileUrl = profile?.profiles?.[profile.currentProfile]?.serverUrl;
128
- if (profileUrl?.trim()) {
129
- return normalizeServerOrigin(profileUrl);
130
- }
131
- return DEFAULT_NOLO_SERVER_URL;
132
- }
133
- function buildCliDoctorText(info) {
134
- return [
135
- "Nolo CLI doctor",
136
- "---------------",
137
- `version ${info.packageName} ${info.version}`,
138
- `install ${info.installKind}`,
139
- `channel ${info.updateChannel}`,
140
- `entry ${info.entrypoint}`,
141
- `server ${info.serverUrl}`,
142
- `profile ${info.profileName}`,
143
- `update nolo update`,
144
- "",
145
- "If direct `nolo` differs from repo-local `bun ./packages/cli/index.ts`,",
146
- "the global install is older than this checkout.",
147
- "",
148
- `Manual update: ${info.installKind === "standalone-bundle" ? buildStandaloneManualUpdateHint(info.updateChannel) : buildNpmSelfUpdateCommand(info.updateChannel).join(" ")}`
149
- ].join("\n");
150
- }
151
- function isRunSelfUpdateOptions(value) {
152
- return typeof value === "object" && value !== null && ("output" in value || "spawn" in value || "entrypointPath" in value || "serverUrl" in value || "env" in value);
153
- }
154
- async function forwardSpawnOutput(stream, output) {
155
- if (!stream) {
156
- return;
157
- }
158
- for await (const chunk of stream) {
159
- output.write(normalizeSpawnChunk(chunk));
160
- }
161
- }
162
- function normalizeSpawnChunk(chunk) {
163
- if (typeof chunk === "string" || chunk instanceof Uint8Array) {
164
- return chunk;
165
- }
166
- if (chunk instanceof ArrayBuffer) {
167
- return new Uint8Array(chunk);
168
- }
169
- return new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);
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
- }
273
- var NOLO_UPDATE_CHECK_KILL_SWITCH = "NOLO_CLI_NO_UPDATE_CHECK";
274
- function parseCliVersion(raw) {
275
- const match = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/.exec(raw.trim());
276
- if (!match) return null;
277
- return {
278
- main: [Number(match[1]), Number(match[2]), Number(match[3])],
279
- pre: match[4] ? match[4].split(".") : []
280
- };
281
- }
282
- function compareCliVersions(a, b) {
283
- const pa = parseCliVersion(a);
284
- const pb = parseCliVersion(b);
285
- if (!pa || !pb) return a.localeCompare(b);
286
- for (let i = 0; i < 3; i++) {
287
- if (pa.main[i] !== pb.main[i]) return pa.main[i] < pb.main[i] ? -1 : 1;
288
- }
289
- if (pa.pre.length === 0 && pb.pre.length === 0) return 0;
290
- if (pa.pre.length === 0) return 1;
291
- if (pb.pre.length === 0) return -1;
292
- const len = Math.max(pa.pre.length, pb.pre.length);
293
- for (let i = 0; i < len; i++) {
294
- const x = pa.pre[i];
295
- const y = pb.pre[i];
296
- if (x === void 0) return -1;
297
- if (y === void 0) return 1;
298
- if (x === y) continue;
299
- const xn = /^\d+$/.test(x) ? Number(x) : NaN;
300
- const yn = /^\d+$/.test(y) ? Number(y) : NaN;
301
- if (!Number.isNaN(xn) && !Number.isNaN(yn)) return xn < yn ? -1 : 1;
302
- if (!Number.isNaN(xn)) return -1;
303
- if (!Number.isNaN(yn)) return 1;
304
- return x < y ? -1 : 1;
305
- }
306
- return 0;
307
- }
308
- async function checkForCliUpdate(currentVersion, serverUrl, options = {}) {
309
- const env = options.env ?? process.env;
310
- if ((env[NOLO_UPDATE_CHECK_KILL_SWITCH] ?? process.env[NOLO_UPDATE_CHECK_KILL_SWITCH]) === "1") {
311
- return null;
312
- }
313
- if (!currentVersion || !parseCliVersion(currentVersion)) return null;
314
- const channel = getCliInstallChannel(serverUrl);
315
- const fetchImpl = options.fetchImpl ?? fetch;
316
- const timeoutMs = options.timeoutMs ?? 2e3;
317
- try {
318
- const res = await fetchImpl(
319
- `https://registry.npmjs.org/nolo-cli/${channel}`,
320
- {
321
- signal: AbortSignal.timeout(timeoutMs),
322
- headers: { accept: "application/json" }
323
- }
324
- );
325
- if (!res.ok) return null;
326
- const data = await res.json();
327
- const latestVersion = data.version;
328
- if (!latestVersion || !parseCliVersion(latestVersion) || compareCliVersions(latestVersion, currentVersion) <= 0) {
329
- return null;
330
- }
331
- return { latestVersion, channel };
332
- } catch {
333
- return null;
334
- }
335
- }
336
- async function runSelfUpdate(outputOrOptions) {
337
- const options = outputOrOptions === void 0 ? {} : isRunSelfUpdateOptions(outputOrOptions) ? outputOrOptions : { output: outputOrOptions };
338
- if (isCompiledBinary()) {
339
- return runStandaloneBundleUpdate(options);
340
- }
341
- const output = options.output ?? process.stdout;
342
- const spawn = options.spawn ?? resolveDefaultSpawn();
343
- const env = options.env ?? process.env;
344
- const serverUrl = resolveSelfUpdateServerUrl(env, options.serverUrl);
345
- const channel = getCliInstallChannel(serverUrl);
346
- const command = buildNpmSelfUpdateCommand(channel);
347
- output.write(`
348
- Nolo Agent CLI Installer & Updater
349
- `);
350
- output.write(`-----------------------------------------
351
- `);
352
- output.write(`\u2713 Target channel: ${channel} (nolo-cli@${channel})
353
- `);
354
- output.write(`\u25B8 Downloading and installing package via npm...
355
- `);
356
- const useCustomSink = options.output !== void 0;
357
- const proc = spawn({
358
- cmd: command,
359
- stdin: "inherit",
360
- stdout: useCustomSink ? "pipe" : "inherit",
361
- stderr: useCustomSink ? "pipe" : "inherit",
362
- env
363
- });
364
- if (!useCustomSink) {
365
- const exitCode2 = await proc.exited;
366
- if (exitCode2 === 0) {
367
- output.write(` ${renderProgressBar(100)}
368
- `);
369
- output.write(`\u2713 Update completed successfully!
370
-
371
- `);
372
- }
373
- return exitCode2;
374
- }
375
- const [exitCode] = await Promise.all([
376
- proc.exited,
377
- forwardSpawnOutput(proc.stdout, output),
378
- forwardSpawnOutput(proc.stderr, output)
379
- ]);
380
- if (exitCode === 0) {
381
- output.write(` ${renderProgressBar(100)}
382
- `);
383
- output.write(`\u2713 Update completed successfully!
384
-
385
- `);
386
- }
387
- return exitCode;
388
- }
389
-
390
- export {
391
- getCliInstallChannel,
392
- renderProgressBar,
393
- buildNpmSelfUpdateCommand,
394
- resolveStandaloneBundlePlatform,
395
- resolveStandaloneBundleRepoBase,
396
- buildStandaloneManualUpdateHint,
397
- readPackageInfo,
398
- buildCliVersionText,
399
- buildSelfUpdateCommand,
400
- resolveSelfUpdateServerUrl,
401
- buildCliDoctorText,
402
- runStandaloneBundleUpdate,
403
- NOLO_UPDATE_CHECK_KILL_SWITCH,
404
- compareCliVersions,
405
- checkForCliUpdate,
406
- runSelfUpdate
407
- };