@rynfar/meridian 1.37.8 → 1.39.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.
Files changed (83) hide show
  1. package/README.md +54 -3
  2. package/dist/{cli-pr79d7nw.js → cli-4rqtm83g.js} +33 -2
  3. package/dist/{cli-z5r7ptsm.js → cli-jbdchsr4.js} +1109 -231
  4. package/dist/cli-sry5aqdj.js +54 -0
  5. package/dist/cli.js +5 -4
  6. package/dist/pluginPage-85s6t6k8.js +405 -0
  7. package/dist/{profilePage-g5t5t6av.js → profilePage-77z05e0r.js} +4 -8
  8. package/dist/proxy/adapter.d.ts +45 -12
  9. package/dist/proxy/adapter.d.ts.map +1 -1
  10. package/dist/proxy/adapters/claudecode.d.ts +21 -0
  11. package/dist/proxy/adapters/claudecode.d.ts.map +1 -0
  12. package/dist/proxy/adapters/crush.d.ts +2 -0
  13. package/dist/proxy/adapters/crush.d.ts.map +1 -1
  14. package/dist/proxy/adapters/detect.d.ts +3 -2
  15. package/dist/proxy/adapters/detect.d.ts.map +1 -1
  16. package/dist/proxy/adapters/droid.d.ts +2 -0
  17. package/dist/proxy/adapters/droid.d.ts.map +1 -1
  18. package/dist/proxy/adapters/forgecode.d.ts +2 -0
  19. package/dist/proxy/adapters/forgecode.d.ts.map +1 -1
  20. package/dist/proxy/adapters/opencode.d.ts +2 -0
  21. package/dist/proxy/adapters/opencode.d.ts.map +1 -1
  22. package/dist/proxy/adapters/passthrough.d.ts +2 -0
  23. package/dist/proxy/adapters/passthrough.d.ts.map +1 -1
  24. package/dist/proxy/adapters/pi.d.ts +2 -0
  25. package/dist/proxy/adapters/pi.d.ts.map +1 -1
  26. package/dist/proxy/agentDefs.d.ts +2 -0
  27. package/dist/proxy/agentDefs.d.ts.map +1 -1
  28. package/dist/proxy/agentMatch.d.ts +11 -1
  29. package/dist/proxy/agentMatch.d.ts.map +1 -1
  30. package/dist/proxy/messages.d.ts +11 -0
  31. package/dist/proxy/messages.d.ts.map +1 -1
  32. package/dist/proxy/models.d.ts +25 -0
  33. package/dist/proxy/models.d.ts.map +1 -1
  34. package/dist/proxy/openai.d.ts.map +1 -1
  35. package/dist/proxy/passthroughTools.d.ts +18 -0
  36. package/dist/proxy/passthroughTools.d.ts.map +1 -1
  37. package/dist/proxy/plugins/loader.d.ts +6 -0
  38. package/dist/proxy/plugins/loader.d.ts.map +1 -0
  39. package/dist/proxy/plugins/pluginPage.d.ts +7 -0
  40. package/dist/proxy/plugins/pluginPage.d.ts.map +1 -0
  41. package/dist/proxy/plugins/stats.d.ts +61 -0
  42. package/dist/proxy/plugins/stats.d.ts.map +1 -0
  43. package/dist/proxy/plugins/types.d.ts +21 -0
  44. package/dist/proxy/plugins/types.d.ts.map +1 -0
  45. package/dist/proxy/plugins/validation.d.ts +8 -0
  46. package/dist/proxy/plugins/validation.d.ts.map +1 -0
  47. package/dist/proxy/query.d.ts +27 -4
  48. package/dist/proxy/query.d.ts.map +1 -1
  49. package/dist/proxy/server.d.ts +2 -0
  50. package/dist/proxy/server.d.ts.map +1 -1
  51. package/dist/proxy/session/lineage.d.ts +10 -1
  52. package/dist/proxy/session/lineage.d.ts.map +1 -1
  53. package/dist/proxy/transform.d.ts +137 -0
  54. package/dist/proxy/transform.d.ts.map +1 -0
  55. package/dist/proxy/transforms/crush.d.ts +3 -0
  56. package/dist/proxy/transforms/crush.d.ts.map +1 -0
  57. package/dist/proxy/transforms/droid.d.ts +3 -0
  58. package/dist/proxy/transforms/droid.d.ts.map +1 -0
  59. package/dist/proxy/transforms/forgecode.d.ts +3 -0
  60. package/dist/proxy/transforms/forgecode.d.ts.map +1 -0
  61. package/dist/proxy/transforms/opencode.d.ts +3 -0
  62. package/dist/proxy/transforms/opencode.d.ts.map +1 -0
  63. package/dist/proxy/transforms/passthrough.d.ts +3 -0
  64. package/dist/proxy/transforms/passthrough.d.ts.map +1 -0
  65. package/dist/proxy/transforms/pi.d.ts +3 -0
  66. package/dist/proxy/transforms/pi.d.ts.map +1 -0
  67. package/dist/proxy/transforms/registry.d.ts +3 -0
  68. package/dist/proxy/transforms/registry.d.ts.map +1 -0
  69. package/dist/proxy/types.d.ts +6 -0
  70. package/dist/proxy/types.d.ts.map +1 -1
  71. package/dist/server.js +14 -5
  72. package/dist/stats-4c4ewmdh.js +17 -0
  73. package/dist/telemetry/dashboard.d.ts.map +1 -1
  74. package/dist/telemetry/landing.d.ts.map +1 -1
  75. package/dist/telemetry/profileBar.d.ts +13 -1
  76. package/dist/telemetry/profileBar.d.ts.map +1 -1
  77. package/dist/telemetry/profilePage.d.ts.map +1 -1
  78. package/dist/telemetry/settingsPage.d.ts +1 -1
  79. package/dist/telemetry/settingsPage.d.ts.map +1 -1
  80. package/dist/telemetry/sqlite.d.ts.map +1 -1
  81. package/dist/telemetry/types.d.ts +4 -0
  82. package/dist/telemetry/types.d.ts.map +1 -1
  83. package/package.json +4 -2
package/README.md CHANGED
@@ -7,12 +7,12 @@
7
7
  <a href="https://www.npmjs.com/package/@rynfar/meridian"><img src="https://img.shields.io/npm/v/@rynfar/meridian?style=flat-square&color=8b5cf6&label=npm" alt="npm"></a>
8
8
  <a href="#"><img src="https://img.shields.io/badge/platform-macOS%20%7C%20Linux%20%7C%20Windows-a78bfa?style=flat-square" alt="Platform"></a>
9
9
  <a href="#"><img src="https://img.shields.io/badge/license-MIT-c4b5fd?style=flat-square" alt="License"></a>
10
- <a href="https://discord.gg/7vNVFYBz"><img src="https://img.shields.io/badge/discord-join-5865F2?style=flat-square&logo=discord&logoColor=white" alt="Discord"></a>
10
+ <a href="https://discord.gg/jP2a2Z92NZ"><img src="https://img.shields.io/badge/discord-join-5865F2?style=flat-square&logo=discord&logoColor=white" alt="Discord"></a>
11
11
  </p>
12
12
 
13
13
  ---
14
14
 
15
- Meridian bridges the Claude Code SDK to the standard Anthropic API. No OAuth interception. No binary patches. No hacks. Just pure, documented SDK calls. Any tool that speaks the Anthropic or OpenAI protocol — OpenCode, ForgeCode, Crush, Cline, Aider, Pi, Droid, Open WebUI — connects to Meridian and gets Claude, with session management, streaming, and prompt caching handled natively by the SDK.
15
+ Meridian bridges the Claude Code SDK to the standard Anthropic API. No OAuth interception. No binary patches. No hacks. Just pure, documented SDK calls. Any tool that speaks the Anthropic or OpenAI protocol — OpenCode, ForgeCode, Crush, Cline, Aider, Pi, Droid, Open WebUI, Claude Code — connects to Meridian and gets Claude, with session management, streaming, and prompt caching handled natively by the SDK.
16
16
 
17
17
  > [!NOTE]
18
18
  > ### How Meridian works with Anthropic
@@ -483,6 +483,35 @@ Pi uses the `@mariozechner/pi-ai` library which supports a configurable `baseUrl
483
483
 
484
484
  Pi mimics Claude Code's User-Agent, so automatic detection isn't possible. The `x-meridian-agent: pi` header in the config above tells Meridian to use the Pi adapter. Alternatively, if Pi is your only agent, you can set `MERIDIAN_DEFAULT_AGENT=pi` as an env var instead.
485
485
 
486
+ ### Claude Code
487
+
488
+ Claude Code can point at Meridian like any other Anthropic API client. The
489
+ common use case is sharing a single Claude Max subscription from one host
490
+ across other machines on your network — run Meridian on the box that is
491
+ logged into Claude Max, then run Claude Code anywhere else against it.
492
+
493
+ ```bash
494
+ # On another machine (or the same one)
495
+ ANTHROPIC_AUTH_TOKEN=x ANTHROPIC_BASE_URL=http://meridian-host:3456 claude
496
+ ```
497
+
498
+ > **Note:** Use `ANTHROPIC_AUTH_TOKEN` (or `ANTHROPIC_API_KEY`) — Claude Code
499
+ > treats both as bearer credentials. Set the value to your `MERIDIAN_API_KEY`
500
+ > if you've enabled authentication, otherwise any string works.
501
+
502
+ > ⚠️ **Security for multi-machine setups.** If you expose Meridian beyond
503
+ > loopback (e.g. bind to `0.0.0.0` or a LAN IP), **set `MERIDIAN_API_KEY` to a
504
+ > strong secret** and require it on clients. An unprotected network-accessible
505
+ > proxy is a Claude Max credential leak — anyone who can reach the port can
506
+ > burn your subscription.
507
+
508
+ Claude Code is detected automatically via its `claude-cli/*` User-Agent.
509
+ Requests flow through the Claude Code adapter which:
510
+
511
+ - Parses the client's real working directory from its `Primary working directory:` system-prompt line so Claude answers path-related questions with your local path, not the proxy host's.
512
+ - Leaves the SDK subprocess cwd on the proxy host (Claude Code's local paths don't exist there).
513
+ - Runs in passthrough mode by default — Claude Code executes its own tools on the machine it runs on; Meridian just forwards tool_use blocks.
514
+
486
515
  ### Any Anthropic-compatible tool
487
516
 
488
517
  ```bash
@@ -502,6 +531,7 @@ export ANTHROPIC_BASE_URL=http://127.0.0.1:3456
502
531
  | [Aider](https://github.com/paul-gauthier/aider) | ✅ Verified | Env vars — file editing, streaming; `--no-stream` broken (litellm bug) |
503
532
  | [Open WebUI](https://github.com/open-webui/open-webui) | ✅ Verified | OpenAI-compatible endpoints — set base URL to `http://127.0.0.1:3456` |
504
533
  | [Pi](https://github.com/mariozechner/pi-coding-agent) | ✅ Verified | models.json config (see above) — requires `MERIDIAN_DEFAULT_AGENT=pi` |
534
+ | [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | ✅ Verified | `ANTHROPIC_BASE_URL` — remote clients share a Max subscription over the network; client CWD preserved in system prompt |
505
535
  | [Continue](https://github.com/continuedev/continue) | 🔲 Untested | OpenAI-compatible endpoints should work — set `apiBase` to `http://127.0.0.1:3456` |
506
536
 
507
537
  Tested an agent or built a plugin? [Open an issue](https://github.com/rynfar/meridian/issues) and we'll add it.
@@ -652,6 +682,27 @@ Health response example:
652
682
 
653
683
  `plugin.opencode` is `"configured"` when `meridian setup` has been run, `"not-configured"` otherwise.
654
684
 
685
+ ## Plugins
686
+
687
+ Extend Meridian's behavior with composable plugins — no core modifications needed.
688
+
689
+ **Quick start:** Drop a `.ts` or `.js` file in `~/.config/meridian/plugins/` and restart.
690
+
691
+ ```ts
692
+ // ~/.config/meridian/plugins/my-plugin.ts
693
+ export default {
694
+ name: "my-plugin",
695
+ onRequest(ctx) {
696
+ // modify request context
697
+ return { ...ctx, systemContext: ctx.systemContext + "\nBe concise." }
698
+ },
699
+ }
700
+ ```
701
+
702
+ - **Manage plugins** at `http://localhost:3456/plugins`
703
+ - **Reload without restart:** `POST /plugins/reload`
704
+ - **Full guide:** See [PLUGINS.md](PLUGINS.md)
705
+
655
706
  ## CLI Commands
656
707
 
657
708
  | Command | Description |
@@ -758,7 +809,7 @@ You haven't run `meridian setup`. Without the plugin, OpenCode requests won't ha
758
809
 
759
810
  ## Contributing
760
811
 
761
- Issues and PRs welcome. Join the [Discord](https://discord.gg/7vNVFYBz) to discuss ideas before opening issues. See [`ARCHITECTURE.md`](ARCHITECTURE.md) for module structure and dependency rules, [`CLAUDE.md`](CLAUDE.md) for coding guidelines, [`E2E.md`](E2E.md) for end-to-end test procedures, and [`MONITORING.md`](MONITORING.md) for understanding token usage and prompt cache health.
812
+ Issues and PRs welcome. Join the [Discord](https://discord.gg/jP2a2Z92NZ) to discuss ideas before opening issues. See [`ARCHITECTURE.md`](ARCHITECTURE.md) for module structure and dependency rules, [`CLAUDE.md`](CLAUDE.md) for coding guidelines, [`E2E.md`](E2E.md) for end-to-end test procedures, and [`MONITORING.md`](MONITORING.md) for understanding token usage and prompt cache health.
762
813
 
763
814
  ## License
764
815
 
@@ -3,7 +3,37 @@ import {
3
3
  } from "./cli-p9swy5t3.js";
4
4
 
5
5
  // src/telemetry/profileBar.ts
6
- var profileBarCss = `
6
+ var themeCss = `
7
+ :root {
8
+ /* Cool-gray neutral palette — matches the original dashboard/profiles/
9
+ settings look. Better for data-dense dashboards: high contrast,
10
+ surface/border separation, no color cast muddying the text. Purple
11
+ accents are retained as secondary brand color for hover states,
12
+ gradients, and a handful of telemetry badges. */
13
+ --bg: #0d1117;
14
+ --surface: #161b22;
15
+ --surface2: #1c2128;
16
+ --border: #30363d;
17
+ /* Text */
18
+ --text: #e6edf3;
19
+ --muted: #8b949e;
20
+ /* Brand — blue primary, purple secondary */
21
+ --accent: #58a6ff;
22
+ --accent2: #bc8cff;
23
+ --violet: #bc8cff;
24
+ --lavender: #d2a8ff;
25
+ /* Semantic */
26
+ --green: #3fb950;
27
+ --yellow: #d29922;
28
+ --red: #f85149;
29
+ /* Telemetry-specific aliases (waterfall + lineage badges) */
30
+ --blue: #58a6ff;
31
+ --purple: #bc8cff;
32
+ --queue: #d29922;
33
+ --ttfb: #58a6ff;
34
+ --upstream: #3fb950;
35
+ }
36
+ `, profileBarCss = `
7
37
  .meridian-profile-bar {
8
38
  position: sticky; top: 0; z-index: 100;
9
39
  display: none; align-items: center; gap: 12px;
@@ -57,6 +87,7 @@ var profileBarCss = `
57
87
  <a href="/settings" id="nav-settings">Settings</a>
58
88
  <a href="/profiles" id="nav-profiles">Profiles</a>
59
89
  <a href="/telemetry" id="nav-telemetry">Telemetry</a>
90
+ <a href="/plugins" id="nav-plugins">Plugins</a>
60
91
  </div>
61
92
  </div>
62
93
  `, profileBarJs = `
@@ -114,4 +145,4 @@ var profileBarCss = `
114
145
  `;
115
146
  var init_profileBar = () => {};
116
147
 
117
- export { profileBarCss, profileBarHtml, profileBarJs, init_profileBar };
148
+ export { themeCss, profileBarCss, profileBarHtml, profileBarJs, init_profileBar };