@axlsdk/studio 0.9.1 → 0.10.1
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 +225 -7
- package/dist/{chunk-EG74VI3M.js → chunk-GKIPF45K.js} +206 -101
- package/dist/chunk-GKIPF45K.js.map +1 -0
- package/dist/cli.cjs +220 -116
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/assets/{index-DDlRZgfC.js → index-jeUeToM_.js} +13 -13
- package/dist/client/index.html +2 -2
- package/dist/connection-manager-DbOgO_gK.d.cts +75 -0
- package/dist/connection-manager-DbOgO_gK.d.ts +75 -0
- package/dist/middleware.cjs +1243 -0
- package/dist/middleware.cjs.map +1 -0
- package/dist/middleware.d.cts +131 -0
- package/dist/middleware.d.ts +131 -0
- package/dist/middleware.js +346 -0
- package/dist/middleware.js.map +1 -0
- package/dist/server/index.cjs +204 -100
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +12 -62
- package/dist/server/index.d.ts +12 -62
- package/dist/server/index.js +1 -1
- package/package.json +16 -4
- package/dist/chunk-EG74VI3M.js.map +0 -1
package/dist/client/index.html
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Axl Studio</title>
|
|
7
|
-
<script type="module" crossorigin src="
|
|
8
|
-
<link rel="stylesheet" crossorigin href="
|
|
7
|
+
<script type="module" crossorigin src="./assets/index-jeUeToM_.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="./assets/index-djsvilkt.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="root"></div>
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
declare class ConnectionManager {
|
|
50
|
+
/** channel -> set of WS connections */
|
|
51
|
+
private channels;
|
|
52
|
+
/** ws -> set of subscribed channels (for cleanup) */
|
|
53
|
+
private connections;
|
|
54
|
+
private maxConnections;
|
|
55
|
+
/** Register a new WS connection. */
|
|
56
|
+
add(ws: BroadcastTarget): void;
|
|
57
|
+
/** Remove a WS connection and all its subscriptions. */
|
|
58
|
+
remove(ws: BroadcastTarget): void;
|
|
59
|
+
/** Subscribe a connection to a channel. No-op if the connection was not added. */
|
|
60
|
+
subscribe(ws: BroadcastTarget, channel: string): void;
|
|
61
|
+
/** Unsubscribe a connection from a channel. */
|
|
62
|
+
unsubscribe(ws: BroadcastTarget, channel: string): void;
|
|
63
|
+
/** Broadcast data to all subscribers of a channel. */
|
|
64
|
+
broadcast(channel: string, data: unknown): void;
|
|
65
|
+
/** Broadcast to channel and all wildcard subscribers (e.g., trace:* matches trace:abc). */
|
|
66
|
+
broadcastWithWildcard(channel: string, data: unknown): void;
|
|
67
|
+
/** Close all connections and clear all state. Used during shutdown. */
|
|
68
|
+
closeAll(): void;
|
|
69
|
+
/** Get the number of active connections. */
|
|
70
|
+
get connectionCount(): number;
|
|
71
|
+
/** Check if any connections are subscribed to a channel. */
|
|
72
|
+
hasSubscribers(channel: string): boolean;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export { type BroadcastTarget as B, ConnectionManager as C, type StudioEnv as S, type CostData as a };
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
declare class ConnectionManager {
|
|
50
|
+
/** channel -> set of WS connections */
|
|
51
|
+
private channels;
|
|
52
|
+
/** ws -> set of subscribed channels (for cleanup) */
|
|
53
|
+
private connections;
|
|
54
|
+
private maxConnections;
|
|
55
|
+
/** Register a new WS connection. */
|
|
56
|
+
add(ws: BroadcastTarget): void;
|
|
57
|
+
/** Remove a WS connection and all its subscriptions. */
|
|
58
|
+
remove(ws: BroadcastTarget): void;
|
|
59
|
+
/** Subscribe a connection to a channel. No-op if the connection was not added. */
|
|
60
|
+
subscribe(ws: BroadcastTarget, channel: string): void;
|
|
61
|
+
/** Unsubscribe a connection from a channel. */
|
|
62
|
+
unsubscribe(ws: BroadcastTarget, channel: string): void;
|
|
63
|
+
/** Broadcast data to all subscribers of a channel. */
|
|
64
|
+
broadcast(channel: string, data: unknown): void;
|
|
65
|
+
/** Broadcast to channel and all wildcard subscribers (e.g., trace:* matches trace:abc). */
|
|
66
|
+
broadcastWithWildcard(channel: string, data: unknown): void;
|
|
67
|
+
/** Close all connections and clear all state. Used during shutdown. */
|
|
68
|
+
closeAll(): void;
|
|
69
|
+
/** Get the number of active connections. */
|
|
70
|
+
get connectionCount(): number;
|
|
71
|
+
/** Check if any connections are subscribed to a channel. */
|
|
72
|
+
hasSubscribers(channel: string): boolean;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export { type BroadcastTarget as B, ConnectionManager as C, type StudioEnv as S, type CostData as a };
|