oysterun 1.6.0-beta.21 → 1.6.0-beta.23

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 (243) hide show
  1. package/README.md +2 -7
  2. package/bin/oysterun.mjs +25 -22
  3. package/dev/client/connectivity/host-connection-feedback.mjs +3 -1
  4. package/dev/client/connectivity/logical-host-connection.mjs +4 -0
  5. package/dev/client/connectivity/managed-host-browser.mjs +36 -6
  6. package/dev/client/web/index.html +842 -876
  7. package/dev/client/web-chat/dist/assets/{ReactPrism-C6YiTZTC.js → ReactPrism-CSVi7uVo.js} +1 -1
  8. package/dev/client/web-chat/dist/assets/{ReactPrism-C6YiTZTC.js.map → ReactPrism-CSVi7uVo.js.map} +1 -1
  9. package/dev/client/web-chat/dist/assets/SessionsSetupApp-CXbqDUMO.js +6348 -0
  10. package/dev/client/web-chat/dist/assets/{SessionsSetupApp-CKJOSPFP.js.map → SessionsSetupApp-CXbqDUMO.js.map} +1 -1
  11. package/dev/client/web-chat/dist/assets/SessionsSetupApp-CkENGhE-.css +1 -0
  12. package/dev/client/web-chat/dist/assets/{index-CN_FoTB1.js → index-1eoKcCH8.js} +2 -2
  13. package/dev/client/web-chat/dist/assets/{index-CN_FoTB1.js.map → index-1eoKcCH8.js.map} +1 -1
  14. package/dev/client/web-chat/dist/assets/{index-Ae5I4LHp.js → index-BqUAQMQT.js} +2 -2
  15. package/dev/client/web-chat/dist/assets/{index-Ae5I4LHp.js.map → index-BqUAQMQT.js.map} +1 -1
  16. package/dev/client/web-chat/dist/assets/{index-DCQFwgGf.js → index-Cm_tOW2z.js} +1 -1
  17. package/dev/client/web-chat/dist/assets/{index-DCQFwgGf.js.map → index-Cm_tOW2z.js.map} +1 -1
  18. package/dev/client/web-chat/dist/assets/{matrix-entry-abAy3aOo.js → matrix-entry-DllR5zcs.js} +165 -165
  19. package/dev/client/web-chat/dist/assets/matrix-entry-DllR5zcs.js.map +1 -0
  20. package/dev/client/web-chat/dist/assets/{pdf-DN7oVvM6.js → pdf-BxFfw3lg.js} +3 -3
  21. package/dev/client/web-chat/dist/assets/{pdf-DN7oVvM6.js.map → pdf-BxFfw3lg.js.map} +1 -1
  22. package/dev/client/web-chat/dist/assets/{web-BlYuDlOV.js → web-BXiFv31Q.js} +1 -1
  23. package/dev/client/web-chat/dist/assets/{web-BlYuDlOV.js.map → web-BXiFv31Q.js.map} +1 -1
  24. package/dev/client/web-chat/dist/assets/{web-Dabw6cJi.js → web-CnI8aoRK.js} +1 -1
  25. package/dev/client/web-chat/dist/assets/{web-Dabw6cJi.js.map → web-CnI8aoRK.js.map} +1 -1
  26. package/dev/client/web-chat/dist/index.html +1 -1
  27. package/docs/routec/config_hierachy.md +28 -22
  28. package/docs/routec/dev/host_update_runtime_identity.md +42 -1
  29. package/docs/routec/dev/npmjs_publish.md +143 -19
  30. package/docs/routec/form_UI_fields.md +1 -2
  31. package/docs/routec/host_cloud_app_auth.md +4 -4
  32. package/docs/routec/host_setup.md +28 -37
  33. package/docs/routec/oysterun_operation_interface_spec.md +6 -5
  34. package/docs/routec/skill_installation.md +0 -1
  35. package/host-service/README.md +18 -25
  36. package/host-service/adapters/claude-code-adapter.mjs +123 -19
  37. package/host-service/agent-config-migration.mjs +3 -2
  38. package/host-service/agent-config.mjs +26 -4
  39. package/host-service/apns-complete-message-dispatcher.mjs +6 -7
  40. package/host-service/apns-config.mjs +2 -1
  41. package/host-service/apns-device-store.mjs +7 -3
  42. package/host-service/assets/product-skills/Oysterun/SKILL.md +0 -1
  43. package/host-service/assets/product-skills/Oysterun/modules/oysterun-session-chat/SKILL.md +11 -10
  44. package/host-service/assets/product-skills/Oysterun/modules/oysterun-sessions/SKILL.md +24 -10
  45. package/host-service/assets/product-skills/Oysterun/modules/oysterun-website/SKILL.md +2 -2
  46. package/host-service/assets/product-skills/oysterun-session-chat/SKILL.md +11 -10
  47. package/host-service/assets/product-skills/oysterun-sessions/SKILL.md +24 -10
  48. package/host-service/assets/product-skills/oysterun-website/SKILL.md +2 -2
  49. package/host-service/atomic-file.mjs +184 -14
  50. package/host-service/claude-acp-model-discovery.mjs +106 -22
  51. package/host-service/claude-acp-model-error-classification.mjs +97 -0
  52. package/host-service/cli/check-storage-migration.mjs +41 -0
  53. package/host-service/cli/prepare-storage-layout.mjs +41 -0
  54. package/host-service/cli/product-cli.mjs +136 -46
  55. package/host-service/cli/recover-installer-lifecycle.mjs +2 -1
  56. package/host-service/cli/run-host-lifecycle.mjs +26 -2
  57. package/host-service/cli-profile-storage.mjs +69 -0
  58. package/host-service/cloud-identity-envelope.mjs +93 -0
  59. package/host-service/complete-cli-uninstall.mjs +8 -3
  60. package/host-service/config-storage-shape.mjs +48 -0
  61. package/host-service/config.mjs +167 -179
  62. package/host-service/connectivity/managed-tunnel-runtime-status.mjs +5 -5
  63. package/host-service/connectivity/transport-usage-circuit-store.mjs +2 -6
  64. package/host-service/desired-open-session-state.mjs +5 -3
  65. package/host-service/frp-agent.mjs +14 -10
  66. package/host-service/host-lifecycle-recovery.mjs +29 -15
  67. package/host-service/host-login-bootstrap-tokens.mjs +21 -34
  68. package/host-service/host-restart-login-gate.mjs +4 -7
  69. package/host-service/host-runtime-diagnostics.mjs +10 -17
  70. package/host-service/host-telemetry.mjs +4 -5
  71. package/host-service/initial-preflight-recovery.mjs +2 -1
  72. package/host-service/installer-recovery-guidance.mjs +4 -3
  73. package/host-service/installer-reinstall-bindings.mjs +2 -1
  74. package/host-service/installer-reinstall-target.mjs +2 -1
  75. package/host-service/large-tool-call-store.mjs +4 -2
  76. package/host-service/lifecycle-compat-preload.mjs +1 -1
  77. package/host-service/lifecycle-compatibility.mjs +5 -4
  78. package/host-service/lifecycle-continuity-assets.mjs +24 -10
  79. package/host-service/lifecycle-continuity-probe.mjs +9 -3
  80. package/host-service/lifecycle-continuity-projection.mjs +2 -0
  81. package/host-service/lifecycle-continuity-runner.mjs +5 -12
  82. package/host-service/lifecycle-continuity.mjs +99 -46
  83. package/host-service/lifecycle-diagnostics.mjs +54 -8
  84. package/host-service/lifecycle-service-render-bundle.mjs +3 -2
  85. package/host-service/lifecycle-user-path.mjs +4 -0
  86. package/host-service/log-retention.mjs +199 -0
  87. package/host-service/mail-notification-dispatcher.mjs +6 -7
  88. package/host-service/mail-store.mjs +2 -1
  89. package/host-service/managed-identity-lifecycle.mjs +3 -31
  90. package/host-service/matrix-room-binding.mjs +8 -7
  91. package/host-service/node-npm-runtime-identity.mjs +2 -1
  92. package/host-service/onboard.mjs +9 -17
  93. package/host-service/package.json +1 -1
  94. package/host-service/product-runtime-host-origin.mjs +10 -13
  95. package/host-service/provider-model-params.mjs +34 -13
  96. package/host-service/provider-model-refresh-runner.mjs +16 -3
  97. package/host-service/registered-update-authority.mjs +0 -13
  98. package/host-service/replay-claude-acp-raw-events.mjs +6 -3
  99. package/host-service/restart-restore-state.mjs +4 -7
  100. package/host-service/routec-artifacts.mjs +6 -4
  101. package/host-service/routec-matrix-media-store.mjs +8 -12
  102. package/host-service/routec-matrix-sqlite-store.mjs +43 -71
  103. package/host-service/routec-matrix-storage-adapter.mjs +5 -2
  104. package/host-service/routec-matrix-storage-paths.mjs +16 -2
  105. package/host-service/routec-matrix-stream-seq-repair.mjs +5 -6
  106. package/host-service/routec-viewport-geometry-diagnostics.mjs +2 -1
  107. package/host-service/scheduler-setup-snapshot-contract.mjs +12 -0
  108. package/host-service/scheduler-store.mjs +2 -1
  109. package/host-service/server.mjs +276 -243
  110. package/host-service/service-control-token.mjs +7 -13
  111. package/host-service/service-definition-migration.mjs +70 -13
  112. package/host-service/session-assets.mjs +3 -2
  113. package/host-service/session-collection-service.mjs +13 -0
  114. package/host-service/session-history.mjs +15 -34
  115. package/host-service/session-loop-definitions.mjs +4 -21
  116. package/host-service/session-manager.mjs +156 -57
  117. package/host-service/session-name-counter-store.mjs +2 -1
  118. package/host-service/session-notification-settings-store.mjs +3 -2
  119. package/host-service/session-tags.mjs +11 -34
  120. package/host-service/session-transcript-target.mjs +4 -7
  121. package/host-service/setup-input-file.mjs +6 -4
  122. package/host-service/setup-provider-model-defaults.mjs +6 -1
  123. package/host-service/setup.mjs +58 -576
  124. package/host-service/stopped-user-host-package.mjs +2 -1
  125. package/host-service/storage-continuity.mjs +120 -0
  126. package/host-service/storage-database.mjs +115 -0
  127. package/host-service/storage-layout-cli.mjs +15 -0
  128. package/host-service/storage-layout.mjs +401 -0
  129. package/host-service/storage-lifecycle.mjs +337 -0
  130. package/host-service/storage-lock.mjs +178 -0
  131. package/host-service/storage-migration.mjs +812 -0
  132. package/host-service/storage-references.mjs +72 -0
  133. package/host-service/storage-service-binding.mjs +255 -0
  134. package/host-service/storage-snapshot.mjs +101 -0
  135. package/host-service/telegram-adapter.mjs +7 -1
  136. package/host-service/telegram-bridge.mjs +195 -0
  137. package/host-service/telegram-media.mjs +11 -14
  138. package/host-service/test-fixtures/p316/rca-run1-chunks.json +71 -0
  139. package/host-service/test-fixtures/p316/rca-run2-chunks.json +213 -0
  140. package/host-service/tool-event-detail-store.mjs +8 -11
  141. package/host-service/transcript-store.mjs +16 -14
  142. package/host-service/update-reminder-state.mjs +7 -8
  143. package/host-service/upload-manager.mjs +3 -2
  144. package/host-service/voice-input-service.mjs +5 -13
  145. package/host-service/voice-input-usage-store.mjs +2 -1
  146. package/package.json +2 -1
  147. package/static/site/docs/choose-and-recover-a-provider/assets/publication/provider-refresh-ready.png +0 -0
  148. package/static/site/docs/choose-and-recover-a-provider/assets/publication-screenshots.json +22 -12
  149. package/static/site/docs/choose-and-recover-a-provider/en/index.html +2 -2
  150. package/static/site/docs/choose-and-recover-a-provider/en/index.md +2 -2
  151. package/static/site/docs/choose-and-recover-a-provider/zh/index.html +2 -2
  152. package/static/site/docs/choose-and-recover-a-provider/zh/index.md +2 -2
  153. package/static/site/docs/configure-session-files-and-settings/assets/publication/folder-picker-focused.png +0 -0
  154. package/static/site/docs/configure-session-files-and-settings/assets/publication/session-profile-root.png +0 -0
  155. package/static/site/docs/configure-session-files-and-settings/assets/publication/session-setup-confirmed.png +0 -0
  156. package/static/site/docs/configure-session-files-and-settings/assets/publication-screenshots.json +18 -18
  157. package/static/site/docs/configure-session-files-and-settings/en/index.html +4 -4
  158. package/static/site/docs/configure-session-files-and-settings/en/index.md +3 -3
  159. package/static/site/docs/configure-session-files-and-settings/zh/index.html +4 -4
  160. package/static/site/docs/configure-session-files-and-settings/zh/index.md +3 -3
  161. package/static/site/docs/generated_manifest.json +82 -82
  162. package/static/site/docs/host-authentication-and-connection/assets/publication/sessions-connected-managed.png +0 -0
  163. package/static/site/docs/host-authentication-and-connection/assets/publication-screenshots.json +13 -13
  164. package/static/site/docs/host-authentication-and-connection/en/index.html +7 -7
  165. package/static/site/docs/host-authentication-and-connection/en/index.md +9 -9
  166. package/static/site/docs/host-authentication-and-connection/zh/index.html +7 -7
  167. package/static/site/docs/host-authentication-and-connection/zh/index.md +9 -9
  168. package/static/site/docs/install-and-use-a-skill/en/index.html +0 -1
  169. package/static/site/docs/install-and-use-a-skill/en/index.md +0 -4
  170. package/static/site/docs/install-and-use-a-skill/zh/index.html +0 -1
  171. package/static/site/docs/install-and-use-a-skill/zh/index.md +0 -4
  172. package/static/site/docs/restore-work-after-a-host-restart/assets/publication/restart-control.png +0 -0
  173. package/static/site/docs/restore-work-after-a-host-restart/assets/publication-screenshots.json +7 -7
  174. package/static/site/docs/restore-work-after-a-host-restart/en/index.html +2 -2
  175. package/static/site/docs/restore-work-after-a-host-restart/en/index.md +2 -2
  176. package/static/site/docs/restore-work-after-a-host-restart/zh/index.html +2 -2
  177. package/static/site/docs/restore-work-after-a-host-restart/zh/index.md +2 -2
  178. package/static/site/docs/set-up-and-understand-a-host/assets/publication/host-identity-browse-root.png +0 -0
  179. package/static/site/docs/set-up-and-understand-a-host/assets/publication/host-setup-managed-ready.png +0 -0
  180. package/static/site/docs/set-up-and-understand-a-host/assets/publication/host-setup-seven-steps.png +0 -0
  181. package/static/site/docs/set-up-and-understand-a-host/assets/publication/session-profile-identity.png +0 -0
  182. package/static/site/docs/set-up-and-understand-a-host/assets/publication/session-setup-identity.png +0 -0
  183. package/static/site/docs/set-up-and-understand-a-host/assets/publication/website-link.png +0 -0
  184. package/static/site/docs/set-up-and-understand-a-host/assets/publication-screenshots.json +63 -51
  185. package/static/site/docs/set-up-and-understand-a-host/en/index.html +17 -17
  186. package/static/site/docs/set-up-and-understand-a-host/en/index.md +16 -48
  187. package/static/site/docs/set-up-and-understand-a-host/zh/index.html +17 -17
  188. package/static/site/docs/set-up-and-understand-a-host/zh/index.md +16 -48
  189. package/static/site/install.sh +83 -21
  190. package/static/site_source/content/AGENTS.md +5 -12
  191. package/static/site_source/content/tutorials/published/choose-and-recover-a-provider/assets/publication/provider-refresh-ready.png +0 -0
  192. package/static/site_source/content/tutorials/published/choose-and-recover-a-provider/assets/publication-screenshots.json +22 -12
  193. package/static/site_source/content/tutorials/published/choose-and-recover-a-provider/en/article.html +2 -2
  194. package/static/site_source/content/tutorials/published/choose-and-recover-a-provider/zh/article.html +2 -2
  195. package/static/site_source/content/tutorials/published/configure-session-files-and-settings/assets/publication/folder-picker-focused.png +0 -0
  196. package/static/site_source/content/tutorials/published/configure-session-files-and-settings/assets/publication/session-profile-root.png +0 -0
  197. package/static/site_source/content/tutorials/published/configure-session-files-and-settings/assets/publication/session-setup-confirmed.png +0 -0
  198. package/static/site_source/content/tutorials/published/configure-session-files-and-settings/assets/publication-screenshots.json +18 -18
  199. package/static/site_source/content/tutorials/published/configure-session-files-and-settings/en/article.html +3 -3
  200. package/static/site_source/content/tutorials/published/configure-session-files-and-settings/zh/article.html +3 -3
  201. package/static/site_source/content/tutorials/published/host-authentication-and-connection/assets/publication/sessions-connected-managed.png +0 -0
  202. package/static/site_source/content/tutorials/published/host-authentication-and-connection/assets/publication-screenshots.json +13 -13
  203. package/static/site_source/content/tutorials/published/host-authentication-and-connection/en/article.html +6 -6
  204. package/static/site_source/content/tutorials/published/host-authentication-and-connection/zh/article.html +6 -6
  205. package/static/site_source/content/tutorials/published/install-and-use-a-skill/en/article.html +0 -1
  206. package/static/site_source/content/tutorials/published/install-and-use-a-skill/zh/article.html +0 -1
  207. package/static/site_source/content/tutorials/published/restore-work-after-a-host-restart/assets/publication/restart-control.png +0 -0
  208. package/static/site_source/content/tutorials/published/restore-work-after-a-host-restart/assets/publication-screenshots.json +7 -7
  209. package/static/site_source/content/tutorials/published/restore-work-after-a-host-restart/en/article.html +2 -2
  210. package/static/site_source/content/tutorials/published/restore-work-after-a-host-restart/zh/article.html +2 -2
  211. package/static/site_source/content/tutorials/published/set-up-and-understand-a-host/assets/publication/host-identity-browse-root.png +0 -0
  212. package/static/site_source/content/tutorials/published/set-up-and-understand-a-host/assets/publication/host-setup-managed-ready.png +0 -0
  213. package/static/site_source/content/tutorials/published/set-up-and-understand-a-host/assets/publication/host-setup-seven-steps.png +0 -0
  214. package/static/site_source/content/tutorials/published/set-up-and-understand-a-host/assets/publication/session-profile-identity.png +0 -0
  215. package/static/site_source/content/tutorials/published/set-up-and-understand-a-host/assets/publication/session-setup-identity.png +0 -0
  216. package/static/site_source/content/tutorials/published/set-up-and-understand-a-host/assets/publication/website-link.png +0 -0
  217. package/static/site_source/content/tutorials/published/set-up-and-understand-a-host/assets/publication-screenshots.json +63 -51
  218. package/static/site_source/content/tutorials/published/set-up-and-understand-a-host/en/article.html +16 -16
  219. package/static/site_source/content/tutorials/published/set-up-and-understand-a-host/zh/article.html +16 -16
  220. package/static/site_source/downloads/install.sh +83 -21
  221. package/tool_scripts/install_oysterun_update.mjs +93 -33
  222. package/tool_scripts/oysterun_continuity_transaction.mjs +97 -93
  223. package/tool_scripts/oysterun_npm_package_manifest.mjs +16 -1
  224. package/tool_scripts/oysterun_service_common.sh +72 -15
  225. package/tool_scripts/oysterun_setup_input.sh +77 -16
  226. package/tool_scripts/oysterun_update_restart_runner.mjs +3 -5
  227. package/tool_scripts/p233_legacy_bootstrap.mjs +1 -1
  228. package/tool_scripts/run_oysterun_host.sh +1 -0
  229. package/tool_scripts/stack_dashboard_credentials.mjs +28 -12
  230. package/tool_scripts/start_oysterun.sh +2 -0
  231. package/tool_scripts/sync_host_stack_config.mjs +23 -13
  232. package/tool_scripts/test_environment_remote_cloud_deprovision.mjs +13 -10
  233. package/dev/client/web-chat/dist/assets/SessionsSetupApp-CKJOSPFP.js +0 -6442
  234. package/dev/client/web-chat/dist/assets/SessionsSetupApp-Dx09Uz-6.css +0 -1
  235. package/dev/client/web-chat/dist/assets/matrix-entry-abAy3aOo.js.map +0 -1
  236. package/host-service/agent-store-demo.mjs +0 -369
  237. package/host-service/assets/product-skills/Oysterun/modules/oysterun-find-context/SKILL.md +0 -114
  238. package/host-service/assets/product-skills/Oysterun/modules/oysterun-find-context/scripts/oysterun_find_context.mjs +0 -49
  239. package/host-service/assets/product-skills/oysterun-find-context/SKILL.md +0 -114
  240. package/host-service/assets/product-skills/oysterun-find-context/scripts/oysterun_find_context.mjs +0 -49
  241. package/host-service/legacy-continuity-observation.mjs +0 -33
  242. package/static/site/docs/host-authentication-and-connection/assets/publication/sessions-connected-direct-host.png +0 -0
  243. package/static/site_source/content/tutorials/published/host-authentication-and-connection/assets/publication/sessions-connected-direct-host.png +0 -0
package/README.md CHANGED
@@ -130,7 +130,6 @@ Oysterun through its supported CLI rather than direct Host API calls:
130
130
 
131
131
  - `skills/oysterun-sessions`
132
132
  - `skills/oysterun-session-chat`
133
- - `skills/oysterun-find-context`
134
133
  - `skills/oysterun-scheduler`
135
134
  - `skills/oysterun-notifications`
136
135
  - `skills/oysterun-mail`
@@ -248,9 +247,7 @@ npm start
248
247
  Useful commands:
249
248
 
250
249
  ```bash
251
- npm run setup # first-run Managed Tunnel Host setup
252
- node host-service/setup.mjs # source-local Direct Host setup
253
- node bin/oysterun.mjs setup --local # explicit local-only Direct setup
250
+ npm run setup # first-run Managed Tunnel Host setup (the only setup path)
254
251
  npm start # plain start, no watch mode
255
252
  npm run dev # watch mode for Host JS files
256
253
  npm run cli # local CLI client
@@ -270,11 +267,9 @@ Port notes:
270
267
  - phone app verification can use any running Host port; point the app at the actual user-approved port for that run
271
268
  - backend URL default is `http://localhost:8000`
272
269
  - Host config is stored in `~/.oysterun/config.json`
273
- - direct mode can also store an optional `public_base_url` there for manual client connection
274
270
  - fresh Session Setup runtime defaults, including interface style plus Claude/Codex provider defaults, are stored there under `session_defaults`
275
271
  - Host Preferences shows the active config path, so `OYSTERUN_CONFIG_DIR` overrides are visible in the UI
276
- - release setup defaults to Oysterun Managed Tunnel
277
- - source-local setup and `oysterun setup --local` retain explicit Direct mode
272
+ - every setup registers the Host with Oysterun Managed Tunnel; the registered Tunnel URL is the Host's formal address for the web, the App, login QR codes, the CLI and Agents (P296). The local listener and loopback health URLs remain internal addresses.
278
273
 
279
274
  ### Optional: start backend + Host together for repo development
280
275
 
package/bin/oysterun.mjs CHANGED
@@ -2,11 +2,14 @@
2
2
 
3
3
  import { existsSync, readFileSync } from "node:fs";
4
4
  import { spawnSync } from "node:child_process";
5
- import { dirname, join, resolve } from "node:path";
5
+ import { dirname, join, relative, resolve } from "node:path";
6
6
  import { fileURLToPath } from "node:url";
7
7
  import {
8
8
  getConfigPath,
9
+ getConfigDir,
9
10
  readRawConfigSource,
11
+ readDashboardCredentials,
12
+ readCloudIdentity,
10
13
  } from "../host-service/config.mjs";
11
14
  import {
12
15
  PRODUCT_CLI_MODULES,
@@ -56,10 +59,11 @@ function run(command, args, { setupInput = false } = {}) {
56
59
  }
57
60
 
58
61
  function runSetup(args = []) {
59
- const setupArgs = args.includes("--local")
60
- ? args.filter((arg) => arg !== "--local")
61
- : ["--release-setup", ...args];
62
- run(process.execPath, [setupScript, ...setupArgs]);
62
+ if (args.includes("--local")) {
63
+ console.error("oysterun: setup --local was removed; `oysterun setup` registers this Host with Oysterun Managed Tunnel.");
64
+ process.exit(2);
65
+ }
66
+ run(process.execPath, [setupScript, "--release-setup", ...args]);
63
67
  }
64
68
 
65
69
  function runService(command, args = []) {
@@ -149,23 +153,25 @@ function inspectConfig() {
149
153
  return {
150
154
  configured: false,
151
155
  configPath,
152
- missing: ["config.json"],
156
+ // Name the layout-aware file actually checked (config/host.json on v2).
157
+ missing: [relative(getConfigDir(), configPath)],
153
158
  raw: {},
154
159
  };
155
160
  }
156
161
 
157
- const raw = readRawConfigSource();
162
+ const raw = { ...readRawConfigSource(), ...readDashboardCredentials() };
158
163
  const missing = [];
159
164
  const port = Number(raw.port);
160
165
  if (!Number.isInteger(port) || port <= 0) missing.push("port");
161
166
  if (!isNonEmptyString(raw.dashboard_password_hash)) {
162
167
  missing.push("dashboard_password_hash");
163
168
  }
164
- if (
165
- !isNonEmptyString(raw.direct_host_url) &&
166
- !isNonEmptyString(raw.public_base_url)
167
- ) {
168
- missing.push("direct_host_url or public_base_url");
169
+ // A configured Host has its registered identity and formal Tunnel URL.
170
+ const identity = readCloudIdentity();
171
+ if (!isNonEmptyString(raw.managed_endpoint)) missing.push("managed_endpoint");
172
+ if (!isNonEmptyString(identity.device_id || identity.host_id) ||
173
+ !isNonEmptyString(identity.device_token || identity.host_credential)) {
174
+ missing.push("registered Host identity");
169
175
  }
170
176
 
171
177
  return {
@@ -222,8 +228,9 @@ Product modules:
222
228
 
223
229
  Chat transcript reads:
224
230
  chat recent|messages|messages-around|search [--session-id <exact_id>]
225
- A verified live Agent can read its Agent's stopped/history target without
226
- starting it. History names are unsupported; use an exact retained Session ID.
231
+ A verified live Session can read any retained stopped Session, of any Agent,
232
+ without starting it. History names are unsupported; use an exact retained
233
+ Session ID (list them with: sessions history [--limit 1..100]).
227
234
  chat messages --session-id <history_id> [--limit 20] [--next-batch <opaque>]
228
235
  History page limits are 1..100; live messages retain --after-seq.
229
236
  History read authority does not authorize send, loop, profile or lifecycle.
@@ -236,9 +243,8 @@ Session tags:
236
243
 
237
244
  First run:
238
245
  If Host config is missing or incomplete, 'oysterun' enters setup.
239
- Release setup uses Oysterun Managed Tunnel by default.
240
- Use 'oysterun setup --local' for local-only Direct Host setup.
241
- Use '--enable-cloud-direct' only for advanced Direct Cloud registration.
246
+ Setup registers this Host with Oysterun Managed Tunnel; its Tunnel URL is the
247
+ Host address used by the web, the App, QR login, the CLI and Agents.
242
248
 
243
249
  Install contract:
244
250
  npm install -g oysterun installs files only. It does not run setup or start
@@ -296,7 +302,7 @@ function runUninstall(args = []) {
296
302
  }
297
303
 
298
304
  const configPath = getConfigPath();
299
- const configDir = dirname(configPath);
305
+ const configDir = getConfigDir();
300
306
  const defaultBrowsePath = readConfiguredDefaultBrowsePath();
301
307
  const deleteConfig = options.confirm === "DELETE";
302
308
  if (deleteConfig) {
@@ -379,10 +385,7 @@ function runUninstall(args = []) {
379
385
 
380
386
  function printConfiguredStatus(status) {
381
387
  const config = status.raw;
382
- const url =
383
- config.direct_host_url ||
384
- config.public_base_url ||
385
- (config.port ? `http://localhost:${config.port}` : "(unknown)");
388
+ const url = config.managed_endpoint || "(not registered)";
386
389
  console.log("Oysterun Host is configured.");
387
390
  console.log(`Config: ${status.configPath}`);
388
391
  console.log(`Web: ${url}/app/sessions`);
@@ -20,7 +20,9 @@ export function normalizeHostConnectionStatus(status = {}) {
20
20
  ["closed", "disconnected", "recovering", "unavailable"].includes(
21
21
  status.connection_state
22
22
  );
23
- let qualifier = "Direct Host";
23
+ // P296: a page not opened through the Tunnel URL reaches the Host on a
24
+ // local address; this is a status description, not a separate entry.
25
+ let qualifier = "Local address";
24
26
  if (originKind === "managed_endpoint") {
25
27
  qualifier =
26
28
  activePathKind === "webrtc" ? "Managed WebRTC" : "Managed Endpoint";
@@ -334,6 +334,7 @@ export class OysterunLogicalHostConnection {
334
334
  syncOwnerId = null,
335
335
  timeoutMs = undefined,
336
336
  onUploadProgress = null,
337
+ onDispatch = null,
337
338
  } = {}
338
339
  ) {
339
340
  if (this.closed) throw new Error("Logical Host connection is closed");
@@ -349,6 +350,9 @@ export class OysterunLogicalHostConnection {
349
350
  const isMatrixSync = MATRIX_SYNC_PATH.test(request.path);
350
351
  const startedAt = Date.now();
351
352
  const releaseTransport = this.acquireTransportLease(transport);
353
+ // P308: report the transport that really carries this request; the caller
354
+ // decodes and meters by it, not by the path it saw before awaiting the body.
355
+ onDispatch?.({ pathKind });
352
356
  this.emitDiagnostic({
353
357
  event_type: isMatrixSync
354
358
  ? "matrix_sync_request_started"
@@ -816,6 +816,17 @@ function responseFromBootstrapLogicalResult(result) {
816
816
  });
817
817
  }
818
818
 
819
+ // P308: the response envelope belongs to the transport that carried the request.
820
+ function responseFromDispatchedLogicalResult(result, dispatchedPathKind) {
821
+ return dispatchedPathKind === "webrtc"
822
+ ? responseFromLogicalResult(result)
823
+ : responseFromBootstrapLogicalResult(result);
824
+ }
825
+
826
+ function transportAccountingKind(pathKind) {
827
+ return pathKind === "webrtc" ? "datachannel" : "bootstrap";
828
+ }
829
+
819
830
  function logicalResultBodyByteLength(result) {
820
831
  if (result?.response?.body instanceof Uint8Array) {
821
832
  return result.response.body.byteLength;
@@ -2480,7 +2491,7 @@ export class ManagedHostBrowserConnection {
2480
2491
  }
2481
2492
  : {}),
2482
2493
  };
2483
- recordTransportRequest(this.accounting, "bootstrap", path);
2494
+ let dispatchedPathKind = "bootstrap";
2484
2495
  let result;
2485
2496
  try {
2486
2497
  result = await this.logicalConnection.request(requestPayload, {
@@ -2488,6 +2499,14 @@ export class ManagedHostBrowserConnection {
2488
2499
  syncOwnerId: MATRIX_SYNC_PATH.test(path)
2489
2500
  ? this.ensureSyncOwner()
2490
2501
  : null,
2502
+ onDispatch: ({ pathKind }) => {
2503
+ dispatchedPathKind = pathKind;
2504
+ recordTransportRequest(
2505
+ this.accounting,
2506
+ transportAccountingKind(pathKind),
2507
+ path
2508
+ );
2509
+ },
2491
2510
  });
2492
2511
  } catch (error) {
2493
2512
  if (error?.code === HOST_UNAVAILABLE_RESPONSE_ERROR) {
@@ -2525,10 +2544,13 @@ export class ManagedHostBrowserConnection {
2525
2544
  }
2526
2545
  throw error;
2527
2546
  }
2528
- const response = responseFromBootstrapLogicalResult(result);
2547
+ const response = responseFromDispatchedLogicalResult(
2548
+ result,
2549
+ dispatchedPathKind
2550
+ );
2529
2551
  recordTransportResponseBytes(
2530
2552
  this.accounting,
2531
- "bootstrap",
2553
+ transportAccountingKind(dispatchedPathKind),
2532
2554
  logicalResultBodyByteLength(result),
2533
2555
  path
2534
2556
  );
@@ -2550,6 +2572,10 @@ export class ManagedHostBrowserConnection {
2550
2572
  signal: request.signal,
2551
2573
  ...(body ? { body } : {}),
2552
2574
  };
2575
+ // The body await above can outlast the WebRTC path (page backgrounded, peer
2576
+ // closed); the logical connection then dispatches on bootstrap. Decode and
2577
+ // meter by the transport that actually carried the request (P308).
2578
+ let dispatchedPathKind = "webrtc";
2553
2579
  const result = await this.logicalConnection.request(requestPayload, {
2554
2580
  requestId: createConnectivityRandomId(),
2555
2581
  syncOwnerId: MATRIX_SYNC_PATH.test(path) ? this.ensureSyncOwner() : null,
@@ -2559,15 +2585,19 @@ export class ManagedHostBrowserConnection {
2559
2585
  ? BULK_REQUEST_TIMEOUT_MS
2560
2586
  : undefined,
2561
2587
  onUploadProgress: recovery.onUploadProgress || null,
2588
+ onDispatch: ({ pathKind }) => {
2589
+ dispatchedPathKind = pathKind;
2590
+ },
2562
2591
  });
2563
- recordTransportRequest(this.accounting, "datachannel", path);
2592
+ const accountingKind = transportAccountingKind(dispatchedPathKind);
2593
+ recordTransportRequest(this.accounting, accountingKind, path);
2564
2594
  recordTransportResponseBytes(
2565
2595
  this.accounting,
2566
- "datachannel",
2596
+ accountingKind,
2567
2597
  logicalResultBodyByteLength(result),
2568
2598
  path
2569
2599
  );
2570
- return responseFromLogicalResult(result);
2600
+ return responseFromDispatchedLogicalResult(result, dispatchedPathKind);
2571
2601
  }
2572
2602
 
2573
2603
  status() {