@copado/agentia-cli 0.116.0-alpha.0 → 0.118.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 +369 -358
- package/dist/commands/cicd/work/commit.d.ts +0 -5
- package/dist/commands/cicd/work/commit.js +18 -33
- package/dist/commands/cicd/work/commit.js.map +1 -1
- package/dist/commands/cicd/work/publish.d.ts +12 -0
- package/dist/commands/cicd/work/publish.js +20 -0
- package/dist/commands/cicd/work/publish.js.map +1 -0
- package/dist/commands/cicd/work/push.d.ts +4 -0
- package/dist/commands/cicd/work/push.js +11 -82
- package/dist/commands/cicd/work/push.js.map +1 -1
- package/dist/commands/cicd/work/set.d.ts +2 -2
- package/dist/commands/cicd/work/set.js +6 -2
- package/dist/commands/cicd/work/set.js.map +1 -1
- package/dist/commands/cicd/work/status.js +14 -13
- package/dist/commands/cicd/work/status.js.map +1 -1
- package/dist/commands/cicd/work/submit.d.ts +2 -0
- package/dist/commands/cicd/work/submit.js +11 -3
- package/dist/commands/cicd/work/submit.js.map +1 -1
- package/dist/commands/cicd/work/test/apex.d.ts +11 -0
- package/dist/commands/cicd/work/test/apex.js +57 -0
- package/dist/commands/cicd/work/test/apex.js.map +1 -0
- package/dist/commands/cicd/work/test.js +12 -4
- package/dist/commands/cicd/work/test.js.map +1 -1
- package/dist/lib/cicd-gateway.d.ts +4 -0
- package/dist/lib/cicd-gateway.js +49 -3
- package/dist/lib/cicd-gateway.js.map +1 -1
- package/dist/lib/defaults-store.d.ts +1 -1
- package/dist/lib/defaults-store.js +1 -1
- package/dist/lib/git-worktree.d.ts +6 -0
- package/dist/lib/git-worktree.js +35 -1
- package/dist/lib/git-worktree.js.map +1 -1
- package/dist/lib/local-quality-gates.d.ts +4 -0
- package/dist/lib/local-quality-gates.js +1 -1
- package/dist/lib/local-quality-gates.js.map +1 -1
- package/dist/lib/mcp/tools.d.ts +12 -2
- package/dist/lib/mcp/tools.js +10 -8
- package/dist/lib/mcp/tools.js.map +1 -1
- package/dist/lib/mcp/work-tools.d.ts +18 -6
- package/dist/lib/mcp/work-tools.js +75 -50
- package/dist/lib/mcp/work-tools.js.map +1 -1
- package/dist/lib/nested-metadata-changes.d.ts +4 -4
- package/dist/lib/setup-templates.d.ts +3 -3
- package/dist/lib/setup-templates.js +33 -28
- package/dist/lib/setup-templates.js.map +1 -1
- package/dist/lib/setup-wizard.js +1 -1
- package/dist/lib/setup-wizard.js.map +1 -1
- package/dist/lib/stock-quality-gates.d.ts +12 -0
- package/dist/lib/stock-quality-gates.js +67 -0
- package/dist/lib/stock-quality-gates.js.map +1 -0
- package/dist/lib/work-apex-test.d.ts +56 -0
- package/dist/lib/work-apex-test.js +265 -0
- package/dist/lib/work-apex-test.js.map +1 -0
- package/dist/lib/work-branch-metadata.d.ts +2 -0
- package/dist/lib/work-branch-metadata.js +9 -0
- package/dist/lib/work-branch-metadata.js.map +1 -1
- package/dist/lib/work-local-commit.d.ts +1 -1
- package/dist/lib/work-local-commit.js +1 -1
- package/dist/lib/work-publish-command.d.ts +26 -0
- package/dist/lib/work-publish-command.js +88 -0
- package/dist/lib/work-publish-command.js.map +1 -0
- package/dist/lib/work-push.d.ts +3 -3
- package/dist/lib/work-push.js +12 -12
- package/dist/lib/work-push.js.map +1 -1
- package/dist/lib/work-set-selection.d.ts +3 -1
- package/dist/lib/work-set-selection.js +19 -1
- package/dist/lib/work-set-selection.js.map +1 -1
- package/dist/lib/work-types.d.ts +12 -1
- package/dist/lib/work-types.js.map +1 -1
- package/oclif.manifest.json +292 -212
- package/package.json +4 -1
- package/templates/AGENTS.md +2 -2
- package/templates/skills/agentia-cicd/SKILL.md +4 -3
- package/templates/skills/agentia-cicd/references/work.md +25 -23
package/templates/AGENTS.md
CHANGED
|
@@ -8,7 +8,7 @@ Authentication must be configured before operational commands. Never print crede
|
|
|
8
8
|
|
|
9
9
|
## Copado workflow
|
|
10
10
|
|
|
11
|
-
`list → get → set → commit →
|
|
11
|
+
`list → get → set → (implement & git commit) → test → publish → submit [--done|--deploy]`
|
|
12
12
|
|
|
13
13
|
Read records before changing them and use IDs returned by Copado. Do not skip `work set` before coding; use one story per feature branch. Keep the working tree clean for lifecycle commands, and confirm promotion/deployment intent before `done`.
|
|
14
14
|
|
|
@@ -16,7 +16,7 @@ Read records before changing them and use IDs returned by Copado. Do not skip `w
|
|
|
16
16
|
|
|
17
17
|
Load exactly one copy of each applicable Agentia skill. Prefer the client-specific root when available (`.cursor/skills` in Cursor or `.claude/skills` in Claude); otherwise use `.agents/skills`.
|
|
18
18
|
|
|
19
|
-
- `agentia-cicd/SKILL.md`: Copado stories, commits,
|
|
19
|
+
- `agentia-cicd/SKILL.md`: Copado stories, commits, publish, submit, done, promotions, jobs, environments, pipelines, and data.
|
|
20
20
|
- `agentia-testing/SKILL.md`: Copado Robotic Testing operations.
|
|
21
21
|
- `agentia-ai/SKILL.md`: Copado AI operations.
|
|
22
22
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: agentia-cicd
|
|
3
|
-
description: Use this skill when managing Copado CICD work with the Agentia CLI or Agentia MCP tools: user stories, work commit/
|
|
3
|
+
description: Use this skill when managing Copado CICD work with the Agentia CLI or Agentia MCP tools: user stories, work commit/publish/submit/done, promotion runs and conflicts, job executions, environments, credentials, pipelines, stages, and release data templates. Use it whenever the user asks an agent to operate Copado CICD from a terminal, IDE, or headless workflow.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
<!-- Agentia managed skill file: agentia setup skills -->
|
|
@@ -20,7 +20,7 @@ Prefer Agentia MCP tools when they are available and match the task. Use CLI exa
|
|
|
20
20
|
|
|
21
21
|
## References
|
|
22
22
|
|
|
23
|
-
- User stories,
|
|
23
|
+
- User stories, git commits, cloud commits, publish, submit, done, quality gates, and deployment steps: [references/work.md](references/work.md)
|
|
24
24
|
- Promotion lookup, run, resume, merge conflicts, and story-centric promotion: [references/promotions.md](references/promotions.md)
|
|
25
25
|
- Copado JobExecution lookup, actions, logs, and monitoring: [references/jobs.md](references/jobs.md)
|
|
26
26
|
- Copado environments, environment credentials, and browser authentication: [references/environments-and-credentials.md](references/environments-and-credentials.md)
|
|
@@ -31,9 +31,10 @@ Prefer Agentia MCP tools when they are available and match the task. Use CLI exa
|
|
|
31
31
|
|
|
32
32
|
- Use Salesforce record IDs or generated names read from Copado. Do not invent story names, promotion IDs, job IDs, credential IDs, or pipeline IDs.
|
|
33
33
|
- Keep human output off stdout in JSON workflows. Prefer `--json`, then parse the result object.
|
|
34
|
-
- For local project work, keep the tracked working tree clean before commands that require it: `work set`, `work
|
|
34
|
+
- For local project work, keep the tracked working tree clean before commands that require it: `work set`, `work publish`, and `work submit`. If `work set` returns `status: "warning"`, show the message and do not assume a feature branch or local work context was created.
|
|
35
35
|
- Treat `cicd job` as Copado CICD JobExecution. It is different from CRT `testing job`.
|
|
36
36
|
- Treat `cicd work test` as local quality gates (`--local` is the default). It is different from CRT `testing test run`.
|
|
37
|
+
- Treat `cicd work test apex` as the Apex test runner that local quality gates (`.agentia_quality_gates.*`) usually call when those scripts are configured. It can also be invoked directly. It is different from CRT.
|
|
37
38
|
- Treat `auth` credentials as keychain/API credentials and `cicd credential` records as Copado environment credentials.
|
|
38
39
|
|
|
39
40
|
## Report Back
|
|
@@ -2,26 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
# CICD Work Reference
|
|
4
4
|
|
|
5
|
-
Use this reference for `agentia cicd work ...` and matching MCP tools such as `agentia_work_get`, `agentia_work_commit`, `
|
|
5
|
+
Use this reference for `agentia cicd work ...` and matching MCP tools such as `agentia_work_get`, `agentia_work_commit`, `agentia_work_publish`, and `agentia_work_submit`.
|
|
6
6
|
|
|
7
7
|
## Choose One Workflow
|
|
8
8
|
|
|
9
|
-
Local and cloud work are separate delivery paths. Do not continue a cloud commit with local `work
|
|
9
|
+
Local and cloud work are separate delivery paths. Do not continue a cloud commit with local `work publish` or `work submit`: those commands inspect and push the local Git feature branch.
|
|
10
10
|
|
|
11
11
|
### Local Repository Flow
|
|
12
12
|
|
|
13
13
|
Use this path when the change exists in the local repository:
|
|
14
14
|
|
|
15
15
|
1. Discover and inspect: `agentia cicd work list --assigned-to-me --json`, then `agentia cicd work get <id-or-name> --json`.
|
|
16
|
-
2. Activate: `agentia cicd work set <id-or-name> --json`. This fetches the configured base branch, checks out `feature/<story-name>`, and records the story, base branch, dev org branch, and pull-request context in `.agentia/config.user.json`. Use `--base-branch <branch>` only when intentionally overriding the Pipeline default. If the Story source credential differs from the project default, work set warns with the current credential and environment and does not PATCH; use `agentia cicd work update <id> --source-credential <credential-id>` to change it.
|
|
17
|
-
3. Implement
|
|
18
|
-
4. Run project-owned gates: `agentia cicd work test --json`. This runs `.agentia_quality_gates.sh` or `.agentia_quality_gates.cmd` from the repository root when present.
|
|
19
|
-
5. Register and synchronize: `agentia cicd work
|
|
20
|
-
6. Validate and open the merge-request flow: `agentia cicd work submit --json`. Submit runs the local gates unless `--skip-local-tests` is explicit, pushes ahead commits, and submits with validate-only behavior.
|
|
21
|
-
7. Only with explicit approval to promote and deploy, run `agentia cicd work submit --
|
|
16
|
+
2. Activate: `agentia cicd work set <id-or-name> --json`. This fetches the configured base branch, checks out `feature/<story-name>`, and records the story, base branch, dev org branch, and pull-request context in `.agentia/config.user.json`. Use `--base-branch <branch>` only when intentionally overriding the Pipeline default. If the JSON result has `status: "warning"` (missing pipeline or credential), show that `message`, do not assume a feature branch was created, and stop until the Story setup is fixed — publish and submit will not work. If the Story source credential differs from the project default, work set warns with the current credential and environment and does not PATCH; use `agentia cicd work update <id> --source-credential <credential-id>` to change it.
|
|
17
|
+
3. Implement with Salesforce CLI, VS Code, or an IDE. Stage and commit with `git add` / `git commit`. Do not use `agentia cicd work commit` for local Git work.
|
|
18
|
+
4. Run project-owned gates: `agentia cicd work test --json`. This runs `.agentia_quality_gates.sh` or `.agentia_quality_gates.cmd` from the repository root when present. If those files are missing, it warns and runs `agentia cicd work test apex` via the stock sample from a temporary file. Local tests can be slow; pass `--apex-test-classes=MyTest,OtherTest` for faster, earlier Apex checks.
|
|
19
|
+
5. Register and synchronize: `agentia cicd work publish --json`. A plain `git push` does not register a Copado Commit or merge the feature branch into the recorded dev org branch. Pass `--permissions` and `--full-metadata` when nested detection is not enough.
|
|
20
|
+
6. Validate and open the merge-request flow: `agentia cicd work submit --json`. Submit runs the local gates unless `--skip-local-tests` is explicit, pushes ahead commits, and submits with validate-only behavior. `--skip-pull-request` skips opening the compare URL.
|
|
21
|
+
7. Only with explicit approval to promote and deploy, run `agentia cicd work submit --deploy --json` (or `--done`). `work done` is a compatibility alias.
|
|
22
22
|
8. Check asynchronous results with `agentia cicd work status [id-or-name] --json`.
|
|
23
23
|
|
|
24
|
-
`work set`, `work
|
|
24
|
+
`work set`, `work publish`, and `work submit` require a clean tracked working tree. `work publish` also requires the exact `feature/<story-name>` branch, recorded `lastBaseBranch` and `lastDevOrgBranch`, and at least one commit in `origin/<lastBaseBranch>..HEAD`. `work submit` fetches `origin/<lastBaseBranch>` and permits an empty commit range only for a Story with a Salesforce Data Set or Data Template deployment step.
|
|
25
25
|
|
|
26
26
|
### Copado Cloud Flow
|
|
27
27
|
|
|
@@ -42,11 +42,12 @@ Cloud commit checks Story readiness and source credentials before submission. Av
|
|
|
42
42
|
| `work get [ID]` | Read story details | ID is optional after `work set`. Human output redacts OAuth signatures; JSON preserves structured fields. |
|
|
43
43
|
| `work create` | Create a story | Use `--title`, project/team/assignee/theme fields, specs, and short acceptance criteria. `--source-credential` sends `sourceEnvironment` as null so Salesforce assigns the environment. |
|
|
44
44
|
| `work update [ID]` | Mutate story fields or status | ID is optional after `work set`. Acceptance criteria must be fewer than 255 chars. `--source-credential` sends `sourceEnvironment` as null. |
|
|
45
|
-
| `work set ID` | Mark active and prepare branch | Fetches base branch, creates/checks out `feature/<story-name>`, stores local context. Warns without PATCHing when the Story credential differs from the project default; use `work update --source-credential` to change it. `--none` clears every `last*` key and checks out `lastBaseBranch`, else `main`, else `master`. |
|
|
46
|
-
| `work commit` |
|
|
47
|
-
| `work
|
|
48
|
-
| `work test` | Run local quality gate scripts | `--local` is default. Runs `.agentia_quality_gates.sh` or `.agentia_quality_gates.cmd` from repo root. `--cloud` is not implemented yet. |
|
|
49
|
-
| `work
|
|
45
|
+
| `work set ID` | Mark active and prepare branch | Fetches base branch, creates/checks out `feature/<story-name>`, stores local context. A gateway warning prints the message and skips git. Warns without PATCHing when the Story credential differs from the project default; use `work update --source-credential` to change it. `--none` clears every `last*` key and checks out `lastBaseBranch`, else `main`, else `master`. |
|
|
46
|
+
| `work commit` | Copado cloud metadata commit | Requires `--cloud`. For local Git work, use `git commit` then `work publish`. |
|
|
47
|
+
| `work publish` | Publish local commits and register with Copado | Requires active story context and clean tree. Accepts `--permissions` and `--full-metadata` when nested detection is not enough. `work push` is a compatibility alias. |
|
|
48
|
+
| `work test` | Run local quality gate scripts | `--local` is default. Runs `.agentia_quality_gates.sh` or `.agentia_quality_gates.cmd` from repo root. If missing, warns and runs the stock setup sample from a temp file. `--cloud` is not implemented yet. |
|
|
49
|
+
| `work test apex` | Run named Apex test classes | Required `--apex-test-classes`. Optional `--wait` minutes (default 60). Usually invoked from `.agentia_quality_gates.*` when local quality gates are configured. |
|
|
50
|
+
| `work submit` | Submit for review/validation or promote | Runs local gates unless `--skip-local-tests`; can push ahead commits. `--skip-pull-request` skips opening the MR URL. `--done` and `--deploy` match Copado UI Submit when promoting. |
|
|
50
51
|
| `work done` | Compatibility alias | Prefer `work submit --done`; both promote and deploy rather than validate-only. |
|
|
51
52
|
| `work promote` | Story-centric promotion run | Requires `--cloud`; use `--deploy` for merge and deploy. |
|
|
52
53
|
| `work status [ID]` | Check story and related executions | Useful after submit, promote, or commit jobs. |
|
|
@@ -54,21 +55,21 @@ Cloud commit checks Story readiness and source credentials before submission. Av
|
|
|
54
55
|
|
|
55
56
|
## Local Repository Details
|
|
56
57
|
|
|
57
|
-
Use
|
|
58
|
+
Use Git for normal source changes:
|
|
58
59
|
|
|
59
60
|
```sh
|
|
60
61
|
git add -A
|
|
61
|
-
|
|
62
|
+
git commit -m "US-0001 add account service"
|
|
62
63
|
agentia cicd work test --json
|
|
63
|
-
agentia cicd work
|
|
64
|
+
agentia cicd work publish --permissions CustomField:Account.SLA__c,ApexClass:AccountService --json
|
|
64
65
|
agentia cicd work submit --json
|
|
65
66
|
```
|
|
66
67
|
|
|
67
|
-
`--permissions`
|
|
68
|
+
`--permissions` on publish names metadata that Copado should treat as Retrieve Only. List the components whose access changed, not the permission set or profile files. Use `--full-metadata` only when a profile or permission set should travel as a complete file, because it can overwrite permissions the Story did not touch. Both flags apply to that publish only.
|
|
68
69
|
|
|
69
|
-
|
|
70
|
+
`work test` and `work submit` take `--apex-test-classes` when you want the local gate script to receive them as `AGENTIA_APEX_TEST_CLASSES`. Sample quality-gate scripts pass that value to `work test apex`.
|
|
70
71
|
|
|
71
|
-
`work
|
|
72
|
+
`work publish` detects nested metadata across the full branch diff from the merge base to `HEAD`, applies Copado environment-variable and YAML replacements, registers every commit in the range, and merges into the recorded dev org branch. Review unexpected Retrieve Only, Full Metadata, or nested-deletion output before continuing.
|
|
72
73
|
|
|
73
74
|
## Cloud Operation Details
|
|
74
75
|
|
|
@@ -109,8 +110,9 @@ Prefer explicit flags for standard step types. Use `--config-json`, `--file`, or
|
|
|
109
110
|
## Gotchas
|
|
110
111
|
|
|
111
112
|
- `work test` is not CRT. For Robot Framework execution, use the `agentia-testing` skill.
|
|
112
|
-
-
|
|
113
|
+
- `work test apex` runs named Apex classes. Local quality gates (`.agentia_quality_gates.*`) usually call it when `AGENTIA_APEX_TEST_CLASSES` is set. Direct use is for a targeted rerun without the rest of the gates.
|
|
114
|
+
- Local Git work uses `git commit` then `work publish`. Cloud `work commit --cloud` is a separate path.
|
|
113
115
|
- `work submit` may push ahead commits, but the local flow still needs story and branch context from `work set`.
|
|
114
|
-
- `work submit --done` promotes/deploys. Do not run it unless the user explicitly asked to promote or finish the story.
|
|
115
|
-
- `work promote --cloud` is not the next step after a local commit; local delivery uses `work
|
|
116
|
+
- `work submit --done` (or `--deploy`) promotes/deploys. Do not run it unless the user explicitly asked to promote or finish the story.
|
|
117
|
+
- `work promote --cloud` is not the next step after a local git commit; local delivery uses `work publish` and `work submit`.
|
|
116
118
|
- `work delete` is destructive; read the story and confirm intent first.
|