@kky42/pievo-server 2.4.1 → 2.4.4

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 (82) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/MachinesModal-Ci18Bitd.js +1 -0
  3. package/.output/public/assets/{SignIn-BdkKWOSs.js → SignIn-Czy-XJou.js} +1 -1
  4. package/.output/public/assets/{actionUi-BYBeYy7U.js → actionUi-DGJmNwsD.js} +1 -1
  5. package/.output/public/assets/app-CuZ0I3Mb.css +2 -0
  6. package/.output/public/assets/index-gJavUZIA.js +10 -0
  7. package/.output/public/assets/{invite._token-ZnVQqqq4.js → invite._token-BQUbjPMM.js} +1 -1
  8. package/.output/public/assets/invite._token-BUYUsIBj.js +1 -0
  9. package/.output/public/assets/lifecycleUi-C0DaC6NM.js +1 -0
  10. package/.output/public/assets/loops._loopId-BkEPvT1q.js +67 -0
  11. package/.output/public/assets/{loops._loopId_.runs._runId-CA0-q1y5.js → loops._loopId_.runs._runId-SM4sD1xB.js} +2 -2
  12. package/.output/public/assets/{preload-helper-CUIO87nJ.js → preload-helper-D1jXs0sN.js} +3 -3
  13. package/.output/public/assets/routes-4mIvs8LG.js +1 -0
  14. package/.output/public/assets/routes-B0svLfFq.js +1 -0
  15. package/.output/public/assets/t._teamId-BLO_bz6b.js +1 -0
  16. package/.output/public/assets/t._teamId-D-wGh4mo.js +1 -0
  17. package/.output/public/assets/{ui-DGOT8AoZ.js → ui-DGHTxOhC.js} +1 -1
  18. package/.output/server/_ssr/{DashboardView-D_hKsCsv.mjs → DashboardView-DqZLADCp.mjs} +70 -333
  19. package/.output/server/_ssr/{MachinesModal-DZ_9ErAU.mjs → MachinesModal-BsCfGuwp.mjs} +142 -9
  20. package/.output/server/_ssr/{SignIn-DjSrg0nO.mjs → SignIn-ffgDY0yf.mjs} +3 -3
  21. package/.output/server/_ssr/{SocialLinks-BTjsnVOm.mjs → SocialLinks-Bt7huqfS.mjs} +7 -13
  22. package/.output/server/_ssr/{actionUi-D15R8L7R.mjs → actionUi-DD7Cd7Le.mjs} +2 -2
  23. package/.output/server/_ssr/{artifactFiles-CV3OXxRD.mjs → artifactFiles-DHBXTtZn.mjs} +3 -3
  24. package/.output/server/_ssr/{artifactKind-ByzVa7fg.mjs → artifactKind-CwQ_Ddj6.mjs} +3 -3
  25. package/.output/server/_ssr/artifacts-BR3jj0NC.mjs +2 -0
  26. package/.output/server/_ssr/{auth-CPCDf6Wr.mjs → auth-C0zoZCGe.mjs} +9 -9
  27. package/.output/server/_ssr/boot-CdOO4xOo.mjs +2 -0
  28. package/.output/server/_ssr/{boot-BbWxaF-z.mjs → boot-sNlIkoLe.mjs} +66 -129
  29. package/.output/server/_ssr/{bun-sqlite-dialect-BW9W1_Ps-8MIh9jN1.mjs → bun-sqlite-dialect-BW9W1_Ps-DmlZWqO7.mjs} +2 -2
  30. package/.output/server/_ssr/{d1-sqlite-dialect-BLC8LXE6-CcMQ01_d.mjs → d1-sqlite-dialect-BLC8LXE6-CCNzqZwZ.mjs} +2 -2
  31. package/.output/server/_ssr/db-CwLD-5w1.mjs +2 -0
  32. package/.output/server/_ssr/{dist-AxCsRawm.mjs → dist-B3SxDOpW.mjs} +2 -2
  33. package/.output/server/_ssr/{factory-S7MaMVC2.mjs → factory-Dv3Zopis.mjs} +2 -2
  34. package/.output/server/_ssr/{invite._token-B1UgMbNQ.mjs → invite._token-AvtAuDKv.mjs} +4 -12
  35. package/.output/server/_ssr/{invite._token-BliJIGk4.mjs → invite._token-CHR5K84a.mjs} +6 -14
  36. package/.output/server/_ssr/{invite._token-D296YVGd.mjs → invite._token-tw3mgvEo.mjs} +8 -16
  37. package/.output/server/_ssr/{kysely-adapter-DUdpqcCJ.mjs → kysely-adapter-nL7WKSgw.mjs} +1 -1
  38. package/.output/server/_ssr/lifecycleUi-DOr6Af13.mjs +51 -0
  39. package/.output/server/_ssr/logger-B8m8F1Qu.mjs +2 -0
  40. package/.output/server/_ssr/{loopApi-Dy8ztANM.mjs → loopApi-7YHXDl5g.mjs} +14 -61
  41. package/.output/server/_ssr/{loopProjection-BZ1_IYCr.mjs → loopProjection-eZvVobW7.mjs} +30 -5
  42. package/.output/server/_ssr/{loops._loopId-CKsAnxMl.mjs → loops._loopId-TEIcuqZU.mjs} +84 -112
  43. package/.output/server/_ssr/{loops._loopId_.runs._runId-a_SyY8rX.mjs → loops._loopId_.runs._runId-B4jXeonc.mjs} +3 -3
  44. package/.output/server/_ssr/{loops._loopId_.runs._runId-DG405pQs.mjs → loops._loopId_.runs._runId-BVQKe8xT.mjs} +6 -6
  45. package/.output/server/_ssr/{machineFns-BSaE7K88.mjs → machineFns-ByMsgG12.mjs} +3 -3
  46. package/.output/server/_ssr/{node-sqlite-dialect-rWwVyt2J.mjs → node-sqlite-dialect-CjNineno.mjs} +2 -2
  47. package/.output/server/_ssr/{router-lMkobh5r.mjs → router-DyhWcIzt.mjs} +65 -118
  48. package/.output/server/_ssr/{routes-DNCZrs8z.mjs → routes-BWLQNDn5.mjs} +2 -2
  49. package/.output/server/_ssr/{routes-ufPbrGHs.mjs → routes-Cz49hLy6.mjs} +5 -5
  50. package/.output/server/_ssr/{routes-CRHc9cLG.mjs → routes-DqIGr7p0.mjs} +5 -5
  51. package/.output/server/_ssr/runDiff-Ba8Lg1vg.mjs +2 -0
  52. package/.output/server/_ssr/ssr.mjs +39 -47
  53. package/.output/server/_ssr/store-Cujtg2QE.mjs +2 -0
  54. package/.output/server/_ssr/{t._teamId-BoBoYEHL.mjs → t._teamId-COoQSQtH.mjs} +5 -5
  55. package/.output/server/_ssr/{t._teamId-DcWOYjPf.mjs → t._teamId-Dms0PTMu.mjs} +2 -2
  56. package/.output/server/_ssr/{t._teamId-QD2nN0wn.mjs → t._teamId-xFPYdSPu.mjs} +5 -5
  57. package/.output/server/_ssr/{teamFns-BsmconJ1.mjs → teamFns-H438WnZC.mjs} +12 -30
  58. package/.output/server/_ssr/{teamFns-DcoVuWyH.mjs → teamFns-gilVwh7z.mjs} +2 -2
  59. package/.output/server/_ssr/tokens-DgG_Syq3.mjs +2 -0
  60. package/.output/server/_ssr/{ui-DmFKW2H_.mjs → ui-dMEI4sHj.mjs} +13 -9
  61. package/.output/server/_tanstack-start-manifest_v-UkU-Jq6w.mjs +86 -0
  62. package/.output/server/index.mjs +84 -84
  63. package/package.json +1 -2
  64. package/.output/public/assets/MachinesModal-CEddj7la.js +0 -1
  65. package/.output/public/assets/app-BAgHQVvr.css +0 -2
  66. package/.output/public/assets/index-BZLqD3JI.js +0 -12
  67. package/.output/public/assets/invite._token-BCLgmTO7.js +0 -1
  68. package/.output/public/assets/lifecycleUi-C7dwHtbw.js +0 -1
  69. package/.output/public/assets/loops._loopId-X8PSlgdB.js +0 -67
  70. package/.output/public/assets/routes-BjKcDy6D.js +0 -1
  71. package/.output/public/assets/routes-bfMcArTT.js +0 -1
  72. package/.output/public/assets/t._teamId-B75J8h0x.js +0 -1
  73. package/.output/public/assets/t._teamId-D7WVPMDr.js +0 -1
  74. package/.output/server/_ssr/artifacts-BhQvaGjF.mjs +0 -2
  75. package/.output/server/_ssr/boot-COHf8Gv3.mjs +0 -2
  76. package/.output/server/_ssr/db-dw61xIt1.mjs +0 -2
  77. package/.output/server/_ssr/lifecycleUi-Dad3hvhm.mjs +0 -37
  78. package/.output/server/_ssr/logger-DdUWuMdh.mjs +0 -2
  79. package/.output/server/_ssr/runDiff-CrZzjokj.mjs +0 -2
  80. package/.output/server/_ssr/store-CirPHuib.mjs +0 -2
  81. package/.output/server/_ssr/tokens-XngoyCU8.mjs +0 -2
  82. package/.output/server/_tanstack-start-manifest_v-Xd5bMpJe.mjs +0 -87
@@ -11,7 +11,7 @@ import { fileURLToPath } from "node:url";
11
11
  import path from "node:path";
12
12
  import os from "node:os";
13
13
  import fs$1 from "node:fs/promises";
14
- //#region node_modules/.nitro/vite/services/ssr/assets/boot-BbWxaF-z.js
14
+ //#region node_modules/.nitro/vite/services/ssr/assets/boot-sNlIkoLe.js
15
15
  var import_pino = /* @__PURE__ */ __toESM(require_pino());
16
16
  var import_pino_pretty = /* @__PURE__ */ __toESM(require_pino_pretty());
17
17
  function defineErrorCodes(codes) {
@@ -1430,9 +1430,8 @@ function coerceCodingAgent(value) {
1430
1430
  * (postgres-js on Supabase; embedded pglite for local/self-host + tests) — the
1431
1431
  * query-builder API is identical, only `db/index.ts` branches the driver.
1432
1432
  *
1433
- * Timestamps are ISO strings (`text`) for portability (no db-side defaults).
1434
- * JSON columns use `jsonb().$type<>()` for typed
1435
- * (de)serialization. Booleans use native `boolean()`.
1433
+ * Timestamp values are represented as ISO strings across both drivers. JSON
1434
+ * columns use `jsonb().$type<>()`; booleans use native `boolean()`.
1436
1435
  */
1437
1436
  var machines = pgTable("machines", {
1438
1437
  /** m-sha256(deviceToken)[:16] */
@@ -1737,7 +1736,6 @@ var runSnapshots = pgTable("run_snapshots", {
1737
1736
  manifest: jsonb("manifest").$type().notNull(),
1738
1737
  createdAt: text("created_at").notNull()
1739
1738
  }, (t) => [index("run_snapshots_loop_idx").on(t.loopId)]);
1740
- sql`1`;
1741
1739
  var user = pgTable("user", {
1742
1740
  id: text("id").primaryKey(),
1743
1741
  name: text("name").notNull(),
@@ -2854,8 +2852,7 @@ async function listMachines(teamId) {
2854
2852
  /**
2855
2853
  * Machines usable/visible in a team, MEMBERSHIP-scoped: every machine whose owner
2856
2854
  * belongs to the team (join `machines.userId` → a `team_members` row for this
2857
- * team). One machine therefore appears in every team its owner is a member of —
2858
- * the decoupling that lets a single daemon serve multiple teams (report §2.3).
2855
+ * team). One machine therefore appears in every team its owner belongs to.
2859
2856
  * A user has at most one membership row per team, so no machine is duplicated.
2860
2857
  */
2861
2858
  async function listMachinesForTeam(teamId) {
@@ -2889,9 +2886,7 @@ function teamIdForUser(userId) {
2889
2886
  }
2890
2887
  var ensuredTeams = /* @__PURE__ */ new Set();
2891
2888
  /** Idempotently create a team (+ owner membership) if absent. The email-derived
2892
- * `name` is INSERT-ONLY — it seeds a brand-new personal team but is NEVER synced
2893
- * onto an existing row, so an owner's `renameTeam` on their personal team sticks
2894
- * (design decision 5 / §6: the old force-rename silently reverted manual renames).
2889
+ * `name` seeds only a new personal team, so later owner renames persist.
2895
2890
  * Memoized ⇒ at most one reconcile per team per process. The team insert +
2896
2891
  * membership insert are one atomic transaction. */
2897
2892
  async function ensureTeam(id, name, ownerUserId) {
@@ -2919,8 +2914,7 @@ async function ensureTeam(id, name, ownerUserId) {
2919
2914
  function newTeamId() {
2920
2915
  return `team-${randomUUID().slice(0, 12)}`;
2921
2916
  }
2922
- /** Is this the user's undeletable personal team (`team-<ownerUserId>`)? The
2923
- * requestScope fallback, so it can be renamed (decision 5) but never deleted/left. */
2917
+ /** Whether this is the user's renamable but undeletable personal team. */
2924
2918
  function isPersonalTeam(team) {
2925
2919
  return !!team.ownerUserId && team.id === teamIdForUser(team.ownerUserId);
2926
2920
  }
@@ -2971,8 +2965,7 @@ async function listTeamMembers(teamId) {
2971
2965
  displayName: r.displayName ?? null
2972
2966
  })).sort((a, b) => a.role === b.role ? a.createdAt < b.createdAt ? -1 : 1 : a.role === "owner" ? -1 : 1);
2973
2967
  }
2974
- /** Resolve a user by email (case-insensitive) — the direct-add-by-email fast path
2975
- * (design §4 option A). Undefined ⇒ no account yet (invite-link path instead). */
2968
+ /** Resolve a user by email for direct membership; undefined means no account yet. */
2976
2969
  async function userByEmail(email) {
2977
2970
  const r = (await db.select({
2978
2971
  id: user.id,
@@ -3030,9 +3023,8 @@ async function setTeamMemberRoleGuarded(teamId, userId, role) {
3030
3023
  }
3031
3024
  /**
3032
3025
  * Delete a team and its dependents, transactionally. The CALLER enforces the
3033
- * policy guards first (personal-team undeletable; blocked while the team still
3034
- * owns loops — design decision 1, no cascade of loop history). We RE-CHECK the
3035
- * loop count INSIDE the transaction and abort (`has-loops`) if any loop exists,
3026
+ * policy guards first (personal-team undeletable; blocked while the team owns loops).
3027
+ * The transaction rechecks the loop count and aborts (`has-loops`) if one exists,
3036
3028
  * closing the check-then-cascade gap where a loop created between the caller's
3037
3029
  * guard and here would be orphaned at a now-deleted team. On success we cascade
3038
3030
  * the team's own resources: pending invites, memberships, and reassign
@@ -3394,7 +3386,7 @@ function parseArtifactSyncBody(value) {
3394
3386
  }
3395
3387
  /**
3396
3388
  * Machine + run credential helpers. Device tokens (`dk_…`) identify a machine
3397
- * (its id is derived from the token: `m-sha256(token)[:16]`, BYOA §2). A RUN
3389
+ * (its id is derived from the token: `m-sha256(token)[:16]`). A run
3398
3390
  * LEASE (`rk_…`) is minted per delivery, bound to one run, and carries the
3399
3391
  * run's least-privilege caps — the CLI dispatch authorizes the `pievo` shim
3400
3392
  * against it. Its lifecycle is a small state machine (`active` →
@@ -3403,10 +3395,9 @@ function parseArtifactSyncBody(value) {
3403
3395
  *
3404
3396
  * Leases and connect-key bindings are DURABLE (run_leases / connect_keys
3405
3397
  * tables): they must survive a deploy, or every restart 401s the in-flight
3406
- * runs' callbacks/finalize and silently mis-files a post-restart paste into the
3407
- * machine's home team. The short-lived UI correlations (`claimResults`) and the
3408
- * 15-min `new` idempotency window stay in-process (accepted restart gaps —
3409
- * losing one only degrades a dialog wait / a retry dedupe, never data).
3398
+ * runs' callbacks/finalize and silently mis-files a post-restart create into the
3399
+ * machine's home team. The 15-minute `new` idempotency window stays in-process;
3400
+ * losing it only degrades retry deduplication, never persisted data.
3410
3401
  */
3411
3402
  function sha256(s) {
3412
3403
  return createHash("sha256").update(s).digest("hex");
@@ -3465,9 +3456,7 @@ async function getDeviceOwner(machineId, now = Date.now()) {
3465
3456
  return row.userId;
3466
3457
  }
3467
3458
  /** How long a terminal-grace lease stays alive to accept one late wake-report.
3468
- * Generous on purpose: a laptop can sleep overnight or across a weekend before the
3469
- * daemon resumes and delivers the run's real result. (Subsumes the former
3470
- * `RECLAIM_GRACE_MS`.) */
3459
+ * A laptop can sleep overnight or across a weekend before the daemon resumes. */
3471
3460
  var TERMINAL_GRACE_MS = 1440 * 60 * 1e3;
3472
3461
  /** Leases live in the `run_leases` table, keyed by sha256(full `rk_…` wire
3473
3462
  * token), so a deploy is invisible to an in-flight run and a DB leak never hands
@@ -3545,17 +3534,6 @@ function readNewIdempotency(key, machineId, now = Date.now()) {
3545
3534
  if (rec.machineId !== machineId) return void 0;
3546
3535
  return rec.loopId;
3547
3536
  }
3548
- var claimResults = /* @__PURE__ */ new Map();
3549
- function fulfillClaim(token, result) {
3550
- claimResults.set(token, result);
3551
- }
3552
- /** Read-and-consume: the dialog polls until it sees the result once, then closes —
3553
- * so we evict on first read to keep the map from growing one dead entry per loop. */
3554
- function readClaim(token) {
3555
- const r = claimResults.get(token);
3556
- if (r) claimResults.delete(token);
3557
- return r;
3558
- }
3559
3537
  /**
3560
3538
  * Derive a machine's presence from its stored `online` flag + `lastSeen` stamp.
3561
3539
  * `online` requires BOTH the flag and a fresh stamp (the stored flag lags the
@@ -4159,18 +4137,11 @@ async function authenticateDeviceToken(deviceToken, options = {}) {
4159
4137
  machine
4160
4138
  };
4161
4139
  }
4162
- /** A double-quoted string is needed when the bare token would be ambiguous inside a
4163
- * `key: value` line or a comma-delimited row: an empty string, or one carrying
4164
- * whitespace, a comma, a colon, or a double-quote. This matches gh-axi's observable
4165
- * behavior (every value it leaves bare is a single delimiter-free token; anything
4166
- * with a space/comma/colon it quotes). */
4140
+ /** Whether a token needs quoting inside a key/value line or comma-delimited row. */
4167
4141
  function needsQuote(s) {
4168
4142
  return s === "" || /[\s,:"]/.test(s);
4169
4143
  }
4170
- /** Always wrap a string in double quotes, escaping backslashes, quotes, and newlines
4171
- * so the value survives on a single line (`\n` rendered as two chars, like gh-axi's
4172
- * body field). Used for error messages (always quoted, per gh-axi) and by `scalar`
4173
- * when quoting is required. */
4144
+ /** Quote and escape a string so it remains on one line. */
4174
4145
  function quote(s) {
4175
4146
  return `"${s.replace(/\\/g, "\\\\").replace(/"/g, "\\\"").replace(/\r?\n/g, "\\n")}"`;
4176
4147
  }
@@ -4203,8 +4174,7 @@ function detailBlock(topKey, rows) {
4203
4174
  }
4204
4175
  return lines.join("\n");
4205
4176
  }
4206
- /** The `count:` aggregate line (P4). `total` → `count: N of TOTAL total` (a windowed
4207
- * survey); `showing` → `count: N (showing first SHOWING)`; else `count: N`. */
4177
+ /** Render a count, optionally with total or displayed-window context. */
4208
4178
  function countLine(count, opts = {}) {
4209
4179
  if (opts.total !== void 0) return `count: ${count} of ${opts.total} total`;
4210
4180
  if (opts.showing !== void 0) return `count: ${count} (showing first ${opts.showing})`;
@@ -4224,22 +4194,16 @@ function listBlock(name, fields, rows) {
4224
4194
  for (const row of rows) lines.push(` ${row.map(scalar).join(",")}`);
4225
4195
  return lines.join("\n");
4226
4196
  }
4227
- /** A definitive empty collection (P5): the bare `name: []` line. Pair with
4228
- * `countLine(0)` for the full `count: 0` + `name: []` empty state. */
4197
+ /** Render an empty named collection. */
4229
4198
  function emptyList(name) {
4230
4199
  return `${name}: []`;
4231
4200
  }
4232
- /**
4233
- * A contextual-disclosure help block (P9): `help[N]:` then each command template
4234
- * indented two spaces, verbatim (they carry backticks + `<placeholders>`).
4235
- */
4201
+ /** Render command templates as an indented help block. */
4236
4202
  function helpBlock(lines) {
4237
4203
  return [`help[${lines.length}]:`, ...lines.map((l) => ` ${l}`)].join("\n");
4238
4204
  }
4239
4205
  /**
4240
- * A structured error (P6): the message (always quoted) plus a bare machine-readable
4241
- * slug, both to stdout. Slugs: VALIDATION_ERROR, FORBIDDEN, NOT_FOUND, CONFLICT,
4242
- * UNAUTHORIZED, RATE_LIMITED, ERROR.
4206
+ * Render a quoted error plus a machine-readable code.
4243
4207
  *
4244
4208
  * error: "status must be keep|no-change|block (got \"wibble\")"
4245
4209
  * code: VALIDATION_ERROR
@@ -4247,7 +4211,7 @@ function helpBlock(lines) {
4247
4211
  function errorBlock(message, code) {
4248
4212
  return `error: ${quote(message)}\ncode: ${code}`;
4249
4213
  }
4250
- /** The axi error-code slug for an HTTP status (P6). */
4214
+ /** Map an HTTP status to its CLI error code. */
4251
4215
  function codeForStatus(status) {
4252
4216
  switch (status) {
4253
4217
  case 400: return "VALIDATION_ERROR";
@@ -4259,13 +4223,7 @@ function codeForStatus(status) {
4259
4223
  default: return "ERROR";
4260
4224
  }
4261
4225
  }
4262
- /**
4263
- * Content truncation with a size hint (P3). A string within `cap` passes through
4264
- * unchanged; a longer one is clipped to `cap` chars and gets the hint appended INSIDE
4265
- * the value (so a caller can quote the whole thing as one field, like gh-axi's body).
4266
- * `tail` is the escape-hatch phrasing — the full `use --full to see complete body`
4267
- * for a detail body, or a terse `use --full` for a dense list cell.
4268
- */
4226
+ /** Clip content at `cap` and append its original size plus recovery hint. */
4269
4227
  function truncate(text, cap, tail = "use --full to see complete body") {
4270
4228
  if (text.length <= cap) return {
4271
4229
  value: text,
@@ -4723,6 +4681,29 @@ function daemonNeedsUpdate(current, required = MIN_DAEMON_VERSION) {
4723
4681
  function daemonUpgradeCommand() {
4724
4682
  return "npm install -g @kky42/pievo@latest && pievo daemon restart";
4725
4683
  }
4684
+ var POLL_INFO_FIELDS = new Set([
4685
+ "host",
4686
+ "platform",
4687
+ "arch",
4688
+ "version"
4689
+ ]);
4690
+ var POLL_V4_REQUEST_FIELDS = new Set([
4691
+ "protocolVersion",
4692
+ "currentRuns",
4693
+ "daemonInstanceId",
4694
+ "recoveryComplete",
4695
+ "info"
4696
+ ]);
4697
+ var POLL_HTTP_BODY_FIELDS = new Set([
4698
+ ...POLL_INFO_FIELDS,
4699
+ "protocolVersion",
4700
+ "currentRuns",
4701
+ "daemonInstanceId",
4702
+ "recoveryComplete"
4703
+ ]);
4704
+ var validPollWireId = (value) => typeof value === "string" && value.length <= 200 && value.trim().length > 0 && !value.includes("\0");
4705
+ var validPollCurrentRun = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length === 2 && Object.prototype.hasOwnProperty.call(value, "runId") && Object.prototype.hasOwnProperty.call(value, "stage") && validPollWireId(value.runId) && (value.stage === "executing" || value.stage === "reporting");
4706
+ var validPollInfo = (value) => value === void 0 || value !== null && typeof value === "object" && !Array.isArray(value) && Object.keys(value).every((key) => POLL_INFO_FIELDS.has(key)) && validOptionalPollString(value.host, 524288) && validOptionalPollString(value.platform, 524288) && validOptionalPollString(value.arch, 524288) && validOptionalPollString(value.version, 64);
4726
4707
  /**
4727
4708
  * Machine gateway - the run-lifecycle core of the HTTP surface the daemon talks
4728
4709
  * to (poll transport: short-poll while a run is in flight, opt-in server-held
@@ -5138,25 +5119,8 @@ var MachineGateway = class {
5138
5119
  }
5139
5120
  /** Protocol-v4 poll: plural local state, one new delivery per poll. */
5140
5121
  async pollV4(deviceToken, request) {
5141
- const validWireId = (value) => typeof value === "string" && value.length <= 200 && value.trim().length > 0 && !value.includes("\0");
5142
- const validCurrent = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length === 2 && Object.prototype.hasOwnProperty.call(value, "runId") && Object.prototype.hasOwnProperty.call(value, "stage") && validWireId(value.runId) && (value.stage === "executing" || value.stage === "reporting");
5143
- const requestFields = new Set([
5144
- "protocolVersion",
5145
- "currentRuns",
5146
- "daemonInstanceId",
5147
- "recoveryComplete",
5148
- "info"
5149
- ]);
5150
- const infoFields = new Set([
5151
- "host",
5152
- "platform",
5153
- "arch",
5154
- "version"
5155
- ]);
5156
5122
  const rawRequest = request;
5157
- const rawInfo = rawRequest?.info;
5158
- const infoValid = rawInfo === void 0 || rawInfo !== null && typeof rawInfo === "object" && !Array.isArray(rawInfo) && Object.keys(rawInfo).every((key) => infoFields.has(key)) && validOptionalPollString(rawInfo.host, 524288) && validOptionalPollString(rawInfo.platform, 524288) && validOptionalPollString(rawInfo.arch, 524288) && validOptionalPollString(rawInfo.version, 64);
5159
- if (request === null || typeof request !== "object" || Array.isArray(request) || Object.keys(rawRequest).some((key) => !requestFields.has(key)) || !infoValid || rawRequest.protocolVersion !== void 0 && (typeof rawRequest.protocolVersion !== "number" || !Number.isInteger(rawRequest.protocolVersion)) || rawRequest.currentRuns !== void 0 && (!Array.isArray(rawRequest.currentRuns) || rawRequest.currentRuns.some((run) => !validCurrent(run))) || rawRequest.daemonInstanceId !== void 0 && !validWireId(rawRequest.daemonInstanceId) || rawRequest.recoveryComplete !== void 0 && typeof rawRequest.recoveryComplete !== "boolean") return {
5123
+ if (request === null || typeof request !== "object" || Array.isArray(request) || Object.keys(rawRequest).some((key) => !POLL_V4_REQUEST_FIELDS.has(key)) || !validPollInfo(rawRequest?.info) || rawRequest.protocolVersion !== void 0 && (typeof rawRequest.protocolVersion !== "number" || !Number.isInteger(rawRequest.protocolVersion)) || rawRequest.currentRuns !== void 0 && (!Array.isArray(rawRequest.currentRuns) || rawRequest.currentRuns.some((run) => !validPollCurrentRun(run))) || rawRequest.daemonInstanceId !== void 0 && !validPollWireId(rawRequest.daemonInstanceId) || rawRequest.recoveryComplete !== void 0 && typeof rawRequest.recoveryComplete !== "boolean") return {
5160
5124
  status: 400,
5161
5125
  body: {
5162
5126
  error: "invalid poll request",
@@ -5179,7 +5143,7 @@ var MachineGateway = class {
5179
5143
  }
5180
5144
  };
5181
5145
  }
5182
- if (!Array.isArray(request.currentRuns) || request.currentRuns.some((run) => !validCurrent(run))) return {
5146
+ if (!Array.isArray(request.currentRuns) || request.currentRuns.some((run) => !validPollCurrentRun(run))) return {
5183
5147
  status: 400,
5184
5148
  body: {
5185
5149
  error: "invalid currentRuns",
@@ -5193,7 +5157,7 @@ var MachineGateway = class {
5193
5157
  code: "VALIDATION_ERROR"
5194
5158
  }
5195
5159
  };
5196
- if (!validWireId(request.daemonInstanceId)) return {
5160
+ if (!validPollWireId(request.daemonInstanceId)) return {
5197
5161
  status: 400,
5198
5162
  body: {
5199
5163
  error: "a valid daemonInstanceId is required",
@@ -5279,12 +5243,8 @@ var MachineGateway = class {
5279
5243
  }
5280
5244
  };
5281
5245
  }
5282
- /**
5283
- * Create a loop from Claude Code (Bearer device token). The user perfected the
5284
- * task in their own Claude Code session, then — per SKILL.md — claude authors
5285
- * the loop config and POSTs it here. Binds the loop to the token's machine and
5286
- * schedules it immediately. The web's New-loop dialog is just waiting on this.
5287
- */
5246
+ /** Create a validated loop through device authority, bind it to that machine,
5247
+ * and schedule it immediately. */
5288
5248
  async createLoop(deviceToken, body) {
5289
5249
  const auth = await authenticateDeviceToken(deviceToken);
5290
5250
  if (!auth.ok) return auth.response;
@@ -5360,12 +5320,6 @@ var MachineGateway = class {
5360
5320
  ...row
5361
5321
  });
5362
5322
  this.scheduler.addLoop(loop);
5363
- if (typeof claim === "string") fulfillClaim(claim, {
5364
- loopId: loop.id,
5365
- name: loop.name,
5366
- machineId,
5367
- agent: loop.agent
5368
- });
5369
5323
  recordNewIdempotency(idempotencyKey, machineId, loop.id);
5370
5324
  log$2.info({
5371
5325
  machineId,
@@ -5383,10 +5337,8 @@ var MachineGateway = class {
5383
5337
  };
5384
5338
  }
5385
5339
  }
5386
- /** List the loops bound to this machine, for `pievo loops`. The default columns
5387
- * are the minimal `{id,name,cron,enabled,nextFire}` (P2); `--fields` extends them
5388
- * from the optional set, and an unknown field fails loud (P6, VALIDATION_ERROR).
5389
- * `--json` (OQ4) is the escape hatch: the full structured records as real JSON
5340
+ /** List loops bound to this machine. `--fields` extends the minimal default
5341
+ * columns and rejects unknown names. `--json` returns full structured records
5390
5342
  * (first byte `[`), mirroring `show --json` — the daemon prints `text` either way. */
5391
5343
  async listLoops(deviceToken, fieldsFlag, json) {
5392
5344
  const auth = await authenticateDeviceToken(deviceToken);
@@ -5499,10 +5451,6 @@ var MachineGateway = class {
5499
5451
  };
5500
5452
  }
5501
5453
  }
5502
- /** Read a New-loop claim's result (the web dialog polls this while waiting). */
5503
- claimStatus(token) {
5504
- return readClaim(token);
5505
- }
5506
5454
  async rejectRetiredConflict(runToken, lease, body, payloadDigest) {
5507
5455
  const ackBody = {
5508
5456
  ok: true,
@@ -5878,8 +5826,7 @@ function fmtTimeZoned(iso, timezone, opts = {}) {
5878
5826
  return fmtTime(iso);
5879
5827
  }
5880
5828
  }
5881
- /** `pievo loops` default columns (P2 — minimal): identity + the two things an
5882
- * agent scans for (schedule + when it next fires). */
5829
+ /** Minimal default columns for `pievo loops`. */
5883
5830
  var LIST_DEFAULT_FIELDS = [
5884
5831
  "id",
5885
5832
  "name",
@@ -5888,7 +5835,7 @@ var LIST_DEFAULT_FIELDS = [
5888
5835
  "nextFire"
5889
5836
  ];
5890
5837
  /** The optional columns `--fields` may add (the "available" set an unknown field is
5891
- * measured against, §4.2). `runs`/`lastResult` are derived per loop. */
5838
+ * measured against). `runs`/`lastResult` are derived per loop. */
5892
5839
  var LIST_OPTIONAL_FIELDS = [
5893
5840
  "timezone",
5894
5841
  "model",
@@ -5912,7 +5859,7 @@ function loopCell(rec, field) {
5912
5859
  default: return null;
5913
5860
  }
5914
5861
  }
5915
- /** `pievo loops` — the typed loop list (P2/P4/P5/P9). Columns = the default set
5862
+ /** Render the typed loop list. Columns are the default set
5916
5863
  * plus any `--fields` extras (validated + resolved by `listLoops`). */
5917
5864
  function renderLoopsText(loops, fields) {
5918
5865
  if (!loops.length) return doc(countLine(0), emptyList("loops"), helpBlock(["Run `pievo new --json '{...}'` to create your first loop", "Run `pievo daemon start` if this machine isn't connected yet"]));
@@ -7016,7 +6963,7 @@ var CliGateway = class {
7016
6963
  return renderShowText(loop, loopEnvelope(loop), await countRuns(loop.id), recent[0] ?? null, opts);
7017
6964
  }
7018
6965
  /**
7019
- * `pievo` (bare) — the content-first home for a DEVICE credential (P8/§5.1). The
6966
+ * Bare `pievo` renders the home for a device credential. The
7020
6967
  * daemon passes the local facts it alone knows as context flags (`--cwd`/`--home`
7021
6968
  * for directory scoping, `--bin`/`--pid`/`--server` for the header); the server owns
7022
6969
  * the whole TOON render (text-sink). An unregistered machine renders a DEFINITIVE
@@ -7053,9 +7000,7 @@ var CliGateway = class {
7053
7000
  };
7054
7001
  /** Shared refusal for terminal-report-only grace after reclaim. */
7055
7002
  var TERMINAL_GRACE_MSG = "this run is terminal and no longer accepts commands; its final result is delivered via the terminal report";
7056
- /** Verbs that require OWNER (device) authority — a run credential is 403'd on these
7057
- * in the unified `cli` dispatch (§4.1). `report` is the mirror image
7058
- * (run-only, 403 for a device credential) and are handled inline in `deviceCli`. */
7003
+ /** Verbs that require device authority. `report` is run-only and rejected there. */
7059
7004
  var DEVICE_ONLY_VERBS = new Set([
7060
7005
  "new",
7061
7006
  "edit",
@@ -7102,7 +7047,7 @@ function parseJsonFlag(raw) {
7102
7047
  value: obj
7103
7048
  };
7104
7049
  }
7105
- /** A structured error result to STDOUT (P6): `error:`/`code:` TOON as the verb `text`.
7050
+ /** A structured `error:`/`code:` TOON result for stdout.
7106
7051
  * Mirrors the `{code, text}` shape `dispatch` returns; the slug defaults from the
7107
7052
  * HTTP status but a caller may pin it (e.g. CONFLICT). */
7108
7053
  function derr(code, message, slug) {
@@ -7115,7 +7060,7 @@ function derr(code, message, slug) {
7115
7060
  * `text` and exits with `exitCode`; two structured channels remain because the
7116
7061
  * current daemon reads them as data:
7117
7062
  * - `loops`: the daemon resolves cwd→loop CLIENT-side (`log`/`show`/`home`) from this
7118
- * list — the server's `log`/`show` dispatch needs an explicit id (design §3).
7063
+ * list; the server's `log`/`show` dispatch needs an explicit id.
7119
7064
  * - `runs`: the `log --json` normalized-data escape hatch. */
7120
7065
  var CLI_RETAINED_KEYS = new Set([
7121
7066
  "text",
@@ -7138,7 +7083,7 @@ function finalizeCli(res) {
7138
7083
  }
7139
7084
  return res;
7140
7085
  }
7141
- /** `pievo report` — the compact run-status confirmation (§4.6). */
7086
+ /** Render the compact run-status confirmation. */
7142
7087
  function renderReportedText(status, hasMessage) {
7143
7088
  const parts = [];
7144
7089
  if (status) parts.push(`status=${status}`);
@@ -7205,7 +7150,7 @@ var DEVICE_VERB_HELP = {
7205
7150
  help: ["Run `pievo log <id> --json` for structured history", "Run `pievo log <id> --run 12 --diff` for bounded run detail and artifact diff"]
7206
7151
  }
7207
7152
  };
7208
- /** Render a verb's `--help` (P10). A run lease selects the report-only help;
7153
+ /** Render per-verb help. A run lease selects the report-only help;
7209
7154
  * no lease means the device (owner) surface. Returns undefined for a verb
7210
7155
  * with no help spec, so the caller falls back to its unknown-command handling. */
7211
7156
  function verbHelpText(verb, lease) {
@@ -7231,11 +7176,7 @@ function nextFireDisplay(loop) {
7231
7176
  if (!iso) return "(never)";
7232
7177
  return fmtTimeZoned(iso, schedule.timezone, { seconds: true });
7233
7178
  }
7234
- /**
7235
- * `pievo show` — the full editable envelope TOON (F1/F6, feedback #1/#2, §4.1).
7236
- * The `loop:` block keys are EXACTLY `edit --json`'s keys (read/write identity),
7237
- * then the read-only derived aggregates (`nextFire`/`lifecycle`/`runs`).
7238
- */
7179
+ /** `pievo show` renders the editable envelope followed by derived read-only state. */
7239
7180
  function renderShowText(loop, env, totalRuns, lastRun, opts = {}) {
7240
7181
  const full = opts.full === true;
7241
7182
  const block = detailBlock("loop", [
@@ -7259,8 +7200,7 @@ function renderShowText(loop, env, totalRuns, lastRun, opts = {}) {
7259
7200
  ];
7260
7201
  return doc(block, kvLine("nextFire", nextFireDisplay(loop)), `lifecycle: ${loop.enabled ? "active" : "paused"}`, `runs: ${runsTally}`, !loop.enabled ? kvLine("pauseCause", loop.pauseCause?.kind === "failure-streak" ? `failure-streak (run ${loop.pauseCause.runId}, count ${loop.pauseCause.count})` : loop.pauseCause?.kind === "blocked" ? `blocked (run ${loop.pauseCause.runId})` : loop.pauseCause?.kind === "owner" ? "owner" : "unknown") : null, lastRun?.reportIncident ? kvLine("reportIncident", `${lastRun.reportIncident.code} · ${lastRun.reportIncident.faultDomain} · ${lastRun.reportIncident.reason}`) : null, helpBlock(help));
7261
7202
  }
7262
- /** The static one-line description in the home header (mirrors the reference axi
7263
- * tools' `description:` line — what this bin is for). */
7203
+ /** The static one-line description in the home header. */
7264
7204
  var HOME_DESCRIPTION = "Run your scheduled Pievo agent loops on this machine with your own coding agent.";
7265
7205
  /** Expand a leading `~/` against the daemon-supplied home dir (the SERVER's own home
7266
7206
  * is irrelevant — a loop's paths are the daemon machine's). Absent home ⇒ unchanged. */
@@ -7273,7 +7213,7 @@ function scopeLoopDir(workdir, home) {
7273
7213
  }
7274
7214
  /**
7275
7215
  * Partition a machine's loops into the ones rooted at (or under) `cwd` — the
7276
- * directory-scoped ambient context P8 wants — and a count of the rest. With no cwd
7216
+ * directory-scoped ambient context and a count of the rest. With no cwd
7277
7217
  * (or none matching), ALL loops are "here" (elsewhere 0): a home run from an
7278
7218
  * unrelated directory still shows the whole machine rather than nothing.
7279
7219
  */
@@ -7308,7 +7248,7 @@ async function recentMachineRuns(loops, n) {
7308
7248
  rows.sort((a, b) => a.ts < b.ts ? 1 : a.ts > b.ts ? -1 : 0);
7309
7249
  return rows.slice(0, n);
7310
7250
  }
7311
- /** The device home (P8/§5.1): `bin:`/`description:`/`machine:` header, the cwd-scoped
7251
+ /** The device home: `bin:`/`description:`/`machine:` header, the cwd-scoped
7312
7252
  * loop list, recent runs, and a `help[]`. `presence` null ⇒ the machine is not
7313
7253
  * registered → a DEFINITIVE "not connected" state (never empty, never an error). */
7314
7254
  function renderHomeText(ctx, presence, here, elsewhere, recent) {
@@ -7440,9 +7380,6 @@ var Scheduler = class {
7440
7380
  }
7441
7381
  return advanced;
7442
7382
  }
7443
- async runningIds() {
7444
- return [...new Set((await openRuns()).filter((r) => r.phase === "running").map((r) => r.loopId))];
7445
- }
7446
7383
  async enqueue(id, request) {
7447
7384
  const result = await enqueueRun(id, request);
7448
7385
  if ("run" in result) {
@@ -7646,4 +7583,4 @@ async function getCliGateway() {
7646
7583
  return (await ensureServer()).cliGateway;
7647
7584
  }
7648
7585
  //#endregion
7649
- export { isDynamicBaseURLConfig as $, ensureServer as A, rememberConnectKey as At, getGateway as B, startLoop as Bt, createTeam as C, normalizePathname as Ct, deleteInvite as D, readJsonBody as Dt, defu as E, readByteBody as Et, getArtifactSync as F, resolveBaseURL as Ft, getOrigin as G, tryDeleteLoop as Gt, getInvite as H, stopLoop as Ht, getBaseURL as I, safeRelPath as It, getTeam as J, userByEmail as Jt, getProtocol as K, updateLoop as Kt, getBooleanEnvVar as L, scheduleFromLoop as Lt, env as M, renameTeam as Mt, forceDeleteLoop as N, requestDeleteLoop as Nt, deleteMachine as O, reconciliationStatesForRuns as Ot, getArtifactFile as P, requestRunCancel as Pt, isDevelopment as Q, getCliGateway as R, setTeamMemberRoleGuarded as Rt, createMachine as S, mintDeviceToken as St, db as T, pauseLoop as Tt, getLoop as U, teamIdForUser as Ut, getHost as V, statusDefinitionsFromLoop as Vt, getMachine as W, toKebabCase as Wt, hasPendingRun as X, validateLoopEdit as Xt, getTeamMember as Y, validOptionalPollString as Yt, hasRunningRun as Z, wildcardMatch as Zt, countLoopsForTeam as _, logger as _t, BetterAuthError as a, isTeamMember as at, createFetch as b, machineIdFromToken as bt, ENV as c, listArtifacts as ct, SYNC_BODY_CAP as d, listMachinesForTeam as dt, isOutdated as et, ValidationError$1 as f, listPendingInvites as ft, computeRunDiff as g, listTeamsForUser as gt, capitalizeFirstLetter as h, listTeamMembers as ht, BLOB_CAP as i, isSafeUrlScheme as it, ensureTeam as j, removeTeamMemberGuarded as jt, deleteTeamCascade as k, redeemInviteAtomic as kt, MACHINE_BODY_CAP as l, listLoops as lt, betterFetch as m, listRunsBefore as mt, APIError$1 as n, isProduction as nt, BetterCallError as o, isTest as ot, addTeamMember as p, listRuns as pt, getRun as q, updateMachine as qt, BASE_ERROR_CODES as r, isRequestLike as rt, CODING_AGENTS as s, kAPIErrorHeaderSymbol as st, APIError as t, isPersonalTeam as tt, MIN_DAEMON_VERSION as u, listMachines as ut, countRuns as v, loginGateEnabled as vt, daemonNeedsUpdate as w, parseArtifactSyncBody as wt, createInvite as x, machinePresence as xt, createDefu as y, loopsForMachine as yt, getEnvVar as z, sha256 as zt };
7586
+ export { isDevelopment as $, validateLoopEdit as $t, deleteTeamCascade as A, redeemInviteAtomic as At, getEnvVar as B, sha256 as Bt, createMachine as C, mintDeviceToken as Ct, defu as D, readByteBody as Dt, db as E, pauseLoop as Et, getArtifactFile as F, requestRunCancel as Ft, getMachine as G, toKebabCase as Gt, getHost as H, statusDefinitionsFromLoop as Ht, getArtifactSync as I, resolveBaseURL as It, getRun as J, updateMachine as Jt, getOrigin as K, tryDeleteLoop as Kt, getBaseURL as L, safeRelPath as Lt, ensureTeam as M, removeTeamMemberGuarded as Mt, env as N, renameTeam as Nt, deleteInvite as O, readJsonBody as Ot, forceDeleteLoop as P, requestDeleteLoop as Pt, hasRunningRun as Q, validPollWireId as Qt, getBooleanEnvVar as R, scheduleFromLoop as Rt, createInvite as S, machinePresence as St, daemonNeedsUpdate as T, parseArtifactSyncBody as Tt, getInvite as U, stopLoop as Ut, getGateway as V, startLoop as Vt, getLoop as W, teamIdForUser as Wt, getTeamMember as X, validOptionalPollString as Xt, getTeam as Y, userByEmail as Yt, hasPendingRun as Z, validPollCurrentRun as Zt, computeRunDiff as _, listTeamsForUser as _t, BetterAuthError as a, isSafeUrlScheme as at, createDefu as b, loopsForMachine as bt, ENV as c, kAPIErrorHeaderSymbol as ct, POLL_HTTP_BODY_FIELDS as d, listMachines as dt, wildcardMatch as en, isDynamicBaseURLConfig as et, SYNC_BODY_CAP as f, listMachinesForTeam as ft, capitalizeFirstLetter as g, listTeamMembers as gt, betterFetch as h, listRunsBefore as ht, BLOB_CAP as i, isRequestLike as it, ensureServer as j, rememberConnectKey as jt, deleteMachine as k, reconciliationStatesForRuns as kt, MACHINE_BODY_CAP as l, listArtifacts as lt, addTeamMember as m, listRuns as mt, APIError$1 as n, isPersonalTeam as nt, BetterCallError as o, isTeamMember as ot, ValidationError$1 as p, listPendingInvites as pt, getProtocol as q, updateLoop as qt, BASE_ERROR_CODES as r, isProduction as rt, CODING_AGENTS as s, isTest as st, APIError as t, isOutdated as tt, MIN_DAEMON_VERSION as u, listLoops as ut, countLoopsForTeam as v, logger as vt, createTeam as w, normalizePathname as wt, createFetch as x, machineIdFromToken as xt, countRuns as y, loginGateEnabled as yt, getCliGateway as z, setTeamMemberRoleGuarded as zt };
@@ -1,6 +1,6 @@
1
- import { n as DefaultQueryCompiler, o as CompiledQuery, s as sql$1 } from "./auth-CPCDf6Wr.mjs";
1
+ import { n as DefaultQueryCompiler, o as CompiledQuery, s as sql$1 } from "./auth-C0zoZCGe.mjs";
2
2
  import { n as DEFAULT_MIGRATION_TABLE, t as DEFAULT_MIGRATION_LOCK_TABLE } from "./kysely-migration-tables-JkVUjPF_-bPAX9LR_.mjs";
3
- //#region node_modules/.nitro/vite/services/ssr/assets/bun-sqlite-dialect-BW9W1_Ps-8MIh9jN1.js
3
+ //#region node_modules/.nitro/vite/services/ssr/assets/bun-sqlite-dialect-BW9W1_Ps-DmlZWqO7.js
4
4
  var BunSqliteAdapter = class {
5
5
  get supportsCreateIfNotExists() {
6
6
  return true;
@@ -1,6 +1,6 @@
1
- import { a as SqliteQueryCompiler, i as SqliteAdapter } from "./auth-CPCDf6Wr.mjs";
1
+ import { a as SqliteQueryCompiler, i as SqliteAdapter } from "./auth-C0zoZCGe.mjs";
2
2
  import { n as DEFAULT_MIGRATION_TABLE, t as DEFAULT_MIGRATION_LOCK_TABLE } from "./kysely-migration-tables-JkVUjPF_-bPAX9LR_.mjs";
3
- //#region node_modules/.nitro/vite/services/ssr/assets/d1-sqlite-dialect-BLC8LXE6-CcMQ01_d.js
3
+ //#region node_modules/.nitro/vite/services/ssr/assets/d1-sqlite-dialect-BLC8LXE6-CCNzqZwZ.js
4
4
  var D1SqliteAdapter = class extends SqliteAdapter {};
5
5
  var D1SqliteDriver = class {
6
6
  #config;
@@ -0,0 +1,2 @@
1
+ import { E as db } from "./boot-sNlIkoLe.mjs";
2
+ export { db };
@@ -1,5 +1,5 @@
1
- import { _ as logger, o as createAdapterFactory } from "./factory-S7MaMVC2.mjs";
2
- //#region node_modules/.nitro/vite/services/ssr/assets/dist-AxCsRawm.js
1
+ import { _ as logger, o as createAdapterFactory } from "./factory-Dv3Zopis.mjs";
2
+ //#region node_modules/.nitro/vite/services/ssr/assets/dist-B3SxDOpW.js
3
3
  /**
4
4
  * Case-insensitive in-memory comparison helpers.
5
5
  * Used when evaluating where clauses in the memory adapter.
@@ -1,5 +1,5 @@
1
- import { M as env, a as BetterAuthError, z as getEnvVar } from "./boot-BbWxaF-z.mjs";
2
- //#region node_modules/.nitro/vite/services/ssr/assets/factory-S7MaMVC2.js
1
+ import { B as getEnvVar, N as env, a as BetterAuthError } from "./boot-sNlIkoLe.mjs";
2
+ //#region node_modules/.nitro/vite/services/ssr/assets/factory-Dv3Zopis.js
3
3
  var __defProp = Object.defineProperty;
4
4
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
5
5
  var __exportAll = (all, no_symbols) => {
@@ -1,18 +1,10 @@
1
1
  import { h as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
2
- import { r as LoadErrorCard } from "./actionUi-D15R8L7R.mjs";
2
+ import { r as LoadErrorCard } from "./actionUi-DD7Cd7Le.mjs";
3
3
  import { f as useRouter } from "../_libs/@tanstack/react-router+[...].mjs";
4
- //#region node_modules/.nitro/vite/services/ssr/assets/invite._token-B1UgMbNQ.js
4
+ //#region node_modules/.nitro/vite/services/ssr/assets/invite._token-AvtAuDKv.js
5
5
  var import_jsx_runtime = require_jsx_runtime();
6
- /**
7
- * Invite-link redeem (`/invite/<token>`, design §4 option B). The recipient opens
8
- * the link the owner shared; if signed out (under the gate) they hit the normal
9
- * gated GitHub sign-in and return here — the invite NEVER bypasses the login
10
- * allowlist (decision 3), it only grants membership once they already have an
11
- * account. On redeem we navigate to the team's dashboard.
12
- *
13
- * Open mode has no identities, so an invite is meaningless there — it renders a
14
- * calm explanation rather than a broken redeem.
15
- */
6
+ /** Redeem a team invite after normal gated sign-in. Invites grant membership but
7
+ * never bypass the login allowlist; open mode has no invite identity to redeem. */
16
8
  function LoadError({ error }) {
17
9
  const router = useRouter();
18
10
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("main", {
@@ -1,18 +1,10 @@
1
1
  import { c as createFileRoute, s as lazyRouteComponent } from "../_libs/@tanstack/react-router+[...].mjs";
2
- import { d as getAuthState, i as authClient } from "./SocialLinks-BTjsnVOm.mjs";
3
- //#region node_modules/.nitro/vite/services/ssr/assets/invite._token-BliJIGk4.js
4
- var $$splitErrorComponentImporter = () => import("./invite._token-B1UgMbNQ.mjs");
5
- var $$splitComponentImporter = () => import("./invite._token-D296YVGd.mjs");
6
- /**
7
- * Invite-link redeem (`/invite/<token>`, design §4 option B). The recipient opens
8
- * the link the owner shared; if signed out (under the gate) they hit the normal
9
- * gated GitHub sign-in and return here — the invite NEVER bypasses the login
10
- * allowlist (decision 3), it only grants membership once they already have an
11
- * account. On redeem we navigate to the team's dashboard.
12
- *
13
- * Open mode has no identities, so an invite is meaningless there — it renders a
14
- * calm explanation rather than a broken redeem.
15
- */
2
+ import { i as authClient, u as getAuthState } from "./SocialLinks-Bt7huqfS.mjs";
3
+ //#region node_modules/.nitro/vite/services/ssr/assets/invite._token-CHR5K84a.js
4
+ var $$splitErrorComponentImporter = () => import("./invite._token-AvtAuDKv.mjs");
5
+ var $$splitComponentImporter = () => import("./invite._token-tw3mgvEo.mjs");
6
+ /** Redeem a team invite after normal gated sign-in. Invites grant membership but
7
+ * never bypass the login allowlist; open mode has no invite identity to redeem. */
16
8
  var Route = createFileRoute("/invite/$token")({
17
9
  ssr: false,
18
10
  loader: async ({ params }) => {
@@ -1,25 +1,17 @@
1
1
  import { o as __toESM } from "../_runtime.mjs";
2
2
  import { g as require_react, h as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
3
- import { s as btnPrimary } from "./ui-DmFKW2H_.mjs";
3
+ import { s as btnPrimary } from "./ui-dMEI4sHj.mjs";
4
4
  import { d as useNavigate } from "../_libs/@tanstack/react-router+[...].mjs";
5
- import { D as useSession, r as PievoLogo } from "./SocialLinks-BTjsnVOm.mjs";
5
+ import { E as useSession, r as PievoLogo } from "./SocialLinks-Bt7huqfS.mjs";
6
6
  import { t as setActiveTeamCookie } from "./teamCookie-B7hLOIie.mjs";
7
- import { c as redeemTeamInvite } from "./teamFns-DcoVuWyH.mjs";
8
- import { t as Route } from "./invite._token-BliJIGk4.mjs";
9
- import { t as SignIn } from "./SignIn-DjSrg0nO.mjs";
10
- //#region node_modules/.nitro/vite/services/ssr/assets/invite._token-D296YVGd.js
7
+ import { c as redeemTeamInvite } from "./teamFns-gilVwh7z.mjs";
8
+ import { t as Route } from "./invite._token-CHR5K84a.mjs";
9
+ import { t as SignIn } from "./SignIn-ffgDY0yf.mjs";
10
+ //#region node_modules/.nitro/vite/services/ssr/assets/invite._token-tw3mgvEo.js
11
11
  var import_react = /* @__PURE__ */ __toESM(require_react());
12
12
  var import_jsx_runtime = require_jsx_runtime();
13
- /**
14
- * Invite-link redeem (`/invite/<token>`, design §4 option B). The recipient opens
15
- * the link the owner shared; if signed out (under the gate) they hit the normal
16
- * gated GitHub sign-in and return here — the invite NEVER bypasses the login
17
- * allowlist (decision 3), it only grants membership once they already have an
18
- * account. On redeem we navigate to the team's dashboard.
19
- *
20
- * Open mode has no identities, so an invite is meaningless there — it renders a
21
- * calm explanation rather than a broken redeem.
22
- */
13
+ /** Redeem a team invite after normal gated sign-in. Invites grant membership but
14
+ * never bypass the login allowlist; open mode has no invite identity to redeem. */
23
15
  function Shell({ children }) {
24
16
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
25
17
  className: "mx-auto mt-32 max-w-sm text-center",
@@ -1,2 +1,2 @@
1
- import { r as kyselyAdapter, t as createKyselyAdapter } from "./auth-CPCDf6Wr.mjs";
1
+ import { r as kyselyAdapter, t as createKyselyAdapter } from "./auth-C0zoZCGe.mjs";
2
2
  export { createKyselyAdapter, kyselyAdapter };