@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,722 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* manifest scan command
|
|
3
|
+
*
|
|
4
|
+
* Scans .manifest files for configuration issues before runtime.
|
|
5
|
+
* Primary goal: "If scan passes, the code works."
|
|
6
|
+
*
|
|
7
|
+
* Checks performed:
|
|
8
|
+
* - Policy coverage: Every command has a policy
|
|
9
|
+
* - Store consistency: Store targets are recognized
|
|
10
|
+
* - Route context: Generated routes pass required user context
|
|
11
|
+
* - Property alignment: Manifest properties match Prisma schema (when configured)
|
|
12
|
+
*/
|
|
13
|
+
import fs from 'fs/promises';
|
|
14
|
+
import path from 'path';
|
|
15
|
+
import { glob } from 'glob';
|
|
16
|
+
import chalk from 'chalk';
|
|
17
|
+
import ora from 'ora';
|
|
18
|
+
import { loadAllConfigs, getStoreBindingsInfo, findPrismaSchemaPath, parsePrismaSchema, getPrismaModel, propertyExistsInModel, getPrismaFieldNames } from '../utils/config.js';
|
|
19
|
+
// Import compiler from the monorepo root package
|
|
20
|
+
async function loadCompiler() {
|
|
21
|
+
// Match the resolution path used by compile.ts and emit-registries.ts —
|
|
22
|
+
// go through the package's own subpath export map. Vitest aliases this
|
|
23
|
+
// to src/ during tests; the export map resolves to dist/ in production.
|
|
24
|
+
const module = await import('@angriff36/manifest/ir-compiler');
|
|
25
|
+
return module.compileToIR;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Check if an expression string references user context
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* Recursively walk an IRExpression (or a legacy `{expression: string}`
|
|
32
|
+
* wrapper) looking for any reference to `user.*`. This replaces a regex
|
|
33
|
+
* over the source string; on the v1 IR, guards/policies arrive as a
|
|
34
|
+
* discriminated union of expression nodes rather than as strings.
|
|
35
|
+
*/
|
|
36
|
+
function expressionReferencesUser(expr) {
|
|
37
|
+
if (expr == null)
|
|
38
|
+
return false;
|
|
39
|
+
// Legacy string form
|
|
40
|
+
if (typeof expr === 'string')
|
|
41
|
+
return /\buser\.[a-zA-Z_]/.test(expr);
|
|
42
|
+
// Legacy wrapper { expression: string }
|
|
43
|
+
if (typeof expr === 'object' && 'expression' in expr) {
|
|
44
|
+
return expressionReferencesUser(expr.expression);
|
|
45
|
+
}
|
|
46
|
+
// IRExpression discriminated union
|
|
47
|
+
if (typeof expr === 'object' && 'kind' in expr) {
|
|
48
|
+
const e = expr;
|
|
49
|
+
switch (e.kind) {
|
|
50
|
+
case 'identifier':
|
|
51
|
+
return e.name === 'user';
|
|
52
|
+
case 'member':
|
|
53
|
+
// user.X — object is `user` identifier (any property dereferenced
|
|
54
|
+
// counts as referencing user)
|
|
55
|
+
if (e.object && typeof e.object === 'object' &&
|
|
56
|
+
e.object.kind === 'identifier' &&
|
|
57
|
+
e.object.name === 'user') {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
return expressionReferencesUser(e.object);
|
|
61
|
+
case 'binary':
|
|
62
|
+
return expressionReferencesUser(e.left) || expressionReferencesUser(e.right);
|
|
63
|
+
case 'unary':
|
|
64
|
+
return expressionReferencesUser(e.operand);
|
|
65
|
+
case 'call': {
|
|
66
|
+
if (expressionReferencesUser(e.callee))
|
|
67
|
+
return true;
|
|
68
|
+
const args = Array.isArray(e.args) ? e.args : [];
|
|
69
|
+
return args.some(expressionReferencesUser);
|
|
70
|
+
}
|
|
71
|
+
default:
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Check if a command requires user context based on its guards and policies.
|
|
79
|
+
* Operates on the canonical IRCommand/IRPolicy shapes from
|
|
80
|
+
* `@angriff36/manifest/ir`; legacy `{expression: string}` shapes are
|
|
81
|
+
* still handled by `expressionReferencesUser`.
|
|
82
|
+
*/
|
|
83
|
+
function commandRequiresUserContext(command, policies) {
|
|
84
|
+
for (const guard of command.guards || []) {
|
|
85
|
+
if (expressionReferencesUser(guard))
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
const policyMap = new Map(policies.map(p => [p.name, p]));
|
|
89
|
+
for (const policyName of command.policies || []) {
|
|
90
|
+
const policy = policyMap.get(policyName);
|
|
91
|
+
if (policy?.expression && expressionReferencesUser(policy.expression)) {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Scan a route file to check if it properly passes user context
|
|
99
|
+
*/
|
|
100
|
+
async function scanRouteFile(filePath, commandsRequiringUserContext) {
|
|
101
|
+
const warnings = [];
|
|
102
|
+
let routesScanned = 0;
|
|
103
|
+
const content = await fs.readFile(filePath, 'utf-8');
|
|
104
|
+
// Check if this is a command route (POST handler that uses createManifestRuntime)
|
|
105
|
+
const isCommandRoute = /createManifestRuntime|runCommand/.test(content);
|
|
106
|
+
if (!isCommandRoute) {
|
|
107
|
+
return { warnings, routesScanned: 0 };
|
|
108
|
+
}
|
|
109
|
+
routesScanned = 1;
|
|
110
|
+
// Extract entity and command from the route file path or content
|
|
111
|
+
// Routes typically follow: app/api/{entity}/{command}/route.ts pattern
|
|
112
|
+
const pathParts = filePath.split(/[/\\]/);
|
|
113
|
+
const apiIndex = pathParts.findIndex(p => p === 'api');
|
|
114
|
+
let entityName = null;
|
|
115
|
+
let commandName = null;
|
|
116
|
+
if (apiIndex >= 0 && pathParts.length > apiIndex + 2) {
|
|
117
|
+
entityName = pathParts[apiIndex + 1];
|
|
118
|
+
// Check if this is a command route (not a list route)
|
|
119
|
+
const possibleCommand = pathParts[apiIndex + 2];
|
|
120
|
+
if (possibleCommand !== 'list' && possibleCommand !== 'route.ts') {
|
|
121
|
+
commandName = possibleCommand;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// Also try to extract from content
|
|
125
|
+
const entityMatch = content.match(/entityName:\s*["']([^"']+)["']/);
|
|
126
|
+
const commandMatch = content.match(/runCommand\(\s*["']([^"']+)["']/);
|
|
127
|
+
if (entityMatch)
|
|
128
|
+
entityName = entityMatch[1];
|
|
129
|
+
if (commandMatch)
|
|
130
|
+
commandName = commandMatch[1];
|
|
131
|
+
if (!entityName || !commandName) {
|
|
132
|
+
return { warnings, routesScanned };
|
|
133
|
+
}
|
|
134
|
+
const commandKey = `${entityName}.${commandName}`;
|
|
135
|
+
// Only check routes for commands that require user context
|
|
136
|
+
if (!commandsRequiringUserContext.has(commandKey)) {
|
|
137
|
+
return { warnings, routesScanned };
|
|
138
|
+
}
|
|
139
|
+
// Check if the route passes user context
|
|
140
|
+
const passesUserContext = /user:\s*\{|user:\s*userId|user:\s*{\s*id:\s*userId/.test(content);
|
|
141
|
+
if (!passesUserContext) {
|
|
142
|
+
warnings.push({
|
|
143
|
+
file: filePath,
|
|
144
|
+
message: `Route for '${commandKey}' does not pass user context, but command requires it.`,
|
|
145
|
+
suggestion: `Ensure the route passes user context to createManifestRuntime:\n const runtime = await createManifestRuntime({ user: { id: userId, ... } });\n\n Or configure resolveUser in manifest.config.ts for auto-injection.`,
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
return { warnings, routesScanned };
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Scan project for route files
|
|
152
|
+
*/
|
|
153
|
+
async function scanRoutes(projectRoot, ir, spinner) {
|
|
154
|
+
const warnings = [];
|
|
155
|
+
let routesScanned = 0;
|
|
156
|
+
// Build set of commands requiring user context
|
|
157
|
+
const commandsRequiringUserContext = new Set();
|
|
158
|
+
for (const command of ir.commands || []) {
|
|
159
|
+
if (!command.entity || !command.name)
|
|
160
|
+
continue;
|
|
161
|
+
if (commandRequiresUserContext(command, ir.policies || [])) {
|
|
162
|
+
commandsRequiringUserContext.add(`${command.entity}.${command.name}`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
// If no commands require user context, skip route scanning
|
|
166
|
+
if (commandsRequiringUserContext.size === 0) {
|
|
167
|
+
return { warnings, routesScanned: 0 };
|
|
168
|
+
}
|
|
169
|
+
// Find route files (Next.js App Router pattern)
|
|
170
|
+
const routePatterns = [
|
|
171
|
+
'app/api/**/route.ts',
|
|
172
|
+
'app/api/**/route.js',
|
|
173
|
+
'src/app/api/**/route.ts',
|
|
174
|
+
'src/app/api/**/route.js',
|
|
175
|
+
'apps/*/app/api/**/route.ts',
|
|
176
|
+
'apps/*/app/api/**/route.js',
|
|
177
|
+
];
|
|
178
|
+
const routeFiles = [];
|
|
179
|
+
for (const pattern of routePatterns) {
|
|
180
|
+
const files = await glob(pattern, {
|
|
181
|
+
cwd: projectRoot,
|
|
182
|
+
ignore: ['**/node_modules/**', '**/.next/**'],
|
|
183
|
+
absolute: true
|
|
184
|
+
});
|
|
185
|
+
routeFiles.push(...files);
|
|
186
|
+
}
|
|
187
|
+
if (routeFiles.length === 0) {
|
|
188
|
+
// No route files found - informational warning
|
|
189
|
+
if (commandsRequiringUserContext.size > 0) {
|
|
190
|
+
spinner.info(`No route files found. ${commandsRequiringUserContext.size} command(s) require user context.`);
|
|
191
|
+
}
|
|
192
|
+
return { warnings, routesScanned: 0 };
|
|
193
|
+
}
|
|
194
|
+
// Scan each route file
|
|
195
|
+
for (const routeFile of routeFiles) {
|
|
196
|
+
const result = await scanRouteFile(routeFile, commandsRequiringUserContext);
|
|
197
|
+
warnings.push(...result.warnings);
|
|
198
|
+
routesScanned += result.routesScanned;
|
|
199
|
+
}
|
|
200
|
+
return { warnings, routesScanned };
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Known built-in store targets (from runtime-engine.ts)
|
|
204
|
+
*/
|
|
205
|
+
const BUILTIN_STORE_TARGETS = ['memory', 'localStorage', 'postgres', 'supabase'];
|
|
206
|
+
/**
|
|
207
|
+
* Get all manifest files from source pattern
|
|
208
|
+
*/
|
|
209
|
+
async function getManifestFiles(source, options) {
|
|
210
|
+
// If no source provided, use current directory with glob pattern
|
|
211
|
+
if (!source) {
|
|
212
|
+
const pattern = options.glob || '**/*.manifest';
|
|
213
|
+
const files = await glob(pattern, { cwd: process.cwd(), ignore: ['**/node_modules/**'] });
|
|
214
|
+
return files.map(f => path.resolve(process.cwd(), f));
|
|
215
|
+
}
|
|
216
|
+
const resolved = path.resolve(process.cwd(), source);
|
|
217
|
+
const stat = await fs.stat(resolved).catch(() => null);
|
|
218
|
+
if (!stat) {
|
|
219
|
+
throw new Error(`Source not found: ${source}`);
|
|
220
|
+
}
|
|
221
|
+
// If source is a file, return it directly
|
|
222
|
+
if (stat.isFile()) {
|
|
223
|
+
return [resolved];
|
|
224
|
+
}
|
|
225
|
+
// If source is a directory, use glob pattern
|
|
226
|
+
const pattern = options.glob || '**/*.manifest';
|
|
227
|
+
const files = await glob(pattern, { cwd: resolved, ignore: ['**/node_modules/**'] });
|
|
228
|
+
return files.map(f => path.resolve(resolved, f));
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Check if a command is covered by any policy
|
|
232
|
+
*
|
|
233
|
+
* A policy covers a command if:
|
|
234
|
+
* 1. Policy action is 'execute' or 'all'
|
|
235
|
+
* 2. Policy entity matches the command's entity (or policy is global)
|
|
236
|
+
*/
|
|
237
|
+
function isCommandCoveredByPolicy(entityName, policies) {
|
|
238
|
+
for (const policy of policies) {
|
|
239
|
+
// Policy must have execute or all action
|
|
240
|
+
if (policy.action !== 'execute' && policy.action !== 'all') {
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
// Policy must match the entity (or be global with no entity)
|
|
244
|
+
if (policy.entity === undefined || policy.entity === entityName) {
|
|
245
|
+
return true;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Find the line number of a command definition in source
|
|
252
|
+
*/
|
|
253
|
+
function findCommandLine(sourceLines, commandName) {
|
|
254
|
+
const commandPattern = new RegExp(`command\\s+${commandName}\\s*\\(`);
|
|
255
|
+
for (let i = 0; i < sourceLines.length; i++) {
|
|
256
|
+
if (commandPattern.test(sourceLines[i])) {
|
|
257
|
+
return i + 1;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
return undefined;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Find the line number of a store declaration in source
|
|
264
|
+
*/
|
|
265
|
+
function findStoreLine(sourceLines, entityName, target) {
|
|
266
|
+
const storePattern = new RegExp(`store\\s+${entityName}\\s+in\\s+${target}`);
|
|
267
|
+
for (let i = 0; i < sourceLines.length; i++) {
|
|
268
|
+
if (storePattern.test(sourceLines[i])) {
|
|
269
|
+
return i + 1;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return undefined;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Scan a single manifest file for issues
|
|
276
|
+
*/
|
|
277
|
+
async function scanFile(filePath, spinner, runtimeConfig) {
|
|
278
|
+
const compileToIR = await loadCompiler();
|
|
279
|
+
const errors = [];
|
|
280
|
+
const warnings = [];
|
|
281
|
+
let commandsChecked = 0;
|
|
282
|
+
let ir = null;
|
|
283
|
+
spinner.text = `Scanning ${path.relative(process.cwd(), filePath)}`;
|
|
284
|
+
// Read source
|
|
285
|
+
const source = await fs.readFile(filePath, 'utf-8');
|
|
286
|
+
const sourceLines = source.split('\n');
|
|
287
|
+
// Compile to IR
|
|
288
|
+
const result = await compileToIR(source);
|
|
289
|
+
// Check for compilation errors first
|
|
290
|
+
if (result.diagnostics && result.diagnostics.length > 0) {
|
|
291
|
+
for (const diagnostic of result.diagnostics) {
|
|
292
|
+
if (diagnostic.severity === 'error') {
|
|
293
|
+
errors.push({
|
|
294
|
+
file: filePath,
|
|
295
|
+
line: diagnostic.line,
|
|
296
|
+
entityName: '',
|
|
297
|
+
commandName: '',
|
|
298
|
+
message: diagnostic.message,
|
|
299
|
+
suggestion: 'Fix the compilation error before running the scanner.',
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
// If there are compilation errors, return early
|
|
304
|
+
if (errors.length > 0) {
|
|
305
|
+
return { errors, warnings, commandsChecked: 0, ir: null };
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
// No IR means nothing to scan
|
|
309
|
+
if (!result.ir) {
|
|
310
|
+
return { errors, warnings, commandsChecked: 0, ir: null };
|
|
311
|
+
}
|
|
312
|
+
ir = result.ir;
|
|
313
|
+
// Build a map of entity name → entity for command lookup
|
|
314
|
+
const entityMap = new Map();
|
|
315
|
+
for (const entity of ir.entities || []) {
|
|
316
|
+
entityMap.set(entity.name, entity);
|
|
317
|
+
}
|
|
318
|
+
// Build a map of entity → store target from ir.stores
|
|
319
|
+
const storeMap = new Map();
|
|
320
|
+
for (const store of ir.stores || []) {
|
|
321
|
+
storeMap.set(store.entity, store.target);
|
|
322
|
+
}
|
|
323
|
+
// Check each command in ir.commands for policy coverage
|
|
324
|
+
for (const command of ir.commands || []) {
|
|
325
|
+
// Skip commands without required fields (shouldn't happen in valid IR)
|
|
326
|
+
if (!command.entity || !command.name) {
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
commandsChecked++;
|
|
330
|
+
const entityName = command.entity;
|
|
331
|
+
const commandName = command.name;
|
|
332
|
+
// Check if command is covered by policies
|
|
333
|
+
const isCovered = isCommandCoveredByPolicy(entityName, ir.policies || []);
|
|
334
|
+
if (!isCovered) {
|
|
335
|
+
const lineNum = findCommandLine(sourceLines, commandName);
|
|
336
|
+
errors.push({
|
|
337
|
+
file: filePath,
|
|
338
|
+
line: lineNum,
|
|
339
|
+
entityName,
|
|
340
|
+
commandName,
|
|
341
|
+
message: `Command '${entityName}.${commandName}' has no policy.`,
|
|
342
|
+
suggestion: `Add a policy:\n policy ${entityName}Can${capitalize(commandName)} execute: user.role in ["role1", "role2"]\n \n Or set entity defaults:\n default policy execute: user.authenticated`,
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
// Check store targets are recognized
|
|
347
|
+
const storeBindingsInfo = getStoreBindingsInfo(runtimeConfig);
|
|
348
|
+
for (const store of ir.stores || []) {
|
|
349
|
+
const isBuiltin = BUILTIN_STORE_TARGETS.includes(store.target);
|
|
350
|
+
const hasConfigBinding = storeBindingsInfo.hasStore(store.entity);
|
|
351
|
+
if (!isBuiltin && !hasConfigBinding) {
|
|
352
|
+
// Custom store target without config binding
|
|
353
|
+
const lineNum = findStoreLine(sourceLines, store.entity, store.target);
|
|
354
|
+
warnings.push({
|
|
355
|
+
file: filePath,
|
|
356
|
+
line: lineNum,
|
|
357
|
+
message: `Store target '${store.target}' is not a built-in target and has no config binding.`,
|
|
358
|
+
suggestion: `Built-in targets: ${BUILTIN_STORE_TARGETS.join(', ')}\n \n If using a custom store, bind it in manifest.config.ts:\n stores: { ${store.entity}: { implementation: YourStoreClass } }`,
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
else if (!isBuiltin && hasConfigBinding) {
|
|
362
|
+
// Custom store target WITH config binding - just informational
|
|
363
|
+
// This is valid usage, no warning needed
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
return { errors, warnings, commandsChecked, ir };
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Capitalize first letter of a string
|
|
370
|
+
*/
|
|
371
|
+
function capitalize(str) {
|
|
372
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
373
|
+
}
|
|
374
|
+
// ============================================================================
|
|
375
|
+
// Property Alignment Scanner (P1-B)
|
|
376
|
+
// ============================================================================
|
|
377
|
+
/**
|
|
378
|
+
* Levenshtein distance between two strings
|
|
379
|
+
* Used for "Did you mean X?" suggestions
|
|
380
|
+
*/
|
|
381
|
+
function levenshteinDistance(a, b) {
|
|
382
|
+
if (a.length === 0)
|
|
383
|
+
return b.length;
|
|
384
|
+
if (b.length === 0)
|
|
385
|
+
return a.length;
|
|
386
|
+
const matrix = [];
|
|
387
|
+
for (let i = 0; i <= b.length; i++) {
|
|
388
|
+
matrix[i] = [i];
|
|
389
|
+
}
|
|
390
|
+
for (let j = 0; j <= a.length; j++) {
|
|
391
|
+
matrix[0][j] = j;
|
|
392
|
+
}
|
|
393
|
+
for (let i = 1; i <= b.length; i++) {
|
|
394
|
+
for (let j = 1; j <= a.length; j++) {
|
|
395
|
+
if (b.charAt(i - 1) === a.charAt(j - 1)) {
|
|
396
|
+
matrix[i][j] = matrix[i - 1][j - 1];
|
|
397
|
+
}
|
|
398
|
+
else {
|
|
399
|
+
matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution
|
|
400
|
+
matrix[i][j - 1] + 1, // insertion
|
|
401
|
+
matrix[i - 1][j] + 1 // deletion
|
|
402
|
+
);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
return matrix[b.length][a.length];
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Find closest matching Prisma field names for suggestions
|
|
410
|
+
*/
|
|
411
|
+
function findClosestFields(propertyName, fieldNames, maxDistance = 3) {
|
|
412
|
+
const suggestions = [];
|
|
413
|
+
for (const fieldName of fieldNames) {
|
|
414
|
+
const distance = levenshteinDistance(propertyName.toLowerCase(), fieldName.toLowerCase());
|
|
415
|
+
if (distance <= maxDistance) {
|
|
416
|
+
suggestions.push({ name: fieldName, distance });
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
// Sort by distance and return names
|
|
420
|
+
return suggestions
|
|
421
|
+
.sort((a, b) => a.distance - b.distance)
|
|
422
|
+
.slice(0, 3)
|
|
423
|
+
.map(s => s.name);
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Scan an entity's properties against a Prisma model for alignment issues
|
|
427
|
+
*/
|
|
428
|
+
function scanPropertyAlignment(entityName, entityProperties, prismaSchema, prismaModelName, propertyMapping) {
|
|
429
|
+
const warnings = [];
|
|
430
|
+
const model = getPrismaModel(prismaSchema, prismaModelName);
|
|
431
|
+
if (!model) {
|
|
432
|
+
warnings.push({
|
|
433
|
+
file: '',
|
|
434
|
+
message: `Entity '${entityName}' references Prisma model '${prismaModelName}' but model not found in schema.`,
|
|
435
|
+
suggestion: `Available models: ${prismaSchema.models.map(m => m.name).join(', ')}`,
|
|
436
|
+
});
|
|
437
|
+
return warnings;
|
|
438
|
+
}
|
|
439
|
+
const fieldNames = getPrismaFieldNames(model);
|
|
440
|
+
for (const prop of entityProperties) {
|
|
441
|
+
const exists = propertyExistsInModel(model, prop.name, propertyMapping);
|
|
442
|
+
if (!exists) {
|
|
443
|
+
// Find suggestions
|
|
444
|
+
const suggestions = findClosestFields(prop.name, fieldNames);
|
|
445
|
+
let suggestionMsg = '';
|
|
446
|
+
if (suggestions.length > 0) {
|
|
447
|
+
suggestionMsg = `\n Did you mean: ${suggestions.join(', ')}?`;
|
|
448
|
+
}
|
|
449
|
+
// Check if property might need mapping
|
|
450
|
+
const hasMapping = propertyMapping && Object.values(propertyMapping).includes(prop.name);
|
|
451
|
+
if (hasMapping) {
|
|
452
|
+
continue; // Property is mapped, skip warning
|
|
453
|
+
}
|
|
454
|
+
warnings.push({
|
|
455
|
+
file: '',
|
|
456
|
+
message: `Entity '${entityName}' property '${prop.name}' (${prop.type}) not found in Prisma model '${prismaModelName}'.`,
|
|
457
|
+
suggestion: `Add field to Prisma model or configure property mapping in manifest.config.ts.${suggestionMsg}`,
|
|
458
|
+
});
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
return warnings;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Scan all entities for property alignment issues using Prisma schema
|
|
465
|
+
*/
|
|
466
|
+
async function scanPropertyAlignmentForIR(ir, runtimeConfig, buildConfig, projectRoot) {
|
|
467
|
+
const warnings = [];
|
|
468
|
+
// Find Prisma schema
|
|
469
|
+
const schemaPath = await findPrismaSchemaPath(projectRoot, buildConfig);
|
|
470
|
+
if (!schemaPath) {
|
|
471
|
+
// No Prisma schema found - skip this check
|
|
472
|
+
return warnings;
|
|
473
|
+
}
|
|
474
|
+
// Parse schema
|
|
475
|
+
let prismaSchema;
|
|
476
|
+
try {
|
|
477
|
+
prismaSchema = await parsePrismaSchema(schemaPath);
|
|
478
|
+
}
|
|
479
|
+
catch (error) {
|
|
480
|
+
warnings.push({
|
|
481
|
+
file: schemaPath,
|
|
482
|
+
message: `Failed to parse Prisma schema: ${error instanceof Error ? (error instanceof Error ? error.message : String(error)) : String(error)}`,
|
|
483
|
+
});
|
|
484
|
+
return warnings;
|
|
485
|
+
}
|
|
486
|
+
if (prismaSchema.models.length === 0) {
|
|
487
|
+
warnings.push({
|
|
488
|
+
file: schemaPath,
|
|
489
|
+
message: 'Prisma schema found but contains no models.',
|
|
490
|
+
});
|
|
491
|
+
return warnings;
|
|
492
|
+
}
|
|
493
|
+
// Get store bindings for property mapping
|
|
494
|
+
const storeBindingsInfo = getStoreBindingsInfo(runtimeConfig);
|
|
495
|
+
// Check each entity
|
|
496
|
+
for (const entity of ir.entities || []) {
|
|
497
|
+
if (!entity.name || !entity.properties)
|
|
498
|
+
continue;
|
|
499
|
+
// Get the Prisma model name from config binding
|
|
500
|
+
const prismaModelName = storeBindingsInfo.getPrismaModel(entity.name);
|
|
501
|
+
if (!prismaModelName) {
|
|
502
|
+
// Entity has no Prisma model binding - skip
|
|
503
|
+
continue;
|
|
504
|
+
}
|
|
505
|
+
// Get property mapping if configured
|
|
506
|
+
const propertyMapping = storeBindingsInfo.getPropertyMapping(entity.name);
|
|
507
|
+
// Scan properties — flatten IRType ({ name, nullable }) to a string
|
|
508
|
+
// so the helper's shape doesn't have to know about IR's full type
|
|
509
|
+
// graph. `entity.properties` is optional on IREntity; guard accordingly.
|
|
510
|
+
const entityWarnings = scanPropertyAlignment(entity.name, (entity.properties ?? []).map((p) => ({ name: p.name, type: p.type.name })), prismaSchema, prismaModelName, propertyMapping);
|
|
511
|
+
// Add file context to warnings
|
|
512
|
+
for (const warning of entityWarnings) {
|
|
513
|
+
warnings.push({
|
|
514
|
+
...warning,
|
|
515
|
+
message: `[${entity.name}] ${warning.message}`,
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
return warnings;
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Format relative path for display
|
|
523
|
+
*/
|
|
524
|
+
function formatPath(filePath) {
|
|
525
|
+
return path.relative(process.cwd(), filePath) || filePath;
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Scan command handler
|
|
529
|
+
*/
|
|
530
|
+
export async function scanCommand(source, options = {}) {
|
|
531
|
+
const spinner = ora('Scanning manifest files').start();
|
|
532
|
+
try {
|
|
533
|
+
// Load runtime config for store binding validation
|
|
534
|
+
let runtimeConfig = null;
|
|
535
|
+
try {
|
|
536
|
+
const configs = await loadAllConfigs(process.cwd());
|
|
537
|
+
runtimeConfig = configs.runtime;
|
|
538
|
+
}
|
|
539
|
+
catch {
|
|
540
|
+
// Config loading failed - continue without config validation
|
|
541
|
+
}
|
|
542
|
+
// Get manifest files
|
|
543
|
+
const files = await getManifestFiles(source || '', options);
|
|
544
|
+
if (files.length === 0) {
|
|
545
|
+
spinner.warn('No .manifest files found');
|
|
546
|
+
console.log(' Create a .manifest file or specify a source pattern');
|
|
547
|
+
console.log(' Run `manifest init` to get started');
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
spinner.info(`Found ${files.length} file(s) to scan`);
|
|
551
|
+
// Scan each file
|
|
552
|
+
const result = {
|
|
553
|
+
errors: [],
|
|
554
|
+
warnings: [],
|
|
555
|
+
filesScanned: files.length,
|
|
556
|
+
commandsChecked: 0,
|
|
557
|
+
routesScanned: 0,
|
|
558
|
+
};
|
|
559
|
+
// Collect all IRs for route scanning
|
|
560
|
+
const allIRs = [];
|
|
561
|
+
for (const file of files) {
|
|
562
|
+
const fileSpinner = ora().start();
|
|
563
|
+
try {
|
|
564
|
+
const fileResult = await scanFile(file, fileSpinner, runtimeConfig);
|
|
565
|
+
result.errors.push(...fileResult.errors);
|
|
566
|
+
result.warnings.push(...fileResult.warnings);
|
|
567
|
+
result.commandsChecked += fileResult.commandsChecked;
|
|
568
|
+
// Collect IR for route scanning
|
|
569
|
+
if (fileResult.ir) {
|
|
570
|
+
allIRs.push(fileResult.ir);
|
|
571
|
+
}
|
|
572
|
+
if (fileResult.errors.length === 0 && fileResult.warnings.length === 0) {
|
|
573
|
+
fileSpinner.succeed(`${formatPath(file)} - OK`);
|
|
574
|
+
}
|
|
575
|
+
else if (fileResult.errors.length > 0) {
|
|
576
|
+
fileSpinner.fail(`${formatPath(file)} - ${fileResult.errors.length} error(s)`);
|
|
577
|
+
}
|
|
578
|
+
else {
|
|
579
|
+
fileSpinner.warn(`${formatPath(file)} - ${fileResult.warnings.length} warning(s)`);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
catch (error) {
|
|
583
|
+
fileSpinner.fail(`Failed to scan ${formatPath(file)}: ${(error instanceof Error ? error.message : String(error))}`);
|
|
584
|
+
result.errors.push({
|
|
585
|
+
file,
|
|
586
|
+
entityName: '',
|
|
587
|
+
commandName: '',
|
|
588
|
+
message: (error instanceof Error ? error.message : String(error)),
|
|
589
|
+
suggestion: 'Check the file for syntax errors.',
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
// Scan routes for context issues (if no compilation errors)
|
|
594
|
+
if (result.errors.length === 0 && allIRs.length > 0) {
|
|
595
|
+
const routeSpinner = ora('Scanning routes for context issues').start();
|
|
596
|
+
try {
|
|
597
|
+
// Merge all IRs for route scanning. scanRoutes only reads
|
|
598
|
+
// `commands` and `policies` — we cast through `Partial<ScanIR>`
|
|
599
|
+
// because we deliberately produce a partial-IR shape here.
|
|
600
|
+
const mergedIR = {
|
|
601
|
+
commands: allIRs.flatMap(ir => ir.commands || []),
|
|
602
|
+
policies: allIRs.flatMap(ir => ir.policies || []),
|
|
603
|
+
};
|
|
604
|
+
const routeResult = await scanRoutes(process.cwd(), mergedIR, routeSpinner);
|
|
605
|
+
result.warnings.push(...routeResult.warnings);
|
|
606
|
+
result.routesScanned = routeResult.routesScanned;
|
|
607
|
+
if (routeResult.warnings.length === 0 && routeResult.routesScanned > 0) {
|
|
608
|
+
routeSpinner.succeed(`Scanned ${routeResult.routesScanned} route(s) - OK`);
|
|
609
|
+
}
|
|
610
|
+
else if (routeResult.warnings.length > 0) {
|
|
611
|
+
routeSpinner.warn(`Found ${routeResult.warnings.length} route context issue(s)`);
|
|
612
|
+
}
|
|
613
|
+
else {
|
|
614
|
+
routeSpinner.info('No route files found to scan');
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
catch (error) {
|
|
618
|
+
routeSpinner.info(`Route scanning skipped: ${(error instanceof Error ? (error instanceof Error ? error.message : String(error)) : String(error))}`);
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
// Scan property alignment (Prisma schema validation) - P1-B
|
|
622
|
+
if (result.errors.length === 0 && allIRs.length > 0) {
|
|
623
|
+
const propertySpinner = ora('Scanning property alignment with Prisma schema').start();
|
|
624
|
+
try {
|
|
625
|
+
// Get build config for schema path
|
|
626
|
+
const configs = await loadAllConfigs(process.cwd());
|
|
627
|
+
// Merge all IRs for property scanning — partial-IR shape; same
|
|
628
|
+
// cast rationale as the route-scan path above.
|
|
629
|
+
const mergedIR = {
|
|
630
|
+
entities: allIRs.flatMap(ir => ir.entities || []),
|
|
631
|
+
commands: allIRs.flatMap(ir => ir.commands || []),
|
|
632
|
+
policies: allIRs.flatMap(ir => ir.policies || []),
|
|
633
|
+
};
|
|
634
|
+
const propertyWarnings = await scanPropertyAlignmentForIR(mergedIR, runtimeConfig, configs.build, process.cwd());
|
|
635
|
+
result.warnings.push(...propertyWarnings);
|
|
636
|
+
if (propertyWarnings.length === 0) {
|
|
637
|
+
propertySpinner.succeed('Property alignment check passed');
|
|
638
|
+
}
|
|
639
|
+
else {
|
|
640
|
+
propertySpinner.warn(`Found ${propertyWarnings.length} property alignment issue(s)`);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
catch (error) {
|
|
644
|
+
propertySpinner.info(`Property alignment scanning skipped: ${(error instanceof Error ? (error instanceof Error ? error.message : String(error)) : String(error))}`);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
// Output results
|
|
648
|
+
if (options.format === 'json') {
|
|
649
|
+
console.log(JSON.stringify(result, null, 2));
|
|
650
|
+
return;
|
|
651
|
+
}
|
|
652
|
+
console.log('');
|
|
653
|
+
// Show errors
|
|
654
|
+
if (result.errors.length > 0) {
|
|
655
|
+
console.log(chalk.red.bold('ERRORS:'));
|
|
656
|
+
console.log('');
|
|
657
|
+
for (const error of result.errors) {
|
|
658
|
+
const location = error.line
|
|
659
|
+
? `${formatPath(error.file)}:${error.line}`
|
|
660
|
+
: formatPath(error.file);
|
|
661
|
+
console.log(chalk.red(` ${location}`));
|
|
662
|
+
if (error.entityName && error.commandName) {
|
|
663
|
+
console.log(` Command '${error.entityName}.${error.commandName}' has no policy.`);
|
|
664
|
+
}
|
|
665
|
+
else {
|
|
666
|
+
console.log(` ${(error instanceof Error ? error.message : String(error))}`);
|
|
667
|
+
}
|
|
668
|
+
if (error.suggestion) {
|
|
669
|
+
console.log(chalk.gray(` → ${error.suggestion.split('\n').join('\n → ')}`));
|
|
670
|
+
}
|
|
671
|
+
console.log('');
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
// Show warnings
|
|
675
|
+
if (result.warnings.length > 0) {
|
|
676
|
+
console.log(chalk.yellow.bold('WARNINGS:'));
|
|
677
|
+
console.log('');
|
|
678
|
+
for (const warning of result.warnings) {
|
|
679
|
+
const location = warning.line
|
|
680
|
+
? `${formatPath(warning.file)}:${warning.line}`
|
|
681
|
+
: formatPath(warning.file);
|
|
682
|
+
console.log(chalk.yellow(` ${location}`));
|
|
683
|
+
console.log(` ${warning.message}`);
|
|
684
|
+
if (warning.suggestion) {
|
|
685
|
+
console.log(chalk.gray(` → ${warning.suggestion.split('\n').join('\n → ')}`));
|
|
686
|
+
}
|
|
687
|
+
console.log('');
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
// Summary
|
|
691
|
+
console.log(chalk.bold('SUMMARY:'));
|
|
692
|
+
console.log(` Files scanned: ${result.filesScanned}`);
|
|
693
|
+
console.log(` Commands checked: ${result.commandsChecked}`);
|
|
694
|
+
if (result.routesScanned > 0) {
|
|
695
|
+
console.log(` Routes scanned: ${result.routesScanned}`);
|
|
696
|
+
}
|
|
697
|
+
if (result.errors.length === 0 && result.warnings.length === 0) {
|
|
698
|
+
spinner.succeed('Scan passed - no issues found');
|
|
699
|
+
console.log(chalk.green('\n If `manifest scan` passes, the code works.'));
|
|
700
|
+
}
|
|
701
|
+
else if (result.errors.length === 0) {
|
|
702
|
+
console.log(chalk.yellow(` Warnings: ${result.warnings.length}`));
|
|
703
|
+
if (options.strict) {
|
|
704
|
+
spinner.fail('Scan failed with warnings (strict mode)');
|
|
705
|
+
process.exit(1);
|
|
706
|
+
}
|
|
707
|
+
else {
|
|
708
|
+
spinner.warn('Scan passed with warnings');
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
else {
|
|
712
|
+
spinner.fail(`Scan failed with ${result.errors.length} error(s), ${result.warnings.length} warning(s)`);
|
|
713
|
+
process.exit(1);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
catch (error) {
|
|
717
|
+
spinner.fail(`Scan failed: ${(error instanceof Error ? (error instanceof Error ? error.message : String(error)) : String(error))}`);
|
|
718
|
+
console.error(error);
|
|
719
|
+
process.exit(1);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
//# sourceMappingURL=scan.js.map
|