@relayplane/proxy 0.1.9 → 0.2.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.
@@ -0,0 +1,315 @@
1
+ "use strict";
2
+ /**
3
+ * RelayPlane Proxy Telemetry
4
+ *
5
+ * Anonymized telemetry collection for improving model routing.
6
+ *
7
+ * What we collect (exact schema):
8
+ * - device_id: anonymous random ID
9
+ * - task_type: inferred from token patterns, NOT prompt content
10
+ * - model: which model was used
11
+ * - tokens_in/out: token counts
12
+ * - latency_ms: response time
13
+ * - success: whether request succeeded
14
+ * - cost_usd: estimated cost
15
+ *
16
+ * What we NEVER collect:
17
+ * - Prompts or responses
18
+ * - File paths or contents
19
+ * - Anything that could identify you or your project
20
+ *
21
+ * @packageDocumentation
22
+ */
23
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
24
+ if (k2 === undefined) k2 = k;
25
+ var desc = Object.getOwnPropertyDescriptor(m, k);
26
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
27
+ desc = { enumerable: true, get: function() { return m[k]; } };
28
+ }
29
+ Object.defineProperty(o, k2, desc);
30
+ }) : (function(o, m, k, k2) {
31
+ if (k2 === undefined) k2 = k;
32
+ o[k2] = m[k];
33
+ }));
34
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
35
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
36
+ }) : function(o, v) {
37
+ o["default"] = v;
38
+ });
39
+ var __importStar = (this && this.__importStar) || (function () {
40
+ var ownKeys = function(o) {
41
+ ownKeys = Object.getOwnPropertyNames || function (o) {
42
+ var ar = [];
43
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
44
+ return ar;
45
+ };
46
+ return ownKeys(o);
47
+ };
48
+ return function (mod) {
49
+ if (mod && mod.__esModule) return mod;
50
+ var result = {};
51
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
52
+ __setModuleDefault(result, mod);
53
+ return result;
54
+ };
55
+ })();
56
+ Object.defineProperty(exports, "__esModule", { value: true });
57
+ exports.inferTaskType = inferTaskType;
58
+ exports.estimateCost = estimateCost;
59
+ exports.setAuditMode = setAuditMode;
60
+ exports.isAuditMode = isAuditMode;
61
+ exports.setOfflineMode = setOfflineMode;
62
+ exports.isOfflineMode = isOfflineMode;
63
+ exports.getAuditBuffer = getAuditBuffer;
64
+ exports.clearAuditBuffer = clearAuditBuffer;
65
+ exports.recordTelemetry = recordTelemetry;
66
+ exports.getLocalTelemetry = getLocalTelemetry;
67
+ exports.getTelemetryStats = getTelemetryStats;
68
+ exports.clearTelemetry = clearTelemetry;
69
+ exports.getTelemetryPath = getTelemetryPath;
70
+ exports.printTelemetryDisclosure = printTelemetryDisclosure;
71
+ const fs = __importStar(require("fs"));
72
+ const path = __importStar(require("path"));
73
+ const config_js_1 = require("./config.js");
74
+ /**
75
+ * Local telemetry store using SQLite (via Ledger)
76
+ */
77
+ const TELEMETRY_FILE = path.join((0, config_js_1.getConfigDir)(), 'telemetry.jsonl');
78
+ // In-memory buffer for audit mode
79
+ let auditBuffer = [];
80
+ let auditMode = false;
81
+ let offlineMode = false;
82
+ /**
83
+ * Task type inference based on token patterns
84
+ * This infers task type from request characteristics, NOT from prompt content
85
+ */
86
+ function inferTaskType(inputTokens, outputTokens, model, hasTools = false) {
87
+ // Simple heuristics based on token patterns
88
+ const ratio = outputTokens / Math.max(inputTokens, 1);
89
+ if (hasTools) {
90
+ return 'tool_use';
91
+ }
92
+ if (inputTokens > 10000) {
93
+ return 'long_context';
94
+ }
95
+ if (ratio > 5) {
96
+ return 'generation';
97
+ }
98
+ if (ratio < 0.3 && outputTokens < 100) {
99
+ return 'classification';
100
+ }
101
+ if (inputTokens < 500 && outputTokens < 500) {
102
+ return 'quick_task';
103
+ }
104
+ if (inputTokens > 2000 && outputTokens > 500) {
105
+ return 'code_review';
106
+ }
107
+ if (outputTokens > 1000) {
108
+ return 'content_generation';
109
+ }
110
+ return 'general';
111
+ }
112
+ /**
113
+ * Estimate cost based on model and token counts
114
+ * Pricing as of 2024 (USD per 1M tokens)
115
+ */
116
+ const MODEL_PRICING = {
117
+ // Anthropic
118
+ 'claude-opus-4-20250514': { input: 15.0, output: 75.0 },
119
+ 'claude-sonnet-4-20250514': { input: 3.0, output: 15.0 },
120
+ 'claude-3-5-sonnet-20241022': { input: 3.0, output: 15.0 },
121
+ 'claude-3-5-sonnet-20240620': { input: 3.0, output: 15.0 },
122
+ 'claude-3-5-haiku-20241022': { input: 0.8, output: 4.0 },
123
+ 'claude-3-opus-20240229': { input: 15.0, output: 75.0 },
124
+ 'claude-3-sonnet-20240229': { input: 3.0, output: 15.0 },
125
+ 'claude-3-haiku-20240307': { input: 0.25, output: 1.25 },
126
+ // OpenAI
127
+ 'gpt-4o': { input: 2.5, output: 10.0 },
128
+ 'gpt-4o-mini': { input: 0.15, output: 0.60 },
129
+ 'gpt-4-turbo': { input: 10.0, output: 30.0 },
130
+ 'gpt-4': { input: 30.0, output: 60.0 },
131
+ 'gpt-3.5-turbo': { input: 0.5, output: 1.5 },
132
+ // Default for unknown models
133
+ 'default': { input: 1.0, output: 3.0 },
134
+ };
135
+ function estimateCost(model, inputTokens, outputTokens) {
136
+ const pricing = MODEL_PRICING[model] || MODEL_PRICING['default'];
137
+ const inputCost = (inputTokens / 1_000_000) * pricing.input;
138
+ const outputCost = (outputTokens / 1_000_000) * pricing.output;
139
+ return Math.round((inputCost + outputCost) * 10000) / 10000; // Round to 4 decimal places
140
+ }
141
+ /**
142
+ * Set audit mode - shows telemetry payload before sending
143
+ */
144
+ function setAuditMode(enabled) {
145
+ auditMode = enabled;
146
+ }
147
+ /**
148
+ * Check if audit mode is enabled
149
+ */
150
+ function isAuditMode() {
151
+ return auditMode;
152
+ }
153
+ /**
154
+ * Set offline mode - disables all network calls except LLM
155
+ */
156
+ function setOfflineMode(enabled) {
157
+ offlineMode = enabled;
158
+ }
159
+ /**
160
+ * Check if offline mode is enabled
161
+ */
162
+ function isOfflineMode() {
163
+ return offlineMode;
164
+ }
165
+ /**
166
+ * Get pending audit events
167
+ */
168
+ function getAuditBuffer() {
169
+ return [...auditBuffer];
170
+ }
171
+ /**
172
+ * Clear audit buffer
173
+ */
174
+ function clearAuditBuffer() {
175
+ auditBuffer = [];
176
+ }
177
+ /**
178
+ * Record a telemetry event
179
+ */
180
+ function recordTelemetry(event) {
181
+ if (!(0, config_js_1.isTelemetryEnabled)() && !auditMode) {
182
+ return; // Telemetry disabled and not in audit mode
183
+ }
184
+ const fullEvent = {
185
+ ...event,
186
+ device_id: (0, config_js_1.getDeviceId)(),
187
+ timestamp: new Date().toISOString(),
188
+ };
189
+ if (auditMode) {
190
+ // In audit mode, buffer events and print them
191
+ auditBuffer.push(fullEvent);
192
+ console.log('\n📊 [TELEMETRY AUDIT] The following data would be collected:');
193
+ console.log(JSON.stringify(fullEvent, null, 2));
194
+ console.log('');
195
+ return;
196
+ }
197
+ if (!(0, config_js_1.isTelemetryEnabled)()) {
198
+ return;
199
+ }
200
+ // Store locally (append to JSONL file)
201
+ try {
202
+ const configDir = (0, config_js_1.getConfigDir)();
203
+ if (!fs.existsSync(configDir)) {
204
+ fs.mkdirSync(configDir, { recursive: true });
205
+ }
206
+ fs.appendFileSync(TELEMETRY_FILE, JSON.stringify(fullEvent) + '\n');
207
+ }
208
+ catch (err) {
209
+ // Silently fail - telemetry should never break the proxy
210
+ }
211
+ }
212
+ /**
213
+ * Get local telemetry data
214
+ */
215
+ function getLocalTelemetry() {
216
+ try {
217
+ if (!fs.existsSync(TELEMETRY_FILE)) {
218
+ return [];
219
+ }
220
+ const data = fs.readFileSync(TELEMETRY_FILE, 'utf-8');
221
+ return data
222
+ .split('\n')
223
+ .filter(line => line.trim())
224
+ .map(line => JSON.parse(line));
225
+ }
226
+ catch (err) {
227
+ return [];
228
+ }
229
+ }
230
+ /**
231
+ * Get telemetry stats summary
232
+ */
233
+ function getTelemetryStats() {
234
+ const events = getLocalTelemetry();
235
+ const byModel = {};
236
+ const byTaskType = {};
237
+ let totalCost = 0;
238
+ let successCount = 0;
239
+ for (const event of events) {
240
+ totalCost += event.cost_usd;
241
+ if (event.success)
242
+ successCount++;
243
+ if (!byModel[event.model]) {
244
+ byModel[event.model] = { count: 0, cost: 0 };
245
+ }
246
+ byModel[event.model].count++;
247
+ byModel[event.model].cost += event.cost_usd;
248
+ if (!byTaskType[event.task_type]) {
249
+ byTaskType[event.task_type] = { count: 0, cost: 0 };
250
+ }
251
+ byTaskType[event.task_type].count++;
252
+ byTaskType[event.task_type].cost += event.cost_usd;
253
+ }
254
+ return {
255
+ totalEvents: events.length,
256
+ totalCost: Math.round(totalCost * 100) / 100,
257
+ byModel,
258
+ byTaskType,
259
+ successRate: events.length > 0 ? successCount / events.length : 0,
260
+ };
261
+ }
262
+ /**
263
+ * Clear all local telemetry data
264
+ */
265
+ function clearTelemetry() {
266
+ try {
267
+ if (fs.existsSync(TELEMETRY_FILE)) {
268
+ fs.unlinkSync(TELEMETRY_FILE);
269
+ }
270
+ }
271
+ catch (err) {
272
+ // Silently fail
273
+ }
274
+ }
275
+ /**
276
+ * Get telemetry file path
277
+ */
278
+ function getTelemetryPath() {
279
+ return TELEMETRY_FILE;
280
+ }
281
+ /**
282
+ * Print telemetry disclosure message
283
+ */
284
+ function printTelemetryDisclosure() {
285
+ console.log(`
286
+ ╭─────────────────────────────────────────────────────────────────────╮
287
+ │ 📊 TELEMETRY DISCLOSURE │
288
+ ╰─────────────────────────────────────────────────────────────────────╯
289
+
290
+ RelayPlane collects anonymous telemetry to improve model routing.
291
+
292
+ What we collect:
293
+ • Anonymous device ID (random, not fingerprintable)
294
+ • Task type (inferred from token patterns, NOT your prompts)
295
+ • Model used, token counts, latency, success/failure
296
+ • Estimated cost
297
+
298
+ What we NEVER collect:
299
+ • Your prompts or model responses
300
+ • File paths or contents
301
+ • Anything that could identify you or your project
302
+
303
+ How to verify:
304
+ • Run with --audit to see exact payloads before they're sent
305
+ • Run with --offline to disable all telemetry transmission
306
+ • Full source code: https://github.com/RelayPlane/proxy
307
+
308
+ To opt out completely:
309
+ $ relayplane-proxy telemetry off
310
+
311
+ Learn more: https://relayplane.com/privacy
312
+
313
+ `);
314
+ }
315
+ //# sourceMappingURL=telemetry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDH,sCAsCC;AA4BD,oCAKC;AAKD,oCAEC;AAKD,kCAEC;AAKD,wCAEC;AAKD,sCAEC;AAKD,wCAEC;AAKD,4CAEC;AAKD,0CAmCC;AAKD,8CAcC;AAKD,8CAsCC;AAKD,wCAQC;AAKD,4CAEC;AAKD,4DA8BC;AAhUD,uCAAyB;AACzB,2CAA6B;AAC7B,2CAA4E;AAkC5E;;GAEG;AACH,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,IAAA,wBAAY,GAAE,EAAE,iBAAiB,CAAC,CAAC;AAEpE,kCAAkC;AAClC,IAAI,WAAW,GAAqB,EAAE,CAAC;AACvC,IAAI,SAAS,GAAG,KAAK,CAAC;AACtB,IAAI,WAAW,GAAG,KAAK,CAAC;AAExB;;;GAGG;AACH,SAAgB,aAAa,CAC3B,WAAmB,EACnB,YAAoB,EACpB,KAAa,EACb,WAAoB,KAAK;IAEzB,4CAA4C;IAC5C,MAAM,KAAK,GAAG,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IAEtD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,IAAI,WAAW,GAAG,KAAK,EAAE,CAAC;QACxB,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,IAAI,KAAK,GAAG,C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,CAAC;YACjC,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QACtD,CAAC;QACD,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,CAAC;QACpC,UAAU,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,IAAI,KAAK,CAAC,QAAQ,CAAC;IACrD,CAAC;IAED,OAAO;QACL,WAAW,EAAE,MAAM,CAAC,MAAM;QAC1B,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,GAAG,CAAC,GAAG,GAAG;QAC5C,OAAO;QACP,UAAU;QACV,WAAW,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KAClE,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,cAAc;IAC5B,IAAI,CAAC;QACH,IAAI,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;YAClC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;QAChC,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,gBAAgB;IAClB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,gBAAgB;IAC9B,OAAO,cAAc,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,SAAgB,wBAAwB;IACtC,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4Bb,CAAC,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,76 +1,51 @@
1
1
  {
2
2
  "name": "@relayplane/proxy",
3
- "version": "0.1.9",
4
- "description": "RelayPlane Proxy - Intelligent AI model routing for cost optimization. 100% local, zero cloud dependency.",
5
- "main": "./dist/index.js",
6
- "module": "./dist/index.mjs",
7
- "types": "./dist/index.d.ts",
3
+ "version": "0.2.0",
4
+ "description": "RelayPlane proxy server - intelligent AI model routing with observability",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
8
7
  "bin": {
9
- "relayplane-proxy": "./dist/cli.js"
10
- },
11
- "exports": {
12
- ".": {
13
- "types": "./dist/index.d.ts",
14
- "import": "./dist/index.mjs",
15
- "require": "./dist/index.js"
16
- }
8
+ "relayplane-proxy": "dist/cli.js"
17
9
  },
18
10
  "scripts": {
19
- "build": "tsup",
20
- "dev": "tsup --watch",
11
+ "build": "tsc",
12
+ "dev": "tsc --watch",
21
13
  "start": "node dist/cli.js",
22
14
  "test": "vitest run",
23
- "test:watch": "vitest",
24
- "lint": "eslint src --ext .ts",
25
- "type-check": "tsc --noEmit",
26
- "clean": "rm -rf dist"
15
+ "test:watch": "vitest"
27
16
  },
28
17
  "keywords": [
29
18
  "relayplane",
30
- "proxy",
31
19
  "ai",
32
20
  "llm",
21
+ "proxy",
33
22
  "routing",
34
- "cost-optimization",
35
23
  "anthropic",
36
24
  "openai",
37
25
  "gemini",
38
- "grok",
39
- "moonshot",
40
- "local-first",
41
26
  "openclaw",
42
- "cursor",
43
- "aider"
27
+ "observability",
28
+ "agent-ops"
44
29
  ],
45
30
  "author": "RelayPlane",
46
31
  "license": "MIT",
47
- "homepage": "https://relayplane.com/integrations/openclaw",
48
- "repository": {
49
- "type": "git",
50
- "url": "https://github.com/RelayPlane/proxy.git"
51
- },
52
- "bugs": "https://github.com/RelayPlane/proxy/issues",
53
- "publishConfig": {
54
- "access": "public",
55
- "registry": "https://registry.npmjs.org/"
56
- },
57
- "files": [
58
- "dist",
59
- "README.md",
60
- "LICENSE"
61
- ],
62
32
  "dependencies": {
63
- "better-sqlite3": "^11.0.0",
64
- "zod": "^3.22.0"
33
+ "@relayplane/core": "workspace:*",
34
+ "@relayplane/openclaw": "workspace:*",
35
+ "@relayplane/ledger": "workspace:*",
36
+ "@relayplane/auth-gate": "workspace:*",
37
+ "@relayplane/policy-engine": "workspace:*",
38
+ "@relayplane/routing-engine": "workspace:*",
39
+ "@relayplane/explainability": "workspace:*"
65
40
  },
66
41
  "devDependencies": {
67
- "@types/better-sqlite3": "^7.6.8",
68
- "@types/node": "^20.10.0",
69
- "tsup": "^8.5.1",
70
42
  "typescript": "^5.3.3",
71
43
  "vitest": "^1.1.0"
72
44
  },
73
45
  "engines": {
74
46
  "node": ">=18"
47
+ },
48
+ "publishConfig": {
49
+ "access": "public"
75
50
  }
76
51
  }