spooling 0.4.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 (83) hide show
  1. {spooling-0.4.0/spooling.egg-info → spooling-0.4.1}/PKG-INFO +19 -8
  2. {spooling-0.4.0 → spooling-0.4.1}/README.md +18 -7
  3. {spooling-0.4.0 → spooling-0.4.1}/pyproject.toml +1 -1
  4. {spooling-0.4.0 → spooling-0.4.1}/spooling/cli.py +11 -4
  5. {spooling-0.4.0 → spooling-0.4.1}/spooling/tunnel.py +5 -1
  6. {spooling-0.4.0 → spooling-0.4.1/spooling.egg-info}/PKG-INFO +19 -8
  7. {spooling-0.4.0 → spooling-0.4.1}/LICENSE +0 -0
  8. {spooling-0.4.0 → spooling-0.4.1}/setup.cfg +0 -0
  9. {spooling-0.4.0 → spooling-0.4.1}/spooling/__init__.py +0 -0
  10. {spooling-0.4.0 → spooling-0.4.1}/spooling/agent.py +0 -0
  11. {spooling-0.4.0 → spooling-0.4.1}/spooling/classifiers.py +0 -0
  12. {spooling-0.4.0 → spooling-0.4.1}/spooling/cloud.py +0 -0
  13. {spooling-0.4.0 → spooling-0.4.1}/spooling/config.py +0 -0
  14. {spooling-0.4.0 → spooling-0.4.1}/spooling/connectors/__init__.py +0 -0
  15. {spooling-0.4.0 → spooling-0.4.1}/spooling/connectors/base.py +0 -0
  16. {spooling-0.4.0 → spooling-0.4.1}/spooling/connectors/bigquery.py +0 -0
  17. {spooling-0.4.0 → spooling-0.4.1}/spooling/connectors/clickhouse.py +0 -0
  18. {spooling-0.4.0 → spooling-0.4.1}/spooling/connectors/factory.py +0 -0
  19. {spooling-0.4.0 → spooling-0.4.1}/spooling/connectors/mongodb.py +0 -0
  20. {spooling-0.4.0 → spooling-0.4.1}/spooling/connectors/mysql.py +0 -0
  21. {spooling-0.4.0 → spooling-0.4.1}/spooling/connectors/postgresql.py +0 -0
  22. {spooling-0.4.0 → spooling-0.4.1}/spooling/connectors/rest/__init__.py +0 -0
  23. {spooling-0.4.0 → spooling-0.4.1}/spooling/connectors/rest/base.py +0 -0
  24. {spooling-0.4.0 → spooling-0.4.1}/spooling/connectors/rest/shopify_connectors.py +0 -0
  25. {spooling-0.4.0 → spooling-0.4.1}/spooling/connectors/snowflake.py +0 -0
  26. {spooling-0.4.0 → spooling-0.4.1}/spooling/connectors/types.py +0 -0
  27. {spooling-0.4.0 → spooling-0.4.1}/spooling/db.py +0 -0
  28. {spooling-0.4.0 → spooling-0.4.1}/spooling/device_login.py +0 -0
  29. {spooling-0.4.0 → spooling-0.4.1}/spooling/embeddings.py +0 -0
  30. {spooling-0.4.0 → spooling-0.4.1}/spooling/evals.py +0 -0
  31. {spooling-0.4.0 → spooling-0.4.1}/spooling/experiments.py +0 -0
  32. {spooling-0.4.0 → spooling-0.4.1}/spooling/ingest.py +0 -0
  33. {spooling-0.4.0 → spooling-0.4.1}/spooling/insights.py +0 -0
  34. {spooling-0.4.0 → spooling-0.4.1}/spooling/mcp_server.py +0 -0
  35. {spooling-0.4.0 → spooling-0.4.1}/spooling/optimize.py +0 -0
  36. {spooling-0.4.0 → spooling-0.4.1}/spooling/parser.py +0 -0
  37. {spooling-0.4.0 → spooling-0.4.1}/spooling/pricing.py +0 -0
  38. {spooling-0.4.0 → spooling-0.4.1}/spooling/providers/__init__.py +0 -0
  39. {spooling-0.4.0 → spooling-0.4.1}/spooling/providers/antigravity.py +0 -0
  40. {spooling-0.4.0 → spooling-0.4.1}/spooling/providers/base.py +0 -0
  41. {spooling-0.4.0 → spooling-0.4.1}/spooling/providers/claude_code.py +0 -0
  42. {spooling-0.4.0 → spooling-0.4.1}/spooling/providers/codex.py +0 -0
  43. {spooling-0.4.0 → spooling-0.4.1}/spooling/providers/copilot.py +0 -0
  44. {spooling-0.4.0 → spooling-0.4.1}/spooling/providers/cortex_code.py +0 -0
  45. {spooling-0.4.0 → spooling-0.4.1}/spooling/providers/cursor.py +0 -0
  46. {spooling-0.4.0 → spooling-0.4.1}/spooling/providers/gemini.py +0 -0
  47. {spooling-0.4.0 → spooling-0.4.1}/spooling/providers/github.py +0 -0
  48. {spooling-0.4.0 → spooling-0.4.1}/spooling/providers/gitlab.py +0 -0
  49. {spooling-0.4.0 → spooling-0.4.1}/spooling/providers/kiro.py +0 -0
  50. {spooling-0.4.0 → spooling-0.4.1}/spooling/providers/opencode.py +0 -0
  51. {spooling-0.4.0 → spooling-0.4.1}/spooling/providers/session_file.py +0 -0
  52. {spooling-0.4.0 → spooling-0.4.1}/spooling/providers/windsurf.py +0 -0
  53. {spooling-0.4.0 → spooling-0.4.1}/spooling/redact.py +0 -0
  54. {spooling-0.4.0 → spooling-0.4.1}/spooling/remote_otel.py +0 -0
  55. {spooling-0.4.0 → spooling-0.4.1}/spooling/schema.py +0 -0
  56. {spooling-0.4.0 → spooling-0.4.1}/spooling/sdk.py +0 -0
  57. {spooling-0.4.0 → spooling-0.4.1}/spooling/search.py +0 -0
  58. {spooling-0.4.0 → spooling-0.4.1}/spooling/server.py +0 -0
  59. {spooling-0.4.0 → spooling-0.4.1}/spooling/sessions.py +0 -0
  60. {spooling-0.4.0 → spooling-0.4.1}/spooling/stats.py +0 -0
  61. {spooling-0.4.0 → spooling-0.4.1}/spooling/subscription_pricing.py +0 -0
  62. {spooling-0.4.0 → spooling-0.4.1}/spooling/summarize.py +0 -0
  63. {spooling-0.4.0 → spooling-0.4.1}/spooling/tracing.py +0 -0
  64. {spooling-0.4.0 → spooling-0.4.1}/spooling/tunnel_auth.py +0 -0
  65. {spooling-0.4.0 → spooling-0.4.1}/spooling/watcher.py +0 -0
  66. {spooling-0.4.0 → spooling-0.4.1}/spooling.egg-info/SOURCES.txt +0 -0
  67. {spooling-0.4.0 → spooling-0.4.1}/spooling.egg-info/dependency_links.txt +0 -0
  68. {spooling-0.4.0 → spooling-0.4.1}/spooling.egg-info/entry_points.txt +0 -0
  69. {spooling-0.4.0 → spooling-0.4.1}/spooling.egg-info/requires.txt +0 -0
  70. {spooling-0.4.0 → spooling-0.4.1}/spooling.egg-info/top_level.txt +0 -0
  71. {spooling-0.4.0 → spooling-0.4.1}/tests/test_agent_spans.py +0 -0
  72. {spooling-0.4.0 → spooling-0.4.1}/tests/test_claude_code_provider.py +0 -0
  73. {spooling-0.4.0 → spooling-0.4.1}/tests/test_cloud_errors.py +0 -0
  74. {spooling-0.4.0 → spooling-0.4.1}/tests/test_cloud_teams.py +0 -0
  75. {spooling-0.4.0 → spooling-0.4.1}/tests/test_device_login.py +0 -0
  76. {spooling-0.4.0 → spooling-0.4.1}/tests/test_docs.py +0 -0
  77. {spooling-0.4.0 → spooling-0.4.1}/tests/test_evals.py +0 -0
  78. {spooling-0.4.0 → spooling-0.4.1}/tests/test_insights.py +0 -0
  79. {spooling-0.4.0 → spooling-0.4.1}/tests/test_mcp_auth_middleware.py +0 -0
  80. {spooling-0.4.0 → spooling-0.4.1}/tests/test_session_ids.py +0 -0
  81. {spooling-0.4.0 → spooling-0.4.1}/tests/test_storage_optimizations.py +0 -0
  82. {spooling-0.4.0 → spooling-0.4.1}/tests/test_summarize.py +0 -0
  83. {spooling-0.4.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.4.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
@@ -340,25 +340,36 @@ spooling mcp --stdio # stdio transport, for stdio-only clients
340
340
 
341
341
  ### `spooling tunnel`
342
342
 
343
- 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).
344
344
 
345
345
  ```bash
346
- spooling tunnel # Expose Spooling MCP (port 3004, default)
347
- spooling tunnel --port 8090 # Expose a custom local port
348
- 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
349
350
  ```
350
351
 
351
352
  Options:
352
353
  - `-p, --port` - Local port to expose (default: 3004)
353
354
  - `-n, --name` - Label for display purposes
354
355
 
355
- 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):
356
365
 
357
366
  ```json
358
- {"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_..."}}}}
359
368
  ```
360
369
 
361
- 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:
362
373
 
363
374
  ```bash
364
375
  # macOS
@@ -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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "spooling"
3
- version = "0.4.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." }]
@@ -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)")
@@ -8,7 +8,7 @@ import subprocess
8
8
  import time
9
9
  import urllib.request
10
10
  from pathlib import Path
11
- from typing import Optional, Tuple
11
+ from typing import Callable, Optional, Tuple
12
12
 
13
13
  from rich.console import Console
14
14
 
@@ -106,12 +106,14 @@ def _validate_port(port: int) -> bool:
106
106
  def start_tunnel(
107
107
  port: int,
108
108
  name: Optional[str] = None,
109
+ on_ready: Optional[Callable[[str], None]] = None,
109
110
  ) -> Optional[str]:
110
111
  """Start a Cloudflare quick tunnel and return the public URL.
111
112
 
112
113
  Args:
113
114
  port: Local port to expose (1-65535)
114
115
  name: Optional name for the tunnel (for display purposes)
116
+ on_ready: Optional callback invoked with the public URL once the tunnel is ready
115
117
 
116
118
  Returns:
117
119
  The tunnel URL if successful, None otherwise
@@ -163,6 +165,8 @@ def start_tunnel(
163
165
  console.print(f" [dim]Tunnel: {url}[/dim]")
164
166
  console.print(f" [dim]Local: http://localhost:{port}[/dim]")
165
167
  console.print()
168
+ if on_ready:
169
+ on_ready(url)
166
170
  console.print("Press [bold]Ctrl+C[/bold] to stop the tunnel")
167
171
 
168
172
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: spooling
3
- Version: 0.4.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
@@ -340,25 +340,36 @@ spooling mcp --stdio # stdio transport, for stdio-only clients
340
340
 
341
341
  ### `spooling tunnel`
342
342
 
343
- 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).
344
344
 
345
345
  ```bash
346
- spooling tunnel # Expose Spooling MCP (port 3004, default)
347
- spooling tunnel --port 8090 # Expose a custom local port
348
- 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
349
350
  ```
350
351
 
351
352
  Options:
352
353
  - `-p, --port` - Local port to expose (default: 3004)
353
354
  - `-n, --name` - Label for display purposes
354
355
 
355
- 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):
356
365
 
357
366
  ```json
358
- {"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_..."}}}}
359
368
  ```
360
369
 
361
- 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:
362
373
 
363
374
  ```bash
364
375
  # macOS
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes