@vue/devtools-agent 0.0.0-stage → 9.0.0-rc.2

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.
@@ -0,0 +1,482 @@
1
+ import { z } from "zod";
2
+ import { configure } from "safe-stable-stringify";
3
+ //#region src/mcp/schemas.ts
4
+ const jsonRecord = z.record(z.string(), z.json());
5
+ const encodedValue = z.lazy(() => z.union([
6
+ z.object({ kind: z.enum(["null", "undefined"]) }),
7
+ z.object({
8
+ kind: z.literal("boolean"),
9
+ value: z.boolean()
10
+ }),
11
+ z.object({
12
+ kind: z.literal("number"),
13
+ value: z.union([z.number(), z.enum([
14
+ "NaN",
15
+ "Infinity",
16
+ "-Infinity"
17
+ ])])
18
+ }),
19
+ z.object({
20
+ kind: z.literal("string"),
21
+ value: z.string(),
22
+ truncated: z.boolean().optional(),
23
+ length: z.number().optional()
24
+ }),
25
+ z.object({
26
+ kind: z.enum([
27
+ "bigint",
28
+ "date",
29
+ "regexp"
30
+ ]),
31
+ value: z.string()
32
+ }),
33
+ z.object({
34
+ kind: z.literal("symbol"),
35
+ description: z.string()
36
+ }),
37
+ z.object({
38
+ kind: z.literal("function"),
39
+ name: z.string().optional(),
40
+ sourcePreview: z.string().optional()
41
+ }),
42
+ z.object({
43
+ kind: z.literal("array"),
44
+ length: z.number(),
45
+ preview: z.array(valueEntry),
46
+ handle: z.string().optional()
47
+ }),
48
+ z.object({
49
+ kind: z.literal("object"),
50
+ name: z.string(),
51
+ entries: z.number(),
52
+ preview: z.array(valueEntry),
53
+ handle: z.string().optional()
54
+ }),
55
+ z.object({
56
+ kind: z.enum(["map", "set"]),
57
+ size: z.number(),
58
+ preview: z.array(valueEntry),
59
+ handle: z.string().optional()
60
+ }),
61
+ z.object({
62
+ kind: z.literal("component"),
63
+ id: z.string().optional(),
64
+ name: z.string()
65
+ }),
66
+ z.object({
67
+ kind: z.literal("dom"),
68
+ tag: z.string(),
69
+ id: z.string().optional(),
70
+ className: z.string().optional()
71
+ }),
72
+ z.looseObject({
73
+ kind: z.literal("custom"),
74
+ value: encodedValue,
75
+ handle: z.string().optional(),
76
+ readOnly: z.boolean().optional()
77
+ }),
78
+ z.object({
79
+ kind: z.literal("error"),
80
+ name: z.string(),
81
+ message: z.string(),
82
+ stack: z.string().optional()
83
+ }),
84
+ z.object({
85
+ kind: z.literal("circular"),
86
+ handle: z.string()
87
+ })
88
+ ]));
89
+ const valueEntry = z.object({
90
+ key: z.string(),
91
+ value: encodedValue
92
+ });
93
+ const treeNode = z.looseObject({
94
+ id: z.string(),
95
+ appId: z.string(),
96
+ name: z.string(),
97
+ parentId: z.string().optional(),
98
+ file: z.string().optional(),
99
+ childCount: z.number().optional(),
100
+ updatedAt: z.number()
101
+ });
102
+ const inspectorNode = z.lazy(() => z.looseObject({
103
+ id: z.string(),
104
+ label: z.string(),
105
+ children: z.array(inspectorNode).optional()
106
+ }));
107
+ const route = z.lazy(() => z.object({
108
+ path: z.string(),
109
+ name: z.string().optional(),
110
+ meta: jsonRecord.optional(),
111
+ children: z.array(route).optional()
112
+ }));
113
+ const pagination = z.object({
114
+ total: z.number().int().nonnegative(),
115
+ pageSize: z.number().int().positive(),
116
+ current: z.number().int().positive(),
117
+ next: z.number().int().positive().nullable()
118
+ });
119
+ const state = z.object({
120
+ snapshotId: z.string(),
121
+ pagination,
122
+ componentId: z.string(),
123
+ version: z.number(),
124
+ sections: z.array(z.object({
125
+ id: z.string(),
126
+ label: z.string(),
127
+ partial: z.boolean().optional(),
128
+ entries: z.array(valueEntry.extend({
129
+ path: z.array(z.string()),
130
+ editable: z.boolean(),
131
+ meta: jsonRecord.optional()
132
+ }))
133
+ })),
134
+ reactivityGraph: z.object({
135
+ nodes: z.array(z.object({
136
+ id: z.string(),
137
+ type: z.string(),
138
+ label: z.string(),
139
+ data: jsonRecord
140
+ })),
141
+ relationships: z.array(z.object({
142
+ id: z.string(),
143
+ from: z.string(),
144
+ to: z.string()
145
+ }))
146
+ }).optional()
147
+ });
148
+ const stateValueSchema = z.discriminatedUnion("found", [z.object({ found: z.literal(false) }), z.object({
149
+ found: z.literal(true),
150
+ editable: z.boolean(),
151
+ value: encodedValue,
152
+ snapshotId: z.string().optional(),
153
+ pagination: pagination.optional()
154
+ })]);
155
+ const resultSchemas = {
156
+ apps: z.object({ apps: z.array(z.object({
157
+ id: z.string(),
158
+ name: z.string(),
159
+ version: z.string().optional(),
160
+ componentCount: z.number()
161
+ })) }),
162
+ plugins: z.object({ plugins: z.array(z.looseObject({
163
+ id: z.string(),
164
+ settings: jsonRecord,
165
+ settingValues: jsonRecord
166
+ })) }),
167
+ health: z.object({
168
+ status: z.literal("ready"),
169
+ performance: z.object({
170
+ receivedEvents: z.number(),
171
+ emittedEvents: z.number(),
172
+ droppedEvents: z.number(),
173
+ coalescedEvents: z.number(),
174
+ bufferedEvents: z.number(),
175
+ bufferedBytes: z.number(),
176
+ collectionActive: z.boolean(),
177
+ attachedClients: z.number()
178
+ })
179
+ }),
180
+ tree: z.object({
181
+ appId: z.string().optional(),
182
+ version: z.number().optional(),
183
+ nodes: z.array(treeNode)
184
+ }),
185
+ children: z.object({
186
+ nodes: z.array(treeNode),
187
+ cursor: z.string().optional()
188
+ }),
189
+ command: z.object({
190
+ status: z.union([z.literal(0), z.literal(1)]),
191
+ error: z.json().optional()
192
+ }),
193
+ state: state.nullable(),
194
+ inspectors: z.object({ inspectors: z.array(z.looseObject({
195
+ id: z.string(),
196
+ label: z.string()
197
+ })) }),
198
+ inspectorTree: z.object({
199
+ inspectorId: z.string(),
200
+ rootNodes: z.array(inspectorNode)
201
+ }),
202
+ renderCode: z.string().nullable(),
203
+ router: z.object({
204
+ appId: z.string().optional(),
205
+ currentRoute: z.looseObject({
206
+ path: z.string().optional(),
207
+ fullPath: z.string().optional(),
208
+ matched: z.array(route).optional()
209
+ }).optional(),
210
+ routes: z.array(route)
211
+ }),
212
+ matches: z.object({
213
+ appId: z.string().optional(),
214
+ path: z.string(),
215
+ routes: z.array(route)
216
+ }),
217
+ expanded: z.object({
218
+ handle: z.string(),
219
+ path: z.array(z.string()),
220
+ value: encodedValue,
221
+ snapshotId: z.string(),
222
+ pagination
223
+ }),
224
+ stateValue: stateValueSchema,
225
+ edited: z.object({
226
+ status: z.literal(1),
227
+ state: stateValueSchema
228
+ })
229
+ };
230
+ function snapshotSchema(result) {
231
+ return z.object({
232
+ page: z.object({
233
+ id: z.string(),
234
+ url: z.string(),
235
+ title: z.string()
236
+ }),
237
+ capturedAt: z.number(),
238
+ result
239
+ });
240
+ }
241
+ //#endregion
242
+ //#region src/mcp/tools.ts
243
+ const stringify = configure({
244
+ bigint: false,
245
+ circularValue: "[Circular]",
246
+ deterministic: false
247
+ });
248
+ function createVueDevtoolsAgentTools(connection, page) {
249
+ const appId = z.string().min(1);
250
+ const target = z.strictObject({ appId });
251
+ const component = target.extend({ componentId: z.string().min(1) });
252
+ const inspector = target.extend({ inspectorId: z.string().min(1) });
253
+ const pagination = {
254
+ page: z.number().int().min(1).default(1),
255
+ pageSize: z.number().int().min(1).max(500).default(50),
256
+ snapshotId: z.string().min(1).optional()
257
+ };
258
+ const valuePagination = {
259
+ page: z.number().int().min(1).optional(),
260
+ pageSize: z.number().int().min(1).max(5e3).optional(),
261
+ snapshotId: pagination.snapshotId
262
+ };
263
+ const pagingGuide = " Paging: start at page 1, then pass the returned snapshotId and pagination.next as page with the same target and pageSize until next is null. Pages may hold fewer entries to fit the response budget. Restart without snapshotId if it expires.";
264
+ const previewNote = " Objects and arrays preview 30 entries.";
265
+ function tool(description, schema, handler, resultSchema, kind = "query") {
266
+ return {
267
+ type: kind,
268
+ jsonSerializable: true,
269
+ args: [schema],
270
+ returns: snapshotSchema(resultSchema),
271
+ agent: {
272
+ description,
273
+ safety: kind === "query" ? "read" : "action"
274
+ },
275
+ async handler(input) {
276
+ return toSnapshot(page, await handler(schema.parse(input)));
277
+ }
278
+ };
279
+ }
280
+ function noArgTool(description, handler, resultSchema) {
281
+ const definition = tool(description, z.strictObject({}), handler, resultSchema);
282
+ return {
283
+ ...definition,
284
+ args: [],
285
+ handler: () => definition.handler({})
286
+ };
287
+ }
288
+ const field = z.object({
289
+ sectionId: z.string().min(1),
290
+ path: z.array(z.string().refine((segment) => ![
291
+ "__proto__",
292
+ "prototype",
293
+ "constructor"
294
+ ].includes(segment), "Unsafe state path")).min(1).max(20)
295
+ });
296
+ const componentField = component.extend(field.shape);
297
+ const inspectorField = inspector.extend({
298
+ nodeId: z.string().min(1),
299
+ ...field.shape
300
+ });
301
+ async function editField(command, read) {
302
+ if (!connection.command) throw new Error("This host does not support state editing");
303
+ const result = await connection.command({
304
+ ...command,
305
+ payload: {
306
+ ...command.payload,
307
+ requireEditable: true
308
+ }
309
+ });
310
+ if (result.status !== 1) {
311
+ const reason = stringify(result.error) ?? "the runtime rejected the edit";
312
+ throw new Error(reason.includes("not found") ? "State path was not found. Read the current component or inspector state and correct the path before editing." : reason.includes("read-only") ? "State field is read-only. Choose an editable field from the current state." : `State edit failed: ${reason}`);
313
+ }
314
+ try {
315
+ return {
316
+ status: 1,
317
+ state: await read()
318
+ };
319
+ } catch (error) {
320
+ throw new Error(`The edit command completed, but reading back the value failed. Inspect the state before retrying the edit. ${String(error)}`);
321
+ }
322
+ }
323
+ return {
324
+ "list-apps": noArgTool("Identify this page and list its Vue apps. Call before inspecting an app. IDs and value handles belong to this document and expire on reload. page.url follows the document location; use router-state for the Vue route.", () => connection.query({ type: "apps:snapshot" }), resultSchemas.apps),
325
+ "list-plugins": noArgTool("List Vue DevTools plugins registered on this page, including their settings.", () => connection.query({ type: "plugins:snapshot" }), resultSchemas.plugins),
326
+ "runtime-health": noArgTool("Read whether the Vue runtime is collecting and a small performance snapshot. Use this when component data looks empty or stalled.", () => connection.query({ type: "runtime:health" }), resultSchemas.health),
327
+ "component-tree": tool("List the initially expanded Vue component tree and source files. With filter, search every component in the app by name or source file (up to 100 matches, each with its parentId) instead. The tree can be partial; use component-children for childCount and cursors. If a cursor expires, restart component-children for that component.", target.extend({ filter: z.string().max(200).optional() }), ({ appId, filter }) => filter ? connection.query({
328
+ type: "components:search",
329
+ appId,
330
+ payload: { filter }
331
+ }) : connection.query({
332
+ type: "components:treeSnapshot",
333
+ appId,
334
+ payload: {}
335
+ }), resultSchemas.tree),
336
+ "component-children": tool("Read one page of a component’s children. Pass the returned cursor to read the next page in the same app and document. If a cursor expires, restart without it. Use cancel-component-children to drop a cursor you will not finish.", component.extend({ cursor: z.string().min(1).optional() }), ({ appId, ...payload }) => connection.query({
337
+ type: "components:treeChildren",
338
+ appId,
339
+ payload
340
+ }), resultSchemas.children),
341
+ "cancel-component-children": tool("Drop a component-children cursor that will not be read again.", target.extend({ cursor: z.string().min(1) }), ({ appId, cursor }) => {
342
+ if (!connection.command) throw new Error("This host cannot cancel component expansion");
343
+ return connection.command({
344
+ type: "components:cancelTreeChildren",
345
+ appId,
346
+ payload: { cursor }
347
+ });
348
+ }, resultSchemas.command),
349
+ "component-state": tool("Read a page of component state, grouped by section. pagination.total counts top-level fields across all sections. Use expand-value or component-value for nested contents. A null result means the component was not found." + previewNote + pagingGuide, component.extend(pagination), ({ appId, ...payload }) => connection.query({
350
+ type: "components:stateSnapshot",
351
+ appId,
352
+ payload
353
+ }), resultSchemas.state),
354
+ "list-inspectors": tool("List plugin inspectors, including Pinia when registered. Use inspector-tree and inspector-state to inspect stores or other plugin data.", target, ({ appId }) => connection.query({
355
+ type: "inspectors:list",
356
+ appId
357
+ }), resultSchemas.inspectors),
358
+ "inspector-tree": tool("Find nodes in a plugin inspector, such as Pinia stores. Use inspector IDs from list-inspectors. filter is interpreted by that plugin, not as a plain name search.", inspector.extend({ filter: z.string().max(200).optional() }), ({ appId, ...payload }) => connection.query({
359
+ type: "inspectors:treeSnapshot",
360
+ appId,
361
+ payload
362
+ }), resultSchemas.inspectorTree),
363
+ "inspector-state": tool("Read a page of Inspector state, such as a Pinia store, grouped by section. pagination.total counts fields across all sections. Use node IDs from inspector-tree and inspector-value for a known path. The plugin state hook runs when starting a batch. A null result means no matching state was found." + previewNote + pagingGuide, inspector.extend({
364
+ nodeId: z.string().min(1),
365
+ ...pagination
366
+ }), ({ appId, ...payload }) => connection.query({
367
+ type: "inspectors:stateSnapshot",
368
+ appId,
369
+ payload
370
+ }), resultSchemas.state),
371
+ "component-render-code": tool("Read the render function source for one component, when the runtime can recover it.", component, ({ appId, componentId }) => connection.query({
372
+ type: "components:getRenderCode",
373
+ appId,
374
+ payload: { componentId }
375
+ }), resultSchemas.renderCode),
376
+ "router-state": tool("Inspect the app’s current route and registered routes to diagnose navigation and matched components.", target, ({ appId }) => connection.query({
377
+ type: "router:snapshot",
378
+ appId
379
+ }), resultSchemas.router),
380
+ "router-matches": tool("Match a path against the app router without navigating. Use router-state for the current route.", target.extend({ path: z.string().min(1).max(2e3) }), ({ appId, path }) => connection.query({
381
+ type: "router:matchedRoutes",
382
+ appId,
383
+ payload: { path }
384
+ }), resultSchemas.matches),
385
+ "component-value": tool("Read a known field in a component state section without a snapshot or handle, including fields outside the current page. Get sectionId from component-state (for example props, data, setup); path uses property names or array indexes as strings. found:false means the target or path is missing; a present null/undefined value has a codec tag. Pass page:1 to paginate (strings default to 5000 UTF-16 units, collections to 50 entries)." + previewNote + pagingGuide, componentField.extend(valuePagination), ({ appId, ...payload }) => connection.query({
386
+ type: "components:stateValue",
387
+ appId,
388
+ payload
389
+ }), resultSchemas.stateValue),
390
+ "inspector-value": tool("Read one field through an existing plugin Inspector, including Pinia. Use inspector/node/section IDs from list-inspectors, inspector-tree and inspector-state. path starts with the state entry key, followed by nested keys. found:false means no matching target or path. The plugin getInspectorState hook still runs, but only the requested value is encoded. Pass page:1 to paginate (strings default to 5000 UTF-16 units, collections to 50 entries)." + previewNote + pagingGuide, inspectorField.extend(valuePagination), ({ appId, ...payload }) => connection.query({
391
+ type: "inspectors:stateValue",
392
+ appId,
393
+ payload
394
+ }), resultSchemas.stateValue),
395
+ ...connection.command ? {
396
+ "edit-component-state": tool("Change one existing editable component field through the Kit edit command. First read component-value and check editable. Accepts JSON values only; no delete or rename. Props can be overwritten by the parent. Returns the actual value read after the command; status:1 is command acknowledgement, not proof that the requested value persisted. If transport/readback fails, read state before retrying; do not blindly repeat a mutation.", componentField.extend({ value: z.json() }), ({ appId, value, ...payload }) => editField({
397
+ type: "components:editState",
398
+ appId,
399
+ payload: {
400
+ ...payload,
401
+ value
402
+ }
403
+ }, () => connection.query({
404
+ type: "components:stateValue",
405
+ appId,
406
+ payload
407
+ })), resultSchemas.edited, "action"),
408
+ "edit-inspector-state": tool("Change one existing editable Inspector field through its plugin edit hook, including Pinia. First read inspector-value and check editable. Accepts a JSON value at the entry path; does not replace the entire store. Returns the actual value read after the command, which a plugin may transform or leave unchanged. If transport/readback fails, inspect state before retrying.", inspectorField.extend({ value: z.json() }), ({ appId, value, ...payload }) => editField({
409
+ type: "inspectors:editState",
410
+ appId,
411
+ payload: {
412
+ ...payload,
413
+ value
414
+ }
415
+ }, () => connection.query({
416
+ type: "inspectors:stateValue",
417
+ appId,
418
+ payload
419
+ })), resultSchemas.edited, "action")
420
+ } : {},
421
+ "expand-value": tool("Expand an encoded value handle from a previous state or inspector query in this app and document. Read only the necessary path. If a handle expired, rerun the original query for a new one. Handles expire when the same target is read again or the page reloads." + pagingGuide, target.extend({
422
+ handle: z.string().min(1),
423
+ path: z.array(z.string()).max(20).optional(),
424
+ ...pagination,
425
+ pageSize: z.number().int().min(1).max(5e3).optional()
426
+ }), async ({ appId, ...payload }) => {
427
+ const result = await connection.query({
428
+ type: "values:expand",
429
+ appId,
430
+ payload
431
+ });
432
+ if (result == null) throw new Error("Value handle is expired or unknown. Rerun the original component-state or inspector-state query, then retry expand-value with the new handle. If the page reloaded, rediscover its tools first.");
433
+ if ("found" in result && result.found === false) throw new Error("Value path was not found. Read the current value and correct the path before expanding again.");
434
+ return result;
435
+ }, resultSchemas.expanded)
436
+ };
437
+ }
438
+ function toSnapshot(page, result) {
439
+ return {
440
+ page: {
441
+ id: page.id,
442
+ url: page.url,
443
+ title: page.title
444
+ },
445
+ capturedAt: Date.now(),
446
+ result: toJson(result) ?? null
447
+ };
448
+ }
449
+ function toJson(value) {
450
+ return JSON.parse(stringify(value) ?? "null");
451
+ }
452
+ //#endregion
453
+ //#region src/session.ts
454
+ /** Connect on the first call and retain the connection until the host disposes it. */
455
+ function createVueDevtoolsAgentSession(connect) {
456
+ let connection;
457
+ let disposed = false;
458
+ function getConnection() {
459
+ if (disposed) throw new Error("Vue DevTools agent session is disposed");
460
+ return connection ??= connect();
461
+ }
462
+ return {
463
+ async query(request) {
464
+ return getConnection().query(request);
465
+ },
466
+ async command(request) {
467
+ const current = getConnection();
468
+ if (!current.command) throw new Error("Vue DevTools agent session cannot send commands");
469
+ return current.command(request);
470
+ },
471
+ dispose() {
472
+ disposed = true;
473
+ const current = connection;
474
+ connection = void 0;
475
+ current?.dispose();
476
+ }
477
+ };
478
+ }
479
+ //#endregion
480
+ export { createVueDevtoolsAgentTools as n, createVueDevtoolsAgentSession as t };
481
+
482
+ //# sourceMappingURL=session-D7L9Vjbr.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-D7L9Vjbr.mjs","names":[],"sources":["../src/mcp/schemas.ts","../src/mcp/tools.ts","../src/session.ts"],"sourcesContent":["import { z } from 'zod'\n\nconst jsonRecord = z.record(z.string(), z.json())\n// Preserve codec tags: a present undefined/null value is not a missing field.\nconst encodedValue: z.ZodType = z.lazy(() =>\n z.union([\n z.object({ kind: z.enum(['null', 'undefined']) }),\n z.object({ kind: z.literal('boolean'), value: z.boolean() }),\n z.object({\n kind: z.literal('number'),\n value: z.union([z.number(), z.enum(['NaN', 'Infinity', '-Infinity'])]),\n }),\n z.object({\n kind: z.literal('string'),\n value: z.string(),\n truncated: z.boolean().optional(),\n length: z.number().optional(),\n }),\n z.object({ kind: z.enum(['bigint', 'date', 'regexp']), value: z.string() }),\n z.object({ kind: z.literal('symbol'), description: z.string() }),\n z.object({\n kind: z.literal('function'),\n name: z.string().optional(),\n sourcePreview: z.string().optional(),\n }),\n z.object({\n kind: z.literal('array'),\n length: z.number(),\n preview: z.array(valueEntry),\n handle: z.string().optional(),\n }),\n z.object({\n kind: z.literal('object'),\n name: z.string(),\n entries: z.number(),\n preview: z.array(valueEntry),\n handle: z.string().optional(),\n }),\n z.object({\n kind: z.enum(['map', 'set']),\n size: z.number(),\n preview: z.array(valueEntry),\n handle: z.string().optional(),\n }),\n z.object({ kind: z.literal('component'), id: z.string().optional(), name: z.string() }),\n z.object({\n kind: z.literal('dom'),\n tag: z.string(),\n id: z.string().optional(),\n className: z.string().optional(),\n }),\n z.looseObject({\n kind: z.literal('custom'),\n value: encodedValue,\n handle: z.string().optional(),\n readOnly: z.boolean().optional(),\n }),\n z.object({\n kind: z.literal('error'),\n name: z.string(),\n message: z.string(),\n stack: z.string().optional(),\n }),\n z.object({ kind: z.literal('circular'), handle: z.string() }),\n ]),\n)\nconst valueEntry = z.object({ key: z.string(), value: encodedValue })\nconst treeNode = z.looseObject({\n id: z.string(),\n appId: z.string(),\n name: z.string(),\n parentId: z.string().optional(),\n file: z.string().optional(),\n childCount: z.number().optional(),\n updatedAt: z.number(),\n})\nconst inspectorNode: z.ZodType = z.lazy(() =>\n z.looseObject({ id: z.string(), label: z.string(), children: z.array(inspectorNode).optional() }),\n)\nconst route: z.ZodType = z.lazy(() =>\n z.object({\n path: z.string(),\n name: z.string().optional(),\n meta: jsonRecord.optional(),\n children: z.array(route).optional(),\n }),\n)\nconst pagination = z.object({\n total: z.number().int().nonnegative(),\n pageSize: z.number().int().positive(),\n current: z.number().int().positive(),\n next: z.number().int().positive().nullable(),\n})\nconst state = z.object({\n snapshotId: z.string(),\n pagination,\n componentId: z.string(),\n version: z.number(),\n sections: z.array(\n z.object({\n id: z.string(),\n label: z.string(),\n partial: z.boolean().optional(),\n entries: z.array(\n valueEntry.extend({\n path: z.array(z.string()),\n editable: z.boolean(),\n meta: jsonRecord.optional(),\n }),\n ),\n }),\n ),\n reactivityGraph: z\n .object({\n nodes: z.array(\n z.object({ id: z.string(), type: z.string(), label: z.string(), data: jsonRecord }),\n ),\n relationships: z.array(z.object({ id: z.string(), from: z.string(), to: z.string() })),\n })\n .optional(),\n})\nconst stateValueSchema = z.discriminatedUnion('found', [\n z.object({ found: z.literal(false) }),\n z.object({\n found: z.literal(true),\n editable: z.boolean(),\n value: encodedValue,\n snapshotId: z.string().optional(),\n pagination: pagination.optional(),\n }),\n])\nexport const resultSchemas = {\n apps: z.object({\n apps: z.array(\n z.object({\n id: z.string(),\n name: z.string(),\n version: z.string().optional(),\n componentCount: z.number(),\n }),\n ),\n }),\n plugins: z.object({\n plugins: z.array(\n z.looseObject({ id: z.string(), settings: jsonRecord, settingValues: jsonRecord }),\n ),\n }),\n health: z.object({\n status: z.literal('ready'),\n performance: z.object({\n receivedEvents: z.number(),\n emittedEvents: z.number(),\n droppedEvents: z.number(),\n coalescedEvents: z.number(),\n bufferedEvents: z.number(),\n bufferedBytes: z.number(),\n collectionActive: z.boolean(),\n attachedClients: z.number(),\n }),\n }),\n tree: z.object({\n appId: z.string().optional(),\n version: z.number().optional(),\n nodes: z.array(treeNode),\n }),\n children: z.object({ nodes: z.array(treeNode), cursor: z.string().optional() }),\n command: z.object({ status: z.union([z.literal(0), z.literal(1)]), error: z.json().optional() }),\n state: state.nullable(),\n inspectors: z.object({\n inspectors: z.array(z.looseObject({ id: z.string(), label: z.string() })),\n }),\n inspectorTree: z.object({ inspectorId: z.string(), rootNodes: z.array(inspectorNode) }),\n renderCode: z.string().nullable(),\n router: z.object({\n appId: z.string().optional(),\n currentRoute: z\n .looseObject({\n path: z.string().optional(),\n fullPath: z.string().optional(),\n matched: z.array(route).optional(),\n })\n .optional(),\n routes: z.array(route),\n }),\n matches: z.object({ appId: z.string().optional(), path: z.string(), routes: z.array(route) }),\n expanded: z.object({\n handle: z.string(),\n path: z.array(z.string()),\n value: encodedValue,\n snapshotId: z.string(),\n pagination,\n }),\n stateValue: stateValueSchema,\n edited: z.object({ status: z.literal(1), state: stateValueSchema }),\n}\n\nexport function snapshotSchema(result: z.ZodType) {\n return z.object({\n page: z.object({ id: z.string(), url: z.string(), title: z.string() }),\n capturedAt: z.number(),\n result,\n })\n}\n","import type { RuntimeCommandRequest, StateValueMessage } from '@vue/devtools-kit'\nimport { z } from 'zod'\nimport { resultSchemas, snapshotSchema } from './schemas'\nimport { configure } from 'safe-stable-stringify'\nimport type {\n VueDevtoolsAgentConnection,\n VueDevtoolsAgentPage,\n VueDevtoolsAgentSnapshot,\n} from '../types'\n\nconst stringify = configure({ bigint: false, circularValue: '[Circular]', deterministic: false })\n\nexport function createVueDevtoolsAgentTools(\n connection: VueDevtoolsAgentConnection,\n page: VueDevtoolsAgentPage,\n) {\n const appId = z.string().min(1)\n const target = z.strictObject({ appId })\n const component = target.extend({ componentId: z.string().min(1) })\n const inspector = target.extend({ inspectorId: z.string().min(1) })\n const pagination = {\n page: z.number().int().min(1).default(1),\n pageSize: z.number().int().min(1).max(500).default(50),\n snapshotId: z.string().min(1).optional(),\n }\n const valuePagination = {\n page: z.number().int().min(1).optional(),\n pageSize: z.number().int().min(1).max(5000).optional(),\n snapshotId: pagination.snapshotId,\n }\n // Inline so the protocol reaches agents on hosts that never register the help tool.\n const pagingGuide =\n ' Paging: start at page 1, then pass the returned snapshotId and pagination.next as page with the same target and pageSize until next is null. Pages may hold fewer entries to fit the response budget. Restart without snapshotId if it expires.'\n const previewNote = ' Objects and arrays preview 30 entries.'\n const handleNote = ' Handles expire when the same target is read again or the page reloads.'\n\n function tool<S extends z.ZodType>(\n description: string,\n schema: S,\n handler: (input: z.output<S>) => Promise<unknown>,\n resultSchema: z.ZodType,\n kind: 'query' | 'action' = 'query',\n ) {\n return {\n type: kind,\n jsonSerializable: true as const,\n args: [schema] as [S],\n returns: snapshotSchema(resultSchema),\n agent: { description, safety: kind === 'query' ? ('read' as const) : ('action' as const) },\n async handler(input: z.input<S>) {\n const result = await handler(schema.parse(input))\n return toSnapshot(page, result)\n },\n }\n }\n\n function noArgTool(\n description: string,\n handler: () => Promise<unknown>,\n resultSchema: z.ZodType,\n ) {\n const definition = tool(description, z.strictObject({}), handler, resultSchema)\n return { ...definition, args: [], handler: () => definition.handler({}) }\n }\n\n const field = z.object({\n sectionId: z.string().min(1),\n path: z\n .array(\n z\n .string()\n .refine(\n (segment) => !['__proto__', 'prototype', 'constructor'].includes(segment),\n 'Unsafe state path',\n ),\n )\n .min(1)\n .max(20),\n })\n const componentField = component.extend(field.shape)\n const inspectorField = inspector.extend({ nodeId: z.string().min(1), ...field.shape })\n\n async function editField(command: RuntimeCommandRequest, read: () => Promise<StateValueMessage>) {\n if (!connection.command) throw new Error('This host does not support state editing')\n // requireEditable makes the runtime reject missing or read-only paths before any plugin hook runs.\n const result = await connection.command({\n ...command,\n payload: { ...command.payload, requireEditable: true },\n } as RuntimeCommandRequest)\n if (result.status !== 1) {\n const reason = stringify(result.error) ?? 'the runtime rejected the edit'\n throw new Error(\n reason.includes('not found')\n ? 'State path was not found. Read the current component or inspector state and correct the path before editing.'\n : reason.includes('read-only')\n ? 'State field is read-only. Choose an editable field from the current state.'\n : `State edit failed: ${reason}`,\n )\n }\n try {\n return { status: 1 as const, state: await read() }\n } catch (error) {\n throw new Error(\n `The edit command completed, but reading back the value failed. Inspect the state before retrying the edit. ${String(error)}`,\n )\n }\n }\n\n const listApps = noArgTool(\n 'Identify this page and list its Vue apps. Call before inspecting an app. IDs and value handles belong to this document and expire on reload. page.url follows the document location; use router-state for the Vue route.',\n () => connection.query({ type: 'apps:snapshot' }),\n resultSchemas.apps,\n )\n const listPlugins = noArgTool(\n 'List Vue DevTools plugins registered on this page, including their settings.',\n () => connection.query({ type: 'plugins:snapshot' }),\n resultSchemas.plugins,\n )\n const runtimeHealth = noArgTool(\n 'Read whether the Vue runtime is collecting and a small performance snapshot. Use this when component data looks empty or stalled.',\n () => connection.query({ type: 'runtime:health' }),\n resultSchemas.health,\n )\n\n return {\n 'list-apps': listApps,\n 'list-plugins': listPlugins,\n 'runtime-health': runtimeHealth,\n 'component-tree': tool(\n 'List the initially expanded Vue component tree and source files. With filter, search every component in the app by name or source file (up to 100 matches, each with its parentId) instead. The tree can be partial; use component-children for childCount and cursors. If a cursor expires, restart component-children for that component.',\n target.extend({ filter: z.string().max(200).optional() }),\n ({ appId, filter }) =>\n filter\n ? connection.query({ type: 'components:search', appId, payload: { filter } })\n : connection.query({ type: 'components:treeSnapshot', appId, payload: {} }),\n resultSchemas.tree,\n ),\n 'component-children': tool(\n 'Read one page of a component’s children. Pass the returned cursor to read the next page in the same app and document. If a cursor expires, restart without it. Use cancel-component-children to drop a cursor you will not finish.',\n component.extend({ cursor: z.string().min(1).optional() }),\n ({ appId, ...payload }) =>\n connection.query({ type: 'components:treeChildren', appId, payload }),\n resultSchemas.children,\n ),\n 'cancel-component-children': tool(\n 'Drop a component-children cursor that will not be read again.',\n target.extend({ cursor: z.string().min(1) }),\n ({ appId, cursor }) => {\n if (!connection.command) throw new Error('This host cannot cancel component expansion')\n return connection.command({\n type: 'components:cancelTreeChildren',\n appId,\n payload: { cursor },\n })\n },\n resultSchemas.command,\n ),\n 'component-state': tool(\n 'Read a page of component state, grouped by section. pagination.total counts top-level fields across all sections. Use expand-value or component-value for nested contents. A null result means the component was not found.' +\n previewNote +\n pagingGuide,\n component.extend(pagination),\n ({ appId, ...payload }) =>\n connection.query({ type: 'components:stateSnapshot', appId, payload }),\n resultSchemas.state,\n ),\n 'list-inspectors': tool(\n 'List plugin inspectors, including Pinia when registered. Use inspector-tree and inspector-state to inspect stores or other plugin data.',\n target,\n ({ appId }) => connection.query({ type: 'inspectors:list', appId }),\n resultSchemas.inspectors,\n ),\n 'inspector-tree': tool(\n 'Find nodes in a plugin inspector, such as Pinia stores. Use inspector IDs from list-inspectors. filter is interpreted by that plugin, not as a plain name search.',\n inspector.extend({ filter: z.string().max(200).optional() }),\n ({ appId, ...payload }) =>\n connection.query({ type: 'inspectors:treeSnapshot', appId, payload }),\n resultSchemas.inspectorTree,\n ),\n 'inspector-state': tool(\n 'Read a page of Inspector state, such as a Pinia store, grouped by section. pagination.total counts fields across all sections. Use node IDs from inspector-tree and inspector-value for a known path. The plugin state hook runs when starting a batch. A null result means no matching state was found.' +\n previewNote +\n pagingGuide,\n inspector.extend({ nodeId: z.string().min(1), ...pagination }),\n ({ appId, ...payload }) =>\n connection.query({ type: 'inspectors:stateSnapshot', appId, payload }),\n resultSchemas.state,\n ),\n 'component-render-code': tool(\n 'Read the render function source for one component, when the runtime can recover it.',\n component,\n ({ appId, componentId }) =>\n connection.query({ type: 'components:getRenderCode', appId, payload: { componentId } }),\n resultSchemas.renderCode,\n ),\n 'router-state': tool(\n 'Inspect the app’s current route and registered routes to diagnose navigation and matched components.',\n target,\n ({ appId }) => connection.query({ type: 'router:snapshot', appId }),\n resultSchemas.router,\n ),\n 'router-matches': tool(\n 'Match a path against the app router without navigating. Use router-state for the current route.',\n target.extend({ path: z.string().min(1).max(2000) }),\n ({ appId, path }) =>\n connection.query({ type: 'router:matchedRoutes', appId, payload: { path } }),\n resultSchemas.matches,\n ),\n 'component-value': tool(\n 'Read a known field in a component state section without a snapshot or handle, including fields outside the current page. Get sectionId from component-state (for example props, data, setup); path uses property names or array indexes as strings. found:false means the target or path is missing; a present null/undefined value has a codec tag. Pass page:1 to paginate (strings default to 5000 UTF-16 units, collections to 50 entries).' +\n previewNote +\n pagingGuide,\n componentField.extend(valuePagination),\n ({ appId, ...payload }) =>\n connection.query({ type: 'components:stateValue', appId, payload }),\n resultSchemas.stateValue,\n ),\n 'inspector-value': tool(\n 'Read one field through an existing plugin Inspector, including Pinia. Use inspector/node/section IDs from list-inspectors, inspector-tree and inspector-state. path starts with the state entry key, followed by nested keys. found:false means no matching target or path. The plugin getInspectorState hook still runs, but only the requested value is encoded. Pass page:1 to paginate (strings default to 5000 UTF-16 units, collections to 50 entries).' +\n previewNote +\n pagingGuide,\n inspectorField.extend(valuePagination),\n ({ appId, ...payload }) =>\n connection.query({ type: 'inspectors:stateValue', appId, payload }),\n resultSchemas.stateValue,\n ),\n ...(connection.command\n ? {\n 'edit-component-state': tool(\n 'Change one existing editable component field through the Kit edit command. First read component-value and check editable. Accepts JSON values only; no delete or rename. Props can be overwritten by the parent. Returns the actual value read after the command; status:1 is command acknowledgement, not proof that the requested value persisted. If transport/readback fails, read state before retrying; do not blindly repeat a mutation.',\n componentField.extend({ value: z.json() }),\n ({ appId, value, ...payload }) =>\n editField(\n { type: 'components:editState', appId, payload: { ...payload, value } },\n () => connection.query({ type: 'components:stateValue', appId, payload }),\n ),\n resultSchemas.edited,\n 'action',\n ),\n 'edit-inspector-state': tool(\n 'Change one existing editable Inspector field through its plugin edit hook, including Pinia. First read inspector-value and check editable. Accepts a JSON value at the entry path; does not replace the entire store. Returns the actual value read after the command, which a plugin may transform or leave unchanged. If transport/readback fails, inspect state before retrying.',\n inspectorField.extend({ value: z.json() }),\n ({ appId, value, ...payload }) =>\n editField(\n { type: 'inspectors:editState', appId, payload: { ...payload, value } },\n () => connection.query({ type: 'inspectors:stateValue', appId, payload }),\n ),\n resultSchemas.edited,\n 'action',\n ),\n }\n : {}),\n 'expand-value': tool(\n 'Expand an encoded value handle from a previous state or inspector query in this app and document. Read only the necessary path. If a handle expired, rerun the original query for a new one.' +\n handleNote +\n pagingGuide,\n target.extend({\n handle: z.string().min(1),\n path: z.array(z.string()).max(20).optional(),\n ...pagination,\n pageSize: z.number().int().min(1).max(5000).optional(),\n }),\n async ({ appId, ...payload }) => {\n const result = await connection.query({ type: 'values:expand', appId, payload })\n if (result == null) {\n throw new Error(\n 'Value handle is expired or unknown. Rerun the original component-state or inspector-state query, then retry expand-value with the new handle. If the page reloaded, rediscover its tools first.',\n )\n }\n if ('found' in result && result.found === false) {\n throw new Error(\n 'Value path was not found. Read the current value and correct the path before expanding again.',\n )\n }\n return result\n },\n resultSchemas.expanded,\n ),\n }\n}\n\nfunction toSnapshot(page: VueDevtoolsAgentPage, result: unknown): VueDevtoolsAgentSnapshot {\n return {\n page: { id: page.id, url: page.url, title: page.title },\n capturedAt: Date.now(),\n result: toJson(result) ?? null,\n }\n}\n\n// The codec output is JSON-safe; this pass only normalizes the few non-codec results\n// (render code, router data, plugin settings) into plain JSON.\nfunction toJson(value: unknown): unknown {\n return JSON.parse(stringify(value) ?? 'null')\n}\n","import type { RuntimeCommandRequest, RuntimeCommandResult } from '@vue/devtools-kit'\nimport type { VueDevtoolsAgentConnection } from './types'\n\nexport interface VueDevtoolsAgentSession extends VueDevtoolsAgentConnection {\n command(request: RuntimeCommandRequest): Promise<RuntimeCommandResult>\n dispose(): void\n}\n\n/** Connect on the first call and retain the connection until the host disposes it. */\nexport function createVueDevtoolsAgentSession(\n connect: () => VueDevtoolsAgentConnection & { dispose(): void },\n): VueDevtoolsAgentSession {\n let connection: (VueDevtoolsAgentConnection & { dispose(): void }) | undefined\n let disposed = false\n\n function getConnection() {\n if (disposed) throw new Error('Vue DevTools agent session is disposed')\n return (connection ??= connect())\n }\n\n return {\n async query(request) {\n return getConnection().query(request)\n },\n async command(request) {\n const current = getConnection()\n if (!current.command) throw new Error('Vue DevTools agent session cannot send commands')\n return current.command(request)\n },\n dispose() {\n disposed = true\n const current = connection\n connection = undefined\n current?.dispose()\n },\n }\n}\n"],"mappings":";;;AAEA,MAAM,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,KAAK,CAAC;AAEhD,MAAM,eAA0B,EAAE,WAChC,EAAE,MAAM;CACN,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,QAAQ,WAAW,CAAC,EAAE,CAAC;CAChD,EAAE,OAAO;EAAE,MAAM,EAAE,QAAQ,SAAS;EAAG,OAAO,EAAE,QAAQ;CAAE,CAAC;CAC3D,EAAE,OAAO;EACP,MAAM,EAAE,QAAQ,QAAQ;EACxB,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,KAAK;GAAC;GAAO;GAAY;EAAW,CAAC,CAAC,CAAC;CACvE,CAAC;CACD,EAAE,OAAO;EACP,MAA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AI;CACJ,IAAI,WAAW;CAEf,SAAS,gBAAgB;EACvB,IAAI,UAAU,MAAM,IAAI,MAAM,wCAAwC;EACtE,OAAQ,eAAe,QAAQ;CACjC;CAEA,OAAO;EACL,MAAM,MAAM,SAAS;GACnB,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO;EACtC;EACA,MAAM,QAAQ,SAAS;GACrB,MAAM,UAAU,cAAc;GAC9B,IAAI,CAAC,QAAQ,SAAS,MAAM,IAAI,MAAM,iDAAiD;GACvF,OAAO,QAAQ,QAAQ,OAAO;EAChC;EACA,UAAU;GACR,WAAW;GACX,MAAM,UAAU;GAChB,aAAa,KAAA;GACb,SAAS,QAAQ;EACnB;CACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,60 @@
1
1
  {
2
2
  "name": "@vue/devtools-agent",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "9.0.0-rc.2",
4
+ "description": "Agent tools and host adapters for Vue DevTools",
5
+ "license": "MIT",
6
+ "author": "webfansplz",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/vuejs/devtools.git",
10
+ "directory": "packages/agent"
11
+ },
12
+ "bin": {
13
+ "vue-devtools-agent": "./dist/cli.mjs"
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "LICENSE",
18
+ "README.md"
19
+ ],
20
+ "type": "module",
21
+ "sideEffects": [
22
+ "./dist/cli.mjs"
23
+ ],
24
+ "main": "./dist/index.mjs",
25
+ "module": "./dist/index.mjs",
26
+ "types": "./dist/index.d.mts",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./dist/index.d.mts",
30
+ "default": "./dist/index.mjs"
31
+ },
32
+ "./package.json": "./package.json",
33
+ "./devframe": {
34
+ "types": "./dist/devframe.d.mts",
35
+ "default": "./dist/devframe.mjs"
36
+ },
37
+ "./node": {
38
+ "types": "./dist/node.d.mts",
39
+ "default": "./dist/node.mjs"
40
+ }
41
+ },
42
+ "dependencies": {
43
+ "@devframes/agentic": "^1.1.0",
44
+ "@vue/devtools-kit": "9.0.0-rc.2",
45
+ "cac": "^7.0.0",
46
+ "devframe": "^1.1.0",
47
+ "safe-stable-stringify": "^2.5.0",
48
+ "zod": "^4.6.5"
49
+ },
50
+ "devDependencies": {
51
+ "tsdown": "^0.23.0"
52
+ },
53
+ "engines": {
54
+ "node": ">=22.12.0"
55
+ },
56
+ "scripts": {
57
+ "build": "tsdown",
58
+ "dev": "tsdown --watch"
59
+ }
6
60
  }