@copado/agentia-cli 0.84.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.
Files changed (81) hide show
  1. package/README.md +694 -161
  2. package/dist/commands/cicd/pipeline/connection/create.d.ts +19 -0
  3. package/dist/commands/cicd/pipeline/connection/create.js +67 -0
  4. package/dist/commands/cicd/pipeline/connection/create.js.map +1 -0
  5. package/dist/commands/cicd/pipeline/connection/delete.d.ts +15 -0
  6. package/dist/commands/cicd/pipeline/connection/delete.js +62 -0
  7. package/dist/commands/cicd/pipeline/connection/delete.js.map +1 -0
  8. package/dist/commands/cicd/pipeline/connection/open.d.ts +12 -0
  9. package/dist/commands/cicd/pipeline/connection/open.js +30 -0
  10. package/dist/commands/cicd/pipeline/connection/open.js.map +1 -0
  11. package/dist/commands/cicd/pipeline/connection/update.d.ts +19 -0
  12. package/dist/commands/cicd/pipeline/connection/update.js +55 -0
  13. package/dist/commands/cicd/pipeline/connection/update.js.map +1 -0
  14. package/dist/commands/cicd/pipeline/create.d.ts +19 -0
  15. package/dist/commands/cicd/pipeline/create.js +42 -0
  16. package/dist/commands/cicd/pipeline/create.js.map +1 -0
  17. package/dist/commands/cicd/pipeline/list.d.ts +3 -0
  18. package/dist/commands/cicd/pipeline/list.js +5 -3
  19. package/dist/commands/cicd/pipeline/list.js.map +1 -1
  20. package/dist/commands/cicd/pipeline/stage-connection/create.d.ts +12 -0
  21. package/dist/commands/cicd/pipeline/stage-connection/create.js +33 -0
  22. package/dist/commands/cicd/pipeline/stage-connection/create.js.map +1 -0
  23. package/dist/commands/cicd/pipeline/stage-connection/delete.d.ts +16 -0
  24. package/dist/commands/cicd/pipeline/stage-connection/delete.js +34 -0
  25. package/dist/commands/cicd/pipeline/stage-connection/delete.js.map +1 -0
  26. package/dist/commands/cicd/pipeline/stage-connection/list.d.ts +10 -0
  27. package/dist/commands/cicd/pipeline/stage-connection/list.js +37 -0
  28. package/dist/commands/cicd/pipeline/stage-connection/list.js.map +1 -0
  29. package/dist/commands/cicd/pipeline/stage-connection/open.d.ts +12 -0
  30. package/dist/commands/cicd/pipeline/stage-connection/open.js +16 -0
  31. package/dist/commands/cicd/pipeline/stage-connection/open.js.map +1 -0
  32. package/dist/commands/cicd/pipeline/stage-connection/update.d.ts +15 -0
  33. package/dist/commands/cicd/pipeline/stage-connection/update.js +38 -0
  34. package/dist/commands/cicd/pipeline/stage-connection/update.js.map +1 -0
  35. package/dist/commands/cicd/pipeline/update.d.ts +20 -0
  36. package/dist/commands/cicd/pipeline/update.js +52 -0
  37. package/dist/commands/cicd/pipeline/update.js.map +1 -0
  38. package/dist/commands/cicd/stage/create.d.ts +14 -0
  39. package/dist/commands/cicd/stage/create.js +28 -0
  40. package/dist/commands/cicd/stage/create.js.map +1 -0
  41. package/dist/commands/cicd/stage/delete.d.ts +14 -0
  42. package/dist/commands/cicd/stage/delete.js +28 -0
  43. package/dist/commands/cicd/stage/delete.js.map +1 -0
  44. package/dist/commands/cicd/stage/get.d.ts +10 -0
  45. package/dist/commands/cicd/stage/get.js +17 -0
  46. package/dist/commands/cicd/stage/get.js.map +1 -0
  47. package/dist/commands/cicd/stage/list.d.ts +12 -0
  48. package/dist/commands/cicd/stage/list.js +27 -0
  49. package/dist/commands/cicd/stage/list.js.map +1 -0
  50. package/dist/commands/cicd/stage/open.d.ts +12 -0
  51. package/dist/commands/cicd/stage/open.js +16 -0
  52. package/dist/commands/cicd/stage/open.js.map +1 -0
  53. package/dist/commands/cicd/stage/update.d.ts +14 -0
  54. package/dist/commands/cicd/stage/update.js +30 -0
  55. package/dist/commands/cicd/stage/update.js.map +1 -0
  56. package/dist/lib/mcp/tools.d.ts +134 -2
  57. package/dist/lib/mcp/tools.js +383 -5
  58. package/dist/lib/mcp/tools.js.map +1 -1
  59. package/dist/lib/navigation.d.ts +1 -1
  60. package/dist/lib/navigation.js +3 -0
  61. package/dist/lib/navigation.js.map +1 -1
  62. package/dist/lib/pipeline-connection-flags.d.ts +62 -0
  63. package/dist/lib/pipeline-connection-flags.js +309 -0
  64. package/dist/lib/pipeline-connection-flags.js.map +1 -0
  65. package/dist/lib/pipeline-flags.d.ts +74 -0
  66. package/dist/lib/pipeline-flags.js +154 -0
  67. package/dist/lib/pipeline-flags.js.map +1 -0
  68. package/dist/lib/pipeline-stage-connection-flags.d.ts +25 -0
  69. package/dist/lib/pipeline-stage-connection-flags.js +46 -0
  70. package/dist/lib/pipeline-stage-connection-flags.js.map +1 -0
  71. package/dist/lib/pipeline-types.d.ts +91 -2
  72. package/dist/lib/pipeline-types.js +51 -5
  73. package/dist/lib/pipeline-types.js.map +1 -1
  74. package/dist/lib/stage-flags.d.ts +19 -0
  75. package/dist/lib/stage-flags.js +29 -0
  76. package/dist/lib/stage-flags.js.map +1 -0
  77. package/dist/lib/stage-types.d.ts +67 -0
  78. package/dist/lib/stage-types.js +69 -0
  79. package/dist/lib/stage-types.js.map +1 -0
  80. package/oclif.manifest.json +1835 -716
  81. package/package.json +2 -2
@@ -0,0 +1,16 @@
1
+ import { Args } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../../lib/agentia-command.js';
3
+ import { openNavigationTarget } from '../../../../lib/navigation-open.js';
4
+ import { resolveNavigationTarget } from '../../../../lib/navigation.js';
5
+ export default class PipelineStageConnectionOpen extends AgentiaCommand {
6
+ static args = { id: Args.string({ description: 'Pipeline stage connection ID', required: true }) };
7
+ static description = 'Open a pipeline stage connection in the browser';
8
+ static examples = ['<%= config.bin %> <%= command.id %> connection-1', '<%= config.bin %> <%= command.id %> connection-1 --json'];
9
+ async run() {
10
+ const { args } = await this.parse(PipelineStageConnectionOpen);
11
+ const target = await this.withSpinner('Resolving navigation URL', () => resolveNavigationTarget({ id: args.id, resourceType: 'pipeline_stage_connection' }));
12
+ await openNavigationTarget(target, { jsonEnabled: this.jsonEnabled(), log: this.log.bind(this) });
13
+ return target;
14
+ }
15
+ }
16
+ //# sourceMappingURL=open.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open.js","sourceRoot":"","sources":["../../../../../src/commands/cicd/pipeline/stage-connection/open.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,cAAc,EAAC,MAAM,oCAAoC,CAAA;AACjE,OAAO,EAAC,oBAAoB,EAAC,MAAM,oCAAoC,CAAA;AACvE,OAAO,EAAC,uBAAuB,EAAC,MAAM,+BAA+B,CAAA;AAErE,MAAM,CAAC,OAAO,OAAO,2BAA4B,SAAQ,cAAc;IACrE,MAAM,CAAU,IAAI,GAAG,EAAC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,8BAA8B,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,EAAC,CAAA;IACvG,MAAM,CAAU,WAAW,GAAG,iDAAiD,CAAA;IAC/E,MAAM,CAAU,QAAQ,GAAG,CAAC,kDAAkD,EAAE,yDAAyD,CAAC,CAAA;IAEnI,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAA;QAC5D,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,0BAA0B,EAAE,GAAG,EAAE,CACrE,uBAAuB,CAAC,EAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,YAAY,EAAE,2BAA2B,EAAC,CAAC,CAClF,CAAA;QACD,MAAM,oBAAoB,CAAC,MAAM,EAAE,EAAC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAC,CAAC,CAAA;QAC/F,OAAO,MAAM,CAAA;IACf,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { AgentiaCommand } from '../../../../lib/agentia-command.js';
2
+ import { type PipelineStageConnection } from '../../../../lib/stage-types.js';
3
+ export default class PipelineStageConnectionUpdate extends AgentiaCommand {
4
+ static args: {
5
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static description: string;
8
+ static examples: string[];
9
+ static flags: {
10
+ readonly 'pipeline-id': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
11
+ readonly 'next-pipeline-stage-connection-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ readonly 'stage-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ };
14
+ run(): Promise<PipelineStageConnection>;
15
+ }
@@ -0,0 +1,38 @@
1
+ import { Args } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../../lib/agentia-command.js';
3
+ import { assertRequired } from '../../../../lib/assert.js';
4
+ import { CicdGateway } from '../../../../lib/cicd-gateway.js';
5
+ import { buildPipelineStageConnectionUpdatePayload, pipelineStageConnectionUpdateFlags, } from '../../../../lib/pipeline-stage-connection-flags.js';
6
+ import { normalizePipelineStageConnection, pipelineStageConnectionEndpoint, } from '../../../../lib/stage-types.js';
7
+ export default class PipelineStageConnectionUpdate extends AgentiaCommand {
8
+ static args = {
9
+ id: Args.string({ description: 'Pipeline stage connection ID', required: true }),
10
+ };
11
+ static description = 'Update a pipeline stage connection';
12
+ static examples = [
13
+ '<%= config.bin %> <%= command.id %> connection-1 --pipeline-id pipeline-1 --next-pipeline-stage-connection-id connection-2',
14
+ ];
15
+ static flags = pipelineStageConnectionUpdateFlags;
16
+ async run() {
17
+ const { args, flags } = await this.parse(PipelineStageConnectionUpdate);
18
+ const connectionId = assertRequired(args.id, 'id');
19
+ const pipelineId = assertRequired(flags['pipeline-id'], '--pipeline-id');
20
+ let payload;
21
+ try {
22
+ payload = buildPipelineStageConnectionUpdatePayload(flags, connectionId);
23
+ }
24
+ catch (error) {
25
+ this.error(error instanceof Error ? error.message : String(error), { exit: 2 });
26
+ }
27
+ const response = await this.withSpinner('Updating pipeline stage connection', () => CicdGateway.call({
28
+ body: payload,
29
+ endpoint: pipelineStageConnectionEndpoint(pipelineId, connectionId),
30
+ headers: { 'Content-Type': 'application/json' },
31
+ method: 'PATCH',
32
+ }));
33
+ const connection = normalizePipelineStageConnection(response);
34
+ this.display(() => this.log(`Updated pipeline stage connection (ID: ${connection.id ?? connectionId}).`));
35
+ return connection;
36
+ }
37
+ }
38
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../../src/commands/cicd/pipeline/stage-connection/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,cAAc,EAAC,MAAM,oCAAoC,CAAA;AACjE,OAAO,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAC,WAAW,EAAC,MAAM,iCAAiC,CAAA;AAC3D,OAAO,EACL,yCAAyC,EACzC,kCAAkC,GACnC,MAAM,oDAAoD,CAAA;AAC3D,OAAO,EACL,gCAAgC,EAEhC,+BAA+B,GAEhC,MAAM,gCAAgC,CAAA;AAEvC,MAAM,CAAC,OAAO,OAAO,6BAA8B,SAAQ,cAAc;IACvE,MAAM,CAAU,IAAI,GAAG;QACrB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,8BAA8B,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC;KAC/E,CAAA;IACD,MAAM,CAAU,WAAW,GAAG,oCAAoC,CAAA;IAClE,MAAM,CAAU,QAAQ,GAAG;QACzB,4HAA4H;KAC7H,CAAA;IACD,MAAM,CAAU,KAAK,GAAG,kCAAkC,CAAA;IAEnD,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAA;QACrE,MAAM,YAAY,GAAG,cAAc,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAA;QAClD,MAAM,UAAU,GAAG,cAAc,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,eAAe,CAAC,CAAA;QACxE,IAAI,OAAO,CAAA;QACX,IAAI,CAAC;YACH,OAAO,GAAG,yCAAyC,CAAC,KAAK,EAAE,YAAY,CAAC,CAAA;QAC1E,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAA;QAC/E,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,oCAAoC,EAAE,GAAG,EAAE,CACjF,WAAW,CAAC,IAAI,CAA4D;YAC1E,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,+BAA+B,CAAC,UAAU,EAAE,YAAY,CAAC;YACnE,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,EAAC;YAC7C,MAAM,EAAE,OAAO;SAChB,CAAC,CACH,CAAA;QACD,MAAM,UAAU,GAAG,gCAAgC,CAAC,QAAQ,CAAC,CAAA;QAC7D,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,0CAA0C,UAAU,CAAC,EAAE,IAAI,YAAY,IAAI,CAAC,CAAC,CAAA;QACzG,OAAO,UAAU,CAAA;IACnB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
2
+ import { type Pipeline } from '../../../lib/pipeline-types.js';
3
+ export default class PipelineUpdate extends AgentiaCommand {
4
+ static args: {
5
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static description: string;
8
+ static examples: string[];
9
+ static flags: {
10
+ readonly name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ readonly 'calculate-based-on': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ readonly 'git-repository-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
13
+ readonly 'main-branch': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
14
+ readonly platform: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
15
+ readonly active: import("@oclif/core/interfaces").BooleanFlag<boolean>;
16
+ readonly 'block-commits': import("@oclif/core/interfaces").BooleanFlag<boolean>;
17
+ readonly 'enable-smart-conflict-resolution': import("@oclif/core/interfaces").BooleanFlag<boolean>;
18
+ };
19
+ run(): Promise<Pipeline>;
20
+ }
@@ -0,0 +1,52 @@
1
+ import { Args } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
3
+ import { CicdGateway } from '../../../lib/cicd-gateway.js';
4
+ import { buildPipelineMutationPayload, collectPipelineMutationFlagKeys, pipelineUpdateFlags, validatePipelineMutationPayload, } from '../../../lib/pipeline-flags.js';
5
+ import { normalizePipeline, pipelineEndpoint, } from '../../../lib/pipeline-types.js';
6
+ export default class PipelineUpdate extends AgentiaCommand {
7
+ static args = {
8
+ id: Args.string({
9
+ description: 'Pipeline ID',
10
+ required: true,
11
+ }),
12
+ };
13
+ static description = 'Update a Copado pipeline by ID';
14
+ static examples = [
15
+ '<%= config.bin %> <%= command.id %> pipeline-1 --main-branch develop',
16
+ '<%= config.bin %> <%= command.id %> pipeline-1 --platform SFDX --active',
17
+ '<%= config.bin %> <%= command.id %> pipeline-1 --name "Updated Pipeline" --json',
18
+ ];
19
+ static flags = pipelineUpdateFlags;
20
+ async run() {
21
+ const { args, flags } = await this.parse(PipelineUpdate);
22
+ const selectedKeys = collectPipelineMutationFlagKeys(flags);
23
+ if (selectedKeys.length === 0) {
24
+ this.error('Must provide at least one flag to update.', {
25
+ exit: 2,
26
+ suggestions: [
27
+ `${this.config.bin} cicd pipeline update ${args.id} --main-branch develop`,
28
+ `${this.config.bin} cicd pipeline update ${args.id} --platform SFDX`,
29
+ ],
30
+ });
31
+ }
32
+ const payload = buildPipelineMutationPayload(flags);
33
+ const validationError = validatePipelineMutationPayload(payload);
34
+ if (validationError !== undefined) {
35
+ this.error(validationError, { exit: 2 });
36
+ }
37
+ const response = await this.withSpinner('Updating pipeline', () => CicdGateway.call({
38
+ body: payload,
39
+ endpoint: pipelineEndpoint(args.id),
40
+ headers: {
41
+ 'Content-Type': 'application/json',
42
+ },
43
+ method: 'PATCH',
44
+ }));
45
+ const pipeline = normalizePipeline(response);
46
+ this.display(() => {
47
+ this.log(`Updated pipeline ${pipeline.name ?? payload.name ?? args.id} (ID: ${pipeline.id ?? args.id}).`);
48
+ });
49
+ return pipeline;
50
+ }
51
+ }
52
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/commands/cicd/pipeline/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EACL,4BAA4B,EAC5B,+BAA+B,EAC/B,mBAAmB,EACnB,+BAA+B,GAChC,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,iBAAiB,EAEjB,gBAAgB,GAEjB,MAAM,gCAAgC,CAAA;AAEvC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,cAAc;IACxD,MAAM,CAAU,IAAI,GAAG;QACrB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC;YACd,WAAW,EAAE,aAAa;YAC1B,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAA;IACD,MAAM,CAAU,WAAW,GAAG,gCAAgC,CAAA;IAC9D,MAAM,CAAU,QAAQ,GAAG;QACzB,sEAAsE;QACtE,yEAAyE;QACzE,iFAAiF;KAClF,CAAA;IACD,MAAM,CAAU,KAAK,GAAG,mBAAmB,CAAA;IAEpC,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;QACtD,MAAM,YAAY,GAAG,+BAA+B,CAAC,KAAK,CAAC,CAAA;QAE3D,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9B,IAAI,CAAC,KAAK,CAAC,2CAA2C,EAAE;gBACtD,IAAI,EAAE,CAAC;gBACP,WAAW,EAAE;oBACX,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,yBAAyB,IAAI,CAAC,EAAE,wBAAwB;oBAC1E,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,yBAAyB,IAAI,CAAC,EAAE,kBAAkB;iBACrE;aACF,CAAC,CAAA;QACJ,CAAC;QAED,MAAM,OAAO,GAAG,4BAA4B,CAAC,KAAK,CAAC,CAAA;QACnD,MAAM,eAAe,GAAG,+BAA+B,CAAC,OAAO,CAAC,CAAA;QAEhE,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;YAClC,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAA;QACxC,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,mBAAmB,EAAE,GAAG,EAAE,CAChE,WAAW,CAAC,IAAI,CAA8B;YAC5C,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;YACnC,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;aACnC;YACD,MAAM,EAAE,OAAO;SAChB,CAAC,CACH,CAAA;QACD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAA;QAE5C,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,CAAC,GAAG,CAAC,oBAAoB,QAAQ,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,SAAS,QAAQ,CAAC,EAAE,IAAI,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;QAC3G,CAAC,CAAC,CAAA;QAEF,OAAO,QAAQ,CAAA;IACjB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
2
+ import { type Stage } from '../../../lib/stage-types.js';
3
+ export default class StageCreate extends AgentiaCommand {
4
+ static args: {
5
+ name: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static description: string;
8
+ static examples: string[];
9
+ static flags: {
10
+ readonly 'meta-stage': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ readonly name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ };
13
+ run(): Promise<Stage>;
14
+ }
@@ -0,0 +1,28 @@
1
+ import { Args } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
3
+ import { CicdGateway } from '../../../lib/cicd-gateway.js';
4
+ import { buildStageMutationPayload, stageCreateFlags, validateStagePayload } from '../../../lib/stage-flags.js';
5
+ import { normalizeStage, stagesEndpoint } from '../../../lib/stage-types.js';
6
+ export default class StageCreate extends AgentiaCommand {
7
+ static args = { name: Args.string({ description: 'Stage name', required: true }) };
8
+ static description = 'Create a Copado stage';
9
+ static examples = ['<%= config.bin %> <%= command.id %> Build', '<%= config.bin %> <%= command.id %> Test --meta-stage Test'];
10
+ static flags = stageCreateFlags;
11
+ async run() {
12
+ const { args, flags } = await this.parse(StageCreate);
13
+ const payload = { ...buildStageMutationPayload(flags), name: args.name };
14
+ const validationError = validateStagePayload(payload, true);
15
+ if (validationError !== undefined)
16
+ this.error(validationError, { exit: 2 });
17
+ const response = await this.withSpinner('Creating stage', () => CicdGateway.call({
18
+ body: payload,
19
+ endpoint: stagesEndpoint(),
20
+ headers: { 'Content-Type': 'application/json' },
21
+ method: 'POST',
22
+ }));
23
+ const stage = normalizeStage(response);
24
+ this.display(() => this.log(`Created stage ${stage.name ?? args.name} (ID: ${stage.id ?? 'unknown id'}).`));
25
+ return stage;
26
+ }
27
+ }
28
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/cicd/stage/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAC,yBAAyB,EAAE,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,6BAA6B,CAAA;AAC7G,OAAO,EAAC,cAAc,EAAkC,cAAc,EAAC,MAAM,6BAA6B,CAAA;AAE1G,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,cAAc;IACrD,MAAM,CAAU,IAAI,GAAG,EAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,EAAC,CAAA;IACvF,MAAM,CAAU,WAAW,GAAG,uBAAuB,CAAA;IACrD,MAAM,CAAU,QAAQ,GAAG,CAAC,2CAA2C,EAAE,4DAA4D,CAAC,CAAA;IACtI,MAAM,CAAU,KAAK,GAAG,gBAAgB,CAAA;IAEjC,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QACnD,MAAM,OAAO,GAAG,EAAC,GAAG,yBAAyB,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAC,CAAA;QACtE,MAAM,eAAe,GAAG,oBAAoB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;QAC3D,IAAI,eAAe,KAAK,SAAS;YAAE,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAA;QAEzE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,GAAG,EAAE,CAC7D,WAAW,CAAC,IAAI,CAAwB;YACtC,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,cAAc,EAAE;YAC1B,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,EAAC;YAC7C,MAAM,EAAE,MAAM;SACf,CAAC,CACH,CAAA;QACD,MAAM,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;QACtC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,SAAS,KAAK,CAAC,EAAE,IAAI,YAAY,IAAI,CAAC,CAAC,CAAA;QAC3G,OAAO,KAAK,CAAA;IACd,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
2
+ export default class StageDelete extends AgentiaCommand {
3
+ static args: {
4
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ static flags: {
9
+ yes: import("@oclif/core/interfaces").BooleanFlag<boolean>;
10
+ };
11
+ run(): Promise<{
12
+ id: string;
13
+ }>;
14
+ }
@@ -0,0 +1,28 @@
1
+ import { confirm } from '@inquirer/prompts';
2
+ import { Args, Flags } from '@oclif/core';
3
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
4
+ import { CicdGateway } from '../../../lib/cicd-gateway.js';
5
+ import { stageEndpoint } from '../../../lib/stage-types.js';
6
+ export default class StageDelete extends AgentiaCommand {
7
+ static args = { id: Args.string({ description: 'Stage ID', required: true }) };
8
+ static description = 'Delete a Copado stage';
9
+ static examples = ['<%= config.bin %> <%= command.id %> <stage-id>', '<%= config.bin %> <%= command.id %> <stage-id> --yes --json'];
10
+ static flags = {
11
+ yes: Flags.boolean({ char: 'y', default: false, description: 'Confirm deletion without prompting' }),
12
+ };
13
+ async run() {
14
+ const { args, flags } = await this.parse(StageDelete);
15
+ if (!flags.yes) {
16
+ if (this.jsonEnabled() || !process.stdin.isTTY) {
17
+ this.error('Stage deletion requires confirmation. Pass --yes for headless or JSON execution.', { exit: 2 });
18
+ }
19
+ if (!(await confirm({ default: false, message: `Delete stage ${args.id}?` }))) {
20
+ this.error('Stage deletion canceled.', { exit: 1 });
21
+ }
22
+ }
23
+ await this.withSpinner('Deleting stage', () => CicdGateway.call({ endpoint: stageEndpoint(args.id), method: 'DELETE' }));
24
+ this.display(() => this.log(`Deleted stage (ID: ${args.id}).`));
25
+ return { id: args.id };
26
+ }
27
+ }
28
+ //# sourceMappingURL=delete.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.js","sourceRoot":"","sources":["../../../../src/commands/cicd/stage/delete.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAC,IAAI,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AAEvC,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAC,aAAa,EAAC,MAAM,6BAA6B,CAAA;AAEzD,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,cAAc;IACrD,MAAM,CAAU,IAAI,GAAG,EAAC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,EAAC,CAAA;IACnF,MAAM,CAAU,WAAW,GAAG,uBAAuB,CAAA;IACrD,MAAM,CAAU,QAAQ,GAAG,CAAC,gDAAgD,EAAE,6DAA6D,CAAC,CAAA;IAC5I,MAAM,CAAU,KAAK,GAAG;QACtB,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,EAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,oCAAoC,EAAC,CAAC;KACnG,CAAA;IAEM,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QACnD,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YACf,IAAI,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;gBAC/C,IAAI,CAAC,KAAK,CAAC,kFAAkF,EAAE,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAA;YAC3G,CAAC;YAED,IACE,CAAC,CAAC,MAAM,OAAO,CAAC,EAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,gBAAgB,IAAI,CAAC,EAAE,GAAG,EAAC,CAAC,CAAC,EACvE,CAAC;gBACD,IAAI,CAAC,KAAK,CAAC,0BAA0B,EAAE,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAA;YACnD,CAAC;QACH,CAAC;QAED,MAAM,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,GAAG,EAAE,CAC5C,WAAW,CAAC,IAAI,CAAO,EAAC,QAAQ,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAC,CAAC,CAC7E,CAAA;QACD,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,sBAAsB,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAA;QAC/D,OAAO,EAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAC,CAAA;IACtB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
2
+ import { type Stage } from '../../../lib/stage-types.js';
3
+ export default class StageGet extends AgentiaCommand {
4
+ static args: {
5
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static description: string;
8
+ static examples: string[];
9
+ run(): Promise<Stage>;
10
+ }
@@ -0,0 +1,17 @@
1
+ import { Args } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
3
+ import { CicdGateway } from '../../../lib/cicd-gateway.js';
4
+ import { formatStageDetail, normalizeStage, stageEndpoint } from '../../../lib/stage-types.js';
5
+ export default class StageGet extends AgentiaCommand {
6
+ static args = { id: Args.string({ description: 'Stage ID', required: true }) };
7
+ static description = 'Get a Copado stage';
8
+ static examples = ['<%= config.bin %> <%= command.id %> <stage-id>', '<%= config.bin %> <%= command.id %> <stage-id> --json'];
9
+ async run() {
10
+ const { args } = await this.parse(StageGet);
11
+ const response = await this.withSpinner('Fetching stage', () => CicdGateway.call({ endpoint: stageEndpoint(args.id), method: 'GET' }));
12
+ const stage = normalizeStage(response);
13
+ this.display(() => this.log(formatStageDetail(stage)));
14
+ return stage;
15
+ }
16
+ }
17
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../src/commands/cicd/stage/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAC,iBAAiB,EAAE,cAAc,EAAc,aAAa,EAAqB,MAAM,6BAA6B,CAAA;AAE5H,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,cAAc;IAClD,MAAM,CAAU,IAAI,GAAG,EAAC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,EAAC,CAAA;IACnF,MAAM,CAAU,WAAW,GAAG,oBAAoB,CAAA;IAClD,MAAM,CAAU,QAAQ,GAAG,CAAC,gDAAgD,EAAE,uDAAuD,CAAC,CAAA;IAE/H,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAA;QACzC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,GAAG,EAAE,CAC7D,WAAW,CAAC,IAAI,CAAwB,EAAC,QAAQ,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAC,CAAC,CAC3F,CAAA;QACD,MAAM,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;QACtC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QACtD,OAAO,KAAK,CAAA;IACd,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
2
+ import { type PaginatedListResult } from '../../../lib/list-pagination.js';
3
+ import { type Stage } from '../../../lib/stage-types.js';
4
+ export default class StageList extends AgentiaCommand {
5
+ static description: string;
6
+ static examples: string[];
7
+ static flags: {
8
+ readonly cursor: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
9
+ readonly 'page-size': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
+ };
11
+ run(): Promise<PaginatedListResult<Stage>>;
12
+ }
@@ -0,0 +1,27 @@
1
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
2
+ import { CicdGateway } from '../../../lib/cicd-gateway.js';
3
+ import { displayListPagination, listPaginationFlags } from '../../../lib/list-pagination.js';
4
+ import { formatStageTable, normalizeStagesListPage, stagesEndpoint } from '../../../lib/stage-types.js';
5
+ export default class StageList extends AgentiaCommand {
6
+ static description = 'List Copado stages';
7
+ static examples = ['<%= config.bin %> <%= command.id %>', '<%= config.bin %> <%= command.id %> --json'];
8
+ static flags = listPaginationFlags;
9
+ async run() {
10
+ const { flags } = await this.parse(StageList);
11
+ const response = await this.withSpinner('Fetching stages', () => CicdGateway.call({
12
+ endpoint: stagesEndpoint({ cursor: flags.cursor, pageSize: flags['page-size'] }),
13
+ method: 'GET',
14
+ }));
15
+ const page = normalizeStagesListPage(response);
16
+ this.display(() => {
17
+ if (page.data.length === 0) {
18
+ this.log('No stages found.');
19
+ return;
20
+ }
21
+ this.log(formatStageTable(page.data));
22
+ displayListPagination(this.log.bind(this), page);
23
+ });
24
+ return page;
25
+ }
26
+ }
27
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/cicd/stage/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAC,qBAAqB,EAAE,mBAAmB,EAA2B,MAAM,iCAAiC,CAAA;AACpH,OAAO,EAAC,gBAAgB,EAAE,uBAAuB,EAAsC,cAAc,EAAC,MAAM,6BAA6B,CAAA;AAEzI,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,cAAc;IACnD,MAAM,CAAU,WAAW,GAAG,oBAAoB,CAAA;IAClD,MAAM,CAAU,QAAQ,GAAG,CAAC,qCAAqC,EAAE,4CAA4C,CAAC,CAAA;IAChH,MAAM,CAAU,KAAK,GAAG,mBAAmB,CAAA;IAEpC,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;QAC3C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,iBAAiB,EAAE,GAAG,EAAE,CAC9D,WAAW,CAAC,IAAI,CAAoB;YAClC,QAAQ,EAAE,cAAc,CAAC,EAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,EAAC,CAAC;YAC9E,MAAM,EAAE,KAAK;SACd,CAAC,CACH,CAAA;QACD,MAAM,IAAI,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAA;QAE9C,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC3B,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;gBAC5B,OAAM;YACR,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;YACrC,qBAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;QAClD,CAAC,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
2
+ export default class StageOpen extends AgentiaCommand {
3
+ static args: {
4
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
5
+ };
6
+ static description: string;
7
+ static examples: string[];
8
+ run(): Promise<{
9
+ provider: string;
10
+ url: string;
11
+ }>;
12
+ }
@@ -0,0 +1,16 @@
1
+ import { Args } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
3
+ import { openNavigationTarget } from '../../../lib/navigation-open.js';
4
+ import { resolveNavigationTarget } from '../../../lib/navigation.js';
5
+ export default class StageOpen extends AgentiaCommand {
6
+ static args = { id: Args.string({ description: 'Stage ID', required: true }) };
7
+ static description = 'Open a Copado stage in the browser';
8
+ static examples = ['<%= config.bin %> <%= command.id %> <stage-id>', '<%= config.bin %> <%= command.id %> <stage-id> --json'];
9
+ async run() {
10
+ const { args } = await this.parse(StageOpen);
11
+ const target = await this.withSpinner('Resolving navigation URL', () => resolveNavigationTarget({ id: args.id, resourceType: 'stage' }));
12
+ await openNavigationTarget(target, { jsonEnabled: this.jsonEnabled(), log: this.log.bind(this) });
13
+ return target;
14
+ }
15
+ }
16
+ //# sourceMappingURL=open.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open.js","sourceRoot":"","sources":["../../../../src/commands/cicd/stage/open.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAA;AACpE,OAAO,EAAC,uBAAuB,EAAC,MAAM,4BAA4B,CAAA;AAElE,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,cAAc;IACnD,MAAM,CAAU,IAAI,GAAG,EAAC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,EAAC,CAAA;IACnF,MAAM,CAAU,WAAW,GAAG,oCAAoC,CAAA;IAClE,MAAM,CAAU,QAAQ,GAAG,CAAC,gDAAgD,EAAE,uDAAuD,CAAC,CAAA;IAE/H,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;QAC1C,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,0BAA0B,EAAE,GAAG,EAAE,CACrE,uBAAuB,CAAC,EAAC,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,YAAY,EAAE,OAAO,EAAC,CAAC,CAC9D,CAAA;QACD,MAAM,oBAAoB,CAAC,MAAM,EAAE,EAAC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAC,CAAC,CAAA;QAC/F,OAAO,MAAM,CAAA;IACf,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
2
+ import { type Stage } from '../../../lib/stage-types.js';
3
+ export default class StageUpdate extends AgentiaCommand {
4
+ static args: {
5
+ id: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static description: string;
8
+ static examples: string[];
9
+ static flags: {
10
+ readonly 'meta-stage': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
+ readonly name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
12
+ };
13
+ run(): Promise<Stage>;
14
+ }
@@ -0,0 +1,30 @@
1
+ import { Args } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
3
+ import { CicdGateway } from '../../../lib/cicd-gateway.js';
4
+ import { buildStageMutationPayload, stageUpdateFlags, validateStagePayload } from '../../../lib/stage-flags.js';
5
+ import { normalizeStage, stageEndpoint } from '../../../lib/stage-types.js';
6
+ export default class StageUpdate extends AgentiaCommand {
7
+ static args = { id: Args.string({ description: 'Stage ID', required: true }) };
8
+ static description = 'Update a Copado stage';
9
+ static examples = ['<%= config.bin %> <%= command.id %> <stage-id> --name QA', '<%= config.bin %> <%= command.id %> <stage-id> --meta-stage Test'];
10
+ static flags = stageUpdateFlags;
11
+ async run() {
12
+ const { args, flags } = await this.parse(StageUpdate);
13
+ const payload = buildStageMutationPayload(flags);
14
+ if (Object.keys(payload).length === 0)
15
+ this.error('Must provide at least one flag to update.', { exit: 2 });
16
+ const validationError = validateStagePayload(payload);
17
+ if (validationError !== undefined)
18
+ this.error(validationError, { exit: 2 });
19
+ const response = await this.withSpinner('Updating stage', () => CicdGateway.call({
20
+ body: payload,
21
+ endpoint: stageEndpoint(args.id),
22
+ headers: { 'Content-Type': 'application/json' },
23
+ method: 'PATCH',
24
+ }));
25
+ const stage = normalizeStage(response);
26
+ this.display(() => this.log(`Updated stage ${stage.name ?? args.id} (ID: ${stage.id ?? args.id}).`));
27
+ return stage;
28
+ }
29
+ }
30
+ //# sourceMappingURL=update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/commands/cicd/stage/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAC,yBAAyB,EAAE,gBAAgB,EAAE,oBAAoB,EAAC,MAAM,6BAA6B,CAAA;AAC7G,OAAO,EAAC,cAAc,EAAc,aAAa,EAAqB,MAAM,6BAA6B,CAAA;AAEzG,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,cAAc;IACrD,MAAM,CAAU,IAAI,GAAG,EAAC,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,EAAC,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,EAAC,CAAA;IACnF,MAAM,CAAU,WAAW,GAAG,uBAAuB,CAAA;IACrD,MAAM,CAAU,QAAQ,GAAG,CAAC,0DAA0D,EAAE,kEAAkE,CAAC,CAAA;IAC3J,MAAM,CAAU,KAAK,GAAG,gBAAgB,CAAA;IAEjC,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QACnD,MAAM,OAAO,GAAG,yBAAyB,CAAC,KAAK,CAAC,CAAA;QAChD,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC;YAAE,IAAI,CAAC,KAAK,CAAC,2CAA2C,EAAE,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAA;QACzG,MAAM,eAAe,GAAG,oBAAoB,CAAC,OAAO,CAAC,CAAA;QACrD,IAAI,eAAe,KAAK,SAAS;YAAE,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAA;QAEzE,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,GAAG,EAAE,CAC7D,WAAW,CAAC,IAAI,CAAwB;YACtC,IAAI,EAAE,OAAO;YACb,QAAQ,EAAE,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;YAChC,OAAO,EAAE,EAAC,cAAc,EAAE,kBAAkB,EAAC;YAC7C,MAAM,EAAE,OAAO;SAChB,CAAC,CACH,CAAA;QACD,MAAM,KAAK,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;QACtC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,iBAAiB,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,SAAS,KAAK,CAAC,EAAE,IAAI,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAA;QACpG,OAAO,KAAK,CAAA;IACd,CAAC"}
@@ -7,13 +7,14 @@ import { type JobListFilters } from '../job-types.js';
7
7
  import { type ComparisonMode, type ContentSource, type DependencyResult, type IndexSearchResult, type IndexSource, type MetadataContentResult, type ModuleType, type OrderDirection, type PlatformExperience, type RetrieveMode } from '../metadata-common.js';
8
8
  import { type IndexRefreshResult, type RefreshDeletedMetadataIndexResult } from '../metadata-refresh.js';
9
9
  import { NAVIGATION_RESOURCE_TYPES } from '../navigation.js';
10
- import { type PipelineConnection, type PipelineDescribe, type PipelineListFilters } from '../pipeline-types.js';
10
+ import { type Pipeline, type PipelineConnection, type PipelineListFilters } from '../pipeline-types.js';
11
11
  import { type ProjectDefaultScope } from '../project-defaults.js';
12
12
  import { type Project, type ProjectListFilters } from '../project-types.js';
13
13
  import { type PromotionConflict, type PromotionConflictMode, type PromotionConflictResolutionResult, type PromotionConflictUndoResult } from '../promotion-conflicts.js';
14
14
  import { type PromotionOperation } from '../promotion-run.js';
15
15
  import { type PromotionDetail, type PromotionListFilters } from '../promotion-types.js';
16
16
  import { type GitRepository, type RepositoryListFilters, type RepositoryValidateResult } from '../repository-types.js';
17
+ import { type PipelineStageConnection, type Stage } from '../stage-types.js';
17
18
  import { type User } from '../user-types.js';
18
19
  import { type HeadlessWorkStatusResult } from '../work-types.js';
19
20
  type EnvironmentCreateArgs = {
@@ -111,6 +112,76 @@ type RepositoryCreateArgs = RepositoryMutationArgs & {
111
112
  type RepositoryUpdateArgs = RepositoryMutationArgs & {
112
113
  id: string;
113
114
  };
115
+ type PipelineMutationArgs = {
116
+ active?: boolean;
117
+ blockCommits?: boolean;
118
+ calculateBasedOn?: string;
119
+ enableSmartConflictResolution?: boolean;
120
+ gitRepositoryId?: string;
121
+ id?: string;
122
+ mainBranch?: string;
123
+ name?: string;
124
+ platform?: string;
125
+ };
126
+ type PipelineCreateArgs = PipelineMutationArgs & {
127
+ name: string;
128
+ };
129
+ type PipelineUpdateArgs = PipelineMutationArgs & {
130
+ id: string;
131
+ };
132
+ type StageMutationArgs = {
133
+ metaStage?: string;
134
+ name?: string;
135
+ };
136
+ type StageCreateArgs = StageMutationArgs & {
137
+ name: string;
138
+ };
139
+ type StageUpdateArgs = StageMutationArgs & {
140
+ id: string;
141
+ };
142
+ type StageDeleteArgs = {
143
+ id: string;
144
+ };
145
+ type PipelineStageConnectionCreateArgs = {
146
+ nextPipelineStageConnectionId?: string;
147
+ pipelineId: string;
148
+ stageId: string;
149
+ };
150
+ type PipelineStageConnectionListArgs = {
151
+ pipelineId: string;
152
+ };
153
+ type PipelineStageConnectionUpdateArgs = {
154
+ connectionId: string;
155
+ nextPipelineStageConnectionId?: string;
156
+ pipelineId: string;
157
+ stageId?: string;
158
+ };
159
+ type PipelineStageConnectionDeleteArgs = {
160
+ connectionId: string;
161
+ pipelineId: string;
162
+ };
163
+ type PipelineConnectionMutationArgs = {
164
+ branch?: string;
165
+ destinationBranch?: string;
166
+ destinationEnvironmentId?: string;
167
+ id?: string;
168
+ sourceEnvironmentId?: string;
169
+ stageConnectionId?: string;
170
+ syncMergeState?: string;
171
+ syncPullState?: string;
172
+ };
173
+ type PipelineConnectionCreateArgs = PipelineConnectionMutationArgs & {
174
+ connections?: PipelineConnectionMutationArgs[];
175
+ pipelineId: string;
176
+ };
177
+ type PipelineConnectionUpdateArgs = {
178
+ connections: PipelineConnectionMutationArgs[];
179
+ pipelineId: string;
180
+ };
181
+ type PipelineConnectionDeleteArgs = {
182
+ connectionIds: string[];
183
+ pipelineId: string;
184
+ };
114
185
  type MetadataListArgs = {
115
186
  avoidSourceTracking?: boolean;
116
187
  changeDateFrom?: string;
@@ -234,13 +305,60 @@ declare function pipelineList(args?: PipelineListFilters): Promise<Record<string
234
305
  declare function pipelineGet(args: {
235
306
  id: string;
236
307
  }): Promise<{
237
- pipeline: PipelineDescribe;
308
+ pipeline: import("../pipeline-types.js").PipelineDescribe;
238
309
  }>;
239
310
  declare function pipelineConnectionList(args: {
240
311
  pipelineId?: string;
241
312
  }): Promise<{
242
313
  connections: PipelineConnection[];
243
314
  }>;
315
+ declare function pipelineCreate(args: PipelineCreateArgs): Promise<{
316
+ pipeline: Pipeline;
317
+ }>;
318
+ declare function pipelineUpdate(args: PipelineUpdateArgs): Promise<{
319
+ pipeline: Pipeline;
320
+ }>;
321
+ declare function pipelineConnectionCreate(args: PipelineConnectionCreateArgs): Promise<{
322
+ connections: PipelineConnection[];
323
+ }>;
324
+ declare function pipelineConnectionUpdate(args: PipelineConnectionUpdateArgs): Promise<{
325
+ connections: PipelineConnection[];
326
+ }>;
327
+ declare function pipelineConnectionDelete(args: PipelineConnectionDeleteArgs): Promise<{
328
+ connectionIds: string[];
329
+ pipelineId: string;
330
+ }>;
331
+ declare function stageList(args?: {
332
+ cursor?: string;
333
+ pageSize?: number;
334
+ }): Promise<Record<string, unknown>>;
335
+ declare function stageGet(args: {
336
+ id: string;
337
+ }): Promise<{
338
+ stage: Stage;
339
+ }>;
340
+ declare function stageCreate(args: StageCreateArgs): Promise<{
341
+ stage: Stage;
342
+ }>;
343
+ declare function stageUpdate(args: StageUpdateArgs): Promise<{
344
+ stage: Stage;
345
+ }>;
346
+ declare function stageDelete(args: StageDeleteArgs): Promise<{
347
+ id: string;
348
+ }>;
349
+ declare function pipelineStageConnectionCreate(args: PipelineStageConnectionCreateArgs): Promise<{
350
+ connection: PipelineStageConnection;
351
+ }>;
352
+ declare function pipelineStageConnectionList(args: PipelineStageConnectionListArgs): Promise<{
353
+ connections: PipelineStageConnection[];
354
+ }>;
355
+ declare function pipelineStageConnectionUpdate(args: PipelineStageConnectionUpdateArgs): Promise<{
356
+ connection: PipelineStageConnection;
357
+ }>;
358
+ declare function pipelineStageConnectionDelete(args: PipelineStageConnectionDeleteArgs): Promise<{
359
+ connectionId: string;
360
+ pipelineId: string;
361
+ }>;
244
362
  declare function projectList(args?: ProjectListFilters): Promise<Record<string, unknown>>;
245
363
  declare function repositoryList(args?: RepositoryListFilters): Promise<Record<string, unknown>>;
246
364
  declare function repositoryGet(args: {
@@ -1085,9 +1203,18 @@ export declare const agentiaMcpToolHandlers: {
1085
1203
  metadataRefreshRun: typeof metadataRefreshRun;
1086
1204
  metadataRefreshStatus: typeof metadataRefreshStatus;
1087
1205
  navigationResolve: typeof navigationResolve;
1206
+ pipelineConnectionCreate: typeof pipelineConnectionCreate;
1207
+ pipelineConnectionDelete: typeof pipelineConnectionDelete;
1088
1208
  pipelineConnectionList: typeof pipelineConnectionList;
1209
+ pipelineConnectionUpdate: typeof pipelineConnectionUpdate;
1210
+ pipelineCreate: typeof pipelineCreate;
1089
1211
  pipelineGet: typeof pipelineGet;
1090
1212
  pipelineList: typeof pipelineList;
1213
+ pipelineStageConnectionCreate: typeof pipelineStageConnectionCreate;
1214
+ pipelineStageConnectionDelete: typeof pipelineStageConnectionDelete;
1215
+ pipelineStageConnectionList: typeof pipelineStageConnectionList;
1216
+ pipelineStageConnectionUpdate: typeof pipelineStageConnectionUpdate;
1217
+ pipelineUpdate: typeof pipelineUpdate;
1091
1218
  projectDefaultGet: typeof projectDefaultGet;
1092
1219
  projectDefaultSet: typeof projectDefaultSet;
1093
1220
  projectDefaultUnset: typeof projectDefaultUnset;
@@ -1107,6 +1234,11 @@ export declare const agentiaMcpToolHandlers: {
1107
1234
  repositoryReset: typeof repositoryReset;
1108
1235
  repositoryUpdate: typeof repositoryUpdate;
1109
1236
  repositoryValidate: typeof repositoryValidate;
1237
+ stageCreate: typeof stageCreate;
1238
+ stageDelete: typeof stageDelete;
1239
+ stageGet: typeof stageGet;
1240
+ stageList: typeof stageList;
1241
+ stageUpdate: typeof stageUpdate;
1110
1242
  userGet: typeof userGet;
1111
1243
  workStatus: typeof workStatus;
1112
1244
  deploymentStepCreate: (args: {