@vibedeckx/linux-x64 0.2.8 → 0.2.9
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 +64 -29
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -228800,7 +228800,7 @@ ${intent}` : null,
|
|
|
228800
228800
|
opts.taskContext ? `
|
|
228801
228801
|
## Original task
|
|
228802
228802
|
${opts.taskContext}` : null,
|
|
228803
|
-
|
|
228803
|
+
selfReportSection(opts.authorSelfReport),
|
|
228804
228804
|
opts.reviewFocus ? `
|
|
228805
228805
|
## Review focus (from the user)
|
|
228806
228806
|
${opts.reviewFocus}` : null,
|
|
@@ -228810,7 +228810,7 @@ ${opts.reviewFocus}` : null,
|
|
|
228810
228810
|
reviewTargetPromptLine(opts.target),
|
|
228811
228811
|
"- Judge correctness, completeness against the task, and code quality. Be specific: reference files and lines.",
|
|
228812
228812
|
"\nEnd your final message with a clear, actionable list of feedback items \u2014 or state explicitly that the work looks good.",
|
|
228813
|
-
brief ? "\n(review context: distilled intent brief + live workspace)" : hasExcerpt ? "\n(review context: deterministic excerpt of the source conversation + live workspace)" : "\n(review context: live workspace only \u2014 the source conversation was unavailable)"
|
|
228813
|
+
brief ? opts.authorSelfReport ? "\n(review context: distilled intent brief + author self-report + live workspace)" : "\n(review context: distilled intent brief + live workspace)" : hasExcerpt ? "\n(review context: deterministic excerpt of the source conversation + live workspace)" : "\n(review context: live workspace only \u2014 the source conversation was unavailable)"
|
|
228814
228814
|
].filter((l) => l !== null).join("\n");
|
|
228815
228815
|
}
|
|
228816
228816
|
function reviewTargetPromptLine(target) {
|
|
@@ -236197,6 +236197,10 @@ function parseReviewerAgentType(raw) {
|
|
|
236197
236197
|
if (raw === void 0) return void 0;
|
|
236198
236198
|
return typeof raw === "string" && REVIEWER_AGENT_TYPES.has(raw) ? raw : null;
|
|
236199
236199
|
}
|
|
236200
|
+
function normalizeIntentBrief(raw) {
|
|
236201
|
+
if (!raw?.trim()) return void 0;
|
|
236202
|
+
return raw.length > 8e3 ? raw.slice(0, 8e3) + "\u2026" : raw;
|
|
236203
|
+
}
|
|
236200
236204
|
function errStatus(err) {
|
|
236201
236205
|
if (!(err instanceof WorkflowError)) return null;
|
|
236202
236206
|
switch (err.code) {
|
|
@@ -236238,6 +236242,28 @@ async function routes18(fastify2) {
|
|
|
236238
236242
|
if (!project) return null;
|
|
236239
236243
|
return info;
|
|
236240
236244
|
};
|
|
236245
|
+
const distillIntentBrief = async (userId, sourceSessionId) => {
|
|
236246
|
+
try {
|
|
236247
|
+
let messages;
|
|
236248
|
+
if (sourceSessionId.startsWith("remote-")) {
|
|
236249
|
+
const remoteInfo = fastify2.remoteSessionMap.get(sourceSessionId);
|
|
236250
|
+
if (!remoteInfo) return void 0;
|
|
236251
|
+
const historyResult = await proxyAuto(
|
|
236252
|
+
remoteInfo,
|
|
236253
|
+
"GET",
|
|
236254
|
+
`/api/agent-sessions/${remoteInfo.remoteSessionId}`
|
|
236255
|
+
);
|
|
236256
|
+
if (!historyResult.ok) return void 0;
|
|
236257
|
+
messages = historyResult.data.messages ?? [];
|
|
236258
|
+
} else {
|
|
236259
|
+
messages = fastify2.agentSessionManager.getMessages(sourceSessionId);
|
|
236260
|
+
}
|
|
236261
|
+
return await generateIntentBrief(fastify2.storage, resolveUserId(userId), messages) ?? void 0;
|
|
236262
|
+
} catch (err) {
|
|
236263
|
+
console.warn("[WorkflowRuns] intent brief generation failed:", err);
|
|
236264
|
+
return void 0;
|
|
236265
|
+
}
|
|
236266
|
+
};
|
|
236241
236267
|
fastify2.post("/api/workflow-runs", async (req, reply) => {
|
|
236242
236268
|
const userId = requireAuth(req, reply);
|
|
236243
236269
|
if (userId === null) return;
|
|
@@ -236253,6 +236279,12 @@ async function routes18(fastify2) {
|
|
|
236253
236279
|
return reply.code(400).send({ error: "reviewerSessionId and reviewerAgentType are mutually exclusive" });
|
|
236254
236280
|
}
|
|
236255
236281
|
const reviewerSessionId = reviewerSessionIdRaw?.trim();
|
|
236282
|
+
const intentBriefRaw = req.body?.intentBrief;
|
|
236283
|
+
if (intentBriefRaw !== void 0 && typeof intentBriefRaw !== "string") {
|
|
236284
|
+
return reply.code(400).send({ error: "intentBrief must be a string" });
|
|
236285
|
+
}
|
|
236286
|
+
const clientProvidedBrief = intentBriefRaw !== void 0;
|
|
236287
|
+
const clientBrief = normalizeIntentBrief(intentBriefRaw);
|
|
236256
236288
|
if (sourceSessionId.startsWith("remote-")) {
|
|
236257
236289
|
const remoteInfo = fastify2.remoteSessionMap.get(sourceSessionId);
|
|
236258
236290
|
if (!remoteInfo) return reply.code(404).send({ error: "Session not found" });
|
|
@@ -236268,21 +236300,9 @@ async function routes18(fastify2) {
|
|
|
236268
236300
|
}
|
|
236269
236301
|
bareReviewerSessionId = reviewerInfo.remoteSessionId;
|
|
236270
236302
|
}
|
|
236271
|
-
let intentBrief2;
|
|
236272
|
-
if (!bareReviewerSessionId) {
|
|
236273
|
-
|
|
236274
|
-
const historyResult = await proxyAuto(
|
|
236275
|
-
remoteInfo,
|
|
236276
|
-
"GET",
|
|
236277
|
-
`/api/agent-sessions/${remoteInfo.remoteSessionId}`
|
|
236278
|
-
);
|
|
236279
|
-
if (historyResult.ok) {
|
|
236280
|
-
const messages = historyResult.data.messages ?? [];
|
|
236281
|
-
intentBrief2 = await generateIntentBrief(fastify2.storage, resolveUserId(userId), messages) ?? void 0;
|
|
236282
|
-
}
|
|
236283
|
-
} catch (err) {
|
|
236284
|
-
console.warn("[WorkflowRuns] intent brief generation failed (remote source):", err);
|
|
236285
|
-
}
|
|
236303
|
+
let intentBrief2 = clientBrief;
|
|
236304
|
+
if (!clientProvidedBrief && !bareReviewerSessionId) {
|
|
236305
|
+
intentBrief2 = await distillIntentBrief(userId, sourceSessionId);
|
|
236286
236306
|
}
|
|
236287
236307
|
const result = await proxyAuto(remoteInfo, "POST", "/api/path/workflow-runs", {
|
|
236288
236308
|
sourceSessionId: remoteInfo.remoteSessionId,
|
|
@@ -236356,17 +236376,9 @@ async function routes18(fastify2) {
|
|
|
236356
236376
|
if (branch !== void 0 && (branch || null) !== runBranch) {
|
|
236357
236377
|
return reply.code(400).send({ error: "branch does not match source session" });
|
|
236358
236378
|
}
|
|
236359
|
-
let intentBrief;
|
|
236360
|
-
if (!reviewerSessionId) {
|
|
236361
|
-
|
|
236362
|
-
intentBrief = await generateIntentBrief(
|
|
236363
|
-
fastify2.storage,
|
|
236364
|
-
resolveUserId(userId),
|
|
236365
|
-
fastify2.agentSessionManager.getMessages(sourceSessionId)
|
|
236366
|
-
) ?? void 0;
|
|
236367
|
-
} catch (err) {
|
|
236368
|
-
console.warn("[WorkflowRuns] intent brief generation failed (local source):", err);
|
|
236369
|
-
}
|
|
236379
|
+
let intentBrief = clientBrief;
|
|
236380
|
+
if (!clientProvidedBrief && !reviewerSessionId) {
|
|
236381
|
+
intentBrief = await distillIntentBrief(userId, sourceSessionId);
|
|
236370
236382
|
}
|
|
236371
236383
|
try {
|
|
236372
236384
|
const run2 = await fastify2.workflowEngine.startAdhocReview({
|
|
@@ -236386,6 +236398,29 @@ async function routes18(fastify2) {
|
|
|
236386
236398
|
throw err;
|
|
236387
236399
|
}
|
|
236388
236400
|
});
|
|
236401
|
+
fastify2.post("/api/workflow-runs/intent-brief", async (req, reply) => {
|
|
236402
|
+
const userId = requireAuth(req, reply);
|
|
236403
|
+
if (userId === null) return;
|
|
236404
|
+
const { projectId, sourceSessionId } = req.body ?? {};
|
|
236405
|
+
if (!projectId || !sourceSessionId) {
|
|
236406
|
+
return reply.code(400).send({ error: "projectId and sourceSessionId are required" });
|
|
236407
|
+
}
|
|
236408
|
+
const project = await fastify2.storage.projects.getById(projectId, userId);
|
|
236409
|
+
if (!project) return reply.code(404).send({ error: "Project not found" });
|
|
236410
|
+
if (sourceSessionId.startsWith("remote-")) {
|
|
236411
|
+
const remoteInfo = fastify2.remoteSessionMap.get(sourceSessionId);
|
|
236412
|
+
if (!remoteInfo || projectIdFromRemoteSessionId(sourceSessionId, remoteInfo) !== projectId) {
|
|
236413
|
+
return reply.code(404).send({ error: "Session not found" });
|
|
236414
|
+
}
|
|
236415
|
+
} else {
|
|
236416
|
+
const session = await fastify2.storage.agentSessions.getById(sourceSessionId);
|
|
236417
|
+
if (!session || session.project_id !== projectId) {
|
|
236418
|
+
return reply.code(404).send({ error: "Session not found" });
|
|
236419
|
+
}
|
|
236420
|
+
}
|
|
236421
|
+
const brief = await distillIntentBrief(userId, sourceSessionId);
|
|
236422
|
+
return reply.send({ brief: brief ?? null });
|
|
236423
|
+
});
|
|
236389
236424
|
fastify2.get("/api/workflow-runs/reviewer-candidate", async (req, reply) => {
|
|
236390
236425
|
const userId = requireAuth(req, reply);
|
|
236391
236426
|
if (userId === null) return;
|
|
@@ -236559,7 +236594,7 @@ async function routes18(fastify2) {
|
|
|
236559
236594
|
if (intentBriefRaw !== void 0 && typeof intentBriefRaw !== "string") {
|
|
236560
236595
|
return reply.code(400).send({ error: "intentBrief must be a string" });
|
|
236561
236596
|
}
|
|
236562
|
-
const intentBrief =
|
|
236597
|
+
const intentBrief = normalizeIntentBrief(intentBriefRaw);
|
|
236563
236598
|
const reviewerAgentType = parseReviewerAgentType(req.body?.reviewerAgentType);
|
|
236564
236599
|
if (reviewerAgentType === null) return reply.code(400).send({ error: "reviewerAgentType must be one of: claude-code, codex" });
|
|
236565
236600
|
const reviewerSessionIdRaw = req.body?.reviewerSessionId;
|