@copado/agentia-cli 0.114.0-alpha.0 → 0.116.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.
@@ -2020,168 +2020,6 @@
2020
2020
  "update.js"
2021
2021
  ]
2022
2022
  },
2023
- "cicd:credential:create": {
2024
- "aliases": [],
2025
- "args": {},
2026
- "description": "Create a Copado environment credential",
2027
- "examples": [
2028
- "<%= config.bin %> <%= command.id %> --environmentid <environment-id> --name \"CI User\"",
2029
- "<%= config.bin %> <%= command.id %> --environmentid <environment-id> --name \"CI User\" --default",
2030
- "<%= config.bin %> <%= command.id %> --environmentid <environment-id> --name \"CI User\" --json"
2031
- ],
2032
- "flags": {
2033
- "json": {
2034
- "description": "Format output as json.",
2035
- "helpGroup": "GLOBAL",
2036
- "name": "json",
2037
- "allowNo": false,
2038
- "type": "boolean"
2039
- },
2040
- "default": {
2041
- "description": "Mark this credential as the environment default",
2042
- "name": "default",
2043
- "allowNo": true,
2044
- "type": "boolean"
2045
- },
2046
- "environmentid": {
2047
- "description": "Copado environment ID",
2048
- "name": "environmentid",
2049
- "required": true,
2050
- "hasDynamicHelp": false,
2051
- "multiple": false,
2052
- "type": "option"
2053
- },
2054
- "name": {
2055
- "description": "Credential name",
2056
- "name": "name",
2057
- "required": true,
2058
- "hasDynamicHelp": false,
2059
- "multiple": false,
2060
- "type": "option"
2061
- }
2062
- },
2063
- "hasDynamicHelp": false,
2064
- "hiddenAliases": [],
2065
- "id": "cicd:credential:create",
2066
- "pluginAlias": "@copado/agentia-cli",
2067
- "pluginName": "@copado/agentia-cli",
2068
- "pluginType": "core",
2069
- "strict": true,
2070
- "enableJsonFlag": true,
2071
- "isESM": true,
2072
- "relativePath": [
2073
- "dist",
2074
- "commands",
2075
- "cicd",
2076
- "credential",
2077
- "create.js"
2078
- ]
2079
- },
2080
- "cicd:credential:list": {
2081
- "aliases": [],
2082
- "args": {},
2083
- "description": "List credentials for a Copado environment",
2084
- "examples": [
2085
- "<%= config.bin %> <%= command.id %> --environmentid <environment-id>",
2086
- "<%= config.bin %> <%= command.id %> --environmentid \"Dev Sandbox\"",
2087
- "<%= config.bin %> <%= command.id %> --environmentid <environment-id> --json"
2088
- ],
2089
- "flags": {
2090
- "json": {
2091
- "description": "Format output as json.",
2092
- "helpGroup": "GLOBAL",
2093
- "name": "json",
2094
- "allowNo": false,
2095
- "type": "boolean"
2096
- },
2097
- "environmentid": {
2098
- "description": "Copado environment ID",
2099
- "name": "environmentid",
2100
- "required": true,
2101
- "hasDynamicHelp": false,
2102
- "multiple": false,
2103
- "type": "option"
2104
- }
2105
- },
2106
- "hasDynamicHelp": false,
2107
- "hiddenAliases": [],
2108
- "id": "cicd:credential:list",
2109
- "pluginAlias": "@copado/agentia-cli",
2110
- "pluginName": "@copado/agentia-cli",
2111
- "pluginType": "core",
2112
- "strict": true,
2113
- "enableJsonFlag": true,
2114
- "isESM": true,
2115
- "relativePath": [
2116
- "dist",
2117
- "commands",
2118
- "cicd",
2119
- "credential",
2120
- "list.js"
2121
- ]
2122
- },
2123
- "cicd:credential:update": {
2124
- "aliases": [],
2125
- "args": {
2126
- "id": {
2127
- "description": "Copado credential ID",
2128
- "name": "id",
2129
- "required": true
2130
- }
2131
- },
2132
- "description": "Update a Copado environment credential by ID",
2133
- "examples": [
2134
- "<%= config.bin %> <%= command.id %> <credential-id> --environmentid <environment-id> --name \"CI User\"",
2135
- "<%= config.bin %> <%= command.id %> <credential-id> --environmentid <environment-id> --default",
2136
- "<%= config.bin %> <%= command.id %> <credential-id> --environmentid <environment-id> --no-default --json"
2137
- ],
2138
- "flags": {
2139
- "json": {
2140
- "description": "Format output as json.",
2141
- "helpGroup": "GLOBAL",
2142
- "name": "json",
2143
- "allowNo": false,
2144
- "type": "boolean"
2145
- },
2146
- "default": {
2147
- "description": "Mark this credential as the environment default",
2148
- "name": "default",
2149
- "allowNo": true,
2150
- "type": "boolean"
2151
- },
2152
- "environmentid": {
2153
- "description": "Copado environment ID",
2154
- "name": "environmentid",
2155
- "required": true,
2156
- "hasDynamicHelp": false,
2157
- "multiple": false,
2158
- "type": "option"
2159
- },
2160
- "name": {
2161
- "description": "Credential name",
2162
- "name": "name",
2163
- "hasDynamicHelp": false,
2164
- "multiple": false,
2165
- "type": "option"
2166
- }
2167
- },
2168
- "hasDynamicHelp": false,
2169
- "hiddenAliases": [],
2170
- "id": "cicd:credential:update",
2171
- "pluginAlias": "@copado/agentia-cli",
2172
- "pluginName": "@copado/agentia-cli",
2173
- "pluginType": "core",
2174
- "strict": true,
2175
- "enableJsonFlag": true,
2176
- "isESM": true,
2177
- "relativePath": [
2178
- "dist",
2179
- "commands",
2180
- "cicd",
2181
- "credential",
2182
- "update.js"
2183
- ]
2184
- },
2185
2023
  "cicd:environment:create": {
2186
2024
  "aliases": [],
2187
2025
  "args": {
@@ -2593,6 +2431,168 @@
2593
2431
  "update.js"
2594
2432
  ]
2595
2433
  },
2434
+ "cicd:credential:create": {
2435
+ "aliases": [],
2436
+ "args": {},
2437
+ "description": "Create a Copado environment credential",
2438
+ "examples": [
2439
+ "<%= config.bin %> <%= command.id %> --environmentid <environment-id> --name \"CI User\"",
2440
+ "<%= config.bin %> <%= command.id %> --environmentid <environment-id> --name \"CI User\" --default",
2441
+ "<%= config.bin %> <%= command.id %> --environmentid <environment-id> --name \"CI User\" --json"
2442
+ ],
2443
+ "flags": {
2444
+ "json": {
2445
+ "description": "Format output as json.",
2446
+ "helpGroup": "GLOBAL",
2447
+ "name": "json",
2448
+ "allowNo": false,
2449
+ "type": "boolean"
2450
+ },
2451
+ "default": {
2452
+ "description": "Mark this credential as the environment default",
2453
+ "name": "default",
2454
+ "allowNo": true,
2455
+ "type": "boolean"
2456
+ },
2457
+ "environmentid": {
2458
+ "description": "Copado environment ID",
2459
+ "name": "environmentid",
2460
+ "required": true,
2461
+ "hasDynamicHelp": false,
2462
+ "multiple": false,
2463
+ "type": "option"
2464
+ },
2465
+ "name": {
2466
+ "description": "Credential name",
2467
+ "name": "name",
2468
+ "required": true,
2469
+ "hasDynamicHelp": false,
2470
+ "multiple": false,
2471
+ "type": "option"
2472
+ }
2473
+ },
2474
+ "hasDynamicHelp": false,
2475
+ "hiddenAliases": [],
2476
+ "id": "cicd:credential:create",
2477
+ "pluginAlias": "@copado/agentia-cli",
2478
+ "pluginName": "@copado/agentia-cli",
2479
+ "pluginType": "core",
2480
+ "strict": true,
2481
+ "enableJsonFlag": true,
2482
+ "isESM": true,
2483
+ "relativePath": [
2484
+ "dist",
2485
+ "commands",
2486
+ "cicd",
2487
+ "credential",
2488
+ "create.js"
2489
+ ]
2490
+ },
2491
+ "cicd:credential:list": {
2492
+ "aliases": [],
2493
+ "args": {},
2494
+ "description": "List credentials for a Copado environment",
2495
+ "examples": [
2496
+ "<%= config.bin %> <%= command.id %> --environmentid <environment-id>",
2497
+ "<%= config.bin %> <%= command.id %> --environmentid \"Dev Sandbox\"",
2498
+ "<%= config.bin %> <%= command.id %> --environmentid <environment-id> --json"
2499
+ ],
2500
+ "flags": {
2501
+ "json": {
2502
+ "description": "Format output as json.",
2503
+ "helpGroup": "GLOBAL",
2504
+ "name": "json",
2505
+ "allowNo": false,
2506
+ "type": "boolean"
2507
+ },
2508
+ "environmentid": {
2509
+ "description": "Copado environment ID",
2510
+ "name": "environmentid",
2511
+ "required": true,
2512
+ "hasDynamicHelp": false,
2513
+ "multiple": false,
2514
+ "type": "option"
2515
+ }
2516
+ },
2517
+ "hasDynamicHelp": false,
2518
+ "hiddenAliases": [],
2519
+ "id": "cicd:credential:list",
2520
+ "pluginAlias": "@copado/agentia-cli",
2521
+ "pluginName": "@copado/agentia-cli",
2522
+ "pluginType": "core",
2523
+ "strict": true,
2524
+ "enableJsonFlag": true,
2525
+ "isESM": true,
2526
+ "relativePath": [
2527
+ "dist",
2528
+ "commands",
2529
+ "cicd",
2530
+ "credential",
2531
+ "list.js"
2532
+ ]
2533
+ },
2534
+ "cicd:credential:update": {
2535
+ "aliases": [],
2536
+ "args": {
2537
+ "id": {
2538
+ "description": "Copado credential ID",
2539
+ "name": "id",
2540
+ "required": true
2541
+ }
2542
+ },
2543
+ "description": "Update a Copado environment credential by ID",
2544
+ "examples": [
2545
+ "<%= config.bin %> <%= command.id %> <credential-id> --environmentid <environment-id> --name \"CI User\"",
2546
+ "<%= config.bin %> <%= command.id %> <credential-id> --environmentid <environment-id> --default",
2547
+ "<%= config.bin %> <%= command.id %> <credential-id> --environmentid <environment-id> --no-default --json"
2548
+ ],
2549
+ "flags": {
2550
+ "json": {
2551
+ "description": "Format output as json.",
2552
+ "helpGroup": "GLOBAL",
2553
+ "name": "json",
2554
+ "allowNo": false,
2555
+ "type": "boolean"
2556
+ },
2557
+ "default": {
2558
+ "description": "Mark this credential as the environment default",
2559
+ "name": "default",
2560
+ "allowNo": true,
2561
+ "type": "boolean"
2562
+ },
2563
+ "environmentid": {
2564
+ "description": "Copado environment ID",
2565
+ "name": "environmentid",
2566
+ "required": true,
2567
+ "hasDynamicHelp": false,
2568
+ "multiple": false,
2569
+ "type": "option"
2570
+ },
2571
+ "name": {
2572
+ "description": "Credential name",
2573
+ "name": "name",
2574
+ "hasDynamicHelp": false,
2575
+ "multiple": false,
2576
+ "type": "option"
2577
+ }
2578
+ },
2579
+ "hasDynamicHelp": false,
2580
+ "hiddenAliases": [],
2581
+ "id": "cicd:credential:update",
2582
+ "pluginAlias": "@copado/agentia-cli",
2583
+ "pluginName": "@copado/agentia-cli",
2584
+ "pluginType": "core",
2585
+ "strict": true,
2586
+ "enableJsonFlag": true,
2587
+ "isESM": true,
2588
+ "relativePath": [
2589
+ "dist",
2590
+ "commands",
2591
+ "cicd",
2592
+ "credential",
2593
+ "update.js"
2594
+ ]
2595
+ },
2596
2596
  "cicd:function:defaults": {
2597
2597
  "aliases": [],
2598
2598
  "args": {},
@@ -5922,14 +5922,14 @@
5922
5922
  "type": "option"
5923
5923
  },
5924
5924
  "source-credential": {
5925
- "description": "Source credential ID",
5925
+ "description": "Source credential ID. When set, sourceEnvironment is sent as null so Salesforce assigns the environment from the credential.",
5926
5926
  "name": "source-credential",
5927
5927
  "hasDynamicHelp": false,
5928
5928
  "multiple": false,
5929
5929
  "type": "option"
5930
5930
  },
5931
5931
  "source-environment": {
5932
- "description": "Source environment ID",
5932
+ "description": "Source environment ID. Ignored when --source-credential is also set.",
5933
5933
  "name": "source-environment",
5934
5934
  "hasDynamicHelp": false,
5935
5935
  "multiple": false,
@@ -6396,7 +6396,7 @@
6396
6396
  "cicd:work:push": {
6397
6397
  "aliases": [],
6398
6398
  "args": {},
6399
- "description": "Push the current feature/<lastWorkItem> branch and register commits with Copado. Requires a clean working tree, base branch, and dev org branch from `.agentia/config.user.json`. When there are no commits since the base branch, or origin already has HEAD, fails with \"No changes to push\" unless `--permissions` and/or `--full-metadata` is set, in which case it creates an empty commit so a tip commit id exists. Applies Copado environment-variable then yaml replacements when needed, commits both as a single follow-up commit, locks the tip commit, runs `git push origin <branch>`, reports the nested metadata changed across the branch, such as the CustomField behind a profile field-permission edit, plus the parent components it would ignore, calls headless work/push with one changeListUpdate list of Action:MetadataType:MetadataName corrections: lastPermissionSelected and --permissions plus the nested metadata of the changed profiles and permission sets as RetrieveOnly, lastFullMetadataSelected and --full-metadata plus brand-new nested parent files as fullMetadata, the ignored parents as unchanged, the nested metadata deleted on the branch as Del, and the remaining nested metadata as Add, then merges the feature branch into the recorded dev org branch. The changed profiles and permission sets themselves are never sent as corrections, so they stay in the change list and deploy only the permissions their RetrieveOnly entries select. Brand-new nested parent files are an exception: they are sent as fullMetadata so the complete file travels.",
6399
+ "description": "Push the current feature/<lastWorkItem> branch and register commits with Copado. Requires a clean working tree, base branch, and dev org branch from `.agentia/config.user.json`. Fetches origin/<lastBaseBranch>, then registers only commits in origin/<lastBaseBranch>..HEAD and diffs nested parent XML at merge-base(origin/<lastBaseBranch>, HEAD) versus HEAD, so origin/base-only history is ignored. When there are no commits since origin/<lastBaseBranch>, or origin already has HEAD, fails with \"No changes to push\" unless `--permissions` and/or `--full-metadata` is set, in which case it creates an empty commit so a tip commit id exists. Applies Copado environment-variable then yaml replacements when needed, commits both as a single follow-up commit, locks the tip commit, runs `git push origin <branch>`, reports the nested metadata changed across the branch, such as the CustomField behind a profile field-permission edit, plus the parent components it would ignore, calls headless work/push with one changeListUpdate list of Action:MetadataType:MetadataName corrections: lastPermissionSelected and --permissions plus the nested metadata of the changed profiles and permission sets as RetrieveOnly, lastFullMetadataSelected and --full-metadata plus brand-new nested parent files as fullMetadata, the ignored parents as unchanged, the nested metadata deleted on the branch as Del, and the remaining nested metadata as Add, then merges the feature branch into the recorded dev org branch. The changed profiles and permission sets themselves are never sent as corrections, so they stay in the change list and deploy only the permissions their RetrieveOnly entries select. Brand-new nested parent files are an exception: they are sent as fullMetadata so the complete file travels.",
6400
6400
  "examples": [
6401
6401
  "<%= config.bin %> <%= command.id %>",
6402
6402
  "<%= config.bin %> <%= command.id %> --permissions CustomField:Account.SLA__c,ApexClass:AccountService",
@@ -6459,7 +6459,7 @@
6459
6459
  "required": false
6460
6460
  }
6461
6461
  },
6462
- "description": "Set the active work item and prepare a local feature branch. Calls the CICD gateway work/set endpoint, requires a clean tracked working tree, fetches the work item base branch from origin, then creates or checks out feature/<user-story-name>. After work/set returns, compares the Story source credential with the CICD project default: warns when the default or Story credential is missing, and updates the Story when they differ. With --none, clears every last* key from `.agentia/config.user.json` and checks out the previous lastBaseBranch when present, else main, else master, else stays put.",
6462
+ "description": "Set the active work item and prepare a local feature branch. Calls the CICD gateway work/set endpoint, requires a clean tracked working tree, fetches the work item base branch from origin, then creates or checks out feature/<user-story-name>. After work/set returns, compares the Story source credential with the CICD project default: warns when the default or Story credential is missing, and warns without changing the Story when they differ (shows the current credential and environment; use work update to change it). With --none, clears every last* key from `.agentia/config.user.json` and checks out the previous lastBaseBranch when present, else main, else master, else stays put.",
6463
6463
  "examples": [
6464
6464
  "<%= config.bin %> <%= command.id %> a0SKC000000CmZ2AU",
6465
6465
  "<%= config.bin %> <%= command.id %> US-0001 --json",
@@ -6820,14 +6820,14 @@
6820
6820
  "type": "option"
6821
6821
  },
6822
6822
  "source-credential": {
6823
- "description": "Source credential ID",
6823
+ "description": "Source credential ID. When set, sourceEnvironment is sent as null so Salesforce assigns the environment from the credential.",
6824
6824
  "name": "source-credential",
6825
6825
  "hasDynamicHelp": false,
6826
6826
  "multiple": false,
6827
6827
  "type": "option"
6828
6828
  },
6829
6829
  "source-environment": {
6830
- "description": "Source environment ID",
6830
+ "description": "Source environment ID. Ignored when --source-credential is also set.",
6831
6831
  "name": "source-environment",
6832
6832
  "hasDynamicHelp": false,
6833
6833
  "multiple": false,
@@ -17793,5 +17793,5 @@
17793
17793
  ]
17794
17794
  }
17795
17795
  },
17796
- "version": "0.114.0-alpha.0"
17796
+ "version": "0.116.0-alpha.0"
17797
17797
  }
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.114.0-alpha.0",
4
+ "version": "0.116.0-alpha.0",
5
5
  "author": "Copado Solutions",
6
6
  "bin": {
7
7
  "agentia": "./bin/run.js"
@@ -13,7 +13,7 @@ Local and cloud work are separate delivery paths. Do not continue a cloud commit
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.
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
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
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. `--local` is the default; `--cloud` is reserved and not implemented yet.
19
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.
@@ -21,7 +21,7 @@ Use this path when the change exists in the local repository:
21
21
  7. Only with explicit approval to promote and deploy, run `agentia cicd work submit --done --json`. `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 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.
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 `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
 
@@ -40,9 +40,9 @@ Cloud commit checks Story readiness and source credentials before submission. Av
40
40
  | --- | --- | --- |
41
41
  | `work list` | Find candidate stories | Use `--assigned-to-me`, `--status`, `--project-name`, `--name`, pagination flags. |
42
42
  | `work get [ID]` | Read story details | ID is optional after `work set`. Human output redacts OAuth signatures; JSON preserves structured fields. |
43
- | `work create` | Create a story | Use `--title`, project/team/assignee/theme fields, specs, and short acceptance criteria. |
44
- | `work update [ID]` | Mutate story fields or status | ID is optional after `work set`. Acceptance criteria must be fewer than 255 chars. |
45
- | `work set ID` | Mark active and prepare branch | Fetches base branch, creates/checks out `feature/<story-name>`, stores local context. `--none` clears every `last*` key and checks out `lastBaseBranch`, else `main`, else `master`. |
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
+ | `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
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. |
47
47
  | `work push` | Push local commits and register with Copado | Requires active story context and clean tree. Sends stored retrieve-only permissions. |
48
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. |