@xopcai/xopc 0.0.424 → 0.0.425
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/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-AI081rxe.js → activity-store-CMw8qBuC.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DupnTbL7.js → agent-avatar-dicebear-JI0YWOIm.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-CmEj6Uqy.js → agent-avatar-display-YqmwzOSa.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-IEV5yKuu.js → agent-defaults-settings-panel-DlvjxWg6.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-D_njOuFA.js → agent-plugin-dialog-OBueuQSc.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-B_yg9nA3.js → agents-Cp6_5OOQ.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-CUZUolwG.js → agents-admin-api-DLnmdC1h.js} +1 -1
- package/dist/gateway/static/root/assets/{api-bpQ7yR10.js → api-Boc-CVh7.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CWWEVThO.js → api-bL7sxjAF.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-C0_hxwgg.js → app-management-settings-panel-jIG5i7KE.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CLh-qnCC.js → appearance-settings-BnaQW9Xd.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-Bjtm3Rgi.js → apps-page-C2WKUwtN.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-dGnstkhB.js → archive-plugin-DjboG3kA.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-MB2xCoFF.js → automation-api-CZqL9l_d.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-DJQflY78.js → automation-result-state-DRd-X_Ai.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-DXgBxVE2.js → automation-task-card-wbnR5i6N.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-D3O7M2FH.js → automations-page-HyBQIfmn.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-Dk3FVWoX.js → automations-workspace-D6cTOKr7.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-BrVJXmYf.js → binary-plugins-Bg8ARZUH.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Dok4sfT3.js → block-editor-DKohqFAW.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-PJbT3CxW.js → browser-automation-inputs-YeibTzw4.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-kkpX1Q7K.js → browser-automations-page-BWNcbuz2.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-control-api-Bg4wnkeA.js → browser-control-api-CDeuxy2x.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-BrgX_Yb2.js → browser-settings-page-L0nBjfhG.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-Cs6Jt5Gl.js → capabilities-BcQa8c9n.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BMaJizw4.js → capabilities-aT-QjNTl.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-D5hvAG6D.js → capabilities-page-DlpuHdHi.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-BrEvm4IH.js → capabilities-settings-panel-pvqkN2-2.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-1jQgGVc9.js → channels-BUPtawh6.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-BAOWaUJf.js → chat-agents-api-B8JO6Tcj.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-DeWrb9XR.js → chat-chart-block-DRtuFfF1.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-page-CafkCKOj.js → chat-page-BP0huA-W.js} +31 -31
- package/dist/gateway/static/root/assets/{chat-terminal-dock-C544n0-R.js → chat-terminal-dock-Dkqq5FSL.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-D9PXzY8b.js → command-palette-api-qujvNqkK.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-CYXfjpem.js → composer-payload-handoff-CYIhcczq.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-DJmod8-w.js → computer-settings-page-8q4hRmoo.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-b46VH4uy.js → connected-providers-grid-CKZfhHSD.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-BqDbTOTp.js → connector-service-page-DQaTI21R.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-CwRuUnH4.js → connectors-api-BjypBp2g.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-Mq9Bvoax.js → connectors-page-Lf1ZzaVn.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-DWaT0IC0.js → date-picker-D_PSHGpe.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-DV9XAt6F.js → dependency-picker-UqKVJ9dv.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Dffq2NxL.js → desktop-pet-1Et9VqkM.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-narrative-CS8qJpNO.js → desktop-pet-narrative-rADKU0FX.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CrB1ICax.js → desktop-pet-settings-0fCGgaG7.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-liRgSkcT.js → dev-view-store-TTj_djD8.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-ByEL5lvM.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-EKqQLQrE.js → directory-picker-path-field-C07a7wYX.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-D-b1X6ro.js → discussion-annotation-sync-BFqKm9ky.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-wD97GeG0.js → extension-debug-page-DFaVlqas.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-B4Q1CjvW.js → extension-iframe-host-BfzPfXBq.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-ak1_K3u8.js → extension-marketplace-api-ow0K1Y4_.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DWFI4iIh.js → extension-page-CrDADV5W.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-BZwcaU5Y.js → extension-provider-mnRoa63o.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-cn4KS42C.js → extension-settings-page-BLl02GFY.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-c3gDD9sM.js → file-preview-surface-TGdKqhCf.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-Dmt5JhZU.js → gateway-config-swr-DfPQIHOL.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-CJtDXQCt.js → gateway-realtime-67vWg_M2.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-Bkt1z-xo.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-DInvvT5u.js → gateway-restart-CLtR2wkL.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-BZXdv2FE.js → gateway-settings-COvC3r-l.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-s2KcWekp.js → gateway-startup-retry-9YQllbw2.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-DtnmDd87.js → global-defaults-api-DYMRjGvd.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-CAVjA5rO.js → home-page-k9LFXcVa.js} +2 -2
- package/dist/gateway/static/root/assets/{image-generation-api-RQQokgE9.js → image-generation-api-Dzydfvy8.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-BP_4TubV.js → imports-page-Csd_YZXZ.js} +1 -1
- package/dist/gateway/static/root/assets/index-CpwPxKQ8.css +1 -0
- package/dist/gateway/static/root/assets/index-DKW7BeT_.js +11 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-BNzNuXJ8.js → install-connector-dialog-CTQAKTPv.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DNRQFepg.js → keyboard-shortcuts-settings-B201bMIa.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CvY5XxbX.js → local-app-workbench-page-CD_8_gd_.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-DfwEvd8G.js → local-apps-page-BOwqNH0L.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-CuDdIyxR.js → local-session-drafts-DjmK-SM9.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-TQcz_Vjt.js → locale-store-Bg_XR36n.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-eq49F1Rt.js → logs-page-gw3E9CMQ.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-BaYXDMOJ.js → management-settings-t_Z2mCyw.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-D4nII6Zv.js → markdown-view-BUpXJUPv.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-MvlAY405.js → media-plugins-_shnaEMY.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DG4HLOER.js +3 -0
- package/dist/gateway/static/root/assets/{model-selector-nsoNHqif.js → model-selector-a7PIT1Lk.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-CFIazNIF.js → models-hub-cache-KOJC3z6Q.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-KPzbHiEW.js → note-detail-panel-BsHYUFgk.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-B-bEtjhj.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-HVxR5bRD.js → notes-api-BSmikUKI.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-yShJeR3i.js → notes-page-CA0NRL8O.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-CfKjRVnb.js → oauth-api-D2t9HXoC.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-D4uqONWr.js → oauth-provider-connect-DGGGGtcB.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-B98nlKTc.js → page-context-capture-button-BH54VO0V.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-HcuK45iu.js → page-context-draft-BS5y8Cx9.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-BdZnUh-D.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-_d72UP_d.js → personal-avatar-D8DtpDTa.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-B19h_3WQ.js → personal-page-KJezmTKP.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-CfwtGyue.js → personal-settings-panel-9uDaNJy5.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-D8bqsDk_.js → phone-dependencies-card-DLYrI0C4.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-CL_Zn6Xd.js → phone-model-picker-BbA2iI-3.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-C5Jia8eQ.js → phone-settings-page-Cg_BPss4.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-FBfrfkYq.js → phone-workspace-store-CVDk80Bf.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-gAq2KPzK.js → plugin-details-dialog-DgibLkc3.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-Ck8GAX_y.js → preference-select-fields-BVoN-lAv.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-BJ9oTnNs.js → product-automation-feedback-DCo90zGh.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-Dw9hUdxP.js → product-open-page-OWl8IAoY.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-C0iPzmSm.js → product-preview-content-Cjas7UNe.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-COFtHoh6.js → product-preview-modal-CPWRvBI9.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-C5Amjah-.js → project-detail-page-B_HlZux_.js} +1 -1
- package/dist/gateway/static/root/assets/{project-understanding-DpL9ADQU.js → project-understanding-Ba02SFzB.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-gGg9nM2t.js → projects-page-CdfKjp95.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-D6JJRlJb.js → providers-api-rwQ4LWzr.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-DxX1xKyt.js → recording-upload-BSmvRrZQ.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-BfXzBR1D.js → registry-api-Vy7LfH6E.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-BZA4StwC.js → remote-access-hub-UXrnpGev.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-X-SIrZYI.js → resource-unavailable-f9OzSi4W.js} +1 -1
- package/dist/gateway/static/root/assets/{route-preload-CWRb0UCt.js → route-preload-BtObM-co.js} +2 -2
- package/dist/gateway/static/root/assets/{runtime-tools-api-1DjsPyQ5.js → runtime-tools-api-Bt8t37z5.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BnCtyORj.js → runtime-tools-settings-panel-DU4UXnBm.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-ChSOfHHh.js → service-recommendation-list-CuYsRcBB.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-rvY5aWw8.js → session-api-DJI9eSgw.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-CtKgACGl.js +23 -0
- package/dist/gateway/static/root/assets/{sessions-page-DAS2IUGT.js → sessions-page-BAsKzRHt.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CjAFqg2U.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-ZKRIuk7h.js → settings-advanced-section-BxUuF_yi.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-CtJ8pEfm.js → settings-mode-store-CaoRh2gt.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-DuNCn8i-.js → settings-page-header-CyUHrn7c.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-DeNC8YHJ.js → settings-page-layout-DGVqXrlp.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-B3pUce-_.js → settings-page-qQ8-6dJ_.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-Fc3vuz_h.js → setup-status-panel-BpaPb625.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-B3hwjVAx.js → share-link-dialog-CQJ6Ykm2.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-D_9oFzGS.js → share-preview-page-Cem96FbB.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-BoUpXmxq.js → shares-api-Dowes16l.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-Drfuvepz.js → shares-settings-DZEkZDR0.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-By2HhJ9O.js → skill-api-D8ZwFEVe.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-TaUCzS8Y.js → skill-list-api-B4gp00-f.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-CN2fpS1n.js → skill-reload-api-ClmaaDXo.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-LzGLique.js → skills-page-CV0X9rvG.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-Cuyg8Ml3.js → system-settings-panel-D095uacX.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-CY2C4AM2.js +2 -0
- package/dist/gateway/static/root/assets/{task-result-evidence-DDubAU_5.js → task-result-evidence-LUrJlUhb.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-BNs75Wdr.js → terminal-panel-store-BqEDB1Vl.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-DB1ZfBUm.js → theme-store-gAcojLgP.js} +1 -1
- package/dist/gateway/static/root/assets/tool-friendly-title-o6sxGVUu.js +1 -0
- package/dist/gateway/static/root/assets/{tracing-settings-page-TvtX4Goh.js → tracing-settings-page-B1ZRh-Is.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-COoVEdV9.js → tunnel-api-C9u9E3UQ.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-Dr_MLgYe.js → understanding-activity-store-BTrzsR6_.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-DGmLGEqw.js → understanding-refresh-store-5Qava3jh.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-DP6eb6ed.js → usage-page-DFMLYKAc.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-itwjDYUb.js → use-autosave-3O-X7x15.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-hjIGlI_2.js → use-composer-attachments-BLc4dBfe.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-ClLa0g8D.js → use-file-preview-expanded-BaOmTXsT.js} +2 -2
- package/dist/gateway/static/root/assets/{use-personal-profile-vhWk6tTU.js → use-personal-profile-MusPgljM.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-dfXXjA2-.js → use-workspace-tree-Ck_U2yTw.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-D8dswPWd.js → user-model-page-Den5Lg-k.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-BIfBySnN.js → voice-api-key-field-C5zJApoa.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-J4o59ICE.js → voice-config-api-DC1bYDt1.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-B1mlpUdC.js → voice-input-shortcut-events-0SZjJdVV.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-transcribe-api-xxaSOOmq.js → voice-transcribe-api-CxVeANPX.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DqwT1E5u.js → work-discovery-overlay-DAQ8McVe.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-BzYQmPLT.js → work-discovery-page-DUQysEyb.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-D2Zf3GOG.js → working-directory-picker-modal-BO9qdJyZ.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-Bnx3eS2M.js → workspace-api-ZrN6yUER.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-Bo5dwoWP.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-D13qHzVr.js → workspace-file-preview-dialog-Yj_kBWSb.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-Cou-ig1H.js → workspace-open-location-menu-yxT7wajO.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-DQGPKxHA.js → xopc-cloud-account-card-IcH9KDzx.js} +1 -1
- package/dist/gateway/static/root/index.html +81 -81
- package/dist/package.js +1 -1
- package/dist/packages/computer-control-contract/src/index.js +33 -3
- package/dist/src/agent/embedded/run-turn.js +64 -4
- package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
- package/dist/src/agent/tool-manuals/computer.js +6 -0
- package/dist/src/agent/tools/computer-use-tool.js +18 -5
- package/dist/src/agent/tools/phone-use-tool.js +12 -2
- package/dist/src/cli/commands/backup.js +1 -1
- package/dist/src/computer/agent-context.d.ts +21 -0
- package/dist/src/computer/agent-context.js +107 -0
- package/dist/src/computer/broker.d.ts +4 -2
- package/dist/src/computer/broker.js +26 -11
- package/dist/src/computer/diagnostics.d.ts +60 -6
- package/dist/src/computer/diagnostics.js +45 -4
- package/dist/src/computer/errors.d.ts +1 -1
- package/dist/src/computer/errors.js +4 -0
- package/dist/src/computer/evaluation.d.ts +2 -2
- package/dist/src/computer/native-timing.d.ts +15 -0
- package/dist/src/computer/native-timing.js +49 -0
- package/dist/src/computer/program-runtime.d.ts +22 -0
- package/dist/src/computer/program-runtime.js +105 -0
- package/dist/src/computer/runtime.d.ts +36 -2
- package/dist/src/computer/runtime.js +269 -58
- package/dist/src/config/schema.d.ts +18 -0
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +6 -0
- package/dist/src/phone/adb-driver.d.ts +15 -1
- package/dist/src/phone/adb-driver.js +104 -41
- package/dist/src/phone/autoglm-protocol.d.ts +36 -0
- package/dist/src/phone/autoglm-protocol.js +88 -0
- package/dist/src/phone/autoglm-upstream-prompt.d.ts +2 -0
- package/dist/src/phone/autoglm-upstream-prompt.js +5 -0
- package/dist/src/phone/autoglm-upstream.LICENSE +201 -0
- package/dist/src/phone/cloud-adb-connection.d.ts +3 -0
- package/dist/src/phone/cloud-adb-connection.js +102 -31
- package/dist/src/phone/cloud-adb.js +18 -6
- package/dist/src/phone/completion-recovery.d.ts +6 -0
- package/dist/src/phone/completion-recovery.js +30 -0
- package/dist/src/phone/contracts.d.ts +20 -0
- package/dist/src/phone/contracts.js +6 -0
- package/dist/src/phone/execution-trace.d.ts +51 -0
- package/dist/src/phone/execution-trace.js +78 -0
- package/dist/src/phone/model-adapter.d.ts +9 -1
- package/dist/src/phone/model-adapter.js +132 -61
- package/dist/src/phone/model-response.d.ts +5 -0
- package/dist/src/phone/model-response.js +118 -0
- package/dist/src/phone/runtime.d.ts +4 -0
- package/dist/src/phone/runtime.js +146 -16
- package/dist/src/phone/text-session.d.ts +14 -0
- package/dist/src/phone/text-session.js +39 -0
- package/dist/src/phone/ui-dump-binary.d.ts +1 -1
- package/dist/src/phone/ui-dump-binary.js +1 -1
- package/dist/src/phone/ui-session.d.ts +22 -0
- package/dist/src/phone/ui-session.js +191 -0
- package/dist/src/process/phone-process.d.ts +1 -0
- package/dist/src/process/phone-process.js +11 -1
- package/package.json +2 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-1du1hfi5.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DcsZyYEa.js +0 -1
- package/dist/gateway/static/root/assets/index-BS9mjvSL.js +0 -11
- package/dist/gateway/static/root/assets/index-pT-m6l6b.css +0 -1
- package/dist/gateway/static/root/assets/messages-DaLmc4W1.js +0 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-DticJxxh.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-D6SzJ9Ch.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-D2rbRfX3.js +0 -23
- package/dist/gateway/static/root/assets/settings-advanced-gate-CYDQybNF.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-6A9337pK.js +0 -2
- package/dist/gateway/static/root/assets/tool-friendly-title-DGmi7rCQ.js +0 -1
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-COUVwj-p.js +0 -1
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { init_paths, resolveCredentialsDir } from "../config/paths.js";
|
|
2
2
|
import { PhoneError, init_contracts } from "./contracts.js";
|
|
3
|
+
import { measurePhonePhase } from "./execution-trace.js";
|
|
3
4
|
import { readScrcpyServer } from "./scrcpy-assets.js";
|
|
5
|
+
import { PHONE_UI_DEX } from "./ui-dump-binary.js";
|
|
6
|
+
import { PhoneUiSession } from "./ui-session.js";
|
|
4
7
|
import { parsePhoneApplications, phoneApplicationsCommand } from "./applications.js";
|
|
5
8
|
import { observeAdbConsumption } from "./cloud-adb-writable.js";
|
|
6
9
|
import { protectPhoneCredential } from "./cloud-key-permissions.js";
|
|
7
|
-
import { PHONE_UI_DEX } from "./ui-dump-binary.js";
|
|
8
10
|
import { join } from "node:path";
|
|
9
|
-
import { createPrivateKey, randomUUID } from "node:crypto";
|
|
11
|
+
import { createHash, createPrivateKey, randomUUID } from "node:crypto";
|
|
10
12
|
import { lstat, mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
11
13
|
import { connect } from "node:net";
|
|
12
14
|
import { Adb, AdbDaemonTransport, AdbPacket, AdbPacketSerializeStream, AdbSignatureAuthenticator } from "@yume-chan/adb";
|
|
@@ -231,53 +233,122 @@ var CloudAdbConnection = class {
|
|
|
231
233
|
this.idle.unref();
|
|
232
234
|
}
|
|
233
235
|
}
|
|
234
|
-
async
|
|
236
|
+
async prepareUi(signal) {
|
|
235
237
|
const combined = AbortSignal.any([signal, AbortSignal.timeout(2e4)]);
|
|
236
238
|
const abort = () => this.close();
|
|
237
239
|
combined.addEventListener("abort", abort, { once: true });
|
|
238
|
-
const
|
|
240
|
+
const binary = Buffer.from(PHONE_UI_DEX, "base64");
|
|
241
|
+
const hash = createHash("sha256").update(binary).digest("hex");
|
|
242
|
+
const remote = `/data/local/tmp/xopc-ui-${hash}.dex`;
|
|
243
|
+
let staging;
|
|
239
244
|
try {
|
|
240
245
|
combined.throwIfAborted();
|
|
241
|
-
|
|
242
|
-
combined.throwIfAborted();
|
|
243
|
-
const sync = await adb.sync();
|
|
244
|
-
try {
|
|
245
|
-
const binary = Buffer.from(PHONE_UI_DEX, "base64");
|
|
246
|
-
await sync.write({
|
|
247
|
-
filename: remote,
|
|
248
|
-
permission: 384,
|
|
249
|
-
file: new ReadableStream({ start(controller) {
|
|
250
|
-
controller.enqueue(binary);
|
|
251
|
-
controller.close();
|
|
252
|
-
} })
|
|
253
|
-
});
|
|
254
|
-
} finally {
|
|
255
|
-
await sync.dispose();
|
|
256
|
-
}
|
|
257
|
-
const result = (await this.command("", [
|
|
246
|
+
if ((await this.command("", [
|
|
258
247
|
"-s",
|
|
259
248
|
this.endpoint,
|
|
260
249
|
"shell",
|
|
261
|
-
"
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
"
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
250
|
+
"sha256sum",
|
|
251
|
+
remote
|
|
252
|
+
], combined)).toString().trim().split(/\s+/)[0] !== hash) {
|
|
253
|
+
staging = `${remote}.${randomUUID()}.tmp`;
|
|
254
|
+
await measurePhonePhase("dex_upload", async () => {
|
|
255
|
+
const adb = await this.client();
|
|
256
|
+
combined.throwIfAborted();
|
|
257
|
+
const sync = await adb.sync();
|
|
258
|
+
try {
|
|
259
|
+
await sync.write({
|
|
260
|
+
filename: staging,
|
|
261
|
+
permission: 384,
|
|
262
|
+
file: new ReadableStream({ start(controller) {
|
|
263
|
+
controller.enqueue(binary);
|
|
264
|
+
controller.close();
|
|
265
|
+
} })
|
|
266
|
+
});
|
|
267
|
+
} finally {
|
|
268
|
+
await sync.dispose();
|
|
269
|
+
}
|
|
270
|
+
await this.command("", [
|
|
271
|
+
"-s",
|
|
272
|
+
this.endpoint,
|
|
273
|
+
"shell",
|
|
274
|
+
"chmod",
|
|
275
|
+
"400",
|
|
276
|
+
staging
|
|
277
|
+
], combined);
|
|
278
|
+
await this.command("", [
|
|
279
|
+
"-s",
|
|
280
|
+
this.endpoint,
|
|
281
|
+
"shell",
|
|
282
|
+
"mv",
|
|
283
|
+
"-f",
|
|
284
|
+
staging,
|
|
285
|
+
remote
|
|
286
|
+
], combined);
|
|
287
|
+
if ((await this.command("", [
|
|
288
|
+
"-s",
|
|
289
|
+
this.endpoint,
|
|
290
|
+
"shell",
|
|
291
|
+
"sha256sum",
|
|
292
|
+
remote
|
|
293
|
+
], combined)).toString().trim().split(/\s+/)[0] !== hash) throw new PhoneError("PHONE_UI_UNAVAILABLE", "Phone UI helper verification failed", 502);
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
return remote;
|
|
269
297
|
} finally {
|
|
270
298
|
combined.removeEventListener("abort", abort);
|
|
271
|
-
await this.command("", [
|
|
299
|
+
if (staging) await this.command("", [
|
|
272
300
|
"-s",
|
|
273
301
|
this.endpoint,
|
|
274
302
|
"shell",
|
|
275
303
|
"rm",
|
|
276
304
|
"-f",
|
|
277
|
-
|
|
305
|
+
staging
|
|
278
306
|
], void 0, 3e3).catch(() => {});
|
|
279
307
|
}
|
|
280
308
|
}
|
|
309
|
+
async hierarchy(signal) {
|
|
310
|
+
const remote = await this.prepareUi(signal);
|
|
311
|
+
const result = (await this.command("", [
|
|
312
|
+
"-s",
|
|
313
|
+
this.endpoint,
|
|
314
|
+
"shell",
|
|
315
|
+
"env",
|
|
316
|
+
`CLASSPATH=${remote}`,
|
|
317
|
+
"app_process",
|
|
318
|
+
"/",
|
|
319
|
+
"ai.xopc.phone.PhoneUiDump"
|
|
320
|
+
], signal)).toString();
|
|
321
|
+
if (!result.includes("</hierarchy>")) throw new PhoneError("PHONE_UI_UNAVAILABLE", "Incomplete phone hierarchy", 502);
|
|
322
|
+
return result;
|
|
323
|
+
}
|
|
324
|
+
async observer(signal) {
|
|
325
|
+
const combined = AbortSignal.any([signal, AbortSignal.timeout(2e4)]);
|
|
326
|
+
const abort = () => this.close();
|
|
327
|
+
combined.addEventListener("abort", abort, { once: true });
|
|
328
|
+
try {
|
|
329
|
+
const remote = await this.prepareUi(combined);
|
|
330
|
+
const adb = await this.client();
|
|
331
|
+
combined.throwIfAborted();
|
|
332
|
+
const channel = await adb.createSocket(`exec:env CLASSPATH=${remote} app_process / ai.xopc.phone.PhoneUiDump --resident`);
|
|
333
|
+
if (combined.aborted) {
|
|
334
|
+
await channel.close();
|
|
335
|
+
combined.throwIfAborted();
|
|
336
|
+
}
|
|
337
|
+
clearTimeout(this.idle);
|
|
338
|
+
const writer = channel.writable.getWriter();
|
|
339
|
+
writer.closed.catch(() => {});
|
|
340
|
+
return new PhoneUiSession({
|
|
341
|
+
readable: channel.readable,
|
|
342
|
+
write: (data) => writer.write(data),
|
|
343
|
+
close: async () => {
|
|
344
|
+
await channel.close();
|
|
345
|
+
writer.releaseLock();
|
|
346
|
+
}
|
|
347
|
+
});
|
|
348
|
+
} finally {
|
|
349
|
+
combined.removeEventListener("abort", abort);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
281
352
|
async applications(signal) {
|
|
282
353
|
const combined = AbortSignal.any([signal, AbortSignal.timeout(3e4)]);
|
|
283
354
|
const abort = () => this.close();
|
|
@@ -10,15 +10,27 @@ var CloudAdbConnection = class CloudAdbConnection extends CloudAdbConnection$1 {
|
|
|
10
10
|
} finally {
|
|
11
11
|
listing.dispose();
|
|
12
12
|
}
|
|
13
|
-
}, async (
|
|
13
|
+
}, void 0, this.hierarchy.bind(this), async (_serial, failed) => {
|
|
14
14
|
const { CloudScrcpyProvider } = await import("./cloud-scrcpy.js");
|
|
15
|
-
|
|
15
|
+
return new CloudScrcpyProvider(this.endpoint, Buffer.from(this.key), failed, void 0, true);
|
|
16
|
+
}, async (signal) => {
|
|
17
|
+
const observation = new CloudAdbConnection(this.endpoint, Buffer.from(this.key));
|
|
16
18
|
try {
|
|
17
|
-
await
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
const session = await observation.observer(signal);
|
|
20
|
+
const close = session.close.bind(session);
|
|
21
|
+
session.close = async () => {
|
|
22
|
+
try {
|
|
23
|
+
await close();
|
|
24
|
+
} finally {
|
|
25
|
+
observation.dispose();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return session;
|
|
29
|
+
} catch (error) {
|
|
30
|
+
observation.dispose();
|
|
31
|
+
throw error;
|
|
20
32
|
}
|
|
21
|
-
}
|
|
33
|
+
});
|
|
22
34
|
}
|
|
23
35
|
};
|
|
24
36
|
//#endregion
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PhoneCompletion, PhoneObservation } from './contracts.js';
|
|
2
|
+
export declare const PHONE_COMPLETION_CORRECTIONS = 2;
|
|
3
|
+
/** Warn only when visible matching content could be mistaken for an absent exact input field. */
|
|
4
|
+
export declare function phoneCompletionGuidance(completion: PhoneCompletion, screen: PhoneObservation, changed: boolean): string | undefined;
|
|
5
|
+
/** Diagnostic feedback only; completion conditions never authorize generated device actions. */
|
|
6
|
+
export declare function phoneCompletionRecoveryHint(completion: PhoneCompletion, screen: PhoneObservation, changed: boolean, attempt: number): string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { phoneCompletionSatisfied } from "./reliability.js";
|
|
2
|
+
//#region src/phone/completion-recovery.ts
|
|
3
|
+
const PHONE_COMPLETION_CORRECTIONS = 2;
|
|
4
|
+
function completionHint(completion, screen, changed, prefix, concise = false) {
|
|
5
|
+
let evidence;
|
|
6
|
+
const preview = (value, limit = 60) => JSON.stringify(value.slice(0, limit));
|
|
7
|
+
if (completion.appPackage && completion.appPackage !== screen.package) evidence = `Required app ${preview(completion.appPackage, 90)}; observed ${preview(screen.package, 90)}.`;
|
|
8
|
+
else if (completion.field && !phoneCompletionSatisfied({ field: completion.field }, screen, changed)) {
|
|
9
|
+
const fields = screen.elements.filter((node) => node.editable && !node.password && node.resourceId === completion.field.resourceId);
|
|
10
|
+
evidence = `Editable field ${preview(completion.field.resourceId, 100)} must equal ${preview(completion.field.value)}; ` + (fields.length === 1 ? `observed ${preview(fields[0].text)}.` : `no unique non-password field (${fields.length} matches).`);
|
|
11
|
+
} else {
|
|
12
|
+
const texts = screen.elements.filter((node) => !node.password).flatMap((node) => [node.text, node.description]);
|
|
13
|
+
const missing = completion.textAll?.find((value) => !texts.some((text) => text.includes(value)));
|
|
14
|
+
evidence = missing ? `Required native text missing: ${preview(missing, 100)}.` : completion.textAny && !completion.textAny.some((value) => texts.some((text) => text.includes(value))) ? `No required native text alternative is visible: ${preview(completion.textAny[0], 100)}.` : "The required UI change has not been observed.";
|
|
15
|
+
}
|
|
16
|
+
const instruction = (completion.field ? "Matching visible content does not prove an exact field condition. " : "") + "Return one safe action authorized by the original goal, or request takeover if blocked. Do not finish without evidence." + (concise ? " Return only the action, without a screen summary." : "");
|
|
17
|
+
return `${prefix}${evidence.slice(0, 500 - prefix.length - instruction.length - 1)} ${instruction}`;
|
|
18
|
+
}
|
|
19
|
+
/** Warn only when visible matching content could be mistaken for an absent exact input field. */
|
|
20
|
+
function phoneCompletionGuidance(completion, screen, changed) {
|
|
21
|
+
const field = completion.field;
|
|
22
|
+
if (!field?.value.trim() || screen.elements.some((node) => node.resourceId === field.resourceId)) return void 0;
|
|
23
|
+
return screen.elements.some((node) => !node.password && !node.editable && node.bounds[0] >= 0 && node.bounds[1] >= 0 && node.bounds[2] <= screen.width && node.bounds[3] <= screen.height && node.bounds[2] > node.bounds[0] && node.bounds[3] > node.bounds[1] && [node.text, node.description].some((text) => text.includes(field.value))) ? completionHint(completion, screen, changed, "Native completion: NOT MET. ", true) : void 0;
|
|
24
|
+
}
|
|
25
|
+
/** Diagnostic feedback only; completion conditions never authorize generated device actions. */
|
|
26
|
+
function phoneCompletionRecoveryHint(completion, screen, changed, attempt) {
|
|
27
|
+
return completionHint(completion, screen, changed, `Completion rejected (${attempt}/2). `);
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { PHONE_COMPLETION_CORRECTIONS, phoneCompletionGuidance, phoneCompletionRecoveryHint };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import type { PhonePerformance } from './execution-trace.js';
|
|
2
3
|
export declare const PhoneProfileSchema: z.ZodEnum<{
|
|
3
4
|
"autoglm-phone-v1": "autoglm-phone-v1";
|
|
4
5
|
"structured-phone-v1": "structured-phone-v1";
|
|
@@ -23,6 +24,24 @@ export declare const PhoneConfigSchema: z.ZodPrefault<z.ZodObject<{
|
|
|
23
24
|
direct: "direct";
|
|
24
25
|
}>>;
|
|
25
26
|
adbPath: z.ZodOptional<z.ZodString>;
|
|
27
|
+
autoGlmPrompt: z.ZodDefault<z.ZodEnum<{
|
|
28
|
+
current: "current";
|
|
29
|
+
upstream: "upstream";
|
|
30
|
+
}>>;
|
|
31
|
+
autoGlmProtocol: z.ZodDefault<z.ZodEnum<{
|
|
32
|
+
current: "current";
|
|
33
|
+
upstream: "upstream";
|
|
34
|
+
}>>;
|
|
35
|
+
autoGlmSampling: z.ZodDefault<z.ZodEnum<{
|
|
36
|
+
current: "current";
|
|
37
|
+
upstream: "upstream";
|
|
38
|
+
}>>;
|
|
39
|
+
modelResponseMode: z.ZodDefault<z.ZodEnum<{
|
|
40
|
+
json: "json";
|
|
41
|
+
stream: "stream";
|
|
42
|
+
}>>;
|
|
43
|
+
batchReadings: z.ZodDefault<z.ZodBoolean>;
|
|
44
|
+
modelRepetitionGuard: z.ZodDefault<z.ZodBoolean>;
|
|
26
45
|
semanticControls: z.ZodDefault<z.ZodBoolean>;
|
|
27
46
|
hierarchicalPlanning: z.ZodDefault<z.ZodBoolean>;
|
|
28
47
|
maxActionsPerSession: z.ZodDefault<z.ZodNumber>;
|
|
@@ -409,6 +428,7 @@ export type PhoneReport = {
|
|
|
409
428
|
feedback?: PhoneTaskFeedback;
|
|
410
429
|
sourceConversationId?: string;
|
|
411
430
|
readings?: PhoneReading[];
|
|
431
|
+
performance?: PhonePerformance;
|
|
412
432
|
steps: Array<{
|
|
413
433
|
action: PhoneAction['type'];
|
|
414
434
|
at: number;
|
|
@@ -12,6 +12,12 @@ var init_contracts = __esmMin((() => {
|
|
|
12
12
|
enabled: z.boolean().default(false),
|
|
13
13
|
executionMode: PhoneExecutionModeSchema.default("collaborative"),
|
|
14
14
|
adbPath: z.string().min(1).optional(),
|
|
15
|
+
autoGlmPrompt: z.enum(["current", "upstream"]).default("current"),
|
|
16
|
+
autoGlmProtocol: z.enum(["current", "upstream"]).default("current"),
|
|
17
|
+
autoGlmSampling: z.enum(["current", "upstream"]).default("current"),
|
|
18
|
+
modelResponseMode: z.enum(["json", "stream"]).default("json"),
|
|
19
|
+
batchReadings: z.boolean().default(false),
|
|
20
|
+
modelRepetitionGuard: z.boolean().default(false),
|
|
15
21
|
semanticControls: z.boolean().default(false),
|
|
16
22
|
hierarchicalPlanning: z.boolean().default(false),
|
|
17
23
|
maxActionsPerSession: z.number().int().min(1).max(80).default(40),
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type PhonePhase = 'observation' | 'hierarchy' | 'capture' | 'foreground' | 'screenshot' | 'display' | 'field_transaction' | 'dispatch' | 'input' | 'input_confirmation' | 'settle' | 'model_request' | 'model_parse' | 'screen_reading' | 'dex_upload';
|
|
2
|
+
export type PhonePhaseMetric = {
|
|
3
|
+
count: number;
|
|
4
|
+
errors: number;
|
|
5
|
+
totalMs: number;
|
|
6
|
+
maxMs: number;
|
|
7
|
+
};
|
|
8
|
+
export type PhoneModelMetric = {
|
|
9
|
+
durationMs?: number;
|
|
10
|
+
preparationMs?: number;
|
|
11
|
+
firstByteMs?: number;
|
|
12
|
+
firstTokenMs?: number;
|
|
13
|
+
httpStatus?: number;
|
|
14
|
+
promptTokens?: number;
|
|
15
|
+
completionTokens?: number;
|
|
16
|
+
totalTokens?: number;
|
|
17
|
+
imageBytes?: number;
|
|
18
|
+
requestBytes?: number;
|
|
19
|
+
responseBytes?: number;
|
|
20
|
+
finishReason?: string;
|
|
21
|
+
errorCode?: string;
|
|
22
|
+
protocol?: string;
|
|
23
|
+
prompt?: string;
|
|
24
|
+
sampling?: string;
|
|
25
|
+
transport?: string;
|
|
26
|
+
};
|
|
27
|
+
export type PhonePerformance = {
|
|
28
|
+
operationId: string;
|
|
29
|
+
durationMs: number;
|
|
30
|
+
phases: Partial<Record<PhonePhase, PhonePhaseMetric>>;
|
|
31
|
+
modelCalls: PhoneModelMetric[];
|
|
32
|
+
droppedModelCalls: number;
|
|
33
|
+
};
|
|
34
|
+
/** Numeric, bounded diagnostics only; no screen text, prompts, model output or credentials. */
|
|
35
|
+
export declare class PhoneExecutionTrace {
|
|
36
|
+
readonly id: `${string}-${string}-${string}-${string}-${string}`;
|
|
37
|
+
private started;
|
|
38
|
+
private phases;
|
|
39
|
+
private calls;
|
|
40
|
+
private dropped;
|
|
41
|
+
private endedAt?;
|
|
42
|
+
get active(): boolean;
|
|
43
|
+
finish(): void;
|
|
44
|
+
run<T>(work: () => T): T;
|
|
45
|
+
record(phase: PhonePhase, durationMs: number, failed: boolean): void;
|
|
46
|
+
model(metric: PhoneModelMetric): void;
|
|
47
|
+
snapshot(): PhonePerformance;
|
|
48
|
+
}
|
|
49
|
+
export declare function currentPhoneTrace(): PhoneExecutionTrace | undefined;
|
|
50
|
+
/** Phases can overlap or nest; their sums must not be treated as wall-clock percentages. */
|
|
51
|
+
export declare function measurePhonePhase<T>(phase: PhonePhase, work: () => Promise<T>): Promise<T>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { AsyncLocalStorage } from "node:async_hooks";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
3
|
+
import { performance } from "node:perf_hooks";
|
|
4
|
+
//#region src/phone/execution-trace.ts
|
|
5
|
+
const context = new AsyncLocalStorage();
|
|
6
|
+
const rounded = (value) => Math.round(value * 100) / 100;
|
|
7
|
+
/** Numeric, bounded diagnostics only; no screen text, prompts, model output or credentials. */
|
|
8
|
+
var PhoneExecutionTrace = class {
|
|
9
|
+
id = randomUUID();
|
|
10
|
+
started = performance.now();
|
|
11
|
+
phases = {};
|
|
12
|
+
calls = [];
|
|
13
|
+
dropped = 0;
|
|
14
|
+
endedAt;
|
|
15
|
+
get active() {
|
|
16
|
+
return this.endedAt === void 0;
|
|
17
|
+
}
|
|
18
|
+
finish() {
|
|
19
|
+
this.endedAt ??= performance.now();
|
|
20
|
+
}
|
|
21
|
+
run(work) {
|
|
22
|
+
return context.run(this, work);
|
|
23
|
+
}
|
|
24
|
+
record(phase, durationMs, failed) {
|
|
25
|
+
if (!this.active) return;
|
|
26
|
+
const metric = this.phases[phase] ??= {
|
|
27
|
+
count: 0,
|
|
28
|
+
errors: 0,
|
|
29
|
+
totalMs: 0,
|
|
30
|
+
maxMs: 0
|
|
31
|
+
};
|
|
32
|
+
metric.count++;
|
|
33
|
+
metric.errors += Number(failed);
|
|
34
|
+
metric.totalMs += durationMs;
|
|
35
|
+
metric.maxMs = Math.max(metric.maxMs, durationMs);
|
|
36
|
+
}
|
|
37
|
+
model(metric) {
|
|
38
|
+
if (!this.active) return;
|
|
39
|
+
if (this.calls.length === 120) {
|
|
40
|
+
this.calls.shift();
|
|
41
|
+
this.dropped++;
|
|
42
|
+
}
|
|
43
|
+
this.calls.push({ ...metric });
|
|
44
|
+
}
|
|
45
|
+
snapshot() {
|
|
46
|
+
return {
|
|
47
|
+
operationId: this.id,
|
|
48
|
+
durationMs: rounded((this.endedAt ?? performance.now()) - this.started),
|
|
49
|
+
phases: Object.fromEntries(Object.entries(this.phases).map(([phase, metric]) => [phase, {
|
|
50
|
+
...metric,
|
|
51
|
+
totalMs: rounded(metric.totalMs),
|
|
52
|
+
maxMs: rounded(metric.maxMs)
|
|
53
|
+
}])),
|
|
54
|
+
modelCalls: structuredClone(this.calls),
|
|
55
|
+
droppedModelCalls: this.dropped
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
function currentPhoneTrace() {
|
|
60
|
+
const trace = context.getStore();
|
|
61
|
+
return trace?.active ? trace : void 0;
|
|
62
|
+
}
|
|
63
|
+
/** Phases can overlap or nest; their sums must not be treated as wall-clock percentages. */
|
|
64
|
+
async function measurePhonePhase(phase, work) {
|
|
65
|
+
const trace = currentPhoneTrace();
|
|
66
|
+
if (!trace) return work();
|
|
67
|
+
const start = performance.now();
|
|
68
|
+
let failed = true;
|
|
69
|
+
try {
|
|
70
|
+
const result = await work();
|
|
71
|
+
failed = false;
|
|
72
|
+
return result;
|
|
73
|
+
} finally {
|
|
74
|
+
trace.record(phase, performance.now() - start, failed);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
export { PhoneExecutionTrace, currentPhoneTrace, measurePhonePhase };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type PhoneAppAccess } from './app-access.js';
|
|
2
2
|
import { type PhonePlan, type PhonePlanState } from './planning.js';
|
|
3
3
|
import type { Config } from '../config/schema.js';
|
|
4
|
-
import { type PhoneAction, type PhoneApplication, type PhoneDecision, type PhoneObservation, type PhoneCompletion, type PhoneTaskContract } from './contracts.js';
|
|
4
|
+
import { type PhoneAction, type PhoneApplication, type PhoneDecision, type PhoneObservation, type PhoneCompletion, type PhoneTaskContract, type PhoneRequestedOutput } from './contracts.js';
|
|
5
5
|
export declare function phoneModelProfile(model: unknown): "autoglm-phone-v1" | "structured-phone-v1";
|
|
6
6
|
export declare function validatePhoneModelChange(next: {
|
|
7
7
|
primary: string;
|
|
@@ -28,6 +28,7 @@ export interface PhoneTrajectoryEntry {
|
|
|
28
28
|
export interface PhonePrediction {
|
|
29
29
|
task?: PhoneTaskContract;
|
|
30
30
|
readOnly?: boolean;
|
|
31
|
+
readingFields?: PhoneRequestedOutput[];
|
|
31
32
|
goal: string;
|
|
32
33
|
observation: PhoneObservation;
|
|
33
34
|
completion?: PhoneCompletion;
|
|
@@ -51,6 +52,9 @@ export type PhoneModelDecision = PhoneDecision & {
|
|
|
51
52
|
};
|
|
52
53
|
export interface PhoneModelAdapter {
|
|
53
54
|
predict(input: PhonePrediction, signal: AbortSignal): Promise<PhoneModelDecision>;
|
|
55
|
+
recordAction?(action: PhoneAction, outcome: 'completed' | 'human'): void;
|
|
56
|
+
reset?(): void;
|
|
57
|
+
readFields?(input: PhonePrediction, fields: PhoneRequestedOutput[], signal: AbortSignal): Promise<Record<string, string | null>>;
|
|
54
58
|
readScreen?(input: PhonePrediction, signal: AbortSignal): Promise<string>;
|
|
55
59
|
}
|
|
56
60
|
export declare function parsePhonePlanningResponse(raw: string, input: PhonePrediction): {
|
|
@@ -166,6 +170,10 @@ export declare function buildPhoneModelContext(input: PhonePrediction): {
|
|
|
166
170
|
recoveryHint: string;
|
|
167
171
|
protocolFeedback: string;
|
|
168
172
|
task?: PhoneTaskContract;
|
|
173
|
+
readingFields?: {
|
|
174
|
+
key: string;
|
|
175
|
+
description: string;
|
|
176
|
+
}[];
|
|
169
177
|
};
|
|
170
178
|
export declare function isAboutScreen(observation: PhoneObservation): boolean;
|
|
171
179
|
export declare class MockPhoneModel implements PhoneModelAdapter {
|