@moda-ai/cli 1.55.24 → 1.55.26

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 (34) hide show
  1. package/dist/{agent-b4tdzy9q.js → agent-nqmha8ck.js} +8 -8
  2. package/dist/{cli-9hc5bg2r.js → cli-1mbb0ct0.js} +1 -1
  3. package/dist/{cli-vg88mg20.js → cli-5g1tv80h.js} +5 -5
  4. package/dist/{cli-rt26sbz7.js → cli-8tfk8qeb.js} +10 -6
  5. package/dist/{cli-y2ty9vtv.js → cli-b4740tnv.js} +210 -23
  6. package/dist/{cli-qvg26twp.js → cli-cdrvjva5.js} +11 -8
  7. package/dist/{cli-7xc585hc.js → cli-d577kq6h.js} +5 -5
  8. package/dist/{cli-dn91fb56.js → cli-jgfm7w1r.js} +89 -47
  9. package/dist/{cli-9btx12wp.js → cli-jtyvbd8d.js} +1 -1
  10. package/dist/{cli-qycsmxev.js → cli-k6q8dbpk.js} +3 -3
  11. package/dist/{cli-0wr3483h.js → cli-q6f6vrrr.js} +1 -1
  12. package/dist/{cli-dve50x7p.js → cli-sqsjd08w.js} +784 -725
  13. package/dist/cli.js +713 -234
  14. package/dist/{doctor-3r19ry92.js → doctor-w913fj4g.js} +8 -8
  15. package/dist/{fix-exvxzvtz.js → fix-crkwdkt4.js} +6 -6
  16. package/dist/{harness-github-actions-atc5bbkj.js → harness-github-actions-fjhvhgpj.js} +5 -5
  17. package/dist/{harness-vzy7n7ea.js → harness-x3e7d68b.js} +5 -5
  18. package/dist/{index-e1pf1qz2.js → index-2kf3fnnb.js} +11 -11
  19. package/dist/{production-intelligence-c8e0xw3n.js → production-intelligence-7n83c701.js} +75 -15
  20. package/dist/{profile-commands-6e2dgv72.js → profile-commands-ct2t0bfr.js} +3 -3
  21. package/dist/prompt-source-mcp.js +5 -5
  22. package/dist/{prompts-cvzt994j.js → prompts-92aqqb2k.js} +6 -6
  23. package/dist/{provision-q86phh4a.js → provision-gn8raqpt.js} +5 -5
  24. package/dist/{registry-s2vdsfw8.js → registry-ex162j5y.js} +3 -3
  25. package/dist/{skills-tadh1jss.js → skills-2mbsj9bt.js} +5 -5
  26. package/dist/{sync-g8wtecz1.js → sync-kghmmmk5.js} +7 -7
  27. package/package.json +1 -1
  28. package/skills/integration/index.json +2 -2
  29. package/skills/moda-cli/SKILL.md +8 -2
  30. package/skills/moda-cli/references/dashboard-parity.md +1 -1
  31. package/skills/moda-cli/references/output-protocol.md +35 -10
  32. package/skills/moda-cli/references/production-intelligence.md +3 -2
  33. package/skills/moda-cli/references/prompts.md +6 -2
  34. package/skills/moda-cli/references/search-and-traces.md +20 -2
@@ -40,7 +40,7 @@ Branch on the exit code; it is stable and cheaper than parsing the payload:
40
40
  |---|---|---|
41
41
  | `0` | ok — answer is grounded in Moda Cloud intelligence | Trust it. |
42
42
  | `1` | error — bad input, unknown id (`not_found`), access denied, API/network failure | Read `errors[0].code`; retry only `network_error` / 5xx `api_error`. For `not_found`, find a valid id first (the `cause` names the command). |
43
- | `3` | degraded — Moda Cloud was unavailable; answer synthesized from local Data API evidence | Answer is present but lower-trust; verify before acting. |
43
+ | `3` | degraded — Moda Cloud was unavailable and the answer was synthesized from local Data API evidence (`ask`), or some sources failed to load (`investigate`/`failures`, named in `data.failedSources`) | Answer is present but lower-trust or partial; verify before acting, and never read a partial result as "no issues". |
44
44
  | `4` | auth required — no API key, or the API rejected it (HTTP 401) | Set `MODA_API_KEY` or run the `login_command` from the `auth` payload (`moda auth login --api-key`), then re-run. |
45
45
  | `5` | input required — a choice is needed that the non-interactive run could not answer | Pick a choice from the `input_request` payload and re-invoke the same command with that choice's `resume_flags` appended. |
46
46
  | `130` | cancelled | Treat as interrupted or closed pipe; do not retry blindly. |
@@ -195,17 +195,42 @@ Treat an answer as degraded if **any** of these hold:
195
195
  that text stays whole, and the error message says whether `data` is whole
196
196
  or bounded with its complete copy at `truncation.data.full_output_path`.
197
197
  You can also page with a smaller `--limit` and
198
- `--offset`, or rerun with `--json` (no byte limit).
198
+ `--offset`, or rerun with `--json` (no byte limit). Commands that read
199
+ per-row extras (`--include-window`, `--include-world-state`, batch reads)
200
+ stop reading once the budget is spent; rows they did not enrich carry
201
+ `window_skipped` / `world_state_skipped: "agent_output_budget"`.
202
+ - **`--json` is compact when piped.** `--json` prints one line of JSON when
203
+ stdout is not a terminal (indented on a terminal); `--pretty` indents it
204
+ anyway. `--json` prints the payload as read: `--profile` is stamped only on
205
+ the agent envelope's generated commands (`next_commands`, `*_command`
206
+ fields), never on trace content.
199
207
  - **Unknown flags fail.** A flag the command doesn't take (a typo, or a
200
208
  filter it lacks) exits `1` with the valid flag list and a "did you mean",
201
- instead of being silently ignored. Stray arguments on commands that take
202
- none fail the same way.
203
- - **`--dry-run` is only accepted where it's implemented** (for example
204
- `registry push`, `harness sync|delete|register`, `prompts sync|decide`,
205
- `skills sync|policy`, `signals` write subcommands, `problem-reopen`;
206
- `moda <command> --help` says whether a command takes it). Anywhere else it fails **before
207
- anything is sent**. It is never silently ignored, so a "preview" can't
208
- perform a real write.
209
+ instead of being silently ignored. So does a flag the chosen mode would
210
+ not send (`moda signal <id> --limit=3` without `--detections`).
211
+ - **`--days-back` and `--days_back` are the same flag.** Every flag is read
212
+ under its kebab-case name whichever spelling you type.
213
+ - **A value flag needs a value.** `--user-id` with nothing after it (often an
214
+ empty shell variable) exits `1` naming the flag instead of sending the
215
+ string "true". Switches such as `--include-tool-io` stay bare.
216
+ - **Numbers are plain decimal integers.** `--limit=0x10`, `--limit=1e1` and
217
+ `--limit=2.5` fail; text flags keep their text (`--search=404` searches
218
+ for "404").
219
+ - **Extra words fail.** A command that takes one id rejects a second word
220
+ instead of ignoring it. Free text joins every word: `moda traces search
221
+ refund not processed` searches "refund not processed" (same for `ask` and
222
+ `feedback`).
223
+ - **Writes take `--dry-run`** (`prompts promote|ab|propose` excepted).
224
+ - `problems feedback|reopen|link`, `review`, `feedback`, `signals` writes
225
+ and `skills policy` validate fully, send nothing, and return
226
+ `data.planned` (method, endpoint, body) plus a `next_commands` entry
227
+ that runs the write for real (`requires_approval: true`).
228
+ - `registry push`, `harness sync|delete|register`, `prompts sync|decide`
229
+ and `skills sync` return their own preview. Some ask the server to
230
+ compute it (`skills sync --dry-run` sends the local skills marked
231
+ `dryRun: true`), but none of them applies a change.
232
+ - A read refuses `--dry-run` **before anything is sent**, so a "preview"
233
+ can't perform a real write.
209
234
  - **Unknown profiles fail.** `--profile=<name>` or `MODA_PROFILE` naming a
210
235
  profile that doesn't exist exits `1` instead of falling back to another
211
236
  profile's key and tenant. Time windows differ by command (below).
@@ -90,7 +90,8 @@ Rules that keep the fix grounded:
90
90
  - Cite the Moda problem id and the trace ids you relied on in the PR
91
91
  description, so a reviewer can open the same evidence.
92
92
  - To test a prompt change against real traffic before shipping it, A/B it with
93
- `moda prompts ab --baseline=<path> --candidate=<path> --traces=<ids>` (see
94
- section 7).
93
+ `moda prompts ab --baseline=<path> --candidate=<path> --problem=<problem_id>`
94
+ (replays the Problem's failing traces from their evidence anchors) or
95
+ `--traces=<ids>` (see section 7).
95
96
  - Mark the Problem fixed only after the change ships. If the issue is detected
96
97
  again, the Problem comes back; `moda problems reopen` reopens it by hand.
@@ -72,7 +72,10 @@ read, they fail (exit 1) with the number and the exact command to re-run with `-
72
72
  Only add `--yes` when the user has agreed to that spend. Limits: `--cases`
73
73
  default 5, max 100; `--seeds` default 3, max 10; `--traces` at most 100
74
74
  (`--traces=conv_id@412` replays that trace from msg_index 412, with the
75
- earlier turns as history);
75
+ earlier turns as history, and writes its case from the messages around 412);
76
+ `--problem=<problem_id>` picks a Problem's affected traces, each anchored at
77
+ its earliest evidence msg_index, up to
78
+ `--max-cases` (default 10, max 100), and prints them (`problemCases`);
76
79
  `--model` / `--assistant-model` must be one of `openai/gpt-5.6-luna`,
77
80
  `openai/gpt-4o-mini`, `openai/gpt-4o`, `anthropic/claude-sonnet-4-5`,
78
81
  `anthropic/claude-haiku-4-5`, `google/gemini-2.5-flash`,
@@ -80,7 +83,8 @@ earlier turns as history);
80
83
 
81
84
  `prompts ab --traces=<ids>` builds one case per trace from Moda's distilled
82
85
  scenario and success criteria for that trace. A trace Moda cannot distill
83
- falls back to its opening user message with three generic criteria (which long
86
+ falls back to its opening user message (for `id@N`, the user message leading
87
+ into N) with three generic criteria (which long
84
88
  traces pass easily); the run warns and lists it under `caseSources.fallback`.
85
89
  `prompts ab` never makes its replay set the tenant's primary set unless you
86
90
  pass `--promote`.
@@ -110,7 +110,16 @@ moda traces get <conversation_id> --all --from=500 --max-messages=500 # continu
110
110
  ```
111
111
 
112
112
  `--all` returns `has_more`/`next_from`; when it stops at the cap, the warning
113
- prints the exact `--from` command to continue.
113
+ prints the exact `--from` command to continue. In agent output `--all` reads
114
+ only about what fits the byte budget (a ~50-message first page), so
115
+ `returned` can be well under `--max-messages`; follow `next_from`.
116
+
117
+ A window over the agent byte budget is cut around its anchor, never past it:
118
+ the requested message is always returned, the rest are kept nearest-first on
119
+ both sides, `context.from_index`/`to_index` describe what was returned
120
+ (`requested_from_index`/`requested_to_index` and `omitted_for_byte_limit`
121
+ what was asked for), and `next_commands` has an `--all --from` command for
122
+ each side that lost messages.
114
123
 
115
124
  **Several traces? Batch them in one call instead of looping `moda traces get`
116
125
  per id.** Pass up to 25 targets as positionals or one per line with
@@ -130,7 +139,9 @@ plus `succeeded`/`failed` counts. A missing trace is a per-item
130
139
  `error.code: "not_found"`, not a failed call; the exit code is 1 only when
131
140
  every target failed. When the agent byte budget would overflow, the items that
132
141
  fit are returned and `remaining_targets` plus a `next_commands` entry read the
133
- rest. One positional id keeps the single-trace output above.
142
+ rest. Agent output stops reading targets once the budget is spent, so the
143
+ targets it names were not read yet (nothing is read and then dropped). One
144
+ positional id keeps the single-trace output above.
134
145
 
135
146
  `moda traces get` returns messages whole, with their tool calls and results. An
136
147
  older Moda server cuts message text, tool inputs, and tool results at 500
@@ -148,6 +159,7 @@ moda traces spans <conversation_id> --include-raw # attach verbatim raw_event
148
159
  moda traces spans <conversation_id> --include-bodies # keep prompt/response/attribute bodies
149
160
  moda traces spans <conversation_id> --limit=1000 # ingest rows to read (default 200, max 1000)
150
161
  moda traces spans <conversation_id> --cursor=<next_cursor> # next page of a capped audit
162
+ moda traces spans <conversation_id> --cursor=<c> --span-offset=N # rest of a page cut for the agent budget
151
163
  moda traces spans <id1> <id2> <id3> # batch: up to 25 ids, one envelope
152
164
  ```
153
165
 
@@ -162,6 +174,12 @@ A full `--limit` page of ingest rows, the server's ~3 MB response budget
162
174
  (`summary.truncated_reason: "byte_limit"`) or a span cap sets both, and a
163
175
  warning plus `next_commands` give the follow-up — usually the `--cursor=` page
164
176
  from `next_cursor`; for very large traces audit one OTLP trace at a time
177
+ (see below). In agent output a page over the byte budget (the server's
178
+ smallest page, 32 KiB, is over the 24,000-byte default) keeps the most spans
179
+ that fit: `span_offset`/`next_span_offset`/`page_spans` say which,
180
+ `next_cursor` is `null` until the last spans of the page are read, and
181
+ `next_commands` has the `--span-offset=N` command that reads the rest of the
182
+ same page. Following `next_commands` never skips a span;
165
183
  (`summary.trace_ids`, `--kind=trace`). Prompt/response bodies are omitted by
166
184
  default (`{"omitted": true, "original_bytes": N}`); `--include-bodies` keeps
167
185
  them, cutting strings over 8 KB to `{"truncated": true, "original_bytes": N,