@kky42/pievo-server 2.3.0 → 2.4.2

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 (199) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/MachinesModal-CSbnrUER.js +1 -0
  3. package/.output/public/assets/SignIn-0Tjqs-Ma.js +1 -0
  4. package/.output/public/assets/actionUi-DpwGIGpw.js +1 -0
  5. package/.output/public/assets/app-CaZpuwOS.css +2 -0
  6. package/.output/public/assets/index-CaS_SmDq.js +10 -0
  7. package/.output/public/assets/invite._token-Btg_0aLp.js +1 -0
  8. package/.output/public/assets/invite._token-KMD2JAgE.js +1 -0
  9. package/.output/public/assets/lifecycleUi-C7dwHtbw.js +1 -0
  10. package/.output/public/assets/loops._loopId-D5usF3DO.js +67 -0
  11. package/.output/public/assets/loops._loopId_.runs._runId-DRCgXaCq.js +3 -0
  12. package/.output/public/assets/preload-helper-DsxECZIS.js +5 -0
  13. package/.output/public/assets/routes-CtFgwdgW.js +1 -0
  14. package/.output/public/assets/routes-LDbnnQ3f.js +1 -0
  15. package/.output/public/assets/t._teamId-D41xcbsF.js +1 -0
  16. package/.output/public/assets/t._teamId-DUena1pV.js +1 -0
  17. package/.output/public/assets/ui-Do4gqMyP.js +1 -0
  18. package/.output/server/_libs/@base-ui/react+[...].mjs +4130 -4130
  19. package/.output/server/_libs/@tanstack/react-router+[...].mjs +1 -1
  20. package/.output/server/_libs/drizzle-orm+postgres.mjs +28 -1
  21. package/.output/server/_ssr/DashboardView-C2LdV6J0.mjs +914 -0
  22. package/.output/server/_ssr/{notifyFns-DuPR1zd7.mjs → MachinesModal-BjkcVjjx.mjs} +55 -35
  23. package/.output/server/_ssr/{SignIn-RmpWm9uy.mjs → SignIn-DEGrvJvb.mjs} +10 -24
  24. package/.output/server/_ssr/SocialLinks-Cm4H8pUJ.mjs +1044 -0
  25. package/.output/server/_ssr/{actionUi-BN55TNYE.mjs → actionUi-DJBWuNwr.mjs} +3 -3
  26. package/.output/server/_ssr/{artifactFiles-BCaIIrrT.mjs → artifactFiles-DtpRidFZ.mjs} +7 -8
  27. package/.output/server/_ssr/{artifactKind-BW0isV8L.mjs → artifactKind-FBYbgSuf.mjs} +27 -2
  28. package/.output/server/_ssr/artifacts-BR3jj0NC.mjs +2 -0
  29. package/.output/server/_ssr/{auth-30Z4lV1w.mjs → auth-C0zoZCGe.mjs} +16 -19
  30. package/.output/server/_ssr/boot-CdOO4xOo.mjs +2 -0
  31. package/.output/server/_ssr/{boot-3BNKujyp.mjs → boot-sNlIkoLe.mjs} +1331 -3927
  32. package/.output/server/_ssr/{bun-sqlite-dialect-BW9W1_Ps-_7tfuNRi.mjs → bun-sqlite-dialect-BW9W1_Ps-DmlZWqO7.mjs} +2 -2
  33. package/.output/server/_ssr/{d1-sqlite-dialect-BLC8LXE6-ucDUbeBk.mjs → d1-sqlite-dialect-BLC8LXE6-CCNzqZwZ.mjs} +2 -2
  34. package/.output/server/_ssr/db-CwLD-5w1.mjs +2 -0
  35. package/.output/server/_ssr/{dist-Cd6nlLlO.mjs → dist-B3SxDOpW.mjs} +2 -2
  36. package/.output/server/_ssr/{factory-CWWwV7XZ.mjs → factory-Dv3Zopis.mjs} +2 -2
  37. package/.output/server/_ssr/invite._token-CJ6-H-s3.mjs +20 -0
  38. package/.output/server/_ssr/{invite._token-SdWXemIc.mjs → invite._token-dLKDJKVs.mjs} +9 -17
  39. package/.output/server/_ssr/{invite._token-BKlz0R2f.mjs → invite._token-l1SjouDz.mjs} +6 -15
  40. package/.output/server/_ssr/{kysely-adapter-C8iS51DB.mjs → kysely-adapter-nL7WKSgw.mjs} +1 -1
  41. package/.output/server/_ssr/{lifecycleUi-DgBQAYzp.mjs → lifecycleUi-Dad3hvhm.mjs} +11 -11
  42. package/.output/server/_ssr/logger-B8m8F1Qu.mjs +2 -0
  43. package/.output/server/_ssr/loopApi-BKyFB4KM.mjs +342 -0
  44. package/.output/server/_ssr/{adapters-BoLkOf1T.mjs → loopProjection-B8a829ij.mjs} +25 -55
  45. package/.output/server/_ssr/loops._loopId-DS16Phmq.mjs +1271 -0
  46. package/.output/server/_ssr/{loops._loopId_.runs._runId-PUGBrD5q.mjs → loops._loopId_.runs._runId-BEJI6iK5.mjs} +23 -74
  47. package/.output/server/_ssr/{loops._loopId_.runs._runId-Ymy4lwee.mjs → loops._loopId_.runs._runId-CduETLqH.mjs} +4 -5
  48. package/.output/server/_ssr/{machineFns-BZ9puxDt.mjs → machineFns-ByMsgG12.mjs} +3 -5
  49. package/.output/server/_ssr/{node-sqlite-dialect-D_3JmkMo.mjs → node-sqlite-dialect-CjNineno.mjs} +2 -2
  50. package/.output/server/_ssr/router-CXyrnvx-.mjs +565 -0
  51. package/.output/server/_ssr/{routes-ClZEdsnB.mjs → routes-BulNEUEE.mjs} +6 -10
  52. package/.output/server/_ssr/{routes-ComqHvCL.mjs → routes-DD94baie.mjs} +3 -3
  53. package/.output/server/_ssr/{routes-D5jJJ-30.mjs → routes-Wjexi35W.mjs} +6 -6
  54. package/.output/server/_ssr/runDiff-Ba8Lg1vg.mjs +2 -0
  55. package/.output/server/_ssr/ssr.mjs +60 -100
  56. package/.output/server/_ssr/store-Cujtg2QE.mjs +2 -0
  57. package/.output/server/_ssr/{t._teamId-BgHV_KFP.mjs → t._teamId-1CreIlPV.mjs} +7 -11
  58. package/.output/server/_ssr/{t._teamId-DDERNgfn.mjs → t._teamId-Bd6-zZsy.mjs} +4 -4
  59. package/.output/server/_ssr/{t._teamId-DRJvKHZn.mjs → t._teamId-COuMKQ4r.mjs} +7 -7
  60. package/.output/server/_ssr/{teamFns-Bp81UO-x.mjs → teamFns-H438WnZC.mjs} +12 -30
  61. package/.output/server/_ssr/{teamFns-bm82twd5.mjs → teamFns-j2JKjorZ.mjs} +2 -2
  62. package/.output/server/_ssr/tokens-DgG_Syq3.mjs +2 -0
  63. package/.output/server/_ssr/{ui-Ww2tTM2u.mjs → ui-D5KWstlb.mjs} +26 -48
  64. package/.output/server/{_tanstack-start-manifest_v-DwKENYCN.mjs → _tanstack-start-manifest_v-3H7yBKLz.mjs} +25 -35
  65. package/{drizzle/0000_round_marauders.sql → .output/server/drizzle/0000_baseline.sql} +102 -44
  66. package/.output/server/drizzle/meta/_journal.json +3 -115
  67. package/.output/server/index.mjs +83 -132
  68. package/{.output/server/drizzle/0000_round_marauders.sql → drizzle/0000_baseline.sql} +102 -44
  69. package/drizzle/meta/_journal.json +3 -115
  70. package/package.json +2 -11
  71. package/scripts/pievo-server.mjs +3 -1
  72. package/scripts/server-cli-lib.mjs +23 -16
  73. package/.output/public/assets/CodeField-dOzyFQNH.js +0 -34
  74. package/.output/public/assets/LoopView-DjVHUyrR.js +0 -59
  75. package/.output/public/assets/Modal-CCRvx959.js +0 -1
  76. package/.output/public/assets/SignIn-Qxw5zDFq.js +0 -1
  77. package/.output/public/assets/actionUi-CXxhzYe2.js +0 -1
  78. package/.output/public/assets/app-D1cij_NJ.css +0 -2
  79. package/.output/public/assets/artifactView-Cd5wWPil.js +0 -66
  80. package/.output/public/assets/index-BRN_CQ8U.js +0 -12
  81. package/.output/public/assets/invite._token-BIxr8DlP.js +0 -1
  82. package/.output/public/assets/invite._token-j2BTCeG1.js +0 -1
  83. package/.output/public/assets/jsx-runtime-BseJUIpC.js +0 -1
  84. package/.output/public/assets/lifecycleUi-Qy_8beQK.js +0 -1
  85. package/.output/public/assets/loopApi-CT1mMhlb.js +0 -3
  86. package/.output/public/assets/loops._loopId-BRBQzioy.js +0 -4
  87. package/.output/public/assets/loops._loopId_.runs._runId-CMnOJkem.js +0 -3
  88. package/.output/public/assets/notifyFns-DYD4EKaG.js +0 -1
  89. package/.output/public/assets/preload-helper-DFkkpP6W.js +0 -3
  90. package/.output/public/assets/routes-3nuEJGdo.js +0 -1
  91. package/.output/public/assets/routes-DORLim-C.js +0 -1
  92. package/.output/public/assets/t._teamId-F5f4K8kd.js +0 -1
  93. package/.output/public/assets/t._teamId-XfE_S1Fo.js +0 -1
  94. package/.output/public/assets/ui-Dhsx6SW0.js +0 -1
  95. package/.output/public/assets/useRouter-DsjH8G0p.js +0 -1
  96. package/.output/server/_libs/@codemirror/autocomplete+[...].mjs +0 -19713
  97. package/.output/server/_libs/@codemirror/lang-css+[...].mjs +0 -2636
  98. package/.output/server/_libs/@codemirror/lang-html+[...].mjs +0 -2247
  99. package/.output/server/_libs/@codemirror/lang-json+[...].mjs +0 -79
  100. package/.output/server/_libs/@reduxjs/toolkit+[...].mjs +0 -1736
  101. package/.output/server/_libs/@uiw/codemirror-extensions-basic-setup+[...].mjs +0 -76
  102. package/.output/server/_libs/babel__runtime.mjs +0 -30
  103. package/.output/server/_libs/clsx.mjs +0 -16
  104. package/.output/server/_libs/codemirror__commands.mjs +0 -1725
  105. package/.output/server/_libs/codemirror__lint.mjs +0 -565
  106. package/.output/server/_libs/codemirror__search.mjs +0 -1138
  107. package/.output/server/_libs/codemirror__theme-one-dark.mjs +0 -161
  108. package/.output/server/_libs/d3-array.mjs +0 -231
  109. package/.output/server/_libs/d3-color.mjs +0 -330
  110. package/.output/server/_libs/d3-format.mjs +0 -252
  111. package/.output/server/_libs/d3-interpolate.mjs +0 -163
  112. package/.output/server/_libs/d3-path.mjs +0 -77
  113. package/.output/server/_libs/d3-scale+[...].mjs +0 -1907
  114. package/.output/server/_libs/d3-shape.mjs +0 -818
  115. package/.output/server/_libs/decimal.js-light.mjs +0 -884
  116. package/.output/server/_libs/dom-serializer+[...].mjs +0 -708
  117. package/.output/server/_libs/domhandler.mjs +0 -461
  118. package/.output/server/_libs/domutils.mjs +0 -868
  119. package/.output/server/_libs/es-toolkit.mjs +0 -1737
  120. package/.output/server/_libs/eventemitter3.mjs +0 -236
  121. package/.output/server/_libs/html-dom-parser+htmlparser2.mjs +0 -1560
  122. package/.output/server/_libs/html-react-parser+[...].mjs +0 -1360
  123. package/.output/server/_libs/react-is.mjs +0 -48
  124. package/.output/server/_libs/react-redux+[...].mjs +0 -205
  125. package/.output/server/_libs/recharts+victory-vendor.mjs +0 -17303
  126. package/.output/server/_libs/uiw__codemirror-themes.mjs +0 -32
  127. package/.output/server/_libs/uiw__react-codemirror.mjs +0 -354
  128. package/.output/server/_ssr/CodeField-B7oOmmwH.mjs +0 -143
  129. package/.output/server/_ssr/DashboardView-BF7PciP7.mjs +0 -2736
  130. package/.output/server/_ssr/LoopPlaybook-DC7QVvPY.mjs +0 -2105
  131. package/.output/server/_ssr/LoopView-DwSrm9Ja.mjs +0 -1300
  132. package/.output/server/_ssr/Modal-MaCG52Pv.mjs +0 -49
  133. package/.output/server/_ssr/artifactView-iuPsp5aa.mjs +0 -304
  134. package/.output/server/_ssr/artifacts-jQ-bfdhI.mjs +0 -2
  135. package/.output/server/_ssr/boot-CsEFT53K.mjs +0 -2
  136. package/.output/server/_ssr/db-CXownd1H.mjs +0 -2
  137. package/.output/server/_ssr/invite._token-CWl6kipD.mjs +0 -28
  138. package/.output/server/_ssr/logger-Gy-47z3k.mjs +0 -2
  139. package/.output/server/_ssr/loopApi-8_KgBapr.mjs +0 -109
  140. package/.output/server/_ssr/loopApi-ABi9SgWS.mjs +0 -564
  141. package/.output/server/_ssr/loops._loopId-SON_t43g.mjs +0 -30
  142. package/.output/server/_ssr/loops._loopId-p1KWsvMM.mjs +0 -1477
  143. package/.output/server/_ssr/notifyFns-BUCePuF3.mjs +0 -118
  144. package/.output/server/_ssr/router-Czxvra6l.mjs +0 -685
  145. package/.output/server/_ssr/runDiff--qLtU4FI.mjs +0 -2
  146. package/.output/server/_ssr/store-40eVzW1S.mjs +0 -2
  147. package/.output/server/_ssr/tokens-CbfoRC_s.mjs +0 -2
  148. package/.output/server/drizzle/0001_naive_silver_fox.sql +0 -25
  149. package/.output/server/drizzle/0002_funny_sage.sql +0 -12
  150. package/.output/server/drizzle/0003_optimal_slapstick.sql +0 -102
  151. package/.output/server/drizzle/0004_remove_grok_agent.sql +0 -5
  152. package/.output/server/drizzle/0005_heavy_gauntlet.sql +0 -8
  153. package/.output/server/drizzle/0006_tranquil_sharon_carter.sql +0 -1
  154. package/.output/server/drizzle/0007_faulty_starbolt.sql +0 -30
  155. package/.output/server/drizzle/0008_durable_lifecycle_evidence.sql +0 -15
  156. package/.output/server/drizzle/0009_ordinary_electro.sql +0 -1
  157. package/.output/server/drizzle/0010_workable_rage.sql +0 -14
  158. package/.output/server/drizzle/0011_steep_marvel_zombies.sql +0 -3
  159. package/.output/server/drizzle/0012_blocked_run_status.sql +0 -12
  160. package/.output/server/drizzle/0013_drop_run_outcome.sql +0 -2
  161. package/.output/server/drizzle/0014_luxuriant_scrambler.sql +0 -5
  162. package/.output/server/drizzle/0015_run_history_foundation.sql +0 -43
  163. package/.output/server/drizzle/0016_plural_machine_runs.sql +0 -4
  164. package/.output/server/drizzle/meta/0000_snapshot.json +0 -1333
  165. package/.output/server/drizzle/meta/0001_snapshot.json +0 -1498
  166. package/.output/server/drizzle/meta/0002_snapshot.json +0 -1576
  167. package/.output/server/drizzle/meta/0003_snapshot.json +0 -1666
  168. package/.output/server/drizzle/meta/0005_snapshot.json +0 -1666
  169. package/.output/server/drizzle/meta/0006_snapshot.json +0 -1672
  170. package/.output/server/drizzle/meta/0007_snapshot.json +0 -1787
  171. package/.output/server/drizzle/meta/0009_snapshot.json +0 -1793
  172. package/.output/server/drizzle/meta/0010_snapshot.json +0 -1891
  173. package/.output/server/drizzle/meta/0011_snapshot.json +0 -1872
  174. package/drizzle/0001_naive_silver_fox.sql +0 -25
  175. package/drizzle/0002_funny_sage.sql +0 -12
  176. package/drizzle/0003_optimal_slapstick.sql +0 -102
  177. package/drizzle/0004_remove_grok_agent.sql +0 -5
  178. package/drizzle/0005_heavy_gauntlet.sql +0 -8
  179. package/drizzle/0006_tranquil_sharon_carter.sql +0 -1
  180. package/drizzle/0007_faulty_starbolt.sql +0 -30
  181. package/drizzle/0008_durable_lifecycle_evidence.sql +0 -15
  182. package/drizzle/0009_ordinary_electro.sql +0 -1
  183. package/drizzle/0010_workable_rage.sql +0 -14
  184. package/drizzle/0011_steep_marvel_zombies.sql +0 -3
  185. package/drizzle/0012_blocked_run_status.sql +0 -12
  186. package/drizzle/0013_drop_run_outcome.sql +0 -2
  187. package/drizzle/0014_luxuriant_scrambler.sql +0 -5
  188. package/drizzle/0015_run_history_foundation.sql +0 -43
  189. package/drizzle/0016_plural_machine_runs.sql +0 -4
  190. package/drizzle/meta/0000_snapshot.json +0 -1333
  191. package/drizzle/meta/0001_snapshot.json +0 -1498
  192. package/drizzle/meta/0002_snapshot.json +0 -1576
  193. package/drizzle/meta/0003_snapshot.json +0 -1666
  194. package/drizzle/meta/0005_snapshot.json +0 -1666
  195. package/drizzle/meta/0006_snapshot.json +0 -1672
  196. package/drizzle/meta/0007_snapshot.json +0 -1787
  197. package/drizzle/meta/0009_snapshot.json +0 -1793
  198. package/drizzle/meta/0010_snapshot.json +0 -1891
  199. package/drizzle/meta/0011_snapshot.json +0 -1872
@@ -0,0 +1,565 @@
1
+ import { j as sql } from "../_libs/drizzle-orm+postgres.mjs";
2
+ import { Dt as readByteBody, Ot as readJsonBody, Qt as validPollWireId, Xt as validOptionalPollString, Zt as validPollCurrentRun, d as POLL_HTTP_BODY_FIELDS, j as ensureServer, l as MACHINE_BODY_CAP } from "./boot-sNlIkoLe.mjs";
3
+ import { h as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
4
+ import { c as createFileRoute, i as HeadContent, l as createRootRoute, o as createRouter, r as Scripts } from "../_libs/@tanstack/react-router+[...].mjs";
5
+ import { t as Route$12 } from "./invite._token-l1SjouDz.mjs";
6
+ import { r as imageMime, t as Route$13 } from "./artifactKind-FBYbgSuf.mjs";
7
+ import { t as Route$14 } from "./loops._loopId_.runs._runId-CduETLqH.mjs";
8
+ import { t as Route$15 } from "./routes-BulNEUEE.mjs";
9
+ import { t as Route$16 } from "./t._teamId-1CreIlPV.mjs";
10
+ //#region node_modules/.nitro/vite/services/ssr/assets/router-CXyrnvx-.js
11
+ var import_jsx_runtime = require_jsx_runtime();
12
+ var app_default = "/assets/app-CaZpuwOS.css";
13
+ var Route$11 = createRootRoute({
14
+ head: () => ({
15
+ meta: [
16
+ { charSet: "utf-8" },
17
+ {
18
+ name: "viewport",
19
+ content: "width=device-width, initial-scale=1"
20
+ },
21
+ { title: "Pievo" }
22
+ ],
23
+ links: [{
24
+ rel: "stylesheet",
25
+ href: app_default
26
+ }, {
27
+ rel: "icon",
28
+ type: "image/svg+xml",
29
+ href: "/favicon.svg"
30
+ }]
31
+ }),
32
+ shellComponent: RootDocument
33
+ });
34
+ function RootDocument({ children }) {
35
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("html", {
36
+ lang: "en",
37
+ suppressHydrationWarning: true,
38
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("head", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HeadContent, {}) }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("body", {
39
+ className: "dot-grid-subtle bg-paper font-sans text-primary antialiased",
40
+ suppressHydrationWarning: true,
41
+ children: [children, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Scripts, {})]
42
+ })]
43
+ });
44
+ }
45
+ var TokenBucketLimiter = class {
46
+ capacity;
47
+ refillPerSec;
48
+ maxKeys;
49
+ buckets = /* @__PURE__ */ new Map();
50
+ constructor(capacity, refillPerSec, maxKeys = 2e4) {
51
+ this.capacity = capacity;
52
+ this.refillPerSec = refillPerSec;
53
+ this.maxKeys = maxKeys;
54
+ }
55
+ /** Consume one token for `key`. Returns true if allowed, false if the bucket is dry. */
56
+ allow(key, now = Date.now()) {
57
+ let b = this.buckets.get(key);
58
+ if (!b) {
59
+ if (this.buckets.size >= this.maxKeys) this.evictOldest();
60
+ b = {
61
+ tokens: this.capacity,
62
+ last: now
63
+ };
64
+ this.buckets.set(key, b);
65
+ }
66
+ const elapsedSec = Math.max(0, (now - b.last) / 1e3);
67
+ b.tokens = Math.min(this.capacity, b.tokens + elapsedSec * this.refillPerSec);
68
+ b.last = now;
69
+ if (b.tokens >= 1) {
70
+ b.tokens -= 1;
71
+ return true;
72
+ }
73
+ return false;
74
+ }
75
+ /** Drop the least-recently-touched key (bounded memory under a distinct-key flood). */
76
+ evictOldest() {
77
+ let oldestKey;
78
+ let oldest = Number.POSITIVE_INFINITY;
79
+ for (const [k, b] of this.buckets) if (b.last < oldest) {
80
+ oldest = b.last;
81
+ oldestKey = k;
82
+ }
83
+ if (oldestKey !== void 0) this.buckets.delete(oldestKey);
84
+ }
85
+ /** Test seam — forget all state. */
86
+ reset() {
87
+ this.buckets.clear();
88
+ }
89
+ };
90
+ /** Parse a positive-number env override, falling back to `dflt` on absent/invalid. */
91
+ function envNum(name, dflt) {
92
+ const raw = process.env[name]?.trim();
93
+ if (!raw) return dflt;
94
+ const n = Number(raw);
95
+ return Number.isFinite(n) && n > 0 ? n : dflt;
96
+ }
97
+ /**
98
+ * Per-IP: default 240 burst + 8/sec sustained (≈480 req/min). One daemon does
99
+ * ~20 polls/min plus sync bursts; this comfortably covers a dozen daemons behind a
100
+ * shared NAT while still capping a single-IP flood.
101
+ */
102
+ var ipLimiter = new TokenBucketLimiter(envNum("PIEVO_RL_IP_BURST", 240), envNum("PIEVO_RL_IP_PER_SEC", 8));
103
+ /**
104
+ * Per-token (per-machine): default 120 burst + 4/sec sustained. A single daemon
105
+ * never approaches this; it bounds one credential's share of the process.
106
+ */
107
+ var tokenLimiter = new TokenBucketLimiter(envNum("PIEVO_RL_TOKEN_BURST", 120), envNum("PIEVO_RL_TOKEN_PER_SEC", 4));
108
+ /** Whether rate limiting is active. Off by default in tests unless opted in, so the
109
+ * large existing suites don't trip it; ON in a real server process. */
110
+ function rateLimitEnabled() {
111
+ const flag = process.env.PIEVO_RATE_LIMIT?.trim().toLowerCase();
112
+ if (flag === "0" || flag === "false" || flag === "off") return false;
113
+ if (flag === "1" || flag === "true" || flag === "on") return true;
114
+ return process.env.VITEST !== "true";
115
+ }
116
+ /**
117
+ * Best-effort client IP from the request, honoring the usual proxy headers (Fly
118
+ * sets `Fly-Client-IP`; a generic proxy sets `X-Forwarded-For`). Falls back to a
119
+ * single shared key so a missing IP still shares ONE bucket (fail-closed: unknown
120
+ * origins can't each get a private allowance). Only the FIRST `X-Forwarded-For` hop
121
+ * is trusted (the client-facing edge appends left-to-right).
122
+ */
123
+ function clientIp(request) {
124
+ const h = request.headers;
125
+ const fly = h.get("fly-client-ip");
126
+ if (fly) return fly.trim();
127
+ const xff = h.get("x-forwarded-for");
128
+ if (xff) {
129
+ const first = xff.split(",")[0]?.trim();
130
+ if (first) return first;
131
+ }
132
+ const real = h.get("x-real-ip");
133
+ if (real) return real.trim();
134
+ return "unknown";
135
+ }
136
+ /**
137
+ * A 429 response with a Retry-After hint. Carries `text` + `exitCode` alongside
138
+ * `error` so `/api/machine/cli` can print the response directly.
139
+ */
140
+ function tooMany() {
141
+ return Response.json({
142
+ error: "rate limited — slow down",
143
+ text: "rate limited — slow down",
144
+ exitCode: 1
145
+ }, {
146
+ status: 429,
147
+ headers: { "retry-after": "1" }
148
+ });
149
+ }
150
+ /**
151
+ * Enforce the machine-route rate limits for one request. Call it at the top of a
152
+ * machine route handler, right after reading the Bearer token (pass it so a valid
153
+ * daemon keys off its own per-machine bucket). Returns a 429 `Response` to return
154
+ * verbatim, or null to proceed. Both tiers apply: the per-IP flood guard always,
155
+ * and the per-token fairness tier whenever a credential is present. (The byte-
156
+ * ingress routes are exempt entirely and simply do not call this — see the module
157
+ * doc.)
158
+ */
159
+ function machineRouteLimit(request, token, opts = {}) {
160
+ if (!rateLimitEnabled()) return null;
161
+ const now = opts.now ?? Date.now();
162
+ if (!ipLimiter.allow(clientIp(request), now)) return tooMany();
163
+ if (token && !tokenLimiter.allow(token, now)) return tooMany();
164
+ return null;
165
+ }
166
+ /** POST /machine/report — finalize a run (Bearer run token). */
167
+ var Route$10 = createFileRoute("/machine/report")({ server: { handlers: { POST: async ({ request }) => {
168
+ const auth = request.headers.get("authorization") ?? "";
169
+ const token = auth.startsWith("Bearer ") ? auth.slice(7) : "";
170
+ const limited = machineRouteLimit(request, token || void 0);
171
+ if (limited) return limited;
172
+ if (!token) return Response.json({ error: "missing token" }, { status: 401 });
173
+ const parsed = await readJsonBody(request, MACHINE_BODY_CAP);
174
+ if (parsed.kind === "too-large") return Response.json({ error: "body too large" }, { status: 413 });
175
+ const body = parsed.kind === "ok" && parsed.body && typeof parsed.body === "object" ? parsed.body : {};
176
+ const { getGateway } = await import("./boot-CdOO4xOo.mjs");
177
+ const r = await (await getGateway()).report(token, body);
178
+ return Response.json(r.body, { status: r.status });
179
+ } } } });
180
+ /**
181
+ * Deep readiness for process launchers. Unlike /api/health, this waits for the
182
+ * one-time backend boot (migrations, blob-store selection, and scheduler start).
183
+ * The per-launch nonce lets a launcher reject a different process already bound
184
+ * to the requested port.
185
+ */
186
+ async function readyResponse(ensure = ensureServer, env = process.env) {
187
+ await ensure();
188
+ return Response.json({
189
+ ok: true,
190
+ nonce: env.PIEVO_SERVER_LAUNCH_NONCE ?? null
191
+ });
192
+ }
193
+ var Route$9 = createFileRoute("/api/ready")({ server: { handlers: { GET: () => readyResponse() } } });
194
+ var buildSha = () => process.env.GIT_SHA || "unknown";
195
+ var buildAt = () => process.env.BUILT_AT || "unknown";
196
+ var Route$8 = createFileRoute("/api/health")({ server: { handlers: { GET: async () => Response.json({
197
+ ok: true,
198
+ sha: buildSha(),
199
+ builtAt: buildAt()
200
+ }) } } });
201
+ /**
202
+ * POST /api/machine/sync — exact artifact sync (Bearer DEVICE token). The daemon
203
+ * posts the complete configured-path manifest after a run; the server reconciles
204
+ * artifact_files and replies with needHashes for raw blob PUTs.
205
+ * The manifest route retains its dedicated 32 MB JSON-body limit.
206
+ *
207
+ * This byte-ingress route is deliberately NOT rate limited (same rationale as the
208
+ * blob PUT): it requires a valid registered device token (unknown ⇒ 401) and is
209
+ * already bounded by the exact-path/hash handshake and 32MB sync-body cap, so a
210
+ * limiter would only throttle a legitimate large sync.
211
+ */
212
+ var Route$7 = createFileRoute("/api/machine/sync")({ server: { handlers: { POST: async ({ request }) => {
213
+ const auth = request.headers.get("authorization") ?? "";
214
+ const token = auth.startsWith("Bearer ") ? auth.slice(7) : "";
215
+ if (!token) return Response.json({ error: "missing device token" }, { status: 401 });
216
+ const { SYNC_BODY_CAP, parseArtifactSyncBody } = await import("./artifacts-BR3jj0NC.mjs");
217
+ const parsed = await readJsonBody(request, SYNC_BODY_CAP);
218
+ if (parsed.kind === "too-large") return Response.json({ error: "sync body too large" }, { status: 413 });
219
+ if (parsed.kind === "invalid") return Response.json({ error: "invalid JSON" }, { status: 400 });
220
+ const body = parseArtifactSyncBody(parsed.body);
221
+ if (!body) return Response.json({ error: "invalid sync body" }, { status: 400 });
222
+ const { getArtifactSync } = await import("./boot-CdOO4xOo.mjs");
223
+ const r = await (await getArtifactSync()).sync(token, body);
224
+ return Response.json(r.body, { status: r.status });
225
+ } } } });
226
+ /** GET /api/machine/status — is this machine's daemon live? (Bearer device token) */
227
+ var Route$6 = createFileRoute("/api/machine/status")({ server: { handlers: { GET: async ({ request }) => {
228
+ const auth = request.headers.get("authorization") ?? "";
229
+ const token = auth.startsWith("Bearer ") ? auth.slice(7) : "";
230
+ const limited = machineRouteLimit(request, token || void 0);
231
+ if (limited) return limited;
232
+ if (!token) return Response.json({ error: "missing device token" }, { status: 401 });
233
+ const { getGateway } = await import("./boot-CdOO4xOo.mjs");
234
+ const r = await (await getGateway()).status(token);
235
+ return Response.json(r.body, { status: r.status });
236
+ } } } });
237
+ /** Reject non-object bodies, additions, coercible types, over-cap strings, and
238
+ * NUL-bearing text before the gateway is loaded or any state can mutate. */
239
+ function parsePollBody(value) {
240
+ if (value === null || typeof value !== "object" || Array.isArray(value)) return null;
241
+ if (Object.keys(value).some((key) => !POLL_HTTP_BODY_FIELDS.has(key))) return null;
242
+ const body = value;
243
+ if (!validOptionalPollString(body.host, 524288) || !validOptionalPollString(body.platform, 524288) || !validOptionalPollString(body.arch, 524288) || !validOptionalPollString(body.version, 64)) return null;
244
+ if (body.protocolVersion !== void 0 && (typeof body.protocolVersion !== "number" || !Number.isInteger(body.protocolVersion))) return null;
245
+ if (body.currentRuns !== void 0 && (!Array.isArray(body.currentRuns) || body.currentRuns.some((run) => !validPollCurrentRun(run)))) return null;
246
+ if (body.daemonInstanceId !== void 0 && !validPollWireId(body.daemonInstanceId)) return null;
247
+ if (body.recoveryComplete !== void 0 && typeof body.recoveryComplete !== "boolean") return null;
248
+ return body;
249
+ }
250
+ /** Keep the HTTP adapter's protocol forwarding independently testable. */
251
+ function gatewayPollRequest(body) {
252
+ return {
253
+ protocolVersion: body.protocolVersion,
254
+ currentRuns: body.currentRuns,
255
+ daemonInstanceId: body.daemonInstanceId,
256
+ recoveryComplete: body.recoveryComplete,
257
+ info: {
258
+ host: body.host,
259
+ platform: body.platform,
260
+ arch: body.arch,
261
+ version: body.version
262
+ }
263
+ };
264
+ }
265
+ /** POST /api/machine/poll — daemon claims this machine's pending runs (Bearer device token). */
266
+ var Route$5 = createFileRoute("/api/machine/poll")({ server: { handlers: { POST: async ({ request }) => {
267
+ const auth = request.headers.get("authorization") ?? "";
268
+ const token = auth.startsWith("Bearer ") ? auth.slice(7) : "";
269
+ const limited = machineRouteLimit(request, token || void 0);
270
+ if (limited) return limited;
271
+ if (!token) return Response.json({ error: "missing device token" }, { status: 401 });
272
+ const parsed = await readJsonBody(request, MACHINE_BODY_CAP);
273
+ if (parsed.kind === "too-large") return Response.json({ error: "body too large" }, { status: 413 });
274
+ if (parsed.kind !== "ok") return Response.json({ error: "invalid JSON body" }, { status: 400 });
275
+ const body = parsePollBody(parsed.body);
276
+ if (!body) return Response.json({ error: "unknown or invalid poll body fields" }, { status: 400 });
277
+ const { getGateway } = await import("./boot-CdOO4xOo.mjs");
278
+ const r = await (await getGateway()).pollV4Wait(token, gatewayPollRequest(body));
279
+ return Response.json(r.body, { status: r.status });
280
+ } } } });
281
+ function parseCliBody(value) {
282
+ if (value === null || typeof value !== "object" || Array.isArray(value)) return null;
283
+ const body = value;
284
+ if (Object.keys(body).length !== 1 || !Object.prototype.hasOwnProperty.call(body, "argv")) return null;
285
+ if (!Array.isArray(body.argv) || body.argv.some((entry) => typeof entry !== "string")) return null;
286
+ return { argv: body.argv };
287
+ }
288
+ /**
289
+ * POST /api/machine/cli — the ONE unified CLI dispatch (Bearer credential + `{argv}`).
290
+ * `CliGateway.cli()` branches by credential type: a `dk_` device token takes owner
291
+ * commands, while an `rk_` run credential can only report its run. Uses the standard
292
+ * 2MB machine JSON body cap.
293
+ */
294
+ var Route$4 = createFileRoute("/api/machine/cli")({ server: { handlers: { POST: async ({ request }) => {
295
+ const auth = request.headers.get("authorization") ?? "";
296
+ const token = auth.startsWith("Bearer ") ? auth.slice(7) : "";
297
+ const limited = machineRouteLimit(request, token || void 0);
298
+ if (limited) return limited;
299
+ if (!token) return Response.json({ error: "missing credential" }, { status: 401 });
300
+ const parsed = await readJsonBody(request, MACHINE_BODY_CAP);
301
+ if (parsed.kind === "too-large") return Response.json({ error: "body too large" }, { status: 413 });
302
+ const body = parsed.kind === "ok" ? parseCliBody(parsed.body) : null;
303
+ if (!body) return Response.json({ error: "body must be exactly {argv:string[]}" }, { status: 400 });
304
+ const { getCliGateway } = await import("./boot-CdOO4xOo.mjs");
305
+ const r = await (await getCliGateway()).cli(token, body.argv);
306
+ return Response.json(r.body, { status: r.status });
307
+ } } } });
308
+ /**
309
+ * DB-touching liveness probe — the ONE home for the wedged-pool incident rationale
310
+ * (db/index.ts and the Fly checks point here). Unlike /api/health (which never
311
+ * touches the DB and so reported `ok` right through a ~5.5h outage while a dead
312
+ * postgres-js pool masked it), this runs a trivial `select 1` through the runtime
313
+ * pool.
314
+ *
315
+ * This route SURFACES a wedged pool (Fly's check goes critical, which de-routes the
316
+ * machine); it does NOT by itself recover it. Fly's failing `[http_service.checks]`
317
+ * only pull the machine from load balancing — they never restart the VM (the
318
+ * 2026-07-12 outage: pool wedged, check critical, box down ~9h with no auto-restart
319
+ * until a manual `fly machine restart`). The ACTUAL auto-recovery is the in-process
320
+ * DB watchdog (`server/dbWatchdog.ts`), which exits the process on a sustained wedge
321
+ * so Fly's `restart.policy = "on-failure"` brings up a fresh pool.
322
+ *
323
+ * A wedged pool makes `select 1` HANG (queued behind stuck connections; the pool's
324
+ * `statement_timeout` is unenforced under the Supabase transaction pooler). So the
325
+ * probe races the query against a hard client-side deadline (`PROBE_TIMEOUT_MS`, <
326
+ * Fly's 10s check timeout) and returns a fast 503 instead of eating the full timeout
327
+ * "awaiting headers". 200 → DB reachable; 503 → the query failed or timed out.
328
+ * Drizzle imported inside the handler so it stays out of the client bundle.
329
+ */
330
+ var PROBE_TIMEOUT_MS = 5e3;
331
+ var Route$3 = createFileRoute("/api/health/db")({ server: { handlers: { GET: async () => {
332
+ try {
333
+ const { db } = await import("./db-CwLD-5w1.mjs");
334
+ const ping = db.execute(sql`select 1`);
335
+ const timeout = new Promise((_, reject) => {
336
+ setTimeout(() => reject(/* @__PURE__ */ new Error(`db ping timed out after ${PROBE_TIMEOUT_MS}ms`)), PROBE_TIMEOUT_MS).unref?.();
337
+ });
338
+ await Promise.race([ping, timeout]);
339
+ return Response.json({
340
+ ok: true,
341
+ db: "up"
342
+ });
343
+ } catch (err) {
344
+ return Response.json({
345
+ ok: false,
346
+ db: "down",
347
+ error: err instanceof Error ? err.message : String(err)
348
+ }, { status: 503 });
349
+ }
350
+ } } } });
351
+ /** Better Auth handler — GET/POST /api/auth/* (OAuth callbacks, session, sign-out). */
352
+ var Route$2 = createFileRoute("/api/auth/$")({ server: { handlers: {
353
+ GET: async ({ request }) => (await import("./auth-C0zoZCGe.mjs")).auth.handler(request),
354
+ POST: async ({ request }) => (await import("./auth-C0zoZCGe.mjs")).auth.handler(request)
355
+ } } });
356
+ /**
357
+ * `decodeURIComponent` that returns null on malformed percent-encoding instead
358
+ * of throwing a URIError (which would escape a route handler as a 500). Shared
359
+ * by the routes that decode path segments; the policy is uniform — ANY
360
+ * malformed segment is the caller's clean 400, never silently kept raw.
361
+ */
362
+ function safeDecode(s) {
363
+ try {
364
+ return decodeURIComponent(s);
365
+ } catch {
366
+ return null;
367
+ }
368
+ }
369
+ /**
370
+ * PUT /api/machine/blob/:hash — upload one content-addressed blob's raw bytes
371
+ * (Bearer DEVICE token). The server recomputes sha256(body) and rejects a
372
+ * mismatch before storing in the byte store. The hash is read from the URL (the daemon PUTs
373
+ * exactly the hashes the sync handshake returned in needHashes).
374
+ *
375
+ * This byte-ingress route is deliberately NOT rate limited: it requires a valid
376
+ * registered device token (unknown ⇒ 401, not an unauthenticated surface) and is
377
+ * already bounded by the sync hash-handshake (the server only accepts hashes it
378
+ * asked THIS machine for) plus the per-file 10MB byte cap. A
379
+ * large first sync bursts many concurrent PUTs on one token, so any limiter would
380
+ * only throttle legitimate uploads without adding real protection.
381
+ */
382
+ var Route$1 = createFileRoute("/api/machine/blob/$hash")({ server: { handlers: { PUT: async ({ request }) => {
383
+ const auth = request.headers.get("authorization") ?? "";
384
+ const token = auth.startsWith("Bearer ") ? auth.slice(7) : "";
385
+ if (!token) return Response.json({ error: "missing device token" }, { status: 401 });
386
+ const hash = safeDecode(new URL(request.url).pathname.split("/").pop() ?? "");
387
+ if (hash === null) return Response.json({ error: "bad hash" }, { status: 400 });
388
+ const { BLOB_CAP } = await import("./artifacts-BR3jj0NC.mjs");
389
+ const body = await readByteBody(request, BLOB_CAP);
390
+ if (body.kind === "too-large") return Response.json({ error: "blob exceeds size cap" }, { status: 413 });
391
+ if (body.kind === "invalid") return Response.json({ error: "could not read blob body" }, { status: 400 });
392
+ const buf = Buffer.from(body.bytes.buffer, body.bytes.byteOffset, body.bytes.byteLength);
393
+ const { getArtifactSync } = await import("./boot-CdOO4xOo.mjs");
394
+ const r = await (await getArtifactSync()).putBlob(token, hash, buf);
395
+ return Response.json(r.body, { status: r.status });
396
+ } } } });
397
+ /**
398
+ * GET /api/artifact/:loopId/:path - stream one of a loop's live-synced artifact
399
+ * blobs. Two dispositions:
400
+ * - default: `attachment` (the download affordance for binary/oversize files;
401
+ * text is shown inline via getArtifact).
402
+ * - `?view=inline`: for a KNOWN image type only (the `imageMime` allowlist),
403
+ * served `inline` with the real image content-type so an <img> can render it.
404
+ * Hardened against a direct navigation turning the byte stream into a scripted
405
+ * document on the app origin: `X-Content-Type-Options: nosniff` pins the type
406
+ * and `Content-Security-Policy: sandbox` loads it in an opaque origin with no
407
+ * scripts - so an inline SVG can't run script against the session even if the
408
+ * URL is opened directly. Non-image inline requests fall back to attachment.
409
+ *
410
+ * Authed via the WEB SESSION (not a machine token) and scoped to the loop's team,
411
+ * mirroring the server fns' `ownedLoop` gate. Path-safe: the relative path is
412
+ * normalized + traversal-rejected before it ever reaches a blob, and blob keys
413
+ * are content hashes, never the user path. Reads stream from the BlobStore
414
+ * (local by default, R2 when configured); the route never writes.
415
+ */
416
+ var PREFIX = "/api/artifact/";
417
+ var Route = createFileRoute("/api/artifact/$loopId/$")({ server: { handlers: { GET: async ({ request }) => {
418
+ const pathname = new URL(request.url).pathname;
419
+ if (!pathname.startsWith(PREFIX)) return Response.json({ error: "not found" }, { status: 404 });
420
+ const after = pathname.slice(14);
421
+ const slash = after.indexOf("/");
422
+ if (slash < 0) return Response.json({ error: "missing path" }, { status: 400 });
423
+ const loopId = safeDecode(after.slice(0, slash));
424
+ if (loopId === null) return Response.json({ error: "bad loop id" }, { status: 400 });
425
+ const segments = after.slice(slash + 1).split("/").map((s) => safeDecode(s));
426
+ if (segments.some((s) => s === null)) return Response.json({ error: "bad path" }, { status: 400 });
427
+ const relPath = segments.join("/");
428
+ const loop = await (await import("./store-Cujtg2QE.mjs")).getLoop(loopId);
429
+ if (!loop) return Response.json({ error: "not found" }, { status: 404 });
430
+ const { requestScope, canAccessLoop } = await import("./auth-C0zoZCGe.mjs");
431
+ if (!await canAccessLoop(loop.teamId, await requestScope())) return Response.json({ error: "not found" }, { status: 404 });
432
+ const { readLoopArtifactBytes } = await import("./artifactFiles-DtpRidFZ.mjs");
433
+ const r = await readLoopArtifactBytes(loopId, relPath);
434
+ if (r.status !== 200 || !r.bytes) return Response.json({ error: "not found" }, { status: r.status });
435
+ const filename = (r.filename || "file").replace(/["\\\r\n]/g, "_");
436
+ const mime = new URL(request.url).searchParams.get("view") === "inline" ? imageMime(relPath) : null;
437
+ if (mime) return new Response(new Uint8Array(r.bytes), {
438
+ status: 200,
439
+ headers: {
440
+ "content-type": mime,
441
+ "content-length": String(r.bytes.length),
442
+ "content-disposition": `inline; filename="${filename}"`,
443
+ "x-content-type-options": "nosniff",
444
+ "content-security-policy": "sandbox",
445
+ "cache-control": "private, no-store"
446
+ }
447
+ });
448
+ return new Response(new Uint8Array(r.bytes), {
449
+ status: 200,
450
+ headers: {
451
+ "content-type": r.binary ? "application/octet-stream" : "text/plain; charset=utf-8",
452
+ "content-length": String(r.bytes.length),
453
+ "content-disposition": `attachment; filename="${filename}"`,
454
+ "cache-control": "private, no-store"
455
+ }
456
+ });
457
+ } } } });
458
+ var IndexRoute = Route$15.update({
459
+ id: "/",
460
+ path: "/",
461
+ getParentRoute: () => Route$11
462
+ });
463
+ var TTeamIdRoute = Route$16.update({
464
+ id: "/t/$teamId",
465
+ path: "/t/$teamId",
466
+ getParentRoute: () => Route$11
467
+ });
468
+ var MachineReportRoute = Route$10.update({
469
+ id: "/machine/report",
470
+ path: "/machine/report",
471
+ getParentRoute: () => Route$11
472
+ });
473
+ var LoopsLoopIdRoute = Route$13.update({
474
+ id: "/loops/$loopId",
475
+ path: "/loops/$loopId",
476
+ getParentRoute: () => Route$11
477
+ });
478
+ var InviteTokenRoute = Route$12.update({
479
+ id: "/invite/$token",
480
+ path: "/invite/$token",
481
+ getParentRoute: () => Route$11
482
+ });
483
+ var ApiReadyRoute = Route$9.update({
484
+ id: "/api/ready",
485
+ path: "/api/ready",
486
+ getParentRoute: () => Route$11
487
+ });
488
+ var ApiHealthRoute = Route$8.update({
489
+ id: "/api/health",
490
+ path: "/api/health",
491
+ getParentRoute: () => Route$11
492
+ });
493
+ var ApiMachineSyncRoute = Route$7.update({
494
+ id: "/api/machine/sync",
495
+ path: "/api/machine/sync",
496
+ getParentRoute: () => Route$11
497
+ });
498
+ var ApiMachineStatusRoute = Route$6.update({
499
+ id: "/api/machine/status",
500
+ path: "/api/machine/status",
501
+ getParentRoute: () => Route$11
502
+ });
503
+ var ApiMachinePollRoute = Route$5.update({
504
+ id: "/api/machine/poll",
505
+ path: "/api/machine/poll",
506
+ getParentRoute: () => Route$11
507
+ });
508
+ var ApiMachineCliRoute = Route$4.update({
509
+ id: "/api/machine/cli",
510
+ path: "/api/machine/cli",
511
+ getParentRoute: () => Route$11
512
+ });
513
+ var ApiHealthDbRoute = Route$3.update({
514
+ id: "/db",
515
+ path: "/db",
516
+ getParentRoute: () => ApiHealthRoute
517
+ });
518
+ var ApiAuthSplatRoute = Route$2.update({
519
+ id: "/api/auth/$",
520
+ path: "/api/auth/$",
521
+ getParentRoute: () => Route$11
522
+ });
523
+ var LoopsLoopIdRunsRunIdRoute = Route$14.update({
524
+ id: "/loops/$loopId_/runs/$runId",
525
+ path: "/loops/$loopId/runs/$runId",
526
+ getParentRoute: () => Route$11
527
+ });
528
+ var ApiMachineBlobHashRoute = Route$1.update({
529
+ id: "/api/machine/blob/$hash",
530
+ path: "/api/machine/blob/$hash",
531
+ getParentRoute: () => Route$11
532
+ });
533
+ var ApiArtifactLoopIdSplatRoute = Route.update({
534
+ id: "/api/artifact/$loopId/$",
535
+ path: "/api/artifact/$loopId/$",
536
+ getParentRoute: () => Route$11
537
+ });
538
+ var ApiHealthRouteChildren = { ApiHealthDbRoute };
539
+ var rootRouteChildren = {
540
+ IndexRoute,
541
+ ApiHealthRoute: ApiHealthRoute._addFileChildren(ApiHealthRouteChildren),
542
+ ApiReadyRoute,
543
+ InviteTokenRoute,
544
+ LoopsLoopIdRoute,
545
+ MachineReportRoute,
546
+ TTeamIdRoute,
547
+ ApiAuthSplatRoute,
548
+ ApiMachineCliRoute,
549
+ ApiMachinePollRoute,
550
+ ApiMachineStatusRoute,
551
+ ApiMachineSyncRoute,
552
+ ApiArtifactLoopIdSplatRoute,
553
+ ApiMachineBlobHashRoute,
554
+ LoopsLoopIdRunsRunIdRoute
555
+ };
556
+ var routeTree = Route$11._addFileChildren(rootRouteChildren)._addFileTypes();
557
+ function getRouter() {
558
+ return createRouter({
559
+ routeTree,
560
+ scrollRestoration: true,
561
+ defaultPreload: "intent"
562
+ });
563
+ }
564
+ //#endregion
565
+ export { getRouter };
@@ -1,10 +1,9 @@
1
1
  import { c as createFileRoute, p as redirect, s as lazyRouteComponent } from "../_libs/@tanstack/react-router+[...].mjs";
2
- import { c as getAuthState, d as getDefaultTeam, g as listTemplates } from "./loopApi-8_KgBapr.mjs";
3
- import { a as authClient } from "./LoopPlaybook-DC7QVvPY.mjs";
4
- import { n as fetchLiveData } from "./DashboardView-BF7PciP7.mjs";
5
- //#region node_modules/.nitro/vite/services/ssr/assets/routes-ClZEdsnB.js
6
- var $$splitErrorComponentImporter = () => import("./routes-ComqHvCL.mjs");
7
- var $$splitComponentImporter = () => import("./routes-D5jJJ-30.mjs");
2
+ import { f as getDefaultTeam, i as authClient, u as getAuthState } from "./SocialLinks-Cm4H8pUJ.mjs";
3
+ import { n as fetchLiveData } from "./DashboardView-C2LdV6J0.mjs";
4
+ //#region node_modules/.nitro/vite/services/ssr/assets/routes-BulNEUEE.js
5
+ var $$splitErrorComponentImporter = () => import("./routes-DD94baie.mjs");
6
+ var $$splitComponentImporter = () => import("./routes-Wjexi35W.mjs");
8
7
  /**
9
8
  * The home route. Under the auth gate it is now a THIN redirect to the explicit
10
9
  * team URL (`/t/<lastUsed|personal>`) so the dashboard's team lives in the path
@@ -30,10 +29,7 @@ var Route = createFileRoute("/")({
30
29
  return {
31
30
  mode: "dashboard",
32
31
  auth,
33
- initial: {
34
- ...await fetchLiveData(),
35
- templates: await listTemplates()
36
- }
32
+ initial: await fetchLiveData()
37
33
  };
38
34
  },
39
35
  component: lazyRouteComponent($$splitComponentImporter, "component"),
@@ -1,7 +1,7 @@
1
- import { g as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
1
+ import { h as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
2
+ import { r as LoadErrorCard } from "./actionUi-DJBWuNwr.mjs";
2
3
  import { f as useRouter } from "../_libs/@tanstack/react-router+[...].mjs";
3
- import { r as LoadErrorCard } from "./actionUi-BN55TNYE.mjs";
4
- //#region node_modules/.nitro/vite/services/ssr/assets/routes-ComqHvCL.js
4
+ //#region node_modules/.nitro/vite/services/ssr/assets/routes-DD94baie.js
5
5
  var import_jsx_runtime = require_jsx_runtime();
6
6
  /**
7
7
  * The home route. Under the auth gate it is now a THIN redirect to the explicit
@@ -1,9 +1,9 @@
1
- import { g as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
2
- import { s as useSession } from "./LoopPlaybook-DC7QVvPY.mjs";
3
- import { t as SignIn } from "./SignIn-RmpWm9uy.mjs";
4
- import { t as DashboardView } from "./DashboardView-BF7PciP7.mjs";
5
- import { t as Route } from "./routes-ClZEdsnB.mjs";
6
- //#region node_modules/.nitro/vite/services/ssr/assets/routes-D5jJJ-30.js
1
+ import { h as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
2
+ import { E as useSession } from "./SocialLinks-Cm4H8pUJ.mjs";
3
+ import { t as SignIn } from "./SignIn-DEGrvJvb.mjs";
4
+ import { t as DashboardView } from "./DashboardView-C2LdV6J0.mjs";
5
+ import { t as Route } from "./routes-BulNEUEE.mjs";
6
+ //#region node_modules/.nitro/vite/services/ssr/assets/routes-Wjexi35W.js
7
7
  var import_jsx_runtime = require_jsx_runtime();
8
8
  /**
9
9
  * The home route. Under the auth gate it is now a THIN redirect to the explicit
@@ -0,0 +1,2 @@
1
+ import { _ as computeRunDiff } from "./boot-sNlIkoLe.mjs";
2
+ export { computeRunDiff };