@agentick/devtools 0.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Agentick Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,207 @@
1
+ # @agentick/devtools
2
+
3
+ Real-time debugging and observability for Agentick applications. Provides a server that captures execution events and a browser UI for inspection.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @agentick/devtools
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```typescript
14
+ import { startDevToolsServer } from "@agentick/devtools";
15
+ import { createApp } from "@agentick/core";
16
+
17
+ // Start DevTools server
18
+ const devtools = startDevToolsServer({ port: 3001 });
19
+
20
+ // Enable DevTools in your app
21
+ const app = createApp(MyApp, {
22
+ model: myModel,
23
+ devTools: true, // Enables event emission
24
+ });
25
+
26
+ // Navigate to http://localhost:3001 to view DevTools UI
27
+ ```
28
+
29
+ ## API
30
+
31
+ ### startDevToolsServer(config?)
32
+
33
+ Convenience function to create and start a DevTools server:
34
+
35
+ ```typescript
36
+ const devtools = startDevToolsServer({
37
+ port: 3001, // Default: 3001
38
+ host: "127.0.0.1", // Default: 127.0.0.1
39
+ debug: false, // Enable debug logging
40
+ heartbeatInterval: 30000, // SSE heartbeat interval (ms)
41
+ });
42
+
43
+ // Get server URL
44
+ console.log(devtools.getUrl()); // "http://127.0.0.1:3001"
45
+
46
+ // Stop when done
47
+ devtools.stop();
48
+ ```
49
+
50
+ ### DevToolsServer Class
51
+
52
+ For more control, use the class directly:
53
+
54
+ ```typescript
55
+ import { DevToolsServer } from "@agentick/devtools";
56
+
57
+ const server = new DevToolsServer({ port: 3001 });
58
+ await server.start();
59
+
60
+ // Later...
61
+ await server.stop();
62
+ ```
63
+
64
+ ## HTTP Endpoints
65
+
66
+ | Endpoint | Method | Description |
67
+ | -------------- | ------ | ------------------------------ |
68
+ | `/` | GET | DevTools UI |
69
+ | `/events` | GET | SSE stream of execution events |
70
+ | `/api/history` | GET | All buffered events as JSON |
71
+ | `/api/clear` | GET | Clear event history |
72
+
73
+ ## Event Types
74
+
75
+ The DevTools server captures these events from `@agentick/core`:
76
+
77
+ | Event | Description |
78
+ | ------------------- | ------------------------------ |
79
+ | `execution_start` | Execution began |
80
+ | `execution_end` | Execution completed |
81
+ | `tick_start` | Model API call started |
82
+ | `tick_end` | Model API call completed |
83
+ | `compiled` | JSX compiled to messages/tools |
84
+ | `model_request` | Request sent to provider |
85
+ | `provider_response` | Raw provider response |
86
+ | `model_response` | Normalized response |
87
+ | `tool_call` | Tool invocation |
88
+ | `tool_result` | Tool execution result |
89
+ | `fiber_snapshot` | Component tree state |
90
+ | `content_delta` | Streaming text chunk |
91
+
92
+ ## UI Features
93
+
94
+ ### Execution List
95
+
96
+ View all executions with status, duration, and token usage.
97
+
98
+ ### Tick Navigator
99
+
100
+ Scrub through individual ticks within an execution to see:
101
+
102
+ - Compiled context (system, messages, tools)
103
+ - Provider input/output
104
+ - Model response
105
+ - Tool calls
106
+
107
+ ### Fiber Tree
108
+
109
+ Inspect the component hierarchy with:
110
+
111
+ - Props for each component
112
+ - Hook states
113
+ - Token estimates
114
+
115
+ ### Context Info
116
+
117
+ Monitor context utilization:
118
+
119
+ - Input/output tokens per tick
120
+ - Context window usage percentage
121
+ - Cumulative usage across ticks
122
+
123
+ ## Integration
124
+
125
+ ### With Express
126
+
127
+ ```typescript
128
+ import express from "express";
129
+ import { createExpressAdapter } from "@agentick/express";
130
+ import { startDevToolsServer } from "@agentick/devtools";
131
+
132
+ const app = express();
133
+
134
+ // Start DevTools on separate port
135
+ startDevToolsServer({ port: 3001 });
136
+
137
+ // Your Agentick app with DevTools enabled
138
+ const agentick = createExpressAdapter(MyApp, {
139
+ model: myModel,
140
+ devTools: true,
141
+ });
142
+
143
+ app.use("/api", agentick);
144
+ app.listen(3000);
145
+ ```
146
+
147
+ ### With Gateway
148
+
149
+ ```typescript
150
+ import { createGateway } from "@agentick/gateway";
151
+ import { startDevToolsServer } from "@agentick/devtools";
152
+
153
+ startDevToolsServer({ port: 3001 });
154
+
155
+ const gateway = createGateway({
156
+ agents: { assistant: myApp },
157
+ devTools: true,
158
+ });
159
+ ```
160
+
161
+ ## Architecture
162
+
163
+ ```
164
+ ┌─────────────────────────┐
165
+ │ Agentick App/Session │
166
+ │ (devTools: true) │
167
+ └────────────┬────────────┘
168
+ │ devToolsEmitter.emit()
169
+
170
+ ┌─────────────────────────┐
171
+ │ DevToolsServer │
172
+ │ - Buffers events │
173
+ │ - Broadcasts via SSE │
174
+ │ - Serves UI │
175
+ └────────────┬────────────┘
176
+ │ HTTP /events (SSE)
177
+
178
+ ┌─────────────────────────┐
179
+ │ Browser UI (React) │
180
+ │ - Real-time updates │
181
+ │ - Execution inspection│
182
+ │ - Fiber tree viewer │
183
+ └─────────────────────────┘
184
+ ```
185
+
186
+ ## Configuration
187
+
188
+ ### Environment Variables
189
+
190
+ ```bash
191
+ TENTICKLE_DEVTOOLS_PORT=3001
192
+ TENTICKLE_DEVTOOLS_HOST=127.0.0.1
193
+ ```
194
+
195
+ ### Programmatic
196
+
197
+ ```typescript
198
+ const devtools = startDevToolsServer({
199
+ port: process.env.DEVTOOLS_PORT || 3001,
200
+ host: process.env.DEVTOOLS_HOST || "127.0.0.1",
201
+ debug: process.env.NODE_ENV === "development",
202
+ });
203
+ ```
204
+
205
+ ## License
206
+
207
+ MIT
@@ -0,0 +1,11 @@
1
+ /**
2
+ * DevTools Package
3
+ *
4
+ * Provides real-time observability for Agentick applications:
5
+ * - SSE server for streaming events to UI
6
+ * - HTTP API for querying execution history
7
+ * - Subscribes to devToolsEmitter for fiber snapshots and execution events
8
+ */
9
+ export { DevToolsServer, type DevToolsServerConfig } from "./server/devtools-server";
10
+ export { startDevToolsServer } from "./server/start";
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * DevTools Package
3
+ *
4
+ * Provides real-time observability for Agentick applications:
5
+ * - SSE server for streaming events to UI
6
+ * - HTTP API for querying execution history
7
+ * - Subscribes to devToolsEmitter for fiber snapshots and execution events
8
+ */
9
+ export { DevToolsServer } from "./server/devtools-server";
10
+ export { startDevToolsServer } from "./server/start";
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,cAAc,EAA6B,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,42 @@
1
+ export interface DevToolsServerConfig {
2
+ /** Port to listen on (default: 3001) */
3
+ port?: number;
4
+ /** Host to bind to (default: '127.0.0.1') */
5
+ host?: string;
6
+ /** Enable debug logging */
7
+ debug?: boolean;
8
+ /** Heartbeat interval in ms (default: 30000) */
9
+ heartbeatInterval?: number;
10
+ }
11
+ export declare class DevToolsServer {
12
+ private server;
13
+ private clients;
14
+ private config;
15
+ private eventHistory;
16
+ private maxHistorySize;
17
+ private unsubscribe;
18
+ constructor(config?: DevToolsServerConfig);
19
+ private log;
20
+ /**
21
+ * Start the devtools server
22
+ */
23
+ start(): void;
24
+ /**
25
+ * Stop the server
26
+ */
27
+ stop(): void;
28
+ /**
29
+ * Emit event to all connected clients
30
+ */
31
+ private emit;
32
+ /**
33
+ * Get the server URL
34
+ */
35
+ getUrl(): string;
36
+ private handleRequest;
37
+ private handleSSE;
38
+ private handleHistory;
39
+ private handleClear;
40
+ private handleStatic;
41
+ }
42
+ //# sourceMappingURL=devtools-server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtools-server.d.ts","sourceRoot":"","sources":["../../src/server/devtools-server.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,oBAAoB;IACnC,wCAAwC;IACxC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gDAAgD;IAChD,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAcD,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,cAAc,CAAQ;IAC9B,OAAO,CAAC,WAAW,CAA6B;gBAEpC,MAAM,GAAE,oBAAyB;IAS7C,OAAO,CAAC,GAAG;IAMX;;OAEG;IACH,KAAK,IAAI,IAAI;IA2Bb;;OAEG;IACH,IAAI,IAAI,IAAI;IA8BZ;;OAEG;IACH,OAAO,CAAC,IAAI;IAoBZ;;OAEG;IACH,MAAM,IAAI,MAAM;IAIhB,OAAO,CAAC,aAAa;IA0BrB,OAAO,CAAC,SAAS;IA+BjB,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,YAAY;CAsCrB"}
@@ -0,0 +1,214 @@
1
+ /**
2
+ * DevTools Server
3
+ *
4
+ * HTTP server that:
5
+ * 1. Subscribes to devToolsEmitter for events
6
+ * 2. Broadcasts events to connected clients via SSE
7
+ * 3. Provides HTTP API for querying history
8
+ * 4. Serves the DevTools UI
9
+ */
10
+ import { createServer } from "node:http";
11
+ import { join, dirname } from "node:path";
12
+ import { fileURLToPath } from "node:url";
13
+ import { existsSync, readFileSync } from "node:fs";
14
+ import { devToolsEmitter } from "@agentick/shared";
15
+ const __dirname = dirname(fileURLToPath(import.meta.url));
16
+ export class DevToolsServer {
17
+ server = null;
18
+ clients = new Set();
19
+ config;
20
+ eventHistory = [];
21
+ maxHistorySize = 1000;
22
+ unsubscribe = null;
23
+ constructor(config = {}) {
24
+ this.config = {
25
+ port: config.port ?? 3001,
26
+ host: config.host ?? "127.0.0.1",
27
+ debug: config.debug ?? false,
28
+ heartbeatInterval: config.heartbeatInterval ?? 30000,
29
+ };
30
+ }
31
+ log(...args) {
32
+ if (this.config.debug) {
33
+ console.log("[DevTools]", ...args);
34
+ }
35
+ }
36
+ /**
37
+ * Start the devtools server
38
+ */
39
+ start() {
40
+ if (this.server) {
41
+ this.log("Server already running");
42
+ return;
43
+ }
44
+ // Subscribe to devToolsEmitter
45
+ this.unsubscribe = devToolsEmitter.subscribe((event) => {
46
+ this.emit(event);
47
+ });
48
+ this.server = createServer((req, res) => this.handleRequest(req, res));
49
+ this.server.on("error", (error) => {
50
+ const code = error.code;
51
+ if (code === "EADDRINUSE") {
52
+ console.warn(`[DevTools] Port ${this.config.port} is already in use; DevTools disabled.`);
53
+ }
54
+ else {
55
+ console.error("[DevTools] Server error:", error);
56
+ }
57
+ this.stop();
58
+ });
59
+ this.server.listen(this.config.port, this.config.host, () => {
60
+ console.log(`[DevTools] Server listening on http://${this.config.host}:${this.config.port}`);
61
+ });
62
+ }
63
+ /**
64
+ * Stop the server
65
+ */
66
+ stop() {
67
+ // Unsubscribe from events
68
+ if (this.unsubscribe) {
69
+ this.unsubscribe();
70
+ this.unsubscribe = null;
71
+ }
72
+ // Close SSE connections
73
+ for (const client of this.clients) {
74
+ clearInterval(client.heartbeatInterval);
75
+ client.res.end();
76
+ }
77
+ this.clients.clear();
78
+ // Close server
79
+ if (this.server) {
80
+ const server = this.server;
81
+ this.server = null;
82
+ try {
83
+ server.close();
84
+ }
85
+ catch (error) {
86
+ const code = error.code;
87
+ if (code !== "ERR_SERVER_NOT_RUNNING") {
88
+ this.log("Failed to close server", error);
89
+ }
90
+ }
91
+ }
92
+ this.log("Server stopped");
93
+ }
94
+ /**
95
+ * Emit event to all connected clients
96
+ */
97
+ emit(event) {
98
+ // Store in history
99
+ this.eventHistory.push(event);
100
+ if (this.eventHistory.length > this.maxHistorySize) {
101
+ this.eventHistory.shift();
102
+ }
103
+ // Broadcast to SSE clients
104
+ const data = `data: ${JSON.stringify(event)}\n\n`;
105
+ for (const client of this.clients) {
106
+ try {
107
+ client.res.write(data);
108
+ }
109
+ catch {
110
+ // Client disconnected
111
+ }
112
+ }
113
+ this.log(`Emitted ${event.type} to ${this.clients.size} clients`);
114
+ }
115
+ /**
116
+ * Get the server URL
117
+ */
118
+ getUrl() {
119
+ return `http://${this.config.host}:${this.config.port}`;
120
+ }
121
+ handleRequest(req, res) {
122
+ const url = new URL(req.url || "/", `http://${this.config.host}:${this.config.port}`);
123
+ // CORS headers
124
+ res.setHeader("Access-Control-Allow-Origin", "*");
125
+ res.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
126
+ res.setHeader("Access-Control-Allow-Headers", "Content-Type");
127
+ if (req.method === "OPTIONS") {
128
+ res.writeHead(204);
129
+ res.end();
130
+ return;
131
+ }
132
+ // Route handling
133
+ if (url.pathname === "/events") {
134
+ this.handleSSE(req, res);
135
+ }
136
+ else if (url.pathname === "/api/history") {
137
+ this.handleHistory(res);
138
+ }
139
+ else if (url.pathname === "/api/clear") {
140
+ this.handleClear(res);
141
+ }
142
+ else {
143
+ this.handleStatic(url.pathname, res);
144
+ }
145
+ }
146
+ handleSSE(_req, res) {
147
+ res.writeHead(200, {
148
+ "Content-Type": "text/event-stream",
149
+ "Cache-Control": "no-cache",
150
+ Connection: "keep-alive",
151
+ });
152
+ // Send connection event
153
+ res.write(`data: ${JSON.stringify({ type: "connected", timestamp: Date.now() })}\n\n`);
154
+ // Setup heartbeat
155
+ const heartbeatInterval = setInterval(() => {
156
+ try {
157
+ res.write(":heartbeat\n\n");
158
+ }
159
+ catch {
160
+ // Connection closed
161
+ }
162
+ }, this.config.heartbeatInterval);
163
+ const client = { res, heartbeatInterval };
164
+ this.clients.add(client);
165
+ this.log(`Client connected, total: ${this.clients.size}`);
166
+ res.on("close", () => {
167
+ clearInterval(heartbeatInterval);
168
+ this.clients.delete(client);
169
+ this.log(`Client disconnected, total: ${this.clients.size}`);
170
+ });
171
+ }
172
+ handleHistory(res) {
173
+ res.writeHead(200, { "Content-Type": "application/json" });
174
+ res.end(JSON.stringify(this.eventHistory));
175
+ }
176
+ handleClear(res) {
177
+ this.eventHistory = [];
178
+ res.writeHead(200, { "Content-Type": "application/json" });
179
+ res.end(JSON.stringify({ cleared: true }));
180
+ }
181
+ handleStatic(pathname, res) {
182
+ // Serve UI from ui/dist
183
+ const uiDir = join(__dirname, "../../ui/dist");
184
+ let filePath = pathname === "/" ? "/index.html" : pathname;
185
+ filePath = join(uiDir, filePath);
186
+ // Security: prevent directory traversal
187
+ if (!filePath.startsWith(uiDir)) {
188
+ res.writeHead(403);
189
+ res.end("Forbidden");
190
+ return;
191
+ }
192
+ if (!existsSync(filePath)) {
193
+ // SPA fallback
194
+ filePath = join(uiDir, "index.html");
195
+ }
196
+ if (!existsSync(filePath)) {
197
+ res.writeHead(404);
198
+ res.end("Not found - run pnpm build:ui first");
199
+ return;
200
+ }
201
+ const ext = filePath.split(".").pop() || "";
202
+ const contentTypes = {
203
+ html: "text/html",
204
+ js: "application/javascript",
205
+ css: "text/css",
206
+ json: "application/json",
207
+ png: "image/png",
208
+ svg: "image/svg+xml",
209
+ };
210
+ res.writeHead(200, { "Content-Type": contentTypes[ext] || "text/plain" });
211
+ res.end(readFileSync(filePath));
212
+ }
213
+ }
214
+ //# sourceMappingURL=devtools-server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devtools-server.js","sourceRoot":"","sources":["../../src/server/devtools-server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,YAAY,EAAe,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAsB,MAAM,kBAAkB,CAAC;AAEvE,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAyB1D,MAAM,OAAO,cAAc;IACjB,MAAM,GAAkB,IAAI,CAAC;IAC7B,OAAO,GAAG,IAAI,GAAG,EAAa,CAAC;IAC/B,MAAM,CAAiB;IACvB,YAAY,GAAoB,EAAE,CAAC;IACnC,cAAc,GAAG,IAAI,CAAC;IACtB,WAAW,GAAwB,IAAI,CAAC;IAEhD,YAAY,SAA+B,EAA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AAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAEjC,wCAAwC;QACxC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YAChC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;YACnB,GAAG,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QAED,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC1B,eAAe;YACf,QAAQ,GAAG,IAAI,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QACvC,CAAC;QAED,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC1B,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;YACnB,GAAG,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;YAC/C,OAAO;QACT,CAAC;QAED,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;QAC5C,MAAM,YAAY,GAA2B;YAC3C,IAAI,EAAE,WAAW;YACjB,EAAE,EAAE,wBAAwB;YAC5B,GAAG,EAAE,UAAU;YACf,IAAI,EAAE,kBAAkB;YACxB,GAAG,EAAE,WAAW;YAChB,GAAG,EAAE,eAAe;SACrB,CAAC;QAEF,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,YAAY,CAAC,GAAG,CAAC,IAAI,YAAY,EAAE,CAAC,CAAC;QAC1E,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;IAClC,CAAC;CACF"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Convenience function to start DevTools server
3
+ */
4
+ import { DevToolsServer, type DevToolsServerConfig } from "./devtools-server";
5
+ /**
6
+ * Start a DevTools server.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { startDevToolsServer } from '@agentick/devtools';
11
+ *
12
+ * const server = startDevToolsServer({ port: 3001, debug: true });
13
+ * console.log(`DevTools: ${server.getUrl()}`);
14
+ *
15
+ * // Later...
16
+ * server.stop();
17
+ * ```
18
+ */
19
+ export declare function startDevToolsServer(config?: DevToolsServerConfig): DevToolsServer;
20
+ //# sourceMappingURL=start.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../src/server/start.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,cAAc,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAE9E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,cAAc,CAIjF"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Convenience function to start DevTools server
3
+ */
4
+ import { DevToolsServer } from "./devtools-server";
5
+ /**
6
+ * Start a DevTools server.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * import { startDevToolsServer } from '@agentick/devtools';
11
+ *
12
+ * const server = startDevToolsServer({ port: 3001, debug: true });
13
+ * console.log(`DevTools: ${server.getUrl()}`);
14
+ *
15
+ * // Later...
16
+ * server.stop();
17
+ * ```
18
+ */
19
+ export function startDevToolsServer(config) {
20
+ const server = new DevToolsServer(config);
21
+ server.start();
22
+ return server;
23
+ }
24
+ //# sourceMappingURL=start.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start.js","sourceRoot":"","sources":["../../src/server/start.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,cAAc,EAA6B,MAAM,mBAAmB,CAAC;AAE9E;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAA6B;IAC/D,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,CAAC,KAAK,EAAE,CAAC;IACf,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "@agentick/devtools",
3
+ "version": "0.0.1",
4
+ "files": [
5
+ "dist",
6
+ "ui/dist"
7
+ ],
8
+ "type": "module",
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ }
16
+ },
17
+ "dependencies": {
18
+ "@agentick/shared": "0.0.1"
19
+ },
20
+ "devDependencies": {
21
+ "@types/node": "^22.10.10",
22
+ "@types/react": "^19.0.0",
23
+ "@types/react-dom": "^19.0.0",
24
+ "@vitejs/plugin-react": "^4.3.4",
25
+ "concurrently": "^9.1.2",
26
+ "react": "^19.0.0",
27
+ "react-dom": "^19.0.0",
28
+ "tsx": "^4.19.2",
29
+ "typescript": "^5.7.3",
30
+ "vite": "^6.0.0"
31
+ },
32
+ "peerDependencies": {
33
+ "react": ">=18.0.0",
34
+ "react-dom": ">=18.0.0"
35
+ },
36
+ "peerDependenciesMeta": {
37
+ "react": {
38
+ "optional": true
39
+ },
40
+ "react-dom": {
41
+ "optional": true
42
+ }
43
+ },
44
+ "scripts": {
45
+ "build": "tsc -p tsconfig.build.json && pnpm build:ui",
46
+ "build:ui": "cd ui && vite build",
47
+ "dev": "tsx src/cli.ts",
48
+ "dev:ui": "cd ui && vite",
49
+ "typecheck": "tsc --noEmit"
50
+ }
51
+ }