@copado/agentia-cli 1.0.0-beta.6 → 1.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +311 -324
- package/dist/commands/adv/component/add.js +1 -1
- package/dist/commands/adv/component/remove.js +1 -1
- package/dist/commands/adv/component/types.js +1 -1
- package/dist/commands/adv/deployment/deploy.js +4 -1
- package/dist/commands/adv/deployment/list.js +1 -1
- package/dist/commands/adv/deployment/options.js +1 -1
- package/dist/commands/adv/deployment/quick-deploy.js +5 -2
- package/dist/commands/adv/deployment/validate.js +4 -1
- package/dist/commands/adv/job/list.js +3 -3
- package/dist/commands/adv/job/wait.js +7 -3
- package/dist/commands/cicd/environment/get.js +3 -6
- package/dist/commands/cicd/environment/list.js +2 -7
- package/dist/commands/cicd/job/get.js +3 -7
- package/dist/commands/cicd/job/list.js +3 -7
- package/dist/commands/cicd/pipeline/get.js +3 -7
- package/dist/commands/cicd/pipeline/list.js +3 -7
- package/dist/commands/cicd/project/get.js +3 -7
- package/dist/commands/cicd/project/list.js +3 -7
- package/dist/commands/cicd/promotion/get.js +3 -7
- package/dist/commands/cicd/promotion/list.js +3 -7
- package/dist/commands/cicd/stage/list.js +5 -6
- package/dist/commands/cicd/user/get.js +3 -7
- package/dist/commands/cicd/work/get.js +2 -2
- package/dist/commands/cicd/work/list.js +3 -7
- package/dist/commands/cicd/work/promote.js +1 -0
- package/dist/commands/plugins/install.js +76 -0
- package/dist/lib/adv-operations.js +4 -1
- package/dist/lib/agentia-command.js +38 -2
- package/dist/lib/ai-config.js +3 -1
- package/dist/lib/auth-profile.js +2 -1
- package/dist/lib/environment-get.js +4 -0
- package/dist/lib/job-get.js +4 -0
- package/dist/lib/mcp/adv-tools.js +12 -6
- package/dist/lib/mcp/tools.js +25 -67
- package/dist/lib/mcp/work-tools.js +4 -8
- package/dist/lib/pipeline-get.js +4 -0
- package/dist/lib/plugin-host/ai.js +5 -0
- package/dist/lib/plugin-host/environment.js +4 -0
- package/dist/lib/plugin-host/event-log.js +2 -1
- package/dist/lib/plugin-host/input.js +7 -0
- package/dist/lib/plugin-host/job.js +4 -0
- package/dist/lib/plugin-host/pipeline.js +4 -0
- package/dist/lib/plugin-host/project.js +5 -0
- package/dist/lib/plugin-host/projection-utils.js +6 -1
- package/dist/lib/plugin-host/promotion.js +4 -0
- package/dist/lib/plugin-host/stage.js +4 -0
- package/dist/lib/plugin-host/user.js +4 -0
- package/dist/lib/plugin-host/workspace.js +3 -0
- package/dist/lib/plugin-trust/catalog.js +6 -0
- package/dist/lib/plugin-trust/gate.js +14 -0
- package/dist/lib/plugin-trust/http.js +5 -0
- package/dist/lib/plugin-trust/policy.js +3 -0
- package/dist/lib/project-get.js +4 -0
- package/dist/lib/promotion-get.js +4 -0
- package/dist/lib/runtime.js +1 -1
- package/dist/lib/stage-list.js +3 -0
- package/dist/lib/testing-gateway.js +2 -1
- package/dist/lib/user-get.js +3 -0
- package/dist/lib/work-get.js +3 -2
- package/oclif.manifest.json +340 -20
- package/package.json +1 -1
- package/templates/skills/agentia-adv/SKILL.md +3 -1
- package/templates/skills/agentia-adv/references/pipelines-advanced.md +19 -3
|
@@ -23,7 +23,7 @@ export default class AdvComponentAdd extends AgentiaCommand {
|
|
|
23
23
|
exclusive: ['component', 'json-file'],
|
|
24
24
|
}),
|
|
25
25
|
'json-file': Flags.string({
|
|
26
|
-
description: 'JSON file
|
|
26
|
+
description: 'JSON file containing a bare component array (not a --json envelope); accepts list rows, {type, fullName}, or {nodeType: {name}, fullName}.',
|
|
27
27
|
exclusive: ['component', 'file'],
|
|
28
28
|
}),
|
|
29
29
|
};
|
|
@@ -18,7 +18,7 @@ export default class AdvComponentRemove extends AgentiaCommand {
|
|
|
18
18
|
multiple: true,
|
|
19
19
|
}),
|
|
20
20
|
'json-file': Flags.string({
|
|
21
|
-
description: 'JSON file
|
|
21
|
+
description: 'JSON file containing a bare component array (not a --json envelope); text-file input is not supported.',
|
|
22
22
|
exclusive: ['component'],
|
|
23
23
|
}),
|
|
24
24
|
};
|
|
@@ -2,7 +2,7 @@ import { listAdvComponentTypes } from '../../../lib/adv-operations.js';
|
|
|
2
2
|
import { formatAdvRecord } from '../../../lib/adv-types.js';
|
|
3
3
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
4
4
|
export default class AdvComponentTypes extends AgentiaCommand {
|
|
5
|
-
static description = 'List Pipelines Advanced component type views';
|
|
5
|
+
static description = 'List Pipelines Advanced component type views; a component type can appear in multiple views';
|
|
6
6
|
static examples = [
|
|
7
7
|
'<%= config.bin %> <%= command.id %>',
|
|
8
8
|
'<%= config.bin %> <%= command.id %> --json',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Args } from '@oclif/core';
|
|
2
2
|
import { advWaitFlags, advYesFlag, confirmAdvAction, requiresAdvExplicitYes } from '../../../lib/adv-flags.js';
|
|
3
|
-
import { runAdvDeploymentAction } from '../../../lib/adv-operations.js';
|
|
3
|
+
import { advRunErrorJson, runAdvDeploymentAction } from '../../../lib/adv-operations.js';
|
|
4
4
|
import { formatAdvRecord } from '../../../lib/adv-types.js';
|
|
5
5
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
6
6
|
import { isPromptCanceled } from '../../../lib/setup-prompts.js';
|
|
@@ -42,5 +42,8 @@ export default class AdvDeploymentDeploy extends AgentiaCommand {
|
|
|
42
42
|
this.display(() => this.log(formatAdvRecord(result)));
|
|
43
43
|
return result;
|
|
44
44
|
}
|
|
45
|
+
toErrorJson(error) {
|
|
46
|
+
return advRunErrorJson(super.toErrorJson(error), error);
|
|
47
|
+
}
|
|
45
48
|
}
|
|
46
49
|
//# sourceMappingURL=deploy.js.map
|
|
@@ -3,7 +3,7 @@ import { listAdvDeployments } from '../../../lib/adv-operations.js';
|
|
|
3
3
|
import { formatAdvDeployments } from '../../../lib/adv-types.js';
|
|
4
4
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
5
5
|
export default class AdvDeploymentList extends AgentiaCommand {
|
|
6
|
-
static description = 'List Pipelines Advanced deployments visible to the PAT user';
|
|
6
|
+
static description = 'List up to 500 Pipelines Advanced deployments visible to the PAT user; the API does not support filters';
|
|
7
7
|
static examples = [
|
|
8
8
|
'<%= config.bin %> <%= command.id %>',
|
|
9
9
|
'<%= config.bin %> <%= command.id %> --include-archived',
|
|
@@ -18,7 +18,7 @@ export default class AdvDeploymentOptions extends AgentiaCommand {
|
|
|
18
18
|
exclusive: ['set'],
|
|
19
19
|
}),
|
|
20
20
|
set: Flags.string({
|
|
21
|
-
description: 'Deployment option as name=value;
|
|
21
|
+
description: 'Deployment option as name=value; true, false, null, and any finite JavaScript Number value (including hex and exponent notation) are converted.',
|
|
22
22
|
exclusive: ['file'],
|
|
23
23
|
multiple: true,
|
|
24
24
|
}),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
2
|
import { advWaitFlags, advYesFlag, confirmAdvAction, requiresAdvExplicitYes } from '../../../lib/adv-flags.js';
|
|
3
|
-
import { runAdvDeploymentAction } from '../../../lib/adv-operations.js';
|
|
3
|
+
import { advRunErrorJson, runAdvDeploymentAction } from '../../../lib/adv-operations.js';
|
|
4
4
|
import { formatAdvRecord } from '../../../lib/adv-types.js';
|
|
5
5
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
6
6
|
import { isPromptCanceled } from '../../../lib/setup-prompts.js';
|
|
@@ -18,7 +18,7 @@ export default class AdvDeploymentQuickDeploy extends AgentiaCommand {
|
|
|
18
18
|
...advYesFlag,
|
|
19
19
|
backup: Flags.boolean({
|
|
20
20
|
default: false,
|
|
21
|
-
description: '
|
|
21
|
+
description: 'Run backupThenDeploy instead of a quick deploy; the returned action reflects backupThenDeploy.',
|
|
22
22
|
}),
|
|
23
23
|
};
|
|
24
24
|
async run() {
|
|
@@ -50,5 +50,8 @@ export default class AdvDeploymentQuickDeploy extends AgentiaCommand {
|
|
|
50
50
|
this.display(() => this.log(formatAdvRecord(result)));
|
|
51
51
|
return result;
|
|
52
52
|
}
|
|
53
|
+
toErrorJson(error) {
|
|
54
|
+
return advRunErrorJson(super.toErrorJson(error), error);
|
|
55
|
+
}
|
|
53
56
|
}
|
|
54
57
|
//# sourceMappingURL=quick-deploy.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Args } from '@oclif/core';
|
|
2
2
|
import { advWaitFlags } from '../../../lib/adv-flags.js';
|
|
3
|
-
import { runAdvDeploymentAction } from '../../../lib/adv-operations.js';
|
|
3
|
+
import { advRunErrorJson, runAdvDeploymentAction } from '../../../lib/adv-operations.js';
|
|
4
4
|
import { formatAdvRecord } from '../../../lib/adv-types.js';
|
|
5
5
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
6
6
|
export default class AdvDeploymentValidate extends AgentiaCommand {
|
|
@@ -25,5 +25,8 @@ export default class AdvDeploymentValidate extends AgentiaCommand {
|
|
|
25
25
|
this.display(() => this.log(formatAdvRecord(result)));
|
|
26
26
|
return result;
|
|
27
27
|
}
|
|
28
|
+
toErrorJson(error) {
|
|
29
|
+
return advRunErrorJson(super.toErrorJson(error), error);
|
|
30
|
+
}
|
|
28
31
|
}
|
|
29
32
|
//# sourceMappingURL=validate.js.map
|
|
@@ -6,14 +6,14 @@ export default class AdvJobList extends AgentiaCommand {
|
|
|
6
6
|
static args = {
|
|
7
7
|
'deployment-id': Args.integer({ description: 'Pipelines Advanced deployment ID.', required: true }),
|
|
8
8
|
};
|
|
9
|
-
static description = 'List
|
|
9
|
+
static description = 'List deploy and quick-deploy history for a Pipelines Advanced deployment; validation runs are not included';
|
|
10
10
|
static examples = [
|
|
11
11
|
'<%= config.bin %> <%= command.id %> 1025',
|
|
12
12
|
'<%= config.bin %> <%= command.id %> 1025 --page 1 --page-size 25',
|
|
13
13
|
];
|
|
14
14
|
static flags = {
|
|
15
|
-
page: Flags.integer({ description: 'Page number starting at 0.' }),
|
|
16
|
-
'page-size': Flags.integer({ description: 'Rows per page.' }),
|
|
15
|
+
page: Flags.integer({ description: 'Page number starting at 0 (default: 0).' }),
|
|
16
|
+
'page-size': Flags.integer({ description: 'Rows per page (default: 50; server maximum: 100).' }),
|
|
17
17
|
};
|
|
18
18
|
async run() {
|
|
19
19
|
const { args, flags } = await this.parse(AdvJobList);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
|
-
import { waitForAdvJob } from '../../../lib/adv-operations.js';
|
|
2
|
+
import { advRunErrorJson, assertAdvJobSucceeded, waitForAdvJob } from '../../../lib/adv-operations.js';
|
|
3
3
|
import { formatAdvRecord } from '../../../lib/adv-types.js';
|
|
4
4
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
5
5
|
export default class AdvJobWait extends AgentiaCommand {
|
|
@@ -12,8 +12,8 @@ export default class AdvJobWait extends AgentiaCommand {
|
|
|
12
12
|
'<%= config.bin %> <%= command.id %> 1025 --interval 5 --timeout 1800',
|
|
13
13
|
];
|
|
14
14
|
static flags = {
|
|
15
|
-
interval: Flags.integer({ description: 'Seconds between job status polls.' }),
|
|
16
|
-
timeout: Flags.integer({ description: 'Maximum seconds to wait.' }),
|
|
15
|
+
interval: Flags.integer({ description: 'Seconds between job status polls (default: 3).' }),
|
|
16
|
+
timeout: Flags.integer({ description: 'Maximum seconds to wait (default: 3600).' }),
|
|
17
17
|
};
|
|
18
18
|
async run() {
|
|
19
19
|
const { args, flags } = await this.parse(AdvJobWait);
|
|
@@ -22,8 +22,12 @@ export default class AdvJobWait extends AgentiaCommand {
|
|
|
22
22
|
intervalSeconds: flags.interval,
|
|
23
23
|
timeoutSeconds: flags.timeout,
|
|
24
24
|
}));
|
|
25
|
+
assertAdvJobSucceeded(result);
|
|
25
26
|
this.display(() => this.log(formatAdvRecord(result)));
|
|
26
27
|
return result;
|
|
27
28
|
}
|
|
29
|
+
toErrorJson(error) {
|
|
30
|
+
return advRunErrorJson(super.toErrorJson(error), error);
|
|
31
|
+
}
|
|
28
32
|
}
|
|
29
33
|
//# sourceMappingURL=wait.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Args } from '@oclif/core';
|
|
2
2
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
-
import { CicdGateway } from '../../../lib/cicd-gateway.js';
|
|
4
3
|
import { sanitizeEnvironment } from '../../../lib/environment-credential-operations.js';
|
|
5
|
-
import {
|
|
4
|
+
import { fetchEnvironment } from '../../../lib/environment-get.js';
|
|
5
|
+
import { formatEnvironmentDetail } from '../../../lib/environment-types.js';
|
|
6
6
|
export default class EnvironmentGet extends AgentiaCommand {
|
|
7
7
|
static args = {
|
|
8
8
|
id: Args.string({
|
|
@@ -18,10 +18,7 @@ export default class EnvironmentGet extends AgentiaCommand {
|
|
|
18
18
|
];
|
|
19
19
|
async run() {
|
|
20
20
|
const { args } = await this.parse(EnvironmentGet);
|
|
21
|
-
const environment = sanitizeEnvironment(await this.withSpinner('Fetching environment', () =>
|
|
22
|
-
endpoint: environmentEndpoint(args.id),
|
|
23
|
-
method: 'GET',
|
|
24
|
-
})));
|
|
21
|
+
const environment = sanitizeEnvironment(await this.withSpinner('Fetching environment', () => fetchEnvironment(args.id)));
|
|
25
22
|
this.display(() => {
|
|
26
23
|
this.log(formatEnvironmentDetail(environment));
|
|
27
24
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
|
-
import { CicdGateway } from '../../../lib/cicd-gateway.js';
|
|
3
2
|
import { buildEnvironmentListFilters, environmentListFilterFlags } from '../../../lib/environment-flags.js';
|
|
4
|
-
import {
|
|
3
|
+
import { fetchEnvironments } from '../../../lib/environment-get.js';
|
|
5
4
|
import { cellValue, table } from '../../../lib/format.js';
|
|
6
5
|
import { buildPaginatedListResult, displayListPagination, pickCursorPageMeta, } from '../../../lib/list-pagination.js';
|
|
7
6
|
export function normalizeEnvironmentsListPage(response) {
|
|
@@ -53,11 +52,7 @@ export default class EnvironmentList extends AgentiaCommand {
|
|
|
53
52
|
async run() {
|
|
54
53
|
const { flags } = await this.parse(EnvironmentList);
|
|
55
54
|
const filters = buildEnvironmentListFilters(flags);
|
|
56
|
-
const
|
|
57
|
-
endpoint: environmentsListEndpoint(filters),
|
|
58
|
-
method: 'GET',
|
|
59
|
-
}));
|
|
60
|
-
const page = normalizeEnvironmentsListPage(response);
|
|
55
|
+
const page = await this.withSpinner('Fetching environments', () => fetchEnvironments(filters));
|
|
61
56
|
this.display(() => {
|
|
62
57
|
if (page.data.length === 0) {
|
|
63
58
|
this.log('No environments found.');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Args } from '@oclif/core';
|
|
2
2
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
-
import {
|
|
4
|
-
import { formatJobDetail
|
|
3
|
+
import { fetchJob } from '../../../lib/job-get.js';
|
|
4
|
+
import { formatJobDetail } from '../../../lib/job-types.js';
|
|
5
5
|
export default class JobGet extends AgentiaCommand {
|
|
6
6
|
static args = {
|
|
7
7
|
id: Args.string({
|
|
@@ -16,11 +16,7 @@ export default class JobGet extends AgentiaCommand {
|
|
|
16
16
|
];
|
|
17
17
|
async run() {
|
|
18
18
|
const { args } = await this.parse(JobGet);
|
|
19
|
-
const
|
|
20
|
-
endpoint: jobEndpoint(args.id),
|
|
21
|
-
method: 'GET',
|
|
22
|
-
}));
|
|
23
|
-
const job = normalizeJob(response);
|
|
19
|
+
const job = await this.withSpinner('Fetching job', () => fetchJob(args.id));
|
|
24
20
|
this.display(() => {
|
|
25
21
|
this.log(formatJobDetail(job));
|
|
26
22
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Flags } from '@oclif/core';
|
|
2
2
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
-
import {
|
|
4
|
-
import { formatJobTable
|
|
3
|
+
import { fetchJobs } from '../../../lib/job-get.js';
|
|
4
|
+
import { formatJobTable } from '../../../lib/job-types.js';
|
|
5
5
|
import { buildListPaginationQuery, displayListPagination, listPaginationFlags, } from '../../../lib/list-pagination.js';
|
|
6
6
|
import { getUserContext } from '../../../lib/user-context.js';
|
|
7
7
|
export default class JobList extends AgentiaCommand {
|
|
@@ -56,11 +56,7 @@ export default class JobList extends AgentiaCommand {
|
|
|
56
56
|
}
|
|
57
57
|
filters.ownerId = userId;
|
|
58
58
|
}
|
|
59
|
-
const
|
|
60
|
-
endpoint: jobListEndpoint(filters),
|
|
61
|
-
method: 'GET',
|
|
62
|
-
}));
|
|
63
|
-
const page = normalizeJobsListPage(response);
|
|
59
|
+
const page = await this.withSpinner('Fetching jobs', () => fetchJobs(filters));
|
|
64
60
|
this.display(() => {
|
|
65
61
|
if (page.data.length === 0) {
|
|
66
62
|
this.log('No jobs found.');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Args } from '@oclif/core';
|
|
2
2
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
-
import {
|
|
4
|
-
import { formatPipelineDetail
|
|
3
|
+
import { fetchPipeline } from '../../../lib/pipeline-get.js';
|
|
4
|
+
import { formatPipelineDetail } from '../../../lib/pipeline-types.js';
|
|
5
5
|
export default class PipelineGet extends AgentiaCommand {
|
|
6
6
|
static args = {
|
|
7
7
|
id: Args.string({
|
|
@@ -16,11 +16,7 @@ export default class PipelineGet extends AgentiaCommand {
|
|
|
16
16
|
];
|
|
17
17
|
async run() {
|
|
18
18
|
const { args } = await this.parse(PipelineGet);
|
|
19
|
-
const
|
|
20
|
-
endpoint: pipelineDescribeEndpoint(args.id),
|
|
21
|
-
method: 'GET',
|
|
22
|
-
}));
|
|
23
|
-
const pipeline = normalizePipelineDescribe(response);
|
|
19
|
+
const pipeline = await this.withSpinner('Fetching pipeline', () => fetchPipeline(args.id));
|
|
24
20
|
this.display(() => {
|
|
25
21
|
this.log(formatPipelineDetail(pipeline));
|
|
26
22
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
|
-
import { CicdGateway } from '../../../lib/cicd-gateway.js';
|
|
3
2
|
import { displayListPagination, } from '../../../lib/list-pagination.js';
|
|
4
3
|
import { buildPipelineListFilters, pipelineListFlags } from '../../../lib/pipeline-flags.js';
|
|
5
|
-
import {
|
|
4
|
+
import { fetchPipelines } from '../../../lib/pipeline-get.js';
|
|
5
|
+
import { formatPipelineTable } from '../../../lib/pipeline-types.js';
|
|
6
6
|
export default class PipelineList extends AgentiaCommand {
|
|
7
7
|
static description = 'List Copado pipelines';
|
|
8
8
|
static examples = [
|
|
@@ -13,11 +13,7 @@ export default class PipelineList extends AgentiaCommand {
|
|
|
13
13
|
static flags = pipelineListFlags;
|
|
14
14
|
async run() {
|
|
15
15
|
const { flags } = await this.parse(PipelineList);
|
|
16
|
-
const
|
|
17
|
-
endpoint: pipelineListEndpoint(buildPipelineListFilters(flags)),
|
|
18
|
-
method: 'GET',
|
|
19
|
-
}));
|
|
20
|
-
const page = normalizePipelinesListPage(response);
|
|
16
|
+
const page = await this.withSpinner('Fetching pipelines', () => fetchPipelines(buildPipelineListFilters(flags)));
|
|
21
17
|
this.display(() => {
|
|
22
18
|
if (page.data.length === 0) {
|
|
23
19
|
this.log('No pipelines found.');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Args } from '@oclif/core';
|
|
2
2
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
-
import {
|
|
4
|
-
import { formatProjectDetail
|
|
3
|
+
import { fetchProject } from '../../../lib/project-get.js';
|
|
4
|
+
import { formatProjectDetail } from '../../../lib/project-types.js';
|
|
5
5
|
export default class ProjectGet extends AgentiaCommand {
|
|
6
6
|
static args = {
|
|
7
7
|
id: Args.string({
|
|
@@ -17,11 +17,7 @@ export default class ProjectGet extends AgentiaCommand {
|
|
|
17
17
|
];
|
|
18
18
|
async run() {
|
|
19
19
|
const { args } = await this.parse(ProjectGet);
|
|
20
|
-
const
|
|
21
|
-
endpoint: projectEndpoint(args.id),
|
|
22
|
-
method: 'GET',
|
|
23
|
-
}));
|
|
24
|
-
const project = normalizeProject(response);
|
|
20
|
+
const project = await this.withSpinner('Fetching project', () => fetchProject(args.id));
|
|
25
21
|
this.display(() => {
|
|
26
22
|
this.log(formatProjectDetail(project));
|
|
27
23
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
|
-
import { CicdGateway } from '../../../lib/cicd-gateway.js';
|
|
3
2
|
import { displayListPagination } from '../../../lib/list-pagination.js';
|
|
4
3
|
import { buildProjectListFilters, projectListFlags, validateProjectListFilters, } from '../../../lib/project-flags.js';
|
|
5
|
-
import {
|
|
4
|
+
import { fetchProjects } from '../../../lib/project-get.js';
|
|
5
|
+
import { formatProjectTable } from '../../../lib/project-types.js';
|
|
6
6
|
export default class ProjectList extends AgentiaCommand {
|
|
7
7
|
static description = 'List Copado projects';
|
|
8
8
|
static examples = [
|
|
@@ -19,11 +19,7 @@ export default class ProjectList extends AgentiaCommand {
|
|
|
19
19
|
if (validationError !== undefined) {
|
|
20
20
|
this.error(validationError, { exit: 2 });
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
endpoint: projectsListEndpoint(filters),
|
|
24
|
-
method: 'GET',
|
|
25
|
-
}));
|
|
26
|
-
const page = normalizeProjectsListPage(response);
|
|
22
|
+
const page = await this.withSpinner('Fetching projects', () => fetchProjects(filters));
|
|
27
23
|
this.display(() => {
|
|
28
24
|
if (page.data.length === 0) {
|
|
29
25
|
this.log('No projects found.');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Args } from '@oclif/core';
|
|
2
2
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
-
import {
|
|
4
|
-
import { formatPromotionDetail
|
|
3
|
+
import { fetchPromotion } from '../../../lib/promotion-get.js';
|
|
4
|
+
import { formatPromotionDetail } from '../../../lib/promotion-types.js';
|
|
5
5
|
export default class PromotionGet extends AgentiaCommand {
|
|
6
6
|
static args = {
|
|
7
7
|
id: Args.string({
|
|
@@ -17,11 +17,7 @@ export default class PromotionGet extends AgentiaCommand {
|
|
|
17
17
|
];
|
|
18
18
|
async run() {
|
|
19
19
|
const { args } = await this.parse(PromotionGet);
|
|
20
|
-
const
|
|
21
|
-
endpoint: promotionEndpoint(args.id),
|
|
22
|
-
method: 'GET',
|
|
23
|
-
}));
|
|
24
|
-
const promotion = normalizePromotionDetail(response);
|
|
20
|
+
const promotion = await this.withSpinner('Fetching promotion', () => fetchPromotion(args.id));
|
|
25
21
|
this.display(() => {
|
|
26
22
|
this.log(formatPromotionDetail(promotion));
|
|
27
23
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
|
-
import { CicdGateway } from '../../../lib/cicd-gateway.js';
|
|
3
2
|
import { displayListPagination } from '../../../lib/list-pagination.js';
|
|
4
3
|
import { buildPromotionListFilters, promotionListFilterFlags } from '../../../lib/promotion-flags.js';
|
|
5
|
-
import {
|
|
4
|
+
import { fetchPromotions } from '../../../lib/promotion-get.js';
|
|
5
|
+
import { formatPromotionTable } from '../../../lib/promotion-types.js';
|
|
6
6
|
export const PROMOTION_TABLE_DISPLAY_LIMIT = 100;
|
|
7
7
|
export function selectPromotionsForTableDisplay(promotions) {
|
|
8
8
|
const total = promotions.length;
|
|
@@ -27,11 +27,7 @@ export default class PromotionList extends AgentiaCommand {
|
|
|
27
27
|
async run() {
|
|
28
28
|
const { flags } = await this.parse(PromotionList);
|
|
29
29
|
const filters = buildPromotionListFilters(flags);
|
|
30
|
-
const
|
|
31
|
-
endpoint: promotionListEndpoint(filters),
|
|
32
|
-
method: 'GET',
|
|
33
|
-
}));
|
|
34
|
-
const page = normalizePromotionsListPage(response);
|
|
30
|
+
const page = await this.withSpinner('Fetching promotions', () => fetchPromotions(filters));
|
|
35
31
|
this.display(() => {
|
|
36
32
|
if (page.data.length === 0) {
|
|
37
33
|
this.log('No promotions found.');
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
|
-
import { CicdGateway } from '../../../lib/cicd-gateway.js';
|
|
3
2
|
import { displayListPagination, listPaginationFlags } from '../../../lib/list-pagination.js';
|
|
4
|
-
import {
|
|
3
|
+
import { fetchStages } from '../../../lib/stage-list.js';
|
|
4
|
+
import { formatStageTable } from '../../../lib/stage-types.js';
|
|
5
5
|
export default class StageList extends AgentiaCommand {
|
|
6
6
|
static description = 'List Copado stages';
|
|
7
7
|
static examples = ['<%= config.bin %> <%= command.id %>', '<%= config.bin %> <%= command.id %> --json'];
|
|
8
8
|
static flags = listPaginationFlags;
|
|
9
9
|
async run() {
|
|
10
10
|
const { flags } = await this.parse(StageList);
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const page = await this.withSpinner('Fetching stages', () => fetchStages({
|
|
12
|
+
cursor: flags.cursor,
|
|
13
|
+
pageSize: flags['page-size'],
|
|
14
14
|
}));
|
|
15
|
-
const page = normalizeStagesListPage(response);
|
|
16
15
|
this.display(() => {
|
|
17
16
|
if (page.data.length === 0) {
|
|
18
17
|
this.log('No stages found.');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Flags } from '@oclif/core';
|
|
2
2
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
|
-
import {
|
|
4
|
-
import { DEFAULT_USER_ID, formatUserDetail
|
|
3
|
+
import { fetchUser } from '../../../lib/user-get.js';
|
|
4
|
+
import { DEFAULT_USER_ID, formatUserDetail } from '../../../lib/user-types.js';
|
|
5
5
|
export default class UserGet extends AgentiaCommand {
|
|
6
6
|
static description = 'Get a Copado user by ID (defaults to the authenticated user)';
|
|
7
7
|
static examples = [
|
|
@@ -18,11 +18,7 @@ export default class UserGet extends AgentiaCommand {
|
|
|
18
18
|
};
|
|
19
19
|
async run() {
|
|
20
20
|
const { flags } = await this.parse(UserGet);
|
|
21
|
-
const
|
|
22
|
-
const user = await this.withSpinner('Fetching user', () => CicdGateway.call({
|
|
23
|
-
endpoint: userEndpoint(userId),
|
|
24
|
-
method: 'GET',
|
|
25
|
-
}));
|
|
21
|
+
const user = await this.withSpinner('Fetching user', () => fetchUser(flags.id));
|
|
26
22
|
this.display(() => {
|
|
27
23
|
this.log(formatUserDetail(user));
|
|
28
24
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Args, Flags } from '@oclif/core';
|
|
2
2
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
3
|
import { WorkActiveResolutionError } from '../../../lib/work-active.js';
|
|
4
|
-
import {
|
|
4
|
+
import { fetchWorkItem } from '../../../lib/work-get.js';
|
|
5
5
|
import { formatUserStoriesAheadBehindLines, reportUserStoriesAheadBehindForStory, } from '../../../lib/work-submit-ahead-behind.js';
|
|
6
6
|
import { formatUserStoryDetail, } from '../../../lib/work-types.js';
|
|
7
7
|
export default class WorkGet extends AgentiaCommand {
|
|
@@ -29,7 +29,7 @@ export default class WorkGet extends AgentiaCommand {
|
|
|
29
29
|
const { args, flags } = await this.parse(WorkGet);
|
|
30
30
|
let userStory;
|
|
31
31
|
try {
|
|
32
|
-
userStory = await this.withSpinner('Fetching user story', () =>
|
|
32
|
+
userStory = await this.withSpinner('Fetching user story', () => fetchWorkItem(args.id));
|
|
33
33
|
}
|
|
34
34
|
catch (error) {
|
|
35
35
|
if (error instanceof WorkActiveResolutionError) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
|
-
import { CicdGateway } from '../../../lib/cicd-gateway.js';
|
|
3
2
|
import { displayListPagination } from '../../../lib/list-pagination.js';
|
|
4
3
|
import { getUserContext } from '../../../lib/user-context.js';
|
|
5
4
|
import { buildWorkListFilters, workListFilterFlags } from '../../../lib/work-flags.js';
|
|
6
|
-
import {
|
|
5
|
+
import { fetchWorkItems } from '../../../lib/work-get.js';
|
|
6
|
+
import { formatUserStoryTable } from '../../../lib/work-types.js';
|
|
7
7
|
export default class WorkList extends AgentiaCommand {
|
|
8
8
|
static description = 'List Copado user stories';
|
|
9
9
|
static examples = [
|
|
@@ -41,11 +41,7 @@ export default class WorkList extends AgentiaCommand {
|
|
|
41
41
|
filters.ownerId = userId;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
-
const
|
|
45
|
-
endpoint: workListEndpoint(filters),
|
|
46
|
-
method: 'GET',
|
|
47
|
-
}));
|
|
48
|
-
const page = normalizeUserStoriesListPage(response);
|
|
44
|
+
const page = await this.withSpinner('Fetching user stories', () => fetchWorkItems(filters));
|
|
49
45
|
this.display(() => {
|
|
50
46
|
if (page.data.length === 0) {
|
|
51
47
|
this.log('No user stories found.');
|
|
@@ -36,6 +36,7 @@ export default class WorkPromote extends AgentiaCommand {
|
|
|
36
36
|
'<%= config.bin %> <%= command.id %> --promotion=P29354 --abort',
|
|
37
37
|
'<%= config.bin %> <%= command.id %> a16P7000006By3pIAC --json',
|
|
38
38
|
];
|
|
39
|
+
static experimental = true;
|
|
39
40
|
static flags = {
|
|
40
41
|
abort: Flags.boolean({
|
|
41
42
|
default: false,
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { confirm } from '@inquirer/prompts';
|
|
2
|
+
import { Args, Flags } from '@oclif/core';
|
|
3
|
+
import { AgentiaCommand } from '../../lib/agentia-command.js';
|
|
4
|
+
import { assessInstalls, enforceInstalls, parseInstallArguments, PluginTrustError, stockInstallArguments, uncheckedWarning } from '../../lib/plugin-trust/gate.js';
|
|
5
|
+
export default class PluginsInstall extends AgentiaCommand {
|
|
6
|
+
static aliases = ['plugins:add'];
|
|
7
|
+
static args = {
|
|
8
|
+
plugin: Args.string({ description: 'npm package name (optionally with @tag) or git URL.', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static description = `Install plugins with npm after checking them against the Agentia plugin catalog.
|
|
11
|
+
|
|
12
|
+
Official and Verified plugins install without a prompt. Community, unlisted, and git URL plugins ask first. Use --allow-unverified when there is no terminal or with --json.
|
|
13
|
+
|
|
14
|
+
A revoked version, or an npm tarball that differs from the hash in the catalog, is always refused. If the catalog cannot be reached, the command warns and the install continues.`;
|
|
15
|
+
static examples = [
|
|
16
|
+
'<%= config.bin %> <%= command.id %> @acme/agentia-plugin-x',
|
|
17
|
+
'<%= config.bin %> <%= command.id %> @acme/agentia-plugin-x@1.2.0 --allow-unverified --json',
|
|
18
|
+
];
|
|
19
|
+
static flags = {
|
|
20
|
+
'allow-unverified': Flags.boolean({ description: 'Install plugins that are not Official or Verified without asking. Never overrides a revoked or mismatched version.' }),
|
|
21
|
+
force: Flags.boolean({ char: 'f', description: 'Force npm to fetch remote resources even if a local copy exists.' }),
|
|
22
|
+
silent: Flags.boolean({ char: 's', description: 'Silence npm output.' }),
|
|
23
|
+
verbose: Flags.boolean({ char: 'v', description: 'Show verbose npm output.' }),
|
|
24
|
+
};
|
|
25
|
+
static strict = false;
|
|
26
|
+
async run() {
|
|
27
|
+
let plugins;
|
|
28
|
+
let stockArguments;
|
|
29
|
+
try {
|
|
30
|
+
const parsed = parseInstallArguments(this.argv);
|
|
31
|
+
const inputs = this.applyAliases(parsed.inputs);
|
|
32
|
+
if (inputs.length === 0)
|
|
33
|
+
this.error('Missing 1 required arg:\nplugin Plugin to install.', { exit: 2 });
|
|
34
|
+
// The installer reads this registry setting; a hash from public npm would not describe a package from another registry.
|
|
35
|
+
const registryVariable = this.config.scopedEnvVarKey('NPM_REGISTRY');
|
|
36
|
+
const customRegistry = Boolean(process.env[registryVariable]);
|
|
37
|
+
const { assessments } = await assessInstalls(inputs, { resolve: !customRegistry });
|
|
38
|
+
const skipped = uncheckedWarning(assessments);
|
|
39
|
+
if (skipped)
|
|
40
|
+
this.display(() => this.warn(skipped));
|
|
41
|
+
if (customRegistry)
|
|
42
|
+
this.display(() => this.warn(`${registryVariable} is set, so versions cannot be checked against the catalog.`));
|
|
43
|
+
plugins = await enforceInstalls(assessments, {
|
|
44
|
+
allowUnverified: parsed.allowUnverified,
|
|
45
|
+
confirm: async (message) => confirm({ default: false, message }),
|
|
46
|
+
interactive: !this.jsonEnabled() && Boolean(process.stdin.isTTY && process.stdout.isTTY),
|
|
47
|
+
warn: (line) => this.display(() => this.warn(line)),
|
|
48
|
+
});
|
|
49
|
+
stockArguments = stockInstallArguments(parsed, assessments);
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
if (error instanceof PluginTrustError)
|
|
53
|
+
this.error(error.message, { exit: 1 });
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
await this.runStockInstall(stockArguments);
|
|
57
|
+
return { plugins };
|
|
58
|
+
}
|
|
59
|
+
applyAliases(inputs) {
|
|
60
|
+
const aliases = this.config.pjson.oclif.aliases ?? {};
|
|
61
|
+
return inputs.map((input) => {
|
|
62
|
+
if (aliases[input] === null)
|
|
63
|
+
this.error(`${input} is blocked`, { exit: 1 });
|
|
64
|
+
return aliases[input] ?? input;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
// Runs the stock @oclif/plugin-plugins command, which still does the npm install.
|
|
68
|
+
async runStockInstall(argv) {
|
|
69
|
+
const stock = this.config.plugins.get('@oclif/plugin-plugins')?.commands.find((command) => command.id === 'plugins:install');
|
|
70
|
+
if (stock === undefined)
|
|
71
|
+
this.error('@oclif/plugin-plugins is not available, so plugins cannot be installed.', { exit: 1 });
|
|
72
|
+
const StockInstall = await stock.load();
|
|
73
|
+
await StockInstall.run(argv, this.config);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=install.js.map
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import {modules} from './runtime.js';
|
|
2
|
+
const AdvRunFailedError = modules["adv-operations.js"]["AdvRunFailedError"]
|
|
2
3
|
const addAdvComponents = modules["adv-operations.js"]["addAdvComponents"]
|
|
4
|
+
const advRunErrorJson = modules["adv-operations.js"]["advRunErrorJson"]
|
|
5
|
+
const assertAdvJobSucceeded = modules["adv-operations.js"]["assertAdvJobSucceeded"]
|
|
3
6
|
const cancelAdvDeployment = modules["adv-operations.js"]["cancelAdvDeployment"]
|
|
4
7
|
const createAdvDeployment = modules["adv-operations.js"]["createAdvDeployment"]
|
|
5
8
|
const deriveAdvJobResult = modules["adv-operations.js"]["deriveAdvJobResult"]
|
|
@@ -23,4 +26,4 @@ const selectedAdvComponents = modules["adv-operations.js"]["selectedAdvComponent
|
|
|
23
26
|
const updateAdvDeploymentOptions = modules["adv-operations.js"]["updateAdvDeploymentOptions"]
|
|
24
27
|
const validateAdvOrganization = modules["adv-operations.js"]["validateAdvOrganization"]
|
|
25
28
|
const waitForAdvJob = modules["adv-operations.js"]["waitForAdvJob"]
|
|
26
|
-
export {addAdvComponents, cancelAdvDeployment, createAdvDeployment, deriveAdvJobResult, getAdvAuthStatus, getAdvDeployment, getAdvJob, getAdvOrganization, getStoredAdvAuthSummary, listAdvComponentTypes, listAdvComponents, listAdvDeployments, listAdvJobs, listAdvOrganizations, parseAdvComponentSpec, readAdvComponentsFromJsonFile, readAdvComponentsFromTextFile, refreshAdvComponents, removeAdvComponents, runAdvDeploymentAction, selectedAdvComponents, updateAdvDeploymentOptions, validateAdvOrganization, waitForAdvJob};
|
|
29
|
+
export {AdvRunFailedError, addAdvComponents, advRunErrorJson, assertAdvJobSucceeded, cancelAdvDeployment, createAdvDeployment, deriveAdvJobResult, getAdvAuthStatus, getAdvDeployment, getAdvJob, getAdvOrganization, getStoredAdvAuthSummary, listAdvComponentTypes, listAdvComponents, listAdvDeployments, listAdvJobs, listAdvOrganizations, parseAdvComponentSpec, readAdvComponentsFromJsonFile, readAdvComponentsFromTextFile, refreshAdvComponents, removeAdvComponents, runAdvDeploymentAction, selectedAdvComponents, updateAdvDeploymentOptions, validateAdvOrganization, waitForAdvJob};
|