@ccdd/project 2.0.1 → 2.0.2
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/README.md +8 -8
- package/dist/monitor-ui/assets/{GraphView-UjtW4QRC.js → GraphView-0hRu9REg.js} +3 -3
- package/dist/monitor-ui/assets/ValidationView-BuT1XOPJ.js +1 -0
- package/dist/monitor-ui/assets/ValidationView-p5r8lX18.css +1 -0
- package/dist/monitor-ui/assets/{elk-api-yRi2AOS6.js → elk-api-U8zu3SUU.js} +1 -1
- package/dist/monitor-ui/assets/{elk.bundled-CtLobQTy.js → elk.bundled-B5v2hKp_.js} +1 -1
- package/dist/monitor-ui/assets/index-SA3sxGLr.css +1 -0
- package/dist/monitor-ui/assets/{index-Cpm0fC0p.js → index-rUSYOSt7.js} +6 -6
- package/dist/monitor-ui/index.html +4 -4
- package/dist/scripts/prepare-demo.js +16 -16
- package/dist/scripts/prepare-demo.js.map +1 -1
- package/dist/src/broker/index.js +2 -1
- package/dist/src/broker/index.js.map +1 -1
- package/dist/src/cli.js +2 -2
- package/dist/src/cli.js.map +1 -1
- package/dist/src/doctor/index.js +16 -16
- package/dist/src/doctor/index.js.map +1 -1
- package/dist/src/executors/auth.js +7 -7
- package/dist/src/executors/auth.js.map +1 -1
- package/dist/src/executors/index.js +13 -13
- package/dist/src/executors/index.js.map +1 -1
- package/dist/src/executors/pi.js +24 -24
- package/dist/src/executors/pi.js.map +1 -1
- package/dist/src/monitor/actions.js +6 -6
- package/dist/src/monitor/actions.js.map +1 -1
- package/dist/src/monitor/server.js +67 -67
- package/dist/src/monitor/server.js.map +1 -1
- package/dist/src/monitor/store.js +24 -24
- package/dist/src/monitor/store.js.map +1 -1
- package/dist/src/monitor/ui/api.js +3 -3
- package/dist/src/monitor/ui/api.js.map +1 -1
- package/dist/src/monitor/ui/critic-presentation.js +12 -12
- package/dist/src/monitor/ui/critic-presentation.js.map +1 -1
- package/dist/src/monitor/ui/format.js +8 -8
- package/dist/src/monitor/ui/format.js.map +1 -1
- package/dist/src/monitor/ui/tool-input.js +9 -9
- package/dist/src/monitor/ui/tool-input.js.map +1 -1
- package/dist/src/project/store.js +3 -2
- package/dist/src/project/store.js.map +1 -1
- package/package.json +1 -1
- package/dist/monitor-ui/assets/ValidationView-CC1FvqUl.js +0 -1
- package/dist/monitor-ui/assets/ValidationView-DWl4b8Ug.css +0 -1
- package/dist/monitor-ui/assets/index-CUzg-dht.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pi.js","sourceRoot":"","sources":["../../../src/executors/pi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAiC,MAAM,+BAA+B,CAAC;AACrF,OAAO,EAAE,IAAI,EAAE,0BAA0B,EAAE,MAAM,EAAsC,MAAM,uBAAuB,CAAC;AACrH,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAsD,MAAM,oBAAoB,CAAC;AAE1H,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,iBAAiB,EAAkB,MAAM,WAAW,CAAC;AACpG,OAAO,EAAE,eAAe,IAAI,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAKvE,MAAM,OAAO,GAAG,aAAa,EAAE,CAAC;AAChC,MAAM,aAAa,GAAG,IAAI,OAAO,EAAS,CAAC;AAC3C,SAAS,eAAe,CAAC,IAAY,EAAE,OAAe,EAAE,MAAc;IACpE,MAAM,KAAK,GAAG,qBAAqB,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC3D,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzB,OAAO,KAAK,CAAC;AACf,CAAC;AACD,MAAM,MAAM,GAAG,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,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wF,CAAC,CAAC;QAAC,CAAC;QACxN,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,CAAC,SAAS,EAAE,CAAC;IAClD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,UAAU,EAAE,CAAC;QACb,IAAI,WAAW;YAAE,MAAM,WAAW,CAAC;QACnC,IAAI,KAAK,YAAY,KAAK,IAAI,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC;YAAE,MAAM,KAAK,CAAC;QACpE,MAAM,eAAe,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;YAAS,CAAC;QACT,YAAY,CAAC,KAAK,CAAC,CAAC;QACpB,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QAC5C,KAAK,EAAE,KAAK,EAAE,CAAC;QACf,MAAM,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC1B,CAAC;AACH,CAAC"}
|
|
@@ -17,21 +17,21 @@ export async function authorizeWorkspace(record) {
|
|
|
17
17
|
!isAbsolute(repoPath) || resolve(repoPath) !== repoPath || !isAbsolute(stateDir) || resolve(stateDir) !== stateDir ||
|
|
18
18
|
descriptor.sourcePath !== repoPath || descriptor.stateDir !== stateDir || await realpath(stateDir) !== stateDir ||
|
|
19
19
|
descriptor.path !== (descriptor.mode === 'copy' ? join(stateDir, 'workspaces', descriptor.hash) : repoPath)) {
|
|
20
|
-
throw new MonitorActionError(409, '
|
|
20
|
+
throw new MonitorActionError(409, 'The review input does not match the stored project information.');
|
|
21
21
|
}
|
|
22
22
|
if (descriptor.mode === 'lock' && await realpath(repoPath) !== repoPath)
|
|
23
|
-
throw new MonitorActionError(409, '
|
|
23
|
+
throw new MonitorActionError(409, 'The original workspace path has changed.');
|
|
24
24
|
}
|
|
25
25
|
function available(record, reviewerId, requireClaim) {
|
|
26
26
|
const request = record.request;
|
|
27
27
|
if (request.profile.kind !== 'human' || request.status !== 'WAITING_HUMAN')
|
|
28
|
-
throw new MonitorActionError(409, '
|
|
28
|
+
throw new MonitorActionError(409, 'This request is not currently available for Human review.');
|
|
29
29
|
if (request.claimedBy && request.claimedBy !== reviewerId)
|
|
30
|
-
throw new MonitorActionError(403, '
|
|
30
|
+
throw new MonitorActionError(403, 'Another reviewer has claimed this request.');
|
|
31
31
|
if (requireClaim && request.claimedBy !== reviewerId)
|
|
32
|
-
throw new MonitorActionError(403, '
|
|
32
|
+
throw new MonitorActionError(403, 'Claim the review in this browser first.');
|
|
33
33
|
if (requireClaim && !request.notifiedAt)
|
|
34
|
-
throw new MonitorActionError(409, '
|
|
34
|
+
throw new MonitorActionError(409, 'Checking review notification delivery. Please try again shortly.');
|
|
35
35
|
}
|
|
36
36
|
/** Mutations are explicitly requested; normal monitor reads never open a Broker. */
|
|
37
37
|
export async function claimReview(record, reviewerId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.js","sourceRoot":"","sources":["../../../src/monitor/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAItD,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IACtB,MAAM;IAA3B,YAAqB,MAAc,EAAE,OAAe;QAAI,KAAK,CAAC,OAAO,CAAC,CAAC;sBAAlD,MAAM;IAA6C,CAAC;CAC1E;AAED,2FAA2F;AAC3F,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,MAA4B;IACnE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACvD,MAAM,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;IACrC,IAAI,CAAC,UAAU,IAAI,OAAO,CAAC,MAAM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M,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAChD,IAAI,GAAG,EAAE,MAAM,KAAK,QAAQ;YAAE,MAAM,eAAe,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;IACxF,CAAC;YAAS,CAAC;QAAC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IAAC,CAAC;AACrC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,MAA4B,EAAE,UAAkB,EAAE,QAAgB,EAAE,IAA6B,EAAE,MAAmB;IAC5J,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;IACpC,MAAM,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACjC,MAAM,CAAC,cAAc,EAAE,CAAC;IACxB,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,CAAC;QAAC,OAAO,MAAM,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAAC,CAAC;YAC3G,CAAC;QAAC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IAAC,CAAC;AACnC,CAAC"}
|
|
@@ -18,7 +18,7 @@ class HttpError extends MonitorActionError {
|
|
|
18
18
|
function parameters(url, allowed) {
|
|
19
19
|
for (const name of url.searchParams.keys()) {
|
|
20
20
|
if (!allowed.includes(name) || url.searchParams.getAll(name).length !== 1)
|
|
21
|
-
throw new HttpError(400, '
|
|
21
|
+
throw new HttpError(400, 'Unknown or duplicate query parameter.');
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
function number(value, fallback, minimum, maximum) {
|
|
@@ -26,7 +26,7 @@ function number(value, fallback, minimum, maximum) {
|
|
|
26
26
|
return fallback;
|
|
27
27
|
const parsed = Number(value);
|
|
28
28
|
if (!/^\d+$/.test(value) || !Number.isSafeInteger(parsed) || parsed < minimum || parsed > maximum)
|
|
29
|
-
throw new HttpError(400,
|
|
29
|
+
throw new HttpError(400, `The query range must be an integer between ${minimum} and ${maximum}.`);
|
|
30
30
|
return parsed;
|
|
31
31
|
}
|
|
32
32
|
function id(value, maximumLength = 128) {
|
|
@@ -35,10 +35,10 @@ function id(value, maximumLength = 128) {
|
|
|
35
35
|
decoded = decodeURIComponent(value);
|
|
36
36
|
}
|
|
37
37
|
catch {
|
|
38
|
-
throw new HttpError(400, '
|
|
38
|
+
throw new HttpError(400, 'Invalid identifier.');
|
|
39
39
|
}
|
|
40
40
|
if (decoded.length > maximumLength || !identifier.test(decoded))
|
|
41
|
-
throw new HttpError(400, '
|
|
41
|
+
throw new HttpError(400, 'Invalid identifier.');
|
|
42
42
|
return decoded;
|
|
43
43
|
}
|
|
44
44
|
function errorCode(value) {
|
|
@@ -49,51 +49,51 @@ function safeError(value) {
|
|
|
49
49
|
return value;
|
|
50
50
|
const code = errorCode(value);
|
|
51
51
|
if (['WORKSPACE_CHANGED', 'WORKSPACE_CACHE_TAMPERED', 'WORKSPACE_ARTIFACT_MISMATCH'].includes(code ?? ''))
|
|
52
|
-
return new HttpError(409, '
|
|
52
|
+
return new HttpError(409, 'The review input has changed; this Artifact cannot be inspected.');
|
|
53
53
|
if (code === 'ENOENT' || code === 'ENOTDIR')
|
|
54
|
-
return new HttpError(409, '
|
|
54
|
+
return new HttpError(409, 'The stored review input could not be found. The original or copy may have been moved or deleted.');
|
|
55
55
|
if (code === 'HUMAN_TOOL_UNAVAILABLE')
|
|
56
|
-
return new HttpError(409, '
|
|
56
|
+
return new HttpError(409, 'Unable to start the registered program. Check its installation and tool settings.');
|
|
57
57
|
if (code === 'HUMAN_TOOL_FAILED')
|
|
58
|
-
return new HttpError(409, '
|
|
58
|
+
return new HttpError(409, 'The registered program did not finish successfully. Check the program and tool settings.');
|
|
59
59
|
if (code === 'HUMAN_TOOL_TIMEOUT')
|
|
60
|
-
return new HttpError(504, '
|
|
60
|
+
return new HttpError(504, 'The registered program timed out.');
|
|
61
61
|
if (code === 'ARTIFACT_TOOL_TIMEOUT')
|
|
62
|
-
return new HttpError(504, '
|
|
62
|
+
return new HttpError(504, 'The tool timed out.');
|
|
63
63
|
if (code === 'ARTIFACT_TOOL_FAILED')
|
|
64
|
-
return new HttpError(409, '
|
|
64
|
+
return new HttpError(409, 'Unable to run the tool. Check the input and registered program, then try again.');
|
|
65
65
|
if (code === 'UNKNOWN_ARTIFACT_TOOL')
|
|
66
|
-
return new HttpError(400, '
|
|
66
|
+
return new HttpError(400, 'This tool is not registered for this Artifact.');
|
|
67
67
|
if (code === 'ABORTED')
|
|
68
|
-
return new HttpError(409, '
|
|
68
|
+
return new HttpError(409, 'Tool execution was aborted.');
|
|
69
69
|
if (code === 'EACCES' || code === 'EPERM')
|
|
70
|
-
return new HttpError(409, '
|
|
70
|
+
return new HttpError(409, 'Permission denied when reading the review input.');
|
|
71
71
|
const message = value instanceof Error ? value.message : '';
|
|
72
72
|
if (/claimed|reviewer who/i.test(message))
|
|
73
|
-
return new HttpError(403, '
|
|
73
|
+
return new HttpError(403, 'You can only act on reviews claimed in this browser.');
|
|
74
74
|
if (/waiting for a human|already completed|alarm delivery|lock review requires/i.test(message))
|
|
75
|
-
return new HttpError(409, '
|
|
75
|
+
return new HttpError(409, 'The review status has changed or the review is not ready yet. Refresh the list.');
|
|
76
76
|
if (/worker|saved.*configuration|saved.*settings/i.test(message))
|
|
77
|
-
return new HttpError(503, '
|
|
78
|
-
return new HttpError(400, '
|
|
77
|
+
return new HttpError(503, 'Unable to start the worker for the next review. Check the saved execution settings and resume the Run.');
|
|
78
|
+
return new HttpError(400, 'Unable to read the requested Artifact range. Check the file path and read range.');
|
|
79
79
|
}
|
|
80
80
|
function protect(request, port) {
|
|
81
81
|
const host = request.headers.host;
|
|
82
82
|
const hosts = [`127.0.0.1:${port}`, `localhost:${port}`];
|
|
83
83
|
if (!host || !hosts.includes(host))
|
|
84
|
-
throw new HttpError(403, '
|
|
84
|
+
throw new HttpError(403, 'Connect using the local address of this monitor.');
|
|
85
85
|
const origin = request.headers.origin;
|
|
86
86
|
if (origin !== undefined && origin !== `http://${host}`)
|
|
87
|
-
throw new HttpError(403, '
|
|
87
|
+
throw new HttpError(403, 'Only requests from the same monitor page are allowed.');
|
|
88
88
|
const site = request.headers['sec-fetch-site'];
|
|
89
89
|
if (site !== undefined && site !== 'same-origin' && site !== 'none')
|
|
90
|
-
throw new HttpError(403, '
|
|
90
|
+
throw new HttpError(403, 'External pages cannot access this monitor.');
|
|
91
91
|
if (request.method !== 'GET' && request.method !== 'POST')
|
|
92
|
-
throw new HttpError(405, '
|
|
92
|
+
throw new HttpError(405, 'Unsupported request method.');
|
|
93
93
|
if (request.method === 'POST' && origin !== `http://${host}`)
|
|
94
|
-
throw new HttpError(403, '
|
|
94
|
+
throw new HttpError(403, 'Only requests from the same monitor page are allowed.');
|
|
95
95
|
if (request.method === 'GET' && (request.headers['transfer-encoding'] !== undefined || (request.headers['content-length'] !== undefined && request.headers['content-length'] !== '0')))
|
|
96
|
-
throw new HttpError(400, '
|
|
96
|
+
throw new HttpError(400, 'GET requests must not contain a body.');
|
|
97
97
|
return host;
|
|
98
98
|
}
|
|
99
99
|
function headers(response) {
|
|
@@ -126,36 +126,36 @@ function session(secret, token) {
|
|
|
126
126
|
function authenticate(request, secret) {
|
|
127
127
|
const token = tokenFrom(request), supplied = request.headers['x-ccdd-csrf'];
|
|
128
128
|
if (!token || typeof supplied !== 'string' || !bearerPattern.test(supplied) || !timingSafeEqual(Buffer.from(supplied), Buffer.from(session(secret, token).csrfToken)))
|
|
129
|
-
throw new HttpError(403, '
|
|
129
|
+
throw new HttpError(403, 'Unable to verify the reviewer session. Refresh the page and try again.');
|
|
130
130
|
return reviewer(token);
|
|
131
131
|
}
|
|
132
132
|
const object = (value) => value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
133
133
|
function bodyShape(value, keys) {
|
|
134
134
|
if (!object(value) || Object.keys(value).some(key => !keys.includes(key)))
|
|
135
|
-
throw new HttpError(400, '
|
|
135
|
+
throw new HttpError(400, 'Invalid request body fields.');
|
|
136
136
|
}
|
|
137
137
|
async function body(request) {
|
|
138
138
|
if (!/^application\/json(?:;\s*charset=utf-8)?$/i.test(request.headers['content-type'] ?? ''))
|
|
139
|
-
throw new HttpError(415, '
|
|
139
|
+
throw new HttpError(415, 'Send the request as JSON.');
|
|
140
140
|
if (Number(request.headers['content-length'] ?? 0) > 32_768)
|
|
141
|
-
throw new HttpError(413, '
|
|
141
|
+
throw new HttpError(413, 'The request body must be at most 32KiB.');
|
|
142
142
|
return await new Promise((ok, no) => {
|
|
143
143
|
const chunks = [];
|
|
144
144
|
let size = 0;
|
|
145
145
|
const cleanup = () => { clearTimeout(timer); request.off('data', data); request.off('end', end); request.off('aborted', abort); request.off('error', no); };
|
|
146
146
|
const fail = (error) => { cleanup(); request.resume(); no(error); };
|
|
147
|
-
const abort = () => fail(new HttpError(400, '
|
|
147
|
+
const abort = () => fail(new HttpError(400, 'The request transfer was aborted.'));
|
|
148
148
|
const data = (chunk) => { size += chunk.length; if (size > 32_768)
|
|
149
|
-
fail(new HttpError(413, '
|
|
149
|
+
fail(new HttpError(413, 'The request body must be at most 32KiB.'));
|
|
150
150
|
else
|
|
151
151
|
chunks.push(chunk); };
|
|
152
152
|
const end = () => { cleanup(); try {
|
|
153
153
|
ok(JSON.parse(Buffer.concat(chunks).toString('utf8')));
|
|
154
154
|
}
|
|
155
155
|
catch {
|
|
156
|
-
no(new HttpError(400, 'JSON
|
|
156
|
+
no(new HttpError(400, 'Check the JSON request body.'));
|
|
157
157
|
} };
|
|
158
|
-
const timer = setTimeout(() => fail(new HttpError(408, '
|
|
158
|
+
const timer = setTimeout(() => fail(new HttpError(408, 'The request body transfer timed out.')), 5_000);
|
|
159
159
|
request.on('data', data);
|
|
160
160
|
request.once('end', end);
|
|
161
161
|
request.once('aborted', abort);
|
|
@@ -180,7 +180,7 @@ async function staticAssets() {
|
|
|
180
180
|
};
|
|
181
181
|
await visit(root, '/');
|
|
182
182
|
if (!assets.has('/'))
|
|
183
|
-
throw new Error('
|
|
183
|
+
throw new Error('Monitor UI files are missing. Rebuild the package.');
|
|
184
184
|
return assets;
|
|
185
185
|
}
|
|
186
186
|
async function decorateDetail(detail, record, reviewerId) {
|
|
@@ -207,7 +207,7 @@ async function decorateDetail(detail, record, reviewerId) {
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
catch {
|
|
210
|
-
detail.toolIssue = '
|
|
210
|
+
detail.toolIssue = 'Unable to prepare tools for this review. Check the stored input and tool definitions.';
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
return detail;
|
|
@@ -216,7 +216,7 @@ async function decorateDetail(detail, record, reviewerId) {
|
|
|
216
216
|
export async function startMonitor(options = {}) {
|
|
217
217
|
const requestedPort = options.port ?? 4318;
|
|
218
218
|
if (!Number.isInteger(requestedPort) || requestedPort < 0 || requestedPort > 65535)
|
|
219
|
-
throw new Error('
|
|
219
|
+
throw new Error('The monitor port must be an integer between 0 and 65535.');
|
|
220
220
|
const store = createMonitorStore(options);
|
|
221
221
|
const assets = await staticAssets();
|
|
222
222
|
const sessionSecret = randomBytes(32);
|
|
@@ -229,10 +229,10 @@ export async function startMonitor(options = {}) {
|
|
|
229
229
|
const job = (async () => {
|
|
230
230
|
const host = protect(request, port);
|
|
231
231
|
if (!request.url?.startsWith('/') || request.url.startsWith('//'))
|
|
232
|
-
throw new HttpError(400, '
|
|
232
|
+
throw new HttpError(400, 'Invalid request URL.');
|
|
233
233
|
const url = new URL(request.url, `http://${host}`);
|
|
234
234
|
if (closing)
|
|
235
|
-
throw new HttpError(503, '
|
|
235
|
+
throw new HttpError(503, 'The monitor is shutting down.');
|
|
236
236
|
const asset = assets.get(url.pathname);
|
|
237
237
|
if (asset && request.method === 'GET') {
|
|
238
238
|
parameters(url, []);
|
|
@@ -254,17 +254,17 @@ export async function startMonitor(options = {}) {
|
|
|
254
254
|
authenticate(request, sessionSecret);
|
|
255
255
|
bodyShape(await body(request), []);
|
|
256
256
|
if (active.size >= MAX_ARTIFACT_READS)
|
|
257
|
-
throw new HttpError(429, '
|
|
257
|
+
throw new HttpError(429, 'Other input is being inspected. Please try again shortly.');
|
|
258
258
|
const context = await store.projectContext(id(validation[1]));
|
|
259
259
|
if (!context)
|
|
260
|
-
throw new HttpError(404, '
|
|
260
|
+
throw new HttpError(404, 'Project not found.');
|
|
261
261
|
const controller = new AbortController();
|
|
262
262
|
const disconnect = () => { if (!response.writableEnded)
|
|
263
263
|
controller.abort(new Error('Monitor client disconnected')); };
|
|
264
264
|
request.once('aborted', disconnect);
|
|
265
265
|
response.once('close', disconnect);
|
|
266
266
|
active.add(controller);
|
|
267
|
-
const timer = setTimeout(() => controller.abort(new HttpError(504, '
|
|
267
|
+
const timer = setTimeout(() => controller.abort(new HttpError(504, 'Current input inspection timed out. Try again using the CLI.')), 30_000);
|
|
268
268
|
try {
|
|
269
269
|
const { plan } = await inspectProject({ ...context, recursive: true, signal: controller.signal });
|
|
270
270
|
json(response, { plan, observedAt: new Date().toISOString() });
|
|
@@ -272,7 +272,7 @@ export async function startMonitor(options = {}) {
|
|
|
272
272
|
catch (error) {
|
|
273
273
|
if (controller.signal.aborted)
|
|
274
274
|
throw controller.signal.reason;
|
|
275
|
-
throw new HttpError(409, '
|
|
275
|
+
throw new HttpError(409, 'Unable to inspect current input. Run ccdd-project config check to check the configuration and input.');
|
|
276
276
|
}
|
|
277
277
|
finally {
|
|
278
278
|
clearTimeout(timer);
|
|
@@ -284,21 +284,21 @@ export async function startMonitor(options = {}) {
|
|
|
284
284
|
}
|
|
285
285
|
const action = /^\/api\/requests\/([^/]+)\/([^/]+)\/(claim|complete|tools\/([^/]+))$/.exec(url.pathname);
|
|
286
286
|
if (!action)
|
|
287
|
-
throw new HttpError(405, '
|
|
287
|
+
throw new HttpError(405, 'This URL only accepts GET requests.');
|
|
288
288
|
parameters(url, []);
|
|
289
289
|
const reviewerId = authenticate(request, sessionSecret);
|
|
290
290
|
const input = await body(request);
|
|
291
291
|
const projectId = id(action[1]), requestId = id(action[2]);
|
|
292
292
|
const key = `${projectId}/${requestId}`;
|
|
293
293
|
if (mutations.has(key))
|
|
294
|
-
throw new HttpError(409, '
|
|
294
|
+
throw new HttpError(409, 'Another action is in progress for this review. Please try again shortly.');
|
|
295
295
|
mutations.add(key);
|
|
296
296
|
try {
|
|
297
297
|
const record = await store.request(projectId, requestId);
|
|
298
298
|
if (!record)
|
|
299
|
-
throw new HttpError(404, '
|
|
299
|
+
throw new HttpError(404, 'Review request not found.');
|
|
300
300
|
if (record.request.id !== requestId)
|
|
301
|
-
throw new HttpError(409, '
|
|
301
|
+
throw new HttpError(409, 'The stored review identifier does not match.');
|
|
302
302
|
if (action[3] === 'claim') {
|
|
303
303
|
bodyShape(input, []);
|
|
304
304
|
await claimReview(record, reviewerId);
|
|
@@ -306,22 +306,22 @@ export async function startMonitor(options = {}) {
|
|
|
306
306
|
else if (action[3] === 'complete') {
|
|
307
307
|
bodyShape(input, ['verdict', 'summary', 'evidence']);
|
|
308
308
|
if ((input.verdict !== 'GREEN' && input.verdict !== 'RED') || typeof input.summary !== 'string' || !input.summary.trim() || input.summary.length > 12_000 || !Array.isArray(input.evidence) || input.evidence.length < 1 || input.evidence.length > 100 || !input.evidence.every(item => typeof item === 'string' && item.trim().length > 0 && item.length <= 4_000))
|
|
309
|
-
throw new HttpError(400, '
|
|
309
|
+
throw new HttpError(400, 'Check the verdict, summary, and evidence list.');
|
|
310
310
|
await completeReview(record, reviewerId, { verdict: input.verdict, summary: input.summary, evidence: input.evidence });
|
|
311
311
|
}
|
|
312
312
|
else {
|
|
313
313
|
bodyShape(input, ['arguments']);
|
|
314
314
|
if (!object(input.arguments))
|
|
315
|
-
throw new HttpError(400, '
|
|
315
|
+
throw new HttpError(400, 'Tool input must be a JSON object.');
|
|
316
316
|
if (active.size >= MAX_ARTIFACT_READS)
|
|
317
|
-
throw new HttpError(429, '
|
|
317
|
+
throw new HttpError(429, 'Other tools are running. Please try again shortly.');
|
|
318
318
|
const controller = new AbortController();
|
|
319
319
|
const disconnect = () => { if (!response.writableEnded)
|
|
320
320
|
controller.abort(new Error('Monitor client disconnected')); };
|
|
321
321
|
request.once('aborted', disconnect);
|
|
322
322
|
response.once('close', disconnect);
|
|
323
323
|
active.add(controller);
|
|
324
|
-
const timer = setTimeout(() => controller.abort(new HttpError(504, '
|
|
324
|
+
const timer = setTimeout(() => controller.abort(new HttpError(504, 'The tool timed out.')), 120_000);
|
|
325
325
|
try {
|
|
326
326
|
json(response, { result: await executeReviewTool(record, reviewerId, id(action[4], 129), input.arguments, controller.signal) });
|
|
327
327
|
}
|
|
@@ -335,7 +335,7 @@ export async function startMonitor(options = {}) {
|
|
|
335
335
|
}
|
|
336
336
|
const updated = await store.detail(projectId, requestId);
|
|
337
337
|
if (!updated)
|
|
338
|
-
throw new HttpError(404, '
|
|
338
|
+
throw new HttpError(404, 'Review request not found.');
|
|
339
339
|
json(response, await decorateDetail(updated, record, reviewerId));
|
|
340
340
|
}
|
|
341
341
|
finally {
|
|
@@ -354,7 +354,7 @@ export async function startMonitor(options = {}) {
|
|
|
354
354
|
parameters(url, []);
|
|
355
355
|
const graph = await store.graph(id(graphRoute[1]), id(graphRoute[2]));
|
|
356
356
|
if (!graph)
|
|
357
|
-
throw new HttpError(404, '
|
|
357
|
+
throw new HttpError(404, 'Selected Run not found.');
|
|
358
358
|
json(response, graph);
|
|
359
359
|
return;
|
|
360
360
|
}
|
|
@@ -362,18 +362,18 @@ export async function startMonitor(options = {}) {
|
|
|
362
362
|
parameters(url, ['project', 'run', 'filter', 'lane', 'limit', 'offset']);
|
|
363
363
|
const filter = url.searchParams.get('filter') ?? 'all';
|
|
364
364
|
if (!['all', 'active', 'attention'].includes(filter))
|
|
365
|
-
throw new HttpError(400, '
|
|
365
|
+
throw new HttpError(400, 'Unknown request filter.');
|
|
366
366
|
const projectValue = url.searchParams.get('project');
|
|
367
367
|
const project = projectValue === null ? undefined : id(projectValue);
|
|
368
368
|
const runValue = url.searchParams.get('run');
|
|
369
369
|
const run = runValue === null ? undefined : id(runValue);
|
|
370
370
|
if (run !== undefined && project === undefined)
|
|
371
|
-
throw new HttpError(400, '
|
|
371
|
+
throw new HttpError(400, 'Select a project before selecting a Run.');
|
|
372
372
|
const limit = number(url.searchParams.get('limit'), 50, 1, 100);
|
|
373
373
|
const offset = number(url.searchParams.get('offset'), 0, 0, Number.MAX_SAFE_INTEGER);
|
|
374
374
|
const lane = url.searchParams.get('lane') ?? undefined;
|
|
375
375
|
if (lane !== undefined && !['requested', 'running', 'success', 'failure'].includes(lane))
|
|
376
|
-
throw new HttpError(400, '
|
|
376
|
+
throw new HttpError(400, 'Unknown Kanban column.');
|
|
377
377
|
json(response, await store.overview({ project, run, filter: filter, lane: lane, limit, offset }));
|
|
378
378
|
return;
|
|
379
379
|
}
|
|
@@ -382,7 +382,7 @@ export async function startMonitor(options = {}) {
|
|
|
382
382
|
parameters(url, []);
|
|
383
383
|
const result = await store.detail(id(detail[1]), id(detail[2]));
|
|
384
384
|
if (!result)
|
|
385
|
-
throw new HttpError(404, '
|
|
385
|
+
throw new HttpError(404, 'Review request not found.');
|
|
386
386
|
const record = await store.request(id(detail[1]), id(detail[2]));
|
|
387
387
|
const token = tokenFrom(request);
|
|
388
388
|
json(response, record ? await decorateDetail(result, record, token ? reviewer(token) : undefined) : result);
|
|
@@ -390,29 +390,29 @@ export async function startMonitor(options = {}) {
|
|
|
390
390
|
}
|
|
391
391
|
const artifact = /^\/api\/requests\/([^/]+)\/([^/]+)\/artifacts\/([^/]+)$/.exec(url.pathname);
|
|
392
392
|
if (!artifact)
|
|
393
|
-
throw new HttpError(404, '
|
|
393
|
+
throw new HttpError(404, 'Request URL not found.');
|
|
394
394
|
parameters(url, ['operation', 'path', 'startLine', 'lineCount', 'offset', 'limit']);
|
|
395
395
|
if (active.size >= MAX_ARTIFACT_READS) {
|
|
396
396
|
response.setHeader('Retry-After', '1');
|
|
397
|
-
throw new HttpError(429, '
|
|
397
|
+
throw new HttpError(429, 'Other Artifacts are being inspected. Please try again shortly.');
|
|
398
398
|
}
|
|
399
399
|
const controller = new AbortController();
|
|
400
400
|
const disconnect = () => { if (!response.writableEnded)
|
|
401
401
|
controller.abort(new Error('Monitor client disconnected')); };
|
|
402
402
|
request.once('aborted', disconnect);
|
|
403
403
|
response.once('close', disconnect);
|
|
404
|
-
const timer = setTimeout(() => controller.abort(new HttpError(504, 'Artifact
|
|
404
|
+
const timer = setTimeout(() => controller.abort(new HttpError(504, 'Artifact inspection timed out. Try again with a smaller input.')), ARTIFACT_BUDGET_MS);
|
|
405
405
|
active.add(controller);
|
|
406
406
|
try {
|
|
407
407
|
const projectId = id(artifact[1]), requestId = id(artifact[2]), artifactId = id(artifact[3]);
|
|
408
408
|
const record = await store.request(projectId, requestId);
|
|
409
409
|
controller.signal.throwIfAborted();
|
|
410
410
|
if (!record)
|
|
411
|
-
throw new HttpError(404, '
|
|
411
|
+
throw new HttpError(404, 'Review request not found.');
|
|
412
412
|
if (record.request.id !== requestId)
|
|
413
|
-
throw new HttpError(409, '
|
|
413
|
+
throw new HttpError(409, 'The stored review request identifier does not match.');
|
|
414
414
|
if (record.request.configManifest)
|
|
415
|
-
throw new HttpError(409, '
|
|
415
|
+
throw new HttpError(409, 'Inspect this Artifact with its registered tools. Human reviewers can use the programs provided in the Review tab.');
|
|
416
416
|
await authorizeWorkspace(record);
|
|
417
417
|
controller.signal.throwIfAborted();
|
|
418
418
|
const handle = await reopenWorkspace(record.request.workspace, { signal: controller.signal });
|
|
@@ -420,19 +420,19 @@ export async function startMonitor(options = {}) {
|
|
|
420
420
|
await handle.assertUnchanged();
|
|
421
421
|
const expected = await readStoredArtifactScope({ repoPath: handle.descriptor.path, criticId: record.request.criticId });
|
|
422
422
|
if (!expected || !isDeepStrictEqual(expected.artifacts, record.request.artifacts) || !isDeepStrictEqual(expected.artifactTypes, record.request.artifactTypes))
|
|
423
|
-
throw new HttpError(409, '
|
|
423
|
+
throw new HttpError(409, 'The stored Artifact scope does not match the review input definitions.');
|
|
424
424
|
const viewer = await createArtifactViewer({ worktreePath: handle.descriptor.path, artifacts: record.request.artifacts, artifactTypes: record.request.artifactTypes, signal: handle.signal });
|
|
425
425
|
const definition = viewer.listArtifacts().find(item => item.id === artifactId);
|
|
426
426
|
if (!definition)
|
|
427
|
-
throw new HttpError(404, '
|
|
427
|
+
throw new HttpError(404, 'This Artifact is not included in the review request.');
|
|
428
428
|
const operation = url.searchParams.get('operation') ?? (definition.directory ? 'list' : 'read');
|
|
429
429
|
if (operation !== 'read' && operation !== 'list')
|
|
430
|
-
throw new HttpError(400, '
|
|
430
|
+
throw new HttpError(400, 'Unsupported Artifact inspection method.');
|
|
431
431
|
const registry = createArtifactTools(viewer, { audience: 'viewer' });
|
|
432
432
|
const toolName = `${operation}_${artifactId}`;
|
|
433
433
|
const tool = registry.tools.find(item => item.name === toolName);
|
|
434
434
|
if (!tool)
|
|
435
|
-
throw new HttpError(400, '
|
|
435
|
+
throw new HttpError(400, 'This Artifact does not have the requested inspection tool.');
|
|
436
436
|
const args = {};
|
|
437
437
|
if (url.searchParams.has('path'))
|
|
438
438
|
args.path = url.searchParams.get('path');
|
|
@@ -472,7 +472,7 @@ export async function startMonitor(options = {}) {
|
|
|
472
472
|
await new Promise((ok, no) => { server.once('error', no); server.listen(requestedPort, '127.0.0.1', () => { server.off('error', no); ok(); }); });
|
|
473
473
|
const address = server.address();
|
|
474
474
|
if (!address || typeof address === 'string')
|
|
475
|
-
throw new Error('
|
|
475
|
+
throw new Error('Unable to determine the local address of the monitor.');
|
|
476
476
|
port = address.port;
|
|
477
477
|
return {
|
|
478
478
|
url: `http://127.0.0.1:${port}`,
|
|
@@ -480,7 +480,7 @@ export async function startMonitor(options = {}) {
|
|
|
480
480
|
if (!closePromise) {
|
|
481
481
|
closing = true;
|
|
482
482
|
for (const controller of active)
|
|
483
|
-
controller.abort(new HttpError(503, '
|
|
483
|
+
controller.abort(new HttpError(503, 'The monitor is shutting down.'));
|
|
484
484
|
closePromise = (async () => {
|
|
485
485
|
await new Promise((ok, no) => { server.close(error => error ? no(error) : ok()); server.closeIdleConnections(); });
|
|
486
486
|
await Promise.allSettled([...jobs]);
|