@oxmumu3/dsh-project-companion 0.44.0 → 0.44.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +1 -1
- package/package.json +1 -1
- package/src/mobile-bridge/bin/dot-butler-ctl.mjs +7 -0
- package/src/mobile-bridge/bin/dot-send.mjs +1 -1
- package/src/mobile-bridge/lib/device-tool-hub.mjs +17 -6
- package/src/mobile-bridge/lib/dot-store.mjs +119 -18
- package/src/mobile-bridge/lib/media-inbox.mjs +9 -1
- package/src/mobile-bridge/lib/sentinel-guard.mjs +2 -1
- package/src/mobile-bridge/mcp/dot-iphone-mcp-server.mjs +94 -0
package/dist/client.js
CHANGED
|
@@ -2484,4 +2484,4 @@ ${s}`:s)},pn=async()=>{en(!0),Ko(!0),It(""),se({dockOpen:!0});let t=await qn();r
|
|
|
2484
2484
|
${t}`:t,po=async(t,s=void 0,p=void 0)=>{if(qe.current)return;let k=t??ma,J=s??(t===void 0?tr:rt);if(!k.trim()){C("\u5148\u5199\u4E00\u53E5\u4F60\u5E0C\u671B Dot \u5E2E\u5FD9\u7684\u4E8B\u3002");return}let ae=p??Le,ie=qa(J?.id),pt=he,Xe=pt?.sessionId??null;if(!Xe&&typeof l.sessions?.create!="function"){C("\u539F\u751F\u4F1A\u8BDD\u5165\u53E3\u5C1A\u672A\u5C31\u7EEA\uFF0C\u8BF7\u5728 Harness \u65B0\u5EFA\u4E00\u4E2A\u672C\u5730\u4F1A\u8BDD\u7EE7\u7EED\u3002\u8F93\u5165\u5DF2\u4FDD\u7559\u3002");return}H(""),C(""),ke(!0),qe.current=!0;let Ct=new AbortController;Xt.current.add(Ct);let na=null;try{if(!Xe){if(Xe=await l.sessions.create({}),!Wt(Xe)||Xe.startsWith("family_"))throw new Error("\u539F\u751F\u4F1A\u8BDD\u521B\u5EFA\u672A\u5B8C\u6210\uFF0C\u8F93\u5165\u5DF2\u4FDD\u7559\u3002");let va={sessionId:Xe,revision:`native:${Xe}`};re.localConversation=va,F.current&&We(va);let _n=await r.remember(Xe);F.current&&!_n&&C("\u672C\u6B21\u4F1A\u8BDD\u5DF2\u521B\u5EFA\uFF1B\u5165\u53E3\u6682\u672A\u4FDD\u5B58\uFF0C\u53EF\u4ECE\u539F\u751F\u5386\u53F2\u7EE7\u7EED\u3002")}let Rt=r.getSnapshot();if(Rt.owner===null)na=Symbol("main-draft-handoff"),await r.acquire(na,{sessionId:Xe,revision:pt?.revision??`native:${Xe}`});else if(Rt.sessionId!==Xe)throw new Error("\u539F\u751F\u5BF9\u8BDD\u6B63\u5728\u5207\u6362\uFF0C\u8F93\u5165\u4ECD\u5DF2\u4FDD\u7559\u3002");let Ua=await Te(l,Xe,nr(k,J),Ct.signal,async()=>{let va=await pa(ce);if(!F.current||ie.binding!==$t(va)||pt&&re.localConversation?.sessionId!==Xe||J&&!va.projects?.some(_n=>_n.id===J.id))throw new Error("\u539F\u5FAE\u4FE1\u7ED1\u5B9A\u6216\u9879\u76EE\u8303\u56F4\u5DF2\u53D8\u5316\uFF0C\u672A\u653E\u5165\u539F\u751F\u8349\u7A3F\u3002\u8BF7\u5237\u65B0\u540E\u91CD\u65B0\u6838\u5BF9\uFF1B\u8F93\u5165\u4ECD\u4FDD\u7559\u3002")},()=>{if(!(t!==void 0&&p===void 0||re.draft!==k||re.selected!==ae||re.binding!==ie.binding))return re.draft="",F.current&&ka(""),()=>{re.draft===""&&re.selected===ae&&re.binding===ie.binding&&(re.draft=k,F.current&&ka(k))}},typeof v.SessionProvider=="function"&&typeof v.renderSlot=="function");F.current&&ie.binding===$t(Dt.current)&&Ua.status==="preserved"&&C("Dot \u4F1A\u8BDD\u91CC\u5DF2\u6709\u8349\u7A3F\uFF0C\u5DF2\u4E3A\u4F60\u4FDD\u7559\u3002\u8BF7\u5148\u6253\u5F00\u4F1A\u8BDD\u5904\u7406\uFF1B\u8FD9\u91CC\u7684\u65B0\u95EE\u9898\u4E5F\u4FDD\u7559\u7740\u3002")}catch(Rt){F.current&&H(Rt.message||"\u539F\u751F\u8349\u7A3F\u672A\u80FD\u51C6\u5907\uFF0C\u8BF7\u6253\u5F00 Dot \u4F1A\u8BDD\u6838\u5BF9\u3002")}finally{na&&r.release(na),qe.current=!1,Xt.current.delete(Ct),F.current&&ke(!1)}},ta=(t,s=Le)=>{if(!qe.current){if(ma.trim()&&ma!==t){C("\u5DF2\u4FDD\u7559\u4F60\u5C1A\u672A\u53D1\u9001\u7684\u8349\u7A3F\u3002\u8BF7\u5148\u5904\u7406\u5F53\u524D\u5185\u5BB9\u3002");return}if(un){ba(()=>{Do(t),so(s??""),Je("home"),po(t,St.find(p=>p.id===s),s??"").then(()=>{ve.current?.scrollIntoView?.({block:"nearest"});let p=re.localConversation;p&&r.focus(p)})});return}ba(()=>{Do(t),so(s??""),Je("home"),C("\u95EE\u9898\u5DF2\u653E\u5165\u8349\u7A3F\u3002\u70B9\u51FB\u201C\u5F00\u59CB\u5BF9\u8BDD\u201D\u5E26\u5165\u539F\u751F\u4F1A\u8BDD\u540E\uFF0C\u7531\u4F60\u53D1\u9001\u3002")})}},sr=[["\u7ED3\u5408\u8D44\u6599\u6392\u4E0B\u4E00\u6B65","\u8BF7\u7ED3\u5408\u6211\u6307\u5B9A\u7684\u4E2A\u4EBA\u8D44\u6599\u548C\u8FD9\u4E2A\u9879\u76EE\uFF0C\u6574\u7406\u4E00\u4EFD\u5E26\u6765\u6E90\u7684\u7B80\u62A5\uFF0C\u5217\u51FA\u503C\u5F97\u63A8\u8FDB\u7684\u51E0\u4EF6\u4E8B\u3002\u6839\u636E\u6211\u5DF2\u6709\u7684\u8BF4\u660E\u786E\u5B9A\u8303\u56F4\uFF1B\u786E\u5B9E\u7F3A\u5C11\u76EE\u6807\u6216\u8D44\u6599\u8303\u56F4\u65F6\uFF0C\u53EA\u95EE\u7F3A\u5C11\u7684\u90E8\u5206\u3002\u6682\u4E0D\u4EA4\u529E\u3001\u4E0D\u8BBE\u7F6E\u8DDF\u8FDB\u3002"],["\u770B\u770B\u9879\u76EE\u8FDB\u5C55","\u8BF7\u53EA\u8BFB\u770B\u770B\u8FD9\u4E2A\u9879\u76EE\u7684\u6700\u65B0\u8FDB\u5C55\u3001\u963B\u585E\u548C\u4E0B\u4E00\u6B65\u3002"],["\u4EA4\u4EE3\u4E00\u4EF6\u4E8B","\u8BF7\u5E2E\u6211\u5904\u7406\u8FD9\u4E2A\u9879\u76EE\u7684\u4E00\u4EF6\u4E8B\uFF1A"],["\u5B89\u6392\u4E00\u4E2A\u63D0\u9192","\u8BF7\u63D0\u9192\u6211\uFF1A"]],uo=async(t=rt,s=!1)=>{if(!t||qe.current)return;if(zo&&!s){ba(()=>{uo(t,!0)});return}jo();let p=qa(t.id),k=++_t.current;ea.current=p,D(t.id),fa(null),Xa(!1),Et("follow"),et(!1),Ut.current=!1;let J=re.follow.get(Ba(p)),ae=J??{mode:"once",time:"",cadence:60};Sn(ae.mode),Cn(ae.time),An(ae.cadence),sn.current=JSON.stringify({mode:"once",time:"",cadence:60});let ie=await Ga({action:"followup_status",projectId:t.id},p,k);ie&&_t.current===k&&ie.projectId===t.id&&fa(ie)},rr=async()=>{let t=ea.current,s=_t.current;if(!t?.projectId||!ia||!Fo||qe.current)return;let p;if(la==="repeat")p={action:"followup_configure",projectId:t.projectId,everyMinutes:Number(Ya),userRequested:!0};else{let ie=new Date(Na);if(!Na||!Number.isFinite(ie.getTime())||ie<=new Date||ie.getTime()>Date.now()+7*864e5){H("\u8BF7\u9009\u62E9\u672A\u6765\u4E03\u5929\u5185\u7684\u68C0\u67E5\u65F6\u95F4\u3002");return}p={action:"check_once",projectId:t.projectId,dueAt:ie.toISOString(),userRequested:!0}}Ut.current=!0;let k=await Ga(p,t,s);Ut.current=!1;let J=k?.[la==="repeat"?"followup":"once"];k?.projectId===t.projectId&&J?.enabled===!0&&(la==="repeat"?J.everyMinutes===Number(Ya):J.status==="queued"&&Date.parse(J.nextDueAt)===Date.parse(p.dueAt))?(re.follow.delete(Ba(t)),_t.current===s&&(fa(ie=>({...ie,...k})),Xa(!1),sn.current=JSON.stringify(mn())),C(`\u5DF2\u4E3A\u300C${t.projectLabel}\u300D\u4FDD\u5B58\u8DDF\u8FDB\u5B89\u6392\u3002\u6CA1\u6709\u5B9E\u8D28\u53D8\u5316\u65F6\u4FDD\u6301\u5B89\u9759\uFF1B\u7535\u8111\u4E0E Harness \u9700\u5728\u7EBF\u3002`),Vt()):k&&(C(`\u300C${t.projectLabel}\u300D\u7684\u5B89\u6392\u7ED3\u679C\u9700\u6838\u5BF9\uFF0C\u5C1A\u672A\u786E\u8BA4\u4FDD\u5B58\u3002\u8BF7\u67E5\u770B\u5F53\u524D\u5B89\u6392\uFF1B\u6CA1\u6709\u81EA\u52A8\u91CD\u8BD5\u3002`),_t.current===s&&Xa(!1),Vt())},ir=async t=>{let s=ea.current,p=_t.current;if(!s?.projectId||qe.current)return;Ut.current=!0;let k=await Ga({action:t==="once"?"cancel_once":"followup_cancel",projectId:s.projectId,userRequested:!0},s,p);Ut.current=!1,k&&k.projectId===s.projectId&&k[t==="once"?"once":"followup"]?.enabled===!1?(_t.current===p&&fa(J=>({...J,...k})),C(`\u5DF2\u5173\u95ED\u300C${s.projectLabel}\u300D\u7684\u8FD9\u9879\u8DDF\u8FDB\u3002`),Vt()):k&&(C(`\u300C${s.projectLabel}\u300D\u7684\u5173\u95ED\u7ED3\u679C\u9700\u6838\u5BF9\uFF0C\u8BF7\u67E5\u8BE2\u5F53\u524D\u5B89\u6392\uFF1B\u6CA1\u6709\u81EA\u52A8\u91CD\u8BD5\u3002`),Vt())},lr=async t=>{if(qe.current)return;jo();let s=++_t.current,p=qa(void 0,t.id);ea.current=p,In(null),Et("task"),et(!1);let k=await Ga({action:"task_detail",id:t.id},p,s);k&&_t.current===s&&Array.isArray(k.jobs)&&k.jobs.every(J=>J.id===t.id)&&In(k)},Kn=t=>{if(t.source.kind==="file")return t.source.reference;let s=t.source.reference.startsWith("session:")?t.source.reference.slice(8).split("#")[0]:null,p=s&&Y?.[s]?.displayTitle;return typeof p=="string"&&p.trim()?`\u6765\u6E90\u4F1A\u8BDD\uFF1A${p.slice(0,120)}`:"\u6765\u6E90\uFF1A\u9879\u76EE\u4F1A\u8BDD\u8BB0\u5F55"},gn=t=>t?.overview?.available===!0&&["goals","blockers","nextSteps","recent"].every(s=>Array.isArray(t.overview[s])&&t.overview[s].length<=4&&t.overview[s].every(p=>p&&Wt(p.id)&&typeof p.text=="string"&&p.source&&["user","assistant","file"].includes(p.source.kind)&&typeof p.source.reference=="string"&&p.verified===!1)),cr=t=>gn(t)?[...new Map([...t.overview.goals,...t.overview.blockers,...t.overview.nextSteps,...t.overview.recent].map(s=>[s.id,s])).values()]:[],hn=rt?.overview,Un=gn(rt),Qn=cr(rt),Zn=async(t,s=rt,p=!1)=>{if(!s||qe.current)return;if(zo&&!p){ba(()=>{Zn(t,s,!0)});return}jo();let k=++_t.current,J=qa(s.id,t.id);ea.current=J,D(s.id),qo(null),_o(""),eo(null),xo(!1),et(!1),Et("memory"),Ut.current=!1;let ae=await Ga({action:"memory_detail",projectId:s.id,id:t.id},J,k);if(!ae||_t.current!==k)return;if(ae.editable===!1||ae.redacted===!0){H("\u8FD9\u6761\u8BB0\u5FC6\u542B\u6709\u9690\u85CF\u5185\u5BB9\uFF0C\u8BF7\u5728 Dot \u4F1A\u8BDD\u4E2D\u6309\u539F\u59CB\u5185\u5BB9\u7EA0\u6B63\u6216\u5FD8\u8BB0\uFF1B\u672A\u5C06\u9690\u85CF\u540E\u7684\u526F\u672C\u4F5C\u4E3A\u7F16\u8F91\u539F\u6587\u3002");return}let ie=ae.record;if(ae.projectId!==s.id||!ie||ie.id!==t.id||typeof ie.text!="string"||!ie.text.trim()||Array.from(ie.text).length>2e3||!ie.source||!["user","assistant","file"].includes(ie.source.kind)||typeof ie.source.reference!="string"){H("\u5B8C\u6574\u8BB0\u5FC6\u6682\u4E0D\u53EF\u7528\uFF0C\u672A\u52A0\u8F7D\u9884\u89C8\u7247\u6BB5\u4F5C\u4E3A\u7F16\u8F91\u5185\u5BB9\u3002");return}let pt=re.memory.get(Ba(J));qo(ie),_o(pt?.original===ie.text?pt.text:ie.text),pt&&pt.original!==ie.text&&(eo(pt.text),C("\u8FD9\u6761\u8BB0\u5FC6\u7684\u539F\u6587\u5DF2\u53D8\u5316\uFF0C\u65E7\u8349\u7A3F\u672A\u5957\u7528\u3002\u4F60\u53EF\u4EE5\u5C55\u5F00\u4FDD\u7559\u7684\u8349\u7A3F\uFF0C\u4E0E\u5F53\u524D\u539F\u6587\u6838\u5BF9\u540E\u7EE7\u7EED\u4FEE\u6539\u3002"))},Jn=(t,s=rt)=>a("div",{className:"pc_dot_source",key:t.id},a("p",{className:"pc_dot_excerpt"},t.text),a("p",{className:"pc_dot_muted"},`${t.source.kind==="user"?"\u7528\u6237\u8BB0\u5F55":t.source.kind==="assistant"?"\u52A9\u624B\u8BB0\u5F55 \xB7 AI \u5F52\u7EB3":"\u6587\u4EF6\u8BB0\u5F55"} \xB7 ${yt(t.at)} \xB7 \u672A\u72EC\u7ACB\u6838\u9A8C`),a("small",{className:"pc_dot_muted"},Kn(t)),a("div",{className:"pc_dot_actions"},gt?null:pe("\u7EA0\u6B63\u6216\u5FD8\u8BB0",()=>Zn(t,s),{disabled:Pe||!ha}),pe("\u67E5\u770B\u6765\u6E90",()=>co(s.id,"sources")))),bn=(t,s,p)=>Tt(t,s?.length?s.map(k=>Jn(k)):a("p",{className:"pc_dot_muted"},p)),Yn=async t=>{let s=ea.current,p=_t.current;if(!s?.projectId||!Jt||s.id!==Jt.id||qe.current)return;Ut.current=!0;let k=await Ga({action:t?"memory_forget":"memory_update",projectId:s.projectId,id:s.id,...t?{}:{text:Sa.trim()},userRequested:!0},s,p);Ut.current=!1,k&&k.projectId===s.projectId&&k.id===s.id&&(t?k.forgotten===!0:k.updated===!0)?(re.memory.delete(Ba(s)),_t.current===p&&(Et("project"),wa("memory"),et(!1)),C(t?`\u5DF2\u5FD8\u8BB0\u300C${s.projectLabel}\u300D\u7684\u8FD9\u6761\u9879\u76EE\u8BB0\u5FC6\u3002`:`\u5DF2\u8BB0\u4F4F\u4F60\u5BF9\u300C${s.projectLabel}\u300D\u7684\u7EA0\u6B63\u3002`),await Vt()):k&&_t.current===p&&H("\u4FDD\u5B58\u56DE\u6267\u4E0E\u8FD9\u6761\u8BB0\u5FC6\u4E0D\u4E00\u81F4\uFF0C\u672A\u786E\u8BA4\u6210\u529F\u3002\u8BF7\u5237\u65B0\u72B6\u6001\u6838\u5BF9\uFF0C\u672A\u81EA\u52A8\u91CD\u8BD5\u3002")},dr=t=>t.sessionIds.map((s,p)=>{let k=Y?.[s],J=typeof k?.displayTitle=="string"&&k.displayTitle.trim()?k.displayTitle.slice(0,120):`\u4F1A\u8BDD ${p+1}`;return pe(a("span",null,J,a("small",{style:{display:"block"},className:"pc_dot_muted"},k?.displayTitle?k.running===!0?"\u6B63\u5728\u8FD0\u884C":k.running===!1?"\u5F53\u524D\u65E0\u8FD0\u884C\u4EFB\u52A1":"\u8FD0\u884C\u72B6\u6001\u5F85\u786E\u8BA4":"\u6807\u9898\u5C1A\u672A\u52A0\u8F7D \xB7 \u72B6\u6001\u5F85\u786E\u8BA4")),()=>Pt(s),{key:s})}),pr=()=>rt?a("article",{"data-dot-project":rt.id},a("div",{className:"pc_dot_drawer_tabs"},...[["summary","\u6982\u51B5"],["memory","\u8BB0\u4F4F\u7684\u4E8B"],["sources","\u6765\u6E90\u4E0E\u8BB0\u5F55"]].map(([t,s])=>pe(s,()=>wa(t),{"aria-pressed":Ra===t,className:Ra===t?"active":""}))),Ra==="summary"?a("div",null,Un?a("div",{"data-dot-overview":!0},bn("\u9879\u76EE\u76EE\u6807",hn.goals,"\u5C1A\u672A\u8BB0\u5F55\u9879\u76EE\u76EE\u6807\u3002\u53EF\u4EE5\u5728 Dot \u4F1A\u8BDD\u91CC\u544A\u8BC9\u6211\u4F60\u60F3\u8FBE\u6210\u4EC0\u4E48\u3002"),bn("\u5DF2\u8BB0\u5F55\u7684\u963B\u585E",hn.blockers,"\u5C1A\u672A\u8BB0\u5F55\u963B\u585E\uFF1B\u8FD9\u4E0D\u4EE3\u8868\u5F53\u524D\u6CA1\u6709\u963B\u585E\u3002"),bn("\u5DF2\u8BB0\u5F55\u7684\u4E0B\u4E00\u6B65",hn.nextSteps,"\u5C1A\u672A\u8BB0\u5F55\u4E0B\u4E00\u6B65\u3002")):Tt("\u9879\u76EE\u8BB0\u5FC6",a("p",{className:"pc_dot_muted"},"\u9879\u76EE\u8BB0\u5FC6\u6682\u4E0D\u53EF\u7528\u3002\u53EF\u5728\u6765\u6E90\u4E2D\u6838\u5BF9\u539F\u59CB\u8D44\u6599\u3002")),Tt("\u63A5\u4E0B\u6765\u53EF\u4EE5\u505A\u4EC0\u4E48",a("div",{className:"pc_dot_actions"},gt?a("p",{className:"pc_dot_muted"},"\u5728\u539F\u5FAE\u4FE1\u7EE7\u7EED\u4EA4\u4EE3\uFF0C\u8FD9\u91CC\u4FDD\u7559\u9879\u76EE\u80CC\u666F\u3001\u7ED3\u679C\u548C\u540E\u7EED\u5B89\u6392\u3002"):pe("\u548C Dot \u804A\u8FD9\u4E2A\u9879\u76EE",()=>po("\u8BF7\u7ED3\u5408\u8FD9\u4E2A\u9879\u76EE\u7684\u6700\u65B0\u8D44\u6599\uFF0C\u544A\u8BC9\u6211\u4E0B\u4E00\u6B65\u5148\u505A\u4EC0\u4E48\u3002"),{className:"pc_dot_primary"}),pe("\u67E5\u770B\u6216\u5B89\u6392\u8DDF\u8FDB",()=>uo(rt)))),Tt("\u9879\u76EE\u4F1A\u8BDD",rt.sessionIds.length===1?pe("\u6253\u5F00\u9879\u76EE\u4F1A\u8BDD",()=>Pt(rt.sessionIds[0])):rt.sessionIds.length?a("div",null,a("p",null,"\u9009\u62E9\u4F1A\u8BDD"),a("div",{className:"pc_dot_actions"},dr(rt))):a("p",{className:"pc_dot_muted"},"\u6682\u65E0\u53EF\u6253\u5F00\u7684\u9879\u76EE\u4F1A\u8BDD\u3002"))):Ra==="memory"?a("div",null,Tt("\u4F60\u544A\u8BC9 Dot \u7684\u4E8B",Un?Qn.length?Qn.map(t=>Jn(t)):a("p",{className:"pc_dot_muted"},"\u5C1A\u672A\u8BB0\u5F55\u9879\u76EE\u8BB0\u5FC6\u3002"):a("p",{className:"pc_dot_muted"},"\u9879\u76EE\u8BB0\u5FC6\u6682\u4E0D\u53EF\u7528\u3002")),gt?a("p",{className:"pc_dot_muted"},"\u5171\u4EAB\u5FAE\u4FE1\u5165\u53E3\u7684\u8BB0\u5FC6\u53EF\u67E5\u770B\uFF1B\u672C\u89C6\u56FE\u6682\u4E0D\u5F00\u653E\u8BB0\u5FC6\u589E\u6539\u3002"):pe("\u544A\u8BC9 Dot \u8981\u8BB0\u4F4F\u4EC0\u4E48",()=>po("\u8BF7\u8BB0\u4F4F\u8FD9\u4E2A\u9879\u76EE\u7684\u4E00\u70B9\u80CC\u666F\uFF1A"))):a("details",{className:"pc_dot_section",open:!0},a("summary",null,"\u539F\u59CB\u8D44\u6599\u4E0E\u5BF9\u8BDD"),Tt("\u9879\u76EE\u8D44\u6599",rt.sources.length?rt.sources.map(t=>a("div",{className:"pc_dot_source",key:t.name},a("strong",null,t.name),a("p",{className:"pc_dot_muted"},t.status==="ok"?yt(t.updatedAt??t.modifiedAt):t.status==="missing"?"\u5C1A\u672A\u63D0\u4F9B":"\u6682\u4E0D\u53EF\u8BFB\u53D6"),t.status==="ok"?a("pre",null,t.text):null,t.truncated?a("p",{className:"pc_dot_muted"},"\u6765\u6E90\u5185\u5BB9\u8F83\u957F\uFF0C\u5DF2\u622A\u53D6\uFF1B\u6B64\u5904\u672A\u5C55\u793A\u5B8C\u6574\u6587\u4EF6\u3002"):null)):a("p",null,"\u6682\u65E0\u9879\u76EE\u8D44\u6599\u3002")),Tt("\u6700\u8FD1\u5BF9\u8BDD",rt.events.length?rt.events.slice().reverse().map((t,s)=>a("div",{className:"pc_dot_source",key:s},a("p",{className:"pc_dot_muted"},`${rt.label} \xB7 ${t.kind==="user"?"\u7528\u6237\u4EA4\u4EE3":t.kind==="assistant"?"\u52A9\u624B\u56DE\u590D":"\u8FD0\u884C\u8BB0\u5F55"} \xB7 ${yt(t.at)}`),a("p",{className:"pc_dot_excerpt"},t.text),t.truncated?a("p",{className:"pc_dot_muted"},"\u5BF9\u8BDD\u7247\u6BB5\u5DF2\u622A\u53D6\uFF0C\u8BF7\u6253\u5F00\u539F\u59CB\u9879\u76EE\u4F1A\u8BDD\u67E5\u770B\u5B8C\u6574\u5185\u5BB9\u3002"):null)):a("p",null,"\u542F\u7528\u540E\u5C1A\u672A\u89C2\u5BDF\u5230\u65B0\u5BF9\u8BDD\u3002")))):null,ur=()=>a("div",null,a("p",{className:"pc_dot_muted"},`\u53EA\u8BFB\u68C0\u67E5\u300C${rt?.label??"\u6240\u9009\u9879\u76EE"}\u300D\uFF0C\u6709\u5B9E\u8D28\u53D8\u5316\u624D\u901A\u8FC7\u539F\u5FAE\u4FE1\u4F1A\u8BDD\u544A\u8BC9\u4F60\u3002\u7535\u8111\u4E0E Harness \u9700\u5728\u7EBF\u3002`),ia?a("div",null,...[["followup","\u6301\u7EED\u8DDF\u8FDB"],["once","\u5355\u6B21\u68C0\u67E5"]].map(([t,s])=>{let p=ia[t];return a("div",{className:"pc_dot_source",key:t},a("strong",null,s),a("p",null,p?.enabled?`${t==="followup"?Fn(p):"\u53EA\u68C0\u67E5\u4E00\u6B21"} \xB7 ${p.nextDueAt?`\u4E0B\u6B21 ${yt(p.nextDueAt)}`:"\u4E0B\u6B21\u65F6\u95F4\u5F85\u6838\u5BF9"}`:"\u5F53\u524D\u672A\u5F00\u542F"),p?.blocked?a("p",{className:"pc_dot_muted"},"\u5F53\u524D\u672A\u8FD0\u884C\uFF0C\u8BF7\u6838\u5BF9\u539F\u5FAE\u4FE1\u8FDE\u63A5\u3002"):p?.enabled&&p.running===!1?a("p",{className:"pc_dot_muted"},t==="once"?"\u7B49\u5F85\u5230\u671F\u68C0\u67E5\u3002":"\u5B89\u6392\u5DF2\u4FDD\u5B58\uFF0C\u8FD0\u884C\u5668\u672A\u542F\u52A8\uFF1B\u8BF7\u6838\u5BF9 Harness \u4E2D\u7684\u8DDF\u8FDB\u72B6\u6001\u3002"):null,p?.enabled&&!gt?pe("\u5173\u95ED\u8FD9\u9879\u8DDF\u8FDB",()=>ir(t)):null)}),gt?a("p",{className:"pc_dot_muted"},"\u8BF7\u5728\u539F\u5FAE\u4FE1\u5B89\u6392\u3001\u8C03\u6574\u6216\u53D6\u6D88\u8DDF\u8FDB\uFF1B\u8FD9\u91CC\u67E5\u770B\u5DF2\u4FDD\u5B58\u7684\u5B89\u6392\u3002"):a("div",{className:"pc_dot_source"},a("h3",null,Fo?"\u6838\u5BF9\u8FD9\u6B21\u5B89\u6392":"\u5B89\u6392\u4E0B\u4E00\u6B21"),Fo?a("div",null,a("p",null,`\u9879\u76EE\uFF1A${rt?.label}`),a("p",null,la==="repeat"?`\u9891\u7387\uFF1A\u6BCF ${Ya} \u5206\u949F\uFF0C\u53EA\u8BFB\u68C0\u67E5`:`\u65F6\u95F4\uFF1A${Na.replace("T"," ")}\uFF08\u672C\u673A\u6D4F\u89C8\u5668\u65F6\u533A\uFF1A${Intl.DateTimeFormat().resolvedOptions().timeZone}\uFF09`),a("p",null,"\u901A\u77E5\uFF1A\u539F\u5FAE\u4FE1\u4F1A\u8BDD\uFF1B\u6CA1\u6709\u5B9E\u8D28\u53D8\u5316\u65F6\u4FDD\u6301\u5B89\u9759\u3002"),a("div",{className:"pc_dot_actions"},pe("\u786E\u8BA4\u8DDF\u8FDB",rr,{className:"pc_dot_primary",disabled:Pe||!ha}),pe("\u8FD4\u56DE\u4FEE\u6539",()=>Xa(!1)))):a("div",null,a("label",null,"\u65B9\u5F0F",a("select",{value:la,disabled:Pe,onChange:t=>{qe.current||Sn(t.target.value)}},a("option",{value:"once"},"\u5728\u6307\u5B9A\u65F6\u95F4\u770B\u4E00\u6B21"),a("option",{value:"repeat"},"\u6309\u95F4\u9694\u6301\u7EED\u8DDF\u8FDB"))),la==="once"?a("label",null,"\u68C0\u67E5\u65F6\u95F4",a("input",{type:"datetime-local",value:Na,disabled:Pe,onChange:t=>{qe.current||Cn(t.target.value)}})):a("label",null,"\u6BCF\u9694",a("select",{value:Ya,disabled:Pe,onChange:t=>{qe.current||An(Number(t.target.value))}},...[30,60,180,360,1440].map(t=>a("option",{value:t,key:t},t===1440?"\u4E00\u5929":`${t} \u5206\u949F`)))),a("p",{className:"pc_dot_muted"},"\u5355\u6B21\u53EF\u5B89\u6392\u672A\u6765\u4E03\u5929\u5185\u7684\u68C0\u67E5\u3002\u5468\u671F\u8DDF\u8FDB\u9075\u5B88\u514D\u6253\u6270\u65F6\u6BB5\u548C\u6D88\u606F\u9884\u7B97\uFF1B\u63D0\u4EA4\u4F1A\u66F4\u65B0\u8FD9\u4E2A\u9879\u76EE\u540C\u7C7B\u578B\u7684\u5B89\u6392\u3002"),pe("\u6838\u5BF9\u5B89\u6392",()=>{if(la==="once"&&!Na){H("\u8BF7\u9009\u62E9\u68C0\u67E5\u65F6\u95F4\u3002");return}if(la==="once"){let t=new Date(Na);if(!Number.isFinite(t.getTime())||t<=new Date||t.getTime()>Date.now()+7*864e5){H("\u8BF7\u9009\u62E9\u672A\u6765\u4E03\u5929\u5185\u7684\u68C0\u67E5\u65F6\u95F4\u3002");return}}H(""),Xa(!0)},{className:"pc_dot_primary",disabled:Pe||!ha})))):a("p",{role:"status"},Ne?"\u5F53\u524D\u5B89\u6392\u5C1A\u672A\u786E\u8BA4\uFF1B\u8BF7\u91CD\u65B0\u67E5\u8BE2\u3002":"\u6B63\u5728\u67E5\u8BE2\u5F53\u524D\u5B89\u6392\u2026"),pe("\u5237\u65B0\u5B89\u6392",()=>uo(rt))),mr=()=>{let t=Array.isArray(Bo?.jobs)?Bo.jobs:[];return a("div",null,Bo?t.length?t.map(s=>a("article",{key:s.id},a("h3",null,s.projectLabel),a("p",null,s.task),a("p",{className:"pc_dot_muted"},`\u6267\u884C\uFF1A${Hn[s.status]??"\u72B6\u6001\u5F85\u786E\u8BA4"} \xB7 ${yt(s.finishedAt??s.createdAt)}`),a("p",{className:"pc_dot_muted"},`\u56DE\u4F20\uFF1A${Wn[s.delivery?.status]??"\u5C1A\u65E0\u53D1\u9001\u56DE\u6267"}`),a("pre",null,s.reply??s.text??"\u672C\u8F6E\u6CA1\u6709\u53EF\u5C55\u793A\u7684\u6587\u672C\u56DE\u590D\u3002"),s.replyTruncated?a("p",{className:"pc_dot_muted"},"\u672C\u6B21\u56DE\u590D\u5DF2\u622A\u53D6\uFF0C\u8BF7\u6253\u5F00\u4F1A\u8BDD\u770B\u5B8C\u6574\u5185\u5BB9\u3002"):null,a("p",{className:"pc_dot_muted"},"\u6765\u6E90\uFF1A\u8FD9\u6B21\u4EA4\u529E\u7684\u539F\u59CB\u56DE\u590D\uFF1B\u4ECD\u9700\u6838\u5BF9\u5185\u5BB9\u4E0E\u5B9E\u9645\u6210\u679C\u3002"),pe("\u6253\u5F00 Dot \u4F1A\u8BDD",()=>Pt(ge?.connection.sessionId)))):a("p",null,"\u6CA1\u6709\u8FD9\u6B21\u4EA4\u529E\u7684\u53EF\u7528\u8BE6\u60C5\u3002"):a("p",{role:"status"},Ne?"\u6267\u884C\u56DE\u590D\u6682\u4E0D\u53EF\u7528\u3002":"\u6B63\u5728\u8BFB\u53D6\u672C\u6B21\u56DE\u590D\u2026"))},fr=()=>Jt?a("div",null,a("p",{className:"pc_dot_muted"},`\u53EA\u4FEE\u6539\u300C${rt?.label}\u300D\u7684\u8FD9\u6761\u9879\u76EE\u8BB0\u5FC6\u3002\u7EA0\u6B63\u4F1A\u8BB0\u5F55\u4E3A\u4F60\u7684\u672C\u6B21\u8BF4\u660E\uFF0C\u5E76\u4FDD\u7559\u539F\u6765\u6E90\u8EAB\u4EFD\u3002`),a("p",{className:"pc_dot_muted"},`${Kn(Jt)} \xB7 ${yt(Jt.at)} \xB7 \u672A\u72EC\u7ACB\u6838\u9A8C`),Ps?a("div",null,a("p",null,"\u786E\u8BA4\u8BA9 Dot \u5FD8\u8BB0\u8FD9\u6761\u8BB0\u5FC6\uFF1F\u539F\u59CB\u9879\u76EE\u6587\u4EF6\u4E0D\u4F1A\u88AB\u4FEE\u6539\u3002"),a("div",{className:"pc_dot_actions"},pe("\u786E\u8BA4\u5FD8\u8BB0",()=>Yn(!0),{className:"pc_dot_primary"}),pe("\u8FD4\u56DE",()=>xo(!1)))):a("div",null,a("label",null,"\u8BB0\u5FC6\u5185\u5BB9",a("textarea",{"aria-label":"\u7EA0\u6B63\u9879\u76EE\u8BB0\u5FC6",maxLength:4e3,value:Sa,disabled:Pe,onChange:t=>{qe.current||_o(t.target.value)}})),a("div",{className:"pc_dot_actions"},pe("\u4FDD\u5B58\u7EA0\u6B63",()=>Yn(!1),{className:"pc_dot_primary",disabled:Pe||!Sa.trim()||Sa===Jt.text||Array.from(Sa.trim()).length>2e3}),pe("\u5FD8\u8BB0\u8FD9\u6761",()=>xo(!0))),a("p",{className:"pc_dot_muted"},"\u4E0D\u4F1A\u6539\u5199\u539F\u59CB\u5BF9\u8BDD\u3001\u9879\u76EE\u6587\u4EF6\u6216\u5176\u4ED6\u9879\u76EE\u7684\u8BB0\u5FC6\u3002"),Go?a("details",{"data-dot-conflict-draft":!0},a("summary",null,"\u67E5\u770B\u4FDD\u7559\u7684\u65E7\u8349\u7A3F"),a("p",{className:"pc_dot_muted"},"\u5F53\u524D\u539F\u6587\u5DF2\u6709\u66F4\u65B0\u3002\u4F7F\u7528\u8349\u7A3F\u53EA\u4F1A\u653E\u5165\u7F16\u8F91\u5668\uFF0C\u8BF7\u7ED3\u5408\u4E0A\u65B9\u539F\u6587\u6838\u5BF9\u540E\u518D\u4FDD\u5B58\u3002"),a("pre",null,Go),pe("\u4F7F\u7528\u4FDD\u7559\u8349\u7A3F\u7EE7\u7EED\u4FEE\u6539",()=>{_o(Go),eo(null)}),pe("\u653E\u5F03\u8FD9\u4EFD\u65E7\u8349\u7A3F",()=>{re.memory.delete(Ba(ea.current)),eo(null)})):null)):a("p",{role:"status"},Ne?"\u5B8C\u6574\u8BB0\u5FC6\u5C1A\u672A\u8BFB\u53D6\uFF0C\u672A\u5F00\u653E\u7F16\u8F91\u3002":"\u6B63\u5728\u8BFB\u53D6\u5B8C\u6574\u8BB0\u5FC6\u2026"),gr=t=>{let s=St.filter(p=>p.label===t.projectLabel);if(s.length!==1){C("\u8FD9\u6B21\u4EA4\u529E\u7684\u9879\u76EE\u8303\u56F4\u9700\u8981\u4F60\u6838\u5BF9\uFF0C\u8BF7\u5148\u5728\u5173\u6CE8\u7684\u9879\u76EE\u4E2D\u9009\u62E9\u5BF9\u5E94\u9879\u76EE\u3002"),lo("projects");return}ta(`\u5173\u4E8E\u300C${t.projectLabel}\u300D\u8FD9\u6B21\u4EA4\u529E\uFF1A${t.task}
|
|
2485
2485
|
\u4EA4\u529E\u8BB0\u5F55 ID\uFF1A${t.id}\u3002\u8BF7\u5148\u8BFB\u53D6\u8FD9\u6B21\u5DF2\u6709\u4EA4\u529E\u7ED3\u679C\uFF0C\u4E0D\u91CD\u65B0\u63D0\u4EA4\u6216\u91CD\u505A\u4EFB\u52A1\uFF0C\u518D\u89E3\u91CA\u672C\u6B21\u7ED3\u679C\u548C\u8FD8\u9700\u8981\u6211\u51B3\u5B9A\u7684\u4E8B\u3002`,s[0].id)},yn=[...Gn].reverse().sort((t,s)=>Date.parse(s.createdAt)-Date.parse(t.createdAt)),Ae=ge?.personalReview?.available===!0?ge.personalReview:null,aa=Ae?.review?.schedule,Wa=Ae?.review?.health,hr=async()=>{if(!F.current||qe.current||!Ae?.deliverySupported||!aa)return;let t=Ae.bindingRevision;qe.current=!0,ke(!0),H("");try{let s=await pa("/api/project_companion/review/attention",{enabled:Ae.review.attention?.enabled!==!0,expectedBindingRevision:t});F.current&&ro(Dt.current)===t&&C(s.text)}catch{F.current&&H("\u4E3B\u52A8\u5173\u6CE8\u8BBE\u7F6E\u672A\u66F4\u6539\u6216\u7ED3\u679C\u5F85\u6838\u5BF9\uFF0C\u8BF7\u5237\u65B0\u540E\u68C0\u67E5\u3002")}finally{qe.current=!1,F.current&&(ke(!1),await Vt())}},br="\u6BCF\u592909:00\u3001\u6BCF\u5468\u4E0009:00\uFF0C\u4F7F\u7528\u6211\u5728\u7535\u8111\u542F\u7528\u7684\u8D44\u6599\u548C\u5DF2\u5173\u6CE8\u9879\u76EE\u505A\u4E2A\u4EBA\u56DE\u987E\uFF0C\u4E3B\u52A8\u53D1\u73B0\u98CE\u9669\u3001\u622A\u6B62\u4E8B\u9879\u548C\u9879\u76EE\u8FDB\u5C55\uFF1B\u65E0\u53D8\u5316\u65F6\u4FDD\u6301\u5B89\u9759\u3002",yr=Tt("\u6BCF\u5929\u5C11\u6F0F\u4E00\u4EF6\u91CD\u8981\u7684\u4E8B",a("p",{className:"pc_dot_muted"},"\u628A\u8FD1\u671F\u90AE\u4EF6\u3001\u65E5\u7A0B\u3001\u7B14\u8BB0\u3001\u5F85\u529E\u548C\u9879\u76EE\u53D8\u5316\u653E\u5728\u4E00\u8D77\uFF0C\u770B\u6E05\u9700\u8981\u5904\u7406\u7684\u98CE\u9669\u4E0E\u622A\u6B62\u4E8B\u9879\u3002\u6BCF\u5929\u63D0\u9192\u91CD\u70B9\uFF0C\u6BCF\u5468\u56DE\u770B\u8FDB\u5C55\u3002"),Ae?.deliverySupported===!1?a("p",{className:"pc_dot_muted"},Ae.deliveryNote??"\u5F53\u524D\u901A\u9053\u53EA\u652F\u6301\u4E2A\u4EBA\u56DE\u987E\u9884\u89C8\uFF0C\u6682\u4E0D\u80FD\u5F00\u542F\u63A8\u9001\u3002"):null,a("p",null,Ae?Ae.review?.status==="enabled"?"\u4E2A\u4EBA\u56DE\u987E\u5DF2\u5F00\u542F":Ae.review?.status==="paused"?"\u4E2A\u4EBA\u56DE\u987E\u5DF2\u6682\u505C":"\u4E2A\u4EBA\u56DE\u987E\u672A\u5F00\u542F":"\u4E2A\u4EBA\u56DE\u987E\u72B6\u6001\u6682\u65E0\u6CD5\u786E\u8BA4\u3002"),Ae?.review?.status!=="off"&&aa?a("p",{className:"pc_dot_muted"},[aa.dailyTime?`\u6BCF\u5929 ${aa.dailyTime}`:"",Number.isInteger(aa.weeklyDay)&&aa.weeklyTime?`\u6BCF\u5468${["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"][aa.weeklyDay]} ${aa.weeklyTime}`:"",aa.timeZone].filter(Boolean).join(" \xB7 ")):null,Ae?.review?.attention?a("p",{className:"pc_dot_muted"},Ae.review.status==="paused"?"\u5DE5\u4F5C\u65F6\u6BB5\u4E3B\u52A8\u5173\u6CE8\u5DF2\u6682\u505C\u3002":Ae.review.attention.enabled===!0?["\u5DE5\u4F5C\u65F6\u6BB5\u4E3B\u52A8\u5173\u6CE8\u5DF2\u5F00\u542F",Ae.review.attention.quiet?"\u5F53\u524D\u5B89\u9759\u65F6\u6BB5":"",Ae.review.attention.nextRun?`\u4E0B\u6B21\u68C0\u67E5 ${yt(Ae.review.attention.nextRun)}`:"",Number.isInteger(Ae.review.attention.remaining)?`\u4ECA\u5929\u8FD8\u53EF\u63D0\u9192 ${Ae.review.attention.remaining} \u6B21`:""].filter(Boolean).join(" \xB7 "):Ae.review.attention.enabled===!1?"\u5DE5\u4F5C\u65F6\u6BB5\u4E3B\u52A8\u5173\u6CE8\u672A\u5F00\u542F\u3002":"\u5DE5\u4F5C\u65F6\u6BB5\u4E3B\u52A8\u5173\u6CE8\u72B6\u6001\u5F85\u786E\u8BA4\u3002"):null,Ae?.deliverySupported&&aa?pe(Ae.review.attention?.enabled?"\u5173\u95ED\u5DE5\u4F5C\u65F6\u6BB5\u4E3B\u52A8\u5173\u6CE8":"\u5F00\u542F\u5DE5\u4F5C\u65F6\u6BB5\u4E3B\u52A8\u5173\u6CE8",hr,{disabled:Pe||Ae.review.status==="paused"}):null,a("p",{className:"pc_dot_muted"},"\u5DE5\u4F5C\u65F6\u6BB5\uFF1A09:00\u201319:00\uFF0C\u6BCF\u4E24\u5C0F\u65F6\u68C0\u67E5\uFF1B\u91CD\u8981\u65B0\u98CE\u9669\u6216\u4E34\u671F\u4E8B\u9879\u624D\u63D0\u9192\uFF0C\u6BCF\u5929\u6700\u591A\u989D\u5916\u4E24\u6761\u3002\u6CBF\u7528\u73B0\u6709\u8D44\u6599\u8303\u56F4\u3002"),Ae?.review?.sources?.length||Ae?.review?.projects?.length?a("p",{className:"pc_dot_muted"},`\u8303\u56F4\uFF1A${Ae.review.sources?.length??0} \u4E2A\u8D44\u6599\u6765\u6E90\uFF0C${Ae.review.projects?.length??0} \u4E2A\u9879\u76EE\u3002\u53EA\u8BFB\u5DF2\u786E\u8BA4\u8303\u56F4\uFF0C\u53EF\u968F\u65F6\u6682\u505C\u6216\u53D6\u6D88\u3002`):null,Ae?.review?.jobs?.length?a("p",{className:"pc_dot_muted"},`\u6700\u8FD1\u4E00\u8F6E\uFF1A${yt(Ae.review.jobs.at(-1).createdAt)} \xB7 ${Ae.review.jobs.at(-1).detail??"\u72B6\u6001\u5F85\u6838\u5BF9"}`):null,Array.isArray(Ae?.review?.goals)&&Ae.review.goals.length?a("div",null,a("h3",null,"\u6B63\u5728\u8DDF\u8FDB\u7684\u76EE\u6807"),...Ae.review.goals.map((t,s)=>a("p",{key:s,className:"pc_dot_muted"},`${t.title} \xB7 ${{active:"\u8DDF\u8FDB\u4E2D",paused:"\u5DF2\u6682\u505C",completed:"\u5DF2\u5B8C\u6210"}[t.status]??"\u72B6\u6001\u5F85\u786E\u8BA4"}${t.meetingTitle?` \xB7 ${t.meetingTitle}`:""}`))):null,a("div",{className:"pc_dot_actions"},...gt?[]:[pe("\u5148\u770B\u4E00\u4EFD\u4E2A\u4EBA\u56DE\u987E",()=>ta("\u9884\u89C8\u4E00\u4EFD\u4E2A\u4EBA\u56DE\u987E\uFF0C\u4F7F\u7528\u6211\u5728\u7535\u8111\u542F\u7528\u7684\u8D44\u6599\u548C\u5DF2\u5173\u6CE8\u9879\u76EE\uFF0C\u4E0D\u5EFA\u7ACB\u8BA1\u5212\u3002",""),{disabled:Pe||!ha}),Ae?.deliverySupported===!1?null:pe(Ae?.review?.status==="enabled"?"\u8C03\u6574\u4E2A\u4EBA\u56DE\u987E":"\u5F00\u542F\u6BCF\u65E5\u4E0E\u6BCF\u5468\u56DE\u987E",()=>ta(br,""),{disabled:Pe||!ha})]),gt?a("p",{className:"pc_dot_muted"},"\u5728\u539F\u5FAE\u4FE1\u544A\u8BC9\u6211\u300C\u6BCF\u592909:00\u3001\u6BCF\u5468\u4E0009:00\uFF0C\u4F7F\u7528\u6211\u5728\u7535\u8111\u542F\u7528\u7684\u8D44\u6599\u548C\u5DF2\u5173\u6CE8\u9879\u76EE\u505A\u4E2A\u4EBA\u56DE\u987E\u300D\u5373\u53EF\u5F00\u542F\uFF1B\u4E5F\u53EF\u4EE5\u8BF4\u300C\u6682\u505C\u4E2A\u4EBA\u56DE\u987E\u300D\u3002"):a("p",{className:"pc_dot_muted"},"\u5148\u51C6\u5907\u4E00\u53E5\u8BDD\uFF0C\u7531\u4F60\u53D1\u9001\u540E\u542F\u7528\u3002\u6253\u5F00\u9875\u9762\u4E0D\u4F1A\u626B\u63CF\u8D44\u6599\u6216\u81EA\u52A8\u5EFA\u8BA1\u5212\u3002"),a("h3",null,"AI \u65E5\u62A5\uFF0C\u56F4\u7ED5\u4F60\u7684\u5173\u6CE8\u70B9"),a("p",{className:"pc_dot_muted"},!Ae?.news||Ae.news.topicSource==="unavailable"?"\u8D44\u8BAF\u5173\u6CE8\u70B9\u6682\u65E0\u6CD5\u786E\u8BA4\uFF0C\u8BF7\u5237\u65B0\u540E\u6838\u5BF9\u3002":Ae.news.topicSource==="explicit"&&Array.isArray(Ae.news.topics)?Ae.news.topics.join(" \xB7 "):"\u5C1A\u672A\u8BBE\u7F6E\u4E13\u5C5E\u5173\u6CE8\u70B9\uFF0C\u6CBF\u7528\u516C\u5F00 AI \u8D44\u8BAF\u4E3B\u9898\u3002"),gt?a("p",{className:"pc_dot_muted"},"\u5728\u5FAE\u4FE1\u8BF4\u300CAI \u65E5\u62A5\u5173\u6CE8\uFF1AAgent \u4EA7\u54C1\u3001\u63D2\u4EF6\u751F\u6001\u2026\u2026\u300D\u5373\u53EF\u4FDD\u5B58\u3002\u8D44\u8BAF\u53EA\u4F7F\u7528\u516C\u5F00\u6765\u6E90\uFF0C\u4E0D\u4F1A\u5E26\u5165\u79C1\u4EBA\u90AE\u4EF6\u3002"):pe("\u8C03\u6574\u8D44\u8BAF\u5173\u6CE8\u70B9",()=>ta("AI \u65E5\u62A5\u5173\u6CE8\uFF1A",""),{disabled:Pe||!ha}),a("p",{className:"pc_dot_muted"},"\u7535\u8111\u4E0E Harness \u9700\u4FDD\u6301\u5728\u7EBF\uFF1B\u6765\u6E90\u9650\u91CF\u8BFB\u53D6\uFF0C\u4E0D\u4EE3\u8868\u5168\u8D26\u53F7\u8986\u76D6\u3002")),Xn=St.flatMap(t=>t.followup?.available===!0?[["followup",t.followup.followup],["once",t.followup.once]].filter(([,s])=>s?.enabled===!0).map(([s,p])=>({project:t,kind:s,plan:p})):[]).sort((t,s)=>(Date.parse(t.plan.nextDueAt)||1/0)-(Date.parse(s.plan.nextDueAt)||1/0)),es=St.flatMap(t=>t.followup?.available===!0?[["followup",t.followup.followup],["once",t.followup.once]].filter(([,s])=>s&&typeof s.lastReviewedAt=="string"&&Number.isFinite(Date.parse(s.lastReviewedAt))).map(([s,p])=>({project:t,kind:s,plan:p})):[]).sort((t,s)=>Date.parse(s.plan.lastReviewedAt)-Date.parse(t.plan.lastReviewedAt)).slice(0,5),vr=Tt("\u4E0A\u6B21\u5DF2\u6838\u9A8C\u68C0\u67E5",es.length?es.map(({project:t,kind:s,plan:p})=>a("div",{className:"pc_dot_row",key:`checked:${t.id}:${s}`},a("div",null,a("strong",null,t.label),a("small",{className:"pc_dot_muted"},`${s==="once"?"\u5355\u6B21\u68C0\u67E5":"\u6301\u7EED\u8DDF\u8FDB"} \xB7 ${yt(p.lastReviewedAt)}`),a("p",{className:"pc_dot_muted"},p.lastCheckOutcome==="quiet"?"\u672C\u6B21\u53EF\u89C1\u8303\u56F4\u65E0\u65B0\u53D8\u5316\uFF0C\u5DF2\u9759\u9ED8\uFF1B\u4E0D\u4EE3\u8868\u5168\u8D26\u53F7\u65E0\u53D8\u5316\u3002":p.lastCheckOutcome==="partial"?"\u90E8\u5206\u6765\u6E90\u4ECD\u65E0\u6CD5\u786E\u8BA4\uFF1B\u8FD9\u662F\u68C0\u67E5\u8BB0\u5F55\uFF0C\u4E0D\u4EE3\u8868\u8D44\u6599\u5DF2\u5B8C\u6574\u8BFB\u53D6\u3002":"\u5DF2\u5B8C\u6210\u68C0\u67E5\u6D41\u7A0B\uFF1B\u5177\u4F53\u8D44\u6599\u4E0E\u7ED3\u679C\u89C1\u539F\u4F1A\u8BDD\u3002"),["failed","blocked","cancelled"].includes(p.status)?a("p",{className:"pc_dot_muted"},`\u5F53\u524D${p.status==="failed"?"\u68C0\u67E5\u5931\u8D25":p.status==="blocked"?"\u53D7\u963B":"\u5DF2\u53D6\u6D88"}\uFF0C\u4E0A\u65B9\u4E3A\u6B64\u524D\u5DF2\u6838\u9A8C\u8BB0\u5F55\u3002`):null),pe("\u67E5\u770B\u5B89\u6392",()=>uo(t)))):a("p",{className:"pc_dot_muted"},St.some(t=>t.followup?.available===!0)?"\u5C1A\u65E0\u5DF2\u6838\u9A8C\u68C0\u67E5\u8BB0\u5F55\u3002":"\u68C0\u67E5\u8BB0\u5F55\u6682\u65E0\u6CD5\u786E\u8BA4\uFF1B\u4E0D\u636E\u6B64\u5224\u65AD\u672A\u6267\u884C\u3002")),_r=Tt("\u4E0B\u4E00\u6B21\u8DDF\u8FDB",Xn.length?Xn.map(({project:t,kind:s,plan:p})=>a("div",{className:"pc_dot_row",key:`${t.id}:${s}`},a("div",null,a("strong",null,t.label),a("small",{className:"pc_dot_muted"},s==="once"?"\u5355\u6B21\u68C0\u67E5":Fn(p),p.blocked?" \xB7 \u5F53\u524D\u53D7\u963B":p.running===!1?s==="once"?" \xB7 \u7B49\u5F85\u5230\u671F":" \xB7 \u5DF2\u4FDD\u5B58\uFF0C\u8FD0\u884C\u5668\u672A\u542F\u52A8":"",p.loopId?" \xB7 \u542B\u5DF2\u9009\u4E2A\u4EBA\u8D44\u6599":""," \xB7 \u539F\u5FAE\u4FE1\u4F1A\u8BDD"),a("small",{className:"pc_dot_muted"},`\u4E0B\u6B21 ${yt(p.nextDueAt)}`)),pe("\u67E5\u770B\u5B89\u6392",()=>uo(t)))):St.some(t=>t.followup?.available===!1||!t.followup)?a("p",{className:"pc_dot_muted"},"\u9879\u76EE\u8DDF\u8FDB\u72B6\u6001\u5C1A\u672A\u786E\u8BA4\uFF0C\u53EF\u5728\u9879\u76EE\u8BE6\u60C5\u4E2D\u67E5\u8BE2\u3002"):a("p",{className:"pc_dot_muted"},"\u8FD8\u6CA1\u6709\u5F00\u542F\u9879\u76EE\u8DDF\u8FDB\u3002\u5148\u4EA4\u4EE3\u76EE\u6807\uFF0C\u518D\u51B3\u5B9A\u4EC0\u4E48\u65F6\u5019\u56DE\u6765\u770B\u770B\u3002"),Ta.plans?a("div",null,...$o.map(t=>a("div",{className:"pc_dot_row",key:t.id},a("div",null,a("strong",null,t.title),a("small",{className:"pc_dot_muted"},"\u660E\u786E\u63D0\u9192 \xB7 \u539F\u5FAE\u4FE1\u4F1A\u8BDD")),a("span",{className:"pc_dot_muted"},yt(t.dueAt)))),!gt&&!$o.length?a("p",{className:"pc_dot_muted"},"\u6682\u65E0\u5F85\u89E6\u53D1\u7684\u660E\u786E\u63D0\u9192\u3002"):null,ge?.counts?.activeReminders>$o.length?a("p",{className:"pc_dot_muted"},`\u4EC5\u663E\u793A ${$o.length} \u6761\u6D3B\u52A8\u63D0\u9192\uFF0C\u5176\u4F59\u8BF7\u5728 Dot \u4F1A\u8BDD\u4E2D\u67E5\u8BE2\u3002`):null,gt?null:a("p",{className:"pc_dot_muted"},ge?.daily?.enabled?`\u9879\u76EE\u8D44\u6599\u65E5\u62A5\uFF1A\u6BCF\u5929 ${ge.daily.time}\uFF08${ge.daily.timeZone}\uFF09`:"\u9879\u76EE\u8D44\u6599\u65E5\u62A5\u672A\u5F00\u542F\u3002"),a("div",{className:"pc_dot_actions"},gt?null:pe("\u5B89\u6392\u63D0\u9192",()=>ta("\u8BF7\u63D0\u9192\u6211\uFF1A","")),gt?null:pe("\u8BBE\u7F6E\u65E5\u62A5",()=>ta("\u8BF7\u5E2E\u6211\u8BBE\u7F6E\u9879\u76EE\u8D44\u6599\u65E5\u62A5\u3002\u5148\u548C\u6211\u786E\u8BA4\u6BCF\u5929\u7684\u53D1\u9001\u65F6\u95F4\u3001\u65F6\u533A\u548C\u5173\u6CE8\u9879\u76EE\uFF0C\u518D\u5F00\u542F\u3002","")))):a("p",{className:"pc_dot_muted"},gt?"\u5171\u4EAB\u5FAE\u4FE1\u7684\u63D0\u9192\u4E0E\u65E5\u62A5\uFF0C\u8BF7\u5728\u539F\u5FAE\u4FE1\u67E5\u8BE2\u6216\u5B89\u6392\uFF1B\u8FD9\u91CC\u4E0D\u6DF7\u5165\u72EC\u7ACB Dot \u4F1A\u8BDD\u7684\u65E7\u8BA1\u5212\u3002":"\u63D0\u9192\u4E0E\u65E5\u62A5\u72B6\u6001\u5C1A\u672A\u786E\u8BA4\uFF0C\u8BF7\u5237\u65B0\u6838\u5BF9\u3002")),xi=yn[0],Va=Qa(ge?.connection),oa=ge?.personalReview?.attentionItems,Ka=ge?.personalReview?.schedules,mo=oa?.available===!0&&Array.isArray(oa.items)?oa.items.slice(0,5):null,fo=Array.isArray(Ka?.items)?Ka.items.slice(0,12):null,ts=[Ta.projects?null:"\u5173\u6CE8\u9879\u76EE",Ta.jobs?null:"\u4EA4\u529E\u8BB0\u5F55",!gt&&!Ta.plans?"\u5DF2\u6709\u5B89\u6392":null,mo?oa.coverage==="unconfirmed"?"\u90E8\u5206\u4E8B\u9879\u8986\u76D6":null:"\u5F53\u524D\u4E8B\u9879",Ka?.available!==!0?"\u4E0B\u4E00\u6B21\u5B89\u6392":null,["unknown","failed"].includes(ge?.connection?.state)?"\u5FAE\u4FE1\u8FDE\u63A5":null].filter(Boolean),xr=!Va&&ts.length?a("div",{className:"pc_dot_statusline",role:"status","data-dot-recovery":!0},a("span",null,`${ts.join("\u3001")}\u8FD8\u5728\u6838\u5BF9\uFF1B\u4E0D\u5F71\u54CD\u4F60\u73B0\u5728\u5BF9\u8BDD\uFF0C\u539F\u6765\u7684\u5B89\u6392\u90FD\u4FDD\u7559\u3002`),pe("\u91CD\u8BD5\u72B6\u6001",Vt,{className:"pc_dot_text_button"}),pe("\u67E5\u770B\u8FDE\u63A5",()=>lo("settings"),{className:"pc_dot_text_button"})):null,wr=t=>a("article",{className:"pc_dot_update",key:t.id,"data-dot-job":t.id},a("p",{className:"pc_dot_muted"},`${t.projectLabel} \xB7 ${Hn[t.status]??"\u72B6\u6001\u5F85\u6838\u5BF9"}`),a("h3",null,t.task),t.result?.available===!0&&typeof t.result.text=="string"?a("p",{className:"pc_dot_excerpt"},t.result.text):null,t.result?.truncated?a("p",{className:"pc_dot_muted"},"\u539F\u56DE\u590D\u8F83\u957F\uFF0C\u6B64\u5904\u4E3A\u6458\u5F55\u3002"):null,t.delivery?a("p",{className:"pc_dot_muted"},Wn[t.delivery.status]??"\u56DE\u4F20\u72B6\u6001\u5F85\u6838\u5BF9"):null,a("div",{className:"pc_dot_actions"},pe("\u770B\u770B\u8FD9\u6B21\u7ED3\u679C",()=>lr(t)),gt?null:pe("\u548C Dot \u63A5\u7740\u804A",()=>gr(t)))),kr=()=>{Be.current?.focus?.(),Be.current?.scrollIntoView?.({block:"nearest"})},Nr=async()=>{if(!(!st||qe.current)){qe.current=!0,ke(!0);try{let t=await r.resolve(st);if(!t)throw Error("candidate unavailable");let s=await r.remember(t.sessionId);F.current&&(re.localConversation=t,We(t),Nt(null),C(s?"\u5DF2\u9009\u62E9\u4E0A\u6B21\u5BF9\u8BDD\uFF0C\u6CBF\u7528\u539F\u8349\u7A3F\u3002":"\u672C\u6B21\u53EF\u7EE7\u7EED\u4E0A\u6B21\u5BF9\u8BDD\uFF1B\u5165\u53E3\u6682\u672A\u4FDD\u5B58\uFF0C\u53EF\u4ECE\u539F\u751F\u5386\u53F2\u627E\u56DE\u3002"))}catch{F.current&&H("\u4E0A\u6B21\u5BF9\u8BDD\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u4ECE\u539F\u751F\u5386\u53F2\u6838\u5BF9\uFF1B\u5F53\u524D\u8349\u7A3F\u4ECD\u4FDD\u7559\u3002")}finally{qe.current=!1,F.current&&ke(!1)}}},Sr=async()=>{if(qe.current||!xt)return;qe.current=!0,ke(!0);let t=new AbortController;Xt.current.add(t);try{let s=await Mt(xt,t.signal);F.current&&(ka(re.draft),C(s.status==="applied"?"\u4FDD\u7559\u8349\u7A3F\u5DF2\u653E\u5165\u5F53\u524D\u539F\u751F\u4F1A\u8BDD\uFF0C\u7531\u4F60\u53D1\u9001\u3002":"\u539F\u751F\u4F1A\u8BDD\u5DF2\u6709\u8349\u7A3F\uFF0C\u7535\u8111\u539F\u6587\u7EE7\u7EED\u5B8C\u6574\u4FDD\u7559\u3002"))}catch{F.current&&H("\u8349\u7A3F\u672A\u80FD\u5E26\u5165\uFF1A\u539F\u5BF9\u8BDD\u6216\u8349\u7A3F\u8303\u56F4\u6682\u672A\u786E\u8BA4\u3002\u539F\u6587\u4ECD\u5B8C\u6574\u4FDD\u7559\uFF0C\u53EF\u590D\u5236\u540E\u7EE7\u7EED\u3002")}finally{Xt.current.delete(t),qe.current=!1,F.current&&ke(!1)}},go=tt?.state,Cr={missing:"\u5FAE\u4FE1\u6865\u63A5\u5C1A\u672A\u5C31\u7EEA\u3002\u5148\u5728\u7535\u8111\u4E0A\u804A\uFF0C\u4E5F\u53EF\u5230\u8FDE\u63A5\u9875\u67E5\u770B\u5FAE\u4FE1\u8BBE\u7F6E\u3002",unknown:"\u5FAE\u4FE1\u8FDE\u63A5\u72B6\u6001\u6682\u672A\u786E\u8BA4\uFF0C\u4FDD\u7559\u539F\u8FDE\u63A5\uFF1B\u5148\u5728\u7535\u8111\u4E0A\u7EE7\u7EED\u3002","waiting-qr":"\u5FAE\u4FE1\u626B\u4E00\u626B \xB7 \u7B49\u5F85\u626B\u7801",scanned:"\u5DF2\u626B\u7801\uFF0C\u8BF7\u5728\u624B\u673A\u4E0A\u786E\u8BA4\u3002","awaiting-message":"\u5DF2\u786E\u8BA4\u626B\u7801\u8D26\u53F7\u3002\u7528\u8FD9\u4E2A\u5FAE\u4FE1\u7ED9\u5C0F\u52A9\u624B\u53D1\u9001\u201C\u4F60\u597D\u201D\uFF0C\u5F00\u59CB\u804A\u5929\u3002",bound:"\u5FAE\u4FE1\u5DF2\u8FDE\u63A5\uFF0C\u6CBF\u7528\u5DF2\u6709\u5165\u53E3\u3002",failed:"\u5FAE\u4FE1\u8FDE\u63A5\u6682\u65F6\u53D7\u963B\u3002\u5148\u67E5\u770B\u5DF2\u6709\u8FDE\u63A5\u72B6\u6001\uFF0C\u4E0D\u4F1A\u91CD\u7F6E\u7ED1\u5B9A\u3002"},Ar=Va?a("section",{className:"pc_dot_inline_wechat","data-dot-inline-wechat":!0,"aria-label":"\u8FDE\u63A5\u5FAE\u4FE1"},a("div",{className:"pc_dot_pair_copy"},a("h2",null,go==="bound"?"\u5FAE\u4FE1\u5DF2\u8FDE\u63A5":"\u628A Dot \u5E26\u5230\u5FAE\u4FE1\u91CC"),a("p",null,"\u5728\u624B\u673A\u4E0A\u4EA4\u4EE3\u4EFB\u52A1\u3001\u6536\u7ED3\u679C\uFF0C\u4E5F\u80FD\u6536\u5230\u4F60\u5DF2\u5F00\u542F\u7684\u63D0\u9192\u3002"),pe("\u5148\u5728\u7535\u8111\u4E0A\u8BD5\u8BD5",kr,{className:"pc_dot_text_button"}),a("p",{className:"pc_dot_muted"},"\u7535\u8111\u548C Harness \u9700\u4FDD\u6301\u5728\u7EBF\u3002\u626B\u7801\u4E0D\u4F1A\u81EA\u52A8\u5F00\u542F\u63A8\u9001\u3002")),a("div",{className:"pc_dot_inline_code"},a("p",{role:"status"},At||(ua?"\u4E8C\u7EF4\u7801\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u5237\u65B0\u8FDE\u63A5\u72B6\u6001\u3002":Cr[go]??"\u6B63\u5728\u8BFB\u53D6\u73B0\u6709\u5FAE\u4FE1\u8FDE\u63A5\u2026")),go==="waiting-qr"&&tt?.qrAvailable===!0&&!ua?a("img",{src:"/wechat/api/qr-image"+(/^[a-f0-9]{16}$/.test(tt.qrRevision??"")?`?v=${tt.qrRevision}`:""),alt:"\u7528\u5FAE\u4FE1\u626B\u63CF\uFF0C\u8FDE\u63A5 Dot",onError:()=>xa(!0)}):null,pe("\u5237\u65B0\u8FDE\u63A5\u72B6\u6001",cn),go==="missing"||go==="failed"?pe("\u67E5\u770B\u5FAE\u4FE1\u8BBE\u7F6E",()=>lo("settings")):null)):null,Ir=un?a("section",{className:"pc_dot_hero","aria-label":"\u548C Dot \u7EE7\u7EED\u5BF9\u8BDD"},a("h1",null,"\u4ECA\u5929\u60F3\u505A\u4EC0\u4E48\uFF1F"),a("p",{className:"pc_dot_muted"},"\u8BF4\u4E00\u53E5\u8981\u505A\u7684\u4E8B\uFF0C\u6216\u8005\u63A5\u7740\u4E0A\u6B21\u804A\uFF1B\u9700\u8981\u8D44\u6599\u65F6\u518D\u8FDE\u3002"),Pa(xt,{busy:Pe,onApply:Sr,onCopy:()=>_a(C)}),a("div",{ref:ve,"data-dot-home-conversation":!0},Ie||fe?a("div",{"data-dot-native-placeholder":!0,style:{height:Ce.current},"aria-hidden":!0}):Gt?a("p",{className:"pc_dot_notice",role:"status"},"\u6B63\u5728\u5207\u6362\u5B8C\u6574\u5BF9\u8BDD\uFF0C\u539F\u8349\u7A3F\u4F1A\u4FDD\u7559\u3002"):a(m,{target:xt,SessionProvider:v.SessionProvider,renderSlot:v.renderSlot,onOpenHistory:()=>Pt(xt.sessionId),onReady:zt}))):a("section",{className:"pc_dot_hero"},a("h1",null,Va?"\u5148\u628A\u4E00\u4EF6\u4E8B\u4EA4\u7ED9 Dot\u3002":"\u4ECA\u5929\u60F3\u505A\u4EC0\u4E48\uFF1F"),a("p",{className:"pc_dot_muted"},"\u8BF4\u8BF4\u80CC\u666F\u548C\u76EE\u6807\uFF0C\u9700\u8981\u8D44\u6599\u65F6\u518D\u6309\u9700\u8FDE\u63A5\u3002"),a("div",{className:"pc_dot_composer"},a("textarea",{ref:Be,"aria-label":"\u4EA4\u4EE3\u7ED9 Dot \u7684\u4E8B\u60C5",placeholder:"\u628A\u80CC\u666F\u3001\u60F3\u505A\u7684\u4E8B\uFF0C\u6216\u521A\u521A\u53D8\u5316\u7684\u60C5\u51B5\u544A\u8BC9\u6211\u2026",maxLength:3500,value:ma,disabled:Pe,onChange:t=>{qe.current||Do(t.target.value)},onKeyDown:t=>{(t.metaKey||t.ctrlKey)&&t.key==="Enter"&&!t.isComposing&&t.keyCode!==229&&!t.nativeEvent?.isComposing&&(t.preventDefault(),po())}}),a("div",{className:"pc_dot_compose_bottom"},a("select",{"aria-label":"\u8FD9\u53E5\u8BDD\u5173\u8054\u7684\u9879\u76EE",value:Le??"",disabled:Pe,onChange:t=>{qe.current||so(t.target.value)}},a("option",{value:""},"\u4E0D\u5173\u8054\u9879\u76EE"),...St.map(t=>a("option",{value:t.id,key:t.id},t.label))),a("span",{className:"pc_dot_keyboard"},"\u2318 / Ctrl + Enter"),pe("\u5F00\u59CB\u5BF9\u8BDD",()=>po(),{className:"pc_dot_primary"}))),a("p",{className:"pc_dot_muted"},"\u5E26\u5165\u539F\u751F Dot \u4F1A\u8BDD\u540E\uFF0C\u7531\u4F60\u53D1\u9001\uFF1B\u5DF2\u6709\u4F1A\u8BDD\u8349\u7A3F\u4F1A\u4FDD\u7559\u3002"),st?pe("\u7EE7\u7EED\u4E0A\u6B21\u5BF9\u8BDD",Nr,{className:"pc_dot_text_button"}):null,a("div",{className:"pc_dot_actions pc_dot_shortcuts"},...sr.slice(0,3).map(([t,s])=>pe(t,()=>ta(s),{key:t})))),Dr=t=>a("div",{className:"pc_dot_item_source",key:`${t.source??""}:${t.title??""}`},a("strong",null,t.label||t.title||t.source||"\u6765\u6E90"),a("span",null,[t.source,t.at?yt(t.at):null,["metadata_only","metadata-only"].includes(t.contentState)?"\u4EC5\u6765\u6E90\u4FE1\u606F":null,t.contentState==="unread"?"\u6B63\u6587\u672A\u8BFB":null,t.contentState==="unavailable"?"\u5185\u5BB9\u5C1A\u672A\u786E\u8BA4":null,t.contentState==="actual_empty"?"\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A":null,t.truncated?"\u5185\u5BB9\u5DF2\u622A\u65AD":null].filter(Boolean).join(" \xB7 "))),jr=t=>a("article",{className:"pc_dot_attention_item",key:t.id,"data-dot-attention-item":t.id},a("div",{className:"pc_dot_item_kicker"},a("span",null,{deadline:"\u622A\u6B62\u4E8B\u9879",risk:"\u9700\u8981\u7559\u610F",invitation:"\u5F85\u786E\u8BA4\u9080\u8BF7",reply:"\u5F85\u56DE\u590D",change:"\u8FD1\u671F\u53D8\u5316",progress:"\u9879\u76EE\u8FDB\u5C55",event:"\u8FD1\u671F\u5B89\u6392"}[t.kind]??"\u5F53\u524D\u4E8B\u9879"),a("span",null,t.dueAt?`${t.dueAtBasis==="relative"?"\u4F30\u7B97\u671F\u9650":"\u622A\u6B62"} ${yt(t.dueAt)}`:t.eventStartAt?`\u5F00\u59CB ${yt(t.eventStartAt)}`:t.time?yt(t.time):"")),a("h3",null,t.title),typeof t.summary=="string"&&t.summary?a("p",{className:"pc_dot_item_summary"},t.summary):null,typeof t.why=="string"&&t.why?a("p",{className:"pc_dot_item_why"},t.why):null,typeof t.action=="string"&&t.action?a("p",{className:"pc_dot_item_next"},t.action):null,typeof t.unknown=="string"&&t.unknown?a("p",{className:"pc_dot_item_unknown"},`\u5F85\u786E\u8BA4\uFF1A${t.unknown}`):null,t.execution?a("p",{className:"pc_dot_muted","data-dot-item-execution":!0},{in_progress:"\u6B63\u5728\u6267\u884C",ready_for_review:"\u5DF2\u6709\u7ED3\u679C\uFF0C\u5F85\u4F60\u9A8C\u6536",blocked:"\u6267\u884C\u5F53\u524D\u53D7\u963B",unknown:"\u6267\u884C\u7ED3\u679C\u5C1A\u672A\u786E\u8BA4"}[t.execution.status]??"\u6267\u884C\u7ED3\u679C\u5C1A\u672A\u786E\u8BA4",t.execution.outdated===!0?" \xB7 \u4F9D\u636E\u5DF2\u6709\u66F4\u65B0\uFF0C\u6267\u884C\u7ED3\u679C\u57FA\u4E8E\u65E7\u7248\u8D44\u6599\uFF0C\u9700\u91CD\u65B0\u6838\u5BF9\u3002":null):null,t.confidence==="inferred"?a("p",{className:"pc_dot_muted"},"\u8FD9\u662F\u57FA\u4E8E\u5DF2\u4FDD\u5B58\u8D44\u6599\u7684\u5224\u65AD\uFF0C\u4ECD\u9700\u6838\u5BF9\u3002"):null,a("div",{className:"pc_dot_actions"},pe("\u548C Dot \u63A5\u7740\u804A",()=>ta(`\u8BF7\u51C6\u5907\u4E2A\u4EBA\u56DE\u987E\u300C${t.title}\u300D\u7684\u4E0B\u4E00\u6B65
|
|
2486
2486
|
\u4E8B\u9879 ID\uFF1A${t.id}
|
|
2487
|
-
\u8BF7\u5148\u6838\u5BF9\u539F\u4E8B\u9879\u53CA\u5DF2\u6388\u6743\u6765\u6E90\uFF0C\u518D\u5E2E\u6211\u68B3\u7406\u4E0B\u4E00\u6B65\uFF1B\u4E0D\u8981\u81EA\u52A8\u91CD\u505A\u65E7\u4EFB\u52A1\u6216\u6269\u5927\u8BFB\u53D6\u8303\u56F4\u3002`,"")),Array.isArray(t.sources)&&t.sources.length?a("details",null,a("summary",null,"\u67E5\u770B\u4F9D\u636E"),...t.sources.slice(0,5).map(Dr)):null)),$r=mo?Tt("\u503C\u5F97\u4F60\u7559\u610F",mo?mo.length?mo.map(jr):a("p",{className:"pc_dot_empty"},"\u5F53\u524D\u5DF2\u6838\u5BF9\u7684\u8303\u56F4\u5185\uFF0C\u6CA1\u6709\u5F85\u5904\u7406\u4E8B\u9879\u3002\u6709\u4E8B\u53EF\u4EE5\u76F4\u63A5\u544A\u8BC9 Dot\u3002"):a("p",{className:"pc_dot_empty"},"\u5F53\u524D\u4E8B\u9879\u5C1A\u672A\u6838\u5BF9\uFF0C\u6062\u590D\u5165\u53E3\u89C1\u4E0A\u65B9\u63D0\u793A\u3002"),typeof oa?.note=="string"&&oa.note?a("p",{className:"pc_dot_muted"},oa.note):null,oa?.truncated?a("p",{className:"pc_dot_muted"},"\u8FD9\u91CC\u53EA\u5C55\u793A\u6700\u8FD1 5 \u6761\u4E8B\u9879\uFF0C\u5176\u4ED6\u5185\u5BB9\u8BF7\u5728\u539F\u4F1A\u8BDD\u6838\u5BF9\u3002"):null):a("p",{className:"pc_dot_muted pc_dot_inline_note"},["\u5F53\u524D\u4E8B\u9879\u8FD8\u6CA1\u6838\u5BF9\u3002",typeof oa?.note=="string"?oa.note:null].filter(Boolean).join(" ")),Tr=t=>t.nextDueAt?yt(t.nextDueAt):[t.dailyTime?`\u6BCF\u5929 ${t.dailyTime}`:"",Number.isInteger(t.weeklyDay)&&t.weeklyTime?`\u6BCF\u5468${["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"][t.weeklyDay]} ${t.weeklyTime}`:"",Number.isInteger(t.everyMinutes)?`\u6BCF ${t.everyMinutes} \u5206\u949F`:""].filter(Boolean).join(" \xB7 ")||"\u4E0B\u6B21\u65F6\u95F4\u5F85\u786E\u8BA4",zr=a("section",{className:"pc_dot_section pc_dot_schedule","data-dot-schedule-rail":!0},a("h3",null,"\u4E0B\u4E00\u6B21\u5B89\u6392"),typeof Wa?.label=="string"&&Wa.label?a("p",{className:"pc_dot_muted","data-dot-review-health":!0},`\u6700\u8FD1\u8FD0\u884C\uFF1A${Wa.label}${Wa.at?" \xB7 "+yt(Wa.at):""}\u3002\u624B\u673A\u6536\u5230\u4ECD\u672A\u786E\u8BA4\u3002`):null,fo?fo.length?fo.map(t=>a("div",{className:"pc_dot_schedule_item",key:t.id},a("strong",null,t.title),a("span",{className:"pc_dot_plan_status"},{stored:"\u5DF2\u4FDD\u5B58",paused:"\u5DF2\u6682\u505C",blocked:"\u5F53\u524D\u53D7\u963B"}[t.status]??"\u72B6\u6001\u5F85\u6838\u5BF9"),a("p",null,Tr(t)),a("p",{className:"pc_dot_muted"},t.timeZone||"\u65F6\u533A\u5F85\u6838\u5BF9"),a("p",{className:"pc_dot_muted"},{"personal-review":"\u4E2A\u4EBA\u56DE\u987E",news:"AI \u65E5\u62A5","project-followup":"\u9879\u76EE\u8DDF\u8FDB"}[t.source]??"\u539F\u5B89\u6392"))):Ka?.available===!0?a("p",{className:"pc_dot_empty"},"\u5F53\u524D\u8303\u56F4\u6CA1\u6709\u5DF2\u4FDD\u5B58\u7684\u5B89\u6392\u3002\u60F3\u8DDF\u8FDB\u4E00\u4EF6\u4E8B\uFF0C\u53EF\u4EE5\u76F4\u63A5\u544A\u8BC9 Dot\u3002"):a("p",{className:"pc_dot_empty"},"\u5B89\u6392\u72B6\u6001\u89C1\u4E0A\u65B9\u63D0\u793A\u3002"):a("p",{className:"pc_dot_empty"},"\u5B89\u6392\u72B6\u6001\u89C1\u4E0A\u65B9\u63D0\u793A\u3002"),Ka?.available!==!0&&fo?.length?a("p",{className:"pc_dot_muted"},"\u90E8\u5206\u5B89\u6392\u5C1A\u672A\u786E\u8BA4\uFF1B\u8FD9\u91CC\u4FDD\u7559\u5DF2\u6838\u5BF9\u7684\u5B89\u6392\u3002"):null,fo?.length?a("p",{className:"pc_dot_rail_note"},Wa?"\u8FD9\u91CC\u663E\u793A\u5DF2\u4FDD\u5B58\u7684\u5B89\u6392\uFF1B\u624B\u673A\u6536\u5230\u4ECD\u672A\u786E\u8BA4\u3002":"\u8FD9\u91CC\u663E\u793A\u5DF2\u4FDD\u5B58\u7684\u5B89\u6392\uFF1B\u8FD0\u884C\u5C1A\u672A\u6838\u9A8C\uFF0C\u624B\u673A\u6536\u5230\u4ECD\u672A\u786E\u8BA4\u3002"):null,Ka?.truncated?a("p",{className:"pc_dot_muted"},"\u6B64\u5904\u4E3A\u6709\u9650\u5B89\u6392\uFF0C\u5176\u4F59\u8BF7\u5728\u539F\u5165\u53E3\u6838\u5BF9\u3002"):null),Er=Ta.jobs?a("details",{className:"pc_dot_history","data-dot-history":!0},a("summary",null,`\u627E\u5230\u4E4B\u524D\u804A\u8FC7\u7684\u4E8B\uFF08${Gn.length}\uFF09`),yn.length?yn.map(wr):a("p",{className:"pc_dot_muted"},"\u8FD9\u4E2A\u7A97\u53E3\u91CC\u8FD8\u6CA1\u6709\u4EA4\u529E\u8BB0\u5F55\u3002"),a("p",{className:"pc_dot_muted"},"\u8FD9\u91CC\u5C55\u793A\u6700\u8FD1\u7684\u6709\u9650\u8BB0\u5F55\uFF1B\u66F4\u65E9\u7684\u539F\u59CB\u5185\u5BB9\u5728 Dot \u4F1A\u8BDD\u4E2D\u3002"),xt?pe("\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD\u5386\u53F2",()=>Pt(xt.sessionId)):ha&&!gt?pe("\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD\u5386\u53F2",()=>Pt(ge.connection.sessionId)):null):null,Pr=Va&&!St.length?a("section",{className:"pc_dot_sample","data-dot-sample":!0,"aria-label":"\u793A\u4F8B\u7B80\u62A5"},a("div",{className:"pc_dot_sample_head"},a("span",{className:"pc_dot_badge"},"\u793A\u4F8B"),a("strong",null,"Dot \u4F1A\u628A\u4E00\u4EF6\u4E8B\u63A5\u6210\u8FD9\u6837\u7684\u7B80\u62A5")),a("ol",null,a("li",null,a("b",null,"\u8FDB\u5C55"),"\u4E09\u7BC7\u9605\u8BFB\u6750\u6599\u5DF2\u7ECF\u6574\u7406\u597D\uFF0C\u8BD5\u8BFB\u8BF4\u660E\u8FD8\u5DEE\u4E00\u7248\u3002"),a("li",null,a("b",null,"\u5361\u70B9"),"\u4F5C\u8005\u5E0C\u671B\u628A\u201C\u8BFB\u5B8C\u6709\u4EC0\u4E48\u6536\u83B7\u201D\u8BF4\u5F97\u66F4\u5177\u4F53\u3002"),a("li",null,a("b",null,"\u4E0B\u4E00\u6B65"),"\u5148\u627E 5 \u4F4D\u8BFB\u8005\u8BD5\u8BFB\u4E00\u5468\uFF0C\u518D\u51B3\u5B9A\u662F\u5426\u6269\u5927\u3002")),a("p",{className:"pc_dot_muted"},"\u8FD9\u662F\u793A\u4F8B\uFF0C\u4E0D\u662F\u4F60\u7684\u8D44\u6599\u3002\u8FDE\u4E0A\u9879\u76EE\u6216\u5FAE\u4FE1\u540E\uFF0CDot \u4F1A\u6309\u4F60\u7684\u6765\u6E90\u6574\u7406\u3002"),a("div",{className:"pc_dot_actions"},pe("\u7528\u8FD9\u4E2A\u4F8B\u5B50\u804A\u804A",()=>ta("\u8BF7\u53C2\u8003\u793A\u4F8B\u7B80\u62A5\u7684\u7ED3\u6784\uFF0C\u5E2E\u6211\u6574\u7406\u4E00\u4EF6\u6B63\u5728\u63A8\u8FDB\u7684\u4E8B\uFF1A\u5148\u53EA\u95EE\u6211\u7F3A\u7684\u76EE\u6807\u548C\u8303\u56F4\uFF0C\u518D\u7ED9\u6211\u8FDB\u5C55\u3001\u5361\u70B9\u548C\u4E0B\u4E00\u6B65\u3002"),{className:"pc_dot_text_button"}))):null,wi=a("div",null,xr,a("div",{className:"pc_dot_home_grid pc_dot_home_single"},a("div",{className:"pc_dot_column"},Ar,Ir,a(h,{controller:K,organizer:x,onOrganize:async()=>{await x.organize(K.getSnapshot().summary?.revision)&&lo("projects")}}),Pr,Va?a("p",{className:"pc_dot_intro"},"\u4E0D\u7528\u5148\u628A\u6240\u6709\u4E1C\u897F\u914D\u597D\u3002\u5148\u804A\u624B\u4E0A\u7684\u4EFB\u52A1\uFF0C\u7528\u5230\u90AE\u4EF6\u3001\u65E5\u7A0B\u6216\u9879\u76EE\u65F6\uFF0C\u518D\u8FDE\u63A5\u9700\u8981\u7684\u8D44\u6599\u3002"):$r,Er,a("details",{className:"pc_dot_legacy_details"},a("summary",null,"\u66F4\u591A\u539F\u4F1A\u8BDD\u5B89\u6392\u4E0E\u68C0\u67E5"),_r,vr)),a("details",{className:"pc_dot_more","aria-label":"\u5B89\u6392\u4E0E\u5173\u6CE8"},a("summary",null,"\u5B89\u6392\u4E0E\u5173\u6CE8"),Va?Tt("\u4ECE\u4F60\u624B\u4E0A\u7684\u4E8B\u5F00\u59CB",a("p",{className:"pc_dot_muted"},"\u5148\u4EA4\u4EE3\u4E00\u4E2A\u76EE\u6807\uFF0CDot \u4F1A\u63A5\u7740\u6574\u7406\u4E0B\u4E00\u6B65\u3002\u7528\u5230\u8D44\u6599\u65F6\u518D\u8FDE\u63A5\uFF1B\u60F3\u5B9A\u65F6\u8DDF\u8FDB\u65F6\u518D\u5B89\u6392\u3002")):zr,Tt("\u6B63\u5728\u5173\u6CE8",Ta.projects?St.length?St.map(t=>pe(a("span",null,a("strong",null,t.label),a("small",{className:"pc_dot_muted"},To(t)?`\u8D44\u6599\u66F4\u65B0 ${yt(To(t))}`:"\u5C1A\u65E0\u8FD1\u671F\u8D44\u6599")),()=>co(t.id),{key:t.id,className:"pc_dot_project_mini"})):a("p",{className:"pc_dot_muted"},"\u5148\u4ECE\u624B\u5934\u7684\u4E00\u4EF6\u4E8B\u5F00\u59CB\uFF0C\u9700\u8981\u65F6\u518D\u5173\u6CE8\u9879\u76EE\u3002"):a("p",{className:"pc_dot_muted"},"\u5173\u6CE8\u8303\u56F4\u89C1\u4E0A\u65B9\u63D0\u793A\u3002"),gt?null:pe("\u9009\u62E9\u5173\u6CE8\u9879\u76EE",()=>Kt(!0))),Ae?a("details",{className:"pc_dot_review_details"},a("summary",null,"\u4E2A\u4EBA\u56DE\u987E\u4E0E\u8D44\u8BAF\u8BBE\u7F6E"),yr):null))),Rr=Tt(`\u5168\u90E8\u9879\u76EE${it?` \xB7 ${it.total}`:""}`,a("p",{className:"pc_dot_muted"},"\u6309\u540D\u79F0\u627E\u5230 Harness \u5DF2\u767B\u8BB0\u7684\u9879\u76EE\uFF0C\u5355\u6B21\u67E5\u770B\u4E0D\u5360\u6301\u7EED\u5173\u6CE8\u540D\u989D\u3002\u5217\u76EE\u5F55\u4E0D\u4F1A\u8BFB\u53D6\u9879\u76EE\u5185\u5BB9\u3002"),ha?a("div",null,a("form",{"aria-label":"\u641C\u7D22\u5168\u90E8\u9879\u76EE",className:"pc_dot_actions",onSubmit:t=>{t.preventDefault(),io({query:Ho})}},a("input",{"aria-label":"\u641C\u7D22\u5168\u90E8\u9879\u76EE",placeholder:"\u8F93\u5165\u9879\u76EE\u540D\u79F0",maxLength:80,value:Ho,disabled:Ca,onChange:t=>Dn(t.target.value)}),a("button",{type:"submit",disabled:Ca},"\u641C\u7D22"),pe("\u5237\u65B0\u9879\u76EE\u76EE\u5F55",()=>io({query:Ho}),{disabled:Ca})),Ca?a("p",{role:"status",className:"pc_dot_muted"},"\u6B63\u5728\u8BFB\u53D6\u6240\u9009\u5185\u5BB9\u2026"):null,Wo?a("p",{role:"alert",className:"pc_dot_error"},Wo):null,it?a("div",null,a("p",{className:"pc_dot_muted"},`\u672C\u6B21\u5339\u914D ${it.matchedTotal} \u4E2A${it.items.length?` \xB7 \u663E\u793A ${it.offset+1}\u2013${it.offset+it.items.length}`:""}`),it.items.length?it.items.map(t=>a("div",{className:"pc_dot_row",key:t.id,"data-catalog-project":t.id},a("div",null,a("strong",null,t.label),a("small",{className:"pc_dot_muted"},t.disambiguator?`${t.disambiguator} \xB7 `:"",t.watched?"\u6B63\u5728\u6301\u7EED\u5173\u6CE8":"\u6309\u9700\u67E5\u770B")),pe("\u5355\u6B21\u67E5\u770B",()=>Zs(t),{disabled:Ca||ge?.paused===!0,"aria-label":`\u5355\u6B21\u67E5\u770B ${t.label}${t.disambiguator?` ${t.disambiguator}`:""}`}))):a("p",{className:"pc_dot_empty"},it.total?"\u6CA1\u6709\u5339\u914D\u7684\u9879\u76EE\uFF0C\u8BD5\u8BD5\u5176\u4ED6\u540D\u79F0\u3002":"Harness \u4E2D\u8FD8\u6CA1\u6709\u5DF2\u767B\u8BB0\u9879\u76EE\u3002"),a("div",{className:"pc_dot_actions"},pe("\u4E0A\u4E00\u9875",()=>io({query:it.query,offset:Math.max(0,it.offset-it.limit),expectedRevision:it.revision}),{disabled:Ca||it.offset===0}),pe("\u4E0B\u4E00\u9875",()=>io({query:it.query,offset:it.nextOffset,expectedRevision:it.revision}),{disabled:Ca||!it.hasMore}))):null,Vo?a("section",{className:"pc_dot_result","aria-label":"\u5355\u6B21\u9879\u76EE\u8D44\u6599"},a("div",{className:"pc_dot_header"},a("h3",null,Vo.project.label),pe("\u6536\u8D77\u8D44\u6599",()=>oo(null))),a("p",{className:"pc_dot_muted"},"\u672C\u6B21\u53EA\u8BFB\u9879\u76EE\u56FA\u5B9A\u8BF4\u660E\uFF1B\u4E0D\u4F1A\u52A0\u5165\u6301\u7EED\u5173\u6CE8\u3001\u8BFB\u53D6\u804A\u5929\u5386\u53F2\u6216\u521B\u5EFA\u8BA1\u5212\u3002"),...Vo.sources.map(t=>a("div",{className:"pc_dot_source",key:t.path},a("strong",null,t.path),a("p",{className:"pc_dot_muted"},t.modifiedAt?`\u66F4\u65B0 ${yt(t.modifiedAt)}`:"",t.truncated?" \xB7 \u5DF2\u622A\u65AD\uFF0C\u5F53\u524D\u9884\u89C8\u4E0D\u662F\u5B8C\u6574\u6587\u4EF6":""),t.status==="ok"?a("pre",null,t.text):a("p",{className:"pc_dot_muted"},t.status==="missing"?"\u8FD9\u4E2A\u6587\u4EF6\u4E0D\u5B58\u5728\uFF1B\u4E0D\u80FD\u636E\u6B64\u5224\u65AD\u9879\u76EE\u8FDB\u5C55\u3002":"\u8FD9\u4E2A\u6587\u4EF6\u5F53\u524D\u65E0\u6CD5\u8BFB\u53D6\u3002")))):null):a("p",{className:"pc_dot_empty"},"\u5148\u786E\u8BA4\u5FAE\u4FE1\u8FDE\u63A5\uFF0C\u518D\u67E5\u770B\u4F60\u7684\u9879\u76EE\u76EE\u5F55\u3002")),Or=a("div",null,a("div",{className:"pc_dot_header"},a("div",null,a("h1",null,"\u9879\u76EE"),a("p",{className:"pc_dot_muted"},"\u6240\u6709\u9879\u76EE\u90FD\u80FD\u6309\u9700\u67E5\u770B\uFF0C\u91CD\u8981\u7684\u4E8B\u518D\u6301\u7EED\u5173\u6CE8\u3002")),gt?null:pe("\u9009\u62E9\u5173\u6CE8\u9879\u76EE",()=>Kt(!0))),Rr,Tt(`\u6301\u7EED\u5173\u6CE8 \xB7 ${St.length}/5`,a("p",{className:"pc_dot_muted"},"\u80CC\u666F\u3001\u7ED3\u679C\u548C\u540E\u7EED\u5B89\u6392\uFF0C\u4ECE\u8FD9\u91CC\u63A5\u7740\u8D70\u3002\u5173\u6CE8\u540D\u989D\u53EA\u9650\u5236\u540E\u53F0\u8DDF\u8FDB\u3002"),Ta.projects?St.length?a("div",{className:"pc_dot_project_cards"},St.map(t=>a("article",{className:"pc_dot_project_card",key:t.id},a("p",{className:"pc_dot_eyebrow"},"\u9879\u76EE"),a("h2",null,t.label),a("p",{className:"pc_dot_muted"},To(t)?`\u4E0A\u6B21\u8D44\u6599\u66F4\u65B0 ${yt(To(t))}`:"\u5C1A\u65E0\u8FD1\u671F\u8D44\u6599"),a("p",{className:"pc_dot_excerpt"},gn(t)&&t.overview.nextSteps[0]?t.overview.nextSteps[0].text:"\u8FD8\u6CA1\u6709\u8BB0\u5F55\u4E0B\u4E00\u6B65\u3002\u76F4\u63A5\u8BF4\u8BF4\u4F60\u60F3\u63A8\u8FDB\u4EC0\u4E48\u3002"),a("div",{className:"pc_dot_actions"},pe("\u67E5\u770B\u9879\u76EE",()=>co(t.id)),gt?null:pe("\u7EE7\u7EED\u804A",()=>ta(`\u8BF7\u770B\u770B\u300C${t.label}\u300D\u7684\u6700\u65B0\u8FDB\u5C55\u3002`,t.id)),pe("\u6765\u6E90\u4E0E\u8BB0\u5F55",()=>co(t.id,"sources")))))):a("p",{className:"pc_dot_empty"},"\u8FD8\u6CA1\u6709\u5173\u6CE8\u9879\u76EE\u3002\u53EF\u4EE5\u5148\u8FDE\u63A5\u5FAE\u4FE1\uFF0C\u518D\u9009\u4E00\u4E2A\u9879\u76EE\u5F00\u59CB\u3002"):a("p",{className:"pc_dot_empty"},"\u5173\u6CE8\u5217\u8868\u6682\u4E0D\u53EF\u7528\u3002"))),ki=a("div",null,a(te,{controller:x,workspaceController:K}),a("details",{className:"pc_goal_legacy"},a("summary",null,"\u5DE5\u4F5C\u533A\u76EE\u5F55\u4E0E\u539F\u6709\u5173\u6CE8\u8BB0\u5F55"),a("p",{className:"pc_dot_muted"},"\u8FD9\u91CC\u4FDD\u7559\u65E7\u5173\u6CE8\u3001\u56FA\u5B9A\u8BF4\u660E\u548C\u5B89\u6392\u3002\u5DE5\u4F5C\u533A\u662F\u8D44\u6599\u5165\u53E3\uFF0C\u76EE\u6807\u9879\u76EE\u5728\u4E0A\u65B9\u7EC4\u7EC7\u3002"),Or)),Ni=yo(Ao&&!on?Oo():dt,{sample:Ao&&!on,loading:Fa.phase==="loading"}),Mr=async(t,s={})=>{let p=s.cardId?`${s.projectId}:${s.cardId}`:"";p&&["approve","retry"].includes(t)&&zn(k=>new Set(k).add(p));try{let k=await Ea("/api/project_companion/item",{action:t,...s});k?.openSession&&Wt(k.sessionId)?(C(k.text||"\u5DF2\u6253\u5F00\u8FD9\u4E2A\u4F1A\u8BDD\u3002"),await Pt(k.sessionId)):k?.fallback==="open_session"&&Wt(k.sessionId)?(C(k.text||M.today.toast.approveUnsupported),await Pt(k.sessionId)):k?.ok?(C(k.text||M.today.toast.handled),Tn(typeof k.undoId=="string"?k.undoId:"")):H(k?.revoked?"\u8FD9\u4E2A\u9879\u76EE\u7684\u6388\u6743\u5DF2\u7ECF\u6536\u56DE\uFF1B\u6CA1\u6709\u6267\u884C\u4EFB\u4F55\u52A8\u4F5C\u3002":k?.stale?"\u8FD9\u5F20\u5361\u7247\u5DF2\u7ECF\u8FC7\u671F\uFF0C\u4ECA\u5929\u9875\u5DF2\u5237\u65B0\uFF1B\u6CA1\u6709\u6267\u884C\u3002":k?.error||"\u64CD\u4F5C\u7ED3\u679C\u5F85\u6838\u5BF9\uFF1B\u672A\u81EA\u52A8\u91CD\u8BD5\u3002"),await kt.current.refreshNow()}catch(k){H(`${k?.message||"\u64CD\u4F5C\u7ED3\u679C\u5F85\u6838\u5BF9\u3002"} \u672A\u81EA\u52A8\u91CD\u8BD5\u3002`)}finally{p&&zn(k=>{let J=new Set(k);return J.delete(p),J})}},Lr=async()=>{if(Qo)try{let t=await Ea("/api/project_companion/item",{action:"undo",undoId:Qo});t?.ok?(C(t.text||"\u5DF2\u7ECF\u64A4\u9500\u3002"),Tn("")):H(t?.error||"\u8FD9\u6B21\u64A4\u9500\u6CA1\u6709\u5B8C\u6210\u3002"),await kt.current.refreshNow()}catch(t){H(t?.message||"\u8FD9\u6B21\u64A4\u9500\u6CA1\u6709\u5B8C\u6210\u3002")}},Fr=async t=>{en(!0),Ko(!0),It(""),se({dockOpen:!0});let s=await qn();try{let p=await Ea("/api/project_companion/say",{text:t});if(p?.fallback==="stage_draft"){if(dn(t),p.foregroundChanged===!0){It("\u524D\u53F0\u4F1A\u8BDD\u5DF2\u7ECF\u5207\u6362\uFF1B\u539F\u8BDD\u4FDD\u7559\u5728\u4E0B\u65B9\uFF0C\u6CA1\u6709\u6295\u5230\u65E7\u4F1A\u8BDD\u3002");return}if(!s){It("\u8FD8\u6CA1\u6709\u53EF\u7528\u7684\u539F\u751F\u4F1A\u8BDD\uFF1B\u539F\u8BDD\u4FDD\u7559\u5728\u4E0B\u65B9\uFF0C\u4E0D\u4F1A\u4E22\u3002");return}try{(await Te(l,s.sessionId,t,AbortSignal.timeout(15e3),null,void 0,!0))?.status==="applied"?(It("\u5DF2\u653E\u8FDB\u539F\u751F\u8F93\u5165\u6846\uFF0C\u6309\u56DE\u8F66\u7531\u4F60\u53D1\u9001\uFF1B\u539F\u8BDD\u4E5F\u4FDD\u7559\u5728\u4E0B\u65B9\u3002"),r.focus(s)):It("\u539F\u751F\u5BF9\u8BDD\u5DF2\u6709\u8349\u7A3F\uFF0C\u539F\u8BDD\u4FDD\u7559\u5728\u4E0B\u65B9\uFF1B\u6CA1\u6709\u8986\u76D6\u3002")}catch{It("\u539F\u751F\u8F93\u5165\u6846\u6682\u4E0D\u53EF\u7528\uFF1B\u539F\u8BDD\u4FDD\u7559\u5728\u4E0B\u65B9\uFF0C\u53EF\u4EE5\u590D\u5236\u540E\u7EE7\u7EED\u3002")}return}if(!p?.ok)throw new Error(p?.error||M.today.toast.sayFailed);C(p.text||"\u6536\u5230\uFF0C\u6211\u53BB\u529E\u3002"),It(p.mode==="steer"?"\u524D\u53F0\u6B63\u5728\u8DD1\uFF0C\u8FD9\u53E5\u8BDD\u6309\u63D2\u8BDD\u6295\u9012\u4E86\u3002":"\u5DF2\u6295\u7ED9\u524D\u53F0\u4F1A\u8BDD\uFF1B\u7B49\u5B83\u63A5\u5230\u540E\u7684\u8D26\u672C\u56DE\u6267\u3002"),await kt.current.refreshNow()}catch(p){dn(t),H(p?.message||M.today.toast.sayFailed)}},Eo=(t="")=>{typeof t=="string"&&t&&Yo(t),setTimeout(()=>{try{document.querySelector("[data-muse-capsule-input]")?.focus?.()}catch{}},0)},Br=t=>{Yo(s=>s.trim()?`${s.trim()} ${t}`:t),pn(),Eo()},ya=async(t={})=>{if(!F.current)return null;Oa.current++,H(""),ke(!0);try{let s=await Ea("/api/project_companion/muse",t);if(F.current&&s&&typeof s=="object"&&(Oa.current++,En(p=>js(p,s))),!s?.ok)return F.current&&H(s?.error||"\u64CD\u4F5C\u6CA1\u6709\u5B8C\u6210\uFF0C\u8BF7\u5237\u65B0\u6838\u5BF9\u3002"),s;if(F.current){if(s.undoToken){let p=t.action==="dossier_act";No({token:s.undoToken,kind:p?"dossier":"profile",message:s.text||(p?"\u5DF2\u529E\u59A5\u3002":"\u521A\u624D\u90A3\u6761\u8BB0\u5FC6\u5DF2\u7ECF\u66F4\u65B0\u3002"),expiresAt:s.undoExpiresAt})}else(t.action==="profile_undo"||t.action==="dossier_undo")&&No(null);s.text&&C(s.text)}return["superagent_pending","rhythm_configure","routine_toggle","workspace_brief_refresh","promise_draft_save","promise_draft_reset","dossier_act","dossier_undo","connector_toggle"].includes(t.action)&&await kt.current.refreshNow(),s}catch(s){return F.current&&H(s?.message||"\u64CD\u4F5C\u6CA1\u6709\u5B8C\u6210\uFF0C\u8BF7\u5237\u65B0\u6838\u5BF9\u3002"),null}finally{F.current&&ke(!1)}},ho=()=>{Ia.current&&(clearInterval(Ia.current),Ia.current=null)},qr=async t=>{if(!F.current)return;if(t==="wechat"){Kt(!0);return}let s={google_suite:{authAction:"google_suite_authorize",authKey:"googleSuiteAuth",target:["https://accounts.google.com","/o/oauth2/v2/auth"],sources:["gmail","calendar","drive"],label:"Google"},flomo:{authAction:"flomo_authorize",authKey:"flomoAuth",target:["https://flomoapp.com","/integration/grant"],sources:["flomo"],label:"flomo"},dida:{authAction:"dida_authorize",authKey:"didaAuth",target:["https://dida365.com","/oauth/authorize"],sources:["dida"],label:"\u6EF4\u7B54\u6E05\u5355"}}[t];if(!s)return;ho(),H(""),ca({id:t,phase:"starting",message:"\u6B63\u5728\u6253\u5F00\u6388\u6743\u9875\u2026"});let p=async J=>{let ae=await fetch("/api/project_companion/context",{method:J===void 0?"GET":"POST",credentials:"same-origin",redirect:"error",cache:"no-store",...J!==void 0?{headers:{"Content-Type":"application/json"},body:JSON.stringify(J)}:{}}),ie={};try{ie=await ae.json()}catch{}if(!ae.ok)throw Object.assign(new Error(ie?.error||"\u6682\u65F6\u65E0\u6CD5\u6253\u5F00\u6388\u6743\u9875\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"),{code:ie?.code});return ie},k=async(J,ae)=>{let ie=typeof J?.bindingRevision=="string"?J.bindingRevision:null;for(let pt of ae){let Xe=J?.sources?.find(Ct=>Ct.id===pt);Xe?.configured===!0&&Xe.enabled!==!0&&await p({action:"connect",source:pt,...ie?{expectedBindingRevision:ie}:{}})}};try{let J=await p();if(!F.current)return;if(t==="google_suite"?J.googleSuiteAuth?.refreshConfigured===!0&&(J.googleSuiteAuth.grantedSources||[]).length>0:!!J.sources?.some(na=>s.sources.includes(na.id)&&na.configured===!0)){if(await k(J,t==="google_suite"?J.googleSuiteAuth.grantedSources:s.sources),!F.current)return;await ga({includeContext:!0}),await kt.current.refreshNow(),F.current&&ca(null);return}let ie=typeof J?.bindingRevision=="string"?J.bindingRevision:null,pt=await p({action:s.authAction,...ie?{expectedBindingRevision:ie}:{}});if(!F.current)return;let Xe=new URL(pt?.url);if(Xe.origin!==s.target[0]||Xe.pathname!==s.target[1]||Xe.username||Xe.password||Xe.hash||typeof pt?.expiresAt!="string"||!Number.isFinite(Date.parse(pt.expiresAt))||Date.parse(pt.expiresAt)<=Date.now())throw new Error("\u6388\u6743\u94FE\u63A5\u65E0\u6548\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002");try{window.open?.(Xe.toString(),"_blank","noopener,noreferrer")}catch{}let Ct=Math.min(Date.parse(pt.expiresAt),Date.now()+3e5);ca({id:t,phase:"waiting",url:Xe.toString(),deadline:Ct,remaining:Math.max(0,Math.ceil((Ct-Date.now())/1e3)),label:s.label}),Ia.current=setInterval(async()=>{if(!F.current){ho();return}let na=Math.max(0,Math.ceil((Ct-Date.now())/1e3));if(ca(Rt=>Rt&&Rt.id===t&&Rt.phase==="waiting"?{...Rt,remaining:na}:Rt),na<=0){ho(),ca({id:t,phase:"error",message:"\u6388\u6743\u94FE\u63A5\u5DF2\u8FC7\u671F\uFF0C\u70B9\u53F3\u4FA7\u6309\u94AE\u5373\u53EF\u91CD\u65B0\u6253\u5F00\u3002"});return}try{let Rt=await p();if(!F.current)return;let Ua=Rt?.[s.authKey];if(!Ua?.authInProgress)if(ho(),Ua?.lastAttempt?.status==="failed")ca({id:t,phase:"error",message:"\u672C\u6B21\u6388\u6743\u672A\u5B8C\u6210\uFF0C\u8BF7\u91CD\u8BD5\u3002"});else if(Ua?.refreshConfigured===!0||Rt?.sources?.some(va=>s.sources.includes(va.id)&&va.configured===!0)){if(await k(Rt,t==="google_suite"&&Ua?.grantedSources||s.sources),!F.current)return;await ga({includeContext:!0}),await kt.current.refreshNow(),F.current&&ca(null)}else ca({id:t,phase:"error",message:"\u5C1A\u672A\u786E\u8BA4\u4FDD\u5B58\u6388\u6743\uFF0C\u8BF7\u91CD\u8BD5\u3002"})}catch{}},2e3)}catch(J){if(ho(),F.current){let ae=J?.code==="GOOGLE_CONNECTION_UNAVAILABLE"?"\u6682\u65F6\u8FDE\u4E0D\u5230 Google \u6388\u6743\u63A5\u53E3\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC/\u4EE3\u7406\u540E\u518D\u70B9\u4E00\u6B21\u3002":J?.message||"\u6682\u65F6\u65E0\u6CD5\u6253\u5F00\u6388\u6743\u9875\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002";ca({id:t,phase:"error",message:ae})}}},bo=()=>{Da.current&&(clearInterval(Da.current),Da.current=null)},za=async t=>{let s=await fetch("/api/project_companion/context",{method:t===void 0?"GET":"POST",credentials:"same-origin",redirect:"error",cache:"no-store",...t!==void 0?{headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}:{}}),p={};try{p=await s.json()}catch{}if(!s.ok)throw Object.assign(new Error(p?.error||"\u64CD\u4F5C\u5C1A\u672A\u751F\u6548\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"),{code:p?.code});return p},as=t=>(t?.googleWorkspaceMcp?.accounts||[]).map(s=>`${s.id}:${s.authorizedAt}:${(s.grantedServices||[]).join(",")}`).join("|"),Gr=async({loginHint:t="",addAccount:s=!1}={})=>{if(F.current){bo(),H(""),Yt({phase:"starting",message:"\u6B63\u5728\u6253\u5F00 Google \u6388\u6743\u9875\u2026"});try{let p=await za();if(!F.current)return;no(p);let k=as(p),J=typeof p?.bindingRevision=="string"?p.bindingRevision:null,ae=await za({action:"google_mcp_authorize",...t?{loginHint:t}:{},...s?{addAccount:!0}:{},...J?{expectedBindingRevision:J}:{}});if(!F.current)return;let ie=new URL(ae?.url);if(ie.origin!=="https://accounts.google.com"||ie.pathname!=="/o/oauth2/v2/auth"||ie.username||ie.password||ie.hash||typeof ae?.expiresAt!="string"||!Number.isFinite(Date.parse(ae.expiresAt))||Date.parse(ae.expiresAt)<=Date.now())throw new Error("\u6388\u6743\u94FE\u63A5\u65E0\u6548\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002");try{window.open?.(ie.toString(),"_blank","noopener,noreferrer")}catch{}let pt=Math.min(Date.parse(ae.expiresAt),Date.now()+3e5);Yt({phase:"waiting",url:ie.toString(),deadline:pt,remaining:Math.max(0,Math.ceil((pt-Date.now())/1e3)),loginHint:t}),Da.current=setInterval(async()=>{if(!F.current){bo();return}let Xe=Math.max(0,Math.ceil((pt-Date.now())/1e3));if(Yt(Ct=>Ct&&Ct.phase==="waiting"?{...Ct,remaining:Xe}:Ct),Xe<=0){bo(),Yt({phase:"error",message:"\u6388\u6743\u94FE\u63A5\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u518D\u6B21\u70B9\u51FB\u8FDE\u63A5 Google \u8D26\u53F7\u3002"});return}try{let Ct=await za();if(!F.current)return;as(Ct)!==k&&(bo(),no(Ct),Yt(null),await ga({includeContext:!1}),await kt.current.refreshNow())}catch{}},2e3)}catch(p){if(bo(),F.current){let k=p?.code==="GOOGLE_CONNECTION_UNAVAILABLE"?"\u6682\u65F6\u8FDE\u4E0D\u5230 Google \u6388\u6743\u63A5\u53E3\uFF0C\u8BF7\u68C0\u67E5\u672C\u673A\u7F51\u7EDC\u6216\u4EE3\u7406\u540E\u91CD\u8BD5\u3002":p?.message||"\u6682\u65F6\u65E0\u6CD5\u6253\u5F00 Google \u6388\u6743\u9875\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002";Yt({phase:"error",message:k})}}}},Hr=async(t,s,p)=>{if(!(!F.current||tn)){So(!0);try{let k=Ma??await za(),J=typeof k?.bindingRevision=="string"?k.bindingRevision:null,ae=await za({action:"google_mcp_toggle_service",accountId:t,service:s,enabled:p,...J?{expectedBindingRevision:J}:{}});if(!F.current)return;no(ae),Yt(null),await ga({includeContext:!1}),await kt.current.refreshNow()}catch(k){F.current&&Yt({phase:"error",message:k?.message||"\u5207\u6362\u670D\u52A1\u5F00\u5173\u5931\u8D25\uFF0C\u8BF7\u5237\u65B0\u91CD\u8BD5\u3002"})}finally{F.current&&So(!1)}}},Wr=async t=>{if(!(!F.current||tn)){So(!0);try{let s=Ma??await za(),p=typeof s?.bindingRevision=="string"?s.bindingRevision:null,k=await za({action:"google_mcp_disconnect",accountId:t,...p?{expectedBindingRevision:p}:{}});if(!F.current)return;no(k),Yt(null),await ga({includeContext:!1}),await kt.current.refreshNow()}catch(s){F.current&&Yt({phase:"error",message:s?.message||"\u65AD\u5F00\u8D26\u53F7\u5931\u8D25\uFF0C\u8BF7\u5237\u65B0\u91CD\u8BD5\u3002"})}finally{F.current&&So(!1)}}},Vr=async(t,s="")=>{if(t){H(""),ke(!0);try{let p=await Ea("/api/project_companion/promise",{promiseId:t,...typeof s=="string"&&s.trim()?{draftText:s.trim()}:{}});if(!p?.ok){F.current&&H(p?.error||"\u8FD9\u4EF6\u4E8B\u6682\u65F6\u6CA1\u80FD\u63A8\u51FA\u53BB\uFF0C\u8BF7\u5237\u65B0\u6838\u5BF9\u3002");return}F.current&&(C(p.text||"\u5DF2\u63A8\u7ED9\u524D\u53F0\u4F1A\u8BDD\u8DDF\u8FDB\u3002"),Pn(null)),await kt.current.refreshNow(),ga()}catch(p){F.current&&H(p?.message||"\u8FD9\u4EF6\u4E8B\u6682\u65F6\u6CA1\u80FD\u63A8\u51FA\u53BB\uFF0C\u8BF7\u5237\u65B0\u6838\u5BF9\u3002")}finally{F.current&&ke(!1)}}},Kr=t=>{t&&(t.type==="today_act"?Mr(t.act,{projectId:t.projectId,cardId:t.cardId}):t.type==="dispatch_promise"?Vr(t.promiseId,t.draftText):t.type==="ask"?Eo(t.prompt||""):t.type==="focus_capsule"?Eo(t.prefill||""):t.type==="queue_pending"?ya({action:"superagent_pending",text:t.text,title:t.title,workspacePath:t.workspacePath}):t.type==="refresh_workspace_brief"?ya({action:"workspace_brief_refresh"}):t.type==="open_brief"?Rn(!0):t.type==="open_workspace_picker"&&K.open())},Ur=t=>{if(!t){K.open();return}if(St.some(p=>p.id===t)){co(t);return}if(x.getSnapshot().status?.projects?.some(p=>p.id===t)){x.open(t);return}let s=(dt?.dots||[]).find(p=>p.projectId===t&&Wt(p.sessionId));s?Pt(s.sessionId):K.open()},Qr=Ao&&!on&&(dt?.access?.count??0)===0&&!Aa?.dossiers?.length&&!dt?.workspaceBrief?.workspaces?.length&&!Aa?.workspaceBrief?.workspaces?.length&&!dt?.digest?.lastDigest?.text&&!dt?.superagent?.milestones?.length?{...Oo(),sample:!0,superagent:dt?.superagent??Aa?.superagent,profile:dt?.profile??Aa?.profile,digest:dt?.digest??Aa?.digest,workspaceBrief:null,events:Array.isArray(dt?.events)?dt.events:[],connection:dt?.connection??Oo().connection}:dt,Zr=Is({activity:Qr,muse:Aa,workbench:ge,contextSnapshot:Ma,now:new Date,loading:Fa.phase==="loading"&&!dt,pinnedKey:Rs}),vn=!ct.skipped&&(dt?.access?.count??0)===0&&(Aa?.mountedWorkspaces?.length??0)===0&&(K.getSnapshot().summary?.selectedCount??0)===0,Po=e.useCallback(async(t="",s)=>{if(F.current){Bt(p=>({...p,loading:!0,error:""}));try{let p=await E("/api/project_companion/workspaces",{action:"list",query:t,offset:0,limit:50,...s?{pickedWorkspaceId:s}:{}});if(!F.current)return;let k=Array.isArray(p?.items)?p.items:[];Bt(J=>{let ae=s&&p?.pickedId?[...new Set([...J.selectedIds,p.pickedId])]:J.items===null&&Array.isArray(p?.selectedIds)?p.selectedIds:J.selectedIds;return{...J,items:k,meta:{revision:p?.revision,catalogRevision:p?.catalogRevision},selectedIds:ae,loading:!1,pickerOpen:!1}})}catch(p){F.current&&Bt(k=>({...k,loading:!1,error:p?.message||"\u5DE5\u4F5C\u533A\u5217\u8868\u6682\u65F6\u4E0D\u53EF\u7528\u3002"}))}}},[]);e.useEffect(()=>{vn&&ct.items===null&&!ct.loading&&Po("")},[vn,ct.items,ct.loading,Po]);let os=e.useCallback(async t=>{let s=t!==!1;if(Fs(s),!!s){ko(!0);try{let p=await ya({action:"mobile_pair_info"});F.current&&p?.ok&&p.pair&&On(p.pair)}finally{F.current&&ko(!1)}}},[]),ns=!!(P(l.slots)&&typeof v.renderFactorySlot=="function"),Jr={needed:vn,skipped:ct.skipped,items:ct.items||[],selectedIds:ct.selectedIds,query:ct.query,expanded:ct.expanded,loading:ct.loading,saving:ct.saving,error:ct.error,canPick:ns,pickerOpen:ct.pickerOpen,pickerBtnRef:Mn,onTogglePicker:()=>Bt(t=>({...t,pickerOpen:!t.pickerOpen})),renderFolderPicker:()=>ns?v.renderFactorySlot("workspace.picker",{open:ct.pickerOpen,anchorRef:Mn,selectedId:void 0,onPick:t=>{Po("",t)},onClose:()=>Bt(t=>({...t,pickerOpen:!1}))}):null,onQueryChange:t=>Bt(s=>({...s,query:t})),onSearch:t=>{Po(t)},onToggle:t=>Bt(s=>({...s,selectedIds:s.selectedIds.includes(t)?s.selectedIds.filter(p=>p!==t):[...s.selectedIds,t]})),onSelectAll:()=>Bt(t=>{let s=(t.items||[]).map(p=>p.id);return{...t,selectedIds:t.selectedIds.length>=s.length?[]:s}}),onExpandAll:()=>Bt(t=>({...t,expanded:!0})),onSkip:()=>{Bt(t=>({...t,skipped:!0})),os(!0)},onConfirm:async()=>{if(!(!ct.meta?.revision||!ct.meta?.catalogRevision||ct.selectedIds.length===0||ct.saving)){Bt(t=>({...t,saving:!0,error:""}));try{await E("/api/project_companion/workspaces",{action:"save",expectedRevision:ct.meta.revision,expectedCatalogRevision:ct.meta.catalogRevision,workspaceIds:ct.selectedIds});try{globalThis.localStorage?.setItem("dot.sample.cleared","1")}catch{}F.current&&(Ln(!0),Bt(t=>({...t,saving:!1,skipped:!0}))),await K.refresh(),await ya({action:"workspace_brief_refresh"}),await kt.current.refreshNow(),await Vt()}catch(t){F.current&&Bt(s=>({...s,saving:!1,error:t?.message||"\u4FDD\u5B58\u5DE5\u4F5C\u533A\u6388\u6743\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002"}))}}}},Yr=je?a("div",{className:"pc_dot_draft_review",role:"group","aria-label":"\u672A\u4FDD\u5B58\u7684\u4FEE\u6539"},a("h3",null,"\u8FD9\u6B21\u4FEE\u6539\u8FD8\u6CA1\u4FDD\u5B58"),a("p",null,"\u4FDD\u7559\u8349\u7A3F\u540E\uFF0C\u4E0B\u6B21\u6253\u5F00\u540C\u4E00\u9879\u76EE\u7684\u8FD9\u9879\u5185\u5BB9\u53EF\u7EE7\u7EED\u3002\u5173\u95ED\u4E0D\u4F1A\u4FDD\u5B58\u6B63\u5F0F\u8BB0\u5F55\u3002"),a("div",{className:"pc_dot_actions"},pe("\u7EE7\u7EED\u7F16\u8F91",()=>fn("continue"),{className:"pc_dot_primary",disabled:!1,autoFocus:!0}),pe("\u4FDD\u7559\u8349\u7A3F\u5E76\u79BB\u5F00",()=>fn("keep"),{disabled:!1}),pe("\u653E\u5F03\u4FEE\u6539\u5E76\u79BB\u5F00",()=>fn("discard"),{disabled:!1}))):null;return a("div",{className:"pc_dot_muse_shell",ref:ue,"data-dot-workbench":!0,style:{display:"flex",flexDirection:"column",height:"100%",minHeight:0,width:"100%",position:"relative"}},a(U,{model:Zr,tab:Zo,onTab:t=>{Jo(t),t==="connections"&&bt(!0)},busy:Pe,feedback:Ne?{kind:"error",text:Ne}:Z?{kind:"info",text:Z,actionLabel:Qo?"\u64A4\u9500":void 0,onAction:Lr}:null,undoBanner:La,onDismissUndo:()=>No(null),onAction:Kr,onSaveDraft:(t,s)=>ya({action:"promise_draft_save",promiseId:t.promiseId,text:s,what:t.title}),onMuseAct:ya,onPinFocus:t=>Pn(t),onAsk:t=>Eo(t),onOpenProject:Ur,onOpenSession:t=>{Pt(t)},onOpenWorkspacePicker:()=>{K.open()},onOpenSettings:()=>Kt(!0),capsuleDraft:Os,onCapsuleDraft:Yo,onCarryInsight:Br,conversationOpen:Xo,onToggleConversation:t=>{t?pn():Ys()},onSendChat:Fr,briefOpen:Ms,onBriefOpen:Rn,mobilePairOpen:Ls,mobilePairData:Bs,mobilePairLoading:qs,onOpenMobilePair:os,workspaceOnboarding:Jr,mobileHeroDismissed:Gs,onDismissMobileHero:()=>{try{globalThis.localStorage?.setItem("dot.mobile.hero.dismissed","1")}catch{}Hs(!0)},contextHintDismissed:Ws,onDismissContextHint:()=>{try{globalThis.localStorage?.setItem("dot.context.hint.dismissed","1")}catch{}Vs(!0)},onRotateMobilePair:async()=>{ko(!0);try{let t=await ya({action:"mobile_pair_rotate"});F.current&&t?.ok&&t.pair&&On(t.pair)}finally{F.current&&ko(!1)}},renderConversation:()=>a("div",{style:{display:"flex",flexDirection:"column",gap:10,height:"100%",minHeight:0}},jn?a("p",{className:"muse-notice-line",role:"status",style:{margin:0}},jn):null,Uo?a("div",{className:"muse-notice-line info",style:{margin:0,justifyContent:"space-between",gap:8}},a("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},`\u4FDD\u7559\u8349\u7A3F\uFF1A${Uo}`),a("div",{className:"muse-hairline-actions"},a("button",{type:"button",className:"muse-btn-link",onClick:()=>{try{navigator.clipboard?.writeText?.(Uo)}catch{}}},"\u590D\u5236"),a("button",{type:"button",className:"muse-btn-link",onClick:()=>$n("")},"\u6E05\u7A7A"))):null,xt&&un&&!Gt?a(m,{target:xt,owner:"dock",SessionProvider:v.SessionProvider,renderSlot:v.renderSlot,slotName:"dot.desktop.conversation",onOpenHistory:()=>Pt(xt.sessionId)}):a("p",{className:"muse-rail-empty",style:{padding:16}},xt?"\u539F\u751F\u5BF9\u8BDD\u8981\u5728\u5B8C\u6574 Harness \u7A97\u53E3\u4E2D\u6253\u5F00\uFF1B\u539F\u8BDD\u548C\u8349\u7A3F\u4ECD\u4FDD\u7559\u3002":"\u8FD8\u6CA1\u6709\u53EF\u7528\u7684\u539F\u751F\u5BF9\u8BDD\u3002\u8BF4\u4E00\u53E5\uFF0CDot \u4F1A\u5148\u5EFA\u4E00\u4E2A\u684C\u9762\u4F1A\u8BDD\u3002")),renderConnectionsHost:()=>a("div",{style:{paddingTop:12,display:"flex",flexDirection:"column",gap:14}},a(j,{controller:K}),gt?null:a("div",null,a("button",{type:"button",className:"muse-btn-outline",onClick:()=>Kt(!0)},"\u7BA1\u7406\u5FAE\u4FE1\u626B\u7801\u4E0E\u65E7\u7248\u5173\u6CE8\u9879\u76EE"))),connectorAuth:Ks,onStartConnectorAuth:qr,googleMcp:Ma?.googleWorkspaceMcp??null,legacyGoogleConfigured:!!(Ma?.googleSuiteAuth?.refreshConfigured||Ma?.googleCalendarAuth?.refreshConfigured),googleMcpAuth:Us,googleMcpBusy:tn,onStartGoogleMcpAuth:Gr,onToggleGoogleMcpService:Hr,onDisconnectGoogleMcpAccount:Wr}),a(Q,{controller:K,onOrganized:()=>{try{globalThis.localStorage?.setItem("dot.sample.cleared","1")}catch{}Ln(!0),Jo("today"),ya({action:"workspace_brief_refresh"}),Vt(),kt.current.refreshNow()},renderFactorySlot:v.renderFactorySlot,slots:l.slots}),a(N,{controller:x,renderConversation:({projectId:t,target:s})=>!Gt&&typeof v.SessionProvider=="function"&&typeof v.renderSlot=="function"?a(m,{target:s,projectId:t,owner:"project",SessionProvider:v.SessionProvider,renderSlot:v.renderSlot,slotName:"dot.project.conversation",onOpenHistory:()=>Pt(s.sessionId)}):a("p",{role:"status"},"\u539F\u751F\u5BF9\u8BDD\u7EC4\u4EF6\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u6062\u590D Harness \u5DE5\u4F5C\u53F0\u540E\u91CD\u65B0\u6253\u5F00\uFF1B\u5DF2\u6709\u8349\u7A3F\u4ECD\u4FDD\u7559\u3002")}),Ye?a(q,{open:!0,closeLabel:"\u5173\u95ED",title:Ye==="project"?rt?.label??"\u9879\u76EE\u8BE6\u60C5":Ye==="follow"?"\u540E\u7EED\u600E\u4E48\u8DDF\u8FDB":Ye==="memory"?"\u7EA0\u6B63\u9879\u76EE\u8BB0\u5FC6":"\u672C\u6B21\u6267\u884C\u56DE\u590D",className:"pc_dot_modal",onClose:or},a("div",{className:"pc_dot_drawer"},Ne?a("p",{className:"pc_dot_error",role:"alert"},Ne):null,je?Yr:Ye==="project"?pr():Ye==="follow"?ur():Ye==="memory"?fr():mr())):null,Ja&&!gt?a(q,{open:!0,closeLabel:"\u5173\u95ED",title:"\u8FDE\u63A5\u5FAE\u4FE1\u4E0E\u9009\u62E9\u9879\u76EE",className:"pc_setup_modal",onClose:()=>{Kt(!1),Vt()}},a(zs,{renderFactorySlot:v.renderFactorySlot,close:()=>{Kt(!1),Vt()}})):null)}typeof l.layout?.selectPanel=="function"&&(l.effect(()=>{if(typeof document>"u")return;let v=document.createElement("style");return v.dataset.pluginCss="dsh-project-companion/workbench",v.textContent=ye+Oe+wn,document.head.appendChild(v),()=>v.remove()}),l.effect(()=>l.slots.inject("main",()=>l.slots.register({name:"main",key:W,children:{"dot.desktop.conversation":{kind:"single",scope:"session"},"dot.project.conversation":{kind:"single",scope:"session"}}},Ts))),l.effect(()=>l.slots.inject("dot.project.conversation",()=>l.slots.register({name:"dot.project.conversation"},g))),l.effect(()=>l.slots.inject("dot.desktop.conversation",()=>l.slots.register({name:"dot.desktop.conversation"},g))),l.effect(()=>l.slots.inject("dot.overlay.conversation",()=>l.slots.register({name:"dot.overlay.conversation"},g))),G(l,$s),l.effect(()=>l.slots.inject("sidebar.panellist",()=>l.slots.register({name:"sidebar.panellist",id:W,order:5,label:"DSH Dot"},sa))));let zs=v=>S(v,!1),Es=v=>a("div",null,S(v,!1),a(L),a(oe));l.effect(()=>l.slots.inject("settings.section",()=>l.slots.register({name:"settings.section",id:"project-companion",order:39,label:"DSH Dot"},Es))),(typeof l.get=="function"?l.get("configForms",!1):l.configForms)&&l.effect(()=>l.slots.inject("plugins.row.config",()=>l.slots.register({name:"plugins.row.config",key:"@oxmumu3/dsh-project-companion#project-companion"},v=>v.view==="summary"?"DeepSeek Dot \u7684\u4E2A\u4EBA\u8D44\u6599\u6765\u6E90\u4E0E\u539F\u751F\u51ED\u636E\u914D\u7F6E":a("div",{className:"pc_setup"},a("h3",null,"\u8FDE\u63A5\u51ED\u636E"),a(I)))))}return{inject:Ge,apply:u,createDotAppearance:lt,prepareDotDraft:Te,createDesktopConversationController:Qe,desktopConversationCanEmbed:at}}var mi="644fc78";window.__ModuleLoader__.load({id:"@oxmumu3/dsh-project-companion",factory:d=>(console.log("dot client build "+mi),Nn(d))});
|
|
2487
|
+
\u8BF7\u5148\u6838\u5BF9\u539F\u4E8B\u9879\u53CA\u5DF2\u6388\u6743\u6765\u6E90\uFF0C\u518D\u5E2E\u6211\u68B3\u7406\u4E0B\u4E00\u6B65\uFF1B\u4E0D\u8981\u81EA\u52A8\u91CD\u505A\u65E7\u4EFB\u52A1\u6216\u6269\u5927\u8BFB\u53D6\u8303\u56F4\u3002`,"")),Array.isArray(t.sources)&&t.sources.length?a("details",null,a("summary",null,"\u67E5\u770B\u4F9D\u636E"),...t.sources.slice(0,5).map(Dr)):null)),$r=mo?Tt("\u503C\u5F97\u4F60\u7559\u610F",mo?mo.length?mo.map(jr):a("p",{className:"pc_dot_empty"},"\u5F53\u524D\u5DF2\u6838\u5BF9\u7684\u8303\u56F4\u5185\uFF0C\u6CA1\u6709\u5F85\u5904\u7406\u4E8B\u9879\u3002\u6709\u4E8B\u53EF\u4EE5\u76F4\u63A5\u544A\u8BC9 Dot\u3002"):a("p",{className:"pc_dot_empty"},"\u5F53\u524D\u4E8B\u9879\u5C1A\u672A\u6838\u5BF9\uFF0C\u6062\u590D\u5165\u53E3\u89C1\u4E0A\u65B9\u63D0\u793A\u3002"),typeof oa?.note=="string"&&oa.note?a("p",{className:"pc_dot_muted"},oa.note):null,oa?.truncated?a("p",{className:"pc_dot_muted"},"\u8FD9\u91CC\u53EA\u5C55\u793A\u6700\u8FD1 5 \u6761\u4E8B\u9879\uFF0C\u5176\u4ED6\u5185\u5BB9\u8BF7\u5728\u539F\u4F1A\u8BDD\u6838\u5BF9\u3002"):null):a("p",{className:"pc_dot_muted pc_dot_inline_note"},["\u5F53\u524D\u4E8B\u9879\u8FD8\u6CA1\u6838\u5BF9\u3002",typeof oa?.note=="string"?oa.note:null].filter(Boolean).join(" ")),Tr=t=>t.nextDueAt?yt(t.nextDueAt):[t.dailyTime?`\u6BCF\u5929 ${t.dailyTime}`:"",Number.isInteger(t.weeklyDay)&&t.weeklyTime?`\u6BCF\u5468${["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"][t.weeklyDay]} ${t.weeklyTime}`:"",Number.isInteger(t.everyMinutes)?`\u6BCF ${t.everyMinutes} \u5206\u949F`:""].filter(Boolean).join(" \xB7 ")||"\u4E0B\u6B21\u65F6\u95F4\u5F85\u786E\u8BA4",zr=a("section",{className:"pc_dot_section pc_dot_schedule","data-dot-schedule-rail":!0},a("h3",null,"\u4E0B\u4E00\u6B21\u5B89\u6392"),typeof Wa?.label=="string"&&Wa.label?a("p",{className:"pc_dot_muted","data-dot-review-health":!0},`\u6700\u8FD1\u8FD0\u884C\uFF1A${Wa.label}${Wa.at?" \xB7 "+yt(Wa.at):""}\u3002\u624B\u673A\u6536\u5230\u4ECD\u672A\u786E\u8BA4\u3002`):null,fo?fo.length?fo.map(t=>a("div",{className:"pc_dot_schedule_item",key:t.id},a("strong",null,t.title),a("span",{className:"pc_dot_plan_status"},{stored:"\u5DF2\u4FDD\u5B58",paused:"\u5DF2\u6682\u505C",blocked:"\u5F53\u524D\u53D7\u963B"}[t.status]??"\u72B6\u6001\u5F85\u6838\u5BF9"),a("p",null,Tr(t)),a("p",{className:"pc_dot_muted"},t.timeZone||"\u65F6\u533A\u5F85\u6838\u5BF9"),a("p",{className:"pc_dot_muted"},{"personal-review":"\u4E2A\u4EBA\u56DE\u987E",news:"AI \u65E5\u62A5","project-followup":"\u9879\u76EE\u8DDF\u8FDB"}[t.source]??"\u539F\u5B89\u6392"))):Ka?.available===!0?a("p",{className:"pc_dot_empty"},"\u5F53\u524D\u8303\u56F4\u6CA1\u6709\u5DF2\u4FDD\u5B58\u7684\u5B89\u6392\u3002\u60F3\u8DDF\u8FDB\u4E00\u4EF6\u4E8B\uFF0C\u53EF\u4EE5\u76F4\u63A5\u544A\u8BC9 Dot\u3002"):a("p",{className:"pc_dot_empty"},"\u5B89\u6392\u72B6\u6001\u89C1\u4E0A\u65B9\u63D0\u793A\u3002"):a("p",{className:"pc_dot_empty"},"\u5B89\u6392\u72B6\u6001\u89C1\u4E0A\u65B9\u63D0\u793A\u3002"),Ka?.available!==!0&&fo?.length?a("p",{className:"pc_dot_muted"},"\u90E8\u5206\u5B89\u6392\u5C1A\u672A\u786E\u8BA4\uFF1B\u8FD9\u91CC\u4FDD\u7559\u5DF2\u6838\u5BF9\u7684\u5B89\u6392\u3002"):null,fo?.length?a("p",{className:"pc_dot_rail_note"},Wa?"\u8FD9\u91CC\u663E\u793A\u5DF2\u4FDD\u5B58\u7684\u5B89\u6392\uFF1B\u624B\u673A\u6536\u5230\u4ECD\u672A\u786E\u8BA4\u3002":"\u8FD9\u91CC\u663E\u793A\u5DF2\u4FDD\u5B58\u7684\u5B89\u6392\uFF1B\u8FD0\u884C\u5C1A\u672A\u6838\u9A8C\uFF0C\u624B\u673A\u6536\u5230\u4ECD\u672A\u786E\u8BA4\u3002"):null,Ka?.truncated?a("p",{className:"pc_dot_muted"},"\u6B64\u5904\u4E3A\u6709\u9650\u5B89\u6392\uFF0C\u5176\u4F59\u8BF7\u5728\u539F\u5165\u53E3\u6838\u5BF9\u3002"):null),Er=Ta.jobs?a("details",{className:"pc_dot_history","data-dot-history":!0},a("summary",null,`\u627E\u5230\u4E4B\u524D\u804A\u8FC7\u7684\u4E8B\uFF08${Gn.length}\uFF09`),yn.length?yn.map(wr):a("p",{className:"pc_dot_muted"},"\u8FD9\u4E2A\u7A97\u53E3\u91CC\u8FD8\u6CA1\u6709\u4EA4\u529E\u8BB0\u5F55\u3002"),a("p",{className:"pc_dot_muted"},"\u8FD9\u91CC\u5C55\u793A\u6700\u8FD1\u7684\u6709\u9650\u8BB0\u5F55\uFF1B\u66F4\u65E9\u7684\u539F\u59CB\u5185\u5BB9\u5728 Dot \u4F1A\u8BDD\u4E2D\u3002"),xt?pe("\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD\u5386\u53F2",()=>Pt(xt.sessionId)):ha&&!gt?pe("\u6253\u5F00\u5B8C\u6574\u4F1A\u8BDD\u5386\u53F2",()=>Pt(ge.connection.sessionId)):null):null,Pr=Va&&!St.length?a("section",{className:"pc_dot_sample","data-dot-sample":!0,"aria-label":"\u793A\u4F8B\u7B80\u62A5"},a("div",{className:"pc_dot_sample_head"},a("span",{className:"pc_dot_badge"},"\u793A\u4F8B"),a("strong",null,"Dot \u4F1A\u628A\u4E00\u4EF6\u4E8B\u63A5\u6210\u8FD9\u6837\u7684\u7B80\u62A5")),a("ol",null,a("li",null,a("b",null,"\u8FDB\u5C55"),"\u4E09\u7BC7\u9605\u8BFB\u6750\u6599\u5DF2\u7ECF\u6574\u7406\u597D\uFF0C\u8BD5\u8BFB\u8BF4\u660E\u8FD8\u5DEE\u4E00\u7248\u3002"),a("li",null,a("b",null,"\u5361\u70B9"),"\u4F5C\u8005\u5E0C\u671B\u628A\u201C\u8BFB\u5B8C\u6709\u4EC0\u4E48\u6536\u83B7\u201D\u8BF4\u5F97\u66F4\u5177\u4F53\u3002"),a("li",null,a("b",null,"\u4E0B\u4E00\u6B65"),"\u5148\u627E 5 \u4F4D\u8BFB\u8005\u8BD5\u8BFB\u4E00\u5468\uFF0C\u518D\u51B3\u5B9A\u662F\u5426\u6269\u5927\u3002")),a("p",{className:"pc_dot_muted"},"\u8FD9\u662F\u793A\u4F8B\uFF0C\u4E0D\u662F\u4F60\u7684\u8D44\u6599\u3002\u8FDE\u4E0A\u9879\u76EE\u6216\u5FAE\u4FE1\u540E\uFF0CDot \u4F1A\u6309\u4F60\u7684\u6765\u6E90\u6574\u7406\u3002"),a("div",{className:"pc_dot_actions"},pe("\u7528\u8FD9\u4E2A\u4F8B\u5B50\u804A\u804A",()=>ta("\u8BF7\u53C2\u8003\u793A\u4F8B\u7B80\u62A5\u7684\u7ED3\u6784\uFF0C\u5E2E\u6211\u6574\u7406\u4E00\u4EF6\u6B63\u5728\u63A8\u8FDB\u7684\u4E8B\uFF1A\u5148\u53EA\u95EE\u6211\u7F3A\u7684\u76EE\u6807\u548C\u8303\u56F4\uFF0C\u518D\u7ED9\u6211\u8FDB\u5C55\u3001\u5361\u70B9\u548C\u4E0B\u4E00\u6B65\u3002"),{className:"pc_dot_text_button"}))):null,wi=a("div",null,xr,a("div",{className:"pc_dot_home_grid pc_dot_home_single"},a("div",{className:"pc_dot_column"},Ar,Ir,a(h,{controller:K,organizer:x,onOrganize:async()=>{await x.organize(K.getSnapshot().summary?.revision)&&lo("projects")}}),Pr,Va?a("p",{className:"pc_dot_intro"},"\u4E0D\u7528\u5148\u628A\u6240\u6709\u4E1C\u897F\u914D\u597D\u3002\u5148\u804A\u624B\u4E0A\u7684\u4EFB\u52A1\uFF0C\u7528\u5230\u90AE\u4EF6\u3001\u65E5\u7A0B\u6216\u9879\u76EE\u65F6\uFF0C\u518D\u8FDE\u63A5\u9700\u8981\u7684\u8D44\u6599\u3002"):$r,Er,a("details",{className:"pc_dot_legacy_details"},a("summary",null,"\u66F4\u591A\u539F\u4F1A\u8BDD\u5B89\u6392\u4E0E\u68C0\u67E5"),_r,vr)),a("details",{className:"pc_dot_more","aria-label":"\u5B89\u6392\u4E0E\u5173\u6CE8"},a("summary",null,"\u5B89\u6392\u4E0E\u5173\u6CE8"),Va?Tt("\u4ECE\u4F60\u624B\u4E0A\u7684\u4E8B\u5F00\u59CB",a("p",{className:"pc_dot_muted"},"\u5148\u4EA4\u4EE3\u4E00\u4E2A\u76EE\u6807\uFF0CDot \u4F1A\u63A5\u7740\u6574\u7406\u4E0B\u4E00\u6B65\u3002\u7528\u5230\u8D44\u6599\u65F6\u518D\u8FDE\u63A5\uFF1B\u60F3\u5B9A\u65F6\u8DDF\u8FDB\u65F6\u518D\u5B89\u6392\u3002")):zr,Tt("\u6B63\u5728\u5173\u6CE8",Ta.projects?St.length?St.map(t=>pe(a("span",null,a("strong",null,t.label),a("small",{className:"pc_dot_muted"},To(t)?`\u8D44\u6599\u66F4\u65B0 ${yt(To(t))}`:"\u5C1A\u65E0\u8FD1\u671F\u8D44\u6599")),()=>co(t.id),{key:t.id,className:"pc_dot_project_mini"})):a("p",{className:"pc_dot_muted"},"\u5148\u4ECE\u624B\u5934\u7684\u4E00\u4EF6\u4E8B\u5F00\u59CB\uFF0C\u9700\u8981\u65F6\u518D\u5173\u6CE8\u9879\u76EE\u3002"):a("p",{className:"pc_dot_muted"},"\u5173\u6CE8\u8303\u56F4\u89C1\u4E0A\u65B9\u63D0\u793A\u3002"),gt?null:pe("\u9009\u62E9\u5173\u6CE8\u9879\u76EE",()=>Kt(!0))),Ae?a("details",{className:"pc_dot_review_details"},a("summary",null,"\u4E2A\u4EBA\u56DE\u987E\u4E0E\u8D44\u8BAF\u8BBE\u7F6E"),yr):null))),Rr=Tt(`\u5168\u90E8\u9879\u76EE${it?` \xB7 ${it.total}`:""}`,a("p",{className:"pc_dot_muted"},"\u6309\u540D\u79F0\u627E\u5230 Harness \u5DF2\u767B\u8BB0\u7684\u9879\u76EE\uFF0C\u5355\u6B21\u67E5\u770B\u4E0D\u5360\u6301\u7EED\u5173\u6CE8\u540D\u989D\u3002\u5217\u76EE\u5F55\u4E0D\u4F1A\u8BFB\u53D6\u9879\u76EE\u5185\u5BB9\u3002"),ha?a("div",null,a("form",{"aria-label":"\u641C\u7D22\u5168\u90E8\u9879\u76EE",className:"pc_dot_actions",onSubmit:t=>{t.preventDefault(),io({query:Ho})}},a("input",{"aria-label":"\u641C\u7D22\u5168\u90E8\u9879\u76EE",placeholder:"\u8F93\u5165\u9879\u76EE\u540D\u79F0",maxLength:80,value:Ho,disabled:Ca,onChange:t=>Dn(t.target.value)}),a("button",{type:"submit",disabled:Ca},"\u641C\u7D22"),pe("\u5237\u65B0\u9879\u76EE\u76EE\u5F55",()=>io({query:Ho}),{disabled:Ca})),Ca?a("p",{role:"status",className:"pc_dot_muted"},"\u6B63\u5728\u8BFB\u53D6\u6240\u9009\u5185\u5BB9\u2026"):null,Wo?a("p",{role:"alert",className:"pc_dot_error"},Wo):null,it?a("div",null,a("p",{className:"pc_dot_muted"},`\u672C\u6B21\u5339\u914D ${it.matchedTotal} \u4E2A${it.items.length?` \xB7 \u663E\u793A ${it.offset+1}\u2013${it.offset+it.items.length}`:""}`),it.items.length?it.items.map(t=>a("div",{className:"pc_dot_row",key:t.id,"data-catalog-project":t.id},a("div",null,a("strong",null,t.label),a("small",{className:"pc_dot_muted"},t.disambiguator?`${t.disambiguator} \xB7 `:"",t.watched?"\u6B63\u5728\u6301\u7EED\u5173\u6CE8":"\u6309\u9700\u67E5\u770B")),pe("\u5355\u6B21\u67E5\u770B",()=>Zs(t),{disabled:Ca||ge?.paused===!0,"aria-label":`\u5355\u6B21\u67E5\u770B ${t.label}${t.disambiguator?` ${t.disambiguator}`:""}`}))):a("p",{className:"pc_dot_empty"},it.total?"\u6CA1\u6709\u5339\u914D\u7684\u9879\u76EE\uFF0C\u8BD5\u8BD5\u5176\u4ED6\u540D\u79F0\u3002":"Harness \u4E2D\u8FD8\u6CA1\u6709\u5DF2\u767B\u8BB0\u9879\u76EE\u3002"),a("div",{className:"pc_dot_actions"},pe("\u4E0A\u4E00\u9875",()=>io({query:it.query,offset:Math.max(0,it.offset-it.limit),expectedRevision:it.revision}),{disabled:Ca||it.offset===0}),pe("\u4E0B\u4E00\u9875",()=>io({query:it.query,offset:it.nextOffset,expectedRevision:it.revision}),{disabled:Ca||!it.hasMore}))):null,Vo?a("section",{className:"pc_dot_result","aria-label":"\u5355\u6B21\u9879\u76EE\u8D44\u6599"},a("div",{className:"pc_dot_header"},a("h3",null,Vo.project.label),pe("\u6536\u8D77\u8D44\u6599",()=>oo(null))),a("p",{className:"pc_dot_muted"},"\u672C\u6B21\u53EA\u8BFB\u9879\u76EE\u56FA\u5B9A\u8BF4\u660E\uFF1B\u4E0D\u4F1A\u52A0\u5165\u6301\u7EED\u5173\u6CE8\u3001\u8BFB\u53D6\u804A\u5929\u5386\u53F2\u6216\u521B\u5EFA\u8BA1\u5212\u3002"),...Vo.sources.map(t=>a("div",{className:"pc_dot_source",key:t.path},a("strong",null,t.path),a("p",{className:"pc_dot_muted"},t.modifiedAt?`\u66F4\u65B0 ${yt(t.modifiedAt)}`:"",t.truncated?" \xB7 \u5DF2\u622A\u65AD\uFF0C\u5F53\u524D\u9884\u89C8\u4E0D\u662F\u5B8C\u6574\u6587\u4EF6":""),t.status==="ok"?a("pre",null,t.text):a("p",{className:"pc_dot_muted"},t.status==="missing"?"\u8FD9\u4E2A\u6587\u4EF6\u4E0D\u5B58\u5728\uFF1B\u4E0D\u80FD\u636E\u6B64\u5224\u65AD\u9879\u76EE\u8FDB\u5C55\u3002":"\u8FD9\u4E2A\u6587\u4EF6\u5F53\u524D\u65E0\u6CD5\u8BFB\u53D6\u3002")))):null):a("p",{className:"pc_dot_empty"},"\u5148\u786E\u8BA4\u5FAE\u4FE1\u8FDE\u63A5\uFF0C\u518D\u67E5\u770B\u4F60\u7684\u9879\u76EE\u76EE\u5F55\u3002")),Or=a("div",null,a("div",{className:"pc_dot_header"},a("div",null,a("h1",null,"\u9879\u76EE"),a("p",{className:"pc_dot_muted"},"\u6240\u6709\u9879\u76EE\u90FD\u80FD\u6309\u9700\u67E5\u770B\uFF0C\u91CD\u8981\u7684\u4E8B\u518D\u6301\u7EED\u5173\u6CE8\u3002")),gt?null:pe("\u9009\u62E9\u5173\u6CE8\u9879\u76EE",()=>Kt(!0))),Rr,Tt(`\u6301\u7EED\u5173\u6CE8 \xB7 ${St.length}/5`,a("p",{className:"pc_dot_muted"},"\u80CC\u666F\u3001\u7ED3\u679C\u548C\u540E\u7EED\u5B89\u6392\uFF0C\u4ECE\u8FD9\u91CC\u63A5\u7740\u8D70\u3002\u5173\u6CE8\u540D\u989D\u53EA\u9650\u5236\u540E\u53F0\u8DDF\u8FDB\u3002"),Ta.projects?St.length?a("div",{className:"pc_dot_project_cards"},St.map(t=>a("article",{className:"pc_dot_project_card",key:t.id},a("p",{className:"pc_dot_eyebrow"},"\u9879\u76EE"),a("h2",null,t.label),a("p",{className:"pc_dot_muted"},To(t)?`\u4E0A\u6B21\u8D44\u6599\u66F4\u65B0 ${yt(To(t))}`:"\u5C1A\u65E0\u8FD1\u671F\u8D44\u6599"),a("p",{className:"pc_dot_excerpt"},gn(t)&&t.overview.nextSteps[0]?t.overview.nextSteps[0].text:"\u8FD8\u6CA1\u6709\u8BB0\u5F55\u4E0B\u4E00\u6B65\u3002\u76F4\u63A5\u8BF4\u8BF4\u4F60\u60F3\u63A8\u8FDB\u4EC0\u4E48\u3002"),a("div",{className:"pc_dot_actions"},pe("\u67E5\u770B\u9879\u76EE",()=>co(t.id)),gt?null:pe("\u7EE7\u7EED\u804A",()=>ta(`\u8BF7\u770B\u770B\u300C${t.label}\u300D\u7684\u6700\u65B0\u8FDB\u5C55\u3002`,t.id)),pe("\u6765\u6E90\u4E0E\u8BB0\u5F55",()=>co(t.id,"sources")))))):a("p",{className:"pc_dot_empty"},"\u8FD8\u6CA1\u6709\u5173\u6CE8\u9879\u76EE\u3002\u53EF\u4EE5\u5148\u8FDE\u63A5\u5FAE\u4FE1\uFF0C\u518D\u9009\u4E00\u4E2A\u9879\u76EE\u5F00\u59CB\u3002"):a("p",{className:"pc_dot_empty"},"\u5173\u6CE8\u5217\u8868\u6682\u4E0D\u53EF\u7528\u3002"))),ki=a("div",null,a(te,{controller:x,workspaceController:K}),a("details",{className:"pc_goal_legacy"},a("summary",null,"\u5DE5\u4F5C\u533A\u76EE\u5F55\u4E0E\u539F\u6709\u5173\u6CE8\u8BB0\u5F55"),a("p",{className:"pc_dot_muted"},"\u8FD9\u91CC\u4FDD\u7559\u65E7\u5173\u6CE8\u3001\u56FA\u5B9A\u8BF4\u660E\u548C\u5B89\u6392\u3002\u5DE5\u4F5C\u533A\u662F\u8D44\u6599\u5165\u53E3\uFF0C\u76EE\u6807\u9879\u76EE\u5728\u4E0A\u65B9\u7EC4\u7EC7\u3002"),Or)),Ni=yo(Ao&&!on?Oo():dt,{sample:Ao&&!on,loading:Fa.phase==="loading"}),Mr=async(t,s={})=>{let p=s.cardId?`${s.projectId}:${s.cardId}`:"";p&&["approve","retry"].includes(t)&&zn(k=>new Set(k).add(p));try{let k=await Ea("/api/project_companion/item",{action:t,...s});k?.openSession&&Wt(k.sessionId)?(C(k.text||"\u5DF2\u6253\u5F00\u8FD9\u4E2A\u4F1A\u8BDD\u3002"),await Pt(k.sessionId)):k?.fallback==="open_session"&&Wt(k.sessionId)?(C(k.text||M.today.toast.approveUnsupported),await Pt(k.sessionId)):k?.ok?(C(k.text||M.today.toast.handled),Tn(typeof k.undoId=="string"?k.undoId:"")):H(k?.revoked?"\u8FD9\u4E2A\u9879\u76EE\u7684\u6388\u6743\u5DF2\u7ECF\u6536\u56DE\uFF1B\u6CA1\u6709\u6267\u884C\u4EFB\u4F55\u52A8\u4F5C\u3002":k?.stale?"\u8FD9\u5F20\u5361\u7247\u5DF2\u7ECF\u8FC7\u671F\uFF0C\u4ECA\u5929\u9875\u5DF2\u5237\u65B0\uFF1B\u6CA1\u6709\u6267\u884C\u3002":k?.error||"\u64CD\u4F5C\u7ED3\u679C\u5F85\u6838\u5BF9\uFF1B\u672A\u81EA\u52A8\u91CD\u8BD5\u3002"),await kt.current.refreshNow()}catch(k){H(`${k?.message||"\u64CD\u4F5C\u7ED3\u679C\u5F85\u6838\u5BF9\u3002"} \u672A\u81EA\u52A8\u91CD\u8BD5\u3002`)}finally{p&&zn(k=>{let J=new Set(k);return J.delete(p),J})}},Lr=async()=>{if(Qo)try{let t=await Ea("/api/project_companion/item",{action:"undo",undoId:Qo});t?.ok?(C(t.text||"\u5DF2\u7ECF\u64A4\u9500\u3002"),Tn("")):H(t?.error||"\u8FD9\u6B21\u64A4\u9500\u6CA1\u6709\u5B8C\u6210\u3002"),await kt.current.refreshNow()}catch(t){H(t?.message||"\u8FD9\u6B21\u64A4\u9500\u6CA1\u6709\u5B8C\u6210\u3002")}},Fr=async t=>{en(!0),Ko(!0),It(""),se({dockOpen:!0});let s=await qn();try{let p=await Ea("/api/project_companion/say",{text:t});if(p?.fallback==="stage_draft"){if(dn(t),p.foregroundChanged===!0){It("\u524D\u53F0\u4F1A\u8BDD\u5DF2\u7ECF\u5207\u6362\uFF1B\u539F\u8BDD\u4FDD\u7559\u5728\u4E0B\u65B9\uFF0C\u6CA1\u6709\u6295\u5230\u65E7\u4F1A\u8BDD\u3002");return}if(!s){It("\u8FD8\u6CA1\u6709\u53EF\u7528\u7684\u539F\u751F\u4F1A\u8BDD\uFF1B\u539F\u8BDD\u4FDD\u7559\u5728\u4E0B\u65B9\uFF0C\u4E0D\u4F1A\u4E22\u3002");return}try{(await Te(l,s.sessionId,t,AbortSignal.timeout(15e3),null,void 0,!0))?.status==="applied"?(It("\u5DF2\u653E\u8FDB\u539F\u751F\u8F93\u5165\u6846\uFF0C\u6309\u56DE\u8F66\u7531\u4F60\u53D1\u9001\uFF1B\u539F\u8BDD\u4E5F\u4FDD\u7559\u5728\u4E0B\u65B9\u3002"),r.focus(s)):It("\u539F\u751F\u5BF9\u8BDD\u5DF2\u6709\u8349\u7A3F\uFF0C\u539F\u8BDD\u4FDD\u7559\u5728\u4E0B\u65B9\uFF1B\u6CA1\u6709\u8986\u76D6\u3002")}catch{It("\u539F\u751F\u8F93\u5165\u6846\u6682\u4E0D\u53EF\u7528\uFF1B\u539F\u8BDD\u4FDD\u7559\u5728\u4E0B\u65B9\uFF0C\u53EF\u4EE5\u590D\u5236\u540E\u7EE7\u7EED\u3002")}return}if(!p?.ok)throw new Error(p?.error||M.today.toast.sayFailed);C(p.text||"\u6536\u5230\uFF0C\u6211\u53BB\u529E\u3002"),It(p.mode==="steer"?"\u524D\u53F0\u6B63\u5728\u8DD1\uFF0C\u8FD9\u53E5\u8BDD\u6309\u63D2\u8BDD\u6295\u9012\u4E86\u3002":"\u5DF2\u6295\u7ED9\u524D\u53F0\u4F1A\u8BDD\uFF1B\u7B49\u5B83\u63A5\u5230\u540E\u7684\u8D26\u672C\u56DE\u6267\u3002"),await kt.current.refreshNow()}catch(p){dn(t),H(p?.message||M.today.toast.sayFailed)}},Eo=(t="")=>{typeof t=="string"&&t&&Yo(t),setTimeout(()=>{try{document.querySelector("[data-muse-capsule-input]")?.focus?.()}catch{}},0)},Br=t=>{Yo(s=>s.trim()?`${s.trim()} ${t}`:t),pn(),Eo()},ya=async(t={})=>{if(!F.current)return null;Oa.current++,H(""),ke(!0);try{let s=await Ea("/api/project_companion/muse",t);if(F.current&&s&&typeof s=="object"&&(Oa.current++,En(p=>js(p,s))),!s?.ok)return F.current&&H(s?.error||"\u64CD\u4F5C\u6CA1\u6709\u5B8C\u6210\uFF0C\u8BF7\u5237\u65B0\u6838\u5BF9\u3002"),s;if(F.current){if(s.undoToken){let p=t.action==="dossier_act";No({token:s.undoToken,kind:p?"dossier":"profile",message:s.text||(p?"\u5DF2\u529E\u59A5\u3002":"\u521A\u624D\u90A3\u6761\u8BB0\u5FC6\u5DF2\u7ECF\u66F4\u65B0\u3002"),expiresAt:s.undoExpiresAt})}else(t.action==="profile_undo"||t.action==="dossier_undo")&&No(null);s.text&&C(s.text)}return["superagent_pending","rhythm_configure","routine_toggle","workspace_brief_refresh","promise_draft_save","promise_draft_reset","dossier_act","dossier_undo","connector_toggle"].includes(t.action)&&await kt.current.refreshNow(),s}catch(s){return F.current&&H(s?.message||"\u64CD\u4F5C\u6CA1\u6709\u5B8C\u6210\uFF0C\u8BF7\u5237\u65B0\u6838\u5BF9\u3002"),null}finally{F.current&&ke(!1)}},ho=()=>{Ia.current&&(clearInterval(Ia.current),Ia.current=null)},qr=async t=>{if(!F.current)return;if(t==="wechat"){Kt(!0);return}let s={google_suite:{authAction:"google_suite_authorize",authKey:"googleSuiteAuth",target:["https://accounts.google.com","/o/oauth2/v2/auth"],sources:["gmail","calendar","drive"],label:"Google"},flomo:{authAction:"flomo_authorize",authKey:"flomoAuth",target:["https://flomoapp.com","/integration/grant"],sources:["flomo"],label:"flomo"},dida:{authAction:"dida_authorize",authKey:"didaAuth",target:["https://dida365.com","/oauth/authorize"],sources:["dida"],label:"\u6EF4\u7B54\u6E05\u5355"}}[t];if(!s)return;ho(),H(""),ca({id:t,phase:"starting",message:"\u6B63\u5728\u6253\u5F00\u6388\u6743\u9875\u2026"});let p=async J=>{let ae=await fetch("/api/project_companion/context",{method:J===void 0?"GET":"POST",credentials:"same-origin",redirect:"error",cache:"no-store",...J!==void 0?{headers:{"Content-Type":"application/json"},body:JSON.stringify(J)}:{}}),ie={};try{ie=await ae.json()}catch{}if(!ae.ok)throw Object.assign(new Error(ie?.error||"\u6682\u65F6\u65E0\u6CD5\u6253\u5F00\u6388\u6743\u9875\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"),{code:ie?.code});return ie},k=async(J,ae)=>{let ie=typeof J?.bindingRevision=="string"?J.bindingRevision:null;for(let pt of ae){let Xe=J?.sources?.find(Ct=>Ct.id===pt);Xe?.configured===!0&&Xe.enabled!==!0&&await p({action:"connect",source:pt,...ie?{expectedBindingRevision:ie}:{}})}};try{let J=await p();if(!F.current)return;if(t==="google_suite"?J.googleSuiteAuth?.refreshConfigured===!0&&(J.googleSuiteAuth.grantedSources||[]).length>0:!!J.sources?.some(na=>s.sources.includes(na.id)&&na.configured===!0)){if(await k(J,t==="google_suite"?J.googleSuiteAuth.grantedSources:s.sources),!F.current)return;await ga({includeContext:!0}),await kt.current.refreshNow(),F.current&&ca(null);return}let ie=typeof J?.bindingRevision=="string"?J.bindingRevision:null,pt=await p({action:s.authAction,...ie?{expectedBindingRevision:ie}:{}});if(!F.current)return;let Xe=new URL(pt?.url);if(Xe.origin!==s.target[0]||Xe.pathname!==s.target[1]||Xe.username||Xe.password||Xe.hash||typeof pt?.expiresAt!="string"||!Number.isFinite(Date.parse(pt.expiresAt))||Date.parse(pt.expiresAt)<=Date.now())throw new Error("\u6388\u6743\u94FE\u63A5\u65E0\u6548\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002");try{window.open?.(Xe.toString(),"_blank","noopener,noreferrer")}catch{}let Ct=Math.min(Date.parse(pt.expiresAt),Date.now()+3e5);ca({id:t,phase:"waiting",url:Xe.toString(),deadline:Ct,remaining:Math.max(0,Math.ceil((Ct-Date.now())/1e3)),label:s.label}),Ia.current=setInterval(async()=>{if(!F.current){ho();return}let na=Math.max(0,Math.ceil((Ct-Date.now())/1e3));if(ca(Rt=>Rt&&Rt.id===t&&Rt.phase==="waiting"?{...Rt,remaining:na}:Rt),na<=0){ho(),ca({id:t,phase:"error",message:"\u6388\u6743\u94FE\u63A5\u5DF2\u8FC7\u671F\uFF0C\u70B9\u53F3\u4FA7\u6309\u94AE\u5373\u53EF\u91CD\u65B0\u6253\u5F00\u3002"});return}try{let Rt=await p();if(!F.current)return;let Ua=Rt?.[s.authKey];if(!Ua?.authInProgress)if(ho(),Ua?.lastAttempt?.status==="failed")ca({id:t,phase:"error",message:"\u672C\u6B21\u6388\u6743\u672A\u5B8C\u6210\uFF0C\u8BF7\u91CD\u8BD5\u3002"});else if(Ua?.refreshConfigured===!0||Rt?.sources?.some(va=>s.sources.includes(va.id)&&va.configured===!0)){if(await k(Rt,t==="google_suite"&&Ua?.grantedSources||s.sources),!F.current)return;await ga({includeContext:!0}),await kt.current.refreshNow(),F.current&&ca(null)}else ca({id:t,phase:"error",message:"\u5C1A\u672A\u786E\u8BA4\u4FDD\u5B58\u6388\u6743\uFF0C\u8BF7\u91CD\u8BD5\u3002"})}catch{}},2e3)}catch(J){if(ho(),F.current){let ae=J?.code==="GOOGLE_CONNECTION_UNAVAILABLE"?"\u6682\u65F6\u8FDE\u4E0D\u5230 Google \u6388\u6743\u63A5\u53E3\uFF0C\u8BF7\u68C0\u67E5\u7F51\u7EDC/\u4EE3\u7406\u540E\u518D\u70B9\u4E00\u6B21\u3002":J?.message||"\u6682\u65F6\u65E0\u6CD5\u6253\u5F00\u6388\u6743\u9875\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002";ca({id:t,phase:"error",message:ae})}}},bo=()=>{Da.current&&(clearInterval(Da.current),Da.current=null)},za=async t=>{let s=await fetch("/api/project_companion/context",{method:t===void 0?"GET":"POST",credentials:"same-origin",redirect:"error",cache:"no-store",...t!==void 0?{headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}:{}}),p={};try{p=await s.json()}catch{}if(!s.ok)throw Object.assign(new Error(p?.error||"\u64CD\u4F5C\u5C1A\u672A\u751F\u6548\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002"),{code:p?.code});return p},as=t=>(t?.googleWorkspaceMcp?.accounts||[]).map(s=>`${s.id}:${s.authorizedAt}:${(s.grantedServices||[]).join(",")}`).join("|"),Gr=async({loginHint:t="",addAccount:s=!1}={})=>{if(F.current){bo(),H(""),Yt({phase:"starting",message:"\u6B63\u5728\u6253\u5F00 Google \u6388\u6743\u9875\u2026"});try{let p=await za();if(!F.current)return;no(p);let k=as(p),J=typeof p?.bindingRevision=="string"?p.bindingRevision:null,ae=await za({action:"google_mcp_authorize",...t?{loginHint:t}:{},...s?{addAccount:!0}:{},...J?{expectedBindingRevision:J}:{}});if(!F.current)return;let ie=new URL(ae?.url);if(ie.origin!=="https://accounts.google.com"||ie.pathname!=="/o/oauth2/v2/auth"||ie.username||ie.password||ie.hash||typeof ae?.expiresAt!="string"||!Number.isFinite(Date.parse(ae.expiresAt))||Date.parse(ae.expiresAt)<=Date.now())throw new Error("\u6388\u6743\u94FE\u63A5\u65E0\u6548\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002");try{window.open?.(ie.toString(),"_blank","noopener,noreferrer")}catch{}let pt=Math.min(Date.parse(ae.expiresAt),Date.now()+3e5);Yt({phase:"waiting",url:ie.toString(),deadline:pt,remaining:Math.max(0,Math.ceil((pt-Date.now())/1e3)),loginHint:t}),Da.current=setInterval(async()=>{if(!F.current){bo();return}let Xe=Math.max(0,Math.ceil((pt-Date.now())/1e3));if(Yt(Ct=>Ct&&Ct.phase==="waiting"?{...Ct,remaining:Xe}:Ct),Xe<=0){bo(),Yt({phase:"error",message:"\u6388\u6743\u94FE\u63A5\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u518D\u6B21\u70B9\u51FB\u8FDE\u63A5 Google \u8D26\u53F7\u3002"});return}try{let Ct=await za();if(!F.current)return;as(Ct)!==k&&(bo(),no(Ct),Yt(null),await ga({includeContext:!1}),await kt.current.refreshNow())}catch{}},2e3)}catch(p){if(bo(),F.current){let k=p?.code==="GOOGLE_CONNECTION_UNAVAILABLE"?"\u6682\u65F6\u8FDE\u4E0D\u5230 Google \u6388\u6743\u63A5\u53E3\uFF0C\u8BF7\u68C0\u67E5\u672C\u673A\u7F51\u7EDC\u6216\u4EE3\u7406\u540E\u91CD\u8BD5\u3002":p?.message||"\u6682\u65F6\u65E0\u6CD5\u6253\u5F00 Google \u6388\u6743\u9875\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002";Yt({phase:"error",message:k})}}}},Hr=async(t,s,p)=>{if(!(!F.current||tn)){So(!0);try{let k=Ma??await za(),J=typeof k?.bindingRevision=="string"?k.bindingRevision:null,ae=await za({action:"google_mcp_toggle_service",accountId:t,service:s,enabled:p,...J?{expectedBindingRevision:J}:{}});if(!F.current)return;no(ae),Yt(null),await ga({includeContext:!1}),await kt.current.refreshNow()}catch(k){F.current&&Yt({phase:"error",message:k?.message||"\u5207\u6362\u670D\u52A1\u5F00\u5173\u5931\u8D25\uFF0C\u8BF7\u5237\u65B0\u91CD\u8BD5\u3002"})}finally{F.current&&So(!1)}}},Wr=async t=>{if(!(!F.current||tn)){So(!0);try{let s=Ma??await za(),p=typeof s?.bindingRevision=="string"?s.bindingRevision:null,k=await za({action:"google_mcp_disconnect",accountId:t,...p?{expectedBindingRevision:p}:{}});if(!F.current)return;no(k),Yt(null),await ga({includeContext:!1}),await kt.current.refreshNow()}catch(s){F.current&&Yt({phase:"error",message:s?.message||"\u65AD\u5F00\u8D26\u53F7\u5931\u8D25\uFF0C\u8BF7\u5237\u65B0\u91CD\u8BD5\u3002"})}finally{F.current&&So(!1)}}},Vr=async(t,s="")=>{if(t){H(""),ke(!0);try{let p=await Ea("/api/project_companion/promise",{promiseId:t,...typeof s=="string"&&s.trim()?{draftText:s.trim()}:{}});if(!p?.ok){F.current&&H(p?.error||"\u8FD9\u4EF6\u4E8B\u6682\u65F6\u6CA1\u80FD\u63A8\u51FA\u53BB\uFF0C\u8BF7\u5237\u65B0\u6838\u5BF9\u3002");return}F.current&&(C(p.text||"\u5DF2\u63A8\u7ED9\u524D\u53F0\u4F1A\u8BDD\u8DDF\u8FDB\u3002"),Pn(null)),await kt.current.refreshNow(),ga()}catch(p){F.current&&H(p?.message||"\u8FD9\u4EF6\u4E8B\u6682\u65F6\u6CA1\u80FD\u63A8\u51FA\u53BB\uFF0C\u8BF7\u5237\u65B0\u6838\u5BF9\u3002")}finally{F.current&&ke(!1)}}},Kr=t=>{t&&(t.type==="today_act"?Mr(t.act,{projectId:t.projectId,cardId:t.cardId}):t.type==="dispatch_promise"?Vr(t.promiseId,t.draftText):t.type==="ask"?Eo(t.prompt||""):t.type==="focus_capsule"?Eo(t.prefill||""):t.type==="queue_pending"?ya({action:"superagent_pending",text:t.text,title:t.title,workspacePath:t.workspacePath}):t.type==="refresh_workspace_brief"?ya({action:"workspace_brief_refresh"}):t.type==="open_brief"?Rn(!0):t.type==="open_workspace_picker"&&K.open())},Ur=t=>{if(!t){K.open();return}if(St.some(p=>p.id===t)){co(t);return}if(x.getSnapshot().status?.projects?.some(p=>p.id===t)){x.open(t);return}let s=(dt?.dots||[]).find(p=>p.projectId===t&&Wt(p.sessionId));s?Pt(s.sessionId):K.open()},Qr=Ao&&!on&&(dt?.access?.count??0)===0&&!Aa?.dossiers?.length&&!dt?.workspaceBrief?.workspaces?.length&&!Aa?.workspaceBrief?.workspaces?.length&&!dt?.digest?.lastDigest?.text&&!dt?.superagent?.milestones?.length?{...Oo(),sample:!0,superagent:dt?.superagent??Aa?.superagent,profile:dt?.profile??Aa?.profile,digest:dt?.digest??Aa?.digest,workspaceBrief:null,events:Array.isArray(dt?.events)?dt.events:[],connection:dt?.connection??Oo().connection}:dt,Zr=Is({activity:Qr,muse:Aa,workbench:ge,contextSnapshot:Ma,now:new Date,loading:Fa.phase==="loading"&&!dt,pinnedKey:Rs}),vn=!ct.skipped&&(dt?.access?.count??0)===0&&(Aa?.mountedWorkspaces?.length??0)===0&&(K.getSnapshot().summary?.selectedCount??0)===0,Po=e.useCallback(async(t="",s)=>{if(F.current){Bt(p=>({...p,loading:!0,error:""}));try{let p=await E("/api/project_companion/workspaces",{action:"list",query:t,offset:0,limit:50,...s?{pickedWorkspaceId:s}:{}});if(!F.current)return;let k=Array.isArray(p?.items)?p.items:[];Bt(J=>{let ae=s&&p?.pickedId?[...new Set([...J.selectedIds,p.pickedId])]:J.items===null&&Array.isArray(p?.selectedIds)?p.selectedIds:J.selectedIds;return{...J,items:k,meta:{revision:p?.revision,catalogRevision:p?.catalogRevision},selectedIds:ae,loading:!1,pickerOpen:!1}})}catch(p){F.current&&Bt(k=>({...k,loading:!1,error:p?.message||"\u5DE5\u4F5C\u533A\u5217\u8868\u6682\u65F6\u4E0D\u53EF\u7528\u3002"}))}}},[]);e.useEffect(()=>{vn&&ct.items===null&&!ct.loading&&Po("")},[vn,ct.items,ct.loading,Po]);let os=e.useCallback(async t=>{let s=t!==!1;if(Fs(s),!!s){ko(!0);try{let p=await ya({action:"mobile_pair_info"});F.current&&p?.ok&&p.pair&&On(p.pair)}finally{F.current&&ko(!1)}}},[]),ns=!!(P(l.slots)&&typeof v.renderFactorySlot=="function"),Jr={needed:vn,skipped:ct.skipped,items:ct.items||[],selectedIds:ct.selectedIds,query:ct.query,expanded:ct.expanded,loading:ct.loading,saving:ct.saving,error:ct.error,canPick:ns,pickerOpen:ct.pickerOpen,pickerBtnRef:Mn,onTogglePicker:()=>Bt(t=>({...t,pickerOpen:!t.pickerOpen})),renderFolderPicker:()=>ns?v.renderFactorySlot("workspace.picker",{open:ct.pickerOpen,anchorRef:Mn,selectedId:void 0,onPick:t=>{Po("",t)},onClose:()=>Bt(t=>({...t,pickerOpen:!1}))}):null,onQueryChange:t=>Bt(s=>({...s,query:t})),onSearch:t=>{Po(t)},onToggle:t=>Bt(s=>({...s,selectedIds:s.selectedIds.includes(t)?s.selectedIds.filter(p=>p!==t):[...s.selectedIds,t]})),onSelectAll:()=>Bt(t=>{let s=(t.items||[]).map(p=>p.id);return{...t,selectedIds:t.selectedIds.length>=s.length?[]:s}}),onExpandAll:()=>Bt(t=>({...t,expanded:!0})),onSkip:()=>{Bt(t=>({...t,skipped:!0})),os(!0)},onConfirm:async()=>{if(!(!ct.meta?.revision||!ct.meta?.catalogRevision||ct.selectedIds.length===0||ct.saving)){Bt(t=>({...t,saving:!0,error:""}));try{await E("/api/project_companion/workspaces",{action:"save",expectedRevision:ct.meta.revision,expectedCatalogRevision:ct.meta.catalogRevision,workspaceIds:ct.selectedIds});try{globalThis.localStorage?.setItem("dot.sample.cleared","1")}catch{}F.current&&(Ln(!0),Bt(t=>({...t,saving:!1,skipped:!0}))),await K.refresh(),await ya({action:"workspace_brief_refresh"}),await kt.current.refreshNow(),await Vt()}catch(t){F.current&&Bt(s=>({...s,saving:!1,error:t?.message||"\u4FDD\u5B58\u5DE5\u4F5C\u533A\u6388\u6743\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002"}))}}}},Yr=je?a("div",{className:"pc_dot_draft_review",role:"group","aria-label":"\u672A\u4FDD\u5B58\u7684\u4FEE\u6539"},a("h3",null,"\u8FD9\u6B21\u4FEE\u6539\u8FD8\u6CA1\u4FDD\u5B58"),a("p",null,"\u4FDD\u7559\u8349\u7A3F\u540E\uFF0C\u4E0B\u6B21\u6253\u5F00\u540C\u4E00\u9879\u76EE\u7684\u8FD9\u9879\u5185\u5BB9\u53EF\u7EE7\u7EED\u3002\u5173\u95ED\u4E0D\u4F1A\u4FDD\u5B58\u6B63\u5F0F\u8BB0\u5F55\u3002"),a("div",{className:"pc_dot_actions"},pe("\u7EE7\u7EED\u7F16\u8F91",()=>fn("continue"),{className:"pc_dot_primary",disabled:!1,autoFocus:!0}),pe("\u4FDD\u7559\u8349\u7A3F\u5E76\u79BB\u5F00",()=>fn("keep"),{disabled:!1}),pe("\u653E\u5F03\u4FEE\u6539\u5E76\u79BB\u5F00",()=>fn("discard"),{disabled:!1}))):null;return a("div",{className:"pc_dot_muse_shell",ref:ue,"data-dot-workbench":!0,style:{display:"flex",flexDirection:"column",height:"100%",minHeight:0,width:"100%",position:"relative"}},a(U,{model:Zr,tab:Zo,onTab:t=>{Jo(t),t==="connections"&&bt(!0)},busy:Pe,feedback:Ne?{kind:"error",text:Ne}:Z?{kind:"info",text:Z,actionLabel:Qo?"\u64A4\u9500":void 0,onAction:Lr}:null,undoBanner:La,onDismissUndo:()=>No(null),onAction:Kr,onSaveDraft:(t,s)=>ya({action:"promise_draft_save",promiseId:t.promiseId,text:s,what:t.title}),onMuseAct:ya,onPinFocus:t=>Pn(t),onAsk:t=>Eo(t),onOpenProject:Ur,onOpenSession:t=>{Pt(t)},onOpenWorkspacePicker:()=>{K.open()},onOpenSettings:()=>Kt(!0),capsuleDraft:Os,onCapsuleDraft:Yo,onCarryInsight:Br,conversationOpen:Xo,onToggleConversation:t=>{t?pn():Ys()},onSendChat:Fr,briefOpen:Ms,onBriefOpen:Rn,mobilePairOpen:Ls,mobilePairData:Bs,mobilePairLoading:qs,onOpenMobilePair:os,workspaceOnboarding:Jr,mobileHeroDismissed:Gs,onDismissMobileHero:()=>{try{globalThis.localStorage?.setItem("dot.mobile.hero.dismissed","1")}catch{}Hs(!0)},contextHintDismissed:Ws,onDismissContextHint:()=>{try{globalThis.localStorage?.setItem("dot.context.hint.dismissed","1")}catch{}Vs(!0)},onRotateMobilePair:async()=>{ko(!0);try{let t=await ya({action:"mobile_pair_rotate"});F.current&&t?.ok&&t.pair&&On(t.pair)}finally{F.current&&ko(!1)}},renderConversation:()=>a("div",{style:{display:"flex",flexDirection:"column",gap:10,height:"100%",minHeight:0}},jn?a("p",{className:"muse-notice-line",role:"status",style:{margin:0}},jn):null,Uo?a("div",{className:"muse-notice-line info",style:{margin:0,justifyContent:"space-between",gap:8}},a("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},`\u4FDD\u7559\u8349\u7A3F\uFF1A${Uo}`),a("div",{className:"muse-hairline-actions"},a("button",{type:"button",className:"muse-btn-link",onClick:()=>{try{navigator.clipboard?.writeText?.(Uo)}catch{}}},"\u590D\u5236"),a("button",{type:"button",className:"muse-btn-link",onClick:()=>$n("")},"\u6E05\u7A7A"))):null,xt&&un&&!Gt?a(m,{target:xt,owner:"dock",SessionProvider:v.SessionProvider,renderSlot:v.renderSlot,slotName:"dot.desktop.conversation",onOpenHistory:()=>Pt(xt.sessionId)}):a("p",{className:"muse-rail-empty",style:{padding:16}},xt?"\u539F\u751F\u5BF9\u8BDD\u8981\u5728\u5B8C\u6574 Harness \u7A97\u53E3\u4E2D\u6253\u5F00\uFF1B\u539F\u8BDD\u548C\u8349\u7A3F\u4ECD\u4FDD\u7559\u3002":"\u8FD8\u6CA1\u6709\u53EF\u7528\u7684\u539F\u751F\u5BF9\u8BDD\u3002\u8BF4\u4E00\u53E5\uFF0CDot \u4F1A\u5148\u5EFA\u4E00\u4E2A\u684C\u9762\u4F1A\u8BDD\u3002")),renderConnectionsHost:()=>a("div",{style:{paddingTop:12,display:"flex",flexDirection:"column",gap:14}},a(j,{controller:K}),gt?null:a("div",null,a("button",{type:"button",className:"muse-btn-outline",onClick:()=>Kt(!0)},"\u7BA1\u7406\u5FAE\u4FE1\u626B\u7801\u4E0E\u65E7\u7248\u5173\u6CE8\u9879\u76EE"))),connectorAuth:Ks,onStartConnectorAuth:qr,googleMcp:Ma?.googleWorkspaceMcp??null,legacyGoogleConfigured:!!(Ma?.googleSuiteAuth?.refreshConfigured||Ma?.googleCalendarAuth?.refreshConfigured),googleMcpAuth:Us,googleMcpBusy:tn,onStartGoogleMcpAuth:Gr,onToggleGoogleMcpService:Hr,onDisconnectGoogleMcpAccount:Wr}),a(Q,{controller:K,onOrganized:()=>{try{globalThis.localStorage?.setItem("dot.sample.cleared","1")}catch{}Ln(!0),Jo("today"),ya({action:"workspace_brief_refresh"}),Vt(),kt.current.refreshNow()},renderFactorySlot:v.renderFactorySlot,slots:l.slots}),a(N,{controller:x,renderConversation:({projectId:t,target:s})=>!Gt&&typeof v.SessionProvider=="function"&&typeof v.renderSlot=="function"?a(m,{target:s,projectId:t,owner:"project",SessionProvider:v.SessionProvider,renderSlot:v.renderSlot,slotName:"dot.project.conversation",onOpenHistory:()=>Pt(s.sessionId)}):a("p",{role:"status"},"\u539F\u751F\u5BF9\u8BDD\u7EC4\u4EF6\u6682\u4E0D\u53EF\u7528\uFF0C\u8BF7\u6062\u590D Harness \u5DE5\u4F5C\u53F0\u540E\u91CD\u65B0\u6253\u5F00\uFF1B\u5DF2\u6709\u8349\u7A3F\u4ECD\u4FDD\u7559\u3002")}),Ye?a(q,{open:!0,closeLabel:"\u5173\u95ED",title:Ye==="project"?rt?.label??"\u9879\u76EE\u8BE6\u60C5":Ye==="follow"?"\u540E\u7EED\u600E\u4E48\u8DDF\u8FDB":Ye==="memory"?"\u7EA0\u6B63\u9879\u76EE\u8BB0\u5FC6":"\u672C\u6B21\u6267\u884C\u56DE\u590D",className:"pc_dot_modal",onClose:or},a("div",{className:"pc_dot_drawer"},Ne?a("p",{className:"pc_dot_error",role:"alert"},Ne):null,je?Yr:Ye==="project"?pr():Ye==="follow"?ur():Ye==="memory"?fr():mr())):null,Ja&&!gt?a(q,{open:!0,closeLabel:"\u5173\u95ED",title:"\u8FDE\u63A5\u5FAE\u4FE1\u4E0E\u9009\u62E9\u9879\u76EE",className:"pc_setup_modal",onClose:()=>{Kt(!1),Vt()}},a(zs,{renderFactorySlot:v.renderFactorySlot,close:()=>{Kt(!1),Vt()}})):null)}typeof l.layout?.selectPanel=="function"&&(l.effect(()=>{if(typeof document>"u")return;let v=document.createElement("style");return v.dataset.pluginCss="dsh-project-companion/workbench",v.textContent=ye+Oe+wn,document.head.appendChild(v),()=>v.remove()}),l.effect(()=>l.slots.inject("main",()=>l.slots.register({name:"main",key:W,children:{"dot.desktop.conversation":{kind:"single",scope:"session"},"dot.project.conversation":{kind:"single",scope:"session"}}},Ts))),l.effect(()=>l.slots.inject("dot.project.conversation",()=>l.slots.register({name:"dot.project.conversation"},g))),l.effect(()=>l.slots.inject("dot.desktop.conversation",()=>l.slots.register({name:"dot.desktop.conversation"},g))),l.effect(()=>l.slots.inject("dot.overlay.conversation",()=>l.slots.register({name:"dot.overlay.conversation"},g))),G(l,$s),l.effect(()=>l.slots.inject("sidebar.panellist",()=>l.slots.register({name:"sidebar.panellist",id:W,order:5,label:"DSH Dot"},sa))));let zs=v=>S(v,!1),Es=v=>a("div",null,S(v,!1),a(L),a(oe));l.effect(()=>l.slots.inject("settings.section",()=>l.slots.register({name:"settings.section",id:"project-companion",order:39,label:"DSH Dot"},Es))),(typeof l.get=="function"?l.get("configForms",!1):l.configForms)&&l.effect(()=>l.slots.inject("plugins.row.config",()=>l.slots.register({name:"plugins.row.config",key:"@oxmumu3/dsh-project-companion#project-companion"},v=>v.view==="summary"?"DeepSeek Dot \u7684\u4E2A\u4EBA\u8D44\u6599\u6765\u6E90\u4E0E\u539F\u751F\u51ED\u636E\u914D\u7F6E":a("div",{className:"pc_setup"},a("h3",null,"\u8FDE\u63A5\u51ED\u636E"),a(I)))))}return{inject:Ge,apply:u,createDotAppearance:lt,prepareDotDraft:Te,createDesktopConversationController:Qe,desktopConversationCanEmbed:at}}var mi="cf26e78";window.__ModuleLoader__.load({id:"@oxmumu3/dsh-project-companion",factory:d=>(console.log("dot client build "+mi),Nn(d))});
|
package/package.json
CHANGED
|
@@ -102,6 +102,8 @@ const CONFIRM_KIND_MAP = {
|
|
|
102
102
|
ios_vault_http: 'ios_vault_http',
|
|
103
103
|
vault_mcp: 'ios_vault_mcp',
|
|
104
104
|
ios_vault_mcp: 'ios_vault_mcp',
|
|
105
|
+
browser_action: 'ios_browser_action',
|
|
106
|
+
ios_browser_action: 'ios_browser_action',
|
|
105
107
|
wechat_ping: 'wechat_send',
|
|
106
108
|
wechat_send: 'wechat_send',
|
|
107
109
|
custom: 'superagent_dispatch',
|
|
@@ -232,6 +234,11 @@ function buildPayload(positionals, flags) {
|
|
|
232
234
|
...(flags['content-type'] ? { contentType: String(flags['content-type']) } : {}),
|
|
233
235
|
...(flags['headers-json'] ? { headersJson: String(flags['headers-json']) } : {}),
|
|
234
236
|
...(flags['tool-name'] ? { toolName: String(flags['tool-name']) } : {}),
|
|
237
|
+
...(flags['browser-op'] ? { browserOp: String(flags['browser-op']) } : {}),
|
|
238
|
+
...(flags['snapshot-id'] ? { snapshotId: String(flags['snapshot-id']) } : {}),
|
|
239
|
+
...(flags.index !== undefined ? { index: String(flags.index) } : {}),
|
|
240
|
+
...(flags.text !== undefined ? { text: String(flags.text) } : {}),
|
|
241
|
+
...(flags['press-enter'] !== undefined ? { pressEnter: toBool(flags['press-enter'], false) } : {}),
|
|
235
242
|
...(argsJsonFlag ? { argsJson: String(argsJsonFlag) } : {}),
|
|
236
243
|
...(stepsJson ? { comboStepsJson: String(stepsJson) } : {}),
|
|
237
244
|
...(body ? { body: String(body) } : {}),
|
|
@@ -5,7 +5,8 @@ const DEFAULT_TIMEOUT_MS = 12_000;
|
|
|
5
5
|
const VAULT_TIMEOUT_MS = 35_000;
|
|
6
6
|
const SHORTCUT_CALLBACK_TIMEOUT_MS = 45_000;
|
|
7
7
|
const PICK_TIMEOUT_MS = 60_000;
|
|
8
|
-
const
|
|
8
|
+
const BROWSER_TIMEOUT_MS = 180_000;
|
|
9
|
+
const MAX_TIMEOUT_MS = 180_000;
|
|
9
10
|
|
|
10
11
|
export const READ_ONLY_BLOCKED_DEVICE_TOOLS = new Set([
|
|
11
12
|
'alarms.create',
|
|
@@ -21,6 +22,10 @@ export const READ_ONLY_BLOCKED_DEVICE_TOOLS = new Set([
|
|
|
21
22
|
'music.control',
|
|
22
23
|
'shortcuts.run',
|
|
23
24
|
'combo.execute',
|
|
25
|
+
'browser.tap',
|
|
26
|
+
'browser.click',
|
|
27
|
+
'browser.type',
|
|
28
|
+
'browser.hand_to_user',
|
|
24
29
|
]);
|
|
25
30
|
|
|
26
31
|
function cleanText(value, fallback = '') {
|
|
@@ -43,6 +48,7 @@ const PRESERVED_PAYLOAD_KEYS = new Set([
|
|
|
43
48
|
'shortcutUrl', 'shortcutName', 'shortcutInput', 'recipeId', 'category',
|
|
44
49
|
'callbackStatus', 'comboStepsJson', 'stepCount', 'completedCount', 'spotlightIndexedCount',
|
|
45
50
|
'secretRef', 'method', 'url', 'body', 'contentType', 'headersJson', 'action', 'toolName', 'argsJson',
|
|
51
|
+
'browserOp', 'snapshotId', 'index', 'text', 'pressEnter', 'filePath', 'fileName', 'pageCount',
|
|
46
52
|
]);
|
|
47
53
|
|
|
48
54
|
export function sanitizeDeviceWidget(raw) {
|
|
@@ -127,6 +133,9 @@ export class DeviceToolHub {
|
|
|
127
133
|
this.clients.delete(clientId);
|
|
128
134
|
for (const [requestId, item] of this.pending.entries()) {
|
|
129
135
|
if (item.clientId === clientId) {
|
|
136
|
+
// Keep in-flight browser.* RPC alive across brief app switches (e.g. copying 2FA/SMS code)
|
|
137
|
+
// so the HTTP POST /api/device/tool-result on return can still settle the pending request.
|
|
138
|
+
if (item.tool.startsWith('browser.')) continue;
|
|
130
139
|
clearTimeout(item.timer);
|
|
131
140
|
this.pending.delete(requestId);
|
|
132
141
|
item.resolve({
|
|
@@ -276,11 +285,13 @@ export class DeviceToolHub {
|
|
|
276
285
|
const opId = typeof operationId === 'string' && operationId.trim()
|
|
277
286
|
? operationId.trim()
|
|
278
287
|
: (typeof args?.operationId === 'string' && args.operationId.trim() ? args.operationId.trim() : randomUUID());
|
|
279
|
-
const fallbackTimeout = cleanTool
|
|
280
|
-
?
|
|
281
|
-
: (cleanTool === '
|
|
282
|
-
?
|
|
283
|
-
: (
|
|
288
|
+
const fallbackTimeout = cleanTool.startsWith('browser.')
|
|
289
|
+
? BROWSER_TIMEOUT_MS
|
|
290
|
+
: (cleanTool === 'photos.pick'
|
|
291
|
+
? PICK_TIMEOUT_MS
|
|
292
|
+
: (cleanTool === 'shortcuts.run' && args?.waitForCallback === true
|
|
293
|
+
? SHORTCUT_CALLBACK_TIMEOUT_MS
|
|
294
|
+
: ((cleanTool === 'vault.http' || cleanTool === 'vault.mcp') ? VAULT_TIMEOUT_MS : DEFAULT_TIMEOUT_MS)));
|
|
284
295
|
const resolvedTimeout = Number.isFinite(Number(timeoutMs)) && Number(timeoutMs) > 0
|
|
285
296
|
? Math.min(Math.max(Number(timeoutMs), 1000), MAX_TIMEOUT_MS)
|
|
286
297
|
: fallbackTimeout;
|
|
@@ -83,10 +83,10 @@ export function dossierStatusRank(dossier, nowMs = Date.now()) {
|
|
|
83
83
|
if (status === 'done') return 3;
|
|
84
84
|
return 4;
|
|
85
85
|
}
|
|
86
|
-
const ACTION_TYPES = new Set(['ios_calendar_event', 'ios_reminder', 'ios_alarm', 'ios_shortcut', 'ios_combo', 'ios_vault_http', 'ios_vault_mcp', 'gmail_draft', 'wechat_send', 'superagent_dispatch', 'mcp_approval', 'micro_card_enable', 'sp_task_write']);
|
|
86
|
+
const ACTION_TYPES = new Set(['ios_calendar_event', 'ios_reminder', 'ios_alarm', 'ios_shortcut', 'ios_combo', 'ios_vault_http', 'ios_vault_mcp', 'ios_browser_action', 'gmail_draft', 'wechat_send', 'superagent_dispatch', 'mcp_approval', 'micro_card_enable', 'sp_task_write']);
|
|
87
87
|
const INTERNAL_EPHEMERAL_BUTLER_RE = /^dot-butler-(?:proactive|routine|selfcheck)-/;
|
|
88
88
|
const ANY_BUTLER_SESSION_RE = /^dot-butler-/;
|
|
89
|
-
const BUTLER_SURFACE_VERSION = '1.5.
|
|
89
|
+
const BUTLER_SURFACE_VERSION = '1.5.2-phone-browser-bridge';
|
|
90
90
|
const DEVICE_TOOL_SCHEMA_CHEATSHEET = [
|
|
91
91
|
'端侧工具参数速查(直接传给 `dot-butler-ctl device call --tool <名> --args-json \'<JSON>\'`):',
|
|
92
92
|
'- 闹钟/倒计时:`alarms.create {"title":"...","fireIso":"YYYY-MM-DDTHH:mm:ss+08:00"}` | `alarms.timer {"title":"...","durationSeconds":1500}` | `alarms.list {}` | `alarms.cancel {"alarmId":"..."}`',
|
|
@@ -96,6 +96,7 @@ const DEVICE_TOOL_SCHEMA_CHEATSHEET = [
|
|
|
96
96
|
'- 日历提醒:`calendar.query {"startIso":"<ISO>","endIso":"<ISO>"}` | 写日程:`confirm --kind calendar_create --title "..." --start "<ISO>" --end "<ISO>"` | `reminders.query {}` | `reminders.create {"title":"...","dueIso":"<ISO>"}` | `reminders.complete {"id":"..."}`',
|
|
97
97
|
'- 通讯录/相册/捷径/聚焦:`contacts.search {"query":"..."}` | `photos.recent_summary {"days":7}` | `photos.pick {}` | `shortcuts.list {}` | `shortcuts.recipes {}` | `shortcuts.run {"name":"...","input":"..."}` | `spotlight.status {}`',
|
|
98
98
|
'- 手机凭据库(零暴露直连手机钥匙串内已存服务如 flomo/Slack/Notion/GitHub/滴答/MCP):`vault.list {}` | `vault.http {"secretRef":"flomo","method":"POST","body":"{\\"content\\":\\"...\\"}"}` | `vault.http {"secretRef":"slack","method":"POST","url":"/conversations.list","body":"types=public_channel,private_channel"}` | `vault.mcp {"secretRef":"flomo_mcp","action":"list_tools"}` | `vault.mcp {"secretRef":"flomo_mcp","action":"call_tool","toolName":"...","arguments":{...}}`(密钥不出手机,读操作与 flomo 快捷写直通,外部写操作自动弹手机 Sentinel 准奏卡)',
|
|
99
|
+
'- 手机随身网页工作台(`browser` 模块 · 连 Mac 满血模式严格覆盖手机独立模式全部能力):`browser.navigate {"url":"https://..."}` | `browser.observe {}` | `browser.read {"max_chars":8000,"offset":0}` | `browser.tap {"snapshot_id":"...","index":1}` | `browser.type {"snapshot_id":"...","index":1,"text":"...","press_enter":false}` | `browser.scroll {"direction":"down","amount":1}` | `browser.back {}` | `browser.hand_to_user {"reason":"..."}` | `browser.export_pdf {"title":"..."}`(当用户人在手机旁需要登录/操作/打印万豪、航司、银行或内网个人网页时,直接用手机持久化网页工作台——新站或不可逆提交自动弹 Sentinel 准奏卡,登录/验证码/支付自动弹人工接管页让主人 Face ID 登录后交还,需要原样打印行程单时直接调 `browser.export_pdf` 在手机对话出 PDF 预览与 AirPrint 卡片)',
|
|
99
100
|
'- 复合场景联动卡:`confirm --kind combo_plan --title "<方案名>" --steps-json \'[{"type":"alarm_create","title":"早起准备","fireIso":"YYYY-MM-DDTHH:mm:ss+08:00"},{"type":"calendar_create","title":"<日程标题>","startIso":"...","endIso":"...","location":"<地点>"},{"type":"reminder_create","title":"出发带资料","fireIso":"..."},{"type":"map_handoff","destination":"<目的地>"}]\'`(支持 `alarm_create`/`timer_create`/`calendar_create`/`reminder_create`/`map_handoff`/`music_handoff`/`shortcut_run`)',
|
|
100
101
|
].join('\n');
|
|
101
102
|
const DEVICE_FAST_EXEC_RULE = [
|
|
@@ -118,7 +119,7 @@ export function buildButlerStaticGuide(ctl) {
|
|
|
118
119
|
`Dot 控制工具(推荐直接运行):${ctl}`,
|
|
119
120
|
'可用子命令:',
|
|
120
121
|
`- ${ctl} status`,
|
|
121
|
-
`- ${ctl} device capabilities | call --tool <alarms.list|alarms.create|alarms.timer|alarms.cancel|location.current|maps.search|maps.directions|maps.handoff|calendar.query|reminders.query|reminders.create|reminders.complete|music.now_playing|music.search|music.play|music.control|music.handoff|contacts.search|health.summary|photos.recent_summary|photos.pick|shortcuts.list|shortcuts.recipes|shortcuts.run|spotlight.status|vault.list|vault.http|vault.mcp> --args-json '<JSON>'`,
|
|
122
|
+
`- ${ctl} device capabilities | call --tool <alarms.list|alarms.create|alarms.timer|alarms.cancel|location.current|maps.search|maps.directions|maps.handoff|calendar.query|reminders.query|reminders.create|reminders.complete|music.now_playing|music.search|music.play|music.control|music.handoff|contacts.search|health.summary|photos.recent_summary|photos.pick|shortcuts.list|shortcuts.recipes|shortcuts.run|spotlight.status|vault.list|vault.http|vault.mcp|browser.navigate|browser.observe|browser.read|browser.tap|browser.type|browser.scroll|browser.back|browser.hand_to_user|browser.export_pdf> --args-json '<JSON>'`,
|
|
122
123
|
DEVICE_TOOL_SCHEMA_CHEATSHEET,
|
|
123
124
|
DEVICE_FAST_EXEC_RULE,
|
|
124
125
|
`- ${ctl} search --query "<关键词>" [--alternates "同义词1,同义词2"] [--workspace "<工作区ID>"]`,
|
|
@@ -129,7 +130,7 @@ export function buildButlerStaticGuide(ctl) {
|
|
|
129
130
|
`- ${ctl} reminder list | add --title "<内容>" [--note "<时间备注>"] | toggle --id <id> | remove --id <id>`,
|
|
130
131
|
`- ${ctl} memory list | add --bucket <identity|preferences|proactive_rules> --text "<提炼结论>" --quote "<用户原话精确子串>" | remove --id <id>`,
|
|
131
132
|
`- ${ctl} routine list | scratch-get --id <id> | scratch-set --id <id> --text "<便签>" | upsert [--id <id>] --title "<标题>" --prompt "<执行指令>" --cadence <daily|weekly|watch_mail|watch_workspace> [--time HH:MM] [--skip-if-scratch-empty true|false] [--notify-wechat true|false] | remove --id <id>`,
|
|
132
|
-
`- ${ctl} confirm --kind <email_draft|calendar_create|reminder_create|alarm_create|shortcut_run|combo_plan|vault_http|vault_mcp|wechat_ping|custom> --title "<动作标题>" [--account "<邮箱账号>"] [--recipient "<收件人>"] [--cc "<抄送>"] [--subject "<主题>"] [--start "<ISO>"] [--end "<ISO>"] [--fire-iso "<ISO>"] [--duration-seconds <秒>] [--shortcut-name "<捷径名>"] [--shortcut-input "<参数>"] [--secret-ref "<凭据别名>"] [--method "<HTTP方法>"] [--url "<相对路径或URL>"] [--tool-name "<MCP工具>"] [--args-json '<JSON>'] [--steps-json '<JSON数组>'] [--workspace "<工作区>"] [--body "<正文>"]`,
|
|
133
|
+
`- ${ctl} confirm --kind <email_draft|calendar_create|reminder_create|alarm_create|shortcut_run|combo_plan|vault_http|vault_mcp|browser_action|wechat_ping|custom> --title "<动作标题>" [--account "<邮箱账号>"] [--recipient "<收件人>"] [--cc "<抄送>"] [--subject "<主题>"] [--start "<ISO>"] [--end "<ISO>"] [--fire-iso "<ISO>"] [--duration-seconds <秒>] [--shortcut-name "<捷径名>"] [--shortcut-input "<参数>"] [--secret-ref "<凭据别名>"] [--method "<HTTP方法>"] [--url "<相对路径或URL>"] [--tool-name "<MCP工具>"] [--browser-op "<navigate|tap|type>"] [--snapshot-id "<快照ID>"] [--index <元素编号>] [--text "<输入文本>"] [--press-enter true|false] [--args-json '<JSON>'] [--steps-json '<JSON数组>'] [--workspace "<工作区>"] [--body "<正文>"]`,
|
|
133
134
|
`- ${ctl} delegate list | delegate --title "<事项标题>" --prompt "<完整任务要求与背景>" [--workspace "<工作区名或路径>"] [--session-id "<已有会话ID>"] [--preset standard|cordis]`,
|
|
134
135
|
`- ${ctl} dossier list [--include-archived true] | complete --id <id> | reopen --id <id> | pause --id <id>`,
|
|
135
136
|
`- ${ctl} doc --title "<文稿标题>" --markdown "<完整Markdown内容>" [--workspace "<工作区名>"]`,
|
|
@@ -147,7 +148,7 @@ const COMBO_STEP_LABELS = {
|
|
|
147
148
|
music_handoff: '音乐接力',
|
|
148
149
|
shortcut_run: '快捷指令',
|
|
149
150
|
};
|
|
150
|
-
const DEVICE_INTENT_RE = /闹钟|倒计时|地图|路线|导航|健康|睡眠|步数|心率|音乐|网易云|QQ音乐|听歌|播歌|放一首|通讯录|联系人|日历|日程|提醒|快捷指令|捷径|聚焦|联动|安排一下|安排好|安排妥当|见客户|赶高铁|赶飞机|出门|专注静音|番茄钟|flomo|slack|notion|github|linear|滴答|凭据库|vault|手机.*mcp|本机.*token|本机.*api
|
|
151
|
+
const DEVICE_INTENT_RE = /闹钟|倒计时|地图|路线|导航|健康|睡眠|步数|心率|音乐|网易云|QQ音乐|听歌|播歌|放一首|通讯录|联系人|日历|日程|提醒|快捷指令|捷径|聚焦|联动|安排一下|安排好|安排妥当|见客户|赶高铁|赶飞机|出门|专注静音|番茄钟|flomo|slack|notion|github|linear|滴答|凭据库|vault|手机.*mcp|本机.*token|本机.*api|网页工作台|手机.*浏览器|手机.*登录|手机.*打开.*网页|打印.*网页|万豪|行程单|登机牌|browser\./i;
|
|
151
152
|
const EXPLICIT_GOOGLE_INTENT_RE = /gmail|google|邮件|邮箱|收件箱|回信|回邮|草稿|发邮件|云端硬盘|drive|回复这封|这封邮件|那封邮件/i;
|
|
152
153
|
const GOOGLE_SHORT_FOLLOWUP_RE = /^(好的|收到|明白|知道了|已提交|已确认|不用管|忽略|帮我回|帮我拟|回一下|确认一下|取消|改期|谢谢)/i;
|
|
153
154
|
|
|
@@ -3455,7 +3456,7 @@ export class DotBridgeStore extends EventEmitter {
|
|
|
3455
3456
|
'<dot_butler_surface>',
|
|
3456
3457
|
'你是用户在 DSH Dot 手机主会话的「小参谋 / 私人总管家」,像能干的 team leader 一样对最终结果端到端负责,绝不要说「我没有权限 / 请你自己在电脑或终端执行」。',
|
|
3457
3458
|
...(surfaceVersionChanged ? [
|
|
3458
|
-
'【能力升级生效】本机 Bridge 已升级至 1.5.1
|
|
3459
|
+
'【能力升级生效】本机 Bridge 已升级至 1.5.2(公开包 0.44.1):连着 Mac 满血模式的端侧能力严格大于等于手机独立模式。「随身网页工作台」(`browser.navigate` / `observe` / `read` / `tap` / `type` / `scroll` / `back` / `hand_to_user` / `export_pdf` 共 9 工具)及「个人服务凭据库」(`vault.*`)已全部作为端侧模块暴露给主管家与 MCP——Mac 在线时可直接驱动手头手机的持久化浏览器登录个人网页、弹窗让主人 Face ID/验证码接管并原样导出可 AirPrint 打印的 PDF,绝不要说「连 Mac 没注册 browser.*」;全能大管家面对缺能力/外部接入时请直接排查或 `delegate --preset cordis` 补齐实现;遇到手机端能力请求须直接调用 `dot-butler-ctl device capabilities` / `device call` 或 `confirm`。',
|
|
3459
3460
|
] : []),
|
|
3460
3461
|
'',
|
|
3461
3462
|
buildButlerStaticGuide(ctl),
|
|
@@ -3548,6 +3549,7 @@ export class DotBridgeStore extends EventEmitter {
|
|
|
3548
3549
|
turnId: turnId || null,
|
|
3549
3550
|
sessionId: null,
|
|
3550
3551
|
userMessage: latestUserMessage,
|
|
3552
|
+
readOnly: body.readOnly === true,
|
|
3551
3553
|
widgets: [],
|
|
3552
3554
|
artifactIds: new Set(),
|
|
3553
3555
|
createdArtifactIds: new Set(),
|
|
@@ -3926,9 +3928,22 @@ export class DotBridgeStore extends EventEmitter {
|
|
|
3926
3928
|
};
|
|
3927
3929
|
}
|
|
3928
3930
|
const isVaultTool = toolName === 'vault.http' || toolName === 'vault.mcp';
|
|
3929
|
-
const
|
|
3930
|
-
|
|
3931
|
-
|
|
3931
|
+
const isBrowserTool = toolName.startsWith('browser.');
|
|
3932
|
+
if (effectiveScope.readOnly && isBrowserTool && !['browser.observe', 'browser.read', 'browser.read_text'].includes(toolName)) {
|
|
3933
|
+
return {
|
|
3934
|
+
ok: false,
|
|
3935
|
+
code: 'readonly_blocked',
|
|
3936
|
+
error: '当前只读巡检模式禁止驱动手机浏览器访问或操作网页',
|
|
3937
|
+
};
|
|
3938
|
+
}
|
|
3939
|
+
const sanitizedToolArgs = { ...toolArgs };
|
|
3940
|
+
delete sanitizedToolArgs._userText;
|
|
3941
|
+
let invokedArgs = effectiveScope.readOnly && isVaultTool
|
|
3942
|
+
? { ...sanitizedToolArgs, readOnly: true }
|
|
3943
|
+
: sanitizedToolArgs;
|
|
3944
|
+
if (toolName === 'browser.navigate' && typeof effectiveScope.userMessage?.text === 'string' && effectiveScope.userMessage.text.trim()) {
|
|
3945
|
+
invokedArgs = { ...invokedArgs, _userText: effectiveScope.userMessage.text };
|
|
3946
|
+
}
|
|
3932
3947
|
const out = await this.deviceToolHub.invokeTool({
|
|
3933
3948
|
tool: toolName,
|
|
3934
3949
|
args: invokedArgs,
|
|
@@ -3936,6 +3951,47 @@ export class DotBridgeStore extends EventEmitter {
|
|
|
3936
3951
|
operationId: args.operationId,
|
|
3937
3952
|
preferredClientId: args.clientId || null,
|
|
3938
3953
|
});
|
|
3954
|
+
if (isBrowserTool && (out.code === 'confirmation_required' || out.result?.code === 'confirmation_required')) {
|
|
3955
|
+
if (effectiveScope.readOnly) {
|
|
3956
|
+
return {
|
|
3957
|
+
ok: false,
|
|
3958
|
+
code: 'readonly_blocked',
|
|
3959
|
+
error: '当前只读巡检模式禁止执行需要确认的网页操作',
|
|
3960
|
+
};
|
|
3961
|
+
}
|
|
3962
|
+
const browserOp = String(out.result?.browserOp || (toolName === 'browser.navigate' ? 'navigate' : (toolName === 'browser.type' ? 'type' : 'tap'))).trim();
|
|
3963
|
+
const targetUrl = String(out.result?.url || sanitizedToolArgs.url || '').trim();
|
|
3964
|
+
const snapshotId = String(out.result?.snapshotId || sanitizedToolArgs.snapshot_id || sanitizedToolArgs.snapshotId || '').trim();
|
|
3965
|
+
const rawIndex = out.result?.index ?? sanitizedToolArgs.index ?? sanitizedToolArgs.ref;
|
|
3966
|
+
const indexStr = rawIndex != null && String(rawIndex).trim() ? String(rawIndex).trim() : '';
|
|
3967
|
+
const textVal = out.result?.text ?? sanitizedToolArgs.text ?? '';
|
|
3968
|
+
const enterVal = out.result?.pressEnter ?? sanitizedToolArgs.press_enter ?? sanitizedToolArgs.pressEnter ?? false;
|
|
3969
|
+
const riskLevel = String(out.result?.riskLevel || 'high').trim() === 'standard' ? 'standard' : 'high';
|
|
3970
|
+
const label = String(out.result?.title || out.result?.summary || '确认网页操作').trim();
|
|
3971
|
+
const defaultPrimary = browserOp === 'navigate' ? '准奏访问' : (browserOp === 'type' ? '准奏提交' : '准奏点击');
|
|
3972
|
+
const widget = this.#stageAction({
|
|
3973
|
+
actionType: 'ios_browser_action',
|
|
3974
|
+
title: label,
|
|
3975
|
+
subtitle: out.error || out.result?.error || '该网页操作受手机 Sentinel 保护,需主人点击准奏卡确认后执行',
|
|
3976
|
+
browserOp,
|
|
3977
|
+
...(targetUrl ? { url: targetUrl } : {}),
|
|
3978
|
+
...(snapshotId ? { snapshotId } : {}),
|
|
3979
|
+
...(indexStr ? { index: indexStr } : {}),
|
|
3980
|
+
...(String(textVal) ? { text: String(textVal) } : {}),
|
|
3981
|
+
...(browserOp === 'type' ? { pressEnter: enterVal === true || enterVal === 'true' ? 'true' : 'false' } : {}),
|
|
3982
|
+
riskLevel,
|
|
3983
|
+
primaryLabel: defaultPrimary,
|
|
3984
|
+
}, effectiveScope.sessionId);
|
|
3985
|
+
await this.#emitWidget(effectiveScope, widget);
|
|
3986
|
+
this.#saveState();
|
|
3987
|
+
return {
|
|
3988
|
+
ok: true,
|
|
3989
|
+
confirmationRequired: true,
|
|
3990
|
+
actionId: widget.actionId,
|
|
3991
|
+
widget,
|
|
3992
|
+
note: '该网页操作受手机 Sentinel 保护,已弹出准奏卡等待主人确认;确认后即可继续调用 browser.observe 接续操作。',
|
|
3993
|
+
};
|
|
3994
|
+
}
|
|
3939
3995
|
if (isVaultTool && (out.code === 'confirmation_required' || out.result?.code === 'confirmation_required')) {
|
|
3940
3996
|
if (effectiveScope.readOnly) {
|
|
3941
3997
|
return {
|
|
@@ -4281,10 +4337,11 @@ export class DotBridgeStore extends EventEmitter {
|
|
|
4281
4337
|
throw new Error('后台主动唤醒仅支持预备日程、闹钟、邮件草稿或组合确认卡');
|
|
4282
4338
|
}
|
|
4283
4339
|
const isVaultConfirm = args.actionType === 'ios_vault_http' || args.actionType === 'ios_vault_mcp';
|
|
4340
|
+
const isBrowserConfirm = args.actionType === 'ios_browser_action';
|
|
4284
4341
|
const title = sanitizeForMobileText(args.title, '待确认动作');
|
|
4285
4342
|
const payload = { title };
|
|
4286
4343
|
for (const key of ['account', 'to', 'cc', 'subject', 'body', 'startIso', 'endIso', 'dueIso', 'fireIso', 'durationSeconds', 'repeatDays', 'location', 'workspaceTitle', 'instructions', 'shortcutName', 'shortcutInput', 'recipeId', 'cardId', 'pinnedToToday', 'cadenceLabel', 'sourceSummary']) {
|
|
4287
|
-
if (isVaultConfirm && key === 'body') continue;
|
|
4344
|
+
if ((isVaultConfirm || isBrowserConfirm) && key === 'body') continue;
|
|
4288
4345
|
if (args[key] == null) continue;
|
|
4289
4346
|
const rawStr = typeof args[key] === 'string' ? args[key] : String(args[key]);
|
|
4290
4347
|
payload[key] = key === 'body' || key === 'instructions'
|
|
@@ -4358,6 +4415,44 @@ export class DotBridgeStore extends EventEmitter {
|
|
|
4358
4415
|
...(payload.argsJson && payload.argsJson !== '{}' ? [{ label: '参数摘要', value: sanitizeForMobileText(payload.argsJson).slice(0, 120) }] : []),
|
|
4359
4416
|
];
|
|
4360
4417
|
}
|
|
4418
|
+
let browserFields = null;
|
|
4419
|
+
if (args.actionType === 'ios_browser_action') {
|
|
4420
|
+
const browserOp = String(args.browserOp || args.payload?.browserOp || 'navigate').trim().toLowerCase();
|
|
4421
|
+
if (!['navigate', 'tap', 'type'].includes(browserOp)) {
|
|
4422
|
+
throw new Error('browserOp 仅支持 navigate / tap / type');
|
|
4423
|
+
}
|
|
4424
|
+
const targetUrl = args.url ?? args.payload?.url;
|
|
4425
|
+
const snapshotId = args.snapshotId ?? args.payload?.snapshotId;
|
|
4426
|
+
const rawIndex = args.index ?? args.payload?.index;
|
|
4427
|
+
const rawText = args.text ?? args.payload?.text;
|
|
4428
|
+
const rawEnter = args.pressEnter ?? args.payload?.pressEnter;
|
|
4429
|
+
payload.browserOp = browserOp;
|
|
4430
|
+
if (browserOp === 'navigate') {
|
|
4431
|
+
const cleanUrl = String(targetUrl || '').trim();
|
|
4432
|
+
if (!cleanUrl) throw new Error('网页访问确认卡必须提供 url');
|
|
4433
|
+
payload.url = cleanUrl;
|
|
4434
|
+
} else {
|
|
4435
|
+
const idxNum = Number(rawIndex);
|
|
4436
|
+
if (!Number.isInteger(idxNum) || idxNum <= 0) {
|
|
4437
|
+
throw new Error('网页点击/输入确认卡必须提供有效元素编号 index');
|
|
4438
|
+
}
|
|
4439
|
+
payload.index = String(idxNum);
|
|
4440
|
+
if (snapshotId != null && String(snapshotId).trim()) {
|
|
4441
|
+
payload.snapshotId = String(snapshotId).trim();
|
|
4442
|
+
}
|
|
4443
|
+
if (browserOp === 'type') {
|
|
4444
|
+
payload.text = rawText != null ? String(rawText) : '';
|
|
4445
|
+
payload.pressEnter = rawEnter === true || rawEnter === 'true' ? 'true' : 'false';
|
|
4446
|
+
}
|
|
4447
|
+
}
|
|
4448
|
+
const opLabel = browserOp === 'navigate' ? '打开新网站' : (browserOp === 'type' ? '填写网页表单' : '点击网页元素');
|
|
4449
|
+
browserFields = [
|
|
4450
|
+
{ label: '网页动作', value: opLabel },
|
|
4451
|
+
...(payload.url ? [{ label: '目标网址', value: sanitizeForMobileText(payload.url).slice(0, 160) }] : []),
|
|
4452
|
+
...(payload.index ? [{ label: '目标元素', value: `@e${payload.index}` }] : []),
|
|
4453
|
+
...(payload.text ? [{ label: '输入内容', value: sanitizeForMobileText(payload.text).slice(0, 120) }] : []),
|
|
4454
|
+
];
|
|
4455
|
+
}
|
|
4361
4456
|
let comboFields = null;
|
|
4362
4457
|
if (args.actionType === 'ios_combo') {
|
|
4363
4458
|
let rawSteps = Array.isArray(args.steps) ? args.steps : null;
|
|
@@ -4433,15 +4528,20 @@ export class DotBridgeStore extends EventEmitter {
|
|
|
4433
4528
|
? '确认后拉起手机快捷指令执行'
|
|
4434
4529
|
: (args.actionType === 'ios_vault_http' || args.actionType === 'ios_vault_mcp'
|
|
4435
4530
|
? '确认后由手机本机注入钥匙串凭据执行外部写入(密钥不出手机)'
|
|
4436
|
-
: (args.actionType === '
|
|
4437
|
-
? '
|
|
4438
|
-
: (args.actionType === '
|
|
4439
|
-
? '
|
|
4440
|
-
: '
|
|
4531
|
+
: (args.actionType === 'ios_browser_action'
|
|
4532
|
+
? '确认后在手机随身网页工作台执行该网页操作'
|
|
4533
|
+
: (args.actionType === 'mcp_approval'
|
|
4534
|
+
? '来自电脑端协作工具的拍板请求'
|
|
4535
|
+
: (args.actionType === 'micro_card_enable'
|
|
4536
|
+
? '启用个人专属宣纸微卡片(仅纯数据渲染,零代码下发)'
|
|
4537
|
+
: '确认后执行')))));
|
|
4441
4538
|
const customPrimary = typeof args.primaryLabel === 'string' && args.primaryLabel.trim()
|
|
4442
4539
|
? sanitizeForMobileText(args.primaryLabel).slice(0, 16)
|
|
4443
4540
|
: '';
|
|
4444
|
-
const
|
|
4541
|
+
const browserDefaultPrimary = args.actionType === 'ios_browser_action'
|
|
4542
|
+
? (payload.browserOp === 'navigate' ? '准奏访问' : (payload.browserOp === 'type' ? '准奏提交' : '准奏点击'))
|
|
4543
|
+
: '';
|
|
4544
|
+
const primaryLabel = customPrimary || browserDefaultPrimary || (args.actionType === 'ios_combo'
|
|
4445
4545
|
? '全部执行'
|
|
4446
4546
|
: (args.actionType === 'ios_shortcut'
|
|
4447
4547
|
? '运行快捷指令'
|
|
@@ -4477,7 +4577,7 @@ export class DotBridgeStore extends EventEmitter {
|
|
|
4477
4577
|
...(args.source ? { source: sanitizeForMobileText(String(args.source), 'butler').slice(0, 32) } : {}),
|
|
4478
4578
|
...(args.caller ? { caller: sanitizeForMobileText(String(args.caller), 'external').slice(0, 48) } : {}),
|
|
4479
4579
|
...(resumeContext ? { resumeContext } : {}),
|
|
4480
|
-
fields: comboFields || vaultFields || extraFields || Object.entries(payload)
|
|
4580
|
+
fields: comboFields || vaultFields || browserFields || extraFields || Object.entries(payload)
|
|
4481
4581
|
.filter(([key]) => ['account', 'to', 'cc', 'subject', 'startIso', 'endIso', 'dueIso', 'fireIso', 'durationSeconds', 'location', 'workspaceTitle', 'shortcutName', 'shortcutInput'].includes(key))
|
|
4482
4582
|
.map(([key, value]) => ({
|
|
4483
4583
|
label: ({
|
|
@@ -4538,6 +4638,7 @@ export class DotBridgeStore extends EventEmitter {
|
|
|
4538
4638
|
'ios_combo',
|
|
4539
4639
|
'ios_vault_http',
|
|
4540
4640
|
'ios_vault_mcp',
|
|
4641
|
+
'ios_browser_action',
|
|
4541
4642
|
]);
|
|
4542
4643
|
const cleanType = allowedMcpActionTypes.has(actionType) ? actionType : 'mcp_approval';
|
|
4543
4644
|
const extraPayload = payload && typeof payload === 'object' && !Array.isArray(payload) ? payload : {};
|
|
@@ -5873,7 +5974,7 @@ export class DotBridgeStore extends EventEmitter {
|
|
|
5873
5974
|
} else if (pending.actionType === 'mcp_approval') {
|
|
5874
5975
|
pending.status = 'executed';
|
|
5875
5976
|
pending.receiptText = sanitizeForMobileText(receiptText || '主人已在手机端准奏放行', '已准奏');
|
|
5876
|
-
} else if (['ios_calendar_event', 'ios_reminder', 'ios_alarm', 'ios_shortcut', 'ios_combo', 'ios_vault_http', 'ios_vault_mcp'].includes(pending.actionType)) {
|
|
5977
|
+
} else if (['ios_calendar_event', 'ios_reminder', 'ios_alarm', 'ios_shortcut', 'ios_combo', 'ios_vault_http', 'ios_vault_mcp', 'ios_browser_action'].includes(pending.actionType)) {
|
|
5877
5978
|
if (!clientExecuted) return { ok: false, error: '等待手机系统写入回执', status: 'pending', snapshot: this.getSnapshot() };
|
|
5878
5979
|
pending.status = 'executed';
|
|
5879
5980
|
pending.receiptText = sanitizeForMobileText(receiptText, '手机已回报写入成功');
|
|
@@ -71,7 +71,12 @@ export function classifyMediaFile(fileNameOrExt, explicitKind = 'auto', explicit
|
|
|
71
71
|
|
|
72
72
|
let kind = mapped.kind;
|
|
73
73
|
const cleanExplicitKind = String(explicitKind || '').trim().toLowerCase();
|
|
74
|
-
if (
|
|
74
|
+
if (
|
|
75
|
+
cleanExplicitKind
|
|
76
|
+
&& cleanExplicitKind !== 'auto'
|
|
77
|
+
&& VALID_KINDS.has(cleanExplicitKind)
|
|
78
|
+
&& !(cleanExplicitKind === 'file' && mapped.kind !== 'file')
|
|
79
|
+
) {
|
|
75
80
|
kind = cleanExplicitKind;
|
|
76
81
|
}
|
|
77
82
|
|
|
@@ -82,6 +87,9 @@ export function classifyMediaFile(fileNameOrExt, explicitKind = 'auto', explicit
|
|
|
82
87
|
? `${cleanMime}; charset=utf-8`
|
|
83
88
|
: cleanMime;
|
|
84
89
|
}
|
|
90
|
+
if (kind === 'file' && mimeType.includes('pdf')) {
|
|
91
|
+
kind = 'pdf';
|
|
92
|
+
}
|
|
85
93
|
|
|
86
94
|
return { kind, mimeType, ext: cleanExt };
|
|
87
95
|
}
|
|
@@ -11,6 +11,7 @@ export const HIGH_RISK_ACTION_TYPES = new Set([
|
|
|
11
11
|
'ios_combo',
|
|
12
12
|
'ios_vault_http',
|
|
13
13
|
'ios_vault_mcp',
|
|
14
|
+
'ios_browser_action',
|
|
14
15
|
'mcp_approval',
|
|
15
16
|
]);
|
|
16
17
|
|
|
@@ -74,7 +75,7 @@ const CARD_CANDIDATE_RE = /(?<![A-Fa-f0-9])(?:\d[ -]?){15,18}\d(?![A-Fa-f0-9])/g
|
|
|
74
75
|
|
|
75
76
|
function extractOutboundStrings(payload) {
|
|
76
77
|
if (!payload || typeof payload !== 'object') return [];
|
|
77
|
-
const fields = ['title', 'subject', 'body', 'instructions', 'shortcutInput', 'notes', 'url', 'headersJson', 'argsJson'];
|
|
78
|
+
const fields = ['title', 'subject', 'body', 'instructions', 'shortcutInput', 'notes', 'url', 'headersJson', 'argsJson', 'text'];
|
|
78
79
|
const values = [];
|
|
79
80
|
for (const key of fields) {
|
|
80
81
|
if (typeof payload[key] === 'string' && payload[key].trim()) {
|
|
@@ -23,6 +23,7 @@ const MCP_EXPOSED_MODULES = new Set([
|
|
|
23
23
|
'health',
|
|
24
24
|
'shortcuts',
|
|
25
25
|
'vault',
|
|
26
|
+
'browser',
|
|
26
27
|
]);
|
|
27
28
|
|
|
28
29
|
const MCP_EXPOSED_DEVICE_TOOLS = new Set([
|
|
@@ -51,6 +52,15 @@ const MCP_EXPOSED_DEVICE_TOOLS = new Set([
|
|
|
51
52
|
'vault.list',
|
|
52
53
|
'vault.http',
|
|
53
54
|
'vault.mcp',
|
|
55
|
+
'browser.navigate',
|
|
56
|
+
'browser.observe',
|
|
57
|
+
'browser.read',
|
|
58
|
+
'browser.tap',
|
|
59
|
+
'browser.type',
|
|
60
|
+
'browser.scroll',
|
|
61
|
+
'browser.back',
|
|
62
|
+
'browser.hand_to_user',
|
|
63
|
+
'browser.export_pdf',
|
|
54
64
|
]);
|
|
55
65
|
|
|
56
66
|
function normalizeClientCallerName(rawName) {
|
|
@@ -254,6 +264,33 @@ export const MCP_TOOLS = [
|
|
|
254
264
|
},
|
|
255
265
|
},
|
|
256
266
|
},
|
|
267
|
+
{
|
|
268
|
+
name: 'iphone_browser',
|
|
269
|
+
description: 'Drive the persistent on-device browser workbench on the paired phone (with persistent cookies/sessions, Face ID/AutoFill user takeover on login/OTP/payment walls, Sentinel confirmation cards for new sites or irreversible actions, and full-page PDF export).',
|
|
270
|
+
inputSchema: {
|
|
271
|
+
type: 'object',
|
|
272
|
+
additionalProperties: false,
|
|
273
|
+
required: ['action'],
|
|
274
|
+
properties: {
|
|
275
|
+
action: {
|
|
276
|
+
type: 'string',
|
|
277
|
+
description: 'navigate | observe | read | tap | type | scroll | back | hand_to_user | export_pdf',
|
|
278
|
+
},
|
|
279
|
+
url: { type: 'string', description: 'Target https:// or http:// URL when action=navigate' },
|
|
280
|
+
snapshotId: { type: 'string', description: 'Snapshot ID from observe/navigate when action=tap or type' },
|
|
281
|
+
index: { type: 'number', description: 'Element @eN index when action=tap or type' },
|
|
282
|
+
text: { type: 'string', description: 'Text to type when action=type' },
|
|
283
|
+
pressEnter: { type: 'boolean', description: 'Whether to submit after typing when action=type' },
|
|
284
|
+
direction: { type: 'string', description: 'up | down when action=scroll' },
|
|
285
|
+
amount: { type: 'number', description: 'Scroll screens (1-5) when action=scroll' },
|
|
286
|
+
maxChars: { type: 'number', description: 'Maximum characters to extract when action=read' },
|
|
287
|
+
offset: { type: 'number', description: 'Character offset when action=read' },
|
|
288
|
+
reason: { type: 'string', description: 'Reason shown to user when action=hand_to_user' },
|
|
289
|
+
title: { type: 'string', description: 'Suggested PDF filename/title when action=export_pdf' },
|
|
290
|
+
waitSeconds: { type: 'number', description: 'Optional seconds (0-120) to wait if a Sentinel confirmation card is staged' },
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
},
|
|
257
294
|
{
|
|
258
295
|
name: 'iphone_request_approval',
|
|
259
296
|
description: 'Push a Sentinel-guarded approval card directly to the user\'s iPhone Lock Screen / Dynamic Island before executing sensitive Mac/cloud actions, optionally blocking until approved or cancelled.',
|
|
@@ -768,6 +805,63 @@ export function createIphoneMcpServer({
|
|
|
768
805
|
}
|
|
769
806
|
return out;
|
|
770
807
|
}
|
|
808
|
+
if (name === 'iphone_browser') {
|
|
809
|
+
const action = String(args.action || '').trim().toLowerCase();
|
|
810
|
+
const allowedActions = new Set([
|
|
811
|
+
'navigate',
|
|
812
|
+
'observe',
|
|
813
|
+
'read',
|
|
814
|
+
'tap',
|
|
815
|
+
'type',
|
|
816
|
+
'scroll',
|
|
817
|
+
'back',
|
|
818
|
+
'hand_to_user',
|
|
819
|
+
'export_pdf',
|
|
820
|
+
]);
|
|
821
|
+
if (!allowedActions.has(action)) {
|
|
822
|
+
return { ok: false, code: 'invalid_request', error: `不支持的 browser action: ${action}` };
|
|
823
|
+
}
|
|
824
|
+
const tool = `browser.${action}`;
|
|
825
|
+
const toolArgs = {};
|
|
826
|
+
if (args.url != null) toolArgs.url = String(args.url);
|
|
827
|
+
if (args.snapshotId != null) toolArgs.snapshot_id = String(args.snapshotId);
|
|
828
|
+
if (args.index != null) toolArgs.index = Number(args.index);
|
|
829
|
+
if (args.text != null) toolArgs.text = String(args.text);
|
|
830
|
+
if (args.pressEnter !== undefined) toolArgs.press_enter = args.pressEnter === true;
|
|
831
|
+
if (args.direction != null) toolArgs.direction = String(args.direction);
|
|
832
|
+
if (args.amount != null) toolArgs.amount = Number(args.amount);
|
|
833
|
+
if (args.maxChars != null) toolArgs.max_chars = Number(args.maxChars);
|
|
834
|
+
if (args.offset != null) toolArgs.offset = Number(args.offset);
|
|
835
|
+
if (args.reason != null) toolArgs.reason = String(args.reason);
|
|
836
|
+
if (args.title != null) toolArgs.title = String(args.title);
|
|
837
|
+
|
|
838
|
+
const out = await callBridgeMcp({
|
|
839
|
+
op: 'invoke',
|
|
840
|
+
tool,
|
|
841
|
+
args: toolArgs,
|
|
842
|
+
timeoutMs: 180_000,
|
|
843
|
+
});
|
|
844
|
+
if (out?.ok) return { ok: true, ...(out.result || {}) };
|
|
845
|
+
if (out?.code === 'confirmation_required' || out?.result?.code === 'confirmation_required') {
|
|
846
|
+
const browserOp = out?.result?.browserOp || (action === 'navigate' ? 'navigate' : (action === 'type' ? 'type' : 'tap'));
|
|
847
|
+
const summary = out?.result?.summary || out?.result?.title || `确认网页${browserOp}`;
|
|
848
|
+
return stageWithOptionalWait({
|
|
849
|
+
actionType: 'ios_browser_action',
|
|
850
|
+
title: out?.result?.title || summary,
|
|
851
|
+
summary,
|
|
852
|
+
riskLevel: out?.result?.riskLevel === 'standard' ? 'standard' : 'high',
|
|
853
|
+
payload: {
|
|
854
|
+
browserOp,
|
|
855
|
+
...(out?.result?.url || args.url ? { url: String(out?.result?.url || args.url) } : {}),
|
|
856
|
+
...(out?.result?.snapshotId || args.snapshotId ? { snapshotId: String(out?.result?.snapshotId || args.snapshotId) } : {}),
|
|
857
|
+
...((out?.result?.index ?? args.index) != null ? { index: String(out?.result?.index ?? args.index) } : {}),
|
|
858
|
+
...(out?.result?.text != null || args.text != null ? { text: String(out?.result?.text ?? args.text) } : {}),
|
|
859
|
+
...(browserOp === 'type' ? { pressEnter: (out?.result?.pressEnter ?? args.pressEnter) ? 'true' : 'false' } : {}),
|
|
860
|
+
},
|
|
861
|
+
}, args.waitSeconds);
|
|
862
|
+
}
|
|
863
|
+
return out;
|
|
864
|
+
}
|
|
771
865
|
if (name === 'iphone_request_approval') {
|
|
772
866
|
const waitSec = args.waitSeconds === undefined ? 60 : Number(args.waitSeconds);
|
|
773
867
|
return stageWithOptionalWait({
|