@moda-ai/cli 1.25.0 → 1.27.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 +62 -24
- package/dist/{cli-vc7zddj1.js → cli-59yacef3.js} +14 -1
- package/dist/{cli-8s69sg7f.js → cli-9xw5bq1j.js} +1 -1
- package/dist/{cli-kqvjt12y.js → cli-cjqzrp9k.js} +127 -46
- package/dist/{cli-jntzpem2.js → cli-g931ntph.js} +2 -2
- package/dist/{cli-tdttb4cv.js → cli-pq6rte0w.js} +2 -2
- package/dist/cli.js +1473 -73
- package/dist/{harness-github-actions-rjyc9a7z.js → harness-github-actions-ct8fwzdr.js} +2 -2
- package/dist/{index-fm9ey3ks.js → index-fwxpt51s.js} +5 -5
- package/dist/{provision-dphktm75.js → provision-r0cq3g2v.js} +3 -3
- package/package.json +1 -1
- package/skills/integration/index.json +2 -2
- package/skills/moda-cli/SKILL.md +80 -12
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
runPromptSync,
|
|
10
10
|
runSkillSync,
|
|
11
11
|
upsertSkillManifestRecord
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-cjqzrp9k.js";
|
|
13
13
|
import {
|
|
14
14
|
codingAgentDisplayName,
|
|
15
15
|
describeCodingAgentEvent,
|
|
@@ -27,14 +27,14 @@ import {
|
|
|
27
27
|
runHarnessCommand,
|
|
28
28
|
startRemoteAnalyze,
|
|
29
29
|
stripAnsi
|
|
30
|
-
} from "./cli-
|
|
30
|
+
} from "./cli-g931ntph.js";
|
|
31
31
|
import {
|
|
32
32
|
selectTenantAndCreateKey
|
|
33
|
-
} from "./cli-
|
|
33
|
+
} from "./cli-pq6rte0w.js";
|
|
34
34
|
import {
|
|
35
35
|
loadToken,
|
|
36
36
|
login
|
|
37
|
-
} from "./cli-
|
|
37
|
+
} from "./cli-9xw5bq1j.js";
|
|
38
38
|
import {
|
|
39
39
|
CliAuthError,
|
|
40
40
|
CliInputError,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
createCommandContext,
|
|
43
43
|
resolveIngestUrl,
|
|
44
44
|
resolveModaBaseUrl
|
|
45
|
-
} from "./cli-
|
|
45
|
+
} from "./cli-59yacef3.js";
|
|
46
46
|
|
|
47
47
|
// src/init/index.ts
|
|
48
48
|
import { existsSync as existsSync6, mkdirSync as mkdirSync5, readdirSync as readdirSync4, readFileSync as readFileSync5, writeFileSync as writeFileSync4 } from "node:fs";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
selectTenantAndCreateKey
|
|
3
|
-
} from "./cli-
|
|
3
|
+
} from "./cli-pq6rte0w.js";
|
|
4
4
|
import {
|
|
5
5
|
loadAuthSession
|
|
6
|
-
} from "./cli-
|
|
6
|
+
} from "./cli-9xw5bq1j.js";
|
|
7
7
|
import {
|
|
8
8
|
CliAuthError,
|
|
9
9
|
resolveIngestUrl,
|
|
10
10
|
resolveModaBaseUrl,
|
|
11
11
|
stringOption
|
|
12
|
-
} from "./cli-
|
|
12
|
+
} from "./cli-59yacef3.js";
|
|
13
13
|
|
|
14
14
|
// src/provision.ts
|
|
15
15
|
async function runProvision(context, options = {}) {
|
package/package.json
CHANGED
package/skills/moda-cli/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: moda-cli
|
|
3
|
-
version: 2.
|
|
3
|
+
version: 2.3.0
|
|
4
4
|
description: Query Moda's AI agent conversation analytics and manage code-first prompt versions from the terminal — semantic/keyword/hybrid message search, overview KPIs, topic clusters, message context, user frustration detections, tool failures, and moda prompts status/sync/promote. Use when the user asks about moda, modaflows, conversation analytics, prompt management, user frustrations, agent observability, tool failure debugging, wants to find conversations or tool calls about a topic, or wants to investigate how their AI agent is performing.
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -16,7 +16,7 @@ or promote remote state (`prompts sync`, `prompts promote`).
|
|
|
16
16
|
|
|
17
17
|
**`moda search` is the primary way to find anything by content.** It runs
|
|
18
18
|
message-grain semantic, keyword, or hybrid retrieval across every message —
|
|
19
|
-
including tool calls and tool results — and returns ranked snippets with
|
|
19
|
+
including tool calls and tool results with `--include-tool-io` — and returns ranked snippets with
|
|
20
20
|
direct anchors (`conversation_id` + `message_index`) you can hand straight to
|
|
21
21
|
`moda context`. Reach for it first whenever the question is "where did X
|
|
22
22
|
happen?" or "find conversations/tool calls about Y". Use `moda conversations`
|
|
@@ -55,9 +55,9 @@ Optional:
|
|
|
55
55
|
|
|
56
56
|
- `MODA_BASE_URL` defaults to `https://moda.dev`; override only for
|
|
57
57
|
self-hosted or staging.
|
|
58
|
-
- `MODA_SKILL_VERSION` — export to `2.
|
|
58
|
+
- `MODA_SKILL_VERSION` — export to `2.3.0` so search-adoption telemetry can
|
|
59
59
|
attribute usage to this skill version. Set it once per session:
|
|
60
|
-
`export MODA_SKILL_VERSION=2.
|
|
60
|
+
`export MODA_SKILL_VERSION=2.3.0`.
|
|
61
61
|
|
|
62
62
|
## Setup
|
|
63
63
|
|
|
@@ -391,9 +391,10 @@ moda search "checkout error" --time-range=7d --limit=10
|
|
|
391
391
|
moda search "stripe.charges.create failed" --user-id=<id>
|
|
392
392
|
```
|
|
393
393
|
|
|
394
|
-
Searches conversation messages at message grain
|
|
395
|
-
tool results** (tool name, input arguments, and
|
|
396
|
-
so it finds where an agent *did* something, not just where
|
|
394
|
+
Searches conversation messages at message grain. Pass `--include-tool-io` to
|
|
395
|
+
also search **tool calls and tool results** (tool name, input arguments, and
|
|
396
|
+
output previews), so it finds where an agent *did* something, not just where
|
|
397
|
+
it talked about it — tool-IO search is opt-in, not the default.
|
|
397
398
|
|
|
398
399
|
Flags: `--mode=keyword|semantic|hybrid` (default `hybrid`), `--user-id`,
|
|
399
400
|
`--time-range` (`all|1h|3d|7d|24h|30d|90d`, default `all`), `--limit` (1–100,
|
|
@@ -613,6 +614,56 @@ Do not copy prompt text from the dashboard into source code. The repo prompt
|
|
|
613
614
|
files are the source of truth; the dashboard is for visibility, usage, labels,
|
|
614
615
|
and future evals.
|
|
615
616
|
|
|
617
|
+
### 8. Fixing detected Problems (`moda fix` — a fix with proof)
|
|
618
|
+
|
|
619
|
+
Moda turns detected Problems into **Fixes**: a routed candidate change plus a
|
|
620
|
+
replay **gate** that proves it on held-out production evidence. Use this loop
|
|
621
|
+
whenever you are asked to fix a detected Problem, or before hand-editing
|
|
622
|
+
prompt/skill files in a repo that talks to Moda.
|
|
623
|
+
|
|
624
|
+
The fail-to-pass loop:
|
|
625
|
+
|
|
626
|
+
```bash
|
|
627
|
+
moda fixes # ranked queue of fixes with proof
|
|
628
|
+
moda fix <fix_id> --packet # moda.fix_packet.v1: cause, target
|
|
629
|
+
# file, evidence links, verify cmd,
|
|
630
|
+
# handback + magic word
|
|
631
|
+
moda fix start <problem_id> --wait # draft from a Problem and drive
|
|
632
|
+
# scope -> propose -> gate
|
|
633
|
+
moda fix checkout <fix_id> # write the candidate at its target
|
|
634
|
+
# source path (NEVER runs git)
|
|
635
|
+
# ...edit the target file...
|
|
636
|
+
moda fix verify <fix_id> --prompt-file=<path> # re-gate local content on the
|
|
637
|
+
# frozen holdout
|
|
638
|
+
# iterate edit -> verify until exit 0, then hand back:
|
|
639
|
+
moda fix submit <fix_id> --pr # draft PR via the Moda GitHub App
|
|
640
|
+
moda fix submit <fix_id> --local-ref=<branch> # or record your own branch
|
|
641
|
+
moda fix dismiss <fix_id> --reason="why" # reject (feeds problem feedback)
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
**`moda fix verify` exit codes are the contract — branch on them:**
|
|
645
|
+
|
|
646
|
+
| Exit | Meaning | How to treat it |
|
|
647
|
+
|---|---|---|
|
|
648
|
+
| `0` | gate pass — the candidate beat baseline on the frozen holdout (wins clear the noise floor) | Safe to submit. |
|
|
649
|
+
| `1` | gate fail — per-case findings ride the envelope's `findings[]` (`case:<id>` entries with baseline/candidate pass) | Edit the candidate and re-`verify`. |
|
|
650
|
+
| `3` | degraded/inconclusive — too many abstentions, blocked coverage, or no verdict | **Never treat as a pass.** Re-verify or read `moda fix <fix_id> --packet`. |
|
|
651
|
+
|
|
652
|
+
Rules that keep the proof honest:
|
|
653
|
+
|
|
654
|
+
- The verdict reads only **holdout** cases the proposer never saw; repair
|
|
655
|
+
rows are training cases, never the headline.
|
|
656
|
+
- The gate compares against a noise floor from a baseline-vs-baseline control
|
|
657
|
+
run — a "win" inside the noise floor does not pass.
|
|
658
|
+
- `checkout` only writes the file. Branching (`moda/fix/<shortref-lower>`),
|
|
659
|
+
committing, and pushing are yours; the CLI never runs git.
|
|
660
|
+
- Fix PRs end with the magic word `Fixes MODA-FIX-<SHORTREF>` in the body —
|
|
661
|
+
Moda-authored PRs carry it automatically; hand-authored PRs must include it
|
|
662
|
+
so the merge confirms the fix and starts production monitoring.
|
|
663
|
+
- The pipeline is advance-on-poll: `--wait` (on `start`, `verify`, or
|
|
664
|
+
`moda fix <fix_id> --wait`) drives it; a fix left `GATING` will not finish
|
|
665
|
+
on its own.
|
|
666
|
+
|
|
616
667
|
## Common workflow recipes
|
|
617
668
|
|
|
618
669
|
### Find where something happened (search → context)
|
|
@@ -710,9 +761,10 @@ moda feedback "a cancelled call is counted as a tool failure" \
|
|
|
710
761
|
## Validation — how to know it worked
|
|
711
762
|
|
|
712
763
|
- Every successful command exits 0 and prints valid JSON to stdout.
|
|
713
|
-
- `moda ask`
|
|
714
|
-
|
|
715
|
-
exit `1` as the only hard error (see
|
|
764
|
+
- `moda ask` may exit `3` (degraded): a real, lower-trust answer synthesized
|
|
765
|
+
from local evidence — not a failure (`investigate`/`failures` always exit
|
|
766
|
+
`0` on success). Treat exit `1` as the only hard error (see
|
|
767
|
+
[Agent protocol](#agent-protocol)).
|
|
716
768
|
- Errors print to stderr with non-zero exit. Check stderr before claiming
|
|
717
769
|
success.
|
|
718
770
|
- If the JSON has `"conversations": []` or `"frustrations": []`, the call
|
|
@@ -768,18 +820,34 @@ npx: `npx -p @moda-ai/cli moda <command>`.
|
|
|
768
820
|
| `moda overview` | Dashboard KPIs, top clusters, recent activity |
|
|
769
821
|
| `moda ask "<question>"` | Natural-language production/harness answer with evidence (exit `3` = degraded local fallback) |
|
|
770
822
|
| `moda investigate` | Rank production issues with evidence + next commands |
|
|
771
|
-
| `moda clusters` | Browse topic cluster hierarchy |
|
|
823
|
+
| `moda clusters` | Browse topic cluster hierarchy; `--search="q"` finds clusters by meaning, `--node-id=ID` resolves a deep link |
|
|
772
824
|
| `moda cluster-conversations <node_id>` | Conversations in a cluster |
|
|
773
825
|
| `moda conversations` | List/filter conversations by structured fields |
|
|
774
826
|
| `moda context <conversation_id>` | Windowed message context (max 5 per side) |
|
|
775
|
-
| `moda frustrations` | User frustration detections with evidence |
|
|
827
|
+
| `moda frustrations` | User frustration detections with evidence (legacy single-family; prefer `emotions`) |
|
|
828
|
+
| `moda emotions` | Multi-family emotion detections: frustration, sadness, confusion, anxiety, trust, positive (`--family=F`, limit 1–20) |
|
|
829
|
+
| `moda hallucinations` | Grounding detections: contradicted/verified outputs, rule breakdown (`--kind=contradicted\|verified`, `--conversation-id=ID`) |
|
|
776
830
|
| `moda tool-failures` | Tool failure overview |
|
|
777
831
|
| `moda tool-failure-detail <tool_name>` | Per-tool failure breakdown + examples |
|
|
832
|
+
| `moda problems` | Rank cross-signal Problems by root cause (what to fix first) |
|
|
833
|
+
| `moda problem <problem_id>` | One Problem: dossier, or `--evidence`/`--reports`/`--conversations`/`--feedback` pages (`--limit` 1–50, `--cursor` verbatim keyset token) |
|
|
834
|
+
| `moda problem-feedback <problem_id>` | Write: `--action=mark_fixed\|dismiss\|flag_attribution\|rename`. `--reason` required for dismiss/flag_attribution; `--new-name` for rename; `--attribution-id` (UUID) required for flag_attribution |
|
|
835
|
+
| `moda step-scores <conversation_id>` | Graph-PRM step scores: per-segment curves, first bad step, rollup |
|
|
836
|
+
| `moda world-state <conversation_id>` | Agent memory: slots/threads/events; `--summary-only`; `--snapshot --msg-index=N` (state at a turn); `--replay --message-count=N` (state over time) |
|
|
837
|
+
| `moda failures` | Production failures worth fixing first |
|
|
838
|
+
| `moda tail` | Live tail: one JSON line per new conversation/detection (`--signal=conversations\|emotions\|all`, `--interval=N`, `--once`, `--max-events=N`). **Emotions caveat:** `/emotions` is ranked by score with no time ordering or cursor, so the tail follows the *highest-scoring* detections rather than everything; each poll emits a `tail_coverage` line with `scanned`/`total`/`coverage_pct`/`complete`. Pass `--full-scan` for a complete window scan (many more requests, capped by the API's offset ceiling of 10000). |
|
|
778
839
|
| `moda feedback "<note>"` | Flag wrong/missing data or CLI quirks to the Moda team |
|
|
779
840
|
| `moda prompts status` | Read-only local prompt status |
|
|
780
841
|
| `moda prompts diff` | Read-only local prompt diff/status |
|
|
781
842
|
| `moda prompts sync` | Upload changed prompt versions and update lockfile |
|
|
782
843
|
| `moda prompts promote <key>` | Move a remote prompt label |
|
|
844
|
+
| `moda fixes` | Ranked queue of Fixes ("a fix with proof"); `--status=S`, `--limit=N`, `--cursor=TOKEN` |
|
|
845
|
+
| `moda fix <fix_id>` | One Fix: status + gate result; `--packet` prints `moda.fix_packet.v1`; `--wait` drives a running pipeline to rest |
|
|
846
|
+
| `moda fix start <problem_id>` | Draft a Fix from a Problem (`--type=auto\|prompt`); `--wait` drives scope → propose → gate |
|
|
847
|
+
| `moda fix verify <fix_id>` | Re-gate on the frozen holdout; `--prompt-file=P` gates local content (exit `0` pass / `1` fail with per-case findings / `3` degraded — never a pass) |
|
|
848
|
+
| `moda fix checkout <fix_id>` | Write the candidate at its target source path (never runs git) |
|
|
849
|
+
| `moda fix submit <fix_id>` | Deliver: `--pr` opens a draft PR \| `--local-ref=<branch>` records your branch |
|
|
850
|
+
| `moda fix dismiss <fix_id>` | Reject with `--reason=TEXT` (feeds problem feedback) |
|
|
783
851
|
|
|
784
852
|
`moda search` flags: `--mode=keyword|semantic|hybrid` (default `hybrid`),
|
|
785
853
|
`--user-id`, `--time-range=<range>`, `--limit=N` (1–100, default 20).
|