@prplkane/agentlink 0.3.0-beta.1 → 0.3.0-beta.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.
- package/README.md +1 -1
- package/docs/architecture.md +3 -0
- package/docs/laptop-testing.md +3 -3
- package/package.json +1 -1
- package/src/profiles.mjs +3 -2
- package/src/replace-file.mjs +14 -0
- package/src/storage.mjs +3 -2
- package/src/version.mjs +1 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@ bridges in your user account and exposes their actual capabilities through
|
|
|
6
6
|
standard ACP.
|
|
7
7
|
|
|
8
8
|
JavaScript / Node.js 22+. Zero npm runtime dependencies. Public beta
|
|
9
|
-
`0.3.0-beta.
|
|
9
|
+
`0.3.0-beta.2`; the API and CLI may change before a stable release.
|
|
10
10
|
Offline fixtures pass on Windows, Linux and macOS with Node 22 and 24.
|
|
11
11
|
[Live ACP qualification](docs/acp-qualification.md) records Codex, Claude and agy
|
|
12
12
|
results through Roundtable, including the initial chairman timeout, the successful
|
package/docs/architecture.md
CHANGED
|
@@ -77,6 +77,9 @@ only checked descendants of the managed installation directory.
|
|
|
77
77
|
Profile and bridge metadata are flushed before publication. A live-process
|
|
78
78
|
lease is atomically written without a durability flush: it does not need to
|
|
79
79
|
survive a machine restart when its owning process cannot survive either.
|
|
80
|
+
On Windows, atomic replacement retries file-sharing conflicts up to five times
|
|
81
|
+
with at most 750 ms of retry delay. A persistent failure leaves the old file in
|
|
82
|
+
place and reports the error; replacement never deletes the destination first.
|
|
80
83
|
|
|
81
84
|
No automatic deletion of previous versions occurs during an update. Users can
|
|
82
85
|
prune after sessions finish and optionally clear the download cache. External
|
package/docs/laptop-testing.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Testing the AgentLink public beta on another laptop
|
|
2
2
|
|
|
3
|
-
Use `@prplkane/agentlink@0.3.0-beta.
|
|
3
|
+
Use `@prplkane/agentlink@0.3.0-beta.2`. Node.js 22 or newer with npm is required.
|
|
4
4
|
AgentLink has no npm runtime dependencies; the agents and selected bridges have
|
|
5
5
|
their own dependencies. Do not copy profiles blindly between machines because
|
|
6
6
|
external executable paths are machine-specific.
|
|
@@ -8,14 +8,14 @@ external executable paths are machine-specific.
|
|
|
8
8
|
## Install once
|
|
9
9
|
|
|
10
10
|
~~~sh
|
|
11
|
-
npm install -g @prplkane/agentlink@0.3.0-beta.
|
|
11
|
+
npm install -g @prplkane/agentlink@0.3.0-beta.2
|
|
12
12
|
agentlink --version
|
|
13
13
|
agentlink --help
|
|
14
14
|
agentlink where
|
|
15
15
|
agentlink doctor
|
|
16
16
|
~~~
|
|
17
17
|
|
|
18
|
-
The version should be `0.3.0-beta.
|
|
18
|
+
The version should be `0.3.0-beta.2`. Installation of AgentLink alone downloads no
|
|
19
19
|
vendor bridge.
|
|
20
20
|
|
|
21
21
|
## Configure the agents you have
|
package/package.json
CHANGED
package/src/profiles.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { homedir } from 'node:os';
|
|
2
2
|
import { isAbsolute, join, resolve } from 'node:path';
|
|
3
|
-
import { link, mkdir, open, readdir, readFile,
|
|
3
|
+
import { link, mkdir, open, readdir, readFile, stat, unlink } from 'node:fs/promises';
|
|
4
4
|
import { randomUUID } from 'node:crypto';
|
|
5
|
+
import { replaceFile } from './replace-file.mjs';
|
|
5
6
|
|
|
6
7
|
export const error = (code, message) => Object.assign(new Error(message), { code });
|
|
7
8
|
export const strings = value => Array.isArray(value) && value.every(item => typeof item === 'string' && !item.includes('\0'));
|
|
@@ -88,7 +89,7 @@ export class ProfileStore {
|
|
|
88
89
|
finally { await handle.close(); }
|
|
89
90
|
// A hard link publishes a complete new file without overwriting another user's
|
|
90
91
|
// concurrent add. Updates use rename so readers see the old or the new JSON.
|
|
91
|
-
if (replace) await
|
|
92
|
+
if (replace) await replaceFile(temporary, destination);
|
|
92
93
|
else await link(temporary, destination);
|
|
93
94
|
} catch (cause) {
|
|
94
95
|
if (cause.code === 'EEXIST') throw error('PROFILE_EXISTS', `Profile "${profile.name}" already exists. Use update or refresh.`);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { rename } from 'node:fs/promises';
|
|
2
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
3
|
+
|
|
4
|
+
// Windows readers can briefly prevent replacing an otherwise writable file.
|
|
5
|
+
// Retry the same atomic rename; never unlink the destination to make it succeed.
|
|
6
|
+
export async function replaceFile(source, destination) {
|
|
7
|
+
for (let attempt = 0; ; attempt++) {
|
|
8
|
+
try { return await rename(source, destination); }
|
|
9
|
+
catch (cause) {
|
|
10
|
+
if (process.platform !== 'win32' || attempt === 5 || !['EACCES', 'EPERM', 'EBUSY'].includes(cause.code)) throw cause;
|
|
11
|
+
await delay(50 * (attempt + 1));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
package/src/storage.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { mkdir, open, readFile,
|
|
1
|
+
import { mkdir, open, readFile, stat, unlink } from 'node:fs/promises';
|
|
2
2
|
import { dirname, isAbsolute, relative, resolve, sep } from 'node:path';
|
|
3
3
|
import { randomUUID } from 'node:crypto';
|
|
4
4
|
import { error } from './profiles.mjs';
|
|
5
|
+
import { replaceFile } from './replace-file.mjs';
|
|
5
6
|
|
|
6
7
|
export function inside(root, path) {
|
|
7
8
|
const target = resolve(root, path);
|
|
@@ -27,7 +28,7 @@ export async function writeJson(path, value, { durable = true } = {}) {
|
|
|
27
28
|
if (durable) await handle.sync();
|
|
28
29
|
}
|
|
29
30
|
finally { await handle.close(); }
|
|
30
|
-
await
|
|
31
|
+
await replaceFile(temporary, path);
|
|
31
32
|
} finally { await unlink(temporary).catch(cause => { if (cause.code !== 'ENOENT') throw cause; }); }
|
|
32
33
|
}
|
|
33
34
|
|
package/src/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '0.3.0-beta.
|
|
1
|
+
export const version = '0.3.0-beta.2';
|