@rynfar/meridian 1.37.8 → 1.38.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 (66) hide show
  1. package/README.md +21 -0
  2. package/dist/{cli-pr79d7nw.js → cli-4rqtm83g.js} +33 -2
  3. package/dist/{cli-z5r7ptsm.js → cli-bfgya0hb.js} +683 -100
  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 +17 -10
  9. package/dist/proxy/adapter.d.ts.map +1 -1
  10. package/dist/proxy/adapters/crush.d.ts +2 -0
  11. package/dist/proxy/adapters/crush.d.ts.map +1 -1
  12. package/dist/proxy/adapters/droid.d.ts +2 -0
  13. package/dist/proxy/adapters/droid.d.ts.map +1 -1
  14. package/dist/proxy/adapters/forgecode.d.ts +2 -0
  15. package/dist/proxy/adapters/forgecode.d.ts.map +1 -1
  16. package/dist/proxy/adapters/opencode.d.ts +2 -0
  17. package/dist/proxy/adapters/opencode.d.ts.map +1 -1
  18. package/dist/proxy/adapters/passthrough.d.ts +2 -0
  19. package/dist/proxy/adapters/passthrough.d.ts.map +1 -1
  20. package/dist/proxy/adapters/pi.d.ts +2 -0
  21. package/dist/proxy/adapters/pi.d.ts.map +1 -1
  22. package/dist/proxy/plugins/loader.d.ts +6 -0
  23. package/dist/proxy/plugins/loader.d.ts.map +1 -0
  24. package/dist/proxy/plugins/pluginPage.d.ts +7 -0
  25. package/dist/proxy/plugins/pluginPage.d.ts.map +1 -0
  26. package/dist/proxy/plugins/stats.d.ts +61 -0
  27. package/dist/proxy/plugins/stats.d.ts.map +1 -0
  28. package/dist/proxy/plugins/types.d.ts +21 -0
  29. package/dist/proxy/plugins/types.d.ts.map +1 -0
  30. package/dist/proxy/plugins/validation.d.ts +8 -0
  31. package/dist/proxy/plugins/validation.d.ts.map +1 -0
  32. package/dist/proxy/query.d.ts +8 -3
  33. package/dist/proxy/query.d.ts.map +1 -1
  34. package/dist/proxy/server.d.ts +2 -0
  35. package/dist/proxy/server.d.ts.map +1 -1
  36. package/dist/proxy/transform.d.ts +137 -0
  37. package/dist/proxy/transform.d.ts.map +1 -0
  38. package/dist/proxy/transforms/crush.d.ts +3 -0
  39. package/dist/proxy/transforms/crush.d.ts.map +1 -0
  40. package/dist/proxy/transforms/droid.d.ts +3 -0
  41. package/dist/proxy/transforms/droid.d.ts.map +1 -0
  42. package/dist/proxy/transforms/forgecode.d.ts +3 -0
  43. package/dist/proxy/transforms/forgecode.d.ts.map +1 -0
  44. package/dist/proxy/transforms/opencode.d.ts +3 -0
  45. package/dist/proxy/transforms/opencode.d.ts.map +1 -0
  46. package/dist/proxy/transforms/passthrough.d.ts +3 -0
  47. package/dist/proxy/transforms/passthrough.d.ts.map +1 -0
  48. package/dist/proxy/transforms/pi.d.ts +3 -0
  49. package/dist/proxy/transforms/pi.d.ts.map +1 -0
  50. package/dist/proxy/transforms/registry.d.ts +3 -0
  51. package/dist/proxy/transforms/registry.d.ts.map +1 -0
  52. package/dist/proxy/types.d.ts +6 -0
  53. package/dist/proxy/types.d.ts.map +1 -1
  54. package/dist/server.js +14 -5
  55. package/dist/stats-4c4ewmdh.js +17 -0
  56. package/dist/telemetry/dashboard.d.ts.map +1 -1
  57. package/dist/telemetry/landing.d.ts.map +1 -1
  58. package/dist/telemetry/profileBar.d.ts +13 -1
  59. package/dist/telemetry/profileBar.d.ts.map +1 -1
  60. package/dist/telemetry/profilePage.d.ts.map +1 -1
  61. package/dist/telemetry/settingsPage.d.ts +1 -1
  62. package/dist/telemetry/settingsPage.d.ts.map +1 -1
  63. package/dist/telemetry/sqlite.d.ts.map +1 -1
  64. package/dist/telemetry/types.d.ts +4 -0
  65. package/dist/telemetry/types.d.ts.map +1 -1
  66. package/package.json +1 -1
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Plugins management page.
3
+ * Shows all discovered plugins with their status, hooks, adapters, and errors.
4
+ * Fetches /plugins/list client-side for live data; supports reload via POST /plugins/reload.
5
+ */
6
+ export declare const pluginPageHtml: string;
7
+ //# sourceMappingURL=pluginPage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pluginPage.d.ts","sourceRoot":"","sources":["../../../src/proxy/plugins/pluginPage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,eAAO,MAAM,cAAc,QAsYnB,CAAA"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Plugin invocation statistics.
3
+ *
4
+ * Counts hook invocations, errors, and accumulated runtime per plugin so
5
+ * users can confirm their plugin is actually running and catch regressions
6
+ * (e.g. a plugin throwing on every request).
7
+ *
8
+ * Stats are tracked only for plugins the loader has registered — adapter
9
+ * built-in transforms are internal plumbing and flow through the same
10
+ * pipeline but aren't metered here.
11
+ */
12
+ export interface HookStats {
13
+ /** Number of successful invocations */
14
+ invocations: number;
15
+ /** Number of times the hook threw */
16
+ errors: number;
17
+ /** Accumulated execution time in milliseconds (successful calls only) */
18
+ totalMs: number;
19
+ }
20
+ export interface PluginStats {
21
+ /** Per-hook counters, keyed by hook name (onRequest, onResponse, etc.) */
22
+ hooks: Record<string, HookStats>;
23
+ /** Unix timestamp of the most recent invocation of any hook */
24
+ lastInvokedAt?: number;
25
+ /** Most recent error, if any */
26
+ lastError?: {
27
+ hook: string;
28
+ message: string;
29
+ at: number;
30
+ };
31
+ }
32
+ /**
33
+ * Register a plugin name for stats tracking. Called by the loader after
34
+ * a plugin validates successfully. Resets any prior stats for that name
35
+ * (so /plugins/reload gives you a clean slate).
36
+ */
37
+ export declare function registerPluginStats(name: string): void;
38
+ /**
39
+ * Drop all stats. Called before a full reload so stale data doesn't linger
40
+ * for plugins that were removed from the config.
41
+ */
42
+ export declare function resetAllPluginStats(): void;
43
+ /**
44
+ * Whether the given name is a tracked plugin. Adapter built-in transforms
45
+ * aren't registered, so the runner can silently skip stats for them.
46
+ */
47
+ export declare function isTrackedPlugin(name: string): boolean;
48
+ /**
49
+ * Record a successful invocation of a hook.
50
+ */
51
+ export declare function recordInvocation(name: string, hook: string, durationMs: number): void;
52
+ /**
53
+ * Record an error from a hook.
54
+ */
55
+ export declare function recordError(name: string, hook: string, err: unknown): void;
56
+ /**
57
+ * Read a snapshot of stats for one plugin. Returns a deep copy so callers
58
+ * can't mutate the internal state.
59
+ */
60
+ export declare function getPluginStats(name: string): PluginStats | undefined;
61
+ //# sourceMappingURL=stats.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../src/proxy/plugins/stats.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,SAAS;IACxB,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAA;IACnB,qCAAqC;IACrC,MAAM,EAAE,MAAM,CAAA;IACd,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IAChC,+DAA+D;IAC/D,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gCAAgC;IAChC,SAAS,CAAC,EAAE;QACV,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;QACf,EAAE,EAAE,MAAM,CAAA;KACX,CAAA;CACF;AAYD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEtD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAQrF;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CAa1E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAUpE"}
@@ -0,0 +1,21 @@
1
+ import type { Transform } from "../transform";
2
+ export interface PluginEntry {
3
+ path: string;
4
+ enabled: boolean;
5
+ }
6
+ export interface PluginConfig {
7
+ plugins: PluginEntry[];
8
+ }
9
+ export type PluginStatus = "active" | "disabled" | "error";
10
+ export interface LoadedPlugin {
11
+ name: string;
12
+ description?: string;
13
+ version?: string;
14
+ adapters?: string[];
15
+ hooks: string[];
16
+ status: PluginStatus;
17
+ error?: string;
18
+ path: string;
19
+ transform: Transform;
20
+ }
21
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/proxy/plugins/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,WAAW,EAAE,CAAA;CACvB;AAED,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAA;AAE1D,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,MAAM,EAAE,YAAY,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,SAAS,CAAA;CACrB"}
@@ -0,0 +1,8 @@
1
+ export interface ValidationResult {
2
+ valid: boolean;
3
+ hooks: string[];
4
+ error?: string;
5
+ warnings?: string[];
6
+ }
7
+ export declare function validateTransform(exported: unknown): ValidationResult;
8
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/proxy/plugins/validation.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAA;IACd,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CACpB;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,OAAO,GAAG,gBAAgB,CAmCrE"}
@@ -4,7 +4,6 @@
4
4
  * Centralizes the construction of query() options, eliminating duplication
5
5
  * between the streaming and non-streaming paths in server.ts.
6
6
  */
7
- import type { AgentAdapter } from "./adapter";
8
7
  import type { Options, SettingSource } from "@anthropic-ai/claude-agent-sdk";
9
8
  import { createPassthroughMcpServer } from "./passthroughTools";
10
9
  export interface QueryContext {
@@ -38,8 +37,14 @@ export interface QueryContext {
38
37
  undoRollbackUuid?: string;
39
38
  /** SDK hooks (PreToolUse etc.) */
40
39
  sdkHooks?: any;
41
- /** The agent adapter providing tool configuration */
42
- adapter: AgentAdapter;
40
+ /** Blocked SDK built-in tools (from pipeline) */
41
+ blockedTools: readonly string[];
42
+ /** Agent-incompatible tools (from pipeline) */
43
+ incompatibleTools: readonly string[];
44
+ /** MCP server name for this adapter */
45
+ mcpServerName: string;
46
+ /** Allowed MCP tools (from pipeline) */
47
+ allowedMcpTools: readonly string[];
43
48
  /** Callback to receive stderr lines from the Claude subprocess */
44
49
  onStderr?: (line: string) => void;
45
50
  /** Effort level — controls thinking depth (low/medium/high/max) */
@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wBAAgB,iBAAiB,CAAC,GAAG,EAAE,YAAY,GAAG,gBAAgB,CAqFrE"}
@@ -1,5 +1,7 @@
1
1
  import type { ProxyConfig, ProxyInstance, ProxyServer } from "./types";
2
2
  export type { ProxyConfig, ProxyInstance, ProxyServer };
3
+ export type { Transform, RequestContext, ResponseContext, TelemetryContext, SessionContext, ToolUseContext, ToolResultContext, ErrorContext, TransformHook, ObserveHook, } from "./transform";
4
+ export { runTransformHook, runObserveHook, buildPipeline, createRequestContext } from "./transform";
3
5
  import { computeLineageHash, hashMessage, computeMessageHashes, type LineageResult } from "./session/lineage";
4
6
  import { clearSessionCache, getMaxSessionsLimit } from "./session/cache";
5
7
  export { computeLineageHash, hashMessage, computeMessageHashes };
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/proxy/server.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACtE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,CAAA;AA0BvD,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EACpB,KAAK,aAAa,EAEnB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAA+B,iBAAiB,EAAE,mBAAmB,EAAsC,MAAM,iBAAiB,CAAA;AAGzI,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAA;AACjD,YAAY,EAAE,aAAa,EAAE,CAAA;AA8N7B,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CAy5DhF;AAED,wBAAsB,gBAAgB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAiEhG"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/proxy/server.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACtE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,CAAA;AAGvD,YAAY,EACV,SAAS,EACT,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,WAAW,GACZ,MAAM,aAAa,CAAA;AAKpB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AA8BnG,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EACpB,KAAK,aAAa,EAEnB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAA+B,iBAAiB,EAAE,mBAAmB,EAAsC,MAAM,iBAAiB,CAAA;AAGzI,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAA;AACjD,YAAY,EAAE,aAAa,EAAE,CAAA;AA8N7B,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CA0+DhF;AAED,wBAAsB,gBAAgB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAkEhG"}
@@ -0,0 +1,137 @@
1
+ /**
2
+ * Transform pipeline — composable behavioral hooks for request/response processing.
3
+ *
4
+ * Adapters provide built-in transforms; plugins provide user-defined transforms.
5
+ * Both use the same interface. The pipeline runner chains them in order, passing
6
+ * each hook's output as the next hook's input.
7
+ */
8
+ import type { FileChange } from "./fileChanges";
9
+ import type { SettingSource } from "@anthropic-ai/claude-agent-sdk";
10
+ /**
11
+ * A composable unit of request/response behavior.
12
+ * Built-in adapter transforms and user plugins implement this interface.
13
+ */
14
+ export interface Transform {
15
+ /** Unique name for logging and UI display */
16
+ name: string;
17
+ /** Human-readable description */
18
+ description?: string;
19
+ /** Semver version string */
20
+ version?: string;
21
+ /** Restrict to specific adapter names. Undefined = all adapters. */
22
+ adapters?: string[];
23
+ onRequest?(ctx: RequestContext): RequestContext;
24
+ onResponse?(ctx: ResponseContext): ResponseContext;
25
+ onTelemetry?(ctx: TelemetryContext): void;
26
+ onSession?(ctx: SessionContext): SessionContext;
27
+ onToolUse?(ctx: ToolUseContext): ToolUseContext;
28
+ onToolResult?(ctx: ToolResultContext): ToolResultContext;
29
+ onError?(ctx: ErrorContext): ErrorContext;
30
+ }
31
+ /**
32
+ * Request-time context. Transforms modify this to configure SDK behavior.
33
+ * Immutable-in, modified-out — transforms return a new object.
34
+ */
35
+ export interface RequestContext {
36
+ /** Adapter name (readonly — set by pipeline runner) */
37
+ readonly adapter: string;
38
+ /** Raw request body (readonly — use specific fields to modify) */
39
+ readonly body: any;
40
+ /** Request headers (readonly) */
41
+ readonly headers: Headers;
42
+ model: string;
43
+ messages: any[];
44
+ systemContext?: string;
45
+ tools?: any[];
46
+ stream: boolean;
47
+ workingDirectory: string;
48
+ blockedTools: readonly string[];
49
+ incompatibleTools: readonly string[];
50
+ allowedMcpTools: readonly string[];
51
+ coreToolNames?: readonly string[];
52
+ sdkAgents: Record<string, any>;
53
+ sdkHooks?: any;
54
+ passthrough?: boolean;
55
+ settingSources?: SettingSource[];
56
+ supportsThinking: boolean;
57
+ shouldTrackFileChanges: boolean;
58
+ leaksCwdViaSystemReminder: boolean;
59
+ prefersStreaming?: boolean;
60
+ extractFileChangesFromToolUse?: (toolName: string, toolInput: unknown) => FileChange[];
61
+ metadata: Record<string, unknown>;
62
+ }
63
+ /**
64
+ * Response-time context. Transforms can modify response content.
65
+ */
66
+ export interface ResponseContext {
67
+ readonly adapter: string;
68
+ content: any[];
69
+ usage?: any;
70
+ metadata: Record<string, unknown>;
71
+ }
72
+ /**
73
+ * Telemetry context. Observe-only — return value is ignored.
74
+ */
75
+ export interface TelemetryContext {
76
+ readonly adapter: string;
77
+ readonly model: string;
78
+ readonly requestId: string;
79
+ readonly durationMs: number;
80
+ readonly inputTokens: number;
81
+ readonly outputTokens: number;
82
+ readonly cacheReadTokens: number;
83
+ readonly cacheCreationTokens: number;
84
+ readonly cacheHitRate: number;
85
+ }
86
+ export interface SessionContext {
87
+ readonly adapter: string;
88
+ [key: string]: unknown;
89
+ }
90
+ export interface ToolUseContext {
91
+ readonly adapter: string;
92
+ [key: string]: unknown;
93
+ }
94
+ export interface ToolResultContext {
95
+ readonly adapter: string;
96
+ [key: string]: unknown;
97
+ }
98
+ export interface ErrorContext {
99
+ readonly adapter: string;
100
+ [key: string]: unknown;
101
+ }
102
+ /** Hook names that transform request/response data (return value used) */
103
+ export type TransformHook = "onRequest" | "onResponse" | "onSession" | "onToolUse" | "onToolResult" | "onError";
104
+ /** Hook names that are observe-only (return value ignored) */
105
+ export type ObserveHook = "onTelemetry";
106
+ /**
107
+ * Run a data-transforming hook through the pipeline.
108
+ * Each transform receives the previous transform's output.
109
+ * Transforms scoped to other adapters are skipped.
110
+ */
111
+ export declare function runTransformHook<T>(transforms: readonly Transform[], hook: TransformHook, ctx: T, adapterName: string): T;
112
+ /**
113
+ * Run an observe-only hook through the pipeline.
114
+ * All matching transforms are called; return values are ignored.
115
+ */
116
+ export declare function runObserveHook<T>(transforms: readonly Transform[], hook: ObserveHook, ctx: T, adapterName: string): void;
117
+ /**
118
+ * Build the ordered transform pipeline for a request.
119
+ * Adapter built-in transforms run first, then plugins in config order.
120
+ */
121
+ export declare function buildPipeline(adapterTransforms: readonly Transform[], pluginTransforms: readonly Transform[]): Transform[];
122
+ /**
123
+ * Create the initial RequestContext from HTTP request data.
124
+ * Adapter transforms will populate SDK configuration fields.
125
+ */
126
+ export declare function createRequestContext(params: {
127
+ adapter: string;
128
+ body: any;
129
+ headers: Headers;
130
+ model: string;
131
+ messages: any[];
132
+ systemContext?: string;
133
+ tools?: any[];
134
+ stream: boolean;
135
+ workingDirectory: string;
136
+ }): RequestContext;
137
+ //# sourceMappingURL=transform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../src/proxy/transform.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAGnE;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAA;IACZ,iCAAiC;IACjC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IAGnB,SAAS,CAAC,CAAC,GAAG,EAAE,cAAc,GAAG,cAAc,CAAA;IAC/C,UAAU,CAAC,CAAC,GAAG,EAAE,eAAe,GAAG,eAAe,CAAA;IAClD,WAAW,CAAC,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAAA;IAGzC,SAAS,CAAC,CAAC,GAAG,EAAE,cAAc,GAAG,cAAc,CAAA;IAC/C,SAAS,CAAC,CAAC,GAAG,EAAE,cAAc,GAAG,cAAc,CAAA;IAC/C,YAAY,CAAC,CAAC,GAAG,EAAE,iBAAiB,GAAG,iBAAiB,CAAA;IACxD,OAAO,CAAC,CAAC,GAAG,EAAE,YAAY,GAAG,YAAY,CAAA;CAC1C;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,uDAAuD;IACvD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,kEAAkE;IAClE,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAA;IAClB,iCAAiC;IACjC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IAGzB,KAAK,EAA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AAG,EAAE,CAAC,EACN,WAAW,EAAE,MAAM,GAClB,IAAI,CAeN;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,iBAAiB,EAAE,SAAS,SAAS,EAAE,EACvC,gBAAgB,EAAE,SAAS,SAAS,EAAE,GACrC,SAAS,EAAE,CAEb;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE;IAC3C,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,GAAG,CAAA;IACT,OAAO,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,GAAG,EAAE,CAAA;IACf,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,GAAG,EAAE,CAAA;IACb,MAAM,EAAE,OAAO,CAAA;IACf,gBAAgB,EAAE,MAAM,CAAA;CACzB,GAAG,cAAc,CAqBjB"}
@@ -0,0 +1,3 @@
1
+ import type { Transform } from "../transform";
2
+ export declare const crushTransforms: Transform[];
3
+ //# sourceMappingURL=crush.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crush.d.ts","sourceRoot":"","sources":["../../../src/proxy/transforms/crush.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,cAAc,CAAA;AAc7D,eAAO,MAAM,eAAe,EAAE,SAAS,EAyBtC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { Transform } from "../transform";
2
+ export declare const droidTransforms: Transform[];
3
+ //# sourceMappingURL=droid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"droid.d.ts","sourceRoot":"","sources":["../../../src/proxy/transforms/droid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,cAAc,CAAA;AAa7D,eAAO,MAAM,eAAe,EAAE,SAAS,EAgBtC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { Transform } from "../transform";
2
+ export declare const forgeCodeTransforms: Transform[];
3
+ //# sourceMappingURL=forgecode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forgecode.d.ts","sourceRoot":"","sources":["../../../src/proxy/transforms/forgecode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,cAAc,CAAA;AAc7D,eAAO,MAAM,mBAAmB,EAAE,SAAS,EAwB1C,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { Transform } from "../transform";
2
+ export declare const openCodeTransforms: Transform[];
3
+ //# sourceMappingURL=opencode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opencode.d.ts","sourceRoot":"","sources":["../../../src/proxy/transforms/opencode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,cAAc,CAAA;AAM7D,eAAO,MAAM,kBAAkB,EAAE,SAAS,EA2FzC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { Transform } from "../transform";
2
+ export declare const passthroughTransforms: Transform[];
3
+ //# sourceMappingURL=passthrough.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"passthrough.d.ts","sourceRoot":"","sources":["../../../src/proxy/transforms/passthrough.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,cAAc,CAAA;AAY7D,eAAO,MAAM,qBAAqB,EAAE,SAAS,EAgB5C,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { Transform } from "../transform";
2
+ export declare const piTransforms: Transform[];
3
+ //# sourceMappingURL=pi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pi.d.ts","sourceRoot":"","sources":["../../../src/proxy/transforms/pi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,cAAc,CAAA;AAc7D,eAAO,MAAM,YAAY,EAAE,SAAS,EAyBnC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import type { Transform } from "../transform";
2
+ export declare function getAdapterTransforms(adapterName: string): readonly Transform[];
3
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/proxy/transforms/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAiB7C,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS,SAAS,EAAE,CAE9E"}
@@ -12,6 +12,10 @@ export interface ProxyConfig {
12
12
  defaultProfile?: string;
13
13
  /** Package version, exposed via /health endpoint */
14
14
  version?: string;
15
+ /** Plugin auto-discovery directory. Defaults to ~/.config/meridian/plugins/. */
16
+ pluginDir?: string;
17
+ /** Plugin config file path. Defaults to ~/.config/meridian/plugins.json. */
18
+ pluginConfigPath?: string;
15
19
  }
16
20
  export interface ProxyInstance {
17
21
  /** The underlying http.Server */
@@ -29,6 +33,8 @@ export interface ProxyServer {
29
33
  };
30
34
  /** The resolved proxy configuration */
31
35
  config: ProxyConfig;
36
+ /** Load plugins from disk and wire them into the request pipeline */
37
+ initPlugins?(): Promise<void>;
32
38
  }
33
39
  export declare const DEFAULT_PROXY_CONFIG: ProxyConfig;
34
40
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/proxy/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,OAAO,CAAA;IACd,kBAAkB,EAAE,MAAM,CAAA;IAC1B,MAAM,EAAE,OAAO,CAAA;IACf,oDAAoD;IACpD,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAA;IAC1B,gDAAgD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Aa;IAC5B,iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,uCAAuC;IACvC,MAAM,EAAE,WAAW,CAAA;IACnB,mEAAmE;IACnE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACvB;AAED,oFAAoF;AACpF,MAAM,WAAW,WAAW;IAC1B,+DAA+D;IAC/D,GAAG,EAAE;QAAE,KAAK,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;KAAE,CAAA;IAClF,uCAAuC;IACvC,MAAM,EAAE,WAAW,CAAA;IACnB,qEAAqE;IACrE,WAAW,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAC9B;AAED,eAAO,MAAM,oBAAoB,EAAE,WASlC,CAAA"}
package/dist/server.js CHANGED
@@ -1,24 +1,33 @@
1
1
  import {
2
+ buildPipeline,
2
3
  clearSessionCache,
3
4
  computeLineageHash,
4
5
  computeMessageHashes,
5
6
  createProxyServer,
7
+ createRequestContext,
6
8
  getMaxSessionsLimit,
7
9
  hashMessage,
10
+ runObserveHook,
11
+ runTransformHook,
8
12
  startProxyServer
9
- } from "./cli-z5r7ptsm.js";
10
- import"./cli-pr79d7nw.js";
11
- import"./cli-rtab0qa6.js";
12
- import"./cli-m9pfb7h9.js";
13
+ } from "./cli-bfgya0hb.js";
13
14
  import"./cli-vdp9s10c.js";
15
+ import"./cli-sry5aqdj.js";
16
+ import"./cli-4rqtm83g.js";
14
17
  import"./cli-340h1chz.js";
18
+ import"./cli-rtab0qa6.js";
19
+ import"./cli-m9pfb7h9.js";
15
20
  import"./cli-p9swy5t3.js";
16
21
  export {
17
22
  startProxyServer,
23
+ runTransformHook,
24
+ runObserveHook,
18
25
  hashMessage,
19
26
  getMaxSessionsLimit,
27
+ createRequestContext,
20
28
  createProxyServer,
21
29
  computeMessageHashes,
22
30
  computeLineageHash,
23
- clearSessionCache
31
+ clearSessionCache,
32
+ buildPipeline
24
33
  };
@@ -0,0 +1,17 @@
1
+ import {
2
+ getPluginStats,
3
+ isTrackedPlugin,
4
+ recordError,
5
+ recordInvocation,
6
+ registerPluginStats,
7
+ resetAllPluginStats
8
+ } from "./cli-sry5aqdj.js";
9
+ import"./cli-p9swy5t3.js";
10
+ export {
11
+ resetAllPluginStats,
12
+ registerPluginStats,
13
+ recordInvocation,
14
+ recordError,
15
+ isTrackedPlugin,
16
+ getPluginStats
17
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/telemetry/dashboard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,eAAO,MAAM,aAAa,QA6VlB,CAAA"}
1
+ {"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/telemetry/dashboard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,eAAO,MAAM,aAAa,QA0VlB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"landing.d.ts","sourceRoot":"","sources":["../../src/telemetry/landing.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,eAAO,MAAM,WAAW,QAyHhB,CAAA"}
1
+ {"version":3,"file":"landing.d.ts","sourceRoot":"","sources":["../../src/telemetry/landing.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,eAAO,MAAM,WAAW,QAoHhB,CAAA"}
@@ -5,7 +5,19 @@
5
5
  * are configured. Profile changes take effect immediately via
6
6
  * POST /profiles/active — no page reload needed.
7
7
  */
8
+ /**
9
+ * Canonical Meridian theme — purple brand palette.
10
+ *
11
+ * Every inline HTML page (landing, telemetry dashboard, profiles,
12
+ * settings, plugins) prepends this block before its own styles so
13
+ * `var(--bg)`, `var(--accent)` etc. resolve consistently everywhere.
14
+ *
15
+ * Extra variables (--queue, --ttfb, --upstream, --blue, --purple) exist
16
+ * so the telemetry waterfall and lineage-colored badges keep their
17
+ * semantic meaning without needing per-page overrides.
18
+ */
19
+ export declare const themeCss = "\n :root {\n /* Cool-gray neutral palette \u2014 matches the original dashboard/profiles/\n settings look. Better for data-dense dashboards: high contrast,\n surface/border separation, no color cast muddying the text. Purple\n accents are retained as secondary brand color for hover states,\n gradients, and a handful of telemetry badges. */\n --bg: #0d1117;\n --surface: #161b22;\n --surface2: #1c2128;\n --border: #30363d;\n /* Text */\n --text: #e6edf3;\n --muted: #8b949e;\n /* Brand \u2014 blue primary, purple secondary */\n --accent: #58a6ff;\n --accent2: #bc8cff;\n --violet: #bc8cff;\n --lavender: #d2a8ff;\n /* Semantic */\n --green: #3fb950;\n --yellow: #d29922;\n --red: #f85149;\n /* Telemetry-specific aliases (waterfall + lineage badges) */\n --blue: #58a6ff;\n --purple: #bc8cff;\n --queue: #d29922;\n --ttfb: #58a6ff;\n --upstream: #3fb950;\n }\n";
8
20
  export declare const profileBarCss = "\n .meridian-profile-bar {\n position: sticky; top: 0; z-index: 100;\n display: none; align-items: center; gap: 12px;\n padding: 8px 24px;\n background: rgba(13, 17, 23, 0.92);\n backdrop-filter: blur(12px);\n border-bottom: 1px solid var(--border, #30363d);\n font-size: 12px;\n color: var(--muted, #8b949e);\n }\n .meridian-profile-bar.visible { display: flex; }\n .meridian-profile-bar .profile-label {\n font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px;\n font-size: 10px; color: var(--muted, #8b949e);\n }\n .meridian-profile-bar select {\n background: var(--surface, #161b22); color: var(--text, #e6edf3);\n border: 1px solid var(--border, #30363d); border-radius: 6px;\n padding: 4px 24px 4px 10px; font-size: 12px; cursor: pointer;\n appearance: none;\n background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%238b949e' stroke-width='1.5'/%3E%3C/svg%3E\");\n background-repeat: no-repeat; background-position: right 6px center;\n }\n .meridian-profile-bar select:hover { border-color: var(--accent, #58a6ff); }\n .meridian-profile-bar select:focus { outline: none; border-color: var(--accent, #58a6ff); box-shadow: 0 0 0 1px var(--accent, #58a6ff); }\n .meridian-profile-bar .profile-status {\n font-size: 11px; color: var(--green, #3fb950); opacity: 0;\n transition: opacity 0.3s;\n }\n .meridian-profile-bar .profile-status.show { opacity: 1; }\n .meridian-profile-bar .profile-type {\n font-size: 10px; padding: 2px 8px; border-radius: 4px;\n background: var(--surface, #161b22); border: 1px solid var(--border, #30363d);\n }\n .meridian-profile-bar .spacer { flex: 1; }\n .meridian-profile-bar .profile-nav a {\n color: var(--muted, #8b949e); text-decoration: none; font-size: 11px;\n padding: 4px 8px; border-radius: 4px; transition: color 0.15s;\n }\n .meridian-profile-bar .profile-nav a:hover { color: var(--text, #e6edf3); }\n .meridian-profile-bar .profile-nav a.active { color: var(--accent, #58a6ff); }\n";
9
- export declare const profileBarHtml = "\n<div class=\"meridian-profile-bar\" id=\"meridianProfileBar\">\n <span class=\"profile-label\">Profile</span>\n <select id=\"meridianProfileSelect\"></select>\n <span class=\"profile-type\" id=\"meridianProfileType\"></span>\n <span class=\"profile-status\" id=\"meridianProfileStatus\">\u2713 Switched</span>\n <div class=\"spacer\"></div>\n <div class=\"profile-nav\">\n <a href=\"/\" id=\"nav-home\">Home</a>\n <a href=\"/settings\" id=\"nav-settings\">Settings</a>\n <a href=\"/profiles\" id=\"nav-profiles\">Profiles</a>\n <a href=\"/telemetry\" id=\"nav-telemetry\">Telemetry</a>\n </div>\n</div>\n";
21
+ export declare const profileBarHtml = "\n<div class=\"meridian-profile-bar\" id=\"meridianProfileBar\">\n <span class=\"profile-label\">Profile</span>\n <select id=\"meridianProfileSelect\"></select>\n <span class=\"profile-type\" id=\"meridianProfileType\"></span>\n <span class=\"profile-status\" id=\"meridianProfileStatus\">\u2713 Switched</span>\n <div class=\"spacer\"></div>\n <div class=\"profile-nav\">\n <a href=\"/\" id=\"nav-home\">Home</a>\n <a href=\"/settings\" id=\"nav-settings\">Settings</a>\n <a href=\"/profiles\" id=\"nav-profiles\">Profiles</a>\n <a href=\"/telemetry\" id=\"nav-telemetry\">Telemetry</a>\n <a href=\"/plugins\" id=\"nav-plugins\">Plugins</a>\n </div>\n</div>\n";
10
22
  export declare const profileBarJs = "\n(function() {\n var profileBar = document.getElementById('meridianProfileBar');\n var profileSelect = document.getElementById('meridianProfileSelect');\n var profileType = document.getElementById('meridianProfileType');\n var profileStatus = document.getElementById('meridianProfileStatus');\n var statusTimeout;\n\n // Highlight active nav link\n var path = location.pathname;\n var navLinks = document.querySelectorAll('.profile-nav a');\n navLinks.forEach(function(a) {\n if (a.getAttribute('href') === path || (path === '/telemetry' && a.id === 'nav-telemetry') || (path === '/' && a.id === 'nav-home')) {\n a.classList.add('active');\n }\n });\n\n function esc(s) { var d = document.createElement('div'); d.textContent = s; return d.innerHTML; }\n\n function loadProfiles() {\n fetch('/profiles/list').then(function(r) { return r.json(); }).then(function(data) {\n if (!data.profiles || data.profiles.length === 0) {\n profileBar.classList.remove('visible');\n return;\n }\n profileBar.classList.add('visible');\n var current = data.profiles.find(function(p) { return p.isActive; });\n profileSelect.innerHTML = data.profiles.map(function(p) {\n return '<option value=\"' + esc(p.id) + '\"' + (p.isActive ? ' selected' : '') + '>' + esc(p.id) + '</option>';\n }).join('');\n if (current) profileType.textContent = current.type;\n }).catch(function() {});\n }\n\n profileSelect.onchange = function() {\n fetch('/profiles/active', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ profile: profileSelect.value })\n }).then(function(r) { return r.json(); }).then(function(data) {\n if (data.success) {\n profileStatus.classList.add('show');\n clearTimeout(statusTimeout);\n statusTimeout = setTimeout(function() { profileStatus.classList.remove('show'); }, 2000);\n loadProfiles();\n }\n }).catch(function() {});\n };\n\n loadProfiles();\n setInterval(loadProfiles, 10000);\n})();\n";
11
23
  //# sourceMappingURL=profileBar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"profileBar.d.ts","sourceRoot":"","sources":["../../src/telemetry/profileBar.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,aAAa,wmEA0CzB,CAAA;AAED,eAAO,MAAM,cAAc,snBAc1B,CAAA;AAED,eAAO,MAAM,YAAY,yiEAoDxB,CAAA"}
1
+ {"version":3,"file":"profileBar.d.ts","sourceRoot":"","sources":["../../src/telemetry/profileBar.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,igCA8BpB,CAAA;AAED,eAAO,MAAM,aAAa,wmEA0CzB,CAAA;AAED,eAAO,MAAM,cAAc,+qBAe1B,CAAA;AAED,eAAO,MAAM,YAAY,yiEAoDxB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"profilePage.d.ts","sourceRoot":"","sources":["../../src/telemetry/profilePage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,eAAO,MAAM,eAAe,QAuQpB,CAAA"}
1
+ {"version":3,"file":"profilePage.d.ts","sourceRoot":"","sources":["../../src/telemetry/profilePage.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,eAAO,MAAM,eAAe,QAkQpB,CAAA"}