@agenttrail/cli 0.1.0 → 0.2.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 +46 -6
- package/dist/chunk-WMGYTOQC.js +163 -0
- package/dist/cli/index.cjs +60 -50
- package/dist/cli/index.js +1 -1
- package/dist/cursor/capture-hook.mjs +2 -2
- package/dist/cursor/flush.mjs +6 -6
- package/dist/cursor/pep-hook.mjs +232 -45
- package/dist/index.cjs +65 -50
- package/dist/index.d.cts +39 -7
- package/dist/index.d.ts +39 -7
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/plugin/.claude-plugin/marketplace.json +2 -2
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/scripts/pep-hook.mjs +232 -45
- package/dist/chunk-F6FLYISV.js +0 -148
package/README.md
CHANGED
|
@@ -60,6 +60,39 @@ npx -y @agenttrail/cli@latest setup --agent claude --org <your-org-uuid>
|
|
|
60
60
|
npx -y @agenttrail/cli@latest status --agent claude
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
+
### What `setup --agent claude` writes in your repo
|
|
64
|
+
|
|
65
|
+
The default setup keeps everything about **this machine** out of git, so a trial run does
|
|
66
|
+
not leave a change for you to commit or a flag for your teammates to inherit:
|
|
67
|
+
|
|
68
|
+
- **Real-time enforcement** (the policy endpoints, the token and the
|
|
69
|
+
`AGENTTRAIL_PEP_ENFORCE` switch) and the ingest token go into
|
|
70
|
+
`.claude/settings.local.json`.
|
|
71
|
+
- `.claude/settings.local.json` and `.agenttrail.json` (and the temporary copies a write
|
|
72
|
+
leaves for a moment) are kept out of git with lines in the repo's own `.git/info/exclude`,
|
|
73
|
+
which git reads like `.gitignore` but never tracks. Setup checks with git that they are
|
|
74
|
+
ignored, and never edits `.gitignore`.
|
|
75
|
+
- The **telemetry settings** (`CLAUDE_CODE_*`, `OTEL_*` and the `SessionStart` refresh hook)
|
|
76
|
+
still go into `.claude/settings.json`, which is usually committed. Apart from moving an
|
|
77
|
+
older install's enforcement keys out of that file (below), that is the only tracked change
|
|
78
|
+
setup makes today. A `.agenttrail.json` the repo already tracks is left as it is.
|
|
79
|
+
|
|
80
|
+
If the repo **already tracks** `.claude/settings.local.json` (or a `.gitignore` rule
|
|
81
|
+
re-includes it), that file would carry your credential into git, so setup **writes nothing**
|
|
82
|
+
and stops with the reason and the fix: `git rm --cached .claude/settings.local.json` and
|
|
83
|
+
commit (or remove the re-including rule), then run setup again. AgentTrail is not connected in
|
|
84
|
+
that repo until then. The same applies to `.agenttrail.json` when it would hold an API key.
|
|
85
|
+
|
|
86
|
+
`--team` is the explicit "write committable config" path: key-free settings meant to be
|
|
87
|
+
committed, and never the `AGENTTRAIL_PEP_ENFORCE` switch or a token.
|
|
88
|
+
|
|
89
|
+
An older version wrote the enforcement settings into `.claude/settings.json` and appended
|
|
90
|
+
lines to `.gitignore`. Running `setup` again moves the settings to
|
|
91
|
+
`.claude/settings.local.json` once enforcement is verified again (if `settings.json` is
|
|
92
|
+
committed, commit that change), and removes the `.gitignore` lines it added if they were never
|
|
93
|
+
committed. `logout` removes the enforcement settings from both files; the
|
|
94
|
+
`.git/info/exclude` lines stay, because the files they hide can still hold your own settings.
|
|
95
|
+
|
|
63
96
|
## Cursor (`--agent cursor`)
|
|
64
97
|
|
|
65
98
|
```bash
|
|
@@ -76,10 +109,10 @@ What differs from `--agent claude`:
|
|
|
76
109
|
| | Claude Code | Cursor |
|
|
77
110
|
|---|---|---|
|
|
78
111
|
| How spans are produced | Claude Code's own exporter, configured by us | our capture hook + a detached sender, both under `~/.agenttrail/cursor/runtime/` |
|
|
79
|
-
| What is written in the repo | `.claude/settings.json
|
|
112
|
+
| What is written in the repo | telemetry settings in `.claude/settings.json`; everything per-machine in `.claude/settings.local.json`, kept out of git via `.git/info/exclude` | `.cursor/hooks.json`, kept out of git via `.git/info/exclude` |
|
|
80
113
|
| State | `~/.agenttrail/credentials.json` | `~/.agenttrail/cursor/` (its own credential, registry, queue and checkpoint) |
|
|
81
114
|
| Auth | device login, or `--key` / `--team` for CI | device login only — `--key`, `--team` and `--global` are refused |
|
|
82
|
-
| Content capture |
|
|
115
|
+
| Content capture | **on by default** (`--no-capture-content` opts out); scrubbed at ingest | off by default (`--capture-content` turns it on); scrubbed **on this machine** before it is queued, then server-side as well |
|
|
83
116
|
| Cost | tokens × the provider's list price | not computed: Cursor sessions read "Not reported by Cursor" |
|
|
84
117
|
| Real-time blocking | the enforcement plugin | from Cursor 3.21.16, installed by `setup`; an older Cursor is captured only |
|
|
85
118
|
|
|
@@ -121,7 +154,8 @@ Each runs as `npx -y @agenttrail/cli@latest <command> --agent <claude|cursor|cod
|
|
|
121
154
|
| `--api-endpoint <url>` | API base URL for the device-auth flow (`setup`/`login`/`--refresh`/`logout`). Accepts a **bare origin** (e.g. `https://api.agenttrail.sh` or `http://localhost:3000`); the CLI derives the `/api/v1` base internally (idempotent if you pass `…/api/v1`). Precedence: flag → `$AGENTTRAIL_API_ENDPOINT` → prod default (`https://api.agenttrail.sh`). Distinct from `--endpoint` (ingest). |
|
|
122
155
|
| `--team` | Write committable, **key-free** config (key supplied per-dev via env). Refused by `setup --agent cursor`. |
|
|
123
156
|
| `--global` | Configure `~/.claude` + `~/.agenttrail/config.json` (per-user; prints a privacy warning). Refused by `setup --agent cursor` — Cursor is per project only. |
|
|
124
|
-
| `--capture-content` |
|
|
157
|
+
| `--no-capture-content` | `--agent claude`: turn OFF prompt/tool-content capture, which is **on by default** (prompts, commands, file paths and tool output). Setup writes the three content flags as `"0"`, and a later rerun without a flag keeps that opt-out. |
|
|
158
|
+
| `--capture-content` | `--agent claude`: turn capture back on after `--no-capture-content` (on is already the default). `--agent cursor`: turn ON prompt/tool-content capture. Ingest scrubs it server-side under your org's config; with `--agent cursor` it is also scrubbed **on this machine** before it is queued — the scrubber reads the whole value, and the 8192-character cap applies to what is kept afterwards. Scrubbing is shape-based, so it reduces exposure rather than guaranteeing none; the cap is a size limit on what is stored, not a safety measure. |
|
|
125
159
|
| `--unregister` | `setup --agent cursor` only: disconnect this project — remove its entries and its registry record, leaving every other project connected and this device signed in. |
|
|
126
160
|
|
|
127
161
|
## Key facts
|
|
@@ -138,9 +172,15 @@ Each runs as `npx -y @agenttrail/cli@latest <command> --agent <claude|cursor|cod
|
|
|
138
172
|
nested repos do not inherit a parent's config (resolution stops at the git root).
|
|
139
173
|
- **`CLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1` is required** — span emission is a
|
|
140
174
|
Claude Code beta feature, OFF by default; the writer always sets it.
|
|
141
|
-
- **
|
|
142
|
-
|
|
143
|
-
|
|
175
|
+
- **Claude Code content capture is ON by default**: `setup` writes the three
|
|
176
|
+
`OTEL_LOG_*` content flags, so prompts, commands, file paths and tool output reach
|
|
177
|
+
AgentTrail. `--no-capture-content` opts out (metadata + tokens only), and `setup`
|
|
178
|
+
and `status` both print which mode is on. Cursor stays off unless you pass
|
|
179
|
+
`--capture-content`. A committed `.claude/settings.json` (under `--team`, or in a
|
|
180
|
+
repo that tracks it) carries the flags to every teammate; a teammate opts out for
|
|
181
|
+
themselves by setting the three flags to `"0"` in their own
|
|
182
|
+
`.claude/settings.local.json`. Claude Code's own exporter sends the content, so nothing
|
|
183
|
+
scrubs it on your machine; ingest scrubs captured content under your org's configured mode, falling
|
|
144
184
|
back to the deployment-wide `SCRUB_MODE` — never to no scrubbing. The one
|
|
145
185
|
passthrough is an org explicitly setting `mode: "off"`, which opts out by choice.
|
|
146
186
|
Scrubbing is shape-based, so a structureless secret can still get through; the
|