@kky42/pievo-server 2.4.14 → 3.0.0
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.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{actionUi-5PtES4q0.js → actionUi-BZrLpgHT.js} +1 -1
- package/.output/public/assets/app-DXLuQNb9.css +2 -0
- package/.output/public/assets/index-Di_wpAtL.js +10 -0
- package/.output/public/assets/loops._loopId-X3ClNPMY.js +67 -0
- package/.output/public/assets/loops._loopId_.runs._runId-ByU2BSyF.js +3 -0
- package/.output/public/assets/preload-helper-hRTYB_ju.js +3 -0
- package/.output/public/assets/{routes-Dm_3J2aV.js → routes-BIOJZsig.js} +1 -1
- package/.output/public/assets/routes-K8D5uBiV.js +1 -0
- package/.output/server/_chunks/ssr-renderer.mjs +1 -1
- package/.output/server/_libs/{drizzle-orm+postgres.mjs → drizzle-orm.mjs} +93 -2218
- package/.output/server/_ssr/{MachinesModal-BaEtzycr.mjs → MachinesModal-CmVMec6B.mjs} +46 -46
- package/.output/server/_ssr/{actionUi-5HOCZnom.mjs → actionUi-DE-Pb2tv.mjs} +1 -2
- package/.output/server/_ssr/{artifactFiles-DO43wwXA.mjs → artifactFiles-Di1xDKvX.mjs} +5 -8
- package/.output/server/_ssr/{artifactKind-DwDr8IYc.mjs → artifactKind-DqpmtxDU.mjs} +3 -9
- package/.output/server/_ssr/{boot-C472kLwY.mjs → boot-CYRi-wez.mjs} +2152 -351
- package/.output/server/_ssr/lifecycleUi-BsbUsi5K.mjs +106 -0
- package/.output/server/_ssr/{loopApi-DT751TJA.mjs → loopApi-Bez1rHV0.mjs} +50 -66
- package/.output/server/_ssr/{loopProjection-qaD2I48a.mjs → loopProjection-esCjyZJg.mjs} +4 -23
- package/.output/server/_ssr/{loops._loopId-CXgw2Rz1.mjs → loops._loopId-KUezNY69.mjs} +8 -23
- package/.output/server/_ssr/{loops._loopId_.runs._runId-Dk94Z0Jq.mjs → loops._loopId_.runs._runId-BFP9oMrp.mjs} +2 -7
- package/.output/server/_ssr/{loops._loopId_.runs._runId-SASSqOfy.mjs → loops._loopId_.runs._runId-DOkUEesG.mjs} +18 -33
- package/.output/server/_ssr/{machineFns-BSrIgn3f.mjs → machineFns-CniGcY8s.mjs} +13 -50
- package/.output/server/_ssr/networkAccess-CIlK3ION.mjs +30 -0
- package/.output/server/_ssr/router-BFIH2UAE.mjs +362 -0
- package/.output/server/_ssr/routes-BSVBANI3.mjs +12 -0
- package/.output/server/_ssr/{routes-Cr-9yDEH.mjs → routes-DnE7XDe_.mjs} +91 -50
- package/.output/server/_ssr/{routes-DRBS4Zi4.mjs → routes-ngpX7h8D.mjs} +2 -4
- package/.output/server/_ssr/ssr.mjs +25 -34
- package/.output/server/_ssr/start-B5_9Z5W-.mjs +35 -0
- package/.output/server/{_tanstack-start-manifest_v-DxLIQ0cc.mjs → _tanstack-start-manifest_v-DnwAupbZ.mjs} +8 -13
- package/.output/server/drizzle/0000_baseline.sql +6 -97
- package/.output/server/drizzle/meta/_journal.json +2 -23
- package/.output/server/index.mjs +45 -52
- package/drizzle/0000_baseline.sql +6 -97
- package/drizzle/meta/_journal.json +2 -23
- package/package.json +4 -8
- package/scripts/pievo-server.mjs +49 -47
- package/scripts/server-cli-lib.mjs +21 -12
- package/scripts/server-network.mjs +139 -0
- package/.output/public/assets/SignIn-CIFwnZtF.js +0 -1
- package/.output/public/assets/app-DvHMhs7S.css +0 -2
- package/.output/public/assets/index-CRX2pu0W.js +0 -10
- package/.output/public/assets/loops._loopId-BsuV-Rmf.js +0 -67
- package/.output/public/assets/loops._loopId_.runs._runId-DpK_fzmZ.js +0 -3
- package/.output/public/assets/preload-helper-sAZOZb3G.js +0 -5
- package/.output/public/assets/routes-DxF_s3cD.js +0 -1
- package/.output/server/_libs/@aws-crypto/crc32+[...].mjs +0 -419
- package/.output/server/_libs/@aws-sdk/checksums+[...].mjs +0 -10732
- package/.output/server/_libs/@aws-sdk/client-s3+[...].mjs +0 -9475
- package/.output/server/_libs/@aws-sdk/credential-provider-http+[...].mjs +0 -137
- package/.output/server/_libs/@aws-sdk/credential-provider-ini+[...].mjs +0 -440
- package/.output/server/_libs/@aws-sdk/credential-provider-process+[...].mjs +0 -62
- package/.output/server/_libs/@aws-sdk/credential-provider-sso+[...].mjs +0 -818
- package/.output/server/_libs/@aws-sdk/credential-provider-web-identity+[...].mjs +0 -59
- package/.output/server/_libs/@smithy/credential-provider-imds+[...].mjs +0 -342
- package/.output/server/_libs/aws-crypto__crc32c.mjs +0 -314
- package/.output/server/_libs/aws-sdk__nested-clients.mjs +0 -2671
- package/.output/server/_ssr/SignIn-sHQaBQJC.mjs +0 -53
- package/.output/server/_ssr/artifacts-Cd7Qx3Qp.mjs +0 -2
- package/.output/server/_ssr/auth-0AamrwHo.mjs +0 -38355
- package/.output/server/_ssr/auth-client-lSMb_Idt.mjs +0 -1070
- package/.output/server/_ssr/bun-sqlite-dialect-BW9W1_Ps-DLIXocA0.mjs +0 -162
- package/.output/server/_ssr/core-RrmWoKne.mjs +0 -5
- package/.output/server/_ssr/d1-sqlite-dialect-BLC8LXE6-BoFMIPr_.mjs +0 -112
- package/.output/server/_ssr/db-BzvMQ2kx.mjs +0 -2
- package/.output/server/_ssr/dist-ClzqkwxD.mjs +0 -342
- package/.output/server/_ssr/factory-ixUjZqJn.mjs +0 -6903
- package/.output/server/_ssr/kysely-adapter-DkZbmKgV.mjs +0 -2
- package/.output/server/_ssr/kysely-migration-tables-JkVUjPF_-bPAX9LR_.mjs +0 -19
- package/.output/server/_ssr/logger-DDjsYB2X.mjs +0 -2
- package/.output/server/_ssr/loopTags-CXx5UdGf.mjs +0 -3356
- package/.output/server/_ssr/node-sqlite-dialect-BbUqnnYv.mjs +0 -162
- package/.output/server/_ssr/router-BlLlhfJe.mjs +0 -543
- package/.output/server/_ssr/routes-DTBltabU.mjs +0 -27
- package/.output/server/_ssr/start-4ifArtKx.mjs +0 -4
- package/.output/server/_ssr/store-vDZ9INSa.mjs +0 -2
- package/.output/server/_ssr/tokens-BHiCElYD.mjs +0 -2
- package/.output/server/drizzle/0001_add_pi_agent.sql +0 -9
- package/.output/server/drizzle/0002_remove_teams.sql +0 -15
- package/.output/server/drizzle/0003_add_loop_tags.sql +0 -5
- package/.output/server/node_modules/tslib/modules/index.js +0 -70
- package/.output/server/node_modules/tslib/modules/package.json +0 -3
- package/.output/server/node_modules/tslib/package.json +0 -47
- package/.output/server/node_modules/tslib/tslib.js +0 -484
- package/.output/server/package.json +0 -9
- package/drizzle/0001_add_pi_agent.sql +0 -9
- package/drizzle/0002_remove_teams.sql +0 -15
- package/drizzle/0003_add_loop_tags.sql +0 -5
- package/scripts/prestart.mjs +0 -66
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { i as getServerFnById, r as createServerFn, t as TSS_SERVER_FUNCTION } from "./ssr.mjs";
|
|
2
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/lifecycleUi-BsbUsi5K.js
|
|
3
|
+
var createSsrRpc = (functionId) => {
|
|
4
|
+
const url = "/_serverFn/" + functionId;
|
|
5
|
+
const serverFnMeta = { id: functionId };
|
|
6
|
+
const fn = async (...args) => {
|
|
7
|
+
return (await getServerFnById(functionId, { origin: "server" }))(...args);
|
|
8
|
+
};
|
|
9
|
+
return Object.assign(fn, {
|
|
10
|
+
url,
|
|
11
|
+
serverFnMeta,
|
|
12
|
+
[TSS_SERVER_FUNCTION]: true
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Server functions backing the dashboard. They run server-side (createServerFn
|
|
17
|
+
* → RPC) and call the IN-PROCESS scheduler + store directly — the scheduler
|
|
18
|
+
* lives in this same TanStack process (booted on first call via ensureServer).
|
|
19
|
+
* The machine-facing poll, CLI, report, and artifact-sync endpoints are sibling
|
|
20
|
+
* server routes in this same process, so one process owns the single scheduler.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Client config. `pievoCli` is the CLI invocation prefix the skill + connect
|
|
24
|
+
* dialog use for every verb (`daemon start`, `new`, …) — defaults to the globally
|
|
25
|
+
* installed `pievo`. Set PIEVO_CLI locally to a runnable command that points at the in-repo
|
|
26
|
+
* daemon, e.g. `tsx /abs/packages/daemon/src/cli.ts` or
|
|
27
|
+
* `node /abs/packages/daemon/dist/cli.js`, so loops created from THIS server tell
|
|
28
|
+
* Claude Code to run your local code instead of the registry build.
|
|
29
|
+
*/
|
|
30
|
+
var getConfig = createServerFn({ method: "GET" }).handler(createSsrRpc("cbb6a1b09b309459bbba3dc3851ae85fc468658b3cda77e22b6c6f3e28b65af4"));
|
|
31
|
+
/** GET — visible loops as compact summaries, most recently run first. */
|
|
32
|
+
var listLoops = createServerFn({ method: "GET" }).handler(createSsrRpc("23e290b2b7483ceea6fe669024c35b12c2c4ddd76649f6fab21c958ceda02940"));
|
|
33
|
+
var getLoopDetail = createServerFn({ method: "GET" }).validator((id) => id).handler(createSsrRpc("b050455aacc84dd2a2c9a45517826ad10f91d8f1545e87cc7015784cc7116a97"));
|
|
34
|
+
var loadOlderRuns = createServerFn({ method: "GET" }).validator((d) => d).handler(createSsrRpc("85fdf73d4fee43aed762f93c5d47d33200fbff39e2d082647dc921f610d32698"));
|
|
35
|
+
var getArtifacts = createServerFn({ method: "GET" }).validator((d) => d).handler(createSsrRpc("b18bbec3d06dfc77714e1e527dfb9172fd7575a64a6c0d6e73ba6dc658dccf0d"));
|
|
36
|
+
var getArtifact = createServerFn({ method: "GET" }).validator((d) => d).handler(createSsrRpc("ed10d5fe79208e5e0e4e18e4a17b18d7f7db4dd16204c00c3ac90c4644668841"));
|
|
37
|
+
/** GET — a run's per-file diff vs the previous run. Lazy by runId like
|
|
38
|
+
* computed on the server at read time (no stored diffs). Old runs
|
|
39
|
+
* with no snapshot return `hasSnapshot: false` for the degrade copy. */
|
|
40
|
+
var getRunDiff = createServerFn({ method: "GET" }).validator((d) => d).handler(createSsrRpc("08c28b892712a1b491b120b74c7dcb81761988d31ccea60216d1807b73c1182c"));
|
|
41
|
+
var patchLoop = createServerFn({ method: "POST" }).validator((d) => d).handler(createSsrRpc("9befe6b8d67ccbbd7aa9b538bde2a161a9894761c8936761a9503fda1a88c0fc"));
|
|
42
|
+
/** Dedicated lifecycle operations. Dashboard callers never synthesize these
|
|
43
|
+
* transitions with patchLoop: each delegates to the loop-locked store operation. */
|
|
44
|
+
var pauseLoop = createServerFn({ method: "POST" }).validator((id) => id).handler(createSsrRpc("95b7483b333d7649e70c848319417e83c2af6a0327bbcda2d0e331f626dffe05"));
|
|
45
|
+
var startLoop = createServerFn({ method: "POST" }).validator((id) => id).handler(createSsrRpc("5660ea82ea5ff2549e0ce2f8f070c54f3e9e24fee84d547601ef5d6ef49a4016"));
|
|
46
|
+
var stopLoop = createServerFn({ method: "POST" }).validator((id) => id).handler(createSsrRpc("e233a461e4526dec3cc4cbaa891a7c3621d5967ce7f32b4fb17e9fb645857b9a"));
|
|
47
|
+
/** Delete is one confirmed operation. Reachable machines get the graceful
|
|
48
|
+
* Stop-and-wait path; a machine already offline at click time cannot acknowledge
|
|
49
|
+
* Stop, so retire its execution authority and remove server data immediately.
|
|
50
|
+
* Local files are never touched by either path. */
|
|
51
|
+
var deleteLoop = createServerFn({ method: "POST" }).validator((id) => id).handler(createSsrRpc("5e0d6b55f5629faac2f55a68661eeb82668b2be752192b16264ffb5cd1e6fabe"));
|
|
52
|
+
var runLoop = createServerFn({ method: "POST" }).validator((id) => id).handler(createSsrRpc("08565e35f6a3dd06ef25401de0343976c47f7ae319d3baed6320b56dd3718311"));
|
|
53
|
+
/** Dedicated Stop-run operation. Pending work cancels immediately; running work
|
|
54
|
+
* records intent and stays Running until the daemon reports its actual result. */
|
|
55
|
+
var stopRun = createServerFn({ method: "POST" }).validator((id) => id).handler(createSsrRpc("6850ba403da9dec5aff45794eb52636ca540ddec2d9e59f5c75ccbb852bfeacb"));
|
|
56
|
+
/** Mint the key shown in the New-loop daemon connection command. */
|
|
57
|
+
var mintConnectKey = createServerFn({ method: "POST" }).handler(createSsrRpc("ce43dcb9366e7c8f7338a6ad28e4290b75a5ee3b13d0d2c9cb585020008f12c6"));
|
|
58
|
+
var DAEMON_UPGRADE_REQUIRED = "Daemon upgrade required to stop a running process. Run `npm install -g @kky42/pievo@latest`, then `pievo daemon restart`.";
|
|
59
|
+
function deriveLoopLifecycle(loop) {
|
|
60
|
+
if (loop.deleteRequestedAt != null) return "deleting";
|
|
61
|
+
const running = loop.runs.find((run) => run.phase === "running");
|
|
62
|
+
if (!loop.enabled && running?.cancelRequested) return "stopping";
|
|
63
|
+
if (!loop.enabled && (loop.running || running)) return "paused-finishing";
|
|
64
|
+
if (!loop.enabled) return "paused";
|
|
65
|
+
return "active";
|
|
66
|
+
}
|
|
67
|
+
/** Stable lifecycle badge shared by dashboard cards and loop detail. It shows
|
|
68
|
+
* only scheduling state and its durable pause cause; execution transients
|
|
69
|
+
* (queued/running/stopping) stay in the runs timeline and never replace it. */
|
|
70
|
+
function lifecyclePresentation(loop) {
|
|
71
|
+
if (loop.deleteRequestedAt != null) return {
|
|
72
|
+
label: "Deleting",
|
|
73
|
+
tone: "accent"
|
|
74
|
+
};
|
|
75
|
+
if (loop.enabled) return {
|
|
76
|
+
label: "Active",
|
|
77
|
+
tone: "success"
|
|
78
|
+
};
|
|
79
|
+
if (loop.pauseCause?.kind === "blocked") return {
|
|
80
|
+
label: "Paused · blocked",
|
|
81
|
+
tone: "attention"
|
|
82
|
+
};
|
|
83
|
+
if (loop.pauseCause?.kind === "failure-streak") return {
|
|
84
|
+
label: "Paused · failure streak",
|
|
85
|
+
tone: "attention"
|
|
86
|
+
};
|
|
87
|
+
if (loop.pauseCause?.kind === "owner") return {
|
|
88
|
+
label: "Paused · owner",
|
|
89
|
+
tone: "neutral"
|
|
90
|
+
};
|
|
91
|
+
return {
|
|
92
|
+
label: "Paused",
|
|
93
|
+
tone: "neutral"
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
function daemonStopSupport(protocol) {
|
|
97
|
+
return protocol === 4 ? {
|
|
98
|
+
supported: true,
|
|
99
|
+
label: `Daemon protocol 4 · Stop supported`
|
|
100
|
+
} : {
|
|
101
|
+
supported: false,
|
|
102
|
+
label: `Daemon protocol ${protocol ?? "unknown"} · upgrade required`
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
export { runLoop as _, deriveLoopLifecycle as a, stopRun as b, getConfig as c, lifecyclePresentation as d, listLoops as f, pauseLoop as g, patchLoop as h, deleteLoop as i, getLoopDetail as l, mintConnectKey as m, createSsrRpc as n, getArtifact as o, loadOlderRuns as p, daemonStopSupport as r, getArtifacts as s, DAEMON_UPGRADE_REQUIRED as t, getRunDiff as u, startLoop as v, stopLoop as y };
|
|
@@ -1,44 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { canAccessLoop, requestScope } from "./auth-0AamrwHo.mjs";
|
|
5
|
-
import { n as createServerFn } from "./ssr.mjs";
|
|
1
|
+
import { A as listMachines, C as getMachine, E as hasRunningRun, G as startLoop$1, H as requestRunCancel, I as machinePresence, J as updateLoop, K as stopLoop$1, M as listRunsBefore, R as pauseLoop$1, S as getLoop, V as requestDeleteLoop, c as ensureServer, h as validateLoopEdit, k as listLoops$1, q as tryDeleteLoop, w as getRun, y as forceDeleteLoop } from "./boot-CYRi-wez.mjs";
|
|
2
|
+
import { a as toRunSummaries, i as toLoopSummaries, r as toLoopDetail, t as sortLoopSummariesByRecentRun } from "./loopProjection-esCjyZJg.mjs";
|
|
3
|
+
import { r as createServerFn } from "./ssr.mjs";
|
|
6
4
|
import { t as createServerRpc } from "./createServerRpc-BD8Xn_0_.mjs";
|
|
7
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/loopApi-
|
|
5
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/loopApi-Bez1rHV0.js
|
|
8
6
|
/**
|
|
9
7
|
* Server functions backing the dashboard. They run server-side (createServerFn
|
|
10
8
|
* → RPC) and call the IN-PROCESS scheduler + store directly — the scheduler
|
|
11
9
|
* lives in this same TanStack process (booted on first call via ensureServer).
|
|
12
10
|
* The machine-facing poll, CLI, report, and artifact-sync endpoints are sibling
|
|
13
11
|
* server routes in this same process, so one process owns the single scheduler.
|
|
14
|
-
*
|
|
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.
|
|
17
12
|
*/
|
|
18
13
|
function backend() {
|
|
19
14
|
return ensureServer();
|
|
20
15
|
}
|
|
21
|
-
|
|
22
|
-
* Resolve a loop and authorize the request against its owner. Returns the loop,
|
|
23
|
-
* or undefined when it's missing OR (gate on) owned by a different user — callers
|
|
24
|
-
* treat both as "not found" so existence never leaks across users.
|
|
25
|
-
*/
|
|
26
|
-
async function ownedLoop(id) {
|
|
16
|
+
async function findLoop(id) {
|
|
27
17
|
const loop = await getLoop(id);
|
|
28
|
-
|
|
29
|
-
const scope = await requestScope();
|
|
30
|
-
if (!canAccessLoop(loop.userId, scope)) return void 0;
|
|
31
|
-
return { loop };
|
|
18
|
+
return loop ? { loop } : void 0;
|
|
32
19
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
});
|
|
20
|
+
/**
|
|
21
|
+
* Client config. `pievoCli` is the CLI invocation prefix the skill + connect
|
|
22
|
+
* dialog use for every verb (`daemon start`, `new`, …) — defaults to the globally
|
|
23
|
+
* installed `pievo`. Set PIEVO_CLI locally to a runnable command that points at the in-repo
|
|
24
|
+
* daemon, e.g. `tsx /abs/packages/daemon/src/cli.ts` or
|
|
25
|
+
* `node /abs/packages/daemon/dist/cli.js`, so loops created from THIS server tell
|
|
26
|
+
* Claude Code to run your local code instead of the registry build.
|
|
27
|
+
*/
|
|
42
28
|
var getConfig_createServerFn_handler = createServerRpc({
|
|
43
29
|
id: "cbb6a1b09b309459bbba3dc3851ae85fc468658b3cda77e22b6c6f3e28b65af4",
|
|
44
30
|
name: "getConfig",
|
|
@@ -50,7 +36,9 @@ var getConfig = createServerFn({ method: "GET" }).handler(getConfig_createServer
|
|
|
50
36
|
pievoCli: custom || "pievo",
|
|
51
37
|
/** True when a non-default (dev) CLI is configured — the New-loop paste then
|
|
52
38
|
* carries an explicit `pievo-cli:` line so Claude Code uses it verbatim. */
|
|
53
|
-
customCli: !!custom
|
|
39
|
+
customCli: !!custom,
|
|
40
|
+
/** Best URL for other devices, published by the launcher (HTTPS, Tailscale, then LAN). */
|
|
41
|
+
publicUrl: process.env.PIEVO_PUBLIC_URL?.trim() || null
|
|
54
42
|
};
|
|
55
43
|
});
|
|
56
44
|
var listLoops_createServerFn_handler = createServerRpc({
|
|
@@ -60,9 +48,7 @@ var listLoops_createServerFn_handler = createServerRpc({
|
|
|
60
48
|
}, (opts) => listLoops.__executeServer(opts));
|
|
61
49
|
var listLoops = createServerFn({ method: "GET" }).handler(listLoops_createServerFn_handler, async () => {
|
|
62
50
|
await backend();
|
|
63
|
-
const
|
|
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()]);
|
|
51
|
+
const [loopRows, machines] = await Promise.all([listLoops$1(), listMachines()]);
|
|
66
52
|
return sortLoopSummariesByRecentRun(await toLoopSummaries(loopRows.sort((a, b) => a.createdAt < b.createdAt ? 1 : -1), machines));
|
|
67
53
|
});
|
|
68
54
|
var getLoopDetail_createServerFn_handler = createServerRpc({
|
|
@@ -72,9 +58,9 @@ var getLoopDetail_createServerFn_handler = createServerRpc({
|
|
|
72
58
|
}, (opts) => getLoopDetail.__executeServer(opts));
|
|
73
59
|
var getLoopDetail = createServerFn({ method: "GET" }).validator((id) => id).handler(getLoopDetail_createServerFn_handler, async ({ data: id }) => {
|
|
74
60
|
await backend();
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
77
|
-
return toLoopDetail(
|
|
61
|
+
const found = await findLoop(id);
|
|
62
|
+
if (!found) throw new Error("This loop does not exist.");
|
|
63
|
+
return toLoopDetail(found.loop);
|
|
78
64
|
});
|
|
79
65
|
var loadOlderRuns_createServerFn_handler = createServerRpc({
|
|
80
66
|
id: "85fdf73d4fee43aed762f93c5d47d33200fbff39e2d082647dc921f610d32698",
|
|
@@ -83,7 +69,7 @@ var loadOlderRuns_createServerFn_handler = createServerRpc({
|
|
|
83
69
|
}, (opts) => loadOlderRuns.__executeServer(opts));
|
|
84
70
|
var loadOlderRuns = createServerFn({ method: "GET" }).validator((d) => d).handler(loadOlderRuns_createServerFn_handler, async ({ data }) => {
|
|
85
71
|
await backend();
|
|
86
|
-
if (!await
|
|
72
|
+
if (!await findLoop(data.loopId)) return [];
|
|
87
73
|
const limit = Math.min(Math.max(data.limit ?? 16, 1), 100);
|
|
88
74
|
return toRunSummaries(data.loopId, await listRunsBefore(data.loopId, data.beforeTs, limit));
|
|
89
75
|
});
|
|
@@ -94,8 +80,8 @@ var getArtifacts_createServerFn_handler = createServerRpc({
|
|
|
94
80
|
}, (opts) => getArtifacts.__executeServer(opts));
|
|
95
81
|
var getArtifacts = createServerFn({ method: "GET" }).validator((d) => d).handler(getArtifacts_createServerFn_handler, async ({ data }) => {
|
|
96
82
|
await backend();
|
|
97
|
-
if (!await
|
|
98
|
-
const { listLoopArtifacts } = await import("./artifactFiles-
|
|
83
|
+
if (!await findLoop(data.loopId)) return [];
|
|
84
|
+
const { listLoopArtifacts } = await import("./artifactFiles-Di1xDKvX.mjs");
|
|
99
85
|
return listLoopArtifacts(data.loopId);
|
|
100
86
|
});
|
|
101
87
|
var getArtifact_createServerFn_handler = createServerRpc({
|
|
@@ -105,8 +91,8 @@ var getArtifact_createServerFn_handler = createServerRpc({
|
|
|
105
91
|
}, (opts) => getArtifact.__executeServer(opts));
|
|
106
92
|
var getArtifact = createServerFn({ method: "GET" }).validator((d) => d).handler(getArtifact_createServerFn_handler, async ({ data }) => {
|
|
107
93
|
await backend();
|
|
108
|
-
if (!await
|
|
109
|
-
const { readLoopArtifact } = await import("./artifactFiles-
|
|
94
|
+
if (!await findLoop(data.loopId)) return { error: "file not found" };
|
|
95
|
+
const { readLoopArtifact } = await import("./artifactFiles-Di1xDKvX.mjs");
|
|
110
96
|
return readLoopArtifact(data.loopId, data.path);
|
|
111
97
|
});
|
|
112
98
|
var getRunDiff_createServerFn_handler = createServerRpc({
|
|
@@ -121,11 +107,11 @@ var getRunDiff = createServerFn({ method: "GET" }).validator((d) => d).handler(g
|
|
|
121
107
|
hasSnapshot: false,
|
|
122
108
|
files: []
|
|
123
109
|
};
|
|
124
|
-
if (!await
|
|
110
|
+
if (!await findLoop(run.loopId)) return {
|
|
125
111
|
hasSnapshot: false,
|
|
126
112
|
files: []
|
|
127
113
|
};
|
|
128
|
-
const { computeRunDiff } = await import("./boot-
|
|
114
|
+
const { computeRunDiff } = await import("./boot-CYRi-wez.mjs").then((n) => n.i).then((n) => n.i);
|
|
129
115
|
return computeRunDiff(data.runId);
|
|
130
116
|
});
|
|
131
117
|
var patchLoop_createServerFn_handler = createServerRpc({
|
|
@@ -135,11 +121,11 @@ var patchLoop_createServerFn_handler = createServerRpc({
|
|
|
135
121
|
}, (opts) => patchLoop.__executeServer(opts));
|
|
136
122
|
var patchLoop = createServerFn({ method: "POST" }).validator((d) => d).handler(patchLoop_createServerFn_handler, async ({ data }) => {
|
|
137
123
|
const { scheduler } = await backend();
|
|
138
|
-
const
|
|
139
|
-
if (!
|
|
124
|
+
const found = await findLoop(data.id);
|
|
125
|
+
if (!found) return { error: "not found" };
|
|
140
126
|
const p = data.patch;
|
|
141
127
|
{
|
|
142
|
-
const validated = validateLoopEdit(
|
|
128
|
+
const validated = validateLoopEdit(found.loop, p);
|
|
143
129
|
if (!validated.ok) return { error: validated.detail };
|
|
144
130
|
const loop = await updateLoop(data.id, validated.value);
|
|
145
131
|
if (!loop) return { error: "not found" };
|
|
@@ -155,7 +141,7 @@ var pauseLoop_createServerFn_handler = createServerRpc({
|
|
|
155
141
|
}, (opts) => pauseLoop.__executeServer(opts));
|
|
156
142
|
var pauseLoop = createServerFn({ method: "POST" }).validator((id) => id).handler(pauseLoop_createServerFn_handler, async ({ data: id }) => {
|
|
157
143
|
const { scheduler } = await backend();
|
|
158
|
-
if (!await
|
|
144
|
+
if (!await findLoop(id)) return { error: "not found" };
|
|
159
145
|
if (!await pauseLoop$1(id)) return { error: "not found" };
|
|
160
146
|
scheduler.removeLoop(id);
|
|
161
147
|
return { ok: true };
|
|
@@ -167,9 +153,9 @@ var startLoop_createServerFn_handler = createServerRpc({
|
|
|
167
153
|
}, (opts) => startLoop.__executeServer(opts));
|
|
168
154
|
var startLoop = createServerFn({ method: "POST" }).validator((id) => id).handler(startLoop_createServerFn_handler, async ({ data: id }) => {
|
|
169
155
|
const { scheduler } = await backend();
|
|
170
|
-
const
|
|
171
|
-
if (!
|
|
172
|
-
if (
|
|
156
|
+
const found = await findLoop(id);
|
|
157
|
+
if (!found) return { error: "not found" };
|
|
158
|
+
if (found.loop.deleteRequestedAt) return { error: "loop is being deleted" };
|
|
173
159
|
const loop = await startLoop$1(id);
|
|
174
160
|
if (!loop) return { error: "not found" };
|
|
175
161
|
scheduler.addLoop(loop);
|
|
@@ -182,10 +168,10 @@ var stopLoop_createServerFn_handler = createServerRpc({
|
|
|
182
168
|
}, (opts) => stopLoop.__executeServer(opts));
|
|
183
169
|
var stopLoop = createServerFn({ method: "POST" }).validator((id) => id).handler(stopLoop_createServerFn_handler, async ({ data: id }) => {
|
|
184
170
|
const { scheduler } = await backend();
|
|
185
|
-
const
|
|
186
|
-
if (!
|
|
171
|
+
const found = await findLoop(id);
|
|
172
|
+
if (!found) return { error: "not found" };
|
|
187
173
|
if (await hasRunningRun(id)) {
|
|
188
|
-
if ((await getMachine(
|
|
174
|
+
if ((await getMachine(found.loop.machineId))?.daemonProtocol !== 4) return { error: "Daemon upgrade required to stop a running process" };
|
|
189
175
|
}
|
|
190
176
|
const stopped = await stopLoop$1(id);
|
|
191
177
|
if (!stopped) return { error: "not found" };
|
|
@@ -202,20 +188,20 @@ var deleteLoop_createServerFn_handler = createServerRpc({
|
|
|
202
188
|
}, (opts) => deleteLoop.__executeServer(opts));
|
|
203
189
|
var deleteLoop = createServerFn({ method: "POST" }).validator((id) => id).handler(deleteLoop_createServerFn_handler, async ({ data: id }) => {
|
|
204
190
|
const { scheduler } = await backend();
|
|
205
|
-
const
|
|
206
|
-
if (!
|
|
207
|
-
const machine = await getMachine(
|
|
191
|
+
const found = await findLoop(id);
|
|
192
|
+
if (!found) return { error: "not found" };
|
|
193
|
+
const machine = await getMachine(found.loop.machineId);
|
|
208
194
|
const unreachable = machinePresence(machine?.online, machine?.lastSeen) !== "online";
|
|
209
195
|
if (!unreachable && await hasRunningRun(id) && machine?.daemonProtocol !== 4) return { error: "Daemon upgrade required to stop a running process" };
|
|
210
196
|
scheduler.removeLoop(id);
|
|
211
197
|
if (!await requestDeleteLoop(id)) return { error: "not found" };
|
|
212
198
|
if (unreachable) {
|
|
213
199
|
if (!await forceDeleteLoop(id)) return { error: "delete failed; server data was not deleted" };
|
|
214
|
-
const { logger } = await import("./
|
|
200
|
+
const { logger } = await import("./boot-CYRi-wez.mjs").then((n) => n.N).then((n) => n.Jt);
|
|
215
201
|
logger.child({ mod: "loop-lifecycle" }).warn({
|
|
216
202
|
action: "unreachable-delete",
|
|
217
203
|
loopId: id,
|
|
218
|
-
machineId:
|
|
204
|
+
machineId: found.loop.machineId
|
|
219
205
|
}, "unreachable-machine delete: retired execution authority and removed server data");
|
|
220
206
|
return {
|
|
221
207
|
ok: true,
|
|
@@ -236,7 +222,7 @@ var runLoop_createServerFn_handler = createServerRpc({
|
|
|
236
222
|
}, (opts) => runLoop.__executeServer(opts));
|
|
237
223
|
var runLoop = createServerFn({ method: "POST" }).validator((id) => id).handler(runLoop_createServerFn_handler, async ({ data: id }) => {
|
|
238
224
|
const { scheduler } = await backend();
|
|
239
|
-
if (!await
|
|
225
|
+
if (!await findLoop(id)) return { error: "not found" };
|
|
240
226
|
const queued = await scheduler.runNow(id);
|
|
241
227
|
if (!("run" in queued)) return { error: queued.reason };
|
|
242
228
|
return {
|
|
@@ -254,9 +240,9 @@ var stopRun_createServerFn_handler = createServerRpc({
|
|
|
254
240
|
var stopRun = createServerFn({ method: "POST" }).validator((id) => id).handler(stopRun_createServerFn_handler, async ({ data: id }) => {
|
|
255
241
|
await backend();
|
|
256
242
|
const run = await getRun(id);
|
|
257
|
-
const
|
|
258
|
-
if (!run || !
|
|
259
|
-
if (run.phase === "running" && (await getMachine(
|
|
243
|
+
const found = run ? await findLoop(run.loopId) : void 0;
|
|
244
|
+
if (!run || !found) return { error: "run not found" };
|
|
245
|
+
if (run.phase === "running" && (await getMachine(found.loop.machineId))?.daemonProtocol !== 4) return { error: "Daemon upgrade required to stop a running process" };
|
|
260
246
|
const result = await requestRunCancel(run.loopId, id);
|
|
261
247
|
return result ? {
|
|
262
248
|
ok: true,
|
|
@@ -270,12 +256,10 @@ var mintConnectKey_createServerFn_handler = createServerRpc({
|
|
|
270
256
|
}, (opts) => mintConnectKey.__executeServer(opts));
|
|
271
257
|
var mintConnectKey = createServerFn({ method: "POST" }).handler(mintConnectKey_createServerFn_handler, async () => {
|
|
272
258
|
await backend();
|
|
273
|
-
const
|
|
274
|
-
if (scope.enforce && !scope.userId) return { error: "not signed in" };
|
|
275
|
-
const { mintDeviceToken, rememberConnectKey } = await import("./tokens-BHiCElYD.mjs");
|
|
259
|
+
const { mintDeviceToken, rememberConnectKey } = await import("./boot-CYRi-wez.mjs").then((n) => n.N).then((n) => n.g);
|
|
276
260
|
const token = mintDeviceToken();
|
|
277
|
-
await rememberConnectKey(token
|
|
261
|
+
await rememberConnectKey(token);
|
|
278
262
|
return { token };
|
|
279
263
|
});
|
|
280
264
|
//#endregion
|
|
281
|
-
export { deleteLoop_createServerFn_handler, getArtifact_createServerFn_handler, getArtifacts_createServerFn_handler,
|
|
265
|
+
export { deleteLoop_createServerFn_handler, getArtifact_createServerFn_handler, getArtifacts_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,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/loopProjection-qaD2I48a.js
|
|
1
|
+
import { B as reconciliationStatesForRuns, C as getMachine, E as hasRunningRun, I as machinePresence, T as hasPendingRun, _ as countRuns, a as canonicalLoopEnvelope, j as listRuns, n as MIN_DAEMON_VERSION, o as canonicalLoopSummary, s as daemonNeedsUpdate, z as recentLoopUsage } from "./boot-CYRi-wez.mjs";
|
|
2
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/loopProjection-esCjyZJg.js
|
|
4
3
|
var SUMMARY_RUNS = 18;
|
|
5
4
|
var RECENT_USAGE_WINDOW_MS = 10080 * 60 * 1e3;
|
|
6
5
|
/** Dashboard order: loops with runs first, most recent run first. The incoming
|
|
@@ -61,14 +60,7 @@ async function toLoopSummaryWithMachine(loop, machine) {
|
|
|
61
60
|
const recentUsage = await recentLoopUsage(loop.id, (/* @__PURE__ */ new Date(Date.now() - RECENT_USAGE_WINDOW_MS)).toISOString());
|
|
62
61
|
const presence = machinePresence(machine?.online, machine?.lastSeen);
|
|
63
62
|
return {
|
|
64
|
-
|
|
65
|
-
name: loop.name,
|
|
66
|
-
tags: loop.tags,
|
|
67
|
-
schedule: scheduleFromLoop(loop),
|
|
68
|
-
workdir: loop.workdir,
|
|
69
|
-
agent: loop.agent,
|
|
70
|
-
model: loop.model ?? null,
|
|
71
|
-
reasoningEffort: loop.reasoningEffort ?? null,
|
|
63
|
+
...canonicalLoopSummary(loop),
|
|
72
64
|
machine: {
|
|
73
65
|
id: loop.machineId,
|
|
74
66
|
name: machine?.name || "",
|
|
@@ -97,18 +89,7 @@ async function toLoopSummaries(loops, machines) {
|
|
|
97
89
|
}
|
|
98
90
|
function toLoopFull(loop) {
|
|
99
91
|
return {
|
|
100
|
-
|
|
101
|
-
name: loop.name,
|
|
102
|
-
tags: loop.tags,
|
|
103
|
-
schedule: scheduleFromLoop(loop),
|
|
104
|
-
workdir: loop.workdir,
|
|
105
|
-
agent: loop.agent,
|
|
106
|
-
model: loop.model ?? null,
|
|
107
|
-
reasoningEffort: loop.reasoningEffort ?? null,
|
|
108
|
-
prompt: loop.prompt,
|
|
109
|
-
statusDefinitions: statusDefinitionsFromLoop(loop),
|
|
110
|
-
artifacts: loop.artifacts,
|
|
111
|
-
enabled: loop.enabled,
|
|
92
|
+
...canonicalLoopEnvelope(loop),
|
|
112
93
|
pauseCause: loop.pauseCause ?? null,
|
|
113
94
|
createdAt: loop.createdAt,
|
|
114
95
|
updatedAt: loop.updatedAt
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { o as __toESM } from "../_runtime.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { X as validateLoopTags, g as CODING_AGENTS } from "./boot-CYRi-wez.mjs";
|
|
3
3
|
import { g as require_react, h as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
|
|
4
4
|
import { d as useNavigate, u as Link } from "../_libs/@tanstack/react-router+[...].mjs";
|
|
5
|
-
import {
|
|
6
|
-
import { A as tsShort, E as runPulseStyle, M as useFlash, O as sectionHeadCls, S as labelCls, _ as fmt, a as Loading, b as humanBytes, c as btn, d as btnQuiet, g as dur, i as LoadErrorCard, k as selectCls, l as btnDanger, m as dotLabel, n as ErrorBanner, p as dotColor, r as FlashLine, t as ConfirmBar, u as btnPrimary, w as rel, x as inputCls, y as focusRing } from "./actionUi-
|
|
7
|
-
import { a as Timeline,
|
|
8
|
-
import { n as artifactKind, t as Route } from "./artifactKind-
|
|
9
|
-
import { t as SignIn } from "./SignIn-sHQaBQJC.mjs";
|
|
5
|
+
import { _ as runLoop, a as deriveLoopLifecycle, g as pauseLoop, h as patchLoop, i as deleteLoop, l as getLoopDetail, o as getArtifact, p as loadOlderRuns, r as daemonStopSupport, s as getArtifacts, t as DAEMON_UPGRADE_REQUIRED, v as startLoop, y as stopLoop } from "./lifecycleUi-BsbUsi5K.mjs";
|
|
6
|
+
import { A as tsShort, E as runPulseStyle, M as useFlash, O as sectionHeadCls, S as labelCls, _ as fmt, a as Loading, b as humanBytes, c as btn, d as btnQuiet, g as dur, i as LoadErrorCard, k as selectCls, l as btnDanger, m as dotLabel, n as ErrorBanner, p as dotColor, r as FlashLine, t as ConfirmBar, u as btnPrimary, w as rel, x as inputCls, y as focusRing } from "./actionUi-DE-Pb2tv.mjs";
|
|
7
|
+
import { a as Timeline, l as mergeRuns, n as MachinesModal, t as LoopOverview } from "./MachinesModal-CmVMec6B.mjs";
|
|
8
|
+
import { n as artifactKind, t as Route } from "./artifactKind-DqpmtxDU.mjs";
|
|
10
9
|
import { t as purify } from "../_libs/dompurify.mjs";
|
|
11
10
|
import { t as g } from "../_libs/marked.mjs";
|
|
12
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/loops._loopId-
|
|
11
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/loops._loopId-KUezNY69.js
|
|
13
12
|
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
14
13
|
var import_jsx_runtime = require_jsx_runtime();
|
|
15
14
|
/** Download URL for one artifact. Each path segment is encoded independently so
|
|
@@ -1287,25 +1286,11 @@ function RunsSection({ loopId, summary, runs, older, onMore, onPickRun }) {
|
|
|
1287
1286
|
/**
|
|
1288
1287
|
* Loop detail page — `/loops/$loopId`: a loop header and action toolbar, the
|
|
1289
1288
|
* exact artifact Files panel, and the runs timeline. The view owns its own
|
|
1290
|
-
* data + self-poll
|
|
1291
|
-
* like the dashboard loader). Run rows link on to `/loops/$loopId/runs/$runId`.
|
|
1292
|
-
*
|
|
1293
|
-
* Auth-gated exactly like the dashboard (`/`): Better Auth's session hook keeps a
|
|
1294
|
-
* logged-out or expired deep link from mounting the ownership-scoped data view.
|
|
1289
|
+
* data + self-poll. Run rows link on to `/loops/$loopId/runs/$runId`.
|
|
1295
1290
|
*/
|
|
1296
1291
|
function LoopDetailPage() {
|
|
1297
1292
|
const { loopId } = Route.useParams();
|
|
1298
|
-
|
|
1299
|
-
const { data: session, isPending } = useSession();
|
|
1300
|
-
if (auth.enabled && isPending) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("main", {
|
|
1301
|
-
className: "mx-auto max-w-[1360px] px-8 pt-10",
|
|
1302
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Loading, {})
|
|
1303
|
-
});
|
|
1304
|
-
if (auth.enabled && !session) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SignIn, { callbackURL: `/loops/${loopId}` });
|
|
1305
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [!auth.enabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
1306
|
-
className: "mx-auto max-w-[1360px] px-8 pt-6",
|
|
1307
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(OpenModeWarning, {})
|
|
1308
|
-
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoopDetailView, { id: loopId })] });
|
|
1293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoopDetailView, { id: loopId });
|
|
1309
1294
|
}
|
|
1310
1295
|
//#endregion
|
|
1311
1296
|
export { LoopDetailPage as component };
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import { c as createFileRoute, s as lazyRouteComponent } from "../_libs/@tanstack/react-router+[...].mjs";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var $$splitComponentImporter = () => import("./loops._loopId_.runs._runId-SASSqOfy.mjs");
|
|
2
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/loops._loopId_.runs._runId-BFP9oMrp.js
|
|
3
|
+
var $$splitComponentImporter = () => import("./loops._loopId_.runs._runId-DOkUEesG.mjs");
|
|
5
4
|
/**
|
|
6
5
|
* Run detail PAGE — `/loops/$loopId/runs/$runId`. A standalone page (the trailing
|
|
7
6
|
* `_` on the `$loopId` segment opts it out of the loop page's component so the run
|
|
8
7
|
* gets its own full surface, deep-linkable + browser-back friendly) rather than a
|
|
9
8
|
* modal or an inline panel. It resolves the run from the loop's detail payload
|
|
10
9
|
* (reusing getLoopDetail) and the existing artifact diff.
|
|
11
|
-
*
|
|
12
|
-
* Auth-gated like the dashboard (`/`) so Better Auth's session hook keeps a
|
|
13
|
-
* logged-out or expired deep link from mounting the run view.
|
|
14
10
|
*/
|
|
15
11
|
var Route = createFileRoute("/loops/$loopId_/runs/$runId")({
|
|
16
12
|
ssr: false,
|
|
17
|
-
loader: async () => ({ auth: await getAuthState() }),
|
|
18
13
|
component: lazyRouteComponent($$splitComponentImporter, "component")
|
|
19
14
|
});
|
|
20
15
|
//#endregion
|
|
@@ -1,11 +1,10 @@
|
|
|
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
3
|
import { u as Link } from "../_libs/@tanstack/react-router+[...].mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { E as runPulseStyle, O as sectionHeadCls, _ as fmt, a as Loading, b as humanBytes, c as btn, g as dur, i as LoadErrorCard, l as btnDanger, o as Pill, s as StatusPill, v as fnum } from "./actionUi-
|
|
6
|
-
import { t as
|
|
7
|
-
|
|
8
|
-
//#region node_modules/.nitro/vite/services/ssr/assets/loops._loopId_.runs._runId-SASSqOfy.js
|
|
4
|
+
import { b as stopRun, l as getLoopDetail, p as loadOlderRuns, u as getRunDiff } from "./lifecycleUi-BsbUsi5K.mjs";
|
|
5
|
+
import { E as runPulseStyle, O as sectionHeadCls, _ as fmt, a as Loading, b as humanBytes, c as btn, g as dur, i as LoadErrorCard, l as btnDanger, o as Pill, s as StatusPill, v as fnum } from "./actionUi-DE-Pb2tv.mjs";
|
|
6
|
+
import { t as Route } from "./loops._loopId_.runs._runId-BFP9oMrp.mjs";
|
|
7
|
+
//#region node_modules/.nitro/vite/services/ssr/assets/loops._loopId_.runs._runId-DOkUEesG.js
|
|
9
8
|
var import_react = /* @__PURE__ */ __toESM(require_react());
|
|
10
9
|
var import_jsx_runtime = require_jsx_runtime();
|
|
11
10
|
/**
|
|
@@ -594,40 +593,26 @@ function RunDetailView({ loopId, runId }) {
|
|
|
594
593
|
* gets its own full surface, deep-linkable + browser-back friendly) rather than a
|
|
595
594
|
* modal or an inline panel. It resolves the run from the loop's detail payload
|
|
596
595
|
* (reusing getLoopDetail) and the existing artifact diff.
|
|
597
|
-
*
|
|
598
|
-
* Auth-gated like the dashboard (`/`) so Better Auth's session hook keeps a
|
|
599
|
-
* logged-out or expired deep link from mounting the run view.
|
|
600
596
|
*/
|
|
601
597
|
function RunDetailPage() {
|
|
602
598
|
const { loopId, runId } = Route.useParams();
|
|
603
|
-
const { auth } = Route.useLoaderData() ?? { auth: { enabled: false } };
|
|
604
|
-
const { data: session, isPending } = useSession();
|
|
605
|
-
if (auth.enabled && isPending) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("main", {
|
|
606
|
-
className: "mx-auto max-w-[1360px] px-8 pt-10",
|
|
607
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Loading, {})
|
|
608
|
-
});
|
|
609
|
-
if (auth.enabled && !session) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SignIn, { callbackURL: `/loops/${loopId}/runs/${runId}` });
|
|
610
599
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("main", {
|
|
611
600
|
className: "mx-auto max-w-[1360px] px-8 pb-24 pt-6",
|
|
612
|
-
children: [
|
|
613
|
-
|
|
614
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
children:
|
|
621
|
-
|
|
622
|
-
children: "←"
|
|
623
|
-
}), " Back to loop"]
|
|
624
|
-
})
|
|
625
|
-
}),
|
|
626
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RunDetailView, {
|
|
627
|
-
loopId,
|
|
628
|
-
runId
|
|
601
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
|
|
602
|
+
className: "mb-5",
|
|
603
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Link, {
|
|
604
|
+
to: "/loops/$loopId",
|
|
605
|
+
params: { loopId },
|
|
606
|
+
className: "inline-flex items-center gap-1.5 text-label font-medium text-secondary transition-colors hover:text-display",
|
|
607
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
608
|
+
"aria-hidden": true,
|
|
609
|
+
children: "←"
|
|
610
|
+
}), " Back to loop"]
|
|
629
611
|
})
|
|
630
|
-
|
|
612
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RunDetailView, {
|
|
613
|
+
loopId,
|
|
614
|
+
runId
|
|
615
|
+
})]
|
|
631
616
|
});
|
|
632
617
|
}
|
|
633
618
|
//#endregion
|