@contractspec/lib.feature-flags 1.49.0 → 1.51.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 (42) hide show
  1. package/dist/contracts/src/capabilities/capabilities.d.ts +32 -5
  2. package/dist/contracts/src/capabilities/capabilities.d.ts.map +1 -1
  3. package/dist/contracts/src/capabilities/context.d.ts +1 -0
  4. package/dist/contracts/src/capabilities/guards.d.ts +4 -0
  5. package/dist/contracts/src/capabilities/index.d.ts +3 -0
  6. package/dist/contracts/src/capabilities/validation.d.ts +4 -0
  7. package/dist/contracts/src/events.d.ts +24 -4
  8. package/dist/contracts/src/events.d.ts.map +1 -1
  9. package/dist/contracts/src/experiments/spec.d.ts +7 -4
  10. package/dist/contracts/src/experiments/spec.d.ts.map +1 -1
  11. package/dist/contracts/src/features/install.d.ts +3 -3
  12. package/dist/contracts/src/features/types.d.ts +23 -29
  13. package/dist/contracts/src/features/types.d.ts.map +1 -1
  14. package/dist/contracts/src/index.d.ts +6 -5
  15. package/dist/contracts/src/install.d.ts +1 -1
  16. package/dist/contracts/src/integrations/openbanking/contracts/accounts.d.ts +1 -1
  17. package/dist/contracts/src/integrations/openbanking/contracts/balances.d.ts +1 -1
  18. package/dist/contracts/src/integrations/openbanking/contracts/transactions.d.ts +1 -1
  19. package/dist/contracts/src/integrations/operations.d.ts +1 -1
  20. package/dist/contracts/src/knowledge/operations.d.ts +1 -1
  21. package/dist/contracts/src/llm/exporters.d.ts +1 -1
  22. package/dist/contracts/src/operations/operation.d.ts +6 -0
  23. package/dist/contracts/src/operations/operation.d.ts.map +1 -1
  24. package/dist/contracts/src/ownership.d.ts +111 -8
  25. package/dist/contracts/src/ownership.d.ts.map +1 -1
  26. package/dist/contracts/src/policy/guards.d.ts +1 -0
  27. package/dist/contracts/src/policy/index.d.ts +3 -1
  28. package/dist/contracts/src/policy/spec.d.ts +6 -4
  29. package/dist/contracts/src/policy/spec.d.ts.map +1 -1
  30. package/dist/contracts/src/policy/validation.d.ts +3 -0
  31. package/dist/contracts/src/presentations/presentations.d.ts +1 -0
  32. package/dist/contracts/src/presentations/presentations.d.ts.map +1 -1
  33. package/dist/contracts/src/server/mcp/createMcpServer.d.ts +2 -1
  34. package/dist/contracts/src/tests/spec.d.ts +6 -4
  35. package/dist/contracts/src/tests/spec.d.ts.map +1 -1
  36. package/dist/contracts/src/versioning/refs.d.ts +47 -0
  37. package/dist/contracts/src/versioning/refs.d.ts.map +1 -0
  38. package/dist/contracts/src/workflow/context.d.ts +2 -0
  39. package/dist/contracts/src/workflow/index.d.ts +3 -1
  40. package/dist/contracts/src/workflow/sla-monitor.d.ts +2 -0
  41. package/dist/contracts/src/workflow/validation.d.ts +2 -0
  42. package/package.json +5 -5
@@ -1,31 +1,58 @@
1
+ import { VersionedSpecRef } from "../versioning/refs.js";
1
2
  import { OwnerShipMeta } from "../ownership.js";
2
3
 
3
4
  //#region ../contracts/src/capabilities/capabilities.d.ts
5
+ /** Classification of capability types. */
4
6
  type CapabilityKind = 'api' | 'event' | 'data' | 'ui' | 'integration';
7
+ /** Surfaces where capabilities can be exposed or consumed. */
5
8
  type CapabilitySurface = 'operation' | 'event' | 'workflow' | 'presentation' | 'resource';
9
+ /**
10
+ * Reference to a capability on a specific surface.
11
+ * Extends VersionedSpecRef with surface and description context.
12
+ */
6
13
  interface CapabilitySurfaceRef {
14
+ /** The surface type where this capability is exposed. */
7
15
  surface: CapabilitySurface;
16
+ /** Unique key identifying the spec on that surface (e.g., operation key). */
8
17
  key: string;
9
- version: string;
18
+ /** Semantic version of the spec on that surface. */
19
+ version?: string;
20
+ /** Optional description of what this capability provides. */
10
21
  description?: string;
11
22
  }
23
+ /** Metadata for a capability spec, extending ownership with kind. */
12
24
  interface CapabilityMeta extends OwnerShipMeta {
25
+ /** The kind/category of this capability. */
13
26
  kind: CapabilityKind;
14
27
  }
28
+ /**
29
+ * Requirement for a capability dependency.
30
+ * Used to declare what capabilities a spec needs.
31
+ */
15
32
  interface CapabilityRequirement {
33
+ /** Unique key of the required capability. */
16
34
  key: string;
35
+ /** Optional specific version required. */
17
36
  version?: string;
37
+ /** Optional kind filter for the requirement. */
18
38
  kind?: CapabilityKind;
39
+ /** If true, the requirement is optional and won't block if missing. */
19
40
  optional?: boolean;
41
+ /** Human-readable reason why this capability is required. */
20
42
  reason?: string;
21
43
  }
22
- interface CapabilityRef {
23
- key: string;
24
- version: string;
25
- }
44
+ /**
45
+ * Reference to a capability spec.
46
+ * Uses key and version to identify a specific capability.
47
+ */
48
+ type CapabilityRef = VersionedSpecRef;
26
49
  interface CapabilitySpec {
27
50
  meta: CapabilityMeta;
51
+ /** Capabilities this capability extends (inherits requirements from). */
52
+ extends?: CapabilityRef;
53
+ /** Surfaces (operations, events, presentations, etc.) this capability provides. */
28
54
  provides?: CapabilitySurfaceRef[];
55
+ /** Capabilities that must be present for this capability to function. */
29
56
  requires?: CapabilityRequirement[];
30
57
  }
31
58
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.d.ts","names":[],"sources":["../../../../../contracts/src/capabilities/capabilities.ts"],"sourcesContent":[],"mappings":";;;KAGY,cAAA;KAEA,iBAAA;AAFA,UASK,oBAAA,CATS;EAEd,OAAA,EAQD,iBARkB;EAOZ,GAAA,EAAA,MAAA;EAOA,OAAA,EAAA,MAAA;EAIA,WAAA,CAAA,EAAA,MAAA;AAQjB;AAKiB,UAjBA,cAAA,SAAuB,aAiBT,CAAA;EACvB,IAAA,EAjBA,cAiBA;;AAEK,UAhBI,qBAAA,CAgBJ;EAAqB,GAAA,EAAA,MAAA;;SAbzB;;;;UAKQ,aAAA;;;;UAKA,cAAA;QACT;aACK;aACA"}
1
+ {"version":3,"file":"capabilities.d.ts","names":[],"sources":["../../../../../contracts/src/capabilities/capabilities.ts"],"sourcesContent":[],"mappings":";;;;;KAKY,cAAA;AAAZ;AAGY,KAAA,iBAAA,GAAiB,WAAA,GAAA,OAAA,GAAA,UAAA,GAAA,cAAA,GAAA,UAAA;AAW7B;AAYA;AASA;AAiBA;AAEiB,UAxCA,oBAAA,CAwCc;EACvB;EAEI,OAAA,EAzCD,iBAyCC;EAEC;EAEA,GAAA,EAAA,MAAA;EAAqB;;;;;;UAnCjB,cAAA,SAAuB;;QAEhC;;;;;;UAOS,qBAAA;;;;;;SAMR;;;;;;;;;;KAWG,aAAA,GAAgB;UAEX,cAAA;QACT;;YAEI;;aAEC;;aAEA"}
@@ -0,0 +1 @@
1
+ import "./capabilities.js";
@@ -0,0 +1,4 @@
1
+ import "../presentations/presentations.js";
2
+ import "../operations/operation.js";
3
+ import "./context.js";
4
+ import "../events.js";
@@ -1,2 +1,5 @@
1
1
  import { CapabilityKind, CapabilityMeta, CapabilityRef, CapabilityRequirement, CapabilitySpec, CapabilitySurface, CapabilitySurfaceRef } from "./capabilities.js";
2
+ import "./validation.js";
3
+ import "./context.js";
4
+ import "./guards.js";
2
5
  import "./openbanking.js";
@@ -0,0 +1,4 @@
1
+ import "./capabilities.js";
2
+ import "../operations/registry.js";
3
+ import "../presentations/index.js";
4
+ import "../events.js";
@@ -1,21 +1,41 @@
1
1
  import { AnySchemaModel } from "../../schema/src/SchemaModel.js";
2
2
  import "../../schema/src/index.js";
3
+ import { CapabilityRef } from "./capabilities/capabilities.js";
3
4
  import { DocId } from "./docs/registry.js";
4
5
  import { OwnerShipMeta } from "./ownership.js";
5
6
  import "./registry.js";
6
7
 
7
8
  //#region ../contracts/src/events.d.ts
9
+
10
+ /**
11
+ * Metadata for an event specification.
12
+ * Extends OwnerShipMeta with event-specific documentation.
13
+ */
8
14
  interface EventSpecMeta extends Omit<OwnerShipMeta, 'docId'> {
9
- /** Doc block(s) for this operation. */
15
+ /** Associated DocBlock identifiers for this event. */
10
16
  docId?: DocId[];
11
17
  }
12
18
  /**
13
- * Typed event specification. Declare once, validate payloads at publish time,
14
- * and guard emissions via the contracts runtime.
19
+ * Typed event specification.
20
+ *
21
+ * Declare once, validate payloads at publish time, and guard emissions
22
+ * via the contracts runtime. Events are the backbone of event-driven
23
+ * architectures in ContractSpec.
24
+ *
25
+ * @typeParam T - The SchemaModel type defining the event payload structure
15
26
  */
16
27
  interface EventSpec<T extends AnySchemaModel> {
28
+ /** Event metadata including key, version, and ownership. */
17
29
  meta: EventSpecMeta;
18
- /** JSON-like paths to redact from logs/exports. */
30
+ /**
31
+ * Optional reference to the capability that provides this event.
32
+ * Used for bidirectional linking between capabilities and events.
33
+ */
34
+ capability?: CapabilityRef;
35
+ /**
36
+ * JSON paths to PII fields that should be redacted in logs/exports.
37
+ * @example ['email', 'user.phone', 'billing.address']
38
+ */
19
39
  pii?: string[];
20
40
  /** Event payload schema from @contractspec/lib.schema. */
21
41
  payload: T;
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","names":[],"sources":["../../../../contracts/src/events.ts"],"sourcesContent":[],"mappings":";;;;;;;UAKiB,aAAA,SAAsB,KAAK;;UAElC;AAFV;;;;;AASiB,UAAA,SAAS,CAAA,UAAW,cAAX,CAAA,CAAA;EAAW,IAAA,EAC7B,aAD6B;EAC7B;EAIG,GAAA,CAAA,EAAA,MAAA,EAAA;EAAC;WAAD"}
1
+ {"version":3,"file":"events.d.ts","names":[],"sources":["../../../../contracts/src/events.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;UAiDiB,aAAA,SAAsB,KAAK;;UAElC;;;;;;;;;;;UAYO,oBAAoB;;QAE7B;;;;;eAKO;;;;;;;WAOJ"}
@@ -1,13 +1,16 @@
1
+ import { OptionalVersionedSpecRef } from "../versioning/refs.js";
1
2
  import "../ownership.js";
2
3
  import "../policy/spec.js";
3
4
  import "../telemetry/spec.js";
4
5
  import "../registry.js";
5
6
 
6
7
  //#region ../contracts/src/experiments/spec.d.ts
7
- interface ExperimentRef {
8
- key: string;
9
- version?: string;
10
- }
8
+
9
+ /**
10
+ * Reference to an experiment spec.
11
+ * Version is optional; when omitted, refers to the latest version.
12
+ */
13
+ type ExperimentRef = OptionalVersionedSpecRef;
11
14
  //#endregion
12
15
  export { ExperimentRef };
13
16
  //# sourceMappingURL=spec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spec.d.ts","names":[],"sources":["../../../../../contracts/src/experiments/spec.ts"],"sourcesContent":[],"mappings":";;;;;;UAOiB,aAAA;EAAA,GAAA,EAAA,MAAA"}
1
+ {"version":3,"file":"spec.d.ts","names":[],"sources":["../../../../../contracts/src/experiments/spec.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAaA;;;;KAAY,aAAA,GAAgB"}
@@ -1,6 +1,6 @@
1
1
  import "../presentations/presentations.js";
2
- import "../capabilities/index.js";
3
2
  import "../operations/registry.js";
3
+ import "../presentations/index.js";
4
+ import "../capabilities/index.js";
4
5
  import "./types.js";
5
- import "./registry.js";
6
- import "../presentations/index.js";
6
+ import "./registry.js";
@@ -1,46 +1,40 @@
1
+ import { VersionedSpecRef } from "../versioning/refs.js";
2
+ import { CapabilityRef, CapabilityRequirement } from "../capabilities/capabilities.js";
1
3
  import { PresentationTarget } from "../presentations/presentations.js";
2
4
  import { OwnerShipMeta } from "../ownership.js";
3
- import { CapabilityRef, CapabilityRequirement } from "../capabilities/capabilities.js";
4
- import "../capabilities/index.js";
5
- import { ExperimentRef } from "../experiments/spec.js";
6
5
  import { ImplementationRef } from "../operations/operation.js";
7
6
  import "../operations/index.js";
7
+ import "../capabilities/index.js";
8
+ import { ExperimentRef } from "../experiments/spec.js";
8
9
 
9
10
  //#region ../contracts/src/features/types.d.ts
10
11
  /** Minimal metadata to identify and categorize a feature module. */
11
12
  type FeatureModuleMeta = OwnerShipMeta;
12
- interface OpRef {
13
- /** Operation key (OperationSpec.meta.key). */
14
- key: string;
15
- /** Operation version (OperationSpec.meta.version). */
16
- version: string;
17
- }
18
- interface EventRef {
19
- /** Event key. */
20
- key: string;
21
- /** Event version. */
22
- version: string;
23
- }
24
- interface PresentationRef {
25
- /** Presentation key. */
26
- key: string;
27
- /** Presentation version. */
28
- version: string;
29
- }
13
+ /**
14
+ * Reference to an operation spec.
15
+ * Uses key (OperationSpec.meta.key) and version (OperationSpec.meta.version).
16
+ */
17
+ type OpRef = VersionedSpecRef;
18
+ /**
19
+ * Reference to an event spec.
20
+ * Uses key (EventSpec.meta.key) and version (EventSpec.meta.version).
21
+ */
22
+ type EventRef = VersionedSpecRef;
23
+ /**
24
+ * Reference to a presentation spec.
25
+ * Uses key (PresentationSpec.meta.key) and version (PresentationSpec.meta.version).
26
+ */
27
+ type PresentationRef = VersionedSpecRef;
30
28
  /**
31
29
  * Reference to a data view spec.
30
+ * Uses key (DataViewSpec.meta.key) and version (DataViewSpec.meta.version).
32
31
  */
33
- interface DataViewRef {
34
- key: string;
35
- version: string;
36
- }
32
+ type DataViewRef = VersionedSpecRef;
37
33
  /**
38
34
  * Reference to a form spec.
35
+ * Uses key (FormSpec.meta.key) and version (FormSpec.meta.version).
39
36
  */
40
- interface FormRef {
41
- key: string;
42
- version: string;
43
- }
37
+ type FormRef = VersionedSpecRef;
44
38
  /** Group operations/events/presentations into an installable feature. */
45
39
  interface FeatureModuleSpec {
46
40
  meta: FeatureModuleMeta;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":[],"sources":["../../../../../contracts/src/features/types.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;KAOY,iBAAA,GAAoB;UAEf,KAAA;;EAFL,GAAA,EAAA,MAAA;EAEK;EAOA,OAAA,EAAA,MAAQ;AAOzB;AAUiB,UAjBA,QAAA,CAiBW;EAQX;EAMA,GAAA,EAAA,MAAA;EACT;EAEO,OAAA,EAAA,MAAA;;AAIG,UA/BD,eAAA,CA+BC;EAEF;EAGD,GAAA,EAAA,MAAA;EACA;EAGY,OAAA,EAAA,MAAA;;;;;AAqBjB,UAnDO,WAAA,CAmDP;EAAO,GAAA,EAAA,MAAA;;;;;;UA3CA,OAAA;;;;;UAMA,iBAAA;QACT;;eAEO;;WAEJ;;kBAEO;;gBAEF;;;eAGD;eACA;;;;QAGY;UAAa;;;;;;;;;aAQ3B;;;;;;oBAOO;;cAGN;;UAGJ"}
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../../../../../contracts/src/features/types.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;KAQY,iBAAA,GAAoB;;;AAAhC;AAMA;AAMY,KANA,KAAA,GAAQ,gBAMG;AAMvB;AAMA;AAMA;AAGA;AACQ,KAtBI,QAAA,GAAW,gBAsBf;;;;;AAWO,KA3BH,eAAA,GAAkB,gBA2Bf;;;;;AAmBK,KAxCR,WAAA,GAAc,gBAwCN;;;;;KAlCR,OAAA,GAAU;;UAGL,iBAAA;QACT;;eAEO;;WAEJ;;kBAEO;;gBAEF;;;eAGD;eACA;;;;QAGY;UAAa;;;;;;;;;aAQ3B;;;;;;oBAOO;;cAGN;;UAGJ"}
@@ -1,4 +1,6 @@
1
1
  import "../../schema/src/index.js";
2
+ import { OptionalVersionedSpecRef, VersionedSpecRef } from "./versioning/refs.js";
3
+ import { CapabilityKind, CapabilityMeta, CapabilityRef, CapabilityRequirement, CapabilitySpec, CapabilitySurface, CapabilitySurfaceRef } from "./capabilities/capabilities.js";
2
4
  import { PresentationTarget } from "./presentations/presentations.js";
3
5
  import { DocId } from "./docs/registry.js";
4
6
  import "./docs/index.js";
@@ -6,16 +8,15 @@ import { Owner, OwnerShipMeta, OwnersEnum, Stability, StabilityEnum, Tag, TagsEn
6
8
  import "./registry-utils.js";
7
9
  import { PolicyRef } from "./policy/spec.js";
8
10
  import "./telemetry/index.js";
9
- import { CapabilityKind, CapabilityMeta, CapabilityRef, CapabilityRequirement, CapabilitySpec, CapabilitySurface, CapabilitySurfaceRef } from "./capabilities/capabilities.js";
10
- import "./capabilities/index.js";
11
- import { ExperimentRef } from "./experiments/spec.js";
12
11
  import { ResourceRefDescriptor } from "./resources.js";
13
12
  import { TestSpecRef } from "./tests/spec.js";
14
13
  import { EmitDecl, EmitDeclInline, EmitDeclRef, ImplementationRef, ImplementationType, OpKind, OperationSpec, OperationSpecMeta, TelemetryTrigger } from "./operations/operation.js";
15
- import "./install.js";
16
14
  import "./operations/index.js";
17
- import { DataViewRef, EventRef, FeatureModuleMeta, FeatureModuleSpec, FormRef, OpRef, PresentationRef } from "./features/types.js";
15
+ import "./install.js";
18
16
  import "./presentations/index.js";
17
+ import "./capabilities/index.js";
18
+ import { ExperimentRef } from "./experiments/spec.js";
19
+ import { DataViewRef, EventRef, FeatureModuleMeta, FeatureModuleSpec, FormRef, OpRef, PresentationRef } from "./features/types.js";
19
20
  import "./features/index.js";
20
21
  import "./data-views/index.js";
21
22
  import "./themes.js";
@@ -1,7 +1,7 @@
1
1
  import "../../schema/src/index.js";
2
2
  import "./resources.js";
3
- import "./operations/registry.js";
4
3
  import "./operations/index.js";
4
+ import "./operations/registry.js";
5
5
  import "./types.js";
6
6
  import "./events.js";
7
7
  import "zod";
@@ -1,4 +1,4 @@
1
1
  import "../../../../../schema/src/index.js";
2
- import "../../../operations/registry.js";
3
2
  import "../../../operations/index.js";
3
+ import "../../../operations/registry.js";
4
4
  import "../../../index.js";
@@ -1,4 +1,4 @@
1
1
  import "../../../../../schema/src/index.js";
2
- import "../../../operations/registry.js";
3
2
  import "../../../operations/index.js";
3
+ import "../../../operations/registry.js";
4
4
  import "../../../index.js";
@@ -1,4 +1,4 @@
1
1
  import "../../../../../schema/src/index.js";
2
- import "../../../operations/registry.js";
3
2
  import "../../../operations/index.js";
3
+ import "../../../operations/registry.js";
4
4
  import "../../../index.js";
@@ -1,4 +1,4 @@
1
1
  import "../../../schema/src/index.js";
2
- import "../operations/registry.js";
3
2
  import "../operations/index.js";
3
+ import "../operations/registry.js";
4
4
  import "../index.js";
@@ -1,4 +1,4 @@
1
1
  import "../../../schema/src/index.js";
2
- import "../operations/registry.js";
3
2
  import "../operations/index.js";
3
+ import "../operations/registry.js";
4
4
  import "../index.js";
@@ -1,6 +1,6 @@
1
1
  import "../../../schema/src/index.js";
2
- import "../operations/registry.js";
3
2
  import "../operations/index.js";
3
+ import "../operations/registry.js";
4
4
  import "../presentations/index.js";
5
5
  import "../features/index.js";
6
6
  import "../events.js";
@@ -1,5 +1,6 @@
1
1
  import { AnySchemaModel } from "../../../schema/src/SchemaModel.js";
2
2
  import "../../../schema/src/index.js";
3
+ import { CapabilityRef } from "../capabilities/capabilities.js";
3
4
  import { OwnerShipMeta } from "../ownership.js";
4
5
  import { PolicyRef } from "../policy/spec.js";
5
6
  import { ResourceRefDescriptor } from "../resources.js";
@@ -70,6 +71,11 @@ interface OperationSpecMeta extends OwnerShipMeta {
70
71
  */
71
72
  interface OperationSpec<Input extends AnySchemaModel, Output extends AnySchemaModel | ResourceRefDescriptor<boolean>, Events extends readonly EmitDecl[] | undefined = readonly EmitDecl[] | undefined> {
72
73
  meta: OperationSpecMeta;
74
+ /**
75
+ * Optional reference to the capability that provides this operation.
76
+ * Used for bidirectional linking between capabilities and operations.
77
+ */
78
+ capability?: CapabilityRef;
73
79
  io: {
74
80
  /** Zod schema for input body payload */
75
81
  input: Input | null;
@@ -1 +1 @@
1
- {"version":3,"file":"operation.d.ts","names":[],"sources":["../../../../../contracts/src/operations/operation.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAmBA;AAaA;AAUA;AAKiB,KAjCL,MAAA,GAiCmB,SAAA,GAAA,OAIpB;AAMX;AAGA;AASA;AAeiB,KAjEL,kBAAA,GAiEkB,SAAA,GAAA,WAAA,GAAA,MAAA,GAAA,MAAA,GAAA,SAAA,GAAA,MAAA,GAAA,OAAA;;;;;AAIf,UAxDE,iBAAA,CAwDF;EAGP;EAIG,IAAA,EAAA,MAAA;EAGE;EAGD,IAAA,EAjEJ,kBAiEI;EAGE;EAGF,WAAA,CAAA,EAAA,MAAA;;AA2BG,UA5FE,WAAA,CA4FF;EAKA,GAAA,EAhGR,SAgGQ,CAhGE,cAgGF,CAAA,CAAA,MAAA,CAAA;EAMH,IAAA,EAAA,MAAA;;AASE,UA3GG,cAAA,CA2GH;EAGJ,GAAA,EAAA,MAAA;EAsCU,OAAA,EAAA,MAAA;EAAiB,IAAA,EAAA,MAAA;WAhJ1B;;;;;;KAMC,QAAA,GAAW,cAAc;UAGpB,gBAAA;;;;;;;;;QAMT;;UAGS,iBAAA,SAA0B;QACnC;;;;;;;;;;;;;UAcS,4BACD,+BACC,iBAAiB,wDACR,kCACX;QAGP;;;WAIG;;aAGE;;YAGD;;cAGE;;YAGF;;aAEC;;;;;;;;;;;;;;;;;;;;;;;;eAyBE;;;;;eAKA;;;;;YAMH;;;;;;;cAQE;cACA;;UAGJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAsCU"}
1
+ {"version":3,"file":"operation.d.ts","names":[],"sources":["../../../../../contracts/src/operations/operation.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;AAoBA;AAaA;AAUA;AAKiB,KAjCL,MAAA,GAiCmB,SAAA,GAAA,OAIpB;AAMX;AAGA;AASA;AAeiB,KAjEL,kBAAA,GAiEkB,SAAA,GAAA,WAAA,GAAA,MAAA,GAAA,MAAA,GAAA,SAAA,GAAA,MAAA,GAAA,OAAA;;;;;AAIf,UAxDE,iBAAA,CAwDF;EAGP;EAMO,IAAA,EAAA,MAAA;EAIJ;EAGE,IAAA,EApEL,kBAoEK;EAGD;EAGE,WAAA,CAAA,EAAA,MAAA;;AAKD,UAzEI,WAAA,CAyEJ;EAyBE,GAAA,EAjGR,SAiGQ,CAjGE,cAiGF,CAAA,CAAA,MAAA,CAAA;EAKA,IAAA,EAAA,MAAA;;AAcD,UAhHG,cAAA,CAgHH;EACA,GAAA,EAAA,MAAA;EAGJ,OAAA,EAAA,MAAA;EAsCU,IAAA,EAAA,MAAA;EAAiB,OAAA,EAtJ1B,cAsJ0B;;;;;;KAhJzB,QAAA,GAAW,cAAc;UAGpB,gBAAA;;;;;;;;;QAMT;;UAGS,iBAAA,SAA0B;QACnC;;;;;;;;;;;;;UAcS,4BACD,+BACC,iBAAiB,wDACR,kCACX;QAGP;;;;;eAMO;;;WAIJ;;aAGE;;YAGD;;cAGE;;YAGF;;aAEC;;;;;;;;;;;;;;;;;;;;;;;;eAyBE;;;;;eAKA;;;;;YAMH;;;;;;;cAQE;cACA;;UAGJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAsCU"}
@@ -2,58 +2,161 @@ import { DocId } from "./docs/registry.js";
2
2
  import "./docs/index.js";
3
3
 
4
4
  //#region ../contracts/src/ownership.d.ts
5
+
6
+ /**
7
+ * Lifecycle stability stages for specs.
8
+ *
9
+ * Specs progress through these stages as they mature:
10
+ * - `idea`: Initial concept, not implemented
11
+ * - `in_creation`: Currently being built
12
+ * - `experimental`: Working but may change significantly
13
+ * - `beta`: Feature-complete, seeking feedback
14
+ * - `stable`: Production-ready, breaking changes require major version bump
15
+ * - `deprecated`: Scheduled for removal, use alternatives
16
+ */
5
17
  declare const StabilityEnum: {
18
+ /** Initial concept, not yet implemented. */
6
19
  readonly Idea: "idea";
20
+ /** Currently being built, not ready for use. */
7
21
  readonly InCreation: "in_creation";
22
+ /** Working but unstable, may change significantly. */
8
23
  readonly Experimental: "experimental";
24
+ /** Feature-complete, seeking feedback before stabilization. */
9
25
  readonly Beta: "beta";
26
+ /** Production-ready, follows semantic versioning. */
10
27
  readonly Stable: "stable";
28
+ /** Scheduled for removal, use alternatives. */
11
29
  readonly Deprecated: "deprecated";
12
30
  };
31
+ /** Stability level for a spec's lifecycle stage. */
13
32
  type Stability = (typeof StabilityEnum)[keyof typeof StabilityEnum];
33
+ /**
34
+ * Curated owner identifiers for business/product ownership.
35
+ *
36
+ * Used for CODEOWNERS, on-call routing, and approval workflows.
37
+ * Custom owner strings are also allowed for flexibility.
38
+ */
14
39
  declare const OwnersEnum: {
40
+ /** Core platform team. */
15
41
  readonly PlatformCore: "platform.core";
42
+ /** Sigil/auth team. */
16
43
  readonly PlatformSigil: "platform.sigil";
44
+ /** Marketplace team. */
17
45
  readonly PlatformMarketplace: "platform.marketplace";
46
+ /** Messaging/notifications team. */
18
47
  readonly PlatformMessaging: "platform.messaging";
48
+ /** Content/CMS team. */
19
49
  readonly PlatformContent: "platform.content";
50
+ /** Feature flags team. */
20
51
  readonly PlatformFeatureFlags: "platform.featureflags";
52
+ /** Finance/billing team. */
21
53
  readonly PlatformFinance: "platform.finance";
22
54
  };
55
+ /**
56
+ * Owner identifier for a spec.
57
+ * Can be a predefined OwnersEnum value or any custom string.
58
+ */
23
59
  type Owner = (typeof OwnersEnum)[keyof typeof OwnersEnum] | (string & {});
60
+ /**
61
+ * Common tags for categorizing specs.
62
+ *
63
+ * Used for search, grouping, and documentation navigation.
64
+ * Custom tag strings are also allowed for flexibility.
65
+ */
24
66
  declare const TagsEnum: {
67
+ /** Spots/locations domain. */
25
68
  readonly Spots: "spots";
69
+ /** Collectivity/community domain. */
26
70
  readonly Collectivity: "collectivity";
71
+ /** Marketplace domain. */
27
72
  readonly Marketplace: "marketplace";
73
+ /** Seller-related features. */
28
74
  readonly Sellers: "sellers";
75
+ /** Authentication features. */
29
76
  readonly Auth: "auth";
77
+ /** Login flows. */
30
78
  readonly Login: "login";
79
+ /** Signup flows. */
31
80
  readonly Signup: "signup";
81
+ /** Onboarding/guides. */
32
82
  readonly Guide: "guide";
83
+ /** Documentation. */
33
84
  readonly Docs: "docs";
85
+ /** Internationalization. */
34
86
  readonly I18n: "i18n";
87
+ /** Incident management. */
35
88
  readonly Incident: "incident";
89
+ /** Automation/workflows. */
36
90
  readonly Automation: "automation";
91
+ /** Code hygiene/maintenance. */
37
92
  readonly Hygiene: "hygiene";
38
93
  };
94
+ /**
95
+ * Tag for categorizing a spec.
96
+ * Can be a predefined TagsEnum value or any custom string.
97
+ */
39
98
  type Tag = (typeof TagsEnum)[keyof typeof TagsEnum] | (string & {});
99
+ /**
100
+ * Common metadata interface for all ContractSpec specifications.
101
+ *
102
+ * Every spec type (operations, events, presentations, etc.) extends this
103
+ * interface to provide consistent ownership, versioning, and discoverability.
104
+ *
105
+ * @example
106
+ * ```typescript
107
+ * const meta: OwnerShipMeta = {
108
+ * key: 'auth.login',
109
+ * version: '1.0.0',
110
+ * description: 'Authenticates a user with email and password',
111
+ * stability: StabilityEnum.Stable,
112
+ * owners: [OwnersEnum.PlatformSigil],
113
+ * tags: [TagsEnum.Auth, TagsEnum.Login],
114
+ * };
115
+ * ```
116
+ */
40
117
  interface OwnerShipMeta {
41
- /** Breaking changes => bump version */
118
+ /**
119
+ * Semantic version string (e.g., "1.0.0").
120
+ * Bump for breaking changes according to semver rules.
121
+ */
42
122
  version: string;
43
- /** Fully-qualified spec key (e.g., "sigil.beginSignup") */
123
+ /**
124
+ * Fully-qualified spec key (e.g., "sigil.beginSignup", "user.created").
125
+ * Must be unique within the spec type.
126
+ */
44
127
  key: string;
45
- /** Human-friendly spec title (e.g., "Signup begin") */
128
+ /**
129
+ * Human-friendly title (e.g., "Begin Signup").
130
+ * Used in documentation and UI.
131
+ */
46
132
  title?: string;
47
- /** Short human-friendly summary */
133
+ /**
134
+ * Short human-friendly summary of what this spec does.
135
+ * Should be concise (1-2 sentences).
136
+ */
48
137
  description: string;
138
+ /**
139
+ * Business domain this spec belongs to (e.g., "auth", "marketplace").
140
+ * Used for grouping and discovery.
141
+ */
49
142
  domain?: string;
50
- /** Lifecycle marker for comms & tooling */
143
+ /**
144
+ * Lifecycle stability marker.
145
+ * Indicates maturity level and change expectations.
146
+ */
51
147
  stability: Stability;
52
- /** Owners for CODEOWNERS / on-call / approvals */
148
+ /**
149
+ * Team/individual owners responsible for this spec.
150
+ * Used for CODEOWNERS, on-call routing, and approvals.
151
+ */
53
152
  owners: Owner[];
54
- /** Search tags, grouping, docs navigation */
153
+ /**
154
+ * Tags for search, grouping, and documentation navigation.
155
+ */
55
156
  tags: Tag[];
56
- /** Doc block(s) for this operation. */
157
+ /**
158
+ * Associated DocBlock identifiers for documentation linkage.
159
+ */
57
160
  docId?: DocId[];
58
161
  }
59
162
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"ownership.d.ts","names":[],"sources":["../../../../contracts/src/ownership.ts"],"sourcesContent":[],"mappings":";;;;cAIa;;;EAAA,SAAA,YAOH,EAAA,cAAA;EACE,SAAA,IAAS,EAAA,MAAA;EAGR,SAAA,MAQH,EAAA,QAAA;EACE,SAAK,UAAA,EACL,YAAyB;AAMrC,CAAA;AAeY,KAlCA,SAAA,GAkCc,CAAA,OAlCM,aAkCyB,CAAA,CAAA,MAAA,OAlCG,aAkCH,CAAA;AAIxC,cAnCJ,UAmCiB,EAAA;EAWjB,SAAA,YAAA,EAAA,eAAA;EAEH,SAAA,aAAA,EAAA,gBAAA;EAEF,SAAA,mBAAA,EAAA,sBAAA;EAGE,SAAA,iBAAA,EAAA,oBAAA;EAAK,SAAA,eAAA,EAAA,kBAAA;;;;KA5CH,KAAA,WACA,yBAAyB;cAMxB;;;;;;;;;;;;;;;KAeD,GAAA,WAAc,uBAAuB;UAIhC,aAAA;;;;;;;;;;;aAWJ;;UAEH;;QAEF;;UAGE"}
1
+ {"version":3,"file":"ownership.d.ts","names":[],"sources":["../../../../contracts/src/ownership.ts"],"sourcesContent":[],"mappings":";;;;;AA6HA;AA2BA;;;;;;;;;;cA9Ha;;;;;;;;;;;;;;;KAgBD,SAAA,WAAoB,4BAA4B;;;;;;;cAY/C;;;;;;;;;;;;;;;;;;;;KAqBD,KAAA,WACA,yBAAyB;;;;;;;cAgBxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiCD,GAAA,WAAc,uBAAuB;;;;;;;;;;;;;;;;;;;UA2BhC,aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAmCJ;;;;;UAMH;;;;QAKF;;;;UAKE"}
@@ -0,0 +1 @@
1
+ import "../operations/operation.js";
@@ -1,4 +1,6 @@
1
1
  import { PolicyRef } from "./spec.js";
2
2
  import "./registry.js";
3
3
  import "./engine.js";
4
- import "./opa-adapter.js";
4
+ import "./opa-adapter.js";
5
+ import "./guards.js";
6
+ import "./validation.js";
@@ -1,11 +1,13 @@
1
+ import { VersionedSpecRef } from "../versioning/refs.js";
1
2
  import "../ownership.js";
2
3
 
3
4
  //#region ../contracts/src/policy/spec.d.ts
4
5
 
5
- interface PolicyRef {
6
- key: string;
7
- version: string;
8
- }
6
+ /**
7
+ * Reference to a policy spec.
8
+ * Uses key and version to identify a specific policy.
9
+ */
10
+ type PolicyRef = VersionedSpecRef;
9
11
  //#endregion
10
12
  export { PolicyRef };
11
13
  //# sourceMappingURL=spec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spec.d.ts","names":[],"sources":["../../../../../contracts/src/policy/spec.ts"],"sourcesContent":[],"mappings":";;;;UAmHiB,SAAA"}
1
+ {"version":3,"file":"spec.d.ts","names":[],"sources":["../../../../../contracts/src/policy/spec.ts"],"sourcesContent":[],"mappings":";;;;;;;;;KAyHY,SAAA,GAAY"}
@@ -0,0 +1,3 @@
1
+ import "./spec.js";
2
+ import "../operations/registry.js";
3
+ import "./registry.js";
@@ -1,4 +1,5 @@
1
1
  import "../../../schema/src/index.js";
2
+ import "../capabilities/capabilities.js";
2
3
  import "../ownership.js";
3
4
 
4
5
  //#region ../contracts/src/presentations/presentations.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"presentations.d.ts","names":[],"sources":["../../../../../contracts/src/presentations/presentations.ts"],"sourcesContent":[],"mappings":";;;;;AAKY,KAAA,kBAAA,GAAkB,OAAA,GAAA,UAAA,GAAA,kBAAA,GAAA,iBAAA"}
1
+ {"version":3,"file":"presentations.d.ts","names":[],"sources":["../../../../../contracts/src/presentations/presentations.ts"],"sourcesContent":[],"mappings":";;;;;;AAMY,KAAA,kBAAA,GAAkB,OAAA,GAAA,UAAA,GAAA,kBAAA,GAAA,iBAAA"}
@@ -1,4 +1,5 @@
1
1
  import "../../resources.js";
2
2
  import "../../operations/registry.js";
3
3
  import "../../promptRegistry.js";
4
- import "./mcpTypes.js";
4
+ import "./mcpTypes.js";
5
+ import "@modelcontextprotocol/sdk/server/mcp.js";
@@ -1,11 +1,13 @@
1
+ import { OptionalVersionedSpecRef } from "../versioning/refs.js";
1
2
  import "../ownership.js";
2
3
 
3
4
  //#region ../contracts/src/tests/spec.d.ts
4
5
 
5
- interface TestSpecRef {
6
- key: string;
7
- version?: string;
8
- }
6
+ /**
7
+ * Reference to a test spec.
8
+ * Version is optional; when omitted, refers to the latest version.
9
+ */
10
+ type TestSpecRef = OptionalVersionedSpecRef;
9
11
  //#endregion
10
12
  export { TestSpecRef };
11
13
  //# sourceMappingURL=spec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spec.d.ts","names":[],"sources":["../../../../../contracts/src/tests/spec.ts"],"sourcesContent":[],"mappings":";;;;UAiFiB,WAAA"}
1
+ {"version":3,"file":"spec.d.ts","names":[],"sources":["../../../../../contracts/src/tests/spec.ts"],"sourcesContent":[],"mappings":";;;;;;;;;KAwFY,WAAA,GAAc"}
@@ -0,0 +1,47 @@
1
+ //#region ../contracts/src/versioning/refs.d.ts
2
+ /**
3
+ * Base reference types for ContractSpec versioning.
4
+ *
5
+ * Provides canonical reference types for linking between specs.
6
+ * Domain-specific refs (OpRef, EventRef, etc.) should alias these
7
+ * base types for consistency and maintainability.
8
+ *
9
+ * @module versioning/refs
10
+ */
11
+ /**
12
+ * Base reference type for versioned specs.
13
+ * Used to reference any spec by its key and version.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * const opRef: VersionedSpecRef = { key: 'auth.login', version: '1.0.0' };
18
+ * ```
19
+ */
20
+ interface VersionedSpecRef {
21
+ /** Unique key identifying the spec (e.g., "auth.login", "user.created"). */
22
+ key: string;
23
+ /** Semantic version of the spec (e.g., "1.0.0", "2.1.0"). */
24
+ version: string;
25
+ }
26
+ /**
27
+ * Base reference type for specs with optional version.
28
+ * When version is omitted, typically refers to the latest version.
29
+ *
30
+ * @example
31
+ * ```typescript
32
+ * // Reference to latest version
33
+ * const latestRef: OptionalVersionedSpecRef = { key: 'auth.login' };
34
+ *
35
+ * // Reference to specific version
36
+ * const specificRef: OptionalVersionedSpecRef = { key: 'auth.login', version: '1.0.0' };
37
+ * ```
38
+ */
39
+ interface OptionalVersionedSpecRef {
40
+ /** Unique key identifying the spec. */
41
+ key: string;
42
+ /** Optional semantic version. When omitted, refers to the latest version. */
43
+ version?: string;
44
+ }
45
+ //#endregion
46
+ export { OptionalVersionedSpecRef, VersionedSpecRef };
47
+ //# sourceMappingURL=refs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refs.d.ts","names":[],"sources":["../../../../../contracts/src/versioning/refs.ts"],"sourcesContent":[],"mappings":";;AAuBA;AAoBA;;;;;;;;;;;;;;;;UApBiB,gBAAA;;;;;;;;;;;;;;;;;;;UAoBA,wBAAA"}
@@ -0,0 +1,2 @@
1
+ import "./spec.js";
2
+ import "./state.js";
@@ -3,4 +3,6 @@ import "./spec.js";
3
3
  import "./validation.js";
4
4
  import "./state.js";
5
5
  import "./runner.js";
6
- import "./adapters/index.js";
6
+ import "./adapters/index.js";
7
+ import "./context.js";
8
+ import "./sla-monitor.js";
@@ -0,0 +1,2 @@
1
+ import "./spec.js";
2
+ import "./state.js";
@@ -1,3 +1,5 @@
1
+ import "../capabilities/capabilities.js";
1
2
  import "../operations/registry.js";
2
3
  import "./spec.js";
4
+ import "../events.js";
3
5
  import "../forms/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/lib.feature-flags",
3
- "version": "1.49.0",
3
+ "version": "1.51.0",
4
4
  "description": "Feature flags and experiments module for ContractSpec applications",
5
5
  "keywords": [
6
6
  "contractspec",
@@ -24,13 +24,13 @@
24
24
  "lint:check": "eslint src"
25
25
  },
26
26
  "dependencies": {
27
- "@contractspec/lib.schema": "1.49.0",
28
- "@contractspec/lib.contracts": "1.49.0",
27
+ "@contractspec/lib.schema": "1.51.0",
28
+ "@contractspec/lib.contracts": "1.51.0",
29
29
  "zod": "^4.3.5"
30
30
  },
31
31
  "devDependencies": {
32
- "@contractspec/tool.typescript": "1.49.0",
33
- "@contractspec/tool.tsdown": "1.49.0",
32
+ "@contractspec/tool.typescript": "1.51.0",
33
+ "@contractspec/tool.tsdown": "1.51.0",
34
34
  "typescript": "^5.9.3"
35
35
  },
36
36
  "exports": {