@synergenius/flow-weaver 0.2.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 +122 -0
- package/README.md +315 -0
- package/dist/annotation-generator.d.ts +45 -0
- package/dist/annotation-generator.js +557 -0
- package/dist/api/builder.d.ts +223 -0
- package/dist/api/builder.js +345 -0
- package/dist/api/compile.d.ts +92 -0
- package/dist/api/compile.js +149 -0
- package/dist/api/extract-types.d.ts +29 -0
- package/dist/api/extract-types.js +57 -0
- package/dist/api/generate-in-place.d.ts +73 -0
- package/dist/api/generate-in-place.js +1353 -0
- package/dist/api/generate.d.ts +83 -0
- package/dist/api/generate.js +510 -0
- package/dist/api/helpers.d.ts +248 -0
- package/dist/api/helpers.js +285 -0
- package/dist/api/index.d.ts +46 -0
- package/dist/api/index.js +45 -0
- package/dist/api/inline-runtime.d.ts +27 -0
- package/dist/api/inline-runtime.js +551 -0
- package/dist/api/manipulation/connections.d.ts +79 -0
- package/dist/api/manipulation/connections.js +151 -0
- package/dist/api/manipulation/index.d.ts +34 -0
- package/dist/api/manipulation/index.js +41 -0
- package/dist/api/manipulation/node-types.d.ts +123 -0
- package/dist/api/manipulation/node-types.js +200 -0
- package/dist/api/manipulation/nodes.d.ts +144 -0
- package/dist/api/manipulation/nodes.js +333 -0
- package/dist/api/manipulation/ports.d.ts +59 -0
- package/dist/api/manipulation/ports.js +228 -0
- package/dist/api/manipulation/scopes.d.ts +52 -0
- package/dist/api/manipulation/scopes.js +156 -0
- package/dist/api/manipulation/validation.d.ts +6 -0
- package/dist/api/manipulation/validation.js +6 -0
- package/dist/api/manipulation/workflow.d.ts +81 -0
- package/dist/api/manipulation/workflow.js +116 -0
- package/dist/api/manipulation.d.ts +8 -0
- package/dist/api/manipulation.js +8 -0
- package/dist/api/parse.d.ts +48 -0
- package/dist/api/parse.js +110 -0
- package/dist/api/patterns.d.ts +112 -0
- package/dist/api/patterns.js +306 -0
- package/dist/api/query.d.ts +429 -0
- package/dist/api/query.js +816 -0
- package/dist/api/templates.d.ts +98 -0
- package/dist/api/templates.js +117 -0
- package/dist/api/transform.d.ts +31 -0
- package/dist/api/transform.js +40 -0
- package/dist/api/validate.d.ts +25 -0
- package/dist/api/validate.js +39 -0
- package/dist/api/workflow-file-operations.d.ts +29 -0
- package/dist/api/workflow-file-operations.js +180 -0
- package/dist/ast/builder.d.ts +210 -0
- package/dist/ast/builder.js +395 -0
- package/dist/ast/index.d.ts +5 -0
- package/dist/ast/index.js +5 -0
- package/dist/ast/serialization-node.d.ts +6 -0
- package/dist/ast/serialization-node.js +30 -0
- package/dist/ast/serialization.d.ts +43 -0
- package/dist/ast/serialization.js +134 -0
- package/dist/ast/types.d.ts +852 -0
- package/dist/ast/types.js +2 -0
- package/dist/ast/workflow-utils.d.ts +54 -0
- package/dist/ast/workflow-utils.js +114 -0
- package/dist/body-generator.d.ts +31 -0
- package/dist/body-generator.js +35 -0
- package/dist/built-in-nodes/delay.d.ts +11 -0
- package/dist/built-in-nodes/delay.js +29 -0
- package/dist/built-in-nodes/index.d.ts +5 -0
- package/dist/built-in-nodes/index.js +4 -0
- package/dist/built-in-nodes/invoke-workflow.d.ts +13 -0
- package/dist/built-in-nodes/invoke-workflow.js +25 -0
- package/dist/built-in-nodes/mock-types.d.ts +18 -0
- package/dist/built-in-nodes/mock-types.js +12 -0
- package/dist/built-in-nodes/wait-for-event.d.ts +13 -0
- package/dist/built-in-nodes/wait-for-event.js +25 -0
- package/dist/chevrotain-parser/connect-parser.d.ts +24 -0
- package/dist/chevrotain-parser/connect-parser.js +98 -0
- package/dist/chevrotain-parser/grammar-diagrams.d.ts +29 -0
- package/dist/chevrotain-parser/grammar-diagrams.js +264 -0
- package/dist/chevrotain-parser/index.d.ts +25 -0
- package/dist/chevrotain-parser/index.js +27 -0
- package/dist/chevrotain-parser/map-parser.d.ts +33 -0
- package/dist/chevrotain-parser/map-parser.js +130 -0
- package/dist/chevrotain-parser/node-parser.d.ts +36 -0
- package/dist/chevrotain-parser/node-parser.js +466 -0
- package/dist/chevrotain-parser/path-parser.d.ts +28 -0
- package/dist/chevrotain-parser/path-parser.js +118 -0
- package/dist/chevrotain-parser/port-parser.d.ts +36 -0
- package/dist/chevrotain-parser/port-parser.js +442 -0
- package/dist/chevrotain-parser/position-parser.d.ts +20 -0
- package/dist/chevrotain-parser/position-parser.js +83 -0
- package/dist/chevrotain-parser/scope-parser.d.ts +19 -0
- package/dist/chevrotain-parser/scope-parser.js +104 -0
- package/dist/chevrotain-parser/tokens.d.ts +78 -0
- package/dist/chevrotain-parser/tokens.js +384 -0
- package/dist/chevrotain-parser/trigger-cancel-parser.d.ts +50 -0
- package/dist/chevrotain-parser/trigger-cancel-parser.js +282 -0
- package/dist/cli/commands/changelog.d.ts +13 -0
- package/dist/cli/commands/changelog.js +135 -0
- package/dist/cli/commands/compile.d.ts +64 -0
- package/dist/cli/commands/compile.js +278 -0
- package/dist/cli/commands/create.d.ts +33 -0
- package/dist/cli/commands/create.js +147 -0
- package/dist/cli/commands/describe.d.ts +68 -0
- package/dist/cli/commands/describe.js +377 -0
- package/dist/cli/commands/dev.d.ts +32 -0
- package/dist/cli/commands/dev.js +384 -0
- package/dist/cli/commands/diagram.d.ts +13 -0
- package/dist/cli/commands/diagram.js +33 -0
- package/dist/cli/commands/diff.d.ts +11 -0
- package/dist/cli/commands/diff.js +59 -0
- package/dist/cli/commands/doctor.d.ts +57 -0
- package/dist/cli/commands/doctor.js +719 -0
- package/dist/cli/commands/export.d.ts +57 -0
- package/dist/cli/commands/export.js +163 -0
- package/dist/cli/commands/grammar.d.ts +9 -0
- package/dist/cli/commands/grammar.js +39 -0
- package/dist/cli/commands/init.d.ts +59 -0
- package/dist/cli/commands/init.js +435 -0
- package/dist/cli/commands/listen.d.ts +16 -0
- package/dist/cli/commands/listen.js +39 -0
- package/dist/cli/commands/market.d.ts +52 -0
- package/dist/cli/commands/market.js +436 -0
- package/dist/cli/commands/migrate.d.ts +13 -0
- package/dist/cli/commands/migrate.js +89 -0
- package/dist/cli/commands/openapi.d.ts +37 -0
- package/dist/cli/commands/openapi.js +67 -0
- package/dist/cli/commands/pattern.d.ts +34 -0
- package/dist/cli/commands/pattern.js +185 -0
- package/dist/cli/commands/plugin.d.ts +16 -0
- package/dist/cli/commands/plugin.js +176 -0
- package/dist/cli/commands/run.d.ts +49 -0
- package/dist/cli/commands/run.js +191 -0
- package/dist/cli/commands/serve.d.ts +45 -0
- package/dist/cli/commands/serve.js +81 -0
- package/dist/cli/commands/templates.d.ts +8 -0
- package/dist/cli/commands/templates.js +54 -0
- package/dist/cli/commands/ui.d.ts +16 -0
- package/dist/cli/commands/ui.js +130 -0
- package/dist/cli/commands/validate.d.ts +12 -0
- package/dist/cli/commands/validate.js +247 -0
- package/dist/cli/commands/watch.d.ts +9 -0
- package/dist/cli/commands/watch.js +70 -0
- package/dist/cli/flow-weaver.mjs +92924 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/index.js +742 -0
- package/dist/cli/templates/ai/mock-provider.d.ts +7 -0
- package/dist/cli/templates/ai/mock-provider.js +64 -0
- package/dist/cli/templates/ai/types.d.ts +47 -0
- package/dist/cli/templates/ai/types.js +5 -0
- package/dist/cli/templates/approvals/index.d.ts +15 -0
- package/dist/cli/templates/approvals/index.js +241 -0
- package/dist/cli/templates/index.d.ts +102 -0
- package/dist/cli/templates/index.js +101 -0
- package/dist/cli/templates/nodes/agent-router.d.ts +3 -0
- package/dist/cli/templates/nodes/agent-router.js +114 -0
- package/dist/cli/templates/nodes/aggregator.d.ts +7 -0
- package/dist/cli/templates/nodes/aggregator.js +63 -0
- package/dist/cli/templates/nodes/conversation-memory.d.ts +3 -0
- package/dist/cli/templates/nodes/conversation-memory.js +85 -0
- package/dist/cli/templates/nodes/http.d.ts +7 -0
- package/dist/cli/templates/nodes/http.js +80 -0
- package/dist/cli/templates/nodes/human-approval.d.ts +3 -0
- package/dist/cli/templates/nodes/human-approval.js +110 -0
- package/dist/cli/templates/nodes/json-extractor.d.ts +3 -0
- package/dist/cli/templates/nodes/json-extractor.js +119 -0
- package/dist/cli/templates/nodes/llm-call.d.ts +3 -0
- package/dist/cli/templates/nodes/llm-call.js +106 -0
- package/dist/cli/templates/nodes/prompt-template.d.ts +3 -0
- package/dist/cli/templates/nodes/prompt-template.js +52 -0
- package/dist/cli/templates/nodes/rag-retriever.d.ts +3 -0
- package/dist/cli/templates/nodes/rag-retriever.js +128 -0
- package/dist/cli/templates/nodes/tool-executor.d.ts +3 -0
- package/dist/cli/templates/nodes/tool-executor.js +108 -0
- package/dist/cli/templates/nodes/transformer.d.ts +7 -0
- package/dist/cli/templates/nodes/transformer.js +68 -0
- package/dist/cli/templates/nodes/validator.d.ts +7 -0
- package/dist/cli/templates/nodes/validator.js +62 -0
- package/dist/cli/templates/providers/index.d.ts +14 -0
- package/dist/cli/templates/providers/index.js +239 -0
- package/dist/cli/templates/shared/approval-types.d.ts +9 -0
- package/dist/cli/templates/shared/approval-types.js +31 -0
- package/dist/cli/templates/shared/llm-types.d.ts +15 -0
- package/dist/cli/templates/shared/llm-types.js +104 -0
- package/dist/cli/templates/workflows/aggregator.d.ts +7 -0
- package/dist/cli/templates/workflows/aggregator.js +104 -0
- package/dist/cli/templates/workflows/ai-agent-durable.d.ts +8 -0
- package/dist/cli/templates/workflows/ai-agent-durable.js +338 -0
- package/dist/cli/templates/workflows/ai-agent.d.ts +31 -0
- package/dist/cli/templates/workflows/ai-agent.js +326 -0
- package/dist/cli/templates/workflows/ai-chat.d.ts +7 -0
- package/dist/cli/templates/workflows/ai-chat.js +169 -0
- package/dist/cli/templates/workflows/ai-pipeline-durable.d.ts +8 -0
- package/dist/cli/templates/workflows/ai-pipeline-durable.js +330 -0
- package/dist/cli/templates/workflows/ai-rag.d.ts +7 -0
- package/dist/cli/templates/workflows/ai-rag.js +186 -0
- package/dist/cli/templates/workflows/ai-react.d.ts +7 -0
- package/dist/cli/templates/workflows/ai-react.js +294 -0
- package/dist/cli/templates/workflows/conditional.d.ts +12 -0
- package/dist/cli/templates/workflows/conditional.js +142 -0
- package/dist/cli/templates/workflows/error-handler.d.ts +7 -0
- package/dist/cli/templates/workflows/error-handler.js +147 -0
- package/dist/cli/templates/workflows/foreach.d.ts +7 -0
- package/dist/cli/templates/workflows/foreach.js +143 -0
- package/dist/cli/templates/workflows/sequential.d.ts +7 -0
- package/dist/cli/templates/workflows/sequential.js +198 -0
- package/dist/cli/templates/workflows/webhook.d.ts +7 -0
- package/dist/cli/templates/workflows/webhook.js +161 -0
- package/dist/cli/utils/logger.d.ts +15 -0
- package/dist/cli/utils/logger.js +46 -0
- package/dist/constants.d.ts +100 -0
- package/dist/constants.js +125 -0
- package/dist/defaults.d.ts +3 -0
- package/dist/defaults.js +3 -0
- package/dist/deployment/config/defaults.d.ts +29 -0
- package/dist/deployment/config/defaults.js +98 -0
- package/dist/deployment/config/loader.d.ts +24 -0
- package/dist/deployment/config/loader.js +236 -0
- package/dist/deployment/config/types.d.ts +117 -0
- package/dist/deployment/config/types.js +5 -0
- package/dist/deployment/core/adapters.d.ts +90 -0
- package/dist/deployment/core/adapters.js +251 -0
- package/dist/deployment/core/executor.d.ts +62 -0
- package/dist/deployment/core/executor.js +197 -0
- package/dist/deployment/core/formatters.d.ts +57 -0
- package/dist/deployment/core/formatters.js +170 -0
- package/dist/deployment/index.d.ts +31 -0
- package/dist/deployment/index.js +48 -0
- package/dist/deployment/openapi/generator.d.ts +146 -0
- package/dist/deployment/openapi/generator.js +347 -0
- package/dist/deployment/openapi/schema-converter.d.ts +49 -0
- package/dist/deployment/openapi/schema-converter.js +192 -0
- package/dist/deployment/targets/base.d.ts +316 -0
- package/dist/deployment/targets/base.js +823 -0
- package/dist/deployment/targets/cloudflare.d.ts +23 -0
- package/dist/deployment/targets/cloudflare.js +1125 -0
- package/dist/deployment/targets/inngest.d.ts +38 -0
- package/dist/deployment/targets/inngest.js +926 -0
- package/dist/deployment/targets/lambda.d.ts +23 -0
- package/dist/deployment/targets/lambda.js +1289 -0
- package/dist/deployment/targets/vercel.d.ts +23 -0
- package/dist/deployment/targets/vercel.js +886 -0
- package/dist/deployment/types.d.ts +183 -0
- package/dist/deployment/types.js +8 -0
- package/dist/diagram/geometry.d.ts +26 -0
- package/dist/diagram/geometry.js +850 -0
- package/dist/diagram/index.d.ts +16 -0
- package/dist/diagram/index.js +42 -0
- package/dist/diagram/layout.d.ts +11 -0
- package/dist/diagram/layout.js +143 -0
- package/dist/diagram/orthogonal-router.d.ts +79 -0
- package/dist/diagram/orthogonal-router.js +568 -0
- package/dist/diagram/renderer.d.ts +3 -0
- package/dist/diagram/renderer.js +207 -0
- package/dist/diagram/theme.d.ts +20 -0
- package/dist/diagram/theme.js +189 -0
- package/dist/diagram/types.d.ts +70 -0
- package/dist/diagram/types.js +2 -0
- package/dist/diff/WorkflowDiffer.d.ts +13 -0
- package/dist/diff/WorkflowDiffer.js +429 -0
- package/dist/diff/formatDiff.d.ts +10 -0
- package/dist/diff/formatDiff.js +220 -0
- package/dist/diff/impact.d.ts +29 -0
- package/dist/diff/impact.js +119 -0
- package/dist/diff/index.d.ts +10 -0
- package/dist/diff/index.js +9 -0
- package/dist/diff/types.d.ts +138 -0
- package/dist/diff/types.js +35 -0
- package/dist/doc-metadata/extractors/annotations.d.ts +56 -0
- package/dist/doc-metadata/extractors/annotations.js +337 -0
- package/dist/doc-metadata/extractors/cli-commands.d.ts +17 -0
- package/dist/doc-metadata/extractors/cli-commands.js +355 -0
- package/dist/doc-metadata/extractors/mcp-tools.d.ts +16 -0
- package/dist/doc-metadata/extractors/mcp-tools.js +689 -0
- package/dist/doc-metadata/extractors/plugin-api.d.ts +19 -0
- package/dist/doc-metadata/extractors/plugin-api.js +279 -0
- package/dist/doc-metadata/index.d.ts +5 -0
- package/dist/doc-metadata/index.js +4 -0
- package/dist/doc-metadata/types.d.ts +120 -0
- package/dist/doc-metadata/types.js +5 -0
- package/dist/editor-completions/annotationValues.d.ts +12 -0
- package/dist/editor-completions/annotationValues.js +138 -0
- package/dist/editor-completions/contextParser.d.ts +40 -0
- package/dist/editor-completions/contextParser.js +410 -0
- package/dist/editor-completions/dataTypes.d.ts +16 -0
- package/dist/editor-completions/dataTypes.js +95 -0
- package/dist/editor-completions/goToDefinition.d.ts +27 -0
- package/dist/editor-completions/goToDefinition.js +112 -0
- package/dist/editor-completions/index.d.ts +39 -0
- package/dist/editor-completions/index.js +181 -0
- package/dist/editor-completions/jsDocAnnotations.d.ts +29 -0
- package/dist/editor-completions/jsDocAnnotations.js +357 -0
- package/dist/editor-completions/modifierCompletions.d.ts +17 -0
- package/dist/editor-completions/modifierCompletions.js +197 -0
- package/dist/editor-completions/types.d.ts +119 -0
- package/dist/editor-completions/types.js +8 -0
- package/dist/export/index.d.ts +68 -0
- package/dist/export/index.js +1074 -0
- package/dist/export/templates.d.ts +24 -0
- package/dist/export/templates.js +186 -0
- package/dist/friendly-errors.d.ts +35 -0
- package/dist/friendly-errors.js +375 -0
- package/dist/function-like.d.ts +38 -0
- package/dist/function-like.js +83 -0
- package/dist/generated-branding.d.ts +16 -0
- package/dist/generated-branding.js +22 -0
- package/dist/generator/async-detection.d.ts +27 -0
- package/dist/generator/async-detection.js +56 -0
- package/dist/generator/code-utils.d.ts +76 -0
- package/dist/generator/code-utils.js +410 -0
- package/dist/generator/control-flow.d.ts +54 -0
- package/dist/generator/control-flow.js +284 -0
- package/dist/generator/inngest.d.ts +53 -0
- package/dist/generator/inngest.js +1126 -0
- package/dist/generator/scope-function-generator.d.ts +78 -0
- package/dist/generator/scope-function-generator.js +360 -0
- package/dist/generator/unified.d.ts +42 -0
- package/dist/generator/unified.js +1504 -0
- package/dist/generator.d.ts +54 -0
- package/dist/generator.js +100 -0
- package/dist/index.d.ts +85 -0
- package/dist/index.js +89 -0
- package/dist/jsdoc-parser.d.ts +308 -0
- package/dist/jsdoc-parser.js +923 -0
- package/dist/jsdoc-port-sync/constants.d.ts +41 -0
- package/dist/jsdoc-port-sync/constants.js +103 -0
- package/dist/jsdoc-port-sync/diff.d.ts +76 -0
- package/dist/jsdoc-port-sync/diff.js +319 -0
- package/dist/jsdoc-port-sync/index.d.ts +42 -0
- package/dist/jsdoc-port-sync/index.js +45 -0
- package/dist/jsdoc-port-sync/port-parser.d.ts +68 -0
- package/dist/jsdoc-port-sync/port-parser.js +579 -0
- package/dist/jsdoc-port-sync/rename.d.ts +21 -0
- package/dist/jsdoc-port-sync/rename.js +256 -0
- package/dist/jsdoc-port-sync/signature-parser.d.ts +104 -0
- package/dist/jsdoc-port-sync/signature-parser.js +559 -0
- package/dist/jsdoc-port-sync/sync.d.ts +36 -0
- package/dist/jsdoc-port-sync/sync.js +644 -0
- package/dist/jsdoc-port-sync.d.ts +10 -0
- package/dist/jsdoc-port-sync.js +10 -0
- package/dist/marketplace/index.d.ts +11 -0
- package/dist/marketplace/index.js +10 -0
- package/dist/marketplace/manifest.d.ts +32 -0
- package/dist/marketplace/manifest.js +176 -0
- package/dist/marketplace/registry.d.ts +30 -0
- package/dist/marketplace/registry.js +100 -0
- package/dist/marketplace/types.d.ts +154 -0
- package/dist/marketplace/types.js +9 -0
- package/dist/marketplace/validator.d.ts +13 -0
- package/dist/marketplace/validator.js +131 -0
- package/dist/mcp/auto-registration.d.ts +3 -0
- package/dist/mcp/auto-registration.js +62 -0
- package/dist/mcp/editor-connection.d.ts +50 -0
- package/dist/mcp/editor-connection.js +125 -0
- package/dist/mcp/event-buffer.d.ts +62 -0
- package/dist/mcp/event-buffer.js +150 -0
- package/dist/mcp/index.d.ts +12 -0
- package/dist/mcp/index.js +11 -0
- package/dist/mcp/resources.d.ts +14 -0
- package/dist/mcp/resources.js +55 -0
- package/dist/mcp/response-utils.d.ts +63 -0
- package/dist/mcp/response-utils.js +89 -0
- package/dist/mcp/server.d.ts +4 -0
- package/dist/mcp/server.js +99 -0
- package/dist/mcp/tools-diagram.d.ts +8 -0
- package/dist/mcp/tools-diagram.js +53 -0
- package/dist/mcp/tools-editor.d.ts +5 -0
- package/dist/mcp/tools-editor.js +190 -0
- package/dist/mcp/tools-export.d.ts +9 -0
- package/dist/mcp/tools-export.js +180 -0
- package/dist/mcp/tools-marketplace.d.ts +9 -0
- package/dist/mcp/tools-marketplace.js +132 -0
- package/dist/mcp/tools-pattern.d.ts +3 -0
- package/dist/mcp/tools-pattern.js +783 -0
- package/dist/mcp/tools-query.d.ts +3 -0
- package/dist/mcp/tools-query.js +364 -0
- package/dist/mcp/tools-template.d.ts +10 -0
- package/dist/mcp/tools-template.js +119 -0
- package/dist/mcp/types.d.ts +70 -0
- package/dist/mcp/types.js +8 -0
- package/dist/mcp/workflow-executor.d.ts +47 -0
- package/dist/mcp/workflow-executor.js +133 -0
- package/dist/migration/registry.d.ts +30 -0
- package/dist/migration/registry.js +29 -0
- package/dist/node-types-generator.d.ts +49 -0
- package/dist/node-types-generator.js +139 -0
- package/dist/npm-packages.d.ts +56 -0
- package/dist/npm-packages.js +255 -0
- package/dist/parser.d.ts +204 -0
- package/dist/parser.js +2100 -0
- package/dist/plugin/PluginPanel.d.ts +12 -0
- package/dist/plugin/PluginPanel.js +5 -0
- package/dist/plugin/index.d.ts +13 -0
- package/dist/plugin/index.js +14 -0
- package/dist/plugin/types.d.ts +75 -0
- package/dist/plugin/types.js +8 -0
- package/dist/resolve-package-types.d.ts +17 -0
- package/dist/resolve-package-types.js +123 -0
- package/dist/runtime/CancellationError.d.ts +11 -0
- package/dist/runtime/CancellationError.js +20 -0
- package/dist/runtime/ExecutionContext.d.ts +146 -0
- package/dist/runtime/ExecutionContext.js +235 -0
- package/dist/runtime/builtin-functions.d.ts +8 -0
- package/dist/runtime/builtin-functions.js +549 -0
- package/dist/runtime/events.d.ts +50 -0
- package/dist/runtime/events.js +2 -0
- package/dist/runtime/function-registry.d.ts +59 -0
- package/dist/runtime/function-registry.js +66 -0
- package/dist/runtime/index.d.ts +7 -0
- package/dist/runtime/index.js +7 -0
- package/dist/runtime/parameter-resolver.d.ts +62 -0
- package/dist/runtime/parameter-resolver.js +113 -0
- package/dist/server/index.d.ts +7 -0
- package/dist/server/index.js +6 -0
- package/dist/server/types.d.ts +93 -0
- package/dist/server/types.js +5 -0
- package/dist/server/webhook-server.d.ts +50 -0
- package/dist/server/webhook-server.js +269 -0
- package/dist/server/workflow-registry.d.ts +61 -0
- package/dist/server/workflow-registry.js +202 -0
- package/dist/shared-project.d.ts +9 -0
- package/dist/shared-project.js +28 -0
- package/dist/sugar-optimizer.d.ts +40 -0
- package/dist/sugar-optimizer.js +387 -0
- package/dist/testing/assertions.d.ts +51 -0
- package/dist/testing/assertions.js +127 -0
- package/dist/testing/index.d.ts +30 -0
- package/dist/testing/index.js +24 -0
- package/dist/testing/mock-approval.d.ts +81 -0
- package/dist/testing/mock-approval.js +98 -0
- package/dist/testing/mock-llm.d.ts +124 -0
- package/dist/testing/mock-llm.js +119 -0
- package/dist/testing/recorder.d.ts +72 -0
- package/dist/testing/recorder.js +70 -0
- package/dist/testing/replayer.d.ts +56 -0
- package/dist/testing/replayer.js +143 -0
- package/dist/testing/token-tracker.d.ts +71 -0
- package/dist/testing/token-tracker.js +94 -0
- package/dist/type-checker.d.ts +42 -0
- package/dist/type-checker.js +190 -0
- package/dist/type-mappings.d.ts +29 -0
- package/dist/type-mappings.js +125 -0
- package/dist/types/branded-ports.d.ts +151 -0
- package/dist/types/branded-ports.js +121 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.js +5 -0
- package/dist/types.d.ts +139 -0
- package/dist/types.js +15 -0
- package/dist/utils/error-utils.d.ts +15 -0
- package/dist/utils/error-utils.js +27 -0
- package/dist/utils/lru-cache.d.ts +15 -0
- package/dist/utils/lru-cache.js +40 -0
- package/dist/utils/port-ordering.d.ts +26 -0
- package/dist/utils/port-ordering.js +88 -0
- package/dist/utils/port-tag-utils.d.ts +23 -0
- package/dist/utils/port-tag-utils.js +41 -0
- package/dist/utils/string-distance.d.ts +14 -0
- package/dist/utils/string-distance.js +56 -0
- package/dist/validation/agent-detection.d.ts +33 -0
- package/dist/validation/agent-detection.js +115 -0
- package/dist/validation/agent-rules.d.ts +48 -0
- package/dist/validation/agent-rules.js +262 -0
- package/dist/validator.d.ts +92 -0
- package/dist/validator.js +970 -0
- package/package.json +109 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type GenerateResult } from "./api/generate.js";
|
|
2
|
+
export interface GeneratorOptions {
|
|
3
|
+
production?: boolean;
|
|
4
|
+
sourceMap?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export type GeneratorResult = GenerateResult;
|
|
7
|
+
/**
|
|
8
|
+
* Workflow Generator - Convenience wrapper with verbose logging
|
|
9
|
+
*
|
|
10
|
+
* This class provides a high-level interface for generating workflows
|
|
11
|
+
* with detailed console output. It orchestrates parsing, validation,
|
|
12
|
+
* and code generation while providing progress feedback.
|
|
13
|
+
*
|
|
14
|
+
* For programmatic use without console output, use the api/* modules directly:
|
|
15
|
+
* - parseWorkflow() - Parse workflow files to AST
|
|
16
|
+
* - validateWorkflow() - Validate workflow AST
|
|
17
|
+
* - generateCode() - Generate executable TypeScript
|
|
18
|
+
*/
|
|
19
|
+
export declare class WorkflowGenerator {
|
|
20
|
+
/**
|
|
21
|
+
* Generate executable TypeScript code from a workflow file
|
|
22
|
+
*
|
|
23
|
+
* This method performs three steps with verbose console output:
|
|
24
|
+
* 1. Parse the workflow file to extract node types and workflows
|
|
25
|
+
* 2. Validate the workflow structure and connections
|
|
26
|
+
* 3. Generate executable TypeScript code
|
|
27
|
+
*
|
|
28
|
+
* @param filePath - Path to the workflow file
|
|
29
|
+
* @param workflowName - Name of the workflow to generate
|
|
30
|
+
* @param options - Generation options (production mode, source maps)
|
|
31
|
+
* @returns Promise resolving to generated code string, or GeneratorResult with source map
|
|
32
|
+
*
|
|
33
|
+
* @throws Error if validation fails or workflow not found
|
|
34
|
+
*/
|
|
35
|
+
generate(filePath: string, workflowName: string, options: GeneratorOptions & {
|
|
36
|
+
sourceMap: true;
|
|
37
|
+
}): Promise<GeneratorResult>;
|
|
38
|
+
generate(filePath: string, workflowName: string, options?: GeneratorOptions): Promise<string>;
|
|
39
|
+
/**
|
|
40
|
+
* Parse workflow file with detailed console logging
|
|
41
|
+
* @private
|
|
42
|
+
*/
|
|
43
|
+
private parseWithLogging;
|
|
44
|
+
/**
|
|
45
|
+
* Validate workflow AST with detailed console logging
|
|
46
|
+
* @private
|
|
47
|
+
*/
|
|
48
|
+
private validateWithLogging;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Default generator instance for convenience
|
|
52
|
+
*/
|
|
53
|
+
export declare const generator: WorkflowGenerator;
|
|
54
|
+
//# sourceMappingURL=generator.d.ts.map
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import { parseWorkflow } from "./api/parse.js";
|
|
3
|
+
import { validateWorkflow } from "./api/validate.js";
|
|
4
|
+
import { generateCode } from "./api/generate.js";
|
|
5
|
+
/**
|
|
6
|
+
* Workflow Generator - Convenience wrapper with verbose logging
|
|
7
|
+
*
|
|
8
|
+
* This class provides a high-level interface for generating workflows
|
|
9
|
+
* with detailed console output. It orchestrates parsing, validation,
|
|
10
|
+
* and code generation while providing progress feedback.
|
|
11
|
+
*
|
|
12
|
+
* For programmatic use without console output, use the api/* modules directly:
|
|
13
|
+
* - parseWorkflow() - Parse workflow files to AST
|
|
14
|
+
* - validateWorkflow() - Validate workflow AST
|
|
15
|
+
* - generateCode() - Generate executable TypeScript
|
|
16
|
+
*/
|
|
17
|
+
export class WorkflowGenerator {
|
|
18
|
+
async generate(filePath, workflowName, options = {}) {
|
|
19
|
+
const { production = false, sourceMap = false } = options;
|
|
20
|
+
// Step 1: Parse
|
|
21
|
+
const parseResult = await this.parseWithLogging(filePath, workflowName);
|
|
22
|
+
// Step 2: Validate
|
|
23
|
+
this.validateWithLogging(parseResult.ast);
|
|
24
|
+
// Step 3: Generate
|
|
25
|
+
console.log("\\nGenerating workflow function body...");
|
|
26
|
+
// Call generateCode with the correct overload based on sourceMap
|
|
27
|
+
// Pass allWorkflows for local dependency generation
|
|
28
|
+
if (sourceMap) {
|
|
29
|
+
return generateCode(parseResult.ast, { production, sourceMap: true, allWorkflows: parseResult.allWorkflows });
|
|
30
|
+
}
|
|
31
|
+
return generateCode(parseResult.ast, { production, allWorkflows: parseResult.allWorkflows });
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Parse workflow file with detailed console logging
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
37
|
+
async parseWithLogging(filePath, workflowName) {
|
|
38
|
+
console.log("Parsing annotations...");
|
|
39
|
+
const parseResult = await parseWorkflow(filePath, { workflowName });
|
|
40
|
+
if (parseResult.errors.length > 0) {
|
|
41
|
+
console.error(`\\n❌ ${parseResult.errors.length} parse error(s):`);
|
|
42
|
+
parseResult.errors.forEach((error) => {
|
|
43
|
+
console.error(` - ${error}`);
|
|
44
|
+
});
|
|
45
|
+
throw new Error(`Workflow parsing failed with ${parseResult.errors.length} error(s)`);
|
|
46
|
+
}
|
|
47
|
+
// Log discovered node types
|
|
48
|
+
const nodeTypes = parseResult.ast.nodeTypes;
|
|
49
|
+
console.log(`Found ${nodeTypes.length} node types:`);
|
|
50
|
+
nodeTypes.forEach((nodeType) => {
|
|
51
|
+
console.log(` - ${nodeType.functionName}`);
|
|
52
|
+
});
|
|
53
|
+
// Log available workflows
|
|
54
|
+
console.log(`Found ${parseResult.availableWorkflows.length} workflows:`);
|
|
55
|
+
parseResult.availableWorkflows.forEach((wf) => {
|
|
56
|
+
console.log(` - ${wf}`);
|
|
57
|
+
});
|
|
58
|
+
return parseResult;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Validate workflow AST with detailed console logging
|
|
62
|
+
* @private
|
|
63
|
+
*/
|
|
64
|
+
validateWithLogging(ast) {
|
|
65
|
+
console.log("Validating workflow...");
|
|
66
|
+
const validation = validateWorkflow(ast);
|
|
67
|
+
// Log warnings
|
|
68
|
+
if (validation.warnings.length > 0) {
|
|
69
|
+
console.log(`\\n⚠️ ${validation.warnings.length} warning(s):`);
|
|
70
|
+
validation.warnings.forEach((warning) => {
|
|
71
|
+
console.log(` - ${warning.message}`);
|
|
72
|
+
if (warning.node) {
|
|
73
|
+
console.log(` at node: ${warning.node}`);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
console.log("");
|
|
77
|
+
}
|
|
78
|
+
// Handle validation errors
|
|
79
|
+
if (!validation.valid) {
|
|
80
|
+
console.error(`\\n❌ ${validation.errors.length} validation error(s):`);
|
|
81
|
+
validation.errors.forEach((error) => {
|
|
82
|
+
console.error(` - ${error.message}`);
|
|
83
|
+
if (error.node) {
|
|
84
|
+
console.error(` at node: ${error.node}`);
|
|
85
|
+
}
|
|
86
|
+
if (error.connection) {
|
|
87
|
+
console.error(` at connection: ${JSON.stringify(error.connection)}`);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
throw new Error(`Workflow validation failed with ${validation.errors.length} error(s)`);
|
|
91
|
+
}
|
|
92
|
+
console.log("✓ Validation passed\\n");
|
|
93
|
+
return validation;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Default generator instance for convenience
|
|
98
|
+
*/
|
|
99
|
+
export const generator = new WorkflowGenerator();
|
|
100
|
+
//# sourceMappingURL=generator.js.map
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
*
|
|
4
|
+
* # Flow Weaver Library
|
|
5
|
+
*
|
|
6
|
+
* A visual dataflow programming system for TypeScript. Workflows are defined via
|
|
7
|
+
* JSDoc annotations in standard TypeScript files and can be parsed, validated,
|
|
8
|
+
* and compiled to executable code.
|
|
9
|
+
*
|
|
10
|
+
* ## Core Concepts
|
|
11
|
+
*
|
|
12
|
+
* - **Workflow** (`TWorkflowAST`) - A graph of connected nodes with start/exit ports
|
|
13
|
+
* - **NodeType** (`TNodeTypeAST`) - Template defining inputs, outputs, and behavior
|
|
14
|
+
* - **NodeInstance** (`TNodeInstanceAST`) - A usage of a node type in a workflow
|
|
15
|
+
* - **Port** (`TPortDefinition`) - Entry/exit point on a node (data or control flow)
|
|
16
|
+
* - **Connection** (`TConnectionAST`) - Links ports between nodes
|
|
17
|
+
*
|
|
18
|
+
* ## File Format
|
|
19
|
+
*
|
|
20
|
+
* Any `.ts`, `.tsx`, `.js`, or `.jsx` file can contain workflows.
|
|
21
|
+
*
|
|
22
|
+
* ```typescript
|
|
23
|
+
* // Define a node type
|
|
24
|
+
* /**
|
|
25
|
+
* * @flowWeaver nodeType
|
|
26
|
+
* * @input a - First number
|
|
27
|
+
* * @input b - Second number
|
|
28
|
+
* * @output result - Sum
|
|
29
|
+
* *\/
|
|
30
|
+
* function add(execute: boolean, a: number, b: number): { onSuccess: boolean; result: number } { ... }
|
|
31
|
+
*
|
|
32
|
+
* // Define a workflow
|
|
33
|
+
* /**
|
|
34
|
+
* * @flowWeaver workflow
|
|
35
|
+
* * @node adder1 add
|
|
36
|
+
* * @connect Start.execute -> adder1.execute
|
|
37
|
+
* * @connect adder1.onSuccess -> Exit.onSuccess
|
|
38
|
+
* *\/
|
|
39
|
+
* export function myWorkflow(execute: boolean, params: {...}): {...} { ... }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* ## Main APIs
|
|
43
|
+
*
|
|
44
|
+
* - {@link parseWorkflow} - Parse a file to AST
|
|
45
|
+
* - {@link validateWorkflow} - Validate workflow structure
|
|
46
|
+
* - {@link generateCode} - Generate executable code from AST
|
|
47
|
+
* - {@link compileWorkflow} - Parse + validate + generate in one step
|
|
48
|
+
*
|
|
49
|
+
* ## JSDoc Port Sync (Browser-compatible)
|
|
50
|
+
*
|
|
51
|
+
* For IDE integration, use the browser-compatible sync functions:
|
|
52
|
+
* - {@link parsePortsFromFunctionText} - Extract ports from JSDoc
|
|
53
|
+
* - {@link updatePortsInFunctionText} - Update ports in function text
|
|
54
|
+
* - {@link formatPortsInFunctionText} - Format ports consistently
|
|
55
|
+
*
|
|
56
|
+
* @module @synergenius/flow-weaver
|
|
57
|
+
*/
|
|
58
|
+
export * from './api/index.js';
|
|
59
|
+
export { parser, resolveNpmNodeTypes } from './parser.js';
|
|
60
|
+
export type { TExternalNodeType } from './parser.js';
|
|
61
|
+
export type { TConnectionAST, TNodeTypeAST, TNodeInstanceAST, TNodeInstanceConfig, TPortConfig, TWorkflowAST, TPortReference, TPortDefinition, TDataType, TExecuteWhen, TBranchingStrategy, TSerializableValue, TSerializableObject, TSerializableArray, TImportDeclaration, TImportSpecifier, TSourceLocation, TValidationError, TAnalysisResult, TControlFlowGraph, TControlFlowEdge, TBranchingNodeInfo, TBranchRegion, TMergeNodeInfo, TWorkflowMetadata, TNodeMetadata, TConnectionMetadata, TASTTransformer, TASTVisitor, TParseOptions, TValidationRule, TGenerateOptions, TCompileResult, TCompilationMetadata, TNodeTypeDefaultConfig, TNodeTypePort, TPortDirection, TNodeParent, TPullExecutionConfig, TWorkflowFileExtension, TPortPlacement, TPortUI, TNodeTypeUI, TNodeUI, TWorkFlowFunctionUI, TPortType, } from './ast/types.js';
|
|
62
|
+
export { WorkflowBuilder, NodeTypeBuilder, NodeInstanceBuilder, ConnectionBuilder, } from './ast/builder.js';
|
|
63
|
+
export { portRef, port, workflow, nodeType, nodeInstance } from './ast/builder.js';
|
|
64
|
+
export { GeneratedExecutionContext } from './runtime/ExecutionContext.js';
|
|
65
|
+
export type { TDebugger } from './runtime/events.js';
|
|
66
|
+
export type { TLocalFunctionNodeType } from './node-types-generator.js';
|
|
67
|
+
export { configureGeneratedBranding, getGeneratedBranding } from './generated-branding.js';
|
|
68
|
+
export type { GeneratedBranding } from './generated-branding.js';
|
|
69
|
+
export * from './type-mappings.js';
|
|
70
|
+
export * from './constants.js';
|
|
71
|
+
export { validator, WorkflowValidator } from './validator.js';
|
|
72
|
+
export { getFriendlyError, formatFriendlyDiagnostics } from './friendly-errors.js';
|
|
73
|
+
export type { TFriendlyError } from './friendly-errors.js';
|
|
74
|
+
export { generator, WorkflowGenerator } from './generator.js';
|
|
75
|
+
export { AnnotationGenerator } from './annotation-generator.js';
|
|
76
|
+
export type { GenerateAnnotationsOptions } from './annotation-generator.js';
|
|
77
|
+
export * as GeneratorUtils from './generator.js';
|
|
78
|
+
export { parsePortsFromFunctionText, updatePortsInFunctionText, formatPortsInFunctionText, syncCodeRenames, renamePortInCode, parseReturnTypeFields, parseFunctionSignature, parseReturnFields, } from './jsdoc-port-sync.js';
|
|
79
|
+
export { workflowTemplates, nodeTemplates, getWorkflowTemplate, getNodeTemplate, toCamelCase, toPascalCase, } from './cli/templates/index.js';
|
|
80
|
+
export type { WorkflowTemplate, NodeTemplate, WorkflowTemplateOptions } from './cli/templates/index.js';
|
|
81
|
+
export { WorkflowDiffer } from './diff/WorkflowDiffer.js';
|
|
82
|
+
export { formatDiff, type TDiffFormat } from './diff/formatDiff.js';
|
|
83
|
+
export { IMPACT_DESCRIPTIONS, IMPACT_COLORS, getImpactReasons, hasBreakingChanges, getNodeTypeChanges, getCriticalConnections, } from './diff/impact.js';
|
|
84
|
+
export type { TWorkflowDiff, TNodeTypeDiff, TInstanceDiff, TConnectionDiff, TWorkflowPortsDiff, TScopeDiff, TPortChange, TImpactLevel, TChangeType, TChange, TInstanceConfigChange, TPortRef, } from './diff/types.js';
|
|
85
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
*
|
|
4
|
+
* # Flow Weaver Library
|
|
5
|
+
*
|
|
6
|
+
* A visual dataflow programming system for TypeScript. Workflows are defined via
|
|
7
|
+
* JSDoc annotations in standard TypeScript files and can be parsed, validated,
|
|
8
|
+
* and compiled to executable code.
|
|
9
|
+
*
|
|
10
|
+
* ## Core Concepts
|
|
11
|
+
*
|
|
12
|
+
* - **Workflow** (`TWorkflowAST`) - A graph of connected nodes with start/exit ports
|
|
13
|
+
* - **NodeType** (`TNodeTypeAST`) - Template defining inputs, outputs, and behavior
|
|
14
|
+
* - **NodeInstance** (`TNodeInstanceAST`) - A usage of a node type in a workflow
|
|
15
|
+
* - **Port** (`TPortDefinition`) - Entry/exit point on a node (data or control flow)
|
|
16
|
+
* - **Connection** (`TConnectionAST`) - Links ports between nodes
|
|
17
|
+
*
|
|
18
|
+
* ## File Format
|
|
19
|
+
*
|
|
20
|
+
* Any `.ts`, `.tsx`, `.js`, or `.jsx` file can contain workflows.
|
|
21
|
+
*
|
|
22
|
+
* ```typescript
|
|
23
|
+
* // Define a node type
|
|
24
|
+
* /**
|
|
25
|
+
* * @flowWeaver nodeType
|
|
26
|
+
* * @input a - First number
|
|
27
|
+
* * @input b - Second number
|
|
28
|
+
* * @output result - Sum
|
|
29
|
+
* *\/
|
|
30
|
+
* function add(execute: boolean, a: number, b: number): { onSuccess: boolean; result: number } { ... }
|
|
31
|
+
*
|
|
32
|
+
* // Define a workflow
|
|
33
|
+
* /**
|
|
34
|
+
* * @flowWeaver workflow
|
|
35
|
+
* * @node adder1 add
|
|
36
|
+
* * @connect Start.execute -> adder1.execute
|
|
37
|
+
* * @connect adder1.onSuccess -> Exit.onSuccess
|
|
38
|
+
* *\/
|
|
39
|
+
* export function myWorkflow(execute: boolean, params: {...}): {...} { ... }
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* ## Main APIs
|
|
43
|
+
*
|
|
44
|
+
* - {@link parseWorkflow} - Parse a file to AST
|
|
45
|
+
* - {@link validateWorkflow} - Validate workflow structure
|
|
46
|
+
* - {@link generateCode} - Generate executable code from AST
|
|
47
|
+
* - {@link compileWorkflow} - Parse + validate + generate in one step
|
|
48
|
+
*
|
|
49
|
+
* ## JSDoc Port Sync (Browser-compatible)
|
|
50
|
+
*
|
|
51
|
+
* For IDE integration, use the browser-compatible sync functions:
|
|
52
|
+
* - {@link parsePortsFromFunctionText} - Extract ports from JSDoc
|
|
53
|
+
* - {@link updatePortsInFunctionText} - Update ports in function text
|
|
54
|
+
* - {@link formatPortsInFunctionText} - Format ports consistently
|
|
55
|
+
*
|
|
56
|
+
* @module @synergenius/flow-weaver
|
|
57
|
+
*/
|
|
58
|
+
// Public API
|
|
59
|
+
export * from './api/index.js';
|
|
60
|
+
// Parser (for advanced use - clearing import cache)
|
|
61
|
+
export { parser, resolveNpmNodeTypes } from './parser.js';
|
|
62
|
+
// AST Builders (for programmatic AST construction)
|
|
63
|
+
export { WorkflowBuilder, NodeTypeBuilder, NodeInstanceBuilder, ConnectionBuilder, } from './ast/builder.js';
|
|
64
|
+
export { portRef, port, workflow, nodeType, nodeInstance } from './ast/builder.js';
|
|
65
|
+
// Runtime
|
|
66
|
+
export { GeneratedExecutionContext } from './runtime/ExecutionContext.js';
|
|
67
|
+
// Generated Branding (configurable output branding)
|
|
68
|
+
export { configureGeneratedBranding, getGeneratedBranding } from './generated-branding.js';
|
|
69
|
+
// Type Mappings & Constants
|
|
70
|
+
export * from './type-mappings.js';
|
|
71
|
+
export * from './constants.js';
|
|
72
|
+
// Validation
|
|
73
|
+
export { validator, WorkflowValidator } from './validator.js';
|
|
74
|
+
// Friendly Errors (beginner-friendly validation messages)
|
|
75
|
+
export { getFriendlyError, formatFriendlyDiagnostics } from './friendly-errors.js';
|
|
76
|
+
// Code Generation
|
|
77
|
+
export { generator, WorkflowGenerator } from './generator.js';
|
|
78
|
+
export { AnnotationGenerator } from './annotation-generator.js';
|
|
79
|
+
// Generator Utilities (for advanced use)
|
|
80
|
+
export * as GeneratorUtils from './generator.js';
|
|
81
|
+
// JSDoc Port Sync (browser-compatible parsing/updating)
|
|
82
|
+
export { parsePortsFromFunctionText, updatePortsInFunctionText, formatPortsInFunctionText, syncCodeRenames, renamePortInCode, parseReturnTypeFields, parseFunctionSignature, parseReturnFields, } from './jsdoc-port-sync.js';
|
|
83
|
+
// Templates (for workflow/node creation)
|
|
84
|
+
export { workflowTemplates, nodeTemplates, getWorkflowTemplate, getNodeTemplate, toCamelCase, toPascalCase, } from './cli/templates/index.js';
|
|
85
|
+
// Diff (semantic comparison)
|
|
86
|
+
export { WorkflowDiffer } from './diff/WorkflowDiffer.js';
|
|
87
|
+
export { formatDiff } from './diff/formatDiff.js';
|
|
88
|
+
export { IMPACT_DESCRIPTIONS, IMPACT_COLORS, getImpactReasons, hasBreakingChanges, getNodeTypeChanges, getCriticalConnections, } from './diff/impact.js';
|
|
89
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSDoc annotation parser for Flow Weaver
|
|
3
|
+
*
|
|
4
|
+
* Parses @flowWeaver annotations from JSDoc comments.
|
|
5
|
+
*/
|
|
6
|
+
import type { FunctionLike } from './function-like.js';
|
|
7
|
+
import type { TDataType, TPortConfig, TMergeStrategy, TNodeTagAST } from './ast/types.js';
|
|
8
|
+
export interface JSDocNodeTypeConfig {
|
|
9
|
+
name?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
color?: string;
|
|
13
|
+
icon?: string;
|
|
14
|
+
tags?: Array<{
|
|
15
|
+
label: string;
|
|
16
|
+
tooltip?: string;
|
|
17
|
+
}>;
|
|
18
|
+
executeWhen?: string;
|
|
19
|
+
scope?: string;
|
|
20
|
+
expression?: boolean;
|
|
21
|
+
defaultConfig?: {
|
|
22
|
+
pullExecution?: {
|
|
23
|
+
triggerPort: string;
|
|
24
|
+
};
|
|
25
|
+
label?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
};
|
|
28
|
+
inputs?: Record<string, {
|
|
29
|
+
type: TDataType;
|
|
30
|
+
defaultValue?: unknown;
|
|
31
|
+
optional?: boolean;
|
|
32
|
+
label?: string;
|
|
33
|
+
expression?: string;
|
|
34
|
+
scope?: string;
|
|
35
|
+
mergeStrategy?: TMergeStrategy;
|
|
36
|
+
metadata?: {
|
|
37
|
+
order?: number;
|
|
38
|
+
};
|
|
39
|
+
tsType?: string;
|
|
40
|
+
}>;
|
|
41
|
+
outputs?: Record<string, {
|
|
42
|
+
type: TDataType;
|
|
43
|
+
label?: string;
|
|
44
|
+
scope?: string;
|
|
45
|
+
metadata?: {
|
|
46
|
+
order?: number;
|
|
47
|
+
};
|
|
48
|
+
tsType?: string;
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
51
|
+
export interface JSDocWorkflowConfig {
|
|
52
|
+
name?: string;
|
|
53
|
+
description?: string;
|
|
54
|
+
strictTypes?: boolean;
|
|
55
|
+
/** NPM package imports - external node types persisted in JSDoc */
|
|
56
|
+
imports?: Array<{
|
|
57
|
+
name: string;
|
|
58
|
+
functionName: string;
|
|
59
|
+
importSource: string;
|
|
60
|
+
}>;
|
|
61
|
+
instances?: Array<{
|
|
62
|
+
id: string;
|
|
63
|
+
type: string;
|
|
64
|
+
parentScope?: string;
|
|
65
|
+
label?: string;
|
|
66
|
+
portConfigs?: TPortConfig[];
|
|
67
|
+
pullExecution?: {
|
|
68
|
+
triggerPort: string;
|
|
69
|
+
};
|
|
70
|
+
minimized?: boolean;
|
|
71
|
+
color?: string;
|
|
72
|
+
icon?: string;
|
|
73
|
+
tags?: TNodeTagAST[];
|
|
74
|
+
width?: number;
|
|
75
|
+
height?: number;
|
|
76
|
+
sourceLocation?: {
|
|
77
|
+
line: number;
|
|
78
|
+
column: number;
|
|
79
|
+
};
|
|
80
|
+
}>;
|
|
81
|
+
connections?: Array<{
|
|
82
|
+
from: {
|
|
83
|
+
node: string;
|
|
84
|
+
port: string;
|
|
85
|
+
scope?: string;
|
|
86
|
+
};
|
|
87
|
+
to: {
|
|
88
|
+
node: string;
|
|
89
|
+
port: string;
|
|
90
|
+
scope?: string;
|
|
91
|
+
};
|
|
92
|
+
sourceLocation?: {
|
|
93
|
+
line: number;
|
|
94
|
+
column: number;
|
|
95
|
+
};
|
|
96
|
+
}>;
|
|
97
|
+
scopes?: Record<string, string[]>;
|
|
98
|
+
layout?: Record<string, {
|
|
99
|
+
x: number;
|
|
100
|
+
y: number;
|
|
101
|
+
}>;
|
|
102
|
+
startPorts?: Record<string, {
|
|
103
|
+
dataType?: TDataType;
|
|
104
|
+
label?: string;
|
|
105
|
+
metadata?: {
|
|
106
|
+
order?: number;
|
|
107
|
+
};
|
|
108
|
+
}>;
|
|
109
|
+
returnPorts?: Record<string, {
|
|
110
|
+
dataType: TDataType;
|
|
111
|
+
label?: string;
|
|
112
|
+
metadata?: {
|
|
113
|
+
order?: number;
|
|
114
|
+
};
|
|
115
|
+
}>;
|
|
116
|
+
positions?: Record<string, {
|
|
117
|
+
x: number;
|
|
118
|
+
y: number;
|
|
119
|
+
}>;
|
|
120
|
+
/** When true, auto-wire linear connections between nodes in declaration order */
|
|
121
|
+
autoConnect?: boolean;
|
|
122
|
+
/** @map sugar macros that expand to full scope patterns */
|
|
123
|
+
maps?: Array<{
|
|
124
|
+
instanceId: string;
|
|
125
|
+
childId: string;
|
|
126
|
+
sourceNode: string;
|
|
127
|
+
sourcePort: string;
|
|
128
|
+
inputPort?: string;
|
|
129
|
+
outputPort?: string;
|
|
130
|
+
}>;
|
|
131
|
+
/** @path sugar macros that expand to multi-step execution routes with scope walking */
|
|
132
|
+
paths?: Array<{
|
|
133
|
+
steps: Array<{
|
|
134
|
+
node: string;
|
|
135
|
+
route?: 'ok' | 'fail';
|
|
136
|
+
}>;
|
|
137
|
+
}>;
|
|
138
|
+
/** @trigger annotation — event name and/or cron schedule */
|
|
139
|
+
trigger?: {
|
|
140
|
+
event?: string;
|
|
141
|
+
cron?: string;
|
|
142
|
+
};
|
|
143
|
+
/** @cancelOn annotation — cancel on matching external event */
|
|
144
|
+
cancelOn?: {
|
|
145
|
+
event: string;
|
|
146
|
+
match?: string;
|
|
147
|
+
timeout?: string;
|
|
148
|
+
};
|
|
149
|
+
/** @retries annotation — retry count */
|
|
150
|
+
retries?: number;
|
|
151
|
+
/** @timeout annotation — function-level timeout */
|
|
152
|
+
timeout?: string;
|
|
153
|
+
/** @throttle annotation — rate limiting */
|
|
154
|
+
throttle?: {
|
|
155
|
+
limit: number;
|
|
156
|
+
period?: string;
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
export interface JSDocPatternConfig {
|
|
160
|
+
name?: string;
|
|
161
|
+
description?: string;
|
|
162
|
+
instances?: Array<{
|
|
163
|
+
id: string;
|
|
164
|
+
nodeType: string;
|
|
165
|
+
config?: {
|
|
166
|
+
x?: number;
|
|
167
|
+
y?: number;
|
|
168
|
+
};
|
|
169
|
+
}>;
|
|
170
|
+
connections?: Array<{
|
|
171
|
+
from: {
|
|
172
|
+
node: string;
|
|
173
|
+
port: string;
|
|
174
|
+
};
|
|
175
|
+
to: {
|
|
176
|
+
node: string;
|
|
177
|
+
port: string;
|
|
178
|
+
};
|
|
179
|
+
}>;
|
|
180
|
+
ports?: Array<{
|
|
181
|
+
direction: 'IN' | 'OUT';
|
|
182
|
+
name: string;
|
|
183
|
+
description?: string;
|
|
184
|
+
}>;
|
|
185
|
+
positions?: Record<string, {
|
|
186
|
+
x: number;
|
|
187
|
+
y: number;
|
|
188
|
+
}>;
|
|
189
|
+
}
|
|
190
|
+
export declare class JSDocParser {
|
|
191
|
+
/**
|
|
192
|
+
* Parse @flowWeaver nodeType from JSDoc comments
|
|
193
|
+
*/
|
|
194
|
+
parseNodeType(func: FunctionLike, warnings: string[]): JSDocNodeTypeConfig | null;
|
|
195
|
+
/**
|
|
196
|
+
* Parse @flowWeaver workflow from JSDoc comments
|
|
197
|
+
*/
|
|
198
|
+
parseWorkflow(func: FunctionLike, warnings: string[]): JSDocWorkflowConfig | null;
|
|
199
|
+
/**
|
|
200
|
+
* Parse @flowWeaver pattern from JSDoc comments
|
|
201
|
+
*/
|
|
202
|
+
parsePattern(func: FunctionLike, warnings: string[]): JSDocPatternConfig | null;
|
|
203
|
+
/**
|
|
204
|
+
* Parse @node tag for patterns.
|
|
205
|
+
* Format: @node instanceId nodeType
|
|
206
|
+
*/
|
|
207
|
+
private parsePatternNodeTag;
|
|
208
|
+
/**
|
|
209
|
+
* Parse @position tag for patterns.
|
|
210
|
+
* Format: @position nodeId x y
|
|
211
|
+
*/
|
|
212
|
+
private parsePatternPositionTag;
|
|
213
|
+
/**
|
|
214
|
+
* Parse @connect tag for patterns.
|
|
215
|
+
* Supports IN/OUT pseudo-nodes: IN.port -> node.port, node.port -> OUT.port
|
|
216
|
+
*/
|
|
217
|
+
private parsePatternConnectTag;
|
|
218
|
+
/**
|
|
219
|
+
* Parse @port tag for patterns.
|
|
220
|
+
* Format: @port IN.name - description OR @port OUT.name - description
|
|
221
|
+
*/
|
|
222
|
+
private parsePatternPortTag;
|
|
223
|
+
/**
|
|
224
|
+
* Parse @input tag using Chevrotain parser.
|
|
225
|
+
* Supports: @input name, @input [name], @input [name=default]
|
|
226
|
+
* With optional: scope:scopeName, [order:N], [placement:TOP/BOTTOM], - description
|
|
227
|
+
*/
|
|
228
|
+
private parseInputTag;
|
|
229
|
+
/**
|
|
230
|
+
* Parse @output tag using Chevrotain parser.
|
|
231
|
+
* Supports: @output name, scope:scopeName, [order:N], - description
|
|
232
|
+
*/
|
|
233
|
+
private parseOutputTag;
|
|
234
|
+
/**
|
|
235
|
+
* Parse @step tag using Chevrotain parser.
|
|
236
|
+
* Used for explicit STEP/control-flow ports that are not reserved.
|
|
237
|
+
*/
|
|
238
|
+
private parseStepTag;
|
|
239
|
+
/**
|
|
240
|
+
* Parse @return/@returns tag for workflow functions using Chevrotain.
|
|
241
|
+
* Format: @returns name [order:N] - Description (type inferred from signature)
|
|
242
|
+
*/
|
|
243
|
+
private parseReturnTag;
|
|
244
|
+
/**
|
|
245
|
+
* Parse @param tag for workflow functions using Chevrotain.
|
|
246
|
+
* Format: @param name [order:N] - Description (type inferred from signature)
|
|
247
|
+
*/
|
|
248
|
+
private parseParamTag;
|
|
249
|
+
/**
|
|
250
|
+
* Parse @fwImport tag for npm package node types.
|
|
251
|
+
* Format: @fwImport nodeName functionName from "packageName"
|
|
252
|
+
* Examples:
|
|
253
|
+
* @fwImport npm/autoprefixer/autoprefixer autoprefixer from "autoprefixer"
|
|
254
|
+
* @fwImport npm/lodash/map map from "lodash"
|
|
255
|
+
* Note: We use @fwImport instead of @import because TypeScript treats @import specially
|
|
256
|
+
* and truncates the first word as a type annotation.
|
|
257
|
+
*/
|
|
258
|
+
private parseImportTag;
|
|
259
|
+
/**
|
|
260
|
+
* Parse @node tag using Chevrotain parser.
|
|
261
|
+
* Supports: @node instanceId nodeType [parentScope] [label: "..."] [portOrder: port=N] [portLabel: port="label"] [expr: port="val"] [minimized] [pullExecution: triggerPort]
|
|
262
|
+
*/
|
|
263
|
+
private parseNodeTag;
|
|
264
|
+
/**
|
|
265
|
+
* Parse @position tag using Chevrotain parser.
|
|
266
|
+
* Supports: @position nodeId x y
|
|
267
|
+
*/
|
|
268
|
+
private parsePositionTag;
|
|
269
|
+
/**
|
|
270
|
+
* Parse @connect tag using Chevrotain parser.
|
|
271
|
+
* Supports: node.port -> node.port and node.port:scope -> node.port:scope
|
|
272
|
+
*/
|
|
273
|
+
private parseConnectTag;
|
|
274
|
+
/**
|
|
275
|
+
* Parse @scope tag using Chevrotain parser.
|
|
276
|
+
* Format: @scope scopeName [child1, child2] or @scope container.scopeName [child1, child2]
|
|
277
|
+
*/
|
|
278
|
+
private parseScopeTag;
|
|
279
|
+
/**
|
|
280
|
+
* Parse @map tag using Chevrotain parser.
|
|
281
|
+
* Format: @map instanceId childNode over source.port
|
|
282
|
+
* Or: @map instanceId childNode(inputPort -> outputPort) over source.port
|
|
283
|
+
*/
|
|
284
|
+
private parseMapTag;
|
|
285
|
+
/**
|
|
286
|
+
* Parse @path tag using Chevrotain parser.
|
|
287
|
+
* Format: @path Start -> validator:ok -> classifier -> urgencyRouter:fail -> escalate -> Exit
|
|
288
|
+
*/
|
|
289
|
+
private parsePathTag;
|
|
290
|
+
/**
|
|
291
|
+
* Parse @trigger tag using Chevrotain parser.
|
|
292
|
+
*/
|
|
293
|
+
private parseTriggerTag;
|
|
294
|
+
/**
|
|
295
|
+
* Parse @cancelOn tag using Chevrotain parser.
|
|
296
|
+
*/
|
|
297
|
+
private parseCancelOnTag;
|
|
298
|
+
/**
|
|
299
|
+
* Parse @throttle tag using Chevrotain parser.
|
|
300
|
+
*/
|
|
301
|
+
private parseThrottleTag;
|
|
302
|
+
/**
|
|
303
|
+
* Parse default value from string
|
|
304
|
+
*/
|
|
305
|
+
private parseDefaultValue;
|
|
306
|
+
}
|
|
307
|
+
export declare const jsdocParser: JSDocParser;
|
|
308
|
+
//# sourceMappingURL=jsdoc-parser.d.ts.map
|