@copado/agentia-cli 1.0.0-beta.2 → 1.0.0-beta.5

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 (55) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +416 -293
  3. package/dist/commands/cicd/data/template/save-detail.js +2 -2
  4. package/dist/commands/cicd/repository/auth/https/configure.js +21 -0
  5. package/dist/commands/cicd/repository/auth/oauth/login.js +56 -0
  6. package/dist/commands/cicd/repository/auth/setup.js +28 -0
  7. package/dist/commands/cicd/repository/auth/ssh/configure.js +22 -0
  8. package/dist/commands/cicd/repository/create.js +2 -2
  9. package/dist/commands/cicd/repository/reset.js +17 -5
  10. package/dist/commands/cicd/repository/update.js +6 -14
  11. package/dist/commands/cicd/work/environment-sync.js +66 -61
  12. package/dist/commands/cicd/work/get.js +5 -9
  13. package/dist/commands/cicd/work/submit.js +1 -1
  14. package/dist/commands/cicd/work/test/apex.js +37 -4
  15. package/dist/commands/cicd/work/test.js +20 -1
  16. package/dist/commands/runtime.js +26 -0
  17. package/dist/hooks/finally/ide-command-event.js +1 -1
  18. package/dist/hooks/init/plugin-host.js +6 -0
  19. package/dist/lib/agentia-command.js +16 -0
  20. package/dist/lib/cicd-gateway.js +2 -1
  21. package/dist/lib/cursor-mcp-config.js +3 -1
  22. package/dist/lib/data-types.js +3 -1
  23. package/dist/lib/git-worktree.js +2 -1
  24. package/dist/lib/local-quality-gates.js +4 -1
  25. package/dist/lib/mcp/data-tools.js +2 -2
  26. package/dist/lib/mcp/server.js +33 -7
  27. package/dist/lib/mcp/tool-annotations.js +3 -0
  28. package/dist/lib/mcp/tools.js +55 -12
  29. package/dist/lib/mcp/work-tools.js +44 -13
  30. package/dist/lib/plugin-host/auth.js +4 -0
  31. package/dist/lib/plugin-host/event-log.js +3 -0
  32. package/dist/lib/plugin-host/format.js +3 -0
  33. package/dist/lib/plugin-host/index.js +7 -0
  34. package/dist/lib/plugin-host/organization.js +4 -0
  35. package/dist/lib/plugin-host/projection-utils.js +6 -0
  36. package/dist/lib/plugin-host/registry.js +6 -0
  37. package/dist/lib/plugin-host/request-scope.js +4 -0
  38. package/dist/lib/plugin-host/work.js +4 -0
  39. package/dist/lib/project-root.js +3 -1
  40. package/dist/lib/repository-auth.js +8 -0
  41. package/dist/lib/repository-flags.js +2 -2
  42. package/dist/lib/repository-types.js +6 -1
  43. package/dist/lib/repository-url-prefill.js +4 -0
  44. package/dist/lib/runtime-invoke-context.js +6 -0
  45. package/dist/lib/runtime-rpc.js +14 -0
  46. package/dist/lib/runtime.js +1 -1
  47. package/dist/lib/setup-templates.js +2 -1
  48. package/dist/lib/work-apex-test-failures.js +13 -0
  49. package/dist/lib/work-apex-test.js +4 -1
  50. package/dist/lib/work-environment-sync.js +1 -2
  51. package/dist/lib/work-get.js +3 -0
  52. package/oclif.manifest.json +315 -174
  53. package/package.json +4 -3
  54. package/templates/skills/agentia-cicd/SKILL.md +1 -1
  55. package/templates/skills/agentia-cicd/references/work.md +2 -2
package/CHANGELOG.md CHANGED
@@ -4,6 +4,61 @@ All published sections are mapped to immutable npm publication metadata. New use
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [1.0.0-beta.5] - 2026-10-08
8
+
9
+ ### Added
10
+
11
+ - `cicd work test` accepts repeatable `-e` / `--env NAME=value` (MCP `agentia_work_test` `env` string array) to inject extra variables into the local quality-gate script environment for custom skips, tool API keys, and similar script-owned knobs. Reserved `AGENTIA_APEX_*` values from dedicated flags still override conflicting `-e` names.
12
+
13
+ ### Changed
14
+
15
+ - `cicd work test apex` (`-t` / `--apex-test-classes`) is optional. When omitted or empty, the command reports that no Apex tests were specified and exits without calling Salesforce CLI, so quality-gate scripts can pass `-t "${AGENTIA_APEX_TEST_CLASSES}"` unconditionally. MCP `agentia_work_test_apex` matches. Sample Unix/Windows quality-gate scripts no longer wrap that call in an env-var `if`.
16
+ - `cicd work test` and `cicd work test apex` accept `--rerun-failed-apex-tests`. Failed Apex runs save `.agentia/apex.tests.<user-story>.json`; a later successful run deletes it. That flag reruns those failed classes (`work test` sets `AGENTIA_APEX_RERUN_FAILED` to `--rerun-failed-apex-tests` or empty for sample quality-gate scripts). MCP uses `rerunFailedApexTests`. Subset reruns merge with the saved failure list so classes not in the run stay queued.
17
+ - `cicd work test` / `work submit` always inject `AGENTIA_APEX_TEST_CLASSES` and `AGENTIA_APEX_RERUN_FAILED` into the quality-gate script environment (empty string when the flags are omitted), so `set -u` scripts can expand them without inheriting a stale shell value.
18
+ - Sample Unix/Windows quality-gate scripts run `npx sfdx-lwc-jest -- --passWithNoTests` so LWC Jest does not fail when a project has no tests.
19
+ - Record plugin activity in the CICD `/eventlog` like AI and CRT traffic. Each plugin host call (`work.getWorkItem`, `organization.healthCheck`, `auth.status`) sends one best-effort event tagged `plugin:<command id>` with the host method name, a placeholder `plugin-host://` URL and the transaction id, and never arguments, results or credentials; delivery failures never affect the plugin call.
20
+
21
+ ### Fixed
22
+
23
+ - `agentia setup` and `agentia setup skills create|update` no longer preselect portable skills. The target prompt starts with nothing checked, and continuing without a selection is rejected. Headless `--target` and the omitted-target default of `.agents/skills` are unchanged.
24
+ - `cicd work test apex` exits with the same process exit code as Salesforce CLI (`sf`), including `100` when Apex tests fail (and other nonzero `sf` codes), instead of always exiting `1`.
25
+
26
+ ## [1.0.0-beta.4] - 2026-10-07
27
+
28
+ ### Added
29
+
30
+ - 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.
31
+ - 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.
32
+
33
+ ### Removed
34
+
35
+ - Remove the in-repo `sample_plugin/` directory. Use the reference plugin and generator in the `cli-plugin-generator` repository (`@copado/create-agentia-plugin`) instead.
36
+
37
+ ## [1.0.0-beta.3] - 2026-10-06
38
+
39
+ ### Changed
40
+
41
+ - 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.
42
+ - `cicd work environment-sync --json` includes a `logs` array of captured progress (and subprocess stdout/stderr), matching `cicd work publish` and `cicd work submit`.
43
+ - `cicd work environment-sync` human output lists committed metadata as `userstory action type name category` lines and no longer prints pathspec tables.
44
+ - `cicd work environment-sync` ends human output with `Elapsed: <seconds>s`, matching `cicd work publish` and `cicd work submit`.
45
+ - `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.
46
+ - `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.
47
+ - 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.
48
+
49
+ ### Fixed
50
+
51
+ - `cicd project default set --credential` validates the credential from the environment record. The credential resource does not accept GET and returned HTTP 405.
52
+ - 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.
53
+
54
+ ### Fixed
55
+
56
+ - 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`).
57
+
58
+ ### Fixed
59
+
60
+ - 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.
61
+
7
62
  ## [1.0.0-beta.2] - 2026-10-02
8
63
 
9
64
  ### Added