@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,798 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pydantic v2 projection for Manifest IR.
|
|
3
|
+
*
|
|
4
|
+
* Generates Pydantic BaseModel classes from IR entities and command parameters,
|
|
5
|
+
* with field validators, type annotations, and JSON schema export.
|
|
6
|
+
*
|
|
7
|
+
* Surfaces:
|
|
8
|
+
* - pydantic.entity → Entity BaseModel classes (one per entity or all)
|
|
9
|
+
* - pydantic.command → Command parameter models (one per command or all)
|
|
10
|
+
* - pydantic.models → All models (entities + commands) in one artifact
|
|
11
|
+
*
|
|
12
|
+
* Reuses constraint analysis from `src/manifest/constraint-analysis.ts`
|
|
13
|
+
* for field annotation generation (@field_validator, @model_validator).
|
|
14
|
+
*/
|
|
15
|
+
import { analyzeConstraints, } from '../../constraint-analysis.js';
|
|
16
|
+
// ============================================================================
|
|
17
|
+
// Type mapping
|
|
18
|
+
// ============================================================================
|
|
19
|
+
/** IR type name → Python/Pydantic type annotation. Unknown types fall through to 'Any'. */
|
|
20
|
+
const TYPE_MAP = {
|
|
21
|
+
string: 'str',
|
|
22
|
+
text: 'str',
|
|
23
|
+
boolean: 'bool',
|
|
24
|
+
bool: 'bool',
|
|
25
|
+
number: 'float',
|
|
26
|
+
float: 'float',
|
|
27
|
+
decimal: 'Decimal',
|
|
28
|
+
money: 'Decimal',
|
|
29
|
+
int: 'int',
|
|
30
|
+
integer: 'int',
|
|
31
|
+
bigint: 'int',
|
|
32
|
+
date: 'date',
|
|
33
|
+
datetime: 'datetime',
|
|
34
|
+
uuid: 'UUID',
|
|
35
|
+
email: 'str',
|
|
36
|
+
url: 'str',
|
|
37
|
+
uri: 'str',
|
|
38
|
+
json: 'dict[str, Any] | Any',
|
|
39
|
+
any: 'Any',
|
|
40
|
+
bytes: 'bytes',
|
|
41
|
+
object: 'dict[str, Any]',
|
|
42
|
+
};
|
|
43
|
+
/** Types that need Decimal import from decimal module */
|
|
44
|
+
const DECIMAL_TYPES = new Set(['decimal', 'money']);
|
|
45
|
+
/** Types that need UUID import from uuid module */
|
|
46
|
+
const UUID_TYPES = new Set(['uuid']);
|
|
47
|
+
/** Types that need date/datetime import from datetime module */
|
|
48
|
+
const DATETIME_TYPES = new Set(['date', 'datetime']);
|
|
49
|
+
// ============================================================================
|
|
50
|
+
// Helpers
|
|
51
|
+
// ============================================================================
|
|
52
|
+
/** Convert an IRType to a Python type annotation string, handling generics recursively. */
|
|
53
|
+
function irTypeToPython(type, diagnostics, imports) {
|
|
54
|
+
// Handle generic types first (array, map) before TYPE_MAP lookup
|
|
55
|
+
if (type.name === 'array' && type.generic) {
|
|
56
|
+
imports.needsTyping = true;
|
|
57
|
+
const inner = irTypeToPython(type.generic, diagnostics, imports);
|
|
58
|
+
return `list[${inner}]`;
|
|
59
|
+
}
|
|
60
|
+
if (type.name === 'map' && type.generic) {
|
|
61
|
+
imports.needsTyping = true;
|
|
62
|
+
const inner = irTypeToPython(type.generic, diagnostics, imports);
|
|
63
|
+
return `dict[str, ${inner}]`;
|
|
64
|
+
}
|
|
65
|
+
const base = TYPE_MAP[type.name];
|
|
66
|
+
if (base === undefined) {
|
|
67
|
+
diagnostics.push({
|
|
68
|
+
severity: 'warning',
|
|
69
|
+
code: 'PYDANTIC_UNKNOWN_TYPE',
|
|
70
|
+
message: `Unknown IR type "${type.name}", falling back to Any`,
|
|
71
|
+
});
|
|
72
|
+
return 'Any';
|
|
73
|
+
}
|
|
74
|
+
// Track imports needed
|
|
75
|
+
if (DATETIME_TYPES.has(type.name)) {
|
|
76
|
+
imports.needsDatetime = true;
|
|
77
|
+
}
|
|
78
|
+
if (UUID_TYPES.has(type.name)) {
|
|
79
|
+
imports.needsUuid = true;
|
|
80
|
+
}
|
|
81
|
+
if (DECIMAL_TYPES.has(type.name)) {
|
|
82
|
+
imports.needsDecimal = true;
|
|
83
|
+
}
|
|
84
|
+
if (type.name === 'json' || type.name === 'object' || type.name === 'any') {
|
|
85
|
+
imports.needsTyping = true;
|
|
86
|
+
}
|
|
87
|
+
return base;
|
|
88
|
+
}
|
|
89
|
+
/** Serialize an IRValue to a Python literal string. */
|
|
90
|
+
function irValueToPythonLiteral(value) {
|
|
91
|
+
switch (value.kind) {
|
|
92
|
+
case 'string':
|
|
93
|
+
return JSON.stringify(value.value);
|
|
94
|
+
case 'number':
|
|
95
|
+
return String(value.value);
|
|
96
|
+
case 'boolean':
|
|
97
|
+
return value.value ? 'True' : 'False';
|
|
98
|
+
case 'null':
|
|
99
|
+
return 'None';
|
|
100
|
+
case 'array':
|
|
101
|
+
return `[${value.elements.map(irValueToPythonLiteral).join(', ')}]`;
|
|
102
|
+
case 'object': {
|
|
103
|
+
const entries = Object.entries(value.properties)
|
|
104
|
+
.map(([k, v]) => `"${k}": ${irValueToPythonLiteral(v)}`);
|
|
105
|
+
return `{${entries.join(', ')}}`;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/** PascalCase conversion for model names. */
|
|
110
|
+
function pascalCase(name) {
|
|
111
|
+
// Handle snake_case and kebab-case
|
|
112
|
+
const words = name.replace(/-/g, '_').split('_');
|
|
113
|
+
return words.map(word => word.charAt(0).toUpperCase() + word.slice(1)).join('');
|
|
114
|
+
}
|
|
115
|
+
/** snake_case conversion for field names (Python convention). */
|
|
116
|
+
function snakeCase(name) {
|
|
117
|
+
// Convert camelCase to snake_case
|
|
118
|
+
return name
|
|
119
|
+
.replace(/([A-Z])/g, '_$1')
|
|
120
|
+
.toLowerCase()
|
|
121
|
+
.replace(/^_/, '');
|
|
122
|
+
}
|
|
123
|
+
// ============================================================================
|
|
124
|
+
// Constraint to Pydantic validator conversion
|
|
125
|
+
// ============================================================================
|
|
126
|
+
/** Generate field validator method for numeric range constraints. */
|
|
127
|
+
function numericRangeToValidator(range, fieldName) {
|
|
128
|
+
const parts = [];
|
|
129
|
+
if (range.min !== undefined && range.max !== undefined) {
|
|
130
|
+
parts.push(` if v < ${range.min} or v > ${range.max}:`);
|
|
131
|
+
parts.push(` raise ValueError('must be between ${range.min} and ${range.max}')`);
|
|
132
|
+
}
|
|
133
|
+
else if (range.min !== undefined) {
|
|
134
|
+
parts.push(` if v < ${range.min}:`);
|
|
135
|
+
parts.push(` raise ValueError('must be at least ${range.min}')`);
|
|
136
|
+
}
|
|
137
|
+
else if (range.max !== undefined) {
|
|
138
|
+
parts.push(` if v > ${range.max}:`);
|
|
139
|
+
parts.push(` raise ValueError('must be at most ${range.max}')`);
|
|
140
|
+
}
|
|
141
|
+
if (parts.length === 0)
|
|
142
|
+
return undefined;
|
|
143
|
+
const methodName = `validate_${snakeCase(fieldName)}`;
|
|
144
|
+
return [
|
|
145
|
+
``,
|
|
146
|
+
` @field_validator('${fieldName}')`,
|
|
147
|
+
` @classmethod`,
|
|
148
|
+
` def ${methodName}(cls, v: int) -> int:`,
|
|
149
|
+
...parts,
|
|
150
|
+
` return v`,
|
|
151
|
+
].join('\n');
|
|
152
|
+
}
|
|
153
|
+
/** Generate field validator method for length constraints. */
|
|
154
|
+
function lengthConstraintToValidator(lc, fieldName) {
|
|
155
|
+
const parts = [];
|
|
156
|
+
if (lc.minLength !== undefined && lc.maxLength !== undefined) {
|
|
157
|
+
parts.push(` if len(v) < ${lc.minLength} or len(v) > ${lc.maxLength}:`);
|
|
158
|
+
parts.push(` raise ValueError('length must be between ${lc.minLength} and ${lc.maxLength}')`);
|
|
159
|
+
}
|
|
160
|
+
else if (lc.minLength !== undefined) {
|
|
161
|
+
parts.push(` if len(v) < ${lc.minLength}:`);
|
|
162
|
+
parts.push(` raise ValueError('length must be at least ${lc.minLength}')`);
|
|
163
|
+
}
|
|
164
|
+
else if (lc.maxLength !== undefined) {
|
|
165
|
+
parts.push(` if len(v) > ${lc.maxLength}:`);
|
|
166
|
+
parts.push(` raise ValueError('length must be at most ${lc.maxLength}')`);
|
|
167
|
+
}
|
|
168
|
+
if (parts.length === 0)
|
|
169
|
+
return undefined;
|
|
170
|
+
const methodName = `validate_${snakeCase(fieldName)}_length`;
|
|
171
|
+
return [
|
|
172
|
+
``,
|
|
173
|
+
` @field_validator('${fieldName}')`,
|
|
174
|
+
` @classmethod`,
|
|
175
|
+
` def ${methodName}(cls, v: str) -> str:`,
|
|
176
|
+
...parts,
|
|
177
|
+
` return v`,
|
|
178
|
+
].join('\n');
|
|
179
|
+
}
|
|
180
|
+
/** Generate field validator method for pattern constraints. */
|
|
181
|
+
function patternConstraintToValidator(pc, fieldName) {
|
|
182
|
+
const methodName = `validate_${snakeCase(fieldName)}_pattern`;
|
|
183
|
+
// Use Python's re module
|
|
184
|
+
return [
|
|
185
|
+
``,
|
|
186
|
+
` @field_validator('${fieldName}')`,
|
|
187
|
+
` @classmethod`,
|
|
188
|
+
` def ${methodName}(cls, v: str) -> str:`,
|
|
189
|
+
` if not re.match(r'${pc.pattern}', v):`,
|
|
190
|
+
` raise ValueError('must match pattern: ${pc.pattern}')`,
|
|
191
|
+
` return v`,
|
|
192
|
+
].join('\n');
|
|
193
|
+
}
|
|
194
|
+
function generateEntityModel(entity, analysisOptions, diagnostics) {
|
|
195
|
+
const name = pascalCase(entity.name);
|
|
196
|
+
const lines = [];
|
|
197
|
+
const opts = normalizeOptions(analysisOptions);
|
|
198
|
+
const imports = {
|
|
199
|
+
needsDatetime: opts.emitDatetimeImports !== false,
|
|
200
|
+
needsTyping: opts.emitTypingImports !== false,
|
|
201
|
+
needsUuid: opts.emitUuidImport !== false,
|
|
202
|
+
needsDecimal: opts.emitDecimalImport !== false,
|
|
203
|
+
};
|
|
204
|
+
// Analyze constraints for this entity
|
|
205
|
+
const analysis = analyzeConstraints(entity.constraints);
|
|
206
|
+
// Build lookup: property name → constraint info
|
|
207
|
+
const numericConstraints = new Map();
|
|
208
|
+
for (const range of analysis.numericRanges) {
|
|
209
|
+
const prop = range.propertyPath.replace(/^self\./, '');
|
|
210
|
+
numericConstraints.set(prop, range);
|
|
211
|
+
}
|
|
212
|
+
const lengthConstraints = new Map();
|
|
213
|
+
for (const lc of analysis.lengthConstraints) {
|
|
214
|
+
const prop = lc.propertyPath.replace(/^self\./, '');
|
|
215
|
+
lengthConstraints.set(prop, lc);
|
|
216
|
+
}
|
|
217
|
+
const patternConstraints = new Map();
|
|
218
|
+
for (const pc of analysis.patternConstraints) {
|
|
219
|
+
const prop = pc.propertyPath.replace(/^self\./, '');
|
|
220
|
+
const existing = patternConstraints.get(prop) ?? [];
|
|
221
|
+
existing.push(pc);
|
|
222
|
+
patternConstraints.set(prop, existing);
|
|
223
|
+
}
|
|
224
|
+
// Class declaration
|
|
225
|
+
lines.push(`# Entity: ${entity.name}`);
|
|
226
|
+
lines.push(`class ${name}(BaseModel):`);
|
|
227
|
+
lines.push(` """${name} model from Manifest IR entity '${entity.name}'."""`);
|
|
228
|
+
lines.push('');
|
|
229
|
+
// Generate properties
|
|
230
|
+
for (const prop of entity.properties) {
|
|
231
|
+
const propResult = generatePropertyLine(prop, numericConstraints, lengthConstraints, patternConstraints, diagnostics, imports, opts);
|
|
232
|
+
lines.push(...propResult.lines.map(l => ' ' + l));
|
|
233
|
+
}
|
|
234
|
+
// Add validators after all fields
|
|
235
|
+
let needsRe = false;
|
|
236
|
+
// Process numeric range constraints
|
|
237
|
+
for (const [prop, constraint] of numericConstraints.entries()) {
|
|
238
|
+
const validator = numericRangeToValidator(constraint, prop);
|
|
239
|
+
if (validator) {
|
|
240
|
+
lines.push(validator.replace(/\n/g, '\n '));
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
// Process length constraints
|
|
244
|
+
for (const [prop, constraint] of lengthConstraints.entries()) {
|
|
245
|
+
const validator = lengthConstraintToValidator(constraint, prop);
|
|
246
|
+
if (validator) {
|
|
247
|
+
lines.push(validator.replace(/\n/g, '\n '));
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
// Process pattern constraints
|
|
251
|
+
for (const [prop, constraints] of patternConstraints.entries()) {
|
|
252
|
+
needsRe = true;
|
|
253
|
+
for (const pc of constraints) {
|
|
254
|
+
const validator = patternConstraintToValidator(pc, prop);
|
|
255
|
+
if (validator) {
|
|
256
|
+
lines.push(validator.replace(/\n/g, '\n '));
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
// Config class for JSON schema generation
|
|
261
|
+
if (opts.emitJsonSchema) {
|
|
262
|
+
lines.push('');
|
|
263
|
+
lines.push(' class Config:');
|
|
264
|
+
lines.push(' json_schema_extra = {"example": {}}');
|
|
265
|
+
}
|
|
266
|
+
// Computed properties
|
|
267
|
+
if (opts.emitComputedFields && entity.computedProperties.length > 0) {
|
|
268
|
+
lines.push('');
|
|
269
|
+
for (const cp of entity.computedProperties) {
|
|
270
|
+
const cpResult = generateComputedPropertyLine(cp, diagnostics, imports);
|
|
271
|
+
for (const line of cpResult) {
|
|
272
|
+
lines.push(' ' + line);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
// JSON schema export
|
|
277
|
+
if (opts.emitJsonSchema) {
|
|
278
|
+
lines.push('');
|
|
279
|
+
lines.push('');
|
|
280
|
+
lines.push(`# JSON Schema for ${name}`);
|
|
281
|
+
lines.push(`${name}JsonSchema = ${name}.model_json_schema()`);
|
|
282
|
+
}
|
|
283
|
+
return {
|
|
284
|
+
lines,
|
|
285
|
+
entityName: name,
|
|
286
|
+
hasComputed: entity.computedProperties.length > 0,
|
|
287
|
+
needsRe,
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
function generatePropertyLine(prop, _numericConstraints, _lengthConstraints, _patternConstraints, diagnostics, imports, _opts) {
|
|
291
|
+
const lines = [];
|
|
292
|
+
const fieldName = snakeCase(prop.name);
|
|
293
|
+
const typeAnnotation = irTypeToPython(prop.type, diagnostics, imports);
|
|
294
|
+
// Handle optional (properties without 'required' modifier)
|
|
295
|
+
const isRequired = prop.modifiers.includes('required');
|
|
296
|
+
const hasDefault = prop.defaultValue !== undefined;
|
|
297
|
+
const isNullable = prop.type.nullable;
|
|
298
|
+
// Build the field declaration
|
|
299
|
+
let fieldDecl = `${fieldName}: ${typeAnnotation}`;
|
|
300
|
+
if (hasDefault) {
|
|
301
|
+
// For fields with a default value, set the default
|
|
302
|
+
fieldDecl += ` = ${irValueToPythonLiteral(prop.defaultValue)}`;
|
|
303
|
+
}
|
|
304
|
+
else if (!isRequired && isNullable) {
|
|
305
|
+
// For nullable optional fields without default: use Type | None = None
|
|
306
|
+
imports.needsTyping = true;
|
|
307
|
+
fieldDecl = `${fieldName}: ${typeAnnotation} | None = None`;
|
|
308
|
+
}
|
|
309
|
+
else if (!isRequired) {
|
|
310
|
+
// For non-nullable optional fields without default: use Type | None = None
|
|
311
|
+
imports.needsTyping = true;
|
|
312
|
+
fieldDecl = `${fieldName}: ${typeAnnotation} | None = None`;
|
|
313
|
+
}
|
|
314
|
+
lines.push(fieldDecl);
|
|
315
|
+
return { lines };
|
|
316
|
+
}
|
|
317
|
+
function generateComputedPropertyLine(cp, diagnostics, imports) {
|
|
318
|
+
const lines = [];
|
|
319
|
+
const fieldName = snakeCase(cp.name);
|
|
320
|
+
let typeAnnotation = irTypeToPython(cp.type, diagnostics, imports);
|
|
321
|
+
if (cp.type.nullable) {
|
|
322
|
+
imports.needsTyping = true;
|
|
323
|
+
typeAnnotation = `None | ${typeAnnotation}`;
|
|
324
|
+
}
|
|
325
|
+
lines.push(`# Computed property: ${cp.name} (expression: ${cp.expression.kind})`);
|
|
326
|
+
lines.push(`@computed_field`);
|
|
327
|
+
lines.push(`@property`);
|
|
328
|
+
lines.push(`def ${fieldName}(self) -> ${typeAnnotation}:`);
|
|
329
|
+
lines.push(` """Computed property from IR."""`);
|
|
330
|
+
lines.push(` # TODO: Implement computed property logic from expression`);
|
|
331
|
+
lines.push(` raise NotImplementedError("Computed property '${cp.name}' not implemented")`);
|
|
332
|
+
return lines;
|
|
333
|
+
}
|
|
334
|
+
// ============================================================================
|
|
335
|
+
// Command model generation
|
|
336
|
+
// ============================================================================
|
|
337
|
+
function generateCommandModel(command, analysisOptions, diagnostics) {
|
|
338
|
+
const lines = [];
|
|
339
|
+
const opts = normalizeOptions(analysisOptions);
|
|
340
|
+
const imports = {
|
|
341
|
+
needsDatetime: opts.emitDatetimeImports !== false,
|
|
342
|
+
needsTyping: opts.emitTypingImports !== false,
|
|
343
|
+
needsUuid: opts.emitUuidImport !== false,
|
|
344
|
+
needsDecimal: opts.emitDecimalImport !== false,
|
|
345
|
+
};
|
|
346
|
+
const name = pascalCase(command.name);
|
|
347
|
+
const schemaName = `${name}Params`;
|
|
348
|
+
// Command parameter model
|
|
349
|
+
lines.push(`# Command: ${command.name}${command.entity ? ` on ${command.entity}` : ''}`);
|
|
350
|
+
if (command.parameters.length === 0) {
|
|
351
|
+
lines.push(`class ${schemaName}(BaseModel):`);
|
|
352
|
+
lines.push(` """Parameter model for command '${command.name}'."""`);
|
|
353
|
+
lines.push(` pass`);
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
lines.push(`class ${schemaName}(BaseModel):`);
|
|
357
|
+
lines.push(` """Parameter model for command '${command.name}'."""`);
|
|
358
|
+
lines.push('');
|
|
359
|
+
for (const param of command.parameters) {
|
|
360
|
+
const paramResult = generateParameterLine(param, diagnostics, imports, opts);
|
|
361
|
+
lines.push(...paramResult.lines.map(l => ' ' + l));
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
// Return type model if command has a return type
|
|
365
|
+
if (command.returns) {
|
|
366
|
+
lines.push('');
|
|
367
|
+
lines.push('');
|
|
368
|
+
const returnExpr = irTypeToPython(command.returns, diagnostics, imports);
|
|
369
|
+
const returnName = `${name}Return`;
|
|
370
|
+
lines.push(`class ${returnName}(BaseModel):`);
|
|
371
|
+
lines.push(` """Return type model for command '${command.name}'."""`);
|
|
372
|
+
lines.push(` value: ${returnExpr}`);
|
|
373
|
+
}
|
|
374
|
+
return { lines, needsTyping: imports.needsTyping };
|
|
375
|
+
}
|
|
376
|
+
function generateParameterLine(param, diagnostics, imports, _opts) {
|
|
377
|
+
const lines = [];
|
|
378
|
+
const fieldName = snakeCase(param.name);
|
|
379
|
+
const typeAnnotation = irTypeToPython(param.type, diagnostics, imports);
|
|
380
|
+
const hasDefault = param.defaultValue !== undefined;
|
|
381
|
+
const isNullable = param.type.nullable;
|
|
382
|
+
let fieldDecl = `${fieldName}: ${typeAnnotation}`;
|
|
383
|
+
if (hasDefault) {
|
|
384
|
+
fieldDecl += ` = ${irValueToPythonLiteral(param.defaultValue)}`;
|
|
385
|
+
}
|
|
386
|
+
else if (!param.required && isNullable) {
|
|
387
|
+
imports.needsTyping = true;
|
|
388
|
+
fieldDecl = `${fieldName}: ${typeAnnotation} | None = None`;
|
|
389
|
+
}
|
|
390
|
+
else if (!param.required) {
|
|
391
|
+
imports.needsTyping = true;
|
|
392
|
+
fieldDecl = `${fieldName}: ${typeAnnotation} | None = None`;
|
|
393
|
+
}
|
|
394
|
+
lines.push(fieldDecl);
|
|
395
|
+
return { lines };
|
|
396
|
+
}
|
|
397
|
+
// ============================================================================
|
|
398
|
+
// Enum model generation
|
|
399
|
+
// ============================================================================
|
|
400
|
+
function generateEnumModel(enumDef) {
|
|
401
|
+
const lines = [];
|
|
402
|
+
const name = pascalCase(enumDef.name);
|
|
403
|
+
lines.push(`# Enum: ${enumDef.name}`);
|
|
404
|
+
lines.push(`class ${name}(str):`);
|
|
405
|
+
lines.push(` """${name} enum from Manifest IR enum '${enumDef.name}'."""`);
|
|
406
|
+
lines.push(' ');
|
|
407
|
+
for (const value of enumDef.values) {
|
|
408
|
+
const pascalValue = pascalCase(value.name);
|
|
409
|
+
if (value.label) {
|
|
410
|
+
lines.push(` ${pascalValue} = "${value.name}" # ${value.label}`);
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
lines.push(` ${pascalValue} = "${value.name}"`);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
return lines;
|
|
417
|
+
}
|
|
418
|
+
// ============================================================================
|
|
419
|
+
// Options normalization
|
|
420
|
+
// ============================================================================
|
|
421
|
+
function normalizeOptions(options) {
|
|
422
|
+
return {
|
|
423
|
+
emitTypes: options?.emitTypes !== false,
|
|
424
|
+
emitComputedFields: options?.emitComputedFields !== false,
|
|
425
|
+
pydanticImportPath: options?.pydanticImportPath ?? 'pydantic',
|
|
426
|
+
emitDatetimeImports: options?.emitDatetimeImports !== false,
|
|
427
|
+
emitTypingImports: options?.emitTypingImports !== false,
|
|
428
|
+
emitUuidImport: options?.emitUuidImport !== false,
|
|
429
|
+
emitDecimalImport: options?.emitDecimalImport !== false,
|
|
430
|
+
emitHeader: options?.emitHeader !== false,
|
|
431
|
+
useFieldFunction: options?.useFieldFunction ?? false,
|
|
432
|
+
emitJsonSchema: options?.emitJsonSchema ?? false,
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
// ============================================================================
|
|
436
|
+
// Import generation
|
|
437
|
+
// ============================================================================
|
|
438
|
+
function generateImports(needsDatetime, needsTyping, needsUuid, needsDecimal, needsRe, needsComputedField, pydanticImportPath, emitHeader) {
|
|
439
|
+
const lines = [];
|
|
440
|
+
if (emitHeader) {
|
|
441
|
+
lines.push('# Auto-generated by Manifest Pydantic projection');
|
|
442
|
+
lines.push(`# Generated at: ${new Date().toISOString()}`);
|
|
443
|
+
lines.push('');
|
|
444
|
+
lines.push('# This code generates Pydantic v2 BaseModel classes from Manifest IR entities.');
|
|
445
|
+
lines.push('# Pydantic v2 documentation: https://docs.pydantic.dev/');
|
|
446
|
+
lines.push('');
|
|
447
|
+
}
|
|
448
|
+
// Standard library imports
|
|
449
|
+
if (needsRe) {
|
|
450
|
+
lines.push('import re');
|
|
451
|
+
}
|
|
452
|
+
lines.push('');
|
|
453
|
+
// Pydantic imports
|
|
454
|
+
lines.push(`from ${pydanticImportPath} import BaseModel, field_validator`);
|
|
455
|
+
if (needsComputedField) {
|
|
456
|
+
lines.push(`from ${pydanticImportPath} import computed_field`);
|
|
457
|
+
}
|
|
458
|
+
// Type imports
|
|
459
|
+
const typeImports = [];
|
|
460
|
+
if (needsTyping) {
|
|
461
|
+
typeImports.push('Any');
|
|
462
|
+
}
|
|
463
|
+
if (typeImports.length > 0) {
|
|
464
|
+
lines.push(`from typing import ${typeImports.join(', ')}`);
|
|
465
|
+
}
|
|
466
|
+
// Special type imports
|
|
467
|
+
if (needsDatetime) {
|
|
468
|
+
lines.push('from datetime import date, datetime');
|
|
469
|
+
}
|
|
470
|
+
if (needsUuid) {
|
|
471
|
+
lines.push('from uuid import UUID');
|
|
472
|
+
}
|
|
473
|
+
if (needsDecimal) {
|
|
474
|
+
lines.push('from decimal import Decimal');
|
|
475
|
+
}
|
|
476
|
+
lines.push('');
|
|
477
|
+
lines.push('');
|
|
478
|
+
return lines;
|
|
479
|
+
}
|
|
480
|
+
// ============================================================================
|
|
481
|
+
// Main projection class
|
|
482
|
+
// ============================================================================
|
|
483
|
+
export class PydanticProjection {
|
|
484
|
+
name = 'pydantic';
|
|
485
|
+
description = 'Pydantic v2 models for IR entities and commands with field validators and JSON schema export';
|
|
486
|
+
surfaces = ['pydantic.entity', 'pydantic.command', 'pydantic.models', 'pydantic.client'];
|
|
487
|
+
generate(ir, request) {
|
|
488
|
+
const diagnostics = [];
|
|
489
|
+
const opts = normalizeOptions(request.options);
|
|
490
|
+
switch (request.surface) {
|
|
491
|
+
case 'pydantic.entity':
|
|
492
|
+
return this.generateEntitySurface(ir, request, opts, diagnostics);
|
|
493
|
+
case 'pydantic.command':
|
|
494
|
+
return this.generateCommandSurface(ir, request, opts, diagnostics);
|
|
495
|
+
case 'pydantic.models':
|
|
496
|
+
return this.generateAllSurface(ir, opts, diagnostics);
|
|
497
|
+
case 'pydantic.client':
|
|
498
|
+
return this.generateClientSurface(ir, opts, diagnostics);
|
|
499
|
+
default:
|
|
500
|
+
return {
|
|
501
|
+
artifacts: [],
|
|
502
|
+
diagnostics: [{
|
|
503
|
+
severity: 'error',
|
|
504
|
+
code: 'PYDANTIC_UNKNOWN_SURFACE',
|
|
505
|
+
message: `Unknown surface "${request.surface}". Expected one of: ${this.surfaces.join(', ')}`,
|
|
506
|
+
}],
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
generateEntitySurface(ir, request, opts, diagnostics) {
|
|
511
|
+
const entities = request.entity
|
|
512
|
+
? ir.entities.filter(e => e.name === request.entity)
|
|
513
|
+
: ir.entities;
|
|
514
|
+
if (request.entity && entities.length === 0) {
|
|
515
|
+
return {
|
|
516
|
+
artifacts: [],
|
|
517
|
+
diagnostics: [{
|
|
518
|
+
severity: 'error',
|
|
519
|
+
code: 'PYDANTIC_ENTITY_NOT_FOUND',
|
|
520
|
+
message: `Entity "${request.entity}" not found in IR`,
|
|
521
|
+
entity: request.entity,
|
|
522
|
+
}],
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
const artifacts = [];
|
|
526
|
+
for (const entity of entities) {
|
|
527
|
+
const result = generateEntityModel(entity, opts, diagnostics);
|
|
528
|
+
const imports = generateImports(opts.emitDatetimeImports, opts.emitTypingImports, opts.emitUuidImport, opts.emitDecimalImport, result.needsRe, result.hasComputed, opts.pydanticImportPath, opts.emitHeader);
|
|
529
|
+
const code = [...imports, ...result.lines].join('\n');
|
|
530
|
+
artifacts.push({
|
|
531
|
+
id: `pydantic.entity.${entity.name}`,
|
|
532
|
+
pathHint: `models/${entity.name}.py`,
|
|
533
|
+
contentType: 'python',
|
|
534
|
+
code,
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
return { artifacts, diagnostics };
|
|
538
|
+
}
|
|
539
|
+
generateCommandSurface(ir, request, opts, diagnostics) {
|
|
540
|
+
const commands = request.command
|
|
541
|
+
? ir.commands.filter(c => c.name === request.command)
|
|
542
|
+
: ir.commands;
|
|
543
|
+
if (request.command && commands.length === 0) {
|
|
544
|
+
return {
|
|
545
|
+
artifacts: [],
|
|
546
|
+
diagnostics: [{
|
|
547
|
+
severity: 'error',
|
|
548
|
+
code: 'PYDANTIC_COMMAND_NOT_FOUND',
|
|
549
|
+
message: `Command "${request.command}" not found in IR`,
|
|
550
|
+
}],
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
const artifacts = [];
|
|
554
|
+
for (const command of commands) {
|
|
555
|
+
const result = generateCommandModel(command, opts, diagnostics);
|
|
556
|
+
const imports = generateImports(opts.emitDatetimeImports, result.needsTyping, opts.emitUuidImport, opts.emitDecimalImport, false, false, opts.pydanticImportPath, opts.emitHeader);
|
|
557
|
+
const code = [...imports, ...result.lines].join('\n');
|
|
558
|
+
artifacts.push({
|
|
559
|
+
id: `pydantic.command.${command.name}`,
|
|
560
|
+
pathHint: `models/commands/${command.name}.py`,
|
|
561
|
+
contentType: 'python',
|
|
562
|
+
code,
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
return { artifacts, diagnostics };
|
|
566
|
+
}
|
|
567
|
+
generateAllSurface(ir, opts, diagnostics) {
|
|
568
|
+
// Pre-scan imports to populate any side-effect state (regenerated as finalImports below)
|
|
569
|
+
generateImports(opts.emitDatetimeImports, opts.emitTypingImports, opts.emitUuidImport, opts.emitDecimalImport, false, // will detect if any entity needs re
|
|
570
|
+
false, // will detect if any entity has computed
|
|
571
|
+
opts.pydanticImportPath, opts.emitHeader);
|
|
572
|
+
// Scan all entities to detect if we need re or computed_field
|
|
573
|
+
let needsRe = false;
|
|
574
|
+
let needsComputed = false;
|
|
575
|
+
const lines = [];
|
|
576
|
+
// Add all entity models
|
|
577
|
+
for (const entity of ir.entities) {
|
|
578
|
+
const result = generateEntityModel(entity, opts, diagnostics);
|
|
579
|
+
if (result.needsRe)
|
|
580
|
+
needsRe = true;
|
|
581
|
+
if (result.hasComputed)
|
|
582
|
+
needsComputed = true;
|
|
583
|
+
lines.push(...result.lines);
|
|
584
|
+
lines.push('');
|
|
585
|
+
lines.push('');
|
|
586
|
+
}
|
|
587
|
+
// Add all command models
|
|
588
|
+
for (const command of ir.commands) {
|
|
589
|
+
const result = generateCommandModel(command, opts, diagnostics);
|
|
590
|
+
lines.push(...result.lines);
|
|
591
|
+
lines.push('');
|
|
592
|
+
lines.push('');
|
|
593
|
+
}
|
|
594
|
+
// Add all enum models
|
|
595
|
+
if (ir.enums && ir.enums.length > 0) {
|
|
596
|
+
lines.push('# Enums');
|
|
597
|
+
lines.push('');
|
|
598
|
+
for (const enumDef of ir.enums) {
|
|
599
|
+
const enumLines = generateEnumModel(enumDef);
|
|
600
|
+
lines.push(...enumLines);
|
|
601
|
+
lines.push('');
|
|
602
|
+
lines.push('');
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
// Regenerate imports with correct detection
|
|
606
|
+
const finalImports = generateImports(opts.emitDatetimeImports, opts.emitTypingImports, opts.emitUuidImport, opts.emitDecimalImport, needsRe, needsComputed, opts.pydanticImportPath, opts.emitHeader);
|
|
607
|
+
const code = [...finalImports, ...lines].join('\n');
|
|
608
|
+
return {
|
|
609
|
+
artifacts: [{
|
|
610
|
+
id: 'pydantic.models',
|
|
611
|
+
pathHint: 'models/manifest_models.py',
|
|
612
|
+
contentType: 'python',
|
|
613
|
+
code,
|
|
614
|
+
}],
|
|
615
|
+
diagnostics,
|
|
616
|
+
};
|
|
617
|
+
}
|
|
618
|
+
generateClientSurface(ir, opts, diagnostics) {
|
|
619
|
+
const result = generatePythonClient(ir, opts, diagnostics);
|
|
620
|
+
return {
|
|
621
|
+
artifacts: [{
|
|
622
|
+
id: 'pydantic.client',
|
|
623
|
+
pathHint: 'client/manifest_client.py',
|
|
624
|
+
contentType: 'python',
|
|
625
|
+
code: result.code,
|
|
626
|
+
}],
|
|
627
|
+
diagnostics: result.diagnostics,
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
function generatePythonClient(ir, opts, diagnostics) {
|
|
632
|
+
const lines = [];
|
|
633
|
+
// Header
|
|
634
|
+
if (opts.emitHeader) {
|
|
635
|
+
lines.push('# Auto-generated Python client SDK from Manifest IR');
|
|
636
|
+
lines.push(`# Generated at: ${new Date().toISOString()}`);
|
|
637
|
+
lines.push('');
|
|
638
|
+
lines.push('# This code generates an async httpx-based client for Manifest entities and commands.');
|
|
639
|
+
lines.push('# Compatible with Python 3.10+');
|
|
640
|
+
lines.push('');
|
|
641
|
+
}
|
|
642
|
+
// Imports
|
|
643
|
+
lines.push('import asyncio');
|
|
644
|
+
lines.push('from typing import Any, Optional');
|
|
645
|
+
lines.push('import httpx');
|
|
646
|
+
lines.push('from pydantic import BaseModel');
|
|
647
|
+
lines.push('');
|
|
648
|
+
lines.push('');
|
|
649
|
+
// Client class
|
|
650
|
+
lines.push('class ManifestClient:');
|
|
651
|
+
lines.push(' """');
|
|
652
|
+
lines.push(' Async client for Manifest API with typed command invocation methods.');
|
|
653
|
+
lines.push(' ');
|
|
654
|
+
lines.push(' Example:');
|
|
655
|
+
lines.push(' async with ManifestClient(base_url="http://localhost:3000") as client:');
|
|
656
|
+
lines.push(' result = await client.create_user(email="user@example.com", name="John")');
|
|
657
|
+
lines.push(' """');
|
|
658
|
+
lines.push('');
|
|
659
|
+
lines.push('');
|
|
660
|
+
lines.push(' def __init__(self, base_url: str = "http://localhost:3000", api_key: Optional[str] = None):');
|
|
661
|
+
lines.push(' self._base_url = base_url.rstrip("/")');
|
|
662
|
+
lines.push(' self._api_key = api_key');
|
|
663
|
+
lines.push(' self._client: Optional[httpx.AsyncClient] = None');
|
|
664
|
+
lines.push(' ');
|
|
665
|
+
lines.push(' async def __aenter__(self):');
|
|
666
|
+
lines.push(' self._client = httpx.AsyncClient(');
|
|
667
|
+
lines.push(' base_url=self._base_url,');
|
|
668
|
+
lines.push(' headers={"Authorization": f"Bearer {self._api_key}"} if self._api_key else {},');
|
|
669
|
+
lines.push(' )');
|
|
670
|
+
lines.push(' return self');
|
|
671
|
+
lines.push(' ');
|
|
672
|
+
lines.push(' async def __aexit__(self, exc_type, exc_val, exc_tb):');
|
|
673
|
+
lines.push(' if self._client:');
|
|
674
|
+
lines.push(' await self._client.aclose()');
|
|
675
|
+
lines.push(' ');
|
|
676
|
+
lines.push(' async def _request(self, method: str, path: str, **kwargs) -> dict[str, Any]:');
|
|
677
|
+
lines.push(' """Make an HTTP request and return the JSON response."""');
|
|
678
|
+
lines.push(' if not self._client:');
|
|
679
|
+
lines.push(' raise RuntimeError("Client not initialized. Use `async with ManifestClient(...) as client:`")');
|
|
680
|
+
lines.push(' response = await self._client.request(method, path, **kwargs)');
|
|
681
|
+
lines.push(' response.raise_for_status()');
|
|
682
|
+
lines.push(' return response.json()');
|
|
683
|
+
lines.push(' ');
|
|
684
|
+
lines.push(' # Entity query methods');
|
|
685
|
+
lines.push('');
|
|
686
|
+
// Generate entity query methods
|
|
687
|
+
for (const entity of ir.entities) {
|
|
688
|
+
const lowerEntity = entity.name.toLowerCase();
|
|
689
|
+
const snakeEntity = snakeCase(entity.name);
|
|
690
|
+
// List method
|
|
691
|
+
lines.push(` async def list_${snakeEntity}s(self) -> list[dict[str, Any]]:`);
|
|
692
|
+
lines.push(` """Get all ${entity.name} entities."""`);
|
|
693
|
+
lines.push(` return await self._request("GET", "/api/${lowerEntity}/list")`);
|
|
694
|
+
lines.push('');
|
|
695
|
+
// Get by ID method
|
|
696
|
+
lines.push(` async def get_${snakeEntity}(self, id: str) -> dict[str, Any]:`);
|
|
697
|
+
lines.push(` """Get a ${entity.name} by ID."""`);
|
|
698
|
+
lines.push(` return await self._request("GET", f"/api/${lowerEntity}/{id}")`);
|
|
699
|
+
lines.push('');
|
|
700
|
+
}
|
|
701
|
+
lines.push(' # Command invocation methods');
|
|
702
|
+
lines.push('');
|
|
703
|
+
// Generate command invocation methods
|
|
704
|
+
for (const command of ir.commands) {
|
|
705
|
+
if (!command.entity)
|
|
706
|
+
continue; // Skip global commands for now
|
|
707
|
+
const snakeCommand = snakeCase(command.name);
|
|
708
|
+
lines.push(` async def ${snakeCommand}(`);
|
|
709
|
+
lines.push(` self,`);
|
|
710
|
+
lines.push(` entity_id: Optional[str] = None,`);
|
|
711
|
+
// Add parameters
|
|
712
|
+
for (const param of command.parameters) {
|
|
713
|
+
const snakeParam = snakeCase(param.name);
|
|
714
|
+
const typeAnnotation = irTypeToPython(param.type, diagnostics, { needsDatetime: false, needsTyping: true, needsUuid: false, needsDecimal: false });
|
|
715
|
+
if (!param.required) {
|
|
716
|
+
lines.push(` ${snakeParam}: ${typeAnnotation} | None = None,`);
|
|
717
|
+
}
|
|
718
|
+
else {
|
|
719
|
+
lines.push(` ${snakeParam}: ${typeAnnotation},`);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
lines.push(` ) -> dict[str, Any]:`);
|
|
723
|
+
lines.push(` """Execute the ${command.name} command on ${command.entity}."""`);
|
|
724
|
+
lines.push(` payload = {`);
|
|
725
|
+
for (const param of command.parameters) {
|
|
726
|
+
const snakeParam = snakeCase(param.name);
|
|
727
|
+
lines.push(` "${param.name}": ${snakeParam},`);
|
|
728
|
+
}
|
|
729
|
+
lines.push(` }`);
|
|
730
|
+
lines.push(` `);
|
|
731
|
+
if (command.entity) {
|
|
732
|
+
const lowerEntity = command.entity.toLowerCase();
|
|
733
|
+
lines.push(` # Filter out None values`);
|
|
734
|
+
lines.push(` payload = {k: v for k, v in payload.items() if v is not None}`);
|
|
735
|
+
lines.push(` return await self._request("POST", f"/api/${lowerEntity}/commands/${command.name}", json=payload)`);
|
|
736
|
+
}
|
|
737
|
+
lines.push('');
|
|
738
|
+
lines.push('');
|
|
739
|
+
}
|
|
740
|
+
// Generate enum classes
|
|
741
|
+
if (ir.enums && ir.enums.length > 0) {
|
|
742
|
+
lines.push('');
|
|
743
|
+
lines.push('');
|
|
744
|
+
lines.push('# Enums');
|
|
745
|
+
lines.push('');
|
|
746
|
+
for (const enumDef of ir.enums) {
|
|
747
|
+
lines.push(`class ${pascalCase(enumDef.name)}(str):`);
|
|
748
|
+
for (const value of enumDef.values) {
|
|
749
|
+
const pascalValue = pascalCase(value.name);
|
|
750
|
+
lines.push(` ${pascalValue} = "${value.name}"`);
|
|
751
|
+
}
|
|
752
|
+
lines.push('');
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
// Generate standalone functions for convenience
|
|
756
|
+
lines.push('');
|
|
757
|
+
lines.push('');
|
|
758
|
+
lines.push('# Convenience functions (create client implicitly)');
|
|
759
|
+
lines.push('');
|
|
760
|
+
lines.push('async def _get_default_client() -> ManifestClient:');
|
|
761
|
+
lines.push(' """Get or create the default singleton client."""');
|
|
762
|
+
lines.push(' if not hasattr(_get_default_client, "_client"):');
|
|
763
|
+
lines.push(' _get_default_client._client = ManifestClient() # type: ignore');
|
|
764
|
+
lines.push(' await _get_default_client._client.__aenter__() # type: ignore');
|
|
765
|
+
lines.push(' return _get_default_client._client # type: ignore');
|
|
766
|
+
lines.push('');
|
|
767
|
+
// Generate command functions
|
|
768
|
+
for (const command of ir.commands) {
|
|
769
|
+
if (!command.entity)
|
|
770
|
+
continue;
|
|
771
|
+
const snakeCommand = snakeCase(command.name);
|
|
772
|
+
lines.push(`async def ${snakeCommand}(`);
|
|
773
|
+
lines.push(` base_url: str = "http://localhost:3000",`);
|
|
774
|
+
lines.push(` api_key: Optional[str] = None,`);
|
|
775
|
+
for (const param of command.parameters) {
|
|
776
|
+
const snakeParam = snakeCase(param.name);
|
|
777
|
+
const typeAnnotation = irTypeToPython(param.type, diagnostics, { needsDatetime: false, needsTyping: true, needsUuid: false, needsDecimal: false });
|
|
778
|
+
if (!param.required) {
|
|
779
|
+
lines.push(` ${snakeParam}: ${typeAnnotation} | None = None,`);
|
|
780
|
+
}
|
|
781
|
+
else {
|
|
782
|
+
lines.push(` ${snakeParam}: ${typeAnnotation},`);
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
lines.push(`) -> dict[str, Any]:`);
|
|
786
|
+
lines.push(` """Execute the ${command.name} command."""`);
|
|
787
|
+
lines.push(` async with ManifestClient(base_url=base_url, api_key=api_key) as client:`);
|
|
788
|
+
lines.push(` return await client.${snakeCommand}(`);
|
|
789
|
+
for (const param of command.parameters) {
|
|
790
|
+
const snakeParam = snakeCase(param.name);
|
|
791
|
+
lines.push(` ${snakeParam}=${snakeParam},`);
|
|
792
|
+
}
|
|
793
|
+
lines.push(` )`);
|
|
794
|
+
lines.push('');
|
|
795
|
+
}
|
|
796
|
+
return { code: lines.join('\n'), diagnostics };
|
|
797
|
+
}
|
|
798
|
+
//# sourceMappingURL=generator.js.map
|