@copado/agentia-cli 0.92.0-alpha.0 → 0.94.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.
Files changed (64) hide show
  1. package/README.md +235 -217
  2. package/dist/commands/cicd/work/commit.js +2 -2
  3. package/dist/commands/cicd/work/commit.js.map +1 -1
  4. package/dist/commands/cicd/work/done.d.ts +4 -0
  5. package/dist/commands/cicd/work/done.js +11 -124
  6. package/dist/commands/cicd/work/done.js.map +1 -1
  7. package/dist/commands/cicd/work/push.js +4 -3
  8. package/dist/commands/cicd/work/push.js.map +1 -1
  9. package/dist/commands/cicd/work/submit.d.ts +4 -3
  10. package/dist/commands/cicd/work/submit.js +13 -4
  11. package/dist/commands/cicd/work/submit.js.map +1 -1
  12. package/dist/commands/setup/skills/create.d.ts +1 -1
  13. package/dist/commands/setup/skills/create.js +3 -2
  14. package/dist/commands/setup/skills/create.js.map +1 -1
  15. package/dist/commands/setup/skills/update.d.ts +1 -1
  16. package/dist/commands/setup/skills/update.js +3 -2
  17. package/dist/commands/setup/skills/update.js.map +1 -1
  18. package/dist/commands/setup.d.ts +3 -0
  19. package/dist/commands/setup.js +20 -0
  20. package/dist/commands/setup.js.map +1 -1
  21. package/dist/lib/defaults-store.js +9 -0
  22. package/dist/lib/defaults-store.js.map +1 -1
  23. package/dist/lib/mcp/tools.d.ts +14 -0
  24. package/dist/lib/mcp/work-tools.d.ts +15 -0
  25. package/dist/lib/mcp/work-tools.js +50 -34
  26. package/dist/lib/mcp/work-tools.js.map +1 -1
  27. package/dist/lib/nested-metadata-changes.d.ts +41 -3
  28. package/dist/lib/nested-metadata-changes.js +110 -16
  29. package/dist/lib/nested-metadata-changes.js.map +1 -1
  30. package/dist/lib/nested-metadata-registry.d.ts +13 -1
  31. package/dist/lib/nested-metadata-registry.js +87 -28
  32. package/dist/lib/nested-metadata-registry.js.map +1 -1
  33. package/dist/lib/project-setup.d.ts +16 -8
  34. package/dist/lib/project-setup.js +81 -80
  35. package/dist/lib/project-setup.js.map +1 -1
  36. package/dist/lib/setup-prompts.d.ts +8 -0
  37. package/dist/lib/setup-prompts.js +2 -1
  38. package/dist/lib/setup-prompts.js.map +1 -1
  39. package/dist/lib/setup-skills.d.ts +18 -2
  40. package/dist/lib/setup-skills.js +48 -36
  41. package/dist/lib/setup-skills.js.map +1 -1
  42. package/dist/lib/setup-templates.d.ts +2 -7
  43. package/dist/lib/setup-templates.js +3 -159
  44. package/dist/lib/setup-templates.js.map +1 -1
  45. package/dist/lib/setup-wizard.d.ts +2 -0
  46. package/dist/lib/setup-wizard.js +3 -0
  47. package/dist/lib/setup-wizard.js.map +1 -1
  48. package/dist/lib/work-done.d.ts +22 -0
  49. package/dist/lib/work-done.js +136 -0
  50. package/dist/lib/work-done.js.map +1 -0
  51. package/dist/lib/work-local-commit.js +18 -2
  52. package/dist/lib/work-local-commit.js.map +1 -1
  53. package/dist/lib/work-push.d.ts +18 -5
  54. package/dist/lib/work-push.js +101 -30
  55. package/dist/lib/work-push.js.map +1 -1
  56. package/dist/lib/work-types.d.ts +22 -23
  57. package/dist/lib/work-types.js.map +1 -1
  58. package/oclif.manifest.json +1439 -1406
  59. package/package.json +1 -1
  60. package/templates/AGENTS.md +24 -0
  61. package/templates/skills/agentia-cicd/SKILL.md +1 -1
  62. package/templates/skills/agentia-cicd/references/data.md +70 -1
  63. package/templates/skills/agentia-cicd/references/promotions.md +1 -1
  64. package/templates/skills/agentia-cicd/references/work.md +7 -8
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.92.0-alpha.0",
4
+ "version": "0.94.0-alpha.0",
5
5
  "author": "Copado Solutions",
6
6
  "bin": {
7
7
  "agentia": "./bin/run.js"
@@ -0,0 +1,24 @@
1
+ # Agentia CLI for AI Agents
2
+
3
+ <!-- agentia:managed:start -->
4
+
5
+ Use Agentia to manage Copado work items. Prefer registered Agentia MCP tools; otherwise use the CLI with `--json`.
6
+
7
+ Authentication must be configured before operational commands. Never print credentials, tokens, or unmasked environment variables.
8
+
9
+ ## Copado workflow
10
+
11
+ `list → get → set → commit → push → submit → done`
12
+
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
+
15
+ ## Agent Skills
16
+
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
+
19
+ - `agentia-cicd/SKILL.md`: Copado stories, commits, push, submit, done, promotions, jobs, environments, pipelines, and data.
20
+ - `agentia-testing/SKILL.md`: Copado Robotic Testing operations.
21
+ - `agentia-ai/SKILL.md`: Copado AI operations.
22
+
23
+ Project rules in this file take precedence over managed skill guidance. Refresh managed skills with `agentia setup skills update`; do not hand-edit managed files.
24
+ <!-- agentia:managed:end -->
@@ -31,7 +31,7 @@ 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 push`, `work submit`, and `work done`.
34
+ - For local project work, keep the tracked working tree clean before commands that require it: `work set`, `work push`, and `work submit`.
35
35
  - Treat `cicd job` as Copado CICD JobExecution. It is different from CRT `testing job`.
36
36
  - Treat `cicd work test --local` as local quality gates. It is different from CRT `testing test run`.
37
37
  - Treat `auth` credentials as keychain/API credentials and `cicd credential` records as Copado environment credentials.
@@ -6,6 +6,75 @@ Use this reference for Release Data Template commands under `agentia cicd data .
6
6
 
7
7
  Data commands often accept large JSON bodies. Prefer `--file` or `--stdin` for complex payloads and `--json` for machine-readable responses.
8
8
 
9
+ ## Operating Rules
10
+
11
+ - Read the target template, credential, User Story, or data commit before mutating it.
12
+ - Use IDs returned by Copado. Do not infer template, credential, commit, or ContentVersion IDs.
13
+ - Use `data sobject fields` and `data sobject relationships` before constructing payloads that reference Salesforce fields or relationships.
14
+ - For JSON payload commands, use exactly one input source: inline JSON flags, `--file`, or `--stdin`.
15
+ - Prefer `--file` when a payload should be reviewed, edited, or reused. Prefer `--stdin` for generated, one-use payloads.
16
+ - After every mutation, read the affected resource back or run its corresponding `list` command.
17
+
18
+ ## Choose A Workflow
19
+
20
+ | Intent | Workflow |
21
+ | --- | --- |
22
+ | Find or export an existing template | Inspect A Template |
23
+ | Test source records and destination matching | Validate Records And Matching |
24
+ | Update templates after metadata changes | Synchronize Metadata Changes |
25
+ | Attach data to a User Story and inspect generated files | Create A Data Commit |
26
+ | Convert or remove a template | Legacy Conversion And Deletion |
27
+
28
+ ## Inspect A Template
29
+
30
+ 1. Discover candidates with `data template list --json`.
31
+ 2. Inspect the selected-column graph with `data template get <template-id> --json`.
32
+ 3. Use `data template get-detail <template-id> --json` only when raw v2 configuration is needed for editing or troubleshooting.
33
+ 4. Inspect attached filters and formulas with `data filter list` and `data formula list` when relevant.
34
+
35
+ Finish when the correct template and its current configuration have been identified. Keep `get-detail` output as a baseline before changing template detail.
36
+
37
+ ## Validate Records And Matching
38
+
39
+ 1. Inspect the template and source/destination credentials.
40
+ 2. Search representative source records with `data records search`.
41
+ 3. Match selected source records against the destination with `data records match`.
42
+ 4. Review unmatched or ambiguous results.
43
+ 5. Adjust filters or formulas when needed, then repeat the search and match checks.
44
+
45
+ Treat this as a feedback loop. Finish when representative records produce the intended source selection and destination matches.
46
+
47
+ ## Synchronize Metadata Changes
48
+
49
+ 1. Prepare the metadata-change request in a JSON file.
50
+ 2. Run `data sync preview-updates --file <preview-request> --json`.
51
+ 3. Review every preview entry, especially `needsAttention` and `autoUpdate`.
52
+ 4. Build an apply payload containing only approved sync entries.
53
+ 5. Run `data sync apply --file <sync-entries> --json`.
54
+ 6. Read each affected template back to verify its fields and relationships.
55
+
56
+ Never apply preview results without reviewing them first. Stop for user input when an entry needs attention and the intended field change is unclear.
57
+
58
+ ## Create A Data Commit - Full template
59
+
60
+ 1. Resolve and inspect the target User Story; see [work.md](work.md).
61
+ 2. Inspect the selected template and credentials.
62
+ 3. Prepare the data commit request in a JSON file.
63
+ 4. Run `data commit create --file <commit-request> --json`.
64
+ 5. If the response contains a JobExecution ID, inspect and monitor it using [jobs.md](jobs.md).
65
+ 6. Confirm the commit is attached to the intended story with `data commit list <user-story-id> --json`.
66
+ 7. List generated artifacts with `data dataset-file list <data-commit-id> --json`.
67
+ 8. Fetch required content with `data dataset-file content <content-version-id>`.
68
+
69
+ Finish when the data commit belongs to the intended story, any returned job has reached the expected status, and generated dataset files are accounted for.
70
+
71
+ ## Legacy Conversion And Deletion
72
+
73
+ 1. Discover and inspect the exact template.
74
+ 2. Save its `get` and `get-detail` output before conversion or deletion.
75
+ 3. For legacy conversion, run `data template convert-old <template-id> --json`, then read the converted template back.
76
+ 4. For deletion, confirm the target and destructive intent before running `data template delete <template-id> --json`.
77
+
9
78
  ## Template Commands
10
79
 
11
80
  | Command | Use For | Notes |
@@ -60,6 +129,6 @@ agentia cicd data dataset-file list <data-commit-id> --json
60
129
  ## Gotchas
61
130
 
62
131
  - Template IDs, credential IDs, data commit IDs, and ContentVersion IDs are different values. Read the parent record before using child commands.
63
- - JSON payload commands should use exactly one input source: inline JSON flags, `--file`, or `--stdin`.
64
132
  - `data template get` and `data template get-detail` serve different audiences: selected graph export versus raw v2 detail.
65
133
  - `data template open` is CLI-only; MCP covers data operations but not browser navigation.
134
+ - A data commit can hand off to a CICD JobExecution. Continue with `agentia cicd job ...`, not CRT `agentia testing job ...`.
@@ -10,7 +10,7 @@ Use this reference for `agentia cicd promotion ...`, `agentia cicd promotion con
10
10
  | --- | --- | --- |
11
11
  | `agentia cicd promotion run <promotion-id>` | Promotion ID | You already know the Promotion record and want explicit merge or merge-and-deploy control. |
12
12
  | `agentia cicd work promote [story-id] --cloud` | User Story | You want Agentia to resolve the story's Promotion before running it. |
13
- | `agentia cicd work done` | Active User Story branch | The story is approved and should move to the next stage through the normal work lifecycle. |
13
+ | `agentia cicd work submit --done` | Active User Story branch | The story is approved and should move to the next stage (Copado UI Submit promote). |
14
14
 
15
15
  Prefer `work promote` when the user talks about a story. Prefer `promotion run` when the user provides a Promotion ID.
16
16
 
@@ -2,7 +2,7 @@
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`, `agentia_work_push`, `agentia_work_submit`, and `agentia_work_done`.
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
7
  ## Workflow
8
8
 
@@ -14,9 +14,9 @@ Use this reference for `agentia cicd work ...` and matching MCP tools such as `a
14
14
  - Copado cloud metadata: `agentia cicd work commit <story-id> --cloud --metadata-name <name> --metadata-type <type> --metadata-category SFDX --json`
15
15
  5. Register local commits: `agentia cicd work push --json`
16
16
  6. Validate and submit: `agentia cicd work submit --json`
17
- 7. Promote only on explicit approval: `agentia cicd work done --json`
17
+ 7. Promote only on explicit approval: `agentia cicd work submit --done --json`
18
18
 
19
- `work set`, `work push`, `work submit`, and `work done` expect a clean tracked working tree and the active story context recorded by `work set`.
19
+ `work set`, `work push`, and `work submit` expect a clean tracked working tree and the active story context recorded by `work set`.
20
20
 
21
21
  ## Core Commands
22
22
 
@@ -30,10 +30,9 @@ Use this reference for `agentia cicd work ...` and matching MCP tools such as `a
30
30
  | `work commit` | Local or cloud commit | `--local` is default; `--cloud` calls Copado commit APIs and can poll a job. |
31
31
  | `work push` | Push local commits and register with Copado | Requires active story context and clean tree. Sends stored retrieve-only permissions. |
32
32
  | `work test --local` | Run local quality gate scripts | Runs `.agentia_quality_gates.sh` or `.agentia_quality_gates.cmd` from repo root. |
33
- | `work submit` | Submit for review/validation | Runs local gates unless `--skip-local-tests`; can push ahead commits. |
34
- | `work done` | Promote after approval | Pushes if needed, then promotes without validate-only behavior. |
33
+ | `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. |
35
34
  | `work promote` | Story-centric promotion run | Requires `--cloud`; use `--deploy` for merge and deploy. |
36
- | `work status [ID]` | Check story and related executions | Useful after submit, done, promote, or commit jobs. |
35
+ | `work status [ID]` | Check story and related executions | Useful after submit, promote, or commit jobs. |
37
36
  | `work open [ID]` | Open story in browser | CLI-only browser helper. |
38
37
 
39
38
  ## Local Commit Path
@@ -79,6 +78,6 @@ Prefer explicit flags for standard step types. Use `--config-json`, `--file`, or
79
78
  ## Gotchas
80
79
 
81
80
  - `work test --local` is not CRT. For Robot Framework execution, use the `agentia-testing` skill.
82
- - `work submit` and `work done` may push ahead commits, but `work set` is still required first.
83
- - `work done` promotes/deploys. Do not run it unless the user explicitly asked to promote or finish the story.
81
+ - `work submit` may push ahead commits, but `work set` is still required first.
82
+ - `work submit --done` promotes/deploys. Do not run it unless the user explicitly asked to promote or finish the story.
84
83
  - `work delete` is destructive; read the story and confirm intent first.