@agentknight/client 0.9.57 → 0.9.61
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 +19 -4
- package/dist/chunks/{aad-relay-login-ZG4FN7LM.js → aad-relay-login-PN2MTPBR.js} +2 -2
- package/dist/chunks/{chunk-CG5LD6VF.js → chunk-ANVWLKOO.js} +1 -1
- package/dist/chunks/{chunk-RL6LR7TK.js → chunk-CH7J4KFA.js} +1 -1
- package/dist/chunks/{chunk-CTJU4IKL.js → chunk-GEXDYCVI.js} +11 -7
- package/dist/chunks/{chunk-RSYKNJHT.js → chunk-GH26GIXM.js} +1066 -818
- package/dist/chunks/{chunk-WZIU4HVH.js → chunk-WMAAFZJ3.js} +3 -9
- package/dist/chunks/{local-sessions-NLGDAJ2G.js → local-sessions-T4LOKU66.js} +1 -1
- package/dist/chunks/{runtime-CTACRJCK.js → runtime-QUFPIXMR.js} +1 -1
- package/dist/chunks/{start-client-C3PCBF25.js → start-client-UO73N3B7.js} +65 -13
- package/dist/chunks/{stop-client-PHRAMW5R.js → stop-client-OXQVYCBB.js} +1 -1
- package/dist/chunks/{upgrade-4IKPYFYS.js → upgrade-UFKH6YNE.js} +2 -2
- package/dist/cli.js +6 -6
- package/dist/upgrade-worker.js +344 -111
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -182,15 +182,20 @@ After approval, AgentKnight saves the machine-bound Relay credential in the
|
|
|
182
182
|
current OS user's credential store, confirms it with Relay, and connects. The
|
|
183
183
|
normal local page provides Android pairing: scan the QR code, match the verification
|
|
184
184
|
code, and approve on the PC. Manage and revoke individual clients on that page.
|
|
185
|
+
For PWA pairing, copy the string displayed below the QR code into the web app's
|
|
186
|
+
pairing input on the same Relay. It expires with the QR and still requires PC approval.
|
|
185
187
|
Upgrade Relay and Android before the PC; existing phones must pair again when
|
|
186
188
|
approval is first enabled.
|
|
187
189
|
See the [approval compatibility policy](../../docs/remote-sessions/protocol-compatibility-plan.md#手机连接审批与撤销)
|
|
188
190
|
for migration and revocation limits. Microsoft sign-in does not replace the
|
|
189
191
|
PC–phone encryption key or authenticate GitHub Copilot.
|
|
190
192
|
|
|
191
|
-
Microsoft sign-in supports Windows Credential Manager
|
|
192
|
-
|
|
193
|
-
|
|
193
|
+
Microsoft sign-in supports Windows Credential Manager, macOS Keychain, and Linux
|
|
194
|
+
Secret Service. On Linux, install and unlock a persistent keyring such as GNOME
|
|
195
|
+
Keyring. Login and headless startup must use the same user's D-Bus session and
|
|
196
|
+
keyring; an isolated service or SSH session does not provide these automatically.
|
|
197
|
+
There is no plaintext or nonpersistent-keyring fallback; existing token
|
|
198
|
+
authentication is unchanged.
|
|
194
199
|
Run the service as the same OS user who signed in. Restarts reuse the saved
|
|
195
200
|
credential; no Microsoft password, browser cookie or client secret is stored by
|
|
196
201
|
the PC Agent.
|
|
@@ -214,7 +219,8 @@ revoke this PC: use the Relay's `/account` page to revoke its grant.
|
|
|
214
219
|
### Existing tokens
|
|
215
220
|
|
|
216
221
|
An existing `RELAY_TOKEN` continues to select token authentication unless
|
|
217
|
-
`RELAY_AUTH` explicitly selects another mode
|
|
222
|
+
`RELAY_AUTH` explicitly selects another mode; use `RELAY_AUTH=microsoft` to switch
|
|
223
|
+
to personal-account sign-in. Microsoft sign-in uses the server's
|
|
218
224
|
returned user identity, not `USER_ID`, and never falls back to the old token on
|
|
219
225
|
failure. Keep legacy tokens in the environment file, not command-line arguments
|
|
220
226
|
or source control.
|
|
@@ -322,6 +328,15 @@ credentials; sending requires the authentication described above.
|
|
|
322
328
|
Credentials stay on the PC; discovery does not verify authentication.
|
|
323
329
|
Copilot-specific Workbench, group and peer-chat operations remain unsupported.
|
|
324
330
|
|
|
331
|
+
Windows MSIX uses a separately installed native Claude CLI for model work; history
|
|
332
|
+
remains available without it. The official native installation is discovered
|
|
333
|
+
automatically, or set `AGENTKNIGHT_CLAUDE_COMMAND` to its absolute executable path.
|
|
334
|
+
Shell/npm shims are unsupported; errors report the exact compatible CLI version.
|
|
335
|
+
AgentKnight never downloads a CLI. Full npm/portable installs retain their bundled CLI.
|
|
336
|
+
|
|
337
|
+
Copilot uses its bundled CLI over stdio. MSIX omits the alternative inprocess
|
|
338
|
+
runtime; leave `COPILOT_SDK_DEFAULT_CONNECTION` unset or set to `stdio`.
|
|
339
|
+
|
|
325
340
|
Codex controls depend on the installed CLI's [App Server capabilities](https://developers.openai.com/codex/app-server/).
|
|
326
341
|
Changes require an idle session and affect its subsequent turns, not approval or
|
|
327
342
|
sandbox permissions.
|
|
@@ -18,7 +18,7 @@ function toErrorDetails(error) {
|
|
|
18
18
|
// src/app-version.ts
|
|
19
19
|
import { readFileSync } from "node:fs";
|
|
20
20
|
function readAppVersion() {
|
|
21
|
-
if (true) return "0.9.
|
|
21
|
+
if (true) return "0.9.61";
|
|
22
22
|
const metadata = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
23
23
|
if (typeof metadata !== "object" || metadata === null || !("version" in metadata) || typeof metadata.version !== "string" || metadata.version.length === 0) {
|
|
24
24
|
throw new Error("AgentKnight package metadata does not contain a version");
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
PcEnrollmentIdSchema,
|
|
6
6
|
PcEnrollmentStartRequestSchema,
|
|
7
7
|
PcEnrollmentVerifierRequestSchema
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-GH26GIXM.js";
|
|
9
9
|
|
|
10
10
|
// src/aad-relay-login.ts
|
|
11
11
|
import { createHash as createHash2 } from "node:crypto";
|
|
@@ -18,11 +18,12 @@ import { brotliCompressSync, brotliDecompressSync } from "node:zlib";
|
|
|
18
18
|
import { z } from "zod";
|
|
19
19
|
var STORE_MESSAGES = {
|
|
20
20
|
unavailable: "Unlock your operating system credential store and restart AgentKnight. No file-based credential fallback is available.",
|
|
21
|
+
linuxUnavailable: "Start or unlock a Secret Service keyring (such as GNOME Keyring) in the same user's D-Bus session, then retry. No file-based or in-memory credential fallback is available.",
|
|
21
22
|
invalid: "The saved Relay credential is invalid. Recover it in your operating system credential manager before signing in.",
|
|
22
23
|
conflict: "A different Relay account or enrollment is already saved for this PC. Resolve it before signing in again.",
|
|
23
24
|
verification: "The operating system credential store did not retain the credential. Unlock it and restart AgentKnight.",
|
|
24
25
|
address: "Use an HTTPS Relay origin without a path, credentials, query, or fragment. HTTP is allowed only for literal loopback addresses.",
|
|
25
|
-
unsupported: "Microsoft sign-in requires Windows Credential Manager or
|
|
26
|
+
unsupported: "Microsoft sign-in requires Windows Credential Manager, macOS Keychain, or Linux Secret Service. This operating system is not supported.",
|
|
26
27
|
tooLarge: "The Relay credential exceeds the operating system credential store capacity. Existing credentials were not changed. Contact your Relay administrator."
|
|
27
28
|
};
|
|
28
29
|
var MAX_RECORD_BYTES = 32 * 1024;
|
|
@@ -36,6 +37,9 @@ var RelayCredentialStoreError = class extends Error {
|
|
|
36
37
|
}
|
|
37
38
|
code;
|
|
38
39
|
};
|
|
40
|
+
function unavailableStoreError() {
|
|
41
|
+
return new RelayCredentialStoreError(platform() === "linux" ? "linuxUnavailable" : "unavailable");
|
|
42
|
+
}
|
|
39
43
|
function normalizeRelayOrigin(value) {
|
|
40
44
|
try {
|
|
41
45
|
const url = new URL(value);
|
|
@@ -136,7 +140,7 @@ var OsRelayCredentialStore = class {
|
|
|
136
140
|
}
|
|
137
141
|
return validateRelayCredentialSlots(value, this.relayUrl, this.machineId);
|
|
138
142
|
} catch (error) {
|
|
139
|
-
throw error instanceof RelayCredentialStoreError ? error :
|
|
143
|
+
throw error instanceof RelayCredentialStoreError ? error : unavailableStoreError();
|
|
140
144
|
}
|
|
141
145
|
}
|
|
142
146
|
savePending(credential) {
|
|
@@ -201,7 +205,7 @@ var OsRelayCredentialStore = class {
|
|
|
201
205
|
try {
|
|
202
206
|
return await action();
|
|
203
207
|
} catch (error) {
|
|
204
|
-
throw error instanceof RelayCredentialStoreError ? error :
|
|
208
|
+
throw error instanceof RelayCredentialStoreError ? error : unavailableStoreError();
|
|
205
209
|
} finally {
|
|
206
210
|
release();
|
|
207
211
|
if (transactions.get(this.key) === completion) transactions.delete(this.key);
|
|
@@ -210,7 +214,7 @@ var OsRelayCredentialStore = class {
|
|
|
210
214
|
};
|
|
211
215
|
async function createRelayCredentialStore(relayUrl, machineId) {
|
|
212
216
|
const os = platform();
|
|
213
|
-
if (os !== "win32" && os !== "darwin") throw new RelayCredentialStoreError("unsupported");
|
|
217
|
+
if (os !== "win32" && os !== "darwin" && os !== "linux") throw new RelayCredentialStoreError("unsupported");
|
|
214
218
|
const origin = normalizeRelayOrigin(relayUrl);
|
|
215
219
|
if (!PcEnrollmentStartRequestSchema.shape.machineId.safeParse(machineId).success) {
|
|
216
220
|
throw new RelayCredentialStoreError("invalid");
|
|
@@ -218,7 +222,7 @@ async function createRelayCredentialStore(relayUrl, machineId) {
|
|
|
218
222
|
const username = createHash("sha256").update(JSON.stringify([origin, machineId])).digest("hex");
|
|
219
223
|
try {
|
|
220
224
|
const { AsyncEntry } = await import("@napi-rs/keyring");
|
|
221
|
-
const entry = new AsyncEntry("AgentKnight Relay", username);
|
|
225
|
+
const entry = os === "linux" ? new AsyncEntry("AgentKnight Relay", username, { linux: { store: "secret-service" } }) : new AsyncEntry("AgentKnight Relay", username);
|
|
222
226
|
return new OsRelayCredentialStore(
|
|
223
227
|
entry,
|
|
224
228
|
username,
|
|
@@ -227,7 +231,7 @@ async function createRelayCredentialStore(relayUrl, machineId) {
|
|
|
227
231
|
os === "win32" ? WINDOWS_MAX_SECRET_BYTES : MAX_RECORD_BYTES
|
|
228
232
|
);
|
|
229
233
|
} catch {
|
|
230
|
-
throw
|
|
234
|
+
throw unavailableStoreError();
|
|
231
235
|
}
|
|
232
236
|
}
|
|
233
237
|
|