@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.
Files changed (64) hide show
  1. package/esm/index.mjs +396 -385
  2. package/esm/openapi/index.mjs +396 -385
  3. package/esm/package.json +18 -6
  4. package/esm/skills/index.mjs +2117 -0
  5. package/index.js +407 -389
  6. package/openapi/index.d.ts +11 -1
  7. package/openapi/index.d.ts.map +1 -1
  8. package/openapi/index.js +407 -389
  9. package/openapi/openapi.adapter.d.ts +2 -2
  10. package/openapi/openapi.adapter.d.ts.map +1 -1
  11. package/openapi/openapi.tool.d.ts.map +1 -1
  12. package/openapi/openapi.types.d.ts +3 -3
  13. package/openapi/openapi.types.d.ts.map +1 -1
  14. package/openapi/openapi.utils.d.ts.map +1 -1
  15. package/package.json +18 -6
  16. package/skills/audit/audit-chain.d.ts +81 -0
  17. package/skills/audit/audit-chain.d.ts.map +1 -0
  18. package/skills/audit/audit-config.d.ts +87 -0
  19. package/skills/audit/audit-config.d.ts.map +1 -0
  20. package/skills/audit/audit-record.types.d.ts +114 -0
  21. package/skills/audit/audit-record.types.d.ts.map +1 -0
  22. package/skills/audit/audit-signer.d.ts +72 -0
  23. package/skills/audit/audit-signer.d.ts.map +1 -0
  24. package/skills/audit/audit-store.d.ts +84 -0
  25. package/skills/audit/audit-store.d.ts.map +1 -0
  26. package/skills/audit/audit-writer.d.ts +175 -0
  27. package/skills/audit/audit-writer.d.ts.map +1 -0
  28. package/skills/audit/index.d.ts +7 -0
  29. package/skills/audit/index.d.ts.map +1 -0
  30. package/skills/bundle/bundle-diff.d.ts +30 -0
  31. package/skills/bundle/bundle-diff.d.ts.map +1 -0
  32. package/skills/bundle/bundle.schema.d.ts +101 -0
  33. package/skills/bundle/bundle.schema.d.ts.map +1 -0
  34. package/skills/bundle/bundle.store.d.ts +143 -0
  35. package/skills/bundle/bundle.store.d.ts.map +1 -0
  36. package/skills/bundle/bundle.types.d.ts +143 -0
  37. package/skills/bundle/bundle.types.d.ts.map +1 -0
  38. package/skills/bundle/overlay-parser.d.ts +42 -0
  39. package/skills/bundle/overlay-parser.d.ts.map +1 -0
  40. package/skills/dependency/skill-dag.d.ts +39 -0
  41. package/skills/dependency/skill-dag.d.ts.map +1 -0
  42. package/skills/index.d.ts +17 -0
  43. package/skills/index.d.ts.map +1 -0
  44. package/skills/index.js +2192 -0
  45. package/skills/security/bundle-signature.d.ts +44 -0
  46. package/skills/security/bundle-signature.d.ts.map +1 -0
  47. package/skills/security/jwt-verifier.d.ts +38 -0
  48. package/skills/security/jwt-verifier.d.ts.map +1 -0
  49. package/skills/security/webhook-replay-guard.d.ts +52 -0
  50. package/skills/security/webhook-replay-guard.d.ts.map +1 -0
  51. package/skills/source-options.d.ts +55 -0
  52. package/skills/source-options.d.ts.map +1 -0
  53. package/skills/sources/filesystem-skills.source.d.ts +127 -0
  54. package/skills/sources/filesystem-skills.source.d.ts.map +1 -0
  55. package/skills/sources/index.d.ts +10 -0
  56. package/skills/sources/index.d.ts.map +1 -0
  57. package/skills/sources/npm.source.d.ts +30 -0
  58. package/skills/sources/npm.source.d.ts.map +1 -0
  59. package/skills/sources/saas-pull.source.d.ts +47 -0
  60. package/skills/sources/saas-pull.source.d.ts.map +1 -0
  61. package/skills/sources/skill-bundle-source.interface.d.ts +36 -0
  62. package/skills/sources/skill-bundle-source.interface.d.ts.map +1 -0
  63. package/skills/sources/static.source.d.ts +30 -0
  64. package/skills/sources/static.source.d.ts.map +1 -0
@@ -0,0 +1,42 @@
1
+ import { type ParsedBundle } from './bundle.schema';
2
+ import type { ResolvedBundle } from './bundle.types';
3
+ /**
4
+ * Pragmatic overlay-parser for v1.2.
5
+ *
6
+ * The wire format is an OpenAPI Overlay (OAI 1.0/1.1) whose `info.x-frontmcp-bundle`
7
+ * extension carries the fully resolved bundle metadata produced by the SaaS
8
+ * analyzer. The plugin DOES NOT walk overlay JSONPath updates against the spec
9
+ * itself — the SaaS has already done all OpenAPI resolution and emits a flat,
10
+ * validated bundle object. The plugin simply:
11
+ *
12
+ * 1. Parses the overlay YAML/JSON
13
+ * 2. Extracts `info.x-frontmcp-bundle`
14
+ * 3. Validates structure with Zod (defense-in-depth)
15
+ * 4. Cross-validates references (serviceId / authBindingRef / operationId)
16
+ *
17
+ * This intentionally avoids re-implementing OpenAPI spec parsing in-tree. A
18
+ * future v1.3 may add a build-time mode that consumes raw OpenAPI + Overlay
19
+ * directly when SaaS isn't in the loop.
20
+ */
21
+ export type OverlayInput = {
22
+ kind: 'yaml';
23
+ content: string;
24
+ } | {
25
+ kind: 'json';
26
+ content: string;
27
+ } | {
28
+ kind: 'object';
29
+ content: unknown;
30
+ };
31
+ export declare class OverlayParseError extends Error {
32
+ readonly errors?: string[] | undefined;
33
+ constructor(message: string, errors?: string[] | undefined);
34
+ }
35
+ /**
36
+ * Parse and validate an overlay into a ResolvedBundle. Throws OverlayParseError
37
+ * on any structural or cross-reference violation.
38
+ */
39
+ export declare function parseOverlay(input: OverlayInput): ResolvedBundle;
40
+ /** Re-export for tests that want raw schema output. */
41
+ export type { ParsedBundle };
42
+ //# sourceMappingURL=overlay-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay-parser.d.ts","sourceRoot":"","sources":["../../../src/skills/bundle/overlay-parser.ts"],"names":[],"mappings":"AAIA,OAAO,EAAuC,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACzF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAIzC,qBAAa,iBAAkB,SAAQ,KAAK;aAGxB,MAAM,CAAC,EAAE,MAAM,EAAE;gBADjC,OAAO,EAAE,MAAM,EACC,MAAM,CAAC,EAAE,MAAM,EAAE,YAAA;CAKpC;AA6CD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,YAAY,GAAG,cAAc,CAqBhE;AAED,uDAAuD;AACvD,YAAY,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,39 @@
1
+ import type { BundledSkill } from '../bundle/bundle.types';
2
+ /**
3
+ * Thrown when the `requires` graph contains a cycle. `cycle` lists the ids
4
+ * forming the offending chain (first id appears once at the end too, so the
5
+ * loop is visible at a glance).
6
+ */
7
+ export declare class SkillDependencyCycleError extends Error {
8
+ readonly cycle: string[];
9
+ constructor(cycle: string[]);
10
+ }
11
+ /**
12
+ * Thrown when a skill declares `requires: [otherId]` but `otherId` is not
13
+ * present in the bundle.
14
+ */
15
+ export declare class SkillDependencyMissingError extends Error {
16
+ readonly skillId: string;
17
+ readonly missingId: string;
18
+ constructor(skillId: string, missingId: string);
19
+ }
20
+ /**
21
+ * Thrown when an internal invariant of the resolver is violated (e.g. the
22
+ * `ready` queue and `byId` map disagree). Surfaces as a typed error rather
23
+ * than a generic Error so callers can distinguish "bug in the resolver"
24
+ * from "bad input".
25
+ */
26
+ export declare class SkillDependencyInvariantError extends Error {
27
+ constructor(message: string);
28
+ }
29
+ /**
30
+ * Compute the dependency-respecting load order for a list of skills.
31
+ *
32
+ * Returns a fresh array — input is not mutated. Tie-break is alphabetical by
33
+ * id so the order is deterministic across runs (helps tests + audit logs).
34
+ *
35
+ * Throws `SkillDependencyMissingError` for unknown ids and
36
+ * `SkillDependencyCycleError` for cycles.
37
+ */
38
+ export declare function resolveSkillLoadOrder(skills: BundledSkill[]): BundledSkill[];
39
+ //# sourceMappingURL=skill-dag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-dag.d.ts","sourceRoot":"","sources":["../../../src/skills/dependency/skill-dag.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAE3D;;;;GAIG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;aACtB,KAAK,EAAE,MAAM,EAAE;gBAAf,KAAK,EAAE,MAAM,EAAE;CAI5C;AAED;;;GAGG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;aAElC,OAAO,EAAE,MAAM;aACf,SAAS,EAAE,MAAM;gBADjB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM;CAKpC;AAED;;;;;GAKG;AACH,qBAAa,6BAA8B,SAAQ,KAAK;gBAC1C,OAAO,EAAE,MAAM;CAI5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CA4E5E"}
@@ -0,0 +1,17 @@
1
+ export type { AuthBinding, AuthoritiesPolicy, BundleIntegrity, BundledSkill, HttpMethod, OperationDescriptor, ResolvedBundle, ServiceDescriptor, } from './bundle/bundle.types';
2
+ export { bundleSkillToActions } from './bundle/bundle.types';
3
+ export { crossValidate, resolvedBundleSchema, type ParsedBundle } from './bundle/bundle.schema';
4
+ export { OverlayParseError, parseOverlay, type OverlayInput } from './bundle/overlay-parser';
5
+ export { BundleStore, BundlePinnedError, type BundleStoreCounter, type BundleStoreOptions, type BundleStoreSpan, type BundleStoreTelemetry, type BundleSwapListener, } from './bundle/bundle.store';
6
+ export { diffBundles, formatDiffSummary, type BundleDiff } from './bundle/bundle-diff';
7
+ export { resolveSkillLoadOrder, SkillDependencyCycleError, SkillDependencyInvariantError, SkillDependencyMissingError, } from './dependency/skill-dag';
8
+ export { bundleSourceSchema, npmSourceSchema, saasSourceSchema, signatureKeySchema, staticSourceSchema, type BundleSourceOptions, type NpmSourceOptions, type SaasSourceOptions, type SignatureKey, type StaticSourceOptions, } from './source-options';
9
+ export { createBundleSource, NpmSource, SaasPullSource, StaticSource } from './sources';
10
+ export type { BundleSourceListener, SkillBundleSource } from './sources/skill-bundle-source.interface';
11
+ export { FilesystemSkillsSource, loadFilesystemSkill, parseSkillFrontmatter, type FilesystemSkillContent, type FilesystemSkillsEvent, type FilesystemSkillsListener, type FilesystemSkillsLogger, type FilesystemSkillsSourceOptions, } from './sources/filesystem-skills.source';
12
+ export { bundleDigest, canonicalize, verifyBundleSignature, type SignatureVerifyCounter, type SignatureVerifyResult, type SignatureVerifyTelemetry, } from './security/bundle-signature';
13
+ export { BundlePushJwtVerifier, type BundlePushJwtVerifierOptions } from './security/jwt-verifier';
14
+ export { WebhookReplayGuard, type ReplayCheckResult, type ReplayGuardCounter, type ReplayGuardTelemetry, type WebhookReplayGuardOptions, } from './security/webhook-replay-guard';
15
+ export { canonicalizeRecordForSigning, defaultAuditSignatureVerifier, Hs256AuditSigner, linkRecord, MemoryAuditStore, nextPrevHash, Rs256AuditSigner, SKILL_AUDIT_ERROR_MESSAGE_MAX, SKILL_AUDIT_GENESIS_PREV_HASH, SKILL_AUDIT_KEYS, SKILL_AUDIT_QUEUE_MAX, SkillAuditWriter, SkillAuditWriterToken, StorageAdapterAuditStore, verifyChain, type AuditChainVerifyResult, type AuditSignatureVerifier, type AuditTrustedKey, type SkillAuditAuthorityFailExtras, type SkillAuditConfig, type SkillAuditFailureExtras, type SkillAuditLogger, type SkillAuditMetrics, type SkillAuditPartialRecord, type SkillAuditPhase, type SkillAuditReadOptions, type SkillAuditRecord, type SkillAuditSignatureAlg, type SkillAuditSigner, type SkillAuditSignResult, type SkillAuditSubjectMode, type SkillAuditWriterOptions, type SkillAuditStore, type SkillAuditSuccessExtras, type SkillAuditWriteContext, } from './audit';
16
+ export { hasSkillAuditFactory, setSkillAuditFactory } from '@frontmcp/sdk';
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/skills/index.ts"],"names":[],"mappings":"AAQA,YAAY,EACV,WAAW,EACX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