deepfish-ai 2.0.3 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -98,37 +98,42 @@ var AgentRoomWebClient = class {
98
98
  //#region src/serve/ui/App.tsx
99
99
  var _tmpl$ = [
100
100
  "<div",
101
- " class=\"table-wrap\"><table class=\"sessions\"><thead><tr><th>ID</th><th>Name</th><th>Workspace</th><th>Status</th><th>Created</th><th>Updated</th><th class=\"th-actions\">Actions</th></tr></thead><tbody>",
101
+ " class=\"table-wrap\"><table class=\"sessions\"><thead><tr><th>Workspace</th><th>Name</th><th>Status</th><th>Created</th><th>Updated</th><th class=\"th-actions\">Actions</th></tr></thead><tbody>",
102
102
  "</tbody></table></div>"
103
103
  ], _tmpl$2 = [
104
104
  "<div",
105
- " class=\"modal-backdrop\"><div class=\"modal\" role=\"dialog\" aria-modal=\"true\" aria-label=\"确认删除\"><div class=\"modal-body\">",
106
- "</div><div class=\"modal-actions\"><button type=\"button\" class=\"btn btn-cancel\">取消</button><button type=\"button\" class=\"btn btn-confirm\"",
105
+ " class=\"modal-backdrop\"><div class=\"modal\" role=\"dialog\" aria-modal=\"true\" aria-label=\"Confirm deletion\"><div class=\"modal-body\">",
106
+ "</div><div class=\"modal-actions\"><button type=\"button\" class=\"btn btn-cancel\">Cancel</button><button type=\"button\" class=\"btn btn-confirm\"",
107
107
  ">",
108
108
  "</button></div></div></div>"
109
109
  ], _tmpl$3 = [
110
110
  "<div",
111
- " class=\"app-shell\"><header class=\"app-header\"><div><h1 class=\"app-title\">DeepFish Sessions</h1><p class=\"app-subtitle\">// agent-room · realtime</p></div><div class=\"status-pill\"",
111
+ " class=\"modal-backdrop\"><div class=\"modal\" role=\"dialog\" aria-modal=\"true\" aria-label=\"Session ID\"><h3 class=\"modal-title\">Session ID</h3><div class=\"modal-id\">",
112
+ "</div><div class=\"modal-actions\"><button type=\"button\" class=\"btn btn-confirm\">Close</button></div></div></div>"
113
+ ], _tmpl$4 = [
114
+ "<div",
115
+ " class=\"app-shell\"><header class=\"app-header\"><div><h1 class=\"app-title\">DeepFish Sessions</h1><p class=\"app-subtitle\"></p></div><div class=\"status-pill\"",
112
116
  "><span class=\"",
113
117
  "\"></span><!--$-->",
114
118
  "<!--/--></div></header><section class=\"panel\"><div class=\"panel-header\"><h2 class=\"panel-title\">Active Sessions<span class=\"badge\">",
115
119
  "</span></h2></div><!--$-->",
116
120
  "<!--/--></section><!--$-->",
121
+ "<!--/--><!--$-->",
117
122
  "<!--/--></div>"
118
- ], _tmpl$4 = [
123
+ ], _tmpl$5 = [
119
124
  "<div",
120
125
  " class=\"empty-state\"><div class=\"icon\">◇</div><div>",
121
126
  "</div></div>"
122
- ], _tmpl$5 = [
127
+ ], _tmpl$6 = [
123
128
  "<tr",
124
- "><td class=\"cell-mono\">",
129
+ "><td class=\"cell-mono cell-workspace\"",
130
+ ">",
125
131
  "</td><td class=\"cell-name\">",
126
- "</td><td class=\"cell-mono\">",
127
132
  "</td><td><span class=\"",
128
133
  "\">",
129
134
  "</span></td><td class=\"cell-time\">",
130
135
  "</td><td class=\"cell-time\">",
131
- "</td><td class=\"cell-actions\"><button type=\"button\" class=\"btn-delete\"",
136
+ "</td><td class=\"cell-actions\"><button type=\"button\" class=\"btn btn-id\">Show ID</button><button type=\"button\" class=\"btn btn-delete\"",
132
137
  ">",
133
138
  "</button></td></tr>"
134
139
  ];
@@ -150,7 +155,7 @@ var STATUS_PILL_TEXT = {
150
155
  disconnected: "DISCONNECTED",
151
156
  error: "ERROR"
152
157
  };
153
- /** ISO 时间格式化为本地字符串(兼容 invalid)。 */
158
+ /** Format an ISO timestamp as a local string, while tolerating invalid values. */
154
159
  function formatTime(value) {
155
160
  if (!value) return "-";
156
161
  const d = new Date(value);
@@ -165,6 +170,7 @@ function App() {
165
170
  const [confirmingId, setConfirmingId] = createSignal("");
166
171
  const [showConfirm, setShowConfirm] = createSignal(false);
167
172
  const [confirmMessage, setConfirmMessage] = createSignal("");
173
+ const [visibleId, setVisibleId] = createSignal("");
168
174
  let client = null;
169
175
  onMount(() => {
170
176
  if (typeof window === "undefined") return;
@@ -191,19 +197,19 @@ function App() {
191
197
  });
192
198
  });
193
199
  onCleanup(() => client?.disconnect());
194
- return ssr(_tmpl$3, ssrHydrationKey(), ssrAttribute("title", escape(errorMsg(), true), false), `status-dot ${escape(STATUS_DOT_CLASS[status()], true)}`, escape(STATUS_PILL_TEXT[status()]), escape(sessions().length), escape(createComponent(Show, {
200
+ return ssr(_tmpl$4, ssrHydrationKey(), ssrAttribute("title", escape(errorMsg(), true), false), `status-dot ${escape(STATUS_DOT_CLASS[status()], true)}`, escape(STATUS_PILL_TEXT[status()]), escape(sessions().length), escape(createComponent(Show, {
195
201
  get when() {
196
202
  return sessions().length > 0;
197
203
  },
198
204
  get fallback() {
199
- return ssr(_tmpl$4, ssrHydrationKey(), status() === "connected" ? "No active sessions" : status() === "ssr" ? "Hydrating…" : "Waiting for data…");
205
+ return ssr(_tmpl$5, ssrHydrationKey(), status() === "connected" ? "No active sessions" : status() === "ssr" ? "Hydrating…" : "Waiting for data…");
200
206
  },
201
207
  get children() {
202
208
  return ssr(_tmpl$, ssrHydrationKey(), escape(createComponent(For, {
203
209
  get each() {
204
210
  return sessions();
205
211
  },
206
- children: (s) => ssr(_tmpl$5, ssrHydrationKey(), escape(s.id), escape(s.name), escape(s.workspace), `status-tag ${s.status === 1 ? "is-online" : "is-offline"}`, escape(STATUS_LABEL[s.status ?? 0]), escape(formatTime(s.createdAt)), escape(formatTime(s.updatedAt)), ssrAttribute("disabled", deletingId() === s.id, true), deletingId() === s.id ? "Deleting..." : "Delete")
212
+ children: (s) => ssr(_tmpl$6, ssrHydrationKey(), ssrAttribute("title", escape(s.workspace, true), false), escape(s.workspace), escape(s.name), `status-tag ${s.status === 1 ? "is-online" : "is-offline"}`, escape(STATUS_LABEL[s.status ?? 0]), escape(formatTime(s.createdAt)), escape(formatTime(s.updatedAt)), ssrAttribute("disabled", deletingId() === s.id, true), deletingId() === s.id ? "Deleting..." : "Delete")
207
213
  })));
208
214
  }
209
215
  })), escape(createComponent(Show, {
@@ -211,7 +217,14 @@ function App() {
211
217
  return showConfirm();
212
218
  },
213
219
  get children() {
214
- return ssr(_tmpl$2, ssrHydrationKey(), escape(confirmMessage()), ssrAttribute("disabled", deletingId() === confirmingId(), true), deletingId() === confirmingId() ? "Deleting..." : "确认删除");
220
+ return ssr(_tmpl$2, ssrHydrationKey(), escape(confirmMessage()), ssrAttribute("disabled", deletingId() === confirmingId(), true), deletingId() === confirmingId() ? "Deleting..." : "Confirm Delete");
221
+ }
222
+ })), escape(createComponent(Show, {
223
+ get when() {
224
+ return visibleId();
225
+ },
226
+ get children() {
227
+ return ssr(_tmpl$3, ssrHydrationKey(), escape(visibleId()));
215
228
  }
216
229
  })));
217
230
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepfish-ai",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "private": false,
5
5
  "description": "An efficient AI-driven command-line tool designed to bridge the gap between natural language and operating system commands, file operations, and more. It enables non-developers to quickly generate executable instructions through simple natural language descriptions, significantly improving terminal operation efficiency.",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- (function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return t(this.context.count)},getNextContextId(){return t(this.context.count++)}};function t(t){let n=String(t),r=n.length-1;return e.context.id+(r?String.fromCharCode(96+r):``)+n}function n(t){e.context=t}function r(){return{...e.context,id:e.getNextContextId(),count:0}}var i=(e,t)=>e===t,a=Symbol(`solid-track`),o={equals:i},s=null,c=oe,l=1,u=2,d={owned:null,cleanups:null,context:null,owner:null},f=null,p=null,m=null,h=null,g=null,_=null,v=null,y=0;function b(e,t){let n=g,r=f,i=e.length===0,a=t===void 0?r:t,o=i?d:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>w(()=>L(o)));f=o,g=null;try{return P(s,!0)}finally{g=n,f=r}}function x(e,t){t=t?Object.assign({},o,t):o;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[O.bind(n),e=>(typeof e==`function`&&(e=p&&p.running&&p.sources.has(n)?e(n.tValue):e(n.value)),k(n,e))]}function S(e,t,n){let r=M(e,t,!1,l);m&&p&&p.running?_.push(r):A(r)}function ee(e,t,n){c=ce;let r=M(e,t,!1,l),i=D&&ie(D);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),v?v.push(r):A(r)}function C(e,t,n){n=n?Object.assign({},o,n):o;let r=M(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,m&&p&&p.running?(r.tState=l,_.push(r)):A(r),O.bind(r)}function w(e){if(!h&&g===null)return e();let t=g;g=null;try{return h?h.untrack(e):e()}finally{g=t}}function te(e){ee(()=>w(e))}function T(e){return f===null||(f.cleanups===null?f.cleanups=[e]:f.cleanups.push(e)),e}function ne(e){if(p&&p.running)return e(),p.done;let t=g,n=f;return Promise.resolve().then(()=>{g=t,f=n;let r;return(m||D)&&(r=p||={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0},r.done||=new Promise(e=>r.resolve=e),r.running=!0),P(e,!1),g=f=null,r?r.done:void 0})}var[re,E]=x(!1);function ie(e){let t;return f&&f.context&&(t=f.context[e.id])!==void 0?t:e.defaultValue}var D;function O(){let e=p&&p.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===l)A(this);else{let e=_;_=null,P(()=>F(this),!1),_=e}if(g){let e=this.observers;if(!e||e[e.length-1]!==g){let t=e?e.length:0;g.sources?(g.sources.push(this),g.sourceSlots.push(t)):(g.sources=[this],g.sourceSlots=[t]),e?(e.push(g),this.observerSlots.push(g.sources.length-1)):(this.observers=[g],this.observerSlots=[g.sources.length-1])}}return e&&p.sources.has(this)?this.tValue:this.value}function k(e,t,n){let r=p&&p.running&&p.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(p){let r=p.running;(r||!n&&p.sources.has(e))&&(p.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&P(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=p&&p.running;r&&p.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?_.push(n):v.push(n),n.observers&&I(n)),r?n.tState=l:n.state=l)}if(_.length>1e6)throw _=[],Error()},!1)}return t}function A(e){if(!e.fn)return;L(e);let t=y;j(e,p&&p.running&&p.sources.has(e)?e.tValue:e.value,t),p&&!p.running&&p.sources.has(e)&&queueMicrotask(()=>{P(()=>{p&&(p.running=!0),g=f=e,j(e,e.tValue,t),g=f=null},!1)})}function j(e,t,n){let r,i=f,a=g;g=f=e;try{r=e.fn(t)}catch(t){return e.pure&&(p&&p.running?(e.tState=l,e.tOwned&&e.tOwned.forEach(L),e.tOwned=void 0):(e.state=l,e.owned&&e.owned.forEach(L),e.owned=null)),e.updatedAt=n+1,B(t)}finally{g=a,f=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?k(e,r,!0):p&&p.running&&e.pure?(p.sources.has(e)||(e.value=r),p.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function M(e,t,n,r=l,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:f,context:f?f.context:null,pure:n};if(p&&p.running&&(a.state=0,a.tState=r),f===null||f!==d&&(p&&p.running&&f.pure?f.tOwned?f.tOwned.push(a):f.tOwned=[a]:f.owned?f.owned.push(a):f.owned=[a]),h&&a.fn){let e=a.fn,[t,n]=x(void 0,{equals:!1}),r=h.factory(e,n);T(()=>r.dispose());let i,o=()=>ne(n).then(()=>{i&&=(i.dispose(),void 0)});a.fn=n=>(t(),p&&p.running?(i||=h.factory(e,o),i.track(n)):r.track(n))}return a}function N(e){let t=p&&p.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===u)return F(e);if(e.suspense&&w(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<y);){if(t&&p.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(p.disposed.has(t))return}if((t?e.tState:e.state)===l)A(e);else if((t?e.tState:e.state)===u){let t=_;_=null,P(()=>F(e,n[0]),!1),_=t}}}function P(e,t){if(_)return e();let n=!1;t||(_=[]),v?n=!0:v=[],y++;try{let t=e();return ae(n),t}catch(e){n||(v=null),_=null,B(e)}}function ae(e){if(_&&=(m&&p&&p.running?se(_):oe(_),null),e)return;let t;if(p){if(!p.promises.size&&!p.queue.size){let e=p.sources,n=p.disposed;v.push.apply(v,p.effects),t=p.resolve;for(let e of v)`tState`in e&&(e.state=e.tState),delete e.tState;p=null,P(()=>{for(let e of n)L(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)L(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}E(!1)},!1)}else if(p.running){p.running=!1,p.effects.push.apply(p.effects,v),v=null,E(!0);return}}let n=v;v=null,n.length&&P(()=>c(n),!1),t&&t()}function oe(e){for(let t=0;t<e.length;t++)N(e[t])}function se(e){for(let t=0;t<e.length;t++){let n=e[t],r=p.queue;r.has(n)||(r.add(n),m(()=>{r.delete(n),P(()=>{p.running=!0,N(n)},!1),p&&(p.running=!1)}))}}function ce(t){let r,i=0;for(r=0;r<t.length;r++){let e=t[r];e.user?t[i++]=e:N(e)}if(e.context){if(e.count){e.effects||=[],e.effects.push(...t.slice(0,i));return}n()}for(e.effects&&(e.done||!e.count)&&(t=[...e.effects,...t],i+=e.effects.length,delete e.effects),r=0;r<i;r++)N(t[r])}function F(e,t){let n=p&&p.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===l?i!==t&&(!i.updatedAt||i.updatedAt<y)&&N(i):e===u&&F(i,t)}}}function I(e){let t=p&&p.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=u:r.state=u,r.pure?_.push(r):v.push(r),r.observers&&I(r))}}function L(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)L(e.tOwned[t]);delete e.tOwned}if(p&&p.running&&e.pure)R(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)L(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}p&&p.running?e.tState=0:e.state=0}function R(e,t){if(t||(e.tState=0,p.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)R(e.owned[t])}function le(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function z(e,t,n){try{for(let n of t)n(e)}catch(e){B(e,n&&n.owner||null)}}function B(e,t=f){let n=s&&t&&t.context&&t.context[s],r=le(e);if(!n)throw r;v?v.push({fn(){z(r,n,t)},state:l}):z(r,n,t)}var ue=Symbol(`fallback`);function V(e){for(let t=0;t<e.length;t++)e[t]()}function de(e,t,n={}){let r=[],i=[],o=[],s=0,c=t.length>1?[]:null;return T(()=>V(o)),()=>{let l=e()||[],u=l.length,d,f;return l[a],w(()=>{let e,t,a,m,h,g,_,v,y;if(u===0)s!==0&&(V(o),o=[],r=[],i=[],s=0,c&&=[]),n.fallback&&(r=[ue],i[0]=b(e=>(o[0]=e,n.fallback())),s=1);else if(s===0){for(i=Array(u),f=0;f<u;f++)r[f]=l[f],i[f]=b(p);s=u}else{for(a=Array(u),m=Array(u),c&&(h=Array(u)),g=0,_=Math.min(s,u);g<_&&r[g]===l[g];g++);for(_=s-1,v=u-1;_>=g&&v>=g&&r[_]===l[v];_--,v--)a[v]=i[_],m[v]=o[_],c&&(h[v]=c[_]);for(e=new Map,t=Array(v+1),f=v;f>=g;f--)y=l[f],d=e.get(y),t[f]=d===void 0?-1:d,e.set(y,f);for(d=g;d<=_;d++)y=r[d],f=e.get(y),f!==void 0&&f!==-1?(a[f]=i[d],m[f]=o[d],c&&(h[f]=c[d]),f=t[f],e.set(y,f)):o[d]();for(f=g;f<u;f++)f in a?(i[f]=a[f],o[f]=m[f],c&&(c[f]=h[f],c[f](f))):i[f]=b(p);i=i.slice(0,s=u),r=l.slice(0)}return i});function p(e){if(o[f]=e,c){let[e,n]=x(f);return c[f]=n,t(l[f],e)}return t(l[f])}}}var fe=!1;function H(t,i){if(fe&&e.context){let a=e.context;n(r());let o=w(()=>t(i||{}));return n(a),o}return w(()=>t(i||{}))}var pe=e=>`Stale read from <${e}>.`;function me(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return C(de(()=>e.each,e.children,t||void 0))}function U(e){let t=e.keyed,n=C(()=>e.when,void 0,void 0),r=t?n:C(n,void 0,{equals:(e,t)=>!e==!t});return C(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?w(()=>a(t?i:()=>{if(!w(r))throw pe(`Show`);return n()})):a}return e.fallback},void 0,void 0)}var he=e=>C(()=>e());function ge(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null)if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&!((d=l.get(t[c]))==null||d!==r+u);)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}var W=`_$DX_DELEGATE`;function _e(e,t,n,r={}){let i;return b(r=>{i=r,t===document?e():q(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function G(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>w(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function ve(e,t=window.document){let n=t[W]||(t[W]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,be))}}function ye(e,t,n){J(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function K(e,t){J(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function q(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return Y(e,t,r,n);S(r=>Y(e,t(),r,n),r)}function J(t){return!!e.context&&!e.done&&(!t||t.isConnected)}function be(t){if(e.registry&&e.events&&e.events.find(([e,n])=>n===t))return;let n=t.target,r=`$$${t.type}`,i=t.target,a=t.currentTarget,o=e=>Object.defineProperty(t,"target",{configurable:!0,value:e}),s=()=>{let e=n[r];if(e&&!n.disabled){let i=n[`${r}Data`];if(i===void 0?e.call(n,t):e.call(n,i,t),t.cancelBubble)return}return n.host&&typeof n.host!=`string`&&!n.host._$host&&n.contains(t.target)&&o(n.host),!0},c=()=>{for(;s()&&(n=n._$host||n.parentNode||n.host););};if(Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return n||document}}),e.registry&&!e.done&&(e.done=_$HY.done=!0),t.composedPath){let e=t.composedPath();o(e[0]);for(let t=0;t<e.length-2&&(n=e[t],s());t++){if(n._$host){n=n._$host,c();break}if(n.parentNode===a)break}}else c();o(i)}function Y(e,t,n,r,i){let a=J(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=Z(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=Z(e,n,r)}else if(o===`function`)return S(()=>{let i=t();for(;typeof i==`function`;)i=i();n=Y(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(X(o,t,n,i))return S(()=>n=Y(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=Z(e,n,r),s)return n}else c?n.length===0?xe(e,o,r):ge(e,n,o):(n&&Z(e),xe(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=Z(e,n,r,t);Z(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function X(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(!(o==null||o===!0||o===!1))if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=X(e,o,s)||i;else if(c===`function`)if(r){for(;typeof o==`function`;)o=o();i=X(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0;else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}return i}function xe(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Z(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}var Se=class{url;id=null;ws=null;opts;reconnectTimer=null;reconnecting=!1;constructor(e){this.opts=e,this.url=e.url||`ws://localhost:8866/agent-room`,this.id=e.id??null,this.connect()}connect(){this.ws||(this.ws=new WebSocket(this.url),this.ws.onopen=()=>{let e={type:`register`,clientType:`web`};this.id&&(e.id=this.id),this.ws.send(JSON.stringify(e))},this.ws.onmessage=e=>{let t=JSON.parse(e.data);if(t.type===`registered`){this.id=t.id,this.opts.onReady?.(this);return}if(t.type===`sessions-push`){let e=t.payload??[];this.opts.onSessionsPush?.(this,e);return}if(t.type===`error`){this.opts.onError?.(this,t.code||``,t.message||``);return}this.opts.onMessage?.(this,t)},this.ws.onclose=e=>{this.opts.onClose?.(this,e.code,e.reason),this.ws=null,this.tryReconnect()},this.ws.onerror=()=>{})}send(e,t,n){!this.ws||this.ws.readyState!==WebSocket.OPEN||this.ws.send(JSON.stringify({type:e,payload:t,to:n}))}reply(e,t){e.from&&this.send(e.type+`-result`,t,e.from)}disconnect(){this.clearReconnect(),this.reconnecting=!1,this.ws&&=(this.ws.close(1e3,`client disconnect`),null)}get connected(){return this.ws?.readyState===WebSocket.OPEN}clearReconnect(){this.reconnectTimer&&=(clearTimeout(this.reconnectTimer),null)}tryReconnect(){let e=this.opts.reconnectInterval??3e3;e<=0||this.reconnecting||(this.reconnecting=!0,this.reconnectTimer=setTimeout(()=>{this.reconnecting=!1,this.connect()},e))}},Ce=G(`<div class=table-wrap><table class=sessions><thead><tr><th>ID</th><th>Name</th><th>Workspace</th><th>Status</th><th>Created</th><th>Updated</th><th class=th-actions>Actions</th></tr></thead><tbody>`),we=G(`<div class=modal-backdrop><div class=modal role=dialog aria-modal=true aria-label=确认删除><div class=modal-body></div><div class=modal-actions><button type=button class="btn btn-cancel">取消</button><button type=button class="btn btn-confirm">`),Te=G(`<div class=app-shell><header class=app-header><div><h1 class=app-title>DeepFish Sessions</h1><p class=app-subtitle>// agent-room · realtime</p></div><div class=status-pill><span></span></div></header><section class=panel><div class=panel-header><h2 class=panel-title>Active Sessions<span class=badge>`),Ee=G(`<div class=empty-state><div class=icon>◇</div><div>`),De=G(`<tr><td class=cell-mono></td><td class=cell-name></td><td class=cell-mono></td><td><span></span></td><td class=cell-time></td><td class=cell-time></td><td class=cell-actions><button type=button class=btn-delete>`),Oe={0:`Idle`,1:`Working`},ke={connecting:`is-connecting`,connected:`is-connected`,disconnected:`is-disconnected`,error:`is-error`,ssr:`is-disconnected`},Ae={ssr:`LOADING`,connecting:`CONNECTING`,connected:`CONNECTED`,disconnected:`DISCONNECTED`,error:`ERROR`};function Q(e){if(!e)return`-`;let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function je(){let[e,t]=x([]),[n,r]=x(`ssr`),[i,a]=x(``),[o,s]=x(``),[c,l]=x(``),[u,d]=x(!1),[f,p]=x(``),m=null;te(()=>{typeof window>`u`||(r(`connecting`),m=new Se({url:`ws://${window.location.host}/agent-room`,onReady:()=>{r(`connected`),a(``)},onSessionsPush:(e,n)=>{t(n??[]),s(``)},onError:(e,t,n)=>{r(`error`),a(n),s(``)},onClose:()=>{r(`disconnected`),s(``)}}))});let h=e=>{l(e),p(`Are you sure you want to delete session "${e}"? This action cannot be undone.`),d(!0)},g=()=>{let e=c();if(!m||!e){d(!1);return}s(e),d(!1),m.send(`delete-session`,{id:e})},_=()=>{l(``),d(!1)};return T(()=>m?.disconnect()),(()=>{var t=Te(),r=t.firstChild,a=r.firstChild.nextSibling,s=a.firstChild,l=r.nextSibling,d=l.firstChild.firstChild.firstChild.nextSibling;return q(a,()=>Ae[n()],null),q(d,()=>e().length),q(l,H(U,{get when(){return e().length>0},get fallback(){return(()=>{var e=Ee(),t=e.firstChild.nextSibling;return q(t,(()=>{var e=he(()=>n()===`connected`);return()=>e()?`No active sessions`:n()===`ssr`?`Hydrating…`:`Waiting for data…`})()),e})()},get children(){var t=Ce(),n=t.firstChild.firstChild.nextSibling;return q(n,H(me,{get each(){return e()},children:e=>(()=>{var t=De(),n=t.firstChild,r=n.nextSibling,i=r.nextSibling,a=i.nextSibling,s=a.firstChild,c=a.nextSibling,l=c.nextSibling,u=l.nextSibling.firstChild;return q(n,()=>e.id),q(r,()=>e.name),q(i,()=>e.workspace),q(s,()=>Oe[e.status??0]),q(c,()=>Q(e.createdAt)),q(l,()=>Q(e.updatedAt)),u.$$click=()=>h(e.id),q(u,()=>o()===e.id?`Deleting...`:`Delete`),S(t=>{var n=`status-tag ${e.status===1?`is-online`:`is-offline`}`,r=o()===e.id;return n!==t.e&&K(s,t.e=n),r!==t.t&&(u.disabled=t.t=r),t},{e:void 0,t:void 0}),t})()})),t}}),null),q(t,H(U,{get when(){return u()},get children(){var e=we(),t=e.firstChild.firstChild,n=t.nextSibling.firstChild,r=n.nextSibling;return q(t,f),n.$$click=_,r.$$click=g,q(r,()=>o()===c()?`Deleting...`:`确认删除`),S(()=>r.disabled=o()===c()),e}}),null),S(e=>{var t=i(),r=`status-dot ${ke[n()]}`;return t!==e.e&&ye(a,`title`,e.e=t),r!==e.t&&K(s,e.t=r),e},{e:void 0,t:void 0}),t})()}ve([`click`]);var $=document.getElementById(`app`);$&&($.innerHTML=``),_e(()=>H(je,{}),$);
@@ -1 +0,0 @@
1
- *,:before,:after{box-sizing:border-box}html,body{min-height:100%;margin:0;padding:0}body{color:#2c3e50;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;letter-spacing:.01em;background:#f5f7fa;min-height:100vh;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,sans-serif}.app-shell{max-width:1400px;margin:0 auto;padding:28px 20px 40px}.app-header{border-bottom:1px solid #ffffff0f;justify-content:space-between;align-items:flex-end;gap:24px;margin-bottom:24px;padding-bottom:18px;display:flex}.app-title{letter-spacing:.02em;color:#2c3e50;margin:0;font-size:1.4rem;font-weight:600}.app-subtitle{color:#6b7280;letter-spacing:.06em;margin:6px 0 0;font-family:SF Mono,JetBrains Mono,Consolas,monospace;font-size:.82rem}.status-pill{color:#6b7280;background:#f3f6fb;border:1px solid #e6e6e6;border-radius:999px;align-items:center;gap:8px;padding:6px 12px;font-family:SF Mono,JetBrains Mono,Consolas,monospace;font-size:.78rem;display:inline-flex}.status-dot{background:#94a3b8;border-radius:50%;width:8px;height:8px}.status-dot.is-connected{background:#38bdf8}.status-dot.is-connecting{background:#f59e0b}.status-dot.is-disconnected{background:#cbd5e1}.status-dot.is-error{background:#ef4444}@keyframes pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.55;transform:scale(.85)}}.panel{background:#fff;border:1px solid #e6e6e6;border-radius:10px;position:relative;overflow:hidden;box-shadow:0 6px 18px #1e293b0f}.panel:before{display:none}.panel-header{border-bottom:1px solid #f0f2f5;justify-content:space-between;align-items:center;padding:14px 18px;display:flex}.panel-title{color:#2c3e50;letter-spacing:.02em;align-items:center;gap:10px;margin:0;font-size:.95rem;font-weight:600;display:flex}.panel-title .badge{color:#3b82f6;background:#eef2ff;border:1px solid #3b82f61f;border-radius:6px;padding:2px 8px;font-family:SF Mono,JetBrains Mono,Consolas,monospace;font-size:.72rem;font-weight:500}.table-wrap{width:100%;overflow-x:visible}table.sessions{border-collapse:separate;border-spacing:0;width:100%;font-size:.88rem}table.sessions thead th{text-align:center;color:#6b7280;background:0 0;border-bottom:1px solid #f0f2f5;padding:12px 18px;font-size:.8rem;font-weight:600}table.sessions tbody td{color:#2c3e50;vertical-align:middle;white-space:normal;border-bottom:1px solid #f0f2f5;padding:14px 18px}table.sessions tbody tr{transition:background .16s}table.sessions tbody tr:hover{background:#fbfbfd}table.sessions tbody tr:last-child td{border-bottom:none}table.sessions .th-actions,table.sessions .cell-actions{text-align:center;white-space:nowrap}.btn-delete{color:#ef4444;letter-spacing:.02em;cursor:pointer;background:0 0;border:1px solid #ef44441f;border-radius:6px;align-items:center;gap:6px;padding:8px 14px;font-family:SF Mono,JetBrains Mono,Consolas,monospace;font-size:.86rem;font-weight:600;transition:all .16s;display:inline-flex}.btn-delete:hover{box-shadow:none;background:#ef44440f}.btn-delete:active{transform:translateY(1px)}.btn-delete:disabled{opacity:.4;cursor:not-allowed}.cell-mono{color:#64748b;font-family:SF Mono,JetBrains Mono,Consolas,monospace;font-size:.86rem}.cell-name{color:#2c3e50;font-weight:600}.cell-time{color:#64748b;font-family:SF Mono,JetBrains Mono,Consolas,monospace;font-size:.86rem}.status-tag{letter-spacing:.04em;border-radius:999px;align-items:center;gap:6px;padding:3px 10px;font-family:SF Mono,JetBrains Mono,Consolas,monospace;font-size:.74rem;font-weight:500;display:inline-flex}.status-tag:before{content:"";background:currentColor;border-radius:50%;width:6px;height:6px;box-shadow:0 0 6px}.status-tag.is-online{color:#4ade80;background:#4ade8014;border:1px solid #4ade8040}.status-tag.is-offline{color:#94a3b8;background:#94a3b80f;border:1px solid #94a3b82e}.empty-state{color:#6b7280;flex-direction:column;justify-content:center;align-items:center;gap:10px;padding:60px 20px;font-size:.98rem;display:flex}.empty-state .icon{opacity:.6;font-size:1.6rem}@media (width<=720px){.app-shell{padding:24px 14px 40px}.app-header{flex-direction:column;align-items:flex-start}table.sessions thead th,table.sessions tbody td{padding:10px 12px}}.modal-backdrop{z-index:1200;background:#10182814;justify-content:center;align-items:center;padding:20px;display:flex;position:fixed;inset:0}.modal{background:#fff;border:1px solid #e6e6e6;border-radius:8px;width:100%;max-width:520px;padding:18px;box-shadow:0 8px 30px #1018280f}.modal-body{color:#2c3e50;margin-bottom:18px;font-size:.98rem}.modal-actions{justify-content:flex-end;gap:12px;display:flex}.btn{cursor:pointer;border:none;border-radius:8px;padding:8px 14px;font-weight:600}.btn:disabled{opacity:.6;cursor:not-allowed}.btn-cancel{color:#6b7280;background:0 0;border:1px solid #f0f2f5}.btn-confirm{color:#fff;background:linear-gradient(90deg,#3b82f6,#60a5fa);border:1px solid #3b82f60f;box-shadow:0 6px 18px #3b82f61f}