oysterun 1.6.0-beta.40 → 1.6.0-beta.41

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 (103) hide show
  1. package/bin/oysterun.mjs +4 -2
  2. package/dev/client/connectivity/managed-host-browser.mjs +34 -29
  3. package/dev/client/connectivity/managed-host-unavailable-response.mjs +18 -0
  4. package/dev/client/connectivity/phone-chat-swipe.mjs +8 -2
  5. package/dev/client/web-chat/dist/assets/{ReactPrism-CYKwEJE8.js → ReactPrism-BeKqgGm9.js} +1 -1
  6. package/dev/client/web-chat/dist/assets/{ReactPrism-CYKwEJE8.js.map → ReactPrism-BeKqgGm9.js.map} +1 -1
  7. package/dev/client/web-chat/dist/assets/{TerminalSurface-CIjZjY-A.js → TerminalSurface-Cx7jfbay.js} +15 -15
  8. package/dev/client/web-chat/dist/assets/{TerminalSurface-CIjZjY-A.js.map → TerminalSurface-Cx7jfbay.js.map} +1 -1
  9. package/dev/client/web-chat/dist/assets/antigravity-icon__full-color-TC2DVLcA.svg +76 -0
  10. package/dev/client/web-chat/dist/assets/{index-CNKWj_sK.js → index-BcYQL95B.js} +2 -2
  11. package/dev/client/web-chat/dist/assets/{index-CNKWj_sK.js.map → index-BcYQL95B.js.map} +1 -1
  12. package/dev/client/web-chat/dist/assets/{index-DWUEXNIL.js → index-Ci2NQKTN.js} +2 -2
  13. package/dev/client/web-chat/dist/assets/{index-DWUEXNIL.js.map → index-Ci2NQKTN.js.map} +1 -1
  14. package/dev/client/web-chat/dist/assets/{index-Cc-Hn07b.js → index-Cp8KWUu3.js} +1 -1
  15. package/dev/client/web-chat/dist/assets/{index-Cc-Hn07b.js.map → index-Cp8KWUu3.js.map} +1 -1
  16. package/dev/client/web-chat/dist/assets/{index-BrluDlTu.js → index-IyKwrmfz.js} +1 -1
  17. package/dev/client/web-chat/dist/assets/{index-BrluDlTu.js.map → index-IyKwrmfz.js.map} +1 -1
  18. package/dev/client/web-chat/dist/assets/{matrix-entry-DC97uQE8.js → matrix-entry-BKi2LOMD.js} +271 -322
  19. package/dev/client/web-chat/dist/assets/matrix-entry-BKi2LOMD.js.map +1 -0
  20. package/dev/client/web-chat/dist/assets/matrix-entry-Df4NgQ0v.css +10 -0
  21. package/dev/client/web-chat/dist/assets/{pdf-BoBERmJm.js → pdf-DQ8tjRZa.js} +3 -3
  22. package/dev/client/web-chat/dist/assets/pdf-DQ8tjRZa.js.map +1 -0
  23. package/dev/client/web-chat/dist/assets/provider-avatars/opencode-avatar-dark-1024-6335c8a63b58.png +0 -0
  24. package/dev/client/web-chat/dist/assets/{web-DbOcnO_Q.js → web-B2uuxHZa.js} +1 -1
  25. package/dev/client/web-chat/dist/assets/{web-DbOcnO_Q.js.map → web-B2uuxHZa.js.map} +1 -1
  26. package/dev/client/web-chat/dist/assets/{web-BQmBj0Lf.js → web-C0rudH5j.js} +1 -1
  27. package/dev/client/web-chat/dist/assets/{web-BQmBj0Lf.js.map → web-C0rudH5j.js.map} +1 -1
  28. package/dev/client/web-chat/dist/index.html +48 -1
  29. package/docs/routec/dev/codex_thread_ownership_and_outbox_recovery.md +9 -1
  30. package/docs/routec/provider_contract.md +49 -2
  31. package/host-service/adapters/agy-acp-adapter.mjs +26 -0
  32. package/host-service/adapters/claude-code-adapter.mjs +57 -0
  33. package/host-service/adapters/codex-app-server-adapter.mjs +56 -6
  34. package/host-service/adapters/debug-fixture-provider-adapter.mjs +17 -0
  35. package/host-service/adapters/grok-acp-adapter.mjs +18 -0
  36. package/host-service/adapters/opencode-acp-adapter.mjs +1397 -0
  37. package/host-service/agent-config.mjs +31 -1
  38. package/host-service/agy-acp-model-discovery.mjs +14 -0
  39. package/host-service/agy-version.mjs +52 -0
  40. package/host-service/assets/product-skills/Oysterun/modules/oysterun-sessions/SKILL.md +7 -0
  41. package/host-service/assets/product-skills/oysterun-sessions/SKILL.md +7 -0
  42. package/host-service/callback-host-integration.mjs +20 -1
  43. package/host-service/cli/product-cli.mjs +44 -3
  44. package/host-service/cli/remove-host-terminals.mjs +25 -0
  45. package/host-service/codex-app-server-command.mjs +13 -0
  46. package/host-service/codex-model-discovery.mjs +2 -5
  47. package/host-service/complete-cli-uninstall.mjs +60 -4
  48. package/host-service/config.mjs +86 -7
  49. package/host-service/connectivity/webrtc-signaling-service.mjs +56 -6
  50. package/host-service/cross-session-search.mjs +1 -1
  51. package/host-service/desired-open-session-state.mjs +2 -0
  52. package/host-service/fixtures/p486-fake-opencode.mjs +343 -0
  53. package/host-service/folder-browser.mjs +1 -3
  54. package/host-service/frp-agent.mjs +203 -14
  55. package/host-service/host-chat-time.mjs +19 -0
  56. package/host-service/host-terminal-cleanup.mjs +45 -0
  57. package/host-service/lifecycle-continuity-runner.mjs +2 -2
  58. package/host-service/lifecycle-continuity.mjs +1 -1
  59. package/host-service/matrix-credential-issuer.mjs +48 -0
  60. package/host-service/matrix-event-writer.mjs +3 -0
  61. package/host-service/matrix-facade.mjs +7 -2
  62. package/host-service/matrix-room-binding.mjs +1 -0
  63. package/host-service/message-search-index.mjs +5 -1
  64. package/host-service/opencode-acp-model-discovery.mjs +236 -0
  65. package/host-service/opencode-auth.mjs +41 -0
  66. package/host-service/opencode-usage-export.mjs +216 -0
  67. package/host-service/opencode-version.mjs +62 -0
  68. package/host-service/package.json +1 -1
  69. package/host-service/plan-limit-readers.mjs +5 -2
  70. package/host-service/plan-limit-service.mjs +2 -2
  71. package/host-service/portable-scheduler-definitions.mjs +2 -1
  72. package/host-service/provider-auth-required.mjs +8 -0
  73. package/host-service/provider-auth.mjs +24 -0
  74. package/host-service/provider-command-detection.mjs +196 -61
  75. package/host-service/provider-model-params.mjs +10 -6
  76. package/host-service/provider-model-refresh-runner.mjs +79 -1
  77. package/host-service/provider-registry.mjs +54 -2
  78. package/host-service/provider-skill-roots.mjs +3 -0
  79. package/host-service/provider-startup-preflight.mjs +2 -1
  80. package/host-service/scheduler-acp-provider-runner.mjs +7 -1
  81. package/host-service/scheduler-direct-provider-runner.mjs +37 -2
  82. package/host-service/scheduler-rule-model.mjs +18 -0
  83. package/host-service/scheduler-service.mjs +29 -27
  84. package/host-service/scheduler-setup-snapshot-contract.mjs +9 -3
  85. package/host-service/server.mjs +619 -86
  86. package/host-service/session-collection-service.mjs +6 -0
  87. package/host-service/session-history.mjs +43 -1
  88. package/host-service/session-lifecycle-snapshot.mjs +2 -2
  89. package/host-service/session-loop-definitions.mjs +110 -38
  90. package/host-service/session-manager.mjs +278 -45
  91. package/host-service/session-model-switch.mjs +263 -0
  92. package/host-service/session-switcher-projection.mjs +4 -0
  93. package/host-service/setup.mjs +5 -1
  94. package/host-service/terminal-session-manager.mjs +1 -1
  95. package/host-service/usage-statistics.mjs +1 -1
  96. package/package.json +1 -1
  97. package/tool_scripts/oysterun_npm_package_manifest.mjs +2 -0
  98. package/tool_scripts/oysterun_service_common.sh +12 -0
  99. package/tool_scripts/uninstall_oysterun_launch_agents.sh +9 -0
  100. package/dev/client/web-chat/dist/assets/matrix-entry-6Fxm8R3m.css +0 -10
  101. package/dev/client/web-chat/dist/assets/matrix-entry-DC97uQE8.js.map +0 -1
  102. package/dev/client/web-chat/dist/assets/pdf-BoBERmJm.js.map +0 -1
  103. package/host-service/session-profile-provider-config.mjs +0 -17
package/bin/oysterun.mjs CHANGED
@@ -348,6 +348,8 @@ async function runUninstall(args = []) {
348
348
  console.log(` CLI package: remove ${plan.root}`);
349
349
  console.log(` npm: ${plan.identity.node_path} ${plan.identity.npm_cli_path} uninstall ${plan.npmArgs.join(" ")} oysterun`);
350
350
  console.log(` Prefix: ${plan.prefix}; OS user: ${plan.user.name} (uid ${plan.user.uid})`);
351
+ console.log(` Launchers: ${plan.launchers.length ? plan.launchers.map(l => l.removable ? `remove ${l.path}` : `${l.path} needs: sudo rm ${l.path}`).join("; ") : "none found"}`);
352
+ console.log(` Kept: ${plan.kept.join("; ")}`);
351
353
  const cloud = describeCloudRetirement({ hostConfig });
352
354
  console.log(
353
355
  cloud.status === "will_retire"
@@ -414,7 +416,7 @@ async function runUninstall(args = []) {
414
416
 
415
417
  const result = spawnSync(releaseServiceScript, serviceArgs, {
416
418
  cwd: repoRoot,
417
- env: process.env,
419
+ env: { ...process.env, OYSTERUN_BOOTSTRAP_NODE_BIN: process.execPath },
418
420
  stdio: "inherit",
419
421
  });
420
422
  if (result.error) {
@@ -449,7 +451,7 @@ function printConfiguredStatus(status) {
449
451
  console.log("Service status:");
450
452
  const result = spawnSync(releaseServiceScript, ["status"], {
451
453
  cwd: repoRoot,
452
- env: process.env,
454
+ env: { ...process.env, OYSTERUN_BOOTSTRAP_NODE_BIN: process.execPath },
453
455
  stdio: "inherit",
454
456
  });
455
457
  if (result.error) {
@@ -6,6 +6,7 @@ import {
6
6
  import { createConnectivityRandomId } from "./random-id.mjs";
7
7
  import { OysterunWebRtcLogicalTransport } from "./webrtc-logical-transport.mjs";
8
8
  import { boundedDiagnosticErrorMessage } from "./diagnostic-error-message.mjs";
9
+ import { isManagedHostUnavailableResponse } from "./managed-host-unavailable-response.mjs";
9
10
 
10
11
  const DASHBOARD_TOKEN_KEY = "oysterun_token";
11
12
  const FAILED_DIAGNOSTIC_BUFFER_KEY = "oysterun_failed_browser_diagnostics_v1";
@@ -44,9 +45,6 @@ const PRESENCE_HEALTH_RECOVERY_MAX_TOTAL_MS = 10_000;
44
45
  const MANAGED_URL_PROBE_INTERVAL_MS = 3_000;
45
46
  const BACKGROUND_PROMOTION_ATTEMPT_LIMIT = 4;
46
47
  const BACKGROUND_PROMOTION_WINDOW_MS = 30 * 60 * 1000;
47
- const HOST_UNAVAILABLE_BODY_MAX_BYTES = 16 * 1024;
48
- const HOST_UNAVAILABLE_MARKER =
49
- '<meta name="oysterun-route-state" content="host-unavailable">';
50
48
  const HOST_UNAVAILABLE_RESPONSE_ERROR =
51
49
  "managed_host_route_unavailable_response";
52
50
  const BULK_REQUEST_TIMEOUT_MS = 120_000;
@@ -59,7 +57,30 @@ const MANAGED_WEBRTC_SELECTED_PATHS = new Set([
59
57
  "turn_tcp_tls",
60
58
  "ipv6",
61
59
  ]);
62
- const MANAGED_ENDPOINT_HOSTNAME = /^h-([a-z2-7]{16})\.tunnel\.oysterun\.com$/i;
60
+ // P484: a Host is reached by its permanent h-<token> name or by its custom name; both live on the Managed domain,
61
+ // which the Host writes into the page (host-managed-domain-json: prod tunnel.oysterun.com, a rehearsal stack its
62
+ // own). Relay's own bootstrap and turn names are not Hosts. The route token comes from the Host, never from a name.
63
+ const DEFAULT_MANAGED_DOMAIN = "tunnel.oysterun.com";
64
+ const RELAY_SERVICE_LABELS = new Set(["bootstrap", "turn"]);
65
+ const ROUTE_TOKEN = /^[a-z2-7]{16,32}$/;
66
+ function hostManagedDomain() {
67
+ try {
68
+ const element = globalThis.document?.getElementById?.("host-managed-domain-json");
69
+ const domain = element ? JSON.parse(element.textContent || "null") : null;
70
+ if (typeof domain === "string" && /^[a-z0-9-]+(?:\.[a-z0-9-]+)+$/.test(domain.toLowerCase())) {
71
+ return domain.toLowerCase();
72
+ }
73
+ } catch {
74
+ // A page without the Host's value keeps the production domain.
75
+ }
76
+ return DEFAULT_MANAGED_DOMAIN;
77
+ }
78
+ function isManagedHostHostname(hostname, domain = hostManagedDomain()) {
79
+ const name = String(hostname || "").toLowerCase();
80
+ if (!name.endsWith(`.${domain}`)) return false;
81
+ const label = name.slice(0, -domain.length - 1);
82
+ return /^[a-z0-9-]+$/.test(label) && !RELAY_SERVICE_LABELS.has(label);
83
+ }
63
84
  const SESSION_SNAPSHOT_PATH = /^\/session\/snapshot(?:\?|$)/;
64
85
  const TRANSPORT_PATH_KINDS = Object.freeze([
65
86
  "bootstrap",
@@ -295,7 +316,7 @@ export function classifyManagedHostBrowserOrigin(value = window.location.href) {
295
316
  const url = new URL(value, window.location.href);
296
317
  if (
297
318
  url.protocol === "https:" &&
298
- MANAGED_ENDPOINT_HOSTNAME.test(url.hostname)
319
+ isManagedHostHostname(url.hostname)
299
320
  ) {
300
321
  return {
301
322
  kind: "managed_endpoint",
@@ -541,29 +562,13 @@ async function waitWithAbort(promise, signal) {
541
562
  }
542
563
  }
543
564
 
544
- async function isRelayHostUnavailableResponse(response) {
545
- if (!(response instanceof Response) || response.status !== 404) return false;
546
- const contentType = String(response.headers.get("content-type") || "");
547
- if (contentType && !contentType.toLowerCase().includes("text/html")) {
548
- return false;
549
- }
550
- const contentLength = Number(response.headers.get("content-length"));
551
- if (
552
- Number.isFinite(contentLength) &&
553
- contentLength > HOST_UNAVAILABLE_BODY_MAX_BYTES
554
- ) {
555
- return false;
556
- }
557
- const body = await response.clone().text();
558
- return (
559
- new TextEncoder().encode(body).byteLength <=
560
- HOST_UNAVAILABLE_BODY_MAX_BYTES && body.includes(HOST_UNAVAILABLE_MARKER)
561
- );
562
- }
563
-
564
565
  function normalizePresenceConfiguration(configuration, origin) {
565
- const routeMatch = MANAGED_ENDPOINT_HOSTNAME.exec(new URL(origin).hostname);
566
- if (!routeMatch) return null;
566
+ if (!isManagedHostHostname(new URL(origin).hostname)) return null;
567
+ const routeToken =
568
+ typeof configuration.route_names?.route_token === "string"
569
+ ? configuration.route_names.route_token.trim().toLowerCase()
570
+ : "";
571
+ if (!ROUTE_TOKEN.test(routeToken)) return null;
567
572
  const hostId =
568
573
  typeof configuration.host_id === "string"
569
574
  ? configuration.host_id.trim()
@@ -595,7 +600,7 @@ function normalizePresenceConfiguration(configuration, origin) {
595
600
  host_id: hostId,
596
601
  cloud_api_url: cloudApiUrl.toString().replace(/\/$/, ""),
597
602
  cloud_api_stage: cloudStage,
598
- route_token: routeMatch[1].toLowerCase(),
603
+ route_token: routeToken,
599
604
  };
600
605
  }
601
606
 
@@ -1477,7 +1482,7 @@ export class ManagedHostBrowserConnection {
1477
1482
  fetchImpl,
1478
1483
  diagnostic: (event) => this.emitDiagnostic(event),
1479
1484
  responseGuard: async (response) => {
1480
- if (await isRelayHostUnavailableResponse(response)) {
1485
+ if (await isManagedHostUnavailableResponse(response)) {
1481
1486
  throw managedHostRouteUnavailableResponseError();
1482
1487
  }
1483
1488
  },
@@ -0,0 +1,18 @@
1
+ const HOST_UNAVAILABLE_BODY_MAX_BYTES = 16 * 1024;
2
+ const HOST_UNAVAILABLE_MARKER =
3
+ '<meta name="oysterun-route-state" content="host-unavailable">';
4
+
5
+ export async function isManagedHostUnavailableResponse(response) {
6
+ if (!(response instanceof Response) || response.status !== 404) return false;
7
+ const contentType = String(response.headers.get('content-type') || '');
8
+ if (contentType && !contentType.toLowerCase().includes('text/html')) return false;
9
+ const contentLength = Number(response.headers.get('content-length'));
10
+ if (Number.isFinite(contentLength) && contentLength > HOST_UNAVAILABLE_BODY_MAX_BYTES) {
11
+ return false;
12
+ }
13
+ const body = await response.clone().text();
14
+ return (
15
+ new TextEncoder().encode(body).byteLength <= HOST_UNAVAILABLE_BODY_MAX_BYTES &&
16
+ body.includes(HOST_UNAVAILABLE_MARKER)
17
+ );
18
+ }
@@ -2,14 +2,20 @@ export const PHONE_CHAT_SWIPE_DISTANCE = 80;
2
2
  export const PHONE_CHAT_SWIPE_HORIZONTAL_DOMINANCE = 1.5;
3
3
  export const PHONE_BROWSER_EDGE_PX = 24;
4
4
 
5
- export function phoneChatSwipeAction({ deltaX, deltaY, sidebarOpen, wide }) {
5
+ // P421 (Owner 2026-11-11, scope item 8): in the Route C shell a right swipe
6
+ // with the drawer open, or at desktop width, no longer goes back to the former
7
+ // Sessions page; it does nothing (`back: false`). Cinny's own pages keep back.
8
+ export function phoneChatSwipeAction({ deltaX, deltaY, sidebarOpen, wide, back = true }) {
6
9
  if (
7
10
  Math.abs(deltaX) <= PHONE_CHAT_SWIPE_DISTANCE ||
8
11
  Math.abs(deltaX) <= Math.abs(deltaY) * PHONE_CHAT_SWIPE_HORIZONTAL_DOMINANCE
9
12
  ) {
10
13
  return "none";
11
14
  }
12
- if (deltaX > 0) return sidebarOpen || wide ? "back" : "open";
15
+ if (deltaX > 0) {
16
+ if (!sidebarOpen && !wide) return "open";
17
+ return back ? "back" : "none";
18
+ }
13
19
  return sidebarOpen && !wide ? "close" : "none";
14
20
  }
15
21
 
@@ -1,4 +1,4 @@
1
- import{h as ee,k as Y,r as K,j as Z}from"./matrix-entry-DC97uQE8.js";import"./index-Cc-Hn07b.js";var X={exports:{}};(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
1
+ import{h as ee,k as Y,r as K,j as Z}from"./matrix-entry-BKi2LOMD.js";import"./index-Cp8KWUu3.js";var X={exports:{}};(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
2
2
  * Prism: Lightweight, robust, elegant syntax highlighting
3
3
  *
4
4
  * @license MIT <https://opensource.org/licenses/MIT>