@jupiterone/jupiterone-mcp 2.8.0 → 2.9.1
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 +24 -10
- package/dist/client/graphql/mutations.d.ts +5 -0
- package/dist/client/graphql/mutations.d.ts.map +1 -1
- package/dist/client/graphql/mutations.js +20 -1
- package/dist/client/graphql/mutations.js.map +1 -1
- package/dist/client/graphql/queries.d.ts +15 -0
- package/dist/client/graphql/queries.d.ts.map +1 -1
- package/dist/client/graphql/queries.js +54 -1
- package/dist/client/graphql/queries.js.map +1 -1
- package/dist/client/jupiterone-client.d.ts +6 -0
- package/dist/client/jupiterone-client.d.ts.map +1 -1
- package/dist/client/jupiterone-client.js +16 -0
- package/dist/client/jupiterone-client.js.map +1 -1
- package/dist/client/services/criticality-service.d.ts +16 -0
- package/dist/client/services/criticality-service.d.ts.map +1 -0
- package/dist/client/services/criticality-service.js +72 -0
- package/dist/client/services/criticality-service.js.map +1 -0
- package/dist/generated/description-map.d.ts.map +1 -1
- package/dist/generated/description-map.js +277 -28
- package/dist/generated/description-map.js.map +1 -1
- package/dist/server/mcp-server.d.ts +10 -0
- package/dist/server/mcp-server.d.ts.map +1 -1
- package/dist/server/mcp-server.js +63 -0
- package/dist/server/mcp-server.js.map +1 -1
- package/dist/server/tools/compliance/attestations.d.ts.map +1 -1
- package/dist/server/tools/compliance/attestations.js +11 -10
- package/dist/server/tools/compliance/attestations.js.map +1 -1
- package/dist/server/tools/compliance/authoring.d.ts.map +1 -1
- package/dist/server/tools/compliance/authoring.js +36 -35
- package/dist/server/tools/compliance/authoring.js.map +1 -1
- package/dist/server/tools/compliance/controls.d.ts.map +1 -1
- package/dist/server/tools/compliance/controls.js +12 -11
- package/dist/server/tools/compliance/controls.js.map +1 -1
- package/dist/server/tools/compliance/exemptions.d.ts.map +1 -1
- package/dist/server/tools/compliance/exemptions.js +16 -15
- package/dist/server/tools/compliance/exemptions.js.map +1 -1
- package/dist/server/tools/compliance/framework.d.ts.map +1 -1
- package/dist/server/tools/compliance/framework.js +24 -23
- package/dist/server/tools/compliance/framework.js.map +1 -1
- package/dist/server/tools/compliance/graph.js +1 -1
- package/dist/server/tools/compliance/graph.js.map +1 -1
- package/dist/server/tools/compliance/requirements.d.ts.map +1 -1
- package/dist/server/tools/compliance/requirements.js +11 -10
- package/dist/server/tools/compliance/requirements.js.map +1 -1
- package/dist/server/tools/compliance/shared.d.ts +4 -32
- package/dist/server/tools/compliance/shared.d.ts.map +1 -1
- package/dist/server/tools/compliance/shared.js +11 -76
- package/dist/server/tools/compliance/shared.js.map +1 -1
- package/dist/server/tools/compliance/summary.d.ts.map +1 -1
- package/dist/server/tools/compliance/summary.js +16 -15
- package/dist/server/tools/compliance/summary.js.map +1 -1
- package/dist/server/tools/compliance/tests.d.ts.map +1 -1
- package/dist/server/tools/compliance/tests.js +26 -25
- package/dist/server/tools/compliance/tests.js.map +1 -1
- package/dist/server/tools/compliance/transitions.d.ts.map +1 -1
- package/dist/server/tools/compliance/transitions.js +15 -14
- package/dist/server/tools/compliance/transitions.js.map +1 -1
- package/dist/server/tools/criticality/context.d.ts +48 -0
- package/dist/server/tools/criticality/context.d.ts.map +1 -0
- package/dist/server/tools/criticality/context.js +90 -0
- package/dist/server/tools/criticality/context.js.map +1 -0
- package/dist/server/tools/criticality/index.d.ts +11 -0
- package/dist/server/tools/criticality/index.d.ts.map +1 -0
- package/dist/server/tools/criticality/index.js +15 -0
- package/dist/server/tools/criticality/index.js.map +1 -0
- package/dist/server/tools/criticality/ladder-delta.d.ts +86 -0
- package/dist/server/tools/criticality/ladder-delta.d.ts.map +1 -0
- package/dist/server/tools/criticality/ladder-delta.js +475 -0
- package/dist/server/tools/criticality/ladder-delta.js.map +1 -0
- package/dist/server/tools/criticality/levels-read.d.ts +43 -0
- package/dist/server/tools/criticality/levels-read.d.ts.map +1 -0
- package/dist/server/tools/criticality/levels-read.js +101 -0
- package/dist/server/tools/criticality/levels-read.js.map +1 -0
- package/dist/server/tools/criticality/read.d.ts +13 -0
- package/dist/server/tools/criticality/read.d.ts.map +1 -0
- package/dist/server/tools/criticality/read.js +214 -0
- package/dist/server/tools/criticality/read.js.map +1 -0
- package/dist/server/tools/criticality/resource.d.ts +35 -0
- package/dist/server/tools/criticality/resource.d.ts.map +1 -0
- package/dist/server/tools/criticality/resource.js +84 -0
- package/dist/server/tools/criticality/resource.js.map +1 -0
- package/dist/server/tools/criticality/schemas.d.ts +114 -0
- package/dist/server/tools/criticality/schemas.d.ts.map +1 -0
- package/dist/server/tools/criticality/schemas.js +99 -0
- package/dist/server/tools/criticality/schemas.js.map +1 -0
- package/dist/server/tools/criticality/update.d.ts +5 -0
- package/dist/server/tools/criticality/update.d.ts.map +1 -0
- package/dist/server/tools/criticality/update.js +243 -0
- package/dist/server/tools/criticality/update.js.map +1 -0
- package/dist/server/tools/errors.d.ts +3 -2
- package/dist/server/tools/errors.d.ts.map +1 -1
- package/dist/server/tools/errors.js +20 -5
- package/dist/server/tools/errors.js.map +1 -1
- package/dist/server/tools/index.d.ts.map +1 -1
- package/dist/server/tools/index.js +2 -0
- package/dist/server/tools/index.js.map +1 -1
- package/dist/server/tools/j1ql.d.ts.map +1 -1
- package/dist/server/tools/j1ql.js +70 -19
- package/dist/server/tools/j1ql.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/rule-preview.d.ts +0 -7
- package/dist/server/tools/rule-preview.d.ts.map +1 -1
- package/dist/server/tools/rule-preview.js +3 -20
- package/dist/server/tools/rule-preview.js.map +1 -1
- package/dist/server/tools/rules.d.ts.map +1 -1
- package/dist/server/tools/rules.js +2 -2
- package/dist/server/tools/rules.js.map +1 -1
- package/dist/server/tools/shared.d.ts +44 -0
- package/dist/server/tools/shared.d.ts.map +1 -0
- package/dist/server/tools/shared.js +95 -0
- package/dist/server/tools/shared.js.map +1 -0
- package/dist/server/tools/usage.d.ts +7 -0
- package/dist/server/tools/usage.d.ts.map +1 -1
- package/dist/server/tools/usage.js +128 -1
- package/dist/server/tools/usage.js.map +1 -1
- package/dist/server/tools/value-probe.d.ts +12 -1
- package/dist/server/tools/value-probe.d.ts.map +1 -1
- package/dist/server/tools/value-probe.js +6 -4
- package/dist/server/tools/value-probe.js.map +1 -1
- package/dist/types/jupiterone.d.ts +89 -0
- package/dist/types/jupiterone.d.ts.map +1 -1
- package/dist/utils/criticality-query.d.ts +97 -0
- package/dist/utils/criticality-query.d.ts.map +1 -0
- package/dist/utils/criticality-query.js +319 -0
- package/dist/utils/criticality-query.js.map +1 -0
- package/dist/utils/j1ql-filters.d.ts +3 -1
- package/dist/utils/j1ql-filters.d.ts.map +1 -1
- package/dist/utils/j1ql-filters.js +19 -7
- package/dist/utils/j1ql-filters.js.map +1 -1
- package/dist/utils/j1ql-validator.d.ts +19 -5
- package/dist/utils/j1ql-validator.d.ts.map +1 -1
- package/dist/utils/j1ql-validator.js +411 -39
- package/dist/utils/j1ql-validator.js.map +1 -1
- package/node_modules/dtrace-provider/build/Makefile +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CRITICALITY_LIMITS = void 0;
|
|
4
|
+
exports.completeQuery = completeQuery;
|
|
5
|
+
exports.checkQueryContract = checkQueryContract;
|
|
6
|
+
exports.checkCriticalityQuery = checkCriticalityQuery;
|
|
7
|
+
exports.withoutReturn = withoutReturn;
|
|
8
|
+
exports.slugifyLevelName = slugifyLevelName;
|
|
9
|
+
exports.levelDisplayName = levelDisplayName;
|
|
10
|
+
exports.criticalityRefOf = criticalityRefOf;
|
|
11
|
+
const query_language_parser_1 = require("@jupiterone/query-language-parser");
|
|
12
|
+
const j1ql_validator_js_1 = require("./j1ql-validator.js");
|
|
13
|
+
/**
|
|
14
|
+
* The asset criticality query contract and the helpers built on it, ported from the product so a
|
|
15
|
+
* query the MCP saves behaves exactly like one saved in the app.
|
|
16
|
+
*
|
|
17
|
+
* The engine is the authority (query-engine `packages/sdk/src/services/tag-sync-query-contract.ts`,
|
|
18
|
+
* scalar mode): the check here only lets an agent see why a query would be refused before the save
|
|
19
|
+
* round trip, and the save relays the engine's own message when the two ever disagree. Completion,
|
|
20
|
+
* the count reprojection and the violation split come from the web app
|
|
21
|
+
* (`artifacts/app/src/views/assets/criticality/utils/criticalityQueryContract.ts`), `withoutReturn`
|
|
22
|
+
* from `features/j1ql/src/utils/withoutReturn.ts`, the slug and display name from `ladderDraft.ts`
|
|
23
|
+
* and `levelSummary.ts`. Parser 6.7.1 here, 6.7.0 in the engine, 6.7.1 in the web app.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* The engine's limits on `origin/main`, 2026-10-31 (`MAX_QUERIES_PER_TAG`, `MAX_J1QL_LENGTH`,
|
|
27
|
+
* `MAX_VALUES_PER_LANE`, query-service's MIN_LEVELS and name cap). query-engine #2529 and web-app
|
|
28
|
+
* #2237, both open, raise the query limits to 100 queries of 2,048 characters: take the new numbers
|
|
29
|
+
* when they merge, or this mirror refuses what the engine accepts.
|
|
30
|
+
*/
|
|
31
|
+
exports.CRITICALITY_LIMITS = {
|
|
32
|
+
minLevels: 2,
|
|
33
|
+
maxLevels: 6,
|
|
34
|
+
maxQueries: 50,
|
|
35
|
+
maxQueryLength: 1024,
|
|
36
|
+
maxNameLength: 64,
|
|
37
|
+
};
|
|
38
|
+
const REQUIRED_ALIAS = 'entityId';
|
|
39
|
+
/** The alias an unaliased single-term query is given when its RETURN is added. */
|
|
40
|
+
const COMPLETED_ROOT_ALIAS = 'e';
|
|
41
|
+
function parsed(query) {
|
|
42
|
+
try {
|
|
43
|
+
// parse() is typed non-nullable but returns undefined for '', ' ', 'FIND'.
|
|
44
|
+
return (0, query_language_parser_1.parse)(query) ?? undefined;
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Appends `RETURN <first term>._id AS entityId` to a query written as a plain filter, as the app
|
|
52
|
+
* does, so `FIND DataStore WITH tag.PCI = true` saves in the shape the engine requires. The engine
|
|
53
|
+
* never completes a query itself. A query that already has a RETURN, LIMIT or SKIP is left as
|
|
54
|
+
* written and judged by the contract.
|
|
55
|
+
*/
|
|
56
|
+
function completeQuery(j1ql) {
|
|
57
|
+
const ast = parsed(j1ql);
|
|
58
|
+
if (!ast)
|
|
59
|
+
return { ok: false, violation: 'unparseable' };
|
|
60
|
+
if (ast.return || ast.limit != null || ast.skip != null) {
|
|
61
|
+
return { ok: true, j1ql, completed: false };
|
|
62
|
+
}
|
|
63
|
+
const text = j1ql.trimEnd();
|
|
64
|
+
let completed;
|
|
65
|
+
if (ast.identifier) {
|
|
66
|
+
completed = `${text} RETURN ${ast.identifier}._id AS ${REQUIRED_ALIAS}`;
|
|
67
|
+
}
|
|
68
|
+
else if (!ast.next) {
|
|
69
|
+
completed = `${text} AS ${COMPLETED_ROOT_ALIAS} RETURN ${COMPLETED_ROOT_ALIAS}._id AS ${REQUIRED_ALIAS}`;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
return { ok: false, violation: 'unaliased-root' };
|
|
73
|
+
}
|
|
74
|
+
return parsed(completed)
|
|
75
|
+
? { ok: true, j1ql: completed, completed: true }
|
|
76
|
+
: { ok: false, violation: 'uncompletable' };
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Identifiers bound to an entity, to a relationship, and those that cannot be certified whatever
|
|
80
|
+
* else they are bound to. `walkTraversals` follows `next` only, so bindings inside an optional
|
|
81
|
+
* traversal, an optional's own binding, and per-branch bindings in a type union are disqualified
|
|
82
|
+
* rather than left uncollected: each can reuse a name bound to an entity elsewhere. A name bound
|
|
83
|
+
* twice on the main chain names two terms, so the second binding retracts the first.
|
|
84
|
+
*
|
|
85
|
+
* `negated` holds the names declared on or after the first negated (`THAT !`) step of the main
|
|
86
|
+
* chain, which bind nothing. The engine's contract checks only the `entityId` column and accepts
|
|
87
|
+
* a RETURN naming one (query-engine 320de6ea6, 2026-10-30); every run then fails "Could not find
|
|
88
|
+
* node, relationship, or variable with identifier", for an unaliased type name too (j1dev,
|
|
89
|
+
* 2026-11-03). PR #62 review.
|
|
90
|
+
*/
|
|
91
|
+
function collectIdentifiers(ast) {
|
|
92
|
+
const entities = new Set();
|
|
93
|
+
const relationships = new Set();
|
|
94
|
+
const disqualified = new Set();
|
|
95
|
+
const negated = new Set();
|
|
96
|
+
const boundOnce = new Set();
|
|
97
|
+
let pastNegation = false;
|
|
98
|
+
const bind = (node) => {
|
|
99
|
+
const identifier = node.identifier ?? node.defaultIdentifier;
|
|
100
|
+
if (node.negate === true)
|
|
101
|
+
pastNegation = true;
|
|
102
|
+
if (!identifier)
|
|
103
|
+
return;
|
|
104
|
+
if (pastNegation)
|
|
105
|
+
negated.add(identifier);
|
|
106
|
+
if (boundOnce.has(identifier)) {
|
|
107
|
+
disqualified.add(identifier);
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
boundOnce.add(identifier);
|
|
111
|
+
if (node.target === 'entities')
|
|
112
|
+
entities.add(identifier);
|
|
113
|
+
else if (node.target === 'relationships')
|
|
114
|
+
relationships.add(identifier);
|
|
115
|
+
};
|
|
116
|
+
const disqualify = (node) => {
|
|
117
|
+
const identifier = node.identifier ?? node.defaultIdentifier;
|
|
118
|
+
if (identifier)
|
|
119
|
+
disqualified.add(identifier);
|
|
120
|
+
};
|
|
121
|
+
const visit = (node, insideOptional = false) => {
|
|
122
|
+
if (insideOptional)
|
|
123
|
+
disqualify(node);
|
|
124
|
+
else
|
|
125
|
+
bind(node);
|
|
126
|
+
for (const branch of node.nodes ?? [])
|
|
127
|
+
disqualify(branch);
|
|
128
|
+
for (const optional of node.optionalTraversals ?? []) {
|
|
129
|
+
if (optional?.identifier)
|
|
130
|
+
disqualified.add(optional.identifier);
|
|
131
|
+
// Guarded: walkTraversals dereferences `next` unguarded and throws on undefined.
|
|
132
|
+
if (optional?.traversal) {
|
|
133
|
+
(0, query_language_parser_1.walkTraversals)(optional.traversal, (n) => visit(n, true));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
(0, query_language_parser_1.walkTraversals)(ast, visit);
|
|
138
|
+
return { entities, relationships, disqualified, negated };
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Whether the query returns `<entity>._id AS entityId` over the complete matched set. Parsed, not
|
|
142
|
+
* substring-matched: `e.name AS entityId`, `count(e) AS entityId` and `r._id AS entityId` pass a
|
|
143
|
+
* text test and then return the wrong column, a number, or relationship ids. The engine reports
|
|
144
|
+
* the last four violations as one; they are split here because each is fixed differently.
|
|
145
|
+
*/
|
|
146
|
+
function checkQueryContract(j1ql) {
|
|
147
|
+
const ast = parsed(j1ql);
|
|
148
|
+
if (!ast)
|
|
149
|
+
return { ok: false, violation: 'unparseable' };
|
|
150
|
+
let bound;
|
|
151
|
+
try {
|
|
152
|
+
bound = collectIdentifiers(ast);
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
return { ok: false, violation: 'unparseable' };
|
|
156
|
+
}
|
|
157
|
+
// A `LIMIT n` makes the query report n assets as the whole set, and every asset past n is read
|
|
158
|
+
// as no longer matching and loses its level.
|
|
159
|
+
if (ast.limit != null || ast.skip != null)
|
|
160
|
+
return { ok: false, violation: 'truncated' };
|
|
161
|
+
const selectors = ast.return?.projections?.selectors;
|
|
162
|
+
if (!Array.isArray(selectors))
|
|
163
|
+
return { ok: false, violation: 'missing-alias' };
|
|
164
|
+
const aliased = selectors.filter((selector) => selector?.alias === REQUIRED_ALIAS);
|
|
165
|
+
if (aliased.length === 0)
|
|
166
|
+
return { ok: false, violation: 'missing-alias' };
|
|
167
|
+
// Neo4j refuses a RETURN with two columns of one name, so this would fail on every run.
|
|
168
|
+
if (aliased.length > 1)
|
|
169
|
+
return { ok: false, violation: 'duplicate-alias' };
|
|
170
|
+
// Any column, not only entityId: the count the save reports re-projects only the entityId
|
|
171
|
+
// term, so it would succeed while every run failed (PR #62 review).
|
|
172
|
+
if ([...(0, j1ql_validator_js_1.namedAliases)(ast.return)].some((name) => bound.negated.has(name))) {
|
|
173
|
+
return { ok: false, violation: 'negated-binding' };
|
|
174
|
+
}
|
|
175
|
+
const [selector] = aliased;
|
|
176
|
+
const source = selector.sourceIdentifier;
|
|
177
|
+
if (source && bound.disqualified.has(source)) {
|
|
178
|
+
return { ok: false, violation: 'ambiguous-binding' };
|
|
179
|
+
}
|
|
180
|
+
if (selector.field === '_id' &&
|
|
181
|
+
source &&
|
|
182
|
+
bound.entities.has(source) &&
|
|
183
|
+
!bound.relationships.has(source)) {
|
|
184
|
+
return { ok: true, entityIdentifier: source };
|
|
185
|
+
}
|
|
186
|
+
return { ok: false, violation: 'not-an-entity-id' };
|
|
187
|
+
}
|
|
188
|
+
const VIOLATION_MESSAGES = {
|
|
189
|
+
unparseable: 'This is not valid J1QL.',
|
|
190
|
+
truncated: 'Remove LIMIT and SKIP: the query defines the complete set for its level, so anything it ' +
|
|
191
|
+
'leaves out loses the level.',
|
|
192
|
+
'missing-alias': "A RETURN has to return one entity's _id AS entityId. Or leave the RETURN out and it is added.",
|
|
193
|
+
'duplicate-alias': 'Return entityId once.',
|
|
194
|
+
'not-an-entity-id': "entityId has to be an entity's _id, not another property, a count or a relationship: " +
|
|
195
|
+
'FIND Host AS h RETURN h._id AS entityId',
|
|
196
|
+
'ambiguous-binding': 'entityId names a binding made twice, inside an optional traversal or in a type union. ' +
|
|
197
|
+
'Return one term bound on the main traversal.',
|
|
198
|
+
'negated-binding': 'The RETURN names a term on or after a negated (THAT !) step, which matches what is absent ' +
|
|
199
|
+
'and binds nothing, so every run would fail. Return only the entity before the "!": ' +
|
|
200
|
+
'FIND Host AS h THAT !HAS Agent RETURN h._id AS entityId',
|
|
201
|
+
'unaliased-root': 'This query traverses from its first term, so that term needs an alias to return: ' +
|
|
202
|
+
'FIND Host AS h THAT …',
|
|
203
|
+
uncompletable: 'ORDER BY, or a WHERE on an unaliased term, needs a RETURN before it. Alias the first term ' +
|
|
204
|
+
'and drop ORDER BY, or write RETURN <alias>._id AS entityId yourself.',
|
|
205
|
+
'too-long': `A query is at most ${exports.CRITICALITY_LIMITS.maxQueryLength} characters, counting the RETURN the save adds.`,
|
|
206
|
+
};
|
|
207
|
+
/** One query, completed the way the save will send it and checked against the contract. */
|
|
208
|
+
function checkCriticalityQuery(j1ql) {
|
|
209
|
+
const completion = completeQuery(j1ql.trim());
|
|
210
|
+
if (!completion.ok) {
|
|
211
|
+
return {
|
|
212
|
+
ok: false,
|
|
213
|
+
violation: completion.violation,
|
|
214
|
+
message: VIOLATION_MESSAGES[completion.violation],
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
const contract = checkQueryContract(completion.j1ql);
|
|
218
|
+
if (!contract.ok) {
|
|
219
|
+
return {
|
|
220
|
+
ok: false,
|
|
221
|
+
violation: contract.violation,
|
|
222
|
+
message: VIOLATION_MESSAGES[contract.violation],
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
if (completion.j1ql.length > exports.CRITICALITY_LIMITS.maxQueryLength) {
|
|
226
|
+
return { ok: false, violation: 'too-long', message: VIOLATION_MESSAGES['too-long'] };
|
|
227
|
+
}
|
|
228
|
+
const traversal = withoutReturn(completion.j1ql);
|
|
229
|
+
return {
|
|
230
|
+
ok: true,
|
|
231
|
+
j1ql: completion.j1ql,
|
|
232
|
+
completed: completion.completed,
|
|
233
|
+
countQuery: traversal === null
|
|
234
|
+
? null
|
|
235
|
+
: `${traversal} RETURN count(${contract.entityIdentifier}) AS matchCount`,
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
/** `next()` skips whitespace and comments. */
|
|
239
|
+
function tokensOf(query) {
|
|
240
|
+
const tokens = [];
|
|
241
|
+
query_language_parser_1.lexer.reset(query);
|
|
242
|
+
for (let token = query_language_parser_1.lexer.next(); token; token = query_language_parser_1.lexer.next())
|
|
243
|
+
tokens.push(token);
|
|
244
|
+
return tokens;
|
|
245
|
+
}
|
|
246
|
+
/** A subquery's own `RETURN` sits inside its parentheses, so only depth 0 counts. */
|
|
247
|
+
function outsideProjection(tokens) {
|
|
248
|
+
let depth = 0;
|
|
249
|
+
let dropping = false;
|
|
250
|
+
return tokens.filter((token) => {
|
|
251
|
+
if (token.type === 'OPEN_PARENTHESIS')
|
|
252
|
+
depth++;
|
|
253
|
+
if (token.type === 'CLOSE_PARENTHESIS')
|
|
254
|
+
depth--;
|
|
255
|
+
if (depth === 0 && (token.type === 'RETURN' || token.type === 'ORDER'))
|
|
256
|
+
dropping = true;
|
|
257
|
+
if (depth === 0 && (token.type === 'SKIP' || token.type === 'LIMIT'))
|
|
258
|
+
dropping = false;
|
|
259
|
+
return !dropping;
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
function join(tokens) {
|
|
263
|
+
let out = '';
|
|
264
|
+
let end = -1;
|
|
265
|
+
for (const token of tokens) {
|
|
266
|
+
if (end >= 0 && token.offset > end)
|
|
267
|
+
out += ' ';
|
|
268
|
+
out += token.text;
|
|
269
|
+
end = token.offset + token.text.length;
|
|
270
|
+
}
|
|
271
|
+
return out;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* A query with its `RETURN` and `ORDER BY` dropped, rebuilt from its own tokens so every literal
|
|
275
|
+
* keeps the quoting it was written with (the parser's reverser prints every string in double
|
|
276
|
+
* quotes, which breaks `'o\'brien'`). Null when the query does not parse, when what is left does
|
|
277
|
+
* not, or when it has a HAVING, which filters on the projection.
|
|
278
|
+
*/
|
|
279
|
+
function withoutReturn(query) {
|
|
280
|
+
const ast = parsed(query);
|
|
281
|
+
if (!ast || ast.having)
|
|
282
|
+
return null;
|
|
283
|
+
const out = join(outsideProjection(tokensOf(query)));
|
|
284
|
+
return out && parsed(out) ? out : null;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* The value a level applies as: its name, reduced the way the app and core-ai reduce it, so a
|
|
288
|
+
* level named here and one named there carry the same `j1.criticality` value.
|
|
289
|
+
*/
|
|
290
|
+
function slugifyLevelName(name) {
|
|
291
|
+
return name
|
|
292
|
+
.toLowerCase()
|
|
293
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
294
|
+
.replace(/^-+|-+$/g, '')
|
|
295
|
+
.slice(0, 40)
|
|
296
|
+
.replace(/-+$/, '');
|
|
297
|
+
}
|
|
298
|
+
/** A level's name, or for a level saved before names were stored, its slug as words. */
|
|
299
|
+
function levelDisplayName(level) {
|
|
300
|
+
if (level.name)
|
|
301
|
+
return level.name;
|
|
302
|
+
const words = level.slug.split(/[-_]+/).filter(Boolean).join(' ');
|
|
303
|
+
if (words === '')
|
|
304
|
+
return level.slug;
|
|
305
|
+
return words.charAt(0).toUpperCase() + words.slice(1);
|
|
306
|
+
}
|
|
307
|
+
/** String literals in either quote, so a property name quoted inside a value never counts. */
|
|
308
|
+
const STRING_LITERAL = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"/g;
|
|
309
|
+
function criticalityRefOf(query) {
|
|
310
|
+
const names = query.replace(STRING_LITERAL, "''");
|
|
311
|
+
if (/\bj1\.(?:normalized)?criticality\b|\bj1\.riskscore\b/i.test(names))
|
|
312
|
+
return 'native';
|
|
313
|
+
if (/\btag\.crownjewel\b/i.test(names))
|
|
314
|
+
return 'legacy';
|
|
315
|
+
if (/#criticalasset\b|\btag\.criticalasset\b/i.test(names))
|
|
316
|
+
return 'customer';
|
|
317
|
+
return undefined;
|
|
318
|
+
}
|
|
319
|
+
//# sourceMappingURL=criticality-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"criticality-query.js","sourceRoot":"","sources":["../../src/utils/criticality-query.ts"],"names":[],"mappings":";;;AA8EA,sCAmBC;AA8ED,gDA4CC;AA4CD,sDA8BC;A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AAC,CAAC;AACxD,CAAC;AAED,8FAA8F;AAC9F,MAAM,cAAc,GAAG,sCAAsC,CAAC;AAW9D,SAAgB,gBAAgB,CAAC,KAAa;IAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;IAClD,IAAI,uDAAuD,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IACzF,IAAI,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IACxD,IAAI,0CAA0C,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,UAAU,CAAC;IAC9E,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -49,7 +49,9 @@ export declare function aliasEntityTargets(query: string): Map<string, string |
|
|
|
49
49
|
* the query text. Fails open — any parse surprise yields an empty list, never an exception, because
|
|
50
50
|
* a diagnosis is a convenience and must never break the call it is attached to.
|
|
51
51
|
*/
|
|
52
|
-
export declare function extractStringEqualityFilters(query: string
|
|
52
|
+
export declare function extractStringEqualityFilters(query: string, options?: {
|
|
53
|
+
includeWildcard?: boolean;
|
|
54
|
+
}): StringEqualityFilter[];
|
|
53
55
|
/** Extract every `field ~= 'string'` comparison in a query, read from both clauses the same way. */
|
|
54
56
|
export declare function extractStringContainsFilters(query: string): StringContainsFilter[];
|
|
55
57
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"j1ql-filters.d.ts","sourceRoot":"","sources":["../../src/utils/j1ql-filters.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,GAAG,GAAG,IAAI,CAAC;IACrB,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,IAAI,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"j1ql-filters.d.ts","sourceRoot":"","sources":["../../src/utils/j1ql-filters.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,GAAG,GAAG,IAAI,CAAC;IACrB,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,IAAI,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAkLD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CAM5E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,MAAM,EACb,OAAO,GAAE;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAO,GAC1C,oBAAoB,EAAE,CAExB;AAED,oGAAoG;AACpG,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,MAAM,GAAG,oBAAoB,EAAE,CAElF;AA8BD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAWtD"}
|
|
@@ -28,6 +28,10 @@ function hopTarget(hop) {
|
|
|
28
28
|
function entityTarget(hop) {
|
|
29
29
|
return hop.target === 'relationships' ? null : hopTarget(hop);
|
|
30
30
|
}
|
|
31
|
+
/** `entityTarget`, with an entity hop that names no type or class (`FIND *`) read as `*`. */
|
|
32
|
+
function filterTarget(hop, includeWildcard) {
|
|
33
|
+
return entityTarget(hop) ?? (includeWildcard && hop.target !== 'relationships' ? '*' : null);
|
|
34
|
+
}
|
|
31
35
|
/**
|
|
32
36
|
* Every literal a comparison compares against: one value, or each arm of `('a' OR 'b')`.
|
|
33
37
|
*
|
|
@@ -117,10 +121,10 @@ function walkHops(query) {
|
|
|
117
121
|
* Relationship hops map to null on purpose: they are addressable, so leaving them out would let the
|
|
118
122
|
* lookup fall through, and `FIND HAS` is not something that can be counted.
|
|
119
123
|
*/
|
|
120
|
-
function aliasTargets(hops) {
|
|
124
|
+
function aliasTargets(hops, includeWildcard = false) {
|
|
121
125
|
const targetOf = new Map();
|
|
122
126
|
for (const hop of hops) {
|
|
123
|
-
const target =
|
|
127
|
+
const target = filterTarget(hop, includeWildcard);
|
|
124
128
|
for (const alias of [hop.identifier, hop.defaultIdentifier]) {
|
|
125
129
|
if (alias && !targetOf.has(alias))
|
|
126
130
|
targetOf.set(alias, target);
|
|
@@ -157,20 +161,28 @@ function aliasEntityTargets(query) {
|
|
|
157
161
|
* the query text. Fails open — any parse surprise yields an empty list, never an exception, because
|
|
158
162
|
* a diagnosis is a convenience and must never break the call it is attached to.
|
|
159
163
|
*/
|
|
160
|
-
function extractStringEqualityFilters(query) {
|
|
161
|
-
return extractStringFilters(query, EQUALITY_OPERATORS);
|
|
164
|
+
function extractStringEqualityFilters(query, options = {}) {
|
|
165
|
+
return extractStringFilters(query, EQUALITY_OPERATORS, options);
|
|
162
166
|
}
|
|
163
167
|
/** Extract every `field ~= 'string'` comparison in a query, read from both clauses the same way. */
|
|
164
168
|
function extractStringContainsFilters(query) {
|
|
165
169
|
return extractStringFilters(query, CONTAINS_OPERATORS);
|
|
166
170
|
}
|
|
167
|
-
|
|
171
|
+
/**
|
|
172
|
+
* `includeWildcard` also reads the filters on a `FIND *` hop, as target `*`, in WITH and in a WHERE
|
|
173
|
+
* naming its alias (`FIND * AS e WHERE e.j1.criticality = '…'`, PR #62 review). Off by default:
|
|
174
|
+
* the probes behind every other caller would scan every entity in the account. The asset
|
|
175
|
+
* criticality diagnosis turns it on, because `FIND * WITH j1.criticality = '…'` is how agents
|
|
176
|
+
* write a level filter and it answers from the account's levels, not from a probe.
|
|
177
|
+
*/
|
|
178
|
+
function extractStringFilters(query, operators, options = {}) {
|
|
168
179
|
const out = [];
|
|
169
180
|
try {
|
|
181
|
+
const includeWildcard = options.includeWildcard ?? false;
|
|
170
182
|
const hops = walkHops(query);
|
|
171
|
-
const targetOf = aliasTargets(hops);
|
|
183
|
+
const targetOf = aliasTargets(hops, includeWildcard);
|
|
172
184
|
for (const hop of hops) {
|
|
173
|
-
const target =
|
|
185
|
+
const target = filterTarget(hop, includeWildcard);
|
|
174
186
|
if (target)
|
|
175
187
|
collectHopFilters(hop.filters, target, operators, out);
|
|
176
188
|
collectPredicateFilters(hop.predicateFilters, targetOf, operators, out);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"j1ql-filters.js","sourceRoot":"","sources":["../../src/utils/j1ql-filters.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"j1ql-filters.js","sourceRoot":"","sources":["../../src/utils/j1ql-filters.ts"],"names":[],"mappings":";;AAyNA,gDAMC;AAeD,oEAKC;AAGD,oEAEC;AAqCD,wCAWC;AAxSD,6EAA0D;AAmC1D,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;AACrE,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAEhE,iGAAiG;AACjG,MAAM,QAAQ,GAAG,EAAE,CAAC;AA4BpB,2FAA2F;AAC3F,SAAS,SAAS,CAAC,GAAQ;IACzB,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG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AAE,eAAe,CAAC,CAAC;YAClD,IAAI,MAAM;gBAAE,iBAAiB,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;YACnE,uBAAuB,CAAC,GAAG,CAAC,gBAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,KAAa;IAC1C,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,IAAI,CAAC;QACH,KAAK,MAAM,GAAG,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAClC,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;YACjC,IAAI,MAAM,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC;gBAAE,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -2,12 +2,17 @@ interface ValidationResult {
|
|
|
2
2
|
isValid: boolean;
|
|
3
3
|
error?: string;
|
|
4
4
|
suggestion?: string;
|
|
5
|
+
/** The kinds of mechanical repair behind a corrected query in `suggestion`, for telemetry. */
|
|
6
|
+
corrections?: string[];
|
|
5
7
|
}
|
|
6
8
|
export declare const RESERVED_WORDS: ReadonlySet<string>;
|
|
7
9
|
export declare class J1qlSyntaxError extends Error {
|
|
8
10
|
readonly suggestion?: string | undefined;
|
|
9
|
-
|
|
11
|
+
readonly corrections?: string[] | undefined;
|
|
12
|
+
constructor(message: string, suggestion?: string | undefined, corrections?: string[] | undefined);
|
|
10
13
|
}
|
|
14
|
+
/** Every alias a subtree names (`sourceIdentifier`), aggregates included. */
|
|
15
|
+
export declare function namedAliases(node: unknown, found?: Set<string>, seen?: Set<object>): Set<string>;
|
|
11
16
|
export declare class J1QLValidator {
|
|
12
17
|
/**
|
|
13
18
|
* Statically validates a J1QL query using the same parser the JupiterOne query service runs
|
|
@@ -20,11 +25,20 @@ export declare class J1QLValidator {
|
|
|
20
25
|
*/
|
|
21
26
|
handleQueryError(error: any, query: string): ValidationResult;
|
|
22
27
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
28
|
+
* The hint with the caller's own query repaired appended, when the gate refuses the query, a
|
|
29
|
+
* repair applies, and the repaired query passes the gate. The prose hint stays above it, so an
|
|
30
|
+
* agent that wants a different fix still has the rule. A hint that already carries a corrected
|
|
31
|
+
* query is left alone, and so is a query the gate accepts: its failure came from somewhere a
|
|
32
|
+
* syntax repair cannot reach (a timeout, a server error). `rejectedByGate` skips re-parsing a
|
|
33
|
+
* query the gate has just refused: the parser's time grows faster than the query (68 ms at
|
|
34
|
+
* 4.6 KB), and a query refused only for its LIMIT would otherwise be parsed in full three times.
|
|
35
|
+
*
|
|
36
|
+
* The prose alone left these mistakes uncorrected in every one of 2.6.1–2.8.0's rejections of
|
|
37
|
+
* them (66 distinct, 2026-11-04 log review), and one query often carries several, so the
|
|
38
|
+
* repairs run together and the agent gets one query that parses.
|
|
26
39
|
*/
|
|
27
|
-
private
|
|
40
|
+
private withRepair;
|
|
41
|
+
private hintFor;
|
|
28
42
|
/**
|
|
29
43
|
* Consolidated error patterns for better maintainability
|
|
30
44
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"j1ql-validator.d.ts","sourceRoot":"","sources":["../../src/utils/j1ql-validator.ts"],"names":[],"mappings":"AAEA,UAAU,gBAAgB;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"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