lastlight-core 0.40.2 → 0.40.3
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/dist/admin/routes.d.ts +1 -1
- package/dist/admin/routes.js +9 -0
- package/dist/admin/routes.js.map +1 -1
- package/dist/engine/dispatcher.d.ts +1 -1
- package/dist/engine/dispatcher.js +14 -0
- package/dist/engine/dispatcher.js.map +1 -1
- package/dist/engine/supersede.d.ts +1 -1
- package/dist/engine/supersede.js +14 -0
- package/dist/engine/supersede.js.map +1 -1
- package/dist/state/db.d.ts +1 -0
- package/dist/state/db.js +1 -0
- package/dist/state/db.js.map +1 -1
- package/dist/state/schema/pg.d.ts +17 -0
- package/dist/state/schema/pg.js +1 -0
- package/dist/state/schema/pg.js.map +1 -1
- package/dist/state/schema/sqlite.d.ts +19 -0
- package/dist/state/schema/sqlite.js +5 -0
- package/dist/state/schema/sqlite.js.map +1 -1
- package/dist/state/workflow-run-store.d.ts +52 -2
- package/dist/state/workflow-run-store.js +93 -17
- package/dist/state/workflow-run-store.js.map +1 -1
- package/dist/workflows/resume.d.ts +1 -1
- package/dist/workflows/resume.js +24 -1
- package/dist/workflows/resume.js.map +1 -1
- package/dist/workflows/simple.d.ts +1 -1
- package/dist/workflows/simple.js +14 -0
- package/dist/workflows/simple.js.map +1 -1
- package/drizzle/pg/0003_needy_obadiah_stane.sql +1 -0
- package/drizzle/pg/meta/0003_snapshot.json +1900 -0
- package/drizzle/pg/meta/_journal.json +7 -0
- package/drizzle/sqlite/0004_adorable_puck.sql +1 -0
- package/drizzle/sqlite/meta/0004_snapshot.json +1732 -0
- package/drizzle/sqlite/meta/_journal.json +7 -0
- package/package.json +3 -3
package/dist/admin/routes.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
2
|
import type { SessionSource } from "./sessions.js";
|
|
3
|
-
import type
|
|
3
|
+
import { type StateDb, type WorkflowRun } from "../state/db.js";
|
|
4
4
|
import type { CronScheduler } from "../cron/scheduler.js";
|
|
5
5
|
import { type PrPolicyConfig } from "../engine/pr-decisions.js";
|
|
6
6
|
import type { GitHubClient } from "../engine/github/github.js";
|
package/dist/admin/routes.js
CHANGED
|
@@ -3,6 +3,7 @@ import { timingSafeEqual, randomBytes, randomUUID } from "node:crypto";
|
|
|
3
3
|
import { streamSSE } from "hono/streaming";
|
|
4
4
|
import { getCookie, setCookie, deleteCookie } from "hono/cookie";
|
|
5
5
|
import { Slack, GitHub } from "arctic";
|
|
6
|
+
import { foreignEngineMessage, isOwnedRun } from "../state/db.js";
|
|
6
7
|
import { tailJsonl } from "./tail.js";
|
|
7
8
|
import { listRunningContainers, killContainer, getContainerStats, getHostStats, listServerContainers, resolveServerContainer, getContainerLogs, streamContainerLogs, } from "./docker.js";
|
|
8
9
|
import { authMiddleware, createToken, verifyTokenForRefresh, decodeToken, actorFromContext, actorTypeFromContext } from "./auth.js";
|
|
@@ -1470,6 +1471,8 @@ export function createAdminRoutes(db, sessions, chatSessions, config) {
|
|
|
1470
1471
|
if (run.status !== "running" && run.status !== "paused" && run.status !== "queued") {
|
|
1471
1472
|
return c.json({ error: `cannot cancel a run with status '${run.status}'` }, 400);
|
|
1472
1473
|
}
|
|
1474
|
+
if (!isOwnedRun(run))
|
|
1475
|
+
return c.json({ error: foreignEngineMessage(run) }, 409);
|
|
1473
1476
|
// Actor logging (issue #205): the canceller lands on the append-only
|
|
1474
1477
|
// executions ledger (via the finish error below), never overwriting the
|
|
1475
1478
|
// run's original `triggered_by`.
|
|
@@ -1599,6 +1602,8 @@ export function createAdminRoutes(db, sessions, chatSessions, config) {
|
|
|
1599
1602
|
if (run.status !== "failed" && run.status !== "cancelled") {
|
|
1600
1603
|
return c.json({ error: `cannot retry a run with status '${run.status}'` }, 400);
|
|
1601
1604
|
}
|
|
1605
|
+
if (!isOwnedRun(run))
|
|
1606
|
+
return c.json({ error: foreignEngineMessage(run) }, 409);
|
|
1602
1607
|
if (!config.retryWorkflow) {
|
|
1603
1608
|
return c.json({ error: "retry not available (runner not wired)" }, 503);
|
|
1604
1609
|
}
|
|
@@ -2353,6 +2358,10 @@ export function createAdminRoutes(db, sessions, chatSessions, config) {
|
|
|
2353
2358
|
return c.json({ error: "approval not found" }, 404);
|
|
2354
2359
|
if (approval.status !== "pending")
|
|
2355
2360
|
return c.json({ error: `already ${approval.status}` }, 400);
|
|
2361
|
+
// Another engine's gate stays pending for that engine (KNOWN_RUN_ENGINES).
|
|
2362
|
+
const gatedRun = await db.runs.getRun(approval.workflowRunId);
|
|
2363
|
+
if (gatedRun && !isOwnedRun(gatedRun))
|
|
2364
|
+
return c.json({ error: foreignEngineMessage(gatedRun) }, 409);
|
|
2356
2365
|
// Actor logging (issue #205): attribute the approval to the authenticated
|
|
2357
2366
|
// user, falling back to `admin` for password/anonymous sessions.
|
|
2358
2367
|
const actor = actorFromContext(c) ?? "admin";
|