@contractspec/module.examples 1.45.0 → 1.45.2
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.
- package/dist/index.js +1 -2
- package/dist/registry.d.ts +2 -2
- package/dist/registry.js +2 -3
- package/dist/registry.js.map +1 -1
- package/package.json +38 -37
- package/dist/libs/contracts/dist/_virtual/rolldown_runtime.js +0 -6
- package/dist/libs/contracts/dist/_virtual/rolldown_runtime.js.map +0 -1
- package/dist/libs/contracts/dist/app-config/spec.js +0 -1
- package/dist/libs/contracts/dist/capabilities/capabilities.js +0 -1
- package/dist/libs/contracts/dist/capabilities/index.js +0 -2
- package/dist/libs/contracts/dist/capabilities/openbanking.js +0 -89
- package/dist/libs/contracts/dist/capabilities/openbanking.js.map +0 -1
- package/dist/libs/contracts/dist/client/index.js +0 -5
- package/dist/libs/contracts/dist/client/react/feature-render.js +0 -3
- package/dist/libs/contracts/dist/client/react/form-render.js +0 -6
- package/dist/libs/contracts/dist/client/react/index.js +0 -4
- package/dist/libs/contracts/dist/contract-registry/index.js +0 -1
- package/dist/libs/contracts/dist/contract-registry/schemas.js +0 -61
- package/dist/libs/contracts/dist/contract-registry/schemas.js.map +0 -1
- package/dist/libs/contracts/dist/data-views/index.js +0 -1
- package/dist/libs/contracts/dist/data-views/registry.js +0 -1
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -17
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/index.js +0 -27
- package/dist/libs/contracts/dist/docs/meta.docs.js +0 -30
- package/dist/libs/contracts/dist/docs/meta.docs.js.map +0 -1
- package/dist/libs/contracts/dist/docs/presentations.js +0 -57
- package/dist/libs/contracts/dist/docs/presentations.js.map +0 -1
- package/dist/libs/contracts/dist/docs/registry.js +0 -45
- package/dist/libs/contracts/dist/docs/registry.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -81
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -58
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-import.docblock.js +0 -65
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-import.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -17
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -358
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -38
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -17
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -21
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -49
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -80
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -85
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -46
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -68
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -41
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -70
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -48
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -63
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -156
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -21
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -102
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/docs/tech-contracts.docs.js +0 -97
- package/dist/libs/contracts/dist/docs/tech-contracts.docs.js.map +0 -1
- package/dist/libs/contracts/dist/events.js +0 -2
- package/dist/libs/contracts/dist/examples/index.js +0 -3
- package/dist/libs/contracts/dist/examples/registry.js +0 -145
- package/dist/libs/contracts/dist/examples/registry.js.map +0 -1
- package/dist/libs/contracts/dist/examples/schema.js +0 -102
- package/dist/libs/contracts/dist/examples/schema.js.map +0 -1
- package/dist/libs/contracts/dist/examples/validation.js +0 -1
- package/dist/libs/contracts/dist/experiments/evaluator.js +0 -1
- package/dist/libs/contracts/dist/experiments/spec.js +0 -1
- package/dist/libs/contracts/dist/features/index.js +0 -1
- package/dist/libs/contracts/dist/features/registry.js +0 -7
- package/dist/libs/contracts/dist/features/registry.js.map +0 -1
- package/dist/libs/contracts/dist/forms/forms.js +0 -2
- package/dist/libs/contracts/dist/forms/index.js +0 -1
- package/dist/libs/contracts/dist/index.js +0 -109
- package/dist/libs/contracts/dist/index.js.map +0 -1
- package/dist/libs/contracts/dist/install.js +0 -2
- package/dist/libs/contracts/dist/integrations/index.js +0 -19
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -230
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js.map +0 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +0 -161
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js.map +0 -1
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -212
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js.map +0 -1
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +0 -243
- package/dist/libs/contracts/dist/integrations/openbanking/models.js.map +0 -1
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +0 -14
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js.map +0 -1
- package/dist/libs/contracts/dist/integrations/operations.js +0 -384
- package/dist/libs/contracts/dist/integrations/operations.js.map +0 -1
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +0 -52
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js.map +0 -1
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +0 -75
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js.map +0 -1
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +0 -87
- package/dist/libs/contracts/dist/integrations/providers/gmail.js.map +0 -1
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +0 -66
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js.map +0 -1
- package/dist/libs/contracts/dist/integrations/providers/index.js +0 -11
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +0 -68
- package/dist/libs/contracts/dist/integrations/providers/mistral.js.map +0 -1
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +0 -68
- package/dist/libs/contracts/dist/integrations/providers/postmark.js.map +0 -1
- package/dist/libs/contracts/dist/integrations/providers/powens.js +0 -116
- package/dist/libs/contracts/dist/integrations/providers/powens.js.map +0 -1
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +0 -73
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js.map +0 -1
- package/dist/libs/contracts/dist/integrations/providers/registry.js +0 -11
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +0 -83
- package/dist/libs/contracts/dist/integrations/providers/stripe.js.map +0 -1
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +0 -61
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js.map +0 -1
- package/dist/libs/contracts/dist/integrations/spec.js +0 -1
- package/dist/libs/contracts/dist/jsonschema.js +0 -1
- package/dist/libs/contracts/dist/knowledge/index.js +0 -8
- package/dist/libs/contracts/dist/knowledge/operations.js +0 -313
- package/dist/libs/contracts/dist/knowledge/operations.js.map +0 -1
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js.map +0 -1
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js.map +0 -1
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js.map +0 -1
- package/dist/libs/contracts/dist/knowledge/spaces/index.js +0 -6
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js.map +0 -1
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +0 -37
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js.map +0 -1
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js.map +0 -1
- package/dist/libs/contracts/dist/knowledge/spec.js +0 -1
- package/dist/libs/contracts/dist/llm/exporters.js +0 -21
- package/dist/libs/contracts/dist/llm/exporters.js.map +0 -1
- package/dist/libs/contracts/dist/llm/index.js +0 -2
- package/dist/libs/contracts/dist/llm/prompts.js +0 -1
- package/dist/libs/contracts/dist/migrations.js +0 -1
- package/dist/libs/contracts/dist/model-registry.js +0 -1
- package/dist/libs/contracts/dist/onboarding-base.js +0 -198
- package/dist/libs/contracts/dist/onboarding-base.js.map +0 -1
- package/dist/libs/contracts/dist/openapi.js +0 -2
- package/dist/libs/contracts/dist/operations/index.js +0 -2
- package/dist/libs/contracts/dist/operations/operation.js +0 -35
- package/dist/libs/contracts/dist/operations/operation.js.map +0 -1
- package/dist/libs/contracts/dist/operations/registry.js +0 -2
- package/dist/libs/contracts/dist/ownership.js +0 -22
- package/dist/libs/contracts/dist/ownership.js.map +0 -1
- package/dist/libs/contracts/dist/policy/engine.js +0 -1
- package/dist/libs/contracts/dist/policy/index.js +0 -2
- package/dist/libs/contracts/dist/policy/registry.js +0 -1
- package/dist/libs/contracts/dist/presentations/index.js +0 -2
- package/dist/libs/contracts/dist/presentations/registry.js +0 -1
- package/dist/libs/contracts/dist/presentations/transform-engine.js +0 -13
- package/dist/libs/contracts/dist/presentations/transform-engine.js.map +0 -1
- package/dist/libs/contracts/dist/prompt.js +0 -1
- package/dist/libs/contracts/dist/promptRegistry.js +0 -2
- package/dist/libs/contracts/dist/regenerator/index.js +0 -1
- package/dist/libs/contracts/dist/regenerator/service.js +0 -5
- package/dist/libs/contracts/dist/regenerator/service.js.map +0 -1
- package/dist/libs/contracts/dist/registry-utils.js +0 -71
- package/dist/libs/contracts/dist/registry-utils.js.map +0 -1
- package/dist/libs/contracts/dist/registry.js +0 -8
- package/dist/libs/contracts/dist/registry.js.map +0 -1
- package/dist/libs/contracts/dist/resources.js +0 -1
- package/dist/libs/contracts/dist/schema-to-markdown.js +0 -1
- package/dist/libs/contracts/dist/server/contracts-adapter-input.js +0 -1
- package/dist/libs/contracts/dist/server/graphql-pothos.js +0 -8
- package/dist/libs/contracts/dist/server/index.js +0 -8
- package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +0 -4
- package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +0 -2
- package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +0 -1
- package/dist/libs/contracts/dist/server/mcp/registerResources.js +0 -2
- package/dist/libs/contracts/dist/server/mcp/registerTools.js +0 -1
- package/dist/libs/contracts/dist/server/provider-mcp.js +0 -1
- package/dist/libs/contracts/dist/server/rest-elysia.js +0 -1
- package/dist/libs/contracts/dist/server/rest-express.js +0 -1
- package/dist/libs/contracts/dist/server/rest-generic.js +0 -1
- package/dist/libs/contracts/dist/server/rest-next-app.js +0 -1
- package/dist/libs/contracts/dist/server/rest-next-pages.js +0 -1
- package/dist/libs/contracts/dist/telemetry/index.js +0 -2
- package/dist/libs/contracts/dist/telemetry/spec.js +0 -2
- package/dist/libs/contracts/dist/telemetry/tracker.js +0 -1
- package/dist/libs/contracts/dist/tests/index.js +0 -2
- package/dist/libs/contracts/dist/tests/runner.js +0 -2
- package/dist/libs/contracts/dist/tests/spec.js +0 -1
- package/dist/libs/contracts/dist/themes.js +0 -1
- package/dist/libs/contracts/dist/workflow/index.js +0 -2
- package/dist/libs/contracts/dist/workflow/overview.docblock.js +0 -21
- package/dist/libs/contracts/dist/workflow/overview.docblock.js.map +0 -1
- package/dist/libs/contracts/dist/workflow/runner.js +0 -1
- package/dist/libs/contracts/dist/workflow/spec.js +0 -1
- package/dist/libs/contracts/dist/workspace-config/contractsrc-schema.js +0 -263
- package/dist/libs/contracts/dist/workspace-config/contractsrc-schema.js.map +0 -1
- package/dist/libs/contracts/dist/workspace-config/index.js +0 -1
- package/dist/libs/contracts/dist/workspace-config/workspace-config.docblock.js +0 -45
- package/dist/libs/contracts/dist/workspace-config/workspace-config.docblock.js.map +0 -1
- package/dist/libs/schema/dist/EnumType.js +0 -2
- package/dist/libs/schema/dist/FieldType.js +0 -50
- package/dist/libs/schema/dist/FieldType.js.map +0 -1
- package/dist/libs/schema/dist/GraphQLSchemaType.js +0 -1
- package/dist/libs/schema/dist/JsonSchemaType.js +0 -1
- package/dist/libs/schema/dist/ScalarTypeEnum.js +0 -237
- package/dist/libs/schema/dist/ScalarTypeEnum.js.map +0 -1
- package/dist/libs/schema/dist/SchemaModel.js +0 -35
- package/dist/libs/schema/dist/SchemaModel.js.map +0 -1
- package/dist/libs/schema/dist/ZodSchemaType.js +0 -1
- package/dist/libs/schema/dist/entity/defineEntity.js +0 -1
- package/dist/libs/schema/dist/entity/index.js +0 -2
- package/dist/libs/schema/dist/entity/types.js +0 -1
- package/dist/libs/schema/dist/index.js +0 -9
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "../jsonschema.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./rest-generic.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./rest-generic.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "crypto";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { compareVersions } from "compare-versions";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "./registry.js";
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { registerDocBlocks } from "../docs/registry.js";
|
|
2
|
-
|
|
3
|
-
//#region ../../libs/contracts/dist/workflow/overview.docblock.js
|
|
4
|
-
const tech_workflows_overview_DocBlocks = [{
|
|
5
|
-
id: "docs.tech.workflows.overview",
|
|
6
|
-
title: "WorkflowSpec Overview",
|
|
7
|
-
summary: "WorkflowSpec provides a declarative, versioned format for long-running flows that mix automation and human review. Specs stay inside `@contractspec/lib.contracts` (`src/workflow/spec.ts`) so the same definition powers runtime execution, documentation, and future generation.",
|
|
8
|
-
kind: "reference",
|
|
9
|
-
visibility: "public",
|
|
10
|
-
route: "/docs/tech/workflows/overview",
|
|
11
|
-
tags: [
|
|
12
|
-
"tech",
|
|
13
|
-
"workflows",
|
|
14
|
-
"overview"
|
|
15
|
-
],
|
|
16
|
-
body: "# WorkflowSpec Overview\n\n## Purpose\n\nWorkflowSpec provides a declarative, versioned format for long-running flows that mix automation and human review. Specs stay inside `@contractspec/lib.contracts` (`src/workflow/spec.ts`) so the same definition powers runtime execution, documentation, and future generation.\n\n## Core Types\n\n- `WorkflowMeta`: ownership metadata (`title`, `domain`, `owners`, `tags`, `stability`) plus `name` and `version`.\n- `WorkflowDefinition`:\n - `entryStepId?`: optional explicit entry point (defaults to first step).\n - `steps[]`: ordered list of `Step` descriptors.\n - `transitions[]`: directed edges between steps with optional expressions.\n - `sla?`: aggregated timing hints for the overall flow or per-step budgets.\n - `compensation?`: fallback operations executed when a workflow is rolled back or fails.\n- `Step`:\n - `type`: `human`, `automation`, or `decision`.\n - `action`: references either a `ContractSpec` (`operation`) or `FormSpec` (`form`).\n - Optional `guard`, `timeoutMs`, and retry policy (`maxAttempts`, `backoff`, `delayMs`, `maxDelayMs?`).\n - `requiredIntegrations?`: integration slot ids that must be bound before the step may execute.\n - `requiredCapabilities?`: `CapabilityRef[]` that must be enabled in the resolved app config.\n- `Transition`: `from` → `to` with optional `condition` string (simple data expressions).\n\n## Registry & Validation\n\n- `WorkflowRegistry` (`src/workflow/spec.ts`) stores specs by key `<name>.v<version>` and exposes `register`, `list`, and `get`.\n- `validateWorkflowSpec()` (`src/workflow/validation.ts`) checks:\n - Duplicate step IDs.\n - Unknown `from`/`to` transitions.\n - Empty guards/conditions.\n - Reachability from the entry step.\n - Cycles in the graph.\n - Operation/Form references against provided registries.\n- `assertWorkflowSpecValid()` wraps validation and throws `WorkflowValidationError` when errors remain.\n\n## Runtime\n\n- `WorkflowRunner` (`src/workflow/runner.ts`) executes workflows and coordinates steps.\n - `start(name, version?, initialData?)` returns a `workflowId`.\n - `executeStep(workflowId, input?)` runs the current step (automation or human).\n - `getState(workflowId)` retrieves the latest state snapshot.\n - `cancel(workflowId)` marks the workflow as cancelled.\n - `preFlightCheck(name, version?, resolvedConfig?)` evaluates integration/capability requirements before the workflow starts.\n - Throws `WorkflowPreFlightError` if required integration slots are unbound or required capabilities are disabled.\n- `StateStore` (`src/workflow/state.ts`) abstracts persistence. V1 ships with:\n - `InMemoryStateStore` (`src/workflow/adapters/memory-store.ts`) for tests/dev.\n - Placeholder factories for file/database adapters (`adapters/file-adapter.ts`, `adapters/db-adapter.ts`).\n- Guard evaluation: expression guards run through `evaluateExpression()` (`src/workflow/expression.ts`); custom policy guards can be provided via `guardEvaluator`.\n- Events: the runner emits `workflow.started`, `workflow.step_completed`, `workflow.step_failed`, and `workflow.cancelled` through the optional `eventEmitter`.\n- React bindings (`@contractspec/lib.presentation-runtime-react`):\n - `useWorkflow` hook (polls state, exposes `executeStep`, `cancel`, `refresh`).\n - `WorkflowStepper` progress indicator using design-system Stepper.\n - `WorkflowStepRenderer` helper to render human/automation/decision steps with sensible fallbacks.\n\n## Authoring Checklist\n\n1. Reuse existing operations/forms; create new specs when missing.\n2. Prefer explicit `entryStepId` for clarity (especially with decision branches).\n3. Give automation steps an `operation` and human steps a `form` (warnings surface otherwise).\n4. Use short, meaningful step IDs (`submit`, `review`, `finalize`) to simplify analytics.\n5. Keep guard expressions deterministic; complex policy logic should move to PolicySpec (Phase 2).\n\n## Testing\n\n- Add unit tests for new workflows via `assertWorkflowSpecValid`.\n- Use the new Vitest suites (`validation.test.ts`, `expression.test.ts`, `runner.test.ts`) as examples.\n- CLI support will arrive in Phase 1 PR 3 (`contractspec create --type workflow`).\n\n## Tooling\n\n- `contractspec create --type workflow` scaffolds a WorkflowSpec with interactive prompts.\n- `contractspec build <spec.workflow.ts>` generates a runner scaffold (`.runner.ts`) wired to `WorkflowRunner` and the in-memory store.\n- `contractspec validate` understands `.workflow.ts` files and checks core structure (meta, steps, transitions).\n\n## Next Steps (Non-MVP)\n\n- Persistence adapters (database/file) for workflow state (Phase 2).\n- React bindings (`useWorkflow`, `WorkflowStepper`) and presentation-runtime integration (PR 3).\n- Policy engine integration (`guard.type === 'policy'` validated against PolicySpec).\n- Telemetry hooks for step execution metrics.\n\n"
|
|
17
|
-
}];
|
|
18
|
-
registerDocBlocks(tech_workflows_overview_DocBlocks);
|
|
19
|
-
|
|
20
|
-
//#endregion
|
|
21
|
-
//# sourceMappingURL=overview.docblock.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"overview.docblock.js","names":[],"sources":["../../../../../../../libs/contracts/dist/workflow/overview.docblock.js"],"sourcesContent":["import { registerDocBlocks } from \"../docs/registry.js\";\n\n//#region src/workflow/overview.docblock.ts\nconst tech_workflows_overview_DocBlocks = [{\n\tid: \"docs.tech.workflows.overview\",\n\ttitle: \"WorkflowSpec Overview\",\n\tsummary: \"WorkflowSpec provides a declarative, versioned format for long-running flows that mix automation and human review. Specs stay inside `@contractspec/lib.contracts` (`src/workflow/spec.ts`) so the same definition powers runtime execution, documentation, and future generation.\",\n\tkind: \"reference\",\n\tvisibility: \"public\",\n\troute: \"/docs/tech/workflows/overview\",\n\ttags: [\n\t\t\"tech\",\n\t\t\"workflows\",\n\t\t\"overview\"\n\t],\n\tbody: \"# WorkflowSpec Overview\\n\\n## Purpose\\n\\nWorkflowSpec provides a declarative, versioned format for long-running flows that mix automation and human review. Specs stay inside `@contractspec/lib.contracts` (`src/workflow/spec.ts`) so the same definition powers runtime execution, documentation, and future generation.\\n\\n## Core Types\\n\\n- `WorkflowMeta`: ownership metadata (`title`, `domain`, `owners`, `tags`, `stability`) plus `name` and `version`.\\n- `WorkflowDefinition`:\\n - `entryStepId?`: optional explicit entry point (defaults to first step).\\n - `steps[]`: ordered list of `Step` descriptors.\\n - `transitions[]`: directed edges between steps with optional expressions.\\n - `sla?`: aggregated timing hints for the overall flow or per-step budgets.\\n - `compensation?`: fallback operations executed when a workflow is rolled back or fails.\\n- `Step`:\\n - `type`: `human`, `automation`, or `decision`.\\n - `action`: references either a `ContractSpec` (`operation`) or `FormSpec` (`form`).\\n - Optional `guard`, `timeoutMs`, and retry policy (`maxAttempts`, `backoff`, `delayMs`, `maxDelayMs?`).\\n - `requiredIntegrations?`: integration slot ids that must be bound before the step may execute.\\n - `requiredCapabilities?`: `CapabilityRef[]` that must be enabled in the resolved app config.\\n- `Transition`: `from` → `to` with optional `condition` string (simple data expressions).\\n\\n## Registry & Validation\\n\\n- `WorkflowRegistry` (`src/workflow/spec.ts`) stores specs by key `<name>.v<version>` and exposes `register`, `list`, and `get`.\\n- `validateWorkflowSpec()` (`src/workflow/validation.ts`) checks:\\n - Duplicate step IDs.\\n - Unknown `from`/`to` transitions.\\n - Empty guards/conditions.\\n - Reachability from the entry step.\\n - Cycles in the graph.\\n - Operation/Form references against provided registries.\\n- `assertWorkflowSpecValid()` wraps validation and throws `WorkflowValidationError` when errors remain.\\n\\n## Runtime\\n\\n- `WorkflowRunner` (`src/workflow/runner.ts`) executes workflows and coordinates steps.\\n - `start(name, version?, initialData?)` returns a `workflowId`.\\n - `executeStep(workflowId, input?)` runs the current step (automation or human).\\n - `getState(workflowId)` retrieves the latest state snapshot.\\n - `cancel(workflowId)` marks the workflow as cancelled.\\n - `preFlightCheck(name, version?, resolvedConfig?)` evaluates integration/capability requirements before the workflow starts.\\n - Throws `WorkflowPreFlightError` if required integration slots are unbound or required capabilities are disabled.\\n- `StateStore` (`src/workflow/state.ts`) abstracts persistence. V1 ships with:\\n - `InMemoryStateStore` (`src/workflow/adapters/memory-store.ts`) for tests/dev.\\n - Placeholder factories for file/database adapters (`adapters/file-adapter.ts`, `adapters/db-adapter.ts`).\\n- Guard evaluation: expression guards run through `evaluateExpression()` (`src/workflow/expression.ts`); custom policy guards can be provided via `guardEvaluator`.\\n- Events: the runner emits `workflow.started`, `workflow.step_completed`, `workflow.step_failed`, and `workflow.cancelled` through the optional `eventEmitter`.\\n- React bindings (`@contractspec/lib.presentation-runtime-react`):\\n - `useWorkflow` hook (polls state, exposes `executeStep`, `cancel`, `refresh`).\\n - `WorkflowStepper` progress indicator using design-system Stepper.\\n - `WorkflowStepRenderer` helper to render human/automation/decision steps with sensible fallbacks.\\n\\n## Authoring Checklist\\n\\n1. Reuse existing operations/forms; create new specs when missing.\\n2. Prefer explicit `entryStepId` for clarity (especially with decision branches).\\n3. Give automation steps an `operation` and human steps a `form` (warnings surface otherwise).\\n4. Use short, meaningful step IDs (`submit`, `review`, `finalize`) to simplify analytics.\\n5. Keep guard expressions deterministic; complex policy logic should move to PolicySpec (Phase 2).\\n\\n## Testing\\n\\n- Add unit tests for new workflows via `assertWorkflowSpecValid`.\\n- Use the new Vitest suites (`validation.test.ts`, `expression.test.ts`, `runner.test.ts`) as examples.\\n- CLI support will arrive in Phase 1 PR 3 (`contractspec create --type workflow`).\\n\\n## Tooling\\n\\n- `contractspec create --type workflow` scaffolds a WorkflowSpec with interactive prompts.\\n- `contractspec build <spec.workflow.ts>` generates a runner scaffold (`.runner.ts`) wired to `WorkflowRunner` and the in-memory store.\\n- `contractspec validate` understands `.workflow.ts` files and checks core structure (meta, steps, transitions).\\n\\n## Next Steps (Non-MVP)\\n\\n- Persistence adapters (database/file) for workflow state (Phase 2).\\n- React bindings (`useWorkflow`, `WorkflowStepper`) and presentation-runtime integration (PR 3).\\n- Policy engine integration (`guard.type === 'policy'` validated against PolicySpec).\\n- Telemetry hooks for step execution metrics.\\n\\n\"\n}];\nregisterDocBlocks(tech_workflows_overview_DocBlocks);\n\n//#endregion\nexport { tech_workflows_overview_DocBlocks };"],"mappings":";;;AAGA,MAAM,oCAAoC,CAAC;CAC1C,IAAI;CACJ,OAAO;CACP,SAAS;CACT,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EACL;EACA;EACA;EACA;CACD,MAAM;CACN,CAAC;AACF,kBAAkB,kCAAkC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "node:crypto";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "../registry.js";
|
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
import * as z$2 from "zod";
|
|
2
|
-
|
|
3
|
-
//#region ../../libs/contracts/dist/workspace-config/contractsrc-schema.js
|
|
4
|
-
/**
|
|
5
|
-
* ContractSpec configuration schema definitions.
|
|
6
|
-
*
|
|
7
|
-
* These schemas define the structure of .contractsrc.json files
|
|
8
|
-
* and are shared across CLI tools and libraries.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Schema output format for code generation.
|
|
12
|
-
* Controls how imported/generated schemas are written.
|
|
13
|
-
*/
|
|
14
|
-
const SchemaFormatSchema = z$2.enum([
|
|
15
|
-
"contractspec",
|
|
16
|
-
"zod",
|
|
17
|
-
"json-schema",
|
|
18
|
-
"graphql"
|
|
19
|
-
]);
|
|
20
|
-
/**
|
|
21
|
-
* OpenAPI source configuration for import/sync/validate operations.
|
|
22
|
-
*/
|
|
23
|
-
const OpenApiSourceConfigSchema = z$2.object({
|
|
24
|
-
name: z$2.string(),
|
|
25
|
-
url: z$2.url().optional(),
|
|
26
|
-
file: z$2.string().optional(),
|
|
27
|
-
syncMode: z$2.enum([
|
|
28
|
-
"import",
|
|
29
|
-
"sync",
|
|
30
|
-
"validate"
|
|
31
|
-
]).default("validate"),
|
|
32
|
-
tags: z$2.array(z$2.string()).optional(),
|
|
33
|
-
exclude: z$2.array(z$2.string()).optional(),
|
|
34
|
-
include: z$2.array(z$2.string()).optional(),
|
|
35
|
-
prefix: z$2.string().optional(),
|
|
36
|
-
defaultStability: z$2.enum([
|
|
37
|
-
"experimental",
|
|
38
|
-
"beta",
|
|
39
|
-
"stable",
|
|
40
|
-
"deprecated"
|
|
41
|
-
]).optional(),
|
|
42
|
-
defaultAuth: z$2.enum([
|
|
43
|
-
"anonymous",
|
|
44
|
-
"user",
|
|
45
|
-
"admin"
|
|
46
|
-
]).optional(),
|
|
47
|
-
defaultOwners: z$2.array(z$2.string()).optional(),
|
|
48
|
-
schemaFormat: SchemaFormatSchema.default("contractspec")
|
|
49
|
-
});
|
|
50
|
-
const OpenApiExportConfigSchema = z$2.object({
|
|
51
|
-
outputPath: z$2.string().default("./openapi.json"),
|
|
52
|
-
format: z$2.enum(["json", "yaml"]).default("json"),
|
|
53
|
-
title: z$2.string().optional(),
|
|
54
|
-
version: z$2.string().optional(),
|
|
55
|
-
description: z$2.string().optional(),
|
|
56
|
-
servers: z$2.array(z$2.object({
|
|
57
|
-
url: z$2.string(),
|
|
58
|
-
description: z$2.string().optional()
|
|
59
|
-
})).optional()
|
|
60
|
-
});
|
|
61
|
-
/**
|
|
62
|
-
* OpenAPI configuration section.
|
|
63
|
-
*/
|
|
64
|
-
const OpenApiConfigSchema = z$2.object({
|
|
65
|
-
sources: z$2.array(OpenApiSourceConfigSchema).optional(),
|
|
66
|
-
export: OpenApiExportConfigSchema.optional()
|
|
67
|
-
});
|
|
68
|
-
/**
|
|
69
|
-
* Grouping strategy for organizing specs.
|
|
70
|
-
*/
|
|
71
|
-
const GroupingStrategySchema = z$2.enum([
|
|
72
|
-
"by-tag",
|
|
73
|
-
"by-owner",
|
|
74
|
-
"by-domain",
|
|
75
|
-
"by-url-path-single",
|
|
76
|
-
"by-url-path-multi",
|
|
77
|
-
"by-feature",
|
|
78
|
-
"none"
|
|
79
|
-
]);
|
|
80
|
-
/**
|
|
81
|
-
* Grouping rule configuration.
|
|
82
|
-
*/
|
|
83
|
-
const GroupingRuleSchema = z$2.object({
|
|
84
|
-
strategy: GroupingStrategySchema,
|
|
85
|
-
urlPathLevel: z$2.number().optional(),
|
|
86
|
-
pattern: z$2.string().optional()
|
|
87
|
-
});
|
|
88
|
-
/**
|
|
89
|
-
* Output directory conventions for generated specs.
|
|
90
|
-
*/
|
|
91
|
-
const FolderConventionsSchema = z$2.object({
|
|
92
|
-
models: z$2.string().default("models"),
|
|
93
|
-
operations: z$2.string().default("operations/commands|queries"),
|
|
94
|
-
events: z$2.string().default("events"),
|
|
95
|
-
presentations: z$2.string().default("presentations"),
|
|
96
|
-
forms: z$2.string().default("forms"),
|
|
97
|
-
groupByFeature: z$2.boolean().default(true),
|
|
98
|
-
operationsGrouping: GroupingRuleSchema.optional(),
|
|
99
|
-
modelsGrouping: GroupingRuleSchema.optional(),
|
|
100
|
-
eventsGrouping: GroupingRuleSchema.optional()
|
|
101
|
-
});
|
|
102
|
-
/**
|
|
103
|
-
* PR comment configuration for CI/CD.
|
|
104
|
-
*/
|
|
105
|
-
const PrCommentConfigSchema = z$2.object({
|
|
106
|
-
enabled: z$2.boolean().default(true),
|
|
107
|
-
template: z$2.enum(["minimal", "detailed"]).default("detailed"),
|
|
108
|
-
updateExisting: z$2.boolean().default(true)
|
|
109
|
-
});
|
|
110
|
-
/**
|
|
111
|
-
* GitHub check run configuration for CI/CD.
|
|
112
|
-
*/
|
|
113
|
-
const CheckRunConfigSchema = z$2.object({
|
|
114
|
-
enabled: z$2.boolean().default(true),
|
|
115
|
-
name: z$2.string().default("ContractSpec Impact"),
|
|
116
|
-
failOnBreaking: z$2.boolean().default(true),
|
|
117
|
-
failOnChanges: z$2.boolean().default(false)
|
|
118
|
-
});
|
|
119
|
-
/**
|
|
120
|
-
* Impact detection configuration for CI/CD.
|
|
121
|
-
*/
|
|
122
|
-
const ImpactConfigSchema = z$2.object({
|
|
123
|
-
baseline: z$2.string().default("default-branch"),
|
|
124
|
-
include: z$2.array(z$2.string()).optional(),
|
|
125
|
-
exclude: z$2.array(z$2.string()).optional()
|
|
126
|
-
});
|
|
127
|
-
/**
|
|
128
|
-
* CI/CD configuration section.
|
|
129
|
-
*/
|
|
130
|
-
const CiConfigSchema = z$2.object({
|
|
131
|
-
checks: z$2.array(z$2.string()).default([
|
|
132
|
-
"structure",
|
|
133
|
-
"integrity",
|
|
134
|
-
"deps"
|
|
135
|
-
]),
|
|
136
|
-
skipChecks: z$2.array(z$2.string()).optional(),
|
|
137
|
-
failOnWarnings: z$2.boolean().default(false),
|
|
138
|
-
uploadSarif: z$2.boolean().default(true),
|
|
139
|
-
prComment: PrCommentConfigSchema.optional(),
|
|
140
|
-
checkRun: CheckRunConfigSchema.optional(),
|
|
141
|
-
impact: ImpactConfigSchema.optional()
|
|
142
|
-
});
|
|
143
|
-
/**
|
|
144
|
-
* External workspace reference for cross-workspace dependencies in meta-repos.
|
|
145
|
-
*/
|
|
146
|
-
const ExternalWorkspaceSchema = z$2.object({
|
|
147
|
-
alias: z$2.string(),
|
|
148
|
-
submodule: z$2.string(),
|
|
149
|
-
packages: z$2.array(z$2.string()).optional(),
|
|
150
|
-
autoResolve: z$2.boolean().default(true)
|
|
151
|
-
});
|
|
152
|
-
/**
|
|
153
|
-
* Meta-repo configuration section.
|
|
154
|
-
*/
|
|
155
|
-
const MetaRepoConfigSchema = z$2.object({
|
|
156
|
-
activeScope: z$2.string().optional(),
|
|
157
|
-
externalWorkspaces: z$2.array(ExternalWorkspaceSchema).optional(),
|
|
158
|
-
crossWorkspaceSearch: z$2.boolean().default(false)
|
|
159
|
-
});
|
|
160
|
-
/**
|
|
161
|
-
* Supported formatter tools.
|
|
162
|
-
*/
|
|
163
|
-
const FormatterTypeSchema = z$2.enum([
|
|
164
|
-
"prettier",
|
|
165
|
-
"eslint",
|
|
166
|
-
"biome",
|
|
167
|
-
"dprint",
|
|
168
|
-
"custom"
|
|
169
|
-
]);
|
|
170
|
-
/**
|
|
171
|
-
* Formatter configuration for code generation.
|
|
172
|
-
*/
|
|
173
|
-
const FormatterConfigSchema = z$2.object({
|
|
174
|
-
enabled: z$2.boolean().default(true),
|
|
175
|
-
type: FormatterTypeSchema.optional(),
|
|
176
|
-
command: z$2.string().optional(),
|
|
177
|
-
args: z$2.array(z$2.string()).optional(),
|
|
178
|
-
timeout: z$2.number().default(3e4)
|
|
179
|
-
});
|
|
180
|
-
/**
|
|
181
|
-
* Rule severity levels (inspired by ESLint).
|
|
182
|
-
*/
|
|
183
|
-
const RuleSeveritySchema = z$2.enum([
|
|
184
|
-
"off",
|
|
185
|
-
"warn",
|
|
186
|
-
"error"
|
|
187
|
-
]);
|
|
188
|
-
/**
|
|
189
|
-
* Contract kinds for per-kind rule overrides.
|
|
190
|
-
*/
|
|
191
|
-
const SpecKindSchema = z$2.enum([
|
|
192
|
-
"operation",
|
|
193
|
-
"event",
|
|
194
|
-
"presentation",
|
|
195
|
-
"feature",
|
|
196
|
-
"workflow",
|
|
197
|
-
"data-view",
|
|
198
|
-
"migration",
|
|
199
|
-
"telemetry",
|
|
200
|
-
"experiment",
|
|
201
|
-
"app-config"
|
|
202
|
-
]);
|
|
203
|
-
/**
|
|
204
|
-
* Available lint rules with their severity.
|
|
205
|
-
*/
|
|
206
|
-
const LintRulesSchema = z$2.object({
|
|
207
|
-
"require-acceptance": RuleSeveritySchema.optional(),
|
|
208
|
-
"require-examples": RuleSeveritySchema.optional(),
|
|
209
|
-
"require-stability": RuleSeveritySchema.optional(),
|
|
210
|
-
"require-owners-format": RuleSeveritySchema.optional(),
|
|
211
|
-
"event-past-tense": RuleSeveritySchema.optional(),
|
|
212
|
-
"no-todo": RuleSeveritySchema.optional(),
|
|
213
|
-
"workflow-transitions": RuleSeveritySchema.optional(),
|
|
214
|
-
"telemetry-privacy": RuleSeveritySchema.optional(),
|
|
215
|
-
"experiment-allocation": RuleSeveritySchema.optional(),
|
|
216
|
-
"app-config-appid": RuleSeveritySchema.optional(),
|
|
217
|
-
"app-config-capabilities": RuleSeveritySchema.optional(),
|
|
218
|
-
"data-view-fields": RuleSeveritySchema.optional()
|
|
219
|
-
});
|
|
220
|
-
/**
|
|
221
|
-
* Full rules configuration with global defaults and per-kind overrides.
|
|
222
|
-
*/
|
|
223
|
-
const RulesConfigSchema = z$2.object({
|
|
224
|
-
defaults: LintRulesSchema.optional(),
|
|
225
|
-
overrides: z$2.record(SpecKindSchema, LintRulesSchema).optional()
|
|
226
|
-
});
|
|
227
|
-
/**
|
|
228
|
-
* Full ContractSpec configuration schema (.contractsrc.json).
|
|
229
|
-
*/
|
|
230
|
-
const ContractsrcSchema = z$2.object({
|
|
231
|
-
aiProvider: z$2.enum([
|
|
232
|
-
"claude",
|
|
233
|
-
"openai",
|
|
234
|
-
"ollama",
|
|
235
|
-
"custom"
|
|
236
|
-
]).default("claude"),
|
|
237
|
-
aiModel: z$2.string().optional(),
|
|
238
|
-
agentMode: z$2.enum([
|
|
239
|
-
"simple",
|
|
240
|
-
"cursor",
|
|
241
|
-
"claude-code",
|
|
242
|
-
"openai-codex"
|
|
243
|
-
]).default("simple"),
|
|
244
|
-
customEndpoint: z$2.url().nullable().optional(),
|
|
245
|
-
customApiKey: z$2.string().nullable().optional(),
|
|
246
|
-
outputDir: z$2.string().default("./src"),
|
|
247
|
-
conventions: FolderConventionsSchema,
|
|
248
|
-
defaultOwners: z$2.array(z$2.string()).default([]),
|
|
249
|
-
defaultTags: z$2.array(z$2.string()).default([]),
|
|
250
|
-
packages: z$2.array(z$2.string()).optional(),
|
|
251
|
-
excludePackages: z$2.array(z$2.string()).optional(),
|
|
252
|
-
recursive: z$2.boolean().optional(),
|
|
253
|
-
openapi: OpenApiConfigSchema.optional(),
|
|
254
|
-
ci: CiConfigSchema.optional(),
|
|
255
|
-
metaRepo: MetaRepoConfigSchema.optional(),
|
|
256
|
-
rules: RulesConfigSchema.optional(),
|
|
257
|
-
schemaFormat: SchemaFormatSchema.default("contractspec"),
|
|
258
|
-
formatter: FormatterConfigSchema.optional()
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
//#endregion
|
|
262
|
-
export { FolderConventionsSchema, FormatterConfigSchema, FormatterTypeSchema, OpenApiConfigSchema, OpenApiExportConfigSchema, OpenApiSourceConfigSchema, SchemaFormatSchema };
|
|
263
|
-
//# sourceMappingURL=contractsrc-schema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contractsrc-schema.js","names":[],"sources":["../../../../../../../libs/contracts/dist/workspace-config/contractsrc-schema.js"],"sourcesContent":["import * as z$2 from \"zod\";\n\n//#region src/workspace-config/contractsrc-schema.ts\n/**\n* ContractSpec configuration schema definitions.\n*\n* These schemas define the structure of .contractsrc.json files\n* and are shared across CLI tools and libraries.\n*/\n/**\n* Schema output format for code generation.\n* Controls how imported/generated schemas are written.\n*/\nconst SchemaFormatSchema = z$2.enum([\n\t\"contractspec\",\n\t\"zod\",\n\t\"json-schema\",\n\t\"graphql\"\n]);\n/**\n* OpenAPI source configuration for import/sync/validate operations.\n*/\nconst OpenApiSourceConfigSchema = z$2.object({\n\tname: z$2.string(),\n\turl: z$2.url().optional(),\n\tfile: z$2.string().optional(),\n\tsyncMode: z$2.enum([\n\t\t\"import\",\n\t\t\"sync\",\n\t\t\"validate\"\n\t]).default(\"validate\"),\n\ttags: z$2.array(z$2.string()).optional(),\n\texclude: z$2.array(z$2.string()).optional(),\n\tinclude: z$2.array(z$2.string()).optional(),\n\tprefix: z$2.string().optional(),\n\tdefaultStability: z$2.enum([\n\t\t\"experimental\",\n\t\t\"beta\",\n\t\t\"stable\",\n\t\t\"deprecated\"\n\t]).optional(),\n\tdefaultAuth: z$2.enum([\n\t\t\"anonymous\",\n\t\t\"user\",\n\t\t\"admin\"\n\t]).optional(),\n\tdefaultOwners: z$2.array(z$2.string()).optional(),\n\tschemaFormat: SchemaFormatSchema.default(\"contractspec\")\n});\nconst OpenApiExportConfigSchema = z$2.object({\n\toutputPath: z$2.string().default(\"./openapi.json\"),\n\tformat: z$2.enum([\"json\", \"yaml\"]).default(\"json\"),\n\ttitle: z$2.string().optional(),\n\tversion: z$2.string().optional(),\n\tdescription: z$2.string().optional(),\n\tservers: z$2.array(z$2.object({\n\t\turl: z$2.string(),\n\t\tdescription: z$2.string().optional()\n\t})).optional()\n});\n/**\n* OpenAPI configuration section.\n*/\nconst OpenApiConfigSchema = z$2.object({\n\tsources: z$2.array(OpenApiSourceConfigSchema).optional(),\n\texport: OpenApiExportConfigSchema.optional()\n});\n/**\n* Grouping strategy for organizing specs.\n*/\nconst GroupingStrategySchema = z$2.enum([\n\t\"by-tag\",\n\t\"by-owner\",\n\t\"by-domain\",\n\t\"by-url-path-single\",\n\t\"by-url-path-multi\",\n\t\"by-feature\",\n\t\"none\"\n]);\n/**\n* Grouping rule configuration.\n*/\nconst GroupingRuleSchema = z$2.object({\n\tstrategy: GroupingStrategySchema,\n\turlPathLevel: z$2.number().optional(),\n\tpattern: z$2.string().optional()\n});\n/**\n* Output directory conventions for generated specs.\n*/\nconst FolderConventionsSchema = z$2.object({\n\tmodels: z$2.string().default(\"models\"),\n\toperations: z$2.string().default(\"operations/commands|queries\"),\n\tevents: z$2.string().default(\"events\"),\n\tpresentations: z$2.string().default(\"presentations\"),\n\tforms: z$2.string().default(\"forms\"),\n\tgroupByFeature: z$2.boolean().default(true),\n\toperationsGrouping: GroupingRuleSchema.optional(),\n\tmodelsGrouping: GroupingRuleSchema.optional(),\n\teventsGrouping: GroupingRuleSchema.optional()\n});\n/**\n* PR comment configuration for CI/CD.\n*/\nconst PrCommentConfigSchema = z$2.object({\n\tenabled: z$2.boolean().default(true),\n\ttemplate: z$2.enum([\"minimal\", \"detailed\"]).default(\"detailed\"),\n\tupdateExisting: z$2.boolean().default(true)\n});\n/**\n* GitHub check run configuration for CI/CD.\n*/\nconst CheckRunConfigSchema = z$2.object({\n\tenabled: z$2.boolean().default(true),\n\tname: z$2.string().default(\"ContractSpec Impact\"),\n\tfailOnBreaking: z$2.boolean().default(true),\n\tfailOnChanges: z$2.boolean().default(false)\n});\n/**\n* Impact detection configuration for CI/CD.\n*/\nconst ImpactConfigSchema = z$2.object({\n\tbaseline: z$2.string().default(\"default-branch\"),\n\tinclude: z$2.array(z$2.string()).optional(),\n\texclude: z$2.array(z$2.string()).optional()\n});\n/**\n* CI/CD configuration section.\n*/\nconst CiConfigSchema = z$2.object({\n\tchecks: z$2.array(z$2.string()).default([\n\t\t\"structure\",\n\t\t\"integrity\",\n\t\t\"deps\"\n\t]),\n\tskipChecks: z$2.array(z$2.string()).optional(),\n\tfailOnWarnings: z$2.boolean().default(false),\n\tuploadSarif: z$2.boolean().default(true),\n\tprComment: PrCommentConfigSchema.optional(),\n\tcheckRun: CheckRunConfigSchema.optional(),\n\timpact: ImpactConfigSchema.optional()\n});\n/**\n* External workspace reference for cross-workspace dependencies in meta-repos.\n*/\nconst ExternalWorkspaceSchema = z$2.object({\n\talias: z$2.string(),\n\tsubmodule: z$2.string(),\n\tpackages: z$2.array(z$2.string()).optional(),\n\tautoResolve: z$2.boolean().default(true)\n});\n/**\n* Meta-repo configuration section.\n*/\nconst MetaRepoConfigSchema = z$2.object({\n\tactiveScope: z$2.string().optional(),\n\texternalWorkspaces: z$2.array(ExternalWorkspaceSchema).optional(),\n\tcrossWorkspaceSearch: z$2.boolean().default(false)\n});\n/**\n* Supported formatter tools.\n*/\nconst FormatterTypeSchema = z$2.enum([\n\t\"prettier\",\n\t\"eslint\",\n\t\"biome\",\n\t\"dprint\",\n\t\"custom\"\n]);\n/**\n* Formatter configuration for code generation.\n*/\nconst FormatterConfigSchema = z$2.object({\n\tenabled: z$2.boolean().default(true),\n\ttype: FormatterTypeSchema.optional(),\n\tcommand: z$2.string().optional(),\n\targs: z$2.array(z$2.string()).optional(),\n\ttimeout: z$2.number().default(3e4)\n});\n/**\n* Rule severity levels (inspired by ESLint).\n*/\nconst RuleSeveritySchema = z$2.enum([\n\t\"off\",\n\t\"warn\",\n\t\"error\"\n]);\n/**\n* Contract kinds for per-kind rule overrides.\n*/\nconst SpecKindSchema = z$2.enum([\n\t\"operation\",\n\t\"event\",\n\t\"presentation\",\n\t\"feature\",\n\t\"workflow\",\n\t\"data-view\",\n\t\"migration\",\n\t\"telemetry\",\n\t\"experiment\",\n\t\"app-config\"\n]);\n/**\n* Available lint rules with their severity.\n*/\nconst LintRulesSchema = z$2.object({\n\t\"require-acceptance\": RuleSeveritySchema.optional(),\n\t\"require-examples\": RuleSeveritySchema.optional(),\n\t\"require-stability\": RuleSeveritySchema.optional(),\n\t\"require-owners-format\": RuleSeveritySchema.optional(),\n\t\"event-past-tense\": RuleSeveritySchema.optional(),\n\t\"no-todo\": RuleSeveritySchema.optional(),\n\t\"workflow-transitions\": RuleSeveritySchema.optional(),\n\t\"telemetry-privacy\": RuleSeveritySchema.optional(),\n\t\"experiment-allocation\": RuleSeveritySchema.optional(),\n\t\"app-config-appid\": RuleSeveritySchema.optional(),\n\t\"app-config-capabilities\": RuleSeveritySchema.optional(),\n\t\"data-view-fields\": RuleSeveritySchema.optional()\n});\n/**\n* Full rules configuration with global defaults and per-kind overrides.\n*/\nconst RulesConfigSchema = z$2.object({\n\tdefaults: LintRulesSchema.optional(),\n\toverrides: z$2.record(SpecKindSchema, LintRulesSchema).optional()\n});\n/**\n* Full ContractSpec configuration schema (.contractsrc.json).\n*/\nconst ContractsrcSchema = z$2.object({\n\taiProvider: z$2.enum([\n\t\t\"claude\",\n\t\t\"openai\",\n\t\t\"ollama\",\n\t\t\"custom\"\n\t]).default(\"claude\"),\n\taiModel: z$2.string().optional(),\n\tagentMode: z$2.enum([\n\t\t\"simple\",\n\t\t\"cursor\",\n\t\t\"claude-code\",\n\t\t\"openai-codex\"\n\t]).default(\"simple\"),\n\tcustomEndpoint: z$2.url().nullable().optional(),\n\tcustomApiKey: z$2.string().nullable().optional(),\n\toutputDir: z$2.string().default(\"./src\"),\n\tconventions: FolderConventionsSchema,\n\tdefaultOwners: z$2.array(z$2.string()).default([]),\n\tdefaultTags: z$2.array(z$2.string()).default([]),\n\tpackages: z$2.array(z$2.string()).optional(),\n\texcludePackages: z$2.array(z$2.string()).optional(),\n\trecursive: z$2.boolean().optional(),\n\topenapi: OpenApiConfigSchema.optional(),\n\tci: CiConfigSchema.optional(),\n\tmetaRepo: MetaRepoConfigSchema.optional(),\n\trules: RulesConfigSchema.optional(),\n\tschemaFormat: SchemaFormatSchema.default(\"contractspec\"),\n\tformatter: FormatterConfigSchema.optional()\n});\n/**\n* Default configuration values.\n*/\nconst DEFAULT_CONTRACTSRC = {\n\taiProvider: \"claude\",\n\tagentMode: \"simple\",\n\toutputDir: \"./src\",\n\tconventions: {\n\t\tmodels: \"models\",\n\t\toperations: \"interactions/commands|queries\",\n\t\tevents: \"events\",\n\t\tpresentations: \"presentations\",\n\t\tforms: \"forms\",\n\t\tgroupByFeature: true\n\t},\n\tdefaultOwners: [],\n\tdefaultTags: [],\n\tschemaFormat: \"contractspec\"\n};\n\n//#endregion\nexport { CheckRunConfigSchema, CiConfigSchema, ContractsrcSchema, DEFAULT_CONTRACTSRC, ExternalWorkspaceSchema, FolderConventionsSchema, FormatterConfigSchema, FormatterTypeSchema, GroupingRuleSchema, GroupingStrategySchema, ImpactConfigSchema, LintRulesSchema, MetaRepoConfigSchema, OpenApiConfigSchema, OpenApiExportConfigSchema, OpenApiSourceConfigSchema, PrCommentConfigSchema, RuleSeveritySchema, RulesConfigSchema, SchemaFormatSchema, SpecKindSchema };"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { FolderConventionsSchema, FormatterConfigSchema, FormatterTypeSchema, OpenApiConfigSchema, OpenApiExportConfigSchema, OpenApiSourceConfigSchema, SchemaFormatSchema } from "./contractsrc-schema.js";
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { registerDocBlocks } from "../docs/registry.js";
|
|
2
|
-
|
|
3
|
-
//#region ../../libs/contracts/dist/workspace-config/workspace-config.docblock.js
|
|
4
|
-
const tech_workspace_config_DocBlocks = [{
|
|
5
|
-
id: "docs.tech.contracts.workspace-config",
|
|
6
|
-
title: "Workspace Configuration (.contractsrc)",
|
|
7
|
-
summary: "Configuration-as-code conventions for ContractSpec workspaces (`.contractsrc.json`).",
|
|
8
|
-
kind: "reference",
|
|
9
|
-
visibility: "public",
|
|
10
|
-
route: "/docs/tech/contracts/workspace-config",
|
|
11
|
-
tags: [
|
|
12
|
-
"tech",
|
|
13
|
-
"contracts",
|
|
14
|
-
"config"
|
|
15
|
-
],
|
|
16
|
-
body: `## Workspace Configuration (.contractsrc)
|
|
17
|
-
|
|
18
|
-
ContractSpec uses a hierarchical configuration system anchored by \`.contractsrc.json\` files. Configuration loader supports standard rc-file discovery (cosmiconfig).
|
|
19
|
-
|
|
20
|
-
### Schema Formats
|
|
21
|
-
|
|
22
|
-
The \`schemaFormat\` option controls the output format of schema generation commands (like \`contractspec openapi import\`).
|
|
23
|
-
|
|
24
|
-
Supported formats:
|
|
25
|
-
- \`contractspec\` (default): Generates standard \`defineSchemaModel\` code.
|
|
26
|
-
- \`zod\`: Generates raw Zod schemas using \`z.object({...})\`.
|
|
27
|
-
- \`json-schema\`: Generates JSON Schema definitions.
|
|
28
|
-
- \`graphql\`: Generates GraphQL SDL type definitions.
|
|
29
|
-
|
|
30
|
-
### Config Interface
|
|
31
|
-
|
|
32
|
-
\`\`\`ts
|
|
33
|
-
export interface ContractsrcConfig {
|
|
34
|
-
// ... existing fields ...
|
|
35
|
-
schemaFormat?: 'contractspec' | 'zod' | 'json-schema' | 'graphql';
|
|
36
|
-
}
|
|
37
|
-
\`\`\`
|
|
38
|
-
|
|
39
|
-
Defined in \`@contractspec/lib.contracts/workspace-config\`.
|
|
40
|
-
`
|
|
41
|
-
}];
|
|
42
|
-
registerDocBlocks(tech_workspace_config_DocBlocks);
|
|
43
|
-
|
|
44
|
-
//#endregion
|
|
45
|
-
//# sourceMappingURL=workspace-config.docblock.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-config.docblock.js","names":[],"sources":["../../../../../../../libs/contracts/dist/workspace-config/workspace-config.docblock.js"],"sourcesContent":["import { registerDocBlocks } from \"../docs/registry.js\";\n\n//#region src/workspace-config/workspace-config.docblock.ts\nconst tech_workspace_config_DocBlocks = [{\n\tid: \"docs.tech.contracts.workspace-config\",\n\ttitle: \"Workspace Configuration (.contractsrc)\",\n\tsummary: \"Configuration-as-code conventions for ContractSpec workspaces (`.contractsrc.json`).\",\n\tkind: \"reference\",\n\tvisibility: \"public\",\n\troute: \"/docs/tech/contracts/workspace-config\",\n\ttags: [\n\t\t\"tech\",\n\t\t\"contracts\",\n\t\t\"config\"\n\t],\n\tbody: `## Workspace Configuration (.contractsrc)\n\nContractSpec uses a hierarchical configuration system anchored by \\`.contractsrc.json\\` files. Configuration loader supports standard rc-file discovery (cosmiconfig).\n\n### Schema Formats\n\nThe \\`schemaFormat\\` option controls the output format of schema generation commands (like \\`contractspec openapi import\\`).\n\nSupported formats:\n- \\`contractspec\\` (default): Generates standard \\`defineSchemaModel\\` code.\n- \\`zod\\`: Generates raw Zod schemas using \\`z.object({...})\\`.\n- \\`json-schema\\`: Generates JSON Schema definitions.\n- \\`graphql\\`: Generates GraphQL SDL type definitions.\n\n### Config Interface\n\n\\`\\`\\`ts\nexport interface ContractsrcConfig {\n // ... existing fields ...\n schemaFormat?: 'contractspec' | 'zod' | 'json-schema' | 'graphql';\n}\n\\`\\`\\`\n\nDefined in \\`@contractspec/lib.contracts/workspace-config\\`.\n`\n}];\nregisterDocBlocks(tech_workspace_config_DocBlocks);\n\n//#endregion\nexport { tech_workspace_config_DocBlocks };"],"mappings":";;;AAGA,MAAM,kCAAkC,CAAC;CACxC,IAAI;CACJ,OAAO;CACP,SAAS;CACT,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EACL;EACA;EACA;EACA;CACD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;CAyBN,CAAC;AACF,kBAAkB,gCAAgC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import "zod";
|
|
2
|
-
import { GraphQLScalarType } from "graphql";
|
|
3
|
-
|
|
4
|
-
//#region ../../libs/schema/dist/FieldType.js
|
|
5
|
-
/**
|
|
6
|
-
* GraphQL scalar wrapper that carries zod and JSON Schema metadata.
|
|
7
|
-
*
|
|
8
|
-
* TInternal is the runtime representation; TExternal is the GraphQL output.
|
|
9
|
-
*/
|
|
10
|
-
var FieldType = class extends GraphQLScalarType {
|
|
11
|
-
zodSchema;
|
|
12
|
-
jsonSchemaDef;
|
|
13
|
-
constructor(config) {
|
|
14
|
-
super(config);
|
|
15
|
-
this.zodSchema = config.zod;
|
|
16
|
-
this.jsonSchemaDef = config.jsonSchema;
|
|
17
|
-
}
|
|
18
|
-
/** Return the attached zod schema for validation. */
|
|
19
|
-
getZod() {
|
|
20
|
-
return this.zodSchema;
|
|
21
|
-
}
|
|
22
|
-
/** GraphQL scalar instance usable by Pothos or vanilla GraphQL. */
|
|
23
|
-
getPothos() {
|
|
24
|
-
return this;
|
|
25
|
-
}
|
|
26
|
-
/** Return the JSON Schema (evaluates factory if provided). */
|
|
27
|
-
getJson() {
|
|
28
|
-
return typeof this.jsonSchemaDef === "function" ? this.jsonSchemaDef() : this.jsonSchemaDef;
|
|
29
|
-
}
|
|
30
|
-
getJsonSchemaDef() {
|
|
31
|
-
return this.jsonSchemaDef;
|
|
32
|
-
}
|
|
33
|
-
getJsonSchema() {
|
|
34
|
-
const deepResolve = (v) => {
|
|
35
|
-
const value = typeof v === "function" ? v() : v;
|
|
36
|
-
if (Array.isArray(value)) return value.map((item) => deepResolve(item));
|
|
37
|
-
if (value && typeof value === "object") {
|
|
38
|
-
const obj = {};
|
|
39
|
-
for (const [k, val] of Object.entries(value)) obj[k] = deepResolve(val);
|
|
40
|
-
return obj;
|
|
41
|
-
}
|
|
42
|
-
return value;
|
|
43
|
-
};
|
|
44
|
-
return deepResolve(this.getJson());
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
//#endregion
|
|
49
|
-
export { FieldType };
|
|
50
|
-
//# sourceMappingURL=FieldType.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FieldType.js","names":[],"sources":["../../../../../../libs/schema/dist/FieldType.js"],"sourcesContent":["import \"zod\";\nimport { GraphQLScalarType } from \"graphql\";\n\n//#region src/FieldType.ts\n/**\n* GraphQL scalar wrapper that carries zod and JSON Schema metadata.\n*\n* TInternal is the runtime representation; TExternal is the GraphQL output.\n*/\nvar FieldType = class extends GraphQLScalarType {\n\tzodSchema;\n\tjsonSchemaDef;\n\tconstructor(config) {\n\t\tsuper(config);\n\t\tthis.zodSchema = config.zod;\n\t\tthis.jsonSchemaDef = config.jsonSchema;\n\t}\n\t/** Return the attached zod schema for validation. */\n\tgetZod() {\n\t\treturn this.zodSchema;\n\t}\n\t/** GraphQL scalar instance usable by Pothos or vanilla GraphQL. */\n\tgetPothos() {\n\t\treturn this;\n\t}\n\t/** Return the JSON Schema (evaluates factory if provided). */\n\tgetJson() {\n\t\treturn typeof this.jsonSchemaDef === \"function\" ? this.jsonSchemaDef() : this.jsonSchemaDef;\n\t}\n\tgetJsonSchemaDef() {\n\t\treturn this.jsonSchemaDef;\n\t}\n\tgetJsonSchema() {\n\t\tconst deepResolve = (v) => {\n\t\t\tconst value = typeof v === \"function\" ? v() : v;\n\t\t\tif (Array.isArray(value)) return value.map((item) => deepResolve(item));\n\t\t\tif (value && typeof value === \"object\") {\n\t\t\t\tconst obj = {};\n\t\t\t\tfor (const [k, val] of Object.entries(value)) obj[k] = deepResolve(val);\n\t\t\t\treturn obj;\n\t\t\t}\n\t\t\treturn value;\n\t\t};\n\t\treturn deepResolve(this.getJson());\n\t}\n};\n\n//#endregion\nexport { FieldType };\n//# sourceMappingURL=FieldType.js.map"],"mappings":";;;;;;;;;AASA,IAAI,YAAY,cAAc,kBAAkB;CAC/C;CACA;CACA,YAAY,QAAQ;AACnB,QAAM,OAAO;AACb,OAAK,YAAY,OAAO;AACxB,OAAK,gBAAgB,OAAO;;;CAG7B,SAAS;AACR,SAAO,KAAK;;;CAGb,YAAY;AACX,SAAO;;;CAGR,UAAU;AACT,SAAO,OAAO,KAAK,kBAAkB,aAAa,KAAK,eAAe,GAAG,KAAK;;CAE/E,mBAAmB;AAClB,SAAO,KAAK;;CAEb,gBAAgB;EACf,MAAM,eAAe,MAAM;GAC1B,MAAM,QAAQ,OAAO,MAAM,aAAa,GAAG,GAAG;AAC9C,OAAI,MAAM,QAAQ,MAAM,CAAE,QAAO,MAAM,KAAK,SAAS,YAAY,KAAK,CAAC;AACvE,OAAI,SAAS,OAAO,UAAU,UAAU;IACvC,MAAM,MAAM,EAAE;AACd,SAAK,MAAM,CAAC,GAAG,QAAQ,OAAO,QAAQ,MAAM,CAAE,KAAI,KAAK,YAAY,IAAI;AACvE,WAAO;;AAER,UAAO;;AAER,SAAO,YAAY,KAAK,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import "zod";
|