codika 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +68 -0
- package/dist/cli/commands/completion.d.ts +15 -0
- package/dist/cli/commands/completion.d.ts.map +1 -0
- package/dist/cli/commands/completion.js +810 -0
- package/dist/cli/commands/completion.js.map +1 -0
- package/dist/cli/commands/config/clear.d.ts +12 -0
- package/dist/cli/commands/config/clear.d.ts.map +1 -0
- package/dist/cli/commands/config/clear.js +35 -0
- package/dist/cli/commands/config/clear.js.map +1 -0
- package/dist/cli/commands/config/index.d.ts +15 -0
- package/dist/cli/commands/config/index.d.ts.map +1 -0
- package/dist/cli/commands/config/index.js +21 -0
- package/dist/cli/commands/config/index.js.map +1 -0
- package/dist/cli/commands/config/set.d.ts +41 -0
- package/dist/cli/commands/config/set.d.ts.map +1 -0
- package/dist/cli/commands/config/set.js +185 -0
- package/dist/cli/commands/config/set.js.map +1 -0
- package/dist/cli/commands/config/show.d.ts +12 -0
- package/dist/cli/commands/config/show.d.ts.map +1 -0
- package/dist/cli/commands/config/show.js +45 -0
- package/dist/cli/commands/config/show.js.map +1 -0
- package/dist/cli/commands/deploy/documents.d.ts +12 -0
- package/dist/cli/commands/deploy/documents.d.ts.map +1 -0
- package/dist/cli/commands/deploy/documents.js +217 -0
- package/dist/cli/commands/deploy/documents.js.map +1 -0
- package/dist/cli/commands/deploy/index.d.ts +14 -0
- package/dist/cli/commands/deploy/index.d.ts.map +1 -0
- package/dist/cli/commands/deploy/index.js +21 -0
- package/dist/cli/commands/deploy/index.js.map +1 -0
- package/dist/cli/commands/deploy/process-data-ingestion.d.ts +13 -0
- package/dist/cli/commands/deploy/process-data-ingestion.d.ts.map +1 -0
- package/dist/cli/commands/deploy/process-data-ingestion.js +226 -0
- package/dist/cli/commands/deploy/process-data-ingestion.js.map +1 -0
- package/dist/cli/commands/deploy/use-case.d.ts +9 -0
- package/dist/cli/commands/deploy/use-case.d.ts.map +1 -0
- package/dist/cli/commands/deploy/use-case.js +212 -0
- package/dist/cli/commands/deploy/use-case.js.map +1 -0
- package/dist/cli/commands/get/execution.d.ts +9 -0
- package/dist/cli/commands/get/execution.d.ts.map +1 -0
- package/dist/cli/commands/get/execution.js +159 -0
- package/dist/cli/commands/get/execution.js.map +1 -0
- package/dist/cli/commands/get/index.d.ts +13 -0
- package/dist/cli/commands/get/index.d.ts.map +1 -0
- package/dist/cli/commands/get/index.js +20 -0
- package/dist/cli/commands/get/index.js.map +1 -0
- package/dist/cli/commands/get/skills.d.ts +15 -0
- package/dist/cli/commands/get/skills.d.ts.map +1 -0
- package/dist/cli/commands/get/skills.js +135 -0
- package/dist/cli/commands/get/skills.js.map +1 -0
- package/dist/cli/commands/get/use-case.d.ts +9 -0
- package/dist/cli/commands/get/use-case.d.ts.map +1 -0
- package/dist/cli/commands/get/use-case.js +186 -0
- package/dist/cli/commands/get/use-case.js.map +1 -0
- package/dist/cli/commands/init.d.ts +14 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +347 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/integration/delete.d.ts +13 -0
- package/dist/cli/commands/integration/delete.d.ts.map +1 -0
- package/dist/cli/commands/integration/delete.js +140 -0
- package/dist/cli/commands/integration/delete.js.map +1 -0
- package/dist/cli/commands/integration/index.d.ts +13 -0
- package/dist/cli/commands/integration/index.d.ts.map +1 -0
- package/dist/cli/commands/integration/index.js +20 -0
- package/dist/cli/commands/integration/index.js.map +1 -0
- package/dist/cli/commands/integration/list.d.ts +13 -0
- package/dist/cli/commands/integration/list.d.ts.map +1 -0
- package/dist/cli/commands/integration/list.js +129 -0
- package/dist/cli/commands/integration/list.js.map +1 -0
- package/dist/cli/commands/integration/set.d.ts +13 -0
- package/dist/cli/commands/integration/set.d.ts.map +1 -0
- package/dist/cli/commands/integration/set.js +253 -0
- package/dist/cli/commands/integration/set.js.map +1 -0
- package/dist/cli/commands/list/executions.d.ts +12 -0
- package/dist/cli/commands/list/executions.d.ts.map +1 -0
- package/dist/cli/commands/list/executions.js +168 -0
- package/dist/cli/commands/list/executions.js.map +1 -0
- package/dist/cli/commands/list/index.d.ts +11 -0
- package/dist/cli/commands/list/index.d.ts.map +1 -0
- package/dist/cli/commands/list/index.js +14 -0
- package/dist/cli/commands/list/index.js.map +1 -0
- package/dist/cli/commands/logout.d.ts +12 -0
- package/dist/cli/commands/logout.d.ts.map +1 -0
- package/dist/cli/commands/logout.js +58 -0
- package/dist/cli/commands/logout.js.map +1 -0
- package/dist/cli/commands/project/create.d.ts +8 -0
- package/dist/cli/commands/project/create.d.ts.map +1 -0
- package/dist/cli/commands/project/create.js +109 -0
- package/dist/cli/commands/project/create.js.map +1 -0
- package/dist/cli/commands/project/index.d.ts +12 -0
- package/dist/cli/commands/project/index.d.ts.map +1 -0
- package/dist/cli/commands/project/index.js +15 -0
- package/dist/cli/commands/project/index.js.map +1 -0
- package/dist/cli/commands/publish.d.ts +12 -0
- package/dist/cli/commands/publish.d.ts.map +1 -0
- package/dist/cli/commands/publish.js +152 -0
- package/dist/cli/commands/publish.js.map +1 -0
- package/dist/cli/commands/redeploy.d.ts +11 -0
- package/dist/cli/commands/redeploy.d.ts.map +1 -0
- package/dist/cli/commands/redeploy.js +166 -0
- package/dist/cli/commands/redeploy.js.map +1 -0
- package/dist/cli/commands/status.d.ts +63 -0
- package/dist/cli/commands/status.d.ts.map +1 -0
- package/dist/cli/commands/status.js +290 -0
- package/dist/cli/commands/status.js.map +1 -0
- package/dist/cli/commands/trigger.d.ts +8 -0
- package/dist/cli/commands/trigger.d.ts.map +1 -0
- package/dist/cli/commands/trigger.js +247 -0
- package/dist/cli/commands/trigger.js.map +1 -0
- package/dist/cli/commands/use.d.ts +13 -0
- package/dist/cli/commands/use.d.ts.map +1 -0
- package/dist/cli/commands/use.js +92 -0
- package/dist/cli/commands/use.js.map +1 -0
- package/dist/cli/commands/verify/index.d.ts +13 -0
- package/dist/cli/commands/verify/index.d.ts.map +1 -0
- package/dist/cli/commands/verify/index.js +18 -0
- package/dist/cli/commands/verify/index.js.map +1 -0
- package/dist/cli/commands/verify/use-case.d.ts +23 -0
- package/dist/cli/commands/verify/use-case.d.ts.map +1 -0
- package/dist/cli/commands/verify/use-case.js +94 -0
- package/dist/cli/commands/verify/use-case.js.map +1 -0
- package/dist/cli/commands/verify/workflow.d.ts +22 -0
- package/dist/cli/commands/verify/workflow.d.ts.map +1 -0
- package/dist/cli/commands/verify/workflow.js +82 -0
- package/dist/cli/commands/verify/workflow.js.map +1 -0
- package/dist/cli/commands/whoami.d.ts +13 -0
- package/dist/cli/commands/whoami.d.ts.map +1 -0
- package/dist/cli/commands/whoami.js +126 -0
- package/dist/cli/commands/whoami.js.map +1 -0
- package/dist/cli/index.d.ts +24 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +90 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/templates/claude-md-template.d.ts +12 -0
- package/dist/cli/templates/claude-md-template.d.ts.map +1 -0
- package/dist/cli/templates/claude-md-template.js +162 -0
- package/dist/cli/templates/claude-md-template.js.map +1 -0
- package/dist/cli/templates/config-template.d.ts +18 -0
- package/dist/cli/templates/config-template.d.ts.map +1 -0
- package/dist/cli/templates/config-template.js +350 -0
- package/dist/cli/templates/config-template.js.map +1 -0
- package/dist/cli/templates/skill-templates.d.ts +24 -0
- package/dist/cli/templates/skill-templates.d.ts.map +1 -0
- package/dist/cli/templates/skill-templates.js +117 -0
- package/dist/cli/templates/skill-templates.js.map +1 -0
- package/dist/cli/templates/slug.d.ts +9 -0
- package/dist/cli/templates/slug.d.ts.map +1 -0
- package/dist/cli/templates/slug.js +17 -0
- package/dist/cli/templates/slug.js.map +1 -0
- package/dist/cli/templates/workflow-templates.d.ts +693 -0
- package/dist/cli/templates/workflow-templates.d.ts.map +1 -0
- package/dist/cli/templates/workflow-templates.js +516 -0
- package/dist/cli/templates/workflow-templates.js.map +1 -0
- package/dist/cli/utils/output.d.ts +65 -0
- package/dist/cli/utils/output.d.ts.map +1 -0
- package/dist/cli/utils/output.js +188 -0
- package/dist/cli/utils/output.js.map +1 -0
- package/dist/cli/utils/validation-output.d.ts +21 -0
- package/dist/cli/utils/validation-output.d.ts.map +1 -0
- package/dist/cli/utils/validation-output.js +204 -0
- package/dist/cli/utils/validation-output.js.map +1 -0
- package/dist/data/integration-fields.d.ts +27 -0
- package/dist/data/integration-fields.d.ts.map +1 -0
- package/dist/data/integration-fields.js +361 -0
- package/dist/data/integration-fields.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -0
- package/dist/types/process-types.d.ts +740 -0
- package/dist/types/process-types.d.ts.map +1 -0
- package/dist/types/process-types.js +22 -0
- package/dist/types/process-types.js.map +1 -0
- package/dist/utils/config.d.ts +127 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +315 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/data-ingestion-deploy-client.d.ts +53 -0
- package/dist/utils/data-ingestion-deploy-client.d.ts.map +1 -0
- package/dist/utils/data-ingestion-deploy-client.js +63 -0
- package/dist/utils/data-ingestion-deploy-client.js.map +1 -0
- package/dist/utils/data-ingestion-deployer.d.ts +78 -0
- package/dist/utils/data-ingestion-deployer.d.ts.map +1 -0
- package/dist/utils/data-ingestion-deployer.js +119 -0
- package/dist/utils/data-ingestion-deployer.js.map +1 -0
- package/dist/utils/deploy-client.d.ts +55 -0
- package/dist/utils/deploy-client.d.ts.map +1 -0
- package/dist/utils/deploy-client.js +73 -0
- package/dist/utils/deploy-client.js.map +1 -0
- package/dist/utils/deployment-archiver.d.ts +110 -0
- package/dist/utils/deployment-archiver.d.ts.map +1 -0
- package/dist/utils/deployment-archiver.js +158 -0
- package/dist/utils/deployment-archiver.js.map +1 -0
- package/dist/utils/document-deploy-client.d.ts +41 -0
- package/dist/utils/document-deploy-client.d.ts.map +1 -0
- package/dist/utils/document-deploy-client.js +46 -0
- package/dist/utils/document-deploy-client.js.map +1 -0
- package/dist/utils/encryption.d.ts +85 -0
- package/dist/utils/encryption.d.ts.map +1 -0
- package/dist/utils/encryption.js +162 -0
- package/dist/utils/encryption.js.map +1 -0
- package/dist/utils/execution-client.d.ts +71 -0
- package/dist/utils/execution-client.d.ts.map +1 -0
- package/dist/utils/execution-client.js +56 -0
- package/dist/utils/execution-client.js.map +1 -0
- package/dist/utils/integration-client.d.ts +134 -0
- package/dist/utils/integration-client.d.ts.map +1 -0
- package/dist/utils/integration-client.js +109 -0
- package/dist/utils/integration-client.js.map +1 -0
- package/dist/utils/list-executions-client.d.ts +47 -0
- package/dist/utils/list-executions-client.d.ts.map +1 -0
- package/dist/utils/list-executions-client.js +50 -0
- package/dist/utils/list-executions-client.js.map +1 -0
- package/dist/utils/metadata-client.d.ts +90 -0
- package/dist/utils/metadata-client.d.ts.map +1 -0
- package/dist/utils/metadata-client.js +66 -0
- package/dist/utils/metadata-client.js.map +1 -0
- package/dist/utils/project-client.d.ts +70 -0
- package/dist/utils/project-client.d.ts.map +1 -0
- package/dist/utils/project-client.js +63 -0
- package/dist/utils/project-client.js.map +1 -0
- package/dist/utils/project-json.d.ts +71 -0
- package/dist/utils/project-json.d.ts.map +1 -0
- package/dist/utils/project-json.js +129 -0
- package/dist/utils/project-json.js.map +1 -0
- package/dist/utils/publish-client.d.ts +53 -0
- package/dist/utils/publish-client.d.ts.map +1 -0
- package/dist/utils/publish-client.js +64 -0
- package/dist/utils/publish-client.js.map +1 -0
- package/dist/utils/redeploy-client.d.ts +39 -0
- package/dist/utils/redeploy-client.d.ts.map +1 -0
- package/dist/utils/redeploy-client.js +51 -0
- package/dist/utils/redeploy-client.js.map +1 -0
- package/dist/utils/skill-parser.d.ts +52 -0
- package/dist/utils/skill-parser.d.ts.map +1 -0
- package/dist/utils/skill-parser.js +127 -0
- package/dist/utils/skill-parser.js.map +1 -0
- package/dist/utils/skills-client.d.ts +39 -0
- package/dist/utils/skills-client.d.ts.map +1 -0
- package/dist/utils/skills-client.js +32 -0
- package/dist/utils/skills-client.js.map +1 -0
- package/dist/utils/trigger-client.d.ts +78 -0
- package/dist/utils/trigger-client.d.ts.map +1 -0
- package/dist/utils/trigger-client.js +81 -0
- package/dist/utils/trigger-client.js.map +1 -0
- package/dist/utils/use-case-deployer.d.ts +93 -0
- package/dist/utils/use-case-deployer.d.ts.map +1 -0
- package/dist/utils/use-case-deployer.js +270 -0
- package/dist/utils/use-case-deployer.js.map +1 -0
- package/dist/utils/version-manager.d.ts +63 -0
- package/dist/utils/version-manager.d.ts.map +1 -0
- package/dist/utils/version-manager.js +91 -0
- package/dist/utils/version-manager.js.map +1 -0
- package/dist/utils/workflow-encoding.d.ts +26 -0
- package/dist/utils/workflow-encoding.d.ts.map +1 -0
- package/dist/utils/workflow-encoding.js +41 -0
- package/dist/utils/workflow-encoding.js.map +1 -0
- package/dist/validation/fixer.d.ts +56 -0
- package/dist/validation/fixer.d.ts.map +1 -0
- package/dist/validation/fixer.js +168 -0
- package/dist/validation/fixer.js.map +1 -0
- package/dist/validation/rules/codika-init-required.d.ts +18 -0
- package/dist/validation/rules/codika-init-required.d.ts.map +1 -0
- package/dist/validation/rules/codika-init-required.js +70 -0
- package/dist/validation/rules/codika-init-required.js.map +1 -0
- package/dist/validation/rules/codika-submit-result.d.ts +22 -0
- package/dist/validation/rules/codika-submit-result.d.ts.map +1 -0
- package/dist/validation/rules/codika-submit-result.js +144 -0
- package/dist/validation/rules/codika-submit-result.js.map +1 -0
- package/dist/validation/rules/error-branch-required.d.ts +24 -0
- package/dist/validation/rules/error-branch-required.d.ts.map +1 -0
- package/dist/validation/rules/error-branch-required.js +103 -0
- package/dist/validation/rules/error-branch-required.js.map +1 -0
- package/dist/validation/rules/index.d.ts +18 -0
- package/dist/validation/rules/index.d.ts.map +1 -0
- package/dist/validation/rules/index.js +28 -0
- package/dist/validation/rules/index.js.map +1 -0
- package/dist/validation/rules/schedule-webhook-convergence.d.ts +24 -0
- package/dist/validation/rules/schedule-webhook-convergence.d.ts.map +1 -0
- package/dist/validation/rules/schedule-webhook-convergence.js +129 -0
- package/dist/validation/rules/schedule-webhook-convergence.js.map +1 -0
- package/dist/validation/rules/subworkflow-min-params.d.ts +21 -0
- package/dist/validation/rules/subworkflow-min-params.d.ts.map +1 -0
- package/dist/validation/rules/subworkflow-min-params.js +84 -0
- package/dist/validation/rules/subworkflow-min-params.js.map +1 -0
- package/dist/validation/runner.d.ts +43 -0
- package/dist/validation/runner.d.ts.map +1 -0
- package/dist/validation/runner.js +335 -0
- package/dist/validation/runner.js.map +1 -0
- package/dist/validation/types.d.ts +155 -0
- package/dist/validation/types.d.ts.map +1 -0
- package/dist/validation/types.js +8 -0
- package/dist/validation/types.js.map +1 -0
- package/dist/validation/use-case-scripts/calledby-consistency.d.ts +23 -0
- package/dist/validation/use-case-scripts/calledby-consistency.d.ts.map +1 -0
- package/dist/validation/use-case-scripts/calledby-consistency.js +236 -0
- package/dist/validation/use-case-scripts/calledby-consistency.js.map +1 -0
- package/dist/validation/use-case-scripts/config-exports.d.ts +17 -0
- package/dist/validation/use-case-scripts/config-exports.d.ts.map +1 -0
- package/dist/validation/use-case-scripts/config-exports.js +93 -0
- package/dist/validation/use-case-scripts/config-exports.js.map +1 -0
- package/dist/validation/use-case-scripts/custom-integration-schema.d.ts +21 -0
- package/dist/validation/use-case-scripts/custom-integration-schema.d.ts.map +1 -0
- package/dist/validation/use-case-scripts/custom-integration-schema.js +378 -0
- package/dist/validation/use-case-scripts/custom-integration-schema.js.map +1 -0
- package/dist/validation/use-case-scripts/index.d.ts +27 -0
- package/dist/validation/use-case-scripts/index.d.ts.map +1 -0
- package/dist/validation/use-case-scripts/index.js +52 -0
- package/dist/validation/use-case-scripts/index.js.map +1 -0
- package/dist/validation/use-case-scripts/integration-inheritance.d.ts +35 -0
- package/dist/validation/use-case-scripts/integration-inheritance.d.ts.map +1 -0
- package/dist/validation/use-case-scripts/integration-inheritance.js +348 -0
- package/dist/validation/use-case-scripts/integration-inheritance.js.map +1 -0
- package/dist/validation/use-case-scripts/schema-types.d.ts +21 -0
- package/dist/validation/use-case-scripts/schema-types.d.ts.map +1 -0
- package/dist/validation/use-case-scripts/schema-types.js +134 -0
- package/dist/validation/use-case-scripts/schema-types.js.map +1 -0
- package/dist/validation/use-case-scripts/skill-consistency.d.ts +21 -0
- package/dist/validation/use-case-scripts/skill-consistency.d.ts.map +1 -0
- package/dist/validation/use-case-scripts/skill-consistency.js +180 -0
- package/dist/validation/use-case-scripts/skill-consistency.js.map +1 -0
- package/dist/validation/use-case-scripts/subworkflow-references.d.ts +22 -0
- package/dist/validation/use-case-scripts/subworkflow-references.d.ts.map +1 -0
- package/dist/validation/use-case-scripts/subworkflow-references.js +139 -0
- package/dist/validation/use-case-scripts/subworkflow-references.js.map +1 -0
- package/dist/validation/use-case-scripts/trigger-type-consistency.d.ts +25 -0
- package/dist/validation/use-case-scripts/trigger-type-consistency.d.ts.map +1 -0
- package/dist/validation/use-case-scripts/trigger-type-consistency.js +265 -0
- package/dist/validation/use-case-scripts/trigger-type-consistency.js.map +1 -0
- package/dist/validation/use-case-scripts/trigger-types.d.ts +20 -0
- package/dist/validation/use-case-scripts/trigger-types.d.ts.map +1 -0
- package/dist/validation/use-case-scripts/trigger-types.js +177 -0
- package/dist/validation/use-case-scripts/trigger-types.js.map +1 -0
- package/dist/validation/use-case-scripts/triggers-required.d.ts +23 -0
- package/dist/validation/use-case-scripts/triggers-required.d.ts.map +1 -0
- package/dist/validation/use-case-scripts/triggers-required.js +111 -0
- package/dist/validation/use-case-scripts/triggers-required.js.map +1 -0
- package/dist/validation/use-case-scripts/webhook-path-consistency.d.ts +28 -0
- package/dist/validation/use-case-scripts/webhook-path-consistency.d.ts.map +1 -0
- package/dist/validation/use-case-scripts/webhook-path-consistency.js +288 -0
- package/dist/validation/use-case-scripts/webhook-path-consistency.js.map +1 -0
- package/dist/validation/use-case-scripts/workflow-imports.d.ts +16 -0
- package/dist/validation/use-case-scripts/workflow-imports.d.ts.map +1 -0
- package/dist/validation/use-case-scripts/workflow-imports.js +206 -0
- package/dist/validation/use-case-scripts/workflow-imports.js.map +1 -0
- package/dist/validation/workflow-scripts/credential-placeholders.d.ts +21 -0
- package/dist/validation/workflow-scripts/credential-placeholders.d.ts.map +1 -0
- package/dist/validation/workflow-scripts/credential-placeholders.js +278 -0
- package/dist/validation/workflow-scripts/credential-placeholders.js.map +1 -0
- package/dist/validation/workflow-scripts/db-always-output.d.ts +16 -0
- package/dist/validation/workflow-scripts/db-always-output.d.ts.map +1 -0
- package/dist/validation/workflow-scripts/db-always-output.js +95 -0
- package/dist/validation/workflow-scripts/db-always-output.js.map +1 -0
- package/dist/validation/workflow-scripts/exec-workflow-wait.d.ts +15 -0
- package/dist/validation/workflow-scripts/exec-workflow-wait.d.ts.map +1 -0
- package/dist/validation/workflow-scripts/exec-workflow-wait.js +85 -0
- package/dist/validation/workflow-scripts/exec-workflow-wait.js.map +1 -0
- package/dist/validation/workflow-scripts/index.d.ts +31 -0
- package/dist/validation/workflow-scripts/index.d.ts.map +1 -0
- package/dist/validation/workflow-scripts/index.js +58 -0
- package/dist/validation/workflow-scripts/index.js.map +1 -0
- package/dist/validation/workflow-scripts/instparm-quoting.d.ts +21 -0
- package/dist/validation/workflow-scripts/instparm-quoting.d.ts.map +1 -0
- package/dist/validation/workflow-scripts/instparm-quoting.js +59 -0
- package/dist/validation/workflow-scripts/instparm-quoting.js.map +1 -0
- package/dist/validation/workflow-scripts/llm-model-id.d.ts +17 -0
- package/dist/validation/workflow-scripts/llm-model-id.d.ts.map +1 -0
- package/dist/validation/workflow-scripts/llm-model-id.js +171 -0
- package/dist/validation/workflow-scripts/llm-model-id.js.map +1 -0
- package/dist/validation/workflow-scripts/llm-output-access.d.ts +23 -0
- package/dist/validation/workflow-scripts/llm-output-access.d.ts.map +1 -0
- package/dist/validation/workflow-scripts/llm-output-access.js +274 -0
- package/dist/validation/workflow-scripts/llm-output-access.js.map +1 -0
- package/dist/validation/workflow-scripts/merge-before-terminal.d.ts +20 -0
- package/dist/validation/workflow-scripts/merge-before-terminal.d.ts.map +1 -0
- package/dist/validation/workflow-scripts/merge-before-terminal.js +87 -0
- package/dist/validation/workflow-scripts/merge-before-terminal.js.map +1 -0
- package/dist/validation/workflow-scripts/placeholder-syntax.d.ts +29 -0
- package/dist/validation/workflow-scripts/placeholder-syntax.d.ts.map +1 -0
- package/dist/validation/workflow-scripts/placeholder-syntax.js +154 -0
- package/dist/validation/workflow-scripts/placeholder-syntax.js.map +1 -0
- package/dist/validation/workflow-scripts/retry-backoff.d.ts +16 -0
- package/dist/validation/workflow-scripts/retry-backoff.d.ts.map +1 -0
- package/dist/validation/workflow-scripts/retry-backoff.js +197 -0
- package/dist/validation/workflow-scripts/retry-backoff.js.map +1 -0
- package/dist/validation/workflow-scripts/webhook-id.d.ts +17 -0
- package/dist/validation/workflow-scripts/webhook-id.d.ts.map +1 -0
- package/dist/validation/workflow-scripts/webhook-id.js +79 -0
- package/dist/validation/workflow-scripts/webhook-id.js.map +1 -0
- package/dist/validation/workflow-scripts/workflow-format.d.ts +16 -0
- package/dist/validation/workflow-scripts/workflow-format.d.ts.map +1 -0
- package/dist/validation/workflow-scripts/workflow-format.js +51 -0
- package/dist/validation/workflow-scripts/workflow-format.js.map +1 -0
- package/dist/validation/workflow-scripts/workflow-sanitization.d.ts +21 -0
- package/dist/validation/workflow-scripts/workflow-sanitization.d.ts.map +1 -0
- package/dist/validation/workflow-scripts/workflow-sanitization.js +78 -0
- package/dist/validation/workflow-scripts/workflow-sanitization.js.map +1 -0
- package/dist/validation/workflow-scripts/workflow-settings.d.ts +19 -0
- package/dist/validation/workflow-scripts/workflow-settings.d.ts.map +1 -0
- package/dist/validation/workflow-scripts/workflow-settings.js +131 -0
- package/dist/validation/workflow-scripts/workflow-settings.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Script: INSTPARM-QUOTE
|
|
3
|
+
*
|
|
4
|
+
* Checks that INSTPARM placeholders are not incorrectly quoted.
|
|
5
|
+
*
|
|
6
|
+
* CORRECT: const x = {{INSTPARM_NAME_MRAPTSNI}};
|
|
7
|
+
* INCORRECT: const x = '{{INSTPARM_NAME_MRAPTSNI}}';
|
|
8
|
+
*
|
|
9
|
+
* When INSTPARM placeholders are quoted, they become string literals
|
|
10
|
+
* instead of being replaced with the actual value at runtime.
|
|
11
|
+
*
|
|
12
|
+
* This script provides auto-fix capability to remove the quotes.
|
|
13
|
+
*/
|
|
14
|
+
export const metadata = {
|
|
15
|
+
id: 'INSTPARM-QUOTE',
|
|
16
|
+
name: 'instparm_quoting',
|
|
17
|
+
severity: 'must',
|
|
18
|
+
description: 'INSTPARM placeholders should not be wrapped in quotes',
|
|
19
|
+
details: 'Remove quotes around INSTPARM placeholders so they are properly replaced at runtime',
|
|
20
|
+
fixable: true,
|
|
21
|
+
category: 'placeholder',
|
|
22
|
+
};
|
|
23
|
+
// Regex to find quoted INSTPARM placeholders
|
|
24
|
+
// Matches: '{{INSTPARM_..._MRAPTSNI}}' or "{{INSTPARM_..._MRAPTSNI}}"
|
|
25
|
+
const QUOTED_INSTPARM_REGEX = /(['"])(\{\{INSTPARM_[A-Z0-9_]+_MRAPTSNI\}\})\1/g;
|
|
26
|
+
/**
|
|
27
|
+
* Check for incorrectly quoted INSTPARM placeholders
|
|
28
|
+
*/
|
|
29
|
+
export function checkInstparmQuoting(content, path) {
|
|
30
|
+
const findings = [];
|
|
31
|
+
// Reset regex state
|
|
32
|
+
QUOTED_INSTPARM_REGEX.lastIndex = 0;
|
|
33
|
+
let match;
|
|
34
|
+
while ((match = QUOTED_INSTPARM_REGEX.exec(content)) !== null) {
|
|
35
|
+
const quote = match[1];
|
|
36
|
+
const placeholder = match[2];
|
|
37
|
+
const fullMatch = match[0];
|
|
38
|
+
// Calculate line number
|
|
39
|
+
const lineNumber = content.substring(0, match.index).split('\n').length;
|
|
40
|
+
findings.push({
|
|
41
|
+
rule: metadata.id,
|
|
42
|
+
severity: metadata.severity,
|
|
43
|
+
path,
|
|
44
|
+
message: `INSTPARM placeholder should not be quoted: ${fullMatch}`,
|
|
45
|
+
raw_details: `Remove the ${quote} quotes around ${placeholder}. Quoted placeholders become string literals instead of being replaced with values.`,
|
|
46
|
+
line: lineNumber,
|
|
47
|
+
fixable: true,
|
|
48
|
+
fix: {
|
|
49
|
+
description: `Remove quotes around ${placeholder}`,
|
|
50
|
+
apply: (fileContent) => {
|
|
51
|
+
// Replace this specific quoted placeholder with unquoted version
|
|
52
|
+
return fileContent.replace(fullMatch, placeholder);
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return findings;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=instparm-quoting.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instparm-quoting.js","sourceRoot":"","sources":["../../../src/validation/workflow-scripts/instparm-quoting.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAKH,MAAM,CAAC,MAAM,QAAQ,GAAiB;IACpC,EAAE,EAAE,gBAAgB;IACpB,IAAI,EAAE,kBAAkB;IACxB,QAAQ,EAAE,MAAM;IAChB,WAAW,EAAE,uDAAuD;IACpE,OAAO,EAAE,qFAAqF;IAC9F,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,aAAa;CACxB,CAAC;AAEF,6CAA6C;AAC7C,sEAAsE;AACtE,MAAM,qBAAqB,GAAG,iDAAiD,CAAC;AAEhF;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe,EAAE,IAAY;IAChE,MAAM,QAAQ,GAAc,EAAE,CAAC;IAE/B,oBAAoB;IACpB,qBAAqB,CAAC,SAAS,GAAG,CAAC,CAAC;IAEpC,IAAI,KAAK,CAAC;IACV,OAAO,CAAC,KAAK,GAAG,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAC9D,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACvB,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAC7B,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QAE3B,wBAAwB;QACxB,MAAM,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;QAExE,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,QAAQ,CAAC,EAAE;YACjB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,IAAI;YACJ,OAAO,EAAE,8CAA8C,SAAS,EAAE;YAClE,WAAW,EAAE,cAAc,KAAK,kBAAkB,WAAW,qFAAqF;YAClJ,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,IAAI;YACb,GAAG,EAAE;gBACH,WAAW,EAAE,wBAAwB,WAAW,EAAE;gBAClD,KAAK,EAAE,CAAC,WAAmB,EAAE,EAAE;oBAC7B,iEAAiE;oBACjE,OAAO,WAAW,CAAC,OAAO,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;gBACrD,CAAC;aACF;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Script: LLM-MODEL-ID
|
|
3
|
+
*
|
|
4
|
+
* Checks that LLM model nodes use current, valid model IDs.
|
|
5
|
+
* Uses an allowlist of known-good models per provider node type.
|
|
6
|
+
* Any model not in the allowlist is flagged as a MUST violation with auto-fix.
|
|
7
|
+
*
|
|
8
|
+
* ## Updating the Allowlist
|
|
9
|
+
*
|
|
10
|
+
* When a provider releases new models or retires old ones, update the
|
|
11
|
+
* ALLOWED_MODELS map below. Each entry maps an n8n node type to the list
|
|
12
|
+
* of currently valid model IDs and a default for auto-fix.
|
|
13
|
+
*/
|
|
14
|
+
import type { Finding, RuleMetadata } from '../types.js';
|
|
15
|
+
export declare const metadata: RuleMetadata;
|
|
16
|
+
export declare function checkLlmModelId(content: string, path: string): Finding[];
|
|
17
|
+
//# sourceMappingURL=llm-model-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm-model-id.d.ts","sourceRoot":"","sources":["../../../src/validation/workflow-scripts/llm-model-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,QAAQ,EAAE,YAUtB,CAAC;AAgIF,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,CAmExE"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Script: LLM-MODEL-ID
|
|
3
|
+
*
|
|
4
|
+
* Checks that LLM model nodes use current, valid model IDs.
|
|
5
|
+
* Uses an allowlist of known-good models per provider node type.
|
|
6
|
+
* Any model not in the allowlist is flagged as a MUST violation with auto-fix.
|
|
7
|
+
*
|
|
8
|
+
* ## Updating the Allowlist
|
|
9
|
+
*
|
|
10
|
+
* When a provider releases new models or retires old ones, update the
|
|
11
|
+
* ALLOWED_MODELS map below. Each entry maps an n8n node type to the list
|
|
12
|
+
* of currently valid model IDs and a default for auto-fix.
|
|
13
|
+
*/
|
|
14
|
+
export const metadata = {
|
|
15
|
+
id: 'LLM-MODEL-ID',
|
|
16
|
+
name: 'llm_model_id',
|
|
17
|
+
severity: 'must',
|
|
18
|
+
description: 'LLM model nodes must use current, non-deprecated model IDs',
|
|
19
|
+
details: 'Retired or unknown model IDs will fail at runtime with "resource not found" errors. ' +
|
|
20
|
+
'Only use model IDs from the provider allowlist. Run with --fix to auto-replace.',
|
|
21
|
+
fixable: true,
|
|
22
|
+
category: 'ai-nodes',
|
|
23
|
+
};
|
|
24
|
+
const ALLOWED_MODELS = {
|
|
25
|
+
'@n8n/n8n-nodes-langchain.lmChatAnthropic': {
|
|
26
|
+
providerName: 'Anthropic',
|
|
27
|
+
allowed: [
|
|
28
|
+
'claude-sonnet-4-20250514',
|
|
29
|
+
'claude-opus-4-20250514',
|
|
30
|
+
'claude-haiku-4-5-20251001',
|
|
31
|
+
// Short aliases (resolve to the same models)
|
|
32
|
+
'claude-sonnet-4-6',
|
|
33
|
+
'claude-opus-4-6',
|
|
34
|
+
'claude-haiku-4-5',
|
|
35
|
+
],
|
|
36
|
+
default: 'claude-sonnet-4-20250514',
|
|
37
|
+
tierMap: {
|
|
38
|
+
opus: 'claude-opus-4-20250514',
|
|
39
|
+
haiku: 'claude-haiku-4-5-20251001',
|
|
40
|
+
sonnet: 'claude-sonnet-4-20250514',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
// Add more providers as needed:
|
|
44
|
+
// '@n8n/n8n-nodes-langchain.lmChatOpenAi': {
|
|
45
|
+
// providerName: 'OpenAI',
|
|
46
|
+
// allowed: ['gpt-4o', 'gpt-4o-mini', ...],
|
|
47
|
+
// default: 'gpt-4o',
|
|
48
|
+
// tierMap: { mini: 'gpt-4o-mini' },
|
|
49
|
+
// },
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Extract the model ID string from a node's parameters.
|
|
53
|
+
* Handles both the __rl resource-list pattern and plain string values.
|
|
54
|
+
*/
|
|
55
|
+
function extractModelId(node) {
|
|
56
|
+
const model = node.parameters?.model;
|
|
57
|
+
if (!model)
|
|
58
|
+
return null;
|
|
59
|
+
if (typeof model === 'string')
|
|
60
|
+
return model;
|
|
61
|
+
if (typeof model === 'object') {
|
|
62
|
+
const m = model;
|
|
63
|
+
if (typeof m.value === 'string')
|
|
64
|
+
return m.value;
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Pick the best replacement model based on the deprecated model's name.
|
|
70
|
+
* Falls back to the provider default if no tier keyword matches.
|
|
71
|
+
*/
|
|
72
|
+
function pickReplacement(deprecatedModelId, provider) {
|
|
73
|
+
const lower = deprecatedModelId.toLowerCase();
|
|
74
|
+
for (const [keyword, replacement] of Object.entries(provider.tierMap)) {
|
|
75
|
+
if (lower.includes(keyword)) {
|
|
76
|
+
return replacement;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return provider.default;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Get a human-readable name for a model ID (e.g. "Claude Sonnet 4").
|
|
83
|
+
*/
|
|
84
|
+
function getDisplayName(modelId, provider) {
|
|
85
|
+
for (const [keyword, id] of Object.entries(provider.tierMap)) {
|
|
86
|
+
if (id === modelId) {
|
|
87
|
+
return `${provider.providerName} ${keyword.charAt(0).toUpperCase() + keyword.slice(1)}`;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return modelId;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Get approximate line number for a node in the workflow JSON.
|
|
94
|
+
*/
|
|
95
|
+
function getLineNumberForNode(content, nodeId) {
|
|
96
|
+
const lines = content.split('\n');
|
|
97
|
+
for (let i = 0; i < lines.length; i++) {
|
|
98
|
+
if (lines[i].includes(`"id": "${nodeId}"`)) {
|
|
99
|
+
return i + 1;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return 1;
|
|
103
|
+
}
|
|
104
|
+
// ---------------------------------------------------------------------------
|
|
105
|
+
// Main validation function
|
|
106
|
+
// ---------------------------------------------------------------------------
|
|
107
|
+
export function checkLlmModelId(content, path) {
|
|
108
|
+
const findings = [];
|
|
109
|
+
let workflow;
|
|
110
|
+
try {
|
|
111
|
+
workflow = JSON.parse(content);
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
return findings;
|
|
115
|
+
}
|
|
116
|
+
if (!workflow.nodes || !Array.isArray(workflow.nodes)) {
|
|
117
|
+
return findings;
|
|
118
|
+
}
|
|
119
|
+
for (const node of workflow.nodes) {
|
|
120
|
+
const provider = ALLOWED_MODELS[node.type];
|
|
121
|
+
if (!provider)
|
|
122
|
+
continue;
|
|
123
|
+
const modelId = extractModelId(node);
|
|
124
|
+
if (!modelId)
|
|
125
|
+
continue;
|
|
126
|
+
if (provider.allowed.includes(modelId))
|
|
127
|
+
continue;
|
|
128
|
+
// Model is not in the allowlist — flag it
|
|
129
|
+
const replacement = pickReplacement(modelId, provider);
|
|
130
|
+
const displayName = getDisplayName(replacement, provider);
|
|
131
|
+
const lineNumber = getLineNumberForNode(content, node.id);
|
|
132
|
+
findings.push({
|
|
133
|
+
rule: metadata.id,
|
|
134
|
+
severity: metadata.severity,
|
|
135
|
+
path,
|
|
136
|
+
message: `Node "${node.name}" uses unknown or deprecated ${provider.providerName} model "${modelId}". Use "${replacement}" (${displayName}).`,
|
|
137
|
+
raw_details: `The model "${modelId}" is not in the current ${provider.providerName} allowlist and may be ` +
|
|
138
|
+
`retired. Replace with "${replacement}".\n\n` +
|
|
139
|
+
`Current allowed models: ${provider.allowed.join(', ')}`,
|
|
140
|
+
nodeId: node.id,
|
|
141
|
+
line: lineNumber,
|
|
142
|
+
guideRef: {
|
|
143
|
+
path: 'integrations/anthropic.md',
|
|
144
|
+
section: 'Available Models',
|
|
145
|
+
},
|
|
146
|
+
fixable: true,
|
|
147
|
+
fix: {
|
|
148
|
+
description: `Replace "${modelId}" with "${replacement}"`,
|
|
149
|
+
apply: (fileContent) => {
|
|
150
|
+
const parsed = JSON.parse(fileContent);
|
|
151
|
+
const targetNode = parsed.nodes.find((n) => n.id === node.id);
|
|
152
|
+
if (targetNode?.parameters?.model) {
|
|
153
|
+
const m = targetNode.parameters.model;
|
|
154
|
+
if (typeof m === 'string') {
|
|
155
|
+
targetNode.parameters.model = replacement;
|
|
156
|
+
}
|
|
157
|
+
else if (typeof m === 'object' && m.value) {
|
|
158
|
+
m.value = replacement;
|
|
159
|
+
if (m.cachedResultName) {
|
|
160
|
+
m.cachedResultName = displayName;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return JSON.stringify(parsed, null, 2);
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
return findings;
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=llm-model-id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm-model-id.js","sourceRoot":"","sources":["../../../src/validation/workflow-scripts/llm-model-id.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,MAAM,CAAC,MAAM,QAAQ,GAAiB;IACpC,EAAE,EAAE,cAAc;IAClB,IAAI,EAAE,cAAc;IACpB,QAAQ,EAAE,MAAM;IAChB,WAAW,EAAE,4DAA4D;IACzE,OAAO,EACL,sFAAsF;QACtF,iFAAiF;IACnF,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,UAAU;CACrB,CAAC;AAqBF,MAAM,cAAc,GAAmC;IACrD,0CAA0C,EAAE;QAC1C,YAAY,EAAE,WAAW;QACzB,OAAO,EAAE;YACP,0BAA0B;YAC1B,wBAAwB;YACxB,2BAA2B;YAC3B,6CAA6C;YAC7C,mBAAmB;YACnB,iBAAiB;YACjB,kBAAkB;SACnB;QACD,OAAO,EAAE,0BAA0B;QACnC,OAAO,EAAE;YACP,IAAI,EAAE,wBAAwB;YAC9B,KAAK,EAAE,2BAA2B;YAClC,MAAM,EAAE,0BAA0B;SACnC;KACF;IACD,gCAAgC;IAChC,6CAA6C;IAC7C,4BAA4B;IAC5B,6CAA6C;IAC7C,uBAAuB;IACvB,sCAAsC;IACtC,KAAK;CACN,CAAC;AAoBF;;;GAGG;AACH,SAAS,cAAc,CAAC,IAAkB;IACxC,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC;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AAC;6BAAM,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;4BAC5C,CAAC,CAAC,KAAK,GAAG,WAAW,CAAC;4BACtB,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;gCACvB,CAAC,CAAC,gBAAgB,GAAG,WAAW,CAAC;4BACnC,CAAC;wBACH,CAAC;oBACH,CAAC;oBACD,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;gBACzC,CAAC;aACF;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Script: LLM-OUTPUT-ACCESS
|
|
3
|
+
*
|
|
4
|
+
* Checks that LLM chain outputs are correctly accessed via the .output property
|
|
5
|
+
* when using a Structured Output Parser.
|
|
6
|
+
*
|
|
7
|
+
* CORRECT: $json.output.fieldName
|
|
8
|
+
* CORRECT: $('LLM Node').first().json.output.fieldName
|
|
9
|
+
* INCORRECT: $json.fieldName (missing .output)
|
|
10
|
+
* INCORRECT: $('LLM Node').first().json.fieldName (missing .output)
|
|
11
|
+
*
|
|
12
|
+
* When chainLlm is used with outputParserStructured, the result is wrapped in
|
|
13
|
+
* an `output` property. Accessing fields directly without .output will fail.
|
|
14
|
+
*
|
|
15
|
+
* This script provides auto-fix capability to add the .output prefix.
|
|
16
|
+
*/
|
|
17
|
+
import type { Finding, RuleMetadata } from '../types.js';
|
|
18
|
+
export declare const metadata: RuleMetadata;
|
|
19
|
+
/**
|
|
20
|
+
* Main validation function
|
|
21
|
+
*/
|
|
22
|
+
export declare function checkLlmOutputAccess(content: string, path: string): Finding[];
|
|
23
|
+
//# sourceMappingURL=llm-output-access.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm-output-access.d.ts","sourceRoot":"","sources":["../../../src/validation/workflow-scripts/llm-output-access.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,QAAQ,EAAE,YAUtB,CAAC;AAmRF;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,CAuD7E"}
|
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Script: LLM-OUTPUT-ACCESS
|
|
3
|
+
*
|
|
4
|
+
* Checks that LLM chain outputs are correctly accessed via the .output property
|
|
5
|
+
* when using a Structured Output Parser.
|
|
6
|
+
*
|
|
7
|
+
* CORRECT: $json.output.fieldName
|
|
8
|
+
* CORRECT: $('LLM Node').first().json.output.fieldName
|
|
9
|
+
* INCORRECT: $json.fieldName (missing .output)
|
|
10
|
+
* INCORRECT: $('LLM Node').first().json.fieldName (missing .output)
|
|
11
|
+
*
|
|
12
|
+
* When chainLlm is used with outputParserStructured, the result is wrapped in
|
|
13
|
+
* an `output` property. Accessing fields directly without .output will fail.
|
|
14
|
+
*
|
|
15
|
+
* This script provides auto-fix capability to add the .output prefix.
|
|
16
|
+
*/
|
|
17
|
+
export const metadata = {
|
|
18
|
+
id: 'LLM-OUTPUT-ACCESS',
|
|
19
|
+
name: 'llm_output_access',
|
|
20
|
+
severity: 'must',
|
|
21
|
+
description: 'LLM chain outputs must be accessed via .output property when using structured output parser',
|
|
22
|
+
details: 'When chainLlm is used with outputParserStructured, the result is wrapped in an output property. ' +
|
|
23
|
+
'Use $json.output.fieldName instead of $json.fieldName',
|
|
24
|
+
fixable: true,
|
|
25
|
+
category: 'ai-nodes',
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Find all chainLlm nodes that have hasOutputParser: true
|
|
29
|
+
*/
|
|
30
|
+
function findChainLlmNodesWithParser(workflow) {
|
|
31
|
+
return workflow.nodes.filter(node => node.type === '@n8n/n8n-nodes-langchain.chainLlm' &&
|
|
32
|
+
node.parameters?.hasOutputParser === true);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Find nodes directly connected downstream from a given node (via main connection)
|
|
36
|
+
*/
|
|
37
|
+
function findDirectDownstreamNodes(workflow, nodeName) {
|
|
38
|
+
const connections = workflow.connections[nodeName];
|
|
39
|
+
if (!connections?.main)
|
|
40
|
+
return [];
|
|
41
|
+
const downstreamNodes = [];
|
|
42
|
+
for (const branch of connections.main) {
|
|
43
|
+
for (const conn of branch) {
|
|
44
|
+
if (conn.type === 'main') {
|
|
45
|
+
downstreamNodes.push(conn.node);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return downstreamNodes;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get all node names that have chainLlm with output parser
|
|
53
|
+
*/
|
|
54
|
+
function getChainLlmNodeNames(workflow) {
|
|
55
|
+
const names = new Set();
|
|
56
|
+
for (const node of workflow.nodes) {
|
|
57
|
+
if (node.type === '@n8n/n8n-nodes-langchain.chainLlm' &&
|
|
58
|
+
node.parameters?.hasOutputParser === true) {
|
|
59
|
+
names.add(node.name);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return names;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Check if a node is directly downstream from any chainLlm node with output parser
|
|
66
|
+
*/
|
|
67
|
+
function isDirectlyConnectedToChainLlm(workflow, nodeId, chainLlmNames) {
|
|
68
|
+
const node = workflow.nodes.find(n => n.id === nodeId);
|
|
69
|
+
if (!node)
|
|
70
|
+
return false;
|
|
71
|
+
// Check if any chainLlm node connects to this node
|
|
72
|
+
for (const chainName of chainLlmNames) {
|
|
73
|
+
const downstreamNodes = findDirectDownstreamNodes(workflow, chainName);
|
|
74
|
+
if (downstreamNodes.includes(node.name)) {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Escape special regex characters in a string
|
|
82
|
+
*/
|
|
83
|
+
function escapeRegex(str) {
|
|
84
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Check for direct $json.fieldName access (should be $json.output.fieldName)
|
|
88
|
+
* This only applies to nodes directly connected to chainLlm
|
|
89
|
+
*/
|
|
90
|
+
function checkDirectJsonAccess(content, node, path) {
|
|
91
|
+
const findings = [];
|
|
92
|
+
const nodeJson = JSON.stringify(node);
|
|
93
|
+
// Pattern to find $json.fieldName (but not $json.output.fieldName)
|
|
94
|
+
// Negative lookahead to skip $json.output
|
|
95
|
+
const directAccessRegex = /\$json\.(?!output[\.\?\s])([a-zA-Z_][a-zA-Z0-9_]*)/g;
|
|
96
|
+
// Also check for defensive patterns that should be skipped
|
|
97
|
+
const defensivePattern = /\$json\.output\?\.[a-zA-Z_]+\s*\|\|\s*\$json\.[a-zA-Z_]+/;
|
|
98
|
+
// If the node has a defensive pattern, skip it entirely
|
|
99
|
+
if (defensivePattern.test(nodeJson)) {
|
|
100
|
+
return findings;
|
|
101
|
+
}
|
|
102
|
+
let match;
|
|
103
|
+
directAccessRegex.lastIndex = 0;
|
|
104
|
+
while ((match = directAccessRegex.exec(nodeJson)) !== null) {
|
|
105
|
+
const fieldName = match[1];
|
|
106
|
+
const fullMatch = match[0];
|
|
107
|
+
// Skip if this is part of a defensive pattern (check surrounding context)
|
|
108
|
+
const contextStart = Math.max(0, match.index - 50);
|
|
109
|
+
const contextEnd = Math.min(nodeJson.length, match.index + fullMatch.length + 50);
|
|
110
|
+
const context = nodeJson.substring(contextStart, contextEnd);
|
|
111
|
+
// Skip if this looks like a fallback pattern: $json.output?.field || $json.field
|
|
112
|
+
if (/\$json\.output\?\.\w+\s*\|\|/.test(context)) {
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
// Calculate approximate line number in the original content
|
|
116
|
+
const lineNumber = getLineNumberForNode(content, node.id);
|
|
117
|
+
findings.push({
|
|
118
|
+
rule: metadata.id,
|
|
119
|
+
severity: metadata.severity,
|
|
120
|
+
path,
|
|
121
|
+
message: `LLM chain output accessed without .output prefix: ${fullMatch} should be $json.output.${fieldName}`,
|
|
122
|
+
raw_details: `When chainLlm is used with outputParserStructured, the output is wrapped in an 'output' property. Change ${fullMatch} to $json.output.${fieldName}`,
|
|
123
|
+
nodeId: node.id,
|
|
124
|
+
line: lineNumber,
|
|
125
|
+
fixable: true,
|
|
126
|
+
fix: {
|
|
127
|
+
description: `Change ${fullMatch} to $json.output.${fieldName}`,
|
|
128
|
+
apply: (fileContent) => {
|
|
129
|
+
// Find the specific node in the content and fix it
|
|
130
|
+
const parsed = JSON.parse(fileContent);
|
|
131
|
+
const targetNode = parsed.nodes.find((n) => n.id === node.id);
|
|
132
|
+
if (targetNode) {
|
|
133
|
+
const nodeStr = JSON.stringify(targetNode);
|
|
134
|
+
// Replace $json.fieldName with $json.output.fieldName (but not $json.output.*)
|
|
135
|
+
const fixedNodeStr = nodeStr.replace(new RegExp(`\\$json\\.(?!output[.?\\s])${escapeRegex(fieldName)}`, 'g'), `$json.output.${fieldName}`);
|
|
136
|
+
const fixedNode = JSON.parse(fixedNodeStr);
|
|
137
|
+
const nodeIndex = parsed.nodes.findIndex((n) => n.id === node.id);
|
|
138
|
+
parsed.nodes[nodeIndex] = fixedNode;
|
|
139
|
+
}
|
|
140
|
+
return JSON.stringify(parsed, null, 2);
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return findings;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Check for named reference access like $('NodeName').first().json.fieldName
|
|
149
|
+
* This applies to any node referencing a chainLlm node by name
|
|
150
|
+
*/
|
|
151
|
+
function checkNamedReferenceAccess(content, node, chainLlmNames, path) {
|
|
152
|
+
const findings = [];
|
|
153
|
+
const nodeJson = JSON.stringify(node);
|
|
154
|
+
for (const chainName of chainLlmNames) {
|
|
155
|
+
// Escape the node name for use in regex
|
|
156
|
+
const escapedName = escapeRegex(chainName);
|
|
157
|
+
// Pattern to find $('NodeName').first().json.fieldName or $('NodeName').item.json.fieldName
|
|
158
|
+
// or $("NodeName") with double quotes
|
|
159
|
+
// But NOT .json.output.fieldName (which is correct)
|
|
160
|
+
// Using word boundary \b to properly detect "output" as a complete word
|
|
161
|
+
const namedRefRegex = new RegExp(`\\$\\(['"]${escapedName}['"]\\)\\.(first\\(\\)|item|all\\(\\)\\[\\d+\\])\\.json\\.(?!output\\b)([a-zA-Z_][a-zA-Z0-9_]*)`, 'g');
|
|
162
|
+
// Also check for defensive patterns
|
|
163
|
+
const defensivePattern = new RegExp(`\\$\\(['"]${escapedName}['"]\\).*\\.json\\.output\\?\\.[a-zA-Z_]+\\s*\\|\\|`);
|
|
164
|
+
if (defensivePattern.test(nodeJson)) {
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
let match;
|
|
168
|
+
namedRefRegex.lastIndex = 0;
|
|
169
|
+
while ((match = namedRefRegex.exec(nodeJson)) !== null) {
|
|
170
|
+
const accessor = match[1]; // first(), item, or all()[0]
|
|
171
|
+
const fieldName = match[2];
|
|
172
|
+
const fullMatch = match[0];
|
|
173
|
+
// Skip if this is part of a defensive pattern
|
|
174
|
+
const contextStart = Math.max(0, match.index - 50);
|
|
175
|
+
const contextEnd = Math.min(nodeJson.length, match.index + fullMatch.length + 50);
|
|
176
|
+
const context = nodeJson.substring(contextStart, contextEnd);
|
|
177
|
+
if (/\.json\.output\?\.\w+\s*\|\|/.test(context)) {
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
180
|
+
const lineNumber = getLineNumberForNode(content, node.id);
|
|
181
|
+
findings.push({
|
|
182
|
+
rule: metadata.id,
|
|
183
|
+
severity: metadata.severity,
|
|
184
|
+
path,
|
|
185
|
+
message: `LLM chain '${chainName}' output accessed without .output prefix: should be $('${chainName}').${accessor}.json.output.${fieldName}`,
|
|
186
|
+
raw_details: `When chainLlm is used with outputParserStructured, the output is wrapped in an 'output' property. Add .output before .${fieldName}`,
|
|
187
|
+
nodeId: node.id,
|
|
188
|
+
line: lineNumber,
|
|
189
|
+
fixable: true,
|
|
190
|
+
fix: {
|
|
191
|
+
description: `Add .output prefix when accessing ${chainName} output`,
|
|
192
|
+
apply: (fileContent) => {
|
|
193
|
+
const parsed = JSON.parse(fileContent);
|
|
194
|
+
const targetNode = parsed.nodes.find((n) => n.id === node.id);
|
|
195
|
+
if (targetNode) {
|
|
196
|
+
const nodeStr = JSON.stringify(targetNode);
|
|
197
|
+
// Replace .json.fieldName with .json.output.fieldName for this specific node reference
|
|
198
|
+
const fixRegex = new RegExp(`(\\$\\(['"]${escapedName}['"]\\)\\.(first\\(\\)|item|all\\(\\)\\[\\d+\\])\\.json)\\.(?!output)${escapeRegex(fieldName)}`, 'g');
|
|
199
|
+
const fixedNodeStr = nodeStr.replace(fixRegex, `$1.output.${fieldName}`);
|
|
200
|
+
const fixedNode = JSON.parse(fixedNodeStr);
|
|
201
|
+
const nodeIndex = parsed.nodes.findIndex((n) => n.id === node.id);
|
|
202
|
+
parsed.nodes[nodeIndex] = fixedNode;
|
|
203
|
+
}
|
|
204
|
+
return JSON.stringify(parsed, null, 2);
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return findings;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Get approximate line number for a node in the workflow JSON
|
|
214
|
+
*/
|
|
215
|
+
function getLineNumberForNode(content, nodeId) {
|
|
216
|
+
const lines = content.split('\n');
|
|
217
|
+
for (let i = 0; i < lines.length; i++) {
|
|
218
|
+
if (lines[i].includes(`"id": "${nodeId}"`)) {
|
|
219
|
+
return i + 1;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return 1;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Main validation function
|
|
226
|
+
*/
|
|
227
|
+
export function checkLlmOutputAccess(content, path) {
|
|
228
|
+
const findings = [];
|
|
229
|
+
// Try to parse the workflow JSON
|
|
230
|
+
let workflow;
|
|
231
|
+
try {
|
|
232
|
+
workflow = JSON.parse(content);
|
|
233
|
+
}
|
|
234
|
+
catch {
|
|
235
|
+
// Not valid JSON, skip
|
|
236
|
+
return findings;
|
|
237
|
+
}
|
|
238
|
+
// Make sure it's a workflow with nodes
|
|
239
|
+
if (!workflow.nodes || !Array.isArray(workflow.nodes)) {
|
|
240
|
+
return findings;
|
|
241
|
+
}
|
|
242
|
+
// Find all chainLlm nodes with output parsers
|
|
243
|
+
const chainLlmNodes = findChainLlmNodesWithParser(workflow);
|
|
244
|
+
if (chainLlmNodes.length === 0) {
|
|
245
|
+
return findings;
|
|
246
|
+
}
|
|
247
|
+
// Get the names of all chainLlm nodes with output parsers
|
|
248
|
+
const chainLlmNames = getChainLlmNodeNames(workflow);
|
|
249
|
+
// Check each node in the workflow
|
|
250
|
+
for (const node of workflow.nodes) {
|
|
251
|
+
// Skip the chainLlm nodes themselves
|
|
252
|
+
if (node.type === '@n8n/n8n-nodes-langchain.chainLlm') {
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
// Skip output parser nodes
|
|
256
|
+
if (node.type === '@n8n/n8n-nodes-langchain.outputParserStructured') {
|
|
257
|
+
continue;
|
|
258
|
+
}
|
|
259
|
+
// Skip model nodes
|
|
260
|
+
if (node.type.includes('lmChat')) {
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
// Check for direct $json access if this node is directly connected to a chainLlm
|
|
264
|
+
if (isDirectlyConnectedToChainLlm(workflow, node.id, chainLlmNames)) {
|
|
265
|
+
const directFindings = checkDirectJsonAccess(content, node, path);
|
|
266
|
+
findings.push(...directFindings);
|
|
267
|
+
}
|
|
268
|
+
// Check for named reference access in all nodes
|
|
269
|
+
const namedFindings = checkNamedReferenceAccess(content, node, chainLlmNames, path);
|
|
270
|
+
findings.push(...namedFindings);
|
|
271
|
+
}
|
|
272
|
+
return findings;
|
|
273
|
+
}
|
|
274
|
+
//# sourceMappingURL=llm-output-access.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"llm-output-access.js","sourceRoot":"","sources":["../../../src/validation/workflow-scripts/llm-output-access.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,MAAM,CAAC,MAAM,QAAQ,GAAiB;IACpC,EAAE,EAAE,mBAAmB;IACvB,IAAI,EAAE,mBAAmB;IACzB,QAAQ,EAAE,MAAM;IAChB,WAAW,EAAE,6FAA6F;IAC1G,OAAO,EACL,kGAAkG;QAClG,uDAAuD;IACzD,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,UAAU;CACrB,CAAC;AAoBF;;GAEG;AACH,SAAS,2BAA2B,CAAC,QAAwB;IAC3D,OAAO,QAAQ,CAAC,KAAK,CAAC,MAAM,CAC1B,IAAI,CAAC,EAAE,CACL,IAAI,CAAC,IAAI,KAAK,mCAAmC;QACjD,IAAI,CAAC,UAAU,EAAE,eAAe,KAAK,IAAI,CAC5C,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,yBAAyB,CAAC,QAAwB,EAAE,QAAgB;IAC3E,MAAM,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IACnD,IAAI,CAAC,WAAW,EAAE,IAAI;QAAE,OAAO,EAAE,CAAC;IAElC,MAAM,eAAe,GAAa,EAAE,CAAC;IACrC,KAAK,MAAM,MAAM,IAAI,WAAW,CAAC,IAAI,EAAE,CAAC;QACtC,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;YAC1B,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;gBACzB,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAClC,CAAC;Q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GE-BEFORE-TERMINAL
|
|
3
|
+
*
|
|
4
|
+
* Validates that Merge nodes are never directly connected to terminal
|
|
5
|
+
* Codika nodes (Submit Result / Report Error / Ingestion Callback).
|
|
6
|
+
*
|
|
7
|
+
* A Merge node immediately before a terminal Codika node causes the
|
|
8
|
+
* workflow to hang indefinitely: the Merge waits for ALL inputs, but
|
|
9
|
+
* typically only one conditional branch executes.
|
|
10
|
+
*
|
|
11
|
+
* Merge → Code → Submit Result is fine (indirect).
|
|
12
|
+
* Merge → Submit Result is a MUST-fix violation (direct).
|
|
13
|
+
*/
|
|
14
|
+
import type { Finding, RuleMetadata } from '../types.js';
|
|
15
|
+
export declare const metadata: RuleMetadata;
|
|
16
|
+
/**
|
|
17
|
+
* Check for Merge nodes directly connected to terminal Codika nodes
|
|
18
|
+
*/
|
|
19
|
+
export declare function checkMergeBeforeTerminal(content: string, path: string): Finding[];
|
|
20
|
+
//# sourceMappingURL=merge-before-terminal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-before-terminal.d.ts","sourceRoot":"","sources":["../../../src/validation/workflow-scripts/merge-before-terminal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,eAAO,MAAM,QAAQ,EAAE,YAWtB,CAAC;AAMF;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,CA+DjF"}
|