agentroam-runtime-darwin-arm64 0.2.0-preview.73 → 0.2.0-preview.75
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 +5 -5
- 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/calendar/route.js +3 -0
- package/runtime/.next/server/app/api/calendar/route.js.nft.json +1 -0
- 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 +37 -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-3cae58f0f14f0b4f.js} +1 -1
- package/runtime/.next/static/chunks/app/web/layout-d5d7d1c5c74eef3c.js +1 -0
- package/runtime/.next/static/chunks/app/web/page-7afa4cb0119e90b7.js +1 -0
- package/runtime/.next/static/chunks/{main-app-20135c1d85680f16.js → main-app-7a6902a607752446.js} +1 -1
- package/runtime/.next/static/chunks/{main-93c452d518291b1c.js → main-d8ef9def37924b01.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 +125 -125
- package/runtime/node_modules/@agent/core/dist/index.js +86 -9
- package/runtime/node_modules/@agent/native-runtime/dist/index.js +49 -19
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/README.md +1 -1
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/bridge.mjs +96 -96
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/browser-sdk.js +73 -71
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-2h2qc9qv.mjs +18 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-9sxfsmzx.mjs +18 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-zg882d22.mjs → core-ba5rrckm.mjs} +2 -2
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-dnsvg8nc.mjs +53 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-9je8ee1j.mjs → core-h6r54bwv.mjs} +2 -2
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-k67vj6j9.mjs +20 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-qbjntcdf.mjs +18 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-qj4dtgyt.mjs +17 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-rn7tc54w.mjs +17 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-sstebd83.mjs +18 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-td7rt8zt.mjs +17 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-x3hc9abc.mjs → core-tf03rfab.mjs} +3 -3
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-x4kwpwv9.mjs +16 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-y6bhrwmk.mjs +47 -0
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/{core-fxa8mwbm.mjs → core-ya1m7gzj.mjs} +3 -3
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core.mjs +11 -11
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.json +21 -21
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/manifest.zst.json +25 -25
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/package.json +25 -21
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs +88 -85
- package/runtime/package-lock.json +182 -158
- package/runtime/server.js +1 -1
- package/runtime/webapp/dist/assets/{AIHubView-BQKD1oRa.js → AIHubView-BMeOfqfm.js} +1 -1
- package/runtime/webapp/dist/assets/{AgentManager-eTCpLsYc.js → AgentManager-CrN2B-tH.js} +1 -1
- package/runtime/webapp/dist/assets/{AiHubPane-LnfAKHOH.js → AiHubPane-Du6ajSsx.js} +1 -1
- package/runtime/webapp/dist/assets/App-zihaYk1L.js +179 -0
- package/runtime/webapp/dist/assets/{BrowserLivePanel-BvXuMltx.js → BrowserLivePanel-CU_X6OU2.js} +1 -1
- package/runtime/webapp/dist/assets/{CollaborationCreateDialog-0xwWJVAB.js → CollaborationCreateDialog-BmgYdwe7.js} +1 -1
- package/runtime/webapp/dist/assets/{CollaborationDashboard-CDuqbRZZ.js → CollaborationDashboard-mHU8iJYg.js} +1 -1
- package/runtime/webapp/dist/assets/{CollaborationPage-BLv1g5Ke.js → CollaborationPage-Br5fhNce.js} +1 -1
- package/runtime/webapp/dist/assets/{FilePreview-DIsjFx4f.js → FilePreview-CevPpP6E.js} +3 -3
- package/runtime/webapp/dist/assets/{FileTree-BJe67ELr.js → FileTree-CagcHV1N.js} +1 -1
- package/runtime/webapp/dist/assets/{FileWorkspaceDrawer-PtNe21oN.js → FileWorkspaceDrawer-CWVndCXp.js} +1 -1
- package/runtime/webapp/dist/assets/{FlowStudioPane-DGv9czqf.js → FlowStudioPane-BZA-qvBj.js} +1 -1
- package/runtime/webapp/dist/assets/{LSPServerList-DZkbA5NX.js → LSPServerList-BMY6dFfG.js} +1 -1
- package/runtime/webapp/dist/assets/{MCPServerList-DLJUT0j8.js → MCPServerList-c91QNM-g.js} +1 -1
- package/runtime/webapp/dist/assets/{MemoryViewer-B4synV6O.js → MemoryViewer-C9IfWwzW.js} +1 -1
- package/runtime/webapp/dist/assets/{RemoteDesktopPage-Db8WVCjo.js → RemoteDesktopPage-w8aL061W.js} +1 -1
- package/runtime/webapp/dist/assets/{RunningSessionsIcon-DRhO-CVq.js → RunningSessionsIcon-B8Cr2-hp.js} +1 -1
- package/runtime/webapp/dist/assets/{SessionDashboard-C6En31sg.js → SessionDashboard-CFXXTm_4.js} +1 -1
- package/runtime/webapp/dist/assets/{SessionDashboardBridge--lNIU1u6.js → SessionDashboardBridge-Bx4EXtos.js} +1 -1
- package/runtime/webapp/dist/assets/{SettingsPanel-mJ5Ggwlp.js → SettingsPanel-CS4XL2sd.js} +1 -1
- package/runtime/webapp/dist/assets/{SkillManager-C_mt62Rc.js → SkillManager-5FZnR9My.js} +1 -1
- package/runtime/webapp/dist/assets/{TerminalPane-D121NsSc.js → TerminalPane-CRrbd0i4.js} +1 -1
- package/runtime/webapp/dist/assets/{abnfDiagram-VCTEODGH-CSTtPfA-.js → abnfDiagram-VCTEODGH-DBioGYiE.js} +1 -1
- package/runtime/webapp/dist/assets/{arc-pE43fNGK.js → arc-BRj_RXHL.js} +1 -1
- package/runtime/webapp/dist/assets/{architectureDiagram-5GKGNRK7-BlExjf1L.js → architectureDiagram-5GKGNRK7-CoCdq67U.js} +1 -1
- package/runtime/webapp/dist/assets/{arrow-right-CED95s1t.js → arrow-right-Cqqb1zqH.js} +1 -1
- package/runtime/webapp/dist/assets/{artifact-links-BWD7xpfV.js → artifact-links-73OZyi5W.js} +1 -1
- package/runtime/webapp/dist/assets/{blockDiagram-I7D4REHJ-4pzU0s_A.js → blockDiagram-I7D4REHJ-CLisIPjq.js} +1 -1
- package/runtime/webapp/dist/assets/{c4Diagram-7LVT6UL2-DBoJHf0c.js → c4Diagram-7LVT6UL2-BoLCIVW8.js} +1 -1
- package/runtime/webapp/dist/assets/channel-JGVZzkSo.js +1 -0
- package/runtime/webapp/dist/assets/{chevron-down-DuxUTH_N.js → chevron-down-DhZV290h.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-2Q5K7J3B-Bu1Sc-w9.js → chunk-2Q5K7J3B-CIQxwzU0.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-5VM5RSS4-COwAF0w2.js → chunk-5VM5RSS4-Buiv0MCN.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-F27PBJKO-FLl8DRP2.js → chunk-F27PBJKO-XBMwIl6X.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-IMKFNOWR-BL8M_b-w.js → chunk-IMKFNOWR-C0NrkJOc.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-JWPE2WC7-Bm0OpXaO.js → chunk-JWPE2WC7-CGON_UvB.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-POPQ4Y6H-Be_mjw7_.js → chunk-POPQ4Y6H-BXvOsc9g.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-SVP7TREG-Dijp9l1U.js → chunk-SVP7TREG-ZD_qn-NK.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-TICWLB2K-CJDtjon2.js → chunk-TICWLB2K-DrB8f6RG.js} +1 -1
- package/runtime/webapp/dist/assets/{chunk-XXDRQBXY-BLWOMtvS.js → chunk-XXDRQBXY-CYgLMn5t.js} +1 -1
- package/runtime/webapp/dist/assets/classDiagram-ZZMXUADV-BnctJ00R.js +1 -0
- package/runtime/webapp/dist/assets/classDiagram-v2-VYDZK3BY-BnctJ00R.js +1 -0
- package/runtime/webapp/dist/assets/{codeSyntax-BnmCqa8x.js → codeSyntax-DfQ5rLir.js} +1 -1
- package/runtime/webapp/dist/assets/{collaboration-B0sTZDns.js → collaboration-CQhzjwS_.js} +1 -1
- package/runtime/webapp/dist/assets/{composer-file-routing-BrWLenKF.js → composer-file-routing-D9orqwzY.js} +1 -1
- package/runtime/webapp/dist/assets/{cose-bilkent-JH36ORCC-cA67vOKJ.js → cose-bilkent-JH36ORCC-CDPnTlcy.js} +1 -1
- package/runtime/webapp/dist/assets/{cynefin-OW5HDTMX-BPeSii-l.js → cynefin-OW5HDTMX-DDCxhkA5.js} +1 -1
- package/runtime/webapp/dist/assets/{cynefinDiagram-5FMLGOSQ-B9f094pg.js → cynefinDiagram-5FMLGOSQ-CIJ1KBPA.js} +1 -1
- package/runtime/webapp/dist/assets/{dagre-GXQ25YYZ-C_xejuzH.js → dagre-GXQ25YYZ-CFX8O3IJ.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-S7CK7UJ4-0f77MjI_.js → diagram-S7CK7UJ4-B8UX2IBH.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-UQ7AKVKN-B7qqB6UY.js → diagram-UQ7AKVKN-Ce34DNrv.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-VSXAHHWV-eS0I06tX.js → diagram-VSXAHHWV-CVL_erWD.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-VX7I27RA-BzaPvwZL.js → diagram-VX7I27RA-DBFHI7Dk.js} +1 -1
- package/runtime/webapp/dist/assets/{diagram-Z3DM3KII-C_EAUyuK.js → diagram-Z3DM3KII-Bw_QcSQY.js} +1 -1
- package/runtime/webapp/dist/assets/{download-DNa5KRtu.js → download-D3xZPWnZ.js} +1 -1
- package/runtime/webapp/dist/assets/{ebnfDiagram-PWID7BFC-CpSazgmq.js → ebnfDiagram-PWID7BFC-DRly04dj.js} +1 -1
- package/runtime/webapp/dist/assets/{erDiagram-RLTQ6QDP-BbAq4dnX.js → erDiagram-RLTQ6QDP-DTm817hG.js} +1 -1
- package/runtime/webapp/dist/assets/{external-link-D0ZU8y72.js → external-link-Cwu5rEgp.js} +1 -1
- package/runtime/webapp/dist/assets/{file-types-Bv8xIlsm.js → file-types-DKkhMnUV.js} +1 -1
- package/runtime/webapp/dist/assets/{flowDiagram-HODETNUW-FxtiM8S_.js → flowDiagram-HODETNUW-tc8ygZtG.js} +1 -1
- package/runtime/webapp/dist/assets/{ganttDiagram-EL5Y4UJY-vbQAmYA_.js → ganttDiagram-EL5Y4UJY-CsQFf1IN.js} +1 -1
- package/runtime/webapp/dist/assets/{gitGraphDiagram-WWUBYQGX-CoH-vS6p.js → gitGraphDiagram-WWUBYQGX-DAIxbmPX.js} +1 -1
- package/runtime/webapp/dist/assets/{image-plus-CMQPwQ1a.js → image-plus-nplydLA5.js} +1 -1
- package/runtime/webapp/dist/assets/index-B-d1Vs9E.css +1 -0
- package/runtime/webapp/dist/assets/{index-B_qrzBSm.js → index-DKm9ESDq.js} +50 -50
- package/runtime/webapp/dist/assets/{infoDiagram-27XIBGKW-BhQjKjwI.js → infoDiagram-27XIBGKW-CVcMW4UM.js} +1 -1
- package/runtime/webapp/dist/assets/{ishikawaDiagram-5VMMS53U-Do6164Lq.js → ishikawaDiagram-5VMMS53U-zzlEtZ1l.js} +1 -1
- package/runtime/webapp/dist/assets/{journeyDiagram-3NMN7TZE-DU9terNG.js → journeyDiagram-3NMN7TZE-q7NuIMSl.js} +1 -1
- package/runtime/webapp/dist/assets/{kanban-definition-UXKFOSKX-PIi78bMz.js → kanban-definition-UXKFOSKX-DLYFZlKO.js} +1 -1
- package/runtime/webapp/dist/assets/{layout-kIcBLq12.js → layout-PFWssIkE.js} +1 -1
- package/runtime/webapp/dist/assets/{linear-DuoGw6Ne.js → linear-ZRVcojb1.js} +1 -1
- package/runtime/webapp/dist/assets/{loader-circle-CkN6rr8Q.js → loader-circle-DIW9tlEz.js} +1 -1
- package/runtime/webapp/dist/assets/{mermaid.core-CMSVAwDO.js → mermaid.core-C8Dl0Nah.js} +5 -5
- package/runtime/webapp/dist/assets/{mindmap-definition-YA3MSWOX-BqXezPt8.js → mindmap-definition-YA3MSWOX-BcbqtwVk.js} +1 -1
- package/runtime/webapp/dist/assets/{page-BJynASYd.js → page-BG97oPXr.js} +4 -4
- package/runtime/webapp/dist/assets/{pegDiagram-XKGWAZYB-CfhSiKuL.js → pegDiagram-XKGWAZYB-BQN3zQuy.js} +1 -1
- package/runtime/webapp/dist/assets/{pieDiagram-E7YTZNPT-D6dTu0HJ.js → pieDiagram-E7YTZNPT-pOgxh3os.js} +1 -1
- package/runtime/webapp/dist/assets/{quadrantDiagram-AXDQQJYC-B6Nk3my2.js → quadrantDiagram-AXDQQJYC-BOg7ujzG.js} +1 -1
- package/runtime/webapp/dist/assets/{railroadDiagram-O6MQD6OU-9HdWlkSi.js → railroadDiagram-O6MQD6OU-CWsN3juJ.js} +1 -1
- package/runtime/webapp/dist/assets/{requirementDiagram-BXWQKSXE-CJ72A4ch.js → requirementDiagram-BXWQKSXE-B0yrO7Oy.js} +1 -1
- package/runtime/webapp/dist/assets/{rotate-ccw-CFOlggPt.js → rotate-ccw-O4wnfQP7.js} +1 -1
- package/runtime/webapp/dist/assets/{rotate-cw-CV6TU7ho.js → rotate-cw-CCJtlAtB.js} +1 -1
- package/runtime/webapp/dist/assets/{sankeyDiagram-P5KCCOFB-B0k_-2GA.js → sankeyDiagram-P5KCCOFB-5MS_e-3E.js} +1 -1
- package/runtime/webapp/dist/assets/{send-Br8F4frT.js → send-Cdg4ZVlp.js} +1 -1
- package/runtime/webapp/dist/assets/{sequenceDiagram-WJ2MYXX4-D-Vubzl4.js → sequenceDiagram-WJ2MYXX4-C1w8qYSu.js} +1 -1
- package/runtime/webapp/dist/assets/{session-dashboard-B_G9IZRa.js → session-dashboard-BigU92sz.js} +1 -1
- package/runtime/webapp/dist/assets/{shield-check-C_XCddHW.js → shield-check-CrjI2wPR.js} +1 -1
- package/runtime/webapp/dist/assets/{sizeCapture-INFHLROL-CDLZ64va.js → sizeCapture-INFHLROL-BonKTynC.js} +1 -1
- package/runtime/webapp/dist/assets/{stateDiagram-D77RDMKH-D55B47_M.js → stateDiagram-D77RDMKH-D3mn6ZK5.js} +1 -1
- package/runtime/webapp/dist/assets/stateDiagram-v2-MP3YSRHH-WEfEW-mH.js +1 -0
- package/runtime/webapp/dist/assets/{swimlanes-42K2YHIH-FSX6VCzY.js → swimlanes-42K2YHIH-Bn9KWChU.js} +1 -1
- package/runtime/webapp/dist/assets/swimlanesDiagram-VR7AAH4N-D26_Nmko.js +8 -0
- package/runtime/webapp/dist/assets/{timeline-definition-24CTP7MA-DGmgxtYO.js → timeline-definition-24CTP7MA-BfuhI7EF.js} +1 -1
- package/runtime/webapp/dist/assets/{trash-2-Drt7yRIe.js → trash-2-BrfgMjfL.js} +1 -1
- package/runtime/webapp/dist/assets/{types-BOD4WqhS.js → types-VnQ_cKrp.js} +1 -1
- package/runtime/webapp/dist/assets/{vennDiagram-4TSXK5OY-XbldOddh.js → vennDiagram-4TSXK5OY-CUFs5JyR.js} +1 -1
- package/runtime/webapp/dist/assets/{wardleyDiagram-VM6X3IG4-DrGMS-oH.js → wardleyDiagram-VM6X3IG4-C27HHz1A.js} +1 -1
- package/runtime/webapp/dist/assets/{web-Crv8v2xB.js → web-BOzkL-0Z.js} +1 -1
- package/runtime/webapp/dist/assets/{web-DQg6oOed.js → web-CeCHmdwO.js} +1 -1
- package/runtime/webapp/dist/assets/{x-8eDWe1V2.js → x-DP1nC4qG.js} +1 -1
- package/runtime/webapp/dist/assets/{xychartDiagram-S5SC5T6Z-BClf-jGf.js → xychartDiagram-S5SC5T6Z-CQwRrSTf.js} +1 -1
- package/runtime/webapp/dist/assets/{zoom-out-CKWUyj9b.js → zoom-out-Dg7YyzcP.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/node_modules/@anthropic-ai/claude-agent-sdk/core-0a66n3e7.mjs +0 -16
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-0bmnpbz2.mjs +0 -45
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-ds2jqcef.mjs +0 -19
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-gbbw9cgm.mjs +0 -17
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-msnqqcc2.mjs +0 -42
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-wadgcjfh.mjs +0 -18
- package/runtime/node_modules/@anthropic-ai/claude-agent-sdk/core-x20yarwf.mjs +0 -17
- 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 → xuZ1UJWVNJ-rxb5YgETmd}/_buildManifest.js +0 -0
- /package/runtime/.next/static/{fg72y0mrQ518VXPNOLU1t → xuZ1UJWVNJ-rxb5YgETmd}/_ssgManifest.js +0 -0
|
@@ -1,445 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Send through the original WeCom UI; verify using the receiver's existing mirror."""
|
|
3
|
-
import contextlib
|
|
4
|
-
import datetime
|
|
5
|
-
import fcntl
|
|
6
|
-
import hashlib
|
|
7
|
-
import json
|
|
8
|
-
import os
|
|
9
|
-
from pathlib import Path
|
|
10
|
-
import re
|
|
11
|
-
import shutil
|
|
12
|
-
import socket
|
|
13
|
-
import sqlite3
|
|
14
|
-
import subprocess
|
|
15
|
-
import sys
|
|
16
|
-
import tempfile
|
|
17
|
-
import time
|
|
18
|
-
|
|
19
|
-
from reader import decode_body
|
|
20
|
-
|
|
21
|
-
DEFAULT_APP = Path.home() / "Library/Application Support/AgentRoam/wecom-sender/WeComSendBridge.app"
|
|
22
|
-
CLIENT = "/Applications/企业微信.app/Contents/MacOS/企业微信"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class Blocked(Exception):
|
|
26
|
-
pass
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class NativeBridge:
|
|
30
|
-
def __init__(self, app=DEFAULT_APP):
|
|
31
|
-
self.app = Path(app)
|
|
32
|
-
|
|
33
|
-
def call(self, operation, pid, **arguments):
|
|
34
|
-
if not self.app.is_dir():
|
|
35
|
-
raise Blocked("本地企微发送桥未安装,请先安装并授予辅助功能权限")
|
|
36
|
-
root = Path(tempfile.mkdtemp(prefix="agentroam-wecom-"))
|
|
37
|
-
request, response = root / "request.json", root / "response.json"
|
|
38
|
-
private_json(request, {"op": operation, "pid": pid, **arguments})
|
|
39
|
-
completed = False
|
|
40
|
-
try:
|
|
41
|
-
subprocess.run(["/usr/bin/open", "-n", "-W", str(self.app), "--args", "--request", str(request),
|
|
42
|
-
"--response", str(response)], check=True, capture_output=True, timeout=45)
|
|
43
|
-
if not response.is_file():
|
|
44
|
-
raise RuntimeError("发送桥退出但没有返回结果")
|
|
45
|
-
result = json.loads(response.read_text())
|
|
46
|
-
completed = True
|
|
47
|
-
return result
|
|
48
|
-
finally:
|
|
49
|
-
# LaunchServices' child may outlive a timed-out `open`. Keep its request/response private and valid.
|
|
50
|
-
if completed:
|
|
51
|
-
shutil.rmtree(root)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
# ---------------------------------------------------------------------------
|
|
55
|
-
# 非 GUI 发送后端:通过 Unix socket 连到注入版企微里的 WeWorkInject.dylib。
|
|
56
|
-
# dylib 在进程内复用 WEWInputViewController 触发企微自己的发送,不走 AX/辅助功能。
|
|
57
|
-
# 保留与 NativeBridge 相同的 call() 接口,process() 无需区分后端。
|
|
58
|
-
# ---------------------------------------------------------------------------
|
|
59
|
-
INJECT_SOCKET = (os.environ.get("AGENT_WECOM_INJECT_SOCKET")
|
|
60
|
-
or str(Path.home() / "Library/Containers/com.tencent.WeWorkMac/Data/tmp/wework-inject.sock"))
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
class InjectBridge:
|
|
64
|
-
"""通过本地 socket 让注入 dylib 在企微进程内发送(零 GUI、零辅助功能权限)。"""
|
|
65
|
-
|
|
66
|
-
def __init__(self, socket_path=INJECT_SOCKET, timeout=25.0):
|
|
67
|
-
self.socket_path = socket_path
|
|
68
|
-
self.timeout = timeout
|
|
69
|
-
|
|
70
|
-
def _request(self, payload):
|
|
71
|
-
if not os.path.exists(self.socket_path):
|
|
72
|
-
raise Blocked("注入版企业微信未运行(socket 不存在):" + self.socket_path)
|
|
73
|
-
try:
|
|
74
|
-
client = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
|
75
|
-
client.settimeout(self.timeout)
|
|
76
|
-
client.connect(self.socket_path)
|
|
77
|
-
client.sendall((json.dumps(payload, ensure_ascii=False) + "\n").encode("utf-8"))
|
|
78
|
-
buf = b""
|
|
79
|
-
while b"\n" not in buf:
|
|
80
|
-
chunk = client.recv(4096)
|
|
81
|
-
if not chunk:
|
|
82
|
-
break
|
|
83
|
-
buf += chunk
|
|
84
|
-
client.close()
|
|
85
|
-
if not buf.strip():
|
|
86
|
-
raise Blocked("注入发送桥未返回结果(企微可能已重启)")
|
|
87
|
-
return json.loads(buf.split(b"\n", 1)[0].decode("utf-8", "replace"))
|
|
88
|
-
except (OSError, json.JSONDecodeError) as error:
|
|
89
|
-
raise Blocked("注入发送桥通信失败:" + str(error))
|
|
90
|
-
|
|
91
|
-
def call(self, operation, pid=None, **arguments):
|
|
92
|
-
# operation 在注入后端里只有 "send" / "verify" 两种语义
|
|
93
|
-
if operation == "send":
|
|
94
|
-
request = {
|
|
95
|
-
"cmd": "send",
|
|
96
|
-
"conv_name": arguments.get("chatTitle") or arguments.get("target", {}).get("name", ""),
|
|
97
|
-
"text": arguments.get("text", ""),
|
|
98
|
-
"dry_run": 0,
|
|
99
|
-
# 会话校验由 process() 里的镜库 verify_target 完成,
|
|
100
|
-
# dylib 侧 conv_name 只做尽力校验(strict=0,见 dylib 实现)。
|
|
101
|
-
"strict": 0,
|
|
102
|
-
}
|
|
103
|
-
# 先让 dylib 在进程内选中目标会话(非 GUI),再发送;
|
|
104
|
-
# 会话一致性由上游 verify_target(镜库)保证。
|
|
105
|
-
conv_name = request.get("conv_name") or ""
|
|
106
|
-
if conv_name:
|
|
107
|
-
opened = self._request({"cmd": "open_conv", "conv_name": conv_name})
|
|
108
|
-
if not opened.get("ok"):
|
|
109
|
-
raise Blocked("目标会话未打开,请先在企微窗口点开一次会话:" +
|
|
110
|
-
str(opened.get("detail") or opened.get("error") or ""))
|
|
111
|
-
result = self._request(request)
|
|
112
|
-
if not result.get("ok"):
|
|
113
|
-
raise Blocked("注入发送失败:" + str(result.get("detail") or result.get("error") or "未知原因"))
|
|
114
|
-
# 契约对齐:submitted 表示已提交企微,等待接收侧核验本人发送记录
|
|
115
|
-
return {"status": "submitted"}
|
|
116
|
-
if operation == "verify":
|
|
117
|
-
# 回执靠本地库(receipt()),这里只探活
|
|
118
|
-
try:
|
|
119
|
-
self._request({"cmd": "status"})
|
|
120
|
-
return {"status": "ready"}
|
|
121
|
-
except Blocked:
|
|
122
|
-
return {"status": "blocked", "error": "注入发送桥不可用"}
|
|
123
|
-
# inspect / selectConversation / paste / submit 在注入后端都不需要
|
|
124
|
-
return {"status": "ready"}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
def private_json(path, value):
|
|
128
|
-
path = Path(path)
|
|
129
|
-
descriptor, temporary = tempfile.mkstemp(prefix=".write-", dir=path.parent)
|
|
130
|
-
try:
|
|
131
|
-
with os.fdopen(descriptor, "w") as output:
|
|
132
|
-
json.dump(value, output, ensure_ascii=False)
|
|
133
|
-
output.flush()
|
|
134
|
-
os.fsync(output.fileno())
|
|
135
|
-
os.replace(temporary, path)
|
|
136
|
-
parent = os.open(path.parent, os.O_RDONLY | getattr(os, "O_DIRECTORY", 0))
|
|
137
|
-
try:
|
|
138
|
-
os.fsync(parent)
|
|
139
|
-
finally:
|
|
140
|
-
os.close(parent)
|
|
141
|
-
finally:
|
|
142
|
-
if os.path.exists(temporary):
|
|
143
|
-
os.unlink(temporary)
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
def accepted(result):
|
|
147
|
-
if result.get("status") != "ready":
|
|
148
|
-
raise Blocked(str(result.get("error") or result.get("code") or "企微发送桥未就绪"))
|
|
149
|
-
return result
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
def client_pid(bridge):
|
|
153
|
-
output = subprocess.run(["/bin/ps", "-axo", "pid=,comm="], check=True, capture_output=True, text=True).stdout
|
|
154
|
-
candidates = [int(line.strip().split(None, 1)[0]) for line in output.splitlines()
|
|
155
|
-
if len(line.strip().split(None, 1)) == 2 and line.strip().split(None, 1)[1] == CLIENT]
|
|
156
|
-
owners = []
|
|
157
|
-
for pid in candidates:
|
|
158
|
-
state = accepted(bridge.call("inspect", pid, compact=True))
|
|
159
|
-
if any(window["title"] == "企业微信" for window in state.get("windows", [])):
|
|
160
|
-
owners.append(pid)
|
|
161
|
-
if len(owners) != 1:
|
|
162
|
-
raise Blocked("未唯一匹配原版企微主窗口,请打开原版企微并保持主窗口可见")
|
|
163
|
-
return owners[0]
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
def verify_client_database(pid, expected):
|
|
167
|
-
if not isinstance(expected, str) or not expected:
|
|
168
|
-
raise Blocked("缺少已配置的企微账号数据库路径")
|
|
169
|
-
output = subprocess.run(["/usr/sbin/lsof", "-nP", "-a", "-p", str(pid), "-Fn"],
|
|
170
|
-
check=True, capture_output=True, text=True, timeout=10).stdout
|
|
171
|
-
# Inspect file names held by this client, without reading the protected source database.
|
|
172
|
-
paths = {line[1:] for line in output.splitlines() if line.startswith("n")
|
|
173
|
-
and re.search(r"/Profiles/[^/]+/Messages[0-9]*/Info\.db$", line[1:])}
|
|
174
|
-
profiles = {str(Path(path).parent.parent) for path in paths}
|
|
175
|
-
if os.path.normpath(expected) not in paths or len(profiles) != 1:
|
|
176
|
-
raise Blocked("原版企微当前账号与接收侧账号未唯一匹配,未发送")
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
def main_window(state):
|
|
180
|
-
windows = [window for window in accepted(state).get("windows", []) if window["title"] == "企业微信"]
|
|
181
|
-
if len(windows) != 1:
|
|
182
|
-
raise Blocked("未唯一匹配企微主窗口")
|
|
183
|
-
return windows[0]
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
def editor(window):
|
|
187
|
-
inputs = [node for node in window["nodes"] if node["role"] == "AXTextArea" and node.get("valueSettable")]
|
|
188
|
-
if len(inputs) != 1:
|
|
189
|
-
raise Blocked("未唯一匹配企微聊天输入框")
|
|
190
|
-
return inputs[0]
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
def chat_controls(window, title):
|
|
194
|
-
target = editor(window)
|
|
195
|
-
headers = [node for node in window["nodes"] if node["role"] in ("AXTextField", "AXStaticText")
|
|
196
|
-
and node["value"] == title and 2 <= len(node["path"]) <= 4
|
|
197
|
-
and node["path"][:-1] == target["path"][:len(node["path"]) - 1]
|
|
198
|
-
and node.get("frame", [0, 0])[0] >= target["frame"][0]
|
|
199
|
-
and node["frame"][1] < target["frame"][1]]
|
|
200
|
-
rows = [node for node in window["nodes"] if node["role"] == "AXRow" and node.get("selected")
|
|
201
|
-
and node.get("frame", [target["frame"][0]])[0] < target["frame"][0]]
|
|
202
|
-
if len(headers) != 1 or len(rows) != 1:
|
|
203
|
-
raise Blocked("聊天标题或选中的会话未唯一匹配,未输入或发送")
|
|
204
|
-
row = rows[0]
|
|
205
|
-
labels = [node["value"] for node in window["nodes"] if node["role"] == "AXStaticText"
|
|
206
|
-
and node["path"][:len(row["path"])] == row["path"]
|
|
207
|
-
and node.get("frame", [0, 1e9])[1] < row["frame"][1] + 30
|
|
208
|
-
and node["frame"][0] > row["frame"][0] + 30 and node["value"]]
|
|
209
|
-
if not labels or labels[0] != title:
|
|
210
|
-
raise Blocked("所选会话与聊天标题不一致,未输入或发送")
|
|
211
|
-
return target, headers[0]
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
def control_args(window, node):
|
|
215
|
-
return {"window": window["index"], "windowTitle": window["title"], "path": node["path"],
|
|
216
|
-
"role": node["role"], "expectedValue": node["value"]}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
@contextlib.contextmanager
|
|
220
|
-
def mirror_connection(path):
|
|
221
|
-
path = Path(path)
|
|
222
|
-
if not path.is_file():
|
|
223
|
-
raise Blocked("接收侧镜像尚未就绪,请先完成本地消息采集")
|
|
224
|
-
connection = sqlite3.connect(path.resolve().as_uri() + "?mode=ro", uri=True, timeout=3)
|
|
225
|
-
connection.row_factory = sqlite3.Row
|
|
226
|
-
try:
|
|
227
|
-
connection.execute("PRAGMA writable_schema=ON")
|
|
228
|
-
connection.execute("PRAGMA query_only=ON")
|
|
229
|
-
connection.execute("BEGIN")
|
|
230
|
-
yield connection
|
|
231
|
-
finally:
|
|
232
|
-
connection.close()
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
def verify_target(request):
|
|
236
|
-
account, target = str(request["accountId"]), request["target"]
|
|
237
|
-
if not account.isdigit() or not str(target["conversationId"]).isdigit():
|
|
238
|
-
raise Blocked("本地账号或会话 ID 无效")
|
|
239
|
-
kind = {"direct": 0, "group": 1}.get(target.get("conversationType"))
|
|
240
|
-
if kind is None:
|
|
241
|
-
raise Blocked("未知会话类型不能用于本地发送")
|
|
242
|
-
with mirror_connection(request["mirror"]) as connection:
|
|
243
|
-
row = connection.execute("SELECT name,conversationtype FROM CONVERSATION WHERE RID=?", (target["conversationId"],)).fetchone()
|
|
244
|
-
if not row or row["name"] != target["name"] or row["conversationtype"] != kind:
|
|
245
|
-
raise Blocked("接收侧会话 ID、名称或类型不匹配")
|
|
246
|
-
if connection.execute("SELECT COUNT(*) FROM CONVERSATION WHERE name=?", (target["name"],)).fetchone()[0] != 1:
|
|
247
|
-
raise Blocked("企微存在同名会话,不能仅凭界面名称发送")
|
|
248
|
-
if kind == 0:
|
|
249
|
-
alias = re.search(r"\(([a-zA-Z0-9_.@-]+)\)$", target["name"])
|
|
250
|
-
if not alias or alias.group(1) != target.get("peerUserId"):
|
|
251
|
-
raise Blocked("私聊联系人别名与接收侧身份不一致")
|
|
252
|
-
origin = request.get("origin")
|
|
253
|
-
if origin:
|
|
254
|
-
row = connection.execute("SELECT conv_id,sender_id,send_time,content,content_type FROM MESSAGE WHERE LID=?", (origin["lid"],)).fetchone()
|
|
255
|
-
if not row or str(row["conv_id"]) != str(target["conversationId"]) or str(row["sender_id"]) != origin["senderId"] \
|
|
256
|
-
or str(row["send_time"]) != origin["sendTime"] or decode_body(row["content"] or b"", row["content_type"])["text"] != origin["text"]:
|
|
257
|
-
raise Blocked("接收侧未匹配原消息的会话、发送人、时间和正文")
|
|
258
|
-
return str(connection.execute("SELECT COALESCE(MAX(LID),0) FROM MESSAGE WHERE conv_id=?", (target["conversationId"],)).fetchone()[0])
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
def receipt(request, ledger):
|
|
262
|
-
if not ledger.get("submittedAt"):
|
|
263
|
-
return None
|
|
264
|
-
with mirror_connection(request["mirror"]) as connection:
|
|
265
|
-
rows = connection.execute(
|
|
266
|
-
"SELECT LID,RID,seq,sender_id,send_time,flag,content_type,content FROM MESSAGE "
|
|
267
|
-
"WHERE conv_id=? AND sender_id=? AND LID>? AND send_time>=? ORDER BY LID LIMIT 100",
|
|
268
|
-
(request["target"]["conversationId"], request["accountId"], ledger["baselineLid"], int(ledger["submittedAt"]) - 2)).fetchall()
|
|
269
|
-
matches = []
|
|
270
|
-
for row in rows:
|
|
271
|
-
try:
|
|
272
|
-
body = decode_body(row["content"] or b"", row["content_type"])["text"]
|
|
273
|
-
except (ValueError, UnicodeDecodeError):
|
|
274
|
-
continue
|
|
275
|
-
if body == request["text"]:
|
|
276
|
-
matches.append(row)
|
|
277
|
-
if len(matches) != 1 or int(matches[0]["RID"] or 0) <= 0 or int(matches[0]["seq"] or 0) <= 0 or matches[0]["flag"] != 0:
|
|
278
|
-
return None
|
|
279
|
-
row = matches[0]
|
|
280
|
-
return {"transport": "local-accessibility", "evidence": "native-outgoing-record", "conversationId": request["target"]["conversationId"],
|
|
281
|
-
"senderId": str(row["sender_id"]), "lid": str(row["LID"]), "rid": str(row["RID"]), "seq": str(row["seq"]),
|
|
282
|
-
"sendTime": str(row["send_time"]), "flag": row["flag"]}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
def resolve_request(request):
|
|
286
|
-
if "target" in request:
|
|
287
|
-
return request
|
|
288
|
-
recipient = request.get("recipient")
|
|
289
|
-
if not isinstance(recipient, str) or not recipient.strip():
|
|
290
|
-
raise Blocked("请提供已采集的会话名称或联系人别名 recipient")
|
|
291
|
-
base = Path(request.get("baseDir") or os.environ.get("AGENT_DATA_DIR") or Path.cwd())
|
|
292
|
-
with mirror_connection(base / ".agent-data/agent.db") as connection:
|
|
293
|
-
row = connection.execute("SELECT payload FROM messaging_state WHERE key='settings'").fetchone()
|
|
294
|
-
settings = json.loads(row[0])["source"] if row else {}
|
|
295
|
-
if not settings.get("database") or not settings.get("accountId"):
|
|
296
|
-
raise Blocked("AgentRoam 尚未配置企微接收账号")
|
|
297
|
-
identity = hashlib.sha256(json.dumps(settings, ensure_ascii=False, separators=(",", ":")).encode()).hexdigest()[:24]
|
|
298
|
-
mirror = base / ".agent-data/messaging-wecom" / identity / "mirror.db"
|
|
299
|
-
with mirror_connection(mirror) as connection:
|
|
300
|
-
rows = connection.execute("SELECT RID,name,conversationtype FROM CONVERSATION").fetchall()
|
|
301
|
-
matches = []
|
|
302
|
-
for row in rows:
|
|
303
|
-
name = row["name"] or ""
|
|
304
|
-
alias = re.search(r"\(([a-zA-Z0-9_.@-]+)\)$", name) if row["conversationtype"] == 0 else None
|
|
305
|
-
labels = [name] + ([name[:alias.start()].strip(), alias.group(1)] if alias else [])
|
|
306
|
-
if recipient.strip() in labels:
|
|
307
|
-
matches.append((row, alias))
|
|
308
|
-
if len(matches) != 1:
|
|
309
|
-
raise Blocked("未唯一匹配收件人,请使用完整会话名称或精确联系人别名")
|
|
310
|
-
row, alias = matches[0]
|
|
311
|
-
target = {"conversationId": str(row["RID"]), "name": row["name"],
|
|
312
|
-
"conversationType": {0: "direct", 1: "group"}.get(row["conversationtype"], "unknown")}
|
|
313
|
-
if alias:
|
|
314
|
-
target["peerUserId"] = alias.group(1)
|
|
315
|
-
return {"deliveryId": request.get("deliveryId"), "text": request.get("text"), "accountId": str(settings["accountId"]),
|
|
316
|
-
"clientDatabase": settings["database"], "target": target, "mirror": str(mirror),
|
|
317
|
-
"stateDir": str(base / ".agent-data/messaging-wecom-send")}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
def process(request, operation="send", bridge=None, pid=None):
|
|
321
|
-
def inject_available():
|
|
322
|
-
try:
|
|
323
|
-
probe = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
|
324
|
-
probe.settimeout(1.0)
|
|
325
|
-
probe.connect(INJECT_SOCKET)
|
|
326
|
-
probe.close()
|
|
327
|
-
return True
|
|
328
|
-
except OSError:
|
|
329
|
-
return False
|
|
330
|
-
|
|
331
|
-
prefer_inject = os.environ.get("AGENT_WECOM_SENDER") == "inject" or (
|
|
332
|
-
os.environ.get("AGENT_WECOM_SENDER") != "gui" and inject_available())
|
|
333
|
-
if prefer_inject and bridge is None:
|
|
334
|
-
bridge = InjectBridge()
|
|
335
|
-
bridge = bridge or NativeBridge(request.get("app", DEFAULT_APP))
|
|
336
|
-
delivery_id, body = request.get("deliveryId"), request.get("text")
|
|
337
|
-
if not isinstance(delivery_id, str) or not delivery_id or len(delivery_id) > 200 \
|
|
338
|
-
or not isinstance(body, str) or not body.strip() or len(body.encode()) > 20_000:
|
|
339
|
-
raise Blocked("发送 ID 或正文无效")
|
|
340
|
-
root = Path(request["stateDir"])
|
|
341
|
-
root.mkdir(parents=True, exist_ok=True, mode=0o700)
|
|
342
|
-
if root.is_symlink() or root.stat().st_uid != os.getuid() or root.stat().st_mode & 0o077:
|
|
343
|
-
raise Blocked("发送记录目录必须仅属于当前用户")
|
|
344
|
-
fingerprint = hashlib.sha256(json.dumps([request["accountId"], request["target"], body], ensure_ascii=False, sort_keys=True).encode()).hexdigest()
|
|
345
|
-
path = root / (hashlib.sha256(delivery_id.encode()).hexdigest() + ".json")
|
|
346
|
-
descriptor = os.open(root / "sender.lock", os.O_CREAT | os.O_RDWR | os.O_NOFOLLOW, 0o600)
|
|
347
|
-
with os.fdopen(descriptor, "w") as lock:
|
|
348
|
-
try:
|
|
349
|
-
fcntl.flock(lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
|
350
|
-
except BlockingIOError:
|
|
351
|
-
raise Blocked("本地发送桥正在处理另一条消息,请稍后重试")
|
|
352
|
-
if path.is_symlink():
|
|
353
|
-
raise Blocked("发送记录不能是符号链接")
|
|
354
|
-
ledger = json.loads(path.read_text()) if path.exists() else None
|
|
355
|
-
if ledger:
|
|
356
|
-
if ledger.get("fingerprint") != fingerprint:
|
|
357
|
-
raise Blocked("相同发送 ID 对应的收件人或正文发生变化")
|
|
358
|
-
if ledger["status"] == "sent":
|
|
359
|
-
return {"status": "sent", "receipt": ledger["receipt"]}
|
|
360
|
-
if ledger.get("submittedAt"):
|
|
361
|
-
try:
|
|
362
|
-
found = receipt(request, ledger)
|
|
363
|
-
except (sqlite3.Error, OSError, Blocked):
|
|
364
|
-
return {"status": "unknown", "error": "接收侧回执暂不可读;不会重复提交"}
|
|
365
|
-
if found:
|
|
366
|
-
ledger.update(status="sent", receipt=found)
|
|
367
|
-
private_json(path, ledger)
|
|
368
|
-
return {"status": "sent", "receipt": found}
|
|
369
|
-
return {"status": "unknown", "error": "未取得唯一的本人已发送记录;不会重复提交"}
|
|
370
|
-
if ledger["status"] == "preparing":
|
|
371
|
-
return {"status": "blocked", "error": "上一次准备中断,请核对企微草稿;未自动重新输入"}
|
|
372
|
-
if operation == "verify":
|
|
373
|
-
return {"status": "blocked", "error": "没有已提交的本地发送记录"}
|
|
374
|
-
baseline = verify_target(request)
|
|
375
|
-
use_inject = isinstance(bridge, InjectBridge)
|
|
376
|
-
ledger = {"deliveryId": delivery_id, "fingerprint": fingerprint, "status": "preparing", "baselineLid": baseline,
|
|
377
|
-
"createdAt": datetime.datetime.now(datetime.timezone.utc).isoformat(), "conversationId": request["target"]["conversationId"]}
|
|
378
|
-
private_json(path, ledger)
|
|
379
|
-
window = None
|
|
380
|
-
target = None
|
|
381
|
-
header = None
|
|
382
|
-
if not use_inject:
|
|
383
|
-
# 草稿/会话校验必须在 try 之外抛 Blocked,保持与原有 GUI 流程一致的语义
|
|
384
|
-
pid = pid or request.get("pid") or client_pid(bridge)
|
|
385
|
-
verify_client_database(pid, request.get("clientDatabase"))
|
|
386
|
-
window = main_window(bridge.call("inspect", pid, compact=True))
|
|
387
|
-
if editor(window)["value"]:
|
|
388
|
-
raise Blocked("企微当前会话已有草稿,未覆盖或切换会话")
|
|
389
|
-
accepted(bridge.call("selectConversation", pid, window=window["index"], windowTitle=window["title"], chatTitle=request["target"]["name"]))
|
|
390
|
-
window = main_window(bridge.call("inspect", pid, compact=True))
|
|
391
|
-
target, header = chat_controls(window, request["target"]["name"])
|
|
392
|
-
if target["value"]:
|
|
393
|
-
raise Blocked("目标会话已有草稿,未覆盖")
|
|
394
|
-
try:
|
|
395
|
-
if use_inject:
|
|
396
|
-
# 非 GUI 路径:一次 socket 调用让注入 dylib 在企微进程内发送。
|
|
397
|
-
# 目标会话/原消息/账号均已由 verify_target + native-delivery.ts 校验。
|
|
398
|
-
inject_bridge = bridge if isinstance(bridge, InjectBridge) else InjectBridge()
|
|
399
|
-
ledger.update(status="submitting", submittedAt=time.time())
|
|
400
|
-
private_json(path, ledger)
|
|
401
|
-
result = inject_bridge.call("send", text=body,
|
|
402
|
-
chatTitle=request["target"]["name"], target=request["target"])
|
|
403
|
-
if result.get("status") == "blocked":
|
|
404
|
-
ledger.update(status="blocked", error=str(result.get("error") or "注入发送被拒绝"))
|
|
405
|
-
ledger.pop("submittedAt", None)
|
|
406
|
-
private_json(path, ledger)
|
|
407
|
-
return {"status": "blocked", "error": ledger["error"]}
|
|
408
|
-
else:
|
|
409
|
-
accepted(bridge.call("paste", pid, **control_args(window, target), text=body, chatTitle=request["target"]["name"], headerPath=header["path"]))
|
|
410
|
-
window = main_window(bridge.call("inspect", pid, compact=True))
|
|
411
|
-
target, header = chat_controls(window, request["target"]["name"])
|
|
412
|
-
if target["value"] != body:
|
|
413
|
-
raise Blocked("准备后的正文与请求不一致,未提交")
|
|
414
|
-
ledger.update(status="submitting", submittedAt=time.time())
|
|
415
|
-
private_json(path, ledger)
|
|
416
|
-
result = bridge.call("submit", pid, **control_args(window, target), text=body, chatTitle=request["target"]["name"], headerPath=header["path"])
|
|
417
|
-
if result.get("status") == "blocked":
|
|
418
|
-
ledger.update(status="blocked", error=str(result.get("error") or "提交前检查未通过"))
|
|
419
|
-
ledger.pop("submittedAt", None)
|
|
420
|
-
private_json(path, ledger)
|
|
421
|
-
return {"status": "blocked", "error": ledger["error"]}
|
|
422
|
-
ledger["status"] = "submitted" if result.get("status") == "submitted" else "unknown"
|
|
423
|
-
private_json(path, ledger)
|
|
424
|
-
return {"status": "unknown", "submitted": True, "error": "已提交企微,等待接收侧核验本人发送记录"}
|
|
425
|
-
except Exception as error:
|
|
426
|
-
ledger.update(status="unknown" if ledger.get("submittedAt") else "blocked", error=str(error))
|
|
427
|
-
private_json(path, ledger)
|
|
428
|
-
return {"status": ledger["status"], "error": "发送结果尚未确认,请核对原会话;不会自动重发" if ledger.get("submittedAt") else str(error)}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
if __name__ == "__main__":
|
|
432
|
-
try:
|
|
433
|
-
data = sys.stdin.buffer.read(65_537)
|
|
434
|
-
if len(data) > 65_536:
|
|
435
|
-
raise Blocked("发送参数过大")
|
|
436
|
-
request = json.loads(data)
|
|
437
|
-
operation = sys.argv[1] if len(sys.argv) > 1 else "send"
|
|
438
|
-
if operation not in ("send", "verify"):
|
|
439
|
-
raise Blocked("不支持该发送桥操作")
|
|
440
|
-
result = process(resolve_request(request), operation)
|
|
441
|
-
except Blocked as error:
|
|
442
|
-
result = {"status": "blocked", "error": str(error)}
|
|
443
|
-
except Exception as error:
|
|
444
|
-
result = {"status": "unknown", "error": "本地发送流程中断,请核对原会话;不会自动重发:" + str(error)}
|
|
445
|
-
print(json.dumps(result, ensure_ascii=False))
|