tauri-agent-tools 0.5.0 → 0.6.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.
Files changed (76) hide show
  1. package/.agents/skills/tauri-agent-tools/SKILL.md +105 -12
  2. package/.agents/skills/tauri-bridge-setup/SKILL.md +42 -6
  3. package/AGENTS.md +9 -7
  4. package/README.md +53 -13
  5. package/dist/bridge/client.d.ts +5 -2
  6. package/dist/bridge/client.js +38 -3
  7. package/dist/bridge/client.js.map +1 -1
  8. package/dist/cli.js +22 -0
  9. package/dist/cli.js.map +1 -1
  10. package/dist/commands/capture.d.ts +3 -0
  11. package/dist/commands/capture.js +218 -0
  12. package/dist/commands/capture.js.map +1 -0
  13. package/dist/commands/check.d.ts +5 -0
  14. package/dist/commands/check.js +174 -0
  15. package/dist/commands/check.js.map +1 -0
  16. package/dist/commands/diff.js +6 -2
  17. package/dist/commands/diff.js.map +1 -1
  18. package/dist/commands/eval.js +16 -3
  19. package/dist/commands/eval.js.map +1 -1
  20. package/dist/commands/interact/click.d.ts +6 -0
  21. package/dist/commands/interact/click.js +102 -0
  22. package/dist/commands/interact/click.js.map +1 -0
  23. package/dist/commands/interact/focus.d.ts +3 -0
  24. package/dist/commands/interact/focus.js +40 -0
  25. package/dist/commands/interact/focus.js.map +1 -0
  26. package/dist/commands/interact/navigate.d.ts +3 -0
  27. package/dist/commands/interact/navigate.js +49 -0
  28. package/dist/commands/interact/navigate.js.map +1 -0
  29. package/dist/commands/interact/scroll.d.ts +11 -0
  30. package/dist/commands/interact/scroll.js +110 -0
  31. package/dist/commands/interact/scroll.js.map +1 -0
  32. package/dist/commands/interact/select.d.ts +3 -0
  33. package/dist/commands/interact/select.js +59 -0
  34. package/dist/commands/interact/select.js.map +1 -0
  35. package/dist/commands/interact/shared.d.ts +23 -0
  36. package/dist/commands/interact/shared.js +62 -0
  37. package/dist/commands/interact/shared.js.map +1 -0
  38. package/dist/commands/interact/type.d.ts +6 -0
  39. package/dist/commands/interact/type.js +59 -0
  40. package/dist/commands/interact/type.js.map +1 -0
  41. package/dist/commands/invoke.d.ts +3 -0
  42. package/dist/commands/invoke.js +53 -0
  43. package/dist/commands/invoke.js.map +1 -0
  44. package/dist/commands/probe.d.ts +2 -0
  45. package/dist/commands/probe.js +117 -0
  46. package/dist/commands/probe.js.map +1 -0
  47. package/dist/commands/shared.d.ts +10 -4
  48. package/dist/commands/shared.js +23 -3
  49. package/dist/commands/shared.js.map +1 -1
  50. package/dist/commands/storeInspect.d.ts +13 -0
  51. package/dist/commands/storeInspect.js +156 -0
  52. package/dist/commands/storeInspect.js.map +1 -0
  53. package/dist/platform/detect.js +65 -37
  54. package/dist/platform/detect.js.map +1 -1
  55. package/dist/platform/x11.js +3 -1
  56. package/dist/platform/x11.js.map +1 -1
  57. package/dist/schemas/bridge.d.ts +34 -0
  58. package/dist/schemas/bridge.js +13 -0
  59. package/dist/schemas/bridge.js.map +1 -1
  60. package/dist/schemas/commands.d.ts +126 -0
  61. package/dist/schemas/commands.js +28 -0
  62. package/dist/schemas/commands.js.map +1 -1
  63. package/dist/schemas/index.d.ts +3 -2
  64. package/dist/schemas/index.js +3 -2
  65. package/dist/schemas/index.js.map +1 -1
  66. package/dist/schemas/interact.d.ts +118 -0
  67. package/dist/schemas/interact.js +31 -0
  68. package/dist/schemas/interact.js.map +1 -0
  69. package/dist/util/image.js +5 -2
  70. package/dist/util/image.js.map +1 -1
  71. package/dist/util/magick.d.ts +21 -0
  72. package/dist/util/magick.js +46 -0
  73. package/dist/util/magick.js.map +1 -0
  74. package/examples/tauri-bridge/src/dev_bridge.rs +88 -2
  75. package/package.json +1 -1
  76. package/rust-bridge/README.md +7 -5
@@ -235,6 +235,44 @@ export declare const StorageTypeSchema: z.ZodEnum<["local", "session", "cookies"
235
235
  export type StorageType = z.infer<typeof StorageTypeSchema>;
236
236
  export declare const DomModeSchema: z.ZodEnum<["dom", "accessibility"]>;
237
237
  export type DomMode = z.infer<typeof DomModeSchema>;
238
+ export declare const CaptureManifestSchema: z.ZodObject<{
239
+ timestamp: z.ZodString;
240
+ url: z.ZodOptional<z.ZodString>;
241
+ title: z.ZodOptional<z.ZodString>;
242
+ viewport: z.ZodOptional<z.ZodObject<{
243
+ width: z.ZodNumber;
244
+ height: z.ZodNumber;
245
+ }, "strip", z.ZodTypeAny, {
246
+ width: number;
247
+ height: number;
248
+ }, {
249
+ width: number;
250
+ height: number;
251
+ }>>;
252
+ errorCount: z.ZodOptional<z.ZodNumber>;
253
+ files: z.ZodRecord<z.ZodString, z.ZodString>;
254
+ }, "strip", z.ZodTypeAny, {
255
+ timestamp: string;
256
+ files: Record<string, string>;
257
+ url?: string | undefined;
258
+ title?: string | undefined;
259
+ viewport?: {
260
+ width: number;
261
+ height: number;
262
+ } | undefined;
263
+ errorCount?: number | undefined;
264
+ }, {
265
+ timestamp: string;
266
+ files: Record<string, string>;
267
+ url?: string | undefined;
268
+ title?: string | undefined;
269
+ viewport?: {
270
+ width: number;
271
+ height: number;
272
+ } | undefined;
273
+ errorCount?: number | undefined;
274
+ }>;
275
+ export type CaptureManifest = z.infer<typeof CaptureManifestSchema>;
238
276
  export declare const PackageJsonSchema: z.ZodObject<{
239
277
  version: z.ZodString;
240
278
  }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
@@ -243,3 +281,91 @@ export declare const PackageJsonSchema: z.ZodObject<{
243
281
  version: z.ZodString;
244
282
  }, z.ZodTypeAny, "passthrough">>;
245
283
  export type PackageJson = z.infer<typeof PackageJsonSchema>;
284
+ export declare const StoreInspectResultSchema: z.ZodObject<{
285
+ framework: z.ZodString;
286
+ stores: z.ZodRecord<z.ZodString, z.ZodUnknown>;
287
+ }, "strip", z.ZodTypeAny, {
288
+ framework: string;
289
+ stores: Record<string, unknown>;
290
+ }, {
291
+ framework: string;
292
+ stores: Record<string, unknown>;
293
+ }>;
294
+ export type StoreInspectResult = z.infer<typeof StoreInspectResultSchema>;
295
+ export declare const CheckItemSchema: z.ZodObject<{
296
+ type: z.ZodEnum<["selector", "text", "eval", "no-errors"]>;
297
+ passed: z.ZodBoolean;
298
+ selector: z.ZodOptional<z.ZodString>;
299
+ pattern: z.ZodOptional<z.ZodString>;
300
+ expression: z.ZodOptional<z.ZodString>;
301
+ errors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
302
+ error: z.ZodOptional<z.ZodString>;
303
+ }, "strip", z.ZodTypeAny, {
304
+ type: "selector" | "text" | "eval" | "no-errors";
305
+ passed: boolean;
306
+ error?: string | undefined;
307
+ selector?: string | undefined;
308
+ pattern?: string | undefined;
309
+ expression?: string | undefined;
310
+ errors?: string[] | undefined;
311
+ }, {
312
+ type: "selector" | "text" | "eval" | "no-errors";
313
+ passed: boolean;
314
+ error?: string | undefined;
315
+ selector?: string | undefined;
316
+ pattern?: string | undefined;
317
+ expression?: string | undefined;
318
+ errors?: string[] | undefined;
319
+ }>;
320
+ export type CheckItem = z.infer<typeof CheckItemSchema>;
321
+ export declare const CheckResultSchema: z.ZodObject<{
322
+ passed: z.ZodBoolean;
323
+ checks: z.ZodArray<z.ZodObject<{
324
+ type: z.ZodEnum<["selector", "text", "eval", "no-errors"]>;
325
+ passed: z.ZodBoolean;
326
+ selector: z.ZodOptional<z.ZodString>;
327
+ pattern: z.ZodOptional<z.ZodString>;
328
+ expression: z.ZodOptional<z.ZodString>;
329
+ errors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
330
+ error: z.ZodOptional<z.ZodString>;
331
+ }, "strip", z.ZodTypeAny, {
332
+ type: "selector" | "text" | "eval" | "no-errors";
333
+ passed: boolean;
334
+ error?: string | undefined;
335
+ selector?: string | undefined;
336
+ pattern?: string | undefined;
337
+ expression?: string | undefined;
338
+ errors?: string[] | undefined;
339
+ }, {
340
+ type: "selector" | "text" | "eval" | "no-errors";
341
+ passed: boolean;
342
+ error?: string | undefined;
343
+ selector?: string | undefined;
344
+ pattern?: string | undefined;
345
+ expression?: string | undefined;
346
+ errors?: string[] | undefined;
347
+ }>, "many">;
348
+ }, "strip", z.ZodTypeAny, {
349
+ passed: boolean;
350
+ checks: {
351
+ type: "selector" | "text" | "eval" | "no-errors";
352
+ passed: boolean;
353
+ error?: string | undefined;
354
+ selector?: string | undefined;
355
+ pattern?: string | undefined;
356
+ expression?: string | undefined;
357
+ errors?: string[] | undefined;
358
+ }[];
359
+ }, {
360
+ passed: boolean;
361
+ checks: {
362
+ type: "selector" | "text" | "eval" | "no-errors";
363
+ passed: boolean;
364
+ error?: string | undefined;
365
+ selector?: string | undefined;
366
+ pattern?: string | undefined;
367
+ expression?: string | undefined;
368
+ errors?: string[] | undefined;
369
+ }[];
370
+ }>;
371
+ export type CheckResult = z.infer<typeof CheckResultSchema>;
@@ -58,8 +58,36 @@ export const SnapshotStorageResultSchema = z.object({
58
58
  export const ImageFormatSchema = z.enum(['png', 'jpg']);
59
59
  export const StorageTypeSchema = z.enum(['local', 'session', 'cookies', 'all']);
60
60
  export const DomModeSchema = z.enum(['dom', 'accessibility']);
61
+ // === Capture manifest ===
62
+ export const CaptureManifestSchema = z.object({
63
+ timestamp: z.string(),
64
+ url: z.string().optional(),
65
+ title: z.string().optional(),
66
+ viewport: z.object({ width: z.number(), height: z.number() }).optional(),
67
+ errorCount: z.number().optional(),
68
+ files: z.record(z.string(), z.string()),
69
+ });
61
70
  // === CLI: package.json ===
62
71
  export const PackageJsonSchema = z.object({
63
72
  version: z.string(),
64
73
  }).passthrough();
74
+ // === Store Inspect ===
75
+ export const StoreInspectResultSchema = z.object({
76
+ framework: z.string(),
77
+ stores: z.record(z.string(), z.unknown()),
78
+ });
79
+ // === Check ===
80
+ export const CheckItemSchema = z.object({
81
+ type: z.enum(['selector', 'text', 'eval', 'no-errors']),
82
+ passed: z.boolean(),
83
+ selector: z.string().optional(),
84
+ pattern: z.string().optional(),
85
+ expression: z.string().optional(),
86
+ errors: z.array(z.string()).optional(),
87
+ error: z.string().optional(),
88
+ });
89
+ export const CheckResultSchema = z.object({
90
+ passed: z.boolean(),
91
+ checks: z.array(CheckItemSchema),
92
+ });
65
93
  //# sourceMappingURL=commands.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/schemas/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,kBAAkB;AAElB,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAGH,qBAAqB;AAErB,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;IAC7D,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;IAClD,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;IAC7D,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;CACtB,CAAC,CAAC;AAGH,0BAA0B;AAE1B,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAGpF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MA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;CAC7B,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,CAAC;CACjC,CAAC,CAAC"}
@@ -5,7 +5,8 @@
5
5
  * Barrel re-exports from all domain files. Consumers may import directly
6
6
  * from domain files (e.g., '../schemas/bridge.js') for explicitness.
7
7
  */
8
- export { TokenFileSchema, type TokenFile, ElementRectSchema, type ElementRect, BridgeConfigSchema, type BridgeConfig, ViewportSizeSchema, type ViewportSize, RustLogLevelSchema, type RustLogLevel, RustLogEntrySchema, type RustLogEntry, BridgeEvalResponseSchema, BridgeLogsResponseSchema, } from './bridge.js';
8
+ export { TokenFileSchema, type TokenFile, ElementRectSchema, type ElementRect, BridgeConfigSchema, type BridgeConfig, ViewportSizeSchema, type ViewportSize, RustLogLevelSchema, type RustLogLevel, RustLogEntrySchema, type RustLogEntry, BridgeEvalResponseSchema, BridgeLogsResponseSchema, DescribeResponseSchema, type DescribeResponse, VersionResponseSchema, type VersionResponse, } from './bridge.js';
9
9
  export { DomNodeSchema, type DomNode, A11yNodeSchema, type A11yNode, } from './dom.js';
10
- export { StorageEntrySchema, type StorageEntry, PageStateSchema, type PageState, ConsoleLevelSchema, type ConsoleLevel, ConsoleEntrySchema, type ConsoleEntry, MutationTypeSchema, type MutationType, MutationEntrySchema, type MutationEntry, IpcEntrySchema, type IpcEntry, SnapshotStorageResultSchema, type SnapshotStorageResult, ImageFormatSchema, type ImageFormat, StorageTypeSchema, type StorageType, DomModeSchema, type DomMode, PackageJsonSchema, type PackageJson, } from './commands.js';
10
+ export { StorageEntrySchema, type StorageEntry, PageStateSchema, type PageState, ConsoleLevelSchema, type ConsoleLevel, ConsoleEntrySchema, type ConsoleEntry, MutationTypeSchema, type MutationType, MutationEntrySchema, type MutationEntry, IpcEntrySchema, type IpcEntry, SnapshotStorageResultSchema, type SnapshotStorageResult, ImageFormatSchema, type ImageFormat, StorageTypeSchema, type StorageType, DomModeSchema, type DomMode, PackageJsonSchema, type PackageJson, CheckItemSchema, type CheckItem, CheckResultSchema, type CheckResult, StoreInspectResultSchema, type StoreInspectResult, CaptureManifestSchema, type CaptureManifest, } from './commands.js';
11
11
  export { WindowIdSchema, CGWindowInfoSchema, type CGWindowInfo, SwayNodeSchema, type SwayNode, } from './platform.js';
12
+ export { InteractionResultSchema, type InteractionResult, ClickResultSchema, type ClickResult, TypeResultSchema, type TypeResult, ScrollResultSchema, type ScrollResult, SelectResultSchema, type SelectResult, InvokeResultSchema, type InvokeResult, } from './interact.js';
@@ -5,8 +5,9 @@
5
5
  * Barrel re-exports from all domain files. Consumers may import directly
6
6
  * from domain files (e.g., '../schemas/bridge.js') for explicitness.
7
7
  */
8
- export { TokenFileSchema, ElementRectSchema, BridgeConfigSchema, ViewportSizeSchema, RustLogLevelSchema, RustLogEntrySchema, BridgeEvalResponseSchema, BridgeLogsResponseSchema, } from './bridge.js';
8
+ export { TokenFileSchema, ElementRectSchema, BridgeConfigSchema, ViewportSizeSchema, RustLogLevelSchema, RustLogEntrySchema, BridgeEvalResponseSchema, BridgeLogsResponseSchema, DescribeResponseSchema, VersionResponseSchema, } from './bridge.js';
9
9
  export { DomNodeSchema, A11yNodeSchema, } from './dom.js';
10
- export { StorageEntrySchema, PageStateSchema, ConsoleLevelSchema, ConsoleEntrySchema, MutationTypeSchema, MutationEntrySchema, IpcEntrySchema, SnapshotStorageResultSchema, ImageFormatSchema, StorageTypeSchema, DomModeSchema, PackageJsonSchema, } from './commands.js';
10
+ export { StorageEntrySchema, PageStateSchema, ConsoleLevelSchema, ConsoleEntrySchema, MutationTypeSchema, MutationEntrySchema, IpcEntrySchema, SnapshotStorageResultSchema, ImageFormatSchema, StorageTypeSchema, DomModeSchema, PackageJsonSchema, CheckItemSchema, CheckResultSchema, StoreInspectResultSchema, CaptureManifestSchema, } from './commands.js';
11
11
  export { WindowIdSchema, CGWindowInfoSchema, SwayNodeSchema, } from './platform.js';
12
+ export { InteractionResultSchema, ClickResultSchema, TypeResultSchema, ScrollResultSchema, SelectResultSchema, InvokeResultSchema, } from './interact.js';
12
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,eAAe,EAEf,iBAAiB,EAEjB,kBAAkB,EAElB,kBAAkB,EAElB,kBAAkB,EAElB,kBAAkB,EAElB,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,aAAa,EAEb,cAAc,GAEf,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,kBAAkB,EAElB,eAAe,EAEf,kBAAkB,EAElB,kBAAkB,EAElB,kBAAkB,EAElB,mBAAmB,EAEnB,cAAc,EAEd,2BAA2B,EAE3B,iBAAiB,EAEjB,iBAAiB,EAEjB,aAAa,EAEb,iBAAiB,GAElB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,cAAc,EACd,kBAAkB,EAElB,cAAc,GAEf,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,eAAe,EAEf,iBAAiB,EAEjB,kBAAkB,EAElB,kBAAkB,EAElB,kBAAkB,EAElB,kBAAkB,EAElB,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EAEtB,qBAAqB,GAEtB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,aAAa,EAEb,cAAc,GAEf,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,kBAAkB,EAElB,eAAe,EAEf,kBAAkB,EAElB,kBAAkB,EAElB,kBAAkB,EAElB,mBAAmB,EAEnB,cAAc,EAEd,2BAA2B,EAE3B,iBAAiB,EAEjB,iBAAiB,EAEjB,aAAa,EAEb,iBAAiB,EAEjB,eAAe,EAEf,iBAAiB,EAEjB,wBAAwB,EAExB,qBAAqB,GAEtB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,cAAc,EACd,kBAAkB,EAElB,cAAc,GAEf,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,uBAAuB,EAEvB,iBAAiB,EAEjB,gBAAgB,EAEhB,kBAAkB,EAElB,kBAAkB,EAElB,kBAAkB,GAEnB,MAAM,eAAe,CAAC"}
@@ -0,0 +1,118 @@
1
+ import { z } from 'zod';
2
+ export declare const InteractionResultSchema: z.ZodObject<{
3
+ success: z.ZodBoolean;
4
+ selector: z.ZodOptional<z.ZodString>;
5
+ tagName: z.ZodOptional<z.ZodString>;
6
+ error: z.ZodOptional<z.ZodString>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ success: boolean;
9
+ error?: string | undefined;
10
+ selector?: string | undefined;
11
+ tagName?: string | undefined;
12
+ }, {
13
+ success: boolean;
14
+ error?: string | undefined;
15
+ selector?: string | undefined;
16
+ tagName?: string | undefined;
17
+ }>;
18
+ export type InteractionResult = z.infer<typeof InteractionResultSchema>;
19
+ export declare const ClickResultSchema: z.ZodObject<{
20
+ success: z.ZodBoolean;
21
+ selector: z.ZodOptional<z.ZodString>;
22
+ tagName: z.ZodOptional<z.ZodString>;
23
+ error: z.ZodOptional<z.ZodString>;
24
+ } & {
25
+ text: z.ZodOptional<z.ZodString>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ success: boolean;
28
+ error?: string | undefined;
29
+ selector?: string | undefined;
30
+ text?: string | undefined;
31
+ tagName?: string | undefined;
32
+ }, {
33
+ success: boolean;
34
+ error?: string | undefined;
35
+ selector?: string | undefined;
36
+ text?: string | undefined;
37
+ tagName?: string | undefined;
38
+ }>;
39
+ export type ClickResult = z.infer<typeof ClickResultSchema>;
40
+ export declare const TypeResultSchema: z.ZodObject<{
41
+ success: z.ZodBoolean;
42
+ selector: z.ZodOptional<z.ZodString>;
43
+ tagName: z.ZodOptional<z.ZodString>;
44
+ error: z.ZodOptional<z.ZodString>;
45
+ } & {
46
+ value: z.ZodOptional<z.ZodString>;
47
+ }, "strip", z.ZodTypeAny, {
48
+ success: boolean;
49
+ value?: string | undefined;
50
+ error?: string | undefined;
51
+ selector?: string | undefined;
52
+ tagName?: string | undefined;
53
+ }, {
54
+ success: boolean;
55
+ value?: string | undefined;
56
+ error?: string | undefined;
57
+ selector?: string | undefined;
58
+ tagName?: string | undefined;
59
+ }>;
60
+ export type TypeResult = z.infer<typeof TypeResultSchema>;
61
+ export declare const ScrollResultSchema: z.ZodObject<{
62
+ success: z.ZodBoolean;
63
+ scrollX: z.ZodOptional<z.ZodNumber>;
64
+ scrollY: z.ZodOptional<z.ZodNumber>;
65
+ error: z.ZodOptional<z.ZodString>;
66
+ }, "strip", z.ZodTypeAny, {
67
+ success: boolean;
68
+ error?: string | undefined;
69
+ scrollX?: number | undefined;
70
+ scrollY?: number | undefined;
71
+ }, {
72
+ success: boolean;
73
+ error?: string | undefined;
74
+ scrollX?: number | undefined;
75
+ scrollY?: number | undefined;
76
+ }>;
77
+ export type ScrollResult = z.infer<typeof ScrollResultSchema>;
78
+ export declare const SelectResultSchema: z.ZodObject<{
79
+ success: z.ZodBoolean;
80
+ selector: z.ZodOptional<z.ZodString>;
81
+ tagName: z.ZodOptional<z.ZodString>;
82
+ error: z.ZodOptional<z.ZodString>;
83
+ } & {
84
+ value: z.ZodOptional<z.ZodString>;
85
+ checked: z.ZodOptional<z.ZodBoolean>;
86
+ }, "strip", z.ZodTypeAny, {
87
+ success: boolean;
88
+ value?: string | undefined;
89
+ error?: string | undefined;
90
+ selector?: string | undefined;
91
+ tagName?: string | undefined;
92
+ checked?: boolean | undefined;
93
+ }, {
94
+ success: boolean;
95
+ value?: string | undefined;
96
+ error?: string | undefined;
97
+ selector?: string | undefined;
98
+ tagName?: string | undefined;
99
+ checked?: boolean | undefined;
100
+ }>;
101
+ export type SelectResult = z.infer<typeof SelectResultSchema>;
102
+ export declare const InvokeResultSchema: z.ZodObject<{
103
+ success: z.ZodBoolean;
104
+ command: z.ZodString;
105
+ result: z.ZodOptional<z.ZodUnknown>;
106
+ error: z.ZodOptional<z.ZodString>;
107
+ }, "strip", z.ZodTypeAny, {
108
+ command: string;
109
+ success: boolean;
110
+ error?: string | undefined;
111
+ result?: unknown;
112
+ }, {
113
+ command: string;
114
+ success: boolean;
115
+ error?: string | undefined;
116
+ result?: unknown;
117
+ }>;
118
+ export type InvokeResult = z.infer<typeof InvokeResultSchema>;
@@ -0,0 +1,31 @@
1
+ import { z } from 'zod';
2
+ // === Interaction Results ===
3
+ export const InteractionResultSchema = z.object({
4
+ success: z.boolean(),
5
+ selector: z.string().optional(),
6
+ tagName: z.string().optional(),
7
+ error: z.string().optional(),
8
+ });
9
+ export const ClickResultSchema = InteractionResultSchema.extend({
10
+ text: z.string().optional(),
11
+ });
12
+ export const TypeResultSchema = InteractionResultSchema.extend({
13
+ value: z.string().optional(),
14
+ });
15
+ export const ScrollResultSchema = z.object({
16
+ success: z.boolean(),
17
+ scrollX: z.number().optional(),
18
+ scrollY: z.number().optional(),
19
+ error: z.string().optional(),
20
+ });
21
+ export const SelectResultSchema = InteractionResultSchema.extend({
22
+ value: z.string().optional(),
23
+ checked: z.boolean().optional(),
24
+ });
25
+ export const InvokeResultSchema = z.object({
26
+ success: z.boolean(),
27
+ command: z.string(),
28
+ result: z.unknown().optional(),
29
+ error: z.string().optional(),
30
+ });
31
+ //# sourceMappingURL=interact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interact.js","sourceRoot":"","sources":["../../src/schemas/interact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8BAA8B;AAE9B,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,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,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC"}
@@ -1,13 +1,16 @@
1
1
  import { exec } from './exec.js';
2
+ import { magickCommand } from './magick.js';
2
3
  export async function cropImage(buffer, rect, format) {
3
4
  const fmt = format === 'jpg' ? 'jpg' : 'png';
4
5
  const crop = `${Math.round(rect.width)}x${Math.round(rect.height)}+${Math.round(rect.x)}+${Math.round(rect.y)}`;
5
- const { stdout } = await exec('convert', [`${fmt}:-`, '-crop', crop, '+repage', `${fmt}:-`], { stdin: buffer });
6
+ const cmd = await magickCommand('convert');
7
+ const { stdout } = await exec(cmd.bin, [...cmd.args, `${fmt}:-`, '-crop', crop, '+repage', `${fmt}:-`], { stdin: buffer });
6
8
  return stdout;
7
9
  }
8
10
  export async function resizeImage(buffer, maxWidth, format) {
9
11
  const fmt = format === 'jpg' ? 'jpg' : 'png';
10
- const { stdout } = await exec('convert', [`${fmt}:-`, '-resize', `${maxWidth}x\\>`, `${fmt}:-`], { stdin: buffer });
12
+ const cmd = await magickCommand('convert');
13
+ const { stdout } = await exec(cmd.bin, [...cmd.args, `${fmt}:-`, '-resize', `${maxWidth}x>`, `${fmt}:-`], { stdin: buffer });
11
14
  return stdout;
12
15
  }
13
16
  export function computeCropRect(elementRect, viewport, windowGeometry) {
@@ -1 +1 @@
1
- {"version":3,"file":"image.js","sourceRoot":"","sources":["../../src/util/image.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,MAAc,EACd,IAAiB,EACjB,MAAmB;IAEnB,MAAM,GAAG,GAAG,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IAC7C,MAAM,IAAI,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI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AG,GAAG,IAAI,EAAE,SAAS,EAAE,GAAG,QAAQ,IAAI,EAAE,GAAG,GAAG,IAAI,CAAC,EACjE,EAAE,KAAK,EAAE,MAAM,EAAE,CAClB,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,WAAwB,EACxB,QAA2C,EAC3C,cAAiD;IAEjD,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;IACrD,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;IACvD,OAAO;QACL,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC;QACzB,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC;QACzB,KAAK,EAAE,WAAW,CAAC,KAAK;QACxB,MAAM,EAAE,WAAW,CAAC,MAAM;KAC3B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * ImageMagick command resolver.
3
+ *
4
+ * v6: standalone commands — `convert`, `import`, `identify`, `compare`
5
+ * v7: unified binary — `magick convert`, `magick import`, etc.
6
+ * (`magick` alone acts as `convert`)
7
+ */
8
+ export interface MagickCommand {
9
+ bin: string;
10
+ args: string[];
11
+ }
12
+ export declare function detectMagickVersion(): Promise<6 | 7>;
13
+ /**
14
+ * Resolve an ImageMagick subcommand to the correct bin + args prefix.
15
+ *
16
+ * v7: `magick` alone replaces `convert`; other subcommands use `magick <sub>`
17
+ * v6: standalone commands — `convert`, `import`, `identify`, `compare`
18
+ */
19
+ export declare function magickCommand(subcommand: 'convert' | 'import' | 'identify' | 'compare'): Promise<MagickCommand>;
20
+ /** Reset cached version (for testing). */
21
+ export declare function _resetMagickCache(): void;
@@ -0,0 +1,46 @@
1
+ import { execFile } from 'node:child_process';
2
+ let cachedVersion = null;
3
+ function commandExists(cmd) {
4
+ const which = process.platform === 'win32' ? 'where' : 'which';
5
+ return new Promise((resolve) => {
6
+ execFile(which, [cmd], (error) => resolve(!error));
7
+ });
8
+ }
9
+ export async function detectMagickVersion() {
10
+ if (cachedVersion !== null)
11
+ return cachedVersion;
12
+ if (await commandExists('magick')) {
13
+ cachedVersion = 7;
14
+ }
15
+ else if (await commandExists('convert')) {
16
+ cachedVersion = 6;
17
+ }
18
+ else {
19
+ throw new Error('ImageMagick not found. Install it:\n' +
20
+ ' Linux: sudo apt install imagemagick (or your distro equivalent)\n' +
21
+ ' macOS: brew install imagemagick');
22
+ }
23
+ return cachedVersion;
24
+ }
25
+ /**
26
+ * Resolve an ImageMagick subcommand to the correct bin + args prefix.
27
+ *
28
+ * v7: `magick` alone replaces `convert`; other subcommands use `magick <sub>`
29
+ * v6: standalone commands — `convert`, `import`, `identify`, `compare`
30
+ */
31
+ export async function magickCommand(subcommand) {
32
+ const version = await detectMagickVersion();
33
+ if (version === 7) {
34
+ // In v7, `magick` alone IS convert; other tools need the subcommand
35
+ if (subcommand === 'convert') {
36
+ return { bin: 'magick', args: [] };
37
+ }
38
+ return { bin: 'magick', args: [subcommand] };
39
+ }
40
+ return { bin: subcommand, args: [] };
41
+ }
42
+ /** Reset cached version (for testing). */
43
+ export function _resetMagickCache() {
44
+ cachedVersion = null;
45
+ }
46
+ //# sourceMappingURL=magick.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"magick.js","sourceRoot":"","sources":["../../src/util/magick.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAe9C,IAAI,aAAa,GAAiB,IAAI,CAAC;AAEvC,SAAS,aAAa,CAAC,GAAW;IAChC,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC;IAC/D,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,QAAQ,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,mBAAmB;IACvC,IAAI,aAAa,KAAK,IAAI;QAAE,OAAO,aAAa,CAAC;IAEjD,IAAI,MAAM,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC;QAClC,aAAa,GAAG,CAAC,CAAC;IACpB,CAAC;SAAM,IAAI,MAAM,aAAa,CAAC,SAAS,CAAC,EAAE,CAAC;QAC1C,aAAa,GAAG,CAAC,CAAC;IACpB,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CACb,sCAAsC;YACpC,uEAAuE;YACvE,oCAAoC,CACvC,CAAC;IACJ,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,UAAyD;IAEzD,MAAM,OAAO,GAAG,MAAM,mBAAmB,EAAE,CAAC;IAE5C,IAAI,OAAO,KAAK,CAAC,EAAE,CAAC;QAClB,oEAAoE;QACpE,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QACrC,CAAC;QACD,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC;IAC/C,CAAC;IAED,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;AACvC,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,iBAAiB;IAC/B,aAAa,GAAG,IAAI,CAAC;AACvB,CAAC"}
@@ -15,6 +15,8 @@ use tracing_subscriber::util::SubscriberInitExt;
15
15
  struct EvalRequest {
16
16
  js: String,
17
17
  token: String,
18
+ #[serde(default)]
19
+ window: Option<String>,
18
20
  }
19
21
 
20
22
  #[derive(Deserialize)]
@@ -41,6 +43,32 @@ struct LogResponse {
41
43
  entries: Vec<LogEntry>,
42
44
  }
43
45
 
46
+ #[derive(Deserialize)]
47
+ struct DescribeRequest {
48
+ token: String,
49
+ }
50
+
51
+ #[derive(Serialize, Default)]
52
+ struct DescribeResponse {
53
+ #[serde(skip_serializing_if = "Option::is_none")]
54
+ app: Option<String>,
55
+ #[serde(skip_serializing_if = "Option::is_none")]
56
+ pid: Option<u32>,
57
+ #[serde(skip_serializing_if = "Option::is_none")]
58
+ windows: Option<Vec<String>>,
59
+ capabilities: Vec<String>,
60
+ #[serde(skip_serializing_if = "Option::is_none")]
61
+ surfaces: Option<HashMap<String, String>>,
62
+ #[serde(skip_serializing_if = "Option::is_none")]
63
+ exports: Option<HashMap<String, String>>,
64
+ }
65
+
66
+ #[derive(Serialize)]
67
+ struct VersionResponse {
68
+ version: String,
69
+ endpoints: Vec<String>,
70
+ }
71
+
44
72
  #[derive(Serialize)]
45
73
  struct TokenFile {
46
74
  port: u16,
@@ -295,7 +323,24 @@ pub fn start_bridge(app: &AppHandle) -> Result<(u16, Arc<LogBuffer>), String> {
295
323
  let is_post = request.method().as_str() == "POST";
296
324
  let url = request.url().to_string();
297
325
 
298
- if !is_post || (url != "/eval" && url != "/logs") {
326
+ // Handle GET /version (no auth needed)
327
+ if url == "/version" && request.method().as_str() == "GET" {
328
+ let resp = VersionResponse {
329
+ version: "0.6.0".to_string(),
330
+ endpoints: vec![
331
+ "/eval".to_string(),
332
+ "/logs".to_string(),
333
+ "/describe".to_string(),
334
+ "/version".to_string(),
335
+ ],
336
+ };
337
+ let json = serde_json::to_string(&resp).unwrap();
338
+ let header = Header::from_bytes("Content-Type", "application/json").unwrap();
339
+ let _ = request.respond(Response::from_string(json).with_header(header));
340
+ continue;
341
+ }
342
+
343
+ if !is_post || (url != "/eval" && url != "/logs" && url != "/describe") {
299
344
  let _ = request.respond(Response::from_string("Not found").with_status_code(404));
300
345
  continue;
301
346
  }
@@ -333,6 +378,46 @@ pub fn start_bridge(app: &AppHandle) -> Result<(u16, Arc<LogBuffer>), String> {
333
378
  continue;
334
379
  }
335
380
 
381
+ // Handle /describe endpoint
382
+ if url == "/describe" {
383
+ let desc_req: DescribeRequest = match serde_json::from_str(&body) {
384
+ Ok(r) => r,
385
+ Err(_) => {
386
+ let _ = request
387
+ .respond(Response::from_string("Invalid JSON").with_status_code(400));
388
+ continue;
389
+ }
390
+ };
391
+
392
+ if desc_req.token != expected_token {
393
+ let _ = request
394
+ .respond(Response::from_string("Unauthorized").with_status_code(401));
395
+ continue;
396
+ }
397
+
398
+ let windows: Vec<String> = app_handle
399
+ .webview_windows()
400
+ .keys()
401
+ .cloned()
402
+ .collect();
403
+
404
+ let resp = DescribeResponse {
405
+ pid: Some(std::process::id()),
406
+ windows: Some(windows),
407
+ capabilities: vec![
408
+ "eval".to_string(),
409
+ "logs".to_string(),
410
+ "describe".to_string(),
411
+ ],
412
+ ..Default::default()
413
+ };
414
+
415
+ let json = serde_json::to_string(&resp).unwrap();
416
+ let header = Header::from_bytes("Content-Type", "application/json").unwrap();
417
+ let _ = request.respond(Response::from_string(json).with_header(header));
418
+ continue;
419
+ }
420
+
336
421
  // Handle /eval endpoint
337
422
  let eval_req: EvalRequest = match serde_json::from_str(&body) {
338
423
  Ok(r) => r,
@@ -353,7 +438,8 @@ pub fn start_bridge(app: &AppHandle) -> Result<(u16, Arc<LogBuffer>), String> {
353
438
  // Evaluate JS in webview via callback pattern
354
439
  let request_id = uuid::Uuid::new_v4().to_string();
355
440
 
356
- if let Some(window) = app_handle.get_webview_window("main") {
441
+ let window_label = eval_req.window.as_deref().unwrap_or("main");
442
+ if let Some(window) = app_handle.get_webview_window(window_label) {
357
443
  // Build JS that evaluates the expression, then calls back into Rust
358
444
  // via __TAURI__.core.invoke() to deliver the result.
359
445
  let callback_js = format!(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tauri-agent-tools",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Agent-driven inspection toolkit for Tauri desktop apps",
5
5
  "type": "module",
6
6
  "bin": {
@@ -82,19 +82,21 @@ tauri-agent-tools eval "document.title"
82
82
  1. Bridge starts an HTTP server on a random localhost port
83
83
  2. A token file with `{ port, token, pid }` is written to `/tmp/`
84
84
  3. `tauri-agent-tools` discovers the token file and authenticates via the token
85
- 4. Requests are `POST /eval { js, token }` (JS evaluation) or `POST /logs { token }` (Rust log retrieval)
86
- 5. For `/eval`, the bridge injects JS into the webview
85
+ 4. The bridge exposes four endpoints: `POST /eval` (JS evaluation), `POST /logs` (Rust log retrieval), `POST /describe` (bridge metadata), and `GET /version` (unauthenticated health check)
86
+ 5. `/eval` accepts an optional `window` field to target specific webview windows (defaults to `"main"`)
87
87
  6. The injected JS evaluates the expression, then calls back into Rust via `window.__TAURI__.core.invoke("__dev_bridge_result", { id, value })` to deliver the result
88
88
  7. The HTTP handler thread waits for the result (up to 5 seconds) and returns it as JSON
89
- 8. For `/logs`, the bridge drains its ring buffer of captured `tracing` events and returns them as JSON
90
- 9. The token file is cleaned up when the app exits
89
+ 8. `/logs` drains the ring buffer of captured `tracing` events and returns them as JSON
90
+ 9. `/describe` returns PID, window labels, and capabilities
91
+ 10. The token file is cleaned up when the app exits
91
92
 
92
93
  ## Security
93
94
 
94
95
  - **Localhost only** — the bridge binds to `127.0.0.1`
95
96
  - **Token authenticated** — every request requires a random 32-char token
96
97
  - **Development only** — wrapped in `cfg!(debug_assertions)`, stripped in release builds
97
- - **Read-only** — `tauri-agent-tools` only reads DOM state, never injects input
98
+ - **Inspection is read-only** — inspection commands only read DOM state
99
+ - **Interaction is debug-only** — interaction commands use eval-based DOM dispatch, sandboxed to the webview
98
100
 
99
101
  ## Agent-Assisted Setup
100
102