shennian 0.2.102 → 0.2.103
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.
|
@@ -3,7 +3,7 @@ export declare const WECHAT_CHANNEL_HELPER_COMMAND_TIMEOUT_MS: {
|
|
|
3
3
|
readonly healthCheck: 2000;
|
|
4
4
|
readonly permissionsCheck: 10000;
|
|
5
5
|
readonly activitySnapshot: 1000;
|
|
6
|
-
readonly automationLease:
|
|
6
|
+
readonly automationLease: 6000;
|
|
7
7
|
readonly windowsEnsureReady: 20000;
|
|
8
8
|
readonly ocrRecognize: 10000;
|
|
9
9
|
readonly windowsCapture: 5000;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const H=1,i={healthCheck:2e3,permissionsCheck:1e4,activitySnapshot:1e3,automationLease:
|
|
1
|
+
const H=1,i={healthCheck:2e3,permissionsCheck:1e4,activitySnapshot:1e3,automationLease:6e3,windowsEnsureReady:2e4,ocrRecognize:1e4,windowsCapture:5e3,mouseKeyboard:3e3,clipboard:5e3,menuPickItem:5e3,savePanel:1e4,wechatSearch:6e3},a=["screenCapture","visionOcr","windowList","windowFocus","mouseKeyboard","clipboard","imageCropHash","wechatSearch","humanActivity"],c=[...a,"contextMenu"],u=[...c,"automationLease"],p=u,l=[...a,"overlayCleanup","wechatRecovery"],C=[...l,"contextMenu"],h=[...C,"automationLease"];function A(e){return e==="observe"?[...a]:e==="download"?[...c]:[...u]}function w(e){return e==="observe"?[...l]:e==="download"?[...C]:[...h]}function L(e,t=p){const r=String(e||"").trim();if(!r)throw new Error("WeChat channel helper expected version is required");return{type:"hello",protocolVersion:1,expectedHelperVersion:r,capabilities:[...t]}}function S(e,t,r=p){if(!e||e.type!=="ready")return{ok:!1,errorCode:"helper_invalid_response",errorSummary:"Helper did not send a ready frame"};if(e.protocolVersion!==1)return{ok:!1,errorCode:"helper_protocol_mismatch",errorSummary:`Helper protocol ${e.protocolVersion} does not match 1`};if(e.helperVersion!==t)return{ok:!1,errorCode:"helper_version_mismatch",errorSummary:`Helper version ${e.helperVersion} does not match ${t}`};const o=r.filter(_=>!e.capabilities.includes(_));return o.length?{ok:!1,errorCode:"helper_capability_missing",errorSummary:`Helper missing capabilities: ${o.join(", ")}`}:{ok:!0}}function d(e){if(!e||typeof e!="object")return null;const t=e;if(!E(t.warmState))return null;const r=f(t.warmup);return r?{warmState:t.warmState,metrics:r}:{warmState:t.warmState}}function W(e){return e==="health.check"?i.healthCheck:e==="permissions.check"||e==="permissions.requestScreenRecording"||e==="permissions.requestAccessibility"?i.permissionsCheck:e==="activity.snapshot"?i.activitySnapshot:e.startsWith("automation.lease.")?i.automationLease:e==="windows.ensureReady"||e==="windows.cleanupOverlays"||e==="windows.recoverWeChat"?i.windowsEnsureReady:e==="ocr.recognize"||e==="windows.captureAndOcr"?i.ocrRecognize:e==="windows.capture"||e==="screen.capture"?i.windowsCapture:e.startsWith("mouse.")||e.startsWith("keyboard.")?i.mouseKeyboard:e.startsWith("clipboard.")?i.clipboard:e==="menu.pickItem"?i.menuPickItem:e==="savePanel.saveToPath"?i.savePanel:e.startsWith("wechat.")?i.wechatSearch:i.healthCheck}function E(e){return e==="cold"||e==="warming"||e==="warm"||e==="failed"}function f(e){if(!e||typeof e!="object")return;const t=e,r={};return n(t,r,"startedAt"),n(t,r,"readyAt"),n(t,r,"warmupStartedAt"),n(t,r,"warmupCompletedAt"),s(t,r,"coldStartMs"),s(t,r,"warmupMs"),s(t,r,"firstOcrMs"),s(t,r,"warmOcrMs"),s(t,r,"lastOcrMs"),s(t,r,"ocrSampleCount"),n(t,r,"errorCode"),n(t,r,"errorSummary"),Object.keys(r).length>0?r:void 0}function n(e,t,r){typeof e[r]=="string"&&(t[r]=e[r])}function s(e,t,r){const o=e[r];typeof o=="number"&&Number.isFinite(o)&&o>=0&&(t[r]=o)}export{c as WECHAT_CHANNEL_DOWNLOAD_HELPER_CAPABILITIES,i as WECHAT_CHANNEL_HELPER_COMMAND_TIMEOUT_MS,H as WECHAT_CHANNEL_HELPER_PROTOCOL_VERSION,a as WECHAT_CHANNEL_OBSERVE_HELPER_CAPABILITIES,p as WECHAT_CHANNEL_REQUIRED_HELPER_CAPABILITIES,u as WECHAT_CHANNEL_SEND_HELPER_CAPABILITIES,C as WECHAT_CHANNEL_WINDOWS_DOWNLOAD_HELPER_CAPABILITIES,l as WECHAT_CHANNEL_WINDOWS_OBSERVE_HELPER_CAPABILITIES,h as WECHAT_CHANNEL_WINDOWS_SEND_HELPER_CAPABILITIES,L as createWeChatChannelHelperHello,d as extractWeChatChannelHelperWarmupSnapshot,A as requiredWeChatChannelHelperCapabilitiesForProfile,w as requiredWindowsWeChatChannelHelperCapabilitiesForProfile,W as timeoutForWeChatChannelHelperCommand,S as validateWeChatChannelHelperReady};
|