shennian 0.2.103 → 0.2.104
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.
|
@@ -226,8 +226,8 @@
|
|
|
226
226
|
},
|
|
227
227
|
{
|
|
228
228
|
"file": "src/channels/wechat-channel/helper-protocol.js",
|
|
229
|
-
"beforeBytes":
|
|
230
|
-
"afterBytes":
|
|
229
|
+
"beforeBytes": 8066,
|
|
230
|
+
"afterBytes": 3795
|
|
231
231
|
},
|
|
232
232
|
{
|
|
233
233
|
"file": "src/channels/wechat-channel/human-coordination.js",
|
|
@@ -4,6 +4,7 @@ export declare const WECHAT_CHANNEL_HELPER_COMMAND_TIMEOUT_MS: {
|
|
|
4
4
|
readonly permissionsCheck: 10000;
|
|
5
5
|
readonly activitySnapshot: 1000;
|
|
6
6
|
readonly automationLease: 6000;
|
|
7
|
+
readonly windowList: 10000;
|
|
7
8
|
readonly windowsEnsureReady: 20000;
|
|
8
9
|
readonly ocrRecognize: 10000;
|
|
9
10
|
readonly windowsCapture: 5000;
|
|
@@ -89,7 +90,7 @@ export type WeChatChannelHumanActivitySnapshot = {
|
|
|
89
90
|
capturesMousePath?: boolean;
|
|
90
91
|
};
|
|
91
92
|
};
|
|
92
|
-
export type WeChatChannelHelperCommandName = 'health.check' | 'permissions.check' | 'permissions.requestScreenRecording' | 'permissions.requestAccessibility' | 'activity.snapshot' | 'automation.lease.acquire' | 'automation.lease.release' | 'automation.lease.status' | 'automation.lease.simulateInterruption' | 'windows.ensureReady' | 'windows.list' | 'windows.focus' | 'windows.capture' | 'windows.captureAndOcr' | 'windows.cleanupOverlays' | 'windows.recoverWeChat' | 'screen.capture' | 'ocr.recognize' | 'mouse.click' | 'mouse.rightClick' | 'mouse.scroll' | 'keyboard.type' | 'keyboard.shortcut' | 'clipboard.snapshot' | 'clipboard.restore' | 'clipboard.setText' | 'clipboard.setFiles' | 'clipboard.setImage' | 'clipboard.readFileUrls' | 'clipboard.readAttachment' | 'menu.pickItem' | 'savePanel.saveToPath' | 'image.cropHash' | 'wechat.searchConversation' | 'wechat.focusMessageInput';
|
|
93
|
+
export type WeChatChannelHelperCommandName = 'health.check' | 'processes.list' | 'permissions.check' | 'permissions.requestScreenRecording' | 'permissions.requestAccessibility' | 'activity.snapshot' | 'automation.lease.acquire' | 'automation.lease.release' | 'automation.lease.status' | 'automation.lease.simulateInterruption' | 'windows.ensureReady' | 'windows.list' | 'windows.enumerateRaw' | 'windows.focus' | 'windows.capture' | 'windows.captureAndOcr' | 'windows.cleanupOverlays' | 'windows.recoverWeChat' | 'screen.capture' | 'ocr.recognize' | 'mouse.click' | 'mouse.rightClick' | 'mouse.scroll' | 'keyboard.type' | 'keyboard.shortcut' | 'clipboard.snapshot' | 'clipboard.restore' | 'clipboard.setText' | 'clipboard.setFiles' | 'clipboard.setImage' | 'clipboard.readFileUrls' | 'clipboard.readAttachment' | 'menu.pickItem' | 'savePanel.saveToPath' | 'image.cropHash' | 'wechat.searchConversation' | 'wechat.focusMessageInput';
|
|
93
94
|
export type WeChatChannelHelperCommand = {
|
|
94
95
|
id: string;
|
|
95
96
|
command: WeChatChannelHelperCommandName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const w=1,i={healthCheck:2e3,permissionsCheck:1e4,activitySnapshot:1e3,automationLease:6e3,windowList:1e4,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"],u=[...a,"contextMenu"],c=[...u,"automationLease"],p=c,l=[...a,"overlayCleanup","wechatRecovery"],C=[...l,"contextMenu"],h=[...C,"automationLease"];function H(e){return e==="observe"?[...a]:e==="download"?[...u]:[...c]}function A(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 d(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 S(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==="processes.list"?i.windowList:e==="permissions.check"||e==="permissions.requestScreenRecording"||e==="permissions.requestAccessibility"?i.permissionsCheck:e==="activity.snapshot"?i.activitySnapshot:e.startsWith("automation.lease.")?i.automationLease:e==="windows.list"||e==="windows.enumerateRaw"?i.windowList: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{u as WECHAT_CHANNEL_DOWNLOAD_HELPER_CAPABILITIES,i as WECHAT_CHANNEL_HELPER_COMMAND_TIMEOUT_MS,w as WECHAT_CHANNEL_HELPER_PROTOCOL_VERSION,a as WECHAT_CHANNEL_OBSERVE_HELPER_CAPABILITIES,p as WECHAT_CHANNEL_REQUIRED_HELPER_CAPABILITIES,c 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,S as extractWeChatChannelHelperWarmupSnapshot,H as requiredWeChatChannelHelperCapabilitiesForProfile,A as requiredWindowsWeChatChannelHelperCapabilitiesForProfile,W as timeoutForWeChatChannelHelperCommand,d as validateWeChatChannelHelperReady};
|