@jupiterone/jupiterone-mcp 2.6.2 → 2.7.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/README.md +122 -72
- package/dist/client/graphql/mutations.d.ts +16 -0
- package/dist/client/graphql/mutations.d.ts.map +1 -1
- package/dist/client/graphql/mutations.js +126 -1
- package/dist/client/graphql/mutations.js.map +1 -1
- package/dist/client/graphql/queries.d.ts +27 -2
- package/dist/client/graphql/queries.d.ts.map +1 -1
- package/dist/client/graphql/queries.js +96 -4
- package/dist/client/graphql/queries.js.map +1 -1
- package/dist/client/jupiterone-client.d.ts +30 -0
- package/dist/client/jupiterone-client.d.ts.map +1 -1
- package/dist/client/jupiterone-client.js +60 -0
- package/dist/client/jupiterone-client.js.map +1 -1
- package/dist/client/services/compliance-service.d.ts +48 -1
- package/dist/client/services/compliance-service.d.ts.map +1 -1
- package/dist/client/services/compliance-service.js +292 -0
- package/dist/client/services/compliance-service.js.map +1 -1
- package/dist/client/services/j1ql-service.d.ts +10 -2
- package/dist/client/services/j1ql-service.d.ts.map +1 -1
- package/dist/client/services/j1ql-service.js +11 -3
- package/dist/client/services/j1ql-service.js.map +1 -1
- package/dist/client/services/rule-service.d.ts +3 -1
- package/dist/client/services/rule-service.d.ts.map +1 -1
- package/dist/client/services/rule-service.js +7 -5
- package/dist/client/services/rule-service.js.map +1 -1
- package/dist/generated/description-map.d.ts.map +1 -1
- package/dist/generated/description-map.js +692 -38
- package/dist/generated/description-map.js.map +1 -1
- package/dist/server/mcp-server.d.ts.map +1 -1
- package/dist/server/mcp-server.js +38 -1
- package/dist/server/mcp-server.js.map +1 -1
- package/dist/server/skills.d.ts +25 -0
- package/dist/server/skills.d.ts.map +1 -0
- package/dist/server/skills.js +115 -0
- package/dist/server/skills.js.map +1 -0
- package/dist/server/tools/compliance/attestations.d.ts.map +1 -1
- package/dist/server/tools/compliance/attestations.js +20 -37
- package/dist/server/tools/compliance/attestations.js.map +1 -1
- package/dist/server/tools/compliance/authoring.d.ts +3 -0
- package/dist/server/tools/compliance/authoring.d.ts.map +1 -0
- package/dist/server/tools/compliance/authoring.js +773 -0
- package/dist/server/tools/compliance/authoring.js.map +1 -0
- package/dist/server/tools/compliance/controls.d.ts.map +1 -1
- package/dist/server/tools/compliance/controls.js +193 -19
- package/dist/server/tools/compliance/controls.js.map +1 -1
- package/dist/server/tools/compliance/exemptions.d.ts +3 -0
- package/dist/server/tools/compliance/exemptions.d.ts.map +1 -0
- package/dist/server/tools/compliance/exemptions.js +287 -0
- package/dist/server/tools/compliance/exemptions.js.map +1 -0
- package/dist/server/tools/compliance/framework.d.ts +3 -0
- package/dist/server/tools/compliance/framework.d.ts.map +1 -0
- package/dist/server/tools/compliance/framework.js +445 -0
- package/dist/server/tools/compliance/framework.js.map +1 -0
- package/dist/server/tools/compliance/graph.d.ts +56 -0
- package/dist/server/tools/compliance/graph.d.ts.map +1 -0
- package/dist/server/tools/compliance/graph.js +115 -0
- package/dist/server/tools/compliance/graph.js.map +1 -0
- package/dist/server/tools/compliance/index.d.ts +2 -16
- package/dist/server/tools/compliance/index.d.ts.map +1 -1
- package/dist/server/tools/compliance/index.js +45 -15
- package/dist/server/tools/compliance/index.js.map +1 -1
- package/dist/server/tools/compliance/requirements.d.ts +3 -0
- package/dist/server/tools/compliance/requirements.d.ts.map +1 -0
- package/dist/server/tools/compliance/requirements.js +243 -0
- package/dist/server/tools/compliance/requirements.js.map +1 -0
- package/dist/server/tools/compliance/schemas.d.ts +409 -8
- package/dist/server/tools/compliance/schemas.d.ts.map +1 -1
- package/dist/server/tools/compliance/schemas.js +337 -7
- package/dist/server/tools/compliance/schemas.js.map +1 -1
- package/dist/server/tools/compliance/shared.d.ts +103 -1
- package/dist/server/tools/compliance/shared.d.ts.map +1 -1
- package/dist/server/tools/compliance/shared.js +235 -1
- package/dist/server/tools/compliance/shared.js.map +1 -1
- package/dist/server/tools/compliance/summary.d.ts +2 -8
- package/dist/server/tools/compliance/summary.d.ts.map +1 -1
- package/dist/server/tools/compliance/summary.js +149 -87
- package/dist/server/tools/compliance/summary.js.map +1 -1
- package/dist/server/tools/compliance/tests.d.ts +3 -0
- package/dist/server/tools/compliance/tests.d.ts.map +1 -0
- package/dist/server/tools/compliance/tests.js +463 -0
- package/dist/server/tools/compliance/tests.js.map +1 -0
- package/dist/server/tools/compliance/transitions.d.ts +6 -0
- package/dist/server/tools/compliance/transitions.d.ts.map +1 -0
- package/dist/server/tools/compliance/transitions.js +659 -0
- package/dist/server/tools/compliance/transitions.js.map +1 -0
- package/dist/server/tools/integrations.d.ts.map +1 -1
- package/dist/server/tools/integrations.js +43 -49
- package/dist/server/tools/integrations.js.map +1 -1
- package/dist/server/tools/reference.d.ts +1 -1
- package/dist/server/tools/reference.d.ts.map +1 -1
- package/dist/server/tools/reference.js +1 -0
- package/dist/server/tools/reference.js.map +1 -1
- package/dist/server/tools/result.d.ts +3 -2
- package/dist/server/tools/result.d.ts.map +1 -1
- package/dist/server/tools/result.js +3 -2
- package/dist/server/tools/result.js.map +1 -1
- package/dist/server/tools/rules.d.ts.map +1 -1
- package/dist/server/tools/rules.js +19 -21
- package/dist/server/tools/rules.js.map +1 -1
- package/dist/server/tools/types.d.ts +2 -0
- package/dist/server/tools/types.d.ts.map +1 -1
- package/dist/server/tools/types.js.map +1 -1
- package/dist/server/tools/usage.d.ts +6 -7
- package/dist/server/tools/usage.d.ts.map +1 -1
- package/dist/server/tools/usage.js +193 -4
- package/dist/server/tools/usage.js.map +1 -1
- package/dist/types/jupiterone.d.ts +179 -0
- package/dist/types/jupiterone.d.ts.map +1 -1
- package/dist/utils/j1ql-validator.d.ts.map +1 -1
- package/dist/utils/j1ql-validator.js +129 -1
- package/dist/utils/j1ql-validator.js.map +1 -1
- package/node_modules/dtrace-provider/build/Makefile +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.controlTestTools = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const j1ql_service_js_1 = require("../../../client/services/j1ql-service.js");
|
|
6
|
+
const load_description_js_1 = require("../../../utils/load-description.js");
|
|
7
|
+
const result_js_1 = require("../result.js");
|
|
8
|
+
const types_js_1 = require("../types.js");
|
|
9
|
+
const schemas_js_1 = require("./schemas.js");
|
|
10
|
+
const shared_js_1 = require("./shared.js");
|
|
11
|
+
/**
|
|
12
|
+
* create-control-test, update-control-test and delete-control-test. A test is one J1QL query plus
|
|
13
|
+
* what its rows mean; the query is parsed and run before it is saved so the agent sees what the
|
|
14
|
+
* test will score, and a non-LIVE control's tests run only on `evaluate-controls`.
|
|
15
|
+
*/
|
|
16
|
+
/** The longest the preflight run waits for the query, within the call's budget. */
|
|
17
|
+
const PREFLIGHT_RUN_MS = 10_000;
|
|
18
|
+
/**
|
|
19
|
+
* Engine messages that mean the query can never run, as opposed to a run that failed (`An error
|
|
20
|
+
* occurred`, a 502 fetching results). In 30 days of prod telemetry (2026-10-29) the only such
|
|
21
|
+
* message was an alias the engine cannot bind; a tester saved two of those as tests that have never
|
|
22
|
+
* evaluated (dev, 2026-10-28).
|
|
23
|
+
*/
|
|
24
|
+
const ENGINE_REJECTIONS = [/Could not find node, relationship, or variable with identifier/i];
|
|
25
|
+
/** What to do about a test whose query failed when run but was saved anyway. */
|
|
26
|
+
const FAILED_RUN_NEXT_STEP = 'The query failed when run, so this test checks nothing until it runs, and CCM scores the ' +
|
|
27
|
+
'control from its other tests meanwhile. Run the query with `execute-j1ql-query` to see the ' +
|
|
28
|
+
'error, then fix it with `update-control-test`.';
|
|
29
|
+
/**
|
|
30
|
+
* Runs the query once, up to PREFLIGHT_RUN_MS and never past the call's deadline. Budgeted as a
|
|
31
|
+
* fresh run: a crafting run usually differs in LIMIT or RETURN, so the five-minute re-attach
|
|
32
|
+
* rarely applies. Advisory, except a run the engine rejects outright (see `rejectedRun`).
|
|
33
|
+
*/
|
|
34
|
+
async function preflightQuery(client, validator, query, deadlineAt) {
|
|
35
|
+
const runUntil = Math.min(deadlineAt, Date.now() + PREFLIGHT_RUN_MS);
|
|
36
|
+
if (Date.now() >= runUntil)
|
|
37
|
+
return { queryRun: 'skipped_deadline' };
|
|
38
|
+
try {
|
|
39
|
+
const result = await (0, shared_js_1.withDeadline)(client.executeJ1qlQuery({
|
|
40
|
+
query,
|
|
41
|
+
maxPollAttempts: Math.max(1, Math.ceil((runUntil - Date.now()) / 1000)),
|
|
42
|
+
}), runUntil);
|
|
43
|
+
if (result === shared_js_1.DEADLINE_PASSED)
|
|
44
|
+
return { queryRun: 'skipped_deadline' };
|
|
45
|
+
const { data, cursor } = (result ?? {});
|
|
46
|
+
const rows = Array.isArray(data) ? data.length : 0;
|
|
47
|
+
return {
|
|
48
|
+
queryRun: 'ran',
|
|
49
|
+
rows,
|
|
50
|
+
noDatapoints: rows === 0,
|
|
51
|
+
moreRows: typeof cursor === 'string' && cursor.length > 0,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
if (error instanceof j1ql_service_js_1.J1qlQueryTimeoutError)
|
|
56
|
+
return { queryRun: 'skipped_deadline' };
|
|
57
|
+
const hint = validator.handleQueryError(error, query);
|
|
58
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
59
|
+
if (ENGINE_REJECTIONS.some((pattern) => pattern.test(message))) {
|
|
60
|
+
return { queryRun: 'rejected', queryError: message, suggestion: hint.suggestion };
|
|
61
|
+
}
|
|
62
|
+
return { queryRun: 'error', queryError: hint.suggestion ?? hint.error ?? 'The query failed.' };
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
/** A message ended with exactly one period, whatever it brought with it. */
|
|
66
|
+
function sentence(message) {
|
|
67
|
+
return `${(message ?? '').replace(/[.\s]+$/, '')}.`;
|
|
68
|
+
}
|
|
69
|
+
/** A run the engine rejected outright: refused like a parse failure, nothing saved. */
|
|
70
|
+
function rejectedRun(verb, preflight) {
|
|
71
|
+
if (preflight?.queryRun !== 'rejected')
|
|
72
|
+
return null;
|
|
73
|
+
return (0, shared_js_1.refusal)('invalid_input', `Test not ${verb} — the query fails when run: ${sentence(preflight.queryError)} ` +
|
|
74
|
+
'`structuredContent.suggestion` says how to fix it; nothing was saved.', { suggestion: preflight.suggestion ?? null, preflight: { queryRun: 'rejected' } });
|
|
75
|
+
}
|
|
76
|
+
/** The parse gate: refuses before anything runs. The corrected query stays out of the text. */
|
|
77
|
+
function parseGate(verb, query, validator) {
|
|
78
|
+
const parsed = validator.validateQuery(query);
|
|
79
|
+
if (parsed.isValid)
|
|
80
|
+
return null;
|
|
81
|
+
return (0, shared_js_1.refusal)('invalid_input', `Test not ${verb} — the query cannot run: ${sentence(parsed.error ?? 'syntax error')} ` +
|
|
82
|
+
'`structuredContent.suggestion` says how to fix it; nothing was saved.', { suggestion: parsed.suggestion ?? null });
|
|
83
|
+
}
|
|
84
|
+
function projectTest(test, subdomain) {
|
|
85
|
+
const [first] = test.queries ?? [];
|
|
86
|
+
return {
|
|
87
|
+
id: test.id,
|
|
88
|
+
name: test.name,
|
|
89
|
+
description: test.description,
|
|
90
|
+
resultsAre: first?.resultsAre ?? null,
|
|
91
|
+
query: first?.query ?? null,
|
|
92
|
+
effective: first?.effective ?? null,
|
|
93
|
+
status: test.status,
|
|
94
|
+
referencedRuleId: test.referencedRuleId,
|
|
95
|
+
url: (0, shared_js_1.controlUrl)(test.controlId, subdomain),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function preflightNote(preflight, resultsAre) {
|
|
99
|
+
if (!preflight)
|
|
100
|
+
return '';
|
|
101
|
+
switch (preflight.queryRun) {
|
|
102
|
+
case 'ran':
|
|
103
|
+
if (preflight.rows === 0) {
|
|
104
|
+
return resultsAre === 'GOOD'
|
|
105
|
+
? 'The query returned no rows now: a GOOD test passes on no data, which proves nothing.'
|
|
106
|
+
: 'The query returned no rows now, so the test passes until a violation appears.';
|
|
107
|
+
}
|
|
108
|
+
return resultsAre === 'BAD'
|
|
109
|
+
? `The query returned ${preflight.rows}${preflight.moreRows ? '+' : ''} rows now: the ` +
|
|
110
|
+
'test will fail the control once LIVE and evaluated.'
|
|
111
|
+
: `The query returned ${preflight.rows}${preflight.moreRows ? '+' : ''} compliant rows now.`;
|
|
112
|
+
case 'skipped_deadline':
|
|
113
|
+
return 'The query was not run within the budget; run it with `execute-j1ql-query` to see its rows.';
|
|
114
|
+
default:
|
|
115
|
+
return `The query failed when run: ${preflight.queryError}`;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const controlTestIdInput = () => zod_1.z.string().trim().min(1).describe("The test's `id`, from `get-control` (`tests[].id`).");
|
|
119
|
+
const queryInput = () => zod_1.z.string().trim().min(1).describe('One J1QL query.');
|
|
120
|
+
const resultsAreInput = () => zod_1.z
|
|
121
|
+
.enum(['GOOD', 'BAD'])
|
|
122
|
+
.describe('BAD: rows are violations and any row fails the test. GOOD: rows are compliant; never fails.');
|
|
123
|
+
const NOTE_DRAFT_RUNS = "A non-LIVE control's tests run only when `evaluate-controls` asks; once LIVE they run daily.";
|
|
124
|
+
/**
|
|
125
|
+
* A refusal when deleting this test would change a LIVE control's score without fixing anything:
|
|
126
|
+
* its only failing test, or its last test. With the failing test gone the control passes on its
|
|
127
|
+
* next run; with no test left its status is cleared (apps `updateControlStatus.ts`,
|
|
128
|
+
* `clearControlStatus.ts`). Null when the delete is allowed.
|
|
129
|
+
*/
|
|
130
|
+
function keptOnLiveControl(test, control) {
|
|
131
|
+
if (control?.state !== 'LIVE')
|
|
132
|
+
return null;
|
|
133
|
+
const others = (control.controlTests ?? []).filter((entry) => !entry.deleted && entry.id !== test.id);
|
|
134
|
+
const failing = test.status === 'FAIL';
|
|
135
|
+
if (!failing && others.length > 0)
|
|
136
|
+
return null;
|
|
137
|
+
return (0, shared_js_1.refusal)('not_deletable', `Test not deleted — its control is LIVE and this is ${failing ? 'a failing test' : 'its last test'}, ` +
|
|
138
|
+
`so deleting it would ${failing ? 'let the control pass on its next run' : "clear the control's status"} ` +
|
|
139
|
+
'without fixing anything. Fix the query with `update-control-test`, exempt assets with ' +
|
|
140
|
+
'`create-exemptions`, or, if the test really should go, move the control to REVIEW with ' +
|
|
141
|
+
'`transition-controls` first.', {
|
|
142
|
+
controlTestId: test.id,
|
|
143
|
+
reason: failing ? 'failing_test_on_live' : 'last_test_on_live',
|
|
144
|
+
control: { id: control.id, name: control.name, state: control.state },
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
exports.controlTestTools = [
|
|
148
|
+
(0, types_js_1.defineTool)({
|
|
149
|
+
name: 'create-control-test',
|
|
150
|
+
title: 'Create Control Test',
|
|
151
|
+
description: (0, load_description_js_1.loadDescription)('create-control-test.md'),
|
|
152
|
+
inputSchema: {
|
|
153
|
+
controlId: zod_1.z
|
|
154
|
+
.string()
|
|
155
|
+
.trim()
|
|
156
|
+
.min(1)
|
|
157
|
+
.refine((value) => !shared_js_1.CONTROL_ID_FORBIDDEN.test(value), {
|
|
158
|
+
message: 'A control id never contains a quote or a backslash.',
|
|
159
|
+
})
|
|
160
|
+
.describe('The exact control id.'),
|
|
161
|
+
testName: zod_1.z.string().trim().min(1).describe('What the auditor would call the check.'),
|
|
162
|
+
query: queryInput(),
|
|
163
|
+
resultsAre: resultsAreInput(),
|
|
164
|
+
description: zod_1.z.string().trim().min(1).optional(),
|
|
165
|
+
},
|
|
166
|
+
outputSchema: schemas_js_1.createControlTestOutput,
|
|
167
|
+
annotations: types_js_1.CREATE,
|
|
168
|
+
accessDeniedHint: shared_js_1.ACCESS_DENIED_HINT,
|
|
169
|
+
errorContext: 'Error creating control test',
|
|
170
|
+
handler: async ({ controlId, testName: name, query, resultsAre, description }, client, validator) => {
|
|
171
|
+
const gate = parseGate('created', query, validator);
|
|
172
|
+
if (gate)
|
|
173
|
+
return gate;
|
|
174
|
+
const startedAt = Date.now();
|
|
175
|
+
const readDeadline = startedAt + shared_js_1.AUTHORING_READ_DEADLINE_MS;
|
|
176
|
+
const writeDeadline = startedAt + shared_js_1.AUTHORING_DEADLINE_MS;
|
|
177
|
+
const timings = {};
|
|
178
|
+
const subdomainRead = (0, shared_js_1.readSubdomain)(client, timings);
|
|
179
|
+
// The run starts beside the control read; both are short on their own and the budget
|
|
180
|
+
// is shared, so neither waits for the other.
|
|
181
|
+
const preflightRead = (0, shared_js_1.timed)(timings, 'preflight', () => preflightQuery(client, validator, query, writeDeadline));
|
|
182
|
+
const control = await (0, shared_js_1.boundedRead)(timings, 'control', () => (0, shared_js_1.findControl)(client, controlId), readDeadline);
|
|
183
|
+
if (control === shared_js_1.DEADLINE_PASSED)
|
|
184
|
+
return (0, shared_js_1.readFailed)('The control', { controlId });
|
|
185
|
+
if (!control) {
|
|
186
|
+
return (0, shared_js_1.refusal)('control_not_found', 'Test not created — no control has this id. Resolve it with `get-control` and retry ' +
|
|
187
|
+
'with the `id` it returns.', { controlId });
|
|
188
|
+
}
|
|
189
|
+
const subdomain = await (0, shared_js_1.subdomainBy)(subdomainRead, readDeadline);
|
|
190
|
+
const summary = {
|
|
191
|
+
id: control.id,
|
|
192
|
+
name: control.name,
|
|
193
|
+
state: control.state,
|
|
194
|
+
url: (0, shared_js_1.controlUrl)(control.id, subdomain),
|
|
195
|
+
};
|
|
196
|
+
const existing = (control.controlTests ?? []).find((test) => !test.deleted && (0, shared_js_1.foldName)(test.name) === (0, shared_js_1.foldName)(name));
|
|
197
|
+
if (existing) {
|
|
198
|
+
return (0, result_js_1.structuredResult)({
|
|
199
|
+
outcome: 'already_exists',
|
|
200
|
+
test: projectTest(existing, subdomain),
|
|
201
|
+
control: summary,
|
|
202
|
+
note: 'This control already has a test with this name, so nothing was created; change it ' +
|
|
203
|
+
'with `update-control-test`.',
|
|
204
|
+
timingsMs: timings,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
const preflight = await preflightRead;
|
|
208
|
+
const rejected = rejectedRun('created', preflight);
|
|
209
|
+
if (rejected)
|
|
210
|
+
return rejected;
|
|
211
|
+
let created;
|
|
212
|
+
try {
|
|
213
|
+
created = await (0, shared_js_1.timed)(timings, 'create', () => client.createControlTest({
|
|
214
|
+
controlId: control.id,
|
|
215
|
+
name,
|
|
216
|
+
queries: [{ name, query, resultsAre }],
|
|
217
|
+
description,
|
|
218
|
+
}));
|
|
219
|
+
}
|
|
220
|
+
catch (error) {
|
|
221
|
+
if ((0, shared_js_1.isAborted)(error)) {
|
|
222
|
+
return (0, shared_js_1.interruptedWrite)('the test was being created', "Read the control's `tests` with `get-control` before creating it again.");
|
|
223
|
+
}
|
|
224
|
+
throw error;
|
|
225
|
+
}
|
|
226
|
+
const effective = created.queries?.[0]?.effective ?? null;
|
|
227
|
+
const unknownEntityType = effective === false;
|
|
228
|
+
return (0, result_js_1.structuredResult)({
|
|
229
|
+
outcome: 'created',
|
|
230
|
+
test: projectTest(created, subdomain),
|
|
231
|
+
control: summary,
|
|
232
|
+
preflight,
|
|
233
|
+
unknownEntityType,
|
|
234
|
+
note: [
|
|
235
|
+
preflightNote(preflight, resultsAre),
|
|
236
|
+
unknownEntityType
|
|
237
|
+
? 'The backend marked the test not effective: its query names an entity type this ' +
|
|
238
|
+
'account does not hold, so it passes on no data until the data exists.'
|
|
239
|
+
: '',
|
|
240
|
+
control.state === 'LIVE'
|
|
241
|
+
? 'The control is LIVE, so the test runs on the next daily evaluation.'
|
|
242
|
+
: NOTE_DRAFT_RUNS,
|
|
243
|
+
]
|
|
244
|
+
.filter(Boolean)
|
|
245
|
+
.join(' '),
|
|
246
|
+
nextStep: preflight.queryRun === 'error'
|
|
247
|
+
? FAILED_RUN_NEXT_STEP
|
|
248
|
+
: control.state === 'LIVE'
|
|
249
|
+
? 'Read the result with `get-control` after the next run, or `evaluate-controls` to run it now.'
|
|
250
|
+
: "`evaluate-controls` runs it now; `get-control` then shows the test's status while the control stays unscored until LIVE.",
|
|
251
|
+
timingsMs: timings,
|
|
252
|
+
});
|
|
253
|
+
},
|
|
254
|
+
}),
|
|
255
|
+
(0, types_js_1.defineTool)({
|
|
256
|
+
name: 'update-control-test',
|
|
257
|
+
title: 'Update Control Test',
|
|
258
|
+
description: (0, load_description_js_1.loadDescription)('update-control-test.md'),
|
|
259
|
+
inputSchema: {
|
|
260
|
+
controlTestId: controlTestIdInput(),
|
|
261
|
+
testName: zod_1.z.string().trim().min(1).optional().describe('A new name.'),
|
|
262
|
+
query: queryInput().optional(),
|
|
263
|
+
resultsAre: resultsAreInput().optional(),
|
|
264
|
+
description: zod_1.z.string().nullable().optional().describe('null clears it.'),
|
|
265
|
+
},
|
|
266
|
+
outputSchema: schemas_js_1.updateControlTestOutput,
|
|
267
|
+
annotations: { ...types_js_1.MUTATE, idempotentHint: true },
|
|
268
|
+
accessDeniedHint: shared_js_1.ACCESS_DENIED_HINT,
|
|
269
|
+
errorContext: 'Error updating control test',
|
|
270
|
+
handler: async ({ controlTestId, testName: name, query, resultsAre, description }, client, validator) => {
|
|
271
|
+
if ([name, query, resultsAre, description].every((value) => value === undefined)) {
|
|
272
|
+
return (0, shared_js_1.validationError)('Test not updated — pass at least one of `name`, `query`, `resultsAre` and `description`.');
|
|
273
|
+
}
|
|
274
|
+
if (query !== undefined) {
|
|
275
|
+
const gate = parseGate('updated', query, validator);
|
|
276
|
+
if (gate)
|
|
277
|
+
return gate;
|
|
278
|
+
}
|
|
279
|
+
const startedAt = Date.now();
|
|
280
|
+
const readDeadline = startedAt + shared_js_1.AUTHORING_READ_DEADLINE_MS;
|
|
281
|
+
const writeDeadline = startedAt + shared_js_1.AUTHORING_DEADLINE_MS;
|
|
282
|
+
const timings = {};
|
|
283
|
+
const subdomainRead = (0, shared_js_1.readSubdomain)(client, timings);
|
|
284
|
+
// Started beside the test read: run after it, a 46 s read left the preflight no time and
|
|
285
|
+
// the update went out unchecked (PR #59 review, 2026-10-30).
|
|
286
|
+
const preflightRead = query === undefined
|
|
287
|
+
? undefined
|
|
288
|
+
: (0, shared_js_1.timed)(timings, 'preflight', () => preflightQuery(client, validator, query, writeDeadline));
|
|
289
|
+
let current;
|
|
290
|
+
try {
|
|
291
|
+
const read = await (0, shared_js_1.boundedRead)(timings, 'test', () => client.getControlTest(controlTestId), readDeadline);
|
|
292
|
+
if (read === shared_js_1.DEADLINE_PASSED)
|
|
293
|
+
return (0, shared_js_1.readFailed)('The test', { controlTestId });
|
|
294
|
+
current = read;
|
|
295
|
+
}
|
|
296
|
+
catch (error) {
|
|
297
|
+
if ((0, shared_js_1.isNotFound)(error)) {
|
|
298
|
+
return (0, result_js_1.structuredResult)({
|
|
299
|
+
outcome: 'not_found',
|
|
300
|
+
controlTestId,
|
|
301
|
+
note: 'No non-deleted test has this id; nothing changed.',
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
throw error;
|
|
305
|
+
}
|
|
306
|
+
const [first] = current.queries ?? [];
|
|
307
|
+
const nextQuery = query ?? first?.query;
|
|
308
|
+
const nextResultsAre = resultsAre ?? first?.resultsAre;
|
|
309
|
+
const queryChanged = query !== undefined && query !== first?.query;
|
|
310
|
+
const preflight = queryChanged ? await preflightRead : undefined;
|
|
311
|
+
const rejected = rejectedRun('updated', preflight);
|
|
312
|
+
if (rejected)
|
|
313
|
+
return rejected;
|
|
314
|
+
let updated;
|
|
315
|
+
try {
|
|
316
|
+
updated = await (0, shared_js_1.timed)(timings, 'update', () => client.updateControlTest({
|
|
317
|
+
id: controlTestId,
|
|
318
|
+
name,
|
|
319
|
+
description,
|
|
320
|
+
...(nextQuery &&
|
|
321
|
+
nextResultsAre &&
|
|
322
|
+
(queryChanged || resultsAre !== undefined || name !== undefined)
|
|
323
|
+
? {
|
|
324
|
+
queries: [
|
|
325
|
+
{ name: name ?? current.name, query: nextQuery, resultsAre: nextResultsAre },
|
|
326
|
+
],
|
|
327
|
+
}
|
|
328
|
+
: {}),
|
|
329
|
+
}));
|
|
330
|
+
}
|
|
331
|
+
catch (error) {
|
|
332
|
+
if ((0, shared_js_1.isNotFound)(error)) {
|
|
333
|
+
return (0, result_js_1.structuredResult)({
|
|
334
|
+
outcome: 'not_found',
|
|
335
|
+
controlTestId,
|
|
336
|
+
note: 'No non-deleted test has this id; nothing changed.',
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
if ((0, shared_js_1.isAborted)(error)) {
|
|
340
|
+
return (0, shared_js_1.interruptedWrite)('the test was being updated', "Read the control's `tests` with `get-control` before repeating the update.");
|
|
341
|
+
}
|
|
342
|
+
throw error;
|
|
343
|
+
}
|
|
344
|
+
const subdomain = await (0, shared_js_1.subdomainBy)(subdomainRead, readDeadline);
|
|
345
|
+
const control = await (0, shared_js_1.withDeadline)((0, shared_js_1.findControl)(client, updated.controlId).catch((error) => {
|
|
346
|
+
console.error('Error reading the control after a test update:', error);
|
|
347
|
+
return null;
|
|
348
|
+
}), Math.min(writeDeadline, readDeadline + 15_000));
|
|
349
|
+
const state = control === shared_js_1.DEADLINE_PASSED || !control ? null : control.state;
|
|
350
|
+
return (0, result_js_1.structuredResult)({
|
|
351
|
+
outcome: 'updated',
|
|
352
|
+
test: projectTest(updated, subdomain),
|
|
353
|
+
control: { id: updated.controlId, state, url: (0, shared_js_1.controlUrl)(updated.controlId, subdomain) },
|
|
354
|
+
...(preflight ? { preflight } : {}),
|
|
355
|
+
note: [
|
|
356
|
+
"Saved. The stored evaluation and the control's status are from the previous query until the next run.",
|
|
357
|
+
preflight ? preflightNote(preflight, nextResultsAre ?? 'BAD') : '',
|
|
358
|
+
state === 'LIVE'
|
|
359
|
+
? 'The control is LIVE, so the new query runs on the next daily evaluation.'
|
|
360
|
+
: NOTE_DRAFT_RUNS,
|
|
361
|
+
queryChanged
|
|
362
|
+
? 'Exemptions apply to evaluations of the query they were filed against; evaluate again before filing new ones.'
|
|
363
|
+
: '',
|
|
364
|
+
]
|
|
365
|
+
.filter(Boolean)
|
|
366
|
+
.join(' '),
|
|
367
|
+
...(preflight?.queryRun === 'error' ? { nextStep: FAILED_RUN_NEXT_STEP } : {}),
|
|
368
|
+
timingsMs: timings,
|
|
369
|
+
});
|
|
370
|
+
},
|
|
371
|
+
}),
|
|
372
|
+
(0, types_js_1.defineTool)({
|
|
373
|
+
name: 'delete-control-test',
|
|
374
|
+
title: 'Delete Control Test',
|
|
375
|
+
description: (0, load_description_js_1.loadDescription)('delete-control-test.md'),
|
|
376
|
+
inputSchema: { controlTestId: controlTestIdInput() },
|
|
377
|
+
outputSchema: schemas_js_1.deleteControlTestOutput,
|
|
378
|
+
// A repeat sees not_found, which is what the first delete left.
|
|
379
|
+
annotations: { ...types_js_1.MUTATE, idempotentHint: true },
|
|
380
|
+
accessDeniedHint: shared_js_1.ACCESS_DENIED_HINT,
|
|
381
|
+
errorContext: 'Error deleting control test',
|
|
382
|
+
handler: async ({ controlTestId }, client) => {
|
|
383
|
+
const startedAt = Date.now();
|
|
384
|
+
const readDeadline = startedAt + shared_js_1.AUTHORING_READ_DEADLINE_MS;
|
|
385
|
+
const timings = {};
|
|
386
|
+
const subdomainRead = (0, shared_js_1.readSubdomain)(client, timings);
|
|
387
|
+
const notFound = () => (0, result_js_1.structuredResult)({
|
|
388
|
+
outcome: 'not_found',
|
|
389
|
+
controlTestId,
|
|
390
|
+
note: 'No non-deleted test has this id, which is also what a repeated delete sees; nothing changed.',
|
|
391
|
+
});
|
|
392
|
+
let test;
|
|
393
|
+
try {
|
|
394
|
+
const read = await (0, shared_js_1.boundedRead)(timings, 'test', () => client.getControlTest(controlTestId), readDeadline);
|
|
395
|
+
if (read === shared_js_1.DEADLINE_PASSED)
|
|
396
|
+
return (0, shared_js_1.readFailed)('The test', { controlTestId });
|
|
397
|
+
test = read;
|
|
398
|
+
}
|
|
399
|
+
catch (error) {
|
|
400
|
+
if ((0, shared_js_1.isNotFound)(error))
|
|
401
|
+
return notFound();
|
|
402
|
+
throw error;
|
|
403
|
+
}
|
|
404
|
+
if (test.deleted)
|
|
405
|
+
return notFound();
|
|
406
|
+
const owner = await (0, shared_js_1.boundedRead)(timings, 'control', () => (0, shared_js_1.findControl)(client, test.controlId), readDeadline);
|
|
407
|
+
if (owner === shared_js_1.DEADLINE_PASSED)
|
|
408
|
+
return (0, shared_js_1.readFailed)('The control', { controlTestId });
|
|
409
|
+
const kept = keptOnLiveControl(test, owner);
|
|
410
|
+
if (kept)
|
|
411
|
+
return kept;
|
|
412
|
+
try {
|
|
413
|
+
await (0, shared_js_1.timed)(timings, 'delete', () => client.deleteControlTest(controlTestId));
|
|
414
|
+
}
|
|
415
|
+
catch (error) {
|
|
416
|
+
if ((0, shared_js_1.isNotFound)(error))
|
|
417
|
+
return notFound();
|
|
418
|
+
if ((0, shared_js_1.isAborted)(error)) {
|
|
419
|
+
return (0, shared_js_1.interruptedWrite)('the test was being deleted', 'Call `delete-control-test` again: `not_found` confirms it.');
|
|
420
|
+
}
|
|
421
|
+
throw error;
|
|
422
|
+
}
|
|
423
|
+
// What now decides the control's status, read after the delete and never allowed to turn
|
|
424
|
+
// the landed delete into an error.
|
|
425
|
+
const after = await (0, shared_js_1.withDeadline)(Promise.all([
|
|
426
|
+
(0, shared_js_1.findControl)(client, test.controlId),
|
|
427
|
+
client.listAttestations({ controlId: test.controlId }),
|
|
428
|
+
]).catch((error) => {
|
|
429
|
+
console.error('Error reading the control after a test delete:', error);
|
|
430
|
+
return null;
|
|
431
|
+
}), Math.min(startedAt + shared_js_1.AUTHORING_DEADLINE_MS, readDeadline + 15_000));
|
|
432
|
+
const subdomain = await (0, shared_js_1.subdomainBy)(subdomainRead, readDeadline);
|
|
433
|
+
const link = { id: test.controlId, url: (0, shared_js_1.controlUrl)(test.controlId, subdomain) };
|
|
434
|
+
if (after === shared_js_1.DEADLINE_PASSED || !after) {
|
|
435
|
+
return (0, result_js_1.structuredResult)({
|
|
436
|
+
outcome: 'deleted',
|
|
437
|
+
test: { id: test.id, name: test.name },
|
|
438
|
+
deletedTestStatus: test.status ?? null,
|
|
439
|
+
control: link,
|
|
440
|
+
note: 'Deleted. The control could not be re-read in time; `get-control` shows what now decides its status.',
|
|
441
|
+
timingsMs: timings,
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
const [control, attestations] = after;
|
|
445
|
+
const remaining = (control?.controlTests ?? []).filter((entry) => !entry.deleted && entry.id !== test.id);
|
|
446
|
+
const valid = attestations.filter((attestation) => attestation.state === 'ACTIVE').length;
|
|
447
|
+
return (0, result_js_1.structuredResult)({
|
|
448
|
+
outcome: 'deleted',
|
|
449
|
+
test: { id: test.id, name: test.name },
|
|
450
|
+
deletedTestStatus: test.status ?? null,
|
|
451
|
+
control: { ...link, name: control?.name ?? null, state: control?.state ?? null },
|
|
452
|
+
remainingTests: remaining.length,
|
|
453
|
+
note: remaining.length > 0
|
|
454
|
+
? `Deleted. ${remaining.length} test${remaining.length === 1 ? '' : 's'} remain and decide the control's status${valid > 0 ? ` with ${valid} valid attestation${valid === 1 ? '' : 's'}` : ''}.`
|
|
455
|
+
: valid > 0
|
|
456
|
+
? `Deleted. No test remains; ${valid} valid attestation${valid === 1 ? '' : 's'} decide the control's status.`
|
|
457
|
+
: 'Deleted. No test or valid attestation remains, so the control is not evaluated until one exists.',
|
|
458
|
+
timingsMs: timings,
|
|
459
|
+
});
|
|
460
|
+
},
|
|
461
|
+
}),
|
|
462
|
+
];
|
|
463
|
+
//# sourceMappingURL=tests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tests.js","sourceRoot":"","sources":["../../../../src/server/tools/compliance/tests.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,8EAAiF;AAGjF,4EAAqE;AACrE,4CAAgD;AAChD,0CAA+F;AAC/F,6CAIsB;AACtB,2CAqBqB;AAErB;;;;GAIG;AAEH,mFAAmF;AACnF,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAWhC;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG,CAAC,iEAAiE,CAAC,CAAC;AAE9F,gFAAgF;AAChF,MAAM,oBAAoB,GACxB,2FAA2F;IAC3F,6FAA6F;IAC7F,gDAAgD,CAAC;AAEnD;;;;GAIG;AACH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
|
+
import type { ControlState } from '../../../types/jupiterone.js';
|
|
2
|
+
import { type ToolDefinition } from '../types.js';
|
|
3
|
+
/** The shortest chain of moves from one state to another, or null when there is none. */
|
|
4
|
+
export declare function pathBetween(from: ControlState, to: ControlState): ControlState[] | null;
|
|
5
|
+
export declare const transitionTools: ToolDefinition[];
|
|
6
|
+
//# sourceMappingURL=transitions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transitions.d.ts","sourceRoot":"","sources":["../../../../src/server/tools/compliance/transitions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAIjE,OAAO,EAAsB,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AA8CtE,yFAAyF;AACzF,wBAAgB,WAAW,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,YAAY,GAAG,YAAY,EAAE,GAAG,IAAI,CAevF;AAqhBD,eAAO,MAAM,eAAe,EAAE,cAAc,EA4Q3C,CAAC"}
|