@copado/agentia-cli 0.74.0-alpha.0 → 0.75.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 +173 -161
- package/dist/commands/cicd/function/list.d.ts +4 -1
- package/dist/commands/cicd/function/list.js +15 -6
- package/dist/commands/cicd/function/list.js.map +1 -1
- package/dist/commands/cicd/repository/list.d.ts +4 -0
- package/dist/commands/cicd/repository/list.js +9 -3
- package/dist/commands/cicd/repository/list.js.map +1 -1
- package/dist/lib/function-types.d.ts +13 -2
- package/dist/lib/function-types.js +6 -7
- package/dist/lib/function-types.js.map +1 -1
- package/dist/lib/mcp/tools.d.ts +5 -8
- package/dist/lib/mcp/tools.js +8 -7
- package/dist/lib/mcp/tools.js.map +1 -1
- package/dist/lib/repository-flags.d.ts +4 -1
- package/dist/lib/repository-flags.js +5 -0
- package/dist/lib/repository-flags.js.map +1 -1
- package/dist/lib/repository-types.d.ts +3 -2
- package/dist/lib/repository-types.js +6 -3
- package/dist/lib/repository-types.js.map +1 -1
- package/oclif.manifest.json +143 -112
- package/package.json +1 -1
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
2
|
import { type CopadoFunction } from '../../../lib/function-types.js';
|
|
3
|
+
import { type PaginatedListResult } from '../../../lib/list-pagination.js';
|
|
3
4
|
export default class FunctionList extends AgentiaCommand {
|
|
4
5
|
static description: string;
|
|
5
6
|
static examples: string[];
|
|
6
7
|
static flags: {
|
|
7
8
|
type: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
cursor: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'page-size': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
11
|
};
|
|
9
|
-
run(): Promise<CopadoFunction
|
|
12
|
+
run(): Promise<PaginatedListResult<CopadoFunction>>;
|
|
10
13
|
}
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { Flags } from '@oclif/core';
|
|
2
2
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
3
3
|
import { CicdGateway } from '../../../lib/cicd-gateway.js';
|
|
4
|
-
import { formatFunctionTable, FUNCTION_LIST_TYPES, functionsEndpoint,
|
|
4
|
+
import { formatFunctionTable, FUNCTION_LIST_TYPES, functionsEndpoint, normalizeFunctionsListPage, } from '../../../lib/function-types.js';
|
|
5
|
+
import { buildListPaginationQuery, displayListPagination, listPaginationFlags, } from '../../../lib/list-pagination.js';
|
|
5
6
|
export default class FunctionList extends AgentiaCommand {
|
|
6
7
|
static description = 'List Copado Functions';
|
|
7
8
|
static examples = [
|
|
8
9
|
'<%= config.bin %> <%= command.id %>',
|
|
9
10
|
'<%= config.bin %> <%= command.id %> --type all',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --page-size 50',
|
|
12
|
+
'<%= config.bin %> <%= command.id %> --cursor NEXT --json',
|
|
10
13
|
'<%= config.bin %> <%= command.id %> --json',
|
|
11
14
|
];
|
|
12
15
|
static flags = {
|
|
16
|
+
...listPaginationFlags,
|
|
13
17
|
type: Flags.string({
|
|
14
18
|
default: 'custom',
|
|
15
19
|
description: 'List Custom functions only, or all functions',
|
|
@@ -18,19 +22,24 @@ export default class FunctionList extends AgentiaCommand {
|
|
|
18
22
|
};
|
|
19
23
|
async run() {
|
|
20
24
|
const { flags } = await this.parse(FunctionList);
|
|
25
|
+
const pagination = buildListPaginationQuery(flags);
|
|
21
26
|
const response = await this.withSpinner('Fetching functions', () => CicdGateway.call({
|
|
22
|
-
endpoint: functionsEndpoint({
|
|
27
|
+
endpoint: functionsEndpoint({
|
|
28
|
+
...pagination,
|
|
29
|
+
type: flags.type,
|
|
30
|
+
}),
|
|
23
31
|
method: 'GET',
|
|
24
32
|
}));
|
|
25
|
-
const
|
|
33
|
+
const page = normalizeFunctionsListPage(response);
|
|
26
34
|
this.display(() => {
|
|
27
|
-
if (
|
|
35
|
+
if (page.data.length === 0) {
|
|
28
36
|
this.log('No functions found.');
|
|
29
37
|
return;
|
|
30
38
|
}
|
|
31
|
-
this.log(formatFunctionTable(
|
|
39
|
+
this.log(formatFunctionTable(page.data));
|
|
40
|
+
displayListPagination(this.log.bind(this), page);
|
|
32
41
|
});
|
|
33
|
-
return
|
|
42
|
+
return page;
|
|
34
43
|
}
|
|
35
44
|
}
|
|
36
45
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/cicd/function/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAEL,mBAAmB,EACnB,mBAAmB,EAEnB,iBAAiB,EAEjB,
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/cicd/function/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAEjC,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAEL,mBAAmB,EACnB,mBAAmB,EAEnB,iBAAiB,EAEjB,0BAA0B,GAC3B,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,GAEpB,MAAM,iCAAiC,CAAA;AAExC,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,cAAc;IACtD,MAAM,CAAU,WAAW,GAAG,uBAAuB,CAAA;IACrD,MAAM,CAAU,QAAQ,GAAG;QACzB,qCAAqC;QACrC,gDA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|
|
|
4
4
|
export default class RepositoryList extends AgentiaCommand {
|
|
5
5
|
static description: string;
|
|
6
6
|
static examples: string[];
|
|
7
|
+
static flags: {
|
|
8
|
+
readonly cursor: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
readonly 'page-size': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
};
|
|
7
11
|
run(): Promise<PaginatedListResult<GitRepository>>;
|
|
8
12
|
}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { AgentiaCommand } from '../../../lib/agentia-command.js';
|
|
2
2
|
import { CicdGateway } from '../../../lib/cicd-gateway.js';
|
|
3
3
|
import { displayListPagination } from '../../../lib/list-pagination.js';
|
|
4
|
+
import { buildRepositoryListQuery, repositoryListFlags } from '../../../lib/repository-flags.js';
|
|
4
5
|
import { formatRepositoryTable, normalizeRepositoriesListPage, repositoriesEndpoint, } from '../../../lib/repository-types.js';
|
|
5
6
|
export default class RepositoryList extends AgentiaCommand {
|
|
6
7
|
static description = 'List Copado Git repositories';
|
|
7
|
-
static examples = [
|
|
8
|
+
static examples = [
|
|
9
|
+
'<%= config.bin %> <%= command.id %>',
|
|
10
|
+
'<%= config.bin %> <%= command.id %> --page-size 50',
|
|
11
|
+
'<%= config.bin %> <%= command.id %> --cursor NEXT --json',
|
|
12
|
+
];
|
|
13
|
+
static flags = repositoryListFlags;
|
|
8
14
|
async run() {
|
|
9
|
-
await this.parse(RepositoryList);
|
|
15
|
+
const { flags } = await this.parse(RepositoryList);
|
|
10
16
|
const response = await this.withSpinner('Fetching repositories', () => CicdGateway.call({
|
|
11
|
-
endpoint: repositoriesEndpoint(),
|
|
17
|
+
endpoint: repositoriesEndpoint(buildRepositoryListQuery(flags)),
|
|
12
18
|
method: 'GET',
|
|
13
19
|
}));
|
|
14
20
|
const page = normalizeRepositoriesListPage(response);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/cicd/repository/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAC,qBAAqB,EAA2B,MAAM,iCAAiC,CAAA;AAC/F,OAAO,EACL,qBAAqB,EAErB,6BAA6B,EAC7B,oBAAoB,GAErB,MAAM,kCAAkC,CAAA;AAEzC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,cAAc;IACxD,MAAM,CAAU,WAAW,GAAG,8BAA8B,CAAA;IAC5D,MAAM,CAAU,QAAQ,GAAG,
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../../../src/commands/cicd/repository/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,iCAAiC,CAAA;AAC9D,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAC,qBAAqB,EAA2B,MAAM,iCAAiC,CAAA;AAC/F,OAAO,EAAC,wBAAwB,EAAE,mBAAmB,EAAC,MAAM,kCAAkC,CAAA;AAC9F,OAAO,EACL,qBAAqB,EAErB,6BAA6B,EAC7B,oBAAoB,GAErB,MAAM,kCAAkC,CAAA;AAEzC,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,cAAc;IACxD,MAAM,CAAU,WAAW,GAAG,8BAA8B,CAAA;IAC5D,MAAM,CAAU,QAAQ,GAAG;QACzB,qCAAqC;QACrC,oDAAoD;QACpD,0DAA0D;KAC3D,CAAA;IACD,MAAM,CAAU,KAAK,GAAG,mBAAmB,CAAA;IAEpC,KAAK,CAAC,GAAG;QACd,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;QAEhD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,uBAAuB,EAAE,GAAG,EAAE,CACpE,WAAW,CAAC,IAAI,CAA2B;YACzC,QAAQ,EAAE,oBAAoB,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;YAC/D,MAAM,EAAE,KAAK;SACd,CAAC,CACH,CAAA;QACD,MAAM,IAAI,GAAG,6BAA6B,CAAC,QAAQ,CAAC,CAAA;QAEpD,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;YAChB,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC3B,IAAI,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAA;gBAClC,OAAM;YACR,CAAC;YAED,IAAI,CAAC,GAAG,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAA;YAC1C,qBAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAA;QAClD,CAAC,CAAC,CAAA;QAEF,OAAO,IAAI,CAAA;IACb,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ListPaginationQuery, type PaginatedListResult } from './list-pagination.js';
|
|
1
2
|
export declare const FUNCTION_LIST_TYPES: readonly ["custom", "all"];
|
|
2
3
|
export type FunctionListType = (typeof FUNCTION_LIST_TYPES)[number];
|
|
3
4
|
export declare const FUNCTION_RUNTIMES: readonly ["bash", "node", "python"];
|
|
@@ -74,8 +75,17 @@ export type FunctionResultStatus = {
|
|
|
74
75
|
resultId: string;
|
|
75
76
|
status: string;
|
|
76
77
|
};
|
|
77
|
-
export type
|
|
78
|
+
export type FunctionsListPage = {
|
|
79
|
+
currentPage?: number;
|
|
78
80
|
data?: CopadoFunction[];
|
|
81
|
+
hasMore?: boolean;
|
|
82
|
+
nextCursor?: string;
|
|
83
|
+
pageSize?: number;
|
|
84
|
+
totalPages?: number;
|
|
85
|
+
totalRecords?: number;
|
|
86
|
+
};
|
|
87
|
+
export type FunctionsListResponse = CopadoFunction[] | FunctionsListPage | {
|
|
88
|
+
data?: CopadoFunction[] | FunctionsListPage;
|
|
79
89
|
};
|
|
80
90
|
export type FunctionResponse = CopadoFunction | {
|
|
81
91
|
data?: CopadoFunction;
|
|
@@ -86,7 +96,7 @@ export type FunctionRunResponse = FunctionRunResult | {
|
|
|
86
96
|
export type FunctionResultStatusResponse = FunctionResultStatus | {
|
|
87
97
|
data?: FunctionResultStatus;
|
|
88
98
|
};
|
|
89
|
-
export type FunctionListFilters = {
|
|
99
|
+
export type FunctionListFilters = ListPaginationQuery & {
|
|
90
100
|
type?: FunctionListType;
|
|
91
101
|
};
|
|
92
102
|
export declare function functionsEndpoint(filters?: FunctionListFilters): string;
|
|
@@ -95,6 +105,7 @@ export declare function functionRunEndpoint(apiName: string): string;
|
|
|
95
105
|
export declare function functionResultEndpoint(resultId: string): string;
|
|
96
106
|
export declare function functionResultLogEndpoint(resultId: string, fileType?: string): string;
|
|
97
107
|
export declare function normalizeFunctionUpsertPayload(apiNameValue: string, input: FunctionUpsertInput): FunctionUpsertPayload;
|
|
108
|
+
export declare function normalizeFunctionsListPage(response: FunctionsListResponse): PaginatedListResult<CopadoFunction>;
|
|
98
109
|
export declare function normalizeFunctionsList(response: FunctionsListResponse): CopadoFunction[];
|
|
99
110
|
export declare function normalizeFunction(response: FunctionResponse): CopadoFunction;
|
|
100
111
|
export declare function normalizeFunctionRunResult(response: FunctionRunResponse): FunctionRunResult;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cellValue, table } from './format.js';
|
|
2
|
+
import { appendListPaginationQueryParams, paginatedResultFromNestedData, } from './list-pagination.js';
|
|
2
3
|
export const FUNCTION_LIST_TYPES = ['custom', 'all'];
|
|
3
4
|
export const FUNCTION_RUNTIMES = ['bash', 'node', 'python'];
|
|
4
5
|
export const FUNCTION_EXTENSIONS = ['sh', 'js', 'py'];
|
|
@@ -12,6 +13,7 @@ export function functionsEndpoint(filters = {}) {
|
|
|
12
13
|
if (filters.type !== undefined) {
|
|
13
14
|
params.set('type', filters.type);
|
|
14
15
|
}
|
|
16
|
+
appendListPaginationQueryParams(params, filters);
|
|
15
17
|
const query = params.toString();
|
|
16
18
|
return query.length > 0 ? `/functions?${query}` : '/functions';
|
|
17
19
|
}
|
|
@@ -65,14 +67,11 @@ export function normalizeFunctionUpsertPayload(apiNameValue, input) {
|
|
|
65
67
|
version: input.version ?? '1',
|
|
66
68
|
};
|
|
67
69
|
}
|
|
70
|
+
export function normalizeFunctionsListPage(response) {
|
|
71
|
+
return paginatedResultFromNestedData(response);
|
|
72
|
+
}
|
|
68
73
|
export function normalizeFunctionsList(response) {
|
|
69
|
-
|
|
70
|
-
return response;
|
|
71
|
-
}
|
|
72
|
-
if (response.data !== undefined && Array.isArray(response.data)) {
|
|
73
|
-
return response.data;
|
|
74
|
-
}
|
|
75
|
-
return [];
|
|
74
|
+
return normalizeFunctionsListPage(response).data;
|
|
76
75
|
}
|
|
77
76
|
export function normalizeFunction(response) {
|
|
78
77
|
if ('data' in response && response.data !== undefined && typeof response.data === 'object' && !Array.isArray(response.data)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function-types.js","sourceRoot":"","sources":["../../src/lib/function-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"function-types.js","sourceRoot":"","sources":["../../src/lib/function-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AAC5C,OAAO,EACL,+BAA+B,EAG/B,6BAA6B,GAC9B,MAAM,sBAAsB,CAAA;AAE7B,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAU,CAAA;AAG7D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAU,CAAA;AAGpE,MAAM,CAAC,M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B,CAAC,CAAA;QAC9E,CAAC;QAED,UAAU,CAAC,GAAG,CAAC,GAAG,UAAU,CAAA;IAC9B,CAAC;IAED,OAAO,UAAU,CAAA;AACnB,CAAC"}
|
package/dist/lib/mcp/tools.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
2
2
|
import { type CicdRegion } from '../cicd-region.js';
|
|
3
3
|
import { type CredentialType } from '../credential-store.js';
|
|
4
4
|
import { type Environment, type EnvironmentListFilters } from '../environment-types.js';
|
|
5
|
-
import { type FunctionCreateDefaultsPayload, type
|
|
5
|
+
import { type FunctionCreateDefaultsPayload, type FunctionListFilters, type FunctionRunPayload, type FunctionRuntime, type FunctionUpsertInput } from '../function-types.js';
|
|
6
6
|
import { type JobListFilters } from '../job-types.js';
|
|
7
|
+
import { type ListPaginationQuery } from '../list-pagination.js';
|
|
7
8
|
import { type ComparisonMode, type ContentSource, type DependencyResult, type IndexSearchResult, type IndexSource, type MetadataContentResult, type ModuleType, type OrderDirection, type PlatformExperience, type RetrieveMode } from '../metadata-common.js';
|
|
8
9
|
import { type IndexRefreshResult, type RefreshDeletedMetadataIndexResult } from '../metadata-refresh.js';
|
|
9
10
|
import { NAVIGATION_RESOURCE_TYPES } from '../navigation.js';
|
|
@@ -242,7 +243,7 @@ declare function pipelineConnectionList(args: {
|
|
|
242
243
|
connections: PipelineConnection[];
|
|
243
244
|
}>;
|
|
244
245
|
declare function projectList(args?: ProjectListFilters): Promise<Record<string, unknown>>;
|
|
245
|
-
declare function repositoryList(): Promise<Record<string, unknown>>;
|
|
246
|
+
declare function repositoryList(args?: ListPaginationQuery): Promise<Record<string, unknown>>;
|
|
246
247
|
declare function repositoryGet(args: {
|
|
247
248
|
id: string;
|
|
248
249
|
}): Promise<{
|
|
@@ -270,11 +271,7 @@ declare function repositoryValidate(args: {
|
|
|
270
271
|
}): Promise<{
|
|
271
272
|
validation: RepositoryValidateResult;
|
|
272
273
|
}>;
|
|
273
|
-
declare function functionList(args?:
|
|
274
|
-
type?: FunctionListType;
|
|
275
|
-
}): Promise<{
|
|
276
|
-
functions: import("../function-types.js").CopadoFunction[];
|
|
277
|
-
}>;
|
|
274
|
+
declare function functionList(args?: FunctionListFilters): Promise<Record<string, unknown>>;
|
|
278
275
|
declare function functionGet(args: {
|
|
279
276
|
apiName: string;
|
|
280
277
|
}): Promise<{
|
|
@@ -532,7 +529,7 @@ export declare const agentiaMcpToolHandlers: {
|
|
|
532
529
|
}) => Promise<{
|
|
533
530
|
userStory: import("../work-types.js").UserStory;
|
|
534
531
|
}>;
|
|
535
|
-
workList: (args?:
|
|
532
|
+
workList: (args?: ListPaginationQuery & {
|
|
536
533
|
assigneeId?: string;
|
|
537
534
|
assigneeName?: string;
|
|
538
535
|
name?: string;
|
package/dist/lib/mcp/tools.js
CHANGED
|
@@ -17,7 +17,7 @@ import { createEnvironmentCredential, resolveEnvironmentOrgType, updateEnvironme
|
|
|
17
17
|
import { buildCreatePayload, buildMutationPayload, ENVIRONMENT_STRING_VALIDATION_KEYS, validateNonEmptyStringFields, } from '../environment-flags.js';
|
|
18
18
|
import { DEFAULT_ENVIRONMENT_PLATFORM, DEFAULT_ENVIRONMENT_TYPE, ENVIRONMENT_TYPES, environmentEndpoint, environmentsListEndpoint, } from '../environment-types.js';
|
|
19
19
|
import { executeLocalFunctionRun } from '../function-local-run.js';
|
|
20
|
-
import { FUNCTION_LIST_TYPES, FUNCTION_RUNTIMES, functionEndpoint, functionResultEndpoint, functionResultLogEndpoint, functionRunEndpoint, functionsEndpoint, normalizeFunction, normalizeFunctionResultStatus, normalizeFunctionRunResult,
|
|
20
|
+
import { FUNCTION_LIST_TYPES, FUNCTION_RUNTIMES, functionEndpoint, functionResultEndpoint, functionResultLogEndpoint, functionRunEndpoint, functionsEndpoint, normalizeFunction, normalizeFunctionResultStatus, normalizeFunctionRunResult, normalizeFunctionsListPage, normalizeFunctionUpsertPayload, } from '../function-types.js';
|
|
21
21
|
import { jobEndpoint, jobKillEndpoint, jobListEndpoint, jobPauseEndpoint, jobResultLogEndpoint, jobResumeEndpoint, jobRunEndpoint, normalizeJob, normalizeJobOperation, normalizeJobsListPage, resolveJobStepForLog, } from '../job-types.js';
|
|
22
22
|
import { listPaginationZodFields, mcpPaginatedListPayload } from '../list-pagination.js';
|
|
23
23
|
import { normalizeLocalGatewayBaseUrl, readLocalGatewayConfig } from '../local-gateway-config.js';
|
|
@@ -320,9 +320,9 @@ async function projectList(args = {}) {
|
|
|
320
320
|
});
|
|
321
321
|
return mcpPaginatedListPayload('projects', normalizeProjectsListPage(response));
|
|
322
322
|
}
|
|
323
|
-
async function repositoryList() {
|
|
323
|
+
async function repositoryList(args = {}) {
|
|
324
324
|
const response = await CicdGateway.call({
|
|
325
|
-
endpoint: repositoriesEndpoint(),
|
|
325
|
+
endpoint: repositoriesEndpoint(args),
|
|
326
326
|
method: 'GET',
|
|
327
327
|
});
|
|
328
328
|
return mcpPaginatedListPayload('repositories', normalizeRepositoriesListPage(response));
|
|
@@ -400,10 +400,10 @@ async function repositoryValidate(args) {
|
|
|
400
400
|
}
|
|
401
401
|
async function functionList(args = {}) {
|
|
402
402
|
const response = await CicdGateway.call({
|
|
403
|
-
endpoint: functionsEndpoint({ type: args.type ?? 'custom' }),
|
|
403
|
+
endpoint: functionsEndpoint({ ...args, type: args.type ?? 'custom' }),
|
|
404
404
|
method: 'GET',
|
|
405
405
|
});
|
|
406
|
-
return
|
|
406
|
+
return mcpPaginatedListPayload('functions', normalizeFunctionsListPage(response));
|
|
407
407
|
}
|
|
408
408
|
async function functionGet(args) {
|
|
409
409
|
const response = await CicdGateway.call({
|
|
@@ -1362,9 +1362,9 @@ export function registerAgentiaMcpTools(server) {
|
|
|
1362
1362
|
}, (args) => safelyHandleTool(() => projectGet(args)));
|
|
1363
1363
|
server.registerTool('agentia_repository_list', {
|
|
1364
1364
|
description: 'List Copado Git repositories via the CICD gateway.',
|
|
1365
|
-
inputSchema:
|
|
1365
|
+
inputSchema: listPaginationZodFields,
|
|
1366
1366
|
title: 'Agentia Repository List',
|
|
1367
|
-
}, () => safelyHandleTool(() => repositoryList()));
|
|
1367
|
+
}, (args) => safelyHandleTool(() => repositoryList(args || {})));
|
|
1368
1368
|
server.registerTool('agentia_repository_get', {
|
|
1369
1369
|
description: 'Get a Copado Git repository by ID via the CICD gateway.',
|
|
1370
1370
|
inputSchema: { id: z.string().describe('Copado Git repository ID.') },
|
|
@@ -1408,6 +1408,7 @@ export function registerAgentiaMcpTools(server) {
|
|
|
1408
1408
|
description: 'List Copado Functions via the CICD gateway.',
|
|
1409
1409
|
inputSchema: {
|
|
1410
1410
|
type: z.enum(FUNCTION_LIST_TYPES).optional().describe('List Custom functions only, or all functions.'),
|
|
1411
|
+
...listPaginationZodFields,
|
|
1411
1412
|
},
|
|
1412
1413
|
title: 'Agentia Function List',
|
|
1413
1414
|
}, (args) => safelyHandleTool(() => functionList(args)));
|