@copado/agentia-cli 0.122.0-alpha.0 → 1.0.0-beta.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/CHANGELOG.md +31 -0
- package/README.md +485 -357
- package/dist/commands/ai/agent/ask.js +12 -32
- package/dist/commands/ai/agent/chat.js +11 -34
- package/dist/commands/cicd/project/create.js +33 -0
- package/dist/commands/cicd/project/default/set.js +2 -0
- package/dist/commands/cicd/project/delete.js +33 -0
- package/dist/commands/cicd/project/list.js +5 -1
- package/dist/commands/cicd/project/update.js +35 -0
- package/dist/commands/cicd/promotion/job-step/update.js +58 -0
- package/dist/commands/cicd/repository/create.js +1 -1
- package/dist/commands/cicd/repository/update.js +1 -1
- package/dist/commands/cicd/work/commit.js +6 -8
- package/dist/commands/cicd/work/submit.js +3 -0
- package/dist/commands/setup.js +3 -47
- package/dist/commands/update.js +1 -1
- package/dist/lib/agentia-oauth-error-codes.js +5 -30
- package/dist/lib/ai-chat-session.js +3 -157
- package/dist/lib/ai-config.js +13 -140
- package/dist/lib/ai-flags.js +4 -12
- package/dist/lib/ai-gateway.js +6 -382
- package/dist/lib/ai-operations.js +4 -203
- package/dist/lib/ai-stream-parser.js +4 -59
- package/dist/lib/ai-terminal-renderer.js +7 -83
- package/dist/lib/ai-types.js +31 -162
- package/dist/lib/assert.js +3 -7
- package/dist/lib/auth-config.js +20 -507
- package/dist/lib/auth-profile.js +8 -112
- package/dist/lib/cicd-gateway.js +43 -834
- package/dist/lib/cicd-region.js +5 -8
- package/dist/lib/cli-update.js +11 -84
- package/dist/lib/cli-version.js +17 -142
- package/dist/lib/command-output-buffer.js +15 -124
- package/dist/lib/credential-store.js +39 -160
- package/dist/lib/credential-sync.js +12 -256
- package/dist/lib/cursor-mcp-config.js +16 -173
- package/dist/lib/data-flags.js +8 -61
- package/dist/lib/data-types.js +30 -182
- package/dist/lib/debug.js +5 -25
- package/dist/lib/defaults-store.js +34 -577
- package/dist/lib/dependency-from-changes.js +7 -121
- package/dist/lib/deployment-step-config.js +7 -110
- package/dist/lib/deployment-step-types.js +26 -223
- package/dist/lib/deployment-step-wizard.js +5 -155
- package/dist/lib/env-file.js +5 -41
- package/dist/lib/environment-auth-status.js +5 -72
- package/dist/lib/environment-auth.js +6 -147
- package/dist/lib/environment-credential-flags.js +13 -73
- package/dist/lib/environment-credential-operations.js +9 -67
- package/dist/lib/environment-credential-selection.js +4 -60
- package/dist/lib/environment-flags.js +18 -165
- package/dist/lib/environment-types.js +14 -79
- package/dist/lib/format.js +4 -108
- package/dist/lib/function-flags.js +8 -199
- package/dist/lib/function-local-run.js +14 -148
- package/dist/lib/function-types.js +22 -179
- package/dist/lib/git-worktree.js +36 -306
- package/dist/lib/ide-command-events.js +25 -248
- package/dist/lib/job-types.js +26 -211
- package/dist/lib/list-pagination.js +16 -106
- package/dist/lib/local-gateway-config.js +8 -53
- package/dist/lib/local-metadata-paths.js +3 -77
- package/dist/lib/local-quality-gates.js +13 -133
- package/dist/lib/loopback-callback-server.js +9 -169
- package/dist/lib/mcp/command-id.js +1 -0
- package/dist/lib/mcp/server.js +2 -0
- package/dist/lib/mcp/tools.js +126 -0
- package/dist/lib/mcp/work-tools.js +25 -17
- package/dist/lib/metadata-common.js +27 -237
- package/dist/lib/metadata-refresh.js +8 -104
- package/dist/lib/navigation-open.js +3 -20
- package/dist/lib/navigation.js +7 -63
- package/dist/lib/nested-metadata-changes.js +9 -260
- package/dist/lib/nested-metadata-registry.js +12 -257
- package/dist/lib/notifications-configure.js +13 -101
- package/dist/lib/open-browser.js +6 -52
- package/dist/lib/pipeline-connection-flags.js +17 -309
- package/dist/lib/pipeline-flags.js +16 -154
- package/dist/lib/pipeline-stage-connection-flags.js +8 -46
- package/dist/lib/pipeline-types.js +18 -118
- package/dist/lib/project-default-flags.js +10 -88
- package/dist/lib/project-default-id.js +4 -29
- package/dist/lib/project-default-validation.js +7 -0
- package/dist/lib/project-defaults.js +8 -54
- package/dist/lib/project-flags.js +10 -22
- package/dist/lib/project-root.js +7 -0
- package/dist/lib/project-setup.js +13 -392
- package/dist/lib/project-types.js +9 -54
- package/dist/lib/promotion-conflicts.js +12 -83
- package/dist/lib/promotion-flags.js +4 -76
- package/dist/lib/promotion-job-steps.js +5 -0
- package/dist/lib/promotion-run.js +27 -481
- package/dist/lib/promotion-types.js +12 -144
- package/dist/lib/repository-flags.js +16 -236
- package/dist/lib/repository-types.js +16 -123
- package/dist/lib/runtime.js +1 -0
- package/dist/lib/salesforce-id.js +5 -42
- package/dist/lib/sdr-metadata-registry.generated.js +7 -6330
- package/dist/lib/sdr-path-resolver.js +4 -116
- package/dist/lib/secret-redaction.js +4 -24
- package/dist/lib/setup-prompts.js +4 -14
- package/dist/lib/setup-skills.js +16 -263
- package/dist/lib/setup-templates.js +12 -213
- package/dist/lib/setup-wizard.js +5 -564
- package/dist/lib/sf-org-context.js +7 -151
- package/dist/lib/stage-flags.js +7 -29
- package/dist/lib/stage-types.js +14 -69
- package/dist/lib/stock-quality-gates.js +5 -67
- package/dist/lib/testing-config.js +17 -175
- package/dist/lib/testing-confirmation.js +5 -17
- package/dist/lib/testing-data-command.js +8 -49
- package/dist/lib/testing-data-core.js +20 -208
- package/dist/lib/testing-data-export.js +6 -2
- package/dist/lib/testing-data-import.js +6 -2
- package/dist/lib/testing-data-io.js +12 -236
- package/dist/lib/testing-data-operations.js +10 -91
- package/dist/lib/testing-data-types.js +4 -3
- package/dist/lib/testing-flags.js +14 -312
- package/dist/lib/testing-gateway.js +15 -363
- package/dist/lib/testing-live-command.js +6 -56
- package/dist/lib/testing-live-endpoints.js +6 -34
- package/dist/lib/testing-live-history.js +7 -96
- package/dist/lib/testing-live-operations.js +19 -676
- package/dist/lib/testing-live-recorder.js +9 -122
- package/dist/lib/testing-live-robot.js +9 -158
- package/dist/lib/testing-live-state.js +5 -90
- package/dist/lib/testing-live-types.js +3 -2
- package/dist/lib/testing-operations.js +60 -1309
- package/dist/lib/testing-run-command.js +3 -94
- package/dist/lib/testing-sanitization.js +9 -135
- package/dist/lib/testing-schedule.js +5 -48
- package/dist/lib/testing-secret-input.js +4 -56
- package/dist/lib/testing-session.js +5 -82
- package/dist/lib/testing-types.js +54 -401
- package/dist/lib/testing-watch.js +4 -45
- package/dist/lib/user-context-types.js +3 -2
- package/dist/lib/user-context.js +3 -34
- package/dist/lib/user-types.js +6 -21
- package/dist/lib/var-replacement.js +14 -153
- package/dist/lib/version-warning.js +2 -1
- package/dist/lib/work-active.js +4 -23
- package/dist/lib/work-apex-test.js +12 -265
- package/dist/lib/work-branch-metadata.js +4 -40
- package/dist/lib/work-commit.js +23 -350
- package/dist/lib/work-defaults.js +5 -50
- package/dist/lib/work-done.js +5 -136
- package/dist/lib/work-flags.js +16 -246
- package/dist/lib/work-local-commit.js +7 -138
- package/dist/lib/work-local-run-tests.js +5 -61
- package/dist/lib/work-publish-command.js +5 -88
- package/dist/lib/work-push.js +25 -627
- package/dist/lib/work-set-none.js +4 -58
- package/dist/lib/work-set-selection.js +5 -46
- package/dist/lib/work-submit-wait.js +11 -0
- package/dist/lib/work-types.js +28 -336
- package/dist/lib/yaml-replacement.js +13 -132
- package/oclif.manifest.json +2052 -1818
- package/package.json +21 -86
- package/templates/skills/agentia-ai/SKILL.md +4 -3
- package/templates/skills/agentia-ai/references/ai-agents.md +13 -13
- package/templates/skills/agentia-cicd/references/work.md +35 -28
- package/theme.json +12 -0
- package/bin/dev.cmd +0 -3
- package/bin/dev.js +0 -10
- package/dist/commands/ai/agent/ask.d.ts +0 -28
- package/dist/commands/ai/agent/ask.js.map +0 -1
- package/dist/commands/ai/agent/chat.d.ts +0 -29
- package/dist/commands/ai/agent/chat.js.map +0 -1
- package/dist/commands/ai/quota/get.d.ts +0 -10
- package/dist/commands/ai/quota/get.js.map +0 -1
- package/dist/commands/ai/workspace/create.d.ts +0 -13
- package/dist/commands/ai/workspace/create.js.map +0 -1
- package/dist/commands/ai/workspace/get.d.ts +0 -13
- package/dist/commands/ai/workspace/get.js.map +0 -1
- package/dist/commands/ai/workspace/list.d.ts +0 -12
- package/dist/commands/ai/workspace/list.js.map +0 -1
- package/dist/commands/ai/workspace/member/invite.d.ts +0 -15
- package/dist/commands/ai/workspace/member/invite.js.map +0 -1
- package/dist/commands/ai/workspace/member/list.d.ts +0 -16
- package/dist/commands/ai/workspace/member/list.js.map +0 -1
- package/dist/commands/ai/workspace/update.d.ts +0 -18
- package/dist/commands/ai/workspace/update.js.map +0 -1
- package/dist/commands/auth/get.d.ts +0 -47
- package/dist/commands/auth/get.js.map +0 -1
- package/dist/commands/auth/set.d.ts +0 -22
- package/dist/commands/auth/set.js.map +0 -1
- package/dist/commands/auth/unset.d.ts +0 -18
- package/dist/commands/auth/unset.js.map +0 -1
- package/dist/commands/cicd/credential/create.d.ts +0 -12
- package/dist/commands/cicd/credential/create.js.map +0 -1
- package/dist/commands/cicd/credential/list.d.ts +0 -12
- package/dist/commands/cicd/credential/list.js.map +0 -1
- package/dist/commands/cicd/credential/update.d.ts +0 -15
- package/dist/commands/cicd/credential/update.js.map +0 -1
- package/dist/commands/cicd/data/commit/create.d.ts +0 -11
- package/dist/commands/cicd/data/commit/create.js.map +0 -1
- package/dist/commands/cicd/data/commit/list.d.ts +0 -10
- package/dist/commands/cicd/data/commit/list.js.map +0 -1
- package/dist/commands/cicd/data/dataset-file/content.d.ts +0 -10
- package/dist/commands/cicd/data/dataset-file/content.js.map +0 -1
- package/dist/commands/cicd/data/dataset-file/list.d.ts +0 -10
- package/dist/commands/cicd/data/dataset-file/list.js.map +0 -1
- package/dist/commands/cicd/data/filter/add.d.ts +0 -13
- package/dist/commands/cicd/data/filter/add.js.map +0 -1
- package/dist/commands/cicd/data/filter/delete.d.ts +0 -10
- package/dist/commands/cicd/data/filter/delete.js.map +0 -1
- package/dist/commands/cicd/data/filter/list.d.ts +0 -10
- package/dist/commands/cicd/data/filter/list.js.map +0 -1
- package/dist/commands/cicd/data/filter/update.d.ts +0 -14
- package/dist/commands/cicd/data/filter/update.js.map +0 -1
- package/dist/commands/cicd/data/formula/create.d.ts +0 -16
- package/dist/commands/cicd/data/formula/create.js.map +0 -1
- package/dist/commands/cicd/data/formula/list.d.ts +0 -10
- package/dist/commands/cicd/data/formula/list.js.map +0 -1
- package/dist/commands/cicd/data/formula/update.d.ts +0 -18
- package/dist/commands/cicd/data/formula/update.js.map +0 -1
- package/dist/commands/cicd/data/records/match.d.ts +0 -11
- package/dist/commands/cicd/data/records/match.js.map +0 -1
- package/dist/commands/cicd/data/records/search.d.ts +0 -14
- package/dist/commands/cicd/data/records/search.js.map +0 -1
- package/dist/commands/cicd/data/sobject/fields.d.ts +0 -13
- package/dist/commands/cicd/data/sobject/fields.js.map +0 -1
- package/dist/commands/cicd/data/sobject/relationships.d.ts +0 -13
- package/dist/commands/cicd/data/sobject/relationships.js.map +0 -1
- package/dist/commands/cicd/data/sync/apply.d.ts +0 -11
- package/dist/commands/cicd/data/sync/apply.js.map +0 -1
- package/dist/commands/cicd/data/sync/preview-updates.d.ts +0 -11
- package/dist/commands/cicd/data/sync/preview-updates.js.map +0 -1
- package/dist/commands/cicd/data/template/convert-old.d.ts +0 -9
- package/dist/commands/cicd/data/template/convert-old.js.map +0 -1
- package/dist/commands/cicd/data/template/create.d.ts +0 -13
- package/dist/commands/cicd/data/template/create.js.map +0 -1
- package/dist/commands/cicd/data/template/delete.d.ts +0 -9
- package/dist/commands/cicd/data/template/delete.js.map +0 -1
- package/dist/commands/cicd/data/template/get-detail.d.ts +0 -10
- package/dist/commands/cicd/data/template/get-detail.js.map +0 -1
- package/dist/commands/cicd/data/template/get.d.ts +0 -10
- package/dist/commands/cicd/data/template/get.js.map +0 -1
- package/dist/commands/cicd/data/template/list.d.ts +0 -13
- package/dist/commands/cicd/data/template/list.js.map +0 -1
- package/dist/commands/cicd/data/template/open.d.ts +0 -12
- package/dist/commands/cicd/data/template/open.js.map +0 -1
- package/dist/commands/cicd/data/template/save-detail.d.ts +0 -13
- package/dist/commands/cicd/data/template/save-detail.js.map +0 -1
- package/dist/commands/cicd/environment/auth/status.d.ts +0 -13
- package/dist/commands/cicd/environment/auth/status.js.map +0 -1
- package/dist/commands/cicd/environment/auth/web/login.d.ts +0 -15
- package/dist/commands/cicd/environment/auth/web/login.js.map +0 -1
- package/dist/commands/cicd/environment/create.d.ts +0 -22
- package/dist/commands/cicd/environment/create.js.map +0 -1
- package/dist/commands/cicd/environment/get.d.ts +0 -10
- package/dist/commands/cicd/environment/get.js.map +0 -1
- package/dist/commands/cicd/environment/list.d.ts +0 -27
- package/dist/commands/cicd/environment/list.js.map +0 -1
- package/dist/commands/cicd/environment/open.d.ts +0 -15
- package/dist/commands/cicd/environment/open.js.map +0 -1
- package/dist/commands/cicd/environment/update.d.ts +0 -23
- package/dist/commands/cicd/environment/update.js.map +0 -1
- package/dist/commands/cicd/function/defaults.d.ts +0 -12
- package/dist/commands/cicd/function/defaults.js.map +0 -1
- package/dist/commands/cicd/function/delete.d.ts +0 -11
- package/dist/commands/cicd/function/delete.js.map +0 -1
- package/dist/commands/cicd/function/get.d.ts +0 -10
- package/dist/commands/cicd/function/get.js.map +0 -1
- package/dist/commands/cicd/function/list.d.ts +0 -16
- package/dist/commands/cicd/function/list.js.map +0 -1
- package/dist/commands/cicd/function/open.d.ts +0 -12
- package/dist/commands/cicd/function/open.js.map +0 -1
- package/dist/commands/cicd/function/result/get.d.ts +0 -10
- package/dist/commands/cicd/function/result/get.js.map +0 -1
- package/dist/commands/cicd/function/result/log/get.d.ts +0 -17
- package/dist/commands/cicd/function/result/log/get.js.map +0 -1
- package/dist/commands/cicd/function/run-local.d.ts +0 -17
- package/dist/commands/cicd/function/run-local.js.map +0 -1
- package/dist/commands/cicd/function/run.d.ts +0 -16
- package/dist/commands/cicd/function/run.js.map +0 -1
- package/dist/commands/cicd/function/upsert.d.ts +0 -27
- package/dist/commands/cicd/function/upsert.js.map +0 -1
- package/dist/commands/cicd/job/get.d.ts +0 -10
- package/dist/commands/cicd/job/get.js.map +0 -1
- package/dist/commands/cicd/job/kill.d.ts +0 -10
- package/dist/commands/cicd/job/kill.js.map +0 -1
- package/dist/commands/cicd/job/list.d.ts +0 -19
- package/dist/commands/cicd/job/list.js.map +0 -1
- package/dist/commands/cicd/job/log/get.d.ts +0 -18
- package/dist/commands/cicd/job/log/get.js.map +0 -1
- package/dist/commands/cicd/job/open.d.ts +0 -12
- package/dist/commands/cicd/job/open.js.map +0 -1
- package/dist/commands/cicd/job/pause.d.ts +0 -10
- package/dist/commands/cicd/job/pause.js.map +0 -1
- package/dist/commands/cicd/job/result-file/get.d.ts +0 -14
- package/dist/commands/cicd/job/result-file/get.js.map +0 -1
- package/dist/commands/cicd/job/result-file/list.d.ts +0 -10
- package/dist/commands/cicd/job/result-file/list.js.map +0 -1
- package/dist/commands/cicd/job/resume.d.ts +0 -10
- package/dist/commands/cicd/job/resume.js.map +0 -1
- package/dist/commands/cicd/job/run.d.ts +0 -13
- package/dist/commands/cicd/job/run.js.map +0 -1
- package/dist/commands/cicd/metadata/content/compare.d.ts +0 -40
- package/dist/commands/cicd/metadata/content/compare.js.map +0 -1
- package/dist/commands/cicd/metadata/content/get.d.ts +0 -39
- package/dist/commands/cicd/metadata/content/get.js.map +0 -1
- package/dist/commands/cicd/metadata/dependency/list.d.ts +0 -50
- package/dist/commands/cicd/metadata/dependency/list.js.map +0 -1
- package/dist/commands/cicd/metadata/index/compare.d.ts +0 -34
- package/dist/commands/cicd/metadata/index/compare.js.map +0 -1
- package/dist/commands/cicd/metadata/list.d.ts +0 -62
- package/dist/commands/cicd/metadata/list.js.map +0 -1
- package/dist/commands/cicd/metadata/refresh/deleted.d.ts +0 -13
- package/dist/commands/cicd/metadata/refresh/deleted.js.map +0 -1
- package/dist/commands/cicd/metadata/refresh/run.d.ts +0 -21
- package/dist/commands/cicd/metadata/refresh/run.js.map +0 -1
- package/dist/commands/cicd/metadata/refresh/status.d.ts +0 -12
- package/dist/commands/cicd/metadata/refresh/status.js.map +0 -1
- package/dist/commands/cicd/notification/configure.d.ts +0 -14
- package/dist/commands/cicd/notification/configure.js.map +0 -1
- package/dist/commands/cicd/pipeline/connection/create.d.ts +0 -19
- package/dist/commands/cicd/pipeline/connection/create.js.map +0 -1
- package/dist/commands/cicd/pipeline/connection/delete.d.ts +0 -15
- package/dist/commands/cicd/pipeline/connection/delete.js.map +0 -1
- package/dist/commands/cicd/pipeline/connection/list.d.ts +0 -10
- package/dist/commands/cicd/pipeline/connection/list.js.map +0 -1
- package/dist/commands/cicd/pipeline/connection/open.d.ts +0 -12
- package/dist/commands/cicd/pipeline/connection/open.js.map +0 -1
- package/dist/commands/cicd/pipeline/connection/update.d.ts +0 -19
- package/dist/commands/cicd/pipeline/connection/update.js.map +0 -1
- package/dist/commands/cicd/pipeline/create.d.ts +0 -19
- package/dist/commands/cicd/pipeline/create.js.map +0 -1
- package/dist/commands/cicd/pipeline/get.d.ts +0 -10
- package/dist/commands/cicd/pipeline/get.js.map +0 -1
- package/dist/commands/cicd/pipeline/list.d.ts +0 -15
- package/dist/commands/cicd/pipeline/list.js.map +0 -1
- package/dist/commands/cicd/pipeline/open.d.ts +0 -12
- package/dist/commands/cicd/pipeline/open.js.map +0 -1
- package/dist/commands/cicd/pipeline/stage-connection/create.d.ts +0 -12
- package/dist/commands/cicd/pipeline/stage-connection/create.js.map +0 -1
- package/dist/commands/cicd/pipeline/stage-connection/delete.d.ts +0 -16
- package/dist/commands/cicd/pipeline/stage-connection/delete.js.map +0 -1
- package/dist/commands/cicd/pipeline/stage-connection/list.d.ts +0 -10
- package/dist/commands/cicd/pipeline/stage-connection/list.js.map +0 -1
- package/dist/commands/cicd/pipeline/stage-connection/open.d.ts +0 -12
- package/dist/commands/cicd/pipeline/stage-connection/open.js.map +0 -1
- package/dist/commands/cicd/pipeline/stage-connection/update.d.ts +0 -15
- package/dist/commands/cicd/pipeline/stage-connection/update.js.map +0 -1
- package/dist/commands/cicd/pipeline/update.d.ts +0 -20
- package/dist/commands/cicd/pipeline/update.js.map +0 -1
- package/dist/commands/cicd/project/default/get.d.ts +0 -22
- package/dist/commands/cicd/project/default/get.js.map +0 -1
- package/dist/commands/cicd/project/default/set.d.ts +0 -22
- package/dist/commands/cicd/project/default/set.js.map +0 -1
- package/dist/commands/cicd/project/default/unset.d.ts +0 -22
- package/dist/commands/cicd/project/default/unset.js.map +0 -1
- package/dist/commands/cicd/project/get.d.ts +0 -10
- package/dist/commands/cicd/project/get.js.map +0 -1
- package/dist/commands/cicd/project/list.d.ts +0 -14
- package/dist/commands/cicd/project/list.js.map +0 -1
- package/dist/commands/cicd/project/open.d.ts +0 -12
- package/dist/commands/cicd/project/open.js.map +0 -1
- package/dist/commands/cicd/promotion/conflict/get.d.ts +0 -19
- package/dist/commands/cicd/promotion/conflict/get.js.map +0 -1
- package/dist/commands/cicd/promotion/conflict/list.d.ts +0 -10
- package/dist/commands/cicd/promotion/conflict/list.js.map +0 -1
- package/dist/commands/cicd/promotion/conflict/resolve.d.ts +0 -15
- package/dist/commands/cicd/promotion/conflict/resolve.js.map +0 -1
- package/dist/commands/cicd/promotion/conflict/unresolve.d.ts +0 -13
- package/dist/commands/cicd/promotion/conflict/unresolve.js.map +0 -1
- package/dist/commands/cicd/promotion/get.d.ts +0 -10
- package/dist/commands/cicd/promotion/get.js.map +0 -1
- package/dist/commands/cicd/promotion/list.d.ts +0 -33
- package/dist/commands/cicd/promotion/list.js.map +0 -1
- package/dist/commands/cicd/promotion/open.d.ts +0 -12
- package/dist/commands/cicd/promotion/open.js.map +0 -1
- package/dist/commands/cicd/promotion/run.d.ts +0 -23
- package/dist/commands/cicd/promotion/run.js.map +0 -1
- package/dist/commands/cicd/repository/create.d.ts +0 -25
- package/dist/commands/cicd/repository/create.js.map +0 -1
- package/dist/commands/cicd/repository/delete.d.ts +0 -11
- package/dist/commands/cicd/repository/delete.js.map +0 -1
- package/dist/commands/cicd/repository/get.d.ts +0 -10
- package/dist/commands/cicd/repository/get.js.map +0 -1
- package/dist/commands/cicd/repository/list.d.ts +0 -15
- package/dist/commands/cicd/repository/list.js.map +0 -1
- package/dist/commands/cicd/repository/open.d.ts +0 -12
- package/dist/commands/cicd/repository/open.js.map +0 -1
- package/dist/commands/cicd/repository/reset.d.ts +0 -12
- package/dist/commands/cicd/repository/reset.js.map +0 -1
- package/dist/commands/cicd/repository/update.d.ts +0 -34
- package/dist/commands/cicd/repository/update.js.map +0 -1
- package/dist/commands/cicd/repository/validate.d.ts +0 -10
- package/dist/commands/cicd/repository/validate.js.map +0 -1
- package/dist/commands/cicd/stage/create.d.ts +0 -14
- package/dist/commands/cicd/stage/create.js.map +0 -1
- package/dist/commands/cicd/stage/delete.d.ts +0 -14
- package/dist/commands/cicd/stage/delete.js.map +0 -1
- package/dist/commands/cicd/stage/get.d.ts +0 -10
- package/dist/commands/cicd/stage/get.js.map +0 -1
- package/dist/commands/cicd/stage/list.d.ts +0 -12
- package/dist/commands/cicd/stage/list.js.map +0 -1
- package/dist/commands/cicd/stage/open.d.ts +0 -12
- package/dist/commands/cicd/stage/open.js.map +0 -1
- package/dist/commands/cicd/stage/update.d.ts +0 -14
- package/dist/commands/cicd/stage/update.js.map +0 -1
- package/dist/commands/cicd/user/get.d.ts +0 -10
- package/dist/commands/cicd/user/get.js.map +0 -1
- package/dist/commands/cicd/work/commit.d.ts +0 -33
- package/dist/commands/cicd/work/commit.js.map +0 -1
- package/dist/commands/cicd/work/create.d.ts +0 -35
- package/dist/commands/cicd/work/create.js.map +0 -1
- package/dist/commands/cicd/work/delete.d.ts +0 -11
- package/dist/commands/cicd/work/delete.js.map +0 -1
- package/dist/commands/cicd/work/deployment-step/create.d.ts +0 -34
- package/dist/commands/cicd/work/deployment-step/create.js.map +0 -1
- package/dist/commands/cicd/work/deployment-step/delete.d.ts +0 -15
- package/dist/commands/cicd/work/deployment-step/delete.js.map +0 -1
- package/dist/commands/cicd/work/deployment-step/list.d.ts +0 -10
- package/dist/commands/cicd/work/deployment-step/list.js.map +0 -1
- package/dist/commands/cicd/work/deployment-step/reorder.d.ts +0 -12
- package/dist/commands/cicd/work/deployment-step/reorder.js.map +0 -1
- package/dist/commands/cicd/work/deployment-step/salesforce-flows.d.ts +0 -7
- package/dist/commands/cicd/work/deployment-step/salesforce-flows.js.map +0 -1
- package/dist/commands/cicd/work/deployment-step/types.d.ts +0 -7
- package/dist/commands/cicd/work/deployment-step/types.js.map +0 -1
- package/dist/commands/cicd/work/deployment-step/update.d.ts +0 -20
- package/dist/commands/cicd/work/deployment-step/update.js.map +0 -1
- package/dist/commands/cicd/work/done.d.ts +0 -14
- package/dist/commands/cicd/work/done.js.map +0 -1
- package/dist/commands/cicd/work/get.d.ts +0 -10
- package/dist/commands/cicd/work/get.js.map +0 -1
- package/dist/commands/cicd/work/list.d.ts +0 -23
- package/dist/commands/cicd/work/list.js.map +0 -1
- package/dist/commands/cicd/work/open.d.ts +0 -12
- package/dist/commands/cicd/work/open.js.map +0 -1
- package/dist/commands/cicd/work/promote.d.ts +0 -25
- package/dist/commands/cicd/work/promote.js.map +0 -1
- package/dist/commands/cicd/work/publish.d.ts +0 -12
- package/dist/commands/cicd/work/publish.js.map +0 -1
- package/dist/commands/cicd/work/push.d.ts +0 -16
- package/dist/commands/cicd/work/push.js.map +0 -1
- package/dist/commands/cicd/work/set.d.ts +0 -16
- package/dist/commands/cicd/work/set.js.map +0 -1
- package/dist/commands/cicd/work/status.d.ts +0 -14
- package/dist/commands/cicd/work/status.js.map +0 -1
- package/dist/commands/cicd/work/submit.d.ts +0 -17
- package/dist/commands/cicd/work/submit.js.map +0 -1
- package/dist/commands/cicd/work/test/apex.d.ts +0 -11
- package/dist/commands/cicd/work/test/apex.js.map +0 -1
- package/dist/commands/cicd/work/test.d.ts +0 -15
- package/dist/commands/cicd/work/test.js.map +0 -1
- package/dist/commands/cicd/work/update.d.ts +0 -38
- package/dist/commands/cicd/work/update.js.map +0 -1
- package/dist/commands/mcp/start.d.ts +0 -7
- package/dist/commands/mcp/start.js.map +0 -1
- package/dist/commands/setup/skills/create.d.ts +0 -15
- package/dist/commands/setup/skills/create.js.map +0 -1
- package/dist/commands/setup/skills/update.d.ts +0 -15
- package/dist/commands/setup/skills/update.js.map +0 -1
- package/dist/commands/setup.d.ts +0 -15
- package/dist/commands/setup.js.map +0 -1
- package/dist/commands/testing/build/abort.d.ts +0 -29
- package/dist/commands/testing/build/abort.js.map +0 -1
- package/dist/commands/testing/build/get.d.ts +0 -18
- package/dist/commands/testing/build/get.js.map +0 -1
- package/dist/commands/testing/build/latest.d.ts +0 -12
- package/dist/commands/testing/build/latest.js.map +0 -1
- package/dist/commands/testing/build/list.d.ts +0 -18
- package/dist/commands/testing/build/list.js.map +0 -1
- package/dist/commands/testing/build/logs.d.ts +0 -24
- package/dist/commands/testing/build/logs.js.map +0 -1
- package/dist/commands/testing/build/run.d.ts +0 -47
- package/dist/commands/testing/build/run.js.map +0 -1
- package/dist/commands/testing/build/search.d.ts +0 -21
- package/dist/commands/testing/build/search.js.map +0 -1
- package/dist/commands/testing/create.d.ts +0 -1
- package/dist/commands/testing/create.js.map +0 -1
- package/dist/commands/testing/data-table/create.d.ts +0 -30
- package/dist/commands/testing/data-table/create.js.map +0 -1
- package/dist/commands/testing/data-table/delete.d.ts +0 -25
- package/dist/commands/testing/data-table/delete.js.map +0 -1
- package/dist/commands/testing/data-table/export.d.ts +0 -33
- package/dist/commands/testing/data-table/export.js.map +0 -1
- package/dist/commands/testing/data-table/get.d.ts +0 -21
- package/dist/commands/testing/data-table/get.js.map +0 -1
- package/dist/commands/testing/data-table/list.d.ts +0 -16
- package/dist/commands/testing/data-table/list.js.map +0 -1
- package/dist/commands/testing/data-table/update.d.ts +0 -34
- package/dist/commands/testing/data-table/update.js.map +0 -1
- package/dist/commands/testing/job/create.d.ts +0 -40
- package/dist/commands/testing/job/create.js.map +0 -1
- package/dist/commands/testing/job/delete.d.ts +0 -26
- package/dist/commands/testing/job/delete.js.map +0 -1
- package/dist/commands/testing/job/download.d.ts +0 -19
- package/dist/commands/testing/job/download.js.map +0 -1
- package/dist/commands/testing/job/files.d.ts +0 -16
- package/dist/commands/testing/job/files.js.map +0 -1
- package/dist/commands/testing/job/get.d.ts +0 -13
- package/dist/commands/testing/job/get.js.map +0 -1
- package/dist/commands/testing/job/list.d.ts +0 -11
- package/dist/commands/testing/job/list.js.map +0 -1
- package/dist/commands/testing/job/refs.d.ts +0 -17
- package/dist/commands/testing/job/refs.js.map +0 -1
- package/dist/commands/testing/job/run.d.ts +0 -1
- package/dist/commands/testing/job/run.js.map +0 -1
- package/dist/commands/testing/job/schedule/get.d.ts +0 -23
- package/dist/commands/testing/job/schedule/get.js.map +0 -1
- package/dist/commands/testing/job/schedule/remove.d.ts +0 -24
- package/dist/commands/testing/job/schedule/remove.js.map +0 -1
- package/dist/commands/testing/job/schedule/set.d.ts +0 -23
- package/dist/commands/testing/job/schedule/set.js.map +0 -1
- package/dist/commands/testing/job/update.d.ts +0 -41
- package/dist/commands/testing/job/update.js.map +0 -1
- package/dist/commands/testing/job/upload.d.ts +0 -32
- package/dist/commands/testing/job/upload.js.map +0 -1
- package/dist/commands/testing/live/continue.d.ts +0 -20
- package/dist/commands/testing/live/continue.js.map +0 -1
- package/dist/commands/testing/live/execute.d.ts +0 -30
- package/dist/commands/testing/live/execute.js.map +0 -1
- package/dist/commands/testing/live/history.d.ts +0 -23
- package/dist/commands/testing/live/history.js.map +0 -1
- package/dist/commands/testing/live/inspect.d.ts +0 -18
- package/dist/commands/testing/live/inspect.js.map +0 -1
- package/dist/commands/testing/live/interrupt.d.ts +0 -20
- package/dist/commands/testing/live/interrupt.js.map +0 -1
- package/dist/commands/testing/live/recorder.d.ts +0 -23
- package/dist/commands/testing/live/recorder.js.map +0 -1
- package/dist/commands/testing/live/reports.d.ts +0 -20
- package/dist/commands/testing/live/reports.js.map +0 -1
- package/dist/commands/testing/live/screenshot.d.ts +0 -23
- package/dist/commands/testing/live/screenshot.js.map +0 -1
- package/dist/commands/testing/live/set-options.d.ts +0 -27
- package/dist/commands/testing/live/set-options.js.map +0 -1
- package/dist/commands/testing/live/start.d.ts +0 -29
- package/dist/commands/testing/live/start.js.map +0 -1
- package/dist/commands/testing/live/status.d.ts +0 -19
- package/dist/commands/testing/live/status.js.map +0 -1
- package/dist/commands/testing/live/stop.d.ts +0 -24
- package/dist/commands/testing/live/stop.js.map +0 -1
- package/dist/commands/testing/live/view.d.ts +0 -16
- package/dist/commands/testing/live/view.js.map +0 -1
- package/dist/commands/testing/logs.d.ts +0 -24
- package/dist/commands/testing/logs.js.map +0 -1
- package/dist/commands/testing/project/create.d.ts +0 -14
- package/dist/commands/testing/project/create.js.map +0 -1
- package/dist/commands/testing/project/delete.d.ts +0 -23
- package/dist/commands/testing/project/delete.js.map +0 -1
- package/dist/commands/testing/project/get.d.ts +0 -11
- package/dist/commands/testing/project/get.js.map +0 -1
- package/dist/commands/testing/project/list.d.ts +0 -10
- package/dist/commands/testing/project/list.js.map +0 -1
- package/dist/commands/testing/project/permission/get.d.ts +0 -13
- package/dist/commands/testing/project/permission/get.js.map +0 -1
- package/dist/commands/testing/project/permission/list.d.ts +0 -13
- package/dist/commands/testing/project/permission/list.js.map +0 -1
- package/dist/commands/testing/project/permission/set.d.ts +0 -19
- package/dist/commands/testing/project/permission/set.js.map +0 -1
- package/dist/commands/testing/project/permission/update.d.ts +0 -19
- package/dist/commands/testing/project/permission/update.js.map +0 -1
- package/dist/commands/testing/project/update.d.ts +0 -14
- package/dist/commands/testing/project/update.js.map +0 -1
- package/dist/commands/testing/robot/create.d.ts +0 -19
- package/dist/commands/testing/robot/create.js.map +0 -1
- package/dist/commands/testing/robot/delete.d.ts +0 -23
- package/dist/commands/testing/robot/delete.js.map +0 -1
- package/dist/commands/testing/robot/get.d.ts +0 -13
- package/dist/commands/testing/robot/get.js.map +0 -1
- package/dist/commands/testing/robot/list.d.ts +0 -10
- package/dist/commands/testing/robot/list.js.map +0 -1
- package/dist/commands/testing/robot/update.d.ts +0 -19
- package/dist/commands/testing/robot/update.js.map +0 -1
- package/dist/commands/testing/run.d.ts +0 -47
- package/dist/commands/testing/run.js.map +0 -1
- package/dist/commands/testing/status.d.ts +0 -13
- package/dist/commands/testing/status.js.map +0 -1
- package/dist/commands/testing/test/create.d.ts +0 -1
- package/dist/commands/testing/test/create.js.map +0 -1
- package/dist/commands/testing/test/logs.d.ts +0 -1
- package/dist/commands/testing/test/logs.js.map +0 -1
- package/dist/commands/testing/test/run.d.ts +0 -47
- package/dist/commands/testing/test/run.js.map +0 -1
- package/dist/commands/testing/test/status.d.ts +0 -1
- package/dist/commands/testing/test/status.js.map +0 -1
- package/dist/commands/testing/test/update.d.ts +0 -1
- package/dist/commands/testing/test/update.js.map +0 -1
- package/dist/commands/testing/update.d.ts +0 -32
- package/dist/commands/testing/update.js.map +0 -1
- package/dist/commands/testing/user-parameter/create.d.ts +0 -19
- package/dist/commands/testing/user-parameter/create.js.map +0 -1
- package/dist/commands/testing/user-parameter/delete.d.ts +0 -21
- package/dist/commands/testing/user-parameter/delete.js.map +0 -1
- package/dist/commands/testing/user-parameter/get.d.ts +0 -13
- package/dist/commands/testing/user-parameter/get.js.map +0 -1
- package/dist/commands/testing/user-parameter/list.d.ts +0 -12
- package/dist/commands/testing/user-parameter/list.js.map +0 -1
- package/dist/commands/testing/user-parameter/update.d.ts +0 -23
- package/dist/commands/testing/user-parameter/update.js.map +0 -1
- package/dist/commands/testing/variable/create.d.ts +0 -21
- package/dist/commands/testing/variable/create.js.map +0 -1
- package/dist/commands/testing/variable/delete.d.ts +0 -21
- package/dist/commands/testing/variable/delete.js.map +0 -1
- package/dist/commands/testing/variable/get.d.ts +0 -13
- package/dist/commands/testing/variable/get.js.map +0 -1
- package/dist/commands/testing/variable/list.d.ts +0 -16
- package/dist/commands/testing/variable/list.js.map +0 -1
- package/dist/commands/testing/variable/update.d.ts +0 -22
- package/dist/commands/testing/variable/update.js.map +0 -1
- package/dist/commands/update.d.ts +0 -10
- package/dist/commands/update.js.map +0 -1
- package/dist/hooks/finally/ide-command-event.d.ts +0 -3
- package/dist/hooks/finally/ide-command-event.js.map +0 -1
- package/dist/hooks/init/migrate-user-config.d.ts +0 -3
- package/dist/hooks/init/migrate-user-config.js.map +0 -1
- package/dist/hooks/init/version-warning.d.ts +0 -3
- package/dist/hooks/init/version-warning.js.map +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/agentia-command.d.ts +0 -15
- package/dist/lib/agentia-command.js.map +0 -1
- package/dist/lib/agentia-oauth-error-codes.d.ts +0 -17
- package/dist/lib/agentia-oauth-error-codes.js.map +0 -1
- package/dist/lib/ai-chat-session.d.ts +0 -18
- package/dist/lib/ai-chat-session.js.map +0 -1
- package/dist/lib/ai-config.d.ts +0 -29
- package/dist/lib/ai-config.js.map +0 -1
- package/dist/lib/ai-flags.d.ts +0 -8
- package/dist/lib/ai-flags.js.map +0 -1
- package/dist/lib/ai-gateway.d.ts +0 -56
- package/dist/lib/ai-gateway.js.map +0 -1
- package/dist/lib/ai-operations.d.ts +0 -28
- package/dist/lib/ai-operations.js.map +0 -1
- package/dist/lib/ai-stream-parser.d.ts +0 -12
- package/dist/lib/ai-stream-parser.js.map +0 -1
- package/dist/lib/ai-terminal-renderer.d.ts +0 -17
- package/dist/lib/ai-terminal-renderer.js.map +0 -1
- package/dist/lib/ai-types.d.ts +0 -157
- package/dist/lib/ai-types.js.map +0 -1
- package/dist/lib/assert.d.ts +0 -1
- package/dist/lib/assert.js.map +0 -1
- package/dist/lib/auth-config.d.ts +0 -92
- package/dist/lib/auth-config.js.map +0 -1
- package/dist/lib/auth-profile.d.ts +0 -25
- package/dist/lib/auth-profile.js.map +0 -1
- package/dist/lib/cicd-gateway.d.ts +0 -166
- package/dist/lib/cicd-gateway.js.map +0 -1
- package/dist/lib/cicd-region.d.ts +0 -4
- package/dist/lib/cicd-region.js.map +0 -1
- package/dist/lib/cli-update.d.ts +0 -29
- package/dist/lib/cli-update.js.map +0 -1
- package/dist/lib/cli-version.d.ts +0 -30
- package/dist/lib/cli-version.js.map +0 -1
- package/dist/lib/command-output-buffer.d.ts +0 -31
- package/dist/lib/command-output-buffer.js.map +0 -1
- package/dist/lib/credential-store.d.ts +0 -47
- package/dist/lib/credential-store.js.map +0 -1
- package/dist/lib/credential-sync.d.ts +0 -41
- package/dist/lib/credential-sync.js.map +0 -1
- package/dist/lib/cursor-mcp-config.d.ts +0 -62
- package/dist/lib/cursor-mcp-config.js.map +0 -1
- package/dist/lib/data-flags.d.ts +0 -14
- package/dist/lib/data-flags.js.map +0 -1
- package/dist/lib/data-types.d.ts +0 -325
- package/dist/lib/data-types.js.map +0 -1
- package/dist/lib/debug.d.ts +0 -3
- package/dist/lib/debug.js.map +0 -1
- package/dist/lib/defaults-store.d.ts +0 -95
- package/dist/lib/defaults-store.js.map +0 -1
- package/dist/lib/dependency-from-changes.d.ts +0 -12
- package/dist/lib/dependency-from-changes.js.map +0 -1
- package/dist/lib/deployment-step-config.d.ts +0 -27
- package/dist/lib/deployment-step-config.js.map +0 -1
- package/dist/lib/deployment-step-types.d.ts +0 -104
- package/dist/lib/deployment-step-types.js.map +0 -1
- package/dist/lib/deployment-step-wizard.d.ts +0 -28
- package/dist/lib/deployment-step-wizard.js.map +0 -1
- package/dist/lib/env-file.d.ts +0 -5
- package/dist/lib/env-file.js.map +0 -1
- package/dist/lib/environment-auth-status.d.ts +0 -18
- package/dist/lib/environment-auth-status.js.map +0 -1
- package/dist/lib/environment-auth.d.ts +0 -26
- package/dist/lib/environment-auth.js.map +0 -1
- package/dist/lib/environment-credential-flags.d.ts +0 -29
- package/dist/lib/environment-credential-flags.js.map +0 -1
- package/dist/lib/environment-credential-operations.d.ts +0 -19
- package/dist/lib/environment-credential-operations.js.map +0 -1
- package/dist/lib/environment-credential-selection.d.ts +0 -15
- package/dist/lib/environment-credential-selection.js.map +0 -1
- package/dist/lib/environment-flags.d.ts +0 -93
- package/dist/lib/environment-flags.js.map +0 -1
- package/dist/lib/environment-types.d.ts +0 -105
- package/dist/lib/environment-types.js.map +0 -1
- package/dist/lib/format.d.ts +0 -10
- package/dist/lib/format.js.map +0 -1
- package/dist/lib/function-flags.d.ts +0 -69
- package/dist/lib/function-flags.js.map +0 -1
- package/dist/lib/function-local-run.d.ts +0 -64
- package/dist/lib/function-local-run.js.map +0 -1
- package/dist/lib/function-types.d.ts +0 -120
- package/dist/lib/function-types.js.map +0 -1
- package/dist/lib/git-worktree.d.ts +0 -83
- package/dist/lib/git-worktree.js.map +0 -1
- package/dist/lib/ide-command-events.d.ts +0 -72
- package/dist/lib/ide-command-events.js.map +0 -1
- package/dist/lib/job-types.d.ts +0 -125
- package/dist/lib/job-types.js.map +0 -1
- package/dist/lib/list-pagination.d.ts +0 -46
- package/dist/lib/list-pagination.js.map +0 -1
- package/dist/lib/local-gateway-config.d.ts +0 -21
- package/dist/lib/local-gateway-config.js.map +0 -1
- package/dist/lib/local-metadata-paths.d.ts +0 -6
- package/dist/lib/local-metadata-paths.js.map +0 -1
- package/dist/lib/local-quality-gates.d.ts +0 -53
- package/dist/lib/local-quality-gates.js.map +0 -1
- package/dist/lib/loopback-callback-server.d.ts +0 -36
- package/dist/lib/loopback-callback-server.js.map +0 -1
- package/dist/lib/mcp/ai-tools.d.ts +0 -21
- package/dist/lib/mcp/ai-tools.js.map +0 -1
- package/dist/lib/mcp/command-id.d.ts +0 -4
- package/dist/lib/mcp/command-id.js.map +0 -1
- package/dist/lib/mcp/data-tools.d.ts +0 -156
- package/dist/lib/mcp/data-tools.js.map +0 -1
- package/dist/lib/mcp/deployment-step-tools.d.ts +0 -82
- package/dist/lib/mcp/deployment-step-tools.js.map +0 -1
- package/dist/lib/mcp/redaction.d.ts +0 -1
- package/dist/lib/mcp/redaction.js.map +0 -1
- package/dist/lib/mcp/request-context.d.ts +0 -2
- package/dist/lib/mcp/request-context.js.map +0 -1
- package/dist/lib/mcp/result.d.ts +0 -44
- package/dist/lib/mcp/result.js.map +0 -1
- package/dist/lib/mcp/server.d.ts +0 -5
- package/dist/lib/mcp/server.js.map +0 -1
- package/dist/lib/mcp/testing-live-tools.d.ts +0 -126
- package/dist/lib/mcp/testing-live-tools.js.map +0 -1
- package/dist/lib/mcp/testing-tools.d.ts +0 -699
- package/dist/lib/mcp/testing-tools.js.map +0 -1
- package/dist/lib/mcp/tools.d.ts +0 -1965
- package/dist/lib/mcp/tools.js.map +0 -1
- package/dist/lib/mcp/work-tools.d.ts +0 -183
- package/dist/lib/mcp/work-tools.js.map +0 -1
- package/dist/lib/metadata-common.d.ts +0 -175
- package/dist/lib/metadata-common.js.map +0 -1
- package/dist/lib/metadata-refresh.d.ts +0 -68
- package/dist/lib/metadata-refresh.js.map +0 -1
- package/dist/lib/navigation-open.d.ts +0 -7
- package/dist/lib/navigation-open.js.map +0 -1
- package/dist/lib/navigation.d.ts +0 -14
- package/dist/lib/navigation.js.map +0 -1
- package/dist/lib/nested-metadata-changes.d.ts +0 -88
- package/dist/lib/nested-metadata-changes.js.map +0 -1
- package/dist/lib/nested-metadata-registry.d.ts +0 -36
- package/dist/lib/nested-metadata-registry.js.map +0 -1
- package/dist/lib/notifications-configure.d.ts +0 -34
- package/dist/lib/notifications-configure.js.map +0 -1
- package/dist/lib/open-browser.d.ts +0 -11
- package/dist/lib/open-browser.js.map +0 -1
- package/dist/lib/pipeline-connection-flags.d.ts +0 -62
- package/dist/lib/pipeline-connection-flags.js.map +0 -1
- package/dist/lib/pipeline-flags.d.ts +0 -74
- package/dist/lib/pipeline-flags.js.map +0 -1
- package/dist/lib/pipeline-stage-connection-flags.d.ts +0 -25
- package/dist/lib/pipeline-stage-connection-flags.js.map +0 -1
- package/dist/lib/pipeline-types.d.ts +0 -178
- package/dist/lib/pipeline-types.js.map +0 -1
- package/dist/lib/project-default-flags.d.ts +0 -43
- package/dist/lib/project-default-flags.js.map +0 -1
- package/dist/lib/project-default-id.d.ts +0 -4
- package/dist/lib/project-default-id.js.map +0 -1
- package/dist/lib/project-defaults.d.ts +0 -24
- package/dist/lib/project-defaults.js.map +0 -1
- package/dist/lib/project-flags.d.ts +0 -11
- package/dist/lib/project-flags.js.map +0 -1
- package/dist/lib/project-setup.d.ts +0 -90
- package/dist/lib/project-setup.js.map +0 -1
- package/dist/lib/project-types.d.ts +0 -39
- package/dist/lib/project-types.js.map +0 -1
- package/dist/lib/promotion-conflicts.d.ts +0 -40
- package/dist/lib/promotion-conflicts.js.map +0 -1
- package/dist/lib/promotion-flags.d.ts +0 -23
- package/dist/lib/promotion-flags.js.map +0 -1
- package/dist/lib/promotion-run.d.ts +0 -105
- package/dist/lib/promotion-run.js.map +0 -1
- package/dist/lib/promotion-types.d.ts +0 -192
- package/dist/lib/promotion-types.js.map +0 -1
- package/dist/lib/repository-flags.d.ts +0 -131
- package/dist/lib/repository-flags.js.map +0 -1
- package/dist/lib/repository-types.d.ts +0 -99
- package/dist/lib/repository-types.js.map +0 -1
- package/dist/lib/salesforce-id.d.ts +0 -11
- package/dist/lib/salesforce-id.js.map +0 -1
- package/dist/lib/sdr-metadata-registry.generated.d.ts +0 -18
- package/dist/lib/sdr-metadata-registry.generated.js.map +0 -1
- package/dist/lib/sdr-path-resolver.d.ts +0 -7
- package/dist/lib/sdr-path-resolver.js.map +0 -1
- package/dist/lib/secret-redaction.d.ts +0 -2
- package/dist/lib/secret-redaction.js.map +0 -1
- package/dist/lib/setup-prompts.d.ts +0 -38
- package/dist/lib/setup-prompts.js.map +0 -1
- package/dist/lib/setup-skills.d.ts +0 -83
- package/dist/lib/setup-skills.js.map +0 -1
- package/dist/lib/setup-templates.d.ts +0 -10
- package/dist/lib/setup-templates.js.map +0 -1
- package/dist/lib/setup-wizard.d.ts +0 -46
- package/dist/lib/setup-wizard.js.map +0 -1
- package/dist/lib/sf-org-context.d.ts +0 -13
- package/dist/lib/sf-org-context.js.map +0 -1
- package/dist/lib/stage-flags.d.ts +0 -19
- package/dist/lib/stage-flags.js.map +0 -1
- package/dist/lib/stage-types.d.ts +0 -67
- package/dist/lib/stage-types.js.map +0 -1
- package/dist/lib/stock-quality-gates.d.ts +0 -12
- package/dist/lib/stock-quality-gates.js.map +0 -1
- package/dist/lib/testing-config.d.ts +0 -44
- package/dist/lib/testing-config.js.map +0 -1
- package/dist/lib/testing-confirmation.d.ts +0 -14
- package/dist/lib/testing-confirmation.js.map +0 -1
- package/dist/lib/testing-data-command.d.ts +0 -21
- package/dist/lib/testing-data-command.js.map +0 -1
- package/dist/lib/testing-data-core.d.ts +0 -22
- package/dist/lib/testing-data-core.js.map +0 -1
- package/dist/lib/testing-data-export.d.ts +0 -1
- package/dist/lib/testing-data-export.js.map +0 -1
- package/dist/lib/testing-data-import.d.ts +0 -1
- package/dist/lib/testing-data-import.js.map +0 -1
- package/dist/lib/testing-data-io.d.ts +0 -21
- package/dist/lib/testing-data-io.js.map +0 -1
- package/dist/lib/testing-data-operations.d.ts +0 -36
- package/dist/lib/testing-data-operations.js.map +0 -1
- package/dist/lib/testing-data-types.d.ts +0 -41
- package/dist/lib/testing-data-types.js.map +0 -1
- package/dist/lib/testing-flags.d.ts +0 -117
- package/dist/lib/testing-flags.js.map +0 -1
- package/dist/lib/testing-gateway.d.ts +0 -60
- package/dist/lib/testing-gateway.js.map +0 -1
- package/dist/lib/testing-live-command.d.ts +0 -24
- package/dist/lib/testing-live-command.js.map +0 -1
- package/dist/lib/testing-live-endpoints.d.ts +0 -14
- package/dist/lib/testing-live-endpoints.js.map +0 -1
- package/dist/lib/testing-live-history.d.ts +0 -11
- package/dist/lib/testing-live-history.js.map +0 -1
- package/dist/lib/testing-live-operations.d.ts +0 -118
- package/dist/lib/testing-live-operations.js.map +0 -1
- package/dist/lib/testing-live-recorder.d.ts +0 -14
- package/dist/lib/testing-live-recorder.js.map +0 -1
- package/dist/lib/testing-live-robot.d.ts +0 -16
- package/dist/lib/testing-live-robot.js.map +0 -1
- package/dist/lib/testing-live-state.d.ts +0 -4
- package/dist/lib/testing-live-state.js.map +0 -1
- package/dist/lib/testing-live-types.d.ts +0 -92
- package/dist/lib/testing-live-types.js.map +0 -1
- package/dist/lib/testing-operations.d.ts +0 -354
- package/dist/lib/testing-operations.js.map +0 -1
- package/dist/lib/testing-run-command.d.ts +0 -25
- package/dist/lib/testing-run-command.js.map +0 -1
- package/dist/lib/testing-sanitization.d.ts +0 -11
- package/dist/lib/testing-sanitization.js.map +0 -1
- package/dist/lib/testing-schedule.d.ts +0 -23
- package/dist/lib/testing-schedule.js.map +0 -1
- package/dist/lib/testing-secret-input.d.ts +0 -12
- package/dist/lib/testing-secret-input.js.map +0 -1
- package/dist/lib/testing-session.d.ts +0 -8
- package/dist/lib/testing-session.js.map +0 -1
- package/dist/lib/testing-types.d.ts +0 -340
- package/dist/lib/testing-types.js.map +0 -1
- package/dist/lib/testing-watch.d.ts +0 -4
- package/dist/lib/testing-watch.js.map +0 -1
- package/dist/lib/user-context-types.d.ts +0 -12
- package/dist/lib/user-context-types.js.map +0 -1
- package/dist/lib/user-context.d.ts +0 -7
- package/dist/lib/user-context.js.map +0 -1
- package/dist/lib/user-types.d.ts +0 -9
- package/dist/lib/user-types.js.map +0 -1
- package/dist/lib/var-replacement.d.ts +0 -47
- package/dist/lib/var-replacement.js.map +0 -1
- package/dist/lib/version-refresh.d.ts +0 -1
- package/dist/lib/version-refresh.js.map +0 -1
- package/dist/lib/version-warning.d.ts +0 -29
- package/dist/lib/version-warning.js.map +0 -1
- package/dist/lib/work-active.d.ts +0 -4
- package/dist/lib/work-active.js.map +0 -1
- package/dist/lib/work-apex-test.d.ts +0 -56
- package/dist/lib/work-apex-test.js.map +0 -1
- package/dist/lib/work-branch-metadata.d.ts +0 -13
- package/dist/lib/work-branch-metadata.js.map +0 -1
- package/dist/lib/work-commit.d.ts +0 -120
- package/dist/lib/work-commit.js.map +0 -1
- package/dist/lib/work-defaults.d.ts +0 -10
- package/dist/lib/work-defaults.js.map +0 -1
- package/dist/lib/work-done.d.ts +0 -22
- package/dist/lib/work-done.js.map +0 -1
- package/dist/lib/work-flags.d.ts +0 -126
- package/dist/lib/work-flags.js.map +0 -1
- package/dist/lib/work-local-commit.d.ts +0 -42
- package/dist/lib/work-local-commit.js.map +0 -1
- package/dist/lib/work-local-run-tests.d.ts +0 -25
- package/dist/lib/work-local-run-tests.js.map +0 -1
- package/dist/lib/work-publish-command.d.ts +0 -26
- package/dist/lib/work-publish-command.js.map +0 -1
- package/dist/lib/work-push.d.ts +0 -112
- package/dist/lib/work-push.js.map +0 -1
- package/dist/lib/work-set-none.d.ts +0 -14
- package/dist/lib/work-set-none.js.map +0 -1
- package/dist/lib/work-set-selection.d.ts +0 -15
- package/dist/lib/work-set-selection.js.map +0 -1
- package/dist/lib/work-types.d.ts +0 -344
- package/dist/lib/work-types.js.map +0 -1
- package/dist/lib/yaml-replacement.d.ts +0 -42
- package/dist/lib/yaml-replacement.js.map +0 -1
package/dist/lib/cicd-gateway.js
CHANGED
|
@@ -1,834 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
return gatewayTransactionStore.getStore()?.origin ?? 'cli';
|
|
46
|
-
}
|
|
47
|
-
export function resolveCicdRequestTimeoutMs(options = {}) {
|
|
48
|
-
if (options.timeoutMs !== undefined) {
|
|
49
|
-
return options.timeoutMs;
|
|
50
|
-
}
|
|
51
|
-
if (getGatewayClientOrigin() !== 'mcp') {
|
|
52
|
-
return undefined;
|
|
53
|
-
}
|
|
54
|
-
const configuredTimeout = Number.parseInt(process.env[CICD_ENV.mcpRequestTimeoutMs] ?? '', 10);
|
|
55
|
-
return Number.isFinite(configuredTimeout) && configuredTimeout > 0
|
|
56
|
-
? configuredTimeout
|
|
57
|
-
: MCP_CICD_DEFAULT_REQUEST_TIMEOUT_MS;
|
|
58
|
-
}
|
|
59
|
-
function gatewayProductName() {
|
|
60
|
-
switch (getGatewayClientOrigin()) {
|
|
61
|
-
case 'ide': {
|
|
62
|
-
return 'agentia-ide';
|
|
63
|
-
}
|
|
64
|
-
case 'mcp': {
|
|
65
|
-
return 'agentia-mcp';
|
|
66
|
-
}
|
|
67
|
-
default: {
|
|
68
|
-
return 'agentia-cli';
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
function ideVersion() {
|
|
73
|
-
if (getGatewayClientOrigin() !== 'ide') {
|
|
74
|
-
return undefined;
|
|
75
|
-
}
|
|
76
|
-
const version = process.env[AGENTIA_IDE_VERSION_ENV]?.trim();
|
|
77
|
-
return version !== undefined && /^[0-9A-Za-z.-]{1,64}$/u.test(version) ? version : undefined;
|
|
78
|
-
}
|
|
79
|
-
export function gatewayRefererHeaders() {
|
|
80
|
-
const referer = getGatewayReferer();
|
|
81
|
-
return referer === undefined ? {} : { Referer: referer };
|
|
82
|
-
}
|
|
83
|
-
export function runWithGatewayTransactionContext(context, fn) {
|
|
84
|
-
const store = typeof context === 'string' ? { transactionId: context } : context;
|
|
85
|
-
return gatewayTransactionStore.run(store, fn);
|
|
86
|
-
}
|
|
87
|
-
function transactionIdForGatewayRequest() {
|
|
88
|
-
const active = getGatewayTransactionId();
|
|
89
|
-
return active ?? createTransactionId();
|
|
90
|
-
}
|
|
91
|
-
export class CicdGatewayError extends Error {
|
|
92
|
-
categories;
|
|
93
|
-
code;
|
|
94
|
-
jobId;
|
|
95
|
-
requestMethod;
|
|
96
|
-
requestUrl;
|
|
97
|
-
retryAfterSeconds;
|
|
98
|
-
statusCode;
|
|
99
|
-
constructor(message, options = {}) {
|
|
100
|
-
super(message);
|
|
101
|
-
this.name = 'CicdGatewayError';
|
|
102
|
-
this.categories = options.categories ?? [];
|
|
103
|
-
this.code = options.code;
|
|
104
|
-
this.jobId = options.jobId;
|
|
105
|
-
this.requestMethod = options.request?.method;
|
|
106
|
-
this.requestUrl =
|
|
107
|
-
options.request?.url !== undefined && options.request.url.trim().length > 0
|
|
108
|
-
? maskUrlSecrets(options.request.url)
|
|
109
|
-
: undefined;
|
|
110
|
-
this.retryAfterSeconds = options.retryAfterSeconds;
|
|
111
|
-
this.statusCode = options.statusCode;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
export function gatewayUserAgent() {
|
|
115
|
-
const productName = gatewayProductName();
|
|
116
|
-
const version = ideVersion();
|
|
117
|
-
if (productName === 'agentia-ide' && version !== undefined) {
|
|
118
|
-
return `${productName}/${version} (agentia-cli/${packageJson.version})`;
|
|
119
|
-
}
|
|
120
|
-
return `${productName}/${packageJson.version}`;
|
|
121
|
-
}
|
|
122
|
-
export function gatewayEventSource() {
|
|
123
|
-
return gatewayProductName();
|
|
124
|
-
}
|
|
125
|
-
export function createTransactionId() {
|
|
126
|
-
return uuidv7();
|
|
127
|
-
}
|
|
128
|
-
export const GATEWAY_EVENT_API_CALL = 'api_call';
|
|
129
|
-
export const GATEWAY_EVENT_UNKNOWN = 'UNKNOWN';
|
|
130
|
-
export const AI_GATEWAY_EVENT_SERVICE = 'copado-ai-gateway';
|
|
131
|
-
export const CRT_GATEWAY_EVENT_SERVICE = 'copado-crt-gateway';
|
|
132
|
-
const GATEWAY_EVENTLOG_ENDPOINT = '/eventlog';
|
|
133
|
-
let eventLogSender = sendGatewayEventLog;
|
|
134
|
-
let eventLogGeneration = 0;
|
|
135
|
-
let pendingEventLogs = [];
|
|
136
|
-
export function formatGatewayEventTimestamp(date = new Date()) {
|
|
137
|
-
return date.toISOString();
|
|
138
|
-
}
|
|
139
|
-
export function buildGatewayEventLogPayload(input) {
|
|
140
|
-
const payload = {
|
|
141
|
-
data: {
|
|
142
|
-
eventSource: gatewayEventSource(),
|
|
143
|
-
method: input.method,
|
|
144
|
-
service: input.service,
|
|
145
|
-
url: maskUrlSecrets(input.url),
|
|
146
|
-
userAgent: gatewayUserAgent(),
|
|
147
|
-
},
|
|
148
|
-
event: GATEWAY_EVENT_API_CALL,
|
|
149
|
-
eventId: input.eventId,
|
|
150
|
-
location: getGatewayReferer() ?? GATEWAY_EVENT_UNKNOWN,
|
|
151
|
-
orgId: GATEWAY_EVENT_UNKNOWN,
|
|
152
|
-
timestamp: formatGatewayEventTimestamp(input.timestamp ?? new Date()),
|
|
153
|
-
userId: GATEWAY_EVENT_UNKNOWN,
|
|
154
|
-
};
|
|
155
|
-
if (input.status !== undefined) {
|
|
156
|
-
payload.data.status = input.status;
|
|
157
|
-
}
|
|
158
|
-
const orgId = normalizeGatewayEventIdentity(input.orgId);
|
|
159
|
-
if (orgId !== undefined) {
|
|
160
|
-
payload.orgId = orgId;
|
|
161
|
-
}
|
|
162
|
-
const userId = normalizeGatewayEventIdentity(input.userId);
|
|
163
|
-
if (userId !== undefined) {
|
|
164
|
-
payload.userId = userId;
|
|
165
|
-
}
|
|
166
|
-
return payload;
|
|
167
|
-
}
|
|
168
|
-
function normalizeGatewayEventIdentity(value) {
|
|
169
|
-
if (value === undefined)
|
|
170
|
-
return undefined;
|
|
171
|
-
const normalized = value.toString().trim();
|
|
172
|
-
return normalized.length > 0 ? normalized : undefined;
|
|
173
|
-
}
|
|
174
|
-
async function sendGatewayEventLog(payload) {
|
|
175
|
-
await CicdGateway.call({
|
|
176
|
-
body: payload,
|
|
177
|
-
endpoint: GATEWAY_EVENTLOG_ENDPOINT,
|
|
178
|
-
headers: { 'Content-Type': 'application/json' },
|
|
179
|
-
method: 'POST',
|
|
180
|
-
}, undefined, { detached: true });
|
|
181
|
-
}
|
|
182
|
-
export function scheduleGatewayEventLog(input) {
|
|
183
|
-
try {
|
|
184
|
-
const payload = buildGatewayEventLogPayload(input);
|
|
185
|
-
const sender = eventLogSender;
|
|
186
|
-
const generation = eventLogGeneration;
|
|
187
|
-
const task = Promise.resolve()
|
|
188
|
-
.then(() => {
|
|
189
|
-
if (generation !== eventLogGeneration) {
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
return sender(payload);
|
|
193
|
-
})
|
|
194
|
-
.catch(() => {
|
|
195
|
-
// Event log delivery is best-effort.
|
|
196
|
-
});
|
|
197
|
-
pendingEventLogs.push(task);
|
|
198
|
-
}
|
|
199
|
-
catch {
|
|
200
|
-
// Event log scheduling is best-effort.
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
export async function flushGatewayEventLogsForTests() {
|
|
204
|
-
await Promise.all(pendingEventLogs);
|
|
205
|
-
pendingEventLogs = [];
|
|
206
|
-
}
|
|
207
|
-
export function setGatewayEventLogSenderForTests(sender) {
|
|
208
|
-
eventLogSender = sender;
|
|
209
|
-
}
|
|
210
|
-
export function resetGatewayEventLogSenderForTests() {
|
|
211
|
-
eventLogGeneration += 1;
|
|
212
|
-
eventLogSender = sendGatewayEventLog;
|
|
213
|
-
pendingEventLogs = [];
|
|
214
|
-
}
|
|
215
|
-
export function normalizeCicdBaseUrl(value) {
|
|
216
|
-
let url;
|
|
217
|
-
try {
|
|
218
|
-
url = new URL(value);
|
|
219
|
-
}
|
|
220
|
-
catch {
|
|
221
|
-
throw new Error('CICD base URL must be a valid absolute HTTPS URL.');
|
|
222
|
-
}
|
|
223
|
-
if (url.protocol !== 'https:') {
|
|
224
|
-
throw new Error('CICD base URL must use HTTPS.');
|
|
225
|
-
}
|
|
226
|
-
return url.origin;
|
|
227
|
-
}
|
|
228
|
-
function extractCicdErrorDetailMessage(details) {
|
|
229
|
-
if (details === undefined) {
|
|
230
|
-
return undefined;
|
|
231
|
-
}
|
|
232
|
-
if (Array.isArray(details)) {
|
|
233
|
-
const messages = details
|
|
234
|
-
.map((detail) => detail?.message)
|
|
235
|
-
.filter((message) => typeof message === 'string' && message.trim().length > 0);
|
|
236
|
-
return messages.length > 0 ? messages.join('\n') : undefined;
|
|
237
|
-
}
|
|
238
|
-
if (typeof details.message === 'string' && details.message.trim().length > 0) {
|
|
239
|
-
return details.message;
|
|
240
|
-
}
|
|
241
|
-
return undefined;
|
|
242
|
-
}
|
|
243
|
-
function extractCicdErrorCategories(details) {
|
|
244
|
-
if (details === undefined) {
|
|
245
|
-
return [];
|
|
246
|
-
}
|
|
247
|
-
const values = Array.isArray(details) ? details : [details];
|
|
248
|
-
return values
|
|
249
|
-
.map((detail) => detail.category)
|
|
250
|
-
.filter((category) => typeof category === 'string' && category.trim().length > 0);
|
|
251
|
-
}
|
|
252
|
-
export function maskUrlSecrets(url) {
|
|
253
|
-
let parsed;
|
|
254
|
-
try {
|
|
255
|
-
parsed = typeof url === 'string' ? new URL(url) : new URL(url.toString());
|
|
256
|
-
}
|
|
257
|
-
catch {
|
|
258
|
-
return typeof url === 'string' ? url : url.toString();
|
|
259
|
-
}
|
|
260
|
-
if (parsed.searchParams.has('api_key')) {
|
|
261
|
-
parsed.searchParams.set('api_key', '<masked>');
|
|
262
|
-
}
|
|
263
|
-
return parsed.toString();
|
|
264
|
-
}
|
|
265
|
-
function formatRequestSuffix(request) {
|
|
266
|
-
if (request?.url === undefined || request.url.trim().length === 0) {
|
|
267
|
-
return '';
|
|
268
|
-
}
|
|
269
|
-
const url = maskUrlSecrets(request.url);
|
|
270
|
-
const method = request.method !== undefined && request.method.trim().length > 0 ? `${request.method} ` : '';
|
|
271
|
-
return ` Request: ${method}${url}`;
|
|
272
|
-
}
|
|
273
|
-
function withRequestSuffix(message, request) {
|
|
274
|
-
const suffix = formatRequestSuffix(request);
|
|
275
|
-
if (suffix.length === 0) {
|
|
276
|
-
return message;
|
|
277
|
-
}
|
|
278
|
-
return message.endsWith('.') ? `${message}${suffix}` : `${message}.${suffix}`;
|
|
279
|
-
}
|
|
280
|
-
export function parseRetryAfterHeader(value) {
|
|
281
|
-
if (value === undefined) {
|
|
282
|
-
return undefined;
|
|
283
|
-
}
|
|
284
|
-
const raw = Array.isArray(value) ? value[0] : value;
|
|
285
|
-
if (raw === undefined) {
|
|
286
|
-
return undefined;
|
|
287
|
-
}
|
|
288
|
-
if (typeof raw === 'number') {
|
|
289
|
-
return Number.isFinite(raw) && raw >= 0 ? Math.ceil(raw) : undefined;
|
|
290
|
-
}
|
|
291
|
-
const trimmed = raw.trim();
|
|
292
|
-
if (trimmed.length === 0) {
|
|
293
|
-
return undefined;
|
|
294
|
-
}
|
|
295
|
-
if (/^\d+$/u.test(trimmed)) {
|
|
296
|
-
return Number.parseInt(trimmed, 10);
|
|
297
|
-
}
|
|
298
|
-
const dateMs = Date.parse(trimmed);
|
|
299
|
-
if (Number.isNaN(dateMs)) {
|
|
300
|
-
return undefined;
|
|
301
|
-
}
|
|
302
|
-
return Math.max(0, Math.ceil((dateMs - Date.now()) / 1000));
|
|
303
|
-
}
|
|
304
|
-
function extractJobIdFromErrorBody(parsed) {
|
|
305
|
-
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
306
|
-
return undefined;
|
|
307
|
-
}
|
|
308
|
-
const { jobId } = parsed;
|
|
309
|
-
if (typeof jobId !== 'string') {
|
|
310
|
-
return undefined;
|
|
311
|
-
}
|
|
312
|
-
const trimmed = jobId.trim();
|
|
313
|
-
return trimmed.length > 0 ? trimmed : undefined;
|
|
314
|
-
}
|
|
315
|
-
export function formatCicdGatewayError(status, raw, request, retryAfterSeconds) {
|
|
316
|
-
try {
|
|
317
|
-
const parsed = JSON.parse(raw);
|
|
318
|
-
const jobId = extractJobIdFromErrorBody(parsed);
|
|
319
|
-
const detailMessage = extractCicdErrorDetailMessage(parsed.data?.details);
|
|
320
|
-
const message = detailMessage ?? parsed.message;
|
|
321
|
-
if (message !== undefined && message.trim().length > 0) {
|
|
322
|
-
return new CicdGatewayError(withRequestSuffix(message.trim(), request), {
|
|
323
|
-
categories: extractCicdErrorCategories(parsed.data?.details),
|
|
324
|
-
code: parsed.data?.code,
|
|
325
|
-
jobId,
|
|
326
|
-
request,
|
|
327
|
-
retryAfterSeconds,
|
|
328
|
-
statusCode: status,
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
if (jobId !== undefined) {
|
|
332
|
-
return new CicdGatewayError(withRequestSuffix(`CICD Gateway request failed (${status}).`, request), {
|
|
333
|
-
categories: extractCicdErrorCategories(parsed.data?.details),
|
|
334
|
-
code: parsed.data?.code,
|
|
335
|
-
jobId,
|
|
336
|
-
request,
|
|
337
|
-
retryAfterSeconds,
|
|
338
|
-
statusCode: status,
|
|
339
|
-
});
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
catch {
|
|
343
|
-
// Fall through to the generic error below.
|
|
344
|
-
}
|
|
345
|
-
return new CicdGatewayError(withRequestSuffix(`CICD Gateway request failed (${status}).`, request), {
|
|
346
|
-
request,
|
|
347
|
-
retryAfterSeconds,
|
|
348
|
-
statusCode: status,
|
|
349
|
-
});
|
|
350
|
-
}
|
|
351
|
-
function createCicdGatewayError(parsed, request) {
|
|
352
|
-
const detailMessage = extractCicdErrorDetailMessage(parsed.data?.details);
|
|
353
|
-
const message = detailMessage ?? parsed.message;
|
|
354
|
-
if (message !== undefined && message.trim().length > 0) {
|
|
355
|
-
return new CicdGatewayError(withRequestSuffix(message.trim(), request), {
|
|
356
|
-
categories: extractCicdErrorCategories(parsed.data?.details),
|
|
357
|
-
code: parsed.data?.code,
|
|
358
|
-
request,
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
return new CicdGatewayError(withRequestSuffix('CICD Gateway request failed.', request), {
|
|
362
|
-
categories: extractCicdErrorCategories(parsed.data?.details),
|
|
363
|
-
code: parsed.data?.code,
|
|
364
|
-
request,
|
|
365
|
-
});
|
|
366
|
-
}
|
|
367
|
-
function buildGatewayRequestHeaders(requestHeaders, userAgent) {
|
|
368
|
-
return {
|
|
369
|
-
...requestHeaders,
|
|
370
|
-
'event-source': gatewayEventSource(),
|
|
371
|
-
...gatewayRefererHeaders(),
|
|
372
|
-
'User-Agent': userAgent,
|
|
373
|
-
'x-transaction-id': transactionIdForGatewayRequest(),
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
|
-
export function cicdApiUrl(serverUrl, apiKey) {
|
|
377
|
-
const endpoint = new URL(CICD_API_PATH, serverUrl);
|
|
378
|
-
endpoint.searchParams.set('api_key', apiKey);
|
|
379
|
-
return endpoint;
|
|
380
|
-
}
|
|
381
|
-
export function maskedCicdApiUrl(serverUrl) {
|
|
382
|
-
const endpoint = new URL(CICD_API_PATH, serverUrl);
|
|
383
|
-
endpoint.searchParams.set('api_key', '<masked>');
|
|
384
|
-
return endpoint.toString();
|
|
385
|
-
}
|
|
386
|
-
// eslint-disable-next-line max-params
|
|
387
|
-
function defaultHttpsJsonRequest(url, method, headers, body, options = activeHttpRequestOptions) {
|
|
388
|
-
const hasBody = body !== undefined;
|
|
389
|
-
const payload = hasBody ? JSON.stringify(body) : '';
|
|
390
|
-
const requestHeaders = {
|
|
391
|
-
Accept: 'application/json',
|
|
392
|
-
...headers,
|
|
393
|
-
};
|
|
394
|
-
const { detached, rejectUnauthorized } = options;
|
|
395
|
-
const timeoutMs = resolveCicdRequestTimeoutMs(options);
|
|
396
|
-
const signal = options.signal ?? getMcpRequestSignal();
|
|
397
|
-
const transport = url.protocol === 'http:' ? http : https;
|
|
398
|
-
if (hasBody) {
|
|
399
|
-
requestHeaders['Content-Type'] = requestHeaders['Content-Type'] ?? 'application/json';
|
|
400
|
-
requestHeaders['Content-Length'] = Buffer.byteLength(payload).toString();
|
|
401
|
-
}
|
|
402
|
-
return new Promise((resolve, reject) => {
|
|
403
|
-
let settled = false;
|
|
404
|
-
const deadline = timeoutMs === undefined
|
|
405
|
-
? undefined
|
|
406
|
-
: setTimeout(() => {
|
|
407
|
-
req.destroy(new Error(`CICD gateway request timed out after ${timeoutMs}ms.`));
|
|
408
|
-
}, timeoutMs);
|
|
409
|
-
const settle = (action) => {
|
|
410
|
-
if (settled)
|
|
411
|
-
return;
|
|
412
|
-
settled = true;
|
|
413
|
-
if (deadline !== undefined) {
|
|
414
|
-
clearTimeout(deadline);
|
|
415
|
-
}
|
|
416
|
-
signal?.removeEventListener('abort', abort);
|
|
417
|
-
action();
|
|
418
|
-
};
|
|
419
|
-
const abort = () => {
|
|
420
|
-
req.destroy(signal?.reason instanceof Error ? signal.reason : new Error('CICD gateway request cancelled.'));
|
|
421
|
-
};
|
|
422
|
-
const requestOptions = {
|
|
423
|
-
agent: detached ? false : undefined,
|
|
424
|
-
headers: requestHeaders,
|
|
425
|
-
hostname: url.hostname,
|
|
426
|
-
method,
|
|
427
|
-
path: `${url.pathname}${url.search}`,
|
|
428
|
-
port: url.port.length > 0 ? Number(url.port) : undefined,
|
|
429
|
-
};
|
|
430
|
-
if (url.protocol === 'https:' && rejectUnauthorized !== undefined) {
|
|
431
|
-
;
|
|
432
|
-
requestOptions.rejectUnauthorized = rejectUnauthorized;
|
|
433
|
-
}
|
|
434
|
-
const req = transport.request(requestOptions, (res) => {
|
|
435
|
-
const chunks = [];
|
|
436
|
-
res.on('data', (chunk) => chunks.push(chunk));
|
|
437
|
-
res.on('end', () => {
|
|
438
|
-
const raw = Buffer.concat(chunks).toString('utf8');
|
|
439
|
-
const status = res.statusCode ?? 0;
|
|
440
|
-
if (status >= 400) {
|
|
441
|
-
if (isCicdWarningResponseBody(raw)) {
|
|
442
|
-
settle(() => resolve(raw));
|
|
443
|
-
return;
|
|
444
|
-
}
|
|
445
|
-
logVerboseDebug('CICD response', {
|
|
446
|
-
body: formatDebugBody(raw),
|
|
447
|
-
status,
|
|
448
|
-
});
|
|
449
|
-
const retryAfterSeconds = status === 429 ? parseRetryAfterHeader(res.headers['retry-after']) : undefined;
|
|
450
|
-
settle(() => reject(formatCicdGatewayError(status, raw, undefined, retryAfterSeconds)));
|
|
451
|
-
return;
|
|
452
|
-
}
|
|
453
|
-
settle(() => resolve(raw));
|
|
454
|
-
});
|
|
455
|
-
});
|
|
456
|
-
req.on('error', (error) => settle(() => reject(error)));
|
|
457
|
-
if (signal?.aborted) {
|
|
458
|
-
abort();
|
|
459
|
-
}
|
|
460
|
-
else {
|
|
461
|
-
signal?.addEventListener('abort', abort, { once: true });
|
|
462
|
-
}
|
|
463
|
-
if (detached) {
|
|
464
|
-
req.on('socket', (socket) => socket.unref());
|
|
465
|
-
}
|
|
466
|
-
if (hasBody) {
|
|
467
|
-
req.write(payload);
|
|
468
|
-
}
|
|
469
|
-
req.end();
|
|
470
|
-
});
|
|
471
|
-
}
|
|
472
|
-
let httpRequestFn = defaultHttpsJsonRequest;
|
|
473
|
-
const AUTOMATIC_GATEWAY_HEADER_NAMES = new Set([
|
|
474
|
-
'event-source',
|
|
475
|
-
'Referer',
|
|
476
|
-
'User-Agent',
|
|
477
|
-
'x-transaction-id',
|
|
478
|
-
]);
|
|
479
|
-
function withoutAutomaticGatewayHeaders(body) {
|
|
480
|
-
if (body === null || typeof body !== 'object' || Array.isArray(body)) {
|
|
481
|
-
return body;
|
|
482
|
-
}
|
|
483
|
-
const request = body;
|
|
484
|
-
const requestHeaders = request.headers;
|
|
485
|
-
if (requestHeaders === null || typeof requestHeaders !== 'object' || Array.isArray(requestHeaders)) {
|
|
486
|
-
return body;
|
|
487
|
-
}
|
|
488
|
-
const headers = Object.fromEntries(Object.entries(requestHeaders).filter(([name]) => !AUTOMATIC_GATEWAY_HEADER_NAMES.has(name)));
|
|
489
|
-
const sanitized = { ...request };
|
|
490
|
-
if (Object.keys(headers).length === 0) {
|
|
491
|
-
delete sanitized.headers;
|
|
492
|
-
}
|
|
493
|
-
else {
|
|
494
|
-
sanitized.headers = headers;
|
|
495
|
-
}
|
|
496
|
-
return sanitized;
|
|
497
|
-
}
|
|
498
|
-
function envCicdApiKey() {
|
|
499
|
-
const value = process.env[CICD_ENV.apiKey]?.trim();
|
|
500
|
-
return value === undefined || value.length === 0 ? undefined : value;
|
|
501
|
-
}
|
|
502
|
-
function envCicdBaseUrl() {
|
|
503
|
-
const value = process.env[CICD_ENV.baseUrl]?.trim();
|
|
504
|
-
return value === undefined || value.length === 0 ? undefined : normalizeCicdBaseUrl(value);
|
|
505
|
-
}
|
|
506
|
-
export function resolveConfiguredCicdBaseUrl(options = {}) {
|
|
507
|
-
loadEnvFile();
|
|
508
|
-
const localConfig = readLocalGatewayConfig();
|
|
509
|
-
if (!options.forceRemote && localConfig.enabled) {
|
|
510
|
-
return normalizeLocalGatewayBaseUrl(localConfig.url);
|
|
511
|
-
}
|
|
512
|
-
const local = readAuthProfile('local');
|
|
513
|
-
return envCicdBaseUrl() ?? local?.cicd?.baseUrl ?? readAuthProfile('global')?.cicd?.baseUrl ?? getCicdBaseUrl();
|
|
514
|
-
}
|
|
515
|
-
export function resolveCicdCredentials(options = {}) {
|
|
516
|
-
loadEnvFile();
|
|
517
|
-
const localConfig = readLocalGatewayConfig();
|
|
518
|
-
if (!options.forceRemote && localConfig.enabled) {
|
|
519
|
-
const local = readAuthProfile('local');
|
|
520
|
-
const apiKey = localConfig.apiKey ||
|
|
521
|
-
envCicdApiKey() ||
|
|
522
|
-
(local?.cicd === undefined ? getCredential('cicd') : getCredentialForKey('cicd', local.keychainId));
|
|
523
|
-
if (apiKey === null || apiKey === undefined || apiKey.trim().length === 0) {
|
|
524
|
-
throw new Error('CICD API key is not configured for local gateway mode. Set AGENTIA_LOCAL_API_KEY in .env or run `agentia auth set --cicd <key>`.');
|
|
525
|
-
}
|
|
526
|
-
return {
|
|
527
|
-
apiKey,
|
|
528
|
-
baseUrl: normalizeLocalGatewayBaseUrl(localConfig.url),
|
|
529
|
-
};
|
|
530
|
-
}
|
|
531
|
-
const local = readAuthProfile('local');
|
|
532
|
-
const localConfigured = local?.cicd !== undefined;
|
|
533
|
-
if (localConfigured && local?.cicd?.baseUrl === undefined) {
|
|
534
|
-
throw new Error('Local CICD authentication profile is incomplete. Configure a region or custom URL for this project.');
|
|
535
|
-
}
|
|
536
|
-
const apiKey = envCicdApiKey() ?? (localConfigured ? getCredentialForKey('cicd', local.keychainId) : getCredential('cicd'));
|
|
537
|
-
if (apiKey === null || apiKey === undefined || apiKey.trim().length === 0) {
|
|
538
|
-
throw new Error('CICD API key is not configured. Run `agentia auth set --cicd <key> [--region <region> | --custom-url <url>]` or set AGENTIA_CICD_API_KEY.');
|
|
539
|
-
}
|
|
540
|
-
const baseUrl = envCicdBaseUrl() ?? (localConfigured ? local?.cicd?.baseUrl : readAuthProfile('global')?.cicd?.baseUrl ?? getCicdBaseUrl());
|
|
541
|
-
if (baseUrl === null || baseUrl === undefined) {
|
|
542
|
-
throw new Error('CICD endpoint is not configured. Run `agentia auth set --cicd <key> [--region <region> | --custom-url <url>]` or set AGENTIA_CICD_BASE_URL.');
|
|
543
|
-
}
|
|
544
|
-
return { apiKey, baseUrl };
|
|
545
|
-
}
|
|
546
|
-
export function tryResolveCicdCredentials(options = {}) {
|
|
547
|
-
try {
|
|
548
|
-
return resolveCicdCredentials(options);
|
|
549
|
-
}
|
|
550
|
-
catch (error) {
|
|
551
|
-
if (error instanceof Error && error.message.startsWith('CICD API key is not configured')) {
|
|
552
|
-
return undefined;
|
|
553
|
-
}
|
|
554
|
-
throw error;
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
function maskSecret(value) {
|
|
558
|
-
if (value.length <= 8) {
|
|
559
|
-
return '<masked>';
|
|
560
|
-
}
|
|
561
|
-
return `${value.slice(0, 4)}...${value.slice(-4)}`;
|
|
562
|
-
}
|
|
563
|
-
function buildLocalGatewayHeaders(apiKey, sfContext, requestHeaders, transactionId) {
|
|
564
|
-
return {
|
|
565
|
-
'event-source': gatewayEventSource(),
|
|
566
|
-
...gatewayRefererHeaders(),
|
|
567
|
-
'User-Agent': gatewayUserAgent(),
|
|
568
|
-
'x-api-key': apiKey,
|
|
569
|
-
'x-canvas-api-session': sfContext.accessToken,
|
|
570
|
-
'x-copado-api-url': sfContext.instanceUrl,
|
|
571
|
-
'x-organization-id': preferSalesforceId(sfContext.orgId),
|
|
572
|
-
'x-transaction-id': transactionId,
|
|
573
|
-
'x-user-id': preferSalesforceId(sfContext.userId),
|
|
574
|
-
...requestHeaders,
|
|
575
|
-
};
|
|
576
|
-
}
|
|
577
|
-
function maskLocalGatewayHeaders(headers) {
|
|
578
|
-
const masked = { ...headers };
|
|
579
|
-
if (masked['x-api-key'] !== undefined) {
|
|
580
|
-
masked['x-api-key'] = maskSecret(masked['x-api-key']);
|
|
581
|
-
}
|
|
582
|
-
if (masked['x-canvas-api-session'] !== undefined) {
|
|
583
|
-
masked['x-canvas-api-session'] = '<masked>';
|
|
584
|
-
}
|
|
585
|
-
return masked;
|
|
586
|
-
}
|
|
587
|
-
function unwrapResponse(parsed) {
|
|
588
|
-
const data = (parsed && typeof parsed === 'object' && 'data' in parsed ? parsed.data : undefined) ?? parsed.result;
|
|
589
|
-
if (data === undefined) {
|
|
590
|
-
return parsed;
|
|
591
|
-
}
|
|
592
|
-
return data;
|
|
593
|
-
}
|
|
594
|
-
function isPlainObject(value) {
|
|
595
|
-
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
596
|
-
}
|
|
597
|
-
/** True when a CICD envelope uses `status: "warning"` instead of failing. */
|
|
598
|
-
export function isCicdWarningStatus(status) {
|
|
599
|
-
return status === 'warning';
|
|
600
|
-
}
|
|
601
|
-
export function isCicdWarningResponseBody(raw) {
|
|
602
|
-
try {
|
|
603
|
-
const parsed = JSON.parse(raw);
|
|
604
|
-
return isCicdWarningStatus(parsed.status);
|
|
605
|
-
}
|
|
606
|
-
catch {
|
|
607
|
-
return false;
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
function applyWarningStatus(parsed, data) {
|
|
611
|
-
if (!isCicdWarningStatus(parsed.status) || !isPlainObject(data)) {
|
|
612
|
-
return data;
|
|
613
|
-
}
|
|
614
|
-
const dataMessage = typeof data.message === 'string' ? data.message.trim() : '';
|
|
615
|
-
const envelopeMessage = typeof parsed.message === 'string' ? parsed.message.trim() : '';
|
|
616
|
-
const message = dataMessage.length > 0 ? data.message : envelopeMessage;
|
|
617
|
-
return {
|
|
618
|
-
...data,
|
|
619
|
-
...(typeof message === 'string' && message.length > 0 ? { message } : {}),
|
|
620
|
-
status: 'warning',
|
|
621
|
-
};
|
|
622
|
-
}
|
|
623
|
-
function composeDebugRequestHandler(onDebugRequest) {
|
|
624
|
-
if (!isVerboseDebug() && onDebugRequest === undefined) {
|
|
625
|
-
return undefined;
|
|
626
|
-
}
|
|
627
|
-
return (debugRequest) => {
|
|
628
|
-
logVerboseDebug('CICD request', debugRequest);
|
|
629
|
-
onDebugRequest?.(debugRequest);
|
|
630
|
-
};
|
|
631
|
-
}
|
|
632
|
-
async function executeRequest(credentials, request, onDebugRequest, options = {}) {
|
|
633
|
-
const errorRequest = buildErrorRequestInfo(credentials, request, options);
|
|
634
|
-
const raw = await sendRequest(credentials, request, composeDebugRequestHandler(onDebugRequest), options);
|
|
635
|
-
logVerboseDebug('CICD response', formatDebugBody(raw));
|
|
636
|
-
if (raw.trim().length === 0) {
|
|
637
|
-
return undefined;
|
|
638
|
-
}
|
|
639
|
-
if (request.responseType === 'text') {
|
|
640
|
-
try {
|
|
641
|
-
const possibleError = JSON.parse(raw);
|
|
642
|
-
if (possibleError.status === 'error') {
|
|
643
|
-
throw createCicdGatewayError(possibleError, errorRequest);
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
catch (error) {
|
|
647
|
-
if (error instanceof CicdGatewayError) {
|
|
648
|
-
throw error;
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
return raw;
|
|
652
|
-
}
|
|
653
|
-
let parsed;
|
|
654
|
-
try {
|
|
655
|
-
parsed = JSON.parse(raw);
|
|
656
|
-
}
|
|
657
|
-
catch {
|
|
658
|
-
throw new Error(`CICD Gateway returned non-JSON response: ${raw}`);
|
|
659
|
-
}
|
|
660
|
-
if (parsed.status === 'error') {
|
|
661
|
-
throw createCicdGatewayError(parsed, errorRequest);
|
|
662
|
-
}
|
|
663
|
-
return applyWarningStatus(parsed, unwrapResponse(parsed));
|
|
664
|
-
}
|
|
665
|
-
function buildErrorRequestInfo(credentials, request, options = {}) {
|
|
666
|
-
if (!options.forceRemote && readLocalGatewayConfig().enabled) {
|
|
667
|
-
return {
|
|
668
|
-
method: request.method,
|
|
669
|
-
url: maskUrlSecrets(new URL(request.endpoint, `${credentials.baseUrl}/`)),
|
|
670
|
-
};
|
|
671
|
-
}
|
|
672
|
-
return {
|
|
673
|
-
method: request.method,
|
|
674
|
-
url: `${request.endpoint}`,
|
|
675
|
-
};
|
|
676
|
-
}
|
|
677
|
-
async function sendRemoteRequest(credentials, request, onDebugRequest, options = {}) {
|
|
678
|
-
const endpoint = cicdApiUrl(credentials.baseUrl, credentials.apiKey);
|
|
679
|
-
const outerHeaders = { 'User-Agent': gatewayUserAgent() };
|
|
680
|
-
const gatewayRequest = {
|
|
681
|
-
...request,
|
|
682
|
-
headers: buildGatewayRequestHeaders(request.headers, outerHeaders['User-Agent']),
|
|
683
|
-
};
|
|
684
|
-
delete gatewayRequest.responseType;
|
|
685
|
-
const errorRequest = {
|
|
686
|
-
method: request.method,
|
|
687
|
-
url: `${request.endpoint} via ${maskedCicdApiUrl(credentials.baseUrl)}`,
|
|
688
|
-
};
|
|
689
|
-
if (onDebugRequest) {
|
|
690
|
-
onDebugRequest({
|
|
691
|
-
body: gatewayRequest,
|
|
692
|
-
headers: {
|
|
693
|
-
Accept: 'application/json',
|
|
694
|
-
'Content-Type': 'application/json',
|
|
695
|
-
...outerHeaders,
|
|
696
|
-
},
|
|
697
|
-
method: 'POST',
|
|
698
|
-
url: maskedCicdApiUrl(credentials.baseUrl),
|
|
699
|
-
});
|
|
700
|
-
}
|
|
701
|
-
try {
|
|
702
|
-
return await httpRequestFn(endpoint, 'POST', outerHeaders, gatewayRequest, {
|
|
703
|
-
detached: options.detached,
|
|
704
|
-
});
|
|
705
|
-
}
|
|
706
|
-
catch (error) {
|
|
707
|
-
throw enrichCicdGatewayError(error, errorRequest);
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
async function sendLocalRequest(credentials, request, onDebugRequest, options = {}) {
|
|
711
|
-
const localConfig = readLocalGatewayConfig();
|
|
712
|
-
const sfContext = await getSfOrgContext(localConfig.orgAlias);
|
|
713
|
-
const transactionId = transactionIdForGatewayRequest();
|
|
714
|
-
const headers = buildLocalGatewayHeaders(credentials.apiKey, sfContext, request.headers, transactionId);
|
|
715
|
-
const url = new URL(request.endpoint, `${credentials.baseUrl}/`);
|
|
716
|
-
const { body } = request;
|
|
717
|
-
const errorRequest = {
|
|
718
|
-
method: request.method,
|
|
719
|
-
url: maskUrlSecrets(url),
|
|
720
|
-
};
|
|
721
|
-
if (onDebugRequest) {
|
|
722
|
-
onDebugRequest({
|
|
723
|
-
body: body ?? null,
|
|
724
|
-
headers: {
|
|
725
|
-
Accept: 'application/json',
|
|
726
|
-
...maskLocalGatewayHeaders(headers),
|
|
727
|
-
},
|
|
728
|
-
method: request.method,
|
|
729
|
-
url: url.toString(),
|
|
730
|
-
});
|
|
731
|
-
}
|
|
732
|
-
const previousOptions = activeHttpRequestOptions;
|
|
733
|
-
activeHttpRequestOptions = {
|
|
734
|
-
...(options.detached === true ? { detached: true } : {}),
|
|
735
|
-
rejectUnauthorized: localConfig.tlsInsecure ? false : undefined,
|
|
736
|
-
};
|
|
737
|
-
try {
|
|
738
|
-
return await httpRequestFn(url, request.method, headers, body, activeHttpRequestOptions);
|
|
739
|
-
}
|
|
740
|
-
catch (error) {
|
|
741
|
-
throw enrichCicdGatewayError(error, errorRequest);
|
|
742
|
-
}
|
|
743
|
-
finally {
|
|
744
|
-
activeHttpRequestOptions = previousOptions;
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
function enrichCicdGatewayError(error, request) {
|
|
748
|
-
if (!(error instanceof CicdGatewayError)) {
|
|
749
|
-
return error;
|
|
750
|
-
}
|
|
751
|
-
const baseMessage = error.message.replace(/\.\s*Request: .+$/u, '.');
|
|
752
|
-
return new CicdGatewayError(withRequestSuffix(baseMessage, request), {
|
|
753
|
-
categories: error.categories,
|
|
754
|
-
code: error.code,
|
|
755
|
-
jobId: error.jobId,
|
|
756
|
-
request,
|
|
757
|
-
retryAfterSeconds: error.retryAfterSeconds,
|
|
758
|
-
statusCode: error.statusCode,
|
|
759
|
-
});
|
|
760
|
-
}
|
|
761
|
-
async function sendRequest(credentials, request, onDebugRequest, options = {}) {
|
|
762
|
-
if (!options.forceRemote && readLocalGatewayConfig().enabled) {
|
|
763
|
-
return sendLocalRequest(credentials, request, onDebugRequest, options);
|
|
764
|
-
}
|
|
765
|
-
return sendRemoteRequest(credentials, request, onDebugRequest, options);
|
|
766
|
-
}
|
|
767
|
-
export async function discoverCicdBaseUrl(apiKey) {
|
|
768
|
-
for (const region of CICD_REGIONS) {
|
|
769
|
-
const baseUrl = cicdBaseUrl(region);
|
|
770
|
-
try {
|
|
771
|
-
// Sequential probing is intentional: stop at the first region that validates.
|
|
772
|
-
// eslint-disable-next-line no-await-in-loop
|
|
773
|
-
await validateCredentialsAtBaseUrl(apiKey, baseUrl);
|
|
774
|
-
return baseUrl;
|
|
775
|
-
}
|
|
776
|
-
catch {
|
|
777
|
-
continue;
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
throw new Error('CICD API key could not be validated. Specify --region or --custom-url.');
|
|
781
|
-
}
|
|
782
|
-
export async function resolveAndValidateCicdEndpoint(apiKey, options) {
|
|
783
|
-
if (options.customUrl !== undefined) {
|
|
784
|
-
const baseUrl = normalizeCicdBaseUrl(options.customUrl);
|
|
785
|
-
await validateCredentialsAtBaseUrl(apiKey, baseUrl);
|
|
786
|
-
return baseUrl;
|
|
787
|
-
}
|
|
788
|
-
if (options.region !== undefined) {
|
|
789
|
-
const baseUrl = cicdBaseUrl(options.region);
|
|
790
|
-
await validateCredentialsAtBaseUrl(apiKey, baseUrl);
|
|
791
|
-
return baseUrl;
|
|
792
|
-
}
|
|
793
|
-
return discoverCicdBaseUrl(apiKey);
|
|
794
|
-
}
|
|
795
|
-
async function validateCredentialsAtBaseUrl(apiKey, baseUrl) {
|
|
796
|
-
await sendRequest({
|
|
797
|
-
apiKey,
|
|
798
|
-
baseUrl,
|
|
799
|
-
}, {
|
|
800
|
-
endpoint: CICD_VALIDATION_ENDPOINT,
|
|
801
|
-
method: 'GET',
|
|
802
|
-
}, undefined, { forceRemote: true });
|
|
803
|
-
}
|
|
804
|
-
// Test-only hook. Command tests receive stable request semantics by default;
|
|
805
|
-
// gateway-boundary tests can opt in to the generated telemetry headers.
|
|
806
|
-
export function setHttpRequestForTests(requestFn, options = {}) {
|
|
807
|
-
httpRequestFn = options.includeAutomaticHeaders
|
|
808
|
-
? requestFn
|
|
809
|
-
: (...args) => {
|
|
810
|
-
const [url, method, headers, body, requestOptions] = args;
|
|
811
|
-
return requestFn(url, method, headers, withoutAutomaticGatewayHeaders(body), requestOptions);
|
|
812
|
-
};
|
|
813
|
-
}
|
|
814
|
-
// Test-only hook
|
|
815
|
-
export function resetHttpRequestForTests() {
|
|
816
|
-
httpRequestFn = defaultHttpsJsonRequest;
|
|
817
|
-
activeHttpRequestOptions = {};
|
|
818
|
-
}
|
|
819
|
-
// Test-only hook
|
|
820
|
-
export function getActiveHttpRequestOptionsForTests() {
|
|
821
|
-
return activeHttpRequestOptions;
|
|
822
|
-
}
|
|
823
|
-
export class CicdGateway {
|
|
824
|
-
static async call(request, onDebugRequest, options = {}) {
|
|
825
|
-
return executeRequest(resolveCicdCredentials(options), request, onDebugRequest, options);
|
|
826
|
-
}
|
|
827
|
-
static async resolveAndValidateEndpoint(apiKey, options) {
|
|
828
|
-
return resolveAndValidateCicdEndpoint(apiKey, options);
|
|
829
|
-
}
|
|
830
|
-
static async validateCredentials(apiKey, baseUrl) {
|
|
831
|
-
await validateCredentialsAtBaseUrl(apiKey, baseUrl);
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
//# sourceMappingURL=cicd-gateway.js.map
|
|
1
|
+
import {modules} from './runtime.js';
|
|
2
|
+
const AGENTIA_CLIENT_ORIGIN_ENV = modules["cicd-gateway.js"]["AGENTIA_CLIENT_ORIGIN_ENV"]
|
|
3
|
+
const AGENTIA_IDE_VERSION_ENV = modules["cicd-gateway.js"]["AGENTIA_IDE_VERSION_ENV"]
|
|
4
|
+
const AI_GATEWAY_EVENT_SERVICE = modules["cicd-gateway.js"]["AI_GATEWAY_EVENT_SERVICE"]
|
|
5
|
+
const CICD_ENV = modules["cicd-gateway.js"]["CICD_ENV"]
|
|
6
|
+
const CRT_GATEWAY_EVENT_SERVICE = modules["cicd-gateway.js"]["CRT_GATEWAY_EVENT_SERVICE"]
|
|
7
|
+
const CicdGateway = modules["cicd-gateway.js"]["CicdGateway"]
|
|
8
|
+
const CicdGatewayError = modules["cicd-gateway.js"]["CicdGatewayError"]
|
|
9
|
+
const GATEWAY_EVENT_API_CALL = modules["cicd-gateway.js"]["GATEWAY_EVENT_API_CALL"]
|
|
10
|
+
const GATEWAY_EVENT_UNKNOWN = modules["cicd-gateway.js"]["GATEWAY_EVENT_UNKNOWN"]
|
|
11
|
+
const MCP_CICD_DEFAULT_REQUEST_TIMEOUT_MS = modules["cicd-gateway.js"]["MCP_CICD_DEFAULT_REQUEST_TIMEOUT_MS"]
|
|
12
|
+
const buildGatewayEventLogPayload = modules["cicd-gateway.js"]["buildGatewayEventLogPayload"]
|
|
13
|
+
const cicdApiUrl = modules["cicd-gateway.js"]["cicdApiUrl"]
|
|
14
|
+
const createTransactionId = modules["cicd-gateway.js"]["createTransactionId"]
|
|
15
|
+
const discoverCicdBaseUrl = modules["cicd-gateway.js"]["discoverCicdBaseUrl"]
|
|
16
|
+
const flushGatewayEventLogsForTests = modules["cicd-gateway.js"]["flushGatewayEventLogsForTests"]
|
|
17
|
+
const formatCicdGatewayError = modules["cicd-gateway.js"]["formatCicdGatewayError"]
|
|
18
|
+
const formatGatewayEventTimestamp = modules["cicd-gateway.js"]["formatGatewayEventTimestamp"]
|
|
19
|
+
const gatewayEventSource = modules["cicd-gateway.js"]["gatewayEventSource"]
|
|
20
|
+
const gatewayRefererHeaders = modules["cicd-gateway.js"]["gatewayRefererHeaders"]
|
|
21
|
+
const gatewayUserAgent = modules["cicd-gateway.js"]["gatewayUserAgent"]
|
|
22
|
+
const getActiveHttpRequestOptionsForTests = modules["cicd-gateway.js"]["getActiveHttpRequestOptionsForTests"]
|
|
23
|
+
const getGatewayClientOrigin = modules["cicd-gateway.js"]["getGatewayClientOrigin"]
|
|
24
|
+
const getGatewayReferer = modules["cicd-gateway.js"]["getGatewayReferer"]
|
|
25
|
+
const getGatewayTransactionId = modules["cicd-gateway.js"]["getGatewayTransactionId"]
|
|
26
|
+
const isCicdWarningResponseBody = modules["cicd-gateway.js"]["isCicdWarningResponseBody"]
|
|
27
|
+
const isCicdWarningStatus = modules["cicd-gateway.js"]["isCicdWarningStatus"]
|
|
28
|
+
const maskUrlSecrets = modules["cicd-gateway.js"]["maskUrlSecrets"]
|
|
29
|
+
const maskedCicdApiUrl = modules["cicd-gateway.js"]["maskedCicdApiUrl"]
|
|
30
|
+
const normalizeCicdBaseUrl = modules["cicd-gateway.js"]["normalizeCicdBaseUrl"]
|
|
31
|
+
const parseRetryAfterHeader = modules["cicd-gateway.js"]["parseRetryAfterHeader"]
|
|
32
|
+
const resetGatewayEventLogSenderForTests = modules["cicd-gateway.js"]["resetGatewayEventLogSenderForTests"]
|
|
33
|
+
const resetHttpRequestForTests = modules["cicd-gateway.js"]["resetHttpRequestForTests"]
|
|
34
|
+
const resolveAndValidateCicdEndpoint = modules["cicd-gateway.js"]["resolveAndValidateCicdEndpoint"]
|
|
35
|
+
const resolveCicdCredentials = modules["cicd-gateway.js"]["resolveCicdCredentials"]
|
|
36
|
+
const resolveCicdRequestTimeoutMs = modules["cicd-gateway.js"]["resolveCicdRequestTimeoutMs"]
|
|
37
|
+
const resolveConfiguredCicdBaseUrl = modules["cicd-gateway.js"]["resolveConfiguredCicdBaseUrl"]
|
|
38
|
+
const runWithGatewayTransactionContext = modules["cicd-gateway.js"]["runWithGatewayTransactionContext"]
|
|
39
|
+
const scheduleGatewayEventLog = modules["cicd-gateway.js"]["scheduleGatewayEventLog"]
|
|
40
|
+
const setGatewayEventLogSenderForTests = modules["cicd-gateway.js"]["setGatewayEventLogSenderForTests"]
|
|
41
|
+
const setHttpRequestForTests = modules["cicd-gateway.js"]["setHttpRequestForTests"]
|
|
42
|
+
const tryResolveCicdCredentials = modules["cicd-gateway.js"]["tryResolveCicdCredentials"]
|
|
43
|
+
export {AGENTIA_CLIENT_ORIGIN_ENV, AGENTIA_IDE_VERSION_ENV, AI_GATEWAY_EVENT_SERVICE, CICD_ENV, CRT_GATEWAY_EVENT_SERVICE, CicdGateway, CicdGatewayError, GATEWAY_EVENT_API_CALL, GATEWAY_EVENT_UNKNOWN, MCP_CICD_DEFAULT_REQUEST_TIMEOUT_MS, buildGatewayEventLogPayload, cicdApiUrl, createTransactionId, discoverCicdBaseUrl, flushGatewayEventLogsForTests, formatCicdGatewayError, formatGatewayEventTimestamp, gatewayEventSource, gatewayRefererHeaders, gatewayUserAgent, getActiveHttpRequestOptionsForTests, getGatewayClientOrigin, getGatewayReferer, getGatewayTransactionId, isCicdWarningResponseBody, isCicdWarningStatus, maskUrlSecrets, maskedCicdApiUrl, normalizeCicdBaseUrl, parseRetryAfterHeader, resetGatewayEventLogSenderForTests, resetHttpRequestForTests, resolveAndValidateCicdEndpoint, resolveCicdCredentials, resolveCicdRequestTimeoutMs, resolveConfiguredCicdBaseUrl, runWithGatewayTransactionContext, scheduleGatewayEventLog, setGatewayEventLogSenderForTests, setHttpRequestForTests, tryResolveCicdCredentials};
|