@kky42/pievo-server 2.4.12 → 2.4.14

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 (88) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/SignIn-CIFwnZtF.js +1 -0
  3. package/.output/public/assets/{ui-s5IMg6RF.js → actionUi-5PtES4q0.js} +1 -1
  4. package/.output/public/assets/app-DvHMhs7S.css +2 -0
  5. package/.output/public/assets/index-CRX2pu0W.js +10 -0
  6. package/.output/public/assets/loops._loopId-BsuV-Rmf.js +67 -0
  7. package/.output/public/assets/loops._loopId_.runs._runId-DpK_fzmZ.js +3 -0
  8. package/.output/public/assets/{preload-helper-Bs7oCAsw.js → preload-helper-sAZOZb3G.js} +3 -3
  9. package/.output/public/assets/routes-Dm_3J2aV.js +1 -0
  10. package/.output/public/assets/routes-DxF_s3cD.js +1 -0
  11. package/.output/server/_libs/@tanstack/react-router+[...].mjs +1 -1
  12. package/.output/server/_ssr/{MachinesModal-BhRw7oOx.mjs → MachinesModal-BaEtzycr.mjs} +24 -57
  13. package/.output/server/_ssr/{SignIn-BhoZIOUp.mjs → SignIn-sHQaBQJC.mjs} +3 -3
  14. package/.output/server/_ssr/{ui-DGz-q9MT.mjs → actionUi-5HOCZnom.mjs} +115 -4
  15. package/.output/server/_ssr/{artifactFiles-ChuJ4PzC.mjs → artifactFiles-DO43wwXA.mjs} +4 -3
  16. package/.output/server/_ssr/{artifactKind-DXumOv7c.mjs → artifactKind-DwDr8IYc.mjs} +6 -14
  17. package/.output/server/_ssr/artifacts-Cd7Qx3Qp.mjs +2 -0
  18. package/.output/server/_ssr/{auth-LwPp_iim.mjs → auth-0AamrwHo.mjs} +44 -124
  19. package/.output/server/_ssr/{SocialLinks-DVCLmql0.mjs → auth-client-lSMb_Idt.mjs} +143 -109
  20. package/.output/server/_ssr/boot-C472kLwY.mjs +3947 -0
  21. package/.output/server/_ssr/{bun-sqlite-dialect-BW9W1_Ps-CHMDkKqA.mjs → bun-sqlite-dialect-BW9W1_Ps-DLIXocA0.mjs} +2 -2
  22. package/.output/server/_ssr/{d1-sqlite-dialect-BLC8LXE6-DYum6qky.mjs → d1-sqlite-dialect-BLC8LXE6-BoFMIPr_.mjs} +2 -2
  23. package/.output/server/_ssr/db-BzvMQ2kx.mjs +2 -0
  24. package/.output/server/_ssr/{dist-bWqs5sTy.mjs → dist-ClzqkwxD.mjs} +2 -2
  25. package/.output/server/_ssr/{factory-pBwrjVTI.mjs → factory-ixUjZqJn.mjs} +2 -2
  26. package/.output/server/_ssr/{kysely-adapter-DMf5pFTf.mjs → kysely-adapter-DkZbmKgV.mjs} +1 -1
  27. package/.output/server/_ssr/logger-DDjsYB2X.mjs +2 -0
  28. package/.output/server/_ssr/{loopApi-Im6JSK0p.mjs → loopApi-DT751TJA.mjs} +30 -90
  29. package/.output/server/_ssr/{loopProjection-DIpGR6rp.mjs → loopProjection-qaD2I48a.mjs} +5 -2
  30. package/.output/server/_ssr/loopTags-CXx5UdGf.mjs +3356 -0
  31. package/.output/server/_ssr/{loops._loopId-B5iPseDG.mjs → loops._loopId-CXgw2Rz1.mjs} +144 -46
  32. package/.output/server/_ssr/{loops._loopId_.runs._runId-DVtG0xYb.mjs → loops._loopId_.runs._runId-Dk94Z0Jq.mjs} +6 -13
  33. package/.output/server/_ssr/{loops._loopId_.runs._runId-BA-P6sGA.mjs → loops._loopId_.runs._runId-SASSqOfy.mjs} +31 -23
  34. package/.output/server/_ssr/{machineFns-Bb9KNXun.mjs → machineFns-BSrIgn3f.mjs} +42 -108
  35. package/.output/server/_ssr/{node-sqlite-dialect-Dho9YjXb.mjs → node-sqlite-dialect-BbUqnnYv.mjs} +2 -2
  36. package/.output/server/_ssr/{router-C8iotXtk.mjs → router-BlLlhfJe.mjs} +26 -40
  37. package/.output/server/_ssr/routes-Cr-9yDEH.mjs +491 -0
  38. package/.output/server/_ssr/{routes-FO0MFfYK.mjs → routes-DRBS4Zi4.mjs} +4 -9
  39. package/.output/server/_ssr/routes-DTBltabU.mjs +27 -0
  40. package/.output/server/_ssr/ssr.mjs +28 -88
  41. package/.output/server/_ssr/store-vDZ9INSa.mjs +2 -0
  42. package/.output/server/_ssr/tokens-BHiCElYD.mjs +2 -0
  43. package/.output/server/_tanstack-start-manifest_v-DxLIQ0cc.mjs +52 -0
  44. package/.output/server/drizzle/0002_remove_teams.sql +15 -0
  45. package/.output/server/drizzle/0003_add_loop_tags.sql +5 -0
  46. package/.output/server/drizzle/meta/_journal.json +14 -0
  47. package/.output/server/index.mjs +47 -96
  48. package/drizzle/0002_remove_teams.sql +15 -0
  49. package/drizzle/0003_add_loop_tags.sql +5 -0
  50. package/drizzle/meta/_journal.json +14 -0
  51. package/package.json +2 -2
  52. package/.output/public/assets/MachinesModal-ByHejech.js +0 -1
  53. package/.output/public/assets/SignIn-Cf4HOpdF.js +0 -1
  54. package/.output/public/assets/actionUi-yYVvoOTn.js +0 -1
  55. package/.output/public/assets/app-D5Hy4BcS.css +0 -2
  56. package/.output/public/assets/index-D504r3X9.js +0 -10
  57. package/.output/public/assets/invite._token-B0EKVyrU.js +0 -1
  58. package/.output/public/assets/invite._token-BSnGRyUw.js +0 -1
  59. package/.output/public/assets/lifecycleUi-C0DaC6NM.js +0 -1
  60. package/.output/public/assets/loops._loopId-j5EB2PLW.js +0 -67
  61. package/.output/public/assets/loops._loopId_.runs._runId-BICo_pRz.js +0 -3
  62. package/.output/public/assets/routes-4N6mrQK_.js +0 -1
  63. package/.output/public/assets/routes-DZU0Tqka.js +0 -1
  64. package/.output/public/assets/t._teamId-CAUjvMZ6.js +0 -1
  65. package/.output/public/assets/t._teamId-Cqzd69sO.js +0 -1
  66. package/.output/server/_ssr/DashboardView-DrKNkmcX.mjs +0 -867
  67. package/.output/server/_ssr/actionUi-Cf6DuEC2.mjs +0 -119
  68. package/.output/server/_ssr/artifacts-DOLHJHcd.mjs +0 -2
  69. package/.output/server/_ssr/boot-BIxtZHU-.mjs +0 -7466
  70. package/.output/server/_ssr/boot-D8cj4uZj.mjs +0 -2
  71. package/.output/server/_ssr/db-BphSJs66.mjs +0 -2
  72. package/.output/server/_ssr/invite._token-CPSvdDox.mjs +0 -27
  73. package/.output/server/_ssr/invite._token-CRBsTSTZ.mjs +0 -84
  74. package/.output/server/_ssr/invite._token-CaTLt92a.mjs +0 -20
  75. package/.output/server/_ssr/lifecycleUi-DauKavgx.mjs +0 -50
  76. package/.output/server/_ssr/logger-EinA2J6y.mjs +0 -2
  77. package/.output/server/_ssr/routes-CsV1weub.mjs +0 -26
  78. package/.output/server/_ssr/routes-fiMzFtcP.mjs +0 -39
  79. package/.output/server/_ssr/runDiff-BLdot9mi.mjs +0 -2
  80. package/.output/server/_ssr/store-CFCp_ggC.mjs +0 -2
  81. package/.output/server/_ssr/t._teamId-BYA4Dnjp.mjs +0 -43
  82. package/.output/server/_ssr/t._teamId-CKsrgN86.mjs +0 -32
  83. package/.output/server/_ssr/t._teamId-D1BTwhWf.mjs +0 -31
  84. package/.output/server/_ssr/teamCookie-B7hLOIie.mjs +0 -10
  85. package/.output/server/_ssr/teamFns-DfqtuBW2.mjs +0 -451
  86. package/.output/server/_ssr/teamFns-cI_tsiCv.mjs +0 -32
  87. package/.output/server/_ssr/tokens-CUz4LDLm.mjs +0 -2
  88. package/.output/server/_tanstack-start-manifest_v-xSxVtI1J.mjs +0 -86
@@ -1,6 +1,6 @@
1
- import { n as DefaultQueryCompiler, o as CompiledQuery, s as sql$1 } from "./auth-LwPp_iim.mjs";
1
+ import { n as DefaultQueryCompiler, o as CompiledQuery, s as sql$1 } from "./auth-0AamrwHo.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-CHMDkKqA.js
3
+ //#region node_modules/.nitro/vite/services/ssr/assets/bun-sqlite-dialect-BW9W1_Ps-DLIXocA0.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-LwPp_iim.mjs";
1
+ import { a as SqliteQueryCompiler, i as SqliteAdapter } from "./auth-0AamrwHo.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-DYum6qky.js
3
+ //#region node_modules/.nitro/vite/services/ssr/assets/d1-sqlite-dialect-BLC8LXE6-BoFMIPr_.js
4
4
  var D1SqliteAdapter = class extends SqliteAdapter {};
5
5
  var D1SqliteDriver = class {
6
6
  #config;
@@ -0,0 +1,2 @@
1
+ import { N as db } from "./loopTags-CXx5UdGf.mjs";
2
+ export { db };
@@ -1,5 +1,5 @@
1
- import { _ as logger, o as createAdapterFactory } from "./factory-pBwrjVTI.mjs";
2
- //#region node_modules/.nitro/vite/services/ssr/assets/dist-bWqs5sTy.js
1
+ import { _ as logger, o as createAdapterFactory } from "./factory-ixUjZqJn.mjs";
2
+ //#region node_modules/.nitro/vite/services/ssr/assets/dist-ClzqkwxD.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 { B as getEnvVar, M as env, a as BetterAuthError } from "./boot-BIxtZHU-.mjs";
2
- //#region node_modules/.nitro/vite/services/ssr/assets/factory-pBwrjVTI.js
1
+ import { V as env, X as getEnvVar, a as BetterAuthError } from "./loopTags-CXx5UdGf.mjs";
2
+ //#region node_modules/.nitro/vite/services/ssr/assets/factory-ixUjZqJn.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,2 +1,2 @@
1
- import { r as kyselyAdapter, t as createKyselyAdapter } from "./auth-LwPp_iim.mjs";
1
+ import { r as kyselyAdapter, t as createKyselyAdapter } from "./auth-0AamrwHo.mjs";
2
2
  export { createKyselyAdapter, kyselyAdapter };
@@ -0,0 +1,2 @@
1
+ import { At as logger } from "./loopTags-CXx5UdGf.mjs";
2
+ export { logger };
@@ -1,9 +1,10 @@
1
- import { $t as validateLoopEdit, A as ensureServer, Ft as requestRunCancel, G as getMachine, J as getRun, Kt as tryDeleteLoop, N as forceDeleteLoop, Pt as requestDeleteLoop, Q as hasRunningRun, Tt as pauseLoop$1, Ut as stopLoop$1, Vt as startLoop$1, W as getLoop, X as getTeamMember, Y as getTeam, _t as listTeamsForUser, dt as listMachines, ft as listMachinesForTeam, ht as listRunsBefore, qt as updateLoop, ut as listLoops$1, xt as machinePresence } from "./boot-BIxtZHU-.mjs";
2
- import { a as toRunSummaries, i as toLoopSummaries, r as toLoopDetail, t as sortLoopSummariesByRecentRun } from "./loopProjection-DIpGR6rp.mjs";
3
- import { canAccessLoop, requestScope } from "./auth-LwPp_iim.mjs";
1
+ import { $ as getLoop, An as updateLoop, Ct as listLoops$1, Dn as stopLoop$1, En as startLoop$1, Et as listMachinesForUser, Ft as machinePresence, Ot as listRunsBefore, Tt as listMachines, Vt as pauseLoop$1, W as forceDeleteLoop, ct as hasRunningRun, dn as requestDeleteLoop, et as getMachine, fn as requestRunCancel, it as getRun, kn as tryDeleteLoop, wt as listLoopsForUser } from "./loopTags-CXx5UdGf.mjs";
2
+ import { h as validateLoopEdit, o as ensureServer } from "./boot-C472kLwY.mjs";
3
+ import { a as toRunSummaries, i as toLoopSummaries, r as toLoopDetail, t as sortLoopSummariesByRecentRun } from "./loopProjection-qaD2I48a.mjs";
4
+ import { canAccessLoop, requestScope } from "./auth-0AamrwHo.mjs";
4
5
  import { n as createServerFn } from "./ssr.mjs";
5
6
  import { t as createServerRpc } from "./createServerRpc-BD8Xn_0_.mjs";
6
- //#region node_modules/.nitro/vite/services/ssr/assets/loopApi-Im6JSK0p.js
7
+ //#region node_modules/.nitro/vite/services/ssr/assets/loopApi-DT751TJA.js
7
8
  /**
8
9
  * Server functions backing the dashboard. They run server-side (createServerFn
9
10
  * → RPC) and call the IN-PROCESS scheduler + store directly — the scheduler
@@ -11,8 +12,8 @@ import { t as createServerRpc } from "./createServerRpc-BD8Xn_0_.mjs";
11
12
  * The machine-facing poll, CLI, report, and artifact-sync endpoints are sibling
12
13
  * server routes in this same process, so one process owns the single scheduler.
13
14
  *
14
- * Reads and writes are scoped through requestScope/ownedLoop so users only see
15
- * teams and loops their current session is authorized to access.
15
+ * Reads and writes are scoped through requestScope/ownedLoop so auth-mode users
16
+ * can access only their own loops. Open mode intentionally shares all loops.
16
17
  */
17
18
  function backend() {
18
19
  return ensureServer();
@@ -26,12 +27,8 @@ async function ownedLoop(id) {
26
27
  const loop = await getLoop(id);
27
28
  if (!loop) return void 0;
28
29
  const scope = await requestScope();
29
- if (!await canAccessLoop(loop.teamId, scope)) return void 0;
30
- return {
31
- loop,
32
- enforce: scope.enforce,
33
- teamId: scope.teamId
34
- };
30
+ if (!canAccessLoop(loop.userId, scope)) return void 0;
31
+ return { loop };
35
32
  }
36
33
  var getAuthState_createServerFn_handler = createServerRpc({
37
34
  id: "b8119d5fe6ca1ed9f609702aa2133b5ac5337030c0bdcf92dc7eba889d6bd2e6",
@@ -39,7 +36,7 @@ var getAuthState_createServerFn_handler = createServerRpc({
39
36
  filename: "src/server/loopApi.ts"
40
37
  }, (opts) => getAuthState.__executeServer(opts));
41
38
  var getAuthState = createServerFn({ method: "GET" }).handler(getAuthState_createServerFn_handler, async () => {
42
- const { authEnabled } = await import("./auth-LwPp_iim.mjs");
39
+ const { authEnabled } = await import("./auth-0AamrwHo.mjs");
43
40
  return { enabled: authEnabled };
44
41
  });
45
42
  var getConfig_createServerFn_handler = createServerRpc({
@@ -56,57 +53,16 @@ var getConfig = createServerFn({ method: "GET" }).handler(getConfig_createServer
56
53
  customCli: !!custom
57
54
  };
58
55
  });
59
- var listMyTeams_createServerFn_handler = createServerRpc({
60
- id: "0fe12e769203c42f432a927b9cbf13a967a0f9db567b61843598f734afb4f5c6",
61
- name: "listMyTeams",
62
- filename: "src/server/loopApi.ts"
63
- }, (opts) => listMyTeams.__executeServer(opts));
64
- var listMyTeams = createServerFn({ method: "GET" }).validator((teamId) => teamId).handler(listMyTeams_createServerFn_handler, async ({ data: teamId }) => {
65
- await backend();
66
- const { enforce, userId, teamId: active } = await requestScope(teamId);
67
- if (!enforce || !userId) return {
68
- teams: [],
69
- activeTeamId: active
70
- };
71
- return {
72
- teams: (await listTeamsForUser(userId)).map((t) => ({
73
- id: t.id,
74
- name: t.name
75
- })),
76
- activeTeamId: active
77
- };
78
- });
79
- var canViewTeam_createServerFn_handler = createServerRpc({
80
- id: "7cc22b3a0f6b1c4c73463c3401e981ad42caf6487b479b738ee5aeacb11710da",
81
- name: "canViewTeam",
82
- filename: "src/server/loopApi.ts"
83
- }, (opts) => canViewTeam.__executeServer(opts));
84
- var canViewTeam = createServerFn({ method: "GET" }).validator((teamId) => teamId).handler(canViewTeam_createServerFn_handler, async ({ data: teamId }) => {
85
- await backend();
86
- const scope = await requestScope(teamId);
87
- if (!scope.enforce) return true;
88
- if (!scope.userId) return false;
89
- return scope.teamId === teamId;
90
- });
91
- var getDefaultTeam_createServerFn_handler = createServerRpc({
92
- id: "dc0ec955d0d53a150a3e9a4673f98f3509cfb4bd411c512079ae4e94c561b70c",
93
- name: "getDefaultTeam",
94
- filename: "src/server/loopApi.ts"
95
- }, (opts) => getDefaultTeam.__executeServer(opts));
96
- var getDefaultTeam = createServerFn({ method: "GET" }).handler(getDefaultTeam_createServerFn_handler, async () => {
97
- await backend();
98
- return (await requestScope()).teamId;
99
- });
100
56
  var listLoops_createServerFn_handler = createServerRpc({
101
57
  id: "23e290b2b7483ceea6fe669024c35b12c2c4ddd76649f6fab21c958ceda02940",
102
58
  name: "listLoops",
103
59
  filename: "src/server/loopApi.ts"
104
60
  }, (opts) => listLoops.__executeServer(opts));
105
- var listLoops = createServerFn({ method: "GET" }).validator((teamId) => teamId).handler(listLoops_createServerFn_handler, async ({ data: teamId }) => {
61
+ var listLoops = createServerFn({ method: "GET" }).handler(listLoops_createServerFn_handler, async () => {
106
62
  await backend();
107
- const { enforce, userId, teamId: active } = await requestScope(teamId);
108
- if (enforce && !userId) return [];
109
- const [loopRows, machines] = await Promise.all([listLoops$1(enforce ? active : void 0), enforce ? listMachinesForTeam(active) : listMachines()]);
63
+ const scope = await requestScope();
64
+ if (scope.enforce && !scope.userId) return [];
65
+ const [loopRows, machines] = await Promise.all([scope.enforce ? listLoopsForUser(scope.userId) : listLoops$1(), scope.enforce ? listMachinesForUser(scope.userId) : listMachines()]);
110
66
  return sortLoopSummariesByRecentRun(await toLoopSummaries(loopRows.sort((a, b) => a.createdAt < b.createdAt ? 1 : -1), machines));
111
67
  });
112
68
  var getLoopDetail_createServerFn_handler = createServerRpc({
@@ -118,17 +74,7 @@ var getLoopDetail = createServerFn({ method: "GET" }).validator((id) => id).hand
118
74
  await backend();
119
75
  const owned = await ownedLoop(id);
120
76
  if (!owned) throw new Error("This loop does not exist, or you do not have access to it.");
121
- const detail = await toLoopDetail(owned.loop);
122
- if (owned.enforce) {
123
- const team = await getTeam(owned.loop.teamId);
124
- if (!team) throw new Error(`invariant: loop ${owned.loop.id} references missing team ${owned.loop.teamId}`);
125
- detail.team = {
126
- id: owned.loop.teamId,
127
- name: team.name,
128
- isActive: owned.loop.teamId === owned.teamId
129
- };
130
- }
131
- return detail;
77
+ return toLoopDetail(owned.loop);
132
78
  });
133
79
  var loadOlderRuns_createServerFn_handler = createServerRpc({
134
80
  id: "85fdf73d4fee43aed762f93c5d47d33200fbff39e2d082647dc921f610d32698",
@@ -149,7 +95,7 @@ var getArtifacts_createServerFn_handler = createServerRpc({
149
95
  var getArtifacts = createServerFn({ method: "GET" }).validator((d) => d).handler(getArtifacts_createServerFn_handler, async ({ data }) => {
150
96
  await backend();
151
97
  if (!await ownedLoop(data.loopId)) return [];
152
- const { listLoopArtifacts } = await import("./artifactFiles-ChuJ4PzC.mjs");
98
+ const { listLoopArtifacts } = await import("./artifactFiles-DO43wwXA.mjs");
153
99
  return listLoopArtifacts(data.loopId);
154
100
  });
155
101
  var getArtifact_createServerFn_handler = createServerRpc({
@@ -160,7 +106,7 @@ var getArtifact_createServerFn_handler = createServerRpc({
160
106
  var getArtifact = createServerFn({ method: "GET" }).validator((d) => d).handler(getArtifact_createServerFn_handler, async ({ data }) => {
161
107
  await backend();
162
108
  if (!await ownedLoop(data.loopId)) return { error: "file not found" };
163
- const { readLoopArtifact } = await import("./artifactFiles-ChuJ4PzC.mjs");
109
+ const { readLoopArtifact } = await import("./artifactFiles-DO43wwXA.mjs");
164
110
  return readLoopArtifact(data.loopId, data.path);
165
111
  });
166
112
  var getRunDiff_createServerFn_handler = createServerRpc({
@@ -179,7 +125,7 @@ var getRunDiff = createServerFn({ method: "GET" }).validator((d) => d).handler(g
179
125
  hasSnapshot: false,
180
126
  files: []
181
127
  };
182
- const { computeRunDiff } = await import("./runDiff-BLdot9mi.mjs");
128
+ const { computeRunDiff } = await import("./boot-C472kLwY.mjs").then((n) => n.i).then((n) => n.i);
183
129
  return computeRunDiff(data.runId);
184
130
  });
185
131
  var patchLoop_createServerFn_handler = createServerRpc({
@@ -260,18 +206,15 @@ var deleteLoop = createServerFn({ method: "POST" }).validator((id) => id).handle
260
206
  if (!owned) return { error: "not found" };
261
207
  const machine = await getMachine(owned.loop.machineId);
262
208
  const unreachable = machinePresence(machine?.online, machine?.lastSeen) !== "online";
263
- const actor = await requestScope();
264
- const mayRetireAuthority = !owned.enforce || !!(actor.userId && owned.loop.teamId && (await getTeamMember(owned.loop.teamId, actor.userId))?.role === "owner");
265
209
  if (!unreachable && await hasRunningRun(id) && machine?.daemonProtocol !== 4) return { error: "Daemon upgrade required to stop a running process" };
266
210
  scheduler.removeLoop(id);
267
211
  if (!await requestDeleteLoop(id)) return { error: "not found" };
268
- if (unreachable && mayRetireAuthority) {
212
+ if (unreachable) {
269
213
  if (!await forceDeleteLoop(id)) return { error: "delete failed; server data was not deleted" };
270
- const { logger } = await import("./logger-EinA2J6y.mjs");
214
+ const { logger } = await import("./logger-DDjsYB2X.mjs");
271
215
  logger.child({ mod: "loop-lifecycle" }).warn({
272
216
  action: "unreachable-delete",
273
217
  loopId: id,
274
- actorUserId: actor.userId,
275
218
  machineId: owned.loop.machineId
276
219
  }, "unreachable-machine delete: retired execution authority and removed server data");
277
220
  return {
@@ -320,22 +263,19 @@ var stopRun = createServerFn({ method: "POST" }).validator((id) => id).handler(s
320
263
  waiting: result.phase === "running"
321
264
  } : { error: "run not found" };
322
265
  });
323
- var mintClaim_createServerFn_handler = createServerRpc({
324
- id: "4646f52fb09b83c9c9cef34836f3c9d03416423c879d9e5ceffcafd9a71ecba6",
325
- name: "mintClaim",
266
+ var mintConnectKey_createServerFn_handler = createServerRpc({
267
+ id: "ce43dcb9366e7c8f7338a6ad28e4290b75a5ee3b13d0d2c9cb585020008f12c6",
268
+ name: "mintConnectKey",
326
269
  filename: "src/server/loopApi.ts"
327
- }, (opts) => mintClaim.__executeServer(opts));
328
- var mintClaim = createServerFn({ method: "POST" }).validator((teamId) => teamId).handler(mintClaim_createServerFn_handler, async ({ data: teamId }) => {
270
+ }, (opts) => mintConnectKey.__executeServer(opts));
271
+ var mintConnectKey = createServerFn({ method: "POST" }).handler(mintConnectKey_createServerFn_handler, async () => {
329
272
  await backend();
330
- const { mintDeviceToken, rememberConnectKey } = await import("./tokens-CUz4LDLm.mjs");
331
- const { userId, teamId: active } = await requestScope(teamId);
332
- const owner = userId ?? "shared";
273
+ const scope = await requestScope();
274
+ if (scope.enforce && !scope.userId) return { error: "not signed in" };
275
+ const { mintDeviceToken, rememberConnectKey } = await import("./tokens-BHiCElYD.mjs");
333
276
  const token = mintDeviceToken();
334
- await rememberConnectKey(token, {
335
- userId: owner,
336
- teamId: active
337
- });
277
+ await rememberConnectKey(token, { userId: scope.userId ?? "shared" });
338
278
  return { token };
339
279
  });
340
280
  //#endregion
341
- export { canViewTeam_createServerFn_handler, deleteLoop_createServerFn_handler, getArtifact_createServerFn_handler, getArtifacts_createServerFn_handler, getAuthState_createServerFn_handler, getConfig_createServerFn_handler, getDefaultTeam_createServerFn_handler, getLoopDetail_createServerFn_handler, getRunDiff_createServerFn_handler, listLoops_createServerFn_handler, listMyTeams_createServerFn_handler, loadOlderRuns_createServerFn_handler, mintClaim_createServerFn_handler, patchLoop_createServerFn_handler, pauseLoop_createServerFn_handler, runLoop_createServerFn_handler, startLoop_createServerFn_handler, stopLoop_createServerFn_handler, stopRun_createServerFn_handler };
281
+ export { deleteLoop_createServerFn_handler, getArtifact_createServerFn_handler, getArtifacts_createServerFn_handler, getAuthState_createServerFn_handler, getConfig_createServerFn_handler, getLoopDetail_createServerFn_handler, getRunDiff_createServerFn_handler, listLoops_createServerFn_handler, loadOlderRuns_createServerFn_handler, mintConnectKey_createServerFn_handler, patchLoop_createServerFn_handler, pauseLoop_createServerFn_handler, runLoop_createServerFn_handler, startLoop_createServerFn_handler, stopLoop_createServerFn_handler, stopRun_createServerFn_handler };
@@ -1,5 +1,6 @@
1
- import { G as getMachine, Ht as statusDefinitionsFromLoop, Ot as recentLoopUsage, Q as hasRunningRun, Rt as scheduleFromLoop, T as daemonNeedsUpdate, Z as hasPendingRun, kt as reconciliationStatesForRuns, mt as listRuns, u as MIN_DAEMON_VERSION, xt as machinePresence, y as countRuns } from "./boot-BIxtZHU-.mjs";
2
- //#region node_modules/.nitro/vite/services/ssr/assets/loopProjection-DIpGR6rp.js
1
+ import { D as countRuns, Dt as listRuns, Ft as machinePresence, Qt as recentLoopUsage, ct as hasRunningRun, et as getMachine, nn as reconciliationStatesForRuns, st as hasPendingRun } from "./loopTags-CXx5UdGf.mjs";
2
+ import { a as daemonNeedsUpdate, d as statusDefinitionsFromLoop, n as MIN_DAEMON_VERSION, u as scheduleFromLoop } from "./boot-C472kLwY.mjs";
3
+ //#region node_modules/.nitro/vite/services/ssr/assets/loopProjection-qaD2I48a.js
3
4
  var SUMMARY_RUNS = 18;
4
5
  var RECENT_USAGE_WINDOW_MS = 10080 * 60 * 1e3;
5
6
  /** Dashboard order: loops with runs first, most recent run first. The incoming
@@ -62,6 +63,7 @@ async function toLoopSummaryWithMachine(loop, machine) {
62
63
  return {
63
64
  id: loop.id,
64
65
  name: loop.name,
66
+ tags: loop.tags,
65
67
  schedule: scheduleFromLoop(loop),
66
68
  workdir: loop.workdir,
67
69
  agent: loop.agent,
@@ -97,6 +99,7 @@ function toLoopFull(loop) {
97
99
  return {
98
100
  id: loop.id,
99
101
  name: loop.name,
102
+ tags: loop.tags,
100
103
  schedule: scheduleFromLoop(loop),
101
104
  workdir: loop.workdir,
102
105
  agent: loop.agent,