@netnodeag/kraftwerk 0.42.0 → 0.42.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (26) hide show
  1. package/README.md +3 -3
  2. package/dist/cli/knowledge.js +3 -3
  3. package/dist/cli/kraftwerk.js +1 -1
  4. package/dist/inspector/chat/sessions.js +1 -1
  5. package/dist/inspector/knowledge.d.ts +1 -1
  6. package/dist/inspector/knowledge.js +1 -1
  7. package/dist/okf.d.ts +1 -1
  8. package/dist/okf.js +1 -1
  9. package/inspector/dist/assets/{dist-CE4xSQoL.js → dist-BJxiusVh.js} +1 -1
  10. package/inspector/dist/assets/{dist-5tG7aS9B.js → dist-BnxCrUQZ.js} +1 -1
  11. package/inspector/dist/assets/{dist-W68I5dk2.js → dist-BpgTFX4N.js} +1 -1
  12. package/inspector/dist/assets/dist-C6Q5FWM0.js +1 -0
  13. package/inspector/dist/assets/{dist-C3XpBw6W.js → dist-C8aIUi2c.js} +1 -1
  14. package/inspector/dist/assets/{dist-DmP7Dxbp.js → dist-Cn-NK0yx.js} +1 -1
  15. package/inspector/dist/assets/{dist-DAeASF1A.js → dist-DQbdG8Cf.js} +1 -1
  16. package/inspector/dist/assets/{dist-D8KGprRA.js → dist-DkSZQh-S.js} +1 -1
  17. package/inspector/dist/assets/{dist-CxiuM_jC.js → dist-OsHgcj_x.js} +1 -1
  18. package/inspector/dist/assets/{dist-DzY0J5Mz.js → dist-cZmo-9Se.js} +1 -1
  19. package/inspector/dist/assets/{dist-CvxuLI-i.js → dist-z049FsVf.js} +1 -1
  20. package/inspector/dist/assets/{editor-CyEovn1g.js → editor-BQkS4m10.js} +3 -3
  21. package/inspector/dist/assets/{index-B2d-nOUv.js → index-DGlIITXq.js} +3 -3
  22. package/inspector/dist/assets/index-DuZ9U4BZ.css +1 -0
  23. package/inspector/dist/index.html +2 -2
  24. package/package.json +1 -1
  25. package/inspector/dist/assets/dist-IEe8XFs2.js +0 -1
  26. package/inspector/dist/assets/index-BRw2ED9p.css +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/editor-CyEovn1g.js","assets/dist-H3rerbMg.js","assets/dist-DAeASF1A.js","assets/dist-CvxuLI-i.js","assets/dist-CE4xSQoL.js","assets/dist-CPlSMtdY.js","assets/editor-B1Jq9YIq.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/editor-BQkS4m10.js","assets/dist-H3rerbMg.js","assets/dist-DQbdG8Cf.js","assets/dist-z049FsVf.js","assets/dist-BJxiusVh.js","assets/dist-CPlSMtdY.js","assets/editor-B1Jq9YIq.css"])))=>i.map(i=>d[i]);
2
2
  var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ee(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var te=/\/+/g;function ne(e,t){return typeof e==`object`&&e&&e.key!=null?ee(``+e.key):t.toString(36)}function k(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function re(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,re(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ne(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(te,`$&/`)+`/`),re(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(te,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ne(a,u),c+=re(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ne(a,u++),c+=re(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return re(k(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function A(e,t,n){if(e==null)return e;var r=[],i=0;return re(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ie(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var j=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},M={map:A,forEach:function(e,t,n){A(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return A(e,function(){t++}),t},toArray:function(e){return A(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=M,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ie}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,j)}catch(e){j(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&ne(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ne(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var ee=new MessageChannel,te=ee.port2;ee.port1.onmessage=D,O=function(){te.postMessage(null)}}else O=function(){_(D,0)};function ne(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ne(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),ee=Symbol.for(`react.activity`),te=Symbol.for(`react.memo_cache_sentinel`),ne=Symbol.iterator;function k(e){return typeof e!=`object`||!e?null:(e=ne&&e[ne]||e[`@@iterator`],typeof e==`function`?e:null)}var re=Symbol.for(`react.client.reference`);function A(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case ee:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?A(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return A(e(t))}catch{}}return null}var ie=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},N=[],oe=-1;function se(e){return{current:e}}function ce(e){0>oe||(e.current=N[oe],N[oe]=null,oe--)}function P(e,t){oe++,N[oe]=e.current,e.current=t}var le=se(null),ue=se(null),de=se(null),fe=se(null);function pe(e,t){switch(P(de,t),P(ue,e),P(le,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ce(le),P(le,e)}function F(){ce(le),ce(ue),ce(de)}function me(e){e.memoizedState!==null&&P(fe,e);var t=le.current,n=Hd(t,e.type);t!==n&&(P(ue,e),P(le,n))}function I(e){ue.current===e&&(ce(le),ce(ue)),fe.current===e&&(ce(fe),Qf._currentValue=ae)}var he,ge;function _e(e){if(he===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);he=t&&t[1]||``,ge=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+he+e+ge}var ve=!1;function ye(e,t){if(!e||ve)return``;ve=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
@@ -200,7 +200,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
200
200
  </table>
201
201
  <script>setTimeout(() => window.print(), 400);<\/script>
202
202
  </body>
203
- </html>`;n.location.href=URL.createObjectURL(new Blob([p],{type:`text/html`}))}function Vi(e,t){return e.split(/(```[\s\S]*?```|`[^`]*`)/).map((e,n)=>n%2==1?e:e.replace(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,(e,n,r)=>{let i=n.trim().replace(/\.md$/,``),a=(r??i).trim();return t===null?a:`[${a}](#/knowledge/${encodeURIComponent(t)}/${i})`})).join(``)}function Hi(e){let t=[];return{md:e.replace(/^\[\^([^\]]+)\]:[ \t]*(.+)$/gm,(e,n,r)=>(t.push({id:n,text:r.trim()}),``)).replace(/\[\^([^\]]+)\]/g,(e,n)=>{let r=t.findIndex(e=>e.id===n);return r>=0?`<sup class="fnref">${r+1}</sup>`:``}),notes:t}}function Ui(e,t){let n=new DOMParser().parseFromString(e,`text/html`),r=t.title,i=n.body.firstElementChild;t.titleIsFallback&&i?.tagName===`H1`&&(r=i.textContent?.trim()||r,i.remove());let a=n.createElement(`header`);a.innerHTML=`<h1>${Wi(r)}</h1><div class="meta">${Wi(t.meta)}</div>`,n.body.prepend(a);for(let e of n.querySelectorAll(`table`)){e.classList.add(`md`);for(let t of e.querySelectorAll(`th, td`))(t.textContent??``).trim().length<=14&&t.classList.add(`nw`)}for(let e of[5,4,3,2,1])for(let t of Array.from(n.body.querySelectorAll(`:scope > h${e}`))){let r=n.createElement(`h${e+1}`);r.innerHTML=t.innerHTML,t.replaceWith(r)}for(let e of Array.from(n.body.querySelectorAll(`:scope > header, :scope > h2, :scope > h3, :scope > h4`))){let t=e.nextElementSibling;if(!t||/^H[1-6]$/.test(t.tagName))continue;let r=n.createElement(`div`);r.className=`keep`,e.replaceWith(r),r.append(e,t)}return{html:n.body.innerHTML,title:r}}function Wi(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Gi(e,t){return`/edit/${encodeURIComponent(e)}/${t.split(`/`).map(encodeURIComponent).join(`/`)}`}function Ki({bundle:e,conceptId:t}){let n=F(`/api/knowledge`,!1),r=n?.bundles??[];return(0,S.jsxs)(`div`,{className:`runs-screen`,children:[(0,S.jsxs)(`aside`,{className:`runs-side`,children:[(0,S.jsxs)(`div`,{className:`side-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`bundles`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(A,{href:`/knowledge`,className:`open-raw`,children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` new`]})]}),(0,S.jsxs)(`div`,{className:`side-list`,children:[r.map(t=>(0,S.jsxs)(A,{href:`/knowledge/${encodeURIComponent(t.name)}`,className:`side-row ${t.name===e?`active`:``}`,children:[(0,S.jsx)(`span`,{className:`lamp ok`}),(0,S.jsxs)(`div`,{className:`side-row-body`,children:[(0,S.jsxs)(`div`,{className:`side-row-top`,children:[(0,S.jsx)(`span`,{className:`side-wf`,children:t.name}),(0,S.jsx)(`span`,{className:`side-when num`,children:t.concepts})]}),(0,S.jsx)(`div`,{className:`side-row-sub`,children:(0,S.jsxs)(`span`,{className:`side-req`,children:[t.okfVersion?`okf ${t.okfVersion}`:`okf`,t.updatedAt?` · ${t.updatedAt.slice(0,10)}`:``]})})]})]},t.name)),n&&r.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no bundles yet`})]})]}),(0,S.jsx)(`div`,{className:`runs-main`,children:e?(0,S.jsx)(Xi,{name:e,conceptId:t},e):(0,S.jsx)(qi,{root:n?.root})})]})}function qi({root:e}){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1);async function s(){let e=t.trim();if(!e)return;o(!0),i(``);let n=await(await fetch(`/api/knowledge`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:e})})).json();o(!1),n.error?i(n.error):window.location.hash=`/knowledge/${encodeURIComponent(e)}`}return(0,S.jsxs)(`div`,{className:`new-chat`,children:[(0,S.jsx)(`div`,{className:`page-head`,children:(0,S.jsx)(`h1`,{children:`context & knowledge`})}),(0,S.jsxs)(`section`,{className:`panel new-chat-panel`,children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`what lives here`})}),(0,S.jsxs)(`div`,{className:`know-intro`,children:[`Curated knowledge as `,(0,S.jsx)(`b`,{children:`OKF bundles`}),` (Open Knowledge Format v0.2): plain markdown files with YAML frontmatter`,e?(0,S.jsxs)(S.Fragment,{children:[` under `,(0,S.jsx)(`code`,{children:e})]}):null,`, readable by humans and agents, diffable in git. Agents write through`,` `,(0,S.jsx)(`code`,{children:`kraftwerk knowledge put`}),` (provenance is stamped automatically); you raise a concept's trust tier by verifying it here.`]}),(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`new bundle`})}),(0,S.jsxs)(`div`,{className:`know-newbundle`,children:[(0,S.jsx)(`input`,{value:t,placeholder:`bundle name, e.g. customer-support`,onChange:e=>n(e.target.value),onKeyDown:e=>e.key===`Enter`&&void s()}),(0,S.jsx)(`button`,{className:`run-btn`,disabled:!t.trim()||a,onClick:s,children:a?`creating…`:`create`})]}),r&&(0,S.jsxs)(`div`,{className:`msg error`,children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` `,r]})]})]})}function Ji({tier:e}){return(0,S.jsx)(`span`,{className:`chip trust ${e}`,children:e})}var Yi=`@activity`;function Xi({name:e,conceptId:t}){let n=F(`/api/knowledge/${encodeURIComponent(e)}`,!1);if(!n)return(0,S.jsx)(`div`,{className:`empty`,children:`loading…`});if(`error`in n)return(0,S.jsx)(`div`,{className:`empty`,children:`bundle not found`});let r=t===Yi?`activity`:`pages`,i=n.concepts,a=r===`pages`?t&&i.some(e=>e.id===t)?t:i[0]?.id:void 0,o=`/knowledge/${encodeURIComponent(e)}`;return(0,S.jsxs)(`div`,{className:`agent-view`,children:[(0,S.jsxs)(`div`,{className:`page-head`,children:[(0,S.jsx)(`h1`,{children:e}),(0,S.jsxs)(`span`,{className:`count`,children:[i.length,` pages`]}),(0,S.jsxs)(`div`,{className:`tabs`,children:[(0,S.jsx)(A,{href:o,className:r===`pages`?`active`:``,children:`pages`}),(0,S.jsx)(A,{href:`${o}/${Yi}`,className:r===`activity`?`active`:``,children:`activity`})]}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`button`,{className:`open-raw`,onClick:()=>void Bi(e),children:[(0,S.jsx)(C,{name:`picture_as_pdf`,className:`ms-sm`}),` export PDF`]}),(0,S.jsx)(`button`,{className:`run-btn`,onClick:()=>void Gr(`claude`,{kind:`knowledge`,bundle:e}),children:`curate in chat`})]}),r===`activity`?n.log?(0,S.jsx)(ea,{name:e,log:n.log}):(0,S.jsx)(`section`,{className:`panel`,children:(0,S.jsx)(`div`,{className:`viewer-note`,children:`no activity yet`})}):i.length===0?(0,S.jsx)(`section`,{className:`panel`,children:(0,S.jsxs)(`div`,{className:`viewer-note`,children:[`No pages yet — start a chat to author some, or write one with`,` `,(0,S.jsxs)(`code`,{children:[`kraftwerk knowledge put `,e,`/<path>`]}),`.`]})}):(0,S.jsxs)(`div`,{className:`wiki`,children:[(0,S.jsx)(`aside`,{className:`wiki-side`,children:ta(i).map(({folder:e,concepts:t})=>(0,S.jsxs)(v.Fragment,{children:[e&&(0,S.jsxs)(`div`,{className:`wiki-folder`,children:[e,`/`]}),t.map(e=>(0,S.jsxs)(A,{href:`${o}/${e.id}`,className:`wiki-page ${e.id===a?`active`:``}`,title:`${e.id}.md`,children:[(0,S.jsx)(C,{name:Zi(e.type),className:`ms-sm`}),(0,S.jsx)(`span`,{className:`wiki-page-title`,children:e.title}),(e.stale||e.error)&&(0,S.jsx)(`span`,{className:`wiki-dot`,title:e.error??`stale`})]},e.id))]},e||`.`))}),(0,S.jsx)(`div`,{className:`wiki-main`,children:a&&(0,S.jsx)(na,{bundle:e,conceptId:a},a)})]})]})}function Zi(e){switch((e??``).toLowerCase()){case`reference`:return`article`;case`policy`:return`gavel`;case`guide`:case`howto`:return`route`;case`decision`:return`balance`;default:return`menu_book`}}function Qi(e){let t=[];for(let n of e.split(`
203
+ </html>`;n.location.href=URL.createObjectURL(new Blob([p],{type:`text/html`}))}function Vi(e,t){return e.split(/(```[\s\S]*?```|`[^`]*`)/).map((e,n)=>n%2==1?e:e.replace(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,(e,n,r)=>{let i=n.trim().replace(/\.md$/,``),a=(r??i).trim();return t===null?a:`[${a}](#/knowledge/${encodeURIComponent(t)}/${i})`})).join(``)}function Hi(e){let t=[];return{md:e.replace(/^\[\^([^\]]+)\]:[ \t]*(.+)$/gm,(e,n,r)=>(t.push({id:n,text:r.trim()}),``)).replace(/\[\^([^\]]+)\]/g,(e,n)=>{let r=t.findIndex(e=>e.id===n);return r>=0?`<sup class="fnref">${r+1}</sup>`:``}),notes:t}}function Ui(e,t){let n=new DOMParser().parseFromString(e,`text/html`),r=t.title,i=n.body.firstElementChild;t.titleIsFallback&&i?.tagName===`H1`&&(r=i.textContent?.trim()||r,i.remove());let a=n.createElement(`header`);a.innerHTML=`<h1>${Wi(r)}</h1><div class="meta">${Wi(t.meta)}</div>`,n.body.prepend(a);for(let e of n.querySelectorAll(`table`)){e.classList.add(`md`);for(let t of e.querySelectorAll(`th, td`))(t.textContent??``).trim().length<=14&&t.classList.add(`nw`)}for(let e of[5,4,3,2,1])for(let t of Array.from(n.body.querySelectorAll(`:scope > h${e}`))){let r=n.createElement(`h${e+1}`);r.innerHTML=t.innerHTML,t.replaceWith(r)}for(let e of Array.from(n.body.querySelectorAll(`:scope > header, :scope > h2, :scope > h3, :scope > h4`))){let t=e.nextElementSibling;if(!t||/^H[1-6]$/.test(t.tagName))continue;let r=n.createElement(`div`);r.className=`keep`,e.replaceWith(r),r.append(e,t)}return{html:n.body.innerHTML,title:r}}function Wi(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function Gi(e,t){return`/edit/${encodeURIComponent(e)}/${t.split(`/`).map(encodeURIComponent).join(`/`)}`}function Ki({bundle:e,conceptId:t}){let n=F(`/api/knowledge`,!1),r=n?.bundles??[];return(0,S.jsxs)(`div`,{className:`runs-screen`,children:[(0,S.jsxs)(`aside`,{className:`runs-side`,children:[(0,S.jsxs)(`div`,{className:`side-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`bundles`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(A,{href:`/knowledge`,className:`open-raw`,children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` new`]})]}),(0,S.jsxs)(`div`,{className:`side-list`,children:[r.map(t=>(0,S.jsxs)(A,{href:`/knowledge/${encodeURIComponent(t.name)}`,className:`side-row ${t.name===e?`active`:``}`,children:[(0,S.jsx)(`span`,{className:`lamp ok`}),(0,S.jsxs)(`div`,{className:`side-row-body`,children:[(0,S.jsxs)(`div`,{className:`side-row-top`,children:[(0,S.jsx)(`span`,{className:`side-wf`,children:t.name}),(0,S.jsx)(`span`,{className:`side-when num`,children:t.concepts})]}),(0,S.jsx)(`div`,{className:`side-row-sub`,children:(0,S.jsxs)(`span`,{className:`side-req`,children:[t.okfVersion?`okf ${t.okfVersion}`:`okf`,t.updatedAt?` · ${t.updatedAt.slice(0,10)}`:``]})})]})]},t.name)),n&&r.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no bundles yet`})]})]}),(0,S.jsx)(`div`,{className:`runs-main`,children:e?(0,S.jsx)(Xi,{name:e,conceptId:t},e):(0,S.jsx)(qi,{root:n?.root})})]})}function qi({root:e}){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1);async function s(){let e=t.trim();if(!e)return;o(!0),i(``);let n=await(await fetch(`/api/knowledge`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({name:e})})).json();o(!1),n.error?i(n.error):window.location.hash=`/knowledge/${encodeURIComponent(e)}`}return(0,S.jsxs)(`div`,{className:`new-chat`,children:[(0,S.jsx)(`div`,{className:`page-head`,children:(0,S.jsx)(`h1`,{children:`knowledge`})}),(0,S.jsxs)(`section`,{className:`panel new-chat-panel`,children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`what lives here`})}),(0,S.jsxs)(`div`,{className:`know-intro`,children:[`Curated knowledge as `,(0,S.jsx)(`b`,{children:`OKF bundles`}),` (Open Knowledge Format v0.2): plain markdown files with YAML frontmatter`,e?(0,S.jsxs)(S.Fragment,{children:[` under `,(0,S.jsx)(`code`,{children:e})]}):null,`, readable by humans and agents, diffable in git. Agents write through`,` `,(0,S.jsx)(`code`,{children:`kraftwerk knowledge put`}),` (provenance is stamped automatically); you raise a concept's trust tier by verifying it here.`]}),(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`new bundle`})}),(0,S.jsxs)(`div`,{className:`know-newbundle`,children:[(0,S.jsx)(`input`,{value:t,placeholder:`bundle name, e.g. customer-support`,onChange:e=>n(e.target.value),onKeyDown:e=>e.key===`Enter`&&void s()}),(0,S.jsx)(`button`,{className:`run-btn`,disabled:!t.trim()||a,onClick:s,children:a?`creating…`:`create`})]}),r&&(0,S.jsxs)(`div`,{className:`msg error`,children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` `,r]})]})]})}function Ji({tier:e}){return(0,S.jsx)(`span`,{className:`chip trust ${e}`,children:e})}var Yi=`@activity`;function Xi({name:e,conceptId:t}){let n=F(`/api/knowledge/${encodeURIComponent(e)}`,!1);if(!n)return(0,S.jsx)(`div`,{className:`empty`,children:`loading…`});if(`error`in n)return(0,S.jsx)(`div`,{className:`empty`,children:`bundle not found`});let r=t===Yi?`activity`:`pages`,i=n.concepts,a=r===`pages`?t&&i.some(e=>e.id===t)?t:i[0]?.id:void 0,o=`/knowledge/${encodeURIComponent(e)}`;return(0,S.jsxs)(`div`,{className:`agent-view`,children:[(0,S.jsxs)(`div`,{className:`page-head`,children:[(0,S.jsx)(`h1`,{children:e}),(0,S.jsxs)(`span`,{className:`count`,children:[i.length,` pages`]}),(0,S.jsxs)(`div`,{className:`tabs`,children:[(0,S.jsx)(A,{href:o,className:r===`pages`?`active`:``,children:`pages`}),(0,S.jsx)(A,{href:`${o}/${Yi}`,className:r===`activity`?`active`:``,children:`activity`})]}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`button`,{className:`open-raw`,onClick:()=>void Bi(e),children:[(0,S.jsx)(C,{name:`picture_as_pdf`,className:`ms-sm`}),` export PDF`]}),(0,S.jsx)(`button`,{className:`run-btn`,onClick:()=>void Gr(`claude`,{kind:`knowledge`,bundle:e}),children:`curate in chat`})]}),r===`activity`?n.log?(0,S.jsx)(ea,{name:e,log:n.log}):(0,S.jsx)(`section`,{className:`panel`,children:(0,S.jsx)(`div`,{className:`viewer-note`,children:`no activity yet`})}):i.length===0?(0,S.jsx)(`section`,{className:`panel`,children:(0,S.jsxs)(`div`,{className:`viewer-note`,children:[`No pages yet — start a chat to author some, or write one with`,` `,(0,S.jsxs)(`code`,{children:[`kraftwerk knowledge put `,e,`/<path>`]}),`.`]})}):(0,S.jsxs)(`div`,{className:`wiki`,children:[(0,S.jsx)(`aside`,{className:`wiki-side`,children:ta(i).map(({folder:e,concepts:t})=>(0,S.jsxs)(v.Fragment,{children:[e&&(0,S.jsxs)(`div`,{className:`wiki-folder`,children:[e,`/`]}),t.map(e=>(0,S.jsxs)(A,{href:`${o}/${e.id}`,className:`wiki-page ${e.id===a?`active`:``}`,title:`${e.id}.md`,children:[(0,S.jsx)(C,{name:Zi(e.type),className:`ms-sm`}),(0,S.jsx)(`span`,{className:`wiki-page-title`,children:e.title}),(e.stale||e.error)&&(0,S.jsx)(`span`,{className:`wiki-dot`,title:e.error??`stale`})]},e.id))]},e||`.`))}),(0,S.jsx)(`div`,{className:`wiki-main`,children:a&&(0,S.jsx)(na,{bundle:e,conceptId:a},a)})]})]})}function Zi(e){switch((e??``).toLowerCase()){case`reference`:return`article`;case`policy`:return`gavel`;case`guide`:case`howto`:return`route`;case`decision`:return`balance`;default:return`menu_book`}}function Qi(e){let t=[];for(let n of e.split(`
204
204
  `)){let e=n.match(/^##\s+(\d{4}-\d{2}-\d{2})/);if(e){t.push({date:e[1],entries:[]});continue}let r=n.match(/^[*-]\s+\*\*([^*]+)\*\*:\s*(.*)$/);r&&t.length>0&&t[t.length-1].entries.push({kind:r[1].toLowerCase(),text:r[2]})}return t.filter(e=>e.entries.length>0)}function $i(e,t){let n=[],r=/\[([^\]]+)\]\(\/?([^)]+?)\.md\)/g,i=0,a;for(;a=r.exec(t);)a.index>i&&n.push(t.slice(i,a.index)),n.push((0,S.jsx)(A,{href:`/knowledge/${encodeURIComponent(e)}/${a[2].replace(/^\//,``)}`,children:a[1]},a.index)),i=a.index+a[0].length;return i<t.length&&n.push(t.slice(i)),n}function ea({name:e,log:t}){let n=Qi(t),[r,i]=(0,v.useState)(!1);return(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`activity`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>i(!r),children:r?`timeline`:`raw log`})]}),r||n.length===0?(0,S.jsx)(`div`,{className:`viewer-body`,children:(0,S.jsx)(`pre`,{children:t})}):(0,S.jsx)(`div`,{className:`know-log`,children:n.map(t=>(0,S.jsxs)(v.Fragment,{children:[(0,S.jsx)(`div`,{className:`m3-subhead num`,children:t.date}),t.entries.map((t,n)=>(0,S.jsxs)(`div`,{className:`know-log-row`,children:[(0,S.jsx)(`span`,{className:`chip log-kind log-${t.kind}`,children:t.kind}),(0,S.jsx)(`span`,{className:`know-log-text`,children:$i(e,t.text)})]},n))]},t.date))})]})}function ta(e){let t=new Map;for(let n of e){let e=n.id.includes(`/`)?n.id.slice(0,n.id.lastIndexOf(`/`)):``;(t.get(e)??t.set(e,[]).get(e)).push(n)}return[...t.keys()].sort((e,t)=>e===``?-1:t===``?1:e.localeCompare(t)).map(e=>({folder:e,concepts:t.get(e)}))}function na({bundle:e,conceptId:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(`rendered`),y=(0,v.useMemo)(()=>n?kr.sanitize(z.parse(Vi(n.body,e),{async:!1})):``,[n?.body,e]),b=()=>{fetch(`/api/knowledge/${encodeURIComponent(e)}/concept?id=${encodeURIComponent(t)}`).then(e=>e.ok?e.json():Promise.reject()).then(r).catch(()=>a(!0))};(0,v.useEffect)(()=>{if(c)return;let n=!0,i,o=async()=>{try{let i=await fetch(`/api/knowledge/${encodeURIComponent(e)}/concept?id=${encodeURIComponent(t)}`,{cache:`no-store`});if(i.ok){let e=await i.json();n&&(a(!1),r(t=>JSON.stringify(t)===JSON.stringify(e)?t:e))}else i.status===404&&n&&a(!0)}catch{}n&&(i=setTimeout(o,6e3))};return o(),()=>{n=!1,clearTimeout(i)}},[e,t,c]);async function x(){s(!0),await fetch(`/api/knowledge/${encodeURIComponent(e)}/verify`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:t})}).catch(()=>{}),s(!1),b()}async function w(){p(!0),h(``);let n=await fetch(`/api/knowledge/${encodeURIComponent(e)}/concept`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:t,content:u})}).then(e=>e.json()).catch(()=>({error:`save failed`}));p(!1),n.error?h(n.error):(r(n),l(!1))}return i?(0,S.jsx)(`div`,{className:`empty`,children:`concept not found`}):n?(0,S.jsxs)(`div`,{className:`agent-view`,children:[(0,S.jsxs)(`div`,{className:`detail-head`,children:[(0,S.jsx)(`h1`,{children:n.title}),n.type&&(0,S.jsx)(`span`,{className:`chip agent`,children:n.type}),(0,S.jsx)(Ji,{tier:n.trustTier}),n.status!==`stable`&&(0,S.jsx)(`span`,{className:`chip ${n.status}`,children:n.status}),n.stale&&(0,S.jsxs)(`span`,{className:`chip stale`,children:[`stale since `,n.staleAfter?.slice(0,10)]}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(A,{href:Gi(e,n.id),className:`open-raw`,title:`Full-screen document editor with autosave`,children:[(0,S.jsx)(C,{name:`edit_document`,className:`ms-sm`}),` open in editor`]}),(0,S.jsxs)(`button`,{className:`open-raw`,onClick:()=>void Bi(e,n.id),children:[(0,S.jsx)(C,{name:`picture_as_pdf`,className:`ms-sm`}),` export PDF`]}),(0,S.jsx)(`button`,{className:`run-btn`,disabled:o,onClick:x,children:o?`verifying…`:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C,{name:`check`,className:`ms-sm`}),` verify (human)`]})})]}),n.error&&(0,S.jsxs)(`div`,{className:`msg error`,children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` `,n.error]}),(0,S.jsxs)(`div`,{className:`detail-cols`,children:[(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`content`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`span`,{className:`side-meta`,children:[e,`/`,n.id,`.md`]}),c?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>{l(!1),h(``)},children:`cancel`}),(0,S.jsx)(`button`,{className:`open-raw`,disabled:f,onClick:w,children:f?`saving…`:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C,{name:`check`,className:`ms-sm`}),` save`]})})]}):(0,S.jsxs)(`button`,{className:`open-raw`,onClick:()=>{d(n.raw),l(!0),h(``)},children:[(0,S.jsx)(C,{name:`edit`,className:`ms-sm`}),` edit`]})]}),c?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`textarea`,{className:`concept-edit`,value:u,rows:Math.min(40,Math.max(18,u.split(`
205
205
  `).length+2)),onChange:e=>d(e.target.value),spellCheck:!1}),(0,S.jsxs)(`div`,{className:`viewer-note`,children:[`full file (frontmatter + markdown body) — saving stamps provenance as`,` `,(0,S.jsx)(`code`,{children:`human:user`}),` and logs an update.`]})]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`viewer-note md-toolbar`,children:(0,S.jsxs)(`div`,{className:`tabs`,children:[(0,S.jsx)(`button`,{className:g===`rendered`?`active`:``,onClick:()=>_(`rendered`),children:`rendered`}),(0,S.jsx)(`button`,{className:g===`source`?`active`:``,onClick:()=>_(`source`),children:`source`})]})}),(0,S.jsx)(`div`,{className:`viewer-body`,children:g===`rendered`?(0,S.jsx)(`div`,{className:`md-body concept-md`,dangerouslySetInnerHTML:{__html:y}}):(0,S.jsx)(`pre`,{children:n.body.trim()||`(empty body)`})})]}),m&&(0,S.jsxs)(`div`,{className:`msg error`,children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` `,m]})]}),(0,S.jsxs)(`aside`,{className:`detail-rail`,children:[(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`about`})}),(0,S.jsxs)(`div`,{className:`rail-list`,children:[(0,S.jsxs)(`div`,{className:`rail-kv`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`trust`}),(0,S.jsx)(`span`,{className:`v`,children:(0,S.jsx)(Ji,{tier:n.trustTier})})]}),(0,S.jsxs)(`div`,{className:`rail-kv`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`generated`}),(0,S.jsx)(`span`,{className:`v ${n.generated?``:`dim`}`,children:n.generated?`${n.generated.by??`?`} · ${(n.generated.at??`?`).slice(0,10)}`:`not stamped`})]}),(0,S.jsxs)(`div`,{className:`rail-kv`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`verified`}),n.verified.length===0?(0,S.jsx)(`span`,{className:`v dim`,children:`never`}):n.verified.map((e,t)=>(0,S.jsxs)(`span`,{className:`v`,children:[e.by??`?`,` · `,(e.at??`?`).slice(0,10)]},t))]}),n.staleAfter&&(0,S.jsxs)(`div`,{className:`rail-kv`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`stale after`}),(0,S.jsxs)(`span`,{className:`v ${n.stale?``:`dim`}`,children:[n.staleAfter.slice(0,10),n.stale&&(0,S.jsx)(`span`,{className:`chip stale`,children:`stale`})]})]}),n.tags.length>0&&(0,S.jsxs)(`div`,{className:`rail-kv`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`tags`}),(0,S.jsx)(`span`,{className:`m3-chips`,children:n.tags.map(e=>(0,S.jsx)(`span`,{className:`chip`,children:e},e))})]})]})]}),n.sources.length>0&&(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`sources`})}),(0,S.jsx)(`div`,{className:`rail-list`,children:n.sources.map((e,t)=>(0,S.jsxs)(`div`,{className:`rail-kv`,children:[(0,S.jsxs)(`span`,{className:`v`,children:[e.resource?.startsWith(`http`)?(0,S.jsx)(`a`,{href:e.resource,target:`_blank`,rel:`noreferrer`,children:e.title??e.resource}):e.title??e.resource??`?`,e.id&&(0,S.jsxs)(`span`,{className:`know-id`,children:[`[^`,e.id,`]`]})]}),(0,S.jsx)(`span`,{className:`v dim`,children:[e.author,e.usage_count==null?null:`${e.usage_count} uses`,e.last_modified?`mod ${e.last_modified.slice(0,10)}`:null].filter(Boolean).join(` · `)})]},t))})]})]})]})]}):(0,S.jsx)(`div`,{className:`empty`,children:`loading…`})}var ra={workspace:`workspace`,project:`.claude`,user:`global`,agent:`agent`};function ia(e){return(0,S.jsx)(`span`,{className:`chip skill-src ${e}`,children:ra[e]})}function aa({name:e}){let t=F(`/api/skills`,!1),n=t?.skills??[],r=n.filter(e=>e.source===`workspace`),i=n.filter(e=>e.source!==`workspace`),a=t=>(0,S.jsxs)(A,{href:`/skills/${encodeURIComponent(t.name)}`,className:`side-row ${t.name===e?`active`:``}`,children:[(0,S.jsx)(`span`,{className:`lamp ${t.source===`workspace`?`ok`:`dim`}`}),(0,S.jsxs)(`div`,{className:`side-row-body`,children:[(0,S.jsxs)(`div`,{className:`side-row-top`,children:[(0,S.jsxs)(`span`,{className:`side-wf`,children:[`/`,t.name]}),t.source!==`workspace`&&ia(t.source)]}),(0,S.jsx)(`div`,{className:`side-row-sub`,children:(0,S.jsx)(`span`,{className:`side-req`,children:t.description||`no description`})})]})]},`${t.source}:${t.name}`);return(0,S.jsxs)(`div`,{className:`runs-screen`,children:[(0,S.jsxs)(`aside`,{className:`runs-side`,children:[(0,S.jsx)(`div`,{className:`side-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`workspace skills`})}),(0,S.jsxs)(`div`,{className:`side-list`,children:[r.map(a),t&&r.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no workspace skills yet`}),i.length>0&&(0,S.jsxs)(v.Fragment,{children:[(0,S.jsx)(`div`,{className:`side-head skills-local-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`local (this machine / repo)`})}),i.map(a)]})]})]}),(0,S.jsx)(`div`,{className:`runs-main`,children:e?(0,S.jsx)(sa,{name:e},e):(0,S.jsx)(oa,{root:t?.root,workspace:r})})]})}function oa({root:e,workspace:t}){return(0,S.jsxs)(`div`,{className:`new-chat`,children:[(0,S.jsxs)(`div`,{className:`page-head`,children:[(0,S.jsx)(`h1`,{children:`skills`}),(0,S.jsxs)(`span`,{className:`count`,children:[t.length,` in workspace`]})]}),(0,S.jsxs)(`section`,{className:`panel new-chat-panel`,children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`what lives here`})}),(0,S.jsxs)(`div`,{className:`know-intro`,children:[`Skills are reusable `,(0,S.jsx)(`b`,{children:`instruction packages`}),`: one folder per skill with a`,` `,(0,S.jsx)(`code`,{children:`SKILL.md`}),` (YAML frontmatter: name, description). `,(0,S.jsx)(`b`,{children:`Workspace skills`}),e?(0,S.jsxs)(S.Fragment,{children:[` live under `,(0,S.jsx)(`code`,{children:e})]}):null,`, are tracked in git and shared with everyone in this workspace — they are the ones to build on. Skills from`,` `,(0,S.jsx)(`code`,{children:`.claude/skills`}),` and your personal `,(0,S.jsx)(`code`,{children:`~/.claude/skills`}),` also work here, but stay repo-/machine-local. Invoke any skill in a session with`,` `,(0,S.jsx)(`code`,{children:`/<name>`}),`.`]}),(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`add a workspace skill`})}),(0,S.jsxs)(`div`,{className:`know-intro`,children:[`Create `,(0,S.jsxs)(`code`,{children:[e?`${e}/`:`skills/`,`<name>/SKILL.md`]}),`, commit it, done — it appears here and in every session's `,(0,S.jsx)(`code`,{children:`/`}),` menu.`]})]})]})}function sa({name:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(`rendered`),s=(0,v.useMemo)(()=>t?t.content.replace(/^---\r?\n[\s\S]*?\r?\n---(\r?\n|$)/,``):``,[t?.content]),c=(0,v.useMemo)(()=>t?kr.sanitize(z.parse(s,{async:!1})):``,[s]);return(0,v.useEffect)(()=>{fetch(`/api/skills/${encodeURIComponent(e)}`).then(e=>e.ok?e.json():Promise.reject()).then(n).catch(()=>i(!0))},[e]),r?(0,S.jsx)(`div`,{className:`empty`,children:`skill not found`}):t?(0,S.jsxs)(`div`,{className:`agent-view`,children:[(0,S.jsxs)(`div`,{className:`detail-head`,children:[(0,S.jsxs)(`h1`,{children:[`/`,t.name]}),ia(t.source)]}),t.description&&(0,S.jsx)(`div`,{className:`know-intro skill-desc`,children:t.description}),(0,S.jsxs)(`div`,{className:`detail-cols`,children:[(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`SKILL.md`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`div`,{className:`tabs`,children:[(0,S.jsx)(`button`,{className:a===`rendered`?`active`:``,onClick:()=>o(`rendered`),children:`rendered`}),(0,S.jsx)(`button`,{className:a===`source`?`active`:``,onClick:()=>o(`source`),children:`source`})]})]}),(0,S.jsx)(`div`,{className:`viewer-body`,children:a===`rendered`?(0,S.jsx)(`div`,{className:`md-body concept-md`,dangerouslySetInnerHTML:{__html:c}}):(0,S.jsx)(`pre`,{children:t.content.trim()||`(empty)`})})]}),(0,S.jsx)(`aside`,{className:`detail-rail`,children:(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`about`})}),(0,S.jsxs)(`div`,{className:`rail-list`,children:[(0,S.jsxs)(`div`,{className:`rail-kv`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`source`}),(0,S.jsx)(`span`,{className:`v`,children:t.source===`workspace`?`workspace — git-tracked, shared with the team`:t.source===`project`?`repo .claude/skills — tracked, but outside the workspace root`:`global ~/.claude/skills — only on this machine`})]}),(0,S.jsxs)(`div`,{className:`rail-kv`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`path`}),(0,S.jsx)(`span`,{className:`v mono skill-path`,title:t.path,children:t.path})]}),(0,S.jsxs)(`div`,{className:`rail-kv`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`invoke`}),(0,S.jsxs)(`span`,{className:`v`,children:[(0,S.jsxs)(`code`,{children:[`/`,t.name]}),` in any session`]})]}),t.files.length>0&&(0,S.jsxs)(`div`,{className:`rail-kv`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`bundled files`}),t.files.map(e=>(0,S.jsx)(`span`,{className:`v mono`,children:e},e))]})]})]})})]})]}):(0,S.jsx)(`div`,{className:`empty`,children:`loading…`})}var ca=[``,`low`,`medium`,`high`,`xhigh`,`max`],la=[`🤖`,`🧑‍💻`,`🎧`,`🛠️`,`📊`,`✍️`,`🔍`,`🧹`,`📦`,`🚀`];function ua({seg:e}){let t=e[0]&&e[0]!==`new`&&e[0]!==`chats`?decodeURIComponent(e[0]):void 0,n=e[0]===`new`?`new`:e[0]===`chats`?`chats`:e[1]===`edit`?`edit`:e[1]===`info`?`info`:e[1]===`chat`?`chat`:t?`agent`:`home`,r=n===`chat`?e[2]:n===`chats`?e[1]:void 0,i=F(`/api/agents`,!1),a=N(),[o,s]=(0,v.useState)(()=>{try{let e=JSON.parse(localStorage.getItem(`kw-agent-groups`)??`[]`);return Array.isArray(e)?e.map(String):[]}catch{return[]}}),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(null),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(null),[x,w]=(0,v.useState)({}),T=(i?.agents??[]).map(e=>x[e.slug]===void 0?e:{...e,group:x[e.slug]||void 0});(0,v.useEffect)(()=>{w(e=>{let t={...e},n=!1;for(let e of i?.agents??[])t[e.slug]!==void 0&&(e.group??``)===t[e.slug]&&(delete t[e.slug],n=!0);return n?t:e})},[i]);let E=T.filter(e=>!e.archived),D=T.filter(e=>e.archived),[O,ee]=(0,v.useState)(!1),te=[...new Set([...E.map(e=>e.group??``).filter(Boolean),...o])].sort((e,t)=>e.localeCompare(t)),ne=E.filter(e=>!e.group);function k(e){s(e);try{localStorage.setItem(`kw-agent-groups`,JSON.stringify(e))}catch{}}function re(){let e=u.trim();l(!1),d(``),e&&!te.includes(e)&&k([...o,e])}function ie(e,t){p(null);let n=t.trim();if(n&&n!==e){for(let t of T.filter(t=>t.group===e))j(t.slug,n);o.includes(e)&&k([...new Set(o.map(t=>t===e?n:t))])}}async function j(e,t){if((T.find(t=>t.slug===e)?.group??``)!==t){w(n=>({...n,[e]:t}));try{let n=await fetch(`/api/agents/${encodeURIComponent(e)}`);if(!n.ok)throw Error();let r=await n.json();if(!(await fetch(`/api/agents/${encodeURIComponent(e)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({...r,group:t||void 0})})).ok)throw Error()}catch{w(t=>{let n={...t};return delete n[e],n})}}}let M=e=>a?{onDragOver:t=>{g!=null&&(t.preventDefault(),t.dataTransfer.dropEffect=`move`,y!==e&&b(e))},onDrop:t=>{t.preventDefault();let n=t.dataTransfer.getData(`text/plain`)||g;n&&j(n,e),_(null),b(null)}}:{},ae=e=>(0,S.jsxs)(A,{href:`/agents/${encodeURIComponent(e.slug)}`,className:`side-row ${e.slug===t?`active`:``} ${g===e.slug?`dragging`:``}`,draggable:a,onDragStart:t=>{t.dataTransfer.setData(`text/plain`,e.slug),t.dataTransfer.effectAllowed=`move`,_(e.slug)},onDragEnd:()=>{_(null),b(null)},children:[(0,S.jsx)(`span`,{className:`agent-avatar sm`,children:(0,S.jsx)(`span`,{"aria-hidden":!0,children:e.emoji})}),(0,S.jsxs)(`div`,{className:`side-row-body`,children:[(0,S.jsx)(`div`,{className:`side-row-top`,children:(0,S.jsx)(`span`,{className:`side-wf`,children:e.name})}),(0,S.jsx)(`div`,{className:`side-row-sub`,children:(0,S.jsx)(`span`,{className:`side-req`,children:e.description||e.harness})})]})]},e.slug),oe=e=>(0,S.jsxs)(A,{href:`/agents/${encodeURIComponent(e.slug)}/info`,className:`side-row archived-row ${e.slug===t?`active`:``}`,children:[(0,S.jsx)(`span`,{className:`agent-avatar sm`,children:(0,S.jsx)(`span`,{"aria-hidden":!0,children:e.emoji})}),(0,S.jsxs)(`div`,{className:`side-row-body`,children:[(0,S.jsx)(`div`,{className:`side-row-top`,children:(0,S.jsx)(`span`,{className:`side-wf`,children:e.name})}),(0,S.jsx)(`div`,{className:`side-row-sub`,children:(0,S.jsx)(`span`,{className:`side-req`,children:e.description||e.harness})})]})]},e.slug),se;se=n===`new`?(0,S.jsx)(xa,{},`new`):n===`edit`&&t?(0,S.jsx)(xa,{slug:t},t):n===`chat`&&t&&r?(0,S.jsx)(`div`,{className:`chat-main`,children:(0,S.jsx)(qr,{id:r,agentName:T.find(e=>e.slug===t)?.name??t,agentDescription:T.find(e=>e.slug===t)?.description},r)}):n===`chats`?r?(0,S.jsx)(`div`,{className:`chat-main`,children:(0,S.jsx)(qr,{id:r},r)}):(0,S.jsx)(Kr,{}):n===`info`&&t?(0,S.jsx)(_a,{slug:t},t):t?(0,S.jsx)(pa,{slug:t},t):(0,S.jsx)(ga,{hasAgents:E.length>0,root:i?.root});let ce=(n===`agent`||n===`info`||n===`chat`)&&t?T.find(e=>e.slug===t)?.knowledge??[]:[],[P,le]=(0,v.useState)(()=>localStorage.getItem(`kw-kside`)!==`hidden`),[ue,de]=(0,v.useState)(()=>Number(localStorage.getItem(`kw-kside-w`))||460),fe=ce.length>0&&P;function pe(e){le(e),localStorage.setItem(`kw-kside`,e?`open`:`hidden`)}function me(e){de(e),localStorage.setItem(`kw-kside-w`,String(e))}return(0,S.jsxs)(`div`,{className:`runs-screen agents-screen ${t||n===`chats`?`has-sessions`:``} ${fe?`has-knowledge`:``}`,style:fe?{"--kside-w":`${ue}px`}:void 0,children:[(0,S.jsxs)(`aside`,{className:`runs-side`,children:[(0,S.jsxs)(`div`,{className:`side-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`agents`}),(0,S.jsx)(`span`,{className:`spacer`}),a&&(0,S.jsxs)(A,{href:`/agents/new`,className:`open-raw`,children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` new`]})]}),(0,S.jsxs)(`div`,{className:`side-list`,children:[(0,S.jsxs)(A,{href:`/agents/chats`,className:`side-row side-general ${n===`chats`?`active`:``}`,children:[(0,S.jsx)(`span`,{className:`agent-avatar sm`,children:(0,S.jsx)(`span`,{"aria-hidden":!0,children:`💬`})}),(0,S.jsxs)(`div`,{className:`side-row-body`,children:[(0,S.jsx)(`div`,{className:`side-row-top`,children:(0,S.jsx)(`span`,{className:`side-wf`,children:`General Chats`})}),(0,S.jsx)(`div`,{className:`side-row-sub`,children:(0,S.jsx)(`span`,{className:`side-req`,children:`chats without an agent`})})]})]}),(0,S.jsxs)(`div`,{className:`side-group ${g&&y===``?`drop-over`:``}`,...M(``),children:[ne.map(ae),g!=null&&ne.length===0&&(0,S.jsx)(`div`,{className:`side-group-empty`,children:`no group — drop here`})]}),te.map(e=>{let t=E.filter(t=>t.group===e);return(0,S.jsxs)(`div`,{className:`side-group ${g&&y===e?`drop-over`:``}`,...M(e),children:[(0,S.jsxs)(`div`,{className:`side-group-head`,children:[f===e?(0,S.jsx)(`input`,{className:`side-group-rename`,autoFocus:!0,value:m,onChange:e=>h(e.target.value),onKeyDown:t=>{t.key===`Enter`&&ie(e,m),t.key===`Escape`&&p(null)},onBlur:()=>ie(e,m)}):(0,S.jsx)(`span`,{className:`microlabel`,children:e}),(0,S.jsx)(`span`,{className:`side-group-count num`,children:t.length}),(0,S.jsx)(`span`,{className:`spacer`}),a&&f!==e&&(0,S.jsx)(`button`,{className:`side-group-x`,title:`Rename group`,onClick:()=>{p(e),h(e)},children:(0,S.jsx)(C,{name:`edit`,className:`ms-sm`})}),a&&t.length===0&&o.includes(e)&&(0,S.jsx)(`button`,{className:`side-group-x`,title:`Remove empty group`,onClick:()=>k(o.filter(t=>t!==e)),children:(0,S.jsx)(C,{name:`close`,className:`ms-sm`})})]}),t.map(ae),t.length===0&&(0,S.jsx)(`div`,{className:`side-group-empty`,children:a?`drag agents here`:`no agents`})]},e)}),D.length>0&&(0,S.jsxs)(`div`,{className:`side-group side-archived`,children:[(0,S.jsxs)(`button`,{className:`side-archived-toggle`,"aria-expanded":O,onClick:()=>ee(e=>!e),children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`archived`}),(0,S.jsx)(`span`,{className:`side-group-count num`,children:D.length}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(C,{name:O?`expand_less`:`expand_more`,className:`ms-sm`})]}),O&&D.map(oe)]}),i&&T.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no agents yet`}),a&&(c?(0,S.jsx)(`div`,{className:`side-group-new`,children:(0,S.jsx)(`input`,{autoFocus:!0,value:u,placeholder:`group name, e.g. Team Content`,onChange:e=>d(e.target.value),onKeyDown:e=>{e.key===`Enter`&&re(),e.key===`Escape`&&(l(!1),d(``))},onBlur:re})}):(0,S.jsxs)(`button`,{className:`side-group-add`,onClick:()=>l(!0),children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` group`]}))]})]}),t&&(0,S.jsx)(ma,{slug:t,chatId:r}),n===`chats`&&(0,S.jsx)(ha,{chatId:r}),(0,S.jsx)(`div`,{className:`runs-main`,children:se}),fe&&(0,S.jsx)(da,{bundles:ce,onHide:()=>pe(!1),onResize:me}),ce.length>0&&!P&&(0,S.jsxs)(`button`,{className:`kside-reopen`,onClick:()=>pe(!0),title:`Show knowledge sidebar`,children:[(0,S.jsx)(C,{name:`menu_book`,className:`ms-sm`}),` knowledge`]})]})}function da({bundles:e,onHide:t,onResize:n}){let[r,i]=(0,v.useState)({}),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)({}),[l,u]=(0,v.useState)({}),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(``);(0,v.useEffect)(()=>{i({});let t=!0,n,r=async()=>{await Promise.all(e.map(async e=>{try{let n=await fetch(`/api/knowledge/${encodeURIComponent(e)}`,{cache:`no-store`}),r=n.ok?await n.json():null;t&&i(t=>JSON.stringify(t[e])===JSON.stringify(r)?t:{...t,[e]:r})}catch{t&&i(t=>e in t?t:{...t,[e]:null})}})),t&&(n=setTimeout(r,6e3))};return r(),()=>{t=!1,clearTimeout(n)}},[e.join(`,`)]),(0,v.useEffect)(()=>{if(!a||d===a)return;let e=a.indexOf(`::`),t=a.slice(0,e),n=a.slice(e+2),r=!0,i,o=async()=>{try{let e=await fetch(`/api/knowledge/${encodeURIComponent(t)}/concept?id=${encodeURIComponent(n)}`,{cache:`no-store`}),i=e.ok?await e.json():null;r&&c(e=>JSON.stringify(e[a])===JSON.stringify(i)?e:{...e,[a]:i})}catch{r&&c(e=>a in e?e:{...e,[a]:null})}r&&(i=setTimeout(o,6e3))};return o(),()=>{r=!1,clearTimeout(i)}},[a,d]);function b(e,t){let n=`${e}::${t}`;o(a===n?null:n)}async function x(e,t){let n=`${e}::${t}`;g(!0),y(``);try{let r=await(await fetch(`/api/knowledge/${encodeURIComponent(e)}/concept`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:t,content:p})})).json();r.error?y(r.error):(c(e=>({...e,[n]:r})),f(null))}catch(e){y(e.message)}g(!1)}return(0,S.jsxs)(`aside`,{className:`runs-side knowledge-side`,children:[(0,S.jsx)(`div`,{className:`kside-resizer`,title:`Drag to resize`,onMouseDown:e=>{e.preventDefault();let t=e.clientX,r=e.currentTarget.parentElement.offsetWidth,i=e=>n(Math.min(900,Math.max(280,r+(t-e.clientX)))),a=()=>{window.removeEventListener(`mousemove`,i),window.removeEventListener(`mouseup`,a)};window.addEventListener(`mousemove`,i),window.addEventListener(`mouseup`,a)}}),(0,S.jsxs)(`div`,{className:`side-head`,children:[(0,S.jsxs)(`span`,{className:`kside-headline`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`knowledge`}),(0,S.jsx)(`span`,{className:`kside-hint`,children:`read & kept current by this agent`})]}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`button`,{className:`open-raw`,onClick:t,title:`Hide knowledge sidebar`,children:[`hide `,(0,S.jsx)(C,{name:`close`,className:`ms-sm`})]})]}),(0,S.jsx)(`div`,{className:`side-list`,children:e.map(e=>{let t=r[e],n=l[e]===!0;return(0,S.jsxs)(`div`,{className:`kside-bundle`,children:[(0,S.jsxs)(`div`,{className:`kside-bundle-head`,children:[(0,S.jsxs)(`button`,{className:`kside-bundle-toggle`,"aria-expanded":!n,onClick:()=>u({...l,[e]:!n}),children:[(0,S.jsx)(`span`,{className:`kside-chev ${n?``:`open`}`,"aria-hidden":!0,children:(0,S.jsx)(C,{name:`chevron_right`,className:`ms-sm`})}),(0,S.jsx)(`span`,{className:`kside-bundle-name`,children:e}),t&&(0,S.jsx)(`span`,{className:`kside-count num`,children:t.concepts.length})]}),(0,S.jsx)(`button`,{className:`kside-open`,title:`Export this bundle as PDF`,onClick:()=>void Bi(e),children:(0,S.jsx)(C,{name:`picture_as_pdf`,className:`ms-sm`})}),(0,S.jsx)(A,{href:`/knowledge/${encodeURIComponent(e)}`,className:`kside-open`,title:`Open this bundle on the knowledge screen`,children:`↗`})]}),!n&&t===null&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`bundle not found`}),!n&&t?.concepts.map(t=>{let n=`${e}::${t.id}`,r=a===n,i=`/knowledge/${encodeURIComponent(e)}/${t.id.split(`/`).map(encodeURIComponent).join(`/`)}`;return(0,S.jsxs)(`div`,{className:`kside-concept ${r?`open`:``}`,children:[(0,S.jsxs)(`button`,{className:`kside-row`,"aria-expanded":r,title:t.description||void 0,onClick:()=>b(e,t.id),children:[(0,S.jsx)(`span`,{className:`kside-chev ${r?`open`:``}`,"aria-hidden":!0,children:(0,S.jsx)(C,{name:`chevron_right`,className:`ms-sm`})}),(0,S.jsx)(`span`,{className:`kside-title`,children:t.title||t.id}),t.stale&&(0,S.jsx)(`span`,{className:`kside-stale`,title:`Past its stale-after date — ask the agent to re-verify it`,children:`stale`})]}),r&&(0,S.jsx)(`div`,{className:`kside-card`,ref:e=>e?.scrollIntoView({block:`nearest`}),children:s[n]===void 0?(0,S.jsx)(`div`,{className:`viewer-note`,children:`loading…`}):s[n]===null?(0,S.jsx)(`div`,{className:`viewer-note`,children:`could not load concept`}):d===n?(0,S.jsxs)(`div`,{className:`kside-edit`,children:[(0,S.jsx)(`textarea`,{className:`concept-edit`,value:p,rows:Math.min(28,Math.max(10,p.split(`
206
206
  `).length+2)),onChange:e=>m(e.target.value),spellCheck:!1}),(0,S.jsxs)(`div`,{className:`kside-actions`,children:[(0,S.jsx)(`button`,{className:`open-raw`,disabled:h,onClick:()=>f(null),children:`cancel`}),(0,S.jsx)(`button`,{className:`open-raw`,disabled:h,onClick:()=>x(e,t.id),children:h?`saving…`:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C,{name:`check`,className:`ms-sm`}),` save`]})})]}),_&&(0,S.jsxs)(`div`,{className:`msg error`,children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` `,_]})]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`kside-card-bar`,children:[t.type&&(0,S.jsx)(`span`,{className:`kside-type`,children:t.type}),fa(t)&&(0,S.jsxs)(`span`,{className:`kside-updated num`,children:[`updated `,_e(fa(t))]}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`button`,{className:`open-raw`,onClick:()=>{m(s[n].raw),f(n),y(``)},children:[(0,S.jsx)(C,{name:`edit`,className:`ms-sm`}),` edit`]}),(0,S.jsxs)(A,{href:Gi(e,t.id),className:`open-raw`,title:`Full-screen document editor with autosave`,children:[(0,S.jsx)(C,{name:`edit_document`,className:`ms-sm`}),` editor`]}),(0,S.jsx)(A,{href:i,className:`open-raw`,children:`open ↗`})]}),(0,S.jsx)(`div`,{className:`kside-md md-body`,dangerouslySetInnerHTML:{__html:kr.sanitize(z.parse(s[n].body??``,{async:!1}))}})]})})]},t.id)}),!n&&t&&t.concepts.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no concepts yet`})]},e)})})]})}function fa(e){return[e.generated?.at,...e.verified.map(e=>e.at)].filter(e=>typeof e==`string`&&e.length>0).sort().pop()}function pa({slug:e}){let[t,n]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let t=!0;return n(!1),fetch(`/api/chats`).then(e=>e.json()).then(r=>{if(!t)return;let i=r.chats.find(t=>t.scope.kind===`agent`&&t.scope.slug===e);i?k(`/agents/${encodeURIComponent(e)}/chat/${i.id}`,{replace:!0}):n(!0)}).catch(()=>t&&n(!0)),()=>{t=!1}},[e]),t?(0,S.jsx)(_a,{slug:e}):(0,S.jsx)(`div`,{className:`empty`,children:`loading…`})}function ma({slug:e,chatId:t}){let n=F(`/api/chats`,!1),r=(n?.chats??[]).filter(t=>t.scope.kind===`agent`&&t.scope.slug===e),[i,a]=(0,v.useState)(!1);return(0,S.jsxs)(`aside`,{className:`runs-side`,children:[(0,S.jsxs)(`div`,{className:`side-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`sessions`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(A,{href:`/agents/${encodeURIComponent(e)}/info`,className:`open-raw`,title:`agent profile & settings`,children:`profile`}),(0,S.jsx)(`button`,{className:`open-raw`,disabled:i,onClick:async()=>{a(!0),await Gr(`claude`,{kind:`agent`,slug:e}),a(!1)},children:i?`…`:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` new`]})})]}),(0,S.jsxs)(`div`,{className:`side-list`,children:[r.map(n=>(0,S.jsxs)(A,{href:`/agents/${encodeURIComponent(e)}/chat/${n.id}`,className:`side-row ${n.id===t?`active`:``}`,children:[(0,S.jsx)(`span`,{className:`lamp ${n.awaitingApproval?`blocked`:n.busy?`running`:`pending`}`,title:n.awaitingApproval?`waiting for your approval`:void 0}),(0,S.jsxs)(`div`,{className:`side-row-body`,children:[(0,S.jsx)(`div`,{className:`side-row-top`,children:(0,S.jsx)(`span`,{className:`side-wf`,children:n.title||`new session`})}),(0,S.jsx)(`div`,{className:`side-row-sub`,children:(0,S.jsx)(`span`,{className:`side-when num`,children:_e(n.updatedAt)})})]}),(0,S.jsx)(`button`,{type:`button`,className:`row-x`,title:`delete session`,onClick:async r=>{r.preventDefault(),r.stopPropagation(),window.confirm(`Delete session "${n.title||n.id}"?`)&&(await fetch(`/api/chats/${n.id}`,{method:`DELETE`}).catch(()=>{}),n.id===t&&k(`/agents/${encodeURIComponent(e)}`))},children:(0,S.jsx)(C,{name:`close`,className:`ms-sm`})})]},n.id)),n&&r.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no sessions yet`})]})]})}function ha({chatId:e}){let t=F(`/api/chats`,!1),n=(t?.chats??[]).filter(e=>e.scope.kind!==`agent`&&e.scope.kind!==`channel`);return(0,S.jsxs)(`aside`,{className:`runs-side`,children:[(0,S.jsxs)(`div`,{className:`side-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`chats`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(A,{href:`/agents/chats`,className:`open-raw`,children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` new`]})]}),(0,S.jsxs)(`div`,{className:`side-list`,children:[n.map(t=>(0,S.jsxs)(A,{href:`/agents/chats/${t.id}`,className:`side-row ${t.id===e?`active`:``}`,children:[(0,S.jsx)(`span`,{className:`lamp ${t.awaitingApproval?`blocked`:t.busy?`running`:`pending`}`,title:t.awaitingApproval?`waiting for your approval`:void 0}),(0,S.jsxs)(`div`,{className:`side-row-body`,children:[(0,S.jsx)(`div`,{className:`side-row-top`,children:(0,S.jsx)(`span`,{className:`side-wf`,children:t.title||`new chat`})}),(0,S.jsxs)(`div`,{className:`side-row-sub`,children:[(0,S.jsxs)(`span`,{className:`side-req`,children:[t.agent,t.scope.kind===`run`?` · ${t.scope.runId}`:t.scope.kind===`kraftwerk`?` · kraftwerk`:t.scope.kind===`knowledge`?` · knowledge${t.scope.bundle?`:${t.scope.bundle}`:``}`:``]}),(0,S.jsx)(`span`,{className:`side-when num`,children:_e(t.updatedAt)})]})]}),(0,S.jsx)(`button`,{type:`button`,className:`row-x`,title:`delete chat`,onClick:async n=>{n.preventDefault(),n.stopPropagation(),window.confirm(`Delete chat "${t.title||t.id}"?`)&&(await fetch(`/api/chats/${t.id}`,{method:`DELETE`}).catch(()=>{}),t.id===e&&k(`/agents/chats`))},children:(0,S.jsx)(C,{name:`close`,className:`ms-sm`})})]},t.id)),t&&n.length===0&&(0,S.jsx)(`div`,{className:`viewer-note`,children:`no chats yet`})]})]})}function ga({hasAgents:e,root:t}){let n=N();return(0,S.jsxs)(`div`,{className:`new-chat`,children:[(0,S.jsx)(`div`,{className:`page-head`,children:(0,S.jsx)(`h1`,{children:`agents`})}),(0,S.jsxs)(`section`,{className:`panel new-chat-panel`,children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`what lives here`})}),(0,S.jsxs)(`div`,{className:`know-intro`,children:[`Your agents, set up like agents: each one has a name, a role (system prompt), a harness/model to run on, and the workflows that belong to its job. An agent lives in`,` `,(0,S.jsx)(`code`,{children:t?`${t}/<slug>/`:`agents/<slug>/`}),` as `,(0,S.jsx)(`code`,{children:`agent.yml`}),` +`,` `,(0,S.jsx)(`code`,{children:`system.md`}),` — git-tracked, so your team travels with the repo. Every session is a persistent conversation with that agent; it knows its connected workflows and knowledge bundles, runs the workflows for you, and keeps the knowledge current.`]}),n?(0,S.jsx)(`div`,{style:{padding:`0 16px 16px`},children:(0,S.jsx)(`button`,{className:`run-btn`,onClick:()=>k(`/agents/new`),children:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C,{name:`add`,className:`ms-sm`}),` `,e?`new agent`:`create your first agent`]})})}):(0,S.jsx)(`div`,{className:`settings-note`,style:{padding:`0 16px 16px`},children:`Creating agents needs expert mode — flip the switch in the top bar.`})]})]})}function _a({slug:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)([]),[h,g]=(0,v.useState)(!0),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(``),w=F(`/api/workflows`,!1),T=F(`/api/knowledge`,!1),E=F(`/api/skills`,!1);(0,v.useEffect)(()=>{let t=!0;return fetch(`/api/agents/${encodeURIComponent(e)}`).then(e=>e.ok?e.json():Promise.reject()).then(e=>t&&n(e)).catch(()=>t&&i(!0)),()=>{t=!1}},[e]);async function D(r){if(t){y(!0),x(``);try{let i=await(await fetch(`/api/agents/${encodeURIComponent(e)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({name:t.name,emoji:t.emoji,description:t.description,harness:t.harness,model:t.model,effort:t.effort,group:t.group,system:t.system,workflows:t.workflows,knowledge:t.knowledge,skills:t.skills,...r})})).json();i.error?x(i.error):(n(i),u(``))}catch(e){x(e.message)}y(!1)}}function O(e,t){m(t?[...p,e]:p.filter(t=>t!==e))}async function ee(t){y(!0),x(``);try{let r=await(await fetch(`/api/agents/${encodeURIComponent(e)}/archive`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({archived:t})})).json();r.error?x(r.error):n(r)}catch(e){x(e.message)}y(!1)}if(r)return(0,S.jsx)(`div`,{className:`empty`,children:`agent not found`});if(!t)return(0,S.jsx)(`div`,{className:`empty`,children:`loading…`});let te=e=>(0,S.jsxs)(`div`,{className:`agent-form-row`,style:{marginTop:8},children:[(0,S.jsx)(`button`,{className:`run-btn`,disabled:_,onClick:()=>void D(e),children:_?`saving…`:`save`}),(0,S.jsx)(`button`,{className:`open-raw`,disabled:_,onClick:()=>(u(``),x(``)),children:`cancel`})]});return(0,S.jsxs)(`div`,{className:`agent-view`,children:[(0,S.jsxs)(`div`,{className:`detail-head`,children:[(0,S.jsx)(`span`,{className:`agent-avatar lg`,children:(0,S.jsx)(`span`,{"aria-hidden":!0,children:t.emoji})}),(0,S.jsx)(`h1`,{children:t.name}),(0,S.jsx)(`span`,{className:`chip agent`,children:t.harness}),t.model&&(0,S.jsx)(`span`,{className:`chip`,children:t.model}),t.effort&&(0,S.jsxs)(`span`,{className:`chip`,children:[`effort: `,t.effort]}),t.archived&&(0,S.jsxs)(`span`,{className:`chip archived-chip`,children:[(0,S.jsx)(C,{name:`inventory_2`,className:`ms-sm`}),` archived`]}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(A,{href:`/agents/${encodeURIComponent(e)}/edit`,className:`open-raw`,children:`edit`}),t.archived?(0,S.jsxs)(`button`,{className:`run-btn tonal`,disabled:_,onClick:()=>void ee(!1),children:[(0,S.jsx)(C,{name:`unarchive`,className:`ms-sm`}),` `,_?`…`:`unarchive`]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`button`,{className:`open-raw`,disabled:_,title:`Hide this agent from the roster — restorable any time`,onClick:()=>void ee(!0),children:[(0,S.jsx)(C,{name:`archive`,className:`ms-sm`}),` archive`]}),(0,S.jsx)(`button`,{className:`run-btn`,disabled:a,onClick:async()=>{o(!0),await Gr(`claude`,{kind:`agent`,slug:e}),o(!1)},children:a?`starting…`:`new session`})]})]}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`m3-list`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`m3-row m3-toggle`,onClick:()=>c(!s),children:[(0,S.jsx)(`span`,{className:`m3-ico`,children:(0,S.jsx)(C,{name:`badge`})}),(0,S.jsxs)(`span`,{className:`m3-body`,children:[(0,S.jsx)(`span`,{className:`m3-head`,children:`role`}),!s&&(0,S.jsx)(`span`,{className:`m3-sub m3-ellipsis`,children:(t.system||``).trim().split(`
@@ -215,4 +215,4 @@ Instructions this agent follows when the skill applies or is invoked with /<name
215
215
  `).map((e,t)=>(0,S.jsxs)(`span`,{className:Ma(e),children:[e||` `,`
216
216
  `]},t)),r&&(0,S.jsxs)(`span`,{className:`d-meta`,children:[`… diff truncated, see the rest in a terminal`,`
217
217
  `]})]}):(0,S.jsx)(`div`,{className:`git-diff`,children:`no textual diff (binary or empty)`})}function Pa(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(new Set),[i,a]=(0,v.useState)(new Set),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),m=(0,v.useCallback)(async()=>{try{let e=await fetch(`/api/git`,{cache:`no-store`});e.ok&&t(await e.json())}catch{}},[]);(0,v.useEffect)(()=>{let e=!0,t,n=async()=>{await m(),e&&(t=setTimeout(n,6e3))};return n(),()=>{e=!1,clearTimeout(t)}},[m]),(0,v.useEffect)(()=>{if(!e?.files)return;let t=new Set(e.files.filter(e=>e.syncable).map(e=>e.path));r(e=>{let n=new Set([...e].filter(e=>t.has(e)));return n.size===e.size?e:n})},[e]);let h=async(e,t)=>{l(e),d(``),p(``);try{let n=await pe(`/api/git/${e}`,t);n.ok?p(e===`push`?`pushed`:e===`pull`?`pulled`:`fetched`):d(n.error||`${e} failed`)}catch(t){d(t.message||`${e} failed`)}finally{l(``)}m()},g=async()=>{l(`commit`),d(``),p(``);try{let e=await pe(`/api/git/commit`,{paths:[...n],message:o});e.ok?(p(`committed ${n.size} file${n.size===1?``:`s`}`),r(new Set),s(``)):d(e.error||`commit failed`)}catch(e){d(e.message||`commit failed`)}finally{l(``)}m()};if(!e)return(0,S.jsx)(`div`,{className:`settings-screen`,children:(0,S.jsx)(`div`,{className:`ws-empty`,children:`loading…`})});if(!e.enabled)return(0,S.jsxs)(`div`,{className:`settings-screen`,children:[(0,S.jsx)(`div`,{className:`settings-head`,children:(0,S.jsxs)(`h1`,{children:[(0,S.jsx)(C,{name:`cloud_sync`,className:`ms-lg`}),` Git sync`]})}),(0,S.jsx)(`section`,{className:`panel`,children:(0,S.jsxs)(`div`,{className:`ws-empty`,children:[`Git sync is off. Turn it on in `,(0,S.jsx)(`a`,{href:`#/settings`,children:`settings`}),`, or add a `,(0,S.jsx)(`code`,{children:`git:`}),` block to kraftwerk.yml.`]})})]});let _=(e.files??[]).filter(e=>e.syncable),y=(e.files??[]).filter(e=>!e.syncable),b=(e,t)=>r(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r});return(0,S.jsxs)(`div`,{className:`settings-screen ws-screen`,children:[(0,S.jsxs)(`div`,{className:`settings-head`,children:[(0,S.jsxs)(`h1`,{children:[(0,S.jsx)(C,{name:`cloud_sync`,className:`ms-lg`}),` Git sync`]}),(0,S.jsx)(`span`,{className:`spacer`}),f&&(0,S.jsxs)(`span`,{className:`settings-saved`,children:[(0,S.jsx)(C,{name:`check`,className:`ms-sm`}),` `,f]}),u&&(0,S.jsx)(`span`,{className:`settings-err`,children:u})]}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`branch`}),(0,S.jsx)(`span`,{className:`spacer`}),e.lastFetch&&(0,S.jsxs)(`span`,{className:`settings-note`,title:e.lastFetch,children:[`fetched `,ve(e.lastFetch)]}),e.lastError&&(0,S.jsxs)(`span`,{className:`settings-err git-sync-err`,title:e.lastError,children:[(0,S.jsx)(C,{name:`cloud_off`,className:`ms-sm`}),` `,e.lastError.split(`
218
- `)[0]]})]}),e.error?(0,S.jsxs)(`div`,{className:`ws-empty ws-load-error`,children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` `,e.error]}):(0,S.jsxs)(`div`,{className:`git-head`,children:[(0,S.jsxs)(`div`,{className:`git-branch`,children:[(0,S.jsx)(C,{name:`account_tree`,className:`ms-sm`}),(0,S.jsx)(`strong`,{children:e.branch}),e.upstream?(0,S.jsxs)(`span`,{className:`settings-note`,children:[`tracking `,e.upstream]}):(0,S.jsx)(`span`,{className:`settings-note`,children:`no upstream yet, push sets one`})]}),(0,S.jsxs)(`div`,{className:`git-counts`,children:[e.diverged&&(0,S.jsx)(`span`,{className:`git-diverged`,children:`diverged, resolve in a terminal`}),!!e.behind&&(0,S.jsxs)(`span`,{className:`git-behind`,children:[e.behind,` behind`]}),!!e.ahead&&(0,S.jsxs)(`span`,{className:`git-ahead`,children:[e.ahead,` ahead`]}),!e.ahead&&!e.behind&&(0,S.jsx)(`span`,{className:`settings-note`,children:`up to date`})]}),(0,S.jsxs)(`div`,{className:`ws-actions`,children:[(0,S.jsxs)(`button`,{className:`ws-btn`,disabled:!!c,onClick:()=>void h(`fetch`),children:[(0,S.jsx)(C,{name:c===`fetch`?`progress_activity`:`refresh`,className:`ms-sm`}),` fetch`]}),(0,S.jsxs)(`button`,{className:`ws-btn`,disabled:!!c||!e.behind||e.diverged,title:e.diverged?`Diverged. Resolve in a terminal.`:`Fast-forward to the remote`,onClick:()=>void h(`pull`),children:[(0,S.jsx)(C,{name:c===`pull`?`progress_activity`:`download`,className:`ms-sm`}),` pull`]}),(0,S.jsxs)(`button`,{className:`ws-btn primary`,disabled:!!c||!e.ahead&&!!e.upstream,title:e.upstream?`Push to the upstream`:`Push and set the upstream`,onClick:()=>void h(`push`),children:[(0,S.jsx)(C,{name:c===`push`?`progress_activity`:`upload`,className:`ms-sm`}),` push`]})]})]})]}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`changes`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(`span`,{className:`settings-note`,children:_.length===0?`workspace clean`:`${n.size} of ${_.length} selected`})]}),_.length===0&&y.length===0&&(0,S.jsx)(`div`,{className:`ws-empty`,children:`Nothing changed under the workspace paths.`}),_.map(e=>(0,S.jsxs)(`div`,{className:`git-row`,children:[(0,S.jsx)(`label`,{className:`git-pick`,children:(0,S.jsx)(`input`,{type:`checkbox`,checked:n.has(e.path),onChange:t=>b(e.path,t.target.checked)})}),(0,S.jsxs)(`button`,{className:`git-file`,onClick:()=>a(t=>{let n=new Set(t);return n.has(e.path)?n.delete(e.path):n.add(e.path),n}),children:[(0,S.jsx)(C,{name:i.has(e.path)?`expand_more`:`chevron_right`,className:`ms-sm`}),(0,S.jsx)(`span`,{className:`git-status s-${e.status}`,children:e.status}),(0,S.jsx)(`span`,{className:`git-path`,children:e.path})]}),i.has(e.path)&&(0,S.jsx)(Na,{file:e.path})]},e.path)),_.length>0&&(0,S.jsxs)(`div`,{className:`git-commit`,children:[(0,S.jsx)(`input`,{className:`git-message`,placeholder:`Commit message`,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!c&&o.trim()&&n.size>0&&g()}}),(0,S.jsx)(`button`,{className:`ws-btn`,disabled:n.size===_.length,onClick:()=>r(new Set(_.map(e=>e.path))),children:`select all`}),(0,S.jsxs)(`button`,{className:`ws-btn primary`,disabled:!!c||n.size===0||!o.trim(),onClick:()=>void g(),children:[(0,S.jsx)(C,{name:c===`commit`?`progress_activity`:`check`,className:`ms-sm`}),`commit `,n.size||``]})]}),y.length>0&&(0,S.jsxs)(`details`,{className:`git-blocked`,children:[(0,S.jsxs)(`summary`,{children:[y.length,e.blockedHidden?`+`:``,` change`,y.length===1&&!e.blockedHidden?``:`s`,` outside the workspace paths`]}),y.map(e=>(0,S.jsxs)(`div`,{className:`git-row blocked`,children:[(0,S.jsx)(`span`,{className:`git-status s-blocked`,children:e.status}),(0,S.jsx)(`span`,{className:`git-path`,children:e.path}),(0,S.jsx)(`span`,{className:`settings-note`,children:e.reason})]},e.path)),!!e.blockedHidden&&(0,S.jsx)(`div`,{className:`git-row blocked`,children:(0,S.jsxs)(`span`,{className:`settings-note`,children:[`and `,e.blockedHidden,` more, not listed`]})})]})]}),(0,S.jsxs)(`p`,{className:`settings-note`,children:[`Synced paths: `,(e.scope??[]).map((e,t)=>(0,S.jsxs)(`span`,{children:[t>0&&`, `,(0,S.jsx)(`code`,{children:e})]},e)),`. Run artifacts and files like `,(0,S.jsx)(`code`,{children:`.env`}),` are never staged.`,` `,e.interval?`Fetches every ${Aa(e.interval)}${e.autosync===`pull`?` and fast-forwards when the working tree is clean`:``}. `:`Background fetching is off. `,`Commit and push are always manual.`]})]})}var Fa=e=>e.replace(/^https?:\/\//,``).replace(/^git@([^:]+):/,`$1/`).replace(/\.git$/,``),Ia=e=>e.error?{label:`unreadable`,cls:`missing`}:e.dirty?{label:`${e.dirty} changed`,cls:`died`}:e.ahead?{label:`${e.ahead} to push`,cls:`running`}:e.behind?{label:`${e.behind} behind`,cls:`stopped`}:{label:`clean`,cls:`running`},La=e=>!!(e.error||e.dirty||e.ahead===void 0||e.ahead);function Ra(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)({}),[o,s]=(0,v.useState)({}),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(``),x=N(),w=(0,v.useCallback)(async()=>{try{let e=await fetch(`/api/repos`,{cache:`no-store`});if(!e.ok)throw Error(`HTTP ${e.status}`);t(await e.json()),r(``)}catch(e){r(e.message||`could not load repositories`)}},[]);(0,v.useEffect)(()=>{let e=!0,t,n=async()=>{await w(),e&&(t=setTimeout(n,15e3))};return n(),()=>{e=!1,clearTimeout(t)}},[w]);let T=async(e,t,n=!1)=>{a(n=>({...n,[e]:t})),s(t=>({...t,[e]:``})),l(null);try{let r=t===`update`?await fetch(`/api/repos/${encodeURIComponent(e)}/update`,{method:`POST`}):await fetch(`/api/repos/${encodeURIComponent(e)}${n?`?force=1`:``}`,{method:`DELETE`}),i=await r.json();if(!r.ok||!i.ok)throw Error(i.error||`failed`);i.error&&s(t=>({...t,[e]:i.error}))}catch(t){s(n=>({...n,[e]:t.message}))}finally{a(t=>{let n={...t};return delete n[e],n}),w()}},E=async e=>{if(e.preventDefault(),u.trim()&&!g){_(!0),b(``);try{let e=await fetch(`/api/repos`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({url:u.trim(),name:f.trim()||void 0,branch:m.trim()||void 0})}),t=await e.json();if(!e.ok)throw Error(t.error||`clone failed`);d(``),p(``),h(``),await w()}catch(e){b(e.message)}finally{_(!1)}}},D=[...e?.repos??[]].sort((e,t)=>(t.updatedAt??``).localeCompare(e.updatedAt??``));return(0,S.jsxs)(`div`,{className:`settings-screen ws-screen repos-screen`,children:[(0,S.jsxs)(`div`,{className:`settings-head`,children:[(0,S.jsxs)(`h1`,{children:[(0,S.jsx)(C,{name:`source`,className:`ms-lg`}),` Repositories`]}),(0,S.jsx)(`span`,{className:`spacer`}),e?.enabled&&(0,S.jsxs)(`span`,{className:`settings-note`,children:[D.length,` cloned`]}),n&&(0,S.jsx)(`span`,{className:`settings-err`,children:n})]}),e&&!e.enabled&&(0,S.jsx)(`section`,{className:`panel`,children:(0,S.jsx)(`div`,{className:`ws-empty`,children:e.error&&!/are off/.test(e.error)?(0,S.jsx)(`span`,{className:`settings-err`,children:e.error}):(0,S.jsxs)(S.Fragment,{children:[`Repositories are off. Turn them on in `,(0,S.jsx)(`a`,{href:`#/settings`,children:`settings`}),` or add a `,(0,S.jsx)(`code`,{children:`repos:`}),` block to kraftwerk.yml.`]})})}),e?.enabled&&(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`add a repository`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`span`,{className:`settings-note`,children:[`clones into `,(0,S.jsx)(`code`,{title:e.root,children:e.root})]})]}),(0,S.jsxs)(`form`,{className:`agent-form`,onSubmit:e=>void E(e),children:[(0,S.jsxs)(`div`,{className:`agent-form-row`,children:[(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:2},children:[`url`,(0,S.jsx)(`input`,{value:u,placeholder:`https://github.com/org/repo.git, git@host:org/repo.git or github:org/repo`,onChange:e=>d(e.target.value),autoFocus:!0})]}),(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`name`,(0,S.jsx)(`input`,{value:f,placeholder:`from the url`,onChange:e=>p(e.target.value)})]}),(0,S.jsxs)(`label`,{className:`agent-field`,style:{width:140},children:[`branch`,(0,S.jsx)(`input`,{value:m,placeholder:`default`,onChange:e=>h(e.target.value)})]}),(0,S.jsxs)(`button`,{className:`ws-btn primary`,type:`submit`,disabled:g||!u.trim(),children:[(0,S.jsx)(C,{name:g?`progress_activity`:`download`,className:`ms-sm`}),g?`cloning…`:`clone`]})]}),y&&(0,S.jsx)(`div`,{className:`settings-err`,children:y}),(0,S.jsxs)(`div`,{className:`settings-note`,children:[`Uses your own git credentials and never prompts: a private remote must already work from a terminal. Agents see every clone here and can add more with `,(0,S.jsx)(`code`,{children:`kraftwerk repos add`}),`.`]})]})]}),e?.enabled&&(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`cloned repositories · newest change first`})}),D.length===0&&(0,S.jsx)(`div`,{className:`ws-empty`,children:`Nothing cloned yet.`}),D.map(e=>{let t=i[e.slug],n=Ia(e);return(0,S.jsxs)(`div`,{className:`ws-row repo-row state-${n.cls}`,"data-repo":e.slug,children:[(0,S.jsx)(`span`,{className:`switcher-icon ws-icon`,children:(0,S.jsx)(C,{name:`folder_data`})}),(0,S.jsxs)(`div`,{className:`ws-main`,children:[(0,S.jsxs)(`div`,{className:`ws-title`,children:[(0,S.jsx)(`span`,{className:`ws-name`,children:e.slug}),e.branch&&(0,S.jsx)(`span`,{className:`repo-branch`,children:e.branch}),(0,S.jsx)(`span`,{className:`ws-state ws-state-${n.cls}`,children:n.label}),e.updatedAt&&(0,S.jsxs)(`span`,{className:`vibeable-when`,title:e.updatedAt,children:[`changed `,ve(e.updatedAt)]})]}),e.url&&(0,S.jsx)(`div`,{className:`ws-root`,title:e.url,children:Fa(e.url)}),x&&(0,S.jsx)(`div`,{className:`ws-root ws-dim`,title:e.path,children:e.path}),(0,S.jsxs)(`div`,{className:`ws-meta`,children:[e.head&&(0,S.jsxs)(`span`,{title:e.committedAt,children:[(0,S.jsx)(`code`,{children:e.head}),` `,e.subject,e.committedAt?` · ${ve(e.committedAt)}`:``]}),!!e.behind&&!!e.dirty&&(0,S.jsxs)(`span`,{children:[`behind by `,e.behind]}),e.error&&(0,S.jsx)(`span`,{className:`settings-err`,children:e.error})]}),o[e.slug]&&(0,S.jsx)(`div`,{className:`settings-err`,children:o[e.slug]})]}),(0,S.jsxs)(`div`,{className:`ws-actions`,children:[(0,S.jsxs)(`button`,{className:`ws-btn`,disabled:!!t,onClick:()=>void T(e.slug,`update`),title:`git fetch, then fast-forward when clean`,children:[(0,S.jsx)(C,{name:t===`update`?`progress_activity`:`sync`,className:`ms-sm`}),t===`update`?`updating…`:`update`]}),c!==e.slug&&(0,S.jsxs)(`button`,{className:`ws-btn`,disabled:!!t,onClick:()=>l(e.slug),title:`Delete the clone`,children:[(0,S.jsx)(C,{name:`delete`,className:`ms-sm`}),` remove`]}),c===e.slug&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`button`,{className:`ws-btn danger`,onClick:()=>void T(e.slug,`remove`,La(e)),children:[(0,S.jsx)(C,{name:`delete`,className:`ms-sm`}),e.dirty||e.ahead?`delete with local changes`:La(e)?`delete anyway`:`confirm remove`]}),(0,S.jsx)(`button`,{className:`ws-btn`,onClick:()=>l(null),children:`cancel`})]})]})]},e.slug)})]})]})}var za=40,Ba=/Mac|iPhone|iPad/.test(navigator.platform),Va=null,Ha=e=>(e?.workspaces??[]).flatMap(e=>e.agents.map(t=>({agent:t,ws:e,key:`${e.url}|${t.slug}`})));function Ua(e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean);if(n.length===0)return e;let r=[];for(let t of e){let e=t.agent.name.toLowerCase(),i=[e,t.agent.slug,t.agent.description??``,t.agent.group??``,t.ws.name].join(` `).toLowerCase();if(!n.every(e=>i.includes(e)))continue;let a=e.startsWith(n[0])?0:e.includes(n[0])?1:2;r.push({hit:t,score:a})}return r.sort((e,t)=>e.score-t.score).map(e=>e.hit)}async function Wa(e){let t=`/agents/${encodeURIComponent(e.agent.slug)}`;if(e.ws.current)return k(t);let n=e.ws.live||!e.ws.root?e.ws.url:await re(e.ws.root);window.location.assign(`${n.replace(/\/+$/,``)}/#${t}`)}function Ga(){let[e,t]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&!e.altKey&&!e.shiftKey&&e.key.toLowerCase()===`k`&&(e.preventDefault(),t(e=>!e))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`button`,{type:`button`,className:`search-btn`,onClick:()=>t(!0),title:`jump to an agent`,"aria-label":`search agents`,children:[(0,S.jsx)(C,{name:`search`}),(0,S.jsx)(`kbd`,{className:`kbd`,children:Ba?`⌘K`:`Ctrl K`})]}),e&&(0,S.jsx)(Ka,{onClose:()=>t(!1)})]})}function Ka({onClose:e}){let[t,n]=(0,v.useState)(Va),[r,i]=(0,v.useState)(Va===null),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(0),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(``),h=(0,v.useRef)(null);(0,v.useEffect)(()=>{let e=!0;return fetch(`/api/search/agents`,{cache:`no-store`}).then(e=>e.ok?e.json():Promise.reject(Error(String(e.status)))).then(t=>{Va=t,e&&n(t)}).catch(()=>e&&o(!0)).finally(()=>e&&i(!1)),()=>{e=!1}},[]);let g=(0,v.useMemo)(()=>Ha(t),[t]),_=(0,v.useMemo)(()=>Ua(g,s).slice(0,za),[g,s]),y=Math.min(l,Math.max(_.length-1,0));(0,v.useEffect)(()=>{(h.current?.children[y])?.scrollIntoView({block:`nearest`})},[y,_]);let b=t=>{if(!d){if(t.ws.current||t.ws.live){e(),Wa(t);return}f(t.key),m(``),Wa(t).catch(e=>{f(null),m(`${t.ws.name}: ${e.message}`)})}},x=t=>{if(t.key===`ArrowDown`)t.preventDefault(),u(_.length?(y+1)%_.length:0);else if(t.key===`ArrowUp`)t.preventDefault(),u(_.length?(y-1+_.length)%_.length:0);else if(t.key===`Enter`){t.preventDefault();let e=_[y];e&&b(e)}else t.key===`Escape`&&(t.preventDefault(),e())},w;return w=_.length>0?(0,S.jsx)(`ul`,{className:`palette-list`,role:`listbox`,"aria-label":`agents`,ref:h,children:_.map((e,t)=>(0,S.jsxs)(`li`,{role:`option`,"aria-selected":t===y,className:`palette-item${t===y?` active`:``}`,onMouseMove:()=>t!==y&&u(t),onClick:()=>b(e),children:[(0,S.jsx)(`span`,{className:`palette-emoji`,"aria-hidden":!0,children:e.agent.emoji}),(0,S.jsxs)(`span`,{className:`palette-text`,children:[(0,S.jsx)(`span`,{className:`palette-name`,children:e.agent.name}),e.agent.description&&(0,S.jsx)(`span`,{className:`palette-sub`,children:e.agent.description})]}),(0,S.jsxs)(`span`,{className:`palette-ws`,title:e.ws.current?`this workspace`:e.ws.url,children:[e.ws.icon&&(0,S.jsx)(`span`,{"aria-hidden":!0,children:e.ws.icon}),e.ws.name,d===e.key?(0,S.jsx)(C,{name:`progress_activity`,className:`ms-sm`}):e.ws.live?!e.ws.current&&(0,S.jsx)(C,{name:`open_in_new`,className:`ms-sm`}):(0,S.jsx)(`span`,{className:`palette-chip`,children:`stopped`})]})]},e.key))}):a?(0,S.jsx)(`div`,{className:`palette-empty`,children:`could not load the agents`}):r?(0,S.jsx)(`div`,{className:`palette-empty`,children:`looking for agents…`}):g.length===0?(0,S.jsxs)(`div`,{className:`palette-empty`,children:[`no agents yet — `,(0,S.jsx)(`a`,{href:`#/agents/new`,onClick:e,children:`create one`})]}):(0,S.jsxs)(`div`,{className:`palette-empty`,children:[`no agent matches “`,s,`”`]}),(0,S.jsx)(`div`,{className:`palette-backdrop`,onMouseDown:e,children:(0,S.jsxs)(`div`,{className:`palette`,role:`dialog`,"aria-label":`jump to an agent`,onMouseDown:e=>e.stopPropagation(),onKeyDown:x,children:[(0,S.jsxs)(`div`,{className:`palette-input`,children:[(0,S.jsx)(C,{name:`search`}),(0,S.jsx)(`input`,{autoFocus:!0,value:s,onChange:e=>{c(e.target.value),u(0)},placeholder:`jump to an agent…`,"aria-label":`search agents`,autoComplete:`off`,spellCheck:!1}),r&&t&&(0,S.jsx)(C,{name:`progress_activity`,className:`ms-sm`}),(0,S.jsx)(`kbd`,{className:`kbd`,children:`esc`})]}),w,(0,S.jsxs)(`div`,{className:`palette-foot`,children:[(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`kbd`,{className:`kbd`,children:`↑`}),(0,S.jsx)(`kbd`,{className:`kbd`,children:`↓`}),` move`]}),(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`kbd`,{className:`kbd`,children:`↵`}),` open`]}),d&&(0,S.jsxs)(`span`,{className:`palette-note`,children:[(0,S.jsx)(C,{name:`progress_activity`,className:`ms-sm`}),` starting the workspace…`]}),p&&(0,S.jsxs)(`span`,{className:`palette-warn`,title:p,children:[(0,S.jsx)(C,{name:`warning`,className:`ms-sm`}),` `,p]})]})]})})}var qa=`modulepreload`,Ja=function(e){return`/`+e},Ya={},Xa=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Ja(t,n),t=s(t),t in Ya)return;Ya[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:qa,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Za=(0,v.lazy)(()=>Xa(()=>import(`./editor-CyEovn1g.js`).then(e=>({default:e.EditorScreen})),__vite__mapDeps([0,1,2,3,4,5,6])));function Qa(){let[e,t=``]=w().split(`?`),n=e.split(`/`).filter(Boolean),r=new URLSearchParams(t).get(`workflow`)??void 0,[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(!0),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(!1),[x,T]=(0,v.useState)(!1),[E,D]=(0,v.useState)([]);(0,v.useEffect)(()=>{let e=!0,t,n=async()=>{try{let t=await fetch(`/api/meta`,{cache:`no-store`}).then(e=>e.json());if(!e)return;a(t.projectName??``),s(t.projectIcon??``),l(t.projectColor??``),d(t.projectNamed!==!1),p(t.projectRootLabel??``),h(t.projectRoot??``),_(!!t.git),b(!!t.repos),T(!!t.vibeables),ce({git:!!t.git,repos:!!t.repos,vibeables:!!t.vibeables}),D(Array.isArray(t.switcher)?t.switcher:[])}catch{}e&&(t=setTimeout(n,3e4))};n();let r=()=>{clearTimeout(t),n()};return window.addEventListener(`kw-meta-refresh`,r),()=>{e=!1,clearTimeout(t),window.removeEventListener(`kw-meta-refresh`,r)}},[]),(0,v.useEffect)(()=>{if(te(i?`${i} — kraftwerk`:`kraftwerk inspector`),!o)return;let e=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="0.9em" font-size="85">${o}</text></svg>`,t=document.querySelector(`link[rel="icon"]`);t||(t=document.createElement(`link`),t.rel=`icon`,document.head.appendChild(t)),t.href=`data:image/svg+xml,${encodeURIComponent(e)}`},[i,o]);let O;return O=n[0]===`runs`&&n[1]?(0,S.jsx)(ni,{id:n[1],workflow:r}):n[0]===`runs`?(0,S.jsx)(oo,{}):n[0]===`workflows`&&n[1]?(0,S.jsx)(Di,{slug:decodeURIComponent(n[1])}):n[0]===`workflows`?(0,S.jsx)(Ti,{}):n[0]===`chats`?(0,S.jsx)(ua,{seg:n}):n[0]===`skills`?(0,S.jsx)(aa,{name:n[1]?decodeURIComponent(n[1]):void 0}):n[0]===`settings`?(0,S.jsx)(Da,{}):n[0]===`workspaces`?(0,S.jsx)(ka,{}):n[0]===`git`?(0,S.jsx)(Pa,{}):n[0]===`repos`?(0,S.jsx)(Ra,{}):n[0]===`vibeables`?(0,S.jsx)(Ir,{}):n[0]===`agents`||n[0]===`team`?(0,S.jsx)(ua,{seg:n.slice(1)}):n[0]===`channels`?(0,S.jsx)(Lr,{seg:n.slice(1)}):n[0]===`knowledge`?(0,S.jsx)(Ki,{bundle:n[1]?decodeURIComponent(n[1]):void 0,conceptId:n.length>2?n.slice(2).map(decodeURIComponent).join(`/`):void 0}):(0,S.jsx)(Pi,{}),n[0]===`edit`&&n[1]&&n.length>2?(0,S.jsx)(v.Suspense,{fallback:(0,S.jsx)(`div`,{className:`empty`,children:`loading editor…`}),children:(0,S.jsx)(Za,{bundle:decodeURIComponent(n[1]),conceptId:n.slice(2).map(decodeURIComponent).join(`/`)},n.slice(1).join(`/`))}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`header`,{className:`topbar`,style:{"--ws-c":ue(c,m||i)},children:[(0,S.jsxs)(`span`,{className:`wordmark`,children:[(0,S.jsx)(`a`,{href:`#/`,className:`home-link`,title:`Dashboard`,children:i?(0,S.jsx)(fe,{className:`home-tile`,icon:o,name:i,color:c,seed:m||i}):(0,S.jsx)(C,{name:`home`})}),i&&(0,S.jsx)(ao,{name:i,icon:o,color:c,named:u,root:f,seed:m||i,entries:E})]}),(0,S.jsxs)(`nav`,{children:[(0,S.jsxs)(`a`,{href:`#/agents`,children:[(0,S.jsx)(C,{name:`groups`}),` agents`]}),(0,S.jsxs)(`a`,{href:`#/channels`,children:[(0,S.jsx)(C,{name:`forum`}),` channels`]}),(0,S.jsxs)(`a`,{href:`#/knowledge`,children:[(0,S.jsx)(C,{name:`menu_book`}),` context & knowledge`]}),(0,S.jsxs)(`a`,{href:`#/workflows`,children:[(0,S.jsx)(C,{name:`account_tree`}),` workflows`]}),(0,S.jsxs)(`a`,{href:`#/skills`,children:[(0,S.jsx)(C,{name:`extension`}),` skills`]}),y&&(0,S.jsxs)(`a`,{href:`#/repos`,children:[(0,S.jsx)(C,{name:`source`}),` repositories`]}),x&&(0,S.jsxs)(`a`,{href:`#/vibeables`,children:[(0,S.jsx)(C,{name:`web`}),` vibeables`]}),g&&(0,S.jsx)($a,{})]}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(Ga,{}),(0,S.jsx)(lo,{}),(0,S.jsx)(so,{}),(0,S.jsx)(co,{}),(0,S.jsx)(uo,{})]}),(0,S.jsx)(`main`,{className:`shell`,children:O})]})}function $a(){let e=F(`/api/git`,!1,15e3),t=e?.files?.filter(e=>e.syncable).length??0;return(0,S.jsxs)(`a`,{href:`#/git`,children:[(0,S.jsx)(C,{name:`cloud_sync`}),` git`,!!e?.behind&&(0,S.jsxs)(`span`,{className:`git-badge behind`,children:[e.behind,`↓`]}),!!e?.ahead&&(0,S.jsxs)(`span`,{className:`git-badge ahead`,children:[e.ahead,`↑`]}),!e?.ahead&&!e?.behind&&!!t&&(0,S.jsx)(`span`,{className:`git-badge dirty`,children:t})]})}function eo(e){try{let t=new URL(e);return t.hostname===`localhost`||t.hostname===`127.0.0.1`?`:${t.port||(t.protocol===`https:`?443:80)}`:t.host}catch{return e.replace(/^https?:\/\//,``)}}function to({label:e}){return e?(0,S.jsx)(`span`,{className:`switcher-root`,title:e,children:(0,S.jsx)(`span`,{dir:`ltr`,children:e})}):null}function no({name:e,named:t}){let n=t===!1;return(0,S.jsx)(`span`,{className:`switcher-name${n?` unnamed`:``}`,title:n?`${e} — folder name; set name: in kraftwerk.yml`:e,children:e})}function ro({entry:e,ambiguous:t}){let[n,r]=(0,v.useState)(`idle`),[i,a]=(0,v.useState)(``),o=e.exists===!1,s=async()=>{r(`starting`),a(``);try{window.location.assign(await re(e.root))}catch(e){r(`error`),a(e.message)}};return(0,S.jsxs)(`span`,{className:`switcher-item stopped ${o?`missing`:``}`,role:`menuitem`,style:{"--ws-c":ue(e.color,e.root??e.url)},children:[(0,S.jsx)(fe,{icon:e.icon,name:e.name,color:e.color,seed:e.root??e.url,ambiguous:t}),(0,S.jsxs)(`span`,{className:`switcher-text`,children:[(0,S.jsx)(no,{name:e.name,named:e.named}),n===`error`?(0,S.jsx)(`span`,{className:`switcher-sub switcher-err`,title:i,children:i}):o?(0,S.jsx)(`span`,{className:`switcher-sub`,children:`folder missing`}):(0,S.jsx)(to,{label:e.rootLabel})]}),(0,S.jsxs)(`span`,{className:`switcher-side`,children:[(0,S.jsx)(`span`,{className:`switcher-port`,children:eo(e.url)}),(0,S.jsxs)(`button`,{className:`switcher-start`,disabled:o||n===`starting`,title:o?`The project folder no longer exists`:`Start the UI for this project`,onClick:e=>{e.stopPropagation(),s()},children:[n===`starting`?(0,S.jsx)(C,{name:`progress_activity`}):(0,S.jsx)(C,{name:`play_arrow`}),n===`starting`?`starting`:`start`]})]})]})}function io({entry:e,ambiguous:t}){let n=e.root??e.url;return(0,S.jsxs)(`a`,{className:`switcher-item${e.live?` live`:``}`,role:`menuitem`,href:e.url,style:{"--ws-c":ue(e.color,n)},children:[(0,S.jsx)(fe,{icon:e.icon,name:e.name,color:e.color,seed:n,ambiguous:t}),(0,S.jsxs)(`span`,{className:`switcher-text`,children:[(0,S.jsx)(no,{name:e.name,named:e.named}),(0,S.jsx)(to,{label:e.rootLabel??(e.root?void 0:e.url.replace(/^https?:\/\//,``))})]}),(0,S.jsx)(`span`,{className:`switcher-side`,children:(0,S.jsxs)(`span`,{className:`switcher-port`,children:[e.live&&(0,S.jsx)(`span`,{className:`live-dot`,title:`running`}),eo(e.url)]})})]})}function ao({name:e,icon:t,color:n,named:r,root:i,seed:a,entries:o}){let[s,c]=(0,v.useState)(!1),l=N();if((0,v.useEffect)(()=>{if(!s)return;let e=e=>{e.target.closest(`.switcher-wrap`)||c(!1)};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[s]),o.length===0)return(0,S.jsx)(`span`,{className:`env-name`,title:i||`Project (kraftwerk.yml: name)`,children:e});let u=new Map;for(let e of[t,...o.map(e=>e.icon)])e&&u.set(e,(u.get(e)??0)+1);let d=e=>!!e&&(u.get(e)??0)>1,f=[{key:`running`,label:`running`,items:o.filter(e=>e.live===!0)},{key:`stopped`,label:`stopped`,items:o.filter(e=>e.live===!1)},{key:`linked`,label:`linked`,items:o.filter(e=>e.live===void 0)}].filter(e=>e.items.length>0),p=a||e;return(0,S.jsxs)(`span`,{className:`switcher-wrap`,children:[(0,S.jsxs)(`button`,{className:`env-name env-switch`,title:i?`${i} — switch workspace`:`Switch workspace`,"aria-haspopup":`menu`,"aria-expanded":s,onClick:()=>c(e=>!e),children:[e,(0,S.jsx)(C,{name:`expand_more`})]}),s&&(0,S.jsxs)(`div`,{className:`switcher-pop`,role:`menu`,children:[(0,S.jsx)(`div`,{className:`switcher-head`,children:`Workspaces`}),(0,S.jsxs)(`span`,{className:`switcher-item current`,"aria-current":`true`,style:{"--ws-c":ue(n,p)},children:[(0,S.jsx)(fe,{icon:t,name:e,color:n,seed:p,ambiguous:d(t)}),(0,S.jsxs)(`span`,{className:`switcher-text`,children:[(0,S.jsx)(no,{name:e,named:r}),i?(0,S.jsx)(to,{label:i}):(0,S.jsx)(`span`,{className:`switcher-sub`,children:`this workspace`})]}),(0,S.jsx)(`span`,{className:`switcher-side`,children:(0,S.jsx)(C,{name:`check`,className:`switcher-check`})})]}),f.map(e=>(0,S.jsxs)(`div`,{className:`switcher-group switcher-group-${e.key}`,role:`group`,"aria-label":e.label,children:[(0,S.jsx)(`div`,{className:`switcher-group-head`,children:e.label}),e.items.map(e=>e.live===!1&&e.root?(0,S.jsx)(ro,{entry:e,ambiguous:d(e.icon)},e.root):(0,S.jsx)(io,{entry:e,ambiguous:d(e.icon)},e.root??e.url))]},e.key)),l&&(0,S.jsxs)(`a`,{className:`switcher-foot`,href:`#/workspaces`,role:`menuitem`,onClick:()=>c(!1),children:[(0,S.jsx)(C,{name:`hub`}),` manage workspaces`]})]})]})}function oo(){let[e,t]=(0,v.useState)(null);return(0,v.useEffect)(()=>{let e=!0;return fetch(`/api/runs`).then(e=>e.json()).then(n=>{e&&(n.runs.length>0?k(`/runs/${n.runs[0].id}`,{replace:!0}):t({outputDir:n.outputDir}))}).catch(()=>{}),()=>{e=!1}},[]),e?(0,S.jsxs)(`div`,{className:`empty`,children:[`No runs found in `,(0,S.jsx)(`code`,{children:e.outputDir}),`. Start one from the`,` `,(0,S.jsx)(`a`,{href:`#/workflows`,children:`workflows`}),` list or with `,(0,S.jsx)(`code`,{children:`kraftwerk run <workflow> [request]`}),`.`]}):(0,S.jsx)(`div`,{className:`empty`,children:`loading…`})}function so(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let e=!0,n,r=async()=>{try{let n=await fetch(`/api/meta`,{cache:`no-store`}).then(e=>e.json());e&&t(n)}catch{}e&&(n=setTimeout(r,3e4))};return r(),()=>{e=!1,clearTimeout(n)}},[]);let i=e?.restartable&&e.diskVersion&&e.diskVersion!==e.version?e.diskVersion:null;async function a(){if(i){r(!0),await fetch(`/api/restart`,{method:`POST`}).catch(()=>{});for(let e=0;e<60;e++){await new Promise(e=>setTimeout(e,500));try{if((await fetch(`/api/meta`,{cache:`no-store`}).then(e=>e.json())).version===i)break}catch{}}location.reload()}}return!i&&!n?null:(0,S.jsx)(`button`,{className:`relaunch-note`,disabled:n,title:`v${i} is installed on disk, the server still runs v${e?.version}. Click to relaunch with the new version.`,onClick:()=>void a(),children:n?`relaunching…`:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C,{name:`restart_alt`,className:`ms-sm`}),` v`,i,` ready — relaunch`]})})}function co(){let e=N();return(0,S.jsxs)(`button`,{className:`expert-toggle ${e?`on`:``}`,title:e?`Expert mode on — full detail`:`Expert mode off — simplified view`,"aria-pressed":e,onClick:()=>ae(!e),children:[(0,S.jsx)(`span`,{className:`expert-track`,children:(0,S.jsx)(`span`,{className:`expert-knob`})}),`expert`]})}var W={approval:`gavel`,routine_done:`schedule`,routine_failed:`schedule`,run_done:`account_tree`,run_failed:`account_tree`},G=`kw.notif.toast.dismissed`;function lo(){let[e,t]=(0,v.useState)(!1),n=F(`/api/notifications`,!1,5e3),[r,i]=(0,v.useState)(()=>typeof Notification>`u`?`unsupported`:Notification.permission),[a,o]=(0,v.useState)(()=>{try{return localStorage.getItem(G)===`1`}catch{return!1}}),s=(0,v.useRef)(null),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null);(0,v.useEffect)(()=>l(null),[n]);let f=c??n,p=f?.items??[],m=f?.unread??0;(0,v.useEffect)(()=>ee(m),[m]),(0,v.useEffect)(()=>{if(n){if(!s.current){s.current=new Set(p.map(e=>e.id));return}for(let e of p)if(!s.current.has(e.id)&&(s.current.add(e.id),!(e.readAt||r!==`granted`)&&(document.hidden||location.hash!==`#${e.href}`)))try{let t=new Notification(e.title,{body:e.body,tag:e.id});t.onclick=()=>{window.focus(),g(e),t.close()}}catch{}}},[n]),(0,v.useEffect)(()=>{if(!e)return;let n=e=>{e.target.closest(`.notif-wrap`)||t(!1)};return window.addEventListener(`mousedown`,n),()=>window.removeEventListener(`mousedown`,n)},[e]);async function h(e,t){try{let n=await fetch(e,{method:e.endsWith(`/notifications`)?`DELETE`:`POST`,headers:{"content-type":`application/json`},body:t===void 0?void 0:JSON.stringify(t)});if(!n.ok)return;let r=await n.json();l(`items`in r?r:{items:[],unread:0})}catch{}}function g(e){t(!1),e.readAt||h(`/api/notifications/read`,{ids:[e.id]}),k(e.href)}async function _(e){d(e.id);try{let n=await(await fetch(`/api/notifications/${encodeURIComponent(e.id)}/diagnose`,{method:`POST`})).json();n.href?(t(!1),k(n.href)):n.error&&alert(n.error)}catch{}d(null)}async function y(){typeof Notification>`u`||i(await Notification.requestPermission())}function b(){o(!0);try{localStorage.setItem(G,`1`)}catch{}}let x=r==="default"&&!a;return(0,S.jsxs)(`span`,{className:`notif-wrap`,children:[(0,S.jsxs)(`button`,{className:`info-btn notif-btn ${m?`has-unread`:``}`,title:m?`${m} item${m===1?``:`s`} need your attention`:`Notifications`,"aria-label":`Notifications`,onClick:()=>t(e=>!e),children:[(0,S.jsx)(C,{name:m?`notifications_active`:`notifications`}),m>0&&(0,S.jsx)(`span`,{className:`notif-badge`,children:m>99?`99+`:m})]}),e&&(0,S.jsxs)(`div`,{className:`info-pop notif-pop`,role:`menu`,children:[(0,S.jsxs)(`div`,{className:`notif-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`notifications`}),(0,S.jsx)(`span`,{className:`spacer`}),m>0&&(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>void h(`/api/notifications/read`),children:`mark all read`}),p.length>0&&(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>void h(`/api/notifications`),children:`clear`})]}),x&&(0,S.jsxs)(`div`,{className:`notif-hint`,children:[(0,S.jsx)(`span`,{children:`Get a system notification when something needs you, even with this tab in the background.`}),(0,S.jsxs)(`span`,{className:`notif-hint-actions`,children:[(0,S.jsx)(`button`,{className:`ws-btn primary`,onClick:()=>void y(),children:`enable`}),(0,S.jsx)(`button`,{className:`ws-btn`,onClick:b,children:`not now`})]})]}),r===`denied`&&(0,S.jsx)(`div`,{className:`notif-hint muted`,children:`Browser notifications are blocked for this site — allow them in the address bar to get system alerts.`}),p.length===0?(0,S.jsx)(`div`,{className:`notif-empty`,children:`nothing needs you right now`}):(0,S.jsx)(`div`,{className:`notif-list`,children:p.slice(0,50).map(e=>(0,S.jsxs)(`div`,{className:`notif-row ${e.readAt?``:`unread`} ${e.kind}`,role:`button`,tabIndex:0,onClick:()=>g(e),onKeyDown:t=>{t.key===`Enter`&&g(e)},children:[(0,S.jsx)(`span`,{className:`notif-ico`,children:(0,S.jsx)(C,{name:W[e.kind]})}),(0,S.jsxs)(`span`,{className:`notif-body`,children:[(0,S.jsx)(`span`,{className:`notif-title`,children:e.title}),e.body&&(0,S.jsx)(`span`,{className:`notif-sub`,children:e.body}),e.diagnose&&(0,S.jsx)(`span`,{className:`notif-actions`,children:(0,S.jsxs)(`button`,{className:`ws-btn notif-diagnose`,disabled:u===e.id,title:`Open a chat that finds the cause and proposes the fix`,onClick:t=>{t.stopPropagation(),_(e)},children:[(0,S.jsx)(C,{name:u===e.id?`progress_activity`:`troubleshoot`,className:`ms-sm`}),u===e.id?`starting…`:`diagnose`]})})]}),(0,S.jsx)(`span`,{className:`notif-when num`,children:ve(e.at)})]},e.id))})]})]})}function uo(){let[e,t]=(0,v.useState)(!1),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``);(0,v.useEffect)(()=>{if(!e)return;fetch(`/api/runs`).then(e=>e.json()).then(r).catch(()=>{}),fetch(`/api/workflows`).then(e=>e.json()).then(a).catch(()=>{}),fetch(`/api/meta`).then(e=>e.json()).then(e=>s(e.version)).catch(()=>{});let n=e=>{e.target.closest(`.info-wrap`)||t(!1)};return window.addEventListener(`mousedown`,n),()=>window.removeEventListener(`mousedown`,n)},[e]);let c=n?.runs[0];return(0,S.jsxs)(`span`,{className:`info-wrap`,children:[(0,S.jsx)(`button`,{className:`info-btn`,title:`Project info`,"aria-label":`Project info`,onClick:()=>t(e=>!e),children:(0,S.jsx)(C,{name:`info`})}),e&&(0,S.jsxs)(`div`,{className:`info-pop`,children:[(0,S.jsxs)(`div`,{className:`info-row`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`Workflows`}),(0,S.jsx)(`span`,{className:`info-v`,children:i?`${i.workflows.length} discovered`:`…`}),(0,S.jsx)(`code`,{className:`info-path`,title:i?.root,children:i?.root??``})]}),(0,S.jsxs)(`div`,{className:`info-row`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`Runs`}),(0,S.jsxs)(`span`,{className:`info-v`,children:[n?`${n.runs.length} total`:`…`,c?` · latest ${c.status}`:``]}),(0,S.jsx)(`code`,{className:`info-path`,title:n?.outputDir,children:n?.outputDir??``})]}),(0,S.jsxs)(`div`,{className:`info-row info-actions`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`Workspace`}),(0,S.jsxs)(`a`,{className:`update-btn`,href:`#/settings`,onClick:()=>t(!1),children:[(0,S.jsx)(C,{name:`settings`,className:`ms-sm`}),` settings`]})]}),(0,S.jsxs)(`div`,{className:`info-row info-actions`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`Theme`}),(0,S.jsx)(mo,{})]}),(0,S.jsxs)(`div`,{className:`info-row info-actions`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`Version`}),(0,S.jsx)(`span`,{className:`info-v mono`,children:o?`kraftwerk ${o}`:`…`}),(0,S.jsx)(po,{})]})]})]})}function fo(e,t){let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e++)if((n[e]??0)!==(r[e]??0))return(n[e]??0)<(r[e]??0);return!1}function po(){let[e,t]=(0,v.useState)(`idle`),[n,r]=(0,v.useState)(null);async function i(){t(`busy`);try{let e=await fetch(`/api/update-check`,{cache:`no-store`}),n=await e.json();if(!e.ok||!n.latest)throw Error();r(n),t(`done`)}catch{t(`err`)}}return e===`done`&&n?fo(n.current,n.latest)?(0,S.jsxs)(`span`,{className:`update-result newer`,children:[`v`,n.latest,` available — `,(0,S.jsxs)(`code`,{children:[`npm i -g `,n.name,`@latest`]})]}):(0,S.jsxs)(`span`,{className:`update-result`,children:[(0,S.jsx)(C,{name:`check`,className:`ms-sm`}),` up to date`]}):(0,S.jsx)(`button`,{className:`update-btn`,disabled:e===`busy`,onClick:()=>void i(),children:e===`busy`?`checking…`:e===`err`?`npm unreachable — retry`:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C,{name:`sync`,className:`ms-sm`}),` check for updates`]})})}function mo(){return(0,S.jsx)(`button`,{className:`theme-btn`,onClick:()=>{let e=document.documentElement,t=e.dataset.theme===`light`?`dark`:`light`;e.dataset.theme=t;try{localStorage.setItem(`kw-theme`,t)}catch{}},children:`day / night`})}(0,y.createRoot)(document.getElementById(`root`)).render((0,S.jsx)(v.StrictMode,{children:(0,S.jsx)(Qa,{})}));export{x as a,o as c,ne as i,s as l,C as n,h as o,k as r,d as s,Xa as t,l as u};
218
+ `)[0]]})]}),e.error?(0,S.jsxs)(`div`,{className:`ws-empty ws-load-error`,children:[(0,S.jsx)(C,{name:`error`,className:`ms-sm`}),` `,e.error]}):(0,S.jsxs)(`div`,{className:`git-head`,children:[(0,S.jsxs)(`div`,{className:`git-branch`,children:[(0,S.jsx)(C,{name:`account_tree`,className:`ms-sm`}),(0,S.jsx)(`strong`,{children:e.branch}),e.upstream?(0,S.jsxs)(`span`,{className:`settings-note`,children:[`tracking `,e.upstream]}):(0,S.jsx)(`span`,{className:`settings-note`,children:`no upstream yet, push sets one`})]}),(0,S.jsxs)(`div`,{className:`git-counts`,children:[e.diverged&&(0,S.jsx)(`span`,{className:`git-diverged`,children:`diverged, resolve in a terminal`}),!!e.behind&&(0,S.jsxs)(`span`,{className:`git-behind`,children:[e.behind,` behind`]}),!!e.ahead&&(0,S.jsxs)(`span`,{className:`git-ahead`,children:[e.ahead,` ahead`]}),!e.ahead&&!e.behind&&(0,S.jsx)(`span`,{className:`settings-note`,children:`up to date`})]}),(0,S.jsxs)(`div`,{className:`ws-actions`,children:[(0,S.jsxs)(`button`,{className:`ws-btn`,disabled:!!c,onClick:()=>void h(`fetch`),children:[(0,S.jsx)(C,{name:c===`fetch`?`progress_activity`:`refresh`,className:`ms-sm`}),` fetch`]}),(0,S.jsxs)(`button`,{className:`ws-btn`,disabled:!!c||!e.behind||e.diverged,title:e.diverged?`Diverged. Resolve in a terminal.`:`Fast-forward to the remote`,onClick:()=>void h(`pull`),children:[(0,S.jsx)(C,{name:c===`pull`?`progress_activity`:`download`,className:`ms-sm`}),` pull`]}),(0,S.jsxs)(`button`,{className:`ws-btn primary`,disabled:!!c||!e.ahead&&!!e.upstream,title:e.upstream?`Push to the upstream`:`Push and set the upstream`,onClick:()=>void h(`push`),children:[(0,S.jsx)(C,{name:c===`push`?`progress_activity`:`upload`,className:`ms-sm`}),` push`]})]})]})]}),(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`changes`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(`span`,{className:`settings-note`,children:_.length===0?`workspace clean`:`${n.size} of ${_.length} selected`})]}),_.length===0&&y.length===0&&(0,S.jsx)(`div`,{className:`ws-empty`,children:`Nothing changed under the workspace paths.`}),_.map(e=>(0,S.jsxs)(`div`,{className:`git-row`,children:[(0,S.jsx)(`label`,{className:`git-pick`,children:(0,S.jsx)(`input`,{type:`checkbox`,checked:n.has(e.path),onChange:t=>b(e.path,t.target.checked)})}),(0,S.jsxs)(`button`,{className:`git-file`,onClick:()=>a(t=>{let n=new Set(t);return n.has(e.path)?n.delete(e.path):n.add(e.path),n}),children:[(0,S.jsx)(C,{name:i.has(e.path)?`expand_more`:`chevron_right`,className:`ms-sm`}),(0,S.jsx)(`span`,{className:`git-status s-${e.status}`,children:e.status}),(0,S.jsx)(`span`,{className:`git-path`,children:e.path})]}),i.has(e.path)&&(0,S.jsx)(Na,{file:e.path})]},e.path)),_.length>0&&(0,S.jsxs)(`div`,{className:`git-commit`,children:[(0,S.jsx)(`input`,{className:`git-message`,placeholder:`Commit message`,value:o,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!c&&o.trim()&&n.size>0&&g()}}),(0,S.jsx)(`button`,{className:`ws-btn`,disabled:n.size===_.length,onClick:()=>r(new Set(_.map(e=>e.path))),children:`select all`}),(0,S.jsxs)(`button`,{className:`ws-btn primary`,disabled:!!c||n.size===0||!o.trim(),onClick:()=>void g(),children:[(0,S.jsx)(C,{name:c===`commit`?`progress_activity`:`check`,className:`ms-sm`}),`commit `,n.size||``]})]}),y.length>0&&(0,S.jsxs)(`details`,{className:`git-blocked`,children:[(0,S.jsxs)(`summary`,{children:[y.length,e.blockedHidden?`+`:``,` change`,y.length===1&&!e.blockedHidden?``:`s`,` outside the workspace paths`]}),y.map(e=>(0,S.jsxs)(`div`,{className:`git-row blocked`,children:[(0,S.jsx)(`span`,{className:`git-status s-blocked`,children:e.status}),(0,S.jsx)(`span`,{className:`git-path`,children:e.path}),(0,S.jsx)(`span`,{className:`settings-note`,children:e.reason})]},e.path)),!!e.blockedHidden&&(0,S.jsx)(`div`,{className:`git-row blocked`,children:(0,S.jsxs)(`span`,{className:`settings-note`,children:[`and `,e.blockedHidden,` more, not listed`]})})]})]}),(0,S.jsxs)(`p`,{className:`settings-note`,children:[`Synced paths: `,(e.scope??[]).map((e,t)=>(0,S.jsxs)(`span`,{children:[t>0&&`, `,(0,S.jsx)(`code`,{children:e})]},e)),`. Run artifacts and files like `,(0,S.jsx)(`code`,{children:`.env`}),` are never staged.`,` `,e.interval?`Fetches every ${Aa(e.interval)}${e.autosync===`pull`?` and fast-forwards when the working tree is clean`:``}. `:`Background fetching is off. `,`Commit and push are always manual.`]})]})}var Fa=e=>e.replace(/^https?:\/\//,``).replace(/^git@([^:]+):/,`$1/`).replace(/\.git$/,``),Ia=e=>e.error?{label:`unreadable`,cls:`missing`}:e.dirty?{label:`${e.dirty} changed`,cls:`died`}:e.ahead?{label:`${e.ahead} to push`,cls:`running`}:e.behind?{label:`${e.behind} behind`,cls:`stopped`}:{label:`clean`,cls:`running`},La=e=>!!(e.error||e.dirty||e.ahead===void 0||e.ahead);function Ra(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)({}),[o,s]=(0,v.useState)({}),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(``),x=N(),w=(0,v.useCallback)(async()=>{try{let e=await fetch(`/api/repos`,{cache:`no-store`});if(!e.ok)throw Error(`HTTP ${e.status}`);t(await e.json()),r(``)}catch(e){r(e.message||`could not load repositories`)}},[]);(0,v.useEffect)(()=>{let e=!0,t,n=async()=>{await w(),e&&(t=setTimeout(n,15e3))};return n(),()=>{e=!1,clearTimeout(t)}},[w]);let T=async(e,t,n=!1)=>{a(n=>({...n,[e]:t})),s(t=>({...t,[e]:``})),l(null);try{let r=t===`update`?await fetch(`/api/repos/${encodeURIComponent(e)}/update`,{method:`POST`}):await fetch(`/api/repos/${encodeURIComponent(e)}${n?`?force=1`:``}`,{method:`DELETE`}),i=await r.json();if(!r.ok||!i.ok)throw Error(i.error||`failed`);i.error&&s(t=>({...t,[e]:i.error}))}catch(t){s(n=>({...n,[e]:t.message}))}finally{a(t=>{let n={...t};return delete n[e],n}),w()}},E=async e=>{if(e.preventDefault(),u.trim()&&!g){_(!0),b(``);try{let e=await fetch(`/api/repos`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({url:u.trim(),name:f.trim()||void 0,branch:m.trim()||void 0})}),t=await e.json();if(!e.ok)throw Error(t.error||`clone failed`);d(``),p(``),h(``),await w()}catch(e){b(e.message)}finally{_(!1)}}},D=[...e?.repos??[]].sort((e,t)=>(t.updatedAt??``).localeCompare(e.updatedAt??``));return(0,S.jsxs)(`div`,{className:`settings-screen ws-screen repos-screen`,children:[(0,S.jsxs)(`div`,{className:`settings-head`,children:[(0,S.jsxs)(`h1`,{children:[(0,S.jsx)(C,{name:`source`,className:`ms-lg`}),` Repositories`]}),(0,S.jsx)(`span`,{className:`spacer`}),e?.enabled&&(0,S.jsxs)(`span`,{className:`settings-note`,children:[D.length,` cloned`]}),n&&(0,S.jsx)(`span`,{className:`settings-err`,children:n})]}),e&&!e.enabled&&(0,S.jsx)(`section`,{className:`panel`,children:(0,S.jsx)(`div`,{className:`ws-empty`,children:e.error&&!/are off/.test(e.error)?(0,S.jsx)(`span`,{className:`settings-err`,children:e.error}):(0,S.jsxs)(S.Fragment,{children:[`Repositories are off. Turn them on in `,(0,S.jsx)(`a`,{href:`#/settings`,children:`settings`}),` or add a `,(0,S.jsx)(`code`,{children:`repos:`}),` block to kraftwerk.yml.`]})})}),e?.enabled&&(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsxs)(`div`,{className:`panel-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`add a repository`}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsxs)(`span`,{className:`settings-note`,children:[`clones into `,(0,S.jsx)(`code`,{title:e.root,children:e.root})]})]}),(0,S.jsxs)(`form`,{className:`agent-form`,onSubmit:e=>void E(e),children:[(0,S.jsxs)(`div`,{className:`agent-form-row`,children:[(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:2},children:[`url`,(0,S.jsx)(`input`,{value:u,placeholder:`https://github.com/org/repo.git, git@host:org/repo.git or github:org/repo`,onChange:e=>d(e.target.value),autoFocus:!0})]}),(0,S.jsxs)(`label`,{className:`agent-field`,style:{flex:1},children:[`name`,(0,S.jsx)(`input`,{value:f,placeholder:`from the url`,onChange:e=>p(e.target.value)})]}),(0,S.jsxs)(`label`,{className:`agent-field`,style:{width:140},children:[`branch`,(0,S.jsx)(`input`,{value:m,placeholder:`default`,onChange:e=>h(e.target.value)})]}),(0,S.jsxs)(`button`,{className:`ws-btn primary`,type:`submit`,disabled:g||!u.trim(),children:[(0,S.jsx)(C,{name:g?`progress_activity`:`download`,className:`ms-sm`}),g?`cloning…`:`clone`]})]}),y&&(0,S.jsx)(`div`,{className:`settings-err`,children:y}),(0,S.jsxs)(`div`,{className:`settings-note`,children:[`Uses your own git credentials and never prompts: a private remote must already work from a terminal. Agents see every clone here and can add more with `,(0,S.jsx)(`code`,{children:`kraftwerk repos add`}),`.`]})]})]}),e?.enabled&&(0,S.jsxs)(`section`,{className:`panel`,children:[(0,S.jsx)(`div`,{className:`panel-head`,children:(0,S.jsx)(`span`,{className:`microlabel`,children:`cloned repositories · newest change first`})}),D.length===0&&(0,S.jsx)(`div`,{className:`ws-empty`,children:`Nothing cloned yet.`}),D.map(e=>{let t=i[e.slug],n=Ia(e);return(0,S.jsxs)(`div`,{className:`ws-row repo-row state-${n.cls}`,"data-repo":e.slug,children:[(0,S.jsx)(`span`,{className:`switcher-icon ws-icon`,children:(0,S.jsx)(C,{name:`folder_data`})}),(0,S.jsxs)(`div`,{className:`ws-main`,children:[(0,S.jsxs)(`div`,{className:`ws-title`,children:[(0,S.jsx)(`span`,{className:`ws-name`,children:e.slug}),e.branch&&(0,S.jsx)(`span`,{className:`repo-branch`,children:e.branch}),(0,S.jsx)(`span`,{className:`ws-state ws-state-${n.cls}`,children:n.label}),e.updatedAt&&(0,S.jsxs)(`span`,{className:`vibeable-when`,title:e.updatedAt,children:[`changed `,ve(e.updatedAt)]})]}),e.url&&(0,S.jsx)(`div`,{className:`ws-root`,title:e.url,children:Fa(e.url)}),x&&(0,S.jsx)(`div`,{className:`ws-root ws-dim`,title:e.path,children:e.path}),(0,S.jsxs)(`div`,{className:`ws-meta`,children:[e.head&&(0,S.jsxs)(`span`,{title:e.committedAt,children:[(0,S.jsx)(`code`,{children:e.head}),` `,e.subject,e.committedAt?` · ${ve(e.committedAt)}`:``]}),!!e.behind&&!!e.dirty&&(0,S.jsxs)(`span`,{children:[`behind by `,e.behind]}),e.error&&(0,S.jsx)(`span`,{className:`settings-err`,children:e.error})]}),o[e.slug]&&(0,S.jsx)(`div`,{className:`settings-err`,children:o[e.slug]})]}),(0,S.jsxs)(`div`,{className:`ws-actions`,children:[(0,S.jsxs)(`button`,{className:`ws-btn`,disabled:!!t,onClick:()=>void T(e.slug,`update`),title:`git fetch, then fast-forward when clean`,children:[(0,S.jsx)(C,{name:t===`update`?`progress_activity`:`sync`,className:`ms-sm`}),t===`update`?`updating…`:`update`]}),c!==e.slug&&(0,S.jsxs)(`button`,{className:`ws-btn`,disabled:!!t,onClick:()=>l(e.slug),title:`Delete the clone`,children:[(0,S.jsx)(C,{name:`delete`,className:`ms-sm`}),` remove`]}),c===e.slug&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`button`,{className:`ws-btn danger`,onClick:()=>void T(e.slug,`remove`,La(e)),children:[(0,S.jsx)(C,{name:`delete`,className:`ms-sm`}),e.dirty||e.ahead?`delete with local changes`:La(e)?`delete anyway`:`confirm remove`]}),(0,S.jsx)(`button`,{className:`ws-btn`,onClick:()=>l(null),children:`cancel`})]})]})]},e.slug)})]})]})}var za=40,Ba=/Mac|iPhone|iPad/.test(navigator.platform),Va=null,Ha=e=>(e?.workspaces??[]).flatMap(e=>e.agents.map(t=>({agent:t,ws:e,key:`${e.url}|${t.slug}`})));function Ua(e,t){let n=t.toLowerCase().split(/\s+/).filter(Boolean);if(n.length===0)return e;let r=[];for(let t of e){let e=t.agent.name.toLowerCase(),i=[e,t.agent.slug,t.agent.description??``,t.agent.group??``,t.ws.name].join(` `).toLowerCase();if(!n.every(e=>i.includes(e)))continue;let a=e.startsWith(n[0])?0:e.includes(n[0])?1:2;r.push({hit:t,score:a})}return r.sort((e,t)=>e.score-t.score).map(e=>e.hit)}async function Wa(e){let t=`/agents/${encodeURIComponent(e.agent.slug)}`;if(e.ws.current)return k(t);let n=e.ws.live||!e.ws.root?e.ws.url:await re(e.ws.root);window.location.assign(`${n.replace(/\/+$/,``)}/#${t}`)}function Ga(){let[e,t]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&!e.altKey&&!e.shiftKey&&e.key.toLowerCase()===`k`&&(e.preventDefault(),t(e=>!e))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`button`,{type:`button`,className:`search-btn`,onClick:()=>t(!0),title:`jump to an agent`,"aria-label":`search agents`,children:[(0,S.jsx)(C,{name:`search`}),(0,S.jsx)(`kbd`,{className:`kbd`,children:Ba?`⌘K`:`Ctrl K`})]}),e&&(0,S.jsx)(Ka,{onClose:()=>t(!1)})]})}function Ka({onClose:e}){let[t,n]=(0,v.useState)(Va),[r,i]=(0,v.useState)(Va===null),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(0),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(``),h=(0,v.useRef)(null);(0,v.useEffect)(()=>{let e=!0;return fetch(`/api/search/agents`,{cache:`no-store`}).then(e=>e.ok?e.json():Promise.reject(Error(String(e.status)))).then(t=>{Va=t,e&&n(t)}).catch(()=>e&&o(!0)).finally(()=>e&&i(!1)),()=>{e=!1}},[]);let g=(0,v.useMemo)(()=>Ha(t),[t]),_=(0,v.useMemo)(()=>Ua(g,s).slice(0,za),[g,s]),y=Math.min(l,Math.max(_.length-1,0));(0,v.useEffect)(()=>{(h.current?.children[y])?.scrollIntoView({block:`nearest`})},[y,_]);let b=t=>{if(!d){if(t.ws.current||t.ws.live){e(),Wa(t);return}f(t.key),m(``),Wa(t).catch(e=>{f(null),m(`${t.ws.name}: ${e.message}`)})}},x=t=>{if(t.key===`ArrowDown`)t.preventDefault(),u(_.length?(y+1)%_.length:0);else if(t.key===`ArrowUp`)t.preventDefault(),u(_.length?(y-1+_.length)%_.length:0);else if(t.key===`Enter`){t.preventDefault();let e=_[y];e&&b(e)}else t.key===`Escape`&&(t.preventDefault(),e())},w;return w=_.length>0?(0,S.jsx)(`ul`,{className:`palette-list`,role:`listbox`,"aria-label":`agents`,ref:h,children:_.map((e,t)=>(0,S.jsxs)(`li`,{role:`option`,"aria-selected":t===y,className:`palette-item${t===y?` active`:``}`,onMouseMove:()=>t!==y&&u(t),onClick:()=>b(e),children:[(0,S.jsx)(`span`,{className:`palette-emoji`,"aria-hidden":!0,children:e.agent.emoji}),(0,S.jsxs)(`span`,{className:`palette-text`,children:[(0,S.jsx)(`span`,{className:`palette-name`,children:e.agent.name}),e.agent.description&&(0,S.jsx)(`span`,{className:`palette-sub`,children:e.agent.description})]}),(0,S.jsxs)(`span`,{className:`palette-ws`,title:e.ws.current?`this workspace`:e.ws.url,children:[e.ws.icon&&(0,S.jsx)(`span`,{"aria-hidden":!0,children:e.ws.icon}),e.ws.name,d===e.key?(0,S.jsx)(C,{name:`progress_activity`,className:`ms-sm`}):e.ws.live?!e.ws.current&&(0,S.jsx)(C,{name:`open_in_new`,className:`ms-sm`}):(0,S.jsx)(`span`,{className:`palette-chip`,children:`stopped`})]})]},e.key))}):a?(0,S.jsx)(`div`,{className:`palette-empty`,children:`could not load the agents`}):r?(0,S.jsx)(`div`,{className:`palette-empty`,children:`looking for agents…`}):g.length===0?(0,S.jsxs)(`div`,{className:`palette-empty`,children:[`no agents yet — `,(0,S.jsx)(`a`,{href:`#/agents/new`,onClick:e,children:`create one`})]}):(0,S.jsxs)(`div`,{className:`palette-empty`,children:[`no agent matches “`,s,`”`]}),(0,S.jsx)(`div`,{className:`palette-backdrop`,onMouseDown:e,children:(0,S.jsxs)(`div`,{className:`palette`,role:`dialog`,"aria-label":`jump to an agent`,onMouseDown:e=>e.stopPropagation(),onKeyDown:x,children:[(0,S.jsxs)(`div`,{className:`palette-input`,children:[(0,S.jsx)(C,{name:`search`}),(0,S.jsx)(`input`,{autoFocus:!0,value:s,onChange:e=>{c(e.target.value),u(0)},placeholder:`jump to an agent…`,"aria-label":`search agents`,autoComplete:`off`,spellCheck:!1}),r&&t&&(0,S.jsx)(C,{name:`progress_activity`,className:`ms-sm`}),(0,S.jsx)(`kbd`,{className:`kbd`,children:`esc`})]}),w,(0,S.jsxs)(`div`,{className:`palette-foot`,children:[(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`kbd`,{className:`kbd`,children:`↑`}),(0,S.jsx)(`kbd`,{className:`kbd`,children:`↓`}),` move`]}),(0,S.jsxs)(`span`,{children:[(0,S.jsx)(`kbd`,{className:`kbd`,children:`↵`}),` open`]}),d&&(0,S.jsxs)(`span`,{className:`palette-note`,children:[(0,S.jsx)(C,{name:`progress_activity`,className:`ms-sm`}),` starting the workspace…`]}),p&&(0,S.jsxs)(`span`,{className:`palette-warn`,title:p,children:[(0,S.jsx)(C,{name:`warning`,className:`ms-sm`}),` `,p]})]})]})})}var qa=`modulepreload`,Ja=function(e){return`/`+e},Ya={},Xa=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Ja(t,n),t=s(t),t in Ya)return;Ya[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:qa,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Za=(0,v.lazy)(()=>Xa(()=>import(`./editor-BQkS4m10.js`).then(e=>({default:e.EditorScreen})),__vite__mapDeps([0,1,2,3,4,5,6])));function Qa(){let[e,t=``]=w().split(`?`),n=e.split(`/`).filter(Boolean),r=new URLSearchParams(t).get(`workflow`)??void 0,[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(!0),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(!1),[x,T]=(0,v.useState)(!1),[E,D]=(0,v.useState)([]);(0,v.useEffect)(()=>{let e=!0,t,n=async()=>{try{let t=await fetch(`/api/meta`,{cache:`no-store`}).then(e=>e.json());if(!e)return;a(t.projectName??``),s(t.projectIcon??``),l(t.projectColor??``),d(t.projectNamed!==!1),p(t.projectRootLabel??``),h(t.projectRoot??``),_(!!t.git),b(!!t.repos),T(!!t.vibeables),ce({git:!!t.git,repos:!!t.repos,vibeables:!!t.vibeables}),D(Array.isArray(t.switcher)?t.switcher:[])}catch{}e&&(t=setTimeout(n,3e4))};n();let r=()=>{clearTimeout(t),n()};return window.addEventListener(`kw-meta-refresh`,r),()=>{e=!1,clearTimeout(t),window.removeEventListener(`kw-meta-refresh`,r)}},[]),(0,v.useEffect)(()=>{if(te(i?`${i} — kraftwerk`:`kraftwerk inspector`),!o)return;let e=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="0.9em" font-size="85">${o}</text></svg>`,t=document.querySelector(`link[rel="icon"]`);t||(t=document.createElement(`link`),t.rel=`icon`,document.head.appendChild(t)),t.href=`data:image/svg+xml,${encodeURIComponent(e)}`},[i,o]);let O;return O=n[0]===`runs`&&n[1]?(0,S.jsx)(ni,{id:n[1],workflow:r}):n[0]===`runs`?(0,S.jsx)(oo,{}):n[0]===`workflows`&&n[1]?(0,S.jsx)(Di,{slug:decodeURIComponent(n[1])}):n[0]===`workflows`?(0,S.jsx)(Ti,{}):n[0]===`chats`?(0,S.jsx)(ua,{seg:n}):n[0]===`skills`?(0,S.jsx)(aa,{name:n[1]?decodeURIComponent(n[1]):void 0}):n[0]===`settings`?(0,S.jsx)(Da,{}):n[0]===`workspaces`?(0,S.jsx)(ka,{}):n[0]===`git`?(0,S.jsx)(Pa,{}):n[0]===`repos`?(0,S.jsx)(Ra,{}):n[0]===`vibeables`?(0,S.jsx)(Ir,{}):n[0]===`agents`||n[0]===`team`?(0,S.jsx)(ua,{seg:n.slice(1)}):n[0]===`channels`?(0,S.jsx)(Lr,{seg:n.slice(1)}):n[0]===`knowledge`?(0,S.jsx)(Ki,{bundle:n[1]?decodeURIComponent(n[1]):void 0,conceptId:n.length>2?n.slice(2).map(decodeURIComponent).join(`/`):void 0}):(0,S.jsx)(Pi,{}),n[0]===`edit`&&n[1]&&n.length>2?(0,S.jsx)(v.Suspense,{fallback:(0,S.jsx)(`div`,{className:`empty`,children:`loading editor…`}),children:(0,S.jsx)(Za,{bundle:decodeURIComponent(n[1]),conceptId:n.slice(2).map(decodeURIComponent).join(`/`)},n.slice(1).join(`/`))}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`header`,{className:`topbar`,style:{"--ws-c":ue(c,m||i)},children:[(0,S.jsxs)(`span`,{className:`wordmark`,children:[(0,S.jsx)(`a`,{href:`#/`,className:`home-link`,title:`Dashboard`,children:i?(0,S.jsx)(fe,{className:`home-tile`,icon:o,name:i,color:c,seed:m||i}):(0,S.jsx)(C,{name:`home`})}),i&&(0,S.jsx)(ao,{name:i,icon:o,color:c,named:u,root:f,seed:m||i,entries:E})]}),(0,S.jsxs)(`nav`,{children:[(0,S.jsxs)(`a`,{href:`#/channels`,children:[(0,S.jsx)(C,{name:`forum`}),` channels`]}),(0,S.jsxs)(`a`,{href:`#/agents`,children:[(0,S.jsx)(C,{name:`groups`}),` agents`]}),(0,S.jsxs)(`a`,{href:`#/workflows`,children:[(0,S.jsx)(C,{name:`account_tree`}),` workflows`]}),(0,S.jsxs)(`a`,{href:`#/knowledge`,children:[(0,S.jsx)(C,{name:`menu_book`}),` knowledge`]}),(0,S.jsxs)(`a`,{href:`#/skills`,className:`nav-expert`,children:[(0,S.jsx)(C,{name:`extension`}),` skills`]}),y&&(0,S.jsxs)(`a`,{href:`#/repos`,className:`nav-expert`,children:[(0,S.jsx)(C,{name:`source`}),` repositories`]}),x&&(0,S.jsxs)(`a`,{href:`#/vibeables`,children:[(0,S.jsx)(C,{name:`web`}),` vibeables`]}),g&&(0,S.jsx)($a,{})]}),(0,S.jsx)(`span`,{className:`spacer`}),(0,S.jsx)(Ga,{}),(0,S.jsx)(lo,{}),(0,S.jsx)(so,{}),(0,S.jsx)(co,{}),(0,S.jsx)(uo,{})]}),(0,S.jsx)(`main`,{className:`shell`,children:O})]})}function $a(){let e=F(`/api/git`,!1,15e3),t=e?.files?.filter(e=>e.syncable).length??0;return(0,S.jsxs)(`a`,{href:`#/git`,className:`nav-expert`,children:[(0,S.jsx)(C,{name:`cloud_sync`}),` git`,!!e?.behind&&(0,S.jsxs)(`span`,{className:`git-badge behind`,children:[e.behind,`↓`]}),!!e?.ahead&&(0,S.jsxs)(`span`,{className:`git-badge ahead`,children:[e.ahead,`↑`]}),!e?.ahead&&!e?.behind&&!!t&&(0,S.jsx)(`span`,{className:`git-badge dirty`,children:t})]})}function eo(e){try{let t=new URL(e);return t.hostname===`localhost`||t.hostname===`127.0.0.1`?`:${t.port||(t.protocol===`https:`?443:80)}`:t.host}catch{return e.replace(/^https?:\/\//,``)}}function to({label:e}){return e?(0,S.jsx)(`span`,{className:`switcher-root`,title:e,children:(0,S.jsx)(`span`,{dir:`ltr`,children:e})}):null}function no({name:e,named:t}){let n=t===!1;return(0,S.jsx)(`span`,{className:`switcher-name${n?` unnamed`:``}`,title:n?`${e} — folder name; set name: in kraftwerk.yml`:e,children:e})}function ro({entry:e,ambiguous:t}){let[n,r]=(0,v.useState)(`idle`),[i,a]=(0,v.useState)(``),o=e.exists===!1,s=async()=>{r(`starting`),a(``);try{window.location.assign(await re(e.root))}catch(e){r(`error`),a(e.message)}};return(0,S.jsxs)(`span`,{className:`switcher-item stopped ${o?`missing`:``}`,role:`menuitem`,style:{"--ws-c":ue(e.color,e.root??e.url)},children:[(0,S.jsx)(fe,{icon:e.icon,name:e.name,color:e.color,seed:e.root??e.url,ambiguous:t}),(0,S.jsxs)(`span`,{className:`switcher-text`,children:[(0,S.jsx)(no,{name:e.name,named:e.named}),n===`error`?(0,S.jsx)(`span`,{className:`switcher-sub switcher-err`,title:i,children:i}):o?(0,S.jsx)(`span`,{className:`switcher-sub`,children:`folder missing`}):(0,S.jsx)(to,{label:e.rootLabel})]}),(0,S.jsxs)(`span`,{className:`switcher-side`,children:[(0,S.jsx)(`span`,{className:`switcher-port`,children:eo(e.url)}),(0,S.jsxs)(`button`,{className:`switcher-start`,disabled:o||n===`starting`,title:o?`The project folder no longer exists`:`Start the UI for this project`,onClick:e=>{e.stopPropagation(),s()},children:[n===`starting`?(0,S.jsx)(C,{name:`progress_activity`}):(0,S.jsx)(C,{name:`play_arrow`}),n===`starting`?`starting`:`start`]})]})]})}function io({entry:e,ambiguous:t}){let n=e.root??e.url;return(0,S.jsxs)(`a`,{className:`switcher-item${e.live?` live`:``}`,role:`menuitem`,href:e.url,style:{"--ws-c":ue(e.color,n)},children:[(0,S.jsx)(fe,{icon:e.icon,name:e.name,color:e.color,seed:n,ambiguous:t}),(0,S.jsxs)(`span`,{className:`switcher-text`,children:[(0,S.jsx)(no,{name:e.name,named:e.named}),(0,S.jsx)(to,{label:e.rootLabel??(e.root?void 0:e.url.replace(/^https?:\/\//,``))})]}),(0,S.jsx)(`span`,{className:`switcher-side`,children:(0,S.jsxs)(`span`,{className:`switcher-port`,children:[e.live&&(0,S.jsx)(`span`,{className:`live-dot`,title:`running`}),eo(e.url)]})})]})}function ao({name:e,icon:t,color:n,named:r,root:i,seed:a,entries:o}){let[s,c]=(0,v.useState)(!1),l=N();if((0,v.useEffect)(()=>{if(!s)return;let e=e=>{e.target.closest(`.switcher-wrap`)||c(!1)};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[s]),o.length===0)return(0,S.jsx)(`span`,{className:`env-name`,title:i||`Project (kraftwerk.yml: name)`,children:e});let u=new Map;for(let e of[t,...o.map(e=>e.icon)])e&&u.set(e,(u.get(e)??0)+1);let d=e=>!!e&&(u.get(e)??0)>1,f=[{key:`running`,label:`running`,items:o.filter(e=>e.live===!0)},{key:`stopped`,label:`stopped`,items:o.filter(e=>e.live===!1)},{key:`linked`,label:`linked`,items:o.filter(e=>e.live===void 0)}].filter(e=>e.items.length>0),p=a||e;return(0,S.jsxs)(`span`,{className:`switcher-wrap`,children:[(0,S.jsxs)(`button`,{className:`env-name env-switch`,title:i?`${i} — switch workspace`:`Switch workspace`,"aria-haspopup":`menu`,"aria-expanded":s,onClick:()=>c(e=>!e),children:[e,(0,S.jsx)(C,{name:`expand_more`})]}),s&&(0,S.jsxs)(`div`,{className:`switcher-pop`,role:`menu`,children:[(0,S.jsx)(`div`,{className:`switcher-head`,children:`Workspaces`}),(0,S.jsxs)(`span`,{className:`switcher-item current`,"aria-current":`true`,style:{"--ws-c":ue(n,p)},children:[(0,S.jsx)(fe,{icon:t,name:e,color:n,seed:p,ambiguous:d(t)}),(0,S.jsxs)(`span`,{className:`switcher-text`,children:[(0,S.jsx)(no,{name:e,named:r}),i?(0,S.jsx)(to,{label:i}):(0,S.jsx)(`span`,{className:`switcher-sub`,children:`this workspace`})]}),(0,S.jsx)(`span`,{className:`switcher-side`,children:(0,S.jsx)(C,{name:`check`,className:`switcher-check`})})]}),f.map(e=>(0,S.jsxs)(`div`,{className:`switcher-group switcher-group-${e.key}`,role:`group`,"aria-label":e.label,children:[(0,S.jsx)(`div`,{className:`switcher-group-head`,children:e.label}),e.items.map(e=>e.live===!1&&e.root?(0,S.jsx)(ro,{entry:e,ambiguous:d(e.icon)},e.root):(0,S.jsx)(io,{entry:e,ambiguous:d(e.icon)},e.root??e.url))]},e.key)),l&&(0,S.jsxs)(`a`,{className:`switcher-foot`,href:`#/workspaces`,role:`menuitem`,onClick:()=>c(!1),children:[(0,S.jsx)(C,{name:`hub`}),` manage workspaces`]})]})]})}function oo(){let[e,t]=(0,v.useState)(null);return(0,v.useEffect)(()=>{let e=!0;return fetch(`/api/runs`).then(e=>e.json()).then(n=>{e&&(n.runs.length>0?k(`/runs/${n.runs[0].id}`,{replace:!0}):t({outputDir:n.outputDir}))}).catch(()=>{}),()=>{e=!1}},[]),e?(0,S.jsxs)(`div`,{className:`empty`,children:[`No runs found in `,(0,S.jsx)(`code`,{children:e.outputDir}),`. Start one from the`,` `,(0,S.jsx)(`a`,{href:`#/workflows`,children:`workflows`}),` list or with `,(0,S.jsx)(`code`,{children:`kraftwerk run <workflow> [request]`}),`.`]}):(0,S.jsx)(`div`,{className:`empty`,children:`loading…`})}function so(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let e=!0,n,r=async()=>{try{let n=await fetch(`/api/meta`,{cache:`no-store`}).then(e=>e.json());e&&t(n)}catch{}e&&(n=setTimeout(r,3e4))};return r(),()=>{e=!1,clearTimeout(n)}},[]);let i=e?.restartable&&e.diskVersion&&e.diskVersion!==e.version?e.diskVersion:null;async function a(){if(i){r(!0),await fetch(`/api/restart`,{method:`POST`}).catch(()=>{});for(let e=0;e<60;e++){await new Promise(e=>setTimeout(e,500));try{if((await fetch(`/api/meta`,{cache:`no-store`}).then(e=>e.json())).version===i)break}catch{}}location.reload()}}return!i&&!n?null:(0,S.jsx)(`button`,{className:`relaunch-note`,disabled:n,title:`v${i} is installed on disk, the server still runs v${e?.version}. Click to relaunch with the new version.`,onClick:()=>void a(),children:n?`relaunching…`:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C,{name:`restart_alt`,className:`ms-sm`}),` v`,i,` ready — relaunch`]})})}function co(){let e=N();return(0,S.jsxs)(`button`,{className:`expert-toggle ${e?`on`:``}`,title:e?`Expert mode on — full detail`:`Expert mode off — simplified view`,"aria-pressed":e,onClick:()=>ae(!e),children:[(0,S.jsx)(`span`,{className:`expert-track`,children:(0,S.jsx)(`span`,{className:`expert-knob`})}),`expert`]})}var W={approval:`gavel`,routine_done:`schedule`,routine_failed:`schedule`,run_done:`account_tree`,run_failed:`account_tree`},G=`kw.notif.toast.dismissed`;function lo(){let[e,t]=(0,v.useState)(!1),n=F(`/api/notifications`,!1,5e3),[r,i]=(0,v.useState)(()=>typeof Notification>`u`?`unsupported`:Notification.permission),[a,o]=(0,v.useState)(()=>{try{return localStorage.getItem(G)===`1`}catch{return!1}}),s=(0,v.useRef)(null),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null);(0,v.useEffect)(()=>l(null),[n]);let f=c??n,p=f?.items??[],m=f?.unread??0;(0,v.useEffect)(()=>ee(m),[m]),(0,v.useEffect)(()=>{if(n){if(!s.current){s.current=new Set(p.map(e=>e.id));return}for(let e of p)if(!s.current.has(e.id)&&(s.current.add(e.id),!(e.readAt||r!==`granted`)&&(document.hidden||location.hash!==`#${e.href}`)))try{let t=new Notification(e.title,{body:e.body,tag:e.id});t.onclick=()=>{window.focus(),g(e),t.close()}}catch{}}},[n]),(0,v.useEffect)(()=>{if(!e)return;let n=e=>{e.target.closest(`.notif-wrap`)||t(!1)};return window.addEventListener(`mousedown`,n),()=>window.removeEventListener(`mousedown`,n)},[e]);async function h(e,t){try{let n=await fetch(e,{method:e.endsWith(`/notifications`)?`DELETE`:`POST`,headers:{"content-type":`application/json`},body:t===void 0?void 0:JSON.stringify(t)});if(!n.ok)return;let r=await n.json();l(`items`in r?r:{items:[],unread:0})}catch{}}function g(e){t(!1),e.readAt||h(`/api/notifications/read`,{ids:[e.id]}),k(e.href)}async function _(e){d(e.id);try{let n=await(await fetch(`/api/notifications/${encodeURIComponent(e.id)}/diagnose`,{method:`POST`})).json();n.href?(t(!1),k(n.href)):n.error&&alert(n.error)}catch{}d(null)}async function y(){typeof Notification>`u`||i(await Notification.requestPermission())}function b(){o(!0);try{localStorage.setItem(G,`1`)}catch{}}let x=r==="default"&&!a;return(0,S.jsxs)(`span`,{className:`notif-wrap`,children:[(0,S.jsxs)(`button`,{className:`info-btn notif-btn ${m?`has-unread`:``}`,title:m?`${m} item${m===1?``:`s`} need your attention`:`Notifications`,"aria-label":`Notifications`,onClick:()=>t(e=>!e),children:[(0,S.jsx)(C,{name:m?`notifications_active`:`notifications`}),m>0&&(0,S.jsx)(`span`,{className:`notif-badge`,children:m>99?`99+`:m})]}),e&&(0,S.jsxs)(`div`,{className:`info-pop notif-pop`,role:`menu`,children:[(0,S.jsxs)(`div`,{className:`notif-head`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`notifications`}),(0,S.jsx)(`span`,{className:`spacer`}),m>0&&(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>void h(`/api/notifications/read`),children:`mark all read`}),p.length>0&&(0,S.jsx)(`button`,{className:`open-raw`,onClick:()=>void h(`/api/notifications`),children:`clear`})]}),x&&(0,S.jsxs)(`div`,{className:`notif-hint`,children:[(0,S.jsx)(`span`,{children:`Get a system notification when something needs you, even with this tab in the background.`}),(0,S.jsxs)(`span`,{className:`notif-hint-actions`,children:[(0,S.jsx)(`button`,{className:`ws-btn primary`,onClick:()=>void y(),children:`enable`}),(0,S.jsx)(`button`,{className:`ws-btn`,onClick:b,children:`not now`})]})]}),r===`denied`&&(0,S.jsx)(`div`,{className:`notif-hint muted`,children:`Browser notifications are blocked for this site — allow them in the address bar to get system alerts.`}),p.length===0?(0,S.jsx)(`div`,{className:`notif-empty`,children:`nothing needs you right now`}):(0,S.jsx)(`div`,{className:`notif-list`,children:p.slice(0,50).map(e=>(0,S.jsxs)(`div`,{className:`notif-row ${e.readAt?``:`unread`} ${e.kind}`,role:`button`,tabIndex:0,onClick:()=>g(e),onKeyDown:t=>{t.key===`Enter`&&g(e)},children:[(0,S.jsx)(`span`,{className:`notif-ico`,children:(0,S.jsx)(C,{name:W[e.kind]})}),(0,S.jsxs)(`span`,{className:`notif-body`,children:[(0,S.jsx)(`span`,{className:`notif-title`,children:e.title}),e.body&&(0,S.jsx)(`span`,{className:`notif-sub`,children:e.body}),e.diagnose&&(0,S.jsx)(`span`,{className:`notif-actions`,children:(0,S.jsxs)(`button`,{className:`ws-btn notif-diagnose`,disabled:u===e.id,title:`Open a chat that finds the cause and proposes the fix`,onClick:t=>{t.stopPropagation(),_(e)},children:[(0,S.jsx)(C,{name:u===e.id?`progress_activity`:`troubleshoot`,className:`ms-sm`}),u===e.id?`starting…`:`diagnose`]})})]}),(0,S.jsx)(`span`,{className:`notif-when num`,children:ve(e.at)})]},e.id))})]})]})}function uo(){let[e,t]=(0,v.useState)(!1),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``);(0,v.useEffect)(()=>{if(!e)return;fetch(`/api/runs`).then(e=>e.json()).then(r).catch(()=>{}),fetch(`/api/workflows`).then(e=>e.json()).then(a).catch(()=>{}),fetch(`/api/meta`).then(e=>e.json()).then(e=>s(e.version)).catch(()=>{});let n=e=>{e.target.closest(`.info-wrap`)||t(!1)};return window.addEventListener(`mousedown`,n),()=>window.removeEventListener(`mousedown`,n)},[e]);let c=n?.runs[0];return(0,S.jsxs)(`span`,{className:`info-wrap`,children:[(0,S.jsx)(`button`,{className:`info-btn`,title:`Project info`,"aria-label":`Project info`,onClick:()=>t(e=>!e),children:(0,S.jsx)(C,{name:`info`})}),e&&(0,S.jsxs)(`div`,{className:`info-pop`,children:[(0,S.jsxs)(`div`,{className:`info-row`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`Workflows`}),(0,S.jsx)(`span`,{className:`info-v`,children:i?`${i.workflows.length} discovered`:`…`}),(0,S.jsx)(`code`,{className:`info-path`,title:i?.root,children:i?.root??``})]}),(0,S.jsxs)(`div`,{className:`info-row`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`Runs`}),(0,S.jsxs)(`span`,{className:`info-v`,children:[n?`${n.runs.length} total`:`…`,c?` · latest ${c.status}`:``]}),(0,S.jsx)(`code`,{className:`info-path`,title:n?.outputDir,children:n?.outputDir??``})]}),(0,S.jsxs)(`div`,{className:`info-row info-actions`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`Workspace`}),(0,S.jsxs)(`a`,{className:`update-btn`,href:`#/settings`,onClick:()=>t(!1),children:[(0,S.jsx)(C,{name:`settings`,className:`ms-sm`}),` settings`]})]}),(0,S.jsxs)(`div`,{className:`info-row info-actions`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`Theme`}),(0,S.jsx)(mo,{})]}),(0,S.jsxs)(`div`,{className:`info-row info-actions`,children:[(0,S.jsx)(`span`,{className:`microlabel`,children:`Version`}),(0,S.jsx)(`span`,{className:`info-v mono`,children:o?`kraftwerk ${o}`:`…`}),(0,S.jsx)(po,{})]})]})]})}function fo(e,t){let n=e.split(`.`).map(Number),r=t.split(`.`).map(Number);for(let e=0;e<3;e++)if((n[e]??0)!==(r[e]??0))return(n[e]??0)<(r[e]??0);return!1}function po(){let[e,t]=(0,v.useState)(`idle`),[n,r]=(0,v.useState)(null);async function i(){t(`busy`);try{let e=await fetch(`/api/update-check`,{cache:`no-store`}),n=await e.json();if(!e.ok||!n.latest)throw Error();r(n),t(`done`)}catch{t(`err`)}}return e===`done`&&n?fo(n.current,n.latest)?(0,S.jsxs)(`span`,{className:`update-result newer`,children:[`v`,n.latest,` available — `,(0,S.jsxs)(`code`,{children:[`npm i -g `,n.name,`@latest`]})]}):(0,S.jsxs)(`span`,{className:`update-result`,children:[(0,S.jsx)(C,{name:`check`,className:`ms-sm`}),` up to date`]}):(0,S.jsx)(`button`,{className:`update-btn`,disabled:e===`busy`,onClick:()=>void i(),children:e===`busy`?`checking…`:e===`err`?`npm unreachable — retry`:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(C,{name:`sync`,className:`ms-sm`}),` check for updates`]})})}function mo(){return(0,S.jsx)(`button`,{className:`theme-btn`,onClick:()=>{let e=document.documentElement,t=e.dataset.theme===`light`?`dark`:`light`;e.dataset.theme=t;try{localStorage.setItem(`kw-theme`,t)}catch{}},children:`day / night`})}(0,y.createRoot)(document.getElementById(`root`)).render((0,S.jsx)(v.StrictMode,{children:(0,S.jsx)(Qa,{})}));export{x as a,o as c,ne as i,s as l,C as n,h as o,k as r,d as s,Xa as t,l as u};
@@ -0,0 +1 @@
1
+ @font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/roboto-latin-400-normal-BqEyEoaF.woff2)format("woff2"),url(/assets/roboto-latin-400-normal-D27F5sTu.woff)format("woff")}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/roboto-latin-500-normal-7RbcRiD8.woff2)format("woff2"),url(/assets/roboto-latin-500-normal-fsTFPL3E.woff)format("woff")}@font-face{font-family:Roboto;font-style:normal;font-display:swap;font-weight:700;src:url(/assets/roboto-latin-700-normal-BZpUvMxY.woff2)format("woff2"),url(/assets/roboto-latin-700-normal-YuyVweIx.woff)format("woff")}@font-face{font-family:Roboto Mono;font-style:normal;font-display:swap;font-weight:400;src:url(/assets/roboto-mono-latin-400-normal-GekRknry.woff2)format("woff2"),url(/assets/roboto-mono-latin-400-normal-DBZPkcnn.woff)format("woff")}@font-face{font-family:Roboto Mono;font-style:normal;font-display:swap;font-weight:500;src:url(/assets/roboto-mono-latin-500-normal-pxIOXZmA.woff2)format("woff2"),url(/assets/roboto-mono-latin-500-normal-D6j6AMzd.woff)format("woff")}@font-face{font-family:Roboto Mono;font-style:normal;font-display:swap;font-weight:700;src:url(/assets/roboto-mono-latin-700-normal-foxDnrFi.woff2)format("woff2"),url(/assets/roboto-mono-latin-700-normal-CHYrj1DZ.woff)format("woff")}@font-face{font-family:Material Symbols Rounded;font-style:normal;font-weight:400;font-display:block;src:url(/assets/material-symbols-rounded-DzDTtRam.woff2)format("woff2")}.material-symbols-rounded{letter-spacing:normal;text-transform:none;white-space:nowrap;word-wrap:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-rendering:optimizelegibility;font-feature-settings:"liga";direction:ltr;font-family:Material Symbols Rounded;font-size:24px;font-style:normal;font-weight:400;line-height:1;display:inline-block}:root{--font-sans:"Roboto";--font-mono:"Roboto Mono";--topbar-h:53px;--primary:#f4efea;--on-primary:#191919;--primary-container:#3a3733;--on-primary-container:#f4efea;--secondary:#cfc9c0;--on-secondary:#24231f;--secondary-container:#3a3733;--on-secondary-container:#e8e2d9;--tertiary:#b8c2a2;--tertiary-container:#38402b;--on-tertiary-container:#d8e0c4;--error:#ffb4ab;--on-error:#690005;--error-container:#93000a;--on-error-container:#ffdad6;--success:#8fd48c;--success-container:#12411a;--on-success-container:#aaf2a4;--surface:#191919;--on-surface:#f4efea;--on-surface-variant:#b5b0a8;--surface-container-lowest:#121211;--surface-container-low:#201f1e;--surface-container:#262523;--surface-container-high:#2f2d2a;--surface-container-highest:#3a3733;--outline:#8f8a82;--outline-variant:#44423e;--inverse-surface:#f4efea;--inverse-on-surface:#2f2d2a;--elev-1:0 1px 2px #0000004d, 0 1px 3px 1px #00000026;--elev-2:0 1px 2px #0000004d, 0 2px 6px 2px #00000026;--elev-3:0 1px 3px #0000004d, 0 4px 8px 3px #00000026;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}:root[data-theme=light]{--primary:#191919;--on-primary:#fff;--primary-container:#e7e0d7;--on-primary-container:#191919;--secondary:#5e5b56;--on-secondary:#fff;--secondary-container:#e7e0d7;--on-secondary-container:#2a2926;--tertiary:#66705a;--tertiary-container:#dde2cf;--on-tertiary-container:#232818;--error:#ba1a1a;--on-error:#fff;--error-container:#ffdad6;--on-error-container:#410002;--success:#2e6b30;--success-container:#d3ecd0;--on-success-container:#0b2e10;--surface:#f4efea;--on-surface:#191919;--on-surface-variant:#5e5b56;--surface-container-lowest:#fff;--surface-container-low:#faf7f3;--surface-container:#ece6df;--surface-container-high:#e6dfd6;--surface-container-highest:#ded6cb;--outline:#8a857c;--outline-variant:#d8d1c7;--inverse-surface:#2b2a27;--inverse-on-surface:#f6f2ec;--elev-1:0 1px 2px #201b132e, 0 1px 3px 1px #201b1314;--elev-2:0 1px 2px #201b132e, 0 2px 6px 2px #201b1314;--elev-3:0 1px 3px #201b132e, 0 4px 8px 3px #201b1314;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}*{box-sizing:border-box;margin:0;padding:0}html{height:100%}body{background:var(--surface);min-height:100%;color:var(--on-surface);font-family:var(--font-sans), system-ui, sans-serif;letter-spacing:.01em;-webkit-font-smoothing:antialiased;font-size:14px;line-height:1.5}a{color:inherit;text-decoration:none}button{font:inherit;color:inherit;cursor:pointer;background:0 0;border:0}code,pre,.mono{font-family:var(--font-mono), monospace}.ms{font-variation-settings:"FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;vertical-align:-4px;-webkit-user-select:none;user-select:none;flex:none;font-size:18px;line-height:1}.ms.ms-fill{font-variation-settings:"FILL" 1, "wght" 400, "GRAD" 0, "opsz" 20}.ms.ms-sm{vertical-align:-3px;font-size:15px}.ms.ms-lg{vertical-align:-5px;font-size:22px}.topbar{z-index:10;height:var(--topbar-h);background:color-mix(in srgb, var(--surface-container) 92%, transparent);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border-bottom:1px solid var(--outline-variant);align-items:center;gap:14px;padding:0 20px;display:flex;position:sticky;top:0}.wordmark{align-items:center;gap:10px;display:flex}.topbar{background:color-mix(in srgb, var(--ws-c,transparent) 7%, color-mix(in srgb, var(--surface-container) 92%, transparent));box-shadow:inset 0 -2px 0 color-mix(in srgb, var(--ws-c,transparent) 70%, transparent)}.home-link{border-radius:50%;place-items:center;width:32px;height:32px;font-size:15px;line-height:1;transition:box-shadow .12s;display:grid}.home-link:hover{box-shadow:0 0 0 4px color-mix(in srgb, var(--ws-c,var(--on-surface)) 16%, transparent)}.home-tile.ws-tile{width:32px;height:32px;font-size:18px}.home-tile.ws-tile-mono{font-size:13px}.wordmark small{color:var(--on-surface-variant);font-size:12px}.wordmark .env-name{letter-spacing:-.01em;color:var(--on-surface);white-space:nowrap;text-overflow:ellipsis;border-radius:10px;max-width:300px;padding:4px 8px;font-size:16px;font-weight:600;overflow:hidden}.switcher-wrap{display:inline-flex;position:relative}.env-switch{align-items:center;gap:5px;transition:background .12s,color .12s;display:inline-flex}.env-switch:hover{background:color-mix(in srgb, var(--on-surface) 8%, transparent)}.env-switch svg{opacity:.55;flex:none}.switcher-pop{z-index:20;background:var(--surface-container);min-width:360px;max-width:min(480px,92vw);box-shadow:var(--elev-2);overscroll-behavior:contain;border-radius:4px;max-height:calc(100dvh - 120px);padding:8px 0;position:absolute;top:calc(100% + 8px);left:0;overflow-y:auto}.switcher-head,.switcher-group-head{box-sizing:border-box;letter-spacing:.1px;min-height:36px;color:var(--on-surface-variant);text-transform:none;align-items:center;padding:8px 16px;font-size:14px;font-weight:500;line-height:20px;display:flex}.switcher-group{border-top:1px solid var(--outline-variant);margin-top:8px;padding-top:4px}.switcher-item{box-sizing:border-box;min-height:72px;color:var(--on-surface);align-items:center;gap:16px;padding:12px 16px;transition:background .12s;display:flex;position:relative}a.switcher-item:after,.switcher-item.stopped:after{content:"";pointer-events:none;background:var(--on-surface);opacity:0;transition:opacity .12s;position:absolute;inset:0}a.switcher-item:hover:after{opacity:.08}a.switcher-item:active:after{opacity:.12}.switcher-item.current{cursor:default;background:var(--secondary-container);color:var(--on-secondary-container)}.switcher-item.current .switcher-sub,.switcher-item.current .switcher-root{color:var(--on-secondary-container);opacity:.8}.ws-tile{background:color-mix(in srgb, var(--ws-c,var(--on-surface)) 22%, var(--surface-container-highest));border-radius:50%;flex:none;place-items:center;width:40px;height:40px;font-size:22px;line-height:1;display:grid;position:relative}.ws-tile-mono{font-family:var(--font-sans), sans-serif;letter-spacing:.15px;color:var(--ws-c,var(--on-surface));font-size:16px;font-weight:500;line-height:24px}.ws-tile-badge{min-width:18px;height:18px;font-family:var(--font-sans), sans-serif;letter-spacing:.4px;background:var(--ws-c,var(--on-surface));color:#fff;box-shadow:0 0 0 2px var(--surface-container);border-radius:9px;place-items:center;padding:0 4px;font-size:10px;font-weight:500;line-height:1;display:grid;position:absolute;bottom:-3px;right:-3px}.switcher-item.current .ws-tile-badge{box-shadow:0 0 0 2px var(--secondary-container)}.switcher-text{flex-direction:column;flex:1;min-width:0;display:flex}.switcher-name{letter-spacing:.5px;white-space:nowrap;text-overflow:ellipsis;font-size:16px;font-weight:400;line-height:24px;overflow:hidden}.switcher-name.unnamed,.ws-name.unnamed{color:var(--on-surface-variant);font-style:italic}.switcher-sub,.switcher-root{letter-spacing:.25px;color:var(--on-surface-variant);white-space:nowrap;text-overflow:ellipsis;font-size:14px;line-height:20px;overflow:hidden}.switcher-root{text-align:left;direction:rtl}.switcher-root>span{unicode-bidi:isolate}.switcher-side{flex:none;align-items:center;gap:12px;margin-left:auto;display:inline-flex}.switcher-port{letter-spacing:.5px;color:var(--on-surface-variant);white-space:nowrap;align-items:center;font-size:11px;font-weight:500;line-height:16px;display:inline-flex}.switcher-check{color:var(--on-secondary-container);font-size:24px}.live-dot{background:var(--success);border-radius:50%;width:8px;height:8px;margin-right:6px;display:inline-block}.switcher-item.stopped{cursor:default}.switcher-item.stopped:after{display:none}.switcher-item.stopped .ws-tile{opacity:.6;filter:grayscale(.5)}.switcher-item.stopped .switcher-name{color:var(--on-surface-variant)}.switcher-item.missing .switcher-name{text-decoration:line-through}.switcher-err{color:var(--error)}.switcher-start{z-index:1;height:40px;font-family:var(--font-sans), sans-serif;letter-spacing:.1px;color:var(--primary);cursor:pointer;background:0 0;border:0;border-radius:20px;flex:none;align-items:center;gap:4px;padding:0 16px 0 12px;font-size:14px;font-weight:500;line-height:20px;transition:background .12s;display:inline-flex;position:relative}.switcher-start:hover:not(:disabled){background:color-mix(in srgb, var(--primary) 8%, transparent)}.switcher-start:active:not(:disabled){background:color-mix(in srgb, var(--primary) 12%, transparent)}.switcher-start:disabled{opacity:.38;cursor:default}.switcher-start .ms{font-size:18px}.switcher-icon{background:var(--secondary-container);border-radius:11px;flex:none;place-items:center;width:36px;height:36px;font-size:18px;line-height:1;display:grid}.ms.ms-spin{animation:1s linear infinite kw-spin}@keyframes kw-spin{to{transform:rotate(360deg)}}.switcher-foot{box-sizing:border-box;border-top:1px solid var(--outline-variant);letter-spacing:.5px;min-height:56px;color:var(--on-surface);align-items:center;gap:16px;margin-top:8px;padding:0 16px;font-size:16px;line-height:24px;transition:background .12s;display:flex}.switcher-foot:hover{background:color-mix(in srgb, var(--on-surface) 8%, transparent)}.switcher-foot .ms{color:var(--on-surface-variant);font-size:24px}.ws-screen{max-width:960px}.ws-empty{color:var(--on-surface-variant);padding:18px;font-size:13px}.ws-row{grid-template-columns:40px minmax(0,1fr) auto;align-items:start;gap:14px;padding:14px 18px;display:grid}.ws-row+.ws-row{border-top:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent)}.ws-row.state-died{background:color-mix(in srgb, var(--warning,#c98a1b) 6%, transparent)}.ws-row.state-missing .ws-icon{opacity:.45;filter:grayscale(.8)}.ws-row.state-stopped .ws-icon{opacity:.65;filter:grayscale(.5)}.ws-row.state-died .ws-icon{opacity:.8}.ws-icon{width:40px;height:40px}.ws-main{flex-direction:column;gap:3px;min-width:0;display:flex}.ws-title{flex-wrap:wrap;align-items:center;gap:10px;display:flex}.ws-name{color:var(--on-surface);font-size:15px;font-weight:600}a.ws-name:hover{text-decoration:underline}.ws-state{letter-spacing:.4px;text-transform:uppercase;color:var(--on-surface-variant);align-items:center;font-size:11px;font-weight:600;display:inline-flex}.ws-state-running{color:var(--success)}.ws-state-died{color:var(--warning,#c98a1b)}.ws-state-missing,.ws-state-orphaned{color:var(--error)}.ws-row.state-orphaned .ws-icon{opacity:.45;filter:grayscale(.8)}.ws-note{color:var(--on-surface-variant);font-size:12px}.ws-load-error{color:var(--error);align-items:center;gap:8px;display:flex}.ws-root{font-family:var(--mono,ui-monospace, SFMono-Regular, Menlo, monospace);color:var(--on-surface-variant);overflow-wrap:anywhere;font-size:12px}.ws-dim{opacity:.7;font-family:var(--font-sans), sans-serif}.ws-meta{color:var(--on-surface-variant);flex-wrap:wrap;gap:4px 14px;font-size:12px;display:flex}.ws-actions{flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;display:flex}.ws-btn{font:500 12.5px/1 var(--font-sans), sans-serif;white-space:nowrap;border:1px solid var(--outline-variant);color:var(--on-surface);cursor:pointer;background:0 0;border-radius:999px;align-items:center;gap:4px;padding:7px 14px 7px 10px;transition:background .12s,border-color .12s;display:inline-flex}.ws-btn:hover:not(:disabled){background:color-mix(in srgb, var(--on-surface) 8%, transparent)}.ws-btn:disabled{opacity:.45;cursor:default}.ws-btn.primary{color:var(--on-primary);background:var(--primary);border-color:var(--primary)}.ws-btn.primary:hover:not(:disabled){filter:brightness(1.06);background:var(--primary)}.ws-btn.danger{color:var(--error)}.ws-btn.danger:hover:not(:disabled){background:color-mix(in srgb, var(--error) 10%, transparent);border-color:var(--error)}.ws-btn .ms{vertical-align:0}.settings-screen{flex-direction:column;gap:16px;max-width:860px;margin:0 auto;display:flex}.settings-head{align-items:center;gap:12px;display:flex}.settings-head h1{letter-spacing:-.01em;align-items:center;gap:10px;margin:0;font-size:22px;font-weight:600;display:inline-flex}.settings-head .spacer{flex:1}.settings-saved{color:var(--success);align-items:center;gap:4px;font-size:12.5px;display:inline-flex}.settings-saved .ms{vertical-align:0}.settings-err{color:var(--error);font-size:12.5px}.settings-check{cursor:pointer;align-items:center;gap:8px;font-size:13px;display:flex}.settings-check input{accent-color:var(--primary);width:15px;height:15px}.settings-note{color:var(--on-surface-variant);font-size:12px}.settings-note code{font-size:11px}.settings-row-x{opacity:1;align-self:flex-end;margin-bottom:6px}.settings-file{color:var(--on-surface-variant);text-overflow:ellipsis;white-space:nowrap;max-width:60%;font-size:11px;overflow:hidden}.settings-kv-list{flex-direction:column;padding:6px 0 10px;display:flex}.settings-kv{grid-template-columns:110px 1fr;align-items:baseline;gap:1px 14px;padding:8px 18px;display:grid}.settings-kv+.settings-kv{border-top:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent)}.settings-kv code{overflow-wrap:break-word;word-break:break-all;font-size:12px}.settings-kv-hint{color:var(--on-surface-variant);grid-column:2;font-size:11px}.switcher-hint{letter-spacing:.4px;text-transform:uppercase;color:var(--on-surface-variant);border:1px solid var(--outline-variant);border-radius:999px;flex:none;margin-left:auto;padding:2px 8px;font-size:10.5px;font-weight:600}.topbar .spacer{flex:1}.topbar nav{gap:4px;display:flex;position:absolute;left:50%;transform:translate(-50%)}@media (width<=1100px){.topbar nav{margin-left:12px;position:static;transform:none}}.topbar nav a{letter-spacing:.01em;text-transform:capitalize;color:var(--on-surface-variant);border-radius:999px;align-items:center;gap:6px;padding:6px 14px;font-size:13px;font-weight:500;transition:background .12s,color .12s;display:inline-flex}.topbar nav a .ms{font-size:17px}.topbar nav a:hover{color:var(--on-surface);background:color-mix(in srgb, var(--on-surface) 8%, transparent)}.topbar nav .nav-apart{margin-left:28px;position:relative}.topbar nav .nav-apart:before{content:"";background:var(--outline-variant);width:1px;height:18px;position:absolute;top:50%;left:-16px;transform:translateY(-50%)}.info-wrap{display:inline-flex;position:relative}.info-btn{width:32px;height:32px;color:var(--on-surface-variant);border-radius:50%;place-items:center;transition:background .12s,color .12s;display:grid}.info-btn:hover{background:color-mix(in srgb, var(--on-surface) 8%, transparent);color:var(--on-surface)}.info-pop{z-index:20;background:var(--surface-container-high);min-width:340px;max-width:min(480px,90vw);box-shadow:var(--elev-2);border-radius:12px;padding:8px 0;position:absolute;top:calc(100% + 8px);right:0}.info-row{flex-direction:column;gap:2px;padding:8px 16px;display:flex}.notif-wrap{display:inline-flex;position:relative}.notif-btn{position:relative}.notif-btn.has-unread{color:var(--on-surface)}.notif-badge{box-sizing:border-box;background:var(--error);min-width:16px;height:16px;color:var(--on-error,#fff);font-family:var(--font-mono), monospace;text-align:center;pointer-events:none;border-radius:8px;padding:0 4px;font-size:10px;font-weight:600;line-height:16px;position:absolute;top:2px;right:0}.notif-pop{min-width:380px;max-width:min(520px,92vw);padding:0;overflow:hidden}.notif-head{align-items:center;gap:12px;padding:10px 16px 6px;display:flex}.notif-hint{background:var(--secondary-container);color:var(--on-secondary-container);border-radius:10px;flex-direction:column;gap:10px;margin:4px 12px 8px;padding:12px 14px;font-size:13px;line-height:18px;display:flex}.notif-hint.muted{color:var(--on-surface-variant);background:0 0;margin:0;padding:4px 16px 8px}.notif-hint-actions{gap:8px;display:flex}.notif-empty{color:var(--on-surface-variant);padding:18px 16px 20px;font-size:13px}.notif-list{overscroll-behavior:contain;flex-direction:column;max-height:min(60dvh,520px);display:flex;overflow-y:auto}.notif-row{text-align:left;color:inherit;border:0;border-top:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent);cursor:pointer;font:inherit;background:0 0;align-items:flex-start;gap:12px;padding:10px 16px;display:flex}.notif-row:hover{background:color-mix(in srgb, var(--on-surface) 6%, transparent)}.notif-row.unread{background:color-mix(in srgb, var(--primary) 7%, transparent)}.notif-row.unread:hover{background:color-mix(in srgb, var(--primary) 12%, transparent)}.notif-ico{background:var(--surface-container-highest);width:28px;height:28px;color:var(--on-surface-variant);border-radius:50%;flex:none;place-items:center;margin-top:1px;display:grid}.notif-ico .ms{font-size:17px}.notif-row.approval .notif-ico{background:var(--error-container);color:var(--on-error-container)}.notif-row.routine_failed .notif-ico,.notif-row.run_failed .notif-ico{color:var(--error)}.notif-row.routine_done .notif-ico,.notif-row.run_done .notif-ico{color:var(--success)}.notif-body{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.notif-title{font-size:13.5px;font-weight:500;line-height:18px}.notif-row.unread .notif-title{font-weight:600}.notif-sub{color:var(--on-surface-variant);-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:12.5px;line-height:17px;display:-webkit-box;overflow:hidden}.notif-when{color:var(--on-surface-variant);flex:none;margin-top:2px;font-size:11px}.notif-actions{gap:8px;margin-top:6px;display:flex}.notif-diagnose{align-items:center;gap:6px;padding:3px 10px;font-size:12px;display:inline-flex}.info-row+.info-row{border-top:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent)}.info-v{color:var(--on-surface);font-size:13px}.info-path{color:var(--on-surface-variant);overflow-wrap:break-word;word-break:break-all;font-size:11px}.info-actions{flex-flow:wrap;justify-content:space-between;align-items:center}.info-actions .theme-btn{flex:none}.theme-btn,.update-btn{border:1px solid var(--outline);color:var(--on-surface-variant);border-radius:999px;padding:6px 14px;font-size:12.5px;font-weight:500;transition:background .12s,color .12s}.theme-btn:hover,.update-btn:hover:not(:disabled){background:color-mix(in srgb, var(--primary) 10%, transparent);color:var(--on-surface)}.update-btn{flex:none;align-items:center;gap:6px;text-decoration:none;display:inline-flex}.update-btn:disabled{opacity:.6;cursor:default}.update-btn .ms{vertical-align:0}.update-result{color:var(--on-surface-variant);align-items:center;gap:5px;font-size:12px;display:inline-flex}.update-result .ms{vertical-align:0;color:var(--success)}.update-result.newer{color:var(--primary);flex-basis:100%;font-weight:500}.update-result.newer code{font-size:11px}.relaunch-note{font:inherit;cursor:pointer;color:var(--primary);border:1px solid var(--primary);background:color-mix(in srgb, var(--primary) 10%, transparent);border-radius:999px;margin-right:10px;padding:4px 12px;font-size:12px}.relaunch-note:hover{background:color-mix(in srgb, var(--primary) 18%, transparent)}.relaunch-note:disabled{opacity:.7;cursor:default}.expert-toggle{font-family:var(--font-mono), monospace;letter-spacing:.5px;color:var(--on-surface-variant);border-radius:999px;align-items:center;gap:7px;margin-right:2px;padding:4px 8px;font-size:11px;transition:color .12s;display:inline-flex}.expert-toggle:hover{color:var(--on-surface)}.expert-track{background:color-mix(in srgb, var(--on-surface) 14%, transparent);border-radius:999px;width:26px;height:15px;transition:background .14s;position:relative}.expert-knob{background:var(--surface);border-radius:50%;width:11px;height:11px;transition:left .14s,background .14s;position:absolute;top:2px;left:2px}.expert-toggle.on{color:var(--on-surface)}.expert-toggle.on .expert-track{background:var(--primary)}.expert-toggle.on .expert-knob{background:var(--on-primary,var(--surface));left:13px}html[data-expert=off] .topbar nav .nav-expert,html[data-expert=off] .chat-thread .detail-head .chip.agent,html[data-expert=off] .chat-thread .detail-head .rid{display:none}.shell{max-width:1240px;margin:0 auto;padding:26px 20px 80px}.microlabel{letter-spacing:.045em;text-transform:capitalize;color:var(--on-surface-variant);font-size:11px;font-weight:500}.num{font-variant-numeric:tabular-nums}.lamp{border-radius:50%;flex:none;width:9px;height:9px;position:relative}.lamp.ok{background:var(--success)}.lamp.failed,.lamp.blocked{background:var(--error)}.lamp.aborted{background:var(--outline-variant)}.lamp.pending{border:1.5px solid var(--outline);background:0 0}.lamp.running{background:var(--primary);animation:1.4s ease-in-out infinite lamp-pulse}@keyframes lamp-pulse{0%,to{box-shadow:0 0 0 0 color-mix(in srgb, var(--primary) 45%, transparent);opacity:1}50%{box-shadow:0 0 0 5px color-mix(in srgb, var(--primary) 18%, transparent);opacity:.8}}.status-word{letter-spacing:.03em;text-transform:capitalize;font-size:12px;font-weight:500}.status-word.ok{color:var(--success)}.status-word.failed,.status-word.blocked{color:var(--error)}.status-word.running{color:var(--primary)}.status-word.aborted,.status-word.pending{color:var(--on-surface-variant)}.page-head{align-items:baseline;gap:14px;margin:6px 2px 20px;display:flex}.page-head .spacer{flex:1}.page-head h1{letter-spacing:0;font-size:24px;font-weight:400}.page-head .count{color:var(--on-surface-variant);font-size:13px}.run-list{gap:10px;display:grid}.run-card{background:var(--surface-container-low);box-shadow:var(--elev-1);border:0;border-radius:12px;grid-template-columns:12px 200px 1fr auto;align-items:center;gap:8px 16px;padding:14px 20px;transition:box-shadow .15s,background .15s;display:grid}.run-card:hover{background:color-mix(in srgb, var(--on-surface) 5%, var(--surface-container-low));box-shadow:var(--elev-2)}.run-card .rid{font-family:var(--font-mono), monospace;color:var(--on-surface-variant);font-size:12.5px}.run-card .wf{font-size:14px;font-weight:500}.run-card .req{color:var(--on-surface-variant);text-overflow:ellipsis;white-space:nowrap;max-width:52ch;font-size:12.5px;overflow:hidden}.run-card .meta{font-family:var(--font-mono), monospace;color:var(--on-surface-variant);align-items:center;gap:18px;font-size:12px;display:flex}.progress-track{background:var(--surface-container-highest);border-radius:999px;width:90px;height:4px;overflow:hidden}.progress-track i{background:var(--primary);border-radius:999px;height:100%;display:block}.run-card.is-ok .progress-track i{background:var(--success)}.run-card.is-failed .progress-track i{background:var(--error)}.empty{border:1px dashed var(--outline-variant);text-align:center;color:var(--on-surface-variant);border-radius:16px;padding:40px}.crumbs{color:var(--on-surface-variant);align-items:center;gap:8px;margin-bottom:14px;font-size:12.5px;display:flex}.crumbs a:hover{color:var(--primary)}.crumbs .sep{color:var(--outline-variant)}.detail-head{flex-wrap:wrap;align-items:center;gap:10px 16px;margin-bottom:6px;display:flex}.detail-head h1{font-size:22px;font-weight:400}.detail-head .rid{font-family:var(--font-mono), monospace;color:var(--on-surface-variant);font-size:12px}.detail-req{color:var(--on-surface-variant);max-width:90ch;margin-bottom:18px;font-size:13px}.statgrid{flex-wrap:wrap;gap:26px;margin-bottom:22px;display:flex}.stat .microlabel{margin-bottom:1px}.stat .v{font-family:var(--font-mono), monospace;font-size:15px;font-weight:500}.columns{grid-template-columns:minmax(430px,5fr) minmax(360px,4fr);align-items:start;gap:18px;display:grid}@media (width<=1020px){.columns{grid-template-columns:1fr}}.panel{background:var(--surface-container-low);box-shadow:var(--elev-1);border:0;border-radius:16px;overflow:hidden}.panel-head{border-bottom:1px solid var(--outline-variant);background:var(--surface-container);align-items:center;gap:10px;padding:12px 18px;display:flex}.panel-head .microlabel{color:var(--on-surface-variant);font-size:12px}.panel-head .spacer{flex:1}.phases{padding:6px 0}.phase-row{padding:10px 18px 10px 42px;position:relative}.phase-row+.phase-row{border-top:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent)}.phase-row .lamp{position:absolute;top:16px;left:19px}.phase-row:before{content:"";background:var(--outline-variant);width:1px;position:absolute;top:0;bottom:0;left:23px}.phase-row:first-child:before{top:16px}.phase-row:last-child:before{height:16px;bottom:auto}.phase-row .lamp{z-index:1}.phase-top{flex-wrap:wrap;align-items:baseline;gap:10px;display:flex}.phase-name{font-size:14px;font-weight:500}.chip{font-family:var(--font-mono), monospace;border:1px solid var(--outline-variant);color:var(--on-surface-variant);border-radius:8px;padding:2px 10px;font-size:11px}.chip.agent{background:var(--secondary-container);color:var(--on-secondary-container);border-color:#0000}.phase-top .right{font-family:var(--font-mono), monospace;color:var(--on-surface-variant);gap:14px;margin-left:auto;font-size:11.5px;display:flex}.phase-sub{color:var(--on-surface-variant);max-width:72ch;margin-top:3px;font-size:12.5px}.phase-activity{font-family:var(--font-mono), monospace;color:var(--primary);margin-top:3px;font-size:11.5px}.phase-activity:before{content:"▸ "}.gate-line{flex-wrap:wrap;gap:6px;margin-top:5px;display:flex}.gate{font-family:var(--font-mono), monospace;background:var(--success-container);color:var(--on-success-container);border-radius:8px;align-items:center;gap:5px;padding:2px 10px;font-size:11px;display:inline-flex}.gate.failed{background:var(--error-container);color:var(--on-error-container)}.gate-fail-msg{color:var(--error);margin-top:4px;font-size:12px}.file-list{max-height:300px;overflow:auto}.file-row{text-align:left;width:100%;font-family:var(--font-mono), monospace;border-bottom:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent);color:var(--on-surface-variant);align-items:center;gap:10px;padding:8px 18px;font-size:12.5px;transition:background .1s;display:flex}.file-row:last-child{border-bottom:0}.file-row:hover{background:color-mix(in srgb, var(--on-surface) 6%, transparent);color:var(--on-surface)}.file-row.active{background:var(--secondary-container);color:var(--on-secondary-container)}.file-row .fname{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.file-row .fsize{color:var(--outline);font-size:11px}.viewer{border-top:1px solid var(--outline-variant)}.viewer-body pre{white-space:pre-wrap;word-break:break-word;max-height:560px;color:var(--on-surface-variant);padding:14px 18px;font-size:12px;line-height:1.55;overflow:auto}.viewer-body iframe{background:#fff;border:0;width:100%;height:620px;display:block}.viewer-body img{max-width:100%;padding:14px 18px;display:block}.viewer-note{color:var(--on-surface-variant);border-bottom:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent);padding:6px 18px;font-size:11px}.open-raw{color:var(--primary);border:1px solid var(--outline);border-radius:999px;padding:3px 12px;font-size:12px;font-weight:500;transition:background .12s}.open-raw:hover{background:color-mix(in srgb, var(--primary) 10%, transparent)}.live-note{color:var(--on-surface-variant);align-items:center;gap:7px;font-size:11px;display:inline-flex}.wf-search{background:var(--surface-container-high);border:1px solid #0000;border-radius:999px;align-items:center;gap:8px;min-width:260px;padding:7px 14px;transition:border-color .12s,background .12s;display:inline-flex}.wf-search:focus-within{border-color:var(--primary);background:var(--surface-container-highest)}.wf-search .ms{color:var(--on-surface-variant);font-size:18px}.wf-search input{min-width:0;font:13px/1.4 var(--font-sans), sans-serif;color:var(--on-surface);background:0 0;border:0;outline:none;flex:1}.wf-search input::-webkit-search-cancel-button{cursor:pointer}.wf-error{margin:-8px 2px 14px}.wf-list{background:var(--surface-container-low);box-shadow:var(--elev-1);border-radius:16px;overflow:hidden}.wf-row{border-bottom:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent);grid-template-columns:9px minmax(0,1fr) auto auto;align-items:center;gap:18px;padding:14px 22px;transition:background .12s;display:grid}.wf-row:last-child{border-bottom:0}.wf-row:hover{background:color-mix(in srgb, var(--on-surface) 4%, transparent)}.wf-row-main{min-width:0}.wf-row-top{flex-wrap:wrap;align-items:baseline;gap:10px;display:flex}.wf-name{font-size:15px;font-weight:500}.wf-row .wf-name:hover{color:var(--primary)}.wf-desc{color:var(--on-surface-variant);font-size:13px}.wf-row .wf-desc{text-overflow:ellipsis;white-space:nowrap;margin:2px 0 0;overflow:hidden}.wf-desc.wrap{white-space:pre-wrap}.wf-meta{font-family:var(--font-mono), monospace;color:var(--on-surface-variant);gap:8px;font-size:11.5px;display:flex}.wf-runs{white-space:nowrap;font-family:var(--font-mono), monospace;color:var(--on-surface-variant);border-radius:999px;align-items:center;gap:6px;padding:6px 12px;font-size:11.5px;transition:background .12s,color .12s;display:inline-flex}.wf-runs:hover{background:color-mix(in srgb, var(--on-surface) 8%, transparent);color:var(--on-surface)}.wf-runs.none{color:var(--outline)}.wf-runs .wf-last{gap:5px;display:inline-flex}.wf-runs .status-word{text-transform:none;font-size:11.5px}.wf-run{align-items:center;gap:4px;padding:8px 16px;font-size:12.5px;display:inline-flex}.wf-nomatch{border-bottom:0;padding:14px 22px}.m3-dialog{background:var(--surface-container-high);width:min(560px,100%);max-height:calc(100dvh - 48px);box-shadow:var(--elev-2);border-radius:28px;flex-direction:column;gap:16px;padding:24px;display:flex;overflow-y:auto}.m3-headline{font:400 24px/32px var(--font-sans), sans-serif;letter-spacing:0;margin:0}.m3-supporting{font:14px/20px var(--font-sans), sans-serif;letter-spacing:.25px;color:var(--on-surface-variant);margin:0}.m3-facts{margin-top:6px;font-size:12px;display:block}.m3-facts a{color:var(--primary);text-underline-offset:3px;text-decoration:underline}.m3-field{display:block;position:relative}.m3-field input{box-sizing:border-box;width:100%;height:56px;font:16px/24px var(--font-mono), monospace;color:var(--on-surface);background:var(--surface-container-highest);border:0;border-bottom:1px solid var(--on-surface-variant);border-radius:4px 4px 0 0;outline:none;padding:24px 16px 8px;transition:border-color .12s,box-shadow .12s}.m3-field input:focus{border-bottom-color:var(--primary);box-shadow:inset 0 -1px 0 var(--primary)}.m3-field-label{pointer-events:none;font:16px/24px var(--font-sans), sans-serif;color:var(--on-surface-variant);transition:top .12s,font-size .12s,color .12s;position:absolute;top:16px;left:16px}.m3-field input:focus~.m3-field-label,.m3-field input:not(:placeholder-shown)~.m3-field-label{font-size:12px;line-height:16px;top:8px}.m3-field input:focus~.m3-field-label{color:var(--primary)}.m3-field-support{font:12px/16px var(--font-sans), sans-serif;color:var(--on-surface-variant);padding:4px 16px 0;display:block}.m3-switches{flex-direction:column;margin:0 -8px;display:flex}.m3-switch-row{text-align:left;cursor:pointer;background:0 0;border-radius:12px;align-items:center;gap:16px;width:100%;padding:10px 8px;transition:background .12s;display:flex}.m3-switch-row:hover{background:color-mix(in srgb, var(--on-surface) 6%, transparent)}.m3-switch-text{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.m3-switch-label{font:14px/20px var(--font-sans), sans-serif;letter-spacing:.1px;color:var(--on-surface)}.m3-switch-hint{font:12px/16px var(--font-sans), sans-serif;color:var(--on-surface-variant)}.m3-switch{background:var(--surface-container-highest);border:2px solid var(--outline);box-sizing:border-box;border-radius:999px;flex:none;width:52px;height:32px;transition:background .14s,border-color .14s;position:relative}.m3-switch-knob{background:var(--outline);border-radius:50%;width:16px;height:16px;transition:left .14s,width .14s,height .14s,background .14s;position:absolute;top:50%;left:6px;transform:translateY(-50%)}.m3-switch.on{background:var(--primary);border-color:var(--primary)}.m3-switch.on .m3-switch-knob{background:var(--on-primary);width:24px;height:24px;left:22px}.m3-error{font:14px/20px var(--font-sans), sans-serif;color:var(--error)}.m3-actions{justify-content:flex-end;gap:8px;margin-top:8px;display:flex}.m3-text-btn,.m3-filled-btn{font:500 14px/20px var(--font-sans), sans-serif;letter-spacing:.1px;border-radius:999px;height:40px;padding:0 24px;transition:background .12s,box-shadow .12s}.m3-text-btn{color:var(--primary);background:0 0;padding:0 12px}.m3-text-btn:hover{background:color-mix(in srgb, var(--primary) 8%, transparent)}.m3-filled-btn{color:var(--on-primary);background:var(--primary)}.m3-filled-btn:hover{box-shadow:var(--elev-1)}.m3-filled-btn:disabled{opacity:.38;cursor:not-allowed;box-shadow:none}.run-norequest{color:var(--on-surface-variant);flex:1;align-self:center;font-size:13px}@media (width<=900px){.page-head .wf-search{width:100%;min-width:0}.wf-row{grid-template-columns:9px minmax(0,1fr);gap:10px 14px}.wf-runs,.wf-run{grid-column:2;justify-self:start}}.wf-workspace{color:var(--on-surface-variant);white-space:pre-wrap;font-size:11.5px}.aid-0{--aid:var(--primary)}.aid-1{--aid:#4fb8a8}.aid-2{--aid:#a78bfa}.aid-3{--aid:#e5793b}.agent-grid{grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:0;display:grid}.agent-card{border-right:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent);border-bottom:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent);padding:14px 18px}.agent-head{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.agent-head b{font-size:14px;font-weight:500}.agent-head .spacer{flex:1}.agent-id{color:var(--on-surface-variant);font-size:11px}.agent-dot{background:var(--aid);border-radius:50%;width:10px;height:10px}.agent-tools{flex-wrap:wrap;gap:5px;margin-top:8px;display:flex}.tool-chip{font-family:var(--font-mono), monospace;border:1px solid var(--outline-variant);color:var(--on-surface-variant);border-radius:8px;padding:1px 8px;font-size:11px}.agent-persona{color:var(--on-surface-variant);white-space:pre-wrap;margin-top:8px;font-size:12px;line-height:1.55}.pipeline{padding:8px 0}.step-node{gap:14px;padding:12px 18px;display:flex;position:relative}.step-node+.step-node{border-top:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent)}.step-node:before{content:"";background:var(--outline-variant);width:1px;position:absolute;top:0;bottom:0;left:31px}.step-node:first-child:before{top:18px}.step-node:last-child:before{height:18px;bottom:auto}.step-index{z-index:1;width:26px;height:26px;font-family:var(--font-mono), monospace;background:color-mix(in srgb, var(--aid) 18%, var(--surface-container-low));border:1px solid color-mix(in srgb, var(--aid) 55%, var(--outline-variant));color:var(--aid);border-radius:50%;flex:none;place-items:center;margin-top:1px;font-size:11.5px;font-weight:700;display:grid;position:relative}.step-index.is-script{--aid:var(--on-surface-variant)}.step-body{flex:1;min-width:0}.agent-chip{border-color:color-mix(in srgb, var(--aid) 50%, var(--outline-variant));color:var(--aid);background:0 0}.step-source{margin-top:6px}.step-source summary{cursor:pointer;color:var(--on-surface-variant);-webkit-user-select:none;user-select:none;font-size:12px;font-weight:500}.step-source summary:hover{color:var(--primary)}.step-source pre{background:var(--surface-container-high);white-space:pre-wrap;word-break:break-word;color:var(--on-surface-variant);border:0;border-radius:12px;max-height:360px;margin-top:6px;padding:10px 12px;font-size:11.5px;line-height:1.55;overflow:auto}.gate.neutral{background:var(--surface-container-high);color:var(--on-surface-variant);border:0}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:var(--outline-variant);background-clip:content-box;border:2px solid #0000;border-radius:999px}::-webkit-scrollbar-track{background:0 0}.run-form{gap:10px;display:flex}.run-form input[type=text]{font:13px/1.4 var(--font-mono), monospace;color:var(--on-surface);background:var(--surface-container-high);border:1px solid #0000;border-radius:999px;outline:none;flex:1;padding:10px 18px;transition:border-color .12s,background .12s}.run-form input[type=text]:focus{border-color:var(--primary);background:var(--surface-container-highest)}.run-btn{font:500 13.5px/1 var(--font-sans), sans-serif;white-space:nowrap;color:var(--on-primary);background:var(--primary);border-radius:999px;padding:11px 24px;transition:box-shadow .12s,filter .12s}.run-btn:hover{box-shadow:var(--elev-1);filter:brightness(1.06)}.run-btn:disabled{opacity:.38;cursor:not-allowed;filter:none;box-shadow:none}.run-btn.tonal{color:var(--on-secondary-container);background:var(--secondary-container)}.run-opts{flex-wrap:wrap;gap:6px 22px;margin-top:12px;display:flex}.run-opts label{color:var(--on-surface-variant);cursor:pointer;align-items:center;gap:8px;font-size:13px;display:inline-flex}.run-opts input[type=checkbox]{accent-color:var(--primary);width:15px;height:15px}.run-opts .opt-hint{color:var(--outline)}.sandbox-chip{border:1px solid var(--outline-variant);color:var(--on-surface-variant)}.stop-btn{font:500 13px/1 var(--font-sans), sans-serif;color:var(--error);border:1px solid var(--outline);background:0 0;border-radius:999px;padding:8px 18px;transition:background .12s,border-color .12s}.stop-btn:hover{background:color-mix(in srgb, var(--error) 10%, transparent);border-color:var(--error)}.stop-btn:disabled{opacity:.38;cursor:default}.shell:has(.runs-screen){max-width:none;padding:0}.runs-screen{grid-template-columns:300px minmax(0,1fr);align-items:start;display:grid}.runs-side{top:var(--topbar-h);height:calc(100vh - var(--topbar-h));border-right:1px solid var(--outline-variant);background:var(--surface-container-low);flex-direction:column;display:flex;position:sticky}.side-head{border-bottom:1px solid var(--outline-variant);background:var(--surface-container);align-items:center;gap:10px;padding:12px 16px;display:flex}.side-head .spacer{flex:1}.side-back{width:26px;height:26px;color:var(--on-surface-variant);border-radius:50%;justify-content:center;align-items:center;margin-left:-6px;transition:background .12s,color .12s;display:inline-flex}.side-back:hover{background:color-mix(in srgb, var(--on-surface) 8%, transparent);color:var(--on-surface)}.side-filter{background:var(--surface-container-high);color:var(--on-surface-variant);border:1px solid #0000;border-radius:999px;align-items:center;gap:8px;margin:8px 8px 2px;padding:6px 12px;transition:border-color .12s,background .12s;display:flex}.side-filter:focus-within{border-color:var(--primary);background:var(--surface-container-highest)}.side-filter input{min-width:0;font:12.5px/1.4 var(--font-sans), sans-serif;color:var(--on-surface);background:0 0;border:0;outline:none;flex:1}.side-list{flex:1;padding:6px;overflow-y:auto}.side-row.side-general{border-bottom:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent);border-radius:12px 12px 0 0;margin-bottom:6px;padding-bottom:10px}.side-row{border-radius:12px;align-items:flex-start;gap:9px;margin-bottom:2px;padding:9px 12px;transition:background .1s;display:flex}.side-row .lamp{margin-top:4px}.side-row:hover{background:color-mix(in srgb, var(--on-surface) 6%, transparent)}.side-row.active{background:var(--secondary-container)}.side-row.active .side-wf{color:var(--on-secondary-container)}.side-row-body{flex:1;min-width:0}.side-row-top{align-items:baseline;gap:8px;display:flex}.side-wf{text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:12.5px;font-weight:500;overflow:hidden}.side-when{font-family:var(--font-mono), monospace;color:var(--on-surface-variant);font-size:10.5px}.side-row-sub{align-items:baseline;gap:8px;margin-top:1px;display:flex}.side-row-sub .side-when{opacity:.8;font-size:9px}.side-req{color:var(--on-surface-variant);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:11.5px;overflow:hidden}.side-row.active .side-req{color:var(--on-secondary-container)}.side-meta{font-family:var(--font-mono), monospace;color:var(--on-surface-variant);font-size:10.5px}.runs-main{min-width:0;padding:18px 22px 40px}.runs-main:has(>.chat-main){padding:0}.runs-main .detail-head .spacer{flex:1}.tabs{border:1px solid var(--outline);background:0 0;border-radius:999px;gap:0;padding:0;display:flex;overflow:hidden}.tabs button{letter-spacing:.01em;text-transform:capitalize;color:var(--on-surface-variant);border-radius:0;padding:7px 18px;font-size:12.5px;font-weight:500;transition:background .12s,color .12s}.tabs button+button{border-left:1px solid var(--outline)}.tabs button:hover{background:color-mix(in srgb, var(--on-surface) 6%, transparent);color:var(--on-surface)}.tabs button.active{background:var(--secondary-container);color:var(--on-secondary-container);box-shadow:none}.run-tab{max-width:1080px}.art-layout{grid-template-columns:280px minmax(0,1fr);gap:14px;height:calc(100vh - 172px);min-height:420px;display:grid}.art-files{flex-direction:column;min-height:0;display:flex}.art-files .file-list{flex:1;max-height:none}.art-viewer{flex-direction:column;min-height:0;display:flex}.art-viewer .viewer{border-top:0;flex-direction:column;flex:1;min-height:0;display:flex}.art-viewer .viewer-body{flex:1;min-height:0}.art-viewer .viewer-body iframe{height:100%}.art-viewer .viewer-body pre{box-sizing:border-box;height:100%;max-height:none}.art-viewer .viewer-body img{object-fit:contain;max-height:100%}.art-viewer .empty{flex:1;place-items:center;display:grid}.md-toolbar{align-items:center;gap:12px;display:flex}.md-toolbar .tabs button{text-transform:none;padding:3px 12px;font-size:11px}.md-body{box-sizing:border-box;height:100%;color:var(--on-surface);padding:16px 22px;font-size:13.5px;line-height:1.6;overflow:auto}.md-body>:first-child{margin-top:0}.md-body h1,.md-body h2,.md-body h3,.md-body h4{margin:1.4em 0 .5em;font-weight:600;line-height:1.25}.md-body h1{font-size:20px}.md-body h2{border-bottom:1px solid var(--outline-variant);padding-bottom:4px;font-size:16px}.md-body h3{font-size:14px}.md-body p,.md-body ul,.md-body ol{margin:.6em 0}.md-body ul,.md-body ol{padding-left:1.6em}.md-body li+li{margin-top:.2em}.md-body a{color:var(--primary)}.md-body code{font-family:var(--font-mono), monospace;background:color-mix(in srgb, var(--on-surface) 8%, transparent);border-radius:4px;padding:1px 5px;font-size:12px}.md-body pre{background:color-mix(in srgb, var(--on-surface) 6%, transparent);border:1px solid var(--outline-variant);border-radius:8px;margin:.8em 0;padding:10px 14px;overflow-x:auto}.md-body pre code{background:0 0;padding:0}.md-body blockquote{border-left:3px solid var(--outline);color:var(--on-surface-variant);margin:.8em 0;padding:2px 14px}.md-body table{border-collapse:collapse;margin:.8em 0;font-size:12.5px}.md-body th,.md-body td{border:1px solid var(--outline-variant);text-align:left;padding:5px 10px}.md-body th{background:color-mix(in srgb, var(--on-surface) 5%, transparent)}.md-body hr{border:0;border-top:1px solid var(--outline-variant);margin:1.2em 0}.md-body img{max-width:100%}@media (width<=940px){.runs-screen{grid-template-columns:1fr}.runs-side{display:none}.art-layout{grid-template-columns:1fr;height:auto}.art-files .file-list{max-height:240px}.art-viewer .viewer-body iframe{height:560px}}.chat-main{height:calc(100vh - var(--topbar-h));flex-direction:column;padding:16px 20px;display:flex}.chat-thread{flex-direction:column;flex:1;width:100%;max-width:980px;min-height:0;margin:0 auto;display:flex}.chat-thread .detail-head{flex:none}.chat-thread .detail-head .rid{text-overflow:ellipsis;white-space:nowrap;max-width:34ch;overflow:hidden}.chat-scroll{flex-direction:column;flex:1;gap:10px;min-height:0;padding:14px 2px 20px;display:flex;overflow-y:auto}.chat-scroll .empty{border:0;margin:auto}.msg{white-space:pre-wrap;word-break:break-word;max-width:76ch;font-size:14px;line-height:1.6}.msg.user{background:var(--primary-container);color:var(--on-primary-container);border:0;border-radius:20px 20px 6px;align-self:flex-end;padding:10px 16px}.msg.agent{background:var(--surface-container);border:0;border-radius:20px 20px 20px 6px;align-self:flex-start;padding:10px 16px}.msg.agent.chat-md{white-space:normal;height:auto;padding:10px 16px;font-size:14px;overflow:visible}.msg.agent.chat-md img{border-radius:10px;margin:4px 0;display:block}.msg.agent.chat-md pre{max-width:100%}.msg.error{color:var(--error);align-self:flex-start;font-size:12.5px}.msg.thought{align-self:flex-start;max-width:76ch}.msg.thought summary{cursor:pointer;color:var(--on-surface-variant);-webkit-user-select:none;user-select:none;font-size:12px;font-weight:500}.msg.thought div{border-left:2px solid var(--outline-variant);color:var(--on-surface-variant);white-space:pre-wrap;word-break:break-word;margin-top:5px;padding:8px 12px;font-size:12px}.tool-card{font-family:var(--font-mono), monospace;color:var(--on-surface-variant);background:0 0;border:0;align-self:flex-start;align-items:flex-start;gap:8px;max-width:90ch;padding:0 2px;font-size:11px;display:inline-flex}.tool-card+.tool-card{margin-top:-6px}.tool-card .lamp{width:7px;height:7px;margin-top:4px}.tool-card .chip.tool-kind{text-transform:uppercase;letter-spacing:.5px;background:0 0;border:0;flex-shrink:0;min-width:64px;padding:0;font-size:10px}.tool-card .tool-title{white-space:pre-wrap;word-break:break-word;min-width:0;line-height:1.5;overflow:visible}.perm-card{background:var(--tertiary-container);color:var(--on-tertiary-container);max-width:76ch;box-shadow:var(--elev-1);border:0;border-radius:16px;align-self:flex-start;padding:12px 16px}.perm-card .perm-title{font-size:13.5px}.perm-card .perm-title .microlabel{color:var(--tertiary);margin-right:8px;font-weight:700}:root[data-theme=light] .perm-card .perm-title .microlabel{color:var(--on-tertiary-container)}.perm-actions{flex-wrap:wrap;gap:8px;margin-top:10px;display:flex}.perm-btn{font:500 13px/1 var(--font-sans), sans-serif;border:1px solid var(--outline);border-radius:999px;padding:8px 18px;transition:background .12s,filter .12s}.perm-btn.allow{color:var(--on-primary);background:var(--primary);border-color:#0000}.perm-btn.allow:hover{filter:brightness(1.06);box-shadow:var(--elev-1)}.perm-btn.deny{color:inherit}.perm-btn.deny:hover{border-color:var(--error);color:var(--error)}.perm-resolved{color:var(--on-surface-variant);font-size:12px;font-family:var(--font-mono), monospace;margin-top:6px}.chat-working{color:var(--on-surface-variant);align-items:center;gap:8px;font-size:12px;display:flex}.composer{border-top:1px solid var(--outline-variant);flex:none;align-items:flex-end;gap:10px;padding:12px 0 4px;display:flex;position:relative}.skill-menu{background:var(--surface-container-high);border:1px solid var(--outline-variant);box-shadow:var(--elev-1);z-index:5;border-radius:14px;flex-direction:column;margin-bottom:6px;display:flex;position:absolute;bottom:100%;left:0;right:0;overflow:hidden}.skill-menu button{text-align:left;background:0 0;border:0;align-items:baseline;gap:6px;padding:9px 14px;font-size:13px;display:flex}.skill-menu button b{font-weight:500;font-family:var(--font-mono), monospace;font-size:12.5px}.skill-menu button span{color:var(--on-surface-variant);text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:12px;overflow:hidden}.skill-menu button .skill-src{text-transform:uppercase;letter-spacing:.04em;flex:none;margin-left:auto;font-size:10.5px}.skill-menu button:hover,.skill-menu button.active{background:color-mix(in srgb, var(--on-surface) 7%, transparent)}.composer textarea{resize:none;font:14px/1.5 var(--font-sans), sans-serif;color:var(--on-surface);background:var(--surface-container-high);border:1px solid #0000;border-radius:24px;outline:none;flex:1;padding:12px 18px;transition:border-color .12s,background .12s}.composer textarea:focus{border-color:var(--primary);background:var(--surface-container-highest)}.new-chat{width:100%;max-width:640px;margin:0 auto}.new-chat-panel{overflow:visible}.agent-pick{grid-template-columns:repeat(3,1fr);gap:10px;padding:14px 16px;display:grid}.agent-pick-btn{text-align:left;border:1px solid var(--outline-variant);background:0 0;border-radius:12px;flex-direction:column;gap:3px;padding:12px 14px;transition:background .12s,border-color .12s;display:flex}.agent-pick-btn b{font-size:13.5px;font-weight:500}.agent-pick-btn span{color:var(--on-surface-variant);font-size:11.5px}.agent-pick-btn:hover{background:color-mix(in srgb, var(--on-surface) 5%, transparent)}.agent-pick-btn.active{background:var(--secondary-container);color:var(--on-secondary-container);border-color:#0000}.agent-pick-btn.active span{color:var(--on-secondary-container)}@media (width<=940px){.chat-main{height:auto;min-height:calc(100vh - var(--topbar-h))}.agent-pick{grid-template-columns:1fr}}.know-intro{color:var(--on-surface-variant);padding:12px 18px;font-size:13px;line-height:1.6}.know-intro code{font-size:11.5px}.know-newbundle{gap:10px;padding:14px 18px;display:flex}.know-newbundle input{font:13px/1.4 var(--font-mono), monospace;color:var(--on-surface);background:var(--surface-container-high);border:1px solid #0000;border-radius:999px;outline:none;flex:1;padding:10px 18px;transition:border-color .12s,background .12s}.know-newbundle input:focus{border-color:var(--primary);background:var(--surface-container-highest)}.know-table{border-collapse:collapse;width:100%;font-size:13px}.know-table td{border-bottom:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent);vertical-align:baseline;padding:9px 18px}.know-table tr:last-child td{border-bottom:none}.know-table a{color:var(--on-surface);text-decoration:none}.know-table a:hover b{color:var(--primary)}.know-id{font-family:var(--font-mono), monospace;color:var(--on-surface-variant);margin-left:8px;font-size:11px}.know-type{color:var(--on-surface-variant);white-space:nowrap;font-size:11.5px}.know-flags{text-align:right;white-space:nowrap}.chip.trust.unverified{color:var(--on-surface-variant)}.chip.trust.machine-confirmed{background:var(--secondary-container);color:var(--on-secondary-container);border-color:#0000}.chip.trust.human-reviewed{color:var(--on-success-container);background:var(--success-container);border-color:#0000}.chip.stale,.chip.deprecated{color:var(--on-error-container);background:var(--error-container);border-color:#0000}.chip.attention{color:var(--on-error-container);background:var(--error-container);border-color:#0000;text-decoration:none}.chip.attention:hover{filter:brightness(.96)}.chip.draft{border-color:color-mix(in srgb, var(--primary) 45%, var(--outline-variant));color:var(--primary)}.dash{box-sizing:border-box;width:100%;max-width:1180px;margin:0 auto;padding:24px 28px 40px}.dash-actions{align-self:center;gap:10px;display:flex}.wf-pick-wrap{position:relative}.wf-pick-pop{z-index:30;background:var(--surface-container);border:1px solid var(--outline-variant);min-width:280px;max-height:340px;box-shadow:var(--elev-2,0 8px 24px #0000002e);border-radius:12px;flex-direction:column;padding:6px;display:flex;position:absolute;top:calc(100% + 6px);right:0;overflow-y:auto}.wf-pick-item{color:inherit;border-radius:8px;flex-direction:column;gap:2px;padding:8px 10px;text-decoration:none;display:flex}.wf-pick-item:hover{background:color-mix(in srgb, var(--on-surface) 6%, transparent)}.wf-pick-name{font-size:13px;font-weight:500}.wf-pick-desc{color:var(--on-surface-variant);font-size:11.5px}.wf-pick-empty{color:var(--on-surface-variant);padding:8px 10px;font-size:12px}.dash-agents{grid-template-columns:repeat(6,1fr);gap:14px;margin-bottom:18px;display:grid}@media (width<=1100px){.dash-agents{grid-template-columns:repeat(4,1fr)}}@media (width<=800px){.dash-agents{grid-template-columns:repeat(3,1fr)}}@media (width<=560px){.dash-agents{grid-template-columns:repeat(2,1fr)}}.dash-agents-empty{margin-bottom:18px}.dash-agent{background:var(--surface-container-low,var(--surface-container));border:1px solid var(--outline-variant);cursor:pointer;border-radius:16px;flex-direction:column;display:flex;overflow:hidden}.dash-agent:hover{border-color:var(--outline)}.lamp.idle{border:1.5px solid var(--outline-variant);background:0 0}.dash-agent-id{text-align:center;color:inherit;flex-direction:column;flex:1;align-items:center;gap:6px;padding:20px 16px 12px;text-decoration:none;display:flex}.dash-agent-id:hover .dash-agent-name{color:var(--primary)}.dash-agent-name{font-size:15px;font-weight:600}.dash-agent-desc{color:var(--on-surface-variant);-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:11.5px;line-height:1.45;display:-webkit-box;overflow:hidden}.dash-agent-foot{border-top:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent);justify-content:space-between;align-items:center;gap:10px;padding:10px 14px;display:flex}.dash-agent-state{color:var(--on-surface-variant);font-size:11px}.dash-agent-state a{color:var(--primary);text-decoration:none}.dash-chat-btn{color:var(--primary);border:1px solid var(--outline);background:0 0;padding:4px 13px;font-size:12px}.dash-chat-btn:hover{background:color-mix(in srgb, var(--primary) 10%, transparent);box-shadow:none;filter:none}.dash-feed{margin:0}.agent-avatar{background:var(--secondary-container);border-radius:50%;flex:none;place-items:center;width:38px;height:38px;font-size:19px;line-height:1;display:grid;position:relative}.agent-avatar .lamp{border:2px solid var(--surface-container-low);width:10px;height:10px;position:absolute;bottom:-1px;right:-1px}.agent-avatar .lamp.idle{background:var(--outline-variant)}.agent-avatar.sm{width:30px;height:30px;font-size:15px}.agent-avatar.lg{width:56px;height:56px;font-size:28px}.agent-avatar.lg .lamp{width:12px;height:12px;bottom:1px;right:1px}.dash-alert{text-align:left;cursor:pointer;border:1px solid color-mix(in srgb, var(--error) 40%, transparent);background:var(--error-container);width:100%;color:var(--on-error-container);border-radius:12px;align-items:center;gap:8px;margin:0 0 14px;padding:9px 14px;font-size:12.5px;display:flex}.dash-alert:hover{filter:brightness(1.04)}.dash-feed-filter{gap:6px;display:flex}.feed-chip{border:1px solid var(--outline-variant);color:var(--on-surface-variant);cursor:pointer;background:0 0;border-radius:8px;padding:2px 10px;font-size:11px}.feed-chip:hover{color:var(--on-surface)}.feed-chip.on{background:var(--primary-container);color:var(--on-primary-container);border-color:#0000}.feed-chip.on.failed{background:var(--error-container);color:var(--on-error-container)}.feed-day{border-top:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent);padding:12px 18px 3px}.feed-group:first-child .feed-day{border-top:none;padding-top:6px}.feed-group+.feed-group .m3-row{border-top:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent)}.feed-group .feed-day+.m3-row{border-top:none}.dash-mini{color:var(--on-surface-variant);flex-wrap:wrap;gap:18px;font-size:12px;display:flex}.dash-mini a{color:inherit;text-decoration:none}.dash-mini a:hover{color:var(--primary);text-decoration:underline}.dash-mini b{color:var(--on-surface);font-weight:600}.dash-mini a:hover b{color:var(--primary)}.chip.dash-kind{flex:none}.chip.status{font-family:var(--font-sans), sans-serif;border-color:#0000;flex:none;font-weight:500}.chip.status.ok{background:var(--success-container);color:var(--on-success-container)}.chip.status.failed{background:var(--error-container);color:var(--on-error-container)}.chip.status.running{background:var(--primary-container);color:var(--on-primary-container)}.chip.status.aborted{background:var(--surface-container-high);color:var(--on-surface-variant)}.chip.dash-kind.run{background:var(--primary-container);color:var(--on-primary-container);border-color:#0000}.chip.dash-kind.session{background:var(--tertiary-container);color:var(--on-tertiary-container);border-color:#0000}.chip.dash-kind.knowledge{background:var(--success-container);color:var(--on-success-container);border-color:#0000}html[data-expert=off] .dash-mini,html[data-expert=off] .chip.dash-kind{display:none}.lamp.dim{background:var(--outline-variant)}.chip.skill-src{flex:none}.chip.skill-src.workspace{background:var(--success-container);color:var(--on-success-container);border-color:#0000}.chip.skill-src.project,.chip.skill-src.user{color:var(--on-surface-variant)}.chip.skill-src.agent{background:var(--secondary-container);color:var(--on-secondary-container);border-color:#0000}.skills-local-head{border-top:1px solid var(--outline-variant);margin-top:10px}.skill-desc{margin:-6px 2px 14px}.skill-path{word-break:break-all}.know-sub{align-items:center;gap:8px;margin:-8px 2px 14px;display:flex}.know-sub .rid{font-family:var(--font-mono), monospace;color:var(--on-surface-variant);font-size:12px}.know-meta{flex-direction:column;gap:8px;padding:12px 18px;font-size:13px;display:flex}.know-meta>div{align-items:baseline;gap:14px;display:flex}.know-meta .microlabel{flex:none;width:90px}.know-verify-entry{margin-right:14px;display:inline-block}.know-folder-row td{border-bottom:none;padding:10px 18px 4px}.know-folder{font-family:var(--font-mono), monospace;color:var(--on-surface-variant);letter-spacing:.04em;font-size:11px}.know-indent{padding-left:32px!important}.side-group{border-radius:10px}.side-group+.side-group{margin-top:12px}.side-group.drop-over{outline:1.5px dashed var(--primary);outline-offset:-1.5px;background:color-mix(in srgb, var(--primary) 7%, transparent)}.side-group-head{align-items:center;gap:6px;padding:6px 10px 2px;display:flex}.side-group-count{color:var(--on-surface-variant);font-size:10px}.side-group-x{font:inherit;color:var(--on-surface-variant);cursor:pointer;opacity:0;background:0 0;border:none;padding:0 4px;font-size:11px}.side-group:hover .side-group-x{opacity:1}.side-group-x:hover{color:var(--on-surface)}.side-group-empty{color:var(--on-surface-variant);padding:6px 10px 8px;font-size:11px}.side-row.dragging{opacity:.4}.side-group-add{font:inherit;color:var(--on-surface-variant);border:1px dashed var(--outline-variant);cursor:pointer;text-align:left;background:0 0;border-radius:8px;margin:12px 10px 4px;padding:4px 10px;font-size:11px;display:block}.side-group-add:hover{color:var(--primary);border-color:var(--outline)}.side-archived{border-top:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent);margin-top:10px;padding-top:4px}.side-archived-toggle{width:100%;font:inherit;color:var(--on-surface-variant);cursor:pointer;text-align:left;background:0 0;border:none;align-items:center;gap:6px;padding:6px 10px 2px;display:flex}.side-archived-toggle:hover .microlabel{color:var(--on-surface)}.side-archived-toggle .ms{vertical-align:0}.side-row.archived-row{opacity:.55}.side-row.archived-row:hover,.side-row.archived-row.active{opacity:1}.chip.archived-chip{color:var(--on-surface-variant);border-style:dashed;align-items:center;gap:4px;display:inline-flex}.chip.archived-chip .ms{vertical-align:0}.side-group-new{padding:10px 10px 4px}.side-group-new input{box-sizing:border-box;width:100%}.side-group-rename{min-width:0;font:inherit;flex:1;font-size:11px}.agents-screen{grid-template-columns:240px minmax(0,1fr)}.agents-screen.has-sessions{grid-template-columns:240px 260px minmax(0,1fr)}.agents-screen.has-sessions.has-knowledge{grid-template-columns:240px 260px minmax(0, 1fr) var(--kside-w,460px)}.knowledge-side{border-left:1px solid var(--outline-variant);border-right:0;position:sticky}.kside-resizer{cursor:col-resize;z-index:4;width:7px;position:absolute;top:0;bottom:0;left:-3px}.kside-resizer:hover{background:color-mix(in srgb, var(--primary) 25%, transparent)}.kside-headline{flex-direction:column;gap:1px;min-width:0;display:flex}.kside-hint{color:var(--on-surface-variant);white-space:nowrap;text-overflow:ellipsis;font-size:10.5px;overflow:hidden}.kside-bundle{padding:6px 8px 10px}.kside-bundle+.kside-bundle{border-top:1px solid var(--outline-variant)}.kside-bundle-head{align-items:center;gap:2px;padding:2px 0;display:flex}.kside-bundle-toggle{text-align:left;border-radius:10px;flex:1;align-items:center;gap:7px;min-width:0;padding:6px 8px;display:flex}.kside-bundle-toggle:hover{background:color-mix(in srgb, var(--on-surface) 5%, transparent)}.kside-bundle-name{color:var(--on-surface);text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:600;overflow:hidden}.kside-count{color:var(--on-surface-variant);background:var(--surface-container-highest);border-radius:999px;flex:none;padding:0 7px;font-size:10.5px;line-height:17px}.kside-open{width:26px;height:26px;color:var(--on-surface-variant);border-radius:50%;flex:none;place-items:center;font-size:13px;display:grid}.kside-open:hover{background:color-mix(in srgb, var(--on-surface) 8%, transparent);color:var(--on-surface)}.kside-chev{width:15px;color:var(--on-surface-variant);flex:none;line-height:1;transition:transform .14s;display:inline-block}.kside-chev .ms{vertical-align:0;font-size:15px;display:block}.kside-chev.open{transform:rotate(90deg)}.kside-row{text-align:left;width:100%;color:var(--on-surface-variant);border-radius:10px;align-items:center;gap:7px;padding:6px 8px 6px 18px;font-size:12px;display:flex}.kside-row:hover{background:color-mix(in srgb, var(--on-surface) 5%, transparent);color:var(--on-surface)}.kside-concept.open>.kside-row{background:var(--secondary-container);color:var(--on-secondary-container);font-weight:500}.kside-concept.open>.kside-row .kside-chev{color:inherit}.kside-title{text-overflow:ellipsis;white-space:nowrap;flex:1;overflow:hidden}.kside-stale{text-transform:uppercase;letter-spacing:.05em;color:var(--error,#b3261e);cursor:help;border:1px solid;border-radius:999px;flex:none;padding:0 6px;font-size:9px}.kside-card{background:var(--surface-container-high);border:1px solid color-mix(in srgb, var(--outline-variant) 70%, transparent);border-radius:12px;margin:4px 0 10px 18px;overflow:hidden}.kside-card>.viewer-note{padding:12px 14px}.kside-card-bar{border-bottom:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent);background:color-mix(in srgb, var(--surface-container-highest) 65%, transparent);align-items:center;gap:10px;padding:7px 12px;display:flex}.kside-type{text-transform:uppercase;letter-spacing:.06em;color:var(--on-surface-variant);border:1px solid var(--outline-variant);border-radius:999px;padding:1px 7px;font-size:9px}.kside-updated{color:var(--on-surface-variant);font-size:10.5px}.kside-md.md-body{height:auto;padding:12px 14px 14px;font-size:12px;overflow:visible}.concept-md{height:auto;overflow:visible}.kside-actions{justify-content:flex-end;gap:8px;margin:2px 0 0;display:flex}.kside-edit{padding:10px 12px}.kside-edit .concept-edit{box-sizing:border-box;width:100%}.kside-edit .kside-actions{margin-top:8px}.kside-reopen{z-index:5;color:var(--on-surface-variant);background:var(--surface-container-high);border:1px solid var(--outline-variant);border-radius:999px;padding:4px 12px;font-size:11px;position:fixed;top:60px;right:14px}.kside-reopen:hover{color:var(--on-surface);background:var(--surface-container-highest,var(--surface-container-high))}@media (width<=1099px){.knowledge-side,.kside-reopen{display:none}.agents-screen.has-sessions.has-knowledge{grid-template-columns:240px 260px minmax(0,1fr)}}.agent-view{flex-direction:column;gap:16px;display:flex}.agent-view .detail-head{margin-bottom:0}.m3-list{flex-direction:column;padding:4px 0;display:flex}.m3-row{text-align:left;color:inherit;align-items:center;gap:14px;padding:12px 18px;display:flex}.m3-row+.m3-row,.m3-expand+.m3-row{border-top:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent)}button.m3-toggle{width:100%;font:inherit;cursor:pointer;background:0 0;border:0}button.m3-toggle:hover{background:color-mix(in srgb, var(--on-surface) 4%, transparent)}.m3-ico{width:32px;height:32px;color:var(--on-secondary-container);background:var(--secondary-container);border-radius:50%;flex:none;place-items:center;font-size:14px;display:grid}.m3-ico .ms{vertical-align:0;font-size:17px}.m3-body{flex-direction:column;flex:1;gap:3px;min-width:0;display:flex}.m3-head{align-items:center;gap:8px;font-size:13.5px;font-weight:500;display:flex}.m3-sub{color:var(--on-surface-variant);font-size:12px;line-height:1.5}.m3-sub code{font-size:11px}.m3-sub a{color:inherit}.m3-ellipsis{white-space:nowrap;text-overflow:ellipsis;display:block;overflow:hidden}.m3-chev{color:var(--on-surface-variant);flex:none;transition:transform .14s;display:inline-flex}.m3-chev .ms{vertical-align:0}.m3-chev.open{transform:rotate(180deg)}.m3-expand{padding:2px 18px 16px 64px}.m3-expand pre{white-space:pre-wrap;font:12.5px/1.65 var(--font-mono), monospace;margin:0}.m3-chips{flex-wrap:wrap;gap:6px;margin-top:3px;display:flex}.m3-chips .chip{text-decoration:none}.m3-switch{cursor:pointer;flex:none;width:44px;height:24px;display:inline-block;position:relative}.m3-switch input{opacity:0;cursor:pointer;margin:0;position:absolute;inset:0}.m3-switch-track{pointer-events:none;background:var(--surface-container-highest);border:2px solid var(--outline-variant);border-radius:999px;transition:background .14s,border-color .14s;position:absolute;inset:0}.m3-switch-track:after{content:"";background:var(--on-surface-variant);border-radius:50%;width:16px;height:16px;transition:transform .14s,background .14s;position:absolute;top:2px;left:2px}.m3-switch input:checked+.m3-switch-track{background:var(--primary);border-color:var(--primary)}.m3-switch input:checked+.m3-switch-track:after{background:var(--on-primary);transform:translate(20px)}a.m3-row{text-decoration:none}a.m3-row:hover{background:color-mix(in srgb, var(--on-surface) 4%, transparent)}a.m3-row:hover .m3-head{color:var(--primary)}.m3-subhead{font-family:var(--font-mono), monospace;letter-spacing:.05em;color:var(--on-surface-variant);padding:14px 18px 4px;font-size:11px}.m3-row+.m3-subhead{border-top:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent);margin-top:4px}.know-log{padding:2px 0 10px}.page-head .tabs{align-self:center;margin-left:4px}.tabs a{letter-spacing:.01em;text-transform:capitalize;color:var(--on-surface-variant);padding:6px 16px;font-size:12.5px;font-weight:500;text-decoration:none;transition:background .12s,color .12s}.tabs a+a{border-left:1px solid var(--outline)}.tabs a:hover{background:color-mix(in srgb, var(--on-surface) 6%, transparent);color:var(--on-surface)}.tabs a.active{background:var(--secondary-container);color:var(--on-secondary-container)}.wiki{grid-template-columns:240px minmax(0,1fr);align-items:start;gap:20px;display:grid}.wiki-side{top:calc(var(--topbar-h) + 18px);max-height:calc(100vh - var(--topbar-h) - 36px);border-right:1px solid color-mix(in srgb, var(--outline-variant) 70%, transparent);flex-direction:column;gap:1px;padding:6px 10px 6px 0;display:flex;position:sticky;overflow-y:auto}.wiki-folder{font-family:var(--font-mono), monospace;letter-spacing:.04em;color:var(--on-surface-variant);padding:12px 10px 4px;font-size:10.5px}.wiki-folder:first-child{padding-top:4px}.wiki-page{color:var(--on-surface);border-radius:10px;align-items:center;gap:8px;padding:7px 10px;font-size:13px;line-height:1.3;text-decoration:none;transition:background .1s;display:flex}.wiki-page .ms-sm{color:var(--on-surface-variant);flex:none}.wiki-page:hover{background:color-mix(in srgb, var(--on-surface) 6%, transparent)}.wiki-page.active{background:var(--secondary-container);color:var(--on-secondary-container);font-weight:500}.wiki-page.active .ms-sm{color:var(--on-secondary-container)}.wiki-page-title{-webkit-line-clamp:2;-webkit-box-orient:vertical;flex:1;min-width:0;display:-webkit-box;overflow:hidden}.wiki-page{align-items:flex-start}.wiki-page .ms-sm{margin-top:1px}.wiki-dot{background:var(--error);border-radius:50%;flex:none;width:6px;height:6px}.wiki-main{min-width:0}.concept-md a{color:var(--primary);text-decoration:underline;-webkit-text-decoration-color:color-mix(in srgb, var(--primary) 40%, transparent);text-decoration-color:color-mix(in srgb, var(--primary) 40%, transparent);text-underline-offset:2px}.concept-md a:hover{-webkit-text-decoration-color:var(--primary);text-decoration-color:var(--primary)}.wiki-main .agent-view>.detail-head{margin-top:0}@media (width<=1100px){.wiki{grid-template-columns:1fr}.wiki-side{border-right:0;flex-flow:wrap;gap:4px;max-height:none;padding-right:0;position:static}.wiki-folder{width:100%}}.know-log-row{align-items:baseline;gap:10px;padding:4px 18px;display:flex}.know-log-text{color:var(--on-surface-variant);overflow-wrap:break-word;min-width:0;font-size:12.5px;line-height:1.55}.know-log-text a{color:var(--primary)}.chip.log-kind{flex:none}.chip.log-verification{background:var(--success-container);color:var(--on-success-container);border-color:#0000}.chip.log-creation,.chip.log-initialization{background:var(--secondary-container);color:var(--on-secondary-container);border-color:#0000}.detail-cols{grid-template-columns:minmax(0,1fr) 320px;align-items:start;gap:16px;display:grid}@media (width<=1020px){.detail-cols{grid-template-columns:1fr}}.detail-rail{flex-direction:column;gap:16px;min-width:0;display:flex}.rail-list{padding:4px 0}.rail-kv{flex-direction:column;gap:3px;padding:10px 18px;display:flex}.rail-kv+.rail-kv{border-top:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent)}.rail-kv .v{color:var(--on-surface);overflow-wrap:break-word;flex-wrap:wrap;align-items:center;gap:8px;font-size:12.5px;display:flex}.rail-kv .v.dim{color:var(--on-surface-variant)}.rail-kv a{color:var(--primary)}.concept-edit{resize:vertical;background:var(--surface-container-lowest);width:100%;color:var(--on-surface);font:12.5px/1.65 var(--font-mono), monospace;border:0;border-bottom:1px solid color-mix(in srgb, var(--outline-variant) 55%, transparent);outline:none;padding:14px 18px;display:block}.side-row .row-x{opacity:0;color:var(--on-surface-variant);cursor:pointer;background:0 0;border:0;border-radius:8px;flex:none;align-self:center;padding:4px 6px;font-size:11px;line-height:1;transition:opacity .1s,background .1s,color .1s}.side-row:hover .row-x,.side-row .row-x:focus-visible{opacity:1}.side-row .row-x:hover{background:color-mix(in srgb, var(--error) 18%, transparent);color:var(--error)}.agent-wf-list{flex-wrap:wrap;gap:8px;padding:12px 18px;display:flex}.agent-wf-list .chip{text-decoration:none}.agent-form{flex-direction:column;gap:14px;max-width:680px;padding:18px;display:flex}.agent-form-row{align-items:flex-end;gap:10px;display:flex}.agent-field{flex-direction:column;gap:5px;display:flex}.agent-field,.agent-field-label{color:var(--on-surface-variant);letter-spacing:.045em;text-transform:capitalize;font-size:11px;font-weight:500}.agent-field input,.agent-field select,.agent-field textarea{font:13px/1.5 var(--font-mono), monospace;color:var(--on-surface);background:var(--surface-container-high);text-transform:none;letter-spacing:normal;border:1px solid #0000;border-radius:12px;outline:none;padding:9px 14px;transition:border-color .12s,background .12s}.agent-field textarea{resize:vertical;font-family:var(--font-mono), monospace}.agent-field input:focus,.agent-field select:focus,.agent-field textarea:focus{border-color:var(--primary);background:var(--surface-container-highest)}.emoji-pick{flex-wrap:wrap;gap:6px;display:flex}.emoji-pick button{border:1px solid var(--outline-variant);cursor:pointer;background:0 0;border-radius:12px;padding:6px 10px;font-size:16px;transition:background .12s,border-color .12s}.emoji-pick button:hover{background:color-mix(in srgb, var(--on-surface) 6%, transparent)}.emoji-pick button.active{background:var(--secondary-container);border-color:#0000}.wf-checks{flex-direction:column;gap:7px;padding:4px 0;display:flex}.wf-checks label{color:var(--on-surface-variant);text-transform:none;letter-spacing:normal;cursor:pointer;align-items:baseline;gap:8px;font-size:13px;display:flex}.wf-checks input[type=checkbox]{accent-color:var(--primary)}.wf-checks b{font-family:var(--font-mono), monospace;font-size:12px}.wf-checks .opt-hint{color:var(--outline);font-size:11.5px}@media (width<=900px){.agents-screen,.agents-screen.has-sessions,.agents-screen.has-sessions.has-knowledge{grid-template-columns:1fr}.agent-form-row{flex-direction:column;align-items:stretch}}.editor-screen{background:var(--surface);z-index:50;flex-direction:column;display:flex;position:fixed;inset:0}.editor-bar{border-bottom:1px solid var(--outline-variant);background:var(--surface-container-low);align-items:center;gap:14px;padding:10px 20px;font-size:13px;display:flex}.editor-bar .spacer{flex:1}.editor-crumb{color:var(--on-surface-variant);font-family:var(--font-mono), monospace;align-items:center;gap:6px;font-size:11.5px;display:inline-flex}.editor-title{text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:500;overflow:hidden}.editor-status{color:var(--on-surface-variant);font-size:11.5px}.editor-status.saving{color:var(--primary)}.editor-status.error{color:var(--error)}.editor-close{font:inherit;border:1px solid var(--outline);color:var(--on-surface);cursor:pointer;background:0 0;border-radius:999px;align-items:center;gap:4px;padding:6px 14px 6px 10px;font-size:13px;font-weight:500;display:inline-flex}.editor-close:hover{background:color-mix(in srgb, var(--on-surface) 6%, transparent)}.editor-doc{flex:1;overflow-y:auto}.editor-mdx,.editor-mdx.dark-theme{--basePageBg:var(--surface);--baseBg:var(--surface);--baseBgSubtle:var(--surface-container-low);--baseBgHover:var(--surface-container);--baseBgActive:var(--surface-container-high);--baseBorder:var(--outline-variant);--baseBorderHover:var(--outline);--baseText:var(--on-surface-variant);--baseTextContrast:var(--on-surface);--accentText:var(--primary);--accentTextContrast:var(--on-primary-container);--accentBg:var(--primary-container);--accentBgSubtle:var(--secondary-container);--accentBorder:var(--primary);color:var(--on-surface);background:var(--surface)}.editor-mdx.dark-theme .cm-editor{background:var(--surface-container-low);color:var(--on-surface)}.editor-mdx.dark-theme .cm-gutters{background:var(--surface-container);color:var(--on-surface-variant);border-color:var(--outline-variant)}.editor-mdx.dark-theme .cm-activeLine,.editor-mdx.dark-theme .cm-activeLineGutter{background:color-mix(in srgb, var(--on-surface) 6%, transparent)}.editor-mdx.dark-theme .cm-cursor{border-left-color:var(--on-surface)}.editor-mdx.dark-theme ._codeMirrorWrapper_uazmk_391,.editor-mdx.dark-theme [class*=codeMirrorWrapper]{background:var(--surface-container-low);border-color:var(--outline-variant)}.editor-mdx [role=toolbar],.editor-mdx .mdxeditor-toolbar{z-index:2;border-bottom:1px solid var(--outline-variant);background:var(--surface-container-low);border-radius:0;padding:4px 16px;position:sticky;top:0}.editor-mdx .mdxeditor-root-contenteditable{max-width:820px;margin:0 auto;padding:32px 40px 160px}.editor-content{font-family:var(--font-sans), sans-serif;color:var(--on-surface);min-height:60vh;font-size:15px;line-height:1.65}.editor-content:focus{outline:none}.editor-content h1{margin:0 0 .4em;font-size:26px}.editor-content h2{margin:1.4em 0 .4em;font-size:20px}.editor-content h3{margin:1.2em 0 .3em;font-size:16px}.editor-content p{margin:0 0 .75em}.editor-content ul,.editor-content ol{margin:0 0 .75em;padding-left:1.4em}.editor-content table{border-collapse:collapse;margin:.6em 0}.editor-content th,.editor-content td{border:1px solid var(--outline-variant);padding:5px 10px}.editor-plain{width:min(820px,100%);min-height:70vh;font:13px/1.6 var(--font-mono), monospace;color:var(--on-surface);background:var(--surface);border:1px solid var(--outline-variant);resize:vertical;border-radius:12px;margin:16px auto;padding:24px 40px;display:block}.editor-doc .viewer-note{max-width:820px;margin:12px auto 0}.git-badge{background:color-mix(in srgb, var(--on-surface) 12%, transparent);border-radius:999px;margin-left:5px;padding:1px 6px;font-size:10.5px;font-weight:600}.git-badge.behind{color:var(--primary)}.git-badge.ahead{color:var(--success)}.git-head{flex-wrap:wrap;align-items:center;gap:16px;padding:14px 18px;display:flex}.git-branch{align-items:center;gap:8px;font-size:14px;display:flex}.git-branch strong{font-family:var(--mono,ui-monospace, SFMono-Regular, Menlo, monospace)}.git-counts{align-items:center;gap:10px;font-size:12.5px;display:flex}.git-ahead{color:var(--success);font-weight:600}.git-behind{color:var(--primary);font-weight:600}.git-diverged{color:var(--error);font-weight:600}.git-sync-err{text-overflow:ellipsis;white-space:nowrap;max-width:46ch;overflow:hidden}.git-head .ws-actions{margin-left:auto}.git-row{flex-wrap:wrap;align-items:center;gap:10px;padding:8px 18px;display:flex}.git-row+.git-row{border-top:1px solid color-mix(in srgb, var(--outline-variant) 45%, transparent)}.git-pick{align-items:center;display:flex}.git-file{cursor:pointer;min-width:0;color:var(--on-surface);font:inherit;text-align:left;background:0 0;border:0;flex:1;align-items:center;gap:8px;padding:2px 0;display:flex}.git-file:hover .git-path{text-decoration:underline}.git-status{text-transform:uppercase;letter-spacing:.4px;border:1px solid var(--outline-variant);color:var(--on-surface-variant);border-radius:999px;flex:none;padding:2px 8px;font-size:10.5px;font-weight:600}.git-status.s-modified{color:var(--primary)}.git-status.s-added,.git-status.s-untracked{color:var(--success)}.git-status.s-deleted,.git-status.s-conflicted{color:var(--error)}.git-path{font-family:var(--mono,ui-monospace, SFMono-Regular, Menlo, monospace);text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;overflow:hidden}.git-row.blocked{opacity:.6}.git-diff{background:var(--surface-container);font-family:var(--mono,ui-monospace, SFMono-Regular, Menlo, monospace);white-space:pre;border-radius:10px;flex-basis:100%;max-height:420px;margin:6px 0 2px;padding:10px 12px;font-size:11.5px;line-height:1.5;overflow:auto}.git-diff-error{color:var(--error)}.git-diff .d-add{color:var(--success)}.git-diff .d-del{color:var(--error)}.git-diff .d-hunk{color:var(--primary)}.git-diff .d-meta{color:var(--on-surface-variant);opacity:.8}.git-commit{border-top:1px solid var(--outline-variant);background:var(--surface-container);flex-wrap:wrap;align-items:center;gap:10px;padding:12px 18px;display:flex}.git-message{min-width:220px;font:inherit;border:1px solid var(--outline-variant);background:var(--surface);color:var(--on-surface);border-radius:10px;flex:1;padding:9px 12px;font-size:13px}.git-blocked{border-top:1px solid var(--outline-variant);padding:10px 18px}.git-blocked summary{color:var(--on-surface-variant);cursor:pointer;font-size:12.5px}.git-blocked .git-row{padding-left:0;padding-right:0}.kbd{font-family:var(--font-mono), monospace;border:1px solid var(--outline-variant);color:var(--on-surface-variant);border-radius:5px;padding:3px 5px;font-size:10.5px;line-height:1}.search-btn{color:var(--on-surface-variant);border-radius:10px;align-items:center;gap:6px;padding:4px 8px 4px 6px;transition:background .12s,color .12s;display:inline-flex}.search-btn:hover{background:color-mix(in srgb, var(--on-surface) 8%, transparent);color:var(--on-surface)}.palette-backdrop{z-index:50;background:#00000059;justify-content:center;align-items:flex-start;padding:12vh 16px 16px;display:flex;position:fixed;inset:0}.palette{background:var(--surface-container-high);width:min(620px,100%);max-height:min(70dvh,560px);box-shadow:var(--elev-3);border-radius:16px;flex-direction:column;display:flex;overflow:hidden}.palette-input{border-bottom:1px solid var(--outline-variant);color:var(--on-surface-variant);align-items:center;gap:10px;padding:12px 16px;display:flex}.palette-input input{min-width:0;font:inherit;color:var(--on-surface);background:0 0;border:0;outline:none;flex:1;font-size:16px}.palette-list{overscroll-behavior:contain;padding:6px;list-style:none;overflow-y:auto}.palette-item{cursor:pointer;border-radius:10px;align-items:center;gap:10px;padding:8px 10px;display:flex}.palette-item.active{background:color-mix(in srgb, var(--on-surface) 8%, transparent)}.palette-emoji{text-align:center;flex:none;width:24px;font-size:18px;line-height:1}.palette-text{flex-direction:column;flex:1;min-width:0;display:flex}.palette-name{white-space:nowrap;text-overflow:ellipsis;font-size:13.5px;font-weight:500;overflow:hidden}.palette-sub{color:var(--on-surface-variant);white-space:nowrap;text-overflow:ellipsis;font-size:12px;overflow:hidden}.palette-ws{text-overflow:ellipsis;white-space:nowrap;max-width:40%;color:var(--on-surface-variant);flex:none;align-items:center;gap:5px;font-size:11.5px;display:inline-flex;overflow:hidden}.palette-empty{text-align:center;color:var(--on-surface-variant);padding:28px 16px;font-size:13px}.palette-empty a{text-decoration:underline}.palette-foot{border-top:1px solid var(--outline-variant);color:var(--on-surface-variant);align-items:center;gap:14px;padding:8px 14px;font-size:11px;display:flex}.palette-foot span{align-items:center;gap:4px;display:inline-flex}.palette-note{margin-left:auto}.palette-warn{color:var(--error);white-space:nowrap;text-overflow:ellipsis;max-width:60%;margin-left:auto;overflow:hidden}.palette-chip{letter-spacing:.4px;text-transform:uppercase;border:1px solid var(--outline-variant);border-radius:999px;padding:1px 6px;font-size:10px;font-weight:600}@media (width<=1100px){.search-btn .kbd{display:none}}.repos-screen .ws-icon .ms{color:var(--on-surface-variant);font-size:22px}.repo-branch{font-family:var(--mono,ui-monospace, SFMono-Regular, Menlo, monospace);color:var(--on-surface-variant);border:1px solid color-mix(in srgb, var(--outline-variant) 70%, transparent);border-radius:999px;padding:1px 7px;font-size:12px}.repo-row .ws-meta code{font-size:11.5px}.repos-screen .agent-form{max-width:none}.repos-screen .agent-form-row .ws-btn{white-space:nowrap;height:36px}.settings-color-row{align-items:center;gap:6px;display:flex}.settings-color-row input[type=color]{border:1px solid var(--outline-variant);cursor:pointer;background:0 0;border-radius:8px;width:30px;height:30px;padding:2px}.settings-color-row input[type=text],.settings-color-row input:not([type]){flex:1;min-width:0}.chat-split{flex:1;gap:16px;min-height:0;display:flex}.chat-split.open .chat-thread{flex:0 44%;min-width:340px;max-width:none;margin:0}.vibeable-open{margin-left:auto}.vibeable-pane{background:var(--surface-container-low);min-width:0;min-height:0;box-shadow:var(--elev-1);border-radius:16px;flex-direction:column;flex:56%;display:flex;overflow:hidden}.vibeable-bar{border-bottom:1px solid var(--outline-variant);flex:none;align-items:center;gap:8px;min-height:44px;padding:6px 8px 6px 14px;display:flex}.vibeable-bar-icon{color:var(--on-surface-variant)}.vibeable-name{text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:500;overflow:hidden}.vibeable-mode{letter-spacing:.02em;background:var(--surface-container-highest);color:var(--on-surface-variant);white-space:nowrap;border-radius:999px;align-items:center;gap:6px;padding:2px 10px;font-size:11px;font-weight:500;display:inline-flex}.vibeable-mode.failed{color:var(--on-error-container);background:var(--error-container)}.vibeable-flash{color:var(--primary);white-space:nowrap;align-items:center;gap:4px;font-size:11px;animation:2.5s forwards vibeable-fade;display:inline-flex}@keyframes vibeable-fade{0%,60%{opacity:1}to{opacity:0}}.vibeable-bar .icon-btn.active{background:var(--secondary-container);color:var(--on-secondary-container)}.vibeable-play{color:var(--primary)}.vibeable-frame{background:#fff;border:0;flex:1;width:100%;min-height:0;display:block}.vibeable-err{color:var(--on-error-container);background:var(--error-container);flex:none;align-items:center;gap:10px;padding:6px 8px 6px 14px;font-size:12.5px;display:flex}.vibeable-err span{flex:1}.vibeable-err-x{width:28px;height:28px;color:inherit;cursor:pointer;background:0 0;border:0;border-radius:50%;place-items:center;display:grid}.vibeable-err-x:hover{background:color-mix(in srgb, var(--on-error-container) 12%, transparent)}.vibeable-note{color:var(--on-surface-variant);border-bottom:1px solid var(--outline-variant);flex:none;padding:6px 14px;font-size:12px}.vibeable-note code{font-size:11px}.vibeable-log{border-top:1px solid var(--outline-variant);max-height:180px;font-family:var(--font-mono), monospace;white-space:pre-wrap;word-break:break-word;color:var(--on-surface-variant);background:var(--surface-container);flex:none;margin:0;padding:8px 14px;font-size:11.5px;line-height:1.5;overflow:auto}.vibeable-pane .empty{border:0;margin:auto}.vibeable-overlay{z-index:60;background:color-mix(in srgb, var(--scrim,#000) 32%, transparent);justify-content:center;align-items:flex-start;padding-top:12vh;display:flex;position:fixed;inset:0}.vibeable-picker{background:var(--surface-container);width:min(560px,100vw - 32px);max-height:76vh;color:var(--on-surface);box-shadow:var(--elev-3);border-radius:28px;flex-direction:column;padding:20px 24px 22px;display:flex}.vibeable-picker-head{align-items:center;gap:12px;display:flex}.vibeable-picker-head h2{margin:0;font-size:20px;font-weight:400}.vibeable-picker-hint{color:var(--on-surface-variant);margin:8px 0 14px;font-size:13px}.vibeable-picker-off{padding:12px 0;font-size:13.5px}.vibeable-new{gap:10px;margin-bottom:12px;display:flex}.vibeable-new input{border:1px solid var(--outline);background:var(--surface-container-highest);height:40px;color:var(--on-surface);border-radius:12px;flex:1;padding:0 14px;font-size:14px}.vibeable-new input:focus{border-color:var(--primary);outline:0}.vibeable-picker-list{border-top:1px solid var(--outline-variant);flex-direction:column;min-height:0;padding-top:6px;display:flex;overflow-y:auto}.vibeable-picker-empty{color:var(--on-surface-variant);padding:16px 4px;font-size:13px}.vibeable-repo{text-align:left;width:100%;color:inherit;cursor:pointer;font:inherit;background:0 0;border:0;border-radius:12px;align-items:center;gap:14px;padding:10px 8px;display:flex}.vibeable-repo:hover:not(:disabled){background:color-mix(in srgb, var(--on-surface) 8%, transparent)}.vibeable-repo:disabled{opacity:.6;cursor:default}.vibeable-repo-icon{background:var(--secondary-container);width:40px;height:40px;color:var(--on-secondary-container);border-radius:50%;flex:none;place-items:center;display:grid}.vibeable-repo-main{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.vibeable-repo-name{font-size:15px}.vibeable-repo-sub{color:var(--on-surface-variant);text-overflow:ellipsis;white-space:nowrap;font-size:12px;overflow:hidden}.vibeable-repo-go{color:var(--on-surface-variant)}.vibeable-picker-err{margin-top:10px}@media (width<=1100px){.chat-split.open{flex-direction:column}.chat-split.open .chat-thread{flex:none;min-width:0;min-height:50vh}.vibeable-pane{flex:none;min-height:460px}}.vibeables-agent{color:var(--on-surface-variant);align-items:center;gap:8px;font-size:12px;display:inline-flex}.vibeables-agent select{border:1px solid var(--outline-variant);background:var(--surface-container-highest);height:28px;color:var(--on-surface);border-radius:8px;padding:0 8px;font-size:12.5px}.vibeable-when{color:var(--on-surface-variant);font-size:12px}.vibeable-row .ws-icon.vibeable-repo-icon{width:40px;height:40px}.ws-actions a.ws-btn{text-decoration:none}.vibeable-pane-off{flex:none;align-self:flex-start;min-width:320px;max-width:420px}.channels-screen{grid-template-columns:280px minmax(0,1fr)}.channel-head .channel-name{color:var(--on-surface-variant);font-size:15px}.channel-head .spacer{flex:1}.channel-members{flex-wrap:wrap;flex:none;align-items:center;gap:8px 10px;padding:0 0 12px;display:flex}.channel-purpose{width:100%;color:var(--on-surface-variant);font-size:13px;line-height:18px}.member-chip{background:var(--surface-container);color:inherit;border-radius:999px;align-items:center;gap:8px;padding:3px 10px 3px 3px;font-size:13px;text-decoration:none;transition:background .12s;display:inline-flex}.member-chip:hover{background:var(--surface-container-high)}.member-chip.working{background:color-mix(in srgb, var(--primary) 12%, var(--surface-container))}.member-chip .member-handle{color:var(--on-surface-variant);font-family:var(--font-mono), monospace;font-size:11.5px}.member-chip .chip{padding:0 7px;font-size:10px}.turn{display:contents}.byline{color:var(--on-surface-variant);align-items:center;gap:8px;margin:10px 0 -2px;font-size:12.5px;text-decoration:none;display:inline-flex}.byline.human{align-self:flex-end}.byline.agent{align-self:flex-start}.byline-avatar{background:var(--secondary-container);width:22px;height:22px;color:var(--on-secondary-container);border-radius:50%;place-items:center;font-size:12px;font-weight:600;display:grid}.byline.human .byline-avatar{background:var(--primary-container);color:var(--on-primary-container)}.byline-name{color:var(--on-surface);font-weight:600}.byline-handle{font-family:var(--font-mono), monospace;font-size:11px}.channel-thread .composer{flex-wrap:wrap}.composer-me{color:var(--on-surface-variant);flex:0 0 100%;align-items:center;gap:6px;padding:0 4px 2px;font-size:12px;display:flex}.composer-me .me-name{font:inherit;color:var(--on-surface);cursor:pointer;background:0 0;border:0;align-items:center;gap:4px;padding:0;font-weight:600;display:inline-flex}.composer-me input{font:inherit;border:1px solid var(--outline-variant);background:var(--surface-container-highest);color:inherit;border-radius:6px;padding:2px 8px}.coworker-btn{align-items:center;gap:6px;display:inline-flex}.dialog-backdrop{z-index:40;background:color-mix(in srgb, var(--on-surface) 32%, transparent);place-items:center;padding:24px;display:grid;position:fixed;inset:0}.dialog{background:var(--surface-container-high);width:min(560px,100%);max-height:calc(100dvh - 48px);box-shadow:var(--elev-2);border-radius:16px;overflow-y:auto}.dialog .agent-form{padding-top:4px}