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,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trigger Client
|
|
3
|
+
* HTTP client for triggering workflows and polling execution status via the Codika public API
|
|
4
|
+
*/
|
|
5
|
+
export interface TriggerWorkflowOptions {
|
|
6
|
+
/** Process instance ID */
|
|
7
|
+
processInstanceId: string;
|
|
8
|
+
/** Workflow ID (from use case config) */
|
|
9
|
+
workflowId: string;
|
|
10
|
+
/** Payload data to send to the workflow */
|
|
11
|
+
payload: Record<string, unknown>;
|
|
12
|
+
/** API URL for the triggerWebhookPublic endpoint */
|
|
13
|
+
apiUrl: string;
|
|
14
|
+
/** API key (organization API key or admin key) */
|
|
15
|
+
apiKey: string;
|
|
16
|
+
}
|
|
17
|
+
export interface TriggerWorkflowSuccessResponse {
|
|
18
|
+
success: true;
|
|
19
|
+
executionId: string;
|
|
20
|
+
message: string;
|
|
21
|
+
}
|
|
22
|
+
export interface TriggerWorkflowErrorResponse {
|
|
23
|
+
success: false;
|
|
24
|
+
error: string;
|
|
25
|
+
code: string;
|
|
26
|
+
}
|
|
27
|
+
export type TriggerWorkflowResponse = TriggerWorkflowSuccessResponse | TriggerWorkflowErrorResponse;
|
|
28
|
+
export interface GetExecutionStatusOptions {
|
|
29
|
+
/** Process instance ID */
|
|
30
|
+
processInstanceId: string;
|
|
31
|
+
/** Execution ID (from trigger response) */
|
|
32
|
+
executionId: string;
|
|
33
|
+
/** API URL for the getExecutionStatusPublic endpoint */
|
|
34
|
+
apiUrl: string;
|
|
35
|
+
/** API key (organization API key or admin key) */
|
|
36
|
+
apiKey: string;
|
|
37
|
+
}
|
|
38
|
+
export interface ExecutionStatusData {
|
|
39
|
+
executionId: string;
|
|
40
|
+
status: 'pending' | 'success' | 'failed';
|
|
41
|
+
createdAt: string;
|
|
42
|
+
duration?: number;
|
|
43
|
+
resultData?: unknown;
|
|
44
|
+
errorDetails?: {
|
|
45
|
+
type: string;
|
|
46
|
+
message: string;
|
|
47
|
+
code?: string;
|
|
48
|
+
failedNodeName?: string;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export interface GetExecutionStatusSuccessResponse {
|
|
52
|
+
success: true;
|
|
53
|
+
execution: ExecutionStatusData;
|
|
54
|
+
}
|
|
55
|
+
export interface GetExecutionStatusErrorResponse {
|
|
56
|
+
success: false;
|
|
57
|
+
error: string;
|
|
58
|
+
code: string;
|
|
59
|
+
}
|
|
60
|
+
export type GetExecutionStatusResponse = GetExecutionStatusSuccessResponse | GetExecutionStatusErrorResponse;
|
|
61
|
+
export interface PollOptions {
|
|
62
|
+
/** Polling interval in milliseconds (default: 3000) */
|
|
63
|
+
intervalMs?: number;
|
|
64
|
+
/** Maximum time to wait in milliseconds (default: 120000) */
|
|
65
|
+
timeoutMs?: number;
|
|
66
|
+
/** Callback on each poll attempt */
|
|
67
|
+
onPoll?: (elapsedMs: number, attempt: number) => void;
|
|
68
|
+
}
|
|
69
|
+
export declare function isTriggerSuccess(response: TriggerWorkflowResponse): response is TriggerWorkflowSuccessResponse;
|
|
70
|
+
export declare function isTriggerError(response: TriggerWorkflowResponse): response is TriggerWorkflowErrorResponse;
|
|
71
|
+
export declare function isStatusSuccess(response: GetExecutionStatusResponse): response is GetExecutionStatusSuccessResponse;
|
|
72
|
+
export declare function isStatusError(response: GetExecutionStatusResponse): response is GetExecutionStatusErrorResponse;
|
|
73
|
+
export declare function triggerWorkflow(options: TriggerWorkflowOptions): Promise<TriggerWorkflowResponse>;
|
|
74
|
+
export declare function triggerWorkflowOrThrow(options: TriggerWorkflowOptions): Promise<TriggerWorkflowSuccessResponse>;
|
|
75
|
+
export declare function getExecutionStatus(options: GetExecutionStatusOptions): Promise<GetExecutionStatusResponse>;
|
|
76
|
+
export declare function getExecutionStatusOrThrow(options: GetExecutionStatusOptions): Promise<GetExecutionStatusSuccessResponse>;
|
|
77
|
+
export declare function pollExecutionStatus(options: GetExecutionStatusOptions, pollOptions?: PollOptions): Promise<GetExecutionStatusSuccessResponse>;
|
|
78
|
+
//# sourceMappingURL=trigger-client.d.ts.map
|
|
@@ -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B,GACjC,OAAO,CAAC,iCAAiC,CAAC,CAQ5C;AAID,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,yBAAyB,EAClC,WAAW,GAAE,WAAgB,GAC5B,OAAO,CAAC,iCAAiC,CAAC,CA6B5C"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trigger Client
|
|
3
|
+
* HTTP client for triggering workflows and polling execution status via the Codika public API
|
|
4
|
+
*/
|
|
5
|
+
// ── Type Guards ─────────────────────────────────────────
|
|
6
|
+
export function isTriggerSuccess(response) {
|
|
7
|
+
return response.success === true;
|
|
8
|
+
}
|
|
9
|
+
export function isTriggerError(response) {
|
|
10
|
+
return response.success === false;
|
|
11
|
+
}
|
|
12
|
+
export function isStatusSuccess(response) {
|
|
13
|
+
return response.success === true;
|
|
14
|
+
}
|
|
15
|
+
export function isStatusError(response) {
|
|
16
|
+
return response.success === false;
|
|
17
|
+
}
|
|
18
|
+
// ── Trigger Function ────────────────────────────────────
|
|
19
|
+
export async function triggerWorkflow(options) {
|
|
20
|
+
const { processInstanceId, workflowId, payload, apiUrl, apiKey } = options;
|
|
21
|
+
const url = `${apiUrl}/${processInstanceId}/${workflowId}`;
|
|
22
|
+
const response = await fetch(url, {
|
|
23
|
+
method: 'POST',
|
|
24
|
+
headers: {
|
|
25
|
+
'Content-Type': 'application/json',
|
|
26
|
+
'X-Process-Manager-Key': apiKey,
|
|
27
|
+
},
|
|
28
|
+
body: JSON.stringify({ payload }),
|
|
29
|
+
});
|
|
30
|
+
return (await response.json());
|
|
31
|
+
}
|
|
32
|
+
export async function triggerWorkflowOrThrow(options) {
|
|
33
|
+
const result = await triggerWorkflow(options);
|
|
34
|
+
if (isTriggerError(result)) {
|
|
35
|
+
throw new Error(`Trigger failed: ${result.error}`);
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
// ── Status Function ─────────────────────────────────────
|
|
40
|
+
export async function getExecutionStatus(options) {
|
|
41
|
+
const { processInstanceId, executionId, apiUrl, apiKey } = options;
|
|
42
|
+
const url = `${apiUrl}/${processInstanceId}/${executionId}`;
|
|
43
|
+
const response = await fetch(url, {
|
|
44
|
+
method: 'GET',
|
|
45
|
+
headers: {
|
|
46
|
+
'X-Process-Manager-Key': apiKey,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
return (await response.json());
|
|
50
|
+
}
|
|
51
|
+
export async function getExecutionStatusOrThrow(options) {
|
|
52
|
+
const result = await getExecutionStatus(options);
|
|
53
|
+
if (isStatusError(result)) {
|
|
54
|
+
throw new Error(`Status fetch failed: ${result.error}`);
|
|
55
|
+
}
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
// ── Poll Function ───────────────────────────────────────
|
|
59
|
+
export async function pollExecutionStatus(options, pollOptions = {}) {
|
|
60
|
+
const { intervalMs = 3000, timeoutMs = 120000, onPoll } = pollOptions;
|
|
61
|
+
const startTime = Date.now();
|
|
62
|
+
let attempt = 0;
|
|
63
|
+
while (true) {
|
|
64
|
+
attempt++;
|
|
65
|
+
const elapsed = Date.now() - startTime;
|
|
66
|
+
if (elapsed > timeoutMs) {
|
|
67
|
+
throw new Error(`Polling timed out after ${Math.round(timeoutMs / 1000)}s. ` +
|
|
68
|
+
`Execution may still be running. Check status with:\n` +
|
|
69
|
+
` codika get execution ${options.executionId}`);
|
|
70
|
+
}
|
|
71
|
+
if (onPoll) {
|
|
72
|
+
onPoll(elapsed, attempt);
|
|
73
|
+
}
|
|
74
|
+
const result = await getExecutionStatusOrThrow(options);
|
|
75
|
+
if (result.execution.status !== 'pending') {
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
78
|
+
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=trigger-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger-client.js","sourceRoot":"","sources":["../../src/utils/trigger-client.ts"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ACxB,MAAM,IAAI,KAAK,CACb,2BAA2B,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,KAAK;gBAC5D,sDAAsD;gBACtD,0BAA0B,OAAO,CAAC,WAAW,EAAE,CAChD,CAAC;QACJ,CAAC;QAED,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC3B,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,yBAAyB,CAAC,OAAO,CAAC,CAAC;QAExD,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC1C,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC;IAClE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Use Case Deployer
|
|
3
|
+
* High-level function to deploy a use case from its folder path
|
|
4
|
+
*/
|
|
5
|
+
import type { ProcessDeploymentConfigurationInput, VersionStrategy, MetadataDocument, SkillDocument } from '../types/process-types.js';
|
|
6
|
+
import { type DeployResult } from './deploy-client.js';
|
|
7
|
+
/**
|
|
8
|
+
* Options for deploying a use case from folder
|
|
9
|
+
*/
|
|
10
|
+
export interface DeployUseCaseOptions {
|
|
11
|
+
/** Absolute path to the use case folder (containing config.ts/config.js) */
|
|
12
|
+
useCasePath: string;
|
|
13
|
+
/** API key for authentication */
|
|
14
|
+
apiKey: string;
|
|
15
|
+
/** API URL for deployment */
|
|
16
|
+
apiUrl: string;
|
|
17
|
+
/** Override project ID (highest priority — skips project.json and config.ts) */
|
|
18
|
+
projectId?: string;
|
|
19
|
+
/** Version strategy (defaults to 'minor_bump') */
|
|
20
|
+
versionStrategy?: VersionStrategy;
|
|
21
|
+
/** Explicit version (required if versionStrategy is 'explicit') */
|
|
22
|
+
explicitVersion?: string;
|
|
23
|
+
/** Additional files to include (e.g., PRD, logs) */
|
|
24
|
+
additionalFiles?: Array<{
|
|
25
|
+
absolutePath: string;
|
|
26
|
+
relativePath: string;
|
|
27
|
+
}>;
|
|
28
|
+
/** Path to a custom project file (e.g., project-client-a.json) */
|
|
29
|
+
projectFile?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Resolved deployment data — everything needed to deploy, before the HTTP call
|
|
33
|
+
*/
|
|
34
|
+
export interface ResolvedUseCaseDeployment {
|
|
35
|
+
useCasePath: string;
|
|
36
|
+
projectId: string;
|
|
37
|
+
projectIdSource: 'flag' | 'project.json';
|
|
38
|
+
configuration: ProcessDeploymentConfigurationInput;
|
|
39
|
+
workflowFiles: string[];
|
|
40
|
+
metadataDocuments: MetadataDocument[];
|
|
41
|
+
skills: SkillDocument[];
|
|
42
|
+
apiUrl: string;
|
|
43
|
+
apiKey: string;
|
|
44
|
+
versionStrategy?: VersionStrategy;
|
|
45
|
+
explicitVersion?: string;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Result of deploying a use case
|
|
49
|
+
* Combines the base DeployResult with additional context for archiving
|
|
50
|
+
*/
|
|
51
|
+
export type DeployUseCaseResult = DeployResult & {
|
|
52
|
+
/** The project ID from config.ts */
|
|
53
|
+
projectId: string;
|
|
54
|
+
/** The configuration that was deployed (useful for archiving) */
|
|
55
|
+
configuration: ProcessDeploymentConfigurationInput;
|
|
56
|
+
/** List of workflow files from config.ts (useful for archiving) */
|
|
57
|
+
workflowFiles: string[];
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Resolve all deployment data without making the HTTP call.
|
|
61
|
+
* This is the preparation phase shared by both real deploy and dry-run.
|
|
62
|
+
*
|
|
63
|
+
* @param options - Deployment options including the use case path
|
|
64
|
+
* @returns Resolved deployment data ready for the HTTP call
|
|
65
|
+
*/
|
|
66
|
+
export declare function resolveUseCaseDeployment(options: DeployUseCaseOptions): Promise<ResolvedUseCaseDeployment>;
|
|
67
|
+
/**
|
|
68
|
+
* Deploy a use case by pointing at its folder
|
|
69
|
+
*
|
|
70
|
+
* This function:
|
|
71
|
+
* 1. Resolves all deployment data (config, project ID, documents)
|
|
72
|
+
* 2. Makes the HTTP call to deploy to the Codika platform
|
|
73
|
+
* 3. Returns the result along with context needed for archiving
|
|
74
|
+
*
|
|
75
|
+
* @param options - Deployment options including the use case path
|
|
76
|
+
* @returns Deployment result with additional context
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```typescript
|
|
80
|
+
* const result = await deployUseCaseFromFolder({
|
|
81
|
+
* useCasePath: '/path/to/use-cases/my-use-case',
|
|
82
|
+
* apiKey: 'your-api-key',
|
|
83
|
+
* });
|
|
84
|
+
*
|
|
85
|
+
* if (isDeploySuccess(result)) {
|
|
86
|
+
* console.log('Deployed version:', result.data.version);
|
|
87
|
+
* // Archive using result.configuration and result.workflowFiles
|
|
88
|
+
* }
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export declare function deployUseCaseFromFolder(options: DeployUseCaseOptions): Promise<DeployUseCaseResult>;
|
|
92
|
+
export { isDeploySuccess, isDeployError } from './deploy-client.js';
|
|
93
|
+
//# sourceMappingURL=use-case-deployer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-case-deployer.d.ts","sourceRoot":"","sources":["../../src/utils/use-case-deployer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,KAAK,EAAE,mCAAmC,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAEvI,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,oBAAoB,CAAC;AAG5B;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,4EAA4E;IAC5E,WAAW,EAAE,MAAM,CAAC;IACpB,iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,MAAM,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D,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Use Case Deployer
|
|
3
|
+
* High-level function to deploy a use case from its folder path
|
|
4
|
+
*/
|
|
5
|
+
import { createHash } from 'crypto';
|
|
6
|
+
import { join, extname, basename } from 'path';
|
|
7
|
+
import { pathToFileURL } from 'url';
|
|
8
|
+
import { existsSync, readdirSync, readFileSync, statSync } from 'fs';
|
|
9
|
+
import { readSkillFiles } from './skill-parser.js';
|
|
10
|
+
import { deployProcess, } from './deploy-client.js';
|
|
11
|
+
import { resolveProjectId } from './project-json.js';
|
|
12
|
+
/**
|
|
13
|
+
* MIME type mapping for common file extensions
|
|
14
|
+
*/
|
|
15
|
+
const MIME_TYPES = {
|
|
16
|
+
// Text/Documentation
|
|
17
|
+
'.md': 'text/markdown',
|
|
18
|
+
'.markdown': 'text/markdown',
|
|
19
|
+
'.txt': 'text/plain',
|
|
20
|
+
'.log': 'text/plain',
|
|
21
|
+
// Data formats
|
|
22
|
+
'.json': 'application/json',
|
|
23
|
+
'.yaml': 'application/x-yaml',
|
|
24
|
+
'.yml': 'application/x-yaml',
|
|
25
|
+
'.xml': 'application/xml',
|
|
26
|
+
'.csv': 'text/csv',
|
|
27
|
+
// Code
|
|
28
|
+
'.ts': 'text/typescript',
|
|
29
|
+
'.js': 'text/javascript',
|
|
30
|
+
'.py': 'text/x-python',
|
|
31
|
+
'.html': 'text/html',
|
|
32
|
+
'.css': 'text/css',
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Get MIME type for a file based on extension
|
|
36
|
+
*/
|
|
37
|
+
function getMimeType(filePath) {
|
|
38
|
+
const ext = extname(filePath).toLowerCase();
|
|
39
|
+
return MIME_TYPES[ext] || 'application/octet-stream';
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Generate a short hash of the relative path for collision-safe storage filenames
|
|
43
|
+
*/
|
|
44
|
+
function hashPath(relativePath) {
|
|
45
|
+
return createHash('md5').update(relativePath).digest('hex').substring(0, 8);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Get the storage filename with hash prefix to prevent collisions
|
|
49
|
+
* Files with same name in different folders get different hashes
|
|
50
|
+
*/
|
|
51
|
+
function getStorageFilename(relativePath) {
|
|
52
|
+
const filename = basename(relativePath);
|
|
53
|
+
return `${hashPath(relativePath)}-${filename}`;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Validate that a relative path is safe (no absolute paths or traversal)
|
|
57
|
+
*/
|
|
58
|
+
function validateRelativePath(relativePath) {
|
|
59
|
+
if (relativePath.startsWith('/')) {
|
|
60
|
+
throw new Error(`relativePath must not be absolute: ${relativePath}`);
|
|
61
|
+
}
|
|
62
|
+
if (relativePath.includes('..')) {
|
|
63
|
+
throw new Error(`relativePath must not contain '..': ${relativePath}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Read a single file and convert to MetadataDocument
|
|
68
|
+
*
|
|
69
|
+
* @param absolutePath - Absolute path to the file
|
|
70
|
+
* @param relativePath - Relative path for storage and reconstruction
|
|
71
|
+
* @param description - Optional description for the document
|
|
72
|
+
* @returns MetadataDocument or null if file cannot be read
|
|
73
|
+
*/
|
|
74
|
+
function readFileAsDocument(absolutePath, relativePath, description) {
|
|
75
|
+
if (!existsSync(absolutePath)) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
const fileStat = statSync(absolutePath);
|
|
79
|
+
// Skip directories
|
|
80
|
+
if (fileStat.isDirectory()) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
// Skip files larger than 10MB
|
|
84
|
+
if (fileStat.size > 10 * 1024 * 1024) {
|
|
85
|
+
console.warn(`Skipping ${relativePath}: exceeds 10MB size limit`);
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
try {
|
|
89
|
+
const content = readFileSync(absolutePath);
|
|
90
|
+
const contentBase64 = content.toString('base64');
|
|
91
|
+
const contentType = getMimeType(absolutePath);
|
|
92
|
+
return {
|
|
93
|
+
relativePath,
|
|
94
|
+
contentType,
|
|
95
|
+
contentBase64,
|
|
96
|
+
...(description && { description }),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
catch (error) {
|
|
100
|
+
console.warn(`Failed to read ${relativePath}: ${error instanceof Error ? error.message : error}`);
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Read use case source files (config.ts and workflow JSONs) as metadata documents
|
|
106
|
+
* All files use their relative path for exact reconstruction
|
|
107
|
+
*
|
|
108
|
+
* @param useCasePath - Path to the use case folder
|
|
109
|
+
* @returns Array of MetadataDocument objects for source files
|
|
110
|
+
*/
|
|
111
|
+
function readUseCaseSourceFiles(useCasePath) {
|
|
112
|
+
const documents = [];
|
|
113
|
+
// 1. Read config.ts
|
|
114
|
+
const configPath = join(useCasePath, 'config.ts');
|
|
115
|
+
const configDoc = readFileAsDocument(configPath, 'config.ts', 'Use case configuration');
|
|
116
|
+
if (configDoc) {
|
|
117
|
+
documents.push(configDoc);
|
|
118
|
+
}
|
|
119
|
+
// 2. Read all workflow JSON files from workflows/ directory
|
|
120
|
+
const workflowsPath = join(useCasePath, 'workflows');
|
|
121
|
+
if (existsSync(workflowsPath)) {
|
|
122
|
+
const workflowFiles = readdirSync(workflowsPath).filter(f => f.endsWith('.json'));
|
|
123
|
+
for (const workflowFile of workflowFiles) {
|
|
124
|
+
const doc = readFileAsDocument(join(workflowsPath, workflowFile), `workflows/${workflowFile}`, // relativePath includes folder
|
|
125
|
+
`Workflow: ${workflowFile}`);
|
|
126
|
+
if (doc) {
|
|
127
|
+
documents.push(doc);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return documents;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Resolve all deployment data without making the HTTP call.
|
|
135
|
+
* This is the preparation phase shared by both real deploy and dry-run.
|
|
136
|
+
*
|
|
137
|
+
* @param options - Deployment options including the use case path
|
|
138
|
+
* @returns Resolved deployment data ready for the HTTP call
|
|
139
|
+
*/
|
|
140
|
+
export async function resolveUseCaseDeployment(options) {
|
|
141
|
+
const { useCasePath, apiKey, apiUrl, versionStrategy, explicitVersion, additionalFiles, } = options;
|
|
142
|
+
// Validate use case structure
|
|
143
|
+
const configPath = join(useCasePath, 'config.ts');
|
|
144
|
+
const workflowsPath = join(useCasePath, 'workflows');
|
|
145
|
+
const errors = [];
|
|
146
|
+
if (!existsSync(configPath)) {
|
|
147
|
+
errors.push(`Missing config.ts at ${configPath}`);
|
|
148
|
+
}
|
|
149
|
+
if (!existsSync(workflowsPath)) {
|
|
150
|
+
errors.push(`Missing workflows/ folder at ${workflowsPath}`);
|
|
151
|
+
}
|
|
152
|
+
if (errors.length > 0) {
|
|
153
|
+
throw new Error(`Invalid use case structure at ${useCasePath}:\n` +
|
|
154
|
+
errors.map((e) => ` - ${e}`).join('\n') +
|
|
155
|
+
'\n\nExpected structure:\n' +
|
|
156
|
+
' use-case-folder/\n' +
|
|
157
|
+
' ├── config.ts\n' +
|
|
158
|
+
' └── workflows/\n' +
|
|
159
|
+
' └── *.json');
|
|
160
|
+
}
|
|
161
|
+
const configUrl = pathToFileURL(configPath).href;
|
|
162
|
+
// Dynamically import the config module
|
|
163
|
+
let configModule;
|
|
164
|
+
try {
|
|
165
|
+
configModule = (await import(configUrl));
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
169
|
+
throw new Error(`Failed to load config at ${configPath}: ${msg}\n` +
|
|
170
|
+
'Check your TypeScript syntax and ensure the file compiles correctly.');
|
|
171
|
+
}
|
|
172
|
+
// Validate required exports
|
|
173
|
+
if (typeof configModule.getConfiguration !== 'function') {
|
|
174
|
+
throw new Error(`config.js at ${useCasePath} must export getConfiguration function`);
|
|
175
|
+
}
|
|
176
|
+
// Resolve project ID: --project-id flag > --project-file > project.json
|
|
177
|
+
const { projectId, source } = resolveProjectId({
|
|
178
|
+
flagValue: options.projectId,
|
|
179
|
+
useCasePath,
|
|
180
|
+
projectFile: options.projectFile,
|
|
181
|
+
});
|
|
182
|
+
const configuration = configModule.getConfiguration();
|
|
183
|
+
const workflowFiles = configModule.WORKFLOW_FILES || [];
|
|
184
|
+
// Build document list - all files use relativePath for reconstruction
|
|
185
|
+
const documents = [];
|
|
186
|
+
// 1. Source files (config.ts, workflows/)
|
|
187
|
+
documents.push(...readUseCaseSourceFiles(useCasePath));
|
|
188
|
+
// 2. Additional files (PRD, logs, etc.)
|
|
189
|
+
if (additionalFiles) {
|
|
190
|
+
for (const file of additionalFiles) {
|
|
191
|
+
validateRelativePath(file.relativePath);
|
|
192
|
+
const doc = readFileAsDocument(file.absolutePath, file.relativePath);
|
|
193
|
+
if (doc) {
|
|
194
|
+
documents.push(doc);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
// 3. Read skill files from skills/*/SKILL.md
|
|
199
|
+
const skills = readSkillFiles(useCasePath);
|
|
200
|
+
// Also add skill files as metadata documents for archival
|
|
201
|
+
for (const skill of skills) {
|
|
202
|
+
const skillPath = join(useCasePath, skill.relativePath);
|
|
203
|
+
const doc = readFileAsDocument(skillPath, skill.relativePath, `Skill: ${skill.name}`);
|
|
204
|
+
if (doc) {
|
|
205
|
+
documents.push(doc);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return {
|
|
209
|
+
useCasePath,
|
|
210
|
+
projectId,
|
|
211
|
+
projectIdSource: source,
|
|
212
|
+
configuration,
|
|
213
|
+
workflowFiles,
|
|
214
|
+
metadataDocuments: documents,
|
|
215
|
+
skills,
|
|
216
|
+
apiUrl,
|
|
217
|
+
apiKey,
|
|
218
|
+
versionStrategy,
|
|
219
|
+
explicitVersion,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Deploy a use case by pointing at its folder
|
|
224
|
+
*
|
|
225
|
+
* This function:
|
|
226
|
+
* 1. Resolves all deployment data (config, project ID, documents)
|
|
227
|
+
* 2. Makes the HTTP call to deploy to the Codika platform
|
|
228
|
+
* 3. Returns the result along with context needed for archiving
|
|
229
|
+
*
|
|
230
|
+
* @param options - Deployment options including the use case path
|
|
231
|
+
* @returns Deployment result with additional context
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* ```typescript
|
|
235
|
+
* const result = await deployUseCaseFromFolder({
|
|
236
|
+
* useCasePath: '/path/to/use-cases/my-use-case',
|
|
237
|
+
* apiKey: 'your-api-key',
|
|
238
|
+
* });
|
|
239
|
+
*
|
|
240
|
+
* if (isDeploySuccess(result)) {
|
|
241
|
+
* console.log('Deployed version:', result.data.version);
|
|
242
|
+
* // Archive using result.configuration and result.workflowFiles
|
|
243
|
+
* }
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
246
|
+
export async function deployUseCaseFromFolder(options) {
|
|
247
|
+
// Phase 1: Resolve everything
|
|
248
|
+
const resolved = await resolveUseCaseDeployment(options);
|
|
249
|
+
// Phase 2: Make the HTTP call (this is the only part dry-run skips)
|
|
250
|
+
const result = await deployProcess({
|
|
251
|
+
projectId: resolved.projectId,
|
|
252
|
+
configuration: resolved.configuration,
|
|
253
|
+
apiKey: resolved.apiKey,
|
|
254
|
+
apiUrl: resolved.apiUrl,
|
|
255
|
+
versionStrategy: resolved.versionStrategy,
|
|
256
|
+
explicitVersion: resolved.explicitVersion,
|
|
257
|
+
metadataDocuments: resolved.metadataDocuments.length > 0 ? resolved.metadataDocuments : undefined,
|
|
258
|
+
skills: resolved.skills.length > 0 ? resolved.skills : undefined,
|
|
259
|
+
});
|
|
260
|
+
// Return result with additional context for archiving
|
|
261
|
+
return {
|
|
262
|
+
...result,
|
|
263
|
+
projectId: resolved.projectId,
|
|
264
|
+
configuration: resolved.configuration,
|
|
265
|
+
workflowFiles: resolved.workflowFiles,
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
// Re-export type guards for convenience
|
|
269
|
+
export { isDeploySuccess, isDeployError } from './deploy-client.js';
|
|
270
|
+
//# sourceMappingURL=use-case-deployer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-case-deployer.js","sourceRoot":"","sources":["../../src/utils/use-case-deployer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAW,MAAM,MAAM,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAErE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACL,aAAa,GAId,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAsDrD;;GAEG;AACH,MAAM,UAAU,GAA2B;IACzC,qBAAqB;IACrB,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,eAAe;IAC5B,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,YAAY;IACpB,eAAe;IACf,OAAO,EAAE,kBAAkB;IAC3B,OAAO,EAAE,oBAAoB;IAC7B,MAAM,EAAE,oBAAoB;IAC5B,MAAM,EAAE,iBAAiB;IACzB,MAAM,EAAE,UAAU;IAClB,OAAO;IACP,KAAK,EAAE,iBAAiB;IACxB,KAAK,EAAE,iBAAiB;IACxB,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,WAAW;IACpB,MAAM,EAAE,UAAU;CACnB,CAAC;AAEF;;GAEG;AACH,SAAS,WAAW,CAAC,QAAgB;IACnC,MAAM,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CA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AAQ,CAAC,eAAe;QACzC,eAAe,EAAE,QAAQ,CAAC,eAAe;QACzC,iBAAiB,EAAE,QAAQ,CAAC,iBAAiB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS;QACjG,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;KACjE,CAAC,CAAC;IAEH,sDAAsD;IACtD,OAAO;QACL,GAAG,MAAM;QACT,SAAS,EAAE,QAAQ,CAAC,SAAS;QAC7B,aAAa,EAAE,QAAQ,CAAC,aAAa;QACrC,aAAa,EAAE,QAAQ,CAAC,aAAa;KACtC,CAAC;AACJ,CAAC;AAED,wCAAwC;AACxC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version Manager
|
|
3
|
+
* Utilities for managing version.json files and semver operations.
|
|
4
|
+
*/
|
|
5
|
+
import type { VersionStrategy } from '../types/process-types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Semver version parts
|
|
8
|
+
*/
|
|
9
|
+
export interface SemverVersion {
|
|
10
|
+
major: number;
|
|
11
|
+
minor: number;
|
|
12
|
+
patch: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Local version increment strategy
|
|
16
|
+
*/
|
|
17
|
+
export type LocalVersionStrategy = 'patch' | 'minor' | 'major';
|
|
18
|
+
/**
|
|
19
|
+
* Resolved version strategies for both API and local versioning
|
|
20
|
+
*/
|
|
21
|
+
export interface ResolvedVersionStrategies {
|
|
22
|
+
apiStrategy: VersionStrategy;
|
|
23
|
+
localStrategy: LocalVersionStrategy;
|
|
24
|
+
explicitVersion?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Read version from version.json in a use case folder.
|
|
28
|
+
* Returns "1.0.0" if the file doesn't exist.
|
|
29
|
+
*/
|
|
30
|
+
export declare function readVersion(useCasePath: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Write version to version.json in a use case folder.
|
|
33
|
+
*/
|
|
34
|
+
export declare function writeVersion(useCasePath: string, version: string): void;
|
|
35
|
+
/**
|
|
36
|
+
* Parse a semver string (X.Y.Z) into parts.
|
|
37
|
+
*/
|
|
38
|
+
export declare function parseSemver(version: string): SemverVersion;
|
|
39
|
+
/**
|
|
40
|
+
* Format semver parts back to string.
|
|
41
|
+
*/
|
|
42
|
+
export declare function formatSemver(version: SemverVersion): string;
|
|
43
|
+
/**
|
|
44
|
+
* Increment a semver version based on strategy.
|
|
45
|
+
*/
|
|
46
|
+
export declare function incrementSemver(version: SemverVersion, strategy: LocalVersionStrategy): SemverVersion;
|
|
47
|
+
/**
|
|
48
|
+
* Resolve shorthand CLI flags to API and local version strategies.
|
|
49
|
+
*
|
|
50
|
+
* | Flag | API strategy | Local strategy |
|
|
51
|
+
* |--------------------|---------------|----------------|
|
|
52
|
+
* | (default / --patch)| minor_bump | patch |
|
|
53
|
+
* | --minor | minor_bump | minor |
|
|
54
|
+
* | --major | major_bump | major |
|
|
55
|
+
* | --version X.Y | explicit | patch |
|
|
56
|
+
*/
|
|
57
|
+
export declare function resolveVersionStrategies(flags: {
|
|
58
|
+
patch?: boolean;
|
|
59
|
+
minor?: boolean;
|
|
60
|
+
major?: boolean;
|
|
61
|
+
version?: string;
|
|
62
|
+
}): ResolvedVersionStrategies;
|
|
63
|
+
//# sourceMappingURL=version-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-manager.d.ts","sourceRoot":"","sources":["../../src/utils/version-manager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,WAAW,EAAE,eAAe,CAAC;IAC7B,aAAa,EAAE,oBAAoB,CAAC;IACpC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAOvD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAGvE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,CAa1D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM,CAE3D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,oBAAoB,GAC7B,aAAa,CAUf;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,yBAAyB,CAyB5B"}
|