@lssm/lib.contracts 0.0.0-canary-20251212230121 → 0.0.0-canary-20251213172311
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/contract-registry/index.js +1 -0
- package/dist/contract-registry/schemas.js +1 -0
- package/dist/contract-registry/types.js +0 -0
- package/dist/docs/index.js +1 -1
- package/dist/docs/tech/contracts/README.docblock.js +1 -1
- package/dist/docs/tech/contracts/openapi-export.docblock.js +38 -0
- package/dist/docs/tech/mcp-endpoints.docblock.js +1 -1
- package/dist/docs/tech/telemetry-ingest.docblock.js +122 -0
- package/dist/docs/tech/vscode-extension.docblock.js +68 -0
- package/dist/index.js +1 -1
- package/dist/integrations/index.js +1 -1
- package/dist/integrations/providers/impls/index.js +1 -1
- package/dist/integrations/providers/impls/provider-factory.js +1 -1
- package/dist/integrations/providers/index.js +1 -1
- package/dist/integrations/secrets/index.js +1 -1
- package/dist/jobs/define-job.js +1 -1
- package/dist/jobs/gcp-cloud-tasks.js +1 -1
- package/dist/jobs/gcp-pubsub.js +1 -1
- package/dist/jobs/handlers/index.js +1 -1
- package/dist/jobs/index.js +1 -1
- package/dist/jobs/memory-queue.js +1 -1
- package/dist/jobs/queue.js +1 -0
- package/dist/jobs/scaleway-sqs-queue.js +1 -1
- package/dist/openapi.js +1 -0
- package/dist/server/index.js +1 -1
- package/dist/server/mcp/createMcpServer.js +1 -0
- package/dist/server/mcp/mcpTypes.js +0 -0
- package/dist/server/mcp/registerPresentations.js +1 -0
- package/dist/server/mcp/registerPrompts.js +3 -0
- package/dist/server/mcp/registerResources.js +1 -0
- package/dist/server/mcp/registerTools.js +1 -0
- package/dist/server/provider-mcp.js +1 -1
- package/package.json +28 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/Options.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/Refs.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/index.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parseDef.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +0 -3
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/selectParser.js +0 -1
- package/dist/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ContractRegistryFileSchema as e,ContractRegistryItemSchema as t,ContractRegistryItemTypeSchema as n,ContractRegistryManifestSchema as r}from"./schemas.js";export{e as ContractRegistryFileSchema,t as ContractRegistryItemSchema,n as ContractRegistryItemTypeSchema,r as ContractRegistryManifestSchema};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{StabilityEnum as e}from"../ownership.js";import t from"zod";const n=t.enum([`contractspec:operation`,`contractspec:event`,`contractspec:presentation`,`contractspec:form`,`contractspec:feature`,`contractspec:workflow`,`contractspec:template`,`contractspec:integration`,`contractspec:data-view`,`contractspec:migration`,`contractspec:telemetry`,`contractspec:experiment`,`contractspec:app-config`,`contractspec:knowledge`]),r=t.object({path:t.string().min(1),type:t.string().min(1),content:t.string().optional()}),i=t.object({name:t.string().min(1),type:n,version:t.number().int().nonnegative(),title:t.string().min(1),description:t.string().min(1),meta:t.object({stability:t.enum([e.Idea,e.InCreation,e.Experimental,e.Beta,e.Stable,e.Deprecated]),owners:t.array(t.string().min(1)).default([]),tags:t.array(t.string().min(1)).default([])}),dependencies:t.array(t.string().min(1)).optional(),registryDependencies:t.array(t.string().min(1)).optional(),files:t.array(r).min(1),schema:t.object({input:t.unknown().optional(),output:t.unknown().optional()}).optional()}),a=t.object({$schema:t.string().min(1).optional(),name:t.string().min(1),homepage:t.string().min(1).optional(),items:t.array(i)});export{r as ContractRegistryFileSchema,i as ContractRegistryItemSchema,n as ContractRegistryItemTypeSchema,a as ContractRegistryManifestSchema};
|
|
File without changes
|
package/dist/docs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{docBlockToPresentationSpec as e,docBlockToPresentationV2 as t,docBlocksToPresentationRoutes as n,docBlocksToPresentationSpecs as r,mapDocRoutes as i}from"./presentations.js";import{DocRegistry as a,defaultDocRegistry as o,docId as s,listRegisteredDocBlocks as c,registerDocBlocks as l}from"./registry.js";import{techContractsDocs as u}from"./tech-contracts.docs.js";import{metaDocs as d}from"./meta.docs.js";import"./PUBLISHING.docblock.js";import"./accessibility_wcag_compliance_specs.docblock.js";import"./tech/PHASE_1_QUICKSTART.docblock.js";import"./tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js";import"./tech/PHASE_3_AUTO_EVOLUTION.docblock.js";import"./tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js";import"./tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js";import"./tech/lifecycle-stage-system.docblock.js";import"./tech/presentation-runtime.docblock.js";import"./tech/schema/README.docblock.js";import"./tech/templates/runtime.docblock.js";import"./tech/workflows/overview.docblock.js";import"./tech/mcp-endpoints.docblock.js";export{a as DocRegistry,o as defaultDocRegistry,e as docBlockToPresentationSpec,t as docBlockToPresentationV2,n as docBlocksToPresentationRoutes,r as docBlocksToPresentationSpecs,s as docId,c as listRegisteredDocBlocks,i as mapDocRoutes,d as metaDocs,l as registerDocBlocks,u as techContractsDocs};
|
|
1
|
+
import{docBlockToPresentationSpec as e,docBlockToPresentationV2 as t,docBlocksToPresentationRoutes as n,docBlocksToPresentationSpecs as r,mapDocRoutes as i}from"./presentations.js";import{DocRegistry as a,defaultDocRegistry as o,docId as s,listRegisteredDocBlocks as c,registerDocBlocks as l}from"./registry.js";import{techContractsDocs as u}from"./tech-contracts.docs.js";import{metaDocs as d}from"./meta.docs.js";import"./PUBLISHING.docblock.js";import"./accessibility_wcag_compliance_specs.docblock.js";import"./tech/PHASE_1_QUICKSTART.docblock.js";import"./tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js";import"./tech/PHASE_3_AUTO_EVOLUTION.docblock.js";import"./tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js";import"./tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js";import"./tech/lifecycle-stage-system.docblock.js";import"./tech/presentation-runtime.docblock.js";import"./tech/schema/README.docblock.js";import"./tech/templates/runtime.docblock.js";import"./tech/workflows/overview.docblock.js";import"./tech/mcp-endpoints.docblock.js";import"./tech/vscode-extension.docblock.js";import"./tech/telemetry-ingest.docblock.js";import"./tech/contracts/openapi-export.docblock.js";export{a as DocRegistry,o as defaultDocRegistry,e as docBlockToPresentationSpec,t as docBlockToPresentationV2,n as docBlocksToPresentationRoutes,r as docBlocksToPresentationSpecs,s as docId,c as listRegisteredDocBlocks,i as mapDocRoutes,d as metaDocs,l as registerDocBlocks,u as techContractsDocs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{registerDocBlocks as e}from"../../registry.js";const t=[{id:`docs.tech.contracts.README`,title:`Contracts: Specs, Registry, Handlers, Adapters`,summary:"- `packages/lssm/libs/contracts` defines the contracts core (SpecRegistry, ContractSpec, install helpers, REST/MCP adapters).",kind:`reference`,visibility:`public`,route:`/docs/tech/contracts/README`,tags:[`tech`,`contracts`,`README`],body:"## Contracts: Specs, Registry, Handlers, Adapters\n\n### What lives where\n\n- `packages/lssm/libs/contracts` defines the contracts core (SpecRegistry, ContractSpec, install helpers, REST/MCP adapters).\n- `packages/lssm/libs/schema` defines the schema dictionary (`SchemaModel`, `FieldType`) used to describe I/O once and map to multiple targets (zod, GraphQL, JSON Schema).\n- App adapters (e.g. GraphQL) live close to the app. Example: `packages/hcircle/apps/api-coliving/src/graphql/contracts-adapter.ts`.\n\n### npm distribution\n\n- `@lssm/lib.contracts` (root) keeps the legacy \\\"everything\\\" surface for backward compatibility.\n- `@lssm/lib.contracts/client` exposes only browser-safe helpers (React renderers, client SDK, drivers). Import from this entry when bundling for the web or React Native to avoid dragging server adapters.\n- `@lssm/lib.contracts/server` covers HTTP/MCP adapters, registries, integrations, and other Node-only helpers.\n- `@lssm/lib.contracts/types` exports the runtime handler context utilities, while `@lssm/lib.contracts/types/all` re-exports every type alias/interface across the package via `export type` so consumers can import a single module for typings without shipping runtime code.\n- `@lssm/lib.schema`, `@lssm/lib.design-system`, `@lssm/lib.ui-kit`, `@lssm/lib.ui-kit-web`, `@lssm/lib.accessibility`, and the presentation runtime packages are published to npm alongside contracts; prefer the scoped packages to keep tree-shaking intact.\n- Bundlers with conditional exports should resolve subpaths first; keep root imports for server-only code paths.\n\n### Core concepts\n\n- **ContractSpec**: immutable description of an operation.\n - `meta`: `{ name, version, kind: 'query' | 'command' }`\n - `io`: `{ input: SchemaModel | zod schema, output: SchemaModel | zod schema }`\n - `policy`: `{ auth?: {...}, rateLimit?: {...}, flags?: string[] }`\n - `transport.gql.field?`: explicit GraphQL field name (otherwise derived via `defaultGqlField`).\n- **SpecRegistry**: registry of specs + handlers. Use `installOp(reg, spec, handler)` to attach a handler.\n- **Handler**: `(ctx, input) => Promise<output>` implementing the operation.\n- **CapabilitySpec**: canonical capability declaration stored in `src/capabilities.ts`. Tracks `meta` (`{ key, version, kind, title, description, domain, owners, tags, stability }`), `provides` surfaces (`operation`, `event`, `workflow`, `presentation`, `resource`), and `requires` which other capabilities must be present. Enforced during `installFeature`.\n- **PolicySpec**: declarative policy rules (`src/policy/spec.ts`) covering ABAC/ReBAC, consent + rate limit requirements, field-level controls, and PII guidance. `PolicyEngine` evaluates refs, while `OPAPolicyAdapter` lets OPA override/augment runtime decisions.\n- **TelemetrySpec**: analytics definitions (`src/telemetry/spec.ts`) describing event semantics, privacy level, retention, sampling, and anomaly detection. `TelemetryTracker` handles redaction/sampling, `TelemetryAnomalyMonitor` raises alerts, and specs integrate with contracts/workflows via `ctx.telemetry`.\n- **TestSpec**: declarative scenario definitions in `src/tests/spec.ts`. `TestRunner` executes fixtures/actions/assertions against a `SpecRegistry`, and the CLI (`contractspec test`) wraps the runner for automation.\n- **ExperimentSpec**: experiment definitions (`src/experiments/spec.ts`) describing variants, allocation strategies, and success metrics. `ExperimentEvaluator` assigns variants (random/sticky/targeted) and integrates with Policy/Telemetry for safe experimentation.\n- **AppBlueprintSpec / TenantAppConfig**: global blueprints and per-tenant overrides (`src/app-config/spec.ts`). `resolveAppConfig()` merges the two into a `ResolvedAppConfig`, while `composeAppConfig()` hydrates the merged view against registries and reports missing references for safe rollout.\n- **RegeneratorService**: background daemon (`src/regenerator/service.ts`) that consumes telemetry/error/behavior signals, evaluates regeneration rules, and produces `SpecChangeProposal`s for Studio review.\n- **DataViewSpec**: declarative data presentation layer in `src/data-views.ts`. Describes entity projections (`fields`, `filters`, `actions`) with `view.kind` (`list`, `table`, `detail`, `grid`), ties to query operations via `source.primary`, and exposes optional presentation-based empty/error states.\n- **ThemeSpec**: design token + component variant definitions in `src/themes.ts`. Supports inheritance (`extends`), tenant/user overrides, and component-specific variant metadata for the design system.\n- **MigrationSpec**: schema/data migration descriptors (`src/migrations.ts`) with ordered step plans, dependency tracking, and pre/post checks to support automated database/content migrations.\n- **WorkflowSpec**: typed definition of multi-step workflows living in `src/workflow/spec.ts`. `WorkflowRegistry` stores versioned specs, and `validateWorkflowSpec()` (in `src/workflow/validation.ts`) checks graph integrity, step references, and reachability.\n\n### Lifecycle\n\n1. Define the spec (I/O via `SchemaModel` or zod) in a vertical lib (e.g. `contracts-coliving`).\n2. Register it: `installOp(registry, spec, handler)` within the app/service.\n3. Expose it via an adapter (REST, GraphQL, MCP). Each adapter maps the I/O to its transport and enforces policy.\n4. Validate at runtime: parse `input` before executing, parse `output` before returning.\n\n### Adapters\n\n- **REST**: see `packages/lssm/libs/contracts/src/server/rest-*`. Binds routes, validates request/response, maps errors/policies.\n- **MCP**: see `packages/lssm/libs/contracts/src/server/provider-mcp.ts` (standalone MCP server) and `packages/lssm/libs/contracts/src/server/rest-next-mcp.ts` (MCP over Next.js route). Provides tools/resources/prompts
|
|
1
|
+
import{registerDocBlocks as e}from"../../registry.js";const t=[{id:`docs.tech.contracts.README`,title:`Contracts: Specs, Registry, Handlers, Adapters`,summary:"- `packages/lssm/libs/contracts` defines the contracts core (SpecRegistry, ContractSpec, install helpers, REST/MCP adapters).",kind:`reference`,visibility:`public`,route:`/docs/tech/contracts/README`,tags:[`tech`,`contracts`,`README`],body:"## Contracts: Specs, Registry, Handlers, Adapters\n\n### What lives where\n\n- `packages/lssm/libs/contracts` defines the contracts core (SpecRegistry, ContractSpec, install helpers, REST/MCP adapters).\n- `packages/lssm/libs/schema` defines the schema dictionary (`SchemaModel`, `FieldType`) used to describe I/O once and map to multiple targets (zod, GraphQL, JSON Schema).\n- App adapters (e.g. GraphQL) live close to the app. Example: `packages/hcircle/apps/api-coliving/src/graphql/contracts-adapter.ts`.\n\n### npm distribution\n\n- `@lssm/lib.contracts` (root) keeps the legacy \\\"everything\\\" surface for backward compatibility.\n- `@lssm/lib.contracts/client` exposes only browser-safe helpers (React renderers, client SDK, drivers). Import from this entry when bundling for the web or React Native to avoid dragging server adapters.\n- `@lssm/lib.contracts/server` covers HTTP/MCP adapters, registries, integrations, and other Node-only helpers.\n- `@lssm/lib.contracts/types` exports the runtime handler context utilities, while `@lssm/lib.contracts/types/all` re-exports every type alias/interface across the package via `export type` so consumers can import a single module for typings without shipping runtime code.\n- `@lssm/lib.schema`, `@lssm/lib.design-system`, `@lssm/lib.ui-kit`, `@lssm/lib.ui-kit-web`, `@lssm/lib.accessibility`, and the presentation runtime packages are published to npm alongside contracts; prefer the scoped packages to keep tree-shaking intact.\n- Bundlers with conditional exports should resolve subpaths first; keep root imports for server-only code paths.\n\n### Core concepts\n\n- **ContractSpec**: immutable description of an operation.\n - `meta`: `{ name, version, kind: 'query' | 'command' }`\n - `io`: `{ input: SchemaModel | zod schema, output: SchemaModel | zod schema }`\n - `policy`: `{ auth?: {...}, rateLimit?: {...}, flags?: string[] }`\n - `transport.gql.field?`: explicit GraphQL field name (otherwise derived via `defaultGqlField`).\n- **SpecRegistry**: registry of specs + handlers. Use `installOp(reg, spec, handler)` to attach a handler.\n- **Handler**: `(ctx, input) => Promise<output>` implementing the operation.\n- **CapabilitySpec**: canonical capability declaration stored in `src/capabilities.ts`. Tracks `meta` (`{ key, version, kind, title, description, domain, owners, tags, stability }`), `provides` surfaces (`operation`, `event`, `workflow`, `presentation`, `resource`), and `requires` which other capabilities must be present. Enforced during `installFeature`.\n- **PolicySpec**: declarative policy rules (`src/policy/spec.ts`) covering ABAC/ReBAC, consent + rate limit requirements, field-level controls, and PII guidance. `PolicyEngine` evaluates refs, while `OPAPolicyAdapter` lets OPA override/augment runtime decisions.\n- **TelemetrySpec**: analytics definitions (`src/telemetry/spec.ts`) describing event semantics, privacy level, retention, sampling, and anomaly detection. `TelemetryTracker` handles redaction/sampling, `TelemetryAnomalyMonitor` raises alerts, and specs integrate with contracts/workflows via `ctx.telemetry`.\n- **TestSpec**: declarative scenario definitions in `src/tests/spec.ts`. `TestRunner` executes fixtures/actions/assertions against a `SpecRegistry`, and the CLI (`contractspec test`) wraps the runner for automation.\n- **ExperimentSpec**: experiment definitions (`src/experiments/spec.ts`) describing variants, allocation strategies, and success metrics. `ExperimentEvaluator` assigns variants (random/sticky/targeted) and integrates with Policy/Telemetry for safe experimentation.\n- **AppBlueprintSpec / TenantAppConfig**: global blueprints and per-tenant overrides (`src/app-config/spec.ts`). `resolveAppConfig()` merges the two into a `ResolvedAppConfig`, while `composeAppConfig()` hydrates the merged view against registries and reports missing references for safe rollout.\n- **RegeneratorService**: background daemon (`src/regenerator/service.ts`) that consumes telemetry/error/behavior signals, evaluates regeneration rules, and produces `SpecChangeProposal`s for Studio review.\n- **DataViewSpec**: declarative data presentation layer in `src/data-views.ts`. Describes entity projections (`fields`, `filters`, `actions`) with `view.kind` (`list`, `table`, `detail`, `grid`), ties to query operations via `source.primary`, and exposes optional presentation-based empty/error states.\n- **ThemeSpec**: design token + component variant definitions in `src/themes.ts`. Supports inheritance (`extends`), tenant/user overrides, and component-specific variant metadata for the design system.\n- **MigrationSpec**: schema/data migration descriptors (`src/migrations.ts`) with ordered step plans, dependency tracking, and pre/post checks to support automated database/content migrations.\n- **WorkflowSpec**: typed definition of multi-step workflows living in `src/workflow/spec.ts`. `WorkflowRegistry` stores versioned specs, and `validateWorkflowSpec()` (in `src/workflow/validation.ts`) checks graph integrity, step references, and reachability.\n\n### Lifecycle\n\n1. Define the spec (I/O via `SchemaModel` or zod) in a vertical lib (e.g. `contracts-coliving`).\n2. Register it: `installOp(registry, spec, handler)` within the app/service.\n3. Expose it via an adapter (REST, GraphQL, MCP). Each adapter maps the I/O to its transport and enforces policy.\n4. Validate at runtime: parse `input` before executing, parse `output` before returning.\n\n### Adapters\n\n- **REST**: see `packages/lssm/libs/contracts/src/server/rest-*`. Binds routes, validates request/response, maps errors/policies.\n- **MCP**: see `packages/lssm/libs/contracts/src/server/provider-mcp.ts` (standalone MCP server) and `packages/lssm/libs/contracts/src/server/rest-next-mcp.ts` (MCP over Next.js route). Provides tools/resources/prompts.\n - Tools + resources are registered from Zod schemas.\n - Resource templates are keyed by full `ResourceMeta.uriTemplate` (e.g. `docs://list`, `docs://doc/{id}`), so multiple templates can share a scheme (`docs://*`) without collisions.\n- **GraphQL (Pothos)**: see `packages/lssm/libs/contracts/src/server/graphql-pothos.ts`. Adds Query/Mutation fields by transforming contract I/O to GraphQL types.\n\n### GraphQL adapter behaviour (summary)\n\n- Field naming: `spec.transport.gql.field` or `<name_with_dots>_v<version>`.\n- Input/Output types from `SchemaModel` (preferred) or fallback zod introspection.\n- Scalars: String/Int/Float/Boolean/Date/JSON; Objects/Arrays/Enums; unions for outputs; input unions => JSON.\n- Policy: auth gate checks GraphQL context; optional feature flag gating.\n- Complexity & tracing: attaches hints and records timings; log includes `{ specName, version }`.\n\n#### Returns mapping and hydration\n\n- `spec.transport.gql.returns` can declare the GraphQL return wrapper: e.g. `\"Spot\"` or `[Spot]`. If omitted, the adapter infers from `io.output` (SchemaModel) or `resourceRef.graphQLType`.\n- Resource outputs: when `io.output` is a `resourceRef(...)` or `transport.gql.resource` is set, the adapter will optionally hydrate via a `ResourceRegistry` using `contracts-adapter-hydration.ts`:\n - Grammar is parsed with `parseReturns()`.\n - Entities are resolved via `hydrateResourceIfNeeded(resources, result, { template, varName, returns })` after handler execution.\n\n### Resource outputs\n\n- Declare resource outputs using `resourceRef(uriTemplate, opts)`.\n- `opts.varName` (default `id`) selects the identifier field returned by the handler for URI substitution.\n- `opts.graphQLType` is the GraphQL return type name (e.g., `Spot`) or list form (e.g., `[Spot]`).\n- `opts.many: true` indicates the handler returns an array of resources. The handler type becomes an array of items that include the identifier field.\n\nExample:\n\n```ts\nio: {\n input: ListThingsInput,\n output: resourceRef('myapp://thing/{id}', { graphQLType: '[Thing]', many: true }),\n}\n```\n\nHandler return (simplified): `{ id: string | number }[]`.\n\n### Errors\n\n- Validation errors → transport 400/GraphQL UserInputError.\n- Policy/auth errors → 401/403 or GraphQL ForbiddenError.\n- Handler errors → mapped to transport error with safe message.\n\n### Versioning & naming\n\n- Keep `meta.version` monotonic. Clients should pin to a versioned field/key.\n- Avoid renaming existing fields; add new fields with new versions.\n\n### Ownership metadata (OwnerShipMeta)\n\nAll contracts, events, features, and presentations reference a shared ownership schema (source of truth in `packages/lssm/libs/contracts/src/ownership.ts`).\n\n- Required fields: `title`, `description`, `domain`, `owners[]`, `tags[]`, `stability`.\n- Curated enums: the library exports suggested constants for owners and tags; free-form strings are still allowed for forward-compatibility.\n- Operations (`spec.ts`): `meta` requires `stability`, `owners`, and `tags` alongside `name`, `version`, `kind`, `description`, `goal`, and `context`.\n- Presentations V2: `meta` is a partial of ownership plus `description`.\n- Events: may specify `ownership` (recommended) for discoverability and docs.\n\n### Quick start\n\n```ts\n// app bootstrap\nconst reg = new SpecRegistry();\ninstallOp(reg, BeginSignupSpec, beginSignupHandler);\nregisterContractsOnBuilder(gqlSchemaBuilder, reg); // GraphQL\n// or: createRestRouter(reg) // REST\n```\n"}];e(t);export{t as tech_contracts_README_DocBlocks};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import{registerDocBlocks as e}from"../../registry.js";const t=[{id:`docs.tech.contracts.openapi-export`,title:`OpenAPI export (OpenAPI 3.1) from SpecRegistry`,summary:`Generate a deterministic OpenAPI document from a SpecRegistry using jsonSchemaForSpec + REST transport metadata.`,kind:`reference`,visibility:`public`,route:`/docs/tech/contracts/openapi-export`,tags:[`contracts`,`openapi`,`rest`],body:`## OpenAPI export (OpenAPI 3.1) from SpecRegistry
|
|
2
|
+
|
|
3
|
+
### Purpose
|
|
4
|
+
|
|
5
|
+
ContractSpec specs can be exported into an **OpenAPI 3.1** document for tooling (SDK generation, docs, gateways).
|
|
6
|
+
|
|
7
|
+
The export is **spec-first**:
|
|
8
|
+
|
|
9
|
+
- Uses \`jsonSchemaForSpec(spec)\` for input/output JSON Schema (from SchemaModel → zod → JSON Schema)
|
|
10
|
+
- Uses \`spec.transport.rest.method/path\` when present
|
|
11
|
+
- Falls back to deterministic defaults:
|
|
12
|
+
- Method: \`POST\` for commands, \`GET\` for queries
|
|
13
|
+
- Path: \`defaultRestPath(name, version)\` → \`/<dot/name>/v<version>\`
|
|
14
|
+
|
|
15
|
+
### Library API
|
|
16
|
+
|
|
17
|
+
- Function: \`openApiForRegistry(registry, options?)\`
|
|
18
|
+
- Location: \`@lssm/lib.contracts/openapi\`
|
|
19
|
+
|
|
20
|
+
### CLI
|
|
21
|
+
|
|
22
|
+
Export OpenAPI from a registry module:
|
|
23
|
+
|
|
24
|
+
\`\`\`bash
|
|
25
|
+
contractspec openapi --registry ./src/registry.ts --out ./openapi.json
|
|
26
|
+
\`\`\`
|
|
27
|
+
|
|
28
|
+
The registry module must export one of:
|
|
29
|
+
|
|
30
|
+
- \`registry: SpecRegistry\`
|
|
31
|
+
- \`default(): SpecRegistry | Promise<SpecRegistry>\`
|
|
32
|
+
- \`createRegistry(): SpecRegistry | Promise<SpecRegistry>\`
|
|
33
|
+
|
|
34
|
+
### Notes / limitations (current)
|
|
35
|
+
|
|
36
|
+
- Responses are generated as a basic \`200\` response (plus schemas when available).
|
|
37
|
+
- Query (GET) inputs are currently represented as a JSON request body when an input schema exists.
|
|
38
|
+
- Errors are not yet expanded into OpenAPI responses; that will be added when we standardize error envelopes.`}];e(t);export{t as tech_contracts_openapi_export_DocBlocks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{registerDocBlocks as e}from"../registry.js";const t=[{id:`docs.tech.mcp.endpoints`,title:`ContractSpec MCP endpoints`,summary:`Dedicated MCP servers for docs, CLI usage, and internal development.`,kind:`reference`,visibility:`mixed`,route:`/docs/tech/mcp/endpoints`,tags:[`mcp`,`docs`,`cli`,`internal`],body:"# ContractSpec MCP endpoints\n\nThree dedicated MCP servers keep AI agents efficient and scoped:\n\n- **Docs MCP**: `/api/mcp/docs` — exposes DocBlocks as resources + presentations. Tool: `docs.search`.\n- **CLI MCP**: `/api/mcp/cli` — surfaces CLI quickstart/reference/README and suggests commands. Tool: `cli.suggestCommand`.\n- **Internal MCP**: `/api/mcp/internal` — internal routing hints and
|
|
1
|
+
import{registerDocBlocks as e}from"../registry.js";const t=[{id:`docs.tech.mcp.endpoints`,title:`ContractSpec MCP endpoints`,summary:`Dedicated MCP servers for docs, CLI usage, and internal development.`,kind:`reference`,visibility:`mixed`,route:`/docs/tech/mcp/endpoints`,tags:[`mcp`,`docs`,`cli`,`internal`],body:"# ContractSpec MCP endpoints\n\nThree dedicated MCP servers keep AI agents efficient and scoped:\n\n- **Docs MCP**: `/api/mcp/docs` — exposes DocBlocks as resources + presentations. Tool: `docs.search`.\n- **CLI MCP**: `/api/mcp/cli` — surfaces CLI quickstart/reference/README and suggests commands. Tool: `cli.suggestCommand`.\n- **Internal MCP**: `/api/mcp/internal` — internal routing hints, playbook, and example registry access. Tool: `internal.describe`.\n\n### Usage notes\n- Transports are HTTP POST (streamable HTTP); SSE is disabled.\n- Resources are namespaced (`docs://*`, `cli://*`, `internal://*`) and are read-only.\n- Internal MCP also exposes the examples registry via `examples://*` resources:\n - `examples://list?q=<query>`\n - `examples://example/<id>`\n- Prompts mirror each surface (navigator, usage, bootstrap) for quick agent onboarding.\n- GraphQL remains at `/graphql`; health at `/health`.\n"}];e(t);export{t as tech_mcp_endpoints_DocBlocks};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import{registerDocBlocks as e}from"../registry.js";const t=[{id:`docs.tech.telemetry.ingest`,title:`Telemetry Ingest Endpoint`,summary:`Server-side telemetry ingestion for ContractSpec clients (VS Code extension, CLI, etc.).`,kind:`reference`,visibility:`internal`,route:`/docs/tech/telemetry/ingest`,tags:[`telemetry`,`api`,`posthog`,`analytics`],body:`# Telemetry Ingest Endpoint
|
|
2
|
+
|
|
3
|
+
The ContractSpec API provides a telemetry ingest endpoint for clients to send product analytics events.
|
|
4
|
+
|
|
5
|
+
## Endpoint
|
|
6
|
+
|
|
7
|
+
\`\`\`
|
|
8
|
+
POST /api/telemetry/ingest
|
|
9
|
+
\`\`\`
|
|
10
|
+
|
|
11
|
+
## Request
|
|
12
|
+
|
|
13
|
+
\`\`\`json
|
|
14
|
+
{
|
|
15
|
+
"event": "contractspec.vscode.command_run",
|
|
16
|
+
"distinct_id": "client-uuid",
|
|
17
|
+
"properties": {
|
|
18
|
+
"command": "validate"
|
|
19
|
+
},
|
|
20
|
+
"timestamp": "2024-01-15T10:30:00.000Z"
|
|
21
|
+
}
|
|
22
|
+
\`\`\`
|
|
23
|
+
|
|
24
|
+
### Headers
|
|
25
|
+
|
|
26
|
+
| Header | Description |
|
|
27
|
+
|--------|-------------|
|
|
28
|
+
| \`x-contractspec-client-id\` | Optional client identifier (used as fallback for distinct_id) |
|
|
29
|
+
| \`Content-Type\` | Must be \`application/json\` |
|
|
30
|
+
|
|
31
|
+
### Body
|
|
32
|
+
|
|
33
|
+
| Field | Type | Required | Description |
|
|
34
|
+
|-------|------|----------|-------------|
|
|
35
|
+
| \`event\` | string | Yes | Event name (e.g., \`contractspec.vscode.activated\`) |
|
|
36
|
+
| \`distinct_id\` | string | Yes | Anonymous client identifier |
|
|
37
|
+
| \`properties\` | object | No | Event properties |
|
|
38
|
+
| \`timestamp\` | string | No | ISO 8601 timestamp |
|
|
39
|
+
|
|
40
|
+
## Response
|
|
41
|
+
|
|
42
|
+
\`\`\`json
|
|
43
|
+
{
|
|
44
|
+
"success": true
|
|
45
|
+
}
|
|
46
|
+
\`\`\`
|
|
47
|
+
|
|
48
|
+
## Configuration
|
|
49
|
+
|
|
50
|
+
The endpoint requires \`POSTHOG_PROJECT_KEY\` environment variable to be set. If not configured, events are accepted but not forwarded.
|
|
51
|
+
|
|
52
|
+
| Environment Variable | Description | Default |
|
|
53
|
+
|---------------------|-------------|---------|
|
|
54
|
+
| \`POSTHOG_HOST\` | PostHog host URL | \`https://eu.posthog.com\` |
|
|
55
|
+
| \`POSTHOG_PROJECT_KEY\` | PostHog project API key | (required) |
|
|
56
|
+
|
|
57
|
+
## Privacy
|
|
58
|
+
|
|
59
|
+
- No PII is collected or stored
|
|
60
|
+
- \`distinct_id\` is an anonymous client-generated UUID
|
|
61
|
+
- File paths and source code are never included in events
|
|
62
|
+
- Respects VS Code telemetry settings on the client side
|
|
63
|
+
|
|
64
|
+
## Events
|
|
65
|
+
|
|
66
|
+
### Extension Events
|
|
67
|
+
|
|
68
|
+
| Event | Description | Properties |
|
|
69
|
+
|-------|-------------|------------|
|
|
70
|
+
| \`contractspec.vscode.activated\` | Extension activated | \`version\` |
|
|
71
|
+
| \`contractspec.vscode.command_run\` | Command executed | \`command\` |
|
|
72
|
+
| \`contractspec.vscode.mcp_call\` | MCP call made | \`endpoint\`, \`tool\` |
|
|
73
|
+
|
|
74
|
+
### API Events
|
|
75
|
+
|
|
76
|
+
| Event | Description | Properties |
|
|
77
|
+
|-------|-------------|------------|
|
|
78
|
+
| \`contractspec.api.mcp_request\` | MCP request processed | \`endpoint\`, \`method\`, \`success\`, \`duration_ms\` |
|
|
79
|
+
`},{id:`docs.tech.telemetry.hybrid`,title:`Hybrid Telemetry Model`,summary:`How ContractSpec clients choose between direct PostHog and API-routed telemetry.`,kind:`usage`,visibility:`internal`,route:`/docs/tech/telemetry/hybrid`,tags:[`telemetry`,`architecture`,`posthog`],body:`# Hybrid Telemetry Model
|
|
80
|
+
|
|
81
|
+
ContractSpec uses a hybrid telemetry model where clients can send events either directly to PostHog or via the API server.
|
|
82
|
+
|
|
83
|
+
## Decision Flow
|
|
84
|
+
|
|
85
|
+
\`\`\`
|
|
86
|
+
Is contractspec.api.baseUrl configured?
|
|
87
|
+
├── Yes → Send via /api/telemetry/ingest
|
|
88
|
+
└── No → Is posthogProjectKey configured?
|
|
89
|
+
├── Yes → Send directly to PostHog
|
|
90
|
+
└── No → Telemetry disabled
|
|
91
|
+
\`\`\`
|
|
92
|
+
|
|
93
|
+
## Benefits
|
|
94
|
+
|
|
95
|
+
### Direct PostHog
|
|
96
|
+
- No server dependency
|
|
97
|
+
- Works offline (with batching)
|
|
98
|
+
- Lower latency
|
|
99
|
+
|
|
100
|
+
### Via API
|
|
101
|
+
- Centralized key management (no client-side keys)
|
|
102
|
+
- Server-side enrichment and validation
|
|
103
|
+
- Rate limiting and abuse prevention
|
|
104
|
+
- Easier migration to other providers
|
|
105
|
+
|
|
106
|
+
## Recommendation
|
|
107
|
+
|
|
108
|
+
- **Development**: Use direct PostHog with a dev project key
|
|
109
|
+
- **Production**: Route via API for better governance
|
|
110
|
+
|
|
111
|
+
## Future: OpenTelemetry
|
|
112
|
+
|
|
113
|
+
The current PostHog implementation is behind a simple interface that can be swapped for OpenTelemetry:
|
|
114
|
+
|
|
115
|
+
\`\`\`typescript
|
|
116
|
+
interface TelemetryClient {
|
|
117
|
+
send(event: TelemetryEvent): Promise<void>;
|
|
118
|
+
}
|
|
119
|
+
\`\`\`
|
|
120
|
+
|
|
121
|
+
This allows future migration without changing client code.
|
|
122
|
+
`}];e(t);export{t as tech_telemetry_ingest_DocBlocks};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import{registerDocBlocks as e}from"../registry.js";const t=[{id:`docs.tech.vscode.extension`,title:`ContractSpec VS Code Extension`,summary:`VS Code extension for spec-first development with validation, scaffolding, and MCP integration.`,kind:`reference`,visibility:`public`,route:`/docs/tech/vscode/extension`,tags:[`vscode`,`extension`,`tooling`,`dx`],body:`# ContractSpec VS Code Extension
|
|
2
|
+
|
|
3
|
+
The ContractSpec VS Code extension provides spec-first development tooling directly in your editor.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Real-time Validation**: Get instant feedback on spec errors and warnings as you save files
|
|
8
|
+
- **Build/Scaffold**: Generate handler and component skeletons from specs (no AI required)
|
|
9
|
+
- **Spec Explorer**: List and navigate all specs in your workspace
|
|
10
|
+
- **Dependency Analysis**: Visualize spec dependencies and detect cycles
|
|
11
|
+
- **MCP Integration**: Search ContractSpec documentation via Model Context Protocol
|
|
12
|
+
- **Snippets**: Code snippets for common ContractSpec patterns
|
|
13
|
+
|
|
14
|
+
## Commands
|
|
15
|
+
|
|
16
|
+
| Command | Description |
|
|
17
|
+
|---------|-------------|
|
|
18
|
+
| \`ContractSpec: Validate Current Spec\` | Validate the currently open spec file |
|
|
19
|
+
| \`ContractSpec: Validate All Specs\` | Validate all spec files in the workspace |
|
|
20
|
+
| \`ContractSpec: Build/Scaffold\` | Generate handler/component from the current spec |
|
|
21
|
+
| \`ContractSpec: List All Specs\` | Show all specs in the workspace |
|
|
22
|
+
| \`ContractSpec: Analyze Dependencies\` | Analyze and visualize spec dependencies |
|
|
23
|
+
| \`ContractSpec: Search Docs (MCP)\` | Search documentation via MCP |
|
|
24
|
+
|
|
25
|
+
## Configuration
|
|
26
|
+
|
|
27
|
+
| Setting | Description | Default |
|
|
28
|
+
|---------|-------------|---------|
|
|
29
|
+
| \`contractspec.api.baseUrl\` | Base URL for ContractSpec API (enables MCP + remote telemetry) | \`""\` |
|
|
30
|
+
| \`contractspec.telemetry.posthogHost\` | PostHog host URL for direct telemetry | \`"https://eu.posthog.com"\` |
|
|
31
|
+
| \`contractspec.telemetry.posthogProjectKey\` | PostHog project key for direct telemetry | \`""\` |
|
|
32
|
+
| \`contractspec.validation.onSave\` | Run validation on save | \`true\` |
|
|
33
|
+
| \`contractspec.validation.onOpen\` | Run validation on open | \`true\` |
|
|
34
|
+
|
|
35
|
+
## Architecture
|
|
36
|
+
|
|
37
|
+
The extension uses:
|
|
38
|
+
- \`@lssm/module.contractspec-workspace\` for pure analysis + templates
|
|
39
|
+
- \`@lssm/bundle.contractspec-workspace\` for workspace services + adapters
|
|
40
|
+
|
|
41
|
+
This allows the extension to work without requiring the CLI to be installed.
|
|
42
|
+
|
|
43
|
+
## Telemetry
|
|
44
|
+
|
|
45
|
+
The extension uses a hybrid telemetry approach:
|
|
46
|
+
1. If \`contractspec.api.baseUrl\` is configured → send to API \`/api/telemetry/ingest\`
|
|
47
|
+
2. Otherwise → send directly to PostHog (if project key configured)
|
|
48
|
+
|
|
49
|
+
Telemetry respects VS Code's telemetry settings. No file paths, source code, or PII is collected.
|
|
50
|
+
`},{id:`docs.tech.vscode.snippets`,title:`ContractSpec Snippets`,summary:`Code snippets for common ContractSpec patterns in VS Code.`,kind:`reference`,visibility:`public`,route:`/docs/tech/vscode/snippets`,tags:[`vscode`,`snippets`,`dx`],body:`# ContractSpec Snippets
|
|
51
|
+
|
|
52
|
+
The VS Code extension includes snippets for common ContractSpec patterns.
|
|
53
|
+
|
|
54
|
+
## Available Snippets
|
|
55
|
+
|
|
56
|
+
| Prefix | Description |
|
|
57
|
+
|--------|-------------|
|
|
58
|
+
| \`contractspec-command\` | Create a new command (write operation) |
|
|
59
|
+
| \`contractspec-query\` | Create a new query (read-only operation) |
|
|
60
|
+
| \`contractspec-event\` | Create a new event |
|
|
61
|
+
| \`contractspec-docblock\` | Create a new DocBlock |
|
|
62
|
+
| \`contractspec-telemetry\` | Create a new TelemetrySpec |
|
|
63
|
+
| \`contractspec-presentation\` | Create a new Presentation |
|
|
64
|
+
|
|
65
|
+
## Usage
|
|
66
|
+
|
|
67
|
+
Type the prefix in a TypeScript file and press Tab to expand the snippet. Tab through the placeholders to fill in your values.
|
|
68
|
+
`}];e(t);export{t as tech_vscode_extension_DocBlocks};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CapabilityRegistry as e,capabilityKey as t,defineCapability as n}from"./capabilities.js";import{DataViewRegistry as r,dataViewKey as i}from"./data-views.js";import{defineEvent as a,eventKey as o}from"./events.js";import{FeatureRegistry as s,installFeature as c,validateFeatureTargetsV2 as l}from"./features.js";import{FormRegistry as u,buildZodWithRelations as d,defineFormSpec as f,evalPredicate as p}from"./forms.js";import{schemaToMarkdown as m,schemaToMarkdownDetail as h,schemaToMarkdownList as g,schemaToMarkdownSummary as _,schemaToMarkdownTable as v}from"./schema-to-markdown.js";import{TransformEngine as y,createDefaultTransformEngine as b,registerBasicValidation as x,registerDefaultReactRenderer as S,registerReactToMarkdownRenderer as C}from"./presentations.v2.js";import{createEngineWithDefaults as w,createFeatureModule as T,registerFeature as E,renderFeaturePresentation as D}from"./client/react/feature-render.js";import{createFormRenderer as O}from"./client/react/form-render.js";import{shadcnDriver as k}from"./client/react/drivers/shadcn.js";import{rnReusablesDriver as A}from"./client/react/drivers/rn-reusables.js";import"./client/index.js";import{defaultGqlField as j,defaultMcpTool as M,defaultRestPath as N,jsonSchemaForSpec as P}from"./jsonschema.js";import{registerContractsOnBuilder as F}from"./server/graphql-pothos.js";import{PresentationRegistry as I,jsonSchemaForPresentation as L}from"./presentations.js";import{createMcpServer as R}from"./server/provider-mcp.js";import{createFetchHandler as z}from"./server/rest-generic.js";import{elysiaPlugin as B}from"./server/rest-elysia.js";import{expressRouter as V}from"./server/rest-express.js";import{makeNextAppHandler as H}from"./server/rest-next-app.js";import{makeNextPagesHandler as U}from"./server/rest-next-pages.js";import"./server/index.js";import{defineCommand as W,defineQuery as G,isEmitDeclRef as K}from"./spec.js";import{docBlockToPresentationSpec as q,docBlockToPresentationV2 as J,docBlocksToPresentationRoutes as Y,docBlocksToPresentationSpecs as X,mapDocRoutes as Z}from"./docs/presentations.js";import{DocRegistry as Q,defaultDocRegistry as $,docId as ee,listRegisteredDocBlocks as te,registerDocBlocks as ne}from"./docs/registry.js";import{SpecRegistry as re,opKey as ie}from"./registry.js";import{installOp as ae,makeEmit as oe,op as se}from"./install.js";import{definePrompt as ce}from"./prompt.js";import{PromptRegistry as le}from"./promptRegistry.js";import{ResourceRegistry as ue,defineResourceTemplate as de,isResourceRef as fe,resourceRef as pe}from"./resources.js";import{toV2FromV1 as me}from"./presentations.backcompat.js";import{Owners as he,OwnersEnum as ge,StabilityEnum as _e,Tags as ve,TagsEnum as ye}from"./ownership.js";import{CompleteOnboardingBaseInput as be,CompleteOnboardingBaseOutput as xe,CompleteOnboardingBaseSpec as Se,DeleteOnboardingDraftBaseSpec as Ce,DeleteOnboardingDraftOutput as we,GetOnboardingDraftBaseSpec as Te,GetOnboardingDraftOutput as Ee,SaveOnboardingDraftBaseSpec as De,SaveOnboardingDraftInput as Oe,SaveOnboardingDraftOutput as ke}from"./onboarding-base.js";import{openBankingAccountsReadCapability as Ae,openBankingBalancesReadCapability as je,openBankingTransactionsReadCapability as Me,registerOpenBankingCapabilities as Ne}from"./capabilities/openbanking.js";import{PolicyRegistry as Pe,makePolicyKey as Fe}from"./policy/spec.js";import{PolicyEngine as Ie}from"./policy/engine.js";import{OPAPolicyAdapter as Le,buildOPAInput as Re}from"./policy/opa-adapter.js";import{ThemeRegistry as ze,makeThemeRef as Be}from"./themes.js";import{MigrationRegistry as Ve}from"./migrations.js";import{TelemetryRegistry as He,makeTelemetryKey as Ue}from"./telemetry/spec.js";import{TelemetryTracker as We}from"./telemetry/tracker.js";import{TelemetryAnomalyMonitor as Ge}from"./telemetry/anomaly.js";import"./telemetry/index.js";import{TestRegistry as Ke,makeTestKey as qe}from"./tests/spec.js";import{TestRunner as Je}from"./tests/runner.js";import"./tests/index.js";import{ExperimentRegistry as Ye,makeExperimentKey as Xe}from"./experiments/spec.js";import{ExperimentEvaluator as Ze}from"./experiments/evaluator.js";import{AppBlueprintRegistry as Qe,makeAppBlueprintKey as $e}from"./app-config/spec.js";import{composeAppConfig as et,resolveAppConfig as tt}from"./app-config/runtime.js";import{IntegrationSpecRegistry as nt,makeIntegrationSpecKey as rt}from"./integrations/spec.js";import{registerStripeIntegration as it,stripeIntegrationSpec as at}from"./integrations/providers/stripe.js";import{postmarkIntegrationSpec as ot,registerPostmarkIntegration as st}from"./integrations/providers/postmark.js";import{qdrantIntegrationSpec as ct,registerQdrantIntegration as lt}from"./integrations/providers/qdrant.js";import{mistralIntegrationSpec as ut,registerMistralIntegration as dt}from"./integrations/providers/mistral.js";import{elevenLabsIntegrationSpec as ft,registerElevenLabsIntegration as pt}from"./integrations/providers/elevenlabs.js";import{gmailIntegrationSpec as mt,registerGmailIntegration as ht}from"./integrations/providers/gmail.js";import{googleCalendarIntegrationSpec as gt,registerGoogleCalendarIntegration as _t}from"./integrations/providers/google-calendar.js";import{registerTwilioSmsIntegration as vt,twilioSmsIntegrationSpec as yt}from"./integrations/providers/twilio-sms.js";import{gcsStorageIntegrationSpec as bt,registerGcsStorageIntegration as xt}from"./integrations/providers/gcs-storage.js";import{powensIntegrationSpec as St,registerPowensIntegration as Ct}from"./integrations/providers/powens.js";import{MistralLLMProvider as wt}from"./integrations/providers/impls/mistral-llm.js";import{MistralEmbeddingProvider as Tt}from"./integrations/providers/impls/mistral-embedding.js";import{QdrantVectorProvider as Et}from"./integrations/providers/impls/qdrant-vector.js";import{GmailInboundProvider as Dt}from"./integrations/providers/impls/gmail-inbound.js";import{GmailOutboundProvider as Ot}from"./integrations/providers/impls/gmail-outbound.js";import{GoogleCalendarProvider as kt}from"./integrations/providers/impls/google-calendar.js";import{ElevenLabsVoiceProvider as At}from"./integrations/providers/impls/elevenlabs-voice.js";import{GoogleCloudStorageProvider as jt}from"./integrations/providers/impls/gcs-storage.js";import{StripePaymentsProvider as Mt}from"./integrations/providers/impls/stripe-payments.js";import{PostmarkEmailProvider as Nt}from"./integrations/providers/impls/postmark-email.js";import{TwilioSmsProvider as Pt}from"./integrations/providers/impls/twilio-sms.js";import{PowensClient as Ft,PowensClientError as It}from"./integrations/providers/impls/powens-client.js";import{PowensOpenBankingProvider as Lt}from"./integrations/providers/impls/powens-openbanking.js";import{IntegrationProviderFactory as Rt}from"./integrations/providers/impls/provider-factory.js";import{SecretProviderError as zt,normalizeSecretPayload as Bt,parseSecretUri as Vt}from"./integrations/secrets/provider.js";import{GcpSecretManagerProvider as Ht}from"./integrations/secrets/gcp-secret-manager.js";import{EnvSecretProvider as Ut}from"./integrations/secrets/env-secret-provider.js";import{SecretProviderManager as Wt}from"./integrations/secrets/manager.js";import{IntegrationCallGuard as Gt,connectionStatusLabel as Kt,ensureConnectionReady as qt}from"./integrations/runtime.js";import{IntegrationHealthService as Jt}from"./integrations/health.js";import{AccountBalanceRecord as Yt,BankAccountRecord as Xt,BankTransactionRecord as Zt}from"./integrations/openbanking/models.js";import{OPENBANKING_PII_FIELDS as Qt,OPENBANKING_TELEMETRY_EVENTS as $t,redactOpenBankingTelemetryPayload as en}from"./integrations/openbanking/telemetry.js";import{OpenBankingGetAccount as tn,OpenBankingListAccounts as nn,OpenBankingSyncAccounts as rn}from"./integrations/openbanking/contracts/accounts.js";import{OpenBankingListTransactions as an,OpenBankingSyncTransactions as on}from"./integrations/openbanking/contracts/transactions.js";import{OpenBankingGetBalances as sn,OpenBankingRefreshBalances as cn}from"./integrations/openbanking/contracts/balances.js";import{registerOpenBankingContracts as ln}from"./integrations/openbanking/contracts/index.js";import{assertPrimaryOpenBankingReady as un,ensurePrimaryOpenBankingIntegration as dn}from"./integrations/openbanking/guards.js";import"./integrations/index.js";import{KnowledgeSpaceRegistry as fn,makeKnowledgeSpaceKey as pn}from"./knowledge/spec.js";import{productCanonKnowledgeSpace as mn,registerProductCanonKnowledgeSpace as hn}from"./knowledge/spaces/product-canon.js";import{registerSupportFaqKnowledgeSpace as gn,supportFaqKnowledgeSpace as _n}from"./knowledge/spaces/support-faq.js";import{emailThreadsKnowledgeSpace as vn,registerEmailThreadsKnowledgeSpace as yn}from"./knowledge/spaces/email-threads.js";import{registerUploadedDocsKnowledgeSpace as bn,uploadedDocsKnowledgeSpace as xn}from"./knowledge/spaces/uploaded-docs.js";import{financialDocsKnowledgeSpace as Sn,registerFinancialDocsKnowledgeSpace as Cn}from"./knowledge/spaces/financial-docs.js";import{financialOverviewKnowledgeSpace as wn,registerFinancialOverviewKnowledgeSpace as Tn}from"./knowledge/spaces/financial-overview.js";import"./knowledge/index.js";import{CreateIntegrationConnection as En,DeleteIntegrationConnection as Dn,ListIntegrationConnections as On,TestIntegrationConnection as kn,UpdateIntegrationConnection as An,integrationContracts as jn,registerIntegrationContracts as Mn}from"./integrations/contracts.js";import{CreateKnowledgeSource as Nn,DeleteKnowledgeSource as Pn,ListKnowledgeSources as Fn,TriggerKnowledgeSourceSync as In,UpdateKnowledgeSource as Ln,knowledgeContracts as Rn,registerKnowledgeContracts as zn}from"./knowledge/contracts.js";import{behaviorToEnvelope as Bn,errorToEnvelope as Vn,telemetryToEnvelope as Hn}from"./regenerator/utils.js";import{RegeneratorService as Un}from"./regenerator/service.js";import{ProposalExecutor as Wn}from"./regenerator/executor.js";import{ExecutorProposalSink as Gn}from"./regenerator/sinks.js";import"./regenerator/index.js";import{WorkflowRegistry as Kn}from"./workflow/spec.js";import{WorkflowValidationError as qn,assertWorkflowSpecValid as Jn,validateWorkflowSpec as Yn}from"./workflow/validation.js";import{evaluateExpression as Xn}from"./workflow/expression.js";import{WorkflowPreFlightError as Zn,WorkflowRunner as Qn}from"./workflow/runner.js";import{InMemoryStateStore as $n}from"./workflow/adapters/memory-store.js";import{PrismaStateStore as er}from"./workflow/adapters/db-adapter.js";import{createFileStateStore as tr}from"./workflow/adapters/file-adapter.js";import"./workflow/index.js";import{techContractsDocs as nr}from"./docs/tech-contracts.docs.js";import{metaDocs as rr}from"./docs/meta.docs.js";import"./docs/index.js";import{defineSchemaModel as ir}from"@lssm/lib.schema";export{Yt as AccountBalanceRecord,Qe as AppBlueprintRegistry,Xt as BankAccountRecord,Zt as BankTransactionRecord,e as CapabilityRegistry,be as CompleteOnboardingBaseInput,xe as CompleteOnboardingBaseOutput,Se as CompleteOnboardingBaseSpec,En as CreateIntegrationConnection,Nn as CreateKnowledgeSource,r as DataViewRegistry,Dn as DeleteIntegrationConnection,Pn as DeleteKnowledgeSource,Ce as DeleteOnboardingDraftBaseSpec,we as DeleteOnboardingDraftOutput,Q as DocRegistry,At as ElevenLabsVoiceProvider,Ut as EnvSecretProvider,Gn as ExecutorProposalSink,Ze as ExperimentEvaluator,Ye as ExperimentRegistry,s as FeatureRegistry,u as FormRegistry,Ht as GcpSecretManagerProvider,Te as GetOnboardingDraftBaseSpec,Ee as GetOnboardingDraftOutput,Dt as GmailInboundProvider,Ot as GmailOutboundProvider,kt as GoogleCalendarProvider,jt as GoogleCloudStorageProvider,$n as InMemoryStateStore,Gt as IntegrationCallGuard,Jt as IntegrationHealthService,Rt as IntegrationProviderFactory,nt as IntegrationSpecRegistry,fn as KnowledgeSpaceRegistry,On as ListIntegrationConnections,Fn as ListKnowledgeSources,Ve as MigrationRegistry,Tt as MistralEmbeddingProvider,wt as MistralLLMProvider,Le as OPAPolicyAdapter,Qt as OPENBANKING_PII_FIELDS,$t as OPENBANKING_TELEMETRY_EVENTS,tn as OpenBankingGetAccount,sn as OpenBankingGetBalances,nn as OpenBankingListAccounts,an as OpenBankingListTransactions,cn as OpenBankingRefreshBalances,rn as OpenBankingSyncAccounts,on as OpenBankingSyncTransactions,he as Owners,ge as OwnersEnum,Ie as PolicyEngine,Pe as PolicyRegistry,Nt as PostmarkEmailProvider,Ft as PowensClient,It as PowensClientError,Lt as PowensOpenBankingProvider,I as PresentationRegistry,er as PrismaStateStore,le as PromptRegistry,Wn as ProposalExecutor,Et as QdrantVectorProvider,Un as RegeneratorService,ue as ResourceRegistry,De as SaveOnboardingDraftBaseSpec,Oe as SaveOnboardingDraftInput,ke as SaveOnboardingDraftOutput,zt as SecretProviderError,Wt as SecretProviderManager,re as SpecRegistry,_e as StabilityEnum,Mt as StripePaymentsProvider,ve as Tags,ye as TagsEnum,Ge as TelemetryAnomalyMonitor,He as TelemetryRegistry,We as TelemetryTracker,kn as TestIntegrationConnection,Ke as TestRegistry,Je as TestRunner,ze as ThemeRegistry,y as TransformEngine,In as TriggerKnowledgeSourceSync,Pt as TwilioSmsProvider,An as UpdateIntegrationConnection,Ln as UpdateKnowledgeSource,Zn as WorkflowPreFlightError,Kn as WorkflowRegistry,Qn as WorkflowRunner,qn as WorkflowValidationError,un as assertPrimaryOpenBankingReady,Jn as assertWorkflowSpecValid,Bn as behaviorToEnvelope,Re as buildOPAInput,d as buildZodWithRelations,t as capabilityKey,et as composeAppConfig,Kt as connectionStatusLabel,b as createDefaultTransformEngine,w as createEngineWithDefaults,T as createFeatureModule,z as createFetchHandler,tr as createFileStateStore,O as createFormRenderer,R as createMcpServer,i as dataViewKey,$ as defaultDocRegistry,j as defaultGqlField,M as defaultMcpTool,N as defaultRestPath,n as defineCapability,W as defineCommand,a as defineEvent,f as defineFormSpec,ce as definePrompt,G as defineQuery,de as defineResourceTemplate,ir as defineSchemaModel,q as docBlockToPresentationSpec,J as docBlockToPresentationV2,Y as docBlocksToPresentationRoutes,X as docBlocksToPresentationSpecs,ee as docId,ft as elevenLabsIntegrationSpec,B as elysiaPlugin,vn as emailThreadsKnowledgeSpace,qt as ensureConnectionReady,dn as ensurePrimaryOpenBankingIntegration,Vn as errorToEnvelope,p as evalPredicate,Xn as evaluateExpression,o as eventKey,V as expressRouter,Sn as financialDocsKnowledgeSpace,wn as financialOverviewKnowledgeSpace,bt as gcsStorageIntegrationSpec,mt as gmailIntegrationSpec,gt as googleCalendarIntegrationSpec,c as installFeature,ae as installOp,jn as integrationContracts,K as isEmitDeclRef,fe as isResourceRef,L as jsonSchemaForPresentation,P as jsonSchemaForSpec,Rn as knowledgeContracts,te as listRegisteredDocBlocks,$e as makeAppBlueprintKey,oe as makeEmit,Xe as makeExperimentKey,rt as makeIntegrationSpecKey,pn as makeKnowledgeSpaceKey,H as makeNextAppHandler,U as makeNextPagesHandler,Fe as makePolicyKey,Ue as makeTelemetryKey,qe as makeTestKey,Be as makeThemeRef,Z as mapDocRoutes,rr as metaDocs,ut as mistralIntegrationSpec,Bt as normalizeSecretPayload,se as op,ie as opKey,Ae as openBankingAccountsReadCapability,je as openBankingBalancesReadCapability,Me as openBankingTransactionsReadCapability,Vt as parseSecretUri,ot as postmarkIntegrationSpec,St as powensIntegrationSpec,mn as productCanonKnowledgeSpace,ct as qdrantIntegrationSpec,en as redactOpenBankingTelemetryPayload,x as registerBasicValidation,F as registerContractsOnBuilder,S as registerDefaultReactRenderer,ne as registerDocBlocks,pt as registerElevenLabsIntegration,yn as registerEmailThreadsKnowledgeSpace,E as registerFeature,Cn as registerFinancialDocsKnowledgeSpace,Tn as registerFinancialOverviewKnowledgeSpace,xt as registerGcsStorageIntegration,ht as registerGmailIntegration,_t as registerGoogleCalendarIntegration,Mn as registerIntegrationContracts,zn as registerKnowledgeContracts,dt as registerMistralIntegration,Ne as registerOpenBankingCapabilities,ln as registerOpenBankingContracts,st as registerPostmarkIntegration,Ct as registerPowensIntegration,hn as registerProductCanonKnowledgeSpace,lt as registerQdrantIntegration,C as registerReactToMarkdownRenderer,it as registerStripeIntegration,gn as registerSupportFaqKnowledgeSpace,vt as registerTwilioSmsIntegration,bn as registerUploadedDocsKnowledgeSpace,D as renderFeaturePresentation,tt as resolveAppConfig,pe as resourceRef,A as rnReusablesDriver,m as schemaToMarkdown,h as schemaToMarkdownDetail,g as schemaToMarkdownList,_ as schemaToMarkdownSummary,v as schemaToMarkdownTable,k as shadcnDriver,at as stripeIntegrationSpec,_n as supportFaqKnowledgeSpace,nr as techContractsDocs,Hn as telemetryToEnvelope,me as toV2FromV1,yt as twilioSmsIntegrationSpec,xn as uploadedDocsKnowledgeSpace,l as validateFeatureTargetsV2,Yn as validateWorkflowSpec};
|
|
1
|
+
import{CapabilityRegistry as e,capabilityKey as t,defineCapability as n}from"./capabilities.js";import{DataViewRegistry as r,dataViewKey as i}from"./data-views.js";import{defineEvent as a,eventKey as o}from"./events.js";import{FeatureRegistry as s,installFeature as c,validateFeatureTargetsV2 as l}from"./features.js";import{FormRegistry as u,buildZodWithRelations as d,defineFormSpec as f,evalPredicate as p}from"./forms.js";import{schemaToMarkdown as m,schemaToMarkdownDetail as h,schemaToMarkdownList as g,schemaToMarkdownSummary as _,schemaToMarkdownTable as v}from"./schema-to-markdown.js";import{TransformEngine as y,createDefaultTransformEngine as b,registerBasicValidation as x,registerDefaultReactRenderer as S,registerReactToMarkdownRenderer as C}from"./presentations.v2.js";import{createEngineWithDefaults as w,createFeatureModule as T,registerFeature as E,renderFeaturePresentation as D}from"./client/react/feature-render.js";import{createFormRenderer as O}from"./client/react/form-render.js";import{shadcnDriver as k}from"./client/react/drivers/shadcn.js";import{rnReusablesDriver as A}from"./client/react/drivers/rn-reusables.js";import"./client/index.js";import{defaultGqlField as j,defaultMcpTool as M,defaultRestPath as N,jsonSchemaForSpec as P}from"./jsonschema.js";import{registerContractsOnBuilder as F}from"./server/graphql-pothos.js";import{PresentationRegistry as I,jsonSchemaForPresentation as L}from"./presentations.js";import{createMcpServer as R}from"./server/mcp/createMcpServer.js";import{createFetchHandler as z}from"./server/rest-generic.js";import{elysiaPlugin as B}from"./server/rest-elysia.js";import{expressRouter as V}from"./server/rest-express.js";import{makeNextAppHandler as H}from"./server/rest-next-app.js";import{makeNextPagesHandler as U}from"./server/rest-next-pages.js";import"./server/index.js";import{defineCommand as W,defineQuery as G,isEmitDeclRef as K}from"./spec.js";import{docBlockToPresentationSpec as q,docBlockToPresentationV2 as J,docBlocksToPresentationRoutes as Y,docBlocksToPresentationSpecs as X,mapDocRoutes as Z}from"./docs/presentations.js";import{DocRegistry as Q,defaultDocRegistry as $,docId as ee,listRegisteredDocBlocks as te,registerDocBlocks as ne}from"./docs/registry.js";import{SpecRegistry as re,opKey as ie}from"./registry.js";import{Owners as ae,OwnersEnum as oe,StabilityEnum as se,Tags as ce,TagsEnum as le}from"./ownership.js";import{ContractRegistryFileSchema as ue,ContractRegistryItemSchema as de,ContractRegistryItemTypeSchema as fe,ContractRegistryManifestSchema as pe}from"./contract-registry/schemas.js";import"./contract-registry/index.js";import{installOp as me,makeEmit as he,op as ge}from"./install.js";import{openApiForRegistry as _e}from"./openapi.js";import{definePrompt as ve}from"./prompt.js";import{PromptRegistry as ye}from"./promptRegistry.js";import{ResourceRegistry as be,defineResourceTemplate as xe,isResourceRef as Se,resourceRef as Ce}from"./resources.js";import{toV2FromV1 as we}from"./presentations.backcompat.js";import{CompleteOnboardingBaseInput as Te,CompleteOnboardingBaseOutput as Ee,CompleteOnboardingBaseSpec as De,DeleteOnboardingDraftBaseSpec as Oe,DeleteOnboardingDraftOutput as ke,GetOnboardingDraftBaseSpec as Ae,GetOnboardingDraftOutput as je,SaveOnboardingDraftBaseSpec as Me,SaveOnboardingDraftInput as Ne,SaveOnboardingDraftOutput as Pe}from"./onboarding-base.js";import{openBankingAccountsReadCapability as Fe,openBankingBalancesReadCapability as Ie,openBankingTransactionsReadCapability as Le,registerOpenBankingCapabilities as Re}from"./capabilities/openbanking.js";import{PolicyRegistry as ze,makePolicyKey as Be}from"./policy/spec.js";import{PolicyEngine as Ve}from"./policy/engine.js";import{OPAPolicyAdapter as He,buildOPAInput as Ue}from"./policy/opa-adapter.js";import{ThemeRegistry as We,makeThemeRef as Ge}from"./themes.js";import{MigrationRegistry as Ke}from"./migrations.js";import{TelemetryRegistry as qe,makeTelemetryKey as Je}from"./telemetry/spec.js";import{TelemetryTracker as Ye}from"./telemetry/tracker.js";import{TelemetryAnomalyMonitor as Xe}from"./telemetry/anomaly.js";import"./telemetry/index.js";import{TestRegistry as Ze,makeTestKey as Qe}from"./tests/spec.js";import{TestRunner as $e}from"./tests/runner.js";import"./tests/index.js";import{ExperimentRegistry as et,makeExperimentKey as tt}from"./experiments/spec.js";import{ExperimentEvaluator as nt}from"./experiments/evaluator.js";import{AppBlueprintRegistry as rt,makeAppBlueprintKey as it}from"./app-config/spec.js";import{composeAppConfig as at,resolveAppConfig as ot}from"./app-config/runtime.js";import{IntegrationSpecRegistry as st,makeIntegrationSpecKey as ct}from"./integrations/spec.js";import{registerStripeIntegration as lt,stripeIntegrationSpec as ut}from"./integrations/providers/stripe.js";import{postmarkIntegrationSpec as dt,registerPostmarkIntegration as ft}from"./integrations/providers/postmark.js";import{qdrantIntegrationSpec as pt,registerQdrantIntegration as mt}from"./integrations/providers/qdrant.js";import{mistralIntegrationSpec as ht,registerMistralIntegration as gt}from"./integrations/providers/mistral.js";import{elevenLabsIntegrationSpec as _t,registerElevenLabsIntegration as vt}from"./integrations/providers/elevenlabs.js";import{gmailIntegrationSpec as yt,registerGmailIntegration as bt}from"./integrations/providers/gmail.js";import{googleCalendarIntegrationSpec as xt,registerGoogleCalendarIntegration as St}from"./integrations/providers/google-calendar.js";import{registerTwilioSmsIntegration as Ct,twilioSmsIntegrationSpec as wt}from"./integrations/providers/twilio-sms.js";import{gcsStorageIntegrationSpec as Tt,registerGcsStorageIntegration as Et}from"./integrations/providers/gcs-storage.js";import{powensIntegrationSpec as Dt,registerPowensIntegration as Ot}from"./integrations/providers/powens.js";import{AccountBalanceRecord as kt,BankAccountRecord as At,BankTransactionRecord as jt}from"./integrations/openbanking/models.js";import{OPENBANKING_PII_FIELDS as Mt,OPENBANKING_TELEMETRY_EVENTS as Nt,redactOpenBankingTelemetryPayload as Pt}from"./integrations/openbanking/telemetry.js";import{OpenBankingGetAccount as Ft,OpenBankingListAccounts as It,OpenBankingSyncAccounts as Lt}from"./integrations/openbanking/contracts/accounts.js";import{OpenBankingListTransactions as Rt,OpenBankingSyncTransactions as zt}from"./integrations/openbanking/contracts/transactions.js";import{OpenBankingGetBalances as Bt,OpenBankingRefreshBalances as Vt}from"./integrations/openbanking/contracts/balances.js";import{registerOpenBankingContracts as Ht}from"./integrations/openbanking/contracts/index.js";import{assertPrimaryOpenBankingReady as Ut,ensurePrimaryOpenBankingIntegration as Wt}from"./integrations/openbanking/guards.js";import"./integrations/index.js";import{KnowledgeSpaceRegistry as Gt,makeKnowledgeSpaceKey as Kt}from"./knowledge/spec.js";import{productCanonKnowledgeSpace as qt,registerProductCanonKnowledgeSpace as Jt}from"./knowledge/spaces/product-canon.js";import{registerSupportFaqKnowledgeSpace as Yt,supportFaqKnowledgeSpace as Xt}from"./knowledge/spaces/support-faq.js";import{emailThreadsKnowledgeSpace as Zt,registerEmailThreadsKnowledgeSpace as Qt}from"./knowledge/spaces/email-threads.js";import{registerUploadedDocsKnowledgeSpace as $t,uploadedDocsKnowledgeSpace as en}from"./knowledge/spaces/uploaded-docs.js";import{financialDocsKnowledgeSpace as tn,registerFinancialDocsKnowledgeSpace as nn}from"./knowledge/spaces/financial-docs.js";import{financialOverviewKnowledgeSpace as rn,registerFinancialOverviewKnowledgeSpace as an}from"./knowledge/spaces/financial-overview.js";import"./knowledge/index.js";import{CreateIntegrationConnection as on,DeleteIntegrationConnection as sn,ListIntegrationConnections as cn,TestIntegrationConnection as ln,UpdateIntegrationConnection as un,integrationContracts as dn,registerIntegrationContracts as fn}from"./integrations/contracts.js";import{CreateKnowledgeSource as pn,DeleteKnowledgeSource as mn,ListKnowledgeSources as hn,TriggerKnowledgeSourceSync as gn,UpdateKnowledgeSource as _n,knowledgeContracts as vn,registerKnowledgeContracts as yn}from"./knowledge/contracts.js";import{behaviorToEnvelope as bn,errorToEnvelope as xn,telemetryToEnvelope as Sn}from"./regenerator/utils.js";import{RegeneratorService as Cn}from"./regenerator/service.js";import{ProposalExecutor as wn}from"./regenerator/executor.js";import{ExecutorProposalSink as Tn}from"./regenerator/sinks.js";import"./regenerator/index.js";import{WorkflowRegistry as En}from"./workflow/spec.js";import{WorkflowValidationError as Dn,assertWorkflowSpecValid as On,validateWorkflowSpec as kn}from"./workflow/validation.js";import{evaluateExpression as An}from"./workflow/expression.js";import{WorkflowPreFlightError as jn,WorkflowRunner as Mn}from"./workflow/runner.js";import{InMemoryStateStore as Nn}from"./workflow/adapters/memory-store.js";import{PrismaStateStore as Pn}from"./workflow/adapters/db-adapter.js";import{createFileStateStore as Fn}from"./workflow/adapters/file-adapter.js";import"./workflow/index.js";import{techContractsDocs as In}from"./docs/tech-contracts.docs.js";import{metaDocs as Ln}from"./docs/meta.docs.js";import"./docs/index.js";import{defineSchemaModel as Rn}from"@lssm/lib.schema";export{kt as AccountBalanceRecord,rt as AppBlueprintRegistry,At as BankAccountRecord,jt as BankTransactionRecord,e as CapabilityRegistry,Te as CompleteOnboardingBaseInput,Ee as CompleteOnboardingBaseOutput,De as CompleteOnboardingBaseSpec,ue as ContractRegistryFileSchema,de as ContractRegistryItemSchema,fe as ContractRegistryItemTypeSchema,pe as ContractRegistryManifestSchema,on as CreateIntegrationConnection,pn as CreateKnowledgeSource,r as DataViewRegistry,sn as DeleteIntegrationConnection,mn as DeleteKnowledgeSource,Oe as DeleteOnboardingDraftBaseSpec,ke as DeleteOnboardingDraftOutput,Q as DocRegistry,Tn as ExecutorProposalSink,nt as ExperimentEvaluator,et as ExperimentRegistry,s as FeatureRegistry,u as FormRegistry,Ae as GetOnboardingDraftBaseSpec,je as GetOnboardingDraftOutput,Nn as InMemoryStateStore,st as IntegrationSpecRegistry,Gt as KnowledgeSpaceRegistry,cn as ListIntegrationConnections,hn as ListKnowledgeSources,Ke as MigrationRegistry,He as OPAPolicyAdapter,Mt as OPENBANKING_PII_FIELDS,Nt as OPENBANKING_TELEMETRY_EVENTS,Ft as OpenBankingGetAccount,Bt as OpenBankingGetBalances,It as OpenBankingListAccounts,Rt as OpenBankingListTransactions,Vt as OpenBankingRefreshBalances,Lt as OpenBankingSyncAccounts,zt as OpenBankingSyncTransactions,ae as Owners,oe as OwnersEnum,Ve as PolicyEngine,ze as PolicyRegistry,I as PresentationRegistry,Pn as PrismaStateStore,ye as PromptRegistry,wn as ProposalExecutor,Cn as RegeneratorService,be as ResourceRegistry,Me as SaveOnboardingDraftBaseSpec,Ne as SaveOnboardingDraftInput,Pe as SaveOnboardingDraftOutput,re as SpecRegistry,se as StabilityEnum,ce as Tags,le as TagsEnum,Xe as TelemetryAnomalyMonitor,qe as TelemetryRegistry,Ye as TelemetryTracker,ln as TestIntegrationConnection,Ze as TestRegistry,$e as TestRunner,We as ThemeRegistry,y as TransformEngine,gn as TriggerKnowledgeSourceSync,un as UpdateIntegrationConnection,_n as UpdateKnowledgeSource,jn as WorkflowPreFlightError,En as WorkflowRegistry,Mn as WorkflowRunner,Dn as WorkflowValidationError,Ut as assertPrimaryOpenBankingReady,On as assertWorkflowSpecValid,bn as behaviorToEnvelope,Ue as buildOPAInput,d as buildZodWithRelations,t as capabilityKey,at as composeAppConfig,b as createDefaultTransformEngine,w as createEngineWithDefaults,T as createFeatureModule,z as createFetchHandler,Fn as createFileStateStore,O as createFormRenderer,R as createMcpServer,i as dataViewKey,$ as defaultDocRegistry,j as defaultGqlField,M as defaultMcpTool,N as defaultRestPath,n as defineCapability,W as defineCommand,a as defineEvent,f as defineFormSpec,ve as definePrompt,G as defineQuery,xe as defineResourceTemplate,Rn as defineSchemaModel,q as docBlockToPresentationSpec,J as docBlockToPresentationV2,Y as docBlocksToPresentationRoutes,X as docBlocksToPresentationSpecs,ee as docId,_t as elevenLabsIntegrationSpec,B as elysiaPlugin,Zt as emailThreadsKnowledgeSpace,Wt as ensurePrimaryOpenBankingIntegration,xn as errorToEnvelope,p as evalPredicate,An as evaluateExpression,o as eventKey,V as expressRouter,tn as financialDocsKnowledgeSpace,rn as financialOverviewKnowledgeSpace,Tt as gcsStorageIntegrationSpec,yt as gmailIntegrationSpec,xt as googleCalendarIntegrationSpec,c as installFeature,me as installOp,dn as integrationContracts,K as isEmitDeclRef,Se as isResourceRef,L as jsonSchemaForPresentation,P as jsonSchemaForSpec,vn as knowledgeContracts,te as listRegisteredDocBlocks,it as makeAppBlueprintKey,he as makeEmit,tt as makeExperimentKey,ct as makeIntegrationSpecKey,Kt as makeKnowledgeSpaceKey,H as makeNextAppHandler,U as makeNextPagesHandler,Be as makePolicyKey,Je as makeTelemetryKey,Qe as makeTestKey,Ge as makeThemeRef,Z as mapDocRoutes,Ln as metaDocs,ht as mistralIntegrationSpec,ge as op,ie as opKey,_e as openApiForRegistry,Fe as openBankingAccountsReadCapability,Ie as openBankingBalancesReadCapability,Le as openBankingTransactionsReadCapability,dt as postmarkIntegrationSpec,Dt as powensIntegrationSpec,qt as productCanonKnowledgeSpace,pt as qdrantIntegrationSpec,Pt as redactOpenBankingTelemetryPayload,x as registerBasicValidation,F as registerContractsOnBuilder,S as registerDefaultReactRenderer,ne as registerDocBlocks,vt as registerElevenLabsIntegration,Qt as registerEmailThreadsKnowledgeSpace,E as registerFeature,nn as registerFinancialDocsKnowledgeSpace,an as registerFinancialOverviewKnowledgeSpace,Et as registerGcsStorageIntegration,bt as registerGmailIntegration,St as registerGoogleCalendarIntegration,fn as registerIntegrationContracts,yn as registerKnowledgeContracts,gt as registerMistralIntegration,Re as registerOpenBankingCapabilities,Ht as registerOpenBankingContracts,ft as registerPostmarkIntegration,Ot as registerPowensIntegration,Jt as registerProductCanonKnowledgeSpace,mt as registerQdrantIntegration,C as registerReactToMarkdownRenderer,lt as registerStripeIntegration,Yt as registerSupportFaqKnowledgeSpace,Ct as registerTwilioSmsIntegration,$t as registerUploadedDocsKnowledgeSpace,D as renderFeaturePresentation,ot as resolveAppConfig,Ce as resourceRef,A as rnReusablesDriver,m as schemaToMarkdown,h as schemaToMarkdownDetail,g as schemaToMarkdownList,_ as schemaToMarkdownSummary,v as schemaToMarkdownTable,k as shadcnDriver,ut as stripeIntegrationSpec,Xt as supportFaqKnowledgeSpace,In as techContractsDocs,Sn as telemetryToEnvelope,we as toV2FromV1,wt as twilioSmsIntegrationSpec,en as uploadedDocsKnowledgeSpace,l as validateFeatureTargetsV2,kn as validateWorkflowSpec};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{IntegrationSpecRegistry as e,makeIntegrationSpecKey as t}from"./spec.js";import{registerStripeIntegration as n,stripeIntegrationSpec as r}from"./providers/stripe.js";import{postmarkIntegrationSpec as i,registerPostmarkIntegration as a}from"./providers/postmark.js";import{qdrantIntegrationSpec as o,registerQdrantIntegration as s}from"./providers/qdrant.js";import{mistralIntegrationSpec as c,registerMistralIntegration as l}from"./providers/mistral.js";import{elevenLabsIntegrationSpec as u,registerElevenLabsIntegration as d}from"./providers/elevenlabs.js";import{gmailIntegrationSpec as f,registerGmailIntegration as p}from"./providers/gmail.js";import{googleCalendarIntegrationSpec as m,registerGoogleCalendarIntegration as h}from"./providers/google-calendar.js";import{registerTwilioSmsIntegration as g,twilioSmsIntegrationSpec as _}from"./providers/twilio-sms.js";import{gcsStorageIntegrationSpec as v,registerGcsStorageIntegration as y}from"./providers/gcs-storage.js";import{powensIntegrationSpec as b,registerPowensIntegration as x}from"./providers/powens.js";import
|
|
1
|
+
import{IntegrationSpecRegistry as e,makeIntegrationSpecKey as t}from"./spec.js";import{registerStripeIntegration as n,stripeIntegrationSpec as r}from"./providers/stripe.js";import{postmarkIntegrationSpec as i,registerPostmarkIntegration as a}from"./providers/postmark.js";import{qdrantIntegrationSpec as o,registerQdrantIntegration as s}from"./providers/qdrant.js";import{mistralIntegrationSpec as c,registerMistralIntegration as l}from"./providers/mistral.js";import{elevenLabsIntegrationSpec as u,registerElevenLabsIntegration as d}from"./providers/elevenlabs.js";import{gmailIntegrationSpec as f,registerGmailIntegration as p}from"./providers/gmail.js";import{googleCalendarIntegrationSpec as m,registerGoogleCalendarIntegration as h}from"./providers/google-calendar.js";import{registerTwilioSmsIntegration as g,twilioSmsIntegrationSpec as _}from"./providers/twilio-sms.js";import{gcsStorageIntegrationSpec as v,registerGcsStorageIntegration as y}from"./providers/gcs-storage.js";import{powensIntegrationSpec as b,registerPowensIntegration as x}from"./providers/powens.js";import"./providers/index.js";import{AccountBalanceRecord as S,BankAccountRecord as C,BankTransactionRecord as w}from"./openbanking/models.js";import{OPENBANKING_PII_FIELDS as T,OPENBANKING_TELEMETRY_EVENTS as E,redactOpenBankingTelemetryPayload as D}from"./openbanking/telemetry.js";import{OpenBankingGetAccount as O,OpenBankingListAccounts as k,OpenBankingSyncAccounts as A}from"./openbanking/contracts/accounts.js";import{OpenBankingListTransactions as j,OpenBankingSyncTransactions as M}from"./openbanking/contracts/transactions.js";import{OpenBankingGetBalances as N,OpenBankingRefreshBalances as P}from"./openbanking/contracts/balances.js";import{registerOpenBankingContracts as F}from"./openbanking/contracts/index.js";import{assertPrimaryOpenBankingReady as I,ensurePrimaryOpenBankingIntegration as L}from"./openbanking/guards.js";export{S as AccountBalanceRecord,C as BankAccountRecord,w as BankTransactionRecord,e as IntegrationSpecRegistry,T as OPENBANKING_PII_FIELDS,E as OPENBANKING_TELEMETRY_EVENTS,O as OpenBankingGetAccount,N as OpenBankingGetBalances,k as OpenBankingListAccounts,j as OpenBankingListTransactions,P as OpenBankingRefreshBalances,A as OpenBankingSyncAccounts,M as OpenBankingSyncTransactions,I as assertPrimaryOpenBankingReady,u as elevenLabsIntegrationSpec,L as ensurePrimaryOpenBankingIntegration,v as gcsStorageIntegrationSpec,f as gmailIntegrationSpec,m as googleCalendarIntegrationSpec,t as makeIntegrationSpecKey,c as mistralIntegrationSpec,i as postmarkIntegrationSpec,b as powensIntegrationSpec,o as qdrantIntegrationSpec,D as redactOpenBankingTelemetryPayload,d as registerElevenLabsIntegration,y as registerGcsStorageIntegration,p as registerGmailIntegration,h as registerGoogleCalendarIntegration,l as registerMistralIntegration,F as registerOpenBankingContracts,a as registerPostmarkIntegration,x as registerPowensIntegration,s as registerQdrantIntegration,n as registerStripeIntegration,g as registerTwilioSmsIntegration,r as stripeIntegrationSpec,_ as twilioSmsIntegrationSpec};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ElevenLabsVoiceProvider as e}from"./elevenlabs-voice.js";import{GoogleCloudStorageProvider as t}from"./gcs-storage.js";import{GmailInboundProvider as n}from"./gmail-inbound.js";import{GmailOutboundProvider as r}from"./gmail-outbound.js";import{GoogleCalendarProvider as i}from"./google-calendar.js";import{MistralLLMProvider as a}from"./mistral-llm.js";import{MistralEmbeddingProvider as o}from"./mistral-embedding.js";import{QdrantVectorProvider as s}from"./qdrant-vector.js";import{StripePaymentsProvider as c}from"./stripe-payments.js";import{PostmarkEmailProvider as l}from"./postmark-email.js";import{TwilioSmsProvider as u}from"./twilio-sms.js";import{PowensClient as d,PowensClientError as f}from"./powens-client.js";import{PowensOpenBankingProvider as p}from"./powens-openbanking.js";import{IntegrationProviderFactory as m}from"./provider-factory.js";export{e as ElevenLabsVoiceProvider,n as GmailInboundProvider,r as GmailOutboundProvider,i as GoogleCalendarProvider,t as GoogleCloudStorageProvider,m as IntegrationProviderFactory,o as MistralEmbeddingProvider,a as MistralLLMProvider,l as PostmarkEmailProvider,d as PowensClient,f as PowensClientError,p as PowensOpenBankingProvider,s as QdrantVectorProvider,c as StripePaymentsProvider,u as TwilioSmsProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ElevenLabsVoiceProvider as e}from"./elevenlabs-voice.js";import{GoogleCloudStorageProvider as t}from"./gcs-storage.js";import{MistralLLMProvider as n}from"./mistral-llm.js";import{MistralEmbeddingProvider as r}from"./mistral-embedding.js";import{QdrantVectorProvider as i}from"./qdrant-vector.js";import{StripePaymentsProvider as a}from"./stripe-payments.js";import{PostmarkEmailProvider as o}from"./postmark-email.js";import{TwilioSmsProvider as s}from"./twilio-sms.js";import{PowensOpenBankingProvider as c}from"./powens-openbanking.js";import{Buffer as l}from"node:buffer";const u=new Map;var d=class{async createPaymentsProvider(e){let t=await this.loadSecrets(e);switch(e.spec.meta.key){case`payments.stripe`:return new a({apiKey:p(t,`apiKey`,`Stripe API key is required`)});default:throw Error(`Unsupported payments integration: ${e.spec.meta.key}`)}}async createEmailOutboundProvider(e){let t=await this.loadSecrets(e);switch(e.spec.meta.key){case`email.postmark`:return new o({serverToken:p(t,`serverToken`,`Postmark server token is required`),defaultFromEmail:e.config.fromEmail,messageStream:e.config.messageStream});default:throw Error(`Unsupported email integration: ${e.spec.meta.key}`)}}async createSmsProvider(e){let t=await this.loadSecrets(e);switch(e.spec.meta.key){case`sms.twilio`:return new s({accountSid:p(t,`accountSid`,`Twilio account SID is required`),authToken:p(t,`authToken`,`Twilio auth token is required`),fromNumber:e.config.fromNumber});default:throw Error(`Unsupported SMS integration: ${e.spec.meta.key}`)}}async createVectorStoreProvider(e){let t=await this.loadSecrets(e);switch(e.spec.meta.key){case`vectordb.qdrant`:return new i({url:m(e,`apiUrl`,`Qdrant apiUrl config is required`),apiKey:t.apiKey});default:throw Error(`Unsupported vector store integration: ${e.spec.meta.key}`)}}async createObjectStorageProvider(e){let n=await this.loadSecrets(e);switch(e.spec.meta.key){case`storage.s3`:case`storage.gcs`:return new t({bucket:m(e,`bucket`,`Storage bucket is required`),clientOptions:n.type===`service_account`?{credentials:n}:void 0});default:throw Error(`Unsupported storage integration: ${e.spec.meta.key}`)}}async createVoiceProvider(t){let n=await this.loadSecrets(t);switch(t.spec.meta.key){case`ai-voice.elevenlabs`:return new e({apiKey:p(n,`apiKey`,`ElevenLabs API key is required`),defaultVoiceId:t.config.defaultVoiceId});default:throw Error(`Unsupported voice integration: ${t.spec.meta.key}`)}}async createLlmProvider(e){let t=await this.loadSecrets(e);switch(e.spec.meta.key){case`ai-llm.mistral`:return new n({apiKey:p(t,`apiKey`,`Mistral API key is required`),defaultModel:e.config.model});default:throw Error(`Unsupported LLM integration: ${e.spec.meta.key}`)}}async createEmbeddingProvider(e){let t=await this.loadSecrets(e);switch(e.spec.meta.key){case`ai-llm.mistral`:return new r({apiKey:p(t,`apiKey`,`Mistral API key is required`),defaultModel:e.config.embeddingModel});default:throw Error(`Unsupported embeddings integration: ${e.spec.meta.key}`)}}async createOpenBankingProvider(e){let t=await this.loadSecrets(e),n=e.config;switch(e.spec.meta.key){case`openbanking.powens`:{let r=m(e,`environment`,`Powens environment (sandbox | production) must be specified in integration config.`);if(r!==`sandbox`&&r!==`production`)throw Error(`Powens environment "${r}" is invalid. Expected "sandbox" or "production".`);return new c({clientId:p(t,`clientId`,`Powens clientId is required`),clientSecret:p(t,`clientSecret`,`Powens clientSecret is required`),apiKey:t.apiKey,environment:r,baseUrl:n?.baseUrl})}default:throw Error(`Unsupported open banking integration: ${e.spec.meta.key}`)}}async loadSecrets(e){let t=e.connection.meta.id;if(u.has(t))return u.get(t);let n=f(await e.secretProvider.getSecret(e.secretReference));return u.set(t,n),n}};function f(e){let t=l.from(e.data).toString(`utf-8`).trim();if(!t)return{};try{return JSON.parse(t)}catch{return{apiKey:t}}}function p(e,t,n){let r=e[t];if(r==null||r===``)throw Error(n);return r}function m(e,t,n){let r=e.config?.[t];if(r==null)throw Error(n);return r}export{d as IntegrationProviderFactory};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{registerStripeIntegration as e,stripeIntegrationSpec as t}from"./stripe.js";import{postmarkIntegrationSpec as n,registerPostmarkIntegration as r}from"./postmark.js";import{qdrantIntegrationSpec as i,registerQdrantIntegration as a}from"./qdrant.js";import{mistralIntegrationSpec as o,registerMistralIntegration as s}from"./mistral.js";import{elevenLabsIntegrationSpec as c,registerElevenLabsIntegration as l}from"./elevenlabs.js";import{gmailIntegrationSpec as u,registerGmailIntegration as d}from"./gmail.js";import{googleCalendarIntegrationSpec as f,registerGoogleCalendarIntegration as p}from"./google-calendar.js";import{registerTwilioSmsIntegration as m,twilioSmsIntegrationSpec as h}from"./twilio-sms.js";import{gcsStorageIntegrationSpec as g,registerGcsStorageIntegration as _}from"./gcs-storage.js";import{powensIntegrationSpec as v,registerPowensIntegration as y}from"./powens.js";
|
|
1
|
+
import{registerStripeIntegration as e,stripeIntegrationSpec as t}from"./stripe.js";import{postmarkIntegrationSpec as n,registerPostmarkIntegration as r}from"./postmark.js";import{qdrantIntegrationSpec as i,registerQdrantIntegration as a}from"./qdrant.js";import{mistralIntegrationSpec as o,registerMistralIntegration as s}from"./mistral.js";import{elevenLabsIntegrationSpec as c,registerElevenLabsIntegration as l}from"./elevenlabs.js";import{gmailIntegrationSpec as u,registerGmailIntegration as d}from"./gmail.js";import{googleCalendarIntegrationSpec as f,registerGoogleCalendarIntegration as p}from"./google-calendar.js";import{registerTwilioSmsIntegration as m,twilioSmsIntegrationSpec as h}from"./twilio-sms.js";import{gcsStorageIntegrationSpec as g,registerGcsStorageIntegration as _}from"./gcs-storage.js";import{powensIntegrationSpec as v,registerPowensIntegration as y}from"./powens.js";export{c as elevenLabsIntegrationSpec,g as gcsStorageIntegrationSpec,u as gmailIntegrationSpec,f as googleCalendarIntegrationSpec,o as mistralIntegrationSpec,n as postmarkIntegrationSpec,v as powensIntegrationSpec,i as qdrantIntegrationSpec,l as registerElevenLabsIntegration,_ as registerGcsStorageIntegration,d as registerGmailIntegration,p as registerGoogleCalendarIntegration,s as registerMistralIntegration,r as registerPostmarkIntegration,y as registerPowensIntegration,a as registerQdrantIntegration,e as registerStripeIntegration,m as registerTwilioSmsIntegration,t as stripeIntegrationSpec,h as twilioSmsIntegrationSpec};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SecretProviderError as e,normalizeSecretPayload as t,parseSecretUri as n}from"./provider.js";import{
|
|
1
|
+
import{SecretProviderError as e,normalizeSecretPayload as t,parseSecretUri as n}from"./provider.js";import{EnvSecretProvider as r}from"./env-secret-provider.js";import{GcpSecretManagerProvider as i}from"./gcp-secret-manager.js";import{SecretProviderManager as a}from"./manager.js";export{r as EnvSecretProvider,i as GcpSecretManagerProvider,e as SecretProviderError,a as SecretProviderManager,t as normalizeSecretPayload,n as parseSecretUri};
|
package/dist/jobs/define-job.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,t){e.register(t.type,async e=>{let n=t.schema.parse(e.payload)
|
|
1
|
+
function e(e,t){e.register(t.type,async e=>{let n=t.schema.parse(e.payload);await t.handler(n,e)})}export{e as registerDefinedJob};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{DEFAULT_RETRY_POLICY as e}from"./queue.js";import{randomUUID as t}from"node:crypto";var n=class{handlers=new Map;constructor(e){this.options=e}async enqueue(n,r,i={}){let a=i.delaySeconds==null?void 0:{seconds:Math.floor(Date.now()/1e3)+i.delaySeconds},o=Buffer.from(JSON.stringify({id:t(),type:n,payload:r}),`utf-8`);return await this.options.client.createTask({parent:`projects/${this.options.projectId}/locations/${this.options.location}/queues/${this.options.queue}`,task:{httpRequest:{httpMethod:`POST`,url:this.options.resolveUrl(n),body:o,headers:{"Content-Type":`application/json`},oidcToken:this.options.serviceAccountEmail?{serviceAccountEmail:this.options.serviceAccountEmail}:void 0},scheduleTime:a}}),{id:t(),type:n,version:1,payload:r,status:`pending`,priority:i.priority??0,attempts:0,maxRetries:i.maxRetries??e.maxRetries,createdAt:new Date,updatedAt:new Date}}register(e,t){this.handlers.set(e,t)}start(){}async stop(){this.handlers.clear()}};export{n as GcpCloudTasksQueue};
|
package/dist/jobs/gcp-pubsub.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{DEFAULT_RETRY_POLICY as e}from"./queue.js";import{randomUUID as t}from"node:crypto";var n=class{handlers=new Map;constructor(e){this.options=e}async enqueue(n,r,i={}){return await this.options.client.topic(this.options.topicName).publishMessage({data:Buffer.from(JSON.stringify({id:t(),type:n,payload:r}),`utf-8`)}),{id:t(),type:n,version:1,payload:r,status:`pending`,priority:i.priority??0,attempts:0,maxRetries:i.maxRetries??e.maxRetries,createdAt:new Date,updatedAt:new Date}}register(e,t){this.handlers.set(e,t)}start(){}async stop(){this.handlers.clear()}};export{n as GcpPubSubQueue};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{registerDefinedJob as e}from"../define-job.js";import{
|
|
1
|
+
import{registerDefinedJob as e}from"../define-job.js";import{createGmailSyncHandler as t}from"./gmail-sync-handler.js";import{PING_JOB_TYPE as n,PingPayloadSchema as r,pingJob as i}from"./ping-handler.js";import{createStorageDocumentHandler as a}from"./storage-document-handler.js";function o(t){e(t,i)}export{n as PING_JOB_TYPE,r as PingPayloadSchema,t as createGmailSyncHandler,a as createStorageDocumentHandler,i as pingJob,o as registerAllJobs};
|
package/dist/jobs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{registerDefinedJob as e}from"./define-job.js";import{DEFAULT_RETRY_POLICY as t,calculateBackoff as n,defineJobType as r}from"./queue.js";export{t as DEFAULT_RETRY_POLICY,n as calculateBackoff,r as defineJobType,e as registerDefinedJob};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{DEFAULT_RETRY_POLICY as e}from"./queue.js";import{randomUUID as t}from"node:crypto";var n=class{jobs=[];handlers=new Map;timer;processing=!1;constructor(e=200){this.pollIntervalMs=e}async enqueue(n,r,i={}){let a={id:t(),type:n,version:1,payload:r,status:`pending`,priority:i.priority??0,attempts:0,maxRetries:i.maxRetries??e.maxRetries,createdAt:new Date,updatedAt:new Date};return i.delaySeconds&&(a.updatedAt=new Date(Date.now()+i.delaySeconds*1e3)),this.jobs.push(a),a}register(e,t){this.handlers.set(e,t)}start(){this.timer||=setInterval(()=>{this.processNext()},this.pollIntervalMs)}async stop(){for(this.timer&&=(clearInterval(this.timer),void 0);this.processing;)await new Promise(e=>setTimeout(e,10))}async processNext(){if(this.processing)return;let e=this.jobs.find(e=>e.status===`pending`&&e.updatedAt<=new Date);if(!e)return;let t=this.handlers.get(e.type);if(t){this.processing=!0,e.status=`running`,e.updatedAt=new Date,e.attempts+=1;try{await t(e),e.status=`completed`,e.updatedAt=new Date}catch(t){e.status=`failed`,e.lastError=t instanceof Error?t.message:`Unknown job error`,e.updatedAt=new Date}finally{this.processing=!1}}}};export{n as MemoryJobQueue};
|
package/dist/jobs/queue.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"zod";const e={maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:6e4,multiplier:2,jitter:!0};function t(t,n=e){let r=Math.min(n.initialBackoffMs*n.multiplier**(t-1),n.maxBackoffMs);if(n.jitter){let e=.8+Math.random()*.4;return Math.floor(r*e)}return r}function n(e){return e}export{e as DEFAULT_RETRY_POLICY,t as calculateBackoff,n as defineJobType};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{DEFAULT_RETRY_POLICY as e}from"./queue.js";import{randomUUID as t}from"crypto";import{DeleteMessageCommand as n,ReceiveMessageCommand as r,SQSClient as i,SendMessageCommand as a}from"@aws-sdk/client-sqs";var o=class{sqs;queueUrl;waitTimeSeconds;maxNumberOfMessages;visibilityTimeoutSeconds;handlers=new Map;running=!1;constructor(e){let t=process.env.SCALEWAY_ACCESS_KEY_QUEUE,n=process.env.SCALEWAY_SECRET_KEY_QUEUE;if(!t||!n)throw Error(`Missing SCALEWAY_ACCESS_KEY_QUEUE / SCALEWAY_SECRET_KEY_QUEUE in env`);this.sqs=new i({region:e.region??process.env.SCALEWAY_REGION??`par`,endpoint:`https://sqs.mnq.fr-par.scaleway.com`,credentials:{accessKeyId:t,secretAccessKey:n}}),this.queueUrl=e.queueUrl,this.waitTimeSeconds=e.waitTimeSeconds??20,this.maxNumberOfMessages=e.maxNumberOfMessages??5,this.visibilityTimeoutSeconds=e.visibilityTimeoutSeconds??60}async enqueue(n,r,i={}){let o=t(),s=new Date,c={id:o,type:n,payload:r};return await this.sqs.send(new a({QueueUrl:this.queueUrl,MessageBody:JSON.stringify(c),DelaySeconds:i.delaySeconds??0})),{id:o,type:n,version:1,payload:r,status:`pending`,priority:i.priority??0,attempts:0,maxRetries:i.maxRetries??e.maxRetries,createdAt:s,updatedAt:s}}register(e,t){if(this.handlers.has(e))throw Error(`Handler already registered for job type "${e}"`);this.handlers.set(e,t)}start(){this.running||(this.running=!0,this.pollLoop().catch(e=>{console.error(`[queue] Fatal error in poll loop`,e),process.exit(1)}))}async stop(){this.running=!1}async pollLoop(){for(console.log(`[queue] SQS worker started for queue:`,this.queueUrl);this.running;)try{let t=(await this.sqs.send(new r({QueueUrl:this.queueUrl,MaxNumberOfMessages:this.maxNumberOfMessages,WaitTimeSeconds:this.waitTimeSeconds,VisibilityTimeout:this.visibilityTimeoutSeconds,MessageSystemAttributeNames:[`ApproximateReceiveCount`]}))).Messages??[];if(t.length===0)continue;for(let n of t){if(!n.Body||!n.ReceiptHandle){console.warn(`[queue] Message missing Body or ReceiptHandle`,n.MessageId);continue}let t;try{t=JSON.parse(n.Body)}catch(e){console.error(`[queue] Failed to parse message body (id=${n.MessageId}), deleting`,e),await this.deleteMessage(n.ReceiptHandle);continue}let r=this.handlers.get(t.type);if(!r){console.error(`[queue] No handler registered for type "${t.type}", deleting message`),await this.deleteMessage(n.ReceiptHandle);continue}let i=new Date,a=parseInt(n.Attributes?.ApproximateReceiveCount??`1`,10),o={id:t.id,type:t.type,version:1,payload:t.payload,status:`pending`,priority:0,attempts:a,maxRetries:e.maxRetries,createdAt:i,updatedAt:i};o.status=`running`,o.updatedAt=new Date;try{await r(o),o.status=`completed`,o.updatedAt=new Date,await this.deleteMessage(n.ReceiptHandle)}catch(e){o.status=`failed`,o.lastError=e instanceof Error?e.message:`Unknown job error`,o.updatedAt=new Date,console.error(`[queue] Error while handling job type=${o.type} id=${o.id}`,e)}}}catch(e){e&&typeof e==`object`&&`$response`in e?console.error(`[queue] Error while polling SQS`,e,e.$response):console.error(`[queue] Error while polling SQS`,e),await this.sleep(5e3)}console.log(`[queue] SQS worker stopped`)}async deleteMessage(e){try{await this.sqs.send(new n({QueueUrl:this.queueUrl,ReceiptHandle:e}))}catch(e){console.error(`[queue] Failed to delete message`,e)}}async sleep(e){await new Promise(t=>setTimeout(t,e))}};export{o as ScalewaySqsJobQueue};
|
package/dist/openapi.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defaultRestPath as e,jsonSchemaForSpec as t}from"./jsonschema.js";function n(e,t){return`${e.replace(/\./g,`_`)}_v${t}`}function r(e,t,r){return`${e}_${n(t,r)}`}function i(e,t){return(t??(e===`query`?`GET`:`POST`)).toLowerCase()}function a(t){let n=t.transport?.rest?.path??e(t.meta.name,t.meta.version);return n.startsWith(`/`)?n:`/${n}`}function o(e,o={}){let s=e.listSpecs().filter(e=>e.meta.kind===`command`||e.meta.kind===`query`).slice().sort((e,t)=>{let n=e.meta.name.localeCompare(t.meta.name);return n===0?e.meta.version-t.meta.version:n}),c={openapi:`3.1.0`,info:{title:o.title??`ContractSpec API`,version:o.version??`0.0.0`,...o.description?{description:o.description}:{}},...o.servers?{servers:o.servers}:{},paths:{},components:{schemas:{}}};for(let e of s){let o=t(e),s=i(e.meta.kind,e.transport?.rest?.method),l=a(e),u=n(e.meta.name,e.meta.version),d=c.paths[l]??={},f={operationId:u,summary:e.meta.description??e.meta.name,description:e.meta.description,tags:e.meta.tags??[],"x-contractspec":{name:e.meta.name,version:e.meta.version,kind:e.meta.kind},responses:{}};if(o.input){let t=r(`Input`,e.meta.name,e.meta.version);c.components.schemas[t]=o.input,f.requestBody={required:!0,content:{"application/json":{schema:{$ref:`#/components/schemas/${t}`}}}}}let p={};if(o.output){let t=r(`Output`,e.meta.name,e.meta.version);c.components.schemas[t]=o.output,p[200]={description:`OK`,content:{"application/json":{schema:{$ref:`#/components/schemas/${t}`}}}}}else p[200]={description:`OK`};f.responses=p,d[s]=f}return c}export{o as openApiForRegistry};
|
package/dist/server/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{registerContractsOnBuilder as e}from"./graphql-pothos.js";import{createMcpServer as t}from"./provider-mcp.js";import{createFetchHandler as n}from"./rest-generic.js";import{elysiaPlugin as r}from"./rest-elysia.js";import{expressRouter as i}from"./rest-express.js";import{makeNextAppHandler as a}from"./rest-next-app.js";import{makeNextPagesHandler as o}from"./rest-next-pages.js";export{n as createFetchHandler,t as createMcpServer,r as elysiaPlugin,i as expressRouter,a as makeNextAppHandler,o as makeNextPagesHandler,e as registerContractsOnBuilder};
|
|
1
|
+
import{registerContractsOnBuilder as e}from"./graphql-pothos.js";import{createMcpServer as t}from"./mcp/createMcpServer.js";import"./provider-mcp.js";import{createFetchHandler as n}from"./rest-generic.js";import{elysiaPlugin as r}from"./rest-elysia.js";import{expressRouter as i}from"./rest-express.js";import{makeNextAppHandler as a}from"./rest-next-app.js";import{makeNextPagesHandler as o}from"./rest-next-pages.js";export{n as createFetchHandler,t as createMcpServer,r as elysiaPlugin,i as expressRouter,a as makeNextAppHandler,o as makeNextPagesHandler,e as registerContractsOnBuilder};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{registerMcpTools as e}from"./registerTools.js";import{registerMcpResources as t}from"./registerResources.js";import{registerMcpPrompts as n}from"./registerPrompts.js";import{registerMcpPresentations as r}from"./registerPresentations.js";function i(i,a,o,s,c){return c.logger.info(`Creating MCP server`),e(i,a,{toolCtx:c.toolCtx}),t(i,o,{logger:c.logger,resourceCtx:c.resourceCtx}),r(i,{logger:c.logger,presentations:c.presentations,presentationsV2:c.presentationsV2}),n(i,s,{promptCtx:c.promptCtx}),i}export{i as createMcpServer};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createDefaultTransformEngine as e,registerBasicValidation as t,registerDefaultReactRenderer as n}from"../../presentations.v2.js";import{jsonSchemaForPresentation as r}from"../../presentations.js";function i(e){return!e||typeof e!=`object`?!1:`body`in e&&typeof e.body==`string`}function a(a,o){let s=o.presentations,c=o.presentationsV2;if(s)for(let e of s.list()){let t=`presentation.${e.meta.name.replace(/\./g,`_`)}.v${e.meta.version}`,n=`presentation://${e.meta.name}/v${e.meta.version}`;a.registerResource(t,n,{title:`${e.meta.name} v${e.meta.version}`,description:e.meta.description??`Presentation`},async()=>{if(e.content.kind===`markdown`)return{contents:[{uri:n,mimeType:`text/markdown`,text:e.content.content?e.content.content:`See resource: ${e.content.resourceUri??``}`}]};if(e.content.kind===`data`){let t=r(e);return{contents:[{uri:n,mimeType:`application/json`,text:JSON.stringify(t,null,2)}]}}let t={name:e.meta.name,version:e.meta.version,kind:e.content.kind,description:e.meta.description??``};return{contents:[{uri:n,mimeType:`application/json`,text:JSON.stringify(t,null,2)}]}});for(let i of[{ext:`.md`,target:`markdown`},{ext:`.json`,target:`application/json`},{ext:`.xml`,target:`application/xml`}]){let s=`${t}${i.ext}`,c=`${n}${i.ext}`;o.logger.info(`Registering presentation resource ${c} for ${s}`),a.registerResource(s,c,{title:`${e.meta.name} v${e.meta.version} (${i.ext})`,description:`${e.meta.description??`Presentation`} (${i.ext})`},async()=>{if(e.content.kind===`markdown`&&i.target===`markdown`)return{contents:[{uri:c,mimeType:`text/markdown`,text:e.content.content??`See resource: ${e.content.resourceUri??``}`}]};if(e.content.kind===`data`&&i.target===`application/json`)return{contents:[{uri:c,mimeType:`application/json`,text:JSON.stringify(r(e),null,2)}]};let t=JSON.stringify({meta:e.meta,content:e.content},null,2);return i.target===`application/json`?{contents:[{uri:c,mimeType:`application/json`,text:t}]}:i.target===`application/xml`?{contents:[{uri:c,mimeType:`application/xml`,text:`<presentation name="${e.meta.name}" version="${e.meta.version}"><json>${encodeURIComponent(t)}</json></presentation>`}]}:{contents:[{uri:c,mimeType:`text/markdown`,text:`Unsupported presentation for markdown`}]}})}}if(c&&c.length){let r=t(n(e()));for(let e of c){let t=`presentation.${e.meta.name.replace(/\./g,`_`)}.v${e.meta.version}`,n=`presentation://${e.meta.name}/v${e.meta.version}`;o.logger.info(`Registering presentation descriptor ${n} for ${t}`),a.registerResource(t,n,{title:`${e.meta.name} v${e.meta.version}`,description:e.meta.description??`Presentation`,mimeType:`application/json`},async()=>({contents:[{uri:n,mimeType:`application/json`,text:JSON.stringify({meta:e.meta,source:e.source,targets:e.targets},null,2)}]}));for(let o of[{ext:`.md`,target:`markdown`},{ext:`.json`,target:`application/json`},{ext:`.xml`,target:`application/xml`}]){let s=`${t}${o.ext}`,c=`${n}${o.ext}`;a.registerResource(s,c,{title:`${e.meta.name} v${e.meta.version} (${o.ext})`,description:`${e.meta.description??`Presentation`} (${o.ext})`},async()=>{let t=await r.render(o.target,e);return{contents:[{uri:c,mimeType:i(t)&&t.mimeType?t.mimeType:o.target===`markdown`?`text/markdown`:o.target,text:i(t)&&typeof t.body==`string`?t.body:String(t)}]}})}}}}export{a as registerMcpPresentations};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import e from"zod";function t(e){let t={};for(let n of e)t[n.name]=n.schema;return t}function n(e,n,r){for(let i of n.list())e.registerPrompt(i.meta.name,{title:i.meta.title,description:i.meta.description,argsSchema:t(i.args)},async e=>{let t=(e,t)=>{let n=e;for(let[e,r]of Object.entries(t))n=n.replace(RegExp(`\\{${e}\\}`,`g`),encodeURIComponent(String(r)));return n};return{messages:[{role:`assistant`,content:{type:`text`,text:(await i.render(i.input.parse(e),{...r.promptCtx(),link:t})).map(e=>e.type===`text`?e.text:`See resource: ${e.title??e.uri}\nURI: ${e.uri}`).join(`
|
|
2
|
+
|
|
3
|
+
`)}}],description:i.meta.description}})}export{n as registerMcpPrompts};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ResourceTemplate as e}from"@modelcontextprotocol/sdk/server/mcp.js";import{Buffer as t}from"node:buffer";function n(e){return{title:e.meta.title,description:e.meta.description,mimeType:e.meta.mimeType,_meta:{tags:e.meta.tags??[]}}}function r(r,i,a){for(let o of i.listTemplates())a.logger.info(`Registering resource: `+o.meta.uriTemplate),r.registerResource(o.meta.uriTemplate,new e(o.meta.uriTemplate,{list:void 0}),n(o),async(e,n)=>{let r=o.input.parse(n),i=await o.resolve(r,a.resourceCtx());return typeof i.data==`string`?{contents:[{uri:i.uri,mimeType:i.mimeType??o.meta.mimeType,text:i.data}]}:{contents:[{uri:i.uri,mimeType:i.mimeType??o.meta.mimeType,blob:t.from(i.data).toString(`base64`)}]}}),a.logger.info(`Registered resource: `+o.meta.uriTemplate)}export{r as registerMcpResources};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defaultMcpTool as e}from"../../jsonschema.js";function t(t,n,r){for(let i of n.listSpecs()){if(i.meta.kind!==`command`)continue;let a=i.transport?.mcp?.toolName??e(i.meta.name,i.meta.version);t.registerTool(a,{description:i.meta.description,inputSchema:i.io.input?.getZod()},async e=>{let t=await n.execute(i.meta.name,i.meta.version,e??{},r.toolCtx());return{content:[{type:`text`,text:JSON.stringify(t,null,4)}]}})}}export{t as registerMcpTools};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{createMcpServer as e}from"./mcp/createMcpServer.js";export{e as createMcpServer};
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/lib.contracts",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20251213172311",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
|
|
6
6
|
"build": "bun build:bundle && bun build:types",
|
|
7
7
|
"build:bundle": "tsdown",
|
|
8
8
|
"build:types": "tsc --noEmit",
|
|
9
9
|
"dev": "bun build:bundle --watch",
|
|
10
|
+
"registry:build": "bun run scripts/build-registry.ts",
|
|
10
11
|
"clean": "rimraf dist .turbo",
|
|
11
12
|
"lint": "bun lint:fix",
|
|
12
13
|
"lint:fix": "eslint src --fix",
|
|
@@ -81,6 +82,9 @@
|
|
|
81
82
|
"./client/react/drivers/shadcn": "./src/client/react/drivers/shadcn.ts",
|
|
82
83
|
"./client/react/feature-render": "./src/client/react/feature-render.ts",
|
|
83
84
|
"./client/react/form-render": "./src/client/react/form-render.tsx",
|
|
85
|
+
"./contract-registry": "./src/contract-registry/index.ts",
|
|
86
|
+
"./contract-registry/schemas": "./src/contract-registry/schemas.ts",
|
|
87
|
+
"./contract-registry/types": "./src/contract-registry/types.ts",
|
|
84
88
|
"./contracts-adapter-hydration": "./src/contracts-adapter-hydration.ts",
|
|
85
89
|
"./contracts-adapter-input": "./src/contracts-adapter-input.ts",
|
|
86
90
|
"./data-views": "./src/data-views.ts",
|
|
@@ -97,6 +101,7 @@
|
|
|
97
101
|
"./docs/tech/contracts/create-subscription.docblock": "./src/docs/tech/contracts/create-subscription.docblock.ts",
|
|
98
102
|
"./docs/tech/contracts/graphql-typed-outputs.docblock": "./src/docs/tech/contracts/graphql-typed-outputs.docblock.ts",
|
|
99
103
|
"./docs/tech/contracts/migrations.docblock": "./src/docs/tech/contracts/migrations.docblock.ts",
|
|
104
|
+
"./docs/tech/contracts/openapi-export.docblock": "./src/docs/tech/contracts/openapi-export.docblock.ts",
|
|
100
105
|
"./docs/tech/contracts/ops-to-presentation-linking.docblock": "./src/docs/tech/contracts/ops-to-presentation-linking.docblock.ts",
|
|
101
106
|
"./docs/tech/contracts/overlays.docblock": "./src/docs/tech/contracts/overlays.docblock.ts",
|
|
102
107
|
"./docs/tech/contracts/README.docblock": "./src/docs/tech/contracts/README.docblock.ts",
|
|
@@ -112,7 +117,9 @@
|
|
|
112
117
|
"./docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock": "./src/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.ts",
|
|
113
118
|
"./docs/tech/presentation-runtime.docblock": "./src/docs/tech/presentation-runtime.docblock.ts",
|
|
114
119
|
"./docs/tech/schema/README.docblock": "./src/docs/tech/schema/README.docblock.ts",
|
|
120
|
+
"./docs/tech/telemetry-ingest.docblock": "./src/docs/tech/telemetry-ingest.docblock.ts",
|
|
115
121
|
"./docs/tech/templates/runtime.docblock": "./src/docs/tech/templates/runtime.docblock.ts",
|
|
122
|
+
"./docs/tech/vscode-extension.docblock": "./src/docs/tech/vscode-extension.docblock.ts",
|
|
116
123
|
"./docs/tech/workflows/overview.docblock": "./src/docs/tech/workflows/overview.docblock.ts",
|
|
117
124
|
"./docs/types": "./src/docs/types.ts",
|
|
118
125
|
"./events": "./src/events.ts",
|
|
@@ -217,6 +224,7 @@
|
|
|
217
224
|
"./markdown": "./src/markdown.ts",
|
|
218
225
|
"./migrations": "./src/migrations.ts",
|
|
219
226
|
"./onboarding-base": "./src/onboarding-base.ts",
|
|
227
|
+
"./openapi": "./src/openapi.ts",
|
|
220
228
|
"./openbanking/docs/openbanking.docblock": "./src/openbanking/docs/openbanking.docblock.ts",
|
|
221
229
|
"./ownership": "./src/ownership.ts",
|
|
222
230
|
"./policy/docs/policy.docblock": "./src/policy/docs/policy.docblock.ts",
|
|
@@ -242,6 +250,12 @@
|
|
|
242
250
|
"./schema-to-markdown": "./src/schema-to-markdown.ts",
|
|
243
251
|
"./server": "./src/server/index.ts",
|
|
244
252
|
"./server/graphql-pothos": "./src/server/graphql-pothos.ts",
|
|
253
|
+
"./server/mcp/createMcpServer": "./src/server/mcp/createMcpServer.ts",
|
|
254
|
+
"./server/mcp/mcpTypes": "./src/server/mcp/mcpTypes.ts",
|
|
255
|
+
"./server/mcp/registerPresentations": "./src/server/mcp/registerPresentations.ts",
|
|
256
|
+
"./server/mcp/registerPrompts": "./src/server/mcp/registerPrompts.ts",
|
|
257
|
+
"./server/mcp/registerResources": "./src/server/mcp/registerResources.ts",
|
|
258
|
+
"./server/mcp/registerTools": "./src/server/mcp/registerTools.ts",
|
|
245
259
|
"./server/provider-mcp": "./src/server/provider-mcp.ts",
|
|
246
260
|
"./server/rest-elysia": "./src/server/rest-elysia.ts",
|
|
247
261
|
"./server/rest-express": "./src/server/rest-express.ts",
|
|
@@ -299,6 +313,9 @@
|
|
|
299
313
|
"./client/react/drivers/shadcn": "./dist/client/react/drivers/shadcn.js",
|
|
300
314
|
"./client/react/feature-render": "./dist/client/react/feature-render.js",
|
|
301
315
|
"./client/react/form-render": "./dist/client/react/form-render.js",
|
|
316
|
+
"./contract-registry": "./dist/contract-registry/index.js",
|
|
317
|
+
"./contract-registry/schemas": "./dist/contract-registry/schemas.js",
|
|
318
|
+
"./contract-registry/types": "./dist/contract-registry/types.js",
|
|
302
319
|
"./contracts-adapter-hydration": "./dist/contracts-adapter-hydration.js",
|
|
303
320
|
"./contracts-adapter-input": "./dist/contracts-adapter-input.js",
|
|
304
321
|
"./data-views": "./dist/data-views.js",
|
|
@@ -315,6 +332,7 @@
|
|
|
315
332
|
"./docs/tech/contracts/create-subscription.docblock": "./dist/docs/tech/contracts/create-subscription.docblock.js",
|
|
316
333
|
"./docs/tech/contracts/graphql-typed-outputs.docblock": "./dist/docs/tech/contracts/graphql-typed-outputs.docblock.js",
|
|
317
334
|
"./docs/tech/contracts/migrations.docblock": "./dist/docs/tech/contracts/migrations.docblock.js",
|
|
335
|
+
"./docs/tech/contracts/openapi-export.docblock": "./dist/docs/tech/contracts/openapi-export.docblock.js",
|
|
318
336
|
"./docs/tech/contracts/ops-to-presentation-linking.docblock": "./dist/docs/tech/contracts/ops-to-presentation-linking.docblock.js",
|
|
319
337
|
"./docs/tech/contracts/overlays.docblock": "./dist/docs/tech/contracts/overlays.docblock.js",
|
|
320
338
|
"./docs/tech/contracts/README.docblock": "./dist/docs/tech/contracts/README.docblock.js",
|
|
@@ -330,7 +348,9 @@
|
|
|
330
348
|
"./docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock": "./dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js",
|
|
331
349
|
"./docs/tech/presentation-runtime.docblock": "./dist/docs/tech/presentation-runtime.docblock.js",
|
|
332
350
|
"./docs/tech/schema/README.docblock": "./dist/docs/tech/schema/README.docblock.js",
|
|
351
|
+
"./docs/tech/telemetry-ingest.docblock": "./dist/docs/tech/telemetry-ingest.docblock.js",
|
|
333
352
|
"./docs/tech/templates/runtime.docblock": "./dist/docs/tech/templates/runtime.docblock.js",
|
|
353
|
+
"./docs/tech/vscode-extension.docblock": "./dist/docs/tech/vscode-extension.docblock.js",
|
|
334
354
|
"./docs/tech/workflows/overview.docblock": "./dist/docs/tech/workflows/overview.docblock.js",
|
|
335
355
|
"./docs/types": "./dist/docs/types.js",
|
|
336
356
|
"./events": "./dist/events.js",
|
|
@@ -435,6 +455,7 @@
|
|
|
435
455
|
"./markdown": "./dist/markdown.js",
|
|
436
456
|
"./migrations": "./dist/migrations.js",
|
|
437
457
|
"./onboarding-base": "./dist/onboarding-base.js",
|
|
458
|
+
"./openapi": "./dist/openapi.js",
|
|
438
459
|
"./openbanking/docs/openbanking.docblock": "./dist/openbanking/docs/openbanking.docblock.js",
|
|
439
460
|
"./ownership": "./dist/ownership.js",
|
|
440
461
|
"./policy/docs/policy.docblock": "./dist/policy/docs/policy.docblock.js",
|
|
@@ -460,6 +481,12 @@
|
|
|
460
481
|
"./schema-to-markdown": "./dist/schema-to-markdown.js",
|
|
461
482
|
"./server": "./dist/server/index.js",
|
|
462
483
|
"./server/graphql-pothos": "./dist/server/graphql-pothos.js",
|
|
484
|
+
"./server/mcp/createMcpServer": "./dist/server/mcp/createMcpServer.js",
|
|
485
|
+
"./server/mcp/mcpTypes": "./dist/server/mcp/mcpTypes.js",
|
|
486
|
+
"./server/mcp/registerPresentations": "./dist/server/mcp/registerPresentations.js",
|
|
487
|
+
"./server/mcp/registerPrompts": "./dist/server/mcp/registerPrompts.js",
|
|
488
|
+
"./server/mcp/registerResources": "./dist/server/mcp/registerResources.js",
|
|
489
|
+
"./server/mcp/registerTools": "./dist/server/mcp/registerTools.js",
|
|
463
490
|
"./server/provider-mcp": "./dist/server/provider-mcp.js",
|
|
464
491
|
"./server/rest-elysia": "./dist/server/rest-elysia.js",
|
|
465
492
|
"./server/rest-express": "./dist/server/rest-express.js",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=Symbol(`Let zodToJsonSchema decide on which parser to use`),t={name:void 0,$refStrategy:`root`,basePath:[`#`],effectStrategy:`input`,pipeStrategy:`all`,dateStrategy:`format:date-time`,mapStrategy:`entries`,removeAdditionalStrategy:`passthrough`,allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:`definitions`,target:`jsonSchema7`,strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:`escape`,applyRegexFlags:!1,emailStrategy:`format:email`,base64Strategy:`contentEncoding:base64`,nameStrategy:`ref`,openAiAnyTypeName:`OpenAiAnyType`},n=e=>typeof e==`string`?{...t,name:e}:{...t,...e};export{t as defaultOptions,n as getDefaultOptions,e as ignoreOverride};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getDefaultOptions as e}from"./Options.js";const t=t=>{let n=e(t),r=n.name===void 0?n.basePath:[...n.basePath,n.definitionPath,n.name];return{...n,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(n.definitions).map(([e,t])=>[t._def,{def:t._def,path:[...n.basePath,n.definitionPath,e],jsonSchema:void 0}]))}};export{t as getRefs};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,t,n,r){r?.errorMessages&&n&&(e.errorMessage={...e.errorMessage,[t]:n})}function t(t,n,r,i,a){t[n]=r,e(t,n,i,a)}export{e as addErrorMessage,t as setResponseValueAndErrors};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join(`/`)};export{e as getRelativePath};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{defaultOptions as e,getDefaultOptions as t,ignoreOverride as n}from"./Options.js";import{getRefs as r}from"./Refs.js";import{addErrorMessage as i,setResponseValueAndErrors as a}from"./errorMessages.js";import{getRelativePath as o}from"./getRelativePath.js";import{parseAnyDef as s}from"./parsers/any.js";import{parseArrayDef as c}from"./parsers/array.js";import{parseBigintDef as l}from"./parsers/bigint.js";import{parseBooleanDef as u}from"./parsers/boolean.js";import{parseBrandedDef as d}from"./parsers/branded.js";import{parseCatchDef as f}from"./parsers/catch.js";import{parseDateDef as p}from"./parsers/date.js";import{parseDefaultDef as m}from"./parsers/default.js";import{parseEffectsDef as h}from"./parsers/effects.js";import{parseEnumDef as g}from"./parsers/enum.js";import{parseIntersectionDef as _}from"./parsers/intersection.js";import{parseLiteralDef as v}from"./parsers/literal.js";import{parseStringDef as y,zodPatterns as b}from"./parsers/string.js";import{parseRecordDef as x}from"./parsers/record.js";import{parseMapDef as S}from"./parsers/map.js";import{parseNativeEnumDef as C}from"./parsers/nativeEnum.js";import{parseNeverDef as w}from"./parsers/never.js";import{parseNullDef as T}from"./parsers/null.js";import{parseUnionDef as E,primitiveMappings as D}from"./parsers/union.js";import{parseNullableDef as O}from"./parsers/nullable.js";import{parseNumberDef as k}from"./parsers/number.js";import{parseObjectDef as A}from"./parsers/object.js";import{parseOptionalDef as j}from"./parsers/optional.js";import{parsePipelineDef as M}from"./parsers/pipeline.js";import{parsePromiseDef as N}from"./parsers/promise.js";import{parseSetDef as P}from"./parsers/set.js";import{parseTupleDef as F}from"./parsers/tuple.js";import{parseUndefinedDef as I}from"./parsers/undefined.js";import{parseUnknownDef as L}from"./parsers/unknown.js";import{parseReadonlyDef as R}from"./parsers/readonly.js";import{selectParser as z}from"./selectParser.js";import{parseDef as B}from"./parseDef.js";import{zodToJsonSchema as V}from"./zodToJsonSchema.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ignoreOverride as e}from"./Options.js";import{getRelativePath as t}from"./getRelativePath.js";import{parseAnyDef as n}from"./parsers/any.js";import{selectParser as r}from"./selectParser.js";function i(t,n,s=!1){let c=n.seen.get(t);if(n.override){let r=n.override?.(t,n,c,s);if(r!==e)return r}if(c&&!s){let e=a(c,n);if(e!==void 0)return e}let l={def:t,path:n.currentPath,jsonSchema:void 0};n.seen.set(t,l);let u=r(t,t.typeName,n),d=typeof u==`function`?i(u(),n):u;if(d&&o(t,n,d),n.postProcess){let e=n.postProcess(d,t,n);return l.jsonSchema=d,e}return l.jsonSchema=d,d}const a=(e,r)=>{switch(r.$refStrategy){case`root`:return{$ref:e.path.join(`/`)};case`relative`:return{$ref:t(r.currentPath,e.path)};case`none`:case`seen`:return e.path.length<r.currentPath.length&&e.path.every((e,t)=>r.currentPath[t]===e)?(console.warn(`Recursive reference detected at ${r.currentPath.join(`/`)}! Defaulting to any`),n(r)):r.$refStrategy===`seen`?n(r):void 0}},o=(e,t,n)=>(e.description&&(n.description=e.description,t.markdownDescription&&(n.markdownDescription=e.description)),n);export{i as parseDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getRelativePath as e}from"../getRelativePath.js";function t(t){if(t.target!==`openAi`)return{};let n=[...t.basePath,t.definitionPath,t.openAiAnyTypeName];return t.flags.hasReferencedOpenAiAnyType=!0,{$ref:t.$refStrategy===`relative`?e(n,t.currentPath):n.join(`/`)}}export{t as parseAnyDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{setResponseValueAndErrors as e}from"../errorMessages.js";import{parseDef as t}from"../parseDef.js";import{ZodFirstPartyTypeKind as n}from"zod/v3";function r(r,i){let a={type:`array`};return r.type?._def&&r.type?._def?.typeName!==n.ZodAny&&(a.items=t(r.type._def,{...i,currentPath:[...i.currentPath,`items`]})),r.minLength&&e(a,`minItems`,r.minLength.value,r.minLength.message,i),r.maxLength&&e(a,`maxItems`,r.maxLength.value,r.maxLength.message,i),r.exactLength&&(e(a,`minItems`,r.exactLength.value,r.exactLength.message,i),e(a,`maxItems`,r.exactLength.value,r.exactLength.message,i)),a}export{r as parseArrayDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{setResponseValueAndErrors as e}from"../errorMessages.js";function t(t,n){let r={type:`integer`,format:`int64`};if(!t.checks)return r;for(let i of t.checks)switch(i.kind){case`min`:n.target===`jsonSchema7`?i.inclusive?e(r,`minimum`,i.value,i.message,n):e(r,`exclusiveMinimum`,i.value,i.message,n):(i.inclusive||(r.exclusiveMinimum=!0),e(r,`minimum`,i.value,i.message,n));break;case`max`:n.target===`jsonSchema7`?i.inclusive?e(r,`maximum`,i.value,i.message,n):e(r,`exclusiveMaximum`,i.value,i.message,n):(i.inclusive||(r.exclusiveMaximum=!0),e(r,`maximum`,i.value,i.message,n));break;case`multipleOf`:e(r,`multipleOf`,i.value,i.message,n);break}return r}export{t as parseBigintDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(){return{type:`boolean`}}export{e as parseBooleanDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseDef as e}from"../parseDef.js";function t(t,n){return e(t.type._def,n)}export{t as parseBrandedDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseDef as e}from"../parseDef.js";const t=(t,n)=>e(t.innerType._def,n);export{t as parseCatchDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{setResponseValueAndErrors as e}from"../errorMessages.js";function t(e,r,i){let a=i??r.dateStrategy;if(Array.isArray(a))return{anyOf:a.map((n,i)=>t(e,r,n))};switch(a){case`string`:case`format:date-time`:return{type:`string`,format:`date-time`};case`format:date`:return{type:`string`,format:`date`};case`integer`:return n(e,r)}}const n=(t,n)=>{let r={type:`integer`,format:`unix-time`};if(n.target===`openApi3`)return r;for(let i of t.checks)switch(i.kind){case`min`:e(r,`minimum`,i.value,i.message,n);break;case`max`:e(r,`maximum`,i.value,i.message,n);break}return r};export{t as parseDateDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseDef as e}from"../parseDef.js";function t(t,n){return{...e(t.innerType._def,n),default:t.defaultValue()}}export{t as parseDefaultDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseAnyDef as e}from"./any.js";import{parseDef as t}from"../parseDef.js";function n(n,r){return r.effectStrategy===`input`?t(n.schema._def,r):e(r)}export{n as parseEffectsDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){return{type:`string`,enum:Array.from(e.values)}}export{e as parseEnumDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseDef as e}from"../parseDef.js";const t=e=>`type`in e&&e.type===`string`?!1:`allOf`in e;function n(n,r){let i=[e(n.left._def,{...r,currentPath:[...r.currentPath,`allOf`,`0`]}),e(n.right._def,{...r,currentPath:[...r.currentPath,`allOf`,`1`]})].filter(e=>!!e),a=r.target===`jsonSchema2019-09`?{unevaluatedProperties:!1}:void 0,o=[];return i.forEach(e=>{if(t(e))o.push(...e.allOf),e.unevaluatedProperties===void 0&&(a=void 0);else{let t=e;if(`additionalProperties`in e&&e.additionalProperties===!1){let{additionalProperties:n,...r}=e;t=r}else a=void 0;o.push(t)}}),o.length?{allOf:o,...a}:void 0}export{n as parseIntersectionDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e,t){let n=typeof e.value;return n!==`bigint`&&n!==`number`&&n!==`boolean`&&n!==`string`?{type:Array.isArray(e.value)?`array`:`object`}:t.target===`openApi3`?{type:n===`bigint`?`integer`:n,enum:[e.value]}:{type:n===`bigint`?`integer`:n,const:e.value}}export{e as parseLiteralDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseAnyDef as e}from"./any.js";import{parseRecordDef as t}from"./record.js";import{parseDef as n}from"../parseDef.js";function r(r,i){return i.mapStrategy===`record`?t(r,i):{type:`array`,maxItems:125,items:{type:`array`,items:[n(r.keyType._def,{...i,currentPath:[...i.currentPath,`items`,`items`,`0`]})||e(i),n(r.valueType._def,{...i,currentPath:[...i.currentPath,`items`,`items`,`1`]})||e(i)],minItems:2,maxItems:2}}}export{r as parseMapDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){let t=e.values,n=Object.keys(e.values).filter(e=>typeof t[t[e]]!=`number`).map(e=>t[e]),r=Array.from(new Set(n.map(e=>typeof e)));return{type:r.length===1?r[0]===`string`?`string`:`number`:[`string`,`number`],enum:n}}export{e as parseNativeEnumDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseAnyDef as e}from"./any.js";function t(t){return t.target===`openAi`?void 0:{not:e({...t,currentPath:[...t.currentPath,`not`]})}}export{t as parseNeverDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(e){return e.target===`openApi3`?{enum:[`null`],nullable:!0}:{type:`null`}}export{e as parseNullDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{primitiveMappings as e}from"./union.js";import{parseDef as t}from"../parseDef.js";function n(n,r){if([`ZodString`,`ZodNumber`,`ZodBigInt`,`ZodBoolean`,`ZodNull`].includes(n.innerType._def.typeName)&&(!n.innerType._def.checks||!n.innerType._def.checks.length))return r.target===`openApi3`?{type:e[n.innerType._def.typeName],nullable:!0}:{type:[e[n.innerType._def.typeName],`null`]};if(r.target===`openApi3`){let e=t(n.innerType._def,{...r,currentPath:[...r.currentPath]});return e&&`$ref`in e?{allOf:[e],nullable:!0}:e&&{...e,nullable:!0}}let i=t(n.innerType._def,{...r,currentPath:[...r.currentPath,`anyOf`,`0`]});return i&&{anyOf:[i,{type:`null`}]}}export{n as parseNullableDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{addErrorMessage as e,setResponseValueAndErrors as t}from"../errorMessages.js";function n(n,r){let i={type:`number`};if(!n.checks)return i;for(let a of n.checks)switch(a.kind){case`int`:i.type=`integer`,e(i,`type`,a.message,r);break;case`min`:r.target===`jsonSchema7`?a.inclusive?t(i,`minimum`,a.value,a.message,r):t(i,`exclusiveMinimum`,a.value,a.message,r):(a.inclusive||(i.exclusiveMinimum=!0),t(i,`minimum`,a.value,a.message,r));break;case`max`:r.target===`jsonSchema7`?a.inclusive?t(i,`maximum`,a.value,a.message,r):t(i,`exclusiveMaximum`,a.value,a.message,r):(a.inclusive||(i.exclusiveMaximum=!0),t(i,`maximum`,a.value,a.message,r));break;case`multipleOf`:t(i,`multipleOf`,a.value,a.message,r);break}return i}export{n as parseNumberDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseDef as e}from"../parseDef.js";function t(t,i){let a=i.target===`openAi`,o={type:`object`,properties:{}},s=[],c=t.shape();for(let t in c){let n=c[t];if(n===void 0||n._def===void 0)continue;let l=r(n);l&&a&&(n._def.typeName===`ZodOptional`&&(n=n._def.innerType),n.isNullable()||(n=n.nullable()),l=!1);let u=e(n._def,{...i,currentPath:[...i.currentPath,`properties`,t],propertyPath:[...i.currentPath,`properties`,t]});u!==void 0&&(o.properties[t]=u,l||s.push(t))}s.length&&(o.required=s);let l=n(t,i);return l!==void 0&&(o.additionalProperties=l),o}function n(t,n){if(t.catchall._def.typeName!==`ZodNever`)return e(t.catchall._def,{...n,currentPath:[...n.currentPath,`additionalProperties`]});switch(t.unknownKeys){case`passthrough`:return n.allowedAdditionalProperties;case`strict`:return n.rejectedAdditionalProperties;case`strip`:return n.removeAdditionalStrategy===`strict`?n.allowedAdditionalProperties:n.rejectedAdditionalProperties}}function r(e){try{return e.isOptional()}catch{return!0}}export{t as parseObjectDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseAnyDef as e}from"./any.js";import{parseDef as t}from"../parseDef.js";const n=(n,r)=>{if(r.currentPath.toString()===r.propertyPath?.toString())return t(n.innerType._def,r);let i=t(n.innerType._def,{...r,currentPath:[...r.currentPath,`anyOf`,`1`]});return i?{anyOf:[{not:e(r)},i]}:e(r)};export{n as parseOptionalDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseDef as e}from"../parseDef.js";const t=(t,n)=>{if(n.pipeStrategy===`input`)return e(t.in._def,n);if(n.pipeStrategy===`output`)return e(t.out._def,n);let r=e(t.in._def,{...n,currentPath:[...n.currentPath,`allOf`,`0`]});return{allOf:[r,e(t.out._def,{...n,currentPath:[...n.currentPath,`allOf`,r?`1`:`0`]})].filter(e=>e!==void 0)}};export{t as parsePipelineDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseDef as e}from"../parseDef.js";function t(t,n){return e(t.type._def,n)}export{t as parsePromiseDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseDef as e}from"../parseDef.js";const t=(t,n)=>e(t.innerType._def,n);export{t as parseReadonlyDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseAnyDef as e}from"./any.js";import{parseBrandedDef as t}from"./branded.js";import{parseStringDef as n}from"./string.js";import{parseDef as r}from"../parseDef.js";import{ZodFirstPartyTypeKind as i}from"zod/v3";function a(a,o){if(o.target===`openAi`&&console.warn(`Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.`),o.target===`openApi3`&&a.keyType?._def.typeName===i.ZodEnum)return{type:`object`,required:a.keyType._def.values,properties:a.keyType._def.values.reduce((t,n)=>({...t,[n]:r(a.valueType._def,{...o,currentPath:[...o.currentPath,`properties`,n]})??e(o)}),{}),additionalProperties:o.rejectedAdditionalProperties};let s={type:`object`,additionalProperties:r(a.valueType._def,{...o,currentPath:[...o.currentPath,`additionalProperties`]})??o.allowedAdditionalProperties};if(o.target===`openApi3`)return s;if(a.keyType?._def.typeName===i.ZodString&&a.keyType._def.checks?.length){let{type:e,...t}=n(a.keyType._def,o);return{...s,propertyNames:t}}else if(a.keyType?._def.typeName===i.ZodEnum)return{...s,propertyNames:{enum:a.keyType._def.values}};else if(a.keyType?._def.typeName===i.ZodBranded&&a.keyType._def.type._def.typeName===i.ZodString&&a.keyType._def.type._def.checks?.length){let{type:e,...n}=t(a.keyType._def,o);return{...s,propertyNames:n}}return s}export{a as parseRecordDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{setResponseValueAndErrors as e}from"../errorMessages.js";import{parseDef as t}from"../parseDef.js";function n(n,r){let i={type:`array`,uniqueItems:!0,items:t(n.valueType._def,{...r,currentPath:[...r.currentPath,`items`]})};return n.minSize&&e(i,`minItems`,n.minSize.value,n.minSize.message,r),n.maxSize&&e(i,`maxItems`,n.maxSize.value,n.maxSize.message,r),i}export{n as parseSetDef};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{setResponseValueAndErrors as e}from"../errorMessages.js";let t;const n={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(t===void 0&&(t=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`)),t),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function r(t,r){let a={type:`string`};if(t.checks)for(let o of t.checks)switch(o.kind){case`min`:e(a,`minLength`,typeof a.minLength==`number`?Math.max(a.minLength,o.value):o.value,o.message,r);break;case`max`:e(a,`maxLength`,typeof a.maxLength==`number`?Math.min(a.maxLength,o.value):o.value,o.message,r);break;case`email`:switch(r.emailStrategy){case`format:email`:s(a,`email`,o.message,r);break;case`format:idn-email`:s(a,`idn-email`,o.message,r);break;case`pattern:zod`:c(a,n.email,o.message,r);break}break;case`url`:s(a,`uri`,o.message,r);break;case`uuid`:s(a,`uuid`,o.message,r);break;case`regex`:c(a,o.regex,o.message,r);break;case`cuid`:c(a,n.cuid,o.message,r);break;case`cuid2`:c(a,n.cuid2,o.message,r);break;case`startsWith`:c(a,RegExp(`^${i(o.value,r)}`),o.message,r);break;case`endsWith`:c(a,RegExp(`${i(o.value,r)}$`),o.message,r);break;case`datetime`:s(a,`date-time`,o.message,r);break;case`date`:s(a,`date`,o.message,r);break;case`time`:s(a,`time`,o.message,r);break;case`duration`:s(a,`duration`,o.message,r);break;case`length`:e(a,`minLength`,typeof a.minLength==`number`?Math.max(a.minLength,o.value):o.value,o.message,r),e(a,`maxLength`,typeof a.maxLength==`number`?Math.min(a.maxLength,o.value):o.value,o.message,r);break;case`includes`:c(a,RegExp(i(o.value,r)),o.message,r);break;case`ip`:o.version!==`v6`&&s(a,`ipv4`,o.message,r),o.version!==`v4`&&s(a,`ipv6`,o.message,r);break;case`base64url`:c(a,n.base64url,o.message,r);break;case`jwt`:c(a,n.jwt,o.message,r);break;case`cidr`:o.version!==`v6`&&c(a,n.ipv4Cidr,o.message,r),o.version!==`v4`&&c(a,n.ipv6Cidr,o.message,r);break;case`emoji`:c(a,n.emoji(),o.message,r);break;case`ulid`:c(a,n.ulid,o.message,r);break;case`base64`:switch(r.base64Strategy){case`format:binary`:s(a,`binary`,o.message,r);break;case`contentEncoding:base64`:e(a,`contentEncoding`,`base64`,o.message,r);break;case`pattern:zod`:c(a,n.base64,o.message,r);break}break;case`nanoid`:c(a,n.nanoid,o.message,r);case`toLowerCase`:case`toUpperCase`:case`trim`:break;default:(e=>{})(o)}return a}function i(e,t){return t.patternStrategy===`escape`?o(e):e}const a=new Set(`ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789`);function o(e){let t=``;for(let n=0;n<e.length;n++)a.has(e[n])||(t+=`\\`),t+=e[n];return t}function s(t,n,r,i){t.format||t.anyOf?.some(e=>e.format)?(t.anyOf||=[],t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&i.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:n,...r&&i.errorMessages&&{errorMessage:{format:r}}})):e(t,`format`,n,r,i)}function c(t,n,r,i){t.pattern||t.allOf?.some(e=>e.pattern)?(t.allOf||=[],t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&i.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:l(n,i),...r&&i.errorMessages&&{errorMessage:{pattern:r}}})):e(t,`pattern`,l(n,i),r,i)}function l(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes(`i`),m:e.flags.includes(`m`),s:e.flags.includes(`s`)},r=n.i?e.source.toLowerCase():e.source,i=``,a=!1,o=!1,s=!1;for(let e=0;e<r.length;e++){if(a){i+=r[e],a=!1;continue}if(n.i){if(o){if(r[e].match(/[a-z]/)){s?(i+=r[e],i+=`${r[e-2]}-${r[e]}`.toUpperCase(),s=!1):r[e+1]===`-`&&r[e+2]?.match(/[a-z]/)?(i+=r[e],s=!0):i+=`${r[e]}${r[e].toUpperCase()}`;continue}}else if(r[e].match(/[a-z]/)){i+=`[${r[e]}${r[e].toUpperCase()}]`;continue}}if(n.m){if(r[e]===`^`){i+=`(^|(?<=[\r
|
|
2
|
-
]))`;continue}else if(r[e]===`$`){i+=`($|(?=[\r
|
|
3
|
-
]))`;continue}}if(n.s&&r[e]===`.`){i+=o?`${r[e]}\r\n`:`[${r[e]}\r\n]`;continue}i+=r[e],r[e]===`\\`?a=!0:o&&r[e]===`]`?o=!1:!o&&r[e]===`[`&&(o=!0)}try{new RegExp(i)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join(`/`)} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return i}export{r as parseStringDef,n as zodPatterns};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseDef as e}from"../parseDef.js";function t(t,n){return t.rest?{type:`array`,minItems:t.items.length,items:t.items.map((t,r)=>e(t._def,{...n,currentPath:[...n.currentPath,`items`,`${r}`]})).reduce((e,t)=>t===void 0?e:[...e,t],[]),additionalItems:e(t.rest._def,{...n,currentPath:[...n.currentPath,`additionalItems`]})}:{type:`array`,minItems:t.items.length,maxItems:t.items.length,items:t.items.map((t,r)=>e(t._def,{...n,currentPath:[...n.currentPath,`items`,`${r}`]})).reduce((e,t)=>t===void 0?e:[...e,t],[])}}export{t as parseTupleDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseAnyDef as e}from"./any.js";function t(t){return{not:e(t)}}export{t as parseUndefinedDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseDef as e}from"../parseDef.js";const t={ZodString:`string`,ZodNumber:`number`,ZodBigInt:`integer`,ZodBoolean:`boolean`,ZodNull:`null`};function n(e,n){if(n.target===`openApi3`)return r(e,n);let i=e.options instanceof Map?Array.from(e.options.values()):e.options;if(i.every(e=>e._def.typeName in t&&(!e._def.checks||!e._def.checks.length))){let e=i.reduce((e,n)=>{let r=t[n._def.typeName];return r&&!e.includes(r)?[...e,r]:e},[]);return{type:e.length>1?e:e[0]}}else if(i.every(e=>e._def.typeName===`ZodLiteral`&&!e.description)){let e=i.reduce((e,t)=>{let n=typeof t._def.value;switch(n){case`string`:case`number`:case`boolean`:return[...e,n];case`bigint`:return[...e,`integer`];case`object`:if(t._def.value===null)return[...e,`null`];case`symbol`:case`undefined`:case`function`:default:return e}},[]);if(e.length===i.length){let t=e.filter((e,t,n)=>n.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:i.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(i.every(e=>e._def.typeName===`ZodEnum`))return{type:`string`,enum:i.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return r(e,n)}const r=(t,n)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((t,r)=>e(t._def,{...n,currentPath:[...n.currentPath,`anyOf`,`${r}`]})).filter(e=>!!e&&(!n.strictUnions||typeof e==`object`&&Object.keys(e).length>0));return r.length?{anyOf:r}:void 0};export{n as parseUnionDef,t as primitiveMappings};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseAnyDef as e}from"./any.js";function t(t){return e(t)}export{t as parseUnknownDef};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseAnyDef as e}from"./parsers/any.js";import{parseArrayDef as t}from"./parsers/array.js";import{parseBigintDef as n}from"./parsers/bigint.js";import{parseBooleanDef as r}from"./parsers/boolean.js";import{parseBrandedDef as i}from"./parsers/branded.js";import{parseCatchDef as a}from"./parsers/catch.js";import{parseDateDef as o}from"./parsers/date.js";import{parseDefaultDef as s}from"./parsers/default.js";import{parseEffectsDef as c}from"./parsers/effects.js";import{parseEnumDef as l}from"./parsers/enum.js";import{parseIntersectionDef as u}from"./parsers/intersection.js";import{parseLiteralDef as d}from"./parsers/literal.js";import{parseStringDef as f}from"./parsers/string.js";import{parseRecordDef as p}from"./parsers/record.js";import{parseMapDef as m}from"./parsers/map.js";import{parseNativeEnumDef as h}from"./parsers/nativeEnum.js";import{parseNeverDef as g}from"./parsers/never.js";import{parseNullDef as _}from"./parsers/null.js";import{parseUnionDef as v}from"./parsers/union.js";import{parseNullableDef as y}from"./parsers/nullable.js";import{parseNumberDef as b}from"./parsers/number.js";import{parseObjectDef as x}from"./parsers/object.js";import{parseOptionalDef as S}from"./parsers/optional.js";import{parsePipelineDef as C}from"./parsers/pipeline.js";import{parsePromiseDef as w}from"./parsers/promise.js";import{parseSetDef as T}from"./parsers/set.js";import{parseTupleDef as E}from"./parsers/tuple.js";import{parseUndefinedDef as D}from"./parsers/undefined.js";import{parseUnknownDef as O}from"./parsers/unknown.js";import{parseReadonlyDef as k}from"./parsers/readonly.js";import{ZodFirstPartyTypeKind as A}from"zod/v3";const j=(j,M,N)=>{switch(M){case A.ZodString:return f(j,N);case A.ZodNumber:return b(j,N);case A.ZodObject:return x(j,N);case A.ZodBigInt:return n(j,N);case A.ZodBoolean:return r();case A.ZodDate:return o(j,N);case A.ZodUndefined:return D(N);case A.ZodNull:return _(N);case A.ZodArray:return t(j,N);case A.ZodUnion:case A.ZodDiscriminatedUnion:return v(j,N);case A.ZodIntersection:return u(j,N);case A.ZodTuple:return E(j,N);case A.ZodRecord:return p(j,N);case A.ZodLiteral:return d(j,N);case A.ZodEnum:return l(j);case A.ZodNativeEnum:return h(j);case A.ZodNullable:return y(j,N);case A.ZodOptional:return S(j,N);case A.ZodMap:return m(j,N);case A.ZodSet:return T(j,N);case A.ZodLazy:return()=>j.getter()._def;case A.ZodPromise:return w(j,N);case A.ZodNaN:case A.ZodNever:return g(N);case A.ZodEffects:return c(j,N);case A.ZodAny:return e(N);case A.ZodUnknown:return O(N);case A.ZodDefault:return s(j,N);case A.ZodBranded:return i(j,N);case A.ZodReadonly:return k(j,N);case A.ZodCatch:return a(j,N);case A.ZodPipeline:return C(j,N);case A.ZodFunction:case A.ZodVoid:case A.ZodSymbol:return;default:return(e=>void 0)(M)}};export{j as selectParser};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{getRefs as e}from"./Refs.js";import{parseAnyDef as t}from"./parsers/any.js";import{parseDef as n}from"./parseDef.js";const r=(r,i)=>{let a=e(i),o=typeof i==`object`&&i.definitions?Object.entries(i.definitions).reduce((e,[r,i])=>({...e,[r]:n(i._def,{...a,currentPath:[...a.basePath,a.definitionPath,r]},!0)??t(a)}),{}):void 0,s=typeof i==`string`?i:i?.nameStrategy===`title`?void 0:i?.name,c=n(r._def,s===void 0?a:{...a,currentPath:[...a.basePath,a.definitionPath,s]},!1)??t(a),l=typeof i==`object`&&i.name!==void 0&&i.nameStrategy===`title`?i.name:void 0;l!==void 0&&(c.title=l),a.flags.hasReferencedOpenAiAnyType&&(o||={},o[a.openAiAnyTypeName]||(o[a.openAiAnyTypeName]={type:[`string`,`number`,`integer`,`boolean`,`array`,`null`],items:{$ref:a.$refStrategy===`relative`?`1`:[...a.basePath,a.definitionPath,a.openAiAnyTypeName].join(`/`)}}));let u=s===void 0?o?{...c,[a.definitionPath]:o}:c:{$ref:[...a.$refStrategy===`relative`?[]:a.basePath,a.definitionPath,s].join(`/`),[a.definitionPath]:{...o,[s]:c}};return a.target===`jsonSchema7`?u.$schema=`http://json-schema.org/draft-07/schema#`:(a.target===`jsonSchema2019-09`||a.target===`openAi`)&&(u.$schema=`https://json-schema.org/draft/2019-09/schema#`),a.target===`openAi`&&(`anyOf`in u||`oneOf`in u||`allOf`in u||`type`in u&&Array.isArray(u.type))&&console.warn(`Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.`),u};export{r as zodToJsonSchema};
|