@vibedeckx/linux-x64 0.3.34 → 0.3.35
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 +79 -4
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -186887,7 +186887,8 @@ var mapLocalActivity = (row) => {
|
|
|
186887
186887
|
parseActivityTimestamp(row.created_at) ?? 0
|
|
186888
186888
|
),
|
|
186889
186889
|
lastUserMessageAt: row.last_user_message_at,
|
|
186890
|
-
lastCompletedAt: row.last_completed_at
|
|
186890
|
+
lastCompletedAt: row.last_completed_at,
|
|
186891
|
+
favoritedAt: row.favorited_at
|
|
186891
186892
|
};
|
|
186892
186893
|
};
|
|
186893
186894
|
var observeLocalActivity = (consumer, row) => {
|
|
@@ -186915,6 +186916,7 @@ var localActivityBase = (kdb, projectId) => {
|
|
|
186915
186916
|
"s.updated_at",
|
|
186916
186917
|
"s.last_user_message_at",
|
|
186917
186918
|
"s.last_completed_at",
|
|
186919
|
+
"s.favorited_at",
|
|
186918
186920
|
"checkout.worktree_path",
|
|
186919
186921
|
"checkout.deleted_at as checkout_deleted_at",
|
|
186920
186922
|
"checkout.status as checkout_status",
|
|
@@ -187196,6 +187198,12 @@ var createAgentSessionRepos = (kdb, h) => ({
|
|
|
187196
187198
|
await observeDanglingLocalScope(kdb, consumer, projectId);
|
|
187197
187199
|
return rows.map(mapLocalActivity);
|
|
187198
187200
|
},
|
|
187201
|
+
listFavoritedActivityByProject: async (projectId, limit, consumer) => {
|
|
187202
|
+
const rows = await localActivityBase(kdb, projectId).where(visibleLifecycleOf("s")).where("s.favorited_at", "is not", null).orderBy("s.favorited_at", "desc").orderBy("s.id", "desc").limit(limit).execute();
|
|
187203
|
+
rows.forEach((row) => observeLocalActivity(consumer, row));
|
|
187204
|
+
await observeDanglingLocalScope(kdb, consumer, projectId);
|
|
187205
|
+
return rows.map(mapLocalActivity);
|
|
187206
|
+
},
|
|
187199
187207
|
countRunningByProject: async (projectId) => {
|
|
187200
187208
|
const row = await kdb.selectFrom("agent_sessions").select(kdb.fn.countAll().as("count")).where("project_id", "=", projectId).where("status", "=", "running").where(visibleLifecycle).executeTakeFirstOrThrow();
|
|
187201
187209
|
return Number(row.count);
|
|
@@ -188166,7 +188174,8 @@ var mapRemoteActivity = (row) => {
|
|
|
188166
188174
|
model: row.model,
|
|
188167
188175
|
lastActiveAt: row.last_active_at,
|
|
188168
188176
|
lastUserMessageAt: row.last_user_message_at,
|
|
188169
|
-
lastCompletedAt: row.last_completed_at
|
|
188177
|
+
lastCompletedAt: row.last_completed_at,
|
|
188178
|
+
favoritedAt: row.favorited_at
|
|
188170
188179
|
};
|
|
188171
188180
|
};
|
|
188172
188181
|
var observeRemoteActivity = (consumer, row) => {
|
|
@@ -188234,6 +188243,7 @@ var remoteActivityBase = (kdb, projectId) => remoteSessionScope(kdb, projectId).
|
|
|
188234
188243
|
"c.model",
|
|
188235
188244
|
"c.last_user_message_at",
|
|
188236
188245
|
"c.last_completed_at",
|
|
188246
|
+
"c.favorited_at",
|
|
188237
188247
|
"checkout.worktree_path",
|
|
188238
188248
|
"checkout.deleted_at as checkout_deleted_at",
|
|
188239
188249
|
"checkout.status as checkout_status",
|
|
@@ -188269,6 +188279,12 @@ var createSearchCacheRepos = (kdb, _h) => ({
|
|
|
188269
188279
|
await observeDanglingRemoteActivity(kdb, consumer, projectId);
|
|
188270
188280
|
return rows.map(mapRemoteActivity);
|
|
188271
188281
|
},
|
|
188282
|
+
listRemoteSessionFavoritesByProject: async (projectId, limit, consumer) => {
|
|
188283
|
+
const rows = await remoteActivityBase(kdb, projectId).where("c.favorited_at", "is not", null).orderBy("c.favorited_at", "desc").orderBy("c.local_session_id", "asc").limit(limit).execute();
|
|
188284
|
+
rows.forEach((row) => observeRemoteActivity(consumer, row));
|
|
188285
|
+
await observeDanglingRemoteActivity(kdb, consumer, projectId);
|
|
188286
|
+
return rows.map(mapRemoteActivity);
|
|
188287
|
+
},
|
|
188272
188288
|
countRemoteSessionActivityByProject: async (projectId) => {
|
|
188273
188289
|
const row = await remoteSessionScope(kdb, projectId).select([
|
|
188274
188290
|
sql`coalesce(sum(case when c.status = 'running' then 1 else 0 end), 0)`.as("running")
|
|
@@ -188450,6 +188466,39 @@ var createSearchCacheRepos = (kdb, _h) => ({
|
|
|
188450
188466
|
updateCachedSessionTitle: async (localSessionId, title) => {
|
|
188451
188467
|
await kdb.updateTable("session_search_cache").set({ title, written_at: Date.now() }).where("local_session_id", "=", localSessionId).execute();
|
|
188452
188468
|
},
|
|
188469
|
+
// Star write-through. Unlike the title and delete write-throughs this one
|
|
188470
|
+
// may CREATE the row: the remote favorite PATCH has already succeeded on
|
|
188471
|
+
// the worker, so the session provably exists, and the path that lists a
|
|
188472
|
+
// remote's sessions (where the star button lives) binds only a mapping —
|
|
188473
|
+
// no cache row. Before that target's first catalog snapshot there would be
|
|
188474
|
+
// nothing to update and the star would sit invisible, which is the exact
|
|
188475
|
+
// latency this write-through exists to remove. Only starring creates a
|
|
188476
|
+
// row; an unstar with no row has nothing to hide (see noteSessionDeleted).
|
|
188477
|
+
updateCachedSessionFavorited: async (localSessionId, favoritedAt) => {
|
|
188478
|
+
const now3 = Date.now();
|
|
188479
|
+
const updated = await kdb.updateTable("session_search_cache").set({ favorited_at: favoritedAt, written_at: now3 }).where("local_session_id", "=", localSessionId).executeTakeFirst();
|
|
188480
|
+
if (Number(updated?.numUpdatedRows ?? 0) > 0 || favoritedAt === null) return;
|
|
188481
|
+
const mapping = await kdb.selectFrom("remote_session_mappings").select(["project_id", "remote_server_id", "branch"]).where("local_session_id", "=", localSessionId).executeTakeFirst();
|
|
188482
|
+
if (!mapping || mapping.remote_server_id === "local") return;
|
|
188483
|
+
await kdb.insertInto("session_search_cache").values({
|
|
188484
|
+
local_session_id: localSessionId,
|
|
188485
|
+
project_id: mapping.project_id,
|
|
188486
|
+
target_id: mapping.remote_server_id,
|
|
188487
|
+
branch: toDbBranch(mapping.branch),
|
|
188488
|
+
title: null,
|
|
188489
|
+
last_active_at: null,
|
|
188490
|
+
favorited_at: favoritedAt,
|
|
188491
|
+
entry_count: 0,
|
|
188492
|
+
status: "unknown",
|
|
188493
|
+
agent_type: null,
|
|
188494
|
+
model: null,
|
|
188495
|
+
last_user_message_at: null,
|
|
188496
|
+
last_completed_at: null,
|
|
188497
|
+
generation: 0,
|
|
188498
|
+
deleted_at: null,
|
|
188499
|
+
written_at: now3
|
|
188500
|
+
}).onConflict((oc) => oc.column("local_session_id").doUpdateSet({ favorited_at: favoritedAt, written_at: now3 })).execute();
|
|
188501
|
+
},
|
|
188453
188502
|
// Create write-through: called where a remote session's creation transits
|
|
188454
188503
|
// the server (UI create proxy, commander spawn, branch-from-history). The
|
|
188455
188504
|
// written_at stamp keeps the row exempt from snapshot reconciliation until
|
|
@@ -251385,6 +251434,16 @@ var routes11 = async (fastify2) => {
|
|
|
251385
251434
|
`/api/agent-sessions/${remoteInfo.remoteSessionId}/favorite`,
|
|
251386
251435
|
{ favorited }
|
|
251387
251436
|
);
|
|
251437
|
+
if (result.ok) {
|
|
251438
|
+
try {
|
|
251439
|
+
await fastify2.storage.searchCache.updateCachedSessionFavorited(
|
|
251440
|
+
req.params.sessionId,
|
|
251441
|
+
favorited ? Date.now() : null
|
|
251442
|
+
);
|
|
251443
|
+
} catch (err) {
|
|
251444
|
+
console.error("[API] searchCache.updateCachedSessionFavorited failed:", err);
|
|
251445
|
+
}
|
|
251446
|
+
}
|
|
251388
251447
|
return reply.code(proxyStatus(result)).send(result.data);
|
|
251389
251448
|
}
|
|
251390
251449
|
const session = await fastify2.storage.agentSessions.getById(req.params.sessionId);
|
|
@@ -252467,17 +252526,19 @@ var RECENT_SESSION_LIMIT = 8;
|
|
|
252467
252526
|
var RECENT_RUN_LIMIT = 5;
|
|
252468
252527
|
var PRIORITY_TASK_LIMIT = 5;
|
|
252469
252528
|
var ATTENTION_LIMIT = 10;
|
|
252529
|
+
var STARRED_LIMIT = 50;
|
|
252470
252530
|
var parseDbTimestamp4 = (value) => {
|
|
252471
252531
|
if (!value) return null;
|
|
252472
252532
|
const explicitZone = /(?:Z|[+-]\d\d:\d\d)$/i.test(value);
|
|
252473
252533
|
const parsed = Date.parse(explicitZone ? value : `${value.replace(" ", "T")}Z`);
|
|
252474
252534
|
return Number.isNaN(parsed) ? null : parsed;
|
|
252475
252535
|
};
|
|
252476
|
-
var
|
|
252536
|
+
var mergeBy = (local, remote, limit, rank) => {
|
|
252477
252537
|
const byId = /* @__PURE__ */ new Map();
|
|
252478
252538
|
for (const row of [...local, ...remote]) if (!byId.has(row.id)) byId.set(row.id, row);
|
|
252479
|
-
return [...byId.values()].sort((left, right) => (right
|
|
252539
|
+
return [...byId.values()].sort((left, right) => rank(right) - rank(left) || left.id.localeCompare(right.id)).slice(0, limit);
|
|
252480
252540
|
};
|
|
252541
|
+
var mergeActivity = (local, remote, limit) => mergeBy(local, remote, limit, (row) => row.lastActiveAt ?? 0);
|
|
252481
252542
|
async function getProjectActivity(storage2, projectId, userId) {
|
|
252482
252543
|
const [
|
|
252483
252544
|
recentThreads,
|
|
@@ -252487,6 +252548,8 @@ async function getProjectActivity(storage2, projectId, userId) {
|
|
|
252487
252548
|
priorityTasks,
|
|
252488
252549
|
localAttentionSessions,
|
|
252489
252550
|
remoteAttentionSessions,
|
|
252551
|
+
localStarredSessions,
|
|
252552
|
+
remoteStarredSessions,
|
|
252490
252553
|
attentionRuns,
|
|
252491
252554
|
runningSessions,
|
|
252492
252555
|
runningRuns,
|
|
@@ -252500,6 +252563,8 @@ async function getProjectActivity(storage2, projectId, userId) {
|
|
|
252500
252563
|
storage2.tasks.listPriorityByProject(projectId, PRIORITY_TASK_LIMIT),
|
|
252501
252564
|
storage2.agentSessions.listAttentionActivityByProject(projectId, ATTENTION_LIMIT, "project-activity"),
|
|
252502
252565
|
storage2.searchCache.listRemoteSessionAttentionByProject(projectId, ATTENTION_LIMIT, "project-activity"),
|
|
252566
|
+
storage2.agentSessions.listFavoritedActivityByProject(projectId, STARRED_LIMIT + 1, "project-activity"),
|
|
252567
|
+
storage2.searchCache.listRemoteSessionFavoritesByProject(projectId, STARRED_LIMIT + 1, "project-activity"),
|
|
252503
252568
|
storage2.scheduledTaskRuns.getAttentionByProject(projectId, ATTENTION_LIMIT),
|
|
252504
252569
|
storage2.agentSessions.countRunningActivityByProject(projectId),
|
|
252505
252570
|
storage2.scheduledTaskRuns.countByProjectStatuses(projectId, ["starting", "running"]),
|
|
@@ -252516,6 +252581,14 @@ async function getProjectActivity(storage2, projectId, userId) {
|
|
|
252516
252581
|
remoteAttentionSessions,
|
|
252517
252582
|
ATTENTION_LIMIT
|
|
252518
252583
|
);
|
|
252584
|
+
const starredProbe = mergeBy(
|
|
252585
|
+
localStarredSessions,
|
|
252586
|
+
remoteStarredSessions,
|
|
252587
|
+
STARRED_LIMIT + 1,
|
|
252588
|
+
(row) => row.favoritedAt ?? 0
|
|
252589
|
+
);
|
|
252590
|
+
const starredHasMore = starredProbe.length > STARRED_LIMIT;
|
|
252591
|
+
const starredSessions = starredProbe.slice(0, STARRED_LIMIT);
|
|
252519
252592
|
const attention = [
|
|
252520
252593
|
...attentionSessions.map((session) => ({
|
|
252521
252594
|
type: "agent_session",
|
|
@@ -252540,6 +252613,8 @@ async function getProjectActivity(storage2, projectId, userId) {
|
|
|
252540
252613
|
return {
|
|
252541
252614
|
recentThreads,
|
|
252542
252615
|
recentAgentSessions,
|
|
252616
|
+
starredSessions,
|
|
252617
|
+
starredHasMore,
|
|
252543
252618
|
recentScheduleRuns,
|
|
252544
252619
|
priorityTasks,
|
|
252545
252620
|
attention,
|