spooling 0.3.0__tar.gz → 0.4.1__tar.gz

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 (85) hide show
  1. {spooling-0.3.0/spooling.egg-info → spooling-0.4.1}/PKG-INFO +28 -13
  2. {spooling-0.3.0 → spooling-0.4.1}/README.md +21 -10
  3. {spooling-0.3.0 → spooling-0.4.1}/pyproject.toml +9 -3
  4. {spooling-0.3.0 → spooling-0.4.1}/spooling/__init__.py +1 -1
  5. {spooling-0.3.0 → spooling-0.4.1}/spooling/cli.py +13 -6
  6. {spooling-0.3.0 → spooling-0.4.1}/spooling/db.py +7 -0
  7. spooling-0.4.1/spooling/evals.py +537 -0
  8. spooling-0.4.1/spooling/experiments.py +307 -0
  9. {spooling-0.3.0 → spooling-0.4.1}/spooling/mcp_server.py +2 -2
  10. {spooling-0.3.0 → spooling-0.4.1}/spooling/remote_otel.py +25 -16
  11. {spooling-0.3.0 → spooling-0.4.1}/spooling/schema.py +7 -0
  12. {spooling-0.3.0 → spooling-0.4.1}/spooling/server.py +2 -2
  13. {spooling-0.3.0 → spooling-0.4.1}/spooling/summarize.py +1 -1
  14. {spooling-0.3.0 → spooling-0.4.1}/spooling/tunnel.py +5 -1
  15. {spooling-0.3.0 → spooling-0.4.1/spooling.egg-info}/PKG-INFO +28 -13
  16. {spooling-0.3.0 → spooling-0.4.1}/spooling.egg-info/SOURCES.txt +1 -0
  17. {spooling-0.3.0 → spooling-0.4.1}/spooling.egg-info/requires.txt +8 -2
  18. spooling-0.4.1/tests/test_evals.py +145 -0
  19. spooling-0.3.0/spooling/evals.py +0 -611
  20. spooling-0.3.0/spooling/experiments.py +0 -407
  21. {spooling-0.3.0 → spooling-0.4.1}/LICENSE +0 -0
  22. {spooling-0.3.0 → spooling-0.4.1}/setup.cfg +0 -0
  23. {spooling-0.3.0 → spooling-0.4.1}/spooling/agent.py +0 -0
  24. {spooling-0.3.0 → spooling-0.4.1}/spooling/classifiers.py +0 -0
  25. {spooling-0.3.0 → spooling-0.4.1}/spooling/cloud.py +0 -0
  26. {spooling-0.3.0 → spooling-0.4.1}/spooling/config.py +0 -0
  27. {spooling-0.3.0 → spooling-0.4.1}/spooling/connectors/__init__.py +0 -0
  28. {spooling-0.3.0 → spooling-0.4.1}/spooling/connectors/base.py +0 -0
  29. {spooling-0.3.0 → spooling-0.4.1}/spooling/connectors/bigquery.py +0 -0
  30. {spooling-0.3.0 → spooling-0.4.1}/spooling/connectors/clickhouse.py +0 -0
  31. {spooling-0.3.0 → spooling-0.4.1}/spooling/connectors/factory.py +0 -0
  32. {spooling-0.3.0 → spooling-0.4.1}/spooling/connectors/mongodb.py +0 -0
  33. {spooling-0.3.0 → spooling-0.4.1}/spooling/connectors/mysql.py +0 -0
  34. {spooling-0.3.0 → spooling-0.4.1}/spooling/connectors/postgresql.py +0 -0
  35. {spooling-0.3.0 → spooling-0.4.1}/spooling/connectors/rest/__init__.py +0 -0
  36. {spooling-0.3.0 → spooling-0.4.1}/spooling/connectors/rest/base.py +0 -0
  37. {spooling-0.3.0 → spooling-0.4.1}/spooling/connectors/rest/shopify_connectors.py +0 -0
  38. {spooling-0.3.0 → spooling-0.4.1}/spooling/connectors/snowflake.py +0 -0
  39. {spooling-0.3.0 → spooling-0.4.1}/spooling/connectors/types.py +0 -0
  40. {spooling-0.3.0 → spooling-0.4.1}/spooling/device_login.py +0 -0
  41. {spooling-0.3.0 → spooling-0.4.1}/spooling/embeddings.py +0 -0
  42. {spooling-0.3.0 → spooling-0.4.1}/spooling/ingest.py +0 -0
  43. {spooling-0.3.0 → spooling-0.4.1}/spooling/insights.py +0 -0
  44. {spooling-0.3.0 → spooling-0.4.1}/spooling/optimize.py +0 -0
  45. {spooling-0.3.0 → spooling-0.4.1}/spooling/parser.py +0 -0
  46. {spooling-0.3.0 → spooling-0.4.1}/spooling/pricing.py +0 -0
  47. {spooling-0.3.0 → spooling-0.4.1}/spooling/providers/__init__.py +0 -0
  48. {spooling-0.3.0 → spooling-0.4.1}/spooling/providers/antigravity.py +0 -0
  49. {spooling-0.3.0 → spooling-0.4.1}/spooling/providers/base.py +0 -0
  50. {spooling-0.3.0 → spooling-0.4.1}/spooling/providers/claude_code.py +0 -0
  51. {spooling-0.3.0 → spooling-0.4.1}/spooling/providers/codex.py +0 -0
  52. {spooling-0.3.0 → spooling-0.4.1}/spooling/providers/copilot.py +0 -0
  53. {spooling-0.3.0 → spooling-0.4.1}/spooling/providers/cortex_code.py +0 -0
  54. {spooling-0.3.0 → spooling-0.4.1}/spooling/providers/cursor.py +0 -0
  55. {spooling-0.3.0 → spooling-0.4.1}/spooling/providers/gemini.py +0 -0
  56. {spooling-0.3.0 → spooling-0.4.1}/spooling/providers/github.py +0 -0
  57. {spooling-0.3.0 → spooling-0.4.1}/spooling/providers/gitlab.py +0 -0
  58. {spooling-0.3.0 → spooling-0.4.1}/spooling/providers/kiro.py +0 -0
  59. {spooling-0.3.0 → spooling-0.4.1}/spooling/providers/opencode.py +0 -0
  60. {spooling-0.3.0 → spooling-0.4.1}/spooling/providers/session_file.py +0 -0
  61. {spooling-0.3.0 → spooling-0.4.1}/spooling/providers/windsurf.py +0 -0
  62. {spooling-0.3.0 → spooling-0.4.1}/spooling/redact.py +0 -0
  63. {spooling-0.3.0 → spooling-0.4.1}/spooling/sdk.py +0 -0
  64. {spooling-0.3.0 → spooling-0.4.1}/spooling/search.py +0 -0
  65. {spooling-0.3.0 → spooling-0.4.1}/spooling/sessions.py +0 -0
  66. {spooling-0.3.0 → spooling-0.4.1}/spooling/stats.py +0 -0
  67. {spooling-0.3.0 → spooling-0.4.1}/spooling/subscription_pricing.py +0 -0
  68. {spooling-0.3.0 → spooling-0.4.1}/spooling/tracing.py +0 -0
  69. {spooling-0.3.0 → spooling-0.4.1}/spooling/tunnel_auth.py +0 -0
  70. {spooling-0.3.0 → spooling-0.4.1}/spooling/watcher.py +0 -0
  71. {spooling-0.3.0 → spooling-0.4.1}/spooling.egg-info/dependency_links.txt +0 -0
  72. {spooling-0.3.0 → spooling-0.4.1}/spooling.egg-info/entry_points.txt +0 -0
  73. {spooling-0.3.0 → spooling-0.4.1}/spooling.egg-info/top_level.txt +0 -0
  74. {spooling-0.3.0 → spooling-0.4.1}/tests/test_agent_spans.py +0 -0
  75. {spooling-0.3.0 → spooling-0.4.1}/tests/test_claude_code_provider.py +0 -0
  76. {spooling-0.3.0 → spooling-0.4.1}/tests/test_cloud_errors.py +0 -0
  77. {spooling-0.3.0 → spooling-0.4.1}/tests/test_cloud_teams.py +0 -0
  78. {spooling-0.3.0 → spooling-0.4.1}/tests/test_device_login.py +0 -0
  79. {spooling-0.3.0 → spooling-0.4.1}/tests/test_docs.py +0 -0
  80. {spooling-0.3.0 → spooling-0.4.1}/tests/test_insights.py +0 -0
  81. {spooling-0.3.0 → spooling-0.4.1}/tests/test_mcp_auth_middleware.py +0 -0
  82. {spooling-0.3.0 → spooling-0.4.1}/tests/test_session_ids.py +0 -0
  83. {spooling-0.3.0 → spooling-0.4.1}/tests/test_storage_optimizations.py +0 -0
  84. {spooling-0.3.0 → spooling-0.4.1}/tests/test_summarize.py +0 -0
  85. {spooling-0.3.0 → spooling-0.4.1}/tests/test_tunnel_auth.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: spooling
3
- Version: 0.3.0
3
+ Version: 0.4.1
4
4
  Summary: Local session tracker and semantic search for AI coding assistants
5
5
  Author: Parsed Analytics, Inc.
6
6
  License: MIT
@@ -19,8 +19,8 @@ Requires-Dist: watchdog>=4.0
19
19
  Requires-Dist: rich>=13.0
20
20
  Requires-Dist: httpx>=0.27
21
21
  Requires-Dist: anthropic>=0.40
22
- Requires-Dist: strands-agents[ollama]>=1.35
23
- Requires-Dist: strands-agents-evals>=0.1
22
+ Requires-Dist: pydantic-ai-slim[anthropic,openai]>=2.78
23
+ Requires-Dist: pydantic-evals>=2.78
24
24
  Requires-Dist: mcp<2,>=1.27
25
25
  Provides-Extra: dev
26
26
  Requires-Dist: pytest>=8.0; extra == "dev"
@@ -31,6 +31,10 @@ Requires-Dist: google-cloud-bigquery>=3.0; extra == "connectors"
31
31
  Requires-Dist: mysql-connector-python>=8.0; extra == "connectors"
32
32
  Requires-Dist: clickhouse-connect>=0.5; extra == "connectors"
33
33
  Requires-Dist: motor>=3.0; extra == "connectors"
34
+ Provides-Extra: otel-mappers
35
+ Requires-Dist: strands-agents-evals>=0.1; extra == "otel-mappers"
36
+ Provides-Extra: bedrock
37
+ Requires-Dist: boto3>=1.34; extra == "bedrock"
34
38
  Dynamic: license-file
35
39
 
36
40
  # Spooling
@@ -336,25 +340,36 @@ spooling mcp --stdio # stdio transport, for stdio-only clients
336
340
 
337
341
  ### `spooling tunnel`
338
342
 
339
- Create a Cloudflare quick tunnel (no account required) to expose your local MCP server to the internet. Once started, it prints a public HTTPS URL you can drop straight into any remote MCP client config. Requires [`cloudflared`](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/) to be installed.
343
+ Create a Cloudflare quick tunnel (no account required) to expose your local MCP server to the internet. Requires [`cloudflared`](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/) (auto-downloaded if missing).
340
344
 
341
345
  ```bash
342
- spooling tunnel # Expose Spooling MCP (port 3004, default)
343
- spooling tunnel --port 8090 # Expose a custom local port
344
- spooling tunnel -p 3000 -n my-api # Named tunnel on port 3000
346
+ spooling token generate # create a tunnel token (once)
347
+ spooling mcp # start MCP server (enforces token if set)
348
+ spooling tunnel # expose Spooling MCP (port 3004, default)
349
+ spooling tunnel --port 8090 # expose a custom local port
345
350
  ```
346
351
 
347
352
  Options:
348
353
  - `-p, --port` - Local port to expose (default: 3004)
349
354
  - `-n, --name` - Label for display purposes
350
355
 
351
- After the tunnel starts, it prints the public URL and an MCP config snippet ready to paste:
356
+ When a tunnel token is configured, the MCP server requires this header on every request:
357
+
358
+ ```http
359
+ Authorization: Bearer <tunnel-token>
360
+ ```
361
+
362
+ (`spooling token show` prints the token. Source: `SPOOLING_MCP_TOKEN` or `~/.config/spooling/tunnel.json`. Restart `spooling mcp` after `token generate`/`rotate`.)
363
+
364
+ When the tunnel is ready, Spooling prints the URL and a ready-to-paste MCP config snippet (including the auth header when a token exists):
352
365
 
353
366
  ```json
354
- {"mcpServers": {"spooling": {"type": "http", "url": "https://<random>.trycloudflare.com/mcp"}}}
367
+ {"mcpServers": {"spooling": {"type": "http", "url": "https://<random>.trycloudflare.com/mcp", "headers": {"Authorization": "Bearer sk_..."}}}}
355
368
  ```
356
369
 
357
- Install `cloudflared` if not already present:
370
+ This tunnel token is only for the local MCP tunnel. It is separate from your Spooling Cloud API key (`SPOOLING_KEY` / `spooling login`).
371
+
372
+ Install `cloudflared` manually if you prefer:
358
373
 
359
374
  ```bash
360
375
  # macOS
@@ -409,7 +424,7 @@ spooling eval run --rubric <id> --days 7 # Batch-score traces from the la
409
424
 
410
425
  ### `spooling experiment`
411
426
 
412
- Create and run Strands-style experiments — a set of test cases evaluated by one or more rubrics.
427
+ Create and run experiments — a set of test cases evaluated by one or more LLM judges (Pydantic Evals).
413
428
 
414
429
  ```bash
415
430
  spooling experiment list # List all experiments
@@ -420,7 +435,7 @@ spooling experiment show --run <run-id> # Show the results of a past run
420
435
 
421
436
  ### `spooling otel`
422
437
 
423
- Ingest OpenTelemetry / Strands span exports from external sources into Spooling.
438
+ Ingest OpenTelemetry span exports from external sources into Spooling. OTLP/JSON import needs the optional mapper extra: `pip install "spooling[otel-mappers]"`.
424
439
 
425
440
  ```bash
426
441
  spooling otel ingest --file spans.json # Ingest an OTLP JSON export
@@ -646,7 +661,7 @@ Or register it with an MCP client's config file.
646
661
  | `get_stats` | Top-line stats: traces, tokens, cost, errors |
647
662
  | `get_top_vendors` | Most-used external vendors by tool-call count |
648
663
  | `list_evals` | Recent eval runs, optionally filtered by rubric |
649
- | `list_rubrics` | All configured Strands eval rubrics |
664
+ | `list_rubrics` | All configured eval rubrics (LLM judges + function rubrics) |
650
665
  | `run_eval` | Run a rubric against a trace and persist the result |
651
666
 
652
667
  ### Stdio (legacy clients)
@@ -301,25 +301,36 @@ spooling mcp --stdio # stdio transport, for stdio-only clients
301
301
 
302
302
  ### `spooling tunnel`
303
303
 
304
- Create a Cloudflare quick tunnel (no account required) to expose your local MCP server to the internet. Once started, it prints a public HTTPS URL you can drop straight into any remote MCP client config. Requires [`cloudflared`](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/) to be installed.
304
+ Create a Cloudflare quick tunnel (no account required) to expose your local MCP server to the internet. Requires [`cloudflared`](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/) (auto-downloaded if missing).
305
305
 
306
306
  ```bash
307
- spooling tunnel # Expose Spooling MCP (port 3004, default)
308
- spooling tunnel --port 8090 # Expose a custom local port
309
- spooling tunnel -p 3000 -n my-api # Named tunnel on port 3000
307
+ spooling token generate # create a tunnel token (once)
308
+ spooling mcp # start MCP server (enforces token if set)
309
+ spooling tunnel # expose Spooling MCP (port 3004, default)
310
+ spooling tunnel --port 8090 # expose a custom local port
310
311
  ```
311
312
 
312
313
  Options:
313
314
  - `-p, --port` - Local port to expose (default: 3004)
314
315
  - `-n, --name` - Label for display purposes
315
316
 
316
- After the tunnel starts, it prints the public URL and an MCP config snippet ready to paste:
317
+ When a tunnel token is configured, the MCP server requires this header on every request:
318
+
319
+ ```http
320
+ Authorization: Bearer <tunnel-token>
321
+ ```
322
+
323
+ (`spooling token show` prints the token. Source: `SPOOLING_MCP_TOKEN` or `~/.config/spooling/tunnel.json`. Restart `spooling mcp` after `token generate`/`rotate`.)
324
+
325
+ When the tunnel is ready, Spooling prints the URL and a ready-to-paste MCP config snippet (including the auth header when a token exists):
317
326
 
318
327
  ```json
319
- {"mcpServers": {"spooling": {"type": "http", "url": "https://<random>.trycloudflare.com/mcp"}}}
328
+ {"mcpServers": {"spooling": {"type": "http", "url": "https://<random>.trycloudflare.com/mcp", "headers": {"Authorization": "Bearer sk_..."}}}}
320
329
  ```
321
330
 
322
- Install `cloudflared` if not already present:
331
+ This tunnel token is only for the local MCP tunnel. It is separate from your Spooling Cloud API key (`SPOOLING_KEY` / `spooling login`).
332
+
333
+ Install `cloudflared` manually if you prefer:
323
334
 
324
335
  ```bash
325
336
  # macOS
@@ -374,7 +385,7 @@ spooling eval run --rubric <id> --days 7 # Batch-score traces from the la
374
385
 
375
386
  ### `spooling experiment`
376
387
 
377
- Create and run Strands-style experiments — a set of test cases evaluated by one or more rubrics.
388
+ Create and run experiments — a set of test cases evaluated by one or more LLM judges (Pydantic Evals).
378
389
 
379
390
  ```bash
380
391
  spooling experiment list # List all experiments
@@ -385,7 +396,7 @@ spooling experiment show --run <run-id> # Show the results of a past run
385
396
 
386
397
  ### `spooling otel`
387
398
 
388
- Ingest OpenTelemetry / Strands span exports from external sources into Spooling.
399
+ Ingest OpenTelemetry span exports from external sources into Spooling. OTLP/JSON import needs the optional mapper extra: `pip install "spooling[otel-mappers]"`.
389
400
 
390
401
  ```bash
391
402
  spooling otel ingest --file spans.json # Ingest an OTLP JSON export
@@ -611,7 +622,7 @@ Or register it with an MCP client's config file.
611
622
  | `get_stats` | Top-line stats: traces, tokens, cost, errors |
612
623
  | `get_top_vendors` | Most-used external vendors by tool-call count |
613
624
  | `list_evals` | Recent eval runs, optionally filtered by rubric |
614
- | `list_rubrics` | All configured Strands eval rubrics |
625
+ | `list_rubrics` | All configured eval rubrics (LLM judges + function rubrics) |
615
626
  | `run_eval` | Run a rubric against a trace and persist the result |
616
627
 
617
628
  ### Stdio (legacy clients)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "spooling"
3
- version = "0.3.0"
3
+ version = "0.4.1"
4
4
  description = "Local session tracker and semantic search for AI coding assistants"
5
5
  readme = "README.md"
6
6
  authors = [{ name = "Parsed Analytics, Inc." }]
@@ -21,8 +21,8 @@ dependencies = [
21
21
  "rich>=13.0",
22
22
  "httpx>=0.27",
23
23
  "anthropic>=0.40",
24
- "strands-agents[ollama]>=1.35",
25
- "strands-agents-evals>=0.1",
24
+ "pydantic-ai-slim[openai,anthropic]>=2.78",
25
+ "pydantic-evals>=2.78",
26
26
  "mcp>=1.27,<2",
27
27
  ]
28
28
 
@@ -38,6 +38,12 @@ connectors = [
38
38
  "clickhouse-connect>=0.5",
39
39
  "motor>=3.0",
40
40
  ]
41
+ otel-mappers = [
42
+ "strands-agents-evals>=0.1",
43
+ ]
44
+ bedrock = [
45
+ "boto3>=1.34",
46
+ ]
41
47
 
42
48
  [project.scripts]
43
49
  spooling = "spooling.cli:cli"
@@ -1,2 +1,2 @@
1
1
  """Spooling - local session tracker for AI coding assistants."""
2
- __version__ = "0.1.0"
2
+ __version__ = "0.4.0"
@@ -341,7 +341,7 @@ def serve(host, port):
341
341
 
342
342
  @cli.group()
343
343
  def otel():
344
- """Ingest OTel/Strands spans from external sources into Spooling."""
344
+ """Ingest OTel spans from external sources into Spooling."""
345
345
  pass
346
346
 
347
347
 
@@ -395,7 +395,7 @@ def otel_preview(path, provider_id, project):
395
395
 
396
396
  @cli.group()
397
397
  def experiment():
398
- """Create and run Strands experiments (cases + evaluators)."""
398
+ """Create and run experiments (cases + judges)."""
399
399
  pass
400
400
 
401
401
 
@@ -948,18 +948,25 @@ def tunnel(port, name):
948
948
  display_name = name or f"port {port}"
949
949
  console.print(f"[bold]Starting tunnel for {display_name}...[/bold]")
950
950
 
951
- url = start_tunnel(port=port, name=name)
952
- if url:
953
- # Build MCP config snippet — include auth header when a token is set.
951
+ def _on_ready(url: str) -> None:
954
952
  mcp_server_config: dict = {"type": "http", "url": f"{url}/mcp"}
955
953
  if tok:
954
+ console.print("[bold cyan]Tunnel auth header (required):[/bold cyan]")
955
+ console.print(f" Authorization: Bearer {tok}")
956
+ console.print("[dim]Restart `spooling mcp` if it was started before token generation/rotation. This token is separate from your Spooling Cloud API key.[/dim]")
957
+ console.print()
956
958
  mcp_server_config["headers"] = {"Authorization": f"Bearer {tok}"}
959
+ else:
960
+ console.print("[yellow]No tunnel token configured — the endpoint will be unauthenticated.[/yellow]")
961
+ console.print("[dim]Run `spooling token generate`, restart `spooling mcp`, then rerun tunnel to secure it.[/dim]")
962
+ console.print()
957
963
  snippet = _json.dumps({"mcpServers": {"spooling": mcp_server_config}}, indent=2)
958
- console.print()
959
964
  console.print("[dim]Add this to your MCP client config:[/dim]")
960
965
  console.print(f"[bold]{snippet}[/bold]")
961
966
  console.print()
962
967
 
968
+ start_tunnel(port=port, name=name, on_ready=_on_ready)
969
+
963
970
 
964
971
  @cli.command()
965
972
  @click.option("--stdio", is_flag=True, help="Use stdio transport (default is streamable-HTTP)")
@@ -147,6 +147,13 @@ def _ensure_schema(conn: sqlite3.Connection) -> None:
147
147
  _ADDED_COLUMNS = (
148
148
  ("sessions", "summary", "TEXT"),
149
149
  ("sessions", "summary_message_count", "INTEGER"),
150
+ ("eval_rubrics", "evaluator_type", "TEXT"),
151
+ ("eval_rubrics", "rubric_text", "TEXT"),
152
+ ("eval_rubrics", "model_id", "TEXT"),
153
+ ("eval_rubrics", "is_default", "INTEGER DEFAULT 0"),
154
+ ("evals", "judge_cost_usd", "REAL DEFAULT 0"),
155
+ ("evals", "attrs", "TEXT DEFAULT '{}'"),
156
+ ("experiments", "config", "TEXT DEFAULT '{}'"),
150
157
  )
151
158
 
152
159