@sonde/shared 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +6 -0
- package/.turbo/turbo-test.log +24 -0
- package/.turbo/turbo-typecheck.log +4 -0
- package/CHANGELOG.md +7 -0
- package/dist/crypto/pack-signing.d.ts +18 -0
- package/dist/crypto/pack-signing.d.ts.map +1 -0
- package/dist/crypto/pack-signing.js +31 -0
- package/dist/crypto/pack-signing.js.map +1 -0
- package/dist/crypto/pack-signing.test.d.ts +2 -0
- package/dist/crypto/pack-signing.test.d.ts.map +1 -0
- package/dist/crypto/pack-signing.test.js +61 -0
- package/dist/crypto/pack-signing.test.js.map +1 -0
- package/dist/crypto/signing.test (# Edit conflict 2026-02-17 HtKiQM9 #).js +57 -0
- package/dist/crypto/signing.test.d.ts (# Edit conflict 2026-02-17 EtwzGam #).map +1 -0
- package/dist/crypto/signing.test.js (# Edit conflict 2026-02-17 FD0ZiNy #).map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/schemas/mcp.d.ts +130 -41
- package/dist/schemas/mcp.d.ts.map +1 -1
- package/dist/schemas/mcp.js +34 -11
- package/dist/schemas/mcp.js.map +1 -1
- package/dist/schemas/packs.d.ts +19 -15
- package/dist/schemas/packs.d.ts.map +1 -1
- package/dist/schemas/packs.js +2 -0
- package/dist/schemas/packs.js.map +1 -1
- package/dist/schemas/probes.d.ts +8 -0
- package/dist/schemas/probes.d.ts.map +1 -1
- package/dist/schemas/probes.js +4 -0
- package/dist/schemas/probes.js.map +1 -1
- package/dist/schemas/protocol.d.ts +50 -3
- package/dist/schemas/protocol.d.ts.map +1 -1
- package/dist/schemas/protocol.js +16 -0
- package/dist/schemas/protocol.js.map +1 -1
- package/dist/types/common.d.ts +1 -1
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/common.js +1 -0
- package/dist/types/common.js.map +1 -1
- package/dist/types/integrations.d.ts +36 -0
- package/dist/types/integrations.d.ts.map +1 -0
- package/dist/types/integrations.js +2 -0
- package/dist/types/integrations.js.map +1 -0
- package/package.json +1 -1
- package/src/crypto/pack-signing.test.ts +72 -0
- package/src/crypto/pack-signing.ts +36 -0
- package/src/index.ts +17 -1
- package/src/schemas/mcp.ts +38 -11
- package/src/schemas/packs.ts +2 -0
- package/src/schemas/probes.ts +4 -0
- package/src/schemas/protocol.ts +20 -0
- package/src/types/common.ts +1 -0
- package/src/types/integrations.ts +51 -0
- package/tsconfig.tsbuildinfo +1 -0
package/dist/schemas/mcp.js
CHANGED
|
@@ -5,8 +5,8 @@ import { AgentInfo } from '../types/agent.js';
|
|
|
5
5
|
* MVP's primary MCP tool — sends a single probe to an agent.
|
|
6
6
|
*/
|
|
7
7
|
export const ProbeInput = z.object({
|
|
8
|
-
/** Agent name or ID */
|
|
9
|
-
agent: z.string(),
|
|
8
|
+
/** Agent name or ID (required for agent probes, omit for integration probes) */
|
|
9
|
+
agent: z.string().optional(),
|
|
10
10
|
/** Full probe name, e.g. "system.disk.usage" */
|
|
11
11
|
probe: z.string(),
|
|
12
12
|
/** Probe-specific parameters */
|
|
@@ -16,29 +16,52 @@ export const ProbeInput = z.object({
|
|
|
16
16
|
* Input schema for the `diagnose` MCP tool (post-MVP).
|
|
17
17
|
*/
|
|
18
18
|
export const DiagnoseInput = z.object({
|
|
19
|
-
/** Agent name or ID */
|
|
20
|
-
agent: z.string(),
|
|
19
|
+
/** Agent name or ID (required for agent probes, omit for integration probes) */
|
|
20
|
+
agent: z.string().optional(),
|
|
21
21
|
/** Pack category, e.g. "docker", "system" */
|
|
22
22
|
category: z.string(),
|
|
23
23
|
/** Natural language problem description */
|
|
24
24
|
description: z.string().optional(),
|
|
25
|
+
/** Parameters for diagnostic runbooks (e.g. { vmid: 100 }) */
|
|
26
|
+
params: z.record(z.unknown()).optional(),
|
|
25
27
|
});
|
|
26
28
|
/**
|
|
27
29
|
* Output schema for the `diagnose` MCP tool (post-MVP).
|
|
28
30
|
*/
|
|
29
31
|
export const DiagnoseOutput = z.object({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
summary: z.object({
|
|
32
|
+
/** Execution metadata */
|
|
33
|
+
meta: z.object({
|
|
34
|
+
agent: z.string(),
|
|
35
|
+
timestamp: z.string().datetime(),
|
|
36
|
+
category: z.string(),
|
|
37
|
+
runbookId: z.string(),
|
|
37
38
|
probesRun: z.number(),
|
|
38
39
|
probesSucceeded: z.number(),
|
|
39
40
|
probesFailed: z.number(),
|
|
40
41
|
durationMs: z.number(),
|
|
42
|
+
summaryText: z.string().optional(),
|
|
43
|
+
/** Whether any probe data was truncated */
|
|
44
|
+
truncated: z.boolean().optional(),
|
|
45
|
+
/** Whether runbook timed out with partial results */
|
|
46
|
+
timedOut: z.boolean().optional(),
|
|
41
47
|
}),
|
|
48
|
+
/** Raw probe data keyed by probe name */
|
|
49
|
+
probes: z.record(z.object({
|
|
50
|
+
status: z.enum(['success', 'error', 'timeout']),
|
|
51
|
+
data: z.unknown(),
|
|
52
|
+
durationMs: z.number(),
|
|
53
|
+
error: z.string().optional(),
|
|
54
|
+
})),
|
|
55
|
+
/** Structured analysis findings from diagnostic runbooks */
|
|
56
|
+
findings: z
|
|
57
|
+
.array(z.object({
|
|
58
|
+
severity: z.enum(['info', 'warning', 'critical']),
|
|
59
|
+
title: z.string(),
|
|
60
|
+
detail: z.string(),
|
|
61
|
+
remediation: z.string().optional(),
|
|
62
|
+
relatedProbes: z.array(z.string()),
|
|
63
|
+
}))
|
|
64
|
+
.optional(),
|
|
42
65
|
});
|
|
43
66
|
/**
|
|
44
67
|
* Output schema for the `list_agents` MCP tool.
|
package/dist/schemas/mcp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/schemas/mc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CAAC,QAAQ,EAAE;QAClC,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;KACnC,CAAC,CACH;SACA,QAAQ,EAAE;CACd,CAAC,CAAC;AAGH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC,CAAC"}
|
package/dist/schemas/packs.d.ts
CHANGED
|
@@ -94,10 +94,10 @@ export declare const ProbeDefinition: z.ZodObject<{
|
|
|
94
94
|
/** Probe timeout in ms */
|
|
95
95
|
timeout: z.ZodDefault<z.ZodNumber>;
|
|
96
96
|
}, "strip", z.ZodTypeAny, {
|
|
97
|
-
timeout: number;
|
|
98
|
-
name: string;
|
|
99
97
|
description: string;
|
|
98
|
+
name: string;
|
|
100
99
|
capability: "observe" | "interact" | "manage";
|
|
100
|
+
timeout: number;
|
|
101
101
|
params?: Record<string, {
|
|
102
102
|
type: "string" | "number" | "boolean";
|
|
103
103
|
description: string;
|
|
@@ -105,8 +105,8 @@ export declare const ProbeDefinition: z.ZodObject<{
|
|
|
105
105
|
default?: unknown;
|
|
106
106
|
}> | undefined;
|
|
107
107
|
}, {
|
|
108
|
-
name: string;
|
|
109
108
|
description: string;
|
|
109
|
+
name: string;
|
|
110
110
|
capability: "observe" | "interact" | "manage";
|
|
111
111
|
params?: Record<string, {
|
|
112
112
|
type: "string" | "number" | "boolean";
|
|
@@ -160,6 +160,8 @@ export type DetectRules = z.infer<typeof DetectRules>;
|
|
|
160
160
|
export declare const PackManifest: z.ZodObject<{
|
|
161
161
|
/** Pack name, e.g. "docker" */
|
|
162
162
|
name: z.ZodString;
|
|
163
|
+
/** Pack type: 'agent' runs on target machines, 'integration' runs on the hub calling external APIs. Defaults to 'agent' if omitted. */
|
|
164
|
+
type: z.ZodOptional<z.ZodEnum<["agent", "integration"]>>;
|
|
163
165
|
/** Semver version */
|
|
164
166
|
version: z.ZodString;
|
|
165
167
|
/** Human-readable description */
|
|
@@ -232,10 +234,10 @@ export declare const PackManifest: z.ZodObject<{
|
|
|
232
234
|
/** Probe timeout in ms */
|
|
233
235
|
timeout: z.ZodDefault<z.ZodNumber>;
|
|
234
236
|
}, "strip", z.ZodTypeAny, {
|
|
235
|
-
timeout: number;
|
|
236
|
-
name: string;
|
|
237
237
|
description: string;
|
|
238
|
+
name: string;
|
|
238
239
|
capability: "observe" | "interact" | "manage";
|
|
240
|
+
timeout: number;
|
|
239
241
|
params?: Record<string, {
|
|
240
242
|
type: "string" | "number" | "boolean";
|
|
241
243
|
description: string;
|
|
@@ -243,8 +245,8 @@ export declare const PackManifest: z.ZodObject<{
|
|
|
243
245
|
default?: unknown;
|
|
244
246
|
}> | undefined;
|
|
245
247
|
}, {
|
|
246
|
-
name: string;
|
|
247
248
|
description: string;
|
|
249
|
+
name: string;
|
|
248
250
|
capability: "observe" | "interact" | "manage";
|
|
249
251
|
params?: Record<string, {
|
|
250
252
|
type: "string" | "number" | "boolean";
|
|
@@ -289,14 +291,13 @@ export declare const PackManifest: z.ZodObject<{
|
|
|
289
291
|
services?: string[] | undefined;
|
|
290
292
|
}>>;
|
|
291
293
|
}, "strip", z.ZodTypeAny, {
|
|
292
|
-
name: string;
|
|
293
|
-
version: string;
|
|
294
294
|
description: string;
|
|
295
|
+
name: string;
|
|
295
296
|
probes: {
|
|
296
|
-
timeout: number;
|
|
297
|
-
name: string;
|
|
298
297
|
description: string;
|
|
298
|
+
name: string;
|
|
299
299
|
capability: "observe" | "interact" | "manage";
|
|
300
|
+
timeout: number;
|
|
300
301
|
params?: Record<string, {
|
|
301
302
|
type: "string" | "number" | "boolean";
|
|
302
303
|
description: string;
|
|
@@ -304,6 +305,7 @@ export declare const PackManifest: z.ZodObject<{
|
|
|
304
305
|
default?: unknown;
|
|
305
306
|
}> | undefined;
|
|
306
307
|
}[];
|
|
308
|
+
version: string;
|
|
307
309
|
requires: {
|
|
308
310
|
groups: string[];
|
|
309
311
|
files: string[];
|
|
@@ -313,8 +315,9 @@ export declare const PackManifest: z.ZodObject<{
|
|
|
313
315
|
access: "read-only" | "read-write";
|
|
314
316
|
} | undefined;
|
|
315
317
|
};
|
|
316
|
-
|
|
318
|
+
type?: "agent" | "integration" | undefined;
|
|
317
319
|
author?: string | undefined;
|
|
320
|
+
signature?: string | undefined;
|
|
318
321
|
runbook?: {
|
|
319
322
|
category: string;
|
|
320
323
|
probes: string[];
|
|
@@ -326,12 +329,11 @@ export declare const PackManifest: z.ZodObject<{
|
|
|
326
329
|
services?: string[] | undefined;
|
|
327
330
|
} | undefined;
|
|
328
331
|
}, {
|
|
329
|
-
name: string;
|
|
330
|
-
version: string;
|
|
331
332
|
description: string;
|
|
333
|
+
name: string;
|
|
332
334
|
probes: {
|
|
333
|
-
name: string;
|
|
334
335
|
description: string;
|
|
336
|
+
name: string;
|
|
335
337
|
capability: "observe" | "interact" | "manage";
|
|
336
338
|
params?: Record<string, {
|
|
337
339
|
type: "string" | "number" | "boolean";
|
|
@@ -341,6 +343,7 @@ export declare const PackManifest: z.ZodObject<{
|
|
|
341
343
|
}> | undefined;
|
|
342
344
|
timeout?: number | undefined;
|
|
343
345
|
}[];
|
|
346
|
+
version: string;
|
|
344
347
|
requires: {
|
|
345
348
|
groups?: string[] | undefined;
|
|
346
349
|
files?: string[] | undefined;
|
|
@@ -350,8 +353,9 @@ export declare const PackManifest: z.ZodObject<{
|
|
|
350
353
|
access: "read-only" | "read-write";
|
|
351
354
|
} | undefined;
|
|
352
355
|
};
|
|
353
|
-
|
|
356
|
+
type?: "agent" | "integration" | undefined;
|
|
354
357
|
author?: string | undefined;
|
|
358
|
+
signature?: string | undefined;
|
|
355
359
|
runbook?: {
|
|
356
360
|
category: string;
|
|
357
361
|
probes: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packs.d.ts","sourceRoot":"","sources":["../../src/schemas/packs.ts"],"names":[],"mappings":"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C;AAElE,8DAA8D;AAC9D,eAAO,MAAM,WAAW;IACtB,4CAA4C;;IAE5C,iCAAiC;;IAEjC,4CAA4C;;;;;;;;;;EAE5C,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,YAAY;IACvB,+BAA+B;;IAE/B,uIAAuI;;IAEvI,qBAAqB;;IAErB,iCAAiC;;IAEjC,kBAAkB;;IAElB,8BAA8B;;IAE9B,iCAAiC;;QAjEjC,uBAAuB;;QAEvB,kCAAkC;;QAElC,uCAAuC;;QAEvC,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6DhC,gCAAgC;;QAtDhC,yCAAyC;;QAEzC,iCAAiC;;QAEjC,2CAA2C;;QAE3C,4BAA4B;;;;;;;;;;;;;;;;;QAE5B,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;IAgD1B,iCAAiC;;QAzCjC,kDAAkD;;QAElD,yCAAyC;;QAEzC,wCAAwC;;;;;;;;;;;IAuCxC,2DAA2D;;QAhC3D,4CAA4C;;QAE5C,iCAAiC;;QAEjC,4CAA4C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8B5C,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
package/dist/schemas/packs.js
CHANGED
|
@@ -61,6 +61,8 @@ export const DetectRules = z.object({
|
|
|
61
61
|
export const PackManifest = z.object({
|
|
62
62
|
/** Pack name, e.g. "docker" */
|
|
63
63
|
name: z.string(),
|
|
64
|
+
/** Pack type: 'agent' runs on target machines, 'integration' runs on the hub calling external APIs. Defaults to 'agent' if omitted. */
|
|
65
|
+
type: z.enum(['agent', 'integration']).optional(),
|
|
64
66
|
/** Semver version */
|
|
65
67
|
version: z.string().regex(/^\d+\.\d+\.\d+$/),
|
|
66
68
|
/** Human-readable description */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packs.js","sourceRoot":"","sources":["../../src/schemas/packs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE/E,uCAAuC;AACvC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC7C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACpC,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAGH,uCAAuC;AACvC,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IAC9C,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;CAC5C,CAAC,CAAC;AAGH,4CAA4C;AAC5C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,uBAAuB;IACvB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACvC,kCAAkC;IAClC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACtC,uCAAuC;IACv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ACvB,kBAAkB;IAClB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,8BAA8B;IAC9B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,iCAAiC;IACjC,QAAQ,EAAE,gBAAgB;IAC1B,gCAAgC;IAChC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC;IAChC,iCAAiC;IACjC,OAAO,EAAE,iBAAiB,CAAC,QAAQ,EAAE;IACrC,2DAA2D;IAC3D,MAAM,EAAE,WAAW,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC"}
|
package/dist/schemas/probes.d.ts
CHANGED
|
@@ -13,18 +13,22 @@ export declare const ProbeRequest: z.ZodObject<{
|
|
|
13
13
|
requestedBy: z.ZodString;
|
|
14
14
|
/** Set if this probe is part of a runbook execution */
|
|
15
15
|
runbookId: z.ZodOptional<z.ZodString>;
|
|
16
|
+
/** Correlation ID for concurrent probe support */
|
|
17
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
16
18
|
}, "strip", z.ZodTypeAny, {
|
|
17
19
|
timeout: number;
|
|
18
20
|
probe: string;
|
|
19
21
|
requestedBy: string;
|
|
20
22
|
params?: Record<string, unknown> | undefined;
|
|
21
23
|
runbookId?: string | undefined;
|
|
24
|
+
requestId?: string | undefined;
|
|
22
25
|
}, {
|
|
23
26
|
probe: string;
|
|
24
27
|
requestedBy: string;
|
|
25
28
|
params?: Record<string, unknown> | undefined;
|
|
26
29
|
timeout?: number | undefined;
|
|
27
30
|
runbookId?: string | undefined;
|
|
31
|
+
requestId?: string | undefined;
|
|
28
32
|
}>;
|
|
29
33
|
export type ProbeRequest = z.infer<typeof ProbeRequest>;
|
|
30
34
|
/**
|
|
@@ -56,6 +60,8 @@ export declare const ProbeResponse: z.ZodObject<{
|
|
|
56
60
|
packVersion: string;
|
|
57
61
|
capabilityLevel: "observe" | "interact" | "manage";
|
|
58
62
|
}>;
|
|
63
|
+
/** Correlation ID echoed from request for concurrent probe support */
|
|
64
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
59
65
|
}, "strip", z.ZodTypeAny, {
|
|
60
66
|
status: "error" | "success" | "timeout" | "unauthorized";
|
|
61
67
|
probe: string;
|
|
@@ -66,6 +72,7 @@ export declare const ProbeResponse: z.ZodObject<{
|
|
|
66
72
|
packVersion: string;
|
|
67
73
|
capabilityLevel: "observe" | "interact" | "manage";
|
|
68
74
|
};
|
|
75
|
+
requestId?: string | undefined;
|
|
69
76
|
data?: unknown;
|
|
70
77
|
}, {
|
|
71
78
|
status: "error" | "success" | "timeout" | "unauthorized";
|
|
@@ -77,6 +84,7 @@ export declare const ProbeResponse: z.ZodObject<{
|
|
|
77
84
|
packVersion: string;
|
|
78
85
|
capabilityLevel: "observe" | "interact" | "manage";
|
|
79
86
|
};
|
|
87
|
+
requestId?: string | undefined;
|
|
80
88
|
data?: unknown;
|
|
81
89
|
}>;
|
|
82
90
|
export type ProbeResponse = z.infer<typeof ProbeResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"probes.d.ts","sourceRoot":"","sources":["../../src/schemas/probes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,eAAO,MAAM,YAAY;IACvB,gEAAgE;;IAEhE,gCAAgC;;IAEhC,yCAAyC;;IAEzC,+DAA+D;;IAE/D,uDAAuD
|
|
1
|
+
{"version":3,"file":"probes.d.ts","sourceRoot":"","sources":["../../src/schemas/probes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;GAEG;AACH,eAAO,MAAM,YAAY;IACvB,gEAAgE;;IAEhE,gCAAgC;;IAEhC,yCAAyC;;IAEzC,+DAA+D;;IAE/D,uDAAuD;;IAEvD,kDAAkD;;;;;;;;;;;;;;;;EAElD,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,aAAa;IACxB,gCAAgC;;IAEhC,oBAAoB;;IAEpB,oDAAoD;;IAEpD,oCAAoC;;IAEpC,4DAA4D;;;;;;;;;;;;;;;;;IAO5D,sEAAsE;;;;;;;;;;;;;;;;;;;;;;;;;;EAEtE,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
package/dist/schemas/probes.js
CHANGED
|
@@ -14,6 +14,8 @@ export const ProbeRequest = z.object({
|
|
|
14
14
|
requestedBy: z.string(),
|
|
15
15
|
/** Set if this probe is part of a runbook execution */
|
|
16
16
|
runbookId: z.string().optional(),
|
|
17
|
+
/** Correlation ID for concurrent probe support */
|
|
18
|
+
requestId: z.string().optional(),
|
|
17
19
|
});
|
|
18
20
|
/**
|
|
19
21
|
* Probe response (Agent → Hub).
|
|
@@ -34,5 +36,7 @@ export const ProbeResponse = z.object({
|
|
|
34
36
|
packVersion: z.string(),
|
|
35
37
|
capabilityLevel: CapabilityLevel,
|
|
36
38
|
}),
|
|
39
|
+
/** Correlation ID echoed from request for concurrent probe support */
|
|
40
|
+
requestId: z.string().optional(),
|
|
37
41
|
});
|
|
38
42
|
//# sourceMappingURL=probes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"probes.js","sourceRoot":"","sources":["../../src/schemas/probes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE5F;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,gEAAgE;IAChE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,gCAAgC;IAChC,MAAM,EAAE,C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AC,CAAC,QAAQ,EAAE;IACxC,yCAAyC;IACzC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,wBAAwB,CAAC;IACrD,+DAA+D;IAC/D,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,uDAAuD;IACvD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,kDAAkD;IAClD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC;AAGH;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,gCAAgC;IAChC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,oBAAoB;IACpB,MAAM,EAAE,WAAW;IACnB,oDAAoD;IACpD,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE;IACjB,oCAAoC;IACpC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,4DAA4D;IAC5D,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC;QACjB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;QACxB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;QACpB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;QACvB,eAAe,EAAE,eAAe;KACjC,CAAC;IACF,sEAAsE;IACtE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACjC,CAAC,CAAC"}
|
|
@@ -7,7 +7,7 @@ export declare const MessageEnvelope: z.ZodObject<{
|
|
|
7
7
|
/** Unique message ID */
|
|
8
8
|
id: z.ZodString;
|
|
9
9
|
/** Message type discriminator */
|
|
10
|
-
type: z.ZodEnum<["probe.request", "probe.response", "probe.error", "agent.register", "agent.heartbeat", "hub.ack", "hub.reject"]>;
|
|
10
|
+
type: z.ZodEnum<["probe.request", "probe.response", "probe.error", "agent.register", "agent.heartbeat", "hub.ack", "hub.reject", "hub.update_available"]>;
|
|
11
11
|
/** ISO 8601 timestamp */
|
|
12
12
|
timestamp: z.ZodString;
|
|
13
13
|
/** Set after registration */
|
|
@@ -17,19 +17,66 @@ export declare const MessageEnvelope: z.ZodObject<{
|
|
|
17
17
|
/** Type-specific payload (validated per type) */
|
|
18
18
|
payload: z.ZodUnknown;
|
|
19
19
|
}, "strip", z.ZodTypeAny, {
|
|
20
|
-
type: "probe.request" | "probe.response" | "probe.error" | "agent.register" | "agent.heartbeat" | "hub.ack" | "hub.reject";
|
|
21
20
|
id: string;
|
|
21
|
+
type: "probe.request" | "probe.response" | "probe.error" | "agent.register" | "agent.heartbeat" | "hub.ack" | "hub.reject" | "hub.update_available";
|
|
22
22
|
timestamp: string;
|
|
23
23
|
signature: string;
|
|
24
24
|
agentId?: string | undefined;
|
|
25
25
|
payload?: unknown;
|
|
26
26
|
}, {
|
|
27
|
-
type: "probe.request" | "probe.response" | "probe.error" | "agent.register" | "agent.heartbeat" | "hub.ack" | "hub.reject";
|
|
28
27
|
id: string;
|
|
28
|
+
type: "probe.request" | "probe.response" | "probe.error" | "agent.register" | "agent.heartbeat" | "hub.ack" | "hub.reject" | "hub.update_available";
|
|
29
29
|
timestamp: string;
|
|
30
30
|
signature: string;
|
|
31
31
|
agentId?: string | undefined;
|
|
32
32
|
payload?: unknown;
|
|
33
33
|
}>;
|
|
34
34
|
export type MessageEnvelope = z.infer<typeof MessageEnvelope>;
|
|
35
|
+
/**
|
|
36
|
+
* Payload schema for agent.register messages.
|
|
37
|
+
* Validates registration data before processing.
|
|
38
|
+
*/
|
|
39
|
+
export declare const RegisterPayload: z.ZodObject<{
|
|
40
|
+
name: z.ZodString;
|
|
41
|
+
os: z.ZodString;
|
|
42
|
+
agentVersion: z.ZodString;
|
|
43
|
+
packs: z.ZodArray<z.ZodObject<{
|
|
44
|
+
name: z.ZodString;
|
|
45
|
+
version: z.ZodString;
|
|
46
|
+
status: z.ZodString;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
status: string;
|
|
49
|
+
name: string;
|
|
50
|
+
version: string;
|
|
51
|
+
}, {
|
|
52
|
+
status: string;
|
|
53
|
+
name: string;
|
|
54
|
+
version: string;
|
|
55
|
+
}>, "many">;
|
|
56
|
+
enrollmentToken: z.ZodOptional<z.ZodString>;
|
|
57
|
+
attestation: z.ZodOptional<z.ZodUnknown>;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
name: string;
|
|
60
|
+
os: string;
|
|
61
|
+
agentVersion: string;
|
|
62
|
+
packs: {
|
|
63
|
+
status: string;
|
|
64
|
+
name: string;
|
|
65
|
+
version: string;
|
|
66
|
+
}[];
|
|
67
|
+
enrollmentToken?: string | undefined;
|
|
68
|
+
attestation?: unknown;
|
|
69
|
+
}, {
|
|
70
|
+
name: string;
|
|
71
|
+
os: string;
|
|
72
|
+
agentVersion: string;
|
|
73
|
+
packs: {
|
|
74
|
+
status: string;
|
|
75
|
+
name: string;
|
|
76
|
+
version: string;
|
|
77
|
+
}[];
|
|
78
|
+
enrollmentToken?: string | undefined;
|
|
79
|
+
attestation?: unknown;
|
|
80
|
+
}>;
|
|
81
|
+
export type RegisterPayload = z.infer<typeof RegisterPayload>;
|
|
35
82
|
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/schemas/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;GAGG;AACH,eAAO,MAAM,eAAe;IAC1B,wBAAwB;;IAExB,iCAAiC;;IAEjC,yBAAyB;;IAEzB,6BAA6B;;IAE7B,iCAAiC;;IAEjC,iDAAiD;;;;;;;;;;;;;;;;EAEjD,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/schemas/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;GAGG;AACH,eAAO,MAAM,eAAe;IAC1B,wBAAwB;;IAExB,iCAAiC;;IAEjC,yBAAyB;;IAEzB,6BAA6B;;IAE7B,iCAAiC;;IAEjC,iDAAiD;;;;;;;;;;;;;;;;EAEjD,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
package/dist/schemas/protocol.js
CHANGED
|
@@ -18,4 +18,20 @@ export const MessageEnvelope = z.object({
|
|
|
18
18
|
/** Type-specific payload (validated per type) */
|
|
19
19
|
payload: z.unknown(),
|
|
20
20
|
});
|
|
21
|
+
/**
|
|
22
|
+
* Payload schema for agent.register messages.
|
|
23
|
+
* Validates registration data before processing.
|
|
24
|
+
*/
|
|
25
|
+
export const RegisterPayload = z.object({
|
|
26
|
+
name: z.string().min(1).max(255),
|
|
27
|
+
os: z.string().min(1).max(255),
|
|
28
|
+
agentVersion: z.string().min(1).max(64),
|
|
29
|
+
packs: z.array(z.object({
|
|
30
|
+
name: z.string().min(1),
|
|
31
|
+
version: z.string().min(1),
|
|
32
|
+
status: z.string().min(1),
|
|
33
|
+
})),
|
|
34
|
+
enrollmentToken: z.string().optional(),
|
|
35
|
+
attestation: z.unknown().optional(),
|
|
36
|
+
});
|
|
21
37
|
//# sourceMappingURL=protocol.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/schemas/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAA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C,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAChC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAC9B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IACvC,KAAK,EAAE,CAAC,CAAC,KAAK,CACZ,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACvB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC1B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KAC1B,CAAC,CACH;IACD,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACtC,WAAW,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC,CAAC"}
|
package/dist/types/common.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const PackStatus: z.ZodEnum<["active", "pending", "error"]>;
|
|
|
7
7
|
export type PackStatus = z.infer<typeof PackStatus>;
|
|
8
8
|
export declare const ProbeStatus: z.ZodEnum<["success", "error", "timeout", "unauthorized"]>;
|
|
9
9
|
export type ProbeStatus = z.infer<typeof ProbeStatus>;
|
|
10
|
-
export declare const MessageType: z.ZodEnum<["probe.request", "probe.response", "probe.error", "agent.register", "agent.heartbeat", "hub.ack", "hub.reject"]>;
|
|
10
|
+
export declare const MessageType: z.ZodEnum<["probe.request", "probe.response", "probe.error", "agent.register", "agent.heartbeat", "hub.ack", "hub.reject", "hub.update_available"]>;
|
|
11
11
|
export type MessageType = z.infer<typeof MessageType>;
|
|
12
12
|
/** Default probe timeout in milliseconds */
|
|
13
13
|
export declare const DEFAULT_PROBE_TIMEOUT_MS = 30000;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe,8CAA4C,CAAC;AACzE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,eAAO,MAAM,WAAW,8CAA4C,CAAC;AACrE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,eAAO,MAAM,UAAU,2CAAyC,CAAC;AACjE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,eAAO,MAAM,WAAW,4DAA0D,CAAC;AACnF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe,8CAA4C,CAAC;AACzE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,eAAO,MAAM,WAAW,8CAA4C,CAAC;AACrE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,eAAO,MAAM,UAAU,2CAAyC,CAAC;AACjE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAEpD,eAAO,MAAM,WAAW,4DAA0D,CAAC;AACnF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,eAAO,MAAM,WAAW,qJAStB,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AAEtD,4CAA4C;AAC5C,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAE/C,uBAAuB;AACvB,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC,+CAA+C;AAC/C,eAAO,MAAM,qBAAqB,QAAS,CAAC"}
|
package/dist/types/common.js
CHANGED
package/dist/types/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAGzE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAGrE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;AAGjE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;AAGnF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC;IAChC,eAAe;IACf,gBAAgB;IAChB,aAAa;IACb,gBAAgB;IAChB,iBAAiB;IACjB,SAAS;IACT,YAAY;
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/types/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AAGzE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;AAGrE,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;AAGjE,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAC;AAGnF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC;IAChC,eAAe;IACf,gBAAgB;IAChB,aAAa;IACb,gBAAgB;IAChB,iBAAiB;IACjB,SAAS;IACT,YAAY;IACZ,sBAAsB;CACvB,CAAC,CAAC;AAGH,4CAA4C;AAC5C,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC;AAE/C,uBAAuB;AACvB,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAErC,+CAA+C;AAC/C,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { PackManifest } from '../schemas/packs.js';
|
|
2
|
+
/** Injectable fetch function for testing */
|
|
3
|
+
export type FetchFn = typeof globalThis.fetch;
|
|
4
|
+
/** Supported authentication methods for integration packs */
|
|
5
|
+
export type AuthMethod = 'api_key' | 'bearer_token' | 'oauth2';
|
|
6
|
+
/** OAuth2-specific credential fields */
|
|
7
|
+
export interface OAuth2Credentials {
|
|
8
|
+
accessToken: string;
|
|
9
|
+
refreshToken?: string;
|
|
10
|
+
expiresAt?: number;
|
|
11
|
+
tokenUrl?: string;
|
|
12
|
+
}
|
|
13
|
+
/** Credentials for authenticating with an external API */
|
|
14
|
+
export interface IntegrationCredentials {
|
|
15
|
+
packName: string;
|
|
16
|
+
authMethod: AuthMethod;
|
|
17
|
+
credentials: Record<string, string>;
|
|
18
|
+
oauth2?: OAuth2Credentials;
|
|
19
|
+
}
|
|
20
|
+
/** Configuration for an integration pack's external API */
|
|
21
|
+
export interface IntegrationConfig {
|
|
22
|
+
/** Base URL for the external API */
|
|
23
|
+
endpoint: string;
|
|
24
|
+
/** Additional headers to include in requests */
|
|
25
|
+
headers?: Record<string, string>;
|
|
26
|
+
}
|
|
27
|
+
/** Handler function for a single integration probe */
|
|
28
|
+
export type IntegrationProbeHandler = (params: Record<string, unknown> | undefined, config: IntegrationConfig, credentials: IntegrationCredentials, fetchFn: FetchFn) => Promise<unknown>;
|
|
29
|
+
/** An integration pack definition */
|
|
30
|
+
export interface IntegrationPack {
|
|
31
|
+
manifest: PackManifest;
|
|
32
|
+
handlers: Record<string, IntegrationProbeHandler>;
|
|
33
|
+
/** Test connectivity with the external API */
|
|
34
|
+
testConnection: (config: IntegrationConfig, credentials: IntegrationCredentials, fetchFn: FetchFn) => Promise<boolean>;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=integrations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../src/types/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,4CAA4C;AAC5C,MAAM,MAAM,OAAO,GAAG,OAAO,UAAU,CAAC,KAAK,CAAC;AAE9C,6DAA6D;AAC7D,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,cAAc,GAAG,QAAQ,CAAC;AAE/D,wCAAwC;AACxC,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,0DAA0D;AAC1D,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B;AAED,2DAA2D;AAC3D,MAAM,WAAW,iBAAiB;IAChC,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,sDAAsD;AACtD,MAAM,MAAM,uBAAuB,GAAG,CACpC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC3C,MAAM,EAAE,iBAAiB,EACzB,WAAW,EAAE,sBAAsB,EACnC,OAAO,EAAE,OAAO,KACb,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB,qCAAqC;AACrC,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;IAClD,8CAA8C;IAC9C,cAAc,EAAE,CACd,MAAM,EAAE,iBAAiB,EACzB,WAAW,EAAE,sBAAsB,EACnC,OAAO,EAAE,OAAO,KACb,OAAO,CAAC,OAAO,CAAC,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../src/types/integrations.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import crypto from 'node:crypto';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
import { signPackManifest, verifyPackManifest } from './pack-signing.js';
|
|
4
|
+
|
|
5
|
+
function generateTestKeypair() {
|
|
6
|
+
const { publicKey, privateKey } = crypto.generateKeyPairSync('rsa', {
|
|
7
|
+
modulusLength: 2048,
|
|
8
|
+
publicKeyEncoding: { type: 'spki', format: 'pem' },
|
|
9
|
+
privateKeyEncoding: { type: 'pkcs8', format: 'pem' },
|
|
10
|
+
});
|
|
11
|
+
return { publicKey: publicKey as string, privateKey: privateKey as string };
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const testManifest = {
|
|
15
|
+
name: 'system',
|
|
16
|
+
version: '0.1.0',
|
|
17
|
+
description: 'System monitoring probes',
|
|
18
|
+
requires: { groups: [], files: [], commands: [] },
|
|
19
|
+
probes: [
|
|
20
|
+
{
|
|
21
|
+
name: 'disk.usage',
|
|
22
|
+
description: 'Disk usage',
|
|
23
|
+
capability: 'observe',
|
|
24
|
+
timeout: 30000,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
describe('pack-signing', () => {
|
|
30
|
+
const { publicKey, privateKey } = generateTestKeypair();
|
|
31
|
+
|
|
32
|
+
it('should sign and verify a pack manifest', () => {
|
|
33
|
+
const sig = signPackManifest(testManifest, privateKey);
|
|
34
|
+
expect(sig).toBeTruthy();
|
|
35
|
+
expect(typeof sig).toBe('string');
|
|
36
|
+
|
|
37
|
+
const signedManifest = { ...testManifest, signature: sig };
|
|
38
|
+
const valid = verifyPackManifest(signedManifest, publicKey);
|
|
39
|
+
expect(valid).toBe(true);
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('should reject a tampered manifest', () => {
|
|
43
|
+
const sig = signPackManifest(testManifest, privateKey);
|
|
44
|
+
const tampered = { ...testManifest, signature: sig, version: '9.9.9' };
|
|
45
|
+
|
|
46
|
+
const valid = verifyPackManifest(tampered, publicKey);
|
|
47
|
+
expect(valid).toBe(false);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('should return false for missing signature', () => {
|
|
51
|
+
const valid = verifyPackManifest(testManifest, publicKey);
|
|
52
|
+
expect(valid).toBe(false);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('should return false when no public key is available', () => {
|
|
56
|
+
const sig = signPackManifest(testManifest, privateKey);
|
|
57
|
+
const signedManifest = { ...testManifest, signature: sig };
|
|
58
|
+
|
|
59
|
+
// No public key passed and PACK_SIGNING_PUBLIC_KEY is empty
|
|
60
|
+
const valid = verifyPackManifest(signedManifest);
|
|
61
|
+
expect(valid).toBe(false);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('should ignore existing signature field when signing', () => {
|
|
65
|
+
const manifestWithSig = { ...testManifest, signature: 'old-sig' };
|
|
66
|
+
const sig = signPackManifest(manifestWithSig, privateKey);
|
|
67
|
+
|
|
68
|
+
// Should produce same signature as manifest without signature field
|
|
69
|
+
const sigClean = signPackManifest(testManifest, privateKey);
|
|
70
|
+
expect(sig).toBe(sigClean);
|
|
71
|
+
});
|
|
72
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { signPayload, verifyPayload } from './signing.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Public key for verifying pack manifest signatures.
|
|
5
|
+
* Populated after running `scripts/generate-pack-keypair.ts`.
|
|
6
|
+
* When empty, verification is skipped (unsigned packs allowed).
|
|
7
|
+
*/
|
|
8
|
+
export const PACK_SIGNING_PUBLIC_KEY = '';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Sign a pack manifest. Strips the `signature` field before signing.
|
|
12
|
+
* Returns a base64-encoded RSA-SHA256 signature.
|
|
13
|
+
*/
|
|
14
|
+
export function signPackManifest(manifest: Record<string, unknown>, privateKeyPem: string): string {
|
|
15
|
+
const { signature: _, ...rest } = manifest;
|
|
16
|
+
return signPayload(rest, privateKeyPem);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Verify a pack manifest signature. Strips the `signature` field before verifying.
|
|
21
|
+
* Uses the embedded public key by default, or a provided one.
|
|
22
|
+
* Returns false if signature is missing or verification fails.
|
|
23
|
+
*/
|
|
24
|
+
export function verifyPackManifest(
|
|
25
|
+
manifest: Record<string, unknown>,
|
|
26
|
+
publicKeyPem?: string,
|
|
27
|
+
): boolean {
|
|
28
|
+
const key = publicKeyPem ?? PACK_SIGNING_PUBLIC_KEY;
|
|
29
|
+
if (!key) return false;
|
|
30
|
+
|
|
31
|
+
const sig = manifest.signature;
|
|
32
|
+
if (!sig || typeof sig !== 'string') return false;
|
|
33
|
+
|
|
34
|
+
const { signature: _, ...rest } = manifest;
|
|
35
|
+
return verifyPayload(rest, sig, key);
|
|
36
|
+
}
|