@kky42/pievo-server 2.0.2 → 2.0.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 (90) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/{LoopView-XXW59HAV.js → LoopView-Pbp2YtUu.js} +3 -3
  3. package/.output/public/assets/{Modal-BnCPgN_k.js → Modal-B3xpEtcf.js} +1 -1
  4. package/.output/public/assets/{SignIn-BAoOONQ9.js → SignIn-9vsaKv_p.js} +1 -1
  5. package/.output/public/assets/{actionUi-Dxe9cHAc.js → actionUi-DDDfD0WX.js} +1 -1
  6. package/.output/public/assets/app-CStTBRt2.css +2 -0
  7. package/.output/public/assets/{artifactView-DekEs5ME.js → artifactView-BV-yQVrj.js} +1 -1
  8. package/.output/public/assets/index-49hAH0gP.js +12 -0
  9. package/.output/public/assets/{invite._token-BAqaXvte.js → invite._token-C3t4JfAY.js} +1 -1
  10. package/.output/public/assets/{invite._token-q54LLZ6A.js → invite._token-C891oGkK.js} +1 -1
  11. package/.output/public/assets/lifecycleUi-C3k2MlX8.js +1 -0
  12. package/.output/public/assets/{loopApi-5s2-kCnu.js → loopApi-C_Dtw-nL.js} +1 -1
  13. package/.output/public/assets/loops._loopId-DD4fKGMu.js +4 -0
  14. package/.output/public/assets/{loops._loopId_.runs._runId-lGYlHXTN.js → loops._loopId_.runs._runId-DoPcCQy7.js} +2 -2
  15. package/.output/public/assets/notifyFns-BaukhLAg.js +1 -0
  16. package/.output/public/assets/{preload-helper-ycaoAemE.js → preload-helper--VCqDT5m.js} +2 -2
  17. package/.output/public/assets/{routes-D0zKR7gK.js → routes-BS4N7Lnf.js} +1 -1
  18. package/.output/public/assets/{routes-C7Pw5lGn.js → routes-DsdcURfk.js} +1 -1
  19. package/.output/public/assets/{t._teamId-CCgajlMS.js → t._teamId-C9uEyAh_.js} +1 -1
  20. package/.output/public/assets/{t._teamId-Cn7cRGAh.js → t._teamId-DSYlMX_v.js} +1 -1
  21. package/.output/public/assets/ui-Gb1413-F.js +1 -0
  22. package/.output/server/_ssr/{DashboardView-BhJBW7IL.mjs → DashboardView-CQdjYy03.mjs} +36 -111
  23. package/.output/server/_ssr/{LoopPlaybook-BC9Dvnw2.mjs → LoopPlaybook-C86vJIjZ.mjs} +9 -9
  24. package/.output/server/_ssr/{LoopView-Dom6Ad5G.mjs → LoopView-cDyjmf1B.mjs} +16 -16
  25. package/.output/server/_ssr/{Modal-CfWC9R49.mjs → Modal-Bc_5TYGr.mjs} +2 -2
  26. package/.output/server/_ssr/{SignIn-D70NUJsN.mjs → SignIn-BQQiD3Ss.mjs} +3 -3
  27. package/.output/server/_ssr/{actionUi-mDYOvJdB.mjs → actionUi-BKF6xI3d.mjs} +2 -2
  28. package/.output/server/_ssr/{adapters-D0d1fBKK.mjs → adapters-N4-yQ1vK.mjs} +4 -8
  29. package/.output/server/_ssr/{artifactFiles-BfE1070_.mjs → artifactFiles-Dl1EaUtJ.mjs} +3 -3
  30. package/.output/server/_ssr/{artifactView-CYV1r48i.mjs → artifactView-DX4P3Krh.mjs} +2 -2
  31. package/.output/server/_ssr/artifacts-DzWJrBxK.mjs +2 -0
  32. package/.output/server/_ssr/{auth-BP81awUE.mjs → auth-CbAfO4Ne.mjs} +9 -9
  33. package/.output/server/_ssr/{boot-sM4t8RJu.mjs → boot-BZ-YyUiD.mjs} +1397 -626
  34. package/.output/server/_ssr/{boot-pUGFIxSA.mjs → boot-BigKgB8p.mjs} +1 -1
  35. package/.output/server/_ssr/{bun-sqlite-dialect-BW9W1_Ps-CZJuWL5Z.mjs → bun-sqlite-dialect-BW9W1_Ps-B67XLJZt.mjs} +2 -2
  36. package/.output/server/_ssr/{d1-sqlite-dialect-BLC8LXE6-C2PCtZfI.mjs → d1-sqlite-dialect-BLC8LXE6-nff_yHzH.mjs} +2 -2
  37. package/.output/server/_ssr/db-BF8vSovA.mjs +2 -0
  38. package/.output/server/_ssr/{dist-Z7v6ihws.mjs → dist-BGjVt6NE.mjs} +2 -2
  39. package/.output/server/_ssr/{factory-BQ_XiP23.mjs → factory-DNeo3vVt.mjs} +2 -2
  40. package/.output/server/_ssr/{invite._token-CRAl6-yK.mjs → invite._token-Bipap1cl.mjs} +6 -6
  41. package/.output/server/_ssr/{invite._token-23daBIfe.mjs → invite._token-BlbVjz-o.mjs} +2 -2
  42. package/.output/server/_ssr/{invite._token-VKmyC9-R.mjs → invite._token-z3PzCMzb.mjs} +5 -5
  43. package/.output/server/_ssr/{kysely-adapter-DjQPkqgJ.mjs → kysely-adapter-C1ww7PKr.mjs} +1 -1
  44. package/.output/server/_ssr/{lifecycleUi-l3nx9i3T.mjs → lifecycleUi-5jMhxINb.mjs} +1 -3
  45. package/.output/server/_ssr/logger-C7aewtve.mjs +2 -0
  46. package/.output/server/_ssr/{loopApi-BfMnXaKT.mjs → loopApi-7MTSs6hy.mjs} +5 -5
  47. package/.output/server/_ssr/{loopApi-i7xdpokI.mjs → loopApi-JzGGZZp2.mjs} +31 -25
  48. package/.output/server/_ssr/{loops._loopId-jXSgPWG1.mjs → loops._loopId-CJxQ0EG4.mjs} +4 -4
  49. package/.output/server/_ssr/{loops._loopId-DOPfN_Op.mjs → loops._loopId-DFkyTJR3.mjs} +106 -132
  50. package/.output/server/_ssr/{loops._loopId_.runs._runId-DiBP2rCe.mjs → loops._loopId_.runs._runId-DkG-ZCD1.mjs} +10 -17
  51. package/.output/server/_ssr/{loops._loopId_.runs._runId-BhoM6DWj.mjs → loops._loopId_.runs._runId-lTigSOmT.mjs} +4 -4
  52. package/.output/server/_ssr/{machineFns-ChO1NM3C.mjs → machineFns-Dda8-rBY.mjs} +3 -3
  53. package/.output/server/_ssr/{node-sqlite-dialect-BGlhyZkk.mjs → node-sqlite-dialect-BS2OAFJh.mjs} +2 -2
  54. package/.output/server/_ssr/{notifyFns-DWotltSJ.mjs → notifyFns-C6eyIFZE.mjs} +7 -8
  55. package/.output/server/_ssr/{notifyFns-B1MSIzrT.mjs → notifyFns-C9N0QLe3.mjs} +3 -3
  56. package/.output/server/_ssr/{router-BOHN4CWd.mjs → router-DIfoLu1r.mjs} +30 -30
  57. package/.output/server/_ssr/{routes-DjaTMZqZ.mjs → routes-Bx0bRxt9.mjs} +2 -2
  58. package/.output/server/_ssr/{routes-BQjhKV-m.mjs → routes-DYJB0rKC.mjs} +5 -5
  59. package/.output/server/_ssr/{routes-C2VJzARp.mjs → routes-bWgX0tRE.mjs} +6 -6
  60. package/.output/server/_ssr/runDiff-B9t7ouYj.mjs +2 -0
  61. package/.output/server/_ssr/ssr.mjs +51 -51
  62. package/.output/server/_ssr/store-Dw4LiFjE.mjs +2 -0
  63. package/.output/server/_ssr/{t._teamId-o86wLJrg.mjs → t._teamId-B_ieXBNF.mjs} +6 -6
  64. package/.output/server/_ssr/{t._teamId-CRgNlDGk.mjs → t._teamId-C_KZZ4Xh.mjs} +5 -5
  65. package/.output/server/_ssr/{t._teamId-D_vi_OuG.mjs → t._teamId-D9nCEa2h.mjs} +2 -2
  66. package/.output/server/_ssr/{teamFns-D4I-0dEB.mjs → teamFns-BBIbatdZ.mjs} +2 -2
  67. package/.output/server/_ssr/{teamFns-C3vnwAqv.mjs → teamFns-O3ZmtZL2.mjs} +3 -3
  68. package/.output/server/_ssr/tokens-DI_pklQB.mjs +2 -0
  69. package/.output/server/_ssr/{ui-WGITbP6Z.mjs → ui-B6mE5-5v.mjs} +7 -23
  70. package/.output/server/{_tanstack-start-manifest_v-DYC0z7st.mjs → _tanstack-start-manifest_v-DKnfwHZr.mjs} +28 -28
  71. package/.output/server/drizzle/0014_luxuriant_scrambler.sql +5 -0
  72. package/.output/server/drizzle/0015_run_history_foundation.sql +43 -0
  73. package/.output/server/drizzle/meta/_journal.json +14 -0
  74. package/.output/server/index.mjs +106 -106
  75. package/drizzle/0014_luxuriant_scrambler.sql +5 -0
  76. package/drizzle/0015_run_history_foundation.sql +43 -0
  77. package/drizzle/meta/_journal.json +14 -0
  78. package/package.json +1 -1
  79. package/.output/public/assets/app-DzFILlbu.css +0 -2
  80. package/.output/public/assets/index-BtvLZjhl.js +0 -12
  81. package/.output/public/assets/lifecycleUi-B8Je9exd.js +0 -1
  82. package/.output/public/assets/loops._loopId-BCK4oIRv.js +0 -4
  83. package/.output/public/assets/notifyFns-BneSItOi.js +0 -1
  84. package/.output/public/assets/ui-RFP3R3lU.js +0 -1
  85. package/.output/server/_ssr/artifacts-CSGRJdSy.mjs +0 -2
  86. package/.output/server/_ssr/db-Cc6I8bWL.mjs +0 -2
  87. package/.output/server/_ssr/logger-CHoC5_kz.mjs +0 -2
  88. package/.output/server/_ssr/runDiff-SlGPjjNq.mjs +0 -113
  89. package/.output/server/_ssr/store-BjXC623Z.mjs +0 -2
  90. package/.output/server/_ssr/tokens-BCOvumer.mjs +0 -2
@@ -1,23 +1,21 @@
1
1
  import { o as __toESM } from "../_runtime.mjs";
2
2
  import { g as require_jsx_runtime, h as require_react, t as TooltipProvider } from "../_libs/@base-ui/react+[...].mjs";
3
- import { C as isCompleted, D as rel, P as useHydrated, S as isClosed, T as lastRunOf, c as btnDanger, f as btnSm, h as dotLabel, j as selectCls, l as btnPrimary, o as btn, p as cronText, r as Pill, t as ErrorBanner, u as btnPrimaryPill, v as fmt, w as labelCls, x as inputCls } from "./ui-WGITbP6Z.mjs";
3
+ import { C as lastRunOf, M as useHydrated, S as labelCls, T as rel, c as btnDanger, f as btnSm, h as dotLabel, k as selectCls, l as btnPrimary, o as btn, p as cronText, r as Pill, t as ErrorBanner, u as btnPrimaryPill, x as inputCls } from "./ui-B6mE5-5v.mjs";
4
4
  import { d as useNavigate } from "../_libs/@tanstack/react-router+[...].mjs";
5
- import { _ as mintClaim, g as loadOlderRuns, l as getConfig, m as listMyTeams, n as claimStatus, p as listJobs } from "./loopApi-BfMnXaKT.mjs";
6
- import { n as ModalHead, r as ModalSection, t as Modal } from "./Modal-CfWC9R49.mjs";
7
- import { i as PievoLogo, n as GitHubIcon, r as LoopPlaybook, t as GITHUB_URL } from "./LoopPlaybook-BC9Dvnw2.mjs";
5
+ import { _ as mintClaim, g as loadOlderRuns, l as getConfig, m as listMyTeams, n as claimStatus, p as listJobs } from "./loopApi-7MTSs6hy.mjs";
6
+ import { n as ModalHead, r as ModalSection, t as Modal } from "./Modal-Bc_5TYGr.mjs";
7
+ import { i as PievoLogo, n as GitHubIcon, r as LoopPlaybook, t as GITHUB_URL } from "./LoopPlaybook-C86vJIjZ.mjs";
8
8
  import { t as setActiveTeamCookie } from "./teamCookie-B7hLOIie.mjs";
9
- import { a as getTeamDetail, d as revokeTeamInvite, f as setTeamMemberRole, i as deleteTeam, l as removeTeamMember, n as createTeam, o as leaveTeam, r as createTeamInvite, s as listManagedTeams, t as addTeamMember, u as renameTeam } from "./teamFns-D4I-0dEB.mjs";
10
- import { r as deriveLoopLifecycle } from "./lifecycleUi-l3nx9i3T.mjs";
11
- import { a as listChannels, c as testChannel, i as deleteChannel, n as Timeline, o as listMachines, r as createChannel, s as mergeRuns, t as MachinesModal } from "./notifyFns-DWotltSJ.mjs";
12
- //#region node_modules/.nitro/vite/services/ssr/assets/DashboardView-BhJBW7IL.js
9
+ import { a as getTeamDetail, d as revokeTeamInvite, f as setTeamMemberRole, i as deleteTeam, l as removeTeamMember, n as createTeam, o as leaveTeam, r as createTeamInvite, s as listManagedTeams, t as addTeamMember, u as renameTeam } from "./teamFns-BBIbatdZ.mjs";
10
+ import { r as deriveLoopLifecycle } from "./lifecycleUi-5jMhxINb.mjs";
11
+ import { a as listChannels, c as testChannel, i as deleteChannel, n as Timeline, o as listMachines, r as createChannel, s as mergeRuns, t as MachinesModal } from "./notifyFns-C6eyIFZE.mjs";
12
+ //#region node_modules/.nitro/vite/services/ssr/assets/DashboardView-CQdjYy03.js
13
13
  var import_react = /* @__PURE__ */ __toESM(require_react());
14
14
  var import_jsx_runtime = require_jsx_runtime();
15
15
  function LoopCard({ job, onOpen, onPickRun }) {
16
16
  const en = job.enabled;
17
17
  const last = lastRunOf(job);
18
- const completed = isCompleted(job);
19
18
  const lifecycle = deriveLoopLifecycle(job);
20
- const closedActive = isClosed(job) && !completed;
21
19
  const hydrated = useHydrated();
22
20
  const [older, setOlder] = (0, import_react.useState)([]);
23
21
  const runs = (0, import_react.useMemo)(() => older.length ? mergeRuns(job.runs ?? [], older) : job.runs ?? [], [job.runs, older]);
@@ -64,17 +62,12 @@ function LoopCard({ job, onOpen, onPickRun }) {
64
62
  children: "Queued"
65
63
  }) : null,
66
64
  job.graduation && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Pill, { children: job.graduation }),
67
- completed && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Pill, {
68
- tone: "success",
69
- dot: "green",
70
- children: "Completed"
71
- }),
72
- !completed && closedActive && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Pill, {
65
+ job.goal && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Pill, {
73
66
  tone: "success",
74
67
  title: job.goal ?? void 0,
75
- children: "Goal"
68
+ children: "Objective"
76
69
  }),
77
- !completed && lifecycle === "paused" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Pill, {
70
+ lifecycle === "paused" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Pill, {
78
71
  tone: job.pauseCause?.kind === "blocked" ? "accent" : void 0,
79
72
  children: job.pauseCause?.kind === "blocked" ? "Paused — blocked" : job.pauseCause?.kind === "failure-streak" ? "Paused automatically" : job.pauseCause?.kind === "owner" ? "Paused by owner" : "Paused"
80
73
  }),
@@ -125,17 +118,6 @@ function LoopCard({ job, onOpen, onPickRun }) {
125
118
  latestIncidentRun?.reportIncident && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
126
119
  className: "mt-1.5 text-label text-secondary",
127
120
  children: latestIncidentRun.phase === "error" ? "Last run failed · Terminal report rejected" : "Last run telemetry warning · Terminal report rejected"
128
- }),
129
- completed && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
130
- className: "mt-1.5 text-label text-success",
131
- children: [
132
- "Completed",
133
- job.completedAt ? ` · ${fmt(job.completedAt)}` : "",
134
- job.completionReason && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
135
- className: "text-secondary",
136
- children: [" - ", job.completionReason]
137
- })
138
- ]
139
121
  })
140
122
  ]
141
123
  });
@@ -1391,8 +1373,8 @@ var FLOWS = {
1391
1373
  setup: true,
1392
1374
  kicker: "Before first run",
1393
1375
  glyph: "⚙",
1394
- title: "Verify + define the finish",
1395
- detail: "smoke-test an observation path · set the finish condition"
1376
+ title: "Verify + define the target",
1377
+ detail: "smoke-test an observation path · set a standing objective"
1396
1378
  },
1397
1379
  {
1398
1380
  id: "tick",
@@ -1419,16 +1401,8 @@ var FLOWS = {
1419
1401
  id: "check",
1420
1402
  kicker: "Step 3 · Check",
1421
1403
  glyph: "⚖",
1422
- title: "Goal met?",
1423
- detail: "keep watching until it genuinely holds"
1424
- },
1425
- {
1426
- id: "finish",
1427
- finish: true,
1428
- kicker: "When met",
1429
- glyph: "⚑",
1430
- title: "Finish the loop",
1431
- detail: "marks it done — stops watching"
1404
+ title: "Track the objective",
1405
+ detail: "keep watching and surface regressions"
1432
1406
  }
1433
1407
  ],
1434
1408
  dashboard: [{
@@ -1455,7 +1429,7 @@ var FLOWS = {
1455
1429
  43,
1456
1430
  44
1457
1431
  ],
1458
- note: "goal: hold ≥ 40% for 48h, then the loop finishes itself."
1432
+ note: "objective: sustain ≥ 40%; keep watching for regressions."
1459
1433
  }]
1460
1434
  }
1461
1435
  };
@@ -1475,8 +1449,6 @@ var WT_PAD_BOT = 16;
1475
1449
  var hOf = (d) => d.setup ? 78 : NODE_H;
1476
1450
  function buildGeometry(defs) {
1477
1451
  const tickIndex = defs.findIndex((d) => !d.setup);
1478
- const finishIndex = defs.findIndex((d) => d.finish);
1479
- const closed = finishIndex >= 0;
1480
1452
  const nodes = [];
1481
1453
  let y = TOP;
1482
1454
  defs.forEach((d, i) => {
@@ -1486,7 +1458,7 @@ function buildGeometry(defs) {
1486
1458
  const gap = !prevWt && curWt ? 48 : prevWt && curWt ? 30 : 36;
1487
1459
  y += hOf(defs[i - 1]) + gap;
1488
1460
  }
1489
- const kind = d.finish ? "finish" : d.setup ? "setup" : i === tickIndex ? "tick" : "step";
1461
+ const kind = d.setup ? "setup" : i === tickIndex ? "tick" : "step";
1490
1462
  nodes.push({
1491
1463
  ...d,
1492
1464
  kind,
@@ -1505,34 +1477,20 @@ function buildGeometry(defs) {
1505
1477
  } : null;
1506
1478
  const wires = [];
1507
1479
  for (let i = 0; i < nodes.length - 1; i++) wires.push(`M${CX} ${nodes[i].y + nodes[i].h} L${CX} ${nodes[i + 1].y - 4}`);
1508
- const finishWireIndex = closed ? finishIndex - 1 : -1;
1509
1480
  const tickNode = nodes[tickIndex];
1510
1481
  const tickMidY = tickNode.y + tickNode.h / 2;
1511
- const cycleLast = nodes[closed ? finishIndex - 1 : nodes.length - 1];
1482
+ const cycleLast = nodes[nodes.length - 1];
1512
1483
  const returnWireIndex = wires.length;
1513
- let route;
1514
- let viewH;
1515
- if (closed) {
1516
- const midY = cycleLast.y + cycleLast.h / 2;
1517
- wires.push(`M${NODE_X} ${midY} L36 ${midY} Q${LANE_X} ${midY} ${LANE_X} ${midY - 6} L${LANE_X} ${tickMidY + 6} Q${LANE_X} ${tickMidY} 36 ${tickMidY} L${NODE_X - 4} ${tickMidY}`);
1518
- route = `M${nodes.slice(tickIndex, finishIndex).map((n) => `${CX} ${n.y + n.h / 2}`).join(" L ")} L${LANE_X} ${midY} L${LANE_X} ${tickMidY} L${NODE_X - 4} ${tickMidY}`;
1519
- const finishNode = nodes[finishIndex];
1520
- viewH = finishNode.y + finishNode.h + 14;
1521
- } else {
1522
- const laneY = cycleLast.y + cycleLast.h + 28;
1523
- wires.push(`M${CX} ${cycleLast.y + cycleLast.h} L${CX} ${laneY - 6} Q${CX} ${laneY} ${CX - 6} ${laneY} L36 ${laneY} Q${LANE_X} ${laneY} ${LANE_X} ${laneY - 6} L${LANE_X} ${tickMidY + 6} Q${LANE_X} ${tickMidY} 36 ${tickMidY} L${NODE_X - 4} ${tickMidY}`);
1524
- route = `M${nodes.slice(tickIndex).map((n) => `${CX} ${n.y + n.h / 2}`).join(" L ")} L${CX} ${laneY} L${LANE_X} ${laneY} L${LANE_X} ${tickMidY} L${NODE_X - 4} ${tickMidY}`;
1525
- viewH = laneY + 14;
1526
- }
1484
+ const laneY = cycleLast.y + cycleLast.h + 28;
1485
+ wires.push(`M${CX} ${cycleLast.y + cycleLast.h} L${CX} ${laneY - 6} Q${CX} ${laneY} ${CX - 6} ${laneY} L36 ${laneY} Q${LANE_X} ${laneY} ${LANE_X} ${laneY - 6} L${LANE_X} ${tickMidY + 6} Q${LANE_X} ${tickMidY} 36 ${tickMidY} L${NODE_X - 4} ${tickMidY}`);
1527
1486
  return {
1528
1487
  nodes,
1529
1488
  wires,
1530
- route,
1489
+ route: `M${nodes.slice(tickIndex).map((n) => `${CX} ${n.y + n.h / 2}`).join(" L ")} L${CX} ${laneY} L${LANE_X} ${laneY} L${LANE_X} ${tickMidY} L${NODE_X - 4} ${tickMidY}`,
1531
1490
  worktree,
1532
1491
  returnWireIndex,
1533
- finishWireIndex,
1534
1492
  viewW: VIEW_W,
1535
- viewH
1493
+ viewH: laneY + 14
1536
1494
  };
1537
1495
  }
1538
1496
  function LoopFlow({ template }) {
@@ -1600,7 +1558,7 @@ function FlowDiagram({ spec }) {
1600
1558
  };
1601
1559
  const nodeEls = /* @__PURE__ */ new Map();
1602
1560
  root.querySelectorAll("[data-lpf]").forEach((el) => nodeEls.set(el.dataset.lpf, el));
1603
- const order = geo.nodes.filter((n) => n.kind !== "setup" && n.kind !== "finish").map((n) => ({
1561
+ const order = geo.nodes.filter((n) => n.kind !== "setup").map((n) => ({
1604
1562
  len: lenAt(n.x + n.w / 2, n.y + n.h / 2),
1605
1563
  el: nodeEls.get(n.id)
1606
1564
  })).filter((n) => n.el).sort((a, b) => a.len - b.len);
@@ -1718,20 +1676,6 @@ function FlowDiagram({ spec }) {
1718
1676
  fill: "var(--color-interactive)"
1719
1677
  })
1720
1678
  }),
1721
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("marker", {
1722
- id: "lpf-arw-good",
1723
- markerUnits: "userSpaceOnUse",
1724
- viewBox: "0 0 8 8",
1725
- refX: "6",
1726
- refY: "4",
1727
- markerWidth: "9",
1728
- markerHeight: "9",
1729
- orient: "auto-start-reverse",
1730
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
1731
- d: "M1.2 1.2 L7 4 L1.2 6.8 Z",
1732
- fill: "var(--color-success)"
1733
- })
1734
- }),
1735
1679
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("filter", {
1736
1680
  id: "lpf-glow",
1737
1681
  x: "-60%",
@@ -1749,18 +1693,15 @@ function FlowDiagram({ spec }) {
1749
1693
  d: geo.route
1750
1694
  })
1751
1695
  ] }),
1752
- geo.wires.map((d, i) => {
1753
- const isFinish = i === geo.finishWireIndex;
1754
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
1755
- className: isFinish ? "lpf-wire finish" : "lpf-wire",
1756
- d,
1757
- fill: "none",
1758
- strokeWidth: 2,
1759
- strokeLinecap: "round",
1760
- strokeDasharray: i === geo.returnWireIndex ? "6 6" : void 0,
1761
- markerEnd: isFinish ? "url(#lpf-arw-good)" : "url(#lpf-arw)"
1762
- }, i);
1763
- }),
1696
+ geo.wires.map((d, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
1697
+ className: "lpf-wire",
1698
+ d,
1699
+ fill: "none",
1700
+ strokeWidth: 2,
1701
+ strokeLinecap: "round",
1702
+ strokeDasharray: i === geo.returnWireIndex ? "6 6" : void 0,
1703
+ markerEnd: "url(#lpf-arw)"
1704
+ }, i)),
1764
1705
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
1765
1706
  className: "lpf-comet",
1766
1707
  d: geo.route,
@@ -2551,9 +2492,7 @@ function DashboardView({ teamId, initial }) {
2551
2492
  return () => clearInterval(t);
2552
2493
  }, [refetch, anyRunning]);
2553
2494
  const refresh = () => void refetch();
2554
- const completed = jobs.filter(isCompleted);
2555
- const active = jobs.filter((j) => !isCompleted(j));
2556
- const activeOn = active.filter((j) => j.enabled).length;
2495
+ const activeOn = jobs.filter((j) => j.enabled).length;
2557
2496
  const cardProps = () => ({
2558
2497
  onOpen: (id) => void navigate({
2559
2498
  to: "/loops/$loopId",
@@ -2666,10 +2605,10 @@ function DashboardView({ teamId, initial }) {
2666
2605
  children: "Active loops"
2667
2606
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2668
2607
  className: "text-label text-secondary",
2669
- children: active.length ? `${activeOn} scheduled · ${active.length} total` : ""
2608
+ children: jobs.length ? `${activeOn} scheduled · ${jobs.length} total` : ""
2670
2609
  })]
2671
2610
  }),
2672
- active.length ? active.map((j) => /* @__PURE__ */ (0, import_react.createElement)(LoopCard, {
2611
+ jobs.length ? jobs.map((j) => /* @__PURE__ */ (0, import_react.createElement)(LoopCard, {
2673
2612
  job: j,
2674
2613
  ...cardProps(),
2675
2614
  key: j.id
@@ -2677,26 +2616,12 @@ function DashboardView({ teamId, initial }) {
2677
2616
  className: "py-16 text-center",
2678
2617
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2679
2618
  className: "text-[15px] text-secondary",
2680
- children: jobs.length ? "No active loops" : "No loops yet"
2619
+ children: "No loops yet"
2681
2620
  }), !jobs.length && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2682
2621
  className: "mt-1.5 text-body text-disabled",
2683
2622
  children: "Pick a template above, or start a blank loop."
2684
2623
  })]
2685
2624
  }),
2686
- completed.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2687
- className: "mb-5 mt-11 flex items-baseline gap-2.5",
2688
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", {
2689
- className: "text-body font-semibold text-display",
2690
- children: "Completed"
2691
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2692
- className: "text-label text-secondary",
2693
- children: [completed.length, " total"]
2694
- })]
2695
- }), completed.map((j) => /* @__PURE__ */ (0, import_react.createElement)(LoopCard, {
2696
- job: j,
2697
- ...cardProps(),
2698
- key: j.id
2699
- }))] }),
2700
2625
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoopPlaybook, { onStart: () => setCompose({
2701
2626
  open: true,
2702
2627
  template: null
@@ -1,7 +1,7 @@
1
1
  import { o as __toESM } from "../_runtime.mjs";
2
2
  import { g as require_jsx_runtime, h as require_react } from "../_libs/@base-ui/react+[...].mjs";
3
- import { E as createFetch, M as defu, W as getBaseURL, en as toKebabCase, mt as isSafeUrlScheme, v as capitalizeFirstLetter } from "./boot-sM4t8RJu.mjs";
4
- //#region node_modules/.nitro/vite/services/ssr/assets/LoopPlaybook-BC9Dvnw2.js
3
+ import { E as createFetch, M as defu, Qt as toKebabCase, W as getBaseURL, pt as isSafeUrlScheme, v as capitalizeFirstLetter } from "./boot-BZ-YyUiD.mjs";
4
+ //#region node_modules/.nitro/vite/services/ssr/assets/LoopPlaybook-C86vJIjZ.js
5
5
  var import_react = /* @__PURE__ */ __toESM(require_react());
6
6
  var import_jsx_runtime = require_jsx_runtime();
7
7
  var PROTO_POLLUTION_PATTERNS = {
@@ -1005,12 +1005,12 @@ function LoopPlaybook({ onStart }) {
1005
1005
  })
1006
1006
  }),
1007
1007
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IdeaCard, {
1008
- title: "State + logs",
1008
+ title: "Memory + logs",
1009
1009
  caption: "Durable memory across runs, so it never re-does work and every lesson sticks. Month three is smarter than week one.",
1010
1010
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DocMock, {
1011
- name: "state.md",
1011
+ name: "memory.md",
1012
1012
  lines: [
1013
- { h: "## State" },
1013
+ { h: "## Memory" },
1014
1014
  { t: "hypothesis: credit-wall users reply 3x" },
1015
1015
  { t: "skip: known-noise fingerprints" },
1016
1016
  { h: "## Logs" },
@@ -1066,7 +1066,7 @@ function LoopPlaybook({ onStart }) {
1066
1066
  className: "grid grid-cols-1 gap-x-10 gap-y-3 sm:grid-cols-2",
1067
1067
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
1068
1068
  className: "text-body leading-relaxed text-primary",
1069
- children: "Fragile systems break on a bad run. Robust ones survive it. An antifragile loop gets stronger from it: a periodic evolve pass reads the last dozen runs and asks where money was wasted, which boundary is too loose, which mistake keeps repeating."
1069
+ children: "Fragile systems break on a bad run. Robust ones survive it. An antifragile loop gets stronger from it: a periodic evolve pass starts with bounded history aggregates, then drills into only the decisive runs to ask where money was wasted, which boundary is too loose, and which mistake keeps repeating."
1070
1070
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
1071
1071
  className: "text-body leading-relaxed text-secondary",
1072
1072
  children: "Its output is not product work. It is changes to the loop itself: a tighter contract, a cheaper trigger, mechanical steps folded into scripts and skills. A loop that improves the loop."
@@ -1339,7 +1339,7 @@ function TriggerRow({ code, label }) {
1339
1339
  * The three roles laid out as a dispatch map (the article's infographic, on
1340
1340
  * app tokens): a trigger wakes the orchestrator, which fans tasks out to
1341
1341
  * parallel executor→verifier lanes; every lane ends in proof, and every run
1342
- * reports back into state + logs. Warm ink = work being dispatched, green =
1342
+ * reports back into memory + logs. Warm ink = work being dispatched, green =
1343
1343
  * proof flowing home. Real HTML cards carry all the text; SVG only draws the
1344
1344
  * connectors. Wide by nature, so the diagram scrolls inside its own pane on
1345
1345
  * narrow screens (never the page). Lane rows are fixed-height so the fan-out
@@ -1531,7 +1531,7 @@ function RolesFlow() {
1531
1531
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
1532
1532
  className: "lpb-stage mt-auto rounded-control border border-success/40 bg-success-soft px-2 py-1.5 text-center font-mono text-micro text-success",
1533
1533
  style: stageStyle(4, "success"),
1534
- children: "✍ writes state + logs"
1534
+ children: "✍ writes memory + logs"
1535
1535
  })
1536
1536
  ]
1537
1537
  }),
@@ -1706,7 +1706,7 @@ function RolesFlow() {
1706
1706
  }),
1707
1707
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
1708
1708
  className: "absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 whitespace-nowrap bg-surface px-2.5 font-mono text-micro text-success",
1709
- children: "every run reports back → orchestrator writes state + logs"
1709
+ children: "every run reports back → orchestrator writes memory + logs"
1710
1710
  })
1711
1711
  ]
1712
1712
  })
@@ -1,18 +1,18 @@
1
1
  import { o as __toESM } from "../_runtime.mjs";
2
2
  import { g as require_jsx_runtime, h as require_react } from "../_libs/@base-ui/react+[...].mjs";
3
- import { gt as isTaskPath } from "./boot-sM4t8RJu.mjs";
4
- import { E as md, M as tsShort, v as fmt, y as fnum } from "./ui-WGITbP6Z.mjs";
5
- import { s as getArtifacts } from "./loopApi-BfMnXaKT.mjs";
3
+ import { ht as isTaskPath } from "./boot-BZ-YyUiD.mjs";
4
+ import { A as tsShort, v as fmt, w as md, y as fnum } from "./ui-B6mE5-5v.mjs";
5
+ import { s as getArtifacts } from "./loopApi-7MTSs6hy.mjs";
6
6
  import { t as artifactKind } from "./artifactKind-BW0isV8L.mjs";
7
7
  import { t as purify } from "../_libs/dompurify.mjs";
8
- import { i as isMarkdown, r as ViewerHead, t as ArtifactBody } from "./artifactView-CYV1r48i.mjs";
9
- import { n as ModalHead, t as Modal } from "./Modal-CfWC9R49.mjs";
8
+ import { i as isMarkdown, r as ViewerHead, t as ArtifactBody } from "./artifactView-DX4P3Krh.mjs";
9
+ import { n as ModalHead, t as Modal } from "./Modal-Bc_5TYGr.mjs";
10
10
  import { n as import_lib, t as esm_default } from "../_libs/html-react-parser+[...].mjs";
11
11
  import { a as Area, c as Tooltip, i as XAxis, l as ResponsiveContainer, n as LineChart, o as Line, r as YAxis, s as CartesianGrid, t as AreaChart } from "../_libs/recharts+victory-vendor.mjs";
12
- //#region node_modules/.nitro/vite/services/ssr/assets/LoopView-Dom6Ad5G.js
12
+ //#region node_modules/.nitro/vite/services/ssr/assets/LoopView-cDyjmf1B.js
13
13
  var import_react = /* @__PURE__ */ __toESM(require_react());
14
14
  var import_jsx_runtime = require_jsx_runtime();
15
- /** Parse a `<loop-chart series="key:label:unit, ...">` attribute into StateField[]. */
15
+ /** Parse a `<loop-chart series="key:label:unit, ...">` attribute into MetricField[]. */
16
16
  function parseSeries(attr) {
17
17
  if (!attr) return [];
18
18
  return attr.split(",").map((s) => {
@@ -26,12 +26,12 @@ function parseSeries(attr) {
26
26
  }
27
27
  function buildBindingContext(runs) {
28
28
  const latest = {};
29
- for (const r of runs) if (r.state && typeof r.state === "object" && !Array.isArray(r.state)) {
30
- for (const k in r.state) if (!(k in latest)) {
31
- const v = r.state[k];
32
- if (typeof v === "number") latest[k] = fnum(v);
33
- else if (typeof v === "string") latest[k] = v;
34
- }
29
+ const seen = /* @__PURE__ */ new Set();
30
+ for (const r of runs) if (r.metrics && typeof r.metrics === "object" && !Array.isArray(r.metrics)) for (const k in r.metrics) {
31
+ if (seen.has(k)) continue;
32
+ seen.add(k);
33
+ const v = r.metrics[k];
34
+ if (typeof v === "number") latest[k] = fnum(v);
35
35
  }
36
36
  return { latest };
37
37
  }
@@ -53,12 +53,12 @@ function lookup(ctx, path) {
53
53
  const parts = path.split(".");
54
54
  if (parts[0] === "latest" && parts[1]) return ctx.latest[parts[1]];
55
55
  }
56
- /** Per-run numeric state snapshots → one series per numeric field (chronological). */
56
+ /** Per-run numeric metrics snapshots → one series per numeric field (chronological). */
57
57
  function numericSeries(runsNewestFirst) {
58
58
  const chron = (runsNewestFirst ?? []).slice().reverse();
59
59
  const series = {};
60
60
  for (const r of chron) {
61
- const obj = r.state && typeof r.state === "object" && !Array.isArray(r.state) ? r.state : {};
61
+ const obj = r.metrics && typeof r.metrics === "object" && !Array.isArray(r.metrics) ? r.metrics : {};
62
62
  for (const k in obj) {
63
63
  const v = obj[k];
64
64
  if (typeof v === "number" && isFinite(v)) (series[k] ??= []).push({
@@ -956,7 +956,7 @@ function KanbanCard({ card, onOpen }) {
956
956
  *
957
957
  * Registering a new primitive means moving three things together: LOOP_TAGS +
958
958
  * the sanitizer config below, the parser swap in `options`, and the skill's
959
- * authoring docs (references/evolve.md §3, run/edit.md) - the sanitizer
959
+ * authoring docs (references/evolve.md §3, run/steer.md) - the sanitizer
960
960
  * allowlist and the skill prose must never drift apart.
961
961
  */
962
962
  var LOOP_TAGS = [
@@ -1,6 +1,6 @@
1
1
  import { c as DialogRoot, d as DialogClose, f as DialogBackdrop, g as require_jsx_runtime, l as DialogPortal, s as DialogTitle, u as DialogPopup } from "../_libs/@base-ui/react+[...].mjs";
2
- import { A as sectionHeadCls } from "./ui-WGITbP6Z.mjs";
3
- //#region node_modules/.nitro/vite/services/ssr/assets/Modal-CfWC9R49.js
2
+ import { O as sectionHeadCls } from "./ui-B6mE5-5v.mjs";
3
+ //#region node_modules/.nitro/vite/services/ssr/assets/Modal-Bc_5TYGr.js
4
4
  var import_jsx_runtime = require_jsx_runtime();
5
5
  /** Shared modal shell — Base UI Dialog handles focus trap, Esc, scroll lock.
6
6
  * Content-height, optically centered — sized for the small form/compose dialogs
@@ -1,8 +1,8 @@
1
1
  import { o as __toESM } from "../_runtime.mjs";
2
2
  import { g as require_jsx_runtime, h as require_react } from "../_libs/@base-ui/react+[...].mjs";
3
- import { l as btnPrimary } from "./ui-WGITbP6Z.mjs";
4
- import { i as PievoLogo, n as GitHubIcon, o as signIn, r as LoopPlaybook, t as GITHUB_URL } from "./LoopPlaybook-BC9Dvnw2.mjs";
5
- //#region node_modules/.nitro/vite/services/ssr/assets/SignIn-D70NUJsN.js
3
+ import { l as btnPrimary } from "./ui-B6mE5-5v.mjs";
4
+ import { i as PievoLogo, n as GitHubIcon, o as signIn, r as LoopPlaybook, t as GITHUB_URL } from "./LoopPlaybook-C86vJIjZ.mjs";
5
+ //#region node_modules/.nitro/vite/services/ssr/assets/SignIn-BQQiD3Ss.js
6
6
  var import_react = /* @__PURE__ */ __toESM(require_react());
7
7
  var import_jsx_runtime = require_jsx_runtime();
8
8
  /**
@@ -1,7 +1,7 @@
1
1
  import { o as __toESM } from "../_runtime.mjs";
2
2
  import { g as require_jsx_runtime, h as require_react } from "../_libs/@base-ui/react+[...].mjs";
3
- import { c as btnDanger, l as btnPrimary, o as btn } from "./ui-WGITbP6Z.mjs";
4
- //#region node_modules/.nitro/vite/services/ssr/assets/actionUi-mDYOvJdB.js
3
+ import { c as btnDanger, l as btnPrimary, o as btn } from "./ui-B6mE5-5v.mjs";
4
+ //#region node_modules/.nitro/vite/services/ssr/assets/actionUi-BKF6xI3d.js
5
5
  var import_react = /* @__PURE__ */ __toESM(require_react());
6
6
  var import_jsx_runtime = require_jsx_runtime();
7
7
  /**
@@ -1,5 +1,5 @@
1
- import { $ as getMachine, A as daemonNeedsUpdate, C as countRuns, Et as listRuns, Pt as machinePresence, d as MIN_DAEMON_VERSION, ot as hasPendingRun, st as hasRunningRun } from "./boot-sM4t8RJu.mjs";
2
- //#region node_modules/.nitro/vite/services/ssr/assets/adapters-D0d1fBKK.js
1
+ import { $ as getMachine, A as daemonNeedsUpdate, C as countRuns, Nt as machinePresence, Tt as listRuns, at as hasPendingRun, d as MIN_DAEMON_VERSION, ot as hasRunningRun } from "./boot-BZ-YyUiD.mjs";
2
+ //#region node_modules/.nitro/vite/services/ssr/assets/adapters-N4-yQ1vK.js
3
3
  /**
4
4
  * Map the new relational rows (Loop + Run) onto the shapes the UI already
5
5
  * renders (JobSummary / JobDetail / RunSummary / JobFull), so the dashboard
@@ -34,7 +34,7 @@ function toRunSummary(r) {
34
34
  cacheCreationTokens: r.usage.cacheCreationTokens
35
35
  } : null,
36
36
  error: r.error ?? null,
37
- state: r.state ?? null,
37
+ metrics: r.metrics ?? null,
38
38
  control: r.control ?? null,
39
39
  sessionId: r.sessionId ?? null,
40
40
  reportIncident: r.reportIncident ?? null
@@ -74,8 +74,6 @@ async function toJobSummary(loop) {
74
74
  lastRunTs: runs.length ? runs[runs.length - 1].ts : null,
75
75
  graduation: null,
76
76
  goal: loop.goal ?? null,
77
- completedAt: loop.completedAt ?? null,
78
- completionReason: loop.completionReason ?? null,
79
77
  deleteRequestedAt: loop.deleteRequestedAt ?? null,
80
78
  pauseCause: loop.pauseCause ?? null,
81
79
  runs,
@@ -92,11 +90,9 @@ function toJobFull(loop) {
92
90
  enabled: loop.enabled,
93
91
  notify: loop.notify,
94
92
  goal: loop.goal ?? null,
95
- completedAt: loop.completedAt ?? null,
96
- completionReason: loop.completionReason ?? null,
97
93
  pauseCause: loop.pauseCause ?? null,
98
94
  taskFile: loop.taskFile ?? void 0,
99
- stateSchema: loop.stateSchema ?? void 0,
95
+ metricSchema: loop.metricSchema ?? void 0,
100
96
  ui: loop.ui ?? void 0,
101
97
  channelId: loop.channelId ?? null,
102
98
  agent: loop.agent,
@@ -1,6 +1,6 @@
1
- import { H as getArtifactFile, Jt as safeRelPath, U as getArtifactSync, bt as listArtifactsWithMeta } from "./boot-sM4t8RJu.mjs";
2
- import { t as toArtifactSummary } from "./adapters-D0d1fBKK.mjs";
3
- //#region node_modules/.nitro/vite/services/ssr/assets/artifactFiles-BfE1070_.js
1
+ import { H as getArtifactFile, Kt as safeRelPath, U as getArtifactSync, yt as listArtifactsWithMeta } from "./boot-BZ-YyUiD.mjs";
2
+ import { t as toArtifactSummary } from "./adapters-N4-yQ1vK.mjs";
3
+ //#region node_modules/.nitro/vite/services/ssr/assets/artifactFiles-Dl1EaUtJ.js
4
4
  /**
5
5
  * Server-side reads over a loop's live-synced artifacts (Phase 2). Pure helpers
6
6
  * (no request/session context) so they're shared by the lazy server fns
@@ -1,10 +1,10 @@
1
1
  import { o as __toESM } from "../_runtime.mjs";
2
2
  import { g as require_jsx_runtime, h as require_react } from "../_libs/@base-ui/react+[...].mjs";
3
- import { o as getArtifact } from "./loopApi-BfMnXaKT.mjs";
3
+ import { o as getArtifact } from "./loopApi-7MTSs6hy.mjs";
4
4
  import { t as artifactKind } from "./artifactKind-BW0isV8L.mjs";
5
5
  import { t as purify } from "../_libs/dompurify.mjs";
6
6
  import { t as g } from "../_libs/marked.mjs";
7
- //#region node_modules/.nitro/vite/services/ssr/assets/artifactView-CYV1r48i.js
7
+ //#region node_modules/.nitro/vite/services/ssr/assets/artifactView-DX4P3Krh.js
8
8
  var import_react = /* @__PURE__ */ __toESM(require_react());
9
9
  var import_jsx_runtime = require_jsx_runtime();
10
10
  /** Download URL for one artifact - the path is segment-encoded so a nested path
@@ -0,0 +1,2 @@
1
+ import { f as SYNC_BODY_CAP, i as BLOB_CAP } from "./boot-BZ-YyUiD.mjs";
2
+ export { BLOB_CAP, SYNC_BODY_CAP };
@@ -1,6 +1,6 @@
1
1
  import { A as sql, C as or, S as notInArray, _ as isNull$1, b as lte, c as asc, d as eq, f as gt, g as isNotNull, h as inArray, l as desc, m as ilike, o as count, p as gte, u as and, v as like, x as ne, y as lt } from "../_libs/drizzle-orm+postgres.mjs";
2
- import { $t as teamIdForUser, G as getBooleanEnvVar, It as normalizePathname, J as getEnvVar, M as defu, R as ensureTeam, T as createDefu, W as getBaseURL, X as getHost, _t as isTeamMember, a as BetterAuthError, an as wildcardMatch, ct as isDevelopment, et as getOrigin, ft as isProduction, h as betterFetch, j as db, jt as loginGateEnabled, l as ENV, lt as isDynamicBaseURLConfig, n as APIError$1, o as BetterCallError, p as ValidationError$1, pt as isRequestLike, qt as resolveBaseURL, r as BASE_ERROR_CODES, t as APIError, tt as getProtocol, v as capitalizeFirstLetter, vt as isTest, yt as kAPIErrorHeaderSymbol, z as env } from "./boot-sM4t8RJu.mjs";
3
- import { C as withSpan, S as shouldPublishLog, _ as logger, a as __getBetterAuthGlobal, b as runWithTransaction, c as createRandomStringGenerator, d as getAuthTables, f as getBetterAuthVersion, g as initGetModelName, h as initGetFieldName, l as generateId$2, m as import_src, n as ATTR_HOOK_TYPE, o as createAdapterFactory, p as getCurrentAdapter, r as ATTR_OPERATION_ID, s as createLogger, t as ATTR_CONTEXT, u as getAsyncLocalStorage, v as queueAfterTransactionHook, x as safeJSONParse, y as runWithAdapter } from "./factory-BQ_XiP23.mjs";
2
+ import { At as loginGateEnabled, Ft as normalizePathname, G as getBooleanEnvVar, Gt as resolveBaseURL, J as getEnvVar, M as defu, R as ensureTeam, T as createDefu, W as getBaseURL, X as getHost, Zt as teamIdForUser, _t as isTest, a as BetterAuthError, an as wildcardMatch, ct as isDynamicBaseURLConfig, dt as isProduction, et as getOrigin, ft as isRequestLike, gt as isTeamMember, h as betterFetch, j as db, l as ENV, n as APIError$1, o as BetterCallError, p as ValidationError$1, r as BASE_ERROR_CODES, st as isDevelopment, t as APIError, tt as getProtocol, v as capitalizeFirstLetter, vt as kAPIErrorHeaderSymbol, z as env } from "./boot-BZ-YyUiD.mjs";
3
+ import { C as withSpan, S as shouldPublishLog, _ as logger, a as __getBetterAuthGlobal, b as runWithTransaction, c as createRandomStringGenerator, d as getAuthTables, f as getBetterAuthVersion, g as initGetModelName, h as initGetFieldName, l as generateId$2, m as import_src, n as ATTR_HOOK_TYPE, o as createAdapterFactory, p as getCurrentAdapter, r as ATTR_OPERATION_ID, s as createLogger, t as ATTR_CONTEXT, u as getAsyncLocalStorage, v as queueAfterTransactionHook, x as safeJSONParse, y as runWithAdapter } from "./factory-DNeo3vVt.mjs";
4
4
  import { randomBytes, scrypt } from "node:crypto";
5
5
  import fs from "node:fs";
6
6
  import path from "node:path";
@@ -1700,7 +1700,7 @@ var JOIN_TYPE_SQL = freeze({
1700
1700
  Using: "using"
1701
1701
  });
1702
1702
  //#endregion
1703
- //#region node_modules/.nitro/vite/services/ssr/assets/auth-BP81awUE.js
1703
+ //#region node_modules/.nitro/vite/services/ssr/assets/auth-CbAfO4Ne.js
1704
1704
  /**
1705
1705
  * @internal
1706
1706
  */
@@ -15993,7 +15993,7 @@ var createKyselyAdapter = async (config) => {
15993
15993
  if ("getConnection" in db) dialect = new MysqlDialect(db);
15994
15994
  if ("connect" in db) dialect = new PostgresDialect({ pool: db });
15995
15995
  if ("fileControl" in db) {
15996
- const { BunSqliteDialect } = await import("./bun-sqlite-dialect-BW9W1_Ps-CZJuWL5Z.mjs");
15996
+ const { BunSqliteDialect } = await import("./bun-sqlite-dialect-BW9W1_Ps-B67XLJZt.mjs");
15997
15997
  dialect = new BunSqliteDialect({ database: db });
15998
15998
  }
15999
15999
  if ("createSession" in db) {
@@ -16009,12 +16009,12 @@ var createKyselyAdapter = async (config) => {
16009
16009
  if (error !== null && typeof error === "object" && "code" in error && error.code !== "ERR_UNKNOWN_BUILTIN_MODULE") throw error;
16010
16010
  }
16011
16011
  if (DatabaseSync && db instanceof DatabaseSync) {
16012
- const { NodeSqliteDialect } = await import("./node-sqlite-dialect-BGlhyZkk.mjs");
16012
+ const { NodeSqliteDialect } = await import("./node-sqlite-dialect-BS2OAFJh.mjs");
16013
16013
  dialect = new NodeSqliteDialect({ database: db });
16014
16014
  }
16015
16015
  }
16016
16016
  if ("batch" in db && "exec" in db && "prepare" in db) {
16017
- const { D1SqliteDialect } = await import("./d1-sqlite-dialect-BLC8LXE6-C2PCtZfI.mjs");
16017
+ const { D1SqliteDialect } = await import("./d1-sqlite-dialect-BLC8LXE6-nff_yHzH.mjs");
16018
16018
  dialect = new D1SqliteDialect({ database: db });
16019
16019
  }
16020
16020
  return {
@@ -36526,7 +36526,7 @@ async function getBaseAdapter(options, handleDirectDatabase) {
36526
36526
  acc[key] = [];
36527
36527
  return acc;
36528
36528
  }, {});
36529
- const { memoryAdapter } = await import("./dist-Z7v6ihws.mjs");
36529
+ const { memoryAdapter } = await import("./dist-BGjVt6NE.mjs");
36530
36530
  adapter = memoryAdapter(memoryDB)(options);
36531
36531
  } else if (typeof options.database === "function") adapter = options.database(options);
36532
36532
  else adapter = await handleDirectDatabase(options);
@@ -36540,10 +36540,10 @@ async function getBaseAdapter(options, handleDirectDatabase) {
36540
36540
  }
36541
36541
  async function getAdapter(options) {
36542
36542
  return getBaseAdapter(options, async (opts) => {
36543
- const { createKyselyAdapter } = await import("./kysely-adapter-DjQPkqgJ.mjs");
36543
+ const { createKyselyAdapter } = await import("./kysely-adapter-C1ww7PKr.mjs");
36544
36544
  const { kysely, databaseType, transaction } = await createKyselyAdapter(opts);
36545
36545
  if (!kysely) throw new BetterAuthError("Failed to initialize database adapter");
36546
- const { kyselyAdapter } = await import("./kysely-adapter-DjQPkqgJ.mjs");
36546
+ const { kyselyAdapter } = await import("./kysely-adapter-C1ww7PKr.mjs");
36547
36547
  return kyselyAdapter(kysely, {
36548
36548
  type: databaseType || "sqlite",
36549
36549
  debugLogs: opts.database && "debugLogs" in opts.database ? opts.database.debugLogs : false,