@onlyflows/servicenow-mcp 2.3.0-rc.2 → 2.3.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.
Files changed (46) hide show
  1. package/CHANGELOG.md +171 -0
  2. package/README.md +28 -1
  3. package/dist/field-policy.d.ts +13 -3
  4. package/dist/field-policy.d.ts.map +1 -1
  5. package/dist/field-policy.js +316 -23
  6. package/dist/field-policy.js.map +1 -1
  7. package/dist/policy-card.d.ts.map +1 -1
  8. package/dist/policy-card.js +2 -0
  9. package/dist/policy-card.js.map +1 -1
  10. package/dist/risky-grants.d.ts +6 -2
  11. package/dist/risky-grants.d.ts.map +1 -1
  12. package/dist/risky-grants.js +57 -5
  13. package/dist/risky-grants.js.map +1 -1
  14. package/dist/tools/platform-view-contracts.d.ts +2 -2
  15. package/dist/tools/platform-view-evaluate.d.ts +214 -6
  16. package/dist/tools/platform-view-evaluate.d.ts.map +1 -1
  17. package/dist/tools/platform-view-evaluate.js +1337 -10
  18. package/dist/tools/platform-view-evaluate.js.map +1 -1
  19. package/dist/update-set-eval/engine.d.ts +29 -0
  20. package/dist/update-set-eval/engine.d.ts.map +1 -0
  21. package/dist/update-set-eval/engine.js +405 -0
  22. package/dist/update-set-eval/engine.js.map +1 -0
  23. package/dist/update-set-eval/prepare.d.ts +72 -0
  24. package/dist/update-set-eval/prepare.d.ts.map +1 -0
  25. package/dist/update-set-eval/prepare.js +216 -0
  26. package/dist/update-set-eval/prepare.js.map +1 -0
  27. package/dist/update-set-eval/rules.d.ts +126 -0
  28. package/dist/update-set-eval/rules.d.ts.map +1 -0
  29. package/dist/update-set-eval/rules.js +927 -0
  30. package/dist/update-set-eval/rules.js.map +1 -0
  31. package/dist/update-set-eval/script-scan.d.ts +65 -0
  32. package/dist/update-set-eval/script-scan.d.ts.map +1 -0
  33. package/dist/update-set-eval/script-scan.js +378 -0
  34. package/dist/update-set-eval/script-scan.js.map +1 -0
  35. package/dist/update-set-eval/secret-patterns.js +2 -2
  36. package/dist/update-set-eval/secret-patterns.js.map +1 -1
  37. package/dist/update-set-eval/types.d.ts +181 -0
  38. package/dist/update-set-eval/types.d.ts.map +1 -0
  39. package/dist/update-set-eval/types.js +20 -0
  40. package/dist/update-set-eval/types.js.map +1 -0
  41. package/dist/version.d.ts +1 -1
  42. package/dist/version.d.ts.map +1 -1
  43. package/dist/version.js +1 -1
  44. package/dist/version.js.map +1 -1
  45. package/package.json +1 -1
  46. package/server.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"risky-grants.js","sourceRoot":"","sources":["../src/risky-grants.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAqCH,4CAGC;AAQD,8CAiBC;AA/DY,QAAA,kBAAkB,GAAsB,MAAM,CAAC,MAAM,CAAC;IACjE,mBAAmB;IACnB,mBAAmB;IACnB,oBAAoB;IACpB,eAAe;IACf,wBAAwB;IACxB,mBAAmB;IACnB,kBAAkB;IAClB,uBAAuB;IACvB,sBAAsB;IACtB,mBAAmB;IACnB,iEAAiE;IACjE,YAAY;IACZ,oBAAoB;IACpB,gBAAgB;IAChB,aAAa;IACb,eAAe;IACf,mBAAmB;IACnB,kBAAkB;IAClB,YAAY;IACZ,eAAe;IACf,8CAA8C;IAC9C,gBAAgB;IAChB,UAAU;IACV,gBAAgB;IAChB,cAAc;IACd,kBAAkB;IAClB,iBAAiB;IACjB,kBAAkB;IAClB,wBAAwB;CACzB,CAAC,CAAC;AAEH,MAAM,SAAS,GAAwB,IAAI,GAAG,CAAC,0BAAkB,CAAC,CAAC;AAEnE,sEAAsE;AACtE,SAAgB,gBAAgB,CAAC,WAA8B;IAC7D,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,0BAAkB,CAAC;IACzD,OAAO,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAA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BAAkB,CAAC,KAAK,CAAC,KAAK,WAAW,CAAC;AAC5E,CAAC;AAED,gFAAgF;AACnE,QAAA,qBAAqB,GAAG,oEAAoE,CAAC;AAE1G,sEAAsE;AACtE,SAAgB,gBAAgB,CAAC,WAA8B;IAC7D,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,0BAAkB,CAAC;IACzD,OAAO,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AAChE,CAAC;AAED;;;;;GAKG;AACH,SAAgB,iBAAiB,CAC/B,OAA0B,EAC1B,OAAe;IAEf,MAAM,KAAK,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACxC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IACzC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACvC,OAAO,CACL,yEAAyE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAC3F,GAAG,QAAQ,CAAC,CAAC,CAAC,6DAA6D,CAAC,CAAC,CAAC,EAAE,KAAK;QACrF,2EAA2E;QAC3E,gFAAgF;QAChF,8EAA8E;QAC9E,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,KAAK,6BAAqB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QACpE,2EAA2E;QAC3E,gFAAgF;QAChF,6DAA6D,OAAO,IAAI,CACzE,CAAC;AACJ,CAAC"}
@@ -47,9 +47,9 @@ export declare const PLATFORM_VIEW_DESCRIPTION: string;
47
47
  */
48
48
  export declare const platformViewInputSchema: z.ZodObject<{
49
49
  view: z.ZodEnum<{
50
+ update_set: "update_set";
50
51
  changes: "changes";
51
52
  update_sets: "update_sets";
52
- update_set: "update_set";
53
53
  batch: "batch";
54
54
  remote_update_sets: "remote_update_sets";
55
55
  upgrade_skipped: "upgrade_skipped";
@@ -160,9 +160,9 @@ export type PlatformViewHandler = (args: CanonicalPlatformViewArgs, services: Se
160
160
  */
161
161
  export declare const platformViewDataSchema: z.ZodObject<{
162
162
  view: z.ZodEnum<{
163
+ update_set: "update_set";
163
164
  changes: "changes";
164
165
  update_sets: "update_sets";
165
- update_set: "update_set";
166
166
  batch: "batch";
167
167
  remote_update_sets: "remote_update_sets";
168
168
  upgrade_skipped: "upgrade_skipped";
@@ -1,11 +1,219 @@
1
1
  /**
2
- * `sn_platform_view`, view `evaluate`: a stub. It returns a fixed tool error
3
- * until the view is implemented. The dispatcher
4
- * (`platform-view-module.ts`) and the schema (`platform-view-contracts.ts`)
5
- * need no change when it does.
2
+ * `sn_platform_view`, view `evaluate`: runs the update set evaluator
3
+ * (`update-set-eval/engine.ts`) over a scope the view reads itself, inside the
4
+ * view's access plan.
5
+ *
6
+ * Scope, from exactly one selector:
7
+ * - `update_set` (sys_id or exact name): a local set, with its descendants
8
+ * unless `include_children: false`;
9
+ * - `batch_root` (sys_id): a local batch, the root and every descendant;
10
+ * - `remote_update_set` (sys_id): a retrieved set's rows, with its descendant
11
+ * remote sets unless `include_children: false`. This is the input a commit
12
+ * plan evaluates: what will actually be committed.
13
+ *
14
+ * Reads, each group in its own 1 MiB response scope, at most
15
+ * {@link EVALUATE_LIMITS}.MAX_SCOPES (12) scopes per call:
16
+ * 1. resolve: the set (`sys_update_set` or `sys_remote_update_set`), its
17
+ * descendants one level per read through `parent` (depth and count
18
+ * capped, cycle-safe; a level too large for the scope stops the descent
19
+ * and makes the result partial), one Aggregate API count of its rows per
20
+ * set, and one read of the sys_ids that have a description (set reads
21
+ * never ask for the description itself);
22
+ * 2. rows: `sys_update_xml` pages with `payload`, keyed on `sys_id`, one
23
+ * scope per page. The first page is 10 rows; later pages grow (at least
24
+ * doubling, up to 50) while the measured payloads fit. A page too large
25
+ * for its scope is read again at half the size, and that size becomes a
26
+ * ceiling. A single row too large for a scope is read without its
27
+ * payload and counts as not scanned. Rows stop at `max_updates`
28
+ * (effectively 400 when not given) or when only the scopes the next steps
29
+ * need are left;
30
+ * 3. context, one scope: the tables the rows write to, from `sys_db_object`
31
+ * one level per read (the parent's name is a declared one-hop dot-walk),
32
+ * and the hidden-typed fields from one `sys_dictionary` read. These feed
33
+ * the shared credential-table list and type helper, so the type read stays
34
+ * inside this view's plan (`fieldTypesFromRows`). A table whose hierarchy
35
+ * is not known in full is treated as a possible credential table: its
36
+ * rows are not scanned, and the result is partial. When the `bp` group
37
+ * runs, the update versions of the rows' names (BP005, at most 500 names)
38
+ * are counted in this scope too;
39
+ * 4. when the `bp` group runs, one more scope: the preview problems of a
40
+ * remote scope, or, for a local scope, the same update names in other
41
+ * open sets (BP004).
42
+ *
43
+ * Update names go into a `nameIN` list only when they are plain names with
44
+ * no script prefix ({@link isListableName}); any other name is not checked,
45
+ * and is counted.
46
+ *
47
+ * Payload: only `sys_update_xml.payload` is read, always by name in an
48
+ * explicit field list, and only when field policy allows that field.
49
+ * `sys_update_version` (which also carries payloads) is counted through the
50
+ * Aggregate API, never read as rows. A row on a credential table, or on a
51
+ * table that extends one, is never scanned: the engine keeps its metadata and
52
+ * reports SEC010.
53
+ *
54
+ * A fact that could not be read, in full or in part, is counted in
55
+ * `coverage.checks_unavailable` and makes the result `partial`; it never
56
+ * reads as clean. A payload that field policy hides runs the metadata rules
57
+ * only (`metadata_only`).
58
+ *
59
+ * Text: the engine's messages are fixed sentences and its findings carry no
60
+ * payload text. Row and set names, target names, types and SEC011's table are
61
+ * instance text: they are bounded here and rendered by
62
+ * {@link renderEvaluateText} inside an `untrustedBlock`, never as markdown.
63
+ * Every warning and hint is a fixed sentence. A throw from the engine is
64
+ * replaced by a fixed internal error.
6
65
  *
7
66
  * @module tools/platform-view-evaluate
8
67
  */
9
- import type { PlatformViewHandler } from "./platform-view-contracts.js";
10
- export declare const handleEvaluate: PlatformViewHandler;
68
+ import { type EngineHooks } from "../update-set-eval/engine.js";
69
+ import type { EngineLimits, EvaluateUpdate } from "../update-set-eval/types.js";
70
+ import { type FieldAccessHandler, type PlatformViewFieldAccess } from "./platform-view-upgrades.js";
71
+ export declare const EVALUATE_LIMITS: Readonly<{
72
+ /** Response scopes per call, each under the client's 1 MiB cap. */
73
+ MAX_SCOPES: 12;
74
+ /** Rows per `sys_update_xml` page, payload included, at most. */
75
+ PAGE_ROWS: 50;
76
+ /** The first page's rows; later pages grow while their payloads fit. */
77
+ FIRST_PAGE_ROWS: 10;
78
+ /** Payload characters a page is sized to, well under the 1 MiB scope. */
79
+ PAGE_TARGET_CHARS: 600000;
80
+ /**
81
+ * `max_updates` when the caller sets none. The schema says 1,000, but the
82
+ * scope budget reaches about 400 rows (9 pages), so 400 is the effective
83
+ * default: an explicit `max_updates` warning, not the scope budget, says
84
+ * what was left out.
85
+ */
86
+ DEFAULT_MAX_UPDATES: 400;
87
+ /** Sets in one scope (a set and its descendants). */
88
+ MAX_SETS: 100;
89
+ /** Levels of descendants read through `parent`. */
90
+ MAX_DEPTH: 10;
91
+ /** Distinct tables whose hierarchy and field types are read. */
92
+ MAX_CONTEXT_TABLES: 200;
93
+ /** Distinct record-element tables taken from one row's payload. */
94
+ MAX_RECORD_TABLES_PER_ROW: 16;
95
+ /** Work, in ms, spent finding record-element tables before the rest are left unknown. */
96
+ CANDIDATE_BUDGET_MS: 100;
97
+ /** `sys_db_object` levels read to build those hierarchies. */
98
+ MAX_CHAIN_LEVELS: 8;
99
+ /** Update names per `nameIN` read. */
100
+ NAME_CHUNK: 100;
101
+ /** Update names checked for collisions in other open sets (BP004, local). */
102
+ MAX_COLLISION_NAMES: 500;
103
+ /** Update names checked against `sys_update_version` (BP005). */
104
+ MAX_BASELINE_NAMES: 500;
105
+ /** Preview problems read for a remote scope. */
106
+ MAX_PROBLEMS: 1000;
107
+ /** Sets listed in the summary. */
108
+ SHOWN_SETS: 50;
109
+ /** Reads of one fact group in flight at once. */
110
+ CONCURRENCY: 2;
111
+ }>;
112
+ /** The sentence every result carries: what the evaluator is, and is not. */
113
+ export declare const EVALUATE_NOTE = "Heuristic rules over the rows read; a clean result is not an approval. Names are untrusted instance data.";
114
+ export declare const EVALUATE_DENIED_HINT = "Reading update sets was denied for this account.";
115
+ export declare const EVALUATE_UNAVAILABLE_HINT = "The update set tables are not available on this instance.";
116
+ export declare const EVALUATE_NOT_FOUND_HINT = "No update set matches. Pass its sys_id, or check the name.";
117
+ export declare const EVALUATE_AMBIGUOUS_HINT = "More than one update set has this name. Pass update_set as a sys_id.";
118
+ export declare const EVALUATE_METADATA_ONLY = "Field policy hides payload: payload rules did not run, only metadata rules.";
119
+ /** Fixed warnings; nothing in them comes from the instance. */
120
+ export declare const EVALUATE_WARNINGS: Readonly<{
121
+ scope_budget: "The upstream scope budget ran out before every row was read; the rows left were not evaluated.";
122
+ max_updates: "max_updates was reached before every row was read; the rows left were not evaluated.";
123
+ sets_capped: "The scope has more than 100 sets or deeper than 10 levels; only the first were evaluated.";
124
+ children_unreadable: "Field policy hides the parent field, so descendants were not included.";
125
+ counts_unavailable: "Row counts per set were not readable; set-size rules could not run.";
126
+ row_too_large: "A row was too large to read with its payload; it was evaluated on metadata only.";
127
+ rows_unreadable: "Some rows had no valid sys_id and were not evaluated.";
128
+ context_tables_capped: "The rows write to more than 200 tables; the rest have no type or hierarchy facts.";
129
+ hierarchy_unavailable: "Table hierarchies could not be read in full; some table checks were not made.";
130
+ field_types_unavailable: "Field types could not be read; password-typed field checks were not made.";
131
+ problems_unavailable: "Preview problems could not be read; the commit-blocking check was not made.";
132
+ problems_capped: "More than 1000 preview problems; the commit-blocking check is incomplete.";
133
+ collisions_unavailable: "Other open update sets could not be checked in full for the same updates.";
134
+ baseline_unavailable: "Update versions could not be read in full; the baseline-record check is incomplete.";
135
+ descriptions_unavailable: "Set descriptions could not be checked; the missing-description check was not made.";
136
+ names_unlistable: "Some update names cannot be used in a query; their collision and baseline checks were not made.";
137
+ context_tables_budget: "Finding the tables nested in payloads ran out of time; rows with unknown nested tables were not scanned.";
138
+ }>;
139
+ export type EvaluateWarning = keyof typeof EVALUATE_WARNINGS;
140
+ /**
141
+ * Every field this view may request or filter on, by table, for the module's
142
+ * field-policy preparation. `super_class` and `update_set` are also the heads
143
+ * of the view's two dot-walks, both into tables of its own plan.
144
+ */
145
+ export declare const EVALUATE_FIELD_PLAN: Readonly<Record<string, readonly string[]>>;
146
+ /** The dot-walks this view makes; each target is in its plan. */
147
+ export declare const EVALUATE_DOT_WALKS: readonly (Readonly<{
148
+ from: "sys_db_object";
149
+ field: "super_class";
150
+ target: "sys_db_object";
151
+ }> | Readonly<{
152
+ from: "sys_update_xml";
153
+ field: "update_set";
154
+ target: "sys_update_set";
155
+ }>)[];
156
+ export interface EvaluateHandlerOptions {
157
+ readonly fieldAccess?: PlatformViewFieldAccess;
158
+ /** Engine limits; a test lowers the CPU budget here. Production uses `ENGINE_LIMITS`. */
159
+ readonly limits?: Partial<EngineLimits>;
160
+ readonly hooks?: EngineHooks;
161
+ /** Response scopes per call; at most `EVALUATE_LIMITS.MAX_SCOPES`. */
162
+ readonly maxScopes?: number;
163
+ }
164
+ /**
165
+ * The text of a payload with its CDATA sections and comments removed, so
166
+ * markup-like text inside a script is never read as a record. An
167
+ * unterminated section drops the rest of the text.
168
+ *
169
+ * Linear: the next opener of each kind is searched for again only once the
170
+ * scan has passed the last one found, so a kind that does not occur is
171
+ * searched for once, and every character is read a bounded number of times.
172
+ */
173
+ export declare function outsideCdataAndComments(text: string): string;
174
+ /**
175
+ * Tables a row may write to, most certain first, so the table cap is filled
176
+ * by the tables every row names before any payload can add more:
177
+ * 1. each row's `table` column, update-name prefix and payload root table;
178
+ * 2. record elements (a table-named element with an `action` attribute)
179
+ * found outside CDATA and comments, in the part of the payload the engine
180
+ * reads, at most {@link EVALUATE_LIMITS}.MAX_RECORD_TABLES_PER_ROW per
181
+ * row, taken one per row in turn, so one row cannot crowd out the rest.
182
+ * A table missed here has no facts, so the credential check treats it as
183
+ * unknown and its rows are not scanned: a miss fails closed, for those rows.
184
+ */
185
+ export declare function candidateTables(updates: readonly EvaluateUpdate[], maxPayloadChars?: number): string[];
186
+ /**
187
+ * {@link candidateTables} as the handler runs it: it yields to the event loop
188
+ * after {@link YIELD_AFTER_MS} of work, as the engine does, and stops reading
189
+ * record elements once {@link EVALUATE_LIMITS}.CANDIDATE_BUDGET_MS of work is
190
+ * spent. Rows left then keep only their direct tables; a nested record they
191
+ * hold is unknown, so those rows fail closed, and `budgetHit` says so.
192
+ */
193
+ export declare function collectCandidateTables(updates: readonly EvaluateUpdate[], hooks?: EngineHooks, maxPayloadChars?: number): Promise<{
194
+ readonly tables: string[];
195
+ readonly budgetHit: boolean;
196
+ }>;
197
+ /**
198
+ * True when an update name may go into a `nameIN` list as it is: only the
199
+ * allowed characters, no script prefix, and nothing `escapeQueryValue` would
200
+ * change. Any other name is not checked, and is counted.
201
+ */
202
+ export declare function isListableName(name: string): boolean;
203
+ /**
204
+ * Build the `view: "evaluate"` handler. `handleEvaluate` is the one the module
205
+ * registers; a test builds its own with a fixed field access, engine limits,
206
+ * a fake clock or a smaller scope budget.
207
+ */
208
+ export declare function createEvaluateHandler(defaults?: EvaluateHandlerOptions): FieldAccessHandler;
209
+ /** The handler the dispatcher registers. */
210
+ export declare const handleEvaluate: FieldAccessHandler;
211
+ /**
212
+ * The readable text of an `evaluate` result. Counts, rule ids, severities and
213
+ * the engine's fixed messages are this server's own text. Every name (set,
214
+ * update, target, type, table) is instance text and appears only inside an
215
+ * `untrustedBlock`. A result with no findings never says only that: it says
216
+ * what was examined, and that it is not an approval.
217
+ */
218
+ export declare function renderEvaluateText(data: unknown): string | undefined;
11
219
  //# sourceMappingURL=platform-view-evaluate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform-view-evaluate.d.ts","sourceRoot":"","sources":["../../src/tools/platform-view-evaluate.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,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