@onlyflows/servicenow-mcp 2.1.0 → 2.2.0-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +14 -7
  3. package/dist/atf-config.d.ts +72 -0
  4. package/dist/atf-config.d.ts.map +1 -0
  5. package/dist/atf-config.js +179 -0
  6. package/dist/atf-config.js.map +1 -0
  7. package/dist/atf-form.d.ts +27 -0
  8. package/dist/atf-form.d.ts.map +1 -0
  9. package/dist/atf-form.js +110 -0
  10. package/dist/atf-form.js.map +1 -0
  11. package/dist/atf-policy.d.ts +46 -0
  12. package/dist/atf-policy.d.ts.map +1 -0
  13. package/dist/atf-policy.js +85 -0
  14. package/dist/atf-policy.js.map +1 -0
  15. package/dist/atf-result-cache.d.ts +108 -0
  16. package/dist/atf-result-cache.d.ts.map +1 -0
  17. package/dist/atf-result-cache.js +273 -0
  18. package/dist/atf-result-cache.js.map +1 -0
  19. package/dist/client.d.ts +6 -2
  20. package/dist/client.d.ts.map +1 -1
  21. package/dist/client.js +35 -7
  22. package/dist/client.js.map +1 -1
  23. package/dist/config.d.ts +8 -0
  24. package/dist/config.d.ts.map +1 -1
  25. package/dist/config.js +15 -0
  26. package/dist/config.js.map +1 -1
  27. package/dist/execution-context.d.ts +7 -3
  28. package/dist/execution-context.d.ts.map +1 -1
  29. package/dist/execution-context.js +6 -2
  30. package/dist/execution-context.js.map +1 -1
  31. package/dist/field-policy.d.ts.map +1 -1
  32. package/dist/field-policy.js +48 -1
  33. package/dist/field-policy.js.map +1 -1
  34. package/dist/http-entrypoint.d.ts.map +1 -1
  35. package/dist/http-entrypoint.js +3 -0
  36. package/dist/http-entrypoint.js.map +1 -1
  37. package/dist/http-observability.js +2 -1
  38. package/dist/http-observability.js.map +1 -1
  39. package/dist/index.js +3 -0
  40. package/dist/index.js.map +1 -1
  41. package/dist/metadata-cache.d.ts.map +1 -1
  42. package/dist/metadata-cache.js +1 -0
  43. package/dist/metadata-cache.js.map +1 -1
  44. package/dist/profile-manager.d.ts +12 -0
  45. package/dist/profile-manager.d.ts.map +1 -1
  46. package/dist/profile-manager.js +30 -3
  47. package/dist/profile-manager.js.map +1 -1
  48. package/dist/setup-prompts.js +1 -1
  49. package/dist/setup-prompts.js.map +1 -1
  50. package/dist/setup.d.ts.map +1 -1
  51. package/dist/setup.js +11 -4
  52. package/dist/setup.js.map +1 -1
  53. package/dist/structured-query.d.ts +2 -2
  54. package/dist/tool-table-access.js +2 -4
  55. package/dist/tool-table-access.js.map +1 -1
  56. package/dist/tools/aggregate.d.ts +1 -1
  57. package/dist/tools/atf-author-module.d.ts +98 -0
  58. package/dist/tools/atf-author-module.d.ts.map +1 -0
  59. package/dist/tools/atf-author-module.js +140 -0
  60. package/dist/tools/atf-author-module.js.map +1 -0
  61. package/dist/tools/atf-contracts.d.ts +734 -0
  62. package/dist/tools/atf-contracts.d.ts.map +1 -0
  63. package/dist/tools/atf-contracts.js +30 -0
  64. package/dist/tools/atf-contracts.js.map +1 -0
  65. package/dist/tools/atf-readiness-module.d.ts +2 -0
  66. package/dist/tools/atf-readiness-module.d.ts.map +1 -0
  67. package/dist/tools/atf-readiness-module.js +153 -0
  68. package/dist/tools/atf-readiness-module.js.map +1 -0
  69. package/dist/tools/atf-renderers.d.ts +2 -0
  70. package/dist/tools/atf-renderers.d.ts.map +1 -0
  71. package/dist/tools/atf-renderers.js +39 -0
  72. package/dist/tools/atf-renderers.js.map +1 -0
  73. package/dist/tools/atf-results-module.d.ts +2 -0
  74. package/dist/tools/atf-results-module.d.ts.map +1 -0
  75. package/dist/tools/atf-results-module.js +58 -0
  76. package/dist/tools/atf-results-module.js.map +1 -0
  77. package/dist/tools/atf-run-module.d.ts +3 -0
  78. package/dist/tools/atf-run-module.d.ts.map +1 -0
  79. package/dist/tools/atf-run-module.js +96 -0
  80. package/dist/tools/atf-run-module.js.map +1 -0
  81. package/dist/tools/atf-shared.d.ts +31 -0
  82. package/dist/tools/atf-shared.d.ts.map +1 -0
  83. package/dist/tools/atf-shared.js +182 -0
  84. package/dist/tools/atf-shared.js.map +1 -0
  85. package/dist/tools/atf-step-catalog.d.ts +96 -0
  86. package/dist/tools/atf-step-catalog.d.ts.map +1 -0
  87. package/dist/tools/atf-step-catalog.js +237 -0
  88. package/dist/tools/atf-step-catalog.js.map +1 -0
  89. package/dist/tools/atf-step-definitions.json +533 -0
  90. package/dist/tools/atf.d.ts +5 -5
  91. package/dist/tools/atf.d.ts.map +1 -1
  92. package/dist/tools/atf.js +4 -234
  93. package/dist/tools/atf.js.map +1 -1
  94. package/dist/tools/attach.d.ts +1 -1
  95. package/dist/tools/batch.d.ts +2 -2
  96. package/dist/tools/catalog.d.ts +2 -3
  97. package/dist/tools/catalog.d.ts.map +1 -1
  98. package/dist/tools/catalog.js +9 -2
  99. package/dist/tools/catalog.js.map +1 -1
  100. package/dist/tools/discover.d.ts +1 -1
  101. package/dist/tools/index.d.ts +3 -3
  102. package/dist/tools/index.d.ts.map +1 -1
  103. package/dist/tools/index.js +26 -17
  104. package/dist/tools/index.js.map +1 -1
  105. package/dist/tools/markdown.d.ts +77 -0
  106. package/dist/tools/markdown.d.ts.map +1 -0
  107. package/dist/tools/markdown.js +279 -0
  108. package/dist/tools/markdown.js.map +1 -0
  109. package/dist/tools/nl.d.ts +2 -2
  110. package/dist/tools/relationships.d.ts +2 -2
  111. package/dist/tools/result-envelope.d.ts +832 -24
  112. package/dist/tools/result-envelope.d.ts.map +1 -1
  113. package/dist/tools/result-envelope.js +103 -3
  114. package/dist/tools/result-envelope.js.map +1 -1
  115. package/dist/tools/syslog.d.ts +2 -2
  116. package/dist/tools/tool-module.d.ts +13 -3
  117. package/dist/tools/tool-module.d.ts.map +1 -1
  118. package/dist/tools/tool-module.js +1 -0
  119. package/dist/tools/tool-module.js.map +1 -1
  120. package/dist/version.d.ts +1 -1
  121. package/dist/version.d.ts.map +1 -1
  122. package/dist/version.js +1 -1
  123. package/dist/version.js.map +1 -1
  124. package/docs/ATF-WORKFLOW.md +115 -0
  125. package/docs/CLIENT-SETUP.md +2 -2
  126. package/docs/CONTAINER-DEPLOYMENT.md +11 -0
  127. package/docs/CROSS-CLIENT-RELEASE-MATRIX.md +1 -1
  128. package/docs/PROFILE-CREDENTIALS.md +65 -0
  129. package/docs/RELEASE-VALIDATION.md +29 -2
  130. package/docs/TESTING-OAUTH.md +1 -1
  131. package/docs/V2-MIGRATION.md +4 -4
  132. package/package.json +4 -2
  133. package/scripts/release-validate.mjs +14 -4
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ /**
3
+ * ATF execution grant carried on the resolved effective policy, and the
4
+ * classified denial a tool raises from its access resolver when the profile
5
+ * withholds that grant.
6
+ *
7
+ * Running an ATF suite executes its steps on the instance, and a step can
8
+ * change any table the test touches. No table-only plan can describe that
9
+ * side effect, so execution is its own opt-in: omission denies it.
10
+ *
11
+ * @module atf-policy
12
+ */
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.AtfPolicyError = exports.DENY_ALL_ATF_EXECUTION = void 0;
15
+ exports.createAtfExecutionPolicy = createAtfExecutionPolicy;
16
+ exports.isAtfPolicyError = isAtfPolicyError;
17
+ exports.atfPolicyDenialMessage = atfPolicyDenialMessage;
18
+ exports.requireAtfExecution = requireAtfExecution;
19
+ exports.DENY_ALL_ATF_EXECUTION = Object.freeze({
20
+ execute: false,
21
+ allowScriptSteps: false,
22
+ });
23
+ /**
24
+ * Normalize a provider-supplied ATF policy. Each property is read once, and
25
+ * anything other than an explicit boolean `true` leaves the grant off. A
26
+ * non-boolean value is a provider defect, so it fails context creation.
27
+ */
28
+ function createAtfExecutionPolicy(candidate) {
29
+ if (candidate === undefined)
30
+ return exports.DENY_ALL_ATF_EXECUTION;
31
+ if (typeof candidate !== "object" || candidate === null) {
32
+ throw new TypeError("ATF execution policy must be an object");
33
+ }
34
+ const execute = candidate.execute;
35
+ const allowScriptSteps = candidate.allowScriptSteps;
36
+ if ((execute !== undefined && typeof execute !== "boolean") ||
37
+ (allowScriptSteps !== undefined && typeof allowScriptSteps !== "boolean")) {
38
+ throw new TypeError("ATF execution policy grants must be booleans");
39
+ }
40
+ return Object.freeze({
41
+ execute: execute === true,
42
+ allowScriptSteps: allowScriptSteps === true,
43
+ });
44
+ }
45
+ const ISSUED_ATF_POLICY_ERRORS = new WeakSet();
46
+ class AtfPolicyError extends Error {
47
+ reason;
48
+ constructor(reason) {
49
+ super("ATF operation denied by policy");
50
+ this.name = "AtfPolicyError";
51
+ this.reason = reason;
52
+ ISSUED_ATF_POLICY_ERRORS.add(this);
53
+ Object.freeze(this);
54
+ }
55
+ }
56
+ exports.AtfPolicyError = AtfPolicyError;
57
+ function isAtfPolicyError(error) {
58
+ return (typeof error === "object" &&
59
+ error !== null &&
60
+ ISSUED_ATF_POLICY_ERRORS.has(error));
61
+ }
62
+ /**
63
+ * Fixed operator guidance. It names the configuration key that grants the
64
+ * operation, and keeps the "denied by policy" phrase other denials share.
65
+ */
66
+ function atfPolicyDenialMessage(_error, tool) {
67
+ if (_error.reason === "script_steps_not_enabled")
68
+ return "ATF script-step authoring denied by policy. Set atf.allowScriptSteps=true on this profile to permit code-executing steps.";
69
+ const subject = typeof tool === "string" && tool.trim() !== "" ? tool.trim() : "This tool";
70
+ return (`ATF execution denied by policy: ${subject} runs ATF tests, and this profile ` +
71
+ `does not enable ATF execution. Running a suite executes its steps on the ` +
72
+ `instance and can change any data those steps touch. To allow it, set ` +
73
+ `"atf": { "execute": true } on the profile (or SN_ATF_EXECUTE=true for an ` +
74
+ `environment-only profile), then restart the MCP client.`);
75
+ }
76
+ /**
77
+ * Call from a module's resolveAccess before returning its plan, so a profile
78
+ * without the grant is rejected before any configuration or client exists.
79
+ */
80
+ function requireAtfExecution(policy) {
81
+ if (policy.atf?.execute !== true) {
82
+ throw new AtfPolicyError("execution_not_enabled");
83
+ }
84
+ }
85
+ //# sourceMappingURL=atf-policy.js.map
@@ -0,0 +1 @@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BAAwB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;CACF;AAVD,wCAUC;AAED,SAAgB,gBAAgB,CAAC,KAAc;IAC7C,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,wBAAwB,CAAC,GAAG,CAAC,KAAK,CAAC,CACpC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAgB,sBAAsB,CACpC,MAAsB,EACtB,IAAa;IAEb,IAAI,MAAM,CAAC,MAAM,KAAK,0BAA0B;QAAE,OAAO,2HAA2H,CAAC;IACrL,MAAM,OAAO,GACX,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;IAC7E,OAAO,CACL,mCAAmC,OAAO,oCAAoC;QAC9E,2EAA2E;QAC3E,uEAAuE;QACvE,2EAA2E;QAC3E,yDAAyD,CAC1D,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAgB,mBAAmB,CACjC,MAAqD;IAErD,IAAI,MAAM,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,EAAE,CAAC;QACjC,MAAM,IAAI,cAAc,CAAC,uBAAuB,CAAC,CAAC;IACpD,CAAC;AACH,CAAC"}
@@ -0,0 +1,108 @@
1
+ import { z } from "zod";
2
+ import type { ServiceNowConfig } from "./config.js";
3
+ export declare const atfRunSummarySchema: z.ZodObject<{
4
+ runId: z.ZodString;
5
+ suiteId: z.ZodString;
6
+ startedAt: z.ZodString;
7
+ finishedAt: z.ZodOptional<z.ZodString>;
8
+ status: z.ZodEnum<["pending", "running", "success", "failure", "error", "skipped", "canceled", "success_with_warnings"]>;
9
+ durationMs: z.ZodNumber;
10
+ counts: z.ZodObject<{
11
+ passed: z.ZodNumber;
12
+ failed: z.ZodNumber;
13
+ errors: z.ZodNumber;
14
+ skipped: z.ZodNumber;
15
+ }, "strict", z.ZodTypeAny, {
16
+ skipped: number;
17
+ passed: number;
18
+ failed: number;
19
+ errors: number;
20
+ }, {
21
+ skipped: number;
22
+ passed: number;
23
+ failed: number;
24
+ errors: number;
25
+ }>;
26
+ tests: z.ZodArray<z.ZodObject<{
27
+ testId: z.ZodString;
28
+ status: z.ZodEnum<["pending", "running", "success", "failure", "error", "skipped", "canceled", "success_with_warnings"]>;
29
+ firstFailure: z.ZodOptional<z.ZodString>;
30
+ }, "strict", z.ZodTypeAny, {
31
+ testId: string;
32
+ status: "error" | "success" | "pending" | "running" | "failure" | "skipped" | "canceled" | "success_with_warnings";
33
+ firstFailure?: string | undefined;
34
+ }, {
35
+ testId: string;
36
+ status: "error" | "success" | "pending" | "running" | "failure" | "skipped" | "canceled" | "success_with_warnings";
37
+ firstFailure?: string | undefined;
38
+ }>, "many">;
39
+ }, "strict", z.ZodTypeAny, {
40
+ status: "error" | "success" | "pending" | "running" | "failure" | "skipped" | "canceled" | "success_with_warnings";
41
+ runId: string;
42
+ suiteId: string;
43
+ startedAt: string;
44
+ durationMs: number;
45
+ counts: {
46
+ skipped: number;
47
+ passed: number;
48
+ failed: number;
49
+ errors: number;
50
+ };
51
+ tests: {
52
+ testId: string;
53
+ status: "error" | "success" | "pending" | "running" | "failure" | "skipped" | "canceled" | "success_with_warnings";
54
+ firstFailure?: string | undefined;
55
+ }[];
56
+ finishedAt?: string | undefined;
57
+ }, {
58
+ status: "error" | "success" | "pending" | "running" | "failure" | "skipped" | "canceled" | "success_with_warnings";
59
+ runId: string;
60
+ suiteId: string;
61
+ startedAt: string;
62
+ durationMs: number;
63
+ counts: {
64
+ skipped: number;
65
+ passed: number;
66
+ failed: number;
67
+ errors: number;
68
+ };
69
+ tests: {
70
+ testId: string;
71
+ status: "error" | "success" | "pending" | "running" | "failure" | "skipped" | "canceled" | "success_with_warnings";
72
+ firstFailure?: string | undefined;
73
+ }[];
74
+ finishedAt?: string | undefined;
75
+ }>;
76
+ export type AtfRunSummary = z.infer<typeof atfRunSummarySchema>;
77
+ export declare const MAX_ATF_CACHE_BYTES: number;
78
+ export declare class AtfResultCache {
79
+ readonly filePath: string;
80
+ private readonly directory;
81
+ private readonly identity;
82
+ private readonly size;
83
+ private memory;
84
+ private disk;
85
+ private readonly warnings;
86
+ private queue;
87
+ constructor(options: {
88
+ profile: string;
89
+ policyScope?: string;
90
+ config: ServiceNowConfig;
91
+ warn?: (message: string) => void;
92
+ });
93
+ private readonly warn;
94
+ private empty;
95
+ private warning;
96
+ put(candidate: AtfRunSummary): Promise<void>;
97
+ history(suiteId: string): Promise<AtfRunSummary[]>;
98
+ testHistory(testId: string): Promise<AtfRunSummary[]>;
99
+ private transaction;
100
+ private boundMemory;
101
+ private lock;
102
+ private read;
103
+ private write;
104
+ }
105
+ /** The coordinator supplies a narrow cache port; no credentials cross into handlers. */
106
+ export type AtfResultStore = Pick<AtfResultCache, "put" | "history" | "testHistory">;
107
+ export declare function atfResultStore(profile: string, config: ServiceNowConfig, policyScope: string): AtfResultStore;
108
+ //# sourceMappingURL=atf-result-cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atf-result-cache.d.ts","sourceRoot":"","sources":["../src/atf-result-cache.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAMpD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAarB,CAAC;AACZ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAIhE,eAAO,MAAM,mBAAmB,QAAmB,CAAC;AAGpD,qBAAa,cAAc;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,IAAI,CAAQ;IACpB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqB;IAC9C,OAAO,CAAC,KAAK,CAAuC;gBAExC,OAAO,EAAE;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,MAAM,EAAE,gBAAgB,CAAC;QACzB,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;KAClC;IAYD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA4B;IACjD,OAAO,CAAC,KAAK;IACb,OAAO,CAAC,OAAO;IAIT,GAAG,CAAC,SAAS,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAa5C,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAalD,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;YAW7C,WAAW;IAoCzB,OAAO,CAAC,WAAW;YAML,IAAI;YAcJ,IAAI;YAyBJ,KAAK;CAiBpB;AAED,wFAAwF;AACxF,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,EAAE,KAAK,GAAG,SAAS,GAAG,aAAa,CAAC,CAAC;AAErF,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,GAAG,cAAc,CAS7G"}
@@ -0,0 +1,273 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.AtfResultCache = exports.MAX_ATF_CACHE_BYTES = exports.atfRunSummarySchema = void 0;
37
+ exports.atfResultStore = atfResultStore;
38
+ /** Identity-bound, bounded ATF summaries. No raw step output is persisted. */
39
+ const node_crypto_1 = require("node:crypto");
40
+ const node_fs_1 = require("node:fs");
41
+ const fs = __importStar(require("node:fs/promises"));
42
+ const node_os_1 = require("node:os");
43
+ const node_path_1 = require("node:path");
44
+ const promises_1 = require("node:timers/promises");
45
+ const zod_1 = require("zod");
46
+ const profile_manager_js_1 = require("./profile-manager.js");
47
+ const servicenow_identifiers_js_1 = require("./servicenow-identifiers.js");
48
+ const status = zod_1.z.enum(["pending", "running", "success", "failure", "error", "skipped", "canceled", "success_with_warnings"]);
49
+ const count = zod_1.z.number().int().nonnegative();
50
+ exports.atfRunSummarySchema = zod_1.z.object({
51
+ runId: servicenow_identifiers_js_1.serviceNowSysIdSchema,
52
+ suiteId: servicenow_identifiers_js_1.serviceNowSysIdSchema,
53
+ startedAt: zod_1.z.string().datetime(),
54
+ finishedAt: zod_1.z.string().datetime().optional(),
55
+ status,
56
+ durationMs: count,
57
+ counts: zod_1.z.object({ passed: count, failed: count, errors: count, skipped: count }).strict(),
58
+ tests: zod_1.z.array(zod_1.z.object({
59
+ testId: servicenow_identifiers_js_1.serviceNowSysIdSchema,
60
+ status,
61
+ firstFailure: zod_1.z.string().max(500).optional(),
62
+ }).strict()).max(1000),
63
+ }).strict();
64
+ const suiteSchema = zod_1.z.object({ suiteId: servicenow_identifiers_js_1.serviceNowSysIdSchema, runs: zod_1.z.array(exports.atfRunSummarySchema).max(100) }).strict();
65
+ const fileSchema = zod_1.z.object({ version: zod_1.z.literal(1), identity: zod_1.z.string(), suites: zod_1.z.array(suiteSchema).max(200) }).strict();
66
+ exports.MAX_ATF_CACHE_BYTES = 16 * 1024 * 1024;
67
+ const NOFOLLOW = node_fs_1.constants.O_NOFOLLOW ?? 0;
68
+ class AtfResultCache {
69
+ filePath;
70
+ directory;
71
+ identity;
72
+ size;
73
+ memory;
74
+ disk = true;
75
+ warnings = new Set();
76
+ queue = Promise.resolve();
77
+ constructor(options) {
78
+ this.directory = options.config.atf?.resultCacheDir ?? (0, node_path_1.join)((0, node_os_1.homedir)(), ".servicenow-mcp", "atf-results");
79
+ // Hash the selector so even a profile called ../x cannot escape the directory.
80
+ const selector = (0, node_crypto_1.createHash)("sha256").update(options.profile).digest("hex");
81
+ this.filePath = (0, node_path_1.join)(this.directory, `${selector}.json`);
82
+ this.identity = (0, node_crypto_1.createHash)("sha256").update(JSON.stringify([
83
+ new URL(options.config.instance).origin, (0, profile_manager_js_1.credentialFingerprint)(options.config), options.policyScope ?? "",
84
+ ])).digest("hex");
85
+ this.size = zod_1.z.number().int().min(1).max(100).parse(options.config.atf?.resultCacheSize ?? 10);
86
+ this.memory = this.empty();
87
+ this.warn = options.warn ?? ((message) => process.stderr.write(`${message}\n`));
88
+ }
89
+ warn;
90
+ empty() { return { version: 1, identity: this.identity, suites: [] }; }
91
+ warning(key, message) {
92
+ if (!this.warnings.has(key)) {
93
+ this.warnings.add(key);
94
+ this.warn(message);
95
+ }
96
+ }
97
+ async put(candidate) {
98
+ // Project the failure length before strict validation; other unknown fields are rejected.
99
+ const run = exports.atfRunSummarySchema.parse({ ...candidate, tests: candidate.tests.map(test => ({
100
+ ...test, ...(test.firstFailure === undefined ? {} : { firstFailure: test.firstFailure.slice(0, 500) }),
101
+ })) });
102
+ await this.transaction(file => {
103
+ const previous = file.suites.find(suite => suite.suiteId === run.suiteId);
104
+ const runs = [...(previous?.runs ?? []).filter(entry => entry.runId !== run.runId), run]
105
+ .sort((a, b) => b.startedAt.localeCompare(a.startedAt) || b.runId.localeCompare(a.runId)).slice(0, this.size);
106
+ file.suites = [...file.suites.filter(suite => suite.suiteId !== run.suiteId), { suiteId: run.suiteId, runs }].slice(-200);
107
+ });
108
+ }
109
+ async history(suiteId) {
110
+ const id = servicenow_identifiers_js_1.serviceNowSysIdSchema.parse(suiteId);
111
+ let results = [];
112
+ await this.transaction(file => {
113
+ const suite = file.suites.find(entry => entry.suiteId === id);
114
+ if (suite) {
115
+ results = structuredClone(suite.runs.slice(0, this.size));
116
+ file.suites = [...file.suites.filter(entry => entry !== suite), suite];
117
+ }
118
+ });
119
+ return results;
120
+ }
121
+ async testHistory(testId) {
122
+ const id = servicenow_identifiers_js_1.serviceNowSysIdSchema.parse(testId);
123
+ let results = [];
124
+ await this.transaction(file => {
125
+ results = structuredClone(file.suites.flatMap(suite => suite.runs)
126
+ .filter(run => run.tests.some(test => test.testId === id))
127
+ .sort((a, b) => b.startedAt.localeCompare(a.startedAt)));
128
+ });
129
+ return results;
130
+ }
131
+ async transaction(update) {
132
+ const operation = this.queue.then(async () => {
133
+ let release;
134
+ let applied = false;
135
+ try {
136
+ if (this.disk) {
137
+ await fs.mkdir(this.directory, { recursive: true, mode: 0o700 });
138
+ const stat = await fs.lstat(this.directory);
139
+ if (!stat.isDirectory() || stat.isSymbolicLink())
140
+ throw new Error("unsafe cache directory");
141
+ if (process.platform !== "win32" && ((stat.mode & 0o077) !== 0 || stat.uid !== process.getuid?.())) {
142
+ throw new Error("cache directory must be owner-only");
143
+ }
144
+ release = await this.lock();
145
+ this.memory = await this.read();
146
+ }
147
+ update(this.memory);
148
+ applied = true;
149
+ // Enforce the byte bound even in the fallback store, evicting least-recently-used suites.
150
+ this.boundMemory();
151
+ if (this.disk)
152
+ await this.write();
153
+ }
154
+ catch {
155
+ this.disk = false;
156
+ this.warning("disk", "ATF result cache unavailable; using memory until restart.");
157
+ if (!applied)
158
+ update(this.memory);
159
+ this.boundMemory();
160
+ }
161
+ finally {
162
+ if (release)
163
+ await release().catch(() => {
164
+ this.disk = false;
165
+ this.warning("disk", "ATF result cache unavailable; using memory until restart.");
166
+ });
167
+ }
168
+ });
169
+ this.queue = operation.catch(() => { });
170
+ return operation;
171
+ }
172
+ boundMemory() {
173
+ for (const suite of this.memory.suites)
174
+ suite.runs = suite.runs.slice(0, this.size);
175
+ this.memory.suites = this.memory.suites.slice(-200);
176
+ while (Buffer.byteLength(JSON.stringify(this.memory)) > exports.MAX_ATF_CACHE_BYTES && this.memory.suites.length)
177
+ this.memory.suites.shift();
178
+ }
179
+ async lock() {
180
+ const path = `${this.filePath}.lock`;
181
+ const deadline = Date.now() + 2000;
182
+ for (;;) {
183
+ try {
184
+ const handle = await fs.open(path, node_fs_1.constants.O_CREAT | node_fs_1.constants.O_EXCL | node_fs_1.constants.O_WRONLY | NOFOLLOW, 0o600);
185
+ return async () => { await handle.close(); await fs.unlink(path); };
186
+ }
187
+ catch (error) {
188
+ if (error.code !== "EEXIST" || Date.now() >= deadline)
189
+ throw error;
190
+ await (0, promises_1.setTimeout)(10);
191
+ }
192
+ }
193
+ }
194
+ async read() {
195
+ let handle;
196
+ try {
197
+ handle = await fs.open(this.filePath, node_fs_1.constants.O_RDONLY | NOFOLLOW);
198
+ }
199
+ catch (error) {
200
+ if (error.code === "ENOENT")
201
+ return this.empty();
202
+ throw error;
203
+ }
204
+ try {
205
+ const stat = await handle.stat();
206
+ if (!stat.isFile() || stat.nlink !== 1)
207
+ throw new Error("unsafe cache file");
208
+ if (process.platform !== "win32" && ((stat.mode & 0o077) !== 0 || stat.uid !== process.getuid?.()))
209
+ throw new Error("cache file must be owner-only");
210
+ if (stat.size > exports.MAX_ATF_CACHE_BYTES) {
211
+ this.warning("corrupt", "ATF result cache is corrupt or oversized; starting empty.");
212
+ return this.empty();
213
+ }
214
+ const parsed = fileSchema.safeParse(JSON.parse(await handle.readFile("utf8")));
215
+ if (!parsed.success)
216
+ throw new SyntaxError("invalid cache");
217
+ if (parsed.data.identity !== this.identity)
218
+ return this.empty();
219
+ if (parsed.data.suites.some(suite => suite.runs.some(run => run.suiteId !== suite.suiteId)))
220
+ throw new SyntaxError("invalid suite");
221
+ for (const suite of parsed.data.suites)
222
+ suite.runs = suite.runs.slice(0, this.size);
223
+ return parsed.data;
224
+ }
225
+ catch (error) {
226
+ if (!(error instanceof SyntaxError))
227
+ throw error;
228
+ this.warning("corrupt", "ATF result cache is corrupt or oversized; starting empty.");
229
+ return this.empty();
230
+ }
231
+ finally {
232
+ await handle.close();
233
+ }
234
+ }
235
+ async write() {
236
+ const temp = `${this.filePath}.${(0, node_crypto_1.randomUUID)()}.tmp`;
237
+ const handle = await fs.open(temp, node_fs_1.constants.O_CREAT | node_fs_1.constants.O_EXCL | node_fs_1.constants.O_WRONLY | NOFOLLOW, 0o600);
238
+ try {
239
+ await handle.writeFile(JSON.stringify(this.memory));
240
+ await handle.sync();
241
+ await handle.close();
242
+ await fs.rename(temp, this.filePath);
243
+ if (process.platform !== "win32") {
244
+ const directory = await fs.open(this.directory, node_fs_1.constants.O_RDONLY | NOFOLLOW | (node_fs_1.constants.O_DIRECTORY ?? 0));
245
+ try {
246
+ await directory.sync();
247
+ }
248
+ finally {
249
+ await directory.close();
250
+ }
251
+ }
252
+ }
253
+ finally {
254
+ await handle.close();
255
+ await fs.unlink(temp).catch(error => { if (error.code !== "ENOENT")
256
+ throw error; });
257
+ }
258
+ }
259
+ }
260
+ exports.AtfResultCache = AtfResultCache;
261
+ const STORES = new Map();
262
+ function atfResultStore(profile, config, policyScope) {
263
+ const key = (0, node_crypto_1.createHash)("sha256").update(JSON.stringify([profile, (0, profile_manager_js_1.credentialFingerprint)(config), config.atf, policyScope])).digest("hex");
264
+ let cache = STORES.get(key);
265
+ if (!cache) {
266
+ cache = new AtfResultCache({ profile, config, policyScope });
267
+ if (STORES.size >= 32)
268
+ STORES.delete(STORES.keys().next().value);
269
+ STORES.set(key, cache);
270
+ }
271
+ return Object.freeze({ put: cache.put.bind(cache), history: cache.history.bind(cache), testHistory: cache.testHistory.bind(cache) });
272
+ }
273
+ //# sourceMappingURL=atf-result-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atf-result-cache.js","sourceRoot":"","sources":["../src/atf-result-cache.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgNA,wCASC;AAzND,8EAA8E;AAC9E,6CAAqD;AACrD,qCAAoC;AACpC,qDAAuC;AACvC,qCAAkC;AAClC,yCAAiC;AACjC,mDAA2D;AAC3D,6BAAwB;AAExB,6DAA6D;AAC7D,2EAAoE;AAEpE,MAAM,MAAM,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,uBAAuB,CAAC,CAAC,CAAC;AAC7H,MAAM,KAAK,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;AAChC,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,KAAK,EAAE,iDAAqB;IAC5B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,MAAM,GAAG,GAAG,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,IAAA,0CAAqB,EAAC,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACzI,IAAI,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,KAAK,GAAG,IAAI,cAAc,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC;QAC7D,IAAI,MAAM,CAAC,IAAI,IAAI,EAAE;YAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAM,CAAC,CAAC;QAClE,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACzB,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AACvI,CAAC"}
package/dist/client.d.ts CHANGED
@@ -13,6 +13,7 @@
13
13
  *
14
14
  * @module client
15
15
  */
16
+ import { type AtfFormInput } from "./atf-form.js";
16
17
  import { ServiceNowConfig } from "./config.js";
17
18
  import { AuthProvider } from "./auth.js";
18
19
  /** @deprecated Inspect trusted tool-error provenance instead of raw fields. */
@@ -33,9 +34,10 @@ export interface RequestResult<T = ParsedJson> {
33
34
  * client through `this`, own properties, or the prototype chain.
34
35
  */
35
36
  export interface ServiceNowOperations {
37
+ saveAtfStepInputs?(input: AtfFormInput): Promise<void>;
36
38
  get<T = ParsedJson>(path: string, params?: Record<string, string>): Promise<T | null>;
37
39
  getWithMeta<T = ParsedJson>(path: string, params?: Record<string, string>): Promise<RequestResult<T>>;
38
- post<T = ParsedJson>(path: string, body?: unknown): Promise<T | null>;
40
+ post<T = ParsedJson>(path: string, body?: unknown, params?: Record<string, string>): Promise<T | null>;
39
41
  patch<T = ParsedJson>(path: string, body?: unknown): Promise<T | null>;
40
42
  delete(path: string): Promise<{
41
43
  status: number;
@@ -76,10 +78,12 @@ export declare function runWithServiceNowRequestSignal<T>(signal: AbortSignal, o
76
78
  export declare class ServiceNowClient {
77
79
  #private;
78
80
  constructor(config: ServiceNowConfig, options?: ClientOptions);
81
+ /** Fixed native form endpoint; no generic form/URL capability is exposed. */
82
+ saveAtfStepInputs(candidate: AtfFormInput): Promise<void>;
79
83
  get<T = ParsedJson>(path: string, params?: Record<string, string>): Promise<T | null>;
80
84
  /** GET that also exposes the response status + headers (e.g. X-Total-Count). */
81
85
  getWithMeta<T = ParsedJson>(path: string, params?: Record<string, string>): Promise<RequestResult<T>>;
82
- post<T = ParsedJson>(path: string, body?: unknown): Promise<T | null>;
86
+ post<T = ParsedJson>(path: string, body?: unknown, params?: Record<string, string>): Promise<T | null>;
83
87
  patch<T = ParsedJson>(path: string, body?: unknown): Promise<T | null>;
84
88
  put<T = ParsedJson>(path: string, body?: unknown): Promise<T | null>;
85
89
  delete(path: string): Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAsB,MAAM,WAAW,CAAC;AAQ7D,+EAA+E;AAC/E,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC;AAEpC,KAAK,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,MAA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