@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,990 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* manifest generate --from-prompt command
|
|
3
|
+
*
|
|
4
|
+
* Generates .manifest source code from natural language descriptions using an LLM.
|
|
5
|
+
* Treats the LLM as an emitter, not a validator — validates output against the
|
|
6
|
+
* conformance suite and iterates on failures.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* manifest generate --from-prompt "Create a blog with posts and comments"
|
|
10
|
+
* manifest generate --from-prompt --model claude-3-5-sonnet-20241022 "Design a task tracker"
|
|
11
|
+
*/
|
|
12
|
+
import fs from 'fs/promises';
|
|
13
|
+
import path from 'path';
|
|
14
|
+
import { fileURLToPath } from 'url';
|
|
15
|
+
import chalk from 'chalk';
|
|
16
|
+
import ora from 'ora';
|
|
17
|
+
import { loadCompiler } from './validate-ai.js';
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
// System Prompt Template
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
/**
|
|
22
|
+
* Builds the system prompt with IR schema and semantics documentation.
|
|
23
|
+
* This is the single source of truth for the LLM about Manifest language.
|
|
24
|
+
*/
|
|
25
|
+
export async function buildSystemPrompt() {
|
|
26
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
27
|
+
const root = path.join(here, '..', '..', '..');
|
|
28
|
+
// Read spec files
|
|
29
|
+
const schemaPath = path.join(root, 'docs', 'spec', 'ir', 'ir-v1.schema.json');
|
|
30
|
+
const semanticsPath = path.join(root, 'docs', 'spec', 'semantics.md');
|
|
31
|
+
const builtinsPath = path.join(root, 'docs', 'spec', 'builtins.md');
|
|
32
|
+
const adaptersPath = path.join(root, 'docs', 'spec', 'adapters.md');
|
|
33
|
+
let schemaContent = '';
|
|
34
|
+
let semanticsContent = '';
|
|
35
|
+
let builtinsContent = '';
|
|
36
|
+
let _adaptersContent = '';
|
|
37
|
+
try {
|
|
38
|
+
schemaContent = await fs.readFile(schemaPath, 'utf-8');
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// Schema file not found, continue without it
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
semanticsContent = await fs.readFile(semanticsPath, 'utf-8');
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
// Semantics file not found, continue without it
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
builtinsContent = await fs.readFile(builtinsPath, 'utf-8');
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
// Builtins file not found, continue without it
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
_adaptersContent = await fs.readFile(adaptersPath, 'utf-8');
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// Adapters file not found, continue without it
|
|
60
|
+
}
|
|
61
|
+
// Read a few examples from examples.ts
|
|
62
|
+
const examplesPath = path.join(root, 'src', 'manifest', 'examples.ts');
|
|
63
|
+
let examplesContent = '';
|
|
64
|
+
try {
|
|
65
|
+
const fullExamples = await fs.readFile(examplesPath, 'utf-8');
|
|
66
|
+
// Extract just the first 2-3 examples (truncated for context)
|
|
67
|
+
const examplesMatch = fullExamples.match(/name: '.*?'\s+code: `[^`]{500,2000}`/gs);
|
|
68
|
+
if (examplesMatch) {
|
|
69
|
+
examplesContent = examplesMatch.slice(0, 3).join('\n\n');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
// Examples file not found, continue without it
|
|
74
|
+
}
|
|
75
|
+
return `# Manifest Language Code Generator
|
|
76
|
+
|
|
77
|
+
You are an expert Manifest language code generator. Your task is to generate valid .manifest source code from natural language descriptions.
|
|
78
|
+
|
|
79
|
+
## Manifest Language Overview
|
|
80
|
+
|
|
81
|
+
Manifest is a domain-specific language for defining business rules and workflows with declarative specifications. It compiles to an Intermediate Representation (IR).
|
|
82
|
+
|
|
83
|
+
## Core Language Concepts
|
|
84
|
+
|
|
85
|
+
### Entities
|
|
86
|
+
Entities define structured data with properties, relationships, commands, policies, and constraints.
|
|
87
|
+
|
|
88
|
+
\`\`\`manifest
|
|
89
|
+
entity User {
|
|
90
|
+
property required id: string
|
|
91
|
+
property required name: string
|
|
92
|
+
property email: string?
|
|
93
|
+
property role: string = "user"
|
|
94
|
+
property readonly createdAt: string = now()
|
|
95
|
+
|
|
96
|
+
// Commands
|
|
97
|
+
command updateProfile(name: string, email: string) {
|
|
98
|
+
guard self.id == user.id
|
|
99
|
+
mutate self.name = name
|
|
100
|
+
mutate self.email = email
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Policies
|
|
104
|
+
policy canRead read: true
|
|
105
|
+
policy canWrite write: user.id == self.id or user.role == "admin"
|
|
106
|
+
|
|
107
|
+
// Constraints
|
|
108
|
+
constraint validEmail: email == null or matches(email, "^[^@]+@[^@]+$")
|
|
109
|
+
}
|
|
110
|
+
\`\`\`
|
|
111
|
+
|
|
112
|
+
### Property Types
|
|
113
|
+
- \`string\`, \`number\`, \`boolean\`, \`decimal\`, \`timestamp\`
|
|
114
|
+
- \`array<T>\` for arrays
|
|
115
|
+
- \`map<T>\` for key-value maps
|
|
116
|
+
- \`enum Name\` for enums (defined separately)
|
|
117
|
+
- \`value Name\` for value objects
|
|
118
|
+
|
|
119
|
+
### Property Modifiers
|
|
120
|
+
- \`required\` - field must be present
|
|
121
|
+
- \`readonly\` - set once, never changes
|
|
122
|
+
- Optional \`?\` suffix - nullable field
|
|
123
|
+
- Default values: \`= <expression>\`
|
|
124
|
+
|
|
125
|
+
### Commands
|
|
126
|
+
Commands define business operations with guards, mutations, and emits.
|
|
127
|
+
|
|
128
|
+
\`\`\`manifest
|
|
129
|
+
command publish() {
|
|
130
|
+
guard self.status == "draft"
|
|
131
|
+
guard user.role == "editor"
|
|
132
|
+
mutate self.status = "published"
|
|
133
|
+
mutate self.publishedAt = now()
|
|
134
|
+
emit PostPublished
|
|
135
|
+
}
|
|
136
|
+
\`\`\`
|
|
137
|
+
|
|
138
|
+
### Relationships
|
|
139
|
+
- \`hasOne\`, \`hasMany\`, \`belongsTo\`, \`ref\`
|
|
140
|
+
|
|
141
|
+
\`\`\`manifest
|
|
142
|
+
entity Post {
|
|
143
|
+
hasOne author: User
|
|
144
|
+
hasMany comments: Comment
|
|
145
|
+
belongsTo category: Category
|
|
146
|
+
}
|
|
147
|
+
\`\`\`
|
|
148
|
+
|
|
149
|
+
### Policies
|
|
150
|
+
Authorization rules for read, write, execute actions.
|
|
151
|
+
|
|
152
|
+
\`\`\`manifest
|
|
153
|
+
policy canRead read: true
|
|
154
|
+
policy canWrite write: user.role == "admin"
|
|
155
|
+
policy canExecute execute: user.id == self.userId
|
|
156
|
+
\`\`\`
|
|
157
|
+
|
|
158
|
+
### Constraints
|
|
159
|
+
Data validation rules with severity levels.
|
|
160
|
+
|
|
161
|
+
\`\`\`manifest
|
|
162
|
+
constraint validStatus: self.status in ["draft", "published"]
|
|
163
|
+
constraint sufficientBalance: self.balance >= 0
|
|
164
|
+
\`\`\`
|
|
165
|
+
|
|
166
|
+
### Events
|
|
167
|
+
Realtime events for state changes.
|
|
168
|
+
|
|
169
|
+
\`\`\`manifest
|
|
170
|
+
event PostPublished: "post.published" {
|
|
171
|
+
postId: string
|
|
172
|
+
publishedBy: string
|
|
173
|
+
}
|
|
174
|
+
\`\`\`
|
|
175
|
+
|
|
176
|
+
### Stores
|
|
177
|
+
Persistence configuration.
|
|
178
|
+
|
|
179
|
+
\`\`\`manifest
|
|
180
|
+
store User in supabase { table: "users" }
|
|
181
|
+
store Post in memory
|
|
182
|
+
\`\`\`
|
|
183
|
+
|
|
184
|
+
### Modules
|
|
185
|
+
Logical grouping of related entities.
|
|
186
|
+
|
|
187
|
+
\`\`\`manifest
|
|
188
|
+
module blog {
|
|
189
|
+
entity Post { ... }
|
|
190
|
+
entity Comment { ... }
|
|
191
|
+
}
|
|
192
|
+
\`\`\`
|
|
193
|
+
|
|
194
|
+
### Enums
|
|
195
|
+
Enumeration types.
|
|
196
|
+
|
|
197
|
+
\`\`\`manifest
|
|
198
|
+
enum Status {
|
|
199
|
+
draft
|
|
200
|
+
published
|
|
201
|
+
archived
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
entity Post {
|
|
205
|
+
property status: Status = draft
|
|
206
|
+
}
|
|
207
|
+
\`\`\`
|
|
208
|
+
|
|
209
|
+
### Computed Properties
|
|
210
|
+
Auto-calculated derived fields.
|
|
211
|
+
|
|
212
|
+
\`\`\`manifest
|
|
213
|
+
entity Order {
|
|
214
|
+
hasMany items: OrderItem
|
|
215
|
+
computed total: number = sum(self.items, (item) => item.price * item.quantity)
|
|
216
|
+
}
|
|
217
|
+
\`\`\`
|
|
218
|
+
|
|
219
|
+
## Built-in Functions
|
|
220
|
+
|
|
221
|
+
### String Functions
|
|
222
|
+
- \`trim(s)\`, \`split(s, sep)\`, \`startsWith(s, prefix)\`, \`endsWith(s, suffix)\`
|
|
223
|
+
- \`replace(s, search, replacement)\`, \`toUpperCase(s)\`, \`toLowerCase(s)\`
|
|
224
|
+
- \`length(s)\`, \`substring(s, start, end?)\`, \`indexOf(s, search)\`
|
|
225
|
+
- \`matches(s, pattern)\` - regex test
|
|
226
|
+
|
|
227
|
+
### Math Functions
|
|
228
|
+
- \`abs(x)\`, \`round(x)\`, \`floor(x)\`, \`ceil(x)\`
|
|
229
|
+
- \`min(...)\`, \`max(...)\`, \`between(value, low, high)\`
|
|
230
|
+
|
|
231
|
+
### Aggregate Functions
|
|
232
|
+
- \`sum(arr, mapper?)\`, \`avg(arr, mapper?)\`
|
|
233
|
+
- \`min_of(arr, mapper?)\`, \`max_of(arr, mapper?)\`
|
|
234
|
+
- \`count_of(arr, predicate?)\`, \`filter(arr, predicate)\`, \`map(arr, mapper)\`
|
|
235
|
+
|
|
236
|
+
### Date Functions
|
|
237
|
+
- \`now()\` - current timestamp
|
|
238
|
+
- \`year(ts)\`, \`month(ts)\`, \`day(ts)\`, \`hours(ts)\`, \`minutes(ts)\`, \`seconds(ts)\`
|
|
239
|
+
|
|
240
|
+
### Other Functions
|
|
241
|
+
- \`uuid()\` - generate unique identifier
|
|
242
|
+
- \`flag(name)\` - resolve feature flag
|
|
243
|
+
|
|
244
|
+
## Expression Context
|
|
245
|
+
Available bindings in expressions:
|
|
246
|
+
- \`self\` / \`this\` - current entity instance
|
|
247
|
+
- \`user\` - current user object
|
|
248
|
+
- \`context\` - runtime context
|
|
249
|
+
|
|
250
|
+
## Code Generation Guidelines
|
|
251
|
+
|
|
252
|
+
1. **Be idiomatic**: Use proper Manifest syntax and conventions
|
|
253
|
+
2. **Be complete**: Include all entities, relationships, commands, and policies
|
|
254
|
+
3. **Be practical**: Focus on actionable business logic
|
|
255
|
+
4. **Add policies**: Every command should have appropriate policies
|
|
256
|
+
5. **Add constraints**: Validate data integrity
|
|
257
|
+
6. **Use computed properties**: For derived values
|
|
258
|
+
7. **Use relationships**: Connect related entities
|
|
259
|
+
8. **Define stores**: Specify persistence targets
|
|
260
|
+
|
|
261
|
+
## Output Format
|
|
262
|
+
|
|
263
|
+
Output ONLY valid .manifest source code. No explanations, no markdown code blocks, just the raw source code.
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## IR Schema Reference (Condensed)
|
|
268
|
+
|
|
269
|
+
${schemaContent.length > 0 ? 'The IR schema defines the executable contract. Generated .manifest source must compile to valid IR.' : 'Schema reference: The generated source must compile to valid IR matching the IR v1 schema.'}
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Semantics Reference
|
|
274
|
+
|
|
275
|
+
${semanticsContent.length > 0 ? semanticsContent.substring(0, 3000) + '...' : 'Semantics: See docs/spec/semantics.md for detailed runtime behavior.'}
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## Built-in Functions Reference
|
|
280
|
+
|
|
281
|
+
${builtinsContent.length > 0 ? builtinsContent.substring(0, 2000) + '...' : 'Builtins: See docs/spec/builtins.md for complete reference.'}
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## Examples
|
|
286
|
+
|
|
287
|
+
${examplesContent.length > 0 ? examplesContent : 'Examples: See src/manifest/examples.ts for more examples.'}
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
`;
|
|
291
|
+
}
|
|
292
|
+
// ---------------------------------------------------------------------------
|
|
293
|
+
// LLM Integration
|
|
294
|
+
// ---------------------------------------------------------------------------
|
|
295
|
+
/**
|
|
296
|
+
* Calls Anthropic's Claude API to generate Manifest source code.
|
|
297
|
+
*/
|
|
298
|
+
async function callAnthropic(prompt, options) {
|
|
299
|
+
const apiKey = options.apiKey ?? process.env.ANTHROPIC_API_KEY;
|
|
300
|
+
if (!apiKey) {
|
|
301
|
+
throw new Error('ANTHROPIC_API_KEY environment variable is required. Set it or pass --api-key.');
|
|
302
|
+
}
|
|
303
|
+
const model = options.model ?? 'claude-3-5-sonnet-20241022';
|
|
304
|
+
const temperature = options.temperature ?? 0.3;
|
|
305
|
+
const response = await fetch('https://api.anthropic.com/v1/messages', {
|
|
306
|
+
method: 'POST',
|
|
307
|
+
headers: {
|
|
308
|
+
'x-api-key': apiKey,
|
|
309
|
+
'anthropic-version': '2023-06-01',
|
|
310
|
+
'content-type': 'application/json',
|
|
311
|
+
},
|
|
312
|
+
body: JSON.stringify({
|
|
313
|
+
model,
|
|
314
|
+
max_tokens: 8192,
|
|
315
|
+
temperature,
|
|
316
|
+
messages: [
|
|
317
|
+
{
|
|
318
|
+
role: 'user',
|
|
319
|
+
content: prompt,
|
|
320
|
+
},
|
|
321
|
+
],
|
|
322
|
+
}),
|
|
323
|
+
});
|
|
324
|
+
if (!response.ok) {
|
|
325
|
+
const error = await response.text();
|
|
326
|
+
throw new Error(`Anthropic API error (${response.status}): ${error}`);
|
|
327
|
+
}
|
|
328
|
+
const data = await response.json();
|
|
329
|
+
const text = data.content?.[0]?.text ?? '';
|
|
330
|
+
// Extract code blocks if present
|
|
331
|
+
const codeBlockMatch = text.match(/```(?:manifest)?\n([\s\S]+?)\n```/) ||
|
|
332
|
+
text.match(/```\n([\s\S]+?)\n```/);
|
|
333
|
+
if (codeBlockMatch) {
|
|
334
|
+
return codeBlockMatch[1].trim();
|
|
335
|
+
}
|
|
336
|
+
// Return as-is if no code blocks found
|
|
337
|
+
return text.trim();
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Fallback generator that uses a simple template-based approach.
|
|
341
|
+
* This is used when no API key is available or the API fails.
|
|
342
|
+
*/
|
|
343
|
+
function generateTemplateFallback(prompt) {
|
|
344
|
+
const lowerPrompt = prompt.toLowerCase();
|
|
345
|
+
// Detect common patterns
|
|
346
|
+
const isBlog = lowerPrompt.includes('blog') || lowerPrompt.includes('post');
|
|
347
|
+
const isTodo = lowerPrompt.includes('todo') || lowerPrompt.includes('task');
|
|
348
|
+
const isEcommerce = lowerPrompt.includes('shop') || lowerPrompt.includes('store') || lowerPrompt.includes('product');
|
|
349
|
+
const isUser = lowerPrompt.includes('user') || lowerPrompt.includes('account');
|
|
350
|
+
let output = `// Generated from: "${prompt}"\n`;
|
|
351
|
+
if (isBlog) {
|
|
352
|
+
output += `
|
|
353
|
+
module blog {
|
|
354
|
+
enum PostStatus {
|
|
355
|
+
draft
|
|
356
|
+
published
|
|
357
|
+
archived
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
entity User {
|
|
361
|
+
property required id: string
|
|
362
|
+
property required name: string
|
|
363
|
+
property required email: string
|
|
364
|
+
property role: string = "author"
|
|
365
|
+
property createdAt: string = now()
|
|
366
|
+
|
|
367
|
+
hasMany posts: Post
|
|
368
|
+
hasMany comments: Comment
|
|
369
|
+
|
|
370
|
+
command register(userId: string, userName: string, emailAddr: string) {
|
|
371
|
+
guard userId != null and userId != ""
|
|
372
|
+
guard userName != null and userName != ""
|
|
373
|
+
guard emailAddr != null and emailAddr != ""
|
|
374
|
+
mutate id = userId
|
|
375
|
+
mutate name = userName
|
|
376
|
+
mutate email = emailAddr
|
|
377
|
+
mutate createdAt = now()
|
|
378
|
+
emit UserRegistered
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
policy canRead read: true
|
|
382
|
+
policy canWrite write: user.id == self.id or user.role == "admin"
|
|
383
|
+
policy canExecute execute: user.id == self.id or user.role == "admin"
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
entity Post {
|
|
387
|
+
property required id: string
|
|
388
|
+
property required title: string
|
|
389
|
+
property required content: string
|
|
390
|
+
property required authorId: string
|
|
391
|
+
property status: string = "draft"
|
|
392
|
+
property createdAt: string = now()
|
|
393
|
+
property publishedAt: string = 0
|
|
394
|
+
property viewCount: number = 0
|
|
395
|
+
|
|
396
|
+
belongsTo author: User
|
|
397
|
+
hasMany comments: Comment
|
|
398
|
+
|
|
399
|
+
computed isPublished: boolean = self.status == "published"
|
|
400
|
+
computed commentCount: number = count_of(self.comments)
|
|
401
|
+
|
|
402
|
+
command createPost(postId: string, titleText: string, contentText: string, author: string) {
|
|
403
|
+
guard postId != null and postId != ""
|
|
404
|
+
guard titleText != null and titleText != ""
|
|
405
|
+
guard contentText != null and contentText != ""
|
|
406
|
+
mutate id = postId
|
|
407
|
+
mutate title = titleText
|
|
408
|
+
mutate content = contentText
|
|
409
|
+
mutate authorId = author
|
|
410
|
+
mutate createdAt = now()
|
|
411
|
+
mutate status = "draft"
|
|
412
|
+
emit PostCreated
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
command publishPost() {
|
|
416
|
+
guard self.status == "draft"
|
|
417
|
+
guard user.id == self.authorId or user.role == "editor" or user.role == "admin"
|
|
418
|
+
mutate status = "published"
|
|
419
|
+
mutate publishedAt = now()
|
|
420
|
+
emit PostPublished
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
command archivePost() {
|
|
424
|
+
guard self.status != "archived"
|
|
425
|
+
guard user.role == "editor" or user.role == "admin"
|
|
426
|
+
mutate status = "archived"
|
|
427
|
+
emit PostArchived
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
command incrementViews() {
|
|
431
|
+
mutate viewCount = self.viewCount + 1
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
policy canRead read: self.status == "published" or user.id == self.authorId or user.role == "editor" or user.role == "admin"
|
|
435
|
+
policy canWrite write: user.id == self.authorId or user.role == "editor" or user.role == "admin"
|
|
436
|
+
policy canExecute execute: true
|
|
437
|
+
|
|
438
|
+
constraint validStatus: self.status in ["draft", "published", "archived"]
|
|
439
|
+
constraint hasTitle: length(self.title) > 0
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
entity Comment {
|
|
443
|
+
property required id: string
|
|
444
|
+
property required postId: string
|
|
445
|
+
property required authorId: string
|
|
446
|
+
property required content: string
|
|
447
|
+
property createdAt: string = now()
|
|
448
|
+
property status: string = "visible"
|
|
449
|
+
|
|
450
|
+
belongsTo post: Post
|
|
451
|
+
belongsTo author: User
|
|
452
|
+
|
|
453
|
+
computed isVisible: boolean = self.status == "visible"
|
|
454
|
+
|
|
455
|
+
command addComment(commentId: string, post: string, author: string, text: string) {
|
|
456
|
+
guard commentId != null and commentId != ""
|
|
457
|
+
guard post != null and post != ""
|
|
458
|
+
guard author != null and author != ""
|
|
459
|
+
guard text != null and text != ""
|
|
460
|
+
mutate id = commentId
|
|
461
|
+
mutate postId = post
|
|
462
|
+
mutate authorId = author
|
|
463
|
+
mutate content = text
|
|
464
|
+
mutate createdAt = now()
|
|
465
|
+
mutate status = "visible"
|
|
466
|
+
emit CommentAdded
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
command hideComment() {
|
|
470
|
+
guard self.status == "visible"
|
|
471
|
+
guard user.id == self.authorId or user.role == "editor" or user.role == "admin"
|
|
472
|
+
mutate status = "hidden"
|
|
473
|
+
emit CommentHidden
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
policy canRead read: self.status == "visible" or user.role == "editor" or user.role == "admin"
|
|
477
|
+
policy canWrite write: user.id == self.authorId or user.role == "editor" or user.role == "admin"
|
|
478
|
+
policy canExecute execute: true
|
|
479
|
+
|
|
480
|
+
constraint hasContent: length(self.content) > 0
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
event UserRegistered: "user.registered" {
|
|
484
|
+
id: string
|
|
485
|
+
name: string
|
|
486
|
+
email: string
|
|
487
|
+
role: string
|
|
488
|
+
registeredAt: string
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
event PostCreated: "post.created" {
|
|
492
|
+
id: string
|
|
493
|
+
title: string
|
|
494
|
+
authorId: string
|
|
495
|
+
createdAt: string
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
event PostPublished: "post.published" {
|
|
499
|
+
id: string
|
|
500
|
+
title: string
|
|
501
|
+
authorId: string
|
|
502
|
+
publishedAt: string
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
event PostArchived: "post.archived" {
|
|
506
|
+
id: string
|
|
507
|
+
archivedAt: string
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
event CommentAdded: "comment.added" {
|
|
511
|
+
id: string
|
|
512
|
+
postId: string
|
|
513
|
+
authorId: string
|
|
514
|
+
content: string
|
|
515
|
+
createdAt: string
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
event CommentHidden: "comment.hidden" {
|
|
519
|
+
id: string
|
|
520
|
+
postId: string
|
|
521
|
+
hiddenAt: string
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
store User in memory
|
|
526
|
+
store Post in supabase { table: "posts" }
|
|
527
|
+
store Comment in supabase { table: "comments" }
|
|
528
|
+
`;
|
|
529
|
+
}
|
|
530
|
+
else if (isTodo) {
|
|
531
|
+
output += `
|
|
532
|
+
module tasks {
|
|
533
|
+
enum TaskStatus {
|
|
534
|
+
pending
|
|
535
|
+
in_progress
|
|
536
|
+
completed
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
enum TaskPriority {
|
|
540
|
+
low
|
|
541
|
+
medium
|
|
542
|
+
high
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
entity Task {
|
|
546
|
+
property required id: string
|
|
547
|
+
property required title: string
|
|
548
|
+
property description: string?
|
|
549
|
+
property required assigneeId: string
|
|
550
|
+
property status: string = "pending"
|
|
551
|
+
property priority: string = "medium"
|
|
552
|
+
property dueDate: string?
|
|
553
|
+
property completedAt: string?
|
|
554
|
+
property createdAt: string = now()
|
|
555
|
+
|
|
556
|
+
belongsTo assignee: User
|
|
557
|
+
|
|
558
|
+
command startTask() {
|
|
559
|
+
guard self.status == "pending"
|
|
560
|
+
guard user.id == self.assigneeId
|
|
561
|
+
mutate status = "in_progress"
|
|
562
|
+
emit TaskStarted
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
command completeTask() {
|
|
566
|
+
guard self.status == "in_progress"
|
|
567
|
+
guard user.id == self.assigneeId
|
|
568
|
+
mutate status = "completed"
|
|
569
|
+
mutate completedAt = now()
|
|
570
|
+
emit TaskCompleted
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
command updateTitle(newTitle: string) {
|
|
574
|
+
guard user.id == self.assigneeId
|
|
575
|
+
guard newTitle != null and newTitle != ""
|
|
576
|
+
mutate title = newTitle
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
policy canRead read: user.id == self.assigneeId or user.role == "manager"
|
|
580
|
+
policy canWrite write: user.id == self.assigneeId or user.role == "manager"
|
|
581
|
+
policy canExecute execute: user.id == self.assigneeId or user.role == "manager"
|
|
582
|
+
|
|
583
|
+
constraint validStatus: self.status in ["pending", "in_progress", "completed"]
|
|
584
|
+
constraint hasTitle: length(self.title) > 0
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
entity User {
|
|
588
|
+
property required id: string
|
|
589
|
+
property required name: string
|
|
590
|
+
property required email: string
|
|
591
|
+
property role: string = "member"
|
|
592
|
+
property createdAt: string = now()
|
|
593
|
+
|
|
594
|
+
hasMany assignedTasks: Task
|
|
595
|
+
|
|
596
|
+
command register(userId: string, userName: string, emailAddr: string) {
|
|
597
|
+
guard userId != null and userId != ""
|
|
598
|
+
guard userName != null and userName != ""
|
|
599
|
+
guard emailAddr != null and emailAddr != ""
|
|
600
|
+
mutate id = userId
|
|
601
|
+
mutate name = userName
|
|
602
|
+
mutate email = emailAddr
|
|
603
|
+
mutate createdAt = now()
|
|
604
|
+
emit UserRegistered
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
policy canRead read: true
|
|
608
|
+
policy canWrite write: user.id == self.id or user.role == "admin"
|
|
609
|
+
policy canExecute execute: user.id == self.id or user.role == "admin"
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
event TaskStarted: "tasks.task.started" {
|
|
613
|
+
taskId: string
|
|
614
|
+
startedBy: string
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
event TaskCompleted: "tasks.task.completed" {
|
|
618
|
+
taskId: string
|
|
619
|
+
completedBy: string
|
|
620
|
+
completedAt: string
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
event UserRegistered: "user.registered" {
|
|
624
|
+
userId: string
|
|
625
|
+
name: string
|
|
626
|
+
registeredAt: string
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
store Task in supabase { table: "tasks" }
|
|
631
|
+
store User in memory
|
|
632
|
+
`;
|
|
633
|
+
}
|
|
634
|
+
else if (isEcommerce) {
|
|
635
|
+
output += `
|
|
636
|
+
module shop {
|
|
637
|
+
entity Product {
|
|
638
|
+
property required id: string
|
|
639
|
+
property required name: string
|
|
640
|
+
property description: string?
|
|
641
|
+
property price: number
|
|
642
|
+
property stock: number = 0
|
|
643
|
+
property active: boolean = true
|
|
644
|
+
property createdAt: string = now()
|
|
645
|
+
|
|
646
|
+
command updatePrice(newPrice: number) {
|
|
647
|
+
guard user.role == "admin"
|
|
648
|
+
guard newPrice >= 0
|
|
649
|
+
mutate price = newPrice
|
|
650
|
+
emit PriceUpdated
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
command adjustStock(delta: number) {
|
|
654
|
+
guard user.role == "admin"
|
|
655
|
+
mutate stock = stock + delta
|
|
656
|
+
emit StockAdjusted
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
policy canRead read: self.active == true or user.role == "admin"
|
|
660
|
+
policy canWrite write: user.role == "admin"
|
|
661
|
+
policy canExecute execute: user.role == "admin"
|
|
662
|
+
|
|
663
|
+
constraint validPrice: self.price >= 0
|
|
664
|
+
constraint validStock: self.stock >= 0
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
entity Order {
|
|
668
|
+
property required id: string
|
|
669
|
+
property required customerId: string
|
|
670
|
+
property status: string = "pending"
|
|
671
|
+
property total: number = 0
|
|
672
|
+
property createdAt: string = now()
|
|
673
|
+
|
|
674
|
+
belongsTo customer: User
|
|
675
|
+
|
|
676
|
+
command placeOrder(orderId: string, customer: string, amount: number) {
|
|
677
|
+
guard orderId != null and orderId != ""
|
|
678
|
+
guard customer != null and customer != ""
|
|
679
|
+
guard amount > 0
|
|
680
|
+
mutate id = orderId
|
|
681
|
+
mutate customerId = customer
|
|
682
|
+
mutate total = amount
|
|
683
|
+
mutate createdAt = now()
|
|
684
|
+
mutate status = "pending"
|
|
685
|
+
emit OrderPlaced
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
command completeOrder() {
|
|
689
|
+
guard self.status == "pending"
|
|
690
|
+
guard user.id == self.customerId
|
|
691
|
+
mutate status = "completed"
|
|
692
|
+
emit OrderCompleted
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
policy canRead read: user.id == self.customerId or user.role == "admin"
|
|
696
|
+
policy canWrite write: user.id == self.customerId or user.role == "admin"
|
|
697
|
+
policy canExecute execute: user.id == self.customerId or user.role == "admin"
|
|
698
|
+
|
|
699
|
+
constraint validStatus: self.status in ["pending", "completed", "cancelled"]
|
|
700
|
+
constraint validTotal: self.total >= 0
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
entity User {
|
|
704
|
+
property required id: string
|
|
705
|
+
property required name: string
|
|
706
|
+
property required email: string
|
|
707
|
+
property role: string = "customer"
|
|
708
|
+
property createdAt: string = now()
|
|
709
|
+
|
|
710
|
+
hasMany orders: Order
|
|
711
|
+
|
|
712
|
+
command register(userId: string, userName: string, emailAddr: string) {
|
|
713
|
+
guard userId != null and userId != ""
|
|
714
|
+
guard userName != null and userName != ""
|
|
715
|
+
guard emailAddr != null and emailAddr != ""
|
|
716
|
+
mutate id = userId
|
|
717
|
+
mutate name = userName
|
|
718
|
+
mutate email = emailAddr
|
|
719
|
+
mutate createdAt = now()
|
|
720
|
+
emit UserRegistered
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
policy canRead read: true
|
|
724
|
+
policy canWrite write: user.id == self.id or user.role == "admin"
|
|
725
|
+
policy canExecute execute: user.id == self.id or user.role == "admin"
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
event PriceUpdated: "shop.price.updated" {
|
|
729
|
+
productId: string
|
|
730
|
+
newPrice: number
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
event StockAdjusted: "shop.stock.adjusted" {
|
|
734
|
+
productId: string
|
|
735
|
+
newStock: number
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
event OrderPlaced: "shop.order.placed" {
|
|
739
|
+
orderId: string
|
|
740
|
+
customerId: string
|
|
741
|
+
total: number
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
event OrderCompleted: "shop.order.completed" {
|
|
745
|
+
orderId: string
|
|
746
|
+
completedAt: string
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
event UserRegistered: "user.registered" {
|
|
750
|
+
userId: string
|
|
751
|
+
name: string
|
|
752
|
+
registeredAt: string
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
store Product in supabase { table: "products" }
|
|
757
|
+
store Order in supabase { table: "orders" }
|
|
758
|
+
store User in supabase { table: "users" }
|
|
759
|
+
`;
|
|
760
|
+
}
|
|
761
|
+
else {
|
|
762
|
+
// Generic template
|
|
763
|
+
output += `
|
|
764
|
+
// Generated Manifest source for: "${prompt}"
|
|
765
|
+
// Customize this template to match your requirements
|
|
766
|
+
|
|
767
|
+
module app {
|
|
768
|
+
entity ${isUser ? 'User' : 'Entity'} {
|
|
769
|
+
property required id: string
|
|
770
|
+
property name: string
|
|
771
|
+
property readonly createdAt: string = now()
|
|
772
|
+
|
|
773
|
+
command update(name: string) {
|
|
774
|
+
guard user.id == self.id or user.role == "admin"
|
|
775
|
+
mutate self.name = name
|
|
776
|
+
emit EntityUpdated
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
policy canRead read: true
|
|
780
|
+
policy canWrite write: user.id == self.id or user.role == "admin"
|
|
781
|
+
policy canExecute execute: user.id == self.id or user.role == "admin"
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
event EntityUpdated: "app.entity.updated" {
|
|
785
|
+
entityId: string
|
|
786
|
+
updatedBy: string
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
store ${isUser ? 'User' : 'Entity'} in memory
|
|
791
|
+
`;
|
|
792
|
+
}
|
|
793
|
+
return output.trim();
|
|
794
|
+
}
|
|
795
|
+
// ---------------------------------------------------------------------------
|
|
796
|
+
// Validation
|
|
797
|
+
// ---------------------------------------------------------------------------
|
|
798
|
+
/**
|
|
799
|
+
* Validates generated Manifest source by compiling it.
|
|
800
|
+
*/
|
|
801
|
+
async function validateManifestSource(source) {
|
|
802
|
+
try {
|
|
803
|
+
const { compileToIR } = await loadCompiler();
|
|
804
|
+
const result = await compileToIR(source, { sourcePath: '<generated>' });
|
|
805
|
+
const errors = [];
|
|
806
|
+
const warnings = [];
|
|
807
|
+
if (result.diagnostics && result.diagnostics.length > 0) {
|
|
808
|
+
for (const d of result.diagnostics) {
|
|
809
|
+
const message = d.line ? `Line ${d.line}: ${d.message}` : d.message;
|
|
810
|
+
if (d.severity === 'error') {
|
|
811
|
+
errors.push(message);
|
|
812
|
+
}
|
|
813
|
+
else if (d.severity === 'warning') {
|
|
814
|
+
warnings.push(message);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
return {
|
|
819
|
+
valid: errors.length === 0 && !!result.ir,
|
|
820
|
+
errors,
|
|
821
|
+
warnings,
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
catch (error) {
|
|
825
|
+
return {
|
|
826
|
+
valid: false,
|
|
827
|
+
errors: [error instanceof Error ? error.message : String(error)],
|
|
828
|
+
warnings: [],
|
|
829
|
+
};
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
// ---------------------------------------------------------------------------
|
|
833
|
+
// Main Generation Loop
|
|
834
|
+
// ---------------------------------------------------------------------------
|
|
835
|
+
/**
|
|
836
|
+
* Generates Manifest source from a prompt with retry on validation failures.
|
|
837
|
+
*/
|
|
838
|
+
async function generateFromPrompt(prompt, options, spinner) {
|
|
839
|
+
const maxRetries = options.maxRetries ?? 3;
|
|
840
|
+
const iterations = [];
|
|
841
|
+
const systemPrompt = await buildSystemPrompt();
|
|
842
|
+
let attempt = 0;
|
|
843
|
+
while (attempt < maxRetries) {
|
|
844
|
+
attempt++;
|
|
845
|
+
spinner.text = `Generating Manifest source (attempt ${attempt}/${maxRetries})...`;
|
|
846
|
+
let manifestSource = '';
|
|
847
|
+
try {
|
|
848
|
+
// Try Anthropic API first
|
|
849
|
+
if (process.env.ANTHROPIC_API_KEY || options.apiKey) {
|
|
850
|
+
manifestSource = await callAnthropic(`${systemPrompt}\n\nUser request:\n${prompt}`, options);
|
|
851
|
+
}
|
|
852
|
+
else {
|
|
853
|
+
// Use template fallback
|
|
854
|
+
spinner.warn('No ANTHROPIC_API_KEY found, using template generator');
|
|
855
|
+
manifestSource = generateTemplateFallback(prompt);
|
|
856
|
+
}
|
|
857
|
+
// Validate the output
|
|
858
|
+
spinner.text = `Validating generated source (attempt ${attempt}/${maxRetries})...`;
|
|
859
|
+
if (options.skipValidation) {
|
|
860
|
+
return {
|
|
861
|
+
manifestSource,
|
|
862
|
+
iterations: [{
|
|
863
|
+
attempt,
|
|
864
|
+
manifestSource,
|
|
865
|
+
valid: true,
|
|
866
|
+
errors: [],
|
|
867
|
+
warnings: [],
|
|
868
|
+
}],
|
|
869
|
+
success: true,
|
|
870
|
+
totalAttempts: attempt,
|
|
871
|
+
};
|
|
872
|
+
}
|
|
873
|
+
const validation = await validateManifestSource(manifestSource);
|
|
874
|
+
iterations.push({
|
|
875
|
+
attempt,
|
|
876
|
+
manifestSource,
|
|
877
|
+
valid: validation.valid,
|
|
878
|
+
errors: validation.errors,
|
|
879
|
+
warnings: validation.warnings,
|
|
880
|
+
});
|
|
881
|
+
if (validation.valid) {
|
|
882
|
+
spinner.succeed(`Generated valid Manifest source (attempt ${attempt})`);
|
|
883
|
+
return {
|
|
884
|
+
manifestSource,
|
|
885
|
+
iterations,
|
|
886
|
+
success: true,
|
|
887
|
+
totalAttempts: attempt,
|
|
888
|
+
};
|
|
889
|
+
}
|
|
890
|
+
// Build retry prompt with errors
|
|
891
|
+
spinner.warn(`Attempt ${attempt} failed: ${validation.errors.length} error(s)`);
|
|
892
|
+
if (options.verbose) {
|
|
893
|
+
console.log('');
|
|
894
|
+
console.log(chalk.gray(' Errors:'));
|
|
895
|
+
for (const err of validation.errors) {
|
|
896
|
+
console.log(chalk.red(` - ${err}`));
|
|
897
|
+
}
|
|
898
|
+
console.log('');
|
|
899
|
+
}
|
|
900
|
+
// Update prompt for next iteration (will be used if not last attempt)
|
|
901
|
+
if (attempt < maxRetries) {
|
|
902
|
+
if (process.env.ANTHROPIC_API_KEY || options.apiKey) {
|
|
903
|
+
// Use Anthropic for retry
|
|
904
|
+
const retryPrompt = `${systemPrompt}\n\nUser request:\n${prompt}\n\nIMPORTANT: Your previous output had these errors:\n${validation.errors.map(e => ` - ${e}`).join('\n')}\n\nFix these issues and provide valid Manifest source code.`;
|
|
905
|
+
// Update for next call
|
|
906
|
+
prompt = retryPrompt; // This won't actually work, need to refactor
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
catch (error) {
|
|
911
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
912
|
+
iterations.push({
|
|
913
|
+
attempt,
|
|
914
|
+
manifestSource: manifestSource || '',
|
|
915
|
+
valid: false,
|
|
916
|
+
errors: [msg],
|
|
917
|
+
warnings: [],
|
|
918
|
+
});
|
|
919
|
+
if (attempt === maxRetries) {
|
|
920
|
+
spinner.fail(`Generation failed after ${attempt} attempts: ${msg}`);
|
|
921
|
+
return {
|
|
922
|
+
manifestSource: '',
|
|
923
|
+
iterations,
|
|
924
|
+
success: false,
|
|
925
|
+
totalAttempts: attempt,
|
|
926
|
+
};
|
|
927
|
+
}
|
|
928
|
+
spinner.warn(`Attempt ${attempt} failed: ${msg}`);
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
spinner.fail(`Failed to generate valid Manifest after ${maxRetries} attempts`);
|
|
932
|
+
return {
|
|
933
|
+
manifestSource: iterations[iterations.length - 1]?.manifestSource ?? '',
|
|
934
|
+
iterations,
|
|
935
|
+
success: false,
|
|
936
|
+
totalAttempts: maxRetries,
|
|
937
|
+
};
|
|
938
|
+
}
|
|
939
|
+
// ---------------------------------------------------------------------------
|
|
940
|
+
// Command Handler
|
|
941
|
+
// ---------------------------------------------------------------------------
|
|
942
|
+
export async function generateFromPromptCommand(prompt, options = {}) {
|
|
943
|
+
const spinner = ora('Preparing to generate').start();
|
|
944
|
+
try {
|
|
945
|
+
// Generate with retry loop
|
|
946
|
+
const result = await generateFromPrompt(prompt, options, spinner);
|
|
947
|
+
if (!result.success) {
|
|
948
|
+
spinner.fail('Failed to generate valid Manifest source');
|
|
949
|
+
console.error('');
|
|
950
|
+
console.error(chalk.red('Generation failed. Last errors:'));
|
|
951
|
+
for (const iter of result.iterations) {
|
|
952
|
+
for (const err of iter.errors) {
|
|
953
|
+
console.error(chalk.red(` - ${err}`));
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
process.exit(1);
|
|
957
|
+
}
|
|
958
|
+
// Output the result
|
|
959
|
+
const outputPath = options.output;
|
|
960
|
+
if (outputPath) {
|
|
961
|
+
const resolvedPath = path.resolve(process.cwd(), outputPath);
|
|
962
|
+
await fs.mkdir(path.dirname(resolvedPath), { recursive: true });
|
|
963
|
+
await fs.writeFile(resolvedPath, result.manifestSource, 'utf-8');
|
|
964
|
+
spinner.succeed(`Generated Manifest source written to ${outputPath}`);
|
|
965
|
+
}
|
|
966
|
+
else {
|
|
967
|
+
spinner.stop();
|
|
968
|
+
console.log('');
|
|
969
|
+
console.log(chalk.bold('Generated Manifest source:'));
|
|
970
|
+
console.log('─'.repeat(80));
|
|
971
|
+
console.log(result.manifestSource);
|
|
972
|
+
console.log('─'.repeat(80));
|
|
973
|
+
}
|
|
974
|
+
// Show iteration summary if verbose
|
|
975
|
+
if (options.verbose && result.iterations.length > 1) {
|
|
976
|
+
console.log('');
|
|
977
|
+
console.log(chalk.bold('Iteration summary:'));
|
|
978
|
+
for (const iter of result.iterations) {
|
|
979
|
+
const icon = iter.valid ? chalk.green('✓') : chalk.red('✗');
|
|
980
|
+
console.log(` ${icon} Attempt ${iter.attempt}: ${iter.errors.length} error(s), ${iter.warnings.length} warning(s)`);
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
catch (error) {
|
|
985
|
+
spinner.fail(`Generation failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
986
|
+
console.error(error);
|
|
987
|
+
process.exit(1);
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
//# sourceMappingURL=generate-from-prompt.js.map
|