agentroam-runtime-darwin-arm64 0.2.0-preview.73 → 0.2.0-preview.74
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/manifest.json +2 -3
- package/package.json +1 -1
- package/runtime/.next/BUILD_ID +1 -1
- package/runtime/.next/app-build-manifest.json +8 -8
- package/runtime/.next/app-path-routes-manifest.json +1 -1
- package/runtime/.next/build-manifest.json +3 -3
- package/runtime/.next/prerender-manifest.json +1 -1
- package/runtime/.next/required-server-files.json +1 -1
- package/runtime/.next/server/app/_not-found/page.js +1 -1
- package/runtime/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/runtime/.next/server/app/_not-found.html +1 -1
- package/runtime/.next/server/app/_not-found.rsc +1 -1
- package/runtime/.next/server/app/api/agent/abort/route.js +1 -1
- package/runtime/.next/server/app/api/agent/answer/route.js +1 -1
- package/runtime/.next/server/app/api/agent/codex-sharing/route.js +1 -1
- package/runtime/.next/server/app/api/agent/harness/status/route.js +1 -1
- package/runtime/.next/server/app/api/agent/model/route.js +1 -1
- package/runtime/.next/server/app/api/agent/models/route.js +1 -1
- package/runtime/.next/server/app/api/agent/run/route.js +1 -1
- package/runtime/.next/server/app/api/agent/runtime-health/route.js +1 -1
- package/runtime/.next/server/app/api/agent/steer/route.js +1 -1
- package/runtime/.next/server/app/api/agent/stream/route.js +2 -2
- package/runtime/.next/server/app/api/agent-workspaces/[workspaceId]/sessions/route.js +1 -1
- package/runtime/.next/server/app/api/agent-workspaces/route.js +1 -1
- package/runtime/.next/server/app/api/auth/verify/route.js +1 -1
- package/runtime/.next/server/app/api/business/route.js +1 -1
- package/runtime/.next/server/app/api/client-logs/route.js +1 -1
- package/runtime/.next/server/app/api/collaboration/route.js +2 -2
- package/runtime/.next/server/app/api/engine-threads/route.js +1 -1
- package/runtime/.next/server/app/api/flow/v1/catalog/route.js +1 -1
- package/runtime/.next/server/app/api/flow/v1/runs/[runId]/cancel/route.js +1 -1
- package/runtime/.next/server/app/api/flow/v1/runs/[runId]/events/route.js +2 -2
- package/runtime/.next/server/app/api/flow/v1/runs/route.js +1 -1
- package/runtime/.next/server/app/api/flow-studio/config/route.js +1 -1
- package/runtime/.next/server/app/api/mcp/connect/route.js +1 -1
- package/runtime/.next/server/app/api/mcp/disconnect/route.js +1 -1
- package/runtime/.next/server/app/api/mcp/servers/route.js +1 -1
- package/runtime/.next/server/app/api/memory/[key]/route.js +1 -1
- package/runtime/.next/server/app/api/memory/route.js +1 -1
- package/runtime/.next/server/app/api/messaging/route.js +1 -1
- package/runtime/.next/server/app/api/plugins/load/route.js +1 -1
- package/runtime/.next/server/app/api/projects/[id]/route.js +1 -1
- package/runtime/.next/server/app/api/projects/check/route.js +1 -1
- package/runtime/.next/server/app/api/projects/directories/route.js +1 -1
- package/runtime/.next/server/app/api/projects/roots/route.js +1 -1
- package/runtime/.next/server/app/api/projects/route.js +1 -1
- package/runtime/.next/server/app/api/push/subscribe/route.js +2 -2
- package/runtime/.next/server/app/api/push/unsubscribe/route.js +2 -2
- package/runtime/.next/server/app/api/push/vapid/route.js +2 -2
- package/runtime/.next/server/app/api/push/vapid.body +1 -1
- package/runtime/.next/server/app/api/remote-tools/register/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/background-jobs/[jobId]/stop/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/background-jobs/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/changes/route.js +2 -2
- package/runtime/.next/server/app/api/sessions/[id]/engine-switches/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/fork/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/fork-at/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/goals/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/handoff/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/native-goal/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/query-index/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/release/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/switch-engine/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/thread-goal/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/thread-history/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/[id]/tool-result/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/parallel/route.js +1 -1
- package/runtime/.next/server/app/api/sessions/route.js +1 -1
- package/runtime/.next/server/app/api/settings/route.js +1 -1
- package/runtime/.next/server/app/api/skills/route.js +1 -1
- package/runtime/.next/server/app/api/tool-policies/[policyId]/route.js +1 -1
- package/runtime/.next/server/app/api/tool-policies/route.js +1 -1
- package/runtime/.next/server/app/api/tools/route.js +1 -1
- package/runtime/.next/server/app/api/update/check/route.js +1 -1
- package/runtime/.next/server/app/api/update/install/route.js +1 -1
- package/runtime/.next/server/app/api/update/status/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/login/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/logout/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/revoke-all/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/setup/route.js +1 -1
- package/runtime/.next/server/app/api/web-auth/status/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/bootstrap/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/computer-settings/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/computers/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/device-state/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/history/route.js +1 -1
- package/runtime/.next/server/app/api/web-console/preferences/route.js +1 -1
- package/runtime/.next/server/app/web/page.js +2 -2
- package/runtime/.next/server/app/web/page_client-reference-manifest.js +1 -1
- package/runtime/.next/server/app-paths-manifest.json +36 -36
- package/runtime/.next/server/chunks/5303.js +1 -1
- package/runtime/.next/server/middleware-build-manifest.js +1 -1
- package/runtime/.next/server/pages/404.html +1 -1
- package/runtime/.next/server/pages/500.html +1 -1
- package/runtime/.next/server/server-reference-manifest.json +1 -1
- package/runtime/.next/static/chunks/app/web/{error-077f54cd48d5a6c2.js → error-53531bb27b3b87f8.js} +1 -1
- package/runtime/.next/static/chunks/app/web/layout-88328c61ec0589af.js +1 -0
- package/runtime/.next/static/chunks/app/web/page-84b5f00b4c9cd4ce.js +1 -0
- package/runtime/.next/static/chunks/{main-app-20135c1d85680f16.js → main-app-ba2527534563adfe.js} +1 -1
- package/runtime/lib/device-pairing-gateway.mjs +6 -1
- package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/MacOS/agentroam-remote-desktop +0 -0
- package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/Resources/agentroam-component.json +1 -1
- package/runtime/native/Support.noindex/AgentRoam Remote Desktop.app/Contents/_CodeSignature/CodeResources +2 -2
- package/runtime/node_modules/.package-lock.json +115 -115
- package/runtime/node_modules/@agent/native-runtime/dist/index.js +33 -5
- package/runtime/package-lock.json +156 -132
- package/runtime/server.js +1 -1
- package/runtime/webapp/dist/assets/{AIHubView-BQKD1oRa.js → AIHubView-DBOyOZzW.js} +1 -1
- package/runtime/webapp/dist/assets/{AgentManager-eTCpLsYc.js → AgentManager-BLHvEA2d.js} +1 -1
- package/runtime/webapp/dist/assets/{AiHubPane-LnfAKHOH.js → AiHubPane-CWvL3HSl.js} +1 -1
- package/runtime/webapp/dist/assets/App-DGtdMfGk.js +179 -0
- package/runtime/webapp/dist/assets/{BrowserLivePanel-BvXuMltx.js → BrowserLivePanel-Cl5kMDJF.js} +1 -1
- package/runtime/webapp/dist/assets/{CollaborationCreateDialog-0xwWJVAB.js → CollaborationCreateDialog-DPs4doOz.js} +1 -1
- package/runtime/webapp/dist/assets/{CollaborationDashboard-CDuqbRZZ.js → CollaborationDashboard-ChUaJ5xA.js} +1 -1
- package/runtime/webapp/dist/assets/{CollaborationPage-BLv1g5Ke.js → CollaborationPage-Cg22tJGB.js} +1 -1
- package/runtime/webapp/dist/assets/{FilePreview-DIsjFx4f.js → FilePreview-BItgMeyP.js} +3 -3
- package/runtime/webapp/dist/assets/{FileTree-BJe67ELr.js → FileTree-t-YjjCDU.js} +1 -1
- package/runtime/webapp/dist/assets/{FileWorkspaceDrawer-PtNe21oN.js → FileWorkspaceDrawer-BnOoPJA6.js} +1 -1
- package/runtime/webapp/dist/assets/{FlowStudioPane-DGv9czqf.js → FlowStudioPane-DHrpQpBA.js} +1 -1
- package/runtime/webapp/dist/assets/{LSPServerList-DZkbA5NX.js → LSPServerList-CB2Cwqw_.js} +1 -1
- package/runtime/webapp/dist/assets/{MCPServerList-DLJUT0j8.js → MCPServerList-DUpgIcHk.js} +1 -1
- package/runtime/webapp/dist/assets/{MemoryViewer-B4synV6O.js → MemoryViewer-DCFueBdK.js} +1 -1
- package/runtime/webapp/dist/assets/{RemoteDesktopPage-Db8WVCjo.js → RemoteDesktopPage-DD9aNe8m.js} +1 -1
- package/runtime/webapp/dist/assets/{RunningSessionsIcon-DRhO-CVq.js → RunningSessionsIcon-CKKjZfu_.js} +1 -1
- package/runtime/webapp/dist/assets/{SessionDashboard-C6En31sg.js → SessionDashboard-CCpxslxg.js} +1 -1
- package/runtime/webapp/dist/assets/{SessionDashboardBridge--lNIU1u6.js → SessionDashboardBridge-DG1fQUEQ.js} +1 -1
- package/runtime/webapp/dist/assets/{SettingsPanel-mJ5Ggwlp.js → SettingsPanel-CA0Pj7qk.js} +1 -1
- package/runtime/webapp/dist/assets/{SkillManager-C_mt62Rc.js → SkillManager-BzgAJlVW.js} +1 -1
- package/runtime/webapp/dist/assets/{TerminalPane-D121NsSc.js → TerminalPane-Bc4cGUmA.js} +1 -1
- package/runtime/webapp/dist/assets/{abnfDiagram-VCTEODGH-CSTtPfA-.js → abnfDiagram-VCTEODGH-Dsp6XgB7.js} +1 -1
- package/runtime/webapp/dist/assets/{arc-pE43fNGK.js → arc-DROGDR5M.js} +1 -1
- package/runtime/webapp/dist/assets/{architectureDiagram-5GKGNRK7-BlExjf1L.js → architectureDiagram-5GKGNRK7-S8c_fFRN.js} +1 -1
- package/runtime/webapp/dist/assets/{arrow-right-CED95s1t.js → arrow-right-CUDfCOna.js} +1 -1
- package/runtime/webapp/dist/assets/{artifact-links-BWD7xpfV.js → artifact-links-C7zYRJaC.js} +1 -1
- package/runtime/webapp/dist/assets/{blockDiagram-I7D4REHJ-4pzU0s_A.js → blockDiagram-I7D4REHJ-DrTz3v2B.js} +1 -1
- package/runtime/webapp/dist/assets/{c4Diagram-7LVT6UL2-DBoJHf0c.js → c4Diagram-7LVT6UL2-wuHRphdr.js} +1 -1
- package/runtime/webapp/dist/assets/channel-C_3UNQvo.js +1 -0
- package/runtime/webapp/dist/assets/{chevron-down-DuxUTH_N.js → chevron-down-fUU2ZKzR.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-2Q5K7J3B-Bu1Sc-w9.js → chunk-2Q5K7J3B-BpV5cOX0.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-5VM5RSS4-COwAF0w2.js → chunk-5VM5RSS4-1_IZosIm.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-F27PBJKO-FLl8DRP2.js → chunk-F27PBJKO-IZ7w-WCZ.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-IMKFNOWR-BL8M_b-w.js → chunk-IMKFNOWR-BuicwmZn.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-JWPE2WC7-Bm0OpXaO.js → chunk-JWPE2WC7-CfNSj3eC.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-POPQ4Y6H-Be_mjw7_.js → chunk-POPQ4Y6H-Bxryudz4.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-SVP7TREG-Dijp9l1U.js → chunk-SVP7TREG-DSZbEEd6.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-TICWLB2K-CJDtjon2.js → chunk-TICWLB2K-CHqUfDzl.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-XXDRQBXY-BLWOMtvS.js → chunk-XXDRQBXY-CPbMDiSF.js} +1 -1
- package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-j9nJ5DUm.js +1 -0
- package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-j9nJ5DUm.js +1 -0
- package/runtime/webapp/dist/assets/{codeSyntax-BnmCqa8x.js → codeSyntax-BENnBdX2.js} +1 -1
- package/runtime/webapp/dist/assets/{collaboration-B0sTZDns.js → collaboration-DwgXZbHy.js} +1 -1
- package/runtime/webapp/dist/assets/{composer-file-routing-BrWLenKF.js → composer-file-routing-CKLnrVkP.js} +1 -1
- package/runtime/webapp/dist/assets/{cose-bilkent-JH36ORCC-cA67vOKJ.js → cose-bilkent-JH36ORCC-BPzEzfJw.js} +1 -1
- package/runtime/webapp/dist/assets/{cynefin-OW5HDTMX-BPeSii-l.js → cynefin-OW5HDTMX-BZgzPIdr.js} +1 -1
- package/runtime/webapp/dist/assets/{cynefinDiagram-5FMLGOSQ-B9f094pg.js → cynefinDiagram-5FMLGOSQ-CyNjL-LN.js} +1 -1
- package/runtime/webapp/dist/assets/{dagre-GXQ25YYZ-C_xejuzH.js → dagre-GXQ25YYZ-QqLmAYnp.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-S7CK7UJ4-0f77MjI_.js → diagram-S7CK7UJ4-DrIIbhV6.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-UQ7AKVKN-B7qqB6UY.js → diagram-UQ7AKVKN-B7JON90e.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-VSXAHHWV-eS0I06tX.js → diagram-VSXAHHWV-C1Fzjcgp.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-VX7I27RA-BzaPvwZL.js → diagram-VX7I27RA-HmkXh54q.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-Z3DM3KII-C_EAUyuK.js → diagram-Z3DM3KII-Ca5jnESS.js} +1 -1
- package/runtime/webapp/dist/assets/{download-DNa5KRtu.js → download-CKrjXoG9.js} +1 -1
- package/runtime/webapp/dist/assets/{ebnfDiagram-PWID7BFC-CpSazgmq.js → ebnfDiagram-PWID7BFC-a3qnPIiF.js} +1 -1
- package/runtime/webapp/dist/assets/{erDiagram-RLTQ6QDP-BbAq4dnX.js → erDiagram-RLTQ6QDP-EZKQ4NYt.js} +1 -1
- package/runtime/webapp/dist/assets/{external-link-D0ZU8y72.js → external-link-C9AwR_tM.js} +1 -1
- package/runtime/webapp/dist/assets/{file-types-Bv8xIlsm.js → file-types-BlRT2KnS.js} +1 -1
- package/runtime/webapp/dist/assets/{flowDiagram-HODETNUW-FxtiM8S_.js → flowDiagram-HODETNUW-C4U9dCin.js} +1 -1
- package/runtime/webapp/dist/assets/{ganttDiagram-EL5Y4UJY-vbQAmYA_.js → ganttDiagram-EL5Y4UJY-B5iyiF0_.js} +1 -1
- package/runtime/webapp/dist/assets/{gitGraphDiagram-WWUBYQGX-CoH-vS6p.js → gitGraphDiagram-WWUBYQGX-D9CfK-tl.js} +1 -1
- package/runtime/webapp/dist/assets/{image-plus-CMQPwQ1a.js → image-plus-DsCC5WAa.js} +1 -1
- package/runtime/webapp/dist/assets/{index-B_qrzBSm.js → index-DBNVLOBM.js} +50 -50
- package/runtime/webapp/dist/assets/index-DrzCwyPu.css +1 -0
- package/runtime/webapp/dist/assets/{infoDiagram-27XIBGKW-BhQjKjwI.js → infoDiagram-27XIBGKW-DBcCijd6.js} +1 -1
- package/runtime/webapp/dist/assets/{ishikawaDiagram-5VMMS53U-Do6164Lq.js → ishikawaDiagram-5VMMS53U-D_m8F4n9.js} +1 -1
- package/runtime/webapp/dist/assets/{journeyDiagram-3NMN7TZE-DU9terNG.js → journeyDiagram-3NMN7TZE-4oy2R7XW.js} +1 -1
- package/runtime/webapp/dist/assets/{kanban-definition-UXKFOSKX-PIi78bMz.js → kanban-definition-UXKFOSKX-O6jHSf0E.js} +1 -1
- package/runtime/webapp/dist/assets/{layout-kIcBLq12.js → layout-P82L_S-q.js} +1 -1
- package/runtime/webapp/dist/assets/{linear-DuoGw6Ne.js → linear-B-Cl5K73.js} +1 -1
- package/runtime/webapp/dist/assets/{loader-circle-CkN6rr8Q.js → loader-circle--s-WzZxC.js} +1 -1
- package/runtime/webapp/dist/assets/{mermaid.core-CMSVAwDO.js → mermaid.core-BEmIap6p.js} +5 -5
- package/runtime/webapp/dist/assets/{mindmap-definition-YA3MSWOX-BqXezPt8.js → mindmap-definition-YA3MSWOX-Bnlqql-j.js} +1 -1
- package/runtime/webapp/dist/assets/{page-BJynASYd.js → page-BtLq1udo.js} +3 -3
- package/runtime/webapp/dist/assets/{pegDiagram-XKGWAZYB-CfhSiKuL.js → pegDiagram-XKGWAZYB-AbRjuoUM.js} +1 -1
- package/runtime/webapp/dist/assets/{pieDiagram-E7YTZNPT-D6dTu0HJ.js → pieDiagram-E7YTZNPT-5-ms1WT0.js} +1 -1
- package/runtime/webapp/dist/assets/{quadrantDiagram-AXDQQJYC-B6Nk3my2.js → quadrantDiagram-AXDQQJYC-BXr5BqtQ.js} +1 -1
- package/runtime/webapp/dist/assets/{railroadDiagram-O6MQD6OU-9HdWlkSi.js → railroadDiagram-O6MQD6OU-DqBC-aod.js} +1 -1
- package/runtime/webapp/dist/assets/{requirementDiagram-BXWQKSXE-CJ72A4ch.js → requirementDiagram-BXWQKSXE-VOUcatZG.js} +1 -1
- package/runtime/webapp/dist/assets/{rotate-ccw-CFOlggPt.js → rotate-ccw-CSiD4c4O.js} +1 -1
- package/runtime/webapp/dist/assets/{rotate-cw-CV6TU7ho.js → rotate-cw-CclBpLSU.js} +1 -1
- package/runtime/webapp/dist/assets/{sankeyDiagram-P5KCCOFB-B0k_-2GA.js → sankeyDiagram-P5KCCOFB-Bs23XmVr.js} +1 -1
- package/runtime/webapp/dist/assets/{send-Br8F4frT.js → send-CfzPXlfx.js} +1 -1
- package/runtime/webapp/dist/assets/{sequenceDiagram-WJ2MYXX4-D-Vubzl4.js → sequenceDiagram-WJ2MYXX4-DO-oDX3L.js} +1 -1
- package/runtime/webapp/dist/assets/{session-dashboard-B_G9IZRa.js → session-dashboard-D-0Cip5Y.js} +1 -1
- package/runtime/webapp/dist/assets/{shield-check-C_XCddHW.js → shield-check-Dsex8w1k.js} +1 -1
- package/runtime/webapp/dist/assets/{sizeCapture-INFHLROL-CDLZ64va.js → sizeCapture-INFHLROL-hCQ98eA9.js} +1 -1
- package/runtime/webapp/dist/assets/{stateDiagram-D77RDMKH-D55B47_M.js → stateDiagram-D77RDMKH-DLODIaTQ.js} +1 -1
- package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-CTpD-7Re.js +1 -0
- package/runtime/webapp/dist/assets/{swimlanes-42K2YHIH-FSX6VCzY.js → swimlanes-42K2YHIH-B3Qg_5tW.js} +1 -1
- package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-v5rUeqtL.js +8 -0
- package/runtime/webapp/dist/assets/{timeline-definition-24CTP7MA-DGmgxtYO.js → timeline-definition-24CTP7MA-BdFnRV4K.js} +1 -1
- package/runtime/webapp/dist/assets/{trash-2-Drt7yRIe.js → trash-2-CZp_yMDT.js} +1 -1
- package/runtime/webapp/dist/assets/{types-BOD4WqhS.js → types-BWTyn3Bs.js} +1 -1
- package/runtime/webapp/dist/assets/{vennDiagram-4TSXK5OY-XbldOddh.js → vennDiagram-4TSXK5OY-CRU6BY1c.js} +1 -1
- package/runtime/webapp/dist/assets/{wardleyDiagram-VM6X3IG4-DrGMS-oH.js → wardleyDiagram-VM6X3IG4-CXK3g3al.js} +1 -1
- package/runtime/webapp/dist/assets/{web-Crv8v2xB.js → web-Den_EYDz.js} +1 -1
- package/runtime/webapp/dist/assets/{web-DQg6oOed.js → web-JmfGsfI_.js} +1 -1
- package/runtime/webapp/dist/assets/{x-8eDWe1V2.js → x-CLvev0bC.js} +1 -1
- package/runtime/webapp/dist/assets/{xychartDiagram-S5SC5T6Z-BClf-jGf.js → xychartDiagram-S5SC5T6Z-CeISrKUm.js} +1 -1
- package/runtime/webapp/dist/assets/{zoom-out-CKWUyj9b.js → zoom-out-CSyjX26v.js} +1 -1
- package/runtime/webapp/dist/index.html +18 -3
- package/runtime/.next/static/chunks/app/web/layout-ebfc3a207c355453.js +0 -1
- package/runtime/.next/static/chunks/app/web/page-b456468be8e8e8fa.js +0 -1
- package/runtime/native/Support.noindex/WeComSendBridge.app/Contents/Info.plist +0 -13
- package/runtime/native/Support.noindex/WeComSendBridge.app/Contents/MacOS/NativeAXBridge +0 -0
- package/runtime/native/Support.noindex/WeComSendBridge.app/Contents/Resources/agentroam-component.json +0 -4
- package/runtime/native/Support.noindex/WeComSendBridge.app/Contents/_CodeSignature/CodeResources +0 -128
- package/runtime/node_modules/@agent/messaging/dist/assets/wecom/NativeAXBridge.swift +0 -240
- package/runtime/node_modules/@agent/messaging/dist/assets/wecom/codec.py +0 -133
- package/runtime/node_modules/@agent/messaging/dist/assets/wecom/native_sender.py +0 -445
- package/runtime/node_modules/@agent/messaging/dist/assets/wecom/reader.py +0 -479
- package/runtime/node_modules/@agent/messaging/dist/assets/wecom//351/235/231/346/200/201/350/265/204/346/226/231/350/257/273/345/217/226/350/257/264/346/230/216.md +0 -34
- package/runtime/node_modules/@agent/messaging/dist/index.js +0 -1219
- package/runtime/node_modules/@agent/messaging/package.json +0 -7
- package/runtime/webapp/dist/assets/App-Cm4c_ukZ.js +0 -177
- package/runtime/webapp/dist/assets/channel-C029kbz3.js +0 -1
- package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-DjlcT9EO.js +0 -1
- package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-DjlcT9EO.js +0 -1
- package/runtime/webapp/dist/assets/index-DFMBt4EW.css +0 -1
- package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-DhVWnu4U.js +0 -1
- package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-B677Rs5I.js +0 -8
- /package/runtime/.next/static/{fg72y0mrQ518VXPNOLU1t → 5l3_g1bKM6rXvoGoMh_OC}/_buildManifest.js +0 -0
- /package/runtime/.next/static/{fg72y0mrQ518VXPNOLU1t → 5l3_g1bKM6rXvoGoMh_OC}/_ssgManifest.js +0 -0
|
@@ -1,479 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Own-account WeCom reader. No injection; never writes database/WAL/SHM bytes."""
|
|
3
|
-
import base64
|
|
4
|
-
import contextlib
|
|
5
|
-
import datetime
|
|
6
|
-
import fcntl
|
|
7
|
-
import hashlib
|
|
8
|
-
import json
|
|
9
|
-
import os
|
|
10
|
-
import re
|
|
11
|
-
from pathlib import Path
|
|
12
|
-
import shutil
|
|
13
|
-
import sqlite3
|
|
14
|
-
import struct
|
|
15
|
-
import subprocess
|
|
16
|
-
import sys
|
|
17
|
-
import tempfile
|
|
18
|
-
from codec import AES, SQLITE_HEADER, decrypt_page, derive_base_key, wal_checksum
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
def fields(data, allow_zero=False):
|
|
22
|
-
def varint(offset):
|
|
23
|
-
value = 0
|
|
24
|
-
for shift in range(0, 70, 7):
|
|
25
|
-
if offset >= len(data):
|
|
26
|
-
raise ValueError("truncated protobuf")
|
|
27
|
-
byte = data[offset]
|
|
28
|
-
offset += 1
|
|
29
|
-
value |= (byte & 127) << shift
|
|
30
|
-
if byte < 128:
|
|
31
|
-
return value, offset
|
|
32
|
-
raise ValueError("invalid protobuf varint")
|
|
33
|
-
offset = 0
|
|
34
|
-
while offset < len(data):
|
|
35
|
-
key, offset = varint(offset)
|
|
36
|
-
number, wire = key >> 3, key & 7
|
|
37
|
-
if not number and not allow_zero:
|
|
38
|
-
raise ValueError("invalid protobuf field")
|
|
39
|
-
if wire == 0:
|
|
40
|
-
value, offset = varint(offset)
|
|
41
|
-
elif wire in (1, 5):
|
|
42
|
-
length = 8 if wire == 1 else 4
|
|
43
|
-
value = data[offset:offset + length]
|
|
44
|
-
offset += length
|
|
45
|
-
if len(value) != length:
|
|
46
|
-
raise ValueError("truncated protobuf fixed field")
|
|
47
|
-
elif wire == 2:
|
|
48
|
-
length, offset = varint(offset)
|
|
49
|
-
if offset + length > len(data):
|
|
50
|
-
raise ValueError("truncated protobuf bytes")
|
|
51
|
-
value, offset = data[offset:offset + length], offset + length
|
|
52
|
-
else:
|
|
53
|
-
raise ValueError("unsupported protobuf wire")
|
|
54
|
-
yield number, wire, value
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
def decode_body(data, content_type=0):
|
|
58
|
-
text, display, mentions, segments = [], [], [], []
|
|
59
|
-
if content_type not in (0, 2):
|
|
60
|
-
# Markdown/attachments do not acquire direct-mention semantics by text matching.
|
|
61
|
-
return {"text": "", "displayText": "", "mentionTargets": [], "segments": []}
|
|
62
|
-
for number, wire, segment in fields(data):
|
|
63
|
-
if number != 1 or wire != 2:
|
|
64
|
-
continue
|
|
65
|
-
values = list(fields(segment))
|
|
66
|
-
kind = next((value for n, w, value in values if n == 1 and w == 0), None)
|
|
67
|
-
payloads = [value for n, w, value in values if n == 2 and w == 2]
|
|
68
|
-
segments.append({"kind": kind})
|
|
69
|
-
for payload in payloads:
|
|
70
|
-
inner = list(fields(payload))
|
|
71
|
-
if kind == 0:
|
|
72
|
-
part = next((value.decode("utf-8", "strict") for n, w, value in inner if n == 1 and w == 2), "")
|
|
73
|
-
text.append(part)
|
|
74
|
-
display.append(part)
|
|
75
|
-
elif kind == 5:
|
|
76
|
-
vid = next((str(value) for n, w, value in inner if n == 1 and w == 0), None)
|
|
77
|
-
if vid:
|
|
78
|
-
mentions.append(vid)
|
|
79
|
-
label = next((value.decode("utf-8", "replace") for n, w, value in inner if n == 2 and w == 2), vid or "")
|
|
80
|
-
display.append("@" + label)
|
|
81
|
-
# Quote/forward/attachment payloads are kept raw, never recursively treated as mentions.
|
|
82
|
-
return {"text": "".join(text), "displayText": "".join(display), "mentionTargets": mentions, "segments": segments}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
def conversation_names(connection):
|
|
86
|
-
"""RID -> display name. 直聊会话的 name 即 '中文名(账号)',RID 等于对方 VID。"""
|
|
87
|
-
names = {}
|
|
88
|
-
for row in connection.execute("SELECT RID, name, conversationtype FROM CONVERSATION"):
|
|
89
|
-
if row["RID"] is None or not row["name"]:
|
|
90
|
-
continue
|
|
91
|
-
names[str(row["RID"])] = {"name": row["name"], "conversationType": row["conversationtype"]}
|
|
92
|
-
return names
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
def group_list(connection):
|
|
96
|
-
"""全量群列表:conversationtype=1 视为群,exited=0 为仍在群。"""
|
|
97
|
-
groups = []
|
|
98
|
-
for row in connection.execute(
|
|
99
|
-
"SELECT RID, name, creater_id, conversationtype, exited, hidden "
|
|
100
|
-
"FROM CONVERSATION WHERE conversationtype=1 ORDER BY RID"
|
|
101
|
-
):
|
|
102
|
-
groups.append({
|
|
103
|
-
"conversationId": str(row["RID"]),
|
|
104
|
-
"name": row["name"] or "",
|
|
105
|
-
"createrId": str(row["creater_id"]) if row["creater_id"] is not None else "",
|
|
106
|
-
"conversationType": row["conversationtype"],
|
|
107
|
-
"exited": row["exited"],
|
|
108
|
-
"hidden": row["hidden"],
|
|
109
|
-
})
|
|
110
|
-
return groups
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
def session_plain(config):
|
|
114
|
-
"""解密 Messages1/Session.db(与 Info.db 同 VID key)为明文镜像;带 mtime 缓存。"""
|
|
115
|
-
source = Path(config["database"]).parent / "Session.db"
|
|
116
|
-
cache = Path(config["cacheDir"])
|
|
117
|
-
out = cache / "Session.db.plain"
|
|
118
|
-
if not source.exists():
|
|
119
|
-
return None
|
|
120
|
-
if out.exists() and out.stat().st_mtime >= source.stat().st_mtime:
|
|
121
|
-
return out
|
|
122
|
-
account = int(config["accountId"])
|
|
123
|
-
aes = AES()
|
|
124
|
-
base = derive_base_key(struct.pack("<Q", account))
|
|
125
|
-
frozen_dir = cache / "frozen"
|
|
126
|
-
frozen_dir.mkdir(parents=True, exist_ok=True)
|
|
127
|
-
with frozen_source(source, str(frozen_dir)) as (snap, generation, _):
|
|
128
|
-
data = snap.read_bytes()
|
|
129
|
-
size = int.from_bytes(data[16:18], "big")
|
|
130
|
-
size = 65536 if size == 1 else size
|
|
131
|
-
temporary = out.with_suffix(".tmp")
|
|
132
|
-
temporary.write_bytes(b"".join(
|
|
133
|
-
decrypt_page(aes, data[n:n + size], base, n // size + 1) for n in range(0, len(data), size)))
|
|
134
|
-
os.replace(temporary, out)
|
|
135
|
-
return out
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
def contact_directory(config):
|
|
139
|
-
"""全量通讯录(Session.db USER/DEPARTMENT 表):VID -> {name, job, departmentId, department, corpid}。"""
|
|
140
|
-
plain = session_plain(config)
|
|
141
|
-
users = {}
|
|
142
|
-
if not plain:
|
|
143
|
-
return users
|
|
144
|
-
connection = sqlite3.connect(str(plain))
|
|
145
|
-
connection.row_factory = sqlite3.Row
|
|
146
|
-
try:
|
|
147
|
-
departments = {}
|
|
148
|
-
for row in connection.execute("SELECT RID, name FROM DEPARTMENT"):
|
|
149
|
-
if row["RID"] is not None:
|
|
150
|
-
departments[str(row["RID"])] = row["name"] or ""
|
|
151
|
-
heads = {}
|
|
152
|
-
try:
|
|
153
|
-
for row in connection.execute("SELECT UID, departmentid FROM MYHEAD ORDER BY id"):
|
|
154
|
-
uid = str(row["UID"]) if row["UID"] is not None else ""
|
|
155
|
-
if uid and uid not in heads and row["departmentid"] is not None:
|
|
156
|
-
heads[uid] = str(row["departmentid"])
|
|
157
|
-
except sqlite3.OperationalError:
|
|
158
|
-
pass
|
|
159
|
-
for row in connection.execute("SELECT RID, name, job, corpid FROM USER"):
|
|
160
|
-
if row["RID"] is None:
|
|
161
|
-
continue
|
|
162
|
-
dept_id = heads.get(str(row["RID"]), "")
|
|
163
|
-
users[str(row["RID"])] = {
|
|
164
|
-
"name": row["name"] or "", "job": row["job"] or "",
|
|
165
|
-
"departmentId": dept_id, "department": departments.get(dept_id, ""),
|
|
166
|
-
"corpid": str(row["corpid"]) if row["corpid"] is not None else "",
|
|
167
|
-
}
|
|
168
|
-
finally:
|
|
169
|
-
connection.close()
|
|
170
|
-
return users
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
def group_members(connection, conv_key_prefix, users=None):
|
|
174
|
-
"""解 CONV_MEMBER_DATA.member_bin:字段 1=成员 VID、2=加入时间、3=邀请人 VID。
|
|
175
|
-
conv_key 形如 '1_<RID>_0',按开头 '1_<RID>_' 匹配。users 提供则附姓名。"""
|
|
176
|
-
prefix = "1_" + str(conv_key_prefix) + "_"
|
|
177
|
-
out = []
|
|
178
|
-
for row in connection.execute(
|
|
179
|
-
"SELECT conv_key, member_bin FROM CONV_MEMBER_DATA WHERE conv_key LIKE ?", (prefix + "%",)
|
|
180
|
-
):
|
|
181
|
-
blob = row["member_bin"] or b""
|
|
182
|
-
members = []
|
|
183
|
-
for number, wire, segment in fields(blob, allow_zero=True):
|
|
184
|
-
# 顶层是重复的 field 0 长度块,每块一个成员
|
|
185
|
-
if wire != 2 or not segment:
|
|
186
|
-
continue
|
|
187
|
-
try:
|
|
188
|
-
inner = list(fields(segment))
|
|
189
|
-
except ValueError:
|
|
190
|
-
continue
|
|
191
|
-
vid = next((value for n, w, value in inner if n == 1 and w == 0), None)
|
|
192
|
-
if vid is None:
|
|
193
|
-
continue
|
|
194
|
-
joined = next((value for n, w, value in inner if n == 2 and w == 0), None)
|
|
195
|
-
inviter = next((value for n, w, value in inner if n == 3 and w == 0), None)
|
|
196
|
-
members.append({
|
|
197
|
-
"vid": str(vid),
|
|
198
|
-
"name": (users or {}).get(str(vid), {}).get("name") or None,
|
|
199
|
-
"joinedAt": joined,
|
|
200
|
-
"inviterVid": str(inviter) if inviter is not None else None,
|
|
201
|
-
"inviterName": (users or {}).get(str(inviter), {}).get("name") if inviter is not None else None,
|
|
202
|
-
})
|
|
203
|
-
out.append({"convKey": row["conv_key"], "members": members})
|
|
204
|
-
return out
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
def committed_frames(data, page_size):
|
|
208
|
-
if not data:
|
|
209
|
-
return [], 0, ""
|
|
210
|
-
if len(data) < 32:
|
|
211
|
-
raise ValueError("WAL header is incomplete")
|
|
212
|
-
magic = int.from_bytes(data[:4], "big")
|
|
213
|
-
size = int.from_bytes(data[8:12], "big") or page_size
|
|
214
|
-
if magic not in (0x377F0682, 0x377F0683) or size != page_size:
|
|
215
|
-
raise ValueError("WAL header does not match database")
|
|
216
|
-
stored = tuple(int.from_bytes(data[n:n + 4], "big") for n in (24, 28))
|
|
217
|
-
order = next((o for o in ("little", "big") if wal_checksum(data[:24], 0, 0, o) == stored), None)
|
|
218
|
-
if order is None:
|
|
219
|
-
raise ValueError("WAL header checksum failed")
|
|
220
|
-
checksum = stored
|
|
221
|
-
frames, committed = [], 0
|
|
222
|
-
for offset in range(32, len(data) - (24 + size) + 1, 24 + size):
|
|
223
|
-
frame = data[offset:offset + 24 + size]
|
|
224
|
-
if frame[8:16] != data[16:24]:
|
|
225
|
-
break
|
|
226
|
-
checksum = wal_checksum(frame[:8], *checksum, order)
|
|
227
|
-
checksum = wal_checksum(frame[24:], *checksum, order)
|
|
228
|
-
if checksum != tuple(int.from_bytes(frame[n:n + 4], "big") for n in (16, 20)):
|
|
229
|
-
break
|
|
230
|
-
page, db_size = struct.unpack(">II", frame[:8])
|
|
231
|
-
if page < 1:
|
|
232
|
-
raise ValueError("invalid WAL page")
|
|
233
|
-
frames.append((page, db_size, frame[24:]))
|
|
234
|
-
if db_size:
|
|
235
|
-
committed = len(frames)
|
|
236
|
-
return frames[:committed], committed, data[:24].hex()
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
@contextlib.contextmanager
|
|
240
|
-
def frozen_source(source, directory):
|
|
241
|
-
"""SQLite unix VFS locks start at 120: CKPT=121, READ0=123, READ1=124.
|
|
242
|
-
|
|
243
|
-
Shared locks prevent checkpoint writes and WAL reset while the APFS clone
|
|
244
|
-
and committed WAL prefix are captured. They never alter source bytes.
|
|
245
|
-
"""
|
|
246
|
-
shm = Path(str(source) + "-shm")
|
|
247
|
-
if not shm.is_file():
|
|
248
|
-
raise RuntimeError("企微 WAL 尚未就绪,请保持企微登录后重试")
|
|
249
|
-
with tempfile.TemporaryDirectory(dir=directory) as temp:
|
|
250
|
-
with shm.open("rb") as lock:
|
|
251
|
-
for offset in (121, 123, 124):
|
|
252
|
-
fcntl.lockf(lock, fcntl.LOCK_SH | fcntl.LOCK_NB, 1, offset, os.SEEK_SET)
|
|
253
|
-
before = source.stat()
|
|
254
|
-
wal = Path(str(source) + "-wal")
|
|
255
|
-
data = wal.read_bytes() if wal.exists() else b""
|
|
256
|
-
frozen = Path(temp) / "source.db"
|
|
257
|
-
# cp -c clones on APFS. The fallback remains under both SQLite locks.
|
|
258
|
-
cloned = False
|
|
259
|
-
if sys.platform == "darwin":
|
|
260
|
-
cloned = subprocess.run(["/bin/cp", "-c", str(source), str(frozen)], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode == 0
|
|
261
|
-
if not cloned:
|
|
262
|
-
shutil.copyfile(source, frozen)
|
|
263
|
-
after = source.stat()
|
|
264
|
-
if (before.st_dev, before.st_ino, before.st_size, before.st_mtime_ns) != (after.st_dev, after.st_ino, after.st_size, after.st_mtime_ns):
|
|
265
|
-
raise RuntimeError("企微数据库在快照期间发生变化,暂缓采集")
|
|
266
|
-
# Release source locks before decryption and integrity checks.
|
|
267
|
-
yield frozen, data, str(before.st_dev) + ":" + str(before.st_ino)
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
def prepare_mirror(source, account, cache):
|
|
271
|
-
cache.mkdir(parents=True, exist_ok=True, mode=0o700)
|
|
272
|
-
os.chmod(cache, 0o700)
|
|
273
|
-
mirror, state_file = cache / "mirror.db", cache / "mirror.json"
|
|
274
|
-
try:
|
|
275
|
-
state = json.loads(state_file.read_text()) if state_file.exists() else {}
|
|
276
|
-
except (ValueError, OSError):
|
|
277
|
-
state = {}
|
|
278
|
-
# A plaintext source is an explicit reader/fixture bridge; SQLite owns its snapshot.
|
|
279
|
-
with source.open("rb") as file:
|
|
280
|
-
clear = file.read(16) == SQLITE_HEADER
|
|
281
|
-
if clear:
|
|
282
|
-
connection = sqlite3.connect("file:" + str(source) + "?mode=ro", uri=True)
|
|
283
|
-
try:
|
|
284
|
-
connection.execute("PRAGMA query_only=ON")
|
|
285
|
-
connection.execute("BEGIN")
|
|
286
|
-
generation = "plain:" + str(source.stat().st_ino)
|
|
287
|
-
return source, generation, False
|
|
288
|
-
finally:
|
|
289
|
-
connection.close()
|
|
290
|
-
account_number = int(account)
|
|
291
|
-
base_key, aes = derive_base_key(struct.pack("<Q", account_number)), AES()
|
|
292
|
-
with frozen_source(source, cache) as (frozen, data, identity):
|
|
293
|
-
with frozen.open("rb") as file:
|
|
294
|
-
header = file.read(24)
|
|
295
|
-
size = int.from_bytes(header[16:18], "big")
|
|
296
|
-
size = 65536 if size == 1 else size
|
|
297
|
-
if size < 512 or size > 65536 or size & (size - 1):
|
|
298
|
-
raise ValueError("不支持的企微数据库页大小")
|
|
299
|
-
frames, count, salt = committed_frames(data, size)
|
|
300
|
-
generation = identity + ":" + salt
|
|
301
|
-
rebase = not mirror.exists() or state.get("generation") != generation or state.get("frames", 0) > count
|
|
302
|
-
destination = cache / "mirror.next" if rebase else mirror
|
|
303
|
-
if rebase:
|
|
304
|
-
with frozen.open("rb") as file, destination.open("wb") as output:
|
|
305
|
-
number = 1
|
|
306
|
-
while True:
|
|
307
|
-
page = file.read(size)
|
|
308
|
-
if not page:
|
|
309
|
-
break
|
|
310
|
-
if len(page) != size:
|
|
311
|
-
raise ValueError("企微主库页不完整")
|
|
312
|
-
output.write(decrypt_page(aes, page, base_key, number))
|
|
313
|
-
number += 1
|
|
314
|
-
start = 0
|
|
315
|
-
else:
|
|
316
|
-
start = int(state.get("frames", 0))
|
|
317
|
-
with destination.open("r+b") as output:
|
|
318
|
-
for number, db_size, payload in frames[start:]:
|
|
319
|
-
output.seek((number - 1) * size)
|
|
320
|
-
output.write(decrypt_page(aes, payload, base_key, number))
|
|
321
|
-
if frames:
|
|
322
|
-
output.truncate(frames[-1][1] * size)
|
|
323
|
-
output.flush()
|
|
324
|
-
os.fsync(output.fileno())
|
|
325
|
-
os.chmod(destination, 0o600)
|
|
326
|
-
if rebase:
|
|
327
|
-
destination.replace(mirror)
|
|
328
|
-
with sqlite3.connect("file:" + str(mirror) + "?mode=ro&immutable=1", uri=True) as connection:
|
|
329
|
-
connection.execute("PRAGMA writable_schema=ON")
|
|
330
|
-
result = connection.execute("PRAGMA quick_check('MESSAGE')").fetchall()
|
|
331
|
-
if result != [("ok",)]:
|
|
332
|
-
mirror.unlink(missing_ok=True)
|
|
333
|
-
raise ValueError("企微消息快照一致性检查未通过")
|
|
334
|
-
temporary = cache / "mirror-state.next"
|
|
335
|
-
temporary.write_text(json.dumps({"generation": generation, "frames": count}))
|
|
336
|
-
os.chmod(temporary, 0o600)
|
|
337
|
-
temporary.replace(state_file)
|
|
338
|
-
return mirror, generation, True
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
def discover():
|
|
342
|
-
if sys.platform != "darwin":
|
|
343
|
-
return {"sources": [], "error": "本地企微监听目前支持 macOS;其他渠道可通过接入适配器扩展"}
|
|
344
|
-
documents = Path(os.environ.get("AGENT_WECOM_DATA_DIR", str(Path.home() / "Library/Containers/com.tencent.WeWorkMac/Data/Documents")))
|
|
345
|
-
if not documents.exists():
|
|
346
|
-
return {"sources": [], "error": "未找到本机企业微信,请先安装并登录"}
|
|
347
|
-
try:
|
|
348
|
-
list(documents.iterdir()) # glob suppresses permission errors; surface them instead.
|
|
349
|
-
accounts = [p.name[4:] for p in (documents / "cefcache").iterdir() if p.name.startswith("wew_") and p.name[4:].isdigit()]
|
|
350
|
-
databases = list((documents / "Profiles").glob("*/Messages1/Info.db"))
|
|
351
|
-
except PermissionError:
|
|
352
|
-
return {"sources": [], "error": "macOS 拒绝读取企微数据目录,请为运行 AgentRoam 的应用或终端授予完全磁盘访问权限"}
|
|
353
|
-
sources = []
|
|
354
|
-
for database in databases:
|
|
355
|
-
with database.open("rb") as file:
|
|
356
|
-
header = file.read(4096)
|
|
357
|
-
for account in accounts:
|
|
358
|
-
try:
|
|
359
|
-
if decrypt_page(AES(), header, derive_base_key(struct.pack("<Q", int(account))), 1).startswith(SQLITE_HEADER):
|
|
360
|
-
sources.append({"database": str(database), "accountId": account})
|
|
361
|
-
except (ValueError, RuntimeError):
|
|
362
|
-
pass
|
|
363
|
-
return {"sources": sources, "error": None if sources else "未发现支持的企微账号数据库,请确认本机版本与登录状态"}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
def open_mirror(config):
|
|
367
|
-
"""按 config 准备明文镜像并返回只读连接;调用方负责 close()。"""
|
|
368
|
-
source = Path(config["database"])
|
|
369
|
-
cache = Path(config["cacheDir"])
|
|
370
|
-
mirror, generation, immutable = prepare_mirror(source, config["accountId"], cache)
|
|
371
|
-
uri = "file:" + str(mirror) + "?mode=ro" + ("&immutable=1" if immutable else "")
|
|
372
|
-
connection = sqlite3.connect(uri, uri=True)
|
|
373
|
-
connection.row_factory = sqlite3.Row
|
|
374
|
-
return connection, generation
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
def static_queries(config, groups=False, members_for=None, contacts=False):
|
|
378
|
-
"""只读静态资料查询:群列表 / 群成员 / 全量通讯录;不触碰消息表与 cursor。"""
|
|
379
|
-
connection, _ = open_mirror(config)
|
|
380
|
-
try:
|
|
381
|
-
users = contact_directory(config) if (members_for is not None or contacts) else None
|
|
382
|
-
result = {}
|
|
383
|
-
if contacts:
|
|
384
|
-
result["contacts"] = users
|
|
385
|
-
if groups:
|
|
386
|
-
result["groups"] = group_list(connection)
|
|
387
|
-
if members_for is not None:
|
|
388
|
-
result["members"] = group_members(connection, members_for, users)
|
|
389
|
-
result["conversationId"] = str(members_for)
|
|
390
|
-
return result
|
|
391
|
-
finally:
|
|
392
|
-
connection.close()
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
def read_batch(config):
|
|
396
|
-
cursor = config.get("cursor") or {}
|
|
397
|
-
connection, generation = open_mirror(config)
|
|
398
|
-
previous = cursor.get("generation")
|
|
399
|
-
lid = int(cursor.get("lid", 0)) if previous in (None, generation) else 0
|
|
400
|
-
since = int(cursor.get("since", datetime.datetime.now().timestamp()))
|
|
401
|
-
try:
|
|
402
|
-
connection.execute("PRAGMA writable_schema=ON")
|
|
403
|
-
connection.execute("BEGIN")
|
|
404
|
-
rows = connection.execute(
|
|
405
|
-
"SELECT * "
|
|
406
|
-
"FROM MESSAGE WHERE LID>? AND send_time>=? ORDER BY LID LIMIT 200", (lid, since)
|
|
407
|
-
).fetchall()
|
|
408
|
-
names = conversation_names(connection) # 一次预载,避免逐条查 CONVERSATION
|
|
409
|
-
try:
|
|
410
|
-
users = contact_directory(config) # Session.db USER 表:全量 VID→姓名
|
|
411
|
-
except Exception:
|
|
412
|
-
users = {}
|
|
413
|
-
messages = []
|
|
414
|
-
for row in rows:
|
|
415
|
-
local_id, rid, conversation, seq, sender, kind, sent, content, extras, refer, flag, msg_type = (
|
|
416
|
-
row[key] for key in ("LID", "RID", "conv_id", "seq", "sender_id", "content_type", "send_time", "content", "extras", "refer", "flag", "message_type"))
|
|
417
|
-
content = content or b""
|
|
418
|
-
try:
|
|
419
|
-
decoded = decode_body(content, kind)
|
|
420
|
-
except (ValueError, UnicodeDecodeError):
|
|
421
|
-
decoded = {"text": "", "displayText": "", "mentionTargets": [], "segments": [], "decodeError": "正文结构尚未识别"}
|
|
422
|
-
named = names.get(str(conversation))
|
|
423
|
-
name = named["name"] if named else ""
|
|
424
|
-
conversation_type = named["conversationType"] if named else None
|
|
425
|
-
sender_named = names.get(str(sender))
|
|
426
|
-
# 直聊会话名即 '中文名(账号)';USER 表(Session.db)优先——覆盖无直聊会话的群成员/机器人。
|
|
427
|
-
sender_name = sender_named["name"] if sender_named else ""
|
|
428
|
-
user_entry = users.get(str(sender))
|
|
429
|
-
if user_entry and user_entry["name"]:
|
|
430
|
-
sender_name = user_entry["name"]
|
|
431
|
-
kind_name = "direct" if conversation_type == 0 else "group" if conversation_type == 1 else "unknown"
|
|
432
|
-
alias = re.search(r"\(([a-zA-Z0-9_.@-]+)\)$", name or "") if kind_name == "direct" else None
|
|
433
|
-
stable = "rid:" + str(rid) if rid else "seq:" + str(seq) + ":" + str(sender) + ":" + str(sent) + ":" + hashlib.sha256(content).hexdigest()
|
|
434
|
-
messages.append({
|
|
435
|
-
"sourceId": stable, "connectionId": "wecom:" + str(config["accountId"]), "channel": "wecom",
|
|
436
|
-
"conversationId": str(conversation), "conversationName": name, "senderId": str(sender),
|
|
437
|
-
"senderName": sender_name or None,
|
|
438
|
-
"conversationType": kind_name, **({"peerUserId": alias.group(1)} if alias else {}),
|
|
439
|
-
"text": decoded["text"], "occurredAt": datetime.datetime.fromtimestamp(sent, datetime.timezone.utc).isoformat(),
|
|
440
|
-
"directMention": str(config["accountId"]) in decoded["mentionTargets"], "ownMessage": str(sender) == str(config["accountId"]),
|
|
441
|
-
"raw": {"LID": str(local_id), "RID": str(rid), "conv_id": str(conversation), "seq": str(seq),
|
|
442
|
-
"sender_id": str(sender), "content_type": kind, "send_time": str(sent), "flag": flag,
|
|
443
|
-
"message_type": msg_type, "refer": str(refer), "conversationType": conversation_type, "contentBase64": base64.b64encode(content).decode(),
|
|
444
|
-
"extrasBase64": base64.b64encode(extras or b"").decode(),
|
|
445
|
-
"columns": {key: {"base64": base64.b64encode(value).decode()} if isinstance(value, bytes)
|
|
446
|
-
else str(value) if isinstance(value, int) else value for key, value in dict(row).items()}, **decoded},
|
|
447
|
-
})
|
|
448
|
-
next_lid = rows[-1]["LID"] if rows else max(lid, connection.execute("SELECT COALESCE(MAX(LID),0) FROM MESSAGE").fetchone()[0])
|
|
449
|
-
return {"messages": messages, "cursor": {"generation": generation, "lid": str(next_lid), "since": since}}
|
|
450
|
-
finally:
|
|
451
|
-
connection.close()
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
if __name__ == "__main__":
|
|
455
|
-
try:
|
|
456
|
-
if "--discover" in sys.argv:
|
|
457
|
-
result = discover()
|
|
458
|
-
elif "--contacts" in sys.argv:
|
|
459
|
-
result = contact_directory(json.load(sys.stdin))
|
|
460
|
-
print(json.dumps(result, ensure_ascii=False))
|
|
461
|
-
sys.exit(0)
|
|
462
|
-
elif "--groups" in sys.argv or "--members" in sys.argv:
|
|
463
|
-
config = json.load(sys.stdin)
|
|
464
|
-
members_for = None
|
|
465
|
-
if "--members" in sys.argv:
|
|
466
|
-
index = sys.argv.index("--members")
|
|
467
|
-
if index + 1 >= len(sys.argv):
|
|
468
|
-
raise ValueError("--members 需要群 conversationId(CONVERSATION.RID)")
|
|
469
|
-
members_for = sys.argv[index + 1]
|
|
470
|
-
result = static_queries(config, groups="--groups" in sys.argv, members_for=members_for, contacts="--contacts" in sys.argv)
|
|
471
|
-
else:
|
|
472
|
-
result = read_batch(json.load(sys.stdin))
|
|
473
|
-
print(json.dumps(result, ensure_ascii=False))
|
|
474
|
-
except PermissionError:
|
|
475
|
-
print(json.dumps({"error": "macOS 拒绝读取企微数据目录,请为运行 AgentRoam 的应用或终端授予完全磁盘访问权限"}))
|
|
476
|
-
sys.exit(2)
|
|
477
|
-
except Exception as error:
|
|
478
|
-
print(json.dumps({"error": str(error)}, ensure_ascii=False))
|
|
479
|
-
sys.exit(2)
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# 企微本地库静态资料读取(群列表 / 群成员 / 全量通讯录)
|
|
2
|
-
|
|
3
|
-
> 基于 `reader.py` 的离线读库能力(2026-11-11 完成全量姓名)。不碰企微进程、不改原库/WAL、不需要 root。
|
|
4
|
-
|
|
5
|
-
## 结论
|
|
6
|
-
|
|
7
|
-
- **全量通讯录在 `Messages1/Session.db`**(与 Info.db 同目录、同 VID key),`USER` 表 7 万+ 行(RID=VID、name、job、corpid、alias…)+ `DEPARTMENT`(部门树)+ `MYHEAD`(UID→部门)。**不需要 `Contact/Contact.db`**(该库 key 走服务端授权,本地解不开,也没必要)。
|
|
8
|
-
- 消息 senderName 覆盖率 **99~100%**(原 CONVERSATION join 只有 42%)。
|
|
9
|
-
- 群成员(`CONV_MEMBER_DATA.member_bin` protobuf:f1=VID/f2=加入时间/f3=邀请人VID)姓名覆盖 **100%**(5096/5098)。
|
|
10
|
-
|
|
11
|
-
## 用法
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
cd packages/messaging/assets/wecom
|
|
15
|
-
CFG='{"database":"<Profile>/Messages1/Info.db","accountId":"<VID>","cacheDir":"/tmp/wecom-static"}'
|
|
16
|
-
printf '%s' "$CFG" | /usr/bin/python3 reader.py --contacts # 全量通讯录 VID→姓名/部门/职位
|
|
17
|
-
printf '%s' "$CFG" | /usr/bin/python3 reader.py --groups # 全量群列表(含群主)
|
|
18
|
-
printf '%s' "$CFG" | /usr/bin/python3 reader.py --members <群RID> # 群成员(VID+姓名+邀请人)
|
|
19
|
-
printf '%s' "$CFG2" | /usr/bin/python3 reader.py # 消息增量(含 senderName)
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
`read_batch` 每条消息新增 `senderName`(USER 表优先,CONVERSATION.name 兜底);`session_plain()` 自动解密 Session.db 并按 mtime 缓存(删除 `cacheDir/Session.db.plain` 可强制刷新)。
|
|
23
|
-
|
|
24
|
-
## 测试
|
|
25
|
-
|
|
26
|
-
`python3 -I -c "import sys,unittest;sys.path.insert(0,'.');import reader_test;unittest.TextTestRunner().run(unittest.defaultTestLoader.loadTestsFromModule(reader_test))"` —— 12 个全过。
|
|
27
|
-
|
|
28
|
-
## 踩坑记录
|
|
29
|
-
|
|
30
|
-
1. **Contact.db 误判**:曾以为"群成员姓名需要 Contact.db 第二把 key"——实际 **Session.db 就是全量通讯录**,同 VID key 直接解。Contact.db 是受保护库(key 走服务端授权 vid/st/cst/deviceid 链,本地穷举 240 万次失败),但它没有独特数据,不必碰。
|
|
31
|
-
2. `member_bin` 顶层是 field 0(`fields(..., allow_zero=True)`);内容只有 VID,无姓名——姓名必须 join USER 表。
|
|
32
|
-
3. `reader.py` 用 `prepare_mirror` 写死了消息库校验(`quick_check('MESSAGE')`),解其它库要用底层 `frozen_source + decrypt_page` 手动解(见 `session_plain`);`frozen` 临时目录需预先创建。
|
|
33
|
-
4. USER 表没有 departmentid(部门关联在 MYHEAD:UID→departmentid,一个用户可多部门取第一个)。
|
|
34
|
-
5. FTS5 表(`*SEARCH*`/`TINYHOT`)依赖 ICU tokenizer,无法在系统 sqlite 里 count——按表名跳过。
|