tauri-agent-tools 0.2.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/tauri-agent-tools/SKILL.md +63 -6
- package/.agents/skills/tauri-bridge-setup/SKILL.md +24 -2
- package/AGENTS.md +8 -3
- package/README.md +58 -4
- package/dist/bridge/client.d.ts +5 -2
- package/dist/bridge/client.js +26 -4
- package/dist/bridge/client.js.map +1 -1
- package/dist/bridge/tokenDiscovery.d.ts +1 -1
- package/dist/bridge/tokenDiscovery.js +3 -6
- package/dist/bridge/tokenDiscovery.js.map +1 -1
- package/dist/cli.js +10 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/consoleMonitor.js +15 -10
- package/dist/commands/consoleMonitor.js.map +1 -1
- package/dist/commands/diff.d.ts +2 -0
- package/dist/commands/diff.js +91 -0
- package/dist/commands/diff.js.map +1 -0
- package/dist/commands/dom.d.ts +1 -0
- package/dist/commands/dom.js +81 -6
- package/dist/commands/dom.js.map +1 -1
- package/dist/commands/eval.js +6 -1
- package/dist/commands/eval.js.map +1 -1
- package/dist/commands/ipcMonitor.js +21 -9
- package/dist/commands/ipcMonitor.js.map +1 -1
- package/dist/commands/listWindows.js +5 -1
- package/dist/commands/listWindows.js.map +1 -1
- package/dist/commands/mutations.d.ts +5 -0
- package/dist/commands/mutations.js +146 -0
- package/dist/commands/mutations.js.map +1 -0
- package/dist/commands/pageState.js +2 -1
- package/dist/commands/pageState.js.map +1 -1
- package/dist/commands/rustLogs.d.ts +2 -0
- package/dist/commands/rustLogs.js +105 -0
- package/dist/commands/rustLogs.js.map +1 -0
- package/dist/commands/screenshot.js +12 -2
- package/dist/commands/screenshot.js.map +1 -1
- package/dist/commands/shared.d.ts +6 -0
- package/dist/commands/shared.js +11 -0
- package/dist/commands/shared.js.map +1 -1
- package/dist/commands/snapshot.d.ts +3 -0
- package/dist/commands/snapshot.js +138 -0
- package/dist/commands/snapshot.js.map +1 -0
- package/dist/commands/storage.js +26 -22
- package/dist/commands/storage.js.map +1 -1
- package/dist/commands/wait.js +27 -5
- package/dist/commands/wait.js.map +1 -1
- package/dist/platform/macos.d.ts +2 -1
- package/dist/platform/macos.js +3 -1
- package/dist/platform/macos.js.map +1 -1
- package/dist/platform/wayland.d.ts +2 -1
- package/dist/platform/wayland.js +4 -3
- package/dist/platform/wayland.js.map +1 -1
- package/dist/platform/x11.d.ts +2 -1
- package/dist/platform/x11.js +17 -18
- package/dist/platform/x11.js.map +1 -1
- package/dist/schemas/bridge.d.ts +120 -0
- package/dist/schemas/bridge.js +38 -0
- package/dist/schemas/bridge.js.map +1 -0
- package/dist/schemas/commands.d.ts +245 -0
- package/dist/schemas/commands.js +65 -0
- package/dist/schemas/commands.js.map +1 -0
- package/dist/schemas/dom.d.ts +22 -0
- package/dist/schemas/dom.js +22 -0
- package/dist/schemas/dom.js.map +1 -0
- package/dist/schemas/index.d.ts +11 -0
- package/dist/schemas/index.js +12 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/platform.d.ts +61 -0
- package/dist/schemas/platform.js +34 -0
- package/dist/schemas/platform.js.map +1 -0
- package/dist/types.d.ts +2 -11
- package/dist/util/exec.js +2 -4
- package/dist/util/exec.js.map +1 -1
- package/dist/util/image.d.ts +2 -1
- package/dist/util/image.js.map +1 -1
- package/examples/tauri-bridge/Cargo.toml +2 -0
- package/examples/tauri-bridge/src/dev_bridge.rs +232 -7
- package/package.json +6 -3
- package/rust-bridge/README.md +9 -5
package/dist/platform/wayland.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { exec } from '../util/exec.js';
|
|
2
|
+
import { SwayNodeSchema } from '../schemas/platform.js';
|
|
2
3
|
function findInTree(node, title) {
|
|
3
4
|
if (node.name && node.name.includes(title))
|
|
4
5
|
return node;
|
|
@@ -17,7 +18,7 @@ function findInTree(node, title) {
|
|
|
17
18
|
export class WaylandAdapter {
|
|
18
19
|
async findWindow(title) {
|
|
19
20
|
const { stdout } = await exec('swaymsg', ['-t', 'get_tree', '-r']);
|
|
20
|
-
const tree = JSON.parse(stdout.toString());
|
|
21
|
+
const tree = SwayNodeSchema.parse(JSON.parse(stdout.toString()));
|
|
21
22
|
const node = findInTree(tree, title);
|
|
22
23
|
if (!node) {
|
|
23
24
|
throw new Error(`No window found matching: ${title}`);
|
|
@@ -34,7 +35,7 @@ export class WaylandAdapter {
|
|
|
34
35
|
}
|
|
35
36
|
async getWindowGeometry(windowId) {
|
|
36
37
|
const { stdout } = await exec('swaymsg', ['-t', 'get_tree', '-r']);
|
|
37
|
-
const tree = JSON.parse(stdout.toString());
|
|
38
|
+
const tree = SwayNodeSchema.parse(JSON.parse(stdout.toString()));
|
|
38
39
|
const node = this._findById(tree, parseInt(windowId, 10));
|
|
39
40
|
if (!node) {
|
|
40
41
|
throw new Error(`Window ${windowId} not found in sway tree`);
|
|
@@ -54,7 +55,7 @@ export class WaylandAdapter {
|
|
|
54
55
|
}
|
|
55
56
|
async listWindows() {
|
|
56
57
|
const { stdout } = await exec('swaymsg', ['-t', 'get_tree', '-r']);
|
|
57
|
-
const tree = JSON.parse(stdout.toString());
|
|
58
|
+
const tree = SwayNodeSchema.parse(JSON.parse(stdout.toString()));
|
|
58
59
|
const leaves = [];
|
|
59
60
|
this._collectLeaves(tree, leaves);
|
|
60
61
|
return leaves
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wayland.js","sourceRoot":"","sources":["../../src/platform/wayland.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wayland.js","sourceRoot":"","sources":["../../src/platform/wayland.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAGxD,SAAS,UAAU,CAAC,IAAc,EAAE,KAAa;IAC/C,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,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QACD,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;YAC7B,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IAEO,SAAS,CAAC,IAAc,EAAE,EAAU;QAC1C,IAAI,IAAI,CAAC,EAAE,KAAK,EAAE;YAAE,OAAO,IAAI,CAAC;QAChC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;YACrC,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YACxC,IAAI,KAAK;gBAAE,OAAO,KAAK,CAAC;QAC1B,CAAC;QACD,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,cAAc,IAAI,EAAE,EAAE,CAAC;YAC9C,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YACxC,IAAI,KAAK;gBAAE,OAAO,KAAK,CAAC;QAC1B,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
package/dist/platform/x11.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PlatformAdapter, WindowInfo } from '../types.js';
|
|
2
|
+
import type { ImageFormat } from '../schemas/commands.js';
|
|
2
3
|
export declare class X11Adapter implements PlatformAdapter {
|
|
3
4
|
findWindow(title: string): Promise<string>;
|
|
4
5
|
captureWindow(windowId: string, format: ImageFormat): Promise<Buffer>;
|
package/dist/platform/x11.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { exec, validateWindowId } from '../util/exec.js';
|
|
2
|
+
function parseShellVar(output, key, fallback) {
|
|
3
|
+
const match = output.match(new RegExp(`${key}=(\\d+)`));
|
|
4
|
+
if (!match) {
|
|
5
|
+
if (fallback !== undefined)
|
|
6
|
+
return fallback;
|
|
7
|
+
throw new Error(`Failed to parse ${key} from xdotool output`);
|
|
8
|
+
}
|
|
9
|
+
return parseInt(match[1], 10);
|
|
10
|
+
}
|
|
2
11
|
export class X11Adapter {
|
|
3
12
|
async findWindow(title) {
|
|
4
13
|
const { stdout } = await exec('xdotool', ['search', '--name', title]);
|
|
@@ -18,18 +27,12 @@ export class X11Adapter {
|
|
|
18
27
|
validateWindowId(windowId);
|
|
19
28
|
const { stdout } = await exec('xdotool', ['getwindowgeometry', '--shell', windowId]);
|
|
20
29
|
const output = stdout.toString();
|
|
21
|
-
const parse = (key) => {
|
|
22
|
-
const match = output.match(new RegExp(`${key}=(\\d+)`));
|
|
23
|
-
if (!match)
|
|
24
|
-
throw new Error(`Failed to parse ${key} from xdotool output`);
|
|
25
|
-
return parseInt(match[1], 10);
|
|
26
|
-
};
|
|
27
30
|
return {
|
|
28
31
|
windowId,
|
|
29
|
-
x:
|
|
30
|
-
y:
|
|
31
|
-
width:
|
|
32
|
-
height:
|
|
32
|
+
x: parseShellVar(output, 'X'),
|
|
33
|
+
y: parseShellVar(output, 'Y'),
|
|
34
|
+
width: parseShellVar(output, 'WIDTH'),
|
|
35
|
+
height: parseShellVar(output, 'HEIGHT'),
|
|
33
36
|
};
|
|
34
37
|
}
|
|
35
38
|
async getWindowName(windowId) {
|
|
@@ -52,19 +55,15 @@ export class X11Adapter {
|
|
|
52
55
|
if (!name)
|
|
53
56
|
continue;
|
|
54
57
|
const geomOutput = geomResult.stdout.toString();
|
|
55
|
-
const parse = (key) => {
|
|
56
|
-
const match = geomOutput.match(new RegExp(`${key}=(\\d+)`));
|
|
57
|
-
return match ? parseInt(match[1], 10) : 0;
|
|
58
|
-
};
|
|
59
58
|
const pid = parseInt(pidResult.stdout.toString().trim(), 10);
|
|
60
59
|
windows.push({
|
|
61
60
|
windowId: id,
|
|
62
61
|
pid: isNaN(pid) ? undefined : pid,
|
|
63
62
|
name,
|
|
64
|
-
x:
|
|
65
|
-
y:
|
|
66
|
-
width:
|
|
67
|
-
height:
|
|
63
|
+
x: parseShellVar(geomOutput, 'X', 0),
|
|
64
|
+
y: parseShellVar(geomOutput, 'Y', 0),
|
|
65
|
+
width: parseShellVar(geomOutput, 'WIDTH', 0),
|
|
66
|
+
height: parseShellVar(geomOutput, 'HEIGHT', 0),
|
|
68
67
|
});
|
|
69
68
|
}
|
|
70
69
|
catch {
|
package/dist/platform/x11.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"x11.js","sourceRoot":"","sources":["../../src/platform/x11.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"x11.js","sourceRoot":"","sources":["../../src/platform/x11.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,SAAS,aAAa,CAAC,MAAc,EAAE,GAAW,EAAE,QAAiB;IACnE,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC;IACxD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,IAAI,QAAQ,KAAK,SAAS;YAAE,OAAO,QAAQ,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,mBAAmB,GAAG,sBAAsB,CAAC,CAAC;IAChE,CAAC;IACD,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAE,EAAE,EAAE,CAAC,CAAC;AACjC,CAAC;AAED,MAAM,OAAO,UAAU;IACrB,KAAK,CAAC,UAAU,CAAC,KAAa;QAC5B,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;QACtE,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACjE,IAAI,GAAG,CAAC,MAAM,KAAK,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oBACjC,IAAI;oBACJ,CAAC,EAAE,aAAa,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;oBACpC,CAAC,EAAE,aAAa,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,CAAC;oBACpC,KAAK,EAAE,aAAa,CAAC,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;oBAC5C,MAAM,EAAE,aAAa,CAAC,UAAU,EAAE,QAAQ,EAAE,CAAC,CAAC;iBAC/C,CAAC,CAAC;YACL,CAAC;YAAC,MAAM,CAAC;gBACP,oDAAoD;gBACpD,SAAS;YACX,CAAC;QACH,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const TokenFileSchema: z.ZodObject<{
|
|
3
|
+
port: z.ZodNumber;
|
|
4
|
+
token: z.ZodString;
|
|
5
|
+
pid: z.ZodNumber;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
port: number;
|
|
8
|
+
token: string;
|
|
9
|
+
pid: number;
|
|
10
|
+
}, {
|
|
11
|
+
port: number;
|
|
12
|
+
token: string;
|
|
13
|
+
pid: number;
|
|
14
|
+
}>;
|
|
15
|
+
export type TokenFile = z.infer<typeof TokenFileSchema>;
|
|
16
|
+
export declare const ElementRectSchema: z.ZodObject<{
|
|
17
|
+
x: z.ZodNumber;
|
|
18
|
+
y: z.ZodNumber;
|
|
19
|
+
width: z.ZodNumber;
|
|
20
|
+
height: z.ZodNumber;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
}, {
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
}>;
|
|
32
|
+
export type ElementRect = z.infer<typeof ElementRectSchema>;
|
|
33
|
+
export declare const BridgeConfigSchema: z.ZodObject<{
|
|
34
|
+
port: z.ZodNumber;
|
|
35
|
+
token: z.ZodString;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
port: number;
|
|
38
|
+
token: string;
|
|
39
|
+
}, {
|
|
40
|
+
port: number;
|
|
41
|
+
token: string;
|
|
42
|
+
}>;
|
|
43
|
+
export type BridgeConfig = z.infer<typeof BridgeConfigSchema>;
|
|
44
|
+
export declare const ViewportSizeSchema: z.ZodObject<{
|
|
45
|
+
width: z.ZodNumber;
|
|
46
|
+
height: z.ZodNumber;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
width: number;
|
|
49
|
+
height: number;
|
|
50
|
+
}, {
|
|
51
|
+
width: number;
|
|
52
|
+
height: number;
|
|
53
|
+
}>;
|
|
54
|
+
export type ViewportSize = z.infer<typeof ViewportSizeSchema>;
|
|
55
|
+
export declare const RustLogLevelSchema: z.ZodEnum<["trace", "debug", "info", "warn", "error"]>;
|
|
56
|
+
export type RustLogLevel = z.infer<typeof RustLogLevelSchema>;
|
|
57
|
+
export declare const RustLogEntrySchema: z.ZodObject<{
|
|
58
|
+
timestamp: z.ZodNumber;
|
|
59
|
+
level: z.ZodEnum<["trace", "debug", "info", "warn", "error"]>;
|
|
60
|
+
target: z.ZodString;
|
|
61
|
+
message: z.ZodString;
|
|
62
|
+
source: z.ZodString;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
message: string;
|
|
65
|
+
level: "warn" | "error" | "info" | "debug" | "trace";
|
|
66
|
+
timestamp: number;
|
|
67
|
+
target: string;
|
|
68
|
+
source: string;
|
|
69
|
+
}, {
|
|
70
|
+
message: string;
|
|
71
|
+
level: "warn" | "error" | "info" | "debug" | "trace";
|
|
72
|
+
timestamp: number;
|
|
73
|
+
target: string;
|
|
74
|
+
source: string;
|
|
75
|
+
}>;
|
|
76
|
+
export type RustLogEntry = z.infer<typeof RustLogEntrySchema>;
|
|
77
|
+
export declare const BridgeEvalResponseSchema: z.ZodObject<{
|
|
78
|
+
result: z.ZodUnknown;
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
result?: unknown;
|
|
81
|
+
}, {
|
|
82
|
+
result?: unknown;
|
|
83
|
+
}>;
|
|
84
|
+
export declare const BridgeLogsResponseSchema: z.ZodObject<{
|
|
85
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
86
|
+
timestamp: z.ZodNumber;
|
|
87
|
+
level: z.ZodEnum<["trace", "debug", "info", "warn", "error"]>;
|
|
88
|
+
target: z.ZodString;
|
|
89
|
+
message: z.ZodString;
|
|
90
|
+
source: z.ZodString;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
message: string;
|
|
93
|
+
level: "warn" | "error" | "info" | "debug" | "trace";
|
|
94
|
+
timestamp: number;
|
|
95
|
+
target: string;
|
|
96
|
+
source: string;
|
|
97
|
+
}, {
|
|
98
|
+
message: string;
|
|
99
|
+
level: "warn" | "error" | "info" | "debug" | "trace";
|
|
100
|
+
timestamp: number;
|
|
101
|
+
target: string;
|
|
102
|
+
source: string;
|
|
103
|
+
}>, "many">;
|
|
104
|
+
}, "strip", z.ZodTypeAny, {
|
|
105
|
+
entries: {
|
|
106
|
+
message: string;
|
|
107
|
+
level: "warn" | "error" | "info" | "debug" | "trace";
|
|
108
|
+
timestamp: number;
|
|
109
|
+
target: string;
|
|
110
|
+
source: string;
|
|
111
|
+
}[];
|
|
112
|
+
}, {
|
|
113
|
+
entries: {
|
|
114
|
+
message: string;
|
|
115
|
+
level: "warn" | "error" | "info" | "debug" | "trace";
|
|
116
|
+
timestamp: number;
|
|
117
|
+
target: string;
|
|
118
|
+
source: string;
|
|
119
|
+
}[];
|
|
120
|
+
}>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// === Token Discovery ===
|
|
3
|
+
export const TokenFileSchema = z.object({
|
|
4
|
+
port: z.number().int().min(1).max(65535),
|
|
5
|
+
token: z.string().min(1),
|
|
6
|
+
pid: z.number().int().positive(),
|
|
7
|
+
});
|
|
8
|
+
// === Bridge Types ===
|
|
9
|
+
export const ElementRectSchema = z.object({
|
|
10
|
+
x: z.number(),
|
|
11
|
+
y: z.number(),
|
|
12
|
+
width: z.number(),
|
|
13
|
+
height: z.number(),
|
|
14
|
+
});
|
|
15
|
+
export const BridgeConfigSchema = z.object({
|
|
16
|
+
port: z.number().int().min(1).max(65535),
|
|
17
|
+
token: z.string().min(1),
|
|
18
|
+
});
|
|
19
|
+
export const ViewportSizeSchema = z.object({
|
|
20
|
+
width: z.number(),
|
|
21
|
+
height: z.number(),
|
|
22
|
+
});
|
|
23
|
+
export const RustLogLevelSchema = z.enum(['trace', 'debug', 'info', 'warn', 'error']);
|
|
24
|
+
export const RustLogEntrySchema = z.object({
|
|
25
|
+
timestamp: z.number(),
|
|
26
|
+
level: RustLogLevelSchema,
|
|
27
|
+
target: z.string(),
|
|
28
|
+
message: z.string(),
|
|
29
|
+
source: z.string(),
|
|
30
|
+
});
|
|
31
|
+
// === Bridge HTTP Responses ===
|
|
32
|
+
export const BridgeEvalResponseSchema = z.object({
|
|
33
|
+
result: z.unknown(),
|
|
34
|
+
});
|
|
35
|
+
export const BridgeLogsResponseSchema = z.object({
|
|
36
|
+
entries: z.array(RustLogEntrySchema),
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../../src/schemas/bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,0BAA0B;AAE1B,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,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;IACnB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAC;AAGH,gCAAgC;AAEhC,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;CACpB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC;CACrC,CAAC,CAAC"}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const StorageEntrySchema: z.ZodObject<{
|
|
3
|
+
key: z.ZodString;
|
|
4
|
+
value: z.ZodNullable<z.ZodString>;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
key: string;
|
|
7
|
+
value: string | null;
|
|
8
|
+
}, {
|
|
9
|
+
key: string;
|
|
10
|
+
value: string | null;
|
|
11
|
+
}>;
|
|
12
|
+
export type StorageEntry = z.infer<typeof StorageEntrySchema>;
|
|
13
|
+
export declare const PageStateSchema: z.ZodObject<{
|
|
14
|
+
url: z.ZodString;
|
|
15
|
+
title: z.ZodString;
|
|
16
|
+
viewport: z.ZodObject<{
|
|
17
|
+
width: z.ZodNumber;
|
|
18
|
+
height: z.ZodNumber;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
}, {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
}>;
|
|
26
|
+
scroll: z.ZodObject<{
|
|
27
|
+
x: z.ZodNumber;
|
|
28
|
+
y: z.ZodNumber;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
}, {
|
|
33
|
+
x: number;
|
|
34
|
+
y: number;
|
|
35
|
+
}>;
|
|
36
|
+
document: z.ZodObject<{
|
|
37
|
+
width: z.ZodNumber;
|
|
38
|
+
height: z.ZodNumber;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
}, {
|
|
43
|
+
width: number;
|
|
44
|
+
height: number;
|
|
45
|
+
}>;
|
|
46
|
+
hasTauri: z.ZodBoolean;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
url: string;
|
|
49
|
+
title: string;
|
|
50
|
+
viewport: {
|
|
51
|
+
width: number;
|
|
52
|
+
height: number;
|
|
53
|
+
};
|
|
54
|
+
scroll: {
|
|
55
|
+
x: number;
|
|
56
|
+
y: number;
|
|
57
|
+
};
|
|
58
|
+
document: {
|
|
59
|
+
width: number;
|
|
60
|
+
height: number;
|
|
61
|
+
};
|
|
62
|
+
hasTauri: boolean;
|
|
63
|
+
}, {
|
|
64
|
+
url: string;
|
|
65
|
+
title: string;
|
|
66
|
+
viewport: {
|
|
67
|
+
width: number;
|
|
68
|
+
height: number;
|
|
69
|
+
};
|
|
70
|
+
scroll: {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
};
|
|
74
|
+
document: {
|
|
75
|
+
width: number;
|
|
76
|
+
height: number;
|
|
77
|
+
};
|
|
78
|
+
hasTauri: boolean;
|
|
79
|
+
}>;
|
|
80
|
+
export type PageState = z.infer<typeof PageStateSchema>;
|
|
81
|
+
export declare const ConsoleLevelSchema: z.ZodEnum<["log", "warn", "error", "info", "debug"]>;
|
|
82
|
+
export type ConsoleLevel = z.infer<typeof ConsoleLevelSchema>;
|
|
83
|
+
export declare const ConsoleEntrySchema: z.ZodObject<{
|
|
84
|
+
level: z.ZodEnum<["log", "warn", "error", "info", "debug"]>;
|
|
85
|
+
message: z.ZodString;
|
|
86
|
+
timestamp: z.ZodNumber;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
message: string;
|
|
89
|
+
level: "log" | "warn" | "error" | "info" | "debug";
|
|
90
|
+
timestamp: number;
|
|
91
|
+
}, {
|
|
92
|
+
message: string;
|
|
93
|
+
level: "log" | "warn" | "error" | "info" | "debug";
|
|
94
|
+
timestamp: number;
|
|
95
|
+
}>;
|
|
96
|
+
export type ConsoleEntry = z.infer<typeof ConsoleEntrySchema>;
|
|
97
|
+
export declare const MutationTypeSchema: z.ZodEnum<["childList", "attributes", "characterData"]>;
|
|
98
|
+
export type MutationType = z.infer<typeof MutationTypeSchema>;
|
|
99
|
+
export declare const MutationEntrySchema: z.ZodObject<{
|
|
100
|
+
type: z.ZodEnum<["childList", "attributes", "characterData"]>;
|
|
101
|
+
target: z.ZodString;
|
|
102
|
+
timestamp: z.ZodNumber;
|
|
103
|
+
added: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
104
|
+
tag: z.ZodString;
|
|
105
|
+
id: z.ZodOptional<z.ZodString>;
|
|
106
|
+
class: z.ZodOptional<z.ZodString>;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
tag: string;
|
|
109
|
+
id?: string | undefined;
|
|
110
|
+
class?: string | undefined;
|
|
111
|
+
}, {
|
|
112
|
+
tag: string;
|
|
113
|
+
id?: string | undefined;
|
|
114
|
+
class?: string | undefined;
|
|
115
|
+
}>, "many">>;
|
|
116
|
+
removed: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
117
|
+
tag: z.ZodString;
|
|
118
|
+
id: z.ZodOptional<z.ZodString>;
|
|
119
|
+
class: z.ZodOptional<z.ZodString>;
|
|
120
|
+
}, "strip", z.ZodTypeAny, {
|
|
121
|
+
tag: string;
|
|
122
|
+
id?: string | undefined;
|
|
123
|
+
class?: string | undefined;
|
|
124
|
+
}, {
|
|
125
|
+
tag: string;
|
|
126
|
+
id?: string | undefined;
|
|
127
|
+
class?: string | undefined;
|
|
128
|
+
}>, "many">>;
|
|
129
|
+
attribute: z.ZodOptional<z.ZodString>;
|
|
130
|
+
oldValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
131
|
+
newValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
132
|
+
}, "strip", z.ZodTypeAny, {
|
|
133
|
+
type: "childList" | "attributes" | "characterData";
|
|
134
|
+
timestamp: number;
|
|
135
|
+
target: string;
|
|
136
|
+
added?: {
|
|
137
|
+
tag: string;
|
|
138
|
+
id?: string | undefined;
|
|
139
|
+
class?: string | undefined;
|
|
140
|
+
}[] | undefined;
|
|
141
|
+
removed?: {
|
|
142
|
+
tag: string;
|
|
143
|
+
id?: string | undefined;
|
|
144
|
+
class?: string | undefined;
|
|
145
|
+
}[] | undefined;
|
|
146
|
+
attribute?: string | undefined;
|
|
147
|
+
oldValue?: string | null | undefined;
|
|
148
|
+
newValue?: string | null | undefined;
|
|
149
|
+
}, {
|
|
150
|
+
type: "childList" | "attributes" | "characterData";
|
|
151
|
+
timestamp: number;
|
|
152
|
+
target: string;
|
|
153
|
+
added?: {
|
|
154
|
+
tag: string;
|
|
155
|
+
id?: string | undefined;
|
|
156
|
+
class?: string | undefined;
|
|
157
|
+
}[] | undefined;
|
|
158
|
+
removed?: {
|
|
159
|
+
tag: string;
|
|
160
|
+
id?: string | undefined;
|
|
161
|
+
class?: string | undefined;
|
|
162
|
+
}[] | undefined;
|
|
163
|
+
attribute?: string | undefined;
|
|
164
|
+
oldValue?: string | null | undefined;
|
|
165
|
+
newValue?: string | null | undefined;
|
|
166
|
+
}>;
|
|
167
|
+
export type MutationEntry = z.infer<typeof MutationEntrySchema>;
|
|
168
|
+
export declare const IpcEntrySchema: z.ZodObject<{
|
|
169
|
+
command: z.ZodString;
|
|
170
|
+
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
171
|
+
timestamp: z.ZodNumber;
|
|
172
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
result: z.ZodOptional<z.ZodUnknown>;
|
|
174
|
+
error: z.ZodOptional<z.ZodString>;
|
|
175
|
+
}, "strip", z.ZodTypeAny, {
|
|
176
|
+
timestamp: number;
|
|
177
|
+
command: string;
|
|
178
|
+
args: Record<string, unknown>;
|
|
179
|
+
error?: string | undefined;
|
|
180
|
+
duration?: number | undefined;
|
|
181
|
+
result?: unknown;
|
|
182
|
+
}, {
|
|
183
|
+
timestamp: number;
|
|
184
|
+
command: string;
|
|
185
|
+
args: Record<string, unknown>;
|
|
186
|
+
error?: string | undefined;
|
|
187
|
+
duration?: number | undefined;
|
|
188
|
+
result?: unknown;
|
|
189
|
+
}>;
|
|
190
|
+
export type IpcEntry = z.infer<typeof IpcEntrySchema>;
|
|
191
|
+
export declare const SnapshotStorageResultSchema: z.ZodObject<{
|
|
192
|
+
localStorage: z.ZodArray<z.ZodObject<{
|
|
193
|
+
key: z.ZodString;
|
|
194
|
+
value: z.ZodNullable<z.ZodString>;
|
|
195
|
+
}, "strip", z.ZodTypeAny, {
|
|
196
|
+
key: string;
|
|
197
|
+
value: string | null;
|
|
198
|
+
}, {
|
|
199
|
+
key: string;
|
|
200
|
+
value: string | null;
|
|
201
|
+
}>, "many">;
|
|
202
|
+
sessionStorage: z.ZodArray<z.ZodObject<{
|
|
203
|
+
key: z.ZodString;
|
|
204
|
+
value: z.ZodNullable<z.ZodString>;
|
|
205
|
+
}, "strip", z.ZodTypeAny, {
|
|
206
|
+
key: string;
|
|
207
|
+
value: string | null;
|
|
208
|
+
}, {
|
|
209
|
+
key: string;
|
|
210
|
+
value: string | null;
|
|
211
|
+
}>, "many">;
|
|
212
|
+
}, "strip", z.ZodTypeAny, {
|
|
213
|
+
localStorage: {
|
|
214
|
+
key: string;
|
|
215
|
+
value: string | null;
|
|
216
|
+
}[];
|
|
217
|
+
sessionStorage: {
|
|
218
|
+
key: string;
|
|
219
|
+
value: string | null;
|
|
220
|
+
}[];
|
|
221
|
+
}, {
|
|
222
|
+
localStorage: {
|
|
223
|
+
key: string;
|
|
224
|
+
value: string | null;
|
|
225
|
+
}[];
|
|
226
|
+
sessionStorage: {
|
|
227
|
+
key: string;
|
|
228
|
+
value: string | null;
|
|
229
|
+
}[];
|
|
230
|
+
}>;
|
|
231
|
+
export type SnapshotStorageResult = z.infer<typeof SnapshotStorageResultSchema>;
|
|
232
|
+
export declare const ImageFormatSchema: z.ZodEnum<["png", "jpg"]>;
|
|
233
|
+
export type ImageFormat = z.infer<typeof ImageFormatSchema>;
|
|
234
|
+
export declare const StorageTypeSchema: z.ZodEnum<["local", "session", "cookies", "all"]>;
|
|
235
|
+
export type StorageType = z.infer<typeof StorageTypeSchema>;
|
|
236
|
+
export declare const DomModeSchema: z.ZodEnum<["dom", "accessibility"]>;
|
|
237
|
+
export type DomMode = z.infer<typeof DomModeSchema>;
|
|
238
|
+
export declare const PackageJsonSchema: z.ZodObject<{
|
|
239
|
+
version: z.ZodString;
|
|
240
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
241
|
+
version: z.ZodString;
|
|
242
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
243
|
+
version: z.ZodString;
|
|
244
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
245
|
+
export type PackageJson = z.infer<typeof PackageJsonSchema>;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// === Storage ===
|
|
3
|
+
export const StorageEntrySchema = z.object({
|
|
4
|
+
key: z.string(),
|
|
5
|
+
value: z.string().nullable(),
|
|
6
|
+
});
|
|
7
|
+
// === Page State ===
|
|
8
|
+
export const PageStateSchema = z.object({
|
|
9
|
+
url: z.string(),
|
|
10
|
+
title: z.string(),
|
|
11
|
+
viewport: z.object({ width: z.number(), height: z.number() }),
|
|
12
|
+
scroll: z.object({ x: z.number(), y: z.number() }),
|
|
13
|
+
document: z.object({ width: z.number(), height: z.number() }),
|
|
14
|
+
hasTauri: z.boolean(),
|
|
15
|
+
});
|
|
16
|
+
// === Console Monitor ===
|
|
17
|
+
export const ConsoleLevelSchema = z.enum(['log', 'warn', 'error', 'info', 'debug']);
|
|
18
|
+
export const ConsoleEntrySchema = z.object({
|
|
19
|
+
level: ConsoleLevelSchema,
|
|
20
|
+
message: z.string(),
|
|
21
|
+
timestamp: z.number(),
|
|
22
|
+
});
|
|
23
|
+
// === Mutations ===
|
|
24
|
+
export const MutationTypeSchema = z.enum(['childList', 'attributes', 'characterData']);
|
|
25
|
+
export const MutationEntrySchema = z.object({
|
|
26
|
+
type: MutationTypeSchema,
|
|
27
|
+
target: z.string(),
|
|
28
|
+
timestamp: z.number(),
|
|
29
|
+
added: z.array(z.object({
|
|
30
|
+
tag: z.string(),
|
|
31
|
+
id: z.string().optional(),
|
|
32
|
+
class: z.string().optional(),
|
|
33
|
+
})).optional(),
|
|
34
|
+
removed: z.array(z.object({
|
|
35
|
+
tag: z.string(),
|
|
36
|
+
id: z.string().optional(),
|
|
37
|
+
class: z.string().optional(),
|
|
38
|
+
})).optional(),
|
|
39
|
+
attribute: z.string().optional(),
|
|
40
|
+
oldValue: z.string().nullable().optional(),
|
|
41
|
+
newValue: z.string().nullable().optional(),
|
|
42
|
+
});
|
|
43
|
+
// === IPC Monitor ===
|
|
44
|
+
export const IpcEntrySchema = z.object({
|
|
45
|
+
command: z.string(),
|
|
46
|
+
args: z.record(z.string(), z.unknown()),
|
|
47
|
+
timestamp: z.number(),
|
|
48
|
+
duration: z.number().optional(),
|
|
49
|
+
result: z.unknown().optional(),
|
|
50
|
+
error: z.string().optional(),
|
|
51
|
+
});
|
|
52
|
+
// === Snapshot: combined storage result ===
|
|
53
|
+
export const SnapshotStorageResultSchema = z.object({
|
|
54
|
+
localStorage: z.array(StorageEntrySchema),
|
|
55
|
+
sessionStorage: z.array(StorageEntrySchema),
|
|
56
|
+
});
|
|
57
|
+
// === CLI Options ===
|
|
58
|
+
export const ImageFormatSchema = z.enum(['png', 'jpg']);
|
|
59
|
+
export const StorageTypeSchema = z.enum(['local', 'session', 'cookies', 'all']);
|
|
60
|
+
export const DomModeSchema = z.enum(['dom', 'accessibility']);
|
|
61
|
+
// === CLI: package.json ===
|
|
62
|
+
export const PackageJsonSchema = z.object({
|
|
63
|
+
version: z.string(),
|
|
64
|
+
}).passthrough();
|
|
65
|
+
//# sourceMappingURL=commands.js.map
|
|
@@ -0,0 +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,EAA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pB,CAAC,CAAC,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export interface DomNode {
|
|
3
|
+
tag: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
classes?: string[];
|
|
6
|
+
text?: string;
|
|
7
|
+
rect?: {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
11
|
+
attributes?: Record<string, string>;
|
|
12
|
+
styles?: Record<string, string>;
|
|
13
|
+
children?: DomNode[];
|
|
14
|
+
}
|
|
15
|
+
export declare const DomNodeSchema: z.ZodType<DomNode>;
|
|
16
|
+
export interface A11yNode {
|
|
17
|
+
role: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
state?: Record<string, unknown>;
|
|
20
|
+
children?: A11yNode[];
|
|
21
|
+
}
|
|
22
|
+
export declare const A11yNodeSchema: z.ZodType<A11yNode>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const DomNodeSchema = z.object({
|
|
3
|
+
tag: z.string(),
|
|
4
|
+
id: z.string().optional(),
|
|
5
|
+
classes: z.array(z.string()).optional(),
|
|
6
|
+
text: z.string().optional(),
|
|
7
|
+
rect: z.object({ width: z.number(), height: z.number() }).optional(),
|
|
8
|
+
attributes: z.record(z.string(), z.string()).optional(),
|
|
9
|
+
styles: z.record(z.string(), z.string()).optional(),
|
|
10
|
+
get children() {
|
|
11
|
+
return z.array(DomNodeSchema).optional();
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
export const A11yNodeSchema = z.object({
|
|
15
|
+
role: z.string(),
|
|
16
|
+
name: z.string().optional(),
|
|
17
|
+
state: z.record(z.string(), z.unknown()).optional(),
|
|
18
|
+
get children() {
|
|
19
|
+
return z.array(A11yNodeSchema).optional();
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=dom.js.map
|