@copado/agentia-cli 0.28.0-alpha.0 → 0.31.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 +1000 -87
- package/dist/commands/auth/get.d.ts +2 -0
- package/dist/commands/auth/get.js +13 -2
- package/dist/commands/auth/get.js.map +1 -1
- package/dist/commands/auth/set.d.ts +6 -0
- package/dist/commands/auth/set.js +43 -4
- package/dist/commands/auth/set.js.map +1 -1
- package/dist/commands/environment/list.d.ts +5 -1
- package/dist/commands/environment/list.js +10 -8
- package/dist/commands/environment/list.js.map +1 -1
- package/dist/commands/job/list.d.ts +4 -2
- package/dist/commands/job/list.js +10 -12
- package/dist/commands/job/list.js.map +1 -1
- package/dist/commands/pipeline/list.d.ts +6 -1
- package/dist/commands/pipeline/list.js +10 -7
- package/dist/commands/pipeline/list.js.map +1 -1
- package/dist/commands/project/list.d.ts +4 -1
- package/dist/commands/project/list.js +7 -5
- package/dist/commands/project/list.js.map +1 -1
- package/dist/commands/promotion/list.d.ts +4 -2
- package/dist/commands/promotion/list.js +8 -6
- package/dist/commands/promotion/list.js.map +1 -1
- package/dist/commands/setup.d.ts +12 -0
- package/dist/commands/setup.js +52 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/testing/build/list.d.ts +16 -0
- package/dist/commands/testing/build/list.js +47 -0
- package/dist/commands/testing/build/list.js.map +1 -0
- package/dist/commands/testing/build/logs.d.ts +21 -0
- package/dist/commands/testing/build/logs.js +42 -0
- package/dist/commands/testing/build/logs.js.map +1 -0
- package/dist/commands/testing/build/run.d.ts +19 -0
- package/dist/commands/testing/build/run.js +39 -0
- package/dist/commands/testing/build/run.js.map +1 -0
- package/dist/commands/testing/create.d.ts +18 -0
- package/dist/commands/testing/create.js +46 -0
- package/dist/commands/testing/create.js.map +1 -0
- package/dist/commands/testing/job/create.d.ts +18 -0
- package/dist/commands/testing/job/create.js +46 -0
- package/dist/commands/testing/job/create.js.map +1 -0
- package/dist/commands/testing/job/download.d.ts +22 -0
- package/dist/commands/testing/job/download.js +56 -0
- package/dist/commands/testing/job/download.js.map +1 -0
- package/dist/commands/testing/job/files.d.ts +19 -0
- package/dist/commands/testing/job/files.js +35 -0
- package/dist/commands/testing/job/files.js.map +1 -0
- package/dist/commands/testing/job/list.d.ts +14 -0
- package/dist/commands/testing/job/list.js +32 -0
- package/dist/commands/testing/job/list.js.map +1 -0
- package/dist/commands/testing/job/upload.d.ts +29 -0
- package/dist/commands/testing/job/upload.js +57 -0
- package/dist/commands/testing/job/upload.js.map +1 -0
- package/dist/commands/testing/logs.d.ts +21 -0
- package/dist/commands/testing/logs.js +42 -0
- package/dist/commands/testing/logs.js.map +1 -0
- package/dist/commands/testing/project/create.d.ts +14 -0
- package/dist/commands/testing/project/create.js +36 -0
- package/dist/commands/testing/project/create.js.map +1 -0
- package/dist/commands/testing/project/list.d.ts +13 -0
- package/dist/commands/testing/project/list.js +31 -0
- package/dist/commands/testing/project/list.js.map +1 -0
- package/dist/commands/testing/robot/create.d.ts +19 -0
- package/dist/commands/testing/robot/create.js +60 -0
- package/dist/commands/testing/robot/create.js.map +1 -0
- package/dist/commands/testing/robot/list.d.ts +13 -0
- package/dist/commands/testing/robot/list.js +28 -0
- package/dist/commands/testing/robot/list.js.map +1 -0
- package/dist/commands/testing/run.d.ts +19 -0
- package/dist/commands/testing/run.js +32 -0
- package/dist/commands/testing/run.js.map +1 -0
- package/dist/commands/testing/status.d.ts +16 -0
- package/dist/commands/testing/status.js +47 -0
- package/dist/commands/testing/status.js.map +1 -0
- package/dist/commands/testing/test/create.d.ts +1 -0
- package/dist/commands/testing/test/create.js +2 -0
- package/dist/commands/testing/test/create.js.map +1 -0
- package/dist/commands/testing/test/logs.d.ts +1 -0
- package/dist/commands/testing/test/logs.js +2 -0
- package/dist/commands/testing/test/logs.js.map +1 -0
- package/dist/commands/testing/test/run.d.ts +1 -0
- package/dist/commands/testing/test/run.js +2 -0
- package/dist/commands/testing/test/run.js.map +1 -0
- package/dist/commands/testing/test/status.d.ts +1 -0
- package/dist/commands/testing/test/status.js +2 -0
- package/dist/commands/testing/test/status.js.map +1 -0
- package/dist/commands/testing/test/update.d.ts +1 -0
- package/dist/commands/testing/test/update.js +2 -0
- package/dist/commands/testing/test/update.js.map +1 -0
- package/dist/commands/testing/update.d.ts +29 -0
- package/dist/commands/testing/update.js +57 -0
- package/dist/commands/testing/update.js.map +1 -0
- package/dist/commands/testing/variable/create.d.ts +20 -0
- package/dist/commands/testing/variable/create.js +65 -0
- package/dist/commands/testing/variable/create.js.map +1 -0
- package/dist/commands/testing/variable/delete.d.ts +19 -0
- package/dist/commands/testing/variable/delete.js +30 -0
- package/dist/commands/testing/variable/delete.js.map +1 -0
- package/dist/commands/testing/variable/list.d.ts +15 -0
- package/dist/commands/testing/variable/list.js +40 -0
- package/dist/commands/testing/variable/list.js.map +1 -0
- package/dist/commands/work/list.d.ts +4 -1
- package/dist/commands/work/list.js +7 -5
- package/dist/commands/work/list.js.map +1 -1
- package/dist/commands/work/set.js +8 -1
- package/dist/commands/work/set.js.map +1 -1
- package/dist/commands/work/submit.d.ts +2 -0
- package/dist/commands/work/submit.js +40 -2
- package/dist/commands/work/submit.js.map +1 -1
- package/dist/lib/credential-store.d.ts +4 -0
- package/dist/lib/credential-store.js +14 -0
- package/dist/lib/credential-store.js.map +1 -1
- package/dist/lib/defaults-store.d.ts +3 -0
- package/dist/lib/defaults-store.js +24 -0
- package/dist/lib/defaults-store.js.map +1 -1
- package/dist/lib/environment-flags.d.ts +3 -1
- package/dist/lib/environment-flags.js +3 -1
- package/dist/lib/environment-flags.js.map +1 -1
- package/dist/lib/environment-types.d.ts +4 -1
- package/dist/lib/environment-types.js +2 -0
- package/dist/lib/environment-types.js.map +1 -1
- package/dist/lib/git-worktree.d.ts +4 -0
- package/dist/lib/git-worktree.js +46 -2
- package/dist/lib/git-worktree.js.map +1 -1
- package/dist/lib/job-types.d.ts +7 -4
- package/dist/lib/job-types.js +8 -15
- package/dist/lib/job-types.js.map +1 -1
- package/dist/lib/list-pagination.d.ts +46 -0
- package/dist/lib/list-pagination.js +106 -0
- package/dist/lib/list-pagination.js.map +1 -0
- package/dist/lib/mcp/testing-tools.d.ts +144 -0
- package/dist/lib/mcp/testing-tools.js +366 -0
- package/dist/lib/mcp/testing-tools.js.map +1 -0
- package/dist/lib/mcp/tools.d.ts +288 -31
- package/dist/lib/mcp/tools.js +26 -54
- package/dist/lib/mcp/tools.js.map +1 -1
- package/dist/lib/mcp/work-tools.d.ts +1 -3
- package/dist/lib/mcp/work-tools.js +13 -2
- package/dist/lib/mcp/work-tools.js.map +1 -1
- package/dist/lib/open-browser.d.ts +3 -0
- package/dist/lib/open-browser.js +13 -1
- package/dist/lib/open-browser.js.map +1 -1
- package/dist/lib/pipeline-types.d.ts +6 -1
- package/dist/lib/pipeline-types.js +10 -6
- package/dist/lib/pipeline-types.js.map +1 -1
- package/dist/lib/project-flags.d.ts +3 -2
- package/dist/lib/project-flags.js +3 -1
- package/dist/lib/project-flags.js.map +1 -1
- package/dist/lib/project-setup.d.ts +80 -0
- package/dist/lib/project-setup.js +383 -0
- package/dist/lib/project-setup.js.map +1 -0
- package/dist/lib/project-types.d.ts +5 -1
- package/dist/lib/project-types.js +6 -10
- package/dist/lib/project-types.js.map +1 -1
- package/dist/lib/promotion-flags.d.ts +4 -3
- package/dist/lib/promotion-flags.js +3 -8
- package/dist/lib/promotion-flags.js.map +1 -1
- package/dist/lib/promotion-types.d.ts +8 -5
- package/dist/lib/promotion-types.js +10 -14
- package/dist/lib/promotion-types.js.map +1 -1
- package/dist/lib/setup-templates.d.ts +11 -0
- package/dist/lib/setup-templates.js +181 -0
- package/dist/lib/setup-templates.js.map +1 -0
- package/dist/lib/testing-config.d.ts +17 -0
- package/dist/lib/testing-config.js +68 -0
- package/dist/lib/testing-config.js.map +1 -0
- package/dist/lib/testing-flags.d.ts +33 -0
- package/dist/lib/testing-flags.js +70 -0
- package/dist/lib/testing-flags.js.map +1 -0
- package/dist/lib/testing-gateway.d.ts +33 -0
- package/dist/lib/testing-gateway.js +161 -0
- package/dist/lib/testing-gateway.js.map +1 -0
- package/dist/lib/testing-operations.d.ts +99 -0
- package/dist/lib/testing-operations.js +268 -0
- package/dist/lib/testing-operations.js.map +1 -0
- package/dist/lib/testing-types.d.ts +138 -0
- package/dist/lib/testing-types.js +190 -0
- package/dist/lib/testing-types.js.map +1 -0
- package/dist/lib/work-flags.d.ts +3 -1
- package/dist/lib/work-flags.js +3 -1
- package/dist/lib/work-flags.js.map +1 -1
- package/dist/lib/work-types.d.ts +8 -1
- package/dist/lib/work-types.js +16 -3
- package/dist/lib/work-types.js.map +1 -1
- package/oclif.manifest.json +3447 -1079
- package/package.json +4 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cellValue, table } from './format.js';
|
|
2
|
+
import { appendListPaginationQueryParams, buildPaginatedListResult, paginatedResultFromPage, } from './list-pagination.js';
|
|
2
3
|
import { normalizeSalesforceId } from './salesforce-id.js';
|
|
3
4
|
export const PROMOTION_LIST_FILTER_KEYS = [
|
|
4
5
|
'name',
|
|
@@ -14,7 +15,6 @@ export const PROMOTION_LIST_FILTER_KEYS = [
|
|
|
14
15
|
'isBackPromotion',
|
|
15
16
|
'createdById',
|
|
16
17
|
'createdByName',
|
|
17
|
-
'limit',
|
|
18
18
|
'userStoryId',
|
|
19
19
|
];
|
|
20
20
|
const PROMOTION_LIST_FILTER_QUERY_PARAM = {
|
|
@@ -23,7 +23,6 @@ const PROMOTION_LIST_FILTER_QUERY_PARAM = {
|
|
|
23
23
|
destinationEnvironmentId: 'destinationEnvironmentId',
|
|
24
24
|
destinationEnvironmentName: 'destinationEnvironmentName',
|
|
25
25
|
isBackPromotion: 'isBackPromotion',
|
|
26
|
-
limit: 'limit',
|
|
27
26
|
name: 'name',
|
|
28
27
|
pipelineId: 'pipelineId',
|
|
29
28
|
pipelineName: 'pipelineName',
|
|
@@ -34,8 +33,8 @@ const PROMOTION_LIST_FILTER_QUERY_PARAM = {
|
|
|
34
33
|
status: 'status',
|
|
35
34
|
userStoryId: 'userStoryId',
|
|
36
35
|
};
|
|
37
|
-
export const
|
|
38
|
-
export const
|
|
36
|
+
export const PROMOTION_LIST_PAGE_SIZE_MAX = 200;
|
|
37
|
+
export const PROMOTION_LIST_PAGE_SIZE_MIN = 1;
|
|
39
38
|
export function promotionListEndpoint(filters = {}) {
|
|
40
39
|
const params = new URLSearchParams();
|
|
41
40
|
for (const key of PROMOTION_LIST_FILTER_KEYS) {
|
|
@@ -47,10 +46,6 @@ export function promotionListEndpoint(filters = {}) {
|
|
|
47
46
|
params.set(PROMOTION_LIST_FILTER_QUERY_PARAM[key], String(value));
|
|
48
47
|
continue;
|
|
49
48
|
}
|
|
50
|
-
if (key === 'limit') {
|
|
51
|
-
params.set(PROMOTION_LIST_FILTER_QUERY_PARAM[key], String(value));
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
49
|
if (key === 'sourceEnvironmentId' ||
|
|
55
50
|
key === 'destinationEnvironmentId' ||
|
|
56
51
|
key === 'pipelineId' ||
|
|
@@ -62,20 +57,21 @@ export function promotionListEndpoint(filters = {}) {
|
|
|
62
57
|
}
|
|
63
58
|
params.set(PROMOTION_LIST_FILTER_QUERY_PARAM[key], value);
|
|
64
59
|
}
|
|
60
|
+
appendListPaginationQueryParams(params, filters);
|
|
65
61
|
const query = params.toString();
|
|
66
62
|
return query.length > 0 ? `/release/promotion?${query}` : '/release/promotion';
|
|
67
63
|
}
|
|
68
64
|
export function promotionEndpoint(id) {
|
|
69
65
|
return `/release/promotion/${normalizeSalesforceId(id)}`;
|
|
70
66
|
}
|
|
71
|
-
export function
|
|
67
|
+
export function normalizePromotionsListPage(response) {
|
|
72
68
|
if (Array.isArray(response)) {
|
|
73
|
-
return response;
|
|
69
|
+
return buildPaginatedListResult(response);
|
|
74
70
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return
|
|
71
|
+
return paginatedResultFromPage(response);
|
|
72
|
+
}
|
|
73
|
+
export function normalizePromotions(response) {
|
|
74
|
+
return normalizePromotionsListPage(response).data;
|
|
79
75
|
}
|
|
80
76
|
export function normalizePromotionDetail(response) {
|
|
81
77
|
if ('data' in response && response.data !== undefined && typeof response.data === 'object') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"promotion-types.js","sourceRoot":"","sources":["../../src/lib/promotion-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"promotion-types.js","sourceRoot":"","sources":["../../src/lib/promotion-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AAC5C,OAAO,EACL,+BAA+B,EAC/B,wBAAwB,EAGxB,uBAAuB,GACxB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAA;AAmMxD,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,MAAM;IACN,QAAQ;IACR,WAAW;IACX,aAAa;IACb,YAAY;IACZ,cAAc;IACd,qBAAqB;IACrB,uBAAuB;IACvB,0BAA0B;IAC1B,4BAA4B;IAC5B,iBAAiB;IACjB,aAAa;IACb,eAAe;IACf,aAAa;CAC6C,CAAA;AAE5D,MAAM,iCAAiC,GAAgE;IACrG,WAAW,EAAE,aAAa;IAC1B,aAAa,EAAE,eAAe;IAC9B,wBAAwB,EAAE,0BAA0B;IACpD,0BAA0B,EAAE,4BAA4B;IACxD,eAAe,EAAE,iBAAiB;IAClC,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,YAAY;IACxB,YAAY,EAAE,cAAc;IAC5B,SAAS,EAAE,WAAW;IACtB,WAAW,EAAE,aAAa;IAC1B,mBAAmB,EAAE,qBAAqB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S,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE;KAC/D,CAAA;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,SAA0B;IAC9D,MAAM,KAAK,GAAG,CAAC,GAAG,4BAA4B,CAAC,SAAS,CAAC,EAAE,GAAG,6BAA6B,CAAC,SAAS,CAAC,CAAC,CAAA;IAEvG,wBAAwB,CAAC,KAAK,EAAE,iBAAiB,EAAE,SAAS,CAAC,qBAAqB,CAAC,CAAA;IACnF,wBAAwB,CAAC,KAAK,EAAE,aAAa,EAAE,SAAS,CAAC,aAAa,CAAC,CAAA;IAEvE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Published location for AGENTS.md. Empty until the download URL is finalized;
|
|
3
|
+
* setup falls back to the bundled template below.
|
|
4
|
+
*/
|
|
5
|
+
export declare const DEFAULT_AGENTS_MD_URL = "";
|
|
6
|
+
export declare const AGENTIA_GITIGNORE_ENTRY = ".agentia/";
|
|
7
|
+
export declare const SAMPLE_QUALITY_GATES_UNIX = "#!/usr/bin/env bash\nset -euo pipefail\n\n# Local Agentia quality gates (macOS / Linux).\n# Edit this script to match your project. Agentia runs it from the repo root during\n# `agentia work test --local` and `agentia work submit` (unless --skip-local-tests).\n# The script must exit non-zero if any check fails.\n\nsf code-analyzer run\nsf force lightning lwc test run\n";
|
|
8
|
+
export declare const SAMPLE_QUALITY_GATES_WINDOWS = "@echo off\nsetlocal EnableExtensions\nREM Local Agentia quality gates (Windows).\nREM Edit this script to match your project. Agentia runs it from the repo root during\nREM `agentia work test --local` and `agentia work submit` (unless --skip-local-tests).\nREM The script must exit non-zero if any check fails.\n\nsf code-analyzer run\nif errorlevel 1 exit /b %errorlevel%\nsf force lightning lwc test run\nif errorlevel 1 exit /b %errorlevel%\n";
|
|
9
|
+
/** Bundled AGENTS.md template (mirrors docs/AGENTS.sample.md). Used when DEFAULT_AGENTS_MD_URL is unset or download fails. */
|
|
10
|
+
export declare const BUNDLED_AGENTS_MD = "# Agentia CLI for AI Agents\n\nUse Agentia to manage Copado user stories end-to-end: pick work, prepare a git branch, push changes, submit for review, and promote.\n\n**Prefer the Agentia MCP server when it is available.** If tools such as `agentia_work_list`, `agentia_work_set`, `agentia_work_push`, `agentia_work_submit`, and `agentia_work_done` are registered, call those instead of shelling out to the `agentia` CLI. Fall back to CLI commands only when MCP is not configured.\n\nWhen using the CLI, prefer `--json` on every command so you can parse structured output instead of terminal tables.\n\nAuthentication must already be configured (`agentia auth set` / keychain, or local gateway mode). Run from a git repository that is a Copado-managed project.\n\n## Typical workflow\n\n```text\nlist \u2192 get \u2192 set \u2192 (implement & commit) \u2192 push \u2192 submit \u2192 done\n```\n\n| Step | MCP tool (preferred) | CLI fallback | Purpose |\n| --- | --- | --- | --- |\n| 1 | `agentia_work_list` (`assignedToMe: true`) | `agentia work list --assigned-to-me --json` | Show user stories assigned to you |\n| 2 | `agentia_work_get` | `agentia work get [id] --json` | Read user story details (omit id after `work set`) |\n| 3 | `agentia_work_set` | `agentia work set <id> --json` | Mark in progress and prepare the feature branch |\n| 4 | *(your edits + `git commit`)* | *(your edits + `git commit`)* | Implement the story |\n| 5 | `agentia_work_push` | `agentia work push --json` | Push commits to git and register them with Copado |\n| 6 | `agentia_work_submit` | `agentia work submit --json` | Flag ready for review (pipeline quality gates / validation) |\n| 7 | `agentia_work_done` | `agentia work done --json` | Promote and deploy to the next stage |\n\nDo not skip `work set` before coding. Later steps expect a `feature/<user-story-name>` branch and a recorded base branch from `work set`.\n\n---\n\n## Commands\n\nCLI examples below are the fallback when MCP is unavailable. MCP tool names and arguments mirror these commands (camelCase args instead of flags).\n\n### `agentia work list`\n\nShow user stories. For \u201Cassigned to me\u201D, always use:\n\n```sh\nagentia work list --assigned-to-me --json\n```\n\nUseful filters: `--status`, `--project-name`, `--name`, `--owned-by-me`. Do not combine `--assigned-to-me` with `--owned-by-me` or `--assignee-id`.\n\n### `agentia work get [id]`\n\nRead full details for one user story. After `work set`, omit the ID to use the active work item:\n\n```sh\nagentia work get --json\nagentia work get a0SKC000000CmZ2AU --json\n```\n\nUse this before starting work to understand title, status, acceptance criteria, and related fields.\n\n### `agentia work set <id>`\n\nFlag the user story as the active work item (in progress) and prepare the correct git branch:\n\n```sh\nagentia work set a0SKC000000CmZ2AU --json\n# or by name:\nagentia work set US-0001 --json\n```\n\nWhat it does:\n\n1. Calls Copado to set the work item and resolve the base branch\n2. Requires a **clean tracked working tree** (stash or commit first if dirty)\n3. Fetches `origin/<base-branch>`\n4. Creates or checks out `feature/<user-story-name>`\n5. Records the last work item ID, name, and base branch for later commands\n\nOptional: `--base-branch <name>` overrides the base branch from the API.\n\nAfter success, stay on that feature branch for all implementation commits.\n\n### `agentia work push`\n\nPush committed changes to git and register them with Copado:\n\n```sh\nagentia work push --json\n```\n\nPrerequisites:\n\n- Current branch is `feature/US-XXXX` (from `work set`)\n- No uncommitted tracked changes (commit first)\n- `work set` was run so a base branch is recorded\n\nLocks the tip commit, runs `git push origin <branch>`, then registers the commits with Copado.\n\n### `agentia work test --local`\n\nRun local project quality gates without submitting:\n\n```sh\nagentia work test --local --json\n```\n\nIf the project root contains `.agentia_quality_gates.sh` (macOS/Linux) or `.agentia_quality_gates.cmd` (Windows), that script runs and the command stops on failure. Only `--local` is supported for now.\n\n### `agentia work submit`\n\nFlag the user story as ready for review. Runs local project quality gates (when present), then pipeline quality gates and validation:\n\n```sh\nagentia work submit --json\nagentia work submit --skip-local-tests --json\n```\n\nSame branch/clean-tree rules as `work push`. If the project root contains `.agentia_quality_gates.sh` (macOS/Linux) or `.agentia_quality_gates.cmd` (Windows), that script runs first and submit stops on failure (same local gates as `work test --local`). Use `--skip-local-tests` to skip it. If the branch has unpushed commits, it pushes and registers them next, then submits.\n\n### `agentia work done`\n\nPromote and deploy the user story to the next pipeline stage:\n\n```sh\nagentia work done --json\n```\n\nSame branch/clean-tree rules as `work submit`. Pushes unpushed commits if needed, then promotes (without the validate-only path used by submit).\n\nOnly run this when the story is approved and ready to move to the next environment.\n\n---\n\n## Agent rules\n\n1. **Prefer MCP over CLI.** When Agentia MCP tools are available, use them instead of running `agentia` in the shell.\n2. **Discover before acting.** List assigned stories, then `get` the chosen ID, then `set` before editing files.\n3. **One story, one feature branch.** Do not mix unrelated commits on the same `feature/US-XXXX` branch.\n4. **Commit yourself; push with Agentia.** Use normal `git add` / `git commit` for local commits. Use `agentia_work_push` / `agentia work push` (not bare `git push`) so Copado receives the commit registration.\n5. **Keep the tree clean** before `set`, `push`, `submit`, and `done`. Those steps fail if tracked changes are pending.\n6. **Prefer structured results.** MCP returns JSON; for CLI, use `--json` and do not scrape human table output.\n7. **Order matters.** `set` \u2192 commit \u2192 `push` \u2192 `submit` \u2192 `done`. `submit` and `done` will auto-push if the branch is ahead of origin, but `set` is still required first.\n8. **Confirm intent for `done`.** Promotion deploys to the next stage; do not run it unless the user asked to promote/deploy.\n";
|
|
11
|
+
export declare function qualityGatesExplanation(bin?: string): string;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { QUALITY_GATES_SCRIPT_UNIX, QUALITY_GATES_SCRIPT_WINDOWS, } from './local-quality-gates.js';
|
|
2
|
+
/**
|
|
3
|
+
* Published location for AGENTS.md. Empty until the download URL is finalized;
|
|
4
|
+
* setup falls back to the bundled template below.
|
|
5
|
+
*/
|
|
6
|
+
export const DEFAULT_AGENTS_MD_URL = '';
|
|
7
|
+
export const AGENTIA_GITIGNORE_ENTRY = '.agentia/';
|
|
8
|
+
export const SAMPLE_QUALITY_GATES_UNIX = `#!/usr/bin/env bash
|
|
9
|
+
set -euo pipefail
|
|
10
|
+
|
|
11
|
+
# Local Agentia quality gates (macOS / Linux).
|
|
12
|
+
# Edit this script to match your project. Agentia runs it from the repo root during
|
|
13
|
+
# \`agentia work test --local\` and \`agentia work submit\` (unless --skip-local-tests).
|
|
14
|
+
# The script must exit non-zero if any check fails.
|
|
15
|
+
|
|
16
|
+
sf code-analyzer run
|
|
17
|
+
sf force lightning lwc test run
|
|
18
|
+
`;
|
|
19
|
+
export const SAMPLE_QUALITY_GATES_WINDOWS = `@echo off
|
|
20
|
+
setlocal EnableExtensions
|
|
21
|
+
REM Local Agentia quality gates (Windows).
|
|
22
|
+
REM Edit this script to match your project. Agentia runs it from the repo root during
|
|
23
|
+
REM \`agentia work test --local\` and \`agentia work submit\` (unless --skip-local-tests).
|
|
24
|
+
REM The script must exit non-zero if any check fails.
|
|
25
|
+
|
|
26
|
+
sf code-analyzer run
|
|
27
|
+
if errorlevel 1 exit /b %errorlevel%
|
|
28
|
+
sf force lightning lwc test run
|
|
29
|
+
if errorlevel 1 exit /b %errorlevel%
|
|
30
|
+
`;
|
|
31
|
+
/** Bundled AGENTS.md template (mirrors docs/AGENTS.sample.md). Used when DEFAULT_AGENTS_MD_URL is unset or download fails. */
|
|
32
|
+
export const BUNDLED_AGENTS_MD = `# Agentia CLI for AI Agents
|
|
33
|
+
|
|
34
|
+
Use Agentia to manage Copado user stories end-to-end: pick work, prepare a git branch, push changes, submit for review, and promote.
|
|
35
|
+
|
|
36
|
+
**Prefer the Agentia MCP server when it is available.** If tools such as \`agentia_work_list\`, \`agentia_work_set\`, \`agentia_work_push\`, \`agentia_work_submit\`, and \`agentia_work_done\` are registered, call those instead of shelling out to the \`agentia\` CLI. Fall back to CLI commands only when MCP is not configured.
|
|
37
|
+
|
|
38
|
+
When using the CLI, prefer \`--json\` on every command so you can parse structured output instead of terminal tables.
|
|
39
|
+
|
|
40
|
+
Authentication must already be configured (\`agentia auth set\` / keychain, or local gateway mode). Run from a git repository that is a Copado-managed project.
|
|
41
|
+
|
|
42
|
+
## Typical workflow
|
|
43
|
+
|
|
44
|
+
\`\`\`text
|
|
45
|
+
list → get → set → (implement & commit) → push → submit → done
|
|
46
|
+
\`\`\`
|
|
47
|
+
|
|
48
|
+
| Step | MCP tool (preferred) | CLI fallback | Purpose |
|
|
49
|
+
| --- | --- | --- | --- |
|
|
50
|
+
| 1 | \`agentia_work_list\` (\`assignedToMe: true\`) | \`agentia work list --assigned-to-me --json\` | Show user stories assigned to you |
|
|
51
|
+
| 2 | \`agentia_work_get\` | \`agentia work get [id] --json\` | Read user story details (omit id after \`work set\`) |
|
|
52
|
+
| 3 | \`agentia_work_set\` | \`agentia work set <id> --json\` | Mark in progress and prepare the feature branch |
|
|
53
|
+
| 4 | *(your edits + \`git commit\`)* | *(your edits + \`git commit\`)* | Implement the story |
|
|
54
|
+
| 5 | \`agentia_work_push\` | \`agentia work push --json\` | Push commits to git and register them with Copado |
|
|
55
|
+
| 6 | \`agentia_work_submit\` | \`agentia work submit --json\` | Flag ready for review (pipeline quality gates / validation) |
|
|
56
|
+
| 7 | \`agentia_work_done\` | \`agentia work done --json\` | Promote and deploy to the next stage |
|
|
57
|
+
|
|
58
|
+
Do not skip \`work set\` before coding. Later steps expect a \`feature/<user-story-name>\` branch and a recorded base branch from \`work set\`.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Commands
|
|
63
|
+
|
|
64
|
+
CLI examples below are the fallback when MCP is unavailable. MCP tool names and arguments mirror these commands (camelCase args instead of flags).
|
|
65
|
+
|
|
66
|
+
### \`agentia work list\`
|
|
67
|
+
|
|
68
|
+
Show user stories. For “assigned to me”, always use:
|
|
69
|
+
|
|
70
|
+
\`\`\`sh
|
|
71
|
+
agentia work list --assigned-to-me --json
|
|
72
|
+
\`\`\`
|
|
73
|
+
|
|
74
|
+
Useful filters: \`--status\`, \`--project-name\`, \`--name\`, \`--owned-by-me\`. Do not combine \`--assigned-to-me\` with \`--owned-by-me\` or \`--assignee-id\`.
|
|
75
|
+
|
|
76
|
+
### \`agentia work get [id]\`
|
|
77
|
+
|
|
78
|
+
Read full details for one user story. After \`work set\`, omit the ID to use the active work item:
|
|
79
|
+
|
|
80
|
+
\`\`\`sh
|
|
81
|
+
agentia work get --json
|
|
82
|
+
agentia work get a0SKC000000CmZ2AU --json
|
|
83
|
+
\`\`\`
|
|
84
|
+
|
|
85
|
+
Use this before starting work to understand title, status, acceptance criteria, and related fields.
|
|
86
|
+
|
|
87
|
+
### \`agentia work set <id>\`
|
|
88
|
+
|
|
89
|
+
Flag the user story as the active work item (in progress) and prepare the correct git branch:
|
|
90
|
+
|
|
91
|
+
\`\`\`sh
|
|
92
|
+
agentia work set a0SKC000000CmZ2AU --json
|
|
93
|
+
# or by name:
|
|
94
|
+
agentia work set US-0001 --json
|
|
95
|
+
\`\`\`
|
|
96
|
+
|
|
97
|
+
What it does:
|
|
98
|
+
|
|
99
|
+
1. Calls Copado to set the work item and resolve the base branch
|
|
100
|
+
2. Requires a **clean tracked working tree** (stash or commit first if dirty)
|
|
101
|
+
3. Fetches \`origin/<base-branch>\`
|
|
102
|
+
4. Creates or checks out \`feature/<user-story-name>\`
|
|
103
|
+
5. Records the last work item ID, name, and base branch for later commands
|
|
104
|
+
|
|
105
|
+
Optional: \`--base-branch <name>\` overrides the base branch from the API.
|
|
106
|
+
|
|
107
|
+
After success, stay on that feature branch for all implementation commits.
|
|
108
|
+
|
|
109
|
+
### \`agentia work push\`
|
|
110
|
+
|
|
111
|
+
Push committed changes to git and register them with Copado:
|
|
112
|
+
|
|
113
|
+
\`\`\`sh
|
|
114
|
+
agentia work push --json
|
|
115
|
+
\`\`\`
|
|
116
|
+
|
|
117
|
+
Prerequisites:
|
|
118
|
+
|
|
119
|
+
- Current branch is \`feature/US-XXXX\` (from \`work set\`)
|
|
120
|
+
- No uncommitted tracked changes (commit first)
|
|
121
|
+
- \`work set\` was run so a base branch is recorded
|
|
122
|
+
|
|
123
|
+
Locks the tip commit, runs \`git push origin <branch>\`, then registers the commits with Copado.
|
|
124
|
+
|
|
125
|
+
### \`agentia work test --local\`
|
|
126
|
+
|
|
127
|
+
Run local project quality gates without submitting:
|
|
128
|
+
|
|
129
|
+
\`\`\`sh
|
|
130
|
+
agentia work test --local --json
|
|
131
|
+
\`\`\`
|
|
132
|
+
|
|
133
|
+
If the project root contains \`${QUALITY_GATES_SCRIPT_UNIX}\` (macOS/Linux) or \`${QUALITY_GATES_SCRIPT_WINDOWS}\` (Windows), that script runs and the command stops on failure. Only \`--local\` is supported for now.
|
|
134
|
+
|
|
135
|
+
### \`agentia work submit\`
|
|
136
|
+
|
|
137
|
+
Flag the user story as ready for review. Runs local project quality gates (when present), then pipeline quality gates and validation:
|
|
138
|
+
|
|
139
|
+
\`\`\`sh
|
|
140
|
+
agentia work submit --json
|
|
141
|
+
agentia work submit --skip-local-tests --json
|
|
142
|
+
\`\`\`
|
|
143
|
+
|
|
144
|
+
Same branch/clean-tree rules as \`work push\`. If the project root contains \`${QUALITY_GATES_SCRIPT_UNIX}\` (macOS/Linux) or \`${QUALITY_GATES_SCRIPT_WINDOWS}\` (Windows), that script runs first and submit stops on failure (same local gates as \`work test --local\`). Use \`--skip-local-tests\` to skip it. If the branch has unpushed commits, it pushes and registers them next, then submits.
|
|
145
|
+
|
|
146
|
+
### \`agentia work done\`
|
|
147
|
+
|
|
148
|
+
Promote and deploy the user story to the next pipeline stage:
|
|
149
|
+
|
|
150
|
+
\`\`\`sh
|
|
151
|
+
agentia work done --json
|
|
152
|
+
\`\`\`
|
|
153
|
+
|
|
154
|
+
Same branch/clean-tree rules as \`work submit\`. Pushes unpushed commits if needed, then promotes (without the validate-only path used by submit).
|
|
155
|
+
|
|
156
|
+
Only run this when the story is approved and ready to move to the next environment.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Agent rules
|
|
161
|
+
|
|
162
|
+
1. **Prefer MCP over CLI.** When Agentia MCP tools are available, use them instead of running \`agentia\` in the shell.
|
|
163
|
+
2. **Discover before acting.** List assigned stories, then \`get\` the chosen ID, then \`set\` before editing files.
|
|
164
|
+
3. **One story, one feature branch.** Do not mix unrelated commits on the same \`feature/US-XXXX\` branch.
|
|
165
|
+
4. **Commit yourself; push with Agentia.** Use normal \`git add\` / \`git commit\` for local commits. Use \`agentia_work_push\` / \`agentia work push\` (not bare \`git push\`) so Copado receives the commit registration.
|
|
166
|
+
5. **Keep the tree clean** before \`set\`, \`push\`, \`submit\`, and \`done\`. Those steps fail if tracked changes are pending.
|
|
167
|
+
6. **Prefer structured results.** MCP returns JSON; for CLI, use \`--json\` and do not scrape human table output.
|
|
168
|
+
7. **Order matters.** \`set\` → commit → \`push\` → \`submit\` → \`done\`. \`submit\` and \`done\` will auto-push if the branch is ahead of origin, but \`set\` is still required first.
|
|
169
|
+
8. **Confirm intent for \`done\`.** Promotion deploys to the next stage; do not run it unless the user asked to promote/deploy.
|
|
170
|
+
`;
|
|
171
|
+
export function qualityGatesExplanation(bin = 'agentia') {
|
|
172
|
+
return [
|
|
173
|
+
'Local quality gates:',
|
|
174
|
+
` • ${QUALITY_GATES_SCRIPT_UNIX} runs on macOS/Linux; ${QUALITY_GATES_SCRIPT_WINDOWS} on Windows.`,
|
|
175
|
+
` • ${bin} work test --local and ${bin} work submit run the platform script from the repo root when present.`,
|
|
176
|
+
` • Use ${bin} work submit --skip-local-tests to bypass them for a single submit.`,
|
|
177
|
+
' • Edit the scripts to add or remove checks; they must exit non-zero on failure.',
|
|
178
|
+
' • Sample scripts call Salesforce CLI checks (code analyzer + LWC tests) — replace with your project gates.',
|
|
179
|
+
].join('\n');
|
|
180
|
+
}
|
|
181
|
+
//# sourceMappingURL=setup-templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-templates.js","sourceRoot":"","sources":["../../src/lib/setup-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,0BAA0B,CAAA;AAEjC;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAA;AAEvC,MAAM,CAAC,MAAM,uBAAuB,GAAG,WAAW,CAAA;AAElD,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;;;;CAUxC,CAAA;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG;;;;;;;;;;;CAW3C,CAAA;AAED,8HAA8H;AAC9H,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAqGA,yBAAyB,yBAAyB,4BAA4B;;;;;;;;;;;gFAW/B,yBAAyB,yBAAyB,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;CA0B7J,CAAA;AAED,MAAM,UAAU,uBAAuB,CAAC,GAAG,GAAG,SAAS;IACrD,OAAO;QACL,sBAAsB;QACtB,OAAO,yBAAyB,yBAAyB,4BAA4B,cAAc;QACnG,OAAO,GAAG,0BAA0B,GAAG,uEAAuE;QAC9G,WAAW,GAAG,qEAAqE;QACnF,mFAAmF;QACnF,8GAA8G;KAC/G,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const CRT_ALLOWED_DOMAINS: readonly ["dev-robotic.copado.com", "qa.robotic.copado.com", "au-robotic.copado.com", "ca-robotic.copado.com", "eu-robotic.copado.com", "gb-robotic.copado.com", "in-robotic.copado.com", "jp-robotic.copado.com", "sg-robotic.copado.com", "robotic.copado.com"];
|
|
2
|
+
export type CrtAllowedDomain = (typeof CRT_ALLOWED_DOMAINS)[number];
|
|
3
|
+
export type TestingConnectionOverrides = {
|
|
4
|
+
domain?: string;
|
|
5
|
+
org?: number | string;
|
|
6
|
+
pat?: string;
|
|
7
|
+
};
|
|
8
|
+
export type TestingCredentials = {
|
|
9
|
+
domain: CrtAllowedDomain;
|
|
10
|
+
orgId: number;
|
|
11
|
+
pat: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function normalizeCrtDomain(value: string): CrtAllowedDomain;
|
|
14
|
+
export declare function normalizeCrtOrgId(value: number | string): number;
|
|
15
|
+
export declare function resolveTestingCredentials(overrides?: TestingConnectionOverrides): TestingCredentials;
|
|
16
|
+
export declare function platformBaseUrl(domain: string): string;
|
|
17
|
+
export declare function paceBaseUrl(domain: string): string;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { getCredential, getCrtDomain, getCrtOrgId } from './credential-store.js';
|
|
2
|
+
import { loadEnvFile } from './env-file.js';
|
|
3
|
+
export const CRT_ALLOWED_DOMAINS = [
|
|
4
|
+
'dev-robotic.copado.com',
|
|
5
|
+
'qa.robotic.copado.com',
|
|
6
|
+
'au-robotic.copado.com',
|
|
7
|
+
'ca-robotic.copado.com',
|
|
8
|
+
'eu-robotic.copado.com',
|
|
9
|
+
'gb-robotic.copado.com',
|
|
10
|
+
'in-robotic.copado.com',
|
|
11
|
+
'jp-robotic.copado.com',
|
|
12
|
+
'sg-robotic.copado.com',
|
|
13
|
+
'robotic.copado.com',
|
|
14
|
+
];
|
|
15
|
+
export function normalizeCrtDomain(value) {
|
|
16
|
+
const trimmed = value.trim().replace(/^https?:\/\//u, '').replace(/\/+$/u, '');
|
|
17
|
+
if (!CRT_ALLOWED_DOMAINS.includes(trimmed)) {
|
|
18
|
+
throw new Error(`CRT domain must be one of: ${CRT_ALLOWED_DOMAINS.join(', ')}.`);
|
|
19
|
+
}
|
|
20
|
+
return trimmed;
|
|
21
|
+
}
|
|
22
|
+
export function normalizeCrtOrgId(value) {
|
|
23
|
+
const raw = typeof value === 'number' ? value.toString() : value.trim();
|
|
24
|
+
if (!/^\d+$/u.test(raw)) {
|
|
25
|
+
throw new Error('CRT organization ID must be a positive integer.');
|
|
26
|
+
}
|
|
27
|
+
const parsed = Number.parseInt(raw, 10);
|
|
28
|
+
if (!Number.isSafeInteger(parsed) || parsed <= 0) {
|
|
29
|
+
throw new Error('CRT organization ID must be a positive integer.');
|
|
30
|
+
}
|
|
31
|
+
return parsed;
|
|
32
|
+
}
|
|
33
|
+
function envValue(...keys) {
|
|
34
|
+
for (const key of keys) {
|
|
35
|
+
const value = process.env[key]?.trim();
|
|
36
|
+
if (value !== undefined && value.length > 0) {
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
export function resolveTestingCredentials(overrides = {}) {
|
|
43
|
+
loadEnvFile();
|
|
44
|
+
const domain = overrides.domain ?? envValue('COPADO_ROBOTIC_DOMAIN', 'CRT_DOMAIN') ?? getCrtDomain();
|
|
45
|
+
const org = overrides.org ?? envValue('COPADO_ROBOTIC_ORG_ID', 'CRT_ORG') ?? getCrtOrgId();
|
|
46
|
+
const pat = overrides.pat ?? envValue('COPADO_ROBOTIC_API_KEY', 'CRT_AI_KEY') ?? getCredential('crt');
|
|
47
|
+
if (domain === undefined || domain === null || domain.trim().length === 0) {
|
|
48
|
+
throw new Error('CRT domain is not configured. Run `agentia auth set --crt-domain <domain>` or set COPADO_ROBOTIC_DOMAIN.');
|
|
49
|
+
}
|
|
50
|
+
if (org === undefined || org === null || org.toString().trim().length === 0) {
|
|
51
|
+
throw new Error('CRT organization ID is not configured. Run `agentia auth set --crt-org <org-id>` or set COPADO_ROBOTIC_ORG_ID.');
|
|
52
|
+
}
|
|
53
|
+
if (pat === null || pat === undefined || pat.trim().length === 0) {
|
|
54
|
+
throw new Error('CRT PAT token is not configured. Run `agentia auth set --crt <pat-token>` or set COPADO_ROBOTIC_API_KEY.');
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
domain: normalizeCrtDomain(domain),
|
|
58
|
+
orgId: normalizeCrtOrgId(org),
|
|
59
|
+
pat,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
export function platformBaseUrl(domain) {
|
|
63
|
+
return `https://platform.${domain}`;
|
|
64
|
+
}
|
|
65
|
+
export function paceBaseUrl(domain) {
|
|
66
|
+
return `https://api.${domain}`;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=testing-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing-config.js","sourceRoot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;IAED,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjE,MAAM,IAAI,KAAK,CAAC,0GAA0G,CAAC,CAAA;IAC7H,CAAC;IAED,OAAO;QACL,MAAM,EAAE,kBAAkB,CAAC,MAAM,CAAC;QAClC,KAAK,EAAE,iBAAiB,CAAC,GAAG,CAAC;QAC7B,GAAG;KACJ,CAAA;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,MAAc;IAC5C,OAAO,oBAAoB,MAAM,EAAE,CAAA;AACrC,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,MAAc;IACxC,OAAO,eAAe,MAAM,EAAE,CAAA;AAChC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type TestingConnectionOptions } from './testing-operations.js';
|
|
2
|
+
export declare const testingConnectionFlags: {
|
|
3
|
+
domain: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
4
|
+
org: import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
5
|
+
pat: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
|
+
};
|
|
7
|
+
export declare const testingProjectFlag: {
|
|
8
|
+
project: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
export declare const testingJobFlag: {
|
|
11
|
+
job: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
export declare const testingBranchFlag: {
|
|
14
|
+
branch: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
};
|
|
16
|
+
export declare const testingOutputFlags: {
|
|
17
|
+
output: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
|
+
};
|
|
19
|
+
export declare const testingFileInputFlags: {
|
|
20
|
+
dir: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
|
+
file: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
22
|
+
};
|
|
23
|
+
export declare const testingUploadOperationFlags: {
|
|
24
|
+
add: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
25
|
+
remove: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
26
|
+
replace: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
27
|
+
};
|
|
28
|
+
export type TestingConnectionFlagValues = {
|
|
29
|
+
domain?: string;
|
|
30
|
+
org?: number;
|
|
31
|
+
pat?: string;
|
|
32
|
+
};
|
|
33
|
+
export declare function testingConnectionOptions(flags: TestingConnectionFlagValues): TestingConnectionOptions;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Flags } from '@oclif/core';
|
|
2
|
+
export const testingConnectionFlags = {
|
|
3
|
+
domain: Flags.string({
|
|
4
|
+
description: 'CRT domain hostname. Defaults to COPADO_ROBOTIC_DOMAIN, CRT_DOMAIN, or stored auth config.',
|
|
5
|
+
}),
|
|
6
|
+
org: Flags.integer({
|
|
7
|
+
description: 'CRT organization ID. Defaults to COPADO_ROBOTIC_ORG_ID, CRT_ORG, or stored auth config.',
|
|
8
|
+
}),
|
|
9
|
+
pat: Flags.string({
|
|
10
|
+
description: 'CRT PAT token override. Prefer auth set --crt or COPADO_ROBOTIC_API_KEY for regular use.',
|
|
11
|
+
}),
|
|
12
|
+
};
|
|
13
|
+
export const testingProjectFlag = {
|
|
14
|
+
project: Flags.integer({
|
|
15
|
+
char: 'p',
|
|
16
|
+
description: 'CRT project ID.',
|
|
17
|
+
required: true,
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
20
|
+
export const testingJobFlag = {
|
|
21
|
+
job: Flags.integer({
|
|
22
|
+
char: 'j',
|
|
23
|
+
description: 'CRT job/test ID.',
|
|
24
|
+
required: true,
|
|
25
|
+
}),
|
|
26
|
+
};
|
|
27
|
+
export const testingBranchFlag = {
|
|
28
|
+
branch: Flags.string({
|
|
29
|
+
description: 'Optional CRT branch name for file operations.',
|
|
30
|
+
}),
|
|
31
|
+
};
|
|
32
|
+
export const testingOutputFlags = {
|
|
33
|
+
output: Flags.string({
|
|
34
|
+
char: 'o',
|
|
35
|
+
description: 'Write raw output to this file path.',
|
|
36
|
+
}),
|
|
37
|
+
};
|
|
38
|
+
export const testingFileInputFlags = {
|
|
39
|
+
dir: Flags.string({
|
|
40
|
+
description: 'Directory containing Robot Framework files to upload. Can be provided multiple times.',
|
|
41
|
+
multiple: true,
|
|
42
|
+
}),
|
|
43
|
+
file: Flags.string({
|
|
44
|
+
char: 'f',
|
|
45
|
+
description: 'Robot Framework file to upload. Can be provided multiple times.',
|
|
46
|
+
multiple: true,
|
|
47
|
+
}),
|
|
48
|
+
};
|
|
49
|
+
export const testingUploadOperationFlags = {
|
|
50
|
+
add: Flags.string({
|
|
51
|
+
description: 'Add a file using local[:remote] syntax. Can be provided multiple times.',
|
|
52
|
+
multiple: true,
|
|
53
|
+
}),
|
|
54
|
+
remove: Flags.string({
|
|
55
|
+
description: 'Remove a remote CRT file path. Can be provided multiple times.',
|
|
56
|
+
multiple: true,
|
|
57
|
+
}),
|
|
58
|
+
replace: Flags.string({
|
|
59
|
+
description: 'Replace a file using local[:remote] syntax. Can be provided multiple times.',
|
|
60
|
+
multiple: true,
|
|
61
|
+
}),
|
|
62
|
+
};
|
|
63
|
+
export function testingConnectionOptions(flags) {
|
|
64
|
+
return {
|
|
65
|
+
domain: flags.domain,
|
|
66
|
+
org: flags.org,
|
|
67
|
+
pat: flags.pat,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=testing-flags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing-flags.js","sourceRoot":"","sources":["../../src/lib/testing-flags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAIjC,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;QACnB,WAAW,EAAE,4FAA4F;KAC1G,CAAC;IACF,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC;QACjB,WAAW,EAAE,yFAAyF;KACvG,CAAC;IACF,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC;QAChB,WAAW,EAAE,0FAA0F;KACxG,CAAC;CACH,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC;QACrB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,iBAAiB;QAC9B,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC;QACjB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,kBAAkB;QAC/B,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;QACnB,WAAW,EAAE,+CAA+C;KAC7D,CAAC;CACH,CAAA;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,qCAAqC;KACnD,CAAC;CACH,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC;QAChB,WAAW,EAAE,uFAAuF;QACpG,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC;QACjB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,iEAAiE;QAC9E,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,CAAA;AAED,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC;QAChB,WAAW,EAAE,yEAAyE;QACtF,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC;QACnB,WAAW,EAAE,gEAAgE;QAC7E,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC;QACpB,WAAW,EAAE,6EAA6E;QAC1F,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,CAAA;AAQD,MAAM,UAAU,wBAAwB,CAAC,KAAkC;IACzE,OAAO;QACL,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,GAAG,EAAE,KAAK,CAAC,GAAG;KACf,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { URL } from 'node:url';
|
|
2
|
+
import { type TestingConnectionOverrides } from './testing-config.js';
|
|
3
|
+
export declare const TESTING_DEFAULT_TIMEOUT_MS = 45000;
|
|
4
|
+
export type TestingRequest = {
|
|
5
|
+
body?: unknown;
|
|
6
|
+
endpoint: string;
|
|
7
|
+
method: 'DELETE' | 'GET' | 'PATCH' | 'POST' | 'PUT';
|
|
8
|
+
responseType?: 'json' | 'text';
|
|
9
|
+
service: 'pace' | 'platform';
|
|
10
|
+
};
|
|
11
|
+
export type TestingHttpRequestFn = (url: URL, method: string, headers: Record<string, string>, body: unknown, timeoutMs: number) => Promise<string>;
|
|
12
|
+
export type TestingGatewayCallOptions = TestingConnectionOverrides & {
|
|
13
|
+
timeoutMs?: number;
|
|
14
|
+
};
|
|
15
|
+
export declare class TestingGatewayError extends Error {
|
|
16
|
+
readonly requestMethod?: string;
|
|
17
|
+
readonly requestUrl?: string;
|
|
18
|
+
readonly retryAfterSeconds?: number;
|
|
19
|
+
readonly statusCode?: number;
|
|
20
|
+
constructor(message: string, options?: {
|
|
21
|
+
request?: {
|
|
22
|
+
method?: string;
|
|
23
|
+
url?: string;
|
|
24
|
+
};
|
|
25
|
+
retryAfterSeconds?: number;
|
|
26
|
+
statusCode?: number;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export declare class TestingGateway {
|
|
30
|
+
static call<T = unknown>(request: TestingRequest, options?: TestingGatewayCallOptions): Promise<T>;
|
|
31
|
+
}
|
|
32
|
+
export declare function setTestingHttpRequestForTests(requestFn: TestingHttpRequestFn): void;
|
|
33
|
+
export declare function resetTestingHttpRequestForTests(): void;
|