@copado/agentia-cli 1.2.0 → 1.3.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 +30 -1
- package/README.md +2205 -1530
- package/dist/commands/auth/get.js +21 -1
- package/dist/commands/auth/set.js +13 -0
- package/dist/commands/auth/unset.js +37 -0
- package/dist/commands/cicd/cloud/commit.js +2 -2
- package/dist/commands/cicd/cloud/promote.js +19 -5
- package/dist/commands/cicd/credential/auth/status.js +2 -2
- package/dist/commands/cicd/credential/auth/web/login.js +2 -2
- package/dist/commands/cicd/credential/create.js +2 -2
- package/dist/commands/cicd/credential/list.js +2 -2
- package/dist/commands/cicd/credential/open.js +2 -2
- package/dist/commands/cicd/credential/update.js +2 -2
- package/dist/commands/cicd/data/commit/create.js +2 -2
- package/dist/commands/cicd/data/commit/list.js +2 -2
- package/dist/commands/cicd/data/dataset-file/content.js +2 -2
- package/dist/commands/cicd/data/dataset-file/list.js +2 -2
- package/dist/commands/cicd/data/filter/add.js +2 -2
- package/dist/commands/cicd/data/filter/delete.js +2 -2
- package/dist/commands/cicd/data/filter/list.js +2 -2
- package/dist/commands/cicd/data/filter/update.js +2 -2
- package/dist/commands/cicd/data/formula/create.js +2 -2
- package/dist/commands/cicd/data/formula/list.js +2 -2
- package/dist/commands/cicd/data/formula/update.js +2 -2
- package/dist/commands/cicd/data/records/match.js +2 -2
- package/dist/commands/cicd/data/records/search.js +2 -2
- package/dist/commands/cicd/data/sobject/fields.js +2 -2
- package/dist/commands/cicd/data/sobject/relationships.js +2 -2
- package/dist/commands/cicd/data/sync/apply.js +2 -2
- package/dist/commands/cicd/data/sync/preview-updates.js +2 -2
- package/dist/commands/cicd/data/template/convert-old.js +2 -2
- package/dist/commands/cicd/data/template/create.js +2 -2
- package/dist/commands/cicd/data/template/delete.js +2 -2
- package/dist/commands/cicd/data/template/get-detail.js +2 -2
- package/dist/commands/cicd/data/template/get.js +2 -2
- package/dist/commands/cicd/data/template/list.js +2 -2
- package/dist/commands/cicd/data/template/open.js +2 -2
- package/dist/commands/cicd/data/template/save-detail.js +2 -2
- package/dist/commands/cicd/environment/auth/status.js +2 -2
- package/dist/commands/cicd/environment/auth/web/login.js +2 -2
- package/dist/commands/cicd/environment/create.js +2 -2
- package/dist/commands/cicd/environment/get.js +2 -2
- package/dist/commands/cicd/environment/list.js +2 -2
- package/dist/commands/cicd/environment/open.js +2 -2
- package/dist/commands/cicd/environment/update.js +2 -2
- package/dist/commands/cicd/extension/create.js +2 -2
- package/dist/commands/cicd/extension/install.js +2 -2
- package/dist/commands/cicd/extension/package.js +2 -2
- package/dist/commands/cicd/extension/publish.js +2 -2
- package/dist/commands/cicd/extension/uninstall.js +2 -2
- package/dist/commands/cicd/extension/validate.js +2 -2
- package/dist/commands/cicd/extension-configuration/get.js +2 -2
- package/dist/commands/cicd/extension-configuration/list.js +2 -2
- package/dist/commands/cicd/extension-configuration/open.js +2 -2
- package/dist/commands/cicd/function/defaults.js +2 -2
- package/dist/commands/cicd/function/delete.js +2 -2
- package/dist/commands/cicd/function/get.js +2 -2
- package/dist/commands/cicd/function/list.js +2 -2
- package/dist/commands/cicd/function/open.js +2 -2
- package/dist/commands/cicd/function/result/get.js +2 -2
- package/dist/commands/cicd/function/result/log/get.js +2 -2
- package/dist/commands/cicd/function/run-local.js +2 -2
- package/dist/commands/cicd/function/run.js +2 -2
- package/dist/commands/cicd/function/upsert.js +2 -2
- package/dist/commands/cicd/health-check.js +2 -2
- package/dist/commands/cicd/job/get.js +2 -2
- package/dist/commands/cicd/job/kill.js +2 -2
- package/dist/commands/cicd/job/list.js +2 -2
- package/dist/commands/cicd/job/log/get.js +2 -2
- package/dist/commands/cicd/job/open.js +2 -2
- package/dist/commands/cicd/job/pause.js +2 -2
- package/dist/commands/cicd/job/result-file/get.js +2 -2
- package/dist/commands/cicd/job/result-file/list.js +2 -2
- package/dist/commands/cicd/job/resume.js +2 -2
- package/dist/commands/cicd/job/run.js +2 -2
- package/dist/commands/cicd/metadata/content/compare.js +2 -2
- package/dist/commands/cicd/metadata/content/get.js +2 -2
- package/dist/commands/cicd/metadata/dependency/list.js +44 -21
- package/dist/commands/cicd/metadata/explore.js +2 -2
- package/dist/commands/cicd/metadata/index/compare.js +2 -2
- package/dist/commands/cicd/metadata/list.js +2 -2
- package/dist/commands/cicd/metadata/refresh/deleted.js +2 -2
- package/dist/commands/cicd/metadata/refresh/run.js +2 -2
- package/dist/commands/cicd/metadata/refresh/status.js +2 -2
- package/dist/commands/cicd/notification/configure.js +2 -2
- package/dist/commands/cicd/notification/get.js +2 -2
- package/dist/commands/cicd/pipeline/automation/activate.js +2 -2
- package/dist/commands/cicd/pipeline/automation/create.js +2 -2
- package/dist/commands/cicd/pipeline/automation/deactivate.js +2 -2
- package/dist/commands/cicd/pipeline/automation/delete.js +2 -2
- package/dist/commands/cicd/pipeline/automation/get.js +2 -2
- package/dist/commands/cicd/pipeline/automation/list.js +2 -2
- package/dist/commands/cicd/pipeline/automation/open.js +2 -2
- package/dist/commands/cicd/pipeline/automation/update.js +2 -2
- package/dist/commands/cicd/pipeline/connection/create.js +2 -2
- package/dist/commands/cicd/pipeline/connection/delete.js +2 -2
- package/dist/commands/cicd/pipeline/connection/list.js +2 -2
- package/dist/commands/cicd/pipeline/connection/open.js +2 -2
- package/dist/commands/cicd/pipeline/connection/update.js +2 -2
- package/dist/commands/cicd/pipeline/create.js +2 -2
- package/dist/commands/cicd/pipeline/get.js +2 -2
- package/dist/commands/cicd/pipeline/list.js +2 -2
- package/dist/commands/cicd/pipeline/open.js +2 -2
- package/dist/commands/cicd/pipeline/quality-gate/activate.js +2 -2
- package/dist/commands/cicd/pipeline/quality-gate/create.js +2 -2
- package/dist/commands/cicd/pipeline/quality-gate/deactivate.js +2 -2
- package/dist/commands/cicd/pipeline/quality-gate/delete.js +2 -2
- package/dist/commands/cicd/pipeline/quality-gate/get.js +2 -2
- package/dist/commands/cicd/pipeline/quality-gate/list.js +2 -2
- package/dist/commands/cicd/pipeline/quality-gate/open.js +2 -2
- package/dist/commands/cicd/pipeline/quality-gate/update.js +2 -2
- package/dist/commands/cicd/pipeline/stage-connection/create.js +2 -2
- package/dist/commands/cicd/pipeline/stage-connection/delete.js +2 -2
- package/dist/commands/cicd/pipeline/stage-connection/list.js +2 -2
- package/dist/commands/cicd/pipeline/stage-connection/open.js +2 -2
- package/dist/commands/cicd/pipeline/stage-connection/update.js +2 -2
- package/dist/commands/cicd/pipeline/update.js +2 -2
- package/dist/commands/cicd/project/create.js +2 -2
- package/dist/commands/cicd/project/default/get.js +2 -2
- package/dist/commands/cicd/project/default/set.js +2 -2
- package/dist/commands/cicd/project/default/unset.js +2 -2
- package/dist/commands/cicd/project/delete.js +2 -2
- package/dist/commands/cicd/project/get.js +2 -2
- package/dist/commands/cicd/project/list.js +2 -2
- package/dist/commands/cicd/project/open.js +2 -2
- package/dist/commands/cicd/project/update.js +2 -2
- package/dist/commands/cicd/promotion/conflict/get.js +2 -2
- package/dist/commands/cicd/promotion/conflict/list.js +2 -2
- package/dist/commands/cicd/promotion/conflict/resolve.js +2 -2
- package/dist/commands/cicd/promotion/conflict/unresolve.js +2 -2
- package/dist/commands/cicd/promotion/get.js +2 -2
- package/dist/commands/cicd/promotion/job-step/update.js +2 -2
- package/dist/commands/cicd/promotion/list.js +2 -2
- package/dist/commands/cicd/promotion/open.js +2 -2
- package/dist/commands/cicd/promotion/queue/list.js +28 -0
- package/dist/commands/cicd/promotion/queue/remove.js +37 -0
- package/dist/commands/cicd/promotion/run.js +2 -2
- package/dist/commands/cicd/repository/auth/https/configure.js +2 -2
- package/dist/commands/cicd/repository/auth/oauth/login.js +2 -2
- package/dist/commands/cicd/repository/auth/setup.js +2 -2
- package/dist/commands/cicd/repository/auth/ssh/configure.js +2 -2
- package/dist/commands/cicd/repository/create.js +2 -2
- package/dist/commands/cicd/repository/delete.js +2 -2
- package/dist/commands/cicd/repository/get.js +2 -2
- package/dist/commands/cicd/repository/list.js +2 -2
- package/dist/commands/cicd/repository/open.js +2 -2
- package/dist/commands/cicd/repository/reset.js +2 -2
- package/dist/commands/cicd/repository/update.js +2 -2
- package/dist/commands/cicd/repository/validate.js +2 -2
- package/dist/commands/cicd/stage/create.js +2 -2
- package/dist/commands/cicd/stage/delete.js +2 -2
- package/dist/commands/cicd/stage/get.js +2 -2
- package/dist/commands/cicd/stage/list.js +2 -2
- package/dist/commands/cicd/stage/open.js +2 -2
- package/dist/commands/cicd/stage/update.js +2 -2
- package/dist/commands/cicd/template/defaults.js +2 -2
- package/dist/commands/cicd/template/delete.js +2 -2
- package/dist/commands/cicd/template/get.js +2 -2
- package/dist/commands/cicd/template/list.js +2 -2
- package/dist/commands/cicd/template/upsert.js +2 -2
- package/dist/commands/cicd/user/get.js +2 -2
- package/dist/commands/cicd/work/ahead-behind.js +2 -2
- package/dist/commands/cicd/work/create.js +2 -2
- package/dist/commands/cicd/work/delete.js +2 -2
- package/dist/commands/cicd/work/deployment-step/create.js +2 -2
- package/dist/commands/cicd/work/deployment-step/delete.js +2 -2
- package/dist/commands/cicd/work/deployment-step/list.js +2 -2
- package/dist/commands/cicd/work/deployment-step/reorder.js +2 -2
- package/dist/commands/cicd/work/deployment-step/salesforce-flows.js +2 -2
- package/dist/commands/cicd/work/deployment-step/types.js +2 -2
- package/dist/commands/cicd/work/deployment-step/update.js +2 -2
- package/dist/commands/cicd/work/done.js +2 -2
- package/dist/commands/cicd/work/environment-sync.js +2 -2
- package/dist/commands/cicd/work/get.js +2 -2
- package/dist/commands/cicd/work/list.js +2 -2
- package/dist/commands/cicd/work/open.js +2 -2
- package/dist/commands/cicd/work/promote.js +2 -2
- package/dist/commands/cicd/work/publish.js +2 -2
- package/dist/commands/cicd/work/push.js +2 -2
- package/dist/commands/cicd/work/set.js +2 -2
- package/dist/commands/cicd/work/status.js +2 -2
- package/dist/commands/cicd/work/submit.js +2 -2
- package/dist/commands/cicd/work/test/apex.js +2 -2
- package/dist/commands/cicd/work/test.js +2 -2
- package/dist/commands/cicd/work/update.js +2 -2
- package/dist/commands/help-agent.js +15 -0
- package/dist/commands/help.js +38 -0
- package/dist/commands/history/clear.js +42 -0
- package/dist/commands/history/list.js +50 -0
- package/dist/commands/support.js +15 -0
- package/dist/commands/testing/browser/execute.js +49 -0
- package/dist/commands/testing/browser/history.js +49 -0
- package/dist/commands/testing/browser/inspect.js +35 -0
- package/dist/commands/testing/browser/recorder.js +52 -0
- package/dist/commands/testing/browser/reports.js +33 -0
- package/dist/commands/testing/browser/screenshot.js +27 -0
- package/dist/commands/testing/browser/set-options.js +35 -0
- package/dist/commands/testing/browser/start.js +51 -0
- package/dist/commands/testing/browser/status.js +26 -0
- package/dist/commands/testing/browser/stop.js +34 -0
- package/dist/commands/testing/browser/view.js +35 -0
- package/dist/commands/testing/job/runs/abort.js +1 -1
- package/dist/commands/testing/job/runs/get.js +1 -1
- package/dist/commands/testing/job/runs/list.js +1 -1
- package/dist/commands/testing/job/runs/logs.js +1 -1
- package/dist/commands/testing/job/runs/search.js +1 -1
- package/dist/hooks/init/cicd-connection.js +59 -0
- package/dist/lib/agentia-command.js +69 -6
- package/dist/lib/cicd-command.js +3 -0
- package/dist/lib/cicd-connection.js +22 -0
- package/dist/lib/cicd-gateway.js +2 -1
- package/dist/lib/command-history-sanitization.js +9 -0
- package/dist/lib/command-history.js +11 -0
- package/dist/lib/command-output-buffer.js +6 -1
- package/dist/lib/defaults-store.js +3 -1
- package/dist/lib/dependency-from-changes.js +3 -1
- package/dist/lib/dependency-source-context.js +3 -0
- package/dist/lib/help-agent-command.js +3 -0
- package/dist/lib/help-agent-interaction-history.js +10 -0
- package/dist/lib/help-agent-session.js +3 -0
- package/dist/lib/mcp/result.js +41 -3
- package/dist/lib/mcp/server.js +3 -2
- package/dist/lib/mcp/testing-browser-tools.js +194 -0
- package/dist/lib/mcp/testing-tools.js +4 -3
- package/dist/lib/mcp/tool-annotations.js +32 -12
- package/dist/lib/mcp/tools.js +88 -37
- package/dist/lib/promotion-queue.js +5 -0
- package/dist/lib/promotion-run.js +2 -1
- package/dist/lib/runtime.js +1 -1
- package/dist/lib/support-ai-context.js +11 -0
- package/dist/lib/support-ai-stream-parser.js +4 -0
- package/dist/lib/support-ai.js +9 -0
- package/dist/lib/testing-browser-command.js +6 -0
- package/dist/lib/testing-browser-operations.js +17 -0
- package/dist/lib/testing-browser-requests.js +11 -0
- package/dist/lib/testing-browser-robot.js +9 -0
- package/dist/lib/testing-browser-session.js +14 -0
- package/dist/lib/testing-browser-state.js +17 -0
- package/dist/lib/testing-browser-stream.js +7 -0
- package/dist/lib/testing-browser-types.js +3 -0
- package/dist/lib/testing-browser-viewer-key.js +7 -0
- package/dist/lib/testing-gateway.js +2 -1
- package/dist/lib/testing-operations.js +21 -1
- package/dist/lib/testing-sanitization.js +2 -1
- package/dist/lib/work-promote.js +2 -1
- package/oclif.manifest.json +3108 -1450
- package/package.json +11 -4
- package/templates/skills/agentia-ai/SKILL.md +6 -2
- package/templates/skills/agentia-ai/references/ai-agents.md +19 -1
- package/templates/skills/agentia-cicd/SKILL.md +2 -2
- package/templates/skills/agentia-cicd/references/environments-and-credentials.md +16 -0
- package/templates/skills/agentia-cicd/references/promotions.md +10 -1
- package/templates/skills/agentia-metadata/SKILL.md +9 -3
- package/templates/skills/agentia-metadata/references/metadata-dependency.md +70 -0
- package/templates/skills/agentia-metadata/references/metadata-explore.md +8 -4
- package/templates/skills/agentia-testing/SKILL.md +9 -4
- package/templates/skills/agentia-testing/references/browser-testing.md +93 -0
- package/templates/skills/agentia-testing/references/flow-automation.md +112 -0
- package/templates/skills/agentia-testing/references/qforce.md +88 -0
- package/templates/skills/agentia-testing/references/qweb.md +103 -0
- package/templates/skills/agentia-testing/references/tests.md +17 -9
- package/dist/commands/testing/live/continue.js +0 -16
- package/dist/commands/testing/live/execute.js +0 -43
- package/dist/commands/testing/live/history.js +0 -40
- package/dist/commands/testing/live/inspect.js +0 -31
- package/dist/commands/testing/live/interrupt.js +0 -16
- package/dist/commands/testing/live/recorder.js +0 -42
- package/dist/commands/testing/live/reports.js +0 -31
- package/dist/commands/testing/live/screenshot.js +0 -25
- package/dist/commands/testing/live/set-options.js +0 -35
- package/dist/commands/testing/live/start.js +0 -58
- package/dist/commands/testing/live/status.js +0 -24
- package/dist/commands/testing/live/stop.js +0 -36
- package/dist/commands/testing/live/view.js +0 -36
- package/dist/lib/mcp/testing-live-tools.js +0 -226
- package/dist/lib/testing-live-command.js +0 -8
- package/dist/lib/testing-live-operations.js +0 -25
- package/dist/lib/testing-live-recorder.js +0 -11
- package/dist/lib/testing-live-robot.js +0 -9
- package/dist/lib/testing-live-state.js +0 -12
- package/dist/lib/testing-live-types.js +0 -3
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* Every tool is classified here explicitly. `test/lib/mcp/tool-annotations.test.ts` fails when a
|
|
8
8
|
* registered tool is missing from the table, so new tools must be classified when they are added.
|
|
9
9
|
*/
|
|
10
|
+
import { z } from 'zod';
|
|
10
11
|
/** MCP spec: destructive means the tool may overwrite or remove existing state, not only add. */
|
|
11
12
|
const CLASS_ANNOTATIONS = {
|
|
12
13
|
// Runs or triggers something with side effects; repeating it repeats the effect.
|
|
@@ -47,10 +48,8 @@ const ACTION_TOOLS = [
|
|
|
47
48
|
'agentia_promotion_run',
|
|
48
49
|
'agentia_testing_job_runs_abort',
|
|
49
50
|
'agentia_testing_job_run',
|
|
50
|
-
'
|
|
51
|
-
'
|
|
52
|
-
'agentia_testing_live_interrupt',
|
|
53
|
-
'agentia_testing_live_stop',
|
|
51
|
+
'agentia_testing_browser_execute',
|
|
52
|
+
'agentia_testing_browser_stop',
|
|
54
53
|
'agentia_work_commit',
|
|
55
54
|
'agentia_work_done',
|
|
56
55
|
'agentia_work_publish',
|
|
@@ -82,7 +81,7 @@ const CREATE_TOOLS = [
|
|
|
82
81
|
'agentia_testing_data_table_create',
|
|
83
82
|
'agentia_testing_job_create',
|
|
84
83
|
'agentia_testing_job_files_download',
|
|
85
|
-
'
|
|
84
|
+
'agentia_testing_browser_start',
|
|
86
85
|
'agentia_testing_project_create',
|
|
87
86
|
'agentia_testing_robot_create',
|
|
88
87
|
'agentia_testing_user_parameter_create',
|
|
@@ -103,6 +102,7 @@ const DELETE_TOOLS = [
|
|
|
103
102
|
'agentia_project_delete',
|
|
104
103
|
'agentia_repository_delete',
|
|
105
104
|
'agentia_repository_reset',
|
|
105
|
+
'agentia_promotion_queue_remove',
|
|
106
106
|
'agentia_stage_delete',
|
|
107
107
|
'agentia_testing_data_table_delete',
|
|
108
108
|
'agentia_testing_job_delete',
|
|
@@ -161,6 +161,7 @@ const READ_TOOLS = [
|
|
|
161
161
|
'agentia_job_get',
|
|
162
162
|
'agentia_job_list',
|
|
163
163
|
'agentia_job_log_get',
|
|
164
|
+
'agentia_promotion_queue_list',
|
|
164
165
|
'agentia_job_result_file_get',
|
|
165
166
|
'agentia_job_result_file_list',
|
|
166
167
|
'agentia_metadata_content_compare',
|
|
@@ -202,11 +203,11 @@ const READ_TOOLS = [
|
|
|
202
203
|
'agentia_testing_job_list',
|
|
203
204
|
'agentia_testing_job_refs',
|
|
204
205
|
'agentia_testing_job_schedule_get',
|
|
205
|
-
'
|
|
206
|
-
'
|
|
207
|
-
'
|
|
208
|
-
'
|
|
209
|
-
'
|
|
206
|
+
'agentia_testing_browser_history',
|
|
207
|
+
'agentia_testing_browser_inspect',
|
|
208
|
+
'agentia_testing_browser_reports',
|
|
209
|
+
'agentia_testing_browser_screenshot',
|
|
210
|
+
'agentia_testing_browser_status',
|
|
210
211
|
'agentia_testing_project_get',
|
|
211
212
|
'agentia_testing_project_list',
|
|
212
213
|
'agentia_testing_project_permission_get',
|
|
@@ -258,7 +259,7 @@ const UPDATE_TOOLS = [
|
|
|
258
259
|
'agentia_testing_job_schedule_set',
|
|
259
260
|
'agentia_testing_job_update',
|
|
260
261
|
'agentia_testing_job_files_upload',
|
|
261
|
-
'
|
|
262
|
+
'agentia_testing_browser_set_options',
|
|
262
263
|
'agentia_testing_project_permission_set',
|
|
263
264
|
'agentia_testing_project_permission_update',
|
|
264
265
|
'agentia_testing_project_update',
|
|
@@ -294,12 +295,31 @@ export function getToolAnnotations(toolName) {
|
|
|
294
295
|
return undefined;
|
|
295
296
|
return { ...CLASS_ANNOTATIONS[toolClass], openWorldHint: !LOCAL_ONLY_TOOLS.has(toolName) };
|
|
296
297
|
}
|
|
298
|
+
const cicdConnectionSchemaField = z
|
|
299
|
+
.string()
|
|
300
|
+
.optional()
|
|
301
|
+
.describe('Named CICD connection for this call only (see agentia auth set --connection). Does not change stored default auth.');
|
|
302
|
+
function usesCicdGateway(toolName) {
|
|
303
|
+
if (LOCAL_ONLY_TOOLS.has(toolName))
|
|
304
|
+
return false;
|
|
305
|
+
if (toolName.startsWith('agentia_testing_'))
|
|
306
|
+
return false;
|
|
307
|
+
if (toolName.startsWith('agentia_ai_'))
|
|
308
|
+
return false;
|
|
309
|
+
if (toolName.startsWith('agentia_adv_'))
|
|
310
|
+
return false;
|
|
311
|
+
return true;
|
|
312
|
+
}
|
|
297
313
|
/** Returns the tool config with default annotations; annotations already set on the tool win. */
|
|
298
314
|
export function withToolAnnotations(toolName, config) {
|
|
299
315
|
const defaults = getToolAnnotations(toolName);
|
|
300
316
|
if (defaults === undefined || typeof config !== 'object' || config === null)
|
|
301
317
|
return config;
|
|
302
318
|
const existing = config.annotations;
|
|
303
|
-
|
|
319
|
+
const inputSchema = config.inputSchema;
|
|
320
|
+
const withConnection = usesCicdGateway(toolName) && inputSchema !== undefined && inputSchema.cicdConnection === undefined
|
|
321
|
+
? { inputSchema: { ...inputSchema, cicdConnection: cicdConnectionSchemaField } }
|
|
322
|
+
: {};
|
|
323
|
+
return { ...config, ...withConnection, annotations: { ...defaults, ...existing } };
|
|
304
324
|
}
|
|
305
325
|
//# sourceMappingURL=tool-annotations.js.map
|
package/dist/lib/mcp/tools.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { buildMetadataCompareFileRequests } from '../../commands/cicd/metadata/content/compare.js';
|
|
4
4
|
import { buildMetadataContentRequest } from '../../commands/cicd/metadata/content/get.js';
|
|
5
|
+
import { buildDependencyRequest, enrichDependencyResult, } from '../../commands/cicd/metadata/dependency/list.js';
|
|
5
6
|
import { buildMetadataCompareRequest } from '../../commands/cicd/metadata/index/compare.js';
|
|
6
7
|
import { buildMetadataIndexRequest } from '../../commands/cicd/metadata/list.js';
|
|
7
8
|
import { AI_METADATA_ACTIONS, buildAiMetadataToolRequest, callAiMetadataTool, } from '../metadata-explore.js';
|
|
@@ -20,6 +21,7 @@ import { DEFAULT_ENVIRONMENT_PLATFORM, DEFAULT_ENVIRONMENT_TYPE, ENVIRONMENT_TYP
|
|
|
20
21
|
import { executeLocalFunctionRun } from '../function-local-run.js';
|
|
21
22
|
import { FUNCTION_LIST_TYPES, FUNCTION_RUNTIMES, functionEndpoint, functionResultEndpoint, functionResultLogEndpoint, functionRunEndpoint, functionsEndpoint, normalizeFunction, normalizeFunctionResultStatus, normalizeFunctionRunResult, normalizeFunctionsListPage, normalizeFunctionUpsertPayload, } from '../function-types.js';
|
|
22
23
|
import { fetchJob, fetchJobs } from '../job-get.js';
|
|
24
|
+
import { fetchPromotionQueue, removePromotionQueueItems } from '../promotion-queue.js';
|
|
23
25
|
import { jobEndpoint, jobKillEndpoint, jobPauseEndpoint, jobResultFileContentEndpoint, jobResultFilesEndpoint, jobResultLogEndpoint, jobResumeEndpoint, jobRunEndpoint, normalizeJob, normalizeJobOperation, normalizeJobResultFileContent, normalizeJobResultFiles, resolveJobStepForLog, } from '../job-types.js';
|
|
24
26
|
import { listPaginationZodFields, mcpPaginatedListPayload } from '../list-pagination.js';
|
|
25
27
|
import { COMPARISON_MODES, CONTENT_SOURCES, contentResultToCompareSide, createUnifiedDiff, INDEX_SOURCES, MODULE_TYPES, ORDER_DIRECTIONS, PLATFORM_EXPERIENCES, RETRIEVE_MODES, sourceSideLabel, } from '../metadata-common.js';
|
|
@@ -287,6 +289,12 @@ async function jobPause(args) {
|
|
|
287
289
|
});
|
|
288
290
|
return { result: normalizeJobOperation(result) };
|
|
289
291
|
}
|
|
292
|
+
async function promotionQueueList(args) {
|
|
293
|
+
return { queue: await fetchPromotionQueue(assertRequired(args.promotion, 'promotion')) };
|
|
294
|
+
}
|
|
295
|
+
async function promotionQueueRemove(args) {
|
|
296
|
+
return { queue: await removePromotionQueueItems(assertRequired(args.promotion, 'promotion'), args.itemIds) };
|
|
297
|
+
}
|
|
290
298
|
async function pipelineList(args = {}) {
|
|
291
299
|
return mcpPaginatedListPayload('pipelines', await fetchPipelines(args));
|
|
292
300
|
}
|
|
@@ -999,44 +1007,47 @@ async function metadataExplore(args) {
|
|
|
999
1007
|
output,
|
|
1000
1008
|
};
|
|
1001
1009
|
}
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
type: assertRequired(args.metadataType, 'metadataType'),
|
|
1006
|
-
};
|
|
1007
|
-
if (args.metadataCategory) {
|
|
1008
|
-
selection.category = args.metadataCategory;
|
|
1010
|
+
function normalizeDependencyPathArg(path) {
|
|
1011
|
+
if (path === undefined) {
|
|
1012
|
+
return undefined;
|
|
1009
1013
|
}
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
};
|
|
1018
|
-
if (args.targetOrgId) {
|
|
1019
|
-
body.compareOptions.targetOrgId = args.targetOrgId;
|
|
1020
|
-
}
|
|
1021
|
-
if (args.retrieveMode) {
|
|
1022
|
-
body.compareOptions.retrieveMode = args.retrieveMode;
|
|
1023
|
-
}
|
|
1024
|
-
if (args.moduleType) {
|
|
1025
|
-
body.moduleType = args.moduleType;
|
|
1026
|
-
}
|
|
1027
|
-
if (args.resultId) {
|
|
1028
|
-
body.resultId = args.resultId;
|
|
1014
|
+
const paths = (Array.isArray(path) ? path : [path]).map((entry) => entry.trim()).filter(Boolean);
|
|
1015
|
+
return paths.length > 0 ? paths : undefined;
|
|
1016
|
+
}
|
|
1017
|
+
async function metadataDependencyList(args) {
|
|
1018
|
+
const paths = normalizeDependencyPathArg(args.path);
|
|
1019
|
+
if (paths && (args.metadataName || args.metadataType)) {
|
|
1020
|
+
throw new Error('Use either path or metadataName/metadataType, not both.');
|
|
1029
1021
|
}
|
|
1030
|
-
const platformExperience =
|
|
1031
|
-
|
|
1022
|
+
const { body, localPathsBySelection, platformExperience } = await buildDependencyRequest({
|
|
1023
|
+
'base-ref': 'origin/main',
|
|
1024
|
+
'from-changes': false,
|
|
1025
|
+
'metadata-category': args.metadataCategory,
|
|
1026
|
+
'metadata-name': args.metadataName,
|
|
1027
|
+
'metadata-type': args.metadataType,
|
|
1028
|
+
'module-type': args.moduleType,
|
|
1029
|
+
path: paths,
|
|
1030
|
+
'pipeline-id': args.pipelineId,
|
|
1031
|
+
'platform-experience': args.platformExperience,
|
|
1032
|
+
'result-id': args.resultId,
|
|
1033
|
+
'retrieve-mode': args.retrieveMode,
|
|
1034
|
+
'source-credential-id': args.sourceCredentialId,
|
|
1035
|
+
'source-org-id': args.sourceOrgId,
|
|
1036
|
+
stdin: false,
|
|
1037
|
+
'target-org-id': args.targetOrgId,
|
|
1038
|
+
});
|
|
1039
|
+
const gatewayResult = await CicdGateway.call({
|
|
1032
1040
|
body,
|
|
1033
1041
|
endpoint: '/release/metadata/dependencies',
|
|
1034
1042
|
headers: {
|
|
1035
1043
|
'Content-Type': 'application/json',
|
|
1036
|
-
'platform-experience': platformExperience,
|
|
1044
|
+
...(platformExperience === undefined ? {} : { 'platform-experience': platformExperience }),
|
|
1037
1045
|
},
|
|
1038
1046
|
method: 'POST',
|
|
1039
1047
|
});
|
|
1048
|
+
const result = localPathsBySelection
|
|
1049
|
+
? await enrichDependencyResult(gatewayResult, localPathsBySelection, args.moduleType)
|
|
1050
|
+
: gatewayResult;
|
|
1040
1051
|
return { result };
|
|
1041
1052
|
}
|
|
1042
1053
|
function authCredentialResult(type) {
|
|
@@ -1310,6 +1321,8 @@ export const agentiaMcpToolHandlers = wrapMcpToolHandlers({
|
|
|
1310
1321
|
jobList,
|
|
1311
1322
|
jobLogGet,
|
|
1312
1323
|
jobPause,
|
|
1324
|
+
promotionQueueList,
|
|
1325
|
+
promotionQueueRemove,
|
|
1313
1326
|
jobResultFileGet,
|
|
1314
1327
|
jobResultFileList,
|
|
1315
1328
|
jobResume,
|
|
@@ -1643,6 +1656,19 @@ export function registerAgentiaMcpTools(server) {
|
|
|
1643
1656
|
},
|
|
1644
1657
|
title: 'Agentia Job Pause',
|
|
1645
1658
|
}, (args) => safelyHandleTool(() => jobPause(args)));
|
|
1659
|
+
server.registerTool('agentia_promotion_queue_list', {
|
|
1660
|
+
description: 'List the promotion queue for a Copado promotion via the CICD gateway.',
|
|
1661
|
+
inputSchema: { promotion: z.string().describe('Copado promotion ID or name.') },
|
|
1662
|
+
title: 'Agentia Promotion Queue List',
|
|
1663
|
+
}, (args) => safelyHandleTool(() => promotionQueueList(args)));
|
|
1664
|
+
server.registerTool('agentia_promotion_queue_remove', {
|
|
1665
|
+
description: 'Remove items from a Copado promotion promotion queue via the CICD gateway (requires the Manage Queue permission).',
|
|
1666
|
+
inputSchema: {
|
|
1667
|
+
itemIds: z.array(z.string()).min(1).describe('Queue item IDs to remove (from agentia_promotion_queue_list).'),
|
|
1668
|
+
promotion: z.string().describe('Copado promotion ID or name.'),
|
|
1669
|
+
},
|
|
1670
|
+
title: 'Agentia Promotion Queue Remove',
|
|
1671
|
+
}, (args) => safelyHandleTool(() => promotionQueueRemove(args)));
|
|
1646
1672
|
server.registerTool('agentia_pipeline_list', {
|
|
1647
1673
|
description: 'List Copado pipelines via the CICD gateway.',
|
|
1648
1674
|
inputSchema: {
|
|
@@ -1956,19 +1982,44 @@ export function registerAgentiaMcpTools(server) {
|
|
|
1956
1982
|
title: 'Agentia Metadata Content Compare',
|
|
1957
1983
|
}, (args) => safelyHandleTool(() => metadataContentCompare(args)));
|
|
1958
1984
|
server.registerTool('agentia_metadata_dependency_list', {
|
|
1959
|
-
description: 'Retrieve metadata dependencies.',
|
|
1985
|
+
description: 'Retrieve metadata dependencies. Provide either path (one or more local Salesforce source files) or both metadataName and metadataType. pipelineId, sourceCredentialId, sourceOrgId, and platformExperience default from the active work item or project defaults when omitted; targetOrgId is never inferred.',
|
|
1960
1986
|
inputSchema: {
|
|
1961
1987
|
metadataCategory: z.string().optional().describe('Optional metadata category.'),
|
|
1962
|
-
metadataName: z
|
|
1963
|
-
|
|
1988
|
+
metadataName: z
|
|
1989
|
+
.string()
|
|
1990
|
+
.optional()
|
|
1991
|
+
.describe('Metadata API name. Required with metadataType when path is omitted.'),
|
|
1992
|
+
metadataType: z
|
|
1993
|
+
.string()
|
|
1994
|
+
.optional()
|
|
1995
|
+
.describe('Metadata type, for example ApexClass. Required with metadataName when path is omitted.'),
|
|
1964
1996
|
moduleType: z.enum(MODULE_TYPES).optional().describe('Optional addon module type.'),
|
|
1965
|
-
|
|
1966
|
-
|
|
1997
|
+
path: z
|
|
1998
|
+
.union([z.string(), z.array(z.string())])
|
|
1999
|
+
.optional()
|
|
2000
|
+
.describe('Local Salesforce source file path(s) resolved into metadata selections. Mutually exclusive with metadataName/metadataType.'),
|
|
2001
|
+
pipelineId: z
|
|
2002
|
+
.string()
|
|
2003
|
+
.optional()
|
|
2004
|
+
.describe('Pipeline Id. Defaults to the active work item pipelineId or the project default pipeline.'),
|
|
2005
|
+
platformExperience: z
|
|
2006
|
+
.enum(PLATFORM_EXPERIENCES)
|
|
2007
|
+
.optional()
|
|
2008
|
+
.describe('Platform experience header. Defaults to the active work item platform, then sfdx.'),
|
|
1967
2009
|
resultId: z.string().optional().describe('Optional result Id from a prior metadata operation.'),
|
|
1968
2010
|
retrieveMode: z.enum(RETRIEVE_MODES).optional().describe('Dependency retrieve mode.'),
|
|
1969
|
-
sourceCredentialId: z
|
|
1970
|
-
|
|
1971
|
-
|
|
2011
|
+
sourceCredentialId: z
|
|
2012
|
+
.string()
|
|
2013
|
+
.optional()
|
|
2014
|
+
.describe('Source org credential Id. Defaults to the active work item source credential or the project default credential.'),
|
|
2015
|
+
sourceOrgId: z
|
|
2016
|
+
.string()
|
|
2017
|
+
.optional()
|
|
2018
|
+
.describe('Source org Id. Defaults to the active work item sourceOrgId or orgId from the resolved credential/environment.'),
|
|
2019
|
+
targetOrgId: z
|
|
2020
|
+
.string()
|
|
2021
|
+
.optional()
|
|
2022
|
+
.describe('Optional target org Id. Not inferred from work item or project defaults.'),
|
|
1972
2023
|
},
|
|
1973
2024
|
title: 'Agentia Metadata Dependency List',
|
|
1974
2025
|
}, (args) => safelyHandleTool(() => metadataDependencyList(args)));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import {modules} from './runtime.js';
|
|
2
|
+
const fetchPromotionQueue = modules["promotion-queue.js"]["fetchPromotionQueue"]
|
|
3
|
+
const formatPromotionQueueTable = modules["promotion-queue.js"]["formatPromotionQueueTable"]
|
|
4
|
+
const removePromotionQueueItems = modules["promotion-queue.js"]["removePromotionQueueItems"]
|
|
5
|
+
export {fetchPromotionQueue, formatPromotionQueueTable, removePromotionQueueItems};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {modules} from './runtime.js';
|
|
2
|
+
const NoPromotionForUserStoryError = modules["promotion-run.js"]["NoPromotionForUserStoryError"]
|
|
2
3
|
const PROMOTION_OPERATIONS = modules["promotion-run.js"]["PROMOTION_OPERATIONS"]
|
|
3
4
|
const PROMOTION_RUN_DEFAULT_TIMEOUT_SECONDS = modules["promotion-run.js"]["PROMOTION_RUN_DEFAULT_TIMEOUT_SECONDS"]
|
|
4
5
|
const PromotionRunIncompleteResponseError = modules["promotion-run.js"]["PromotionRunIncompleteResponseError"]
|
|
@@ -24,4 +25,4 @@ const requirePromotionId = modules["promotion-run.js"]["requirePromotionId"]
|
|
|
24
25
|
const resetPromotionRunSleepForTests = modules["promotion-run.js"]["resetPromotionRunSleepForTests"]
|
|
25
26
|
const resolvePromotionIdForWorkItem = modules["promotion-run.js"]["resolvePromotionIdForWorkItem"]
|
|
26
27
|
const setPromotionRunSleepForTests = modules["promotion-run.js"]["setPromotionRunSleepForTests"]
|
|
27
|
-
export {PROMOTION_OPERATIONS, PROMOTION_RUN_DEFAULT_TIMEOUT_SECONDS, PromotionRunIncompleteResponseError, PromotionRunJobFailedError, PromotionRunTimeoutError, PromotionRunValidationError, assertPromotionContextReady, formatPromotionRunResult, isPromotionRunExecutionError, parseIgnoredMetadataJson, performPromotionResume, performPromotionRun, promotionContextEndpoint, promotionDeploymentStepsEndpoint, promotionIgnoredMetadataEndpoint, promotionJobMonitorEndpoint, promotionResumeEndpoint, promotionRunDetailEndpoint, promotionRunEndpoint, promotionRunErrorJson, promotionValidateResolutionEndpoint, requirePromotionId, resetPromotionRunSleepForTests, resolvePromotionIdForWorkItem, setPromotionRunSleepForTests};
|
|
28
|
+
export {NoPromotionForUserStoryError, PROMOTION_OPERATIONS, PROMOTION_RUN_DEFAULT_TIMEOUT_SECONDS, PromotionRunIncompleteResponseError, PromotionRunJobFailedError, PromotionRunTimeoutError, PromotionRunValidationError, assertPromotionContextReady, formatPromotionRunResult, isPromotionRunExecutionError, parseIgnoredMetadataJson, performPromotionResume, performPromotionRun, promotionContextEndpoint, promotionDeploymentStepsEndpoint, promotionIgnoredMetadataEndpoint, promotionJobMonitorEndpoint, promotionResumeEndpoint, promotionRunDetailEndpoint, promotionRunEndpoint, promotionRunErrorJson, promotionValidateResolutionEndpoint, requirePromotionId, resetPromotionRunSleepForTests, resolvePromotionIdForWorkItem, setPromotionRunSleepForTests};
|