oysterun 1.6.0-beta.32 → 1.6.0-beta.34

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 (63) hide show
  1. package/README.md +15 -17
  2. package/dev/client/connectivity/host-connection-feedback.mjs +12 -0
  3. package/dev/client/connectivity/managed-host-browser.mjs +75 -12
  4. package/dev/client/web/index.html +12 -69395
  5. package/dev/client/web/notification-sw.js +11 -2
  6. package/dev/client/web-chat/dist/assets/{ReactPrism-Co-6SgXR.js → ReactPrism-h7wMon6m.js} +1 -1
  7. package/dev/client/web-chat/dist/assets/{ReactPrism-Co-6SgXR.js.map → ReactPrism-h7wMon6m.js.map} +1 -1
  8. package/dev/client/web-chat/dist/assets/{TerminalSurface-MUU0Aa9O.js → TerminalSurface-CvTao9wt.js} +14 -14
  9. package/dev/client/web-chat/dist/assets/{TerminalSurface-MUU0Aa9O.js.map → TerminalSurface-CvTao9wt.js.map} +1 -1
  10. package/dev/client/web-chat/dist/assets/index-CSxogDLz.js +2 -0
  11. package/dev/client/web-chat/dist/assets/index-CSxogDLz.js.map +1 -0
  12. package/dev/client/web-chat/dist/assets/index-DTdvG5zz.js +2 -0
  13. package/dev/client/web-chat/dist/assets/index-DTdvG5zz.js.map +1 -0
  14. package/dev/client/web-chat/dist/assets/index-KsAa2cUp.js +1 -0
  15. package/dev/client/web-chat/dist/assets/index-KsAa2cUp.js.map +1 -0
  16. package/dev/client/web-chat/dist/assets/{index-BApEAFLA.js → index-ytRVq2Ob.js} +2 -2
  17. package/dev/client/web-chat/dist/assets/{index-BApEAFLA.js.map → index-ytRVq2Ob.js.map} +1 -1
  18. package/dev/client/web-chat/dist/assets/matrix-entry-CX83sjNa.js +8647 -0
  19. package/dev/client/web-chat/dist/assets/matrix-entry-CX83sjNa.js.map +1 -0
  20. package/dev/client/web-chat/dist/assets/matrix-entry-DoY5rt0R.css +10 -0
  21. package/dev/client/web-chat/dist/assets/{pdf-BEMt3hbm.js → pdf-B7PMGrRd.js} +3 -3
  22. package/dev/client/web-chat/dist/assets/pdf-B7PMGrRd.js.map +1 -0
  23. package/dev/client/web-chat/dist/assets/{web-BgmlWJdG.js → web-DcYtSbxy.js} +1 -1
  24. package/dev/client/web-chat/dist/assets/{web-BgmlWJdG.js.map → web-DcYtSbxy.js.map} +1 -1
  25. package/dev/client/web-chat/dist/assets/{web-igWDSrBQ.js → web-OfFbAdta.js} +1 -1
  26. package/dev/client/web-chat/dist/assets/{web-igWDSrBQ.js.map → web-OfFbAdta.js.map} +1 -1
  27. package/dev/client/web-chat/dist/index.html +51 -1
  28. package/dev/client/web-chat/dist/sw.js +1 -1
  29. package/dev/client/web-chat/dist/sw.js.map +1 -1
  30. package/docs/routec/dev/scheduler_mail_skill.md +3 -1
  31. package/docs/routec/oysterun_operation_interface_spec.md +21 -6
  32. package/host-service/README.md +7 -13
  33. package/host-service/assets/product-skills/Oysterun/SKILL.md +11 -1
  34. package/host-service/assets/product-skills/Oysterun/modules/oysterun-mail/SKILL.md +18 -0
  35. package/host-service/assets/product-skills/oysterun-mail/SKILL.md +18 -0
  36. package/host-service/cli/product-cli.mjs +77 -21
  37. package/host-service/cli.mjs +4 -4
  38. package/host-service/completed-turn-notification-observer.mjs +5 -2
  39. package/host-service/matrix-event-writer.mjs +3 -0
  40. package/host-service/matrix-facade.mjs +11 -9
  41. package/host-service/notification-feed-replay.mjs +60 -0
  42. package/host-service/package.json +2 -2
  43. package/host-service/provider-auth-required.mjs +62 -0
  44. package/host-service/provider-auth.mjs +4 -220
  45. package/host-service/provider-registry.mjs +1 -1
  46. package/host-service/routec-matrix-media-store.mjs +1 -1
  47. package/host-service/routec-static-encoding.mjs +62 -0
  48. package/host-service/server.mjs +294 -481
  49. package/host-service/session-collection-service.mjs +7 -2
  50. package/host-service/session-manager.mjs +218 -34
  51. package/package.json +1 -1
  52. package/dev/client/web-chat/dist/assets/SessionsSetupApp-BmHVrH9Z.js +0 -6137
  53. package/dev/client/web-chat/dist/assets/SessionsSetupApp-BmHVrH9Z.js.map +0 -1
  54. package/dev/client/web-chat/dist/assets/SessionsSetupApp-CsC74INd.css +0 -1
  55. package/dev/client/web-chat/dist/assets/index-BS_XDtVp.js +0 -9
  56. package/dev/client/web-chat/dist/assets/index-BS_XDtVp.js.map +0 -1
  57. package/dev/client/web-chat/dist/assets/index-CT1q3te6.js +0 -2
  58. package/dev/client/web-chat/dist/assets/index-CT1q3te6.js.map +0 -1
  59. package/dev/client/web-chat/dist/assets/matrix-entry-BIVffqZK.js +0 -596
  60. package/dev/client/web-chat/dist/assets/matrix-entry-BIVffqZK.js.map +0 -1
  61. package/dev/client/web-chat/dist/assets/matrix-entry-DftnSt6v.css +0 -10
  62. package/dev/client/web-chat/dist/assets/pdf-BEMt3hbm.js.map +0 -1
  63. package/dev/client/web-chat/dist/assets/session-notice-DlyODy1z.css +0 -1
package/README.md CHANGED
@@ -363,17 +363,18 @@ The web client is served by the Host service. There is no separate frontend dev
363
363
 
364
364
  Frontend files live here:
365
365
 
366
+ - `dev/client/web-chat/src/oysterun/surfaces/`
367
+ - `dev/client/web-chat/src/app/pages/Router.tsx`
366
368
  - `dev/client/web/src/index.template.html`
367
- - `dev/client/web/src/styles.css`
368
369
  - `dev/client/web/build-index.mjs`
369
370
  - `dev/client/web/index.html`
370
371
 
371
372
  How it works:
372
373
 
373
- - `src/index.template.html` is the main UI source
374
- - `src/styles.css` is injected into the template
375
- - `build-index.mjs` generates `dev/client/web/index.html`
376
- - `host-service/server.mjs` reads `dev/client/web/index.html` and serves it at `/app`
374
+ - React surfaces own every `/app/*` page and the Router selects them directly.
375
+ - `dev/client/web/src/styles.css` remains the shared Host-page style source imported by React.
376
+ - `src/index.template.html` and its generated `index.html` are inert package/service-readiness markers; the Host does not serve them for `/app/*`.
377
+ - `host-service/server.mjs` serves the web-chat production build for `/app/*`.
377
378
 
378
379
  After frontend edits:
379
380
 
@@ -382,12 +383,7 @@ cd <repo-root>
382
383
  node dev/client/web/build-index.mjs
383
384
  ```
384
385
 
385
- Then restart the Host service.
386
-
387
- Why restart is needed:
388
-
389
- - the Host service reads `dev/client/web/index.html` at startup and keeps it in memory
390
- - rebuilding the HTML alone does not refresh the running Host process
386
+ Build the React web-chat production bundle after React frontend edits.
391
387
 
392
388
  ## How To Restart Things
393
389
 
@@ -513,10 +509,12 @@ Core modules:
513
509
 
514
510
  Main files:
515
511
 
516
- - `dev/client/web/src/index.template.html`: primary UI markup and client logic
517
- - `dev/client/web/src/styles.css`: web client styles
518
- - `dev/client/web/build-index.mjs`: build step for the served HTML
519
- - `dev/client/web/index.html`: built file served by the Host
512
+ - `dev/client/web-chat/src/app/pages/Router.tsx`: `/app/*` route ownership
513
+ - `dev/client/web-chat/src/oysterun/surfaces/`: React Host-page components
514
+ - `dev/client/web/src/styles.css`: shared Host-page styles imported by React
515
+ - `dev/client/web/src/index.template.html`: inert package/service-readiness template
516
+ - `dev/client/web/build-index.mjs`: copies/formats that retained template
517
+ - `dev/client/web/index.html`: generated inert readiness artifact
520
518
 
521
519
  ## Recommended Code Reading Order
522
520
 
@@ -554,8 +552,8 @@ Within each service, use this order:
554
552
  ### Web Client
555
553
 
556
554
  1. `dev/client/README.md`
557
- 2. `dev/client/web/build-index.mjs`
558
- 3. `dev/client/web/src/index.template.html`
555
+ 2. `dev/client/web-chat/src/app/pages/Router.tsx`
556
+ 3. `dev/client/web-chat/src/oysterun/surfaces/`
559
557
  4. `dev/client/web/src/styles.css`
560
558
 
561
559
  ## Useful Docs
@@ -6,6 +6,18 @@ function boundedString(value) {
6
6
  return typeof value === "string" ? value.trim() : "";
7
7
  }
8
8
 
9
+ // R1027-OW21: a Host page shows its own connection state. The browser connection
10
+ // reports it beside the overall state; requests of the Chat client kept loaded
11
+ // behind the Host page are not part of it (beta.32 Host pages ran no Chat client).
12
+ export function hostPageConnectionStatus(status = {}) {
13
+ if (typeof status?.host_page_last_request_failed !== "boolean") return status;
14
+ return {
15
+ ...status,
16
+ last_request_failed: status.host_page_last_request_failed,
17
+ connection_state: status.host_page_connection_state ?? status.connection_state,
18
+ };
19
+ }
20
+
9
21
  export function normalizeHostConnectionStatus(status = {}) {
10
22
  const originKind =
11
23
  status.origin_kind === "managed_endpoint"
@@ -380,6 +380,7 @@ function browserConnectionStatusKey(status) {
380
380
  return JSON.stringify([
381
381
  status.connection_state,
382
382
  status.last_request_failed,
383
+ status.host_page_last_request_failed,
383
384
  status.browser_online,
384
385
  status.active_path_kind,
385
386
  status.webrtc_selected_path,
@@ -573,6 +574,35 @@ function normalizeHostPath(input) {
573
574
  return `${url.pathname}${url.search}`;
574
575
  }
575
576
 
577
+ // R1027-OW21: the Chat client's own Matrix requests. Host pages report only their
578
+ // own connection state (beta.32 Host pages had no Chat client running behind them),
579
+ // so a failed or timed-out Chat request does not mark the Host page disconnected.
580
+ function isOysterunChatRequestPath(path) {
581
+ return typeof path === "string" && path.startsWith("/_matrix/");
582
+ }
583
+
584
+ // Shared by both browser connections: transport events and Host-page requests set
585
+ // both flags (lastRequestFailed setter); a Chat request result changes only the
586
+ // overall flag.
587
+ function markBrowserConnectionRequestResult(connection, failed, path) {
588
+ const hostPageFailed = isOysterunChatRequestPath(path)
589
+ ? connection.hostPageRequestFailed === true
590
+ : failed;
591
+ if (
592
+ connection.anyRequestFailed === failed &&
593
+ connection.hostPageRequestFailed === hostPageFailed
594
+ ) {
595
+ return;
596
+ }
597
+ connection.anyRequestFailed = failed;
598
+ connection.hostPageRequestFailed = hostPageFailed;
599
+ connection.notifyStatusListeners();
600
+ }
601
+
602
+ function connectionStateFor({ closed, offline, requestFailed }) {
603
+ return closed ? "closed" : offline ? "disconnected" : requestFailed ? "recovering" : "connected";
604
+ }
605
+
576
606
  function fingerprintFromSdp(sdp) {
577
607
  const matches = [
578
608
  ...String(sdp || "").matchAll(/^a=fingerprint:sha-256 ([^\r\n]+)$/gim),
@@ -1024,10 +1054,19 @@ export class DirectHostBrowserConnection {
1024
1054
  if (isCurrent()) this.notifyStatusListeners();
1025
1055
  }
1026
1056
 
1027
- markRequestResult(failed) {
1028
- if (this.lastRequestFailed === failed) return;
1029
- this.lastRequestFailed = failed;
1030
- this.notifyStatusListeners();
1057
+ // R1027-OW21: the overall flag; a direct assignment (a transport event) also sets
1058
+ // the Host page's own flag, a Chat request result only the overall one.
1059
+ get lastRequestFailed() {
1060
+ return this.anyRequestFailed === true;
1061
+ }
1062
+
1063
+ set lastRequestFailed(failed) {
1064
+ this.anyRequestFailed = failed;
1065
+ this.hostPageRequestFailed = failed;
1066
+ }
1067
+
1068
+ markRequestResult(failed, path = null) {
1069
+ markBrowserConnectionRequestResult(this, failed, path);
1031
1070
  }
1032
1071
 
1033
1072
  async fetch(input, init = {}, _options = {}) {
@@ -1038,10 +1077,10 @@ export class DirectHostBrowserConnection {
1038
1077
  if (path) {
1039
1078
  recordNativeResponseBytes(this.accounting, "direct", path, response);
1040
1079
  }
1041
- this.markRequestResult(false);
1080
+ this.markRequestResult(false, path);
1042
1081
  return response;
1043
1082
  } catch (error) {
1044
- if (!isAbortError(error)) this.markRequestResult(true);
1083
+ if (!isAbortError(error)) this.markRequestResult(true, path);
1045
1084
  throw error;
1046
1085
  }
1047
1086
  }
@@ -1074,6 +1113,13 @@ export class DirectHostBrowserConnection {
1074
1113
  : this.lastRequestFailed
1075
1114
  ? "recovering"
1076
1115
  : "connected",
1116
+ // R1027-OW21: the Host page's own view, without the Chat client's requests.
1117
+ host_page_last_request_failed: this.hostPageRequestFailed === true,
1118
+ host_page_connection_state: connectionStateFor({
1119
+ closed: this.closed,
1120
+ offline: !browserOnline,
1121
+ requestFailed: this.hostPageRequestFailed === true,
1122
+ }),
1077
1123
  closed: this.closed,
1078
1124
  };
1079
1125
  }
@@ -1274,10 +1320,19 @@ export class ManagedHostBrowserConnection {
1274
1320
  }
1275
1321
  }
1276
1322
 
1277
- markRequestResult(failed) {
1278
- if (this.lastRequestFailed === failed) return;
1279
- this.lastRequestFailed = failed;
1280
- this.notifyStatusListeners();
1323
+ // R1027-OW21: the overall flag; a direct assignment (a transport event) also sets
1324
+ // the Host page's own flag, a Chat request result only the overall one.
1325
+ get lastRequestFailed() {
1326
+ return this.anyRequestFailed === true;
1327
+ }
1328
+
1329
+ set lastRequestFailed(failed) {
1330
+ this.anyRequestFailed = failed;
1331
+ this.hostPageRequestFailed = failed;
1332
+ }
1333
+
1334
+ markRequestResult(failed, path = null) {
1335
+ markBrowserConnectionRequestResult(this, failed, path);
1281
1336
  }
1282
1337
 
1283
1338
  emitDiagnostic(event) {
@@ -2485,12 +2540,13 @@ export class ManagedHostBrowserConnection {
2485
2540
  }
2486
2541
 
2487
2542
  async fetch(input, init = {}, recovery = {}) {
2543
+ const path = normalizeHostPath(input);
2488
2544
  try {
2489
2545
  const response = await this.performFetch(input, init, recovery);
2490
- this.markRequestResult(false);
2546
+ this.markRequestResult(false, path);
2491
2547
  return response;
2492
2548
  } catch (error) {
2493
- if (!isAbortError(error)) this.markRequestResult(true);
2549
+ if (!isAbortError(error)) this.markRequestResult(true, path);
2494
2550
  throw error;
2495
2551
  }
2496
2552
  }
@@ -2698,6 +2754,13 @@ export class ManagedHostBrowserConnection {
2698
2754
  : this.lastRequestFailed
2699
2755
  ? "recovering"
2700
2756
  : "connected",
2757
+ // R1027-OW21: the Host page's own view, without the Chat client's requests.
2758
+ host_page_last_request_failed: this.hostPageRequestFailed === true,
2759
+ host_page_connection_state: connectionStateFor({
2760
+ closed: this.closed,
2761
+ offline: !browserOnline || this.routeUnavailable,
2762
+ requestFailed: this.hostPageRequestFailed === true,
2763
+ }),
2701
2764
  transport_accounting: snapshotTransportAccounting(this.accounting),
2702
2765
  };
2703
2766
  }