openclaw-multi-auto 1.4.5 → 1.4.7
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/build-info.json +3 -3
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/plugin-sdk/mattermost.js +3 -3
- package/dist/plugin-sdk/signal.js +2 -2
- package/docs/browser-architecture.md +602 -0
- package/extensions/googlechat/node_modules/.bin/openclaw +2 -2
- package/extensions/memory-core/node_modules/.bin/openclaw +2 -2
- package/extensions/memory-lancedb/node_modules/.bin/openai +2 -2
- package/extensions/page-action-cache/dist/actions-executor.d.ts +62 -0
- package/extensions/page-action-cache/dist/actions-executor.d.ts.map +1 -0
- package/extensions/page-action-cache/dist/actions-executor.js +339 -0
- package/extensions/page-action-cache/dist/actions-executor.js.map +1 -0
- package/extensions/page-action-cache/dist/cache-invalidator.d.ts +70 -0
- package/extensions/page-action-cache/dist/cache-invalidator.d.ts.map +1 -0
- package/extensions/page-action-cache/dist/cache-invalidator.js +212 -0
- package/extensions/page-action-cache/dist/cache-invalidator.js.map +1 -0
- package/extensions/page-action-cache/dist/cache-store.d.ts +80 -0
- package/extensions/page-action-cache/dist/cache-store.d.ts.map +1 -0
- package/extensions/page-action-cache/dist/cache-store.js +361 -0
- package/extensions/page-action-cache/dist/cache-store.js.map +1 -0
- package/extensions/page-action-cache/dist/cache-strategy.d.ts +65 -0
- package/extensions/page-action-cache/dist/cache-strategy.d.ts.map +1 -0
- package/extensions/page-action-cache/dist/cache-strategy.js +237 -0
- package/extensions/page-action-cache/dist/cache-strategy.js.map +1 -0
- package/extensions/page-action-cache/dist/hooks-entry.d.ts +18 -0
- package/extensions/page-action-cache/dist/hooks-entry.d.ts.map +1 -0
- package/extensions/page-action-cache/dist/hooks-entry.js +27 -0
- package/extensions/page-action-cache/dist/hooks-entry.js.map +1 -0
- package/extensions/page-action-cache/dist/hooks.d.ts +10 -0
- package/extensions/page-action-cache/dist/hooks.d.ts.map +1 -0
- package/extensions/page-action-cache/dist/hooks.js +277 -0
- package/extensions/page-action-cache/dist/hooks.js.map +1 -0
- package/extensions/page-action-cache/dist/index.d.ts +24 -0
- package/extensions/page-action-cache/dist/index.d.ts.map +1 -0
- package/extensions/page-action-cache/dist/index.js +34 -0
- package/extensions/page-action-cache/dist/index.js.map +1 -0
- package/extensions/page-action-cache/dist/scenario-recognizer.d.ts +45 -0
- package/extensions/page-action-cache/dist/scenario-recognizer.d.ts.map +1 -0
- package/extensions/page-action-cache/dist/scenario-recognizer.js +213 -0
- package/extensions/page-action-cache/dist/scenario-recognizer.js.map +1 -0
- package/extensions/page-action-cache/dist/security-policy.d.ts +62 -0
- package/extensions/page-action-cache/dist/security-policy.d.ts.map +1 -0
- package/extensions/page-action-cache/dist/security-policy.js +219 -0
- package/extensions/page-action-cache/dist/security-policy.js.map +1 -0
- package/extensions/page-action-cache/dist/tools.d.ts +209 -0
- package/extensions/page-action-cache/dist/tools.d.ts.map +1 -0
- package/extensions/page-action-cache/dist/tools.js +383 -0
- package/extensions/page-action-cache/dist/tools.js.map +1 -0
- package/extensions/page-action-cache/dist/types.d.ts +336 -0
- package/extensions/page-action-cache/dist/types.d.ts.map +1 -0
- package/extensions/page-action-cache/dist/types.js +8 -0
- package/extensions/page-action-cache/dist/types.js.map +1 -0
- package/extensions/page-action-cache/dist/ux-enhancer.d.ts +60 -0
- package/extensions/page-action-cache/dist/ux-enhancer.d.ts.map +1 -0
- package/extensions/page-action-cache/dist/ux-enhancer.js +218 -0
- package/extensions/page-action-cache/dist/ux-enhancer.js.map +1 -0
- package/extensions/page-action-cache/dist/variable-resolver.d.ts +28 -0
- package/extensions/page-action-cache/dist/variable-resolver.d.ts.map +1 -0
- package/extensions/page-action-cache/dist/variable-resolver.js +201 -0
- package/extensions/page-action-cache/dist/variable-resolver.js.map +1 -0
- package/extensions/page-action-cache/docs/API.md +555 -0
- package/extensions/page-action-cache/docs/IMPLEMENTATION.md +1792 -0
- package/extensions/page-action-cache/docs/INTEGRATION.md +387 -0
- package/extensions/page-action-cache/docs/README.md +183 -0
- package/extensions/page-action-cache/index.ts +118 -0
- package/extensions/page-action-cache/node_modules/.bin/nlc +21 -0
- package/extensions/page-action-cache/node_modules/.bin/node-llama-cpp +21 -0
- package/extensions/page-action-cache/node_modules/.bin/openclaw +21 -0
- package/extensions/page-action-cache/node_modules/.bin/tsc +21 -0
- package/extensions/page-action-cache/node_modules/.bin/tsserver +21 -0
- package/extensions/page-action-cache/node_modules/.bin/vitest +21 -0
- package/extensions/page-action-cache/openclaw.plugin.json +208 -0
- package/extensions/page-action-cache/package.json +76 -0
- package/extensions/page-action-cache/scripts/npm_publish.sh +80 -0
- package/extensions/page-action-cache/skills/page-action-cache/SKILL.md +216 -0
- package/extensions/page-action-cache/src/actions-executor.ts +441 -0
- package/extensions/page-action-cache/src/cache-invalidator.ts +271 -0
- package/extensions/page-action-cache/src/cache-store.ts +457 -0
- package/extensions/page-action-cache/src/cache-strategy.ts +327 -0
- package/extensions/page-action-cache/src/hooks-entry.ts +114 -0
- package/extensions/page-action-cache/src/hooks.ts +332 -0
- package/extensions/page-action-cache/src/index.ts +104 -0
- package/extensions/page-action-cache/src/scenario-recognizer.ts +259 -0
- package/extensions/page-action-cache/src/security-policy.ts +268 -0
- package/extensions/page-action-cache/src/tools.ts +437 -0
- package/extensions/page-action-cache/src/types.ts +482 -0
- package/extensions/page-action-cache/src/ux-enhancer.ts +266 -0
- package/extensions/page-action-cache/src/variable-resolver.ts +258 -0
- package/extensions/page-action-cache/tests/actions-executor.test.ts +424 -0
- package/extensions/page-action-cache/tests/cache-store.test.ts +267 -0
- package/extensions/page-action-cache/tests/integration-test.ts +62 -0
- package/extensions/page-action-cache/tests/scenario-recognizer.test.ts +140 -0
- package/extensions/page-action-cache/tests/variable-resolver.test.ts +187 -0
- package/extensions/page-action-cache/tsconfig.json +39 -0
- package/package.json +1 -1
- package/scripts/create-instance.sh +26 -8
- package/scripts/npm_publish.sh +59 -1
- package/scripts/publish-extension.sh +343 -0
- package/ui/node_modules/.bin/vite +2 -2
- package/ui/node_modules/.bin/vitest +2 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node-llama-cpp@3.16.2_typescript@5.9.3/node_modules/node-llama-cpp/dist/cli/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node-llama-cpp@3.16.2_typescript@5.9.3/node_modules/node-llama-cpp/dist/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node-llama-cpp@3.16.2_typescript@5.9.3/node_modules/node-llama-cpp/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node-llama-cpp@3.16.2_typescript@5.9.3/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node-llama-cpp@3.16.2_typescript@5.9.3/node_modules/node-llama-cpp/dist/cli/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node-llama-cpp@3.16.2_typescript@5.9.3/node_modules/node-llama-cpp/dist/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node-llama-cpp@3.16.2_typescript@5.9.3/node_modules/node-llama-cpp/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node-llama-cpp@3.16.2_typescript@5.9.3/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/node-llama-cpp@3.16.2_typescript@5.9.3/node_modules/node-llama-cpp/dist/cli/cli.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../../node_modules/.pnpm/node-llama-cpp@3.16.2_typescript@5.9.3/node_modules/node-llama-cpp/dist/cli/cli.js" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node-llama-cpp@3.16.2_typescript@5.9.3/node_modules/node-llama-cpp/dist/cli/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node-llama-cpp@3.16.2_typescript@5.9.3/node_modules/node-llama-cpp/dist/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node-llama-cpp@3.16.2_typescript@5.9.3/node_modules/node-llama-cpp/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node-llama-cpp@3.16.2_typescript@5.9.3/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node-llama-cpp@3.16.2_typescript@5.9.3/node_modules/node-llama-cpp/dist/cli/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node-llama-cpp@3.16.2_typescript@5.9.3/node_modules/node-llama-cpp/dist/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node-llama-cpp@3.16.2_typescript@5.9.3/node_modules/node-llama-cpp/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node-llama-cpp@3.16.2_typescript@5.9.3/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/node-llama-cpp@3.16.2_typescript@5.9.3/node_modules/node-llama-cpp/dist/cli/cli.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../../../../node_modules/.pnpm/node-llama-cpp@3.16.2_typescript@5.9.3/node_modules/node-llama-cpp/dist/cli/cli.js" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/openclaw@2026.3.13_@napi-rs+canvas@0.1.96_@types+express@5.0.6_node-llama-cpp@3.16.2_typescript@5.9.3_/node_modules/openclaw/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/openclaw@2026.3.13_@napi-rs+canvas@0.1.96_@types+express@5.0.6_node-llama-cpp@3.16.2_typescript@5.9.3_/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/openclaw@2026.3.13_@napi-rs+canvas@0.1.96_@types+express@5.0.6_node-llama-cpp@3.16.2_typescript@5.9.3_/node_modules/openclaw/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/openclaw@2026.3.13_@napi-rs+canvas@0.1.96_@types+express@5.0.6_node-llama-cpp@3.16.2_typescript@5.9.3_/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../openclaw/openclaw.mjs" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../openclaw/openclaw.mjs" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../typescript/bin/tsc" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/typescript@5.9.3/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../typescript/bin/tsserver" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/vitest@1.6.1_@types+node@20.19.37/node_modules/vitest/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/vitest@1.6.1_@types+node@20.19.37/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/vitest@1.6.1_@types+node@20.19.37/node_modules/vitest/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/vitest@1.6.1_@types+node@20.19.37/node_modules:/Users/zhoujinyu/Documents/projects/repo/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../vitest/vitest.mjs" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../vitest/vitest.mjs" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "page-action-cache",
|
|
3
|
+
"name": "Page Action Cache",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "Caches LLM browser operations to avoid re-analyzing the same DOM. Reduces token consumption and operation latency through scenario recognition (login, search, payment, etc.) and multi-level caching (L3/L2/L1).",
|
|
6
|
+
"author": "OpenClaw",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"kind": "extension",
|
|
9
|
+
"main": "./src/hooks-entry.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./src/index.js",
|
|
12
|
+
"./hooks-entry": "./src/hooks-entry.js"
|
|
13
|
+
},
|
|
14
|
+
"configSchema": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"additionalProperties": false,
|
|
17
|
+
"properties": {
|
|
18
|
+
"enabled": {
|
|
19
|
+
"type": "boolean",
|
|
20
|
+
"default": true,
|
|
21
|
+
"description": "Enable or disable the page action cache extension"
|
|
22
|
+
},
|
|
23
|
+
"autoUseCache": {
|
|
24
|
+
"type": "boolean",
|
|
25
|
+
"default": true,
|
|
26
|
+
"description": "Automatically use cached actions when available"
|
|
27
|
+
},
|
|
28
|
+
"scenarioRecognitionEnabled": {
|
|
29
|
+
"type": "boolean",
|
|
30
|
+
"default": true,
|
|
31
|
+
"description": "Enable automatic scenario recognition (login, search, checkout, etc.)"
|
|
32
|
+
},
|
|
33
|
+
"llmClassificationThreshold": {
|
|
34
|
+
"type": "number",
|
|
35
|
+
"default": 70,
|
|
36
|
+
"minimum": 0,
|
|
37
|
+
"maximum": 100,
|
|
38
|
+
"description": "Confidence threshold for LLM-based scenario classification (0-100)"
|
|
39
|
+
},
|
|
40
|
+
"cacheLevelStrategy": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"enum": ["auto", "l3-only", "l2-only", "l1-only"],
|
|
43
|
+
"default": "auto",
|
|
44
|
+
"description": "Cache level strategy: auto (default), l3-only (scenario-level only), l2-only (flow-level only), l1-only (atomic-level only)"
|
|
45
|
+
},
|
|
46
|
+
"defaultCacheLevel": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"enum": ["L3", "L2", "L1"],
|
|
49
|
+
"default": "L3",
|
|
50
|
+
"description": "Default cache level when no scenario is recognized"
|
|
51
|
+
},
|
|
52
|
+
"pageChangeDetectionEnabled": {
|
|
53
|
+
"type": "boolean",
|
|
54
|
+
"default": true,
|
|
55
|
+
"description": "Enable automatic page change detection to invalidate stale caches"
|
|
56
|
+
},
|
|
57
|
+
"changeInvalidationThreshold": {
|
|
58
|
+
"type": "number",
|
|
59
|
+
"default": 80,
|
|
60
|
+
"minimum": 0,
|
|
61
|
+
"maximum": 100,
|
|
62
|
+
"description": "Page change confidence threshold for cache invalidation (0-100)"
|
|
63
|
+
},
|
|
64
|
+
"invalidationStrategy": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"enum": ["soft", "hard"],
|
|
67
|
+
"default": "soft",
|
|
68
|
+
"description": "Cache invalidation strategy: soft (mark stale, allow override) or hard (immediately delete)"
|
|
69
|
+
},
|
|
70
|
+
"variableExtractionEnabled": {
|
|
71
|
+
"type": "boolean",
|
|
72
|
+
"default": true,
|
|
73
|
+
"description": "Enable automatic variable extraction from user input (username, password, etc.)"
|
|
74
|
+
},
|
|
75
|
+
"allowUserConfirmVariables": {
|
|
76
|
+
"type": "boolean",
|
|
77
|
+
"default": false,
|
|
78
|
+
"description": "Allow user confirmation for extracted variables before execution"
|
|
79
|
+
},
|
|
80
|
+
"encryptSensitiveCache": {
|
|
81
|
+
"type": "boolean",
|
|
82
|
+
"default": false,
|
|
83
|
+
"description": "Encrypt sensitive cache entries (passwords, tokens) using AES-256-GCM"
|
|
84
|
+
},
|
|
85
|
+
"accessControlEnabled": {
|
|
86
|
+
"type": "boolean",
|
|
87
|
+
"default": false,
|
|
88
|
+
"description": "Enable access control for sensitive cache operations"
|
|
89
|
+
},
|
|
90
|
+
"logSanitizationEnabled": {
|
|
91
|
+
"type": "boolean",
|
|
92
|
+
"default": true,
|
|
93
|
+
"description": "Automatically redact sensitive data from logs"
|
|
94
|
+
},
|
|
95
|
+
"showCacheStatusToUser": {
|
|
96
|
+
"type": "boolean",
|
|
97
|
+
"default": true,
|
|
98
|
+
"description": "Display cache hit/miss status to users"
|
|
99
|
+
},
|
|
100
|
+
"enableUserCacheConfirmation": {
|
|
101
|
+
"type": "boolean",
|
|
102
|
+
"default": false,
|
|
103
|
+
"description": "Require user confirmation before using cached actions"
|
|
104
|
+
},
|
|
105
|
+
"enableUserForcedRefresh": {
|
|
106
|
+
"type": "boolean",
|
|
107
|
+
"default": true,
|
|
108
|
+
"description": "Allow users to force refresh specific cache entries"
|
|
109
|
+
},
|
|
110
|
+
"enableUserCacheErrorReport": {
|
|
111
|
+
"type": "boolean",
|
|
112
|
+
"default": true,
|
|
113
|
+
"description": "Enable user reporting of cache execution errors"
|
|
114
|
+
},
|
|
115
|
+
"trackExecutionStats": {
|
|
116
|
+
"type": "boolean",
|
|
117
|
+
"default": true,
|
|
118
|
+
"description": "Track execution statistics (hit rate, saved tokens, saved time)"
|
|
119
|
+
},
|
|
120
|
+
"statsUpdateInterval": {
|
|
121
|
+
"type": "number",
|
|
122
|
+
"default": 60,
|
|
123
|
+
"minimum": 10,
|
|
124
|
+
"description": "Statistics update interval in seconds (minimum 10)"
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"uiHints": {
|
|
129
|
+
"enabled": {
|
|
130
|
+
"label": "Enable Cache Extension",
|
|
131
|
+
"description": "Enable or disable the page action cache extension"
|
|
132
|
+
},
|
|
133
|
+
"autoUseCache": {
|
|
134
|
+
"label": "Auto Use Cache",
|
|
135
|
+
"description": "Automatically use cached actions when available"
|
|
136
|
+
},
|
|
137
|
+
"scenarioRecognitionEnabled": {
|
|
138
|
+
"label": "Scenario Recognition",
|
|
139
|
+
"description": "Enable automatic scenario recognition (login, search, checkout, etc.)"
|
|
140
|
+
},
|
|
141
|
+
"cacheLevelStrategy": {
|
|
142
|
+
"label": "Cache Strategy",
|
|
143
|
+
"description": "Cache level strategy (auto, l3-only, l2-only, l1-only)"
|
|
144
|
+
},
|
|
145
|
+
"encryptSensitiveCache": {
|
|
146
|
+
"label": "Encrypt Sensitive Data",
|
|
147
|
+
"description": "Encrypt sensitive cache entries (passwords, tokens)",
|
|
148
|
+
"sensitive": false
|
|
149
|
+
},
|
|
150
|
+
"showCacheStatusToUser": {
|
|
151
|
+
"label": "Show Cache Status",
|
|
152
|
+
"description": "Display cache hit/miss status to users"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"tools": [
|
|
156
|
+
{
|
|
157
|
+
"name": "execute_cached",
|
|
158
|
+
"label": "Execute Cached Actions",
|
|
159
|
+
"description": "Execute cached page action sequences, skipping LLM analysis. Significantly reduces token consumption and operation latency."
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "cache_stats",
|
|
163
|
+
"label": "Cache Statistics",
|
|
164
|
+
"description": "View cache statistics including hit rate, saved tokens, and saved time."
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"name": "cache_list",
|
|
168
|
+
"label": "List Cache Entries",
|
|
169
|
+
"description": "List all cached page action entries with their metadata."
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "cache_clear",
|
|
173
|
+
"label": "Clear Cache",
|
|
174
|
+
"description": "Clear all cached page action entries."
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"name": "scenario_list",
|
|
178
|
+
"label": "List Scenarios",
|
|
179
|
+
"description": "List all recognized scenarios with their match patterns."
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"name": "force_refresh",
|
|
183
|
+
"label": "Force Refresh Cache",
|
|
184
|
+
"description": "Force refresh a specific cache entry by URL and viewport."
|
|
185
|
+
}
|
|
186
|
+
],
|
|
187
|
+
"hooks": [
|
|
188
|
+
{
|
|
189
|
+
"name": "before_tool_call",
|
|
190
|
+
"description": "Scenario recognition and cache interception"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"name": "after_tool_call",
|
|
194
|
+
"description": "Save LLM analysis results to cache"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"name": "before_prompt_build",
|
|
198
|
+
"description": "Inject cache usage guide into prompts"
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
"runtime": {
|
|
202
|
+
"node": ">=18.0.0"
|
|
203
|
+
},
|
|
204
|
+
"openclaw": {
|
|
205
|
+
"minVersion": "2026.2.0",
|
|
206
|
+
"extensions": ["./src/hooks-entry.js"]
|
|
207
|
+
}
|
|
208
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openclaw/page-action-cache",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Page action caching extension for OpenClaw - caches LLM browser operations to avoid re-analyzing the same DOM",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"automation",
|
|
7
|
+
"browser",
|
|
8
|
+
"cache",
|
|
9
|
+
"extension",
|
|
10
|
+
"openclaw"
|
|
11
|
+
],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"author": "OpenClaw",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/openclaw/openclaw.git",
|
|
17
|
+
"directory": "extensions/page-action-cache"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"index.ts",
|
|
21
|
+
"dist/",
|
|
22
|
+
"src/",
|
|
23
|
+
"skills/",
|
|
24
|
+
"docs/",
|
|
25
|
+
"package.json",
|
|
26
|
+
"openclaw.plugin.json"
|
|
27
|
+
],
|
|
28
|
+
"type": "module",
|
|
29
|
+
"main": "src/hooks-entry.js",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./src/index.d.ts",
|
|
33
|
+
"default": "./src/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./hooks-entry": {
|
|
36
|
+
"types": "./src/hooks-entry.d.ts",
|
|
37
|
+
"default": "./src/hooks-entry.js"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "tsc",
|
|
42
|
+
"publish:npm": "./scripts/npm_publish.sh",
|
|
43
|
+
"test": "vitest",
|
|
44
|
+
"typecheck": "tsc --noEmit"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/node": "^20.0.0",
|
|
48
|
+
"typescript": "^5.0.0",
|
|
49
|
+
"vitest": "^1.0.0"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"openclaw": ">=2026.2.0"
|
|
53
|
+
},
|
|
54
|
+
"peerDependenciesMeta": {
|
|
55
|
+
"openclaw": {
|
|
56
|
+
"optional": true
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"config": {
|
|
60
|
+
"test": {
|
|
61
|
+
"include": [
|
|
62
|
+
"tests/**/*.test.ts"
|
|
63
|
+
],
|
|
64
|
+
"exclude": [
|
|
65
|
+
"node_modules",
|
|
66
|
+
"dist",
|
|
67
|
+
"**/node_modules/**"
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"openclaw": {
|
|
72
|
+
"extensions": [
|
|
73
|
+
"./src/hooks-entry.js"
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# npm 发布脚本 - 处理工作区依赖问题
|
|
3
|
+
# 解决 npm 不支持 workspace:* 协议的问题
|
|
4
|
+
|
|
5
|
+
set -e
|
|
6
|
+
|
|
7
|
+
# 获取脚本所在目录
|
|
8
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
9
|
+
PROJECT_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")"
|
|
10
|
+
PLUGIN_DIR="$PROJECT_ROOT/extensions/page-action-cache"
|
|
11
|
+
|
|
12
|
+
echo "📦 准备发布 @openclaw/page-action-cache"
|
|
13
|
+
echo "📍 插件目录: $PLUGIN_DIR"
|
|
14
|
+
|
|
15
|
+
# 切换到插件目录
|
|
16
|
+
cd "$PLUGIN_DIR"
|
|
17
|
+
|
|
18
|
+
# 创建临时 package.json 用于发布
|
|
19
|
+
TMP_PACKAGE_JSON="/tmp/package-publish-$(date +%s).json"
|
|
20
|
+
cp package.json "$TMP_PACKAGE_JSON"
|
|
21
|
+
|
|
22
|
+
# 移除工作区依赖(npm 不支持 workspace:*)
|
|
23
|
+
echo "🔧 处理 package.json..."
|
|
24
|
+
node -e "
|
|
25
|
+
const pkg = JSON.parse(require('fs').readFileSync('$TMP_PACKAGE_JSON', 'utf8'));
|
|
26
|
+
// 移除 workspace:* 依赖
|
|
27
|
+
delete pkg.dependencies;
|
|
28
|
+
// 保留 peerDependencies
|
|
29
|
+
pkg.peerDependencies = pkg.peerDependencies || {};
|
|
30
|
+
require('fs').writeFileSync('$TMP_PACKAGE_JSON', JSON.stringify(pkg, null, 2));
|
|
31
|
+
"
|
|
32
|
+
|
|
33
|
+
echo "✅ 已处理 package.json(移除 workspace 依赖)"
|
|
34
|
+
|
|
35
|
+
# 构建插件
|
|
36
|
+
echo "🔨 构建插件..."
|
|
37
|
+
pnpm build
|
|
38
|
+
|
|
39
|
+
# 复制处理后的 package.json 到构建目录
|
|
40
|
+
echo "📋 复制 package.json..."
|
|
41
|
+
cp "$TMP_PACKAGE_JSON" package.json
|
|
42
|
+
|
|
43
|
+
# 清理旧的 dist 目录
|
|
44
|
+
echo "🧹 清理旧的构建..."
|
|
45
|
+
rm -rf dist
|
|
46
|
+
|
|
47
|
+
# 重新构建
|
|
48
|
+
echo "🔨 重新构建..."
|
|
49
|
+
pnpm build
|
|
50
|
+
|
|
51
|
+
# 检查构建结果
|
|
52
|
+
if [ ! -d "dist" ]; then
|
|
53
|
+
echo "❌ 构建失败:dist 目录不存在"
|
|
54
|
+
exit 1
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
echo "✅ 构建成功"
|
|
58
|
+
|
|
59
|
+
# 发布到 npm(不检查登录状态,避免触发 npm 操作)
|
|
60
|
+
echo "🚀 发布到 npm..."
|
|
61
|
+
echo "💡 提示:如果未登录 npm,请先运行 npm login"
|
|
62
|
+
npm publish --access public
|
|
63
|
+
|
|
64
|
+
# 检查发布是否成功
|
|
65
|
+
if [ $? -eq 0 ]; then
|
|
66
|
+
echo "✅ 发布成功!"
|
|
67
|
+
# 恢复原始 package.json
|
|
68
|
+
echo "🔄 恢复原始 package.json..."
|
|
69
|
+
git checkout package.json 2>/dev/null || true
|
|
70
|
+
else
|
|
71
|
+
echo "❌ 发布失败,请检查上面的错误信息"
|
|
72
|
+
# 恢复原始 package.json
|
|
73
|
+
echo "🔄 恢复原始 package.json..."
|
|
74
|
+
git checkout package.json 2>/dev/null || true
|
|
75
|
+
fi
|
|
76
|
+
|
|
77
|
+
# 清理临时文件
|
|
78
|
+
rm -f "$TMP_PACKAGE_JSON"
|
|
79
|
+
|
|
80
|
+
echo "📋 发布流程结束"
|