@axlsdk/studio 0.14.0 → 0.16.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/README.md +69 -10
- package/dist/chunk-RE6VPUXA.js +2213 -0
- package/dist/chunk-RE6VPUXA.js.map +1 -0
- package/dist/cli.cjs +1191 -143
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/assets/index-ClajLxib.js +288 -0
- package/dist/client/assets/index-DnHL_gtF.css +1 -0
- package/dist/client/index.html +2 -2
- package/dist/connection-manager-DAuqk9lM.d.cts +166 -0
- package/dist/connection-manager-DAuqk9lM.d.ts +166 -0
- package/dist/middleware.cjs +1222 -150
- package/dist/middleware.cjs.map +1 -1
- package/dist/middleware.d.cts +76 -6
- package/dist/middleware.d.ts +76 -6
- package/dist/middleware.js +32 -8
- package/dist/middleware.js.map +1 -1
- package/dist/server/index.cjs +1194 -142
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +171 -28
- package/dist/server/index.d.ts +171 -28
- package/dist/server/index.js +7 -3
- package/package.json +13 -9
- package/dist/chunk-HUKUQDYL.js +0 -1163
- package/dist/chunk-HUKUQDYL.js.map +0 -1
- package/dist/client/assets/index-7aDhMztu.css +0 -1
- package/dist/client/assets/index-Bzr3vDPz.js +0 -255
- package/dist/connection-manager-B7AWpsCD.d.cts +0 -81
- package/dist/connection-manager-B7AWpsCD.d.ts +0 -81
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { AxlRuntime } from '@axlsdk/axl';
|
|
2
|
-
|
|
3
|
-
/** Cost aggregation data */
|
|
4
|
-
type CostData = {
|
|
5
|
-
totalCost: number;
|
|
6
|
-
totalTokens: {
|
|
7
|
-
input: number;
|
|
8
|
-
output: number;
|
|
9
|
-
reasoning: number;
|
|
10
|
-
};
|
|
11
|
-
byAgent: Record<string, {
|
|
12
|
-
cost: number;
|
|
13
|
-
calls: number;
|
|
14
|
-
}>;
|
|
15
|
-
byModel: Record<string, {
|
|
16
|
-
cost: number;
|
|
17
|
-
calls: number;
|
|
18
|
-
tokens: {
|
|
19
|
-
input: number;
|
|
20
|
-
output: number;
|
|
21
|
-
};
|
|
22
|
-
}>;
|
|
23
|
-
byWorkflow: Record<string, {
|
|
24
|
-
cost: number;
|
|
25
|
-
executions: number;
|
|
26
|
-
}>;
|
|
27
|
-
};
|
|
28
|
-
/** Hono app environment bindings */
|
|
29
|
-
type StudioEnv = {
|
|
30
|
-
Variables: {
|
|
31
|
-
runtime: AxlRuntime;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Minimal interface for a connection that can receive broadcast messages.
|
|
37
|
-
* Satisfied by WSContext (Hono), ws.WebSocket (Node.js), and the middleware's
|
|
38
|
-
* adapted socket. Internal to ConnectionManager — not part of the public API.
|
|
39
|
-
*/
|
|
40
|
-
interface BroadcastTarget {
|
|
41
|
-
send(data: string): void;
|
|
42
|
-
close?(): void;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Manages WebSocket connections and channel subscriptions.
|
|
46
|
-
* Supports channel multiplexing: clients subscribe/unsubscribe to channels
|
|
47
|
-
* and receive events only for channels they're subscribed to.
|
|
48
|
-
*
|
|
49
|
-
* Execution channels (`execution:*`) are replay-buffered: events are stored
|
|
50
|
-
* so that late subscribers receive the full event history. Buffers are cleaned
|
|
51
|
-
* up shortly after the stream completes.
|
|
52
|
-
*/
|
|
53
|
-
declare class ConnectionManager {
|
|
54
|
-
/** channel -> set of WS connections */
|
|
55
|
-
private channels;
|
|
56
|
-
/** ws -> set of subscribed channels (for cleanup) */
|
|
57
|
-
private connections;
|
|
58
|
-
/** channel -> replay buffer for execution streams */
|
|
59
|
-
private buffers;
|
|
60
|
-
private maxConnections;
|
|
61
|
-
/** Register a new WS connection. */
|
|
62
|
-
add(ws: BroadcastTarget): void;
|
|
63
|
-
/** Remove a WS connection and all its subscriptions. */
|
|
64
|
-
remove(ws: BroadcastTarget): void;
|
|
65
|
-
/** Subscribe a connection to a channel. Replays buffered events for execution channels. */
|
|
66
|
-
subscribe(ws: BroadcastTarget, channel: string): void;
|
|
67
|
-
/** Unsubscribe a connection from a channel. */
|
|
68
|
-
unsubscribe(ws: BroadcastTarget, channel: string): void;
|
|
69
|
-
/** Broadcast data to all subscribers of a channel. Buffers events for execution channels. */
|
|
70
|
-
broadcast(channel: string, data: unknown): void;
|
|
71
|
-
/** Broadcast to channel and all wildcard subscribers (e.g., trace:* matches trace:abc). */
|
|
72
|
-
broadcastWithWildcard(channel: string, data: unknown): void;
|
|
73
|
-
/** Close all connections, clear all state and buffers. Used during shutdown. */
|
|
74
|
-
closeAll(): void;
|
|
75
|
-
/** Get the number of active connections. */
|
|
76
|
-
get connectionCount(): number;
|
|
77
|
-
/** Check if any connections are subscribed to a channel. */
|
|
78
|
-
hasSubscribers(channel: string): boolean;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export { type BroadcastTarget as B, ConnectionManager as C, type StudioEnv as S, type CostData as a };
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { AxlRuntime } from '@axlsdk/axl';
|
|
2
|
-
|
|
3
|
-
/** Cost aggregation data */
|
|
4
|
-
type CostData = {
|
|
5
|
-
totalCost: number;
|
|
6
|
-
totalTokens: {
|
|
7
|
-
input: number;
|
|
8
|
-
output: number;
|
|
9
|
-
reasoning: number;
|
|
10
|
-
};
|
|
11
|
-
byAgent: Record<string, {
|
|
12
|
-
cost: number;
|
|
13
|
-
calls: number;
|
|
14
|
-
}>;
|
|
15
|
-
byModel: Record<string, {
|
|
16
|
-
cost: number;
|
|
17
|
-
calls: number;
|
|
18
|
-
tokens: {
|
|
19
|
-
input: number;
|
|
20
|
-
output: number;
|
|
21
|
-
};
|
|
22
|
-
}>;
|
|
23
|
-
byWorkflow: Record<string, {
|
|
24
|
-
cost: number;
|
|
25
|
-
executions: number;
|
|
26
|
-
}>;
|
|
27
|
-
};
|
|
28
|
-
/** Hono app environment bindings */
|
|
29
|
-
type StudioEnv = {
|
|
30
|
-
Variables: {
|
|
31
|
-
runtime: AxlRuntime;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Minimal interface for a connection that can receive broadcast messages.
|
|
37
|
-
* Satisfied by WSContext (Hono), ws.WebSocket (Node.js), and the middleware's
|
|
38
|
-
* adapted socket. Internal to ConnectionManager — not part of the public API.
|
|
39
|
-
*/
|
|
40
|
-
interface BroadcastTarget {
|
|
41
|
-
send(data: string): void;
|
|
42
|
-
close?(): void;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Manages WebSocket connections and channel subscriptions.
|
|
46
|
-
* Supports channel multiplexing: clients subscribe/unsubscribe to channels
|
|
47
|
-
* and receive events only for channels they're subscribed to.
|
|
48
|
-
*
|
|
49
|
-
* Execution channels (`execution:*`) are replay-buffered: events are stored
|
|
50
|
-
* so that late subscribers receive the full event history. Buffers are cleaned
|
|
51
|
-
* up shortly after the stream completes.
|
|
52
|
-
*/
|
|
53
|
-
declare class ConnectionManager {
|
|
54
|
-
/** channel -> set of WS connections */
|
|
55
|
-
private channels;
|
|
56
|
-
/** ws -> set of subscribed channels (for cleanup) */
|
|
57
|
-
private connections;
|
|
58
|
-
/** channel -> replay buffer for execution streams */
|
|
59
|
-
private buffers;
|
|
60
|
-
private maxConnections;
|
|
61
|
-
/** Register a new WS connection. */
|
|
62
|
-
add(ws: BroadcastTarget): void;
|
|
63
|
-
/** Remove a WS connection and all its subscriptions. */
|
|
64
|
-
remove(ws: BroadcastTarget): void;
|
|
65
|
-
/** Subscribe a connection to a channel. Replays buffered events for execution channels. */
|
|
66
|
-
subscribe(ws: BroadcastTarget, channel: string): void;
|
|
67
|
-
/** Unsubscribe a connection from a channel. */
|
|
68
|
-
unsubscribe(ws: BroadcastTarget, channel: string): void;
|
|
69
|
-
/** Broadcast data to all subscribers of a channel. Buffers events for execution channels. */
|
|
70
|
-
broadcast(channel: string, data: unknown): void;
|
|
71
|
-
/** Broadcast to channel and all wildcard subscribers (e.g., trace:* matches trace:abc). */
|
|
72
|
-
broadcastWithWildcard(channel: string, data: unknown): void;
|
|
73
|
-
/** Close all connections, clear all state and buffers. Used during shutdown. */
|
|
74
|
-
closeAll(): void;
|
|
75
|
-
/** Get the number of active connections. */
|
|
76
|
-
get connectionCount(): number;
|
|
77
|
-
/** Check if any connections are subscribed to a channel. */
|
|
78
|
-
hasSubscribers(channel: string): boolean;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export { type BroadcastTarget as B, ConnectionManager as C, type StudioEnv as S, type CostData as a };
|