@copado/agentia-cli 1.0.0-beta.1 → 1.0.0-beta.4

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 (70) hide show
  1. package/CHANGELOG.md +67 -0
  2. package/README.md +648 -370
  3. package/dist/commands/cicd/cloud/commit.js +252 -0
  4. package/dist/commands/cicd/cloud/promote.js +139 -0
  5. package/dist/commands/cicd/data/template/save-detail.js +2 -2
  6. package/dist/commands/cicd/health-check.js +77 -0
  7. package/dist/commands/cicd/repository/auth/https/configure.js +21 -0
  8. package/dist/commands/cicd/repository/auth/oauth/login.js +56 -0
  9. package/dist/commands/cicd/repository/auth/setup.js +28 -0
  10. package/dist/commands/cicd/repository/auth/ssh/configure.js +22 -0
  11. package/dist/commands/cicd/repository/create.js +2 -2
  12. package/dist/commands/cicd/repository/reset.js +17 -5
  13. package/dist/commands/cicd/repository/update.js +6 -14
  14. package/dist/commands/cicd/work/commit.js +10 -324
  15. package/dist/commands/cicd/work/environment-sync.js +125 -0
  16. package/dist/commands/cicd/work/get.js +29 -12
  17. package/dist/commands/cicd/work/promote.js +93 -97
  18. package/dist/commands/cicd/work/set.js +4 -2
  19. package/dist/commands/cicd/work/submit.js +7 -0
  20. package/dist/commands/runtime.js +26 -0
  21. package/dist/hooks/finally/ide-command-event.js +1 -1
  22. package/dist/hooks/init/plugin-host.js +6 -0
  23. package/dist/lib/agentia-command.js +16 -0
  24. package/dist/lib/cursor-mcp-config.js +3 -1
  25. package/dist/lib/data-types.js +3 -1
  26. package/dist/lib/defaults-store.js +2 -1
  27. package/dist/lib/git-sizer.js +5 -0
  28. package/dist/lib/git-worktree.js +17 -1
  29. package/dist/lib/health-check.js +3 -0
  30. package/dist/lib/mcp/command-id.js +1 -0
  31. package/dist/lib/mcp/data-tools.js +2 -2
  32. package/dist/lib/mcp/health-check-tools.js +16 -0
  33. package/dist/lib/mcp/server.js +35 -8
  34. package/dist/lib/mcp/tool-annotations.js +268 -0
  35. package/dist/lib/mcp/tools.js +58 -12
  36. package/dist/lib/mcp/work-tools.js +98 -83
  37. package/dist/lib/metadata-pathspecs.js +4 -0
  38. package/dist/lib/metadataRegistry.json +5427 -0
  39. package/dist/lib/plugin-host/auth.js +4 -0
  40. package/dist/lib/plugin-host/format.js +3 -0
  41. package/dist/lib/plugin-host/index.js +7 -0
  42. package/dist/lib/plugin-host/organization.js +4 -0
  43. package/dist/lib/plugin-host/projection-utils.js +6 -0
  44. package/dist/lib/plugin-host/registry.js +6 -0
  45. package/dist/lib/plugin-host/request-scope.js +4 -0
  46. package/dist/lib/plugin-host/work.js +4 -0
  47. package/dist/lib/project-root.js +3 -1
  48. package/dist/lib/promotion-types.js +4 -1
  49. package/dist/lib/repository-auth.js +8 -0
  50. package/dist/lib/repository-flags.js +2 -2
  51. package/dist/lib/repository-types.js +6 -1
  52. package/dist/lib/repository-url-prefill.js +4 -0
  53. package/dist/lib/runtime-invoke-context.js +6 -0
  54. package/dist/lib/runtime-rpc.js +14 -0
  55. package/dist/lib/runtime.js +1 -1
  56. package/dist/lib/work-environment-sync-errors.js +4 -0
  57. package/dist/lib/work-environment-sync-ready.js +18 -0
  58. package/dist/lib/work-environment-sync.js +41 -0
  59. package/dist/lib/work-get.js +3 -0
  60. package/dist/lib/work-promote-deploy.js +13 -0
  61. package/dist/lib/work-promote-errors.js +5 -0
  62. package/dist/lib/work-promote.js +12 -0
  63. package/dist/lib/work-set-selection.js +2 -1
  64. package/dist/lib/work-submit-ahead-behind.js +8 -0
  65. package/dist/lib/work-types.js +2 -1
  66. package/oclif.manifest.json +1166 -605
  67. package/package.json +8 -4
  68. package/templates/skills/agentia-cicd/SKILL.md +2 -2
  69. package/templates/skills/agentia-cicd/references/promotions.md +8 -8
  70. package/templates/skills/agentia-cicd/references/work.md +16 -14
package/CHANGELOG.md CHANGED
@@ -4,6 +4,73 @@ All published sections are mapped to immutable npm publication metadata. New use
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [1.0.0-beta.4] - 2026-10-07
8
+
9
+ ### Added
10
+
11
+ - Add `agentia runtime`, a bounded custom NDJSON process the Agentia IDE uses to reuse one warm CLI for many invokes instead of starting Node and oclif per call. Runtime command bodies are serialized, stdout/stderr and structured failures are preserved, stdin-consuming commands are rejected, and nested commands publish normal `command.completed` refresh events. This is process amortization, not a login daemon.
12
+ - Add a plugin host and the `@copado/agentia-plugin-sdk` package so plugins call Copado through a curated set of domain methods instead of importing CLI internals. The host exposes `work.getWorkItem`, `organization.healthCheck`, `auth.status` (configured/ready/source only), and table formatting; results are allowlisted and redacted, including errors. Plugin requests are labelled `plugin:<command id>`. The SDK ships `AgentiaCommand`, lets a plugin declare the host methods it needs (`getAgentiaHost({requires})`) so an older CLI fails with a clear message, and plugins never receive credentials.
13
+
14
+ ### Removed
15
+
16
+ - Remove the in-repo `sample_plugin/` directory. Use the reference plugin and generator in the `cli-plugin-generator` repository (`@copado/create-agentia-plugin`) instead.
17
+
18
+ ## [1.0.0-beta.3] - 2026-10-06
19
+
20
+ ### Changed
21
+
22
+ - Improve repository setup with guided HTTPS, SSH, and OAuth authentication flows. Repository credentials are now configured separately from repository details, stay out of command arguments, and are protected from accidental replacement by default.
23
+ - `cicd work environment-sync --json` includes a `logs` array of captured progress (and subprocess stdout/stderr), matching `cicd work publish` and `cicd work submit`.
24
+ - `cicd work environment-sync` human output lists committed metadata as `userstory action type name category` lines and no longer prints pathspec tables.
25
+ - `cicd work environment-sync` ends human output with `Elapsed: <seconds>s`, matching `cicd work publish` and `cicd work submit`.
26
+ - `cicd work environment-sync --continue` commits the in-progress merge when conflicts are resolved and staged but not yet committed (`MERGE_HEAD` present). If you already ran `git commit`, it skips that step and finishes the remaining sync.
27
+ - `cicd work submit` (including `--done` / `--deploy` and MCP `agentia_work_submit`) counts user stories ahead and behind the next pipeline environment and warns when stories behind might cause promotion conflicts, advising `agentia cicd work environment-sync` to retrieve and merge the newest changes.
28
+ - When merging a feature branch into the dest/dev org branch (`environment-sync` and work publish), remaining conflicts after `-X theirs` are auto-resolved by taking the feature branch (`checkout --theirs`, or `git rm` when that branch deleted the path) and completing the merge commit.
29
+
30
+ ### Fixed
31
+
32
+ - `cicd project default set --credential` validates the credential from the environment record. The credential resource does not accept GET and returned HTTP 405.
33
+ - Surface git stdout and stderr when `cicd work environment-sync` (and related git merge paths) fail, instead of only Node's generic `Command failed: git …` / exit code.
34
+
35
+ ### Fixed
36
+
37
+ - Default omitted `limit` to `50000` on `cicd data template save-detail` and MCP `agentia_data_template_save_detail` so gateway PUT validation succeeds when a v2 detail omits the field; explicit limits, including `0`, are unchanged (`US-0632625`).
38
+
39
+ ### Fixed
40
+
41
+ - Resolve local MCP project authentication, defaults, `.env`, and Git context consistently across Cursor, Claude Code, and supported roots-aware local clients; stale Cursor registrations are now upgraded to pass the active workspace root.
42
+
43
+ ## [1.0.0-beta.2] - 2026-10-02
44
+
45
+ ### Added
46
+
47
+ - Add `--user-stories-ahead-behind` to `cicd work get`. When the user story has a pipeline and source environment with one next environment, it compares ahead/behind counts via `/agentia/headless/work/user-stories-ahead-behind` and includes them in human and `--json` output.
48
+ - Require `enableLocalPromote: true` in `.agentia/config.json` (or `.agentia/config.user.json`) before `cicd work promote` runs. The command is experimental because it skips Quality Gates; when the option is missing or not `true`, it fails with an error that tells you to set that option.
49
+ - Add `cicd work promote` to create a forward promotion, or a back promotion with `--backpromote --destination-branch`, for one or more user stories. A back promotion infers the destination environment from that pipeline connection branch. The command merges each `feature/<name>` branch in order into `promotion/<promotionName>` created from the destination environment branch, then sets the promotion status to Completed or Merge Conflict. After a merge conflict, resolve the files and re-run `cicd work promote --promotion=<name-or-id> --continue` to commit the merge and finish the remaining stories. The continue hint repeats `--validate` or `--deploy` and `--sf-alias` when the original command used them. `--validate` and `--deploy` require `--sf-alias` and deploy the promotion metadata with `sf project deploy start --test-level NoTestRun`. `--validate` uses `--dry-run`, skips the destination-branch merge, and sets the status to Validated. `--deploy` merges the promotion branch into the destination branch and sets the status to Completed only after that deployment succeeds. User story records are left unchanged.
50
+ - Add `cicd work environment-sync`. It creates a Copado `back_promotion` for every user story behind the destination environment. Continue after conflicts with `cicd work environment-sync --promotion=<name> --continue`.
51
+ - Add `--abort` to `cicd work promote` and `cicd work environment-sync`. With `--promotion`, it runs `git merge --abort` and patches the promotion status to Draft (`Cancelled` is reserved by Salesforce). Conflict error suggestions include the matching `--abort` command.
52
+ - Add organization-scoped governance health checks with optional local git-sizer analysis.
53
+
54
+ ### Changed
55
+
56
+ - Declare standard MCP tool annotations (`readOnlyHint`, `destructiveHint`, `idempotentHint`, `openWorldHint`) on every Agentia MCP tool so MCP clients can auto-approve safe reads and prompt before destructive tools. The hints are advisory and do not add a server-side confirmation. Tool names, inputs, and outputs are unchanged.
57
+ - Rename `cicd work commit` to `cicd cloud commit` so Copado cloud commits are distinct from local work-item commands. `--cloud` is no longer required. `cicd work commit` remains a hidden compatibility alias and still accepts `--cloud`. MCP tools follow the same split (`agentia_cloud_commit`), with `agentia_work_commit` kept as an alias.
58
+ - Move Copado cloud promotion runs to `cicd cloud promote` / MCP `agentia_cloud_promote`. `cicd work promote` is the experimental local promotion command (previously drafted as `quick-promote`), not a cloud alias. The former MCP `agentia_work_promote` cloud alias is removed; use `agentia_cloud_promote`.
59
+ - `cicd work environment-sync` always syncs every user story behind the destination environment. It no longer accepts user story IDs or `--next-env-branch`. The next environment branch is resolved from `--destination-environment` or `--dev-org-branch`.
60
+ - `cicd work submit` (including `--done` / `--deploy` and MCP `agentia_work_submit`) counts user stories ahead and behind the next pipeline environment and warns when stories behind might cause promotion conflicts.
61
+
62
+ ### Fixed
63
+
64
+ - Allow `cicd function upsert --file <payload.json> --json` without treating `--json` as a payload flag conflict (`US-0632393` — CLI v1.1.0-alpha.0).
65
+ - Show the Salesforce component, file, and problem when `cicd work promote --validate` or `--deploy` fails, instead of only the deploy status.
66
+ - Tolerate SSE keepalive comment lines (for example `: heartbeat`) and `data:` prefixes in the Copado AI NDJSON stream instead of failing with `malformed NDJSON`, and keep the received answer with a warning when the stream closes without a `stream_complete` record.
67
+ - On a `cicd work set` / `agentia_work_set` gateway warning, clear `lastBaseBranch`, `lastDevOrgBranch`, and `lastPullRequestBaseUrl`, and record `lastWorkItemId`, `lastWorkItem`, and `lastWorkItemTitle` from the returned work item instead of leaving user config unchanged.
68
+ - Cast the `tty-table` v7 default export so TypeScript accepts the callable factory used by table formatting after the security bump.
69
+
70
+ ### Security
71
+
72
+ - Bump `brace-expansion` and bundled `npm` overrides, and apply `npm audit fix --force` (including `tty-table` to v7) so `security:gate` clears the current high advisories.
73
+
7
74
  ## [1.0.0-beta.1] - 2026-09-29
8
75
 
9
76
  ### Changed