@onlyflows/servicenow-mcp 2.3.0-rc.3 → 2.4.0-rc.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.
Files changed (129) hide show
  1. package/CHANGELOG.md +138 -0
  2. package/README.md +206 -22
  3. package/dist/atf-result-cache.d.ts +2 -2
  4. package/dist/call-metrics.d.ts +11 -1
  5. package/dist/call-metrics.d.ts.map +1 -1
  6. package/dist/call-metrics.js +2 -0
  7. package/dist/call-metrics.js.map +1 -1
  8. package/dist/client.d.ts +10 -0
  9. package/dist/client.d.ts.map +1 -1
  10. package/dist/client.js +31 -3
  11. package/dist/client.js.map +1 -1
  12. package/dist/execution-context.d.ts +3 -3
  13. package/dist/execution-context.d.ts.map +1 -1
  14. package/dist/execution-context.js +7 -2
  15. package/dist/execution-context.js.map +1 -1
  16. package/dist/field-policy.d.ts +8 -0
  17. package/dist/field-policy.d.ts.map +1 -1
  18. package/dist/field-policy.js +239 -46
  19. package/dist/field-policy.js.map +1 -1
  20. package/dist/hidden-values.d.ts +368 -21
  21. package/dist/hidden-values.d.ts.map +1 -1
  22. package/dist/hidden-values.js +1050 -101
  23. package/dist/hidden-values.js.map +1 -1
  24. package/dist/http-observability.js +3 -1
  25. package/dist/http-observability.js.map +1 -1
  26. package/dist/inert-text.d.ts +27 -0
  27. package/dist/inert-text.d.ts.map +1 -0
  28. package/dist/inert-text.js +57 -0
  29. package/dist/inert-text.js.map +1 -0
  30. package/dist/policy-card.d.ts +1 -1
  31. package/dist/policy-card.d.ts.map +1 -1
  32. package/dist/policy-card.js +3 -1
  33. package/dist/policy-card.js.map +1 -1
  34. package/dist/setup-prompts.js +1 -0
  35. package/dist/setup-prompts.js.map +1 -1
  36. package/dist/setup.js +6 -0
  37. package/dist/setup.js.map +1 -1
  38. package/dist/tool-error.d.ts +39 -3
  39. package/dist/tool-error.d.ts.map +1 -1
  40. package/dist/tool-error.js +101 -2
  41. package/dist/tool-error.js.map +1 -1
  42. package/dist/tool-table-access.d.ts.map +1 -1
  43. package/dist/tool-table-access.js +5 -0
  44. package/dist/tool-table-access.js.map +1 -1
  45. package/dist/tools/aggregate.d.ts +8 -0
  46. package/dist/tools/aggregate.d.ts.map +1 -1
  47. package/dist/tools/aggregate.js +70 -11
  48. package/dist/tools/aggregate.js.map +1 -1
  49. package/dist/tools/atf-contracts.d.ts +9 -9
  50. package/dist/tools/catalog.d.ts +2 -2
  51. package/dist/tools/catalog.d.ts.map +1 -1
  52. package/dist/tools/catalog.js +9 -0
  53. package/dist/tools/catalog.js.map +1 -1
  54. package/dist/tools/envelope-text-fit.d.ts +20 -0
  55. package/dist/tools/envelope-text-fit.d.ts.map +1 -0
  56. package/dist/tools/envelope-text-fit.js +33 -0
  57. package/dist/tools/envelope-text-fit.js.map +1 -0
  58. package/dist/tools/flow-view-mermaid.d.ts.map +1 -1
  59. package/dist/tools/flow-view-mermaid.js +6 -13
  60. package/dist/tools/flow-view-mermaid.js.map +1 -1
  61. package/dist/tools/flow-view-module.js +1 -1
  62. package/dist/tools/get-module.js +1 -1
  63. package/dist/tools/history-contracts.d.ts +198 -0
  64. package/dist/tools/history-contracts.d.ts.map +1 -0
  65. package/dist/tools/history-contracts.js +317 -0
  66. package/dist/tools/history-contracts.js.map +1 -0
  67. package/dist/tools/history-module.d.ts +158 -0
  68. package/dist/tools/history-module.d.ts.map +1 -0
  69. package/dist/tools/history-module.js +937 -0
  70. package/dist/tools/history-module.js.map +1 -0
  71. package/dist/tools/history-renderers.d.ts +32 -0
  72. package/dist/tools/history-renderers.d.ts.map +1 -0
  73. package/dist/tools/history-renderers.js +154 -0
  74. package/dist/tools/history-renderers.js.map +1 -0
  75. package/dist/tools/index.d.ts +3 -3
  76. package/dist/tools/index.d.ts.map +1 -1
  77. package/dist/tools/index.js +31 -14
  78. package/dist/tools/index.js.map +1 -1
  79. package/dist/tools/platform-view-contracts.d.ts +4 -4
  80. package/dist/tools/platform-view-contracts.d.ts.map +1 -1
  81. package/dist/tools/platform-view-contracts.js +3 -0
  82. package/dist/tools/platform-view-contracts.js.map +1 -1
  83. package/dist/tools/platform-view-evaluate.d.ts +7 -2
  84. package/dist/tools/platform-view-evaluate.d.ts.map +1 -1
  85. package/dist/tools/platform-view-evaluate.js +44 -130
  86. package/dist/tools/platform-view-evaluate.js.map +1 -1
  87. package/dist/tools/platform-view-module.d.ts +12 -3
  88. package/dist/tools/platform-view-module.d.ts.map +1 -1
  89. package/dist/tools/platform-view-module.js +61 -16
  90. package/dist/tools/platform-view-module.js.map +1 -1
  91. package/dist/tools/platform-view-payload.d.ts +101 -0
  92. package/dist/tools/platform-view-payload.d.ts.map +1 -0
  93. package/dist/tools/platform-view-payload.js +302 -0
  94. package/dist/tools/platform-view-payload.js.map +1 -0
  95. package/dist/tools/platform-view-update-sets.d.ts +129 -0
  96. package/dist/tools/platform-view-update-sets.d.ts.map +1 -0
  97. package/dist/tools/platform-view-update-sets.js +1060 -0
  98. package/dist/tools/platform-view-update-sets.js.map +1 -0
  99. package/dist/tools/query-module.js +1 -1
  100. package/dist/tools/relationships-map.d.ts +59 -0
  101. package/dist/tools/relationships-map.d.ts.map +1 -0
  102. package/dist/tools/relationships-map.js +162 -0
  103. package/dist/tools/relationships-map.js.map +1 -0
  104. package/dist/tools/relationships-renderer.d.ts +22 -0
  105. package/dist/tools/relationships-renderer.d.ts.map +1 -0
  106. package/dist/tools/relationships-renderer.js +90 -0
  107. package/dist/tools/relationships-renderer.js.map +1 -0
  108. package/dist/tools/relationships.d.ts +37 -2
  109. package/dist/tools/relationships.d.ts.map +1 -1
  110. package/dist/tools/relationships.js +602 -183
  111. package/dist/tools/relationships.js.map +1 -1
  112. package/dist/tools/result-envelope.d.ts +314 -15
  113. package/dist/tools/result-envelope.d.ts.map +1 -1
  114. package/dist/tools/result-envelope.js +120 -19
  115. package/dist/tools/result-envelope.js.map +1 -1
  116. package/dist/tools/syslog.d.ts +1 -1
  117. package/dist/tools/table-hierarchy.d.ts +17 -0
  118. package/dist/tools/table-hierarchy.d.ts.map +1 -1
  119. package/dist/tools/table-hierarchy.js +41 -0
  120. package/dist/tools/table-hierarchy.js.map +1 -1
  121. package/dist/version.d.ts +1 -1
  122. package/dist/version.js +1 -1
  123. package/docs/CLIENT-SETUP.md +2 -2
  124. package/docs/CROSS-CLIENT-RELEASE-MATRIX.md +2 -2
  125. package/docs/PRODUCTION-SECURITY.md +145 -2
  126. package/docs/RELEASE-VALIDATION.md +2 -2
  127. package/docs/TESTING-OAUTH.md +1 -1
  128. package/package.json +2 -2
  129. package/server.json +2 -2
@@ -0,0 +1,129 @@
1
+ /**
2
+ * `sn_platform_view`, the update set views: `update_sets`, `update_set`,
3
+ * `changes` (with the masked payload of one change), `batch` and
4
+ * `remote_update_sets`.
5
+ *
6
+ * Reads, each group in its own 1 MiB response scope, at most
7
+ * {@link UPDATE_SET_VIEW_LIMITS}.MAX_SCOPES (6) scopes per call, never cached:
8
+ * - `update_sets`: one page of `sys_update_set`, then one Aggregate API count
9
+ * of `sys_update_xml` grouped by `update_set` for that page (a set with no
10
+ * rows has no group: its count is 0). 2 requests.
11
+ * - `update_set`: the set (by sys_id or exact name), then together: its row
12
+ * counts grouped by `type` and `action`, its children (at most 50 shown),
13
+ * and the retrieved set it came from (`remote_sys_id`). At most 4 requests.
14
+ * - `changes`: the set (local, or retrieved with `remote_update_set`), its
15
+ * descendants one level per read when `include_children` (depth and count
16
+ * capped, cycle-safe), then one page of `sys_update_xml` metadata. With
17
+ * `change` and `payload: true`, the one change's payload, then the
18
+ * hierarchies and field types of the tables it writes (see
19
+ * `platform-view-payload.ts`).
20
+ * - `batch`: the member, its batch root (`base_update_set`, else the
21
+ * member's parents), the tree under the root one level per read (depth at
22
+ * most 10, at most 200 sets, cycle-safe), and the row counts per set (one
23
+ * Aggregate API read per 100 sets).
24
+ * - `remote_update_sets`: one page of `sys_remote_update_set`; with
25
+ * `remote_update_set` and `problems: true`, that set, one page of its
26
+ * preview problems and their counts by type and status.
27
+ *
28
+ * Every read names its fields. `sys_update_xml.payload` is asked for only by
29
+ * the payload read, and only when field policy lets the profile read it;
30
+ * `payload_diff` never. Every field the views filter or order on must be
31
+ * readable, or the call is `denied` before it reads. Every row passes the
32
+ * field access before it is projected.
33
+ *
34
+ * Queries are built from canonical selectors (escaped by the dispatcher) and
35
+ * validated sys_ids only; no instance text ever shapes a query. A 403 on a
36
+ * view's first table is `status: "denied"`, and a missing table
37
+ * `status: "unavailable"`, each with a fixed hint, never an empty success.
38
+ *
39
+ * Text: instance strings are bounded here and rendered by
40
+ * {@link renderUpdateSetViewText} inside an `untrustedBlock`.
41
+ *
42
+ * @module tools/platform-view-update-sets
43
+ */
44
+ import { type FieldAccessHandler, type PlatformViewFieldAccess } from "./platform-view-upgrades.js";
45
+ export declare const UPDATE_SET_VIEW_LIMITS: Readonly<{
46
+ /** Response scopes per call, each under the client's 1 MiB cap. */
47
+ MAX_SCOPES: 6;
48
+ /** Levels of descendants read through `parent`. */
49
+ MAX_DEPTH: 10;
50
+ /** Sets in a batch tree, the root included. */
51
+ MAX_BATCH_NODES: 200;
52
+ /** Sets whose changes one `changes` call lists, the selected one included. */
53
+ MAX_SCOPE_SETS: 100;
54
+ /** Children listed by `update_set`. */
55
+ MAX_CHILDREN: 50;
56
+ /** Sets per Aggregate API read. */
57
+ STATS_CHUNK: 100;
58
+ /** `type`/`action` groups read for one set's counts. */
59
+ MAX_COUNT_GROUPS: 500;
60
+ DESCRIPTION_CHARS: 200;
61
+ PROBLEM_DESCRIPTION_CHARS: 300;
62
+ NAME_CHARS: 200;
63
+ }>;
64
+ /** `sys_update_set`, as the list and the detail views read it. */
65
+ export declare const UPDATE_SET_FIELDS: readonly string[];
66
+ /** `sys_update_xml` metadata. Never `payload` or `payload_diff`: the payload read adds `payload` alone. */
67
+ export declare const CHANGE_FIELDS: readonly string[];
68
+ /** `sys_remote_update_set`. */
69
+ export declare const REMOTE_SET_FIELDS: readonly string[];
70
+ /** `sys_update_preview_problem`. */
71
+ export declare const PROBLEM_FIELDS: readonly string[];
72
+ /**
73
+ * Every field these views may request or filter on, by table: what the
74
+ * module prepares (intersected with what the profile may read). The payload
75
+ * read adds `sys_update_xml.payload`; the payload's type lookup reads the two
76
+ * metadata tables through `loadFieldTypesInPlan`.
77
+ */
78
+ export declare const UPDATE_SET_VIEWS_FIELD_PLAN: Readonly<Record<string, readonly string[]>>;
79
+ /** The dot-walks these views make: only the payload's type lookup, one hop into its own table. */
80
+ export declare const UPDATE_SET_VIEW_DOT_WALKS: readonly Readonly<{
81
+ from: "sys_db_object";
82
+ field: "super_class";
83
+ target: "sys_db_object";
84
+ }>[];
85
+ export declare const UPDATE_SETS_DENIED_HINT = "Reading update sets was denied for this account.";
86
+ export declare const UPDATE_SETS_UNAVAILABLE_HINT = "The update set tables are not available on this instance.";
87
+ export declare const REMOTE_SETS_DENIED_HINT = "Reading retrieved update sets was denied for this account.";
88
+ export declare const REMOTE_SETS_UNAVAILABLE_HINT = "The retrieved update set tables are not available on this instance.";
89
+ export declare const NOT_FOUND_HINT = "No update set matches. Pass its sys_id, or check the name.";
90
+ export declare const REMOTE_NOT_FOUND_HINT = "No retrieved update set has this sys_id.";
91
+ export declare const AMBIGUOUS_HINT = "More than one update set has this name. Pass update_set as a sys_id.";
92
+ /** Fixed warnings; nothing in them comes from the instance. */
93
+ export declare const UPDATE_SET_VIEW_WARNINGS: Readonly<{
94
+ counts_unavailable: "Row counts were not readable; update_count is null.";
95
+ counts_truncated: "More than 500 type and action groups; the counts cover the first ones.";
96
+ children_unreadable: "Field policy hides the parent field, so child sets were not read.";
97
+ children_unavailable: "Child sets could not be read.";
98
+ remote_unavailable: "The retrieved set this one came from could not be read.";
99
+ sets_capped: "The scope has more than 100 sets or is deeper than 10 levels; changes of the first sets only.";
100
+ depth_capped: "The batch is deeper than 10 levels; deeper sets were not read.";
101
+ nodes_capped: "The batch has more than 200 sets; the rest were not read.";
102
+ cycles: "Some sets point back to a set already in the tree; each is shown once.";
103
+ root_unresolved: "The batch root was not found within 10 parents; the tree starts at the highest set found.";
104
+ problems_denied: "Reading preview problems was denied for this account.";
105
+ problem_counts_unavailable: "Preview problem counts were not readable.";
106
+ }>;
107
+ export type UpdateSetViewWarning = keyof typeof UPDATE_SET_VIEW_WARNINGS;
108
+ declare const UPDATE_SET_VIEWS: readonly ["update_sets", "update_set", "changes", "batch", "remote_update_sets"];
109
+ export type UpdateSetView = (typeof UPDATE_SET_VIEWS)[number];
110
+ export interface UpdateSetViewsHandlerOptions {
111
+ readonly fieldAccess?: PlatformViewFieldAccess;
112
+ }
113
+ /**
114
+ * Build the handler of the five update set views. `handleUpdateSetViews` is
115
+ * the one the module registers; a test builds its own with a fixed field
116
+ * access.
117
+ */
118
+ export declare function createUpdateSetViewsHandler(defaults?: UpdateSetViewsHandlerOptions): FieldAccessHandler;
119
+ /** The handler the dispatcher registers for the five update set views. */
120
+ export declare const handleUpdateSetViews: FieldAccessHandler;
121
+ /**
122
+ * The readable text of an update set view's result. Counts, statuses and the
123
+ * fixed hints, warnings and notes are plain text; every value read from the
124
+ * instance (names, descriptions, types, payload text) sits inside an
125
+ * `untrustedBlock`.
126
+ */
127
+ export declare function renderUpdateSetViewText(data: unknown): string | undefined;
128
+ export {};
129
+ //# sourceMappingURL=platform-view-update-sets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-view-update-sets.d.ts","sourceRoot":"","sources":["../../src/tools/platform-view-update-sets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAqBH,OAAO,EAsBL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC7B,MAAM,6BAA6B,CAAC;AAOrC,eAAO,MAAM,sBAAsB;IACjC,mEAAmE;;IAEnE,mDAAmD;;IAEnD,+CAA+C;;IAE/C,8EAA8E;;IAE9E,uCAAuC;;IAEvC,mCAAmC;;IAEnC,wDAAwD;;;;;EAKxD,CAAC;AAIH,kEAAkE;AAClE,eAAO,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