agent-replay 0.1.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.
- package/LICENSE +21 -0
- package/README.md +113 -0
- package/bin/agent-replay.js +20 -0
- package/build/client/_app/immutable/assets/0.D9-tUsfl.css +1 -0
- package/build/client/_app/immutable/assets/0.D9-tUsfl.css.br +0 -0
- package/build/client/_app/immutable/assets/0.D9-tUsfl.css.gz +0 -0
- package/build/client/_app/immutable/assets/2.Ch4de4ty.css +1 -0
- package/build/client/_app/immutable/assets/2.Ch4de4ty.css.br +0 -0
- package/build/client/_app/immutable/assets/2.Ch4de4ty.css.gz +0 -0
- package/build/client/_app/immutable/assets/3.BP1aEJ1A.css +1 -0
- package/build/client/_app/immutable/assets/3.BP1aEJ1A.css.br +0 -0
- package/build/client/_app/immutable/assets/3.BP1aEJ1A.css.gz +0 -0
- package/build/client/_app/immutable/chunks/8LyLqy0e.js +1 -0
- package/build/client/_app/immutable/chunks/8LyLqy0e.js.br +3 -0
- package/build/client/_app/immutable/chunks/8LyLqy0e.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BmaMsIzI.js +3 -0
- package/build/client/_app/immutable/chunks/BmaMsIzI.js.br +0 -0
- package/build/client/_app/immutable/chunks/BmaMsIzI.js.gz +0 -0
- package/build/client/_app/immutable/chunks/BoUXsunA.js +1 -0
- package/build/client/_app/immutable/chunks/BoUXsunA.js.br +0 -0
- package/build/client/_app/immutable/chunks/BoUXsunA.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CCa20sJM.js +1 -0
- package/build/client/_app/immutable/chunks/CCa20sJM.js.br +0 -0
- package/build/client/_app/immutable/chunks/CCa20sJM.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CP-o74wi.js +2 -0
- package/build/client/_app/immutable/chunks/CP-o74wi.js.br +0 -0
- package/build/client/_app/immutable/chunks/CP-o74wi.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CZWwZlGk.js +1 -0
- package/build/client/_app/immutable/chunks/CZWwZlGk.js.br +0 -0
- package/build/client/_app/immutable/chunks/CZWwZlGk.js.gz +0 -0
- package/build/client/_app/immutable/chunks/D6SnDtAs.js +1 -0
- package/build/client/_app/immutable/chunks/D6SnDtAs.js.br +0 -0
- package/build/client/_app/immutable/chunks/D6SnDtAs.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DApgqo7x.js +1 -0
- package/build/client/_app/immutable/chunks/DApgqo7x.js.br +0 -0
- package/build/client/_app/immutable/chunks/DApgqo7x.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DCcb0kkP.js +1 -0
- package/build/client/_app/immutable/chunks/DCcb0kkP.js.br +0 -0
- package/build/client/_app/immutable/chunks/DCcb0kkP.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.CelDjTDX.js +2 -0
- package/build/client/_app/immutable/entry/app.CelDjTDX.js.br +0 -0
- package/build/client/_app/immutable/entry/app.CelDjTDX.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.Bo8U6P_2.js +1 -0
- package/build/client/_app/immutable/entry/start.Bo8U6P_2.js.br +2 -0
- package/build/client/_app/immutable/entry/start.Bo8U6P_2.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.DdgnJbSm.js +1 -0
- package/build/client/_app/immutable/nodes/0.DdgnJbSm.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.DdgnJbSm.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.DUCL1Cc_.js +1 -0
- package/build/client/_app/immutable/nodes/1.DUCL1Cc_.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.DUCL1Cc_.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.FNRc_Nvw.js +1 -0
- package/build/client/_app/immutable/nodes/2.FNRc_Nvw.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.FNRc_Nvw.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.CaEmUkA2.js +29 -0
- package/build/client/_app/immutable/nodes/3.CaEmUkA2.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.CaEmUkA2.js.gz +0 -0
- package/build/client/_app/version.json +1 -0
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/client/favicon.svg +13 -0
- package/build/client/favicon.svg.br +0 -0
- package/build/client/favicon.svg.gz +0 -0
- package/build/client/robots.txt +3 -0
- package/build/client/screenshot.png +0 -0
- package/build/env.js +94 -0
- package/build/handler.js +1494 -0
- package/build/index.js +345 -0
- package/build/server/chunks/0-CkGitm9W.js +9 -0
- package/build/server/chunks/0-CkGitm9W.js.map +1 -0
- package/build/server/chunks/1-BU8Hl3FY.js +9 -0
- package/build/server/chunks/1-BU8Hl3FY.js.map +1 -0
- package/build/server/chunks/2-DenZJmTh.js +27 -0
- package/build/server/chunks/2-DenZJmTh.js.map +1 -0
- package/build/server/chunks/3-Df2VKXDy.js +73 -0
- package/build/server/chunks/3-Df2VKXDy.js.map +1 -0
- package/build/server/chunks/_layout.svelte-BK7oCPlN.js +26 -0
- package/build/server/chunks/_layout.svelte-BK7oCPlN.js.map +1 -0
- package/build/server/chunks/_page.svelte-BMqbzglq.js +178 -0
- package/build/server/chunks/_page.svelte-BMqbzglq.js.map +1 -0
- package/build/server/chunks/_page.svelte-C2kNC2pi.js +504 -0
- package/build/server/chunks/_page.svelte-C2kNC2pi.js.map +1 -0
- package/build/server/chunks/context-JUYyv6NC.js +74 -0
- package/build/server/chunks/context-JUYyv6NC.js.map +1 -0
- package/build/server/chunks/error.svelte-Epasb48G.js +46 -0
- package/build/server/chunks/error.svelte-Epasb48G.js.map +1 -0
- package/build/server/chunks/escaping-CqgfEcN3.js +19 -0
- package/build/server/chunks/escaping-CqgfEcN3.js.map +1 -0
- package/build/server/chunks/exports-CURVw3-F.js +303 -0
- package/build/server/chunks/exports-CURVw3-F.js.map +1 -0
- package/build/server/chunks/format-dOzJq-yD.js +59 -0
- package/build/server/chunks/format-dOzJq-yD.js.map +1 -0
- package/build/server/chunks/index-C0L7m6Jv.js +1497 -0
- package/build/server/chunks/index-C0L7m6Jv.js.map +1 -0
- package/build/server/chunks/index-CoD1IJuy.js +190 -0
- package/build/server/chunks/index-CoD1IJuy.js.map +1 -0
- package/build/server/chunks/index2-f44F-4KW.js +614 -0
- package/build/server/chunks/index2-f44F-4KW.js.map +1 -0
- package/build/server/chunks/shared-server-DaWdgxVh.js +11 -0
- package/build/server/chunks/shared-server-DaWdgxVh.js.map +1 -0
- package/build/server/index.js +8152 -0
- package/build/server/index.js.map +1 -0
- package/build/server/manifest.js +54 -0
- package/build/server/manifest.js.map +1 -0
- package/build/shims.js +32 -0
- package/package.json +71 -0
- package/static/favicon.svg +13 -0
- package/static/robots.txt +3 -0
- package/static/screenshot.png +0 -0
package/build/index.js
ADDED
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import http from 'node:http';
|
|
2
|
+
import process from 'node:process';
|
|
3
|
+
import { handler } from './handler.js';
|
|
4
|
+
import { env, timeout_env } from './env.js';
|
|
5
|
+
import { setImmediate } from 'node:timers';
|
|
6
|
+
import * as qs from 'node:querystring';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @param {string|RegExp} input The route pattern
|
|
10
|
+
* @param {boolean} [loose] Allow open-ended matching. Ignored with `RegExp` input.
|
|
11
|
+
*/
|
|
12
|
+
function parse$1(input, loose) {
|
|
13
|
+
if (input instanceof RegExp) return { keys:false, pattern:input };
|
|
14
|
+
var c, o, tmp, ext, keys=[], pattern='', arr = input.split('/');
|
|
15
|
+
arr[0] || arr.shift();
|
|
16
|
+
|
|
17
|
+
while (tmp = arr.shift()) {
|
|
18
|
+
c = tmp[0];
|
|
19
|
+
if (c === '*') {
|
|
20
|
+
keys.push(c);
|
|
21
|
+
pattern += tmp[1] === '?' ? '(?:/(.*))?' : '/(.*)';
|
|
22
|
+
} else if (c === ':') {
|
|
23
|
+
o = tmp.indexOf('?', 1);
|
|
24
|
+
ext = tmp.indexOf('.', 1);
|
|
25
|
+
keys.push( tmp.substring(1, !!~o ? o : !!~ext ? ext : tmp.length) );
|
|
26
|
+
pattern += !!~o && !~ext ? '(?:/([^/]+?))?' : '/([^/]+?)';
|
|
27
|
+
if (!!~ext) pattern += (!!~o ? '?' : '') + '\\' + tmp.substring(ext);
|
|
28
|
+
} else {
|
|
29
|
+
pattern += '/' + tmp;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
keys: keys,
|
|
35
|
+
pattern: new RegExp('^' + pattern + (loose ? '(?=$|\/)' : '\/?$'), 'i')
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const MAP = {
|
|
40
|
+
"": 0,
|
|
41
|
+
GET: 1,
|
|
42
|
+
HEAD: 2,
|
|
43
|
+
PATCH: 3,
|
|
44
|
+
OPTIONS: 4,
|
|
45
|
+
CONNECT: 5,
|
|
46
|
+
DELETE: 6,
|
|
47
|
+
TRACE: 7,
|
|
48
|
+
POST: 8,
|
|
49
|
+
PUT: 9,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
class Trouter {
|
|
53
|
+
constructor() {
|
|
54
|
+
this.routes = [];
|
|
55
|
+
|
|
56
|
+
this.all = this.add.bind(this, '');
|
|
57
|
+
this.get = this.add.bind(this, 'GET');
|
|
58
|
+
this.head = this.add.bind(this, 'HEAD');
|
|
59
|
+
this.patch = this.add.bind(this, 'PATCH');
|
|
60
|
+
this.options = this.add.bind(this, 'OPTIONS');
|
|
61
|
+
this.connect = this.add.bind(this, 'CONNECT');
|
|
62
|
+
this.delete = this.add.bind(this, 'DELETE');
|
|
63
|
+
this.trace = this.add.bind(this, 'TRACE');
|
|
64
|
+
this.post = this.add.bind(this, 'POST');
|
|
65
|
+
this.put = this.add.bind(this, 'PUT');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
use(route, ...fns) {
|
|
69
|
+
let handlers = [].concat.apply([], fns);
|
|
70
|
+
let { keys, pattern } = parse$1(route, true);
|
|
71
|
+
this.routes.push({ keys, pattern, method: '', handlers, midx: MAP[''] });
|
|
72
|
+
return this;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
add(method, route, ...fns) {
|
|
76
|
+
let { keys, pattern } = parse$1(route);
|
|
77
|
+
let handlers = [].concat.apply([], fns);
|
|
78
|
+
this.routes.push({ keys, pattern, method, handlers, midx: MAP[method] });
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
find(method, url) {
|
|
83
|
+
let midx = MAP[method];
|
|
84
|
+
let isHEAD = (midx === 2);
|
|
85
|
+
let i=0, j=0, k, tmp, arr=this.routes;
|
|
86
|
+
let matches=[], params={}, handlers=[];
|
|
87
|
+
for (; i < arr.length; i++) {
|
|
88
|
+
tmp = arr[i];
|
|
89
|
+
if (tmp.midx === midx || tmp.midx === 0 || (isHEAD && tmp.midx===1) ) {
|
|
90
|
+
if (tmp.keys === false) {
|
|
91
|
+
matches = tmp.pattern.exec(url);
|
|
92
|
+
if (matches === null) continue;
|
|
93
|
+
if (matches.groups !== void 0) for (k in matches.groups) params[k]=matches.groups[k];
|
|
94
|
+
tmp.handlers.length > 1 ? (handlers=handlers.concat(tmp.handlers)) : handlers.push(tmp.handlers[0]);
|
|
95
|
+
} else if (tmp.keys.length > 0) {
|
|
96
|
+
matches = tmp.pattern.exec(url);
|
|
97
|
+
if (matches === null) continue;
|
|
98
|
+
for (j=0; j < tmp.keys.length;) params[tmp.keys[j]]=matches[++j];
|
|
99
|
+
tmp.handlers.length > 1 ? (handlers=handlers.concat(tmp.handlers)) : handlers.push(tmp.handlers[0]);
|
|
100
|
+
} else if (tmp.pattern.test(url)) {
|
|
101
|
+
tmp.handlers.length > 1 ? (handlers=handlers.concat(tmp.handlers)) : handlers.push(tmp.handlers[0]);
|
|
102
|
+
}
|
|
103
|
+
} // else not a match
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return { params, handlers };
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @typedef ParsedURL
|
|
112
|
+
* @type {import('.').ParsedURL}
|
|
113
|
+
*/
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @typedef Request
|
|
117
|
+
* @property {string} url
|
|
118
|
+
* @property {ParsedURL} _parsedUrl
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @param {Request} req
|
|
123
|
+
* @returns {ParsedURL|void}
|
|
124
|
+
*/
|
|
125
|
+
function parse(req) {
|
|
126
|
+
let raw = req.url;
|
|
127
|
+
if (raw == null) return;
|
|
128
|
+
|
|
129
|
+
let prev = req._parsedUrl;
|
|
130
|
+
if (prev && prev.raw === raw) return prev;
|
|
131
|
+
|
|
132
|
+
let pathname=raw, search='', query;
|
|
133
|
+
|
|
134
|
+
if (raw.length > 1) {
|
|
135
|
+
let idx = raw.indexOf('?', 1);
|
|
136
|
+
|
|
137
|
+
if (idx !== -1) {
|
|
138
|
+
search = raw.substring(idx);
|
|
139
|
+
pathname = raw.substring(0, idx);
|
|
140
|
+
if (search.length > 1) {
|
|
141
|
+
query = qs.parse(search.substring(1));
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return req._parsedUrl = { pathname, search, query, raw };
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function onError(err, req, res) {
|
|
150
|
+
let code = typeof err.status === 'number' && err.status;
|
|
151
|
+
code = res.statusCode = (code && code >= 100 ? code : 500);
|
|
152
|
+
if (typeof err === 'string' || Buffer.isBuffer(err)) res.end(err);
|
|
153
|
+
else res.end(err.message || http.STATUS_CODES[code]);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const mount = fn => fn instanceof Polka ? fn.attach : fn;
|
|
157
|
+
|
|
158
|
+
class Polka extends Trouter {
|
|
159
|
+
constructor(opts={}) {
|
|
160
|
+
super();
|
|
161
|
+
this.parse = parse;
|
|
162
|
+
this.server = opts.server;
|
|
163
|
+
this.handler = this.handler.bind(this);
|
|
164
|
+
this.onError = opts.onError || onError; // catch-all handler
|
|
165
|
+
this.onNoMatch = opts.onNoMatch || this.onError.bind(null, { status: 404 });
|
|
166
|
+
this.attach = (req, res) => setImmediate(this.handler, req, res);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
use(base, ...fns) {
|
|
170
|
+
if (base === '/') {
|
|
171
|
+
super.use(base, fns.map(mount));
|
|
172
|
+
} else if (typeof base === 'function' || base instanceof Polka) {
|
|
173
|
+
super.use('/', [base, ...fns].map(mount));
|
|
174
|
+
} else {
|
|
175
|
+
super.use(base,
|
|
176
|
+
(req, _, next) => {
|
|
177
|
+
if (typeof base === 'string') {
|
|
178
|
+
let len = base.length;
|
|
179
|
+
base.startsWith('/') || len++;
|
|
180
|
+
req.url = req.url.substring(len) || '/';
|
|
181
|
+
req.path = req.path.substring(len) || '/';
|
|
182
|
+
} else {
|
|
183
|
+
req.url = req.url.replace(base, '') || '/';
|
|
184
|
+
req.path = req.path.replace(base, '') || '/';
|
|
185
|
+
}
|
|
186
|
+
if (req.url.charAt(0) !== '/') {
|
|
187
|
+
req.url = '/' + req.url;
|
|
188
|
+
}
|
|
189
|
+
next();
|
|
190
|
+
},
|
|
191
|
+
fns.map(mount),
|
|
192
|
+
(req, _, next) => {
|
|
193
|
+
req.path = req._parsedUrl.pathname;
|
|
194
|
+
req.url = req.path + req._parsedUrl.search;
|
|
195
|
+
next();
|
|
196
|
+
}
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
return this; // chainable
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
listen() {
|
|
203
|
+
(this.server = this.server || http.createServer()).on('request', this.attach);
|
|
204
|
+
this.server.listen.apply(this.server, arguments);
|
|
205
|
+
return this;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
handler(req, res, next) {
|
|
209
|
+
let info = this.parse(req), path = info.pathname;
|
|
210
|
+
let obj = this.find(req.method, req.path=path);
|
|
211
|
+
|
|
212
|
+
req.url = path + info.search;
|
|
213
|
+
req.originalUrl = req.originalUrl || req.url;
|
|
214
|
+
req.query = info.query || {};
|
|
215
|
+
req.search = info.search;
|
|
216
|
+
req.params = obj.params;
|
|
217
|
+
|
|
218
|
+
if (path.length > 1 && path.indexOf('%', 1) !== -1) {
|
|
219
|
+
for (let k in req.params) {
|
|
220
|
+
try { req.params[k] = decodeURIComponent(req.params[k]); }
|
|
221
|
+
catch (e) { /* malform uri segment */ }
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
let i=0, arr=obj.handlers.concat(this.onNoMatch), len=arr.length;
|
|
226
|
+
let loop = async () => res.finished || (i < len) && arr[i++](req, res, next);
|
|
227
|
+
(next = next || (err => err ? this.onError(err, req, res, next) : loop().catch(next)))(); // init
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
function polka (opts) {
|
|
232
|
+
return new Polka(opts);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
const path = env('SOCKET_PATH', false);
|
|
236
|
+
const host = env('HOST', '0.0.0.0');
|
|
237
|
+
const port = env('PORT', !path && '3000');
|
|
238
|
+
|
|
239
|
+
const shutdown_timeout = parseInt(env('SHUTDOWN_TIMEOUT', '30'));
|
|
240
|
+
const idle_timeout = parseInt(env('IDLE_TIMEOUT', '0'));
|
|
241
|
+
const listen_pid = parseInt(env('LISTEN_PID', '0'));
|
|
242
|
+
const listen_fds = parseInt(env('LISTEN_FDS', '0'));
|
|
243
|
+
// https://www.freedesktop.org/software/systemd/man/latest/sd_listen_fds.html
|
|
244
|
+
const SD_LISTEN_FDS_START = 3;
|
|
245
|
+
|
|
246
|
+
if (listen_pid !== 0 && listen_pid !== process.pid) {
|
|
247
|
+
throw new Error(`received LISTEN_PID ${listen_pid} but current process id is ${process.pid}`);
|
|
248
|
+
}
|
|
249
|
+
if (listen_fds > 1) {
|
|
250
|
+
throw new Error(
|
|
251
|
+
`only one socket is allowed for socket activation, but LISTEN_FDS was set to ${listen_fds}`
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
const socket_activation = listen_pid === process.pid && listen_fds === 1;
|
|
256
|
+
|
|
257
|
+
let requests = 0;
|
|
258
|
+
/** @type {NodeJS.Timeout | void} */
|
|
259
|
+
let shutdown_timeout_id;
|
|
260
|
+
/** @type {NodeJS.Timeout | void} */
|
|
261
|
+
let idle_timeout_id;
|
|
262
|
+
|
|
263
|
+
// Initialize the HTTP server here so that we can set properties before starting to listen.
|
|
264
|
+
// Otherwise, polka delays creating the server until listen() is called. Settings these
|
|
265
|
+
// properties after the server has started listening could lead to race conditions.
|
|
266
|
+
const httpServer = http.createServer();
|
|
267
|
+
|
|
268
|
+
const keep_alive_timeout = timeout_env('KEEP_ALIVE_TIMEOUT');
|
|
269
|
+
if (keep_alive_timeout !== undefined) {
|
|
270
|
+
// Convert the keep-alive timeout from seconds to milliseconds (the unit Node.js expects).
|
|
271
|
+
httpServer.keepAliveTimeout = keep_alive_timeout * 1000;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const headers_timeout = timeout_env('HEADERS_TIMEOUT');
|
|
275
|
+
if (headers_timeout !== undefined) {
|
|
276
|
+
// Convert the headers timeout from seconds to milliseconds (the unit Node.js expects).
|
|
277
|
+
httpServer.headersTimeout = headers_timeout * 1000;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
const server = polka({ server: httpServer }).use(handler);
|
|
281
|
+
|
|
282
|
+
if (socket_activation) {
|
|
283
|
+
server.listen({ fd: SD_LISTEN_FDS_START }, () => {
|
|
284
|
+
console.log(`Listening on file descriptor ${SD_LISTEN_FDS_START}`);
|
|
285
|
+
});
|
|
286
|
+
} else {
|
|
287
|
+
server.listen({ path, host, port }, () => {
|
|
288
|
+
console.log(`Listening on ${path || `http://${host}:${port}`}`);
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/** @param {'SIGINT' | 'SIGTERM' | 'IDLE'} reason */
|
|
293
|
+
function graceful_shutdown(reason) {
|
|
294
|
+
if (shutdown_timeout_id) return;
|
|
295
|
+
|
|
296
|
+
// If a connection was opened with a keep-alive header close() will wait for the connection to
|
|
297
|
+
// time out rather than close it even if it is not handling any requests, so call this first
|
|
298
|
+
httpServer.closeIdleConnections();
|
|
299
|
+
|
|
300
|
+
httpServer.close((error) => {
|
|
301
|
+
// occurs if the server is already closed
|
|
302
|
+
if (error) return;
|
|
303
|
+
|
|
304
|
+
if (shutdown_timeout_id) {
|
|
305
|
+
clearTimeout(shutdown_timeout_id);
|
|
306
|
+
}
|
|
307
|
+
if (idle_timeout_id) {
|
|
308
|
+
clearTimeout(idle_timeout_id);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
// @ts-expect-error custom events cannot be typed
|
|
312
|
+
process.emit('sveltekit:shutdown', reason);
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
shutdown_timeout_id = setTimeout(() => httpServer.closeAllConnections(), shutdown_timeout * 1000);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
httpServer.on(
|
|
319
|
+
'request',
|
|
320
|
+
/** @param {import('node:http').IncomingMessage} req */
|
|
321
|
+
(req) => {
|
|
322
|
+
requests++;
|
|
323
|
+
|
|
324
|
+
if (socket_activation && idle_timeout_id) {
|
|
325
|
+
idle_timeout_id = clearTimeout(idle_timeout_id);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
req.on('close', () => {
|
|
329
|
+
requests--;
|
|
330
|
+
|
|
331
|
+
if (shutdown_timeout_id) {
|
|
332
|
+
// close connections as soon as they become idle, so they don't accept new requests
|
|
333
|
+
httpServer.closeIdleConnections();
|
|
334
|
+
}
|
|
335
|
+
if (requests === 0 && socket_activation && idle_timeout) {
|
|
336
|
+
idle_timeout_id = setTimeout(() => graceful_shutdown('IDLE'), idle_timeout * 1000);
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
);
|
|
341
|
+
|
|
342
|
+
process.on('SIGTERM', graceful_shutdown);
|
|
343
|
+
process.on('SIGINT', graceful_shutdown);
|
|
344
|
+
|
|
345
|
+
export { host, path, port, server };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const index = 0;
|
|
2
|
+
let component_cache;
|
|
3
|
+
const component = async () => component_cache ??= (await import('./_layout.svelte-BK7oCPlN.js')).default;
|
|
4
|
+
const imports = ["_app/immutable/nodes/0.DdgnJbSm.js","_app/immutable/chunks/CP-o74wi.js","_app/immutable/chunks/DApgqo7x.js","_app/immutable/chunks/8LyLqy0e.js","_app/immutable/chunks/CCa20sJM.js"];
|
|
5
|
+
const stylesheets = ["_app/immutable/assets/0.D9-tUsfl.css"];
|
|
6
|
+
const fonts = [];
|
|
7
|
+
|
|
8
|
+
export { component, fonts, imports, index, stylesheets };
|
|
9
|
+
//# sourceMappingURL=0-CkGitm9W.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"0-CkGitm9W.js","sources":["../../../.svelte-kit/adapter-node/nodes/0.js"],"sourcesContent":["\n\nexport const index = 0;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/_layout.svelte.js')).default;\nexport const imports = [\"_app/immutable/nodes/0.DdgnJbSm.js\",\"_app/immutable/chunks/CP-o74wi.js\",\"_app/immutable/chunks/DApgqo7x.js\",\"_app/immutable/chunks/8LyLqy0e.js\",\"_app/immutable/chunks/CCa20sJM.js\"];\nexport const stylesheets = [\"_app/immutable/assets/0.D9-tUsfl.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG;AACrB,IAAI,eAAe;AACP,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,8BAAoC,CAAC,EAAE;AAClG,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AAChM,MAAC,WAAW,GAAG,CAAC,sCAAsC;AACtD,MAAC,KAAK,GAAG;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const index = 1;
|
|
2
|
+
let component_cache;
|
|
3
|
+
const component = async () => component_cache ??= (await import('./error.svelte-Epasb48G.js')).default;
|
|
4
|
+
const imports = ["_app/immutable/nodes/1.DUCL1Cc_.js","_app/immutable/chunks/CP-o74wi.js","_app/immutable/chunks/DApgqo7x.js","_app/immutable/chunks/BmaMsIzI.js","_app/immutable/chunks/D6SnDtAs.js"];
|
|
5
|
+
const stylesheets = [];
|
|
6
|
+
const fonts = [];
|
|
7
|
+
|
|
8
|
+
export { component, fonts, imports, index, stylesheets };
|
|
9
|
+
//# sourceMappingURL=1-BU8Hl3FY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1-BU8Hl3FY.js","sources":["../../../.svelte-kit/adapter-node/nodes/1.js"],"sourcesContent":["\n\nexport const index = 1;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/fallbacks/error.svelte.js')).default;\nexport const imports = [\"_app/immutable/nodes/1.DUCL1Cc_.js\",\"_app/immutable/chunks/CP-o74wi.js\",\"_app/immutable/chunks/DApgqo7x.js\",\"_app/immutable/chunks/BmaMsIzI.js\",\"_app/immutable/chunks/D6SnDtAs.js\"];\nexport const stylesheets = [];\nexport const fonts = [];\n"],"names":[],"mappings":"AAEY,MAAC,KAAK,GAAG;AACrB,IAAI,eAAe;AACP,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAsC,CAAC,EAAE;AACpG,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AAChM,MAAC,WAAW,GAAG;AACf,MAAC,KAAK,GAAG;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { d as discoverAllSessions } from './index2-f44F-4KW.js';
|
|
2
|
+
import 'fs/promises';
|
|
3
|
+
import 'path';
|
|
4
|
+
import './shared-server-DaWdgxVh.js';
|
|
5
|
+
import 'os';
|
|
6
|
+
import 'better-sqlite3';
|
|
7
|
+
|
|
8
|
+
const load = async () => {
|
|
9
|
+
const sessions = await discoverAllSessions();
|
|
10
|
+
return { sessions };
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
var _page_server_ts = /*#__PURE__*/Object.freeze({
|
|
14
|
+
__proto__: null,
|
|
15
|
+
load: load
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const index = 2;
|
|
19
|
+
let component_cache;
|
|
20
|
+
const component = async () => component_cache ??= (await import('./_page.svelte-BMqbzglq.js')).default;
|
|
21
|
+
const server_id = "src/routes/+page.server.ts";
|
|
22
|
+
const imports = ["_app/immutable/nodes/2.FNRc_Nvw.js","_app/immutable/chunks/CP-o74wi.js","_app/immutable/chunks/DApgqo7x.js","_app/immutable/chunks/CZWwZlGk.js","_app/immutable/chunks/8LyLqy0e.js","_app/immutable/chunks/CCa20sJM.js","_app/immutable/chunks/BoUXsunA.js"];
|
|
23
|
+
const stylesheets = ["_app/immutable/assets/2.Ch4de4ty.css"];
|
|
24
|
+
const fonts = [];
|
|
25
|
+
|
|
26
|
+
export { component, fonts, imports, index, _page_server_ts as server, server_id, stylesheets };
|
|
27
|
+
//# sourceMappingURL=2-DenZJmTh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"2-DenZJmTh.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/_page.server.ts.js","../../../.svelte-kit/adapter-node/nodes/2.js"],"sourcesContent":["import { d as discoverAllSessions } from \"../../chunks/index2.js\";\nconst load = async () => {\n const sessions = await discoverAllSessions();\n return { sessions };\n};\nexport {\n load\n};\n","import * as server from '../entries/pages/_page.server.ts.js';\n\nexport const index = 2;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/+page.server.ts\";\nexport const imports = [\"_app/immutable/nodes/2.FNRc_Nvw.js\",\"_app/immutable/chunks/CP-o74wi.js\",\"_app/immutable/chunks/DApgqo7x.js\",\"_app/immutable/chunks/CZWwZlGk.js\",\"_app/immutable/chunks/8LyLqy0e.js\",\"_app/immutable/chunks/CCa20sJM.js\",\"_app/immutable/chunks/BoUXsunA.js\"];\nexport const stylesheets = [\"_app/immutable/assets/2.Ch4de4ty.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":";;;;;;;AACA,MAAM,IAAI,GAAG,YAAY;AACzB,EAAE,MAAM,QAAQ,GAAG,MAAM,mBAAmB,EAAE;AAC9C,EAAE,OAAO,EAAE,QAAQ,EAAE;AACrB,CAAC;;;;;;;ACFW,MAAC,KAAK,GAAG;AACrB,IAAI,eAAe;AACP,MAAC,SAAS,GAAG,YAAY,eAAe,KAAK,CAAC,MAAM,OAAO,4BAAkC,CAAC,EAAE;AAEhG,MAAC,SAAS,GAAG;AACb,MAAC,OAAO,GAAG,CAAC,oCAAoC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC,CAAC,mCAAmC;AACxQ,MAAC,WAAW,GAAG,CAAC,sCAAsC;AACtD,MAAC,KAAK,GAAG;;;;"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { p as parseSessionByProvider, C as CLAUDE_DIR, a as parseSession } from './index2-f44F-4KW.js';
|
|
2
|
+
import { e as error } from './index-CoD1IJuy.js';
|
|
3
|
+
import { readdir, access } from 'fs/promises';
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
import './shared-server-DaWdgxVh.js';
|
|
6
|
+
import 'os';
|
|
7
|
+
import 'better-sqlite3';
|
|
8
|
+
|
|
9
|
+
function decodeProjectName(dirName) {
|
|
10
|
+
return dirName.replace(/-/g, "/").replace(/^\//, "");
|
|
11
|
+
}
|
|
12
|
+
const load = async ({ params, url }) => {
|
|
13
|
+
const { sessionId } = params;
|
|
14
|
+
const provider = url.searchParams.get("provider") || "claude-code";
|
|
15
|
+
if (provider === "cursor") {
|
|
16
|
+
const meta = {};
|
|
17
|
+
for (const [key, value] of url.searchParams.entries()) {
|
|
18
|
+
if (key !== "provider") meta[key] = value;
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
const timeline = await parseSessionByProvider(sessionId, "cursor", meta);
|
|
22
|
+
return { timeline };
|
|
23
|
+
} catch (e) {
|
|
24
|
+
throw error(500, `Failed to parse Cursor session: ${e instanceof Error ? e.message : "Unknown error"}`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
let filePath = url.searchParams.get("file");
|
|
28
|
+
let project = url.searchParams.get("project") || "";
|
|
29
|
+
if (!filePath) {
|
|
30
|
+
let projectDirs;
|
|
31
|
+
try {
|
|
32
|
+
projectDirs = await readdir(CLAUDE_DIR);
|
|
33
|
+
} catch {
|
|
34
|
+
throw error(500, "Cannot read Claude sessions directory");
|
|
35
|
+
}
|
|
36
|
+
for (const projectDir of projectDirs) {
|
|
37
|
+
const candidate = join(CLAUDE_DIR, projectDir, `${sessionId}.jsonl`);
|
|
38
|
+
try {
|
|
39
|
+
await access(candidate);
|
|
40
|
+
filePath = candidate;
|
|
41
|
+
project = decodeProjectName(projectDir);
|
|
42
|
+
break;
|
|
43
|
+
} catch {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (!filePath) {
|
|
48
|
+
throw error(404, `Session ${sessionId} not found`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
const timeline = await parseSession(filePath, sessionId, project);
|
|
53
|
+
return { timeline };
|
|
54
|
+
} catch (e) {
|
|
55
|
+
throw error(500, `Failed to parse session: ${e instanceof Error ? e.message : "Unknown error"}`);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
var _page_server_ts = /*#__PURE__*/Object.freeze({
|
|
60
|
+
__proto__: null,
|
|
61
|
+
load: load
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const index = 3;
|
|
65
|
+
let component_cache;
|
|
66
|
+
const component = async () => component_cache ??= (await import('./_page.svelte-C2kNC2pi.js')).default;
|
|
67
|
+
const server_id = "src/routes/sessions/[sessionId]/+page.server.ts";
|
|
68
|
+
const imports = ["_app/immutable/nodes/3.CaEmUkA2.js","_app/immutable/chunks/CP-o74wi.js","_app/immutable/chunks/DApgqo7x.js","_app/immutable/chunks/8LyLqy0e.js","_app/immutable/chunks/CZWwZlGk.js","_app/immutable/chunks/CCa20sJM.js","_app/immutable/chunks/BoUXsunA.js","_app/immutable/chunks/DCcb0kkP.js"];
|
|
69
|
+
const stylesheets = ["_app/immutable/assets/3.BP1aEJ1A.css"];
|
|
70
|
+
const fonts = [];
|
|
71
|
+
|
|
72
|
+
export { component, fonts, imports, index, _page_server_ts as server, server_id, stylesheets };
|
|
73
|
+
//# sourceMappingURL=3-Df2VKXDy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"3-Df2VKXDy.js","sources":["../../../.svelte-kit/adapter-node/entries/pages/sessions/_sessionId_/_page.server.ts.js","../../../.svelte-kit/adapter-node/nodes/3.js"],"sourcesContent":["import { p as parseSessionByProvider, C as CLAUDE_DIR, a as parseSession } from \"../../../../chunks/index2.js\";\nimport { error } from \"@sveltejs/kit\";\nimport { readdir, access } from \"fs/promises\";\nimport { join } from \"path\";\nfunction decodeProjectName(dirName) {\n return dirName.replace(/-/g, \"/\").replace(/^\\//, \"\");\n}\nconst load = async ({ params, url }) => {\n const { sessionId } = params;\n const provider = url.searchParams.get(\"provider\") || \"claude-code\";\n if (provider === \"cursor\") {\n const meta = {};\n for (const [key, value] of url.searchParams.entries()) {\n if (key !== \"provider\") meta[key] = value;\n }\n try {\n const timeline = await parseSessionByProvider(sessionId, \"cursor\", meta);\n return { timeline };\n } catch (e) {\n throw error(500, `Failed to parse Cursor session: ${e instanceof Error ? e.message : \"Unknown error\"}`);\n }\n }\n let filePath = url.searchParams.get(\"file\");\n let project = url.searchParams.get(\"project\") || \"\";\n if (!filePath) {\n let projectDirs;\n try {\n projectDirs = await readdir(CLAUDE_DIR);\n } catch {\n throw error(500, \"Cannot read Claude sessions directory\");\n }\n for (const projectDir of projectDirs) {\n const candidate = join(CLAUDE_DIR, projectDir, `${sessionId}.jsonl`);\n try {\n await access(candidate);\n filePath = candidate;\n project = decodeProjectName(projectDir);\n break;\n } catch {\n continue;\n }\n }\n if (!filePath) {\n throw error(404, `Session ${sessionId} not found`);\n }\n }\n try {\n const timeline = await parseSession(filePath, sessionId, project);\n return { timeline };\n } catch (e) {\n throw error(500, `Failed to parse session: ${e instanceof Error ? e.message : \"Unknown error\"}`);\n }\n};\nexport {\n load\n};\n","import * as server from '../entries/pages/sessions/_sessionId_/_page.server.ts.js';\n\nexport const index = 3;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/sessions/_sessionId_/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/sessions/[sessionId]/+page.server.ts\";\nexport const imports = [\"_app/immutable/nodes/3.CaEmUkA2.js\",\"_app/immutable/chunks/CP-o74wi.js\",\"_app/immutable/chunks/DApgqo7x.js\",\"_app/immutable/chunks/8LyLqy0e.js\",\"_app/immutable/chunks/CZWwZlGk.js\",\"_app/immutable/chunks/CCa20sJM.js\",\"_app/immutable/chunks/BoUXsunA.js\",\"_app/immutable/chunks/DCcb0kkP.js\"];\nexport const stylesheets = [\"_app/immutable/assets/3.BP1aEJ1A.css\"];\nexport const fonts = [];\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { e as escape_html } from './escaping-CqgfEcN3.js';
|
|
2
|
+
|
|
3
|
+
const PLAN_LABELS = { api: "API", pro: "Pro", max: "Max", enterprise: "Enterprise" };
|
|
4
|
+
function loadPlan() {
|
|
5
|
+
return "api";
|
|
6
|
+
}
|
|
7
|
+
let plan = loadPlan();
|
|
8
|
+
function getPlan() {
|
|
9
|
+
return plan;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function _layout($$renderer, $$props) {
|
|
13
|
+
$$renderer.component(($$renderer2) => {
|
|
14
|
+
let { children } = $$props;
|
|
15
|
+
$$renderer2.push(`<div class="min-h-screen flex flex-col"><header class="bg-surface-900/80 backdrop-blur-sm sticky top-0 z-50"><nav class="px-4 h-14 flex items-center gap-4"><a href="/" class="flex items-center gap-2 text-surface-100 hover:text-white transition-colors"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" class="w-6 h-6"><defs><linearGradient id="ghost-grad" x1="0" y1="0" x2="0" y2="1"><stop offset="0%" stop-color="#67e8f9"></stop><stop offset="100%" stop-color="#818cf8"></stop></linearGradient></defs><path d="M16 2C9.373 2 4 7.373 4 14v14l3-3 3 3 3-3 3 3 3-3 3 3 3-3 3 3V14c0-6.627-5.373-12-12-12z" fill="url(#ghost-grad)"></path><circle cx="12" cy="14" r="2.5" fill="#0f172a"></circle><circle cx="20" cy="14" r="2.5" fill="#0f172a"></circle><circle cx="13" cy="13.2" r="0.8" fill="#fff"></circle><circle cx="21" cy="13.2" r="0.8" fill="#fff"></circle></svg> <span class="font-semibold tracking-tight">Agent Replay</span></a> <span class="text-surface-600 text-xs hidden sm:inline">DevTools for AI Agents</span> <div class="ml-auto relative"><button class="px-2.5 py-1 rounded-full text-xs font-medium bg-surface-800 text-surface-300 hover:text-surface-100 border border-surface-700 hover:border-surface-600 transition-colors">${escape_html(PLAN_LABELS[getPlan()])}</button> `);
|
|
16
|
+
{
|
|
17
|
+
$$renderer2.push("<!--[!-->");
|
|
18
|
+
}
|
|
19
|
+
$$renderer2.push(`<!--]--></div></nav> <div class="h-[2px] bg-gradient-to-r from-purple-500/50 via-blue-500/50 to-cyan-500/50"></div></header> <main class="flex-1">`);
|
|
20
|
+
children($$renderer2);
|
|
21
|
+
$$renderer2.push(`<!----></main></div>`);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { _layout as default };
|
|
26
|
+
//# sourceMappingURL=_layout.svelte-BK7oCPlN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_layout.svelte-BK7oCPlN.js","sources":["../../../.svelte-kit/adapter-node/chunks/plan.svelte.js","../../../.svelte-kit/adapter-node/entries/pages/_layout.svelte.js"],"sourcesContent":["import \"clsx\";\nconst PLAN_LABELS = { api: \"API\", pro: \"Pro\", max: \"Max\", enterprise: \"Enterprise\" };\nfunction loadPlan() {\n return \"api\";\n}\nlet plan = loadPlan();\nfunction getPlan() {\n return plan;\n}\nfunction isIncludedPlan() {\n return plan !== \"api\";\n}\nexport {\n PLAN_LABELS as P,\n getPlan as g,\n isIncludedPlan as i\n};\n","import { e as escape_html } from \"../../chunks/escaping.js\";\nimport \"clsx\";\nimport { P as PLAN_LABELS, g as getPlan } from \"../../chunks/plan.svelte.js\";\nfunction _layout($$renderer, $$props) {\n $$renderer.component(($$renderer2) => {\n let { children } = $$props;\n $$renderer2.push(`<div class=\"min-h-screen flex flex-col\"><header class=\"bg-surface-900/80 backdrop-blur-sm sticky top-0 z-50\"><nav class=\"px-4 h-14 flex items-center gap-4\"><a href=\"/\" class=\"flex items-center gap-2 text-surface-100 hover:text-white transition-colors\"><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\" class=\"w-6 h-6\"><defs><linearGradient id=\"ghost-grad\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\"><stop offset=\"0%\" stop-color=\"#67e8f9\"></stop><stop offset=\"100%\" stop-color=\"#818cf8\"></stop></linearGradient></defs><path d=\"M16 2C9.373 2 4 7.373 4 14v14l3-3 3 3 3-3 3 3 3-3 3 3 3-3 3 3V14c0-6.627-5.373-12-12-12z\" fill=\"url(#ghost-grad)\"></path><circle cx=\"12\" cy=\"14\" r=\"2.5\" fill=\"#0f172a\"></circle><circle cx=\"20\" cy=\"14\" r=\"2.5\" fill=\"#0f172a\"></circle><circle cx=\"13\" cy=\"13.2\" r=\"0.8\" fill=\"#fff\"></circle><circle cx=\"21\" cy=\"13.2\" r=\"0.8\" fill=\"#fff\"></circle></svg> <span class=\"font-semibold tracking-tight\">Agent Replay</span></a> <span class=\"text-surface-600 text-xs hidden sm:inline\">DevTools for AI Agents</span> <div class=\"ml-auto relative\"><button class=\"px-2.5 py-1 rounded-full text-xs font-medium bg-surface-800 text-surface-300 hover:text-surface-100 border border-surface-700 hover:border-surface-600 transition-colors\">${escape_html(PLAN_LABELS[getPlan()])}</button> `);\n {\n $$renderer2.push(\"<!--[!-->\");\n }\n $$renderer2.push(`<!--]--></div></nav> <div class=\"h-[2px] bg-gradient-to-r from-purple-500/50 via-blue-500/50 to-cyan-500/50\"></div></header> <main class=\"flex-1\">`);\n children($$renderer2);\n $$renderer2.push(`<!----></main></div>`);\n });\n}\nexport {\n _layout as default\n};\n"],"names":[],"mappings":";;AACA,MAAM,WAAW,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE;AACpF,SAAS,QAAQ,GAAG;AACpB,EAAE,OAAO,KAAK;AACd;AACA,IAAI,IAAI,GAAG,QAAQ,EAAE;AACrB,SAAS,OAAO,GAAG;AACnB,EAAE,OAAO,IAAI;AACb;;ACLA,SAAS,OAAO,CAAC,UAAU,EAAE,OAAO,EAAE;AACtC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,WAAW,KAAK;AACxC,IAAI,IAAI,EAAE,QAAQ,EAAE,GAAG,OAAO;AAC9B,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,utCAAutC,EAAE,WAAW,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;AAC/xC,IAAI;AACJ,MAAM,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC;AACnC,IAAI;AACJ,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,kJAAkJ,CAAC,CAAC;AAC1K,IAAI,QAAQ,CAAC,WAAW,CAAC;AACzB,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,oBAAoB,CAAC,CAAC;AAC5C,EAAE,CAAC,CAAC;AACJ;;;;"}
|