@agentknight/client 0.9.41 → 0.9.43

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 CHANGED
@@ -61,8 +61,8 @@ Status and upgrade commands do not import or migrate configuration.
61
61
  A legacy `~/.copilot-remote` home is copied only while the old Agent is stopped,
62
62
  preserving its machine identity, pairing keys and saved state. The stable device
63
63
  ID now lives in `<home>/device-id` alongside `device.json`; existing identities
64
- are preserved when importing the old `.bluepaw` ID. Fresh custom homes have
65
- independent identities. No new `.bluepaw` directory or compatibility symlink is
64
+ are preserved when importing a retired client layout's ID. Fresh custom homes have
65
+ independent identities. No retired client directory or compatibility symlink is
66
66
  created. Conflicting identities or homes require manual resolution, not an
67
67
  automatic reset. Retained legacy files are rollback copies, never dual-written;
68
68
  remove them only after verifying the migrated installation while old agents are stopped.
@@ -220,10 +220,9 @@ Native agent configuration still comes from the environment file. Subsequent
220
220
  webpage Sync actions apply immediately and save the selection; the startup flag takes precedence
221
221
  again on restart. Managed mode also works with the local webpage disabled.
222
222
 
223
- Discovery reads native session inventories without resuming their conversations.
224
- AgentKnight can continue PI's saved sessions, but does not attach to an already
225
- running PI terminal. Avoid continuing the same native session concurrently in both
226
- applications. Provider credentials and history stay in their native stores.
223
+ PI discovery reads its native session inventory without resuming conversations.
224
+ AgentKnight can continue saved PI sessions, but cannot attach to a running PI
225
+ terminal. Avoid continuing the same session concurrently in both applications.
227
226
 
228
227
  In Android, choose **Rename** from a supported session's menu to change its native
229
228
  name, not a local display alias. Renaming a group changes only its title, not its
@@ -237,20 +236,22 @@ Groups connect two shared Copilot sessions on the same PC, in either managed or
237
236
  single-engine mode, including sessions created in the CLI or restored after a restart.
238
237
  Both participants must be idle with no pending input. After restarting, groups remain
239
238
  paused without replay; send a new group message to continue with the existing members.
240
- PI and ACP do not support groups.
239
+ Other engines do not support groups.
241
240
 
242
241
  For experimental online conversation between Copilot sessions on two PCs, see
243
242
  the [peer-chat setup](../../docs/remote-sessions/agent-group-chat-design.md#使用).
244
243
  It is separate from local groups and sends Relay-readable text.
245
244
  Use only non-sensitive test content.
246
245
 
247
- Explicit `copilot`, `pi`, or `acp` values retain single-engine operation without
246
+ Explicit engine values retain single-engine operation without
248
247
  selection filtering. See [.env.example](.env.example) for configuration.
249
248
 
250
249
  | Engine | Setup |
251
250
  | --- | --- |
252
251
  | `copilot` | Authenticate the GitHub Copilot CLI as before. |
253
- | `pi` | Requires Node.js >=22.19.0 and the optional PI dependencies from the [SDK manifest](../../shared/sdk/package.json). Authenticate PI using its own CLI (`/login`) or supported provider API-key environment variables. |
252
+ | `pi` | Install the optional PI dependencies using the Node.js version required by their manifests. Authenticate through PI's CLI or supported provider environment variables. |
253
+ | `codex` | Install and authenticate the [official Codex CLI](https://developers.openai.com/codex/cli/); executable overrides are in [.env.example](.env.example). |
254
+ | `claude` | Enable optional dependencies and follow the [official Agent SDK setup](https://platform.claude.com/docs/en/agent-sdk/overview) for API-key or cloud-provider authentication. Personal subscription OAuth is not reused. |
254
255
  | `acp` | Install and authenticate an ACP-compatible agent or bridge. Set `AGENTKNIGHT_ACP_COMMAND` to its executable and `AGENTKNIGHT_ACP_ARGS` to a JSON string array, such as `["--stdio"]` if that agent requires it. |
255
256
 
256
257
  PI uses its native directory by default. `PI_CODING_AGENT_DIR` selects an
@@ -260,6 +261,11 @@ AgentKnight with optional dependencies enabled to use PI.
260
261
  Source builds and the complete adapter suite also require the PI-compatible Node
261
262
  version; Copilot-only operation retains the baseline version in the manifest.
262
263
 
264
+ Codex (App Server) and Claude (Agent SDK) expose only AgentKnight-created
265
+ conversations and their saved history, not existing CLI/IDE conversations.
266
+ Credentials stay on the PC; discovery does not verify authentication.
267
+ Copilot-specific Workbench, group and peer-chat operations remain unsupported.
268
+
263
269
  The ACP executable must speak the Agent Client Protocol over stdio; an ordinary
264
270
  Codex or Claude Code CLI is not automatically an ACP endpoint. Arguments are
265
271
  passed literally, without a shell. AgentKnight does not download or authenticate
@@ -274,8 +280,8 @@ Machine-wide features such as uploads and deletion are available only when every
274
280
  selected engine supports them; session controls use that session's own engine.
275
281
  ACP approvals use the agent's offered one-time permission option, never an
276
282
  automatic persistent grant. Unsupported operations return errors rather than
277
- pretending to succeed. PI and ACP do not expose Copilot's remote-mode toggle.
278
- Generic file uploads remain Copilot-only; PI also rejects image uploads, while
283
+ pretending to succeed. Only Copilot exposes its remote-mode toggle.
284
+ Generic file uploads remain Copilot-only; PI, Codex and Claude also reject image uploads, while
279
285
  ACP images require the agent's negotiated image support.
280
286
 
281
287
  Optional controls follow the [capability compatibility policy](../../docs/remote-sessions/protocol-compatibility-plan.md);
package/dist/cli.js CHANGED
@@ -33,7 +33,7 @@ function readAppVersion() {
33
33
  }
34
34
 
35
35
  // src/cli-options.ts
36
- import { AgentSelectionSchema } from "@agentknight/sdk";
36
+ import { AgentSelectionSchema, CODING_AGENT_IDS } from "@agentknight/sdk";
37
37
  import { PeerChatRequestSchema } from "@agentknight/sdk";
38
38
  function parseCliOptions(args) {
39
39
  let envFile;
@@ -94,7 +94,7 @@ function parseCliOptions(args) {
94
94
  agents: value === "none" ? [] : value?.split(",").map((id) => id.trim())
95
95
  });
96
96
  if (!parsed.success) {
97
- throw new Error("--agents requires comma-separated copilot,pi,acp or none");
97
+ throw new Error(`--agents requires comma-separated ${CODING_AGENT_IDS.join(",")} or none`);
98
98
  }
99
99
  agents = parsed.data.agents;
100
100
  index += 1;
@@ -143,7 +143,7 @@ Usage:
143
143
 
144
144
  Options:
145
145
  --env <path> Use a file as the authoritative PC configuration
146
- --agents <list> Sync copilot,pi,acp (comma-separated), or none
146
+ --agents <list> Sync ${CODING_AGENT_IDS.join(",")} (comma-separated), or none
147
147
  -h, --help Show this help
148
148
  -v, --version Show the installed CLI version
149
149
 
@@ -1365,6 +1365,8 @@ function fileResultSchema(mediaTypes, extended) {
1365
1365
  }
1366
1366
  var SessionFileReadResultDataSchema = fileResultSchema(SESSION_FILE_MEDIA_TYPES, false);
1367
1367
  var SessionFileReadV2ResultDataSchema = fileResultSchema(SESSION_FILE_V2_MEDIA_TYPES, true);
1368
+ var SessionFileDownloadDataSchema = SessionFileReadDataSchema;
1369
+ var SessionFileDownloadResultDataSchema = fileResultSchema(["application/octet-stream"], true);
1368
1370
  var SessionGitProjectSchema = z13.object({
1369
1371
  localRepositoryKey: z13.string().length(43).regex(/^[A-Za-z0-9_-]{43}$/),
1370
1372
  worktreeRoot: z13.string().min(1).max(SESSION_PROJECT_IDENTITY_MAX_PATH_LENGTH),
@@ -3018,6 +3020,8 @@ var AndroidProtocolSchemas = {
3018
3020
  SessionFileReadData: SessionFileReadDataSchema,
3019
3021
  SessionFileReadResultData: SessionFileReadResultDataSchema,
3020
3022
  SessionFileReadV2ResultData: SessionFileReadV2ResultDataSchema,
3023
+ SessionFileDownloadData: SessionFileDownloadDataSchema,
3024
+ SessionFileDownloadResultData: SessionFileDownloadResultDataSchema,
3021
3025
  SessionResourceReadData: SessionResourceReadDataSchema,
3022
3026
  SessionResourceReadResultData: SessionResourceReadResultDataSchema,
3023
3027
  SessionDirectoryListRequest: SessionDirectoryListRequestSchema,
@@ -3109,6 +3113,7 @@ var AndroidProtocolSchemas = {
3109
3113
  // src/config.ts
3110
3114
  import {
3111
3115
  AgentSelectionSchema as AgentSelectionSchema2,
3116
+ CODING_AGENT_IDS as CODING_AGENT_IDS2,
3112
3117
  SessionImageRelayUrlSchema,
3113
3118
  SessionImagesConfigSchema
3114
3119
  } from "@agentknight/sdk";
@@ -3142,10 +3147,11 @@ var EnvironmentSchema = z28.object({
3142
3147
  AGENTKNIGHT_MACHINE_NAME: z28.string().trim().min(1).max(120).optional(),
3143
3148
  AGENTKNIGHT_HOME: z28.string().trim().min(1).optional(),
3144
3149
  AGENTKNIGHT_WORKSPACE_ROOT: z28.string().trim().min(1).optional(),
3145
- AGENTKNIGHT_CODING_AGENT: z28.enum(["managed", "copilot", "pi", "acp"]).default("managed"),
3150
+ AGENTKNIGHT_CODING_AGENT: z28.enum(["managed", ...CODING_AGENT_IDS2]).default("managed"),
3146
3151
  AGENTKNIGHT_GROUP_CHAT_ENABLED: EnabledBooleanStringSchema,
3147
3152
  AGENTKNIGHT_PEER_CHAT_ENABLED: EnabledBooleanStringSchema,
3148
3153
  PI_CODING_AGENT_DIR: OptionalPathSchema,
3154
+ AGENTKNIGHT_CODEX_COMMAND: OptionalPathSchema,
3149
3155
  AGENTKNIGHT_ACP_COMMAND: OptionalPathSchema,
3150
3156
  AGENTKNIGHT_ACP_ARGS: AcpArgumentsSchema,
3151
3157
  SESSION_REFRESH_INTERVAL_MS: z28.coerce.number().int().min(5e3).max(36e5).default(3e4),
@@ -3188,6 +3194,7 @@ function codingAgentConfig(environment) {
3188
3194
  case "managed":
3189
3195
  return {
3190
3196
  kind: "managed",
3197
+ ...environment.AGENTKNIGHT_CODEX_COMMAND === void 0 ? {} : { codexCommand: environment.AGENTKNIGHT_CODEX_COMMAND },
3191
3198
  ...environment.PI_CODING_AGENT_DIR === void 0 ? {} : { piDirectory: environment.PI_CODING_AGENT_DIR },
3192
3199
  ...environment.AGENTKNIGHT_ACP_COMMAND === void 0 ? {} : {
3193
3200
  acp: { command: environment.AGENTKNIGHT_ACP_COMMAND, args: environment.AGENTKNIGHT_ACP_ARGS }
@@ -3200,6 +3207,13 @@ function codingAgentConfig(environment) {
3200
3207
  kind: "pi",
3201
3208
  ...environment.PI_CODING_AGENT_DIR === void 0 ? {} : { agentDirectory: environment.PI_CODING_AGENT_DIR }
3202
3209
  };
3210
+ case "codex":
3211
+ return {
3212
+ kind: "codex",
3213
+ ...environment.AGENTKNIGHT_CODEX_COMMAND === void 0 ? {} : { command: environment.AGENTKNIGHT_CODEX_COMMAND }
3214
+ };
3215
+ case "claude":
3216
+ return { kind: "claude" };
3203
3217
  case "acp":
3204
3218
  if (environment.AGENTKNIGHT_ACP_COMMAND === void 0) {
3205
3219
  throw new Error("AGENTKNIGHT_ACP_COMMAND is required");
@@ -6832,7 +6846,7 @@ import { link, lstat as lstat2, mkdir as mkdir6, readFile as readFile5, readlink
6832
6846
  import { homedir as homedir3, hostname } from "node:os";
6833
6847
  import { dirname as dirname6, join as join12, resolve as resolve9 } from "node:path";
6834
6848
  import { z as z37 } from "zod";
6835
- import { DeviceIdentitySchema } from "@agentknight/sdk";
6849
+ import { DeviceIdentitySchema, LEGACY_CLIENT_STATE_DIRECTORY } from "@agentknight/sdk";
6836
6850
  import { DeviceIdentitySchema as DeviceIdentitySchema2 } from "@agentknight/sdk";
6837
6851
  var LegacyDeviceIdentitySchema = z37.object({
6838
6852
  schemaVersion: z37.literal(1),
@@ -6871,8 +6885,8 @@ async function requireDirectory(path) {
6871
6885
  }
6872
6886
  async function readLegacyStableDeviceId(userHome) {
6873
6887
  const defaultHome = defaultClientHome(userHome);
6874
- const movedRoot = join12(defaultHome, ".bluepaw");
6875
- const legacyRoot = join12(userHome, ".bluepaw");
6888
+ const movedRoot = join12(defaultHome, LEGACY_CLIENT_STATE_DIRECTORY);
6889
+ const legacyRoot = join12(userHome, LEGACY_CLIENT_STATE_DIRECTORY);
6876
6890
  const movedExists = await requireDirectory(defaultHome) && await requireDirectory(movedRoot);
6877
6891
  const legacyInfo = await optionalStat(legacyRoot);
6878
6892
  let legacyDirectory;