@vibedeckx/linux-x64 0.3.30 → 0.3.31
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/bin.js +28 -7
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -188505,6 +188505,10 @@ var createWorkflowRunRepos = (kdb) => ({
|
|
|
188505
188505
|
const row = await kdb.selectFrom("workflow_runs").selectAll().where("source_session_id", "=", sourceSessionId).where("status", "=", "completed").where("reviewer_session_id", "is not", null).orderBy("created_at", "desc").orderBy(sql`rowid`, "desc").executeTakeFirst();
|
|
188506
188506
|
return row ? asRun(row) : void 0;
|
|
188507
188507
|
},
|
|
188508
|
+
listReviewedSourceSessions: async (projectId, branch) => {
|
|
188509
|
+
const rows = await kdb.selectFrom("workflow_runs").select("source_session_id").distinct().where("project_id", "=", projectId).where("branch", "is", branch).where("status", "=", "completed").where("reviewer_session_id", "is not", null).execute();
|
|
188510
|
+
return rows.map((r) => r.source_session_id);
|
|
188511
|
+
},
|
|
188508
188512
|
update: async (id, patch) => {
|
|
188509
188513
|
if (Object.keys(patch).length > 0) {
|
|
188510
188514
|
await kdb.updateTable("workflow_runs").set({ ...patch, updated_at: sql`datetime('now')` }).where("id", "=", id).execute();
|
|
@@ -205224,6 +205228,12 @@ var initializeSchema = (db) => {
|
|
|
205224
205228
|
FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE
|
|
205225
205229
|
);
|
|
205226
205230
|
|
|
205231
|
+
-- getActive (panel poll, every 5s per open workspace) and
|
|
205232
|
+
-- listReviewedSourceSessions (same request) both scope by project+branch
|
|
205233
|
+
-- and differ only in the status filter.
|
|
205234
|
+
CREATE INDEX IF NOT EXISTS idx_workflow_runs_project_branch_status
|
|
205235
|
+
ON workflow_runs(project_id, branch, status);
|
|
205236
|
+
|
|
205227
205237
|
CREATE TABLE IF NOT EXISTS turn_snapshots (
|
|
205228
205238
|
session_id TEXT NOT NULL,
|
|
205229
205239
|
turn_end_index INTEGER NOT NULL,
|
|
@@ -251272,19 +251282,27 @@ async function routes20(fastify2) {
|
|
|
251272
251282
|
};
|
|
251273
251283
|
const result = await proxyAuto(info, "GET", `/api/path/workflow-runs?${q}`);
|
|
251274
251284
|
if (!result.ok) return sendProxyFailure(reply, result);
|
|
251275
|
-
const
|
|
251285
|
+
const data = result.data;
|
|
251286
|
+
const bareRuns = data.runs ?? [];
|
|
251276
251287
|
const runs2 = bareRuns.map((r) => {
|
|
251277
251288
|
const mapped = mapRemoteRun(r, info.remoteServerId, projectId);
|
|
251278
251289
|
trackRemoteRun(mapped, { ...info, bareRunId: r.id, projectId });
|
|
251279
251290
|
return mapped;
|
|
251280
251291
|
});
|
|
251281
251292
|
logRead(runs2.length, `remote:${info.remoteServerId}`);
|
|
251282
|
-
|
|
251293
|
+
const prefix = `remote-${info.remoteServerId}-${projectId}-`;
|
|
251294
|
+
return reply.send({
|
|
251295
|
+
runs: runs2,
|
|
251296
|
+
...data.reviewedSessionIds ? { reviewedSessionIds: data.reviewedSessionIds.map((id) => prefix + id) } : {}
|
|
251297
|
+
});
|
|
251283
251298
|
}
|
|
251284
251299
|
}
|
|
251285
|
-
const runs = await
|
|
251300
|
+
const [runs, reviewedSessionIds] = await Promise.all([
|
|
251301
|
+
fastify2.storage.workflowRuns.getActive(projectId, branch ?? null),
|
|
251302
|
+
fastify2.storage.workflowRuns.listReviewedSourceSessions(projectId, branch ?? null)
|
|
251303
|
+
]);
|
|
251286
251304
|
logRead(runs.length, "local");
|
|
251287
|
-
return reply.send({ runs });
|
|
251305
|
+
return reply.send({ runs, reviewedSessionIds });
|
|
251288
251306
|
}
|
|
251289
251307
|
);
|
|
251290
251308
|
fastify2.get("/api/workflow-runs/:id", async (req, reply) => {
|
|
@@ -251536,9 +251554,12 @@ async function routes20(fastify2) {
|
|
|
251536
251554
|
const { path: projectPath, branch } = req.query;
|
|
251537
251555
|
if (!projectPath) return reply.code(400).send({ error: "path is required" });
|
|
251538
251556
|
const project = await fastify2.storage.projects.getByPath(projectPath) ?? await fastify2.storage.projects.getById(`path:${projectPath}`);
|
|
251539
|
-
if (!project) return reply.send({ runs: [] });
|
|
251540
|
-
const runs = await
|
|
251541
|
-
|
|
251557
|
+
if (!project) return reply.send({ runs: [], reviewedSessionIds: [] });
|
|
251558
|
+
const [runs, reviewedSessionIds] = await Promise.all([
|
|
251559
|
+
fastify2.storage.workflowRuns.getActive(project.id, branch || null),
|
|
251560
|
+
fastify2.storage.workflowRuns.listReviewedSourceSessions(project.id, branch || null)
|
|
251561
|
+
]);
|
|
251562
|
+
return reply.send({ runs, reviewedSessionIds });
|
|
251542
251563
|
});
|
|
251543
251564
|
}
|
|
251544
251565
|
var workflow_run_routes_default = (0, import_fastify_plugin21.default)(routes20, { name: "workflow-run-routes" });
|