@copado/agentia-cli 1.0.0-beta.5 → 1.0.0-beta.7
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 +20 -0
- package/README.md +906 -245
- package/dist/commands/adv/auth/status.js +20 -0
- package/dist/commands/adv/component/add.js +48 -0
- package/dist/commands/adv/component/list.js +46 -0
- package/dist/commands/adv/component/refresh.js +23 -0
- package/dist/commands/adv/component/remove.js +35 -0
- package/dist/commands/adv/component/selected.js +26 -0
- package/dist/commands/adv/component/types.js +16 -0
- package/dist/commands/adv/deployment/cancel.js +45 -0
- package/dist/commands/adv/deployment/create.js +23 -0
- package/dist/commands/adv/deployment/deploy.js +49 -0
- package/dist/commands/adv/deployment/get.js +21 -0
- package/dist/commands/adv/deployment/list.js +30 -0
- package/dist/commands/adv/deployment/options.js +33 -0
- package/dist/commands/adv/deployment/quick-deploy.js +57 -0
- package/dist/commands/adv/deployment/validate.js +32 -0
- package/dist/commands/adv/job/get.js +21 -0
- package/dist/commands/adv/job/list.js +30 -0
- package/dist/commands/adv/job/wait.js +33 -0
- package/dist/commands/adv/organization/get.js +21 -0
- package/dist/commands/adv/organization/list.js +21 -0
- package/dist/commands/adv/organization/validate.js +20 -0
- package/dist/commands/auth/get.js +24 -3
- package/dist/commands/auth/set.js +18 -0
- package/dist/commands/auth/unset.js +4 -0
- package/dist/commands/cicd/environment/get.js +3 -6
- package/dist/commands/cicd/environment/list.js +2 -7
- package/dist/commands/cicd/job/get.js +3 -7
- package/dist/commands/cicd/job/list.js +3 -7
- package/dist/commands/cicd/notification/get.js +44 -0
- package/dist/commands/cicd/pipeline/get.js +3 -7
- package/dist/commands/cicd/pipeline/list.js +3 -7
- package/dist/commands/cicd/project/get.js +3 -7
- package/dist/commands/cicd/project/list.js +3 -7
- package/dist/commands/cicd/promotion/get.js +3 -7
- package/dist/commands/cicd/promotion/list.js +3 -7
- package/dist/commands/cicd/stage/list.js +5 -6
- package/dist/commands/cicd/user/get.js +3 -7
- package/dist/commands/cicd/work/get.js +2 -2
- package/dist/commands/cicd/work/list.js +3 -7
- package/dist/commands/cicd/work/promote.js +1 -0
- package/dist/commands/cicd/work/publish.js +1 -0
- package/dist/commands/setup/skills/create.js +4 -0
- package/dist/commands/setup/skills/update.js +4 -0
- package/dist/hooks/init/migrate-user-config.js +5 -1
- package/dist/hooks/init/version-warning.js +5 -2
- package/dist/lib/adv-config.js +9 -0
- package/dist/lib/adv-flags.js +8 -0
- package/dist/lib/adv-gateway.js +8 -0
- package/dist/lib/adv-operations.js +29 -0
- package/dist/lib/adv-sanitization.js +8 -0
- package/dist/lib/adv-types.js +9 -0
- package/dist/lib/agentia-command.js +68 -3
- package/dist/lib/ai-config.js +3 -1
- package/dist/lib/auth-config.js +2 -1
- package/dist/lib/auth-profile.js +2 -1
- package/dist/lib/auth-status-format.js +2 -1
- package/dist/lib/cicd-gateway.js +2 -1
- package/dist/lib/cli-severity-color.js +4 -0
- package/dist/lib/environment-get.js +4 -0
- package/dist/lib/job-get.js +4 -0
- package/dist/lib/mcp/adv-tools.js +227 -0
- package/dist/lib/mcp/command-id.js +4 -1
- package/dist/lib/mcp/tool-annotations.js +23 -0
- package/dist/lib/mcp/tools.js +67 -67
- package/dist/lib/mcp/work-tools.js +10 -9
- package/dist/lib/notifications-get.js +10 -0
- package/dist/lib/pipeline-get.js +4 -0
- package/dist/lib/plugin-host/ai.js +5 -0
- package/dist/lib/plugin-host/environment.js +4 -0
- package/dist/lib/plugin-host/event-log.js +2 -1
- package/dist/lib/plugin-host/input.js +7 -0
- package/dist/lib/plugin-host/job.js +4 -0
- package/dist/lib/plugin-host/pipeline.js +4 -0
- package/dist/lib/plugin-host/project.js +5 -0
- package/dist/lib/plugin-host/projection-utils.js +6 -1
- package/dist/lib/plugin-host/promotion.js +4 -0
- package/dist/lib/plugin-host/stage.js +4 -0
- package/dist/lib/plugin-host/user.js +4 -0
- package/dist/lib/plugin-host/workspace.js +3 -0
- package/dist/lib/project-get.js +4 -0
- package/dist/lib/promotion-get.js +4 -0
- package/dist/lib/runtime.js +1 -1
- package/dist/lib/stage-list.js +3 -0
- package/dist/lib/testing-gateway.js +2 -1
- package/dist/lib/user-get.js +3 -0
- package/dist/lib/work-get.js +3 -2
- package/oclif.manifest.json +1578 -144
- package/package.json +35 -2
- package/templates/AGENTS.md +1 -1
- package/templates/skills/agentia-adv/SKILL.md +22 -0
- package/templates/skills/agentia-adv/references/pipelines-advanced.md +50 -0
- package/templates/skills/agentia-cicd/SKILL.md +3 -1
- package/templates/skills/agentia-cicd/references/notifications.md +79 -0
- package/templates/skills/agentia-cicd/references/work.md +19 -0
package/dist/lib/mcp/tools.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/* eslint-disable max-lines -- Tool schemas and registrations are intentionally colocated. */
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { normalizeEnvironmentsListPage } from '../../commands/cicd/environment/list.js';
|
|
4
3
|
import { buildMetadataCompareFileRequests } from '../../commands/cicd/metadata/content/compare.js';
|
|
5
4
|
import { buildMetadataContentRequest } from '../../commands/cicd/metadata/content/get.js';
|
|
6
5
|
import { buildMetadataCompareRequest } from '../../commands/cicd/metadata/index/compare.js';
|
|
@@ -15,35 +14,44 @@ import { runEnvironmentAuthStatus } from '../environment-auth-status.js';
|
|
|
15
14
|
import { collectCredentialUpdateFlagKeys, validateCredentialName } from '../environment-credential-flags.js';
|
|
16
15
|
import { createEnvironmentCredential, listEnvironmentCredentials, resolveEnvironmentOrgType, sanitizeEnvironment, updateEnvironmentCredential, } from '../environment-credential-operations.js';
|
|
17
16
|
import { buildCreatePayload, buildMutationPayload, ENVIRONMENT_STRING_VALIDATION_KEYS, validateNonEmptyStringFields, } from '../environment-flags.js';
|
|
18
|
-
import {
|
|
17
|
+
import { fetchEnvironment, fetchEnvironments } from '../environment-get.js';
|
|
18
|
+
import { DEFAULT_ENVIRONMENT_PLATFORM, DEFAULT_ENVIRONMENT_TYPE, ENVIRONMENT_TYPES, environmentEndpoint, } from '../environment-types.js';
|
|
19
19
|
import { executeLocalFunctionRun } from '../function-local-run.js';
|
|
20
20
|
import { FUNCTION_LIST_TYPES, FUNCTION_RUNTIMES, functionEndpoint, functionResultEndpoint, functionResultLogEndpoint, functionRunEndpoint, functionsEndpoint, normalizeFunction, normalizeFunctionResultStatus, normalizeFunctionRunResult, normalizeFunctionsListPage, normalizeFunctionUpsertPayload, } from '../function-types.js';
|
|
21
|
-
import {
|
|
21
|
+
import { fetchJob, fetchJobs } from '../job-get.js';
|
|
22
|
+
import { jobEndpoint, jobKillEndpoint, jobPauseEndpoint, jobResultFileContentEndpoint, jobResultFilesEndpoint, jobResultLogEndpoint, jobResumeEndpoint, jobRunEndpoint, normalizeJob, normalizeJobOperation, normalizeJobResultFileContent, normalizeJobResultFiles, resolveJobStepForLog, } from '../job-types.js';
|
|
22
23
|
import { listPaginationZodFields, mcpPaginatedListPayload } from '../list-pagination.js';
|
|
23
24
|
import { COMPARISON_MODES, CONTENT_SOURCES, contentResultToCompareSide, createUnifiedDiff, INDEX_SOURCES, MODULE_TYPES, ORDER_DIRECTIONS, PLATFORM_EXPERIENCES, RETRIEVE_MODES, sourceSideLabel, } from '../metadata-common.js';
|
|
24
25
|
import { buildRefreshDeletedRequest, buildRefreshIndexRequest, refreshStatusEndpoint, resolveRefreshSourceFromEnv, } from '../metadata-refresh.js';
|
|
25
26
|
import { NAVIGATION_RESOURCE_TYPES, resolveNavigationTarget } from '../navigation.js';
|
|
27
|
+
import { configureNotification, NOTIFICATION_DESTINATION_TYPES, NOTIFICATION_EVENTS, NOTIFICATION_SUBSCRIPTIONS, withNotificationConfigureErrorTranslation, } from '../notifications-configure.js';
|
|
28
|
+
import { getNotificationSubscriptions } from '../notifications-get.js';
|
|
26
29
|
import { parsePipelineConnectionMutationObject, parsePipelineConnectionUpdateObject, validatePipelineConnectionCreatePayload, validatePipelineConnectionUpdatePayload, } from '../pipeline-connection-flags.js';
|
|
27
30
|
import { validatePipelineMutationPayload, } from '../pipeline-flags.js';
|
|
31
|
+
import { fetchPipeline, fetchPipelines } from '../pipeline-get.js';
|
|
28
32
|
import { buildPipelineStageConnectionCreatePayload, buildPipelineStageConnectionUpdatePayload, } from '../pipeline-stage-connection-flags.js';
|
|
29
|
-
import { normalizePipeline, normalizePipelineConnections, normalizePipelineDescribe, normalizePipelines,
|
|
33
|
+
import { normalizePipeline, normalizePipelineConnections, normalizePipelineDescribe, normalizePipelines, PIPELINE_CALCULATE_BASED_ON_VALUES, PIPELINE_CONNECTION_SYNC_STATE_NEEDS_RECALCULATING, PIPELINE_PLATFORMS, pipelineConnectionsEndpoint, pipelineConnectionsFromPipelines, pipelineDescribeEndpoint, pipelineEndpoint, pipelineListEndpoint, } from '../pipeline-types.js';
|
|
30
34
|
import { buildSetValues, collectSelectedKeys } from '../project-default-flags.js';
|
|
31
35
|
import { validateProjectDefaultIdentifiers } from '../project-default-validation.js';
|
|
32
36
|
import { PROJECT_DEFAULT_KEYS } from '../project-defaults.js';
|
|
33
37
|
import { validateProjectListFilters, validateProjectMutationPayload } from '../project-flags.js';
|
|
34
|
-
import {
|
|
38
|
+
import { fetchProject, fetchProjects } from '../project-get.js';
|
|
39
|
+
import { normalizeProject, projectEndpoint, projectsListEndpoint, } from '../project-types.js';
|
|
35
40
|
import { buildPromotionConflictResolutionRequest, normalizePromotionConflicts, PROMOTION_CONFLICT_MODES, promotionConflictContentEndpoint, promotionConflictResolveEndpoint, promotionConflictsEndpoint, promotionConflictUndoEndpoint, withPromotionConflictErrorTranslation, } from '../promotion-conflicts.js';
|
|
41
|
+
import { fetchPromotion, fetchPromotions } from '../promotion-get.js';
|
|
36
42
|
import { buildPromotionManualTaskUpdatePayload, PROMOTION_MANUAL_TASK_STATUSES, promotionManualTaskEndpoint, } from '../promotion-job-steps.js';
|
|
37
43
|
import { performPromotionResume, performPromotionRun, PROMOTION_OPERATIONS, PROMOTION_RUN_DEFAULT_TIMEOUT_SECONDS, } from '../promotion-run.js';
|
|
38
|
-
import { normalizePromotionDetail, normalizePromotionsListPage, promotionEndpoint, promotionListEndpoint, } from '../promotion-types.js';
|
|
39
44
|
import { REPOSITORY_STRING_VALIDATION_KEYS, validateNonEmptyStringFields as validateRepositoryNonEmptyStringFields, } from '../repository-flags.js';
|
|
40
45
|
import { normalizeRepositoriesListPage, normalizeRepository, normalizeRepositoryValidateResult, repositoriesEndpoint, REPOSITORY_PROVIDERS, REPOSITORY_SOURCE_FORMATS, repositoryEndpoint, repositoryHttpsAuthEndpoint, repositoryResetEndpoint, repositorySshAuthEndpoint, repositoryValidateEndpoint, } from '../repository-types.js';
|
|
41
46
|
import { buildStageMutationPayload, validateStagePayload } from '../stage-flags.js';
|
|
42
|
-
import {
|
|
47
|
+
import { fetchStages } from '../stage-list.js';
|
|
48
|
+
import { normalizePipelineStageConnection, normalizeStage, pipelineStageConnectionEndpoint, pipelineStageConnectionsEndpoint, STAGE_META_STAGE_SUGGESTIONS, stageEndpoint, stagesEndpoint, } from '../stage-types.js';
|
|
43
49
|
import { getUserContext } from '../user-context.js';
|
|
44
|
-
import {
|
|
50
|
+
import { fetchUser } from '../user-get.js';
|
|
51
|
+
import { DEFAULT_USER_ID } from '../user-types.js';
|
|
45
52
|
import { resolveRecordedWorkBranchMetadata } from '../work-branch-metadata.js';
|
|
46
53
|
import { workStatusEndpoint } from '../work-types.js';
|
|
54
|
+
import { registerAgentiaMcpAdvTools } from './adv-tools.js';
|
|
47
55
|
import { agentiaMcpAiToolHandlers, registerAgentiaMcpAiTools } from './ai-tools.js';
|
|
48
56
|
import { agentiaMcpDataToolHandlers, registerAgentiaMcpDataTools } from './data-tools.js';
|
|
49
57
|
import { agentiaMcpDeploymentStepToolHandlers, registerAgentiaMcpDeploymentStepTools } from './deployment-step-tools.js';
|
|
@@ -53,17 +61,10 @@ import { agentiaMcpTestingToolHandlers, registerAgentiaMcpTestingTools } from '.
|
|
|
53
61
|
import { agentiaMcpWorkToolHandlers, registerAgentiaMcpWorkTools } from './work-tools.js';
|
|
54
62
|
const MAX_LIMIT = 2000;
|
|
55
63
|
async function environmentList(args = {}) {
|
|
56
|
-
|
|
57
|
-
endpoint: environmentsListEndpoint(args),
|
|
58
|
-
method: 'GET',
|
|
59
|
-
});
|
|
60
|
-
return mcpPaginatedListPayload('environments', normalizeEnvironmentsListPage(response));
|
|
64
|
+
return mcpPaginatedListPayload('environments', await fetchEnvironments(args));
|
|
61
65
|
}
|
|
62
66
|
async function environmentGet(args) {
|
|
63
|
-
const environment = sanitizeEnvironment(await
|
|
64
|
-
endpoint: environmentEndpoint(assertRequired(args.id, 'id')),
|
|
65
|
-
method: 'GET',
|
|
66
|
-
}));
|
|
67
|
+
const environment = sanitizeEnvironment(await fetchEnvironment(assertRequired(args.id, 'id')));
|
|
67
68
|
return { environment };
|
|
68
69
|
}
|
|
69
70
|
const silentPromotionRunHooks = {
|
|
@@ -71,18 +72,10 @@ const silentPromotionRunHooks = {
|
|
|
71
72
|
withSpinner: async (_message, action) => action(),
|
|
72
73
|
};
|
|
73
74
|
async function promotionList(args = {}) {
|
|
74
|
-
|
|
75
|
-
endpoint: promotionListEndpoint(args),
|
|
76
|
-
method: 'GET',
|
|
77
|
-
});
|
|
78
|
-
return mcpPaginatedListPayload('promotions', normalizePromotionsListPage(response));
|
|
75
|
+
return mcpPaginatedListPayload('promotions', await fetchPromotions(args));
|
|
79
76
|
}
|
|
80
77
|
async function promotionGet(args) {
|
|
81
|
-
|
|
82
|
-
endpoint: promotionEndpoint(assertRequired(args.id, 'id')),
|
|
83
|
-
method: 'GET',
|
|
84
|
-
});
|
|
85
|
-
return { promotion: normalizePromotionDetail(response) };
|
|
78
|
+
return { promotion: await fetchPromotion(assertRequired(args.id, 'id')) };
|
|
86
79
|
}
|
|
87
80
|
async function promotionRun(args) {
|
|
88
81
|
const waitTimeout = args.waitTimeout ?? PROMOTION_RUN_DEFAULT_TIMEOUT_SECONDS;
|
|
@@ -252,18 +245,10 @@ async function jobList(args) {
|
|
|
252
245
|
}
|
|
253
246
|
filters.ownerId = userId;
|
|
254
247
|
}
|
|
255
|
-
|
|
256
|
-
endpoint: jobListEndpoint(filters),
|
|
257
|
-
method: 'GET',
|
|
258
|
-
});
|
|
259
|
-
return mcpPaginatedListPayload('jobs', normalizeJobsListPage(response));
|
|
248
|
+
return mcpPaginatedListPayload('jobs', await fetchJobs(filters));
|
|
260
249
|
}
|
|
261
250
|
async function jobGet(args) {
|
|
262
|
-
|
|
263
|
-
endpoint: jobEndpoint(assertRequired(args.id, 'id')),
|
|
264
|
-
method: 'GET',
|
|
265
|
-
});
|
|
266
|
-
return { job: normalizeJob(response) };
|
|
251
|
+
return { job: await fetchJob(assertRequired(args.id, 'id')) };
|
|
267
252
|
}
|
|
268
253
|
async function jobRun(args) {
|
|
269
254
|
const result = await CicdGateway.call({
|
|
@@ -294,18 +279,10 @@ async function jobPause(args) {
|
|
|
294
279
|
return { result: normalizeJobOperation(result) };
|
|
295
280
|
}
|
|
296
281
|
async function pipelineList(args = {}) {
|
|
297
|
-
|
|
298
|
-
endpoint: pipelineListEndpoint(args),
|
|
299
|
-
method: 'GET',
|
|
300
|
-
});
|
|
301
|
-
return mcpPaginatedListPayload('pipelines', normalizePipelinesListPage(response));
|
|
282
|
+
return mcpPaginatedListPayload('pipelines', await fetchPipelines(args));
|
|
302
283
|
}
|
|
303
284
|
async function pipelineGet(args) {
|
|
304
|
-
|
|
305
|
-
endpoint: pipelineDescribeEndpoint(assertRequired(args.id, 'id')),
|
|
306
|
-
method: 'GET',
|
|
307
|
-
});
|
|
308
|
-
return { pipeline: normalizePipelineDescribe(response) };
|
|
285
|
+
return { pipeline: await fetchPipeline(assertRequired(args.id, 'id')) };
|
|
309
286
|
}
|
|
310
287
|
async function pipelineConnectionList(args) {
|
|
311
288
|
let connections;
|
|
@@ -419,11 +396,7 @@ async function pipelineConnectionDelete(args) {
|
|
|
419
396
|
return { connectionIds, pipelineId };
|
|
420
397
|
}
|
|
421
398
|
async function stageList(args = {}) {
|
|
422
|
-
|
|
423
|
-
endpoint: stagesEndpoint(args),
|
|
424
|
-
method: 'GET',
|
|
425
|
-
});
|
|
426
|
-
return mcpPaginatedListPayload('stages', normalizeStagesListPage(response));
|
|
399
|
+
return mcpPaginatedListPayload('stages', await fetchStages(args));
|
|
427
400
|
}
|
|
428
401
|
async function stageGet(args) {
|
|
429
402
|
const response = await CicdGateway.call({
|
|
@@ -519,11 +492,7 @@ async function projectList(args = {}) {
|
|
|
519
492
|
const validationError = validateProjectListFilters(args);
|
|
520
493
|
if (validationError !== undefined)
|
|
521
494
|
throw new Error(validationError);
|
|
522
|
-
|
|
523
|
-
endpoint: projectsListEndpoint(args),
|
|
524
|
-
method: 'GET',
|
|
525
|
-
});
|
|
526
|
-
return mcpPaginatedListPayload('projects', normalizeProjectsListPage(response));
|
|
495
|
+
return mcpPaginatedListPayload('projects', await fetchProjects(args));
|
|
527
496
|
}
|
|
528
497
|
async function repositoryList(args = {}) {
|
|
529
498
|
const response = await CicdGateway.call({
|
|
@@ -784,11 +753,7 @@ function validateRepositoryMutationPayload(payload) {
|
|
|
784
753
|
return validateRepositoryNonEmptyStringFields(payload, REPOSITORY_STRING_VALIDATION_KEYS);
|
|
785
754
|
}
|
|
786
755
|
async function userGet(args = {}) {
|
|
787
|
-
|
|
788
|
-
endpoint: userEndpoint(resolveUserId(args.id)),
|
|
789
|
-
method: 'GET',
|
|
790
|
-
});
|
|
791
|
-
return { user };
|
|
756
|
+
return { user: await fetchUser(args.id) };
|
|
792
757
|
}
|
|
793
758
|
async function projectDefaultGet(args = {}) {
|
|
794
759
|
const keys = collectSelectedKeys(args);
|
|
@@ -1067,11 +1032,7 @@ async function jobResultFileGet(args) {
|
|
|
1067
1032
|
return { file: { ...normalizeJobResultFileContent(response), resultId } };
|
|
1068
1033
|
}
|
|
1069
1034
|
async function projectGet(args) {
|
|
1070
|
-
|
|
1071
|
-
endpoint: projectEndpoint(assertRequired(args.id, 'id')),
|
|
1072
|
-
method: 'GET',
|
|
1073
|
-
});
|
|
1074
|
-
return { project: normalizeProject(response) };
|
|
1035
|
+
return { project: await fetchProject(assertRequired(args.id, 'id')) };
|
|
1075
1036
|
}
|
|
1076
1037
|
async function projectCreate(args) {
|
|
1077
1038
|
const payload = {
|
|
@@ -1221,6 +1182,20 @@ async function navigationResolve(args) {
|
|
|
1221
1182
|
resourceType: args.resourceType,
|
|
1222
1183
|
});
|
|
1223
1184
|
}
|
|
1185
|
+
async function notificationConfigure(args) {
|
|
1186
|
+
const result = await withNotificationConfigureErrorTranslation(() => configureNotification({
|
|
1187
|
+
destinationId: assertRequired(args.destinationId, 'destinationId'),
|
|
1188
|
+
destinationType: args.destinationType,
|
|
1189
|
+
event: args.event,
|
|
1190
|
+
pipelineId: assertRequired(args.pipelineId, 'pipelineId'),
|
|
1191
|
+
subscription: args.subscription,
|
|
1192
|
+
}));
|
|
1193
|
+
return { result };
|
|
1194
|
+
}
|
|
1195
|
+
async function notificationGet(args) {
|
|
1196
|
+
const result = await getNotificationSubscriptions(assertRequired(args.pipelineId, 'pipelineId'));
|
|
1197
|
+
return { result };
|
|
1198
|
+
}
|
|
1224
1199
|
export const agentiaMcpToolHandlers = wrapMcpToolHandlers({
|
|
1225
1200
|
...agentiaMcpAiToolHandlers,
|
|
1226
1201
|
...agentiaMcpDataToolHandlers,
|
|
@@ -1263,6 +1238,8 @@ export const agentiaMcpToolHandlers = wrapMcpToolHandlers({
|
|
|
1263
1238
|
metadataRefreshRun,
|
|
1264
1239
|
metadataRefreshStatus,
|
|
1265
1240
|
navigationResolve,
|
|
1241
|
+
notificationConfigure,
|
|
1242
|
+
notificationGet,
|
|
1266
1243
|
pipelineConnectionCreate,
|
|
1267
1244
|
pipelineConnectionDelete,
|
|
1268
1245
|
pipelineConnectionList,
|
|
@@ -1308,6 +1285,18 @@ export const agentiaMcpToolHandlers = wrapMcpToolHandlers({
|
|
|
1308
1285
|
...agentiaMcpTestingToolHandlers,
|
|
1309
1286
|
...agentiaMcpWorkToolHandlers,
|
|
1310
1287
|
});
|
|
1288
|
+
const notificationConfigureSchema = {
|
|
1289
|
+
destinationId: z.string().describe('Slack user or channel id or name.'),
|
|
1290
|
+
destinationType: z.enum(NOTIFICATION_DESTINATION_TYPES).describe('Slack destination type.'),
|
|
1291
|
+
event: z
|
|
1292
|
+
.enum(NOTIFICATION_EVENTS)
|
|
1293
|
+
.describe('Notification event.'),
|
|
1294
|
+
pipelineId: z.string().describe('Copado pipeline Salesforce Id (15 or 18 characters).'),
|
|
1295
|
+
subscription: z.enum(NOTIFICATION_SUBSCRIPTIONS).describe('Notification audience for this event.'),
|
|
1296
|
+
};
|
|
1297
|
+
const notificationGetSchema = {
|
|
1298
|
+
pipelineId: z.string().describe('Copado pipeline Salesforce Id (15 or 18 characters).'),
|
|
1299
|
+
};
|
|
1311
1300
|
const environmentMutationSchema = {
|
|
1312
1301
|
apexTestLevel: z.string().optional().describe('Apex test level.'),
|
|
1313
1302
|
enableRollback: z.boolean().optional().describe('Enable rollback.'),
|
|
@@ -1380,6 +1369,7 @@ const promotionListSchema = {
|
|
|
1380
1369
|
};
|
|
1381
1370
|
export function registerAgentiaMcpTools(server) {
|
|
1382
1371
|
registerAgentiaMcpAiTools(server);
|
|
1372
|
+
registerAgentiaMcpAdvTools(server);
|
|
1383
1373
|
registerAgentiaMcpDataTools(server);
|
|
1384
1374
|
registerAgentiaMcpDeploymentStepTools(server);
|
|
1385
1375
|
registerAgentiaMcpHealthCheckTools(server);
|
|
@@ -1721,6 +1711,16 @@ export function registerAgentiaMcpTools(server) {
|
|
|
1721
1711
|
},
|
|
1722
1712
|
title: 'Agentia Navigation Resolve',
|
|
1723
1713
|
}, (args) => safelyHandleTool(() => navigationResolve(args)));
|
|
1714
|
+
server.registerTool('agentia_notification_configure', {
|
|
1715
|
+
description: 'Configure one Slack notification subscription for the current user on a pipeline. Mirrors agentia cicd notification configure.',
|
|
1716
|
+
inputSchema: notificationConfigureSchema,
|
|
1717
|
+
title: 'Agentia Notification Configure',
|
|
1718
|
+
}, (args) => safelyHandleTool(() => notificationConfigure(args)));
|
|
1719
|
+
server.registerTool('agentia_notification_get', {
|
|
1720
|
+
description: 'List Slack notification subscriptions for the current user on a pipeline. Mirrors agentia cicd notification get.',
|
|
1721
|
+
inputSchema: notificationGetSchema,
|
|
1722
|
+
title: 'Agentia Notification Get',
|
|
1723
|
+
}, (args) => safelyHandleTool(() => notificationGet(args)));
|
|
1724
1724
|
server.registerTool('agentia_project_default_get', {
|
|
1725
1725
|
description: 'Show Agentia project default values for the current project or globally.',
|
|
1726
1726
|
inputSchema: projectSelectorSchema,
|
|
@@ -18,7 +18,7 @@ import { DEFAULT_APEX_TEST_WAIT_MINUTES, parseApexTestClassNames, runWorkApexTes
|
|
|
18
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';
|
|
19
19
|
import { buildWorkCreatePayload } from '../work-defaults.js';
|
|
20
20
|
import { validateWorkMutationPayload, WORK_LONG_TEXT_MAX_LENGTH, WORK_SHORT_TEXT_MAX_LENGTH, } from '../work-flags.js';
|
|
21
|
-
import {
|
|
21
|
+
import { fetchWorkItem, fetchWorkItems } from '../work-get.js';
|
|
22
22
|
import { performWorkLocalCommit } from '../work-local-commit.js';
|
|
23
23
|
import { reportLocalQualityGatesFailure, reportLocalQualityGatesOutcome, } from '../work-local-run-tests.js';
|
|
24
24
|
import { capturingWorkPushHooks, performWorkPush, resolveActiveFeatureWorkItem, resolveWorkPushContext, resolveWorkPushNeed, } from '../work-push.js';
|
|
@@ -26,7 +26,7 @@ import { performWorkSetNone } from '../work-set-none.js';
|
|
|
26
26
|
import { isWorkSetWarning, parseWorkSetSelection, toWorkSetWarningResult, writeWorkSetWarningSelection, } from '../work-set-selection.js';
|
|
27
27
|
import { reportSubmitUserStoriesAheadBehind } from '../work-submit-ahead-behind.js';
|
|
28
28
|
import { waitForPendingCommitJobIfNeeded } from '../work-submit-wait.js';
|
|
29
|
-
import { applySourceCredentialEnvironmentRule, featureBranchName,
|
|
29
|
+
import { applySourceCredentialEnvironmentRule, featureBranchName, workCreateEndpoint, workDoneEndpoint, workEndpoint, workSetEndpoint, workSubmitEndpoint, } from '../work-types.js';
|
|
30
30
|
import { safelyHandleTool } from './result.js';
|
|
31
31
|
const CLOUD_ONLY_COMMIT_ARGS = [
|
|
32
32
|
'action',
|
|
@@ -123,14 +123,10 @@ async function workList(args = {}) {
|
|
|
123
123
|
filters.ownerId = userId;
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
|
|
127
|
-
endpoint: workListEndpoint(filters),
|
|
128
|
-
method: 'GET',
|
|
129
|
-
});
|
|
130
|
-
return mcpPaginatedListPayload('userStories', normalizeUserStoriesListPage(response));
|
|
126
|
+
return mcpPaginatedListPayload('userStories', await fetchWorkItems(filters));
|
|
131
127
|
}
|
|
132
128
|
async function workGet(args = {}) {
|
|
133
|
-
const userStory = await
|
|
129
|
+
const userStory = await fetchWorkItem(args.id);
|
|
134
130
|
return { userStory };
|
|
135
131
|
}
|
|
136
132
|
async function workCreate(args = {}) {
|
|
@@ -251,6 +247,7 @@ async function workPublish(args = {}) {
|
|
|
251
247
|
const context = await resolveWorkPushContext();
|
|
252
248
|
return performWorkPush({
|
|
253
249
|
...context,
|
|
250
|
+
dryRun: args.dryRun === true,
|
|
254
251
|
...(args.fullMetadata === undefined ? {} : { fullMetadata: args.fullMetadata }),
|
|
255
252
|
hooks: capturingWorkPushHooks,
|
|
256
253
|
...(args.permissions === undefined ? {} : { permissions: args.permissions }),
|
|
@@ -688,6 +685,10 @@ export function registerAgentiaMcpWorkTools(server) {
|
|
|
688
685
|
title: 'Agentia Work Set',
|
|
689
686
|
}, (args) => safelyHandleTool(() => workSet(args || {})));
|
|
690
687
|
const workPublishInputSchema = {
|
|
688
|
+
dryRun: z
|
|
689
|
+
.boolean()
|
|
690
|
+
.optional()
|
|
691
|
+
.describe('Preview publish: run commit collection, Copado replacements, and nested metadata detection; return the changeListUpdate that would be registered; do not commit, push, lock, register, or sync the dev org branch. Restores dirtied tracked files afterward. Requires a clean tracked working tree.'),
|
|
691
692
|
fullMetadata: z
|
|
692
693
|
.string()
|
|
693
694
|
.optional()
|
|
@@ -699,7 +700,7 @@ export function registerAgentiaMcpWorkTools(server) {
|
|
|
699
700
|
skipNestedMetadataDetection: skipNestedMetadataDetectionSchema,
|
|
700
701
|
};
|
|
701
702
|
server.registerTool('agentia_work_publish', {
|
|
702
|
-
description: 'Publish the current feature/<lastWorkItem> branch and register commits with Copado. Requires a clean working tree, lastBaseBranch, and lastDevOrgBranch from config.user.json. Applies Copado environment-variable then yaml replacements when needed (yaml `-b` is the feature branch, matching Copado Commit), commits both as a single follow-up commit, sends one headless push changeListUpdate list of Action:MetadataType:MetadataName corrections (lastPermissionSelected and the permissions argument plus the nested metadata of the changed profiles and permission sets as RetrieveOnly so Copado registers that metadata with the Retrieve Only commit action, lastFullMetadataSelected and the fullMetadata argument plus brand-new nested parent files as fullMetadata, the ignored nested parents as unchanged, the nested metadata the branch deleted as Del, and the remaining nested metadata as Add). The changed profiles and permission sets themselves are never sent as corrections, so they stay in the change list and deploy only the permissions their RetrieveOnly entries select; brand-new nested parent files are sent as fullMetadata instead. Merges the feature branch into the recorded dev org branch after headless push. Prefer this over agentia_work_push.',
|
|
703
|
+
description: 'Publish the current feature/<lastWorkItem> branch and register commits with Copado. Requires a clean working tree, lastBaseBranch, and lastDevOrgBranch from config.user.json. Applies Copado environment-variable then yaml replacements when needed (yaml `-b` is the feature branch, matching Copado Commit), commits both as a single follow-up commit, sends one headless push changeListUpdate list of Action:MetadataType:MetadataName corrections (lastPermissionSelected and the permissions argument plus the nested metadata of the changed profiles and permission sets as RetrieveOnly so Copado registers that metadata with the Retrieve Only commit action, lastFullMetadataSelected and the fullMetadata argument plus brand-new nested parent files as fullMetadata, the ignored nested parents as unchanged, the nested metadata the branch deleted as Del, and the remaining nested metadata as Add). The changed profiles and permission sets themselves are never sent as corrections, so they stay in the change list and deploy only the permissions their RetrieveOnly entries select; brand-new nested parent files are sent as fullMetadata instead. Merges the feature branch into the recorded dev org branch after headless push. With dryRun=true, previews replacements and changeListUpdate, restores dirtied tracked files, and skips commit/push/lock/register/dev-org sync. Prefer this over agentia_work_push.',
|
|
703
704
|
inputSchema: workPublishInputSchema,
|
|
704
705
|
title: 'Agentia Work Publish',
|
|
705
706
|
}, (args) => safelyHandleTool(() => workPublish(args || {})));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import {modules} from './runtime.js';
|
|
2
|
+
const NOTIFICATION_SYSTEM_PROPERTIES_ENDPOINT = modules["notifications-get.js"]["NOTIFICATION_SYSTEM_PROPERTIES_ENDPOINT"]
|
|
3
|
+
const NotificationGetUserUnavailableError = modules["notifications-get.js"]["NotificationGetUserUnavailableError"]
|
|
4
|
+
const formatNotificationSubscriptionsTable = modules["notifications-get.js"]["formatNotificationSubscriptionsTable"]
|
|
5
|
+
const getNotificationSubscriptions = modules["notifications-get.js"]["getNotificationSubscriptions"]
|
|
6
|
+
const notificationSystemPropertiesEndpoint = modules["notifications-get.js"]["notificationSystemPropertiesEndpoint"]
|
|
7
|
+
const notificationSystemPropertyApiName = modules["notifications-get.js"]["notificationSystemPropertyApiName"]
|
|
8
|
+
const parseStoredNotificationSubscriptions = modules["notifications-get.js"]["parseStoredNotificationSubscriptions"]
|
|
9
|
+
const subscriptionsFromSystemProperties = modules["notifications-get.js"]["subscriptionsFromSystemProperties"]
|
|
10
|
+
export {NOTIFICATION_SYSTEM_PROPERTIES_ENDPOINT, NotificationGetUserUnavailableError, formatNotificationSubscriptionsTable, getNotificationSubscriptions, notificationSystemPropertiesEndpoint, notificationSystemPropertyApiName, parseStoredNotificationSubscriptions, subscriptionsFromSystemProperties};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import {modules} from '../runtime.js';
|
|
2
|
+
const createAiApi = modules["plugin-host/ai.js"]["createAiApi"]
|
|
3
|
+
const projectAiAsk = modules["plugin-host/ai.js"]["projectAiAsk"]
|
|
4
|
+
const projectAiQuota = modules["plugin-host/ai.js"]["projectAiQuota"]
|
|
5
|
+
export {createAiApi, projectAiAsk, projectAiQuota};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import {modules} from '../runtime.js';
|
|
2
|
+
const schedulePluginCommandEvent = modules["plugin-host/event-log.js"]["schedulePluginCommandEvent"]
|
|
2
3
|
const schedulePluginHostEvent = modules["plugin-host/event-log.js"]["schedulePluginHostEvent"]
|
|
3
|
-
export {schedulePluginHostEvent};
|
|
4
|
+
export {schedulePluginCommandEvent, schedulePluginHostEvent};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {modules} from '../runtime.js';
|
|
2
|
+
const isSalesforceId = modules["plugin-host/input.js"]["isSalesforceId"]
|
|
3
|
+
const requireSalesforceId = modules["plugin-host/input.js"]["requireSalesforceId"]
|
|
4
|
+
const requireUserId = modules["plugin-host/input.js"]["requireUserId"]
|
|
5
|
+
const validateListQuery = modules["plugin-host/input.js"]["validateListQuery"]
|
|
6
|
+
const validatePageQuery = modules["plugin-host/input.js"]["validatePageQuery"]
|
|
7
|
+
export {isSalesforceId, requireSalesforceId, requireUserId, validateListQuery, validatePageQuery};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import {modules} from '../runtime.js';
|
|
2
|
+
const createProjectApi = modules["plugin-host/project.js"]["createProjectApi"]
|
|
3
|
+
const projectProject = modules["plugin-host/project.js"]["projectProject"]
|
|
4
|
+
const projectProjectDefaults = modules["plugin-host/project.js"]["projectProjectDefaults"]
|
|
5
|
+
export {createProjectApi, projectProject, projectProjectDefaults};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import {modules} from '../runtime.js';
|
|
2
2
|
const deepFreeze = modules["plugin-host/projection-utils.js"]["deepFreeze"]
|
|
3
|
+
const namedRef = modules["plugin-host/projection-utils.js"]["namedRef"]
|
|
4
|
+
const namedRefFrom = modules["plugin-host/projection-utils.js"]["namedRefFrom"]
|
|
3
5
|
const nonNegativeInt = modules["plugin-host/projection-utils.js"]["nonNegativeInt"]
|
|
4
6
|
const omitUndefined = modules["plugin-host/projection-utils.js"]["omitUndefined"]
|
|
7
|
+
const optionalBoolean = modules["plugin-host/projection-utils.js"]["optionalBoolean"]
|
|
5
8
|
const optionalText = modules["plugin-host/projection-utils.js"]["optionalText"]
|
|
6
|
-
|
|
9
|
+
const projectMany = modules["plugin-host/projection-utils.js"]["projectMany"]
|
|
10
|
+
const requireRecord = modules["plugin-host/projection-utils.js"]["requireRecord"]
|
|
11
|
+
export {deepFreeze, namedRef, namedRefFrom, nonNegativeInt, omitUndefined, optionalBoolean, optionalText, projectMany, requireRecord};
|