@aristanetworks/eos-mcp-server 0.6.1-beta → 0.8.0-beta

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 (105) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +197 -44
  3. package/dist/cli.d.ts +4 -1
  4. package/dist/cli.js +63 -4
  5. package/dist/cli.js.map +1 -1
  6. package/dist/commands/inspectDiagnostics.d.ts +3 -0
  7. package/dist/commands/inspectDiagnostics.js +35 -0
  8. package/dist/commands/inspectDiagnostics.js.map +1 -0
  9. package/dist/commands/releaseDiagnostics.d.ts +9 -0
  10. package/dist/commands/releaseDiagnostics.js +87 -0
  11. package/dist/commands/releaseDiagnostics.js.map +1 -0
  12. package/dist/config/diagnostics.d.ts +60 -0
  13. package/dist/config/diagnostics.js +37 -0
  14. package/dist/config/diagnostics.js.map +1 -0
  15. package/dist/config/loadConfig.js +6 -1
  16. package/dist/config/loadConfig.js.map +1 -1
  17. package/dist/config/schema.d.ts +168 -8
  18. package/dist/config/schema.js +3 -0
  19. package/dist/config/schema.js.map +1 -1
  20. package/dist/diagnostics/concurrency.d.ts +33 -0
  21. package/dist/diagnostics/concurrency.js +157 -0
  22. package/dist/diagnostics/concurrency.js.map +1 -0
  23. package/dist/diagnostics/eapiRunner.d.ts +10 -0
  24. package/dist/diagnostics/eapiRunner.js +46 -0
  25. package/dist/diagnostics/eapiRunner.js.map +1 -0
  26. package/dist/diagnostics/executionError.d.ts +7 -0
  27. package/dist/diagnostics/executionError.js +10 -0
  28. package/dist/diagnostics/executionError.js.map +1 -0
  29. package/dist/diagnostics/executor.d.ts +32 -0
  30. package/dist/diagnostics/executor.js +115 -0
  31. package/dist/diagnostics/executor.js.map +1 -0
  32. package/dist/diagnostics/journal.d.ts +14 -0
  33. package/dist/diagnostics/journal.js +317 -0
  34. package/dist/diagnostics/journal.js.map +1 -0
  35. package/dist/diagnostics/journalTypes.d.ts +8 -0
  36. package/dist/diagnostics/journalTypes.js +2 -0
  37. package/dist/diagnostics/journalTypes.js.map +1 -0
  38. package/dist/diagnostics/ping.d.ts +7 -0
  39. package/dist/diagnostics/ping.js +131 -0
  40. package/dist/diagnostics/ping.js.map +1 -0
  41. package/dist/diagnostics/releaseEvidence.d.ts +502 -0
  42. package/dist/diagnostics/releaseEvidence.js +115 -0
  43. package/dist/diagnostics/releaseEvidence.js.map +1 -0
  44. package/dist/diagnostics/reservationSchema.d.ts +49 -0
  45. package/dist/diagnostics/reservationSchema.js +18 -0
  46. package/dist/diagnostics/reservationSchema.js.map +1 -0
  47. package/dist/diagnostics/statePath.d.ts +4 -0
  48. package/dist/diagnostics/statePath.js +25 -0
  49. package/dist/diagnostics/statePath.js.map +1 -0
  50. package/dist/diagnostics/types.d.ts +82 -0
  51. package/dist/diagnostics/types.js +2 -0
  52. package/dist/diagnostics/types.js.map +1 -0
  53. package/dist/eapi/client.d.ts +3 -1
  54. package/dist/eapi/client.js +17 -6
  55. package/dist/eapi/client.js.map +1 -1
  56. package/dist/eapi/types.d.ts +6 -0
  57. package/dist/eapi/types.js.map +1 -1
  58. package/dist/index.js +10 -0
  59. package/dist/index.js.map +1 -1
  60. package/dist/inventory/buildModel.js +1 -0
  61. package/dist/inventory/buildModel.js.map +1 -1
  62. package/dist/inventory/listInventoryView.d.ts +1 -0
  63. package/dist/inventory/listInventoryView.js +1 -0
  64. package/dist/inventory/listInventoryView.js.map +1 -1
  65. package/dist/inventory/policy.d.ts +1 -0
  66. package/dist/inventory/policy.js +3 -1
  67. package/dist/inventory/policy.js.map +1 -1
  68. package/dist/inventory/types.d.ts +1 -0
  69. package/dist/inventory/varValidation.js +1 -0
  70. package/dist/inventory/varValidation.js.map +1 -1
  71. package/dist/mcp/createServer.js +56 -4
  72. package/dist/mcp/createServer.js.map +1 -1
  73. package/dist/mcp/tools/getServerInfo.d.ts +2 -1
  74. package/dist/mcp/tools/getServerInfo.js +2 -2
  75. package/dist/mcp/tools/getServerInfo.js.map +1 -1
  76. package/dist/mcp/tools/ping.d.ts +38 -0
  77. package/dist/mcp/tools/ping.js +40 -0
  78. package/dist/mcp/tools/ping.js.map +1 -0
  79. package/dist/operations/readExecution.d.ts +3 -1
  80. package/dist/operations/readExecution.js +24 -16
  81. package/dist/operations/readExecution.js.map +1 -1
  82. package/dist/serverInfo/buildServerInfo.d.ts +2 -1
  83. package/dist/serverInfo/buildServerInfo.js +16 -2
  84. package/dist/serverInfo/buildServerInfo.js.map +1 -1
  85. package/dist/serverInfo/types.d.ts +15 -0
  86. package/dist/utils/privateFile.d.ts +3 -0
  87. package/dist/utils/privateFile.js +7 -0
  88. package/dist/utils/privateFile.js.map +1 -0
  89. package/docs/CHECKPOINT.md +11 -1
  90. package/docs/CODE_WALKTHROUGH.md +30 -6
  91. package/docs/DESIGN.md +17 -4
  92. package/docs/DIAGNOSTICS.md +218 -0
  93. package/docs/IMPLEMENTATION_PLAN.md +5 -4
  94. package/docs/QUICKSTART.md +13 -13
  95. package/docs/adr/0001-non-configuring-diagnostics.md +5 -0
  96. package/docs/adr/0002-fail-closed-diagnostic-reservations.md +7 -0
  97. package/docs/adr/0003-durable-diagnostic-ledger.md +9 -0
  98. package/docs/adr/0004-offline-operator-attested-release.md +5 -0
  99. package/docs/adr/0005-multi-destination-ping.md +9 -0
  100. package/docs/examples/diagnostic-release-evidence.template.json +26 -0
  101. package/docs/research/eos-diagnostic-lifecycle.md +84 -0
  102. package/package.json +1 -1
  103. package/dist/inventory/writePolicy.d.ts +0 -2
  104. package/dist/inventory/writePolicy.js +0 -36
  105. package/dist/inventory/writePolicy.js.map +0 -1
@@ -0,0 +1,38 @@
1
+ import { z } from "zod";
2
+ import type { DiagnosticExecutor } from "../../diagnostics/executor.js";
3
+ export declare const pingInputSchema: z.ZodObject<{
4
+ target: z.ZodString;
5
+ destinations: z.ZodArray<z.ZodString, "many">;
6
+ count: z.ZodOptional<z.ZodNumber>;
7
+ vrf: z.ZodOptional<z.ZodString>;
8
+ source: z.ZodOptional<z.ZodString>;
9
+ include_raw: z.ZodDefault<z.ZodBoolean>;
10
+ }, "strict", z.ZodTypeAny, {
11
+ target: string;
12
+ destinations: string[];
13
+ include_raw: boolean;
14
+ count?: number | undefined;
15
+ vrf?: string | undefined;
16
+ source?: string | undefined;
17
+ }, {
18
+ target: string;
19
+ destinations: string[];
20
+ count?: number | undefined;
21
+ vrf?: string | undefined;
22
+ source?: string | undefined;
23
+ include_raw?: boolean | undefined;
24
+ }>;
25
+ export declare function buildPingToolResult(args: z.infer<typeof pingInputSchema>, executor: DiagnosticExecutor, signal?: AbortSignal): Promise<{
26
+ content: {
27
+ type: "text";
28
+ text: string;
29
+ }[];
30
+ structuredContent: Record<string, unknown>;
31
+ } | {
32
+ isError: boolean;
33
+ content: {
34
+ type: "text";
35
+ text: string;
36
+ }[];
37
+ structuredContent: Record<string, unknown>;
38
+ }>;
@@ -0,0 +1,40 @@
1
+ import { z } from "zod";
2
+ import { AppError } from "../../core/errors.js";
3
+ import { buildJsonToolResult } from "../toolResult.js";
4
+ export const pingInputSchema = z.object({
5
+ target: z.string().min(1).describe("Inventory host or group executing the diagnostic"),
6
+ destinations: z.array(z.string().min(1)).min(1)
7
+ .describe("Unique unicast IPv4/IPv6 literals to test from every target host; need not be in inventory. Use one entry for a single ping. Bounded by diagnostics.maxDestinationsPerRequest"),
8
+ count: z.number().int().positive().optional().describe("Packet count per destination, bounded by server settings; defaults to diagnostics.defaultPingCount"),
9
+ vrf: z.string().min(1).optional().describe("Explicit VRF for every destination; omission uses the EOS default"),
10
+ source: z.string().min(1).optional().describe("Source IP literal in the same address family as every destination"),
11
+ include_raw: z.boolean().default(false)
12
+ }).strict("Unrecognized field. eos_ping accepts target, destinations, count, vrf, source, and include_raw; use destinations: [\"<ip>\"] for a single ping");
13
+ export async function buildPingToolResult(args, executor, signal) {
14
+ try {
15
+ const payload = await executor.execute({
16
+ target: args.target,
17
+ request: {
18
+ kind: "ping",
19
+ destinations: args.destinations,
20
+ ...(args.count === undefined ? {} : { count: args.count }),
21
+ ...(args.vrf === undefined ? {} : { vrf: args.vrf }),
22
+ ...(args.source === undefined ? {} : { source: args.source })
23
+ },
24
+ includeRaw: args.include_raw,
25
+ ...(signal === undefined ? {} : { signal })
26
+ });
27
+ return buildJsonToolResult(payload);
28
+ }
29
+ catch (error) {
30
+ if (error instanceof AppError && (error.code === "diagnostic_capacity_uncertain" || error.code.startsWith("diagnostic_state_"))) {
31
+ // The SDK otherwise reduces thrown errors to text and drops AppError.code.
32
+ return {
33
+ ...buildJsonToolResult({ error_code: error.code, message: error.message }),
34
+ isError: true
35
+ };
36
+ }
37
+ throw error;
38
+ }
39
+ }
40
+ //# sourceMappingURL=ping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ping.js","sourceRoot":"","sources":["../../../src/mcp/tools/ping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,kDAAkD,CAAC;IACtF,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;SAC5C,QAAQ,CAAC,+KAA+K,CAAC;IAC5L,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oGAAoG,CAAC;IAC5J,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE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AAI,KAAK,YAAY,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,+BAA+B,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC;YAChI,2EAA2E;YAC3E,OAAO;gBACL,GAAG,mBAAmB,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;gBAC1E,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -37,6 +37,7 @@ interface ReadOperationResultEnvelopeOptions<TExtra extends Record<string, unkno
37
37
  export declare function executeReadOperation<TDeviceResult extends ReadDeviceResultBase>(model: InventoryModel, config: ResolvedServerConfig, options: {
38
38
  target: string;
39
39
  operationName: string;
40
+ signal?: AbortSignal;
40
41
  validateTarget?: (resolvedTarget: ResolvedInventoryTarget) => void;
41
42
  run: (host: InventoryHostModel, signal: AbortSignal) => Promise<TDeviceResult>;
42
43
  onError: (host: InventoryHostModel, error: unknown) => TDeviceResult;
@@ -52,6 +53,7 @@ export declare function buildReadDeviceFailure(host: InventoryHostModel, errorCo
52
53
  export declare function enforceReadTargetLimit(config: ResolvedServerConfig, targetCount: number): void;
53
54
  export declare function enforceShowCommandLimit(config: ResolvedServerConfig, commandCount: number): void;
54
55
  export declare function mapWithConcurrency<T, R>(items: T[], concurrencyLimit: number, worker: (item: T) => Promise<R>, signal?: AbortSignal): Promise<R[]>;
55
- export declare function runWithOperationTimeout<T>(config: ResolvedServerConfig, operationName: string, run: (signal: AbortSignal) => Promise<T>): Promise<T>;
56
+ export declare function runWithOperationTimeout<T>(config: ResolvedServerConfig, operationName: string, run: (signal: AbortSignal) => Promise<T>, callerSignal?: AbortSignal): Promise<T>;
56
57
  export declare function enforceResponseSizeLimit(config: ResolvedServerConfig, payload: unknown, operationName: string, narrowingGuidance?: string): void;
58
+ export declare function buildDeviceResultSummary(results: ReadDeviceResultBase[]): DeviceResultSummary;
57
59
  export {};
@@ -11,7 +11,7 @@ export async function executeReadOperation(model, config, options) {
11
11
  catch (error) {
12
12
  return options.onError(host, error);
13
13
  }
14
- }, signal));
14
+ }, signal), options.signal);
15
15
  return {
16
16
  resolvedTarget,
17
17
  results,
@@ -79,29 +79,37 @@ export async function mapWithConcurrency(items, concurrencyLimit, worker, signal
79
79
  await Promise.all(Array.from({ length: workerCount }, () => runWorker()));
80
80
  return results;
81
81
  }
82
- export async function runWithOperationTimeout(config, operationName, run) {
82
+ export async function runWithOperationTimeout(config, operationName, run, callerSignal) {
83
83
  const controller = new AbortController();
84
- const operation = run(controller.signal);
85
- if (config.overallOperationTimeoutMs === undefined) {
86
- return operation;
84
+ const onCancel = () => controller.abort(new AppError("operation_aborted", `${operationName} was cancelled`));
85
+ callerSignal?.addEventListener("abort", onCancel, { once: true });
86
+ if (callerSignal?.aborted) {
87
+ onCancel();
87
88
  }
88
89
  let timeout;
90
+ let onAbort;
89
91
  try {
90
- return await Promise.race([
91
- operation,
92
- new Promise((_resolve, reject) => {
93
- timeout = setTimeout(() => {
94
- const error = new AppError("operation_timeout", `${operationName} exceeded overallOperationTimeoutMs ${config.overallOperationTimeoutMs}`);
95
- reject(error);
96
- controller.abort(error);
97
- }, config.overallOperationTimeoutMs);
98
- })
99
- ]);
92
+ if (config.overallOperationTimeoutMs !== undefined) {
93
+ timeout = setTimeout(() => controller.abort(new AppError("operation_timeout", `${operationName} exceeded overallOperationTimeoutMs ${config.overallOperationTimeoutMs}`)), config.overallOperationTimeoutMs);
94
+ }
95
+ const aborted = new Promise((_resolve, reject) => {
96
+ onAbort = () => reject(controller.signal.reason);
97
+ controller.signal.addEventListener("abort", onAbort, { once: true });
98
+ if (controller.signal.aborted) {
99
+ onAbort();
100
+ }
101
+ });
102
+ const operation = controller.signal.aborted ? aborted : run(controller.signal);
103
+ return await Promise.race([operation, aborted]);
100
104
  }
101
105
  finally {
102
106
  if (timeout !== undefined) {
103
107
  clearTimeout(timeout);
104
108
  }
109
+ callerSignal?.removeEventListener("abort", onCancel);
110
+ if (onAbort !== undefined) {
111
+ controller.signal.removeEventListener("abort", onAbort);
112
+ }
105
113
  }
106
114
  }
107
115
  function throwIfAborted(signal) {
@@ -122,7 +130,7 @@ export function enforceResponseSizeLimit(config, payload, operationName, narrowi
122
130
  });
123
131
  }
124
132
  }
125
- function buildDeviceResultSummary(results) {
133
+ export function buildDeviceResultSummary(results) {
126
134
  return {
127
135
  total_count: results.length,
128
136
  success_count: results.filter((result) => result.status === "success").length,
@@ -1 +1 @@
1
- {"version":3,"file":"readExecution.js","sourceRoot":"","sources":["../../src/operations/readExecution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE1E,OAAO,EAAE,sBAAsB,EAAgC,MAAM,+BAA+B,CAAC;AA0CrG,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,KAAqB,EACrB,MAA4B,EAC5B,OAMC;IAED,MAAM,cAAc,GAAG,sBAAsB,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACjF,sBAAsB,CAAC,MAAM,EAAE,cAAc,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IACpE,OAAO,CAAC,cAAc,EAAE,CAAC,cAAc,CAAC,CAAC;IAEzC,MAAM,OAAO,GAAG,MAAM,uBAAuB,CAC3C,MAAM,EACN,OAAO,CAAC,aAAa,EACrB,CAAC,MAAM,EAAE,EAAE,CACT,kBAAkB,CAAC,cAAc,CAAC,aAAa,EAAE,MAAM,CAAC,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACxF,IAAI,CAAC;YACH,OAAO,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACzC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC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AAG,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAClE,QAAQ,EAAE,iBAAiB,IAAI,eAAe;SAC/C,CACF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,OAA+B;IACtE,OAAO;QACL,WAAW,EAAE,OAAO,CAAC,MAAM;QAC3B,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,MAAM;QAC7E,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,MAAM;KAC5E,CAAC;AACJ,CAAC"}
@@ -1,2 +1,3 @@
1
+ import type { DiagnosticCapacitySnapshot } from "../diagnostics/types.js";
1
2
  import type { ServerInfo, ServerRuntimeContext } from "./types.js";
2
- export declare function buildServerInfo(context: ServerRuntimeContext): ServerInfo;
3
+ export declare function buildServerInfo(context: ServerRuntimeContext, diagnosticCapacity?: DiagnosticCapacitySnapshot): ServerInfo;
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
2
  import { APP_NAME, APP_VERSION } from "../core/version.js";
3
- export function buildServerInfo(context) {
3
+ export function buildServerInfo(context, diagnosticCapacity) {
4
4
  const summary = context.inventorySummary;
5
5
  return {
6
6
  server_name: APP_NAME,
@@ -29,7 +29,21 @@ export function buildServerInfo(context) {
29
29
  max_read_targets: context.config.maxReadTargets,
30
30
  max_show_commands_per_request: context.config.maxShowCommandsPerRequest,
31
31
  max_logging_messages_per_request: context.config.maxLoggingMessagesPerRequest,
32
- max_response_size_bytes: context.config.maxResponseSizeBytes
32
+ max_response_size_bytes: context.config.maxResponseSizeBytes,
33
+ diagnostics: {
34
+ default_ping_count: context.config.diagnostics.defaultPingCount,
35
+ max_ping_count: context.config.diagnostics.maxPingCount,
36
+ max_probes_per_request: context.config.diagnostics.maxProbesPerRequest,
37
+ max_destinations_per_request: context.config.diagnostics.maxDestinationsPerRequest,
38
+ device_concurrency: context.config.diagnostics.deviceConcurrency,
39
+ ping_reply_timeout_ms: context.config.diagnostics.pingReplyTimeoutMs,
40
+ command_timeout_ms: context.config.diagnostics.commandTimeoutMs,
41
+ http_timeout_ms: context.config.diagnostics.httpTimeoutMs,
42
+ overall_operation_timeout_ms: context.config.diagnostics.overallOperationTimeoutMs
43
+ }
44
+ },
45
+ diagnostics: {
46
+ capacity: diagnosticCapacity ?? null
33
47
  },
34
48
  logging: {
35
49
  actor: context.config.actor ?? null,
@@ -1 +1 @@
1
- {"version":3,"file":"buildServerInfo.js","sourceRoot":"","sources":["../../src/serverInfo/buildServerInfo.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAG3D,MAAM,UAAU,eAAe,CAAC,OAA6B;IAC3D,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAEzC,OAAO;QACL,WAAW,EAAE,QAAQ;QACrB,cAAc,EAAE,WAAW;QAC3B,WAAW,EAAE,OAAO,CAAC,UAAU;QAC/B,UAAU,EAAE,OAAO,CAAC,SAAS;QAC7B,YAAY,EAAE,WAAW;QACzB,SAAS,EAAE;YACT,QAAQ,EAAE,OAAO,EAAE,QAAQ,IAAI,gBAAgB,CAAC,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC;YAC7E,WAAW,EAAE,OAAO,EAAE,UAAU,IAAI,IAAI;YACxC,WAAW,EAAE,OAAO,EAAE,cAAc,IAAI,IAAI;YAC5C,YAAY,EAAE,OAAO,EAAE,eAAe,IAAI,IAAI;YAC9C,kBAAkB,EAAE,OAAO,EAAE,oBAAoB,IAAI,IAAI;YACz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import type { DiagnosticCapacitySnapshot } from "../diagnostics/types.js";
2
3
  import type { EapiVersion } from "../eapi/types.js";
3
4
  import type { InventorySummary } from "../inventory/types.js";
4
5
  export interface ServerRuntimeContext {
@@ -35,6 +36,20 @@ export interface ServerInfo {
35
36
  max_show_commands_per_request: number;
36
37
  max_logging_messages_per_request: number;
37
38
  max_response_size_bytes: number;
39
+ diagnostics: {
40
+ default_ping_count: number;
41
+ max_ping_count: number;
42
+ max_probes_per_request: number;
43
+ max_destinations_per_request: number;
44
+ device_concurrency: number;
45
+ ping_reply_timeout_ms: number;
46
+ command_timeout_ms: number;
47
+ http_timeout_ms: number;
48
+ overall_operation_timeout_ms: number;
49
+ };
50
+ };
51
+ diagnostics: {
52
+ capacity: DiagnosticCapacitySnapshot | null;
38
53
  };
39
54
  logging: {
40
55
  actor: string | null;
@@ -0,0 +1,3 @@
1
+ import type { Stats } from "node:fs";
2
+ /** Shared file policy; callers retain path/descriptor race checks and error codes. */
3
+ export declare function isPrivateRegularFile(stat: Stats): boolean;
@@ -0,0 +1,7 @@
1
+ /** Shared file policy; callers retain path/descriptor race checks and error codes. */
2
+ export function isPrivateRegularFile(stat) {
3
+ return stat.isFile() && !stat.isSymbolicLink() && stat.nlink === 1 &&
4
+ (process.platform === "win32" || ((stat.mode & 0o077) === 0 &&
5
+ (process.getuid === undefined || stat.uid === process.getuid())));
6
+ }
7
+ //# sourceMappingURL=privateFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"privateFile.js","sourceRoot":"","sources":["../../src/utils/privateFile.ts"],"names":[],"mappings":"AAEA,sFAAsF;AACtF,MAAM,UAAU,oBAAoB,CAAC,IAAW;IAC9C,OAAO,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC;QAChE,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC;YACzD,CAAC,OAAO,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,GAAG,KAAK,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;AACxE,CAAC"}
@@ -11,6 +11,7 @@ The server is a test-backed, read-only MCP service for Arista EOS eAPI. The prod
11
11
  - `eos_get_server_info`
12
12
  - `eos_list_inventory`
13
13
  - `eos_probe_devices`
14
+ - `eos_ping` (bounded active diagnostics to one or more destinations, explicit inventory opt-in)
14
15
  - `eos_run_show`
15
16
  - `eos_show_logging`
16
17
  - `eos_get_facts`
@@ -22,6 +23,8 @@ The server is a test-backed, read-only MCP service for Arista EOS eAPI. The prod
22
23
  - `validate-inventory`
23
24
  - `print-server-info`
24
25
  - `probe`
26
+ - `inspect-diagnostics` (read-only persisted state and audit, no device access)
27
+ - `release-diagnostics` (offline operator attestation, explicit scope and atomic audit)
25
28
 
26
29
  ## Safety and operational controls
27
30
 
@@ -32,6 +35,11 @@ The server is a test-backed, read-only MCP service for Arista EOS eAPI. The prod
32
35
  - HTTPS with certificate validation by default and optional custom CA support.
33
36
  - Validated show commands and bounded logging/running-configuration queries.
34
37
  - Read-operation concurrency, target, response-size, and timeout controls.
38
+ - Configurable diagnostic budgets, durable ledger-scoped admission, independent timeouts, and indefinite fail-closed reservations after uncertain remote completion.
39
+ - Write-ahead SQLite reservations, exact wire-ID persistence/correlation, exclusive crash-released ownership, restoration of unfinished work as uncertain, and fail-closed storage errors.
40
+ - JSON-RPC version/ID and result/error exclusivity validation precedes output interpretation or read-only fallback; unrelated acknowledgements cannot free diagnostic capacity.
41
+ - Live sanitized capacity/reservation visibility in server info; `diagnostic_capacity_uncertain` prevents new or queued work when all capacity is uncertain. Persistence and offline inspection are implemented. Offline operator-attested release is implemented, not an EOS completion proof. A qualified native remote kill/deadline mechanism remains unimplemented; installed EOS requestTimeout is not an end-to-end termination guarantee.
42
+ - No retries or shell/SSH fallback for ping. Non-configuring diagnostics are not passive reads; traceroute and capture are not implemented.
35
43
  - Sanitized result envelopes with stable machine-readable errors.
36
44
 
37
45
  ## Re-entry reading
@@ -43,4 +51,6 @@ The server is a test-backed, read-only MCP service for Arista EOS eAPI. The prod
43
51
 
44
52
  ## Validation
45
53
 
46
- Run `npm test`, `npm run typecheck`, and `npm run build` after changes. Optional integration tests require the configured cEOS environment.
54
+ Run `npm test`, `npm run typecheck`, `npm run lint`, and `npm run build` after changes. Optional integration tests require the configured cEOS environment. Ping's module and MCP stdio integration suites are qualified on cEOS 4.34.3M; see [DIAGNOSTICS.md](DIAGNOSTICS.md).
55
+
56
+ Latest refactor verification: **362 tests across 40 files passed** with `INTEGRATION=1`, plus typecheck, static policy, build, and whitespace checks. Independent read-only review found no findings. Synthetic ledgers written by pre-refactor commit `0e208ec` retained compatible audit checksums, inspection, committed retries, legacy RPC identities, and remaining capacity. No real EOS reservations were operator-released in these checks.
@@ -14,18 +14,20 @@ This repository is a single TypeScript/Node package.
14
14
 
15
15
  ## Runtime Entry
16
16
 
17
- Execution starts at `src/index.ts`. It parses CLI args, loads config, then dispatches one of four commands:
17
+ Execution starts at `src/index.ts`. It parses CLI args, loads config, then dispatches one of six commands:
18
18
 
19
19
  - `serve`: load inventory, validate startup credentials, start MCP stdio server.
20
20
  - `validate-inventory`: validate inventory and print the result.
21
21
  - `print-server-info`: print sanitized server metadata.
22
22
  - `probe`: run the same probe logic as the MCP probe tool.
23
+ - `inspect-diagnostics`: read existing reservations and release audit without device access, ownership takeover, or reset.
24
+ - `release-diagnostics`: offline, exact-scope operator release with explicit fencing attestation and atomic audit; no device calls or MCP exposure.
23
25
 
24
26
  CLI parsing lives in `src/cli.ts`. The app name and version are read from `package.json` at runtime via `src/core/version.ts`. Shared error handling lives in `src/core/errors.ts`, which defines `AppError` and the stable machine-readable error codes used across the CLI and MCP layers.
25
27
 
26
28
  ## Config And Inventory
27
29
 
28
- Config loading is in `src/config/loadConfig.ts`, with Zod schemas in `src/config/schema.ts`. It merges optional config-file values with CLI overrides and resolves paths.
30
+ Config loading is in `src/config/loadConfig.ts`, with Zod schemas in `src/config/schema.ts`. Diagnostic defaults and cross-setting budget validation live in `src/config/diagnostics.ts`. It merges optional config-file values with CLI overrides and resolves paths.
29
31
 
30
32
  `src/inventory/loadInventory.ts` orchestrates inventory loading. It supports simplified YAML and canonical Ansible-style YAML by delegating to a pipeline: parsing (`src/inventory/parse.ts`), schema detection and normalization (`src/inventory/normalize.ts`), structural and variable-type validation (`src/inventory/validateNormalized.ts`, `src/inventory/varValidation.ts`), and model construction (`src/inventory/buildModel.ts`). Together these validate structure, build effective host vars, resolve groups, and produce an `InventoryModel`.
31
33
 
@@ -35,7 +37,7 @@ Supporting inventory modules:
35
37
  - `src/inventory/internalTypes.ts` / `src/inventory/internalUtils.ts`: shared types and helpers used across the parsing/normalization/validation pipeline.
36
38
  - `src/inventory/effectiveVars.ts`: global/group/host variable inheritance and same-depth conflict handling.
37
39
  - `src/inventory/graph.ts`: group parent maps, group depths, host lineage, direct memberships, and resolved group hosts.
38
- - `src/inventory/policy.ts`: EOS eligibility and read access evaluation, including the `mcp_read_allowed` fail-closed check.
40
+ - `src/inventory/policy.ts`: EOS eligibility and read access evaluation, including `mcp_read_allowed` and the explicit `mcp_diagnostics_allowed` opt-in (read denial vetoes both).
39
41
  - `src/inventory/resolveTarget.ts`: host/group target resolution and policy fail-closed checks.
40
42
  - `src/inventory/listInventoryView.ts`: sanitized inventory view for MCP output.
41
43
 
@@ -49,8 +51,9 @@ Startup credential validation is in `src/connection/validateStartupConnections.t
49
51
 
50
52
  eAPI protocol and transport are split:
51
53
 
52
- - `src/eapi/client.ts`: builds JSON-RPC `runCmds` requests using the connection's `eapiVersion` (`"latest"` by default, `1` when pinned in config), handles HTTP errors, invalid JSON, JSON-RPC errors, and unexpected result counts. Supports opt-in enable mode (`{ enable: true }`) for privileged commands by prepending `enable` to the wire commands and stripping the extra result entry transparently. Per-request timeout and caller cancellation are combined with `AbortSignal`.
54
+ - `src/eapi/client.ts`: builds JSON-RPC `runCmds` requests using the connection's `eapiVersion` (`"latest"` by default, `1` when pinned in config), handles HTTP errors, invalid JSON, protocol version/response-ID correlation, exclusive result/error envelopes, JSON-RPC errors, and unexpected result counts. Supports opt-in enable mode (`{ enable: true }`) for privileged commands by prepending `enable` to the wire commands and stripping the extra result entry transparently. Per-request timeout and caller cancellation are combined with `AbortSignal`.
53
55
  - `src/eapi/transport.ts`: production HTTPS transport and test-friendly fetch transport. The production transport enforces `maxResponseSizeBytes` while chunks are received, before buffering an oversized device response.
56
+ - `src/eapi/client.ts` also exposes single-execution text commands for active diagnostics, without JSON fallback retries, using the pre-journaled request identity supplied by the diagnostic execution context.
54
57
  - `src/eapi/types.ts`: shared eAPI types, the low-level `EosCommandRunner` interface used by `EapiDeviceReader`, `EapiCommandOptions`, and helpers for validating/drilling into eAPI JSON-RPC response payloads.
55
58
 
56
59
  ## Read Tool Services
@@ -71,15 +74,31 @@ Shared read orchestration lives in `src/operations/readExecution.ts`. It central
71
74
 
72
75
  Shared type-narrowing utilities (`isObject`, `readString`, `readBoolean`, `readNumber`, etc.) live in `src/utils/value.ts`.
73
76
 
77
+ ## Diagnostic Execution
78
+
79
+ - `src/diagnostics/executor.ts`: typed diagnostic orchestration, inventory opt-in and probe-budget checks, existing result envelopes, and cancellation. One executor is created per server instance.
80
+ - `src/diagnostics/concurrency.ts`: admission shared by concurrent calls, with queueing separated from durable reservation creation, completion, and uncertainty transitions. Shutdown, storage failure, and exhausted uncertainty share queued-work rejection. Unknown completion never expires; cancelled waiters are removed.
81
+ - `src/diagnostics/eapiRunner.ts`: connection resolution followed by one text eAPI attempt in enable mode. Separate error paths distinguish local rejection before dispatch from uncertain RPC, transport, or malformed-result failures after dispatch; there is no mutable dispatch flag or retry.
82
+ - `src/diagnostics/executionError.ts`: typed `AppError` classification (`not_dispatched`, `completed`, or `unknown`). Only explicitly settled errors permit capacity reuse; ordinary errors remain uncertain.
83
+ - `src/diagnostics/ping.ts`: literal-address/VRF/source/count validation, finite ping command construction, and loss/RTT interpretation. A no-reply finding is not an execution failure.
84
+ - `src/diagnostics/types.ts`: request, prepared intent, observation, and finding types discriminated by diagnostic kind, plus the `DiagnosticDeviceRunner` seam. Only ping is implemented; capture sessions are not pre-modeled.
85
+
86
+ Diagnostic execution reuses read-operation orchestration with independent settings and global admission. Unknown completion retains capacity indefinitely; HTTP abort and elapsed budgets are not remote kill signals. Each server-info call reads `DiagnosticExecutor.getCapacity()` afresh; the standalone CLI reports no live snapshot.
87
+
88
+ `journal.ts` provides private SQLite persistence and an exclusive ownership lock; `statePath.ts` supplies canonical inventory identity/default storage. Entries survive crashes, and commit failure blocks dispatch or reuse. The journal is injected through `journalTypes.ts`, so pure executor tests can remain in memory. Native SQLite loads only when production diagnostic permissions or ledger administration require it.
89
+
90
+ `releaseEvidence.ts` validates attestation scope/consistency and uses shared JSON SHA-256 hashing for evidence and audit checksums; it does not verify external fencing. `reservationSchema.ts` validates and normalizes both unresolved records and audit snapshots, including absent legacy RPC IDs. The refactor preserves serialized records, checksum computation, and schema versions. Schema-1 migration, audit insertion, and selected deletions share the release transaction; ordinary server migration preserves occupied capacity. See [DIAGNOSTICS.md](DIAGNOSTICS.md).
91
+
74
92
  ## MCP Layer
75
93
 
76
- The MCP server is assembled in `src/mcp/createServer.ts`. It creates the official SDK `McpServer`, registers seven read-only tools, and connects over stdio.
94
+ The MCP server is assembled in `src/mcp/createServer.ts`. It creates the official SDK `McpServer`, registers eight non-configuring tools, and connects over stdio. Ping forwards the MCP cancellation signal into diagnostic execution.
77
95
 
78
96
  Tool adapters live under `src/mcp/tools/`:
79
97
 
80
98
  - `getServerInfo.ts`
81
99
  - `listInventory.ts`
82
100
  - `probeDevices.ts`
101
+ - `ping.ts`
83
102
  - `runShow.ts`
84
103
  - `showLogging.ts`
85
104
  - `getFacts.ts`
@@ -96,6 +115,8 @@ Local CLI commands live in `src/commands/`:
96
115
  - `validateInventory.ts`
97
116
  - `printServerInfo.ts`
98
117
  - `probe.ts`
118
+ - `inspectDiagnostics.ts`
119
+ - `releaseDiagnostics.ts`
99
120
 
100
121
  ## Tests
101
122
 
@@ -105,8 +126,11 @@ Tests mirror the source layout:
105
126
  - Inventory and target behavior: `inventory.test.ts`, `targetResolution.test.ts`
106
127
  - eAPI and connection behavior: `eapiClient.test.ts`, `eosDeviceReader.test.ts`, `startupValidation.test.ts`, `responseSize.test.ts`
107
128
  - Read services and orchestration: `probeDevices.test.ts`, `runShow.test.ts`, `loggingQuery.test.ts`, `showLogging.test.ts`, `getFacts.test.ts`, `getRunningConfig.test.ts`, `readExecution.test.ts`
129
+ - Diagnostics: `ping.test.ts`, `diagnosticConfig.test.ts`, `diagnostics.test.ts`, `diagnosticEapi.test.ts`, `diagnosticReservations.test.ts` (delayed-start/cancellation regressions and visibility)
130
+ - Diagnostic persistence: `diagnosticJournal.test.ts` (including child-process crash/lock recovery), `diagnosticPersistence.test.ts` (write-ahead failures and queued-admission failure without invalidating completed work), `eapiCorrelation.test.ts`, `inspectDiagnostics.test.ts` (read-only CLI and concurrent-release snapshot consistency)
108
131
  - Server info and errors: `buildServerInfo.test.ts`, `errors.test.ts`, `errorTaxonomy.test.ts`
109
132
  - MCP adapters and stdio: `readToolsMcp.test.ts`, `probeDevicesTool.test.ts`, `listInventoryTool.test.ts`, `mcpStdioSmoke.test.ts`
110
133
  - Package/static policy: `packagePolicy.test.ts`, `packageSmoke.test.ts`
111
- - Optional cEOS integration (requires a configured lab): `integration.test.ts`
134
+ - Optional cEOS integration (requires a configured lab): `integration.test.ts`, `pingIntegration.test.ts`, `pingMcpIntegration.test.ts`
135
+ - Offline attested release and CLI: `diagnosticRelease.test.ts`, `releaseDiagnosticsCli.test.ts` (synthetic evidence only; no live EOS releases)
112
136
  - Shared test helpers: `test/helpers.ts`
package/docs/DESIGN.md CHANGED
@@ -11,6 +11,7 @@ EOS MCP Server is an ESM TypeScript MCP server that provides inventory-scoped, r
11
11
  | `eos_get_server_info` | Sanitized runtime, limits, and inventory summary |
12
12
  | `eos_list_inventory` | Eligible hosts and groups |
13
13
  | `eos_probe_devices` | Connectivity, authentication, and harmless command check |
14
+ | `eos_ping` | Explicitly authorized, bounded active ping diagnostics on EOS to one or more destinations |
14
15
  | `eos_run_show` | Validated single-line `show` commands |
15
16
  | `eos_show_logging` | Bounded logging retrieval |
16
17
  | `eos_get_facts` | Fixed device facts |
@@ -21,7 +22,7 @@ Local CLI commands provide inventory validation, server-info output, and probing
21
22
  ## Target boundary
22
23
 
23
24
  - A target is exactly one inventory host or group name.
24
- - Address, hostname, pattern, and ad-hoc targets are rejected.
25
+ - Address, hostname, pattern, and ad-hoc execution targets are rejected. Ping destinations are separate literal IP addresses and may be outside inventory.
25
26
  - Host and group names use `^[A-Za-z0-9_.-]+$` and cannot collide.
26
27
  - Group hosts are deduplicated and ordered alphabetically.
27
28
  - Canonical inventories merge repeated group declarations with host/child union and later-wins variables.
@@ -32,6 +33,8 @@ Canonical Ansible-style YAML and simplified YAML are supported. Structural keys
32
33
 
33
34
  `mcp_read_allowed` defaults to `true` for eligible EOS hosts and follows inherited inventory variable precedence. Operational requests fail closed when any resolved host is ineligible or read-denied — a mixed or ineligible target fails as a whole, and devices are never silently skipped. The inventory is the only policy source.
34
35
 
36
+ `mcp_diagnostics_allowed` defaults to `false` and must explicitly resolve to boolean `true` to permit diagnostics. It follows existing inheritance; EOS eligibility and read permission are prerequisites. Mixed diagnostic permission in a group fails the entire request before dispatch.
37
+
35
38
  ## Connection security
36
39
 
37
40
  - HTTPS is required.
@@ -41,16 +44,26 @@ Canonical Ansible-style YAML and simplified YAML are supported. Structural keys
41
44
 
42
45
  ## Command safety
43
46
 
44
- `eos_run_show` accepts only trimmed, single-line commands beginning with `show`. It rejects control characters, shell metacharacters, and CLI output modifiers. `eos_get_running_config.section` uses the same single-line restrictions. Enable mode is used only as needed to retrieve running configuration.
47
+ `eos_run_show` accepts only trimmed, single-line commands beginning with `show`. It rejects control characters, shell metacharacters, and CLI output modifiers. `eos_get_running_config.section` uses the same single-line restrictions. Enable mode is used only for operations that need it, currently running configuration and ping. Diagnostics accept typed, validated arguments, not arbitrary command strings; the show-only validator is not relaxed.
45
48
 
46
49
  ## Runtime controls
47
50
 
48
51
  Read requests have configured per-device timeout, optional overall timeout, device concurrency, target-count, command-count, logging-message, and response-size limits. The overall timeout aborts in-flight requests and halts further scheduling. Device HTTP responses and final serialized tool results are size-limited.
49
52
 
53
+ ### Active diagnostic controls
54
+
55
+ `eos_ping` uses independent `diagnostics` settings with finite defaults: count 3/max 10, aggregate probes 100 (hosts × destinations × count), 16 destinations per call, server-wide device concurrency 5, reply timeout 1000 ms, command budget 30000 ms, HTTP timeout 35000 ms, and overall timeout 60000 ms. All are configurable; target and response-size limits are shared with reads. Config validation requires consistent counts, execution budgets, and HTTP timeouts.
56
+
57
+ A ping request names one or more destinations and sends exactly one text-mode eAPI request per host and destination, without automatic retries. Those executions run concurrently under the shared admission controller, each with its own reservation, and return one result per host and destination. Fixed count, one-second interval, fixed size 64, and reply timeout bound device work; the command budget is not a native remote kill timer. HTTP abort is not proof of remote completion. Unknown completion retains its global admission slot indefinitely; elapsed time is never completion evidence. When all capacity is uncertain, new and queued work fail closed with `diagnostic_capacity_uncertain`. Server info exposes current sanitized capacity and reservation state. Production commits reservations before dispatch to a private SQLite ledger and commits confirmed removal before reusing capacity. Unfinished entries restore as uncertain across restarts; only one server may own a ledger. Invalid, mismatched, or missing companion state fails closed. `inspect-diagnostics` provides read-only offline inspection without ownership takeover or device access. Ledger location is configurable as `diagnostics.stateFile`, otherwise derived from the canonical inventory path under the user's state directory. Offline operator-attested release requires independent fencing evidence covering running, accepted queued and replayable work, exact IDs, explicit confirmation and exclusive ownership. Schema-2 audit and deletions commit atomically; inspection is read-only, and neither a reset nor a release is exposed through MCP. Authority is the OS-authorized operator, not automated validation of fencing truth. A qualified native remote deadline remains unresolved; timeout-shaped RPC errors are not assumed to confirm process exit. Cancellation stops scheduling and aborts HTTP requests; overall timeout remains a request-level failure without partial results. See [DIAGNOSTICS.md](DIAGNOSTICS.md) for the full lifecycle assumptions and limits.
58
+
59
+ Only unicast literal destinations are supported; DNS, scoped/link-local IPv6, multicast, unspecified, and limited broadcast addresses are rejected. Optional VRF/source selection must not fall back. Directed-broadcast detection is not guaranteed from an address alone.
60
+
50
61
  ## Result and error model
51
62
 
52
- Device-facing tools return target metadata, resolved devices, summary counts, and per-device results. Request-level failures and known device failures use `AppError` machine-readable codes. Supported diagnostic tools expose raw eAPI payloads only through an explicit `include_raw` option.
63
+ Every eAPI response must identify JSON-RPC 2.0, match its request ID exactly, and contain exactly one result/error member before interpretation. Missing or mismatched identity is `eapi_response_uncorrelated`, not completion evidence. Diagnostic wire IDs are journaled before dispatch and survive uncertain restarts; legacy records without wire IDs are not retroactively correlated. Correlation IDs do not provide an EOS job lookup, cancellation, or idempotency facility.
64
+
65
+ Device-facing tools return target metadata, resolved devices, summary counts, and per-device results. Request-level failures and known device failures use `AppError` machine-readable codes. Supported read tools expose raw eAPI payloads only through an explicit `include_raw` option. Ping separates successful execution from a reachability finding and returns normalized loss/RTT measurements; original EOS text is opt-in. Unrecognized output is an explicit device failure, never an invented finding.
53
66
 
54
67
  ## Compatibility and validation
55
68
 
56
- The read surface is validated against cEOS 4.34.3M. EOS 4.20 is the documented minimum for supported read operations. Changes must preserve strict TypeScript checks and pass the unit, stdio smoke, and package-policy test suites.
69
+ The read surface is validated against cEOS 4.34.3M. EOS 4.20 is the documented minimum for supported read operations. Ping is separately qualified on cEOS 4.34.3M; its compatibility with older EOS versions or physical platforms is not established by the existing read-path minimum. Traceroute and packet capture remain future work requiring their own capability and lifecycle decisions. Changes must preserve strict TypeScript checks and pass the unit, stdio smoke, and package-policy test suites.