console: 任务列表服务端分页 + 控制台分页面签

任务列表分页(服务端 + 前端):
- GET /tasks 新增 limit(1..100,非法回 400)、offset、
  order=desc、status/executor/q 服务端过滤;回 total(过滤后
  计数)与 status_counts(全项目统计,不受过滤与分页影响,
  数据卡片不再把当前页当成全项目);无 limit 时旧行为不变
  (全量、正序,协调子任务与旧调用不受影响)。
- 前端每页 20 条、最新在前,上一页/下一页 + 页码;筛选与
  搜索改服务端过滤(搜索防抖 300ms),切筛选/切项目/派发
  后回第 1 页,10 秒刷新与刷新按钮停在当前页;新测试
  test_task_list_pagination.py 5 项。

分页面签:
- 顶栏锚点导航改成 5 个页签:工作台(派发 + 任务列表 +
  对话 + 详情)、项目(项目 + 成员)、环境与 Workers、
  技能与自动化(技能 + 自动化 + 分诊)、管理与 Key;
  数据卡片仍在页签上方常驻。选中任务存在 App 层 store
  里,切页不丢,回来仍是同一任务、10 秒刷新续同步;
  页签同步到 location.hash(#tab-workbench 等),刷新与
  分享链接落在同一页签;窄屏工作台仍保持派发在前的顺序。
- 工作台页签仍是左(任务)右(派发/对话/详情)两栏,
  沿用等高内部滚动规则;其它页签单列堆叠。
This commit is contained in:
host committed 2026-10-30 02:25:48 +08:00
1 parent 9a11ef27b8
commit e5b6c45c83
11 files changed
+443 -122

No files matched your search

+22 -22
View File
@@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Codex 命令台</title>
<script type="module" crossorigin>(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const _ of document.querySelectorAll('link[rel="modulepreload"]'))o(_);new MutationObserver(_=>{for(const C of _)if(C.type==="childList")for(const N of C.addedNodes)N.tagName==="LINK"&&N.rel==="modulepreload"&&o(N)}).observe(document,{childList:!0,subtree:!0});function m(_){const C={};return _.integrity&&(C.integrity=_.integrity),_.referrerPolicy&&(C.referrerPolicy=_.referrerPolicy),_.crossOrigin==="use-credentials"?C.credentials="include":_.crossOrigin==="anonymous"?C.credentials="omit":C.credentials="same-origin",C}function o(_){if(_.ep)return;_.ep=!0;const C=m(_);fetch(_.href,C)}})();function kh(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var nr={exports:{}},ui={};/**
<script type="module" crossorigin>(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const _ of document.querySelectorAll('link[rel="modulepreload"]'))o(_);new MutationObserver(_=>{for(const N of _)if(N.type==="childList")for(const C of N.addedNodes)C.tagName==="LINK"&&C.rel==="modulepreload"&&o(C)}).observe(document,{childList:!0,subtree:!0});function m(_){const N={};return _.integrity&&(N.integrity=_.integrity),_.referrerPolicy&&(N.referrerPolicy=_.referrerPolicy),_.crossOrigin==="use-credentials"?N.credentials="include":_.crossOrigin==="anonymous"?N.credentials="omit":N.credentials="same-origin",N}function o(_){if(_.ep)return;_.ep=!0;const N=m(_);fetch(_.href,N)}})();function Qh(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var nr={exports:{}},ui={};/**
* @license React
* react-jsx-runtime.production.js
*
@@ -12,7 +12,7 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Ah;function My(){if(Ah)return ui;Ah=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function m(o,_,C){var N=null;if(C!==void 0&&(N=""+C),_.key!==void 0&&(N=""+_.key),"key"in _){C={};for(var b in _)b!=="key"&&(C[b]=_[b])}else C=_;return _=C.ref,{$$typeof:i,type:o,key:N,ref:_!==void 0?_:null,props:C}}return ui.Fragment=r,ui.jsx=m,ui.jsxs=m,ui}var Oh;function zy(){return Oh||(Oh=1,nr.exports=My()),nr.exports}var c=zy(),ur={exports:{}},st={};/**
*/var Mh;function Dy(){if(Mh)return ui;Mh=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function m(o,_,N){var C=null;if(N!==void 0&&(C=""+N),_.key!==void 0&&(C=""+_.key),"key"in _){N={};for(var b in _)b!=="key"&&(N[b]=_[b])}else N=_;return _=N.ref,{$$typeof:i,type:o,key:C,ref:_!==void 0?_:null,props:N}}return ui.Fragment=r,ui.jsx=m,ui.jsxs=m,ui}var Oh;function Uy(){return Oh||(Oh=1,nr.exports=Dy()),nr.exports}var c=Uy(),ur={exports:{}},ft={};/**
* @license React
* react.production.js
*
@@ -20,7 +20,7 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Mh;function Ry(){if(Mh)return st;Mh=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),N=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),U=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),q=Symbol.for("react.view_transition"),tt=Symbol.iterator;function X(y){return y===null||typeof y!="object"?null:(y=tt&&y[tt]||y["@@iterator"],typeof y=="function"?y:null)}var W={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},G=Object.assign,dt={};function Mt(y,R,I){this.props=y,this.context=R,this.refs=dt,this.updater=I||W}Mt.prototype.isReactComponent={},Mt.prototype.setState=function(y,R){if(typeof y!="object"&&typeof y!="function"&&y!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,y,R,"setState")},Mt.prototype.forceUpdate=function(y){this.updater.enqueueForceUpdate(this,y,"forceUpdate")};function Ft(){}Ft.prototype=Mt.prototype;function nt(y,R,I){this.props=y,this.context=R,this.refs=dt,this.updater=I||W}var Xt=nt.prototype=new Ft;Xt.constructor=nt,G(Xt,Mt.prototype),Xt.isPureReactComponent=!0;var ee=Array.isArray;function ct(){}var yt={H:null,A:null,T:null,S:null},oe=Object.prototype.hasOwnProperty;function ve(y,R,I){var $=I.ref;return{$$typeof:i,type:y,key:R,ref:$!==void 0?$:null,props:I}}function Vt(y,R){return ve(y.type,R,y.props)}function Wt(y){return typeof y=="object"&&y!==null&&y.$$typeof===i}function ae(y){var R={"=":"=0",":":"=2"};return"$"+y.replace(/[=:]/g,function(I){return R[I]})}var Ie=/\/+/g;function vt(y,R){return typeof y=="object"&&y!==null&&y.key!=null?ae(""+y.key):R.toString(36)}function Y(y){switch(y.status){case"fulfilled":return y.value;case"rejected":throw y.reason;default:switch(typeof y.status=="string"?y.then(ct,ct):(y.status="pending",y.then(function(R){y.status==="pending"&&(y.status="fulfilled",y.value=R)},function(R){y.status==="pending"&&(y.status="rejected",y.reason=R)})),y.status){case"fulfilled":return y.value;case"rejected":throw y.reason}}throw y}function A(y,R,I,$,pt){var mt=typeof y;(mt==="undefined"||mt==="boolean")&&(y=null);var _t=!1;if(y===null)_t=!0;else switch(mt){case"bigint":case"string":case"number":_t=!0;break;case"object":switch(y.$$typeof){case i:case r:_t=!0;break;case k:return _t=y._init,A(_t(y._payload),R,I,$,pt)}}if(_t)return pt=pt(y),_t=$===""?"."+vt(y,0):$,ee(pt)?(I="",_t!=null&&(I=_t.replace(Ie,"$&/")+"/"),A(pt,R,I,"",function(ne){return ne})):pt!=null&&(Wt(pt)&&(pt=Vt(pt,I+(pt.key==null||y&&y.key===pt.key?"":(""+pt.key).replace(Ie,"$&/")+"/")+_t)),R.push(pt)),1;_t=0;var Z=$===""?".":$+":";if(ee(y))for(var ut=0;ut<y.length;ut++)$=y[ut],mt=Z+vt($,ut),_t+=A($,R,I,mt,pt);else if(ut=X(y),typeof ut=="function")for(y=ut.call(y),ut=0;!($=y.next()).done;)$=$.value,mt=Z+vt($,ut++),_t+=A($,R,I,mt,pt);else if(mt==="object"){if(typeof y.then=="function")return A(Y(y),R,I,$,pt);throw R=String(y),Error("Objects are not valid as a React child (found: "+(R==="[object Object]"?"object with keys {"+Object.keys(y).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.")}return _t}function at(y,R,I){if(y==null)return y;var $=[],pt=0;return A(y,$,"","",function(mt){return R.call(I,mt,pt++)}),$}function gt(y){if(y._status===-1){var R=y._result,I=R();I.then(function($){(y._status===0||y._status===-1)&&(y._status=1,y._result=$,I.status===void 0&&(I.status="fulfilled",I.value=$))},function($){(y._status===0||y._status===-1)&&(y._status=2,y._result=$,I.status===void 0&&(I.status="rejected",I.reason=$))}),y._status===-1&&(y._status=0,y._result=I)}if(y._status===1)return y._result.default;throw y._result}var St=typeof reportError=="function"?reportError:function(y){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var R=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof y=="object"&&y!==null&&typeof y.message=="string"?String(y.message):String(y),error:y});if(!window.dispatchEvent(R))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",y);return}console.error(y)};function ye(y){var R=yt.T,I={};I.types=R!==null?R.types:null,yt.T=I;try{var $=y(),pt=yt.S;pt!==null&&pt(I,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(ct,St)}catch(mt){St(mt)}finally{R!==null&&I.types!==null&&(R.types=I.types),yt.T=R}}function He(y){var R=yt.T;if(R!==null){var I=R.types;I===null?R.types=[y]:I.indexOf(y)===-1&&I.push(y)}else ye(He.bind(null,y))}var Ee={map:at,forEach:function(y,R,I){at(y,function(){R.apply(this,arguments)},I)},count:function(y){var R=0;return at(y,function(){R++}),R},toArray:function(y){return at(y,function(R){return R})||[]},onlLine truncated
*/var zh;function Hy(){if(zh)return ft;zh=1;var i=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),C=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),U=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),k=Symbol.for("react.view_transition"),I=Symbol.iterator;function F(y){return y===null||typeof y!="object"?null:(y=I&&y[I]||y["@@iterator"],typeof y=="function"?y:null)}var nt={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},V=Object.assign,St={};function _t(y,R,P){this.props=y,this.context=R,this.refs=St,this.updater=P||nt}_t.prototype.isReactComponent={},_t.prototype.setState=function(y,R){if(typeof y!="object"&&typeof y!="function"&&y!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,y,R,"setState")},_t.prototype.forceUpdate=function(y){this.updater.enqueueForceUpdate(this,y,"forceUpdate")};function Bt(){}Bt.prototype=_t.prototype;function W(y,R,P){this.props=y,this.context=R,this.refs=St,this.updater=P||nt}var Qt=W.prototype=new Bt;Qt.constructor=W,V(Qt,_t.prototype),Qt.isPureReactComponent=!0;var Wt=Array.isArray;function ut(){}var yt={H:null,A:null,T:null,S:null},ne=Object.prototype.hasOwnProperty;function ue(y,R,P){var $=P.ref;return{$$typeof:i,type:y,key:R,ref:$!==void 0?$:null,props:P}}function Xt(y,R){return ue(y.type,R,y.props)}function Kt(y){return typeof y=="object"&&y!==null&&y.$$typeof===i}function Pt(y){var R={"=":"=0",":":"=2"};return"$"+y.replace(/[=:]/g,function(P){return R[P]})}var At=/\/+/g;function st(y,R){return typeof y=="object"&&y!==null&&y.key!=null?Pt(""+y.key):R.toString(36)}function q(y){switch(y.status){case"fulfilled":return y.value;case"rejected":throw y.reason;default:switch(typeof y.status=="string"?y.then(ut,ut):(y.status="pending",y.then(function(R){y.status==="pending"&&(y.status="fulfilled",y.value=R)},function(R){y.status==="pending"&&(y.status="rejected",y.reason=R)})),y.status){case"fulfilled":return y.value;case"rejected":throw y.reason}}throw y}function A(y,R,P,$,pt){var vt=typeof y;(vt==="undefined"||vt==="boolean")&&(y=null);var Et=!1;if(y===null)Et=!0;else switch(vt){case"bigint":case"string":case"number":Et=!0;break;case"object":switch(y.$$typeof){case i:case r:Et=!0;break;case Y:return Et=y._init,A(Et(y._payload),R,P,$,pt)}}if(Et)return pt=pt(y),Et=$===""?"."+st(y,0):$,Wt(pt)?(P="",Et!=null&&(P=Et.replace(At,"$&/")+"/"),A(pt,R,P,"",function(ce){return ce})):pt!=null&&(Kt(pt)&&(pt=Xt(pt,P+(pt.key==null||y&&y.key===pt.key?"":(""+pt.key).replace(At,"$&/")+"/")+Et)),R.push(pt)),1;Et=0;var L=$===""?".":$+":";if(Wt(y))for(var it=0;it<y.length;it++)$=y[it],vt=L+st($,it),Et+=A($,R,P,vt,pt);else if(it=F(y),typeof it=="function")for(y=it.call(y),it=0;!($=y.next()).done;)$=$.value,vt=L+st($,it++),Et+=A($,R,P,vt,pt);else if(vt==="object"){if(typeof y.then=="function")return A(q(y),R,P,$,pt);throw R=String(y),Error("Objects are not valid as a React child (found: "+(R==="[object Object]"?"object with keys {"+Object.keys(y).join(", ")+"}":R)+"). If you meant to render a collection of children, use an array instead.")}return Et}function lt(y,R,P){if(y==null)return y;var $=[],pt=0;return A(y,$,"","",function(vt){return R.call(P,vt,pt++)}),$}function ht(y){if(y._status===-1){var R=y._result,P=R();P.then(function($){(y._status===0||y._status===-1)&&(y._status=1,y._result=$,P.status===void 0&&(P.status="fulfilled",P.value=$))},function($){(y._status===0||y._status===-1)&&(y._status=2,y._result=$,P.status===void 0&&(P.status="rejected",P.reason=$))}),y._status===-1&&(y._status=0,y._result=P)}if(y._status===1)return y._result.default;throw y._result}var ot=typeof reportError=="function"?reportError:function(y){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var R=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof y=="object"&&y!==null&&typeof y.message=="string"?String(y.message):String(y),error:y});if(!window.dispatchEvent(R))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",y);return}console.error(y)};function ge(y){var R=yt.T,P={};P.types=R!==null?R.types:null,yt.T=P;try{var $=y(),pt=yt.S;pt!==null&&pt(P,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(ut,ot)}catch(vt){ot(vt)}finally{R!==null&&P.types!==null&&(R.types=P.types),yt.T=R}}function Be(y){var R=yt.T;if(R!==null){var P=R.types;P===null?R.types=[y]:P.indexOf(y)===-1&&P.push(y)}else ge(Be.bind(null,y))}var Ne={map:lt,forEach:function(y,R,P){lt(y,function(){R.apply(this,arguments)},P)},count:function(y){var R=0;return lt(y,function(){R++}),R},toArray:function(y){return lt(y,function(R){return R})||[]},only:fLine truncated
* @license React
* scheduler.production.js
*
@@ -28,7 +28,7 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Rh;function Uy(){return Rh||(Rh=1,(function(i){function r(Y,A){var at=Y.length;Y.push(A);t:for(;0<at;){var gt=at-1>>>1,St=Y[gt];if(0<_(St,A))Y[gt]=A,Y[at]=St,at=gt;else break t}}function m(Y){return Y.length===0?null:Y[0]}function o(Y){if(Y.length===0)return null;var A=Y[0],at=Y.pop();if(at!==A){Y[0]=at;t:for(var gt=0,St=Y.length,ye=St>>>1;gt<ye;){var He=2*(gt+1)-1,Ee=Y[He],y=He+1,R=Y[y];if(0>_(Ee,at))y<St&&0>_(R,Ee)?(Y[gt]=R,Y[y]=at,gt=y):(Y[gt]=Ee,Y[He]=at,gt=He);else if(y<St&&0>_(R,at))Y[gt]=R,Y[y]=at,gt=y;else break t}}return A}function _(Y,A){var at=Y.sortIndex-A.sortIndex;return at!==0?at:Y.id-A.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var C=performance;i.unstable_now=function(){return C.now()}}else{var N=Date,b=N.now();i.unstable_now=function(){return N.now()-b}}var B=[],U=[],k=1,j=null,q=3,tt=!1,X=!1,W=!1,G=!1,dt=typeof setTimeout=="function"?setTimeout:null,Mt=typeof clearTimeout=="function"?clearTimeout:null,Ft=typeof setImmediate<"u"?setImmediate:null;function nt(Y){for(var A=m(U);A!==null;){if(A.callback===null)o(U);else if(A.startTime<=Y)o(U),A.sortIndex=A.expirationTime,r(B,A);else break;A=m(U)}}function Xt(Y){if(W=!1,nt(Y),!X)if(m(B)!==null)X=!0,ee||(ee=!0,Wt());else{var A=m(U);A!==null&&vt(Xt,A.startTime-Y)}}var ee=!1,ct=-1,yt=5,oe=-1;function ve(){return G?!0:!(i.unstable_now()-oe<yt)}function Vt(){if(G=!1,ee){var Y=i.unstable_now();oe=Y;var A=!0;try{t:{X=!1,W&&(W=!1,Mt(ct),ct=-1),tt=!0;var at=q;try{e:{for(nt(Y),j=m(B);j!==null&&!(j.expirationTime>Y&&ve());){var gt=j.callback;if(typeof gt=="function"){j.callback=null,q=j.priorityLevel;var St=gt(j.expirationTime<=Y);if(Y=i.unstable_now(),typeof St=="function"){j.callback=St,nt(Y),A=!0;break e}j===m(B)&&o(B),nt(Y)}else o(B);j=m(B)}if(j!==null)A=!0;else{var ye=m(U);ye!==null&&vt(Xt,ye.startTime-Y),A=!1}}break t}finally{j=null,q=at,tt=!1}A=void 0}}finally{A?Wt():ee=!1}}}var Wt;if(typeof Ft=="function")Wt=function(){Ft(Vt)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,Ie=ae.port2;ae.port1.onmessage=Vt,Wt=function(){Ie.postMessage(null)}}else Wt=function(){dt(Vt,0)};function vt(Y,A){ct=dt(function(){Y(i.unstable_now())},A)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(Y){Y.callback=null},i.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):yt=0<Y?Math.floor(1e3/Y):5},i.unstable_getCurrentPriorityLevel=function(){return q},i.unstable_next=function(Y){switch(q){case 1:case 2:case 3:var A=3;break;default:A=q}var at=q;q=A;try{return Y()}finally{q=at}},i.unstable_requestPaint=function(){G=!0},i.unstable_runWithPriority=function(Y,A){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var at=q;q=Y;try{return A()}finally{q=at}},i.unstable_scheduleCallback=function(Y,A,at){var gt=i.unstable_now();switch(typeof at=="object"&&at!==null?(at=at.delay,at=typeof at=="number"&&0<at?gt+at:gt):at=gt,Y){case 1:var St=-1;break;case 2:St=250;break;case 5:St=1073741823;break;case 4:St=1e4;break;default:St=5e3}return St=at+St,Y={id:k++,callback:A,priorityLevel:Y,startTime:at,expirationTime:St,sortIndex:-1},at>gt?(Y.sortIndex=at,r(U,Y),m(B)===null&&Y===m(U)&&(W?(Mt(ct),ct=-1):W=!0,vt(Xt,at-gt))):(Y.sortIndex=St,r(B,Y),X||tt||(X=!0,ee||(ee=!0,Wt()))),Y},i.unstable_shouldYield=ve,i.unstable_wrapCallback=function(Y){var A=q;return function(){var at=q;q=A;try{return Y.apply(this,arguments)}finally{q=at}}}})(sr)),sr}var Dh;function Hy(){return Dh||(Dh=1,cr.exports=Uy()),cr.exports}var fr={exports:{}},De={};/**
*/var Dh;function qy(){return Dh||(Dh=1,(function(i){function r(q,A){var lt=q.length;q.push(A);t:for(;0<lt;){var ht=lt-1>>>1,ot=q[ht];if(0<_(ot,A))q[ht]=A,q[lt]=ot,lt=ht;else break t}}function m(q){return q.length===0?null:q[0]}function o(q){if(q.length===0)return null;var A=q[0],lt=q.pop();if(lt!==A){q[0]=lt;t:for(var ht=0,ot=q.length,ge=ot>>>1;ht<ge;){var Be=2*(ht+1)-1,Ne=q[Be],y=Be+1,R=q[y];if(0>_(Ne,lt))y<ot&&0>_(R,Ne)?(q[ht]=R,q[y]=lt,ht=y):(q[ht]=Ne,q[Be]=lt,ht=Be);else if(y<ot&&0>_(R,lt))q[ht]=R,q[y]=lt,ht=y;else break t}}return A}function _(q,A){var lt=q.sortIndex-A.sortIndex;return lt!==0?lt:q.id-A.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var N=performance;i.unstable_now=function(){return N.now()}}else{var C=Date,b=C.now();i.unstable_now=function(){return C.now()-b}}var B=[],U=[],Y=1,j=null,k=3,I=!1,F=!1,nt=!1,V=!1,St=typeof setTimeout=="function"?setTimeout:null,_t=typeof clearTimeout=="function"?clearTimeout:null,Bt=typeof setImmediate<"u"?setImmediate:null;function W(q){for(var A=m(U);A!==null;){if(A.callback===null)o(U);else if(A.startTime<=q)o(U),A.sortIndex=A.expirationTime,r(B,A);else break;A=m(U)}}function Qt(q){if(nt=!1,W(q),!F)if(m(B)!==null)F=!0,Wt||(Wt=!0,Kt());else{var A=m(U);A!==null&&st(Qt,A.startTime-q)}}var Wt=!1,ut=-1,yt=5,ne=-1;function ue(){return V?!0:!(i.unstable_now()-ne<yt)}function Xt(){if(V=!1,Wt){var q=i.unstable_now();ne=q;var A=!0;try{t:{F=!1,nt&&(nt=!1,_t(ut),ut=-1),I=!0;var lt=k;try{e:{for(W(q),j=m(B);j!==null&&!(j.expirationTime>q&&ue());){var ht=j.callback;if(typeof ht=="function"){j.callback=null,k=j.priorityLevel;var ot=ht(j.expirationTime<=q);if(q=i.unstable_now(),typeof ot=="function"){j.callback=ot,W(q),A=!0;break e}j===m(B)&&o(B),W(q)}else o(B);j=m(B)}if(j!==null)A=!0;else{var ge=m(U);ge!==null&&st(Qt,ge.startTime-q),A=!1}}break t}finally{j=null,k=lt,I=!1}A=void 0}}finally{A?Kt():Wt=!1}}}var Kt;if(typeof Bt=="function")Kt=function(){Bt(Xt)};else if(typeof MessageChannel<"u"){var Pt=new MessageChannel,At=Pt.port2;Pt.port1.onmessage=Xt,Kt=function(){At.postMessage(null)}}else Kt=function(){St(Xt,0)};function st(q,A){ut=St(function(){q(i.unstable_now())},A)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(q){q.callback=null},i.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):yt=0<q?Math.floor(1e3/q):5},i.unstable_getCurrentPriorityLevel=function(){return k},i.unstable_next=function(q){switch(k){case 1:case 2:case 3:var A=3;break;default:A=k}var lt=k;k=A;try{return q()}finally{k=lt}},i.unstable_requestPaint=function(){V=!0},i.unstable_runWithPriority=function(q,A){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var lt=k;k=q;try{return A()}finally{k=lt}},i.unstable_scheduleCallback=function(q,A,lt){var ht=i.unstable_now();switch(typeof lt=="object"&&lt!==null?(lt=lt.delay,lt=typeof lt=="number"&&0<lt?ht+lt:ht):lt=ht,q){case 1:var ot=-1;break;case 2:ot=250;break;case 5:ot=1073741823;break;case 4:ot=1e4;break;default:ot=5e3}return ot=lt+ot,q={id:Y++,callback:A,priorityLevel:q,startTime:lt,expirationTime:ot,sortIndex:-1},lt>ht?(q.sortIndex=lt,r(U,q),m(B)===null&&q===m(U)&&(nt?(_t(ut),ut=-1):nt=!0,st(Qt,lt-ht))):(q.sortIndex=ot,r(B,q),F||I||(F=!0,Wt||(Wt=!0,Kt()))),q},i.unstable_shouldYield=ue,i.unstable_wrapCallback=function(q){var A=k;return function(){var lt=k;k=A;try{return q.apply(this,arguments)}finally{k=lt}}}})(sr)),sr}var Uh;function ky(){return Uh||(Uh=1,cr.exports=qy()),cr.exports}var fr={exports:{}},Ue={};/**
* @license React
* react-dom.production.js
*
@@ -36,7 +36,7 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Uh;function By(){if(Uh)return De;Uh=1;var i=mr();function r(k){var j="https://react.dev/errors/"+k;if(1<arguments.length){j+="?args[]="+encodeURIComponent(arguments[1]);for(var q=2;q<arguments.length;q++)j+="&args[]="+encodeURIComponent(arguments[q])}return"Minified React error #"+k+"; visit "+j+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function m(){}var o={d:{f:m,r:function(){throw Error(r(522))},D:m,C:m,L:m,m,X:m,S:m,M:m},p:0,findDOMNode:null},_=Symbol.for("react.portal"),C=Symbol.for("react.recoverable"),N=Symbol.for("react.optimistic_key");function b(k,j,q){var tt=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:_,key:tt==null?null:tt===N?N:""+tt,children:k,containerInfo:j,implementation:q}}var B=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function U(k,j){if(k==="font")return"";if(typeof j=="string")return j==="use-credentials"?j:""}return De.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,De.browser=function(k){return{$$typeof:C,_reason:k}},De.createPortal=function(k,j){var q=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!j||j.nodeType!==1&&j.nodeType!==9&&j.nodeType!==11)throw Error(r(299));return b(k,j,null,q)},De.flushSync=function(k){var j=B.T,q=o.p;try{if(B.T=null,o.p=2,k)return k()}finally{B.T=j,o.p=q,o.d.f()}},De.preconnect=function(k,j){typeof k=="string"&&(j?(j=j.crossOrigin,j=typeof j=="string"?j==="use-credentials"?j:"":void 0):j=null,o.d.C(k,j))},De.prefetchDNS=function(k){typeof k=="string"&&o.d.D(k)},De.preinit=function(k,j){if(typeof k=="string"&&j&&typeof j.as=="string"){var q=j.as,tt=U(q,j.crossOrigin),X=typeof j.integrity=="string"?j.integrity:void 0,W=typeof j.fetchPriority=="string"?j.fetchPriority:void 0;q==="style"?o.d.S(k,typeof j.precedence=="string"?j.precedence:void 0,{crossOrigin:tt,integrity:X,fetchPriority:W}):q==="script"&&o.d.X(k,{crossOrigin:tt,integrity:X,fetchPriority:W,nonce:typeof j.nonce=="string"?j.nonce:void 0})}},De.preinitModule=function(k,j){if(typeof k=="string")if(typeof j=="object"&&j!==null){if(j.as==null||j.as==="script"){var q=U(j.as,j.crossOrigin);o.d.M(k,{crossOrigin:q,integrity:typeof j.integrity=="string"?j.integrity:void 0,nonce:typeof j.nonce=="string"?j.nonce:void 0,fetchPriority:typeof j.fetchPriority=="string"?j.fetchPriority:void 0})}}else j==null&&o.d.M(k)},De.preload=function(k,j){if(typeof k=="string"&&typeof j=="object"&&j!==null&&typeof j.as=="string"){var q=j.as,tt=U(q,j.crossOrigin);o.d.L(k,q,{crossOrigin:tt,integrity:typeof j.integrity=="string"?j.integrity:void 0,nonce:typeof j.nonce=="string"?j.nonce:void 0,type:typeof j.type=="string"?j.type:void 0,fetchPriority:typeof j.fetchPriority=="string"?j.fetchPriority:void 0,referrerPolicy:typeof j.referrerPolicy=="string"?j.referrerPolicy:void 0,imageSrcSet:typeof j.imageSrcSet=="string"?j.imageSrcSet:void 0,imageSizes:typeof j.imageSizes=="string"?j.imageSizes:void 0,media:typeof j.media=="string"?j.media:void 0})}},De.preloadModule=function(k,j){if(typeof k=="string")if(j){var q=U(j.as,j.crossOrigin);o.d.m(k,{as:typeof j.as=="string"&&j.as!=="script"?j.as:void 0,crossOrigin:q,integrity:typeof j.integrity=="string"?j.integrity:void 0,nonce:typeof j.nonce=="string"?j.nonce:void 0,fetchPriority:typeof j.fetchPriority=="string"?j.fetchPriority:void 0})}else o.d.m(k)},De.requestFormReset=function(k){o.d.r(k)},De.unstable_batchedUpdates=function(k,j){return k(j)},De.useFormState=function(k,j,q){return B.H.useFormState(k,j,q)},De.useFormStatus=function(){return B.H.useHostTransitionStatus()},De.version="19.3.1",De}var Hh;function qy(){if(Hh)return fr.exports;Hh=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(r){console.error(r)}}return i(),fr.exports=By(),fr.exports}/**
*/var Hh;function wy(){if(Hh)return Ue;Hh=1;var i=hr();function r(Y){var j="https://react.dev/errors/"+Y;if(1<arguments.length){j+="?args[]="+encodeURIComponent(arguments[1]);for(var k=2;k<arguments.length;k++)j+="&args[]="+encodeURIComponent(arguments[k])}return"Minified React error #"+Y+"; visit "+j+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function m(){}var o={d:{f:m,r:function(){throw Error(r(522))},D:m,C:m,L:m,m,X:m,S:m,M:m},p:0,findDOMNode:null},_=Symbol.for("react.portal"),N=Symbol.for("react.recoverable"),C=Symbol.for("react.optimistic_key");function b(Y,j,k){var I=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:_,key:I==null?null:I===C?C:""+I,children:Y,containerInfo:j,implementation:k}}var B=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function U(Y,j){if(Y==="font")return"";if(typeof j=="string")return j==="use-credentials"?j:""}return Ue.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Ue.browser=function(Y){return{$$typeof:N,_reason:Y}},Ue.createPortal=function(Y,j){var k=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!j||j.nodeType!==1&&j.nodeType!==9&&j.nodeType!==11)throw Error(r(299));return b(Y,j,null,k)},Ue.flushSync=function(Y){var j=B.T,k=o.p;try{if(B.T=null,o.p=2,Y)return Y()}finally{B.T=j,o.p=k,o.d.f()}},Ue.preconnect=function(Y,j){typeof Y=="string"&&(j?(j=j.crossOrigin,j=typeof j=="string"?j==="use-credentials"?j:"":void 0):j=null,o.d.C(Y,j))},Ue.prefetchDNS=function(Y){typeof Y=="string"&&o.d.D(Y)},Ue.preinit=function(Y,j){if(typeof Y=="string"&&j&&typeof j.as=="string"){var k=j.as,I=U(k,j.crossOrigin),F=typeof j.integrity=="string"?j.integrity:void 0,nt=typeof j.fetchPriority=="string"?j.fetchPriority:void 0;k==="style"?o.d.S(Y,typeof j.precedence=="string"?j.precedence:void 0,{crossOrigin:I,integrity:F,fetchPriority:nt}):k==="script"&&o.d.X(Y,{crossOrigin:I,integrity:F,fetchPriority:nt,nonce:typeof j.nonce=="string"?j.nonce:void 0})}},Ue.preinitModule=function(Y,j){if(typeof Y=="string")if(typeof j=="object"&&j!==null){if(j.as==null||j.as==="script"){var k=U(j.as,j.crossOrigin);o.d.M(Y,{crossOrigin:k,integrity:typeof j.integrity=="string"?j.integrity:void 0,nonce:typeof j.nonce=="string"?j.nonce:void 0,fetchPriority:typeof j.fetchPriority=="string"?j.fetchPriority:void 0})}}else j==null&&o.d.M(Y)},Ue.preload=function(Y,j){if(typeof Y=="string"&&typeof j=="object"&&j!==null&&typeof j.as=="string"){var k=j.as,I=U(k,j.crossOrigin);o.d.L(Y,k,{crossOrigin:I,integrity:typeof j.integrity=="string"?j.integrity:void 0,nonce:typeof j.nonce=="string"?j.nonce:void 0,type:typeof j.type=="string"?j.type:void 0,fetchPriority:typeof j.fetchPriority=="string"?j.fetchPriority:void 0,referrerPolicy:typeof j.referrerPolicy=="string"?j.referrerPolicy:void 0,imageSrcSet:typeof j.imageSrcSet=="string"?j.imageSrcSet:void 0,imageSizes:typeof j.imageSizes=="string"?j.imageSizes:void 0,media:typeof j.media=="string"?j.media:void 0})}},Ue.preloadModule=function(Y,j){if(typeof Y=="string")if(j){var k=U(j.as,j.crossOrigin);o.d.m(Y,{as:typeof j.as=="string"&&j.as!=="script"?j.as:void 0,crossOrigin:k,integrity:typeof j.integrity=="string"?j.integrity:void 0,nonce:typeof j.nonce=="string"?j.nonce:void 0,fetchPriority:typeof j.fetchPriority=="string"?j.fetchPriority:void 0})}else o.d.m(Y)},Ue.requestFormReset=function(Y){o.d.r(Y)},Ue.unstable_batchedUpdates=function(Y,j){return Y(j)},Ue.useFormState=function(Y,j,k){return B.H.useFormState(Y,j,k)},Ue.useFormStatus=function(){return B.H.useHostTransitionStatus()},Ue.version="19.3.1",Ue}var Bh;function Yy(){if(Bh)return fr.exports;Bh=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(r){console.error(r)}}return i(),fr.exports=wy(),fr.exports}/**
* @license React
* react-dom-client.production.js
*
@@ -44,33 +44,33 @@
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Bh;function wy(){if(Bh)return ii;Bh=1;var i=Hy(),r=mr(),m=qy();function o(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)e+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function _(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function C(t){for(var e=t,l=e;l&&!l.alternate;)e=l,(e.flags&4098)!==0&&(t=e.return),l=e.return;for(;e.return;)e=e.return;return e.tag===3?t:null}function N(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function b(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function B(t){if(C(t)!==t)throw Error(o(188))}function U(t){var e=t.alternate;if(!e){if(e=C(t),e===null)throw Error(o(188));return e!==t?null:t}for(var l=t,a=e;;){var n=l.return;if(n===null)break;var u=n.alternate;if(u===null){if(a=n.return,a!==null){l=a;continue}break}if(n.child===u.child){for(u=n.child;u;){if(u===l)return B(n),t;if(u===a)return B(n),e;u=u.sibling}throw Error(o(188))}if(l.return!==a.return)l=n,a=u;else{for(var s=!1,f=n.child;f;){if(f===l){s=!0,l=n,a=u;break}if(f===a){s=!0,a=n,l=u;break}f=f.sibling}if(!s){for(f=u.child;f;){if(f===l){s=!0,l=u,a=n;break}if(f===a){s=!0,a=u,l=n;break}f=f.sibling}if(!s)throw Error(o(189))}}if(l.alternate!==a)throw Error(o(190))}if(l.tag!==3)throw Error(o(188));return l.stateNode.current===l?t:e}function k(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=k(t),e!==null)return e;t=t.sibling}return null}function j(t,e,l,a,n,u){for(;t!==null;){if((t.tag===5||t.tag===27||t.tag===6)&&l(t,a,n,u)||(t.tag!==22||t.memoizedState===null)&&(e||t.tag!==5&&t.tag!==27)&&j(t.child,e,l,a,n,u))return!0;t=t.sibling}return!1}function q(t){for(t=t.return;t!==null;){if(t.tag===3||t.tag===5||t.tag===27)return t;t=t.return}return null}function tt(t){var e=!1;for(t=t.return;t!==null&&(t.tag===4&&(e=!0),!(t.tag===3||t.tag===5||t.tag===27));)t=t.return;return e}function X(t){var e=[null,null],l=q(t);return l===null||W(e,t,l.child,{foundSelf:!1}),e}function W(t,e,l,a){for(;l!==null;){if(l===e)a.foundSelf=!0;else if(l.tag===5||l.tag===27||l.tag===6){if(a.foundSelf)return t[1]=l,!0;t[0]=l}else if((l.tag!==22||l.memoizedState===null)&&W(t,e,l.child,a))return!0;l=l.sibling}return!1}function G(t){switch(t.tag){case 5:case 27:case 6:return t.stateNode;case 3:return t.stateNode.containerInfo;default:throw Error(o(559))}}var dt=null,Mt=null;function Ft(t,e,l){return t===l?!0:t===e?(dt=t,!0):!1}function nt(t,e,l){return t===l?(Mt=t,!1):t===e?(Mt!==null&&(dt=t),!0):!1}function Xt(t){if(t===null)return null;do t=t===null?null:t.return;while(t&&t.tag!==5&&t.tag!==27&&t.tag!==3);return t||null}function ee(t,e,l){for(var a=0,n=t;n;n=l(n))a++;n=0;for(var u=e;u;u=l(u))n++;for(;0<a-n;)t=l(t),a--;for(;0<n-a;)e=l(e),n--;for(;a--;){if(t===e||e!==null&&t===e.alternate)return t;t=l(t),e=l(e)}return null}var ct=Object.assign,yt=Symbol.for("react.element"),oe=Symbol.for("react.transitional.element"),ve=Symbol.for("react.portal"),Vt=Symbol.for("react.fragment"),Wt=Symbol.for("react.strict_mode"),ae=Symbol.for("react.profiler"),Ie=Symbol.for("react.consumer"),vt=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),at=Symbol.for("react.suspense_list"),gt=Symbol.for("react.memo"),St=Symbol.for("react.lazy"),ye=Symbol.for("react.activity"),He=Symbol.for("react.legacy_hidden"),Ee=Symbol.for("react.memo_cache_sentinel"),y=Symbol.for("react.view_transition"),R=Symbol.for("react.recoverable"),I=Symbol.iterator;function $(t){return t===null||typeof t!="object"?null:(t=I&&t[I]||t["@@iterator"],typeof t=="function"?t:null)}var pt=Symbol.for("react.client.reference");function mt(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===pt?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Vt:return"Fragment";case ae:return"Profiler";case Wt:return"StrictMode";case A:return"Suspense";case at:return"SuspenseList";case ye:return"Activity";case y:return"ViewTransition"}if(typeof t=="object")switch(t.$$typeof){case ve:return"Portal";case vt:return t.displayName||"Context";case Ie:return(t._context.displayName||"Context")+".Consumer";case Y:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case gt:return e=t.displayName||null,e!==null?e:mt(t.type)||"Memo";case St:e=t._payload,t=t._init;try{return mt(t(e))}catch{}}return null}var _t=Array.isArray,Z=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ut=m.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,actionLine truncated
*/var qh;function Gy(){if(qh)return ii;qh=1;var i=ky(),r=hr(),m=Yy();function o(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)e+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function _(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function N(t){for(var e=t,l=e;l&&!l.alternate;)e=l,(e.flags&4098)!==0&&(t=e.return),l=e.return;for(;e.return;)e=e.return;return e.tag===3?t:null}function C(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function b(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function B(t){if(N(t)!==t)throw Error(o(188))}function U(t){var e=t.alternate;if(!e){if(e=N(t),e===null)throw Error(o(188));return e!==t?null:t}for(var l=t,a=e;;){var n=l.return;if(n===null)break;var u=n.alternate;if(u===null){if(a=n.return,a!==null){l=a;continue}break}if(n.child===u.child){for(u=n.child;u;){if(u===l)return B(n),t;if(u===a)return B(n),e;u=u.sibling}throw Error(o(188))}if(l.return!==a.return)l=n,a=u;else{for(var s=!1,f=n.child;f;){if(f===l){s=!0,l=n,a=u;break}if(f===a){s=!0,a=n,l=u;break}f=f.sibling}if(!s){for(f=u.child;f;){if(f===l){s=!0,l=u,a=n;break}if(f===a){s=!0,a=u,l=n;break}f=f.sibling}if(!s)throw Error(o(189))}}if(l.alternate!==a)throw Error(o(190))}if(l.tag!==3)throw Error(o(188));return l.stateNode.current===l?t:e}function Y(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=Y(t),e!==null)return e;t=t.sibling}return null}function j(t,e,l,a,n,u){for(;t!==null;){if((t.tag===5||t.tag===27||t.tag===6)&&l(t,a,n,u)||(t.tag!==22||t.memoizedState===null)&&(e||t.tag!==5&&t.tag!==27)&&j(t.child,e,l,a,n,u))return!0;t=t.sibling}return!1}function k(t){for(t=t.return;t!==null;){if(t.tag===3||t.tag===5||t.tag===27)return t;t=t.return}return null}function I(t){var e=!1;for(t=t.return;t!==null&&(t.tag===4&&(e=!0),!(t.tag===3||t.tag===5||t.tag===27));)t=t.return;return e}function F(t){var e=[null,null],l=k(t);return l===null||nt(e,t,l.child,{foundSelf:!1}),e}function nt(t,e,l,a){for(;l!==null;){if(l===e)a.foundSelf=!0;else if(l.tag===5||l.tag===27||l.tag===6){if(a.foundSelf)return t[1]=l,!0;t[0]=l}else if((l.tag!==22||l.memoizedState===null)&&nt(t,e,l.child,a))return!0;l=l.sibling}return!1}function V(t){switch(t.tag){case 5:case 27:case 6:return t.stateNode;case 3:return t.stateNode.containerInfo;default:throw Error(o(559))}}var St=null,_t=null;function Bt(t,e,l){return t===l?!0:t===e?(St=t,!0):!1}function W(t,e,l){return t===l?(_t=t,!1):t===e?(_t!==null&&(St=t),!0):!1}function Qt(t){if(t===null)return null;do t=t===null?null:t.return;while(t&&t.tag!==5&&t.tag!==27&&t.tag!==3);return t||null}function Wt(t,e,l){for(var a=0,n=t;n;n=l(n))a++;n=0;for(var u=e;u;u=l(u))n++;for(;0<a-n;)t=l(t),a--;for(;0<n-a;)e=l(e),n--;for(;a--;){if(t===e||e!==null&&t===e.alternate)return t;t=l(t),e=l(e)}return null}var ut=Object.assign,yt=Symbol.for("react.element"),ne=Symbol.for("react.transitional.element"),ue=Symbol.for("react.portal"),Xt=Symbol.for("react.fragment"),Kt=Symbol.for("react.strict_mode"),Pt=Symbol.for("react.profiler"),At=Symbol.for("react.consumer"),st=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),lt=Symbol.for("react.suspense_list"),ht=Symbol.for("react.memo"),ot=Symbol.for("react.lazy"),ge=Symbol.for("react.activity"),Be=Symbol.for("react.legacy_hidden"),Ne=Symbol.for("react.memo_cache_sentinel"),y=Symbol.for("react.view_transition"),R=Symbol.for("react.recoverable"),P=Symbol.iterator;function $(t){return t===null||typeof t!="object"?null:(t=P&&t[P]||t["@@iterator"],typeof t=="function"?t:null)}var pt=Symbol.for("react.client.reference");function vt(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===pt?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Xt:return"Fragment";case Pt:return"Profiler";case Kt:return"StrictMode";case A:return"Suspense";case lt:return"SuspenseList";case ge:return"Activity";case y:return"ViewTransition"}if(typeof t=="object")switch(t.$$typeof){case ue:return"Portal";case st:return t.displayName||"Context";case At:return(t._context.displayName||"Context")+".Consumer";case q:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case ht:return e=t.displayName||null,e!==null?e:vt(t.type)||"Memo";case ot:e=t._payload,t=t._init;try{return vt(t(e))}catch{}}return null}var Et=Array.isArray,L=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,it=m.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce={pending:!1,data:null,method:null,actioLine truncated
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
`+qe+t+ue}var sl=!1;function Jl(t,e){if(!t||sl)return"";sl=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(e){var z=function(){throw Error()};if(Object.defineProperty(z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(z,[])}catch(w){var g=w}Reflect.construct(t,[],z)}else{try{z.call()}catch(w){g=w}z=!1;try{var T=Object.getOwnPropertyDescriptor(t.prototype,"props");Object.defineProperty(t.prototype,"props",{configurable:!0,set:function(){throw Error()}}),z=!0,new t}finally{z&&(T!==void 0?Object.defineProperty(t.prototype,"props",T):delete t.prototype.props)}}}else{try{throw Error()}catch(w){g=w}(z=t())&&typeof z.catch=="function"&&z.catch(function(){})}}catch(w){if(w&&g&&typeof w.stack=="string")return[w.stack,g.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=a.DetermineComponentFrameRoot(),s=u[0],f=u[1];if(s&&f){var d=s.split(`
`+ke+t+se}var sl=!1;function Jl(t,e){if(!t||sl)return"";sl=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(e){var z=function(){throw Error()};if(Object.defineProperty(z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(z,[])}catch(w){var g=w}Reflect.construct(t,[],z)}else{try{z.call()}catch(w){g=w}z=!1;try{var T=Object.getOwnPropertyDescriptor(t.prototype,"props");Object.defineProperty(t.prototype,"props",{configurable:!0,set:function(){throw Error()}}),z=!0,new t}finally{z&&(T!==void 0?Object.defineProperty(t.prototype,"props",T):delete t.prototype.props)}}}else{try{throw Error()}catch(w){g=w}(z=t())&&typeof z.catch=="function"&&z.catch(function(){})}}catch(w){if(w&&g&&typeof w.stack=="string")return[w.stack,g.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var n=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");n&&n.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=a.DetermineComponentFrameRoot(),s=u[0],f=u[1];if(s&&f){var d=s.split(`
`),p=f.split(`
`);for(n=a=0;a<d.length&&!d[a].includes("DetermineComponentFrameRoot");)a++;for(;n<p.length&&!p[n].includes("DetermineComponentFrameRoot");)n++;if(a===d.length||n===p.length)for(a=d.length-1,n=p.length-1;1<=a&&0<=n&&d[a]!==p[n];)n--;for(;1<=a&&0<=n;a--,n--)if(d[a]!==p[n]){if(a!==1||n!==1)do if(a--,n--,0>n||d[a]!==p[n]){var E=`
`+d[a].replace(" at new "," at ");return t.displayName&&E.includes("<anonymous>")&&(E=E.replace("<anonymous>",t.displayName)),E}while(1<=a&&0<=n);break}}}finally{sl=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?ie(l):""}function da(t,e){switch(t.tag){case 26:case 27:case 5:return ie(t.type);case 16:return ie("Lazy");case 13:return t.child!==e&&e!==null?ie("Suspense Fallback"):ie("Suspense");case 19:return ie("SuspenseList");case 0:case 15:return Jl(t.type,!1);case 11:return Jl(t.type.render,!1);case 1:return Jl(t.type,!0);case 31:return ie("Activity");case 30:return ie("ViewTransition");default:return""}}function Dl(t){try{var e="",l=null;do e+=da(t,l),l=t,t=t.return;while(t);return e}catch(a){return`
`+d[a].replace(" at new "," at ");return t.displayName&&E.includes("<anonymous>")&&(E=E.replace("<anonymous>",t.displayName)),E}while(1<=a&&0<=n);break}}}finally{sl=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?fe(l):""}function da(t,e){switch(t.tag){case 26:case 27:case 5:return fe(t.type);case 16:return fe("Lazy");case 13:return t.child!==e&&e!==null?fe("Suspense Fallback"):fe("Suspense");case 19:return fe("SuspenseList");case 0:case 15:return Jl(t.type,!1);case 11:return Jl(t.type.render,!1);case 1:return Jl(t.type,!0);case 31:return fe("Activity");case 30:return fe("ViewTransition");default:return""}}function Dl(t){try{var e="",l=null;do e+=da(t,l),l=t,t=t.return;while(t);return e}catch(a){return`
Error generating stack: `+a.message+`
`+a.stack}}var Kt=Object.prototype.hasOwnProperty,Pe=i.unstable_scheduleCallback,we=i.unstable_cancelCallback,Tl=i.unstable_shouldYield,fl=i.unstable_requestPaint,kt=i.unstable_now,Ul=i.unstable_getCurrentPriorityLevel,mn=i.unstable_ImmediatePriority,Qa=i.unstable_UserBlockingPriority,Se=i.unstable_NormalPriority,Xa=i.unstable_LowPriority,ma=i.unstable_IdlePriority,su=i.log,fu=i.unstable_setDisableYieldValue,Fl=null,Ne=null;function rl(t){if(typeof su=="function"&&fu(t),Ne&&typeof Ne.setStrictMode=="function")try{Ne.setStrictMode(Fl,t)}catch{}}var Ce=Math.clz32?Math.clz32:du,ru=Math.log,ou=Math.LN2;function du(t){return t>>>=0,t===0?32:31-(ru(t)/ou|0)|0}var H=256,D=262144,L=4194304;function J(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&-t;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function O(t,e,l){var a=t.pendingLanes;if(a===0)return 0;var n=0,u=t.suspendedLanes,s=t.pingedLanes;t=t.warmLanes;var f=a&134217727;return f!==0?(a=f&~u,a!==0?n=J(a):(s&=f,s!==0?n=J(s):l||(l=f&~t,l!==0&&(n=J(l))))):(f=a&~u,f!==0?n=J(f):s!==0?n=J(s):l||(l=a&~t,l!==0&&(n=J(l)))),n===0?0:e!==0&&e!==n&&(e&u)===0&&(u=n&-n,l=e&-e,u>=l||u===32&&(l&4194048)!==0)?e:n}function Q(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function F(t,e){(e&8)!==0&&(e|=e&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=e;0<l;){var a=31-Ce(l),n=1<<a;e|=t[a],l&=~n}return e}function At(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Et(){var t=L;return L<<=1,(L&62914560)===0&&(L=4194304),t}function pe(t){for(var e=[],l=0;31>l;l++)e.push(t);return e}function be(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Rc(t,e,l,a,n,u){var s=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var f=t.entanglements,d=t.expirationTimes,p=t.hiddenUpdates;for(l=s&~l;0<l;){var E=31-Ce(l),z=1<<E;f[E]=0,d[E]=-1;var g=p[E];if(g!==null)for(p[E]=null,E=0;E<g.length;E++){var T=g[E];T!==null&&(T.lane&=-536870913)}l&=~z}a!==0&&ci(t,a,0),u!==0&&n===0&&t.tag!==0&&(t.suspendedLanes|=u&~(s&~e))}function ci(t,e,l){t.pendingLanes|=e,t.suspendedLanes&=~e;var a=31-Ce(e);t.entangledLanes|=e,t.entanglements[a]=t.entanglements[a]|1073741824|l&261930}function hn(t,e){var l=t.entangledLanes|=e;for(t=t.entanglements;l;){var a=31-Ce(l),n=1<<a;n&e|t[a]&e&&(t[a]|=e),l&=~n}}function Wl(t,e){var l=e&-e;return l=(l&42)!==0?1:Hl(l),(l&(t.suspendedLanes|e))!==0?0:l}function Hl(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function mu(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function hu(){var t=ut.p;return t!==0?t:(t=window.event,t===void 0?32:xh(t.type))}function Le(t,e){var l=ut.p;try{return ut.p=t,e()}finally{ut.p=l}}var It=Math.random().toString(36).slice(2),me="__reactFiber$"+It,Ze="__reactProps$"+It,vn="__reactContainer$"+It,vr="__reactEvents$"+It,Zh="__reactListeners$"+It,Kh="__reactHandles$"+It,yr="__reactResources$"+It,vu="__reactMarker$"+It,si="__reactLoad$"+It;function fi(t){delete t[me],delete t[Ze],delete t[Zh],delete t[Kh]}function Va(t){var e;if(e=t[me])return e;for(var l=t.parentNode;l;){if(e=l[vn]||l[me]){if(l=e.alternate,e.child!==null||l!==null&&l.child!==null)for(t=eh(t);t!==null;){if(l=t[me])return l;t=eh(t)}return e}t=l,l=t.parentNode}return null}function yn(t){if(t=t[me]||t[vn]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function yu(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(o(33))}function gn(t){var e=t[yr];return e||(e=t[yr]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function xe(t){t[vu]=!0}function gr(t){t[si]=void 0}var Sr=new Set,pr={};function La(t,e){Sn(t,e),Sn(t+"Capture",e)}function Sn(t,e){for(pLine truncated
`).replace(U0,"")}function Hm(t,e){return e=Um(e),Um(t)===e}function qt(t,e,l,a,n,u){switch(l){case"children":if(typeof a=="string")e==="body"||e==="textarea"&&a===""||bn(t,a);else if(typeof a=="number"||typeof a=="bigint")e!=="body"&&bn(t,""+a);else return;break;case"className":oi(t,"class",a);break;case"tabIndex":oi(t,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":oi(t,l,a);break;case"style":Or(t,a,u);return;case"data":if(e!=="object"){oi(t,"data",a);break}case"src":case"href":if(a===""&&(e!=="a"||l!=="href")){t.removeAttribute(l);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(l);break}a=di(a),t.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(l==="formAction"?(e!=="input"&&qt(t,e,"name",n.name,n,null),qt(t,e,"formEncType",n.formEncType,n,null),qt(t,e,"formMethod",n.formMethod,n,null),qt(t,e,"formTarget",n.formTarget,n,null)):(qt(t,e,"encType",n.encType,n,null),qt(t,e,"method",n.method,n,null),qt(t,e,"target",n.target,n,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(l);break}a=di(a),t.setAttribute(l,a);break;case"onClick":a!=null&&(t.onclick=Bl);return;case"onScroll":a!=null&&xt("scroll",t);return;case"onScrollEnd":a!=null&&xt("scrollend",t);return;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(o(60));(u!=null?u.__html:void 0)!==l&&(t.innerHTML=l)}}break;case"multiple":t.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":t.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){t.removeAttribute("xlink:href");break}l=di(a),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(l,a):t.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":a===!0?t.setAttribute(l,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(l,a):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?t.setAttribute(l,a):t.removeAttribute(l);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?t.removeAttribute(l):t.setAttribute(l,a);break;case"popover":xt("beforetoggle",t),xt("toggle",t),ri(t,"popover",a);break;case"xlinkActuate":$l(t,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":$l(t,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":$l(t,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":$l(t,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":$l(t,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":$l(t,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":$l(t,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":$l(t,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":$l(t,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":ri(t,"is",a);break;case"innerText":case"textContent":return;default:if(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")l=Ph.get(l)||l,ri(t,l,a);else return}Ct=!0}function Hf(t,e,l,a,n,u){switch(l){case"style":Or(t,a,u);return;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(o(60));(u!=null?u.__html:void 0)!==l&&(t.innerHTML=l)}}break;case"children":if(typeof a=="string")bn(t,a);else if(typeof a=="number"||typeof a=="bigint")bn(t,""+a);else return;break;case"onScroll":a!=null&&xt("scroll",t);return;case"onScrollEnd":a!=null&&xt("scroLine truncated
`;At&&(pe+=At+`
`),Et&&(pe+=(Array.isArray(Et)?Et.join(`
`):String(Et))+`
`),pe+=JSON.stringify(F,null,2).slice(0,4e3),xl(pe),ne("已返回登录信息,见下方")}catch(F){ne("发起失败:"+F.message)}},[]),D=v.useCallback(async()=>{const O=X.trim();if(!O){tt("请填要查配额的用户 id");return}try{const Q=await lt(P.adminQuotaUser(O));tt("用户 "+O.slice(0,8)+":本月用量 "+or(Q.used_usd_micros)+" / 配额 "+or(Q.quota_usd_micros)+(Q.remaining_usd_micros!==null&&Q.remaining_usd_micros!==void 0?"(剩余 "+or(Q.remaining_usd_micros)+")":"")+" | 月份 "+(Q.month||""))}catch(Q){tt(rr(Q))}},[X]),L=v.useCallback(async()=>{if(window.confirm("确定手动触发 sweep 吗?超阈值的陈旧 running 任务会被标为 interrupted。"))try{const Q=(await lt(P.adminSweep,"POST",{})).swept||[];tt("sweep 完成,清理 "+Q.length+" 个任务"+(Q.length?":"+Q.join("、"):""))}catch(O){tt(rr(O))}},[]),J=v.useCallback(async()=>{try{const O=await lt(P.adminBackup,"POST",{});tt("备份完成:backend="+O.backend+" | 路径 "+O.path+" | 大小 "+O.size_bytes+" 字节 | 任务 "+O.task_count+" 行")}catch(O){tt(rr(O))}},[]);return{keySaved:i,keyState:m,quotaText:_,healthText:N,adminGate:B,adminBody:k,adminResult:q,adminUserId:X,setAdminUserId:W,projects:G,projectId:Mt,setProjectId:Ft,projectMsg:nt,githubRepos:ee,workers:yt,workersSummary:ve,workersError:Wt,members:Ie,memberMsg:Y,memberError:at,skills:St,apps:He,mcpServers:y,skillMsg:I,skillError:pt,mcpMsg:_t,mcpOauthMsg:ut,mcpOauthBox:Ga,envs:Xe,envCount:zt,envMsg:Kl,envRepoLine:oa,envRepoBar:zl,envRepoMsg:jl,envSelect:ue,setEnvSelect:ie,models:sl,modelCustomVisible:da,refreshHealth:we,loadQuota:Tl,probeAdmin:fl,refreshProjects:kt,loadGithubRepos:Ul,loadRelayModels:mn,refreshWorkers:Qa,refreshEnvs:Se,refreshMembers:Xa,refreshSkills:ma,saveKeyInput:su,clearKeyInput:fu,createProject:Fl,createEnv:Ne,archiveEnv:rl,saveEnvRepo:Ce,inviteMember:ru,changeMemberRole:ou,reloadMcp:du,mcpOauth:H,adminQuota:D,adminSweep:L,adminBackup:J}}function Wy(){const[i,r]=v.useState([]),[m,o]=v.useState(""),[_,C]=v.useState(""),[N,b]=v.useState(""),[B,U]=v.useState(""),k=v.useCallback(async(X,W)=>{const G=X!==void 0?X:W;if(!G){r([]);return}try{const dt=await lt(P.tasks(G));r(dt.tasks||[]),o("")}catch(dt){o("加载失败:"+dt.message)}},[]),j=v.useMemo(()=>{const X=B.trim().toLowerCase();return i.filter(W=>!(_&&W.status!==_||N&&(W.executor||"")!==N||X&&!((W.id||"")+" "+(W.prompt||"")).toLowerCase().includes(X)))},[i,_,N,B]),q=j.length+" 个任务(共 "+i.length+" 个)",tt=v.useCallback(async(X,W)=>{const G={...X};W.length&&(G.upload_id=await Ky(W));const dt=await lt(P.tasksCreate,"POST",G);return"任务已建:"+Ue(dt.id)},[]);return{tasks:i,taskError:m,statusFilter:_,setStatusFilter:C,executorFilter:N,setExecutorFilter:b,searchText:B,setSearchText:U,filteredTasks:j,taskCountText:q,refreshTasks:k,dispatch:tt}}function $y(i,r){const[m,o]=v.useState(null),[_,C]=v.useState(""),[N,b]=v.useState(""),[B,U]=v.useState(""),[k,j]=v.useState(""),[q,tt]=v.useState(void 0),[X,W]=v.useState(!1),[G,dt]=v.useState(""),[Mt,Ft]=v.useState([]),[nt,Xt]=v.useState([]),[ee,ct]=v.useState(""),[yt,oe]=v.useState([]),[ve,Vt]=v.useState(""),[Wt,ae]=v.useState(""),[Ie,vt]=v.useState([]),[Y,A]=v.useState(""),[at,gt]=v.useState(""),[St,ye]=v.useState(""),[He,Ee]=v.useState(""),[y,R]=v.useState([]),[I,$]=v.useState([]),[pt,mt]=v.useState(""),[_t,Z]=v.useState([]),[ut,ne]=v.useState(""),[Ga,xl]=v.useState(""),[Xe,$t]=v.useState(""),[zt,de]=v.useState(""),[Kl,ge]=v.useState([]),[oa,Ve]=v.useState(""),[zl,Rl]=v.useState(null),jl=v.useRef(null),qe=v.useRef(null),ue=v.useRef(null);ue.current=m;const ie=v.useCallback(()=>{if(jl.current){try{jl.current.abort()}catch{}jl.current=null}qe.current&&(clearTimeout(qe.current),qe.current=null)},[]),sl=v.useCallback(async H=>{try{const D=await lt(P.taskAgents(H));Xt(D.agents||[]),ct(D.note||"")}catch(D){Xt([]),ct("子代理链路加载失败:"+D.message)}},[]),Jl=v.useCallback(H=>{qe.current&&clearTimeout(qe.current),qe.current=setTimeout(()=>void sl(H),1e3)},[sl]),da=v.useCallback(async H=>{if(!H.coordinator_parts){Ft([]);return}try{const D=await lt(P.tasksByParent(H.project_id||"",H.id));Ft(D.tasks||[])}catch{Ft([])}},[]),Dl=v.useCallback(async H=>{try{const D=await lt(P.taskCost(H));tt(D)}catch{tt(null)}},[]),Kt=v.useCallback(async H=>{try{const D=await lt(P.taskFollowups(H));R(D.followups||[])}catch{R([])}},[]),Pe=v.useCallback(async H=>{try{const D=await lt(P.taskChatHistory(H));Rl(D)}catch{Rl(null)}},[]),we=v.useCallback(async H=>{var L;const D=H||((L=ue.current)==null?void 0:L.id);if(D)try{const J=await lt(P.taskReviews(D));oe(J.reviews||[]),ae("")}catch(J){ae("评审队列加载失败:"+J.message)}},[]),Tl=v.useCallback(async H=>{var L;const D=H||((L=ue.current)==null?void 0:L.id);if(D)try{const J=await lt(P.taskApprovals(D));$(J.approvals||[])}catch(J){mt("审批队列加载失败:"+J.message)}},[]),fl=v.useCallback(async H=>{try{const D=await lt(P.taskMessages(H));Z(D.messages||[])}catch{Z([])}},[]),kt=v.useCLine truncated
`+a.stack}}var $t=Object.prototype.hasOwnProperty,Pe=i.unstable_scheduleCallback,we=i.unstable_cancelCallback,Tl=i.unstable_shouldYield,fl=i.unstable_requestPaint,Vt=i.unstable_now,Ul=i.unstable_getCurrentPriorityLevel,mn=i.unstable_ImmediatePriority,Qa=i.unstable_UserBlockingPriority,pe=i.unstable_NormalPriority,Xa=i.unstable_LowPriority,ma=i.unstable_IdlePriority,su=i.log,fu=i.unstable_setDisableYieldValue,Fl=null,Ce=null;function rl(t){if(typeof su=="function"&&fu(t),Ce&&typeof Ce.setStrictMode=="function")try{Ce.setStrictMode(Fl,t)}catch{}}var Ae=Math.clz32?Math.clz32:du,ru=Math.log,ou=Math.LN2;function du(t){return t>>>=0,t===0?32:31-(ru(t)/ou|0)|0}var H=256,D=262144,X=4194304;function K(t){var e=t&42;if(e!==0)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&-t;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function M(t,e,l){var a=t.pendingLanes;if(a===0)return 0;var n=0,u=t.suspendedLanes,s=t.pingedLanes;t=t.warmLanes;var f=a&134217727;return f!==0?(a=f&~u,a!==0?n=K(a):(s&=f,s!==0?n=K(s):l||(l=f&~t,l!==0&&(n=K(l))))):(f=a&~u,f!==0?n=K(f):s!==0?n=K(s):l||(l=a&~t,l!==0&&(n=K(l)))),n===0?0:e!==0&&e!==n&&(e&u)===0&&(u=n&-n,l=e&-e,u>=l||u===32&&(l&4194048)!==0)?e:n}function G(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function J(t,e){(e&8)!==0&&(e|=e&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=e;0<l;){var a=31-Ae(l),n=1<<a;e|=t[a],l&=~n}return e}function Ot(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Nt(){var t=X;return X<<=1,(X&62914560)===0&&(X=4194304),t}function be(t){for(var e=[],l=0;31>l;l++)e.push(t);return e}function xe(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Rc(t,e,l,a,n,u){var s=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var f=t.entanglements,d=t.expirationTimes,p=t.hiddenUpdates;for(l=s&~l;0<l;){var E=31-Ae(l),z=1<<E;f[E]=0,d[E]=-1;var g=p[E];if(g!==null)for(p[E]=null,E=0;E<g.length;E++){var T=g[E];T!==null&&(T.lane&=-536870913)}l&=~z}a!==0&&ci(t,a,0),u!==0&&n===0&&t.tag!==0&&(t.suspendedLanes|=u&~(s&~e))}function ci(t,e,l){t.pendingLanes|=e,t.suspendedLanes&=~e;var a=31-Ae(e);t.entangledLanes|=e,t.entanglements[a]=t.entanglements[a]|1073741824|l&261930}function hn(t,e){var l=t.entangledLanes|=e;for(t=t.entanglements;l;){var a=31-Ae(l),n=1<<a;n&e|t[a]&e&&(t[a]|=e),l&=~n}}function Wl(t,e){var l=e&-e;return l=(l&42)!==0?1:Hl(l),(l&(t.suspendedLanes|e))!==0?0:l}function Hl(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function mu(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function hu(){var t=it.p;return t!==0?t:(t=window.event,t===void 0?32:jh(t.type))}function Ze(t,e){var l=it.p;try{return it.p=t,e()}finally{it.p=l}}var ee=Math.random().toString(36).slice(2),ve="__reactFiber$"+ee,Ke="__reactProps$"+ee,vn="__reactContainer$"+ee,yr="__reactEvents$"+ee,Fh="__reactListeners$"+ee,Wh="__reactHandles$"+ee,gr="__reactResources$"+ee,vu="__reactMarker$"+ee,si="__reactLoad$"+ee;function fi(t){delete t[ve],delete t[Ke],delete t[Fh],delete t[Wh]}function Va(t){var e;if(e=t[ve])return e;for(var l=t.parentNode;l;){if(e=l[vn]||l[ve]){if(l=e.alternate,e.child!==null||l!==null&&l.child!==null)for(t=lh(t);t!==null;){if(l=t[ve])return l;t=lh(t)}return e}t=l,l=t.parentNode}return null}function yn(t){if(t=t[ve]||t[vn]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function yu(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(o(33))}function gn(t){var e=t[gr];return e||(e=t[gr]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function je(t){t[vu]=!0}function Sr(t){t[si]=void 0}var pr=new Set,br={};function La(t,e){Sn(t,e),Sn(t+"Capture",e)}function Sn(t,e){for(bLine truncated
`).replace(q0,"")}function Bm(t,e){return e=Hm(e),Hm(t)===e}function wt(t,e,l,a,n,u){switch(l){case"children":if(typeof a=="string")e==="body"||e==="textarea"&&a===""||bn(t,a);else if(typeof a=="number"||typeof a=="bigint")e!=="body"&&bn(t,""+a);else return;break;case"className":oi(t,"class",a);break;case"tabIndex":oi(t,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":oi(t,l,a);break;case"style":Or(t,a,u);return;case"data":if(e!=="object"){oi(t,"data",a);break}case"src":case"href":if(a===""&&(e!=="a"||l!=="href")){t.removeAttribute(l);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(l);break}a=di(a),t.setAttribute(l,a);break;case"action":case"formAction":if(typeof a=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(l==="formAction"?(e!=="input"&&wt(t,e,"name",n.name,n,null),wt(t,e,"formEncType",n.formEncType,n,null),wt(t,e,"formMethod",n.formMethod,n,null),wt(t,e,"formTarget",n.formTarget,n,null)):(wt(t,e,"encType",n.encType,n,null),wt(t,e,"method",n.method,n,null),wt(t,e,"target",n.target,n,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){t.removeAttribute(l);break}a=di(a),t.setAttribute(l,a);break;case"onClick":a!=null&&(t.onclick=Bl);return;case"onScroll":a!=null&&xt("scroll",t);return;case"onScrollEnd":a!=null&&xt("scrollend",t);return;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(o(60));(u!=null?u.__html:void 0)!==l&&(t.innerHTML=l)}}break;case"multiple":t.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":t.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){t.removeAttribute("xlink:href");break}l=di(a),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(l,a):t.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":a===!0?t.setAttribute(l,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?t.setAttribute(l,a):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?t.setAttribute(l,a):t.removeAttribute(l);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?t.removeAttribute(l):t.setAttribute(l,a);break;case"popover":xt("beforetoggle",t),xt("toggle",t),ri(t,"popover",a);break;case"xlinkActuate":$l(t,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":$l(t,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":$l(t,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":$l(t,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":$l(t,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":$l(t,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":$l(t,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":$l(t,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":$l(t,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":ri(t,"is",a);break;case"innerText":case"textContent":return;default:if(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")l=lv.get(l)||l,ri(t,l,a);else return}Mt=!0}function Hf(t,e,l,a,n,u){switch(l){case"style":Or(t,a,u);return;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(o(61));if(l=a.__html,l!=null){if(n.children!=null)throw Error(o(60));(u!=null?u.__html:void 0)!==l&&(t.innerHTML=l)}}break;case"children":if(typeof a=="string")bn(t,a);else if(typeof a=="number"||typeof a=="bigint")bn(t,""+a);else return;break;case"onScroll":a!=null&&xt("scroll",t);return;case"onScrollEnd":a!=null&&xt("scroLine truncated
`;Ot&&(be+=Ot+`
`),Nt&&(be+=(Array.isArray(Nt)?Nt.join(`
`):String(Nt))+`
`),be+=JSON.stringify(J,null,2).slice(0,4e3),xl(be),ce("已返回登录信息,见下方")}catch(J){ce("发起失败:"+J.message)}},[]),D=h.useCallback(async()=>{const M=F.trim();if(!M){I("请填要查配额的用户 id");return}try{const G=await at(tt.adminQuotaUser(M));I("用户 "+M.slice(0,8)+":本月用量 "+or(G.used_usd_micros)+" / 配额 "+or(G.quota_usd_micros)+(G.remaining_usd_micros!==null&&G.remaining_usd_micros!==void 0?"(剩余 "+or(G.remaining_usd_micros)+")":"")+" | 月份 "+(G.month||""))}catch(G){I(rr(G))}},[F]),X=h.useCallback(async()=>{if(window.confirm("确定手动触发 sweep 吗?超阈值的陈旧 running 任务会被标为 interrupted。"))try{const G=(await at(tt.adminSweep,"POST",{})).swept||[];I("sweep 完成,清理 "+G.length+" 个任务"+(G.length?":"+G.join("、"):""))}catch(M){I(rr(M))}},[]),K=h.useCallback(async()=>{try{const M=await at(tt.adminBackup,"POST",{});I("备份完成:backend="+M.backend+" | 路径 "+M.path+" | 大小 "+M.size_bytes+" 字节 | 任务 "+M.task_count+" 行")}catch(M){I(rr(M))}},[]);return{keySaved:i,keyState:m,quotaText:_,healthText:C,adminGate:B,adminBody:Y,adminResult:k,adminUserId:F,setAdminUserId:nt,projects:V,projectId:_t,setProjectId:Bt,projectMsg:W,githubRepos:Wt,workers:yt,workersSummary:ue,workersError:Kt,members:At,memberMsg:q,memberError:lt,skills:ot,apps:Be,mcpServers:y,skillMsg:P,skillError:pt,mcpMsg:Et,mcpOauthMsg:it,mcpOauthBox:Ga,envs:Ve,envCount:Rt,envMsg:Kl,envRepoLine:oa,envRepoBar:zl,envRepoMsg:jl,envSelect:se,setEnvSelect:fe,models:sl,modelCustomVisible:da,refreshHealth:we,loadQuota:Tl,probeAdmin:fl,refreshProjects:Vt,loadGithubRepos:Ul,loadRelayModels:mn,refreshWorkers:Qa,refreshEnvs:pe,refreshMembers:Xa,refreshSkills:ma,saveKeyInput:su,clearKeyInput:fu,createProject:Fl,createEnv:Ce,archiveEnv:rl,saveEnvRepo:Ae,inviteMember:ru,changeMemberRole:ou,reloadMcp:du,mcpOauth:H,adminQuota:D,adminSweep:X,adminBackup:K}}const dr=20;function Py(){const[i,r]=h.useState([]),[m,o]=h.useState(""),[_,N]=h.useState(""),[C,b]=h.useState(""),[B,U]=h.useState(""),[Y,j]=h.useState(0),[k,I]=h.useState(0),[F,nt]=h.useState({}),V=h.useRef(0),St=h.useRef({status:"",executor:"",q:""});St.current={status:_,executor:C,q:B};const _t=h.useRef(""),Bt=h.useCallback(async(At,st,q)=>{const A=At!==void 0?At:st;if(!A){r([]),I(0),nt({});return}_t.current=A;const lt=q!==void 0?q:V.current,ht=St.current;try{const ot=await at(tt.tasksPage(A,dr,lt*dr,ht.status,ht.executor,ht.q));r(ot.tasks||[]),I(ot.total??(ot.tasks||[]).length),nt(ot.status_counts||{}),o("")}catch(ot){o("加载失败:"+ot.message)}},[]),W=h.useCallback(At=>{const st=Math.max(0,At);V.current=st,j(st)},[]),Qt=h.useCallback(At=>{W(At),Bt(_t.current||void 0,void 0,At)},[Bt,W]);h.useEffect(()=>{if(!_t.current)return;const At=setTimeout(()=>{Bt(_t.current,void 0,0)},300);return()=>clearTimeout(At)},[_,C,B]);const Wt=h.useCallback(At=>{N(At),W(0)},[W]),ut=h.useCallback(At=>{b(At),W(0)},[W]),yt=h.useCallback(At=>{U(At),W(0)},[W]),ne=h.useCallback(async At=>{W(0),await Bt(At,void 0,0)},[Bt,W]),ue=Math.max(1,Math.ceil(k/dr)),Xt=k===0?"共 0 个任务":"共 "+k+" 个任务,第 "+(Y+1)+" / "+ue+" 页",Kt=i,Pt=h.useCallback(async(At,st)=>{const q={...At};st.length&&(q.upload_id=await Wy(st));const A=await at(tt.tasksCreate,"POST",q);return"任务已建:"+He(A.id)},[]);return{tasks:i,taskError:m,statusFilter:_,setStatusFilter:Wt,executorFilter:C,setExecutorFilter:ut,searchText:B,setSearchText:yt,filteredTasks:Kt,taskCountText:Xt,refreshTasks:Bt,refreshTasksFirstPage:ne,page:Y,totalPages:ue,taskTotal:k,taskStatusCounts:F,goToPage:Qt,dispatch:Pt}}function tg(i,r){const[m,o]=h.useState(null),[_,N]=h.useState(""),[C,b]=h.useState(""),[B,U]=h.useState(""),[Y,j]=h.useState(""),[k,I]=h.useState(void 0),[F,nt]=h.useState(!1),[V,St]=h.useState(""),[_t,Bt]=h.useState([]),[W,Qt]=h.useState([]),[Wt,ut]=h.useState(""),[yt,ne]=h.useState([]),[ue,Xt]=h.useState(""),[Kt,Pt]=h.useState(""),[At,st]=h.useState([]),[q,A]=h.useState(""),[lt,ht]=h.useState(""),[ot,ge]=h.useState(""),[Be,Ne]=h.useState(""),[y,R]=h.useState([]),[P,$]=h.useState([]),[pt,vt]=h.useState(""),[Et,L]=h.useState([]),[it,ce]=h.useState(""),[Ga,xl]=h.useState(""),[Ve,te]=h.useState(""),[Rt,he]=h.useState(""),[Kl,Se]=h.useState([]),[oa,Le]=h.useState(""),[zl,Rl]=h.useState(null),jl=h.useRef(null),ke=h.useRef(null),se=h.useRef(null);se.current=m;const fe=h.useCallback(()=>{if(jl.current){try{jl.current.abort()}catch{}jl.current=null}ke.current&&(clearTimeout(ke.current),ke.current=null)},[]),sl=h.useCallback(async H=>{try{const D=await at(tt.taskAgents(H));Qt(D.agents||[]),ut(D.note||"")}catch(D){Qt([]),ut("子代理链路加载失败:"+D.message)}},[]),Jl=h.useCallback(H=>{ke.current&&clearTimeout(ke.current),ke.current=setTimeout(()=>void sl(H),1e3)},[sl]),da=h.useCallback(async H=>{if(!H.coordinator_parts){Bt([]);return}try{const D=await at(tt.tasksByParent(H.project_id||"",H.id));Bt(D.tasks||[])}catch{Bt([])}},[]),Dl=h.useCallbacLine truncated
`);hn=Hl.pop()||"";for(const mu of Hl){const hu=mu.split(`
`).filter(Le=>Le.indexOf("data: ")===0).map(Le=>Le.slice(6)).join(`
`);if(hu)try{const Le=JSON.parse(hu);if(Le.type==="snapshot")J=Le.entries||[],Object.keys(O).forEach(It=>delete O[It]),J.forEach((It,me)=>{It.id&&(O[It.id]=me)}),Q=Le.note||"",vt([...J]),A(Q),Jl(H);else if(Le.type==="entry"){const It=Le.entry;It.id&&It.id in O?J[O[It.id]]=It:(It.id&&(O[It.id]=J.length),J.push(It)),vt([...J]),Jl(H)}else Le.type==="done"&&(F=!0,At=Le.status,gt(At))}catch{}}if(F)break}}catch(Et){if(Et&&Et.name==="AbortError")return;A("链路流中断:"+Et.message);return}F&&r()},[ie,Jl,r]),Se=v.useCallback(async H=>{ie();try{const D=await lt(P.task(H));o(D);let L="";D.result_text&&(L+=`=== result ===
`).filter(Ze=>Ze.indexOf("data: ")===0).map(Ze=>Ze.slice(6)).join(`
`);if(hu)try{const Ze=JSON.parse(hu);if(Ze.type==="snapshot")K=Ze.entries||[],Object.keys(M).forEach(ee=>delete M[ee]),K.forEach((ee,ve)=>{ee.id&&(M[ee.id]=ve)}),G=Ze.note||"",st([...K]),A(G),Jl(H);else if(Ze.type==="entry"){const ee=Ze.entry;ee.id&&ee.id in M?K[M[ee.id]]=ee:(ee.id&&(M[ee.id]=K.length),K.push(ee)),st([...K]),Jl(H)}else Ze.type==="done"&&(J=!0,Ot=Ze.status,ht(Ot))}catch{}}if(J)break}}catch(Nt){if(Nt&&Nt.name==="AbortError")return;A("链路流中断:"+Nt.message);return}J&&r()},[fe,Jl,r]),pe=h.useCallback(async H=>{fe();try{const D=await at(tt.task(H));o(D);let X="";D.result_text&&(X+=`=== result ===
`+D.result_text.slice(0,8e3)+`
`),D.error_text&&(L+=`=== error ===
`),D.error_text&&(X+=`=== error ===
`+D.error_text.slice(0,8e3)+`
`),L||(L="(暂无 result/error 输出)"),C(L),j(""),tt(void 0),Dl(H),W(!1),dt(""),ne(""),de(""),mn(D.status);const J=i(D.project_id),O=J==="maintainer"||J==="owner",Q=J==="contributor"||O,F=uu.includes(D.status),At=[];["failed","interrupted","merge-failed"].includes(D.status)&&O||At.push("重试:不可用——仅 failed/interrupted/merge-failed 可重试"+(O?"":",且仅 maintainer 可重试")),!F&&Q||At.push("取消:不可用——"+(F?"终态任务不可取消":"仅项目成员(contributor 及以上)可取消")),D.status==="completed"&&O||At.push("合并:不可用——仅 completed 可合并"+(O?"":",且仅 maintainer 可合并")),D.status==="merged"&&O||At.push("提 PR:不可用——仅 merged 可提 PR"+(O?"":",且仅 maintainer 可提 PR")),U(At.join(";")),b(""),Qa(H,D.status),sl(H),da(D),Pe(H),Kt(H),fl(H),kt(H),Ul(H),we(H),Tl(H)}catch(D){o(null),C("加载失败:"+D.message)}},[ie,Qa,sl,da,Pe,Kt,fl,kt,Ul,we,Tl,Dl,i]),Xa=v.useCallback(async()=>{const H=ue.current;if(H){try{const D=await lt(P.task(H.id));o(D);let L="";D.result_text&&(L+=`=== result ===
`),X||(X="(暂无 result/error 输出)"),N(X),j(""),I(void 0),Dl(H),nt(!1),St(""),ce(""),he(""),mn(D.status);const K=i(D.project_id),M=K==="maintainer"||K==="owner",G=K==="contributor"||M,J=uu.includes(D.status),Ot=[];["failed","interrupted","merge-failed"].includes(D.status)&&M||Ot.push("重试:不可用——仅 failed/interrupted/merge-failed 可重试"+(M?"":",且仅 maintainer 可重试")),!J&&G||Ot.push("取消:不可用——"+(J?"终态任务不可取消":"仅项目成员(contributor 及以上)可取消")),D.status==="completed"&&M||Ot.push("合并:不可用——仅 completed 可合并"+(M?"":",且仅 maintainer 可合并")),D.status==="merged"&&M||Ot.push("提 PR:不可用——仅 merged 可提 PR"+(M?"":",且仅 maintainer 可提 PR")),U(Ot.join(";")),b(""),Qa(H,D.status),sl(H),da(D),Pe(H),$t(H),fl(H),Vt(H),Ul(H),we(H),Tl(H)}catch(D){o(null),N("加载失败:"+D.message)}},[fe,Qa,sl,da,Pe,$t,fl,Vt,Ul,we,Tl,Dl,i]),Xa=h.useCallback(async()=>{const H=se.current;if(H){try{const D=await at(tt.task(H.id));o(D);let X="";D.result_text&&(X+=`=== result ===
`+D.result_text.slice(0,8e3)+`
`),D.error_text&&(L+=`=== error ===
`),D.error_text&&(X+=`=== error ===
`+D.error_text.slice(0,8e3)+`
`),C(L||"(暂无 result/error 输出)")}catch{}Kt(H.id),Pe(H.id),we(H.id),Tl(H.id),da(H),sl(H.id),fl(H.id),kt(H.id),Ul(H.id),Dl(H.id)}},[Kt,Pe,we,Tl,da,sl,fl,kt,Ul,Dl]),ma=v.useCallback(async H=>{const D=ue.current;if(!D)return;const L={cancel:"确定取消该任务吗?",merge:"确定把 completed 任务标为 merged 吗?",pr:"确定为该任务提 PR 吗?(会在仓库真实建 PR)"};if(!(L[H]&&!window.confirm(L[H])))try{const J=await lt(P.taskAction(D.id,H),"POST",{});b(H+" 已提交:"+JSON.stringify(J).slice(0,300)),r(),await Se(D.id)}catch(J){b(H+" 失败:"+J.message)}},[Se,r]),su=v.useCallback(async()=>{const H=ue.current;if(H)try{const D=await lt(P.taskCost(H.id));j(JSON.stringify(D,null,2).slice(0,4e3))}catch(D){j("查成本失败:"+D.message)}},[]),fu=v.useCallback(async H=>{const D=ue.current;if(D){if(!H.trim()){dt("分支消息必填");return}if(!uu.includes(D.status)){dt("仅终态任务可分支");return}try{const L=await lt(P.taskFork(D.id),"POST",{message:H.trim()});dt("分支任务已建:"+L.id.slice(0,8)),r()}catch(L){dt("分支失败:"+L.message)}}},[r]),Fl=v.useCallback(async H=>{const D=ue.current;if(D)try{await lt(P.taskReviews(D.id),"POST",H),Vt("评审已登记(requested)"),await we(D.id)}catch(L){Vt("登记评审需求失败:"+L.message)}},[we]),Ne=v.useCallback(H=>{const D=ue.current;if(!D)return;const L=window.prompt("输入该条评审的 findings(将写回记录并标为 completed):");L!==null&&lt(P.taskReviewFindings(D.id,H),"POST",{findings:L}).then(()=>void we(D.id)).catch(J=>Vt("写 findings 失败:"+J.message))},[we]),rl=v.useCallback((H,D)=>{const L=ue.current;if(!L)return;const J=D==="approved"?"approve":"deny";lt(P.taskApprovalDecision(L.id,H,J),"POST",{}).then(()=>{mt("已记录"+(D==="approved"?"允许":"拒绝")+"(当前版本只留回执,不拦截实时行为)"),Tl(L.id)}).catch(O=>mt("决定失败:"+O.message))},[Tl]),Ce=v.useCallback(async(H,D,L)=>{const J=ue.current;if(J){if(!D.trim()){ne("目标任务 id 不能为空");return}if(!L.trim()){ne("消息正文不能为空");return}try{const O=await lt(P.taskMessagesTo(D.trim()),"POST",{from_task_id:J.id,body:L.trim(),mode:H});ne("已发送("+O.delivery+")"),await fl(J.id)}catch(O){ne("发送失败:"+O.message)}}},[fl]),ru=v.useCallback((H,D)=>{const L=ue.current;if(!L)return;if(!["completed","failed","interrupted"].includes(L.status)){de("仅 completed/failed/interrupted 任务可操作线程(merged/merge-failed 不可改,服务端同样 409)");return}const J={};if(H==="rename"){if(!D.trim()){de("新线程名不能为空");return}J.name=D.trim()}lt(P.taskThreadAction(L.id,H),"POST",J).then(O=>{de(H+" 已提交:"+JSON.stringify(O).slice(0,300)),kt(L.id),Ul(L.id)}).catch(O=>de(H+" 失败:"+O.message))},[kt,Ul]),ou=v.useCallback(async H=>{const D=ue.current;if(!D)return;const L=H.trim();if(!L){Ve("消息不能为空");return}try{uu.includes(D.status)&&D.status!=="merged"?(await lt(P.taskContinue(D.id),"POST",{message:L}),Ve("已重新排队,同一会话继续"),r(),await Se(D.id)):["queued","running"].includes(D.status)?(await lt(P.taskFollowups(D.id),"POST",{body:L,mode:"direct"}),Ve("已直接发送"),await Kt(D.id),await Pe(D.id)):Ve("merged/merge-failed 任务不可继续,也不可发后续消息")}catch(J){Ve("发送失败:"+J.message)}},[Se,r,Kt,Pe]),du=v.useCallback(async()=>{const H=ue.current;if(!H){Ee("先选一个任务");return}try{const D=await lt(P.taskTrace(H.id)),L=new Blob([JSON.stringify({task_id:H.id,status:D.status,note:D.note||"",count:(D.entries||[]).length,entries:D.entries||[]},null,2)],{type:"application/json"}),J=document.createElement("a");J.href=URL.createObjectURL(L),J.download="trace-"+H.id.slice(0,8)+".json",document.body.appendChild(J),J.click(),J.remove(),setTimeout(()=>URL.revokeObjectURL(J.href),1e3),Ee("已下载完整链路 "+(D.entries||[]).length+" 条")}catch(D){Ee("下载失败:"+D.message)}},[]);return v.useEffect(()=>()=>ie(),[ie]),{currentTask:m,detailBody:_,actionMsg:N,actionReasons:B,costBox:k,costSummary:q,forkVisible:X,setForkVisible:W,forkMsg:G,coordChildren:Mt,agents:nt,agentsNote:ee,reviews:yt,reviewMsg:ve,reviewError:Wt,traceEntries:Ie,traceNote:Y,traceDone:at,traceKind:St,setTraceKind:ye,traceMsg:He,followups:y,approvals:I,approvalMsg:pt,peerMessages:_t,peerMsg:ut,threadText:Ga,threadGateNote:Xe,threadMsg:zt,threadList:Kl,chatMsg:oa,chatHistory:zl,showDetail:Se,refreshDetailLists:Xa,doAction:ma,taskCost:su,forkTask:fu,postReview:Fl,submitFindings:Ne,decideApproval:rl,postPeer:Ce,threadAction:ru,sendChatMessage:ou,downloadTrace:du,refreshReviews:()=>void we(),refreshApprovals:()=>void Tl()}}function Iy(i){const[r,m]=v.useState([]),[o,_]=v.useState(""),[C,N]=v.useState(null),[b,B]=v.useState(""),U=v.useCallback(async tt=>{const X=tt!==void 0?tt:i();if(!X){m([]);return}try{const W=await lt(P.projectAutomations(X));m(W.automations||[])}catch(W){_("自动化加载失败:"+W.message)}},[i]),k=v.useCallbacLine truncated
(链路摘要已截断至 300 字,完整回复见右侧任务结果)`:o,label:"助手"}}if(i.kind==="exec"||i.kind==="file"||i.kind==="tool"||i.kind==="call"){const o=i.kind==="exec"?"命令":i.kind==="file"?"文件":i.kind==="tool"?"工具":"调用";return{id:m,role:"tool",kind:i.kind,text:dr(i),label:o}}return i.kind==="plan"?{id:m,role:"status",kind:i.kind,text:i.text||""}:i.kind==="reasoning"?{id:m,role:"status",kind:i.kind,text:"思考:"+(i.summary||"")}:i.kind==="agent-start"?{id:m,role:"status",kind:i.kind,text:"子代理开始:"+(i.name||"")+(i.prompt?"("+i.prompt+")":"")}:i.kind==="agent-done"?{id:m,role:"status",kind:i.kind,text:"子代理结束:"+(i.name||"")+" "+(i.status||"")}:{id:m,role:"status",kind:i.kind,text:dr(i)}}function og(){const i=Ut(),r=i.currentTask,m=v.useMemo(()=>{if(!r)return[];let B;if(i.chatHistory){B=i.chatHistory.messages.map(X=>({id:X.id,role:X.role,text:X.text,label:X.label,kind:X.kind}));const q=new Set(B.map(X=>X.id)),tt=i.traceEntries.filter(X=>X.id&&!q.has(X.id)&&!String(X.id).startsWith("fu-")).map((X,W)=>Yh(X,W));B=[...B,...tt]}else{const q=r.prompt?[{id:"task-prompt",role:"user",text:r.prompt}]:[],tt=i.traceEntries.filter(W=>!String(W.id||"").startsWith("fu-")).map((W,G)=>Yh(W,G)),X=i.followups.map((W,G)=>({id:"followup-"+G,role:"user",text:String(W.body||""),label:"后续消息"}));B=[...q,...tt,...X]}const U=i.traceKind,k=U?B.filter(q=>q.role==="user"||!q.kind||q.kind===U):B,j=i.traceDone?[{id:"trace-done",role:"status",text:"链路已结束("+i.traceDone+")"}]:[];return[...k,...j]},[r,i.chatHistory,i.traceEntries,i.followups,i.traceKind,i.traceDone]);if(!r)return c.jsx("div",{className:"muted",children:"点任务行查看详情后,这里显示继续会话"});const o=uu.includes(r.status),_=["queued","running"].includes(r.status),C=o||_,N=o?"终态任务:发送走继续接口(同一会话再跑一轮)":_?"运行中/排队中:发送走后续消息直接发送(跑完当前轮后优先执行)":"merged/merge-failed 任务不可继续,也不可发后续消息",b=i.chatHistory?i.chatHistory.legacy_continue_count??null:null;return c.jsxs("div",{className:"chat-column",children:[c.jsx("div",{className:"muted",children:"实时对话"}),c.jsxs(Dt,{children:[c.jsxs("select",{"aria-label":"链路类型",value:i.traceKind,onChange:B=>i.setTraceKind(B.target.value),children:[c.jsx("option",{value:"",children:"链路类型:全部"}),["exec","file","call","tool","message","reasoning","plan","agent-start","agent-done"].map(B=>c.jsx("option",{value:B,children:B==="exec"?"命令":B==="file"?"文件":B==="call"?"调用":B==="tool"?"工具":B==="message"?"消息":B==="reasoning"?"思考":B==="plan"?"计划":"子代理"},B))]}),c.jsx("button",{onClick:i.downloadTrace,children:"下载完整链路"}),c.jsx("span",{className:"muted",children:i.traceMsg})]}),i.traceNote?c.jsx("div",{children:c.jsx("span",{className:"err",children:i.traceNote})}):null,b!==null&&b>0?c.jsxs("div",{className:"muted",children:["此前有 ",b," 条继续消息发生在持久化之前,未入库,上面历史不完整;部署后新发的继续消息会正常显示。"]}):null,i.chatHistory&&i.chatHistory.trace_note?c.jsx("div",{className:"muted",children:i.chatHistory.trace_note}):null,c.jsx(fg,{messages:m,empty:"(暂无会话消息)"}),c.jsx(rg,{disabled:!C,placeholder:"消息",onSend:B=>void i.sendChatMessage(B)}),c.jsxs("div",{className:"muted",children:[N,"。",i.chatMsg]}),c.jsx("div",{className:"muted",children:"对话时间线:首条是本任务 prompt(用户);助手回复、命令/文件/工具/调用、计划/思考/子代理开始结束都在同一列里,不再另起一份链路名单。流式进行中时新条目实时追加;你在底部时自动跟随,往上翻时暂停跟随,点“回到最新”恢复。"})]})}function dg(){return Ut().currentTask?c.jsx("div",{className:"conversation",children:c.jsx(og,{})}):c.jsx("div",{className:"conversation",children:c.jsx("div",{className:"muted",children:"在任务列表里点一条任务,对话和详情就切到该任务;也可以在上面派发一个新任务。"})})}function mg(){const i=Ut(),r=i.currentTask,[m,o]=v.useState("");if(!r)return null;const _=uu.includes(r.status),C=["failed","interrupted","merge-failed"].includes(r.status);return c.jsxs(c.Fragment,{children:[c.jsxs(Dt,{children:[c.jsx("button",{disabled:!C,title:C?"":"仅 failed/interrupted/merge-failed 可重试",onClick:()=>i.doAction("retry"),children:"重试"}),c.jsx("button",{className:"danger",disabled:_,title:_?"终态任务不可取消":"",onClick:()=>i.doAction("cancel"),children:"取消"}),c.jsx("button",{disabled:r.status!=="completed",title:r.status!=="completed"?"仅 completed 可合并":"",onClick:()=>i.doAction("merge"),children:"合并(completed → merged)"}),c.jsx("button",{disabled:r.status!=="merged",title:r.status!=="merged"?"仅 merged 可提 PR":"",onClick:()=>i.doAction("pr"),children:"提 PR(须 merLine truncated
<style rel="stylesheet" crossorigin>:root{--text:#1f2328;--muted:#656d76;--subtle:#6e7781;--line:#d0d7de;--line-muted:#d8dee4;--paper:#ffffff;--card:#ffffff;--subtle-bg:#f6f8fa;--inset-bg:#f6f8fa;--accent:#0969da;--accent-emphasis:#0969da;--green:#2da44e;--green-hover:#2c974b;--success:#1a7f37;--danger:#d1242f;--danger-bg:#ffebe9;--attention:#9a6700;--done:#8250df;--selected-bg:#ddf4ff;--radius:6px;--shadow:0 1px 0 rgba(27,31,36,.04);--sans:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif;--mono:ui-monospace,SFMono-Regular,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;--ctl:32px}*{box-sizing:border-box}html,body,#root{height:100%}body{font-family:var(--sans);margin:0;color:var(--text);background:#fff;line-height:1.5;font-size:14px}a{color:var(--accent);text-underline-offset:3px}:focus-visible{outline:2px solid var(--accent);outline-offset:2px}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}.muted{color:var(--muted);font-size:12px;line-height:1.5}.err{color:var(--danger)}.ok{color:var(--success)}button{cursor:pointer;font-weight:500;border-radius:var(--radius);border:1px solid var(--line);background:#fff;color:var(--text);box-shadow:var(--shadow)}button:hover{background:var(--subtle-bg)}button:disabled{opacity:.45;cursor:not-allowed;box-shadow:none}button.primary,button.seal{background:var(--green);border-color:#1b1f2426;color:#fff}button.primary:hover,button.seal:hover{background:var(--green-hover)}button.danger{color:var(--danger);border-color:var(--line);background:#fff}button.danger:hover{background:var(--danger-bg);color:var(--danger)}.icon-btn{width:32px;height:32px;padding:0;display:grid;place-items:center;border:1px solid var(--line);border-radius:var(--radius);background:#fff;color:var(--text);font-size:16px;line-height:1}.icon-btn:hover{background:var(--subtle-bg)}.dash-topbar{position:sticky;top:0;z-index:10;background:#24292f;color:#fff;border-bottom:1px solid rgba(255,255,255,.15);padding:10px 20px 8px}.dash-topbar .muted{color:#ffffffbf}.dash-topbar-row{display:flex;gap:14px;align-items:center;flex-wrap:wrap}.dash-brand{font-weight:600;font-size:16px;color:#fff}.dash-status{font-size:13px;font-weight:600;color:#ffffffbf}.dash-status.ok{color:#2da44e}.dash-stamp{margin-left:auto}.dash-nav{display:flex;gap:4px;flex-wrap:wrap;margin-top:8px}.dash-nav a{color:#fff;text-decoration:none;font-size:13px;font-weight:600;padding:6px 12px;border-radius:var(--radius)}.dash-nav a:hover{background:#ffffff1f;text-decoration:none}.dash-page{max-width:1180px;margin:0 auto;padding:20px;display:flex;flex-direction:column;gap:20px}.dash-page>*{min-width:0}.dash-section>*{min-width:0}.dash-section{scroll-margin-top:130px;display:flex;flex-direction:column;gap:16px}.dash-section.card{padding:16px}.dash-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.dash-card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:16px;min-width:0}.dash-card-label{color:var(--muted);font-size:12px;font-weight:600}.dash-card-value{font-size:24px;font-weight:600;line-height:1.3;overflow-wrap:anywhere}.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:none;padding:16px}.card h2{font-size:14px;margin:0 0 12px;font-weight:600}.card h3{font-size:14px;margin:24px 0 12px;padding-top:16px;border-top:1px solid var(--line);font-weight:600}.card h3:first-of-type{border-top:0;padding-top:0}.composer h2{font-size:16px}.composer textarea.prompt{min-height:148px;font-size:14px;padding:12px;border-radius:var(--radius)}.composer textarea.coord{font-family:var(--mono);font-size:13px}.bar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:12px 0}.bar>button,.bar>label{display:inline-flex;align-items:center;height:var(--ctl);min-height:var(--ctl);padding:0 16px;box-sizing:border-box;white-space:nowrap}.bar>input,.bar>select{height:var(--ctl);min-height:var(--ctl)}input,select,textarea,button{font:inherit;font-size:14px;padding:5px 12px;border-radius:var(--radius);border:1px solid var(--line);background:#fff;color:var(--text)}input:focus,select:focus,textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px #0969da4d}select{-moz-appearance:none;appearance:none;-webkit-appearance:none;cursor:pointer;padding-right:34px;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23656d76' stroke-width='1.5' stroke-linecap='round'/></svg>");background-repeat:no-repeat;background-position:right 12px center}select::-ms-expand{display:none}select:disabled,input:disabled{color:var(--muted);background:var(--subtle-bg);cursor:not-allowed}input[type=checkbox]{width:16px;height:16px;accent-color:var(--accent)}input[type=file]{height:var(--ctl);display:inline-flex;align-items:center;padding:0 12px;border:1px dashed var(--line);border-radius:var(-Line truncated
`),N(X||"(暂无 result/error 输出)")}catch{}$t(H.id),Pe(H.id),we(H.id),Tl(H.id),da(H),sl(H.id),fl(H.id),Vt(H.id),Ul(H.id),Dl(H.id)}},[$t,Pe,we,Tl,da,sl,fl,Vt,Ul,Dl]),ma=h.useCallback(async H=>{const D=se.current;if(!D)return;const X={cancel:"确定取消该任务吗?",merge:"确定把 completed 任务标为 merged 吗?",pr:"确定为该任务提 PR 吗?(会在仓库真实建 PR)"};if(!(X[H]&&!window.confirm(X[H])))try{const K=await at(tt.taskAction(D.id,H),"POST",{});b(H+" 已提交:"+JSON.stringify(K).slice(0,300)),r(),await pe(D.id)}catch(K){b(H+" 失败:"+K.message)}},[pe,r]),su=h.useCallback(async()=>{const H=se.current;if(H)try{const D=await at(tt.taskCost(H.id));j(JSON.stringify(D,null,2).slice(0,4e3))}catch(D){j("查成本失败:"+D.message)}},[]),fu=h.useCallback(async H=>{const D=se.current;if(D){if(!H.trim()){St("分支消息必填");return}if(!uu.includes(D.status)){St("仅终态任务可分支");return}try{const X=await at(tt.taskFork(D.id),"POST",{message:H.trim()});St("分支任务已建:"+X.id.slice(0,8)),r()}catch(X){St("分支失败:"+X.message)}}},[r]),Fl=h.useCallback(async H=>{const D=se.current;if(D)try{await at(tt.taskReviews(D.id),"POST",H),Xt("评审已登记(requested)"),await we(D.id)}catch(X){Xt("登记评审需求失败:"+X.message)}},[we]),Ce=h.useCallback(H=>{const D=se.current;if(!D)return;const X=window.prompt("输入该条评审的 findings(将写回记录并标为 completed):");X!==null&&at(tt.taskReviewFindings(D.id,H),"POST",{findings:X}).then(()=>void we(D.id)).catch(K=>Xt("写 findings 失败:"+K.message))},[we]),rl=h.useCallback((H,D)=>{const X=se.current;if(!X)return;const K=D==="approved"?"approve":"deny";at(tt.taskApprovalDecision(X.id,H,K),"POST",{}).then(()=>{vt("已记录"+(D==="approved"?"允许":"拒绝")+"(当前版本只留回执,不拦截实时行为)"),Tl(X.id)}).catch(M=>vt("决定失败:"+M.message))},[Tl]),Ae=h.useCallback(async(H,D,X)=>{const K=se.current;if(K){if(!D.trim()){ce("目标任务 id 不能为空");return}if(!X.trim()){ce("消息正文不能为空");return}try{const M=await at(tt.taskMessagesTo(D.trim()),"POST",{from_task_id:K.id,body:X.trim(),mode:H});ce("已发送("+M.delivery+")"),await fl(K.id)}catch(M){ce("发送失败:"+M.message)}}},[fl]),ru=h.useCallback((H,D)=>{const X=se.current;if(!X)return;if(!["completed","failed","interrupted"].includes(X.status)){he("仅 completed/failed/interrupted 任务可操作线程(merged/merge-failed 不可改,服务端同样 409)");return}const K={};if(H==="rename"){if(!D.trim()){he("新线程名不能为空");return}K.name=D.trim()}at(tt.taskThreadAction(X.id,H),"POST",K).then(M=>{he(H+" 已提交:"+JSON.stringify(M).slice(0,300)),Vt(X.id),Ul(X.id)}).catch(M=>he(H+" 失败:"+M.message))},[Vt,Ul]),ou=h.useCallback(async H=>{const D=se.current;if(!D)return;const X=H.trim();if(!X){Le("消息不能为空");return}try{uu.includes(D.status)&&D.status!=="merged"?(await at(tt.taskContinue(D.id),"POST",{message:X}),Le("已重新排队,同一会话继续"),r(),await pe(D.id)):["queued","running"].includes(D.status)?(await at(tt.taskFollowups(D.id),"POST",{body:X,mode:"direct"}),Le("已直接发送"),await $t(D.id),await Pe(D.id)):Le("merged/merge-failed 任务不可继续,也不可发后续消息")}catch(K){Le("发送失败:"+K.message)}},[pe,r,$t,Pe]),du=h.useCallback(async()=>{const H=se.current;if(!H){Ne("先选一个任务");return}try{const D=await at(tt.taskTrace(H.id)),X=new Blob([JSON.stringify({task_id:H.id,status:D.status,note:D.note||"",count:(D.entries||[]).length,entries:D.entries||[]},null,2)],{type:"application/json"}),K=document.createElement("a");K.href=URL.createObjectURL(X),K.download="trace-"+H.id.slice(0,8)+".json",document.body.appendChild(K),K.click(),K.remove(),setTimeout(()=>URL.revokeObjectURL(K.href),1e3),Ne("已下载完整链路 "+(D.entries||[]).length+" 条")}catch(D){Ne("下载失败:"+D.message)}},[]);return h.useEffect(()=>()=>fe(),[fe]),{currentTask:m,detailBody:_,actionMsg:C,actionReasons:B,costBox:Y,costSummary:k,forkVisible:F,setForkVisible:nt,forkMsg:V,coordChildren:_t,agents:W,agentsNote:Wt,reviews:yt,reviewMsg:ue,reviewError:Kt,traceEntries:At,traceNote:q,traceDone:lt,traceKind:ot,setTraceKind:ge,traceMsg:Be,followups:y,approvals:P,approvalMsg:pt,peerMessages:Et,peerMsg:it,threadText:Ga,threadGateNote:Ve,threadMsg:Rt,threadList:Kl,chatMsg:oa,chatHistory:zl,showDetail:pe,refreshDetailLists:Xa,doAction:ma,taskCost:su,forkTask:fu,postReview:Fl,submitFindings:Ce,decideApproval:rl,postPeer:Ae,threadAction:ru,sendChatMessage:ou,downloadTrace:du,refreshReviews:()=>void we(),refreshApprovals:()=>void Tl()}}function eg(i){const[r,m]=h.useState([]),[o,_]=h.useState(""),[N,C]=h.useState(null),[b,B]=h.useState(""),U=h.useCallback(async I=>{const F=I!==void 0?I:i();if(!F){m([]);return}try{const nt=await at(tt.projectAutomations(F));m(nt.automations||[])}catch(nt){_("自动化加载失败:"+nt.message)}},[i]),YLine truncated
(链路摘要已截断至 300 字,完整回复见右侧任务结果)`:o,label:"助手"}}if(i.kind==="exec"||i.kind==="file"||i.kind==="tool"||i.kind==="call"){const o=i.kind==="exec"?"命令":i.kind==="file"?"文件":i.kind==="tool"?"工具":"调用";return{id:m,role:"tool",kind:i.kind,text:mr(i),label:o}}return i.kind==="plan"?{id:m,role:"status",kind:i.kind,text:i.text||""}:i.kind==="reasoning"?{id:m,role:"status",kind:i.kind,text:"思考:"+(i.summary||"")}:i.kind==="agent-start"?{id:m,role:"status",kind:i.kind,text:"子代理开始:"+(i.name||"")+(i.prompt?"("+i.prompt+")":"")}:i.kind==="agent-done"?{id:m,role:"status",kind:i.kind,text:"子代理结束:"+(i.name||"")+" "+(i.status||"")}:{id:m,role:"status",kind:i.kind,text:mr(i)}}function hg(){const i=Ht(),r=i.currentTask,m=h.useMemo(()=>{if(!r)return[];let B;if(i.chatHistory){B=i.chatHistory.messages.map(F=>({id:F.id,role:F.role,text:F.text,label:F.label,kind:F.kind}));const k=new Set(B.map(F=>F.id)),I=i.traceEntries.filter(F=>F.id&&!k.has(F.id)&&!String(F.id).startsWith("fu-")).map((F,nt)=>Yh(F,nt));B=[...B,...I]}else{const k=r.prompt?[{id:"task-prompt",role:"user",text:r.prompt}]:[],I=i.traceEntries.filter(nt=>!String(nt.id||"").startsWith("fu-")).map((nt,V)=>Yh(nt,V)),F=i.followups.map((nt,V)=>({id:"followup-"+V,role:"user",text:String(nt.body||""),label:"后续消息"}));B=[...k,...I,...F]}const U=i.traceKind,Y=U?B.filter(k=>k.role==="user"||!k.kind||k.kind===U):B,j=i.traceDone?[{id:"trace-done",role:"status",text:"链路已结束("+i.traceDone+")"}]:[];return[...Y,...j]},[r,i.chatHistory,i.traceEntries,i.followups,i.traceKind,i.traceDone]);if(!r)return c.jsx("div",{className:"muted",children:"点任务行查看详情后,这里显示继续会话"});const o=uu.includes(r.status),_=["queued","running"].includes(r.status),N=o||_,C=o?"终态任务:发送走继续接口(同一会话再跑一轮)":_?"运行中/排队中:发送走后续消息直接发送(跑完当前轮后优先执行)":"merged/merge-failed 任务不可继续,也不可发后续消息",b=i.chatHistory?i.chatHistory.legacy_continue_count??null:null;return c.jsxs("div",{className:"chat-column",children:[c.jsx("div",{className:"muted",children:"实时对话"}),c.jsxs(Ut,{children:[c.jsxs("select",{"aria-label":"链路类型",value:i.traceKind,onChange:B=>i.setTraceKind(B.target.value),children:[c.jsx("option",{value:"",children:"链路类型:全部"}),["exec","file","call","tool","message","reasoning","plan","agent-start","agent-done"].map(B=>c.jsx("option",{value:B,children:B==="exec"?"命令":B==="file"?"文件":B==="call"?"调用":B==="tool"?"工具":B==="message"?"消息":B==="reasoning"?"思考":B==="plan"?"计划":"子代理"},B))]}),c.jsx("button",{onClick:i.downloadTrace,children:"下载完整链路"}),c.jsx("span",{className:"muted",children:i.traceMsg})]}),i.traceNote?c.jsx("div",{children:c.jsx("span",{className:"err",children:i.traceNote})}):null,b!==null&&b>0?c.jsxs("div",{className:"muted",children:["此前有 ",b," 条继续消息发生在持久化之前,未入库,上面历史不完整;部署后新发的继续消息会正常显示。"]}):null,i.chatHistory&&i.chatHistory.trace_note?c.jsx("div",{className:"muted",children:i.chatHistory.trace_note}):null,c.jsx(dg,{messages:m,empty:"(暂无会话消息)"}),c.jsx(mg,{disabled:!N,placeholder:"消息",onSend:B=>void i.sendChatMessage(B)}),c.jsxs("div",{className:"muted",children:[C,"。",i.chatMsg]}),c.jsx("div",{className:"muted",children:"对话时间线:首条是本任务 prompt(用户);助手回复、命令/文件/工具/调用、计划/思考/子代理开始结束都在同一列里,不再另起一份链路名单。流式进行中时新条目实时追加;你在底部时自动跟随,往上翻时暂停跟随,点“回到最新”恢复。"})]})}function vg(){return Ht().currentTask?c.jsx("div",{className:"conversation",children:c.jsx(hg,{})}):c.jsx("div",{className:"conversation",children:c.jsx("div",{className:"muted",children:"在任务列表里点一条任务,对话和详情就切到该任务;也可以在上面派发一个新任务。"})})}function yg(){const i=Ht(),r=i.currentTask,[m,o]=h.useState("");if(!r)return null;const _=uu.includes(r.status),N=["failed","interrupted","merge-failed"].includes(r.status);return c.jsxs(c.Fragment,{children:[c.jsxs(Ut,{children:[c.jsx("button",{disabled:!N,title:N?"":"仅 failed/interrupted/merge-failed 可重试",onClick:()=>i.doAction("retry"),children:"重试"}),c.jsx("button",{className:"danger",disabled:_,title:_?"终态任务不可取消":"",onClick:()=>i.doAction("cancel"),children:"取消"}),c.jsx("button",{disabled:r.status!=="completed",title:r.status!=="completed"?"仅 completed 可合并":"",onClick:()=>i.doAction("merge"),children:"合并(completed → merged)"}),c.jsx("button",{disabled:r.status!=="merged",title:r.status!=="merged"?"仅 merged 可提 PR":"",onClick:()=>i.doAction("pr"),children:"提 PR(须Line truncated
<style rel="stylesheet" crossorigin>:root{--text:#1f2328;--muted:#656d76;--subtle:#6e7781;--line:#d0d7de;--line-muted:#d8dee4;--paper:#ffffff;--card:#ffffff;--subtle-bg:#f6f8fa;--inset-bg:#f6f8fa;--accent:#0969da;--accent-emphasis:#0969da;--green:#2da44e;--green-hover:#2c974b;--success:#1a7f37;--danger:#d1242f;--danger-bg:#ffebe9;--attention:#9a6700;--done:#8250df;--selected-bg:#ddf4ff;--radius:6px;--shadow:0 1px 0 rgba(27,31,36,.04);--sans:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans",Helvetica,Arial,sans-serif;--mono:ui-monospace,SFMono-Regular,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;--ctl:32px}*{box-sizing:border-box}html,body,#root{height:100%}body{font-family:var(--sans);margin:0;color:var(--text);background:#fff;line-height:1.5;font-size:14px}a{color:var(--accent);text-underline-offset:3px}:focus-visible{outline:2px solid var(--accent);outline-offset:2px}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}.muted{color:var(--muted);font-size:12px;line-height:1.5}.err{color:var(--danger)}.ok{color:var(--success)}button{cursor:pointer;font-weight:500;border-radius:var(--radius);border:1px solid var(--line);background:#fff;color:var(--text);box-shadow:var(--shadow)}button:hover{background:var(--subtle-bg)}button:disabled{opacity:.45;cursor:not-allowed;box-shadow:none}button.primary,button.seal{background:var(--green);border-color:#1b1f2426;color:#fff}button.primary:hover,button.seal:hover{background:var(--green-hover)}button.danger{color:var(--danger);border-color:var(--line);background:#fff}button.danger:hover{background:var(--danger-bg);color:var(--danger)}.icon-btn{width:32px;height:32px;padding:0;display:grid;place-items:center;border:1px solid var(--line);border-radius:var(--radius);background:#fff;color:var(--text);font-size:16px;line-height:1}.icon-btn:hover{background:var(--subtle-bg)}.dash-topbar{position:sticky;top:0;z-index:10;background:#24292f;color:#fff;border-bottom:1px solid rgba(255,255,255,.15);padding:10px 20px 8px}.dash-topbar .muted{color:#ffffffbf}.dash-topbar-row{display:flex;gap:14px;align-items:center;flex-wrap:wrap}.dash-brand{font-weight:600;font-size:16px;color:#fff}.dash-status{font-size:13px;font-weight:600;color:#ffffffbf}.dash-status.ok{color:#2da44e}.dash-stamp{margin-left:auto}.dash-nav{display:flex;gap:4px;flex-wrap:wrap;margin-top:8px}.dash-nav a{color:#fff;text-decoration:none;font-size:13px;font-weight:600;padding:6px 12px;border-radius:var(--radius)}.dash-nav a:hover{background:#ffffff1f;text-decoration:none}.tab-nav button{background:transparent;border:0;box-shadow:none;color:#fff;font-size:13px;font-weight:600;padding:6px 12px;border-radius:var(--radius)}.tab-nav button:hover{background:#ffffff1f}.tab-nav button.active{background:#ffffff2e}.dash-page-tabs{display:flex}.dash-page-tabs>.tab-content{grid-column:1 / -1;min-width:0;display:flex;flex-direction:column;gap:20px}.tab-workbench{display:grid;grid-template-columns:320px minmax(0,1fr);gap:20px;align-items:start}.tab-workbench>*{min-width:0}@media(max-width:899px){.tab-workbench{grid-template-columns:1fr}.tab-workbench #sec-dispatch{order:1}.tab-workbench #sec-tasks{order:2}.tab-workbench #sec-conv{order:3}}.dash-page{max-width:1180px;margin:0 auto;padding:20px;display:flex;flex-direction:column;gap:20px}.dash-page>*{min-width:0}.dash-section>*{min-width:0}.dash-section{scroll-margin-top:130px;display:flex;flex-direction:column;gap:16px}.dash-section.card{padding:16px}.dash-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.dash-card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:16px;min-width:0}.dash-card-label{color:var(--muted);font-size:12px;font-weight:600}.dash-card-value{font-size:24px;font-weight:600;line-height:1.3;overflow-wrap:anywhere}.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);box-shadow:none;padding:16px}.card h2{font-size:14px;margin:0 0 12px;font-weight:600}.card h3{font-size:14px;margin:24px 0 12px;padding-top:16px;border-top:1px solid var(--line);font-weight:600}.card h3:first-of-type{border-top:0;padding-top:0}.composer h2{font-size:16px}.composer textarea.prompt{min-height:148px;font-size:14px;padding:12px;border-radius:var(--radius)}.composer textarea.coord{font-family:var(--mono);font-size:13px}.bar{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:12px 0}.bar>button,.bar>label{display:inline-flex;align-items:center;height:var(--ctl);min-height:var(--ctl);padding:0 16px;box-sizing:border-box;white-space:nowrap}.bar>input,.bar>select{height:var(--ctl);min-height:var(--ctl)}input,select,textarea,button{font:inherit;font-size:14px;padding:5px 12px;border-radius:var(--radius);border:1px solid var(--line);background:#fff;color:var(--text)}input:focus,select:focus,textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px #0969da4d}select{-moz-appearance:none;appearance:none;-webkit-appearance:none;cursLine truncated
</head>
<body>
<div id="root"></div>