agent-embassy 1.9.4 → 2.0.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.
Files changed (72) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/CONTRIBUTING.md +1 -1
  3. package/README.md +28 -21
  4. package/README.zh-CN.md +26 -20
  5. package/dist/src/gateway/claude-helper-protocol.d.ts +1 -1
  6. package/dist/src/gateway/claude-helper-protocol.js +3 -2
  7. package/dist/src/gateway/claude-helper-protocol.js.map +1 -1
  8. package/dist/src/gateway/claude-helper-supervisor.d.ts +1 -1
  9. package/dist/src/gateway/claude-helper-supervisor.js +1 -1
  10. package/dist/src/gateway/claude-helper-supervisor.js.map +1 -1
  11. package/dist/src/gateway/claude-helper.js +12 -4
  12. package/dist/src/gateway/claude-helper.js.map +1 -1
  13. package/dist/src/gateway/cli-copy.d.ts +1 -1
  14. package/dist/src/gateway/cli-copy.en.d.ts +9 -4
  15. package/dist/src/gateway/cli-copy.en.js +10 -6
  16. package/dist/src/gateway/cli-copy.en.js.map +1 -1
  17. package/dist/src/gateway/cli-copy.js +5 -0
  18. package/dist/src/gateway/cli-copy.js.map +1 -1
  19. package/dist/src/gateway/cli-copy.zh-CN.d.ts +9 -4
  20. package/dist/src/gateway/cli-copy.zh-CN.js +10 -6
  21. package/dist/src/gateway/cli-copy.zh-CN.js.map +1 -1
  22. package/dist/src/gateway/cli.d.ts +3 -9
  23. package/dist/src/gateway/cli.js +56 -63
  24. package/dist/src/gateway/cli.js.map +1 -1
  25. package/dist/src/gateway/codex-local-transport.d.ts +1 -1
  26. package/dist/src/gateway/codex-local-transport.js +2 -2
  27. package/dist/src/gateway/codex-local-transport.js.map +1 -1
  28. package/dist/src/gateway/config.d.ts +4 -3
  29. package/dist/src/gateway/config.js +5 -11
  30. package/dist/src/gateway/config.js.map +1 -1
  31. package/dist/src/gateway/control.d.ts +20 -41
  32. package/dist/src/gateway/control.js +54 -96
  33. package/dist/src/gateway/control.js.map +1 -1
  34. package/dist/src/gateway/dashboard-copy.en.js +2 -2
  35. package/dist/src/gateway/dashboard-copy.en.js.map +1 -1
  36. package/dist/src/gateway/dashboard-copy.zh-CN.js +2 -2
  37. package/dist/src/gateway/dashboard-copy.zh-CN.js.map +1 -1
  38. package/dist/src/gateway/federation-nodes.d.ts +1 -2
  39. package/dist/src/gateway/federation-nodes.js +29 -14
  40. package/dist/src/gateway/federation-nodes.js.map +1 -1
  41. package/dist/src/gateway/live-dashboard-app/app.js +2 -2
  42. package/dist/src/gateway/live-dashboard-command.d.ts +3 -1
  43. package/dist/src/gateway/live-dashboard-command.js +1 -1
  44. package/dist/src/gateway/live-dashboard-command.js.map +1 -1
  45. package/dist/src/gateway/peer-protocol.d.ts +1 -0
  46. package/dist/src/gateway/peer-protocol.js +5 -0
  47. package/dist/src/gateway/peer-protocol.js.map +1 -1
  48. package/dist/src/gateway/providers.d.ts +3 -3
  49. package/dist/src/gateway/providers.js +7 -10
  50. package/dist/src/gateway/providers.js.map +1 -1
  51. package/dist/src/gateway/server.d.ts +1 -2
  52. package/dist/src/gateway/server.js +6 -13
  53. package/dist/src/gateway/server.js.map +1 -1
  54. package/dist/src/gateway/service.d.ts +3 -1
  55. package/dist/src/gateway/service.js +93 -39
  56. package/dist/src/gateway/service.js.map +1 -1
  57. package/dist/src/gateway/store.d.ts +1 -1
  58. package/dist/src/gateway/store.js +30 -29
  59. package/dist/src/gateway/store.js.map +1 -1
  60. package/dist/src/gateway/types.d.ts +4 -4
  61. package/docs/CONFIGURATION.md +27 -21
  62. package/docs/CONFIGURATION.zh-CN.md +19 -15
  63. package/docs/DASHBOARD.md +1 -1
  64. package/docs/DASHBOARD.zh-CN.md +1 -1
  65. package/docs/DELIVERY.md +2 -2
  66. package/docs/DELIVERY.zh-CN.md +2 -2
  67. package/docs/GATEWAY-ARCHITECTURE.md +48 -58
  68. package/package.json +1 -1
  69. package/skills/embassy-peer/SKILL.md +20 -15
  70. package/dist/src/gateway/state-v2-to-v3.d.ts +0 -24
  71. package/dist/src/gateway/state-v2-to-v3.js +0 -1034
  72. package/dist/src/gateway/state-v2-to-v3.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"claude-helper.js","sourceRoot":"","sources":["../../../src/gateway/claude-helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAwD,MAAM,kBAAkB,CAAC;AAC3G,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAErE,OAAO,EACL,+BAA+B,EAAE,iCAAiC,EAClE,oCAAoC,EACpC,iCAAiC,GAGlC,MAAM,6BAA6B,CAAC;AAGrC,MAAM,IAAI,GAAG,CAAC,KAAc,EAA0C,EAAE,CAAC,KAAK,YAAY,WAAW;IACnG,wBAAwB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;IAClG,EAAE,IAAI,EAAE,uCAAuC,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC;AACxE,MAAM,EAAE,GAAG,GAA2B,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AACxD,SAAS,IAAI,CAAC,KAAqC;IACjD,+BAA+B,CAAC,KAAK,CAAC,CAAC;IACvC,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS;QAAE,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC,CAAC;IAC9G,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,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AAC,MAAM,KAAK,OAAO;oBAAE,MAAM,QAAQ,EAAE,CAAC;YAAC,CAAC;YAC/H,OAAO,KAAK,EAAE,CAAC;gBAAC,MAAM,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;gBAAC,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY;oBAAE,MAAM,QAAQ,EAAE,CAAC;YAAC,CAAC;QAAC,CAAC,CAAC;aACnI,OAAO,CAAC,GAAG,EAAE,GAAG,QAAQ,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;IAAE,KAAK,4BAA4B,EAAE,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { DashboardLocale } from "./locale.js";
2
- export declare const cliCopyKeys: readonly ["help.usage", "hint.dashboardLiveRequired", "hint.dashboardPortInUse", "hint.controlInvalidResponse", "hint.messageTooLarge", "hint.progressWatchOwnerConflict", "error.input", "error.decision", "error.unavailable", "error.ambiguous", "error.failure", "error.unsafe", "error.tokenUnknown", "error.deliveryTimeout"];
2
+ export declare const cliCopyKeys: readonly ["help.usage", "hint.dashboardLiveRequired", "hint.dashboardPortInUse", "hint.controlConnectDenied", "hint.controlInvalidResponse", "hint.controlVersionMismatch", "hint.stateAccessDenied", "hint.messageTooLarge", "hint.nodeInventoryRequired", "hint.progressWatchOwnerConflict", "hint.stateResetRequired", "error.input", "error.decision", "error.unavailable", "error.ambiguous", "error.failure", "error.unsafe", "error.tokenUnknown", "error.deliveryTimeout"];
3
3
  export type CliCopyKey = (typeof cliCopyKeys)[number];
4
4
  export type CliCopy = Readonly<Record<CliCopyKey, string>>;
5
5
  export type CliStderrKind = {
@@ -1,17 +1,22 @@
1
- export declare const callerIdentityConflictHintEn = "both agent identities were inherited; the Codex App Server daemon may have been started inside an agent session. From a normal terminal, run: codex app-server daemon restart";
1
+ export declare const callerIdentityConflictHintEn = "both agent identities were inherited; rerun this Codex-side call with env -u CLAUDE_CODE_MESSAGING_SOCKET, or this Claude-side call with env -u CODEX_THREAD_ID";
2
2
  export declare const cliCopyEn: {
3
- readonly "help.usage": "Embassy — local messaging for Claude Code and Codex\n\nUsage:\n embassy <command> [options] [--lang en|zh-CN]\n\nCommands:\n serve [--inbound open] Run the socket-only broker (paired inbound by default)\n health Check broker health\n status Read the public status snapshot\n doctor Diagnose Codex Desktop attachment\n convert-state-v2-to-v3 Convert stopped-broker state after making a backup\n refresh-dashboard Refresh discovery and publish both static dashboards\n dashboard --live [--port <n>]\n Open live status and bounded route consent\n register-codex Register or succeed a Codex task\n unregister-codex Unregister the current Codex task\n register-peer --alias <peer-alias> [--token-stdin|--emit-env]\n Register a universal shell peer\n unregister-peer --alias <peer-alias> [--token-stdin]\n Unregister a universal shell peer\n await --alias <peer-alias> [--token-stdin]\n Wait for one peer message and acknowledge stdout\n select-claude Select a discovered Claude session\n unselect-claude Clear the Claude selection\n pair [--from <alias> --to <alias>] Add one cross-provider consent edge\n unpair [--from <alias> --to <alias>] Remove one cross-provider consent edge\n send-to-claude Send stdin to the selected Claude route\n send-to-codex Send stdin to a registered Codex route\n reply Reply with a conversation token\n delivery-status Read a delivery token\n wait-delivery Wait for terminal delivery status\n untrack Close one active progress watch\n\nOptions:\n --lang en|zh-CN Localize user-facing text\n --token-stdin Read the peer token as the first LF-terminated stdin line\n --emit-env Print the first registration token as an export command\n --port <n> Live dashboard port, 1024–65535 (default 41961)\n --version, -v Print the version\n --help, -h Show this help\n";
3
+ readonly "help.usage": "Embassy — local messaging for Claude Code and Codex\n\nUsage:\n embassy <command> [options] [--lang en|zh-CN]\n\nCommands:\n serve [--inbound open] Run the socket-only broker (paired inbound by default)\n health Check broker health\n status Read the public status snapshot\n doctor Diagnose Codex Desktop attachment\n refresh-dashboard Refresh discovery and publish both static dashboards\n dashboard --live [--port <n>]\n Open live status and bounded route consent\n register-codex Register or succeed a Codex task\n unregister-codex Unregister the current Codex task\n register-peer --alias <peer-alias> [--token-stdin|--emit-env]\n Register a universal shell peer\n unregister-peer --alias <peer-alias> [--token-stdin]\n Unregister a universal shell peer\n await --alias <peer-alias> [--token-stdin]\n Wait for one peer message and acknowledge stdout\n peer-stdio Serve the bounded federation protocol on stdin/stdout\n select-claude Select a discovered Claude session\n unselect-claude Clear the Claude selection\n pair [--from <alias> --to <alias>] Add one cross-provider consent edge\n unpair [--from <alias> --to <alias>] Remove one cross-provider consent edge\n send Send stdin between paired provider routes\n reply Reply with a conversation token\n delivery-status Read a delivery token\n wait-delivery Wait for terminal delivery status\n untrack Close one active progress watch\n\nOptions:\n --lang en|zh-CN Localize user-facing text\n --token-stdin Read the peer token as the first LF-terminated stdin line\n --emit-env Print the first registration token as an export command\n --port <n> Live dashboard port, 1024–65535 (default 41961)\n --version, -v Print the version\n --help, -h Show this help\n";
4
4
  readonly "hint.dashboardLiveRequired": "dashboard requires --live; static files are published by serve and refresh-dashboard.";
5
5
  readonly "hint.dashboardPortInUse": "live dashboard port {port} is already in use; close the holding process or choose another with --port <n>.";
6
- readonly "hint.controlInvalidResponse": "client/broker version skew is likely; rebuild or repoint this client to the broker's Embassy installation, then retry.";
6
+ readonly "hint.controlConnectDenied": "the broker may be running, but this process cannot connect; grant this task write access to the gateway state directory, then retry. Do not start a second broker. If access should already work, verify EMBASSY_STATE_DIR names this user's own state directory.";
7
+ readonly "hint.controlInvalidResponse": "if either Embassy installation changed recently, rebuild or repoint this client to the broker's installation; otherwise restart the broker, then retry.";
8
+ readonly "hint.controlVersionMismatch": "rebuild or repoint this client to the broker's Embassy installation, then retry.";
9
+ readonly "hint.stateAccessDenied": "local policy denied access to the gateway state directory; grant this process access, then retry starting the broker. If access should already work, verify EMBASSY_STATE_DIR names this user's own state directory.";
7
10
  readonly "hint.messageTooLarge": "message exceeds the 16 KiB acceptance cap; shorten or split it. For long prose, pipe the body from a file.";
11
+ readonly "hint.nodeInventoryRequired": "at {stateDir}, create the directory as mode-0700, replace <host> with your chosen lowercase host in exactly {\"version\":1,\"host\":\"<host>\",\"nodes\":[]}, save it there as mode-0600 nodes.json, then run embassy serve again.";
8
12
  readonly "hint.progressWatchOwnerConflict": "this pair already has a watch owned by the other participant; ask that owner to run `embassy untrack --conversation <conversation-token>` first.";
13
+ readonly "hint.stateResetRequired": "state reset required; follow docs/CONFIGURATION.md#private-state-reset. Resetting abandons unsettled work. To check for unsettled work after upgrading, temporarily use Embassy 1.9.x before resetting.";
9
14
  readonly "error.input": "request rejected.";
10
15
  readonly "error.decision": "gateway rejected the request.";
11
16
  readonly "error.unavailable": "gateway unavailable.";
12
17
  readonly "error.ambiguous": "outcome ambiguous; do not retry automatically.";
13
18
  readonly "error.failure": "command failed.";
14
- readonly "error.unsafe": "gateway state directory or socket has unexpected permissions or ownership. Verify nothing else controls that path before running embassy serve.";
19
+ readonly "error.unsafe": "gateway state directory or socket has unexpected permissions or ownership. Verify the exact path, owner, and modes before retrying.";
15
20
  readonly "error.tokenUnknown": "delivery token not recognized; it may have expired or left bounded retention.";
16
21
  readonly "error.deliveryTimeout": "the delivery has not settled yet; the gateway is still running. Check again later with embassy delivery-status.";
17
22
  };
@@ -1,4 +1,4 @@
1
- export const callerIdentityConflictHintEn = "both agent identities were inherited; the Codex App Server daemon may have been started inside an agent session. From a normal terminal, run: codex app-server daemon restart";
1
+ export const callerIdentityConflictHintEn = "both agent identities were inherited; rerun this Codex-side call with env -u CLAUDE_CODE_MESSAGING_SOCKET, or this Claude-side call with env -u CODEX_THREAD_ID";
2
2
  export const cliCopyEn = {
3
3
  "help.usage": `Embassy — local messaging for Claude Code and Codex
4
4
 
@@ -10,7 +10,6 @@ Commands:
10
10
  health Check broker health
11
11
  status Read the public status snapshot
12
12
  doctor Diagnose Codex Desktop attachment
13
- convert-state-v2-to-v3 Convert stopped-broker state after making a backup
14
13
  refresh-dashboard Refresh discovery and publish both static dashboards
15
14
  dashboard --live [--port <n>]
16
15
  Open live status and bounded route consent
@@ -22,12 +21,12 @@ Commands:
22
21
  Unregister a universal shell peer
23
22
  await --alias <peer-alias> [--token-stdin]
24
23
  Wait for one peer message and acknowledge stdout
24
+ peer-stdio Serve the bounded federation protocol on stdin/stdout
25
25
  select-claude Select a discovered Claude session
26
26
  unselect-claude Clear the Claude selection
27
27
  pair [--from <alias> --to <alias>] Add one cross-provider consent edge
28
28
  unpair [--from <alias> --to <alias>] Remove one cross-provider consent edge
29
- send-to-claude Send stdin to the selected Claude route
30
- send-to-codex Send stdin to a registered Codex route
29
+ send Send stdin between paired provider routes
31
30
  reply Reply with a conversation token
32
31
  delivery-status Read a delivery token
33
32
  wait-delivery Wait for terminal delivery status
@@ -43,15 +42,20 @@ Options:
43
42
  `,
44
43
  "hint.dashboardLiveRequired": "dashboard requires --live; static files are published by serve and refresh-dashboard.",
45
44
  "hint.dashboardPortInUse": "live dashboard port {port} is already in use; close the holding process or choose another with --port <n>.",
46
- "hint.controlInvalidResponse": "client/broker version skew is likely; rebuild or repoint this client to the broker's Embassy installation, then retry.",
45
+ "hint.controlConnectDenied": "the broker may be running, but this process cannot connect; grant this task write access to the gateway state directory, then retry. Do not start a second broker. If access should already work, verify EMBASSY_STATE_DIR names this user's own state directory.",
46
+ "hint.controlInvalidResponse": "if either Embassy installation changed recently, rebuild or repoint this client to the broker's installation; otherwise restart the broker, then retry.",
47
+ "hint.controlVersionMismatch": "rebuild or repoint this client to the broker's Embassy installation, then retry.",
48
+ "hint.stateAccessDenied": "local policy denied access to the gateway state directory; grant this process access, then retry starting the broker. If access should already work, verify EMBASSY_STATE_DIR names this user's own state directory.",
47
49
  "hint.messageTooLarge": "message exceeds the 16 KiB acceptance cap; shorten or split it. For long prose, pipe the body from a file.",
50
+ "hint.nodeInventoryRequired": "at {stateDir}, create the directory as mode-0700, replace <host> with your chosen lowercase host in exactly {\"version\":1,\"host\":\"<host>\",\"nodes\":[]}, save it there as mode-0600 nodes.json, then run embassy serve again.",
48
51
  "hint.progressWatchOwnerConflict": "this pair already has a watch owned by the other participant; ask that owner to run `embassy untrack --conversation <conversation-token>` first.",
52
+ "hint.stateResetRequired": "state reset required; follow docs/CONFIGURATION.md#private-state-reset. Resetting abandons unsettled work. To check for unsettled work after upgrading, temporarily use Embassy 1.9.x before resetting.",
49
53
  "error.input": "request rejected.",
50
54
  "error.decision": "gateway rejected the request.",
51
55
  "error.unavailable": "gateway unavailable.",
52
56
  "error.ambiguous": "outcome ambiguous; do not retry automatically.",
53
57
  "error.failure": "command failed.",
54
- "error.unsafe": "gateway state directory or socket has unexpected permissions or ownership. Verify nothing else controls that path before running embassy serve.",
58
+ "error.unsafe": "gateway state directory or socket has unexpected permissions or ownership. Verify the exact path, owner, and modes before retrying.",
55
59
  "error.tokenUnknown": "delivery token not recognized; it may have expired or left bounded retention.",
56
60
  "error.deliveryTimeout": "the delivery has not settled yet; the gateway is still running. Check again later with embassy delivery-status.",
57
61
  };
@@ -1 +1 @@
1
- {"version":3,"file":"cli-copy.en.js","sourceRoot":"","sources":["../../../src/gateway/cli-copy.en.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,4BAA4B,GACvC,+KAA+K,CAAC;AAElL,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCf;IACC,4BAA4B,EAC1B,uFAAuF;IACzF,yBAAyB,EACvB,4GAA4G;IAC9G,6BAA6B,EAC3B,wHAAwH;IAC1H,sBAAsB,EACpB,4GAA4G;IAC9G,iCAAiC,EAC/B,kJAAkJ;IACpJ,aAAa,EAAE,mBAAmB;IAClC,gBAAgB,EAAE,+BAA+B;IACjD,mBAAmB,EAAE,sBAAsB;IAC3C,iBAAiB,EAAE,gDAAgD;IACnE,eAAe,EAAE,iBAAiB;IAClC,cAAc,EACZ,iJAAiJ;IACnJ,oBAAoB,EAClB,+EAA+E;IACjF,uBAAuB,EACrB,iHAAiH;CACzF,CAAC"}
1
+ {"version":3,"file":"cli-copy.en.js","sourceRoot":"","sources":["../../../src/gateway/cli-copy.en.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,4BAA4B,GACvC,iKAAiK,CAAC;AAEpK,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCf;IACC,4BAA4B,EAC1B,uFAAuF;IACzF,yBAAyB,EACvB,4GAA4G;IAC9G,2BAA2B,EACzB,mQAAmQ;IACrQ,6BAA6B,EAC3B,yJAAyJ;IAC3J,6BAA6B,EAC3B,kFAAkF;IACpF,wBAAwB,EACtB,sNAAsN;IACxN,sBAAsB,EACpB,4GAA4G;IAC9G,4BAA4B,EAC1B,oOAAoO;IACtO,iCAAiC,EAC/B,kJAAkJ;IACpJ,yBAAyB,EACvB,yMAAyM;IAC3M,aAAa,EAAE,mBAAmB;IAClC,gBAAgB,EAAE,+BAA+B;IACjD,mBAAmB,EAAE,sBAAsB;IAC3C,iBAAiB,EAAE,gDAAgD;IACnE,eAAe,EAAE,iBAAiB;IAClC,cAAc,EACZ,qIAAqI;IACvI,oBAAoB,EAClB,+EAA+E;IACjF,uBAAuB,EACrB,iHAAiH;CACzF,CAAC"}
@@ -4,9 +4,14 @@ export const cliCopyKeys = [
4
4
  "help.usage",
5
5
  "hint.dashboardLiveRequired",
6
6
  "hint.dashboardPortInUse",
7
+ "hint.controlConnectDenied",
7
8
  "hint.controlInvalidResponse",
9
+ "hint.controlVersionMismatch",
10
+ "hint.stateAccessDenied",
8
11
  "hint.messageTooLarge",
12
+ "hint.nodeInventoryRequired",
9
13
  "hint.progressWatchOwnerConflict",
14
+ "hint.stateResetRequired",
10
15
  "error.input",
11
16
  "error.decision",
12
17
  "error.unavailable",
@@ -1 +1 @@
1
- {"version":3,"file":"cli-copy.js","sourceRoot":"","sources":["../../../src/gateway/cli-copy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,YAAY;IACZ,4BAA4B;IAC5B,yBAAyB;IACzB,6BAA6B;IAC7B,sBAAsB;IACtB,iCAAiC;IACjC,aAAa;IACb,gBAAgB;IAChB,mBAAmB;IACnB,iBAAiB;IACjB,eAAe;IACf,cAAc;IACd,oBAAoB;IACpB,uBAAuB;CACf,CAAC;AAQX,MAAM,UAAU,UAAU,CAAC,MAAuB;IAChD,OAAO,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;AACtD,CAAC"}
1
+ {"version":3,"file":"cli-copy.js","sourceRoot":"","sources":["../../../src/gateway/cli-copy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,YAAY;IACZ,4BAA4B;IAC5B,yBAAyB;IACzB,2BAA2B;IAC3B,6BAA6B;IAC7B,6BAA6B;IAC7B,wBAAwB;IACxB,sBAAsB;IACtB,4BAA4B;IAC5B,iCAAiC;IACjC,yBAAyB;IACzB,aAAa;IACb,gBAAgB;IAChB,mBAAmB;IACnB,iBAAiB;IACjB,eAAe;IACf,cAAc;IACd,oBAAoB;IACpB,uBAAuB;CACf,CAAC;AAQX,MAAM,UAAU,UAAU,CAAC,MAAuB;IAChD,OAAO,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;AACtD,CAAC"}
@@ -1,17 +1,22 @@
1
- export declare const callerIdentityConflictHintZhCn = "\u540C\u65F6\u7EE7\u627F\u4E86\u4E24\u79CD\u4EE3\u7406\u8EAB\u4EFD\uFF1BCodex App Server \u5B88\u62A4\u8FDB\u7A0B\u53EF\u80FD\u662F\u5728\u4EE3\u7406\u4F1A\u8BDD\u5185\u542F\u52A8\u7684\u3002\u8BF7\u5728\u666E\u901A\u7EC8\u7AEF\u4E2D\u8FD0\u884C\uFF1Acodex app-server daemon restart";
1
+ export declare const callerIdentityConflictHintZhCn = "\u540C\u65F6\u7EE7\u627F\u4E86\u4E24\u79CD\u4EE3\u7406\u8EAB\u4EFD\uFF1BCodex \u4FA7\u8C03\u7528\u8BF7\u4F7F\u7528 env -u CLAUDE_CODE_MESSAGING_SOCKET \u91CD\u8BD5\uFF0CClaude \u4FA7\u8C03\u7528\u8BF7\u4F7F\u7528 env -u CODEX_THREAD_ID \u91CD\u8BD5";
2
2
  export declare const cliCopyZhCn: {
3
- readonly "help.usage": "Embassy — Claude Code 与 Codex 的本地消息通道\n\n用法:\n embassy <command> [options] [--lang en|zh-CN]\n\n命令:\n serve [--inbound open] 在前台运行仅使用套接字的代理(默认配对入站)\n health 检查代理健康状态\n status 读取公开状态快照\n doctor 诊断 Codex 桌面应用连接状态\n convert-state-v2-to-v3 备份后转换已停止代理的状态\n refresh-dashboard 刷新发现结果并发布两份静态仪表盘\n dashboard --live [--port <n>]\n 打开实时状态与有限路由同意操作\n register-codex 注册或继任 Codex 任务\n unregister-codex 注销当前 Codex 任务\n register-peer --alias <对等别名> [--token-stdin|--emit-env]\n 注册通用 shell 对等方\n unregister-peer --alias <对等别名> [--token-stdin]\n 注销通用 shell 对等方\n await --alias <对等别名> [--token-stdin]\n 等待一条对等消息并在标准输出后确认\n select-claude 选择已发现的 Claude 会话\n unselect-claude 清除 Claude 选择\n pair [--from <别名> --to <别名>] 添加一条跨提供商同意边\n unpair [--from <别名> --to <别名>] 移除一条跨提供商同意边\n send-to-claude 将标准输入发送到所选 Claude 路由\n send-to-codex 将标准输入发送到已注册 Codex 路由\n reply 使用会话令牌回复\n delivery-status 读取投递令牌状态\n wait-delivery 等待终结投递状态\n untrack 关闭一个活跃的进度监视\n\n选项:\n --lang en|zh-CN 本地化面向用户的文本\n --token-stdin 从标准输入首个 LF 结尾行读取对等令牌\n --emit-env 将首次注册令牌输出为 export 命令\n --port <n> 实时仪表盘端口,1024–65535(默认 41961)\n --version, -v 输出版本\n --help, -h 显示此帮助\n";
3
+ readonly "help.usage": "Embassy — Claude Code 与 Codex 的本地消息通道\n\n用法:\n embassy <command> [options] [--lang en|zh-CN]\n\n命令:\n serve [--inbound open] 在前台运行仅使用套接字的代理(默认配对入站)\n health 检查代理健康状态\n status 读取公开状态快照\n doctor 诊断 Codex 桌面应用连接状态\n refresh-dashboard 刷新发现结果并发布两份静态仪表盘\n dashboard --live [--port <n>]\n 打开实时状态与有限路由同意操作\n register-codex 注册或继任 Codex 任务\n unregister-codex 注销当前 Codex 任务\n register-peer --alias <对等别名> [--token-stdin|--emit-env]\n 注册通用 shell 对等方\n unregister-peer --alias <对等别名> [--token-stdin]\n 注销通用 shell 对等方\n await --alias <对等别名> [--token-stdin]\n 等待一条对等消息并在标准输出后确认\n peer-stdio 在标准输入/输出上提供有界联邦协议\n select-claude 选择已发现的 Claude 会话\n unselect-claude 清除 Claude 选择\n pair [--from <别名> --to <别名>] 添加一条跨提供商同意边\n unpair [--from <别名> --to <别名>] 移除一条跨提供商同意边\n send 在已配对的提供方路由之间发送标准输入\n reply 使用会话令牌回复\n delivery-status 读取投递令牌状态\n wait-delivery 等待终结投递状态\n untrack 关闭一个活跃的进度监视\n\n选项:\n --lang en|zh-CN 本地化面向用户的文本\n --token-stdin 从标准输入首个 LF 结尾行读取对等令牌\n --emit-env 将首次注册令牌输出为 export 命令\n --port <n> 实时仪表盘端口,1024–65535(默认 41961)\n --version, -v 输出版本\n --help, -h 显示此帮助\n";
4
4
  readonly "hint.dashboardLiveRequired": "dashboard 需要 --live;静态文件由 serve 和 refresh-dashboard 发布。";
5
5
  readonly "hint.dashboardPortInUse": "实时仪表盘端口 {port} 已被占用;请关闭占用进程,或使用 --port <n> 选择其他端口。";
6
- readonly "hint.controlInvalidResponse": "客户端与网关进程的版本可能不一致;请重新构建客户端,或将其重新指向网关进程所使用的 Embassy 安装,然后重试。";
6
+ readonly "hint.controlConnectDenied": "网关进程可能仍在运行,但当前进程无权连接;请授予此任务对网关状态目录的写入权限,然后重试。请勿启动第二个网关进程。如果本应已有访问权限,请确认 EMBASSY_STATE_DIR 指向此用户自己的状态目录。";
7
+ readonly "hint.controlInvalidResponse": "如果任一 Embassy 安装近期发生变化,请重新构建客户端或将其重新指向网关进程所用的安装;否则请重启网关进程,然后重试。";
8
+ readonly "hint.controlVersionMismatch": "请重新构建客户端,或将其重新指向网关进程所使用的 Embassy 安装,然后重试。";
9
+ readonly "hint.stateAccessDenied": "本地策略拒绝访问网关状态目录;请授予此进程访问权限,然后重新尝试启动网关。如果本应已有访问权限,请确认 EMBASSY_STATE_DIR 指向此用户自己的状态目录。";
7
10
  readonly "hint.messageTooLarge": "消息超过 16 KiB 接收上限;请缩短消息或将其拆分。对于长篇内容,请通过管道从文件传入正文。";
11
+ readonly "hint.nodeInventoryRequired": "请在 {stateDir} 将该目录创建为 mode-0700,把 {\"version\":1,\"host\":\"<host>\",\"nodes\":[]} 中的 <host> 替换为所选的小写主机名,并在该目录中保存为 mode-0600 的 nodes.json,然后再次运行 embassy serve。";
8
12
  readonly "hint.progressWatchOwnerConflict": "此配对已有由另一参与方拥有的监视;请先让该所有者运行 `embassy untrack --conversation <conversation-token>`。";
13
+ readonly "hint.stateResetRequired": "必须重置状态;请按照 docs/CONFIGURATION.zh-CN.md#私有状态重置 操作。重置会放弃所有未结算工作。升级后如需检查未结算工作,请在重置前暂时使用 Embassy 1.9.x。";
9
14
  readonly "error.input": "请求被拒绝。";
10
15
  readonly "error.decision": "网关拒绝了该请求。";
11
16
  readonly "error.unavailable": "网关不可用。";
12
17
  readonly "error.ambiguous": "结果不确定;请勿自动重试。";
13
18
  readonly "error.failure": "命令失败。";
14
- readonly "error.unsafe": "网关状态目录或套接字的权限或所有者异常。请先确认该路径未被其他进程控制,再运行 embassy serve。";
19
+ readonly "error.unsafe": "网关状态目录或套接字的权限或所有者异常。请核对精确路径、所有者和模式后再重试。";
15
20
  readonly "error.tokenUnknown": "无法识别该投递令牌;它可能已过期,或已超出有界保留范围。";
16
21
  readonly "error.deliveryTimeout": "该投递尚未结算;网关仍在运行。请稍后使用 embassy delivery-status 再次查询。";
17
22
  };
@@ -1,4 +1,4 @@
1
- export const callerIdentityConflictHintZhCn = "同时继承了两种代理身份;Codex App Server 守护进程可能是在代理会话内启动的。请在普通终端中运行:codex app-server daemon restart";
1
+ export const callerIdentityConflictHintZhCn = "同时继承了两种代理身份;Codex 侧调用请使用 env -u CLAUDE_CODE_MESSAGING_SOCKET 重试,Claude 侧调用请使用 env -u CODEX_THREAD_ID 重试";
2
2
  export const cliCopyZhCn = {
3
3
  "help.usage": `Embassy — Claude Code 与 Codex 的本地消息通道
4
4
 
@@ -10,7 +10,6 @@ export const cliCopyZhCn = {
10
10
  health 检查代理健康状态
11
11
  status 读取公开状态快照
12
12
  doctor 诊断 Codex 桌面应用连接状态
13
- convert-state-v2-to-v3 备份后转换已停止代理的状态
14
13
  refresh-dashboard 刷新发现结果并发布两份静态仪表盘
15
14
  dashboard --live [--port <n>]
16
15
  打开实时状态与有限路由同意操作
@@ -22,12 +21,12 @@ export const cliCopyZhCn = {
22
21
  注销通用 shell 对等方
23
22
  await --alias <对等别名> [--token-stdin]
24
23
  等待一条对等消息并在标准输出后确认
24
+ peer-stdio 在标准输入/输出上提供有界联邦协议
25
25
  select-claude 选择已发现的 Claude 会话
26
26
  unselect-claude 清除 Claude 选择
27
27
  pair [--from <别名> --to <别名>] 添加一条跨提供商同意边
28
28
  unpair [--from <别名> --to <别名>] 移除一条跨提供商同意边
29
- send-to-claude 将标准输入发送到所选 Claude 路由
30
- send-to-codex 将标准输入发送到已注册 Codex 路由
29
+ send 在已配对的提供方路由之间发送标准输入
31
30
  reply 使用会话令牌回复
32
31
  delivery-status 读取投递令牌状态
33
32
  wait-delivery 等待终结投递状态
@@ -43,15 +42,20 @@ export const cliCopyZhCn = {
43
42
  `,
44
43
  "hint.dashboardLiveRequired": "dashboard 需要 --live;静态文件由 serve 和 refresh-dashboard 发布。",
45
44
  "hint.dashboardPortInUse": "实时仪表盘端口 {port} 已被占用;请关闭占用进程,或使用 --port <n> 选择其他端口。",
46
- "hint.controlInvalidResponse": "客户端与网关进程的版本可能不一致;请重新构建客户端,或将其重新指向网关进程所使用的 Embassy 安装,然后重试。",
45
+ "hint.controlConnectDenied": "网关进程可能仍在运行,但当前进程无权连接;请授予此任务对网关状态目录的写入权限,然后重试。请勿启动第二个网关进程。如果本应已有访问权限,请确认 EMBASSY_STATE_DIR 指向此用户自己的状态目录。",
46
+ "hint.controlInvalidResponse": "如果任一 Embassy 安装近期发生变化,请重新构建客户端或将其重新指向网关进程所用的安装;否则请重启网关进程,然后重试。",
47
+ "hint.controlVersionMismatch": "请重新构建客户端,或将其重新指向网关进程所使用的 Embassy 安装,然后重试。",
48
+ "hint.stateAccessDenied": "本地策略拒绝访问网关状态目录;请授予此进程访问权限,然后重新尝试启动网关。如果本应已有访问权限,请确认 EMBASSY_STATE_DIR 指向此用户自己的状态目录。",
47
49
  "hint.messageTooLarge": "消息超过 16 KiB 接收上限;请缩短消息或将其拆分。对于长篇内容,请通过管道从文件传入正文。",
50
+ "hint.nodeInventoryRequired": "请在 {stateDir} 将该目录创建为 mode-0700,把 {\"version\":1,\"host\":\"<host>\",\"nodes\":[]} 中的 <host> 替换为所选的小写主机名,并在该目录中保存为 mode-0600 的 nodes.json,然后再次运行 embassy serve。",
48
51
  "hint.progressWatchOwnerConflict": "此配对已有由另一参与方拥有的监视;请先让该所有者运行 `embassy untrack --conversation <conversation-token>`。",
52
+ "hint.stateResetRequired": "必须重置状态;请按照 docs/CONFIGURATION.zh-CN.md#私有状态重置 操作。重置会放弃所有未结算工作。升级后如需检查未结算工作,请在重置前暂时使用 Embassy 1.9.x。",
49
53
  "error.input": "请求被拒绝。",
50
54
  "error.decision": "网关拒绝了该请求。",
51
55
  "error.unavailable": "网关不可用。",
52
56
  "error.ambiguous": "结果不确定;请勿自动重试。",
53
57
  "error.failure": "命令失败。",
54
- "error.unsafe": "网关状态目录或套接字的权限或所有者异常。请先确认该路径未被其他进程控制,再运行 embassy serve。",
58
+ "error.unsafe": "网关状态目录或套接字的权限或所有者异常。请核对精确路径、所有者和模式后再重试。",
55
59
  "error.tokenUnknown": "无法识别该投递令牌;它可能已过期,或已超出有界保留范围。",
56
60
  "error.deliveryTimeout": "该投递尚未结算;网关仍在运行。请稍后使用 embassy delivery-status 再次查询。",
57
61
  };
@@ -1 +1 @@
1
- {"version":3,"file":"cli-copy.zh-CN.js","sourceRoot":"","sources":["../../../src/gateway/cli-copy.zh-CN.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,8BAA8B,GACzC,yFAAyF,CAAC;AAE5F,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCf;IACC,4BAA4B,EAC1B,yDAAyD;IAC3D,yBAAyB,EACvB,oDAAoD;IACtD,6BAA6B,EAC3B,4DAA4D;IAC9D,sBAAsB,EACpB,kDAAkD;IACpD,iCAAiC,EAC/B,mFAAmF;IACrF,aAAa,EAAE,QAAQ;IACvB,gBAAgB,EAAE,WAAW;IAC7B,mBAAmB,EAAE,QAAQ;IAC7B,iBAAiB,EAAE,eAAe;IAClC,eAAe,EAAE,OAAO;IACxB,cAAc,EACZ,wDAAwD;IAC1D,oBAAoB,EAAE,8BAA8B;IACpD,uBAAuB,EACrB,oDAAoD;CAC5B,CAAC"}
1
+ {"version":3,"file":"cli-copy.zh-CN.js","sourceRoot":"","sources":["../../../src/gateway/cli-copy.zh-CN.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,8BAA8B,GACzC,yGAAyG,CAAC;AAE5G,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,YAAY,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCf;IACC,4BAA4B,EAC1B,yDAAyD;IAC3D,yBAAyB,EACvB,oDAAoD;IACtD,2BAA2B,EACzB,yGAAyG;IAC3G,6BAA6B,EAC3B,gEAAgE;IAClE,6BAA6B,EAC3B,2CAA2C;IAC7C,wBAAwB,EACtB,qFAAqF;IACvF,sBAAsB,EACpB,kDAAkD;IACpD,4BAA4B,EAC1B,iKAAiK;IACnK,iCAAiC,EAC/B,mFAAmF;IACrF,yBAAyB,EACvB,qGAAqG;IACvG,aAAa,EAAE,QAAQ;IACvB,gBAAgB,EAAE,WAAW;IAC7B,mBAAmB,EAAE,QAAQ;IAC7B,iBAAiB,EAAE,eAAe;IAClC,eAAe,EAAE,OAAO;IACxB,cAAc,EACZ,yCAAyC;IAC3C,oBAAoB,EAAE,8BAA8B;IACpD,uBAAuB,EACrB,oDAAoD;CAC5B,CAAC"}
@@ -5,9 +5,8 @@ import { type GatewayNodeInventory } from "./federation-nodes.js";
5
5
  import { type LiveDashboardCommandOutcome, type LiveDashboardCommandOptions } from "./live-dashboard-command.js";
6
6
  import { type GatewayServerOptions } from "./server.js";
7
7
  import { runPeerStdio, type PeerStdioSession } from "./peer-stdio.js";
8
- import { type GatewayStateV2ToV3Result } from "./state-v2-to-v3.js";
9
- export declare const EMBASSY_VERSION = "1.9.4";
10
- export declare const gatewayCliCommands: readonly ["serve", "health", "status", "doctor", "convert-state-v2-to-v3", "delivery-status", "wait-delivery", "untrack", "refresh-dashboard", "dashboard", "register-codex", "unregister-codex", "select-claude", "unselect-claude", "pair", "unpair", "send-to-claude", "send-to-codex", "reply", "register-peer", "unregister-peer", "await", "peer-stdio"];
8
+ export declare const EMBASSY_VERSION = "2.0.1";
9
+ export declare const gatewayCliCommands: readonly ["serve", "health", "status", "doctor", "delivery-status", "wait-delivery", "untrack", "refresh-dashboard", "dashboard", "register-codex", "unregister-codex", "select-claude", "unselect-claude", "pair", "unpair", "send", "reply", "register-peer", "unregister-peer", "await", "peer-stdio"];
11
10
  export type GatewayCliCommand = (typeof gatewayCliCommands)[number];
12
11
  export declare const gatewayCliExitCodes: Readonly<{
13
12
  readonly ok: 0;
@@ -23,22 +22,17 @@ type Writable = {
23
22
  type GatewayControlSender = <M extends GatewayControlMethod>(options: SendGatewayControlRequestOptions<M>) => Promise<GatewayControlResponse<M>>;
24
23
  type GatewayServerRunner = (options: GatewayServerOptions) => Promise<void>;
25
24
  type LiveDashboardRunner = (options: LiveDashboardCommandOptions) => Promise<LiveDashboardCommandOutcome | void>;
26
- type GatewayStateConverter = (options: Readonly<{
27
- stateDir: string;
28
- hostId?: string;
29
- }>) => Promise<GatewayStateV2ToV3Result>;
30
25
  type PeerStdioRunner = (options: Parameters<typeof runPeerStdio>[0]) => PeerStdioSession;
31
26
  export type GatewayCliDependencies = {
32
27
  env?: NodeJS.ProcessEnv;
33
28
  stdin?: AsyncIterable<unknown>;
34
29
  stdout?: Writable;
35
30
  stderr?: Writable;
36
- loadConfig?: (env: NodeJS.ProcessEnv) => GatewayConfig;
31
+ loadConfig?: (env: NodeJS.ProcessEnv, inventory: GatewayNodeInventory) => GatewayConfig;
37
32
  loadNodeInventory?: (stateDir: string) => Promise<GatewayNodeInventory>;
38
33
  sendRequest?: GatewayControlSender;
39
34
  runServer?: GatewayServerRunner;
40
35
  runLiveDashboard?: LiveDashboardRunner;
41
- convertState?: GatewayStateConverter;
42
36
  serverSignal?: AbortSignal;
43
37
  liveDashboardSignal?: AbortSignal;
44
38
  validateControlSocket?: (stateDir: string, socketPath: string) => Promise<void>;
@@ -8,31 +8,29 @@ import { BridgeError } from "../errors.js";
8
8
  import { getCliCopy } from "./cli-copy.js";
9
9
  import { callerIdentityConflictHintEn } from "./cli-copy.en.js";
10
10
  import { callerIdentityConflictHintZhCn } from "./cli-copy.zh-CN.js";
11
- import { GATEWAY_CONTROL_DEFAULT_TIMEOUT_MS, GATEWAY_CONTROL_MAX_MESSAGE_BYTES, GATEWAY_CONTROL_MAX_RESPONSE_BYTES, GATEWAY_CONTROL_PROTOCOL_VERSION, GatewayControlTransportError, isClaudeSessionSelector, isGatewayAlias, isGatewayConversationId, isGatewayDeliveryToken, isGatewayHostId, isGatewayReplyAddress, sendGatewayControlRequest } from "./control.js";
12
- import { loadGatewayConfig } from "./config.js";
11
+ import { GATEWAY_CONTROL_DEFAULT_TIMEOUT_MS, GATEWAY_CONTROL_MAX_MESSAGE_BYTES, GATEWAY_CONTROL_MAX_RESPONSE_BYTES, GATEWAY_CONTROL_PROTOCOL_VERSION, GatewayControlTransportError, isClaudeSessionSelector, isGatewayAlias, isGatewayConversationId, isGatewayDeliveryToken, isGatewayReplyAddress, sendGatewayControlRequest } from "./control.js";
12
+ import { defaultGatewayStateDir, loadGatewayConfig } from "./config.js";
13
13
  import { loadGatewayNodeInventory } from "./federation-nodes.js";
14
14
  import { isDashboardLocale } from "./locale.js";
15
15
  import { DEFAULT_LIVE_DASHBOARD_PORT, runLiveDashboardCommand } from "./live-dashboard-command.js";
16
16
  import { runGatewayServer } from "./server.js";
17
17
  import { PROGRESS_WATCH_DEFAULT_IDLE_MS } from "./progress-watch-machine.js";
18
18
  import { PeerHandlerError, runPeerStdio } from "./peer-stdio.js";
19
- import { convertGatewayStateV2ToV3 } from "./state-v2-to-v3.js";
20
19
  const THREAD_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
21
- const DEFAULT_HOST_ID = "this-mac";
22
20
  const CLI_MAX_OUTPUT_BYTES = GATEWAY_CONTROL_MAX_RESPONSE_BYTES;
23
21
  const DELIVERY_POLL_INTERVAL_MS = 250;
24
22
  const DELIVERY_POLL_MIN_REQUEST_TIMEOUT_MS = 50;
25
23
  const PEER_AWAIT_REQUEST_TIMEOUT_MS = 35_000;
26
- export const EMBASSY_VERSION = "1.9.4";
24
+ export const EMBASSY_VERSION = "2.0.1";
27
25
  // RELEASE VERSION SWEEP — every place the version lives: package.json,
28
26
  // npm-shrinkwrap.json (x2), this constant,
29
27
  // test/gateway-cli.test.ts package-metadata assertion.
30
28
  const DEFAULT_CLI_LOCALE = "en";
31
29
  export const gatewayCliCommands = [
32
- "serve", "health", "status", "doctor", "convert-state-v2-to-v3", "delivery-status",
30
+ "serve", "health", "status", "doctor", "delivery-status",
33
31
  "wait-delivery", "untrack", "refresh-dashboard", "dashboard", "register-codex",
34
32
  "unregister-codex", "select-claude", "unselect-claude", "pair", "unpair",
35
- "send-to-claude", "send-to-codex", "reply",
33
+ "send", "reply",
36
34
  "register-peer", "unregister-peer", "await",
37
35
  "peer-stdio",
38
36
  ];
@@ -210,14 +208,6 @@ function requireExclusiveCodexThreadId(env) {
210
208
  throw callerIdentityConflictFault(env);
211
209
  return requireCodexThreadId(env);
212
210
  }
213
- function optionalCodexThreadId(env) {
214
- const threadId = env.CODEX_THREAD_ID;
215
- if (threadId === undefined || threadId.length === 0)
216
- return undefined;
217
- if (!THREAD_ID_PATTERN.test(threadId))
218
- fault("CODEX_IDENTITY_REQUIRED");
219
- return threadId.toLowerCase();
220
- }
221
211
  function optionalClaudeReplyAddress(env) {
222
212
  const socketPath = env.CLAUDE_CODE_MESSAGING_SOCKET;
223
213
  if (socketPath === undefined || socketPath.length === 0)
@@ -324,7 +314,7 @@ function parseLiveDashboardArgs(args) {
324
314
  return parseLiveDashboardPort(options.port);
325
315
  }
326
316
  const envelope = (method, params) => ({ protocolVersion: GATEWAY_CONTROL_PROTOCOL_VERSION, method, params });
327
- async function buildRequest(command, args, env, stdin) {
317
+ async function buildRequest(command, args, env, stdin, loadLocalHost) {
328
318
  const simple = {
329
319
  health: "health", status: "list_snapshot", doctor: "list_snapshot",
330
320
  "refresh-dashboard": "refresh_dashboard",
@@ -335,7 +325,6 @@ async function buildRequest(command, args, env, stdin) {
335
325
  switch (command) {
336
326
  case "serve":
337
327
  case "dashboard":
338
- case "convert-state-v2-to-v3":
339
328
  case "peer-stdio":
340
329
  return fault();
341
330
  case "health":
@@ -357,20 +346,19 @@ async function buildRequest(command, args, env, stdin) {
357
346
  return envelope("untrack", { conversationId });
358
347
  }
359
348
  case "register-codex": {
360
- const options = parseOptions(args, ["alias", "host", "succeeds"]);
349
+ const options = parseOptions(args, ["alias", "succeeds"]);
361
350
  const alias = requireCodexAlias(options, "alias");
362
351
  const succeedsAlias = options.succeeds === undefined ? undefined : requireCodexAlias(options, "succeeds");
363
352
  count(options, succeedsAlias === undefined ? 1 : 2, 2);
364
- if (succeedsAlias !== undefined && options.host !== undefined)
353
+ const threadId = requireExclusiveCodexThreadId(env);
354
+ if (succeedsAlias === alias)
365
355
  fault();
366
- const host = succeedsAlias === undefined ? (options.host ?? DEFAULT_HOST_ID) : gatewayAliasHost(alias);
367
- if (typeof host !== "string" ||
368
- !isGatewayHostId(host) ||
369
- !alias.endsWith(`@${host}`) ||
370
- (succeedsAlias !== undefined && (succeedsAlias === alias || gatewayAliasHost(succeedsAlias) !== host)))
356
+ const localHost = await loadLocalHost();
357
+ if (!alias.endsWith(`@${localHost}`) ||
358
+ (succeedsAlias !== undefined && gatewayAliasHost(succeedsAlias) !== localHost))
371
359
  fault();
372
360
  return envelope("register_codex", {
373
- alias, threadId: requireExclusiveCodexThreadId(env), hostId: host, busyPolicy: "queue",
361
+ alias, threadId, hostId: localHost, busyPolicy: "queue",
374
362
  ...(succeedsAlias === undefined ? {} : { succeedsAlias }),
375
363
  });
376
364
  }
@@ -404,28 +392,15 @@ async function buildRequest(command, args, env, stdin) {
404
392
  const options = parseOptions(args, ["alias", "session"]);
405
393
  count(options, 1);
406
394
  const selector = requireClaudeSelector(options, options.alias === undefined ? "session" : "alias");
407
- const codexThreadId = optionalCodexThreadId(env);
408
- return envelope(command === "select-claude" ? "select_claude" : "unselect_claude", {
409
- alias: selector, ...(codexThreadId === undefined ? {} : { codexThreadId }),
410
- });
395
+ return envelope(command === "select-claude" ? "select_claude" : "unselect_claude", { alias: selector });
411
396
  }
412
397
  case "pair":
413
398
  case "unpair": {
414
- const options = parseOptions(args, ["claude", "codex", "from", "to"]);
399
+ const options = parseOptions(args, ["from", "to"]);
415
400
  count(options, 2);
416
- const legacyArm = options.claude !== undefined || options.codex !== undefined;
417
- if (legacyArm) {
418
- if (options.from !== undefined || options.to !== undefined)
419
- fault();
420
- return envelope(command, {
421
- claudeAlias: requireClaudeSelector(options, "claude"), codexAlias: requireCodexAlias(options, "codex"),
422
- codexThreadId: requireExclusiveCodexThreadId(env),
423
- });
424
- }
425
401
  return envelope(command, { aliases: requirePairAliases(options) });
426
402
  }
427
- case "send-to-claude":
428
- case "send-to-codex": {
403
+ case "send": {
429
404
  const options = parseOptions(args, ["from", "to", "idle-minutes"], ["expects-reply", "track", "token-stdin"]);
430
405
  count(options, 2, 6);
431
406
  const source = peerTokenSource(options, env);
@@ -433,19 +408,19 @@ async function buildRequest(command, args, env, stdin) {
433
408
  if (principals > 1)
434
409
  throw callerIdentityConflictFault(env);
435
410
  const fromAlias = requireAlias(options, "from");
436
- const toAlias = command === "send-to-claude" ? requireClaudeSelector(options, "to") : requireAlias(options, "to");
411
+ const toAlias = requireClaudeSelector(options, "to");
437
412
  const idleMinutes = trackIdleMinutes(options);
438
413
  const peer = source === undefined ? undefined : await readPeerInput(stdin, source, true);
439
- const authority = peer === undefined ? command === "send-to-claude"
440
- ? requireExclusiveCodexThreadId(env) : requireExclusiveClaudeReplyAddress(env) : undefined;
414
+ const authority = peer === undefined ? hasIdentity(env.CODEX_THREAD_ID)
415
+ ? { threadId: requireExclusiveCodexThreadId(env) }
416
+ : { replyAddress: requireExclusiveClaudeReplyAddress(env) }
417
+ : { peerToken: peer.token };
441
418
  const common = {
442
419
  fromAlias, toAlias, text: peer?.text ?? await readMessageBody(stdin),
443
420
  expectsReply: options["expects-reply"] === true,
444
421
  ...(idleMinutes === undefined ? {} : { trackIdleMinutes: idleMinutes }),
445
422
  };
446
- return command === "send-to-claude"
447
- ? envelope("send_to_claude", { ...common, ...(peer === undefined ? { threadId: authority } : { peerToken: peer.token }) })
448
- : envelope("send_to_codex", { ...common, ...(peer === undefined ? { replyAddress: authority } : { peerToken: peer.token }) });
423
+ return envelope("send", { ...common, ...authority });
449
424
  }
450
425
  case "reply": {
451
426
  const options = parseOptions(args, ["conversation", "alias", "idle-minutes"], ["track", "token-stdin"]);
@@ -481,7 +456,11 @@ export async function validatePrivateGatewayControlSocket(stateDir, socketPath)
481
456
  try {
482
457
  [state, socket] = await Promise.all([lstat(stateDir), lstat(socketPath)]);
483
458
  }
484
- catch {
459
+ catch (error) {
460
+ const code = error !== null && typeof error === "object" && "code" in error
461
+ ? error.code : undefined;
462
+ if (code === "EPERM" || code === "EACCES")
463
+ throw new CliFault("CONTROL_CONNECT_DENIED", true, "hint.controlConnectDenied");
485
464
  throw new CliFault("CONTROL_SOCKET_UNAVAILABLE", true);
486
465
  }
487
466
  const uid = process.getuid?.();
@@ -528,6 +507,11 @@ function writeFailure(stdout, stderr, locale, command, code, options) {
528
507
  } }));
529
508
  stderr.write(fixedStderr(locale, options.kind));
530
509
  }
510
+ function writeStateResetHint(stderr, locale, code) {
511
+ if (code === "GATEWAY_STATE_SCHEMA_UNSUPPORTED" || code === "CORRUPT_GATEWAY_STATE") {
512
+ stderr.write(`[embassy] ${getCliCopy(locale)["hint.stateResetRequired"]}\n`);
513
+ }
514
+ }
531
515
  function isRejectedResult(result) {
532
516
  return result !== null && typeof result === "object" && result.accepted === false;
533
517
  }
@@ -611,6 +595,11 @@ export async function runGatewayCli(argv = process.argv.slice(2), dependencies =
611
595
  let locale = fallbackCliLocale(argv.slice(1), env);
612
596
  let serverReady = false, dashboardReady = false;
613
597
  let liveDashboardPort;
598
+ let identity;
599
+ const loadIdentity = () => identity ??= (async () => {
600
+ const inventory = await (dependencies.loadNodeInventory ?? loadGatewayNodeInventory)(path.resolve(defaultGatewayStateDir(env)));
601
+ return { inventory, config: loadConfig(env, inventory) };
602
+ })();
614
603
  const success = (result) => {
615
604
  stdout.write(serializedOutput({ ok: true, command: command, result }));
616
605
  };
@@ -627,13 +616,12 @@ export async function runGatewayCli(argv = process.argv.slice(2), dependencies =
627
616
  if (command === "peer-stdio") {
628
617
  emptyParams(common.args);
629
618
  try {
630
- const config = loadConfig(env);
631
- const inventory = await (dependencies.loadNodeInventory ?? loadGatewayNodeInventory)(config.stateDir);
619
+ const { config, inventory } = await loadIdentity();
632
620
  await validateSocket(config.stateDir, config.controlSocketPath);
633
621
  let peerHost, firstCatalog;
634
622
  const request = async (method, params) => {
635
623
  const response = await sendRequest({ socketPath: config.controlSocketPath,
636
- request: { protocolVersion: 1, method, params } });
624
+ request: { protocolVersion: GATEWAY_CONTROL_PROTOCOL_VERSION, method, params } });
637
625
  if (!response.ok)
638
626
  throw new PeerHandlerError({ code: -32000, message: "Local broker refused peer authority" });
639
627
  return response.result;
@@ -681,18 +669,11 @@ export async function runGatewayCli(argv = process.argv.slice(2), dependencies =
681
669
  fault("SERVER_NOT_READY");
682
670
  return gatewayCliExitCodes.ok;
683
671
  }
684
- if (command === "convert-state-v2-to-v3") {
685
- emptyParams(common.args);
686
- const config = loadConfig(env);
687
- const inventory = await (dependencies.loadNodeInventory ?? loadGatewayNodeInventory)(config.stateDir);
688
- const converted = await (dependencies.convertState ?? convertGatewayStateV2ToV3)({ stateDir: config.stateDir, hostId: inventory.host });
689
- success({ converted: true, backupFile: path.basename(converted.backupFile) });
690
- return gatewayCliExitCodes.ok;
691
- }
692
672
  if (command === "dashboard") {
693
673
  liveDashboardPort = parseLiveDashboardArgs(common.args);
674
+ const { inventory } = await loadIdentity();
694
675
  const outcome = await (dependencies.runLiveDashboard ?? runLiveDashboardCommand)({
695
- env, locale, port: liveDashboardPort, loadConfig, sendRequest, validateControlSocket: validateSocket,
676
+ env, locale, port: liveDashboardPort, inventory, loadConfig, sendRequest, validateControlSocket: validateSocket,
696
677
  ...(dependencies.liveDashboardSignal === undefined ? {} : { signal: dependencies.liveDashboardSignal }),
697
678
  onReady: async (result) => {
698
679
  if (dashboardReady)
@@ -707,8 +688,8 @@ export async function runGatewayCli(argv = process.argv.slice(2), dependencies =
707
688
  throw new Error("LIVE_DASHBOARD_NOT_READY");
708
689
  return gatewayCliExitCodes.ok;
709
690
  }
710
- const request = await buildRequest(command, common.args, env, stdin);
711
- const config = loadConfig(env);
691
+ const request = await buildRequest(command, common.args, env, stdin, async () => (await loadIdentity()).config.hostId);
692
+ const { config } = await loadIdentity();
712
693
  await validateSocket(config.stateDir, config.controlSocketPath);
713
694
  let response;
714
695
  let waited;
@@ -799,9 +780,14 @@ export async function runGatewayCli(argv = process.argv.slice(2), dependencies =
799
780
  ambiguous, retryable: ambiguous ? false : error.recoverable,
800
781
  kind: ambiguous ? "ambiguous" : "unavailable",
801
782
  });
802
- if (error.code === "CONTROL_INVALID_RESPONSE") {
783
+ if (error.code === "CONTROL_VERSION_MISMATCH") {
784
+ stderr.write(`[embassy] ${getCliCopy(locale)["hint.controlVersionMismatch"]}\n`);
785
+ }
786
+ else if (error.code === "CONTROL_INVALID_RESPONSE") {
803
787
  stderr.write(`[embassy] ${getCliCopy(locale)["hint.controlInvalidResponse"]}\n`);
804
788
  }
789
+ if (error.code === "CONTROL_CONNECT_DENIED")
790
+ stderr.write(`[embassy] ${getCliCopy(locale)["hint.controlConnectDenied"]}\n`);
805
791
  return ambiguous ? gatewayCliExitCodes.ambiguous : gatewayCliExitCodes.unavailable;
806
792
  }
807
793
  if (error instanceof CliFault) {
@@ -824,6 +810,13 @@ export async function runGatewayCli(argv = process.argv.slice(2), dependencies =
824
810
  writeFailure(stdout, stderr, locale, command, error.code, {
825
811
  retryable: error.recoverable, kind: error.recoverable ? "unavailable" : "input",
826
812
  });
813
+ writeStateResetHint(stderr, locale, error.code);
814
+ if (error.code === "CONTROL_CONNECT_DENIED")
815
+ stderr.write(`[embassy] ${getCliCopy(locale)[command === "serve" ? "hint.stateAccessDenied" : "hint.controlConnectDenied"]}\n`);
816
+ if (error.code === "GATEWAY_NODE_INVENTORY_REQUIRED") {
817
+ const stateDir = env.EMBASSY_STATE_DIR ?? (env.XDG_STATE_HOME ? path.join(env.XDG_STATE_HOME, "agent-embassy") : "~/.local/state/agent-embassy");
818
+ stderr.write(`[embassy] ${getCliCopy(locale)["hint.nodeInventoryRequired"].replace("{stateDir}", stateDir)}\n`);
819
+ }
827
820
  if (error.code === "LIVE_DASHBOARD_PORT_IN_USE" && liveDashboardPort !== undefined) {
828
821
  const hint = getCliCopy(locale)["hint.dashboardPortInUse"].replace("{port}", String(liveDashboardPort));
829
822
  stderr.write(`[embassy] ${hint}\n`);