@copado/agentia-cli 0.10.0-alpha.0 → 0.13.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 +194 -51
- package/dist/commands/environment/list.d.ts +6 -0
- package/dist/commands/environment/list.js +7 -2
- package/dist/commands/environment/list.js.map +1 -1
- package/dist/commands/project/list.d.ts +10 -0
- package/dist/commands/project/list.js +31 -0
- package/dist/commands/project/list.js.map +1 -0
- package/dist/commands/promotion/get.d.ts +10 -0
- package/dist/commands/promotion/get.js +31 -0
- package/dist/commands/promotion/get.js.map +1 -0
- package/dist/commands/promotion/list.d.ts +30 -0
- package/dist/commands/promotion/list.js +48 -0
- package/dist/commands/promotion/list.js.map +1 -0
- package/dist/commands/user/get.d.ts +10 -0
- package/dist/commands/user/get.js +32 -0
- package/dist/commands/user/get.js.map +1 -0
- package/dist/lib/environment-flags.d.ts +11 -1
- package/dist/lib/environment-flags.js +29 -0
- package/dist/lib/environment-flags.js.map +1 -1
- package/dist/lib/environment-types.d.ts +8 -0
- package/dist/lib/environment-types.js +18 -0
- package/dist/lib/environment-types.js.map +1 -1
- package/dist/lib/mcp/tools.d.ts +30 -0
- package/dist/lib/mcp/tools.js +110 -7
- package/dist/lib/mcp/tools.js.map +1 -1
- package/dist/lib/project-flags.d.ts +8 -0
- package/dist/lib/project-flags.js +10 -0
- package/dist/lib/project-flags.js.map +1 -0
- package/dist/lib/project-types.d.ts +19 -0
- package/dist/lib/project-types.js +27 -0
- package/dist/lib/project-types.js.map +1 -0
- package/dist/lib/promotion-flags.d.ts +21 -0
- package/dist/lib/promotion-flags.js +77 -0
- package/dist/lib/promotion-flags.js.map +1 -0
- package/dist/lib/promotion-types.d.ts +188 -0
- package/dist/lib/promotion-types.js +145 -0
- package/dist/lib/promotion-types.js.map +1 -0
- package/dist/lib/user-types.d.ts +9 -0
- package/dist/lib/user-types.js +21 -0
- package/dist/lib/user-types.js.map +1 -0
- package/oclif.manifest.json +314 -26
- package/package.json +4 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../../lib/agentia-command.js';
|
|
2
|
+
import { CicdGateway } from '../../lib/cicd-gateway.js';
|
|
3
|
+
import { buildProjectListFilters, projectListFlags } from '../../lib/project-flags.js';
|
|
4
|
+
import { formatProjectTable, normalizeProjects, projectsListEndpoint, } from '../../lib/project-types.js';
|
|
5
|
+
export default class ProjectList extends AgentiaCommand {
|
|
6
|
+
static description = 'List Copado projects';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> <%= command.id %>',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --mine',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --mine --json',
|
|
11
|
+
];
|
|
12
|
+
static flags = projectListFlags;
|
|
13
|
+
async run() {
|
|
14
|
+
const { flags } = await this.parse(ProjectList);
|
|
15
|
+
const filters = buildProjectListFilters(flags);
|
|
16
|
+
const response = await this.withSpinner('Fetching projects', () => CicdGateway.call({
|
|
17
|
+
endpoint: projectsListEndpoint(filters),
|
|
18
|
+
method: 'GET',
|
|
19
|
+
}));
|
|
20
|
+
const projects = normalizeProjects(response);
|
|
21
|
+
this.display(() => {
|
|
22
|
+
if (projects.length === 0) {
|
|
23
|
+
this.log('No projects found.');
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
this.log(formatProjectTable(projects));
|
|
27
|
+
});
|
|
28
|
+
return projects;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/project/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAC,uBAAuB,EAAE,gBAAgB,EAAC,MAAM,4BAA4B,CAAA;AACpF,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EAEjB,oBAAoB,GAErB,MAAM,4BAA4B,CAAA;AAEnC,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,cAAc;IACrD,MAAM,CAAU,WAAW,GAAG,sBAAsB,CAAA;IACpD,MAAM,CAAU,QAAQ,GAAG;QACzB,qCAAqC;QACrC,4CAA4C;QAC5C,mDAAmD;KACpD,CAAA;IACD,MAAM,CAAU,KAAK,GAAG,gBAAgB,CAAA;IAEjC,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QAC7C,MAAM,OAAO,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAA;QAE9C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,mBAAmB,EAAE,GAAG,EAAE,CAChE,WAAW,CAAC,IAAI,CAA+B;YAC7C,QAAQ,EAAE,oBAAoB,CAAC,OAAO,CAAC;YACvC,MAAM,EAAE,KAAK;SACd,CAAC,CACH,CAAA;QACD,MAAM,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAA;QAE5C,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC1B,IAAI,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;gBAC9B,OAAM;YACR,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAA;QACxC,CAAC,CAAC,CAAA;QAEF,OAAO,QAAQ,CAAA;IACjB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../../lib/agentia-command.js';
|
|
2
|
+
import { type PromotionDetail } from '../../lib/promotion-types.js';
|
|
3
|
+
export default class PromotionGet 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<PromotionDetail>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
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';
|
|
5
|
+
export default class PromotionGet extends AgentiaCommand {
|
|
6
|
+
static args = {
|
|
7
|
+
id: Args.string({
|
|
8
|
+
description: 'Copado promotion ID',
|
|
9
|
+
name: 'id',
|
|
10
|
+
required: true,
|
|
11
|
+
}),
|
|
12
|
+
};
|
|
13
|
+
static description = 'Get a Copado promotion by ID';
|
|
14
|
+
static examples = [
|
|
15
|
+
'<%= config.bin %> <%= command.id %> <promotion-id>',
|
|
16
|
+
'<%= config.bin %> <%= command.id %> <promotion-id> --json',
|
|
17
|
+
];
|
|
18
|
+
async run() {
|
|
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);
|
|
25
|
+
this.display(() => {
|
|
26
|
+
this.log(formatPromotionDetail(promotion));
|
|
27
|
+
});
|
|
28
|
+
return promotion;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/promotion/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAA;AACrD,OAAO,EACL,qBAAqB,EACrB,wBAAwB,EAGxB,iBAAiB,GAClB,MAAM,8BAA8B,CAAA;AAErC,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,cAAc;IACtD,MAAM,CAAU,IAAI,GAAG;QACrB,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC;YACd,WAAW,EAAE,qBAAqB;YAClC,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,IAAI;SACf,CAAC;KACH,CAAA;IACD,MAAM,CAAU,WAAW,GAAG,8BAA8B,CAAA;IAC5D,MAAM,CAAU,QAAQ,GAAG;QACzB,oDAAoD;QACpD,2DAA2D;KAC5D,CAAA;IAEM,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;QAE7C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,oBAAoB,EAAE,GAAG,EAAE,CACjE,WAAW,CAAC,IAAI,CAA4C;YAC1D,QAAQ,EAAE,iBAAiB,CAAC,IAAI,CAAC,EAAE,CAAC;YACpC,MAAM,EAAE,KAAK;SACd,CAAC,CACH,CAAA;QACD,MAAM,SAAS,GAAG,wBAAwB,CAAC,QAAQ,CAAC,CAAA;QAEpD,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,CAAC,GAAG,CAAC,qBAAqB,CAAC,SAAS,CAAC,CAAC,CAAA;QAC5C,CAAC,CAAC,CAAA;QAEF,OAAO,SAAS,CAAA;IAClB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../../lib/agentia-command.js';
|
|
2
|
+
import { type Promotion } from '../../lib/promotion-types.js';
|
|
3
|
+
export declare const PROMOTION_TABLE_DISPLAY_LIMIT = 100;
|
|
4
|
+
export declare function selectPromotionsForTableDisplay(promotions: Promotion[]): {
|
|
5
|
+
displayed: Promotion[];
|
|
6
|
+
total: number;
|
|
7
|
+
truncated: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare function formatPromotionTableTruncationMessage(total: number): string;
|
|
10
|
+
export default class PromotionList extends AgentiaCommand {
|
|
11
|
+
static description: string;
|
|
12
|
+
static examples: string[];
|
|
13
|
+
static flags: {
|
|
14
|
+
readonly 'created-by-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
readonly 'created-by-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
readonly 'destination-environment-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
readonly 'destination-environment-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
readonly 'is-back-promotion': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
19
|
+
readonly limit: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
|
+
readonly name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
readonly 'pipeline-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
readonly 'pipeline-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
readonly 'project-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
24
|
+
readonly 'project-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
25
|
+
readonly 'source-environment-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
26
|
+
readonly 'source-environment-name': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
27
|
+
readonly status: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
28
|
+
};
|
|
29
|
+
run(): Promise<Promotion[]>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../../lib/agentia-command.js';
|
|
2
|
+
import { CicdGateway } from '../../lib/cicd-gateway.js';
|
|
3
|
+
import { buildPromotionListFilters, promotionListFilterFlags } from '../../lib/promotion-flags.js';
|
|
4
|
+
import { formatPromotionTable, normalizePromotions, promotionListEndpoint, } from '../../lib/promotion-types.js';
|
|
5
|
+
export const PROMOTION_TABLE_DISPLAY_LIMIT = 100;
|
|
6
|
+
export function selectPromotionsForTableDisplay(promotions) {
|
|
7
|
+
const total = promotions.length;
|
|
8
|
+
const truncated = total > PROMOTION_TABLE_DISPLAY_LIMIT;
|
|
9
|
+
return {
|
|
10
|
+
displayed: truncated ? promotions.slice(0, PROMOTION_TABLE_DISPLAY_LIMIT) : promotions,
|
|
11
|
+
total,
|
|
12
|
+
truncated,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export function formatPromotionTableTruncationMessage(total) {
|
|
16
|
+
return `Showing first ${PROMOTION_TABLE_DISPLAY_LIMIT} of ${total} promotions.`;
|
|
17
|
+
}
|
|
18
|
+
export default class PromotionList extends AgentiaCommand {
|
|
19
|
+
static description = 'List Copado promotions';
|
|
20
|
+
static examples = [
|
|
21
|
+
'<%= config.bin %> <%= command.id %>',
|
|
22
|
+
'<%= config.bin %> <%= command.id %> --status Completed --project-name "My Project" --limit 50',
|
|
23
|
+
'<%= config.bin %> <%= command.id %> --json',
|
|
24
|
+
];
|
|
25
|
+
static flags = promotionListFilterFlags;
|
|
26
|
+
async run() {
|
|
27
|
+
const { flags } = await this.parse(PromotionList);
|
|
28
|
+
const filters = buildPromotionListFilters(flags);
|
|
29
|
+
const response = await this.withSpinner('Fetching promotions', () => CicdGateway.call({
|
|
30
|
+
endpoint: promotionListEndpoint(filters),
|
|
31
|
+
method: 'GET',
|
|
32
|
+
}));
|
|
33
|
+
const promotions = normalizePromotions(response);
|
|
34
|
+
this.display(() => {
|
|
35
|
+
if (promotions.length === 0) {
|
|
36
|
+
this.log('No promotions found.');
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const { displayed, total, truncated } = selectPromotionsForTableDisplay(promotions);
|
|
40
|
+
if (truncated) {
|
|
41
|
+
this.log(formatPromotionTableTruncationMessage(total));
|
|
42
|
+
}
|
|
43
|
+
this.log(formatPromotionTable(displayed));
|
|
44
|
+
});
|
|
45
|
+
return promotions;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/promotion/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAC,yBAAyB,EAAE,wBAAwB,EAAC,MAAM,8BAA8B,CAAA;AAChG,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EAEnB,qBAAqB,GAEtB,MAAM,8BAA8B,CAAA;AAErC,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAG,CAAA;AAEhD,MAAM,UAAU,+BAA+B,CAAC,UAAuB;IAKrE,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAA;IAC/B,MAAM,SAAS,GAAG,KAAK,GAAG,6BAA6B,CAAA;IAEvD,OAAO;QACL,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,6BAA6B,CAAC,CAAC,CAAC,CAAC,UAAU;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,CAAC,CAAA;QAC3C,CAAC,CAAC,CAAA;QAEF,OAAO,UAAU,CAAA;IACnB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AgentiaCommand } from '../../lib/agentia-command.js';
|
|
2
|
+
import { type User } from '../../lib/user-types.js';
|
|
3
|
+
export default class UserGet extends AgentiaCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
id: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<User>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
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';
|
|
5
|
+
export default class UserGet extends AgentiaCommand {
|
|
6
|
+
static description = 'Get a Copado user by ID (defaults to the authenticated user)';
|
|
7
|
+
static examples = [
|
|
8
|
+
'<%= config.bin %> <%= command.id %>',
|
|
9
|
+
'<%= config.bin %> <%= command.id %> --id me',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --id 005000000000000',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --json',
|
|
12
|
+
];
|
|
13
|
+
static flags = {
|
|
14
|
+
id: Flags.string({
|
|
15
|
+
default: DEFAULT_USER_ID,
|
|
16
|
+
description: 'User ID, or "me" for the authenticated user',
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
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
|
+
}));
|
|
26
|
+
this.display(() => {
|
|
27
|
+
this.log(formatUserDetail(user));
|
|
28
|
+
});
|
|
29
|
+
return user;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../src/commands/user/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAA;AAC3D,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAC,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAa,YAAY,EAAC,MAAM,yBAAyB,CAAA;AAEjH,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,cAAc;IACjD,MAAM,CAAU,WAAW,GAAG,8DAA8D,CAAA;IAC5F,MAAM,CAAU,QAAQ,GAAG;QACzB,qCAAqC;QACrC,6CAA6C;QAC7C,0DAA0D;QAC1D,4CAA4C;KAC7C,CAAA;IACD,MAAM,CAAU,KAAK,GAAG;QACtB,EAAE,EAAE,KAAK,CAAC,MAAM,CAAC;YACf,OAAO,EAAE,eAAe;YACxB,WAAW,EAAE,6CAA6C;SAC3D,CAAC;KACH,CAAA;IAEM,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QACzC,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;QAEtC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,eAAe,EAAE,GAAG,EAAE,CACxD,WAAW,CAAC,IAAI,CAAO;YACrB,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC;YAC9B,MAAM,EAAE,KAAK;SACd,CAAC,CACH,CAAA;QAED,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAA;QAClC,CAAC,CAAC,CAAA;QAEF,OAAO,IAAI,CAAA;IACb,CAAC"}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
import { type EnvironmentMutationPayload } from './environment-types.js';
|
|
1
|
+
import { type EnvironmentListFilters, type EnvironmentMutationPayload } from './environment-types.js';
|
|
2
2
|
export declare const environmentPlatformFlag: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
3
3
|
export declare const environmentTypeFlag: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
4
4
|
export declare const environmentCreateTypeFlag: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
5
|
+
export declare const environmentListFilterFlags: {
|
|
6
|
+
readonly name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
readonly 'org-id': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
readonly platform: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
readonly type: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
};
|
|
11
|
+
export type EnvironmentListFilterFlagValues = {
|
|
12
|
+
[K in keyof typeof environmentListFilterFlags]?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function buildEnvironmentListFilters(flags: EnvironmentListFilterFlagValues): EnvironmentListFilters;
|
|
5
15
|
export declare const environmentMutationStringFlags: {
|
|
6
16
|
readonly 'apex-test-level': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
17
|
readonly name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -13,6 +13,35 @@ export const environmentCreateTypeFlag = Flags.string({
|
|
|
13
13
|
description: 'Environment type',
|
|
14
14
|
options: [...ENVIRONMENT_TYPES],
|
|
15
15
|
});
|
|
16
|
+
export const environmentListFilterFlags = {
|
|
17
|
+
name: Flags.string({
|
|
18
|
+
description: 'Filter by name',
|
|
19
|
+
}),
|
|
20
|
+
'org-id': Flags.string({
|
|
21
|
+
description: 'Filter by Salesforce org ID',
|
|
22
|
+
}),
|
|
23
|
+
platform: Flags.string({
|
|
24
|
+
description: 'Filter by platform',
|
|
25
|
+
}),
|
|
26
|
+
type: environmentTypeFlag,
|
|
27
|
+
};
|
|
28
|
+
const ENVIRONMENT_LIST_FILTER_FLAG_TO_KEY = {
|
|
29
|
+
name: 'name',
|
|
30
|
+
'org-id': 'orgId',
|
|
31
|
+
platform: 'platform',
|
|
32
|
+
type: 'type',
|
|
33
|
+
};
|
|
34
|
+
export function buildEnvironmentListFilters(flags) {
|
|
35
|
+
const filters = {};
|
|
36
|
+
for (const flagKey of Object.keys(ENVIRONMENT_LIST_FILTER_FLAG_TO_KEY)) {
|
|
37
|
+
const value = flags[flagKey];
|
|
38
|
+
if (typeof value === 'string') {
|
|
39
|
+
const filterKey = ENVIRONMENT_LIST_FILTER_FLAG_TO_KEY[flagKey];
|
|
40
|
+
Object.assign(filters, { [filterKey]: value });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return filters;
|
|
44
|
+
}
|
|
16
45
|
export const environmentMutationStringFlags = {
|
|
17
46
|
'apex-test-level': Flags.string({
|
|
18
47
|
description: 'Apex test level',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment-flags.js","sourceRoot":"","sources":["../../src/lib/environment-flags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,iBA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AC,GAAG,CAAC,CAAA;QAE1B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3D,OAAO,GAAG,GAAG,wBAAwB,CAAA;QACvC,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC"}
|
|
@@ -65,6 +65,14 @@ export type EnvironmentMutationPayload = {
|
|
|
65
65
|
type?: string;
|
|
66
66
|
validationPromotionDefaultCredential?: string;
|
|
67
67
|
};
|
|
68
|
+
export type EnvironmentListFilters = {
|
|
69
|
+
name?: string;
|
|
70
|
+
orgId?: string;
|
|
71
|
+
platform?: string;
|
|
72
|
+
type?: string;
|
|
73
|
+
};
|
|
74
|
+
export declare const ENVIRONMENT_LIST_FILTER_KEYS: readonly ["name", "orgId", "platform", "type"];
|
|
75
|
+
export declare function environmentsListEndpoint(filters?: EnvironmentListFilters): string;
|
|
68
76
|
export declare function environmentEndpoint(id: string): string;
|
|
69
77
|
export declare function environmentCredentialAuthUrlEndpoint(environmentId: string, credentialId: string, redirectUrl: string): string;
|
|
70
78
|
export declare function environmentCredentialValidateEndpoint(environmentId: string, credentialId: string): string;
|
|
@@ -3,6 +3,24 @@ import { normalizeSalesforceId } from './salesforce-id.js';
|
|
|
3
3
|
export const ENVIRONMENT_TYPES = ['Production/Developer', 'Sandbox', 'Scratch Org', 'Custom Domain'];
|
|
4
4
|
export const DEFAULT_ENVIRONMENT_PLATFORM = 'SFDX';
|
|
5
5
|
export const DEFAULT_ENVIRONMENT_TYPE = 'Production/Developer';
|
|
6
|
+
export const ENVIRONMENT_LIST_FILTER_KEYS = ['name', 'orgId', 'platform', 'type'];
|
|
7
|
+
const ENVIRONMENT_LIST_FILTER_QUERY_PARAM = {
|
|
8
|
+
name: 'name',
|
|
9
|
+
orgId: 'orgid',
|
|
10
|
+
platform: 'platform',
|
|
11
|
+
type: 'type',
|
|
12
|
+
};
|
|
13
|
+
export function environmentsListEndpoint(filters = {}) {
|
|
14
|
+
const params = new URLSearchParams();
|
|
15
|
+
for (const key of ENVIRONMENT_LIST_FILTER_KEYS) {
|
|
16
|
+
const value = filters[key];
|
|
17
|
+
if (value !== undefined) {
|
|
18
|
+
params.set(ENVIRONMENT_LIST_FILTER_QUERY_PARAM[key], value);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
const query = params.toString();
|
|
22
|
+
return query.length > 0 ? `/corpus/environments?${query}` : '/corpus/environments';
|
|
23
|
+
}
|
|
6
24
|
export function environmentEndpoint(id) {
|
|
7
25
|
return `/corpus/environments/${normalizeSalesforceId(id)}`;
|
|
8
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment-types.js","sourceRoot":"","sources":["../../src/lib/environment-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAA;AACrC,OAAO,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAA;AAExD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,sBAAsB,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,CAAU,CAAA;AAI7G,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAA;AAClD,MAAM,CAAC,MAAM,wBAAwB,GAAoB,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"environment-types.js","sourceRoot":"","sources":["../../src/lib/environment-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAA;AACrC,OAAO,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAA;AAExD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,sBAAsB,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,CAAU,CAAA;AAI7G,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAA;AAClD,MAAM,CAAC,MAAM,wBAAwB,GAAoB,sBAAsB,CAAA;AA4E/E,MAAM,CAAC,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SAAS,CAAC,EAAE;QAChD,oBAAoB,SAAS,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE;QAC1D,oBAAoB,SAAS,CAAC,WAAW,CAAC,aAAa,CAAC,EAAE;QAC1D,wBAAwB,SAAS,CAAC,WAAW,CAAC,iBAAiB,CAAC,EAAE;QAClE,iCAAiC,SAAS,CAAC,WAAW,CAAC,0BAA0B,CAAC,EAAE;QACpF,4CAA4C,SAAS,CAAC,WAAW,CAAC,oCAAoC,CAAC,EAAE;QACzG,kCAAkC,SAAS,CAAC,WAAW,CAAC,0BAA0B,CAAC,EAAE;QACrF,oBAAoB,SAAS,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE;QAC3D,eAAe,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE;QACjD,iBAAiB,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE;QACrD,qBAAqB,SAAS,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE;QAC5D,uBAAuB,SAAS,CAAC,WAAW,CAAC,gBAAgB,CAAC,EAAE;QAChE,sBAAsB,SAAS,CAAC,WAAW,CAAC,eAAe,CAAC,EAAE;KAC/D,CAAA;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC"}
|
package/dist/lib/mcp/tools.d.ts
CHANGED
|
@@ -4,6 +4,9 @@ import { type JobListFilters } from '../job-types.js';
|
|
|
4
4
|
import { type ComparisonMode, type ContentSource, type DependencyResult, type IndexSearchResult, type IndexSource, type MetadataContentResult, type ModuleType, type OrderDirection, type PlatformExperience, type RetrieveMode } from '../metadata-common.js';
|
|
5
5
|
import { type PipelineConnection, type PipelineDescribe } from '../pipeline-types.js';
|
|
6
6
|
import { type ProjectDefaultScope } from '../project-defaults.js';
|
|
7
|
+
import { type Project } from '../project-types.js';
|
|
8
|
+
import { type PromotionDetail, type PromotionListFilters } from '../promotion-types.js';
|
|
9
|
+
import { type User } from '../user-types.js';
|
|
7
10
|
import { type UserStory, type UserStoryMutationPayload, type WorkListFilters } from '../work-types.js';
|
|
8
11
|
type EnvironmentCreateArgs = {
|
|
9
12
|
apexTestLevel?: string;
|
|
@@ -143,6 +146,10 @@ type WorkDeleteArgs = {
|
|
|
143
146
|
};
|
|
144
147
|
declare function environmentList(args?: {
|
|
145
148
|
limit?: number;
|
|
149
|
+
name?: string;
|
|
150
|
+
orgId?: string;
|
|
151
|
+
platform?: string;
|
|
152
|
+
type?: string;
|
|
146
153
|
}): Promise<{
|
|
147
154
|
environments: Environment[];
|
|
148
155
|
}>;
|
|
@@ -151,6 +158,15 @@ declare function environmentGet(args: {
|
|
|
151
158
|
}): Promise<{
|
|
152
159
|
environment: Environment;
|
|
153
160
|
}>;
|
|
161
|
+
type PromotionListArgs = PromotionListFilters;
|
|
162
|
+
declare function promotionList(args?: PromotionListArgs): Promise<{
|
|
163
|
+
promotions: import("../promotion-types.js").Promotion[];
|
|
164
|
+
}>;
|
|
165
|
+
declare function promotionGet(args: {
|
|
166
|
+
id: string;
|
|
167
|
+
}): Promise<{
|
|
168
|
+
promotion: PromotionDetail;
|
|
169
|
+
}>;
|
|
154
170
|
declare function environmentCreate(args: EnvironmentCreateArgs): Promise<{
|
|
155
171
|
environment: Environment;
|
|
156
172
|
}>;
|
|
@@ -188,6 +204,16 @@ declare function pipelineConnectionList(args: PipelineHeaderArgs & {
|
|
|
188
204
|
}): Promise<{
|
|
189
205
|
connections: PipelineConnection[];
|
|
190
206
|
}>;
|
|
207
|
+
declare function projectList(args?: {
|
|
208
|
+
mine?: boolean;
|
|
209
|
+
}): Promise<{
|
|
210
|
+
projects: Project[];
|
|
211
|
+
}>;
|
|
212
|
+
declare function userGet(args?: {
|
|
213
|
+
id?: string;
|
|
214
|
+
}): Promise<{
|
|
215
|
+
user: User;
|
|
216
|
+
}>;
|
|
191
217
|
declare function projectDefaultGet(args?: ProjectDefaultGetArgs): Promise<{
|
|
192
218
|
defaults: import("../project-defaults.js").ResolvedProjectDefault[];
|
|
193
219
|
scope: "global" | "effective";
|
|
@@ -262,6 +288,10 @@ export declare const agentiaMcpToolHandlers: {
|
|
|
262
288
|
projectDefaultGet: typeof projectDefaultGet;
|
|
263
289
|
projectDefaultSet: typeof projectDefaultSet;
|
|
264
290
|
projectDefaultUnset: typeof projectDefaultUnset;
|
|
291
|
+
projectList: typeof projectList;
|
|
292
|
+
promotionGet: typeof promotionGet;
|
|
293
|
+
promotionList: typeof promotionList;
|
|
294
|
+
userGet: typeof userGet;
|
|
265
295
|
workCreate: typeof workCreate;
|
|
266
296
|
workDelete: typeof workDelete;
|
|
267
297
|
workGet: typeof workGet;
|
package/dist/lib/mcp/tools.js
CHANGED
|
@@ -8,14 +8,17 @@ import { assertRequired } from '../assert.js';
|
|
|
8
8
|
import { CicdGateway } from '../cicd-gateway.js';
|
|
9
9
|
import { readDefaults, resolveDefaults, unsetDefaults, writeDefaults } from '../defaults-store.js';
|
|
10
10
|
import { buildCreatePayload, buildMutationPayload, ENVIRONMENT_STRING_VALIDATION_KEYS, validateNonEmptyStringFields, } from '../environment-flags.js';
|
|
11
|
-
import { DEFAULT_ENVIRONMENT_PLATFORM, DEFAULT_ENVIRONMENT_TYPE, ENVIRONMENT_TYPES, environmentEndpoint, } from '../environment-types.js';
|
|
11
|
+
import { DEFAULT_ENVIRONMENT_PLATFORM, DEFAULT_ENVIRONMENT_TYPE, ENVIRONMENT_TYPES, environmentEndpoint, environmentsListEndpoint, } from '../environment-types.js';
|
|
12
12
|
import { JOB_LIST_LIMIT_MAX, JOB_LIST_LIMIT_MIN, jobEndpoint, jobKillEndpoint, jobListEndpoint, jobPauseEndpoint, jobResumeEndpoint, jobRunEndpoint, normalizeJob, normalizeJobOperation, normalizeJobs, } from '../job-types.js';
|
|
13
13
|
import { COMPARISON_MODES, CONTENT_SOURCES, contentResultToCompareSide, createUnifiedDiff, INDEX_SOURCES, MODULE_TYPES, ORDER_DIRECTIONS, PLATFORM_EXPERIENCES, RETRIEVE_MODES, sourceSideLabel, } from '../metadata-common.js';
|
|
14
14
|
import { pipelineHeaders } from '../pipeline-flags.js';
|
|
15
15
|
import { normalizePipelineDescribe, normalizePipelines, pipelineConnectionsFromPipelines, pipelineDescribeEndpoint, pipelineListEndpoint, } from '../pipeline-types.js';
|
|
16
16
|
import { buildSetValues, collectSelectedKeys } from '../project-default-flags.js';
|
|
17
17
|
import { PROJECT_DEFAULT_KEYS } from '../project-defaults.js';
|
|
18
|
+
import { normalizeProjects, projectsListEndpoint } from '../project-types.js';
|
|
19
|
+
import { normalizePromotionDetail, normalizePromotions, PROMOTION_LIST_LIMIT_MAX, PROMOTION_LIST_LIMIT_MIN, promotionEndpoint, promotionListEndpoint, } from '../promotion-types.js';
|
|
18
20
|
import { getUserContext } from '../user-context.js';
|
|
21
|
+
import { DEFAULT_USER_ID, resolveUserId, userEndpoint } from '../user-types.js';
|
|
19
22
|
import { buildWorkCreatePayload } from '../work-defaults.js';
|
|
20
23
|
import { validateNonEmptyStringFields as validateWorkNonEmptyStringFields, WORK_STRING_VALIDATION_KEYS, } from '../work-flags.js';
|
|
21
24
|
import { normalizeUserStories, workCreateEndpoint, workEndpoint, workListEndpoint, } from '../work-types.js';
|
|
@@ -60,8 +63,21 @@ function buildWorkMutationPayloadFromArgs(args) {
|
|
|
60
63
|
return payload;
|
|
61
64
|
}
|
|
62
65
|
async function environmentList(args = {}) {
|
|
66
|
+
const filters = {};
|
|
67
|
+
if (args.name !== undefined) {
|
|
68
|
+
filters.name = args.name;
|
|
69
|
+
}
|
|
70
|
+
if (args.orgId !== undefined) {
|
|
71
|
+
filters.orgId = args.orgId;
|
|
72
|
+
}
|
|
73
|
+
if (args.platform !== undefined) {
|
|
74
|
+
filters.platform = args.platform;
|
|
75
|
+
}
|
|
76
|
+
if (args.type !== undefined) {
|
|
77
|
+
filters.type = args.type;
|
|
78
|
+
}
|
|
63
79
|
const response = await CicdGateway.call({
|
|
64
|
-
endpoint:
|
|
80
|
+
endpoint: environmentsListEndpoint(filters),
|
|
65
81
|
method: 'GET',
|
|
66
82
|
});
|
|
67
83
|
const environments = normalizeEnvironments(response);
|
|
@@ -75,6 +91,20 @@ async function environmentGet(args) {
|
|
|
75
91
|
});
|
|
76
92
|
return { environment };
|
|
77
93
|
}
|
|
94
|
+
async function promotionList(args = {}) {
|
|
95
|
+
const response = await CicdGateway.call({
|
|
96
|
+
endpoint: promotionListEndpoint(args),
|
|
97
|
+
method: 'GET',
|
|
98
|
+
});
|
|
99
|
+
return { promotions: normalizePromotions(response) };
|
|
100
|
+
}
|
|
101
|
+
async function promotionGet(args) {
|
|
102
|
+
const response = await CicdGateway.call({
|
|
103
|
+
endpoint: promotionEndpoint(assertRequired(args.id, 'id')),
|
|
104
|
+
method: 'GET',
|
|
105
|
+
});
|
|
106
|
+
return { promotion: normalizePromotionDetail(response) };
|
|
107
|
+
}
|
|
78
108
|
async function environmentCreate(args) {
|
|
79
109
|
const payload = buildCreatePayload(args.name, {
|
|
80
110
|
'apex-test-level': args.apexTestLevel,
|
|
@@ -246,6 +276,20 @@ async function pipelineConnectionList(args) {
|
|
|
246
276
|
}
|
|
247
277
|
return { connections };
|
|
248
278
|
}
|
|
279
|
+
async function projectList(args = {}) {
|
|
280
|
+
const response = await CicdGateway.call({
|
|
281
|
+
endpoint: projectsListEndpoint(args.mine ? { mine: true } : {}),
|
|
282
|
+
method: 'GET',
|
|
283
|
+
});
|
|
284
|
+
return { projects: normalizeProjects(response) };
|
|
285
|
+
}
|
|
286
|
+
async function userGet(args = {}) {
|
|
287
|
+
const user = await CicdGateway.call({
|
|
288
|
+
endpoint: userEndpoint(resolveUserId(args.id)),
|
|
289
|
+
method: 'GET',
|
|
290
|
+
});
|
|
291
|
+
return { user };
|
|
292
|
+
}
|
|
249
293
|
async function projectDefaultGet(args = {}) {
|
|
250
294
|
const keys = collectSelectedKeys(args);
|
|
251
295
|
const selected = keys.length > 0 ? keys : [...PROJECT_DEFAULT_KEYS];
|
|
@@ -562,6 +606,10 @@ export const agentiaMcpToolHandlers = {
|
|
|
562
606
|
projectDefaultGet,
|
|
563
607
|
projectDefaultSet,
|
|
564
608
|
projectDefaultUnset,
|
|
609
|
+
projectList,
|
|
610
|
+
promotionGet,
|
|
611
|
+
promotionList,
|
|
612
|
+
userGet,
|
|
565
613
|
workCreate,
|
|
566
614
|
workDelete,
|
|
567
615
|
workGet,
|
|
@@ -578,10 +626,7 @@ const environmentMutationSchema = {
|
|
|
578
626
|
runLocalTests: z.boolean().optional().describe('Run local tests.'),
|
|
579
627
|
runSpecifiedTests: z.string().optional().describe('Specified tests to run.'),
|
|
580
628
|
type: z.enum(ENVIRONMENT_TYPES).optional().describe('Environment type.'),
|
|
581
|
-
validationPromotionDefaultCredential: z
|
|
582
|
-
.string()
|
|
583
|
-
.optional()
|
|
584
|
-
.describe('Default credential for validation promotions.'),
|
|
629
|
+
validationPromotionDefaultCredential: z.string().optional().describe('Default credential for validation promotions.'),
|
|
585
630
|
};
|
|
586
631
|
const pipelineHeaderSchema = {
|
|
587
632
|
organizationId: z.string().describe('Organization Id for the x-organization-id gateway header.'),
|
|
@@ -625,6 +670,28 @@ const workMutationSchema = {
|
|
|
625
670
|
title: z.string().optional().describe('Title.'),
|
|
626
671
|
wantTo: z.string().optional().describe('User story "want to" clause.'),
|
|
627
672
|
};
|
|
673
|
+
const promotionListSchema = {
|
|
674
|
+
createdById: z.string().optional().describe('Filter by creator ID.'),
|
|
675
|
+
createdByName: z.string().optional().describe('Filter by creator name.'),
|
|
676
|
+
destinationEnvironmentId: z.string().optional().describe('Filter by destination environment ID.'),
|
|
677
|
+
destinationEnvironmentName: z.string().optional().describe('Filter by destination environment name.'),
|
|
678
|
+
isBackPromotion: z.boolean().optional().describe('Filter by back promotion.'),
|
|
679
|
+
limit: z
|
|
680
|
+
.number()
|
|
681
|
+
.int()
|
|
682
|
+
.min(PROMOTION_LIST_LIMIT_MIN)
|
|
683
|
+
.max(PROMOTION_LIST_LIMIT_MAX)
|
|
684
|
+
.optional()
|
|
685
|
+
.describe(`Maximum number of promotions to return (${PROMOTION_LIST_LIMIT_MIN}-${PROMOTION_LIST_LIMIT_MAX}).`),
|
|
686
|
+
name: z.string().optional().describe('Filter by name.'),
|
|
687
|
+
pipelineId: z.string().optional().describe('Filter by pipeline ID.'),
|
|
688
|
+
pipelineName: z.string().optional().describe('Filter by pipeline name.'),
|
|
689
|
+
projectId: z.string().optional().describe('Filter by project ID.'),
|
|
690
|
+
projectName: z.string().optional().describe('Filter by project name.'),
|
|
691
|
+
sourceEnvironmentId: z.string().optional().describe('Filter by source environment ID.'),
|
|
692
|
+
sourceEnvironmentName: z.string().optional().describe('Filter by source environment name.'),
|
|
693
|
+
status: z.string().optional().describe('Filter by status.'),
|
|
694
|
+
};
|
|
628
695
|
const workListSchema = {
|
|
629
696
|
assignedToMe: z.boolean().optional().describe('Filter by the current user as assignee.'),
|
|
630
697
|
assigneeId: z.string().optional().describe('Filter by assignee ID.'),
|
|
@@ -643,6 +710,10 @@ export function registerAgentiaMcpTools(server) {
|
|
|
643
710
|
description: 'List Copado environments via the CICD gateway.',
|
|
644
711
|
inputSchema: {
|
|
645
712
|
limit: z.number().int().min(1).max(MAX_LIMIT).optional().describe('Maximum number of environments to return.'),
|
|
713
|
+
name: z.string().optional().describe('Filter by name.'),
|
|
714
|
+
orgId: z.string().optional().describe('Filter by Salesforce org ID.'),
|
|
715
|
+
platform: z.string().optional().describe('Filter by platform.'),
|
|
716
|
+
type: z.string().optional().describe('Filter by environment type.'),
|
|
646
717
|
},
|
|
647
718
|
title: 'Agentia Environment List',
|
|
648
719
|
}, (args) => safelyHandleTool(() => environmentList(args || {})));
|
|
@@ -670,6 +741,18 @@ export function registerAgentiaMcpTools(server) {
|
|
|
670
741
|
},
|
|
671
742
|
title: 'Agentia Environment Update',
|
|
672
743
|
}, (args) => safelyHandleTool(() => environmentUpdate(args)));
|
|
744
|
+
server.registerTool('agentia_promotion_list', {
|
|
745
|
+
description: 'List Copado promotions via the CICD gateway.',
|
|
746
|
+
inputSchema: promotionListSchema,
|
|
747
|
+
title: 'Agentia Promotion List',
|
|
748
|
+
}, (args) => safelyHandleTool(() => promotionList(args || {})));
|
|
749
|
+
server.registerTool('agentia_promotion_get', {
|
|
750
|
+
description: 'Get a Copado promotion by Id via the CICD gateway.',
|
|
751
|
+
inputSchema: {
|
|
752
|
+
id: z.string().describe('Copado promotion Id.'),
|
|
753
|
+
},
|
|
754
|
+
title: 'Agentia Promotion Get',
|
|
755
|
+
}, (args) => safelyHandleTool(() => promotionGet(args)));
|
|
673
756
|
server.registerTool('agentia_job_list', {
|
|
674
757
|
description: 'List Copado job executions via the CICD gateway.',
|
|
675
758
|
inputSchema: {
|
|
@@ -752,6 +835,23 @@ export function registerAgentiaMcpTools(server) {
|
|
|
752
835
|
},
|
|
753
836
|
title: 'Agentia Pipeline Connection List',
|
|
754
837
|
}, (args) => safelyHandleTool(() => pipelineConnectionList(args)));
|
|
838
|
+
server.registerTool('agentia_project_list', {
|
|
839
|
+
description: 'List Copado projects via the CICD gateway.',
|
|
840
|
+
inputSchema: {
|
|
841
|
+
mine: z.boolean().optional().describe('When true, list only projects owned by or related to the current user.'),
|
|
842
|
+
},
|
|
843
|
+
title: 'Agentia Project List',
|
|
844
|
+
}, (args) => safelyHandleTool(() => projectList(args || {})));
|
|
845
|
+
server.registerTool('agentia_user_get', {
|
|
846
|
+
description: 'Get a Copado user by Id via the CICD gateway. Defaults to the authenticated user ("me").',
|
|
847
|
+
inputSchema: {
|
|
848
|
+
id: z
|
|
849
|
+
.string()
|
|
850
|
+
.optional()
|
|
851
|
+
.describe(`User Id, or "${DEFAULT_USER_ID}" for the authenticated user. Defaults to "${DEFAULT_USER_ID}".`),
|
|
852
|
+
},
|
|
853
|
+
title: 'Agentia User Get',
|
|
854
|
+
}, (args) => safelyHandleTool(() => userGet(args || {})));
|
|
755
855
|
server.registerTool('agentia_project_default_get', {
|
|
756
856
|
description: 'Show Agentia project default values for the current project or globally.',
|
|
757
857
|
inputSchema: projectSelectorSchema,
|
|
@@ -811,7 +911,10 @@ export function registerAgentiaMcpTools(server) {
|
|
|
811
911
|
server.registerTool('agentia_metadata_list', {
|
|
812
912
|
description: 'Search the Copado metadata index via the CICD gateway.',
|
|
813
913
|
inputSchema: {
|
|
814
|
-
avoidSourceTracking: z
|
|
914
|
+
avoidSourceTracking: z
|
|
915
|
+
.boolean()
|
|
916
|
+
.optional()
|
|
917
|
+
.describe('Pass avoidSourceTracking=true to the gateway index route.'),
|
|
815
918
|
filterType: z.string().optional().describe('Optional metadata type name filter, for example ApexClass.'),
|
|
816
919
|
findManagedPackages: z.boolean().optional().describe('Include managed package metadata in the search.'),
|
|
817
920
|
limit: z.number().int().min(1).max(MAX_LIMIT).optional().describe('Maximum number of records to return.'),
|