@contractspec/lib.contracts 1.56.1 → 1.57.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 (212) hide show
  1. package/dist/_virtual/{rolldown_runtime.js → _rolldown/runtime.js} +3 -3
  2. package/dist/app-config/app-config.contracts.d.ts +50 -50
  3. package/dist/app-config/events.d.ts +27 -27
  4. package/dist/app-config/lifecycle-contracts.d.ts +54 -54
  5. package/dist/app-config/runtime.js +3 -3
  6. package/dist/app-config/validation.js +3 -3
  7. package/dist/capabilities/capabilities.js +20 -20
  8. package/dist/capabilities/context.d.ts +0 -1
  9. package/dist/capabilities/context.js +1 -1
  10. package/dist/capabilities/guards.d.ts +0 -1
  11. package/dist/capabilities/index.d.ts +2 -1
  12. package/dist/capabilities/index.js +2 -1
  13. package/dist/capabilities/meeting-recorder.d.ts +10 -0
  14. package/dist/capabilities/meeting-recorder.js +82 -0
  15. package/dist/capabilities/validation.d.ts +0 -1
  16. package/dist/client/react/drivers/rn-reusables.d.ts +0 -1
  17. package/dist/client/react/drivers/shadcn.d.ts +0 -1
  18. package/dist/client/react/form-render.js +3 -3
  19. package/dist/contract-registry/schemas.d.ts +2 -2
  20. package/dist/data-views/registry.d.ts +0 -1
  21. package/dist/data-views/spec.d.ts +0 -1
  22. package/dist/docs/commands/docsPublish.command.d.ts +13 -13
  23. package/dist/docs/contracts.d.ts +103 -103
  24. package/dist/docs/events/docsGenerated.event.d.ts +13 -13
  25. package/dist/docs/events/docsPublished.event.d.ts +15 -15
  26. package/dist/docs/forms/docsSearch.form.d.ts +4 -4
  27. package/dist/docs/queries/contractReference.query.d.ts +47 -47
  28. package/dist/docs/queries/docsIndex.query.d.ts +57 -57
  29. package/dist/docs/tech/llm/llm-integration.docblock.d.ts +0 -1
  30. package/dist/docs/tech/mcp-endpoints.docblock.js +5 -0
  31. package/dist/events.d.ts +0 -1
  32. package/dist/examples/index.d.ts +0 -1
  33. package/dist/examples/registry.d.ts +0 -1
  34. package/dist/examples/schema.d.ts +17 -17
  35. package/dist/experiments/spec.d.ts +2 -4
  36. package/dist/features/index.d.ts +0 -1
  37. package/dist/features/types.d.ts +2 -5
  38. package/dist/forms/forms.d.ts +1 -2
  39. package/dist/forms/forms.js +1 -2
  40. package/dist/index.d.ts +42 -1
  41. package/dist/index.js +36 -1
  42. package/dist/install.d.ts +2 -5
  43. package/dist/integrations/docs/integrations.docblock.js +19 -1
  44. package/dist/integrations/index.d.ts +26 -1
  45. package/dist/integrations/index.js +20 -1
  46. package/dist/integrations/meeting-recorder/contracts/index.d.ts +10 -0
  47. package/dist/integrations/meeting-recorder/contracts/index.js +12 -0
  48. package/dist/integrations/meeting-recorder/contracts/meetings.d.ts +458 -0
  49. package/dist/integrations/meeting-recorder/contracts/meetings.js +149 -0
  50. package/dist/integrations/meeting-recorder/contracts/transcripts.d.ts +173 -0
  51. package/dist/integrations/meeting-recorder/contracts/transcripts.js +156 -0
  52. package/dist/integrations/meeting-recorder/contracts/webhooks.d.ts +92 -0
  53. package/dist/integrations/meeting-recorder/contracts/webhooks.js +82 -0
  54. package/dist/integrations/meeting-recorder/meeting-recorder.capability.d.ts +7 -0
  55. package/dist/integrations/meeting-recorder/meeting-recorder.capability.js +21 -0
  56. package/dist/integrations/meeting-recorder/meeting-recorder.feature.d.ts +11 -0
  57. package/dist/integrations/meeting-recorder/meeting-recorder.feature.js +67 -0
  58. package/dist/integrations/meeting-recorder/models.d.ts +407 -0
  59. package/dist/integrations/meeting-recorder/models.js +295 -0
  60. package/dist/integrations/meeting-recorder/telemetry.d.ts +16 -0
  61. package/dist/integrations/meeting-recorder/telemetry.js +42 -0
  62. package/dist/integrations/openbanking/contracts/accounts.d.ts +66 -66
  63. package/dist/integrations/openbanking/contracts/balances.d.ts +34 -34
  64. package/dist/integrations/openbanking/contracts/transactions.d.ts +48 -48
  65. package/dist/integrations/openbanking/models.d.ts +55 -55
  66. package/dist/integrations/operations.d.ts +102 -102
  67. package/dist/integrations/providers/analytics-reader.d.ts +107 -0
  68. package/dist/integrations/providers/analytics-reader.js +0 -0
  69. package/dist/integrations/providers/analytics-writer.d.ts +10 -0
  70. package/dist/integrations/providers/analytics-writer.js +0 -0
  71. package/dist/integrations/providers/analytics.d.ts +49 -0
  72. package/dist/integrations/providers/analytics.js +0 -0
  73. package/dist/integrations/providers/database.d.ts +15 -0
  74. package/dist/integrations/providers/database.js +0 -0
  75. package/dist/integrations/providers/fal.d.ts +8 -0
  76. package/dist/integrations/providers/fal.js +94 -0
  77. package/dist/integrations/providers/fathom.d.ts +8 -0
  78. package/dist/integrations/providers/fathom.js +114 -0
  79. package/dist/integrations/providers/fireflies.d.ts +8 -0
  80. package/dist/integrations/providers/fireflies.js +98 -0
  81. package/dist/integrations/providers/gradium.d.ts +8 -0
  82. package/dist/integrations/providers/gradium.js +92 -0
  83. package/dist/integrations/providers/granola.d.ts +8 -0
  84. package/dist/integrations/providers/granola.js +71 -0
  85. package/dist/integrations/providers/index.d.ts +19 -1
  86. package/dist/integrations/providers/index.js +13 -1
  87. package/dist/integrations/providers/jira.d.ts +8 -0
  88. package/dist/integrations/providers/jira.js +90 -0
  89. package/dist/integrations/providers/linear.d.ts +8 -0
  90. package/dist/integrations/providers/linear.js +85 -0
  91. package/dist/integrations/providers/meeting-recorder.d.ts +132 -0
  92. package/dist/integrations/providers/meeting-recorder.js +0 -0
  93. package/dist/integrations/providers/notion.d.ts +8 -0
  94. package/dist/integrations/providers/notion.js +91 -0
  95. package/dist/integrations/providers/posthog.d.ts +8 -0
  96. package/dist/integrations/providers/posthog.js +107 -0
  97. package/dist/integrations/providers/project-management.d.ts +35 -0
  98. package/dist/integrations/providers/project-management.js +0 -0
  99. package/dist/integrations/providers/registry.d.ts +0 -1
  100. package/dist/integrations/providers/registry.js +24 -0
  101. package/dist/integrations/providers/supabase-postgres.d.ts +8 -0
  102. package/dist/integrations/providers/supabase-postgres.js +73 -0
  103. package/dist/integrations/providers/supabase-vector.d.ts +8 -0
  104. package/dist/integrations/providers/supabase-vector.js +93 -0
  105. package/dist/integrations/providers/tldv.d.ts +8 -0
  106. package/dist/integrations/providers/tldv.js +98 -0
  107. package/dist/integrations/runtime.js +0 -1
  108. package/dist/integrations/spec.d.ts +1 -1
  109. package/dist/jobs/queue.d.ts +0 -1
  110. package/dist/knowledge/binding.d.ts +1 -3
  111. package/dist/knowledge/operations.d.ts +66 -66
  112. package/dist/llm/exporters.d.ts +0 -1
  113. package/dist/llm/exporters.js +0 -1
  114. package/dist/llm/prompts.d.ts +0 -1
  115. package/dist/llm/types.d.ts +0 -1
  116. package/dist/onboarding-base.d.ts +29 -29
  117. package/dist/openapi.d.ts +0 -1
  118. package/dist/operations/operation.d.ts +19 -43
  119. package/dist/operations/registry.d.ts +0 -1
  120. package/dist/operations/registry.js +2 -2
  121. package/dist/operations/report/getContractVerificationStatus.d.ts +10 -10
  122. package/dist/ownership.d.ts +41 -88
  123. package/dist/policy/guards.d.ts +0 -1
  124. package/dist/policy/guards.js +3 -3
  125. package/dist/policy/index.d.ts +0 -1
  126. package/dist/policy/validation.d.ts +0 -1
  127. package/dist/product-intent/contract-patch-intent.d.ts +103 -0
  128. package/dist/product-intent/contract-patch-intent.js +33 -0
  129. package/dist/product-intent/contract-spec-patch.d.ts +89 -0
  130. package/dist/product-intent/contract-spec-patch.js +27 -0
  131. package/dist/product-intent/evidence.d.ts +17 -0
  132. package/dist/product-intent/evidence.js +13 -0
  133. package/dist/product-intent/findings.d.ts +60 -0
  134. package/dist/product-intent/findings.js +17 -0
  135. package/dist/product-intent/impact-report.d.ts +60 -0
  136. package/dist/product-intent/impact-report.js +27 -0
  137. package/dist/product-intent/index.d.ts +16 -0
  138. package/dist/product-intent/index.js +17 -0
  139. package/dist/product-intent/insights.d.ts +65 -0
  140. package/dist/product-intent/insights.js +23 -0
  141. package/dist/product-intent/opportunity-brief.d.ts +195 -0
  142. package/dist/product-intent/opportunity-brief.js +42 -0
  143. package/dist/product-intent/problems.d.ts +62 -0
  144. package/dist/product-intent/problems.js +22 -0
  145. package/dist/product-intent/registry.d.ts +32 -0
  146. package/dist/product-intent/registry.js +49 -0
  147. package/dist/product-intent/runtime.d.ts +103 -0
  148. package/dist/product-intent/runtime.js +101 -0
  149. package/dist/product-intent/spec.d.ts +676 -0
  150. package/dist/product-intent/spec.js +53 -0
  151. package/dist/product-intent/task-pack.d.ts +101 -0
  152. package/dist/product-intent/task-pack.js +34 -0
  153. package/dist/product-intent/tickets.d.ts +70 -0
  154. package/dist/product-intent/tickets.js +24 -0
  155. package/dist/product-intent/types.d.ts +12 -0
  156. package/dist/product-intent/types.js +13 -0
  157. package/dist/product-intent/ui-wireframe.d.ts +103 -0
  158. package/dist/product-intent/ui-wireframe.js +33 -0
  159. package/dist/registry-utils.d.ts +0 -1
  160. package/dist/registry-utils.js +3 -3
  161. package/dist/resources.js +1 -1
  162. package/dist/schema-to-markdown.d.ts +0 -1
  163. package/dist/server/contracts-adapter-input.js +2 -2
  164. package/dist/server/graphql-pothos.d.ts +0 -1
  165. package/dist/server/mcp/createMcpServer.d.ts +0 -1
  166. package/dist/server/rest-express.d.ts +0 -1
  167. package/dist/server/rest-generic.js +3 -3
  168. package/dist/server/rest-next-app.d.ts +0 -1
  169. package/dist/tests/spec.d.ts +0 -1
  170. package/dist/translations/registry.d.ts +0 -1
  171. package/dist/translations/spec.d.ts +0 -1
  172. package/dist/translations/validation.d.ts +0 -1
  173. package/dist/types.d.ts +5 -12
  174. package/dist/versioning/types.d.ts +0 -1
  175. package/dist/versioning/utils.d.ts +0 -1
  176. package/dist/workflow/adapters/memory-store.d.ts +0 -1
  177. package/dist/workflow/context.d.ts +0 -1
  178. package/dist/workflow/context.js +2 -2
  179. package/dist/workflow/runner.d.ts +1 -2
  180. package/dist/workspace-config/contractsrc-schema.d.ts +0 -1
  181. package/dist/workspace-config/contractsrc-types.d.ts +1 -3
  182. package/package.json +110 -32
  183. package/dist/integrations/providers/impls/elevenlabs-voice.d.ts +0 -20
  184. package/dist/integrations/providers/impls/elevenlabs-voice.js +0 -95
  185. package/dist/integrations/providers/impls/gcs-storage.d.ts +0 -24
  186. package/dist/integrations/providers/impls/gcs-storage.js +0 -88
  187. package/dist/integrations/providers/impls/gmail-inbound.d.ts +0 -26
  188. package/dist/integrations/providers/impls/gmail-inbound.js +0 -200
  189. package/dist/integrations/providers/impls/gmail-outbound.d.ts +0 -18
  190. package/dist/integrations/providers/impls/gmail-outbound.js +0 -105
  191. package/dist/integrations/providers/impls/google-calendar.d.ts +0 -23
  192. package/dist/integrations/providers/impls/google-calendar.js +0 -154
  193. package/dist/integrations/providers/impls/index.d.ts +0 -15
  194. package/dist/integrations/providers/impls/index.js +0 -16
  195. package/dist/integrations/providers/impls/mistral-embedding.d.ts +0 -23
  196. package/dist/integrations/providers/impls/mistral-embedding.js +0 -41
  197. package/dist/integrations/providers/impls/mistral-llm.d.ts +0 -31
  198. package/dist/integrations/providers/impls/mistral-llm.js +0 -247
  199. package/dist/integrations/providers/impls/postmark-email.d.ts +0 -19
  200. package/dist/integrations/providers/impls/postmark-email.js +0 -55
  201. package/dist/integrations/providers/impls/powens-client.d.ts +0 -124
  202. package/dist/integrations/providers/impls/powens-client.js +0 -171
  203. package/dist/integrations/providers/impls/powens-openbanking.d.ts +0 -27
  204. package/dist/integrations/providers/impls/powens-openbanking.js +0 -218
  205. package/dist/integrations/providers/impls/provider-factory.d.ts +0 -26
  206. package/dist/integrations/providers/impls/provider-factory.js +0 -146
  207. package/dist/integrations/providers/impls/qdrant-vector.d.ts +0 -24
  208. package/dist/integrations/providers/impls/qdrant-vector.js +0 -69
  209. package/dist/integrations/providers/impls/stripe-payments.d.ts +0 -28
  210. package/dist/integrations/providers/impls/stripe-payments.js +0 -202
  211. package/dist/integrations/providers/impls/twilio-sms.d.ts +0 -20
  212. package/dist/integrations/providers/impls/twilio-sms.js +0 -58
@@ -7,7 +7,6 @@ import { EventSpec } from "../events.js";
7
7
  import { AnySchemaModel } from "@contractspec/lib.schema";
8
8
 
9
9
  //#region src/operations/operation.d.ts
10
-
11
10
  /**
12
11
  * Distinguishes between state-changing operations (command) and read-only operations (query).
13
12
  */
@@ -77,17 +76,11 @@ interface OperationSpec<Input extends AnySchemaModel, Output extends AnySchemaMo
77
76
  */
78
77
  capability?: CapabilityRef;
79
78
  io: {
80
- /** Zod schema for input body payload */
81
- input: Input | null;
82
- /** Zod schema for URL path parameters */
83
- params?: AnySchemaModel;
84
- /** Zod schema for query string parameters */
85
- query?: AnySchemaModel;
86
- /** Zod schema for HTTP headers */
87
- headers?: AnySchemaModel;
88
- /** Zod schema for output payload */
89
- output: Output;
90
- /** Named, typed errors this op may throw (optional) */
79
+ /** Zod schema for input body payload */input: Input | null; /** Zod schema for URL path parameters */
80
+ params?: AnySchemaModel; /** Zod schema for query string parameters */
81
+ query?: AnySchemaModel; /** Zod schema for HTTP headers */
82
+ headers?: AnySchemaModel; /** Zod schema for output payload */
83
+ output: Output; /** Named, typed errors this op may throw (optional) */
91
84
  errors?: Record<string, {
92
85
  description: string;
93
86
  http?: number;
@@ -96,24 +89,16 @@ interface OperationSpec<Input extends AnySchemaModel, Output extends AnySchemaMo
96
89
  }>;
97
90
  };
98
91
  policy: {
99
- /** Minimal auth category allowed to call this op */
100
- auth: 'anonymous' | 'user' | 'admin';
101
- /** Idempotency hint. Queries default true; commands default false. */
102
- idempotent?: boolean;
103
- /** Soft rate limit suggestion; adapter enforces via limiter */
92
+ /** Minimal auth category allowed to call this op */auth: 'anonymous' | 'user' | 'admin'; /** Idempotency hint. Queries default true; commands default false. */
93
+ idempotent?: boolean; /** Soft rate limit suggestion; adapter enforces via limiter */
104
94
  rateLimit?: {
105
95
  rpm: number;
106
96
  key: 'user' | 'org' | 'global';
107
- };
108
- /** Feature flags that must be ON for this op to run */
109
- flags?: string[];
110
- /** Whether a human must approve before action (e.g., risky commands) */
111
- escalate?: 'human_review' | null;
112
- /** JSONPath-like pointers to redact from logs/prompts */
113
- pii?: string[];
114
- /** Referenced policy specs governing access */
115
- policies?: PolicyRef[];
116
- /** Field-level overrides referencing policy specs */
97
+ }; /** Feature flags that must be ON for this op to run */
98
+ flags?: string[]; /** Whether a human must approve before action (e.g., risky commands) */
99
+ escalate?: 'human_review' | null; /** JSONPath-like pointers to redact from logs/prompts */
100
+ pii?: string[]; /** Referenced policy specs governing access */
101
+ policies?: PolicyRef[]; /** Field-level overrides referencing policy specs */
117
102
  fieldPolicies?: {
118
103
  field: string;
119
104
  actions: ('read' | 'write')[];
@@ -121,11 +106,8 @@ interface OperationSpec<Input extends AnySchemaModel, Output extends AnySchemaMo
121
106
  }[];
122
107
  };
123
108
  sideEffects?: {
124
- /** Declared events this op may emit; runtime will guard against others */
125
- emits?: Events;
126
- /** Analytics intents (names); the service decides the sink */
127
- analytics?: string[];
128
- /** Audit intents (labels); the service decides storage */
109
+ /** Declared events this op may emit; runtime will guard against others */emits?: Events; /** Analytics intents (names); the service decides the sink */
110
+ analytics?: string[]; /** Audit intents (labels); the service decides storage */
129
111
  audit?: string[];
130
112
  };
131
113
  telemetry?: {
@@ -135,30 +117,24 @@ interface OperationSpec<Input extends AnySchemaModel, Output extends AnySchemaMo
135
117
  tests?: TestSpecRef[];
136
118
  transport?: {
137
119
  rest?: {
138
- /** Override HTTP method (default: POST for commands, GET for queries) */
139
- method?: 'GET' | 'POST';
140
- /** Override path (default derived from meta.name/version) */
120
+ /** Override HTTP method (default: POST for commands, GET for queries) */method?: 'GET' | 'POST'; /** Override path (default derived from meta.name/version) */
141
121
  path?: string;
142
122
  };
143
123
  gql?: {
144
- /** Override field name (default: dots→underscores + _vN) */
145
- field?: string;
124
+ /** Override field name (default: dots→underscores + _vN) */field?: string;
146
125
  returns?: string;
147
126
  };
148
127
  mcp?: {
149
- /** Override tool identifier (default: "<name>.v<version>") */
150
- toolName?: string;
128
+ /** Override tool identifier (default: "<name>.v<version>") */toolName?: string;
151
129
  };
152
130
  };
153
131
  acceptance?: {
154
- /** Gherkin-lite scenarios for docs & auto tests */
155
- scenarios?: {
132
+ /** Gherkin-lite scenarios for docs & auto tests */scenarios?: {
156
133
  key: string;
157
134
  given: string[];
158
135
  when: string[];
159
136
  then: string[];
160
- }[];
161
- /** Request/response examples (used for docs & snapshot tests) */
137
+ }[]; /** Request/response examples (used for docs & snapshot tests) */
162
138
  examples?: {
163
139
  key: string;
164
140
  input: unknown;
@@ -6,7 +6,6 @@ import { HandlerCtx } from "../types.js";
6
6
  import { AnySchemaModel } from "@contractspec/lib.schema";
7
7
 
8
8
  //#region src/operations/registry.d.ts
9
-
10
9
  type OperationKey = `${string}.v${string}`;
11
10
  declare function opKey(key: string, version: string): OperationKey;
12
11
  type AnyOperationHandler = (args: unknown, ctx: HandlerCtx) => Promise<unknown>;
@@ -104,9 +104,9 @@ var OperationSpecRegistry = class extends SpecContractRegistry {
104
104
  });
105
105
  if (decision.effect === "deny") throw new Error(`PolicyDenied: ${spec.meta.key}.v${spec.meta.version}`);
106
106
  if (decision.rateLimit && ctx.rateLimit) {
107
- const key$1 = decision.rateLimit.key ?? "default";
107
+ const key = decision.rateLimit.key ?? "default";
108
108
  const rpm = decision.rateLimit.rpm ?? 60;
109
- await ctx.rateLimit(key$1, 1, rpm);
109
+ await ctx.rateLimit(key, 1, rpm);
110
110
  }
111
111
  }
112
112
  const allowedEvents = /* @__PURE__ */ new Map();
@@ -1,6 +1,6 @@
1
1
  import { OperationSpec } from "../operation.js";
2
2
  import "../index.js";
3
- import * as _contractspec_lib_schema536 from "@contractspec/lib.schema";
3
+ import * as _contractspec_lib_schema0 from "@contractspec/lib.schema";
4
4
  import { SchemaModel, ZodSchemaType } from "@contractspec/lib.schema";
5
5
  import * as z$2 from "zod";
6
6
 
@@ -10,34 +10,34 @@ import * as z$2 from "zod";
10
10
  */
11
11
  declare const ContractVerificationStatusModel: SchemaModel<{
12
12
  name: {
13
- type: _contractspec_lib_schema536.FieldType<string, string>;
13
+ type: _contractspec_lib_schema0.FieldType<string, string>;
14
14
  isOptional: false;
15
15
  };
16
16
  lastVerifiedSha: {
17
- type: _contractspec_lib_schema536.FieldType<string, string>;
17
+ type: _contractspec_lib_schema0.FieldType<string, string>;
18
18
  isOptional: true;
19
19
  };
20
20
  lastVerifiedDate: {
21
- type: _contractspec_lib_schema536.FieldType<string, string>;
21
+ type: _contractspec_lib_schema0.FieldType<string, string>;
22
22
  isOptional: true;
23
23
  };
24
24
  surfaces: {
25
- type: _contractspec_lib_schema536.FieldType<string, string>;
25
+ type: _contractspec_lib_schema0.FieldType<string, string>;
26
26
  isOptional: false;
27
27
  isArray: true;
28
28
  };
29
29
  driftMismatches: {
30
- type: _contractspec_lib_schema536.FieldType<number, number>;
30
+ type: _contractspec_lib_schema0.FieldType<number, number>;
31
31
  isOptional: false;
32
32
  };
33
33
  }>;
34
34
  declare const GetContractVerificationStatusInput: SchemaModel<{
35
35
  projectPath: {
36
- type: _contractspec_lib_schema536.FieldType<string, string>;
36
+ type: _contractspec_lib_schema0.FieldType<string, string>;
37
37
  isOptional: false;
38
38
  };
39
39
  baseline: {
40
- type: _contractspec_lib_schema536.FieldType<string, string>;
40
+ type: _contractspec_lib_schema0.FieldType<string, string>;
41
41
  isOptional: true;
42
42
  };
43
43
  }>;
@@ -55,11 +55,11 @@ declare const GetContractVerificationStatusOutput: ZodSchemaType<z$2.ZodObject<{
55
55
  */
56
56
  declare const GetContractVerificationStatusQuery: OperationSpec<SchemaModel<{
57
57
  projectPath: {
58
- type: _contractspec_lib_schema536.FieldType<string, string>;
58
+ type: _contractspec_lib_schema0.FieldType<string, string>;
59
59
  isOptional: false;
60
60
  };
61
61
  baseline: {
62
- type: _contractspec_lib_schema536.FieldType<string, string>;
62
+ type: _contractspec_lib_schema0.FieldType<string, string>;
63
63
  isOptional: true;
64
64
  };
65
65
  }>, ZodSchemaType<z$2.ZodObject<{
@@ -2,7 +2,6 @@ import { DocId } from "./docs/registry.js";
2
2
  import "./docs/index.js";
3
3
 
4
4
  //#region src/ownership.d.ts
5
-
6
5
  /**
7
6
  * Lifecycle stability stages for specs.
8
7
  *
@@ -15,17 +14,11 @@ import "./docs/index.js";
15
14
  * - `deprecated`: Scheduled for removal, use alternatives
16
15
  */
17
16
  declare const StabilityEnum: {
18
- /** Initial concept, not yet implemented. */
19
- readonly Idea: "idea";
20
- /** Currently being built, not ready for use. */
21
- readonly InCreation: "in_creation";
22
- /** Working but unstable, may change significantly. */
23
- readonly Experimental: "experimental";
24
- /** Feature-complete, seeking feedback before stabilization. */
25
- readonly Beta: "beta";
26
- /** Production-ready, follows semantic versioning. */
27
- readonly Stable: "stable";
28
- /** Scheduled for removal, use alternatives. */
17
+ /** Initial concept, not yet implemented. */readonly Idea: "idea"; /** Currently being built, not ready for use. */
18
+ readonly InCreation: "in_creation"; /** Working but unstable, may change significantly. */
19
+ readonly Experimental: "experimental"; /** Feature-complete, seeking feedback before stabilization. */
20
+ readonly Beta: "beta"; /** Production-ready, follows semantic versioning. */
21
+ readonly Stable: "stable"; /** Scheduled for removal, use alternatives. */
29
22
  readonly Deprecated: "deprecated";
30
23
  };
31
24
  /** Stability level for a spec's lifecycle stage. */
@@ -37,19 +30,12 @@ type Stability = (typeof StabilityEnum)[keyof typeof StabilityEnum];
37
30
  * Custom owner strings are also allowed for flexibility.
38
31
  */
39
32
  declare const OwnersEnum: {
40
- /** Core platform team. */
41
- readonly PlatformCore: "platform.core";
42
- /** Sigil/auth team. */
43
- readonly PlatformSigil: "platform.sigil";
44
- /** Marketplace team. */
45
- readonly PlatformMarketplace: "platform.marketplace";
46
- /** Messaging/notifications team. */
47
- readonly PlatformMessaging: "platform.messaging";
48
- /** Content/CMS team. */
49
- readonly PlatformContent: "platform.content";
50
- /** Feature flags team. */
51
- readonly PlatformFeatureFlags: "platform.featureflags";
52
- /** Finance/billing team. */
33
+ /** Core platform team. */readonly PlatformCore: "platform.core"; /** Sigil/auth team. */
34
+ readonly PlatformSigil: "platform.sigil"; /** Marketplace team. */
35
+ readonly PlatformMarketplace: "platform.marketplace"; /** Messaging/notifications team. */
36
+ readonly PlatformMessaging: "platform.messaging"; /** Content/CMS team. */
37
+ readonly PlatformContent: "platform.content"; /** Feature flags team. */
38
+ readonly PlatformFeatureFlags: "platform.featureflags"; /** Finance/billing team. */
53
39
  readonly PlatformFinance: "platform.finance";
54
40
  };
55
41
  /**
@@ -59,19 +45,12 @@ declare const OwnersEnum: {
59
45
  type Owner = (typeof OwnersEnum)[keyof typeof OwnersEnum] | (string & {});
60
46
  /** @deprecated Use OwnersEnum instead. */
61
47
  declare const Owners: {
62
- /** Core platform team. */
63
- readonly PlatformCore: "platform.core";
64
- /** Sigil/auth team. */
65
- readonly PlatformSigil: "platform.sigil";
66
- /** Marketplace team. */
67
- readonly PlatformMarketplace: "platform.marketplace";
68
- /** Messaging/notifications team. */
69
- readonly PlatformMessaging: "platform.messaging";
70
- /** Content/CMS team. */
71
- readonly PlatformContent: "platform.content";
72
- /** Feature flags team. */
73
- readonly PlatformFeatureFlags: "platform.featureflags";
74
- /** Finance/billing team. */
48
+ /** Core platform team. */readonly PlatformCore: "platform.core"; /** Sigil/auth team. */
49
+ readonly PlatformSigil: "platform.sigil"; /** Marketplace team. */
50
+ readonly PlatformMarketplace: "platform.marketplace"; /** Messaging/notifications team. */
51
+ readonly PlatformMessaging: "platform.messaging"; /** Content/CMS team. */
52
+ readonly PlatformContent: "platform.content"; /** Feature flags team. */
53
+ readonly PlatformFeatureFlags: "platform.featureflags"; /** Finance/billing team. */
75
54
  readonly PlatformFinance: "platform.finance";
76
55
  };
77
56
  /**
@@ -81,31 +60,18 @@ declare const Owners: {
81
60
  * Custom tag strings are also allowed for flexibility.
82
61
  */
83
62
  declare const TagsEnum: {
84
- /** Spots/locations domain. */
85
- readonly Spots: "spots";
86
- /** Collectivity/community domain. */
87
- readonly Collectivity: "collectivity";
88
- /** Marketplace domain. */
89
- readonly Marketplace: "marketplace";
90
- /** Seller-related features. */
91
- readonly Sellers: "sellers";
92
- /** Authentication features. */
93
- readonly Auth: "auth";
94
- /** Login flows. */
95
- readonly Login: "login";
96
- /** Signup flows. */
97
- readonly Signup: "signup";
98
- /** Onboarding/guides. */
99
- readonly Guide: "guide";
100
- /** Documentation. */
101
- readonly Docs: "docs";
102
- /** Internationalization. */
103
- readonly I18n: "i18n";
104
- /** Incident management. */
105
- readonly Incident: "incident";
106
- /** Automation/workflows. */
107
- readonly Automation: "automation";
108
- /** Code hygiene/maintenance. */
63
+ /** Spots/locations domain. */readonly Spots: "spots"; /** Collectivity/community domain. */
64
+ readonly Collectivity: "collectivity"; /** Marketplace domain. */
65
+ readonly Marketplace: "marketplace"; /** Seller-related features. */
66
+ readonly Sellers: "sellers"; /** Authentication features. */
67
+ readonly Auth: "auth"; /** Login flows. */
68
+ readonly Login: "login"; /** Signup flows. */
69
+ readonly Signup: "signup"; /** Onboarding/guides. */
70
+ readonly Guide: "guide"; /** Documentation. */
71
+ readonly Docs: "docs"; /** Internationalization. */
72
+ readonly I18n: "i18n"; /** Incident management. */
73
+ readonly Incident: "incident"; /** Automation/workflows. */
74
+ readonly Automation: "automation"; /** Code hygiene/maintenance. */
109
75
  readonly Hygiene: "hygiene";
110
76
  };
111
77
  /**
@@ -115,31 +81,18 @@ declare const TagsEnum: {
115
81
  type Tag = (typeof TagsEnum)[keyof typeof TagsEnum] | (string & {});
116
82
  /** @deprecated Use TagsEnum instead. */
117
83
  declare const Tags: {
118
- /** Spots/locations domain. */
119
- readonly Spots: "spots";
120
- /** Collectivity/community domain. */
121
- readonly Collectivity: "collectivity";
122
- /** Marketplace domain. */
123
- readonly Marketplace: "marketplace";
124
- /** Seller-related features. */
125
- readonly Sellers: "sellers";
126
- /** Authentication features. */
127
- readonly Auth: "auth";
128
- /** Login flows. */
129
- readonly Login: "login";
130
- /** Signup flows. */
131
- readonly Signup: "signup";
132
- /** Onboarding/guides. */
133
- readonly Guide: "guide";
134
- /** Documentation. */
135
- readonly Docs: "docs";
136
- /** Internationalization. */
137
- readonly I18n: "i18n";
138
- /** Incident management. */
139
- readonly Incident: "incident";
140
- /** Automation/workflows. */
141
- readonly Automation: "automation";
142
- /** Code hygiene/maintenance. */
84
+ /** Spots/locations domain. */readonly Spots: "spots"; /** Collectivity/community domain. */
85
+ readonly Collectivity: "collectivity"; /** Marketplace domain. */
86
+ readonly Marketplace: "marketplace"; /** Seller-related features. */
87
+ readonly Sellers: "sellers"; /** Authentication features. */
88
+ readonly Auth: "auth"; /** Login flows. */
89
+ readonly Login: "login"; /** Signup flows. */
90
+ readonly Signup: "signup"; /** Onboarding/guides. */
91
+ readonly Guide: "guide"; /** Documentation. */
92
+ readonly Docs: "docs"; /** Internationalization. */
93
+ readonly I18n: "i18n"; /** Incident management. */
94
+ readonly Incident: "incident"; /** Automation/workflows. */
95
+ readonly Automation: "automation"; /** Code hygiene/maintenance. */
143
96
  readonly Hygiene: "hygiene";
144
97
  };
145
98
  /**
@@ -2,7 +2,6 @@ import { AnyOperationSpec } from "../operations/operation.js";
2
2
  import { PolicyContext } from "./context.js";
3
3
 
4
4
  //#region src/policy/guards.d.ts
5
-
6
5
  /** Result of a policy guard check. */
7
6
  interface PolicyGuardResult {
8
7
  /** Whether the guard passed. */
@@ -66,10 +66,10 @@ function checkPolicyForOperation(ctx, operation, flags = []) {
66
66
  function assertPolicyForOperation(ctx, operation, flags = []) {
67
67
  const result = checkPolicyForOperation(ctx, operation, flags);
68
68
  if (!result.allowed) {
69
- const operationName$1 = `${operation.meta.key}.v${operation.meta.version}`;
70
- ctx.auditAccess(operationName$1, "denied", result.reason);
69
+ const operationName = `${operation.meta.key}.v${operation.meta.version}`;
70
+ ctx.auditAccess(operationName, "denied", result.reason);
71
71
  throw new PolicyViolationError("access_denied", {
72
- operation: operationName$1,
72
+ operation: operationName,
73
73
  reason: result.reason
74
74
  });
75
75
  }
@@ -7,7 +7,6 @@ import { CombinedPolicyRequirements, PolicyGuardResult, assertCombinedPolicy, as
7
7
  import { PolicyConsistencyDeps, PolicyValidationError, PolicyValidationIssue, PolicyValidationLevel, PolicyValidationResult, assertPolicyConsistency, assertPolicySpecValid, validatePolicyConsistency, validatePolicySpec } from "./validation.js";
8
8
 
9
9
  //#region src/policy/index.d.ts
10
-
11
10
  /**
12
11
  * Helper to define a Policy.
13
12
  */
@@ -3,7 +3,6 @@ import { PolicyRegistry } from "./registry.js";
3
3
  import { OperationSpecRegistry } from "../operations/registry.js";
4
4
 
5
5
  //#region src/policy/validation.d.ts
6
-
7
6
  type PolicyValidationLevel = 'error' | 'warning' | 'info';
8
7
  interface PolicyValidationIssue {
9
8
  level: PolicyValidationLevel;
@@ -0,0 +1,103 @@
1
+ import { ZodSchemaType } from "@contractspec/lib.schema";
2
+ import * as z$2 from "zod";
3
+
4
+ //#region src/product-intent/contract-patch-intent.d.ts
5
+ declare const PatchChangeTypeSchema: z$2.ZodEnum<{
6
+ other: "other";
7
+ add_field: "add_field";
8
+ remove_field: "remove_field";
9
+ rename_field: "rename_field";
10
+ add_event: "add_event";
11
+ update_event: "update_event";
12
+ add_operation: "add_operation";
13
+ update_operation: "update_operation";
14
+ update_form: "update_form";
15
+ update_policy: "update_policy";
16
+ add_enum_value: "add_enum_value";
17
+ remove_enum_value: "remove_enum_value";
18
+ }>;
19
+ type PatchChangeType = z$2.infer<typeof PatchChangeTypeSchema>;
20
+ declare const PatchChangeSchema: z$2.ZodObject<{
21
+ type: z$2.ZodEnum<{
22
+ other: "other";
23
+ add_field: "add_field";
24
+ remove_field: "remove_field";
25
+ rename_field: "rename_field";
26
+ add_event: "add_event";
27
+ update_event: "update_event";
28
+ add_operation: "add_operation";
29
+ update_operation: "update_operation";
30
+ update_form: "update_form";
31
+ update_policy: "update_policy";
32
+ add_enum_value: "add_enum_value";
33
+ remove_enum_value: "remove_enum_value";
34
+ }>;
35
+ target: z$2.ZodString;
36
+ detail: z$2.ZodString;
37
+ }, z$2.core.$strip>;
38
+ declare const PatchChangeModel: ZodSchemaType<z$2.ZodObject<{
39
+ type: z$2.ZodEnum<{
40
+ other: "other";
41
+ add_field: "add_field";
42
+ remove_field: "remove_field";
43
+ rename_field: "rename_field";
44
+ add_event: "add_event";
45
+ update_event: "update_event";
46
+ add_operation: "add_operation";
47
+ update_operation: "update_operation";
48
+ update_form: "update_form";
49
+ update_policy: "update_policy";
50
+ add_enum_value: "add_enum_value";
51
+ remove_enum_value: "remove_enum_value";
52
+ }>;
53
+ target: z$2.ZodString;
54
+ detail: z$2.ZodString;
55
+ }, z$2.core.$strip>>;
56
+ type PatchChange = z$2.infer<typeof PatchChangeSchema>;
57
+ declare const ContractPatchIntentSchema: z$2.ZodObject<{
58
+ featureKey: z$2.ZodString;
59
+ changes: z$2.ZodArray<z$2.ZodObject<{
60
+ type: z$2.ZodEnum<{
61
+ other: "other";
62
+ add_field: "add_field";
63
+ remove_field: "remove_field";
64
+ rename_field: "rename_field";
65
+ add_event: "add_event";
66
+ update_event: "update_event";
67
+ add_operation: "add_operation";
68
+ update_operation: "update_operation";
69
+ update_form: "update_form";
70
+ update_policy: "update_policy";
71
+ add_enum_value: "add_enum_value";
72
+ remove_enum_value: "remove_enum_value";
73
+ }>;
74
+ target: z$2.ZodString;
75
+ detail: z$2.ZodString;
76
+ }, z$2.core.$strip>>;
77
+ acceptanceCriteria: z$2.ZodArray<z$2.ZodString>;
78
+ }, z$2.core.$strip>;
79
+ declare const ContractPatchIntentModel: ZodSchemaType<z$2.ZodObject<{
80
+ featureKey: z$2.ZodString;
81
+ changes: z$2.ZodArray<z$2.ZodObject<{
82
+ type: z$2.ZodEnum<{
83
+ other: "other";
84
+ add_field: "add_field";
85
+ remove_field: "remove_field";
86
+ rename_field: "rename_field";
87
+ add_event: "add_event";
88
+ update_event: "update_event";
89
+ add_operation: "add_operation";
90
+ update_operation: "update_operation";
91
+ update_form: "update_form";
92
+ update_policy: "update_policy";
93
+ add_enum_value: "add_enum_value";
94
+ remove_enum_value: "remove_enum_value";
95
+ }>;
96
+ target: z$2.ZodString;
97
+ detail: z$2.ZodString;
98
+ }, z$2.core.$strip>>;
99
+ acceptanceCriteria: z$2.ZodArray<z$2.ZodString>;
100
+ }, z$2.core.$strip>>;
101
+ type ContractPatchIntent = z$2.infer<typeof ContractPatchIntentSchema>;
102
+ //#endregion
103
+ export { ContractPatchIntent, ContractPatchIntentModel, PatchChange, PatchChangeModel, PatchChangeType };
@@ -0,0 +1,33 @@
1
+ import { ZodSchemaType } from "@contractspec/lib.schema";
2
+ import * as z$2 from "zod";
3
+
4
+ //#region src/product-intent/contract-patch-intent.ts
5
+ const PatchChangeTypeSchema = z$2.enum([
6
+ "add_field",
7
+ "remove_field",
8
+ "rename_field",
9
+ "add_event",
10
+ "update_event",
11
+ "add_operation",
12
+ "update_operation",
13
+ "update_form",
14
+ "update_policy",
15
+ "add_enum_value",
16
+ "remove_enum_value",
17
+ "other"
18
+ ]);
19
+ const PatchChangeSchema = z$2.object({
20
+ type: PatchChangeTypeSchema,
21
+ target: z$2.string().min(1),
22
+ detail: z$2.string().min(1)
23
+ });
24
+ const PatchChangeModel = new ZodSchemaType(PatchChangeSchema, { name: "PatchChange" });
25
+ const ContractPatchIntentSchema = z$2.object({
26
+ featureKey: z$2.string().min(1),
27
+ changes: z$2.array(PatchChangeSchema),
28
+ acceptanceCriteria: z$2.array(z$2.string().min(1))
29
+ });
30
+ const ContractPatchIntentModel = new ZodSchemaType(ContractPatchIntentSchema, { name: "ContractPatchIntent" });
31
+
32
+ //#endregion
33
+ export { ContractPatchIntentModel, PatchChangeModel };
@@ -0,0 +1,89 @@
1
+ import { ZodSchemaType } from "@contractspec/lib.schema";
2
+ import * as z$2 from "zod";
3
+
4
+ //#region src/product-intent/contract-spec-patch.d.ts
5
+ declare const ContractPatchAddSchema: z$2.ZodObject<{
6
+ path: z$2.ZodString;
7
+ value: z$2.ZodUnknown;
8
+ }, z$2.core.$strip>;
9
+ declare const ContractPatchAddModel: ZodSchemaType<z$2.ZodObject<{
10
+ path: z$2.ZodString;
11
+ value: z$2.ZodUnknown;
12
+ }, z$2.core.$strip>>;
13
+ type ContractPatchAdd = z$2.infer<typeof ContractPatchAddSchema>;
14
+ declare const ContractPatchUpdateSchema: z$2.ZodObject<{
15
+ path: z$2.ZodString;
16
+ value: z$2.ZodUnknown;
17
+ }, z$2.core.$strip>;
18
+ declare const ContractPatchUpdateModel: ZodSchemaType<z$2.ZodObject<{
19
+ path: z$2.ZodString;
20
+ value: z$2.ZodUnknown;
21
+ }, z$2.core.$strip>>;
22
+ type ContractPatchUpdate = z$2.infer<typeof ContractPatchUpdateSchema>;
23
+ declare const ContractPatchRemoveSchema: z$2.ZodObject<{
24
+ path: z$2.ZodString;
25
+ }, z$2.core.$strip>;
26
+ declare const ContractPatchRemoveModel: ZodSchemaType<z$2.ZodObject<{
27
+ path: z$2.ZodString;
28
+ }, z$2.core.$strip>>;
29
+ type ContractPatchRemove = z$2.infer<typeof ContractPatchRemoveSchema>;
30
+ declare const ContractSpecOverlaySchema: z$2.ZodObject<{
31
+ adds: z$2.ZodOptional<z$2.ZodArray<z$2.ZodObject<{
32
+ path: z$2.ZodString;
33
+ value: z$2.ZodUnknown;
34
+ }, z$2.core.$strip>>>;
35
+ updates: z$2.ZodOptional<z$2.ZodArray<z$2.ZodObject<{
36
+ path: z$2.ZodString;
37
+ value: z$2.ZodUnknown;
38
+ }, z$2.core.$strip>>>;
39
+ removes: z$2.ZodOptional<z$2.ZodArray<z$2.ZodObject<{
40
+ path: z$2.ZodString;
41
+ }, z$2.core.$strip>>>;
42
+ }, z$2.core.$strip>;
43
+ declare const ContractSpecOverlayModel: ZodSchemaType<z$2.ZodObject<{
44
+ adds: z$2.ZodOptional<z$2.ZodArray<z$2.ZodObject<{
45
+ path: z$2.ZodString;
46
+ value: z$2.ZodUnknown;
47
+ }, z$2.core.$strip>>>;
48
+ updates: z$2.ZodOptional<z$2.ZodArray<z$2.ZodObject<{
49
+ path: z$2.ZodString;
50
+ value: z$2.ZodUnknown;
51
+ }, z$2.core.$strip>>>;
52
+ removes: z$2.ZodOptional<z$2.ZodArray<z$2.ZodObject<{
53
+ path: z$2.ZodString;
54
+ }, z$2.core.$strip>>>;
55
+ }, z$2.core.$strip>>;
56
+ type ContractSpecOverlay = z$2.infer<typeof ContractSpecOverlaySchema>;
57
+ declare const ContractSpecPatchSchema: z$2.ZodObject<{
58
+ overlay: z$2.ZodObject<{
59
+ adds: z$2.ZodOptional<z$2.ZodArray<z$2.ZodObject<{
60
+ path: z$2.ZodString;
61
+ value: z$2.ZodUnknown;
62
+ }, z$2.core.$strip>>>;
63
+ updates: z$2.ZodOptional<z$2.ZodArray<z$2.ZodObject<{
64
+ path: z$2.ZodString;
65
+ value: z$2.ZodUnknown;
66
+ }, z$2.core.$strip>>>;
67
+ removes: z$2.ZodOptional<z$2.ZodArray<z$2.ZodObject<{
68
+ path: z$2.ZodString;
69
+ }, z$2.core.$strip>>>;
70
+ }, z$2.core.$strip>;
71
+ }, z$2.core.$strip>;
72
+ declare const ContractSpecPatchModel: ZodSchemaType<z$2.ZodObject<{
73
+ overlay: z$2.ZodObject<{
74
+ adds: z$2.ZodOptional<z$2.ZodArray<z$2.ZodObject<{
75
+ path: z$2.ZodString;
76
+ value: z$2.ZodUnknown;
77
+ }, z$2.core.$strip>>>;
78
+ updates: z$2.ZodOptional<z$2.ZodArray<z$2.ZodObject<{
79
+ path: z$2.ZodString;
80
+ value: z$2.ZodUnknown;
81
+ }, z$2.core.$strip>>>;
82
+ removes: z$2.ZodOptional<z$2.ZodArray<z$2.ZodObject<{
83
+ path: z$2.ZodString;
84
+ }, z$2.core.$strip>>>;
85
+ }, z$2.core.$strip>;
86
+ }, z$2.core.$strip>>;
87
+ type ContractSpecPatch = z$2.infer<typeof ContractSpecPatchSchema>;
88
+ //#endregion
89
+ export { ContractPatchAdd, ContractPatchAddModel, ContractPatchRemove, ContractPatchRemoveModel, ContractPatchUpdate, ContractPatchUpdateModel, ContractSpecOverlay, ContractSpecOverlayModel, ContractSpecPatch, ContractSpecPatchModel };