@copado/agentia-cli 1.0.0-beta.5 → 1.0.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +906 -245
  3. package/dist/commands/adv/auth/status.js +20 -0
  4. package/dist/commands/adv/component/add.js +48 -0
  5. package/dist/commands/adv/component/list.js +46 -0
  6. package/dist/commands/adv/component/refresh.js +23 -0
  7. package/dist/commands/adv/component/remove.js +35 -0
  8. package/dist/commands/adv/component/selected.js +26 -0
  9. package/dist/commands/adv/component/types.js +16 -0
  10. package/dist/commands/adv/deployment/cancel.js +45 -0
  11. package/dist/commands/adv/deployment/create.js +23 -0
  12. package/dist/commands/adv/deployment/deploy.js +49 -0
  13. package/dist/commands/adv/deployment/get.js +21 -0
  14. package/dist/commands/adv/deployment/list.js +30 -0
  15. package/dist/commands/adv/deployment/options.js +33 -0
  16. package/dist/commands/adv/deployment/quick-deploy.js +57 -0
  17. package/dist/commands/adv/deployment/validate.js +32 -0
  18. package/dist/commands/adv/job/get.js +21 -0
  19. package/dist/commands/adv/job/list.js +30 -0
  20. package/dist/commands/adv/job/wait.js +33 -0
  21. package/dist/commands/adv/organization/get.js +21 -0
  22. package/dist/commands/adv/organization/list.js +21 -0
  23. package/dist/commands/adv/organization/validate.js +20 -0
  24. package/dist/commands/auth/get.js +24 -3
  25. package/dist/commands/auth/set.js +18 -0
  26. package/dist/commands/auth/unset.js +4 -0
  27. package/dist/commands/cicd/environment/get.js +3 -6
  28. package/dist/commands/cicd/environment/list.js +2 -7
  29. package/dist/commands/cicd/job/get.js +3 -7
  30. package/dist/commands/cicd/job/list.js +3 -7
  31. package/dist/commands/cicd/notification/get.js +44 -0
  32. package/dist/commands/cicd/pipeline/get.js +3 -7
  33. package/dist/commands/cicd/pipeline/list.js +3 -7
  34. package/dist/commands/cicd/project/get.js +3 -7
  35. package/dist/commands/cicd/project/list.js +3 -7
  36. package/dist/commands/cicd/promotion/get.js +3 -7
  37. package/dist/commands/cicd/promotion/list.js +3 -7
  38. package/dist/commands/cicd/stage/list.js +5 -6
  39. package/dist/commands/cicd/user/get.js +3 -7
  40. package/dist/commands/cicd/work/get.js +2 -2
  41. package/dist/commands/cicd/work/list.js +3 -7
  42. package/dist/commands/cicd/work/promote.js +1 -0
  43. package/dist/commands/cicd/work/publish.js +1 -0
  44. package/dist/commands/setup/skills/create.js +4 -0
  45. package/dist/commands/setup/skills/update.js +4 -0
  46. package/dist/hooks/init/migrate-user-config.js +5 -1
  47. package/dist/hooks/init/version-warning.js +5 -2
  48. package/dist/lib/adv-config.js +9 -0
  49. package/dist/lib/adv-flags.js +8 -0
  50. package/dist/lib/adv-gateway.js +8 -0
  51. package/dist/lib/adv-operations.js +29 -0
  52. package/dist/lib/adv-sanitization.js +8 -0
  53. package/dist/lib/adv-types.js +9 -0
  54. package/dist/lib/agentia-command.js +68 -3
  55. package/dist/lib/ai-config.js +3 -1
  56. package/dist/lib/auth-config.js +2 -1
  57. package/dist/lib/auth-profile.js +2 -1
  58. package/dist/lib/auth-status-format.js +2 -1
  59. package/dist/lib/cicd-gateway.js +2 -1
  60. package/dist/lib/cli-severity-color.js +4 -0
  61. package/dist/lib/environment-get.js +4 -0
  62. package/dist/lib/job-get.js +4 -0
  63. package/dist/lib/mcp/adv-tools.js +227 -0
  64. package/dist/lib/mcp/command-id.js +4 -1
  65. package/dist/lib/mcp/tool-annotations.js +23 -0
  66. package/dist/lib/mcp/tools.js +67 -67
  67. package/dist/lib/mcp/work-tools.js +10 -9
  68. package/dist/lib/notifications-get.js +10 -0
  69. package/dist/lib/pipeline-get.js +4 -0
  70. package/dist/lib/plugin-host/ai.js +5 -0
  71. package/dist/lib/plugin-host/environment.js +4 -0
  72. package/dist/lib/plugin-host/event-log.js +2 -1
  73. package/dist/lib/plugin-host/input.js +7 -0
  74. package/dist/lib/plugin-host/job.js +4 -0
  75. package/dist/lib/plugin-host/pipeline.js +4 -0
  76. package/dist/lib/plugin-host/project.js +5 -0
  77. package/dist/lib/plugin-host/projection-utils.js +6 -1
  78. package/dist/lib/plugin-host/promotion.js +4 -0
  79. package/dist/lib/plugin-host/stage.js +4 -0
  80. package/dist/lib/plugin-host/user.js +4 -0
  81. package/dist/lib/plugin-host/workspace.js +3 -0
  82. package/dist/lib/project-get.js +4 -0
  83. package/dist/lib/promotion-get.js +4 -0
  84. package/dist/lib/runtime.js +1 -1
  85. package/dist/lib/stage-list.js +3 -0
  86. package/dist/lib/testing-gateway.js +2 -1
  87. package/dist/lib/user-get.js +3 -0
  88. package/dist/lib/work-get.js +3 -2
  89. package/oclif.manifest.json +1578 -144
  90. package/package.json +35 -2
  91. package/templates/AGENTS.md +1 -1
  92. package/templates/skills/agentia-adv/SKILL.md +22 -0
  93. package/templates/skills/agentia-adv/references/pipelines-advanced.md +50 -0
  94. package/templates/skills/agentia-cicd/SKILL.md +3 -1
  95. package/templates/skills/agentia-cicd/references/notifications.md +79 -0
  96. package/templates/skills/agentia-cicd/references/work.md +19 -0
@@ -0,0 +1,21 @@
1
+ import { listAdvOrganizations } from '../../../lib/adv-operations.js';
2
+ import { formatAdvOrganizations } from '../../../lib/adv-types.js';
3
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
4
+ export default class AdvOrganizationList extends AgentiaCommand {
5
+ static description = 'List Pipelines Advanced organizations visible to the PAT user';
6
+ static examples = [
7
+ '<%= config.bin %> <%= command.id %>',
8
+ '<%= config.bin %> <%= command.id %> --json',
9
+ ];
10
+ async run() {
11
+ const result = await this.withSpinner('Fetching Pipelines Advanced organizations', () => listAdvOrganizations());
12
+ this.display(() => {
13
+ if (result.organizations.length === 0)
14
+ this.log('No Pipelines Advanced organizations found.');
15
+ else
16
+ this.log(formatAdvOrganizations(result.organizations));
17
+ });
18
+ return result;
19
+ }
20
+ }
21
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1,20 @@
1
+ import { Args } from '@oclif/core';
2
+ import { validateAdvOrganization } from '../../../lib/adv-operations.js';
3
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
4
+ export default class AdvOrganizationValidate extends AgentiaCommand {
5
+ static args = {
6
+ id: Args.integer({ description: 'Pipelines Advanced organization ID.', required: true }),
7
+ };
8
+ static description = 'Validate that Pipelines Advanced can connect to an organization';
9
+ static examples = [
10
+ '<%= config.bin %> <%= command.id %> 910001',
11
+ '<%= config.bin %> <%= command.id %> 910001 --json',
12
+ ];
13
+ async run() {
14
+ const { args } = await this.parse(AdvOrganizationValidate);
15
+ const result = await this.withSpinner('Validating Pipelines Advanced organization connection', () => validateAdvOrganization(args.id));
16
+ this.display(() => this.log(result.message));
17
+ return result;
18
+ }
19
+ }
20
+ //# sourceMappingURL=validate.js.map
@@ -1,9 +1,9 @@
1
1
  import { Flags, ux } from '@oclif/core';
2
2
  import { existsSync } from 'node:fs';
3
3
  import { AgentiaCommand } from '../../lib/agentia-command.js';
4
- import { getAiAuthStatus, getCicdAuthStatus, getCrtAuthStatus } from '../../lib/auth-config.js';
4
+ import { getAdvAuthStatus, getAiAuthStatus, getCicdAuthStatus, getCrtAuthStatus } from '../../lib/auth-config.js';
5
5
  import { readAuthProfile } from '../../lib/auth-profile.js';
6
- import { formatAiStatusLine, formatCicdStatusLine, formatCrtStatusLine } from '../../lib/auth-status-format.js';
6
+ import { formatAdvStatusLine, formatAiStatusLine, formatCicdStatusLine, formatCrtStatusLine } from '../../lib/auth-status-format.js';
7
7
  import { ALL_CREDENTIAL_TYPES, credentialLabel, } from '../../lib/credential-store.js';
8
8
  import { getDefaultsStorePaths } from '../../lib/defaults-store.js';
9
9
  export default class AuthGet extends AgentiaCommand {
@@ -11,12 +11,16 @@ export default class AuthGet extends AgentiaCommand {
11
11
  static examples = [
12
12
  '<%= config.bin %> <%= command.id %>',
13
13
  '<%= config.bin %> <%= command.id %> --ai',
14
+ '<%= config.bin %> <%= command.id %> --adv',
14
15
  '<%= config.bin %> <%= command.id %> --cicd',
15
16
  '<%= config.bin %> <%= command.id %> --crt',
16
17
  '<%= config.bin %> <%= command.id %> --cicd --crt',
17
18
  '<%= config.bin %> <%= command.id %> --json',
18
19
  ];
19
20
  static flags = {
21
+ adv: Flags.boolean({
22
+ description: 'Show PAT for Pipelines Advanced authentication',
23
+ }),
20
24
  ai: Flags.boolean({
21
25
  description: 'Show PAK for Copado AI authentication',
22
26
  }),
@@ -39,10 +43,13 @@ export default class AuthGet extends AgentiaCommand {
39
43
  if (flags.ai) {
40
44
  types.push('ai');
41
45
  }
46
+ if (flags.adv) {
47
+ types.push('adv');
48
+ }
42
49
  const selectedTypes = types.length > 0 ? types : ALL_CREDENTIAL_TYPES;
43
50
  const credentials = selectedTypes.map((type) => this.buildCredentialResult(type));
44
51
  this.display(() => {
45
- for (const type of ['cicd', 'ai', 'crt']) {
52
+ for (const type of ['cicd', 'ai', 'crt', 'adv']) {
46
53
  if (!selectedTypes.includes(type))
47
54
  continue;
48
55
  const scopes = this.hasLocalAuthentication(type) ? ['global', 'local'] : [undefined];
@@ -81,6 +88,17 @@ export default class AuthGet extends AgentiaCommand {
81
88
  if (type === 'cicd') {
82
89
  return this.buildCicdCredentialResult(scope);
83
90
  }
91
+ if (type === 'adv') {
92
+ const status = getAdvAuthStatus(scope);
93
+ return {
94
+ baseUrl: status.baseUrl,
95
+ label: credentialLabel(type),
96
+ masked: status.masked,
97
+ set: status.set,
98
+ source: status.source,
99
+ type,
100
+ };
101
+ }
84
102
  if (type === 'ai') {
85
103
  const status = getAiAuthStatus(scope);
86
104
  return {
@@ -119,6 +137,9 @@ export default class AuthGet extends AgentiaCommand {
119
137
  if (credential.type === 'crt') {
120
138
  return formatCrtStatusLine(credential);
121
139
  }
140
+ if (credential.type === 'adv') {
141
+ return formatAdvStatusLine(credential);
142
+ }
122
143
  return '';
123
144
  }
124
145
  hasLocalAuthentication(type) {
@@ -10,6 +10,8 @@ export default class AuthSet extends AgentiaCommand {
10
10
  '<%= config.bin %> <%= command.id %> --ai <pak> --ai-domain robotic.copado.com --ai-org 42888 --ai-workspace 42d0b908-37b7-4565-9ec9-86eda40c9782',
11
11
  '<%= config.bin %> <%= command.id %> --ai <pak> --ai-gateway-url http://localhost:8080/organizations/42888',
12
12
  '<%= config.bin %> <%= command.id %> --ai-workspace 42d0b908-37b7-4565-9ec9-86eda40c9782',
13
+ '<%= config.bin %> <%= command.id %> --adv <pat>',
14
+ '<%= config.bin %> <%= command.id %> --adv <pat> --adv-base-url https://uat.pipeline.copado.com',
13
15
  '<%= config.bin %> <%= command.id %> --cicd <copado-api-key> --region na',
14
16
  '<%= config.bin %> <%= command.id %> --cicd <copado-api-key> --custom-url https://dev.api.copado.com',
15
17
  '<%= config.bin %> <%= command.id %> --cicd <copado-api-key>',
@@ -19,6 +21,12 @@ export default class AuthSet extends AgentiaCommand {
19
21
  '<%= config.bin %> <%= command.id %> --cicd <copado-api-key> --region na --json',
20
22
  ];
21
23
  static flags = {
24
+ adv: Flags.string({
25
+ description: 'Personal Access Token for Copado Pipelines Advanced authentication',
26
+ }),
27
+ 'adv-base-url': Flags.string({
28
+ description: 'Optional Pipelines Advanced base URL; omit to auto-discover from the PAT',
29
+ }),
22
30
  ai: Flags.string({ description: 'PAK for Copado AI authentication' }),
23
31
  'ai-domain': Flags.string({
24
32
  description: 'Optional Copado AI domain hostname; omit to auto-discover from the PAK and organization ID',
@@ -59,6 +67,8 @@ export default class AuthSet extends AgentiaCommand {
59
67
  let result;
60
68
  try {
61
69
  result = await this.withSpinnerForAuth(flags, () => applyAuthSet({
70
+ adv: flags.adv,
71
+ advBaseUrl: flags['adv-base-url'],
62
72
  ai: flags.ai,
63
73
  aiDomain: flags['ai-domain'],
64
74
  aiGatewayUrl: flags['ai-gateway-url'],
@@ -103,6 +113,9 @@ export default class AuthSet extends AgentiaCommand {
103
113
  if (result.ai?.workspaceId !== undefined) {
104
114
  this.log(`Stored AI workspace ID: ${result.ai.workspaceId}.`);
105
115
  }
116
+ if (result.adv?.baseUrl !== undefined) {
117
+ this.log(`Stored Pipelines Advanced endpoint: ${result.adv.baseUrl}.`);
118
+ }
106
119
  return result;
107
120
  }
108
121
  async withSpinnerForAuth(flags, action) {
@@ -125,6 +138,11 @@ export default class AuthSet extends AgentiaCommand {
125
138
  if (flags.ai !== undefined) {
126
139
  return this.withSpinner('Validating AI credentials', action);
127
140
  }
141
+ if (flags.adv !== undefined) {
142
+ return this.withSpinner(flags['adv-base-url'] === undefined
143
+ ? 'Discovering Pipelines Advanced endpoint'
144
+ : 'Validating Pipelines Advanced PAT for custom endpoint', action);
145
+ }
128
146
  return action();
129
147
  }
130
148
  }
@@ -8,12 +8,16 @@ export default class AuthUnset extends AgentiaCommand {
8
8
  static examples = [
9
9
  '<%= config.bin %> <%= command.id %>',
10
10
  '<%= config.bin %> <%= command.id %> --ai',
11
+ '<%= config.bin %> <%= command.id %> --adv',
11
12
  '<%= config.bin %> <%= command.id %> --cicd',
12
13
  '<%= config.bin %> <%= command.id %> --crt',
13
14
  '<%= config.bin %> <%= command.id %> --cicd --crt --yes',
14
15
  '<%= config.bin %> <%= command.id %> --json --yes',
15
16
  ];
16
17
  static flags = {
18
+ adv: Flags.boolean({
19
+ description: 'Remove Pipelines Advanced PAT and endpoint configuration',
20
+ }),
17
21
  ai: Flags.boolean({
18
22
  description: 'Remove Copado AI PAK, domain, organization, workspace, and gateway URL configuration',
19
23
  }),
@@ -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 { environmentEndpoint, formatEnvironmentDetail } from '../../../lib/environment-types.js';
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', () => CicdGateway.call({
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 { environmentsListEndpoint } from '../../../lib/environment-types.js';
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 response = await this.withSpinner('Fetching environments', () => CicdGateway.call({
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 { CicdGateway } from '../../../lib/cicd-gateway.js';
4
- import { formatJobDetail, jobEndpoint, normalizeJob } from '../../../lib/job-types.js';
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 response = await this.withSpinner('Fetching job', () => CicdGateway.call({
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 { CicdGateway } from '../../../lib/cicd-gateway.js';
4
- import { formatJobTable, jobListEndpoint, normalizeJobsListPage, } from '../../../lib/job-types.js';
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 response = await this.withSpinner('Fetching jobs', () => CicdGateway.call({
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.');
@@ -0,0 +1,44 @@
1
+ import { Flags } from '@oclif/core';
2
+ import { AgentiaCommand } from '../../../lib/agentia-command.js';
3
+ import { NotificationConfigureInputError } from '../../../lib/notifications-configure.js';
4
+ import { formatNotificationSubscriptionsTable, getNotificationSubscriptions, NotificationGetUserUnavailableError, } from '../../../lib/notifications-get.js';
5
+ export default class NotificationGet extends AgentiaCommand {
6
+ static description = 'List Slack notification subscriptions for the current user on a pipeline';
7
+ static examples = [
8
+ '<%= config.bin %> <%= command.id %> --pipeline-id <pipeline-id>',
9
+ '<%= config.bin %> <%= command.id %> -p <pipeline-id> --json',
10
+ ];
11
+ static flags = {
12
+ 'pipeline-id': Flags.string({
13
+ char: 'p',
14
+ description: 'Copado pipeline Salesforce Id',
15
+ required: true,
16
+ }),
17
+ };
18
+ async run() {
19
+ const { flags } = await this.parse(NotificationGet);
20
+ const result = await this.withSpinner('Fetching notification subscriptions', async () => {
21
+ try {
22
+ return await getNotificationSubscriptions(flags['pipeline-id']);
23
+ }
24
+ catch (error) {
25
+ if (error instanceof NotificationConfigureInputError) {
26
+ this.error(error.message, { exit: error.exitCode });
27
+ }
28
+ if (error instanceof NotificationGetUserUnavailableError) {
29
+ this.error(error.message, { exit: error.exitCode });
30
+ }
31
+ throw error;
32
+ }
33
+ });
34
+ this.display(() => {
35
+ if (result.subscriptions.length === 0) {
36
+ this.log('No notification subscriptions found for this pipeline.');
37
+ return;
38
+ }
39
+ this.log(formatNotificationSubscriptionsTable(result.subscriptions));
40
+ });
41
+ return result;
42
+ }
43
+ }
44
+ //# sourceMappingURL=get.js.map
@@ -1,7 +1,7 @@
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
- import { formatPipelineDetail, normalizePipelineDescribe, pipelineDescribeEndpoint, } from '../../../lib/pipeline-types.js';
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 response = await this.withSpinner('Fetching pipeline', () => CicdGateway.call({
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 { formatPipelineTable, normalizePipelinesListPage, pipelineListEndpoint, } from '../../../lib/pipeline-types.js';
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 response = await this.withSpinner('Fetching pipelines', () => CicdGateway.call({
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 { CicdGateway } from '../../../lib/cicd-gateway.js';
4
- import { formatProjectDetail, normalizeProject, projectEndpoint, } from '../../../lib/project-types.js';
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 response = await this.withSpinner('Fetching project', () => CicdGateway.call({
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 { formatProjectTable, normalizeProjectsListPage, projectsListEndpoint, } from '../../../lib/project-types.js';
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 response = await this.withSpinner('Fetching projects', () => CicdGateway.call({
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 { CicdGateway } from '../../../lib/cicd-gateway.js';
4
- import { formatPromotionDetail, normalizePromotionDetail, promotionEndpoint, } from '../../../lib/promotion-types.js';
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 response = await this.withSpinner('Fetching promotion', () => CicdGateway.call({
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 { formatPromotionTable, normalizePromotionsListPage, promotionListEndpoint, } from '../../../lib/promotion-types.js';
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 response = await this.withSpinner('Fetching promotions', () => CicdGateway.call({
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 { formatStageTable, normalizeStagesListPage, stagesEndpoint } from '../../../lib/stage-types.js';
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 response = await this.withSpinner('Fetching stages', () => CicdGateway.call({
12
- endpoint: stagesEndpoint({ cursor: flags.cursor, pageSize: flags['page-size'] }),
13
- method: 'GET',
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 { CicdGateway } from '../../../lib/cicd-gateway.js';
4
- import { DEFAULT_USER_ID, formatUserDetail, resolveUserId, userEndpoint } from '../../../lib/user-types.js';
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 userId = resolveUserId(flags.id);
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 { fetchUserStory } from '../../../lib/work-get.js';
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', () => fetchUserStory(args.id));
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 { formatUserStoryTable, normalizeUserStoriesListPage, workListEndpoint, } from '../../../lib/work-types.js';
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 response = await this.withSpinner('Fetching user stories', () => CicdGateway.call({
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,
@@ -5,6 +5,7 @@ export default class WorkPublish extends AgentiaCommand {
5
5
  static description = WORK_PUBLISH_DESCRIPTION;
6
6
  static examples = [
7
7
  '<%= config.bin %> <%= command.id %>',
8
+ '<%= config.bin %> <%= command.id %> --dry-run',
8
9
  '<%= config.bin %> <%= command.id %> --permissions CustomField:Account.SLA__c,ApexClass:AccountService',
9
10
  '<%= config.bin %> <%= command.id %> --full-metadata PermissionSet:Sales_Onboarding',
10
11
  '<%= config.bin %> <%= command.id %> --skip-nested-metadata-detection',
@@ -6,11 +6,15 @@ export default class SetupSkillsCreate extends AgentiaCommand {
6
6
  static description = 'Create portable Markdown-only Agentia CLI skills in this project without overwriting managed files';
7
7
  static examples = [
8
8
  '<%= config.bin %> <%= command.id %>',
9
+ '<%= config.bin %> <%= command.id %> --adv --target agents --no-prompt',
9
10
  '<%= config.bin %> <%= command.id %> --cicd --target agents --no-prompt',
10
11
  '<%= config.bin %> <%= command.id %> --testing --ai --target cursor --no-prompt',
11
12
  '<%= config.bin %> <%= command.id %> --json',
12
13
  ];
13
14
  static flags = {
15
+ adv: Flags.boolean({
16
+ description: 'Create the Copado Pipelines Advanced skill pack',
17
+ }),
14
18
  ai: Flags.boolean({
15
19
  description: 'Create the Copado AI agent skill pack',
16
20
  }),
@@ -7,10 +7,14 @@ export default class SetupSkillsUpdate extends AgentiaCommand {
7
7
  static examples = [
8
8
  '<%= config.bin %> <%= command.id %>',
9
9
  '<%= config.bin %> <%= command.id %> --ai --target cursor --no-prompt',
10
+ '<%= config.bin %> <%= command.id %> --adv --target agents --no-prompt',
10
11
  '<%= config.bin %> <%= command.id %> --cicd --testing --target agents --no-prompt',
11
12
  '<%= config.bin %> <%= command.id %> --force --json',
12
13
  ];
13
14
  static flags = {
15
+ adv: Flags.boolean({
16
+ description: 'Update the Copado Pipelines Advanced skill pack',
17
+ }),
14
18
  ai: Flags.boolean({
15
19
  description: 'Update the Copado AI agent skill pack',
16
20
  }),
@@ -1,3 +1,5 @@
1
+ import { Errors } from '@oclif/core';
2
+ import { colorizeCliSeverityText } from '../../lib/cli-severity-color.js';
1
3
  import { migrateUserSettingsFromProjectConfig } from '../../lib/defaults-store.js';
2
4
  const hook = async function ({ id }) {
3
5
  if (id === undefined || !id.startsWith('cicd')) {
@@ -6,7 +8,9 @@ const hook = async function ({ id }) {
6
8
  try {
7
9
  const result = await migrateUserSettingsFromProjectConfig();
8
10
  if (result.migrated) {
9
- this.warn('Moved user settings from .agentia/config.json to .agentia/config.user.json.');
11
+ const warning = new Errors.CLIError.Warn(colorizeCliSeverityText('Moved user settings from .agentia/config.json to .agentia/config.user.json.', 'warning'));
12
+ warning.name = colorizeCliSeverityText('Warning', 'warning');
13
+ Errors.warn(warning);
10
14
  }
11
15
  }
12
16
  catch {