@copado/agentia-cli 1.0.0-beta.1 → 1.0.0-beta.4
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 +67 -0
- package/README.md +648 -370
- package/dist/commands/cicd/cloud/commit.js +252 -0
- package/dist/commands/cicd/cloud/promote.js +139 -0
- package/dist/commands/cicd/data/template/save-detail.js +2 -2
- package/dist/commands/cicd/health-check.js +77 -0
- package/dist/commands/cicd/repository/auth/https/configure.js +21 -0
- package/dist/commands/cicd/repository/auth/oauth/login.js +56 -0
- package/dist/commands/cicd/repository/auth/setup.js +28 -0
- package/dist/commands/cicd/repository/auth/ssh/configure.js +22 -0
- package/dist/commands/cicd/repository/create.js +2 -2
- package/dist/commands/cicd/repository/reset.js +17 -5
- package/dist/commands/cicd/repository/update.js +6 -14
- package/dist/commands/cicd/work/commit.js +10 -324
- package/dist/commands/cicd/work/environment-sync.js +125 -0
- package/dist/commands/cicd/work/get.js +29 -12
- package/dist/commands/cicd/work/promote.js +93 -97
- package/dist/commands/cicd/work/set.js +4 -2
- package/dist/commands/cicd/work/submit.js +7 -0
- package/dist/commands/runtime.js +26 -0
- package/dist/hooks/finally/ide-command-event.js +1 -1
- package/dist/hooks/init/plugin-host.js +6 -0
- package/dist/lib/agentia-command.js +16 -0
- package/dist/lib/cursor-mcp-config.js +3 -1
- package/dist/lib/data-types.js +3 -1
- package/dist/lib/defaults-store.js +2 -1
- package/dist/lib/git-sizer.js +5 -0
- package/dist/lib/git-worktree.js +17 -1
- package/dist/lib/health-check.js +3 -0
- package/dist/lib/mcp/command-id.js +1 -0
- package/dist/lib/mcp/data-tools.js +2 -2
- package/dist/lib/mcp/health-check-tools.js +16 -0
- package/dist/lib/mcp/server.js +35 -8
- package/dist/lib/mcp/tool-annotations.js +268 -0
- package/dist/lib/mcp/tools.js +58 -12
- package/dist/lib/mcp/work-tools.js +98 -83
- package/dist/lib/metadata-pathspecs.js +4 -0
- package/dist/lib/metadataRegistry.json +5427 -0
- package/dist/lib/plugin-host/auth.js +4 -0
- package/dist/lib/plugin-host/format.js +3 -0
- package/dist/lib/plugin-host/index.js +7 -0
- package/dist/lib/plugin-host/organization.js +4 -0
- package/dist/lib/plugin-host/projection-utils.js +6 -0
- package/dist/lib/plugin-host/registry.js +6 -0
- package/dist/lib/plugin-host/request-scope.js +4 -0
- package/dist/lib/plugin-host/work.js +4 -0
- package/dist/lib/project-root.js +3 -1
- package/dist/lib/promotion-types.js +4 -1
- package/dist/lib/repository-auth.js +8 -0
- package/dist/lib/repository-flags.js +2 -2
- package/dist/lib/repository-types.js +6 -1
- package/dist/lib/repository-url-prefill.js +4 -0
- package/dist/lib/runtime-invoke-context.js +6 -0
- package/dist/lib/runtime-rpc.js +14 -0
- package/dist/lib/runtime.js +1 -1
- package/dist/lib/work-environment-sync-errors.js +4 -0
- package/dist/lib/work-environment-sync-ready.js +18 -0
- package/dist/lib/work-environment-sync.js +41 -0
- package/dist/lib/work-get.js +3 -0
- package/dist/lib/work-promote-deploy.js +13 -0
- package/dist/lib/work-promote-errors.js +5 -0
- package/dist/lib/work-promote.js +12 -0
- package/dist/lib/work-set-selection.js +2 -1
- package/dist/lib/work-submit-ahead-behind.js +8 -0
- package/dist/lib/work-types.js +2 -1
- package/oclif.manifest.json +1166 -605
- package/package.json +8 -4
- package/templates/skills/agentia-cicd/SKILL.md +2 -2
- package/templates/skills/agentia-cicd/references/promotions.md +8 -8
- package/templates/skills/agentia-cicd/references/work.md +16 -14
|
@@ -14,6 +14,7 @@ import { runWorkTestLocalQualityGates } from '../stock-quality-gates.js';
|
|
|
14
14
|
import { getUserContext } from '../user-context.js';
|
|
15
15
|
import { resolveWorkItemId } from '../work-active.js';
|
|
16
16
|
import { DEFAULT_APEX_TEST_WAIT_MINUTES, parseApexTestClassNames, runWorkApexTests, validateApexTestWaitMinutes, } from '../work-apex-test.js';
|
|
17
|
+
import { fetchUserStory } from '../work-get.js';
|
|
17
18
|
import { buildWorkCommitRequest, normalizeWorkCommitInput, performWorkCommit, resolveWorkCommitPlatformExperience, WORK_COMMIT_ACTIONS, WORK_COMMIT_CHANGES_HELP, WORK_COMMIT_DEFAULT_TIMEOUT_SECONDS, WORK_COMMIT_METADATA_CATEGORY_HELP, } from '../work-commit.js';
|
|
18
19
|
import { buildWorkCreatePayload } from '../work-defaults.js';
|
|
19
20
|
import { validateWorkMutationPayload, WORK_LONG_TEXT_MAX_LENGTH, WORK_SHORT_TEXT_MAX_LENGTH, } from '../work-flags.js';
|
|
@@ -21,7 +22,8 @@ import { performWorkLocalCommit } from '../work-local-commit.js';
|
|
|
21
22
|
import { reportLocalQualityGatesFailure, reportLocalQualityGatesOutcome, } from '../work-local-run-tests.js';
|
|
22
23
|
import { capturingWorkPushHooks, performWorkPush, resolveActiveFeatureWorkItem, resolveWorkPushContext, resolveWorkPushNeed, } from '../work-push.js';
|
|
23
24
|
import { performWorkSetNone } from '../work-set-none.js';
|
|
24
|
-
import { isWorkSetWarning, parseWorkSetSelection, toWorkSetWarningResult } from '../work-set-selection.js';
|
|
25
|
+
import { isWorkSetWarning, parseWorkSetSelection, toWorkSetWarningResult, writeWorkSetWarningSelection, } from '../work-set-selection.js';
|
|
26
|
+
import { reportSubmitUserStoriesAheadBehind } from '../work-submit-ahead-behind.js';
|
|
25
27
|
import { waitForPendingCommitJobIfNeeded } from '../work-submit-wait.js';
|
|
26
28
|
import { applySourceCredentialEnvironmentRule, featureBranchName, normalizeUserStoriesListPage, workCreateEndpoint, workDoneEndpoint, workEndpoint, workListEndpoint, workSetEndpoint, workSubmitEndpoint, } from '../work-types.js';
|
|
27
29
|
import { safelyHandleTool } from './result.js';
|
|
@@ -127,11 +129,7 @@ async function workList(args = {}) {
|
|
|
127
129
|
return mcpPaginatedListPayload('userStories', normalizeUserStoriesListPage(response));
|
|
128
130
|
}
|
|
129
131
|
async function workGet(args = {}) {
|
|
130
|
-
const
|
|
131
|
-
const userStory = await CicdGateway.call({
|
|
132
|
-
endpoint: workEndpoint(workItemId),
|
|
133
|
-
method: 'GET',
|
|
134
|
-
});
|
|
132
|
+
const userStory = await fetchUserStory(args.id);
|
|
135
133
|
return { userStory };
|
|
136
134
|
}
|
|
137
135
|
async function workCreate(args = {}) {
|
|
@@ -213,6 +211,7 @@ async function workSet(args) {
|
|
|
213
211
|
method: 'POST',
|
|
214
212
|
});
|
|
215
213
|
if (isWorkSetWarning(setResponse)) {
|
|
214
|
+
await writeWorkSetWarningSelection(setResponse);
|
|
216
215
|
return toWorkSetWarningResult(setResponse);
|
|
217
216
|
}
|
|
218
217
|
const selection = parseWorkSetSelection(setResponse, args.baseBranch);
|
|
@@ -262,6 +261,12 @@ async function workPublish(args = {}) {
|
|
|
262
261
|
async function workPush(args = {}) {
|
|
263
262
|
return workPublish(args);
|
|
264
263
|
}
|
|
264
|
+
async function reportSubmitAheadBehindForMcp(workItem) {
|
|
265
|
+
return reportSubmitUserStoriesAheadBehind(workItem, {
|
|
266
|
+
log: (message) => capturingWorkPushHooks.log(message),
|
|
267
|
+
warn: (message) => capturingWorkPushHooks.log(`Warning: ${message}`),
|
|
268
|
+
});
|
|
269
|
+
}
|
|
265
270
|
async function promoteWorkItemDone(args = {}) {
|
|
266
271
|
return withCapturedCommandOutput(async () => {
|
|
267
272
|
const { branch, workItem } = await requireFeatureBranchWorkItem();
|
|
@@ -276,6 +281,7 @@ async function promoteWorkItemDone(args = {}) {
|
|
|
276
281
|
skipNestedMetadataDetection: args.skipNestedMetadataDetection,
|
|
277
282
|
});
|
|
278
283
|
}
|
|
284
|
+
const userStoriesAheadBehind = await reportSubmitAheadBehindForMcp(workItem);
|
|
279
285
|
await waitForPendingCommitJobIfNeeded({
|
|
280
286
|
hooks: capturingWorkPushHooks,
|
|
281
287
|
workItem,
|
|
@@ -294,6 +300,7 @@ async function promoteWorkItemDone(args = {}) {
|
|
|
294
300
|
done,
|
|
295
301
|
push: pushResult,
|
|
296
302
|
pushed: needsPush,
|
|
303
|
+
...(userStoriesAheadBehind === undefined ? {} : { userStoriesAheadBehind }),
|
|
297
304
|
workItem,
|
|
298
305
|
};
|
|
299
306
|
}, MCP_STDIO_CAPTURE_OPTIONS);
|
|
@@ -341,6 +348,7 @@ async function workSubmit(args = {}) {
|
|
|
341
348
|
skipNestedMetadataDetection: args.skipNestedMetadataDetection,
|
|
342
349
|
});
|
|
343
350
|
}
|
|
351
|
+
const userStoriesAheadBehind = await reportSubmitAheadBehindForMcp(workItem);
|
|
344
352
|
await waitForPendingCommitJobIfNeeded({
|
|
345
353
|
hooks: capturingWorkPushHooks,
|
|
346
354
|
workItem,
|
|
@@ -359,6 +367,7 @@ async function workSubmit(args = {}) {
|
|
|
359
367
|
pushed: needsPush,
|
|
360
368
|
qualityGates,
|
|
361
369
|
submit,
|
|
370
|
+
...(userStoriesAheadBehind === undefined ? {} : { userStoriesAheadBehind }),
|
|
362
371
|
workItem,
|
|
363
372
|
};
|
|
364
373
|
}, MCP_STDIO_CAPTURE_OPTIONS);
|
|
@@ -428,7 +437,7 @@ function providedCommitArgs(names, args) {
|
|
|
428
437
|
async function workLocalCommit(args) {
|
|
429
438
|
const cloudOnly = providedCommitArgs(CLOUD_ONLY_COMMIT_ARGS, args);
|
|
430
439
|
if (cloudOnly.length > 0) {
|
|
431
|
-
throw new Error(`Local commit does not support ${cloudOnly.join(', ')}.
|
|
440
|
+
throw new Error(`Local commit does not support ${cloudOnly.join(', ')}. Use agentia_cloud_commit for POST /release/commit.`);
|
|
432
441
|
}
|
|
433
442
|
return performWorkLocalCommit({
|
|
434
443
|
all: args.all === true,
|
|
@@ -469,17 +478,13 @@ function buildMcpWorkCommitInput(args) {
|
|
|
469
478
|
recreateFeatureBranch: args.recreateFeatureBranch,
|
|
470
479
|
};
|
|
471
480
|
}
|
|
472
|
-
async function
|
|
473
|
-
// Local git commit is not exposed. Implementation remains in workLocalCommit.
|
|
474
|
-
if (args.cloud !== true) {
|
|
475
|
-
throw new Error('This tool creates Copado cloud metadata commits. For local Git work, use git commit then agentia_work_publish. Pass cloud: true for a Copado cloud commit. Permission and full-metadata selections belong on agentia_work_publish.');
|
|
476
|
-
}
|
|
481
|
+
async function cloudCommit(args = {}) {
|
|
477
482
|
if (args.local === true) {
|
|
478
|
-
throw new Error('
|
|
483
|
+
throw new Error('This tool creates Copado cloud metadata commits. For local Git work, use git commit then agentia_work_publish.');
|
|
479
484
|
}
|
|
480
485
|
const localOnly = providedCommitArgs(LOCAL_ONLY_COMMIT_ARGS, args);
|
|
481
486
|
if (localOnly.length > 0) {
|
|
482
|
-
throw new Error(`Cloud commit does not support ${localOnly.join(', ')}.`);
|
|
487
|
+
throw new Error(`Cloud commit does not support ${localOnly.join(', ')}. Use agentia_work_publish for ${localOnly.join(', ')}.`);
|
|
483
488
|
}
|
|
484
489
|
if (args.changes !== undefined && hasMcpSimpleCommitArgs(args)) {
|
|
485
490
|
throw new Error('Use changes or simple metadata fields, not both.');
|
|
@@ -511,10 +516,11 @@ async function workCommit(args = {}) {
|
|
|
511
516
|
});
|
|
512
517
|
}
|
|
513
518
|
export { workLocalCommit as retainedWorkLocalCommit };
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
519
|
+
/** Compatibility alias of agentia_cloud_commit. Prefer agentia_cloud_commit. */
|
|
520
|
+
async function workCommit(args = {}) {
|
|
521
|
+
return cloudCommit(args);
|
|
522
|
+
}
|
|
523
|
+
async function cloudPromote(args = {}) {
|
|
518
524
|
if (args.recreatePromotionBranch === true && args.confirmRecreate !== true) {
|
|
519
525
|
throw new Error('recreatePromotionBranch requires confirmRecreate=true.');
|
|
520
526
|
}
|
|
@@ -550,13 +556,14 @@ async function workDone(args = {}) {
|
|
|
550
556
|
});
|
|
551
557
|
}
|
|
552
558
|
export const agentiaMcpWorkToolHandlers = {
|
|
559
|
+
cloudCommit,
|
|
560
|
+
cloudPromote,
|
|
553
561
|
workCommit,
|
|
554
562
|
workCreate,
|
|
555
563
|
workDelete,
|
|
556
564
|
workDone,
|
|
557
565
|
workGet,
|
|
558
566
|
workList,
|
|
559
|
-
workPromote,
|
|
560
567
|
workPublish,
|
|
561
568
|
workPush,
|
|
562
569
|
workSet,
|
|
@@ -645,7 +652,7 @@ export function registerAgentiaMcpWorkTools(server) {
|
|
|
645
652
|
title: 'Agentia Work Delete',
|
|
646
653
|
}, (args) => safelyHandleTool(() => workDelete(args)));
|
|
647
654
|
server.registerTool('agentia_work_set', {
|
|
648
|
-
description: 'Set the active Copado work item and prepare a local feature/<user-story-name> branch. Requires a clean tracked working tree. Fetches the base branch from origin, fetches the feature branch when it exists on origin, then creates or checks out the feature branch from the remote feature when present, otherwise from the base. A gateway warning prints the message, skips git, and
|
|
655
|
+
description: 'Set the active Copado work item and prepare a local feature/<user-story-name> branch. Requires a clean tracked working tree. Fetches the base branch from origin, fetches the feature branch when it exists on origin, then creates or checks out the feature branch from the remote feature when present, otherwise from the base. A gateway warning prints the message, skips git, clears lastBaseBranch/lastDevOrgBranch/lastPullRequestBaseUrl, and records lastWorkItemId/lastWorkItem/lastWorkItemTitle from the returned work item. After work/set returns, compares the Story source credential with the CICD project default: warns when the default or Story credential is missing, and warns without changing the Story when they differ (shows the current credential and environment; use work update to change it). With none=true, clears every last* key from config.user.json and checks out the previous lastBaseBranch when present, else main, else master, else stays put.',
|
|
649
656
|
inputSchema: {
|
|
650
657
|
baseBranch: z
|
|
651
658
|
.string()
|
|
@@ -680,79 +687,87 @@ export function registerAgentiaMcpWorkTools(server) {
|
|
|
680
687
|
inputSchema: workPublishInputSchema,
|
|
681
688
|
title: 'Agentia Work Push',
|
|
682
689
|
}, (args) => safelyHandleTool(() => workPush(args || {})));
|
|
690
|
+
const cloudCommitInputSchema = {
|
|
691
|
+
action: z.enum(WORK_COMMIT_ACTIONS).optional().describe('Metadata action for simple input. Defaults to Add.'),
|
|
692
|
+
baseBranch: z.string().nullable().optional().describe('Optional base branch included in the commit request.'),
|
|
693
|
+
changes: z
|
|
694
|
+
.array(z.record(z.string(), z.unknown()))
|
|
695
|
+
.optional()
|
|
696
|
+
.describe(WORK_COMMIT_CHANGES_HELP),
|
|
697
|
+
commitId: z
|
|
698
|
+
.string()
|
|
699
|
+
.optional()
|
|
700
|
+
.describe('Existing local Git commit identifier to register when executeCommit is false.'),
|
|
701
|
+
dataTemplateSyncConfig: z
|
|
702
|
+
.array(z.unknown())
|
|
703
|
+
.optional()
|
|
704
|
+
.describe('Optional data-template synchronization configuration.'),
|
|
705
|
+
executeCommit: z.boolean().optional().describe('Execute the Copado commit job. Defaults to true.'),
|
|
706
|
+
id: z.string().optional().describe('User story Id. Defaults to the active work item from work set.'),
|
|
707
|
+
message: z
|
|
708
|
+
.string()
|
|
709
|
+
.optional()
|
|
710
|
+
.describe('Commit message. Required unless supplied in the request body.'),
|
|
711
|
+
metadataCategory: z.string().optional().describe(WORK_COMMIT_METADATA_CATEGORY_HELP),
|
|
712
|
+
metadataMessage: z.string().optional().describe('Optional per-change message for simple input.'),
|
|
713
|
+
metadataName: z.string().optional().describe('Metadata full name for simple input.'),
|
|
714
|
+
metadataRawJson: z.unknown().optional().describe('Optional raw metadata JSON value for simple input.'),
|
|
715
|
+
metadataType: z.string().optional().describe('Metadata type for simple input, for example ApexClass.'),
|
|
716
|
+
recreateFeatureBranch: z.boolean().optional().describe('Ask Copado to recreate the feature branch.'),
|
|
717
|
+
selection: z
|
|
718
|
+
.array(z.string())
|
|
719
|
+
.optional()
|
|
720
|
+
.describe('Selected files inside a bundle for SelectiveCommit simple input.'),
|
|
721
|
+
wait: z.boolean().optional().describe('Poll the commit job to a terminal status. Defaults to true.'),
|
|
722
|
+
waitTimeout: z.number().int().optional().describe('Maximum seconds to wait for the commit job. Defaults to 300.'),
|
|
723
|
+
};
|
|
724
|
+
const cloudPromoteInputSchema = {
|
|
725
|
+
confirmRecreate: z
|
|
726
|
+
.boolean()
|
|
727
|
+
.optional()
|
|
728
|
+
.describe('Required true when recreatePromotionBranch is true because MCP cannot prompt.'),
|
|
729
|
+
deploy: z.boolean().optional().describe('Use merge_and_deploy instead of promote-only merge.'),
|
|
730
|
+
deploymentStepIds: z
|
|
731
|
+
.array(z.string())
|
|
732
|
+
.optional()
|
|
733
|
+
.describe('Ordered deployment-step Salesforce IDs. Requires deploy=true.'),
|
|
734
|
+
id: z.string().optional().describe('User Story ID. Defaults to the active work item from work set.'),
|
|
735
|
+
ignoredMetadata: z.array(z.unknown()).optional().describe('Ignored metadata persisted before starting the run.'),
|
|
736
|
+
promotionId: z
|
|
737
|
+
.string()
|
|
738
|
+
.optional()
|
|
739
|
+
.describe('Explicit 18-character Promotion ID when the User Story belongs to multiple promotions.'),
|
|
740
|
+
recreatePromotionBranch: z.boolean().optional().describe('Recreate the promotion branch before execution.'),
|
|
741
|
+
wait: z.boolean().optional().describe('Poll all created executions to terminal status. Defaults to true.'),
|
|
742
|
+
waitTimeout: z
|
|
743
|
+
.number()
|
|
744
|
+
.int()
|
|
745
|
+
.optional()
|
|
746
|
+
.describe(`Maximum total wait in seconds. Defaults to ${PROMOTION_RUN_DEFAULT_TIMEOUT_SECONDS}.`),
|
|
747
|
+
};
|
|
748
|
+
server.registerTool('agentia_cloud_commit', {
|
|
749
|
+
description: 'Create a Copado cloud metadata commit. Preflights the user story, submits POST /release/commit, and optionally waits for the job. Use simple metadata fields for one change or changes for multi-change requests. For Salesforce metadata, set metadataCategory to SFDX (or c: "SFDX" on each changes entry); Copado SFDX deploy skips entries that omit that field. For local Git work, use git commit then agentia_work_publish; pass permissions and fullMetadata on agentia_work_publish.',
|
|
750
|
+
inputSchema: cloudCommitInputSchema,
|
|
751
|
+
title: 'Agentia Cloud Commit',
|
|
752
|
+
}, (args) => safelyHandleTool(() => cloudCommit(args || {})));
|
|
683
753
|
server.registerTool('agentia_work_commit', {
|
|
684
|
-
description: '
|
|
754
|
+
description: 'Compatibility alias of agentia_cloud_commit. Prefer agentia_cloud_commit. Create a Copado cloud metadata commit. cloud is ignored when present.',
|
|
685
755
|
inputSchema: {
|
|
686
|
-
|
|
687
|
-
baseBranch: z.string().nullable().optional().describe('Optional base branch included in the commit request.'),
|
|
688
|
-
changes: z
|
|
689
|
-
.array(z.record(z.string(), z.unknown()))
|
|
690
|
-
.optional()
|
|
691
|
-
.describe(WORK_COMMIT_CHANGES_HELP),
|
|
756
|
+
...cloudCommitInputSchema,
|
|
692
757
|
cloud: z
|
|
693
758
|
.boolean()
|
|
694
759
|
.optional()
|
|
695
|
-
.describe('
|
|
696
|
-
commitId: z
|
|
697
|
-
.string()
|
|
698
|
-
.optional()
|
|
699
|
-
.describe('Existing local Git commit identifier to register when executeCommit is false.'),
|
|
700
|
-
dataTemplateSyncConfig: z
|
|
701
|
-
.array(z.unknown())
|
|
702
|
-
.optional()
|
|
703
|
-
.describe('Optional data-template synchronization configuration.'),
|
|
704
|
-
executeCommit: z.boolean().optional().describe('Execute the Copado commit job. Defaults to true.'),
|
|
705
|
-
id: z.string().optional().describe('User story Id. Defaults to the active work item from work set.'),
|
|
706
|
-
message: z
|
|
707
|
-
.string()
|
|
708
|
-
.optional()
|
|
709
|
-
.describe('Commit message. Required unless supplied in the request body.'),
|
|
710
|
-
metadataCategory: z.string().optional().describe(WORK_COMMIT_METADATA_CATEGORY_HELP),
|
|
711
|
-
metadataMessage: z.string().optional().describe('Optional per-change message for simple input.'),
|
|
712
|
-
metadataName: z.string().optional().describe('Metadata full name for simple input.'),
|
|
713
|
-
metadataRawJson: z.unknown().optional().describe('Optional raw metadata JSON value for simple input.'),
|
|
714
|
-
metadataType: z.string().optional().describe('Metadata type for simple input, for example ApexClass.'),
|
|
715
|
-
recreateFeatureBranch: z.boolean().optional().describe('Ask Copado to recreate the feature branch.'),
|
|
716
|
-
selection: z
|
|
717
|
-
.array(z.string())
|
|
718
|
-
.optional()
|
|
719
|
-
.describe('Selected files inside a bundle for SelectiveCommit simple input.'),
|
|
720
|
-
wait: z.boolean().optional().describe('Poll the commit job to a terminal status. Defaults to true.'),
|
|
721
|
-
waitTimeout: z.number().int().optional().describe('Maximum seconds to wait for the commit job. Defaults to 300.'),
|
|
760
|
+
.describe('Ignored. This tool is a compatibility alias of agentia_cloud_commit.'),
|
|
722
761
|
},
|
|
723
762
|
title: 'Agentia Work Commit',
|
|
724
763
|
}, (args) => safelyHandleTool(() => workCommit(args || {})));
|
|
725
|
-
server.registerTool('
|
|
764
|
+
server.registerTool('agentia_cloud_promote', {
|
|
726
765
|
description: 'Resolve a Promotion from an explicit or active User Story, then preflight, start, and optionally wait for the cloud promotion.',
|
|
727
|
-
inputSchema:
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
.boolean()
|
|
731
|
-
.optional()
|
|
732
|
-
.describe('Required true when recreatePromotionBranch is true because MCP cannot prompt.'),
|
|
733
|
-
deploy: z.boolean().optional().describe('Use merge_and_deploy instead of promote-only merge.'),
|
|
734
|
-
deploymentStepIds: z
|
|
735
|
-
.array(z.string())
|
|
736
|
-
.optional()
|
|
737
|
-
.describe('Ordered deployment-step Salesforce IDs. Requires deploy=true.'),
|
|
738
|
-
id: z.string().optional().describe('User Story ID. Defaults to the active work item from work set.'),
|
|
739
|
-
ignoredMetadata: z.array(z.unknown()).optional().describe('Ignored metadata persisted before starting the run.'),
|
|
740
|
-
promotionId: z
|
|
741
|
-
.string()
|
|
742
|
-
.optional()
|
|
743
|
-
.describe('Explicit 18-character Promotion ID when the User Story belongs to multiple promotions.'),
|
|
744
|
-
recreatePromotionBranch: z.boolean().optional().describe('Recreate the promotion branch before execution.'),
|
|
745
|
-
wait: z.boolean().optional().describe('Poll all created executions to terminal status. Defaults to true.'),
|
|
746
|
-
waitTimeout: z
|
|
747
|
-
.number()
|
|
748
|
-
.int()
|
|
749
|
-
.optional()
|
|
750
|
-
.describe(`Maximum total wait in seconds. Defaults to ${PROMOTION_RUN_DEFAULT_TIMEOUT_SECONDS}.`),
|
|
751
|
-
},
|
|
752
|
-
title: 'Agentia Work Promote',
|
|
753
|
-
}, (args) => safelyHandleTool(() => workPromote(args || {})));
|
|
766
|
+
inputSchema: cloudPromoteInputSchema,
|
|
767
|
+
title: 'Agentia Cloud Promote',
|
|
768
|
+
}, (args) => safelyHandleTool(() => cloudPromote(args || {})));
|
|
754
769
|
server.registerTool('agentia_work_submit', {
|
|
755
|
-
description: 'Submit the current feature/US-XXXX work item for pipeline quality gates and validation. Runs project-root .agentia_quality_gates.sh (macOS/Linux) or .agentia_quality_gates.cmd (Windows) when present, then fetches origin/<lastBaseBranch> and counts origin/<lastBaseBranch>..HEAD before checking origin. Pushes and registers commits when that feature-only range is non-empty and the branch is ahead of origin. When the last pending related job template name contains Commit, waits up to 5 minutes for that job before calling headless work/submit. With done=true or deploy=true, matches Copado UI Submit when promoting (headless work/done) and uses the same commit wait. Prefer this over agentia_work_done.',
|
|
770
|
+
description: 'Submit the current feature/US-XXXX work item for pipeline quality gates and validation. Runs project-root .agentia_quality_gates.sh (macOS/Linux) or .agentia_quality_gates.cmd (Windows) when present, then fetches origin/<lastBaseBranch> and counts origin/<lastBaseBranch>..HEAD before checking origin. Pushes and registers commits when that feature-only range is non-empty and the branch is ahead of origin. When the last pending related job template name contains Commit, waits up to 5 minutes for that job before calling headless work/submit. Before submit or promote, counts user stories ahead and behind between the source environment and the next pipeline environment, and warns when stories behind might cause promotion conflicts (advising agentia cicd work environment-sync). With done=true or deploy=true, matches Copado UI Submit when promoting (headless work/done) and uses the same commit wait. Prefer this over agentia_work_done.',
|
|
756
771
|
inputSchema: {
|
|
757
772
|
apexTestClasses: z
|
|
758
773
|
.string()
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import {modules} from './runtime.js';
|
|
2
|
+
const DEFAULT_SFDX_METADATA_ROOT = modules["metadata-pathspecs.js"]["DEFAULT_SFDX_METADATA_ROOT"]
|
|
3
|
+
const guessMetadataPathspecs = modules["metadata-pathspecs.js"]["guessMetadataPathspecs"]
|
|
4
|
+
export {DEFAULT_SFDX_METADATA_ROOT, guessMetadataPathspecs};
|