neoctl 0.2.11 → 0.2.13

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 (82) hide show
  1. package/dist/index.d.ts +0 -1
  2. package/dist/index.js +0 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/repl/index.js +3130 -314
  5. package/dist/repl/index.js.map +1 -1
  6. package/dist/session/tool-result-memory.js +58 -0
  7. package/dist/session/tool-result-memory.js.map +1 -1
  8. package/dist/tools/builtins/image-note-tool.js +1 -5
  9. package/dist/tools/builtins/image-note-tool.js.map +1 -1
  10. package/dist/web/html.js +8 -14
  11. package/dist/web/html.js.map +1 -1
  12. package/dist/web/index.d.ts +0 -5
  13. package/dist/web/index.js +5 -41
  14. package/dist/web/index.js.map +1 -1
  15. package/package.json +3 -1
  16. package/scripts/install-ripgrep.cjs +196 -196
  17. package/scripts/release-local.mjs +148 -0
  18. package/vendor/ripgrep/darwin-arm64/COPYING +3 -3
  19. package/vendor/ripgrep/darwin-arm64/LICENSE-MIT +21 -21
  20. package/vendor/ripgrep/darwin-arm64/UNLICENSE +24 -24
  21. package/vendor/ripgrep/darwin-arm64/manifest.json +7 -7
  22. package/vendor/ripgrep/darwin-x64/COPYING +3 -3
  23. package/vendor/ripgrep/darwin-x64/LICENSE-MIT +21 -21
  24. package/vendor/ripgrep/darwin-x64/UNLICENSE +24 -24
  25. package/vendor/ripgrep/darwin-x64/manifest.json +7 -7
  26. package/vendor/ripgrep/linux-arm64/COPYING +3 -3
  27. package/vendor/ripgrep/linux-arm64/LICENSE-MIT +21 -21
  28. package/vendor/ripgrep/linux-arm64/UNLICENSE +24 -24
  29. package/vendor/ripgrep/linux-arm64/manifest.json +7 -7
  30. package/vendor/ripgrep/linux-x64/COPYING +3 -3
  31. package/vendor/ripgrep/linux-x64/LICENSE-MIT +21 -21
  32. package/vendor/ripgrep/linux-x64/UNLICENSE +24 -24
  33. package/vendor/ripgrep/linux-x64/manifest.json +7 -7
  34. package/vendor/ripgrep/win32-arm64/manifest.json +7 -7
  35. package/dist/repl/browser.d.ts +0 -232
  36. package/dist/repl/browser.js +0 -156
  37. package/dist/repl/browser.js.map +0 -1
  38. package/dist/repl/env-file.d.ts +0 -4
  39. package/dist/repl/env-file.js +0 -97
  40. package/dist/repl/env-file.js.map +0 -1
  41. package/dist/repl/foreground-exec.d.ts +0 -10
  42. package/dist/repl/foreground-exec.js +0 -34
  43. package/dist/repl/foreground-exec.js.map +0 -1
  44. package/dist/repl/login-view.d.ts +0 -75
  45. package/dist/repl/login-view.js +0 -38
  46. package/dist/repl/login-view.js.map +0 -1
  47. package/dist/repl/login.d.ts +0 -14
  48. package/dist/repl/login.js +0 -165
  49. package/dist/repl/login.js.map +0 -1
  50. package/dist/repl/message-rendering.d.ts +0 -99
  51. package/dist/repl/message-rendering.js +0 -476
  52. package/dist/repl/message-rendering.js.map +0 -1
  53. package/dist/repl/prompt-payload.d.ts +0 -9
  54. package/dist/repl/prompt-payload.js +0 -64
  55. package/dist/repl/prompt-payload.js.map +0 -1
  56. package/dist/repl/prompt-view.d.ts +0 -235
  57. package/dist/repl/prompt-view.js +0 -184
  58. package/dist/repl/prompt-view.js.map +0 -1
  59. package/dist/repl/repl-types.d.ts +0 -88
  60. package/dist/repl/repl-types.js +0 -2
  61. package/dist/repl/repl-types.js.map +0 -1
  62. package/dist/repl/runtime.d.ts +0 -33
  63. package/dist/repl/runtime.js +0 -202
  64. package/dist/repl/runtime.js.map +0 -1
  65. package/dist/repl/slash-completion.d.ts +0 -28
  66. package/dist/repl/slash-completion.js +0 -287
  67. package/dist/repl/slash-completion.js.map +0 -1
  68. package/dist/repl/status-panel.d.ts +0 -234
  69. package/dist/repl/status-panel.js +0 -509
  70. package/dist/repl/status-panel.js.map +0 -1
  71. package/dist/repl/terminal.d.ts +0 -19
  72. package/dist/repl/terminal.js +0 -81
  73. package/dist/repl/terminal.js.map +0 -1
  74. package/dist/repl/tool-rendering.d.ts +0 -6
  75. package/dist/repl/tool-rendering.js +0 -502
  76. package/dist/repl/tool-rendering.js.map +0 -1
  77. package/dist/repl/usage.d.ts +0 -17
  78. package/dist/repl/usage.js +0 -57
  79. package/dist/repl/usage.js.map +0 -1
  80. package/dist/tips.d.ts +0 -10
  81. package/dist/tips.js +0 -168
  82. package/dist/tips.js.map +0 -1
@@ -1,196 +1,196 @@
1
- #!/usr/bin/env node
2
- const fs = require("node:fs");
3
- const fsp = require("node:fs/promises");
4
- const os = require("node:os");
5
- const path = require("node:path");
6
- const { execFileSync } = require("node:child_process");
7
-
8
- const REPO = "BurntSushi/ripgrep";
9
- const LATEST_RELEASE_URL = `https://api.github.com/repos/${REPO}/releases/latest`;
10
- const PROJECT_ROOT = path.resolve(__dirname, "..");
11
- const VENDOR_ROOT = path.join(PROJECT_ROOT, "vendor", "ripgrep");
12
- const OPTIONAL = process.argv.includes("--optional");
13
- const FORCE = process.argv.includes("--force");
14
- const ALL = process.argv.includes("--all");
15
-
16
- const TARGETS = {
17
- "win32-x64": [/x86_64-pc-windows-msvc\.zip$/i],
18
- "win32-arm64": [/aarch64-pc-windows-msvc\.zip$/i],
19
- "linux-x64": [/x86_64-unknown-linux-musl\.tar\.gz$/i, /x86_64-unknown-linux-gnu\.tar\.gz$/i],
20
- "linux-arm64": [/aarch64-unknown-linux-gnu\.tar\.gz$/i, /aarch64-unknown-linux-musl\.tar\.gz$/i],
21
- "darwin-x64": [/x86_64-apple-darwin\.tar\.gz$/i],
22
- "darwin-arm64": [/aarch64-apple-darwin\.tar\.gz$/i],
23
- };
24
-
25
- main().catch((error) => {
26
- const message = error instanceof Error ? error.message : String(error);
27
- if (OPTIONAL) {
28
- console.warn(`[ripgrep] optional install skipped: ${message}`);
29
- process.exit(0);
30
- }
31
- console.error(`[ripgrep] install failed: ${message}`);
32
- process.exit(1);
33
- });
34
-
35
- async function main() {
36
- const release = await getJson(LATEST_RELEASE_URL);
37
- const keys = ALL ? Object.keys(TARGETS) : [platformKey()];
38
- for (const key of keys) {
39
- await installTarget(release, key);
40
- }
41
- }
42
-
43
- async function installTarget(release, key) {
44
- const executable = key.startsWith("win32-") ? "rg.exe" : "rg";
45
- const targetDir = path.join(VENDOR_ROOT, key);
46
- const targetPath = path.join(targetDir, executable);
47
-
48
- if (!FORCE && fs.existsSync(targetPath)) {
49
- console.error(`[ripgrep] using existing ${path.relative(PROJECT_ROOT, targetPath)}`);
50
- return;
51
- }
52
-
53
- const asset = selectAsset(release.assets ?? [], key);
54
- if (!asset) throw new Error(`no ripgrep release asset found for ${key}`);
55
-
56
- const tempDir = await fsp.mkdtemp(path.join(os.tmpdir(), "agent-rg-"));
57
- try {
58
- const archivePath = path.join(tempDir, asset.name);
59
- const extractDir = path.join(tempDir, "extract");
60
- await fsp.mkdir(extractDir, { recursive: true });
61
-
62
- console.error(`[ripgrep] downloading ${asset.name}`);
63
- await download(asset.browser_download_url, archivePath);
64
- extractArchive(archivePath, extractDir);
65
-
66
- const binaryPath = await findFile(extractDir, executable);
67
- if (!binaryPath) throw new Error(`${executable} not found inside ${asset.name}`);
68
-
69
- await fsp.rm(targetDir, { recursive: true, force: true });
70
- await fsp.mkdir(targetDir, { recursive: true });
71
- await fsp.copyFile(binaryPath, targetPath);
72
- if (!key.startsWith("win32-")) await fsp.chmod(targetPath, 0o755);
73
-
74
- await copyLicenseFiles(extractDir, targetDir);
75
- await fsp.writeFile(
76
- path.join(targetDir, "manifest.json"),
77
- `${JSON.stringify({
78
- name: "ripgrep",
79
- version: release.tag_name,
80
- source: release.html_url,
81
- asset: asset.name,
82
- installedAt: new Date().toISOString(),
83
- }, null, 2)}\n`,
84
- "utf8",
85
- );
86
- console.error(`[ripgrep] installed ${path.relative(PROJECT_ROOT, targetPath)}`);
87
- } finally {
88
- await fsp.rm(tempDir, { recursive: true, force: true });
89
- }
90
- }
91
-
92
- function platformKey() {
93
- const key = `${process.platform}-${process.arch}`;
94
- if (!TARGETS[key]) throw new Error(`unsupported platform: ${key}`);
95
- return key;
96
- }
97
-
98
- function selectAsset(assets, key) {
99
- const patterns = TARGETS[key];
100
- return assets.find((asset) => patterns.some((pattern) => pattern.test(asset.name)));
101
- }
102
-
103
- async function getJson(url) {
104
- try {
105
- const response = await fetchWithRetry(url, {
106
- headers: {
107
- Accept: "application/vnd.github+json",
108
- "User-Agent": "agent-scaffold-ripgrep-installer",
109
- },
110
- });
111
- if (!response.ok) throw new Error(`GET ${url} returned ${response.status}: ${(await response.text()).slice(0, 200)}`);
112
- return response.json();
113
- } catch (error) {
114
- const body = curlGet(url);
115
- return JSON.parse(body.toString("utf8"));
116
- }
117
- }
118
-
119
- async function download(url, destination) {
120
- try {
121
- const response = await fetchWithRetry(url, { headers: { "User-Agent": "agent-scaffold-ripgrep-installer" } });
122
- if (!response.ok) throw new Error(`download returned ${response.status}`);
123
- await fsp.writeFile(destination, Buffer.from(await response.arrayBuffer()));
124
- } catch (error) {
125
- curlDownload(url, destination);
126
- }
127
- }
128
-
129
- async function fetchWithRetry(url, options, attempts = 3) {
130
- let lastError;
131
- for (let attempt = 1; attempt <= attempts; attempt += 1) {
132
- try {
133
- const response = await fetch(url, options);
134
- if (response.ok || response.status < 500 || attempt === attempts) return response;
135
- lastError = new Error(`HTTP ${response.status}`);
136
- } catch (error) {
137
- lastError = error;
138
- if (attempt === attempts) break;
139
- }
140
- await delay(1000 * attempt);
141
- }
142
- throw lastError;
143
- }
144
-
145
- function delay(ms) {
146
- return new Promise((resolve) => setTimeout(resolve, ms));
147
- }
148
-
149
- function curlGet(url) {
150
- return execFileSync("curl", ["-fL", "--retry", "3", "--retry-delay", "1", "-H", "Accept: application/vnd.github+json", "-H", "User-Agent: agent-scaffold-ripgrep-installer", url], { maxBuffer: 1024 * 1024 * 20 });
151
- }
152
-
153
- function curlDownload(url, destination) {
154
- execFileSync("curl", ["-fL", "--retry", "3", "--retry-delay", "1", "-H", "User-Agent: agent-scaffold-ripgrep-installer", "-o", destination, url], { stdio: "ignore" });
155
- }
156
-
157
- function extractArchive(archivePath, destination) {
158
- try {
159
- execFileSync("tar", ["-xf", archivePath, "-C", destination], { stdio: "ignore" });
160
- return;
161
- } catch (error) {
162
- if (process.platform !== "win32" || !archivePath.toLowerCase().endsWith(".zip")) throw error;
163
- }
164
-
165
- execFileSync("powershell", [
166
- "-NoProfile",
167
- "-Command",
168
- "Expand-Archive -LiteralPath $args[0] -DestinationPath $args[1] -Force",
169
- archivePath,
170
- destination,
171
- ], { stdio: "ignore" });
172
- }
173
-
174
- async function findFile(root, fileName) {
175
- const entries = await fsp.readdir(root, { withFileTypes: true });
176
- for (const entry of entries) {
177
- const fullPath = path.join(root, entry.name);
178
- if (entry.isFile() && entry.name === fileName) return fullPath;
179
- if (entry.isDirectory()) {
180
- const found = await findFile(fullPath, fileName);
181
- if (found) return found;
182
- }
183
- }
184
- return undefined;
185
- }
186
-
187
- async function copyLicenseFiles(root, targetDir) {
188
- const entries = await fsp.readdir(root, { withFileTypes: true });
189
- for (const entry of entries) {
190
- const fullPath = path.join(root, entry.name);
191
- if (entry.isFile() && /^licen[sc]e|copying|unlicense/i.test(entry.name)) {
192
- await fsp.copyFile(fullPath, path.join(targetDir, entry.name));
193
- }
194
- if (entry.isDirectory()) await copyLicenseFiles(fullPath, targetDir);
195
- }
196
- }
1
+ #!/usr/bin/env node
2
+ const fs = require("node:fs");
3
+ const fsp = require("node:fs/promises");
4
+ const os = require("node:os");
5
+ const path = require("node:path");
6
+ const { execFileSync } = require("node:child_process");
7
+
8
+ const REPO = "BurntSushi/ripgrep";
9
+ const LATEST_RELEASE_URL = `https://api.github.com/repos/${REPO}/releases/latest`;
10
+ const PROJECT_ROOT = path.resolve(__dirname, "..");
11
+ const VENDOR_ROOT = path.join(PROJECT_ROOT, "vendor", "ripgrep");
12
+ const OPTIONAL = process.argv.includes("--optional");
13
+ const FORCE = process.argv.includes("--force");
14
+ const ALL = process.argv.includes("--all");
15
+
16
+ const TARGETS = {
17
+ "win32-x64": [/x86_64-pc-windows-msvc\.zip$/i],
18
+ "win32-arm64": [/aarch64-pc-windows-msvc\.zip$/i],
19
+ "linux-x64": [/x86_64-unknown-linux-musl\.tar\.gz$/i, /x86_64-unknown-linux-gnu\.tar\.gz$/i],
20
+ "linux-arm64": [/aarch64-unknown-linux-gnu\.tar\.gz$/i, /aarch64-unknown-linux-musl\.tar\.gz$/i],
21
+ "darwin-x64": [/x86_64-apple-darwin\.tar\.gz$/i],
22
+ "darwin-arm64": [/aarch64-apple-darwin\.tar\.gz$/i],
23
+ };
24
+
25
+ main().catch((error) => {
26
+ const message = error instanceof Error ? error.message : String(error);
27
+ if (OPTIONAL) {
28
+ console.warn(`[ripgrep] optional install skipped: ${message}`);
29
+ process.exit(0);
30
+ }
31
+ console.error(`[ripgrep] install failed: ${message}`);
32
+ process.exit(1);
33
+ });
34
+
35
+ async function main() {
36
+ const release = await getJson(LATEST_RELEASE_URL);
37
+ const keys = ALL ? Object.keys(TARGETS) : [platformKey()];
38
+ for (const key of keys) {
39
+ await installTarget(release, key);
40
+ }
41
+ }
42
+
43
+ async function installTarget(release, key) {
44
+ const executable = key.startsWith("win32-") ? "rg.exe" : "rg";
45
+ const targetDir = path.join(VENDOR_ROOT, key);
46
+ const targetPath = path.join(targetDir, executable);
47
+
48
+ if (!FORCE && fs.existsSync(targetPath)) {
49
+ console.error(`[ripgrep] using existing ${path.relative(PROJECT_ROOT, targetPath)}`);
50
+ return;
51
+ }
52
+
53
+ const asset = selectAsset(release.assets ?? [], key);
54
+ if (!asset) throw new Error(`no ripgrep release asset found for ${key}`);
55
+
56
+ const tempDir = await fsp.mkdtemp(path.join(os.tmpdir(), "agent-rg-"));
57
+ try {
58
+ const archivePath = path.join(tempDir, asset.name);
59
+ const extractDir = path.join(tempDir, "extract");
60
+ await fsp.mkdir(extractDir, { recursive: true });
61
+
62
+ console.error(`[ripgrep] downloading ${asset.name}`);
63
+ await download(asset.browser_download_url, archivePath);
64
+ extractArchive(archivePath, extractDir);
65
+
66
+ const binaryPath = await findFile(extractDir, executable);
67
+ if (!binaryPath) throw new Error(`${executable} not found inside ${asset.name}`);
68
+
69
+ await fsp.rm(targetDir, { recursive: true, force: true });
70
+ await fsp.mkdir(targetDir, { recursive: true });
71
+ await fsp.copyFile(binaryPath, targetPath);
72
+ if (!key.startsWith("win32-")) await fsp.chmod(targetPath, 0o755);
73
+
74
+ await copyLicenseFiles(extractDir, targetDir);
75
+ await fsp.writeFile(
76
+ path.join(targetDir, "manifest.json"),
77
+ `${JSON.stringify({
78
+ name: "ripgrep",
79
+ version: release.tag_name,
80
+ source: release.html_url,
81
+ asset: asset.name,
82
+ installedAt: new Date().toISOString(),
83
+ }, null, 2)}\n`,
84
+ "utf8",
85
+ );
86
+ console.error(`[ripgrep] installed ${path.relative(PROJECT_ROOT, targetPath)}`);
87
+ } finally {
88
+ await fsp.rm(tempDir, { recursive: true, force: true });
89
+ }
90
+ }
91
+
92
+ function platformKey() {
93
+ const key = `${process.platform}-${process.arch}`;
94
+ if (!TARGETS[key]) throw new Error(`unsupported platform: ${key}`);
95
+ return key;
96
+ }
97
+
98
+ function selectAsset(assets, key) {
99
+ const patterns = TARGETS[key];
100
+ return assets.find((asset) => patterns.some((pattern) => pattern.test(asset.name)));
101
+ }
102
+
103
+ async function getJson(url) {
104
+ try {
105
+ const response = await fetchWithRetry(url, {
106
+ headers: {
107
+ Accept: "application/vnd.github+json",
108
+ "User-Agent": "agent-scaffold-ripgrep-installer",
109
+ },
110
+ });
111
+ if (!response.ok) throw new Error(`GET ${url} returned ${response.status}: ${(await response.text()).slice(0, 200)}`);
112
+ return response.json();
113
+ } catch (error) {
114
+ const body = curlGet(url);
115
+ return JSON.parse(body.toString("utf8"));
116
+ }
117
+ }
118
+
119
+ async function download(url, destination) {
120
+ try {
121
+ const response = await fetchWithRetry(url, { headers: { "User-Agent": "agent-scaffold-ripgrep-installer" } });
122
+ if (!response.ok) throw new Error(`download returned ${response.status}`);
123
+ await fsp.writeFile(destination, Buffer.from(await response.arrayBuffer()));
124
+ } catch (error) {
125
+ curlDownload(url, destination);
126
+ }
127
+ }
128
+
129
+ async function fetchWithRetry(url, options, attempts = 3) {
130
+ let lastError;
131
+ for (let attempt = 1; attempt <= attempts; attempt += 1) {
132
+ try {
133
+ const response = await fetch(url, options);
134
+ if (response.ok || response.status < 500 || attempt === attempts) return response;
135
+ lastError = new Error(`HTTP ${response.status}`);
136
+ } catch (error) {
137
+ lastError = error;
138
+ if (attempt === attempts) break;
139
+ }
140
+ await delay(1000 * attempt);
141
+ }
142
+ throw lastError;
143
+ }
144
+
145
+ function delay(ms) {
146
+ return new Promise((resolve) => setTimeout(resolve, ms));
147
+ }
148
+
149
+ function curlGet(url) {
150
+ return execFileSync("curl", ["-fL", "--retry", "3", "--retry-delay", "1", "-H", "Accept: application/vnd.github+json", "-H", "User-Agent: agent-scaffold-ripgrep-installer", url], { maxBuffer: 1024 * 1024 * 20 });
151
+ }
152
+
153
+ function curlDownload(url, destination) {
154
+ execFileSync("curl", ["-fL", "--retry", "3", "--retry-delay", "1", "-H", "User-Agent: agent-scaffold-ripgrep-installer", "-o", destination, url], { stdio: "ignore" });
155
+ }
156
+
157
+ function extractArchive(archivePath, destination) {
158
+ try {
159
+ execFileSync("tar", ["-xf", archivePath, "-C", destination], { stdio: "ignore" });
160
+ return;
161
+ } catch (error) {
162
+ if (process.platform !== "win32" || !archivePath.toLowerCase().endsWith(".zip")) throw error;
163
+ }
164
+
165
+ execFileSync("powershell", [
166
+ "-NoProfile",
167
+ "-Command",
168
+ "Expand-Archive -LiteralPath $args[0] -DestinationPath $args[1] -Force",
169
+ archivePath,
170
+ destination,
171
+ ], { stdio: "ignore" });
172
+ }
173
+
174
+ async function findFile(root, fileName) {
175
+ const entries = await fsp.readdir(root, { withFileTypes: true });
176
+ for (const entry of entries) {
177
+ const fullPath = path.join(root, entry.name);
178
+ if (entry.isFile() && entry.name === fileName) return fullPath;
179
+ if (entry.isDirectory()) {
180
+ const found = await findFile(fullPath, fileName);
181
+ if (found) return found;
182
+ }
183
+ }
184
+ return undefined;
185
+ }
186
+
187
+ async function copyLicenseFiles(root, targetDir) {
188
+ const entries = await fsp.readdir(root, { withFileTypes: true });
189
+ for (const entry of entries) {
190
+ const fullPath = path.join(root, entry.name);
191
+ if (entry.isFile() && /^licen[sc]e|copying|unlicense/i.test(entry.name)) {
192
+ await fsp.copyFile(fullPath, path.join(targetDir, entry.name));
193
+ }
194
+ if (entry.isDirectory()) await copyLicenseFiles(fullPath, targetDir);
195
+ }
196
+ }
@@ -0,0 +1,148 @@
1
+ #!/usr/bin/env node
2
+ import { mkdtemp, rm, readFile } from "node:fs/promises";
3
+ import { tmpdir } from "node:os";
4
+ import path from "node:path";
5
+ import { spawn } from "node:child_process";
6
+
7
+ const args = process.argv.slice(2);
8
+
9
+ if (args.includes("--help") || args.includes("-h")) {
10
+ printHelp();
11
+ process.exit(0);
12
+ }
13
+
14
+ const dryRun = takeFlag("--dry-run") || takeFlag("-n") || isTruthy(process.env.npm_config_dry_run);
15
+ const skipInstall = takeFlag("--no-install");
16
+ const skipPublish = takeFlag("--no-publish");
17
+ const registry = takeOption("--registry") ?? "https://registry.npmjs.org/";
18
+ const tag = takeOption("--tag") ?? "latest";
19
+ const positional = args.filter((arg) => !arg.startsWith("-"));
20
+ const bump = positional[0] ?? "patch";
21
+
22
+ const root = process.cwd();
23
+ const packageJsonPath = path.join(root, "package.json");
24
+ const packageJson = JSON.parse(await readFile(packageJsonPath, "utf8"));
25
+ const packageName = packageJson.name;
26
+ const currentVersion = packageJson.version;
27
+ const targetVersion = resolveTargetVersion(currentVersion, bump);
28
+
29
+ console.log(`[release-local] package: ${packageName}`);
30
+ console.log(`[release-local] current: ${currentVersion}`);
31
+ console.log(`[release-local] target: ${targetVersion}`);
32
+ console.log(`[release-local] registry: ${registry}`);
33
+ console.log(`[release-local] tag: ${tag}`);
34
+
35
+ if (dryRun) {
36
+ console.log("[release-local] dry run: version files will not be modified, package will not be published, global install will not run");
37
+ await run("npm", ["pack", "--dry-run"], { cwd: root });
38
+ console.log(`[release-local] dry run complete. Would publish ${packageName}@${targetVersion} and install it globally.`);
39
+ process.exit(0);
40
+ }
41
+
42
+ await run("npm", ["version", targetVersion, "--no-git-tag-version"], { cwd: root });
43
+
44
+ let userconfig;
45
+ try {
46
+ const token = process.env.NODE_AUTH_TOKEN || process.env.NPM_TOKEN;
47
+ if (token) {
48
+ userconfig = await writeTempNpmrc(registry, token);
49
+ }
50
+
51
+ if (!skipPublish) {
52
+ const publishArgs = ["publish", "--registry", registry, "--tag", tag];
53
+ if (userconfig) publishArgs.push("--userconfig", userconfig);
54
+ await run("npm", publishArgs, { cwd: root });
55
+ } else {
56
+ console.log("[release-local] --no-publish: skipping npm publish");
57
+ }
58
+
59
+ if (!skipInstall) {
60
+ await run("npm", ["install", "-g", `${packageName}@${targetVersion}`, "--registry", registry], { cwd: root });
61
+ } else {
62
+ console.log("[release-local] --no-install: skipping global install");
63
+ }
64
+
65
+ if (!skipPublish) {
66
+ await run("npm", ["view", packageName, "version", "dist-tags", "--registry", registry], { cwd: root });
67
+ }
68
+ if (!skipInstall) {
69
+ await run("npm", ["list", "-g", packageName, "--depth=0"], { cwd: root });
70
+ }
71
+
72
+ console.log(`[release-local] done: ${packageName}@${targetVersion}`);
73
+ } finally {
74
+ if (userconfig) await rm(userconfig, { force: true }).catch(() => undefined);
75
+ }
76
+
77
+ function takeFlag(name) {
78
+ const index = args.indexOf(name);
79
+ if (index === -1) return false;
80
+ args.splice(index, 1);
81
+ return true;
82
+ }
83
+
84
+ function takeOption(name) {
85
+ const equalsIndex = args.findIndex((arg) => arg.startsWith(`${name}=`));
86
+ if (equalsIndex !== -1) {
87
+ const value = args[equalsIndex].slice(name.length + 1);
88
+ args.splice(equalsIndex, 1);
89
+ return value;
90
+ }
91
+ const index = args.indexOf(name);
92
+ if (index === -1) return undefined;
93
+ const value = args[index + 1];
94
+ if (!value || value.startsWith("-")) throw new Error(`Missing value for ${name}`);
95
+ args.splice(index, 2);
96
+ return value;
97
+ }
98
+
99
+ function isTruthy(value) {
100
+ return value === "true" || value === "1" || value === "yes";
101
+ }
102
+
103
+ function resolveTargetVersion(currentVersion, bump) {
104
+ if (/^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/.test(bump)) return bump;
105
+ const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(currentVersion);
106
+ if (!match) throw new Error(`Cannot bump non-standard version: ${currentVersion}`);
107
+ const major = Number(match[1]);
108
+ const minor = Number(match[2]);
109
+ const patch = Number(match[3]);
110
+ if (bump === "patch") return `${major}.${minor}.${patch + 1}`;
111
+ if (bump === "minor") return `${major}.${minor + 1}.0`;
112
+ if (bump === "major") return `${major + 1}.0.0`;
113
+ throw new Error(`Unknown bump/version '${bump}'. Use patch, minor, major, or an explicit x.y.z version.`);
114
+ }
115
+
116
+ async function writeTempNpmrc(registry, token) {
117
+ const dir = await mkdtemp(path.join(tmpdir(), "neoctl-release-"));
118
+ const file = path.join(dir, ".npmrc");
119
+ const registryUrl = new URL(registry);
120
+ const fs = await import("node:fs/promises");
121
+ await fs.writeFile(file, `//${registryUrl.host}/:_authToken=${token}\nregistry=${registry}\n`, "utf8");
122
+ return file;
123
+ }
124
+
125
+ function run(command, commandArgs, options = {}) {
126
+ console.log(`[release-local] $ ${command} ${commandArgs.map(quoteArg).join(" ")}`);
127
+ return new Promise((resolve, reject) => {
128
+ const child = spawn(command, commandArgs, {
129
+ cwd: options.cwd,
130
+ shell: process.platform === "win32",
131
+ stdio: "inherit",
132
+ env: process.env,
133
+ });
134
+ child.on("error", reject);
135
+ child.on("exit", (code, signal) => {
136
+ if (code === 0) resolve();
137
+ else reject(new Error(`${command} exited with ${signal ?? code}`));
138
+ });
139
+ });
140
+ }
141
+
142
+ function quoteArg(arg) {
143
+ return /\s/.test(arg) ? JSON.stringify(arg) : arg;
144
+ }
145
+
146
+ function printHelp() {
147
+ console.log(`Usage: npm run release:local -- [patch|minor|major|x.y.z] [options]\n\nPublishes a new npm version and updates the local global install to that exact version.\n\nDefault bump is patch. The script updates package.json/package-lock.json using\n'npm version <version> --no-git-tag-version', runs npm publish, then runs\n'npm install -g <name>@<version>'.\n\nOptions:\n --dry-run, -n Run npm pack --dry-run only; do not modify, publish, or install\n --registry <url> Registry to publish/install from (default: https://registry.npmjs.org/)\n --tag <tag> npm dist-tag for publish (default: latest)\n --no-publish Bump version and install, but skip npm publish\n --no-install Bump version and publish, but skip global install\n -h, --help Show this help\n\nAuth:\n Uses NODE_AUTH_TOKEN or NPM_TOKEN when set; otherwise relies on npm login.\n\nExamples:\n npm run release:local\n npm run release:local -- minor\n npm run release:local -- 0.3.0\n NODE_AUTH_TOKEN=... npm run release:local -- patch\n`);
148
+ }
@@ -1,3 +1,3 @@
1
- This project is dual-licensed under the Unlicense and MIT licenses.
2
-
3
- You may use this code under the terms of either license.
1
+ This project is dual-licensed under the Unlicense and MIT licenses.
2
+
3
+ You may use this code under the terms of either license.
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2015 Andrew Gallant
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Andrew Gallant
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -1,24 +1,24 @@
1
- This is free and unencumbered software released into the public domain.
2
-
3
- Anyone is free to copy, modify, publish, use, compile, sell, or
4
- distribute this software, either in source code form or as a compiled
5
- binary, for any purpose, commercial or non-commercial, and by any
6
- means.
7
-
8
- In jurisdictions that recognize copyright laws, the author or authors
9
- of this software dedicate any and all copyright interest in the
10
- software to the public domain. We make this dedication for the benefit
11
- of the public at large and to the detriment of our heirs and
12
- successors. We intend this dedication to be an overt act of
13
- relinquishment in perpetuity of all present and future rights to this
14
- software under copyright law.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
- IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
- OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
- ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
- OTHER DEALINGS IN THE SOFTWARE.
23
-
24
- For more information, please refer to <http://unlicense.org/>
1
+ This is free and unencumbered software released into the public domain.
2
+
3
+ Anyone is free to copy, modify, publish, use, compile, sell, or
4
+ distribute this software, either in source code form or as a compiled
5
+ binary, for any purpose, commercial or non-commercial, and by any
6
+ means.
7
+
8
+ In jurisdictions that recognize copyright laws, the author or authors
9
+ of this software dedicate any and all copyright interest in the
10
+ software to the public domain. We make this dedication for the benefit
11
+ of the public at large and to the detriment of our heirs and
12
+ successors. We intend this dedication to be an overt act of
13
+ relinquishment in perpetuity of all present and future rights to this
14
+ software under copyright law.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ For more information, please refer to <http://unlicense.org/>
@@ -1,7 +1,7 @@
1
- {
2
- "name": "ripgrep",
3
- "version": "15.1.0",
4
- "source": "https://github.com/BurntSushi/ripgrep/releases/tag/15.1.0",
5
- "asset": "ripgrep-15.1.0-aarch64-apple-darwin.tar.gz",
6
- "installedAt": "2026-06-08T09:43:36.746Z"
7
- }
1
+ {
2
+ "name": "ripgrep",
3
+ "version": "15.1.0",
4
+ "source": "https://github.com/BurntSushi/ripgrep/releases/tag/15.1.0",
5
+ "asset": "ripgrep-15.1.0-aarch64-apple-darwin.tar.gz",
6
+ "installedAt": "2026-06-08T09:43:36.746Z"
7
+ }