@copado/agentia-cli 0.94.0-alpha.0 → 0.95.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@copado/agentia-cli",
3
3
  "description": "Command-line interface for Agentia",
4
- "version": "0.94.0-alpha.0",
4
+ "version": "0.95.0-alpha.0",
5
5
  "author": "Copado Solutions",
6
6
  "bin": {
7
7
  "agentia": "./bin/run.js"
@@ -4,19 +4,35 @@
4
4
 
5
5
  Use this reference for `agentia cicd work ...` and matching MCP tools such as `agentia_work_get`, `agentia_work_commit`, `agentia_work_push`, and `agentia_work_submit`.
6
6
 
7
- ## Workflow
7
+ ## Choose One Workflow
8
8
 
9
- 1. Discover: `agentia cicd work list --assigned-to-me --json`
10
- 2. Inspect: `agentia cicd work get <id-or-name> --json`
11
- 3. Activate: `agentia cicd work set <id-or-name> --json`
12
- 4. Implement and choose one commit path:
13
- - Local Git: `agentia cicd work commit --local --all --json`
14
- - Copado cloud metadata: `agentia cicd work commit <story-id> --cloud --metadata-name <name> --metadata-type <type> --metadata-category SFDX --json`
15
- 5. Register local commits: `agentia cicd work push --json`
16
- 6. Validate and submit: `agentia cicd work submit --json`
17
- 7. Promote only on explicit approval: `agentia cicd work submit --done --json`
9
+ Local and cloud work are separate delivery paths. Do not continue a cloud commit with local `work push` or `work submit`: those commands inspect and push the local Git feature branch.
18
10
 
19
- `work set`, `work push`, and `work submit` expect a clean tracked working tree and the active story context recorded by `work set`.
11
+ ### Local Repository Flow
12
+
13
+ Use this path when the change exists in the local repository:
14
+
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.
17
+ 3. Implement and stage new files with `git add`. Commit with Git, or use `agentia cicd work commit --local --all --json` when Agentia should also remember permission, full-metadata, or Apex-test selections. `--local` is the default, and `--all` includes tracked changes only.
18
+ 4. Run project-owned gates: `agentia cicd work test --local --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 push --json`. A plain `git push` does not register a Copado Commit or merge the feature branch into the recorded dev org branch.
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 --done --json`. `work done` is a compatibility alias.
22
+ 8. Check asynchronous results with `agentia cicd work status [id-or-name] --json`.
23
+
24
+ `work set`, `work push`, and `work submit` require a clean tracked working tree. `work push` also requires the exact `feature/<story-name>` branch, recorded `lastBaseBranch` and `lastDevOrgBranch`, and at least one commit in `lastBaseBranch..HEAD`. `work submit` permits an empty commit range only for a Story with a Salesforce Data Set or Data Template deployment step.
25
+
26
+ ### Copado Cloud Flow
27
+
28
+ Use this path when Copado should retrieve metadata from a configured source environment instead of using local Git changes:
29
+
30
+ 1. Inspect the Story and pass its Salesforce ID explicitly when possible. An active Story from `work set` is optional, not a prerequisite for the cloud operation.
31
+ 2. Start a cloud commit with `agentia cicd work commit <story-id> --cloud ... --json`. Use the simple metadata flags for one change, or `--file`/`--stdin` for a multi-change request. Salesforce metadata requires `--metadata-category SFDX`.
32
+ 3. Let the command wait for its Job Execution by default. After a timeout, use the returned execution ID with `agentia cicd job get` and `agentia cicd job log get`; do not immediately submit a duplicate commit.
33
+ 4. When explicitly approved to promote an existing Promotion, use `agentia cicd work promote <story-id> --cloud --json`; add `--deploy` only for promote-and-deploy. This is independent of local `work submit`.
34
+
35
+ Cloud commit checks Story readiness and source credentials before submission. Avoid concurrent cloud commits to one Story. Treat `--recreate-feature-branch` as destructive because it can overwrite Story-branch work.
20
36
 
21
37
  ## Core Commands
22
38
 
@@ -27,28 +43,34 @@ Use this reference for `agentia cicd work ...` and matching MCP tools such as `a
27
43
  | `work create` | Create a story | Use `--title`, project/team/assignee/theme fields, specs, and short acceptance criteria. |
28
44
  | `work update [ID]` | Mutate story fields or status | ID is optional after `work set`. Acceptance criteria must be fewer than 255 chars. |
29
45
  | `work set ID` | Mark active and prepare branch | Fetches base branch, creates/checks out `feature/<story-name>`, stores local context. |
30
- | `work commit` | Local or cloud commit | `--local` is default; `--cloud` calls Copado commit APIs and can poll a job. |
46
+ | `work commit` | Local or cloud commit | The flag sets are disjoint. `--local` is default and performs no gateway call; `--cloud` calls Copado commit APIs and polls by default. |
31
47
  | `work push` | Push local commits and register with Copado | Requires active story context and clean tree. Sends stored retrieve-only permissions. |
32
48
  | `work test --local` | Run local quality gate scripts | Runs `.agentia_quality_gates.sh` or `.agentia_quality_gates.cmd` from repo root. |
33
49
  | `work submit` | Submit for review/validation or promote | Runs local gates unless `--skip-local-tests`; can push ahead commits. `--done` matches Copado UI Submit when promoting. |
50
+ | `work done` | Compatibility alias | Prefer `work submit --done`; both promote and deploy rather than validate-only. |
34
51
  | `work promote` | Story-centric promotion run | Requires `--cloud`; use `--deploy` for merge and deploy. |
35
52
  | `work status [ID]` | Check story and related executions | Useful after submit, promote, or commit jobs. |
36
53
  | `work open [ID]` | Open story in browser | CLI-only browser helper. |
37
54
 
38
- ## Local Commit Path
55
+ ## Local Repository Details
39
56
 
40
- Use local commits for normal source changes:
57
+ Use local commits for normal source changes. Stage new files explicitly because `--all` behaves like `git commit -a`:
41
58
 
42
59
  ```sh
60
+ git add -A
43
61
  agentia cicd work commit --local --all --permissions CustomField:Account.SLA__c,ApexClass:AccountService --json
62
+ agentia cicd work test --local --json
44
63
  agentia cicd work push --json
64
+ agentia cicd work submit --json
45
65
  ```
46
66
 
47
- `--permissions` records metadata that Copado should treat as Retrieve Only during push. List the metadata the permissions point at, not the permission set or profile files themselves. The value is sticky in local user config until replaced or cleared with `--permissions ""`.
67
+ `--permissions` records metadata that Copado should treat as Retrieve Only during push. 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 selections are sticky in local user config until replaced or cleared with an empty value. Push-time selections apply only to that push.
48
68
 
49
69
  `--apex-test-classes` records story-related test class names for later reference. `work test --local` and `work submit` still take `--apex-test-classes` explicitly when you want the local gate script to receive them.
50
70
 
51
- ## Cloud Commit Path
71
+ `work push` 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
+ ## Cloud Operation Details
52
74
 
53
75
  Use cloud commits when Copado should retrieve metadata itself:
54
76
 
@@ -59,6 +81,15 @@ agentia cicd work commit <story-id> --cloud --file commit-request.json --json
59
81
 
60
82
  For Salesforce metadata, include `--metadata-category SFDX`. Without the SFDX category, Copado deploy logs can report "Salesforce changes not found."
61
83
 
84
+ For a cloud promotion, the Story must already belong to a Promotion:
85
+
86
+ ```sh
87
+ agentia cicd work promote <story-id> --cloud --json
88
+ agentia cicd work promote <story-id> --cloud --deploy --json
89
+ ```
90
+
91
+ Cloud commit and promotion wait for Job Executions by default and return nonzero on failed or timed-out jobs while preserving diagnostic IDs. If a Promotion reaches Merge Conflict, resolve it and resume the original execution; do not start a replacement run.
92
+
62
93
  ## Deployment Steps
63
94
 
64
95
  Deployment steps are attached to a user story and run during promotion.
@@ -78,6 +109,8 @@ Prefer explicit flags for standard step types. Use `--config-json`, `--file`, or
78
109
  ## Gotchas
79
110
 
80
111
  - `work test --local` is not CRT. For Robot Framework execution, use the `agentia-testing` skill.
81
- - `work submit` may push ahead commits, but `work set` is still required first.
112
+ - Local `work commit` rejects Story IDs and cloud-only flags; cloud `work commit --cloud` rejects local-only flags.
113
+ - `work submit` may push ahead commits, but the local flow still needs story and branch context from `work set`.
82
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 push` and `work submit`.
83
116
  - `work delete` is destructive; read the story and confirm intent first.