agent-yes 1.93.0 → 1.93.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.
- package/dist/{SUPPORTED_CLIS-ditH2qYc.js → SUPPORTED_CLIS-D7v7U04I.js} +3 -3
- package/dist/cli.js +4 -4
- package/dist/index.js +2 -2
- package/dist/{ts-aXo5XZpZ.js → ts-BqeQIQJL.js} +2 -2
- package/dist/{versionChecker-BUQrhOHS.js → versionChecker-DJNQd0qt.js} +2 -2
- package/package.json +1 -1
- package/ts/rustBinary.ts +51 -13
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as CLIS_CONFIG } from "./ts-
|
|
1
|
+
import { t as CLIS_CONFIG } from "./ts-BqeQIQJL.js";
|
|
2
2
|
import "./logger-B9h0djqx.js";
|
|
3
|
-
import "./versionChecker-
|
|
3
|
+
import "./versionChecker-DJNQd0qt.js";
|
|
4
4
|
import "./pidStore-DTzl6zeh.js";
|
|
5
5
|
import "./globalPidIndex-yVd3mbsV.js";
|
|
6
6
|
|
|
@@ -9,4 +9,4 @@ const SUPPORTED_CLIS = Object.keys(CLIS_CONFIG);
|
|
|
9
9
|
|
|
10
10
|
//#endregion
|
|
11
11
|
export { SUPPORTED_CLIS };
|
|
12
|
-
//# sourceMappingURL=SUPPORTED_CLIS-
|
|
12
|
+
//# sourceMappingURL=SUPPORTED_CLIS-D7v7U04I.js.map
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
import { n as logger } from "./logger-B9h0djqx.js";
|
|
3
|
-
import { i as versionString, n as displayVersion, r as getInstalledPackage, t as checkAndAutoUpdate } from "./versionChecker-
|
|
3
|
+
import { i as versionString, n as displayVersion, r as getInstalledPackage, t as checkAndAutoUpdate } from "./versionChecker-DJNQd0qt.js";
|
|
4
4
|
import { argv } from "process";
|
|
5
5
|
import { execFileSync, spawn } from "child_process";
|
|
6
6
|
import ms from "ms";
|
|
@@ -270,7 +270,7 @@ function getBinDir() {
|
|
|
270
270
|
const packageBinDir = path.resolve(import.meta.dirname ?? import.meta.dir, "../bin");
|
|
271
271
|
if (existsSync(packageBinDir)) return packageBinDir;
|
|
272
272
|
const cacheDir = process.env.AGENT_YES_CACHE_DIR || path.join(process.env.XDG_CACHE_HOME || path.join(process.env.HOME || "/tmp", ".cache"), "agent-yes");
|
|
273
|
-
return path.join(cacheDir, "bin");
|
|
273
|
+
return path.join(cacheDir, "bin", getInstalledPackage().version);
|
|
274
274
|
}
|
|
275
275
|
/**
|
|
276
276
|
* Find the Rust binary, checking multiple locations
|
|
@@ -310,7 +310,7 @@ async function downloadBinary(verbose = false) {
|
|
|
310
310
|
const binaryName = getBinaryName();
|
|
311
311
|
const binaryPath = path.join(binDir, binaryName);
|
|
312
312
|
mkdirSync(binDir, { recursive: true });
|
|
313
|
-
const url = getDownloadUrl();
|
|
313
|
+
const url = getDownloadUrl(getInstalledPackage().version);
|
|
314
314
|
if (verbose) console.log(`[rust] Downloading binary from: ${url}`);
|
|
315
315
|
const response = await fetch(url);
|
|
316
316
|
if (!response.ok) throw new Error(`Failed to download binary: ${response.status} ${response.statusText}`);
|
|
@@ -515,7 +515,7 @@ if (config.useRust) {
|
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
517
|
if (rustBinary) {
|
|
518
|
-
const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-
|
|
518
|
+
const { SUPPORTED_CLIS } = await import("./SUPPORTED_CLIS-D7v7U04I.js");
|
|
519
519
|
const rustArgs = buildRustArgs(process.argv, config.cli, SUPPORTED_CLIS);
|
|
520
520
|
if (config.verbose) {
|
|
521
521
|
console.log(`[rust] Using binary: ${rustBinary}`);
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-
|
|
1
|
+
import { a as removeControlCharacters, i as AgentContext, n as agentYes, r as config, t as CLIS_CONFIG } from "./ts-BqeQIQJL.js";
|
|
2
2
|
import "./logger-B9h0djqx.js";
|
|
3
|
-
import "./versionChecker-
|
|
3
|
+
import "./versionChecker-DJNQd0qt.js";
|
|
4
4
|
import "./pidStore-DTzl6zeh.js";
|
|
5
5
|
import "./globalPidIndex-yVd3mbsV.js";
|
|
6
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as logger, t as addTransport } from "./logger-B9h0djqx.js";
|
|
2
|
-
import { r as getInstalledPackage } from "./versionChecker-
|
|
2
|
+
import { r as getInstalledPackage } from "./versionChecker-DJNQd0qt.js";
|
|
3
3
|
import { i as shouldUseLock, r as releaseLock, t as acquireLock } from "./runningLock-C22d9SRJ.js";
|
|
4
4
|
import { t as PidStore } from "./pidStore-DTzl6zeh.js";
|
|
5
5
|
import { i as readGlobalPids } from "./globalPidIndex-yVd3mbsV.js";
|
|
@@ -1705,4 +1705,4 @@ function sleep(ms) {
|
|
|
1705
1705
|
|
|
1706
1706
|
//#endregion
|
|
1707
1707
|
export { removeControlCharacters as a, AgentContext as i, agentYes as n, config as r, CLIS_CONFIG as t };
|
|
1708
|
-
//# sourceMappingURL=ts-
|
|
1708
|
+
//# sourceMappingURL=ts-BqeQIQJL.js.map
|
|
@@ -7,7 +7,7 @@ import { fileURLToPath } from "url";
|
|
|
7
7
|
|
|
8
8
|
//#region package.json
|
|
9
9
|
var name = "agent-yes";
|
|
10
|
-
var version = "1.93.
|
|
10
|
+
var version = "1.93.1";
|
|
11
11
|
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region ts/versionChecker.ts
|
|
@@ -221,4 +221,4 @@ async function displayVersion() {
|
|
|
221
221
|
|
|
222
222
|
//#endregion
|
|
223
223
|
export { versionString as i, displayVersion as n, getInstalledPackage as r, checkAndAutoUpdate as t };
|
|
224
|
-
//# sourceMappingURL=versionChecker-
|
|
224
|
+
//# sourceMappingURL=versionChecker-DJNQd0qt.js.map
|
package/package.json
CHANGED
package/ts/rustBinary.ts
CHANGED
|
@@ -41,20 +41,32 @@ export function getBinaryName(): string {
|
|
|
41
41
|
*/
|
|
42
42
|
export function getBinDir(): string {
|
|
43
43
|
// First check for binaries in the npm package
|
|
44
|
-
const packageBinDir = path.resolve(
|
|
44
|
+
const packageBinDir = path.resolve(
|
|
45
|
+
import.meta.dirname ?? import.meta.dir,
|
|
46
|
+
"../bin",
|
|
47
|
+
);
|
|
45
48
|
if (existsSync(packageBinDir)) {
|
|
46
49
|
return packageBinDir;
|
|
47
50
|
}
|
|
48
51
|
|
|
49
|
-
// Fall back to user's cache directory
|
|
52
|
+
// Fall back to user's cache directory.
|
|
53
|
+
//
|
|
54
|
+
// IMPORTANT: scope the cache by package version. The download cache is shared
|
|
55
|
+
// across every agent-yes version a user has ever run, but the binary filename
|
|
56
|
+
// (e.g. agent-yes-win32-x64.exe) is NOT version-qualified — so without a
|
|
57
|
+
// version segment, findRustBinary() would happily return a stale binary that a
|
|
58
|
+
// previous (older) release downloaded, and a published binary fix would never
|
|
59
|
+
// reach a machine that already has one cached. A version segment makes a new
|
|
60
|
+
// release miss the path and re-download; old binaries sit harmlessly beside it.
|
|
50
61
|
const cacheDir =
|
|
51
62
|
process.env.AGENT_YES_CACHE_DIR ||
|
|
52
63
|
path.join(
|
|
53
|
-
process.env.XDG_CACHE_HOME ||
|
|
64
|
+
process.env.XDG_CACHE_HOME ||
|
|
65
|
+
path.join(process.env.HOME || "/tmp", ".cache"),
|
|
54
66
|
"agent-yes",
|
|
55
67
|
);
|
|
56
68
|
|
|
57
|
-
return path.join(cacheDir, "bin");
|
|
69
|
+
return path.join(cacheDir, "bin", getInstalledPackage().version);
|
|
58
70
|
}
|
|
59
71
|
|
|
60
72
|
/**
|
|
@@ -66,8 +78,14 @@ export function findRustBinary(verbose = false): string | undefined {
|
|
|
66
78
|
const ext = process.platform === "win32" ? ".exe" : "";
|
|
67
79
|
const searchPaths = [
|
|
68
80
|
// 1. Check relative to this script (in the repo during development)
|
|
69
|
-
path.resolve(
|
|
70
|
-
|
|
81
|
+
path.resolve(
|
|
82
|
+
import.meta.dirname ?? import.meta.dir,
|
|
83
|
+
`../rs/target/release/agent-yes${ext}`,
|
|
84
|
+
),
|
|
85
|
+
path.resolve(
|
|
86
|
+
import.meta.dirname ?? import.meta.dir,
|
|
87
|
+
`../rs/target/debug/agent-yes${ext}`,
|
|
88
|
+
),
|
|
71
89
|
|
|
72
90
|
// 2. Check in npm package bin directory
|
|
73
91
|
path.join(getBinDir(), binaryName),
|
|
@@ -119,14 +137,21 @@ export async function downloadBinary(verbose = false): Promise<string> {
|
|
|
119
137
|
// Create bin directory if needed
|
|
120
138
|
mkdirSync(binDir, { recursive: true });
|
|
121
139
|
|
|
122
|
-
|
|
140
|
+
// Pin the download to THIS package's version, not "latest". The shim is
|
|
141
|
+
// version-pinned by bunx/npm, so its binary must match — pulling "latest"
|
|
142
|
+
// could fetch a newer binary than the shim expects, and is incoherent with
|
|
143
|
+
// the version-scoped cache dir above. The release flow guarantees vX's
|
|
144
|
+
// binaries are uploaded before agent-yes@X is published.
|
|
145
|
+
const url = getDownloadUrl(getInstalledPackage().version);
|
|
123
146
|
if (verbose) {
|
|
124
147
|
console.log(`[rust] Downloading binary from: ${url}`);
|
|
125
148
|
}
|
|
126
149
|
|
|
127
150
|
const response = await fetch(url);
|
|
128
151
|
if (!response.ok) {
|
|
129
|
-
throw new Error(
|
|
152
|
+
throw new Error(
|
|
153
|
+
`Failed to download binary: ${response.status} ${response.statusText}`,
|
|
154
|
+
);
|
|
130
155
|
}
|
|
131
156
|
|
|
132
157
|
const isWindows = process.platform === "win32";
|
|
@@ -218,14 +243,19 @@ function getRustBinaryVersion(binaryPath: string): string | null {
|
|
|
218
243
|
*/
|
|
219
244
|
function autoRebuildIfOutdated(binaryPath: string, verbose: boolean): boolean {
|
|
220
245
|
// Only auto-rebuild for local dev builds (target/release or target/debug)
|
|
221
|
-
if (
|
|
246
|
+
if (
|
|
247
|
+
!binaryPath.includes("/target/release") &&
|
|
248
|
+
!binaryPath.includes("/target/debug")
|
|
249
|
+
) {
|
|
222
250
|
return true; // not a dev build, skip
|
|
223
251
|
}
|
|
224
252
|
|
|
225
253
|
const binaryVersion = getRustBinaryVersion(binaryPath);
|
|
226
254
|
const pkgVersion = getInstalledPackage().version;
|
|
227
255
|
if (verbose) {
|
|
228
|
-
console.log(
|
|
256
|
+
console.log(
|
|
257
|
+
`[rust] Binary version: ${binaryVersion}, package version: ${pkgVersion}`,
|
|
258
|
+
);
|
|
229
259
|
}
|
|
230
260
|
|
|
231
261
|
if (binaryVersion === pkgVersion) {
|
|
@@ -233,9 +263,15 @@ function autoRebuildIfOutdated(binaryPath: string, verbose: boolean): boolean {
|
|
|
233
263
|
}
|
|
234
264
|
|
|
235
265
|
// Find the rs/ directory relative to the binary (binary is at rs/target/release/agent-yes)
|
|
236
|
-
const rsDir = binaryPath.replace(
|
|
266
|
+
const rsDir = binaryPath.replace(
|
|
267
|
+
/\/target\/(release|debug)\/agent-yes.*$/,
|
|
268
|
+
"",
|
|
269
|
+
);
|
|
237
270
|
if (!existsSync(path.join(rsDir, "Cargo.toml"))) {
|
|
238
|
-
if (verbose)
|
|
271
|
+
if (verbose)
|
|
272
|
+
console.log(
|
|
273
|
+
`[rust] Cannot find Cargo.toml at ${rsDir}, skipping rebuild`,
|
|
274
|
+
);
|
|
239
275
|
return true; // can't rebuild, use as-is
|
|
240
276
|
}
|
|
241
277
|
|
|
@@ -263,7 +299,9 @@ function autoRebuildIfOutdated(binaryPath: string, verbose: boolean): boolean {
|
|
|
263
299
|
process.stderr.write(`\x1b[32m[rust] Rebuild complete\x1b[0m\n`);
|
|
264
300
|
return true;
|
|
265
301
|
} catch {
|
|
266
|
-
process.stderr.write(
|
|
302
|
+
process.stderr.write(
|
|
303
|
+
`\x1b[31m[rust] Auto-rebuild failed, using outdated binary\x1b[0m\n`,
|
|
304
|
+
);
|
|
267
305
|
return true; // still usable, just old
|
|
268
306
|
}
|
|
269
307
|
}
|