@copado/agentia-cli 0.95.0-alpha.0 → 0.97.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 +269 -183
- package/dist/commands/cicd/credential/list.d.ts +12 -0
- package/dist/commands/cicd/credential/list.js +58 -0
- package/dist/commands/cicd/credential/list.js.map +1 -0
- package/dist/commands/cicd/environment/get.js +3 -2
- package/dist/commands/cicd/environment/get.js.map +1 -1
- package/dist/commands/cicd/environment/update.js +3 -2
- package/dist/commands/cicd/environment/update.js.map +1 -1
- package/dist/commands/cicd/job/result-file/get.d.ts +14 -0
- package/dist/commands/cicd/job/result-file/get.js +51 -0
- package/dist/commands/cicd/job/result-file/get.js.map +1 -0
- package/dist/commands/cicd/job/result-file/list.d.ts +10 -0
- package/dist/commands/cicd/job/result-file/list.js +34 -0
- package/dist/commands/cicd/job/result-file/list.js.map +1 -0
- package/dist/lib/environment-credential-flags.d.ts +3 -0
- package/dist/lib/environment-credential-flags.js +3 -0
- package/dist/lib/environment-credential-flags.js.map +1 -1
- package/dist/lib/environment-credential-operations.d.ts +5 -1
- package/dist/lib/environment-credential-operations.js +26 -0
- package/dist/lib/environment-credential-operations.js.map +1 -1
- package/dist/lib/environment-types.d.ts +3 -0
- package/dist/lib/environment-types.js +3 -3
- package/dist/lib/environment-types.js.map +1 -1
- package/dist/lib/job-types.d.ts +30 -0
- package/dist/lib/job-types.js +57 -0
- package/dist/lib/job-types.js.map +1 -1
- package/dist/lib/mcp/command-id.js +2 -0
- package/dist/lib/mcp/command-id.js.map +1 -1
- package/dist/lib/mcp/tools.d.ts +35 -1
- package/dist/lib/mcp/tools.js +50 -6
- package/dist/lib/mcp/tools.js.map +1 -1
- package/dist/lib/setup-templates.d.ts +2 -0
- package/dist/lib/setup-templates.js +143 -0
- package/dist/lib/setup-templates.js.map +1 -1
- package/oclif.manifest.json +4448 -4307
- package/package.json +4 -1
- package/templates/skills/agentia-cicd/references/environments-and-credentials.md +4 -1
- package/templates/skills/agentia-cicd/references/jobs.md +8 -1
|
@@ -52,6 +52,149 @@ echo ## Running LWC tests
|
|
|
52
52
|
npx sfdx-lwc-jest --
|
|
53
53
|
if errorlevel 1 exit /b %errorlevel%
|
|
54
54
|
`;
|
|
55
|
+
/** Bundled AGENTS.md template (mirrors docs/AGENTS.sample.md). Used when DEFAULT_AGENTS_MD_URL is unset or download fails. */
|
|
56
|
+
export const BUNDLED_AGENTS_MD = `# Agentia CLI for AI Agents
|
|
57
|
+
|
|
58
|
+
Use Agentia to manage Copado user stories end-to-end: pick work, prepare a git branch, push changes, submit for review, and promote.
|
|
59
|
+
|
|
60
|
+
**Prefer the Agentia MCP server when it is available.** If tools such as \`agentia_work_list\`, \`agentia_work_set\`, \`agentia_work_commit\`, \`agentia_work_push\`, and \`agentia_work_submit\` are registered, call those instead of shelling out to the \`agentia\` CLI. Fall back to CLI commands only when MCP is not configured.
|
|
61
|
+
|
|
62
|
+
When using the CLI, prefer \`--json\` on every command so you can parse structured output instead of terminal tables.
|
|
63
|
+
|
|
64
|
+
Authentication must already be configured (\`agentia auth set\` / keychain, or local gateway mode). Run from a git repository that is a Copado-managed project.
|
|
65
|
+
|
|
66
|
+
## Typical workflow
|
|
67
|
+
|
|
68
|
+
\`\`\`text
|
|
69
|
+
list → get → set → (implement & commit or cloud commit) → push → submit [--done]
|
|
70
|
+
\`\`\`
|
|
71
|
+
|
|
72
|
+
| Step | MCP tool (preferred) | CLI fallback | Purpose |
|
|
73
|
+
| --- | --- | --- | --- |
|
|
74
|
+
| 1 | \`agentia_work_list\` (\`assignedToMe: true\`) | \`agentia cicd work list --assigned-to-me --json\` | Show user stories assigned to you |
|
|
75
|
+
| 2 | \`agentia_work_get\` | \`agentia cicd work get [id] --json\` | Read user story details (omit id after \`work set\`) |
|
|
76
|
+
| 3 | \`agentia_work_set\` | \`agentia cicd work set <id> --json\` | Mark in progress and prepare the feature branch |
|
|
77
|
+
| 4 | *(your edits + \`git commit\`)* or \`agentia_work_commit\` | *(your edits + \`git commit\`)* or \`agentia cicd work commit --cloud --json\` | Implement the story or create a Copado cloud metadata commit |
|
|
78
|
+
| 5 | \`agentia_work_push\` | \`agentia cicd work push --json\` | Push local Git commits and register them with Copado |
|
|
79
|
+
| 6 | \`agentia_work_submit\` | \`agentia cicd work submit --json\` | Flag ready for review (pipeline quality gates / validation) |
|
|
80
|
+
| 7 | \`agentia_work_submit\` (\`done: true\`) | \`agentia cicd work submit --done --json\` | Promote and deploy to the next stage (Copado UI Submit promote) |
|
|
81
|
+
|
|
82
|
+
Do not skip \`work set\` before coding. Later steps expect a \`feature/<user-story-name>\` branch and a recorded base branch from \`work set\`.
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Commands
|
|
87
|
+
|
|
88
|
+
CLI examples below are the fallback when MCP is unavailable. MCP tool names and arguments mirror these commands (camelCase args instead of flags).
|
|
89
|
+
|
|
90
|
+
### \`agentia cicd work list\`
|
|
91
|
+
|
|
92
|
+
Show user stories. For “assigned to me”, always use:
|
|
93
|
+
|
|
94
|
+
\`\`\`sh
|
|
95
|
+
agentia cicd work list --assigned-to-me --json
|
|
96
|
+
\`\`\`
|
|
97
|
+
|
|
98
|
+
Useful filters: \`--status\`, \`--project-name\`, \`--name\`, \`--owned-by-me\`. Do not combine \`--assigned-to-me\` with \`--owned-by-me\` or \`--assignee-id\`.
|
|
99
|
+
|
|
100
|
+
### \`agentia cicd work get [id]\`
|
|
101
|
+
|
|
102
|
+
Read full details for one user story. After \`work set\`, omit the ID to use the active work item:
|
|
103
|
+
|
|
104
|
+
\`\`\`sh
|
|
105
|
+
agentia cicd work get --json
|
|
106
|
+
agentia cicd work get a0SKC000000CmZ2AU --json
|
|
107
|
+
\`\`\`
|
|
108
|
+
|
|
109
|
+
Use this before starting work to understand title, status, acceptance criteria, and related fields.
|
|
110
|
+
|
|
111
|
+
### \`agentia cicd work set <id>\`
|
|
112
|
+
|
|
113
|
+
Flag the user story as the active work item (in progress) and prepare the correct git branch:
|
|
114
|
+
|
|
115
|
+
\`\`\`sh
|
|
116
|
+
agentia cicd work set a0SKC000000CmZ2AU --json
|
|
117
|
+
# or by name:
|
|
118
|
+
agentia cicd work set US-0001 --json
|
|
119
|
+
\`\`\`
|
|
120
|
+
|
|
121
|
+
What it does:
|
|
122
|
+
|
|
123
|
+
1. Calls Copado to set the work item and resolve the base branch
|
|
124
|
+
2. Requires a **clean tracked working tree** (stash or commit first if dirty)
|
|
125
|
+
3. Fetches \`origin/<base-branch>\`
|
|
126
|
+
4. Creates or checks out \`feature/<user-story-name>\`
|
|
127
|
+
5. Records the last work item ID, name, and base branch for later commands
|
|
128
|
+
|
|
129
|
+
Optional: \`--base-branch <name>\` overrides the base branch from the API.
|
|
130
|
+
|
|
131
|
+
After success, stay on that feature branch for all implementation commits.
|
|
132
|
+
|
|
133
|
+
### \`agentia cicd work push\`
|
|
134
|
+
|
|
135
|
+
Push committed changes to git and register them with Copado:
|
|
136
|
+
|
|
137
|
+
\`\`\`sh
|
|
138
|
+
agentia cicd work push --json
|
|
139
|
+
\`\`\`
|
|
140
|
+
|
|
141
|
+
Prerequisites:
|
|
142
|
+
|
|
143
|
+
- Current branch is \`feature/US-XXXX\` (from \`work set\`)
|
|
144
|
+
- No uncommitted tracked changes (commit first)
|
|
145
|
+
- \`work set\` was run so a base branch is recorded
|
|
146
|
+
|
|
147
|
+
Locks the tip commit, runs \`git push origin <branch>\`, then registers the commits with Copado.
|
|
148
|
+
|
|
149
|
+
### \`agentia cicd work commit --cloud\`
|
|
150
|
+
|
|
151
|
+
Create a Copado cloud commit job for selected metadata:
|
|
152
|
+
|
|
153
|
+
\`\`\`sh
|
|
154
|
+
agentia cicd work commit --cloud --message "Commit AccountService" --metadata-name AccountService --metadata-type ApexClass --metadata-category SFDX --json
|
|
155
|
+
agentia cicd work commit a0SKC000000CmZ2AU --cloud --file commit-request.json --json
|
|
156
|
+
\`\`\`
|
|
157
|
+
|
|
158
|
+
Use this when the metadata commit should be performed by Copado rather than by local Git. The command preflights the user story, submits the commit request, and waits for the job by default. For bundled metadata with \`SelectiveCommit\`, include \`--selection\` values for the files inside the bundle. MCP uses camelCase fields such as \`metadataName\`, \`metadataType\`, \`metadataCategory\`, \`selection\`, and \`wait\`. For Salesforce metadata, always set \`--metadata-category SFDX\` or MCP \`metadataCategory: "SFDX"\` (maps to change field \`c\`). Without \`c:SFDX\`, Copado SFDX deploy logs "Salesforce changes not found." and skips the deploy.
|
|
159
|
+
|
|
160
|
+
### \`agentia cicd work test --local\`
|
|
161
|
+
|
|
162
|
+
Run local project quality gates without submitting:
|
|
163
|
+
|
|
164
|
+
\`\`\`sh
|
|
165
|
+
agentia cicd work test --local --json
|
|
166
|
+
agentia cicd work test --local --apex-test-classes=MyTest,OtherTest --json
|
|
167
|
+
\`\`\`
|
|
168
|
+
|
|
169
|
+
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. Optional \`--apex-test-classes=class1,class2\` is passed to the script as \`AGENTIA_APEX_TEST_CLASSES\` (MCP: \`apexTestClasses\`).
|
|
170
|
+
|
|
171
|
+
### \`agentia cicd work submit\`
|
|
172
|
+
|
|
173
|
+
Flag the user story as ready for review. Runs local project quality gates (when present), then pipeline quality gates and validation:
|
|
174
|
+
|
|
175
|
+
\`\`\`sh
|
|
176
|
+
agentia cicd work submit --json
|
|
177
|
+
agentia cicd work submit --apex-test-classes=MyTest,OtherTest --json
|
|
178
|
+
agentia cicd work submit --skip-local-tests --json
|
|
179
|
+
agentia cicd work submit --done --json
|
|
180
|
+
agentia cicd work submit --done --skip-nested-metadata-detection --json
|
|
181
|
+
\`\`\`
|
|
182
|
+
|
|
183
|
+
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 \`--apex-test-classes=class1,class2\` to pass Apex test classes to the script as \`AGENTIA_APEX_TEST_CLASSES\` (MCP: \`apexTestClasses\`). Use \`--skip-local-tests\` to skip local gates. After that, submit counts commits since \`lastBaseBranch\` before checking origin. No commits is an error unless the Story has a \`Data Set - Salesforce\` or \`Data Template - Salesforce\` deployment step. When commits exist, unpushed work is still pushed even if those data steps are present, then submit continues. With \`--done\` (MCP: \`done\`), submit matches Copado UI Submit when promoting (validate=false / headless work/done) and honors \`--skip-nested-metadata-detection\`. Prefer \`submit --done\` over the compatibility alias \`cicd work done\`.
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## Agent rules
|
|
188
|
+
|
|
189
|
+
1. **Prefer MCP over CLI.** When Agentia MCP tools are available, use them instead of running \`agentia\` in the shell.
|
|
190
|
+
2. **Discover before acting.** List assigned stories, then \`get\` the chosen ID, then \`set\` before editing files.
|
|
191
|
+
3. **One story, one feature branch.** Do not mix unrelated commits on the same \`feature/US-XXXX\` branch.
|
|
192
|
+
4. **Choose the right commit path.** Use normal \`git add\` / \`git commit\` followed by \`agentia_work_push\` for local Git work. Use \`agentia_work_commit\` / \`agentia cicd work commit --cloud\` for Copado cloud metadata commits.
|
|
193
|
+
5. **Keep the tree clean** before \`set\`, \`push\`, and \`submit\`. Those steps fail if tracked changes are pending.
|
|
194
|
+
6. **Prefer structured results.** MCP returns JSON; for CLI, use \`--json\` and do not scrape human table output.
|
|
195
|
+
7. **Order matters.** \`set\` → local commit or cloud commit → \`push\` when local Git commits exist → \`submit\` (optionally \`--done\`). \`submit\` counts commits since \`lastBaseBranch\` before checking origin; it auto-pushes only when that range is non-empty and origin is behind. A Data Set or Data Template deployment step can waive the empty-history error, but not push validation when commits exist. \`set\` is still required first.
|
|
196
|
+
8. **Confirm intent for \`submit --done\`.** Promotion deploys to the next stage; do not run it unless the user asked to promote/deploy.
|
|
197
|
+
`;
|
|
55
198
|
export function qualityGatesExplanation(bin = 'agentia') {
|
|
56
199
|
return [
|
|
57
200
|
'Local quality gates:',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-templates.js","sourceRoot":"","sources":["../../src/lib/setup-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,yBAAyB,EAAE,4BAA4B,EAAC,MAAM,0BAA0B,CAAA;AAEhG,MAAM,CAAC,MAAM,uBAAuB,GAAG,2BAA2B,CAAA;AAClE,MAAM,CAAC,MAAM,2BAA2B,GAAG,gCAAgC,CAAA;AAC3E,MAAM,CAAC,MAAM,yBAAyB,GAAG,8BAA8B,CAAA;AAEvE,iGAAiG;AACjG,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,CAAU,CAAA;AAE1G,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuBxC,CAAA;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuB3C,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"}
|
|
1
|
+
{"version":3,"file":"setup-templates.js","sourceRoot":"","sources":["../../src/lib/setup-templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,yBAAyB,EAAE,4BAA4B,EAAC,MAAM,0BAA0B,CAAA;AAEhG,MAAM,CAAC,MAAM,uBAAuB,GAAG,2BAA2B,CAAA;AAClE,MAAM,CAAC,MAAM,2BAA2B,GAAG,gCAAgC,CAAA;AAC3E,MAAM,CAAC,MAAM,yBAAyB,GAAG,8BAA8B,CAAA;AAEvE,iGAAiG;AACjG,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,CAAU,CAAA;AAE1G,MAAM,CAAC,MAAM,yBAAyB,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuBxC,CAAA;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG;;;;;;;;;;;;;;;;;;;;;;;CAuB3C,CAAA;AAED,8HAA8H;AAC9H,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAiHA,yBAAyB,yBAAyB,4BAA4B;;;;;;;;;;;;;;gFAc/B,yBAAyB,yBAAyB,4BAA4B;;;;;;;;;;;;;;CAc7J,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"}
|