relay-companion 0.1.418 → 0.1.419

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 (144) hide show
  1. package/bootstrap/relay-setup.cjs +76 -6
  2. package/package.json +7 -27
  3. package/THIRD_PARTY_NOTICES.md +0 -49
  4. package/bin/relay-hook.js +0 -18
  5. package/bin/relay.js +0 -1324
  6. package/licenses/Apache-2.0.txt +0 -201
  7. package/npm-shrinkwrap.json +0 -2866
  8. package/overlay/attention-queue.cjs +0 -170
  9. package/overlay/chat-read-presence.cjs +0 -39
  10. package/overlay/claudeCodeMark.svg +0 -3
  11. package/overlay/codex-open-current.cjs +0 -166
  12. package/overlay/codexMark.svg +0 -3
  13. package/overlay/deep-link.cjs +0 -33
  14. package/overlay/elevation-policy.cjs +0 -22
  15. package/overlay/fonts/inter-var.woff2 +0 -0
  16. package/overlay/fonts/newsreader-var.woff2 +0 -0
  17. package/overlay/fonts/plexmono-400.woff2 +0 -0
  18. package/overlay/fonts/plexmono-500.woff2 +0 -0
  19. package/overlay/host-select.cjs +0 -143
  20. package/overlay/hover-intent.js +0 -384
  21. package/overlay/inbox.html +0 -14572
  22. package/overlay/linux-runtime-probe.cjs +0 -44
  23. package/overlay/linux-terminal.cjs +0 -181
  24. package/overlay/main.cjs +0 -8677
  25. package/overlay/message-face.cjs +0 -71
  26. package/overlay/packet-documents.cjs +0 -49
  27. package/overlay/perf-counters.cjs +0 -48
  28. package/overlay/preload.cjs +0 -252
  29. package/overlay/preview-preload-source.cjs +0 -207
  30. package/overlay/preview-preload.cjs +0 -6579
  31. package/overlay/preview-renderer.js +0 -1779
  32. package/overlay/preview.html +0 -800
  33. package/overlay/read-receipts.cjs +0 -87
  34. package/overlay/relay.ico +0 -0
  35. package/overlay/relayAppIcon.svg +0 -27
  36. package/overlay/relayTrayTemplate.png +0 -0
  37. package/overlay/relayTrayTemplate@2x.png +0 -0
  38. package/overlay/slackMark.png +0 -0
  39. package/overlay/sounds/tink.wav +0 -0
  40. package/overlay/space-presence.cjs +0 -128
  41. package/overlay/state-ack-worker.cjs +0 -116
  42. package/overlay/tray-position.cjs +0 -121
  43. package/overlay/visibility.cjs +0 -179
  44. package/overlay/window-fit.cjs +0 -84
  45. package/overlay/work-ui.js +0 -444
  46. package/src/account.js +0 -153
  47. package/src/agent-relay-context.cjs +0 -413
  48. package/src/ai-session-transcript.js +0 -350
  49. package/src/atomic-json.cjs +0 -74
  50. package/src/attachments.js +0 -229
  51. package/src/auto-update.js +0 -1185
  52. package/src/autostart-registration.js +0 -169
  53. package/src/canonical-runtime.js +0 -936
  54. package/src/canonical-updater.js +0 -733
  55. package/src/capabilities.js +0 -111
  56. package/src/channel-server.js +0 -256
  57. package/src/chat-agent-work-presentation.js +0 -160
  58. package/src/claude-desktop-code.js +0 -595
  59. package/src/claude-hook.js +0 -142
  60. package/src/claude-inject.cjs +0 -813
  61. package/src/claude-materializer.js +0 -106
  62. package/src/claude-native-work-feed.js +0 -786
  63. package/src/claude-session-runtime.js +0 -43
  64. package/src/claude-session-writer.js +0 -856
  65. package/src/cli-trampoline.js +0 -156
  66. package/src/client.js +0 -1384
  67. package/src/codex-app-server-activity.js +0 -204
  68. package/src/codex-app-server.js +0 -155
  69. package/src/codex-desktop.js +0 -1255
  70. package/src/codex-hook.js +0 -101
  71. package/src/codex-inject.js +0 -493
  72. package/src/codex-one-shot.js +0 -452
  73. package/src/codex-project-repair.js +0 -148
  74. package/src/codex-session-writer.js +0 -195
  75. package/src/codex-state.js +0 -146
  76. package/src/config.js +0 -446
  77. package/src/content-field-migration.js +0 -136
  78. package/src/cowork-sessions.js +0 -90
  79. package/src/credential-store.cjs +0 -231
  80. package/src/cwd-select.js +0 -213
  81. package/src/desktop-hosts.js +0 -231
  82. package/src/desktop-migration.js +0 -272
  83. package/src/desktop-wake.js +0 -198
  84. package/src/e2ee-claude-control.js +0 -99
  85. package/src/e2ee-claude-runtime.js +0 -145
  86. package/src/e2ee-device-history.js +0 -427
  87. package/src/e2ee-device-trust.js +0 -213
  88. package/src/e2ee-group-product.js +0 -424
  89. package/src/e2ee-groups.js +0 -995
  90. package/src/e2ee-history-import.js +0 -191
  91. package/src/e2ee-identity.cjs +0 -220
  92. package/src/e2ee-mcp-certificate-store.js +0 -118
  93. package/src/e2ee-mcp-certificate.js +0 -108
  94. package/src/e2ee-mcp-oauth-state.js +0 -160
  95. package/src/e2ee-mcp-oauth.js +0 -476
  96. package/src/e2ee-mcp-tunnel.js +0 -283
  97. package/src/e2ee-mls.js +0 -1211
  98. package/src/e2ee-remote-mcp.js +0 -335
  99. package/src/e2ee-state.js +0 -1166
  100. package/src/e2ee-sync.js +0 -255
  101. package/src/hook-launcher.js +0 -147
  102. package/src/host-json.js +0 -14
  103. package/src/host-paths.js +0 -78
  104. package/src/inbox-item-id.cjs +0 -27
  105. package/src/install.js +0 -3828
  106. package/src/installation-authorization.js +0 -720
  107. package/src/links.js +0 -83
  108. package/src/local-credential-store.cjs +0 -154
  109. package/src/local-time.cjs +0 -37
  110. package/src/local-trace.cjs +0 -49
  111. package/src/log-rotate.js +0 -170
  112. package/src/mac-app-identity.cjs +0 -11
  113. package/src/materializer.js +0 -1035
  114. package/src/mcp-launcher.js +0 -50
  115. package/src/mcp.js +0 -2114
  116. package/src/native-turn.js +0 -44
  117. package/src/notifications.js +0 -796
  118. package/src/outbox.cjs +0 -480
  119. package/src/pill-control.js +0 -49
  120. package/src/pinning.js +0 -43
  121. package/src/product-features.cjs +0 -68
  122. package/src/product-features.js +0 -39
  123. package/src/provider-auth-runner.exp +0 -24
  124. package/src/provider-auth.js +0 -592
  125. package/src/provider-completion.js +0 -159
  126. package/src/provider-inventory-cache.js +0 -144
  127. package/src/provider-work-feed.js +0 -703
  128. package/src/relay-briefing.js +0 -620
  129. package/src/release-trust.json +0 -11
  130. package/src/repo-identity.js +0 -147
  131. package/src/repo-index.js +0 -274
  132. package/src/request-safety.js +0 -97
  133. package/src/runtime.js +0 -1350
  134. package/src/safe-attachment-preview.js +0 -183
  135. package/src/schedule.js +0 -1116
  136. package/src/session-controller.js +0 -956
  137. package/src/session-directory.js +0 -306
  138. package/src/setup-activation.js +0 -276
  139. package/src/setup-open.js +0 -83
  140. package/src/state-lock.cjs +0 -110
  141. package/src/task-daemon.js +0 -980
  142. package/src/update-agent-cleanup.js +0 -120
  143. package/src/work-conversation.js +0 -1278
  144. package/src/work-push-bridge.js +0 -565
@@ -822,6 +822,70 @@ function stopPreviousWindowsRuntime({ platform = process.platform, spawnImpl = s
822
822
  };
823
823
  }
824
824
 
825
+ const SETUP_COMPATIBILITY_VALUE_FLAGS = new Set([
826
+ "--code",
827
+ "--api",
828
+ "--web",
829
+ "--open-relay",
830
+ "--host",
831
+ ]);
832
+ const SAFE_SETUP_TOKEN = /^[A-Za-z0-9_-]{4,256}$/;
833
+
834
+ /**
835
+ * The signed-in website still emits the pre-pill setup contract while the
836
+ * installer migration is in flight. Keep that compatibility surface narrow:
837
+ * only the website's value-bearing arguments may cross the thin bootstrap into
838
+ * the already-verified runtime, and endpoint overrides must be secure origins.
839
+ */
840
+ function validateSetupCompatibilityArgs(argv = []) {
841
+ if (!Array.isArray(argv) || argv.length === 0) return [];
842
+ const args = argv.map((value) => String(value));
843
+ const values = new Map();
844
+ for (let index = 0; index < args.length; index += 2) {
845
+ const flag = args[index];
846
+ const value = args[index + 1];
847
+ if (!SETUP_COMPATIBILITY_VALUE_FLAGS.has(flag)) {
848
+ fail("Relay setup received an unsupported compatibility option.");
849
+ }
850
+ if (!value || value.startsWith("--")) {
851
+ fail("Relay setup received an incomplete compatibility option.");
852
+ }
853
+ if (values.has(flag)) fail("Relay setup received a duplicate compatibility option.");
854
+ values.set(flag, value);
855
+ }
856
+
857
+ const code = values.get("--code");
858
+ if (!code || !SAFE_SETUP_TOKEN.test(code)) fail("Relay setup received an invalid pairing code.");
859
+ const openRelay = values.get("--open-relay");
860
+ if (openRelay && !SAFE_SETUP_TOKEN.test(openRelay)) fail("Relay setup received an invalid relay token.");
861
+ const host = values.get("--host");
862
+ if (host && !openRelay) fail("Relay setup received a host without a relay token.");
863
+ if (host && host !== "claude" && host !== "codex") fail("Relay setup received an invalid agent host.");
864
+
865
+ for (const flag of ["--api", "--web"]) {
866
+ const value = values.get(flag);
867
+ if (!value) continue;
868
+ let url;
869
+ try {
870
+ url = new URL(value);
871
+ } catch {
872
+ fail("Relay setup received an invalid service origin.");
873
+ }
874
+ const loopbackHttp = url.protocol === "http:" && ["localhost", "127.0.0.1", "::1"].includes(url.hostname);
875
+ if (
876
+ (url.protocol !== "https:" && !loopbackHttp) ||
877
+ url.username ||
878
+ url.password ||
879
+ url.pathname !== "/" ||
880
+ url.search ||
881
+ url.hash
882
+ ) {
883
+ fail("Relay setup requires a secure service origin.");
884
+ }
885
+ }
886
+ return args;
887
+ }
888
+
825
889
  async function activateRuntime(layout, runtime, version, {
826
890
  platform = process.platform,
827
891
  homeDir = os.homedir(),
@@ -838,6 +902,7 @@ async function activateRuntime(layout, runtime, version, {
838
902
  activateMacServices = activateMacRuntimeServices,
839
903
  activationDeadlineMs = 90_000,
840
904
  now = Date.now,
905
+ setupCompatibilityArgs = [],
841
906
  } = {}) {
842
907
  let previous = null;
843
908
  try { previous = JSON.parse(readFileSync(layout.pointerPath, "utf8")); } catch {}
@@ -944,7 +1009,7 @@ async function activateRuntime(layout, runtime, version, {
944
1009
  // On macOS/Linux setup owns registration, but the shared activation state
945
1010
  // machine owns service restart. This keeps first-install MCP/autostart creation
946
1011
  // in the candidate while bootstrap and the updater use the same exact-root handoff.
947
- const setupArgs = [runtime.bin, "setup", "--no-trampoline", "--claim"];
1012
+ const setupArgs = [runtime.bin, "setup", "--no-trampoline", "--claim", ...setupCompatibilityArgs];
948
1013
  if (platform === "darwin" || platform === "linux") setupArgs.push("--no-restart");
949
1014
  const result = spawnImpl(candidate.node, setupArgs, {
950
1015
  stdio: "inherit",
@@ -1013,16 +1078,21 @@ async function activateRuntime(layout, runtime, version, {
1013
1078
  return { candidate, cliLauncher };
1014
1079
  }
1015
1080
 
1016
- async function setup() {
1081
+ async function setup(argv = []) {
1017
1082
  assertCompatibleNode();
1083
+ const setupCompatibilityArgs = validateSetupCompatibilityArgs(argv);
1018
1084
  const version = exactVersion(packageJson.version);
1019
1085
  const platformKey = releasePlatform();
1020
1086
  const layout = runtimeLayout(version, platformKey);
1021
1087
  const lock = acquireCanonicalLock(layout.lockPath);
1022
1088
  try {
1023
1089
  const runtime = await stageVerifiedRuntime({ version, platformKey, destination: layout.releaseRoot });
1024
- const activated = await activateRuntime(layout, runtime, version);
1025
- console.log(`Relay ${version} is installed. The Relay pill is open; sign in there to finish.`);
1090
+ const activated = await activateRuntime(layout, runtime, version, { setupCompatibilityArgs });
1091
+ if (setupCompatibilityArgs.includes("--code")) {
1092
+ console.log(`Relay ${version} is installed and paired. The Relay pill is open.`);
1093
+ } else {
1094
+ console.log(`Relay ${version} is installed. The Relay pill is open; sign in there to finish.`);
1095
+ }
1026
1096
  if (activated?.cliLauncher && !activated.cliLauncher.pathAvailable) {
1027
1097
  console.log(`Relay's command is installed at ${activated.cliLauncher.shimPath}. Open a new login session to add ~/.local/bin to PATH.`);
1028
1098
  }
@@ -1077,9 +1147,8 @@ async function main() {
1077
1147
  return;
1078
1148
  }
1079
1149
  }
1080
- if (process.argv.includes("--code")) fail("New Relay setup never accepts a pairing code. Sign in from the Relay pill after installation.");
1081
1150
  if (command === "version" || process.argv.includes("--version")) return console.log(packageJson.version);
1082
- if (command === "setup") return setup();
1151
+ if (command === "setup") return setup(process.argv.slice(3));
1083
1152
  console.log([
1084
1153
  "Relay secure setup",
1085
1154
  "",
@@ -1108,6 +1177,7 @@ module.exports = {
1108
1177
  stageVerifiedRuntime,
1109
1178
  stableNodePath,
1110
1179
  tarInvocation,
1180
+ validateSetupCompatibilityArgs,
1111
1181
  validateArchiveEntries,
1112
1182
  verifyExtractedRuntime,
1113
1183
  waitForRuntimeHealth,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relay-companion",
3
- "version": "0.1.418",
3
+ "version": "0.1.419",
4
4
  "description": "Install Relay for Claude Code, Cowork, and Codex, then sign in from the Relay pill.",
5
5
  "homepage": "https://sendrelays.com/get-started",
6
6
  "repository": {
@@ -28,25 +28,11 @@
28
28
  ],
29
29
  "type": "module",
30
30
  "bin": {
31
- "relay": "bin/relay.js"
32
- },
33
- "main": "bin/relay.js",
34
- "scripts": {
35
- "mcp": "node src/mcp.js",
36
- "daemon": "node src/task-daemon.js"
37
- },
38
- "dependencies": {
39
- "@anthropic-ai/claude-agent-sdk": "0.3.195",
40
- "@modelcontextprotocol/sdk": "1.30.0",
41
- "@noble/ciphers": "2.1.1",
42
- "@noble/curves": "2.0.1",
43
- "@noble/hashes": "2.0.1",
44
- "acme-client": "5.4.0",
45
- "electron": "43.4.1",
46
- "ts-mls": "1.6.2",
47
- "undici": "7.29.0",
48
- "ws": "8.21.0"
31
+ "relay": "bootstrap/relay-setup.cjs"
49
32
  },
33
+ "main": "bootstrap/relay-setup.cjs",
34
+ "scripts": {},
35
+ "dependencies": {},
50
36
  "devDependencies": {
51
37
  "@anthropic-ai/claude-agent-sdk": "0.3.195",
52
38
  "@modelcontextprotocol/sdk": "1.30.0",
@@ -63,13 +49,7 @@
63
49
  "ws": "8.21.0"
64
50
  },
65
51
  "files": [
66
- "bin",
67
- "bootstrap",
68
- "src",
69
- "overlay",
70
- "THIRD_PARTY_NOTICES.md",
71
- "licenses",
72
- "npm-shrinkwrap.json"
52
+ "bootstrap"
73
53
  ],
74
- "relayDistribution": "bridge-runtime"
54
+ "relayDistribution": "thin-installer"
75
55
  }
@@ -1,49 +0,0 @@
1
- # Third-party notices
2
-
3
- The Relay preview preload embeds the following open-source software in
4
- `overlay/preview-preload.cjs`.
5
-
6
- ## markdown-it 14.3.0
7
-
8
- Copyright (c) 2014 Vitaly Puzrin, Alex Kocharin.
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
27
-
28
- ## DOMPurify 3.4.13
29
-
30
- Copyright (c) Cure53 and other contributors.
31
-
32
- DOMPurify is distributed under the Apache License 2.0 or the Mozilla Public
33
- License 2.0. Relay distributes its embedded copy under the Apache License 2.0.
34
- The complete terms are included in [`licenses/Apache-2.0.txt`](licenses/Apache-2.0.txt).
35
-
36
- ## E2EE runtime libraries (MIT)
37
-
38
- The Companion uses the following packages for its RFC 9420 one-to-one text
39
- implementation. Each npm package includes its own complete MIT license text.
40
-
41
- - `ts-mls` 1.6.2 — Copyright Luka Jacobowitz and contributors.
42
- - `@hpke/core` 1.8.0 — Copyright hpke-js contributors.
43
- - `@noble/hashes` 2.0.1 — Copyright Paul Miller and contributors.
44
- - `@noble/ciphers` 2.1.1 — Copyright Paul Miller and contributors.
45
- - `@noble/curves` 2.0.1 — Copyright Paul Miller and contributors.
46
-
47
- `ts-mls` states that it has not undergone a formal security audit. Relay's own
48
- architecture documentation treats independent cryptographic and application
49
- review as a prerequisite for a public production E2EE claim.
package/bin/relay-hook.js DELETED
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- // Dedicated hook entrypoint: unlike the user-facing CLI, this does not import
4
- // setup, updater, Electron, MCP, or daemon modules on every agent event.
5
- const hook = process.argv[2];
6
-
7
- try {
8
- if (hook === "claude-hook") {
9
- const { runClaudeHook } = await import("../src/claude-hook.js");
10
- await runClaudeHook();
11
- } else if (hook === "codex-hook") {
12
- const { runCodexHook } = await import("../src/codex-hook.js");
13
- await runCodexHook();
14
- }
15
- } catch {
16
- // Hook context is advisory. It must never block or visibly break the host.
17
- process.exitCode = 0;
18
- }