agents-relay 2.0.214 → 2.0.215
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/cli-help.js
CHANGED
|
@@ -102,7 +102,7 @@ When provided, --thread-id persists a reviewer destination; otherwise the Job re
|
|
|
102
102
|
Managed host interaction (Node Wrapper normally calls these automatically):
|
|
103
103
|
agents-relay review interactive begin --id JOB --task-id TASK --execution-id EXEC
|
|
104
104
|
agents-relay review interactive wait --id JOB --task-id TASK --execution-id EXEC --invocation-id INV
|
|
105
|
-
agents-relay review interactive ready --id JOB --task-id TASK --execution-id EXEC --invocation-id INV --revision
|
|
105
|
+
agents-relay review interactive ready --id JOB --task-id TASK --execution-id EXEC --invocation-id INV --revision GIT_COMMIT_SHA
|
|
106
106
|
agents-relay review interactive fail --id JOB --task-id TASK --execution-id EXEC --invocation-id INV --reason REASON
|
|
107
107
|
agents-relay review interactive abort --id JOB --task-id TASK --execution-id EXEC --invocation-id INV
|
|
108
108
|
The CLI controls the running Relay daemon; this is not a separate Worker step.`,
|
package/dist/cli-review.js
CHANGED
|
@@ -22,8 +22,8 @@ export async function runInteractiveReviewCommand(argv) {
|
|
|
22
22
|
if (action !== 'begin' && !invocationId)
|
|
23
23
|
throw new Error('review interactive ' + action + ' requires --invocation-id');
|
|
24
24
|
const revision = arg(args, '--revision');
|
|
25
|
-
if (action === 'ready' && !/^[a-f0-9]{
|
|
26
|
-
throw new Error('review interactive ready requires
|
|
25
|
+
if (action === 'ready' && !/^[a-f0-9]{40}$/.test(revision))
|
|
26
|
+
throw new Error('review interactive ready requires full 40-character Git Commit SHA');
|
|
27
27
|
if (action === 'fail' && !arg(args, '--reason').trim())
|
|
28
28
|
throw new Error('review interactive fail requires --reason');
|
|
29
29
|
const body = { command: `review.interactive.${action}`, jobId, taskId, executionId };
|
|
@@ -54,11 +54,15 @@ export function normalizeInteractiveDecision(event) {
|
|
|
54
54
|
return null;
|
|
55
55
|
if (event.source?.id !== `job/${jobId}/task/${taskId}/execution/${executionId}`)
|
|
56
56
|
return null;
|
|
57
|
-
if (value.contentHash !== undefined && typeof value.feedback !== 'string')
|
|
58
|
-
return null;
|
|
59
57
|
const feedback = typeof value.feedback === 'string' ? value.feedback : null;
|
|
58
|
+
const commitSha = string('commitSha');
|
|
60
59
|
const contentHash = string('contentHash');
|
|
61
|
-
if (
|
|
60
|
+
if (commitSha) {
|
|
61
|
+
if (!/^[a-f0-9]{40}$/.test(commitSha) || revision !== commitSha ||
|
|
62
|
+
value.contentHash !== undefined || value.revisionId !== undefined || feedback === null)
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
else if (contentHash && (contentHash !== revision || feedback === null))
|
|
62
66
|
return null;
|
|
63
67
|
const comments = value.comments;
|
|
64
68
|
if (comments !== undefined && (!Array.isArray(comments) || comments.length > 100 ||
|
|
@@ -68,6 +72,7 @@ export function normalizeInteractiveDecision(event) {
|
|
|
68
72
|
return {
|
|
69
73
|
jobId, taskId, executionId, invocationId, revision, decision,
|
|
70
74
|
feedback: feedback ?? undefined,
|
|
75
|
+
commitSha: commitSha ?? undefined,
|
|
71
76
|
contentHash: contentHash ?? undefined, revisionId: string('revisionId') ?? undefined,
|
|
72
77
|
previewId: string('previewId') ?? undefined, requestId: string('requestId') ?? undefined,
|
|
73
78
|
idempotencyKey: string('idempotencyKey') ?? undefined,
|
|
@@ -88,11 +93,12 @@ export function interactiveDecisionFingerprint(decision) {
|
|
|
88
93
|
comments: decision.comments ?? null,
|
|
89
94
|
})).digest('hex');
|
|
90
95
|
}
|
|
91
|
-
/**
|
|
96
|
+
/** Event-only review identity is exactly one complete Git commit SHA. */
|
|
92
97
|
export function eventOnlyReviewEligible(delivery) {
|
|
93
|
-
return Boolean(delivery.
|
|
94
|
-
delivery.revision === delivery.
|
|
95
|
-
|
|
98
|
+
return Boolean(delivery.commitSha && /^[a-f0-9]{40}$/.test(delivery.commitSha) &&
|
|
99
|
+
delivery.revision === delivery.commitSha && !delivery.contentHash && !delivery.revisionId &&
|
|
100
|
+
delivery.feedback !== undefined &&
|
|
101
|
+
[delivery.requestId, delivery.idempotencyKey, delivery.invocationId]
|
|
96
102
|
.every(value => typeof value === 'string' && value.length > 0 && value.length <= 128));
|
|
97
103
|
}
|
|
98
104
|
function invocationState(invocation) {
|
|
@@ -57,8 +57,8 @@ export async function abortInteractiveReview(store, jobId, taskId, executionId,
|
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
export async function readyInteractiveReview(store, jobId, taskId, executionId, invocationId, revision) {
|
|
60
|
-
if (!/^[a-f0-9]{
|
|
61
|
-
throw new Error('Immutable revision must be SHA
|
|
60
|
+
if (!/^[a-f0-9]{40}$/.test(revision))
|
|
61
|
+
throw new Error('Immutable review revision must be full Git Commit SHA');
|
|
62
62
|
if (!store.mutateJob)
|
|
63
63
|
throw new Error('Interactive review requires durable mutation');
|
|
64
64
|
await store.mutateJob(jobId, job => {
|
package/package.json
CHANGED
|
@@ -161,6 +161,8 @@ A newly created zero-task DRAFT Job waits for explicit initial planning (`plan`
|
|
|
161
161
|
|
|
162
162
|
## Task evidence and head identity
|
|
163
163
|
|
|
164
|
+
For Git-versioned Neo Project Interactive Previews, bind a verified full 40-character Git Commit SHA as the sole review revision (`data.interactive.commitSha`, and `data.interactive.revision` must equal it). Compiled media cache hashes, legacy Markcut `revisionId` and `contentHash` must not be used as the Event Review identity. The Producer creates the Stage Commit before requesting Preview; Relay continues to own the decision and Task lifecycle. Generic non-video interactions are not made into Git commits by this contract.
|
|
165
|
+
|
|
164
166
|
### Canonical Neo Project runs boundary
|
|
165
167
|
|
|
166
168
|
`runs/` is durable runtime evidence, not source code and not temporary checkout state. When a Task's declared file output is under `runs/`, that Task and every semantic descendant execute directly in the canonical resolved project directory. Agents Relay MUST NOT create or switch those Tasks into per-execution Git worktrees.
|