@getmagical/cli 0.10.1 → 0.12.1

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
@@ -24,10 +24,41 @@ mgcl org list
24
24
  mgcl automations list --limit 10
25
25
  mgcl automations update --id ... --input-json ...
26
26
  mgcl automation-runs list --automation-id ...
27
+ mgcl work-items list --automation-id ... --status FAILED,STOPPED
28
+ mgcl work-items get --id ...
29
+ mgcl automation-runs list-page --work-item-id ...
27
30
  mgcl automations run-draft --draft-automation-id ... --agent-id ... --idempotency-key ... --config-json '{"startInTakeOverMode":true,"captureActions":true,"approvalMode":"HUMAN_APPROVAL","consistencyCheckCount":3}'
28
31
  mgcl automations publish --draft-automation-id ... # non-production only: mgcl refuses against the production API, and the API rejects it too
29
32
  ```
30
33
 
34
+ ## Search automation runs
35
+
36
+ ```bash
37
+ mgcl automation-runs list --search 'REF-123456' --automation-id <id> --json
38
+ mgcl automation-runs list-page --search 'REF-123456' --limit 20 --page 0 --json
39
+ ```
40
+
41
+ Both commands search on the server before pagination and combine `--search`
42
+ with the existing automation, workflow, status, invocation-type, and date
43
+ filters. Search ignores outer whitespace, matches case-insensitively, and
44
+ looks for substrings in run IDs, automation names, run input/shared-input
45
+ values, and current Data Store leaf values. Empty or whitespace-only search
46
+ disables the search predicate while preserving the other filters. PostgreSQL `ILIKE` patterns apply:
47
+ `%` matches any sequence, `_` matches one character, and backslash escapes
48
+ pattern characters. NUL characters are rejected.
49
+
50
+ Nested input values and Data Store leaves are searched in their JSON text
51
+ representation, so escaped quotes or backslashes can cause misses. Prefer a
52
+ simpler identifying fragment, then inspect the candidate's actual values.
53
+
54
+ `list` returns an array. `list-page` returns `items`, `page`, `pageSize`,
55
+ `hasMore`, `total`, and `isTotalTruncated`. Use `hasMore` to continue paging;
56
+ when `isTotalTruncated` is true, `total` is only a lower bound. Searched pages
57
+ avoid counting all matches: totals become exact on a nonempty terminal page
58
+ or an empty first page. An empty page beyond the end cannot establish the
59
+ exact total. Random ordering supports only page 0 and searched random samples
60
+ always report a truncated total.
61
+
31
62
  ## Regression tests
32
63
 
33
64
  Choose how many historical baseline runs to test per pathway:
@@ -49,42 +80,43 @@ The count applies only when creating a regression test. Repeating the command
49
80
  for the same automation and agent version pair returns the existing test;
50
81
  changing the count does not expand or rerun it.
51
82
 
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
-
56
83
  ## Typed classification
57
84
 
58
85
  Use `mgcl classify` for focused typed judgments over context you already have.
59
- The request uses TypeSafe-shaped JSON with one shared `state` and a map of
60
- named `questions`. Version 1 supports `noul`, `choice`, and `score` questions.
61
- The backend uses `jev-latest` by default. Add `model` to the request to select
62
- an explicit supported model; the response reports the model actually used.
63
- Instructions, choice descriptions, rubric levels, and score legends may be
64
- structured JSON and are passed through without narrowing.
65
- The backend applies a 30-second total deadline, including bounded transient
66
- retries. Access is employee-only through normal CLI credentials or an allowed
67
- Magical runtime identity.
86
+ The request has one shared `context` (text or JSON), optional `images`, and a
87
+ map of named `questions`. Question types are `predicate`, `choice`, and
88
+ `score`, and every question needs `instructions`. Choices are a map of value to
89
+ description; score `levels` are an ordered list of `{label, description?}`.
90
+
91
+ `--provider` selects `openai` (the default, OpenAI Decisions `gpt-6-luna`) or
92
+ `typesafe` (TypeSafe `jev-latest`) and overrides `provider` in the request. Add
93
+ `model` to select an explicit model for that provider; the response reports the
94
+ provider and model actually used. Images must be base64 data URLs and are only
95
+ supported by `openai`; `typesafe` rejects them with an input error. The backend
96
+ applies a 30-second total deadline. Access is employee-only through normal CLI
97
+ credentials or an allowed Magical runtime identity.
68
98
 
69
99
  ```bash
70
100
  mgcl classify --input-file request.json
71
- mgcl classify --input-json '{"state":"Please refund the duplicate charge.","questions":{"refund_requested":{"type":"noul","instructions":"Does the message explicitly request a refund?"}}}'
101
+ mgcl classify --provider typesafe --input-file request.json
102
+ mgcl classify --input-json '{"context":"Please refund the duplicate charge.","questions":{"refund_requested":{"type":"predicate","instructions":"Does the message explicitly request a refund?"}}}'
72
103
  cat request.json | mgcl classify --input-file -
73
104
  ```
74
105
 
75
106
  Pass exactly one input source. Questions in one batch are independent and
76
107
  cannot consume sibling answers. Split dependent judgments into separate calls.
77
- `noul` is a probability rather than a boolean; choice results retain the full
78
- option distribution; scores may be fractional. Confidence represents the
79
- returned distribution, not correctness, so include an `insufficient_evidence`
80
- choice when the supplied context may not establish an answer.
81
-
82
- The command evaluates only supplied text and JSON. It does not fetch URLs,
83
- files named in the request, run records, or media. Output is always the full
84
- parseable JSON response, including model, usage, probability distributions,
85
- score legends, and additive fields. A valid negative or uncertain answer exits
86
- successfully. Invalid input and backend or provider failures use the normal
87
- nonzero CLI error path and write diagnostics to stderr.
108
+ Every provider returns the same answer shape: predicates return a
109
+ `probability`; choices return the `choice`, `confidence`, and the full option
110
+ `probabilities`; scores return a possibly fractional `score`, `confidence`, and
111
+ per-level probabilities. Confidence represents the returned distribution, not
112
+ correctness, so include an `insufficient_evidence` choice when the supplied
113
+ context may not establish an answer.
114
+
115
+ The command does not fetch URLs, files named in the request, run records, or
116
+ hosted media. Output is always the full parseable JSON response, including
117
+ provider, model, usage, and probability distributions. A valid negative or
118
+ uncertain answer exits successfully. Invalid input and backend or provider
119
+ failures use the normal nonzero CLI error path and write diagnostics to stderr.
88
120
 
89
121
  ## Publish checks after saving
90
122