openclaw-multi-auto 1.5.2 → 1.5.4
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/dist/{audio-preflight-5FEeDooz.js → audio-preflight-DDBLZBdb.js} +4 -4
- package/dist/{audio-transcription-runner-B-UvoDjZ.js → audio-transcription-runner-DZbSWT9E.js} +1 -1
- package/dist/build-info.json +3 -3
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{chrome-D45SyhQL.js → chrome-CMU2WVFh.js} +8 -8
- package/dist/{deliver-B9cys0EZ.js → deliver-BXVcFIHL.js} +1 -1
- package/dist/{deliver-runtime-DhaQJ0pI.js → deliver-runtime-DTaIS-1i.js} +3 -3
- package/dist/{deps-send-whatsapp.runtime-DvTL2tzN.js → deps-send-whatsapp.runtime-CIZqFAqb.js} +7 -7
- package/dist/extensionAPI.js +6 -6
- package/dist/{image-DAOPwVXi.js → image-BCVLo0qw.js} +1 -1
- package/dist/{image-runtime-wlCLVvVv.js → image-runtime-DtCKpMPZ.js} +3 -3
- package/dist/{pi-embedded-DYU79yGe.js → pi-embedded-CgQ_W6Xs.js} +24 -24
- package/dist/{pi-embedded-helpers-uTRAmQ4n.js → pi-embedded-helpers-CwuBTKza.js} +3 -3
- package/dist/plugin-sdk/accounts-CJWOBzwB.js +35 -0
- package/dist/plugin-sdk/accounts-DP1-L-QS.js +288 -0
- package/dist/plugin-sdk/accounts-DZhWlEg3.js +46 -0
- package/dist/plugin-sdk/active-listener-B_sLJTXM.js +50 -0
- package/dist/plugin-sdk/api-key-rotation-BRE4X2tf.js +181 -0
- package/dist/plugin-sdk/audio-preflight-DGEUDxxR.js +69 -0
- package/dist/plugin-sdk/audio-transcription-runner-DkoPNPYt.js +2176 -0
- package/dist/plugin-sdk/audit-membership-runtime-DSBHHw7o.js +58 -0
- package/dist/plugin-sdk/bluebubbles.js +2 -2
- package/dist/plugin-sdk/channel-activity-F3d0yUwy.js +94 -0
- package/dist/plugin-sdk/channel-web-QF7EpjeP.js +2256 -0
- package/dist/plugin-sdk/chrome-BXoCyCkY.js +2415 -0
- package/dist/plugin-sdk/commands-registry-t7cXBTfN.js +1125 -0
- package/dist/plugin-sdk/config-BkEnz2Po.js +17913 -0
- package/dist/plugin-sdk/deliver-B6AG_l67.js +1694 -0
- package/dist/plugin-sdk/deliver-runtime-D585kJZc.js +32 -0
- package/dist/plugin-sdk/deps-send-discord.runtime-a_OKY2js.js +23 -0
- package/dist/plugin-sdk/deps-send-imessage.runtime-Baxy9TD4.js +22 -0
- package/dist/plugin-sdk/deps-send-signal.runtime-BwXoCrFl.js +21 -0
- package/dist/plugin-sdk/deps-send-slack.runtime-CLmKjgso.js +19 -0
- package/dist/plugin-sdk/deps-send-telegram.runtime-BKfdBKnZ.js +24 -0
- package/dist/plugin-sdk/deps-send-whatsapp.runtime-BOTwkbx_.js +57 -0
- package/dist/plugin-sdk/diagnostic-CsP-lEkI.js +319 -0
- package/dist/plugin-sdk/errors-DaiAM-yU.js +54 -0
- package/dist/plugin-sdk/fetch-guard-DETCcJzQ.js +156 -0
- package/dist/plugin-sdk/fs-safe-B8y811FR.js +352 -0
- package/dist/plugin-sdk/image-DjTEkYZE.js +2310 -0
- package/dist/plugin-sdk/image-ops-BSiMpAw4.js +584 -0
- package/dist/plugin-sdk/image-runtime-6xPp8m5a.js +25 -0
- package/dist/plugin-sdk/index.js +50 -50
- package/dist/plugin-sdk/ir-DQ7_HbvK.js +1296 -0
- package/dist/plugin-sdk/irc.js +2 -2
- package/dist/plugin-sdk/local-roots-BUP4YBmR.js +186 -0
- package/dist/plugin-sdk/logger-CZY9KIoY.js +1163 -0
- package/dist/plugin-sdk/login-BxEKLlCo.js +57 -0
- package/dist/plugin-sdk/login-qr-BQIpMPr9.js +320 -0
- package/dist/plugin-sdk/manager-I6KbPihW.js +3917 -0
- package/dist/plugin-sdk/manager-runtime-CFfYYWIQ.js +15 -0
- package/dist/plugin-sdk/outbound-NS6UHnB6.js +212 -0
- package/dist/plugin-sdk/outbound-attachment-Dy6fyf6H.js +19 -0
- package/dist/plugin-sdk/path-alias-guards-DBjLbIX_.js +43 -0
- package/dist/plugin-sdk/paths-vTM3Lh3X.js +166 -0
- package/dist/plugin-sdk/pi-embedded-helpers-1R1gu7eX.js +9627 -0
- package/dist/plugin-sdk/pi-model-discovery-runtime-Do9o-dUd.js +8 -0
- package/dist/plugin-sdk/pi-model-discovery-v-XPUOOf.js +134 -0
- package/dist/plugin-sdk/pi-tools.before-tool-call.runtime-D4sFsIks.js +354 -0
- package/dist/plugin-sdk/plugins-DeBZB9l_.js +864 -0
- package/dist/plugin-sdk/proxy-fetch-ChxOhWF4.js +38 -0
- package/dist/plugin-sdk/pw-ai-DEOmCSSC.js +1938 -0
- package/dist/plugin-sdk/qmd-manager-HyYKoEch.js +1448 -0
- package/dist/plugin-sdk/query-expansion-CeyKUeDW.js +1011 -0
- package/dist/plugin-sdk/redact-DjVX-1N3.js +319 -0
- package/dist/plugin-sdk/reply-DAo_Jt8K.js +97916 -0
- package/dist/plugin-sdk/resolve-outbound-target-B42qgQS9.js +40 -0
- package/dist/plugin-sdk/run-with-concurrency-Bt_ks0Qa.js +1994 -0
- package/dist/plugin-sdk/runtime-whatsapp-login.runtime-B6W989eF.js +10 -0
- package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-c_GDFy37.js +19 -0
- package/dist/plugin-sdk/send-CQpMudwO.js +2587 -0
- package/dist/plugin-sdk/send-DQHLzVyO.js +414 -0
- package/dist/plugin-sdk/send-DTB24bEF.js +3135 -0
- package/dist/plugin-sdk/send-DfHadjZ_.js +503 -0
- package/dist/plugin-sdk/send-XXlW2iny.js +540 -0
- package/dist/plugin-sdk/session-6TF6MyaC.js +169 -0
- package/dist/plugin-sdk/skill-commands-CkGeFUMl.js +342 -0
- package/dist/plugin-sdk/skills-CBkHBYPq.js +1428 -0
- package/dist/plugin-sdk/slash-commands.runtime-CxliuGaP.js +13 -0
- package/dist/plugin-sdk/slash-dispatch.runtime-DFaeYlJQ.js +52 -0
- package/dist/plugin-sdk/slash-skill-commands.runtime-0M0OLCxq.js +16 -0
- package/dist/plugin-sdk/ssrf-cFtplYtS.js +202 -0
- package/dist/plugin-sdk/store-5nyxY3WU.js +81 -0
- package/dist/plugin-sdk/subagent-registry-runtime-DCtmDwna.js +52 -0
- package/dist/plugin-sdk/tables-C47P4GTN.js +55 -0
- package/dist/plugin-sdk/target-errors-Blia4S69.js +195 -0
- package/dist/plugin-sdk/thinking-Bo2eosVa.js +1206 -0
- package/dist/plugin-sdk/tokens-DgNRBwIg.js +52 -0
- package/dist/plugin-sdk/tool-images-Gk_-0y2N.js +274 -0
- package/dist/plugin-sdk/web-CVxZbXyH.js +56 -0
- package/dist/plugin-sdk/whatsapp-actions-Bw0H9g-n.js +80 -0
- package/dist/{pw-ai-GcYO6HPE.js → pw-ai-CmphSzHx.js} +1 -1
- package/dist/{slash-dispatch.runtime-Dh053pQK.js → slash-dispatch.runtime-131yup2e.js} +6 -6
- package/dist/{subagent-registry-runtime-DSi5mnCQ.js → subagent-registry-runtime-DbSf_Je6.js} +6 -6
- package/dist/{web-1hWJDzNA.js → web-MR9d7KyB.js} +6 -6
- package/package.json +1 -1
- package/scripts/create-instance.sh +1 -37
- package/scripts/npm_publish.sh +0 -65
- package/scripts/npm_publish_backup.sh +185 -0
- package/extensions/page-action-cache/dist/actions-executor.d.ts +0 -62
- package/extensions/page-action-cache/dist/actions-executor.d.ts.map +0 -1
- package/extensions/page-action-cache/dist/actions-executor.js +0 -339
- package/extensions/page-action-cache/dist/actions-executor.js.map +0 -1
- package/extensions/page-action-cache/dist/cache-invalidator.d.ts +0 -70
- package/extensions/page-action-cache/dist/cache-invalidator.d.ts.map +0 -1
- package/extensions/page-action-cache/dist/cache-invalidator.js +0 -212
- package/extensions/page-action-cache/dist/cache-invalidator.js.map +0 -1
- package/extensions/page-action-cache/dist/cache-store.d.ts +0 -80
- package/extensions/page-action-cache/dist/cache-store.d.ts.map +0 -1
- package/extensions/page-action-cache/dist/cache-store.js +0 -361
- package/extensions/page-action-cache/dist/cache-store.js.map +0 -1
- package/extensions/page-action-cache/dist/cache-strategy.d.ts +0 -65
- package/extensions/page-action-cache/dist/cache-strategy.d.ts.map +0 -1
- package/extensions/page-action-cache/dist/cache-strategy.js +0 -237
- package/extensions/page-action-cache/dist/cache-strategy.js.map +0 -1
- package/extensions/page-action-cache/dist/hooks-entry.d.ts +0 -29
- package/extensions/page-action-cache/dist/hooks-entry.d.ts.map +0 -1
- package/extensions/page-action-cache/dist/hooks-entry.js +0 -83
- package/extensions/page-action-cache/dist/hooks-entry.js.map +0 -1
- package/extensions/page-action-cache/dist/hooks.d.ts +0 -10
- package/extensions/page-action-cache/dist/hooks.d.ts.map +0 -1
- package/extensions/page-action-cache/dist/hooks.js +0 -277
- package/extensions/page-action-cache/dist/hooks.js.map +0 -1
- package/extensions/page-action-cache/dist/index.d.ts +0 -24
- package/extensions/page-action-cache/dist/index.d.ts.map +0 -1
- package/extensions/page-action-cache/dist/index.js +0 -34
- package/extensions/page-action-cache/dist/index.js.map +0 -1
- package/extensions/page-action-cache/dist/scenario-recognizer.d.ts +0 -45
- package/extensions/page-action-cache/dist/scenario-recognizer.d.ts.map +0 -1
- package/extensions/page-action-cache/dist/scenario-recognizer.js +0 -213
- package/extensions/page-action-cache/dist/scenario-recognizer.js.map +0 -1
- package/extensions/page-action-cache/dist/security-policy.d.ts +0 -62
- package/extensions/page-action-cache/dist/security-policy.d.ts.map +0 -1
- package/extensions/page-action-cache/dist/security-policy.js +0 -219
- package/extensions/page-action-cache/dist/security-policy.js.map +0 -1
- package/extensions/page-action-cache/dist/tools.d.ts +0 -209
- package/extensions/page-action-cache/dist/tools.d.ts.map +0 -1
- package/extensions/page-action-cache/dist/tools.js +0 -383
- package/extensions/page-action-cache/dist/tools.js.map +0 -1
- package/extensions/page-action-cache/dist/types.d.ts +0 -336
- package/extensions/page-action-cache/dist/types.d.ts.map +0 -1
- package/extensions/page-action-cache/dist/types.js +0 -8
- package/extensions/page-action-cache/dist/types.js.map +0 -1
- package/extensions/page-action-cache/dist/ux-enhancer.d.ts +0 -60
- package/extensions/page-action-cache/dist/ux-enhancer.d.ts.map +0 -1
- package/extensions/page-action-cache/dist/ux-enhancer.js +0 -218
- package/extensions/page-action-cache/dist/ux-enhancer.js.map +0 -1
- package/extensions/page-action-cache/dist/variable-resolver.d.ts +0 -28
- package/extensions/page-action-cache/dist/variable-resolver.d.ts.map +0 -1
- package/extensions/page-action-cache/dist/variable-resolver.js +0 -201
- package/extensions/page-action-cache/dist/variable-resolver.js.map +0 -1
- package/extensions/page-action-cache/docs/API.md +0 -555
- package/extensions/page-action-cache/docs/IMPLEMENTATION.md +0 -1792
- package/extensions/page-action-cache/docs/INTEGRATION.md +0 -387
- package/extensions/page-action-cache/docs/README.md +0 -183
- package/extensions/page-action-cache/index.ts +0 -118
- package/extensions/page-action-cache/node_modules/.bin/nlc +0 -21
- package/extensions/page-action-cache/node_modules/.bin/node-llama-cpp +0 -21
- package/extensions/page-action-cache/node_modules/.bin/openclaw +0 -21
- package/extensions/page-action-cache/node_modules/.bin/tsc +0 -21
- package/extensions/page-action-cache/node_modules/.bin/tsserver +0 -21
- package/extensions/page-action-cache/node_modules/.bin/vitest +0 -21
- package/extensions/page-action-cache/openclaw.plugin.json +0 -208
- package/extensions/page-action-cache/package.json +0 -74
- package/extensions/page-action-cache/scripts/npm_publish.sh +0 -80
- package/extensions/page-action-cache/skills/page-action-cache/SKILL.md +0 -216
- package/extensions/page-action-cache/src/actions-executor.ts +0 -441
- package/extensions/page-action-cache/src/cache-invalidator.ts +0 -271
- package/extensions/page-action-cache/src/cache-store.ts +0 -457
- package/extensions/page-action-cache/src/cache-strategy.ts +0 -327
- package/extensions/page-action-cache/src/hooks-entry.ts +0 -114
- package/extensions/page-action-cache/src/hooks.ts +0 -332
- package/extensions/page-action-cache/src/index.ts +0 -89
- package/extensions/page-action-cache/src/scenario-recognizer.ts +0 -259
- package/extensions/page-action-cache/src/security-policy.ts +0 -268
- package/extensions/page-action-cache/src/tools.ts +0 -437
- package/extensions/page-action-cache/src/types.ts +0 -482
- package/extensions/page-action-cache/src/ux-enhancer.ts +0 -266
- package/extensions/page-action-cache/src/variable-resolver.ts +0 -258
- package/extensions/page-action-cache/tests/actions-executor.test.ts +0 -424
- package/extensions/page-action-cache/tests/cache-store.test.ts +0 -267
- package/extensions/page-action-cache/tests/integration-test.ts +0 -62
- package/extensions/page-action-cache/tests/scenario-recognizer.test.ts +0 -140
- package/extensions/page-action-cache/tests/variable-resolver.test.ts +0 -187
- package/extensions/page-action-cache/tsconfig.json +0 -39
|
@@ -1,482 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Page Action Cache Extension - Type Definitions
|
|
3
|
-
* Version: 1.0.0
|
|
4
|
-
*
|
|
5
|
-
* 完全对齐 Playwright API 的类型定义
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
// ============================================================================
|
|
9
|
-
// 基础类型
|
|
10
|
-
// ============================================================================
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* 页面视口尺寸
|
|
14
|
-
*/
|
|
15
|
-
export interface PageViewport {
|
|
16
|
-
width: number;
|
|
17
|
-
height: number;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* 变量映射
|
|
22
|
-
*/
|
|
23
|
-
export type VariableMap = Record<string, string>;
|
|
24
|
-
|
|
25
|
-
// ============================================================================
|
|
26
|
-
// 原子化操作(Playwright 完全对齐)
|
|
27
|
-
// ============================================================================
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* 原子化操作类型
|
|
31
|
-
*/
|
|
32
|
-
export type AtomicActionType =
|
|
33
|
-
| "navigate"
|
|
34
|
-
| "screenshot"
|
|
35
|
-
| "click"
|
|
36
|
-
| "type"
|
|
37
|
-
| "press"
|
|
38
|
-
| "hover"
|
|
39
|
-
| "scroll"
|
|
40
|
-
| "wait"
|
|
41
|
-
| "select"
|
|
42
|
-
| "focus"
|
|
43
|
-
| "drag"
|
|
44
|
-
| "upload"
|
|
45
|
-
| "composite";
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Playwright 支持的按钮类型
|
|
49
|
-
*/
|
|
50
|
-
export type PlaywrightButton = "left" | "right" | "middle";
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Playwright 支持的修饰符
|
|
54
|
-
*/
|
|
55
|
-
export type PlaywrightModifier =
|
|
56
|
-
| "Alt"
|
|
57
|
-
| "Control"
|
|
58
|
-
| "ControlOrMeta"
|
|
59
|
-
| "Meta"
|
|
60
|
-
| "Shift";
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Playwright 导航策略
|
|
64
|
-
*/
|
|
65
|
-
export interface NavigationPolicy {
|
|
66
|
-
waitUntil?: "load" | "domcontentloaded" | "networkidle";
|
|
67
|
-
timeout?: number;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Evaluate 操作参数
|
|
72
|
-
*/
|
|
73
|
-
export interface EvaluateParams {
|
|
74
|
-
code: string;
|
|
75
|
-
args?: any[];
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* 原子化操作基类
|
|
80
|
-
*/
|
|
81
|
-
export interface BaseAtomicAction {
|
|
82
|
-
type: AtomicActionType;
|
|
83
|
-
cdpUrl?: string;
|
|
84
|
-
targetId?: string;
|
|
85
|
-
ref?: string;
|
|
86
|
-
variable?: string;
|
|
87
|
-
order: number;
|
|
88
|
-
description?: string;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* 导航操作
|
|
93
|
-
*/
|
|
94
|
-
export interface NavigateAction extends BaseAtomicAction {
|
|
95
|
-
type: "navigate";
|
|
96
|
-
url: string;
|
|
97
|
-
navigationPolicy?: NavigationPolicy;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* 点击操作
|
|
102
|
-
*/
|
|
103
|
-
export interface ClickAction extends BaseAtomicAction {
|
|
104
|
-
type: "click";
|
|
105
|
-
ref: string;
|
|
106
|
-
button?: PlaywrightButton;
|
|
107
|
-
doubleClick?: boolean;
|
|
108
|
-
modifiers?: PlaywrightModifier[];
|
|
109
|
-
timeoutMs?: number;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* 输入操作
|
|
114
|
-
*/
|
|
115
|
-
export interface TypeAction extends BaseAtomicAction {
|
|
116
|
-
type: "type";
|
|
117
|
-
ref: string;
|
|
118
|
-
text: string;
|
|
119
|
-
submit?: boolean;
|
|
120
|
-
slowly?: boolean;
|
|
121
|
-
timeoutMs?: number;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* 按键操作
|
|
126
|
-
*/
|
|
127
|
-
export interface PressAction extends BaseAtomicAction {
|
|
128
|
-
type: "press";
|
|
129
|
-
key: string;
|
|
130
|
-
delayMs?: number;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* 悬停操作
|
|
135
|
-
*/
|
|
136
|
-
export interface HoverAction extends BaseAtomicAction {
|
|
137
|
-
type: "hover";
|
|
138
|
-
ref: string;
|
|
139
|
-
timeoutMs?: number;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* 截图操作
|
|
144
|
-
*/
|
|
145
|
-
export interface ScreenshotAction extends BaseAtomicAction {
|
|
146
|
-
type: "screenshot";
|
|
147
|
-
screenshotPath?: string;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Evaluate 操作(scroll, wait, select, focus, drag, upload)
|
|
152
|
-
*/
|
|
153
|
-
export type EvaluateActionType =
|
|
154
|
-
| "scroll"
|
|
155
|
-
| "wait"
|
|
156
|
-
| "select"
|
|
157
|
-
| "focus"
|
|
158
|
-
| "drag"
|
|
159
|
-
| "upload";
|
|
160
|
-
|
|
161
|
-
export interface EvaluateAction extends BaseAtomicAction {
|
|
162
|
-
type: EvaluateActionType;
|
|
163
|
-
evaluate: EvaluateParams;
|
|
164
|
-
delay?: number; // 等待时间(毫秒)
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* 复合操作
|
|
169
|
-
*/
|
|
170
|
-
export interface CompositeAction extends BaseAtomicAction {
|
|
171
|
-
type: "composite";
|
|
172
|
-
actions: AtomicAction[];
|
|
173
|
-
atomic?: boolean;
|
|
174
|
-
rollback?: AtomicAction[];
|
|
175
|
-
label?: string;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* 原子化操作联合类型
|
|
180
|
-
*/
|
|
181
|
-
export type AtomicAction =
|
|
182
|
-
| NavigateAction
|
|
183
|
-
| ClickAction
|
|
184
|
-
| TypeAction
|
|
185
|
-
| PressAction
|
|
186
|
-
| HoverAction
|
|
187
|
-
| ScreenshotAction
|
|
188
|
-
| EvaluateAction
|
|
189
|
-
| CompositeAction;
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* 操作类型(包含复合操作)
|
|
193
|
-
*/
|
|
194
|
-
export type Action = AtomicAction;
|
|
195
|
-
|
|
196
|
-
// ============================================================================
|
|
197
|
-
// 缓存条目
|
|
198
|
-
// ============================================================================
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* 缓存层级
|
|
202
|
-
*/
|
|
203
|
-
export type CacheLevel = "L3" | "L2" | "L1";
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* 页面类型
|
|
207
|
-
*/
|
|
208
|
-
export type PageType = "static" | "dynamic" | "mixed";
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* 缓存来源
|
|
212
|
-
*/
|
|
213
|
-
export type CacheSource = "llm" | "manual" | "learned";
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* DOM hash 特征
|
|
217
|
-
*/
|
|
218
|
-
export interface DOMHashFeatures {
|
|
219
|
-
formCount: number;
|
|
220
|
-
buttonCount: number;
|
|
221
|
-
linkCount: number;
|
|
222
|
-
scriptCount: number;
|
|
223
|
-
headingCount: number;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* 页面变化检测结果
|
|
228
|
-
*/
|
|
229
|
-
export interface PageChangeDetection {
|
|
230
|
-
hasChanged: boolean;
|
|
231
|
-
changeType: "structure" | "content" | "none";
|
|
232
|
-
confidence: number;
|
|
233
|
-
domHash: string;
|
|
234
|
-
structureHash?: string;
|
|
235
|
-
lastCheckedAt: number;
|
|
236
|
-
details?: string;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* 页面操作缓存条目
|
|
241
|
-
*/
|
|
242
|
-
export interface PageActionCacheEntry {
|
|
243
|
-
// === 标识信息 ===
|
|
244
|
-
key: string;
|
|
245
|
-
url: string;
|
|
246
|
-
viewport: PageViewport;
|
|
247
|
-
|
|
248
|
-
// === 缓存层级 ===
|
|
249
|
-
cacheLevel: CacheLevel;
|
|
250
|
-
|
|
251
|
-
// === 场景信息 ===
|
|
252
|
-
scenario: string;
|
|
253
|
-
description: string;
|
|
254
|
-
variables?: VariableMap;
|
|
255
|
-
urlPattern?: string;
|
|
256
|
-
|
|
257
|
-
// === 操作序列 ===
|
|
258
|
-
actions: AtomicAction[];
|
|
259
|
-
screenshotPath?: string;
|
|
260
|
-
|
|
261
|
-
// === 时间信息 ===
|
|
262
|
-
createdAt: number;
|
|
263
|
-
lastAccessTime: number;
|
|
264
|
-
accessCount: number;
|
|
265
|
-
|
|
266
|
-
// === 失效控制 ===
|
|
267
|
-
expiresAt: number;
|
|
268
|
-
pageChangeDetection: PageChangeDetection;
|
|
269
|
-
|
|
270
|
-
// === 元数据 ===
|
|
271
|
-
source: CacheSource;
|
|
272
|
-
version?: number;
|
|
273
|
-
tags?: string[];
|
|
274
|
-
variant?: string;
|
|
275
|
-
|
|
276
|
-
// === 执行统计 ===
|
|
277
|
-
successCount: number;
|
|
278
|
-
failCount: number;
|
|
279
|
-
avgExecutionTime: number;
|
|
280
|
-
|
|
281
|
-
// === 页面类型(用于失效策略) ===
|
|
282
|
-
pageType?: PageType;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
// ============================================================================
|
|
286
|
-
// 场景识别
|
|
287
|
-
// ============================================================================
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* 场景识别规则
|
|
291
|
-
*/
|
|
292
|
-
export interface ScenarioRule {
|
|
293
|
-
scenario: string;
|
|
294
|
-
keywords: string[];
|
|
295
|
-
urlPatterns: string[];
|
|
296
|
-
priority: number;
|
|
297
|
-
cacheLevel: CacheLevel;
|
|
298
|
-
confidence: number;
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* 场景匹配结果
|
|
303
|
-
*/
|
|
304
|
-
export interface ScenarioMatch {
|
|
305
|
-
scenario: string;
|
|
306
|
-
confidence: number;
|
|
307
|
-
method: "keyword" | "url" | "llm" | "history" | "learned";
|
|
308
|
-
matchedPattern?: string;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
// ============================================================================
|
|
312
|
-
// 缓存统计
|
|
313
|
-
// ============================================================================
|
|
314
|
-
|
|
315
|
-
/**
|
|
316
|
-
* 缓存统计
|
|
317
|
-
*/
|
|
318
|
-
export interface CacheStats {
|
|
319
|
-
// 基本统计
|
|
320
|
-
totalEntries: number;
|
|
321
|
-
totalHits: number;
|
|
322
|
-
totalMisses: number;
|
|
323
|
-
hitRate: number;
|
|
324
|
-
|
|
325
|
-
// 按层级统计
|
|
326
|
-
l3Hits: number;
|
|
327
|
-
l2Hits: number;
|
|
328
|
-
l1Hits: number;
|
|
329
|
-
|
|
330
|
-
// 场景识别统计
|
|
331
|
-
scenarioMatches: number;
|
|
332
|
-
llmClassifications: number;
|
|
333
|
-
learnedAssociations: number;
|
|
334
|
-
|
|
335
|
-
// 效果统计
|
|
336
|
-
savedTokens: number;
|
|
337
|
-
savedTime: number;
|
|
338
|
-
avgExecutionTime: number;
|
|
339
|
-
|
|
340
|
-
// 用户反馈统计
|
|
341
|
-
userConfirmations: number;
|
|
342
|
-
userForcedRefreshes: number;
|
|
343
|
-
cacheErrors: number;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
// ============================================================================
|
|
347
|
-
// 缓存存储
|
|
348
|
-
// ============================================================================
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
* 页面操作缓存存储
|
|
352
|
-
*/
|
|
353
|
-
export interface PageActionCacheStore {
|
|
354
|
-
version: number;
|
|
355
|
-
entries: Record<string, PageActionCacheEntry>;
|
|
356
|
-
scenarios: Map<string, ScenarioMatch>;
|
|
357
|
-
stats: CacheStats;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
// ============================================================================
|
|
361
|
-
// 配置
|
|
362
|
-
// ============================================================================
|
|
363
|
-
|
|
364
|
-
/**
|
|
365
|
-
* 缓存配置
|
|
366
|
-
*/
|
|
367
|
-
export interface CacheConfig {
|
|
368
|
-
// === 全局开关 ===
|
|
369
|
-
enabled: boolean;
|
|
370
|
-
autoUseCache: boolean;
|
|
371
|
-
|
|
372
|
-
// === 场景识别 ===
|
|
373
|
-
scenarioRecognitionEnabled: boolean;
|
|
374
|
-
llmClassificationThreshold: number;
|
|
375
|
-
|
|
376
|
-
// === 缓存策略 ===
|
|
377
|
-
cacheLevelStrategy: "auto" | "l3-only" | "l2-only" | "l1-only";
|
|
378
|
-
defaultCacheLevel: string;
|
|
379
|
-
|
|
380
|
-
// === 缓存失效 ===
|
|
381
|
-
pageChangeDetectionEnabled: boolean;
|
|
382
|
-
changeInvalidationThreshold: number;
|
|
383
|
-
invalidationStrategy: "soft" | "hard";
|
|
384
|
-
maxVersionsPerEntry: number;
|
|
385
|
-
|
|
386
|
-
// === 变量系统 ===
|
|
387
|
-
variableExtractionEnabled: boolean;
|
|
388
|
-
allowUserConfirmVariables: boolean;
|
|
389
|
-
|
|
390
|
-
// === 安全 ===
|
|
391
|
-
encryptSensitiveCache: boolean;
|
|
392
|
-
accessControlEnabled: boolean;
|
|
393
|
-
allowedUserIds: string[];
|
|
394
|
-
logSanitizationEnabled: boolean;
|
|
395
|
-
|
|
396
|
-
// === 用户体验 ===
|
|
397
|
-
showCacheStatusToUser: boolean;
|
|
398
|
-
enableUserCacheConfirmation: boolean;
|
|
399
|
-
enableUserForcedRefresh: boolean;
|
|
400
|
-
enableUserCacheErrorReport: boolean;
|
|
401
|
-
|
|
402
|
-
// === 统计 ===
|
|
403
|
-
trackExecutionStats: boolean;
|
|
404
|
-
statsUpdateInterval: number;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
// ============================================================================
|
|
408
|
-
// 执行结果
|
|
409
|
-
// ============================================================================
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* 操作执行结果
|
|
413
|
-
*/
|
|
414
|
-
export interface ExecutionResult {
|
|
415
|
-
action: string;
|
|
416
|
-
success: boolean;
|
|
417
|
-
error?: string;
|
|
418
|
-
duration: number;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
// ============================================================================
|
|
422
|
-
// Playwright 客户端接口
|
|
423
|
-
// ============================================================================
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* Playwright 客户端接口
|
|
427
|
-
*/
|
|
428
|
-
export interface PwAi {
|
|
429
|
-
navigateViaPlaywright(opts: {
|
|
430
|
-
cdpUrl: string;
|
|
431
|
-
targetId?: string;
|
|
432
|
-
url: string;
|
|
433
|
-
waitUntil?: "load" | "domcontentloaded" | "networkidle";
|
|
434
|
-
timeout?: number;
|
|
435
|
-
}): Promise<void>;
|
|
436
|
-
|
|
437
|
-
clickViaPlaywright(opts: {
|
|
438
|
-
cdpUrl: string;
|
|
439
|
-
targetId?: string;
|
|
440
|
-
ref: string;
|
|
441
|
-
doubleClick?: boolean;
|
|
442
|
-
button?: "left" | "right" | "middle";
|
|
443
|
-
modifiers?: Array<"Alt" | "Control" | "ControlOrMeta" | "Meta" | "Shift">;
|
|
444
|
-
timeoutMs?: number;
|
|
445
|
-
}): Promise<void>;
|
|
446
|
-
|
|
447
|
-
typeViaPlaywright(opts: {
|
|
448
|
-
cdpUrl: string;
|
|
449
|
-
targetId?: string;
|
|
450
|
-
ref: string;
|
|
451
|
-
text: string;
|
|
452
|
-
submit?: boolean;
|
|
453
|
-
slowly?: boolean;
|
|
454
|
-
timeoutMs?: number;
|
|
455
|
-
}): Promise<void>;
|
|
456
|
-
|
|
457
|
-
pressKeyViaPlaywright(opts: {
|
|
458
|
-
cdpUrl: string;
|
|
459
|
-
targetId?: string;
|
|
460
|
-
key: string;
|
|
461
|
-
delayMs?: number;
|
|
462
|
-
}): Promise<void>;
|
|
463
|
-
|
|
464
|
-
hoverViaPlaywright(opts: {
|
|
465
|
-
cdpUrl: string;
|
|
466
|
-
targetId?: string;
|
|
467
|
-
ref: string;
|
|
468
|
-
timeoutMs?: number;
|
|
469
|
-
}): Promise<void>;
|
|
470
|
-
|
|
471
|
-
screenshotViaPlaywright(opts: {
|
|
472
|
-
cdpUrl: string;
|
|
473
|
-
targetId?: string;
|
|
474
|
-
}): Promise<string>;
|
|
475
|
-
|
|
476
|
-
evaluateViaPlaywright(opts: {
|
|
477
|
-
cdpUrl: string;
|
|
478
|
-
targetId?: string;
|
|
479
|
-
code: string;
|
|
480
|
-
args?: any[];
|
|
481
|
-
}): Promise<any>;
|
|
482
|
-
}
|