@teamscala/service-boot 0.23.319 → 0.23.320

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 (165) hide show
  1. package/package.json +526 -526
  2. package/src/agreement-gate.d.ts +19 -0
  3. package/src/agreement-gate.ts +0 -12
  4. package/src/asset-cache-key.d.ts +11 -0
  5. package/src/asset-optimize.d.ts +17 -0
  6. package/src/asset-proxy.d.ts +11 -0
  7. package/src/asset-social-card.d.ts +17 -0
  8. package/src/attach-agreement-magic.d.ts +20 -0
  9. package/src/attach-portal-members.d.ts +23 -0
  10. package/src/attach-proposal-accept.d.ts +26 -0
  11. package/src/attach-proposal-magic.d.ts +18 -0
  12. package/src/attach-transfers-upload.d.ts +27 -0
  13. package/src/auth-gate.d.ts +28 -0
  14. package/src/auth-gate.ts +6 -68
  15. package/src/bind-page-handler.d.ts +18 -0
  16. package/src/build-client-assets/input-hashing.d.ts +25 -0
  17. package/src/build-client-assets/source-candidates.d.ts +27 -0
  18. package/src/build-client-assets.d.ts +50 -0
  19. package/src/build-client-assets.test.ts +1 -1
  20. package/src/build-client-assets.ts +1 -1
  21. package/src/compose-page-title.d.ts +41 -0
  22. package/src/content-gate/access.d.ts +15 -0
  23. package/src/content-gate/config-types.d.ts +99 -0
  24. package/src/content-gate/gate.d.ts +13 -0
  25. package/src/content-gate/parse-cookie.d.ts +9 -0
  26. package/src/content-gate/token.d.ts +48 -0
  27. package/src/content-page-floor.d.ts +39 -0
  28. package/src/discover-blocks.d.ts +28 -0
  29. package/src/discover-blocks.ts +1 -1
  30. package/src/expand-roster.d.ts +34 -0
  31. package/src/fn-routers/agreement-completion-email.d.ts +14 -0
  32. package/src/fn-routers/agreement-send-router.d.ts +82 -0
  33. package/src/fn-routers/ai-health-router.d.ts +35 -0
  34. package/src/fn-routers/auth-router.d.ts +47 -0
  35. package/src/fn-routers/cache-admin-router.d.ts +57 -0
  36. package/src/fn-routers/chat-session-router.d.ts +219 -0
  37. package/src/fn-routers/email-defaults.d.ts +1 -0
  38. package/src/fn-routers/email-link-ttl.d.ts +1 -0
  39. package/src/fn-routers/index.d.ts +18 -0
  40. package/src/fn-routers/index.ts +0 -2
  41. package/src/fn-routers/panel-data-router.d.ts +19 -0
  42. package/src/fn-routers/persist-chat-messages.d.ts +36 -0
  43. package/src/fn-routers/plans-router.d.ts +25 -0
  44. package/src/fn-routers/proposal-send-router.d.ts +58 -0
  45. package/src/fn-routers/public-agreement-router.d.ts +289 -0
  46. package/src/fn-routers/public-assessment-router.d.ts +68 -0
  47. package/src/fn-routers/public-gpt-session-router.d.ts +143 -0
  48. package/src/fn-routers/sign-in-flow-router.d.ts +107 -0
  49. package/src/fn-routers/task-sync-assign.d.ts +305 -0
  50. package/src/fn-routers/task-sync-assign.test.ts +1 -2
  51. package/src/fn-routers/task-sync-assign.ts +4 -4
  52. package/src/fn-routers/task-sync-bind.test.ts +18 -18
  53. package/src/fn-routers/task-sync-brief.d.ts +96 -0
  54. package/src/fn-routers/task-sync-brief.test.ts +17 -20
  55. package/src/fn-routers/task-sync-brief.ts +14 -15
  56. package/src/fn-routers/task-sync-dispatch.d.ts +61 -0
  57. package/src/fn-routers/task-sync-dispatch.test.ts +33 -51
  58. package/src/fn-routers/task-sync-dispatch.ts +124 -0
  59. package/src/fn-routers/task-sync-lane.d.ts +49 -0
  60. package/src/fn-routers/task-sync-lane.ts +125 -0
  61. package/src/fn-routers/task-sync-projection.d.ts +121 -0
  62. package/src/fn-routers/task-sync-projection.test.ts +0 -26
  63. package/src/fn-routers/task-sync-projection.ts +0 -51
  64. package/src/fn-routers/task-sync-router.d.ts +377 -0
  65. package/src/fn-routers/task-sync-router.test.ts +2 -14
  66. package/src/fn-routers/task-sync-router.ts +1075 -0
  67. package/src/fn-routers/tasks-router.d.ts +25 -0
  68. package/src/fn-routers/user-preferences-router.d.ts +77 -0
  69. package/src/fn-routers/work-items-router.d.ts +102 -0
  70. package/src/gate-ttls.d.ts +6 -0
  71. package/src/gpt-gate.d.ts +25 -0
  72. package/src/handlers/bun-stable-watch.d.ts +1 -0
  73. package/src/handlers/pane-outbox-drain.d.ts +1 -0
  74. package/src/handlers/projects-digest.d.ts +26 -0
  75. package/src/handlers/prune-stale-data.d.ts +30 -0
  76. package/src/handlers/registry-stale-inactive-sweep.d.ts +1 -0
  77. package/src/handlers/scala-tools-currency-watch.d.ts +1 -0
  78. package/src/handlers/singleton-tools-currency-watch.d.ts +1 -0
  79. package/src/handlers/singleton-tools-currency-watch.ts +11 -114
  80. package/src/handlers/sweep-event-log.d.ts +1 -0
  81. package/src/handlers/sweep-host-cache.d.ts +1 -0
  82. package/src/handlers/sweep-host-cache.ts +26 -143
  83. package/src/handlers/upstream-issue-sync.d.ts +1 -0
  84. package/src/handlers/whatsapp-liveness-logic.d.ts +34 -0
  85. package/src/handlers/whatsapp-liveness.d.ts +4 -0
  86. package/src/hono-error-handler.d.ts +25 -0
  87. package/src/install-harness.d.ts +45 -0
  88. package/src/install-logging.d.ts +34 -0
  89. package/src/install-logging.ts +0 -3
  90. package/src/load-service-install-row.d.ts +24 -0
  91. package/src/load-service-prisma-client.d.ts +18 -0
  92. package/src/mount-orpc-router.d.ts +15 -0
  93. package/src/mount-orpc-router.ts +1 -1
  94. package/src/mount-server-packages.d.ts +29 -0
  95. package/src/mount.d.ts +9 -0
  96. package/src/mutable-app-ref.d.ts +44 -0
  97. package/src/page-route-shell-types.d.ts +12 -0
  98. package/src/page-server-orpc/audit-revert-router.d.ts +37 -0
  99. package/src/page-server-orpc/hub-mcp-client.d.ts +12 -0
  100. package/src/page-server-orpc/portal-diagnostics-router.d.ts +49 -0
  101. package/src/page-server-orpc/puck-pages-router.d.ts +58 -0
  102. package/src/page-server-orpc/server-client.d.ts +16 -0
  103. package/src/page-server-orpc/templates-router.d.ts +34 -0
  104. package/src/page-server-orpc/user-preferences-router.d.ts +79 -0
  105. package/src/pg-boss-handler-registry.d.ts +27 -0
  106. package/src/pg-boss-mount.d.ts +42 -0
  107. package/src/proposal-authorized-emails.d.ts +28 -0
  108. package/src/proposal-chat-inject.d.ts +17 -0
  109. package/src/proposal-gate.d.ts +18 -0
  110. package/src/read-html-template.d.ts +38 -0
  111. package/src/read-viewport-from-request.d.ts +18 -0
  112. package/src/readiness-gate.d.ts +16 -0
  113. package/src/register-api-routes.d.ts +18 -0
  114. package/src/register-api-routes.ts +2 -8
  115. package/src/register-crash-handlers.d.ts +15 -0
  116. package/src/register-page-routes.d.ts +27 -0
  117. package/src/register-page-routes.ts +3 -0
  118. package/src/register-page-server-client.d.ts +11 -0
  119. package/src/register-registry-page-route/ai-chat-prefetch.d.ts +13 -0
  120. package/src/register-registry-page-route/graph-cache.d.ts +30 -0
  121. package/src/register-registry-page-route/meta-title.d.ts +2 -0
  122. package/src/register-registry-page-route/proposal-approval-email-token.d.ts +14 -0
  123. package/src/register-registry-page-route/proposal-brand-stamping.d.ts +28 -0
  124. package/src/register-registry-page-route/resolve-page-data.d.ts +1 -0
  125. package/src/register-registry-page-route.d.ts +27 -0
  126. package/src/register-static-assets.d.ts +13 -0
  127. package/src/register-ws-routes.d.ts +28 -0
  128. package/src/resolve-app-base-url.d.ts +13 -0
  129. package/src/resolve-brand-favicon.d.ts +28 -0
  130. package/src/resolve-brand-favicon.ts +1 -1
  131. package/src/resolve-from-loader-config.d.ts +32 -0
  132. package/src/resolve-service-context.d.ts +17 -0
  133. package/src/resolve-service-port.d.ts +75 -0
  134. package/src/resolve-theme-mode.d.ts +42 -0
  135. package/src/resolvers/fetch-org-brand.d.ts +2 -0
  136. package/src/resolvers/portal-route-paths.d.ts +39 -0
  137. package/src/resolvers/website-by-host-map.d.ts +12 -0
  138. package/src/resource-chat-inject.d.ts +46 -0
  139. package/src/resource-not-found.d.ts +60 -0
  140. package/src/resource-not-found.ts +0 -10
  141. package/src/run-boot-hook-list.d.ts +19 -0
  142. package/src/run-boot-hooks.d.ts +31 -0
  143. package/src/scala-tools-currency-watchdog.d.ts +10 -0
  144. package/src/security-headers.d.ts +12 -0
  145. package/src/serve/serve.d.ts +46 -0
  146. package/src/serve/stamp-transport-identity.d.ts +32 -0
  147. package/src/serve/stamp-transport-identity.ts +7 -20
  148. package/src/server-error-page.d.ts +29 -0
  149. package/src/start-scheduled-jobs.d.ts +18 -0
  150. package/src/two-phase-boot.d.ts +136 -0
  151. package/src/two-phase-boot.ts +17 -85
  152. package/src/two-phase-health-gate.test.ts +2 -13
  153. package/src/types.d.ts +46 -0
  154. package/src/ui-service.d.ts +46 -0
  155. package/src/ws-boot-self-test.d.ts +19 -0
  156. package/src/auth-gate.test.ts +0 -70
  157. package/src/fn-routers/task-sync-close.test.ts +0 -44
  158. package/src/fn-routers/task-sync-close.ts +0 -82
  159. package/src/fn-routers/task-sync-hook-lifecycle.test.ts +0 -204
  160. package/src/fn-routers/task-sync-lane.test.ts +0 -36
  161. package/src/fn-routers/task-sync-rename.test.ts +0 -53
  162. package/src/fn-routers/task-sync-rename.ts +0 -111
  163. package/src/handlers/sweep-host-cache.test.ts +0 -133
  164. package/src/serve/stamp-transport-identity.test.ts +0 -24
  165. package/src/two-phase-health-gate-client-only.test.ts +0 -77
@@ -1,77 +0,0 @@
1
- /**
2
- * @system service-boot
3
- * @status handwritten
4
- * @edit edit directly
5
- *
6
- * A CLIENT-ONLY service (`render_mode=client`) must reach ready, even though it
7
- * never registers an SSR page handler.
8
- *
9
- * Separate file from `two-phase-health-gate.test.ts` on purpose: `fullAppReady`
10
- * is module state that only transitions false -> true and has no reset hook, so
11
- * the two ready-paths cannot both be exercised in one module instance. A reset
12
- * hook would exist only for tests.
13
- *
14
- * THE REGRESSION THIS LOCKS (measured 2026-08-07 on scala-agents-ui). Readiness
15
- * used to be flipped INSIDE `setPageHandler`, which was honest while every
16
- * service was SSR. `render_mode=client` made a service that completes phase 2
17
- * and never calls it, so `/health` answered `{"status":"starting"}` FOREVER
18
- * while the process was healthy and serving — boot completed in 5023ms, "Full
19
- * app built: 50 block(s)" logged, `GET /` correctly 302'd to sign-in, and three
20
- * untouched UI services reported ok beside it.
21
- *
22
- * That is precisely what `readiness-gated-boot` forbids ("binary: fully-ready or
23
- * cleanly-unavailable"): a permanently-un-ready health signal makes the
24
- * activator's wake gate and every health-gated router treat a working service as
25
- * down. Exercised through a real Hono request against the REAL exported handler
26
- * (`proxy-is-not-behaviour`) — a source grep would prove the call exists, never
27
- * that the endpoint answers 200.
28
- */
29
-
30
- import { beforeAll, describe, expect, test } from "bun:test";
31
- import { Hono } from "hono";
32
- import {
33
- __resetPhase2StateForTest,
34
- getPageHandlerState,
35
- healthHandler,
36
- markFullAppReady,
37
- } from "./two-phase-boot.ts";
38
-
39
- /** Mount the real handler exactly as buildMinimalApp does. */
40
- const app = new Hono().get("/health", healthHandler);
41
-
42
- describe("/health for a client-only service", () => {
43
- // Bun shares one module instance across every test file in a run, so the SSR
44
- // readiness test's setPageHandler leaks into this file when both run together.
45
- // Without this reset the suite passes file-by-file and fails in CI.
46
- beforeAll(() => {
47
- __resetPhase2StateForTest();
48
- });
49
-
50
- test("before phase 2 completes it reports 503, not ready", async () => {
51
- expect(getPageHandlerState().ready).toBe(false);
52
-
53
- const res = await app.request("/health");
54
-
55
- expect(res.status).toBe(503);
56
- expect(await res.json()).toEqual({ status: "starting" });
57
- });
58
-
59
- test("reaches ready without an SSR page handler", async () => {
60
- // The real client-only phase-2 path: buildFullApp finishes and marks the
61
- // app ready WITHOUT setPageHandler, because there is no SSR handler.
62
- markFullAppReady();
63
-
64
- const state = getPageHandlerState();
65
- expect(state.ready).toBe(true);
66
- // The discriminator: ready is true while hasHandler stays false. Asserting
67
- // both is what separates this from the SSR path — a fix that flipped ready
68
- // by registering a dummy handler would pass `ready` and fail here.
69
- expect(state.hasHandler).toBe(false);
70
-
71
- const res = await app.request("/health");
72
-
73
- expect(res.status).toBe(200);
74
- expect(res.ok).toBe(true);
75
- expect(await res.json()).toEqual({ status: "ok" });
76
- });
77
- });