@staff0rd/assist 0.1084.0 → 0.1085.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/dist/built-version +1 -1
- package/dist/commands/sessions/web/bundle.js +350 -350
- package/dist/index.js +190 -52
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.1085.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -841,6 +841,7 @@ var assistConfigShape = {
|
|
|
841
841
|
}).optional(),
|
|
842
842
|
review: z6.strictObject({
|
|
843
843
|
codexModel: z6.string().optional(),
|
|
844
|
+
synthesisHarness: z6.enum(["claude", "codex"]).optional(),
|
|
844
845
|
highLevel: z6.strictObject({
|
|
845
846
|
criticalPaths: z6.array(z6.string()).default(defaultCriticalPaths),
|
|
846
847
|
uiPaths: z6.array(z6.string()).default([]),
|
|
@@ -6715,6 +6716,11 @@ var reviewConfigHelp = [
|
|
|
6715
6716
|
setter: "assist config set review.codexModel gpt-5-codex",
|
|
6716
6717
|
note: "optional; runs the codex reviewer on this model via the LiteLLM proxy (needs litellm.baseUrl and litellm.apiKey)"
|
|
6717
6718
|
},
|
|
6719
|
+
{
|
|
6720
|
+
key: "review.synthesisHarness",
|
|
6721
|
+
setter: "assist config set review.synthesisHarness <claude|codex>",
|
|
6722
|
+
note: "harness that consolidates the two reviews (default claude); codex falls back to claude when the codex CLI is not on PATH"
|
|
6723
|
+
},
|
|
6718
6724
|
{
|
|
6719
6725
|
key: "review.highLevel.criticalPaths",
|
|
6720
6726
|
setter: 'assist config set review.highLevel.criticalPaths "**/*.graphql,en-AU/translation.json"',
|
|
@@ -8747,12 +8753,20 @@ async function handleItemRoute(req, res, pathname) {
|
|
|
8747
8753
|
return false;
|
|
8748
8754
|
}
|
|
8749
8755
|
|
|
8756
|
+
// src/commands/sessions/shared/newTraceId.ts
|
|
8757
|
+
import { randomUUID as randomUUID2 } from "crypto";
|
|
8758
|
+
var TRACE_HEADER = "x-assist-trace-id";
|
|
8759
|
+
function newTraceId() {
|
|
8760
|
+
return randomUUID2().slice(0, 8);
|
|
8761
|
+
}
|
|
8762
|
+
|
|
8750
8763
|
// src/commands/sessions/web/allowAppOrigin.ts
|
|
8751
8764
|
function allowAppOrigin(req, res, pathname) {
|
|
8752
8765
|
const origin = req.headers.origin;
|
|
8753
8766
|
if (!pathname.startsWith("/api/") || !isAppOrigin(origin)) return false;
|
|
8754
8767
|
res.setHeader("Access-Control-Allow-Origin", origin);
|
|
8755
8768
|
res.setHeader("Vary", "Origin");
|
|
8769
|
+
res.setHeader("Access-Control-Expose-Headers", TRACE_HEADER);
|
|
8756
8770
|
if (req.method !== "OPTIONS") return false;
|
|
8757
8771
|
res.setHeader("Access-Control-Allow-Methods", "GET, POST, PATCH, DELETE");
|
|
8758
8772
|
res.setHeader(
|
|
@@ -8823,13 +8837,6 @@ function findLinkSpec(name) {
|
|
|
8823
8837
|
return loadLinkSpecs().find((spec) => spec.name === name);
|
|
8824
8838
|
}
|
|
8825
8839
|
|
|
8826
|
-
// src/commands/sessions/shared/newTraceId.ts
|
|
8827
|
-
import { randomUUID as randomUUID2 } from "crypto";
|
|
8828
|
-
var TRACE_HEADER = "x-assist-trace-id";
|
|
8829
|
-
function newTraceId() {
|
|
8830
|
-
return randomUUID2().slice(0, 8);
|
|
8831
|
-
}
|
|
8832
|
-
|
|
8833
8840
|
// src/commands/sessions/shared/viaDaemonLinkPaths.ts
|
|
8834
8841
|
var LINK_UPDATE_STATUS_PATH = "/api/updates/link-status";
|
|
8835
8842
|
var RESTART_WEB_VIA_LINK_PATH = "/api/updates/restart-web";
|
|
@@ -8851,7 +8858,8 @@ function boundUpstream(upstream, res, timeoutMs) {
|
|
|
8851
8858
|
() => upstream.destroy(new Error(`no response after ${timeoutMs}ms`))
|
|
8852
8859
|
);
|
|
8853
8860
|
res.on("close", () => {
|
|
8854
|
-
if (!res.writableFinished)
|
|
8861
|
+
if (!res.writableFinished)
|
|
8862
|
+
upstream.destroy(new Error("client closed the request"));
|
|
8855
8863
|
});
|
|
8856
8864
|
}
|
|
8857
8865
|
|
|
@@ -8877,7 +8885,11 @@ function relayPeerResponse(peer, res, pathname, log2, done2) {
|
|
|
8877
8885
|
res.writeHead(status2, peer.headers);
|
|
8878
8886
|
peer.pipe(res);
|
|
8879
8887
|
peer.on("end", done2);
|
|
8880
|
-
peer.on("error",
|
|
8888
|
+
peer.on("error", (error) => {
|
|
8889
|
+
log2(`${status2} then failed mid-response: ${error.message}`);
|
|
8890
|
+
res.destroy();
|
|
8891
|
+
done2();
|
|
8892
|
+
});
|
|
8881
8893
|
}
|
|
8882
8894
|
|
|
8883
8895
|
// src/commands/sessions/web/forwardToPeer.ts
|
|
@@ -8888,6 +8900,7 @@ function forwardToPeer(req, res, node, url) {
|
|
|
8888
8900
|
const label = `link ${node} http: ${req.method} ${url.pathname} trace=${traceId}`;
|
|
8889
8901
|
const log2 = (outcome) => console.log(`${label} -> ${outcome} (${Date.now() - started2}ms)`);
|
|
8890
8902
|
const send2 = url.protocol === "https:" ? httpsRequest : httpRequest;
|
|
8903
|
+
res.setHeader(TRACE_HEADER, traceId);
|
|
8891
8904
|
return new Promise((resolve34) => {
|
|
8892
8905
|
const upstream = send2(
|
|
8893
8906
|
url,
|
|
@@ -10367,12 +10380,20 @@ var HARNESS_LABELS = {
|
|
|
10367
10380
|
codex: "Codex",
|
|
10368
10381
|
pi: "pi"
|
|
10369
10382
|
};
|
|
10383
|
+
var HARNESS_PRODUCT_LABELS = {
|
|
10384
|
+
claude: "Claude Code",
|
|
10385
|
+
codex: "Codex",
|
|
10386
|
+
pi: "pi"
|
|
10387
|
+
};
|
|
10370
10388
|
function resolveHarness(harness) {
|
|
10371
10389
|
return harness ?? "claude";
|
|
10372
10390
|
}
|
|
10373
10391
|
function harnessLabel(harness) {
|
|
10374
10392
|
return HARNESS_LABELS[resolveHarness(harness)];
|
|
10375
10393
|
}
|
|
10394
|
+
function harnessProductLabel(harness) {
|
|
10395
|
+
return HARNESS_PRODUCT_LABELS[resolveHarness(harness)];
|
|
10396
|
+
}
|
|
10376
10397
|
|
|
10377
10398
|
// src/shared/usageWindowKey.ts
|
|
10378
10399
|
var RATE_LIMIT_WINDOWS = ["five_hour", "seven_day"];
|
|
@@ -17706,6 +17727,18 @@ function registerAskDesign(program) {
|
|
|
17706
17727
|
// src/commands/askQuestion.ts
|
|
17707
17728
|
import { randomUUID as randomUUID7 } from "crypto";
|
|
17708
17729
|
|
|
17730
|
+
// src/lib/activeHarness.ts
|
|
17731
|
+
var declaredByHookEntryPoint;
|
|
17732
|
+
function markActiveHarness(harness) {
|
|
17733
|
+
declaredByHookEntryPoint = harness;
|
|
17734
|
+
}
|
|
17735
|
+
function activeHarness() {
|
|
17736
|
+
if (declaredByHookEntryPoint) return declaredByHookEntryPoint;
|
|
17737
|
+
if (isClaudeCode()) return "claude";
|
|
17738
|
+
if (isCodex()) return "codex";
|
|
17739
|
+
return void 0;
|
|
17740
|
+
}
|
|
17741
|
+
|
|
17709
17742
|
// src/commands/askQuestion/formatAskQuestionAnswers.ts
|
|
17710
17743
|
function formatAskQuestionAnswers(questions, answers) {
|
|
17711
17744
|
const pairs = questions.map(({ question }) => `"${question}"="${answers[question] ?? ""}"`).join(", ");
|
|
@@ -17774,7 +17807,8 @@ async function askQuestion(options2) {
|
|
|
17774
17807
|
useBuiltIn(
|
|
17775
17808
|
`session ${sessionId2} is not live in the assist daemon, so no preview pane can show the form`
|
|
17776
17809
|
);
|
|
17777
|
-
const
|
|
17810
|
+
const agent = harnessLabel(activeHarness());
|
|
17811
|
+
const title = questions.length === 1 ? `${agent} is asking a question` : `${agent} is asking ${questions.length} questions`;
|
|
17778
17812
|
const decision = await awaitPreviewApproval(
|
|
17779
17813
|
title,
|
|
17780
17814
|
{
|
|
@@ -23922,18 +23956,6 @@ import { existsSync as existsSync51, readFileSync as readFileSync33 } from "fs";
|
|
|
23922
23956
|
import { homedir as homedir18 } from "os";
|
|
23923
23957
|
import { join as join57 } from "path";
|
|
23924
23958
|
|
|
23925
|
-
// src/lib/activeHarness.ts
|
|
23926
|
-
var declaredByHookEntryPoint;
|
|
23927
|
-
function markActiveHarness(harness) {
|
|
23928
|
-
declaredByHookEntryPoint = harness;
|
|
23929
|
-
}
|
|
23930
|
-
function activeHarness() {
|
|
23931
|
-
if (declaredByHookEntryPoint) return declaredByHookEntryPoint;
|
|
23932
|
-
if (isClaudeCode()) return "claude";
|
|
23933
|
-
if (isCodex()) return "codex";
|
|
23934
|
-
return void 0;
|
|
23935
|
-
}
|
|
23936
|
-
|
|
23937
23959
|
// src/shared/readCodexRulePerms.ts
|
|
23938
23960
|
import { existsSync as existsSync50, readdirSync as readdirSync9, readFileSync as readFileSync32 } from "fs";
|
|
23939
23961
|
import { join as join56 } from "path";
|
|
@@ -25928,6 +25950,28 @@ function backlogRefError(subject, context, ids) {
|
|
|
25928
25950
|
return `Error: ${subject} must not reference assist backlog items (found ${refs}). Do not include assist references or backlog numbers in ${context} \u2014 the backlog item links to your work, not the other way around.`;
|
|
25929
25951
|
}
|
|
25930
25952
|
|
|
25953
|
+
// src/shared/findHarnessAttribution.ts
|
|
25954
|
+
var HARNESS_ATTRIBUTION_PHRASES = [
|
|
25955
|
+
"co-authored-by: codex",
|
|
25956
|
+
"generated with codex",
|
|
25957
|
+
"generated with [codex]",
|
|
25958
|
+
"noreply@openai.com"
|
|
25959
|
+
];
|
|
25960
|
+
function findHarnessAttribution(text20) {
|
|
25961
|
+
const lower = text20.toLowerCase();
|
|
25962
|
+
return HARNESS_ATTRIBUTION_PHRASES.find((phrase) => lower.includes(phrase));
|
|
25963
|
+
}
|
|
25964
|
+
|
|
25965
|
+
// src/shared/rejectHarnessAttribution.ts
|
|
25966
|
+
function rejectHarnessAttribution(label, text20) {
|
|
25967
|
+
const phrase = findHarnessAttribution(text20);
|
|
25968
|
+
if (!phrase) return;
|
|
25969
|
+
console.error(
|
|
25970
|
+
`Error: ${label} must not contain coding-agent attribution ("${phrase}")`
|
|
25971
|
+
);
|
|
25972
|
+
process.exit(1);
|
|
25973
|
+
}
|
|
25974
|
+
|
|
25931
25975
|
// src/commands/commit/validateMessage.ts
|
|
25932
25976
|
var MAX_MESSAGE_LENGTH = 50;
|
|
25933
25977
|
var CONVENTIONAL_COMMIT_REGEX = /^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(!)?(\(.+\))?!?: .+$/;
|
|
@@ -25936,6 +25980,7 @@ function validateMessage(message3, config) {
|
|
|
25936
25980
|
console.error("Error: Commit message must not reference Claude");
|
|
25937
25981
|
process.exit(1);
|
|
25938
25982
|
}
|
|
25983
|
+
rejectHarnessAttribution("Commit message", message3);
|
|
25939
25984
|
if (message3.includes("\n")) {
|
|
25940
25985
|
console.error(
|
|
25941
25986
|
"Error: Commit message must be a single line; use --ref to add a reference trailer"
|
|
@@ -31105,6 +31150,8 @@ function validateProposedContent(labels, title, body) {
|
|
|
31105
31150
|
console.error(`Error: ${subject} body must not reference Claude`);
|
|
31106
31151
|
process.exit(1);
|
|
31107
31152
|
}
|
|
31153
|
+
rejectHarnessAttribution(`${subject} title`, title);
|
|
31154
|
+
rejectHarnessAttribution(`${subject} body`, body);
|
|
31108
31155
|
const titleBacklogIds = findBacklogRefs(title);
|
|
31109
31156
|
if (titleBacklogIds.length > 0) {
|
|
31110
31157
|
console.error(
|
|
@@ -35522,6 +35569,7 @@ function validateBody(body) {
|
|
|
35522
35569
|
console.error('Error: Body must not contain "claude" or "opus"');
|
|
35523
35570
|
process.exit(1);
|
|
35524
35571
|
}
|
|
35572
|
+
rejectHarnessAttribution("Body", body);
|
|
35525
35573
|
}
|
|
35526
35574
|
function validateLine(line) {
|
|
35527
35575
|
if (!Number.isInteger(line) || line < 1) {
|
|
@@ -36256,6 +36304,7 @@ function validateBody2(body) {
|
|
|
36256
36304
|
console.error('Error: Body must not contain "claude" or "opus"');
|
|
36257
36305
|
process.exit(1);
|
|
36258
36306
|
}
|
|
36307
|
+
rejectHarnessAttribution("Body", body);
|
|
36259
36308
|
}
|
|
36260
36309
|
async function reply(commentId, body) {
|
|
36261
36310
|
validateBody2(body);
|
|
@@ -36290,6 +36339,7 @@ function validateReason(reason4) {
|
|
|
36290
36339
|
console.error('Error: Reason must not contain "claude" or "opus"');
|
|
36291
36340
|
process.exit(1);
|
|
36292
36341
|
}
|
|
36342
|
+
rejectHarnessAttribution("Reason", reason4);
|
|
36293
36343
|
}
|
|
36294
36344
|
function validateShaReferences(reason4) {
|
|
36295
36345
|
const commitLinkPattern = /\[[0-9a-f]{7}\]\(https:\/\/(?:github\.com\/[^/]+\/[^/]+|dev\.azure\.com\/[^/]+\/[^/]+\/_git\/[^/]+)\/commit\/([0-9a-f]{40})\)/gi;
|
|
@@ -38859,22 +38909,24 @@ async function notify() {
|
|
|
38859
38909
|
const data = JSON.parse(inputData);
|
|
38860
38910
|
const { notification_type, cwd, message: message3 } = data;
|
|
38861
38911
|
const projectName = cwd?.split(/[/\\]/).pop() ?? "Unknown Project";
|
|
38912
|
+
const harness = activeHarness();
|
|
38913
|
+
const agent = harnessLabel(harness);
|
|
38862
38914
|
let title;
|
|
38863
38915
|
let body;
|
|
38864
38916
|
let sound;
|
|
38865
38917
|
switch (notification_type) {
|
|
38866
38918
|
case "permission_prompt":
|
|
38867
|
-
title =
|
|
38919
|
+
title = `${agent} needs permission`;
|
|
38868
38920
|
body = `${projectName} - ${message3 || "Permission required"}`;
|
|
38869
38921
|
sound = "Alarm";
|
|
38870
38922
|
break;
|
|
38871
38923
|
case "idle_prompt":
|
|
38872
|
-
title =
|
|
38924
|
+
title = `${agent} is waiting`;
|
|
38873
38925
|
body = `${projectName} - Waiting for your input`;
|
|
38874
38926
|
sound = "Reminder";
|
|
38875
38927
|
break;
|
|
38876
38928
|
default:
|
|
38877
|
-
title =
|
|
38929
|
+
title = harnessProductLabel(harness);
|
|
38878
38930
|
body = message3 ? `${projectName} - ${message3}` : projectName;
|
|
38879
38931
|
sound = "Default";
|
|
38880
38932
|
}
|
|
@@ -44335,20 +44387,32 @@ function carriedUnanchoredFindings(unanchored) {
|
|
|
44335
44387
|
return unanchored.filter((finding) => finding.source !== "already-raised");
|
|
44336
44388
|
}
|
|
44337
44389
|
|
|
44338
|
-
// src/commands/review/
|
|
44339
|
-
var
|
|
44340
|
-
|
|
44390
|
+
// src/commands/review/reviewerHarnesses.ts
|
|
44391
|
+
var reviewerHarnesses = [
|
|
44392
|
+
"claude",
|
|
44393
|
+
"codex"
|
|
44394
|
+
];
|
|
44395
|
+
var reviewerNameWords = {
|
|
44396
|
+
claude: ["claude", "opus"],
|
|
44397
|
+
codex: ["codex"]
|
|
44398
|
+
};
|
|
44399
|
+
|
|
44400
|
+
// src/commands/review/findingSourceValues.ts
|
|
44401
|
+
var findingSourceValues = [
|
|
44341
44402
|
"confirmed",
|
|
44342
44403
|
"disputed",
|
|
44343
|
-
|
|
44344
|
-
"codex-only",
|
|
44404
|
+
...reviewerHarnesses.map((harness) => `${harness}-only`),
|
|
44345
44405
|
"already-raised"
|
|
44346
44406
|
];
|
|
44407
|
+
var findingSourceEnum = findingSourceValues.join(" | ");
|
|
44408
|
+
|
|
44409
|
+
// src/commands/review/parseFindings.ts
|
|
44410
|
+
var SEVERITIES = ["blocker", "major", "minor", "nit"];
|
|
44347
44411
|
function isSeverity(value) {
|
|
44348
44412
|
return SEVERITIES.includes(value);
|
|
44349
44413
|
}
|
|
44350
44414
|
function isSource(value) {
|
|
44351
|
-
return
|
|
44415
|
+
return findingSourceValues.includes(value);
|
|
44352
44416
|
}
|
|
44353
44417
|
function extractField(block, field) {
|
|
44354
44418
|
const re = new RegExp(`^-\\s+${field}:\\s*(.*)$`, "im");
|
|
@@ -44480,7 +44544,7 @@ For each finding, emit one block in this exact format:
|
|
|
44480
44544
|
|
|
44481
44545
|
### Finding: <short title>
|
|
44482
44546
|
- Severity: blocker | major | minor | nit
|
|
44483
|
-
- Source:
|
|
44547
|
+
- Source: ${findingSourceEnum}
|
|
44484
44548
|
- Location: \`path/to/file.ext:LINE\` or \`n/a\` when not tied to a specific line
|
|
44485
44549
|
- Impact: one sentence on what could go wrong
|
|
44486
44550
|
- Recommendation: one or two sentences with a concrete change
|
|
@@ -44526,6 +44590,40 @@ Files:
|
|
|
44526
44590
|
`;
|
|
44527
44591
|
}
|
|
44528
44592
|
|
|
44593
|
+
// src/commands/review/resolveSynthesisHarness.ts
|
|
44594
|
+
function resolveSynthesisHarness() {
|
|
44595
|
+
const configured = loadConfig().review?.synthesisHarness ?? "claude";
|
|
44596
|
+
if (configured === "claude" || isHarnessAvailable(configured))
|
|
44597
|
+
return configured;
|
|
44598
|
+
console.error(
|
|
44599
|
+
`review.synthesisHarness is ${configured} but it is not on PATH; synthesising with claude.`
|
|
44600
|
+
);
|
|
44601
|
+
return "claude";
|
|
44602
|
+
}
|
|
44603
|
+
|
|
44604
|
+
// src/commands/review/runSynthesisReviewer.ts
|
|
44605
|
+
function runSynthesisReviewer(spec) {
|
|
44606
|
+
const name = "synthesis";
|
|
44607
|
+
if (spec.harness === "claude")
|
|
44608
|
+
return runClaudeReviewer({
|
|
44609
|
+
name,
|
|
44610
|
+
reviewDir: spec.reviewDir,
|
|
44611
|
+
stdin: spec.stdin,
|
|
44612
|
+
outputPath: spec.outputPath,
|
|
44613
|
+
spinner: spec.multi?.create("synthesis \u2014 starting")
|
|
44614
|
+
});
|
|
44615
|
+
const override = buildCodexModelArgs();
|
|
44616
|
+
return runCodexReviewer({
|
|
44617
|
+
name,
|
|
44618
|
+
stdin: spec.stdin,
|
|
44619
|
+
outputPath: spec.outputPath,
|
|
44620
|
+
override,
|
|
44621
|
+
spinner: spec.multi?.create(
|
|
44622
|
+
`${reviewerLabel("synthesis", override.model ?? "codex")} \u2014 starting`
|
|
44623
|
+
)
|
|
44624
|
+
});
|
|
44625
|
+
}
|
|
44626
|
+
|
|
44529
44627
|
// src/commands/review/synthesise.ts
|
|
44530
44628
|
function printSummary2(synthesisPath) {
|
|
44531
44629
|
const markdown = readFileSync58(synthesisPath, "utf8");
|
|
@@ -44539,9 +44637,8 @@ async function synthesise(paths, options2) {
|
|
|
44539
44637
|
printSummary2(paths.synthesisPath);
|
|
44540
44638
|
return cached2;
|
|
44541
44639
|
}
|
|
44542
|
-
const
|
|
44543
|
-
|
|
44544
|
-
name: "synthesis",
|
|
44640
|
+
const result = await runSynthesisReviewer({
|
|
44641
|
+
harness: resolveSynthesisHarness(),
|
|
44545
44642
|
reviewDir: paths.reviewDir,
|
|
44546
44643
|
stdin: buildSynthesisStdin(
|
|
44547
44644
|
paths.requestPath,
|
|
@@ -44549,7 +44646,7 @@ async function synthesise(paths, options2) {
|
|
|
44549
44646
|
paths.codexPath
|
|
44550
44647
|
),
|
|
44551
44648
|
outputPath: paths.synthesisPath,
|
|
44552
|
-
|
|
44649
|
+
multi: options2.multi
|
|
44553
44650
|
});
|
|
44554
44651
|
if (result.exitCode === 0) printSummary2(paths.synthesisPath);
|
|
44555
44652
|
return result;
|
|
@@ -45004,8 +45101,12 @@ async function chainAfterReview(prNumber, outcome, options2) {
|
|
|
45004
45101
|
|
|
45005
45102
|
// src/commands/review/sanitiseReviewerNames.ts
|
|
45006
45103
|
var REVIEWER_LABEL = "the reviewer";
|
|
45104
|
+
var NAME_PATTERNS = reviewerHarnesses.flatMap((harness) => reviewerNameWords[harness]).map((word) => new RegExp(`\\b${word}\\b`, "gi"));
|
|
45007
45105
|
function sanitiseReviewerNames(value) {
|
|
45008
|
-
return
|
|
45106
|
+
return NAME_PATTERNS.reduce(
|
|
45107
|
+
(text20, pattern2) => text20.replace(pattern2, REVIEWER_LABEL),
|
|
45108
|
+
value
|
|
45109
|
+
);
|
|
45009
45110
|
}
|
|
45010
45111
|
|
|
45011
45112
|
// src/commands/review/postFindings.ts
|
|
@@ -45357,7 +45458,7 @@ Read ${synthesisPath}. It contains a list of findings under the \`## Findings\`
|
|
|
45357
45458
|
|
|
45358
45459
|
### Finding: <short title>
|
|
45359
45460
|
- Severity: blocker | major | minor | nit
|
|
45360
|
-
- Source:
|
|
45461
|
+
- Source: ${findingSourceEnum}
|
|
45361
45462
|
- Location: \`path/to/file.ext:LINE\` or \`n/a\` when not tied to a specific line
|
|
45362
45463
|
- Impact: one sentence on what could go wrong
|
|
45363
45464
|
- Recommendation: one or two sentences with a concrete change
|
|
@@ -45427,7 +45528,7 @@ Each finding block must use this exact format so it parses correctly:
|
|
|
45427
45528
|
|
|
45428
45529
|
### Finding: <short title>
|
|
45429
45530
|
- Severity: blocker | major | minor | nit
|
|
45430
|
-
- Source:
|
|
45531
|
+
- Source: ${findingSourceEnum}
|
|
45431
45532
|
- Location: \`path/to/file.ext:LINE\` or \`n/a\` when not tied to a specific line
|
|
45432
45533
|
- Impact: one sentence on what could go wrong
|
|
45433
45534
|
- Recommendation: one or two sentences with a concrete change
|
|
@@ -55399,24 +55500,35 @@ function interactiveHarnessRespawn(session) {
|
|
|
55399
55500
|
);
|
|
55400
55501
|
}
|
|
55401
55502
|
|
|
55402
|
-
// src/commands/sessions/shared/codex/
|
|
55503
|
+
// src/commands/sessions/shared/codex/findCodexRolloutPathSync.ts
|
|
55403
55504
|
import * as fs55 from "fs";
|
|
55404
55505
|
import * as path109 from "path";
|
|
55405
55506
|
var DATE_DEPTH2 = 3;
|
|
55406
|
-
function
|
|
55407
|
-
if (!sessionId2) return
|
|
55408
|
-
return
|
|
55507
|
+
function findCodexRolloutPathSync(sessionId2) {
|
|
55508
|
+
if (!sessionId2) return null;
|
|
55509
|
+
return findRollout(codexSessionsDir(), DATE_DEPTH2, `-${sessionId2}.jsonl`);
|
|
55409
55510
|
}
|
|
55410
|
-
function
|
|
55511
|
+
function findRollout(dir, depth, suffix) {
|
|
55411
55512
|
let entries;
|
|
55412
55513
|
try {
|
|
55413
55514
|
entries = fs55.readdirSync(dir, { withFileTypes: true });
|
|
55414
55515
|
} catch {
|
|
55415
|
-
return
|
|
55516
|
+
return null;
|
|
55416
55517
|
}
|
|
55417
|
-
|
|
55418
|
-
|
|
55419
|
-
|
|
55518
|
+
for (const entry of entries) {
|
|
55519
|
+
const full = path109.join(dir, entry.name);
|
|
55520
|
+
if (entry.isDirectory()) {
|
|
55521
|
+
const found = depth > 0 ? findRollout(full, depth - 1, suffix) : null;
|
|
55522
|
+
if (found) return found;
|
|
55523
|
+
} else if (entry.name.startsWith("rollout-") && entry.name.endsWith(suffix))
|
|
55524
|
+
return full;
|
|
55525
|
+
}
|
|
55526
|
+
return null;
|
|
55527
|
+
}
|
|
55528
|
+
|
|
55529
|
+
// src/commands/sessions/shared/codex/hasCodexRolloutSync.ts
|
|
55530
|
+
function hasCodexRolloutSync(sessionId2) {
|
|
55531
|
+
return findCodexRolloutPathSync(sessionId2) !== null;
|
|
55420
55532
|
}
|
|
55421
55533
|
|
|
55422
55534
|
// src/commands/sessions/daemon/resumableConversationId.ts
|
|
@@ -55891,8 +56003,29 @@ function awaitsQuestionAnswer(entries) {
|
|
|
55891
56003
|
return hasPendingAskUserQuestion(events, lastDecisiveIndex(events)) || pendingAskQuestionTasks(entries).length > 0;
|
|
55892
56004
|
}
|
|
55893
56005
|
|
|
56006
|
+
// src/commands/sessions/shared/codex/deriveCodexRolloutStatus.ts
|
|
56007
|
+
var TURN_END_EVENTS = /* @__PURE__ */ new Set(["task_complete", "turn_aborted"]);
|
|
56008
|
+
function turnEvent(entry) {
|
|
56009
|
+
if (entry.type !== "event_msg") return null;
|
|
56010
|
+
const kind = rolloutPayload(entry).type;
|
|
56011
|
+
if (kind === "task_started") return "started";
|
|
56012
|
+
return typeof kind === "string" && TURN_END_EVENTS.has(kind) ? "ended" : null;
|
|
56013
|
+
}
|
|
56014
|
+
function hasAgentActivity(entries) {
|
|
56015
|
+
return entries.some((entry) => entry.type === "response_item");
|
|
56016
|
+
}
|
|
56017
|
+
function deriveCodexRolloutStatus(entries) {
|
|
56018
|
+
for (let i = entries.length - 1; i >= 0; i--) {
|
|
56019
|
+
const event = turnEvent(entries[i]);
|
|
56020
|
+
if (event) return event === "started" ? "running" : "waiting";
|
|
56021
|
+
}
|
|
56022
|
+
return hasAgentActivity(entries) ? "running" : "waiting";
|
|
56023
|
+
}
|
|
56024
|
+
|
|
55894
56025
|
// src/commands/sessions/daemon/deriveRestoreStatus.ts
|
|
55895
56026
|
function deriveRestoreStatus(persisted) {
|
|
56027
|
+
if (resolveHarness(persisted.harness) === "codex")
|
|
56028
|
+
return deriveCodexRestoreStatus(persisted.harnessSessionId);
|
|
55896
56029
|
if (!persisted.claudeSessionId) return "waiting";
|
|
55897
56030
|
const filePath = findTranscriptPathSync(
|
|
55898
56031
|
persisted.cwd,
|
|
@@ -55903,6 +56036,11 @@ function deriveRestoreStatus(persisted) {
|
|
|
55903
56036
|
if (deriveTranscriptStatus(entries) === "running") return "running";
|
|
55904
56037
|
return awaitsQuestionAnswer(entries) ? "asking" : "waiting";
|
|
55905
56038
|
}
|
|
56039
|
+
function deriveCodexRestoreStatus(harnessSessionId) {
|
|
56040
|
+
const filePath = harnessSessionId ? findCodexRolloutPathSync(harnessSessionId) : null;
|
|
56041
|
+
if (!filePath) return "waiting";
|
|
56042
|
+
return deriveCodexRolloutStatus(readTranscriptTailSync(filePath));
|
|
56043
|
+
}
|
|
55906
56044
|
|
|
55907
56045
|
// src/commands/sessions/daemon/createAssistSession.ts
|
|
55908
56046
|
function createAssistSession(id, assistArgs, cwd, meta, holdPty) {
|
|
@@ -60094,7 +60232,7 @@ function registerOutputCommand(cmd) {
|
|
|
60094
60232
|
function registerSetStatusCommand(cmd) {
|
|
60095
60233
|
internalCommand(
|
|
60096
60234
|
cmd.command("set-status <status>").description(
|
|
60097
|
-
"Report the current session's status to the sessions daemon (used by Claude Code hooks)"
|
|
60235
|
+
"Report the current session's status to the sessions daemon (used by Claude Code and Codex hooks)"
|
|
60098
60236
|
).option(
|
|
60099
60237
|
"--source <source>",
|
|
60100
60238
|
"Originating hook (permission, stop, notification, prompt, pretool, posttool)"
|
|
@@ -60104,7 +60242,7 @@ function registerSetStatusCommand(cmd) {
|
|
|
60104
60242
|
).action(
|
|
60105
60243
|
(status2, options2) => setSessionStatus(status2, { source: options2.source, ack: options2.ack })
|
|
60106
60244
|
),
|
|
60107
|
-
"Claude hooks"
|
|
60245
|
+
"Claude and Codex hooks"
|
|
60108
60246
|
);
|
|
60109
60247
|
}
|
|
60110
60248
|
|
|
@@ -60126,7 +60264,7 @@ async function renameSession(title) {
|
|
|
60126
60264
|
|
|
60127
60265
|
// src/commands/sessions/registerSessions.ts
|
|
60128
60266
|
function registerSessions(program) {
|
|
60129
|
-
const cmd = program.command("sessions").description("Web dashboard for
|
|
60267
|
+
const cmd = program.command("sessions").description("Web dashboard for coding agent sessions").option("--no-open", "Do not open a browser on startup").action(
|
|
60130
60268
|
(_options, command) => web({ port: "3100", open: command.optsWithGlobals().open })
|
|
60131
60269
|
);
|
|
60132
60270
|
const webCmd = cmd.command("web").description("Start the sessions web dashboard").option("-p, --port <number>", "Port to listen on", "3100").option("--no-open", "Do not open a browser on startup").action(
|