@copado/agentia-cli 0.84.0-alpha.0 → 0.86.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 +778 -161
- 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/commands/setup/skills/create.d.ts +15 -0
- package/dist/commands/setup/skills/create.js +64 -0
- package/dist/commands/setup/skills/create.js.map +1 -0
- package/dist/commands/setup/skills/update.d.ts +15 -0
- package/dist/commands/setup/skills/update.js +64 -0
- package/dist/commands/setup/skills/update.js.map +1 -0
- 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/setup-skills.d.ts +67 -0
- package/dist/lib/setup-skills.js +251 -0
- package/dist/lib/setup-skills.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 +2017 -740
- package/package.json +9 -2
- package/templates/skills/agentia-ai/SKILL.md +34 -0
- package/templates/skills/agentia-ai/references/ai-agents.md +70 -0
- package/templates/skills/agentia-cicd/SKILL.md +41 -0
- package/templates/skills/agentia-cicd/references/data.md +65 -0
- package/templates/skills/agentia-cicd/references/environments-and-credentials.md +55 -0
- package/templates/skills/agentia-cicd/references/jobs.md +42 -0
- package/templates/skills/agentia-cicd/references/pipelines.md +63 -0
- package/templates/skills/agentia-cicd/references/promotions.md +58 -0
- package/templates/skills/agentia-cicd/references/work.md +84 -0
- package/templates/skills/agentia-testing/SKILL.md +34 -0
- package/templates/skills/agentia-testing/references/tests.md +65 -0
|
@@ -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,+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AC,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,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AAC,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,CAA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
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,EA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iaCommand } 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
|
+
//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AAC,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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
|
+
import { type SetupSkillsResult } from '../../../lib/setup-skills.js';
|
|
3
|
+
export default class SetupSkillsCreate extends AgentiaCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
ai: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
cicd: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
'no-prompt': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
target: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
testing: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<SetupSkillsResult>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
+
import { createInquirerSetupPrompts, isPromptCanceled } from '../../../lib/setup-prompts.js';
|
|
4
|
+
import { resolveSelectedSkillPacks, runSetupSkills, SETUP_SKILL_TARGETS, } from '../../../lib/setup-skills.js';
|
|
5
|
+
export default class SetupSkillsCreate extends AgentiaCommand {
|
|
6
|
+
static description = 'Create portable Markdown-only Agentia CLI skills in this project without overwriting managed files';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> <%= command.id %>',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --cicd --target agents --no-prompt',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --testing --ai --target cursor --no-prompt',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --json',
|
|
12
|
+
];
|
|
13
|
+
static flags = {
|
|
14
|
+
ai: Flags.boolean({
|
|
15
|
+
description: 'Create the Copado AI agent skill pack',
|
|
16
|
+
}),
|
|
17
|
+
cicd: Flags.boolean({
|
|
18
|
+
description: 'Create the Copado CICD skill pack',
|
|
19
|
+
}),
|
|
20
|
+
force: Flags.boolean({
|
|
21
|
+
default: false,
|
|
22
|
+
description: 'Replace conflicting unmanaged Agentia skill files',
|
|
23
|
+
}),
|
|
24
|
+
'no-prompt': Flags.boolean({
|
|
25
|
+
char: 'n',
|
|
26
|
+
default: false,
|
|
27
|
+
description: 'Skip interactive prompts; defaults the target to .agents/skills when --target is omitted',
|
|
28
|
+
}),
|
|
29
|
+
target: Flags.string({
|
|
30
|
+
description: 'Project skill root to write',
|
|
31
|
+
options: [...SETUP_SKILL_TARGETS],
|
|
32
|
+
}),
|
|
33
|
+
testing: Flags.boolean({
|
|
34
|
+
description: 'Create the Copado Robotic Testing skill pack',
|
|
35
|
+
}),
|
|
36
|
+
};
|
|
37
|
+
async run() {
|
|
38
|
+
const { flags } = await this.parse(SetupSkillsCreate);
|
|
39
|
+
const noPrompt = flags['no-prompt'] || this.jsonEnabled();
|
|
40
|
+
try {
|
|
41
|
+
return await runSetupSkills({
|
|
42
|
+
force: flags.force,
|
|
43
|
+
log: (message) => {
|
|
44
|
+
this.display(() => {
|
|
45
|
+
this.log(message);
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
mode: 'create',
|
|
49
|
+
noPrompt,
|
|
50
|
+
packs: resolveSelectedSkillPacks(flags),
|
|
51
|
+
target: flags.target,
|
|
52
|
+
}, {
|
|
53
|
+
prompts: noPrompt ? undefined : createInquirerSetupPrompts(),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
if (isPromptCanceled(error)) {
|
|
58
|
+
this.error('Setup skills create cancelled.', { exit: 1 });
|
|
59
|
+
}
|
|
60
|
+
this.error(error.message, { exit: 1 });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../../src/commands/setup/skills/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,0BAA0B,EAAE,gBAAgB,EAAC,MAAM,+BAA+B,CAAA;AAC1F,OAAO,EACL,yBAAyB,EACzB,cAAc,EACd,mBAAmB,GAGpB,MAAM,8BAA8B,CAAA;AAErC,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,cAAc;IAC3D,MAAM,CAAU,WAAW,GACzB,oGAAoG,CAAA;IACtG,MAAM,CAAU,QAAQ,GAAG;QACzB,qCAAqC;QACrC,wEAAwE;QACxE,gFAAgF;QAChF,4CAA4C;KAC7C,CAAA;IACD,MAAM,CAAU,KAAK,GAAG;QACtB,EAA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C,CAAC,CAAC,0BAA0B,EAAE;aAC7D,CACF,CAAA;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC5B,IAAI,CAAC,KAAK,CAAC,gCAAgC,EAAE,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAA;YACzD,CAAC;YAED,IAAI,CAAC,KAAK,CAAE,KAAe,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,CAAC,EAAC,CAAC,CAAA;QACjD,CAAC;IACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
|
+
import { type SetupSkillsResult } from '../../../lib/setup-skills.js';
|
|
3
|
+
export default class SetupSkillsUpdate extends AgentiaCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
ai: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
cicd: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
'no-prompt': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
+
target: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
testing: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<SetupSkillsResult>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
+
import { createInquirerSetupPrompts, isPromptCanceled } from '../../../lib/setup-prompts.js';
|
|
4
|
+
import { resolveSelectedSkillPacks, runSetupSkills, SETUP_SKILL_TARGETS, } from '../../../lib/setup-skills.js';
|
|
5
|
+
export default class SetupSkillsUpdate extends AgentiaCommand {
|
|
6
|
+
static description = 'Update Agentia-managed Markdown skill files and restore missing files in this project';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> <%= command.id %>',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --ai --target cursor --no-prompt',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --cicd --testing --target agents --no-prompt',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --force --json',
|
|
12
|
+
];
|
|
13
|
+
static flags = {
|
|
14
|
+
ai: Flags.boolean({
|
|
15
|
+
description: 'Update the Copado AI agent skill pack',
|
|
16
|
+
}),
|
|
17
|
+
cicd: Flags.boolean({
|
|
18
|
+
description: 'Update the Copado CICD skill pack',
|
|
19
|
+
}),
|
|
20
|
+
force: Flags.boolean({
|
|
21
|
+
default: false,
|
|
22
|
+
description: 'Replace conflicting unmanaged Agentia skill files',
|
|
23
|
+
}),
|
|
24
|
+
'no-prompt': Flags.boolean({
|
|
25
|
+
char: 'n',
|
|
26
|
+
default: false,
|
|
27
|
+
description: 'Skip interactive prompts; defaults the target to .agents/skills when --target is omitted',
|
|
28
|
+
}),
|
|
29
|
+
target: Flags.string({
|
|
30
|
+
description: 'Project skill root to write',
|
|
31
|
+
options: [...SETUP_SKILL_TARGETS],
|
|
32
|
+
}),
|
|
33
|
+
testing: Flags.boolean({
|
|
34
|
+
description: 'Update the Copado Robotic Testing skill pack',
|
|
35
|
+
}),
|
|
36
|
+
};
|
|
37
|
+
async run() {
|
|
38
|
+
const { flags } = await this.parse(SetupSkillsUpdate);
|
|
39
|
+
const noPrompt = flags['no-prompt'] || this.jsonEnabled();
|
|
40
|
+
try {
|
|
41
|
+
return await runSetupSkills({
|
|
42
|
+
force: flags.force,
|
|
43
|
+
log: (message) => {
|
|
44
|
+
this.display(() => {
|
|
45
|
+
this.log(message);
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
mode: 'update',
|
|
49
|
+
noPrompt,
|
|
50
|
+
packs: resolveSelectedSkillPacks(flags),
|
|
51
|
+
target: flags.target,
|
|
52
|
+
}, {
|
|
53
|
+
prompts: noPrompt ? undefined : createInquirerSetupPrompts(),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
if (isPromptCanceled(error)) {
|
|
58
|
+
this.error('Setup skills update cancelled.', { exit: 1 });
|
|
59
|
+
}
|
|
60
|
+
this.error(error.message, { exit: 1 });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../../src/commands/setup/skills/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,0BAA0B,EAAE,gBAAgB,EAAC,MAAM,+BAA+B,CAAA;AAC1F,OAAO,EACL,yBAAyB,EACzB,cAAc,EACd,mBAAmB,GAGpB,MAAM,8BAA8B,CAAA;AAErC,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,cAAc;IAC3D,MAAM,CAAU,WAAW,GACzB,uFAAuF,CAAA;IACzF,MAAM,CAAU,QAAQ,GAAG;QACzB,qCAAqC;QACrC,sEAAsE;QACtE,kFAAkF;QAClF,oDAAoD;KACrD,CAAA;IACD,MAAM,CAAU,KAAK,GAAG;QACtB,EAAE,EAAE,KAAK,CAAC,OAAO,CAAC;YAChB,WAAW,EAAE,uCAAuC;SACrD,CAAC;QACF,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC;YAClB,WAAW,EAAE,mCAAmC;SACjD,CAAC;QACF,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;YACnB,OAAO,EAAE,KAAK;YACd,WAAW,EAAE,mDAAmD;SACjE,CAAC;QACF,WAAW,EAAE,KAAK,CAAC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