@prodara/compiler 0.1.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/README.md +204 -0
- package/dist/agent/agent.d.ts +10 -0
- package/dist/agent/agent.d.ts.map +1 -0
- package/dist/agent/agent.js +122 -0
- package/dist/agent/agent.js.map +1 -0
- package/dist/agent/api-client.d.ts +29 -0
- package/dist/agent/api-client.d.ts.map +1 -0
- package/dist/agent/api-client.js +167 -0
- package/dist/agent/api-client.js.map +1 -0
- package/dist/agent/index.d.ts +5 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +3 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/party.d.ts +48 -0
- package/dist/agent/party.d.ts.map +1 -0
- package/dist/agent/party.js +79 -0
- package/dist/agent/party.js.map +1 -0
- package/dist/agent/types.d.ts +35 -0
- package/dist/agent/types.d.ts.map +1 -0
- package/dist/agent/types.js +5 -0
- package/dist/agent/types.js.map +1 -0
- package/dist/audit/audit.d.ts +32 -0
- package/dist/audit/audit.d.ts.map +1 -0
- package/dist/audit/audit.js +120 -0
- package/dist/audit/audit.js.map +1 -0
- package/dist/audit/index.d.ts +3 -0
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/audit/index.js +2 -0
- package/dist/audit/index.js.map +1 -0
- package/dist/audit/types.d.ts +25 -0
- package/dist/audit/types.d.ts.map +1 -0
- package/dist/audit/types.js +5 -0
- package/dist/audit/types.js.map +1 -0
- package/dist/binder/binder.d.ts +34 -0
- package/dist/binder/binder.d.ts.map +1 -0
- package/dist/binder/binder.js +202 -0
- package/dist/binder/binder.js.map +1 -0
- package/dist/binder/index.d.ts +3 -0
- package/dist/binder/index.d.ts.map +1 -0
- package/dist/binder/index.js +2 -0
- package/dist/binder/index.js.map +1 -0
- package/dist/build-state/build-state.d.ts +40 -0
- package/dist/build-state/build-state.d.ts.map +1 -0
- package/dist/build-state/build-state.js +180 -0
- package/dist/build-state/build-state.js.map +1 -0
- package/dist/build-state/index.d.ts +3 -0
- package/dist/build-state/index.d.ts.map +1 -0
- package/dist/build-state/index.js +2 -0
- package/dist/build-state/index.js.map +1 -0
- package/dist/checker/index.d.ts +5 -0
- package/dist/checker/index.d.ts.map +1 -0
- package/dist/checker/index.js +3 -0
- package/dist/checker/index.js.map +1 -0
- package/dist/checker/type-checker.d.ts +8 -0
- package/dist/checker/type-checker.d.ts.map +1 -0
- package/dist/checker/type-checker.js +136 -0
- package/dist/checker/type-checker.js.map +1 -0
- package/dist/checker/validator.d.ts +8 -0
- package/dist/checker/validator.d.ts.map +1 -0
- package/dist/checker/validator.js +251 -0
- package/dist/checker/validator.js.map +1 -0
- package/dist/cli/agent-setup.d.ts +27 -0
- package/dist/cli/agent-setup.d.ts.map +1 -0
- package/dist/cli/agent-setup.js +829 -0
- package/dist/cli/agent-setup.js.map +1 -0
- package/dist/cli/analyze.d.ts +28 -0
- package/dist/cli/analyze.d.ts.map +1 -0
- package/dist/cli/analyze.js +188 -0
- package/dist/cli/analyze.js.map +1 -0
- package/dist/cli/checklist.d.ts +27 -0
- package/dist/cli/checklist.d.ts.map +1 -0
- package/dist/cli/checklist.js +153 -0
- package/dist/cli/checklist.js.map +1 -0
- package/dist/cli/compile.d.ts +26 -0
- package/dist/cli/compile.d.ts.map +1 -0
- package/dist/cli/compile.js +112 -0
- package/dist/cli/compile.js.map +1 -0
- package/dist/cli/dashboard.d.ts +19 -0
- package/dist/cli/dashboard.d.ts.map +1 -0
- package/dist/cli/dashboard.js +73 -0
- package/dist/cli/dashboard.js.map +1 -0
- package/dist/cli/explain.d.ts +23 -0
- package/dist/cli/explain.d.ts.map +1 -0
- package/dist/cli/explain.js +144 -0
- package/dist/cli/explain.js.map +1 -0
- package/dist/cli/git.d.ts +14 -0
- package/dist/cli/git.d.ts.map +1 -0
- package/dist/cli/git.js +44 -0
- package/dist/cli/git.js.map +1 -0
- package/dist/cli/lifecycle.d.ts +28 -0
- package/dist/cli/lifecycle.d.ts.map +1 -0
- package/dist/cli/lifecycle.js +82 -0
- package/dist/cli/lifecycle.js.map +1 -0
- package/dist/cli/main.d.ts +10 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +1072 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/cli/notify.d.ts +13 -0
- package/dist/cli/notify.d.ts.map +1 -0
- package/dist/cli/notify.js +36 -0
- package/dist/cli/notify.js.map +1 -0
- package/dist/cli/starters.d.ts +12 -0
- package/dist/cli/starters.d.ts.map +1 -0
- package/dist/cli/starters.js +439 -0
- package/dist/cli/starters.js.map +1 -0
- package/dist/config/config.d.ts +194 -0
- package/dist/config/config.d.ts.map +1 -0
- package/dist/config/config.js +434 -0
- package/dist/config/config.js.map +1 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +5 -0
- package/dist/config/index.js.map +1 -0
- package/dist/diagnostics/diagnostic.d.ts +44 -0
- package/dist/diagnostics/diagnostic.d.ts.map +1 -0
- package/dist/diagnostics/diagnostic.js +44 -0
- package/dist/diagnostics/diagnostic.js.map +1 -0
- package/dist/diagnostics/index.d.ts +4 -0
- package/dist/diagnostics/index.d.ts.map +1 -0
- package/dist/diagnostics/index.js +3 -0
- package/dist/diagnostics/index.js.map +1 -0
- package/dist/diagnostics/reporter.d.ts +43 -0
- package/dist/diagnostics/reporter.d.ts.map +1 -0
- package/dist/diagnostics/reporter.js +74 -0
- package/dist/diagnostics/reporter.js.map +1 -0
- package/dist/discovery/discovery.d.ts +6 -0
- package/dist/discovery/discovery.d.ts.map +1 -0
- package/dist/discovery/discovery.js +66 -0
- package/dist/discovery/discovery.js.map +1 -0
- package/dist/discovery/index.d.ts +2 -0
- package/dist/discovery/index.d.ts.map +1 -0
- package/dist/discovery/index.js +2 -0
- package/dist/discovery/index.js.map +1 -0
- package/dist/doc-gen/doc-gen-types.d.ts +174 -0
- package/dist/doc-gen/doc-gen-types.d.ts.map +1 -0
- package/dist/doc-gen/doc-gen-types.js +7 -0
- package/dist/doc-gen/doc-gen-types.js.map +1 -0
- package/dist/doc-gen/doc-renderer.d.ts +17 -0
- package/dist/doc-gen/doc-renderer.d.ts.map +1 -0
- package/dist/doc-gen/doc-renderer.js +65 -0
- package/dist/doc-gen/doc-renderer.js.map +1 -0
- package/dist/doc-gen/format-helpers.d.ts +18 -0
- package/dist/doc-gen/format-helpers.d.ts.map +1 -0
- package/dist/doc-gen/format-helpers.js +92 -0
- package/dist/doc-gen/format-helpers.js.map +1 -0
- package/dist/doc-gen/index.d.ts +5 -0
- package/dist/doc-gen/index.d.ts.map +1 -0
- package/dist/doc-gen/index.js +5 -0
- package/dist/doc-gen/index.js.map +1 -0
- package/dist/doc-gen/link-resolver.d.ts +10 -0
- package/dist/doc-gen/link-resolver.d.ts.map +1 -0
- package/dist/doc-gen/link-resolver.js +87 -0
- package/dist/doc-gen/link-resolver.js.map +1 -0
- package/dist/doc-gen/mermaid-renderers.d.ts +12 -0
- package/dist/doc-gen/mermaid-renderers.d.ts.map +1 -0
- package/dist/doc-gen/mermaid-renderers.js +197 -0
- package/dist/doc-gen/mermaid-renderers.js.map +1 -0
- package/dist/doc-gen/module-renderer.d.ts +6 -0
- package/dist/doc-gen/module-renderer.d.ts.map +1 -0
- package/dist/doc-gen/module-renderer.js +54 -0
- package/dist/doc-gen/module-renderer.js.map +1 -0
- package/dist/doc-gen/product-renderer.d.ts +6 -0
- package/dist/doc-gen/product-renderer.d.ts.map +1 -0
- package/dist/doc-gen/product-renderer.js +101 -0
- package/dist/doc-gen/product-renderer.js.map +1 -0
- package/dist/doc-gen/section-renderers.d.ts +20 -0
- package/dist/doc-gen/section-renderers.d.ts.map +1 -0
- package/dist/doc-gen/section-renderers.js +357 -0
- package/dist/doc-gen/section-renderers.js.map +1 -0
- package/dist/doc-gen/string-resolver.d.ts +8 -0
- package/dist/doc-gen/string-resolver.d.ts.map +1 -0
- package/dist/doc-gen/string-resolver.js +47 -0
- package/dist/doc-gen/string-resolver.js.map +1 -0
- package/dist/doc-gen/surface-ascii.d.ts +7 -0
- package/dist/doc-gen/surface-ascii.d.ts.map +1 -0
- package/dist/doc-gen/surface-ascii.js +87 -0
- package/dist/doc-gen/surface-ascii.js.map +1 -0
- package/dist/drift/drift.d.ts +16 -0
- package/dist/drift/drift.d.ts.map +1 -0
- package/dist/drift/drift.js +149 -0
- package/dist/drift/drift.js.map +1 -0
- package/dist/drift/index.d.ts +3 -0
- package/dist/drift/index.d.ts.map +1 -0
- package/dist/drift/index.js +2 -0
- package/dist/drift/index.js.map +1 -0
- package/dist/extensions/index.d.ts +6 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/index.js +7 -0
- package/dist/extensions/index.js.map +1 -0
- package/dist/extensions/loader.d.ts +21 -0
- package/dist/extensions/loader.d.ts.map +1 -0
- package/dist/extensions/loader.js +101 -0
- package/dist/extensions/loader.js.map +1 -0
- package/dist/extensions/marketplace.d.ts +22 -0
- package/dist/extensions/marketplace.d.ts.map +1 -0
- package/dist/extensions/marketplace.js +40 -0
- package/dist/extensions/marketplace.js.map +1 -0
- package/dist/extensions/registry.d.ts +45 -0
- package/dist/extensions/registry.d.ts.map +1 -0
- package/dist/extensions/registry.js +82 -0
- package/dist/extensions/registry.js.map +1 -0
- package/dist/extensions/types.d.ts +41 -0
- package/dist/extensions/types.d.ts.map +1 -0
- package/dist/extensions/types.js +5 -0
- package/dist/extensions/types.js.map +1 -0
- package/dist/generator/contracts.d.ts +67 -0
- package/dist/generator/contracts.d.ts.map +1 -0
- package/dist/generator/contracts.js +94 -0
- package/dist/generator/contracts.js.map +1 -0
- package/dist/generator/index.d.ts +3 -0
- package/dist/generator/index.d.ts.map +1 -0
- package/dist/generator/index.js +2 -0
- package/dist/generator/index.js.map +1 -0
- package/dist/governance/governance.d.ts +24 -0
- package/dist/governance/governance.d.ts.map +1 -0
- package/dist/governance/governance.js +238 -0
- package/dist/governance/governance.js.map +1 -0
- package/dist/governance/index.d.ts +3 -0
- package/dist/governance/index.d.ts.map +1 -0
- package/dist/governance/index.js +2 -0
- package/dist/governance/index.js.map +1 -0
- package/dist/governance/types.d.ts +14 -0
- package/dist/governance/types.d.ts.map +1 -0
- package/dist/governance/types.js +5 -0
- package/dist/governance/types.js.map +1 -0
- package/dist/graph/builder.d.ts +10 -0
- package/dist/graph/builder.d.ts.map +1 -0
- package/dist/graph/builder.js +573 -0
- package/dist/graph/builder.js.map +1 -0
- package/dist/graph/graph-types.d.ts +64 -0
- package/dist/graph/graph-types.d.ts.map +1 -0
- package/dist/graph/graph-types.js +29 -0
- package/dist/graph/graph-types.js.map +1 -0
- package/dist/graph/index.d.ts +8 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +5 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/serializer.d.ts +9 -0
- package/dist/graph/serializer.d.ts.map +1 -0
- package/dist/graph/serializer.js +31 -0
- package/dist/graph/serializer.js.map +1 -0
- package/dist/graph/validator.d.ts +14 -0
- package/dist/graph/validator.d.ts.map +1 -0
- package/dist/graph/validator.js +96 -0
- package/dist/graph/validator.js.map +1 -0
- package/dist/implement/implement.d.ts +30 -0
- package/dist/implement/implement.d.ts.map +1 -0
- package/dist/implement/implement.js +299 -0
- package/dist/implement/implement.js.map +1 -0
- package/dist/implement/index.d.ts +3 -0
- package/dist/implement/index.d.ts.map +1 -0
- package/dist/implement/index.js +2 -0
- package/dist/implement/index.js.map +1 -0
- package/dist/implement/types.d.ts +41 -0
- package/dist/implement/types.d.ts.map +1 -0
- package/dist/implement/types.js +5 -0
- package/dist/implement/types.js.map +1 -0
- package/dist/incremental/incremental-spec.d.ts +12 -0
- package/dist/incremental/incremental-spec.d.ts.map +1 -0
- package/dist/incremental/incremental-spec.js +100 -0
- package/dist/incremental/incremental-spec.js.map +1 -0
- package/dist/incremental/index.d.ts +3 -0
- package/dist/incremental/index.d.ts.map +1 -0
- package/dist/incremental/index.js +5 -0
- package/dist/incremental/index.js.map +1 -0
- package/dist/incremental/types.d.ts +28 -0
- package/dist/incremental/types.d.ts.map +1 -0
- package/dist/incremental/types.js +7 -0
- package/dist/incremental/types.js.map +1 -0
- package/dist/index.d.ts +106 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +106 -0
- package/dist/index.js.map +1 -0
- package/dist/lexer/index.d.ts +6 -0
- package/dist/lexer/index.d.ts.map +1 -0
- package/dist/lexer/index.js +5 -0
- package/dist/lexer/index.js.map +1 -0
- package/dist/lexer/keywords.d.ts +3 -0
- package/dist/lexer/keywords.d.ts.map +1 -0
- package/dist/lexer/keywords.js +142 -0
- package/dist/lexer/keywords.js.map +1 -0
- package/dist/lexer/lexer.d.ts +19 -0
- package/dist/lexer/lexer.d.ts.map +1 -0
- package/dist/lexer/lexer.js +286 -0
- package/dist/lexer/lexer.js.map +1 -0
- package/dist/lexer/source.d.ts +13 -0
- package/dist/lexer/source.d.ts.map +1 -0
- package/dist/lexer/source.js +59 -0
- package/dist/lexer/source.js.map +1 -0
- package/dist/lexer/tokens.d.ts +157 -0
- package/dist/lexer/tokens.d.ts.map +1 -0
- package/dist/lexer/tokens.js +173 -0
- package/dist/lexer/tokens.js.map +1 -0
- package/dist/orchestrator/index.d.ts +5 -0
- package/dist/orchestrator/index.d.ts.map +1 -0
- package/dist/orchestrator/index.js +3 -0
- package/dist/orchestrator/index.js.map +1 -0
- package/dist/orchestrator/orchestrator.d.ts +14 -0
- package/dist/orchestrator/orchestrator.d.ts.map +1 -0
- package/dist/orchestrator/orchestrator.js +129 -0
- package/dist/orchestrator/orchestrator.js.map +1 -0
- package/dist/orchestrator/pipeline.d.ts +31 -0
- package/dist/orchestrator/pipeline.d.ts.map +1 -0
- package/dist/orchestrator/pipeline.js +290 -0
- package/dist/orchestrator/pipeline.js.map +1 -0
- package/dist/orchestrator/types.d.ts +60 -0
- package/dist/orchestrator/types.d.ts.map +1 -0
- package/dist/orchestrator/types.js +8 -0
- package/dist/orchestrator/types.js.map +1 -0
- package/dist/parser/ast.d.ts +502 -0
- package/dist/parser/ast.d.ts.map +1 -0
- package/dist/parser/ast.js +7 -0
- package/dist/parser/ast.js.map +1 -0
- package/dist/parser/expressions.d.ts +18 -0
- package/dist/parser/expressions.d.ts.map +1 -0
- package/dist/parser/expressions.js +230 -0
- package/dist/parser/expressions.js.map +1 -0
- package/dist/parser/index.d.ts +4 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +2 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/parser.d.ts +83 -0
- package/dist/parser/parser.d.ts.map +1 -0
- package/dist/parser/parser.js +2149 -0
- package/dist/parser/parser.js.map +1 -0
- package/dist/planner/differ.d.ts +4 -0
- package/dist/planner/differ.d.ts.map +1 -0
- package/dist/planner/differ.js +96 -0
- package/dist/planner/differ.js.map +1 -0
- package/dist/planner/index.d.ts +7 -0
- package/dist/planner/index.d.ts.map +1 -0
- package/dist/planner/index.js +5 -0
- package/dist/planner/index.js.map +1 -0
- package/dist/planner/plan-types.d.ts +26 -0
- package/dist/planner/plan-types.d.ts.map +1 -0
- package/dist/planner/plan-types.js +5 -0
- package/dist/planner/plan-types.js.map +1 -0
- package/dist/planner/planner.d.ts +8 -0
- package/dist/planner/planner.d.ts.map +1 -0
- package/dist/planner/planner.js +83 -0
- package/dist/planner/planner.js.map +1 -0
- package/dist/planner/propagator.d.ts +4 -0
- package/dist/planner/propagator.d.ts.map +1 -0
- package/dist/planner/propagator.js +45 -0
- package/dist/planner/propagator.js.map +1 -0
- package/dist/planner/semantic-diff.d.ts +27 -0
- package/dist/planner/semantic-diff.d.ts.map +1 -0
- package/dist/planner/semantic-diff.js +253 -0
- package/dist/planner/semantic-diff.js.map +1 -0
- package/dist/presets/index.d.ts +3 -0
- package/dist/presets/index.d.ts.map +1 -0
- package/dist/presets/index.js +5 -0
- package/dist/presets/index.js.map +1 -0
- package/dist/presets/loader.d.ts +28 -0
- package/dist/presets/loader.d.ts.map +1 -0
- package/dist/presets/loader.js +99 -0
- package/dist/presets/loader.js.map +1 -0
- package/dist/presets/types.d.ts +21 -0
- package/dist/presets/types.d.ts.map +1 -0
- package/dist/presets/types.js +5 -0
- package/dist/presets/types.js.map +1 -0
- package/dist/proposal/index.d.ts +3 -0
- package/dist/proposal/index.d.ts.map +1 -0
- package/dist/proposal/index.js +7 -0
- package/dist/proposal/index.js.map +1 -0
- package/dist/proposal/proposal.d.ts +9 -0
- package/dist/proposal/proposal.d.ts.map +1 -0
- package/dist/proposal/proposal.js +169 -0
- package/dist/proposal/proposal.js.map +1 -0
- package/dist/proposal/types.d.ts +15 -0
- package/dist/proposal/types.d.ts.map +1 -0
- package/dist/proposal/types.js +5 -0
- package/dist/proposal/types.js.map +1 -0
- package/dist/registry/index.d.ts +3 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +2 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/resolution.d.ts +39 -0
- package/dist/registry/resolution.d.ts.map +1 -0
- package/dist/registry/resolution.js +70 -0
- package/dist/registry/resolution.js.map +1 -0
- package/dist/reviewers/adversarial.d.ts +3 -0
- package/dist/reviewers/adversarial.d.ts.map +1 -0
- package/dist/reviewers/adversarial.js +111 -0
- package/dist/reviewers/adversarial.js.map +1 -0
- package/dist/reviewers/architecture.d.ts +3 -0
- package/dist/reviewers/architecture.d.ts.map +1 -0
- package/dist/reviewers/architecture.js +71 -0
- package/dist/reviewers/architecture.js.map +1 -0
- package/dist/reviewers/code-quality.d.ts +3 -0
- package/dist/reviewers/code-quality.d.ts.map +1 -0
- package/dist/reviewers/code-quality.js +72 -0
- package/dist/reviewers/code-quality.js.map +1 -0
- package/dist/reviewers/edge-case.d.ts +3 -0
- package/dist/reviewers/edge-case.d.ts.map +1 -0
- package/dist/reviewers/edge-case.js +107 -0
- package/dist/reviewers/edge-case.js.map +1 -0
- package/dist/reviewers/index.d.ts +21 -0
- package/dist/reviewers/index.d.ts.map +1 -0
- package/dist/reviewers/index.js +39 -0
- package/dist/reviewers/index.js.map +1 -0
- package/dist/reviewers/prompt-loader.d.ts +24 -0
- package/dist/reviewers/prompt-loader.d.ts.map +1 -0
- package/dist/reviewers/prompt-loader.js +67 -0
- package/dist/reviewers/prompt-loader.js.map +1 -0
- package/dist/reviewers/quality.d.ts +3 -0
- package/dist/reviewers/quality.d.ts.map +1 -0
- package/dist/reviewers/quality.js +76 -0
- package/dist/reviewers/quality.js.map +1 -0
- package/dist/reviewers/reviewer.d.ts +39 -0
- package/dist/reviewers/reviewer.d.ts.map +1 -0
- package/dist/reviewers/reviewer.js +149 -0
- package/dist/reviewers/reviewer.js.map +1 -0
- package/dist/reviewers/security.d.ts +3 -0
- package/dist/reviewers/security.d.ts.map +1 -0
- package/dist/reviewers/security.js +87 -0
- package/dist/reviewers/security.js.map +1 -0
- package/dist/reviewers/specification.d.ts +3 -0
- package/dist/reviewers/specification.d.ts.map +1 -0
- package/dist/reviewers/specification.js +79 -0
- package/dist/reviewers/specification.js.map +1 -0
- package/dist/reviewers/test-quality.d.ts +3 -0
- package/dist/reviewers/test-quality.d.ts.map +1 -0
- package/dist/reviewers/test-quality.js +88 -0
- package/dist/reviewers/test-quality.js.map +1 -0
- package/dist/reviewers/types.d.ts +32 -0
- package/dist/reviewers/types.d.ts.map +1 -0
- package/dist/reviewers/types.js +5 -0
- package/dist/reviewers/types.js.map +1 -0
- package/dist/reviewers/ux.d.ts +3 -0
- package/dist/reviewers/ux.d.ts.map +1 -0
- package/dist/reviewers/ux.js +94 -0
- package/dist/reviewers/ux.js.map +1 -0
- package/dist/runtime/index.d.ts +3 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +2 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/resolution.d.ts +30 -0
- package/dist/runtime/resolution.d.ts.map +1 -0
- package/dist/runtime/resolution.js +59 -0
- package/dist/runtime/resolution.js.map +1 -0
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +2 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/test-runner.d.ts +18 -0
- package/dist/testing/test-runner.d.ts.map +1 -0
- package/dist/testing/test-runner.js +131 -0
- package/dist/testing/test-runner.js.map +1 -0
- package/dist/types.d.ts +36 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +127 -0
- package/dist/types.js.map +1 -0
- package/dist/validation/index.d.ts +3 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +2 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/types.d.ts +16 -0
- package/dist/validation/types.d.ts.map +1 -0
- package/dist/validation/types.js +5 -0
- package/dist/validation/types.js.map +1 -0
- package/dist/validation/validation.d.ts +8 -0
- package/dist/validation/validation.d.ts.map +1 -0
- package/dist/validation/validation.js +101 -0
- package/dist/validation/validation.js.map +1 -0
- package/dist/verification/index.d.ts +3 -0
- package/dist/verification/index.d.ts.map +1 -0
- package/dist/verification/index.js +5 -0
- package/dist/verification/index.js.map +1 -0
- package/dist/verification/types.d.ts +14 -0
- package/dist/verification/types.d.ts.map +1 -0
- package/dist/verification/types.js +5 -0
- package/dist/verification/types.js.map +1 -0
- package/dist/verification/verify.d.ts +7 -0
- package/dist/verification/verify.d.ts.map +1 -0
- package/dist/verification/verify.js +127 -0
- package/dist/verification/verify.js.map +1 -0
- package/dist/workflow/clarify.d.ts +7 -0
- package/dist/workflow/clarify.d.ts.map +1 -0
- package/dist/workflow/clarify.js +165 -0
- package/dist/workflow/clarify.js.map +1 -0
- package/dist/workflow/engine.d.ts +19 -0
- package/dist/workflow/engine.d.ts.map +1 -0
- package/dist/workflow/engine.js +265 -0
- package/dist/workflow/engine.js.map +1 -0
- package/dist/workflow/index.d.ts +6 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +7 -0
- package/dist/workflow/index.js.map +1 -0
- package/dist/workflow/types.d.ts +95 -0
- package/dist/workflow/types.d.ts.map +1 -0
- package/dist/workflow/types.js +18 -0
- package/dist/workflow/types.js.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/governance/types.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,QAAQ,EAAE,YAAY,GAAG,YAAY,GAAG,YAAY,CAAC;IAC9D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,WAAW,EAAE,SAAS,cAAc,EAAE,CAAC;IAChD,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/governance/types.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,sCAAsC;AACtC,8EAA8E"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AstFile } from '../parser/ast.js';
|
|
2
|
+
import type { BindResult } from '../binder/binder.js';
|
|
3
|
+
import { DiagnosticBag } from '../diagnostics/diagnostic.js';
|
|
4
|
+
import type { ProductGraph } from './graph-types.js';
|
|
5
|
+
export interface BuildGraphResult {
|
|
6
|
+
readonly graph: ProductGraph;
|
|
7
|
+
readonly bag: DiagnosticBag;
|
|
8
|
+
}
|
|
9
|
+
export declare function buildGraph(files: readonly AstFile[], bindResult: BindResult): BuildGraphResult;
|
|
10
|
+
//# sourceMappingURL=builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/graph/builder.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAqC,MAAM,kBAAkB,CAAC;AACnF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAwG,MAAM,kBAAkB,CAAC;AAE3J,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC;CAC7B;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,EAAE,UAAU,EAAE,UAAU,GAAG,gBAAgB,CAK9F"}
|
|
@@ -0,0 +1,573 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Prodara Compiler — Product Graph Builder
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
// Builds the Product Graph from parsed AST files + bind result.
|
|
5
|
+
import { resolveSymbolRef } from '../binder/binder.js';
|
|
6
|
+
import { DiagnosticBag } from '../diagnostics/diagnostic.js';
|
|
7
|
+
export function buildGraph(files, bindResult) {
|
|
8
|
+
const bag = new DiagnosticBag();
|
|
9
|
+
const builder = new GraphBuilder(files, bindResult, bag);
|
|
10
|
+
const graph = builder.build();
|
|
11
|
+
return { graph, bag };
|
|
12
|
+
}
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// Node ID helpers
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
function nodeId(moduleName, kind, name) {
|
|
17
|
+
return `${moduleName}.${kind}.${name}`;
|
|
18
|
+
}
|
|
19
|
+
function resolveTypeRef(type, moduleName, bindResult) {
|
|
20
|
+
switch (type.kind) {
|
|
21
|
+
case 'primitive':
|
|
22
|
+
return type.name;
|
|
23
|
+
case 'ref': {
|
|
24
|
+
const sym = resolveSymbolRef(type.segments, moduleName, bindResult.modules, bindResult.allSymbols);
|
|
25
|
+
if (sym)
|
|
26
|
+
return { ref: sym.qualifiedName.replace('.', `.${sym.nodeKind}.`) };
|
|
27
|
+
return { ref: type.segments.join('.') };
|
|
28
|
+
}
|
|
29
|
+
case 'generic':
|
|
30
|
+
return { generic: type.wrapper, arg: resolveTypeRef(type.inner, moduleName, bindResult) };
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function serializeExpression(expr) {
|
|
34
|
+
switch (expr.kind) {
|
|
35
|
+
case 'binary':
|
|
36
|
+
if (expr.op === 'and' || expr.op === 'or') {
|
|
37
|
+
const operands = [];
|
|
38
|
+
flattenBoolOp(expr, expr.op, operands);
|
|
39
|
+
return { op: expr.op, operands };
|
|
40
|
+
}
|
|
41
|
+
return { op: expr.op, left: serializeExpression(expr.left), right: serializeExpression(expr.right) };
|
|
42
|
+
case 'unary':
|
|
43
|
+
return { op: 'not', operand: serializeExpression(expr.operand) };
|
|
44
|
+
case 'access':
|
|
45
|
+
return { access: [...expr.segments] };
|
|
46
|
+
case 'literal':
|
|
47
|
+
return { literal: expr.value, type: expr.literalType };
|
|
48
|
+
case 'paren':
|
|
49
|
+
return serializeExpression(expr.inner);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function flattenBoolOp(expr, op, out) {
|
|
53
|
+
if (expr.kind === 'binary' && expr.op === op) {
|
|
54
|
+
flattenBoolOp(expr.left, op, out);
|
|
55
|
+
flattenBoolOp(expr.right, op, out);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
out.push(serializeExpression(expr));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function serializeFields(fields, moduleName, bindResult) {
|
|
62
|
+
return fields.map((f) => ({
|
|
63
|
+
name: f.name,
|
|
64
|
+
type: resolveTypeRef(f.type, moduleName, bindResult),
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
// ---------------------------------------------------------------------------
|
|
68
|
+
// Graph Builder
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
class GraphBuilder {
|
|
71
|
+
files;
|
|
72
|
+
bind;
|
|
73
|
+
bag;
|
|
74
|
+
edges = [];
|
|
75
|
+
sourceFiles;
|
|
76
|
+
constructor(files, bind, bag) {
|
|
77
|
+
this.files = files;
|
|
78
|
+
this.bind = bind;
|
|
79
|
+
this.bag = bag;
|
|
80
|
+
this.sourceFiles = files.map((f) => f.path).sort();
|
|
81
|
+
}
|
|
82
|
+
build() {
|
|
83
|
+
const product = this.buildProductNode();
|
|
84
|
+
const modules = this.buildModuleNodes();
|
|
85
|
+
// Sort edges deterministically
|
|
86
|
+
this.edges.sort((a, b) => {
|
|
87
|
+
const cf = a.from.localeCompare(b.from);
|
|
88
|
+
if (cf !== 0)
|
|
89
|
+
return cf;
|
|
90
|
+
const ck = a.kind.localeCompare(b.kind);
|
|
91
|
+
if (ck !== 0)
|
|
92
|
+
return ck;
|
|
93
|
+
return a.to.localeCompare(b.to);
|
|
94
|
+
});
|
|
95
|
+
const metadata = {
|
|
96
|
+
compiler: 'prodara-compiler',
|
|
97
|
+
compiled_at: new Date().toISOString(),
|
|
98
|
+
source_files: this.sourceFiles,
|
|
99
|
+
};
|
|
100
|
+
return {
|
|
101
|
+
format: 'prodara-product-graph',
|
|
102
|
+
version: '0.1.0',
|
|
103
|
+
product,
|
|
104
|
+
modules,
|
|
105
|
+
edges: this.edges,
|
|
106
|
+
metadata,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
buildProductNode() {
|
|
110
|
+
let prodNode = {
|
|
111
|
+
id: 'product',
|
|
112
|
+
kind: 'product',
|
|
113
|
+
name: this.bind.productName ?? 'unnamed',
|
|
114
|
+
title: null,
|
|
115
|
+
version: null,
|
|
116
|
+
modules: [],
|
|
117
|
+
publishes: null,
|
|
118
|
+
};
|
|
119
|
+
for (const file of this.files) {
|
|
120
|
+
for (const decl of file.declarations) {
|
|
121
|
+
if (decl.kind === 'product') {
|
|
122
|
+
const moduleNames = [...(this.bind.modules.keys())].sort();
|
|
123
|
+
let publishes = null;
|
|
124
|
+
if (decl.publishes) {
|
|
125
|
+
publishes = {};
|
|
126
|
+
for (const entry of decl.publishes.entries) {
|
|
127
|
+
publishes[entry.category] = entry.symbols.map((s) => {
|
|
128
|
+
const resolved = resolveSymbolRef(s, '', this.bind.modules, this.bind.allSymbols);
|
|
129
|
+
/* v8 ignore next */
|
|
130
|
+
return resolved ? `${resolved.module}.${resolved.nodeKind}.${resolved.name}` : s.join('.');
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/* v8 ignore next */
|
|
135
|
+
prodNode = { ...prodNode, name: decl.name, title: decl.title ?? null, version: decl.version ?? null, modules: moduleNames, publishes };
|
|
136
|
+
// product -> module edges
|
|
137
|
+
for (const mn of moduleNames) {
|
|
138
|
+
this.addEdge('product', mn, 'contains');
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return prodNode;
|
|
144
|
+
}
|
|
145
|
+
buildModuleNodes() {
|
|
146
|
+
const moduleNodes = [];
|
|
147
|
+
for (const [modName, table] of this.bind.modules) {
|
|
148
|
+
const imports = table.imports.map((imp) => ({
|
|
149
|
+
symbol: imp.originalSymbol,
|
|
150
|
+
from: imp.sourceModule,
|
|
151
|
+
/* v8 ignore next */
|
|
152
|
+
alias: imp.localName !== imp.originalSymbol ? imp.localName : null,
|
|
153
|
+
}));
|
|
154
|
+
// Emit module→module import edges
|
|
155
|
+
const importedModules = new Set(table.imports.map((imp) => imp.sourceModule));
|
|
156
|
+
for (const srcMod of importedModules) {
|
|
157
|
+
this.addEdge(modName, srcMod, 'imports');
|
|
158
|
+
}
|
|
159
|
+
// Group items by category
|
|
160
|
+
const categories = {};
|
|
161
|
+
for (const [, sym] of table.symbols) {
|
|
162
|
+
const item = sym.declaration;
|
|
163
|
+
const id = nodeId(modName, sym.nodeKind, sym.name);
|
|
164
|
+
const cat = pluralize(sym.nodeKind);
|
|
165
|
+
if (!categories[cat])
|
|
166
|
+
categories[cat] = [];
|
|
167
|
+
const node = this.serializeItem(item, id, modName);
|
|
168
|
+
if (node) {
|
|
169
|
+
categories[cat].push(node);
|
|
170
|
+
// module -> item edge
|
|
171
|
+
this.addEdge(modName, id, 'contains');
|
|
172
|
+
// emit semantic edges
|
|
173
|
+
this.emitEdgesForItem(item, id, modName);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
// Sort each category by name for determinism
|
|
177
|
+
for (const cat of Object.keys(categories)) {
|
|
178
|
+
categories[cat].sort((a, b) => a.name.localeCompare(b.name));
|
|
179
|
+
}
|
|
180
|
+
// Build module node with sorted category keys
|
|
181
|
+
const modNode = {
|
|
182
|
+
id: modName,
|
|
183
|
+
kind: 'module',
|
|
184
|
+
name: modName,
|
|
185
|
+
imports: imports.sort((a, b) => a.symbol.localeCompare(b.symbol)),
|
|
186
|
+
};
|
|
187
|
+
for (const cat of Object.keys(categories).sort()) {
|
|
188
|
+
modNode[cat] = categories[cat];
|
|
189
|
+
}
|
|
190
|
+
moduleNodes.push(modNode);
|
|
191
|
+
}
|
|
192
|
+
return moduleNodes.sort((a, b) => a.name.localeCompare(b.name));
|
|
193
|
+
}
|
|
194
|
+
/* v8 ignore start — V8 does not track ??/ternary branches in object literals reliably */
|
|
195
|
+
serializeItem(item, id, modName) {
|
|
196
|
+
switch (item.kind) {
|
|
197
|
+
case 'import': return null;
|
|
198
|
+
case 'entity':
|
|
199
|
+
return { id, kind: 'entity', name: item.name, fields: serializeFields(item.fields, modName, this.bind) };
|
|
200
|
+
case 'value':
|
|
201
|
+
return { id, kind: 'value', name: item.name, fields: serializeFields(item.fields, modName, this.bind) };
|
|
202
|
+
case 'enum':
|
|
203
|
+
return { id, kind: 'enum', name: item.name, members: item.members.map((m) => {
|
|
204
|
+
const mem = { name: m.name };
|
|
205
|
+
if (m.metadata && m.metadata.length > 0) {
|
|
206
|
+
const md = {};
|
|
207
|
+
for (const p of m.metadata)
|
|
208
|
+
md[p.key] = serializeValueNode(p.value);
|
|
209
|
+
mem['metadata'] = md;
|
|
210
|
+
}
|
|
211
|
+
return mem;
|
|
212
|
+
}) };
|
|
213
|
+
case 'rule':
|
|
214
|
+
return {
|
|
215
|
+
id, kind: 'rule', name: item.name,
|
|
216
|
+
entity: this.resolveRefToId(item.entity, modName) ?? item.entity.join('.'),
|
|
217
|
+
condition: serializeExpression(item.condition),
|
|
218
|
+
message: item.message.join('.'),
|
|
219
|
+
};
|
|
220
|
+
case 'actor':
|
|
221
|
+
return { id, kind: 'actor', name: item.name, title: item.title ?? null, description: item.description ?? null };
|
|
222
|
+
case 'capability': {
|
|
223
|
+
const actors = item.actors?.map((a) => this.resolveRefToId(a, modName) ?? a.join('.')).sort() ?? [];
|
|
224
|
+
return { id, kind: 'capability', name: item.name, title: item.title ?? null, description: item.description ?? null, actors };
|
|
225
|
+
}
|
|
226
|
+
case 'workflow': {
|
|
227
|
+
const node = { id, kind: 'workflow', name: item.name };
|
|
228
|
+
if (item.capability)
|
|
229
|
+
node['capability'] = this.resolveRefToId(item.capability, modName);
|
|
230
|
+
if (item.authorization)
|
|
231
|
+
node['authorization'] = item.authorization.map((a) => ({
|
|
232
|
+
actor: this.resolveRefToId([a.actor], modName) ?? a.actor,
|
|
233
|
+
permissions: [...a.permissions],
|
|
234
|
+
}));
|
|
235
|
+
if (item.input)
|
|
236
|
+
node['input'] = serializeFields(item.input, modName, this.bind);
|
|
237
|
+
if (item.reads)
|
|
238
|
+
node['reads'] = item.reads.map((r) => this.resolveRefToId(r, modName) ?? r.join('.'));
|
|
239
|
+
if (item.writes)
|
|
240
|
+
node['writes'] = item.writes.map((w) => this.resolveRefToId(w, modName) ?? w.join('.'));
|
|
241
|
+
if (item.rules)
|
|
242
|
+
node['rules'] = item.rules.map((r) => this.resolveRefToId(r, modName) ?? r.join('.'));
|
|
243
|
+
if (item.steps)
|
|
244
|
+
node['steps'] = item.steps.map((s) => {
|
|
245
|
+
if (s.kind === 'call')
|
|
246
|
+
return { call: this.resolveRefToId(s.target, modName) ?? s.target.join('.') };
|
|
247
|
+
if (s.kind === 'fail')
|
|
248
|
+
return { fail: s.code };
|
|
249
|
+
return { decide: s.name, branches: s.branches.map((b) => ({
|
|
250
|
+
when: b.when, action: b.action.kind === 'call' ? { call: this.resolveRefToId(b.action.target, modName) ?? b.action.target.join('.') } : { fail: b.action.code },
|
|
251
|
+
})) };
|
|
252
|
+
});
|
|
253
|
+
if (item.transitions)
|
|
254
|
+
node['transitions'] = item.transitions.map((t) => ({
|
|
255
|
+
entity: this.resolveRefToId(t.entity, modName) ?? t.entity.join('.'),
|
|
256
|
+
field: t.field, from: t.from, to: t.to,
|
|
257
|
+
}));
|
|
258
|
+
if (item.effects)
|
|
259
|
+
node['effects'] = item.effects.map((e) => {
|
|
260
|
+
if (e.kind === 'audit')
|
|
261
|
+
return { audit: e.value };
|
|
262
|
+
if (e.kind === 'emit')
|
|
263
|
+
return { emit: this.resolveRefToId(e.value, modName) ?? e.value.join('.') };
|
|
264
|
+
if (e.kind === 'notify')
|
|
265
|
+
return { notify: this.resolveRefToId(e.value, modName) ?? e.value.join('.') };
|
|
266
|
+
/* v8 ignore next */
|
|
267
|
+
return { ref: e.value.join('.') };
|
|
268
|
+
});
|
|
269
|
+
if (item.returns)
|
|
270
|
+
node['returns'] = item.returns.map((r) => ({
|
|
271
|
+
name: r.name, type: resolveTypeRef(r.type, modName, this.bind),
|
|
272
|
+
}));
|
|
273
|
+
if (item.trigger)
|
|
274
|
+
node['trigger'] = this.resolveRefToId(item.trigger, modName);
|
|
275
|
+
return node;
|
|
276
|
+
}
|
|
277
|
+
case 'action':
|
|
278
|
+
return { id, kind: 'action', name: item.name, title: item.title ?? null, workflow: this.resolveRefToId(item.workflow ?? [], modName) ?? null };
|
|
279
|
+
case 'event':
|
|
280
|
+
return { id, kind: 'event', name: item.name, payload: item.payload ? resolveTypeRef(item.payload, modName, this.bind) : null, description: item.description ?? null };
|
|
281
|
+
case 'schedule':
|
|
282
|
+
return { id, kind: 'schedule', name: item.name, cron: item.cron ?? null, description: item.description ?? null };
|
|
283
|
+
case 'surface':
|
|
284
|
+
return {
|
|
285
|
+
id, kind: 'surface', name: item.name,
|
|
286
|
+
surface_kind: item.surfaceKind ?? null,
|
|
287
|
+
title: typeof item.title === 'string' ? item.title : item.title ? item.title.join('.') : null,
|
|
288
|
+
capability: item.capability ? (this.resolveRefToId(item.capability, modName) ?? null) : null,
|
|
289
|
+
binds: item.binds ? (this.resolveRefToId(item.binds, modName) ?? null) : null,
|
|
290
|
+
};
|
|
291
|
+
case 'rendering':
|
|
292
|
+
return { id, kind: 'rendering', name: item.name, target: item.target ? this.resolveRefToId(item.target, modName) : null, platform: item.platform ?? null, layout: item.layout ?? null };
|
|
293
|
+
case 'tokens':
|
|
294
|
+
return { id, kind: 'tokens', name: item.name, categories: item.categories.map((c) => ({
|
|
295
|
+
name: c.name, tokens: c.tokens.map((t) => ({ name: t.name, value: serializeValueNode(t.value) })),
|
|
296
|
+
})) };
|
|
297
|
+
case 'theme':
|
|
298
|
+
return { id, kind: 'theme', name: item.name, extends: item.extends || null, overrides: item.overrides.map((c) => ({
|
|
299
|
+
name: c.name, tokens: c.tokens.map((t) => ({ name: t.name, value: serializeValueNode(t.value) })),
|
|
300
|
+
})) };
|
|
301
|
+
case 'strings':
|
|
302
|
+
return { id, kind: 'strings', name: item.name, entries: Object.fromEntries(item.entries.map((e) => [e.key, e.value])) };
|
|
303
|
+
case 'serialization':
|
|
304
|
+
return { id, kind: 'serialization', name: item.name, properties: Object.fromEntries(item.properties.map((p) => [p.key, serializeValueNode(p.value)])) };
|
|
305
|
+
case 'integration':
|
|
306
|
+
return { id, kind: 'integration', name: item.name, title: item.title ?? null, kind_type: item.integrationKind ?? null, protocol: item.protocol ?? null };
|
|
307
|
+
case 'transport':
|
|
308
|
+
return { id, kind: 'transport', name: item.name, target: item.target ? this.resolveRefToId(item.target, modName) : null, protocol: item.protocol ?? null, style: item.style ?? null };
|
|
309
|
+
case 'storage':
|
|
310
|
+
return { id, kind: 'storage', name: item.name, target: item.target ? this.resolveRefToId(item.target, modName) : null, model: item.model ?? null, table: item.table ?? null };
|
|
311
|
+
case 'execution':
|
|
312
|
+
return { id, kind: 'execution', name: item.name, target: item.target ? this.resolveRefToId(item.target, modName) : null, mode: item.mode ?? null };
|
|
313
|
+
case 'extension':
|
|
314
|
+
return { id, kind: 'extension', name: item.name, target: item.target ? this.resolveRefToId(item.target, modName) : null, kind_type: item.extensionKind ?? null, language: item.language ?? null, body: item.body ?? null };
|
|
315
|
+
case 'constitution':
|
|
316
|
+
return { id, kind: 'constitution', name: item.name, applies_to: item.appliesTo?.map((r) => this.resolveRefToId(r, modName) ?? r.join('.')) ?? [], policies: item.policies?.map((p) => ({ name: p.name, properties: Object.fromEntries(p.properties.map((pp) => [pp.key, serializeValueNode(pp.value)])) })) ?? [] };
|
|
317
|
+
case 'security':
|
|
318
|
+
return { id, kind: 'security', name: item.name, applies_to: item.appliesTo?.map((r) => this.resolveRefToId(r, modName) ?? r.join('.')) ?? [] };
|
|
319
|
+
case 'privacy':
|
|
320
|
+
return { id, kind: 'privacy', name: item.name, applies_to: item.appliesTo?.map((r) => this.resolveRefToId(r, modName) ?? r.join('.')) ?? [], classification: item.classification ?? null, retention: item.retention ?? null, exportable: item.exportable ?? null, erasable: item.erasable ?? null };
|
|
321
|
+
case 'validation':
|
|
322
|
+
return { id, kind: 'validation', name: item.name, applies_to: item.appliesTo?.map((r) => this.resolveRefToId(r, modName) ?? r.join('.')) ?? [] };
|
|
323
|
+
case 'secret':
|
|
324
|
+
return { id, kind: 'secret', name: item.name, source: item.source ?? null, description: item.description ?? null };
|
|
325
|
+
case 'environment':
|
|
326
|
+
return { id, kind: 'environment', name: item.name, url: item.url ?? null, description: item.description ?? null };
|
|
327
|
+
case 'deployment':
|
|
328
|
+
return { id, kind: 'deployment', name: item.name, environments: item.environments?.map((e) => this.resolveRefToId(e, modName) ?? e.join('.')) ?? [] };
|
|
329
|
+
case 'test':
|
|
330
|
+
return { id, kind: 'test', name: item.name, target: this.resolveRefToId(item.target, modName) ?? item.target.join('.'), description: item.description ?? null };
|
|
331
|
+
case 'product_ref':
|
|
332
|
+
return { id, kind: 'product_ref', name: item.name, product: item.product ?? null, version: item.version ?? null };
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
/* v8 ignore stop */
|
|
336
|
+
/* v8 ignore start — same V8 branch-tracking issue for if-guard chains */
|
|
337
|
+
emitEdgesForItem(item, id, modName) {
|
|
338
|
+
switch (item.kind) {
|
|
339
|
+
case 'entity':
|
|
340
|
+
case 'value':
|
|
341
|
+
for (const f of item.fields) {
|
|
342
|
+
this.emitTypeEdges(id, f.type, modName, 'field_type');
|
|
343
|
+
}
|
|
344
|
+
break;
|
|
345
|
+
case 'workflow':
|
|
346
|
+
if (item.capability)
|
|
347
|
+
this.addRefEdge(id, item.capability, modName, 'calls');
|
|
348
|
+
if (item.reads)
|
|
349
|
+
for (const r of item.reads)
|
|
350
|
+
this.addRefEdge(id, r, modName, 'reads');
|
|
351
|
+
if (item.writes)
|
|
352
|
+
for (const w of item.writes)
|
|
353
|
+
this.addRefEdge(id, w, modName, 'writes');
|
|
354
|
+
if (item.rules)
|
|
355
|
+
for (const r of item.rules)
|
|
356
|
+
this.addRefEdge(id, r, modName, 'uses_rule');
|
|
357
|
+
if (item.trigger)
|
|
358
|
+
this.addRefEdge(id, item.trigger, modName, 'triggers_on');
|
|
359
|
+
if (item.authorization) {
|
|
360
|
+
for (const a of item.authorization)
|
|
361
|
+
this.addRefEdge(id, [a.actor], modName, 'authorized_as');
|
|
362
|
+
}
|
|
363
|
+
if (item.effects) {
|
|
364
|
+
for (const e of item.effects) {
|
|
365
|
+
if (e.kind === 'emit' && Array.isArray(e.value))
|
|
366
|
+
this.addRefEdge(id, e.value, modName, 'emits');
|
|
367
|
+
if (e.kind === 'notify' && Array.isArray(e.value))
|
|
368
|
+
this.addRefEdge(id, e.value, modName, 'notifies');
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
if (item.transitions) {
|
|
372
|
+
for (const t of item.transitions)
|
|
373
|
+
this.addRefEdge(id, t.entity, modName, 'transitions');
|
|
374
|
+
}
|
|
375
|
+
if (item.input) {
|
|
376
|
+
for (const f of item.input)
|
|
377
|
+
this.emitTypeEdges(id, f.type, modName, 'input_type');
|
|
378
|
+
}
|
|
379
|
+
if (item.returns) {
|
|
380
|
+
for (const r of item.returns)
|
|
381
|
+
this.emitTypeEdges(id, r.type, modName, 'return_type');
|
|
382
|
+
}
|
|
383
|
+
break;
|
|
384
|
+
case 'action':
|
|
385
|
+
if (item.workflow)
|
|
386
|
+
this.addRefEdge(id, item.workflow, modName, 'invokes');
|
|
387
|
+
break;
|
|
388
|
+
case 'event':
|
|
389
|
+
if (item.payload)
|
|
390
|
+
this.emitTypeEdges(id, item.payload, modName, 'payload_type');
|
|
391
|
+
break;
|
|
392
|
+
case 'capability':
|
|
393
|
+
if (item.actors)
|
|
394
|
+
for (const a of item.actors)
|
|
395
|
+
this.addRefEdge(id, a, modName, 'member_of');
|
|
396
|
+
break;
|
|
397
|
+
case 'surface':
|
|
398
|
+
if (item.capability)
|
|
399
|
+
this.addRefEdge(id, item.capability, modName, 'calls');
|
|
400
|
+
if (item.binds)
|
|
401
|
+
this.addRefEdge(id, item.binds, modName, 'binds');
|
|
402
|
+
if (item.actions)
|
|
403
|
+
for (const a of item.actions)
|
|
404
|
+
this.addRefEdge(id, a, modName, 'exposes_action');
|
|
405
|
+
if (item.surfaces)
|
|
406
|
+
for (const s of item.surfaces)
|
|
407
|
+
this.addRefEdge(id, s, modName, 'contains_surface');
|
|
408
|
+
if (item.serialization)
|
|
409
|
+
this.addRefEdge(id, item.serialization, modName, 'uses_serialization');
|
|
410
|
+
if (item.rules)
|
|
411
|
+
for (const r of item.rules)
|
|
412
|
+
this.addRefEdge(id, r, modName, 'uses_rule');
|
|
413
|
+
if (item.hooks) {
|
|
414
|
+
for (const h of item.hooks) {
|
|
415
|
+
this.addRefEdge(id, h.target, modName, 'invokes');
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
break;
|
|
419
|
+
case 'rendering':
|
|
420
|
+
if (item.target)
|
|
421
|
+
this.addRefEdge(id, item.target, modName, 'targets_surface');
|
|
422
|
+
break;
|
|
423
|
+
case 'theme':
|
|
424
|
+
if (item.extends)
|
|
425
|
+
this.addRefEdge(id, [item.extends], modName, 'extends_tokens');
|
|
426
|
+
break;
|
|
427
|
+
case 'transport':
|
|
428
|
+
if (item.target)
|
|
429
|
+
this.addRefEdge(id, item.target, modName, 'attaches_to');
|
|
430
|
+
break;
|
|
431
|
+
case 'storage':
|
|
432
|
+
if (item.target)
|
|
433
|
+
this.addRefEdge(id, item.target, modName, 'refines_entity');
|
|
434
|
+
break;
|
|
435
|
+
case 'execution':
|
|
436
|
+
if (item.target)
|
|
437
|
+
this.addRefEdge(id, item.target, modName, 'attaches_to');
|
|
438
|
+
break;
|
|
439
|
+
case 'extension':
|
|
440
|
+
if (item.target)
|
|
441
|
+
this.addRefEdge(id, item.target, modName, 'attaches_to');
|
|
442
|
+
if (item.contract?.input)
|
|
443
|
+
this.emitTypeEdges(id, item.contract.input, modName, 'contract_type');
|
|
444
|
+
if (item.contract?.output)
|
|
445
|
+
this.emitTypeEdges(id, item.contract.output, modName, 'contract_type');
|
|
446
|
+
break;
|
|
447
|
+
case 'constitution':
|
|
448
|
+
if (item.appliesTo)
|
|
449
|
+
for (const r of item.appliesTo)
|
|
450
|
+
this.addRefEdge(id, r, modName, 'governs');
|
|
451
|
+
break;
|
|
452
|
+
case 'security':
|
|
453
|
+
if (item.appliesTo)
|
|
454
|
+
for (const r of item.appliesTo)
|
|
455
|
+
this.addRefEdge(id, r, modName, 'governs');
|
|
456
|
+
break;
|
|
457
|
+
case 'privacy':
|
|
458
|
+
if (item.appliesTo)
|
|
459
|
+
for (const r of item.appliesTo)
|
|
460
|
+
this.addRefEdge(id, r, modName, 'governs');
|
|
461
|
+
break;
|
|
462
|
+
case 'validation':
|
|
463
|
+
if (item.appliesTo)
|
|
464
|
+
for (const r of item.appliesTo)
|
|
465
|
+
this.addRefEdge(id, r, modName, 'governs');
|
|
466
|
+
break;
|
|
467
|
+
case 'environment':
|
|
468
|
+
if (item.secrets) {
|
|
469
|
+
for (const s of item.secrets) {
|
|
470
|
+
this.addRefEdge(id, [s.name], modName, 'binds_secret');
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
break;
|
|
474
|
+
case 'deployment':
|
|
475
|
+
if (item.environments)
|
|
476
|
+
for (const e of item.environments)
|
|
477
|
+
this.addRefEdge(id, e, modName, 'includes_env');
|
|
478
|
+
break;
|
|
479
|
+
case 'test':
|
|
480
|
+
if (item.target.length > 0)
|
|
481
|
+
this.addRefEdge(id, item.target, modName, 'tests');
|
|
482
|
+
break;
|
|
483
|
+
default:
|
|
484
|
+
break;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
/* v8 ignore stop */
|
|
488
|
+
emitTypeEdges(fromId, type, modName, kind) {
|
|
489
|
+
if (type.kind === 'ref') {
|
|
490
|
+
this.addRefEdge(fromId, type.segments, modName, kind);
|
|
491
|
+
}
|
|
492
|
+
else if (type.kind === 'generic') {
|
|
493
|
+
this.emitTypeEdges(fromId, type.inner, modName, kind);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
addRefEdge(fromId, segments, modName, kind) {
|
|
497
|
+
/* v8 ignore next */
|
|
498
|
+
if (segments.length === 0)
|
|
499
|
+
return;
|
|
500
|
+
const sym = resolveSymbolRef(segments, modName, this.bind.modules, this.bind.allSymbols);
|
|
501
|
+
if (sym) {
|
|
502
|
+
const toId = nodeId(sym.module, sym.nodeKind, sym.name);
|
|
503
|
+
this.addEdge(fromId, toId, kind);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
resolveRefToId(segments, modName) {
|
|
507
|
+
if (segments.length === 0)
|
|
508
|
+
return null;
|
|
509
|
+
const sym = resolveSymbolRef(segments, modName, this.bind.modules, this.bind.allSymbols);
|
|
510
|
+
if (sym)
|
|
511
|
+
return nodeId(sym.module, sym.nodeKind, sym.name);
|
|
512
|
+
return null;
|
|
513
|
+
}
|
|
514
|
+
addEdge(from, to, kind) {
|
|
515
|
+
this.edges.push({ from, to, kind });
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
// ---------------------------------------------------------------------------
|
|
519
|
+
// Value serialization helper
|
|
520
|
+
// ---------------------------------------------------------------------------
|
|
521
|
+
function serializeValueNode(v) {
|
|
522
|
+
switch (v.kind) {
|
|
523
|
+
case 'string': return v['value'];
|
|
524
|
+
case 'integer': return v['value'];
|
|
525
|
+
case 'decimal': return v['value'];
|
|
526
|
+
case 'boolean': return v['value'];
|
|
527
|
+
case 'identifier': return v['value'];
|
|
528
|
+
case 'ref': return v['segments'].join('.');
|
|
529
|
+
case 'list': return v['items'].map(serializeValueNode);
|
|
530
|
+
/* v8 ignore next */
|
|
531
|
+
default: return null;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
// ---------------------------------------------------------------------------
|
|
535
|
+
// Pluralization for category keys
|
|
536
|
+
// ---------------------------------------------------------------------------
|
|
537
|
+
function pluralize(kind) {
|
|
538
|
+
const map = {
|
|
539
|
+
entity: 'entities',
|
|
540
|
+
value: 'values',
|
|
541
|
+
enum: 'enums',
|
|
542
|
+
rule: 'rules',
|
|
543
|
+
actor: 'actors',
|
|
544
|
+
capability: 'capabilities',
|
|
545
|
+
workflow: 'workflows',
|
|
546
|
+
action: 'actions',
|
|
547
|
+
event: 'events',
|
|
548
|
+
schedule: 'schedules',
|
|
549
|
+
surface: 'surfaces',
|
|
550
|
+
rendering: 'renderings',
|
|
551
|
+
tokens: 'tokens',
|
|
552
|
+
theme: 'themes',
|
|
553
|
+
strings: 'strings',
|
|
554
|
+
serialization: 'serializations',
|
|
555
|
+
integration: 'integrations',
|
|
556
|
+
transport: 'transports',
|
|
557
|
+
storage: 'storages',
|
|
558
|
+
execution: 'executions',
|
|
559
|
+
extension: 'extensions',
|
|
560
|
+
constitution: 'constitutions',
|
|
561
|
+
security: 'securities',
|
|
562
|
+
privacy: 'privacies',
|
|
563
|
+
validation: 'validations',
|
|
564
|
+
secret: 'secrets',
|
|
565
|
+
environment: 'environments',
|
|
566
|
+
deployment: 'deployments',
|
|
567
|
+
test: 'tests',
|
|
568
|
+
product_ref: 'product_refs',
|
|
569
|
+
};
|
|
570
|
+
/* v8 ignore next */
|
|
571
|
+
return map[kind] ?? `${kind}s`;
|
|
572
|
+
}
|
|
573
|
+
//# sourceMappingURL=builder.js.map
|