@copado/agentia-cli 0.83.0-alpha.0 → 0.85.0-alpha.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/README.md +695 -162
- package/dist/commands/cicd/metadata/dependency/list.js +1 -1
- package/dist/commands/cicd/metadata/dependency/list.js.map +1 -1
- package/dist/commands/cicd/pipeline/connection/create.d.ts +19 -0
- package/dist/commands/cicd/pipeline/connection/create.js +67 -0
- package/dist/commands/cicd/pipeline/connection/create.js.map +1 -0
- package/dist/commands/cicd/pipeline/connection/delete.d.ts +15 -0
- package/dist/commands/cicd/pipeline/connection/delete.js +62 -0
- package/dist/commands/cicd/pipeline/connection/delete.js.map +1 -0
- package/dist/commands/cicd/pipeline/connection/open.d.ts +12 -0
- package/dist/commands/cicd/pipeline/connection/open.js +30 -0
- package/dist/commands/cicd/pipeline/connection/open.js.map +1 -0
- package/dist/commands/cicd/pipeline/connection/update.d.ts +19 -0
- package/dist/commands/cicd/pipeline/connection/update.js +55 -0
- package/dist/commands/cicd/pipeline/connection/update.js.map +1 -0
- package/dist/commands/cicd/pipeline/create.d.ts +19 -0
- package/dist/commands/cicd/pipeline/create.js +42 -0
- package/dist/commands/cicd/pipeline/create.js.map +1 -0
- package/dist/commands/cicd/pipeline/list.d.ts +3 -0
- package/dist/commands/cicd/pipeline/list.js +5 -3
- package/dist/commands/cicd/pipeline/list.js.map +1 -1
- package/dist/commands/cicd/pipeline/stage-connection/create.d.ts +12 -0
- package/dist/commands/cicd/pipeline/stage-connection/create.js +33 -0
- package/dist/commands/cicd/pipeline/stage-connection/create.js.map +1 -0
- package/dist/commands/cicd/pipeline/stage-connection/delete.d.ts +16 -0
- package/dist/commands/cicd/pipeline/stage-connection/delete.js +34 -0
- package/dist/commands/cicd/pipeline/stage-connection/delete.js.map +1 -0
- package/dist/commands/cicd/pipeline/stage-connection/list.d.ts +10 -0
- package/dist/commands/cicd/pipeline/stage-connection/list.js +37 -0
- package/dist/commands/cicd/pipeline/stage-connection/list.js.map +1 -0
- package/dist/commands/cicd/pipeline/stage-connection/open.d.ts +12 -0
- package/dist/commands/cicd/pipeline/stage-connection/open.js +16 -0
- package/dist/commands/cicd/pipeline/stage-connection/open.js.map +1 -0
- package/dist/commands/cicd/pipeline/stage-connection/update.d.ts +15 -0
- package/dist/commands/cicd/pipeline/stage-connection/update.js +38 -0
- package/dist/commands/cicd/pipeline/stage-connection/update.js.map +1 -0
- package/dist/commands/cicd/pipeline/update.d.ts +20 -0
- package/dist/commands/cicd/pipeline/update.js +52 -0
- package/dist/commands/cicd/pipeline/update.js.map +1 -0
- package/dist/commands/cicd/stage/create.d.ts +14 -0
- package/dist/commands/cicd/stage/create.js +28 -0
- package/dist/commands/cicd/stage/create.js.map +1 -0
- package/dist/commands/cicd/stage/delete.d.ts +14 -0
- package/dist/commands/cicd/stage/delete.js +28 -0
- package/dist/commands/cicd/stage/delete.js.map +1 -0
- package/dist/commands/cicd/stage/get.d.ts +10 -0
- package/dist/commands/cicd/stage/get.js +17 -0
- package/dist/commands/cicd/stage/get.js.map +1 -0
- package/dist/commands/cicd/stage/list.d.ts +12 -0
- package/dist/commands/cicd/stage/list.js +27 -0
- package/dist/commands/cicd/stage/list.js.map +1 -0
- package/dist/commands/cicd/stage/open.d.ts +12 -0
- package/dist/commands/cicd/stage/open.js +16 -0
- package/dist/commands/cicd/stage/open.js.map +1 -0
- package/dist/commands/cicd/stage/update.d.ts +14 -0
- package/dist/commands/cicd/stage/update.js +30 -0
- package/dist/commands/cicd/stage/update.js.map +1 -0
- package/dist/lib/dependency-from-changes.d.ts +3 -2
- package/dist/lib/dependency-from-changes.js +58 -48
- package/dist/lib/dependency-from-changes.js.map +1 -1
- package/dist/lib/mcp/tools.d.ts +134 -2
- package/dist/lib/mcp/tools.js +383 -5
- package/dist/lib/mcp/tools.js.map +1 -1
- package/dist/lib/navigation.d.ts +1 -1
- package/dist/lib/navigation.js +3 -0
- package/dist/lib/navigation.js.map +1 -1
- package/dist/lib/pipeline-connection-flags.d.ts +62 -0
- package/dist/lib/pipeline-connection-flags.js +309 -0
- package/dist/lib/pipeline-connection-flags.js.map +1 -0
- package/dist/lib/pipeline-flags.d.ts +74 -0
- package/dist/lib/pipeline-flags.js +154 -0
- package/dist/lib/pipeline-flags.js.map +1 -0
- package/dist/lib/pipeline-stage-connection-flags.d.ts +25 -0
- package/dist/lib/pipeline-stage-connection-flags.js +46 -0
- package/dist/lib/pipeline-stage-connection-flags.js.map +1 -0
- package/dist/lib/pipeline-types.d.ts +91 -2
- package/dist/lib/pipeline-types.js +51 -5
- package/dist/lib/pipeline-types.js.map +1 -1
- package/dist/lib/sdr-metadata-registry.generated.d.ts +18 -0
- package/dist/lib/sdr-metadata-registry.generated.js +6330 -0
- package/dist/lib/sdr-metadata-registry.generated.js.map +1 -0
- package/dist/lib/sdr-path-resolver.d.ts +7 -0
- package/dist/lib/sdr-path-resolver.js +116 -0
- package/dist/lib/sdr-path-resolver.js.map +1 -0
- package/dist/lib/stage-flags.d.ts +19 -0
- package/dist/lib/stage-flags.js +29 -0
- package/dist/lib/stage-flags.js.map +1 -0
- package/dist/lib/stage-types.d.ts +67 -0
- package/dist/lib/stage-types.js +69 -0
- package/dist/lib/stage-types.js.map +1 -0
- package/oclif.manifest.json +2977 -1858
- package/package.json +3 -2
package/dist/lib/mcp/tools.js
CHANGED
|
@@ -24,7 +24,10 @@ import { normalizeLocalGatewayBaseUrl, readLocalGatewayConfig } from '../local-g
|
|
|
24
24
|
import { COMPARISON_MODES, CONTENT_SOURCES, contentResultToCompareSide, createUnifiedDiff, INDEX_SOURCES, MODULE_TYPES, ORDER_DIRECTIONS, PLATFORM_EXPERIENCES, RETRIEVE_MODES, sourceSideLabel, } from '../metadata-common.js';
|
|
25
25
|
import { buildRefreshDeletedRequest, buildRefreshIndexRequest, refreshStatusEndpoint, resolveRefreshSourceFromEnv, } from '../metadata-refresh.js';
|
|
26
26
|
import { NAVIGATION_RESOURCE_TYPES, resolveNavigationTarget } from '../navigation.js';
|
|
27
|
-
import {
|
|
27
|
+
import { parsePipelineConnectionMutationObject, parsePipelineConnectionUpdateObject, validatePipelineConnectionCreatePayload, validatePipelineConnectionUpdatePayload, } from '../pipeline-connection-flags.js';
|
|
28
|
+
import { validatePipelineMutationPayload, } from '../pipeline-flags.js';
|
|
29
|
+
import { buildPipelineStageConnectionCreatePayload, buildPipelineStageConnectionUpdatePayload, } from '../pipeline-stage-connection-flags.js';
|
|
30
|
+
import { normalizePipeline, normalizePipelineConnections, normalizePipelineDescribe, normalizePipelines, normalizePipelinesListPage, PIPELINE_CALCULATE_BASED_ON_VALUES, PIPELINE_CONNECTION_SYNC_STATE_NEEDS_RECALCULATING, PIPELINE_PLATFORMS, pipelineConnectionsEndpoint, pipelineConnectionsFromPipelines, pipelineDescribeEndpoint, pipelineEndpoint, pipelineListEndpoint, } from '../pipeline-types.js';
|
|
28
31
|
import { buildSetValues, collectSelectedKeys } from '../project-default-flags.js';
|
|
29
32
|
import { PROJECT_DEFAULT_KEYS } from '../project-defaults.js';
|
|
30
33
|
import { normalizeProject, normalizeProjectsListPage, projectEndpoint, projectsListEndpoint, } from '../project-types.js';
|
|
@@ -33,6 +36,8 @@ import { performPromotionResume, performPromotionRun, PROMOTION_OPERATIONS, PROM
|
|
|
33
36
|
import { normalizePromotionDetail, normalizePromotionsListPage, promotionEndpoint, promotionListEndpoint, } from '../promotion-types.js';
|
|
34
37
|
import { REPOSITORY_STRING_VALIDATION_KEYS, validateNonEmptyStringFields as validateRepositoryNonEmptyStringFields, } from '../repository-flags.js';
|
|
35
38
|
import { normalizeRepositoriesListPage, normalizeRepository, normalizeRepositoryValidateResult, repositoriesEndpoint, REPOSITORY_AUTH_TYPES, REPOSITORY_PROVIDERS, REPOSITORY_SOURCE_FORMATS, repositoryEndpoint, repositoryResetEndpoint, repositoryValidateEndpoint, withRequiredRepositoryFields, } from '../repository-types.js';
|
|
39
|
+
import { buildStageMutationPayload, validateStagePayload } from '../stage-flags.js';
|
|
40
|
+
import { normalizePipelineStageConnection, normalizeStage, normalizeStagesListPage, pipelineStageConnectionEndpoint, pipelineStageConnectionsEndpoint, STAGE_META_STAGE_SUGGESTIONS, stageEndpoint, stagesEndpoint, } from '../stage-types.js';
|
|
36
41
|
import { getUserContext } from '../user-context.js';
|
|
37
42
|
import { DEFAULT_USER_ID, resolveUserId, userEndpoint } from '../user-types.js';
|
|
38
43
|
import { workStatusEndpoint } from '../work-types.js';
|
|
@@ -301,8 +306,7 @@ async function pipelineConnectionList(args) {
|
|
|
301
306
|
endpoint: pipelineDescribeEndpoint(args.pipelineId),
|
|
302
307
|
method: 'GET',
|
|
303
308
|
});
|
|
304
|
-
|
|
305
|
-
connections = pipeline.connections ?? [];
|
|
309
|
+
connections = normalizePipelineDescribe(response).connections ?? [];
|
|
306
310
|
}
|
|
307
311
|
else {
|
|
308
312
|
const response = await CicdGateway.call({
|
|
@@ -313,6 +317,196 @@ async function pipelineConnectionList(args) {
|
|
|
313
317
|
}
|
|
314
318
|
return { connections };
|
|
315
319
|
}
|
|
320
|
+
async function pipelineCreate(args) {
|
|
321
|
+
const payload = {
|
|
322
|
+
name: assertRequired(args.name, 'name'),
|
|
323
|
+
...buildPipelineMcpPayload(args),
|
|
324
|
+
};
|
|
325
|
+
const validationError = validatePipelineMutationPayload(payload);
|
|
326
|
+
if (validationError !== undefined) {
|
|
327
|
+
throw new Error(validationError);
|
|
328
|
+
}
|
|
329
|
+
const response = await CicdGateway.call({
|
|
330
|
+
body: payload,
|
|
331
|
+
endpoint: pipelineListEndpoint(),
|
|
332
|
+
headers: {
|
|
333
|
+
'Content-Type': 'application/json',
|
|
334
|
+
},
|
|
335
|
+
method: 'POST',
|
|
336
|
+
});
|
|
337
|
+
return { pipeline: normalizePipeline(response) };
|
|
338
|
+
}
|
|
339
|
+
async function pipelineUpdate(args) {
|
|
340
|
+
const id = assertRequired(args.id, 'id');
|
|
341
|
+
const payload = buildPipelineMcpPayload(args);
|
|
342
|
+
if (Object.keys(payload).length === 0) {
|
|
343
|
+
throw new Error('Must provide at least one field to update.');
|
|
344
|
+
}
|
|
345
|
+
const validationError = validatePipelineMutationPayload(payload);
|
|
346
|
+
if (validationError !== undefined) {
|
|
347
|
+
throw new Error(validationError);
|
|
348
|
+
}
|
|
349
|
+
const response = await CicdGateway.call({
|
|
350
|
+
body: payload,
|
|
351
|
+
endpoint: pipelineEndpoint(id),
|
|
352
|
+
headers: {
|
|
353
|
+
'Content-Type': 'application/json',
|
|
354
|
+
},
|
|
355
|
+
method: 'PATCH',
|
|
356
|
+
});
|
|
357
|
+
return { pipeline: normalizePipeline(response) };
|
|
358
|
+
}
|
|
359
|
+
async function pipelineConnectionCreate(args) {
|
|
360
|
+
const pipelineId = assertRequired(args.pipelineId, 'pipelineId');
|
|
361
|
+
const connections = buildPipelineConnectionMcpCreatePayloads(args);
|
|
362
|
+
for (const [index, connection] of connections.entries()) {
|
|
363
|
+
const validationError = validatePipelineConnectionCreatePayload(connection);
|
|
364
|
+
if (validationError !== undefined) {
|
|
365
|
+
throw new Error(`connections[${index}]: ${validationError}`);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
const response = await CicdGateway.call({
|
|
369
|
+
body: connections,
|
|
370
|
+
endpoint: pipelineConnectionsEndpoint(pipelineId),
|
|
371
|
+
headers: {
|
|
372
|
+
'Content-Type': 'application/json',
|
|
373
|
+
},
|
|
374
|
+
method: 'POST',
|
|
375
|
+
});
|
|
376
|
+
return { connections: normalizePipelineConnections(response) };
|
|
377
|
+
}
|
|
378
|
+
async function pipelineConnectionUpdate(args) {
|
|
379
|
+
const pipelineId = assertRequired(args.pipelineId, 'pipelineId');
|
|
380
|
+
const connections = buildPipelineConnectionMcpUpdatePayloads(args);
|
|
381
|
+
for (const [index, connection] of connections.entries()) {
|
|
382
|
+
const validationError = validatePipelineConnectionUpdatePayload(connection);
|
|
383
|
+
if (validationError !== undefined) {
|
|
384
|
+
throw new Error(`connections[${index}]: ${validationError}`);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
const response = await CicdGateway.call({
|
|
388
|
+
body: { connections },
|
|
389
|
+
endpoint: pipelineConnectionsEndpoint(pipelineId),
|
|
390
|
+
headers: {
|
|
391
|
+
'Content-Type': 'application/json',
|
|
392
|
+
},
|
|
393
|
+
method: 'PATCH',
|
|
394
|
+
});
|
|
395
|
+
return { connections: normalizePipelineConnections(response) };
|
|
396
|
+
}
|
|
397
|
+
async function pipelineConnectionDelete(args) {
|
|
398
|
+
const pipelineId = assertRequired(args.pipelineId, 'pipelineId');
|
|
399
|
+
const { connectionIds } = args;
|
|
400
|
+
if (!Array.isArray(connectionIds) || connectionIds.length === 0) {
|
|
401
|
+
throw new Error('connectionIds must be a non-empty array.');
|
|
402
|
+
}
|
|
403
|
+
await CicdGateway.call({
|
|
404
|
+
body: { connectionIds },
|
|
405
|
+
endpoint: pipelineConnectionsEndpoint(pipelineId),
|
|
406
|
+
headers: {
|
|
407
|
+
'Content-Type': 'application/json',
|
|
408
|
+
},
|
|
409
|
+
method: 'DELETE',
|
|
410
|
+
});
|
|
411
|
+
return { connectionIds, pipelineId };
|
|
412
|
+
}
|
|
413
|
+
async function stageList(args = {}) {
|
|
414
|
+
const response = await CicdGateway.call({
|
|
415
|
+
endpoint: stagesEndpoint(args),
|
|
416
|
+
method: 'GET',
|
|
417
|
+
});
|
|
418
|
+
return mcpPaginatedListPayload('stages', normalizeStagesListPage(response));
|
|
419
|
+
}
|
|
420
|
+
async function stageGet(args) {
|
|
421
|
+
const response = await CicdGateway.call({
|
|
422
|
+
endpoint: stageEndpoint(assertRequired(args.id, 'id')),
|
|
423
|
+
method: 'GET',
|
|
424
|
+
});
|
|
425
|
+
return { stage: normalizeStage(response) };
|
|
426
|
+
}
|
|
427
|
+
async function stageCreate(args) {
|
|
428
|
+
const payload = {
|
|
429
|
+
...buildStageMutationPayload(args),
|
|
430
|
+
name: assertRequired(args.name, 'name'),
|
|
431
|
+
};
|
|
432
|
+
const validationError = validateStagePayload(payload, true);
|
|
433
|
+
if (validationError !== undefined)
|
|
434
|
+
throw new Error(validationError);
|
|
435
|
+
const response = await CicdGateway.call({
|
|
436
|
+
body: payload,
|
|
437
|
+
endpoint: stagesEndpoint(),
|
|
438
|
+
headers: { 'Content-Type': 'application/json' },
|
|
439
|
+
method: 'POST',
|
|
440
|
+
});
|
|
441
|
+
return { stage: normalizeStage(response) };
|
|
442
|
+
}
|
|
443
|
+
async function stageUpdate(args) {
|
|
444
|
+
const id = assertRequired(args.id, 'id');
|
|
445
|
+
const payload = buildStageMutationPayload(args);
|
|
446
|
+
if (Object.keys(payload).length === 0)
|
|
447
|
+
throw new Error('Must provide at least one field to update.');
|
|
448
|
+
const validationError = validateStagePayload(payload);
|
|
449
|
+
if (validationError !== undefined)
|
|
450
|
+
throw new Error(validationError);
|
|
451
|
+
const response = await CicdGateway.call({
|
|
452
|
+
body: payload,
|
|
453
|
+
endpoint: stageEndpoint(id),
|
|
454
|
+
headers: { 'Content-Type': 'application/json' },
|
|
455
|
+
method: 'PATCH',
|
|
456
|
+
});
|
|
457
|
+
return { stage: normalizeStage(response) };
|
|
458
|
+
}
|
|
459
|
+
async function stageDelete(args) {
|
|
460
|
+
const id = assertRequired(args.id, 'id');
|
|
461
|
+
await CicdGateway.call({ endpoint: stageEndpoint(id), method: 'DELETE' });
|
|
462
|
+
return { id };
|
|
463
|
+
}
|
|
464
|
+
async function pipelineStageConnectionCreate(args) {
|
|
465
|
+
const pipelineId = assertRequired(args.pipelineId, 'pipelineId');
|
|
466
|
+
const payload = buildPipelineStageConnectionCreatePayload({
|
|
467
|
+
'next-pipeline-stage-connection-id': args.nextPipelineStageConnectionId,
|
|
468
|
+
'stage-id': args.stageId,
|
|
469
|
+
});
|
|
470
|
+
const response = await CicdGateway.call({
|
|
471
|
+
body: payload,
|
|
472
|
+
endpoint: pipelineStageConnectionsEndpoint(pipelineId),
|
|
473
|
+
headers: { 'Content-Type': 'application/json' },
|
|
474
|
+
method: 'POST',
|
|
475
|
+
});
|
|
476
|
+
return { connection: normalizePipelineStageConnection(response) };
|
|
477
|
+
}
|
|
478
|
+
async function pipelineStageConnectionList(args) {
|
|
479
|
+
const pipelineId = assertRequired(args.pipelineId, 'pipelineId');
|
|
480
|
+
const response = await CicdGateway.call({
|
|
481
|
+
endpoint: pipelineDescribeEndpoint(pipelineId),
|
|
482
|
+
method: 'GET',
|
|
483
|
+
});
|
|
484
|
+
return { connections: normalizePipelineDescribe(response).stageConnections ?? [] };
|
|
485
|
+
}
|
|
486
|
+
async function pipelineStageConnectionUpdate(args) {
|
|
487
|
+
const pipelineId = assertRequired(args.pipelineId, 'pipelineId');
|
|
488
|
+
const connectionId = assertRequired(args.connectionId, 'connectionId');
|
|
489
|
+
const payload = buildPipelineStageConnectionUpdatePayload({
|
|
490
|
+
'next-pipeline-stage-connection-id': args.nextPipelineStageConnectionId,
|
|
491
|
+
'stage-id': args.stageId,
|
|
492
|
+
}, connectionId);
|
|
493
|
+
const response = await CicdGateway.call({
|
|
494
|
+
body: payload,
|
|
495
|
+
endpoint: pipelineStageConnectionEndpoint(pipelineId, connectionId),
|
|
496
|
+
headers: { 'Content-Type': 'application/json' },
|
|
497
|
+
method: 'PATCH',
|
|
498
|
+
});
|
|
499
|
+
return { connection: normalizePipelineStageConnection(response) };
|
|
500
|
+
}
|
|
501
|
+
async function pipelineStageConnectionDelete(args) {
|
|
502
|
+
const pipelineId = assertRequired(args.pipelineId, 'pipelineId');
|
|
503
|
+
const connectionId = assertRequired(args.connectionId, 'connectionId');
|
|
504
|
+
await CicdGateway.call({
|
|
505
|
+
endpoint: pipelineStageConnectionEndpoint(pipelineId, connectionId),
|
|
506
|
+
method: 'DELETE',
|
|
507
|
+
});
|
|
508
|
+
return { connectionId, pipelineId };
|
|
509
|
+
}
|
|
316
510
|
async function projectList(args = {}) {
|
|
317
511
|
const response = await CicdGateway.call({
|
|
318
512
|
endpoint: projectsListEndpoint(args),
|
|
@@ -507,6 +701,41 @@ function buildRepositoryMcpPayload(args) {
|
|
|
507
701
|
}
|
|
508
702
|
return payload;
|
|
509
703
|
}
|
|
704
|
+
function buildPipelineMcpPayload(args) {
|
|
705
|
+
const payload = {};
|
|
706
|
+
for (const [key, value] of Object.entries(args)) {
|
|
707
|
+
if (key === 'id' || value === undefined) {
|
|
708
|
+
continue;
|
|
709
|
+
}
|
|
710
|
+
Object.assign(payload, { [key]: value });
|
|
711
|
+
}
|
|
712
|
+
return payload;
|
|
713
|
+
}
|
|
714
|
+
function buildPipelineConnectionMcpCreatePayloads(args) {
|
|
715
|
+
if ('connections' in args && Array.isArray(args.connections)) {
|
|
716
|
+
return args.connections.map((connection, index) => {
|
|
717
|
+
const payload = parsePipelineConnectionMutationObject(connection, index);
|
|
718
|
+
if (payload.syncMergeState === undefined) {
|
|
719
|
+
payload.syncMergeState = PIPELINE_CONNECTION_SYNC_STATE_NEEDS_RECALCULATING;
|
|
720
|
+
}
|
|
721
|
+
if (payload.syncPullState === undefined) {
|
|
722
|
+
payload.syncPullState = PIPELINE_CONNECTION_SYNC_STATE_NEEDS_RECALCULATING;
|
|
723
|
+
}
|
|
724
|
+
return payload;
|
|
725
|
+
});
|
|
726
|
+
}
|
|
727
|
+
const single = parsePipelineConnectionMutationObject(args);
|
|
728
|
+
if (single.syncMergeState === undefined) {
|
|
729
|
+
single.syncMergeState = PIPELINE_CONNECTION_SYNC_STATE_NEEDS_RECALCULATING;
|
|
730
|
+
}
|
|
731
|
+
if (single.syncPullState === undefined) {
|
|
732
|
+
single.syncPullState = PIPELINE_CONNECTION_SYNC_STATE_NEEDS_RECALCULATING;
|
|
733
|
+
}
|
|
734
|
+
return [single];
|
|
735
|
+
}
|
|
736
|
+
function buildPipelineConnectionMcpUpdatePayloads(args) {
|
|
737
|
+
return args.connections.map((connection, index) => parsePipelineConnectionUpdateObject(connection, index));
|
|
738
|
+
}
|
|
510
739
|
function validateRepositoryPayload(payload) {
|
|
511
740
|
const validationError = validateRepositoryNonEmptyStringFields(payload, REPOSITORY_STRING_VALIDATION_KEYS);
|
|
512
741
|
if (validationError !== undefined) {
|
|
@@ -922,9 +1151,18 @@ export const agentiaMcpToolHandlers = wrapMcpToolHandlers({
|
|
|
922
1151
|
metadataRefreshRun,
|
|
923
1152
|
metadataRefreshStatus,
|
|
924
1153
|
navigationResolve,
|
|
1154
|
+
pipelineConnectionCreate,
|
|
1155
|
+
pipelineConnectionDelete,
|
|
925
1156
|
pipelineConnectionList,
|
|
1157
|
+
pipelineConnectionUpdate,
|
|
1158
|
+
pipelineCreate,
|
|
926
1159
|
pipelineGet,
|
|
927
1160
|
pipelineList,
|
|
1161
|
+
pipelineStageConnectionCreate,
|
|
1162
|
+
pipelineStageConnectionDelete,
|
|
1163
|
+
pipelineStageConnectionList,
|
|
1164
|
+
pipelineStageConnectionUpdate,
|
|
1165
|
+
pipelineUpdate,
|
|
928
1166
|
projectDefaultGet,
|
|
929
1167
|
projectDefaultSet,
|
|
930
1168
|
projectDefaultUnset,
|
|
@@ -944,6 +1182,11 @@ export const agentiaMcpToolHandlers = wrapMcpToolHandlers({
|
|
|
944
1182
|
repositoryReset,
|
|
945
1183
|
repositoryUpdate,
|
|
946
1184
|
repositoryValidate,
|
|
1185
|
+
stageCreate,
|
|
1186
|
+
stageDelete,
|
|
1187
|
+
stageGet,
|
|
1188
|
+
stageList,
|
|
1189
|
+
stageUpdate,
|
|
947
1190
|
userGet,
|
|
948
1191
|
workStatus,
|
|
949
1192
|
...agentiaMcpTestingToolHandlers,
|
|
@@ -972,6 +1215,25 @@ const projectSelectorSchema = {
|
|
|
972
1215
|
sprint: z.boolean().optional().describe('Select the sprint default.'),
|
|
973
1216
|
team: z.boolean().optional().describe('Select the team default.'),
|
|
974
1217
|
};
|
|
1218
|
+
const pipelineMutationSchema = {
|
|
1219
|
+
active: z.boolean().optional().describe('Whether the pipeline is active.'),
|
|
1220
|
+
blockCommits: z.boolean().optional().describe('Block commits on the pipeline.'),
|
|
1221
|
+
calculateBasedOn: z.enum(PIPELINE_CALCULATE_BASED_ON_VALUES).optional().describe('Promotion calculation basis.'),
|
|
1222
|
+
enableSmartConflictResolution: z.boolean().optional().describe('Enable smart conflict resolution.'),
|
|
1223
|
+
gitRepositoryId: z.string().optional().describe('Git repository ID.'),
|
|
1224
|
+
mainBranch: z.string().optional().describe('Main branch name.'),
|
|
1225
|
+
platform: z.enum(PIPELINE_PLATFORMS).optional().describe('Pipeline platform.'),
|
|
1226
|
+
};
|
|
1227
|
+
const pipelineConnectionMutationSchema = {
|
|
1228
|
+
branch: z.string().optional().describe('Source branch for the connection.'),
|
|
1229
|
+
destinationBranch: z.string().optional().describe('Destination branch for the connection.'),
|
|
1230
|
+
destinationEnvironmentId: z.string().optional().describe('Destination environment ID.'),
|
|
1231
|
+
id: z.string().optional().describe('Pipeline connection ID.'),
|
|
1232
|
+
sourceEnvironmentId: z.string().optional().describe('Source environment ID.'),
|
|
1233
|
+
stageConnectionId: z.string().optional().describe('Stage connection ID.'),
|
|
1234
|
+
syncMergeState: z.string().optional().describe('Sync merge state.'),
|
|
1235
|
+
syncPullState: z.string().optional().describe('Sync pull state.'),
|
|
1236
|
+
};
|
|
975
1237
|
const repositoryMutationSchema = {
|
|
976
1238
|
allowFunctionsGitCache: z.boolean().optional().describe('Allow Functions Git cache for this repository.'),
|
|
977
1239
|
authType: z.enum(REPOSITORY_AUTH_TYPES).optional().describe('Repository authentication type.'),
|
|
@@ -1161,7 +1423,12 @@ export function registerAgentiaMcpTools(server) {
|
|
|
1161
1423
|
}, (args) => safelyHandleTool(() => jobPause(args)));
|
|
1162
1424
|
server.registerTool('agentia_pipeline_list', {
|
|
1163
1425
|
description: 'List Copado pipelines via the CICD gateway.',
|
|
1164
|
-
inputSchema:
|
|
1426
|
+
inputSchema: {
|
|
1427
|
+
active: z.boolean().optional().describe('Filter by active status.'),
|
|
1428
|
+
name: z.string().optional().describe('Filter by pipeline name.'),
|
|
1429
|
+
platform: z.enum(PIPELINE_PLATFORMS).optional().describe('Filter by pipeline platform.'),
|
|
1430
|
+
...listPaginationZodFields,
|
|
1431
|
+
},
|
|
1165
1432
|
title: 'Agentia Pipeline List',
|
|
1166
1433
|
}, (args) => safelyHandleTool(() => pipelineList(args || {})));
|
|
1167
1434
|
server.registerTool('agentia_pipeline_get', {
|
|
@@ -1171,13 +1438,124 @@ export function registerAgentiaMcpTools(server) {
|
|
|
1171
1438
|
},
|
|
1172
1439
|
title: 'Agentia Pipeline Get',
|
|
1173
1440
|
}, (args) => safelyHandleTool(() => pipelineGet(args)));
|
|
1441
|
+
server.registerTool('agentia_pipeline_create', {
|
|
1442
|
+
description: 'Create a Copado pipeline via the CICD gateway.',
|
|
1443
|
+
inputSchema: {
|
|
1444
|
+
...pipelineMutationSchema,
|
|
1445
|
+
name: z.string().describe('Pipeline name.'),
|
|
1446
|
+
},
|
|
1447
|
+
title: 'Agentia Pipeline Create',
|
|
1448
|
+
}, (args) => safelyHandleTool(() => pipelineCreate(args)));
|
|
1449
|
+
server.registerTool('agentia_pipeline_update', {
|
|
1450
|
+
description: 'Update a Copado pipeline via the CICD gateway.',
|
|
1451
|
+
inputSchema: {
|
|
1452
|
+
...pipelineMutationSchema,
|
|
1453
|
+
id: z.string().describe('Pipeline Id.'),
|
|
1454
|
+
name: z.string().optional().describe('Pipeline name.'),
|
|
1455
|
+
},
|
|
1456
|
+
title: 'Agentia Pipeline Update',
|
|
1457
|
+
}, (args) => safelyHandleTool(() => pipelineUpdate(args)));
|
|
1174
1458
|
server.registerTool('agentia_pipeline_connection_list', {
|
|
1175
|
-
description: 'List Copado pipeline connections via
|
|
1459
|
+
description: 'List Copado pipeline connections via describe or pipeline list.',
|
|
1176
1460
|
inputSchema: {
|
|
1177
1461
|
pipelineId: z.string().optional().describe('Optional pipeline Id. When set, uses the describe endpoint.'),
|
|
1178
1462
|
},
|
|
1179
1463
|
title: 'Agentia Pipeline Connection List',
|
|
1180
1464
|
}, (args) => safelyHandleTool(() => pipelineConnectionList(args)));
|
|
1465
|
+
server.registerTool('agentia_pipeline_connection_create', {
|
|
1466
|
+
description: 'Create one or more Copado pipeline connections via the CICD gateway.',
|
|
1467
|
+
inputSchema: {
|
|
1468
|
+
...pipelineConnectionMutationSchema,
|
|
1469
|
+
connections: z
|
|
1470
|
+
.array(z.object(pipelineConnectionMutationSchema))
|
|
1471
|
+
.optional()
|
|
1472
|
+
.describe('Optional array of connections to create in bulk.'),
|
|
1473
|
+
pipelineId: z.string().describe('Pipeline Id.'),
|
|
1474
|
+
},
|
|
1475
|
+
title: 'Agentia Pipeline Connection Create',
|
|
1476
|
+
}, (args) => safelyHandleTool(() => pipelineConnectionCreate(args)));
|
|
1477
|
+
server.registerTool('agentia_pipeline_connection_update', {
|
|
1478
|
+
description: 'Update one or more Copado pipeline connections via the CICD gateway.',
|
|
1479
|
+
inputSchema: {
|
|
1480
|
+
connections: z.array(z.object(pipelineConnectionMutationSchema)).describe('Connections to update.'),
|
|
1481
|
+
pipelineId: z.string().describe('Pipeline Id.'),
|
|
1482
|
+
},
|
|
1483
|
+
title: 'Agentia Pipeline Connection Update',
|
|
1484
|
+
}, (args) => safelyHandleTool(() => pipelineConnectionUpdate(args)));
|
|
1485
|
+
server.registerTool('agentia_pipeline_connection_delete', {
|
|
1486
|
+
description: 'Delete one or more Copado pipeline connections via the CICD gateway.',
|
|
1487
|
+
inputSchema: {
|
|
1488
|
+
connectionIds: z.array(z.string()).describe('Pipeline connection IDs to delete.'),
|
|
1489
|
+
pipelineId: z.string().describe('Pipeline Id.'),
|
|
1490
|
+
},
|
|
1491
|
+
title: 'Agentia Pipeline Connection Delete',
|
|
1492
|
+
}, (args) => safelyHandleTool(() => pipelineConnectionDelete(args)));
|
|
1493
|
+
server.registerTool('agentia_stage_list', {
|
|
1494
|
+
description: 'List Copado stages via the CICD gateway.',
|
|
1495
|
+
inputSchema: listPaginationZodFields,
|
|
1496
|
+
title: 'Agentia Stage List',
|
|
1497
|
+
}, (args) => safelyHandleTool(() => stageList(args || {})));
|
|
1498
|
+
server.registerTool('agentia_stage_get', {
|
|
1499
|
+
description: 'Get a Copado stage via the CICD gateway.',
|
|
1500
|
+
inputSchema: { id: z.string().describe('Stage ID.') },
|
|
1501
|
+
title: 'Agentia Stage Get',
|
|
1502
|
+
}, (args) => safelyHandleTool(() => stageGet(args)));
|
|
1503
|
+
server.registerTool('agentia_stage_create', {
|
|
1504
|
+
description: `Create a Copado stage. Common metaStage values include ${STAGE_META_STAGE_SUGGESTIONS.join(', ')}; custom values are allowed.`,
|
|
1505
|
+
inputSchema: {
|
|
1506
|
+
metaStage: z.string().optional().describe('Stage category; custom values are allowed.'),
|
|
1507
|
+
name: z.string().describe('Stage name.'),
|
|
1508
|
+
},
|
|
1509
|
+
title: 'Agentia Stage Create',
|
|
1510
|
+
}, (args) => safelyHandleTool(() => stageCreate(args)));
|
|
1511
|
+
server.registerTool('agentia_stage_update', {
|
|
1512
|
+
description: 'Update a Copado stage via the CICD gateway.',
|
|
1513
|
+
inputSchema: {
|
|
1514
|
+
id: z.string().describe('Stage ID.'),
|
|
1515
|
+
metaStage: z.string().optional().describe('Stage category; custom values are allowed.'),
|
|
1516
|
+
name: z.string().optional().describe('Stage name.'),
|
|
1517
|
+
},
|
|
1518
|
+
title: 'Agentia Stage Update',
|
|
1519
|
+
}, (args) => safelyHandleTool(() => stageUpdate(args)));
|
|
1520
|
+
server.registerTool('agentia_stage_delete', {
|
|
1521
|
+
description: 'Delete a Copado stage via the CICD gateway.',
|
|
1522
|
+
inputSchema: { id: z.string().describe('Stage ID.') },
|
|
1523
|
+
title: 'Agentia Stage Delete',
|
|
1524
|
+
}, (args) => safelyHandleTool(() => stageDelete(args)));
|
|
1525
|
+
server.registerTool('agentia_pipeline_stage_connection_create', {
|
|
1526
|
+
description: 'Create a pipeline stage connection via the CICD gateway.',
|
|
1527
|
+
inputSchema: {
|
|
1528
|
+
nextPipelineStageConnectionId: z.string().optional().describe('Next pipeline stage connection ID.'),
|
|
1529
|
+
pipelineId: z.string().describe('Pipeline ID.'),
|
|
1530
|
+
stageId: z.string().describe('Stage ID.'),
|
|
1531
|
+
},
|
|
1532
|
+
title: 'Agentia Pipeline Stage Connection Create',
|
|
1533
|
+
}, (args) => safelyHandleTool(() => pipelineStageConnectionCreate(args)));
|
|
1534
|
+
server.registerTool('agentia_pipeline_stage_connection_list', {
|
|
1535
|
+
description: 'List pipeline stage connections from the pipeline describe response.',
|
|
1536
|
+
inputSchema: {
|
|
1537
|
+
pipelineId: z.string().describe('Pipeline ID.'),
|
|
1538
|
+
},
|
|
1539
|
+
title: 'Agentia Pipeline Stage Connection List',
|
|
1540
|
+
}, (args) => safelyHandleTool(() => pipelineStageConnectionList(args)));
|
|
1541
|
+
server.registerTool('agentia_pipeline_stage_connection_update', {
|
|
1542
|
+
description: 'Update a pipeline stage connection via the CICD gateway.',
|
|
1543
|
+
inputSchema: {
|
|
1544
|
+
connectionId: z.string().describe('Pipeline stage connection ID.'),
|
|
1545
|
+
nextPipelineStageConnectionId: z.string().optional().describe('Next pipeline stage connection ID.'),
|
|
1546
|
+
pipelineId: z.string().describe('Pipeline ID.'),
|
|
1547
|
+
stageId: z.string().optional().describe('Stage ID.'),
|
|
1548
|
+
},
|
|
1549
|
+
title: 'Agentia Pipeline Stage Connection Update',
|
|
1550
|
+
}, (args) => safelyHandleTool(() => pipelineStageConnectionUpdate(args)));
|
|
1551
|
+
server.registerTool('agentia_pipeline_stage_connection_delete', {
|
|
1552
|
+
description: 'Delete a pipeline stage connection via the CICD gateway.',
|
|
1553
|
+
inputSchema: {
|
|
1554
|
+
connectionId: z.string().describe('Pipeline stage connection ID.'),
|
|
1555
|
+
pipelineId: z.string().describe('Pipeline ID.'),
|
|
1556
|
+
},
|
|
1557
|
+
title: 'Agentia Pipeline Stage Connection Delete',
|
|
1558
|
+
}, (args) => safelyHandleTool(() => pipelineStageConnectionDelete(args)));
|
|
1181
1559
|
server.registerTool('agentia_project_list', {
|
|
1182
1560
|
description: 'List Copado projects via the CICD gateway.',
|
|
1183
1561
|
inputSchema: {
|