tauri-agent-tools 0.3.0 → 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 +23 -3
- package/.agents/skills/tauri-bridge-setup/SKILL.md +24 -2
- package/AGENTS.md +4 -2
- package/README.md +17 -1
- 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 +4 -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.js +2 -1
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/dom.js +19 -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 +2 -18
- package/dist/commands/mutations.js +3 -1
- package/dist/commands/mutations.js.map +1 -1
- 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.js +12 -5
- package/dist/commands/snapshot.js.map +1 -1
- 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 +5 -3
- package/rust-bridge/README.md +9 -5
|
@@ -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,EA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kBAAkB,CAAC;CAC5C,CAAC,CAAC;AAGH,sBAAsB;AAEtB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAGxD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;AAGhF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC;AAG9D,4BAA4B;AAE5B,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom.js","sourceRoot":"","sources":["../../src/schemas/dom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,MAAM,CAAC,MAAM,aAAa,GAAuB,CAAC,CAAC,MAAM,CAAC;IACxD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACvC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE;IACpE,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACvD,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACnD,IAAI,QAAQ;QACV,OAAO,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC3C,CAAC;CACF,CAAC,CAAC;AAWH,MAAM,CAAC,MAAM,cAAc,GAAwB,CAAC,CAAC,MAAM,CAAC;IAC1D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;IACnD,IAAI,QAAQ;QACV,OAAO,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC5C,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Zod schemas and derived TypeScript types, organized by domain.
|
|
3
|
+
* Foundation layer of the dependency DAG — no internal imports except `zod`.
|
|
4
|
+
*
|
|
5
|
+
* Barrel re-exports from all domain files. Consumers may import directly
|
|
6
|
+
* from domain files (e.g., '../schemas/bridge.js') for explicitness.
|
|
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';
|
|
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';
|
|
11
|
+
export { WindowIdSchema, CGWindowInfoSchema, type CGWindowInfo, SwayNodeSchema, type SwayNode, } from './platform.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared Zod schemas and derived TypeScript types, organized by domain.
|
|
3
|
+
* Foundation layer of the dependency DAG — no internal imports except `zod`.
|
|
4
|
+
*
|
|
5
|
+
* Barrel re-exports from all domain files. Consumers may import directly
|
|
6
|
+
* from domain files (e.g., '../schemas/bridge.js') for explicitness.
|
|
7
|
+
*/
|
|
8
|
+
export { TokenFileSchema, ElementRectSchema, BridgeConfigSchema, ViewportSizeSchema, RustLogLevelSchema, RustLogEntrySchema, BridgeEvalResponseSchema, BridgeLogsResponseSchema, } from './bridge.js';
|
|
9
|
+
export { DomNodeSchema, A11yNodeSchema, } from './dom.js';
|
|
10
|
+
export { StorageEntrySchema, PageStateSchema, ConsoleLevelSchema, ConsoleEntrySchema, MutationTypeSchema, MutationEntrySchema, IpcEntrySchema, SnapshotStorageResultSchema, ImageFormatSchema, StorageTypeSchema, DomModeSchema, PackageJsonSchema, } from './commands.js';
|
|
11
|
+
export { WindowIdSchema, CGWindowInfoSchema, SwayNodeSchema, } from './platform.js';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const WindowIdSchema: z.ZodString;
|
|
3
|
+
export declare const CGWindowInfoSchema: z.ZodObject<{
|
|
4
|
+
kCGWindowNumber: z.ZodNumber;
|
|
5
|
+
kCGWindowOwnerPID: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
kCGWindowName: z.ZodOptional<z.ZodString>;
|
|
7
|
+
kCGWindowOwnerName: z.ZodOptional<z.ZodString>;
|
|
8
|
+
kCGWindowBounds: z.ZodObject<{
|
|
9
|
+
X: z.ZodNumber;
|
|
10
|
+
Y: z.ZodNumber;
|
|
11
|
+
Width: z.ZodNumber;
|
|
12
|
+
Height: z.ZodNumber;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
X: number;
|
|
15
|
+
Y: number;
|
|
16
|
+
Width: number;
|
|
17
|
+
Height: number;
|
|
18
|
+
}, {
|
|
19
|
+
X: number;
|
|
20
|
+
Y: number;
|
|
21
|
+
Width: number;
|
|
22
|
+
Height: number;
|
|
23
|
+
}>;
|
|
24
|
+
}, "strip", z.ZodTypeAny, {
|
|
25
|
+
kCGWindowNumber: number;
|
|
26
|
+
kCGWindowBounds: {
|
|
27
|
+
X: number;
|
|
28
|
+
Y: number;
|
|
29
|
+
Width: number;
|
|
30
|
+
Height: number;
|
|
31
|
+
};
|
|
32
|
+
kCGWindowOwnerPID?: number | undefined;
|
|
33
|
+
kCGWindowName?: string | undefined;
|
|
34
|
+
kCGWindowOwnerName?: string | undefined;
|
|
35
|
+
}, {
|
|
36
|
+
kCGWindowNumber: number;
|
|
37
|
+
kCGWindowBounds: {
|
|
38
|
+
X: number;
|
|
39
|
+
Y: number;
|
|
40
|
+
Width: number;
|
|
41
|
+
Height: number;
|
|
42
|
+
};
|
|
43
|
+
kCGWindowOwnerPID?: number | undefined;
|
|
44
|
+
kCGWindowName?: string | undefined;
|
|
45
|
+
kCGWindowOwnerName?: string | undefined;
|
|
46
|
+
}>;
|
|
47
|
+
export type CGWindowInfo = z.infer<typeof CGWindowInfoSchema>;
|
|
48
|
+
export interface SwayNode {
|
|
49
|
+
id: number;
|
|
50
|
+
pid?: number;
|
|
51
|
+
name: string | null;
|
|
52
|
+
rect: {
|
|
53
|
+
x: number;
|
|
54
|
+
y: number;
|
|
55
|
+
width: number;
|
|
56
|
+
height: number;
|
|
57
|
+
};
|
|
58
|
+
nodes?: SwayNode[];
|
|
59
|
+
floating_nodes?: SwayNode[];
|
|
60
|
+
}
|
|
61
|
+
export declare const SwayNodeSchema: z.ZodType<SwayNode>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
// === Platform: Window ID ===
|
|
3
|
+
export const WindowIdSchema = z.string().regex(/^\d+$/, 'Invalid window ID');
|
|
4
|
+
// === Platform: macOS ===
|
|
5
|
+
export const CGWindowInfoSchema = z.object({
|
|
6
|
+
kCGWindowNumber: z.number(),
|
|
7
|
+
kCGWindowOwnerPID: z.number().optional(),
|
|
8
|
+
kCGWindowName: z.string().optional(),
|
|
9
|
+
kCGWindowOwnerName: z.string().optional(),
|
|
10
|
+
kCGWindowBounds: z.object({
|
|
11
|
+
X: z.number(),
|
|
12
|
+
Y: z.number(),
|
|
13
|
+
Width: z.number(),
|
|
14
|
+
Height: z.number(),
|
|
15
|
+
}),
|
|
16
|
+
});
|
|
17
|
+
export const SwayNodeSchema = z.object({
|
|
18
|
+
id: z.number(),
|
|
19
|
+
pid: z.number().optional(),
|
|
20
|
+
name: z.string().nullable(),
|
|
21
|
+
rect: z.object({
|
|
22
|
+
x: z.number(),
|
|
23
|
+
y: z.number(),
|
|
24
|
+
width: z.number(),
|
|
25
|
+
height: z.number(),
|
|
26
|
+
}),
|
|
27
|
+
get nodes() {
|
|
28
|
+
return z.array(SwayNodeSchema).optional();
|
|
29
|
+
},
|
|
30
|
+
get floating_nodes() {
|
|
31
|
+
return z.array(SwayNodeSchema).optional();
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=platform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../../src/schemas/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8BAA8B;AAE9B,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;AAE7E,0BAA0B;AAE1B,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE;IAC3B,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzC,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC;QACxB,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;QACb,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;QACb,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;QACjB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;KACnB,CAAC;CACH,CAAC,CAAC;AAcH,MAAM,CAAC,MAAM,cAAc,GAAwB,CAAC,CAAC,MAAM,CAAC;IAC1D,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;QACb,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;QACb,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;QACjB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;KACnB,CAAC;IACF,IAAI,KAAK;QACP,OAAO,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC5C,CAAC;IACD,IAAI,cAAc;QAChB,OAAO,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC5C,CAAC;CACF,CAAC,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { ImageFormat } from './schemas/commands.js';
|
|
2
|
+
import type { BridgeConfig } from './schemas/bridge.js';
|
|
1
3
|
export interface WindowInfo {
|
|
2
4
|
windowId: string;
|
|
3
5
|
pid?: number;
|
|
@@ -7,18 +9,7 @@ export interface WindowInfo {
|
|
|
7
9
|
width: number;
|
|
8
10
|
height: number;
|
|
9
11
|
}
|
|
10
|
-
export interface ElementRect {
|
|
11
|
-
x: number;
|
|
12
|
-
y: number;
|
|
13
|
-
width: number;
|
|
14
|
-
height: number;
|
|
15
|
-
}
|
|
16
|
-
export interface BridgeConfig {
|
|
17
|
-
port: number;
|
|
18
|
-
token: string;
|
|
19
|
-
}
|
|
20
12
|
export type DisplayServer = 'x11' | 'wayland' | 'darwin' | 'unknown';
|
|
21
|
-
export type ImageFormat = 'png' | 'jpg';
|
|
22
13
|
export interface PlatformAdapter {
|
|
23
14
|
findWindow(title: string): Promise<string>;
|
|
24
15
|
captureWindow(windowId: string, format: ImageFormat): Promise<Buffer>;
|
package/dist/util/exec.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { execFile as cpExecFile } from 'node:child_process';
|
|
2
|
+
import { WindowIdSchema } from '../schemas/platform.js';
|
|
2
3
|
const MAX_BUFFER = 100 * 1024 * 1024; // 100MB
|
|
3
|
-
const WINDOW_ID_RE = /^\d+$/;
|
|
4
4
|
export function validateWindowId(id) {
|
|
5
|
-
|
|
6
|
-
throw new Error(`Invalid window ID: ${id}`);
|
|
7
|
-
}
|
|
5
|
+
WindowIdSchema.parse(id);
|
|
8
6
|
}
|
|
9
7
|
export function exec(cmd, args, options) {
|
|
10
8
|
return new Promise((resolve, reject) => {
|
package/dist/util/exec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../src/util/exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../../src/util/exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,UAAU,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,QAAQ;AAE9C,MAAM,UAAU,gBAAgB,CAAC,EAAU;IACzC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC3B,CAAC;AAOD,MAAM,UAAU,IAAI,CAClB,GAAW,EACX,IAAc,EACd,OAA8C;IAE9C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,KAAK,GAAG,UAAU,CACtB,GAAG,EACH,IAAI,EACJ;YACE,SAAS,EAAE,UAAU;YACrB,QAAQ,EAAE,QAAQ;YAClB,OAAO,EAAE,OAAO,EAAE,OAAO;SAC1B,EACD,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;YACxB,IAAI,KAAK,EAAE,CAAC;gBACV,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;gBACrF,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,GAAG,YAAY,SAAS,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;gBAClE,OAAO;YACT,CAAC;YACD,OAAO,CAAC;gBACN,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAA2B,CAAC;gBACnF,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC;aAC3E,CAAC,CAAC;QACL,CAAC,CACF,CAAC;QAEF,IAAI,OAAO,EAAE,KAAK,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;YAClC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACjC,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/util/image.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { ElementRect
|
|
1
|
+
import type { ElementRect } from '../schemas/bridge.js';
|
|
2
|
+
import type { ImageFormat } from '../schemas/commands.js';
|
|
2
3
|
export declare function cropImage(buffer: Buffer, rect: ElementRect, format: ImageFormat): Promise<Buffer>;
|
|
3
4
|
export declare function resizeImage(buffer: Buffer, maxWidth: number, format: ImageFormat): Promise<Buffer>;
|
|
4
5
|
export declare function computeCropRect(elementRect: ElementRect, viewport: {
|
package/dist/util/image.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../src/util/image.ts"],"names":[],"mappings":"
|
|
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,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAChH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAC3B,SAAS,EACT,CAAC,GAAG,GAAG,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,GAAG,IAAI,CAAC,EAClD,EAAE,KAAK,EAAE,MAAM,EAAE,CAClB,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAAc,EACd,QAAgB,EAChB,MAAmB;IAEnB,MAAM,GAAG,GAAG,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,C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