@agentuity/runtime 0.1.13 → 0.1.14
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/package.json +8 -8
- package/src/_config.ts +13 -0
- package/src/_standalone.ts +167 -19
- package/src/index.ts +1 -0
- package/dist/_config.d.ts +0 -90
- package/dist/_config.d.ts.map +0 -1
- package/dist/_config.js +0 -135
- package/dist/_config.js.map +0 -1
- package/dist/_context.d.ts +0 -76
- package/dist/_context.d.ts.map +0 -1
- package/dist/_context.js +0 -147
- package/dist/_context.js.map +0 -1
- package/dist/_events.d.ts +0 -64
- package/dist/_events.d.ts.map +0 -1
- package/dist/_events.js +0 -92
- package/dist/_events.js.map +0 -1
- package/dist/_idle.d.ts +0 -7
- package/dist/_idle.d.ts.map +0 -1
- package/dist/_idle.js +0 -10
- package/dist/_idle.js.map +0 -1
- package/dist/_metadata.d.ts +0 -117
- package/dist/_metadata.d.ts.map +0 -1
- package/dist/_metadata.js +0 -246
- package/dist/_metadata.js.map +0 -1
- package/dist/_process-protection.d.ts +0 -25
- package/dist/_process-protection.d.ts.map +0 -1
- package/dist/_process-protection.js +0 -65
- package/dist/_process-protection.js.map +0 -1
- package/dist/_server.d.ts +0 -46
- package/dist/_server.d.ts.map +0 -1
- package/dist/_server.js +0 -85
- package/dist/_server.js.map +0 -1
- package/dist/_services.d.ts +0 -21
- package/dist/_services.d.ts.map +0 -1
- package/dist/_services.js +0 -248
- package/dist/_services.js.map +0 -1
- package/dist/_standalone.d.ts +0 -168
- package/dist/_standalone.d.ts.map +0 -1
- package/dist/_standalone.js +0 -441
- package/dist/_standalone.js.map +0 -1
- package/dist/_tokens.d.ts +0 -12
- package/dist/_tokens.d.ts.map +0 -1
- package/dist/_tokens.js +0 -96
- package/dist/_tokens.js.map +0 -1
- package/dist/_util.d.ts +0 -16
- package/dist/_util.d.ts.map +0 -1
- package/dist/_util.js +0 -54
- package/dist/_util.js.map +0 -1
- package/dist/_validation.d.ts +0 -89
- package/dist/_validation.d.ts.map +0 -1
- package/dist/_validation.js +0 -29
- package/dist/_validation.js.map +0 -1
- package/dist/_waituntil.d.ts +0 -18
- package/dist/_waituntil.d.ts.map +0 -1
- package/dist/_waituntil.js +0 -97
- package/dist/_waituntil.js.map +0 -1
- package/dist/agent.d.ts +0 -1210
- package/dist/agent.d.ts.map +0 -1
- package/dist/agent.js +0 -903
- package/dist/agent.js.map +0 -1
- package/dist/app.d.ts +0 -322
- package/dist/app.d.ts.map +0 -1
- package/dist/app.js +0 -160
- package/dist/app.js.map +0 -1
- package/dist/bun-s3-patch.d.ts +0 -37
- package/dist/bun-s3-patch.d.ts.map +0 -1
- package/dist/bun-s3-patch.js +0 -139
- package/dist/bun-s3-patch.js.map +0 -1
- package/dist/cors.d.ts +0 -42
- package/dist/cors.d.ts.map +0 -1
- package/dist/cors.js +0 -117
- package/dist/cors.js.map +0 -1
- package/dist/devmode.d.ts +0 -3
- package/dist/devmode.d.ts.map +0 -1
- package/dist/devmode.js +0 -167
- package/dist/devmode.js.map +0 -1
- package/dist/eval.d.ts +0 -91
- package/dist/eval.d.ts.map +0 -1
- package/dist/eval.js +0 -16
- package/dist/eval.js.map +0 -1
- package/dist/handlers/cron.d.ts +0 -47
- package/dist/handlers/cron.d.ts.map +0 -1
- package/dist/handlers/cron.js +0 -49
- package/dist/handlers/cron.js.map +0 -1
- package/dist/handlers/index.d.ts +0 -5
- package/dist/handlers/index.d.ts.map +0 -1
- package/dist/handlers/index.js +0 -5
- package/dist/handlers/index.js.map +0 -1
- package/dist/handlers/sse.d.ts +0 -91
- package/dist/handlers/sse.d.ts.map +0 -1
- package/dist/handlers/sse.js +0 -213
- package/dist/handlers/sse.js.map +0 -1
- package/dist/handlers/stream.d.ts +0 -52
- package/dist/handlers/stream.d.ts.map +0 -1
- package/dist/handlers/stream.js +0 -116
- package/dist/handlers/stream.js.map +0 -1
- package/dist/handlers/websocket.d.ts +0 -49
- package/dist/handlers/websocket.d.ts.map +0 -1
- package/dist/handlers/websocket.js +0 -143
- package/dist/handlers/websocket.js.map +0 -1
- package/dist/index.d.ts +0 -71
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -58
- package/dist/index.js.map +0 -1
- package/dist/logger/console.d.ts +0 -70
- package/dist/logger/console.d.ts.map +0 -1
- package/dist/logger/console.js +0 -274
- package/dist/logger/console.js.map +0 -1
- package/dist/logger/index.d.ts +0 -3
- package/dist/logger/index.d.ts.map +0 -1
- package/dist/logger/index.js +0 -3
- package/dist/logger/index.js.map +0 -1
- package/dist/logger/internal.d.ts +0 -79
- package/dist/logger/internal.d.ts.map +0 -1
- package/dist/logger/internal.js +0 -133
- package/dist/logger/internal.js.map +0 -1
- package/dist/logger/logger.d.ts +0 -41
- package/dist/logger/logger.d.ts.map +0 -1
- package/dist/logger/logger.js +0 -2
- package/dist/logger/logger.js.map +0 -1
- package/dist/logger/user.d.ts +0 -8
- package/dist/logger/user.d.ts.map +0 -1
- package/dist/logger/user.js +0 -7
- package/dist/logger/user.js.map +0 -1
- package/dist/logger/util.d.ts +0 -11
- package/dist/logger/util.d.ts.map +0 -1
- package/dist/logger/util.js +0 -77
- package/dist/logger/util.js.map +0 -1
- package/dist/middleware.d.ts +0 -112
- package/dist/middleware.d.ts.map +0 -1
- package/dist/middleware.js +0 -507
- package/dist/middleware.js.map +0 -1
- package/dist/otel/config.d.ts +0 -19
- package/dist/otel/config.d.ts.map +0 -1
- package/dist/otel/config.js +0 -26
- package/dist/otel/config.js.map +0 -1
- package/dist/otel/console.d.ts +0 -33
- package/dist/otel/console.d.ts.map +0 -1
- package/dist/otel/console.js +0 -86
- package/dist/otel/console.js.map +0 -1
- package/dist/otel/exporters/index.d.ts +0 -4
- package/dist/otel/exporters/index.d.ts.map +0 -1
- package/dist/otel/exporters/index.js +0 -4
- package/dist/otel/exporters/index.js.map +0 -1
- package/dist/otel/exporters/jsonl-log-exporter.d.ts +0 -36
- package/dist/otel/exporters/jsonl-log-exporter.d.ts.map +0 -1
- package/dist/otel/exporters/jsonl-log-exporter.js +0 -103
- package/dist/otel/exporters/jsonl-log-exporter.js.map +0 -1
- package/dist/otel/exporters/jsonl-metric-exporter.d.ts +0 -40
- package/dist/otel/exporters/jsonl-metric-exporter.d.ts.map +0 -1
- package/dist/otel/exporters/jsonl-metric-exporter.js +0 -104
- package/dist/otel/exporters/jsonl-metric-exporter.js.map +0 -1
- package/dist/otel/exporters/jsonl-trace-exporter.d.ts +0 -36
- package/dist/otel/exporters/jsonl-trace-exporter.d.ts.map +0 -1
- package/dist/otel/exporters/jsonl-trace-exporter.js +0 -111
- package/dist/otel/exporters/jsonl-trace-exporter.js.map +0 -1
- package/dist/otel/fetch.d.ts +0 -12
- package/dist/otel/fetch.d.ts.map +0 -1
- package/dist/otel/fetch.js +0 -82
- package/dist/otel/fetch.js.map +0 -1
- package/dist/otel/http.d.ts +0 -16
- package/dist/otel/http.d.ts.map +0 -1
- package/dist/otel/http.js +0 -44
- package/dist/otel/http.js.map +0 -1
- package/dist/otel/logger.d.ts +0 -37
- package/dist/otel/logger.d.ts.map +0 -1
- package/dist/otel/logger.js +0 -268
- package/dist/otel/logger.js.map +0 -1
- package/dist/otel/otel.d.ts +0 -65
- package/dist/otel/otel.d.ts.map +0 -1
- package/dist/otel/otel.js +0 -261
- package/dist/otel/otel.js.map +0 -1
- package/dist/router.d.ts +0 -100
- package/dist/router.d.ts.map +0 -1
- package/dist/router.js +0 -163
- package/dist/router.js.map +0 -1
- package/dist/services/evalrun/composite.d.ts +0 -21
- package/dist/services/evalrun/composite.d.ts.map +0 -1
- package/dist/services/evalrun/composite.js +0 -26
- package/dist/services/evalrun/composite.js.map +0 -1
- package/dist/services/evalrun/http.d.ts +0 -24
- package/dist/services/evalrun/http.d.ts.map +0 -1
- package/dist/services/evalrun/http.js +0 -86
- package/dist/services/evalrun/http.js.map +0 -1
- package/dist/services/evalrun/index.d.ts +0 -5
- package/dist/services/evalrun/index.d.ts.map +0 -1
- package/dist/services/evalrun/index.js +0 -5
- package/dist/services/evalrun/index.js.map +0 -1
- package/dist/services/evalrun/json.d.ts +0 -21
- package/dist/services/evalrun/json.d.ts.map +0 -1
- package/dist/services/evalrun/json.js +0 -38
- package/dist/services/evalrun/json.js.map +0 -1
- package/dist/services/evalrun/local.d.ts +0 -19
- package/dist/services/evalrun/local.d.ts.map +0 -1
- package/dist/services/evalrun/local.js +0 -22
- package/dist/services/evalrun/local.js.map +0 -1
- package/dist/services/local/_db.d.ts +0 -4
- package/dist/services/local/_db.d.ts.map +0 -1
- package/dist/services/local/_db.js +0 -123
- package/dist/services/local/_db.js.map +0 -1
- package/dist/services/local/_router.d.ts +0 -3
- package/dist/services/local/_router.d.ts.map +0 -1
- package/dist/services/local/_router.js +0 -28
- package/dist/services/local/_router.js.map +0 -1
- package/dist/services/local/_util.d.ts +0 -18
- package/dist/services/local/_util.d.ts.map +0 -1
- package/dist/services/local/_util.js +0 -44
- package/dist/services/local/_util.js.map +0 -1
- package/dist/services/local/index.d.ts +0 -7
- package/dist/services/local/index.d.ts.map +0 -1
- package/dist/services/local/index.js +0 -7
- package/dist/services/local/index.js.map +0 -1
- package/dist/services/local/keyvalue.d.ts +0 -17
- package/dist/services/local/keyvalue.d.ts.map +0 -1
- package/dist/services/local/keyvalue.js +0 -125
- package/dist/services/local/keyvalue.js.map +0 -1
- package/dist/services/local/stream.d.ts +0 -12
- package/dist/services/local/stream.d.ts.map +0 -1
- package/dist/services/local/stream.js +0 -262
- package/dist/services/local/stream.js.map +0 -1
- package/dist/services/local/vector.d.ts +0 -17
- package/dist/services/local/vector.d.ts.map +0 -1
- package/dist/services/local/vector.js +0 -303
- package/dist/services/local/vector.js.map +0 -1
- package/dist/services/sandbox/http.d.ts +0 -13
- package/dist/services/sandbox/http.d.ts.map +0 -1
- package/dist/services/sandbox/http.js +0 -130
- package/dist/services/sandbox/http.js.map +0 -1
- package/dist/services/sandbox/index.d.ts +0 -2
- package/dist/services/sandbox/index.d.ts.map +0 -1
- package/dist/services/sandbox/index.js +0 -2
- package/dist/services/sandbox/index.js.map +0 -1
- package/dist/services/session/composite.d.ts +0 -21
- package/dist/services/session/composite.d.ts.map +0 -1
- package/dist/services/session/composite.js +0 -26
- package/dist/services/session/composite.js.map +0 -1
- package/dist/services/session/http.d.ts +0 -34
- package/dist/services/session/http.d.ts.map +0 -1
- package/dist/services/session/http.js +0 -80
- package/dist/services/session/http.js.map +0 -1
- package/dist/services/session/index.d.ts +0 -5
- package/dist/services/session/index.d.ts.map +0 -1
- package/dist/services/session/index.js +0 -5
- package/dist/services/session/index.js.map +0 -1
- package/dist/services/session/json.d.ts +0 -22
- package/dist/services/session/json.d.ts.map +0 -1
- package/dist/services/session/json.js +0 -35
- package/dist/services/session/json.js.map +0 -1
- package/dist/services/session/local.d.ts +0 -19
- package/dist/services/session/local.d.ts.map +0 -1
- package/dist/services/session/local.js +0 -23
- package/dist/services/session/local.js.map +0 -1
- package/dist/services/thread/local.d.ts +0 -20
- package/dist/services/thread/local.d.ts.map +0 -1
- package/dist/services/thread/local.js +0 -158
- package/dist/services/thread/local.js.map +0 -1
- package/dist/session.d.ts +0 -734
- package/dist/session.d.ts.map +0 -1
- package/dist/session.js +0 -1139
- package/dist/session.js.map +0 -1
- package/dist/validator.d.ts +0 -142
- package/dist/validator.d.ts.map +0 -1
- package/dist/validator.js +0 -149
- package/dist/validator.js.map +0 -1
- package/dist/web.d.ts +0 -8
- package/dist/web.d.ts.map +0 -1
- package/dist/web.js +0 -66
- package/dist/web.js.map +0 -1
- package/dist/workbench.d.ts +0 -17
- package/dist/workbench.d.ts.map +0 -1
- package/dist/workbench.js +0 -507
- package/dist/workbench.js.map +0 -1
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { upgradeWebSocket } from 'hono/bun';
|
|
2
|
-
import { context as otelContext, ROOT_CONTEXT } from '@opentelemetry/api';
|
|
3
|
-
import { getAgentAsyncLocalStorage } from '../_context';
|
|
4
|
-
/**
|
|
5
|
-
* Creates a WebSocket middleware for handling WebSocket connections.
|
|
6
|
-
*
|
|
7
|
-
* Use with router.get() to create a WebSocket endpoint:
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* ```typescript
|
|
11
|
-
* import { createRouter, websocket } from '@agentuity/runtime';
|
|
12
|
-
*
|
|
13
|
-
* const router = createRouter();
|
|
14
|
-
*
|
|
15
|
-
* router.get('/ws', websocket((c, ws) => {
|
|
16
|
-
* ws.onOpen(() => {
|
|
17
|
-
* c.var.logger.info('WebSocket opened');
|
|
18
|
-
* ws.send('Welcome!');
|
|
19
|
-
* });
|
|
20
|
-
*
|
|
21
|
-
* ws.onMessage((event) => {
|
|
22
|
-
* c.var.logger.info('Received:', event.data);
|
|
23
|
-
* ws.send('Echo: ' + event.data);
|
|
24
|
-
* });
|
|
25
|
-
*
|
|
26
|
-
* ws.onClose(() => {
|
|
27
|
-
* c.var.logger.info('WebSocket closed');
|
|
28
|
-
* });
|
|
29
|
-
* }));
|
|
30
|
-
* ```
|
|
31
|
-
*
|
|
32
|
-
* @param handler - Handler function receiving context and WebSocket connection
|
|
33
|
-
* @returns Hono middleware handler for WebSocket upgrade
|
|
34
|
-
*/
|
|
35
|
-
export function websocket(handler) {
|
|
36
|
-
const wsHandler = upgradeWebSocket((c) => {
|
|
37
|
-
let openHandler;
|
|
38
|
-
let messageHandler;
|
|
39
|
-
let closeHandler;
|
|
40
|
-
let initialized = false;
|
|
41
|
-
const asyncLocalStorage = getAgentAsyncLocalStorage();
|
|
42
|
-
const capturedContext = asyncLocalStorage.getStore();
|
|
43
|
-
const wsConnection = {
|
|
44
|
-
onOpen: (h) => {
|
|
45
|
-
openHandler = h;
|
|
46
|
-
},
|
|
47
|
-
onMessage: (h) => {
|
|
48
|
-
messageHandler = h;
|
|
49
|
-
},
|
|
50
|
-
onClose: (h) => {
|
|
51
|
-
closeHandler = h;
|
|
52
|
-
},
|
|
53
|
-
send: (_data) => {
|
|
54
|
-
// This will be bound to the actual ws in the handlers
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
// IMPORTANT: We run in ROOT_CONTEXT (no active OTEL span) to avoid a Bun bug
|
|
58
|
-
// where OTEL-instrumented fetch conflicts with streaming responses.
|
|
59
|
-
// See: https://github.com/agentuity/sdk/issues/471
|
|
60
|
-
// See: https://github.com/oven-sh/bun/issues/24766
|
|
61
|
-
const runHandler = () => {
|
|
62
|
-
otelContext.with(ROOT_CONTEXT, () => {
|
|
63
|
-
if (capturedContext) {
|
|
64
|
-
asyncLocalStorage.run(capturedContext, () => handler(c, wsConnection));
|
|
65
|
-
}
|
|
66
|
-
else {
|
|
67
|
-
handler(c, wsConnection);
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
initialized = true;
|
|
71
|
-
};
|
|
72
|
-
runHandler();
|
|
73
|
-
return {
|
|
74
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
75
|
-
onOpen: async (event, ws) => {
|
|
76
|
-
try {
|
|
77
|
-
wsConnection.send = (data) => ws.send(data);
|
|
78
|
-
if (openHandler) {
|
|
79
|
-
const h = openHandler;
|
|
80
|
-
await otelContext.with(ROOT_CONTEXT, async () => {
|
|
81
|
-
if (capturedContext) {
|
|
82
|
-
await asyncLocalStorage.run(capturedContext, () => h(event));
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
await h(event);
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
catch (err) {
|
|
91
|
-
c.var.logger?.error('WebSocket onOpen error:', err);
|
|
92
|
-
throw err;
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
96
|
-
onMessage: async (event, ws) => {
|
|
97
|
-
try {
|
|
98
|
-
if (!initialized) {
|
|
99
|
-
wsConnection.send = (data) => ws.send(data);
|
|
100
|
-
runHandler();
|
|
101
|
-
}
|
|
102
|
-
if (messageHandler) {
|
|
103
|
-
const h = messageHandler;
|
|
104
|
-
await otelContext.with(ROOT_CONTEXT, async () => {
|
|
105
|
-
if (capturedContext) {
|
|
106
|
-
await asyncLocalStorage.run(capturedContext, () => h(event));
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
await h(event);
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
catch (err) {
|
|
115
|
-
c.var.logger?.error('WebSocket onMessage error:', err);
|
|
116
|
-
throw err;
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
120
|
-
onClose: async (event, _ws) => {
|
|
121
|
-
try {
|
|
122
|
-
if (closeHandler) {
|
|
123
|
-
const h = closeHandler;
|
|
124
|
-
await otelContext.with(ROOT_CONTEXT, async () => {
|
|
125
|
-
if (capturedContext) {
|
|
126
|
-
await asyncLocalStorage.run(capturedContext, () => h(event));
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
await h(event);
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
catch (err) {
|
|
135
|
-
c.var.logger?.error('WebSocket onClose error:', err);
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
};
|
|
139
|
-
});
|
|
140
|
-
const middleware = (c, next) => wsHandler(c, next);
|
|
141
|
-
return middleware;
|
|
142
|
-
}
|
|
143
|
-
//# sourceMappingURL=websocket.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"websocket.js","sourceRoot":"","sources":["../../src/handlers/websocket.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAsBxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAA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gentRuntimeState, type CreateEvalConfig, type AgentValidator, type Agent, type CreateAgentConfig, type AgentRunner, getGlobalRuntimeState, getAgentRuntime, type AgentName, type AgentRegistry, registerAgent, setAgentConfig, getAgentConfig, type CreateAgentConfigExplicit, createAgent, populateAgentsRegistry, createAgentMiddleware, getAgents, runAgentSetups, runAgentShutdowns, runInAgentContext, } from './agent';
|
|
2
|
-
export { type AppConfig, type CompressionConfig, type CorsConfig, type Variables, type TriggerType, type PrivateVariables, type Env, type AppResult, createApp, getApp, getAppState, getAppConfig, runShutdown, fireEvent, } from './app';
|
|
3
|
-
export { createTrustedCorsOrigin, type TrustedCorsOriginOptions } from './cors';
|
|
4
|
-
export { addEventListener, removeEventListener } from './_events';
|
|
5
|
-
export { createBaseMiddleware, createCorsMiddleware, createOtelMiddleware, createCompressionMiddleware, createWebSessionMiddleware, getSessionSecret, } from './middleware';
|
|
6
|
-
export { register } from './otel/config';
|
|
7
|
-
export { createServices } from './_services';
|
|
8
|
-
export { enableProcessExitProtection } from './_process-protection';
|
|
9
|
-
export { BEACON_SCRIPT, validateBeaconScript } from '@agentuity/frontend';
|
|
10
|
-
export { internalExit } from './_process-protection';
|
|
11
|
-
export { registerDevModeRoutes } from './devmode';
|
|
12
|
-
export { type HonoEnv, type WebSocketConnection, createRouter } from './router';
|
|
13
|
-
export { websocket, type WebSocketHandler, sse, type SSEMessage, type SSEStream, type SSEHandler, stream, type StreamHandler, cron, type CronHandler, type CronMetadata, } from './handlers';
|
|
14
|
-
export { EvalHandlerResultSchema, type EvalContext, type EvalRunResultMetadata, type EvalHandlerResult, type EvalRunResultSuccess, type EvalRunResultError, type EvalRunResult, type CreateEvalRunRequest, type ExternalEvalMetadata, type EvalMetadata, type EvalFunction, type Eval, } from './eval';
|
|
15
|
-
export { type ThreadEventName, type SessionEventName, type ThreadState, type MergeOperation, type Thread, type Session, type ThreadIDProvider, type ThreadProvider, type SessionProvider, generateId, DefaultThreadIDProvider, DefaultThread, LazyThreadState, } from './session';
|
|
16
|
-
export { LocalThreadProvider } from './services/thread/local';
|
|
17
|
-
export { createWorkbenchExecutionRoute, createWorkbenchRouter, createWorkbenchMetadataRoute, createWorkbenchWebsocketRoute, } from './workbench';
|
|
18
|
-
export { createWebRouter } from './web';
|
|
19
|
-
export { type RouteValidator, validator } from './validator';
|
|
20
|
-
export type { Logger } from './logger';
|
|
21
|
-
export { getRouter, setGlobalRouter, createLogger, getLogger, setGlobalLogger, getTracer, setGlobalTracer, addSpanProcessor, getSpanProcessors, privateContext, notifyReady, getServer, AGENT_CONTEXT_PROPERTIES, } from './_server';
|
|
22
|
-
export { hasWaitUntilPending } from './_waituntil';
|
|
23
|
-
export { inAgentContext, inHTTPContext, getAgentContext, getHTTPContext } from './_context';
|
|
24
|
-
export { createAgentContext, StandaloneAgentContext, type StandaloneContextOptions, type InvokeOptions, } from './_standalone';
|
|
25
|
-
export { HTTPEvalRunEventProvider, LocalEvalRunEventProvider, JSONEvalRunEventProvider, CompositeEvalRunEventProvider, } from './services/evalrun';
|
|
26
|
-
export { loadBuildMetadata } from './_metadata';
|
|
27
|
-
export { getOrganizationId, getProjectId, getDeploymentId, isDevMode, isProduction, } from './_config';
|
|
28
|
-
export { getEvalRunEventProvider, getThreadProvider, getSessionProvider } from './_services';
|
|
29
|
-
export type { RouteSchema, GetRouteSchema } from './_validation';
|
|
30
|
-
/**
|
|
31
|
-
* Application state interface that gets automatically augmented based on your createApp setup function.
|
|
32
|
-
*
|
|
33
|
-
* This interface is empty by default but gets populated with strongly-typed properties
|
|
34
|
-
* when you define a setup function in createApp(). The Agentuity build tool automatically
|
|
35
|
-
* generates type augmentations in `.agentuity/.agentuity_runtime.ts`.
|
|
36
|
-
*
|
|
37
|
-
* **How it works:**
|
|
38
|
-
* 1. You define setup() in createApp() that returns an object
|
|
39
|
-
* 2. The build tool generates module augmentation for this interface
|
|
40
|
-
* 3. All agents get strongly-typed access to app state via `ctx.app`
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* ```typescript
|
|
44
|
-
* // In your app.ts:
|
|
45
|
-
* const app = await createApp({
|
|
46
|
-
* setup: async () => {
|
|
47
|
-
* const db = await connectDatabase();
|
|
48
|
-
* const redis = await connectRedis();
|
|
49
|
-
* return { db, redis };
|
|
50
|
-
* }
|
|
51
|
-
* });
|
|
52
|
-
*
|
|
53
|
-
* // In your agent:
|
|
54
|
-
* const agent = createAgent('user-query', {
|
|
55
|
-
* handler: async (ctx, input) => {
|
|
56
|
-
* // ctx.app is strongly typed with { db, redis }!
|
|
57
|
-
* const user = await ctx.app.db.query('SELECT * FROM users');
|
|
58
|
-
* await ctx.app.redis.set('key', 'value');
|
|
59
|
-
* return user;
|
|
60
|
-
* }
|
|
61
|
-
* });
|
|
62
|
-
* ```
|
|
63
|
-
*
|
|
64
|
-
* **Note:** If you're not seeing type hints for `ctx.app`, make sure you've run `bun run build`
|
|
65
|
-
* to generate the type augmentations.
|
|
66
|
-
*/
|
|
67
|
-
export interface AppState {
|
|
68
|
-
}
|
|
69
|
-
export { bootstrapRuntimeEnv, type RuntimeBootstrapOptions } from '@agentuity/server';
|
|
70
|
-
export { patchBunS3ForStorageDev, isAgentuityStorageEndpoint } from './bun-s3-patch';
|
|
71
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,KAAK,EACV,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,qBAAqB,EACrB,eAAe,EACf,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,aAAa,EACb,cAAc,EACd,cAAc,EACd,KAAK,yBAAyB,EAC9B,WAAW,EACX,sBAAsB,EACtB,qBAAq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AGvB,OAAO,EACN,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,6BAA6B,GAC7B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGhD,OAAO,EACN,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,SAAS,EACT,YAAY,GACZ,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAG7F,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,MAAM,WAAW,QAAQ;CAAG;AAK5B,OAAO,EAAE,mBAAmB,EAAE,KAAK,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAGtF,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
// agent.ts exports
|
|
2
|
-
export { getGlobalRuntimeState, getAgentRuntime, registerAgent, setAgentConfig, getAgentConfig, createAgent, populateAgentsRegistry, createAgentMiddleware, getAgents, runAgentSetups, runAgentShutdowns, runInAgentContext, } from './agent';
|
|
3
|
-
// app.ts exports (all app-related functionality)
|
|
4
|
-
export { createApp, getApp, getAppState, getAppConfig, runShutdown, fireEvent, } from './app';
|
|
5
|
-
// cors.ts exports (trusted origin helpers)
|
|
6
|
-
export { createTrustedCorsOrigin } from './cors';
|
|
7
|
-
export { addEventListener, removeEventListener } from './_events';
|
|
8
|
-
// middleware.ts exports (Vite-native)
|
|
9
|
-
export { createBaseMiddleware, createCorsMiddleware, createOtelMiddleware, createCompressionMiddleware, createWebSessionMiddleware, getSessionSecret, } from './middleware';
|
|
10
|
-
// Internal exports needed by generated entry files
|
|
11
|
-
export { register } from './otel/config';
|
|
12
|
-
export { createServices } from './_services';
|
|
13
|
-
export { enableProcessExitProtection } from './_process-protection';
|
|
14
|
-
// Re-export beacon script for generated webanalytics.ts
|
|
15
|
-
export { BEACON_SCRIPT, validateBeaconScript } from '@agentuity/frontend';
|
|
16
|
-
// Internal exports (not in main index, imported by CLI only)
|
|
17
|
-
export { internalExit } from './_process-protection';
|
|
18
|
-
// devmode.ts exports
|
|
19
|
-
export { registerDevModeRoutes } from './devmode';
|
|
20
|
-
// router.ts exports
|
|
21
|
-
export { createRouter } from './router';
|
|
22
|
-
// protocol handler exports (websocket, sse, stream, cron)
|
|
23
|
-
export { websocket, sse, stream, cron, } from './handlers';
|
|
24
|
-
// eval.ts exports
|
|
25
|
-
export { EvalHandlerResultSchema, } from './eval';
|
|
26
|
-
// session.ts exports
|
|
27
|
-
export { generateId, DefaultThreadIDProvider, DefaultThread, LazyThreadState, } from './session';
|
|
28
|
-
// services/thread/local exports
|
|
29
|
-
export { LocalThreadProvider } from './services/thread/local';
|
|
30
|
-
// workbench.ts exports
|
|
31
|
-
export { createWorkbenchExecutionRoute, createWorkbenchRouter, createWorkbenchMetadataRoute, createWorkbenchWebsocketRoute, } from './workbench';
|
|
32
|
-
// web.ts exports
|
|
33
|
-
export { createWebRouter } from './web';
|
|
34
|
-
// validator.ts exports
|
|
35
|
-
export { validator } from './validator';
|
|
36
|
-
// _server.ts exports
|
|
37
|
-
export { getRouter, setGlobalRouter, createLogger, getLogger, setGlobalLogger, getTracer, setGlobalTracer, addSpanProcessor, getSpanProcessors, privateContext, notifyReady, getServer, AGENT_CONTEXT_PROPERTIES, } from './_server';
|
|
38
|
-
// _waituntil.ts exports
|
|
39
|
-
export { hasWaitUntilPending } from './_waituntil';
|
|
40
|
-
// _context.ts exports (for auth integration)
|
|
41
|
-
export { inAgentContext, inHTTPContext, getAgentContext, getHTTPContext } from './_context';
|
|
42
|
-
// _standalone.ts exports
|
|
43
|
-
export { createAgentContext, StandaloneAgentContext, } from './_standalone';
|
|
44
|
-
// services/evalrun exports
|
|
45
|
-
export { HTTPEvalRunEventProvider, LocalEvalRunEventProvider, JSONEvalRunEventProvider, CompositeEvalRunEventProvider, } from './services/evalrun';
|
|
46
|
-
// for loading metadata
|
|
47
|
-
export { loadBuildMetadata } from './_metadata';
|
|
48
|
-
// config exports (for analytics and other runtime config access)
|
|
49
|
-
export { getOrganizationId, getProjectId, getDeploymentId, isDevMode, isProduction, } from './_config';
|
|
50
|
-
// _services.ts exports
|
|
51
|
-
export { getEvalRunEventProvider, getThreadProvider, getSessionProvider } from './_services';
|
|
52
|
-
// Re-export bootstrapRuntimeEnv from @agentuity/server for convenience
|
|
53
|
-
// This allows generated code to import from @agentuity/runtime instead of having
|
|
54
|
-
// a direct dependency on @agentuity/server
|
|
55
|
-
export { bootstrapRuntimeEnv } from '@agentuity/server';
|
|
56
|
-
// bun-s3-patch.ts exports
|
|
57
|
-
export { patchBunS3ForStorageDev, isAgentuityStorageEndpoint } from './bun-s3-patch';
|
|
58
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB;AACnB,OAAO,EAUN,qBAAqB,EACrB,eAAe,EAGf,aAAa,EACb,cAAc,EACd,cAAc,EAEd,WAAW,EACX,sBAAsB,EACtB,qBAAqB,EACrB,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,iBAAiB,GACjB,MAAM,SAAS,CAAC;AAEjB,iDAAiD;AACjD,OAAO,EASN,SAAS,EACT,MAAM,EACN,WAAW,EACX,YAAY,EACZ,WAAW,EACX,SAAS,GACT,MAAM,OAAO,CAAC;AAEf,2CAA2C;AAC3C,OAAO,EAAE,uBAAuB,EAAiC,MAAM,QAAQ,CAAC;AAChF,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAElE,sCAAsC;AACtC,OAAO,EACN,oBAAoB,EAC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AChB,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,SAAS,EACT,wBAAwB,GACxB,MAAM,WAAW,CAAC;AAEnB,wBAAwB;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,6CAA6C;AAC7C,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5F,yBAAyB;AACzB,OAAO,EACN,kBAAkB,EAClB,sBAAsB,GAGtB,MAAM,eAAe,CAAC;AAEvB,2BAA2B;AAC3B,OAAO,EACN,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,6BAA6B,GAC7B,MAAM,oBAAoB,CAAC;AAE5B,uBAAuB;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,iEAAiE;AACjE,OAAO,EACN,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,SAAS,EACT,YAAY,GACZ,MAAM,WAAW,CAAC;AAEnB,uBAAuB;AACvB,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AA6C7F,uEAAuE;AACvE,iFAAiF;AACjF,2CAA2C;AAC3C,OAAO,EAAE,mBAAmB,EAAgC,MAAM,mBAAmB,CAAC;AAEtF,0BAA0B;AAC1B,OAAO,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/logger/console.d.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { LogLevel } from '@agentuity/core';
|
|
2
|
-
import type { Logger } from './logger';
|
|
3
|
-
/**
|
|
4
|
-
* Console implementation of the Logger interface
|
|
5
|
-
*/
|
|
6
|
-
export default class ConsoleLogger implements Logger {
|
|
7
|
-
private context;
|
|
8
|
-
private formatContext;
|
|
9
|
-
private logLevel;
|
|
10
|
-
private colors;
|
|
11
|
-
private detectedTraceLoopLog;
|
|
12
|
-
private useColors;
|
|
13
|
-
/**
|
|
14
|
-
* Creates a new console logger
|
|
15
|
-
*
|
|
16
|
-
* @param context - Initial context for the logger
|
|
17
|
-
*/
|
|
18
|
-
constructor(context?: Record<string, unknown>, formatContext?: boolean, logLevel?: LogLevel);
|
|
19
|
-
private shouldLog;
|
|
20
|
-
/**
|
|
21
|
-
* Log a trace message (most verbose)
|
|
22
|
-
*
|
|
23
|
-
* @param message - The message to log
|
|
24
|
-
* @param args - Additional arguments to log
|
|
25
|
-
*/
|
|
26
|
-
trace(message: unknown, ...args: unknown[]): void;
|
|
27
|
-
/**
|
|
28
|
-
* Log a debug message
|
|
29
|
-
*
|
|
30
|
-
* @param message - The message to log
|
|
31
|
-
* @param args - Additional arguments to log
|
|
32
|
-
*/
|
|
33
|
-
debug(message: unknown, ...args: unknown[]): void;
|
|
34
|
-
/**
|
|
35
|
-
* Log an info message
|
|
36
|
-
*
|
|
37
|
-
* @param message - The message to log
|
|
38
|
-
* @param args - Additional arguments to log
|
|
39
|
-
*/
|
|
40
|
-
info(message: unknown, ...args: unknown[]): void;
|
|
41
|
-
/**
|
|
42
|
-
* Log a warning message
|
|
43
|
-
*
|
|
44
|
-
* @param message - The message to log
|
|
45
|
-
* @param args - Additional arguments to log
|
|
46
|
-
*/
|
|
47
|
-
warn(message: unknown, ...args: unknown[]): void;
|
|
48
|
-
/**
|
|
49
|
-
* Log an error message
|
|
50
|
-
*
|
|
51
|
-
* @param message - The message to log
|
|
52
|
-
* @param args - Additional arguments to log
|
|
53
|
-
*/
|
|
54
|
-
error(message: unknown, ...args: unknown[]): void;
|
|
55
|
-
/**
|
|
56
|
-
* Log a fatal error message and exit the process
|
|
57
|
-
*
|
|
58
|
-
* @param message - The message to log
|
|
59
|
-
* @param args - Additional arguments to log
|
|
60
|
-
*/
|
|
61
|
-
fatal(message: unknown, ...args: unknown[]): never;
|
|
62
|
-
/**
|
|
63
|
-
* Create a child logger with additional context
|
|
64
|
-
*
|
|
65
|
-
* @param opts - Additional context for the child logger
|
|
66
|
-
* @returns A new logger instance with the additional context
|
|
67
|
-
*/
|
|
68
|
-
child(opts: Record<string, unknown>): Logger;
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=console.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../src/logger/console.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AA8GvC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,aAAc,YAAW,MAAM;IACnD,OAAO,CAAC,OAAO,CAA0B;IACzC,OAAO,CAAC,aAAa,CAAU;IAC/B,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,MAAM,CAA8B;IAC5C,OAAO,CAAC,oBAAoB,CAAsB;IAClD,OAAO,CAAC,SAAS,CAAU;IAE3B;;;;OAIG;gBAEF,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,EACrC,aAAa,UAAO,EACpB,QAAQ,GAAE,QAAiB;IAW5B,OAAO,CAAC,SAAS;IAgBjB;;;;;OAKG;IACH,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAkBjD;;;;;OAKG;IACH,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAkBjD;;;;;OAKG;IACH,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IA8BhD;;;;;OAKG;IACH,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAkBhD;;;;;OAKG;IACH,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAkBjD;;;;;OAKG;IACH,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,KAAK;IAKlD;;;;;OAKG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM;CAU5C"}
|
package/dist/logger/console.js
DELETED
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
import { __originalConsole } from '../otel/logger';
|
|
2
|
-
import { formatMessage } from './util';
|
|
3
|
-
const BOLD = '\x1b[1m';
|
|
4
|
-
const RESET = '\x1b[0m';
|
|
5
|
-
// Helper to convert hex color to ANSI 24-bit color code
|
|
6
|
-
function hexToAnsi(hex) {
|
|
7
|
-
const r = parseInt(hex.slice(1, 3), 16);
|
|
8
|
-
const g = parseInt(hex.slice(3, 5), 16);
|
|
9
|
-
const b = parseInt(hex.slice(5, 7), 16);
|
|
10
|
-
return `\x1b[38;2;${r};${g};${b}m`;
|
|
11
|
-
}
|
|
12
|
-
function shouldUseColors() {
|
|
13
|
-
// Check for NO_COLOR environment variable (any non-empty value disables colors)
|
|
14
|
-
if (process.env.NO_COLOR) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
// Check for TERM=dumb
|
|
18
|
-
if (process.env.TERM === 'dumb') {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
// Check if stdout is a TTY
|
|
22
|
-
if (!process.stdout || typeof process.stdout.isTTY === 'undefined') {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
if (process.stdout && typeof process.stdout.isTTY !== 'undefined' && !process.stdout.isTTY) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
function getLogColors(scheme) {
|
|
31
|
-
if (scheme === 'light') {
|
|
32
|
-
// Darker, high-contrast colors for light backgrounds
|
|
33
|
-
return {
|
|
34
|
-
trace: {
|
|
35
|
-
level: hexToAnsi('#008B8B') + BOLD, // Dark cyan
|
|
36
|
-
message: hexToAnsi('#4B4B4B'), // Dark gray
|
|
37
|
-
},
|
|
38
|
-
debug: {
|
|
39
|
-
level: hexToAnsi('#0000CD') + BOLD, // Medium blue
|
|
40
|
-
message: hexToAnsi('#006400'), // Dark green
|
|
41
|
-
},
|
|
42
|
-
info: {
|
|
43
|
-
level: hexToAnsi('#FF8C00') + BOLD, // Dark orange
|
|
44
|
-
message: hexToAnsi('#0066CC') + BOLD, // Strong blue
|
|
45
|
-
},
|
|
46
|
-
warn: {
|
|
47
|
-
level: hexToAnsi('#9400D3') + BOLD, // Dark violet
|
|
48
|
-
message: hexToAnsi('#8B008B'), // Dark magenta
|
|
49
|
-
},
|
|
50
|
-
error: {
|
|
51
|
-
level: hexToAnsi('#DC143C') + BOLD, // Crimson
|
|
52
|
-
message: hexToAnsi('#8B0000') + BOLD, // Dark red
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
// Dark mode colors (brighter for dark backgrounds)
|
|
57
|
-
return {
|
|
58
|
-
trace: {
|
|
59
|
-
level: hexToAnsi('#00FFFF') + BOLD, // Cyan
|
|
60
|
-
message: hexToAnsi('#A0A0A0'), // Light gray
|
|
61
|
-
},
|
|
62
|
-
debug: {
|
|
63
|
-
level: hexToAnsi('#5C9CFF') + BOLD, // Blue
|
|
64
|
-
message: hexToAnsi('#90EE90'), // Light green
|
|
65
|
-
},
|
|
66
|
-
info: {
|
|
67
|
-
level: hexToAnsi('#FFD700') + BOLD, // Gold/Yellow
|
|
68
|
-
message: hexToAnsi('#FFFFFF') + BOLD, // White
|
|
69
|
-
},
|
|
70
|
-
warn: {
|
|
71
|
-
level: hexToAnsi('#FF00FF') + BOLD, // Magenta
|
|
72
|
-
message: hexToAnsi('#FF00FF'), // Magenta
|
|
73
|
-
},
|
|
74
|
-
error: {
|
|
75
|
-
level: hexToAnsi('#FF4444') + BOLD, // Red
|
|
76
|
-
message: hexToAnsi('#FF4444'), // Red
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
// Detect color scheme from environment
|
|
81
|
-
function detectColorScheme() {
|
|
82
|
-
const scheme = process.env.COLOR_SCHEME?.toLowerCase();
|
|
83
|
-
if (scheme === 'light' || scheme === 'dark') {
|
|
84
|
-
return scheme;
|
|
85
|
-
}
|
|
86
|
-
if (process.env.CI) {
|
|
87
|
-
return 'light';
|
|
88
|
-
}
|
|
89
|
-
return 'dark'; // Default to dark mode
|
|
90
|
-
}
|
|
91
|
-
const NOCOLORS = Object.freeze({ level: '', reset: '', message: '' });
|
|
92
|
-
/**
|
|
93
|
-
* Console implementation of the Logger interface
|
|
94
|
-
*/
|
|
95
|
-
export default class ConsoleLogger {
|
|
96
|
-
context;
|
|
97
|
-
formatContext;
|
|
98
|
-
logLevel;
|
|
99
|
-
colors;
|
|
100
|
-
detectedTraceLoopLog;
|
|
101
|
-
useColors;
|
|
102
|
-
/**
|
|
103
|
-
* Creates a new console logger
|
|
104
|
-
*
|
|
105
|
-
* @param context - Initial context for the logger
|
|
106
|
-
*/
|
|
107
|
-
constructor(context = {}, formatContext = true, logLevel = 'info') {
|
|
108
|
-
this.context = context;
|
|
109
|
-
this.formatContext = formatContext;
|
|
110
|
-
this.logLevel = logLevel;
|
|
111
|
-
this.useColors = shouldUseColors();
|
|
112
|
-
this.colors = this.useColors
|
|
113
|
-
? getLogColors(detectColorScheme())
|
|
114
|
-
: {};
|
|
115
|
-
}
|
|
116
|
-
shouldLog(level) {
|
|
117
|
-
switch (this.logLevel) {
|
|
118
|
-
case 'trace':
|
|
119
|
-
return true;
|
|
120
|
-
case 'debug':
|
|
121
|
-
return level === 'debug' || level === 'info' || level === 'warn' || level === 'error';
|
|
122
|
-
case 'info':
|
|
123
|
-
return level === 'info' || level === 'warn' || level === 'error';
|
|
124
|
-
case 'warn':
|
|
125
|
-
return level === 'warn' || level === 'error';
|
|
126
|
-
case 'error':
|
|
127
|
-
return level === 'error';
|
|
128
|
-
}
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Log a trace message (most verbose)
|
|
133
|
-
*
|
|
134
|
-
* @param message - The message to log
|
|
135
|
-
* @param args - Additional arguments to log
|
|
136
|
-
*/
|
|
137
|
-
trace(message, ...args) {
|
|
138
|
-
if (!this.shouldLog('trace')) {
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
try {
|
|
142
|
-
const colors = this.useColors ? this.colors.trace : NOCOLORS;
|
|
143
|
-
const formattedMessage = formatMessage(this.formatContext, this.context, message, args);
|
|
144
|
-
__originalConsole.debug(`${colors.level}[TRACE]${RESET} ${colors.message}${formattedMessage}${RESET}`);
|
|
145
|
-
}
|
|
146
|
-
catch (err) {
|
|
147
|
-
// Fallback to direct logging if formatting fails
|
|
148
|
-
const colors = this.colors.trace;
|
|
149
|
-
__originalConsole.debug(`${colors.level}[TRACE]${RESET} ${message}`, ...args);
|
|
150
|
-
__originalConsole.error('Error formatting log message:', err);
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Log a debug message
|
|
155
|
-
*
|
|
156
|
-
* @param message - The message to log
|
|
157
|
-
* @param args - Additional arguments to log
|
|
158
|
-
*/
|
|
159
|
-
debug(message, ...args) {
|
|
160
|
-
if (!this.shouldLog('debug')) {
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
try {
|
|
164
|
-
const colors = this.useColors ? this.colors.debug : NOCOLORS;
|
|
165
|
-
const formattedMessage = formatMessage(this.formatContext, this.context, message, args);
|
|
166
|
-
__originalConsole.debug(`${colors.level}[DEBUG]${RESET} ${colors.message}${formattedMessage}${RESET}`);
|
|
167
|
-
}
|
|
168
|
-
catch (err) {
|
|
169
|
-
// Fallback to direct logging if formatting fails
|
|
170
|
-
const colors = this.colors.debug;
|
|
171
|
-
__originalConsole.debug(`${colors.level}[DEBUG]${RESET} ${message}`, ...args);
|
|
172
|
-
__originalConsole.error('Error formatting log message:', err);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Log an info message
|
|
177
|
-
*
|
|
178
|
-
* @param message - The message to log
|
|
179
|
-
* @param args - Additional arguments to log
|
|
180
|
-
*/
|
|
181
|
-
info(message, ...args) {
|
|
182
|
-
if (!this.shouldLog('info')) {
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
// suppress the default traceloop message at info level
|
|
186
|
-
if (!this.detectedTraceLoopLog &&
|
|
187
|
-
typeof message === 'string' &&
|
|
188
|
-
message.includes('Traceloop exporting traces to')) {
|
|
189
|
-
this.detectedTraceLoopLog = true;
|
|
190
|
-
if (this.shouldLog('debug')) {
|
|
191
|
-
this.debug(message, ...args);
|
|
192
|
-
}
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
try {
|
|
196
|
-
const colors = this.useColors ? this.colors.info : NOCOLORS;
|
|
197
|
-
const formattedMessage = formatMessage(this.formatContext, this.context, message, args);
|
|
198
|
-
__originalConsole.info(`${colors.level}[INFO]${RESET} ${colors.message}${formattedMessage}${RESET}`);
|
|
199
|
-
}
|
|
200
|
-
catch (err) {
|
|
201
|
-
// Fallback to direct logging if formatting fails
|
|
202
|
-
const colors = this.colors.info;
|
|
203
|
-
__originalConsole.info(`${colors.level}[INFO]${RESET} ${message}`, ...args);
|
|
204
|
-
__originalConsole.error('Error formatting log message:', err);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Log a warning message
|
|
209
|
-
*
|
|
210
|
-
* @param message - The message to log
|
|
211
|
-
* @param args - Additional arguments to log
|
|
212
|
-
*/
|
|
213
|
-
warn(message, ...args) {
|
|
214
|
-
if (!this.shouldLog('warn')) {
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
try {
|
|
218
|
-
const colors = this.useColors ? this.colors.warn : NOCOLORS;
|
|
219
|
-
const formattedMessage = formatMessage(this.formatContext, this.context, message, args);
|
|
220
|
-
__originalConsole.warn(`${colors.level}[WARN]${RESET} ${colors.message}${formattedMessage}${RESET}`);
|
|
221
|
-
}
|
|
222
|
-
catch (err) {
|
|
223
|
-
// Fallback to direct logging if formatting fails
|
|
224
|
-
const colors = this.colors.warn;
|
|
225
|
-
__originalConsole.warn(`${colors.level}[WARN]${RESET} ${message}`, ...args);
|
|
226
|
-
__originalConsole.error('Error formatting log message:', err);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Log an error message
|
|
231
|
-
*
|
|
232
|
-
* @param message - The message to log
|
|
233
|
-
* @param args - Additional arguments to log
|
|
234
|
-
*/
|
|
235
|
-
error(message, ...args) {
|
|
236
|
-
if (!this.shouldLog('error')) {
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
try {
|
|
240
|
-
const colors = this.useColors ? this.colors.error : NOCOLORS;
|
|
241
|
-
const formattedMessage = formatMessage(this.formatContext, this.context, message, args);
|
|
242
|
-
__originalConsole.error(`${colors.level}[ERROR]${RESET} ${colors.message}${formattedMessage}${RESET}`);
|
|
243
|
-
}
|
|
244
|
-
catch (err) {
|
|
245
|
-
// Fallback to direct logging if formatting fails
|
|
246
|
-
const colors = this.colors.error;
|
|
247
|
-
__originalConsole.error(`${colors.level}[ERROR]${RESET} ${message}`, ...args);
|
|
248
|
-
__originalConsole.error('Error formatting log message:', err);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Log a fatal error message and exit the process
|
|
253
|
-
*
|
|
254
|
-
* @param message - The message to log
|
|
255
|
-
* @param args - Additional arguments to log
|
|
256
|
-
*/
|
|
257
|
-
fatal(message, ...args) {
|
|
258
|
-
this.error(message, ...args);
|
|
259
|
-
process.exit(1);
|
|
260
|
-
}
|
|
261
|
-
/**
|
|
262
|
-
* Create a child logger with additional context
|
|
263
|
-
*
|
|
264
|
-
* @param opts - Additional context for the child logger
|
|
265
|
-
* @returns A new logger instance with the additional context
|
|
266
|
-
*/
|
|
267
|
-
child(opts) {
|
|
268
|
-
return new ConsoleLogger({
|
|
269
|
-
...this.context,
|
|
270
|
-
...opts,
|
|
271
|
-
}, this.formatContext, this.logLevel);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
//# sourceMappingURL=console.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"console.js","sourceRoot":"","sources":["../../src/logger/console.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAEvC,MAAM,IAAI,GAAG,SAAS,CAAC;AACvB,MAAM,KAAK,GAAG,SAAS,CAAC;AAExB,wDAAwD;AACxD,SAAS,SAAS,CAAC,GAAW;IAC7B,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACxC,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACxC,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACxC,OAAO,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AACpC,CAAC;AAOD,SAAS,eAAe;IACvB,gFAAgF;IAChF,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QAC1B,OAAO,KAAK,CAAC;IACd,CAAC;IAED,sBAAsB;IACtB,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC;IACd,CAAC;IAED,2BAA2B;IAC3B,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,OAAO,OAAO,CA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