@moda-ai/cli 1.35.0 → 1.37.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.
@@ -5,11 +5,12 @@ import {
5
5
  inspectCodeSelectors,
6
6
  inspectPythonSelectors,
7
7
  safePromptEvidencePath
8
- } from "./cli-0p6n391h.js";
8
+ } from "./cli-07tv75te.js";
9
+ import"./cli-q79sq80a.js";
9
10
  import {
10
11
  __commonJS,
11
12
  __toESM
12
- } from "./cli-drabjmaj.js";
13
+ } from "./cli-0v6na3yp.js";
13
14
 
14
15
  // ../../node_modules/.bun/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js
15
16
  var require_code = __commonJS((exports) => {
@@ -1,15 +1,16 @@
1
1
  import {
2
2
  selectTenantAndCreateKey
3
- } from "./cli-scjxgaba.js";
3
+ } from "./cli-qgf2cz2v.js";
4
4
  import {
5
5
  loadAuthSession
6
- } from "./cli-yz99t7n8.js";
6
+ } from "./cli-strngwn3.js";
7
7
  import {
8
8
  CliAuthError,
9
9
  resolveIngestUrl,
10
10
  resolveModaBaseUrl,
11
11
  stringOption
12
- } from "./cli-drabjmaj.js";
12
+ } from "./cli-q79sq80a.js";
13
+ import"./cli-0v6na3yp.js";
13
14
 
14
15
  // src/provision.ts
15
16
  async function runProvision(context, options = {}) {
@@ -0,0 +1,14 @@
1
+ import {
2
+ bundledSkillsDir,
3
+ installIntegrationSkill,
4
+ readBundledIndex,
5
+ readBundledSkillMd
6
+ } from "./cli-c5c6f0yw.js";
7
+ import"./cli-ssfq84k5.js";
8
+ import"./cli-0v6na3yp.js";
9
+ export {
10
+ readBundledSkillMd,
11
+ readBundledIndex,
12
+ installIntegrationSkill,
13
+ bundledSkillsDir
14
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moda-ai/cli",
3
- "version": "1.35.0",
3
+ "version": "1.37.0",
4
4
  "description": "CLI for Moda - AI agent analytics and observability",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema_version": "moda.skill_index.v1",
3
- "bundled_at": "2026-09-26T21:50:32.589Z",
4
- "cli_version": "1.35.0",
3
+ "bundled_at": "2026-09-27T21:11:50.220Z",
4
+ "cli_version": "1.37.0",
5
5
  "skills": [
6
6
  {
7
7
  "id": "integration-cloudflare-think",
@@ -109,7 +109,7 @@
109
109
  },
110
110
  {
111
111
  "id": "integration-python-langchain",
112
- "version": "1.0.0",
112
+ "version": "1.1.0",
113
113
  "summary": "Instrument a Python LangChain or LangGraph app with Moda: init before the framework, explicit conversation ids around every run.",
114
114
  "targets": {
115
115
  "language": "python",
@@ -53,7 +53,7 @@ moda.flush()
53
53
 
54
54
  ## What changed, and what did not
55
55
 
56
- - `moda-ai` added to the project dependencies.
56
+ - `moda-ai`, `opentelemetry-instrumentation-langchain` and `wrapt<2` added to the project dependencies.
57
57
  - One `moda.init` call added at startup, before any LangChain model is
58
58
  constructed.
59
59
  - Each agent/chain entry point is wrapped in the scoped context managers
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  id: integration-python-langchain
3
3
  name: "Integrate Moda with LangChain / LangGraph (Python)"
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  category: integration
6
6
  targets:
7
7
  language: python
@@ -35,10 +35,11 @@ this skill, read https://docs.moda.dev/ingestion/moda-sdk.
35
35
  Two constraints drive every step below:
36
36
 
37
37
  1. Instrument at the Moda SDK level, not inside LangChain. Moda's Python SDK
38
- ships a LangChain instrument (`Instruments.LANGCHAIN`), and `moda.init()`
39
- enables all instruments by default (`instruments=None`). Do not add
40
- LangChain callbacks or handler classes for Moda — no such Moda API
41
- exists.
38
+ knows a LangChain instrument (`Instruments.LANGCHAIN`) and `moda.init()`
39
+ enables all instruments by default (`instruments=None`), but it only
40
+ activates when `opentelemetry-instrumentation-langchain` is installed
41
+ next to `moda-ai` (Step 2). Do not add LangChain callbacks or handler
42
+ classes for Moda — no such Moda API exists.
42
43
  2. Explicit conversation ids are mandatory. Moda's automatic conversation
43
44
  detection hashes the first user message, and agent frameworks construct
44
45
  different messages on every internal iteration, so without an explicit id
@@ -54,26 +55,58 @@ If you cannot find any LangChain/LangGraph entry point, stop and report.
54
55
 
55
56
  ## Step 2: Install the SDK
56
57
 
57
- Install `moda-ai` with the package manager this repository already uses
58
- (`uv.lock` means uv, `poetry.lock` means poetry, otherwise pip):
58
+ Install `moda-ai`, the LangChain instrumentation it activates, and a
59
+ `wrapt<2` pin with the package manager this repository already uses
60
+ (`uv.lock` means uv, `poetry.lock` means poetry, otherwise pip). Without
61
+ `opentelemetry-instrumentation-langchain`, only raw provider calls are traced
62
+ and every chain, agent and tool span is missing. The instrumentation version
63
+ that resolves next to `moda-ai` fails to start under `wrapt` 2, so keep the
64
+ pin until `moda-ai` allows newer instrumentations:
59
65
 
60
66
  ```bash
61
- pip install moda-ai
67
+ pip install moda-ai opentelemetry-instrumentation-langchain "wrapt<2"
68
+ ```
69
+
70
+ With pip, also record them in the file the project installs from, so a
71
+ fresh deployment gets them. In `requirements.txt`:
72
+
73
+ ```text
74
+ moda-ai
75
+ opentelemetry-instrumentation-langchain
76
+ wrapt<2
77
+ ```
78
+
79
+ In `pyproject.toml`, add quoted entries to the existing `dependencies` array:
80
+
81
+ ```toml
82
+ dependencies = [
83
+ # ...existing dependencies...
84
+ "moda-ai",
85
+ "opentelemetry-instrumentation-langchain",
86
+ "wrapt<2",
87
+ ]
62
88
  ```
63
89
 
64
90
  With uv:
65
91
 
66
92
  ```bash
67
- uv add moda-ai
93
+ uv add moda-ai opentelemetry-instrumentation-langchain "wrapt<2"
68
94
  ```
69
95
 
70
96
  With poetry:
71
97
 
72
98
  ```bash
73
- poetry add moda-ai
99
+ poetry add moda-ai opentelemetry-instrumentation-langchain "wrapt<2"
74
100
  ```
75
101
 
76
- If `moda-ai` is already a dependency, skip the install.
102
+ Skip `moda-ai` or the instrumentation if it is already a dependency. If the
103
+ project already constrains `wrapt` (for example `wrapt>=2` or `wrapt==2.*`),
104
+ change that constraint to `wrapt<2` rather than skipping it; if something else
105
+ in the project requires `wrapt` 2, stop and report the conflict.
106
+
107
+ After Step 3, start the app once and check its log: the line
108
+ `Error initializing LangChain instrumentor` means the instrumentation did not
109
+ activate. Stop and report it rather than continuing with provider-only traces.
77
110
 
78
111
  ## Step 3: Initialize Moda once at startup
79
112
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: moda-cli
3
- version: 2.6.0
3
+ version: 2.7.0
4
4
  description: Query Moda's AI agent trace 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, custom signals, false-positive review of detections, and moda prompts status/sync/promote. Use when the user asks about moda, modaflows, trace or conversation analytics, prompt management, user frustrations, agent observability, tool failure debugging, custom signals, marking a detection as a false positive, wants to find traces or tool calls about a topic, or wants to investigate how their AI agent is performing.
5
5
  ---
6
6
 
@@ -750,6 +750,45 @@ Rules that keep the proof honest:
750
750
 
751
751
  ### 9. Custom signals and false positives
752
752
 
753
+ **Mark anything as a false positive with one command.** `--reason` (why the
754
+ detection is wrong) is optional but recommended; marks are logged for Moda's review.
755
+ A marked item disappears from every list and count (`moda problems`,
756
+ `hallucinations`, `laziness`, `tool-failures`, problem evidence, the dashboard);
757
+ `--undo` brings it back.
758
+
759
+ ```bash
760
+ moda false-positive problem <problem_id> --reason="two unrelated tools" # dismiss: hidden at once
761
+ moda false-positive problem-detection <problem_id> --conversation-id=<id> \
762
+ --attribution-id=<uuid> --reason="refund was approved" # one piece of evidence
763
+ moda false-positive quote <conversation_id> --family=frustration --turn=3 \
764
+ --quote="this is useless lol" --reason="user was joking" # one user quote
765
+ moda false-positive tool <conversation_id> --tool=send_invoice \
766
+ --tool-use-id=<tool_use_id> --reason="retried upstream" # one failing tool call
767
+ moda false-positive laziness <conversation_id> --reason="reload is expected"
768
+ moda false-positive hallucination <conversation_id> --reason="price came from the tool result"
769
+ moda false-positive custom-signal <signal_id> --conversation-id=<id> --reason="refund was approved"
770
+ moda false-positive laziness <conversation_id> --undo # remove a mark (any kind but problem)
771
+ moda false-positives # every current mark (--kind=tool, --all, --limit)
772
+ moda false-positives <conversation_id> # marks + problem reviews on a trace
773
+ ```
774
+
775
+ What each flag does downstream:
776
+
777
+ | Kind | Effect |
778
+ |---|---|
779
+ | `problem` | Dismisses the problem: it leaves `moda problems` and the dashboard at once, and the reason is folded into the next reconcile. Cannot be undone from the CLI |
780
+ | `problem-detection` | Drops that evidence from the problem and teaches the problem reader (same as `detection-review --verdict=false_positive`) |
781
+ | `custom-signal` | Saved as a `does_not_fit` label with the reason, so the signal learns from it and the live match is retracted (same as `signal-label`). `--undo` removes the label |
782
+ | `quote`, `tool`, `laziness`, `hallucination` | Audit only: recorded for review, never fed back to the detectors |
783
+
784
+ Find targets with the read commands: `--family`, `--turn` and `--quote` verbatim
785
+ from a `user_quotes` entry in `moda emotions`; a failing call's `tool_use_id` (or `msg_index` when it has none) from
786
+ `moda tool-failure-detail <tool_name>`;
787
+ laziness traces from `moda laziness`; hallucination traces from
788
+ `moda hallucinations`; custom-signal hits from `moda trace-signals` or
789
+ `moda signal <id> --detections`; problem evidence ids from
790
+ `moda problem <id> --evidence`.
791
+
753
792
  **Custom signals** are tenant-defined behaviors (pass/fail criteria) judged on
754
793
  every trace. Read them, then label hits so the signal learns:
755
794
 
@@ -768,7 +807,7 @@ match; `--label=fits` confirms it. Pass the hit's `anchor_msg_index` (or
768
807
  message, and always give a `--note` when rejecting. Labels are throttled to 10
769
808
  per minute per API key and are never retried automatically.
770
809
 
771
- **Problem detections** (the dashboard's thumbs on a trace) are reviewed with
810
+ **Problem detections** (the dashboard's flag on problem evidence) are reviewed with
772
811
  `detection-review`. A `false_positive` drops the detection out of
773
812
  `moda problem <id> --evidence` and is fed back to the problem reader; `clear`
774
813
  undoes an earlier review.
@@ -954,7 +993,12 @@ npx: `npx -p @moda-ai/cli moda <command>`.
954
993
  | `moda tool-failure-detail <tool_name>` | Per-tool failure breakdown + examples |
955
994
  | `moda problems` | Rank cross-signal Problems by root cause (what to fix first) |
956
995
  | `moda problem <problem_id>` | One Problem: dossier, or `--evidence`/`--reports`/`--traces`/`--feedback` pages (`--conversations` is a legacy alias of `--traces`) (`--limit` 1–50, `--cursor` verbatim keyset token) |
957
- | `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 |
996
+ | `moda problem-feedback <problem_id>` | Write: `--action=mark_fixed\|dismiss\|flag_attribution\|rename`. `--reason` required for flag_attribution, optional for dismiss; `--new-name` for rename; `--attribution-id` (UUID) required for flag_attribution |
997
+ | `moda false-positive <kind> <target>` | Write: kinds `problem\|problem-detection\|quote\|tool\|laziness\|hallucination\|custom-signal`; `--reason` optional; problem-detection needs `--conversation-id` + `--attribution-id`; quote needs `--family`, `--turn`, `--quote`; tool needs `--tool` plus `--tool-use-id` or `--msg-index`; custom-signal needs `--conversation-id`; `--undo` removes a mark (not for problem) |
998
+ | `moda false-positives [conversation_id]` | Current false-positive marks: all (`--kind`, `--all` to include removed, `--limit`) or one trace with its problem detection reviews |
999
+ | `moda laziness` | Laziness detections per trace (`--days-back`, `--limit` 1-50, `--conversation-id`, `--family`) |
1000
+ | `moda problem-linear <problem_id>` | The Problem's linked Linear issue (key, state, URL) or `link: null`; needs Linear connected (Integrations → Linear) |
1001
+ | `moda problem-linear-file <problem_id>` | Write: file the Problem as a Linear issue (`--team-id`, `--title`, `--priority=0-4`), or link an existing one with `--issue=ENG-123\|URL` (exclusive with the others). Idempotent per Problem |
958
1002
  | `moda detection-reviews <conversation_id>` | Problem detections on a trace with review state (`--attribution-id=UUID` narrows to one) |
959
1003
  | `moda detection-review <problem_id>` | Write: `--conversation-id`, `--attribution-id` (UUID), `--verdict=correct\|false_positive\|clear`, optional `--note` |
960
1004
  | `moda signals` | Custom signals: criteria, status, 7-day judged/matched stats |