@getmagical/cli 0.9.1 → 0.10.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 CHANGED
@@ -28,6 +28,31 @@ mgcl automations run-draft --draft-automation-id ... --agent-id ... --idempotenc
28
28
  mgcl automations publish --draft-automation-id ... # non-production only: mgcl refuses against the production API, and the API rejects it too
29
29
  ```
30
30
 
31
+ ## Regression tests
32
+
33
+ Choose how many historical baseline runs to test per pathway:
34
+
35
+ ```bash
36
+ mgcl regression run \
37
+ --automation-version <automation-version-id> \
38
+ --agent-version <agent-version-id> \
39
+ --runs-per-path 5 \
40
+ --json
41
+ ```
42
+
43
+ `--runs-per-path` accepts integers from 1 to 20 and defaults to 2. This is an
44
+ upper limit: pathways with fewer eligible historical runs use the available
45
+ runs. Each selected baseline gets 30 replay attempts by default, so five
46
+ baselines produce up to 150 attempts per pathway.
47
+
48
+ The count applies only when creating a regression test. Repeating the command
49
+ for the same automation and agent version pair returns the existing test;
50
+ changing the count does not expand or rerun it.
51
+
52
+ `mgcl pathway-regression preview --runs-per-path <count>` remains a historical
53
+ coverage lookup, accepting 1–50 with a default of 2. It does not configure a
54
+ later regression test.
55
+
31
56
  ## Typed classification
32
57
 
33
58
  Use `mgcl classify` for focused typed judgments over context you already have.
@@ -518,6 +543,59 @@ These GraphQL operations come from the same shared registry used by the Apollo
518
543
  MCP server. MCP callers must provide `idempotencyKey` and
519
544
  `expectedTrialCount` directly when starting a run.
520
545
 
546
+ ## Agent export and import
547
+
548
+ Use user login for agent transfers. Export selected agents from a library asset
549
+ or a saved automation version, then import the file into a draft in the same
550
+ workspace:
551
+
552
+ ```bash
553
+ mgcl agents export --library-entity-id <library-id> --ids <agent-id> --org <org-id> --json > agents.json
554
+ mgcl agents import --automation-id <destination-id> --base-version-id <current-draft-version-id> --file agents.json --org <org-id> --json
555
+ ```
556
+
557
+ For an automation source, replace `--library-entity-id` with
558
+ `--automation-version-id`. Export uses the existing selected-agent JSON format,
559
+ including its selection filtering. Import returns `importedAgentIds` and the new
560
+ `draftVersionId`.
561
+
562
+ Import converts the JSON into the existing automation update operation. It
563
+ allocates new IDs, remaps internal references, and preserves API request config.
564
+ Instructions are converted to the update API's command format; command/comment
565
+ identities are recreated and canvas positions are not imported. Existing update
566
+ validation, trigger rules, normalization, audit logging, and stale-version checks
567
+ apply. Destination settings are not imported. Cross-workspace transfers,
568
+ shared-input migration, and branch imports are not supported.
569
+
570
+ JSON imports reject literal credentials and platform resource references using
571
+ the same scanner as portal JSON imports, even when the source workspace matches.
572
+ Remove those values from the exported file and configure them in the destination.
573
+ Fully templated credentials remain importable.
574
+
575
+ Deploy the backend transfer fields before releasing CLI 0.9.3.
576
+
577
+ ## Library assets
578
+
579
+ Library assets are reusable agent subtrees shared by automations in one
580
+ workspace. Like agent transfers, these commands require user login.
581
+
582
+ ```bash
583
+ mgcl library search --query login --org <org-id> --json
584
+ mgcl library get --library-entity-id <library-id> --org <org-id> --json
585
+ mgcl library create --name "Shared Login" --org <org-id> --json
586
+ mgcl library convert --draft-automation-id <automation-id> --root-agent-id <agent-id> --base-version-id <current-draft-version-id> --name "Shared Login" --org <org-id> --json
587
+ mgcl library import --draft-automation-id <automation-id> --library-entity-id <library-id> --base-version-id <current-draft-version-id> --parent-agent-id <agent-id> --org <org-id> --json
588
+ ```
589
+
590
+ An asset is named after its root agent. `--name` on `create` names the new
591
+ root agent (default `New Asset`); on `convert` it renames the converted root
592
+ agent, which otherwise keeps its name. `convert` and `import` save the draft
593
+ and return the new `draftVersionId`. Omit `--parent-agent-id` to import the
594
+ asset at the top level.
595
+
596
+ Deploy the backend `convertAutomationSubtreeToLibraryAsset(assetName:)`
597
+ argument before releasing CLI 0.10.0.
598
+
521
599
  ## Automation branches
522
600
 
523
601
  `--branch-id` is a global, per-command authoring target. The CLI never stores a