@hellcoder/companion 0.120.0 → 0.121.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AgentsPage-V7NBPNSh.js → AgentsPage-ClW7bWRx.js} +5 -5
- package/dist/assets/CronManager-CNRhJ7JU.js +1 -0
- package/dist/assets/{DashboardPage-N7MWZiJQ.js → DashboardPage-Ch_HQGg0.js} +1 -1
- package/dist/assets/{IntegrationsPage-DRP477b0.js → IntegrationsPage-BHj_BEVr.js} +1 -1
- package/dist/assets/{LinearOAuthSettingsPage-CPW4TQuD.js → LinearOAuthSettingsPage-B5U70sHB.js} +1 -1
- package/dist/assets/{LinearSettingsPage-BwVTEKqs.js → LinearSettingsPage-CVmZKj9l.js} +1 -1
- package/dist/assets/{MagicUIDashboard-exuRY5LQ.js → MagicUIDashboard-5nBMuLS8.js} +1 -1
- package/dist/assets/{MagicUIView-AKoy6jOb.js → MagicUIView-CdHkHIEh.js} +1 -1
- package/dist/assets/Playground-Dpfq4KMB.js +121 -0
- package/dist/assets/{PromptsPage-BYtZdliB.js → PromptsPage-BHtp_9DW.js} +1 -1
- package/dist/assets/{RunsPage-DD6KPNKm.js → RunsPage-bbhhFNkd.js} +1 -1
- package/dist/assets/{SandboxManager-C8tBjBXY.js → SandboxManager-b3xCX8cU.js} +1 -1
- package/dist/assets/{SettingsPage-77tDzDuD.js → SettingsPage-CEOoHbQk.js} +1 -1
- package/dist/assets/{TailscalePage-B0TbcOPL.js → TailscalePage-C1bGGkFU.js} +1 -1
- package/dist/assets/index-_VjPWGkx.js +141 -0
- package/dist/assets/{sw-register-Cr16zatT.js → sw-register-2ITbAS9w.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/sw.js +1 -1
- package/package.json +1 -1
- package/dist/assets/CronManager-CGfXlVZS.js +0 -1
- package/dist/assets/Playground-BiEa7THU.js +0 -121
- package/dist/assets/index-BM8QkiV8.js +0 -140
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as u}from"./index-
|
|
1
|
+
import{_ as u}from"./index-_VjPWGkx.js";function w(r={}){const{immediate:i=!1,onNeedReload:d,onNeedRefresh:_,onOfflineReady:s,onRegistered:n,onRegisteredSW:o,onRegisterError:t}=r;let a,c;const l=async(e=!0)=>{await c};async function f(){if("serviceWorker"in navigator){if(a=await u(async()=>{const{Workbox:e}=await import("./workbox-window.prod.es5-BBnX5xw4.js");return{Workbox:e}},[]).then(({Workbox:e})=>new e("/sw.js",{scope:"/",type:"classic"})).catch(e=>{t==null||t(e)}),!a)return;a.addEventListener("activated",e=>{(e.isUpdate||e.isExternal)&&(d?d():window.location.reload())}),a.addEventListener("installed",e=>{e.isUpdate||s==null||s()}),a.register({immediate:i}).then(e=>{o?o("/sw.js",e):n==null||n(e)}).catch(e=>{t==null||t(e)})}}return c=f(),l}w({onRegisteredSW(r,i){i&&setInterval(()=>{i.update()},3600*1e3)},onOfflineReady(){console.log("[SW] Offline-ready: all assets precached")}});
|
package/dist/index.html
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<meta name="apple-mobile-web-app-title" content="Companion ME" />
|
|
12
12
|
<meta name="theme-color" content="#d97757" />
|
|
13
13
|
<title>The Companion — Moritz Edition</title>
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-_VjPWGkx.js"></script>
|
|
15
15
|
<link rel="stylesheet" crossorigin href="/assets/index-CUfPwiv5.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body class="bg-cc-bg text-cc-fg">
|
package/dist/sw.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
try{self["workbox:core:7.4.0"]&&_()}catch{}const x=(a,...e)=>{let t=a;return e.length>0&&(t+=` :: ${JSON.stringify(e)}`),t},N=x;class l extends Error{constructor(e,t){const s=N(e,t);super(s),this.name=e,this.details=t}}const E=new Set,f={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:typeof registration<"u"?registration.scope:""},b=a=>[f.prefix,a,f.suffix].filter(e=>e&&e.length>0).join("-"),O=a=>{for(const e of Object.keys(f))a(e)},C={updateDetails:a=>{O(e=>{typeof a[e]=="string"&&(f[e]=a[e])})},getGoogleAnalyticsName:a=>a||b(f.googleAnalytics),getPrecacheName:a=>a||b(f.precache),getPrefix:()=>f.prefix,getRuntimeName:a=>a||b(f.runtime),getSuffix:()=>f.suffix};function P(a,e){const t=new URL(a);for(const s of e)t.searchParams.delete(s);return t.href}async function I(a,e,t,s){const n=P(e.url,t);if(e.url===n)return a.match(e,s);const r=Object.assign(Object.assign({},s),{ignoreSearch:!0}),c=await a.keys(e,r);for(const i of c){const o=P(i.url,t);if(n===o)return a.match(i,s)}}let y;function M(){if(y===void 0){const a=new Response("");if("body"in a)try{new Response(a.body),y=!0}catch{y=!1}y=!1}return y}class D{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}async function S(){for(const a of E)await a()}const W=a=>new URL(String(a),location.href).href.replace(new RegExp(`^${location.origin}`),"");function A(a){return new Promise(e=>setTimeout(e,a))}function K(a,e){const t=e();return a.waitUntil(t),t}async function q(a,e){let t=null;if(a.url&&(t=new URL(a.url).origin),t!==self.location.origin)throw new l("cross-origin-copy-response",{origin:t});const s=a.clone(),r={headers:new Headers(s.headers),status:s.status,statusText:s.statusText},c=M()?s.body:await s.blob();return new Response(c,r)}function j(){self.addEventListener("activate",()=>self.clients.claim())}try{self["workbox:precaching:7.4.0"]&&_()}catch{}const H="__WB_REVISION__";function F(a){if(!a)throw new l("add-to-cache-list-unexpected-type",{entry:a});if(typeof a=="string"){const r=new URL(a,location.href);return{cacheKey:r.href,url:r.href}}const{revision:e,url:t}=a;if(!t)throw new l("add-to-cache-list-unexpected-type",{entry:a});if(!e){const r=new URL(t,location.href);return{cacheKey:r.href,url:r.href}}const s=new URL(t,location.href),n=new URL(t,location.href);return s.searchParams.set(H,e),{cacheKey:s.href,url:n.href}}class B{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:s})=>{if(e.type==="install"&&t&&t.originalRequest&&t.originalRequest instanceof Request){const n=t.originalRequest.url;s?this.notUpdatedURLs.push(n):this.updatedURLs.push(n)}return s}}}class ${constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:t,params:s})=>{const n=(s==null?void 0:s.cacheKey)||this._precacheController.getCacheKeyForURL(t.url);return n?new Request(n,{headers:t.headers}):t},this._precacheController=e}}try{self["workbox:strategies:7.4.0"]&&_()}catch{}function m(a){return typeof a=="string"?new Request(a):a}class G{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new D,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const s of this._plugins)this._pluginStateMap.set(s,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:t}=this;let s=m(e);if(s.mode==="navigate"&&t instanceof FetchEvent&&t.preloadResponse){const c=await t.preloadResponse;if(c)return c}const n=this.hasCallback("fetchDidFail")?s.clone():null;try{for(const c of this.iterateCallbacks("requestWillFetch"))s=await c({request:s.clone(),event:t})}catch(c){if(c instanceof Error)throw new l("plugin-error-request-will-fetch",{thrownErrorMessage:c.message})}const r=s.clone();try{let c;c=await fetch(s,s.mode==="navigate"?void 0:this._strategy.fetchOptions);for(const i of this.iterateCallbacks("fetchDidSucceed"))c=await i({event:t,request:r,response:c});return c}catch(c){throw n&&await this.runCallbacks("fetchDidFail",{error:c,event:t,originalRequest:n.clone(),request:r.clone()}),c}}async fetchAndCachePut(e){const t=await this.fetch(e),s=t.clone();return this.waitUntil(this.cachePut(e,s)),t}async cacheMatch(e){const t=m(e);let s;const{cacheName:n,matchOptions:r}=this._strategy,c=await this.getCacheKey(t,"read"),i=Object.assign(Object.assign({},r),{cacheName:n});s=await caches.match(c,i);for(const o of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await o({cacheName:n,matchOptions:r,cachedResponse:s,request:c,event:this.event})||void 0;return s}async cachePut(e,t){const s=m(e);await A(0);const n=await this.getCacheKey(s,"write");if(!t)throw new l("cache-put-with-no-response",{url:W(n.url)});const r=await this._ensureResponseSafeToCache(t);if(!r)return!1;const{cacheName:c,matchOptions:i}=this._strategy,o=await self.caches.open(c),h=this.hasCallback("cacheDidUpdate"),p=h?await I(o,n.clone(),["__WB_REVISION__"],i):null;try{await o.put(n,h?r.clone():r)}catch(u){if(u instanceof Error)throw u.name==="QuotaExceededError"&&await S(),u}for(const u of this.iterateCallbacks("cacheDidUpdate"))await u({cacheName:c,oldResponse:p,newResponse:r.clone(),request:n,event:this.event});return!0}async getCacheKey(e,t){const s=`${e.url} | ${t}`;if(!this._cacheKeys[s]){let n=e;for(const r of this.iterateCallbacks("cacheKeyWillBeUsed"))n=m(await r({mode:t,request:n,event:this.event,params:this.params}));this._cacheKeys[s]=n}return this._cacheKeys[s]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const s of this.iterateCallbacks(e))await s(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if(typeof t[e]=="function"){const s=this._pluginStateMap.get(t);yield r=>{const c=Object.assign(Object.assign({},r),{state:s});return t[e](c)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){for(;this._extendLifetimePromises.length;){const e=this._extendLifetimePromises.splice(0),s=(await Promise.allSettled(e)).find(n=>n.status==="rejected");if(s)throw s.reason}}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,s=!1;for(const n of this.iterateCallbacks("cacheWillUpdate"))if(t=await n({request:this.request,response:t,event:this.event})||void 0,s=!0,!t)break;return s||t&&t.status!==200&&(t=void 0),t}}class V{constructor(e={}){this.cacheName=C.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,s=typeof e.request=="string"?new Request(e.request):e.request,n="params"in e?e.params:void 0,r=new G(this,{event:t,request:s,params:n}),c=this._getResponse(r,s,t),i=this._awaitComplete(c,r,s,t);return[c,i]}async _getResponse(e,t,s){await e.runCallbacks("handlerWillStart",{event:s,request:t});let n;try{if(n=await this._handle(t,e),!n||n.type==="error")throw new l("no-response",{url:t.url})}catch(r){if(r instanceof Error){for(const c of e.iterateCallbacks("handlerDidError"))if(n=await c({error:r,event:s,request:t}),n)break}if(!n)throw r}for(const r of e.iterateCallbacks("handlerWillRespond"))n=await r({event:s,request:t,response:n});return n}async _awaitComplete(e,t,s,n){let r,c;try{r=await e}catch{}try{await t.runCallbacks("handlerDidRespond",{event:n,request:s,response:r}),await t.doneWaiting()}catch(i){i instanceof Error&&(c=i)}if(await t.runCallbacks("handlerDidComplete",{event:n,request:s,response:r,error:c}),t.destroy(),c)throw c}}class d extends V{constructor(e={}){e.cacheName=C.getPrecacheName(e.cacheName),super(e),this._fallbackToNetwork=e.fallbackToNetwork!==!1,this.plugins.push(d.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const s=await t.cacheMatch(e);return s||(t.event&&t.event.type==="install"?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,t){let s;const n=t.params||{};if(this._fallbackToNetwork){const r=n.integrity,c=e.integrity,i=!c||c===r;s=await t.fetch(new Request(e,{integrity:e.mode!=="no-cors"?c||r:void 0})),r&&i&&e.mode!=="no-cors"&&(this._useDefaultCacheabilityPluginIfNeeded(),await t.cachePut(e,s.clone()))}else throw new l("missing-precache-entry",{cacheName:this.cacheName,url:e.url});return s}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();const s=await t.fetch(e);if(!await t.cachePut(e,s.clone()))throw new l("bad-precaching-response",{url:e.url,status:s.status});return s}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[s,n]of this.plugins.entries())n!==d.copyRedirectedCacheableResponsesPlugin&&(n===d.defaultPrecacheCacheabilityPlugin&&(e=s),n.cacheWillUpdate&&t++);t===0?this.plugins.push(d.defaultPrecacheCacheabilityPlugin):t>1&&e!==null&&this.plugins.splice(e,1)}}d.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:a}){return!a||a.status>=400?null:a}};d.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:a}){return a.redirected?await q(a):a}};class Q{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:s=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new d({cacheName:C.getPrecacheName(e),plugins:[...t,new $({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const t=[];for(const s of e){typeof s=="string"?t.push(s):s&&s.revision===void 0&&t.push(s.url);const{cacheKey:n,url:r}=F(s),c=typeof s!="string"&&s.revision?"reload":"default";if(this._urlsToCacheKeys.has(r)&&this._urlsToCacheKeys.get(r)!==n)throw new l("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(r),secondEntry:n});if(typeof s!="string"&&s.integrity){if(this._cacheKeysToIntegrities.has(n)&&this._cacheKeysToIntegrities.get(n)!==s.integrity)throw new l("add-to-cache-list-conflicting-integrities",{url:r});this._cacheKeysToIntegrities.set(n,s.integrity)}if(this._urlsToCacheKeys.set(r,n),this._urlsToCacheModes.set(r,c),t.length>0){const i=`Workbox is precaching URLs without revision info: ${t.join(", ")}
|
|
2
|
-
This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(i)}}}install(e){return K(e,async()=>{const t=new B;this.strategy.plugins.push(t);for(const[r,c]of this._urlsToCacheKeys){const i=this._cacheKeysToIntegrities.get(c),o=this._urlsToCacheModes.get(r),h=new Request(r,{integrity:i,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:c},request:h,event:e}))}const{updatedURLs:s,notUpdatedURLs:n}=t;return{updatedURLs:s,notUpdatedURLs:n}})}activate(e){return K(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),s=await t.keys(),n=new Set(this._urlsToCacheKeys.values()),r=[];for(const c of s)n.has(c.url)||(await t.delete(c),r.push(c.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,s=this.getCacheKeyForURL(t);if(s)return(await self.caches.open(this.strategy.cacheName)).match(s)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new l("non-precached-url",{url:e});return s=>(s.request=new Request(e),s.params=Object.assign({cacheKey:t},s.params),this.strategy.handle(s))}}let U;const L=()=>(U||(U=new Q),U);try{self["workbox:routing:7.4.0"]&&_()}catch{}const v="GET",R=a=>a&&typeof a=="object"?a:{handle:a};class g{constructor(e,t,s=v){this.handler=R(t),this.match=e,this.method=s}setCatchHandler(e){this.catchHandler=R(e)}}class z extends g{constructor(e,t,s){const n=({url:r})=>{const c=e.exec(r.href);if(c&&!(r.origin!==location.origin&&c.index!==0))return c.slice(1)};super(n,t,s)}}class J{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",(e=>{const{request:t}=e,s=this.handleRequest({request:t,event:e});s&&e.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,s=Promise.all(t.urlsToCache.map(n=>{typeof n=="string"&&(n=[n]);const r=new Request(...n);return this.handleRequest({request:r,event:e})}));e.waitUntil(s),e.ports&&e.ports[0]&&s.then(()=>e.ports[0].postMessage(!0))}}))}handleRequest({request:e,event:t}){const s=new URL(e.url,location.href);if(!s.protocol.startsWith("http"))return;const n=s.origin===location.origin,{params:r,route:c}=this.findMatchingRoute({event:t,request:e,sameOrigin:n,url:s});let i=c&&c.handler;const o=e.method;if(!i&&this._defaultHandlerMap.has(o)&&(i=this._defaultHandlerMap.get(o)),!i)return;let h;try{h=i.handle({url:s,request:e,event:t,params:r})}catch(u){h=Promise.reject(u)}const p=c&&c.catchHandler;return h instanceof Promise&&(this._catchHandler||p)&&(h=h.catch(async u=>{if(p)try{return await p.handle({url:s,request:e,event:t,params:r})}catch(k){k instanceof Error&&(u=k)}if(this._catchHandler)return this._catchHandler.handle({url:s,request:e,event:t});throw u})),h}findMatchingRoute({url:e,sameOrigin:t,request:s,event:n}){const r=this._routes.get(s.method)||[];for(const c of r){let i;const o=c.match({url:e,sameOrigin:t,request:s,event:n});if(o)return i=o,(Array.isArray(i)&&i.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(i=void 0),{route:c,params:i}}return{}}setDefaultHandler(e,t=v){this._defaultHandlerMap.set(t,R(e))}setCatchHandler(e){this._catchHandler=R(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new l("unregister-route-route-not-registered")}}let w;const X=()=>(w||(w=new J,w.addFetchListener(),w.addCacheListener()),w);function T(a,e,t){let s;if(typeof a=="string"){const r=new URL(a,location.href),c=({url:i})=>i.href===r.href;s=new g(c,e,t)}else if(a instanceof RegExp)s=new z(a,e,t);else if(typeof a=="function")s=new g(a,e,t);else if(a instanceof g)s=a;else throw new l("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return X().registerRoute(s),s}function Y(a,e=[]){for(const t of[...a.searchParams.keys()])e.some(s=>s.test(t))&&a.searchParams.delete(t);return a}function*Z(a,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:s=!0,urlManipulation:n}={}){const r=new URL(a,location.href);r.hash="",yield r.href;const c=Y(r,e);if(yield c.href,t&&c.pathname.endsWith("/")){const i=new URL(c.href);i.pathname+=t,yield i.href}if(s){const i=new URL(c.href);i.pathname+=".html",yield i.href}if(n){const i=n({url:r});for(const o of i)yield o.href}}class ee extends g{constructor(e,t){const s=({request:n})=>{const r=e.getURLsToCacheKeys();for(const c of Z(n.url,t)){const i=r.get(c);if(i){const o=e.getIntegrityForCacheKey(i);return{cacheKey:i,integrity:o}}}};super(s,e.strategy)}}function te(a){const e=L(),t=new ee(e,a);T(t)}const se="-precache-",ae=async(a,e=se)=>{const s=(await self.caches.keys()).filter(n=>n.includes(e)&&n.includes(self.registration.scope)&&n!==a);return await Promise.all(s.map(n=>self.caches.delete(n))),s};function ne(){self.addEventListener("activate",(a=>{const e=C.getPrecacheName();a.waitUntil(ae(e).then(t=>{}))}))}function re(a){return L().createHandlerBoundToURL(a)}function ce(a){L().precache(a)}function ie(a,e){ce(a),te(e)}class oe extends g{constructor(e,{allowlist:t=[/./],denylist:s=[]}={}){super(n=>this._match(n),e),this._allowlist=t,this._denylist=s}_match({url:e,request:t}){if(t&&t.mode!=="navigate")return!1;const s=e.pathname+e.search;for(const n of this._denylist)if(n.test(s))return!1;return!!this._allowlist.some(n=>n.test(s))}}self.skipWaiting();j();ie([{"revision":"fab346dacb0b9b9af12554e9a59f004d","url":"logo.svg"},{"revision":"623840baec64a3438663496bb1050d30","url":"logo-docker.svg"},{"revision":"c5c8611b432190ec28522f1a2dfcbb7f","url":"logo-codex.svg"},{"revision":"
|
|
2
|
+
This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(i)}}}install(e){return K(e,async()=>{const t=new B;this.strategy.plugins.push(t);for(const[r,c]of this._urlsToCacheKeys){const i=this._cacheKeysToIntegrities.get(c),o=this._urlsToCacheModes.get(r),h=new Request(r,{integrity:i,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:c},request:h,event:e}))}const{updatedURLs:s,notUpdatedURLs:n}=t;return{updatedURLs:s,notUpdatedURLs:n}})}activate(e){return K(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),s=await t.keys(),n=new Set(this._urlsToCacheKeys.values()),r=[];for(const c of s)n.has(c.url)||(await t.delete(c),r.push(c.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,s=this.getCacheKeyForURL(t);if(s)return(await self.caches.open(this.strategy.cacheName)).match(s)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new l("non-precached-url",{url:e});return s=>(s.request=new Request(e),s.params=Object.assign({cacheKey:t},s.params),this.strategy.handle(s))}}let U;const L=()=>(U||(U=new Q),U);try{self["workbox:routing:7.4.0"]&&_()}catch{}const v="GET",R=a=>a&&typeof a=="object"?a:{handle:a};class g{constructor(e,t,s=v){this.handler=R(t),this.match=e,this.method=s}setCatchHandler(e){this.catchHandler=R(e)}}class z extends g{constructor(e,t,s){const n=({url:r})=>{const c=e.exec(r.href);if(c&&!(r.origin!==location.origin&&c.index!==0))return c.slice(1)};super(n,t,s)}}class J{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",(e=>{const{request:t}=e,s=this.handleRequest({request:t,event:e});s&&e.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,s=Promise.all(t.urlsToCache.map(n=>{typeof n=="string"&&(n=[n]);const r=new Request(...n);return this.handleRequest({request:r,event:e})}));e.waitUntil(s),e.ports&&e.ports[0]&&s.then(()=>e.ports[0].postMessage(!0))}}))}handleRequest({request:e,event:t}){const s=new URL(e.url,location.href);if(!s.protocol.startsWith("http"))return;const n=s.origin===location.origin,{params:r,route:c}=this.findMatchingRoute({event:t,request:e,sameOrigin:n,url:s});let i=c&&c.handler;const o=e.method;if(!i&&this._defaultHandlerMap.has(o)&&(i=this._defaultHandlerMap.get(o)),!i)return;let h;try{h=i.handle({url:s,request:e,event:t,params:r})}catch(u){h=Promise.reject(u)}const p=c&&c.catchHandler;return h instanceof Promise&&(this._catchHandler||p)&&(h=h.catch(async u=>{if(p)try{return await p.handle({url:s,request:e,event:t,params:r})}catch(k){k instanceof Error&&(u=k)}if(this._catchHandler)return this._catchHandler.handle({url:s,request:e,event:t});throw u})),h}findMatchingRoute({url:e,sameOrigin:t,request:s,event:n}){const r=this._routes.get(s.method)||[];for(const c of r){let i;const o=c.match({url:e,sameOrigin:t,request:s,event:n});if(o)return i=o,(Array.isArray(i)&&i.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(i=void 0),{route:c,params:i}}return{}}setDefaultHandler(e,t=v){this._defaultHandlerMap.set(t,R(e))}setCatchHandler(e){this._catchHandler=R(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new l("unregister-route-route-not-registered")}}let w;const X=()=>(w||(w=new J,w.addFetchListener(),w.addCacheListener()),w);function T(a,e,t){let s;if(typeof a=="string"){const r=new URL(a,location.href),c=({url:i})=>i.href===r.href;s=new g(c,e,t)}else if(a instanceof RegExp)s=new z(a,e,t);else if(typeof a=="function")s=new g(a,e,t);else if(a instanceof g)s=a;else throw new l("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return X().registerRoute(s),s}function Y(a,e=[]){for(const t of[...a.searchParams.keys()])e.some(s=>s.test(t))&&a.searchParams.delete(t);return a}function*Z(a,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:s=!0,urlManipulation:n}={}){const r=new URL(a,location.href);r.hash="",yield r.href;const c=Y(r,e);if(yield c.href,t&&c.pathname.endsWith("/")){const i=new URL(c.href);i.pathname+=t,yield i.href}if(s){const i=new URL(c.href);i.pathname+=".html",yield i.href}if(n){const i=n({url:r});for(const o of i)yield o.href}}class ee extends g{constructor(e,t){const s=({request:n})=>{const r=e.getURLsToCacheKeys();for(const c of Z(n.url,t)){const i=r.get(c);if(i){const o=e.getIntegrityForCacheKey(i);return{cacheKey:i,integrity:o}}}};super(s,e.strategy)}}function te(a){const e=L(),t=new ee(e,a);T(t)}const se="-precache-",ae=async(a,e=se)=>{const s=(await self.caches.keys()).filter(n=>n.includes(e)&&n.includes(self.registration.scope)&&n!==a);return await Promise.all(s.map(n=>self.caches.delete(n))),s};function ne(){self.addEventListener("activate",(a=>{const e=C.getPrecacheName();a.waitUntil(ae(e).then(t=>{}))}))}function re(a){return L().createHandlerBoundToURL(a)}function ce(a){L().precache(a)}function ie(a,e){ce(a),te(e)}class oe extends g{constructor(e,{allowlist:t=[/./],denylist:s=[]}={}){super(n=>this._match(n),e),this._allowlist=t,this._denylist=s}_match({url:e,request:t}){if(t&&t.mode!=="navigate")return!1;const s=e.pathname+e.search;for(const n of this._denylist)if(n.test(s))return!1;return!!this._allowlist.some(n=>n.test(s))}}self.skipWaiting();j();ie([{"revision":"fab346dacb0b9b9af12554e9a59f004d","url":"logo.svg"},{"revision":"623840baec64a3438663496bb1050d30","url":"logo-docker.svg"},{"revision":"c5c8611b432190ec28522f1a2dfcbb7f","url":"logo-codex.svg"},{"revision":"f2a9f78aee59a10ed3f0e9d88794b325","url":"index.html"},{"revision":"1421e9c6cad8218ef5689b85034d3a95","url":"icon-512.png"},{"revision":"b96da5a0b6636012517f54b0e69c304d","url":"icon-192.png"},{"revision":"c64ca8ae8596d4ffe13d0f591beb2274","url":"favicon.svg"},{"revision":"6481face04bd08e6f0bfc2a633840b57","url":"apple-touch-icon.png"},{"revision":"83304194a3c8be2b5b61242eeb1c1046","url":"fonts/MesloLGSNerdFontMono-Regular.woff2"},{"revision":"60fafe18cbcb717c51cdabf87f9490f0","url":"fonts/MesloLGSNerdFontMono-Bold.woff2"},{"revision":null,"url":"assets/workbox-window.prod.es5-BBnX5xw4.js"},{"revision":null,"url":"assets/sw-register-2ITbAS9w.js"},{"revision":null,"url":"assets/index-_VjPWGkx.js"},{"revision":null,"url":"assets/index-CUfPwiv5.css"},{"revision":null,"url":"assets/TailscalePage-C1bGGkFU.js"},{"revision":null,"url":"assets/SettingsPage-CEOoHbQk.js"},{"revision":null,"url":"assets/SandboxManager-b3xCX8cU.js"},{"revision":null,"url":"assets/RunsPage-bbhhFNkd.js"},{"revision":null,"url":"assets/PromptsPage-BHtp_9DW.js"},{"revision":null,"url":"assets/Playground-Dpfq4KMB.js"},{"revision":null,"url":"assets/MagicUIView-CdHkHIEh.js"},{"revision":null,"url":"assets/MagicUIDashboard-5nBMuLS8.js"},{"revision":null,"url":"assets/LinearSettingsPage-CVmZKj9l.js"},{"revision":null,"url":"assets/LinearOAuthSettingsPage-B5U70sHB.js"},{"revision":null,"url":"assets/IntegrationsPage-BHj_BEVr.js"},{"revision":null,"url":"assets/DashboardPage-Ch_HQGg0.js"},{"revision":null,"url":"assets/CronManager-CNRhJ7JU.js"},{"revision":null,"url":"assets/AgentsPage-ClW7bWRx.js"}]);ne();T(new oe(re("index.html"),{denylist:[/^\/api/,/^\/ws/]}));
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,a as j,j as e,t as z,I as _,J as B,K,N as U,F as Y}from"./index-BM8QkiV8.js";function W(s,p,c=!0){a.useEffect(()=>{if(!c)return;function d(o){s.some(m=>m.current&&m.current.contains(o.target))||p()}return document.addEventListener("pointerdown",d),()=>document.removeEventListener("pointerdown",d)},[s,p,c])}function J(s){const p=s-Date.now();if(p<=0)return"now";const c=Math.floor(p/6e4);if(c<60)return`in ${c}m`;const d=Math.floor(c/60);return d<24?`in ${d}h`:`in ${Math.floor(d/24)}d`}function F(s,p){if(!p)return"One-time";const c=s.trim().split(/\s+/);if(c.length!==5)return s;const[d,o,g,m,x]=c;if(s==="* * * * *")return"Every minute";if(o==="*"&&g==="*"&&m==="*"&&x==="*"&&d.startsWith("*/")){const l=parseInt(d.slice(2),10);return l===1?"Every minute":`Every ${l} minutes`}if(d==="0"&&g==="*"&&m==="*"&&x==="*"){if(o==="*")return"Every hour";if(o.startsWith("*/")){const l=parseInt(o.slice(2),10);return l===1?"Every hour":`Every ${l} hours`}}if(g==="*"&&m==="*"&&d!=="*"&&o!=="*"&&!o.includes("/")&&!o.includes(",")){const l=parseInt(o,10),y=parseInt(d,10);if(!isNaN(l)&&!isNaN(y)){const u=l>=12?"PM":"AM",w=l===0?12:l>12?l-12:l,r=y.toString().padStart(2,"0"),v=`${w}:${r} ${u}`;if(x==="*")return`Every day at ${v}`;if(x==="1-5")return`Weekdays at ${v}`;if(x==="0,6")return`Weekends at ${v}`}}return s}const $={name:"",prompt:"",recurring:!0,schedule:"0 8 * * *",oneTimeDate:"",backendType:"claude",model:B("claude"),cwd:""},q=[{label:"Every hour",value:"0 * * * *"},{label:"Every day at 8am",value:"0 8 * * *"},{label:"Every 2 hours",value:"0 */2 * * *"},{label:"Weekdays at 9am",value:"0 9 * * 1-5"}];function X({onClose:s,embedded:p=!1}){const[c,d]=a.useState([]),[o,g]=a.useState(!0),[m,x]=a.useState(""),[l,y]=a.useState(null),[u,w]=a.useState($),[r,v]=a.useState($),[h,M]=a.useState(!1),[f,S]=a.useState(!1),[k,E]=a.useState(new Set),n=a.useCallback(()=>{j.listCronJobs().then(d).catch(()=>{}).finally(()=>g(!1))},[]);a.useEffect(()=>{n();const t=setInterval(n,1e4);return()=>clearInterval(t)},[n]);async function C(){const t=r.name.trim(),i=r.prompt.trim();if(!t||!i)return;M(!0),x("");let N=r.schedule;!r.recurring&&r.oneTimeDate&&(N=new Date(r.oneTimeDate).toISOString());try{await j.createCronJob({name:t,prompt:i,schedule:N,recurring:r.recurring,backendType:r.backendType,model:r.model.trim()||void 0,cwd:r.cwd.trim()||void 0}),v($),S(!1),n()}catch(b){x(b instanceof Error?b.message:String(b))}finally{M(!1)}}function R(t){y(t.id),w({name:t.name,prompt:t.prompt,recurring:t.recurring,schedule:t.schedule,oneTimeDate:"",backendType:t.backendType,model:t.model,cwd:t.cwd}),x("")}function D(){y(null),x("")}async function L(){if(!l)return;const t=u.name.trim(),i=u.prompt.trim();if(!t||!i)return;let N=u.schedule;!u.recurring&&u.oneTimeDate&&(N=new Date(u.oneTimeDate).toISOString());try{await j.updateCronJob(l,{name:t,prompt:i,schedule:N,recurring:u.recurring,backendType:u.backendType,model:u.model.trim()||void 0,cwd:u.cwd.trim()||void 0}),y(null),x(""),n()}catch(b){x(b instanceof Error?b.message:String(b))}}async function A(t){try{await j.deleteCronJob(t),l===t&&y(null),n()}catch(i){x(i instanceof Error?i.message:String(i))}}async function I(t){try{await j.toggleCronJob(t),n()}catch(i){x(i instanceof Error?i.message:String(i))}}async function P(t){E(i=>new Set(i).add(t));try{await j.runCronJob(t),n()}catch(i){x(i instanceof Error?i.message:String(i))}finally{E(i=>{const N=new Set(i);return N.delete(t),N})}}if(p)return e.jsx("div",{className:"h-full bg-cc-bg text-cc-fg font-sans-ui antialiased overflow-y-auto",children:e.jsxs("div",{className:"max-w-2xl mx-auto px-4 sm:px-6 py-6 sm:py-10 pb-safe",children:[e.jsx("div",{className:"flex items-start justify-between gap-3 mb-2",children:e.jsxs("div",{className:"min-w-0",children:[e.jsx("h1",{className:"text-lg font-semibold text-cc-fg",children:"Scheduled Tasks"}),e.jsx("p",{className:"mt-0.5 text-[13px] text-cc-muted leading-relaxed",children:"Run autonomous Claude Code or Codex sessions on a schedule."})]})}),e.jsxs("div",{className:"flex items-center gap-2 mt-4 mb-5",children:[e.jsx("div",{className:"flex-1"}),e.jsxs("button",{onClick:()=>S(!f),className:`flex items-center gap-1.5 px-3.5 py-2.5 min-h-[44px] rounded-lg text-sm font-medium transition-colors cursor-pointer shrink-0 ${f?"bg-cc-active text-cc-fg":"bg-cc-primary hover:bg-cc-primary-hover text-white"}`,children:[e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"w-4 h-4",children:f?e.jsx("path",{d:"M18 6 6 18M6 6l12 12"}):e.jsx("path",{d:"M12 5v14M5 12h14"})}),e.jsx("span",{className:"hidden sm:inline",children:f?"Cancel":"New Task"})]})]}),f&&e.jsxs("div",{className:"mb-6 rounded-xl bg-cc-card p-4 sm:p-5 space-y-3",style:{animation:"fadeSlideIn 150ms ease-out"},children:[e.jsx(T,{form:r,onChange:v}),e.jsx("p",{className:"text-[10px] text-cc-muted",children:"Scheduled tasks run with full autonomy (bypassPermissions)"}),m&&f&&e.jsx("div",{className:"px-3 py-2 rounded-lg bg-cc-error/10 text-xs text-cc-error",children:m}),e.jsx("div",{className:"flex items-center justify-end pt-1",children:e.jsx("button",{onClick:C,disabled:!r.name.trim()||!r.prompt.trim()||h,className:`px-4 py-2.5 min-h-[44px] rounded-lg text-sm font-medium transition-colors ${r.name.trim()&&r.prompt.trim()&&!h?"bg-cc-primary hover:bg-cc-primary-hover text-white cursor-pointer":"bg-cc-hover text-cc-muted cursor-not-allowed"}`,children:h?"Creating...":"Create"})})]}),e.jsxs("div",{className:"flex items-center gap-2 mb-3 text-[12px] text-cc-muted",children:[e.jsxs("span",{children:[c.length," task",c.length!==1?"s":""]}),c.filter(t=>t.enabled).length>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-cc-border",children:"·"}),e.jsxs("span",{children:[c.filter(t=>t.enabled).length," active"]})]})]}),o?e.jsx("div",{className:"py-12 text-center text-sm text-cc-muted",children:"Loading scheduled tasks..."}):c.length===0?e.jsx("div",{className:"py-12 text-center text-sm text-cc-muted",children:"No scheduled tasks yet."}):e.jsx("div",{className:"space-y-1",children:c.map(t=>l===t.id?e.jsxs("div",{className:"rounded-xl bg-cc-card p-4 space-y-3",style:{animation:"fadeSlideIn 150ms ease-out"},children:[e.jsx(T,{form:u,onChange:w}),e.jsxs("div",{className:"flex justify-end gap-2",children:[e.jsx("button",{onClick:D,className:"px-3 py-2.5 min-h-[44px] text-sm rounded-lg text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer",children:"Cancel"}),e.jsx("button",{onClick:()=>void L(),className:"px-4 py-2.5 min-h-[44px] text-sm rounded-lg font-medium bg-cc-primary hover:bg-cc-primary-hover text-white transition-colors cursor-pointer",children:"Save"})]})]},t.id):e.jsx(G,{job:t,isRunning:k.has(t.id),onStartEdit:()=>R(t),onDelete:()=>void A(t.id),onToggle:()=>void I(t.id),onRunNow:()=>void P(t.id)},t.id))}),m&&!f&&e.jsx("div",{className:"mt-4 px-3 py-2 rounded-lg bg-cc-error/10 text-xs text-cc-error",children:m})]})});const O=m&&e.jsx("div",{className:"px-3 py-2 rounded-lg bg-cc-error/10 text-xs text-cc-error",children:m}),H=o?e.jsx("div",{className:"text-sm text-cc-muted text-center py-6",children:"Loading scheduled tasks..."}):c.length===0?e.jsx("div",{className:"text-sm text-cc-muted text-center py-6",children:"No scheduled tasks yet."}):e.jsx("div",{className:"space-y-3",children:c.map(t=>e.jsxs("div",{className:"rounded-xl bg-cc-card overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5",children:[e.jsx("span",{className:"text-sm font-medium text-cc-fg flex-1 truncate",children:t.name}),e.jsx("span",{className:`text-[9px] font-medium px-1.5 rounded-full leading-[16px] shrink-0 ${t.backendType==="codex"?"text-blue-500 bg-blue-500/10":"text-[#5BA8A0] bg-[#5BA8A0]/10"}`,children:t.backendType==="codex"?"Codex":"Claude"}),t.consecutiveFailures>0&&e.jsxs("span",{className:"text-[9px] font-medium px-1.5 rounded-full leading-[16px] shrink-0 text-cc-error bg-cc-error/10",children:[t.consecutiveFailures," fail",t.consecutiveFailures!==1?"s":""]}),e.jsx("button",{onClick:()=>I(t.id),className:`relative w-10 h-6 rounded-full transition-colors cursor-pointer shrink-0 ${t.enabled?"bg-cc-primary":"bg-cc-border"}`,title:t.enabled?"Disable":"Enable",children:e.jsx("span",{className:`absolute top-[3px] w-[18px] h-[18px] rounded-full bg-white transition-transform ${t.enabled?"left-[19px]":"left-[3px]"}`})}),l===t.id?e.jsx("button",{onClick:D,className:"text-xs px-2 py-1.5 min-h-[44px] text-cc-muted hover:text-cc-fg cursor-pointer",children:"Cancel"}):e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:()=>P(t.id),disabled:k.has(t.id),className:`text-xs px-2 py-1.5 min-h-[44px] cursor-pointer ${k.has(t.id)?"text-cc-muted cursor-not-allowed":"text-cc-primary hover:text-cc-primary-hover"}`,children:k.has(t.id)?"Running...":"Run Now"}),e.jsx("button",{onClick:()=>R(t),className:"text-xs px-2 py-1.5 min-h-[44px] text-cc-muted hover:text-cc-fg cursor-pointer",children:"Edit"}),e.jsx("button",{onClick:()=>A(t.id),className:"text-xs px-2 py-1.5 min-h-[44px] text-cc-muted hover:text-cc-error cursor-pointer",children:"Delete"})]})]}),l===t.id&&e.jsxs("div",{className:"px-3 py-3 space-y-2.5",children:[e.jsx(T,{form:u,onChange:w}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:L,className:"px-4 py-2.5 min-h-[44px] text-sm font-medium bg-cc-primary hover:bg-cc-primary-hover text-white rounded-lg transition-colors cursor-pointer",children:"Save"}),e.jsx("button",{onClick:D,className:"px-3 py-2.5 min-h-[44px] text-sm font-medium text-cc-muted hover:text-cc-fg rounded-lg transition-colors cursor-pointer",children:"Cancel"})]})]}),l!==t.id&&e.jsxs("div",{className:"px-3 py-2.5 space-y-1.5",children:[e.jsx("div",{className:"text-xs text-cc-muted truncate",title:t.prompt,children:t.prompt}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] text-cc-muted",children:[e.jsx("span",{children:F(t.schedule,t.recurring)}),t.nextRunAt!=null&&t.enabled&&e.jsxs("span",{children:["Next: ",J(t.nextRunAt)]}),t.lastRunAt!=null&&e.jsxs("span",{className:"flex items-center gap-1",children:["Last: ",z(t.lastRunAt),t.consecutiveFailures===0?e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3 h-3 text-cc-success",children:e.jsx("path",{d:"M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2.5-2.5a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z"})}):e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3 h-3 text-cc-error",children:e.jsx("path",{d:"M4.646 4.646a.5.5 0 01.708 0L8 7.293l2.646-2.647a.5.5 0 01.708.708L8.707 8l2.647 2.646a.5.5 0 01-.708.708L8 8.707l-2.646 2.647a.5.5 0 01-.708-.708L7.293 8 4.646 5.354a.5.5 0 010-.708z"})})]}),t.totalRuns>0&&e.jsxs("span",{children:[t.totalRuns," run",t.totalRuns!==1?"s":""]}),t.cwd&&e.jsx("span",{className:"font-mono-code truncate max-w-[200px]",title:t.cwd,children:t.cwd})]})]})]},t.id))}),V=e.jsxs("div",{className:"rounded-xl bg-cc-card overflow-hidden",children:[e.jsxs("button",{onClick:()=>S(!f),className:"w-full flex items-center gap-2 px-3 py-2.5 cursor-pointer hover:bg-cc-hover transition-colors",children:[e.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",className:`w-3 h-3 text-cc-muted transition-transform ${f?"rotate-90":""}`,children:e.jsx("path",{d:"M6 4l4 4-4 4",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("span",{className:"text-sm font-medium text-cc-fg",children:"New Scheduled Task"})]}),f&&e.jsxs("div",{className:"px-3 py-3 space-y-2.5",children:[e.jsx(T,{form:r,onChange:v}),e.jsx("div",{className:"text-[10px] text-cc-muted",children:"Scheduled tasks run with full autonomy (bypassPermissions)"}),e.jsx("button",{onClick:C,disabled:!r.name.trim()||!r.prompt.trim()||h,className:`px-4 py-2.5 min-h-[44px] text-sm font-medium rounded-lg transition-colors ${r.name.trim()&&r.prompt.trim()&&!h?"bg-cc-primary hover:bg-cc-primary-hover text-white cursor-pointer":"bg-cc-hover text-cc-muted cursor-not-allowed"}`,children:h?"Creating...":"Create"})]})]}),Z=e.jsxs("div",{className:"w-full max-w-2xl max-h-[90dvh] sm:max-h-[80dvh] mx-0 sm:mx-4 flex flex-col bg-cc-bg rounded-t-[14px] sm:rounded-[14px] shadow-2xl overflow-hidden",onClick:t=>t.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-4 sm:px-5 py-3 sm:py-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold text-cc-fg",children:"Scheduled Tasks"}),e.jsx("p",{className:"text-xs text-cc-muted mt-0.5",children:"Run autonomous Claude Code or Codex sessions on a schedule"})]}),s&&e.jsx("button",{onClick:s,className:"w-8 h-8 flex items-center justify-center rounded-md text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer",children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"w-3.5 h-3.5",children:e.jsx("path",{d:"M4 4l8 8M12 4l-8 8",strokeLinecap:"round"})})})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-3 sm:px-5 py-3 sm:py-4 pb-safe space-y-4",children:[O,H,V]})]});return _.createPortal(e.jsx("div",{className:"fixed inset-0 z-50 flex items-end sm:items-center justify-center bg-black/50",onClick:s,children:Z}),document.body)}function G({job:s,isRunning:p,onStartEdit:c,onDelete:d,onToggle:o,onRunNow:g}){return e.jsxs("div",{className:"group flex items-start gap-3 px-3 py-3 min-h-[44px] rounded-lg hover:bg-cc-hover/60 transition-colors",children:[e.jsx("div",{className:"shrink-0 mt-0.5 w-7 h-7 rounded-md bg-cc-primary/10 flex items-center justify-center",children:e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5 text-cc-primary",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("path",{d:"M12 6v6l4 2"})]})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-cc-fg truncate",children:s.name}),e.jsx("span",{className:`text-[9px] font-medium px-1.5 rounded-full leading-[16px] shrink-0 ${s.backendType==="codex"?"text-blue-500 bg-blue-500/10":"text-[#5BA8A0] bg-[#5BA8A0]/10"}`,children:s.backendType==="codex"?"Codex":"Claude"}),s.consecutiveFailures>0&&e.jsxs("span",{className:"text-[9px] font-medium px-1.5 rounded-full leading-[16px] shrink-0 text-cc-error bg-cc-error/10",children:[s.consecutiveFailures," fail",s.consecutiveFailures!==1?"s":""]}),!s.enabled&&e.jsx("span",{className:"text-[9px] font-medium px-1.5 rounded-full leading-[16px] shrink-0 text-cc-muted bg-cc-hover",children:"Paused"})]}),e.jsx("p",{className:"mt-0.5 text-xs text-cc-muted line-clamp-1 leading-relaxed",children:s.prompt}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-0.5 mt-1 text-[11px] text-cc-muted",children:[e.jsx("span",{children:F(s.schedule,s.recurring)}),s.nextRunAt!=null&&s.enabled&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-cc-border",children:"·"}),e.jsxs("span",{children:["Next ",J(s.nextRunAt)]})]}),s.lastRunAt!=null&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-cc-border",children:"·"}),e.jsxs("span",{className:"flex items-center gap-0.5",children:["Last ",z(s.lastRunAt),s.consecutiveFailures===0?e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-2.5 h-2.5 text-cc-success",children:e.jsx("path",{d:"M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2.5-2.5a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z"})}):e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-2.5 h-2.5 text-cc-error",children:e.jsx("path",{d:"M4.646 4.646a.5.5 0 01.708 0L8 7.293l2.646-2.647a.5.5 0 01.708.708L8.707 8l2.647 2.646a.5.5 0 01-.708.708L8 8.707l-2.646 2.647a.5.5 0 01-.708-.708L7.293 8 4.646 5.354a.5.5 0 010-.708z"})})]})]}),s.totalRuns>0&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-cc-border",children:"·"}),e.jsxs("span",{children:[s.totalRuns," run",s.totalRuns!==1?"s":""]})]})]})]}),e.jsxs("div",{className:"shrink-0 flex items-center gap-0.5 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity",children:[e.jsx("button",{onClick:o,className:`relative w-9 h-5 rounded-full transition-colors cursor-pointer shrink-0 ${s.enabled?"bg-cc-primary":"bg-cc-border"}`,title:s.enabled?"Disable":"Enable",children:e.jsx("span",{className:`absolute top-[2px] w-4 h-4 rounded-full bg-white transition-transform ${s.enabled?"left-[17px]":"left-[2px]"}`})}),e.jsx("button",{onClick:g,disabled:p,className:`p-2 min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0 sm:p-1.5 rounded-md transition-colors cursor-pointer ${p?"text-cc-muted cursor-not-allowed":"text-cc-primary hover:bg-cc-primary/10"}`,"aria-label":"Run now",title:p?"Running...":"Run now",children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"w-3.5 h-3.5",children:e.jsx("path",{d:"M8 5v14l11-7z"})})}),e.jsx("button",{onClick:c,className:"p-2 min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0 sm:p-1.5 rounded-md text-cc-muted hover:text-cc-fg hover:bg-cc-active transition-colors cursor-pointer","aria-label":"Edit",children:e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:[e.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),e.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5Z"})]})}),e.jsx("button",{onClick:d,className:"p-2 min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0 sm:p-1.5 rounded-md text-cc-muted hover:text-cc-error hover:bg-cc-error/10 transition-colors cursor-pointer","aria-label":"Delete",children:e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:e.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14Z"})})})]})]})}function T({form:s,onChange:p}){const c=n=>p({...s,...n}),[d,o]=a.useState(null),[g,m]=a.useState(!1),x=a.useRef(null),[l,y]=a.useState(!1),[u,w]=a.useState(!1),r=a.useRef(null),v=d||K(s.backendType),h=v.find(n=>n.value===s.model)||v[0];a.useEffect(()=>{o(null),s.backendType==="codex"&&j.getBackendModels(s.backendType).then(n=>{if(n.length>0){const C=U(n);o(C),C.some(R=>R.value===s.model)||c({model:C[0].value})}}).catch(()=>{})},[s.backendType]),a.useEffect(()=>{s.model||c({model:B(s.backendType)})},[]);const M=a.useMemo(()=>[x],[]),f=a.useCallback(()=>m(!1),[]);W(M,f,g);const S=a.useMemo(()=>[r],[]),k=a.useCallback(()=>w(!1),[]);W(S,k,u);const E=s.cwd?s.cwd.split("/").pop()||s.cwd:"Select folder";return e.jsxs("div",{className:"space-y-2.5",children:[e.jsx("input",{type:"text",value:s.name,onChange:n=>c({name:n.target.value}),placeholder:"Task name (e.g. Daily test suite)",className:"w-full px-3 py-2.5 min-h-[44px] text-sm bg-cc-bg rounded-lg text-cc-fg placeholder:text-cc-muted focus:outline-none focus:ring-1 focus:ring-cc-primary/40 transition-shadow"}),e.jsx("textarea",{value:s.prompt,onChange:n=>c({prompt:n.target.value}),placeholder:"Prompt for the session (e.g. Run the test suite and fix any failures)",rows:4,className:"w-full px-3 py-2.5 text-sm bg-cc-bg rounded-lg text-cc-fg placeholder:text-cc-muted focus:outline-none focus:ring-1 focus:ring-cc-primary/40 resize-y transition-shadow",style:{minHeight:"100px"}}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("button",{onClick:()=>c({recurring:!0}),className:`px-2.5 py-2 min-h-[44px] text-xs font-medium rounded-lg transition-colors cursor-pointer ${s.recurring?"bg-cc-primary text-white":"bg-cc-hover text-cc-muted hover:text-cc-fg"}`,children:"Recurring"}),e.jsx("button",{onClick:()=>c({recurring:!1}),className:`px-2.5 py-2 min-h-[44px] text-xs font-medium rounded-lg transition-colors cursor-pointer ${s.recurring?"bg-cc-hover text-cc-muted hover:text-cc-fg":"bg-cc-primary text-white"}`,children:"One-time"})]}),s.recurring?e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"flex flex-wrap gap-1.5",children:q.map(n=>e.jsx("button",{onClick:()=>c({schedule:n.value}),className:`px-2.5 py-2 min-h-[44px] text-xs font-medium rounded-md transition-colors cursor-pointer ${s.schedule===n.value?"bg-cc-primary/20 text-cc-primary":"bg-cc-hover text-cc-muted hover:text-cc-fg"}`,children:n.label},n.value))}),e.jsx("input",{type:"text",value:s.schedule,onChange:n=>c({schedule:n.target.value}),placeholder:"Cron expression (e.g. 0 8 * * *)",className:"w-full px-3 py-2.5 min-h-[44px] text-sm font-mono-code bg-cc-bg rounded-lg text-cc-fg placeholder:text-cc-muted focus:outline-none focus:ring-1 focus:ring-cc-primary/40 transition-shadow"}),e.jsx("div",{className:"text-[10px] text-cc-muted",children:F(s.schedule,!0)})]}):e.jsx("input",{type:"datetime-local",value:s.oneTimeDate,onChange:n=>c({oneTimeDate:n.target.value}),className:"w-full px-3 py-2.5 min-h-[44px] text-sm bg-cc-bg rounded-lg text-cc-fg placeholder:text-cc-muted focus:outline-none focus:ring-1 focus:ring-cc-primary/40 transition-shadow"})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsxs("div",{className:"relative",ref:r,children:[e.jsxs("button",{onClick:()=>w(!u),className:"flex items-center gap-1.5 px-2.5 py-2 min-h-[44px] text-xs font-medium text-cc-fg rounded-lg hover:bg-cc-hover transition-colors cursor-pointer",children:[e.jsx("span",{children:s.backendType==="codex"?"Codex":"Claude Code"}),e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3 h-3 opacity-50",children:e.jsx("path",{d:"M4 6l4 4 4-4"})})]}),u&&e.jsx("div",{className:"absolute left-0 bottom-full mb-1 w-40 bg-cc-card rounded-xl shadow-lg z-10 py-1",children:[{value:"claude",label:"Claude Code"},{value:"codex",label:"Codex"}].map(n=>e.jsx("button",{onClick:()=>{c({backendType:n.value,model:B(n.value)}),w(!1)},className:`w-full px-3 py-2.5 min-h-[44px] text-xs text-left hover:bg-cc-hover transition-colors cursor-pointer ${n.value===s.backendType?"text-cc-primary font-medium":"text-cc-fg"}`,children:n.label},n.value))})]}),e.jsxs("div",{className:"relative",ref:x,children:[e.jsxs("button",{onClick:()=>m(!g),className:"flex items-center gap-1.5 px-2.5 py-2 min-h-[44px] text-xs text-cc-muted hover:text-cc-fg rounded-lg hover:bg-cc-hover transition-colors cursor-pointer",children:[e.jsx("span",{children:h==null?void 0:h.icon}),e.jsx("span",{children:h==null?void 0:h.label}),e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3 h-3 opacity-50",children:e.jsx("path",{d:"M4 6l4 4 4-4"})})]}),g&&e.jsx("div",{className:"absolute left-0 bottom-full mb-1 w-52 bg-cc-card rounded-xl shadow-lg z-10 py-1",children:v.map(n=>e.jsxs("button",{onClick:()=>{c({model:n.value}),m(!1)},className:`w-full px-3 py-2.5 min-h-[44px] text-xs text-left hover:bg-cc-hover transition-colors cursor-pointer flex items-center gap-2 ${n.value===s.model?"text-cc-primary font-medium":"text-cc-fg"}`,children:[e.jsx("span",{children:n.icon}),n.label]},n.value))})]}),e.jsxs("button",{onClick:()=>y(!0),className:"flex items-center gap-1.5 px-2.5 py-2 min-h-[44px] text-xs text-cc-muted hover:text-cc-fg rounded-lg hover:bg-cc-hover transition-colors cursor-pointer",children:[e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3.5 h-3.5 opacity-60",children:e.jsx("path",{d:"M1 3.5A1.5 1.5 0 012.5 2h3.379a1.5 1.5 0 011.06.44l.622.621a.5.5 0 00.353.146H13.5A1.5 1.5 0 0115 4.707V12.5a1.5 1.5 0 01-1.5 1.5h-11A1.5 1.5 0 011 12.5v-9z"})}),e.jsx("span",{className:"max-w-[200px] truncate font-mono-code",children:E}),e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3 h-3 opacity-50",children:e.jsx("path",{d:"M4 6l4 4 4-4"})})]}),l&&e.jsx(Y,{initialPath:s.cwd||"",onSelect:n=>c({cwd:n}),onClose:()=>y(!1)})]})]})}export{X as CronManager};
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import{r as x,j as e,u as b,n as ge,b as be,P as v,f as fe,A as Q,h,D as _,T as w,G as P,L as X,k as L,S as B,l as U,m as O,o as Z,p as ee,q as je,v as ve,w as we,U as Ne,x as ye,y as ae,z as ie,a as ke,B as _e,E as S,H as Se}from"./index-BM8QkiV8.js";import{M as Ce}from"./MagicUIDashboard-exuRY5LQ.js";const Ae=new Set(["pulling_image","running_init_script","building_image"]);function E({steps:t,error:c}){const[n,i]=x.useState({}),[r,m]=x.useState(new Set),o=x.useRef(new Map),g=x.useCallback(l=>p=>{p?o.current.set(l,p):o.current.delete(l)},[]);return x.useEffect(()=>{for(const l of t)l.detail&&Ae.has(l.step)&&(i(p=>{const a=p[l.step]||[];return a.length===0||a[a.length-1]!==l.detail?{...p,[l.step]:[...a,l.detail]}:p}),m(p=>{if(p.has(l.step))return p;const a=new Set(p);return a.add(l.step),a}))},[t]),x.useEffect(()=>{var l;for(const p of o.current.values())(l=p.scrollTo)==null||l.call(p,{top:p.scrollHeight})},[n]),t.length===0?null:e.jsxs("div",{className:"w-full max-w-md mx-auto mt-4 mb-2",children:[e.jsx("div",{className:"space-y-1.5",children:t.map(l=>{const p=n[l.step],a=p&&p.length>0,y=r.has(l.step);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2.5 py-1",children:[e.jsxs("div",{className:"w-4 h-4 flex items-center justify-center shrink-0",children:[l.status==="in_progress"&&e.jsx("span",{className:"w-3.5 h-3.5 border-2 border-cc-primary/30 border-t-cc-primary rounded-full animate-spin"}),l.status==="done"&&e.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3.5 h-3.5 text-cc-success",children:e.jsx("path",{d:"M13.25 4.75L6 12 2.75 8.75",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),l.status==="error"&&e.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3.5 h-3.5 text-cc-error",children:e.jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})]}),e.jsx("span",{className:`text-sm flex-1 ${l.status==="in_progress"?"text-cc-fg font-medium":l.status==="done"?"text-cc-muted":"text-cc-error"}`,children:l.label}),a&&e.jsx("button",{onClick:()=>m(N=>{const u=new Set(N);return u.has(l.step)?u.delete(l.step):u.add(l.step),u}),className:"text-[10px] text-cc-muted hover:text-cc-fg transition-colors cursor-pointer",children:y?"Hide logs":"Show logs"})]}),a&&y&&e.jsx("pre",{ref:g(l.step),className:"ml-[26px] mt-1 mb-1 px-3 py-2 text-[10px] font-mono-code bg-black/20 border border-cc-border rounded-md text-cc-muted max-h-[150px] overflow-auto whitespace-pre-wrap",children:p.slice(-30).join(`
|
|
2
|
-
`)})]},l.step)})}),c&&e.jsx("div",{className:"mt-2.5 px-3 py-2 rounded-lg bg-cc-error/5 border border-cc-error/20",children:e.jsx("p",{className:"text-xs text-cc-error whitespace-pre-wrap",children:c})})]})}const j="playground-session";function f(t){return{request_id:`perm-${Math.random().toString(36).slice(2,8)}`,tool_use_id:`tu-${Math.random().toString(36).slice(2,8)}`,timestamp:Date.now(),...t}}const ce=f({tool_name:"Bash",input:{command:"git log --oneline -20 && npm run build",description:"View recent commits and build the project"},permission_suggestions:[{type:"addRules",rules:[{toolName:"Bash",ruleContent:"git log --oneline -20 && npm run build"}],behavior:"allow",destination:"session"},{type:"addRules",rules:[{toolName:"Bash",ruleContent:"git log --oneline -20 && npm run build"}],behavior:"allow",destination:"projectSettings"}]}),Ee=f({tool_name:"Edit",input:{file_path:"/Users/stan/Dev/project/src/utils/format.ts",old_string:`export function formatDate(d: Date) {
|
|
3
|
-
return d.toISOString();
|
|
4
|
-
}`,new_string:`export function formatDate(d: Date, locale = "en-US") {
|
|
5
|
-
return d.toLocaleDateString(locale, {
|
|
6
|
-
year: "numeric",
|
|
7
|
-
month: "short",
|
|
8
|
-
day: "numeric",
|
|
9
|
-
});
|
|
10
|
-
}`},permission_suggestions:[{type:"addRules",rules:[{toolName:"Edit"}],behavior:"allow",destination:"session"}]}),Re=f({tool_name:"Write",input:{file_path:"/Users/stan/Dev/project/src/config.ts",content:`export const config = {
|
|
11
|
-
apiUrl: "https://api.example.com",
|
|
12
|
-
timeout: 5000,
|
|
13
|
-
retries: 3,
|
|
14
|
-
debug: process.env.NODE_ENV !== "production",
|
|
15
|
-
};
|
|
16
|
-
`}}),Ie=f({tool_name:"Read",input:{file_path:"/Users/stan/Dev/project/package.json"},permission_suggestions:[{type:"addRules",rules:[{toolName:"Read"}],behavior:"allow",destination:"session"},{type:"addRules",rules:[{toolName:"Read"}],behavior:"allow",destination:"userSettings"}]}),Te=f({tool_name:"Glob",input:{pattern:"**/*.test.ts",path:"/Users/stan/Dev/project/src"}}),Me=f({tool_name:"Grep",input:{pattern:"TODO|FIXME|HACK",path:"/Users/stan/Dev/project/src",glob:"*.ts"}}),De=f({tool_name:"ExitPlanMode",input:{plan:`## Summary
|
|
17
|
-
Refactor the authentication module to use JWT tokens instead of session cookies.
|
|
18
|
-
|
|
19
|
-
## Changes
|
|
20
|
-
1. **Add JWT utility** — new \`src/auth/jwt.ts\` with sign/verify helpers
|
|
21
|
-
2. **Update middleware** — modify \`src/middleware/auth.ts\` to validate Bearer tokens
|
|
22
|
-
3. **Migrate login endpoint** — return JWT in response body instead of Set-Cookie
|
|
23
|
-
4. **Update tests** — adapt all auth tests to use token-based flow
|
|
24
|
-
|
|
25
|
-
## Test plan
|
|
26
|
-
- Run \`npm test -- --grep auth\`
|
|
27
|
-
- Manual test with curl`,allowedPrompts:[{tool:"Bash",prompt:"run tests"},{tool:"Bash",prompt:"install dependencies"}]}}),Pe=f({tool_name:"WebSearch",input:{query:"TypeScript 5.5 new features",allowed_domains:["typescriptlang.org","github.com"]},description:"Search the web for TypeScript 5.5 features"}),oe=f({tool_name:"dynamic:code_interpreter",input:{code:"print('hello from dynamic tool')"},description:"Custom tool call: code_interpreter"}),Le=f({tool_name:"Bash",input:{command:"npm install --save-dev @types/react"},ai_validation:{verdict:"uncertain",reason:"Package installation modifies node_modules",ruleBasedOnly:!1}}),Be=f({tool_name:"Bash",input:{command:"git status"},ai_validation:{verdict:"safe",reason:"Read-only git command",ruleBasedOnly:!1}}),Ue=f({tool_name:"Bash",input:{command:"rm -rf node_modules && rm -rf .git"},ai_validation:{verdict:"dangerous",reason:"Recursive delete of project files",ruleBasedOnly:!1}}),Oe=f({tool_name:"Edit",display_name:"File Editor",title:"Edit a TypeScript file",decision_reason:"File is outside trusted directories",input:{file_path:"/workspace/src/app.ts",new_string:"const x = 1;",old_string:"const x = 0;"}}),Ge=f({tool_name:"AskUserQuestion",input:{questions:[{header:"Auth method",question:"Which authentication method should we use for the API?",options:[{label:"JWT tokens (Recommended)",description:"Stateless, scalable, works well with microservices"},{label:"Session cookies",description:"Traditional approach, simpler but requires session storage"},{label:"OAuth 2.0",description:"Delegated auth, best for third-party integrations"}],multiSelect:!1}]}}),We=f({tool_name:"AskUserQuestion",input:{questions:[{header:"Database",question:"Which database should we use?",options:[{label:"PostgreSQL",description:"Relational, strong consistency"},{label:"MongoDB",description:"Document store, flexible schema"}],multiSelect:!1},{header:"Cache",question:"Do you want to add a caching layer?",options:[{label:"Redis",description:"In-memory, fast, supports pub/sub"},{label:"No cache",description:"Keep it simple for now"}],multiSelect:!1}]}}),le={id:"msg-1",role:"user",content:"Can you help me refactor the authentication module to use JWT tokens?",timestamp:Date.now()-6e4},Ve={id:"msg-2",role:"user",content:"Here's a screenshot of the error I'm seeing",attachments:[{name:"screenshot.png",media_type:"image/png",data:"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPj/HwADBwIAMCbHYQAAAABJRU5ErkJggg==",size:70}],timestamp:Date.now()-55e3},de={id:"msg-3",role:"assistant",content:"",contentBlocks:[{type:"text",text:`I'll help you refactor the authentication module. Let me first look at the current implementation.
|
|
28
|
-
|
|
29
|
-
Here's what I found:
|
|
30
|
-
- The current auth uses **session cookies** via \`express-session\`
|
|
31
|
-
- Sessions are stored in a \`MemoryStore\` (not production-ready)
|
|
32
|
-
- The middleware checks \`req.session.userId\`
|
|
33
|
-
|
|
34
|
-
\`\`\`typescript
|
|
35
|
-
// Current implementation
|
|
36
|
-
app.use(session({
|
|
37
|
-
secret: process.env.SESSION_SECRET,
|
|
38
|
-
resave: false,
|
|
39
|
-
saveUninitialized: false,
|
|
40
|
-
}));
|
|
41
|
-
\`\`\`
|
|
42
|
-
|
|
43
|
-
| Feature | Cookies | JWT |
|
|
44
|
-
|---------|---------|-----|
|
|
45
|
-
| Stateless | No | Yes |
|
|
46
|
-
| Scalable | Limited | Excellent |
|
|
47
|
-
| Revocation | Easy | Needs blocklist |
|
|
48
|
-
|
|
49
|
-
Inline code spans carry a copy button and linkify any URL they contain:
|
|
50
|
-
|
|
51
|
-
Faktura PR: \`https://bitbucket.example.local/projects/MCDEV/repos/defaultcollection/pull-requests/6517\`
|
|
52
|
-
|
|
53
|
-
MCAccess PR: \`https://dev.azure.com/MediaConcept/MC.Headquarters/_git/MC.HQ.MCAccess/pullrequest/2522\`
|
|
54
|
-
|
|
55
|
-
Short spans get the same treatment: \`--resume\`, \`package.json\`.
|
|
56
|
-
`}],timestamp:Date.now()-5e4},G={id:"msg-4",role:"assistant",content:"",contentBlocks:[{type:"text",text:"Let me check the current auth files."},{type:"tool_use",id:"tu-1",name:"Glob",input:{pattern:"src/auth/**/*.ts"}},{type:"tool_result",tool_use_id:"tu-1",content:`src/auth/middleware.ts
|
|
57
|
-
src/auth/login.ts
|
|
58
|
-
src/auth/session.ts`},{type:"tool_use",id:"tu-2",name:"Read",input:{file_path:"src/auth/middleware.ts"}},{type:"tool_result",tool_use_id:"tu-2",content:`export function authMiddleware(req, res, next) {
|
|
59
|
-
if (!req.session.userId) {
|
|
60
|
-
return res.status(401).json({ error: "Unauthorized" });
|
|
61
|
-
}
|
|
62
|
-
next();
|
|
63
|
-
}`},{type:"text",text:"Now I understand the current structure. Let me create the JWT utility."}],timestamp:Date.now()-45e3},se={id:"msg-5",role:"assistant",content:"",contentBlocks:[{type:"thinking",thinking:`Let me think about the best approach here. The user wants to migrate from session cookies to JWT. I need to:
|
|
64
|
-
1. Create a JWT sign/verify utility
|
|
65
|
-
2. Update the middleware to read Authorization header
|
|
66
|
-
3. Change the login endpoint to return a token
|
|
67
|
-
4. Update all tests
|
|
68
|
-
|
|
69
|
-
I should use jsonwebtoken package for signing and jose for verification in edge environments. But since this is a Node.js server, jsonwebtoken is fine.
|
|
70
|
-
|
|
71
|
-
The token should contain: userId, role, iat, exp. Expiry should be configurable. I'll also add a refresh token mechanism.`},{type:"text",text:"I've analyzed the codebase and have a clear plan. Let me start implementing."}],timestamp:Date.now()-4e4},ze={id:"msg-streaming",role:"assistant",content:"Scanning auth files and drafting migration steps...",isStreaming:!0,timestamp:Date.now()-35e3},Fe={id:"msg-streaming-thinking",role:"assistant",content:"Let me analyze the codebase to understand the authentication architecture. I should look at the middleware, session store, and token validation...",isStreaming:!0,streamingPhase:"thinking",timestamp:Date.now()-34e3},qe={id:"msg-streaming-empty",role:"assistant",content:"",isStreaming:!0,timestamp:Date.now()-33e3},He={id:"msg-meta-interrupted",role:"system",content:"Response interrupted — the backend disconnected before finishing. Trying to reconnect…",meta:!0,metaCode:"interrupted_mid_stream",timestamp:Date.now()-3e4},$e={id:"msg-6",role:"system",content:"Context compacted successfully",timestamp:Date.now()-3e4},te={id:"msg-7",role:"assistant",content:"",contentBlocks:[{type:"text",text:"Let me try running the tests."},{type:"tool_use",id:"tu-3",name:"Bash",input:{command:"npm test -- --grep auth"}},{type:"tool_result",tool_use_id:"tu-3",content:`FAIL src/auth/__tests__/middleware.test.ts
|
|
72
|
-
● Auth Middleware › should reject expired tokens
|
|
73
|
-
Expected: 401
|
|
74
|
-
Received: 500
|
|
75
|
-
|
|
76
|
-
TypeError: Cannot read property 'verify' of undefined`,is_error:!0},{type:"text",text:"There's a test failure. Let me fix the issue."}],timestamp:Date.now()-2e4},me={id:"msg-empty-thinking",role:"assistant",content:"",contentBlocks:[{type:"thinking",thinking:" "},{type:"tool_use",id:"tu-density-1",name:"Bash",input:{command:`PGPASSWORD=secret docker exec pg psql -U app -d app_db -tAc "select version_num from alembic_version"
|
|
77
|
-
echo '--- create scratch:'
|
|
78
|
-
docker exec pg psql -U app -d postgres -c "CREATE DATABASE scratch"`,description:"Check dev DB alembic state, create scratch DB"}},{type:"tool_result",tool_use_id:"tu-density-1",content:Array.from({length:24},(t,c)=>`migration line ${c+1}`).join(`
|
|
79
|
-
`)}],timestamp:Date.now()-18e3},Ke={id:"msg-empty-thinking-streaming",role:"assistant",content:"",isStreaming:!0,contentBlocks:[{type:"thinking",thinking:""}],timestamp:Date.now()-17e3},pe=[{id:"1",subject:"Create JWT utility module",description:"",status:"completed"},{id:"2",subject:"Update auth middleware",description:"",status:"completed",activeForm:"Updating auth middleware"},{id:"3",subject:"Migrate login endpoint",description:"",status:"in_progress",activeForm:"Refactoring login to return JWT"},{id:"4",subject:"Add refresh token support",description:"",status:"pending"},{id:"5",subject:"Update all auth tests",description:"",status:"pending",blockedBy:["3"]},{id:"6",subject:"Run full test suite and fix failures",description:"",status:"pending",blockedBy:["5"]}],Je=[{id:"tg-1",name:"Read",input:{file_path:"src/auth/middleware.ts"}},{id:"tg-2",name:"Read",input:{file_path:"src/auth/login.ts"}},{id:"tg-3",name:"Read",input:{file_path:"src/auth/session.ts"}},{id:"tg-4",name:"Read",input:{file_path:"src/auth/types.ts"}}],Ye=[{id:"sa-1",name:"Grep",input:{pattern:"useAuth",path:"src/"}},{id:"sa-2",name:"Grep",input:{pattern:"session.userId",path:"src/"}}],Qe=[{toolUseId:"ta-1",toolName:"Bash",preview:"bun run test",startedAt:Date.now()-7200,completedAt:Date.now()-400,elapsedSeconds:6.8,isError:!1},{toolUseId:"ta-2",toolName:"Read",preview:"src/ws.ts",startedAt:Date.now()-500,completedAt:Date.now()-400,elapsedSeconds:.1,isError:!1},{toolUseId:"ta-3",toolName:"Edit",preview:"src/ws.ts",startedAt:Date.now()-400,completedAt:Date.now()-100,elapsedSeconds:1.4,isError:!1}],Xe=[{toolUseId:"ta-4",toolName:"Bash",preview:"npm run build",startedAt:Date.now()-5e3,completedAt:Date.now()-1e3,elapsedSeconds:4,isError:!0},{toolUseId:"ta-5",toolName:"Read",preview:"package.json",startedAt:Date.now()-900,completedAt:Date.now()-800,elapsedSeconds:.1,isError:!1}],Ze=[{toolUseId:"ta-6",toolName:"Bash",preview:"bun run test",startedAt:Date.now()-3e3,elapsedSeconds:3,isError:!1},{toolUseId:"ta-7",toolName:"Grep",preview:"TODO",startedAt:Date.now()-1e3,completedAt:Date.now()-500,elapsedSeconds:.5,isError:!1}],es={number:162,title:"feat: add dark mode toggle to application settings",url:"https://github.com/example/project/pull/162",state:"OPEN",isDraft:!1,reviewDecision:"CHANGES_REQUESTED",additions:91,deletions:88,changedFiles:24,checks:[{name:"CI / Build",status:"COMPLETED",conclusion:"SUCCESS"},{name:"CI / Test",status:"COMPLETED",conclusion:"FAILURE"},{name:"CI / Lint",status:"COMPLETED",conclusion:"SUCCESS"}],checksSummary:{total:3,success:2,failure:1,pending:0},reviewThreads:{total:4,resolved:2,unresolved:2}},ss={number:158,title:"fix: prevent mobile keyboard layout shift and iOS zoom",url:"https://github.com/example/project/pull/158",state:"OPEN",isDraft:!1,reviewDecision:"APPROVED",additions:42,deletions:12,changedFiles:3,checks:[{name:"CI / Build",status:"COMPLETED",conclusion:"SUCCESS"},{name:"CI / Test",status:"COMPLETED",conclusion:"SUCCESS"}],checksSummary:{total:2,success:2,failure:0,pending:0},reviewThreads:{total:1,resolved:1,unresolved:0}},ts={number:165,title:"refactor: migrate auth module to JWT tokens with refresh support",url:"https://github.com/example/project/pull/165",state:"OPEN",isDraft:!0,reviewDecision:null,additions:340,deletions:156,changedFiles:18,checks:[{name:"CI / Build",status:"IN_PROGRESS",conclusion:null},{name:"CI / Test",status:"QUEUED",conclusion:null}],checksSummary:{total:2,success:0,failure:0,pending:2},reviewThreads:{total:0,resolved:0,unresolved:0}},ns={number:155,title:"feat(cli): add service install/uninstall and separate dev/prod ports",url:"https://github.com/example/project/pull/155",state:"MERGED",isDraft:!1,reviewDecision:"APPROVED",additions:287,deletions:63,changedFiles:11,checks:[{name:"CI / Build",status:"COMPLETED",conclusion:"SUCCESS"},{name:"CI / Test",status:"COMPLETED",conclusion:"SUCCESS"},{name:"CI / Lint",status:"COMPLETED",conclusion:"SUCCESS"}],checksSummary:{total:3,success:3,failure:0,pending:0},reviewThreads:{total:3,resolved:3,unresolved:0}},rs=[{name:"filesystem",status:"connected",config:{type:"stdio",command:"npx",args:["-y","@anthropic/mcp-fs"]},scope:"project",tools:[{name:"read_file",annotations:{readOnly:!0}},{name:"write_file",annotations:{destructive:!0}},{name:"list_directory",annotations:{readOnly:!0}}]},{name:"github",status:"connected",config:{type:"stdio",command:"npx",args:["-y","@anthropic/mcp-github"]},scope:"user",tools:[{name:"create_issue"},{name:"list_prs",annotations:{readOnly:!0}},{name:"create_pr"}]},{name:"postgres",status:"failed",error:"Connection refused: ECONNREFUSED 127.0.0.1:5432",config:{type:"stdio",command:"npx",args:["-y","@anthropic/mcp-postgres"]},scope:"project",tools:[]},{name:"web-search",status:"disabled",config:{type:"sse",url:"http://localhost:8080/sse"},scope:"user",tools:[{name:"search",annotations:{readOnly:!0,openWorld:!0}}]},{name:"docker",status:"connecting",config:{type:"stdio",command:"docker-mcp-server"},scope:"project",tools:[]}],T={identifier:"THE-147",title:"Associer un ticket Linear a une session dans le panneau lateral droit",priorityLabel:"High",stateName:"In Progress",teamName:"Thevibecompany"},M={identifier:"ENG-256",title:"Fix authentication flow for SSO users",priorityLabel:"Urgent",stateName:"Done",teamName:"Engineering"},as=[{id:"c1",body:"Started working on the sidebar integration",createdAt:new Date(Date.now()-36e5).toISOString(),userName:"Alice"},{id:"c2",body:"Added the search component, LGTM",createdAt:new Date(Date.now()-18e5).toISOString(),userName:"Bob"},{id:"c3",body:"Testing the polling flow now",createdAt:new Date(Date.now()-3e5).toISOString(),userName:"Alice"}];function js(){const[t,c]=x.useState(()=>document.documentElement.classList.contains("dark"));return x.useEffect(()=>{document.documentElement.classList.toggle("dark",t)},[t]),x.useEffect(()=>{const n=b.getState(),i=b.getState(),r=j,m=i.sessions.get(r),o=i.messages.get(r),g=i.pendingPermissions.get(r),l=i.connectionStatus.get(r),p=i.cliConnected.get(r),a=i.sessionStatus.get(r),y=i.streaming.get(r),N=i.streamingStartedAt.get(r),u=i.streamingOutputTokens.get(r),D={session_id:r,backend_type:"claude",model:"claude-sonnet-4-5",cwd:"/Users/stan/Dev/project",tools:["Bash","Read","Edit","Write","Glob","Grep","WebSearch"],permissionMode:"default",claude_code_version:"1.0.0",mcp_servers:[],agents:[],slash_commands:["explain","review","fix"],skills:["doc-coauthoring","frontend-design"],total_cost_usd:.1847,num_turns:14,context_used_percent:62,is_compacting:!1,git_branch:"feat/jwt-auth",is_worktree:!1,is_containerized:!0,repo_root:"/Users/stan/Dev/project",git_ahead:3,git_behind:0,total_lines_added:142,total_lines_removed:38};n.addSession(D),n.setConnectionStatus(r,"connected"),n.setCliConnected(r,!0),n.setSessionStatus(r,"running");const re="I'm updating tests and then I'll run the full suite.";return n.setMessages(r,[le,de,G,te,{id:"stream-draft",role:"assistant",content:re,timestamp:Date.now(),isStreaming:!0}]),n.setStreaming(r,re),n.setStreamingStats(r,{startedAt:Date.now()-12e3,outputTokens:1200}),n.addPermission(r,ce),n.addPermission(r,oe),()=>{b.setState(k=>{const V=new Map(k.sessions),z=new Map(k.messages),F=new Map(k.pendingPermissions),q=new Map(k.connectionStatus),H=new Map(k.cliConnected),$=new Map(k.sessionStatus),K=new Map(k.streaming),J=new Map(k.streamingStartedAt),Y=new Map(k.streamingOutputTokens);return m?V.set(r,m):V.delete(r),o?z.set(r,o):z.delete(r),g?F.set(r,g):F.delete(r),l?q.set(r,l):q.delete(r),typeof p=="boolean"?H.set(r,p):H.delete(r),a?$.set(r,a):$.delete(r),typeof y=="string"?K.set(r,y):K.delete(r),typeof N=="number"?J.set(r,N):J.delete(r),typeof u=="number"?Y.set(r,u):Y.delete(r),{sessions:V,messages:z,pendingPermissions:F,connectionStatus:q,cliConnected:H,sessionStatus:$,streaming:K,streamingStartedAt:J,streamingOutputTokens:Y}})}},[]),e.jsxs("div",{className:"fixed inset-0 bg-cc-bg text-cc-fg font-sans-ui overflow-y-auto",children:[e.jsx("header",{className:"sticky top-0 z-50 bg-cc-sidebar border-b border-cc-border",children:e.jsxs("div",{className:"max-w-5xl mx-auto px-6 py-4 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-semibold text-cc-fg tracking-tight",children:"Component Playground"}),e.jsx("p",{className:"text-xs text-cc-muted mt-0.5",children:"Visual catalog of all UI components"})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>{const n=b.getState().currentSessionId;n?ge(n):be()},className:"px-3 py-1.5 text-xs font-medium rounded-lg bg-cc-hover hover:bg-cc-active text-cc-fg border border-cc-border transition-colors cursor-pointer",children:"Back to App"}),e.jsx("button",{onClick:()=>c(!t),className:"px-3 py-1.5 text-xs font-medium rounded-lg bg-cc-primary/10 hover:bg-cc-primary/20 text-cc-primary border border-cc-primary/20 transition-colors cursor-pointer",children:t?"Light Mode":"Dark Mode"})]})]})}),e.jsxs("div",{className:"max-w-5xl mx-auto px-6 py-8 space-y-12",children:[e.jsx(d,{title:"Permission Banners",description:"Tool approval requests shown above the composer",children:e.jsxs("div",{className:"border border-cc-border rounded-xl overflow-hidden bg-cc-card divide-y divide-cc-border",children:[e.jsx(v,{permission:ce,sessionId:j}),e.jsx(v,{permission:Ee,sessionId:j}),e.jsx(v,{permission:Re,sessionId:j}),e.jsx(v,{permission:Ie,sessionId:j}),e.jsx(v,{permission:Te,sessionId:j}),e.jsx(v,{permission:Me,sessionId:j}),e.jsx(v,{permission:Pe,sessionId:j}),e.jsx(v,{permission:oe,sessionId:j}),e.jsx(v,{permission:Oe,sessionId:j})]})}),e.jsx(d,{title:"MagicUI Dashboard",description:"Sandboxed iframe runtime fed a canned dashboard snapshot + a live decision prompt (fully interactive in-browser)",children:e.jsx(ls,{})}),e.jsx(d,{title:"Real Chat Stack",description:"Integrated ChatView using real MessageFeed + PermissionBanner + Composer components",children:e.jsx("div",{"data-testid":"playground-real-chat-stack",className:"max-w-3xl border border-cc-border rounded-xl overflow-hidden bg-cc-card h-[620px]",children:e.jsx(fe,{sessionId:j})})}),e.jsx(d,{title:"ExitPlanMode",description:"Plan approval request — previously rendered as raw JSON, now shows formatted markdown",children:e.jsx("div",{className:"border border-cc-border rounded-xl overflow-hidden bg-cc-card",children:e.jsx(v,{permission:De,sessionId:j})})}),e.jsx(d,{title:"AskUserQuestion",description:"Interactive questions with selectable options",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(s,{label:"Single question",children:e.jsx(v,{permission:Ge,sessionId:j})}),e.jsx(s,{label:"Multi-question",children:e.jsx(v,{permission:We,sessionId:j})})]})}),e.jsx(d,{title:"AI Validation",description:"AI-powered permission validation badges and recommendations",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(s,{label:"Permission with AI recommendation (uncertain)",children:e.jsx(v,{permission:Le,sessionId:j})}),e.jsx(s,{label:"Permission with AI recommendation (safe)",children:e.jsx(v,{permission:Be,sessionId:j})}),e.jsx(s,{label:"Permission with AI recommendation (dangerous)",children:e.jsx(v,{permission:Ue,sessionId:j})}),e.jsx(s,{label:"Per-session toggle (disabled)",children:e.jsx(he,{enabled:!1})}),e.jsx(s,{label:"Per-session toggle (enabled)",children:e.jsx(he,{enabled:!0})}),e.jsx(s,{label:"Auto-resolved badge (with dismiss)",children:e.jsx("div",{className:"border border-cc-border rounded-xl overflow-hidden bg-cc-card",children:e.jsx(Q,{entry:{request:f({tool_name:"Read",input:{file_path:"/src/index.ts"}}),behavior:"allow",reason:"Read is a read-only tool",timestamp:Date.now()},onDismiss:()=>alert("Dismissed!")})})}),e.jsx(s,{label:"Auto-resolved badge (denied, with dismiss)",children:e.jsx("div",{className:"border border-cc-border rounded-xl overflow-hidden bg-cc-card",children:e.jsx(Q,{entry:{request:f({tool_name:"Bash",input:{command:"rm -rf /"}}),behavior:"deny",reason:"Recursive delete of root directory",timestamp:Date.now()},onDismiss:()=>alert("Dismissed!")})})}),e.jsx(s,{label:"Auto-resolved badge (no dismiss)",children:e.jsx("div",{className:"border border-cc-border rounded-xl overflow-hidden bg-cc-card",children:e.jsx(Q,{entry:{request:f({tool_name:"Grep",input:{pattern:"TODO",path:"/src"}}),behavior:"allow",reason:"Grep is a read-only tool",timestamp:Date.now()}})})})]})}),e.jsx(d,{title:"Messages",description:"Chat message bubbles for all roles",children:e.jsxs("div",{className:"space-y-4 max-w-3xl",children:[e.jsx(s,{label:"User message",children:e.jsx(h,{message:le})}),e.jsx(s,{label:"User message with image",children:e.jsx(h,{message:Ve})}),e.jsx(s,{label:"Assistant message (markdown)",children:e.jsx(h,{message:de})}),e.jsx(s,{label:"Assistant message (with tool calls)",children:e.jsx(h,{message:G})}),e.jsx(s,{label:"Assistant message (streaming)",children:e.jsx(h,{message:ze})}),e.jsx(s,{label:"Assistant message (streaming thinking phase)",children:e.jsx(h,{message:Fe})}),e.jsx(s,{label:"Assistant message (empty streaming draft — lone sparkle)",children:e.jsx(h,{message:qe})}),e.jsx(s,{label:"Assistant message (thinking block)",children:e.jsx(h,{message:se})}),e.jsx(s,{label:"Tool result with error",children:e.jsx(h,{message:te})}),e.jsx(s,{label:"Meta notice (interruption / synthetic no-op)",children:e.jsx(h,{message:He})}),e.jsx(s,{label:"System message",children:e.jsx(h,{message:$e})})]})}),e.jsx(d,{title:"Message density",description:"Standard (default) vs compact — set in Settings → General. Compact collapses commands, diffs and output to one expandable line and hides empty thinking steps.",children:e.jsxs("div",{className:"grid gap-4 lg:grid-cols-2 max-w-6xl",children:[e.jsx(s,{label:"Standard — empty thinking + command + output",children:e.jsx(_,{value:"standard",children:e.jsx(h,{message:me})})}),e.jsx(s,{label:"Compact — empty thinking + command + output",children:e.jsx(_,{value:"compact",children:e.jsx(h,{message:me})})}),e.jsx(s,{label:"Standard — thinking block",children:e.jsx(_,{value:"standard",children:e.jsx(h,{message:se})})}),e.jsx(s,{label:"Compact — thinking clamped to two lines",children:e.jsx(_,{value:"compact",children:e.jsx(h,{message:se})})}),e.jsx(s,{label:"Standard — edit diff",children:e.jsx(_,{value:"standard",children:e.jsx(h,{message:G})})}),e.jsx(s,{label:"Compact — edit diff collapsed",children:e.jsx(_,{value:"compact",children:e.jsx(h,{message:G})})}),e.jsx(s,{label:"Compact — streaming with only an empty thinking block",children:e.jsx(_,{value:"compact",children:e.jsx(h,{message:Ke})})}),e.jsx(s,{label:"Compact — error output",children:e.jsx(_,{value:"compact",children:e.jsx(h,{message:te})})})]})}),e.jsx(d,{title:"Tool Blocks",description:"Expandable tool call visualization",children:e.jsxs("div",{className:"space-y-2 max-w-3xl",children:[e.jsx(w,{name:"Bash",input:{command:"git status && npm run lint",description:"Check git status and lint"},toolUseId:"tb-1"}),e.jsx(w,{name:"Read",input:{file_path:"/Users/stan/Dev/project/src/index.ts",offset:10,limit:50},toolUseId:"tb-2"}),e.jsx(w,{name:"Edit",input:{file_path:"src/utils.ts",old_string:"const x = 1;",new_string:"const x = 2;",replace_all:!0},toolUseId:"tb-3"}),e.jsx(w,{name:"Edit",input:{file_path:"/Users/stan/Dev/project/src/store.ts",changes:[{path:"/Users/stan/Dev/project/src/store.ts",kind:"update"},{path:"/Users/stan/Dev/project/src/ws.ts",kind:"update"}]},toolUseId:"tb-3b"}),e.jsx(w,{name:"Write",input:{file_path:"src/new-file.ts",content:`export const hello = "world";
|
|
80
|
-
`},toolUseId:"tb-4"}),e.jsx(w,{name:"Glob",input:{pattern:"**/*.tsx",path:"/Users/stan/Dev/project/src"},toolUseId:"tb-5"}),e.jsx(w,{name:"Grep",input:{pattern:"useEffect",path:"src/",glob:"*.tsx",output_mode:"content",context:3,head_limit:20},toolUseId:"tb-6"}),e.jsx(w,{name:"WebSearch",input:{query:"React 19 new features",allowed_domains:["react.dev","github.com"]},toolUseId:"tb-7"}),e.jsx(w,{name:"WebFetch",input:{url:"https://react.dev/blog/2024/12/05/react-19",prompt:"Summarize the key changes in React 19"},toolUseId:"tb-8"}),e.jsx(w,{name:"Task",input:{description:"Search for auth patterns",subagent_type:"Explore",prompt:"Find all files related to authentication and authorization in the codebase. Look for middleware, guards, and token handling."},toolUseId:"tb-9"}),e.jsx(w,{name:"TodoWrite",input:{todos:[{content:"Create JWT utility module",status:"completed",activeForm:"Creating JWT module"},{content:"Update auth middleware",status:"in_progress",activeForm:"Updating middleware"},{content:"Migrate login endpoint",status:"pending",activeForm:"Migrating login"},{content:"Run full test suite",status:"pending",activeForm:"Running tests"}]},toolUseId:"tb-10"}),e.jsx(w,{name:"NotebookEdit",input:{notebook_path:"/Users/stan/Dev/project/analysis.ipynb",cell_type:"code",edit_mode:"replace",cell_number:3,new_source:`import pandas as pd
|
|
81
|
-
df = pd.read_csv('data.csv')
|
|
82
|
-
df.describe()`},toolUseId:"tb-11"}),e.jsx(w,{name:"SendMessage",input:{type:"message",recipient:"researcher",content:"Please investigate the auth module structure and report back.",summary:"Requesting auth module investigation"},toolUseId:"tb-12"})]})}),e.jsx(d,{title:"Tool Progress",description:"Real-time progress indicator shown while tools are running",children:e.jsxs("div",{className:"space-y-4 max-w-3xl",children:[e.jsx(s,{label:"Single tool running",children:e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-cc-muted font-mono-code pl-9",children:[e.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-cc-primary animate-pulse"}),e.jsx("span",{children:"Terminal"}),e.jsx("span",{className:"text-cc-muted/60",children:"8s"})]})}),e.jsx(s,{label:"Multiple tools running",children:e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-cc-muted font-mono-code pl-9",children:[e.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-cc-primary animate-pulse"}),e.jsx("span",{children:"Search Content"}),e.jsx("span",{className:"text-cc-muted/60",children:"3s"}),e.jsx("span",{className:"text-cc-muted/40",children:"·"}),e.jsx("span",{children:"Find Files"}),e.jsx("span",{className:"text-cc-muted/60",children:"2s"})]})})]})}),e.jsx(d,{title:"Compacting Context",description:"Spinner shown in the message feed when Claude Code is compacting context",children:e.jsx("div",{className:"space-y-4 max-w-3xl",children:e.jsx(s,{label:"Compacting indicator",children:e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-cc-warning font-mono-code pl-9",children:[e.jsxs("svg",{className:"w-3 h-3 animate-spin shrink-0",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("circle",{cx:"8",cy:"8",r:"6",opacity:"0.25"}),e.jsx("path",{d:"M8 2a6 6 0 0 1 6 6",strokeLinecap:"round"})]}),e.jsx("span",{children:"Compacting context..."})]})})})}),e.jsx(d,{title:"Tool Use Summary",description:"System message summarizing batch tool execution",children:e.jsx("div",{className:"space-y-4 max-w-3xl",children:e.jsx(s,{label:"Summary as system message",children:e.jsx(h,{message:{id:"summary-1",role:"system",content:"Read 4 files, searched 12 matches across 3 directories",timestamp:Date.now()}})})})}),e.jsx(d,{title:"Interesting Events",description:"Event summaries that are worth surfacing in the chat feed",children:e.jsxs("div",{className:"space-y-4 max-w-3xl",children:[e.jsx(s,{label:"Context compacted",children:e.jsx(h,{message:{id:"event-compact",role:"system",content:"Context compacted (auto, pre-tokens: 182344).",timestamp:Date.now()}})}),e.jsx(s,{label:"Background task completed",children:e.jsx(h,{message:{id:"event-task",role:"system",content:"Task completed: a1b2c3d.",timestamp:Date.now()}})}),e.jsx(s,{label:"Background task completed (long report, collapsible)",children:e.jsx(h,{message:{id:"event-task-detail",role:"system",content:"Task completed: a3413b566f10512a6.",metaCode:"task_notification",detail:'Done. Committed as `75ac143` on `feature/pricing-signal-push` (worktree `/srv/mc-agent/mcp-pricing-push`), branched off `origin/main` at `b060f64`). Not pushed. No migration.\n\n## Files\n- `backend/app/config.py` — `PRICING_PUSH_ENABLED` (False), `PRICING_API_BASE_URL` (""), `PRICING_API_KEY` ("").\n- `backend/app/services/pricing_push/signals.py` — pure query functions per signal type + `collect_signals()`.\n\n## Test results\n**25 passed**. `ruff check` clean on all touched files.',timestamp:Date.now()}})}),e.jsx(s,{label:"Files persisted",children:e.jsx(h,{message:{id:"event-files",role:"system",content:"Persisted 3 file(s).",timestamp:Date.now()}})}),e.jsx(s,{label:"Hook outcome",children:e.jsx(h,{message:{id:"event-hook",role:"system",content:"Hook success: lint (post_tool_use) (exit 0).",timestamp:Date.now()}})})]})}),e.jsx(d,{title:"Tasks",description:"Task list states: pending, in progress, completed, blocked",children:e.jsxs("div",{className:"w-[280px] border border-cc-border rounded-xl overflow-hidden bg-cc-card",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-cc-border space-y-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[11px] text-cc-muted uppercase tracking-wider",children:"Cost"}),e.jsx("span",{className:"text-[13px] font-medium text-cc-fg tabular-nums",children:"$0.1847"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[11px] text-cc-muted uppercase tracking-wider",children:"Context"}),e.jsx("span",{className:"text-[11px] text-cc-muted tabular-nums",children:"62%"})]}),e.jsx("div",{className:"w-full h-1.5 rounded-full bg-cc-hover overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-cc-warning transition-all duration-500",style:{width:"62%"}})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[11px] text-cc-muted uppercase tracking-wider",children:"Turns"}),e.jsx("span",{className:"text-[13px] font-medium text-cc-fg tabular-nums",children:"14"})]})]}),e.jsxs("div",{className:"px-4 py-2.5 border-b border-cc-border flex items-center justify-between",children:[e.jsx("span",{className:"text-[12px] font-semibold text-cc-fg",children:"Tasks"}),e.jsxs("span",{className:"text-[11px] text-cc-muted tabular-nums",children:["2/",pe.length]})]}),e.jsx("div",{className:"px-3 py-2 space-y-0.5",children:pe.map(n=>e.jsx(hs,{task:n},n.id))})]})}),e.jsx(d,{title:"GitHub PR Status",description:"PR health shown in the TaskPanel — checks, reviews, unresolved comments",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(s,{label:"Open PR — failing checks + changes requested",children:e.jsx("div",{className:"w-[280px] border border-cc-border rounded-xl overflow-hidden bg-cc-card",children:e.jsx(P,{pr:es})})}),e.jsx(s,{label:"Open PR — all checks passed + approved",children:e.jsx("div",{className:"w-[280px] border border-cc-border rounded-xl overflow-hidden bg-cc-card",children:e.jsx(P,{pr:ss})})}),e.jsx(s,{label:"Draft PR — pending checks",children:e.jsx("div",{className:"w-[280px] border border-cc-border rounded-xl overflow-hidden bg-cc-card",children:e.jsx(P,{pr:ts})})}),e.jsx(s,{label:"Merged PR",children:e.jsx("div",{className:"w-[280px] border border-cc-border rounded-xl overflow-hidden bg-cc-card",children:e.jsx(P,{pr:ns})})})]})}),e.jsx(d,{title:"Linear Issue (TaskPanel)",description:"Linear issue linked to a session — displayed in TaskPanel with status, comments, and actions",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(s,{label:"Active issue — In Progress with comments",children:e.jsxs("div",{className:"w-[280px] border border-cc-border rounded-xl overflow-hidden bg-cc-card",children:[e.jsxs("div",{className:"px-4 py-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(X,{className:"w-3.5 h-3.5 text-cc-muted shrink-0"}),e.jsx("span",{className:"text-[12px] font-semibold text-cc-fg font-mono-code",children:T.identifier}),e.jsx("span",{className:"text-[9px] font-medium px-1.5 rounded-full leading-[16px] text-blue-400 bg-blue-400/10",children:T.stateName}),e.jsx("button",{className:"ml-auto flex items-center justify-center w-5 h-5 rounded text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer",title:"Unlink",children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3 h-3",children:e.jsx("path",{d:"M4 4l8 8M12 4l-8 8"})})})]}),e.jsx("p",{className:"text-[11px] text-cc-muted truncate",children:T.title}),e.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-cc-muted",children:[e.jsx("span",{children:T.priorityLabel}),e.jsx("span",{children:"·"}),e.jsx("span",{children:T.teamName}),e.jsx("span",{children:"·"}),e.jsx("span",{children:"@ Alice"})]}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-full",style:{backgroundColor:"#bb87fc20",color:"#bb87fc"},children:"feature"}),e.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded-full",style:{backgroundColor:"#f2994a20",color:"#f2994a"},children:"frontend"})]})]}),e.jsxs("div",{className:"px-4 py-2 border-t border-cc-border space-y-1.5 max-h-36 overflow-y-auto",children:[e.jsx("span",{className:"text-[10px] text-cc-muted uppercase tracking-wider",children:"Comments"}),as.map(n=>e.jsxs("div",{className:"text-[11px]",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"font-medium text-cc-fg",children:n.userName}),e.jsx("span",{className:"text-[9px] text-cc-muted",children:"just now"})]}),e.jsx("p",{className:"text-cc-muted line-clamp-2",children:n.body})]},n.id))]}),e.jsxs("div",{className:"px-4 py-2 border-t border-cc-border flex items-center gap-1.5",children:[e.jsx("input",{type:"text",placeholder:"Add a comment...",className:"flex-1 text-[11px] bg-transparent border border-cc-border rounded-md px-2 py-1.5 text-cc-fg placeholder:text-cc-muted focus:outline-none focus:border-cc-primary/50"}),e.jsx("button",{className:"flex items-center justify-center w-6 h-6 rounded text-cc-primary cursor-pointer",children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3.5 h-3.5",children:e.jsx("path",{d:"M1.724 1.053a.5.5 0 0 0-.714.545l1.403 4.85a.5.5 0 0 0 .397.354l5.19.736-5.19.737a.5.5 0 0 0-.397.353L1.01 13.48a.5.5 0 0 0 .714.545l13-6.5a.5.5 0 0 0 0-.894l-13-6.5z"})})})]})]})}),e.jsx(s,{label:"Completed issue — Done warning banner",children:e.jsxs("div",{className:"w-[280px] border border-cc-border rounded-xl overflow-hidden bg-cc-card",children:[e.jsxs("div",{className:"px-4 py-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(X,{className:"w-3.5 h-3.5 text-cc-muted shrink-0"}),e.jsx("span",{className:"text-[12px] font-semibold text-cc-fg font-mono-code",children:M.identifier}),e.jsx("span",{className:"text-[9px] font-medium px-1.5 rounded-full leading-[16px] text-cc-success bg-cc-success/10",children:M.stateName})]}),e.jsx("p",{className:"text-[11px] text-cc-muted truncate",children:M.title}),e.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-cc-muted",children:[e.jsx("span",{children:M.priorityLabel}),e.jsx("span",{children:"·"}),e.jsx("span",{children:M.teamName})]})]}),e.jsxs("div",{className:"px-4 py-2 bg-cc-success/10 border-t border-cc-success/20 flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[11px] text-cc-success font-medium",children:"Issue completed"}),e.jsx("p",{className:"text-[10px] text-cc-success/80",children:"Ticket moved to done."})]}),e.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[e.jsx("button",{className:"text-[10px] text-cc-muted hover:text-cc-fg px-1.5 py-0.5 rounded cursor-pointer",children:"Dismiss"}),e.jsx("button",{className:"text-[10px] text-cc-success font-medium px-2 py-0.5 rounded bg-cc-success/20 hover:bg-cc-success/30 cursor-pointer",children:"Close session"})]})]})]})}),e.jsx(s,{label:"No linked issue — Link button",children:e.jsx("div",{className:"w-[280px] border border-cc-border rounded-xl overflow-hidden bg-cc-card",children:e.jsx("div",{className:"shrink-0 px-4 py-3 border-b border-cc-border",children:e.jsxs("button",{className:"flex items-center gap-1.5 text-[11px] text-cc-muted hover:text-cc-fg transition-colors cursor-pointer",children:[e.jsx(X,{className:"w-3.5 h-3.5"}),"Link Linear issue"]})})})})]})}),e.jsx(d,{title:"MCP Servers",description:"MCP server status display with toggle, reconnect, and tool listing",children:e.jsx("div",{className:"space-y-4",children:e.jsx(s,{label:"All server states (connected, failed, disabled, connecting)",children:e.jsxs("div",{className:"w-[280px] border border-cc-border rounded-xl overflow-hidden bg-cc-card",children:[e.jsxs("div",{className:"shrink-0 px-4 py-2.5 border-b border-cc-border flex items-center justify-between",children:[e.jsxs("span",{className:"text-[12px] font-semibold text-cc-fg flex items-center gap-1.5",children:[e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3.5 h-3.5 text-cc-muted",children:e.jsx("path",{d:"M1.5 3A1.5 1.5 0 013 1.5h10A1.5 1.5 0 0114.5 3v1A1.5 1.5 0 0113 5.5H3A1.5 1.5 0 011.5 4V3zm0 5A1.5 1.5 0 013 6.5h10A1.5 1.5 0 0114.5 8v1A1.5 1.5 0 0113 10.5H3A1.5 1.5 0 011.5 9V8zm0 5A1.5 1.5 0 013 11.5h10a1.5 1.5 0 011.5 1.5v1a1.5 1.5 0 01-1.5 1.5H3A1.5 1.5 0 011.5 14v-1z"})}),"MCP Servers"]}),e.jsx("span",{className:"text-[11px] text-cc-muted",children:e.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:[e.jsx("path",{d:"M2.5 8a5.5 5.5 0 019.78-3.5M13.5 8a5.5 5.5 0 01-9.78 3.5",strokeLinecap:"round"}),e.jsx("path",{d:"M12.5 2v3h-3M3.5 14v-3h3",strokeLinecap:"round",strokeLinejoin:"round"})]})})]}),e.jsx("div",{className:"px-3 py-2 space-y-1.5",children:rs.map(n=>e.jsx(us,{server:n},n.name))})]})})})}),e.jsx(d,{title:"Panel Config View",description:"Inline configuration for the right sidebar — toggle sections on/off and reorder them",children:e.jsx("div",{className:"space-y-4",children:e.jsx(s,{label:"Config mode with mixed enabled/disabled sections",children:e.jsxs("div",{className:"w-[320px] border border-cc-border rounded-xl overflow-hidden bg-cc-card",children:[e.jsxs("div",{className:"shrink-0 flex items-center justify-between px-4 py-3 border-b border-cc-border",children:[e.jsx("span",{className:"text-sm font-semibold text-cc-fg tracking-tight",children:"Panel Settings"}),e.jsx("button",{className:"flex items-center justify-center w-6 h-6 rounded-lg text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer",children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5",children:e.jsx("path",{d:"M4 4l8 8M12 4l-8 8"})})})]}),e.jsx("div",{className:"px-3 py-3 space-y-1",children:[{id:"git-branch",label:"Git Branch",desc:"Current branch, ahead/behind, and line changes",enabled:!0},{id:"usage-limits",label:"Usage Limits",desc:"API usage and rate limit meters",enabled:!0},{id:"github-pr",label:"GitHub PR",desc:"Pull request status, CI checks, and reviews",enabled:!1},{id:"linear-issue",label:"Linear Issue",desc:"Linked Linear ticket and comments",enabled:!0},{id:"mcp-servers",label:"MCP Servers",desc:"Model Context Protocol server connections",enabled:!1},{id:"tasks",label:"Tasks",desc:"Agent task list and progress",enabled:!0}].map((n,i,r)=>e.jsxs("div",{className:`flex items-center gap-2 px-2.5 py-2 rounded-lg border border-cc-border transition-opacity ${n.enabled?"bg-cc-bg":"bg-cc-hover/50 opacity-60"}`,children:[e.jsxs("div",{className:"flex flex-col gap-0.5 shrink-0",children:[e.jsx("button",{disabled:i===0,className:"w-5 h-4 flex items-center justify-center text-cc-muted hover:text-cc-fg disabled:opacity-20 disabled:cursor-not-allowed cursor-pointer transition-colors",children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3 h-3",children:e.jsx("path",{d:"M8 4l4 4H4l4-4z"})})}),e.jsx("button",{disabled:i===r.length-1,className:"w-5 h-4 flex items-center justify-center text-cc-muted hover:text-cc-fg disabled:opacity-20 disabled:cursor-not-allowed cursor-pointer transition-colors",children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3 h-3",children:e.jsx("path",{d:"M8 12l4-4H4l4 4z"})})})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:"text-[12px] font-medium text-cc-fg block",children:n.label}),e.jsx("span",{className:"text-[10px] text-cc-muted block truncate",children:n.desc})]}),e.jsx("button",{className:`shrink-0 w-8 h-[18px] rounded-full transition-colors cursor-pointer relative ${n.enabled?"bg-cc-primary":"bg-cc-hover"}`,role:"switch","aria-checked":n.enabled,children:e.jsx("span",{className:`absolute top-[2px] w-[14px] h-[14px] rounded-full bg-white shadow transition-transform ${n.enabled?"translate-x-[16px]":"translate-x-[2px]"}`})})]},n.id))}),e.jsxs("div",{className:"shrink-0 border-t border-cc-border px-3 py-2.5 flex items-center justify-between",children:[e.jsx("button",{className:"text-[11px] text-cc-muted hover:text-cc-fg transition-colors cursor-pointer",children:"Reset to defaults"}),e.jsx("button",{className:"text-[11px] font-medium text-cc-primary hover:text-cc-primary-hover transition-colors cursor-pointer",children:"Done"})]})]})})})}),e.jsx(d,{title:"Codex Session Details",description:"Rate limits and token details for Codex (OpenAI) sessions — streamed via session_update",children:e.jsx("div",{className:"space-y-4",children:e.jsx(s,{label:"Rate limits with token breakdown",children:e.jsx(ps,{})})})}),e.jsx(d,{title:"Update Banner",description:"Notification banner for available updates",children:e.jsxs("div",{className:"space-y-4 max-w-3xl",children:[e.jsx(s,{label:"Service mode (auto-update)",children:e.jsx(W,{updateInfo:{currentVersion:"0.22.1",latestVersion:"0.23.0",updateAvailable:!0,isServiceMode:!0,updateInProgress:!1,lastChecked:Date.now(),channel:"stable"}})}),e.jsx(s,{label:"Foreground mode (manual)",children:e.jsx(W,{updateInfo:{currentVersion:"0.22.1",latestVersion:"0.23.0",updateAvailable:!0,isServiceMode:!1,updateInProgress:!1,lastChecked:Date.now(),channel:"stable"}})}),e.jsx(s,{label:"Update in progress",children:e.jsx(W,{updateInfo:{currentVersion:"0.22.1",latestVersion:"0.23.0",updateAvailable:!0,isServiceMode:!0,updateInProgress:!0,lastChecked:Date.now(),channel:"stable"}})}),e.jsx(s,{label:"Prerelease channel update",children:e.jsx(W,{updateInfo:{currentVersion:"0.22.1",latestVersion:"0.23.0-preview.20260228120000.abc1234",updateAvailable:!0,isServiceMode:!0,updateInProgress:!1,lastChecked:Date.now(),channel:"prerelease"}})})]})}),e.jsx(d,{title:"Status Indicators",description:"Connection and session status banners",children:e.jsxs("div",{className:"space-y-3 max-w-3xl",children:[e.jsx(s,{label:"CLI Disconnected",children:e.jsxs("div",{className:"px-4 py-2 bg-cc-warning/10 border border-cc-warning/20 rounded-lg text-center flex items-center justify-center gap-3",children:[e.jsx("span",{className:"text-xs text-cc-warning font-medium",children:"CLI disconnected"}),e.jsx("span",{className:"text-xs font-medium px-3 py-1.5 rounded-md bg-cc-warning/20 text-cc-warning cursor-pointer",children:"Reconnect"})]})}),e.jsx(s,{label:"CLI Reconnecting",children:e.jsxs("div",{className:"px-4 py-2 bg-cc-warning/10 border border-cc-warning/20 rounded-lg text-center flex items-center justify-center gap-3",children:[e.jsx("span",{className:"w-3 h-3 rounded-full border-2 border-cc-warning/30 border-t-cc-warning animate-spin"}),e.jsx("span",{className:"text-xs text-cc-warning font-medium",children:"Reconnecting…"})]})}),e.jsx(s,{label:"Reconnection Error",children:e.jsxs("div",{className:"px-4 py-2 bg-cc-warning/10 border border-cc-warning/20 rounded-lg text-center flex items-center justify-center gap-3",children:[e.jsx("span",{className:"text-xs text-cc-error font-medium",children:"Reconnection failed"}),e.jsx("span",{className:"text-xs font-medium px-3 py-1.5 rounded-md bg-cc-error/15 text-cc-error cursor-pointer",children:"Retry"})]})}),e.jsx(s,{label:"WS Disconnected",children:e.jsx("div",{className:"px-4 py-2 bg-cc-warning/10 border border-cc-warning/20 rounded-lg text-center",children:e.jsx("span",{className:"text-xs text-cc-warning font-medium",children:"Reconnecting to session..."})})}),e.jsx(s,{label:"Connected",children:e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-cc-card border border-cc-border rounded-lg",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-cc-success"}),e.jsx("span",{className:"text-xs text-cc-fg font-medium",children:"Connected"}),e.jsx("span",{className:"text-[11px] text-cc-muted ml-auto",children:"claude-opus-4-6"})]})}),e.jsx(s,{label:"Running / Thinking",children:e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-cc-card border border-cc-border rounded-lg",children:[e.jsx("span",{className:"w-2 h-2 rounded-full bg-cc-primary animate-[pulse-dot_1.5s_ease-in-out_infinite]"}),e.jsx("span",{className:"text-xs text-cc-fg font-medium",children:"Thinking"})]})}),e.jsx(s,{label:"Compacting",children:e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-cc-card border border-cc-border rounded-lg",children:[e.jsx("svg",{className:"w-3.5 h-3.5 text-cc-muted animate-spin",viewBox:"0 0 16 16",fill:"none",children:e.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"28",strokeDashoffset:"8",strokeLinecap:"round"})}),e.jsx("span",{className:"text-xs text-cc-muted font-medium",children:"Compacting context..."})]})})]})}),e.jsx(d,{title:"Composer",description:"Message input bar with mode toggle, image upload, saved prompts (@), and send/stop buttons",children:e.jsxs("div",{className:"max-w-3xl",children:[e.jsx(s,{label:"Connected — code mode",children:e.jsx("div",{className:"border-t border-cc-border bg-cc-card px-4 py-3",children:e.jsx("div",{className:"relative bg-cc-input-bg/95 border border-cc-border rounded-[14px] shadow-[0_10px_30px_rgba(0,0,0,0.10)] overflow-visible",children:e.jsxs("div",{className:"flex items-end gap-2 px-2.5 py-2",children:[e.jsxs("div",{className:"mb-0.5 flex items-center gap-1.5 px-2.5 py-1.5 rounded-md border border-cc-border text-[12px] font-semibold text-cc-muted",children:[e.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3.5 h-3.5",children:[e.jsx("path",{d:"M2.5 4l4 4-4 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),e.jsx("path",{d:"M8.5 4l4 4-4 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]}),e.jsx("span",{children:"code"})]}),e.jsx("textarea",{readOnly:!0,value:"Can you refactor the auth module to use JWT?",rows:1,className:"flex-1 min-w-0 px-2 py-1.5 text-sm bg-transparent resize-none text-cc-fg font-sans-ui",style:{minHeight:"36px"}}),e.jsxs("div",{className:"mb-0.5 flex items-center gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-center w-9 h-9 rounded-lg border border-cc-border text-cc-muted",children:e.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-4 h-4",children:[e.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"2"}),e.jsx("circle",{cx:"5.5",cy:"5.5",r:"1",fill:"currentColor",stroke:"none"}),e.jsx("path",{d:"M2 11l3-3 2 2 3-4 4 5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsx("div",{className:"flex items-center justify-center w-9 h-9 rounded-full bg-cc-primary text-white shadow-[0_6px_20px_rgba(0,0,0,0.18)]",children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3.5 h-3.5",children:e.jsx("path",{d:"M3 2l11 6-11 6V9.5l7-1.5-7-1.5V2z"})})})]})]})})})}),e.jsx("div",{className:"mt-4"}),e.jsx(s,{label:"@ prompt insertion",children:e.jsx("div",{className:"border-t border-cc-border bg-cc-card px-4 py-3",children:e.jsxs("div",{className:"relative bg-cc-input-bg/95 border border-cc-border rounded-[14px] shadow-[0_10px_30px_rgba(0,0,0,0.10)] overflow-visible",children:[e.jsx("div",{className:"absolute left-2 right-2 bottom-full mb-1 max-h-[180px] overflow-y-auto bg-cc-card border border-cc-border rounded-[10px] shadow-lg z-20 py-1",children:e.jsxs("div",{className:"px-3 py-2 flex items-center gap-2.5 bg-cc-hover",children:[e.jsx("span",{className:"flex items-center justify-center w-6 h-6 rounded-md bg-cc-hover text-cc-muted shrink-0",children:"@"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-[13px] font-medium text-cc-fg truncate",children:"@review-pr"}),e.jsx("div",{className:"text-[11px] text-cc-muted truncate",children:"Review this PR and list risks, regressions, and missing tests."})]}),e.jsx("span",{className:"text-[10px] text-cc-muted shrink-0",children:"project"})]})}),e.jsxs("div",{className:"flex items-end gap-2 px-2.5 py-2",children:[e.jsx("textarea",{readOnly:!0,value:"@rev",rows:1,className:"flex-1 min-w-0 px-2 py-1.5 text-sm bg-transparent resize-none text-cc-fg font-sans-ui",style:{minHeight:"36px"}}),e.jsx("div",{className:"mb-0.5 flex items-center gap-1.5",children:e.jsx("div",{className:"flex items-center justify-center w-9 h-9 rounded-lg border border-cc-border text-cc-muted",children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-4 h-4",children:e.jsx("path",{d:"M4 2.75h8A1.25 1.25 0 0113.25 4v9.25L8 10.5l-5.25 2.75V4A1.25 1.25 0 014 2.75z"})})})})]})]})})}),e.jsx("div",{className:"mt-4"}),e.jsx(s,{label:"Plan mode active",children:e.jsx("div",{className:"border-t border-cc-border bg-cc-card px-4 py-3",children:e.jsx("div",{className:"relative bg-cc-input-bg/95 border border-cc-primary/40 rounded-[14px] shadow-[0_10px_30px_rgba(0,0,0,0.10)] overflow-visible",children:e.jsxs("div",{className:"flex items-end gap-2 px-2.5 py-2",children:[e.jsxs("div",{className:"mb-0.5 flex items-center gap-1.5 px-2.5 py-1.5 rounded-md border border-cc-primary/40 text-[12px] font-semibold text-cc-primary bg-cc-primary/8",children:[e.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3.5 h-3.5",children:[e.jsx("rect",{x:"3",y:"3",width:"3.5",height:"10",rx:"0.75"}),e.jsx("rect",{x:"9.5",y:"3",width:"3.5",height:"10",rx:"0.75"})]}),e.jsx("span",{children:"plan"})]}),e.jsx("textarea",{readOnly:!0,value:"",placeholder:"Type a message... (/ + @)",rows:1,className:"flex-1 min-w-0 px-2 py-1.5 text-sm bg-transparent resize-none text-cc-fg font-sans-ui placeholder:text-cc-muted",style:{minHeight:"36px"}}),e.jsxs("div",{className:"mb-0.5 flex items-center gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-center w-9 h-9 rounded-lg border border-cc-border text-cc-muted",children:e.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-4 h-4",children:[e.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"2"}),e.jsx("circle",{cx:"5.5",cy:"5.5",r:"1",fill:"currentColor",stroke:"none"}),e.jsx("path",{d:"M2 11l3-3 2 2 3-4 4 5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsx("div",{className:"flex items-center justify-center w-9 h-9 rounded-full bg-cc-hover text-cc-muted",children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3.5 h-3.5",children:e.jsx("path",{d:"M3 2l11 6-11 6V9.5l7-1.5-7-1.5V2z"})})})]})]})})})}),e.jsx("div",{className:"mt-4"}),e.jsx(s,{label:"Running — stop button visible",children:e.jsx("div",{className:"border-t border-cc-border bg-cc-card px-4 py-3",children:e.jsx("div",{className:"relative bg-cc-input-bg/95 border border-cc-border rounded-[14px] shadow-[0_10px_30px_rgba(0,0,0,0.10)] overflow-visible",children:e.jsxs("div",{className:"flex items-end gap-2 px-2.5 py-2",children:[e.jsxs("div",{className:"mb-0.5 flex items-center gap-1.5 px-2.5 py-1.5 rounded-md border border-cc-border text-[12px] font-semibold text-cc-muted",children:[e.jsxs("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3.5 h-3.5",children:[e.jsx("path",{d:"M2.5 4l4 4-4 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),e.jsx("path",{d:"M8.5 4l4 4-4 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"})]}),e.jsx("span",{children:"code"})]}),e.jsx("textarea",{readOnly:!0,value:"",placeholder:"Type a message... (/ for commands)",rows:1,className:"flex-1 min-w-0 px-2 py-1.5 text-sm bg-transparent resize-none text-cc-fg font-sans-ui placeholder:text-cc-muted",style:{minHeight:"36px"}}),e.jsxs("div",{className:"mb-0.5 flex items-center gap-1.5",children:[e.jsx("div",{className:"flex items-center justify-center w-9 h-9 rounded-lg border border-cc-border text-cc-muted",children:e.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-4 h-4",children:[e.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"2"}),e.jsx("circle",{cx:"5.5",cy:"5.5",r:"1",fill:"currentColor",stroke:"none"}),e.jsx("path",{d:"M2 11l3-3 2 2 3-4 4 5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsx("div",{className:"flex items-center justify-center w-9 h-9 rounded-lg bg-cc-error/10 text-cc-error",children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3.5 h-3.5",children:e.jsx("rect",{x:"3",y:"3",width:"10",height:"10",rx:"1"})})})]})]})})})})]})}),e.jsx(d,{title:"Prompt Suggestions",description:"Suggestion chips from the CLI for predicted next user prompts",children:e.jsxs("div",{className:"max-w-3xl space-y-4",children:[e.jsx(s,{label:"Suggestion chips (idle state)",children:e.jsx("div",{className:"flex flex-wrap gap-2 p-3",children:["Fix the failing test","Add error handling","Refactor to use async/await"].map(n=>e.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-full border border-cc-border bg-cc-card text-cc-fg hover:bg-cc-hover transition-colors",onClick:()=>alert(`Selected: ${n}`),children:n},n))})}),e.jsx(s,{label:"Suggestion chips (after completion)",children:e.jsx("div",{className:"flex flex-wrap gap-2 p-3",children:["Run the test suite","Deploy to staging","Update the README"].map(n=>e.jsx("button",{type:"button",className:"px-3 py-1.5 text-sm rounded-full border border-cc-primary/30 bg-cc-primary/5 text-cc-primary hover:bg-cc-primary/10 transition-colors",onClick:()=>alert(`Selected: ${n}`),children:n},n))})})]})}),e.jsx(d,{title:"Streaming Indicator",description:"Live typing animation shown while the assistant is generating",children:e.jsxs("div",{className:"space-y-4 max-w-3xl",children:[e.jsx(s,{label:"Streaming with cursor",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-cc-primary/10 flex items-center justify-center shrink-0 mt-0.5",children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3.5 h-3.5 text-cc-primary",children:e.jsx("path",{d:"M8 1v14M1 8h14",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("pre",{className:"font-serif-assistant text-[15px] text-cc-fg whitespace-pre-wrap break-words leading-relaxed",children:["I'll start by creating the JWT utility module with sign and verify helpers. Let me first check what dependencies are already installed...",e.jsx("span",{className:"inline-block w-0.5 h-4 bg-cc-primary ml-0.5 align-middle animate-[pulse-dot_0.8s_ease-in-out_infinite]"})]})})]})}),e.jsx(s,{label:"Generation stats bar — active (streaming)",children:e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-cc-muted font-mono-code pl-10 stats-glow py-1",children:[e.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-cc-primary animate-[typing-breathe_1.5s_ease-in-out_infinite]"}),e.jsx("span",{className:"text-cc-fg/70",children:"Generating"}),e.jsx("span",{className:"text-cc-muted/30",children:"|"}),e.jsx("span",{className:"tabular-nums",children:"12s"}),e.jsx("span",{className:"text-cc-muted/30",children:"|"}),e.jsx("span",{className:"tabular-nums",children:"1.2k tokens"})]})}),e.jsx(s,{label:"Generation stats bar — quiet (working silently, e.g. long tool call)",children:e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-cc-muted font-mono-code pl-10 stats-glow py-1",children:[e.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-cc-primary animate-[typing-breathe_1.5s_ease-in-out_infinite]"}),e.jsx("span",{className:"text-cc-fg/70",children:"Still working…"}),e.jsx("span",{className:"text-cc-muted/30",children:"|"}),e.jsx("span",{className:"tabular-nums",children:"no update for 23s"})]})}),e.jsx(s,{label:"Generation stats bar — stalled (may be stuck)",children:e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-cc-warning font-mono-code pl-10 stats-glow py-1",children:[e.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-cc-warning animate-[typing-breathe_1.5s_ease-in-out_infinite]"}),e.jsx("span",{children:"No activity for 16m 12s — the agent may be stuck"})]})}),e.jsx(s,{label:"Plan rate limit — warning (95% of the 5h window)",children:e.jsxs("div",{className:"px-4 py-2.5 space-y-1 max-w-xs",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[11px] text-cc-muted uppercase tracking-wider",children:"5h Limit"}),e.jsxs("span",{className:"text-[11px] text-cc-muted tabular-nums",children:["95% ",e.jsx("span",{className:"ml-1",children:"(2h14m)"})]})]}),e.jsx("div",{className:"w-full h-1.5 rounded-full bg-cc-hover overflow-hidden",children:e.jsx("div",{className:"h-full rounded-full bg-cc-error",style:{width:"95%"}})})]})}),e.jsx(s,{label:"Plan rate limit — rejected (no utilization is sent)",children:e.jsxs("div",{className:"px-4 py-2.5 space-y-2 max-w-xs",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[11px] text-cc-muted uppercase tracking-wider",children:"Plan Limit"}),e.jsx("span",{className:"text-[11px] text-cc-error tabular-nums",children:"rate limited · resets 47m"})]}),e.jsx("p",{className:"text-[11px] text-cc-error",children:"The API is refusing requests for this plan window — resets in 47m."})]})}),e.jsx(s,{label:"Generation stats bar — quiet, naming the running tool",children:e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-cc-muted font-mono-code pl-10 stats-glow py-1",children:[e.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-cc-primary animate-[typing-breathe_1.5s_ease-in-out_infinite]"}),e.jsx("span",{className:"text-cc-fg/70",children:"Running Bash"}),e.jsx("span",{className:"text-cc-muted/30",children:"|"}),e.jsx("span",{className:"tabular-nums",children:"1m 47s"}),e.jsx("span",{className:"text-cc-muted/30",children:"|"}),e.jsx("span",{className:"truncate max-w-[32ch]",children:"bun run test"})]})}),e.jsx(s,{label:"Generation stats bar — background (turn ended, process still running)",children:e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-cc-muted font-mono-code pl-10 stats-glow py-1",children:[e.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-cc-primary animate-[typing-breathe_1.5s_ease-in-out_infinite]"}),e.jsx("span",{className:"text-cc-fg/70",children:"Background process running"}),e.jsx("span",{className:"text-cc-muted/30",children:"|"}),e.jsx("span",{className:"tabular-nums",children:"4m 02s"}),e.jsx("span",{className:"text-cc-muted/30",children:"|"}),e.jsx("span",{className:"truncate max-w-[24ch]",children:"Wait for CI"})]})}),e.jsx(s,{label:"Generation stats bar — background, multiple processes",children:e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-cc-muted font-mono-code pl-10 stats-glow py-1",children:[e.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-cc-primary animate-[typing-breathe_1.5s_ease-in-out_infinite]"}),e.jsx("span",{className:"text-cc-fg/70",children:"3 background processes running"}),e.jsx("span",{className:"text-cc-muted/30",children:"|"}),e.jsx("span",{className:"tabular-nums",children:"12m 40s"})]})})]})}),e.jsx(d,{title:"Tool Message Groups",description:"Consecutive same-tool calls collapsed into a single expandable row",children:e.jsxs("div",{className:"space-y-4 max-w-3xl",children:[e.jsx(s,{label:"Multi-item group (4 Reads)",children:e.jsx(ne,{toolName:"Read",items:Je})}),e.jsx(s,{label:"Single-item group",children:e.jsx(ne,{toolName:"Glob",items:[{id:"sg-1",name:"Glob",input:{pattern:"src/auth/**/*.ts"}}]})})]})}),e.jsx(d,{title:"Subagent Groups",description:"Nested messages from Task tool subagents shown in a collapsible indent",children:e.jsx("div",{className:"space-y-4 max-w-3xl",children:e.jsx(s,{label:"Subagent with nested tool calls",children:e.jsx(ms,{description:"Search codebase for auth patterns",agentType:"Explore",status:"completed",senderThreadId:"thr_main",receiverThreadIds:["thr_sub_1","thr_sub_2"],receiverCount:2,items:Ye})})})}),e.jsx(d,{title:"Activity Tray",description:"Floating pill + expandable panel showing background agents and tasks — appears bottom-right of the chat area",children:e.jsx("div",{className:"space-y-4 max-w-3xl",children:e.jsx(s,{label:"With running agents + tasks (interactive)",children:e.jsx(gs,{})})})}),e.jsx(d,{title:"Diff Viewer",description:"Unified diff rendering with word-level highlighting — used in ToolBlock, PermissionBanner, and DiffPanel",children:e.jsxs("div",{className:"space-y-4 max-w-3xl",children:[e.jsx(s,{label:"Edit diff (compact mode)",children:e.jsx(L,{oldText:`export function formatDate(d: Date) {
|
|
83
|
-
return d.toISOString();
|
|
84
|
-
}`,newText:`export function formatDate(d: Date, locale = "en-US") {
|
|
85
|
-
return d.toLocaleDateString(locale, {
|
|
86
|
-
year: "numeric",
|
|
87
|
-
month: "short",
|
|
88
|
-
day: "numeric",
|
|
89
|
-
});
|
|
90
|
-
}`,fileName:"src/utils/format.ts",mode:"compact"})}),e.jsx(s,{label:"New file diff (compact mode)",children:e.jsx(L,{newText:`export const config = {
|
|
91
|
-
apiUrl: "https://api.example.com",
|
|
92
|
-
timeout: 5000,
|
|
93
|
-
retries: 3,
|
|
94
|
-
debug: process.env.NODE_ENV !== "production",
|
|
95
|
-
};
|
|
96
|
-
`,fileName:"src/config.ts",mode:"compact"})}),e.jsx(s,{label:"Git diff (full mode with line numbers)",children:e.jsx(L,{unifiedDiff:`diff --git a/src/auth/middleware.ts b/src/auth/middleware.ts
|
|
97
|
-
--- a/src/auth/middleware.ts
|
|
98
|
-
+++ b/src/auth/middleware.ts
|
|
99
|
-
@@ -1,8 +1,12 @@
|
|
100
|
-
-import { getSession } from "./session";
|
|
101
|
-
+import { verifyToken } from "./jwt";
|
|
102
|
-
+import type { Request, Response, NextFunction } from "express";
|
|
103
|
-
|
|
104
|
-
-export function authMiddleware(req, res, next) {
|
|
105
|
-
- const session = getSession(req);
|
|
106
|
-
- if (!session?.userId) {
|
|
107
|
-
+export function authMiddleware(req: Request, res: Response, next: NextFunction) {
|
|
108
|
-
+ const header = req.headers.authorization;
|
|
109
|
-
+ if (!header?.startsWith("Bearer ")) {
|
|
110
|
-
return res.status(401).json({ error: "Unauthorized" });
|
|
111
|
-
}
|
|
112
|
-
- req.userId = session.userId;
|
|
113
|
-
+ const token = header.slice(7);
|
|
114
|
-
+ const payload = verifyToken(token);
|
|
115
|
-
+ if (!payload) return res.status(401).json({ error: "Invalid token" });
|
|
116
|
-
+ req.userId = payload.userId;
|
|
117
|
-
next();
|
|
118
|
-
}`,mode:"full"})}),e.jsx(s,{label:"No changes",children:e.jsx(L,{oldText:"same content",newText:"same content"})})]})}),e.jsx(d,{title:"Session Creation Progress",description:"Step-by-step progress indicator shown during session creation (SSE streaming)",children:e.jsxs("div",{className:"space-y-4 max-w-md",children:[e.jsx(s,{label:"In progress (container session)",children:e.jsx(E,{steps:[{step:"resolving_env",label:"Resolving environment...",status:"done"},{step:"pulling_image",label:"Pulling Docker image...",status:"done"},{step:"creating_container",label:"Starting container...",status:"in_progress"},{step:"launching_cli",label:"Launching Claude Code...",status:"in_progress"}]})}),e.jsx(s,{label:"Completed (worktree session)",children:e.jsx(E,{steps:[{step:"resolving_env",label:"Resolving environment...",status:"done"},{step:"fetching_git",label:"Fetching from remote...",status:"done"},{step:"checkout_branch",label:"Checking out feat/auth...",status:"done"},{step:"creating_worktree",label:"Creating worktree...",status:"done"},{step:"launching_cli",label:"Launching Claude Code...",status:"done"}]})}),e.jsx(s,{label:"Error during image pull",children:e.jsx(E,{steps:[{step:"resolving_env",label:"Resolving environment...",status:"done"},{step:"pulling_image",label:"Pulling Docker image...",status:"error"}],error:"Failed to pull docker.io/stangirard/the-companion:latest — connection timed out after 30s"})}),e.jsx(s,{label:"With streaming init script logs",children:e.jsx(E,{steps:[{step:"resolving_env",label:"Resolving environment...",status:"done"},{step:"pulling_image",label:"Image ready",status:"done"},{step:"creating_container",label:"Container running",status:"done"},{step:"running_init_script",label:"Running init script...",status:"in_progress",detail:"Installing dependencies..."}]})}),e.jsx(s,{label:"With streaming image pull logs",children:e.jsx(E,{steps:[{step:"resolving_env",label:"Resolving environment...",status:"done"},{step:"pulling_image",label:"Pulling Docker image...",status:"in_progress",detail:"Downloading layer 3/7 [=====> ] 45%"}]})}),e.jsx(s,{label:"Error during init script",children:e.jsx(E,{steps:[{step:"resolving_env",label:"Resolving environment...",status:"done"},{step:"pulling_image",label:"Pulling Docker image...",status:"done"},{step:"creating_container",label:"Starting container...",status:"done"},{step:"running_init_script",label:"Running init script...",status:"error"}],error:`npm ERR! code ENOENT
|
|
119
|
-
npm ERR! syscall open
|
|
120
|
-
npm ERR! path /app/package.json`})})]})}),e.jsx(d,{title:"Session Launch Overlay",description:"Full-screen overlay shown during session creation, replacing the inline progress list",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(s,{label:"In progress (container session)",children:e.jsx("div",{className:"relative h-[360px] bg-cc-bg rounded-lg overflow-hidden border border-cc-border",children:e.jsx(B,{steps:[{step:"resolving_env",label:"Environment resolved",status:"done"},{step:"pulling_image",label:"Pulling Docker image...",status:"done"},{step:"creating_container",label:"Starting container...",status:"in_progress"},{step:"launching_cli",label:"Launching Claude Code...",status:"in_progress"}],backend:"claude",onCancel:()=>{}})})}),e.jsx(s,{label:"All steps done (launching)",children:e.jsx("div",{className:"relative h-[360px] bg-cc-bg rounded-lg overflow-hidden border border-cc-border",children:e.jsx(B,{steps:[{step:"resolving_env",label:"Environment resolved",status:"done"},{step:"fetching_git",label:"Fetch complete",status:"done"},{step:"creating_worktree",label:"Worktree created",status:"done"},{step:"launching_cli",label:"CLI launched",status:"done"}],backend:"claude"})})}),e.jsx(s,{label:"Error state",children:e.jsx("div",{className:"relative h-[400px] bg-cc-bg rounded-lg overflow-hidden border border-cc-border",children:e.jsx(B,{steps:[{step:"resolving_env",label:"Environment resolved",status:"done"},{step:"pulling_image",label:"Pulling Docker image...",status:"error"}],error:"Failed to pull docker.io/stangirard/the-companion:latest — connection timed out after 30s",backend:"claude",onCancel:()=>{}})})}),e.jsx(s,{label:"Codex backend",children:e.jsx("div",{className:"relative h-[320px] bg-cc-bg rounded-lg overflow-hidden border border-cc-border",children:e.jsx(B,{steps:[{step:"resolving_env",label:"Environment resolved",status:"done"},{step:"launching_cli",label:"Launching Codex...",status:"in_progress"}],backend:"codex",onCancel:()=>{}})})})]})}),e.jsx(d,{title:"Update Overlay",description:"Full-screen overlay shown when auto-update is in progress, polls server and reloads when ready",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(s,{label:"Installing phase",children:e.jsx("div",{className:"relative h-[360px] bg-cc-bg rounded-lg overflow-hidden border border-cc-border",children:e.jsx(U,{phase:"installing"})})}),e.jsx(s,{label:"Restarting phase",children:e.jsx("div",{className:"relative h-[360px] bg-cc-bg rounded-lg overflow-hidden border border-cc-border",children:e.jsx(U,{phase:"restarting"})})}),e.jsx(s,{label:"Waiting for server",children:e.jsx("div",{className:"relative h-[360px] bg-cc-bg rounded-lg overflow-hidden border border-cc-border",children:e.jsx(U,{phase:"waiting"})})}),e.jsx(s,{label:"Update complete",children:e.jsx("div",{className:"relative h-[360px] bg-cc-bg rounded-lg overflow-hidden border border-cc-border",children:e.jsx(U,{phase:"ready"})})})]})}),e.jsx(d,{title:"Docker Update Dialog",description:"Post-update dialog asking whether to also update the sandbox Docker image",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(s,{label:"Prompt phase",children:e.jsx(O,{phase:"prompt"})}),e.jsx(s,{label:"Pulling phase",children:e.jsx(O,{phase:"pulling"})}),e.jsx(s,{label:"Done phase",children:e.jsx(O,{phase:"done"})}),e.jsx(s,{label:"Error phase",children:e.jsx(O,{phase:"error"})})]})}),e.jsx(d,{title:"CLAUDE.md Editor",description:"Modal for viewing and editing project CLAUDE.md instructions",children:e.jsxs("div",{className:"space-y-4 max-w-3xl",children:[e.jsx(s,{label:"Open editor button (from TopBar)",children:e.jsx(xs,{})}),e.jsx(s,{label:"Terminal quick tabs (from TopBar)",children:e.jsx(ds,{})})]})}),e.jsx(d,{title:"Session Items",description:"Sidebar session rows — status dot, backend badge, Docker indicator, archive on hover",children:e.jsx(cs,{})}),e.jsx(d,{title:"Browser Preview",description:"Browser preview panel — host mode (HTTP proxy) and container mode (noVNC) — loading, error, and active states",children:e.jsxs("div",{className:"space-y-4 max-w-3xl",children:[e.jsx(s,{label:"Loading state",children:e.jsxs("div",{className:"h-48 flex flex-col items-center justify-center gap-3 p-4 bg-cc-bg rounded border border-cc-border",children:[e.jsx("div",{className:"w-5 h-5 border-2 border-cc-primary border-t-transparent rounded-full animate-spin"}),e.jsx("div",{className:"text-sm text-cc-muted",children:"Starting browser preview..."})]})}),e.jsx(s,{label:"Error state",children:e.jsx("div",{className:"h-48 flex items-center justify-center p-4 bg-cc-bg rounded border border-cc-border",children:e.jsx("div",{className:"px-4 py-3 rounded-lg bg-cc-error/10 border border-cc-error/30 text-sm text-cc-error max-w-md text-center",children:"Browser preview unavailable."})})}),e.jsx(s,{label:"Host mode (proxy — before navigation)",children:e.jsxs("div",{className:"h-48 flex flex-col bg-cc-bg rounded border border-cc-border overflow-hidden",children:[e.jsxs("div",{className:"shrink-0 px-3 py-2 border-b border-cc-border flex items-center gap-2",children:[e.jsx("button",{type:"button",className:"flex items-center justify-center w-7 h-7 rounded text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer","aria-label":"Reload browser",title:"Reload",children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3.5 h-3.5",children:e.jsx("path",{d:"M13.65 2.35a1 1 0 0 0-1.3 0L11 3.7A5.99 5.99 0 0 0 2 8a1 1 0 1 0 2 0 4 4 0 0 1 6.29-3.29L8.65 6.35a1 1 0 0 0 .7 1.7H13a1 1 0 0 0 1-1V3.4a1 1 0 0 0-.35-.7z M14 8a1 1 0 1 0-2 0 4 4 0 0 1-6.29 3.29l1.64-1.64a1 1 0 0 0-.7-1.7H3.05a1 1 0 0 0-1 1v3.65a1 1 0 0 0 1.7.7L5 11.7A5.99 5.99 0 0 0 14 8z"})})}),e.jsx("input",{type:"text",defaultValue:"http://localhost:3000",className:"flex-1 px-2 py-1 text-xs rounded bg-cc-bg border border-cc-border text-cc-fg placeholder:text-cc-muted focus:outline-none focus:border-cc-primary","aria-label":"Navigate URL",readOnly:!0}),e.jsx("button",{type:"button",className:"px-3 py-1 rounded text-xs font-medium bg-cc-primary text-white hover:bg-cc-primary-hover transition-colors cursor-pointer",children:"Go"})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center text-xs text-cc-muted",children:"Enter a URL and click Go to preview."})]})}),e.jsx(s,{label:"Container mode (noVNC — active)",children:e.jsxs("div",{className:"h-48 flex flex-col bg-cc-bg rounded border border-cc-border overflow-hidden",children:[e.jsxs("div",{className:"shrink-0 px-3 py-2 border-b border-cc-border flex items-center gap-2",children:[e.jsx("button",{type:"button",className:"flex items-center justify-center w-7 h-7 rounded text-cc-muted hover:text-cc-fg hover:bg-cc-hover transition-colors cursor-pointer","aria-label":"Reload browser",title:"Reload",children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3.5 h-3.5",children:e.jsx("path",{d:"M13.65 2.35a1 1 0 0 0-1.3 0L11 3.7A5.99 5.99 0 0 0 2 8a1 1 0 1 0 2 0 4 4 0 0 1 6.29-3.29L8.65 6.35a1 1 0 0 0 .7 1.7H13a1 1 0 0 0 1-1V3.4a1 1 0 0 0-.35-.7z M14 8a1 1 0 1 0-2 0 4 4 0 0 1-6.29 3.29l1.64-1.64a1 1 0 0 0-.7-1.7H3.05a1 1 0 0 0-1 1v3.65a1 1 0 0 0 1.7.7L5 11.7A5.99 5.99 0 0 0 14 8z"})})}),e.jsx("input",{type:"text",defaultValue:"http://localhost:3000",className:"flex-1 px-2 py-1 text-xs rounded bg-cc-bg border border-cc-border text-cc-fg placeholder:text-cc-muted focus:outline-none focus:border-cc-primary","aria-label":"Navigate URL",readOnly:!0}),e.jsx("button",{type:"button",className:"px-3 py-1 rounded text-xs font-medium bg-cc-primary text-white hover:bg-cc-primary-hover transition-colors cursor-pointer",children:"Go"})]}),e.jsx("div",{className:"flex-1 flex items-center justify-center text-xs text-cc-muted",children:"noVNC iframe would render here"})]})})]})}),e.jsx(d,{title:"Tool Activity",description:"Live execution bar and post-turn summary strip",children:e.jsxs("div",{className:"space-y-6",children:[e.jsx(s,{label:"ToolExecutionBar — 1 tool running",children:e.jsx("div",{className:"bg-cc-bg p-2 rounded",children:e.jsx(Z,{tools:[{toolName:"Bash",elapsedSeconds:3}]})})}),e.jsx(s,{label:"ToolExecutionBar — 3 tools running",children:e.jsx("div",{className:"bg-cc-bg p-2 rounded",children:e.jsx(Z,{tools:[{toolName:"Bash",elapsedSeconds:7},{toolName:"Read",elapsedSeconds:1},{toolName:"Edit",elapsedSeconds:4}]})})}),e.jsx(s,{label:"ToolExecutionBar — empty (renders nothing)",children:e.jsx("div",{className:"bg-cc-bg p-2 rounded min-h-[24px]",children:e.jsx(Z,{tools:[]})})}),e.jsx(s,{label:"ToolTurnSummary — collapsed (3 tools, no errors)",children:e.jsx("div",{className:"bg-cc-bg p-2 rounded",children:e.jsx(ee,{entries:Qe})})}),e.jsx(s,{label:"ToolTurnSummary — collapsed (with error)",children:e.jsx("div",{className:"bg-cc-bg p-2 rounded",children:e.jsx(ee,{entries:Xe})})}),e.jsx(s,{label:"ToolTurnSummary — collapsed (with running tool)",children:e.jsx("div",{className:"bg-cc-bg p-2 rounded",children:e.jsx(ee,{entries:Ze})})})]})})]})]})}function C(t){return{id:`mock-${Math.random().toString(36).slice(2,8)}`,model:"claude-sonnet-4-20250514",cwd:"/Users/dev/project",gitBranch:"main",isContainerized:!1,gitAhead:0,gitBehind:0,linesAdded:0,linesRemoved:0,isConnected:!1,isReconnecting:!1,status:null,sdkState:null,createdAt:Date.now(),archived:!1,backendType:"claude",repoRoot:"/Users/dev/project",permCount:0,...t}}const is={current:null},A={onSelect:()=>{},onStartRename:()=>{},onArchive:t=>t.stopPropagation(),onUnarchive:t=>t.stopPropagation(),onDelete:t=>t.stopPropagation(),onClearRecentlyRenamed:()=>{},editingSessionId:null,editingName:"",setEditingName:()=>{},onConfirmRename:()=>{},onCancelRename:()=>{},editInputRef:is};function cs(){return e.jsxs("div",{className:"space-y-4 max-w-sm",children:[e.jsx(s,{label:"Running — Claude Code",children:e.jsx("div",{className:"bg-cc-sidebar rounded-lg p-1",children:e.jsx(S,{session:C({isConnected:!0,status:"running",backendType:"claude"}),isActive:!1,sessionName:"Refactor auth module",permCount:0,isRecentlyRenamed:!1,...A})})}),e.jsx(s,{label:"Running — Codex + Docker",children:e.jsx("div",{className:"bg-cc-sidebar rounded-lg p-1",children:e.jsx(S,{session:C({isConnected:!0,status:"running",backendType:"codex",isContainerized:!0}),isActive:!1,sessionName:"Add payment flow",permCount:0,isRecentlyRenamed:!1,...A})})}),e.jsx(s,{label:"Awaiting Input — 2 permissions pending",children:e.jsx("div",{className:"bg-cc-sidebar rounded-lg p-1",children:e.jsx(S,{session:C({isConnected:!0,status:"running",backendType:"claude",permCount:2}),isActive:!1,sessionName:"Fix login bug",permCount:2,isRecentlyRenamed:!1,...A})})}),e.jsx(s,{label:"Idle — connected, not running",children:e.jsx("div",{className:"bg-cc-sidebar rounded-lg p-1",children:e.jsx(S,{session:C({isConnected:!0,status:"idle",backendType:"claude"}),isActive:!1,sessionName:"Review PR #42",permCount:0,isRecentlyRenamed:!1,...A})})}),e.jsx(s,{label:"Reconnecting — CLI restarting",children:e.jsx("div",{className:"bg-cc-sidebar rounded-lg p-1",children:e.jsx(S,{session:C({isReconnecting:!0}),isActive:!1,sessionName:"Debug auth flow",permCount:0,isRecentlyRenamed:!1,...A})})}),e.jsx(s,{label:"Exited — session stopped",children:e.jsx("div",{className:"bg-cc-sidebar rounded-lg p-1",children:e.jsx(S,{session:C({sdkState:"exited",backendType:"codex"}),isActive:!1,sessionName:"Deploy to staging",permCount:0,isRecentlyRenamed:!1,...A})})}),e.jsx(s,{label:"Active (selected session)",children:e.jsx("div",{className:"bg-cc-sidebar rounded-lg p-1",children:e.jsx(S,{session:C({isConnected:!0,status:"running",backendType:"claude",isContainerized:!0}),isActive:!0,sessionName:"Build new dashboard",permCount:0,isRecentlyRenamed:!1,...A})})}),e.jsx(s,{label:"Archived session",children:e.jsx("div",{className:"bg-cc-sidebar rounded-lg p-1",children:e.jsx(S,{session:C({archived:!0,backendType:"claude"}),isActive:!1,isArchived:!0,sessionName:"Old migration script",permCount:0,isRecentlyRenamed:!1,...A})})})]})}const xe="playground-magic",os={version:7,status:"live",updatedAt:1,sessionSummary:"",slots:{hero:{title:"Now",html:"<h2>Refactoring the auth middleware</h2><p>Extracted token validation into <code>src/auth/validate.ts</code>; all call sites migrated. <mark>2 tests still failing</mark> in the session-expiry suite.</p>",updatedAt:5},tests:{chart:{kind:"bar",title:"Test runs",labels:["run 1","run 2","run 3","run 4"],series:[{label:"passed",data:[21,28,31,34]},{label:"failed",data:[9,5,3,2]}]},title:"Test runs",updatedAt:4},files:{stat:{label:"Files changed",value:"12",trend:"up"},updatedAt:3},duration:{stat:{label:"Session time",value:"38m",trend:"flat"},updatedAt:3},migrate:{title:"Run the migration",snippet:{title:"Run the migration",language:"bash",code:`bun run db:migrate
|
|
121
|
-
bun run db:seed --env dev`},updatedAt:2},log:{title:"Earlier",html:"<ul><li>Bootstrapped OAuth config</li><li>Fixed CI flake in <code>ws-bridge.test.ts</code></li><li>Upgraded Hono to 4.x</li></ul>",updatedAt:1}},layout:[{slot:"hero",area:"hero",span:2},{slot:"tests",area:"main",span:2},{slot:"files",area:"main"},{slot:"duration",area:"main"},{slot:"migrate",area:"main",span:2},{slot:"log",area:"main"}],openItems:[{id:"q-db",ts:3,text:"Waiting for you to run the DB migration locally",kind:"action"},{id:"q-choice",ts:2,text:"Agent asked which token TTL to use",kind:"question"}],currentTopicTitle:"Auth refactor",topics:[{id:"topic-1",title:"Server health",ts:1,slots:{cpu:{stat:{label:"CPU (avg)",value:"1.9%",trend:"flat"},updatedAt:1},mem:{chart:{kind:"donut",labels:["used","cache","free"],series:[{label:"GB",data:[2.4,6.7,22.9]}]},title:"Memory",updatedAt:1},verdict:{title:"Verdict",html:"<p>Box is coasting — CPU ~2%, RAM 8% used, zero swap.</p>",updatedAt:1}},layout:[{slot:"verdict",area:"hero",span:2},{slot:"mem",area:"main"},{slot:"cpu",area:"main"}]}],decisionLog:[{id:"d3",ts:3,source:"user",title:"Bash",detail:"Allowed: bun test --watch=false",behavior:"allow"},{id:"d2",ts:2,source:"ai_auto",title:"Read",detail:"Allowed (read-only tool)",behavior:"allow"},{id:"d1",ts:1,source:"agent",title:"Chose middleware refactor",detail:"Extracting validation beats patching call sites for rollback safety"}]},ue={requestId:"playground-magic-req",kind:"ask_user_question",title:"The agent has a question",questions:[{question:"Which token TTL should the new middleware use?",options:[{label:"15 minutes",description:"Most secure, more refreshes"},{label:"1 hour",description:"Current behavior"},{label:"24 hours",description:"Convenient, least secure"}]}]};function ls(){const[t,c]=x.useState([ue]),[n,i]=x.useState("");return x.useEffect(()=>{b.getState().setMagicUiState(xe,os);const r=()=>{const o=document.documentElement.classList.contains("dark");b.getState().darkMode!==o&&b.getState().setDarkMode(o)};r();const m=new MutationObserver(r);return m.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>m.disconnect()},[]),e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"border border-cc-border rounded-xl overflow-hidden bg-cc-card relative",style:{height:560},children:e.jsx(Ce,{sessionId:xe,decisions:t,onDecisionResponse:(r,m)=>{i(JSON.stringify({requestId:r,response:m})),c([])}})}),e.jsxs("div",{className:"flex items-center gap-3 text-xs text-cc-muted",children:[e.jsx("button",{onClick:()=>c([ue]),className:"px-2 py-1 rounded-md bg-cc-hover hover:bg-cc-active text-cc-fg transition-colors cursor-pointer",children:"Re-show decision"}),n&&e.jsxs("span",{className:"font-mono-code truncate",children:["answered: ",n]})]})]})}function d({title:t,description:c,children:n}){return e.jsxs("section",{children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("h2",{className:"text-base font-semibold text-cc-fg",children:t}),e.jsx("p",{className:"text-xs text-cc-muted mt-0.5",children:c})]}),n]})}function s({label:t,children:c}){return e.jsxs("div",{className:"border border-cc-border rounded-xl overflow-hidden bg-cc-card",children:[e.jsx("div",{className:"px-3 py-1.5 bg-cc-hover/50 border-b border-cc-border",children:e.jsx("span",{className:"text-[10px] text-cc-muted font-mono-code uppercase tracking-wider",children:t})}),e.jsx("div",{className:"p-4",children:c})]})}function ds(){var m;const t=[{id:"host",label:"Terminal",cwd:"/Users/demo/project"},{id:"docker",label:"Docker",cwd:"/workspace"}],[c,n]=x.useState("host"),[i,r]=x.useState("bottom");return e.jsxs("div",{className:"rounded-xl border border-cc-border bg-cc-card overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 border-b border-cc-border bg-cc-sidebar",children:[e.jsx("div",{className:"flex items-center gap-0.5 bg-cc-hover rounded-md p-0.5 mr-1",children:["top","right","bottom","left"].map(o=>{var g;return e.jsxs("button",{onClick:()=>r(o),className:`px-2 py-1 rounded text-[10px] font-medium cursor-pointer ${i===o?"bg-cc-card text-cc-fg":"text-cc-muted"}`,children:[(g=o[0])==null?void 0:g.toUpperCase(),o.slice(1)]},o)})}),t.map(o=>e.jsx("button",{onClick:()=>n(o.id),className:`px-2 py-1 rounded-md text-[11px] font-medium border cursor-pointer ${c===o.id?"text-cc-fg bg-cc-card border-cc-border":"text-cc-muted border-transparent hover:bg-cc-hover"}`,children:o.label},o.id)),e.jsx("span",{className:"text-[11px] font-mono-code text-cc-muted truncate ml-1",children:(m=t.find(o=>o.id===c))==null?void 0:m.cwd})]}),e.jsx("div",{className:"h-32 p-3 bg-cc-bg",children:e.jsxs("div",{className:`h-full min-h-0 rounded-lg border border-cc-border bg-cc-card flex ${i==="left"||i==="right"?"flex-row":"flex-col"}`,children:[(i==="top"||i==="left")&&e.jsx("div",{className:`${i==="left"?"w-2/5 border-r":"h-2/5 border-b"} border-cc-border bg-cc-sidebar/40 flex items-center justify-center text-[10px] text-cc-muted font-mono-code`,children:"Terminal docked"}),e.jsx("div",{className:"flex-1 min-h-0 flex items-center justify-center text-xs text-cc-muted",children:"Session content"}),(i==="right"||i==="bottom")&&e.jsx("div",{className:`${i==="right"?"w-2/5 border-l":"h-2/5 border-t"} border-cc-border bg-cc-sidebar/40 flex items-center justify-center text-[10px] text-cc-muted font-mono-code`,children:"Terminal docked"})]})})]})}function ne({toolName:t,items:c}){const[n,i]=x.useState(!1),r=Se(t),m=ye(t),o=c.length;if(o===1){const g=c[0];return e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-cc-primary/10 flex items-center justify-center shrink-0 mt-0.5",children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3 h-3 text-cc-primary",children:e.jsx("circle",{cx:"8",cy:"8",r:"3"})})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"border border-cc-border rounded-[10px] overflow-hidden bg-cc-card",children:[e.jsxs("button",{onClick:()=>i(!n),className:"w-full flex items-center gap-2.5 px-3 py-2 text-left hover:bg-cc-hover transition-colors cursor-pointer",children:[e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:`w-3 h-3 text-cc-muted transition-transform shrink-0 ${n?"rotate-90":""}`,children:e.jsx("path",{d:"M6 4l4 4-4 4"})}),e.jsx(ae,{type:r}),e.jsx("span",{className:"text-xs font-medium text-cc-fg",children:m}),e.jsx("span",{className:"text-xs text-cc-muted truncate flex-1 font-mono-code",children:ie(g.name,g.input)})]}),n&&e.jsx("div",{className:"px-3 pb-3 pt-0 border-t border-cc-border mt-0",children:e.jsx("pre",{className:"mt-2 text-[11px] text-cc-muted font-mono-code whitespace-pre-wrap leading-relaxed max-h-60 overflow-y-auto",children:JSON.stringify(g.input,null,2)})})]})})]})}return e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"w-6 h-6 rounded-full bg-cc-primary/10 flex items-center justify-center shrink-0 mt-0.5",children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3 h-3 text-cc-primary",children:e.jsx("circle",{cx:"8",cy:"8",r:"3"})})}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsxs("div",{className:"border border-cc-border rounded-[10px] overflow-hidden bg-cc-card",children:[e.jsxs("button",{onClick:()=>i(!n),className:"w-full flex items-center gap-2.5 px-3 py-2 text-left hover:bg-cc-hover transition-colors cursor-pointer",children:[e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:`w-3 h-3 text-cc-muted transition-transform shrink-0 ${n?"rotate-90":""}`,children:e.jsx("path",{d:"M6 4l4 4-4 4"})}),e.jsx(ae,{type:r}),e.jsx("span",{className:"text-xs font-medium text-cc-fg",children:m}),e.jsx("span",{className:"text-[10px] text-cc-muted bg-cc-hover rounded-full px-1.5 py-0.5 tabular-nums font-medium",children:o})]}),n&&e.jsx("div",{className:"border-t border-cc-border px-3 py-1.5",children:c.map((g,l)=>{const p=ie(g.name,g.input);return e.jsxs("div",{className:"flex items-center gap-2 py-1 text-xs text-cc-muted font-mono-code truncate",children:[e.jsx("span",{className:"w-1 h-1 rounded-full bg-cc-muted/40 shrink-0"}),e.jsx("span",{className:"truncate",children:p||JSON.stringify(g.input).slice(0,80)})]},g.id||l)})})]})})]})}function ms({description:t,agentType:c,backend:n="codex",status:i,senderThreadId:r,receiverThreadIds:m=[],receiverCount:o,items:g}){var N;const[l,p]=x.useState(!0),a=x.useMemo(()=>{if(!i)return null;const u=i.trim().toLowerCase();return u?u==="completed"?{label:"completed",className:"text-green-600 bg-green-500/15",summary:"completed"}:u==="failed"||u==="error"||u==="errored"?{label:"failed",className:"text-cc-error bg-cc-error/10",summary:"failed"}:u==="pending"||u==="pendinginit"||u==="pending_init"?{label:"pending",className:"text-amber-700 bg-amber-500/15",summary:"pending"}:u==="running"||u==="inprogress"||u==="in_progress"||u==="started"?{label:"running",className:"text-blue-600 bg-blue-500/15",summary:"running"}:{label:i,className:"text-amber-700 bg-amber-500/15",summary:"running"}:null},[i]),y=o!==void 0?o:g.length;return e.jsxs("div",{className:"ml-9 border-l-2 border-cc-primary/20 pl-4",children:[e.jsxs("button",{onClick:()=>p(!l),className:"w-full flex items-center gap-2 py-1.5 text-left cursor-pointer mb-1",children:[e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:`w-3 h-3 text-cc-muted transition-transform shrink-0 ${l?"rotate-90":""}`,children:e.jsx("path",{d:"M6 4l4 4-4 4"})}),e.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-3.5 h-3.5 text-cc-primary shrink-0",children:[e.jsx("circle",{cx:"8",cy:"8",r:"5"}),e.jsx("path",{d:"M8 5v3l2 1",strokeLinecap:"round"})]}),e.jsx("span",{className:"text-xs font-medium text-cc-fg truncate",children:t}),c&&e.jsx("span",{className:"text-[10px] text-cc-muted bg-cc-hover rounded-full px-1.5 py-0.5 shrink-0",children:c}),e.jsx("span",{className:"text-[10px] text-cc-muted bg-cc-hover rounded-full px-1.5 py-0.5 shrink-0",children:n==="codex"?"Codex":"Claude"}),a&&e.jsx("span",{className:`text-[10px] rounded-full px-1.5 py-0.5 shrink-0 ${a.className}`,children:a.label}),o!==void 0&&e.jsxs("span",{className:"text-[10px] text-cc-muted bg-cc-hover rounded-full px-1.5 py-0.5 shrink-0",children:[o," agent",o===1?"":"s"]}),e.jsx("span",{className:"text-[10px] text-cc-muted bg-cc-hover rounded-full px-1.5 py-0.5 tabular-nums shrink-0 ml-auto",children:g.length})]}),l&&e.jsxs("div",{className:"space-y-3 pb-2",children:[(a||r||m.length>0)&&e.jsxs("div",{className:"rounded-lg border border-cc-border bg-cc-card px-2.5 py-2 space-y-1.5",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-[10px]",children:[a&&e.jsxs("span",{className:`rounded-full px-1.5 py-0.5 ${a.className}`,children:[y," ",a.summary]}),r&&e.jsxs("span",{className:"rounded-full px-1.5 py-0.5 text-cc-muted bg-cc-hover font-mono-code",children:["sender: ",r]}),m.length>0&&e.jsxs("span",{className:"rounded-full px-1.5 py-0.5 text-cc-muted bg-cc-hover",children:["receivers: ",m.length]})]}),m.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1",children:m.map(u=>e.jsx("span",{className:"text-[10px] rounded-full px-1.5 py-0.5 text-cc-muted bg-cc-hover font-mono-code",children:u},u))})]}),e.jsx(ne,{toolName:((N=g[0])==null?void 0:N.name)||"Grep",items:g})]})]})}const R="codex-playground-demo";function ps(){return x.useEffect(()=>{const t=b.getState(),c=t.sessions.get(R);return t.addSession({session_id:R,backend_type:"codex",model:"o3",cwd:"/Users/demo/project",tools:[],permissionMode:"bypassPermissions",claude_code_version:"0.1.0",mcp_servers:[],agents:[],slash_commands:[],skills:[],total_cost_usd:0,num_turns:8,context_used_percent:45,is_compacting:!1,git_branch:"main",is_worktree:!1,is_containerized:!1,repo_root:"/Users/demo/project",git_ahead:0,git_behind:0,total_lines_added:0,total_lines_removed:0,codex_rate_limits:{primary:{usedPercent:62,windowDurationMins:300,resetsAt:Date.now()+2*36e5},secondary:{usedPercent:18,windowDurationMins:10080,resetsAt:Date.now()+5*864e5}},codex_token_details:{inputTokens:84230,outputTokens:12450,cachedInputTokens:41200,reasoningOutputTokens:8900,modelContextWindow:2e5}}),()=>{b.setState(n=>{const i=new Map(n.sessions);return c?i.set(R,c):i.delete(R),{sessions:i}})}},[]),e.jsxs("div",{className:"w-[280px] border border-cc-border rounded-xl overflow-hidden bg-cc-card",children:[e.jsx(ve,{sessionId:R}),e.jsx(we,{sessionId:R})]})}function W({updateInfo:t}){return x.useEffect(()=>{const c=b.getState().updateInfo,n=b.getState().updateDismissedVersion;return b.getState().setUpdateInfo(t),n&&b.setState({updateDismissedVersion:null}),()=>{b.getState().setUpdateInfo(c),n&&b.setState({updateDismissedVersion:n})}},[t]),e.jsx(Ne,{})}function xs(){const[t,c]=x.useState(!1),[n,i]=x.useState("/tmp");return x.useEffect(()=>{ke.getHome().then(r=>i(r.cwd)).catch(()=>{})},[]),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{onClick:()=>c(!0),className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-cc-hover border border-cc-border hover:bg-cc-active transition-colors cursor-pointer",children:[e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-4 h-4 text-cc-primary",children:e.jsx("path",{d:"M4 1.5a.5.5 0 01.5-.5h7a.5.5 0 01.354.146l2 2A.5.5 0 0114 3.5v11a.5.5 0 01-.5.5h-11a.5.5 0 01-.5-.5v-13zm1 .5v12h8V4h-1.5a.5.5 0 01-.5-.5V2H5zm6 0v1h1l-1-1zM6.5 7a.5.5 0 000 1h5a.5.5 0 000-1h-5zm0 2a.5.5 0 000 1h5a.5.5 0 000-1h-5zm0 2a.5.5 0 000 1h3a.5.5 0 000-1h-3z"})}),e.jsx("span",{className:"text-xs font-medium text-cc-fg",children:"Edit CLAUDE.md"})]}),e.jsx("span",{className:"text-[11px] text-cc-muted",children:"Click to open the editor modal (uses server working directory)"}),e.jsx(_e,{cwd:n,open:t,onClose:()=>c(!1)})]})}function us({server:t}){var m;const[c,n]=x.useState(!1),i={connected:{label:"Connected",cls:"text-cc-success bg-cc-success/10",dot:"bg-cc-success"},connecting:{label:"Connecting",cls:"text-cc-warning bg-cc-warning/10",dot:"bg-cc-warning animate-pulse"},failed:{label:"Failed",cls:"text-cc-error bg-cc-error/10",dot:"bg-cc-error"},disabled:{label:"Disabled",cls:"text-cc-muted bg-cc-hover",dot:"bg-cc-muted opacity-40"}},r=i[t.status]||i.disabled;return e.jsxs("div",{className:"rounded-lg border border-cc-border bg-cc-bg",children:[e.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-2",children:[e.jsx("span",{className:`w-1.5 h-1.5 rounded-full shrink-0 ${r.dot}`}),e.jsx("button",{onClick:()=>n(!c),className:"flex-1 min-w-0 text-left cursor-pointer",children:e.jsx("span",{className:"text-[12px] font-medium text-cc-fg truncate block",children:t.name})}),e.jsx("span",{className:`text-[9px] font-medium px-1.5 rounded-full leading-[16px] shrink-0 ${r.cls}`,children:r.label})]}),c&&e.jsxs("div",{className:"px-2.5 pb-2.5 space-y-1.5 border-t border-cc-border pt-2",children:[e.jsxs("div",{className:"text-[11px] text-cc-muted space-y-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-cc-muted/60",children:"Type:"}),e.jsx("span",{children:t.config.type})]}),t.config.command&&e.jsxs("div",{className:"flex items-start gap-1",children:[e.jsx("span",{className:"text-cc-muted/60 shrink-0",children:"Cmd:"}),e.jsxs("span",{className:"font-mono text-[10px] break-all",children:[t.config.command,(m=t.config.args)!=null&&m.length?` ${t.config.args.join(" ")}`:""]})]}),t.config.url&&e.jsxs("div",{className:"flex items-start gap-1",children:[e.jsx("span",{className:"text-cc-muted/60 shrink-0",children:"URL:"}),e.jsx("span",{className:"font-mono text-[10px] break-all",children:t.config.url})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"text-cc-muted/60",children:"Scope:"}),e.jsx("span",{children:t.scope})]})]}),t.error&&e.jsx("div",{className:"text-[11px] text-cc-error bg-cc-error/5 rounded px-2 py-1",children:t.error}),t.tools&&t.tools.length>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsxs("span",{className:"text-[10px] text-cc-muted uppercase tracking-wider",children:["Tools (",t.tools.length,")"]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:t.tools.map(o=>e.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-cc-hover text-cc-fg",children:o.name},o.name))})]})]})]})}function hs({task:t}){const c=t.status==="completed",n=t.status==="in_progress";return e.jsxs("div",{className:`px-2.5 py-2 rounded-lg ${c?"opacity-50":""}`,children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"shrink-0 flex items-center justify-center w-4 h-4 mt-px",children:n?e.jsx("svg",{className:"w-4 h-4 text-cc-primary animate-spin",viewBox:"0 0 16 16",fill:"none",children:e.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"28",strokeDashoffset:"8",strokeLinecap:"round"})}):c?e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-4 h-4 text-cc-success",children:e.jsx("path",{fillRule:"evenodd",d:"M8 15A7 7 0 108 1a7 7 0 000 14zm3.354-9.354a.5.5 0 00-.708-.708L7 8.586 5.354 6.94a.5.5 0 10-.708.708l2 2a.5.5 0 00.708 0l4-4z",clipRule:"evenodd"})}):e.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-4 h-4 text-cc-muted",children:e.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5"})})}),e.jsx("span",{className:`text-[13px] leading-snug flex-1 ${c?"text-cc-muted line-through":"text-cc-fg"}`,children:t.subject})]}),n&&t.activeForm&&e.jsx("p",{className:"mt-1 ml-6 text-[11px] text-cc-muted italic truncate",children:t.activeForm}),t.blockedBy&&t.blockedBy.length>0&&e.jsxs("p",{className:"mt-1 ml-6 text-[11px] text-cc-muted flex items-center gap-1",children:[e.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3 h-3 shrink-0",children:[e.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5"}),e.jsx("path",{d:"M5 8h6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),e.jsxs("span",{children:["blocked by ",t.blockedBy.map(i=>`#${i}`).join(", ")]})]})]})}const I="ai-validation-playground";function he({enabled:t}){return x.useEffect(()=>{const c=b.getState(),n=c.sessions.get(I);return c.updateSession(I,{session_id:I,model:"claude-sonnet-4-20250514",cwd:"/workspace",tools:[],permissionMode:"default",claude_code_version:"1.0.0",mcp_servers:[],agents:[],slash_commands:[],skills:[],total_cost_usd:0,num_turns:0,context_used_percent:0,is_compacting:!1,git_branch:"main",is_worktree:!1,is_containerized:!1,repo_root:"/workspace",git_ahead:0,git_behind:0,total_lines_added:0,total_lines_removed:0,aiValidationEnabled:t,aiValidationAutoApprove:!0,aiValidationAutoDeny:!1,...n}),()=>{n&&b.getState().updateSession(I,n)}},[t]),x.useEffect(()=>{b.getState().setSessionAiValidation(I,{aiValidationEnabled:t})},[t]),e.jsxs("div",{className:"flex items-center gap-2 p-2",children:[e.jsx(je,{sessionId:I}),e.jsx("span",{className:"text-xs text-cc-muted",children:"Click to toggle"})]})}function gs(){const[t,c]=x.useState(!0),[n,i]=x.useState("running"),r=[{name:"Explore codebase",agentType:"Explore",status:n,startedAt:Date.now()-12e3,completedAt:n==="completed"?Date.now():void 0},{name:"Research auth patterns",agentType:"general-purpose",status:"completed",startedAt:Date.now()-45e3,completedAt:Date.now()-3e3}],m=[{id:"1",subject:"Implement ActivityTray component",description:"",status:"completed"},{id:"2",subject:"Wire into ChatView layout",description:"",status:"completed"},{id:"3",subject:"Add background agent detection",description:"",status:"in_progress",activeForm:"Detecting Agent tool_use"},{id:"4",subject:"Write tests",description:"",status:"pending"}],o=r.filter(a=>a.status==="running").length,g=m.filter(a=>a.status==="completed").length,l=o>0||m.some(a=>a.status==="in_progress");function p(a,y){const N=Math.round(((y||Date.now())-a)/1e3);if(N<60)return`${N}s`;const u=Math.floor(N/60),D=N%60;return`${u}m${D>0?` ${D}s`:""}`}return e.jsxs("div",{className:"relative h-48 bg-cc-bg rounded-lg border border-cc-border/30 overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:e.jsx("span",{className:"text-[10px] text-cc-muted/20",children:"Chat area"})}),e.jsx("div",{className:"absolute top-2 left-2 z-30",children:e.jsxs("button",{type:"button",onClick:()=>i(a=>a==="running"?"completed":"running"),className:"text-[10px] px-2 py-1 rounded bg-cc-surface border border-cc-border text-cc-muted hover:text-cc-fg cursor-pointer",children:["Toggle agent: ",n]})}),e.jsxs("div",{className:"absolute bottom-3 right-3 z-20",children:[t&&e.jsxs("div",{className:"mb-1.5 w-72 max-w-[calc(100vw-2rem)] max-h-52 overflow-y-auto rounded-xl border border-cc-border/60 bg-cc-surface/95 backdrop-blur-xl shadow-lg shadow-black/20 animate-[fadeSlideIn_0.2s_ease-out]",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-cc-border/40",children:[e.jsx("span",{className:"text-[11px] font-semibold text-cc-fg/70 uppercase tracking-wider",role:"heading","aria-level":3,children:"Activity"}),e.jsx("button",{type:"button",onClick:()=>c(!1),className:"flex items-center justify-center w-7 h-7 -mr-1 rounded-md text-cc-muted/40 hover:text-cc-muted/70 hover:bg-cc-hover/50 transition-colors cursor-pointer","aria-label":"Close activity tray",children:e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3 h-3",children:e.jsx("path",{d:"M4.646 4.646a.5.5 0 01.708 0L8 7.293l2.646-2.647a.5.5 0 01.708.708L8.707 8l2.647 2.646a.5.5 0 01-.708.708L8 8.707l-2.646 2.647a.5.5 0 01-.708-.708L7.293 8 4.646 5.354a.5.5 0 010-.708z"})})})]}),e.jsxs("div",{className:"py-1",children:[e.jsx("div",{className:"px-3 py-1",role:"heading","aria-level":4,children:e.jsx("span",{className:"text-[9px] text-cc-muted/40 uppercase tracking-widest font-semibold",children:"Agents"})}),r.map((a,y)=>e.jsxs("div",{className:`flex items-center gap-2 px-2.5 min-h-[36px] transition-opacity duration-300 ${a.status!=="running"?"opacity-60":""}`,children:[a.status==="running"?e.jsxs("span",{className:"relative flex h-1.5 w-1.5 shrink-0",children:[e.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-cc-warning opacity-75 animate-ping"}),e.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-cc-warning"})]}):e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-cc-success shrink-0"}),e.jsx("span",{className:"text-[11px] text-cc-fg/80 truncate flex-1 font-medium",children:a.name}),e.jsx("span",{className:"text-[9px] text-cc-muted/50 uppercase tracking-wider shrink-0",children:a.agentType}),e.jsx("span",{className:"text-[10px] text-cc-muted/50 tabular-nums font-mono-code",children:p(a.startedAt,a.completedAt)})]},y))]}),e.jsx("div",{className:"border-t border-cc-border/30 mx-2",role:"separator"}),e.jsxs("div",{className:"py-1",children:[e.jsx("div",{className:"px-3 py-1",role:"heading","aria-level":4,children:e.jsx("span",{className:"text-[9px] text-cc-muted/40 uppercase tracking-widest font-semibold",children:"Tasks"})}),m.map(a=>e.jsxs("div",{className:`flex items-center gap-2 px-2.5 min-h-[32px] transition-opacity duration-300 ${a.status==="completed"?"opacity-40":""}`,children:[e.jsx("span",{className:"shrink-0 flex items-center justify-center w-3.5 h-3.5",children:a.status==="in_progress"?e.jsx("svg",{className:"w-3.5 h-3.5 text-cc-primary animate-spin",viewBox:"0 0 16 16",fill:"none",children:e.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"28",strokeDashoffset:"8",strokeLinecap:"round"})}):a.status==="completed"?e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:"w-3.5 h-3.5 text-cc-success",children:e.jsx("path",{fillRule:"evenodd",d:"M8 15A7 7 0 108 1a7 7 0 000 14zm3.354-9.354a.5.5 0 00-.708-.708L7 8.586 5.354 6.94a.5.5 0 10-.708.708l2 2a.5.5 0 00.708 0l4-4z",clipRule:"evenodd"})}):e.jsx("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3.5 h-3.5 text-cc-muted/40",children:e.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5"})})}),e.jsx("span",{className:`text-[11px] leading-snug flex-1 truncate ${a.status==="completed"?"text-cc-muted line-through":"text-cc-fg/80"}`,children:a.subject}),a.status==="in_progress"&&a.activeForm&&e.jsx("span",{className:"text-[10px] text-cc-muted/50 italic truncate max-w-[120px] shrink-0",children:a.activeForm})]},a.id))]})]}),e.jsxs("button",{type:"button",onClick:()=>c(!t),"aria-expanded":t,className:`flex items-center gap-2 px-3 min-h-[36px] rounded-full border border-cc-border/50 bg-cc-surface/90 backdrop-blur-lg shadow-md shadow-black/15 hover:bg-cc-hover/80 hover:border-cc-border/70 transition-all duration-200 cursor-pointer ${t?"ring-1 ring-cc-primary/30":""}`,children:[l?e.jsxs("span",{className:"relative flex h-2 w-2",children:[e.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-cc-warning opacity-75 animate-ping"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-cc-warning"})]}):e.jsx("span",{className:"h-2 w-2 rounded-full bg-cc-success"}),o>0?e.jsxs("span",{className:"text-[11px] text-cc-fg/70 font-medium tabular-nums",children:[o," agent",o!==1?"s":""]}):e.jsxs("span",{className:"text-[11px] text-cc-fg/70 font-medium tabular-nums",children:[r.length," done"]}),e.jsx("span",{className:"w-0.5 h-0.5 rounded-full bg-cc-muted/30"}),e.jsxs("span",{className:"text-[11px] text-cc-fg/70 tabular-nums",children:[g,"/",m.length]}),e.jsx("svg",{viewBox:"0 0 16 16",fill:"currentColor",className:`w-2.5 h-2.5 text-cc-muted/40 transition-transform duration-200 ${t?"rotate-180":""}`,"aria-hidden":!0,children:e.jsx("path",{d:"M4 6l4 4 4-4"})})]})]})]})}export{js as Playground};
|