@contractspec/lib.contracts 0.0.0-canary-20260119225944 → 0.0.0-canary-20260202053150

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 (166) hide show
  1. package/dist/app-config/{contracts.d.ts → app-config.contracts.d.ts} +52 -52
  2. package/dist/app-config/{contracts.js → app-config.contracts.js} +1 -1
  3. package/dist/app-config/lifecycle-contracts.d.ts +55 -55
  4. package/dist/app-config/runtime.d.ts +4 -4
  5. package/dist/app-config/spec.d.ts +2 -2
  6. package/dist/capabilities/capabilities.d.ts +64 -5
  7. package/dist/capabilities/capabilities.js +125 -0
  8. package/dist/capabilities/context.d.ts +88 -0
  9. package/dist/capabilities/context.js +87 -0
  10. package/dist/capabilities/docs/capabilities.docblock.js +191 -2
  11. package/dist/capabilities/guards.d.ts +110 -0
  12. package/dist/capabilities/guards.js +146 -0
  13. package/dist/capabilities/index.d.ts +4 -1
  14. package/dist/capabilities/index.js +4 -1
  15. package/dist/capabilities/validation.d.ts +76 -0
  16. package/dist/capabilities/validation.js +141 -0
  17. package/dist/client/react/feature-render.d.ts +2 -2
  18. package/dist/data-views/data-views.d.ts +2 -1
  19. package/dist/data-views/index.d.ts +2 -1
  20. package/dist/data-views/registry.d.ts +1 -1
  21. package/dist/data-views/report/contractVerificationTable.d.ts +10 -0
  22. package/dist/data-views/report/contractVerificationTable.js +95 -0
  23. package/dist/data-views/runtime.d.ts +2 -2
  24. package/dist/data-views/spec.d.ts +2 -8
  25. package/dist/data-views/types.d.ts +1 -1
  26. package/dist/docs/capabilities/documentationSystem.capability.d.ts +7 -0
  27. package/dist/docs/capabilities/documentationSystem.capability.js +71 -0
  28. package/dist/docs/capabilities/index.d.ts +2 -0
  29. package/dist/docs/capabilities/index.js +3 -0
  30. package/dist/docs/commands/docsGenerate.command.d.ts +95 -0
  31. package/dist/docs/commands/docsGenerate.command.js +142 -0
  32. package/dist/docs/commands/docsPublish.command.d.ts +64 -0
  33. package/dist/docs/commands/docsPublish.command.js +107 -0
  34. package/dist/docs/commands/index.d.ts +3 -0
  35. package/dist/docs/commands/index.js +4 -0
  36. package/dist/docs/constants.d.ts +7 -0
  37. package/dist/docs/constants.js +10 -0
  38. package/dist/docs/contracts.d.ts +442 -0
  39. package/dist/docs/contracts.js +58 -0
  40. package/dist/docs/ensure-docblocks.d.ts +1 -0
  41. package/dist/docs/ensure-docblocks.js +1 -0
  42. package/dist/docs/events/docsGenerated.event.d.ts +62 -0
  43. package/dist/docs/events/docsGenerated.event.js +53 -0
  44. package/dist/docs/events/docsPublished.event.d.ts +70 -0
  45. package/dist/docs/events/docsPublished.event.js +57 -0
  46. package/dist/docs/events/index.d.ts +3 -0
  47. package/dist/docs/events/index.js +4 -0
  48. package/dist/docs/forms/docsSearch.form.d.ts +22 -0
  49. package/dist/docs/forms/docsSearch.form.js +113 -0
  50. package/dist/docs/forms/index.d.ts +2 -0
  51. package/dist/docs/forms/index.js +3 -0
  52. package/dist/docs/index.d.ts +23 -2
  53. package/dist/docs/index.js +25 -1
  54. package/dist/docs/presentations/docsLayout.presentation.d.ts +7 -0
  55. package/dist/docs/presentations/docsLayout.presentation.js +35 -0
  56. package/dist/docs/presentations/docsReferencePage.presentation.d.ts +7 -0
  57. package/dist/docs/presentations/docsReferencePage.presentation.js +35 -0
  58. package/dist/docs/presentations/index.d.ts +3 -0
  59. package/dist/docs/presentations/index.js +4 -0
  60. package/dist/docs/queries/contractReference.query.d.ts +217 -0
  61. package/dist/docs/queries/contractReference.query.js +125 -0
  62. package/dist/docs/queries/docsIndex.query.d.ts +272 -0
  63. package/dist/docs/queries/docsIndex.query.js +133 -0
  64. package/dist/docs/queries/index.d.ts +3 -0
  65. package/dist/docs/queries/index.js +4 -0
  66. package/dist/docs/tech/cli.docblock.js +10 -0
  67. package/dist/docs/tech/docs-system.docblock.d.ts +1 -0
  68. package/dist/docs/tech/docs-system.docblock.js +128 -0
  69. package/dist/docs/tech/report-verification-table.docblock.d.ts +1 -0
  70. package/dist/docs/tech/report-verification-table.docblock.js +50 -0
  71. package/dist/docs/views/contractReference.dataView.d.ts +7 -0
  72. package/dist/docs/views/contractReference.dataView.js +80 -0
  73. package/dist/docs/views/docsIndex.dataView.d.ts +7 -0
  74. package/dist/docs/views/docsIndex.dataView.js +136 -0
  75. package/dist/docs/views/exampleCatalog.dataView.d.ts +7 -0
  76. package/dist/docs/views/exampleCatalog.dataView.js +91 -0
  77. package/dist/docs/views/index.d.ts +4 -0
  78. package/dist/docs/views/index.js +5 -0
  79. package/dist/events.d.ts +80 -14
  80. package/dist/events.js +33 -3
  81. package/dist/examples/schema.d.ts +12 -12
  82. package/dist/examples/types.d.ts +1 -1
  83. package/dist/experiments/spec.d.ts +9 -6
  84. package/dist/features/index.d.ts +2 -2
  85. package/dist/features/install.d.ts +4 -4
  86. package/dist/features/types.d.ts +28 -32
  87. package/dist/forms/forms.d.ts +1 -1
  88. package/dist/index.d.ts +60 -31
  89. package/dist/index.js +32 -4
  90. package/dist/install.d.ts +1 -1
  91. package/dist/integrations/openbanking/contracts/accounts.d.ts +67 -67
  92. package/dist/integrations/openbanking/contracts/balances.d.ts +35 -35
  93. package/dist/integrations/openbanking/contracts/transactions.d.ts +49 -49
  94. package/dist/integrations/openbanking/models.d.ts +55 -55
  95. package/dist/integrations/operations.d.ts +103 -103
  96. package/dist/integrations/spec.d.ts +2 -2
  97. package/dist/jsonschema.d.ts +1 -1
  98. package/dist/knowledge/operations.d.ts +67 -67
  99. package/dist/knowledge/spec.d.ts +1 -1
  100. package/dist/llm/exporters.d.ts +4 -4
  101. package/dist/llm/types.d.ts +1 -1
  102. package/dist/markdown.d.ts +2 -2
  103. package/dist/operations/index.d.ts +4 -1
  104. package/dist/operations/index.js +4 -1
  105. package/dist/operations/operation.d.ts +8 -2
  106. package/dist/operations/registry.d.ts +1 -1
  107. package/dist/operations/report/getContractVerificationStatus.d.ts +75 -0
  108. package/dist/operations/report/getContractVerificationStatus.js +96 -0
  109. package/dist/operations/report/index.d.ts +13 -0
  110. package/dist/operations/report/index.js +45 -0
  111. package/dist/ownership.d.ts +133 -8
  112. package/dist/ownership.js +25 -0
  113. package/dist/policy/context.d.ts +237 -0
  114. package/dist/policy/context.js +227 -0
  115. package/dist/policy/guards.d.ts +145 -0
  116. package/dist/policy/guards.js +254 -0
  117. package/dist/policy/index.d.ts +12 -1
  118. package/dist/policy/index.js +11 -1
  119. package/dist/policy/spec.d.ts +7 -4
  120. package/dist/policy/validation.d.ts +67 -0
  121. package/dist/policy/validation.js +307 -0
  122. package/dist/presentations/presentations.d.ts +6 -0
  123. package/dist/presentations/registry.d.ts +1 -1
  124. package/dist/registry.d.ts +1 -1
  125. package/dist/serialization/index.d.ts +3 -0
  126. package/dist/serialization/index.js +3 -0
  127. package/dist/serialization/serializers.d.ts +40 -0
  128. package/dist/serialization/serializers.js +148 -0
  129. package/dist/serialization/types.d.ts +103 -0
  130. package/dist/serialization/types.js +0 -0
  131. package/dist/server/rest-elysia.d.ts +1 -1
  132. package/dist/server/rest-express.d.ts +1 -1
  133. package/dist/server/rest-generic.d.ts +1 -1
  134. package/dist/server/rest-next-app.d.ts +1 -1
  135. package/dist/server/rest-next-mcp.d.ts +1 -1
  136. package/dist/server/rest-next-pages.d.ts +1 -1
  137. package/dist/telemetry/spec.d.ts +1 -1
  138. package/dist/telemetry/tracker.d.ts +3 -2
  139. package/dist/tests/runner.d.ts +1 -1
  140. package/dist/tests/spec.d.ts +17 -12
  141. package/dist/themes.d.ts +8 -5
  142. package/dist/translations/index.d.ts +6 -0
  143. package/dist/translations/index.js +5 -0
  144. package/dist/translations/registry.d.ts +144 -0
  145. package/dist/translations/registry.js +223 -0
  146. package/dist/translations/spec.d.ts +126 -0
  147. package/dist/translations/spec.js +31 -0
  148. package/dist/translations/validation.d.ts +85 -0
  149. package/dist/translations/validation.js +328 -0
  150. package/dist/types.d.ts +142 -16
  151. package/dist/versioning/index.d.ts +2 -1
  152. package/dist/versioning/index.js +2 -1
  153. package/dist/versioning/refs.d.ts +179 -0
  154. package/dist/versioning/refs.js +161 -0
  155. package/dist/workflow/context.d.ts +191 -0
  156. package/dist/workflow/context.js +227 -0
  157. package/dist/workflow/index.d.ts +6 -3
  158. package/dist/workflow/index.js +4 -2
  159. package/dist/workflow/spec.d.ts +4 -11
  160. package/dist/workflow/validation.d.ts +64 -2
  161. package/dist/workflow/validation.js +194 -1
  162. package/dist/workspace-config/contractsrc-schema.d.ts +3 -3
  163. package/dist/workspace-config/contractsrc-schema.js +1 -0
  164. package/dist/workspace-config/contractsrc-types.d.ts +7 -8
  165. package/dist/workspace-config/index.d.ts +2 -2
  166. package/package.json +52 -9
@@ -171,6 +171,199 @@ function detectCycles(adjacency, issues) {
171
171
  };
172
172
  for (const node of adjacency.keys()) dfs(node);
173
173
  }
174
+ /**
175
+ * Validate workflow consistency across registries.
176
+ *
177
+ * Checks that:
178
+ * - All workflow specs are internally valid
179
+ * - Operations referenced by steps exist
180
+ * - Forms referenced by steps exist
181
+ * - Capabilities required by steps exist
182
+ *
183
+ * @param deps - Registry dependencies
184
+ * @returns Validation result
185
+ */
186
+ function validateWorkflowConsistency(deps) {
187
+ const issues = [];
188
+ for (const workflow of deps.workflows.list()) {
189
+ const specIssues = validateWorkflowSpec(workflow, {
190
+ operations: deps.operations,
191
+ forms: deps.forms
192
+ });
193
+ issues.push(...specIssues.map((i) => ({
194
+ ...i,
195
+ message: `[${workflow.meta.key}.v${workflow.meta.version}] ${i.message}`
196
+ })));
197
+ if (deps.capabilities) {
198
+ for (const step of workflow.definition.steps) for (const capRef of step.requiredCapabilities ?? []) if (!deps.capabilities.get(capRef.key, capRef.version)) issues.push({
199
+ level: "error",
200
+ message: `[${workflow.meta.key}.v${workflow.meta.version}] Step "${step.id}" references unknown capability "${capRef.key}.v${capRef.version}"`,
201
+ context: {
202
+ stepId: step.id,
203
+ capability: capRef
204
+ }
205
+ });
206
+ }
207
+ if (workflow.definition.compensation && deps.operations) {
208
+ for (const compStep of workflow.definition.compensation.steps) if (!deps.operations.get(compStep.operation.key, compStep.operation.version)) issues.push({
209
+ level: "error",
210
+ message: `[${workflow.meta.key}.v${workflow.meta.version}] Compensation for step "${compStep.stepId}" references unknown operation "${compStep.operation.key}.v${compStep.operation.version}"`,
211
+ context: {
212
+ stepId: compStep.stepId,
213
+ operation: compStep.operation
214
+ }
215
+ });
216
+ }
217
+ if (workflow.definition.sla?.stepDurationMs) {
218
+ const stepIds = new Set(workflow.definition.steps.map((s) => s.id));
219
+ for (const stepId of Object.keys(workflow.definition.sla.stepDurationMs)) if (!stepIds.has(stepId)) issues.push({
220
+ level: "warning",
221
+ message: `[${workflow.meta.key}.v${workflow.meta.version}] SLA references unknown step "${stepId}"`,
222
+ context: { stepId }
223
+ });
224
+ }
225
+ }
226
+ return {
227
+ valid: issues.filter((i) => i.level === "error").length === 0,
228
+ issues
229
+ };
230
+ }
231
+ /**
232
+ * Assert workflow consistency across registries.
233
+ *
234
+ * @param deps - Registry dependencies
235
+ * @throws {WorkflowValidationError} If validation fails
236
+ */
237
+ function assertWorkflowConsistency(deps) {
238
+ const result = validateWorkflowConsistency(deps);
239
+ if (!result.valid) throw new WorkflowValidationError("Workflow consistency check failed", result.issues);
240
+ }
241
+ /**
242
+ * Validate SLA configuration is reasonable.
243
+ *
244
+ * @param spec - Workflow spec to validate
245
+ * @returns Array of validation issues
246
+ */
247
+ function validateSlaConfig(spec) {
248
+ const issues = [];
249
+ const sla = spec.definition.sla;
250
+ if (!sla) return issues;
251
+ if (sla.totalDurationMs !== void 0 && sla.totalDurationMs <= 0) issues.push({
252
+ level: "error",
253
+ message: "SLA totalDurationMs must be positive",
254
+ context: { totalDurationMs: sla.totalDurationMs }
255
+ });
256
+ if (sla.stepDurationMs) {
257
+ for (const [stepId, duration] of Object.entries(sla.stepDurationMs)) if (duration <= 0) issues.push({
258
+ level: "error",
259
+ message: `SLA stepDurationMs for "${stepId}" must be positive`,
260
+ context: {
261
+ stepId,
262
+ duration
263
+ }
264
+ });
265
+ const stepDurationsSum = Object.values(sla.stepDurationMs).reduce((sum, d) => sum + d, 0);
266
+ if (sla.totalDurationMs && stepDurationsSum > sla.totalDurationMs) issues.push({
267
+ level: "warning",
268
+ message: `Sum of step durations (${stepDurationsSum}ms) exceeds total duration (${sla.totalDurationMs}ms)`,
269
+ context: {
270
+ stepDurationsSum,
271
+ totalDurationMs: sla.totalDurationMs
272
+ }
273
+ });
274
+ }
275
+ return issues;
276
+ }
277
+ /**
278
+ * Validate compensation configuration.
279
+ *
280
+ * @param spec - Workflow spec to validate
281
+ * @returns Array of validation issues
282
+ */
283
+ function validateCompensation(spec) {
284
+ const issues = [];
285
+ const compensation = spec.definition.compensation;
286
+ if (!compensation) return issues;
287
+ const stepIds = new Set(spec.definition.steps.map((s) => s.id));
288
+ const coveredSteps = /* @__PURE__ */ new Set();
289
+ for (const compStep of compensation.steps) {
290
+ if (!stepIds.has(compStep.stepId)) issues.push({
291
+ level: "error",
292
+ message: `Compensation references unknown step "${compStep.stepId}"`,
293
+ context: { stepId: compStep.stepId }
294
+ });
295
+ if (coveredSteps.has(compStep.stepId)) issues.push({
296
+ level: "warning",
297
+ message: `Multiple compensation handlers for step "${compStep.stepId}"`,
298
+ context: { stepId: compStep.stepId }
299
+ });
300
+ coveredSteps.add(compStep.stepId);
301
+ if (!compStep.operation?.key || !compStep.operation?.version) issues.push({
302
+ level: "error",
303
+ message: `Compensation for step "${compStep.stepId}" must specify operation with key and version`,
304
+ context: { stepId: compStep.stepId }
305
+ });
306
+ }
307
+ const automationSteps = spec.definition.steps.filter((s) => s.type === "automation");
308
+ for (const step of automationSteps) if (!coveredSteps.has(step.id)) issues.push({
309
+ level: "warning",
310
+ message: `Automation step "${step.id}" has no compensation handler`,
311
+ context: { stepId: step.id }
312
+ });
313
+ return issues;
314
+ }
315
+ /**
316
+ * Validate retry configuration.
317
+ *
318
+ * @param spec - Workflow spec to validate
319
+ * @returns Array of validation issues
320
+ */
321
+ function validateRetryConfig(spec) {
322
+ const issues = [];
323
+ for (const step of spec.definition.steps) {
324
+ if (!step.retry) continue;
325
+ if (step.retry.maxAttempts <= 0) issues.push({
326
+ level: "error",
327
+ message: `Step "${step.id}" retry maxAttempts must be positive`,
328
+ context: {
329
+ stepId: step.id,
330
+ maxAttempts: step.retry.maxAttempts
331
+ }
332
+ });
333
+ if (step.retry.delayMs <= 0) issues.push({
334
+ level: "error",
335
+ message: `Step "${step.id}" retry delayMs must be positive`,
336
+ context: {
337
+ stepId: step.id,
338
+ delayMs: step.retry.delayMs
339
+ }
340
+ });
341
+ if (step.retry.maxDelayMs !== void 0 && step.retry.maxDelayMs < step.retry.delayMs) issues.push({
342
+ level: "warning",
343
+ message: `Step "${step.id}" retry maxDelayMs (${step.retry.maxDelayMs}) is less than delayMs (${step.retry.delayMs})`,
344
+ context: { stepId: step.id }
345
+ });
346
+ }
347
+ return issues;
348
+ }
349
+ /**
350
+ * Perform comprehensive workflow validation.
351
+ *
352
+ * @param spec - Workflow spec to validate
353
+ * @param options - Validation options
354
+ * @returns Validation result
355
+ */
356
+ function validateWorkflowComprehensive(spec, options = {}) {
357
+ const issues = [];
358
+ issues.push(...validateWorkflowSpec(spec, options));
359
+ issues.push(...validateSlaConfig(spec));
360
+ issues.push(...validateCompensation(spec));
361
+ issues.push(...validateRetryConfig(spec));
362
+ return {
363
+ valid: issues.filter((i) => i.level === "error").length === 0,
364
+ issues
365
+ };
366
+ }
174
367
 
175
368
  //#endregion
176
- export { WorkflowValidationError, assertWorkflowSpecValid, validateWorkflowSpec };
369
+ export { WorkflowValidationError, assertWorkflowConsistency, assertWorkflowSpecValid, validateCompensation, validateRetryConfig, validateSlaConfig, validateWorkflowComprehensive, validateWorkflowConsistency, validateWorkflowSpec };
@@ -1,4 +1,4 @@
1
- import { BumpStrategy, ChangelogFormat, ChangelogTier, CheckRunConfig, CiConfig, ClaudeAgentSDKConfig, ContractsrcConfig, ContractsrcFileConfig, ExternalAgentsConfig, ExternalWorkspace, FolderConventions, FormatterConfig, FormatterType, GroupingRule, GroupingStrategy, HooksConfig, ImpactConfig, LintRules, MetaRepoConfig, OpenApiConfig, OpenApiExportConfig, OpenApiSourceConfig, OpenCodeSDKConfig, PrCommentConfig, ResolvedContractsrcConfig, RuleSeverity, RuleSyncConfig, RuleSyncTarget, RulesConfig, SchemaFormat, SpecKind, TestLinkingConfig, TestLinkingStrategy, TestingConfig, VersioningConfig } from "./contractsrc-types.js";
1
+ import { AgentMode, AgentProvider, BumpStrategy, ChangelogFormat, ChangelogTier, CheckRunConfig, CiConfig, ClaudeAgentSDKConfig, ContractsrcConfig, ContractsrcFileConfig, ExternalAgentsConfig, ExternalWorkspace, FolderConventions, FormatterConfig, FormatterType, GroupingRule, GroupingStrategy, HooksConfig, ImpactConfig, LintRules, MetaRepoConfig, OpenApiConfig, OpenApiExportConfig, OpenApiSourceConfig, OpenCodeSDKConfig, PrCommentConfig, ResolvedContractsrcConfig, RuleSeverity, RuleSyncConfig, RuleSyncTarget, RulesConfig, SchemaFormat, SpecKind, TestLinkingConfig, TestLinkingStrategy, TestingConfig, VersioningConfig } from "./contractsrc-types.js";
2
2
  import * as z$2 from "zod";
3
3
 
4
4
  //#region src/workspace-config/contractsrc-schema.d.ts
@@ -133,10 +133,10 @@ declare const HooksConfigSchema: z$2.ZodType<HooksConfig>;
133
133
  /**
134
134
  * Full ContractSpec configuration schema (.contractsrc.json).
135
135
  */
136
- declare const ContractsrcSchema: z$2.ZodType<ContractsrcConfig>;
136
+ declare const ContractsrcSchema: z$2.ZodType<ContractsrcFileConfig>;
137
137
  /**
138
138
  * Default configuration values.
139
139
  */
140
140
  declare const DEFAULT_CONTRACTSRC: ResolvedContractsrcConfig;
141
141
  //#endregion
142
- export { BumpStrategy, BumpStrategySchema, ChangelogFormat, ChangelogFormatSchema, ChangelogTier, ChangelogTierSchema, CheckRunConfig, CheckRunConfigSchema, CiConfig, CiConfigSchema, ClaudeAgentSDKConfig, ClaudeAgentSDKConfigSchema, ContractsrcConfig, ContractsrcFileConfig, ContractsrcSchema, DEFAULT_CONTRACTSRC, ExternalAgentsConfig, ExternalAgentsConfigSchema, ExternalWorkspace, ExternalWorkspaceSchema, FolderConventions, FolderConventionsSchema, FormatterConfig, FormatterConfigSchema, FormatterType, FormatterTypeSchema, GroupingRule, GroupingRuleSchema, GroupingStrategy, GroupingStrategySchema, HooksConfig, HooksConfigSchema, ImpactConfig, ImpactConfigSchema, LintRules, LintRulesSchema, MetaRepoConfig, MetaRepoConfigSchema, OpenApiConfig, OpenApiConfigSchema, OpenApiExportConfig, OpenApiExportConfigSchema, OpenApiSourceConfig, OpenApiSourceConfigSchema, OpenCodeSDKConfig, OpenCodeSDKConfigSchema, PrCommentConfig, PrCommentConfigSchema, ResolvedContractsrcConfig, RuleSeverity, RuleSeveritySchema, RuleSyncConfig, RuleSyncConfigSchema, RuleSyncTarget, RuleSyncTargetSchema, RulesConfig, RulesConfigSchema, SchemaFormat, SchemaFormatSchema, SpecKind, SpecKindSchema, TestLinkingConfig, TestLinkingConfigSchema, TestLinkingStrategy, TestLinkingStrategySchema, TestingConfig, TestingConfigSchema, VersioningConfig, VersioningConfigSchema };
142
+ export { AgentMode, AgentProvider, BumpStrategy, BumpStrategySchema, ChangelogFormat, ChangelogFormatSchema, ChangelogTier, ChangelogTierSchema, CheckRunConfig, CheckRunConfigSchema, CiConfig, CiConfigSchema, ClaudeAgentSDKConfig, ClaudeAgentSDKConfigSchema, ContractsrcConfig, ContractsrcFileConfig, ContractsrcSchema, DEFAULT_CONTRACTSRC, ExternalAgentsConfig, ExternalAgentsConfigSchema, ExternalWorkspace, ExternalWorkspaceSchema, FolderConventions, FolderConventionsSchema, FormatterConfig, FormatterConfigSchema, FormatterType, FormatterTypeSchema, GroupingRule, GroupingRuleSchema, GroupingStrategy, GroupingStrategySchema, HooksConfig, HooksConfigSchema, ImpactConfig, ImpactConfigSchema, LintRules, LintRulesSchema, MetaRepoConfig, MetaRepoConfigSchema, OpenApiConfig, OpenApiConfigSchema, OpenApiExportConfig, OpenApiExportConfigSchema, OpenApiSourceConfig, OpenApiSourceConfigSchema, OpenCodeSDKConfig, OpenCodeSDKConfigSchema, PrCommentConfig, PrCommentConfigSchema, ResolvedContractsrcConfig, RuleSeverity, RuleSeveritySchema, RuleSyncConfig, RuleSyncConfigSchema, RuleSyncTarget, RuleSyncTargetSchema, RulesConfig, RulesConfigSchema, SchemaFormat, SchemaFormatSchema, SpecKind, SpecKindSchema, TestLinkingConfig, TestLinkingConfigSchema, TestLinkingStrategy, TestLinkingStrategySchema, TestingConfig, TestingConfigSchema, VersioningConfig, VersioningConfigSchema };
@@ -374,6 +374,7 @@ const ContractsrcSchema = z$2.object({
374
374
  "claude-code",
375
375
  "openai-codex",
376
376
  "claude-agent-sdk",
377
+ "opencode",
377
378
  "opencode-sdk"
378
379
  ]).default("simple").optional(),
379
380
  customEndpoint: z$2.url().nullable().optional(),
@@ -15,6 +15,8 @@ type RuleSyncTarget = 'cursor' | 'windsurf' | 'cline' | 'claude-code' | 'copilot
15
15
  type RuleSeverity = 'off' | 'warn' | 'error';
16
16
  type SpecKind = 'operation' | 'event' | 'presentation' | 'feature' | 'workflow' | 'data-view' | 'migration' | 'telemetry' | 'experiment' | 'app-config';
17
17
  type TestLinkingStrategy = 'target-first' | 'convention-only' | 'both';
18
+ type AgentProvider = 'claude' | 'openai' | 'ollama' | 'custom';
19
+ type AgentMode = 'simple' | 'cursor' | 'claude-code' | 'openai-codex' | 'claude-agent-sdk' | 'opencode' | 'opencode-sdk';
18
20
  interface OpenApiSourceConfig {
19
21
  /** Friendly name for the source */
20
22
  name: string;
@@ -238,7 +240,7 @@ interface LintRules {
238
240
  'require-owners-format'?: RuleSeverity;
239
241
  /** Require event names to use past tense */
240
242
  'event-past-tense'?: RuleSeverity;
241
- /** Warn on TODO comments */
243
+ /** Warn on placeholder comments */
242
244
  'no-todo'?: RuleSeverity;
243
245
  /** Require workflow transitions */
244
246
  'workflow-transitions'?: RuleSeverity;
@@ -283,17 +285,14 @@ interface RulesConfig {
283
285
  overrides?: Partial<Record<SpecKind, LintRules>>;
284
286
  }
285
287
  type HooksConfig = Record<string, string[]>;
286
- /**
287
- * Full ContractSpec configuration (.contractsrc.json).
288
- */
289
288
  /**
290
289
  * Full ContractSpec configuration (.contractsrc.json).
291
290
  * All fields are optional as they come from user configuration.
292
291
  */
293
292
  interface ContractsrcFileConfig {
294
- aiProvider?: 'claude' | 'openai' | 'ollama' | 'custom';
293
+ aiProvider?: AgentProvider;
295
294
  aiModel?: string;
296
- agentMode?: 'simple' | 'cursor' | 'claude-code' | 'openai-codex' | 'claude-agent-sdk' | 'opencode-sdk';
295
+ agentMode?: AgentMode;
297
296
  customEndpoint?: string | null;
298
297
  customApiKey?: string | null;
299
298
  outputDir?: string;
@@ -321,7 +320,7 @@ interface ContractsrcFileConfig {
321
320
  */
322
321
  interface ResolvedContractsrcConfig extends ContractsrcFileConfig {
323
322
  aiProvider: 'claude' | 'openai' | 'ollama' | 'custom';
324
- agentMode: 'simple' | 'cursor' | 'claude-code' | 'openai-codex' | 'claude-agent-sdk' | 'opencode-sdk';
323
+ agentMode: 'simple' | 'cursor' | 'claude-code' | 'openai-codex' | 'claude-agent-sdk' | 'opencode' | 'opencode-sdk';
325
324
  outputDir: string;
326
325
  conventions: {
327
326
  models: string;
@@ -343,4 +342,4 @@ interface ResolvedContractsrcConfig extends ContractsrcFileConfig {
343
342
  */
344
343
  type ContractsrcConfig = ContractsrcFileConfig;
345
344
  //#endregion
346
- export { BumpStrategy, ChangelogFormat, ChangelogTier, CheckRunConfig, CiConfig, ClaudeAgentSDKConfig, ContractsrcConfig, ContractsrcFileConfig, ExternalAgentsConfig, ExternalWorkspace, FolderConventions, FormatterConfig, FormatterType, GroupingRule, GroupingStrategy, HooksConfig, ImpactConfig, LintRules, MetaRepoConfig, OpenApiConfig, OpenApiExportConfig, OpenApiSourceConfig, OpenCodeSDKConfig, PrCommentConfig, ResolvedContractsrcConfig, RuleSeverity, RuleSyncConfig, RuleSyncTarget, RulesConfig, SchemaFormat, SpecKind, TestLinkingConfig, TestLinkingStrategy, TestingConfig, VersioningConfig };
345
+ export { AgentMode, AgentProvider, BumpStrategy, ChangelogFormat, ChangelogTier, CheckRunConfig, CiConfig, ClaudeAgentSDKConfig, ContractsrcConfig, ContractsrcFileConfig, ExternalAgentsConfig, ExternalWorkspace, FolderConventions, FormatterConfig, FormatterType, GroupingRule, GroupingStrategy, HooksConfig, ImpactConfig, LintRules, MetaRepoConfig, OpenApiConfig, OpenApiExportConfig, OpenApiSourceConfig, OpenCodeSDKConfig, PrCommentConfig, ResolvedContractsrcConfig, RuleSeverity, RuleSyncConfig, RuleSyncTarget, RulesConfig, SchemaFormat, SpecKind, TestLinkingConfig, TestLinkingStrategy, TestingConfig, VersioningConfig };
@@ -1,3 +1,3 @@
1
- import { BumpStrategy, ChangelogFormat, ChangelogTier, ContractsrcConfig, ContractsrcFileConfig, FolderConventions, FormatterConfig, FormatterType, OpenApiConfig, OpenApiExportConfig, OpenApiSourceConfig, ResolvedContractsrcConfig, RuleSyncConfig, RuleSyncTarget, SchemaFormat, VersioningConfig } from "./contractsrc-types.js";
1
+ import { AgentMode, AgentProvider, BumpStrategy, ChangelogFormat, ChangelogTier, ContractsrcConfig, ContractsrcFileConfig, FolderConventions, FormatterConfig, FormatterType, OpenApiConfig, OpenApiExportConfig, OpenApiSourceConfig, ResolvedContractsrcConfig, RuleSyncConfig, RuleSyncTarget, SchemaFormat, VersioningConfig } from "./contractsrc-types.js";
2
2
  import { BumpStrategySchema, ChangelogFormatSchema, ChangelogTierSchema, ContractsrcSchema, DEFAULT_CONTRACTSRC, FolderConventionsSchema, FormatterConfigSchema, FormatterTypeSchema, OpenApiConfigSchema, OpenApiExportConfigSchema, OpenApiSourceConfigSchema, RuleSyncConfigSchema, RuleSyncTargetSchema, SchemaFormatSchema, VersioningConfigSchema } from "./contractsrc-schema.js";
3
- export { type BumpStrategy, BumpStrategySchema, type ChangelogFormat, ChangelogFormatSchema, type ChangelogTier, ChangelogTierSchema, type ContractsrcConfig, type ContractsrcFileConfig, ContractsrcSchema, DEFAULT_CONTRACTSRC, type FolderConventions, FolderConventionsSchema, type FormatterConfig, FormatterConfigSchema, type FormatterType, FormatterTypeSchema, type OpenApiConfig, OpenApiConfigSchema, type OpenApiExportConfig, OpenApiExportConfigSchema, type OpenApiSourceConfig, OpenApiSourceConfigSchema, type ResolvedContractsrcConfig, type RuleSyncConfig, RuleSyncConfigSchema, type RuleSyncTarget, RuleSyncTargetSchema, type SchemaFormat, SchemaFormatSchema, type VersioningConfig, VersioningConfigSchema };
3
+ export { type AgentMode, type AgentProvider, type BumpStrategy, BumpStrategySchema, type ChangelogFormat, ChangelogFormatSchema, type ChangelogTier, ChangelogTierSchema, type ContractsrcConfig, type ContractsrcFileConfig, ContractsrcSchema, DEFAULT_CONTRACTSRC, type FolderConventions, FolderConventionsSchema, type FormatterConfig, FormatterConfigSchema, type FormatterType, FormatterTypeSchema, type OpenApiConfig, OpenApiConfigSchema, type OpenApiExportConfig, OpenApiExportConfigSchema, type OpenApiSourceConfig, OpenApiSourceConfigSchema, type ResolvedContractsrcConfig, type RuleSyncConfig, RuleSyncConfigSchema, type RuleSyncTarget, RuleSyncTargetSchema, type SchemaFormat, SchemaFormatSchema, type VersioningConfig, VersioningConfigSchema };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/lib.contracts",
3
- "version": "0.0.0-canary-20260119225944",
3
+ "version": "0.0.0-canary-20260202053150",
4
4
  "description": "Core contract specification definitions and runtime",
5
5
  "keywords": [
6
6
  "contractspec",
@@ -14,7 +14,7 @@
14
14
  "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
15
15
  "publish:pkg:canary": "bun publish:pkg --tag canary",
16
16
  "build": "bun build:types && bun build:bundle",
17
- "build:bundle": "tsdown",
17
+ "build:bundle": "NODE_OPTIONS=--max-old-space-size=8192 tsdown",
18
18
  "build:types": "tsc --noEmit",
19
19
  "dev": "bun build:bundle --watch",
20
20
  "registry:build": "bun run scripts/build-registry.ts",
@@ -25,18 +25,19 @@
25
25
  "test": "bun test"
26
26
  },
27
27
  "devDependencies": {
28
- "@contractspec/tool.tsdown": "1.48.0",
29
- "@contractspec/tool.typescript": "1.48.0",
28
+ "@contractspec/tool.tsdown": "0.0.0-canary-20260202053150",
29
+ "@contractspec/tool.typescript": "0.0.0-canary-20260202053150",
30
30
  "@types/express": "^5.0.3",
31
31
  "@types/turndown": "^5.0.6",
32
32
  "tsdown": "^0.19.0",
33
- "typescript": "^5.9.3"
33
+ "typescript": "^5.9.3",
34
+ "vitest": "^4.0.18"
34
35
  },
35
36
  "dependencies": {
36
37
  "@aws-sdk/client-secrets-manager": "^3.966.0",
37
38
  "@aws-sdk/client-sqs": "^3.966.0",
38
- "@contractspec/lib.logger": "1.48.0",
39
- "@contractspec/lib.schema": "1.48.0",
39
+ "@contractspec/lib.logger": "0.0.0-canary-20260202053150",
40
+ "@contractspec/lib.schema": "0.0.0-canary-20260202053150",
40
41
  "@elevenlabs/elevenlabs-js": "^2.30.0",
41
42
  "@google-cloud/secret-manager": "^6.1.1",
42
43
  "@google-cloud/storage": "^7.18.0",
@@ -83,9 +84,9 @@
83
84
  ".": "./dist/index.js",
84
85
  "./app-config": "./dist/app-config/index.js",
85
86
  "./app-config/app-config.capability": "./dist/app-config/app-config.capability.js",
87
+ "./app-config/app-config.contracts": "./dist/app-config/app-config.contracts.js",
86
88
  "./app-config/app-config.feature": "./dist/app-config/app-config.feature.js",
87
89
  "./app-config/branding": "./dist/app-config/branding.js",
88
- "./app-config/contracts": "./dist/app-config/contracts.js",
89
90
  "./app-config/docs/app-config.docblock": "./dist/app-config/docs/app-config.docblock.js",
90
91
  "./app-config/events": "./dist/app-config/events.js",
91
92
  "./app-config/lifecycle": "./dist/app-config/lifecycle.js",
@@ -95,8 +96,11 @@
95
96
  "./app-config/validation": "./dist/app-config/validation.js",
96
97
  "./capabilities": "./dist/capabilities/index.js",
97
98
  "./capabilities/capabilities": "./dist/capabilities/capabilities.js",
99
+ "./capabilities/context": "./dist/capabilities/context.js",
98
100
  "./capabilities/docs/capabilities.docblock": "./dist/capabilities/docs/capabilities.docblock.js",
101
+ "./capabilities/guards": "./dist/capabilities/guards.js",
99
102
  "./capabilities/openbanking": "./dist/capabilities/openbanking.js",
103
+ "./capabilities/validation": "./dist/capabilities/validation.js",
100
104
  "./client": "./dist/client/index.js",
101
105
  "./client/react": "./dist/client/react/index.js",
102
106
  "./client/react/drivers/rn-reusables": "./dist/client/react/drivers/rn-reusables.js",
@@ -111,13 +115,32 @@
111
115
  "./data-views/docs/data-views.docblock": "./dist/data-views/docs/data-views.docblock.js",
112
116
  "./data-views/query-generator": "./dist/data-views/query-generator.js",
113
117
  "./data-views/registry": "./dist/data-views/registry.js",
118
+ "./data-views/report/contractVerificationTable": "./dist/data-views/report/contractVerificationTable.js",
114
119
  "./data-views/runtime": "./dist/data-views/runtime.js",
115
120
  "./data-views/spec": "./dist/data-views/spec.js",
116
121
  "./data-views/types": "./dist/data-views/types.js",
117
122
  "./docs": "./dist/docs/index.js",
118
123
  "./docs/accessibility_wcag_compliance_specs.docblock": "./dist/docs/accessibility_wcag_compliance_specs.docblock.js",
124
+ "./docs/capabilities": "./dist/docs/capabilities/index.js",
125
+ "./docs/capabilities/documentationSystem.capability": "./dist/docs/capabilities/documentationSystem.capability.js",
126
+ "./docs/commands": "./dist/docs/commands/index.js",
127
+ "./docs/commands/docsGenerate.command": "./dist/docs/commands/docsGenerate.command.js",
128
+ "./docs/commands/docsPublish.command": "./dist/docs/commands/docsPublish.command.js",
129
+ "./docs/constants": "./dist/docs/constants.js",
130
+ "./docs/contracts": "./dist/docs/contracts.js",
131
+ "./docs/ensure-docblocks": "./dist/docs/ensure-docblocks.js",
132
+ "./docs/events": "./dist/docs/events/index.js",
133
+ "./docs/events/docsGenerated.event": "./dist/docs/events/docsGenerated.event.js",
134
+ "./docs/events/docsPublished.event": "./dist/docs/events/docsPublished.event.js",
135
+ "./docs/forms": "./dist/docs/forms/index.js",
136
+ "./docs/forms/docsSearch.form": "./dist/docs/forms/docsSearch.form.js",
119
137
  "./docs/meta.docs": "./dist/docs/meta.docs.js",
120
- "./docs/presentations": "./dist/docs/presentations.js",
138
+ "./docs/presentations": "./dist/docs/presentations/index.js",
139
+ "./docs/presentations/docsLayout.presentation": "./dist/docs/presentations/docsLayout.presentation.js",
140
+ "./docs/presentations/docsReferencePage.presentation": "./dist/docs/presentations/docsReferencePage.presentation.js",
141
+ "./docs/queries": "./dist/docs/queries/index.js",
142
+ "./docs/queries/contractReference.query": "./dist/docs/queries/contractReference.query.js",
143
+ "./docs/queries/docsIndex.query": "./dist/docs/queries/docsIndex.query.js",
121
144
  "./docs/registry": "./dist/docs/registry.js",
122
145
  "./docs/tech-contracts.docs": "./dist/docs/tech-contracts.docs.js",
123
146
  "./docs/tech/auth/better-auth-nextjs.docblock": "./dist/docs/tech/auth/better-auth-nextjs.docblock.js",
@@ -131,10 +154,12 @@
131
154
  "./docs/tech/contracts/tests.docblock": "./dist/docs/tech/contracts/tests.docblock.js",
132
155
  "./docs/tech/contracts/themes.docblock": "./dist/docs/tech/contracts/themes.docblock.js",
133
156
  "./docs/tech/contracts/vertical-pocket-family-office.docblock": "./dist/docs/tech/contracts/vertical-pocket-family-office.docblock.js",
157
+ "./docs/tech/docs-system.docblock": "./dist/docs/tech/docs-system.docblock.js",
134
158
  "./docs/tech/lifecycle-stage-system.docblock": "./dist/docs/tech/lifecycle-stage-system.docblock.js",
135
159
  "./docs/tech/llm/llm-integration.docblock": "./dist/docs/tech/llm/llm-integration.docblock.js",
136
160
  "./docs/tech/mcp-endpoints.docblock": "./dist/docs/tech/mcp-endpoints.docblock.js",
137
161
  "./docs/tech/presentation-runtime.docblock": "./dist/docs/tech/presentation-runtime.docblock.js",
162
+ "./docs/tech/report-verification-table.docblock": "./dist/docs/tech/report-verification-table.docblock.js",
138
163
  "./docs/tech/schema/README.docblock": "./dist/docs/tech/schema/README.docblock.js",
139
164
  "./docs/tech/studio/learning-events.docblock": "./dist/docs/tech/studio/learning-events.docblock.js",
140
165
  "./docs/tech/studio/learning-journeys.docblock": "./dist/docs/tech/studio/learning-journeys.docblock.js",
@@ -148,6 +173,10 @@
148
173
  "./docs/tech/telemetry-ingest.docblock": "./dist/docs/tech/telemetry-ingest.docblock.js",
149
174
  "./docs/tech/vscode-extension.docblock": "./dist/docs/tech/vscode-extension.docblock.js",
150
175
  "./docs/types": "./dist/docs/types.js",
176
+ "./docs/views": "./dist/docs/views/index.js",
177
+ "./docs/views/contractReference.dataView": "./dist/docs/views/contractReference.dataView.js",
178
+ "./docs/views/docsIndex.dataView": "./dist/docs/views/docsIndex.dataView.js",
179
+ "./docs/views/exampleCatalog.dataView": "./dist/docs/views/exampleCatalog.dataView.js",
151
180
  "./events": "./dist/events.js",
152
181
  "./examples": "./dist/examples/index.js",
153
182
  "./examples/docs/examples.docblock": "./dist/examples/docs/examples.docblock.js",
@@ -280,13 +309,18 @@
280
309
  "./operations": "./dist/operations/index.js",
281
310
  "./operations/operation": "./dist/operations/operation.js",
282
311
  "./operations/registry": "./dist/operations/registry.js",
312
+ "./operations/report": "./dist/operations/report/index.js",
313
+ "./operations/report/getContractVerificationStatus": "./dist/operations/report/getContractVerificationStatus.js",
283
314
  "./ownership": "./dist/ownership.js",
284
315
  "./policy": "./dist/policy/index.js",
316
+ "./policy/context": "./dist/policy/context.js",
285
317
  "./policy/docs/policy.docblock": "./dist/policy/docs/policy.docblock.js",
286
318
  "./policy/engine": "./dist/policy/engine.js",
319
+ "./policy/guards": "./dist/policy/guards.js",
287
320
  "./policy/opa-adapter": "./dist/policy/opa-adapter.js",
288
321
  "./policy/registry": "./dist/policy/registry.js",
289
322
  "./policy/spec": "./dist/policy/spec.js",
323
+ "./policy/validation": "./dist/policy/validation.js",
290
324
  "./presentations": "./dist/presentations/index.js",
291
325
  "./presentations/docs/presentations-conventions.docblock": "./dist/presentations/docs/presentations-conventions.docblock.js",
292
326
  "./presentations/presentations": "./dist/presentations/presentations.js",
@@ -306,6 +340,9 @@
306
340
  "./registry-utils": "./dist/registry-utils.js",
307
341
  "./resources": "./dist/resources.js",
308
342
  "./schema-to-markdown": "./dist/schema-to-markdown.js",
343
+ "./serialization": "./dist/serialization/index.js",
344
+ "./serialization/serializers": "./dist/serialization/serializers.js",
345
+ "./serialization/types": "./dist/serialization/types.js",
309
346
  "./server": "./dist/server/index.js",
310
347
  "./server/contracts-adapter-hydration": "./dist/server/contracts-adapter-hydration.js",
311
348
  "./server/contracts-adapter-input": "./dist/server/contracts-adapter-input.js",
@@ -332,10 +369,15 @@
332
369
  "./tests/runner": "./dist/tests/runner.js",
333
370
  "./tests/spec": "./dist/tests/spec.js",
334
371
  "./themes": "./dist/themes.js",
372
+ "./translations": "./dist/translations/index.js",
335
373
  "./translations/catalog": "./dist/translations/catalog.js",
374
+ "./translations/registry": "./dist/translations/registry.js",
375
+ "./translations/spec": "./dist/translations/spec.js",
336
376
  "./translations/tenant": "./dist/translations/tenant.js",
377
+ "./translations/validation": "./dist/translations/validation.js",
337
378
  "./types": "./dist/types.js",
338
379
  "./versioning": "./dist/versioning/index.js",
380
+ "./versioning/refs": "./dist/versioning/refs.js",
339
381
  "./versioning/types": "./dist/versioning/types.js",
340
382
  "./versioning/utils": "./dist/versioning/utils.js",
341
383
  "./workflow": "./dist/workflow/index.js",
@@ -343,6 +385,7 @@
343
385
  "./workflow/adapters/db-adapter": "./dist/workflow/adapters/db-adapter.js",
344
386
  "./workflow/adapters/file-adapter": "./dist/workflow/adapters/file-adapter.js",
345
387
  "./workflow/adapters/memory-store": "./dist/workflow/adapters/memory-store.js",
388
+ "./workflow/context": "./dist/workflow/context.js",
346
389
  "./workflow/expression": "./dist/workflow/expression.js",
347
390
  "./workflow/overview.docblock": "./dist/workflow/overview.docblock.js",
348
391
  "./workflow/runner": "./dist/workflow/runner.js",