@deslop/scope 0.1.1093 → 0.1.1096

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 CHANGED
@@ -1,19 +1,22 @@
1
- # Scope
1
+ # @deslop/scope
2
2
 
3
- Query the always-on Effect development debugger at https://scope.mp281x.xyz.
3
+ An Effect development debugger: an OTLP/HTTP JSON receiver on port 4318 whose traces and logs agents query through MCP.
4
4
 
5
5
  ```bash
6
- npx @deslop/scope@latest login '<API key from https://auth.mp281x.xyz>'
7
- npx @deslop/scope@latest services
8
- npx @deslop/scope@latest traces --service @deslop/portfolio-server
9
- npx @deslop/scope@latest trace <trace-id>
10
- npx @deslop/scope@latest watch --service @deslop/portfolio-server
6
+ npx @deslop/scope@latest # http://127.0.0.1:4318, data in ~/.deslop/scope
7
+ claude mcp add --transport http scope http://127.0.0.1:4318/mcp
8
+ codex mcp add scope --url http://127.0.0.1:4318/mcp
11
9
  ```
12
10
 
13
- `login` saves the API key with owner-only permissions in `~/.deslop/scope/api-key`. The web app uses the same auth app's session cookie. `SCOPE_SERVER` or `--server` overrides the server URL.
11
+ Apps export to `http://127.0.0.1:4318/v1/traces` and `/v1/logs` with `content-type: application/json`. `HOST` and `PORT` change the address; the MCP endpoint has no authentication, so expose it only on a private network.
14
12
 
15
- Every query writes JSON to stdout and diagnostics to stderr. `watch` emits newline-delimited JSON when matching traces change. `trace` returns the full parent-ordered span tree, frontend/backend runtimes, offsets and logs attached to their spans. `traces`, `spans`, `logs` and `stats` accept `--service`, `--operation`, `--trace`, `--text`, `--errors`, `--since '10 minutes'`, `--limit` and `--offset`. `stats` covers the entire window rather than the first page.
13
+ | Tool | Returns |
14
+ | ---------- | ------------------------------------------------------------------------ |
15
+ | `services` | Services with a current run and their runtime: web, mobile or server |
16
+ | `traces` | Matching traces, newest or slowest first, with the total match count |
17
+ | `spans` | Matching spans with their original OTLP fields |
18
+ | `logs` | Matching logs, standalone or attached to a span |
19
+ | `stats` | Span count, errors and p50, p95 and max latency over the whole window |
20
+ | `trace` | One trace whole: spans in parent order with depth, offset and their logs |
16
21
 
17
- Only the current application runs are visible. Deslop's runtime sets `scope.runtime`, `service.instance.id` and `scope.run.started_unix_nano` resource attributes. When a participating service exports a newer run, the whole previous trace is hidden, including its spans from other services. Uncorrelated OTLP logs remain queryable through the CLI, not a separate web log feed.
18
-
19
- For a local server started with `NODE_ENV=development`, the shared auth package uses a mock developer. Run `scope services --dev --server http://localhost:5000`; no OAuth or API key is needed. Without `--dev`, the CLI always sends its stored API key, including from a development shell. Production requires real authentication. OTLP/HTTP JSON ingestion at `/v1/traces` and `/v1/logs` is unauthenticated.
22
+ `traces`, `spans`, `logs` and `stats` take `service`, `operation`, `traceId`, `text`, `errors` and `since` (`"10 minutes"` by default); `traces`, `spans` and `logs` add `limit` and `offset`; `traces` and `spans` add `sort`. Only the current run of each service is visible: when a service exports a newer run, every trace it took part in before is hidden.