@angriff36/manifest 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +476 -0
- package/dist/manifest/agent-sdk/agent-runtime.d.ts +30 -0
- package/dist/manifest/agent-sdk/agent-runtime.d.ts.map +1 -0
- package/dist/manifest/agent-sdk/agent-runtime.js +232 -0
- package/dist/manifest/agent-sdk/agent-runtime.js.map +1 -0
- package/dist/manifest/agent-sdk/index.d.ts +17 -0
- package/dist/manifest/agent-sdk/index.d.ts.map +1 -0
- package/dist/manifest/agent-sdk/index.js +21 -0
- package/dist/manifest/agent-sdk/index.js.map +1 -0
- package/dist/manifest/agent-sdk/intent-mapper.d.ts +17 -0
- package/dist/manifest/agent-sdk/intent-mapper.d.ts.map +1 -0
- package/dist/manifest/agent-sdk/intent-mapper.js +115 -0
- package/dist/manifest/agent-sdk/intent-mapper.js.map +1 -0
- package/dist/manifest/agent-sdk/introspect.d.ts +42 -0
- package/dist/manifest/agent-sdk/introspect.d.ts.map +1 -0
- package/dist/manifest/agent-sdk/introspect.js +284 -0
- package/dist/manifest/agent-sdk/introspect.js.map +1 -0
- package/dist/manifest/agent-sdk/json-schema.d.ts +29 -0
- package/dist/manifest/agent-sdk/json-schema.d.ts.map +1 -0
- package/dist/manifest/agent-sdk/json-schema.js +132 -0
- package/dist/manifest/agent-sdk/json-schema.js.map +1 -0
- package/dist/manifest/agent-sdk/tool-definitions.d.ts +41 -0
- package/dist/manifest/agent-sdk/tool-definitions.d.ts.map +1 -0
- package/dist/manifest/agent-sdk/tool-definitions.js +288 -0
- package/dist/manifest/agent-sdk/tool-definitions.js.map +1 -0
- package/dist/manifest/agent-sdk/types.d.ts +293 -0
- package/dist/manifest/agent-sdk/types.d.ts.map +1 -0
- package/dist/manifest/agent-sdk/types.js +6 -0
- package/dist/manifest/agent-sdk/types.js.map +1 -0
- package/dist/manifest/api-diagnostics.d.ts +41 -0
- package/dist/manifest/api-diagnostics.d.ts.map +1 -0
- package/dist/manifest/api-diagnostics.js +105 -0
- package/dist/manifest/api-diagnostics.js.map +1 -0
- package/dist/manifest/approval/approval-store.d.ts +52 -0
- package/dist/manifest/approval/approval-store.d.ts.map +1 -0
- package/dist/manifest/approval/approval-store.js +25 -0
- package/dist/manifest/approval/approval-store.js.map +1 -0
- package/dist/manifest/approval/stores/memory.d.ts +33 -0
- package/dist/manifest/approval/stores/memory.d.ts.map +1 -0
- package/dist/manifest/approval/stores/memory.js +56 -0
- package/dist/manifest/approval/stores/memory.js.map +1 -0
- package/dist/manifest/approval/stores/postgres.d.ts +41 -0
- package/dist/manifest/approval/stores/postgres.d.ts.map +1 -0
- package/dist/manifest/approval/stores/postgres.js +124 -0
- package/dist/manifest/approval/stores/postgres.js.map +1 -0
- package/dist/manifest/audit/audit-sink.d.ts +53 -0
- package/dist/manifest/audit/audit-sink.d.ts.map +1 -0
- package/dist/manifest/audit/audit-sink.js +15 -0
- package/dist/manifest/audit/audit-sink.js.map +1 -0
- package/dist/manifest/audit/sinks/memory.d.ts +50 -0
- package/dist/manifest/audit/sinks/memory.d.ts.map +1 -0
- package/dist/manifest/audit/sinks/memory.js +66 -0
- package/dist/manifest/audit/sinks/memory.js.map +1 -0
- package/dist/manifest/audit/sinks/postgres.d.ts +31 -0
- package/dist/manifest/audit/sinks/postgres.d.ts.map +1 -0
- package/dist/manifest/audit/sinks/postgres.js +67 -0
- package/dist/manifest/audit/sinks/postgres.js.map +1 -0
- package/dist/manifest/binary-ir.d.ts +76 -0
- package/dist/manifest/binary-ir.d.ts.map +1 -0
- package/dist/manifest/binary-ir.js +124 -0
- package/dist/manifest/binary-ir.js.map +1 -0
- package/dist/manifest/breaking-change.d.ts +75 -0
- package/dist/manifest/breaking-change.d.ts.map +1 -0
- package/dist/manifest/breaking-change.js +704 -0
- package/dist/manifest/breaking-change.js.map +1 -0
- package/dist/manifest/compiler.d.ts +12 -0
- package/dist/manifest/compiler.d.ts.map +1 -0
- package/dist/manifest/compiler.js +23 -0
- package/dist/manifest/compiler.js.map +1 -0
- package/dist/manifest/config.d.ts +171 -0
- package/dist/manifest/config.d.ts.map +1 -0
- package/dist/manifest/config.js +65 -0
- package/dist/manifest/config.js.map +1 -0
- package/dist/manifest/constraint-analysis.d.ts +122 -0
- package/dist/manifest/constraint-analysis.d.ts.map +1 -0
- package/dist/manifest/constraint-analysis.js +340 -0
- package/dist/manifest/constraint-analysis.js.map +1 -0
- package/dist/manifest/date-time.d.ts +13 -0
- package/dist/manifest/date-time.d.ts.map +1 -0
- package/dist/manifest/date-time.js +60 -0
- package/dist/manifest/date-time.js.map +1 -0
- package/dist/manifest/debug/command-trace.d.ts +37 -0
- package/dist/manifest/debug/command-trace.d.ts.map +1 -0
- package/dist/manifest/debug/command-trace.js +51 -0
- package/dist/manifest/debug/command-trace.js.map +1 -0
- package/dist/manifest/debug/index.d.ts +3 -0
- package/dist/manifest/debug/index.d.ts.map +1 -0
- package/dist/manifest/debug/index.js +2 -0
- package/dist/manifest/debug/index.js.map +1 -0
- package/dist/manifest/domain-completeness.d.ts +13 -0
- package/dist/manifest/domain-completeness.d.ts.map +1 -0
- package/dist/manifest/domain-completeness.js +245 -0
- package/dist/manifest/domain-completeness.js.map +1 -0
- package/dist/manifest/entity-composition.d.ts +24 -0
- package/dist/manifest/entity-composition.d.ts.map +1 -0
- package/dist/manifest/entity-composition.js +157 -0
- package/dist/manifest/entity-composition.js.map +1 -0
- package/dist/manifest/examples.d.ts +6 -0
- package/dist/manifest/examples.d.ts.map +1 -0
- package/dist/manifest/examples.js +443 -0
- package/dist/manifest/examples.js.map +1 -0
- package/dist/manifest/federation/client.d.ts +52 -0
- package/dist/manifest/federation/client.d.ts.map +1 -0
- package/dist/manifest/federation/client.js +152 -0
- package/dist/manifest/federation/client.js.map +1 -0
- package/dist/manifest/federation/descriptor.d.ts +25 -0
- package/dist/manifest/federation/descriptor.d.ts.map +1 -0
- package/dist/manifest/federation/descriptor.js +97 -0
- package/dist/manifest/federation/descriptor.js.map +1 -0
- package/dist/manifest/federation/http-adapter.d.ts +26 -0
- package/dist/manifest/federation/http-adapter.d.ts.map +1 -0
- package/dist/manifest/federation/http-adapter.js +209 -0
- package/dist/manifest/federation/http-adapter.js.map +1 -0
- package/dist/manifest/federation/index.d.ts +51 -0
- package/dist/manifest/federation/index.d.ts.map +1 -0
- package/dist/manifest/federation/index.js +49 -0
- package/dist/manifest/federation/index.js.map +1 -0
- package/dist/manifest/federation/policy-bridge.d.ts +51 -0
- package/dist/manifest/federation/policy-bridge.d.ts.map +1 -0
- package/dist/manifest/federation/policy-bridge.js +122 -0
- package/dist/manifest/federation/policy-bridge.js.map +1 -0
- package/dist/manifest/federation/registry.d.ts +88 -0
- package/dist/manifest/federation/registry.d.ts.map +1 -0
- package/dist/manifest/federation/registry.js +165 -0
- package/dist/manifest/federation/registry.js.map +1 -0
- package/dist/manifest/federation/types.d.ts +209 -0
- package/dist/manifest/federation/types.d.ts.map +1 -0
- package/dist/manifest/federation/types.js +13 -0
- package/dist/manifest/federation/types.js.map +1 -0
- package/dist/manifest/generator.d.ts +44 -0
- package/dist/manifest/generator.d.ts.map +1 -0
- package/dist/manifest/generator.js +899 -0
- package/dist/manifest/generator.js.map +1 -0
- package/dist/manifest/ir-cache.d.ts +48 -0
- package/dist/manifest/ir-cache.d.ts.map +1 -0
- package/dist/manifest/ir-cache.js +91 -0
- package/dist/manifest/ir-cache.js.map +1 -0
- package/dist/manifest/ir-compiler.d.ts +135 -0
- package/dist/manifest/ir-compiler.d.ts.map +1 -0
- package/dist/manifest/ir-compiler.js +1477 -0
- package/dist/manifest/ir-compiler.js.map +1 -0
- package/dist/manifest/ir-diff.d.ts +266 -0
- package/dist/manifest/ir-diff.d.ts.map +1 -0
- package/dist/manifest/ir-diff.js +731 -0
- package/dist/manifest/ir-diff.js.map +1 -0
- package/dist/manifest/ir-version-store.d.ts +109 -0
- package/dist/manifest/ir-version-store.d.ts.map +1 -0
- package/dist/manifest/ir-version-store.js +162 -0
- package/dist/manifest/ir-version-store.js.map +1 -0
- package/dist/manifest/ir.d.ts +616 -0
- package/dist/manifest/ir.d.ts.map +1 -0
- package/dist/manifest/ir.js +2 -0
- package/dist/manifest/ir.js.map +1 -0
- package/dist/manifest/lexer.d.ts +37 -0
- package/dist/manifest/lexer.d.ts.map +1 -0
- package/dist/manifest/lexer.js +224 -0
- package/dist/manifest/lexer.js.map +1 -0
- package/dist/manifest/masking.d.ts +11 -0
- package/dist/manifest/masking.d.ts.map +1 -0
- package/dist/manifest/masking.js +34 -0
- package/dist/manifest/masking.js.map +1 -0
- package/dist/manifest/module-resolver.d.ts +42 -0
- package/dist/manifest/module-resolver.d.ts.map +1 -0
- package/dist/manifest/module-resolver.js +162 -0
- package/dist/manifest/module-resolver.js.map +1 -0
- package/dist/manifest/multi-compiler.d.ts +40 -0
- package/dist/manifest/multi-compiler.d.ts.map +1 -0
- package/dist/manifest/multi-compiler.js +324 -0
- package/dist/manifest/multi-compiler.js.map +1 -0
- package/dist/manifest/outbox/outbox-store.d.ts +56 -0
- package/dist/manifest/outbox/outbox-store.d.ts.map +1 -0
- package/dist/manifest/outbox/outbox-store.js +13 -0
- package/dist/manifest/outbox/outbox-store.js.map +1 -0
- package/dist/manifest/outbox/stores/dynamodb.d.ts +100 -0
- package/dist/manifest/outbox/stores/dynamodb.d.ts.map +1 -0
- package/dist/manifest/outbox/stores/dynamodb.js +239 -0
- package/dist/manifest/outbox/stores/dynamodb.js.map +1 -0
- package/dist/manifest/outbox/stores/memory.d.ts +54 -0
- package/dist/manifest/outbox/stores/memory.d.ts.map +1 -0
- package/dist/manifest/outbox/stores/memory.js +131 -0
- package/dist/manifest/outbox/stores/memory.js.map +1 -0
- package/dist/manifest/outbox/stores/mongodb.d.ts +58 -0
- package/dist/manifest/outbox/stores/mongodb.d.ts.map +1 -0
- package/dist/manifest/outbox/stores/mongodb.js +151 -0
- package/dist/manifest/outbox/stores/mongodb.js.map +1 -0
- package/dist/manifest/outbox/stores/postgres.d.ts +81 -0
- package/dist/manifest/outbox/stores/postgres.d.ts.map +1 -0
- package/dist/manifest/outbox/stores/postgres.js +182 -0
- package/dist/manifest/outbox/stores/postgres.js.map +1 -0
- package/dist/manifest/outbox/stores/redis.d.ts +95 -0
- package/dist/manifest/outbox/stores/redis.d.ts.map +1 -0
- package/dist/manifest/outbox/stores/redis.js +248 -0
- package/dist/manifest/outbox/stores/redis.js.map +1 -0
- package/dist/manifest/parser.d.ts +148 -0
- package/dist/manifest/parser.d.ts.map +1 -0
- package/dist/manifest/parser.js +2243 -0
- package/dist/manifest/parser.js.map +1 -0
- package/dist/manifest/plugin-api.d.ts +202 -0
- package/dist/manifest/plugin-api.d.ts.map +1 -0
- package/dist/manifest/plugin-api.js +101 -0
- package/dist/manifest/plugin-api.js.map +1 -0
- package/dist/manifest/plugin-loader.d.ts +101 -0
- package/dist/manifest/plugin-loader.d.ts.map +1 -0
- package/dist/manifest/plugin-loader.js +332 -0
- package/dist/manifest/plugin-loader.js.map +1 -0
- package/dist/manifest/profiling.d.ts +183 -0
- package/dist/manifest/profiling.d.ts.map +1 -0
- package/dist/manifest/profiling.js +186 -0
- package/dist/manifest/profiling.js.map +1 -0
- package/dist/manifest/projections/analytics/generator.d.ts +27 -0
- package/dist/manifest/projections/analytics/generator.d.ts.map +1 -0
- package/dist/manifest/projections/analytics/generator.js +686 -0
- package/dist/manifest/projections/analytics/generator.js.map +1 -0
- package/dist/manifest/projections/analytics/types.d.ts +46 -0
- package/dist/manifest/projections/analytics/types.d.ts.map +1 -0
- package/dist/manifest/projections/analytics/types.js +8 -0
- package/dist/manifest/projections/analytics/types.js.map +1 -0
- package/dist/manifest/projections/builtins.d.ts +29 -0
- package/dist/manifest/projections/builtins.d.ts.map +1 -0
- package/dist/manifest/projections/builtins.js +143 -0
- package/dist/manifest/projections/builtins.js.map +1 -0
- package/dist/manifest/projections/convex/expression.d.ts +52 -0
- package/dist/manifest/projections/convex/expression.d.ts.map +1 -0
- package/dist/manifest/projections/convex/expression.js +166 -0
- package/dist/manifest/projections/convex/expression.js.map +1 -0
- package/dist/manifest/projections/convex/functions.d.ts +22 -0
- package/dist/manifest/projections/convex/functions.d.ts.map +1 -0
- package/dist/manifest/projections/convex/functions.js +786 -0
- package/dist/manifest/projections/convex/functions.js.map +1 -0
- package/dist/manifest/projections/convex/generator.d.ts +79 -0
- package/dist/manifest/projections/convex/generator.d.ts.map +1 -0
- package/dist/manifest/projections/convex/generator.js +406 -0
- package/dist/manifest/projections/convex/generator.js.map +1 -0
- package/dist/manifest/projections/convex/index.d.ts +10 -0
- package/dist/manifest/projections/convex/index.d.ts.map +1 -0
- package/dist/manifest/projections/convex/index.js +10 -0
- package/dist/manifest/projections/convex/index.js.map +1 -0
- package/dist/manifest/projections/convex/options.d.ts +153 -0
- package/dist/manifest/projections/convex/options.d.ts.map +1 -0
- package/dist/manifest/projections/convex/options.js +60 -0
- package/dist/manifest/projections/convex/options.js.map +1 -0
- package/dist/manifest/projections/convex/orchestration.d.ts +23 -0
- package/dist/manifest/projections/convex/orchestration.d.ts.map +1 -0
- package/dist/manifest/projections/convex/orchestration.js +150 -0
- package/dist/manifest/projections/convex/orchestration.js.map +1 -0
- package/dist/manifest/projections/convex/type-mapping.d.ts +40 -0
- package/dist/manifest/projections/convex/type-mapping.d.ts.map +1 -0
- package/dist/manifest/projections/convex/type-mapping.js +71 -0
- package/dist/manifest/projections/convex/type-mapping.js.map +1 -0
- package/dist/manifest/projections/dart/generator.d.ts +33 -0
- package/dist/manifest/projections/dart/generator.d.ts.map +1 -0
- package/dist/manifest/projections/dart/generator.js +981 -0
- package/dist/manifest/projections/dart/generator.js.map +1 -0
- package/dist/manifest/projections/dart/types.d.ts +29 -0
- package/dist/manifest/projections/dart/types.d.ts.map +1 -0
- package/dist/manifest/projections/dart/types.js +5 -0
- package/dist/manifest/projections/dart/types.js.map +1 -0
- package/dist/manifest/projections/drizzle/generator.d.ts +27 -0
- package/dist/manifest/projections/drizzle/generator.d.ts.map +1 -0
- package/dist/manifest/projections/drizzle/generator.js +654 -0
- package/dist/manifest/projections/drizzle/generator.js.map +1 -0
- package/dist/manifest/projections/drizzle/index.d.ts +12 -0
- package/dist/manifest/projections/drizzle/index.d.ts.map +1 -0
- package/dist/manifest/projections/drizzle/index.js +12 -0
- package/dist/manifest/projections/drizzle/index.js.map +1 -0
- package/dist/manifest/projections/drizzle/options.d.ts +94 -0
- package/dist/manifest/projections/drizzle/options.d.ts.map +1 -0
- package/dist/manifest/projections/drizzle/options.js +31 -0
- package/dist/manifest/projections/drizzle/options.js.map +1 -0
- package/dist/manifest/projections/drizzle/type-mapping.d.ts +74 -0
- package/dist/manifest/projections/drizzle/type-mapping.d.ts.map +1 -0
- package/dist/manifest/projections/drizzle/type-mapping.js +101 -0
- package/dist/manifest/projections/drizzle/type-mapping.js.map +1 -0
- package/dist/manifest/projections/dynamodb/generator.d.ts +48 -0
- package/dist/manifest/projections/dynamodb/generator.d.ts.map +1 -0
- package/dist/manifest/projections/dynamodb/generator.js +341 -0
- package/dist/manifest/projections/dynamodb/generator.js.map +1 -0
- package/dist/manifest/projections/elasticsearch/generator.d.ts +44 -0
- package/dist/manifest/projections/elasticsearch/generator.d.ts.map +1 -0
- package/dist/manifest/projections/elasticsearch/generator.js +613 -0
- package/dist/manifest/projections/elasticsearch/generator.js.map +1 -0
- package/dist/manifest/projections/elasticsearch/options.d.ts +56 -0
- package/dist/manifest/projections/elasticsearch/options.d.ts.map +1 -0
- package/dist/manifest/projections/elasticsearch/options.js +37 -0
- package/dist/manifest/projections/elasticsearch/options.js.map +1 -0
- package/dist/manifest/projections/elasticsearch/type-mapping.d.ts +30 -0
- package/dist/manifest/projections/elasticsearch/type-mapping.d.ts.map +1 -0
- package/dist/manifest/projections/elasticsearch/type-mapping.js +34 -0
- package/dist/manifest/projections/elasticsearch/type-mapping.js.map +1 -0
- package/dist/manifest/projections/elasticsearch/types.d.ts +81 -0
- package/dist/manifest/projections/elasticsearch/types.d.ts.map +1 -0
- package/dist/manifest/projections/elasticsearch/types.js +10 -0
- package/dist/manifest/projections/elasticsearch/types.js.map +1 -0
- package/dist/manifest/projections/express/generator.d.ts +38 -0
- package/dist/manifest/projections/express/generator.d.ts.map +1 -0
- package/dist/manifest/projections/express/generator.js +620 -0
- package/dist/manifest/projections/express/generator.js.map +1 -0
- package/dist/manifest/projections/express/index.d.ts +8 -0
- package/dist/manifest/projections/express/index.d.ts.map +1 -0
- package/dist/manifest/projections/express/index.js +7 -0
- package/dist/manifest/projections/express/index.js.map +1 -0
- package/dist/manifest/projections/express/types.d.ts +92 -0
- package/dist/manifest/projections/express/types.d.ts.map +1 -0
- package/dist/manifest/projections/express/types.js +9 -0
- package/dist/manifest/projections/express/types.js.map +1 -0
- package/dist/manifest/projections/graphql/generator.d.ts +43 -0
- package/dist/manifest/projections/graphql/generator.d.ts.map +1 -0
- package/dist/manifest/projections/graphql/generator.js +662 -0
- package/dist/manifest/projections/graphql/generator.js.map +1 -0
- package/dist/manifest/projections/graphql/index.d.ts +11 -0
- package/dist/manifest/projections/graphql/index.d.ts.map +1 -0
- package/dist/manifest/projections/graphql/index.js +10 -0
- package/dist/manifest/projections/graphql/index.js.map +1 -0
- package/dist/manifest/projections/graphql/types.d.ts +69 -0
- package/dist/manifest/projections/graphql/types.d.ts.map +1 -0
- package/dist/manifest/projections/graphql/types.js +9 -0
- package/dist/manifest/projections/graphql/types.js.map +1 -0
- package/dist/manifest/projections/health/generator.d.ts +36 -0
- package/dist/manifest/projections/health/generator.d.ts.map +1 -0
- package/dist/manifest/projections/health/generator.js +355 -0
- package/dist/manifest/projections/health/generator.js.map +1 -0
- package/dist/manifest/projections/health/types.d.ts +67 -0
- package/dist/manifest/projections/health/types.d.ts.map +1 -0
- package/dist/manifest/projections/health/types.js +28 -0
- package/dist/manifest/projections/health/types.js.map +1 -0
- package/dist/manifest/projections/hono/generator.d.ts +36 -0
- package/dist/manifest/projections/hono/generator.d.ts.map +1 -0
- package/dist/manifest/projections/hono/generator.js +578 -0
- package/dist/manifest/projections/hono/generator.js.map +1 -0
- package/dist/manifest/projections/hono/types.d.ts +86 -0
- package/dist/manifest/projections/hono/types.d.ts.map +1 -0
- package/dist/manifest/projections/hono/types.js +10 -0
- package/dist/manifest/projections/hono/types.js.map +1 -0
- package/dist/manifest/projections/index.d.ts +58 -0
- package/dist/manifest/projections/index.d.ts.map +1 -0
- package/dist/manifest/projections/index.js +41 -0
- package/dist/manifest/projections/index.js.map +1 -0
- package/dist/manifest/projections/interface.d.ts +285 -0
- package/dist/manifest/projections/interface.d.ts.map +1 -0
- package/dist/manifest/projections/interface.js +8 -0
- package/dist/manifest/projections/interface.js.map +1 -0
- package/dist/manifest/projections/jsonschema/generator.d.ts +35 -0
- package/dist/manifest/projections/jsonschema/generator.d.ts.map +1 -0
- package/dist/manifest/projections/jsonschema/generator.js +347 -0
- package/dist/manifest/projections/jsonschema/generator.js.map +1 -0
- package/dist/manifest/projections/jsonschema/index.d.ts +3 -0
- package/dist/manifest/projections/jsonschema/index.d.ts.map +1 -0
- package/dist/manifest/projections/jsonschema/index.js +2 -0
- package/dist/manifest/projections/jsonschema/index.js.map +1 -0
- package/dist/manifest/projections/jsonschema/types.d.ts +31 -0
- package/dist/manifest/projections/jsonschema/types.d.ts.map +1 -0
- package/dist/manifest/projections/jsonschema/types.js +2 -0
- package/dist/manifest/projections/jsonschema/types.js.map +1 -0
- package/dist/manifest/projections/kysely/generator.d.ts +36 -0
- package/dist/manifest/projections/kysely/generator.d.ts.map +1 -0
- package/dist/manifest/projections/kysely/generator.js +325 -0
- package/dist/manifest/projections/kysely/generator.js.map +1 -0
- package/dist/manifest/projections/kysely/index.d.ts +4 -0
- package/dist/manifest/projections/kysely/index.d.ts.map +1 -0
- package/dist/manifest/projections/kysely/index.js +2 -0
- package/dist/manifest/projections/kysely/index.js.map +1 -0
- package/dist/manifest/projections/kysely/options.d.ts +61 -0
- package/dist/manifest/projections/kysely/options.d.ts.map +1 -0
- package/dist/manifest/projections/kysely/options.js +31 -0
- package/dist/manifest/projections/kysely/options.js.map +1 -0
- package/dist/manifest/projections/kysely/type-mapping.d.ts +61 -0
- package/dist/manifest/projections/kysely/type-mapping.d.ts.map +1 -0
- package/dist/manifest/projections/kysely/type-mapping.js +84 -0
- package/dist/manifest/projections/kysely/type-mapping.js.map +1 -0
- package/dist/manifest/projections/llm-context/generator.d.ts +24 -0
- package/dist/manifest/projections/llm-context/generator.d.ts.map +1 -0
- package/dist/manifest/projections/llm-context/generator.js +371 -0
- package/dist/manifest/projections/llm-context/generator.js.map +1 -0
- package/dist/manifest/projections/llm-context/types.d.ts +205 -0
- package/dist/manifest/projections/llm-context/types.d.ts.map +1 -0
- package/dist/manifest/projections/llm-context/types.js +9 -0
- package/dist/manifest/projections/llm-context/types.js.map +1 -0
- package/dist/manifest/projections/materialized-views/expression-to-sql.d.ts +29 -0
- package/dist/manifest/projections/materialized-views/expression-to-sql.d.ts.map +1 -0
- package/dist/manifest/projections/materialized-views/expression-to-sql.js +211 -0
- package/dist/manifest/projections/materialized-views/expression-to-sql.js.map +1 -0
- package/dist/manifest/projections/materialized-views/generator.d.ts +29 -0
- package/dist/manifest/projections/materialized-views/generator.d.ts.map +1 -0
- package/dist/manifest/projections/materialized-views/generator.js +263 -0
- package/dist/manifest/projections/materialized-views/generator.js.map +1 -0
- package/dist/manifest/projections/materialized-views/options.d.ts +59 -0
- package/dist/manifest/projections/materialized-views/options.d.ts.map +1 -0
- package/dist/manifest/projections/materialized-views/options.js +34 -0
- package/dist/manifest/projections/materialized-views/options.js.map +1 -0
- package/dist/manifest/projections/materialized-views/types.d.ts +100 -0
- package/dist/manifest/projections/materialized-views/types.d.ts.map +1 -0
- package/dist/manifest/projections/materialized-views/types.js +11 -0
- package/dist/manifest/projections/materialized-views/types.js.map +1 -0
- package/dist/manifest/projections/mermaid/generator.d.ts +46 -0
- package/dist/manifest/projections/mermaid/generator.d.ts.map +1 -0
- package/dist/manifest/projections/mermaid/generator.js +436 -0
- package/dist/manifest/projections/mermaid/generator.js.map +1 -0
- package/dist/manifest/projections/mongoose/options.d.ts +30 -0
- package/dist/manifest/projections/mongoose/options.d.ts.map +1 -0
- package/dist/manifest/projections/mongoose/options.js +18 -0
- package/dist/manifest/projections/mongoose/options.js.map +1 -0
- package/dist/manifest/projections/mongoose/type-mapping.d.ts +42 -0
- package/dist/manifest/projections/mongoose/type-mapping.d.ts.map +1 -0
- package/dist/manifest/projections/mongoose/type-mapping.js +64 -0
- package/dist/manifest/projections/mongoose/type-mapping.js.map +1 -0
- package/dist/manifest/projections/nextjs/defaults.d.ts +161 -0
- package/dist/manifest/projections/nextjs/defaults.d.ts.map +1 -0
- package/dist/manifest/projections/nextjs/defaults.js +157 -0
- package/dist/manifest/projections/nextjs/defaults.js.map +1 -0
- package/dist/manifest/projections/nextjs/generator.d.ts +78 -0
- package/dist/manifest/projections/nextjs/generator.d.ts.map +1 -0
- package/dist/manifest/projections/nextjs/generator.js +1339 -0
- package/dist/manifest/projections/nextjs/generator.js.map +1 -0
- package/dist/manifest/projections/nextjs/schedule-generator.d.ts +10 -0
- package/dist/manifest/projections/nextjs/schedule-generator.d.ts.map +1 -0
- package/dist/manifest/projections/nextjs/schedule-generator.js +54 -0
- package/dist/manifest/projections/nextjs/schedule-generator.js.map +1 -0
- package/dist/manifest/projections/openapi/generator.d.ts +37 -0
- package/dist/manifest/projections/openapi/generator.d.ts.map +1 -0
- package/dist/manifest/projections/openapi/generator.js +690 -0
- package/dist/manifest/projections/openapi/generator.js.map +1 -0
- package/dist/manifest/projections/openapi/index.d.ts +11 -0
- package/dist/manifest/projections/openapi/index.d.ts.map +1 -0
- package/dist/manifest/projections/openapi/index.js +10 -0
- package/dist/manifest/projections/openapi/index.js.map +1 -0
- package/dist/manifest/projections/openapi/types.d.ts +75 -0
- package/dist/manifest/projections/openapi/types.d.ts.map +1 -0
- package/dist/manifest/projections/openapi/types.js +9 -0
- package/dist/manifest/projections/openapi/types.js.map +1 -0
- package/dist/manifest/projections/prisma/generator.d.ts +32 -0
- package/dist/manifest/projections/prisma/generator.d.ts.map +1 -0
- package/dist/manifest/projections/prisma/generator.js +861 -0
- package/dist/manifest/projections/prisma/generator.js.map +1 -0
- package/dist/manifest/projections/prisma/index.d.ts +12 -0
- package/dist/manifest/projections/prisma/index.d.ts.map +1 -0
- package/dist/manifest/projections/prisma/index.js +12 -0
- package/dist/manifest/projections/prisma/index.js.map +1 -0
- package/dist/manifest/projections/prisma/options.d.ts +243 -0
- package/dist/manifest/projections/prisma/options.d.ts.map +1 -0
- package/dist/manifest/projections/prisma/options.js +59 -0
- package/dist/manifest/projections/prisma/options.js.map +1 -0
- package/dist/manifest/projections/prisma/type-mapping.d.ts +60 -0
- package/dist/manifest/projections/prisma/type-mapping.d.ts.map +1 -0
- package/dist/manifest/projections/prisma/type-mapping.js +95 -0
- package/dist/manifest/projections/prisma/type-mapping.js.map +1 -0
- package/dist/manifest/projections/prisma-store/generator.d.ts +12 -0
- package/dist/manifest/projections/prisma-store/generator.d.ts.map +1 -0
- package/dist/manifest/projections/prisma-store/generator.js +52 -0
- package/dist/manifest/projections/prisma-store/generator.js.map +1 -0
- package/dist/manifest/projections/prisma-store/metadata-builder.d.ts +11 -0
- package/dist/manifest/projections/prisma-store/metadata-builder.d.ts.map +1 -0
- package/dist/manifest/projections/prisma-store/metadata-builder.js +183 -0
- package/dist/manifest/projections/prisma-store/metadata-builder.js.map +1 -0
- package/dist/manifest/projections/prisma-store/options.d.ts +31 -0
- package/dist/manifest/projections/prisma-store/options.d.ts.map +1 -0
- package/dist/manifest/projections/prisma-store/options.js +21 -0
- package/dist/manifest/projections/prisma-store/options.js.map +1 -0
- package/dist/manifest/projections/prisma-store/persistence.d.ts +4 -0
- package/dist/manifest/projections/prisma-store/persistence.d.ts.map +1 -0
- package/dist/manifest/projections/prisma-store/persistence.js +24 -0
- package/dist/manifest/projections/prisma-store/persistence.js.map +1 -0
- package/dist/manifest/projections/pydantic/generator.d.ts +27 -0
- package/dist/manifest/projections/pydantic/generator.d.ts.map +1 -0
- package/dist/manifest/projections/pydantic/generator.js +798 -0
- package/dist/manifest/projections/pydantic/generator.js.map +1 -0
- package/dist/manifest/projections/pydantic/types.d.ts +32 -0
- package/dist/manifest/projections/pydantic/types.d.ts.map +1 -0
- package/dist/manifest/projections/pydantic/types.js +5 -0
- package/dist/manifest/projections/pydantic/types.js.map +1 -0
- package/dist/manifest/projections/react-query/generator.d.ts +87 -0
- package/dist/manifest/projections/react-query/generator.d.ts.map +1 -0
- package/dist/manifest/projections/react-query/generator.js +413 -0
- package/dist/manifest/projections/react-query/generator.js.map +1 -0
- package/dist/manifest/projections/registry.d.ts +59 -0
- package/dist/manifest/projections/registry.d.ts.map +1 -0
- package/dist/manifest/projections/registry.js +110 -0
- package/dist/manifest/projections/registry.js.map +1 -0
- package/dist/manifest/projections/remix/generator.d.ts +58 -0
- package/dist/manifest/projections/remix/generator.d.ts.map +1 -0
- package/dist/manifest/projections/remix/generator.js +788 -0
- package/dist/manifest/projections/remix/generator.js.map +1 -0
- package/dist/manifest/projections/routes/generator.d.ts +32 -0
- package/dist/manifest/projections/routes/generator.d.ts.map +1 -0
- package/dist/manifest/projections/routes/generator.js +401 -0
- package/dist/manifest/projections/routes/generator.js.map +1 -0
- package/dist/manifest/projections/routes/types.d.ts +104 -0
- package/dist/manifest/projections/routes/types.d.ts.map +1 -0
- package/dist/manifest/projections/routes/types.js +11 -0
- package/dist/manifest/projections/routes/types.js.map +1 -0
- package/dist/manifest/projections/shared/naming.d.ts +64 -0
- package/dist/manifest/projections/shared/naming.d.ts.map +1 -0
- package/dist/manifest/projections/shared/naming.js +138 -0
- package/dist/manifest/projections/shared/naming.js.map +1 -0
- package/dist/manifest/projections/storybook/generator.d.ts +38 -0
- package/dist/manifest/projections/storybook/generator.d.ts.map +1 -0
- package/dist/manifest/projections/storybook/generator.js +462 -0
- package/dist/manifest/projections/storybook/generator.js.map +1 -0
- package/dist/manifest/projections/sveltekit/generator.d.ts +64 -0
- package/dist/manifest/projections/sveltekit/generator.d.ts.map +1 -0
- package/dist/manifest/projections/sveltekit/generator.js +1043 -0
- package/dist/manifest/projections/sveltekit/generator.js.map +1 -0
- package/dist/manifest/projections/sveltekit/index.d.ts +11 -0
- package/dist/manifest/projections/sveltekit/index.d.ts.map +1 -0
- package/dist/manifest/projections/sveltekit/index.js +10 -0
- package/dist/manifest/projections/sveltekit/index.js.map +1 -0
- package/dist/manifest/projections/sveltekit/types.d.ts +122 -0
- package/dist/manifest/projections/sveltekit/types.d.ts.map +1 -0
- package/dist/manifest/projections/sveltekit/types.js +10 -0
- package/dist/manifest/projections/sveltekit/types.js.map +1 -0
- package/dist/manifest/projections/terraform/generator.d.ts +29 -0
- package/dist/manifest/projections/terraform/generator.d.ts.map +1 -0
- package/dist/manifest/projections/terraform/generator.js +722 -0
- package/dist/manifest/projections/terraform/generator.js.map +1 -0
- package/dist/manifest/projections/terraform/index.d.ts +7 -0
- package/dist/manifest/projections/terraform/index.d.ts.map +1 -0
- package/dist/manifest/projections/terraform/index.js +7 -0
- package/dist/manifest/projections/terraform/index.js.map +1 -0
- package/dist/manifest/projections/terraform/options.d.ts +92 -0
- package/dist/manifest/projections/terraform/options.d.ts.map +1 -0
- package/dist/manifest/projections/terraform/options.js +37 -0
- package/dist/manifest/projections/terraform/options.js.map +1 -0
- package/dist/manifest/projections/terraform/types.d.ts +55 -0
- package/dist/manifest/projections/terraform/types.d.ts.map +1 -0
- package/dist/manifest/projections/terraform/types.js +38 -0
- package/dist/manifest/projections/terraform/types.js.map +1 -0
- package/dist/manifest/projections/zod/generator.d.ts +27 -0
- package/dist/manifest/projections/zod/generator.d.ts.map +1 -0
- package/dist/manifest/projections/zod/generator.js +367 -0
- package/dist/manifest/projections/zod/generator.js.map +1 -0
- package/dist/manifest/projections/zod/index.d.ts +8 -0
- package/dist/manifest/projections/zod/index.d.ts.map +1 -0
- package/dist/manifest/projections/zod/index.js +7 -0
- package/dist/manifest/projections/zod/index.js.map +1 -0
- package/dist/manifest/projections/zod/types.d.ts +14 -0
- package/dist/manifest/projections/zod/types.d.ts.map +1 -0
- package/dist/manifest/projections/zod/types.js +5 -0
- package/dist/manifest/projections/zod/types.js.map +1 -0
- package/dist/manifest/reaction-completeness-checks.d.ts +11 -0
- package/dist/manifest/reaction-completeness-checks.d.ts.map +1 -0
- package/dist/manifest/reaction-completeness-checks.js +106 -0
- package/dist/manifest/reaction-completeness-checks.js.map +1 -0
- package/dist/manifest/reaction-completeness.d.ts +9 -0
- package/dist/manifest/reaction-completeness.d.ts.map +1 -0
- package/dist/manifest/reaction-completeness.js +35 -0
- package/dist/manifest/reaction-completeness.js.map +1 -0
- package/dist/manifest/registry/emit.d.ts +53 -0
- package/dist/manifest/registry/emit.d.ts.map +1 -0
- package/dist/manifest/registry/emit.js +96 -0
- package/dist/manifest/registry/emit.js.map +1 -0
- package/dist/manifest/runtime-command-extensions.d.ts +21 -0
- package/dist/manifest/runtime-command-extensions.d.ts.map +1 -0
- package/dist/manifest/runtime-command-extensions.js +136 -0
- package/dist/manifest/runtime-command-extensions.js.map +1 -0
- package/dist/manifest/runtime-engine.d.ts +1019 -0
- package/dist/manifest/runtime-engine.d.ts.map +1 -0
- package/dist/manifest/runtime-engine.js +3872 -0
- package/dist/manifest/runtime-engine.js.map +1 -0
- package/dist/manifest/runtime-profiling-bridge.d.ts +22 -0
- package/dist/manifest/runtime-profiling-bridge.d.ts.map +1 -0
- package/dist/manifest/runtime-profiling-bridge.js +69 -0
- package/dist/manifest/runtime-profiling-bridge.js.map +1 -0
- package/dist/manifest/runtime-rate-limit.d.ts +52 -0
- package/dist/manifest/runtime-rate-limit.d.ts.map +1 -0
- package/dist/manifest/runtime-rate-limit.js +70 -0
- package/dist/manifest/runtime-rate-limit.js.map +1 -0
- package/dist/manifest/runtime-retry.d.ts +68 -0
- package/dist/manifest/runtime-retry.d.ts.map +1 -0
- package/dist/manifest/runtime-retry.js +93 -0
- package/dist/manifest/runtime-retry.js.map +1 -0
- package/dist/manifest/runtime-schedule.d.ts +47 -0
- package/dist/manifest/runtime-schedule.d.ts.map +1 -0
- package/dist/manifest/runtime-schedule.js +95 -0
- package/dist/manifest/runtime-schedule.js.map +1 -0
- package/dist/manifest/schedule-utils.d.ts +15 -0
- package/dist/manifest/schedule-utils.d.ts.map +1 -0
- package/dist/manifest/schedule-utils.js +82 -0
- package/dist/manifest/schedule-utils.js.map +1 -0
- package/dist/manifest/standalone-generator.d.ts +32 -0
- package/dist/manifest/standalone-generator.d.ts.map +1 -0
- package/dist/manifest/standalone-generator.js +596 -0
- package/dist/manifest/standalone-generator.js.map +1 -0
- package/dist/manifest/stores/prisma-generic/coercion.d.ts +17 -0
- package/dist/manifest/stores/prisma-generic/coercion.d.ts.map +1 -0
- package/dist/manifest/stores/prisma-generic/coercion.js +83 -0
- package/dist/manifest/stores/prisma-generic/coercion.js.map +1 -0
- package/dist/manifest/stores/prisma-generic/index.d.ts +3 -0
- package/dist/manifest/stores/prisma-generic/index.d.ts.map +1 -0
- package/dist/manifest/stores/prisma-generic/index.js +2 -0
- package/dist/manifest/stores/prisma-generic/index.js.map +1 -0
- package/dist/manifest/stores/prisma-generic/store.d.ts +35 -0
- package/dist/manifest/stores/prisma-generic/store.d.ts.map +1 -0
- package/dist/manifest/stores/prisma-generic/store.js +216 -0
- package/dist/manifest/stores/prisma-generic/store.js.map +1 -0
- package/dist/manifest/stores/prisma-generic/types.d.ts +46 -0
- package/dist/manifest/stores/prisma-generic/types.d.ts.map +1 -0
- package/dist/manifest/stores/prisma-generic/types.js +6 -0
- package/dist/manifest/stores/prisma-generic/types.js.map +1 -0
- package/dist/manifest/stores.node.d.ts +248 -0
- package/dist/manifest/stores.node.d.ts.map +1 -0
- package/dist/manifest/stores.node.js +718 -0
- package/dist/manifest/stores.node.js.map +1 -0
- package/dist/manifest/test/postgres-live-env.d.ts +9 -0
- package/dist/manifest/test/postgres-live-env.d.ts.map +1 -0
- package/dist/manifest/test/postgres-live-env.js +14 -0
- package/dist/manifest/test/postgres-live-env.js.map +1 -0
- package/dist/manifest/types.d.ts +570 -0
- package/dist/manifest/types.d.ts.map +1 -0
- package/dist/manifest/types.js +2 -0
- package/dist/manifest/types.js.map +1 -0
- package/dist/manifest/version.d.ts +15 -0
- package/dist/manifest/version.d.ts.map +1 -0
- package/dist/manifest/version.js +15 -0
- package/dist/manifest/version.js.map +1 -0
- package/dist/manifest/wasm/index.d.ts +15 -0
- package/dist/manifest/wasm/index.d.ts.map +1 -0
- package/dist/manifest/wasm/index.js +15 -0
- package/dist/manifest/wasm/index.js.map +1 -0
- package/dist/manifest/wasm/wasm-evaluator.d.ts +93 -0
- package/dist/manifest/wasm/wasm-evaluator.d.ts.map +1 -0
- package/dist/manifest/wasm/wasm-evaluator.js +242 -0
- package/dist/manifest/wasm/wasm-evaluator.js.map +1 -0
- package/dist/manifest/wasm/wasm-loader.d.ts +56 -0
- package/dist/manifest/wasm/wasm-loader.d.ts.map +1 -0
- package/dist/manifest/wasm/wasm-loader.js +132 -0
- package/dist/manifest/wasm/wasm-loader.js.map +1 -0
- package/docs/spec/config/manifest.config.schema.json +737 -0
- package/docs/spec/config/prisma-projection.schema.json +173 -0
- package/docs/spec/ir/ir-v1.schema.json +2033 -0
- package/docs/spec/plugins/plugin.schema.json +104 -0
- package/docs/spec/registry/bypasses.schema.json +87 -0
- package/docs/spec/registry/commands.schema.json +61 -0
- package/docs/spec/registry/entities.schema.json +52 -0
- package/docs/spec/semantics.md +630 -0
- package/package.json +356 -0
- package/packages/cli/dist/audit/bypass-violations.d.ts +16 -0
- package/packages/cli/dist/audit/bypass-violations.d.ts.map +1 -0
- package/packages/cli/dist/audit/bypass-violations.js +98 -0
- package/packages/cli/dist/audit/bypass-violations.js.map +1 -0
- package/packages/cli/dist/audit/direct-writes.d.ts +15 -0
- package/packages/cli/dist/audit/direct-writes.d.ts.map +1 -0
- package/packages/cli/dist/audit/direct-writes.js +86 -0
- package/packages/cli/dist/audit/direct-writes.js.map +1 -0
- package/packages/cli/dist/audit/event-fabrication.d.ts +17 -0
- package/packages/cli/dist/audit/event-fabrication.d.ts.map +1 -0
- package/packages/cli/dist/audit/event-fabrication.js +101 -0
- package/packages/cli/dist/audit/event-fabrication.js.map +1 -0
- package/packages/cli/dist/audit/existing-command-available.d.ts +20 -0
- package/packages/cli/dist/audit/existing-command-available.d.ts.map +1 -0
- package/packages/cli/dist/audit/existing-command-available.js +158 -0
- package/packages/cli/dist/audit/existing-command-available.js.map +1 -0
- package/packages/cli/dist/audit/missing-tests.d.ts +17 -0
- package/packages/cli/dist/audit/missing-tests.d.ts.map +1 -0
- package/packages/cli/dist/audit/missing-tests.js +108 -0
- package/packages/cli/dist/audit/missing-tests.js.map +1 -0
- package/packages/cli/dist/audit/route-drift.d.ts +16 -0
- package/packages/cli/dist/audit/route-drift.d.ts.map +1 -0
- package/packages/cli/dist/audit/route-drift.js +86 -0
- package/packages/cli/dist/audit/route-drift.js.map +1 -0
- package/packages/cli/dist/audit/types.d.ts +63 -0
- package/packages/cli/dist/audit/types.d.ts.map +1 -0
- package/packages/cli/dist/audit/types.js +10 -0
- package/packages/cli/dist/audit/types.js.map +1 -0
- package/packages/cli/dist/audit/unregistered-command-call.d.ts +25 -0
- package/packages/cli/dist/audit/unregistered-command-call.d.ts.map +1 -0
- package/packages/cli/dist/audit/unregistered-command-call.js +196 -0
- package/packages/cli/dist/audit/unregistered-command-call.js.map +1 -0
- package/packages/cli/dist/audit/unregistered-entity-write.d.ts +16 -0
- package/packages/cli/dist/audit/unregistered-entity-write.d.ts.map +1 -0
- package/packages/cli/dist/audit/unregistered-entity-write.js +96 -0
- package/packages/cli/dist/audit/unregistered-entity-write.js.map +1 -0
- package/packages/cli/dist/audit/write-receiver.d.ts +23 -0
- package/packages/cli/dist/audit/write-receiver.d.ts.map +1 -0
- package/packages/cli/dist/audit/write-receiver.js +32 -0
- package/packages/cli/dist/audit/write-receiver.js.map +1 -0
- package/packages/cli/dist/checks/dispatcher-presence.d.ts +37 -0
- package/packages/cli/dist/checks/dispatcher-presence.d.ts.map +1 -0
- package/packages/cli/dist/checks/dispatcher-presence.js +57 -0
- package/packages/cli/dist/checks/dispatcher-presence.js.map +1 -0
- package/packages/cli/dist/checks/package-shape.d.ts +81 -0
- package/packages/cli/dist/checks/package-shape.d.ts.map +1 -0
- package/packages/cli/dist/checks/package-shape.js +359 -0
- package/packages/cli/dist/checks/package-shape.js.map +1 -0
- package/packages/cli/dist/checks/runtime-smoke.d.ts +42 -0
- package/packages/cli/dist/checks/runtime-smoke.d.ts.map +1 -0
- package/packages/cli/dist/checks/runtime-smoke.js +167 -0
- package/packages/cli/dist/checks/runtime-smoke.js.map +1 -0
- package/packages/cli/dist/commands/analyze.d.ts +97 -0
- package/packages/cli/dist/commands/analyze.d.ts.map +1 -0
- package/packages/cli/dist/commands/analyze.js +411 -0
- package/packages/cli/dist/commands/analyze.js.map +1 -0
- package/packages/cli/dist/commands/audit-bypasses.d.ts +31 -0
- package/packages/cli/dist/commands/audit-bypasses.d.ts.map +1 -0
- package/packages/cli/dist/commands/audit-bypasses.js +152 -0
- package/packages/cli/dist/commands/audit-bypasses.js.map +1 -0
- package/packages/cli/dist/commands/audit-constitution.d.ts +20 -0
- package/packages/cli/dist/commands/audit-constitution.d.ts.map +1 -0
- package/packages/cli/dist/commands/audit-constitution.js +18 -0
- package/packages/cli/dist/commands/audit-constitution.js.map +1 -0
- package/packages/cli/dist/commands/audit-governance.d.ts +37 -0
- package/packages/cli/dist/commands/audit-governance.d.ts.map +1 -0
- package/packages/cli/dist/commands/audit-governance.js +78 -0
- package/packages/cli/dist/commands/audit-governance.js.map +1 -0
- package/packages/cli/dist/commands/audit-routes.d.ts +135 -0
- package/packages/cli/dist/commands/audit-routes.d.ts.map +1 -0
- package/packages/cli/dist/commands/audit-routes.js +514 -0
- package/packages/cli/dist/commands/audit-routes.js.map +1 -0
- package/packages/cli/dist/commands/breaking-change.d.ts +15 -0
- package/packages/cli/dist/commands/breaking-change.d.ts.map +1 -0
- package/packages/cli/dist/commands/breaking-change.js +150 -0
- package/packages/cli/dist/commands/breaking-change.js.map +1 -0
- package/packages/cli/dist/commands/build.d.ts +26 -0
- package/packages/cli/dist/commands/build.d.ts.map +1 -0
- package/packages/cli/dist/commands/build.js +58 -0
- package/packages/cli/dist/commands/build.js.map +1 -0
- package/packages/cli/dist/commands/changelog.d.ts +26 -0
- package/packages/cli/dist/commands/changelog.d.ts.map +1 -0
- package/packages/cli/dist/commands/changelog.js +365 -0
- package/packages/cli/dist/commands/changelog.js.map +1 -0
- package/packages/cli/dist/commands/check.d.ts +21 -0
- package/packages/cli/dist/commands/check.d.ts.map +1 -0
- package/packages/cli/dist/commands/check.js +31 -0
- package/packages/cli/dist/commands/check.js.map +1 -0
- package/packages/cli/dist/commands/compile.d.ts +19 -0
- package/packages/cli/dist/commands/compile.d.ts.map +1 -0
- package/packages/cli/dist/commands/compile.js +325 -0
- package/packages/cli/dist/commands/compile.js.map +1 -0
- package/packages/cli/dist/commands/config.d.ts +23 -0
- package/packages/cli/dist/commands/config.d.ts.map +1 -0
- package/packages/cli/dist/commands/config.js +172 -0
- package/packages/cli/dist/commands/config.js.map +1 -0
- package/packages/cli/dist/commands/coverage.d.ts +55 -0
- package/packages/cli/dist/commands/coverage.d.ts.map +1 -0
- package/packages/cli/dist/commands/coverage.js +343 -0
- package/packages/cli/dist/commands/coverage.js.map +1 -0
- package/packages/cli/dist/commands/diagram.d.ts +22 -0
- package/packages/cli/dist/commands/diagram.d.ts.map +1 -0
- package/packages/cli/dist/commands/diagram.js +176 -0
- package/packages/cli/dist/commands/diagram.js.map +1 -0
- package/packages/cli/dist/commands/docs.d.ts +18 -0
- package/packages/cli/dist/commands/docs.d.ts.map +1 -0
- package/packages/cli/dist/commands/docs.js +722 -0
- package/packages/cli/dist/commands/docs.js.map +1 -0
- package/packages/cli/dist/commands/doctor-lib.d.ts +147 -0
- package/packages/cli/dist/commands/doctor-lib.d.ts.map +1 -0
- package/packages/cli/dist/commands/doctor-lib.js +491 -0
- package/packages/cli/dist/commands/doctor-lib.js.map +1 -0
- package/packages/cli/dist/commands/doctor.d.ts +31 -0
- package/packages/cli/dist/commands/doctor.d.ts.map +1 -0
- package/packages/cli/dist/commands/doctor.js +628 -0
- package/packages/cli/dist/commands/doctor.js.map +1 -0
- package/packages/cli/dist/commands/emit-registries.d.ts +33 -0
- package/packages/cli/dist/commands/emit-registries.d.ts.map +1 -0
- package/packages/cli/dist/commands/emit-registries.js +109 -0
- package/packages/cli/dist/commands/emit-registries.js.map +1 -0
- package/packages/cli/dist/commands/enforce-surface.d.ts +62 -0
- package/packages/cli/dist/commands/enforce-surface.d.ts.map +1 -0
- package/packages/cli/dist/commands/enforce-surface.js +172 -0
- package/packages/cli/dist/commands/enforce-surface.js.map +1 -0
- package/packages/cli/dist/commands/fmt.d.ts +17 -0
- package/packages/cli/dist/commands/fmt.d.ts.map +1 -0
- package/packages/cli/dist/commands/fmt.js +129 -0
- package/packages/cli/dist/commands/fmt.js.map +1 -0
- package/packages/cli/dist/commands/gen-tests.d.ts +41 -0
- package/packages/cli/dist/commands/gen-tests.d.ts.map +1 -0
- package/packages/cli/dist/commands/gen-tests.js +370 -0
- package/packages/cli/dist/commands/gen-tests.js.map +1 -0
- package/packages/cli/dist/commands/generate-from-prompt.d.ts +34 -0
- package/packages/cli/dist/commands/generate-from-prompt.d.ts.map +1 -0
- package/packages/cli/dist/commands/generate-from-prompt.js +990 -0
- package/packages/cli/dist/commands/generate-from-prompt.js.map +1 -0
- package/packages/cli/dist/commands/generate.d.ts +36 -0
- package/packages/cli/dist/commands/generate.d.ts.map +1 -0
- package/packages/cli/dist/commands/generate.js +371 -0
- package/packages/cli/dist/commands/generate.js.map +1 -0
- package/packages/cli/dist/commands/harness.d.ts +13 -0
- package/packages/cli/dist/commands/harness.d.ts.map +1 -0
- package/packages/cli/dist/commands/harness.js +276 -0
- package/packages/cli/dist/commands/harness.js.map +1 -0
- package/packages/cli/dist/commands/init-ci.d.ts +19 -0
- package/packages/cli/dist/commands/init-ci.d.ts.map +1 -0
- package/packages/cli/dist/commands/init-ci.js +148 -0
- package/packages/cli/dist/commands/init-ci.js.map +1 -0
- package/packages/cli/dist/commands/init.d.ts +33 -0
- package/packages/cli/dist/commands/init.d.ts.map +1 -0
- package/packages/cli/dist/commands/init.js +157 -0
- package/packages/cli/dist/commands/init.js.map +1 -0
- package/packages/cli/dist/commands/install-hooks.d.ts +29 -0
- package/packages/cli/dist/commands/install-hooks.d.ts.map +1 -0
- package/packages/cli/dist/commands/install-hooks.js +139 -0
- package/packages/cli/dist/commands/install-hooks.js.map +1 -0
- package/packages/cli/dist/commands/integration-check.d.ts +62 -0
- package/packages/cli/dist/commands/integration-check.d.ts.map +1 -0
- package/packages/cli/dist/commands/integration-check.js +298 -0
- package/packages/cli/dist/commands/integration-check.js.map +1 -0
- package/packages/cli/dist/commands/ir-diff.d.ts +8 -0
- package/packages/cli/dist/commands/ir-diff.d.ts.map +1 -0
- package/packages/cli/dist/commands/ir-diff.js +199 -0
- package/packages/cli/dist/commands/ir-diff.js.map +1 -0
- package/packages/cli/dist/commands/lint-routes.d.ts +56 -0
- package/packages/cli/dist/commands/lint-routes.d.ts.map +1 -0
- package/packages/cli/dist/commands/lint-routes.js +228 -0
- package/packages/cli/dist/commands/lint-routes.js.map +1 -0
- package/packages/cli/dist/commands/load-test.d.ts +61 -0
- package/packages/cli/dist/commands/load-test.d.ts.map +1 -0
- package/packages/cli/dist/commands/load-test.js +675 -0
- package/packages/cli/dist/commands/load-test.js.map +1 -0
- package/packages/cli/dist/commands/migrate.d.ts +21 -0
- package/packages/cli/dist/commands/migrate.d.ts.map +1 -0
- package/packages/cli/dist/commands/migrate.js +264 -0
- package/packages/cli/dist/commands/migrate.js.map +1 -0
- package/packages/cli/dist/commands/mock.d.ts +79 -0
- package/packages/cli/dist/commands/mock.d.ts.map +1 -0
- package/packages/cli/dist/commands/mock.js +324 -0
- package/packages/cli/dist/commands/mock.js.map +1 -0
- package/packages/cli/dist/commands/pack-unpack.d.ts +30 -0
- package/packages/cli/dist/commands/pack-unpack.d.ts.map +1 -0
- package/packages/cli/dist/commands/pack-unpack.js +108 -0
- package/packages/cli/dist/commands/pack-unpack.js.map +1 -0
- package/packages/cli/dist/commands/preflight.d.ts +31 -0
- package/packages/cli/dist/commands/preflight.d.ts.map +1 -0
- package/packages/cli/dist/commands/preflight.js +246 -0
- package/packages/cli/dist/commands/preflight.js.map +1 -0
- package/packages/cli/dist/commands/profile.d.ts +30 -0
- package/packages/cli/dist/commands/profile.d.ts.map +1 -0
- package/packages/cli/dist/commands/profile.js +201 -0
- package/packages/cli/dist/commands/profile.js.map +1 -0
- package/packages/cli/dist/commands/repl.d.ts +16 -0
- package/packages/cli/dist/commands/repl.d.ts.map +1 -0
- package/packages/cli/dist/commands/repl.js +772 -0
- package/packages/cli/dist/commands/repl.js.map +1 -0
- package/packages/cli/dist/commands/routes.d.ts +24 -0
- package/packages/cli/dist/commands/routes.d.ts.map +1 -0
- package/packages/cli/dist/commands/routes.js +144 -0
- package/packages/cli/dist/commands/routes.js.map +1 -0
- package/packages/cli/dist/commands/scan.d.ts +23 -0
- package/packages/cli/dist/commands/scan.d.ts.map +1 -0
- package/packages/cli/dist/commands/scan.js +722 -0
- package/packages/cli/dist/commands/scan.js.map +1 -0
- package/packages/cli/dist/commands/seed.d.ts +35 -0
- package/packages/cli/dist/commands/seed.d.ts.map +1 -0
- package/packages/cli/dist/commands/seed.js +503 -0
- package/packages/cli/dist/commands/seed.js.map +1 -0
- package/packages/cli/dist/commands/validate-ai-ajv.d.ts +4 -0
- package/packages/cli/dist/commands/validate-ai-ajv.d.ts.map +1 -0
- package/packages/cli/dist/commands/validate-ai-ajv.js +78 -0
- package/packages/cli/dist/commands/validate-ai-ajv.js.map +1 -0
- package/packages/cli/dist/commands/validate-ai-compiler.d.ts +5 -0
- package/packages/cli/dist/commands/validate-ai-compiler.d.ts.map +1 -0
- package/packages/cli/dist/commands/validate-ai-compiler.js +8 -0
- package/packages/cli/dist/commands/validate-ai-compiler.js.map +1 -0
- package/packages/cli/dist/commands/validate-ai-report.d.ts +5 -0
- package/packages/cli/dist/commands/validate-ai-report.d.ts.map +1 -0
- package/packages/cli/dist/commands/validate-ai-report.js +80 -0
- package/packages/cli/dist/commands/validate-ai-report.js.map +1 -0
- package/packages/cli/dist/commands/validate-ai-resolve-inputs.d.ts +6 -0
- package/packages/cli/dist/commands/validate-ai-resolve-inputs.d.ts.map +1 -0
- package/packages/cli/dist/commands/validate-ai-resolve-inputs.js +54 -0
- package/packages/cli/dist/commands/validate-ai-resolve-inputs.js.map +1 -0
- package/packages/cli/dist/commands/validate-ai-semantic-checks.d.ts +4 -0
- package/packages/cli/dist/commands/validate-ai-semantic-checks.d.ts.map +1 -0
- package/packages/cli/dist/commands/validate-ai-semantic-checks.js +218 -0
- package/packages/cli/dist/commands/validate-ai-semantic-checks.js.map +1 -0
- package/packages/cli/dist/commands/validate-ai-types.d.ts +41 -0
- package/packages/cli/dist/commands/validate-ai-types.d.ts.map +1 -0
- package/packages/cli/dist/commands/validate-ai-types.js +2 -0
- package/packages/cli/dist/commands/validate-ai-types.js.map +1 -0
- package/packages/cli/dist/commands/validate-ai-validate-file.d.ts +5 -0
- package/packages/cli/dist/commands/validate-ai-validate-file.d.ts.map +1 -0
- package/packages/cli/dist/commands/validate-ai-validate-file.js +126 -0
- package/packages/cli/dist/commands/validate-ai-validate-file.js.map +1 -0
- package/packages/cli/dist/commands/validate-ai.d.ts +15 -0
- package/packages/cli/dist/commands/validate-ai.d.ts.map +1 -0
- package/packages/cli/dist/commands/validate-ai.js +124 -0
- package/packages/cli/dist/commands/validate-ai.js.map +1 -0
- package/packages/cli/dist/commands/validate.d.ts +15 -0
- package/packages/cli/dist/commands/validate.d.ts.map +1 -0
- package/packages/cli/dist/commands/validate.js +205 -0
- package/packages/cli/dist/commands/validate.js.map +1 -0
- package/packages/cli/dist/commands/versions.d.ts +56 -0
- package/packages/cli/dist/commands/versions.d.ts.map +1 -0
- package/packages/cli/dist/commands/versions.js +427 -0
- package/packages/cli/dist/commands/versions.js.map +1 -0
- package/packages/cli/dist/commands/watch.d.ts +34 -0
- package/packages/cli/dist/commands/watch.d.ts.map +1 -0
- package/packages/cli/dist/commands/watch.js +253 -0
- package/packages/cli/dist/commands/watch.js.map +1 -0
- package/packages/cli/dist/index.d.ts +14 -0
- package/packages/cli/dist/index.d.ts.map +1 -0
- package/packages/cli/dist/index.js +1159 -0
- package/packages/cli/dist/index.js.map +1 -0
- package/packages/cli/dist/utils/config-validate.d.ts +48 -0
- package/packages/cli/dist/utils/config-validate.d.ts.map +1 -0
- package/packages/cli/dist/utils/config-validate.js +116 -0
- package/packages/cli/dist/utils/config-validate.js.map +1 -0
- package/packages/cli/dist/utils/config.d.ts +360 -0
- package/packages/cli/dist/utils/config.d.ts.map +1 -0
- package/packages/cli/dist/utils/config.js +567 -0
- package/packages/cli/dist/utils/config.js.map +1 -0
- package/packages/cli/dist/utils/schema.d.ts +8 -0
- package/packages/cli/dist/utils/schema.d.ts.map +1 -0
- package/packages/cli/dist/utils/schema.js +13 -0
- package/packages/cli/dist/utils/schema.js.map +1 -0
- package/packages/lsp-server/bin/manifest-lsp.js +3 -0
- package/packages/lsp-server/dist/compiler-bridge.d.ts +24 -0
- package/packages/lsp-server/dist/compiler-bridge.d.ts.map +1 -0
- package/packages/lsp-server/dist/compiler-bridge.js +32 -0
- package/packages/lsp-server/dist/compiler-bridge.js.map +1 -0
- package/packages/lsp-server/dist/document-store.d.ts +23 -0
- package/packages/lsp-server/dist/document-store.d.ts.map +1 -0
- package/packages/lsp-server/dist/document-store.js +40 -0
- package/packages/lsp-server/dist/document-store.js.map +1 -0
- package/packages/lsp-server/dist/features/completion.d.ts +23 -0
- package/packages/lsp-server/dist/features/completion.d.ts.map +1 -0
- package/packages/lsp-server/dist/features/completion.js +293 -0
- package/packages/lsp-server/dist/features/completion.js.map +1 -0
- package/packages/lsp-server/dist/features/definition.d.ts +9 -0
- package/packages/lsp-server/dist/features/definition.d.ts.map +1 -0
- package/packages/lsp-server/dist/features/definition.js +24 -0
- package/packages/lsp-server/dist/features/definition.js.map +1 -0
- package/packages/lsp-server/dist/features/diagnostics.d.ts +8 -0
- package/packages/lsp-server/dist/features/diagnostics.d.ts.map +1 -0
- package/packages/lsp-server/dist/features/diagnostics.js +40 -0
- package/packages/lsp-server/dist/features/diagnostics.js.map +1 -0
- package/packages/lsp-server/dist/features/document-symbols.d.ts +8 -0
- package/packages/lsp-server/dist/features/document-symbols.d.ts.map +1 -0
- package/packages/lsp-server/dist/features/document-symbols.js +164 -0
- package/packages/lsp-server/dist/features/document-symbols.js.map +1 -0
- package/packages/lsp-server/dist/features/hover.d.ts +9 -0
- package/packages/lsp-server/dist/features/hover.d.ts.map +1 -0
- package/packages/lsp-server/dist/features/hover.js +100 -0
- package/packages/lsp-server/dist/features/hover.js.map +1 -0
- package/packages/lsp-server/dist/index.d.ts +6 -0
- package/packages/lsp-server/dist/index.d.ts.map +1 -0
- package/packages/lsp-server/dist/index.js +11 -0
- package/packages/lsp-server/dist/index.js.map +1 -0
- package/packages/lsp-server/dist/position-utils.d.ts +25 -0
- package/packages/lsp-server/dist/position-utils.d.ts.map +1 -0
- package/packages/lsp-server/dist/position-utils.js +39 -0
- package/packages/lsp-server/dist/position-utils.js.map +1 -0
- package/packages/lsp-server/dist/server.d.ts +14 -0
- package/packages/lsp-server/dist/server.d.ts.map +1 -0
- package/packages/lsp-server/dist/server.js +96 -0
- package/packages/lsp-server/dist/server.js.map +1 -0
- package/packages/lsp-server/dist/symbols/builtin-docs.d.ts +34 -0
- package/packages/lsp-server/dist/symbols/builtin-docs.d.ts.map +1 -0
- package/packages/lsp-server/dist/symbols/builtin-docs.js +193 -0
- package/packages/lsp-server/dist/symbols/builtin-docs.js.map +1 -0
- package/packages/lsp-server/dist/symbols/symbol-index.d.ts +18 -0
- package/packages/lsp-server/dist/symbols/symbol-index.d.ts.map +1 -0
- package/packages/lsp-server/dist/symbols/symbol-index.js +107 -0
- package/packages/lsp-server/dist/symbols/symbol-index.js.map +1 -0
- package/packages/mcp-server/bin/manifest-mcp.js +27 -0
- package/packages/mcp-server/dist/index.d.ts +24 -0
- package/packages/mcp-server/dist/index.d.ts.map +1 -0
- package/packages/mcp-server/dist/index.js +36 -0
- package/packages/mcp-server/dist/index.js.map +1 -0
- package/packages/mcp-server/dist/resources/ir-cache.d.ts +9 -0
- package/packages/mcp-server/dist/resources/ir-cache.d.ts.map +1 -0
- package/packages/mcp-server/dist/resources/ir-cache.js +47 -0
- package/packages/mcp-server/dist/resources/ir-cache.js.map +1 -0
- package/packages/mcp-server/dist/resources/ir-schema.d.ts +8 -0
- package/packages/mcp-server/dist/resources/ir-schema.d.ts.map +1 -0
- package/packages/mcp-server/dist/resources/ir-schema.js +39 -0
- package/packages/mcp-server/dist/resources/ir-schema.js.map +1 -0
- package/packages/mcp-server/dist/resources/semantics.d.ts +8 -0
- package/packages/mcp-server/dist/resources/semantics.d.ts.map +1 -0
- package/packages/mcp-server/dist/resources/semantics.js +38 -0
- package/packages/mcp-server/dist/resources/semantics.js.map +1 -0
- package/packages/mcp-server/dist/server.d.ts +7 -0
- package/packages/mcp-server/dist/server.d.ts.map +1 -0
- package/packages/mcp-server/dist/server.js +22 -0
- package/packages/mcp-server/dist/server.js.map +1 -0
- package/packages/mcp-server/dist/state/session-store.d.ts +39 -0
- package/packages/mcp-server/dist/state/session-store.d.ts.map +1 -0
- package/packages/mcp-server/dist/state/session-store.js +58 -0
- package/packages/mcp-server/dist/state/session-store.js.map +1 -0
- package/packages/mcp-server/dist/tools/compile.d.ts +30 -0
- package/packages/mcp-server/dist/tools/compile.d.ts.map +1 -0
- package/packages/mcp-server/dist/tools/compile.js +54 -0
- package/packages/mcp-server/dist/tools/compile.js.map +1 -0
- package/packages/mcp-server/dist/tools/execute.d.ts +112 -0
- package/packages/mcp-server/dist/tools/execute.d.ts.map +1 -0
- package/packages/mcp-server/dist/tools/execute.js +103 -0
- package/packages/mcp-server/dist/tools/execute.js.map +1 -0
- package/packages/mcp-server/dist/tools/explain.d.ts +25 -0
- package/packages/mcp-server/dist/tools/explain.d.ts.map +1 -0
- package/packages/mcp-server/dist/tools/explain.js +254 -0
- package/packages/mcp-server/dist/tools/explain.js.map +1 -0
- package/packages/mcp-server/dist/tools/validate.d.ts +23 -0
- package/packages/mcp-server/dist/tools/validate.d.ts.map +1 -0
- package/packages/mcp-server/dist/tools/validate.js +38 -0
- package/packages/mcp-server/dist/tools/validate.js.map +1 -0
- package/src/manifest/audit/sinks/postgres.sql +51 -0
- package/src/manifest/outbox/stores/postgres.sql +61 -0
|
@@ -0,0 +1,1019 @@
|
|
|
1
|
+
import { IR, IRProvenance, IREntity, IRCommand, IRPolicy, IRExpression, ConstraintOutcome, OverrideRequest, ConcurrencyConflict, JobQueue, JobRecord } from './ir';
|
|
2
|
+
import type { IRSchedule } from './ir';
|
|
3
|
+
/**
|
|
4
|
+
* Spec-guaranteed runtime context bindings (see docs/spec/semantics.md
|
|
5
|
+
* § "Runtime Context Schema" and docs/spec/builtins.md § "Context Member
|
|
6
|
+
* Access"). Every typed field is optional at the type level; per spec,
|
|
7
|
+
* tenant-scoped commands MUST fail closed with `MISSING_TENANT_CONTEXT`
|
|
8
|
+
* when `tenantId` is absent and `requireTenantContext` is set on
|
|
9
|
+
* RuntimeOptions.
|
|
10
|
+
*
|
|
11
|
+
* The index signature is preserved for backwards compatibility — existing
|
|
12
|
+
* callers may attach ad-hoc keys without a type-level change.
|
|
13
|
+
*/
|
|
14
|
+
export interface RuntimeContext {
|
|
15
|
+
/** Active tenant identifier. Required for tenant-scoped commands. */
|
|
16
|
+
tenantId?: string;
|
|
17
|
+
/** Active organization identifier (e.g. Clerk orgId). */
|
|
18
|
+
orgId?: string;
|
|
19
|
+
/** Acting user identifier. */
|
|
20
|
+
actorId?: string;
|
|
21
|
+
/** Caller-supplied request id; surfaces in diagnostics and emitted events. */
|
|
22
|
+
requestId?: string;
|
|
23
|
+
/** Origin surface: 'route' | 'job' | 'cli' | 'test' | 'ui' | 'workflow' (or other). */
|
|
24
|
+
source?: string;
|
|
25
|
+
/** If true, adapter actions throw ManifestEffectBoundaryError. options.deterministicMode wins if both set. */
|
|
26
|
+
deterministic?: boolean;
|
|
27
|
+
/** Legacy actor shorthand. Prefer `actorId` for new code. */
|
|
28
|
+
user?: {
|
|
29
|
+
id: string;
|
|
30
|
+
role?: string;
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
};
|
|
33
|
+
/** Open extension surface; legacy callers still rely on free keys. */
|
|
34
|
+
[key: string]: unknown;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Pluggable encryption provider for field-level encryption.
|
|
38
|
+
* When supplied via RuntimeOptions.encryptionProvider, properties with the
|
|
39
|
+
* `encrypted` modifier are transparently encrypted on write and decrypted
|
|
40
|
+
* on read at the store boundary. The envelope format supports key rotation:
|
|
41
|
+
* `{"v":1,"kid":"<keyId>","ct":"<ciphertext>"}`.
|
|
42
|
+
*/
|
|
43
|
+
export interface EncryptionProvider {
|
|
44
|
+
encrypt(plaintext: string): Promise<{
|
|
45
|
+
ciphertext: string;
|
|
46
|
+
keyId: string;
|
|
47
|
+
}>;
|
|
48
|
+
decrypt(ciphertext: string, keyId: string): Promise<string>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Middleware hook types. Each corresponds to a lifecycle point in command
|
|
52
|
+
* execution where middleware can observe, patch context, or short-circuit.
|
|
53
|
+
*/
|
|
54
|
+
export type MiddlewareHook = 'before-policy' | 'before-guard' | 'before-action' | 'after-emit';
|
|
55
|
+
/**
|
|
56
|
+
* Context passed to middleware handlers at each lifecycle points.
|
|
57
|
+
*/
|
|
58
|
+
export interface MiddlewareContext {
|
|
59
|
+
/** Which lifecycle hook triggered this middleware call */
|
|
60
|
+
hook: MiddlewareHook;
|
|
61
|
+
/** The IR command being executed */
|
|
62
|
+
command: IRCommand;
|
|
63
|
+
/** The current expression evaluation context (read/write via contextPatch) */
|
|
64
|
+
evalContext: Record<string, unknown>;
|
|
65
|
+
/** The original input to the command */
|
|
66
|
+
input: Record<string, unknown>;
|
|
67
|
+
/** The runtime context (user, tenantId, etc.) */
|
|
68
|
+
runtimeContext: RuntimeContext;
|
|
69
|
+
/** Entity name, if applicable */
|
|
70
|
+
entityName?: string;
|
|
71
|
+
/** Instance ID, if applicable */
|
|
72
|
+
instanceId?: string;
|
|
73
|
+
/** Events emitted so far (populated in after-emit hook) */
|
|
74
|
+
emittedEvents: EmittedEvent[];
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Result returned by a middleware handler.
|
|
78
|
+
* - Empty object `{}` means "continue normally".
|
|
79
|
+
* - `contextPatch` merges additional values into the evalContext.
|
|
80
|
+
* - `shortCircuit` immediately returns the provided CommandResult.
|
|
81
|
+
*/
|
|
82
|
+
export interface MiddlewareResult {
|
|
83
|
+
contextPatch?: Record<string, unknown>;
|
|
84
|
+
shortCircuit?: boolean;
|
|
85
|
+
result?: CommandResult;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* A middleware instance: declares which hooks it participates in and
|
|
89
|
+
* a handler function called at each matching lifecycle points.
|
|
90
|
+
*/
|
|
91
|
+
export interface Middleware {
|
|
92
|
+
hooks: MiddlewareHook[];
|
|
93
|
+
handler: (ctx: MiddlewareContext) => Promise<MiddlewareResult>;
|
|
94
|
+
}
|
|
95
|
+
export interface RuntimeOptions {
|
|
96
|
+
generateId?: () => string;
|
|
97
|
+
now?: () => number;
|
|
98
|
+
/**
|
|
99
|
+
* Optional middleware pipeline. Middleware are executed in declaration order
|
|
100
|
+
* at each matching lifecycle hook during command execution.
|
|
101
|
+
*/
|
|
102
|
+
middleware?: Middleware[];
|
|
103
|
+
/**
|
|
104
|
+
* If true, runtime will verify IR integrity hash before execution.
|
|
105
|
+
* When an IR hash doesn't match, the runtime will throw an error.
|
|
106
|
+
* Set to false for development/debugging mode.
|
|
107
|
+
*
|
|
108
|
+
* @default
|
|
109
|
+
* - `true` in production (NODE_ENV=production)
|
|
110
|
+
* - `false` in development
|
|
111
|
+
*
|
|
112
|
+
* Explicit dev override: Set to `false` to disable verification in production for debugging.
|
|
113
|
+
*/
|
|
114
|
+
requireValidProvenance?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Optional: expected IR hash for verification. If provided and requireValidProvenance is true,
|
|
117
|
+
* the runtime will verify the IR's hash matches this value.
|
|
118
|
+
* If not provided, the runtime will verify the IR's self-reported hash.
|
|
119
|
+
*/
|
|
120
|
+
expectedIRHash?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Optional function to provide custom store implementations for entities.
|
|
123
|
+
* Called with the entity name and should return a Store instance or undefined.
|
|
124
|
+
* If undefined is returned, the runtime will use its default store initialization.
|
|
125
|
+
*
|
|
126
|
+
* This allows using server-side stores like PostgresStore and SupabaseStore from stores.node.ts.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```typescript
|
|
130
|
+
* import { PostgresStore } from './stores.node.js';
|
|
131
|
+
*
|
|
132
|
+
* const runtime = new RuntimeEngine(ir, context, {
|
|
133
|
+
* storeProvider: (entityName) => {
|
|
134
|
+
* if (entityName === 'User' || entityName === 'Post') {
|
|
135
|
+
* return new PostgresStore({
|
|
136
|
+
* connectionString: process.env.DATABASE_URL,
|
|
137
|
+
* tableName: entityName.toLowerCase()
|
|
138
|
+
* });
|
|
139
|
+
* }
|
|
140
|
+
* return undefined; // Use default store
|
|
141
|
+
* }
|
|
142
|
+
* });
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
storeProvider?: (entityName: string) => Store | undefined;
|
|
146
|
+
/** Caller-provided idempotency store for command deduplication */
|
|
147
|
+
idempotencyStore?: IdempotencyStore;
|
|
148
|
+
/**
|
|
149
|
+
* If true, adapter actions (persist/publish/effect) throw ManifestEffectBoundaryError
|
|
150
|
+
* instead of the default no-op behavior. Use for conformance testing and replay validation.
|
|
151
|
+
* See docs/spec/adapters.md for the normative exception.
|
|
152
|
+
*/
|
|
153
|
+
deterministicMode?: boolean;
|
|
154
|
+
/** Optional complexity limits for expression evaluation */
|
|
155
|
+
evaluationLimits?: EvaluationLimits;
|
|
156
|
+
/**
|
|
157
|
+
* If true, any `runCommand` invocation MUST fail closed with diagnostic
|
|
158
|
+
* `MISSING_TENANT_CONTEXT` when `context.tenantId` is absent or empty.
|
|
159
|
+
* Use to enforce tenant-scoped command semantics in multi-tenant apps.
|
|
160
|
+
* Default: false (backwards compatible — legacy callers unaffected).
|
|
161
|
+
*/
|
|
162
|
+
requireTenantContext?: boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Optional custom builtin functions from plugins or project configuration.
|
|
165
|
+
* These are merged with core builtins; core builtins always take precedence
|
|
166
|
+
* on name collision. Populated by the plugin loader from BuiltinFunctionPlugin
|
|
167
|
+
* registrations.
|
|
168
|
+
*
|
|
169
|
+
* @see plugin-api.ts BuiltinFunctionPlugin
|
|
170
|
+
*/
|
|
171
|
+
customBuiltins?: Map<string, (...args: unknown[]) => unknown>;
|
|
172
|
+
/**
|
|
173
|
+
* Optional AuditSink for durable audit records.
|
|
174
|
+
* When supplied, the runtime is contracted to call sink.emit() exactly
|
|
175
|
+
* once per command invocation. Contract: src/manifest/audit/audit-sink.ts.
|
|
176
|
+
* Wire-in is contract-only in this release; actual emission lands in
|
|
177
|
+
* the audit/outbox implementation follow-on.
|
|
178
|
+
*/
|
|
179
|
+
auditSink?: import('./audit/audit-sink').AuditSink;
|
|
180
|
+
/**
|
|
181
|
+
* Optional OutboxStore for transactional event persistence.
|
|
182
|
+
* Contract: src/manifest/outbox/outbox-store.ts. Contract-only wire-in
|
|
183
|
+
* in this release; transactional integration lands in the follow-on.
|
|
184
|
+
*/
|
|
185
|
+
outboxStore?: import('./outbox/outbox-store').OutboxStore;
|
|
186
|
+
/**
|
|
187
|
+
* Optional durable ApprovalStore for multi-stage approval persistence.
|
|
188
|
+
* When supplied, pending approval requests, stage grants, and denials are
|
|
189
|
+
* read from and written to this store, so an approval created by one
|
|
190
|
+
* engine instance is visible to a freshly-constructed engine (the normal
|
|
191
|
+
* stateless-per-request pattern). When omitted, approval state lives in an
|
|
192
|
+
* in-process Map (single-process / test use only).
|
|
193
|
+
* Contract: src/manifest/approval/approval-store.ts. Memory + Postgres
|
|
194
|
+
* adapters ship via "./approval/memory" and "./approval/postgres".
|
|
195
|
+
*/
|
|
196
|
+
approvalStore?: import('./approval/approval-store').ApprovalStore;
|
|
197
|
+
/**
|
|
198
|
+
* Optional feature flag provider function.
|
|
199
|
+
* Called with a flag name and returns the flag value (boolean, string, number, or object).
|
|
200
|
+
* Enables the `flag(name)` built-in to resolve feature flags declaratively
|
|
201
|
+
* from any provider (LaunchDarkly, Unleash, JSON file, etc.).
|
|
202
|
+
*
|
|
203
|
+
* When not provided, `flag(name)` returns `false` (safe default — features off).
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* ```typescript
|
|
207
|
+
* const runtime = new RuntimeEngine(ir, context, {
|
|
208
|
+
* flagProvider: (name) => launchDarklyClient.variation(name, false),
|
|
209
|
+
* });
|
|
210
|
+
* ```
|
|
211
|
+
*/
|
|
212
|
+
flagProvider?: (name: string) => unknown;
|
|
213
|
+
/**
|
|
214
|
+
* Optional JobQueue for async command execution.
|
|
215
|
+
* When an async command is invoked, the runtime enqueues a job and returns
|
|
216
|
+
* a JobId immediately. Use `drainJobs()` for deterministic testing.
|
|
217
|
+
*/
|
|
218
|
+
jobQueue?: JobQueue;
|
|
219
|
+
/**
|
|
220
|
+
* Optional WASM expression evaluator for near-native execution speed.
|
|
221
|
+
* When provided, the runtime will use the WASM module for expression
|
|
222
|
+
* evaluation and constraint validation. Falls back to the TypeScript
|
|
223
|
+
* evaluator transparently if the WASM module fails to load or evaluate.
|
|
224
|
+
*
|
|
225
|
+
* The WASM evaluator maintains identical semantics to the TypeScript
|
|
226
|
+
* implementation, so swapping in/out is safe and observable only via
|
|
227
|
+
* performance characteristics.
|
|
228
|
+
*
|
|
229
|
+
* @see src/manifest/wasm/wasm-evaluator.ts
|
|
230
|
+
*/
|
|
231
|
+
wasmEvaluator?: import('./wasm/wasm-evaluator').WasmExpressionEvaluator;
|
|
232
|
+
/**
|
|
233
|
+
* Optional encryption provider for field-level encryption.
|
|
234
|
+
* When supplied, properties with the `encrypted` modifier are transparently
|
|
235
|
+
* encrypted before store writes and decrypted after store reads.
|
|
236
|
+
* No-op when omitted (plaintext stored — safe for dev/test).
|
|
237
|
+
*/
|
|
238
|
+
encryptionProvider?: EncryptionProvider;
|
|
239
|
+
/**
|
|
240
|
+
* Optional profiling configuration. When enabled, the runtime collects
|
|
241
|
+
* per-phase timing data for each command execution. Profiles are
|
|
242
|
+
* accessible via `engine.getProfiles()`.
|
|
243
|
+
*/
|
|
244
|
+
profiling?: import('./profiling').ProfilingOptions;
|
|
245
|
+
/** Optional per-action trace hook for @angriff36/manifest/debug CommandTraceRecorder */
|
|
246
|
+
actionTraceHook?: (info: {
|
|
247
|
+
index: number;
|
|
248
|
+
kind: string;
|
|
249
|
+
target?: string;
|
|
250
|
+
entityName?: string;
|
|
251
|
+
instanceId?: string;
|
|
252
|
+
}) => void | Promise<void>;
|
|
253
|
+
/** Injectable sleep for deterministic retry backoff in tests/adapters */
|
|
254
|
+
sleep?: (ms: number) => Promise<void>;
|
|
255
|
+
/** Deterministic jitter override for retry delays (used when retry.jitter is true) */
|
|
256
|
+
retryJitter?: (delayMs: number) => number;
|
|
257
|
+
}
|
|
258
|
+
export type { AuditSink, AuditRecord, CommandOutcome } from './audit/audit-sink';
|
|
259
|
+
export type { OutboxStore, OutboxEntry, OutboxEntryStatus } from './outbox/outbox-store';
|
|
260
|
+
export type { ApprovalStore } from './approval/approval-store';
|
|
261
|
+
export type { JobQueue, JobRecord } from './ir';
|
|
262
|
+
export interface EntityInstance {
|
|
263
|
+
id: string;
|
|
264
|
+
/** For optimistic concurrency control (optional) */
|
|
265
|
+
version?: number;
|
|
266
|
+
/** Timestamp of last version change (optional) */
|
|
267
|
+
versionAt?: number;
|
|
268
|
+
[key: string]: unknown;
|
|
269
|
+
}
|
|
270
|
+
export interface CommandResult {
|
|
271
|
+
success: boolean;
|
|
272
|
+
result?: unknown;
|
|
273
|
+
instance?: EntityInstance;
|
|
274
|
+
error?: string;
|
|
275
|
+
deniedBy?: string;
|
|
276
|
+
guardFailure?: GuardFailure;
|
|
277
|
+
policyDenial?: PolicyDenial;
|
|
278
|
+
/** All constraint evaluation outcomes (vNext) */
|
|
279
|
+
constraintOutcomes?: ConstraintOutcome[];
|
|
280
|
+
/** Pending override requests (vNext) */
|
|
281
|
+
overrideRequests?: OverrideRequest[];
|
|
282
|
+
/** Concurrency conflict details (vNext) */
|
|
283
|
+
concurrencyConflict?: ConcurrencyConflict;
|
|
284
|
+
/** Approval workflow required before command can execute */
|
|
285
|
+
approvalRequired?: ApprovalRequiredInfo;
|
|
286
|
+
/** Caller-supplied correlation ID grouping related events across a workflow */
|
|
287
|
+
correlationId?: string;
|
|
288
|
+
/** Caller-supplied ID of the event/command that caused this command execution */
|
|
289
|
+
causationId?: string;
|
|
290
|
+
emittedEvents: EmittedEvent[];
|
|
291
|
+
/** Retry metadata when command declares a retry policy */
|
|
292
|
+
retry?: {
|
|
293
|
+
attempts: number;
|
|
294
|
+
exhausted: boolean;
|
|
295
|
+
lastErrorCode?: string;
|
|
296
|
+
delaysMs: number[];
|
|
297
|
+
};
|
|
298
|
+
/** Rate limit denial when a command or policy rate limiter blocks execution */
|
|
299
|
+
rateLimitDenial?: {
|
|
300
|
+
scope: 'user' | 'tenant' | 'global';
|
|
301
|
+
scopeKey: string;
|
|
302
|
+
limit: number;
|
|
303
|
+
windowMs: number;
|
|
304
|
+
retryAfterMs: number;
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
export interface GuardFailure {
|
|
308
|
+
index: number;
|
|
309
|
+
expression: IRExpression;
|
|
310
|
+
formatted: string;
|
|
311
|
+
resolved?: GuardResolvedValue[];
|
|
312
|
+
}
|
|
313
|
+
export interface PolicyDenial {
|
|
314
|
+
policyName: string;
|
|
315
|
+
expression: IRExpression;
|
|
316
|
+
formatted: string;
|
|
317
|
+
message?: string;
|
|
318
|
+
contextKeys: string[];
|
|
319
|
+
/** Resolved values from the policy expression evaluation */
|
|
320
|
+
resolved?: GuardResolvedValue[];
|
|
321
|
+
}
|
|
322
|
+
export interface GuardResolvedValue {
|
|
323
|
+
expression: string;
|
|
324
|
+
value: unknown;
|
|
325
|
+
}
|
|
326
|
+
export interface ConstraintFailure {
|
|
327
|
+
constraintName: string;
|
|
328
|
+
expression: IRExpression;
|
|
329
|
+
formatted: string;
|
|
330
|
+
message?: string;
|
|
331
|
+
resolved?: GuardResolvedValue[];
|
|
332
|
+
}
|
|
333
|
+
export interface ApprovalGrant {
|
|
334
|
+
stage: string;
|
|
335
|
+
by: string;
|
|
336
|
+
at: number;
|
|
337
|
+
}
|
|
338
|
+
export interface ApprovalRequestState {
|
|
339
|
+
entity: string;
|
|
340
|
+
instanceId: string;
|
|
341
|
+
approvalName: string;
|
|
342
|
+
command: string;
|
|
343
|
+
status: 'pending' | 'granted' | 'denied' | 'expired';
|
|
344
|
+
/** Stages whose `when` condition evaluated true (or had no `when`) */
|
|
345
|
+
requiredStages: string[];
|
|
346
|
+
grants: ApprovalGrant[];
|
|
347
|
+
requestedAt: number;
|
|
348
|
+
expiresAt?: number;
|
|
349
|
+
deniedReason?: string;
|
|
350
|
+
deniedBy?: string;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Identity of a user approving a stage. A bare string is the legacy form
|
|
354
|
+
* where the userId doubles as the role (kept for backward compatibility).
|
|
355
|
+
* Prefer the object form to express real RBAC — `role`/`roles`/permissions
|
|
356
|
+
* are made available to the stage policy as `user.*`, independent of `id`.
|
|
357
|
+
*/
|
|
358
|
+
export type ApprovalApprover = string | {
|
|
359
|
+
id: string;
|
|
360
|
+
role?: string;
|
|
361
|
+
roles?: string[];
|
|
362
|
+
[key: string]: unknown;
|
|
363
|
+
};
|
|
364
|
+
export interface ApprovalRequiredInfo {
|
|
365
|
+
approvalName: string;
|
|
366
|
+
pendingStages: string[];
|
|
367
|
+
requestKey: string;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Canonical subject metadata identifying the originating entity, command,
|
|
371
|
+
* and target instance for an emitted event. Populated by the runtime during
|
|
372
|
+
* `runCommand` so downstream consumers can reliably route and correlate
|
|
373
|
+
* events without inspecting payload internals.
|
|
374
|
+
*/
|
|
375
|
+
export interface EventSubject {
|
|
376
|
+
/** The Manifest entity name associated with the command, when available. */
|
|
377
|
+
entity?: string;
|
|
378
|
+
/** The Manifest command name that emitted the event. */
|
|
379
|
+
command: string;
|
|
380
|
+
/** The canonical target instance id, resolved deterministically. */
|
|
381
|
+
id?: string;
|
|
382
|
+
}
|
|
383
|
+
export interface EmittedEvent {
|
|
384
|
+
name: string;
|
|
385
|
+
channel: string;
|
|
386
|
+
payload: unknown;
|
|
387
|
+
timestamp: number;
|
|
388
|
+
/** Canonical subject metadata for the originating entity/command/instance. */
|
|
389
|
+
subject?: EventSubject;
|
|
390
|
+
/** Provenance information from the IR at the time of event emission */
|
|
391
|
+
provenance?: {
|
|
392
|
+
contentHash: string;
|
|
393
|
+
compilerVersion: string;
|
|
394
|
+
schemaVersion: string;
|
|
395
|
+
};
|
|
396
|
+
/** Caller-supplied correlation ID grouping related events across a workflow */
|
|
397
|
+
correlationId?: string;
|
|
398
|
+
/** Caller-supplied ID of the event/command that caused this emission */
|
|
399
|
+
causationId?: string;
|
|
400
|
+
/** Zero-based index of this event within the current runCommand invocation. Per-command only. */
|
|
401
|
+
emitIndex?: number;
|
|
402
|
+
}
|
|
403
|
+
export interface SagaStepResult {
|
|
404
|
+
step: string;
|
|
405
|
+
command: string;
|
|
406
|
+
/**
|
|
407
|
+
* - `completed` — forward command succeeded
|
|
408
|
+
* - `failed` — forward command failed (the step that triggered compensation)
|
|
409
|
+
* - `compensated` — forward command was successfully reversed by its compensation
|
|
410
|
+
* - `compensation_failed` — a compensation was attempted but failed its guard/policy or threw;
|
|
411
|
+
* the step is NOT considered reversed (potential dangling state)
|
|
412
|
+
* - `skipped` — completed step had no compensation declared (nothing to reverse)
|
|
413
|
+
*/
|
|
414
|
+
status: 'completed' | 'failed' | 'compensated' | 'compensation_failed' | 'skipped';
|
|
415
|
+
result?: CommandResult;
|
|
416
|
+
compensation?: CommandResult;
|
|
417
|
+
error?: string;
|
|
418
|
+
}
|
|
419
|
+
export interface SagaResult {
|
|
420
|
+
saga: string;
|
|
421
|
+
success: boolean;
|
|
422
|
+
status: 'completed' | 'compensated' | 'aborted';
|
|
423
|
+
steps: SagaStepResult[];
|
|
424
|
+
emittedEvents: EmittedEvent[];
|
|
425
|
+
failedStep?: string;
|
|
426
|
+
error?: string;
|
|
427
|
+
}
|
|
428
|
+
export interface Store<T extends EntityInstance = EntityInstance> {
|
|
429
|
+
getAll(): Promise<T[]>;
|
|
430
|
+
getById(id: string): Promise<T | undefined>;
|
|
431
|
+
create(data: Partial<T>): Promise<T>;
|
|
432
|
+
update(id: string, data: Partial<T>): Promise<T | undefined>;
|
|
433
|
+
delete(id: string): Promise<boolean>;
|
|
434
|
+
clear(): Promise<void>;
|
|
435
|
+
}
|
|
436
|
+
export interface IdempotencyStore {
|
|
437
|
+
/** Check if a command with this key has already been executed */
|
|
438
|
+
has(key: string): Promise<boolean>;
|
|
439
|
+
/** Record a command result for an idempotency key */
|
|
440
|
+
set(key: string, result: CommandResult): Promise<void>;
|
|
441
|
+
/** Retrieve the cached result for an idempotency key */
|
|
442
|
+
get(key: string): Promise<CommandResult | undefined>;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Thrown when an adapter action (persist/publish/effect) is executed in deterministicMode.
|
|
446
|
+
* This is a programming error, not a domain failure.
|
|
447
|
+
* See docs/spec/adapters.md for the normative exception to default no-op behavior.
|
|
448
|
+
*/
|
|
449
|
+
export declare class ManifestEffectBoundaryError extends Error {
|
|
450
|
+
readonly actionKind: string;
|
|
451
|
+
constructor(actionKind: string);
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Thrown when reaction cascading exceeds the maximum depth (default: 10).
|
|
455
|
+
* Indicates a potential infinite loop in reaction chains.
|
|
456
|
+
* See docs/spec/semantics.md § "Reactions".
|
|
457
|
+
*/
|
|
458
|
+
export declare class ManifestReactionDepthError extends Error {
|
|
459
|
+
readonly depth: number;
|
|
460
|
+
readonly triggerEvent: string;
|
|
461
|
+
readonly targetCommand: string;
|
|
462
|
+
constructor(depth: number, triggerEvent: string, targetCommand: string);
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* In-memory JobQueue implementation for async commands.
|
|
466
|
+
* Suitable for testing and development. Production deployments should
|
|
467
|
+
* provide a durable implementation (e.g. database-backed).
|
|
468
|
+
*/
|
|
469
|
+
export declare class MemoryJobQueue implements JobQueue {
|
|
470
|
+
private jobs;
|
|
471
|
+
enqueue(job: JobRecord): Promise<void>;
|
|
472
|
+
drainPending(): Promise<JobRecord[]>;
|
|
473
|
+
updateStatus(jobId: string, status: JobRecord['status'], detail?: {
|
|
474
|
+
result?: unknown;
|
|
475
|
+
error?: string;
|
|
476
|
+
}): Promise<void>;
|
|
477
|
+
/** Test utility: get all jobs */
|
|
478
|
+
getAll(): JobRecord[];
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Thrown when expression evaluation exceeds configured depth or step limits.
|
|
482
|
+
* This is a domain failure (caught and converted to CommandResult), not a programming error.
|
|
483
|
+
* See docs/spec/manifest-vnext.md § "Diagnostic Payload Bounding".
|
|
484
|
+
*/
|
|
485
|
+
export declare class EvaluationBudgetExceededError extends Error {
|
|
486
|
+
readonly limitType: 'depth' | 'steps';
|
|
487
|
+
readonly limit: number;
|
|
488
|
+
constructor(limitType: 'depth' | 'steps', limit: number);
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Optional complexity limits for expression evaluation.
|
|
492
|
+
* Defaults are permissive — no existing programs should be affected.
|
|
493
|
+
*/
|
|
494
|
+
export interface EvaluationLimits {
|
|
495
|
+
/** Maximum expression nesting depth. Default: 64 */
|
|
496
|
+
maxExpressionDepth?: number;
|
|
497
|
+
/** Maximum total evaluation steps per entry point. Default: 10_000 */
|
|
498
|
+
maxEvaluationSteps?: number;
|
|
499
|
+
}
|
|
500
|
+
type EventListener = (event: EmittedEvent) => void;
|
|
501
|
+
export interface ProvenanceVerificationResult {
|
|
502
|
+
valid: boolean;
|
|
503
|
+
expectedHash?: string;
|
|
504
|
+
computedHash?: string;
|
|
505
|
+
error?: string;
|
|
506
|
+
}
|
|
507
|
+
export declare class RuntimeEngine {
|
|
508
|
+
private ir;
|
|
509
|
+
private context;
|
|
510
|
+
private options;
|
|
511
|
+
private stores;
|
|
512
|
+
private eventListeners;
|
|
513
|
+
private eventLog;
|
|
514
|
+
/** Current reaction nesting depth to prevent infinite loops */
|
|
515
|
+
private reactionDepth;
|
|
516
|
+
private static readonly MAX_REACTION_DEPTH;
|
|
517
|
+
/** Index of relationships for efficient lookup during expression evaluation */
|
|
518
|
+
private relationshipIndex;
|
|
519
|
+
/** Memoization cache for resolved relationships to avoid repeated store queries */
|
|
520
|
+
private relationshipMemoCache;
|
|
521
|
+
/** Index of roles by name for O(1) permission checks */
|
|
522
|
+
private roleIndex;
|
|
523
|
+
/** Track whether version has been incremented for the current command execution */
|
|
524
|
+
private versionIncrementedForCommand;
|
|
525
|
+
/** Track instances that were just created (to prevent version increment on subsequent mutate actions) */
|
|
526
|
+
private justCreatedInstanceIds;
|
|
527
|
+
/**
|
|
528
|
+
* Command-scoped write buffer. While set, mutate/compute actions apply their
|
|
529
|
+
* changes to an in-memory working copy (`instance`) and accumulate a single
|
|
530
|
+
* store-form `patch` instead of issuing one store read + write per action.
|
|
531
|
+
* The buffer is flushed in one `store.update` at the end of the action loop,
|
|
532
|
+
* then cleared — so a command that mutates N fields performs one read and one
|
|
533
|
+
* write rather than N. Scoped to the command's target instance only; nested
|
|
534
|
+
* (reaction/fan-out) commands save and restore the outer buffer.
|
|
535
|
+
*/
|
|
536
|
+
private commandBuffer;
|
|
537
|
+
/** Last transition validation error (set by updateInstance, checked by _executeCommandInternal) */
|
|
538
|
+
private lastTransitionError;
|
|
539
|
+
/** Last concurrency conflict (set by updateInstance, checked by _executeCommandInternal) */
|
|
540
|
+
private lastConcurrencyConflict;
|
|
541
|
+
/** Per-engine sliding-window rate limiter (in-memory; durable store is a follow-up) */
|
|
542
|
+
private rateLimiter;
|
|
543
|
+
private readonly profilingBridge;
|
|
544
|
+
private actionTraceCounter;
|
|
545
|
+
/**
|
|
546
|
+
* In-process approval request cache, keyed by
|
|
547
|
+
* `${entity}:${instanceId}:${approvalName}`. Always maintained as a mirror
|
|
548
|
+
* so the synchronous `getApprovalRequest`/`expireApprovals` accessors work.
|
|
549
|
+
* When `options.approvalStore` is set, that store is the source of truth and
|
|
550
|
+
* this Map is just a write-through mirror; otherwise this Map IS the store.
|
|
551
|
+
*/
|
|
552
|
+
private approvalRequests;
|
|
553
|
+
/**
|
|
554
|
+
* Load an approval request, preferring the durable store when configured.
|
|
555
|
+
* Refreshes the in-process mirror so synchronous accessors stay coherent.
|
|
556
|
+
*/
|
|
557
|
+
private loadApprovalState;
|
|
558
|
+
/**
|
|
559
|
+
* Persist an approval request to the durable store (when configured) and
|
|
560
|
+
* always mirror it in-process so a later synchronous read sees it.
|
|
561
|
+
*/
|
|
562
|
+
private saveApprovalState;
|
|
563
|
+
/** Per-entry-point evaluation budget for bounded complexity enforcement */
|
|
564
|
+
private evalBudget;
|
|
565
|
+
/** Cache for computed property values, keyed by "entityName:instanceId:propertyName" */
|
|
566
|
+
private computedPropertyCache;
|
|
567
|
+
/** Request-scoped cache for computed properties (cleared per command) */
|
|
568
|
+
private computedPropertyRequestCache;
|
|
569
|
+
/**
|
|
570
|
+
* Initialize evaluation budget if not already active (re-entrant safe).
|
|
571
|
+
* Returns true if this call initialized the budget (caller must clear it in finally).
|
|
572
|
+
* Returns false if budget was already active (caller should NOT clear it).
|
|
573
|
+
*/
|
|
574
|
+
private initEvalBudget;
|
|
575
|
+
/** Clear evaluation budget (only call if initEvalBudget returned true) */
|
|
576
|
+
private clearEvalBudget;
|
|
577
|
+
/**
|
|
578
|
+
* Returns the set of property names marked `encrypted` for the given entity.
|
|
579
|
+
* Cached per entity name since IR is immutable at runtime.
|
|
580
|
+
*/
|
|
581
|
+
private encryptedPropertyNamesCache;
|
|
582
|
+
private encryptedPropertyNames;
|
|
583
|
+
/**
|
|
584
|
+
* Encrypt property values before a store write.
|
|
585
|
+
* Returns a shallow copy with encrypted fields replaced by envelope JSON.
|
|
586
|
+
* No-op when encryptionProvider is not configured or entity has no encrypted fields.
|
|
587
|
+
*/
|
|
588
|
+
private encryptProperties;
|
|
589
|
+
/**
|
|
590
|
+
* Decrypt property values after a store read.
|
|
591
|
+
* Returns a shallow copy with encrypted envelope JSON replaced by plaintext.
|
|
592
|
+
* No-op when encryptionProvider is not configured or entity has no encrypted fields.
|
|
593
|
+
*/
|
|
594
|
+
private decryptProperties;
|
|
595
|
+
/**
|
|
596
|
+
* Resolve the active tenant value from runtime context using the IR tenant
|
|
597
|
+
* config's contextPath. Returns undefined when no tenant declaration exists
|
|
598
|
+
* in the IR or the context lacks the value.
|
|
599
|
+
*/
|
|
600
|
+
private resolveTenantValue;
|
|
601
|
+
constructor(ir: IR, context?: RuntimeContext, options?: RuntimeOptions);
|
|
602
|
+
private initializeStores;
|
|
603
|
+
/**
|
|
604
|
+
* Build an index of all relationships for efficient lookup during expression evaluation.
|
|
605
|
+
* Maps "EntityName.relationshipName" to relationship metadata.
|
|
606
|
+
*/
|
|
607
|
+
private buildRelationshipIndex;
|
|
608
|
+
private buildRoleIndex;
|
|
609
|
+
/**
|
|
610
|
+
* Check if a role has a specific permission.
|
|
611
|
+
* Uses precomputed effectivePermissions for O(1) lookup.
|
|
612
|
+
* Unknown role → false (no permissive default, per house style).
|
|
613
|
+
*/
|
|
614
|
+
private roleHasPermission;
|
|
615
|
+
/**
|
|
616
|
+
* Clear the relationship memoization cache.
|
|
617
|
+
* Called at the start of each command execution to ensure fresh data.
|
|
618
|
+
*/
|
|
619
|
+
private clearMemoCache;
|
|
620
|
+
/**
|
|
621
|
+
* Resolve a relationship for a given instance.
|
|
622
|
+
* Uses memoization cache to avoid repeated store queries within a single command execution.
|
|
623
|
+
* @param entityName - The source entity name
|
|
624
|
+
* @param instance - The source instance (must have an id)
|
|
625
|
+
* @param relationshipName - The relationship name to resolve
|
|
626
|
+
* @returns For hasMany: array of related instances; for hasOne/belongsTo/ref: single instance or null
|
|
627
|
+
*/
|
|
628
|
+
private resolveRelationship;
|
|
629
|
+
private getNow;
|
|
630
|
+
/**
|
|
631
|
+
* Generate a unique identifier for runtime-internal records (audit
|
|
632
|
+
* records, outbox entry ids). Uses the caller-supplied generator from
|
|
633
|
+
* RuntimeOptions when present; otherwise falls back to crypto.randomUUID.
|
|
634
|
+
* Distinct from `getBuiltins().uuid` only by intent — keeping a named
|
|
635
|
+
* helper avoids leaking the fallback chain across call sites.
|
|
636
|
+
*/
|
|
637
|
+
private nextRuntimeId;
|
|
638
|
+
private getBuiltins;
|
|
639
|
+
getIR(): IR;
|
|
640
|
+
/**
|
|
641
|
+
* Get the provenance metadata from the IR
|
|
642
|
+
*/
|
|
643
|
+
getProvenance(): IRProvenance | undefined;
|
|
644
|
+
/**
|
|
645
|
+
* Log provenance information at startup
|
|
646
|
+
* This can be called by UI code to display provenance
|
|
647
|
+
*/
|
|
648
|
+
logProvenance(): void;
|
|
649
|
+
/**
|
|
650
|
+
* Verify the IR integrity by checking that the computed hash matches the expected hash.
|
|
651
|
+
* Returns true if verification passes, false otherwise.
|
|
652
|
+
*
|
|
653
|
+
* @param expectedHash - Optional expected hash. If not provided, uses the IR's self-reported irHash
|
|
654
|
+
* @returns true if hash matches or if no hash is available to verify
|
|
655
|
+
*/
|
|
656
|
+
verifyIRHash(expectedHash?: string): Promise<boolean>;
|
|
657
|
+
/**
|
|
658
|
+
* Verify IR and throw if invalid. Use this when requireValidProvenance is true.
|
|
659
|
+
* @throws Error if IR hash verification fails
|
|
660
|
+
*/
|
|
661
|
+
assertValidProvenance(): Promise<void>;
|
|
662
|
+
getContext(): RuntimeContext;
|
|
663
|
+
setContext(ctx: Partial<RuntimeContext>): void;
|
|
664
|
+
replaceContext(ctx: RuntimeContext): void;
|
|
665
|
+
getEntities(): IREntity[];
|
|
666
|
+
getEntity(name: string): IREntity | undefined;
|
|
667
|
+
getCommands(): IRCommand[];
|
|
668
|
+
getCommand(name: string, entityName?: string): IRCommand | undefined;
|
|
669
|
+
getPolicies(): IRPolicy[];
|
|
670
|
+
/** Return all schedule declarations from the compiled IR. */
|
|
671
|
+
getSchedules(): IRSchedule[];
|
|
672
|
+
/**
|
|
673
|
+
* Run a named schedule: evaluate bound params and dispatch the target command.
|
|
674
|
+
* Sets context.source to 'schedule' and context.scheduleName for the invocation.
|
|
675
|
+
*/
|
|
676
|
+
runSchedule(scheduleName: string, options?: {
|
|
677
|
+
correlationId?: string;
|
|
678
|
+
causationId?: string;
|
|
679
|
+
}): Promise<CommandResult>;
|
|
680
|
+
getStore(entityName: string): Store | undefined;
|
|
681
|
+
/**
|
|
682
|
+
* Get collected command profiles when profiling is enabled.
|
|
683
|
+
* Returns an empty array when profiling is not configured.
|
|
684
|
+
*/
|
|
685
|
+
getProfiles(): import('./profiling').CommandProfile[];
|
|
686
|
+
/**
|
|
687
|
+
* Execute middleware registered for a given hook.
|
|
688
|
+
* Returns a short-circuit result if any middleware short-circuits,
|
|
689
|
+
* or undefined to continue normal execution.
|
|
690
|
+
*/
|
|
691
|
+
private runMiddleware;
|
|
692
|
+
/**
|
|
693
|
+
* Public read surface: tenant filter → decrypt → mask (read-projection only).
|
|
694
|
+
* Execution paths (guards, actions, policies, computed properties, relationship
|
|
695
|
+
* resolution) use getAllInstancesRaw and always see real values.
|
|
696
|
+
*/
|
|
697
|
+
getAllInstances(entityName: string): Promise<EntityInstance[]>;
|
|
698
|
+
/** Internal read path: tenant filter + decryption, NO masking. */
|
|
699
|
+
private getAllInstancesRaw;
|
|
700
|
+
/**
|
|
701
|
+
* Public read surface: tenant filter → decrypt → mask (read-projection only).
|
|
702
|
+
* Execution paths use getInstanceRaw and always see real values.
|
|
703
|
+
*/
|
|
704
|
+
getInstance(entityName: string, id: string): Promise<EntityInstance | undefined>;
|
|
705
|
+
/** Internal read path: tenant filter + decryption, NO masking. */
|
|
706
|
+
private getInstanceRaw;
|
|
707
|
+
/** Cache of properties carrying maskStrategy, per entity (IR is immutable at runtime). */
|
|
708
|
+
private maskedPropertiesCache;
|
|
709
|
+
private maskedProperties;
|
|
710
|
+
/**
|
|
711
|
+
* Apply read-time masking to an instance (after decryption and tenant filtering).
|
|
712
|
+
* - `private` wins over `masked`: the property is excluded entirely.
|
|
713
|
+
* - `null`/`undefined` pass through unmasked.
|
|
714
|
+
* - `unmaskWhen` falsy or throwing ⇒ value stays masked (secure by default).
|
|
715
|
+
* An evaluation error additionally surfaces a diagnostic; it never changes
|
|
716
|
+
* the masked outcome (diagnostics explain, never compensate).
|
|
717
|
+
*/
|
|
718
|
+
private applyMasking;
|
|
719
|
+
/**
|
|
720
|
+
* Check entity constraints against instance data
|
|
721
|
+
* Returns array of constraint failures (empty if all pass)
|
|
722
|
+
* Useful for diagnostic purposes without mutating state
|
|
723
|
+
*/
|
|
724
|
+
checkConstraints(entityName: string, data: Record<string, unknown>): Promise<ConstraintOutcome[]>;
|
|
725
|
+
/**
|
|
726
|
+
* Evaluate all entity constraints against instance data, returning every outcome
|
|
727
|
+
* (both passed and failed). Useful for diagnostic UIs that show full constraint status.
|
|
728
|
+
*/
|
|
729
|
+
evaluateAllConstraints(entityName: string, data: Record<string, unknown>): Promise<ConstraintOutcome[]>;
|
|
730
|
+
createInstance(entityName: string, data: Partial<EntityInstance>): Promise<EntityInstance | undefined>;
|
|
731
|
+
private prepareCreateData;
|
|
732
|
+
private reportConstraintOutcomes;
|
|
733
|
+
private createInstanceWithOutcomes;
|
|
734
|
+
/** Date/time primitive write-time validation (docs/spec/semantics.md, Date/Time Types). */
|
|
735
|
+
private validateDateTimeTypes;
|
|
736
|
+
private persistPreparedCreate;
|
|
737
|
+
updateInstance(entityName: string, id: string, data: Partial<EntityInstance>): Promise<EntityInstance | undefined>;
|
|
738
|
+
/**
|
|
739
|
+
* Mark cached computed properties as stale when their dependencies are mutated.
|
|
740
|
+
* Scans the entity's computed properties for any that depend on the changed properties,
|
|
741
|
+
* and sets their cache entries' stale flag to true. Handles transitive staleness.
|
|
742
|
+
*/
|
|
743
|
+
private markComputedPropertiesStale;
|
|
744
|
+
deleteInstance(entityName: string, id: string): Promise<boolean>;
|
|
745
|
+
runCommand(commandName: string, input: Record<string, unknown>, options?: {
|
|
746
|
+
entityName?: string;
|
|
747
|
+
instanceId?: string;
|
|
748
|
+
overrideRequests?: OverrideRequest[];
|
|
749
|
+
/** Correlation ID for workflow event grouping */
|
|
750
|
+
correlationId?: string;
|
|
751
|
+
/** Causation ID linking this command to its trigger */
|
|
752
|
+
causationId?: string;
|
|
753
|
+
/** Caller-provided idempotency key for dedup. Required if idempotencyStore is configured. */
|
|
754
|
+
idempotencyKey?: string;
|
|
755
|
+
}): Promise<CommandResult>;
|
|
756
|
+
/**
|
|
757
|
+
* Execute a saga: run steps in declaration order, compensating completed
|
|
758
|
+
* steps in reverse order on failure (when onFailure === 'compensate').
|
|
759
|
+
* Each step dispatches via `runCommand` — all policies, guards, and
|
|
760
|
+
* constraints of the step's command still apply.
|
|
761
|
+
*/
|
|
762
|
+
runSaga(sagaName: string, stepInputs?: Record<string, {
|
|
763
|
+
input?: Record<string, unknown>;
|
|
764
|
+
instanceId?: string;
|
|
765
|
+
}>, options?: {
|
|
766
|
+
correlationId?: string;
|
|
767
|
+
}): Promise<SagaResult>;
|
|
768
|
+
/**
|
|
769
|
+
* Compensate completed saga steps in reverse order (best-effort).
|
|
770
|
+
* Compensation failures are recorded but do not throw — all remaining
|
|
771
|
+
* compensations still execute.
|
|
772
|
+
*/
|
|
773
|
+
private compensateSagaSteps;
|
|
774
|
+
/**
|
|
775
|
+
* Emit a saga lifecycle event (SagaStarted, SagaCompleted, SagaFailed,
|
|
776
|
+
* SagaStepCompleted) only if declared in the saga's `emits` array.
|
|
777
|
+
*/
|
|
778
|
+
private emitSagaLifecycle;
|
|
779
|
+
/**
|
|
780
|
+
* Map a CommandResult and any thrown error into a CommandOutcome for the
|
|
781
|
+
* AuditRecord. The mapping mirrors the exit paths inside runCommand and
|
|
782
|
+
* _executeCommandInternal — keep them in lock-step when adding new
|
|
783
|
+
* failure modes.
|
|
784
|
+
*/
|
|
785
|
+
private classifyOutcome;
|
|
786
|
+
/**
|
|
787
|
+
* Build and emit a single AuditRecord through the configured sink.
|
|
788
|
+
* Sink errors are caught and logged — audit emission MUST NOT alter
|
|
789
|
+
* command-execution behavior. This is the documented fail-open policy
|
|
790
|
+
* (see docs/spec/adapters.md § "Audit Sink").
|
|
791
|
+
*/
|
|
792
|
+
private emitAudit;
|
|
793
|
+
/**
|
|
794
|
+
* Enqueue emitted events into the configured OutboxStore as a batch.
|
|
795
|
+
* Wraps the call in try/catch and logs failures — outbox failures MUST
|
|
796
|
+
* NOT alter the CommandResult shape callers already received.
|
|
797
|
+
*
|
|
798
|
+
* Non-transactional caveat: the in-memory runtime does not yet expose a
|
|
799
|
+
* shared transaction boundary, so a successful command followed by an
|
|
800
|
+
* outbox enqueue failure leaves state mutated without an outbox row.
|
|
801
|
+
* Durable adapters MUST honor the `tx` parameter and enqueue inside the
|
|
802
|
+
* same transaction that mutated state.
|
|
803
|
+
*/
|
|
804
|
+
private enqueueOutbox;
|
|
805
|
+
/**
|
|
806
|
+
* Validate an async command synchronously (policies, constraints, guards)
|
|
807
|
+
* without executing actions. Used for fail-fast before enqueuing a job.
|
|
808
|
+
*/
|
|
809
|
+
private _validateAsyncCommand;
|
|
810
|
+
/**
|
|
811
|
+
* Drain all pending jobs from the job queue and execute them.
|
|
812
|
+
* Returns an array of CommandResults, one per drained job.
|
|
813
|
+
* For deterministic testing: executes jobs synchronously in FIFO order.
|
|
814
|
+
*
|
|
815
|
+
* For each job:
|
|
816
|
+
* - Sets context.source = 'job' to bypass the async enqueue branch
|
|
817
|
+
* - Executes the full command body (actions + emits)
|
|
818
|
+
* - Emits completion or failure event on the synthesized channel
|
|
819
|
+
* - Updates job status in the queue
|
|
820
|
+
*/
|
|
821
|
+
drainJobs(): Promise<CommandResult[]>;
|
|
822
|
+
private _executeCommandInternal;
|
|
823
|
+
private buildEvalContext;
|
|
824
|
+
private checkPolicies;
|
|
825
|
+
/**
|
|
826
|
+
* Validate entity constraints against instance data
|
|
827
|
+
* Returns array of constraint failures (empty if all pass)
|
|
828
|
+
*
|
|
829
|
+
* Constraint semantics:
|
|
830
|
+
* - Expression evaluates to TRUE → condition is met → constraint PASSES
|
|
831
|
+
* - Expression evaluates to FALSE → condition is not met → constraint FAILS
|
|
832
|
+
*
|
|
833
|
+
* Severity affects what gets reported as failures:
|
|
834
|
+
* - severity='block': Failed constraints are returned as failures (block execution)
|
|
835
|
+
* - severity='warn': Failed constraints are NOT returned as failures (informational only)
|
|
836
|
+
* - severity='ok': Failed constraints are NOT returned as failures (informational only)
|
|
837
|
+
*
|
|
838
|
+
* CONSTRAINT SEMANTICS (vNext hybrid support):
|
|
839
|
+
* - Positive constraints (default): Expression describes what MUST be true for validity
|
|
840
|
+
* - When FALSE → constraint FAILS (e.g., "amount >= 0" fails when amount = -1)
|
|
841
|
+
* - When TRUE → constraint PASSES
|
|
842
|
+
* - Negative constraints (detected by "severity" prefix): Expression describes BAD state
|
|
843
|
+
* - When TRUE → constraint FIRES (e.g., "status == 'cancelled'" fires when cancelled)
|
|
844
|
+
* - When FALSE → constraint PASSES (no bad state present)
|
|
845
|
+
*/
|
|
846
|
+
private validateConstraints;
|
|
847
|
+
private extractContextKeys;
|
|
848
|
+
private formatExpression;
|
|
849
|
+
private formatValue;
|
|
850
|
+
private resolveExpressionValues;
|
|
851
|
+
private notifyActionTrace;
|
|
852
|
+
private executeAction;
|
|
853
|
+
evaluateExpression(expr: IRExpression, context: Record<string, unknown>): Promise<unknown>;
|
|
854
|
+
/**
|
|
855
|
+
* Check whether an expression can be safely evaluated by the WASM module.
|
|
856
|
+
* Pure computational expressions (no entity relationships, no async effects)
|
|
857
|
+
* are compatible. The check is conservative — when in doubt, return false
|
|
858
|
+
* to ensure the TypeScript evaluator is used.
|
|
859
|
+
*/
|
|
860
|
+
private isWasmCompatible;
|
|
861
|
+
private evaluateBinaryOp;
|
|
862
|
+
private evaluateUnaryOp;
|
|
863
|
+
private irValueToJs;
|
|
864
|
+
private getDefaultForType;
|
|
865
|
+
evaluateComputed(entityName: string, instanceId: string, propertyName: string): Promise<unknown>;
|
|
866
|
+
/**
|
|
867
|
+
* Evaluate a computed property and return metadata including cache status and staleness.
|
|
868
|
+
* Returns { value, stale, cached } or undefined if the entity/property/instance doesn't exist.
|
|
869
|
+
*/
|
|
870
|
+
evaluateComputedWithMeta(entityName: string, instanceId: string, propertyName: string): Promise<{
|
|
871
|
+
value: unknown;
|
|
872
|
+
stale: boolean;
|
|
873
|
+
cached: boolean;
|
|
874
|
+
} | undefined>;
|
|
875
|
+
/**
|
|
876
|
+
* Look up a cached computed property value based on the configured cache strategy.
|
|
877
|
+
* Returns the cache entry if valid, or undefined if cache miss or expired.
|
|
878
|
+
*/
|
|
879
|
+
private getCachedComputedValue;
|
|
880
|
+
/**
|
|
881
|
+
* Store a computed property value in the appropriate cache based on strategy.
|
|
882
|
+
*/
|
|
883
|
+
private setCachedComputedValue;
|
|
884
|
+
private evaluateComputedInternal;
|
|
885
|
+
/**
|
|
886
|
+
* vNext: Interpolate template placeholders with values from context
|
|
887
|
+
* Supports {placeholder} syntax where placeholders are resolved from:
|
|
888
|
+
* 1. details mapping (if present)
|
|
889
|
+
* 2. resolved expression values (by expression string)
|
|
890
|
+
* 3. evaluation context (direct property access)
|
|
891
|
+
*/
|
|
892
|
+
private interpolateTemplate;
|
|
893
|
+
/**
|
|
894
|
+
* vNext: Evaluate a single constraint and return detailed outcome
|
|
895
|
+
*/
|
|
896
|
+
private evaluateConstraint;
|
|
897
|
+
/**
|
|
898
|
+
* vNext: Evaluate command constraints with override support
|
|
899
|
+
* Returns allowed flag, all constraint outcomes, and any OverrideApplied events.
|
|
900
|
+
* Per spec (manifest-vnext.md § OverrideApplied Event Shape):
|
|
901
|
+
* OverrideApplied events MUST be included in CommandResult.emittedEvents.
|
|
902
|
+
*/
|
|
903
|
+
private evaluateCommandConstraints;
|
|
904
|
+
/**
|
|
905
|
+
* vNext: Validate override authorization via policy or default admin check
|
|
906
|
+
*/
|
|
907
|
+
private validateOverrideAuthorization;
|
|
908
|
+
/**
|
|
909
|
+
* vNext: Build OverrideApplied event for auditing.
|
|
910
|
+
* Per spec (manifest-vnext.md § OverrideApplied Event Shape):
|
|
911
|
+
* payload MUST contain: constraintCode, reason, authorizedBy, timestamp, commandName,
|
|
912
|
+
* and optionally entityName, instanceId.
|
|
913
|
+
* The event is a runtime-synthesized event included in CommandResult.emittedEvents.
|
|
914
|
+
*/
|
|
915
|
+
private buildOverrideAppliedEvent;
|
|
916
|
+
/**
|
|
917
|
+
* vNext: Emit ConcurrencyConflict event
|
|
918
|
+
*/
|
|
919
|
+
private emitConcurrencyConflictEvent;
|
|
920
|
+
/**
|
|
921
|
+
* vNext: Get provenance info for events
|
|
922
|
+
*/
|
|
923
|
+
private getProvenanceInfo;
|
|
924
|
+
onEvent(listener: EventListener): () => void;
|
|
925
|
+
/**
|
|
926
|
+
* Subscribe to events for a single entity (docs/spec/semantics.md,
|
|
927
|
+
* "Realtime Entities"). Convenience over onEvent: the listener receives
|
|
928
|
+
* only events whose `subject.entity === entityName`. Events WITHOUT a
|
|
929
|
+
* subject entity are NOT delivered — use onEvent for the unfiltered
|
|
930
|
+
* firehose. Returns an unsubscribe function. Exists regardless of any
|
|
931
|
+
* entity's `realtime` flag (the flag is a projection hint only).
|
|
932
|
+
*/
|
|
933
|
+
subscribe(entityName: string, listener: EventListener): () => void;
|
|
934
|
+
private notifyListeners;
|
|
935
|
+
getEventLog(): EmittedEvent[];
|
|
936
|
+
clearEventLog(): void;
|
|
937
|
+
serialize(): Promise<{
|
|
938
|
+
ir: IR;
|
|
939
|
+
context: RuntimeContext;
|
|
940
|
+
stores: Record<string, EntityInstance[]>;
|
|
941
|
+
}>;
|
|
942
|
+
restore(data: {
|
|
943
|
+
stores: Record<string, EntityInstance[]>;
|
|
944
|
+
}): Promise<void>;
|
|
945
|
+
/**
|
|
946
|
+
* Static factory method to create a RuntimeEngine with optional provenance verification.
|
|
947
|
+
* This is useful when you want to verify IR integrity before execution.
|
|
948
|
+
*
|
|
949
|
+
* In production mode (NODE_ENV=production), provenance verification is enabled by default.
|
|
950
|
+
* Set `requireValidProvenance: false` to explicitly disable.
|
|
951
|
+
*
|
|
952
|
+
* @param ir - The IR to execute
|
|
953
|
+
* @param context - Runtime context (user, etc.)
|
|
954
|
+
* @param options - Runtime options including requireValidProvenance
|
|
955
|
+
* @returns A tuple of [runtime, verificationResult]
|
|
956
|
+
*
|
|
957
|
+
* @example
|
|
958
|
+
* ```ts
|
|
959
|
+
* // Production: verification enabled by default
|
|
960
|
+
* const [runtime, result] = await RuntimeEngine.create(ir, context);
|
|
961
|
+
* if (!result.valid) {
|
|
962
|
+
* throw new Error(`Invalid IR: ${result.error}`);
|
|
963
|
+
* }
|
|
964
|
+
*
|
|
965
|
+
* // Development: explicitly disable verification
|
|
966
|
+
* const [runtime] = await RuntimeEngine.create(ir, context, { requireValidProvenance: false });
|
|
967
|
+
* ```
|
|
968
|
+
*/
|
|
969
|
+
/**
|
|
970
|
+
* Build an approval-request key for the Map.
|
|
971
|
+
*/
|
|
972
|
+
private approvalKey;
|
|
973
|
+
/**
|
|
974
|
+
* Find approval declarations on an entity that gate a given command name.
|
|
975
|
+
*/
|
|
976
|
+
private findApprovalsForCommand;
|
|
977
|
+
/**
|
|
978
|
+
* Check the approval gate for a command. Returns a CommandResult (blocked)
|
|
979
|
+
* if the command requires approval that hasn't been granted yet, or
|
|
980
|
+
* undefined if the command may proceed.
|
|
981
|
+
*/
|
|
982
|
+
private checkApprovalGate;
|
|
983
|
+
/**
|
|
984
|
+
* Get the list of stages that still need approvals.
|
|
985
|
+
*/
|
|
986
|
+
private getPendingStages;
|
|
987
|
+
/**
|
|
988
|
+
* Request approval for a command on an entity instance.
|
|
989
|
+
* Creates or returns the existing approval request state.
|
|
990
|
+
*/
|
|
991
|
+
requestApproval(entityName: string, instanceId: string, approvalName: string): Promise<ApprovalRequestState>;
|
|
992
|
+
/**
|
|
993
|
+
* Grant approval for a specific stage. Evaluates the stage policy to verify
|
|
994
|
+
* the approver is authorized. When all required stages are satisfied, marks
|
|
995
|
+
* the approval as 'granted'.
|
|
996
|
+
*/
|
|
997
|
+
approveStage(entityName: string, instanceId: string, approvalName: string, stageName: string, approver: ApprovalApprover): Promise<ApprovalRequestState>;
|
|
998
|
+
/**
|
|
999
|
+
* Deny an approval request.
|
|
1000
|
+
*/
|
|
1001
|
+
denyApproval(entityName: string, instanceId: string, approvalName: string, deniedBy: string, reason?: string): Promise<ApprovalRequestState>;
|
|
1002
|
+
/**
|
|
1003
|
+
* Expire any pending approvals that have exceeded their timeout.
|
|
1004
|
+
* Approvals with `onTimeout: 'cancel'` are set to 'expired'.
|
|
1005
|
+
* Approvals with `onTimeout: 'escalate'` are flagged but kept pending (future).
|
|
1006
|
+
*
|
|
1007
|
+
* Operates on the in-process request set. In durable mode
|
|
1008
|
+
* (`options.approvalStore` configured), run set-based expiry across all
|
|
1009
|
+
* stored requests via `approvalStore.expire(now)` from a cron/worker; this
|
|
1010
|
+
* synchronous accessor only sees requests this engine has touched.
|
|
1011
|
+
*/
|
|
1012
|
+
expireApprovals(now?: number): ApprovalRequestState[];
|
|
1013
|
+
/**
|
|
1014
|
+
* Get the current approval request state for an entity instance.
|
|
1015
|
+
*/
|
|
1016
|
+
getApprovalRequest(entityName: string, instanceId: string, approvalName: string): ApprovalRequestState | undefined;
|
|
1017
|
+
static create(ir: IR, context?: RuntimeContext, options?: RuntimeOptions): Promise<[RuntimeEngine, ProvenanceVerificationResult]>;
|
|
1018
|
+
}
|
|
1019
|
+
//# sourceMappingURL=runtime-engine.d.ts.map
|