@frontmcp/adapters 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/index.mjs +396 -385
- package/esm/openapi/index.mjs +396 -385
- package/esm/package.json +18 -6
- package/esm/skills/index.mjs +2117 -0
- package/index.js +407 -389
- package/openapi/index.d.ts +11 -1
- package/openapi/index.d.ts.map +1 -1
- package/openapi/index.js +407 -389
- package/openapi/openapi.adapter.d.ts +2 -2
- package/openapi/openapi.adapter.d.ts.map +1 -1
- package/openapi/openapi.tool.d.ts.map +1 -1
- package/openapi/openapi.types.d.ts +3 -3
- package/openapi/openapi.types.d.ts.map +1 -1
- package/openapi/openapi.utils.d.ts.map +1 -1
- package/package.json +18 -6
- package/skills/audit/audit-chain.d.ts +81 -0
- package/skills/audit/audit-chain.d.ts.map +1 -0
- package/skills/audit/audit-config.d.ts +87 -0
- package/skills/audit/audit-config.d.ts.map +1 -0
- package/skills/audit/audit-record.types.d.ts +114 -0
- package/skills/audit/audit-record.types.d.ts.map +1 -0
- package/skills/audit/audit-signer.d.ts +72 -0
- package/skills/audit/audit-signer.d.ts.map +1 -0
- package/skills/audit/audit-store.d.ts +84 -0
- package/skills/audit/audit-store.d.ts.map +1 -0
- package/skills/audit/audit-writer.d.ts +175 -0
- package/skills/audit/audit-writer.d.ts.map +1 -0
- package/skills/audit/index.d.ts +7 -0
- package/skills/audit/index.d.ts.map +1 -0
- package/skills/bundle/bundle-diff.d.ts +30 -0
- package/skills/bundle/bundle-diff.d.ts.map +1 -0
- package/skills/bundle/bundle.schema.d.ts +101 -0
- package/skills/bundle/bundle.schema.d.ts.map +1 -0
- package/skills/bundle/bundle.store.d.ts +143 -0
- package/skills/bundle/bundle.store.d.ts.map +1 -0
- package/skills/bundle/bundle.types.d.ts +143 -0
- package/skills/bundle/bundle.types.d.ts.map +1 -0
- package/skills/bundle/overlay-parser.d.ts +42 -0
- package/skills/bundle/overlay-parser.d.ts.map +1 -0
- package/skills/dependency/skill-dag.d.ts +39 -0
- package/skills/dependency/skill-dag.d.ts.map +1 -0
- package/skills/index.d.ts +17 -0
- package/skills/index.d.ts.map +1 -0
- package/skills/index.js +2192 -0
- package/skills/security/bundle-signature.d.ts +44 -0
- package/skills/security/bundle-signature.d.ts.map +1 -0
- package/skills/security/jwt-verifier.d.ts +38 -0
- package/skills/security/jwt-verifier.d.ts.map +1 -0
- package/skills/security/webhook-replay-guard.d.ts +52 -0
- package/skills/security/webhook-replay-guard.d.ts.map +1 -0
- package/skills/source-options.d.ts +55 -0
- package/skills/source-options.d.ts.map +1 -0
- package/skills/sources/filesystem-skills.source.d.ts +127 -0
- package/skills/sources/filesystem-skills.source.d.ts.map +1 -0
- package/skills/sources/index.d.ts +10 -0
- package/skills/sources/index.d.ts.map +1 -0
- package/skills/sources/npm.source.d.ts +30 -0
- package/skills/sources/npm.source.d.ts.map +1 -0
- package/skills/sources/saas-pull.source.d.ts +47 -0
- package/skills/sources/saas-pull.source.d.ts.map +1 -0
- package/skills/sources/skill-bundle-source.interface.d.ts +36 -0
- package/skills/sources/skill-bundle-source.interface.d.ts.map +1 -0
- package/skills/sources/static.source.d.ts +30 -0
- package/skills/sources/static.source.d.ts.map +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DynamicAdapter, FrontMcpAdapterResponse, FrontMcpLogger } from '@frontmcp/sdk';
|
|
2
|
-
import { OpenApiAdapterOptions } from './openapi.types';
|
|
1
|
+
import { DynamicAdapter, type FrontMcpAdapterResponse, type FrontMcpLogger } from '@frontmcp/sdk';
|
|
2
|
+
import { type OpenApiAdapterOptions } from './openapi.types';
|
|
3
3
|
export default class OpenapiAdapter extends DynamicAdapter<OpenApiAdapterOptions> {
|
|
4
4
|
private generator?;
|
|
5
5
|
private logger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openapi.adapter.d.ts","sourceRoot":"","sources":["../../src/openapi/openapi.adapter.ts"],"names":[],"mappings":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;IACH,OAAO,CAAC,2CAA2C;IAyCnD;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAuB7B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAiB3B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,uBAAuB,KAAK,IAAI,GAAG,MAAM,IAAI;IAO3E;;;;OAIG;IACH,YAAY,IAAI,IAAI;IAsCpB;;OAEG;IACH,WAAW,IAAI,IAAI;CAOpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openapi.tool.d.ts","sourceRoot":"","sources":["../../src/openapi/openapi.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"openapi.tool.d.ts","sourceRoot":"","sources":["../../src/openapi/openapi.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAI1D,OAAO,KAAK,EAIV,qBAAqB,EAEtB,MAAM,iBAAiB,CAAC;AAMzB;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,cAAc,EAAE,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAE,cAAc,cA+QpH"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import type { FrontMcpLogger, ToolAnnotations, ToolExample, ToolUIConfig
|
|
1
|
+
import type { GenerateOptions, LoadOptions, McpOpenAPITool, SecurityContext, ToolMetadata } from 'mcp-from-openapi';
|
|
2
|
+
import { type OpenAPIV3, type OpenAPIV3_1 } from 'openapi-types';
|
|
3
|
+
import type { FrontMcpContext, FrontMcpLogger, ToolAnnotations, ToolExample, ToolUIConfig } from '@frontmcp/sdk';
|
|
4
4
|
import type { SpecPollerOptions } from './openapi-spec-poller.types';
|
|
5
5
|
/**
|
|
6
6
|
* Context available when injecting values at request time
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openapi.types.d.ts","sourceRoot":"","sources":["../../src/openapi/openapi.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"openapi.types.d.ts","sourceRoot":"","sources":["../../src/openapi/openapi.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACpH,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjE,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEjH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAMrE;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,uEAAuE;IACvE,GAAG,EAAE,eAAe,CAAC;IACrB,4BAA4B;IAC5B,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IACvB,sCAAsC;IACtC,IAAI,EAAE,cAAc,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,MAAM,EAAE,CAAC,GAAG,EAAE,qBAAqB,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACpE;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAE1B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC;IAE3C;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,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W,SAAQ,WAAW;IACtC;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openapi.utils.d.ts","sourceRoot":"","sources":["../../src/openapi/openapi.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"openapi.utils.d.ts","sourceRoot":"","sources":["../../src/openapi/openapi.utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAKzE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAgDD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,EAC1D,OAAO,EAAE,MAAM,GACd,aAAa,CA8Gf;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAMzG;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,qDAAqD;IACrD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAKD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,uBAAuB;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,EAAE,EAAE,OAAO,CAAC;IACZ,0CAA0C;IAC1C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC,CAgEhH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontmcp/adapters",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Adapters for the FrontMCP framework",
|
|
5
5
|
"author": "AgentFront <info@agentfront.dev>",
|
|
6
6
|
"homepage": "https://docs.agentfront.dev",
|
|
@@ -48,19 +48,31 @@
|
|
|
48
48
|
"default": "./esm/openapi/index.mjs"
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
|
+
"./skills": {
|
|
52
|
+
"require": {
|
|
53
|
+
"types": "./skills/index.d.ts",
|
|
54
|
+
"default": "./skills/index.js"
|
|
55
|
+
},
|
|
56
|
+
"import": {
|
|
57
|
+
"types": "./skills/index.d.ts",
|
|
58
|
+
"default": "./esm/skills/index.mjs"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
51
61
|
"./esm": null
|
|
52
62
|
},
|
|
53
63
|
"engines": {
|
|
54
64
|
"node": ">=24.0.0"
|
|
55
65
|
},
|
|
56
66
|
"dependencies": {
|
|
57
|
-
"@frontmcp/
|
|
58
|
-
"@frontmcp/
|
|
67
|
+
"@frontmcp/auth": "1.2.0",
|
|
68
|
+
"@frontmcp/di": "1.2.0",
|
|
69
|
+
"@frontmcp/utils": "1.2.0",
|
|
70
|
+
"@frontmcp/sdk": "1.2.0",
|
|
71
|
+
"js-yaml": "^4.1.0",
|
|
59
72
|
"openapi-types": "^12.1.3",
|
|
60
|
-
"mcp-from-openapi": "2.3.0"
|
|
61
|
-
"zod-from-json-schema": "^0.5.2"
|
|
73
|
+
"mcp-from-openapi": "2.3.0"
|
|
62
74
|
},
|
|
63
75
|
"peerDependencies": {
|
|
64
|
-
"@frontmcp/lazy-zod": "1.
|
|
76
|
+
"@frontmcp/lazy-zod": "1.2.0"
|
|
65
77
|
}
|
|
66
78
|
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { type SkillAuditPhase, type SkillAuditRecord, type SkillAuditSignatureAlg } from './audit-record.types';
|
|
2
|
+
/**
|
|
3
|
+
* Trusted signing key used by the verifier. Holds either an HMAC secret
|
|
4
|
+
* (HS256) or an RSA/Ed25519 public JWK (RS256/EdDSA). Verifier callers
|
|
5
|
+
* provide the full set; per-record `signatureKeyId` selects which key to
|
|
6
|
+
* use, so a key rotation that changes only the active signer doesn't
|
|
7
|
+
* invalidate older records signed by an older key.
|
|
8
|
+
*/
|
|
9
|
+
export interface AuditTrustedKey {
|
|
10
|
+
keyId: string;
|
|
11
|
+
alg: SkillAuditSignatureAlg;
|
|
12
|
+
/** HMAC secret bytes (HS256) — required when alg is HS256. */
|
|
13
|
+
secret?: Uint8Array;
|
|
14
|
+
/** Public JWK (RS256 / EdDSA) — required when alg is RS256 or EdDSA. */
|
|
15
|
+
publicJwk?: JsonWebKey;
|
|
16
|
+
/** Public PEM (RS256 / EdDSA) — alternative to JWK; used when JWK is unavailable. */
|
|
17
|
+
publicKeyPem?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Result of {@link verifyChain}. On success, the chain is fully linked and
|
|
21
|
+
* every signature checks out. On failure, `breakAt` is the sequence number
|
|
22
|
+
* (or array index when records lack sequences) of the first record that
|
|
23
|
+
* fails — useful for narrowing down which write was tampered with.
|
|
24
|
+
*/
|
|
25
|
+
export type AuditChainVerifyResult = {
|
|
26
|
+
ok: true;
|
|
27
|
+
verified: number;
|
|
28
|
+
} | {
|
|
29
|
+
ok: false;
|
|
30
|
+
breakAt: number;
|
|
31
|
+
reason: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Synchronous signature verifier. The audit signer interface is sync (so the
|
|
35
|
+
* writer can run without an extra await per record); the verifier matches.
|
|
36
|
+
*
|
|
37
|
+
* Implementations live in `audit-signer.ts` (HS256 + RS256/EdDSA via Node's
|
|
38
|
+
* `crypto.verify`). Tests can pass a stub.
|
|
39
|
+
*/
|
|
40
|
+
export type AuditSignatureVerifier = (input: {
|
|
41
|
+
alg: SkillAuditSignatureAlg;
|
|
42
|
+
keyId: string;
|
|
43
|
+
data: Uint8Array;
|
|
44
|
+
signatureBase64Url: string;
|
|
45
|
+
trustedKeys: AuditTrustedKey[];
|
|
46
|
+
}) => boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Strip the `signature` field from a record and return the JCS-canonicalized
|
|
49
|
+
* bytes that are signed (and hashed for prevHash). Exported so the writer can
|
|
50
|
+
* reuse it when computing the prevHash for the next record.
|
|
51
|
+
*/
|
|
52
|
+
export declare function canonicalizeRecordForSigning(record: SkillAuditRecord): string;
|
|
53
|
+
/**
|
|
54
|
+
* Compute the prevHash that the next record after `prev` should carry. When
|
|
55
|
+
* `prev` is undefined (genesis), returns the all-zeros sentinel.
|
|
56
|
+
*/
|
|
57
|
+
export declare function nextPrevHash(prev: SkillAuditRecord | undefined): string;
|
|
58
|
+
/**
|
|
59
|
+
* Fields the writer fills in. Everything else (prevHash, signature*) is
|
|
60
|
+
* derived inside the writer pipeline.
|
|
61
|
+
*/
|
|
62
|
+
export type SkillAuditPartialRecord = Omit<SkillAuditRecord, 'prevHash' | 'signature' | 'signatureKeyId' | 'signatureAlg'>;
|
|
63
|
+
/**
|
|
64
|
+
* Link a partial record to a chain by stamping its prevHash from `prev`.
|
|
65
|
+
* The signature/signatureKeyId/signatureAlg are NOT filled here — that's
|
|
66
|
+
* the signer's job, called separately so that a missing signer surfaces as
|
|
67
|
+
* a runtime configuration error rather than a silently-unsigned record.
|
|
68
|
+
*/
|
|
69
|
+
export declare function linkRecord(prev: SkillAuditRecord | undefined, partial: SkillAuditPartialRecord): Omit<SkillAuditRecord, 'signature' | 'signatureKeyId' | 'signatureAlg'>;
|
|
70
|
+
/**
|
|
71
|
+
* Walk the chain in order, recomputing each prevHash and verifying each
|
|
72
|
+
* signature. Returns the first break or `{ ok: true }` on a clean run.
|
|
73
|
+
*
|
|
74
|
+
* The verifier is permissive about empty input (vacuously OK) and strict
|
|
75
|
+
* about ordering — records must already be sorted by `sequence` ascending.
|
|
76
|
+
* Production stores sort on read; tests should pass already-sorted arrays.
|
|
77
|
+
*/
|
|
78
|
+
export declare function verifyChain(records: ReadonlyArray<SkillAuditRecord>, trustedKeys: ReadonlyArray<AuditTrustedKey>, verifier: AuditSignatureVerifier): AuditChainVerifyResult;
|
|
79
|
+
/** Re-exports for ergonomic external import. */
|
|
80
|
+
export type { SkillAuditPhase, SkillAuditRecord };
|
|
81
|
+
//# sourceMappingURL=audit-chain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-chain.d.ts","sourceRoot":"","sources":["../../../src/skills/audit/audit-chain.ts"],"names":[],"mappings":"AAcA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC5B,MAAM,sBAAsB,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,sBAAsB,CAAC;IAC5B,8DAA8D;IAC9D,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,wEAAwE;IACxE,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,qFAAqF;IACrF,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAErH;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,KAAK,EAAE;IAC3C,GAAG,EAAE,sBAAsB,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,CAAC;IACjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,eAAe,EAAE,CAAC;CAChC,KAAK,OAAO,CAAC;AAEd;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAI7E;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,SAAS,GAAG,MAAM,CAGvE;AAED;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,gBAAgB,EAChB,UAAU,GAAG,WAAW,GAAG,gBAAgB,GAAG,cAAc,CAC7D,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,gBAAgB,GAAG,SAAS,EAClC,OAAO,EAAE,uBAAuB,GAC/B,IAAI,CAAC,gBAAgB,EAAE,WAAW,GAAG,gBAAgB,GAAG,cAAc,CAAC,CAKzE;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,aAAa,CAAC,gBAAgB,CAAC,EACxC,WAAW,EAAE,aAAa,CAAC,eAAe,CAAC,EAC3C,QAAQ,EAAE,sBAAsB,GAC/B,sBAAsB,CAoDxB;AAED,gDAAgD;AAChD,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { Token } from '@frontmcp/di';
|
|
2
|
+
import type { SkillAuditSigner } from './audit-signer';
|
|
3
|
+
import type { SkillAuditStore } from './audit-store';
|
|
4
|
+
import type { SkillAuditWriter } from './audit-writer';
|
|
5
|
+
/**
|
|
6
|
+
* How `subject` (typically a JWT `sub`) is persisted in the audit record.
|
|
7
|
+
*
|
|
8
|
+
* - `'plain'` (legacy default): the raw subject is written verbatim — useful
|
|
9
|
+
* for forensic correlation, but the record then contains PII that GDPR
|
|
10
|
+
* right-to-be-forgotten cannot delete without breaking the prevHash chain.
|
|
11
|
+
* - `'hash'` (recommended default in v1.2+): the subject is replaced with a
|
|
12
|
+
* keyed HMAC-SHA256 of the value (keyed by the audit secret material). The
|
|
13
|
+
* hash is deterministic per-secret so records for the same user can still
|
|
14
|
+
* be joined without the verifier needing the user identity. Reverses to
|
|
15
|
+
* nothing — no rainbow / no forensic recovery — so the host MUST keep its
|
|
16
|
+
* own subject->hash map externally if reverse lookup is ever needed.
|
|
17
|
+
* - `'omit'`: subject is replaced with a constant `'redacted'`. Use when even
|
|
18
|
+
* joining records by user is unwanted (e.g. handed off to an external
|
|
19
|
+
* auditor who only needs to validate signatures + hash continuity).
|
|
20
|
+
*/
|
|
21
|
+
export type SkillAuditSubjectMode = 'plain' | 'hash' | 'omit';
|
|
22
|
+
/**
|
|
23
|
+
* Configuration for the skill action audit log.
|
|
24
|
+
*
|
|
25
|
+
* The `enabled` flag is the master switch. When enabled, callers SHOULD
|
|
26
|
+
* supply both a `signer` and a `store`; when omitted, the SDK falls back to
|
|
27
|
+
* sensible defaults (in-memory store, HS256 signer with a randomly-generated
|
|
28
|
+
* secret) that are appropriate ONLY for development. Production hosts must
|
|
29
|
+
* wire their own — defaults are flagged in logs.
|
|
30
|
+
*
|
|
31
|
+
* @remarks Multi-pod / cross-process safety
|
|
32
|
+
* The current implementation is **single-writer** (single-pod) safe. The
|
|
33
|
+
* writer caches the chain tail per-process so concurrent writers across
|
|
34
|
+
* multiple pods can produce records whose `prevHash` references a stale
|
|
35
|
+
* tail, which the verifier then reports as a chain break. Operators who run
|
|
36
|
+
* multiple replicas behind a load balancer should either:
|
|
37
|
+
* - run a single dedicated audit pod, or
|
|
38
|
+
* - configure leader election so only one pod appends at a time, or
|
|
39
|
+
* - accept that concurrent writers may produce verifier breaks and rely on
|
|
40
|
+
* external head-pinning for tamper-evidence.
|
|
41
|
+
* v1.3.0 will introduce a CAS-based chain-head primitive that fuses
|
|
42
|
+
* `incr(seq) → set(record:N IF NX) → return tail-bytes` into a single
|
|
43
|
+
* Lua/EVAL atomic — see `// TODO(v1.3.0)` in audit-store.ts.
|
|
44
|
+
*/
|
|
45
|
+
export interface SkillAuditConfig {
|
|
46
|
+
/**
|
|
47
|
+
* Master switch. Default: false (opt-in feature, no overhead when disabled).
|
|
48
|
+
*/
|
|
49
|
+
enabled?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Pluggable signer. When omitted, a process-local HS256 signer is created
|
|
52
|
+
* with a randomly-generated 32-byte secret. The secret is never logged but
|
|
53
|
+
* IS process-local — restarting the process resets it, which means
|
|
54
|
+
* pre-restart records can no longer be verified. Production hosts MUST
|
|
55
|
+
* supply an explicit signer.
|
|
56
|
+
*/
|
|
57
|
+
signer?: SkillAuditSigner;
|
|
58
|
+
/**
|
|
59
|
+
* Pluggable store. When omitted, an in-memory store is used. Suitable for
|
|
60
|
+
* dev / single-pod deployments only. Production hosts should wire a
|
|
61
|
+
* `StorageAdapterAuditStore` against their Redis/SQLite/Vercel KV adapter.
|
|
62
|
+
*/
|
|
63
|
+
store?: SkillAuditStore;
|
|
64
|
+
/**
|
|
65
|
+
* How the `subject` field (typically JWT `sub`) is persisted. Default:
|
|
66
|
+
* `'hash'` — deterministic HMAC per audit-secret so records can be joined
|
|
67
|
+
* without surfacing PII in the persisted log. See {@link SkillAuditSubjectMode}.
|
|
68
|
+
*/
|
|
69
|
+
subjectMode?: SkillAuditSubjectMode;
|
|
70
|
+
/**
|
|
71
|
+
* Optional periodic head-anchor interval (milliseconds). When set, the
|
|
72
|
+
* writer occasionally writes `{ tail: { sequence, hash, timestamp } }` to
|
|
73
|
+
* an external immutable store (when one is configured at the host level)
|
|
74
|
+
* so the verifier can detect tail truncation that resets the sequence
|
|
75
|
+
* counter. Out-of-scope for v1.2.0; reserved for v1.3.0.
|
|
76
|
+
*
|
|
77
|
+
* @defaultValue undefined (no head anchoring; tail truncation is NOT
|
|
78
|
+
* detectable by the bundled verifier — see `verifyChain` JSDoc).
|
|
79
|
+
*/
|
|
80
|
+
headAnchorIntervalMs?: number;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* DI token for the audit writer service. Resolved lazily by the
|
|
84
|
+
* ExecuteActionTool via `tryGet` so an unconfigured server is a no-op.
|
|
85
|
+
*/
|
|
86
|
+
export declare const SkillAuditWriterToken: Token<SkillAuditWriter>;
|
|
87
|
+
//# sourceMappingURL=audit-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-config.d.ts","sourceRoot":"","sources":["../../../src/skills/audit/audit-config.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,qBAAqB,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAE9D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAE1B;;;;OAIG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC;IAExB;;;;OAIG;IACH,WAAW,CAAC,EAAE,qBAAqB,CAAC;IAEpC;;;;;;;;;OASG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,gBAAgB,CAE9B,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase of a skill action invocation that this record captures.
|
|
3
|
+
*
|
|
4
|
+
* - `authority-check-pass` is written immediately after the AuthorityGuard
|
|
5
|
+
* approves the call but before the upstream HTTP request fires. This means
|
|
6
|
+
* even denied-by-network or denied-by-budget invocations show up in the
|
|
7
|
+
* audit log alongside the inputHash that drove the decision.
|
|
8
|
+
* - `authority-check-fail` is written when the AuthorityGuard denies the
|
|
9
|
+
* call. Most security-relevant events go here — without this phase,
|
|
10
|
+
* denied invocations would be unrecorded in the audit log.
|
|
11
|
+
* - `http-call-success` is written after a successful upstream call, with
|
|
12
|
+
* the HTTP status and an outputHash derived from the response body.
|
|
13
|
+
* - `http-call-failure` is written when the upstream call throws or returns
|
|
14
|
+
* a non-success envelope; status may be 0 if the request never reached the
|
|
15
|
+
* server (DNS, SSRF block, etc.).
|
|
16
|
+
*/
|
|
17
|
+
export type SkillAuditPhase = 'authority-check-pass' | 'authority-check-fail' | 'http-call-success' | 'http-call-failure';
|
|
18
|
+
/**
|
|
19
|
+
* Signature algorithm used to sign the audit record.
|
|
20
|
+
*
|
|
21
|
+
* - `HS256`: HMAC-SHA256 with a shared secret. Default for dev / single-pod
|
|
22
|
+
* in-memory deployments. Verifiers need access to the same secret, so this
|
|
23
|
+
* is unsuitable for handing off audit logs to external auditors.
|
|
24
|
+
* - `RS256`: RSA-PKCS1-v1_5 with SHA-256. Pairs with the bundle-signing key
|
|
25
|
+
* registry (`SignatureKey.alg = 'RS256'`) so an admin configures one key
|
|
26
|
+
* and gets bundle + audit signing for free.
|
|
27
|
+
*
|
|
28
|
+
* NOTE: EdDSA is NOT included in this union — there is no Ed25519AuditSigner
|
|
29
|
+
* implementation yet, and shipping a placeholder would let hosts opt into a
|
|
30
|
+
* silently-broken signing path. When `@frontmcp/utils` gains Ed25519 support,
|
|
31
|
+
* an `Ed25519AuditSigner` and the `'EdDSA'` literal can land together.
|
|
32
|
+
*/
|
|
33
|
+
export type SkillAuditSignatureAlg = 'HS256' | 'RS256';
|
|
34
|
+
/**
|
|
35
|
+
* One signed entry in the skill action audit chain.
|
|
36
|
+
*
|
|
37
|
+
* The record is canonicalized (RFC 8785 JCS subset) before signing — the
|
|
38
|
+
* resulting bytes are what `prevHash` points to in the next record. The
|
|
39
|
+
* verifier walks the chain from the genesis record (prevHash = `'0'.repeat(64)`)
|
|
40
|
+
* to the head, recomputing each prevHash and re-verifying each signature.
|
|
41
|
+
*
|
|
42
|
+
* NOTE: this record intentionally stores only HASHES of input/output bodies,
|
|
43
|
+
* not the bodies themselves. Audit logs should not become a covert PII /
|
|
44
|
+
* secret store. A redacted-preview field may land in a future schema, but
|
|
45
|
+
* the canonical record schema is hash-only.
|
|
46
|
+
*/
|
|
47
|
+
export interface SkillAuditRecord {
|
|
48
|
+
/** UUIDv4 — opaque, useful for correlating with downstream sinks. */
|
|
49
|
+
id: string;
|
|
50
|
+
/**
|
|
51
|
+
* Monotonic chain index, allocated atomically from the storage adapter
|
|
52
|
+
* (`StorageAdapter.incr('audit:skills:sequence')` in production). Genesis
|
|
53
|
+
* record has sequence = 1.
|
|
54
|
+
*/
|
|
55
|
+
sequence: number;
|
|
56
|
+
/** ISO-8601 UTC timestamp of when this record was finalized. */
|
|
57
|
+
timestamp: string;
|
|
58
|
+
/** Authentication subject (e.g. JWT `sub`). `'anonymous'` when missing. */
|
|
59
|
+
subject: string;
|
|
60
|
+
/** Skill id from the bundle (e.g. `'billing'`). */
|
|
61
|
+
skillId: string;
|
|
62
|
+
/** Operation id within the skill (e.g. `'createInvoice'`). */
|
|
63
|
+
actionId: string;
|
|
64
|
+
/** Stable bundle id the action was resolved against. */
|
|
65
|
+
bundleId: string;
|
|
66
|
+
/** Bundle version pinned for this invocation (entry-pinned, not store-current). */
|
|
67
|
+
bundleVersion: string;
|
|
68
|
+
/** Phase being captured — see {@link SkillAuditPhase}. */
|
|
69
|
+
phase: SkillAuditPhase;
|
|
70
|
+
/** HTTP status, present for the http-call-* phases. */
|
|
71
|
+
status?: number;
|
|
72
|
+
/** sha256Hex(canonicalize(input)) — the input bytes never appear in the record. */
|
|
73
|
+
inputHash: string;
|
|
74
|
+
/** sha256Hex(canonicalize(output)) — only set on http-call-success when a body is present. */
|
|
75
|
+
outputHash?: string;
|
|
76
|
+
/** Redacted, truncated error description for http-call-failure. */
|
|
77
|
+
errorMessage?: string;
|
|
78
|
+
/**
|
|
79
|
+
* sha256Hex of the canonicalized previous record (without its own signature).
|
|
80
|
+
* The genesis record uses `'0'.repeat(64)`. Tamper detection works because
|
|
81
|
+
* any retroactive edit changes the canonicalization of that record, which
|
|
82
|
+
* changes the prevHash the next record expects, which breaks signature
|
|
83
|
+
* verification on the next record.
|
|
84
|
+
*/
|
|
85
|
+
prevHash: string;
|
|
86
|
+
/**
|
|
87
|
+
* Detached signature, base64url-encoded. The signed bytes are
|
|
88
|
+
* `canonicalize(record without signature)` — see audit-chain.ts.
|
|
89
|
+
*/
|
|
90
|
+
signature: string;
|
|
91
|
+
/**
|
|
92
|
+
* Stable id of the signing key. For RS256/EdDSA matches the
|
|
93
|
+
* `SignatureKey.keyId` admins configure for bundle signing.
|
|
94
|
+
*/
|
|
95
|
+
signatureKeyId: string;
|
|
96
|
+
/** Algorithm used to sign — see {@link SkillAuditSignatureAlg}. */
|
|
97
|
+
signatureAlg: SkillAuditSignatureAlg;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Genesis prevHash — sha256 hex output is 64 chars; pre-genesis is "no prior
|
|
101
|
+
* record", encoded as 64 zero hex chars so the field is always the same shape.
|
|
102
|
+
*/
|
|
103
|
+
export declare const SKILL_AUDIT_GENESIS_PREV_HASH: string;
|
|
104
|
+
/**
|
|
105
|
+
* Storage key prefixes. Centralized so that the writer, store, and verifier
|
|
106
|
+
* all agree on the layout.
|
|
107
|
+
*/
|
|
108
|
+
export declare const SKILL_AUDIT_KEYS: {
|
|
109
|
+
/** Atomic chain head counter — incremented per append. */
|
|
110
|
+
readonly sequence: "audit:skills:sequence";
|
|
111
|
+
/** Per-record key. Use `SKILL_AUDIT_KEYS.record(seq)` to build. */
|
|
112
|
+
readonly record: (sequence: number) => string;
|
|
113
|
+
};
|
|
114
|
+
//# sourceMappingURL=audit-record.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-record.types.d.ts","sourceRoot":"","sources":["../../../src/skills/audit/audit-record.types.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,eAAe,GACvB,sBAAsB,GACtB,sBAAsB,GACtB,mBAAmB,GACnB,mBAAmB,CAAC;AAExB;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,OAAO,CAAC;AAEvD;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,gBAAgB;IAC/B,qEAAqE;IACrE,EAAE,EAAE,MAAM,CAAC;IACX;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,SAAS,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,mFAAmF;IACnF,aAAa,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,KAAK,EAAE,eAAe,CAAC;IACvB,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mFAAmF;IACnF,SAAS,EAAE,MAAM,CAAC;IAClB,8FAA8F;IAC9F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IACvB,mEAAmE;IACnE,YAAY,EAAE,sBAAsB,CAAC;CACtC;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B,QAAiB,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,gBAAgB;IAC3B,0DAA0D;;IAE1D,mEAAmE;gCAChD,MAAM,KAAG,MAAM;CAC1B,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type AuditSignatureVerifier, type AuditTrustedKey } from './audit-chain';
|
|
2
|
+
import { type SkillAuditRecord, type SkillAuditSignatureAlg } from './audit-record.types';
|
|
3
|
+
/**
|
|
4
|
+
* Result of a signing pass. Returned to the writer so it can stamp the
|
|
5
|
+
* keyId/alg fields on the record alongside the signature itself.
|
|
6
|
+
*/
|
|
7
|
+
export interface SkillAuditSignResult {
|
|
8
|
+
signature: string;
|
|
9
|
+
keyId: string;
|
|
10
|
+
alg: SkillAuditSignatureAlg;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Stable interface for the writer to call. Each signer holds its own key
|
|
14
|
+
* material (HMAC secret / RSA private JWK) — the writer never sees the
|
|
15
|
+
* secret, only the public-facing keyId.
|
|
16
|
+
*/
|
|
17
|
+
export interface SkillAuditSigner {
|
|
18
|
+
/** Sign the given record (sans signature fields) and return the envelope. */
|
|
19
|
+
sign(record: Omit<SkillAuditRecord, 'signature' | 'signatureKeyId' | 'signatureAlg'>): SkillAuditSignResult;
|
|
20
|
+
/** Public-facing key id — admins identify keys by this string. */
|
|
21
|
+
getKeyId(): string;
|
|
22
|
+
/** Algorithm this signer uses. */
|
|
23
|
+
getAlg(): SkillAuditSignatureAlg;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* HMAC-SHA256 signer for dev / single-pod stacks. Uses a shared secret;
|
|
27
|
+
* verification is symmetric, so this is unsuitable for handing audit logs
|
|
28
|
+
* to external auditors who shouldn't be able to forge new entries.
|
|
29
|
+
*/
|
|
30
|
+
export declare class Hs256AuditSigner implements SkillAuditSigner {
|
|
31
|
+
private readonly key;
|
|
32
|
+
private readonly keyId;
|
|
33
|
+
/**
|
|
34
|
+
* @param secret - HMAC secret. Strings are UTF-8 encoded; pass a
|
|
35
|
+
* Uint8Array directly when you've derived the key (e.g.
|
|
36
|
+
* from HKDF) and want to avoid the extra encode step.
|
|
37
|
+
* @param keyId - Stable identifier (e.g. `'audit-dev-key'`) — surfaces in
|
|
38
|
+
* the signed record's `signatureKeyId` field.
|
|
39
|
+
*/
|
|
40
|
+
constructor(secret: string | Uint8Array, keyId: string);
|
|
41
|
+
sign(record: Omit<SkillAuditRecord, 'signature' | 'signatureKeyId' | 'signatureAlg'>): SkillAuditSignResult;
|
|
42
|
+
getKeyId(): string;
|
|
43
|
+
getAlg(): SkillAuditSignatureAlg;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* RS256 signer that pairs with the bundle-signing key registry.
|
|
47
|
+
*
|
|
48
|
+
* The private key must be supplied as a JWK so the same persistence
|
|
49
|
+
* surface (`@frontmcp/utils` KeyPersistence) that already stores asymmetric
|
|
50
|
+
* keys for bundle signing can be reused. The matching public key — held by
|
|
51
|
+
* verifiers — lives in the same `SignatureKey` allowlist hosts already
|
|
52
|
+
* configure for `verifyBundleSignature`.
|
|
53
|
+
*
|
|
54
|
+
* Strict JWK validation: rejects EC/OKP/oct keys at construction time so a
|
|
55
|
+
* misconfigured key surfaces immediately rather than at first sign() call.
|
|
56
|
+
*/
|
|
57
|
+
export declare class Rs256AuditSigner implements SkillAuditSigner {
|
|
58
|
+
private readonly privateJwk;
|
|
59
|
+
private readonly keyId;
|
|
60
|
+
constructor(privateJwk: JsonWebKey, keyId: string);
|
|
61
|
+
sign(record: Omit<SkillAuditRecord, 'signature' | 'signatureKeyId' | 'signatureAlg'>): SkillAuditSignResult;
|
|
62
|
+
getKeyId(): string;
|
|
63
|
+
getAlg(): SkillAuditSignatureAlg;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Default verifier used by tests and stand-alone forensic tools. Production
|
|
67
|
+
* hosts can wire their own verifier (e.g. backed by an HSM) by supplying a
|
|
68
|
+
* different `AuditSignatureVerifier` to {@link verifyChain}.
|
|
69
|
+
*/
|
|
70
|
+
export declare const defaultAuditSignatureVerifier: AuditSignatureVerifier;
|
|
71
|
+
export type { AuditTrustedKey };
|
|
72
|
+
//# sourceMappingURL=audit-signer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-signer.d.ts","sourceRoot":"","sources":["../../../src/skills/audit/audit-signer.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAgC,KAAK,sBAAsB,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAChH,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE1F;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,sBAAsB,CAAC;CAC7B;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,6EAA6E;IAC7E,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,WAAW,GAAG,gBAAgB,GAAG,cAAc,CAAC,GAAG,oBAAoB,CAAC;IAC5G,kEAAkE;IAClE,QAAQ,IAAI,MAAM,CAAC;IACnB,kCAAkC;IAClC,MAAM,IAAI,sBAAsB,CAAC;CAClC;AAED;;;;GAIG;AACH,qBAAa,gBAAiB,YAAW,gBAAgB;IACvD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAa;IACjC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAE/B;;;;;;OAMG;gBACS,MAAM,EAAE,MAAM,GAAG,UAAU,EAAE,KAAK,EAAE,MAAM;IAkBtD,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,WAAW,GAAG,gBAAgB,GAAG,cAAc,CAAC,GAAG,oBAAoB;IAmB3G,QAAQ,IAAI,MAAM;IAIlB,MAAM,IAAI,sBAAsB;CAGjC;AAED;;;;;;;;;;;GAWG;AACH,qBAAa,gBAAiB,YAAW,gBAAgB;IACvD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;gBAEnB,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM;IAyBjD,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,EAAE,WAAW,GAAG,gBAAgB,GAAG,cAAc,CAAC,GAAG,oBAAoB;IAiB3G,QAAQ,IAAI,MAAM;IAIlB,MAAM,IAAI,sBAAsB;CAGjC;AAID;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,EAAE,sBAmD3C,CAAC;AAEF,YAAY,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { StorageAdapter } from '@frontmcp/utils';
|
|
2
|
+
import { type SkillAuditRecord } from './audit-record.types';
|
|
3
|
+
/**
|
|
4
|
+
* Read filter for forensic / verifier traversal.
|
|
5
|
+
* - `from`: starting sequence (inclusive). Default: 1.
|
|
6
|
+
* - `limit`: max records to return. Default: unlimited.
|
|
7
|
+
*/
|
|
8
|
+
export interface SkillAuditReadOptions {
|
|
9
|
+
from?: number;
|
|
10
|
+
limit?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Common contract for audit stores. The writer relies on `appendAtSequence`
|
|
14
|
+
* being effectively atomic: two concurrent calls with the same `sequence`
|
|
15
|
+
* must result in exactly one of them succeeding (the other should throw or
|
|
16
|
+
* silently no-op based on `ifNotExists` semantics — both are acceptable).
|
|
17
|
+
*
|
|
18
|
+
* The writer guarantees per-process serialization via a Promise queue, so
|
|
19
|
+
* the contract really matters for cross-pod ordering.
|
|
20
|
+
*/
|
|
21
|
+
export interface SkillAuditStore {
|
|
22
|
+
/**
|
|
23
|
+
* Allocate the next monotonic sequence number. In production this maps to
|
|
24
|
+
* `StorageAdapter.incr(...)` which Redis / Vercel KV / Upstash / SQLite
|
|
25
|
+
* all expose atomically.
|
|
26
|
+
*/
|
|
27
|
+
nextSequence(): Promise<number>;
|
|
28
|
+
/**
|
|
29
|
+
* Persist a record at its claimed sequence. Implementations should fail
|
|
30
|
+
* (throw) or no-op if a record already exists at that sequence — this
|
|
31
|
+
* keeps the chain head from being clobbered.
|
|
32
|
+
*/
|
|
33
|
+
appendAtSequence(record: SkillAuditRecord): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Most recent record in the chain, or undefined for an empty chain. Used
|
|
36
|
+
* by the writer to compute `prevHash` for the next record. Must reflect
|
|
37
|
+
* cross-process state for HA correctness.
|
|
38
|
+
*/
|
|
39
|
+
tail(): Promise<SkillAuditRecord | undefined>;
|
|
40
|
+
/** Read records in sequence order. Used by the verifier and by HTTP viewers. */
|
|
41
|
+
read(opts?: SkillAuditReadOptions): Promise<SkillAuditRecord[]>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Process-local append-only audit log. Suitable for tests, dev environments,
|
|
45
|
+
* and single-pod deployments where audit durability is not required across
|
|
46
|
+
* restarts. For HA / multi-pod, use {@link StorageAdapterAuditStore}.
|
|
47
|
+
*/
|
|
48
|
+
export declare class MemoryAuditStore implements SkillAuditStore {
|
|
49
|
+
private readonly records;
|
|
50
|
+
private seq;
|
|
51
|
+
nextSequence(): Promise<number>;
|
|
52
|
+
appendAtSequence(record: SkillAuditRecord): Promise<void>;
|
|
53
|
+
tail(): Promise<SkillAuditRecord | undefined>;
|
|
54
|
+
read(opts?: SkillAuditReadOptions): Promise<SkillAuditRecord[]>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Backed by a `@frontmcp/utils` StorageAdapter. Sequence allocation uses
|
|
58
|
+
* `adapter.incr(...)` for atomic monotonicity across pods; per-record
|
|
59
|
+
* persistence uses `adapter.set(... , { ifNotExists: true })` so a retry
|
|
60
|
+
* after a partial failure doesn't overwrite the original record.
|
|
61
|
+
*/
|
|
62
|
+
export declare class StorageAdapterAuditStore implements SkillAuditStore {
|
|
63
|
+
private readonly adapter;
|
|
64
|
+
private readonly options;
|
|
65
|
+
constructor(adapter: StorageAdapter, options?: {
|
|
66
|
+
sequenceKey?: string;
|
|
67
|
+
recordKeyPrefix?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Maximum number of sequence slots to scan when looking for the chain
|
|
70
|
+
* tail. Default 1024. See {@link tail} for context — a partial write
|
|
71
|
+
* that incremented the counter without persisting the record leaves a
|
|
72
|
+
* hole; we walk backward past those, and this cap prevents an
|
|
73
|
+
* unbounded scan if every recent slot was lost.
|
|
74
|
+
*/
|
|
75
|
+
tailLookback?: number;
|
|
76
|
+
});
|
|
77
|
+
private get sequenceKey();
|
|
78
|
+
private recordKey;
|
|
79
|
+
nextSequence(): Promise<number>;
|
|
80
|
+
appendAtSequence(record: SkillAuditRecord): Promise<void>;
|
|
81
|
+
tail(): Promise<SkillAuditRecord | undefined>;
|
|
82
|
+
read(opts?: SkillAuditReadOptions): Promise<SkillAuditRecord[]>;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=audit-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-store.d.ts","sourceRoot":"","sources":["../../../src/skills/audit/audit-store.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAAoB,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE/E;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;GAQG;AACH,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