@contractspec/lib.contracts 1.52.0 → 1.54.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 (124) hide show
  1. package/dist/app-config/{contracts.d.ts → app-config.contracts.d.ts} +51 -51
  2. package/dist/app-config/{contracts.js → app-config.contracts.js} +1 -1
  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.d.ts +4 -4
  6. package/dist/app-config/spec.d.ts +3 -3
  7. package/dist/capabilities/guards.d.ts +1 -1
  8. package/dist/capabilities/validation.d.ts +1 -1
  9. package/dist/contract-registry/schemas.d.ts +4 -4
  10. package/dist/data-views/data-views.d.ts +1 -1
  11. package/dist/data-views/index.d.ts +1 -1
  12. package/dist/data-views/registry.d.ts +1 -1
  13. package/dist/data-views/report/contractVerificationTable.d.ts +10 -0
  14. package/dist/data-views/report/contractVerificationTable.js +95 -0
  15. package/dist/data-views/runtime.d.ts +2 -2
  16. package/dist/data-views/spec.d.ts +1 -1
  17. package/dist/data-views/types.d.ts +2 -2
  18. package/dist/docs/capabilities/documentationSystem.capability.d.ts +7 -0
  19. package/dist/docs/capabilities/documentationSystem.capability.js +71 -0
  20. package/dist/docs/capabilities/index.d.ts +2 -0
  21. package/dist/docs/capabilities/index.js +3 -0
  22. package/dist/docs/commands/docsGenerate.command.d.ts +95 -0
  23. package/dist/docs/commands/docsGenerate.command.js +142 -0
  24. package/dist/docs/commands/docsPublish.command.d.ts +64 -0
  25. package/dist/docs/commands/docsPublish.command.js +107 -0
  26. package/dist/docs/commands/index.d.ts +3 -0
  27. package/dist/docs/commands/index.js +4 -0
  28. package/dist/docs/constants.d.ts +7 -0
  29. package/dist/docs/constants.js +10 -0
  30. package/dist/docs/contracts.d.ts +442 -0
  31. package/dist/docs/contracts.js +58 -0
  32. package/dist/docs/ensure-docblocks.d.ts +1 -0
  33. package/dist/docs/ensure-docblocks.js +1 -0
  34. package/dist/docs/events/docsGenerated.event.d.ts +62 -0
  35. package/dist/docs/events/docsGenerated.event.js +53 -0
  36. package/dist/docs/events/docsPublished.event.d.ts +70 -0
  37. package/dist/docs/events/docsPublished.event.js +57 -0
  38. package/dist/docs/events/index.d.ts +3 -0
  39. package/dist/docs/events/index.js +4 -0
  40. package/dist/docs/forms/docsSearch.form.d.ts +22 -0
  41. package/dist/docs/forms/docsSearch.form.js +113 -0
  42. package/dist/docs/forms/index.d.ts +2 -0
  43. package/dist/docs/forms/index.js +3 -0
  44. package/dist/docs/index.d.ts +23 -1
  45. package/dist/docs/index.js +25 -1
  46. package/dist/docs/presentations/docsLayout.presentation.d.ts +7 -0
  47. package/dist/docs/presentations/docsLayout.presentation.js +35 -0
  48. package/dist/docs/presentations/docsReferencePage.presentation.d.ts +7 -0
  49. package/dist/docs/presentations/docsReferencePage.presentation.js +35 -0
  50. package/dist/docs/presentations/index.d.ts +3 -0
  51. package/dist/docs/presentations/index.js +4 -0
  52. package/dist/docs/queries/contractReference.query.d.ts +217 -0
  53. package/dist/docs/queries/contractReference.query.js +125 -0
  54. package/dist/docs/queries/docsIndex.query.d.ts +272 -0
  55. package/dist/docs/queries/docsIndex.query.js +133 -0
  56. package/dist/docs/queries/index.d.ts +3 -0
  57. package/dist/docs/queries/index.js +4 -0
  58. package/dist/docs/tech/cli.docblock.js +10 -0
  59. package/dist/docs/tech/docs-system.docblock.d.ts +1 -0
  60. package/dist/docs/tech/docs-system.docblock.js +128 -0
  61. package/dist/docs/tech/report-verification-table.docblock.d.ts +1 -0
  62. package/dist/docs/tech/report-verification-table.docblock.js +50 -0
  63. package/dist/docs/views/contractReference.dataView.d.ts +7 -0
  64. package/dist/docs/views/contractReference.dataView.js +81 -0
  65. package/dist/docs/views/docsIndex.dataView.d.ts +7 -0
  66. package/dist/docs/views/docsIndex.dataView.js +136 -0
  67. package/dist/docs/views/exampleCatalog.dataView.d.ts +7 -0
  68. package/dist/docs/views/exampleCatalog.dataView.js +91 -0
  69. package/dist/docs/views/index.d.ts +4 -0
  70. package/dist/docs/views/index.js +5 -0
  71. package/dist/events.d.ts +1 -1
  72. package/dist/examples/schema.d.ts +17 -17
  73. package/dist/examples/types.d.ts +1 -1
  74. package/dist/experiments/spec.d.ts +2 -2
  75. package/dist/features/install.d.ts +1 -1
  76. package/dist/features/types.d.ts +3 -3
  77. package/dist/forms/forms.d.ts +1 -1
  78. package/dist/index.d.ts +40 -22
  79. package/dist/index.js +20 -2
  80. package/dist/install.d.ts +1 -1
  81. package/dist/integrations/openbanking/contracts/accounts.d.ts +66 -66
  82. package/dist/integrations/openbanking/contracts/balances.d.ts +34 -34
  83. package/dist/integrations/openbanking/contracts/transactions.d.ts +48 -48
  84. package/dist/integrations/openbanking/models.d.ts +55 -55
  85. package/dist/integrations/operations.d.ts +102 -102
  86. package/dist/integrations/providers/impls/stripe-payments.js +1 -1
  87. package/dist/integrations/spec.d.ts +2 -2
  88. package/dist/jsonschema.d.ts +1 -1
  89. package/dist/knowledge/operations.d.ts +66 -66
  90. package/dist/knowledge/spec.d.ts +1 -1
  91. package/dist/llm/exporters.d.ts +3 -3
  92. package/dist/llm/types.d.ts +1 -1
  93. package/dist/markdown.d.ts +1 -1
  94. package/dist/onboarding-base.d.ts +29 -29
  95. package/dist/operations/index.d.ts +4 -1
  96. package/dist/operations/index.js +4 -1
  97. package/dist/operations/operation.d.ts +3 -3
  98. package/dist/operations/registry.d.ts +1 -1
  99. package/dist/operations/report/getContractVerificationStatus.d.ts +75 -0
  100. package/dist/operations/report/getContractVerificationStatus.js +96 -0
  101. package/dist/operations/report/index.d.ts +13 -0
  102. package/dist/operations/report/index.js +45 -0
  103. package/dist/policy/validation.d.ts +1 -1
  104. package/dist/presentations/registry.d.ts +1 -1
  105. package/dist/registry.d.ts +1 -1
  106. package/dist/serialization/serializers.d.ts +3 -3
  107. package/dist/server/rest-elysia.d.ts +1 -1
  108. package/dist/server/rest-express.d.ts +1 -1
  109. package/dist/server/rest-generic.d.ts +1 -1
  110. package/dist/server/rest-next-app.d.ts +1 -1
  111. package/dist/server/rest-next-mcp.d.ts +1 -1
  112. package/dist/server/rest-next-pages.d.ts +1 -1
  113. package/dist/telemetry/spec.d.ts +1 -1
  114. package/dist/telemetry/tracker.d.ts +3 -2
  115. package/dist/tests/runner.d.ts +1 -1
  116. package/dist/themes.d.ts +1 -1
  117. package/dist/types.d.ts +2 -2
  118. package/dist/workflow/spec.d.ts +2 -2
  119. package/dist/workflow/validation.d.ts +2 -2
  120. package/dist/workspace-config/contractsrc-schema.d.ts +3 -3
  121. package/dist/workspace-config/contractsrc-schema.js +1 -0
  122. package/dist/workspace-config/contractsrc-types.d.ts +7 -8
  123. package/dist/workspace-config/index.d.ts +2 -2
  124. package/package.json +38 -11
@@ -0,0 +1,75 @@
1
+ import { OperationSpec } from "../operation.js";
2
+ import "../index.js";
3
+ import * as _contractspec_lib_schema536 from "@contractspec/lib.schema";
4
+ import { SchemaModel, ZodSchemaType } from "@contractspec/lib.schema";
5
+ import * as z$2 from "zod";
6
+
7
+ //#region src/operations/report/getContractVerificationStatus.d.ts
8
+ /**
9
+ * Status of a single contract's verification within the impact report.
10
+ */
11
+ declare const ContractVerificationStatusModel: SchemaModel<{
12
+ name: {
13
+ type: _contractspec_lib_schema536.FieldType<string, string>;
14
+ isOptional: false;
15
+ };
16
+ lastVerifiedSha: {
17
+ type: _contractspec_lib_schema536.FieldType<string, string>;
18
+ isOptional: true;
19
+ };
20
+ lastVerifiedDate: {
21
+ type: _contractspec_lib_schema536.FieldType<string, string>;
22
+ isOptional: true;
23
+ };
24
+ surfaces: {
25
+ type: _contractspec_lib_schema536.FieldType<string, string>;
26
+ isOptional: false;
27
+ isArray: true;
28
+ };
29
+ driftMismatches: {
30
+ type: _contractspec_lib_schema536.FieldType<number, number>;
31
+ isOptional: false;
32
+ };
33
+ }>;
34
+ declare const GetContractVerificationStatusInput: SchemaModel<{
35
+ projectPath: {
36
+ type: _contractspec_lib_schema536.FieldType<string, string>;
37
+ isOptional: false;
38
+ };
39
+ baseline: {
40
+ type: _contractspec_lib_schema536.FieldType<string, string>;
41
+ isOptional: true;
42
+ };
43
+ }>;
44
+ declare const GetContractVerificationStatusOutput: ZodSchemaType<z$2.ZodObject<{
45
+ contracts: z$2.ZodArray<z$2.ZodObject<{
46
+ name: z$2.ZodString;
47
+ lastVerifiedSha: z$2.ZodOptional<z$2.ZodString>;
48
+ lastVerifiedDate: z$2.ZodOptional<z$2.ZodString>;
49
+ surfaces: z$2.ZodArray<z$2.ZodString>;
50
+ driftMismatches: z$2.ZodInt;
51
+ }, z$2.core.$strip>>;
52
+ }, z$2.core.$strip>>;
53
+ /**
54
+ * Query to retrieve per-contract verification status for the impact report.
55
+ */
56
+ declare const GetContractVerificationStatusQuery: OperationSpec<SchemaModel<{
57
+ projectPath: {
58
+ type: _contractspec_lib_schema536.FieldType<string, string>;
59
+ isOptional: false;
60
+ };
61
+ baseline: {
62
+ type: _contractspec_lib_schema536.FieldType<string, string>;
63
+ isOptional: true;
64
+ };
65
+ }>, ZodSchemaType<z$2.ZodObject<{
66
+ contracts: z$2.ZodArray<z$2.ZodObject<{
67
+ name: z$2.ZodString;
68
+ lastVerifiedSha: z$2.ZodOptional<z$2.ZodString>;
69
+ lastVerifiedDate: z$2.ZodOptional<z$2.ZodString>;
70
+ surfaces: z$2.ZodArray<z$2.ZodString>;
71
+ driftMismatches: z$2.ZodInt;
72
+ }, z$2.core.$strip>>;
73
+ }, z$2.core.$strip>>, undefined>;
74
+ //#endregion
75
+ export { ContractVerificationStatusModel, GetContractVerificationStatusInput, GetContractVerificationStatusOutput, GetContractVerificationStatusQuery };
@@ -0,0 +1,96 @@
1
+ import { StabilityEnum } from "../../ownership.js";
2
+ import { defineQuery } from "../operation.js";
3
+ import { ScalarTypeEnum, SchemaModel, ZodSchemaType } from "@contractspec/lib.schema";
4
+ import * as z$2 from "zod";
5
+
6
+ //#region src/operations/report/getContractVerificationStatus.ts
7
+ const REPORT_DOMAIN = "report";
8
+ const REPORT_OWNERS = ["platform.core"];
9
+ const REPORT_TAGS = [
10
+ "report",
11
+ "drift",
12
+ "verification"
13
+ ];
14
+ const REPORT_STABILITY = StabilityEnum.Experimental;
15
+ /**
16
+ * Status of a single contract's verification within the impact report.
17
+ */
18
+ const ContractVerificationStatusModel = new SchemaModel({
19
+ name: "ContractVerificationStatus",
20
+ fields: {
21
+ name: {
22
+ type: ScalarTypeEnum.String_unsecure(),
23
+ isOptional: false
24
+ },
25
+ lastVerifiedSha: {
26
+ type: ScalarTypeEnum.String_unsecure(),
27
+ isOptional: true
28
+ },
29
+ lastVerifiedDate: {
30
+ type: ScalarTypeEnum.String_unsecure(),
31
+ isOptional: true
32
+ },
33
+ surfaces: {
34
+ type: ScalarTypeEnum.String_unsecure(),
35
+ isOptional: false,
36
+ isArray: true
37
+ },
38
+ driftMismatches: {
39
+ type: ScalarTypeEnum.Int_unsecure(),
40
+ isOptional: false
41
+ }
42
+ }
43
+ });
44
+ const GetContractVerificationStatusInput = new SchemaModel({
45
+ name: "GetContractVerificationStatusInput",
46
+ fields: {
47
+ projectPath: {
48
+ type: ScalarTypeEnum.String_unsecure(),
49
+ isOptional: false
50
+ },
51
+ baseline: {
52
+ type: ScalarTypeEnum.String_unsecure(),
53
+ isOptional: true
54
+ }
55
+ }
56
+ });
57
+ const GetContractVerificationStatusOutput = new ZodSchemaType(z$2.object({ contracts: z$2.object({
58
+ name: z$2.string(),
59
+ lastVerifiedSha: z$2.string().optional(),
60
+ lastVerifiedDate: z$2.string().optional(),
61
+ surfaces: z$2.string().array(),
62
+ driftMismatches: z$2.int()
63
+ }).array() }), { name: "GetContractVerificationStatusOutput" });
64
+ /**
65
+ * Query to retrieve per-contract verification status for the impact report.
66
+ */
67
+ const GetContractVerificationStatusQuery = defineQuery({
68
+ meta: {
69
+ key: "report.getContractVerificationStatus",
70
+ title: "Get Contract Verification Status",
71
+ version: "1.0.0",
72
+ description: "Retrieves per-contract verification status for the impact report.",
73
+ goal: "Enable stakeholders to see contract health at a glance.",
74
+ context: "Part of the impact report domain. Reads from drift check outputs and verified.json to provide a consolidated view of each contract's drift debt and surface coverage.",
75
+ domain: REPORT_DOMAIN,
76
+ owners: REPORT_OWNERS,
77
+ tags: REPORT_TAGS,
78
+ stability: REPORT_STABILITY
79
+ },
80
+ io: {
81
+ input: GetContractVerificationStatusInput,
82
+ output: GetContractVerificationStatusOutput,
83
+ errors: { PROJECT_NOT_FOUND: {
84
+ description: "Project path does not exist.",
85
+ http: 404,
86
+ when: "The provided projectPath does not resolve to a valid directory."
87
+ } }
88
+ },
89
+ policy: {
90
+ auth: "anonymous",
91
+ pii: []
92
+ }
93
+ });
94
+
95
+ //#endregion
96
+ export { ContractVerificationStatusModel, GetContractVerificationStatusInput, GetContractVerificationStatusOutput, GetContractVerificationStatusQuery };
@@ -0,0 +1,13 @@
1
+ import { ContractVerificationStatusModel, GetContractVerificationStatusInput, GetContractVerificationStatusOutput, GetContractVerificationStatusQuery } from "./getContractVerificationStatus.js";
2
+ import { HandlerForOperationSpec } from "../../install.js";
3
+ import { ContractVerificationTableDataView } from "../../data-views/report/contractVerificationTable.js";
4
+ import { OperationSpecRegistry } from "../registry.js";
5
+
6
+ //#region src/operations/report/index.d.ts
7
+ declare const getContractVerificationStatusHandler: HandlerForOperationSpec<typeof GetContractVerificationStatusQuery>;
8
+ /**
9
+ * Register report-related operation contracts in the given registry.
10
+ */
11
+ declare function registerReportContracts(registry: OperationSpecRegistry): OperationSpecRegistry;
12
+ //#endregion
13
+ export { ContractVerificationStatusModel, ContractVerificationTableDataView, GetContractVerificationStatusInput, GetContractVerificationStatusOutput, GetContractVerificationStatusQuery, getContractVerificationStatusHandler, registerReportContracts };
@@ -0,0 +1,45 @@
1
+ import { installOp } from "../../install.js";
2
+ import { ContractVerificationStatusModel, GetContractVerificationStatusInput, GetContractVerificationStatusOutput, GetContractVerificationStatusQuery } from "./getContractVerificationStatus.js";
3
+ import { ContractVerificationTableDataView } from "../../data-views/report/contractVerificationTable.js";
4
+
5
+ //#region src/operations/report/index.ts
6
+ const getContractVerificationStatusHandler = async (input, _ctx) => {
7
+ try {
8
+ const cmdStdout = await Bun.spawn([
9
+ "contractspec",
10
+ "impl",
11
+ "status",
12
+ "--format",
13
+ "json",
14
+ "--all"
15
+ ], { cwd: input.projectPath }).stdout;
16
+ const output = await Bun.readableStreamToText(cmdStdout);
17
+ if (!output) return { contracts: [] };
18
+ const cliOutput = JSON.parse(output);
19
+ const contracts = [];
20
+ for (const spec of cliOutput.results || []) {
21
+ const contract = {
22
+ name: spec.specKey,
23
+ lastVerifiedSha: spec.specHash,
24
+ lastVerifiedDate: spec.specHash ? (/* @__PURE__ */ new Date()).toISOString() : void 0,
25
+ surfaces: spec.implementations.filter((impl) => impl.exists).map((impl) => impl.type),
26
+ driftMismatches: spec.implementations.filter((impl) => !impl.exists).length
27
+ };
28
+ contracts.push(contract);
29
+ }
30
+ return { contracts };
31
+ } catch (error) {
32
+ console.error("Failed to get contract verification status:", error);
33
+ return { contracts: [] };
34
+ }
35
+ };
36
+ /**
37
+ * Register report-related operation contracts in the given registry.
38
+ */
39
+ function registerReportContracts(registry) {
40
+ installOp(registry, GetContractVerificationStatusQuery, getContractVerificationStatusHandler);
41
+ return registry;
42
+ }
43
+
44
+ //#endregion
45
+ export { ContractVerificationStatusModel, ContractVerificationTableDataView, GetContractVerificationStatusInput, GetContractVerificationStatusOutput, GetContractVerificationStatusQuery, getContractVerificationStatusHandler, registerReportContracts };
@@ -1,6 +1,6 @@
1
1
  import { PolicySpec } from "./spec.js";
2
- import { OperationSpecRegistry } from "../operations/registry.js";
3
2
  import { PolicyRegistry } from "./registry.js";
3
+ import { OperationSpecRegistry } from "../operations/registry.js";
4
4
 
5
5
  //#region src/policy/validation.d.ts
6
6
 
@@ -1,5 +1,5 @@
1
- import { PresentationSpec } from "./presentations.js";
2
1
  import { SpecContractRegistry } from "../registry.js";
2
+ import { PresentationSpec } from "./presentations.js";
3
3
 
4
4
  //#region src/presentations/registry.d.ts
5
5
  /** In-memory registry for PresentationSpec. */
@@ -1,6 +1,6 @@
1
- import { OwnerShipMeta } from "./ownership.js";
2
1
  import { GroupKeyFn, RegistryFilter } from "./registry-utils.js";
3
2
  import { ContractSpecType } from "./types.js";
3
+ import { OwnerShipMeta } from "./ownership.js";
4
4
 
5
5
  //#region src/registry.d.ts
6
6
  interface AnySpecContract {
@@ -1,13 +1,13 @@
1
- import { PresentationSpec } from "../presentations/presentations.js";
2
1
  import { ResourceRefDescriptor } from "../resources.js";
3
2
  import { AnyOperationSpec } from "../operations/operation.js";
4
- import "../operations/index.js";
3
+ import { PresentationSpec } from "../presentations/presentations.js";
5
4
  import "../presentations/index.js";
6
5
  import { DataViewSpec } from "../data-views/spec.js";
7
6
  import "../data-views/index.js";
8
- import { AnyEventSpec } from "../events.js";
7
+ import "../operations/index.js";
9
8
  import { FormSpec } from "../forms/forms.js";
10
9
  import "../forms/index.js";
10
+ import { AnyEventSpec } from "../events.js";
11
11
  import { SerializedDataViewSpec, SerializedEventSpec, SerializedFormSpec, SerializedOperationSpec, SerializedPresentationSpec, SerializedSchemaModel } from "./types.js";
12
12
  import { AnySchemaModel } from "@contractspec/lib.schema";
13
13
 
@@ -1,5 +1,5 @@
1
- import { OperationSpecRegistry } from "../operations/registry.js";
2
1
  import { HandlerCtx } from "../types.js";
2
+ import { OperationSpecRegistry } from "../operations/registry.js";
3
3
  import { RestOptions } from "./rest-generic.js";
4
4
  import { Elysia } from "elysia";
5
5
 
@@ -1,5 +1,5 @@
1
- import { OperationSpecRegistry } from "../operations/registry.js";
2
1
  import { HandlerCtx } from "../types.js";
2
+ import { OperationSpecRegistry } from "../operations/registry.js";
3
3
  import { RestOptions } from "./rest-generic.js";
4
4
  import { Request, Router } from "express";
5
5
 
@@ -1,5 +1,5 @@
1
- import { OperationSpecRegistry } from "../operations/registry.js";
2
1
  import { HandlerCtx } from "../types.js";
2
+ import { OperationSpecRegistry } from "../operations/registry.js";
3
3
 
4
4
  //#region src/server/rest-generic.d.ts
5
5
  interface RestOptions {
@@ -1,5 +1,5 @@
1
- import { OperationSpecRegistry } from "../operations/registry.js";
2
1
  import { HandlerCtx } from "../types.js";
2
+ import { OperationSpecRegistry } from "../operations/registry.js";
3
3
  import { RestOptions } from "./rest-generic.js";
4
4
 
5
5
  //#region src/server/rest-next-app.d.ts
@@ -1,5 +1,5 @@
1
- import { OperationSpecRegistry } from "../operations/registry.js";
2
1
  import { HandlerCtx } from "../types.js";
2
+ import { OperationSpecRegistry } from "../operations/registry.js";
3
3
 
4
4
  //#region src/server/rest-next-mcp.d.ts
5
5
  declare function makeNextMcpServerFromRegistry(reg: OperationSpecRegistry, ctxFactory: () => HandlerCtx): {
@@ -1,5 +1,5 @@
1
- import { OperationSpecRegistry } from "../operations/registry.js";
2
1
  import { HandlerCtx } from "../types.js";
2
+ import { OperationSpecRegistry } from "../operations/registry.js";
3
3
  import { RestOptions } from "./rest-generic.js";
4
4
  import { NextApiRequest, NextApiResponse } from "next";
5
5
 
@@ -1,5 +1,5 @@
1
- import { OwnerShipMeta } from "../ownership.js";
2
1
  import { SpecContractRegistry } from "../registry.js";
2
+ import { OwnerShipMeta } from "../ownership.js";
3
3
 
4
4
  //#region src/telemetry/spec.d.ts
5
5
  type TelemetryPrivacyLevel = 'public' | 'internal' | 'pii' | 'sensitive';
@@ -1,5 +1,6 @@
1
1
  import { TelemetryEventDef, TelemetryRegistry, TelemetrySpec } from "./spec.js";
2
2
  import { TelemetryAnomalyMonitor } from "./anomaly.js";
3
+ import { Actor, Channel } from "../types.js";
3
4
 
4
5
  //#region src/telemetry/tracker.d.ts
5
6
  interface TelemetryEventContext {
@@ -7,8 +8,8 @@ interface TelemetryEventContext {
7
8
  organizationId?: string | null;
8
9
  userId?: string | null;
9
10
  sessionId?: string | null;
10
- actor?: 'anonymous' | 'user' | 'admin';
11
- channel?: 'web' | 'mobile' | 'job' | 'agent';
11
+ actor?: Actor;
12
+ channel?: Channel;
12
13
  metadata?: Record<string, unknown>;
13
14
  }
14
15
  interface TelemetryDispatch {
@@ -1,6 +1,6 @@
1
1
  import { Assertion, TestScenario, TestSpec } from "./spec.js";
2
- import { OperationSpecRegistry } from "../operations/registry.js";
3
2
  import { HandlerCtx } from "../types.js";
3
+ import { OperationSpecRegistry } from "../operations/registry.js";
4
4
  import "../index.js";
5
5
 
6
6
  //#region src/tests/runner.d.ts
package/dist/themes.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VersionedSpecRef } from "./versioning/refs.js";
2
- import { OwnerShipMeta } from "./ownership.js";
3
2
  import { SpecContractRegistry } from "./registry.js";
3
+ import { OwnerShipMeta } from "./ownership.js";
4
4
 
5
5
  //#region src/themes.d.ts
6
6
  /** Scope at which a theme can be applied. */
package/dist/types.d.ts CHANGED
@@ -34,13 +34,13 @@ type Actor = 'anonymous' | 'user' | 'admin';
34
34
  * - `job`: Background job/scheduled task
35
35
  * - `agent`: AI agent or automated system
36
36
  */
37
- type Channel = 'web' | 'mobile' | 'job' | 'agent';
37
+ type Channel = 'web' | 'mobile' | 'job' | 'agent' | 'ci';
38
38
  /**
39
39
  * Discriminator for all ContractSpec specification types.
40
40
  *
41
41
  * Used to identify the kind of spec in registries and runtime operations.
42
42
  */
43
- type ContractSpecType = 'app-config' | 'agent' | 'operation' | 'example' | 'event' | 'presentation' | 'capability' | 'integration' | 'data-view' | 'feature' | 'workflow' | 'policy' | 'theme' | 'telemetry' | 'experiment' | 'knowledge-space';
43
+ type ContractSpecType = 'operation' | 'event' | 'presentation' | 'feature' | 'capability' | 'data-view' | 'form' | 'agent' | 'migration' | 'workflow' | 'experiment' | 'integration' | 'theme' | 'knowledge' | 'telemetry' | 'example' | 'app-config' | 'policy' | 'test-spec' | 'type' | 'knowledge-space';
44
44
  /**
45
45
  * Decision for a specific field access.
46
46
  * Used for fine-grained field-level authorization.
@@ -1,10 +1,10 @@
1
1
  import { CapabilityRef } from "../capabilities/capabilities.js";
2
- import { OwnerShipMeta } from "../ownership.js";
2
+ import { SpecContractRegistry } from "../registry.js";
3
3
  import "../capabilities/index.js";
4
4
  import { ExperimentRef } from "../experiments/spec.js";
5
5
  import { FormRef, OpRef } from "../features/types.js";
6
6
  import "../features/index.js";
7
- import { SpecContractRegistry } from "../registry.js";
7
+ import { OwnerShipMeta } from "../ownership.js";
8
8
 
9
9
  //#region src/workflow/spec.d.ts
10
10
  type StepType = 'human' | 'automation' | 'decision';
@@ -1,9 +1,9 @@
1
1
  import { CapabilityRegistry } from "../capabilities/capabilities.js";
2
- import { OperationSpecRegistry } from "../operations/registry.js";
3
2
  import { WorkflowRegistry, WorkflowSpec } from "./spec.js";
4
- import { EventRegistry } from "../events.js";
3
+ import { OperationSpecRegistry } from "../operations/registry.js";
5
4
  import { FormRegistry } from "../forms/forms.js";
6
5
  import "../forms/index.js";
6
+ import { EventRegistry } from "../events.js";
7
7
 
8
8
  //#region src/workflow/validation.d.ts
9
9
  type WorkflowValidationLevel = 'error' | 'warning';
@@ -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 };