@relayplane/proxy 1.8.35 → 1.8.37
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.
- package/LICENSE +21 -0
- package/README.md +9 -7
- package/dist/cli.js +0 -0
- package/dist/osmosis-store.d.ts +4 -1
- package/dist/osmosis-store.d.ts.map +1 -1
- package/dist/osmosis-store.js +18 -4
- package/dist/osmosis-store.js.map +1 -1
- package/dist/session-tracker.d.ts +61 -0
- package/dist/session-tracker.d.ts.map +1 -0
- package/dist/session-tracker.js +262 -0
- package/dist/session-tracker.js.map +1 -0
- package/dist/standalone-proxy.d.ts.map +1 -1
- package/dist/standalone-proxy.js +205 -5
- package/dist/standalone-proxy.js.map +1 -1
- package/package.json +13 -14
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Turley Designs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -41,15 +41,17 @@ relayplane start
|
|
|
41
41
|
|
|
42
42
|
Works with any agent framework that talks to OpenAI or Anthropic APIs. Point your client at `http://localhost:4100` (set `ANTHROPIC_BASE_URL` or `OPENAI_BASE_URL`) and the proxy handles the rest.
|
|
43
43
|
|
|
44
|
-
## What's New in v1.8.
|
|
44
|
+
## What's New in v1.8.35
|
|
45
45
|
|
|
46
|
-
**
|
|
46
|
+
**Recent additions:**
|
|
47
47
|
|
|
48
|
-
- **
|
|
49
|
-
- **
|
|
50
|
-
- **
|
|
48
|
+
- **[relayplane.com/live](https://relayplane.com/live)** — Atlas public proof-of-work dashboard showing real-time aggregate savings from developers worldwide
|
|
49
|
+
- **Osmosis Phase 1 shipped** — local telemetry capture tracks every routing decision; mesh is on by default
|
|
50
|
+
- **Service installer hardened** — detects invoking user, loads env files correctly on systemd installs
|
|
51
|
+
- **Provider-aware auto-routing** — Gemini, OpenRouter, xAI supported natively without extra config
|
|
52
|
+
- **Agent-native signup flow** — `relayplane login` handles device OAuth inline
|
|
51
53
|
|
|
52
|
-
|
|
54
|
+
**Note for upgraders from pre-v1.8.14:** Telemetry and mesh are now ON by default. Disable both: `relayplane telemetry off && relayplane mesh off`
|
|
53
55
|
|
|
54
56
|
## Supported Providers
|
|
55
57
|
|
|
@@ -590,7 +592,7 @@ Opt-in collective learning layer. Share anonymized routing signals (model, task
|
|
|
590
592
|
}
|
|
591
593
|
```
|
|
592
594
|
|
|
593
|
-
On by default
|
|
595
|
+
On by default. Opt out: `relayplane mesh off`. Free users receive provider health alerts; Pro users receive full routing intelligence.
|
|
594
596
|
|
|
595
597
|
```bash
|
|
596
598
|
relayplane mesh status # Atoms local/synced, last sync, endpoint
|
package/dist/cli.js
CHANGED
|
File without changes
|
package/dist/osmosis-store.d.ts
CHANGED
|
@@ -26,8 +26,11 @@ export type KnowledgeAtom = SuccessAtom | FailureAtom;
|
|
|
26
26
|
/**
|
|
27
27
|
* Capture a KnowledgeAtom (fire-and-forget).
|
|
28
28
|
* Never throws. Writes to SQLite; falls back to JSONL.
|
|
29
|
+
*
|
|
30
|
+
* @param atom - The knowledge atom to capture.
|
|
31
|
+
* @param sessionId - Optional session ID to associate with this atom.
|
|
29
32
|
*/
|
|
30
|
-
export declare function captureAtom(atom: KnowledgeAtom): void;
|
|
33
|
+
export declare function captureAtom(atom: KnowledgeAtom, sessionId?: string): void;
|
|
31
34
|
/** Exposed for testing — reset singleton state. */
|
|
32
35
|
export declare function _resetStore(): void;
|
|
33
36
|
//# sourceMappingURL=osmosis-store.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"osmosis-store.d.ts","sourceRoot":"","sources":["../src/osmosis-store.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"osmosis-store.d.ts","sourceRoot":"","sources":["../src/osmosis-store.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,WAAW,CAAC;AAsFtD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAuCzE;AAED,mDAAmD;AACnD,wBAAgB,WAAW,IAAI,IAAI,CAOlC"}
|
package/dist/osmosis-store.js
CHANGED
|
@@ -57,9 +57,13 @@ CREATE TABLE IF NOT EXISTS knowledge_atoms (
|
|
|
57
57
|
output_tokens INTEGER,
|
|
58
58
|
error_type TEXT,
|
|
59
59
|
fallback_taken INTEGER,
|
|
60
|
-
timestamp INTEGER NOT NULL
|
|
60
|
+
timestamp INTEGER NOT NULL,
|
|
61
|
+
session_id TEXT
|
|
61
62
|
);
|
|
62
63
|
`;
|
|
64
|
+
// Migration: add session_id column to pre-existing DBs that lack it.
|
|
65
|
+
// SQLite does not support IF NOT EXISTS for ADD COLUMN; we catch the error silently.
|
|
66
|
+
const MIGRATE_SESSION_ID_SQL = `ALTER TABLE knowledge_atoms ADD COLUMN session_id TEXT`;
|
|
63
67
|
/** Lazy-initialised SQLite database handle, or null if unavailable. */
|
|
64
68
|
let _db = undefined;
|
|
65
69
|
let _jsonlPath = null;
|
|
@@ -83,6 +87,11 @@ function initDb() {
|
|
|
83
87
|
const db = new Database(dbPath);
|
|
84
88
|
db.pragma('journal_mode = WAL');
|
|
85
89
|
db.exec(SCHEMA_SQL);
|
|
90
|
+
// Migration for pre-existing DBs created before session_id was added.
|
|
91
|
+
try {
|
|
92
|
+
db.exec(MIGRATE_SESSION_ID_SQL);
|
|
93
|
+
}
|
|
94
|
+
catch { /* column already exists */ }
|
|
86
95
|
return db;
|
|
87
96
|
}
|
|
88
97
|
catch {
|
|
@@ -96,9 +105,9 @@ function getDb() {
|
|
|
96
105
|
if (_db) {
|
|
97
106
|
_insertStmt = _db.prepare(`
|
|
98
107
|
INSERT INTO knowledge_atoms
|
|
99
|
-
(type, model, task_type, latency_ms, input_tokens, output_tokens, error_type, fallback_taken, timestamp)
|
|
108
|
+
(type, model, task_type, latency_ms, input_tokens, output_tokens, error_type, fallback_taken, timestamp, session_id)
|
|
100
109
|
VALUES
|
|
101
|
-
(@type, @model, @task_type, @latency_ms, @input_tokens, @output_tokens, @error_type, @fallback_taken, @timestamp)
|
|
110
|
+
(@type, @model, @task_type, @latency_ms, @input_tokens, @output_tokens, @error_type, @fallback_taken, @timestamp, @session_id)
|
|
102
111
|
`);
|
|
103
112
|
}
|
|
104
113
|
return _db;
|
|
@@ -122,8 +131,11 @@ function writeToJsonl(atom) {
|
|
|
122
131
|
/**
|
|
123
132
|
* Capture a KnowledgeAtom (fire-and-forget).
|
|
124
133
|
* Never throws. Writes to SQLite; falls back to JSONL.
|
|
134
|
+
*
|
|
135
|
+
* @param atom - The knowledge atom to capture.
|
|
136
|
+
* @param sessionId - Optional session ID to associate with this atom.
|
|
125
137
|
*/
|
|
126
|
-
function captureAtom(atom) {
|
|
138
|
+
function captureAtom(atom, sessionId) {
|
|
127
139
|
try {
|
|
128
140
|
const db = getDb();
|
|
129
141
|
if (db && _insertStmt) {
|
|
@@ -138,6 +150,7 @@ function captureAtom(atom) {
|
|
|
138
150
|
error_type: null,
|
|
139
151
|
fallback_taken: null,
|
|
140
152
|
timestamp: atom.timestamp,
|
|
153
|
+
session_id: sessionId ?? null,
|
|
141
154
|
});
|
|
142
155
|
}
|
|
143
156
|
else {
|
|
@@ -151,6 +164,7 @@ function captureAtom(atom) {
|
|
|
151
164
|
error_type: atom.errorType ?? null,
|
|
152
165
|
fallback_taken: atom.fallbackTaken ? 1 : 0,
|
|
153
166
|
timestamp: atom.timestamp,
|
|
167
|
+
session_id: sessionId ?? null,
|
|
154
168
|
});
|
|
155
169
|
}
|
|
156
170
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"osmosis-store.js","sourceRoot":"","sources":["../src/osmosis-store.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"osmosis-store.js","sourceRoot":"","sources":["../src/osmosis-store.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqHH,kCAuCC;AAGD,kCAOC;AApKD,4CAA8B;AAC9B,4CAA8B;AAC9B,gDAAkC;AAsBlC,MAAM,UAAU,GAAG;;;;;;;;;;;;;;CAclB,CAAC;AAEF,qEAAqE;AACrE,qFAAqF;AACrF,MAAM,sBAAsB,GAAG,wDAAwD,CAAC;AAExF,uEAAuE;AACvE,IAAI,GAAG,GAAyD,SAAS,CAAC;AAC1E,IAAI,UAAU,GAAkB,IAAI,CAAC;AACrC,IAAI,WAAW,GAA8C,IAAI,CAAC;AAElE,SAAS,gBAAgB;IACvB,8EAA8E;IAC9E,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACzD,MAAM,IAAI,GAAG,QAAQ,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;IACtC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;AACxC,CAAC;AAED,SAAS,SAAS,CAAC,GAAW;IAC5B,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SA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SAAS,EAAE,IAAI,CAAC,SAAS;oBACzB,UAAU,EAAE,SAAS,IAAI,IAAI;iBAC9B,CAAC,CAAC;YACL,CAAC;YACD,OAAO;QACT,CAAC;QACD,0CAA0C;QAC1C,YAAY,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IAAC,MAAM,CAAC;QACP,uBAAuB;QACvB,IAAI,CAAC;YAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC;IACpD,CAAC;AACH,CAAC;AAED,mDAAmD;AACnD,SAAgB,WAAW;IACzB,IAAI,GAAG,EAAE,CAAC;QACR,IAAI,CAAC;YAAC,GAAG,CAAC,KAAK,EAAE,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;IACD,GAAG,GAAG,SAAS,CAAC;IAChB,WAAW,GAAG,IAAI,CAAC;IACnB,UAAU,GAAG,IAAI,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session Intelligence — X-Claude-Code-Session-Id tracking
|
|
3
|
+
*
|
|
4
|
+
* Stores per-session aggregates in ~/.relayplane/sessions.db (SQLite via better-sqlite3).
|
|
5
|
+
* Falls back to an in-memory Map if SQLite is unavailable (e.g. no native bindings).
|
|
6
|
+
*
|
|
7
|
+
* Extracts the X-Claude-Code-Session-Id header from every request;
|
|
8
|
+
* if missing, synthesises a session ID from sha256(hour + model).slice(0,16)
|
|
9
|
+
* prefixed with "syn_".
|
|
10
|
+
*
|
|
11
|
+
* All writes are fire-and-forget; errors are silently swallowed.
|
|
12
|
+
*/
|
|
13
|
+
import type * as http from 'node:http';
|
|
14
|
+
export interface SessionEntry {
|
|
15
|
+
id: string;
|
|
16
|
+
started_at: number;
|
|
17
|
+
last_seen_at: number;
|
|
18
|
+
total_cost_usd: number;
|
|
19
|
+
total_tokens_in: number;
|
|
20
|
+
total_tokens_out: number;
|
|
21
|
+
request_count: number;
|
|
22
|
+
session_source: 'claude-code' | 'synthetic';
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Extract or synthesise a session ID from an incoming HTTP request.
|
|
26
|
+
*
|
|
27
|
+
* - If the X-Claude-Code-Session-Id header is present, use it (source = 'claude-code').
|
|
28
|
+
* - Otherwise, generate a synthetic ID: sha256(`${hourBucket}:${model}`).slice(0,16)
|
|
29
|
+
* prefixed with "syn_" (source = 'synthetic').
|
|
30
|
+
*/
|
|
31
|
+
export declare function getSessionId(req: Pick<http.IncomingMessage, 'headers'>, model?: string): {
|
|
32
|
+
sessionId: string;
|
|
33
|
+
sessionSource: 'claude-code' | 'synthetic';
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Upsert a session record, accumulating cost and token counts.
|
|
37
|
+
* Fire-and-forget; never throws. Falls back to in-memory store if SQLite unavailable.
|
|
38
|
+
*/
|
|
39
|
+
export declare function upsertSession(sessionId: string, sessionSource: 'claude-code' | 'synthetic', costUsd: number, tokensIn: number, tokensOut: number): void;
|
|
40
|
+
export interface SessionQueryOptions {
|
|
41
|
+
limit?: number;
|
|
42
|
+
days?: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Query sessions from the last N days, most-recent first, paginated.
|
|
46
|
+
* Falls back to in-memory store if SQLite unavailable.
|
|
47
|
+
*/
|
|
48
|
+
export declare function getSessions(options?: SessionQueryOptions): SessionEntry[];
|
|
49
|
+
/**
|
|
50
|
+
* Return sessions active in the last 5 minutes.
|
|
51
|
+
* Falls back to in-memory store if SQLite unavailable.
|
|
52
|
+
*/
|
|
53
|
+
export declare function getActiveSessions(): SessionEntry[];
|
|
54
|
+
/**
|
|
55
|
+
* Mark stale sessions complete — staleness is computed dynamically via
|
|
56
|
+
* last_seen_at filters, so this is a no-op exposed for API symmetry.
|
|
57
|
+
*/
|
|
58
|
+
export declare function markStaleSessionsComplete(): void;
|
|
59
|
+
/** Exposed for testing — reset singleton state. */
|
|
60
|
+
export declare function _resetStore(): void;
|
|
61
|
+
//# sourceMappingURL=session-tracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-tracker.d.ts","sourceRoot":"","sources":["../src/session-tracker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,KAAK,KAAK,IAAI,MAAM,WAAW,CAAC;AAEvC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,aAAa,GAAG,WAAW,CAAC;CAC7C;AAoED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,EAC1C,KAAK,CAAC,EAAE,MAAM,GACb;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,aAAa,GAAG,WAAW,CAAA;CAAE,CAanE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,aAAa,GAAG,WAAW,EAC1C,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAChB,IAAI,CAwCN;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,mBAAwB,GAAG,YAAY,EAAE,CA4B7E;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,YAAY,EAAE,CAwBlD;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,IAAI,CAEhD;AAED,mDAAmD;AACnD,wBAAgB,WAAW,IAAI,IAAI,CAWlC"}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Session Intelligence — X-Claude-Code-Session-Id tracking
|
|
4
|
+
*
|
|
5
|
+
* Stores per-session aggregates in ~/.relayplane/sessions.db (SQLite via better-sqlite3).
|
|
6
|
+
* Falls back to an in-memory Map if SQLite is unavailable (e.g. no native bindings).
|
|
7
|
+
*
|
|
8
|
+
* Extracts the X-Claude-Code-Session-Id header from every request;
|
|
9
|
+
* if missing, synthesises a session ID from sha256(hour + model).slice(0,16)
|
|
10
|
+
* prefixed with "syn_".
|
|
11
|
+
*
|
|
12
|
+
* All writes are fire-and-forget; errors are silently swallowed.
|
|
13
|
+
*/
|
|
14
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
+
}
|
|
20
|
+
Object.defineProperty(o, k2, desc);
|
|
21
|
+
}) : (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
o[k2] = m[k];
|
|
24
|
+
}));
|
|
25
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
26
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
27
|
+
}) : function(o, v) {
|
|
28
|
+
o["default"] = v;
|
|
29
|
+
});
|
|
30
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
31
|
+
var ownKeys = function(o) {
|
|
32
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
33
|
+
var ar = [];
|
|
34
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
return ownKeys(o);
|
|
38
|
+
};
|
|
39
|
+
return function (mod) {
|
|
40
|
+
if (mod && mod.__esModule) return mod;
|
|
41
|
+
var result = {};
|
|
42
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
+
__setModuleDefault(result, mod);
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.getSessionId = getSessionId;
|
|
49
|
+
exports.upsertSession = upsertSession;
|
|
50
|
+
exports.getSessions = getSessions;
|
|
51
|
+
exports.getActiveSessions = getActiveSessions;
|
|
52
|
+
exports.markStaleSessionsComplete = markStaleSessionsComplete;
|
|
53
|
+
exports._resetStore = _resetStore;
|
|
54
|
+
const crypto = __importStar(require("node:crypto"));
|
|
55
|
+
const fs = __importStar(require("node:fs"));
|
|
56
|
+
const os = __importStar(require("node:os"));
|
|
57
|
+
const path = __importStar(require("node:path"));
|
|
58
|
+
const SESSIONS_SCHEMA_SQL = `
|
|
59
|
+
CREATE TABLE IF NOT EXISTS sessions (
|
|
60
|
+
id TEXT PRIMARY KEY,
|
|
61
|
+
started_at INTEGER NOT NULL,
|
|
62
|
+
last_seen_at INTEGER NOT NULL,
|
|
63
|
+
total_cost_usd REAL NOT NULL DEFAULT 0,
|
|
64
|
+
total_tokens_in INTEGER NOT NULL DEFAULT 0,
|
|
65
|
+
total_tokens_out INTEGER NOT NULL DEFAULT 0,
|
|
66
|
+
request_count INTEGER NOT NULL DEFAULT 1,
|
|
67
|
+
session_source TEXT NOT NULL DEFAULT 'synthetic'
|
|
68
|
+
);
|
|
69
|
+
CREATE INDEX IF NOT EXISTS sessions_last_seen ON sessions(last_seen_at);
|
|
70
|
+
`;
|
|
71
|
+
let _db = undefined;
|
|
72
|
+
let _upsertStmt = null;
|
|
73
|
+
/** In-memory fallback when SQLite is unavailable. */
|
|
74
|
+
const _memStore = new Map();
|
|
75
|
+
function getRelayplaneDir() {
|
|
76
|
+
const override = process.env['RELAYPLANE_HOME_OVERRIDE'];
|
|
77
|
+
const base = override ?? os.homedir();
|
|
78
|
+
return path.join(base, '.relayplane');
|
|
79
|
+
}
|
|
80
|
+
function ensureDir(dir) {
|
|
81
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
82
|
+
}
|
|
83
|
+
function initDb() {
|
|
84
|
+
try {
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
86
|
+
const Database = require('better-sqlite3');
|
|
87
|
+
const dir = getRelayplaneDir();
|
|
88
|
+
ensureDir(dir);
|
|
89
|
+
const dbPath = path.join(dir, 'sessions.db');
|
|
90
|
+
const db = new Database(dbPath);
|
|
91
|
+
db.pragma('journal_mode = WAL');
|
|
92
|
+
db.exec(SESSIONS_SCHEMA_SQL);
|
|
93
|
+
return db;
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function getDb() {
|
|
100
|
+
if (_db !== undefined)
|
|
101
|
+
return _db;
|
|
102
|
+
_db = initDb();
|
|
103
|
+
if (_db) {
|
|
104
|
+
_upsertStmt = _db.prepare(`
|
|
105
|
+
INSERT INTO sessions
|
|
106
|
+
(id, started_at, last_seen_at, total_cost_usd, total_tokens_in, total_tokens_out, request_count, session_source)
|
|
107
|
+
VALUES
|
|
108
|
+
(@id, @started_at, @last_seen_at, @total_cost_usd, @total_tokens_in, @total_tokens_out, 1, @session_source)
|
|
109
|
+
ON CONFLICT(id) DO UPDATE SET
|
|
110
|
+
last_seen_at = excluded.last_seen_at,
|
|
111
|
+
total_cost_usd = total_cost_usd + excluded.total_cost_usd,
|
|
112
|
+
total_tokens_in = total_tokens_in + excluded.total_tokens_in,
|
|
113
|
+
total_tokens_out = total_tokens_out + excluded.total_tokens_out,
|
|
114
|
+
request_count = request_count + 1
|
|
115
|
+
`);
|
|
116
|
+
}
|
|
117
|
+
return _db;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Extract or synthesise a session ID from an incoming HTTP request.
|
|
121
|
+
*
|
|
122
|
+
* - If the X-Claude-Code-Session-Id header is present, use it (source = 'claude-code').
|
|
123
|
+
* - Otherwise, generate a synthetic ID: sha256(`${hourBucket}:${model}`).slice(0,16)
|
|
124
|
+
* prefixed with "syn_" (source = 'synthetic').
|
|
125
|
+
*/
|
|
126
|
+
function getSessionId(req, model) {
|
|
127
|
+
const headerVal = req.headers['x-claude-code-session-id'];
|
|
128
|
+
const raw = Array.isArray(headerVal) ? headerVal[0] : headerVal;
|
|
129
|
+
if (raw && raw.trim()) {
|
|
130
|
+
return { sessionId: raw.trim(), sessionSource: 'claude-code' };
|
|
131
|
+
}
|
|
132
|
+
// Synthetic: keyed by UTC hour bucket + model
|
|
133
|
+
const now = new Date();
|
|
134
|
+
const hourBucket = `${now.getUTCFullYear()}-${now.getUTCMonth()}-${now.getUTCDate()}-${now.getUTCHours()}`;
|
|
135
|
+
const key = `${hourBucket}:${model ?? 'unknown'}`;
|
|
136
|
+
const hash = crypto.createHash('sha256').update(key).digest('hex').slice(0, 16);
|
|
137
|
+
return { sessionId: `syn_${hash}`, sessionSource: 'synthetic' };
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Upsert a session record, accumulating cost and token counts.
|
|
141
|
+
* Fire-and-forget; never throws. Falls back to in-memory store if SQLite unavailable.
|
|
142
|
+
*/
|
|
143
|
+
function upsertSession(sessionId, sessionSource, costUsd, tokensIn, tokensOut) {
|
|
144
|
+
const now = Date.now();
|
|
145
|
+
try {
|
|
146
|
+
const db = getDb();
|
|
147
|
+
if (db && _upsertStmt) {
|
|
148
|
+
_upsertStmt.run({
|
|
149
|
+
id: sessionId,
|
|
150
|
+
started_at: now,
|
|
151
|
+
last_seen_at: now,
|
|
152
|
+
total_cost_usd: costUsd,
|
|
153
|
+
total_tokens_in: tokensIn,
|
|
154
|
+
total_tokens_out: tokensOut,
|
|
155
|
+
session_source: sessionSource,
|
|
156
|
+
});
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
// fall through to in-memory
|
|
162
|
+
}
|
|
163
|
+
// In-memory fallback
|
|
164
|
+
const existing = _memStore.get(sessionId);
|
|
165
|
+
if (existing) {
|
|
166
|
+
existing.last_seen_at = now;
|
|
167
|
+
existing.total_cost_usd += costUsd;
|
|
168
|
+
existing.total_tokens_in += tokensIn;
|
|
169
|
+
existing.total_tokens_out += tokensOut;
|
|
170
|
+
existing.request_count += 1;
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
_memStore.set(sessionId, {
|
|
174
|
+
id: sessionId,
|
|
175
|
+
started_at: now,
|
|
176
|
+
last_seen_at: now,
|
|
177
|
+
total_cost_usd: costUsd,
|
|
178
|
+
total_tokens_in: tokensIn,
|
|
179
|
+
total_tokens_out: tokensOut,
|
|
180
|
+
request_count: 1,
|
|
181
|
+
session_source: sessionSource,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Query sessions from the last N days, most-recent first, paginated.
|
|
187
|
+
* Falls back to in-memory store if SQLite unavailable.
|
|
188
|
+
*/
|
|
189
|
+
function getSessions(options = {}) {
|
|
190
|
+
const limit = options.limit ?? 20;
|
|
191
|
+
const days = options.days ?? 7;
|
|
192
|
+
const cutoff = Date.now() - days * 86400000;
|
|
193
|
+
try {
|
|
194
|
+
const db = getDb();
|
|
195
|
+
if (db) {
|
|
196
|
+
const rows = db
|
|
197
|
+
.prepare(`SELECT id, started_at, last_seen_at, total_cost_usd, total_tokens_in, total_tokens_out, request_count, session_source
|
|
198
|
+
FROM sessions
|
|
199
|
+
WHERE last_seen_at >= ?
|
|
200
|
+
ORDER BY last_seen_at DESC
|
|
201
|
+
LIMIT ?`)
|
|
202
|
+
.all(cutoff, limit);
|
|
203
|
+
return rows;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
catch {
|
|
207
|
+
// fall through to in-memory
|
|
208
|
+
}
|
|
209
|
+
// In-memory fallback
|
|
210
|
+
return Array.from(_memStore.values())
|
|
211
|
+
.filter(s => s.last_seen_at >= cutoff)
|
|
212
|
+
.sort((a, b) => b.last_seen_at - a.last_seen_at)
|
|
213
|
+
.slice(0, limit);
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Return sessions active in the last 5 minutes.
|
|
217
|
+
* Falls back to in-memory store if SQLite unavailable.
|
|
218
|
+
*/
|
|
219
|
+
function getActiveSessions() {
|
|
220
|
+
const cutoff = Date.now() - 5 * 60 * 1000;
|
|
221
|
+
try {
|
|
222
|
+
const db = getDb();
|
|
223
|
+
if (db) {
|
|
224
|
+
const rows = db
|
|
225
|
+
.prepare(`SELECT id, started_at, last_seen_at, total_cost_usd, total_tokens_in, total_tokens_out, request_count, session_source
|
|
226
|
+
FROM sessions
|
|
227
|
+
WHERE last_seen_at >= ?
|
|
228
|
+
ORDER BY last_seen_at DESC`)
|
|
229
|
+
.all(cutoff);
|
|
230
|
+
return rows;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
catch {
|
|
234
|
+
// fall through to in-memory
|
|
235
|
+
}
|
|
236
|
+
// In-memory fallback
|
|
237
|
+
return Array.from(_memStore.values())
|
|
238
|
+
.filter(s => s.last_seen_at >= cutoff)
|
|
239
|
+
.sort((a, b) => b.last_seen_at - a.last_seen_at);
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Mark stale sessions complete — staleness is computed dynamically via
|
|
243
|
+
* last_seen_at filters, so this is a no-op exposed for API symmetry.
|
|
244
|
+
*/
|
|
245
|
+
function markStaleSessionsComplete() {
|
|
246
|
+
// No-op: staleness determined dynamically in getActiveSessions()
|
|
247
|
+
}
|
|
248
|
+
/** Exposed for testing — reset singleton state. */
|
|
249
|
+
function _resetStore() {
|
|
250
|
+
if (_db) {
|
|
251
|
+
try {
|
|
252
|
+
_db.close();
|
|
253
|
+
}
|
|
254
|
+
catch {
|
|
255
|
+
/* ignore */
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
_db = undefined;
|
|
259
|
+
_upsertStmt = null;
|
|
260
|
+
_memStore.clear();
|
|
261
|
+
}
|
|
262
|
+
//# sourceMappingURL=session-tracker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-tracker.js","sourceRoot":"","sources":["../src/session-tracker.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4FH,oCAgBC;AAMD,sCA8CC;AAWD,kCA4BC;AAMD,8CAwBC;AAMD,8DAEC;AAGD,kCAWC;AAzPD,oDAAsC;AACtC,4CAA8B;AAC9B,4CAA8B;AAC9B,gDAAkC;AAclC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;CAY3B,CAAC;AAEF,IAAI,GAAG,GAAyD,SAAS,CAAC;AAC1E,IAAI,WAAW,GAA8C,IAAI,CAAC;AAElE,qDAAqD;AACrD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAwB,CAAC;AAElD,SAAS,gBAAgB;IACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACzD,MAAM,IAAI,GAAG,QAAQ,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;IACtC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;AACxC,CAAC;AAED,SAAS,SAAS,CAAC,GAAW;IAC5B,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACzC,CAAC;AAED,SAAS,MAAM;IACb,IAAI,CAAC;QACH,iEAAiE;QACjE,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