openclaw-multi-auto 1.5.1 → 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/{accounts-L9ByEpnP.js → accounts-C9HcPI9h.js} +2 -2
- package/dist/{accounts-BOzyfwW4.js → accounts-C_lW3Ag9.js} +2 -2
- package/dist/{accounts-yfBeCZtS.js → accounts-Tgelvk0C.js} +17 -17
- package/dist/{active-listener-D1yqT1cw.js → active-listener-BEdprTkn.js} +2 -2
- package/dist/{api-key-rotation-DtsNS2Nb.js → api-key-rotation-BJpKWXy0.js} +2 -2
- package/dist/{audio-preflight-DoPfNXDz.js → audio-preflight-BMvgEQ5j.js} +32 -32
- 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/{audio-transcription-runner-CzjuH3uL.js → audio-transcription-runner-gLFfz8fr.js} +12 -12
- package/dist/{audit-membership-runtime-DWyHWAHM.js → audit-membership-runtime-Dntemq07.js} +4 -4
- package/dist/build-info.json +3 -3
- package/dist/bundled/boot-md/handler.js +51 -51
- package/dist/bundled/bootstrap-extra-files/handler.js +6 -6
- package/dist/bundled/command-logger/handler.js +2 -2
- package/dist/bundled/session-memory/handler.js +51 -51
- package/dist/canvas-host/a2ui/.bundle.hash +1 -1
- package/dist/{channel-activity-xHOMiarp.js → channel-activity-BDnjYF7B.js} +3 -3
- package/dist/{chrome-D45SyhQL.js → chrome-CMU2WVFh.js} +8 -8
- package/dist/{chrome-DlhJHqj8.js → chrome-DxxEKrY7.js} +26 -26
- package/dist/{commands-registry-V1zZ5pPC.js → commands-registry-D5qXbFJn.js} +4 -4
- package/dist/{deliver-B9cys0EZ.js → deliver-BXVcFIHL.js} +1 -1
- package/dist/{deliver-CApVJA_l.js → deliver-DbdywYJE.js} +21 -21
- package/dist/deliver-runtime-BFs7iAZF.js +36 -0
- package/dist/{deliver-runtime-DhaQJ0pI.js → deliver-runtime-DTaIS-1i.js} +3 -3
- package/dist/deps-send-discord.runtime-DZUccI6Z.js +26 -0
- package/dist/deps-send-imessage.runtime-CF3OpoqY.js +25 -0
- package/dist/deps-send-signal.runtime-Cw4-ozeO.js +24 -0
- package/dist/deps-send-slack.runtime-BDsDhS1P.js +22 -0
- package/dist/deps-send-telegram.runtime-D_4xVasO.js +27 -0
- package/dist/{deps-send-whatsapp.runtime-DvTL2tzN.js → deps-send-whatsapp.runtime-CIZqFAqb.js} +7 -7
- package/dist/deps-send-whatsapp.runtime-DK8jqd14.js +60 -0
- package/dist/{diagnostic-Bn4PZjMZ.js → diagnostic-Co6Kghr-.js} +2 -2
- package/dist/{errors-CCLeFWAg.js → errors-xt401nuk.js} +1 -1
- package/dist/extensionAPI.js +6 -6
- package/dist/{fetch-BlJWzEP6.js → fetch-DuraYswo.js} +5 -5
- package/dist/{fetch-guard-ChYBwfiy.js → fetch-guard-DWr0d00H.js} +2 -2
- package/dist/{frontmatter-CvaMP376.js → frontmatter-BkTfEZ93.js} +3 -3
- package/dist/{fs-safe-0jAo_Whb.js → fs-safe-CTYUrIgQ.js} +4 -4
- package/dist/{github-copilot-token-D13V9YBz.js → github-copilot-token-BDioPmd6.js} +7 -7
- package/dist/{image-DAOPwVXi.js → image-BCVLo0qw.js} +1 -1
- package/dist/{image-B3Mz7N5I.js → image-eT7Y-nP5.js} +6 -6
- package/dist/{image-ops-CehkHxmW.js → image-ops-BuUnEOE0.js} +2 -2
- package/dist/image-runtime-BcAK3n8a.js +29 -0
- package/dist/{image-runtime-wlCLVvVv.js → image-runtime-DtCKpMPZ.js} +3 -3
- package/dist/{ir-DAP-B-Xw.js → ir-B83looB-.js} +8 -8
- package/dist/{legacy-names-TyzbVqa_.js → legacy-names-DOC03BkU.js} +1 -1
- package/dist/llm-slug-generator.js +51 -51
- package/dist/{logger-DMZQQtxK.js → logger-BfjWMCSD.js} +7 -7
- package/dist/{login-DiCctRo1.js → login-CrIwcrVI.js} +5 -5
- package/dist/{login-qr-MUbXgjtd.js → login-qr-BpPDZdl_.js} +10 -10
- package/dist/{manager-BW_NSIMl.js → manager-1bvuGrNR.js} +13 -13
- package/dist/manager-runtime-FO1Sx3W8.js +18 -0
- package/dist/{model-selection-idoqPmw0.js → model-selection-Dna0Gz1k.js} +43 -43
- package/dist/{outbound-C2kanETZ.js → outbound-ChDjtuD6.js} +6 -6
- package/dist/{outbound-attachment-DBrYWX8h.js → outbound-attachment-DqHlD21U.js} +2 -2
- package/dist/{path-alias-guards-DqXRZmsL.js → path-alias-guards-BzvdLvTI.js} +1 -1
- package/dist/{paths-CCxysrzL.js → paths-Bkr-BCxW.js} +4 -4
- package/dist/{paths-C6TxBCvO.js → paths-Cvc9EM8Y.js} +5 -5
- package/dist/{pi-embedded-bcjMe3wj.js → pi-embedded-BQQa91aA.js} +167 -167
- package/dist/{pi-embedded-DYU79yGe.js → pi-embedded-CgQ_W6Xs.js} +24 -24
- package/dist/{pi-embedded-helpers-D5yyGEvA.js → pi-embedded-helpers-CLXm10bV.js} +52 -52
- package/dist/{pi-embedded-helpers-uTRAmQ4n.js → pi-embedded-helpers-CwuBTKza.js} +3 -3
- package/dist/{pi-model-discovery-BGgOlX8N.js → pi-model-discovery-Dymwdjt0.js} +7 -7
- package/dist/pi-model-discovery-runtime-BeY4EUPp.js +11 -0
- package/dist/{pi-tools.before-tool-call.runtime-BuLxSyx9.js → pi-tools.before-tool-call.runtime-Cwab_5W1.js} +9 -9
- package/dist/plugin-sdk/{accounts-C3m65--E.js → accounts-BJAXxY46.js} +2 -2
- package/dist/plugin-sdk/{accounts-CNCCkdEF.js → accounts-C1j7HSL0.js} +3 -3
- package/dist/plugin-sdk/{accounts-BslAlVYS.js → accounts-DyFCXtHv.js} +2 -2
- package/dist/plugin-sdk/{active-listener-CkPnMUkB.js → active-listener-CftX5jLD.js} +2 -2
- package/dist/plugin-sdk/{api-key-rotation-BXnNsojA.js → api-key-rotation-8nyyt1kx.js} +2 -2
- package/dist/plugin-sdk/{audio-preflight-CtO4fFvp.js → audio-preflight-C_aSAPR1.js} +26 -26
- package/dist/plugin-sdk/{audio-transcription-runner-DnxvOS1-.js → audio-transcription-runner-CB53F7_7.js} +11 -11
- package/dist/plugin-sdk/{audit-membership-runtime-BpfoSk8M.js → audit-membership-runtime-BXndI4LG.js} +2 -2
- package/dist/plugin-sdk/{channel-activity-WJYxcJ3S.js → channel-activity-C5y8AgAV.js} +3 -3
- package/dist/plugin-sdk/{channel-web-dO5k3ubM.js → channel-web-DBTRO03V.js} +18 -18
- package/dist/plugin-sdk/{chrome-CjNTuJML.js → chrome-f00sZkDX.js} +6 -6
- package/dist/plugin-sdk/{commands-registry-CdYjoI0i.js → commands-registry-BJ_NxG2F.js} +4 -4
- package/dist/plugin-sdk/{common-oYc5vPFl.js → common-Cf27Jwxu.js} +2 -2
- package/dist/plugin-sdk/{config-B1z-UxQ3.js → config-CHQrpx-Q.js} +7 -7
- package/dist/plugin-sdk/{deliver-D5_6T567.js → deliver-DNEuetST.js} +10 -10
- package/dist/plugin-sdk/deliver-runtime-BFdqklJM.js +32 -0
- package/dist/plugin-sdk/deps-send-discord.runtime-DuqpYwU0.js +23 -0
- package/dist/plugin-sdk/deps-send-imessage.runtime-CZ2rS8Lb.js +22 -0
- package/dist/plugin-sdk/deps-send-signal.runtime-BdqiWhIh.js +21 -0
- package/dist/plugin-sdk/deps-send-slack.runtime-04s36qiC.js +19 -0
- package/dist/plugin-sdk/deps-send-telegram.runtime-LE5tkPvr.js +24 -0
- package/dist/plugin-sdk/deps-send-whatsapp.runtime-Bz57lobC.js +57 -0
- package/dist/plugin-sdk/{diagnostic-Bxxu0ig-.js → diagnostic-LYUUmjJ5.js} +2 -2
- package/dist/plugin-sdk/{errors-B3cHyZZA.js → errors-CtMWwS2Z.js} +1 -1
- package/dist/plugin-sdk/{fetch-guard-Dcgod0tg.js → fetch-guard-CxYB5Kg6.js} +2 -2
- package/dist/plugin-sdk/{fs-safe-BaKqI3G4.js → fs-safe-DtfhxbrI.js} +3 -3
- package/dist/plugin-sdk/{image-B2mQW9Rb.js → image-BwjYjRHx.js} +6 -6
- package/dist/plugin-sdk/{image-ops-Cbzr4U9l.js → image-ops-BnZKcbd6.js} +2 -2
- package/dist/plugin-sdk/image-runtime-B8twoubs.js +25 -0
- package/dist/plugin-sdk/{ir-ZEmrTr4J.js → ir-Z4hX67TJ.js} +7 -7
- package/dist/plugin-sdk/{local-roots-CIPRxA-4.js → local-roots-KhjQw04O.js} +4 -4
- package/dist/plugin-sdk/{logger-CvPFVOgT.js → logger-DHIIvMxj.js} +2 -2
- package/dist/plugin-sdk/{login-CCTew9bt.js → login-C31642Ld.js} +4 -4
- package/dist/plugin-sdk/{login-qr-BI3Vi_wJ.js → login-qr--y2SG_Ue.js} +5 -5
- package/dist/plugin-sdk/{manager-BEoYPn7R.js → manager-2UZBMCc7.js} +8 -8
- package/dist/plugin-sdk/manager-runtime-CMeLwose.js +15 -0
- package/dist/plugin-sdk/mattermost.js +3 -3
- package/dist/plugin-sdk/{outbound-ByOw1K6W.js → outbound-Ba0QUI5h.js} +5 -5
- package/dist/plugin-sdk/{outbound-attachment-BzVhxRRw.js → outbound-attachment-B1Laso-8.js} +2 -2
- package/dist/plugin-sdk/{path-alias-guards-sWayacde.js → path-alias-guards-C7Vm5DZ1.js} +1 -1
- package/dist/plugin-sdk/{paths-Dpg3qxcl.js → paths-DopV9PQG.js} +1 -1
- package/dist/plugin-sdk/{pi-embedded-helpers-DIxXkGJf.js → pi-embedded-helpers-DnA_OCzP.js} +16 -16
- package/dist/plugin-sdk/{pi-model-discovery-DM_2uFtj.js → pi-model-discovery-DdPqXk8f.js} +1 -1
- package/dist/plugin-sdk/pi-model-discovery-runtime-D8CJhtJY.js +8 -0
- package/dist/plugin-sdk/{pi-tools.before-tool-call.runtime-w1dqL_ty.js → pi-tools.before-tool-call.runtime-DxFHiLUE.js} +4 -4
- package/dist/plugin-sdk/{plugins-C4USiH29.js → plugins-CbCt4osF.js} +4 -4
- package/dist/plugin-sdk/{proxy-env-ET-rp8eg.js → proxy-env-C63mMdas.js} +1 -1
- package/dist/{proxy-fetch-CCjEYbFm.js → plugin-sdk/proxy-fetch-Ch95c_Y2.js} +1 -1
- package/dist/plugin-sdk/{pw-ai-CyOt3RDA.js → pw-ai-DpJk62D4.js} +9 -9
- package/dist/plugin-sdk/{qmd-manager-BySdoVR7.js → qmd-manager-Ca-iSfEE.js} +7 -7
- package/dist/plugin-sdk/{query-expansion-C6uS-7lj.js → query-expansion-B_Xe41Ab.js} +4 -4
- package/dist/plugin-sdk/{redact-Bvxt1T_Q.js → redact-hp9TOulW.js} +1 -1
- package/dist/plugin-sdk/{reply-CTCSeQqW.js → reply-CovBlFea.js} +73 -73
- package/dist/plugin-sdk/{resolve-outbound-target-Bw8YNANu.js → resolve-outbound-target-BbrHgyUk.js} +2 -2
- package/dist/plugin-sdk/{run-with-concurrency-C_KCHwvf.js → run-with-concurrency-BR1DXa8T.js} +1 -1
- package/dist/plugin-sdk/runtime-whatsapp-login.runtime-SkO91TZH.js +10 -0
- package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-B0VWK5hm.js +19 -0
- package/dist/plugin-sdk/{send-C0w6xP2x.js → send-BTztm3D2.js} +6 -6
- package/dist/plugin-sdk/{send-qPyNGSe4.js → send-BXpXBwM_.js} +13 -13
- package/dist/plugin-sdk/{send-BZ6nYFZr.js → send-BvAtLLPl.js} +5 -5
- package/dist/plugin-sdk/{send-CFf-1V89.js → send-CWJUuG0i.js} +8 -8
- package/dist/plugin-sdk/{send-CY-Qfwia.js → send-EcglC4cG.js} +7 -7
- package/dist/plugin-sdk/{session-COrvpvUQ.js → session-k256LJZT.js} +3 -3
- package/dist/plugin-sdk/{skill-commands-DZqhtmiv.js → skill-commands-DoRqLzxm.js} +4 -4
- package/dist/plugin-sdk/{skills-Cw_vXEJb.js → skills-QudILG6e.js} +6 -6
- package/dist/plugin-sdk/slash-commands.runtime-DS6vCNSL.js +13 -0
- package/dist/plugin-sdk/slash-dispatch.runtime-BXrxb2wd.js +52 -0
- package/dist/plugin-sdk/slash-skill-commands.runtime-Bd6qQ2oT.js +16 -0
- package/dist/plugin-sdk/{store-CMHj6IIw.js → store-BbDQw3g6.js} +2 -2
- package/dist/plugin-sdk/subagent-registry-runtime-1uwQbuXj.js +52 -0
- package/dist/plugin-sdk/{tables-CSqrHsKL.js → tables-BhvloMKN.js} +1 -1
- package/dist/plugin-sdk/{thinking-DOnsR_A8.js → thinking-URzkT-3p.js} +7 -7
- package/dist/plugin-sdk/{tokens-BDr0Z9o3.js → tokens-B1PW5Ayy.js} +1 -1
- package/dist/plugin-sdk/{tool-images-eEfOVkzf.js → tool-images-xpqbP6RR.js} +2 -2
- package/dist/plugin-sdk/web-B74yhL2N.js +56 -0
- package/dist/plugin-sdk/{whatsapp-actions-xcleMoMv.js → whatsapp-actions-RcZ6vp61.js} +17 -17
- package/dist/plugin-sdk/whatsapp.js +50 -50
- package/dist/{plugins-CWkRQYDj.js → plugins-4Rj4OjLY.js} +11 -11
- package/dist/{proxy-env-Cq5gdrbj.js → proxy-env-DlmzDx8x.js} +1 -1
- package/dist/{plugin-sdk/proxy-fetch-uDXGKG3Z.js → proxy-fetch-B2pEfjbR.js} +1 -1
- package/dist/{pw-ai-GcYO6HPE.js → pw-ai-CmphSzHx.js} +1 -1
- package/dist/{pw-ai-CDQDCfUa.js → pw-ai-DNMjFMqH.js} +14 -14
- package/dist/{qmd-manager-BsYsO9Ii.js → qmd-manager-BtIKUaO9.js} +10 -10
- package/dist/{query-expansion-DtLc3wjL.js → query-expansion-CX-1fS52.js} +6 -6
- package/dist/{redact-ClbcYG1J.js → redact-COik8ET1.js} +1 -1
- package/dist/{run-with-concurrency-D_ZpbgEG.js → run-with-concurrency-BgYfgkXT.js} +4 -4
- package/dist/runtime-whatsapp-login.runtime-DUb55byQ.js +13 -0
- package/dist/runtime-whatsapp-outbound.runtime-Bii_xSfI.js +22 -0
- package/dist/{send-Dx2RkUOZ.js → send-6lz6rNVP.js} +6 -6
- package/dist/{send-vmONuVgL.js → send-BHTiZcH3.js} +26 -26
- package/dist/{send-Bj776ESJ.js → send-L7gRiwyd.js} +7 -7
- package/dist/{send-DcxmcFi_.js → send-PE6cwoTe.js} +8 -8
- package/dist/{send-BQERFNyo.js → send-dfu6_rgf.js} +5 -5
- package/dist/{session-A4QhBRvH.js → session-D8ImowSs.js} +8 -8
- package/dist/{skill-commands-CMzBZKG2.js → skill-commands-DNqJ-kwn.js} +9 -9
- package/dist/{skills-CE_iqvM5.js → skills-7ODkHQYp.js} +22 -22
- package/dist/slash-commands.runtime-CVw6566g.js +16 -0
- package/dist/{slash-dispatch.runtime-Dh053pQK.js → slash-dispatch.runtime-131yup2e.js} +6 -6
- package/dist/slash-dispatch.runtime-B9Ygtzi4.js +56 -0
- package/dist/slash-skill-commands.runtime-DxZ4z5h6.js +20 -0
- package/dist/{store--eR1R_UX.js → store-D89wDcz9.js} +2 -2
- package/dist/subagent-registry-runtime-DL1Wv7nA.js +56 -0
- package/dist/{subagent-registry-runtime-DSi5mnCQ.js → subagent-registry-runtime-DbSf_Je6.js} +6 -6
- package/dist/{subsystem-Di1z8l0Z.js → subsystem-B45WV3qB.js} +14 -14
- package/dist/{tables-d739Y1xW.js → tables-mE4cJBN2.js} +1 -1
- package/dist/{target-errors-CBI2Ga0y.js → target-errors-mnlwhAjP.js} +2 -2
- package/dist/{thinking-DXYisHiZ.js → thinking-BeGmb5k6.js} +7 -7
- package/dist/{tokens-DxnY9ui_.js → tokens-q32vI39c.js} +1 -1
- package/dist/{tool-images-2cBx1W8h.js → tool-images-RZdHiZcG.js} +2 -2
- package/dist/{web-NWKn8ABz.js → web-Btj-e8kN.js} +55 -55
- package/dist/{web-1hWJDzNA.js → web-MR9d7KyB.js} +6 -6
- package/dist/{whatsapp-actions-iEArE_Ez.js → whatsapp-actions-BHbJJyqw.js} +21 -21
- package/dist/{workspace-CUVC6GX1.js → workspace-U-DyR64O.js} +20 -20
- 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/dist/deliver-runtime-D1z-h5eg.js +0 -36
- package/dist/deps-send-discord.runtime-DnbhTFX9.js +0 -26
- package/dist/deps-send-imessage.runtime-BOiQ6mDx.js +0 -25
- package/dist/deps-send-signal.runtime-CTcl388M.js +0 -24
- package/dist/deps-send-slack.runtime-CCqBz4Kg.js +0 -22
- package/dist/deps-send-telegram.runtime-DGSKTCpH.js +0 -27
- package/dist/deps-send-whatsapp.runtime-Dz_4fi2D.js +0 -60
- package/dist/image-runtime-DWjhow2W.js +0 -29
- package/dist/manager-runtime-BN6VevdC.js +0 -18
- package/dist/pi-model-discovery-runtime-Bwmi4Ev8.js +0 -11
- package/dist/plugin-sdk/deliver-runtime-C5dgvvga.js +0 -32
- package/dist/plugin-sdk/deps-send-discord.runtime-Dg4N7PHJ.js +0 -23
- package/dist/plugin-sdk/deps-send-imessage.runtime-0OEwzMQm.js +0 -22
- package/dist/plugin-sdk/deps-send-signal.runtime-BM1jRt3G.js +0 -21
- package/dist/plugin-sdk/deps-send-slack.runtime-1E3BYRdF.js +0 -19
- package/dist/plugin-sdk/deps-send-telegram.runtime-DNCxIflA.js +0 -24
- package/dist/plugin-sdk/deps-send-whatsapp.runtime-OLwr-9c8.js +0 -57
- package/dist/plugin-sdk/image-runtime-BFm45j49.js +0 -25
- package/dist/plugin-sdk/manager-runtime-DxclHQ4U.js +0 -15
- package/dist/plugin-sdk/pi-model-discovery-runtime-BuzvkvNR.js +0 -8
- package/dist/plugin-sdk/runtime-whatsapp-login.runtime-BxgRDkhc.js +0 -10
- package/dist/plugin-sdk/runtime-whatsapp-outbound.runtime-elOqrkfg.js +0 -19
- package/dist/plugin-sdk/slash-commands.runtime-D67JLweo.js +0 -13
- package/dist/plugin-sdk/slash-dispatch.runtime-DvcpvCJ0.js +0 -52
- package/dist/plugin-sdk/slash-skill-commands.runtime-BM1x3azR.js +0 -16
- package/dist/plugin-sdk/subagent-registry-runtime-1lbDyRzz.js +0 -52
- package/dist/plugin-sdk/web-BLyT64pW.js +0 -56
- package/dist/runtime-whatsapp-login.runtime-IeylZEl4.js +0 -13
- package/dist/runtime-whatsapp-outbound.runtime-ClBRuLsq.js +0 -22
- package/dist/slash-commands.runtime-Cpn2tYW4.js +0 -16
- package/dist/slash-dispatch.runtime-CWbpp23S.js +0 -56
- package/dist/slash-skill-commands.runtime-DKMvvdDW.js +0 -20
- package/dist/subagent-registry-runtime-DEVpAaAP.js +0 -56
- 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 -18
- package/extensions/page-action-cache/dist/hooks-entry.d.ts.map +0 -1
- package/extensions/page-action-cache/dist/hooks-entry.js +0 -27
- 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 -104
- 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,216 +0,0 @@
|
|
|
1
|
-
# 页面操作缓存扩展 - 使用指南
|
|
2
|
-
|
|
3
|
-
**版本**: 1.0.0
|
|
4
|
-
**更新日期**: 2026-03-13
|
|
5
|
-
|
|
6
|
-
## 概述
|
|
7
|
-
|
|
8
|
-
## 概述
|
|
9
|
-
|
|
10
|
-
本技能提供了页面操作缓存功能,可以缓存 LLM 分析浏览器页面后生成的操作序列。当再次访问相同页面时,直接使用缓存的操作,无需重新分析 DOM,大幅降低 token 消耗和操作延迟。
|
|
11
|
-
|
|
12
|
-
## 核心优势
|
|
13
|
-
|
|
14
|
-
- **节省 Token**: 避免每次操作都发送 DOM 给 LLM 分析
|
|
15
|
-
- **加速执行**: 跳过 LLM 分析,直接执行缓存的操作
|
|
16
|
-
- **智能匹配**: 多层场景识别(规则+LLM+历史)
|
|
17
|
-
- **安全可靠**: 自动检测页面变化,缓存失效
|
|
18
|
-
|
|
19
|
-
## 可用工具
|
|
20
|
-
|
|
21
|
-
### 1. execute_cached - 执行缓存操作
|
|
22
|
-
|
|
23
|
-
**用途**: 执行缓存的页面操作序列
|
|
24
|
-
|
|
25
|
-
**参数**:
|
|
26
|
-
- `cacheKey` (必需): 缓存键(从 cache_info 中获取)
|
|
27
|
-
- `fromIndex` (可选): 从第几个操作开始执行(默认 0)
|
|
28
|
-
- `toIndex` (可选): 执行到第几个操作(不指定则执行全部)
|
|
29
|
-
- `dryRun` (可选): 试运行模式,不实际执行
|
|
30
|
-
- `force` (可选): 强制执行(忽略页面变化检测)
|
|
31
|
-
|
|
32
|
-
**示例**:
|
|
33
|
-
```
|
|
34
|
-
使用缓存登录 example.com,cacheKey: abc123
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### 2. cache_stats - 查看缓存统计
|
|
38
|
-
|
|
39
|
-
**用途**: 查看缓存命中统计、节省的 token 等
|
|
40
|
-
|
|
41
|
-
**参数**: 无
|
|
42
|
-
|
|
43
|
-
**示例**:
|
|
44
|
-
```
|
|
45
|
-
查看缓存统计信息
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### 3. cache_list - 列出所有缓存
|
|
49
|
-
|
|
50
|
-
**用途**: 列出所有缓存条目及其详情
|
|
51
|
-
|
|
52
|
-
**参数**:
|
|
53
|
-
- `limit` (可选): 最多返回的条目数(默认 20)
|
|
54
|
-
- `filterScenario` (可选): 按场景过滤(如 login, checkout)
|
|
55
|
-
|
|
56
|
-
**示例**:
|
|
57
|
-
```
|
|
58
|
-
列出所有登录相关的缓存
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### 4. cache_clear - 清空缓存
|
|
62
|
-
|
|
63
|
-
**用途**: 清空缓存条目
|
|
64
|
-
|
|
65
|
-
**参数**:
|
|
66
|
-
- `scenario` (可选): 只清空指定场景的缓存
|
|
67
|
-
|
|
68
|
-
**示例**:
|
|
69
|
-
```
|
|
70
|
-
清空所有缓存
|
|
71
|
-
清空登录场景的缓存
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### 5. scenario_list - 列出所有场景
|
|
75
|
-
|
|
76
|
-
**用途**: 列出所有支持的缓存场景及其匹配规则
|
|
77
|
-
|
|
78
|
-
**参数**: 无
|
|
79
|
-
|
|
80
|
-
**示例**:
|
|
81
|
-
```
|
|
82
|
-
列出所有支持的缓存场景
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### 6. force_refresh - 强制刷新缓存
|
|
86
|
-
|
|
87
|
-
**用途**: 强制刷新指定页面的缓存
|
|
88
|
-
|
|
89
|
-
**参数**:
|
|
90
|
-
- `url` (必需): 页面 URL
|
|
91
|
-
- `viewport` (可选): 视口尺寸
|
|
92
|
-
|
|
93
|
-
**示例**:
|
|
94
|
-
```
|
|
95
|
-
强制刷新 example.com/login 的缓存
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## 使用流程
|
|
99
|
-
|
|
100
|
-
### 场景 1: 首次访问页面
|
|
101
|
-
|
|
102
|
-
```
|
|
103
|
-
用户: "登录 example.com"
|
|
104
|
-
↓
|
|
105
|
-
LLM: 分析页面 DOM,生成操作序列
|
|
106
|
-
↓
|
|
107
|
-
系统: 自动保存到缓存(L3 级)
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### 场景 2: 再次访问相同页面
|
|
111
|
-
|
|
112
|
-
```
|
|
113
|
-
用户: "登录 example.com"
|
|
114
|
-
↓
|
|
115
|
-
系统: 检测到缓存匹配(置信度 95%)
|
|
116
|
-
↓
|
|
117
|
-
LLM: 收到 cacheInfo,决定使用缓存
|
|
118
|
-
↓
|
|
119
|
-
系统: 使用 execute_cached 工具执行缓存操作
|
|
120
|
-
↓
|
|
121
|
-
结果: 节省 5000 tokens,加速 2 秒
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### 场景 3: 页面发生变化
|
|
125
|
-
|
|
126
|
-
```
|
|
127
|
-
用户: "登录 example.com"
|
|
128
|
-
↓
|
|
129
|
-
系统: 检测页面结构变化
|
|
130
|
-
↓
|
|
131
|
-
系统: 自动失效缓存
|
|
132
|
-
↓
|
|
133
|
-
LLM: 重新分析页面,生成新操作
|
|
134
|
-
↓
|
|
135
|
-
系统: 保存新的缓存
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
## 支持的场景
|
|
139
|
-
|
|
140
|
-
| 场景 | 关键词 | 缓存层级 |
|
|
141
|
-
|------|---------|---------|
|
|
142
|
-
| login | 登录、登陆、注册、sign in | L3 |
|
|
143
|
-
| logout | 退出、登出、注销、logout | L3 |
|
|
144
|
-
| search | 搜索、查找、search | L3 |
|
|
145
|
-
| checkout | 结账、结算、支付、checkout | L3 |
|
|
146
|
-
| settings | 设置、配置、修改 | L3 |
|
|
147
|
-
| form_fill | 填写、填表单、提交 | L2 |
|
|
148
|
-
| navigate | 打开、进入、跳转 | L2 |
|
|
149
|
-
| screenshot | 截图、screenshot | L1 |
|
|
150
|
-
|
|
151
|
-
## 缓存层级
|
|
152
|
-
|
|
153
|
-
- **L3: 场景级** - 包含变量模板(如 username, password),高置信度时使用
|
|
154
|
-
- **L2: 流程级** - 固定操作序列,中等置信度时使用
|
|
155
|
-
- **L1: 原子级** - 单个操作,低置信度时使用
|
|
156
|
-
|
|
157
|
-
## 注意事项
|
|
158
|
-
|
|
159
|
-
1. **页面变化检测**: 系统会自动检测页面结构变化,如果检测到变化会自动失效缓存
|
|
160
|
-
2. **变量替换**: 支持变量模板(如 ${username}),执行时自动从用户输入提取
|
|
161
|
-
3. **敏感数据**: 密码等敏感数据会自动脱敏存储
|
|
162
|
-
4. **试运行**: 使用 dryRun 参数可以预览操作而不执行
|
|
163
|
-
5. **强制执行**: 使用 force 参数可以跳过页面变化检测(谨慎使用)
|
|
164
|
-
|
|
165
|
-
## 最佳实践
|
|
166
|
-
|
|
167
|
-
1. **优先使用缓存**: 当工具返回 cacheInfo 时,优先使用 execute_cached 工具
|
|
168
|
-
2. **检查命中统计**: 定期查看 cache_stats,了解缓存效果
|
|
169
|
-
3. **及时清理**: 使用 cache_clear 清理不再需要的缓存
|
|
170
|
-
4. **测试新功能**: 使用 dryRun 模式测试缓存操作
|
|
171
|
-
5. **处理变化**: 当页面变化导致操作失败时,使用 force_refresh 刷新缓存
|
|
172
|
-
|
|
173
|
-
## 故障排查
|
|
174
|
-
|
|
175
|
-
### 问题 1: 缓存未命中
|
|
176
|
-
|
|
177
|
-
**原因**:
|
|
178
|
-
- 首次访问该页面
|
|
179
|
-
- 缓存已过期
|
|
180
|
-
- 页面结构发生变化
|
|
181
|
-
|
|
182
|
-
**解决**:
|
|
183
|
-
- 使用 scenario_list 查看支持的场景
|
|
184
|
-
- 使用 cache_list 查看现有缓存
|
|
185
|
-
- 使用 force_refresh 强制刷新
|
|
186
|
-
|
|
187
|
-
### 问题 2: 缓存执行失败
|
|
188
|
-
|
|
189
|
-
**原因**:
|
|
190
|
-
- 页面结构发生变化
|
|
191
|
-
- 元素选择器失效
|
|
192
|
-
- 操作顺序错误
|
|
193
|
-
|
|
194
|
-
**解决**:
|
|
195
|
-
- 查看执行结果中的错误信息
|
|
196
|
-
- 使用 force_refresh 刷新缓存
|
|
197
|
-
- 调整操作序列
|
|
198
|
-
|
|
199
|
-
### 问题 3: 变量未替换
|
|
200
|
-
|
|
201
|
-
**原因**:
|
|
202
|
-
- 用户输入中不包含变量值
|
|
203
|
-
- 变量名不匹配
|
|
204
|
-
|
|
205
|
-
**解决**:
|
|
206
|
-
- 确保用户输入包含变量值(如 "用户名 alice")
|
|
207
|
-
- 使用变量提取测试验证
|
|
208
|
-
|
|
209
|
-
## 统计信息含义
|
|
210
|
-
|
|
211
|
-
- **总条目数**: 当前缓存的页面操作条目数量
|
|
212
|
-
- **总命中**: 缓存命中的总次数
|
|
213
|
-
- **命中率**: 缓存命中占总请求的百分比
|
|
214
|
-
- **L3/L2/L1 命中**: 各层级缓存命中的次数
|
|
215
|
-
- **节省 Token**: 估算节省的 token 数量
|
|
216
|
-
- **节省时间**: 估算节省的时间(毫秒)
|
|
@@ -1,441 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Actions Executor
|
|
3
|
-
* 操作执行器 - 执行缓存的原子化操作
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import type {
|
|
7
|
-
AtomicAction,
|
|
8
|
-
ExecutionResult,
|
|
9
|
-
PwAi,
|
|
10
|
-
VariableMap,
|
|
11
|
-
NavigateAction,
|
|
12
|
-
ClickAction,
|
|
13
|
-
TypeAction,
|
|
14
|
-
PressAction,
|
|
15
|
-
HoverAction,
|
|
16
|
-
ScreenshotAction,
|
|
17
|
-
EvaluateAction,
|
|
18
|
-
} from "./types.js";
|
|
19
|
-
|
|
20
|
-
// ============================================================================
|
|
21
|
-
// Actions Executor 类
|
|
22
|
-
// ============================================================================
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* 操作执行器
|
|
26
|
-
*/
|
|
27
|
-
export class ActionsExecutor {
|
|
28
|
-
private pw: PwAi | null = null;
|
|
29
|
-
private cdpUrl: string = "";
|
|
30
|
-
|
|
31
|
-
constructor(cdpUrl?: string) {
|
|
32
|
-
if (cdpUrl) {
|
|
33
|
-
this.cdpUrl = cdpUrl;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* 设置 Playwright 客户端
|
|
39
|
-
*/
|
|
40
|
-
setPlaywrightClient(pw: PwAi): void {
|
|
41
|
-
this.pw = pw;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* 设置 CDP URL
|
|
46
|
-
*/
|
|
47
|
-
setCdpUrl(cdpUrl: string): void {
|
|
48
|
-
this.cdpUrl = cdpUrl;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* 执行单个操作
|
|
53
|
-
*/
|
|
54
|
-
async execute(
|
|
55
|
-
action: AtomicAction,
|
|
56
|
-
variables?: VariableMap
|
|
57
|
-
): Promise<ExecutionResult> {
|
|
58
|
-
const startTime = Date.now();
|
|
59
|
-
|
|
60
|
-
try {
|
|
61
|
-
// 应用变量
|
|
62
|
-
const resolvedAction = this.applyVariables(action, variables);
|
|
63
|
-
|
|
64
|
-
// 根据操作类型执行
|
|
65
|
-
switch (resolvedAction.type) {
|
|
66
|
-
case "navigate":
|
|
67
|
-
await this.executeNavigate(resolvedAction as NavigateAction);
|
|
68
|
-
break;
|
|
69
|
-
|
|
70
|
-
case "click":
|
|
71
|
-
await this.executeClick(resolvedAction as ClickAction);
|
|
72
|
-
break;
|
|
73
|
-
|
|
74
|
-
case "type":
|
|
75
|
-
await this.executeType(resolvedAction as TypeAction);
|
|
76
|
-
break;
|
|
77
|
-
|
|
78
|
-
case "press":
|
|
79
|
-
await this.executePress(resolvedAction as PressAction);
|
|
80
|
-
break;
|
|
81
|
-
|
|
82
|
-
case "hover":
|
|
83
|
-
await this.executeHover(resolvedAction as HoverAction);
|
|
84
|
-
break;
|
|
85
|
-
|
|
86
|
-
case "screenshot":
|
|
87
|
-
await this.executeScreenshot(resolvedAction as ScreenshotAction);
|
|
88
|
-
break;
|
|
89
|
-
|
|
90
|
-
case "scroll":
|
|
91
|
-
case "wait":
|
|
92
|
-
case "select":
|
|
93
|
-
case "focus":
|
|
94
|
-
case "drag":
|
|
95
|
-
case "upload":
|
|
96
|
-
await this.executeEvaluate(resolvedAction as EvaluateAction);
|
|
97
|
-
break;
|
|
98
|
-
|
|
99
|
-
case "composite":
|
|
100
|
-
// 复合操作暂不实现
|
|
101
|
-
throw new Error("Composite actions not yet implemented");
|
|
102
|
-
|
|
103
|
-
default:
|
|
104
|
-
throw new Error(`Unsupported action type: ${action.type}`);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return {
|
|
108
|
-
action: action.type,
|
|
109
|
-
success: true,
|
|
110
|
-
duration: Date.now() - startTime,
|
|
111
|
-
};
|
|
112
|
-
} catch (error) {
|
|
113
|
-
return {
|
|
114
|
-
action: action.type,
|
|
115
|
-
success: false,
|
|
116
|
-
error: error instanceof Error ? error.message : String(error),
|
|
117
|
-
duration: Date.now() - startTime,
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* 批量执行操作
|
|
124
|
-
*/
|
|
125
|
-
async executeBatch(
|
|
126
|
-
actions: AtomicAction[],
|
|
127
|
-
variables?: VariableMap,
|
|
128
|
-
options?: {
|
|
129
|
-
fromIndex?: number;
|
|
130
|
-
toIndex?: number;
|
|
131
|
-
atomic?: boolean; // 是否原子执行(全部成功或全部失败)
|
|
132
|
-
}
|
|
133
|
-
): Promise<ExecutionResult[]> {
|
|
134
|
-
const from = options?.fromIndex ?? 0;
|
|
135
|
-
const to =
|
|
136
|
-
options?.toIndex !== undefined ? options.toIndex + 1 : actions.length;
|
|
137
|
-
const atomic = options?.atomic ?? false;
|
|
138
|
-
|
|
139
|
-
const results: ExecutionResult[] = [];
|
|
140
|
-
const actionsToExecute = actions.slice(from, to);
|
|
141
|
-
|
|
142
|
-
for (const action of actionsToExecute) {
|
|
143
|
-
const result = await this.execute(action, variables);
|
|
144
|
-
results.push(result);
|
|
145
|
-
|
|
146
|
-
// 原子执行:失败则停止
|
|
147
|
-
if (atomic && !result.success) {
|
|
148
|
-
break;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return results;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// -------------------------------------------------------------------------
|
|
156
|
-
// 具体操作实现
|
|
157
|
-
// -------------------------------------------------------------------------
|
|
158
|
-
|
|
159
|
-
private async executeNavigate(action: NavigateAction): Promise<void> {
|
|
160
|
-
if (!this.pw) {
|
|
161
|
-
throw new Error("Playwright client not set");
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
await this.pw.navigateViaPlaywright({
|
|
165
|
-
cdpUrl: action.cdpUrl || this.cdpUrl,
|
|
166
|
-
targetId: action.targetId,
|
|
167
|
-
url: action.url,
|
|
168
|
-
waitUntil: action.navigationPolicy?.waitUntil || "domcontentloaded",
|
|
169
|
-
timeout: action.navigationPolicy?.timeout,
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
private async executeClick(action: ClickAction): Promise<void> {
|
|
174
|
-
if (!this.pw) {
|
|
175
|
-
throw new Error("Playwright client not set");
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
await this.pw.clickViaPlaywright({
|
|
179
|
-
cdpUrl: action.cdpUrl || this.cdpUrl,
|
|
180
|
-
targetId: action.targetId,
|
|
181
|
-
ref: action.ref,
|
|
182
|
-
doubleClick: action.doubleClick,
|
|
183
|
-
button: action.button || "left",
|
|
184
|
-
modifiers: action.modifiers,
|
|
185
|
-
timeoutMs: action.timeoutMs,
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
private async executeType(action: TypeAction): Promise<void> {
|
|
190
|
-
if (!this.pw) {
|
|
191
|
-
throw new Error("Playwright client not set");
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
await this.pw.typeViaPlaywright({
|
|
195
|
-
cdpUrl: action.cdpUrl || this.cdpUrl,
|
|
196
|
-
targetId: action.targetId,
|
|
197
|
-
ref: action.ref,
|
|
198
|
-
text: action.text,
|
|
199
|
-
submit: action.submit,
|
|
200
|
-
slowly: action.slowly,
|
|
201
|
-
timeoutMs: action.timeoutMs,
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
private async executePress(action: PressAction): Promise<void> {
|
|
206
|
-
if (!this.pw) {
|
|
207
|
-
throw new Error("Playwright client not set");
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
await this.pw.pressKeyViaPlaywright({
|
|
211
|
-
cdpUrl: action.cdpUrl || this.cdpUrl,
|
|
212
|
-
targetId: action.targetId,
|
|
213
|
-
key: action.key,
|
|
214
|
-
delayMs: action.delayMs,
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
private async executeHover(action: HoverAction): Promise<void> {
|
|
219
|
-
if (!this.pw) {
|
|
220
|
-
throw new Error("Playwright client not set");
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
await this.pw.hoverViaPlaywright({
|
|
224
|
-
cdpUrl: action.cdpUrl || this.cdpUrl,
|
|
225
|
-
targetId: action.targetId,
|
|
226
|
-
ref: action.ref,
|
|
227
|
-
timeoutMs: action.timeoutMs,
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
private async executeScreenshot(action: ScreenshotAction): Promise<string> {
|
|
232
|
-
if (!this.pw) {
|
|
233
|
-
throw new Error("Playwright client not set");
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
return this.pw.screenshotViaPlaywright({
|
|
237
|
-
cdpUrl: action.cdpUrl || this.cdpUrl,
|
|
238
|
-
targetId: action.targetId,
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
private async executeEvaluate(action: EvaluateAction): Promise<any> {
|
|
243
|
-
if (!this.pw) {
|
|
244
|
-
throw new Error("Playwright client not set");
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
return this.pw.evaluateViaPlaywright({
|
|
248
|
-
cdpUrl: action.cdpUrl || this.cdpUrl,
|
|
249
|
-
targetId: action.targetId,
|
|
250
|
-
code: action.evaluate.code,
|
|
251
|
-
args: action.evaluate.args,
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
// -------------------------------------------------------------------------
|
|
256
|
-
// 变量替换
|
|
257
|
-
// -------------------------------------------------------------------------
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* 应用变量到操作
|
|
261
|
-
*/
|
|
262
|
-
private applyVariables(
|
|
263
|
-
action: AtomicAction,
|
|
264
|
-
variables?: VariableMap
|
|
265
|
-
): AtomicAction {
|
|
266
|
-
if (!variables) {
|
|
267
|
-
return action;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
// 检查是否需要变量替换
|
|
271
|
-
if (!action.variable) {
|
|
272
|
-
return action;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
// 获取变量值
|
|
276
|
-
const value = variables[action.variable];
|
|
277
|
-
if (value === undefined) {
|
|
278
|
-
// 变量未定义,返回原操作
|
|
279
|
-
return action;
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
// 根据操作类型设置正确的参数
|
|
283
|
-
const actionType = action.type;
|
|
284
|
-
if (actionType === "type") {
|
|
285
|
-
return { ...action, text: value as string };
|
|
286
|
-
} else if (actionType === "press") {
|
|
287
|
-
return { ...action, key: value as string };
|
|
288
|
-
} else if (actionType === "navigate") {
|
|
289
|
-
return { ...action, url: value as string };
|
|
290
|
-
} else if (actionType === "scroll" || actionType === "wait" ||
|
|
291
|
-
actionType === "select" || actionType === "focus" ||
|
|
292
|
-
actionType === "drag" || actionType === "upload") {
|
|
293
|
-
// evaluate 操作替换模板变量
|
|
294
|
-
return this.replaceTemplateVariables(action, variables);
|
|
295
|
-
} else {
|
|
296
|
-
// 其他操作替换所有字符串参数中的模板变量
|
|
297
|
-
return this.replaceTemplateVariables(action, variables);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
/**
|
|
302
|
-
* 替换操作中的模板变量
|
|
303
|
-
*/
|
|
304
|
-
private replaceTemplateVariables(
|
|
305
|
-
action: AtomicAction,
|
|
306
|
-
variables: VariableMap
|
|
307
|
-
): AtomicAction {
|
|
308
|
-
const result: any = { ...action };
|
|
309
|
-
|
|
310
|
-
// 替换字符串类型参数中的 ${variable}
|
|
311
|
-
for (const key of Object.keys(action)) {
|
|
312
|
-
const value = (action as any)[key];
|
|
313
|
-
if (typeof value === "string") {
|
|
314
|
-
result[key] = value.replace(/\$\{([^}]+)\}/g, (match, varName) => {
|
|
315
|
-
const replacement = variables[varName];
|
|
316
|
-
return replacement !== undefined ? replacement : match;
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
// 特殊处理 evaluate.code(如果存在)
|
|
322
|
-
if (result.evaluate?.code && typeof result.evaluate.code === "string") {
|
|
323
|
-
result.evaluate.code = result.evaluate.code.replace(
|
|
324
|
-
/\$\{([^}]+)\}/g,
|
|
325
|
-
(match: string, varName: string) => {
|
|
326
|
-
const replacement = variables[varName];
|
|
327
|
-
return replacement !== undefined ? replacement : match;
|
|
328
|
-
}
|
|
329
|
-
);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
return result;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
// -------------------------------------------------------------------------
|
|
336
|
-
// 格式化输出
|
|
337
|
-
// -------------------------------------------------------------------------
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* 格式化操作列表
|
|
341
|
-
*/
|
|
342
|
-
formatActions(actions: AtomicAction[]): string {
|
|
343
|
-
return actions
|
|
344
|
-
.map((action, i) => this.formatAction(action, i + 1))
|
|
345
|
-
.join("\n");
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* 格式化单个操作
|
|
350
|
-
*/
|
|
351
|
-
private formatAction(action: AtomicAction, index: number): string {
|
|
352
|
-
switch (action.type) {
|
|
353
|
-
case "navigate":
|
|
354
|
-
return `${index}. 导航到:${(action as NavigateAction).url}`;
|
|
355
|
-
|
|
356
|
-
case "screenshot":
|
|
357
|
-
return `${index}. 截图`;
|
|
358
|
-
|
|
359
|
-
case "click":
|
|
360
|
-
const btn = (action as ClickAction).button || "left";
|
|
361
|
-
const dbl = (action as ClickAction).doubleClick ? "双击" : "";
|
|
362
|
-
const mod = (action as ClickAction).modifiers?.length
|
|
363
|
-
? `+${(action as ClickAction).modifiers!.join("+")}`
|
|
364
|
-
: "";
|
|
365
|
-
return `${index}. ${dbl}点击(${btn}${mod}):${action.ref}`;
|
|
366
|
-
|
|
367
|
-
case "type":
|
|
368
|
-
const txt = (action as TypeAction).text
|
|
369
|
-
? `="${(action as TypeAction).text}"`
|
|
370
|
-
: "";
|
|
371
|
-
const sub = (action as TypeAction).submit ? " [提交]" : "";
|
|
372
|
-
const slow = (action as TypeAction).slowly ? " [慢速]" : "";
|
|
373
|
-
return `${index}. 输入:${action.ref}${txt}${sub}${slow}`;
|
|
374
|
-
|
|
375
|
-
case "press":
|
|
376
|
-
const delay = (action as PressAction).delayMs
|
|
377
|
-
? `(${(action as PressAction).delayMs}ms)`
|
|
378
|
-
: "";
|
|
379
|
-
return `${index}. 按键:${(action as PressAction).key}${delay}${
|
|
380
|
-
action.ref ? ` @ ${action.ref}` : ""
|
|
381
|
-
}`;
|
|
382
|
-
|
|
383
|
-
case "hover":
|
|
384
|
-
return `${index}. 悬停:${action.ref}`;
|
|
385
|
-
|
|
386
|
-
case "scroll":
|
|
387
|
-
return `${index}. 滚动:${
|
|
388
|
-
(action as EvaluateAction).evaluate?.code || "向下滚动"
|
|
389
|
-
}`;
|
|
390
|
-
|
|
391
|
-
case "wait":
|
|
392
|
-
const waitDelay = action.delay ? `(${action.delay}ms)` : "";
|
|
393
|
-
return `${index}. 等待:${
|
|
394
|
-
(action as EvaluateAction).evaluate?.code || "默认等待"
|
|
395
|
-
}${waitDelay}`;
|
|
396
|
-
|
|
397
|
-
case "select":
|
|
398
|
-
return `${index}. 选择:${action.ref}`;
|
|
399
|
-
|
|
400
|
-
case "focus":
|
|
401
|
-
return `${index}. 聚焦:${action.ref}`;
|
|
402
|
-
|
|
403
|
-
case "drag":
|
|
404
|
-
return `${index}. 拖拽:${action.ref}`;
|
|
405
|
-
|
|
406
|
-
case "upload":
|
|
407
|
-
return `${index}. 上传:${action.ref}`;
|
|
408
|
-
|
|
409
|
-
default:
|
|
410
|
-
return `${index}. ${action.type}:${action.ref || ""}`;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* 格式化执行结果
|
|
416
|
-
*/
|
|
417
|
-
formatExecutionResults(results: ExecutionResult[]): string {
|
|
418
|
-
return results
|
|
419
|
-
.map((r, i) => {
|
|
420
|
-
const icon = r.success ? "✅" : "❌";
|
|
421
|
-
const time = r.duration ? `(${r.duration}ms)` : "";
|
|
422
|
-
return `${icon} 操作 ${i + 1}: ${r.action} ${time}${
|
|
423
|
-
r.error ? ` - ${r.error}` : ""
|
|
424
|
-
}`;
|
|
425
|
-
})
|
|
426
|
-
.join("\n");
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
// ============================================================================
|
|
431
|
-
// 单例
|
|
432
|
-
// ============================================================================
|
|
433
|
-
|
|
434
|
-
let actionsExecutorInstance: ActionsExecutor | null = null;
|
|
435
|
-
|
|
436
|
-
export function getActionsExecutor(cdpUrl?: string): ActionsExecutor {
|
|
437
|
-
if (!actionsExecutorInstance) {
|
|
438
|
-
actionsExecutorInstance = new ActionsExecutor(cdpUrl);
|
|
439
|
-
}
|
|
440
|
-
return actionsExecutorInstance;
|
|
441
|
-
}
|