@moda-ai/cli 1.55.45 → 1.55.47

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 (42) hide show
  1. package/README.md +7 -8
  2. package/dist/{agent-5ax7fqhe.js → agent-aewgndk0.js} +16 -16
  3. package/dist/{cli-tztzrh6b.js → cli-4kf462jq.js} +3 -3
  4. package/dist/{cli-xcpwp0gb.js → cli-d6gfxx8t.js} +1 -1
  5. package/dist/{cli-t4xfvrry.js → cli-dxbd1xxs.js} +5 -5
  6. package/dist/{cli-wwbr5caw.js → cli-fqc02t6h.js} +12 -91
  7. package/dist/{cli-sejqvvhv.js → cli-h1z9yyqk.js} +1 -1
  8. package/dist/{cli-dmm9jm9m.js → cli-j08a1mam.js} +1 -1
  9. package/dist/{cli-8pcq2et6.js → cli-m4474bnj.js} +1 -1
  10. package/dist/{cli-xx0pjzkh.js → cli-s7d069g0.js} +5 -19
  11. package/dist/{cli-4m0rgkx4.js → cli-sqnw96gj.js} +2 -2
  12. package/dist/{cli-d4cdczhe.js → cli-x7rc3twr.js} +42 -42
  13. package/dist/{cli-5aa48ry5.js → cli-xctqdn42.js} +3 -3
  14. package/dist/cli.js +227 -630
  15. package/dist/{doctor-k4tdgvgv.js → doctor-fz5kq44d.js} +8 -8
  16. package/dist/{harness-avynbq4f.js → harness-cy0gpyhj.js} +10 -10
  17. package/dist/{harness-github-actions-gd6vyxb0.js → harness-github-actions-aac3tn96.js} +9 -9
  18. package/dist/{index-63k2a6gb.js → index-5eyq3ykt.js} +26 -26
  19. package/dist/{production-intelligence-0z6v6tpp.js → production-intelligence-fe5masaa.js} +43 -10
  20. package/dist/{profile-commands-mh3kfqkn.js → profile-commands-zbyn9xg2.js} +5 -5
  21. package/dist/{prompt-attribution-wvvnzw4m.js → prompt-attribution-g9gtv191.js} +9 -9
  22. package/dist/prompt-source-mcp.js +9 -9
  23. package/dist/{prompts-snnbyxmz.js → prompts-b6awryvv.js} +9 -13
  24. package/dist/{provision-t1dpzcjp.js → provision-xkhwz86g.js} +6 -6
  25. package/dist/{registry-8zkxefjs.js → registry-d7xdm4dw.js} +4 -4
  26. package/dist/{skills-d4215fa9.js → skills-zfenne8w.js} +6 -6
  27. package/dist/{sync-17f9yxb1.js → sync-5vd8gwte.js} +12 -12
  28. package/package.json +1 -1
  29. package/skills/integration/index.json +2 -2
  30. package/skills/moda-cli/SKILL.md +7 -10
  31. package/skills/moda-cli/references/commands.md +1 -2
  32. package/skills/moda-cli/references/dashboard-parity.md +2 -3
  33. package/skills/moda-cli/references/output-protocol.md +1 -1
  34. package/skills/moda-cli/references/production-intelligence.md +0 -4
  35. package/skills/moda-cli/references/prompts.md +1 -27
  36. package/skills/moda-cli/references/{replays-and-registry.md → registry.md} +15 -59
  37. package/dist/cli-4pc0a18x.js +0 -12
  38. package/dist/cli-8pksf2x7.js +0 -754
  39. package/dist/fix-nk5xffz8.js +0 -1440
  40. package/dist/prompts-ab-y7egdzg4.js +0 -64
  41. package/dist/prompts-propose-5nw25v9a.js +0 -256
  42. package/dist/{cli-e24fjyrb.js → cli-da3h2p6w.js} +28 -28
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: moda-cli
3
- version: 3.0.10
4
- description: Investigate a production AI agent with the Moda CLI (`moda`) - find where something happened in real traces (traces search, then traces get), check agent health, rank what to fix (investigate, problems), and dig into tool failures, user frustration, and hallucinations. Also prompt registry sync/promote, replays, custom signals, and false-positive marking. Use when the user mentions Moda, production traces or conversations of their agent, agent failures, or asks what to fix.
3
+ version: 3.0.11
4
+ description: Investigate a production AI agent with the Moda CLI (`moda`) - find where something happened in real traces (traces search, then traces get), check agent health, rank what to fix (investigate, problems), and dig into tool failures, user frustration, and hallucinations. Also prompt registry sync/promote, harness registry push, custom signals, and false-positive marking. Use when the user mentions Moda, production traces or conversations of their agent, agent failures, or asks what to fix.
5
5
  ---
6
6
 
7
7
  # Moda CLI
@@ -81,7 +81,7 @@ Details: `references/output-protocol.md`.
81
81
  | A synthesized answer | `moda ask "<question>"` only when the user asks: each call is a paid agent run (up to about 200k tokens) | Exit 3 means degraded |
82
82
  | A detection is wrong | `moda review <kind> <target> --reason="..."` | `references/signals-and-false-positives.md` |
83
83
  | Moda data looks wrong or missing | `moda feedback "<what and why>" --conversation-id=<id>` | |
84
- | Prompts, replays, registry push | Only on explicit request | `references/prompts.md`, `references/replays-and-registry.md` |
84
+ | Prompts, registry push | Only on explicit request | `references/prompts.md`, `references/registry.md` |
85
85
 
86
86
  Time windows differ by command: `--days-back=N` (1-90) on overview,
87
87
  investigate, problems, and detection commands (`detections list
@@ -97,10 +97,7 @@ names the closest values. `moda <noun> <verb> --help` shows which.
97
97
  2. `moda problems get <problem_id> --evidence` and open two or three anchors with
98
98
  `moda traces get <id> --msg-index=<n>` before deciding on a cause.
99
99
  3. Make the change in code; cite the problem id and trace ids in the commit or PR.
100
- 4. Test a prompt change on the Problem's failing traces (a paid replay, so ask
101
- first; prompt changes only today):
102
- `moda prompts ab --problem=<problem_id> --baseline=<prompt_key> --candidate=<edited file>`.
103
- 5. After it ships, and only if the user agrees:
100
+ 4. After it ships, and only if the user agrees:
104
101
  `moda problems feedback <problem_id> --action=mark_fixed`.
105
102
  More: `references/production-intelligence.md`.
106
103
 
@@ -109,9 +106,9 @@ More: `references/production-intelligence.md`.
109
106
  - Read evidence before acting on a summary; quote trace ids and message
110
107
  indexes when you report.
111
108
  - Never run writes (`problems feedback`, `review`,
112
- `signals create|update|...`, `prompts sync|promote|ab`, `registry push`)
109
+ `signals create|update|...`, `prompts sync|promote`, `registry push`)
113
110
  unless the user asked. Preview with `--dry-run` (every write except
114
- `prompts promote|ab|propose` takes it): it validates and applies nothing.
111
+ `prompts promote` takes it): it validates and applies nothing.
115
112
  Most writes print the exact request and a `next_commands` entry that runs
116
113
  it for real (see `references/output-protocol.md`).
117
114
  - An empty result in a window means "nothing in that window". Widen the window
@@ -156,6 +153,6 @@ Read only what the task needs:
156
153
  - `references/detections.md`: frustrations, emotions, tool failures, anchors and windows
157
154
  - `references/production-intelligence.md`: overview, investigate, ask, Problems and the fix loop
158
155
  - `references/signals-and-false-positives.md`: custom signals and false-positive marks
159
- - `references/prompts.md`, `references/replays-and-registry.md`: prompt registry, replays, registry push
156
+ - `references/prompts.md`, `references/registry.md`: prompt registry, registry push
160
157
  - `references/dashboard-parity.md`, `references/recipes.md`, `references/feedback.md`
161
158
  - `references/troubleshooting.md`, `references/commands.md` (command index; `--help` is authoritative)
@@ -62,8 +62,7 @@ Loaded on demand from the moda-cli skill. This table can lag the CLI: `moda <com
62
62
  | `--cohort=<ref>` | Scope `problems list`, `traces list`, `detections list` (emotion/frustration/hallucination per trace, laziness, custom_signal hits), `detections tools` and `clusters` to one cohort (`builtin:<key>` or a saved id from `moda cohorts list`). The summary names the cohort; a warning means the server did not confirm the scope |
63
63
  | `moda problems reopen <pid>` | Reopen a Problem marked fixed |
64
64
  | `moda signals <create\|update\|activate\|pause\|delete\|examples\|refine\|revise\|proposals\|accept\|reject\|search\|preview>` | Manage custom signals (writes take `--dry-run`; LLM-backed ones are rate-limited per key) |
65
- | `moda prompts list\|show\|proposals\|usage\|replay-runs\|decide` | Read the prompt registry; merge/reject proposals |
66
- | `moda replays sets\|runs\|run\|playouts\|playout` | Replay results: run history, per-seed verdicts, playout transcripts with tool provenance (read-only) |
65
+ | `moda prompts list\|show\|proposals\|usage\|decide` | Read the prompt registry; merge/reject proposals |
67
66
  | `moda skills list\|show\|policy` / `moda harness list\|show\|versions\|diff` | Skill library and synced harnesses |
68
67
 
69
68
  `moda traces search` flags: `--mode=keyword|semantic|hybrid` (default `hybrid`),
@@ -5,7 +5,7 @@ Loaded on demand from the moda-cli skill.
5
5
  ### 10. Everything the dashboard does, from the CLI
6
6
 
7
7
  Every command below needs only an API key, and the tenant comes from the key.
8
- Writes listed here accept `--dry-run`: it validates the call, prints the exact request (method, endpoint, body) and sends nothing, and its `next_commands` entry is the command that sends it for real (`mutability: write`, `requires_approval: true`). That covers `problems feedback|reopen|link`, `review`, `feedback`, `cohorts create|update` and the `signals` writes. `prompts promote|ab|propose` refuse `--dry-run` before sending anything, so run them only when you mean it.
8
+ Writes listed here accept `--dry-run`: it validates the call, prints the exact request (method, endpoint, body) and sends nothing, and its `next_commands` entry is the command that sends it for real (`mutability: write`, `requires_approval: true`). That covers `problems feedback|reopen|link`, `review`, `feedback`, `cohorts create|update` and the `signals` writes. `prompts promote` refuses `--dry-run` before sending anything, so run it only when you mean it.
9
9
 
10
10
  | Dashboard | CLI |
11
11
  |---|---|
@@ -29,8 +29,7 @@ Writes listed here accept `--dry-run`: it validates the call, prints the exact r
29
29
  | Custom signals: edit, lifecycle | `moda signals update <id> …`, `moda signals activate\|pause\|delete <id>` (delete: drafts only; archiving is dashboard-only) |
30
30
  | Custom signals: review & tune | `moda signals examples <id> add\|update\|remove --conversation-id=…`, `refine <id> --request="…"`, `revise <id> --conversation-ids=…`, `proposals <id>`, `accept\|reject <id> <proposal_id>` |
31
31
  | Custom signals: find matches | `moda signals search <id>`, `search-status <id> <search_id>`, `search-stop <id> <search_id>`, `preview --file=detector.json` |
32
- | Replays: run detail, playout transcripts | `moda replays runs <set_id>`, `run <set_id> <run_id>`, `playouts <set_id> <run_id> [--case --arm --seed --transcript]`, `playout <set_id> <run_id> <playout_id>` |
33
- | Prompts registry | `moda prompts list [--label --search]`, `show <key>`, `proposals <key>`, `usage <key>`, `replay-runs <key>`, `decide <key> <proposal_id> --action=merge\|reject\|reopen` |
32
+ | Prompts registry | `moda prompts list [--label --search]`, `show <key>`, `proposals <key>`, `usage <key>`, `decide <key> <proposal_id> --action=merge\|reject\|reopen` |
34
33
  | Skills library | `moda skills list`, `show <key>`, `policy <key> --live\|--local` |
35
34
  | Harness pages | `moda harness list`, `show <id>`, `versions <id>`, `diff <id> --from=… --to=…` |
36
35
 
@@ -220,7 +220,7 @@ Treat an answer as degraded if **any** of these hold:
220
220
  instead of ignoring it. Free text joins every word: `moda traces search
221
221
  refund not processed` searches "refund not processed" (same for `ask` and
222
222
  `feedback`).
223
- - **Writes take `--dry-run`** (`prompts promote|ab|propose` excepted).
223
+ - **Writes take `--dry-run`** (`prompts promote` excepted).
224
224
  - `problems feedback|reopen|link`, `review`, `feedback`, `signals` writes
225
225
  and `skills policy` validate fully, send nothing, and return
226
226
  `data.planned` (method, endpoint, body) plus a `next_commands` entry
@@ -141,9 +141,5 @@ Rules that keep the fix grounded:
141
141
  not on the Problem's title alone.
142
142
  - Cite the Moda problem id and the trace ids you relied on in the PR
143
143
  description, so a reviewer can open the same evidence.
144
- - To test a prompt change against real traffic before shipping it, A/B it with
145
- `moda prompts ab --baseline=<path> --candidate=<path> --problem=<problem_id>`
146
- (replays the Problem's failing traces from their evidence anchors) or
147
- `--traces=<ids>` (see section 7).
148
144
  - Mark the Problem fixed only after the change ships. If the issue is detected
149
145
  again, the Problem comes back; `moda problems reopen` reopens it by hand.
@@ -61,33 +61,7 @@ sources: # prompts defined in code or config, mapped in pla
61
61
  To attribute runtime calls, stamp the lock entry `{ key, promptId, versionId }`
62
62
  on telemetry. With Cloudflare Think / AI SDK 7, pass
63
63
  `prompt: lock.prompts['<key>']` to `createThinkTelemetry` (`moda-ai/think`) or
64
- `createAI7Telemetry` (`moda-ai/ai7`). A `moda fix` that lands `UNROUTED` with
65
- "top share 0%" means the evidence carries no prompt version: wire this up,
66
- then check `moda prompts status`.
67
-
68
- `prompts ab` and `prompts propose --gate` run paid replays. Before sending
69
- anything they compute planned playouts (cases × seeds × 2 arms) and print it
70
- (`plannedPlayouts`). Above 200, or when an existing set's case count can't be
71
- read, they fail (exit 1) with the number and the exact command to re-run with `--yes`.
72
- Only add `--yes` when the user has agreed to that spend. Limits: `--cases`
73
- default 5, max 100; `--seeds` default 3, max 10; `--traces` at most 100
74
- (`--traces=conv_id@412` replays that trace from msg_index 412, with the
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`);
79
- `--model` / `--assistant-model` must be one of `openai/gpt-5.6-luna`,
80
- `openai/gpt-4o-mini`, `openai/gpt-4o`, `anthropic/claude-sonnet-4-5`,
81
- `anthropic/claude-haiku-4-5`, `google/gemini-2.5-flash`,
82
- `google/gemini-2.5-pro` unless you pass `--allow-any-model`.
83
-
84
- `prompts ab --traces=<ids>` builds one case per trace from Moda's distilled
85
- scenario and success criteria for that trace. A trace Moda cannot distill
86
- falls back to its opening user message (for `id@N`, the user message leading
87
- into N) with three generic criteria (which long
88
- traces pass easily); the run warns and lists it under `caseSources.fallback`.
89
- `prompts ab` never makes its replay set the tenant's primary set unless you
90
- pass `--promote`.
64
+ `createAI7Telemetry` (`moda-ai/ai7`).
91
65
 
92
66
  Runtime code should render synced prompts through the SDK:
93
67
 
@@ -1,53 +1,15 @@
1
- # Replays and the harness registry
1
+ # Harness registry
2
2
 
3
3
  Loaded on demand from the moda-cli skill.
4
4
 
5
- ### 7a. Check a replay verdict (`moda replays`)
6
-
7
- Use after `prompts ab`, `prompts propose --gate`, or a dashboard replay when
8
- you need to see *why* an arm passed or failed. Read-only; no replay spend.
9
-
10
- ```bash
11
- moda replays sets --json # set ids
12
- moda replays runs <set_id> --limit=5 --json # newest runs, every status
13
- moda replays run <set_id> <run_id> --json # per-case + per-seed verdicts
14
- moda replays playouts <set_id> <run_id> --json # one row per case x arm x seed
15
- moda replays playouts <set_id> <run_id> --case=<case_id> --arm=proposed --seed=1 --transcript --json
16
- moda replays playout <set_id> <run_id> <playout_id> --json
17
- ```
18
-
19
- `run` returns `results[]` (one per case × arm × seed: `pass`, `abstained`,
20
- `coverageReason`, `score`, `rationale`, `criteria[]`) next to the per-case
21
- majority in `cases[]`. `arm=prod` is the baseline and `arm=proposed` the
22
- candidate. An `abstained: true` row is not a verdict: the pair hit a replay
23
- coverage hole and is excluded from pass counts.
24
-
25
- A playout's `transcript.events[]` holds the simulated user and agent messages
26
- and every tool call with its `input`, the `output` the replay served, and
27
- `provenance.source`: `replay_runtime` (compiled mock over the case's recorded
28
- source state), `agent_tool_simulator` (LLM simulator grounded in recorded
29
- receipts; `simulator.model`), `counterfactual_reconstruction`, or
30
- `generic_handler`. `provenance.errorSubtype` such as `missing_source_state`
31
- marks an unservable call. `judge` is the judgement stored with the playout and
32
- `verdict` the stored eval row (null when `seed` is null, which happens on
33
- older runs whose graphs cannot be matched to a seed).
34
-
35
- Limits: `--transcript` pages at most 10 playouts (`--limit` default 50, max
36
- 200 without it); text and tool JSON are clipped at `--max-chars` (default
37
- 4000, max 32000) and `transcript.truncated.fields` counts the clipped fields.
38
- Page with `--cursor=<nextCursor>`. Playouts exist only for runs whose
39
- playouts were captured; `playoutCount: 0` on `run` means there is no
40
- transcript to read.
41
-
42
- ### 7b. Register the harness for replays (`moda registry`)
5
+ ### 7a. Register the harness (`moda registry`)
43
6
 
44
7
  Use when the user wants their prompts, skills, tools, or agent wiring in Moda
45
- so replays rebuild their harness faithfully, without the GitHub App or `moda
46
- harness analyze`. **You** are the analyst: read the codebase you already have,
47
- write one manifest, and push exactly what it lists. Nothing else in the repo is
48
- uploaded. For a full guided pass (inventory, prompt switching, context,
49
- attribution, and verification), run `moda registry prompt` and follow the
50
- brief it prints.
8
+ without the GitHub App or `moda harness analyze`. **You** are the analyst: read
9
+ the codebase you already have, write one manifest, and push exactly what it
10
+ lists. Nothing else in the repo is uploaded. For a full guided pass (inventory,
11
+ prompt switching, context, attribution, and verification), run `moda registry
12
+ prompt` and follow the brief it prints.
51
13
 
52
14
  ```bash
53
15
  moda registry prompt # the step-by-step brief for this job
@@ -113,8 +75,7 @@ tools still works; every section optional, ≤500 entries in prompts, skills, an
113
75
  - **Skills:** `key` (letters, digits, `_`, `-`) plus `skillMd` or `file` (full
114
76
  SKILL.md). Pushed skills are *local* by default. Set `"live": true`, or pass
115
77
  `--live`, to include them in the served skill surface. Leaving `live` out
116
- never demotes a skill that is already live. Replays load the skills an agent
117
- lists in `agents[].skills`, whether or not they are live.
78
+ never demotes a skill that is already live.
118
79
  - **Tools:** an OpenAI function `schema` (a wrapped
119
80
  `{"type":"function","function":{...}}` is accepted), plus optional
120
81
  `isActive`. Copy names and parameter schemas exactly as the agent registers
@@ -130,16 +91,11 @@ tools still works; every section optional, ≤500 entries in prompts, skills, an
130
91
  `promptKeys`).
131
92
  - **Routing (prompt switching):** `strategy` is `single`, `handoff`, `router`,
132
93
  `rules`, or `trace_attribute`; `default` is an agent key; put code-level
133
- rules in `notes`. Replay runs the agent named on the replayed turn's trace
134
- (agent name, then prompt key), else `default`, else the `entry` agent. When
135
- the replayed model calls a handoff tool, replay switches to the target
136
- agent's prompt, tools, model, and params.
94
+ rules in `notes`.
137
95
  - **Context:** what the runtime injects. `source` is `static` (with `value`),
138
- `clock` (`format`: date, datetime, or iso; replay uses the source
139
- conversation's time), or `trace`, `memory`, `retrieval`, `tool`, or
140
- `unknown`. Those last ones are reported as unresolved in replay fidelity,
141
- never invented. `target` is `prompt_variable` (needs `variable`) or
142
- `system_append`.
96
+ `clock` (`format`: date, datetime, or iso), or `trace`, `memory`,
97
+ `retrieval`, `tool`, or `unknown`. `target` is `prompt_variable` (needs
98
+ `variable`) or `system_append`.
143
99
  - **Runtime:** `framework`, `language`, `maxToolRoundsPerTurn`,
144
100
  `parallelToolCalls`, `history` (`strategy`, `maxMessages`, `maxTokens`),
145
101
  and `skillLoading` (`tool`, `system_prompt`, or `none`).
@@ -148,9 +104,9 @@ tools still works; every section optional, ≤500 entries in prompts, skills, an
148
104
  - `file` paths are relative to the directory you run the command from and must
149
105
  stay inside it (symlinks included).
150
106
 
151
- **Traces must name the agent.** For per-turn prompt switching, each LLM call
152
- should carry `gen_ai.agent.name` (or `moda.agent_name`; with the Vercel AI SDK
153
- use `experimental_telemetry.metadata["moda.agent_name"]`; `agent_name` on
107
+ **Traces must name the agent.** Each LLM call should carry `gen_ai.agent.name`
108
+ (or `moda.agent_name`; with the Vercel AI SDK use
109
+ `experimental_telemetry.metadata["moda.agent_name"]`; `agent_name` on
154
110
  `/v1/ingest`), set to an agent `key` or one of its `match.agentNames`. It
155
111
  should also carry `moda.prompt_key` / `moda.prompt_version_id`. Only add these
156
112
  to application code when the user asks for it or approves the diff.
@@ -1,12 +0,0 @@
1
- import {
2
- callControlAPI
3
- } from "./cli-dmm9jm9m.js";
4
-
5
- // src/replay-runs.ts
6
- var DEFAULT_POLL_INTERVAL_MS = 15000;
7
- var DEFAULT_WAIT_TIMEOUT_MS = 2 * 60 * 60 * 1000;
8
- async function fetchLatestRun(tenantId, replaySetId, runId, profileOptions) {
9
- return callControlAPI(`/tenants/${encodeURIComponent(tenantId)}/replay-sets/${encodeURIComponent(replaySetId)}/runs/latest?runId=${encodeURIComponent(runId)}`, { method: "GET" }, profileOptions, { timeoutMs: 60000, retries: 2 });
10
- }
11
-
12
- export { DEFAULT_POLL_INTERVAL_MS, DEFAULT_WAIT_TIMEOUT_MS, fetchLatestRun };