@workclaw/openclaw-workclaw 1.0.32 → 1.0.33
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/_virtual/_commonjsHelpers.js +8 -0
- package/dist/_virtual/ipaddr.js +4 -0
- package/dist/_virtual/jiti.js +4 -0
- package/dist/_virtual/main.js +4 -0
- package/dist/api.js +4 -373
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +89 -1919
- package/dist/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js +163 -0
- package/dist/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/utilities.js +32 -0
- package/dist/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/ansi-styles/index.js +188 -0
- package/dist/node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/vendor/supports-color/browser.js +25 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/account-id-C6v13Xic.js +4 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/auth-profiles-Db4Eg6ht.js +24 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/bash-tools.exec-runtime--1hhz8C_.js +46 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/bash-tools.schemas-BqpDemKo.js +32 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/boolean-DbfRNnYl.js +14 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/boundary-file-read-BymsBHso.js +172 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/bundled-Cuj8sKt6.js +18 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/bundled-dir-Cq5y_NKM.js +109 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/bundled-plugin-metadata-BJMD48hn.js +260 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/channel-entry-contract-BoTfqLnn.js +176 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/cli-name-DPC4W7Fo.js +22 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/command-format-LqDv8ows.js +24 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/command-registration-Dxq1bCXM.js +16 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/commands-registry-normalize-Bk0WYUI0.js +94 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/commands-registry.data-D99VdOlX.js +940 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/config--3Msyf4f.js +20 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/config-schema-C6kUPI7B.js +33 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/config-schema-DB8FqQH8.js +82 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/conversation-binding-C3EIaK9Z.js +19 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/core-DpZtjMWz.js +51 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/dedupe-DM7iBj7C.js +60 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/discovery-Cgp95o2R.js +649 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/dispatch-2DAqwFVE.js +33 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/errors-Dyla6m1G.js +13 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/exec-approvals-CLXc_BYU.js +212 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/exec-defaults-DBnaZeLQ.js +13 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/exec-jRxy02_4.js +9 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/exec-safe-bin-trust-DOmID2EO.js +638 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/exec-safety-C8v0dsfc.js +24 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/facade-loader-B83leEeb.js +10 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/facade-runtime-B04URCVZ.js +14 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/file-identity-sp9axE-E.js +411 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/file-lock-D016H3tC.js +5 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/gateway-control-ui-origins-B-lkqr3D.js +23 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/gateway-request-scope-BEWoJTx4.js +3 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/global-singleton-DhGoboiG.js +14 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/helpers-CI2CkXhU.js +7 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/home-dir-BEqRdfoa.js +67 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/host-env-security-B-Ebh6At.js +334 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/ids-By7Nkc8R.js +76 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/inbound-path-policy-CQkSSeSi.js +26 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/internal-hooks-D52pUqod.js +5 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/io-DDkf_FUu.js +14328 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/ip-CdfoCORt.js +2 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/json-files-DACY7Zw5.js +22 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/legacy-names-C7VUgVdg.js +5 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/links-BlUEqVE8.js +15 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/loader-DYJR63Q1.js +27 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/logger-BMuqDP66.js +26 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/manager-szyCqvou.js +22 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/manifest-CjPIwluH.js +409 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/manifest-registry-CK0zNybm.js +394 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/map-size-DhG4ditB.js +15 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/message-channel-DXsjCySM.js +32 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/mime-BjR-Aw-Q.js +42 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/min-host-version-CmguvhGB.js +49 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/model-auth-markers-YVQDqG1J.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/model-selection-cli-U7l5Ifek.js +14 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/models-config-B-YHRI3g.js +40 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/native-command-session-targets-BW3SPx-T.js +11 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/network-mode-D3yzFBsD.js +15 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/node-require-DvwmVoHm.js +14 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/node-sqlite-FGjwOqiS.js +3 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/openclaw-root-BNWw3cXT.js +69 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/order-6WHL2fZu.js +26 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/parse-duration-amE_QFsj.js +42 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/path-safety-CKqzLERR.js +308 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/paths-LCYGfrV7.js +95 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/process-scoped-map-Cv-PkzaO.js +11 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/profile-utils-Dh8DVvPv.js +17 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/prototype-keys-BKGE_uzN.js +11 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/provider-env-vars-DDfJbkrO.js +150 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/provider-id-B3nZBDJJ.js +15 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/provider-runtime-O-n0cjZo.js +22 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/public-surface-loader-CSDxBey4.js +14 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/redact-D4nea1HF.js +2 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/ref-contract-B1q5N0Lz.js +35 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/registry-DE4nHTjg.js +54 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/registry-loaded-B8D6rQiJ.js +62 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/registry-nEl7QZ30.js +3 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/runtime-Clo2XF6T.js +27 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/runtime-channel-state-Ck2VkX9T.js +20 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/runtime-guard-DqVOvWAZ.js +23 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/runtime-state-Cd3jnHgw.js +4 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/schema-validator-Bo7NeV8w.js +3 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/scp-host-CiFVRWHy.js +38 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/sdk-alias-Bo1huP7M.js +315 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/session-binding-service-D6sb-LrK.js +9 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/session-write-lock-Dk7FbMr_.js +6 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/setup-helpers-ChrkNnYE.js +5 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/setup-registry-BPL6c_Zk.js +16 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/setup-wizard-helpers-DnMkYslk.js +19 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/skills-Djbt9HGh.js +21 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/slots-PynIdqZ_.js +10 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/string-coerce-BUSzWgUA.js +25 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/string-normalization-DIJRAo0o.js +20 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/strip-inbound-meta-WCHWW8is.js +12 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/subsystem-BHv2zSx6.js +15 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/system-events-CfifhXT7.js +3 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/tailscale-status-Ch1LdrMM.js +5 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/task-registry-2LJDZL29.js +15 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/telegram-command-config-TdpOuZ__.js +66 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/terminal-link-B3nCYQJi.js +10 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/theme-CVJvORNs.js +27 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/thinking-_rqwdGD8.js +44 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/thinking.shared-Dginn1He.js +14 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/tmp-openclaw-dir-DrKSsX71.js +103 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/tool-policy-CwZyJfFc.js +300 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/types-BfKfz-lz.js +38 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/types.secrets-C9RpLzA0.js +53 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/utils-DGFSjtQF.js +36 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/version-b06Uhxnq.js +82 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/workspace-oVBetctb.js +20 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/zod-schema-Cpw1qu03.js +1299 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/zod-schema.agent-runtime-D48J52r_.js +620 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/zod-schema.core-BrzjtZhM.js +597 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/zod-schema.providers-core-CX8AFeyJ.js +1354 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/zod-schema.providers-whatsapp-7E9bf9oA.js +130 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/zod-schema.sensitive-BFZ4qze6.js +5 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@mariozechner/pi-ai/dist/models.generated.js +14275 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@mariozechner/pi-ai/dist/models.js +16 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@mariozechner/pi-ai/dist/utils/oauth/anthropic.js +314 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@mariozechner/pi-ai/dist/utils/oauth/github-copilot.js +256 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@mariozechner/pi-ai/dist/utils/oauth/google-antigravity.js +315 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@mariozechner/pi-ai/dist/utils/oauth/google-gemini-cli.js +402 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@mariozechner/pi-ai/dist/utils/oauth/index.js +41 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@mariozechner/pi-ai/dist/utils/oauth/oauth-page.js +103 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@mariozechner/pi-ai/dist/utils/oauth/openai-codex.js +335 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@mariozechner/pi-ai/dist/utils/oauth/pkce.js +20 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/system/policy.js +34 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/any/any.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/argument/argument.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/array/array.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.js +30 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/clone/type.js +7 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/clone/value.js +32 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/composite/composite.js +37 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/computed/computed.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/const/const.js +36 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.js +9 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/create/immutable.js +29 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/create/type.js +17 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/date/date.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/discard/discard.js +10 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/enum/enum.js +15 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/error/error.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.js +18 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.js +21 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.js +265 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.js +24 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.js +19 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/extends/extends.js +16 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.js +18 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/extract/extract.js +21 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/function/function.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/guard/kind.js +176 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/guard/type.js +272 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/guard/value.js +62 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.js +21 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.js +20 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.js +21 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.js +61 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.js +9 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.js +86 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/integer/integer.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.js +11 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.js +31 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.js +16 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.js +7 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.js +25 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.js +55 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.js +7 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.js +7 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.js +7 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.js +19 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.js +36 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.js +31 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/literal/literal.js +12 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.js +11 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.js +76 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/module/compute.js +122 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/module/module.js +28 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/never/never.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/not/not.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/null/null.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/number/number.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/object/object.js +15 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.js +21 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.js +19 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/omit/omit.js +48 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.js +18 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/optional/optional.js +21 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.js +9 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.js +19 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/partial/partial.js +53 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.js +16 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.js +23 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.js +19 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/pick/pick.js +48 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/promise/promise.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.js +18 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.js +21 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/record/record.js +71 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.js +15 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/ref/ref.js +12 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.js +10 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.js +18 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/required/required.js +52 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/rest/rest.js +10 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.js +9 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/sets/set.js +30 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/string/string.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.js +12 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.js +27 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.js +38 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.js +128 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.js +21 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.js +45 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.js +12 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/template-literal/union.js +11 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/transform/transform.js +37 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/type/index.js +5 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/type/type.js +126 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/union/union-create.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.js +26 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/union/union.js +9 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/type/void/void.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/@sinclair/typebox/build/esm/value/guard/guard.js +18 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/dotenv/lib/main.js +318 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/ipaddr.js/lib/ipaddr.js +805 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/jiti/dist/jiti.js +3869 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/jiti/lib/jiti.js +26 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/json5/dist/index.js +1085 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/doc/anchors.js +12 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/doc/applyReviver.js +45 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/doc/createNode.js +58 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/log.js +8 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/nodes/Alias.js +111 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/nodes/Collection.js +138 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/nodes/Node.js +36 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/nodes/Pair.js +35 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/nodes/Scalar.js +25 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/nodes/YAMLMap.js +139 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/nodes/YAMLSeq.js +111 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/nodes/addPairToJSMap.js +59 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/nodes/identity.js +52 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/nodes/toJS.js +25 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/parse/lexer.js +6 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js +55 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/schema/yaml-1.1/omap.js +50 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js +37 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/schema/yaml-1.1/set.js +65 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/stringify/foldFlowLines.js +131 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/stringify/stringify.js +119 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/stringify/stringifyCollection.js +146 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/stringify/stringifyComment.js +12 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/stringify/stringifyPair.js +128 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/stringify/stringifyString.js +278 -0
- package/dist/node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/node_modules/yaml/browser/dist/visit.js +104 -0
- package/dist/packages/plugin/src/accounts.js +199 -0
- package/dist/packages/plugin/src/api/accounts-api.js +133 -0
- package/dist/packages/plugin/src/api/prompts-api.js +105 -0
- package/dist/packages/plugin/src/api/session-api.js +174 -0
- package/dist/packages/plugin/src/api/skills-api.js +60 -0
- package/dist/packages/plugin/src/api/workspace.js +30 -0
- package/dist/packages/plugin/src/channel.js +214 -0
- package/dist/packages/plugin/src/config-schema.js +51 -0
- package/dist/packages/plugin/src/connection/workclaw-client.js +282 -0
- package/dist/packages/plugin/src/gateway/agent-handlers.js +407 -0
- package/dist/packages/plugin/src/gateway/config-writer.js +149 -0
- package/dist/{cron-tasks-handler-C-mP3VmV.js → packages/plugin/src/gateway/cron-tasks-handler.js} +75 -6
- package/dist/packages/plugin/src/gateway/message-context.js +408 -0
- package/dist/packages/plugin/src/gateway/message-dispatcher.js +517 -0
- package/dist/packages/plugin/src/gateway/reconnect.js +177 -0
- package/dist/packages/plugin/src/gateway/skills-handler.js +511 -0
- package/dist/packages/plugin/src/gateway/skills-list-handler.js +172 -0
- package/dist/packages/plugin/src/gateway/tools-list-handler.js +88 -0
- package/dist/packages/plugin/src/gateway/workclaw-gateway.js +208 -0
- package/dist/packages/plugin/src/media/upload.js +126 -0
- package/dist/packages/plugin/src/outbound/index.js +88 -0
- package/dist/packages/plugin/src/outbound/workclaw-sender.js +79 -0
- package/dist/packages/plugin/src/setup-core.js +22 -0
- package/dist/packages/plugin/src/setup-surface.js +338 -0
- package/dist/packages/plugin/src/tools/openclaw-workclaw-cron/api/index.js +184 -0
- package/dist/packages/plugin/src/tools/openclaw-workclaw-cron/index.js +29 -0
- package/dist/packages/plugin/src/tools/openclaw-workclaw-cron/src/add/params.js +129 -0
- package/dist/packages/plugin/src/tools/openclaw-workclaw-cron/src/add/sync.js +139 -0
- package/dist/packages/plugin/src/tools/openclaw-workclaw-cron/src/disable/params.js +61 -0
- package/dist/packages/plugin/src/tools/openclaw-workclaw-cron/src/disable/sync.js +85 -0
- package/dist/packages/plugin/src/tools/openclaw-workclaw-cron/src/enable/params.js +61 -0
- package/dist/packages/plugin/src/tools/openclaw-workclaw-cron/src/enable/sync.js +85 -0
- package/dist/packages/plugin/src/tools/openclaw-workclaw-cron/src/notify/sync.js +102 -0
- package/dist/packages/plugin/src/tools/openclaw-workclaw-cron/src/remove/params.js +67 -0
- package/dist/packages/plugin/src/tools/openclaw-workclaw-cron/src/remove/sync.js +85 -0
- package/dist/packages/plugin/src/tools/openclaw-workclaw-cron/src/update/params.js +140 -0
- package/dist/packages/plugin/src/tools/openclaw-workclaw-cron/src/update/sync.js +113 -0
- package/dist/packages/plugin/src/tools/openclaw-workclaw-cron/utils/index.js +99 -0
- package/dist/packages/plugin/src/tools/openclaw-workclaw-cron/utils/tool-context.js +28 -0
- package/dist/setup-entry.js +1 -168
- package/dist/src/config-schema.d.ts +3 -85
- package/dist/src/config-schema.d.ts.map +1 -1
- package/dist/src/gateway/cron-tasks-handler.d.ts +2 -1
- package/dist/src/gateway/cron-tasks-handler.d.ts.map +1 -1
- package/dist/src/gateway/tools-list-handler.d.ts.map +1 -1
- package/dist/src/tools/openclaw-workclaw-cron/index.d.ts.map +1 -1
- package/dist/src/tools/openclaw-workclaw-cron/src/add/params.d.ts +0 -3
- package/dist/src/tools/openclaw-workclaw-cron/src/add/params.d.ts.map +1 -1
- package/dist/src/tools/openclaw-workclaw-cron/src/add/sync.d.ts +0 -3
- package/dist/src/tools/openclaw-workclaw-cron/src/add/sync.d.ts.map +1 -1
- package/dist/src/tools/openclaw-workclaw-cron/src/disable/params.d.ts +0 -3
- package/dist/src/tools/openclaw-workclaw-cron/src/disable/params.d.ts.map +1 -1
- package/dist/src/tools/openclaw-workclaw-cron/src/disable/sync.d.ts +0 -3
- package/dist/src/tools/openclaw-workclaw-cron/src/disable/sync.d.ts.map +1 -1
- package/dist/src/tools/openclaw-workclaw-cron/src/enable/params.d.ts +0 -3
- package/dist/src/tools/openclaw-workclaw-cron/src/enable/params.d.ts.map +1 -1
- package/dist/src/tools/openclaw-workclaw-cron/src/enable/sync.d.ts +0 -3
- package/dist/src/tools/openclaw-workclaw-cron/src/enable/sync.d.ts.map +1 -1
- package/dist/src/tools/openclaw-workclaw-cron/src/notify/sync.d.ts +0 -3
- package/dist/src/tools/openclaw-workclaw-cron/src/notify/sync.d.ts.map +1 -1
- package/dist/src/tools/openclaw-workclaw-cron/src/remove/params.d.ts +0 -3
- package/dist/src/tools/openclaw-workclaw-cron/src/remove/params.d.ts.map +1 -1
- package/dist/src/tools/openclaw-workclaw-cron/src/remove/sync.d.ts +0 -3
- package/dist/src/tools/openclaw-workclaw-cron/src/remove/sync.d.ts.map +1 -1
- package/dist/src/tools/openclaw-workclaw-cron/src/update/params.d.ts +0 -3
- package/dist/src/tools/openclaw-workclaw-cron/src/update/params.d.ts.map +1 -1
- package/dist/src/tools/openclaw-workclaw-cron/src/update/sync.d.ts +0 -3
- package/dist/src/tools/openclaw-workclaw-cron/src/update/sync.d.ts.map +1 -1
- package/dist/src/tools/openclaw-workclaw-cron/utils/tool-context.d.ts +9 -0
- package/dist/src/tools/openclaw-workclaw-cron/utils/tool-context.d.ts.map +1 -0
- package/openclaw.plugin.json +56 -56
- package/package.json +2 -2
- package/dist/channel-RYqEIK50.js +0 -49793
- package/dist/jiti-4i2h0FGP.js +0 -4814
package/dist/index.js
CHANGED
|
@@ -1,1894 +1,44 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import process$1 from "node:process";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
5
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/registry-nEl7QZ30.js";
|
|
6
|
+
import { n as emptyPluginConfigSchema } from "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/config-schema-C6kUPI7B.js";
|
|
7
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/subsystem-BHv2zSx6.js";
|
|
8
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/paths-LCYGfrV7.js";
|
|
9
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/utils-DGFSjtQF.js";
|
|
10
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/ip-CdfoCORt.js";
|
|
11
|
+
import "node:os";
|
|
8
12
|
import "node:fs";
|
|
9
13
|
import "node:net";
|
|
14
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/config-schema-DB8FqQH8.js";
|
|
15
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/mime-BjR-Aw-Q.js";
|
|
16
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/tmp-openclaw-dir-DrKSsX71.js";
|
|
17
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/exec-jRxy02_4.js";
|
|
18
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/bundled-dir-Cq5y_NKM.js";
|
|
19
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/bundled-Cuj8sKt6.js";
|
|
10
20
|
import "node:crypto";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (Object.keys(value).length > 0) return error("config must be empty");
|
|
33
|
-
return {
|
|
34
|
-
success: true,
|
|
35
|
-
data: value
|
|
36
|
-
};
|
|
37
|
-
},
|
|
38
|
-
jsonSchema: {
|
|
39
|
-
type: "object",
|
|
40
|
-
additionalProperties: false,
|
|
41
|
-
properties: {}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
function defineChannelPluginEntry({ id, name, description, plugin, configSchema, setRuntime, registerCliMetadata, registerFull }) {
|
|
46
|
-
return {
|
|
47
|
-
id,
|
|
48
|
-
name,
|
|
49
|
-
description,
|
|
50
|
-
configSchema: typeof configSchema === "function" ? configSchema() : configSchema ?? emptyChannelConfigSchema(),
|
|
51
|
-
register(api) {
|
|
52
|
-
if (api.registrationMode === "cli-metadata") {
|
|
53
|
-
registerCliMetadata?.(api);
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
setRuntime?.(api.runtime);
|
|
57
|
-
api.registerChannel({ plugin });
|
|
58
|
-
if (api.registrationMode !== "full") return;
|
|
59
|
-
registerCliMetadata?.(api);
|
|
60
|
-
registerFull?.(api);
|
|
61
|
-
},
|
|
62
|
-
channelPlugin: plugin,
|
|
63
|
-
...setRuntime ? { setChannelRuntime: setRuntime } : {}
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
function sendJson$3(res, statusCode, payload) {
|
|
67
|
-
res.statusCode = statusCode;
|
|
68
|
-
res.setHeader("Content-Type", "application/json");
|
|
69
|
-
res.end(JSON.stringify(payload));
|
|
70
|
-
}
|
|
71
|
-
async function readRequestBody$2(req) {
|
|
72
|
-
const chunks = [];
|
|
73
|
-
await new Promise((resolve, reject) => {
|
|
74
|
-
req.on("data", (chunk) => {
|
|
75
|
-
chunks.push(Buffer$1.isBuffer(chunk) ? chunk : Buffer$1.from(chunk));
|
|
76
|
-
});
|
|
77
|
-
req.on("end", () => resolve());
|
|
78
|
-
req.on("error", (err) => reject(err));
|
|
79
|
-
});
|
|
80
|
-
return Buffer$1.concat(chunks).toString("utf-8");
|
|
81
|
-
}
|
|
82
|
-
async function loadRuntimeConfig(api) {
|
|
83
|
-
const runtimeConfig = api.runtime?.config;
|
|
84
|
-
if (runtimeConfig?.loadConfig) {
|
|
85
|
-
return runtimeConfig.loadConfig();
|
|
86
|
-
}
|
|
87
|
-
return api.config;
|
|
88
|
-
}
|
|
89
|
-
async function writeRuntimeConfig(api, config) {
|
|
90
|
-
const runtimeConfig = api.runtime?.config;
|
|
91
|
-
if (runtimeConfig?.writeConfigFile) {
|
|
92
|
-
await runtimeConfig.writeConfigFile(config);
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
throw new Error("Config write not supported");
|
|
96
|
-
}
|
|
97
|
-
function getAccountMap(config) {
|
|
98
|
-
const channels = config?.channels && typeof config.channels === "object" ? config.channels : {};
|
|
99
|
-
const openclawWorkclaw = channels["openclaw-workclaw"] && typeof channels["openclaw-workclaw"] === "object" ? channels["openclaw-workclaw"] : {};
|
|
100
|
-
const accounts = openclawWorkclaw.accounts && typeof openclawWorkclaw.accounts === "object" ? openclawWorkclaw.accounts : {};
|
|
101
|
-
return { ...accounts };
|
|
102
|
-
}
|
|
103
|
-
function withAccounts(config, accounts) {
|
|
104
|
-
const channels = config?.channels && typeof config.channels === "object" ? config.channels : {};
|
|
105
|
-
const openclawWorkclaw = channels["openclaw-workclaw"] && typeof channels["openclaw-workclaw"] === "object" ? channels["openclaw-workclaw"] : {};
|
|
106
|
-
return {
|
|
107
|
-
...config,
|
|
108
|
-
channels: {
|
|
109
|
-
...channels,
|
|
110
|
-
"openclaw-workclaw": {
|
|
111
|
-
...openclawWorkclaw,
|
|
112
|
-
accounts
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
function createAccountsApiHandler(api) {
|
|
118
|
-
return async (req, res) => {
|
|
119
|
-
const method = String(req.method ?? "GET").toUpperCase();
|
|
120
|
-
const url = new URL(req.url ?? "", "http://localhost");
|
|
121
|
-
const idRaw = url.searchParams.get("id") ?? url.searchParams.get("accountId");
|
|
122
|
-
const accountId = idRaw ? normalizeAccountId(idRaw) : null;
|
|
123
|
-
if (method === "GET") {
|
|
124
|
-
const cfg = await loadRuntimeConfig(api);
|
|
125
|
-
const accounts = getAccountMap(cfg);
|
|
126
|
-
if (accountId) {
|
|
127
|
-
const account = accounts[accountId];
|
|
128
|
-
if (!account) {
|
|
129
|
-
sendJson$3(res, 404, { ok: false, error: "Not Found" });
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
sendJson$3(res, 200, { ok: true, accountId, config: account });
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
const entries = Object.entries(accounts).map(([id, config]) => ({
|
|
136
|
-
accountId: id,
|
|
137
|
-
config
|
|
138
|
-
}));
|
|
139
|
-
sendJson$3(res, 200, { ok: true, accounts: entries });
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
|
-
if (method === "POST" || method === "PUT") {
|
|
143
|
-
const raw = await readRequestBody$2(req);
|
|
144
|
-
let input = {};
|
|
145
|
-
try {
|
|
146
|
-
input = raw ? JSON.parse(raw) : {};
|
|
147
|
-
} catch {
|
|
148
|
-
sendJson$3(res, 400, { ok: false, error: "Invalid JSON" });
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
const inputId = input?.accountId ?? input?.id;
|
|
152
|
-
const normalizedId = inputId ? normalizeAccountId(String(inputId)) : "";
|
|
153
|
-
const patch = input?.config;
|
|
154
|
-
if (!normalizedId || !patch || typeof patch !== "object") {
|
|
155
|
-
sendJson$3(res, 400, { ok: false, error: "Missing accountId or config" });
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
const cfg = await loadRuntimeConfig(api);
|
|
159
|
-
const accounts = getAccountMap(cfg);
|
|
160
|
-
if (method === "POST" && accounts[normalizedId]) {
|
|
161
|
-
sendJson$3(res, 409, { ok: false, error: "Account already exists" });
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
if (method === "PUT" && !accounts[normalizedId]) {
|
|
165
|
-
sendJson$3(res, 404, { ok: false, error: "Not Found" });
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
const next = method === "PUT" ? { ...accounts[normalizedId], ...patch } : patch;
|
|
169
|
-
const updated = withAccounts(cfg, { ...accounts, [normalizedId]: next });
|
|
170
|
-
await writeRuntimeConfig(api, updated);
|
|
171
|
-
sendJson$3(res, 200, { ok: true, accountId: normalizedId });
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
if (method === "DELETE") {
|
|
175
|
-
if (!accountId) {
|
|
176
|
-
sendJson$3(res, 400, { ok: false, error: "Missing accountId" });
|
|
177
|
-
return;
|
|
178
|
-
}
|
|
179
|
-
const cfg = await loadRuntimeConfig(api);
|
|
180
|
-
const accounts = getAccountMap(cfg);
|
|
181
|
-
if (!accounts[accountId]) {
|
|
182
|
-
sendJson$3(res, 404, { ok: false, error: "Not Found" });
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
const { [accountId]: _ignored, ...rest } = accounts;
|
|
186
|
-
const updated = withAccounts(cfg, rest);
|
|
187
|
-
await writeRuntimeConfig(api, updated);
|
|
188
|
-
sendJson$3(res, 200, { ok: true, accountId, deleted: true });
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
sendJson$3(res, 405, { ok: false, error: "Method Not Allowed" });
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
function resolveWorkspaceDir(api) {
|
|
195
|
-
const agents = api.config.agents?.list ?? [];
|
|
196
|
-
const defaultAgent = agents.find((agent) => agent?.default === true) ?? agents.find((agent) => String(agent?.id ?? "").toLowerCase() === "main");
|
|
197
|
-
const workspaceRaw = typeof defaultAgent?.workspace === "string" && defaultAgent.workspace.trim() || typeof api.config.agents?.defaults?.workspace === "string" && api.config.agents.defaults.workspace.trim();
|
|
198
|
-
getWorkclawLogger().info(`workspaceRaw: ${workspaceRaw}`);
|
|
199
|
-
if (workspaceRaw) {
|
|
200
|
-
const resolved = api.resolvePath(workspaceRaw);
|
|
201
|
-
if (resolved)
|
|
202
|
-
return resolved;
|
|
203
|
-
}
|
|
204
|
-
const profile = process.env.OPENCLAW_PROFILE?.trim();
|
|
205
|
-
const suffix = profile && profile.toLowerCase() !== "default" ? `workspace-${profile}` : "workspace";
|
|
206
|
-
return path.join(os.homedir(), ".openclaw", suffix);
|
|
207
|
-
}
|
|
208
|
-
function isDefaultWorkspace(api) {
|
|
209
|
-
const agents = api.config.agents?.list ?? [];
|
|
210
|
-
const defaultAgent = agents.find((agent) => agent?.default === true) ?? agents.find((agent) => String(agent?.id ?? "").toLowerCase() === "main");
|
|
211
|
-
const workspaceRaw = typeof defaultAgent?.workspace === "string" && defaultAgent.workspace.trim() || typeof api.config.agents?.defaults?.workspace === "string" && api.config.agents.defaults.workspace.trim();
|
|
212
|
-
if (workspaceRaw)
|
|
213
|
-
return false;
|
|
214
|
-
const profile = process.env.OPENCLAW_PROFILE?.trim();
|
|
215
|
-
return !profile || profile.toLowerCase() === "default";
|
|
216
|
-
}
|
|
217
|
-
const promptNames = ["SOUL.md", "USER.md"];
|
|
218
|
-
function normalizePromptName(raw) {
|
|
219
|
-
const name = String(raw ?? "").trim().toUpperCase();
|
|
220
|
-
if (name === "SOUL" || name === "SOUL.MD")
|
|
221
|
-
return "SOUL.md";
|
|
222
|
-
if (name === "USER" || name === "USER.MD")
|
|
223
|
-
return "USER.md";
|
|
224
|
-
return null;
|
|
225
|
-
}
|
|
226
|
-
function resolvePromptPath(api, name) {
|
|
227
|
-
return path.join(resolveWorkspaceDir(api), name);
|
|
228
|
-
}
|
|
229
|
-
function sendJson$2(res, statusCode, payload) {
|
|
230
|
-
res.statusCode = statusCode;
|
|
231
|
-
res.setHeader("Content-Type", "application/json");
|
|
232
|
-
res.end(JSON.stringify(payload));
|
|
233
|
-
}
|
|
234
|
-
function createPromptsApiHandler(api) {
|
|
235
|
-
return async (req, res) => {
|
|
236
|
-
const method = String(req.method ?? "GET").toUpperCase();
|
|
237
|
-
const url = new URL(req.url ?? "", "http://localhost");
|
|
238
|
-
const name = normalizePromptName(url.searchParams.get("name"));
|
|
239
|
-
if (method === "GET") {
|
|
240
|
-
if (name) {
|
|
241
|
-
const filePath = resolvePromptPath(api, name);
|
|
242
|
-
try {
|
|
243
|
-
const content = await readFile(filePath, "utf-8");
|
|
244
|
-
sendJson$2(res, 200, { ok: true, name, content });
|
|
245
|
-
return;
|
|
246
|
-
} catch {
|
|
247
|
-
sendJson$2(res, 404, { ok: false, error: "Not Found" });
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
const entries = await Promise.all(
|
|
252
|
-
promptNames.map(async (promptName) => {
|
|
253
|
-
const filePath = resolvePromptPath(api, promptName);
|
|
254
|
-
try {
|
|
255
|
-
const info = await stat(filePath);
|
|
256
|
-
return { name: promptName, exists: true, bytes: info.size };
|
|
257
|
-
} catch {
|
|
258
|
-
return { name: promptName, exists: false, bytes: 0 };
|
|
259
|
-
}
|
|
260
|
-
})
|
|
261
|
-
);
|
|
262
|
-
sendJson$2(res, 200, { ok: true, entries });
|
|
263
|
-
return;
|
|
264
|
-
}
|
|
265
|
-
if (method === "PUT" || method === "POST") {
|
|
266
|
-
const raw = await readRequestBody$1(req);
|
|
267
|
-
let input = {};
|
|
268
|
-
try {
|
|
269
|
-
input = raw ? JSON.parse(raw) : {};
|
|
270
|
-
} catch {
|
|
271
|
-
sendJson$2(res, 400, { ok: false, error: "Invalid JSON" });
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
const targetName = normalizePromptName(input?.name);
|
|
275
|
-
const content = typeof input?.content === "string" ? input.content : null;
|
|
276
|
-
if (!targetName || content === null) {
|
|
277
|
-
sendJson$2(res, 400, { ok: false, error: "Missing name or content" });
|
|
278
|
-
return;
|
|
279
|
-
}
|
|
280
|
-
const workspaceDir = resolveWorkspaceDir(api);
|
|
281
|
-
await mkdir(workspaceDir, { recursive: true });
|
|
282
|
-
await writeFile(resolvePromptPath(api, targetName), content, { encoding: "utf-8" });
|
|
283
|
-
sendJson$2(res, 200, { ok: true, name: targetName });
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
if (method === "DELETE") {
|
|
287
|
-
if (!name) {
|
|
288
|
-
sendJson$2(res, 400, { ok: false, error: "Missing name" });
|
|
289
|
-
return;
|
|
290
|
-
}
|
|
291
|
-
const filePath = resolvePromptPath(api, name);
|
|
292
|
-
try {
|
|
293
|
-
await unlink(filePath);
|
|
294
|
-
sendJson$2(res, 200, { ok: true, name, deleted: true });
|
|
295
|
-
return;
|
|
296
|
-
} catch {
|
|
297
|
-
sendJson$2(res, 200, { ok: true, name, deleted: false });
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
sendJson$2(res, 405, { ok: false, error: "Method Not Allowed" });
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
async function readRequestBody$1(req) {
|
|
305
|
-
const chunks = [];
|
|
306
|
-
await new Promise((resolve, reject) => {
|
|
307
|
-
req.on("data", (chunk) => {
|
|
308
|
-
chunks.push(Buffer$1.isBuffer(chunk) ? chunk : Buffer$1.from(chunk));
|
|
309
|
-
});
|
|
310
|
-
req.on("end", () => resolve());
|
|
311
|
-
req.on("error", (err) => reject(err));
|
|
312
|
-
});
|
|
313
|
-
return Buffer$1.concat(chunks).toString("utf-8");
|
|
314
|
-
}
|
|
315
|
-
function sendJson$1(res, statusCode, payload) {
|
|
316
|
-
res.statusCode = statusCode;
|
|
317
|
-
res.setHeader("Content-Type", "application/json");
|
|
318
|
-
res.end(JSON.stringify(payload));
|
|
319
|
-
}
|
|
320
|
-
async function readRequestBody(req) {
|
|
321
|
-
const chunks = [];
|
|
322
|
-
await new Promise((resolve, reject) => {
|
|
323
|
-
req.on("data", (chunk) => {
|
|
324
|
-
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
325
|
-
});
|
|
326
|
-
req.on("end", () => resolve());
|
|
327
|
-
req.on("error", (err) => reject(err));
|
|
328
|
-
});
|
|
329
|
-
return Buffer.concat(chunks).toString("utf-8");
|
|
330
|
-
}
|
|
331
|
-
function buildSessionKey(accountId, userId) {
|
|
332
|
-
return `openclaw-workclaw:${accountId}:${userId}`;
|
|
333
|
-
}
|
|
334
|
-
function parseSessionKey(sessionKey) {
|
|
335
|
-
const parts = sessionKey.split(":");
|
|
336
|
-
if (parts.length !== 3 || parts[0] !== "openclaw-workclaw") {
|
|
337
|
-
return null;
|
|
338
|
-
}
|
|
339
|
-
return {
|
|
340
|
-
channel: parts[0],
|
|
341
|
-
accountId: parts[1],
|
|
342
|
-
userId: parts[2]
|
|
343
|
-
};
|
|
344
|
-
}
|
|
345
|
-
async function resetSession(sessionKey, log) {
|
|
346
|
-
try {
|
|
347
|
-
const runtime = getWorkclawRuntime();
|
|
348
|
-
runtime.system.enqueueSystemEvent("/new", {
|
|
349
|
-
sessionKey,
|
|
350
|
-
contextKey: null
|
|
351
|
-
});
|
|
352
|
-
log?.info?.(`[SessionAPI] Sent /new command to session: ${sessionKey}`);
|
|
353
|
-
return {
|
|
354
|
-
success: true,
|
|
355
|
-
message: `Session reset command sent to ${sessionKey}`
|
|
356
|
-
};
|
|
357
|
-
} catch (err) {
|
|
358
|
-
const errorMsg = `Failed to reset session: ${String(err)}`;
|
|
359
|
-
log?.error?.(`[SessionAPI] ${errorMsg}`);
|
|
360
|
-
return { success: false, message: errorMsg };
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
function getSessionStorePath(agentId, log) {
|
|
364
|
-
try {
|
|
365
|
-
const runtime = getWorkclawRuntime();
|
|
366
|
-
const storePath = runtime.channel.session.resolveStorePath(void 0, {
|
|
367
|
-
agentId
|
|
368
|
-
});
|
|
369
|
-
return storePath;
|
|
370
|
-
} catch (err) {
|
|
371
|
-
log?.error?.(`[SessionAPI] Failed to resolve store path: ${String(err)}`);
|
|
372
|
-
return null;
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
async function getSessionLastUpdated(sessionKey, log) {
|
|
376
|
-
try {
|
|
377
|
-
const runtime = getWorkclawRuntime();
|
|
378
|
-
const storePath = runtime.channel.session.resolveStorePath();
|
|
379
|
-
const updatedAt = runtime.channel.session.readSessionUpdatedAt({
|
|
380
|
-
storePath,
|
|
381
|
-
sessionKey
|
|
382
|
-
});
|
|
383
|
-
return updatedAt ?? null;
|
|
384
|
-
} catch (err) {
|
|
385
|
-
log?.error?.(`[SessionAPI] Failed to read session updated at: ${String(err)}`);
|
|
386
|
-
return null;
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
function createSessionApiHandler(api) {
|
|
390
|
-
return async (req, res) => {
|
|
391
|
-
const method = String(req.method ?? "GET").toUpperCase();
|
|
392
|
-
const url = new URL(req.url ?? "", "http://localhost");
|
|
393
|
-
const fullPath = url.pathname.replace(/\/+$/, "");
|
|
394
|
-
const subPath = fullPath.replace(/^\/openclaw-workclaw\/sessions/, "").replace(/^\//, "") || "/";
|
|
395
|
-
const log = {
|
|
396
|
-
info: (msg) => api.logger?.info?.(`[SessionAPI] ${msg}`),
|
|
397
|
-
error: (msg) => api.logger?.error?.(`[SessionAPI] ${msg}`)
|
|
398
|
-
};
|
|
399
|
-
log?.info?.(`[SessionAPI] ${method} ${fullPath} (subPath: ${subPath})`);
|
|
400
|
-
if (method === "GET" && (subPath === "/" || subPath === "")) {
|
|
401
|
-
const sessionKey = url.searchParams.get("sessionKey");
|
|
402
|
-
if (sessionKey) {
|
|
403
|
-
const parsed = parseSessionKey(sessionKey);
|
|
404
|
-
const updatedAt = await getSessionLastUpdated(sessionKey, log);
|
|
405
|
-
sendJson$1(res, 200, {
|
|
406
|
-
ok: true,
|
|
407
|
-
session: {
|
|
408
|
-
sessionKey,
|
|
409
|
-
parsed,
|
|
410
|
-
lastUpdatedAt: updatedAt,
|
|
411
|
-
lastUpdatedAtFormatted: updatedAt ? new Date(updatedAt).toISOString() : null
|
|
412
|
-
}
|
|
413
|
-
});
|
|
414
|
-
return;
|
|
415
|
-
}
|
|
416
|
-
sendJson$1(res, 200, {
|
|
417
|
-
ok: true,
|
|
418
|
-
message: "Session Management API",
|
|
419
|
-
endpoints: {
|
|
420
|
-
"GET /sessions": "获取会话信息 (可选参数: sessionKey)",
|
|
421
|
-
"POST /sessions/reset": "重置/开启新会话 (参数: accountId + userId 或直接提供 sessionKey)",
|
|
422
|
-
"GET /sessions/store-path": "获取会话存储路径 (可选参数: agentId)"
|
|
423
|
-
}
|
|
424
|
-
});
|
|
425
|
-
return;
|
|
426
|
-
}
|
|
427
|
-
if (method === "POST" && subPath === "reset") {
|
|
428
|
-
const raw = await readRequestBody(req);
|
|
429
|
-
let input = {};
|
|
430
|
-
try {
|
|
431
|
-
input = raw ? JSON.parse(raw) : {};
|
|
432
|
-
} catch {
|
|
433
|
-
sendJson$1(res, 400, { ok: false, error: "Invalid JSON" });
|
|
434
|
-
return;
|
|
435
|
-
}
|
|
436
|
-
const { accountId, userId, sessionKey: directSessionKey } = input;
|
|
437
|
-
let sessionKey;
|
|
438
|
-
if (directSessionKey) {
|
|
439
|
-
sessionKey = directSessionKey;
|
|
440
|
-
} else if (accountId && userId) {
|
|
441
|
-
sessionKey = buildSessionKey(accountId, userId);
|
|
442
|
-
} else {
|
|
443
|
-
sendJson$1(res, 400, {
|
|
444
|
-
ok: false,
|
|
445
|
-
error: "Missing required fields: either provide 'sessionKey' or both 'accountId' and 'userId'"
|
|
446
|
-
});
|
|
447
|
-
return;
|
|
448
|
-
}
|
|
449
|
-
const result = await resetSession(sessionKey, log);
|
|
450
|
-
if (result.success) {
|
|
451
|
-
sendJson$1(res, 200, {
|
|
452
|
-
ok: true,
|
|
453
|
-
message: result.message,
|
|
454
|
-
sessionKey
|
|
455
|
-
});
|
|
456
|
-
} else {
|
|
457
|
-
sendJson$1(res, 500, {
|
|
458
|
-
ok: false,
|
|
459
|
-
error: result.message,
|
|
460
|
-
sessionKey
|
|
461
|
-
});
|
|
462
|
-
}
|
|
463
|
-
return;
|
|
464
|
-
}
|
|
465
|
-
if (method === "GET" && subPath === "store-path") {
|
|
466
|
-
const agentId = url.searchParams.get("agentId") ?? void 0;
|
|
467
|
-
const storePath = getSessionStorePath(agentId, log);
|
|
468
|
-
if (storePath) {
|
|
469
|
-
sendJson$1(res, 200, {
|
|
470
|
-
ok: true,
|
|
471
|
-
storePath,
|
|
472
|
-
agentId: agentId ?? "default"
|
|
473
|
-
});
|
|
474
|
-
} else {
|
|
475
|
-
sendJson$1(res, 500, {
|
|
476
|
-
ok: false,
|
|
477
|
-
error: "Failed to resolve session store path"
|
|
478
|
-
});
|
|
479
|
-
}
|
|
480
|
-
return;
|
|
481
|
-
}
|
|
482
|
-
sendJson$1(res, 404, { ok: false, error: "Not Found" });
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
|
-
const execAsync = promisify(exec);
|
|
486
|
-
function sendJson(res, statusCode, payload) {
|
|
487
|
-
res.statusCode = statusCode;
|
|
488
|
-
res.setHeader("Content-Type", "application/json");
|
|
489
|
-
res.end(JSON.stringify(payload));
|
|
490
|
-
}
|
|
491
|
-
function createSkillsApiHandler(api) {
|
|
492
|
-
return async (req, res) => {
|
|
493
|
-
const method = String(req.method ?? "GET").toUpperCase();
|
|
494
|
-
if (method === "GET") {
|
|
495
|
-
try {
|
|
496
|
-
const { stdout, stderr } = await execAsync("openclaw skills list --json", {
|
|
497
|
-
timeout: 1e4
|
|
498
|
-
// 10秒超时
|
|
499
|
-
});
|
|
500
|
-
if (stderr && !stdout) {
|
|
501
|
-
api.logger.error(`Skills list error: ${stderr}`);
|
|
502
|
-
sendJson(res, 500, { ok: false, error: "Failed to list skills" });
|
|
503
|
-
return;
|
|
504
|
-
}
|
|
505
|
-
let skillsData;
|
|
506
|
-
try {
|
|
507
|
-
skillsData = JSON.parse(stdout);
|
|
508
|
-
} catch {
|
|
509
|
-
const lines = stdout.split("\n");
|
|
510
|
-
const skills = lines.filter((line) => line.trim() && !line.includes("Skills")).map((line) => {
|
|
511
|
-
const parts = line.split(/\s{2,}/).map((p) => p.trim());
|
|
512
|
-
if (parts.length >= 3) {
|
|
513
|
-
return {
|
|
514
|
-
status: parts[0]?.includes("✓") ? "ready" : "missing",
|
|
515
|
-
name: parts[1],
|
|
516
|
-
description: parts[2],
|
|
517
|
-
source: parts[3] || "openclaw-bundled"
|
|
518
|
-
};
|
|
519
|
-
}
|
|
520
|
-
return null;
|
|
521
|
-
}).filter((s) => s !== null);
|
|
522
|
-
skillsData = {
|
|
523
|
-
total: skills.length,
|
|
524
|
-
ready: skills.filter((s) => s.status === "ready").length,
|
|
525
|
-
missing: skills.filter((s) => s.status === "missing").length,
|
|
526
|
-
skills
|
|
527
|
-
};
|
|
528
|
-
}
|
|
529
|
-
sendJson(res, 200, { ok: true, ...skillsData });
|
|
530
|
-
return;
|
|
531
|
-
} catch (error2) {
|
|
532
|
-
api.logger.error(`Skills API error: ${error2.message}`);
|
|
533
|
-
sendJson(res, 500, { ok: false, error: error2.message });
|
|
534
|
-
return;
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
sendJson(res, 405, { ok: false, error: "Method Not Allowed" });
|
|
538
|
-
};
|
|
539
|
-
}
|
|
540
|
-
function parseRelativeTime(timeStr) {
|
|
541
|
-
const s = timeStr.trim().toLowerCase();
|
|
542
|
-
if (/^\d+$/.test(s)) {
|
|
543
|
-
return Number.parseInt(s, 10) * 6e4;
|
|
544
|
-
}
|
|
545
|
-
let totalMs = 0;
|
|
546
|
-
let matched = false;
|
|
547
|
-
const regex = /(\d+(?:\.\d+)?)\s*([dhms])/g;
|
|
548
|
-
let match;
|
|
549
|
-
while ((match = regex.exec(s)) !== null) {
|
|
550
|
-
matched = true;
|
|
551
|
-
const value = Number.parseFloat(match[1]);
|
|
552
|
-
const unit = match[2];
|
|
553
|
-
switch (unit) {
|
|
554
|
-
case "d":
|
|
555
|
-
totalMs += value * 864e5;
|
|
556
|
-
break;
|
|
557
|
-
case "h":
|
|
558
|
-
totalMs += value * 36e5;
|
|
559
|
-
break;
|
|
560
|
-
case "m":
|
|
561
|
-
totalMs += value * 6e4;
|
|
562
|
-
break;
|
|
563
|
-
case "s":
|
|
564
|
-
totalMs += value * 1e3;
|
|
565
|
-
break;
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
return matched ? Math.round(totalMs) : null;
|
|
569
|
-
}
|
|
570
|
-
function isCronExpression(timeStr) {
|
|
571
|
-
const parts = timeStr.trim().split(/\s+/);
|
|
572
|
-
return parts.length >= 3 && parts.length <= 6;
|
|
573
|
-
}
|
|
574
|
-
function validateCronExpression(timeStr) {
|
|
575
|
-
const parts = timeStr.trim().split(/\s+/);
|
|
576
|
-
if (parts.length < 3 || parts.length > 6) {
|
|
577
|
-
return { valid: false, error: `无效的 cron 表达式:字段数量不正确(期望 3-6 个字段,实际 ${parts.length} 个)` };
|
|
578
|
-
}
|
|
579
|
-
const patterns = [
|
|
580
|
-
/^(\*|[0-5]?\d(-[0-5]?\d)?(\/[0-5]?\d)?|L(-[0-5]?\d)?|W?)$/,
|
|
581
|
-
/^(\*|[0-5]?\d(-[0-5]?\d)?(\/[0-5]?\d)?|L(-[0-5]?\d)?|W?)$/,
|
|
582
|
-
/^(\*|[01]?\d|2[0-3](-[01]?\d|2[0-3])?(\/\d|[01]?\d|2[0-3])?|L(-[01]?\d|2[0-3])?|W)?$/,
|
|
583
|
-
/^(\*|1[0-2]|0?[1-9](-[1-9]|0?[1-9])?(\/[1-9]|0?[1-9])?|L(-1[0-2]|0?[1-9])?|W)?$/,
|
|
584
|
-
/^([*LW]|[0-6](-[0-6])?(\/[0-6])?|L-[0-6])?$/,
|
|
585
|
-
/^(\*|L|(\*\/)?\d{1,2})?$/
|
|
586
|
-
];
|
|
587
|
-
const fieldNames = ["秒", "分钟", "小时", "日期", "月份", "星期"];
|
|
588
|
-
for (let i = 0; i < parts.length && i < patterns.length; i++) {
|
|
589
|
-
const part = parts[i].trim();
|
|
590
|
-
const offset = parts.length - patterns.length;
|
|
591
|
-
if (i < offset)
|
|
592
|
-
continue;
|
|
593
|
-
if (!patterns[i].test(part)) {
|
|
594
|
-
return { valid: false, error: `无效的 cron 表达式:${fieldNames[i]}字段 "${part}" 格式不正确` };
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
return { valid: true };
|
|
598
|
-
}
|
|
599
|
-
function validateTimeFormat(timeStr) {
|
|
600
|
-
if (!timeStr || typeof timeStr !== "string" || timeStr.trim() === "") {
|
|
601
|
-
return { valid: false, error: "时间参数不能为空" };
|
|
602
|
-
}
|
|
603
|
-
const trimmed = timeStr.trim();
|
|
604
|
-
if (trimmed.startsWith("+") || /^\d+$/.test(trimmed) || /^\d+[dhms]/.test(trimmed)) {
|
|
605
|
-
const relativeMs = parseRelativeTime(trimmed);
|
|
606
|
-
if (relativeMs === null) {
|
|
607
|
-
return { valid: false, error: `无法解析相对时间 "${trimmed}",支持的格式:5m、1h、1h30m、2d、30s 等` };
|
|
608
|
-
}
|
|
609
|
-
if (relativeMs < 3e4) {
|
|
610
|
-
return { valid: false, error: "提醒时间不能少于 30 秒" };
|
|
611
|
-
}
|
|
612
|
-
return { valid: true };
|
|
613
|
-
}
|
|
614
|
-
if (isCronExpression(trimmed)) {
|
|
615
|
-
return validateCronExpression(trimmed);
|
|
616
|
-
}
|
|
617
|
-
return { valid: false, error: `无法解析时间 "${trimmed}",请使用相对时间(如 5m、1h)或 cron 表达式(如 0 8 * * *)` };
|
|
618
|
-
}
|
|
619
|
-
function relativeToCron(timeStr) {
|
|
620
|
-
const delayMs = parseRelativeTime(timeStr);
|
|
621
|
-
if (delayMs === null) {
|
|
622
|
-
return timeStr;
|
|
623
|
-
}
|
|
624
|
-
const futureTime = new Date(Date.now() + delayMs);
|
|
625
|
-
const seconds = futureTime.getSeconds();
|
|
626
|
-
const minutes = futureTime.getMinutes();
|
|
627
|
-
const hours = futureTime.getHours();
|
|
628
|
-
const dayOfMonth = futureTime.getDate();
|
|
629
|
-
const month = futureTime.getMonth() + 1;
|
|
630
|
-
return `${seconds} ${minutes} ${hours} ${dayOfMonth} ${month} *`;
|
|
631
|
-
}
|
|
632
|
-
const AddParamsSchema = {
|
|
633
|
-
type: "object",
|
|
634
|
-
properties: {
|
|
635
|
-
time: {
|
|
636
|
-
type: "string",
|
|
637
|
-
description: "⏰ 时间(核心!),支持相对时间和 cron 表达式,工具自动转换"
|
|
638
|
-
},
|
|
639
|
-
name: {
|
|
640
|
-
type: "string",
|
|
641
|
-
description: "任务名称"
|
|
642
|
-
},
|
|
643
|
-
message: {
|
|
644
|
-
type: "string",
|
|
645
|
-
description: "提醒内容"
|
|
646
|
-
}
|
|
647
|
-
},
|
|
648
|
-
required: ["time", "name", "message"]
|
|
649
|
-
};
|
|
650
|
-
function json$a(data) {
|
|
651
|
-
return {
|
|
652
|
-
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
653
|
-
details: data
|
|
654
|
-
};
|
|
655
|
-
}
|
|
656
|
-
function getOpenclawWorkclawCronAddParamsTool(api) {
|
|
657
|
-
return (ctx) => {
|
|
658
|
-
return {
|
|
659
|
-
name: "openclaw-workclaw-cron-add-params",
|
|
660
|
-
label: "智小途生成创建提醒参数",
|
|
661
|
-
description: `【核心工具】生成创建提醒的 cronParams 参数。
|
|
662
|
-
|
|
663
|
-
📋 工作流程(必须按顺序执行):
|
|
664
|
-
1. 调用此工具获取 cronParams 参数
|
|
665
|
-
2. 使用返回的 cronParams 调用 OpenClaw 的 cron 工具
|
|
666
|
-
3. 从 cron 工具返回值中提取 jobId(返回格式:{"success": true, "jobId": "xxx"})
|
|
667
|
-
4. 必须调用 openclaw-workclaw-cron-add-sync 同步到后端
|
|
668
|
-
|
|
669
|
-
⏰ 时间格式(核心!):
|
|
670
|
-
- time 参数支持相对时间(如 "5m"、"1h"、"2d")和 cron 表达式
|
|
671
|
-
- 工具会自动将所有时间统一转换为 cron 表达式
|
|
672
|
-
- 严禁使用 --at 参数或其他绝对时间格式
|
|
673
|
-
- 最终 CLI 命令必须使用 --cron 参数
|
|
674
|
-
|
|
675
|
-
🔒 强制规则:
|
|
676
|
-
- schedule.kind 必须是 "cron"
|
|
677
|
-
- 必须使用 --cron 参数传递 cron 表达式
|
|
678
|
-
|
|
679
|
-
⚠️ 必须从 cron 工具返回值中提取 jobId,不能凭空编造!`,
|
|
680
|
-
parameters: AddParamsSchema,
|
|
681
|
-
execute: async (_toolCallId, params) => {
|
|
682
|
-
const p = params;
|
|
683
|
-
api.logger.info(`[智小途-生成参数] 开始生成创建提醒参数 name=${p.name} time=${p.time}`);
|
|
684
|
-
if (!p.time) {
|
|
685
|
-
api.logger.warn("[智小途-生成参数] 缺少时间参数");
|
|
686
|
-
return json$a({ error: "time(时间)为必填参数" });
|
|
687
|
-
}
|
|
688
|
-
if (!p.name) {
|
|
689
|
-
api.logger.warn("[智小途-生成参数] 缺少任务名称参数");
|
|
690
|
-
return json$a({ error: "name(任务名称)为必填参数" });
|
|
691
|
-
}
|
|
692
|
-
if (!p.message) {
|
|
693
|
-
api.logger.warn("[智小途-生成参数] 缺少用户消息参数");
|
|
694
|
-
return json$a({ error: "message(用户消息)为必填参数" });
|
|
695
|
-
}
|
|
696
|
-
const accountId = ctx?.agentAccountId;
|
|
697
|
-
if (!accountId) {
|
|
698
|
-
api.logger.warn("[智小途-生成参数] 无法获取账户 ID");
|
|
699
|
-
return json$a({ error: "无法获取账户 ID(accountId),请确保已配置账户" });
|
|
700
|
-
}
|
|
701
|
-
api.logger.info(`[智小途-生成参数] accountId=${accountId} name=${p.name}`);
|
|
702
|
-
const timeValidation = validateTimeFormat(p.time);
|
|
703
|
-
if (!timeValidation.valid) {
|
|
704
|
-
api.logger.warn(`[智小途-生成参数] 时间格式校验失败: ${timeValidation.error}`);
|
|
705
|
-
return json$a({ error: timeValidation.error });
|
|
706
|
-
}
|
|
707
|
-
const isCron = isCronExpression(p.time);
|
|
708
|
-
let isOneTime = false;
|
|
709
|
-
let cronExpr;
|
|
710
|
-
if (!isCron) {
|
|
711
|
-
isOneTime = true;
|
|
712
|
-
cronExpr = relativeToCron(p.time.trim());
|
|
713
|
-
api.logger.info(`[智小途-生成参数] 相对时间转换为 cron 表达式 cronExpr=${cronExpr}`);
|
|
714
|
-
} else {
|
|
715
|
-
cronExpr = p.time.trim();
|
|
716
|
-
}
|
|
717
|
-
const cronParams = {
|
|
718
|
-
action: "add",
|
|
719
|
-
account: accountId,
|
|
720
|
-
job: {
|
|
721
|
-
name: p.name,
|
|
722
|
-
schedule: {
|
|
723
|
-
kind: "cron",
|
|
724
|
-
expr: cronExpr,
|
|
725
|
-
tz: "Asia/Shanghai"
|
|
726
|
-
},
|
|
727
|
-
sessionTarget: "isolated",
|
|
728
|
-
wakeMode: "now",
|
|
729
|
-
deleteAfterRun: isOneTime ? true : void 0,
|
|
730
|
-
payload: {
|
|
731
|
-
kind: "agentTurn",
|
|
732
|
-
message: p.message
|
|
733
|
-
},
|
|
734
|
-
delivery: {
|
|
735
|
-
mode: "announce",
|
|
736
|
-
channel: "openclaw-workclaw"
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
};
|
|
740
|
-
api.logger.info(`[智小途-生成参数] 构建 cron 参数 cronParams=${JSON.stringify(cronParams)}`);
|
|
741
|
-
return json$a({
|
|
742
|
-
cronParams,
|
|
743
|
-
meta: {
|
|
744
|
-
accountId,
|
|
745
|
-
name: p.name,
|
|
746
|
-
kind: "cron",
|
|
747
|
-
expr: cronExpr,
|
|
748
|
-
message: p.message
|
|
749
|
-
},
|
|
750
|
-
summary: `⏰ 提醒已生成: "${p.name}" (${p.time})`
|
|
751
|
-
});
|
|
752
|
-
}
|
|
753
|
-
};
|
|
754
|
-
};
|
|
755
|
-
}
|
|
756
|
-
function registerOpenclawWorkclawCronAddParamsTool(api) {
|
|
757
|
-
api.registerTool(getOpenclawWorkclawCronAddParamsTool(api), {
|
|
758
|
-
name: "openclaw-workclaw-cron-add-params"
|
|
759
|
-
});
|
|
760
|
-
}
|
|
761
|
-
const DEFAULT_MAX_RETRIES = 3;
|
|
762
|
-
const DEFAULT_RETRY_DELAY_MS = 1e3;
|
|
763
|
-
function sleep(ms) {
|
|
764
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
765
|
-
}
|
|
766
|
-
async function fetchWithRetry(fetchFn, options = {}) {
|
|
767
|
-
const maxRetries = options.maxRetries ?? DEFAULT_MAX_RETRIES;
|
|
768
|
-
const retryDelayMs = options.retryDelayMs ?? DEFAULT_RETRY_DELAY_MS;
|
|
769
|
-
const retryableErrors = options.retryableErrors ?? [
|
|
770
|
-
"ECONNREFUSED",
|
|
771
|
-
"ETIMEDOUT",
|
|
772
|
-
"ENOTFOUND",
|
|
773
|
-
"ENETUNREACH",
|
|
774
|
-
"EAI_AGAIN"
|
|
775
|
-
];
|
|
776
|
-
let lastError = "";
|
|
777
|
-
let attempts = 0;
|
|
778
|
-
for (let i = 0; i <= maxRetries; i++) {
|
|
779
|
-
attempts = i + 1;
|
|
780
|
-
try {
|
|
781
|
-
const data = await fetchFn();
|
|
782
|
-
return { data, attempts };
|
|
783
|
-
} catch (error2) {
|
|
784
|
-
lastError = error2.message || String(error2);
|
|
785
|
-
const isRetryable = retryableErrors.some(
|
|
786
|
-
(e) => lastError.toLowerCase().includes(e.toLowerCase())
|
|
787
|
-
);
|
|
788
|
-
if (i < maxRetries && isRetryable) {
|
|
789
|
-
const delay = retryDelayMs * 2 ** i;
|
|
790
|
-
await sleep(delay);
|
|
791
|
-
continue;
|
|
792
|
-
}
|
|
793
|
-
break;
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
return { error: lastError, attempts };
|
|
797
|
-
}
|
|
798
|
-
function sanitizePayload(payload) {
|
|
799
|
-
const sensitiveFields = [
|
|
800
|
-
"password",
|
|
801
|
-
"secret",
|
|
802
|
-
"token",
|
|
803
|
-
"authorization",
|
|
804
|
-
"appSecret",
|
|
805
|
-
"appSecret"
|
|
806
|
-
];
|
|
807
|
-
const sanitized = {};
|
|
808
|
-
for (const [key, value] of Object.entries(payload)) {
|
|
809
|
-
const lowerKey = key.toLowerCase();
|
|
810
|
-
if (sensitiveFields.some((f) => lowerKey.includes(f))) {
|
|
811
|
-
sanitized[key] = "***";
|
|
812
|
-
} else if (typeof value === "object" && value !== null) {
|
|
813
|
-
sanitized[key] = sanitizePayload(value);
|
|
814
|
-
} else {
|
|
815
|
-
sanitized[key] = value;
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
return sanitized;
|
|
819
|
-
}
|
|
820
|
-
async function callBackendApi(api, accountId, path2, payload, options = {}) {
|
|
821
|
-
try {
|
|
822
|
-
const account = resolveWorkclawAccountWithCache({
|
|
823
|
-
cfg: api.config,
|
|
824
|
-
accountId
|
|
825
|
-
});
|
|
826
|
-
if (!account.configured) {
|
|
827
|
-
api.logger.error(`[智小途-定时任务] 账户未配置 accountId=${accountId}`);
|
|
828
|
-
return { success: false, error: "Account not configured" };
|
|
829
|
-
}
|
|
830
|
-
const accConfig = account.config;
|
|
831
|
-
const tokenCacheKey = accConfig.appKey || accountId;
|
|
832
|
-
const baseUrl = normalizeBaseUrl(accConfig.baseUrl);
|
|
833
|
-
api.logger.info(`[智小途-定时任务] 正在获取认证 token,accountId=${accountId}`);
|
|
834
|
-
const token = await getWorkclawAccessToken(tokenCacheKey, {
|
|
835
|
-
baseUrl: accConfig.baseUrl,
|
|
836
|
-
appKey: accConfig.appKey,
|
|
837
|
-
appSecret: accConfig.appSecret,
|
|
838
|
-
allowInsecureTls: accConfig.allowInsecureTls,
|
|
839
|
-
requestTimeout: accConfig.requestTimeout
|
|
840
|
-
});
|
|
841
|
-
const requestUrl = `${baseUrl}/open-apis${path2}`;
|
|
842
|
-
const sanitizedPayload = sanitizePayload(payload);
|
|
843
|
-
api.logger.info(`[智小途-定时任务] 调用接口 ${requestUrl}`);
|
|
844
|
-
api.logger.info(`[智小途-定时任务] 请求参数 ${JSON.stringify(sanitizedPayload)}`);
|
|
845
|
-
const maxRetries = options.maxRetries ?? DEFAULT_MAX_RETRIES;
|
|
846
|
-
const fetchResult = await fetchWithRetry(
|
|
847
|
-
() => doFetchJson(
|
|
848
|
-
requestUrl,
|
|
849
|
-
{
|
|
850
|
-
method: "POST",
|
|
851
|
-
headers: {
|
|
852
|
-
"Content-Type": "application/json",
|
|
853
|
-
"Authorization": `Bearer ${token}`
|
|
854
|
-
},
|
|
855
|
-
body: JSON.stringify(payload)
|
|
856
|
-
},
|
|
857
|
-
accConfig.allowInsecureTls,
|
|
858
|
-
accConfig.requestTimeout
|
|
859
|
-
),
|
|
860
|
-
{ maxRetries }
|
|
861
|
-
);
|
|
862
|
-
if (fetchResult.error) {
|
|
863
|
-
api.logger.error(`[智小途-定时任务] 接口调用失败(已重试 ${fetchResult.attempts} 次): ${fetchResult.error}`);
|
|
864
|
-
return { success: false, error: fetchResult.error, attempts: fetchResult.attempts };
|
|
865
|
-
}
|
|
866
|
-
const data = fetchResult.data;
|
|
867
|
-
api.logger.info(`[智小途-定时任务] 接口响应(尝试 ${fetchResult.attempts} 次): ${JSON.stringify(data)}`);
|
|
868
|
-
if (data?.code === 200 || data?.code === 0) {
|
|
869
|
-
return { success: true, data, attempts: fetchResult.attempts };
|
|
870
|
-
} else {
|
|
871
|
-
const errorMsg = data?.message || data?.msg || "Unknown error";
|
|
872
|
-
api.logger.error(`[智小途-定时任务] 接口返回错误 ${errorMsg}`);
|
|
873
|
-
return { success: false, error: errorMsg };
|
|
874
|
-
}
|
|
875
|
-
} catch (error2) {
|
|
876
|
-
api.logger.error(`[智小途-定时任务] 接口调用异常 ${error2.message}`);
|
|
877
|
-
return { success: false, error: error2.message };
|
|
878
|
-
}
|
|
879
|
-
}
|
|
880
|
-
async function callCronJobAdd(api, accountId, payload) {
|
|
881
|
-
api.logger.info(`[智小途-定时任务] 新增定时任务 jobId=${payload.jobId} name=${payload.name}`);
|
|
882
|
-
const result = await callBackendApi(api, accountId, "/cron/job/add", {
|
|
883
|
-
clawJobId: payload.jobId,
|
|
884
|
-
name: payload.name,
|
|
885
|
-
kind: payload.kind,
|
|
886
|
-
expr: payload.expr || "",
|
|
887
|
-
message: payload.message,
|
|
888
|
-
agentId: payload.messageId || "0"
|
|
889
|
-
});
|
|
890
|
-
return { success: result.success, data: result.data, error: result.error };
|
|
891
|
-
}
|
|
892
|
-
async function callCronJobRemove(api, accountId, payload) {
|
|
893
|
-
api.logger.info(`[智小途-定时任务] 删除定时任务 jobId=${payload.jobId}`);
|
|
894
|
-
const result = await callBackendApi(api, accountId, "/cron/job/del", {
|
|
895
|
-
clawJobId: payload.jobId
|
|
896
|
-
});
|
|
897
|
-
return { success: result.success, data: result.data, error: result.error };
|
|
898
|
-
}
|
|
899
|
-
async function callCronJobUpdate(api, accountId, payload) {
|
|
900
|
-
api.logger.info(`[智小途-定时任务] 更新定时任务 jobId=${payload.jobId} name=${payload.name} agentId=${payload.agentId}`);
|
|
901
|
-
const result = await callBackendApi(api, accountId, "/cron/job/update", {
|
|
902
|
-
clawJobId: payload.jobId,
|
|
903
|
-
name: payload.name,
|
|
904
|
-
kind: payload.kind,
|
|
905
|
-
expr: payload.expr || "",
|
|
906
|
-
message: payload.message,
|
|
907
|
-
agentId: payload.agentId || "0"
|
|
908
|
-
});
|
|
909
|
-
return { success: result.success, data: result.data, error: result.error };
|
|
910
|
-
}
|
|
911
|
-
async function callCronJobEnabled(api, accountId, payload) {
|
|
912
|
-
api.logger.info(`[智小途-定时任务] 启用定时任务 jobId=${payload.jobId}`);
|
|
913
|
-
const result = await callBackendApi(api, accountId, "/cron/job/enabled", {
|
|
914
|
-
clawJobId: payload.jobId
|
|
915
|
-
});
|
|
916
|
-
return { success: result.success, data: result.data, error: result.error };
|
|
917
|
-
}
|
|
918
|
-
async function callCronJobDisabled(api, accountId, payload) {
|
|
919
|
-
api.logger.info(`[智小途-定时任务] 禁用定时任务 jobId=${payload.jobId}`);
|
|
920
|
-
const result = await callBackendApi(api, accountId, "/cron/job/disabled", {
|
|
921
|
-
clawJobId: payload.jobId
|
|
922
|
-
});
|
|
923
|
-
return { success: result.success, data: result.data, error: result.error };
|
|
924
|
-
}
|
|
925
|
-
async function callCronJobMessage(api, accountId, payload) {
|
|
926
|
-
api.logger.info(`[智小途-定时任务] 定时任务触发通知 jobId=${payload.jobId} message=${payload.message} agentId=${payload.agentId}`);
|
|
927
|
-
const result = await callBackendApi(api, accountId, "/cron/job/message", {
|
|
928
|
-
clawJobId: payload.jobId,
|
|
929
|
-
message: payload.message,
|
|
930
|
-
agentId: payload.agentId || "0"
|
|
931
|
-
});
|
|
932
|
-
return { success: result.success, data: result.data, error: result.error };
|
|
933
|
-
}
|
|
934
|
-
const AddSyncSchema = {
|
|
935
|
-
type: "object",
|
|
936
|
-
properties: {
|
|
937
|
-
jobId: {
|
|
938
|
-
type: "string",
|
|
939
|
-
description: `⛔ 重要:jobId 必须从 OpenClaw cron 工具返回值中提取,格式:{"success": true, "jobId": "123456"}
|
|
940
|
-
|
|
941
|
-
常见错误:
|
|
942
|
-
- 把 cron 表达式(如 "31 12 11 31 3 *")当作 jobId
|
|
943
|
-
- 把 name 当作 jobId
|
|
944
|
-
- 编造 jobId
|
|
945
|
-
|
|
946
|
-
正确做法:
|
|
947
|
-
1. 调用 openclaw-workclaw-cron-add-params
|
|
948
|
-
2. 用返回的 cronParams 调用 cron 工具
|
|
949
|
-
3. 从返回值提取 jobId(如 "7382945612345")
|
|
950
|
-
4. 用提取到的 jobId 调用此工具`
|
|
951
|
-
},
|
|
952
|
-
name: {
|
|
953
|
-
type: "string",
|
|
954
|
-
description: "任务名称,与 add-params 中传入的 name 一致"
|
|
955
|
-
},
|
|
956
|
-
kind: {
|
|
957
|
-
type: "string",
|
|
958
|
-
description: "任务类型",
|
|
959
|
-
enum: ["cron"]
|
|
960
|
-
},
|
|
961
|
-
expr: {
|
|
962
|
-
type: "string",
|
|
963
|
-
description: "Cron 表达式"
|
|
964
|
-
},
|
|
965
|
-
message: {
|
|
966
|
-
type: "string",
|
|
967
|
-
description: "提醒消息,与 add-params 中传入的 message 一致"
|
|
968
|
-
}
|
|
969
|
-
},
|
|
970
|
-
required: ["jobId", "name", "kind", "message"]
|
|
971
|
-
};
|
|
972
|
-
function json$9(data) {
|
|
973
|
-
return {
|
|
974
|
-
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
975
|
-
details: data
|
|
976
|
-
};
|
|
977
|
-
}
|
|
978
|
-
function getOpenclawWorkclawCronAddSyncTool(api) {
|
|
979
|
-
return (ctx) => {
|
|
980
|
-
return {
|
|
981
|
-
name: "openclaw-workclaw-cron-add-sync",
|
|
982
|
-
label: "智小途同步创建提醒",
|
|
983
|
-
description: `【后端同步步骤】将创建定时任务同步到后端。必须在上一步 openclaw-workclaw-cron-add-params 执行后调用此工具完成同步。
|
|
984
|
-
|
|
985
|
-
⚠️ jobId 必须是 cron 工具返回值 {"success": true, "jobId": "xxx"} 中的 jobId 字段!`,
|
|
986
|
-
parameters: AddSyncSchema,
|
|
987
|
-
execute: async (_toolCallId, params) => {
|
|
988
|
-
const p = params;
|
|
989
|
-
api.logger.info(`[智小途-同步创建] 开始同步 jobId=${p.jobId} name=${p.name}`);
|
|
990
|
-
if (!p.jobId) {
|
|
991
|
-
api.logger.warn("[智小途-同步创建] 缺少 jobId 参数");
|
|
992
|
-
return json$9({ error: "jobId 为必填参数" });
|
|
993
|
-
}
|
|
994
|
-
const jobIdTrimmed = p.jobId.trim();
|
|
995
|
-
const parts = jobIdTrimmed.split(/\s+/);
|
|
996
|
-
const isCronExpression2 = parts.length >= 5 && parts.length <= 6 && jobIdTrimmed.includes("*");
|
|
997
|
-
if (isCronExpression2) {
|
|
998
|
-
api.logger.error(`[智小途-同步创建] jobId 格式错误!jobId=${p.jobId},看起来像 cron 表达式`);
|
|
999
|
-
return json$9({
|
|
1000
|
-
error: `jobId="${p.jobId}" 是 cron 表达式,不是任务 ID!jobId 应来自 cron 工具返回值,如 "123456" 或 "abc123"`
|
|
1001
|
-
});
|
|
1002
|
-
}
|
|
1003
|
-
if (!p.name) {
|
|
1004
|
-
api.logger.warn("[智小途-同步创建] 缺少 name 参数");
|
|
1005
|
-
return json$9({ error: "name 为必填参数" });
|
|
1006
|
-
}
|
|
1007
|
-
if (!p.message) {
|
|
1008
|
-
api.logger.warn("[智小途-同步创建] 缺少 message 参数");
|
|
1009
|
-
return json$9({ error: "message 为必填参数" });
|
|
1010
|
-
}
|
|
1011
|
-
const accountId = ctx?.agentAccountId;
|
|
1012
|
-
if (!accountId) {
|
|
1013
|
-
api.logger.warn("[智小途-同步创建] 无法获取账户 ID");
|
|
1014
|
-
return json$9({ error: "无法获取账户 ID(accountId),请确保已配置账户" });
|
|
1015
|
-
}
|
|
1016
|
-
const accountConfig = resolveWorkclawAccountWithCache({
|
|
1017
|
-
cfg: ctx.config,
|
|
1018
|
-
accountId
|
|
1019
|
-
});
|
|
1020
|
-
if (accountConfig.configured) {
|
|
1021
|
-
try {
|
|
1022
|
-
const channelAgentId = String(accountConfig.config.agentId);
|
|
1023
|
-
api.logger.info(`[智小途-同步创建] accountId=${accountId} channelAgentId=${channelAgentId}`);
|
|
1024
|
-
const result = await callCronJobAdd(api, accountId, {
|
|
1025
|
-
jobId: p.jobId,
|
|
1026
|
-
name: p.name,
|
|
1027
|
-
kind: p.kind,
|
|
1028
|
-
expr: p.expr,
|
|
1029
|
-
message: p.message,
|
|
1030
|
-
messageId: channelAgentId
|
|
1031
|
-
});
|
|
1032
|
-
if (result.success) {
|
|
1033
|
-
api.logger.info(`[智小途-同步创建] 后端同步成功 jobId=${p.jobId}`);
|
|
1034
|
-
return json$9({
|
|
1035
|
-
code: 0,
|
|
1036
|
-
message: "定时任务已创建并同步到后端",
|
|
1037
|
-
data: {
|
|
1038
|
-
jobId: p.jobId,
|
|
1039
|
-
name: p.name,
|
|
1040
|
-
message: p.message,
|
|
1041
|
-
backendSynced: true
|
|
1042
|
-
}
|
|
1043
|
-
});
|
|
1044
|
-
} else {
|
|
1045
|
-
api.logger.error(`[智小途-同步创建] 后端同步失败 ${result.error}`);
|
|
1046
|
-
return json$9({
|
|
1047
|
-
code: -1,
|
|
1048
|
-
error: result.error || "后端同步失败",
|
|
1049
|
-
data: { jobId: p.jobId, name: p.name }
|
|
1050
|
-
});
|
|
1051
|
-
}
|
|
1052
|
-
} catch (error2) {
|
|
1053
|
-
api.logger.error(`[智小途-同步创建] 后端同步异常 ${error2.message}`);
|
|
1054
|
-
return json$9({
|
|
1055
|
-
code: -1,
|
|
1056
|
-
error: error2.message,
|
|
1057
|
-
data: { jobId: p.jobId, name: p.name }
|
|
1058
|
-
});
|
|
1059
|
-
}
|
|
1060
|
-
} else {
|
|
1061
|
-
api.logger.error(`[智小途-同步创建] 无法获取渠道配置,accountId=${accountId}`);
|
|
1062
|
-
return json$9({ error: "无法获取渠道配置,请检查账户配置" });
|
|
1063
|
-
}
|
|
1064
|
-
}
|
|
1065
|
-
};
|
|
1066
|
-
};
|
|
1067
|
-
}
|
|
1068
|
-
function registerOpenclawWorkclawCronAddSyncTool(api) {
|
|
1069
|
-
api.registerTool(getOpenclawWorkclawCronAddSyncTool(api), {
|
|
1070
|
-
name: "openclaw-workclaw-cron-add-sync"
|
|
1071
|
-
});
|
|
1072
|
-
}
|
|
1073
|
-
const DisableParamsSchema = {
|
|
1074
|
-
type: "object",
|
|
1075
|
-
properties: {
|
|
1076
|
-
jobId: {
|
|
1077
|
-
type: "string",
|
|
1078
|
-
description: `OpenClaw 任务 ID(必须是数字或字符串,不是 cron 表达式)`
|
|
1079
|
-
}
|
|
1080
|
-
},
|
|
1081
|
-
required: ["jobId"]
|
|
1082
|
-
};
|
|
1083
|
-
function json$8(data) {
|
|
1084
|
-
return {
|
|
1085
|
-
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
1086
|
-
details: data
|
|
1087
|
-
};
|
|
1088
|
-
}
|
|
1089
|
-
function getOpenclawWorkclawCronDisableParamsTool(api) {
|
|
1090
|
-
return (ctx) => {
|
|
1091
|
-
return {
|
|
1092
|
-
name: "openclaw-workclaw-cron-disable-params",
|
|
1093
|
-
label: "智小途生成禁用提醒参数",
|
|
1094
|
-
description: `生成禁用提醒的 CLI 命令参数。
|
|
1095
|
-
|
|
1096
|
-
📋 工作流程:
|
|
1097
|
-
1. 调用此工具获取 CLI 命令参数
|
|
1098
|
-
2. 使用返回的 cronParams 调用 OpenClaw 的 cron 工具
|
|
1099
|
-
3. 调用 openclaw-workclaw-cron-disable-sync 同步到后端`,
|
|
1100
|
-
parameters: DisableParamsSchema,
|
|
1101
|
-
execute: async (_toolCallId, params) => {
|
|
1102
|
-
const p = params;
|
|
1103
|
-
api.logger.info(`[智小途-生成禁用参数] 开始处理 jobId=${p.jobId}`);
|
|
1104
|
-
if (!p.jobId) {
|
|
1105
|
-
api.logger.warn("[智小途-生成禁用参数] 缺少 jobId 参数");
|
|
1106
|
-
return json$8({ error: "jobId 为必填参数" });
|
|
1107
|
-
}
|
|
1108
|
-
const accountId = ctx?.agentAccountId;
|
|
1109
|
-
if (!accountId) {
|
|
1110
|
-
api.logger.warn("[智小途-生成禁用参数] 无法获取账户 ID");
|
|
1111
|
-
return json$8({ error: "无法获取账户 ID(accountId),请确保已配置账户" });
|
|
1112
|
-
}
|
|
1113
|
-
api.logger.info(`[智小途-生成禁用参数] accountId=${accountId} jobId=${p.jobId}`);
|
|
1114
|
-
const cronParams = {
|
|
1115
|
-
action: "disable",
|
|
1116
|
-
jobId: p.jobId
|
|
1117
|
-
};
|
|
1118
|
-
api.logger.info(`[智小途-生成禁用参数] 构建 cron 参数 cronParams=${JSON.stringify(cronParams)}`);
|
|
1119
|
-
return json$8({
|
|
1120
|
-
cronParams,
|
|
1121
|
-
meta: {
|
|
1122
|
-
accountId,
|
|
1123
|
-
jobId: p.jobId
|
|
1124
|
-
},
|
|
1125
|
-
summary: `⏸️ 提醒已禁用: jobId=${p.jobId}`
|
|
1126
|
-
});
|
|
1127
|
-
}
|
|
1128
|
-
};
|
|
1129
|
-
};
|
|
1130
|
-
}
|
|
1131
|
-
function registerOpenclawWorkclawCronDisableParamsTool(api) {
|
|
1132
|
-
api.registerTool(getOpenclawWorkclawCronDisableParamsTool(api), {
|
|
1133
|
-
name: "openclaw-workclaw-cron-disable-params"
|
|
1134
|
-
});
|
|
1135
|
-
}
|
|
1136
|
-
const DisableSyncSchema = {
|
|
1137
|
-
type: "object",
|
|
1138
|
-
properties: {
|
|
1139
|
-
jobId: {
|
|
1140
|
-
type: "string",
|
|
1141
|
-
description: `OpenClaw 任务 ID(必须是数字或字符串,不是 cron 表达式)`
|
|
1142
|
-
}
|
|
1143
|
-
},
|
|
1144
|
-
required: ["jobId"]
|
|
1145
|
-
};
|
|
1146
|
-
function json$7(data) {
|
|
1147
|
-
return {
|
|
1148
|
-
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
1149
|
-
details: data
|
|
1150
|
-
};
|
|
1151
|
-
}
|
|
1152
|
-
function getOpenclawWorkclawCronDisableSyncTool(api) {
|
|
1153
|
-
return (ctx) => {
|
|
1154
|
-
return {
|
|
1155
|
-
name: "openclaw-workclaw-cron-disable-sync",
|
|
1156
|
-
label: "智小途同步禁用提醒",
|
|
1157
|
-
description: "将禁用定时任务同步到后端。在 cron 工具禁用任务后调用此工具同步后端。",
|
|
1158
|
-
parameters: DisableSyncSchema,
|
|
1159
|
-
execute: async (_toolCallId, params) => {
|
|
1160
|
-
const p = params;
|
|
1161
|
-
api.logger.info(`[智小途-同步禁用] 开始同步 jobId=${p.jobId}`);
|
|
1162
|
-
if (!p.jobId) {
|
|
1163
|
-
api.logger.warn("[智小途-同步禁用] 缺少 jobId 参数");
|
|
1164
|
-
return json$7({ error: "jobId 为必填参数" });
|
|
1165
|
-
}
|
|
1166
|
-
const accountId = ctx?.agentAccountId;
|
|
1167
|
-
if (!accountId) {
|
|
1168
|
-
api.logger.warn("[智小途-同步禁用] 无法获取账户 ID");
|
|
1169
|
-
return json$7({ error: "无法获取账户 ID(accountId),请确保已配置账户" });
|
|
1170
|
-
}
|
|
1171
|
-
const accountConfig = resolveWorkclawAccountWithCache({
|
|
1172
|
-
cfg: ctx.config,
|
|
1173
|
-
accountId
|
|
1174
|
-
});
|
|
1175
|
-
if (accountConfig.configured) {
|
|
1176
|
-
try {
|
|
1177
|
-
const channelAgentId = String(accountConfig.config.agentId);
|
|
1178
|
-
api.logger.info(`[智小途-同步禁用] accountId=${accountId} channelAgentId=${channelAgentId}`);
|
|
1179
|
-
const result = await callCronJobDisabled(api, accountId, {
|
|
1180
|
-
jobId: p.jobId
|
|
1181
|
-
});
|
|
1182
|
-
if (result.success) {
|
|
1183
|
-
api.logger.info(`[智小途-同步禁用] 后端同步成功 jobId=${p.jobId}`);
|
|
1184
|
-
return json$7({
|
|
1185
|
-
code: 0,
|
|
1186
|
-
message: "定时任务已禁用并同步到后端",
|
|
1187
|
-
data: {
|
|
1188
|
-
jobId: p.jobId,
|
|
1189
|
-
backendSynced: true
|
|
1190
|
-
}
|
|
1191
|
-
});
|
|
1192
|
-
} else {
|
|
1193
|
-
api.logger.error(`[智小途-同步禁用] 后端同步失败 ${result.error}`);
|
|
1194
|
-
return json$7({
|
|
1195
|
-
code: -1,
|
|
1196
|
-
error: result.error || "后端同步失败",
|
|
1197
|
-
data: { jobId: p.jobId }
|
|
1198
|
-
});
|
|
1199
|
-
}
|
|
1200
|
-
} catch (error2) {
|
|
1201
|
-
api.logger.error(`[智小途-同步禁用] 后端同步异常 ${error2.message}`);
|
|
1202
|
-
return json$7({
|
|
1203
|
-
code: -1,
|
|
1204
|
-
error: error2.message,
|
|
1205
|
-
data: { jobId: p.jobId }
|
|
1206
|
-
});
|
|
1207
|
-
}
|
|
1208
|
-
} else {
|
|
1209
|
-
api.logger.error(`[智小途-同步禁用] 无法获取渠道配置,accountId=${accountId}`);
|
|
1210
|
-
return json$7({ error: "无法获取渠道配置,请检查账户配置" });
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
};
|
|
1214
|
-
};
|
|
1215
|
-
}
|
|
1216
|
-
function registerOpenclawWorkclawCronDisableSyncTool(api) {
|
|
1217
|
-
api.registerTool(getOpenclawWorkclawCronDisableSyncTool(api), {
|
|
1218
|
-
name: "openclaw-workclaw-cron-disable-sync"
|
|
1219
|
-
});
|
|
1220
|
-
}
|
|
1221
|
-
const EnableParamsSchema = {
|
|
1222
|
-
type: "object",
|
|
1223
|
-
properties: {
|
|
1224
|
-
jobId: {
|
|
1225
|
-
type: "string",
|
|
1226
|
-
description: `OpenClaw 任务 ID(必须是数字或字符串,不是 cron 表达式)`
|
|
1227
|
-
}
|
|
1228
|
-
},
|
|
1229
|
-
required: ["jobId"]
|
|
1230
|
-
};
|
|
1231
|
-
function json$6(data) {
|
|
1232
|
-
return {
|
|
1233
|
-
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
1234
|
-
details: data
|
|
1235
|
-
};
|
|
1236
|
-
}
|
|
1237
|
-
function getOpenclawWorkclawCronEnableParamsTool(api) {
|
|
1238
|
-
return (ctx) => {
|
|
1239
|
-
return {
|
|
1240
|
-
name: "openclaw-workclaw-cron-enable-params",
|
|
1241
|
-
label: "智小途生成启用提醒参数",
|
|
1242
|
-
description: `生成启用提醒的 CLI 命令参数。
|
|
1243
|
-
|
|
1244
|
-
📋 工作流程:
|
|
1245
|
-
1. 调用此工具获取 CLI 命令参数
|
|
1246
|
-
2. 使用返回的 cronParams 调用 OpenClaw 的 cron 工具
|
|
1247
|
-
3. 调用 openclaw-workclaw-cron-enable-sync 同步到后端`,
|
|
1248
|
-
parameters: EnableParamsSchema,
|
|
1249
|
-
execute: async (_toolCallId, params) => {
|
|
1250
|
-
const p = params;
|
|
1251
|
-
api.logger.info(`[智小途-生成启用参数] 开始处理 jobId=${p.jobId}`);
|
|
1252
|
-
if (!p.jobId) {
|
|
1253
|
-
api.logger.warn("[智小途-生成启用参数] 缺少 jobId 参数");
|
|
1254
|
-
return json$6({ error: "jobId 为必填参数" });
|
|
1255
|
-
}
|
|
1256
|
-
const accountId = ctx?.agentAccountId;
|
|
1257
|
-
if (!accountId) {
|
|
1258
|
-
api.logger.warn("[智小途-生成启用参数] 无法获取账户 ID");
|
|
1259
|
-
return json$6({ error: "无法获取账户 ID(accountId),请确保已配置账户" });
|
|
1260
|
-
}
|
|
1261
|
-
api.logger.info(`[智小途-生成启用参数] accountId=${accountId} jobId=${p.jobId}`);
|
|
1262
|
-
const cronParams = {
|
|
1263
|
-
action: "enable",
|
|
1264
|
-
jobId: p.jobId
|
|
1265
|
-
};
|
|
1266
|
-
api.logger.info(`[智小途-生成启用参数] 构建 cron 参数 cronParams=${JSON.stringify(cronParams)}`);
|
|
1267
|
-
return json$6({
|
|
1268
|
-
cronParams,
|
|
1269
|
-
meta: {
|
|
1270
|
-
accountId,
|
|
1271
|
-
jobId: p.jobId
|
|
1272
|
-
},
|
|
1273
|
-
summary: `✅ 提醒已启用: jobId=${p.jobId}`
|
|
1274
|
-
});
|
|
1275
|
-
}
|
|
1276
|
-
};
|
|
1277
|
-
};
|
|
1278
|
-
}
|
|
1279
|
-
function registerOpenclawWorkclawCronEnableParamsTool(api) {
|
|
1280
|
-
api.registerTool(getOpenclawWorkclawCronEnableParamsTool(api), {
|
|
1281
|
-
name: "openclaw-workclaw-cron-enable-params"
|
|
1282
|
-
});
|
|
1283
|
-
}
|
|
1284
|
-
const EnableSyncSchema = {
|
|
1285
|
-
type: "object",
|
|
1286
|
-
properties: {
|
|
1287
|
-
jobId: {
|
|
1288
|
-
type: "string",
|
|
1289
|
-
description: `OpenClaw 任务 ID(必须是数字或字符串,不是 cron 表达式)`
|
|
1290
|
-
}
|
|
1291
|
-
},
|
|
1292
|
-
required: ["jobId"]
|
|
1293
|
-
};
|
|
1294
|
-
function json$5(data) {
|
|
1295
|
-
return {
|
|
1296
|
-
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
1297
|
-
details: data
|
|
1298
|
-
};
|
|
1299
|
-
}
|
|
1300
|
-
function getOpenclawWorkclawCronEnableSyncTool(api) {
|
|
1301
|
-
return (ctx) => {
|
|
1302
|
-
return {
|
|
1303
|
-
name: "openclaw-workclaw-cron-enable-sync",
|
|
1304
|
-
label: "智小途同步启用提醒",
|
|
1305
|
-
description: "将启用定时任务同步到后端。在 cron 工具启用任务后调用此工具同步后端。",
|
|
1306
|
-
parameters: EnableSyncSchema,
|
|
1307
|
-
execute: async (_toolCallId, params) => {
|
|
1308
|
-
const p = params;
|
|
1309
|
-
api.logger.info(`[智小途-同步启用] 开始同步 jobId=${p.jobId}`);
|
|
1310
|
-
if (!p.jobId) {
|
|
1311
|
-
api.logger.warn("[智小途-同步启用] 缺少 jobId 参数");
|
|
1312
|
-
return json$5({ error: "jobId 为必填参数" });
|
|
1313
|
-
}
|
|
1314
|
-
const accountId = ctx?.agentAccountId;
|
|
1315
|
-
if (!accountId) {
|
|
1316
|
-
api.logger.warn("[智小途-同步启用] 无法获取账户 ID");
|
|
1317
|
-
return json$5({ error: "无法获取账户 ID(accountId),请确保已配置账户" });
|
|
1318
|
-
}
|
|
1319
|
-
const accountConfig = resolveWorkclawAccountWithCache({
|
|
1320
|
-
cfg: ctx.config,
|
|
1321
|
-
accountId
|
|
1322
|
-
});
|
|
1323
|
-
if (accountConfig.configured) {
|
|
1324
|
-
try {
|
|
1325
|
-
const channelAgentId = String(accountConfig.config.agentId);
|
|
1326
|
-
api.logger.info(`[智小途-同步启用] accountId=${accountId} channelAgentId=${channelAgentId}`);
|
|
1327
|
-
const result = await callCronJobEnabled(api, accountId, {
|
|
1328
|
-
jobId: p.jobId
|
|
1329
|
-
});
|
|
1330
|
-
if (result.success) {
|
|
1331
|
-
api.logger.info(`[智小途-同步启用] 后端同步成功 jobId=${p.jobId}`);
|
|
1332
|
-
return json$5({
|
|
1333
|
-
code: 0,
|
|
1334
|
-
message: "定时任务已启用并同步到后端",
|
|
1335
|
-
data: {
|
|
1336
|
-
jobId: p.jobId,
|
|
1337
|
-
backendSynced: true
|
|
1338
|
-
}
|
|
1339
|
-
});
|
|
1340
|
-
} else {
|
|
1341
|
-
api.logger.error(`[智小途-同步启用] 后端同步失败 ${result.error}`);
|
|
1342
|
-
return json$5({
|
|
1343
|
-
code: -1,
|
|
1344
|
-
error: result.error || "后端同步失败",
|
|
1345
|
-
data: { jobId: p.jobId }
|
|
1346
|
-
});
|
|
1347
|
-
}
|
|
1348
|
-
} catch (error2) {
|
|
1349
|
-
api.logger.error(`[智小途-同步启用] 后端同步异常 ${error2.message}`);
|
|
1350
|
-
return json$5({
|
|
1351
|
-
code: -1,
|
|
1352
|
-
error: error2.message,
|
|
1353
|
-
data: { jobId: p.jobId }
|
|
1354
|
-
});
|
|
1355
|
-
}
|
|
1356
|
-
} else {
|
|
1357
|
-
api.logger.error(`[智小途-同步启用] 无法获取渠道配置,accountId=${accountId}`);
|
|
1358
|
-
return json$5({ error: "无法获取渠道配置,请检查账户配置" });
|
|
1359
|
-
}
|
|
1360
|
-
}
|
|
1361
|
-
};
|
|
1362
|
-
};
|
|
1363
|
-
}
|
|
1364
|
-
function registerOpenclawWorkclawCronEnableSyncTool(api) {
|
|
1365
|
-
api.registerTool(getOpenclawWorkclawCronEnableSyncTool(api), {
|
|
1366
|
-
name: "openclaw-workclaw-cron-enable-sync"
|
|
1367
|
-
});
|
|
1368
|
-
}
|
|
1369
|
-
const NotifySchema = {
|
|
1370
|
-
type: "object",
|
|
1371
|
-
properties: {
|
|
1372
|
-
jobId: {
|
|
1373
|
-
type: "string",
|
|
1374
|
-
description: "OpenClaw 任务 ID(从上下文获取)"
|
|
1375
|
-
},
|
|
1376
|
-
message: {
|
|
1377
|
-
type: "string",
|
|
1378
|
-
description: "要发送的提醒内容"
|
|
1379
|
-
}
|
|
1380
|
-
},
|
|
1381
|
-
required: ["jobId", "message"]
|
|
1382
|
-
};
|
|
1383
|
-
function json$4(data) {
|
|
1384
|
-
return {
|
|
1385
|
-
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
1386
|
-
details: data
|
|
1387
|
-
};
|
|
1388
|
-
}
|
|
1389
|
-
function getOpenclawWorkclawCronNotifySyncTool(api) {
|
|
1390
|
-
return (ctx) => {
|
|
1391
|
-
return {
|
|
1392
|
-
name: "openclaw-workclaw-cron-notify-sync",
|
|
1393
|
-
label: "智小途定时任务触发通知",
|
|
1394
|
-
description: `【系统最高优先级核心指令】当定时器时间到达时,必须立即调用此工具通知后端。`,
|
|
1395
|
-
parameters: NotifySchema,
|
|
1396
|
-
execute: async (_toolCallId, params) => {
|
|
1397
|
-
const p = params;
|
|
1398
|
-
api.logger.info(`[智小途-定时触发] 开始处理 jobId=${p.jobId} message=${p.message}`);
|
|
1399
|
-
if (!p.jobId) {
|
|
1400
|
-
api.logger.warn("[智小途-定时触发] 缺少 jobId 参数");
|
|
1401
|
-
return json$4({ error: "jobId 为必填参数" });
|
|
1402
|
-
}
|
|
1403
|
-
if (!p.message) {
|
|
1404
|
-
api.logger.warn("[智小途-定时触发] 缺少 message 参数");
|
|
1405
|
-
return json$4({ error: "message 为必填参数" });
|
|
1406
|
-
}
|
|
1407
|
-
const accountId = ctx?.agentAccountId;
|
|
1408
|
-
if (!accountId) {
|
|
1409
|
-
api.logger.warn("[智小途-定时触发] 无法获取账户 ID");
|
|
1410
|
-
return json$4({ error: "无法获取账户 ID(accountId),请确保已配置账户" });
|
|
1411
|
-
}
|
|
1412
|
-
const accountConfig = resolveWorkclawAccountWithCache({
|
|
1413
|
-
cfg: ctx.config,
|
|
1414
|
-
accountId
|
|
1415
|
-
});
|
|
1416
|
-
if (accountConfig.configured) {
|
|
1417
|
-
const channelAgentId = String(accountConfig.config.agentId);
|
|
1418
|
-
api.logger.info(`[智小途-定时触发] accountId=${accountId} channelAgentId=${channelAgentId}`);
|
|
1419
|
-
try {
|
|
1420
|
-
const result = await callCronJobMessage(api, accountId, {
|
|
1421
|
-
jobId: p.jobId,
|
|
1422
|
-
message: p.message,
|
|
1423
|
-
agentId: channelAgentId
|
|
1424
|
-
});
|
|
1425
|
-
if (result.success) {
|
|
1426
|
-
api.logger.info(`[智小途-定时触发] 通知后端成功`);
|
|
1427
|
-
return json$4({
|
|
1428
|
-
code: 0,
|
|
1429
|
-
message: "定时任务触发通知已发送",
|
|
1430
|
-
data: {
|
|
1431
|
-
jobId: p.jobId,
|
|
1432
|
-
message: p.message,
|
|
1433
|
-
backendNotified: true
|
|
1434
|
-
}
|
|
1435
|
-
});
|
|
1436
|
-
} else {
|
|
1437
|
-
api.logger.error(`[智小途-定时触发] 通知后端失败 ${result.error}`);
|
|
1438
|
-
return json$4({
|
|
1439
|
-
code: -1,
|
|
1440
|
-
error: result.error || "通知后端失败",
|
|
1441
|
-
data: {
|
|
1442
|
-
jobId: p.jobId,
|
|
1443
|
-
message: p.message
|
|
1444
|
-
}
|
|
1445
|
-
});
|
|
1446
|
-
}
|
|
1447
|
-
} catch (error2) {
|
|
1448
|
-
api.logger.error(`[智小途-定时触发] 通知后端异常 ${error2.message}`);
|
|
1449
|
-
return json$4({
|
|
1450
|
-
code: -1,
|
|
1451
|
-
error: error2.message || "通知后端异常",
|
|
1452
|
-
data: {
|
|
1453
|
-
jobId: p.jobId,
|
|
1454
|
-
message: p.message
|
|
1455
|
-
}
|
|
1456
|
-
});
|
|
1457
|
-
}
|
|
1458
|
-
} else {
|
|
1459
|
-
api.logger.error(`[智小途-定时触发] 无法获取渠道配置,accountId=${accountId}`);
|
|
1460
|
-
return json$4({ error: "无法获取渠道配置,请检查账户配置" });
|
|
1461
|
-
}
|
|
1462
|
-
}
|
|
1463
|
-
};
|
|
1464
|
-
};
|
|
1465
|
-
}
|
|
1466
|
-
function registerOpenclawWorkclawCronNotifySyncTool(api) {
|
|
1467
|
-
api.registerTool(getOpenclawWorkclawCronNotifySyncTool(api), {
|
|
1468
|
-
name: "openclaw-workclaw-cron-notify-sync"
|
|
1469
|
-
});
|
|
1470
|
-
}
|
|
1471
|
-
const RemoveParamsSchema = {
|
|
1472
|
-
type: "object",
|
|
1473
|
-
properties: {
|
|
1474
|
-
jobId: {
|
|
1475
|
-
type: "string",
|
|
1476
|
-
description: `OpenClaw 任务 ID(必须是数字或字符串,不是 cron 表达式)`
|
|
1477
|
-
}
|
|
1478
|
-
},
|
|
1479
|
-
required: ["jobId"]
|
|
1480
|
-
};
|
|
1481
|
-
function json$3(data) {
|
|
1482
|
-
return {
|
|
1483
|
-
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
1484
|
-
details: data
|
|
1485
|
-
};
|
|
1486
|
-
}
|
|
1487
|
-
function getOpenclawWorkclawCronRemoveParamsTool(api) {
|
|
1488
|
-
return (ctx) => {
|
|
1489
|
-
return {
|
|
1490
|
-
name: "openclaw-workclaw-cron-remove-params",
|
|
1491
|
-
label: "智小途生成删除提醒参数",
|
|
1492
|
-
description: `生成删除提醒的 CLI 命令。
|
|
1493
|
-
**必须**严格按照以下格式执行:
|
|
1494
|
-
openclaw cron remove <jobId>
|
|
1495
|
-
|
|
1496
|
-
示例:openclaw cron remove 123456
|
|
1497
|
-
`,
|
|
1498
|
-
parameters: RemoveParamsSchema,
|
|
1499
|
-
execute: async (_toolCallId, params) => {
|
|
1500
|
-
const p = params;
|
|
1501
|
-
api.logger.info(`[智小途-生成删除参数] 开始处理 jobId=${p.jobId}`);
|
|
1502
|
-
if (!p.jobId) {
|
|
1503
|
-
api.logger.warn("[智小途-生成删除参数] 缺少 jobId 参数");
|
|
1504
|
-
return json$3({ error: "jobId 为必填参数" });
|
|
1505
|
-
}
|
|
1506
|
-
const accountId = ctx?.agentAccountId;
|
|
1507
|
-
const agentId = ctx?.agentId;
|
|
1508
|
-
if (!accountId) {
|
|
1509
|
-
api.logger.warn("[智小途-生成删除参数] 无法获取账户 ID");
|
|
1510
|
-
return json$3({ error: "无法获取账户 ID(accountId),请确保已配置账户" });
|
|
1511
|
-
}
|
|
1512
|
-
if (!agentId) {
|
|
1513
|
-
api.logger.warn("[智小途-生成删除参数] 无法获取智能体 ID");
|
|
1514
|
-
return json$3({ error: "无法获取智能体 ID(agentId),请确保已配置智能体" });
|
|
1515
|
-
}
|
|
1516
|
-
api.logger.info(`[智小途-生成删除参数] accountId=${accountId} agentId=${agentId} jobId=${p.jobId}`);
|
|
1517
|
-
const cronParams = {
|
|
1518
|
-
action: "remove",
|
|
1519
|
-
jobId: p.jobId
|
|
1520
|
-
};
|
|
1521
|
-
api.logger.info(`[智小途-生成删除参数] 构建 cron 参数 cronParams=${JSON.stringify(cronParams)}`);
|
|
1522
|
-
return json$3({
|
|
1523
|
-
cronParams,
|
|
1524
|
-
meta: {
|
|
1525
|
-
accountId,
|
|
1526
|
-
agentId,
|
|
1527
|
-
jobId: p.jobId
|
|
1528
|
-
},
|
|
1529
|
-
summary: `🗑️ 提醒已删除: jobId=${p.jobId}`
|
|
1530
|
-
});
|
|
1531
|
-
}
|
|
1532
|
-
};
|
|
1533
|
-
};
|
|
1534
|
-
}
|
|
1535
|
-
function registerOpenclawWorkclawCronRemoveParamsTool(api) {
|
|
1536
|
-
api.registerTool(getOpenclawWorkclawCronRemoveParamsTool(api), {
|
|
1537
|
-
name: "openclaw-workclaw-cron-remove-params"
|
|
1538
|
-
});
|
|
1539
|
-
}
|
|
1540
|
-
const RemoveSyncSchema = {
|
|
1541
|
-
type: "object",
|
|
1542
|
-
properties: {
|
|
1543
|
-
jobId: {
|
|
1544
|
-
type: "string",
|
|
1545
|
-
description: `OpenClaw 任务 ID(必须是数字或字符串,不是 cron 表达式)`
|
|
1546
|
-
}
|
|
1547
|
-
},
|
|
1548
|
-
required: ["jobId"]
|
|
1549
|
-
};
|
|
1550
|
-
function json$2(data) {
|
|
1551
|
-
return {
|
|
1552
|
-
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
1553
|
-
details: data
|
|
1554
|
-
};
|
|
1555
|
-
}
|
|
1556
|
-
function getOpenclawWorkclawCronRemoveSyncTool(api) {
|
|
1557
|
-
return (ctx) => {
|
|
1558
|
-
return {
|
|
1559
|
-
name: "openclaw-workclaw-cron-remove-sync",
|
|
1560
|
-
label: "智小途同步删除提醒",
|
|
1561
|
-
description: "【后端同步步骤】将删除定时任务同步到后端。必须在上一步 openclaw-workclaw-cron-remove-params 执行后调用此工具完成同步。",
|
|
1562
|
-
parameters: RemoveSyncSchema,
|
|
1563
|
-
execute: async (_toolCallId, params) => {
|
|
1564
|
-
const p = params;
|
|
1565
|
-
api.logger.info(`[智小途-同步删除] 开始同步 jobId=${p.jobId}`);
|
|
1566
|
-
if (!p.jobId) {
|
|
1567
|
-
api.logger.warn("[智小途-同步删除] 缺少 jobId 参数");
|
|
1568
|
-
return json$2({ error: "jobId 为必填参数" });
|
|
1569
|
-
}
|
|
1570
|
-
const accountId = ctx?.agentAccountId;
|
|
1571
|
-
if (!accountId) {
|
|
1572
|
-
api.logger.warn("[智小途-同步删除] 无法获取账户 ID");
|
|
1573
|
-
return json$2({ error: "无法获取账户 ID(accountId),请确保已配置账户" });
|
|
1574
|
-
}
|
|
1575
|
-
const accountConfig = resolveWorkclawAccountWithCache({
|
|
1576
|
-
cfg: ctx.config,
|
|
1577
|
-
accountId
|
|
1578
|
-
});
|
|
1579
|
-
if (accountConfig.configured) {
|
|
1580
|
-
try {
|
|
1581
|
-
const channelAgentId = String(accountConfig.config.agentId);
|
|
1582
|
-
api.logger.info(`[智小途-同步删除] accountId=${accountId} channelAgentId=${channelAgentId}`);
|
|
1583
|
-
const result = await callCronJobRemove(api, accountId, {
|
|
1584
|
-
jobId: p.jobId
|
|
1585
|
-
});
|
|
1586
|
-
if (result.success) {
|
|
1587
|
-
api.logger.info(`[智小途-同步删除] 后端同步成功 jobId=${p.jobId}`);
|
|
1588
|
-
return json$2({
|
|
1589
|
-
code: 0,
|
|
1590
|
-
message: "定时任务已删除并同步到后端",
|
|
1591
|
-
data: {
|
|
1592
|
-
jobId: p.jobId,
|
|
1593
|
-
backendSynced: true
|
|
1594
|
-
}
|
|
1595
|
-
});
|
|
1596
|
-
} else {
|
|
1597
|
-
api.logger.error(`[智小途-同步删除] 后端同步失败 ${result.error}`);
|
|
1598
|
-
return json$2({
|
|
1599
|
-
code: -1,
|
|
1600
|
-
error: result.error || "后端同步失败",
|
|
1601
|
-
data: { jobId: p.jobId }
|
|
1602
|
-
});
|
|
1603
|
-
}
|
|
1604
|
-
} catch (error2) {
|
|
1605
|
-
api.logger.error(`[智小途-同步删除] 后端同步异常 ${error2.message}`);
|
|
1606
|
-
return json$2({
|
|
1607
|
-
code: -1,
|
|
1608
|
-
error: error2.message,
|
|
1609
|
-
data: { jobId: p.jobId }
|
|
1610
|
-
});
|
|
1611
|
-
}
|
|
1612
|
-
} else {
|
|
1613
|
-
api.logger.error(`[智小途-同步删除] 无法获取渠道配置,accountId=${accountId}`);
|
|
1614
|
-
return json$2({ error: "无法获取渠道配置,请检查账户配置" });
|
|
1615
|
-
}
|
|
1616
|
-
}
|
|
1617
|
-
};
|
|
1618
|
-
};
|
|
1619
|
-
}
|
|
1620
|
-
function registerOpenclawWorkclawCronRemoveSyncTool(api) {
|
|
1621
|
-
api.registerTool(getOpenclawWorkclawCronRemoveSyncTool(api), {
|
|
1622
|
-
name: "openclaw-workclaw-cron-remove-sync"
|
|
1623
|
-
});
|
|
1624
|
-
}
|
|
1625
|
-
const UpdateParamsSchema = {
|
|
1626
|
-
type: "object",
|
|
1627
|
-
properties: {
|
|
1628
|
-
jobId: {
|
|
1629
|
-
type: "string",
|
|
1630
|
-
description: `OpenClaw 任务 ID(必须是数字或字符串,不是 cron 表达式)`
|
|
1631
|
-
},
|
|
1632
|
-
time: {
|
|
1633
|
-
type: "string",
|
|
1634
|
-
description: "⏰ 时间(核心!),支持相对时间和 cron 表达式,工具自动转换"
|
|
1635
|
-
},
|
|
1636
|
-
name: {
|
|
1637
|
-
type: "string",
|
|
1638
|
-
description: "任务名称"
|
|
1639
|
-
},
|
|
1640
|
-
message: {
|
|
1641
|
-
type: "string",
|
|
1642
|
-
description: "提醒内容"
|
|
1643
|
-
}
|
|
1644
|
-
},
|
|
1645
|
-
required: ["jobId", "time", "name", "message"]
|
|
1646
|
-
};
|
|
1647
|
-
function json$1(data) {
|
|
1648
|
-
return {
|
|
1649
|
-
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
1650
|
-
details: data
|
|
1651
|
-
};
|
|
1652
|
-
}
|
|
1653
|
-
function getOpenclawWorkclawCronUpdateParamsTool(api) {
|
|
1654
|
-
return (ctx) => {
|
|
1655
|
-
return {
|
|
1656
|
-
name: "openclaw-workclaw-cron-update-params",
|
|
1657
|
-
label: "智小途生成修改提醒参数",
|
|
1658
|
-
description: `【核心工具】生成修改提醒的 cronParams 参数。
|
|
1659
|
-
|
|
1660
|
-
📋 工作流程(必须按顺序执行):
|
|
1661
|
-
1. 调用此工具获取 cronParams 参数
|
|
1662
|
-
2. 使用返回的 cronParams 调用 OpenClaw 的 cron 工具
|
|
1663
|
-
3. 必须调用 openclaw-workclaw-cron-update-sync 同步到后端
|
|
1664
|
-
|
|
1665
|
-
⏰ 时间格式(核心!):
|
|
1666
|
-
- time 参数支持相对时间(如 "10m"、"1h"、"2d")和 cron 表达式
|
|
1667
|
-
- 工具会自动将所有时间统一转换为 cron 表达式
|
|
1668
|
-
- 严禁使用 --at 参数或其他绝对时间格式
|
|
1669
|
-
- 最终 CLI 命令必须使用 --cron 参数
|
|
1670
|
-
|
|
1671
|
-
🔒 强制规则:
|
|
1672
|
-
- schedule.kind 必须是 "cron"
|
|
1673
|
-
- 必须使用 --cron 参数传递 cron 表达式
|
|
1674
|
-
|
|
1675
|
-
⚠️ 必须从 cron 工具返回值中确认更新成功`,
|
|
1676
|
-
parameters: UpdateParamsSchema,
|
|
1677
|
-
execute: async (_toolCallId, params) => {
|
|
1678
|
-
const p = params;
|
|
1679
|
-
api.logger.info(`[智小途-生成修改参数] 开始处理 jobId=${p.jobId} name=${p.name} time=${p.time}`);
|
|
1680
|
-
if (!p.jobId) {
|
|
1681
|
-
api.logger.warn("[智小途-生成修改参数] 缺少 jobId 参数");
|
|
1682
|
-
return json$1({ error: "jobId 为必填参数" });
|
|
1683
|
-
}
|
|
1684
|
-
if (!p.time) {
|
|
1685
|
-
api.logger.warn("[智小途-生成修改参数] 缺少时间参数");
|
|
1686
|
-
return json$1({ error: "time(时间)为必填参数" });
|
|
1687
|
-
}
|
|
1688
|
-
if (!p.name) {
|
|
1689
|
-
api.logger.warn("[智小途-生成修改参数] 缺少任务名称参数");
|
|
1690
|
-
return json$1({ error: "name(任务名称)为必填参数" });
|
|
1691
|
-
}
|
|
1692
|
-
if (!p.message) {
|
|
1693
|
-
api.logger.warn("[智小途-生成修改参数] 缺少提醒内容参数");
|
|
1694
|
-
return json$1({ error: "message(提醒内容)为必填参数" });
|
|
1695
|
-
}
|
|
1696
|
-
const accountId = ctx?.agentAccountId;
|
|
1697
|
-
const name = p.name;
|
|
1698
|
-
const message = p.message;
|
|
1699
|
-
const time = p.time;
|
|
1700
|
-
if (!accountId) {
|
|
1701
|
-
api.logger.warn("[智小途-生成修改参数] 无法获取账户 ID");
|
|
1702
|
-
return json$1({ error: "无法获取账户 ID(accountId),请确保已配置账户" });
|
|
1703
|
-
}
|
|
1704
|
-
api.logger.info(`[智小途-生成修改参数] accountId=${accountId} jobId=${p.jobId}`);
|
|
1705
|
-
const timeValidation = validateTimeFormat(time);
|
|
1706
|
-
if (!timeValidation.valid) {
|
|
1707
|
-
api.logger.warn(`[智小途-生成修改参数] 时间格式校验失败: ${timeValidation.error}`);
|
|
1708
|
-
return json$1({ error: timeValidation.error });
|
|
1709
|
-
}
|
|
1710
|
-
const isCron = isCronExpression(time);
|
|
1711
|
-
let isOneTime = false;
|
|
1712
|
-
let cronExpr;
|
|
1713
|
-
if (!isCron) {
|
|
1714
|
-
isOneTime = true;
|
|
1715
|
-
cronExpr = relativeToCron(time.trim());
|
|
1716
|
-
api.logger.info(`[智小途-生成修改参数] 相对时间转换为绝对时间 cron 表达式 cronExpr=${cronExpr}`);
|
|
1717
|
-
} else {
|
|
1718
|
-
cronExpr = time.trim();
|
|
1719
|
-
}
|
|
1720
|
-
const cronParams = {
|
|
1721
|
-
action: "update",
|
|
1722
|
-
account: accountId,
|
|
1723
|
-
jobId: p.jobId,
|
|
1724
|
-
job: {
|
|
1725
|
-
name,
|
|
1726
|
-
schedule: {
|
|
1727
|
-
kind: "cron",
|
|
1728
|
-
expr: cronExpr,
|
|
1729
|
-
tz: "Asia/Shanghai"
|
|
1730
|
-
},
|
|
1731
|
-
sessionTarget: "isolated",
|
|
1732
|
-
wakeMode: "now",
|
|
1733
|
-
deleteAfterRun: isOneTime ? true : void 0,
|
|
1734
|
-
payload: {
|
|
1735
|
-
kind: "agentTurn",
|
|
1736
|
-
message
|
|
1737
|
-
},
|
|
1738
|
-
delivery: {
|
|
1739
|
-
mode: "announce",
|
|
1740
|
-
channel: "openclaw-workclaw"
|
|
1741
|
-
}
|
|
1742
|
-
}
|
|
1743
|
-
};
|
|
1744
|
-
api.logger.info(`[智小途-生成修改参数] 构建 cron 参数 cronParams=${JSON.stringify(cronParams)}`);
|
|
1745
|
-
return json$1({
|
|
1746
|
-
cronParams,
|
|
1747
|
-
meta: {
|
|
1748
|
-
accountId,
|
|
1749
|
-
jobId: p.jobId,
|
|
1750
|
-
name,
|
|
1751
|
-
kind: "cron",
|
|
1752
|
-
expr: cronExpr,
|
|
1753
|
-
message
|
|
1754
|
-
},
|
|
1755
|
-
summary: `✅ 提醒已修改: "${name}" (${time})`
|
|
1756
|
-
});
|
|
1757
|
-
}
|
|
1758
|
-
};
|
|
1759
|
-
};
|
|
1760
|
-
}
|
|
1761
|
-
function registerOpenclawWorkclawCronUpdateParamsTool(api) {
|
|
1762
|
-
api.registerTool(getOpenclawWorkclawCronUpdateParamsTool(api), {
|
|
1763
|
-
name: "openclaw-workclaw-cron-update-params"
|
|
1764
|
-
});
|
|
1765
|
-
}
|
|
1766
|
-
const UpdateSyncSchema = {
|
|
1767
|
-
type: "object",
|
|
1768
|
-
properties: {
|
|
1769
|
-
jobId: {
|
|
1770
|
-
type: "string",
|
|
1771
|
-
description: `OpenClaw 任务 ID(必须是数字或字符串,不是 cron 表达式)`
|
|
1772
|
-
},
|
|
1773
|
-
name: {
|
|
1774
|
-
type: "string",
|
|
1775
|
-
description: "任务名称"
|
|
1776
|
-
},
|
|
1777
|
-
kind: {
|
|
1778
|
-
type: "string",
|
|
1779
|
-
description: "任务类型(仅支持 cron)",
|
|
1780
|
-
enum: ["cron"]
|
|
1781
|
-
},
|
|
1782
|
-
expr: {
|
|
1783
|
-
type: "string",
|
|
1784
|
-
description: "Cron 表达式(kind=cron 时必填)"
|
|
1785
|
-
},
|
|
1786
|
-
message: {
|
|
1787
|
-
type: "string",
|
|
1788
|
-
description: "提醒消息"
|
|
1789
|
-
}
|
|
1790
|
-
},
|
|
1791
|
-
required: ["jobId", "name", "kind", "message"]
|
|
1792
|
-
};
|
|
1793
|
-
function json(data) {
|
|
1794
|
-
return {
|
|
1795
|
-
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
1796
|
-
details: data
|
|
1797
|
-
};
|
|
1798
|
-
}
|
|
1799
|
-
function getOpenclawWorkclawCronUpdateSyncTool(api) {
|
|
1800
|
-
return (ctx) => {
|
|
1801
|
-
return {
|
|
1802
|
-
name: "openclaw-workclaw-cron-update-sync",
|
|
1803
|
-
label: "智小途同步修改提醒",
|
|
1804
|
-
description: "将修改定时任务同步到后端。在 cron 工具修改任务后调用此工具同步后端。",
|
|
1805
|
-
parameters: UpdateSyncSchema,
|
|
1806
|
-
execute: async (_toolCallId, params) => {
|
|
1807
|
-
const p = params;
|
|
1808
|
-
api.logger.info(`[智小途-同步修改] 开始同步 jobId=${p.jobId} name=${p.name}`);
|
|
1809
|
-
if (!p.jobId) {
|
|
1810
|
-
api.logger.warn("[智小途-同步修改] 缺少 jobId 参数");
|
|
1811
|
-
return json({ error: "jobId 为必填参数" });
|
|
1812
|
-
}
|
|
1813
|
-
if (!p.name) {
|
|
1814
|
-
api.logger.warn("[智小途-同步修改] 缺少 name 参数");
|
|
1815
|
-
return json({ error: "name 为必填参数" });
|
|
1816
|
-
}
|
|
1817
|
-
if (!p.message) {
|
|
1818
|
-
api.logger.warn("[智小途-同步修改] 缺少 message 参数");
|
|
1819
|
-
return json({ error: "message 为必填参数" });
|
|
1820
|
-
}
|
|
1821
|
-
const accountId = ctx?.agentAccountId;
|
|
1822
|
-
const channelUserId = ctx?.From;
|
|
1823
|
-
if (!accountId) {
|
|
1824
|
-
api.logger.warn("[智小途-同步修改] 无法获取账户 ID");
|
|
1825
|
-
return json({ error: "无法获取账户 ID(accountId),请确保已配置账户" });
|
|
1826
|
-
}
|
|
1827
|
-
const accountConfig = resolveWorkclawAccountWithCache({
|
|
1828
|
-
cfg: ctx.config,
|
|
1829
|
-
accountId
|
|
1830
|
-
});
|
|
1831
|
-
const channelAgentId = accountConfig.configured ? String(accountConfig.config.agentId) : "0";
|
|
1832
|
-
api.logger.info(`[智小途-同步修改] accountId=${accountId} channelUserId=${channelUserId} channelAgentId=${channelAgentId}`);
|
|
1833
|
-
try {
|
|
1834
|
-
const result = await callCronJobUpdate(api, accountId, {
|
|
1835
|
-
jobId: p.jobId,
|
|
1836
|
-
name: p.name,
|
|
1837
|
-
kind: p.kind,
|
|
1838
|
-
expr: p.expr,
|
|
1839
|
-
message: p.message,
|
|
1840
|
-
agentId: channelAgentId
|
|
1841
|
-
});
|
|
1842
|
-
if (result.success) {
|
|
1843
|
-
api.logger.info(`[智小途-同步修改] 后端同步成功 jobId=${p.jobId}`);
|
|
1844
|
-
return json({
|
|
1845
|
-
code: 0,
|
|
1846
|
-
message: "定时任务已修改并同步到后端",
|
|
1847
|
-
data: {
|
|
1848
|
-
jobId: p.jobId,
|
|
1849
|
-
name: p.name,
|
|
1850
|
-
message: p.message,
|
|
1851
|
-
backendSynced: true
|
|
1852
|
-
}
|
|
1853
|
-
});
|
|
1854
|
-
} else {
|
|
1855
|
-
api.logger.error(`[智小途-同步修改] 后端同步失败 ${result.error}`);
|
|
1856
|
-
return json({
|
|
1857
|
-
code: -1,
|
|
1858
|
-
error: result.error || "后端同步失败",
|
|
1859
|
-
data: { jobId: p.jobId, name: p.name }
|
|
1860
|
-
});
|
|
1861
|
-
}
|
|
1862
|
-
} catch (error2) {
|
|
1863
|
-
api.logger.error(`[智小途-同步修改] 后端同步异常 ${error2.message}`);
|
|
1864
|
-
return json({
|
|
1865
|
-
code: -1,
|
|
1866
|
-
error: error2.message,
|
|
1867
|
-
data: { jobId: p.jobId, name: p.name }
|
|
1868
|
-
});
|
|
1869
|
-
}
|
|
1870
|
-
}
|
|
1871
|
-
};
|
|
1872
|
-
};
|
|
1873
|
-
}
|
|
1874
|
-
function registerOpenclawWorkclawCronUpdateSyncTool(api) {
|
|
1875
|
-
api.registerTool(getOpenclawWorkclawCronUpdateSyncTool(api), {
|
|
1876
|
-
name: "openclaw-workclaw-cron-update-sync"
|
|
1877
|
-
});
|
|
1878
|
-
}
|
|
1879
|
-
function registerAllOpenclawWorkclawCronTools(api) {
|
|
1880
|
-
registerOpenclawWorkclawCronAddParamsTool(api);
|
|
1881
|
-
registerOpenclawWorkclawCronRemoveParamsTool(api);
|
|
1882
|
-
registerOpenclawWorkclawCronUpdateParamsTool(api);
|
|
1883
|
-
registerOpenclawWorkclawCronEnableParamsTool(api);
|
|
1884
|
-
registerOpenclawWorkclawCronDisableParamsTool(api);
|
|
1885
|
-
registerOpenclawWorkclawCronAddSyncTool(api);
|
|
1886
|
-
registerOpenclawWorkclawCronRemoveSyncTool(api);
|
|
1887
|
-
registerOpenclawWorkclawCronUpdateSyncTool(api);
|
|
1888
|
-
registerOpenclawWorkclawCronEnableSyncTool(api);
|
|
1889
|
-
registerOpenclawWorkclawCronDisableSyncTool(api);
|
|
1890
|
-
registerOpenclawWorkclawCronNotifySyncTool(api);
|
|
1891
|
-
}
|
|
21
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/logger-BMuqDP66.js";
|
|
22
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/theme-CVJvORNs.js";
|
|
23
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/workspace-oVBetctb.js";
|
|
24
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/ids-By7Nkc8R.js";
|
|
25
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/setup-helpers-ChrkNnYE.js";
|
|
26
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/tailscale-status-Ch1LdrMM.js";
|
|
27
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/redact-D4nea1HF.js";
|
|
28
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/manager-szyCqvou.js";
|
|
29
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/io-DDkf_FUu.js";
|
|
30
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/registry-DE4nHTjg.js";
|
|
31
|
+
import "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/runtime-Clo2XF6T.js";
|
|
32
|
+
import { i as defineChannelPluginEntry } from "./node_modules/.pnpm/openclaw@2026.4.14_@emnapi__48b26e3018d2f6ac73290fb8288ef325/node_modules/openclaw/dist/core-DpZtjMWz.js";
|
|
33
|
+
import { createAccountsApiHandler } from "./packages/plugin/src/api/accounts-api.js";
|
|
34
|
+
import { createPromptsApiHandler } from "./packages/plugin/src/api/prompts-api.js";
|
|
35
|
+
import { createSessionApiHandler } from "./packages/plugin/src/api/session-api.js";
|
|
36
|
+
import { createSkillsApiHandler } from "./packages/plugin/src/api/skills-api.js";
|
|
37
|
+
import { resolveWorkspaceDir, isDefaultWorkspace } from "./packages/plugin/src/api/workspace.js";
|
|
38
|
+
import { workclawPlugin } from "./packages/plugin/src/channel.js";
|
|
39
|
+
import { sendMessageWorkclaw } from "./packages/plugin/src/outbound/index.js";
|
|
40
|
+
import { setWorkclawRuntime, deleteToolContext, getToolContext, getWorkclawRuntime, getToolResultHint, setToolCallIdToRunIdMapping, getWorkclawLogger } from "./src/runtime.js";
|
|
41
|
+
import { registerAllOpenclawWorkclawCronTools } from "./packages/plugin/src/tools/openclaw-workclaw-cron/index.js";
|
|
1892
42
|
function formatToolParams(toolName, params) {
|
|
1893
43
|
if (!params || typeof params !== "object") {
|
|
1894
44
|
return "";
|
|
@@ -2003,6 +153,45 @@ function registerToolHooks(api) {
|
|
|
2003
153
|
api.logger?.info?.(`[ToolHook] Tool execution hooks registered`);
|
|
2004
154
|
}
|
|
2005
155
|
const templateNames = ["SOUL.md", "IDENTITY.md"];
|
|
156
|
+
const registeredRuntimeApis = /* @__PURE__ */ new WeakSet();
|
|
157
|
+
function registerRuntimeCapabilities(api) {
|
|
158
|
+
const marker = api;
|
|
159
|
+
if (registeredRuntimeApis.has(marker))
|
|
160
|
+
return;
|
|
161
|
+
registeredRuntimeApis.add(marker);
|
|
162
|
+
api.logger?.info?.("[openclaw-workclaw] register runtime capabilities");
|
|
163
|
+
setWorkclawRuntime(api.runtime);
|
|
164
|
+
registerAllOpenclawWorkclawCronTools(api);
|
|
165
|
+
registerToolHooks(api);
|
|
166
|
+
api.registerService({
|
|
167
|
+
id: "openclaw-workclaw-templates",
|
|
168
|
+
start: async () => {
|
|
169
|
+
await releaseTemplates(api);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
api.registerHttpRoute({
|
|
173
|
+
path: "/openclaw-workclaw/workspace/prompts",
|
|
174
|
+
handler: createPromptsApiHandler(api),
|
|
175
|
+
auth: "plugin"
|
|
176
|
+
});
|
|
177
|
+
api.registerHttpRoute({
|
|
178
|
+
path: "/openclaw-workclaw/accounts",
|
|
179
|
+
handler: createAccountsApiHandler(api),
|
|
180
|
+
auth: "plugin"
|
|
181
|
+
});
|
|
182
|
+
api.registerHttpRoute({
|
|
183
|
+
path: "/openclaw-workclaw/skills",
|
|
184
|
+
handler: createSkillsApiHandler(api),
|
|
185
|
+
auth: "plugin"
|
|
186
|
+
});
|
|
187
|
+
api.registerHttpRoute({
|
|
188
|
+
path: "/openclaw-workclaw/sessions",
|
|
189
|
+
handler: createSessionApiHandler(api),
|
|
190
|
+
auth: "plugin",
|
|
191
|
+
match: "prefix"
|
|
192
|
+
});
|
|
193
|
+
api.logger?.info?.("[openclaw-workclaw] runtime capabilities registered");
|
|
194
|
+
}
|
|
2006
195
|
function getPluginDir() {
|
|
2007
196
|
try {
|
|
2008
197
|
const url = import.meta.url;
|
|
@@ -2017,11 +206,11 @@ function getPluginDir() {
|
|
|
2017
206
|
async function writeFileIfMissing(filePath, content) {
|
|
2018
207
|
try {
|
|
2019
208
|
await writeFile(filePath, content, { encoding: "utf-8", flag: "wx" });
|
|
2020
|
-
} catch (
|
|
2021
|
-
if (
|
|
209
|
+
} catch (error) {
|
|
210
|
+
if (error && typeof error === "object" && "code" in error && error.code === "EEXIST") {
|
|
2022
211
|
return;
|
|
2023
212
|
}
|
|
2024
|
-
throw
|
|
213
|
+
throw error;
|
|
2025
214
|
}
|
|
2026
215
|
}
|
|
2027
216
|
async function releaseTemplates(api) {
|
|
@@ -2048,45 +237,26 @@ async function releaseTemplates(api) {
|
|
|
2048
237
|
);
|
|
2049
238
|
api.logger?.info?.(`openclaw-workclaw templates ready: ${workspaceDir}`);
|
|
2050
239
|
}
|
|
2051
|
-
const
|
|
240
|
+
const channelEntry = defineChannelPluginEntry({
|
|
2052
241
|
id: "openclaw-workclaw",
|
|
2053
242
|
name: "智小途",
|
|
2054
243
|
description: "智小途企业通讯平台 OpenClaw 渠道插件,支持消息收发、定时任务、工具调用等",
|
|
2055
244
|
configSchema: emptyPluginConfigSchema(),
|
|
2056
245
|
plugin: workclawPlugin,
|
|
2057
246
|
registerFull(api) {
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
api.registerService({
|
|
2062
|
-
id: "openclaw-workclaw-templates",
|
|
2063
|
-
start: async () => {
|
|
2064
|
-
await releaseTemplates(api);
|
|
2065
|
-
}
|
|
2066
|
-
});
|
|
2067
|
-
api.registerHttpRoute({
|
|
2068
|
-
path: "/openclaw-workclaw/workspace/prompts",
|
|
2069
|
-
handler: createPromptsApiHandler(api),
|
|
2070
|
-
auth: "plugin"
|
|
2071
|
-
});
|
|
2072
|
-
api.registerHttpRoute({
|
|
2073
|
-
path: "/openclaw-workclaw/accounts",
|
|
2074
|
-
handler: createAccountsApiHandler(api),
|
|
2075
|
-
auth: "plugin"
|
|
2076
|
-
});
|
|
2077
|
-
api.registerHttpRoute({
|
|
2078
|
-
path: "/openclaw-workclaw/skills",
|
|
2079
|
-
handler: createSkillsApiHandler(api),
|
|
2080
|
-
auth: "plugin"
|
|
2081
|
-
});
|
|
2082
|
-
api.registerHttpRoute({
|
|
2083
|
-
path: "/openclaw-workclaw/sessions",
|
|
2084
|
-
handler: createSessionApiHandler(api),
|
|
2085
|
-
auth: "plugin",
|
|
2086
|
-
match: "prefix"
|
|
2087
|
-
});
|
|
247
|
+
api.logger?.info?.("[openclaw-workclaw] registerFull called");
|
|
248
|
+
registerRuntimeCapabilities(api);
|
|
249
|
+
api.logger?.info?.("[openclaw-workclaw] registerFull completed");
|
|
2088
250
|
}
|
|
2089
251
|
});
|
|
252
|
+
const index = {
|
|
253
|
+
...channelEntry,
|
|
254
|
+
register(api) {
|
|
255
|
+
channelEntry.register(api);
|
|
256
|
+
api.logger?.info?.(`[openclaw-workclaw] compatibility register path mode=${api.registrationMode}`);
|
|
257
|
+
registerRuntimeCapabilities(api);
|
|
258
|
+
}
|
|
259
|
+
};
|
|
2090
260
|
export {
|
|
2091
261
|
index as default
|
|
2092
262
|
};
|