@netnodeag/kraftwerk 0.10.0 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/init.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { appendFile, mkdir, readFile, stat, writeFile } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import chalk from "chalk";
4
- import { SCHEMA_URL } from "../config.js";
4
+ import { CONFIG_SCHEMA_URL, SCHEMA_URL } from "../config.js";
5
5
  import { initBundle, writeConcept } from "../okf.js";
6
6
  /**
7
7
  * `kraftwerk init` — make any repository a kraftwerk consumer in one
@@ -11,7 +11,8 @@ import { initBundle, writeConcept } from "../okf.js";
11
11
  * existing files are left untouched and reported.
12
12
  */
13
13
  const DATA_DIR = "kraftwerk-data";
14
- const configTemplate = (name) => `# kraftwerk project config — also marks the project root for the CLI.
14
+ const configTemplate = (name) => `# yaml-language-server: $schema=${CONFIG_SCHEMA_URL}
15
+ # kraftwerk project config — also marks the project root for the CLI.
15
16
  # All fields optional. Docs: https://github.com/NETNODEAG/kraftwerk
16
17
  name: ${JSON.stringify(name)} # display name, shown in the inspector header + browser tab
17
18
  icon: "⚡" # emoji shown as the inspector favicon
package/dist/config.d.ts CHANGED
@@ -19,6 +19,8 @@
19
19
  */
20
20
  /** Stable, versionless URL of the workflow JSON schema (editor validation). */
21
21
  export declare const SCHEMA_URL = "https://raw.githubusercontent.com/NETNODEAG/kraftwerk/main/kraftwerk/schema/workflow.schema.json";
22
+ /** Stable, versionless URL of the kraftwerk.yml JSON schema (editor validation). */
23
+ export declare const CONFIG_SCHEMA_URL = "https://raw.githubusercontent.com/NETNODEAG/kraftwerk/main/kraftwerk/schema/kraftwerk.schema.json";
22
24
  export declare const CONFIG_FILENAMES: string[];
23
25
  export interface ProjectConfig {
24
26
  /** Display name of the project ("environment"), shown in the inspector header. */
package/dist/config.js CHANGED
@@ -22,6 +22,8 @@ import { parse } from "yaml";
22
22
  */
23
23
  /** Stable, versionless URL of the workflow JSON schema (editor validation). */
24
24
  export const SCHEMA_URL = "https://raw.githubusercontent.com/NETNODEAG/kraftwerk/main/kraftwerk/schema/workflow.schema.json";
25
+ /** Stable, versionless URL of the kraftwerk.yml JSON schema (editor validation). */
26
+ export const CONFIG_SCHEMA_URL = "https://raw.githubusercontent.com/NETNODEAG/kraftwerk/main/kraftwerk/schema/kraftwerk.schema.json";
25
27
  export const CONFIG_FILENAMES = ["kraftwerk.yml", "kraftwerk.yaml"];
26
28
  const WORKFLOW_ROOT_CANDIDATES = ["src/workflows", "workflows"];
27
29
  const exists = async (p) => !!(await stat(p).catch(() => null));
@@ -72,7 +72,7 @@ ${u}</tr>
72
72
  `}strong({tokens:u}){return`<strong>${this.parser.parseInline(u)}</strong>`}em({tokens:u}){return`<em>${this.parser.parseInline(u)}</em>`}codespan({text:u}){return`<code>${Rl(u,!0)}</code>`}br(u){return"<br>"}del({tokens:u}){return`<del>${this.parser.parseInline(u)}</del>`}link({href:u,title:s,tokens:o}){let r=this.parser.parseInline(o),d=hm(u);if(d===null)return r;u=d;let h='<a href="'+u+'"';return s&&(h+=' title="'+Rl(s)+'"'),h+=">"+r+"</a>",h}image({href:u,title:s,text:o,tokens:r}){r&&(o=this.parser.parseInline(r,this.parser.textRenderer));let d=hm(u);if(d===null)return Rl(o);u=d;let h=`<img src="${u}" alt="${Rl(o)}"`;return s&&(h+=` title="${Rl(s)}"`),h+=">",h}text(u){return"tokens"in u&&u.tokens?this.parser.parseInline(u.tokens):"escaped"in u&&u.escaped?u.text:Rl(u.text)}},So=class{strong({text:u}){return u}em({text:u}){return u}codespan({text:u}){return u}del({text:u}){return u}html({text:u}){return u}text({text:u}){return u}link({text:u}){return""+u}image({text:u}){return""+u}br(){return""}checkbox({raw:u}){return u}},Sl=class io{options;renderer;textRenderer;constructor(s){this.options=s||da,this.options.renderer=this.options.renderer||new Yc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new So}static parse(s,o){return new io(o).parse(s)}static parseInline(s,o){return new io(o).parseInline(s)}parse(s){this.renderer.parser=this;let o="";for(let r=0;r<s.length;r++){let d=s[r];if(this.options.extensions?.renderers?.[d.type]){let g=d,v=this.options.extensions.renderers[g.type].call({parser:this},g);if(v!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(g.type)){o+=v||"";continue}}let h=d;switch(h.type){case"space":{o+=this.renderer.space(h);break}case"hr":{o+=this.renderer.hr(h);break}case"heading":{o+=this.renderer.heading(h);break}case"code":{o+=this.renderer.code(h);break}case"table":{o+=this.renderer.table(h);break}case"blockquote":{o+=this.renderer.blockquote(h);break}case"list":{o+=this.renderer.list(h);break}case"checkbox":{o+=this.renderer.checkbox(h);break}case"html":{o+=this.renderer.html(h);break}case"def":{o+=this.renderer.def(h);break}case"paragraph":{o+=this.renderer.paragraph(h);break}case"text":{o+=this.renderer.text(h);break}default:{let g='Token with "'+h.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return o}parseInline(s,o=this.renderer){this.renderer.parser=this;let r="";for(let d=0;d<s.length;d++){let h=s[d];if(this.options.extensions?.renderers?.[h.type]){let v=this.options.extensions.renderers[h.type].call({parser:this},h);if(v!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(h.type)){r+=v||"";continue}}let g=h;switch(g.type){case"escape":{r+=o.text(g);break}case"html":{r+=o.html(g);break}case"link":{r+=o.link(g);break}case"image":{r+=o.image(g);break}case"checkbox":{r+=o.checkbox(g);break}case"strong":{r+=o.strong(g);break}case"em":{r+=o.em(g);break}case"codespan":{r+=o.codespan(g);break}case"br":{r+=o.br(g);break}case"del":{r+=o.del(g);break}case"text":{r+=o.text(g);break}default:{let v='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(v),"";throw new Error(v)}}}return r}},ds=class{options;block;constructor(u){this.options=u||da}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(u){return u}postprocess(u){return u}processAllTokens(u){return u}emStrongMask(u){return u}provideLexer(u=this.block){return u?bl.lex:bl.lexInline}provideParser(u=this.block){return u?Sl.parse:Sl.parseInline}},iv=class{defaults=mo();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Sl;Renderer=Yc;TextRenderer=So;Lexer=bl;Tokenizer=qc;Hooks=ds;constructor(...u){this.use(...u)}walkTokens(u,s){let o=[];for(let r of u)switch(o=o.concat(s.call(this,r)),r.type){case"table":{let d=r;for(let h of d.header)o=o.concat(this.walkTokens(h.tokens,s));for(let h of d.rows)for(let g of h)o=o.concat(this.walkTokens(g.tokens,s));break}case"list":{let d=r;o=o.concat(this.walkTokens(d.items,s));break}default:{let d=r;this.defaults.extensions?.childTokens?.[d.type]?this.defaults.extensions.childTokens[d.type].forEach(h=>{let g=d[h].flat(1/0);o=o.concat(this.walkTokens(g,s))}):d.tokens&&(o=o.concat(this.walkTokens(d.tokens,s)))}}return o}use(...u){let s=this.defaults.extensions||{renderers:{},childTokens:{}};return u.forEach(o=>{let r={...o};if(r.async=this.defaults.async||r.async||!1,o.extensions&&(o.extensions.forEach(d=>{if(!d.name)throw new Error("extension name required");if("renderer"in d){let h=s.renderers[d.name];h?s.renderers[d.name]=function(...g){let v=d.renderer.apply(this,g);return v===!1&&(v=h.apply(this,g)),v}:s.renderers[d.name]=d.renderer}if("tokenizer"in d){if(!d.level||d.level!=="block"&&d.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let h=s[d.level];h?h.unshift(d.tokenizer):s[d.level]=[d.tokenizer],d.start&&(d.level==="block"?s.startBlock?s.startBlock.push(d.start):s.startBlock=[d.start]:d.level==="inline"&&(s.startInline?s.startInline.push(d.start):s.startInline=[d.start]))}"childTokens"in d&&d.childTokens&&(s.childTokens[d.name]=d.childTokens)}),r.extensions=s),o.renderer){let d=this.defaults.renderer||new Yc(this.defaults);for(let h in o.renderer){if(!(h in d))throw new Error(`renderer '${h}' does not exist`);if(["options","parser"].includes(h))continue;let g=h,v=o.renderer[g],S=d[g];d[g]=(...y)=>{let z=v.apply(d,y);return z===!1&&(z=S.apply(d,y)),z||""}}r.renderer=d}if(o.tokenizer){let d=this.defaults.tokenizer||new qc(this.defaults);for(let h in o.tokenizer){if(!(h in d))throw new Error(`tokenizer '${h}' does not exist`);if(["options","rules","lexer"].includes(h))continue;let g=h,v=o.tokenizer[g],S=d[g];d[g]=(...y)=>{let z=v.apply(d,y);return z===!1&&(z=S.apply(d,y)),z}}r.tokenizer=d}if(o.hooks){let d=this.defaults.hooks||new ds;for(let h in o.hooks){if(!(h in d))throw new Error(`hook '${h}' does not exist`);if(["options","block"].includes(h))continue;let g=h,v=o.hooks[g],S=d[g];ds.passThroughHooks.has(h)?d[g]=y=>{if(this.defaults.async&&ds.passThroughHooksRespectAsync.has(h))return(async()=>{let O=await v.call(d,y);return S.call(d,O)})();let z=v.call(d,y);return S.call(d,z)}:d[g]=(...y)=>{if(this.defaults.async)return(async()=>{let O=await v.apply(d,y);return O===!1&&(O=await S.apply(d,y)),O})();let z=v.apply(d,y);return z===!1&&(z=S.apply(d,y)),z}}r.hooks=d}if(o.walkTokens){let d=this.defaults.walkTokens,h=o.walkTokens;r.walkTokens=function(g){let v=[];return v.push(h.call(this,g)),d&&(v=v.concat(d.call(this,g))),v}}this.defaults={...this.defaults,...r}}),this}setOptions(u){return this.defaults={...this.defaults,...u},this}lexer(u,s){return bl.lex(u,s??this.defaults)}parser(u,s){return Sl.parse(u,s??this.defaults)}parseMarkdown(u){return(s,o)=>{let r={...o},d={...this.defaults,...r},h=this.onError(!!d.silent,!!d.async);if(this.defaults.async===!0&&r.async===!1)return h(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return h(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return h(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));if(d.hooks&&(d.hooks.options=d,d.hooks.block=u),d.async)return(async()=>{let g=d.hooks?await d.hooks.preprocess(s):s,v=await(d.hooks?await d.hooks.provideLexer(u):u?bl.lex:bl.lexInline)(g,d),S=d.hooks?await d.hooks.processAllTokens(v):v;d.walkTokens&&await Promise.all(this.walkTokens(S,d.walkTokens));let y=await(d.hooks?await d.hooks.provideParser(u):u?Sl.parse:Sl.parseInline)(S,d);return d.hooks?await d.hooks.postprocess(y):y})().catch(h);try{d.hooks&&(s=d.hooks.preprocess(s));let g=(d.hooks?d.hooks.provideLexer(u):u?bl.lex:bl.lexInline)(s,d);d.hooks&&(g=d.hooks.processAllTokens(g)),d.walkTokens&&this.walkTokens(g,d.walkTokens);let v=(d.hooks?d.hooks.provideParser(u):u?Sl.parse:Sl.parseInline)(g,d);return d.hooks&&(v=d.hooks.postprocess(v)),v}catch(g){return h(g)}}}onError(u,s){return o=>{if(o.message+=`
73
73
  Please report this to https://github.com/markedjs/marked.`,u){let r="<p>An error occurred:</p><pre>"+Rl(o.message+"",!0)+"</pre>";return s?Promise.resolve(r):r}if(s)return Promise.reject(o);throw o}}},fa=new iv;function _e(u,s){return fa.parse(u,s)}_e.options=_e.setOptions=function(u){return fa.setOptions(u),_e.defaults=fa.defaults,Mm(_e.defaults),_e};_e.getDefaults=mo;_e.defaults=da;function sv(...u){return fa.use(...u),_e.defaults=fa.defaults,Mm(_e.defaults),_e}_e.use=sv;_e.walkTokens=function(u,s){return fa.walkTokens(u,s)};_e.parseInline=fa.parseInline;_e.Parser=Sl;_e.parser=Sl.parse;_e.Renderer=Yc;_e.TextRenderer=So;_e.Lexer=bl;_e.lexer=bl.lex;_e.Tokenizer=qc;_e.Hooks=ds;_e.parse=_e;_e.options;_e.setOptions;_e.walkTokens;_e.parseInline;Sl.parse;bl.lex;function ym(u,s){(s==null||s>u.length)&&(s=u.length);for(var o=0,r=Array(s);o<s;o++)r[o]=u[o];return r}function cv(u){if(Array.isArray(u))return u}function uv(u,s){var o=u==null?null:typeof Symbol<"u"&&u[Symbol.iterator]||u["@@iterator"];if(o!=null){var r,d,h,g,v=[],S=!0,y=!1;try{if(h=(o=o.call(u)).next,s!==0)for(;!(S=(r=h.call(o)).done)&&(v.push(r.value),v.length!==s);S=!0);}catch(z){y=!0,d=z}finally{try{if(!S&&o.return!=null&&(g=o.return(),Object(g)!==g))return}finally{if(y)throw d}}return v}}function rv(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
74
74
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ov(u,s){return cv(u)||uv(u,s)||fv(u,s)||rv()}function fv(u,s){if(u){if(typeof u=="string")return ym(u,s);var o={}.toString.call(u).slice(8,-1);return o==="Object"&&u.constructor&&(o=u.constructor.name),o==="Map"||o==="Set"?Array.from(u):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?ym(u,s):void 0}}const Zm=Object.entries,vm=Object.setPrototypeOf,dv=Object.isFrozen,hv=Object.getPrototypeOf,mv=Object.getOwnPropertyDescriptor;let st=Object.freeze,ot=Object.seal,Pa=Object.create,$m=typeof Reflect<"u"&&Reflect,so=$m.apply,co=$m.construct;st||(st=function(s){return s});ot||(ot=function(s){return s});so||(so=function(s,o){for(var r=arguments.length,d=new Array(r>2?r-2:0),h=2;h<r;h++)d[h-2]=arguments[h];return s.apply(o,d)});co||(co=function(s){for(var o=arguments.length,r=new Array(o>1?o-1:0),d=1;d<o;d++)r[d-1]=arguments[d];return new s(...r)});const ra=lt(Array.prototype.forEach),pv=lt(Array.prototype.lastIndexOf),xm=lt(Array.prototype.pop),rs=lt(Array.prototype.push),gv=lt(Array.prototype.splice),ei=Array.isArray,hs=lt(String.prototype.toLowerCase),Fr=lt(String.prototype.toString),bm=lt(String.prototype.match),os=lt(String.prototype.replace),Sm=lt(String.prototype.indexOf),yv=lt(String.prototype.trim),vv=lt(Number.prototype.toString),xv=lt(Boolean.prototype.toString),jm=typeof BigInt>"u"?null:lt(BigInt.prototype.toString),Nm=typeof Symbol>"u"?null:lt(Symbol.prototype.toString),Ut=lt(Object.prototype.hasOwnProperty),fs=lt(Object.prototype.toString),Tt=lt(RegExp.prototype.test),ua=bv(TypeError);function lt(u){return function(s){s instanceof RegExp&&(s.lastIndex=0);for(var o=arguments.length,r=new Array(o>1?o-1:0),d=1;d<o;d++)r[d-1]=arguments[d];return so(u,s,r)}}function bv(u){return function(){for(var s=arguments.length,o=new Array(s),r=0;r<s;r++)o[r]=arguments[r];return co(u,o)}}function ve(u,s){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:hs;if(vm&&vm(u,null),!ei(s))return u;let r=s.length;for(;r--;){let d=s[r];if(typeof d=="string"){const h=o(d);h!==d&&(dv(s)||(s[r]=h),d=h)}u[d]=!0}return u}function Sv(u){for(let s=0;s<u.length;s++)Ut(u,s)||(u[s]=null);return u}function Jt(u){const s=Pa(null);for(const r of Zm(u)){var o=ov(r,2);const d=o[0],h=o[1];Ut(u,d)&&(ei(h)?s[d]=Sv(h):h&&typeof h=="object"&&h.constructor===Object?s[d]=Jt(h):s[d]=h)}return s}function jv(u){switch(typeof u){case"string":return u;case"number":return vv(u);case"boolean":return xv(u);case"bigint":return jm?jm(u):"0";case"symbol":return Nm?Nm(u):"Symbol()";case"undefined":return fs(u);case"function":case"object":{if(u===null)return fs(u);const s=u,o=xl(s,"toString");if(typeof o=="function"){const r=o(s);return typeof r=="string"?r:fs(r)}return fs(u)}default:return fs(u)}}function xl(u,s){for(;u!==null;){const r=mv(u,s);if(r){if(r.get)return lt(r.get);if(typeof r.value=="function")return lt(r.value)}u=hv(u)}function o(){return null}return o}function Nv(u){try{return Tt(u,""),!0}catch{return!1}}const Tm=st(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ir=st(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Pr=st(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Tv=st(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),eo=st(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ev=st(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Em=st(["#text"]),Am=st(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),to=st(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),_m=st(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Hc=st(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Av=ot(/{{[\w\W]*|^[\w\W]*}}/g),_v=ot(/<%[\w\W]*|^[\w\W]*%>/g),wv=ot(/\${[\w\W]*/g),kv=ot(/^data-[\-\w.\u00B7-\uFFFF]+$/),zv=ot(/^aria-[\-\w]+$/),wm=ot(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Rv=ot(/^(?:\w+script|data):/i),Ov=ot(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Dv=ot(/^html$/i),Cv=ot(/^[a-z][.\w]*(-[.\w]+)+$/i),km=ot(/<[/\w!]/g),zm=ot(/<[/\w]/g),Mv=ot(/<\/no(script|embed|frames)/i),Uv=ot(/\/>/i),Kt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Vm=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Hv=st(ve({},Vm)),Lv=(function(){const u={};return ra(Vm,s=>{u[s]=ot(new RegExp("</"+s+"(?=[\\t\\n\\f\\r />])","i"))}),st(u)})(),Bv=function(){return typeof window>"u"?null:window},qv=function(s,o){if(typeof s!="object"||typeof s.createPolicy!="function")return null;let r=null;const d="data-tt-policy-suffix";o&&o.hasAttribute(d)&&(r=o.getAttribute(d));const h="dompurify"+(r?"#"+r:"");try{return s.createPolicy(h,{createHTML(g){return g},createScriptURL(g){return g}})}catch{return console.warn("TrustedTypes policy "+h+" could not be created."),null}},Rm=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Mn=function(s,o,r,d){return Ut(s,o)&&ei(s[o])?ve(d.base?Jt(d.base):{},s[o],d.transform):r},lo=function(s,o,r){const d=Ut(s,o)?s[o]:void 0;return d&&typeof d=="object"?Jt(d):r()};function Km(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bv();const s=B=>Km(B);if(s.version="3.4.14",s.removed=[],!u||!u.document||u.document.nodeType!==Kt.document||!u.Element)return s.isSupported=!1,s;let o=u.document;const r=o,d=r.currentScript;u.DocumentFragment;const h=u.HTMLTemplateElement,g=u.Node,v=u.Element,S=u.NodeFilter,y=u.NamedNodeMap;y===void 0&&(u.NamedNodeMap||u.MozNamedAttrMap),u.HTMLFormElement;const z=u.DOMParser,O=u.trustedTypes,k=v.prototype,le=xl(k,"cloneNode"),Q=xl(k,"remove"),J=xl(k,"nextSibling"),W=xl(k,"childNodes"),R=xl(k,"parentNode"),Te=xl(k,"shadowRoot"),P=xl(k,"attributes"),ae=g&&g.prototype?xl(g.prototype,"nodeType"):null,se=g&&g.prototype?xl(g.prototype,"nodeName"):null,G=g&&g.prototype?xl(g.prototype,"ownerDocument"):null,I=function(p){return ae?ae(p):p.nodeType},He=function(p){return se?se(p):p.nodeName};if(typeof h=="function"){const B=o.createElement("template");B.content&&B.content.ownerDocument&&(o=B.content.ownerDocument)}let Le,wt="",kt,ft=!1,Ht=0;const Wt=function(){if(Ht>0)throw ua('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ct=function(p){Wt(),Ht++;try{return Le.createHTML(p)}finally{Ht--}},C=function(p){Wt(),Ht++;try{return Le.createScriptURL(p)}finally{Ht--}},X=function(){return ft||(kt=qv(O,d),ft=!0),kt},ne=o,xe=ne.implementation,Ae=ne.createNodeIterator,j=ne.createDocumentFragment,H=ne.getElementsByTagName,Z=r.importNode;let Y=Rm();s.isSupported=typeof Zm=="function"&&typeof R=="function"&&xe&&xe.createHTMLDocument!==void 0;const ce=Av,fe=_v,be=wv,dt=kv,Xe=zv,Hn=Rv,Ln=Ov,ai=Cv;let ii=wm,Se=null;const Bn=ve({},[...Tm,...Ir,...Pr,...eo,...Em]);let Re=null;const si=ve({},[...Am,...to,..._m,...Hc]);let Lt=Object.seal(Pa(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ol=null,ha=null;const Ft=Object.seal(Pa(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ys=!0,ci=!0,St=!1,vs=!0,fl=!1,jl=!0,It=!1,ui=!1,qn=null,ma=null,ri=!1,Pt=!1,ut=!1,Bt=!1,jt=!0,xs=!1;const bs="user-content-";let oi=!0,tn=!1,dl={},hl=null;const Nl=ve({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Yn=null;const ln=ve({},["audio","video","img","source","image","track"]);let Ss=null;const fi=ve({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nn="http://www.w3.org/1998/Math/MathML",Tl="http://www.w3.org/2000/svg",el="http://www.w3.org/1999/xhtml";let Dl=el,pa=!1,ga=null;const di=ve({},[nn,Tl,el],Fr),ya=st(["mi","mo","mn","ms","mtext"]);let va=ve({},ya);const hi=st(["annotation-xml"]);let tl=ve({},hi);const nt=ve({},["title","style","font","a","script"]);let Je=null;const an=["application/xhtml+xml","text/html"],mi="text/html";let Qe=null,sn=null;const js=o.createElement("form"),cn=function(p){return p instanceof RegExp||p instanceof Function},Gn=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(sn&&sn===p)return;(!p||typeof p!="object")&&(p={}),p=Jt(p),Je=an.indexOf(p.PARSER_MEDIA_TYPE)===-1?mi:p.PARSER_MEDIA_TYPE,Qe=Je==="application/xhtml+xml"?Fr:hs,Se=Mn(p,"ALLOWED_TAGS",Bn,{transform:Qe}),Re=Mn(p,"ALLOWED_ATTR",si,{transform:Qe}),ga=Mn(p,"ALLOWED_NAMESPACES",di,{transform:Fr}),Ss=Mn(p,"ADD_URI_SAFE_ATTR",fi,{transform:Qe,base:fi}),Yn=Mn(p,"ADD_DATA_URI_TAGS",ln,{transform:Qe,base:ln}),hl=Mn(p,"FORBID_CONTENTS",Nl,{transform:Qe}),Ol=Mn(p,"FORBID_TAGS",Jt({}),{transform:Qe}),ha=Mn(p,"FORBID_ATTR",Jt({}),{transform:Qe}),dl=Ut(p,"USE_PROFILES")?p.USE_PROFILES&&typeof p.USE_PROFILES=="object"?Jt(p.USE_PROFILES):p.USE_PROFILES:!1,ys=p.ALLOW_ARIA_ATTR!==!1,ci=p.ALLOW_DATA_ATTR!==!1,St=p.ALLOW_UNKNOWN_PROTOCOLS||!1,vs=p.ALLOW_SELF_CLOSE_IN_ATTR!==!1,fl=p.SAFE_FOR_TEMPLATES||!1,jl=p.SAFE_FOR_XML!==!1,It=p.WHOLE_DOCUMENT||!1,Pt=p.RETURN_DOM||!1,ut=p.RETURN_DOM_FRAGMENT||!1,Bt=p.RETURN_TRUSTED_TYPE||!1,ri=p.FORCE_BODY||!1,jt=p.SANITIZE_DOM!==!1,xs=p.SANITIZE_NAMED_PROPS||!1,oi=p.KEEP_CONTENT!==!1,tn=p.IN_PLACE||!1,ii=Nv(p.ALLOWED_URI_REGEXP)?p.ALLOWED_URI_REGEXP:wm,Dl=typeof p.NAMESPACE=="string"?p.NAMESPACE:el,va=lo(p,"MATHML_TEXT_INTEGRATION_POINTS",()=>ve({},ya)),tl=lo(p,"HTML_INTEGRATION_POINTS",()=>ve({},hi));const N=lo(p,"CUSTOM_ELEMENT_HANDLING",()=>Pa(null));if(Lt=Pa(null),Ut(N,"tagNameCheck")&&cn(N.tagNameCheck)&&(Lt.tagNameCheck=N.tagNameCheck),Ut(N,"attributeNameCheck")&&cn(N.attributeNameCheck)&&(Lt.attributeNameCheck=N.attributeNameCheck),Ut(N,"allowCustomizedBuiltInElements")&&typeof N.allowCustomizedBuiltInElements=="boolean"&&(Lt.allowCustomizedBuiltInElements=N.allowCustomizedBuiltInElements),ot(Lt),fl&&(ci=!1),ut&&(Pt=!0),dl&&(Se=ve({},Em),Re=Pa(null),dl.html===!0&&(ve(Se,Tm),ve(Re,Am)),dl.svg===!0&&(ve(Se,Ir),ve(Re,to),ve(Re,Hc)),dl.svgFilters===!0&&(ve(Se,Pr),ve(Re,to),ve(Re,Hc)),dl.mathMl===!0&&(ve(Se,eo),ve(Re,_m),ve(Re,Hc))),Ft.tagCheck=null,Ft.attributeCheck=null,Ut(p,"ADD_TAGS")&&(typeof p.ADD_TAGS=="function"?Ft.tagCheck=p.ADD_TAGS:ei(p.ADD_TAGS)&&(Se===Bn&&(Se=Jt(Se)),ve(Se,p.ADD_TAGS,Qe))),Ut(p,"ADD_ATTR")&&(typeof p.ADD_ATTR=="function"?Ft.attributeCheck=p.ADD_ATTR:ei(p.ADD_ATTR)&&(Re===si&&(Re=Jt(Re)),ve(Re,p.ADD_ATTR,Qe))),Ut(p,"ADD_FORBID_CONTENTS")&&ei(p.ADD_FORBID_CONTENTS)&&(hl===Nl&&(hl=Jt(hl)),ve(hl,p.ADD_FORBID_CONTENTS,Qe)),oi&&(Se["#text"]=!0),It&&ve(Se,["html","head","body"]),Se.table&&(ve(Se,["tbody"]),delete Ol.tbody),p.TRUSTED_TYPES_POLICY){if(typeof p.TRUSTED_TYPES_POLICY.createHTML!="function")throw ua('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof p.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ua('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const L=Le;Le=p.TRUSTED_TYPES_POLICY;try{wt=ct("")}catch($){throw Le=L,$}}else p.TRUSTED_TYPES_POLICY===null?(Le=void 0,wt=""):(Le===void 0&&(Le=X()),Le&&typeof wt=="string"&&(wt=ct("")));st&&st(p),sn=p},Cl=ve({},[...Ir,...Pr,...Tv]),Ml=ve({},[...eo,...Ev]),Xn=function(p,N,L){return N.namespaceURI===el?p==="svg":N.namespaceURI===nn?p==="svg"&&(L==="annotation-xml"||va[L]):!!Cl[p]},un=function(p,N,L){return N.namespaceURI===el?p==="math":N.namespaceURI===Tl?p==="math"&&tl[L]:!!Ml[p]},We=function(p,N,L){return N.namespaceURI===Tl&&!tl[L]||N.namespaceURI===nn&&!va[L]?!1:!Ml[p]&&(nt[p]||!Cl[p])},Ns=function(p){let N=R(p);(!N||!N.tagName)&&(N={namespaceURI:Dl,tagName:"template"});const L=hs(p.tagName),$=hs(N.tagName);return ga[p.namespaceURI]?p.namespaceURI===Tl?Xn(L,N,$):p.namespaceURI===nn?un(L,N,$):p.namespaceURI===el?We(L,N,$):!!(Je==="application/xhtml+xml"&&ga[p.namespaceURI]):!1},ml=function(p){rs(s.removed,{element:p});try{R(p).removeChild(p)}catch{if(Q(p),!R(p))throw ua("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},El=function(p,N,L){try{p.removeAttributeNode(N)}catch{try{p.removeAttribute(L)}catch{}}},pl=function(p){Qn(p);const N=W(p);if(N){const $=[];ra(N,V=>{rs($,V)}),ra($,V=>{try{Q(V)}catch{}})}const L=P(p);if(L)for(let $=L.length-1;$>=0;--$){const V=L[$],te=V&&V.name;typeof te=="string"&&El(p,V,te)}},Ul=function(p,N,L){if(!L)try{L=N.getAttributeNode(p)}catch{L=null}rs(s.removed,{attribute:L||null,from:N});try{L?N.removeAttributeNode(L):N.removeAttribute(p)}catch{try{N.removeAttribute(p)}catch{}}if(p==="is")if(Pt||ut)try{ml(N)}catch{}else try{N.setAttribute(p,"")}catch{}},Ts=function(p){const N=P(p);if(N)for(let L=N.length-1;L>=0;--L){const $=N[L],V=$&&$.name;typeof V!="string"||Re[Qe(V)]||El(p,$,V)}},Qn=function(p){const N=[p];for(;N.length>0;){const L=N.pop();I(L)===Kt.element&&Ts(L);const V=W(L);if(V)for(let te=V.length-1;te>=0;--te)N.push(V[te])}},Es=function(p,N){return jl?p==="patchsrc"?!0:p==="for"&&N!=="label"&&N!=="output":!1},xa=function(p){if(!jl)return;const N=[p];for(;N.length>0;){const L=N.pop(),$=I(L);if($===Kt.processingInstruction||$===Kt.comment&&Tt(zm,L.data)){try{Q(L)}catch{}continue}if($===Kt.element){const te=L,we=Qe(He(L));try{te.hasAttribute&&te.hasAttribute("patchsrc")&&te.removeAttribute("patchsrc"),te.hasAttribute&&te.hasAttribute("for")&&Es("for",we)&&te.removeAttribute("for")}catch{}}const V=W(L);if(V)for(let te=V.length-1;te>=0;--te)N.push(V[te])}},Zn=function(p){let N=null,L=null;if(ri)p="<remove></remove>"+p;else{const te=bm(p,/^[\r\n\t ]+/);L=te&&te[0]}Je==="application/xhtml+xml"&&Dl===el&&(p='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+p+"</body></html>");const $=Le?ct(p):p;if(Dl===el)try{N=new z().parseFromString($,Je)}catch{}if(!N||!N.documentElement){N=xe.createDocument(Dl,"template",null);try{N.documentElement.innerHTML=pa?wt:$}catch{}}const V=N.body||N.documentElement;return p&&L&&V.insertBefore(o.createTextNode(L),V.childNodes[0]||null),Dl===el?H.call(N,It?"html":"body")[0]:It?N.documentElement:V},ll=function(p){const N=G?G(p):p.ownerDocument;return Ae.call(N||p,p,S.SHOW_ELEMENT|S.SHOW_COMMENT|S.SHOW_TEXT|S.SHOW_PROCESSING_INSTRUCTION|S.SHOW_CDATA_SECTION,null)},ht=function(p){return p=os(p,ce," "),p=os(p,fe," "),p=os(p,be," "),p},ba=function(p){var N;p.normalize();const L=G?G(p):p.ownerDocument,$=Ae.call(L||p,p,S.SHOW_TEXT|S.SHOW_COMMENT|S.SHOW_CDATA_SECTION|S.SHOW_PROCESSING_INSTRUCTION,null);let V=$.nextNode();for(;V;)V.data=ht(V.data),V=$.nextNode();const te=(N=p.querySelectorAll)===null||N===void 0?void 0:N.call(p,"template");te&&ra(te,we=>{Al(we.content)&&ba(we.content)})},Sa=function(p){const N=se?se(p):null;return typeof N!="string"||Qe(N)!=="form"?!1:typeof p.nodeName!="string"||typeof p.textContent!="string"||typeof p.removeChild!="function"||p.attributes!==P(p)||typeof p.removeAttribute!="function"||typeof p.setAttribute!="function"||typeof p.namespaceURI!="string"||typeof p.insertBefore!="function"||typeof p.hasChildNodes!="function"||p.nodeType!==ae(p)||p.childNodes!==W(p)},Al=function(p){if(!ae||typeof p!="object"||p===null)return!1;try{return ae(p)===Kt.documentFragment}catch{return!1}},rn=function(p){if(!ae||typeof p!="object"||p===null)return!1;try{return typeof ae(p)=="number"}catch{return!1}};function At(B,p,N){B.length!==0&&ra(B,L=>{L.call(s,p,N,sn)})}const Qc=function(p,N){return!!(jl&&p.hasChildNodes()&&!rn(p.firstElementChild)&&Tt(km,p.textContent)&&Tt(km,p.innerHTML)||jl&&p.namespaceURI===el&&Hv[N]&&(rn(p.firstElementChild)||typeof p.textContent=="string"&&Tt(Lv[N],p.textContent))||p.nodeType===Kt.processingInstruction||jl&&p.nodeType===Kt.comment&&Tt(zm,p.data))},mt=function(p,N){if(p instanceof RegExp)return Tt(p,N);if(p instanceof Function){for(var L=arguments.length,$=new Array(L>2?L-2:0),V=2;V<L;V++)$[V-2]=arguments[V];return!!p(N,...$)}return!1},pi=function(p,N,L){if(!Ol[N]&&Ll(N)&&mt(Lt.tagNameCheck,N))return!1;if(oi&&!hl[N]){const $=R(p),V=W(p);if(V&&$){const te=V.length;for(let we=te-1;we>=0;--we){const Me=p===L?le(V[we],!0):V[we];$.insertBefore(Me,J(p))}}}return ml(p),!0},gi=function(p,N,L,$){return p.length===0?N:N===L||N===$?Jt(N):N},ja=function(p,N){return p===N||R(p)!==null?!1:(tn&&Qn(p),!0)},Hl=function(p,N){if(At(Y.beforeSanitizeElements,p,null),ja(p,N))return!0;if(Sa(p))return ml(p),!0;const L=Qe(He(p));if(Se=gi(Y.uponSanitizeElement,Se,Bn,qn),At(Y.uponSanitizeElement,p,{tagName:L,allowedTags:Se}),ja(p,N))return!0;if(Qc(p,L))return ml(p),!0;if(Ol[L]||!(Ft.tagCheck instanceof Function&&Ft.tagCheck(L))&&!Se[L]){const V=pi(p,L,N);return V===!1&&At(Y.afterSanitizeElements,p,null),V}if(I(p)===Kt.element&&!Ns(p)||(L==="noscript"||L==="noembed"||L==="noframes")&&Tt(Mv,p.innerHTML))return ml(p),!0;if(fl&&p.nodeType===Kt.text){const V=ht(p.textContent);p.textContent!==V&&(rs(s.removed,{element:p.cloneNode()}),p.textContent=V)}return At(Y.afterSanitizeElements,p,null),!1},yi=function(p,N,L){if(ha[N]||Es(N,p)||jt&&(N==="id"||N==="name")&&(L in o||L in js))return!1;const $=Re[N]||Ft.attributeCheck instanceof Function&&Ft.attributeCheck(N,p);return ci&&Tt(dt,N)||ys&&Tt(Xe,N)?!0:$?Ss[N]||Tt(ii,os(L,Ln,""))||(N==="src"||N==="xlink:href"||N==="href")&&p!=="script"&&Sm(L,"data:")===0&&Yn[p]||St&&!Tt(Hn,os(L,Ln,""))?!0:!L:Ll(p)&&mt(Lt.tagNameCheck,p)&&mt(Lt.attributeNameCheck,N,p)||N==="is"&&Lt.allowCustomizedBuiltInElements&&mt(Lt.tagNameCheck,L)},As=ve({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ll=function(p){return!As[hs(p)]&&Tt(ai,p)},Zc=function(p,N,L,$){if(Le&&typeof O=="object"&&typeof O.getAttributeType=="function"&&!L)switch(O.getAttributeType(p,N)){case"TrustedHTML":return ct($);case"TrustedScriptURL":return C($)}return $},_s=function(p,N,L,$){try{L?p.setAttributeNS(L,N,$):p.setAttribute(N,$),Sa(p)?ml(p):xm(s.removed)}catch{Ul(N,p)}},vi=function(p){At(Y.beforeSanitizeAttributes,p,null);const N=p.attributes;if(!N||Sa(p))return;Re=gi(Y.uponSanitizeAttribute,Re,si,ma);const L={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Re,forceKeepAttr:void 0};let $=N.length;const V=Qe(p.nodeName);for(;$--;){const te=N[$],we=te.name,Me=te.namespaceURI,pt=te.value,Fe=Qe(we),qt=pt;let at=we==="value"?qt:yv(qt);if(L.attrName=Fe,L.attrValue=at,L.keepAttr=!0,L.forceKeepAttr=void 0,At(Y.uponSanitizeAttribute,p,L),at=L.attrValue,xs&&(Fe==="id"||Fe==="name")&&Sm(at,bs)!==0&&(Ul(we,p,te),at=bs+at),jl&&Tt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,at)){Ul(we,p,te);continue}if(Fe==="attributename"&&bm(at,"href")){Ul(we,p,te);continue}if(!L.forceKeepAttr){if(!L.keepAttr){Ul(we,p,te);continue}if(!vs&&Tt(Uv,at)){Ul(we,p,te);continue}if(fl&&(at=ht(at)),!yi(V,Fe,at)){Ul(we,p,te);continue}at=Zc(V,Fe,Me,at),at!==qt&&_s(p,we,Me,at)}}At(Y.afterSanitizeAttributes,p,null)},on=function(p){let N=null;const L=ll(p);for(At(Y.beforeSanitizeShadowDOM,p,null);N=L.nextNode();)if(At(Y.uponSanitizeShadowNode,N,null),Hl(N,p),vi(N),Al(N.content)&&on(N.content),I(N)===Kt.element){const $=Te(N);Al($)&&(xi($),on($))}At(Y.afterSanitizeShadowDOM,p,null)},xi=function(p){const N=[{node:p,shadow:null}];for(;N.length>0;){const L=N.pop();if(L.shadow){on(L.shadow);continue}const $=L.node,te=I($)===Kt.element,we=W($);if(we)for(let Me=we.length-1;Me>=0;--Me)N.push({node:we[Me],shadow:null});if(te){const Me=se?se($):null;if(typeof Me=="string"&&Qe(Me)==="template"){const pt=$.content;Al(pt)&&N.push({node:pt,shadow:null})}}if(te){const Me=Te($);Al(Me)&&N.push({node:null,shadow:Me},{node:Me,shadow:null})}}};return s.sanitize=function(B){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},N=null,L=null,$=null,V=null;if(pa=!B,pa&&(B="<!-->"),typeof B!="string"&&!rn(B)&&(B=jv(B),typeof B!="string"))throw ua("dirty is not a string, aborting");if(!s.isSupported)return B;ui?(Se=qn,Re=ma):Gn(p),(Y.uponSanitizeElement.length>0||Y.uponSanitizeAttribute.length>0)&&(Se=Jt(Se)),Y.uponSanitizeAttribute.length>0&&(Re=Jt(Re)),s.removed=[];const te=tn&&typeof B!="string"&&rn(B);if(te){xa(B);const pt=He(B);if(typeof pt=="string"){const Fe=Qe(pt);if(!Se[Fe]||Ol[Fe])throw pl(B),ua("root node is forbidden and cannot be sanitized in-place")}if(Sa(B))throw pl(B),ua("root node is clobbered and cannot be sanitized in-place");try{xi(B)}catch(Fe){throw pl(B),Fe}}else if(rn(B))N=Zn("<!---->"),L=N.ownerDocument.importNode(B,!0),L.nodeType===Kt.element&&L.nodeName==="BODY"||L.nodeName==="HTML"?N=L:N.appendChild(L),xi(L);else{if(!Pt&&!fl&&!It&&B.indexOf("<")===-1)return Le&&Bt?ct(B):B;if(N=Zn(B),!N)return Pt?null:Bt?wt:""}N&&ri&&ml(N.firstChild);const we=te?B:N;try{const pt=ll(we);for(;$=pt.nextNode();)Hl($,we),vi($),Al($.content)&&on($.content)}catch(pt){throw te&&(pl(B),ra(s.removed,Fe=>{Fe.element&&Qn(Fe.element)})),pt}if(te)return ra(s.removed,pt=>{pt.element&&Qn(pt.element)}),fl&&ba(B),B;if(Pt){if(fl&&ba(N),ut)for(V=j.call(N.ownerDocument);N.firstChild;)V.appendChild(N.firstChild);else V=N;return(Re.shadowroot||Re.shadowrootmode)&&(V=Z.call(r,V,!0)),V}let Me=It?N.outerHTML:N.innerHTML;return It&&Se["!doctype"]&&N.ownerDocument&&N.ownerDocument.doctype&&N.ownerDocument.doctype.name&&Tt(Dv,N.ownerDocument.doctype.name)&&(Me="<!DOCTYPE "+N.ownerDocument.doctype.name+`>
75
- `+Me),fl&&(Me=ht(Me)),Le&&Bt?ct(Me):Me},s.setConfig=function(){let B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Gn(B),ui=!0,qn=Se,ma=Re},s.clearConfig=function(){sn=null,ui=!1,qn=null,ma=null,Le=kt,wt=""},s.isValidAttribute=function(B,p,N){sn||Gn({});const L=Qe(B),$=Qe(p);return yi(L,$,N)},s.addHook=function(B,p){typeof p=="function"&&Ut(Y,B)&&rs(Y[B],p)},s.removeHook=function(B,p){if(Ut(Y,B)){if(p!==void 0){const N=pv(Y[B],p);return N===-1?void 0:gv(Y[B],N,1)[0]}return xm(Y[B])}},s.removeHooks=function(B){Ut(Y,B)&&(Y[B]=[])},s.removeAllHooks=function(){Y=Rm()},s}var jo=Km();const Yv=[{id:"claude",label:"claude",hint:"Claude Code via ACP"},{id:"codex",label:"codex",hint:"Codex (ChatGPT) via ACP"},{id:"pi",label:"pi",hint:"pi coding agent"}];function Gv({id:u}){const s=bt("/api/chats",!1),o=(s?.chats??[]).filter(r=>r.scope.kind!=="team");return c.jsxs("div",{className:"runs-screen",children:[c.jsxs("aside",{className:"runs-side",children:[c.jsxs("div",{className:"side-head",children:[c.jsx("span",{className:"microlabel",children:"chats"}),c.jsx("span",{className:"spacer"}),c.jsx(Ye,{href:"/chats",className:"open-raw",children:"+ new"})]}),c.jsxs("div",{className:"side-list",children:[o.map(r=>c.jsxs(Ye,{href:`/chats/${r.id}`,className:`side-row ${r.id===u?"active":""}`,children:[c.jsx("span",{className:`lamp ${r.busy?"running":"pending"}`}),c.jsxs("div",{className:"side-row-body",children:[c.jsxs("div",{className:"side-row-top",children:[c.jsx("span",{className:"side-wf",children:r.title||"new chat"}),c.jsx("span",{className:"side-when num",children:ti(r.updatedAt)})]}),c.jsx("div",{className:"side-row-sub",children:c.jsxs("span",{className:"side-req",children:[r.agent,r.scope.kind==="run"?` · ${r.scope.runId}`:r.scope.kind==="kraftwerk"?" · kraftwerk":r.scope.kind==="knowledge"?` · knowledge${r.scope.bundle?`:${r.scope.bundle}`:""}`:""]})})]})]},r.id)),s&&o.length===0&&c.jsx("div",{className:"viewer-note",children:"no chats yet"})]})]}),c.jsx("div",{className:"runs-main chat-main",children:u?c.jsx(Jm,{id:u},u):c.jsx(Xv,{})})]})}async function ni(u,s){const r=await(await fetch("/api/chats",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({agent:u,scope:s})})).json();r.id&&Un(r.scope?.kind==="team"?`/team/${encodeURIComponent(r.scope.member)}/chat/${r.id}`:`/chats/${r.id}`)}function Xv(){const[u,s]=q.useState("claude"),[o,r]=q.useState(!0),[d,h]=q.useState(!1);return c.jsxs("div",{className:"new-chat",children:[c.jsx("div",{className:"page-head",children:c.jsx("h1",{children:"new chat"})}),c.jsxs("section",{className:"panel new-chat-panel",children:[c.jsx("div",{className:"panel-head",children:c.jsx("span",{className:"microlabel",children:"agent"})}),c.jsx("div",{className:"agent-pick",children:Yv.map(g=>c.jsxs("button",{className:`agent-pick-btn ${u===g.id?"active":""}`,onClick:()=>s(g.id),children:[c.jsx("b",{children:g.label}),c.jsx("span",{children:g.hint})]},g.id))}),c.jsx("div",{className:"run-opts",style:{padding:"0 16px 14px"},children:c.jsxs("label",{children:[c.jsx("input",{type:"checkbox",checked:o,onChange:g=>r(g.target.checked)}),"kraftwerk-aware",c.jsx("span",{className:"opt-hint",children:"— agent gets workflows + recent runs as context"})]})}),c.jsx("div",{style:{padding:"0 16px 16px"},children:c.jsx("button",{className:"run-btn",disabled:d,onClick:async()=>{h(!0),await ni(u,{kind:o?"kraftwerk":"general"}),h(!1)},children:d?"starting…":"start chat"})})]})]})}function Jm({id:u}){const[s,o]=q.useState(null),[r,d]=q.useState([]),[h,g]=q.useState(!1);q.useEffect(()=>{let S=!0,y=null;return fetch(`/api/chats/${u}`).then(z=>z.ok?z.json():Promise.reject()).then(z=>{if(!S)return;o(z.meta),d(z.events);const O=z.events[z.events.length-1]?.seq??0;y=new EventSource(`/api/chats/${u}/events?after=${O}`),y.onmessage=k=>{const le=JSON.parse(k.data);d(Q=>Q.some(J=>J.seq===le.seq)?Q:[...Q,le])}}).catch(()=>S&&g(!0)),()=>{S=!1,y?.close()}},[u]);const v=q.useMemo(()=>{for(let S=r.length-1;S>=0;S--){const y=r[S].type;if(y==="user_message")return!0;if(y==="turn_end"||y==="error")return!1}return!1},[r]);return h?c.jsx("div",{className:"empty",children:"chat not found"}):s?c.jsxs("div",{className:"chat-thread",children:[c.jsxs("div",{className:"detail-head",children:[c.jsx("span",{className:`lamp ${v?"running":"ok"}`}),c.jsx("h1",{children:s.title||"new chat"}),c.jsx("span",{className:"chip agent",children:s.agent}),s.scope.kind==="run"&&c.jsx(Ye,{href:`/runs/${s.scope.runId}`,className:"chip",children:s.scope.runId}),s.scope.kind==="kraftwerk"&&c.jsx("span",{className:"chip",children:"kraftwerk-aware"}),s.scope.kind==="knowledge"&&c.jsxs(Ye,{href:s.scope.bundle?`/knowledge/${encodeURIComponent(s.scope.bundle)}`:"/knowledge",className:"chip",children:["knowledge",s.scope.bundle?`:${s.scope.bundle}`:""]}),s.scope.kind==="team"&&c.jsxs(Ye,{href:`/team/${encodeURIComponent(s.scope.member)}`,className:"chip",children:["team:",s.scope.member]}),c.jsx("span",{className:"rid",title:s.cwd,children:s.cwd})]}),c.jsx(Zv,{id:u,events:r,busy:v}),c.jsx(Kv,{id:u,busy:v,scope:s.scope})]}):c.jsx("div",{className:"empty",children:"loading…"})}function Qv(u){const s=[],o=new Map,r=new Map;for(const d of u){const h=s[s.length-1];switch(d.type){case"user_message":s.push({kind:"user",text:d.text,key:`e${d.seq}`});break;case"text":h?.kind==="agent"?h.text+=d.text:s.push({kind:"agent",text:d.text,key:`e${d.seq}`});break;case"thought":h?.kind==="thought"?h.text+=d.text:s.push({kind:"thought",text:d.text,key:`e${d.seq}`});break;case"tool_call":o.set(d.callId,s.length),s.push({kind:"tool",callId:d.callId,title:d.title,toolKind:d.kind,status:d.status,key:`e${d.seq}`});break;case"tool_update":{const g=o.get(d.callId);if(g!=null){const v=s[g];d.title&&(v.title=d.title),d.status&&(v.status=d.status)}break}case"permission_request":r.set(d.requestId,s.length),s.push({kind:"permission",requestId:d.requestId,title:d.title,options:d.options,resolved:void 0,key:`e${d.seq}`});break;case"permission_resolved":{const g=r.get(d.requestId);g!=null&&(s[g].resolved=d.optionId);break}case"error":s.push({kind:"error",text:d.message,key:`e${d.seq}`});break}}return s}function Zv({id:u,events:s,busy:o}){const r=q.useMemo(()=>Qv(s),[s]),d=q.useRef(null),h=q.useRef(!0);return q.useEffect(()=>{const g=d.current;g&&h.current&&(g.scrollTop=g.scrollHeight)},[r,o]),c.jsxs("div",{className:"chat-scroll",ref:d,onScroll:g=>{const v=g.currentTarget;h.current=v.scrollHeight-v.scrollTop-v.clientHeight<60},children:[r.length===0&&c.jsx("div",{className:"empty",children:"say something — the agent starts on your first message"}),r.map(g=>c.jsx($v,{b:g,chatId:u},g.key)),o&&c.jsxs("div",{className:"chat-working",children:[c.jsx("span",{className:"lamp running"})," working…"]})]})}function $v({b:u,chatId:s}){switch(u.kind){case"user":return c.jsx("div",{className:"msg user",children:u.text});case"agent":return c.jsx("div",{className:"msg agent",children:u.text});case"thought":return c.jsxs("details",{className:"msg thought",children:[c.jsx("summary",{children:"thinking"}),c.jsx("div",{children:u.text})]});case"tool":return c.jsxs("div",{className:`tool-card ${u.status??""}`,children:[c.jsx("span",{className:`lamp ${u.status==="completed"?"ok":u.status==="failed"?"failed":"running"}`}),c.jsx("span",{className:"tool-title",children:u.title}),u.toolKind&&c.jsx("span",{className:"chip",children:u.toolKind})]});case"permission":return c.jsx(Vv,{b:u,chatId:s});case"error":return c.jsxs("div",{className:"msg error",children:["✕ ",u.text]})}}function Vv({b:u,chatId:s}){const[o,r]=q.useState(!1),d=u.resolved===void 0;async function h(g){r(!0),await fetch(`/api/chats/${s}/permission`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({requestId:u.requestId,optionId:g})}).catch(()=>{}),r(!1)}return c.jsxs("div",{className:`perm-card ${d?"pending":""}`,children:[c.jsxs("div",{className:"perm-title",children:[c.jsx("span",{className:"microlabel",children:"permission"})," ",u.title]}),d?c.jsx("div",{className:"perm-actions",children:u.options.map(g=>c.jsx("button",{className:`perm-btn ${g.kind?.startsWith("allow")?"allow":"deny"}`,disabled:o,onClick:()=>h(g.optionId),children:g.name},g.optionId))}):c.jsx("div",{className:"perm-resolved",children:u.resolved?`→ ${u.options.find(g=>g.optionId===u.resolved)?.name??u.resolved}`:"→ dismissed"})]})}function Kv({id:u,busy:s,scope:o}){const[r,d]=q.useState(""),[h,g]=q.useState([]),[v,S]=q.useState(0),[y,z]=q.useState(!1);q.useEffect(()=>{let R=!0;return(async()=>{try{let P=(await fetch("/api/skills").then(ae=>ae.json())).skills??[];if(o?.kind==="team"){const ae=await fetch(`/api/team/${encodeURIComponent(o.member)}`).then(se=>se.ok?se.json():null).catch(()=>null);if(ae&&Array.isArray(ae.skills)){const se=new Set(ae.skills.map(G=>G.toLowerCase()));P=P.filter(G=>se.has(G.name.toLowerCase()))}}R&&g(P)}catch{}})(),()=>{R=!1}},[u]);const O=/^\/([\w-]*)$/.exec(r)?.[1],k=O!==void 0&&!y?h.filter(R=>R.name.toLowerCase().startsWith(O.toLowerCase())):[],le=k.length>0,Q=Math.min(v,k.length-1);function J(R){d(`/${R.name} `),S(0)}async function W(){const R=r.trim();!R||s||(d(""),await fetch(`/api/chats/${u}/message`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:R})}).catch(()=>{}))}return c.jsxs("div",{className:"composer",children:[le&&c.jsx("div",{className:"skill-menu",children:k.map((R,Te)=>c.jsxs("button",{className:Te===Q?"active":"",onMouseDown:P=>{P.preventDefault(),J(R)},children:[c.jsxs("b",{children:["/",R.name]}),R.description&&c.jsxs("span",{children:[" — ",R.description]}),c.jsx("span",{className:"skill-src",children:R.source})]},R.name))}),c.jsx("textarea",{value:r,placeholder:s?"agent is working…":"message · Enter to send, Shift+Enter for newline, / for skills",rows:Math.min(6,Math.max(1,r.split(`
75
+ `+Me),fl&&(Me=ht(Me)),Le&&Bt?ct(Me):Me},s.setConfig=function(){let B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Gn(B),ui=!0,qn=Se,ma=Re},s.clearConfig=function(){sn=null,ui=!1,qn=null,ma=null,Le=kt,wt=""},s.isValidAttribute=function(B,p,N){sn||Gn({});const L=Qe(B),$=Qe(p);return yi(L,$,N)},s.addHook=function(B,p){typeof p=="function"&&Ut(Y,B)&&rs(Y[B],p)},s.removeHook=function(B,p){if(Ut(Y,B)){if(p!==void 0){const N=pv(Y[B],p);return N===-1?void 0:gv(Y[B],N,1)[0]}return xm(Y[B])}},s.removeHooks=function(B){Ut(Y,B)&&(Y[B]=[])},s.removeAllHooks=function(){Y=Rm()},s}var jo=Km();const Yv=[{id:"claude",label:"claude",hint:"Claude Code via ACP"},{id:"codex",label:"codex",hint:"Codex (ChatGPT) via ACP"},{id:"pi",label:"pi",hint:"pi coding agent"}];function Gv({id:u}){const s=bt("/api/chats",!1),o=(s?.chats??[]).filter(r=>r.scope.kind!=="team");return c.jsxs("div",{className:"runs-screen",children:[c.jsxs("aside",{className:"runs-side",children:[c.jsxs("div",{className:"side-head",children:[c.jsx("span",{className:"microlabel",children:"chats"}),c.jsx("span",{className:"spacer"}),c.jsx(Ye,{href:"/chats",className:"open-raw",children:"+ new"})]}),c.jsxs("div",{className:"side-list",children:[o.map(r=>c.jsxs(Ye,{href:`/chats/${r.id}`,className:`side-row ${r.id===u?"active":""}`,children:[c.jsx("span",{className:`lamp ${r.busy?"running":"pending"}`}),c.jsxs("div",{className:"side-row-body",children:[c.jsxs("div",{className:"side-row-top",children:[c.jsx("span",{className:"side-wf",children:r.title||"new chat"}),c.jsx("span",{className:"side-when num",children:ti(r.updatedAt)})]}),c.jsx("div",{className:"side-row-sub",children:c.jsxs("span",{className:"side-req",children:[r.agent,r.scope.kind==="run"?` · ${r.scope.runId}`:r.scope.kind==="kraftwerk"?" · kraftwerk":r.scope.kind==="knowledge"?` · knowledge${r.scope.bundle?`:${r.scope.bundle}`:""}`:""]})})]})]},r.id)),s&&o.length===0&&c.jsx("div",{className:"viewer-note",children:"no chats yet"})]})]}),c.jsx("div",{className:"runs-main chat-main",children:u?c.jsx(Jm,{id:u},u):c.jsx(Xv,{})})]})}async function ni(u,s){const r=await(await fetch("/api/chats",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({agent:u,scope:s})})).json();r.id&&Un(r.scope?.kind==="team"?`/team/${encodeURIComponent(r.scope.member)}/chat/${r.id}`:`/chats/${r.id}`)}function Xv(){const[u,s]=q.useState("claude"),[o,r]=q.useState(!0),[d,h]=q.useState(!1);return c.jsxs("div",{className:"new-chat",children:[c.jsx("div",{className:"page-head",children:c.jsx("h1",{children:"new chat"})}),c.jsxs("section",{className:"panel new-chat-panel",children:[c.jsx("div",{className:"panel-head",children:c.jsx("span",{className:"microlabel",children:"agent"})}),c.jsx("div",{className:"agent-pick",children:Yv.map(g=>c.jsxs("button",{className:`agent-pick-btn ${u===g.id?"active":""}`,onClick:()=>s(g.id),children:[c.jsx("b",{children:g.label}),c.jsx("span",{children:g.hint})]},g.id))}),c.jsx("div",{className:"run-opts",style:{padding:"0 16px 14px"},children:c.jsxs("label",{children:[c.jsx("input",{type:"checkbox",checked:o,onChange:g=>r(g.target.checked)}),"kraftwerk-aware",c.jsx("span",{className:"opt-hint",children:"— agent gets workflows + recent runs as context"})]})}),c.jsx("div",{style:{padding:"0 16px 16px"},children:c.jsx("button",{className:"run-btn",disabled:d,onClick:async()=>{h(!0),await ni(u,{kind:o?"kraftwerk":"general"}),h(!1)},children:d?"starting…":"start chat"})})]})]})}function Jm({id:u}){const[s,o]=q.useState(null),[r,d]=q.useState([]),[h,g]=q.useState(!1);q.useEffect(()=>{let S=!0,y=null;return fetch(`/api/chats/${u}`).then(z=>z.ok?z.json():Promise.reject()).then(z=>{if(!S)return;o(z.meta),d(z.events);const O=z.events[z.events.length-1]?.seq??0;y=new EventSource(`/api/chats/${u}/events?after=${O}`),y.onmessage=k=>{const le=JSON.parse(k.data);d(Q=>Q.some(J=>J.seq===le.seq)?Q:[...Q,le])}}).catch(()=>S&&g(!0)),()=>{S=!1,y?.close()}},[u]);const v=q.useMemo(()=>{for(let S=r.length-1;S>=0;S--){const y=r[S].type;if(y==="user_message")return!0;if(y==="turn_end"||y==="error")return!1}return!1},[r]);return h?c.jsx("div",{className:"empty",children:"chat not found"}):s?c.jsxs("div",{className:"chat-thread",children:[c.jsxs("div",{className:"detail-head",children:[c.jsx("span",{className:`lamp ${v?"running":"ok"}`}),c.jsx("h1",{children:s.title||"new chat"}),c.jsx("span",{className:"chip agent",children:s.agent}),s.scope.kind==="run"&&c.jsx(Ye,{href:`/runs/${s.scope.runId}`,className:"chip",children:s.scope.runId}),s.scope.kind==="kraftwerk"&&c.jsx("span",{className:"chip",children:"kraftwerk-aware"}),s.scope.kind==="knowledge"&&c.jsxs(Ye,{href:s.scope.bundle?`/knowledge/${encodeURIComponent(s.scope.bundle)}`:"/knowledge",className:"chip",children:["knowledge",s.scope.bundle?`:${s.scope.bundle}`:""]}),s.scope.kind==="team"&&c.jsxs(Ye,{href:`/team/${encodeURIComponent(s.scope.member)}`,className:"chip",children:["team:",s.scope.member]}),c.jsx("span",{className:"rid",title:s.cwd,children:s.cwd})]}),c.jsx(Zv,{id:u,events:r,busy:v}),c.jsx(Kv,{id:u,busy:v,scope:s.scope})]}):c.jsx("div",{className:"empty",children:"loading…"})}function Qv(u){const s=[],o=new Map,r=new Map;for(const d of u){const h=s[s.length-1];switch(d.type){case"user_message":s.push({kind:"user",text:d.text,key:`e${d.seq}`});break;case"text":h?.kind==="agent"?h.text+=d.text:s.push({kind:"agent",text:d.text,key:`e${d.seq}`});break;case"thought":h?.kind==="thought"?h.text+=d.text:s.push({kind:"thought",text:d.text,key:`e${d.seq}`});break;case"tool_call":o.set(d.callId,s.length),s.push({kind:"tool",callId:d.callId,title:d.title,toolKind:d.kind,status:d.status,key:`e${d.seq}`});break;case"tool_update":{const g=o.get(d.callId);if(g!=null){const v=s[g];d.title&&(v.title=d.title),d.status&&(v.status=d.status)}break}case"permission_request":r.set(d.requestId,s.length),s.push({kind:"permission",requestId:d.requestId,title:d.title,options:d.options,resolved:void 0,key:`e${d.seq}`});break;case"permission_resolved":{const g=r.get(d.requestId);g!=null&&(s[g].resolved=d.optionId);break}case"error":s.push({kind:"error",text:d.message,key:`e${d.seq}`});break}}return s}function Zv({id:u,events:s,busy:o}){const r=q.useMemo(()=>Qv(s),[s]),d=q.useRef(null),h=q.useRef(!0);return q.useEffect(()=>{const g=d.current;g&&h.current&&(g.scrollTop=g.scrollHeight)},[r,o]),c.jsxs("div",{className:"chat-scroll",ref:d,onScroll:g=>{const v=g.currentTarget;h.current=v.scrollHeight-v.scrollTop-v.clientHeight<60},children:[r.length===0&&c.jsx("div",{className:"empty",children:"say something — the agent starts on your first message"}),r.map(g=>c.jsx($v,{b:g,chatId:u},g.key)),o&&c.jsxs("div",{className:"chat-working",children:[c.jsx("span",{className:"lamp running"})," working…"]})]})}function $v({b:u,chatId:s}){switch(u.kind){case"user":return c.jsx("div",{className:"msg user",children:u.text});case"agent":return c.jsx("div",{className:"msg agent",children:u.text});case"thought":return c.jsxs("details",{className:"msg thought",children:[c.jsx("summary",{children:"thinking"}),c.jsx("div",{children:u.text})]});case"tool":return c.jsxs("div",{className:`tool-card ${u.status??""}`,children:[c.jsx("span",{className:`lamp ${u.status==="completed"?"ok":u.status==="failed"?"failed":"running"}`}),u.toolKind&&c.jsx("span",{className:"chip tool-kind",children:u.toolKind}),c.jsx("span",{className:"tool-title",children:u.title})]});case"permission":return c.jsx(Vv,{b:u,chatId:s});case"error":return c.jsxs("div",{className:"msg error",children:["✕ ",u.text]})}}function Vv({b:u,chatId:s}){const[o,r]=q.useState(!1),d=u.resolved===void 0;async function h(g){r(!0),await fetch(`/api/chats/${s}/permission`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({requestId:u.requestId,optionId:g})}).catch(()=>{}),r(!1)}return c.jsxs("div",{className:`perm-card ${d?"pending":""}`,children:[c.jsxs("div",{className:"perm-title",children:[c.jsx("span",{className:"microlabel",children:"permission"})," ",u.title]}),d?c.jsx("div",{className:"perm-actions",children:u.options.map(g=>c.jsx("button",{className:`perm-btn ${g.kind?.startsWith("allow")?"allow":"deny"}`,disabled:o,onClick:()=>h(g.optionId),children:g.name},g.optionId))}):c.jsx("div",{className:"perm-resolved",children:u.resolved?`→ ${u.options.find(g=>g.optionId===u.resolved)?.name??u.resolved}`:"→ dismissed"})]})}function Kv({id:u,busy:s,scope:o}){const[r,d]=q.useState(""),[h,g]=q.useState([]),[v,S]=q.useState(0),[y,z]=q.useState(!1);q.useEffect(()=>{let R=!0;return(async()=>{try{let P=(await fetch("/api/skills").then(ae=>ae.json())).skills??[];if(o?.kind==="team"){const ae=await fetch(`/api/team/${encodeURIComponent(o.member)}`).then(se=>se.ok?se.json():null).catch(()=>null);if(ae&&Array.isArray(ae.skills)){const se=new Set(ae.skills.map(G=>G.toLowerCase()));P=P.filter(G=>se.has(G.name.toLowerCase()))}}R&&g(P)}catch{}})(),()=>{R=!1}},[u]);const O=/^\/([\w-]*)$/.exec(r)?.[1],k=O!==void 0&&!y?h.filter(R=>R.name.toLowerCase().startsWith(O.toLowerCase())):[],le=k.length>0,Q=Math.min(v,k.length-1);function J(R){d(`/${R.name} `),S(0)}async function W(){const R=r.trim();!R||s||(d(""),await fetch(`/api/chats/${u}/message`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:R})}).catch(()=>{}))}return c.jsxs("div",{className:"composer",children:[le&&c.jsx("div",{className:"skill-menu",children:k.map((R,Te)=>c.jsxs("button",{className:Te===Q?"active":"",onMouseDown:P=>{P.preventDefault(),J(R)},children:[c.jsxs("b",{children:["/",R.name]}),R.description&&c.jsxs("span",{children:[" — ",R.description]}),c.jsx("span",{className:"skill-src",children:R.source})]},R.name))}),c.jsx("textarea",{value:r,placeholder:s?"agent is working…":"message · Enter to send, Shift+Enter for newline, / for skills",rows:Math.min(6,Math.max(1,r.split(`
76
76
  `).length)),onChange:R=>{d(R.target.value),S(0),z(!1)},onKeyDown:R=>{if(le){if(R.key==="ArrowDown")return R.preventDefault(),S((Q+1)%k.length);if(R.key==="ArrowUp")return R.preventDefault(),S((Q-1+k.length)%k.length);if(R.key==="Tab"||R.key==="Enter")return R.preventDefault(),J(k[Q]);if(R.key==="Escape")return R.preventDefault(),z(!0)}R.key==="Enter"&&!R.shiftKey&&(R.preventDefault(),W())}}),s?c.jsx("button",{className:"stop-btn",onClick:()=>fetch(`/api/chats/${u}/cancel`,{method:"POST"}).catch(()=>{}),children:"■ stop"}):c.jsx("button",{className:"run-btn",disabled:!r.trim(),onClick:W,children:"send"})]})}function Jv({id:u}){const s=bt("/api/runs",!0),o=s?.runs??[];return c.jsxs("div",{className:"runs-screen",children:[c.jsxs("aside",{className:"runs-side",children:[c.jsxs("div",{className:"side-head",children:[c.jsx("span",{className:"microlabel",children:"runs"}),c.jsx("span",{className:"spacer"}),c.jsx("span",{className:"microlabel num",children:o.length})]}),c.jsxs("div",{className:"side-list",children:[o.map(r=>c.jsx(Wv,{r,active:r.id===u},r.id)),s&&o.length===0&&c.jsx("div",{className:"viewer-note",children:"no runs yet"})]})]}),c.jsx("div",{className:"runs-main",children:c.jsx(Fv,{id:u},u)})]})}function Wv({r:u,active:s}){return c.jsxs(Ye,{href:`/runs/${u.id}`,className:`side-row ${s?"active":""}`,children:[c.jsx(Gc,{status:u.status}),c.jsxs("div",{className:"side-row-body",children:[c.jsxs("div",{className:"side-row-top",children:[c.jsx("span",{className:"side-wf",children:u.workflow??"unknown"}),c.jsx("span",{className:"side-when num",children:ti(u.startedAt)})]}),c.jsxs("div",{className:"side-row-sub",children:[c.jsx("span",{className:"side-req",title:u.request,children:u.status==="running"&&u.currentPhase?`▸ ${u.currentPhase}`:u.request??""}),c.jsx("span",{className:"side-meta num",children:u.status==="running"?c.jsx(ho,{since:u.startedAt}):ms(u.durationMs)})]})]})]})}function Fv({id:u}){const s=bt(`/api/runs/${u}`,!0),o=s?.status==="running",[r,d]=q.useState(null),[h,g]=q.useState(!1);if(!s)return c.jsx("div",{className:"empty",children:"loading…"});const v=s.files.some(z=>z.name==="runner.json"),S=r??(o?"run":"artifacts");async function y(){g(!0),await fetch(`/api/runs/${u}/stop`,{method:"POST"}).catch(()=>{})}return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"detail-head",children:[c.jsx(Gc,{status:s.status}),c.jsx("h1",{children:s.workflow?c.jsx(Ye,{href:`/workflows/${encodeURIComponent(s.workflow)}`,title:"open workflow",children:s.workflow}):"unknown workflow"}),c.jsx(ry,{status:s.status}),v&&c.jsx("span",{className:"chip sandbox-chip",children:"⬒ sandbox"}),c.jsx("span",{className:"rid",children:u.replace(/^run-/,"")}),o&&v&&c.jsx("button",{className:"stop-btn",onClick:y,disabled:h,children:h?"stopping…":"■ stop"}),c.jsx("span",{className:"spacer"}),c.jsx("button",{className:"open-raw",title:"chat with an agent about this run",onClick:()=>{ni("claude",{kind:"run",runId:u})},children:"⌬ discuss"}),c.jsxs("nav",{className:"tabs",children:[c.jsx("button",{className:S==="run"?"active":"",onClick:()=>d("run"),children:"run"}),c.jsxs("button",{className:S==="artifacts"?"active":"",onClick:()=>d("artifacts"),children:["artifacts ",c.jsxs("span",{className:"num",children:["(",s.files.length,")"]})]})]})]}),s.request&&c.jsx("p",{className:"detail-req",children:s.request}),S==="run"?c.jsx(Iv,{run:s,live:o}):c.jsx(l0,{id:u,files:s.files,live:o})]})}function Iv({run:u,live:s}){return c.jsxs("div",{className:"run-tab",children:[c.jsxs("div",{className:"statgrid",children:[c.jsxs("div",{className:"stat",children:[c.jsx("div",{className:"microlabel",children:"phases"}),c.jsxs("div",{className:"v num",children:[u.phasesDone,u.phasesTotal!=null?` / ${u.phasesTotal}`:""]})]}),c.jsxs("div",{className:"stat",children:[c.jsx("div",{className:"microlabel",children:"duration"}),c.jsx("div",{className:"v num",children:s?c.jsx(ho,{since:u.startedAt}):ms(u.durationMs)})]}),c.jsxs("div",{className:"stat",children:[c.jsx("div",{className:"microlabel",children:"cost"}),c.jsx("div",{className:"v num",children:oo(u.costUsd??Pv(u.phases))})]}),c.jsxs("div",{className:"stat",children:[c.jsx("div",{className:"microlabel",children:"tokens in / out"}),c.jsxs("div",{className:"v num",children:[Lc(Om(u.phases,"tokensIn"))," / ",Lc(Om(u.phases,"tokensOut"))]})]})]}),c.jsxs("section",{className:"panel",children:[c.jsxs("div",{className:"panel-head",children:[c.jsx("span",{className:"microlabel",children:"phase timeline"}),c.jsx("span",{className:"spacer"}),s&&c.jsxs("span",{className:"live-note",children:[c.jsx("span",{className:"lamp running"})," live · polling"]})]}),c.jsx("div",{className:"phases",children:u.phases.map(o=>c.jsx(e0,{p:o},o.phase))})]})]})}function Om(u,s){return u.reduce((o,r)=>o+(r[s]??0),0)}function Pv(u){return u.reduce((s,o)=>s+(o.costUsd??0),0)}function e0({p:u}){const s=u.gates.filter(o=>!o.passed);return c.jsxs("div",{className:"phase-row",children:[c.jsx(Gc,{status:u.status}),c.jsxs("div",{className:"phase-top",children:[c.jsx("span",{className:"phase-name",children:u.phase}),u.kind==="agent"?c.jsxs("span",{className:"chip agent",children:[u.agent,u.model?` · ${u.model}`:""]}):c.jsx("span",{className:"chip",children:"script"}),c.jsxs("span",{className:"right num",children:[u.attempts>1&&c.jsxs("span",{children:["att ",u.attempts]}),u.status==="running"?c.jsx(ho,{since:u.startedAt}):u.durationMs!=null&&c.jsx("span",{children:ms(u.durationMs)}),u.kind==="agent"&&u.tokensIn!=null&&c.jsxs("span",{children:[Lc(u.tokensIn)," / ",Lc(u.tokensOut)]}),u.costUsd!=null&&u.costUsd>0&&c.jsx("span",{children:oo(u.costUsd)})]})]}),u.status==="running"&&u.lastActivity&&c.jsx("div",{className:"phase-activity",children:u.lastActivity}),u.summary&&u.status!=="running"&&c.jsx("div",{className:"phase-sub",children:u.summary}),u.gates.length>0&&c.jsx("div",{className:"gate-line",children:u.gates.map(o=>c.jsxs("span",{className:`gate ${o.passed?"":"failed"}`,title:o.failure??"",children:[o.passed?"✓":"✕"," ",o.gate]},o.gate))}),s.map(o=>c.jsx("div",{className:"gate-fail-msg",children:o.failure},o.gate))]})}const t0=new Set(["png","jpg","jpeg","gif","webp","svg"]);function l0({id:u,files:s,live:o}){const[r,d]=q.useState(null);return q.useEffect(()=>{if(r||s.length===0)return;d(["report.html","recommendation.md","trace.jsonl"].find(g=>s.some(v=>v.name===g))??s[0].name)},[s,r]),c.jsxs("div",{className:"art-layout",children:[c.jsxs("section",{className:"panel art-files",children:[c.jsx("div",{className:"panel-head",children:c.jsxs("span",{className:"microlabel",children:["files ",c.jsxs("span",{className:"num",children:["(",s.length,")"]})]})}),c.jsxs("div",{className:"file-list",children:[s.map(h=>c.jsxs("button",{className:`file-row ${r===h.name?"active":""}`,onClick:()=>d(h.name),children:[c.jsx("span",{className:"fname",children:h.name}),c.jsx("span",{className:"fsize num",children:fo(h.size)})]},h.name)),s.length===0&&c.jsx("div",{className:"viewer-note",children:"no files yet"})]})]}),c.jsxs("section",{className:"panel art-viewer",children:[c.jsxs("div",{className:"panel-head",children:[c.jsx("span",{className:"microlabel",children:r??"viewer"}),c.jsx("span",{className:"spacer"}),r&&c.jsx("a",{className:"open-raw",href:`/api/runs/${u}/file?name=${encodeURIComponent(r)}&raw=1`,target:"_blank",children:"open raw ↗"})]}),r?c.jsx(n0,{id:u,name:r,live:o}):c.jsx("div",{className:"empty",children:"select a file"})]})]})}function n0({id:u,name:s,live:o}){const r=s.split(".").pop()?.toLowerCase()??"",d=`/api/runs/${u}/file?name=${encodeURIComponent(s)}&raw=1`;return r==="html"?c.jsx("div",{className:"viewer",children:c.jsx("div",{className:"viewer-body",children:c.jsx("iframe",{src:d,sandbox:"allow-scripts",allow:"clipboard-write",title:s})})}):t0.has(r)?c.jsx("div",{className:"viewer",children:c.jsx("div",{className:"viewer-body",children:c.jsx("img",{src:d,alt:s})})}):r==="md"||r==="markdown"?c.jsx(a0,{id:u,name:s,live:o}):c.jsx(i0,{id:u,name:s,live:o})}function a0({id:u,name:s,live:o}){const[r,d]=q.useState("rendered"),h=bt(`/api/runs/${u}/file?name=${encodeURIComponent(s)}`,o),g=q.useMemo(()=>h?jo.sanitize(_e.parse(h.content,{async:!1})):"",[h?.content]);return c.jsxs("div",{className:"viewer",children:[c.jsxs("div",{className:"viewer-note md-toolbar",children:[c.jsxs("div",{className:"tabs",children:[c.jsx("button",{className:r==="rendered"?"active":"",onClick:()=>d("rendered"),children:"rendered"}),c.jsx("button",{className:r==="source"?"active":"",onClick:()=>d("source"),children:"source"})]}),h?.truncated&&c.jsxs("span",{children:["large file — showing the last ",fo(4e5)]})]}),c.jsx("div",{className:"viewer-body",children:h?r==="rendered"?c.jsx("div",{className:"md-body",dangerouslySetInnerHTML:{__html:g}}):c.jsx("pre",{children:h.content||"(empty)"}):c.jsx("pre",{children:"loading…"})})]})}function i0({id:u,name:s,live:o}){const r=bt(`/api/runs/${u}/file?name=${encodeURIComponent(s)}`,o);return c.jsxs("div",{className:"viewer",children:[r?.truncated&&c.jsxs("div",{className:"viewer-note",children:["large file — showing the last ",fo(4e5)]}),c.jsx("div",{className:"viewer-body",children:c.jsx("pre",{children:r?r.content||"(empty)":"loading…"})})]})}function s0(){const u=bt("/api/workflows",!1),s=u?.workflows??[];return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"page-head",children:[c.jsx("h1",{children:"Workflows"}),c.jsxs("span",{className:"count num",children:[s.length," discovered"]}),u?.root&&c.jsx("span",{className:"count mono",children:u.root})]}),u&&s.length===0&&c.jsxs("div",{className:"empty",children:["No workflows found — expected ",c.jsx("code",{children:"src/workflows/"})," or ",c.jsx("code",{children:"workflows/"})," ","next to the output folder."]}),c.jsx("div",{className:"wf-grid",children:s.map(o=>c.jsxs(Ye,{href:`/workflows/${o.slug}`,className:"wf-card",children:[c.jsxs("div",{className:"wf-card-head",children:[c.jsx("span",{className:"wf-name",children:o.name??o.slug}),o.error&&c.jsx("span",{className:"status-word failed",children:"broken"})]}),c.jsx("p",{className:"wf-desc",children:o.error??o.description??""}),c.jsxs("div",{className:"wf-meta num",children:[c.jsxs("span",{children:[o.agents," agents"]}),c.jsx("span",{children:"·"}),c.jsxs("span",{children:[o.steps," steps"]})]})]},o.slug))})]})}function c0({slug:u}){const s=bt(`/api/workflows/${encodeURIComponent(u)}`,!1),o=bt("/api/runs",!1);if(!s)return c.jsx("div",{className:"empty",children:"loading…"});if(s.error)return c.jsxs(c.Fragment,{children:[c.jsx(Dm,{slug:s.slug}),c.jsxs("div",{className:"empty",children:[c.jsx("span",{className:"status-word failed",children:"broken workflow"}),c.jsx("pre",{style:{marginTop:12,textAlign:"left"},children:s.error})]})]});const r=new Map(s.agents.map((h,g)=>[h.id,g%4])),d=(o?.runs??[]).filter(h=>h.workflow===s.name).slice(0,8);return c.jsxs(c.Fragment,{children:[c.jsx(Dm,{slug:s.slug}),c.jsxs("div",{className:"detail-head",children:[c.jsx("h1",{children:s.name??s.slug}),c.jsx("span",{className:"rid mono",children:s.dir})]}),s.description&&c.jsx("p",{className:"detail-req",children:s.description}),c.jsxs("div",{className:"statgrid",children:[c.jsxs("div",{className:"stat",children:[c.jsx("div",{className:"microlabel",children:"agents"}),c.jsx("div",{className:"v num",children:s.agents.length})]}),c.jsxs("div",{className:"stat",children:[c.jsx("div",{className:"microlabel",children:"steps"}),c.jsxs("div",{className:"v num",children:[s.steps.length," ",c.jsxs("span",{style:{color:"var(--muted)",fontWeight:400},children:["(",s.steps.filter(h=>h.kind==="agent").length," agent ·"," ",s.steps.filter(h=>h.kind==="script").length," script)"]})]})]}),s.workspace&&c.jsxs("div",{className:"stat",style:{maxWidth:420},children:[c.jsx("div",{className:"microlabel",children:"workspace"}),c.jsx("div",{className:"wf-workspace mono",children:s.workspace})]})]}),c.jsx(u0,{slug:s.slug,lastRequest:d[0]?.request}),c.jsxs("section",{className:"panel",style:{marginBottom:18},children:[c.jsx("div",{className:"panel-head",children:c.jsx("span",{className:"microlabel",children:"agents"})}),c.jsxs("div",{className:"agent-grid",children:[s.agents.map(h=>c.jsx(r0,{a:h,idx:r.get(h.id)??0},h.id)),s.agents.length===0&&c.jsx("div",{className:"viewer-note",children:"no agents — script-only workflow"})]})]}),c.jsxs("div",{className:"columns",children:[c.jsxs("section",{className:"panel",children:[c.jsx("div",{className:"panel-head",children:c.jsx("span",{className:"microlabel",children:"pipeline"})}),c.jsx("div",{className:"pipeline",children:s.steps.map((h,g)=>c.jsx(o0,{s:h,i:g,idx:h.agent?r.get(h.agent)??0:null},h.name))})]}),c.jsxs("div",{style:{display:"grid",gap:18},children:[c.jsxs("section",{className:"panel",children:[c.jsx("div",{className:"panel-head",children:c.jsxs("span",{className:"microlabel",children:["folder ",c.jsxs("span",{className:"num",children:["(",s.files.length," files)"]})]})}),c.jsx("div",{className:"file-list",children:s.files.map(h=>c.jsx("div",{className:"file-row",style:{cursor:"default"},children:c.jsx("span",{className:"fname",children:h})},h))})]}),c.jsxs("section",{className:"panel",children:[c.jsx("div",{className:"panel-head",children:c.jsxs("span",{className:"microlabel",children:["recent runs ",c.jsxs("span",{className:"num",children:["(",d.length,")"]})]})}),c.jsxs("div",{className:"file-list",children:[d.map(h=>c.jsxs(Ye,{href:`/runs/${h.id}`,className:"file-row",children:[c.jsx(Gc,{status:h.status}),c.jsx("span",{className:"fname",children:h.id.replace(/^run-/,"")}),c.jsxs("span",{className:"fsize num",children:[ms(h.durationMs)," · ",oo(h.costUsd)," · ",ti(h.startedAt)]})]},h.id)),d.length===0&&c.jsx("div",{className:"viewer-note",children:"no runs of this workflow yet"})]})]})]})]})]})}function u0({slug:u,lastRequest:s}){const[o,r]=q.useState(""),[d,h]=q.useState(!0),[g,v]=q.useState(!1),[S,y]=q.useState(!1),[z,O]=q.useState(null),k=bt(`/api/workflows/${encodeURIComponent(u)}/run`,!1);q.useEffect(()=>{!o&&s&&r(s)},[s]);const le=k?.available&&k?.image,Q=k?k.available?k.image?"isolated container per run":"image missing — run `kraftwerk runner build`":"Docker not running — sandbox unavailable":"";async function J(){if(!(!o.trim()||S)){y(!0),O(null);try{const W=await fetch(`/api/workflows/${encodeURIComponent(u)}/run`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({request:o.trim(),sandbox:d,ssh:g})}),R=await W.json();if(!W.ok)throw new Error(R.error??`HTTP ${W.status}`);Un(`/runs/${R.runId}`)}catch(W){O(W.message),y(!1)}}}return c.jsxs("section",{className:"panel run-panel",style:{marginBottom:18},children:[c.jsx("div",{className:"panel-head",children:c.jsx("span",{className:"microlabel",children:"trigger run"})}),c.jsxs("div",{className:"run-form",children:[c.jsx("input",{type:"text",value:o,placeholder:"request — topic, URL, host …",onChange:W=>r(W.target.value),onKeyDown:W=>W.key==="Enter"&&J()}),c.jsx("button",{className:"run-btn",onClick:J,disabled:S||!o.trim()||d&&!le,children:S?"starting…":d?"▶ run in sandbox":"▶ run locally"})]}),c.jsxs("div",{className:"run-opts",children:[c.jsxs("label",{children:[c.jsx("input",{type:"checkbox",checked:d,onChange:W=>h(W.target.checked)}),"docker sandbox ",Q&&c.jsxs("span",{className:"opt-hint",children:["— ",Q]})]}),c.jsxs("label",{children:[c.jsx("input",{type:"checkbox",checked:g,onChange:W=>v(W.target.checked),disabled:!d}),"forward SSH agent"]})]}),z&&c.jsx("div",{className:"gate-fail-msg",children:z})]})}function Dm({slug:u}){return c.jsxs("nav",{className:"crumbs",children:[c.jsx(Ye,{href:"/workflows",children:"workflows"}),c.jsx("span",{className:"sep",children:"/"}),c.jsx("span",{className:"mono",children:u})]})}function r0({a:u,idx:s}){return c.jsxs("div",{className:`agent-card aid-${s}`,children:[c.jsxs("div",{className:"agent-head",children:[c.jsx("span",{className:"agent-dot"}),c.jsx("b",{children:u.name??u.id}),c.jsxs("code",{className:"agent-id",children:["[",u.id,"]"]}),c.jsx("span",{className:"spacer"}),c.jsxs("span",{className:"chip",children:[u.model??"default",u.effort?` · ${u.effort}`:""]})]}),u.tools.length>0&&c.jsx("div",{className:"agent-tools",children:u.tools.map(o=>c.jsx("span",{className:"tool-chip",children:o},o))}),u.persona&&c.jsx("p",{className:"agent-persona",children:u.persona})]})}function o0({s:u,i:s,idx:o}){const r=u.kind==="script"?u.script:u.prompt;return c.jsxs("div",{className:"step-node",children:[c.jsx("div",{className:`step-index num ${o!=null?`aid-${o}`:"is-script"}`,children:s+1}),c.jsxs("div",{className:"step-body",children:[c.jsxs("div",{className:"phase-top",children:[c.jsx("span",{className:"phase-name",children:u.name}),u.kind==="agent"?c.jsxs("span",{className:`chip agent-chip aid-${o??0}`,children:["agent · ",u.agent]}):c.jsxs("span",{className:"chip",children:["script",u.sourceRef?` · ${u.sourceRef}`:""]})]}),r&&c.jsxs("details",{className:"step-source",children:[c.jsx("summary",{children:u.kind==="agent"?"prompt":"script"}),c.jsx("pre",{children:r})]}),u.gates.length>0&&c.jsx("div",{className:"gate-line",children:u.gates.map(d=>c.jsxs("span",{className:"gate neutral",children:["⛨ ",d]},d))})]})]})}function f0({bundle:u,conceptId:s}){const o=bt("/api/knowledge",!1),r=o?.bundles??[];return c.jsxs("div",{className:"runs-screen",children:[c.jsxs("aside",{className:"runs-side",children:[c.jsxs("div",{className:"side-head",children:[c.jsx("span",{className:"microlabel",children:"bundles"}),c.jsx("span",{className:"spacer"}),c.jsx(Ye,{href:"/knowledge",className:"open-raw",children:"+ new"})]}),c.jsxs("div",{className:"side-list",children:[r.map(d=>c.jsxs(Ye,{href:`/knowledge/${encodeURIComponent(d.name)}`,className:`side-row ${d.name===u?"active":""}`,children:[c.jsx("span",{className:"lamp ok"}),c.jsxs("div",{className:"side-row-body",children:[c.jsxs("div",{className:"side-row-top",children:[c.jsx("span",{className:"side-wf",children:d.name}),c.jsx("span",{className:"side-when num",children:d.concepts})]}),c.jsx("div",{className:"side-row-sub",children:c.jsxs("span",{className:"side-req",children:[d.okfVersion?`okf ${d.okfVersion}`:"okf",d.updatedAt?` · ${d.updatedAt.slice(0,10)}`:""]})})]})]},d.name)),o&&r.length===0&&c.jsx("div",{className:"viewer-note",children:"no bundles yet"})]})]}),c.jsx("div",{className:"runs-main",children:u&&s?c.jsx(x0,{bundle:u,conceptId:s},`${u}/${s}`):u?c.jsx(h0,{name:u},u):c.jsx(d0,{root:o?.root})})]})}function d0({root:u}){const[s,o]=q.useState(""),[r,d]=q.useState(""),[h,g]=q.useState(!1);async function v(){const S=s.trim();if(!S)return;g(!0),d("");const z=await(await fetch("/api/knowledge",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:S})})).json();g(!1),z.error?d(z.error):window.location.hash=`/knowledge/${encodeURIComponent(S)}`}return c.jsxs("div",{className:"new-chat",children:[c.jsx("div",{className:"page-head",children:c.jsx("h1",{children:"context & knowledge"})}),c.jsxs("section",{className:"panel new-chat-panel",children:[c.jsx("div",{className:"panel-head",children:c.jsx("span",{className:"microlabel",children:"what lives here"})}),c.jsxs("div",{className:"know-intro",children:["Curated knowledge as ",c.jsx("b",{children:"OKF bundles"})," (Open Knowledge Format v0.2): plain markdown files with YAML frontmatter",u?c.jsxs(c.Fragment,{children:[" under ",c.jsx("code",{children:u})]}):null,", readable by humans and agents, diffable in git. Agents write through"," ",c.jsx("code",{children:"kraftwerk knowledge put"})," (provenance is stamped automatically); you raise a concept's trust tier by verifying it here."]}),c.jsx("div",{className:"panel-head",children:c.jsx("span",{className:"microlabel",children:"new bundle"})}),c.jsxs("div",{className:"know-newbundle",children:[c.jsx("input",{value:s,placeholder:"bundle name, e.g. customer-support",onChange:S=>o(S.target.value),onKeyDown:S=>S.key==="Enter"&&void v()}),c.jsx("button",{className:"run-btn",disabled:!s.trim()||h,onClick:v,children:h?"creating…":"create"})]}),r&&c.jsxs("div",{className:"msg error",children:["✕ ",r]})]})]})}function uo({tier:u}){return c.jsx("span",{className:`chip trust ${u}`,children:u})}function h0({name:u}){const s=bt(`/api/knowledge/${encodeURIComponent(u)}`,!1);return s?"error"in s?c.jsx("div",{className:"empty",children:"bundle not found"}):c.jsxs("div",{className:"member-view",children:[c.jsxs("div",{className:"page-head",children:[c.jsx("h1",{children:u}),c.jsxs("span",{className:"count",children:[s.concepts.length," concepts"]}),c.jsx("span",{className:"spacer"}),c.jsx("button",{className:"run-btn",onClick:()=>{ni("claude",{kind:"knowledge",bundle:u})},children:"curate in chat"})]}),c.jsx("section",{className:"panel",children:s.concepts.length===0?c.jsxs("div",{className:"viewer-note",children:["No concepts yet — start a chat to author some, or write one with"," ",c.jsxs("code",{children:["kraftwerk knowledge put ",u,"/<path>"]}),"."]}):c.jsx("div",{className:"m3-list",children:v0(s.concepts).map(({folder:o,concepts:r})=>c.jsxs(q.Fragment,{children:[o&&c.jsxs("div",{className:"m3-subhead",children:[o,"/"]}),r.map(d=>c.jsxs(Ye,{href:`/knowledge/${encodeURIComponent(u)}/${d.id}`,className:"m3-row m3-link",children:[c.jsx("span",{className:"m3-ico",children:m0(d.type)}),c.jsxs("span",{className:"m3-body",children:[c.jsxs("span",{className:"m3-head",children:[d.title,d.status!=="stable"&&c.jsx("span",{className:`chip ${d.status}`,children:d.status}),d.stale&&c.jsx("span",{className:"chip stale",children:"stale"}),d.error&&c.jsx("span",{className:"chip stale",title:d.error,children:"invalid"})]}),c.jsxs("span",{className:"m3-sub",children:[c.jsxs("code",{children:[o?d.id.slice(o.length+1):d.id,".md"]})," · ",d.type??"untyped"]})]}),c.jsx(uo,{tier:d.trustTier}),c.jsx("span",{className:"m3-chev",children:"›"})]},d.id))]},o||"."))})}),s.log&&c.jsx(y0,{name:u,log:s.log})]}):c.jsx("div",{className:"empty",children:"loading…"})}function m0(u){switch((u??"").toLowerCase()){case"reference":return"▤";case"policy":return"§";case"guide":case"howto":return"➤";case"decision":return"⚖";default:return"◆"}}function p0(u){const s=[];for(const o of u.split(`
77
77
  `)){const r=o.match(/^##\s+(\d{4}-\d{2}-\d{2})/);if(r){s.push({date:r[1],entries:[]});continue}const d=o.match(/^[*-]\s+\*\*([^*]+)\*\*:\s*(.*)$/);d&&s.length>0&&s[s.length-1].entries.push({kind:d[1].toLowerCase(),text:d[2]})}return s.filter(o=>o.entries.length>0)}function g0(u,s){const o=[],r=/\[([^\]]+)\]\(\/?([^)]+?)\.md\)/g;let d=0,h;for(;h=r.exec(s);)h.index>d&&o.push(s.slice(d,h.index)),o.push(c.jsx(Ye,{href:`/knowledge/${encodeURIComponent(u)}/${h[2].replace(/^\//,"")}`,children:h[1]},h.index)),d=h.index+h[0].length;return d<s.length&&o.push(s.slice(d)),o}function y0({name:u,log:s}){const o=p0(s),[r,d]=q.useState(!1);return c.jsxs("section",{className:"panel",children:[c.jsxs("div",{className:"panel-head",children:[c.jsx("span",{className:"microlabel",children:"activity"}),c.jsx("span",{className:"spacer"}),c.jsx("button",{className:"open-raw",onClick:()=>d(!r),children:r?"timeline":"raw log"})]}),r||o.length===0?c.jsx("div",{className:"viewer-body",children:c.jsx("pre",{children:s})}):c.jsx("div",{className:"know-log",children:o.map(h=>c.jsxs(q.Fragment,{children:[c.jsx("div",{className:"m3-subhead num",children:h.date}),h.entries.map((g,v)=>c.jsxs("div",{className:"know-log-row",children:[c.jsx("span",{className:`chip log-kind log-${g.kind}`,children:g.kind}),c.jsx("span",{className:"know-log-text",children:g0(u,g.text)})]},v))]},h.date))})]})}function v0(u){const s=new Map;for(const o of u){const r=o.id.includes("/")?o.id.slice(0,o.id.lastIndexOf("/")):"";(s.get(r)??s.set(r,[]).get(r)).push(o)}return[...s.keys()].sort((o,r)=>o===""?-1:r===""?1:o.localeCompare(r)).map(o=>({folder:o,concepts:s.get(o)}))}function x0({bundle:u,conceptId:s}){const[o,r]=q.useState(null),[d,h]=q.useState(!1),[g,v]=q.useState(!1),[S,y]=q.useState(!1),[z,O]=q.useState(""),[k,le]=q.useState(!1),[Q,J]=q.useState(""),[W,R]=q.useState("rendered"),Te=q.useMemo(()=>o?jo.sanitize(_e.parse(o.body,{async:!1})):"",[o?.body]),P=()=>{fetch(`/api/knowledge/${encodeURIComponent(u)}/concept?id=${encodeURIComponent(s)}`).then(G=>G.ok?G.json():Promise.reject()).then(r).catch(()=>h(!0))};q.useEffect(P,[u,s]);async function ae(){v(!0),await fetch(`/api/knowledge/${encodeURIComponent(u)}/verify`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:s})}).catch(()=>{}),v(!1),P()}async function se(){le(!0),J("");const G=await fetch(`/api/knowledge/${encodeURIComponent(u)}/concept`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:s,content:z})}).then(I=>I.json()).catch(()=>({error:"save failed"}));le(!1),G.error?J(G.error):(r(G),y(!1))}return d?c.jsx("div",{className:"empty",children:"concept not found"}):o?c.jsxs("div",{className:"member-view",children:[c.jsxs("div",{className:"detail-head",children:[c.jsx("h1",{children:o.title}),o.type&&c.jsx("span",{className:"chip agent",children:o.type}),c.jsx(uo,{tier:o.trustTier}),o.status!=="stable"&&c.jsx("span",{className:`chip ${o.status}`,children:o.status}),o.stale&&c.jsxs("span",{className:"chip stale",children:["stale since ",o.staleAfter?.slice(0,10)]}),c.jsx("span",{className:"spacer"}),c.jsx("button",{className:"open-raw",onClick:()=>{ni("claude",{kind:"knowledge",bundle:u})},children:"curate in chat"}),c.jsx("button",{className:"run-btn",disabled:g,onClick:ae,children:g?"verifying…":"✓ verify (human)"})]}),o.error&&c.jsxs("div",{className:"msg error",children:["✕ ",o.error]}),c.jsxs("div",{className:"detail-cols",children:[c.jsxs("section",{className:"panel",children:[c.jsxs("div",{className:"panel-head",children:[c.jsx("span",{className:"microlabel",children:"content"}),c.jsx("span",{className:"spacer"}),c.jsxs("span",{className:"side-meta",children:[u,"/",o.id,".md"]}),S?c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"open-raw",onClick:()=>{y(!1),J("")},children:"cancel"}),c.jsx("button",{className:"open-raw",disabled:k,onClick:se,children:k?"saving…":"✓ save"})]}):c.jsx("button",{className:"open-raw",onClick:()=>{O(o.raw),y(!0),J("")},children:"✎ edit"})]}),S?c.jsxs(c.Fragment,{children:[c.jsx("textarea",{className:"concept-edit",value:z,rows:Math.min(40,Math.max(18,z.split(`
78
78
  `).length+2)),onChange:G=>O(G.target.value),spellCheck:!1}),c.jsxs("div",{className:"viewer-note",children:["full file (frontmatter + markdown body) — saving stamps provenance as"," ",c.jsx("code",{children:"human:user"})," and logs an update."]})]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"viewer-note md-toolbar",children:c.jsxs("div",{className:"tabs",children:[c.jsx("button",{className:W==="rendered"?"active":"",onClick:()=>R("rendered"),children:"rendered"}),c.jsx("button",{className:W==="source"?"active":"",onClick:()=>R("source"),children:"source"})]})}),c.jsx("div",{className:"viewer-body",children:W==="rendered"?c.jsx("div",{className:"md-body concept-md",dangerouslySetInnerHTML:{__html:Te}}):c.jsx("pre",{children:o.body.trim()||"(empty body)"})})]}),Q&&c.jsxs("div",{className:"msg error",children:["✕ ",Q]})]}),c.jsxs("aside",{className:"detail-rail",children:[c.jsxs("section",{className:"panel",children:[c.jsx("div",{className:"panel-head",children:c.jsx("span",{className:"microlabel",children:"about"})}),c.jsxs("div",{className:"rail-list",children:[c.jsxs("div",{className:"rail-kv",children:[c.jsx("span",{className:"microlabel",children:"trust"}),c.jsx("span",{className:"v",children:c.jsx(uo,{tier:o.trustTier})})]}),c.jsxs("div",{className:"rail-kv",children:[c.jsx("span",{className:"microlabel",children:"generated"}),c.jsx("span",{className:`v ${o.generated?"":"dim"}`,children:o.generated?`${o.generated.by??"?"} · ${(o.generated.at??"?").slice(0,10)}`:"not stamped"})]}),c.jsxs("div",{className:"rail-kv",children:[c.jsx("span",{className:"microlabel",children:"verified"}),o.verified.length===0?c.jsx("span",{className:"v dim",children:"never"}):o.verified.map((G,I)=>c.jsxs("span",{className:"v",children:[G.by??"?"," · ",(G.at??"?").slice(0,10)]},I))]}),o.staleAfter&&c.jsxs("div",{className:"rail-kv",children:[c.jsx("span",{className:"microlabel",children:"stale after"}),c.jsxs("span",{className:`v ${o.stale?"":"dim"}`,children:[o.staleAfter.slice(0,10),o.stale&&c.jsx("span",{className:"chip stale",children:"stale"})]})]}),o.tags.length>0&&c.jsxs("div",{className:"rail-kv",children:[c.jsx("span",{className:"microlabel",children:"tags"}),c.jsx("span",{className:"m3-chips",children:o.tags.map(G=>c.jsx("span",{className:"chip",children:G},G))})]})]})]}),o.sources.length>0&&c.jsxs("section",{className:"panel",children:[c.jsx("div",{className:"panel-head",children:c.jsx("span",{className:"microlabel",children:"sources"})}),c.jsx("div",{className:"rail-list",children:o.sources.map((G,I)=>c.jsxs("div",{className:"rail-kv",children:[c.jsxs("span",{className:"v",children:[G.resource?.startsWith("http")?c.jsx("a",{href:G.resource,target:"_blank",rel:"noreferrer",children:G.title??G.resource}):G.title??G.resource??"?",G.id&&c.jsxs("span",{className:"know-id",children:["[^",G.id,"]"]})]}),c.jsx("span",{className:"v dim",children:[G.author,G.usage_count!=null?`${G.usage_count} uses`:null,G.last_modified?`mod ${G.last_modified.slice(0,10)}`:null].filter(Boolean).join(" · ")})]},I))})]})]})]})]}):c.jsx("div",{className:"empty",children:"loading…"})}const b0=["","low","medium","high","xhigh","max"],S0=["🤖","🧑‍💻","🎧","🛠️","📊","✍️","🔍","🧹","📦","🚀"];function j0({seg:u}){const s=u[0]&&u[0]!=="new"?decodeURIComponent(u[0]):void 0,o=u[0]==="new"?"new":u[1]==="edit"?"edit":u[1]==="chat"?"chat":s?"member":"home",r=o==="chat"?u[2]:void 0,d=bt("/api/team",!1),h=d?.members??[];let g;o==="new"?g=c.jsx(Cm,{},"new"):o==="edit"&&s?g=c.jsx(Cm,{slug:s},s):o==="chat"&&s&&r?g=c.jsx("div",{className:"chat-main",children:c.jsx(Jm,{id:r},r)}):s?g=c.jsx(A0,{slug:s},s):g=c.jsx(E0,{hasMembers:h.length>0,root:d?.root});const v=(o==="member"||o==="chat")&&s?h.find(J=>J.slug===s)?.knowledge??[]:[],[S,y]=q.useState(()=>localStorage.getItem("kw-kside")!=="hidden"),[z,O]=q.useState(()=>Number(localStorage.getItem("kw-kside-w"))||460),k=v.length>0&&S;function le(J){y(J),localStorage.setItem("kw-kside",J?"open":"hidden")}function Q(J){O(J),localStorage.setItem("kw-kside-w",String(J))}return c.jsxs("div",{className:`runs-screen team-screen ${s?"has-sessions":""} ${k?"has-knowledge":""}`,style:k?{"--kside-w":`${z}px`}:void 0,children:[c.jsxs("aside",{className:"runs-side",children:[c.jsxs("div",{className:"side-head",children:[c.jsx("span",{className:"microlabel",children:"agents"}),c.jsx("span",{className:"spacer"}),c.jsx(Ye,{href:"/team/new",className:"open-raw",children:"+ new"})]}),c.jsxs("div",{className:"side-list",children:[h.map(J=>c.jsxs(Ye,{href:`/team/${encodeURIComponent(J.slug)}`,className:`side-row ${J.slug===s?"active":""}`,children:[c.jsx("span",{className:"team-emoji",children:J.emoji}),c.jsxs("div",{className:"side-row-body",children:[c.jsx("div",{className:"side-row-top",children:c.jsx("span",{className:"side-wf",children:J.name})}),c.jsx("div",{className:"side-row-sub",children:c.jsx("span",{className:"side-req",children:J.description||J.harness})})]})]},J.slug)),d&&h.length===0&&c.jsx("div",{className:"viewer-note",children:"no agents yet"})]})]}),s&&c.jsx(T0,{slug:s,chatId:r}),c.jsx("div",{className:"runs-main",children:g}),k&&c.jsx(N0,{bundles:v,onHide:()=>le(!1),onResize:Q}),v.length>0&&!S&&c.jsx("button",{className:"kside-reopen",onClick:()=>le(!0),title:"Show knowledge sidebar",children:"◆ knowledge"})]})}function N0({bundles:u,onHide:s,onResize:o}){const[r,d]=q.useState({}),[h,g]=q.useState(null),[v,S]=q.useState({}),[y,z]=q.useState(null),[O,k]=q.useState(""),[le,Q]=q.useState(!1),[J,W]=q.useState("");q.useEffect(()=>{d({});for(const P of u)fetch(`/api/knowledge/${encodeURIComponent(P)}`).then(ae=>ae.ok?ae.json():null).then(ae=>d(se=>({...se,[P]:ae}))).catch(()=>d(ae=>({...ae,[P]:null})))},[u.join(",")]);async function R(P,ae){const se=`${P}::${ae}`;if(h===se){g(null);return}if(g(se),v[se]===void 0)try{const G=await fetch(`/api/knowledge/${encodeURIComponent(P)}/concept?id=${encodeURIComponent(ae)}`),I=G.ok?await G.json():null;S(He=>({...He,[se]:I}))}catch{S(G=>({...G,[se]:null}))}}async function Te(P,ae){const se=`${P}::${ae}`;Q(!0),W("");try{const I=await(await fetch(`/api/knowledge/${encodeURIComponent(P)}/concept`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:ae,content:O})})).json();I.error?W(I.error):(S(He=>({...He,[se]:I})),z(null))}catch(G){W(G.message)}Q(!1)}return c.jsxs("aside",{className:"runs-side knowledge-side",children:[c.jsx("div",{className:"kside-resizer",title:"Drag to resize",onMouseDown:P=>{P.preventDefault();const ae=P.clientX,se=P.currentTarget.parentElement.offsetWidth,G=He=>o(Math.min(900,Math.max(280,se+(ae-He.clientX)))),I=()=>{window.removeEventListener("mousemove",G),window.removeEventListener("mouseup",I)};window.addEventListener("mousemove",G),window.addEventListener("mouseup",I)}}),c.jsxs("div",{className:"side-head",children:[c.jsx("span",{className:"microlabel",children:"knowledge"}),c.jsx("span",{className:"spacer"}),c.jsx("button",{className:"open-raw",onClick:s,title:"Hide knowledge sidebar",children:"hide ✕"})]}),c.jsx("div",{className:"side-list",children:u.map(P=>{const ae=r[P];return c.jsxs("div",{className:"kside-bundle",children:[c.jsxs(Ye,{href:`/knowledge/${encodeURIComponent(P)}`,className:"kside-bundle-name",children:[P," ",ae?c.jsxs("span",{className:"num",children:["(",ae.concepts.length,")"]}):null]}),ae===null&&c.jsx("div",{className:"viewer-note",children:"bundle not found"}),ae?.concepts.map(se=>{const G=`${P}::${se.id}`,I=h===G;return c.jsxs("div",{className:"kside-concept",children:[c.jsxs("button",{className:`kside-row ${I?"active":""}`,onClick:()=>R(P,se.id),children:[c.jsx("span",{className:"kside-title",children:se.title||se.id}),se.stale&&c.jsx("span",{className:"kside-stale",children:"stale"})]}),I&&y!==G&&c.jsx("div",{className:"kside-body md-body",children:v[G]===void 0?c.jsx("span",{className:"viewer-note",children:"loading…"}):v[G]===null?c.jsx("span",{className:"viewer-note",children:"could not load concept"}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"kside-actions",children:c.jsx("button",{className:"open-raw",onClick:()=>{k(v[G].raw),z(G),W("")},children:"✎ edit"})}),c.jsx("div",{dangerouslySetInnerHTML:{__html:jo.sanitize(_e.parse(v[G].body??"",{async:!1}))}})]})}),I&&y===G&&c.jsxs("div",{className:"kside-body kside-edit",children:[c.jsx("textarea",{className:"concept-edit",value:O,rows:Math.min(28,Math.max(10,O.split(`
@@ -1 +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")}:root{--font-sans: "Roboto";--font-mono: "Roboto Mono";--primary: #f2bd57;--on-primary: #422c00;--primary-container: #5f4100;--on-primary-container: #ffdea9;--secondary: #d9c4a0;--on-secondary: #3b2f15;--secondary-container: #53452a;--on-secondary-container: #f6e0bb;--tertiary: #b1cfa1;--tertiary-container: #354d2a;--on-tertiary-container: #cdebbb;--error: #ffb4ab;--on-error: #690005;--error-container: #93000a;--on-error-container: #ffdad6;--success: #8fd48c;--success-container: #12411a;--on-success-container: #aaf2a4;--surface: #16130e;--on-surface: #eae1d6;--on-surface-variant: #cfc5b4;--surface-container-lowest: #100d08;--surface-container-low: #1e1b14;--surface-container: #221f18;--surface-container-high: #2d2921;--surface-container-highest: #38332b;--outline: #99907f;--outline-variant: #4d4639;--inverse-surface: #eae1d6;--inverse-on-surface: #34302a;--elev-1: 0 1px 2px rgba(0, 0, 0, .3), 0 1px 3px 1px rgba(0, 0, 0, .15);--elev-2: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 6px 2px rgba(0, 0, 0, .15);--elev-3: 0 1px 3px rgba(0, 0, 0, .3), 0 4px 8px 3px rgba(0, 0, 0, .15);color-scheme:dark}:root[data-theme=light]{--primary: #7e5700;--on-primary: #ffffff;--primary-container: #ffdea9;--on-primary-container: #281900;--secondary: #6d5c3f;--on-secondary: #ffffff;--secondary-container: #f6e0bb;--on-secondary-container: #251a04;--tertiary: #4c6540;--tertiary-container: #cdebbb;--on-tertiary-container: #0a2005;--error: #ba1a1a;--on-error: #ffffff;--error-container: #ffdad6;--on-error-container: #410002;--success: #2e6b30;--success-container: #b0f1ab;--on-success-container: #002204;--surface: #fff8f2;--on-surface: #201b13;--on-surface-variant: #4e4639;--surface-container-lowest: #ffffff;--surface-container-low: #faf2e9;--surface-container: #f4ede3;--surface-container-high: #eee7dd;--surface-container-highest: #e9e1d8;--outline: #807663;--outline-variant: #d2c5b1;--inverse-surface: #35302a;--inverse-on-surface: #faf0e7;--elev-1: 0 1px 2px rgba(32, 27, 19, .18), 0 1px 3px 1px rgba(32, 27, 19, .08);--elev-2: 0 1px 2px rgba(32, 27, 19, .18), 0 2px 6px 2px rgba(32, 27, 19, .08);--elev-3: 0 1px 3px rgba(32, 27, 19, .18), 0 4px 8px 3px rgba(32, 27, 19, .08);color-scheme:light}*{box-sizing:border-box;margin:0;padding:0}html{height:100%}body{min-height:100%;background:var(--surface);color:var(--on-surface);font-family:var(--font-sans),system-ui,sans-serif;font-size:14px;line-height:1.5;letter-spacing:.01em;-webkit-font-smoothing:antialiased}a{color:inherit;text-decoration:none}button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}code,pre,.mono{font-family:var(--font-mono),monospace}.topbar{position:sticky;top:0;z-index:10;display:flex;align-items:center;gap:14px;padding:10px 20px;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)}.wordmark{display:flex;align-items:center;gap:10px}.wordmark .lamp-block{width:26px;height:26px;border-radius:9px;background:var(--primary);display:grid;place-items:center}.wordmark .lamp-block span{width:8px;height:8px;border-radius:50%;background:var(--on-primary)}.wordmark b{font-size:15px;font-weight:500;letter-spacing:0}.wordmark small{font-size:12px;color:var(--on-surface-variant)}.wordmark .env-name{font-size:12px;font-weight:500;letter-spacing:.01em;color:var(--on-surface-variant);padding:2px 9px;border-radius:999px;border:1px solid var(--outline-variant);white-space:nowrap;max-width:220px;overflow:hidden;text-overflow:ellipsis}.topbar .spacer{flex:1}.topbar nav{display:flex;gap:4px;position:absolute;left:50%;transform:translate(-50%)}@media(max-width:1100px){.topbar nav{position:static;transform:none;margin-left:12px}}.topbar nav a{font-size:13px;font-weight:500;letter-spacing:.01em;text-transform:capitalize;color:var(--on-surface-variant);padding:6px 14px;border-radius:999px;transition:background .12s ease,color .12s ease}.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:"";position:absolute;left:-16px;top:50%;height:18px;width:1px;transform:translateY(-50%);background:var(--outline-variant)}.info-wrap{position:relative;display:inline-flex}.info-btn{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;color:var(--on-surface-variant);transition:background .12s ease,color .12s ease}.info-btn:hover{background:color-mix(in srgb,var(--on-surface) 8%,transparent);color:var(--on-surface)}.info-pop{position:absolute;top:calc(100% + 8px);right:0;z-index:20;min-width:340px;max-width:min(480px,90vw);background:var(--surface-container-high);border-radius:12px;box-shadow:var(--elev-2);padding:8px 0}.info-row{display:flex;flex-direction:column;gap:2px;padding:8px 16px}.info-row+.info-row{border-top:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent)}.info-v{font-size:13px;color:var(--on-surface)}.info-path{font-size:11px;color:var(--on-surface-variant);overflow-wrap:break-word;word-break:break-all}.info-actions{flex-direction:row;align-items:center;justify-content:space-between}.info-actions .theme-btn{flex:none}.theme-btn{border:1px solid var(--outline);border-radius:999px;padding:6px 14px;font-size:12.5px;font-weight:500;color:var(--on-surface-variant);transition:background .12s ease,color .12s ease}.theme-btn:hover{background:color-mix(in srgb,var(--primary) 10%,transparent);color:var(--on-surface)}.shell{max-width:1240px;margin:0 auto;padding:26px 20px 80px}.microlabel{font-size:11px;font-weight:500;letter-spacing:.045em;text-transform:capitalize;color:var(--on-surface-variant)}.num{font-variant-numeric:tabular-nums}.lamp{width:9px;height:9px;border-radius:50%;flex:none;position:relative}.lamp.ok{background:var(--success)}.lamp.failed,.lamp.blocked{background:var(--error)}.lamp.aborted{background:var(--outline-variant)}.lamp.pending{background:transparent;border:1.5px solid var(--outline)}.lamp.running{background:var(--primary);animation:lamp-pulse 1.4s ease-in-out infinite}@keyframes lamp-pulse{0%,to{box-shadow: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{font-size:12px;font-weight:500;letter-spacing:.03em;text-transform:capitalize}.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{display:flex;align-items:baseline;gap:14px;margin:6px 2px 20px}.page-head h1{font-size:24px;font-weight:400;letter-spacing:0}.page-head .count{color:var(--on-surface-variant);font-size:13px}.run-list{display:grid;gap:10px}.run-card{display:grid;grid-template-columns:12px 200px 1fr auto;gap:8px 16px;align-items:center;background:var(--surface-container-low);border:0;border-radius:12px;padding:14px 20px;box-shadow:var(--elev-1);transition:box-shadow .15s ease,background .15s ease}.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;font-size:12.5px;color:var(--on-surface-variant)}.run-card .wf{font-weight:500;font-size:14px}.run-card .req{color:var(--on-surface-variant);font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:52ch}.run-card .meta{display:flex;gap:18px;align-items:center;font-family:var(--font-mono),monospace;font-size:12px;color:var(--on-surface-variant)}.progress-track{width:90px;height:4px;border-radius:999px;background:var(--surface-container-highest);overflow:hidden}.progress-track i{display:block;height:100%;background:var(--primary);border-radius:999px}.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);border-radius:16px;padding:40px;text-align:center;color:var(--on-surface-variant)}.crumbs{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--on-surface-variant);margin-bottom:14px}.crumbs a:hover{color:var(--primary)}.crumbs .sep{color:var(--outline-variant)}.detail-head{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;margin-bottom:6px}.detail-head h1{font-size:22px;font-weight:400}.detail-head .rid{font-family:var(--font-mono),monospace;font-size:12px;color:var(--on-surface-variant)}.detail-req{color:var(--on-surface-variant);font-size:13px;margin-bottom:18px;max-width:90ch}.statgrid{display:flex;flex-wrap:wrap;gap:26px;margin-bottom:22px}.stat .microlabel{margin-bottom:1px}.stat .v{font-family:var(--font-mono),monospace;font-size:15px;font-weight:500}.columns{display:grid;grid-template-columns:minmax(430px,5fr) minmax(360px,4fr);gap:18px;align-items:start}@media(max-width:1020px){.columns{grid-template-columns:1fr}}.panel{background:var(--surface-container-low);border:0;border-radius:16px;box-shadow:var(--elev-1);overflow:hidden}.panel-head{display:flex;align-items:center;gap:10px;padding:12px 18px;border-bottom:1px solid var(--outline-variant);background:var(--surface-container)}.panel-head .microlabel{color:var(--on-surface-variant);font-size:12px}.panel-head .spacer{flex:1}.phases{padding:6px 0}.phase-row{position:relative;padding:10px 18px 10px 42px}.phase-row+.phase-row{border-top:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent)}.phase-row .lamp{position:absolute;left:19px;top:16px}.phase-row:before{content:"";position:absolute;left:23px;top:0;bottom:0;width:1px;background:var(--outline-variant)}.phase-row:first-child:before{top:16px}.phase-row:last-child:before{bottom:auto;height:16px}.phase-row .lamp{z-index:1}.phase-top{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}.phase-name{font-weight:500;font-size:14px}.chip{font-family:var(--font-mono),monospace;font-size:11px;border:1px solid var(--outline-variant);border-radius:8px;padding:2px 10px;color:var(--on-surface-variant)}.chip.agent{border-color:transparent;background:var(--secondary-container);color:var(--on-secondary-container)}.phase-top .right{margin-left:auto;display:flex;gap:14px;font-family:var(--font-mono),monospace;font-size:11.5px;color:var(--on-surface-variant)}.phase-sub{margin-top:3px;font-size:12.5px;color:var(--on-surface-variant);max-width:72ch}.phase-activity{margin-top:3px;font-family:var(--font-mono),monospace;font-size:11.5px;color:var(--primary)}.phase-activity:before{content:"▸ "}.gate-line{margin-top:5px;display:flex;flex-wrap:wrap;gap:6px}.gate{display:inline-flex;align-items:center;gap:5px;font-family:var(--font-mono),monospace;font-size:11px;border-radius:8px;padding:2px 10px;background:var(--success-container);color:var(--on-success-container)}.gate.failed{background:var(--error-container);color:var(--on-error-container)}.gate-fail-msg{margin-top:4px;font-size:12px;color:var(--error)}.file-list{max-height:300px;overflow:auto}.file-row{display:flex;align-items:center;gap:10px;width:100%;text-align:left;padding:8px 18px;font-family:var(--font-mono),monospace;font-size:12.5px;border-bottom:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent);color:var(--on-surface-variant);transition:background .1s ease}.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{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-row .fsize{color:var(--outline);font-size:11px}.viewer{border-top:1px solid var(--outline-variant)}.viewer-body pre{padding:14px 18px;overflow:auto;max-height:560px;font-size:12px;line-height:1.55;white-space:pre-wrap;word-break:break-word;color:var(--on-surface-variant)}.viewer-body iframe{width:100%;height:620px;border:0;background:#fff;display:block}.viewer-body img{max-width:100%;display:block;padding:14px 18px}.viewer-note{padding:6px 18px;font-size:11px;color:var(--on-surface-variant);border-bottom:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent)}.open-raw{font-size:12px;font-weight:500;color:var(--primary);border:1px solid var(--outline);border-radius:999px;padding:3px 12px;transition:background .12s ease}.open-raw:hover{background:color-mix(in srgb,var(--primary) 10%,transparent)}.live-note{display:inline-flex;align-items:center;gap:7px;font-size:11px;color:var(--on-surface-variant)}.wf-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:14px}.wf-card{display:flex;flex-direction:column;gap:6px;background:var(--surface-container-low);border:0;border-radius:16px;padding:18px 20px;box-shadow:var(--elev-1);transition:box-shadow .15s ease,background .15s ease}.wf-card:hover{background:color-mix(in srgb,var(--on-surface) 5%,var(--surface-container-low));box-shadow:var(--elev-2)}.wf-card-head{display:flex;align-items:baseline;gap:10px}.wf-name{font-weight:500;font-size:16px}.wf-desc{color:var(--on-surface-variant);font-size:13px;flex:1}.wf-meta{display:flex;gap:8px;font-family:var(--font-mono),monospace;font-size:11.5px;color:var(--on-surface-variant)}.wf-workspace{font-size:11.5px;color:var(--on-surface-variant);white-space:pre-wrap}.aid-0{--aid: var(--primary)}.aid-1{--aid: #4fb8a8}.aid-2{--aid: #a78bfa}.aid-3{--aid: #e5793b}.agent-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:0}.agent-card{padding:14px 18px;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)}.agent-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.agent-head b{font-size:14px;font-weight:500}.agent-head .spacer{flex:1}.agent-id{font-size:11px;color:var(--on-surface-variant)}.agent-dot{width:10px;height:10px;border-radius:50%;background:var(--aid)}.agent-tools{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}.tool-chip{font-family:var(--font-mono),monospace;font-size:11px;border:1px solid var(--outline-variant);border-radius:8px;padding:1px 8px;color:var(--on-surface-variant)}.agent-persona{margin-top:8px;font-size:12px;color:var(--on-surface-variant);line-height:1.55;white-space:pre-wrap}.pipeline{padding:8px 0}.step-node{position:relative;display:flex;gap:14px;padding:12px 18px}.step-node+.step-node{border-top:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent)}.step-node:before{content:"";position:absolute;left:31px;top:0;bottom:0;width:1px;background:var(--outline-variant)}.step-node:first-child:before{top:18px}.step-node:last-child:before{bottom:auto;height:18px}.step-index{position:relative;z-index:1;flex:none;width:26px;height:26px;border-radius:50%;margin-top:1px;display:grid;place-items:center;font-family:var(--font-mono),monospace;font-size:11.5px;font-weight:700;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)}.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:transparent}.step-source{margin-top:6px}.step-source summary{cursor:pointer;font-size:12px;font-weight:500;color:var(--on-surface-variant);-webkit-user-select:none;user-select:none}.step-source summary:hover{color:var(--primary)}.step-source pre{margin-top:6px;padding:10px 12px;border:0;border-radius:12px;background:var(--surface-container-high);font-size:11.5px;line-height:1.55;white-space:pre-wrap;word-break:break-word;color:var(--on-surface-variant);max-height:360px;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);border-radius:999px;border:2px solid transparent;background-clip:content-box}::-webkit-scrollbar-track{background:transparent}.run-form{display:flex;gap:10px}.run-form input[type=text]{flex:1;font:13px/1.4 var(--font-mono),monospace;color:var(--on-surface);background:var(--surface-container-high);border:1px solid transparent;border-radius:999px;padding:10px 18px;outline:none;transition:border-color .12s ease,background .12s ease}.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 ease,filter .12s ease}.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-opts{display:flex;flex-wrap:wrap;gap:6px 22px;margin-top:12px}.run-opts label{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--on-surface-variant);cursor:pointer}.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);background:transparent;border:1px solid var(--outline);border-radius:999px;padding:8px 18px;transition:background .12s ease,border-color .12s ease}.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{display:grid;grid-template-columns:300px minmax(0,1fr);align-items:start}.runs-side{position:sticky;top:47px;height:calc(100vh - 47px);display:flex;flex-direction:column;border-right:1px solid var(--outline-variant);background:var(--surface-container-low)}.side-head{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--outline-variant);background:var(--surface-container)}.side-head .spacer{flex:1}.side-list{flex:1;overflow-y:auto;padding:6px}.side-row{display:flex;align-items:flex-start;gap:9px;padding:9px 12px;border-radius:12px;margin-bottom:2px;transition:background .1s ease}.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{display:flex;align-items:baseline;gap:8px}.side-wf{font-weight:500;font-size:12.5px;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.side-when{font-family:var(--font-mono),monospace;font-size:10.5px;color:var(--on-surface-variant)}.side-row-sub{display:flex;align-items:baseline;gap:8px;margin-top:1px}.side-row-sub .side-when{font-size:9px;opacity:.8}.side-req{flex:1;font-size:11.5px;color:var(--on-surface-variant);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.side-row.active .side-req{color:var(--on-secondary-container)}.side-meta{font-family:var(--font-mono),monospace;font-size:10.5px;color:var(--on-surface-variant)}.runs-main{padding:18px 22px 40px;min-width:0}.runs-main .detail-head .spacer{flex:1}.tabs{display:flex;gap:0;background:transparent;border:1px solid var(--outline);border-radius:999px;padding:0;overflow:hidden}.tabs button{font-size:12.5px;font-weight:500;letter-spacing:.01em;text-transform:capitalize;color:var(--on-surface-variant);padding:7px 18px;border-radius:0;transition:background .12s ease,color .12s ease}.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{display:grid;grid-template-columns:280px minmax(0,1fr);gap:14px;height:calc(100vh - 172px);min-height:420px}.art-files{display:flex;flex-direction:column;min-height:0}.art-files .file-list{flex:1;max-height:none}.art-viewer{display:flex;flex-direction:column;min-height:0}.art-viewer .viewer{flex:1;display:flex;flex-direction:column;min-height:0;border-top:0}.art-viewer .viewer-body{flex:1;min-height:0}.art-viewer .viewer-body iframe{height:100%}.art-viewer .viewer-body pre{max-height:none;height:100%;box-sizing:border-box}.art-viewer .viewer-body img{max-height:100%;object-fit:contain}.art-viewer .empty{flex:1;display:grid;place-items:center}.md-toolbar{display:flex;align-items:center;gap:12px}.md-toolbar .tabs button{font-size:11px;padding:3px 12px;text-transform:none}.md-body{height:100%;box-sizing:border-box;overflow:auto;padding:16px 22px;font-size:13.5px;line-height:1.6;color:var(--on-surface)}.md-body>:first-child{margin-top:0}.md-body h1,.md-body h2,.md-body h3,.md-body h4{margin:1.4em 0 .5em;line-height:1.25;font-weight:600}.md-body h1{font-size:20px}.md-body h2{font-size:16px;border-bottom:1px solid var(--outline-variant);padding-bottom:4px}.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;font-size:12px;background:color-mix(in srgb,var(--on-surface) 8%,transparent);padding:1px 5px;border-radius:4px}.md-body pre{background:color-mix(in srgb,var(--on-surface) 6%,transparent);border:1px solid var(--outline-variant);border-radius:8px;padding:10px 14px;overflow-x:auto;margin:.8em 0}.md-body pre code{background:none;padding:0}.md-body blockquote{margin:.8em 0;padding:2px 14px;border-left:3px solid var(--outline);color:var(--on-surface-variant)}.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);padding:5px 10px;text-align:left}.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(max-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{display:flex;flex-direction:column;height:calc(100vh - 47px);padding:16px 20px}.chat-thread{display:flex;flex-direction:column;flex:1;min-height:0;max-width:980px;width:100%;margin:0 auto}.chat-thread .detail-head{flex:none}.chat-thread .detail-head .rid{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:34ch}.chat-scroll{flex:1;min-height:0;overflow-y:auto;padding:14px 2px 20px;display:flex;flex-direction:column;gap:10px}.chat-scroll .empty{margin:auto;border:0}.msg{max-width:76ch;white-space:pre-wrap;word-break:break-word;font-size:14px;line-height:1.6}.msg.user{align-self:flex-end;background:var(--primary-container);color:var(--on-primary-container);border:0;border-radius:20px 20px 6px;padding:10px 16px}.msg.agent{align-self:flex-start;background:var(--surface-container);border:0;border-radius:20px 20px 20px 6px;padding:10px 16px}.msg.error{align-self:flex-start;color:var(--error);font-size:12.5px}.msg.thought{align-self:flex-start;max-width:76ch}.msg.thought summary{cursor:pointer;font-size:12px;font-weight:500;color:var(--on-surface-variant);-webkit-user-select:none;user-select:none}.msg.thought div{margin-top:5px;padding:8px 12px;border-left:2px solid var(--outline-variant);color:var(--on-surface-variant);font-size:12px;white-space:pre-wrap;word-break:break-word}.tool-card{align-self:flex-start;display:inline-flex;align-items:center;gap:9px;font-family:var(--font-mono),monospace;font-size:11.5px;color:var(--on-surface-variant);background:transparent;border:1px solid var(--outline-variant);border-radius:8px;padding:5px 12px;max-width:90ch}.tool-card .tool-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.perm-card{align-self:flex-start;border:0;background:var(--tertiary-container);color:var(--on-tertiary-container);border-radius:16px;padding:12px 16px;max-width:76ch;box-shadow:var(--elev-1)}.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{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}.perm-btn{font:500 13px/1 var(--font-sans),sans-serif;border-radius:999px;padding:8px 18px;border:1px solid var(--outline);transition:background .12s ease,filter .12s ease}.perm-btn.allow{color:var(--on-primary);background:var(--primary);border-color:transparent}.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{margin-top:6px;font-size:12px;color:var(--on-surface-variant);font-family:var(--font-mono),monospace}.chat-working{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--on-surface-variant)}.composer{flex:none;display:flex;gap:10px;align-items:flex-end;padding:12px 0 4px;border-top:1px solid var(--outline-variant);position:relative}.skill-menu{position:absolute;bottom:100%;left:0;right:0;margin-bottom:6px;display:flex;flex-direction:column;overflow:hidden;background:var(--surface-container-high);border:1px solid var(--outline-variant);border-radius:14px;box-shadow:var(--elev-1);z-index:5}.skill-menu button{display:flex;align-items:baseline;gap:6px;text-align:left;padding:9px 14px;font-size:13px;background:transparent;border:0}.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);font-size:12px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.skill-menu button .skill-src{margin-left:auto;flex:none;font-size:10.5px;text-transform:uppercase;letter-spacing:.04em}.skill-menu button:hover,.skill-menu button.active{background:color-mix(in srgb,var(--on-surface) 7%,transparent)}.composer textarea{flex:1;resize:none;font:14px/1.5 var(--font-sans),sans-serif;color:var(--on-surface);background:var(--surface-container-high);border:1px solid transparent;border-radius:24px;padding:12px 18px;outline:none;transition:border-color .12s ease,background .12s ease}.composer textarea:focus{border-color:var(--primary);background:var(--surface-container-highest)}.new-chat{max-width:640px;margin:0 auto;width:100%}.new-chat-panel{overflow:visible}.agent-pick{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;padding:14px 16px}.agent-pick-btn{display:flex;flex-direction:column;gap:3px;text-align:left;border:1px solid var(--outline-variant);border-radius:12px;padding:12px 14px;background:transparent;transition:background .12s ease,border-color .12s ease}.agent-pick-btn b{font-size:13.5px;font-weight:500}.agent-pick-btn span{font-size:11.5px;color:var(--on-surface-variant)}.agent-pick-btn:hover{background:color-mix(in srgb,var(--on-surface) 5%,transparent)}.agent-pick-btn.active{border-color:transparent;background:var(--secondary-container);color:var(--on-secondary-container)}.agent-pick-btn.active span{color:var(--on-secondary-container)}@media(max-width:940px){.chat-main{height:auto;min-height:calc(100vh - 47px)}.agent-pick{grid-template-columns:1fr}}.know-intro{padding:12px 18px;font-size:13px;line-height:1.6;color:var(--on-surface-variant)}.know-intro code{font-size:11.5px}.know-newbundle{display:flex;gap:10px;padding:14px 18px}.know-newbundle input{flex:1;font:13px/1.4 var(--font-mono),monospace;color:var(--on-surface);background:var(--surface-container-high);border:1px solid transparent;border-radius:999px;padding:10px 18px;outline:none;transition:border-color .12s ease,background .12s ease}.know-newbundle input:focus{border-color:var(--primary);background:var(--surface-container-highest)}.know-table{width:100%;border-collapse:collapse;font-size:13px}.know-table td{padding:9px 18px;border-bottom:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent);vertical-align:baseline}.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;font-size:11px;color:var(--on-surface-variant);margin-left:8px}.know-type{font-size:11.5px;color:var(--on-surface-variant);white-space:nowrap}.know-flags{text-align:right;white-space:nowrap}.chip.trust.unverified{color:var(--on-surface-variant)}.chip.trust.machine-confirmed{border-color:transparent;background:var(--secondary-container);color:var(--on-secondary-container)}.chip.trust.human-reviewed{border-color:transparent;color:var(--on-success-container);background:var(--success-container)}.chip.stale,.chip.deprecated{border-color:transparent;color:var(--on-error-container);background:var(--error-container)}.chip.draft{border-color:color-mix(in srgb,var(--primary) 45%,var(--outline-variant));color:var(--primary)}.know-sub{display:flex;align-items:center;gap:8px;margin:-8px 2px 14px}.know-sub .rid{font-family:var(--font-mono),monospace;font-size:12px;color:var(--on-surface-variant)}.know-meta{display:flex;flex-direction:column;gap:8px;padding:12px 18px;font-size:13px}.know-meta>div{display:flex;gap:14px;align-items:baseline}.know-meta .microlabel{width:90px;flex:none}.know-verify-entry{display:inline-block;margin-right:14px}.know-folder-row td{padding:10px 18px 4px;border-bottom:none}.know-folder{font-family:var(--font-mono),monospace;font-size:11px;color:var(--on-surface-variant);letter-spacing:.04em}.know-indent{padding-left:32px!important}.team-screen{grid-template-columns:240px minmax(0,1fr)}.team-screen.has-sessions{grid-template-columns:240px 260px minmax(0,1fr)}.team-screen.has-sessions.has-knowledge{grid-template-columns:240px 260px minmax(0,1fr) var(--kside-w, 460px)}.knowledge-side{position:sticky;border-left:1px solid var(--outline-variant);border-right:0}.kside-resizer{position:absolute;left:-3px;top:0;bottom:0;width:7px;cursor:col-resize;z-index:4}.kside-resizer:hover{background:color-mix(in srgb,var(--primary) 25%,transparent)}.kside-bundle{padding:6px 0}.kside-bundle+.kside-bundle{border-top:1px solid var(--outline-variant)}.kside-bundle-name{display:block;padding:6px 14px;font-size:12px;font-weight:600;color:var(--on-surface);text-decoration:none}.kside-bundle-name:hover{color:var(--primary)}.kside-bundle-name .num{font-weight:400;color:var(--on-surface-variant)}.kside-row{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:5px 14px 5px 20px;font-size:12px;color:var(--on-surface-variant)}.kside-row:hover{background:color-mix(in srgb,var(--on-surface) 5%,transparent);color:var(--on-surface)}.kside-row.active{color:var(--on-surface);font-weight:500}.kside-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kside-stale{font-size:9px;text-transform:uppercase;letter-spacing:.05em;color:var(--error, #b3261e);border:1px solid currentColor;border-radius:999px;padding:0 6px}.kside-body.md-body{height:auto;overflow:visible;padding:6px 14px 10px 20px;font-size:12px;border-bottom:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent)}.concept-md{height:auto;overflow:visible}.kside-actions{display:flex;justify-content:flex-end;gap:8px;margin:2px 0 6px}.kside-edit{padding:6px 14px 10px 20px;border-bottom:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent)}.kside-edit .concept-edit{width:100%;box-sizing:border-box}.kside-edit .kside-actions{margin-top:8px}.kside-reopen{position:fixed;right:14px;top:60px;z-index:5;font-size:11px;color:var(--on-surface-variant);background:var(--surface-container-high);border:1px solid var(--outline-variant);border-radius:999px;padding:4px 12px}.kside-reopen:hover{color:var(--on-surface);background:var(--surface-container-highest, var(--surface-container-high))}@media(max-width:1099px){.knowledge-side,.kside-reopen{display:none}.team-screen.has-sessions.has-knowledge{grid-template-columns:240px 260px minmax(0,1fr)}}.team-emoji{font-size:17px;line-height:1.3;flex:none}.team-emoji-lg{font-size:34px;line-height:1}.member-view{display:flex;flex-direction:column;gap:16px}.member-view .detail-head{margin-bottom:0}.m3-list{display:flex;flex-direction:column;padding:4px 0}.m3-row{display:flex;align-items:center;gap:14px;padding:12px 18px;text-align:left;color:inherit}.m3-row+.m3-row,.m3-expand+.m3-row{border-top:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent)}button.m3-toggle{background:none;border:0;width:100%;font:inherit;cursor:pointer}button.m3-toggle:hover{background:color-mix(in srgb,var(--on-surface) 4%,transparent)}.m3-ico{flex:none;width:32px;height:32px;display:grid;place-items:center;font-size:14px;color:var(--on-secondary-container);background:var(--secondary-container);border-radius:50%}.m3-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.m3-head{font-size:13.5px;font-weight:500;display:flex;align-items:center;gap:8px}.m3-sub{font-size:12px;color:var(--on-surface-variant);line-height:1.5}.m3-sub code{font-size:11px}.m3-sub a{color:inherit}.m3-ellipsis{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.m3-chev{flex:none;color:var(--on-surface-variant);font-size:11px;transition:transform .14s ease}.m3-chev.open{transform:rotate(180deg)}.m3-expand{padding:2px 18px 16px 64px}.m3-expand pre{margin:0;white-space:pre-wrap;font:12.5px/1.65 var(--font-mono),monospace}.m3-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:3px}.m3-chips .chip{text-decoration:none}.m3-switch{position:relative;flex:none;display:inline-block;width:44px;height:24px;cursor:pointer}.m3-switch input{position:absolute;inset:0;opacity:0;margin:0;cursor:pointer}.m3-switch-track{position:absolute;inset:0;border-radius:999px;pointer-events:none;background:var(--surface-container-highest);border:2px solid var(--outline-variant);transition:background .14s ease,border-color .14s ease}.m3-switch-track:after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:var(--on-surface-variant);transition:transform .14s ease,background .14s ease}.m3-switch input:checked+.m3-switch-track{background:var(--primary);border-color:var(--primary)}.m3-switch input:checked+.m3-switch-track:after{transform:translate(20px);background:var(--on-primary)}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{padding:14px 18px 4px;font-family:var(--font-mono),monospace;font-size:11px;letter-spacing:.05em;color:var(--on-surface-variant)}.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}.know-log-row{display:flex;gap:10px;padding:4px 18px;align-items:baseline}.know-log-text{font-size:12.5px;color:var(--on-surface-variant);line-height:1.55;min-width:0;overflow-wrap:break-word}.know-log-text a{color:var(--primary)}.chip.log-kind{flex:none}.chip.log-verification{border-color:transparent;background:var(--success-container);color:var(--on-success-container)}.chip.log-creation,.chip.log-initialization{border-color:transparent;background:var(--secondary-container);color:var(--on-secondary-container)}.detail-cols{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:16px;align-items:start}@media(max-width:1020px){.detail-cols{grid-template-columns:1fr}}.detail-rail{display:flex;flex-direction:column;gap:16px;min-width:0}.rail-list{padding:4px 0}.rail-kv{display:flex;flex-direction:column;gap:3px;padding:10px 18px}.rail-kv+.rail-kv{border-top:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent)}.rail-kv .v{font-size:12.5px;color:var(--on-surface);overflow-wrap:break-word;display:flex;align-items:center;gap:8px;flex-wrap:wrap}.rail-kv .v.dim{color:var(--on-surface-variant)}.rail-kv a{color:var(--primary)}.concept-edit{display:block;width:100%;border:0;outline:none;resize:vertical;padding:14px 18px;background:var(--surface-container-lowest);color:var(--on-surface);font:12.5px/1.65 var(--font-mono),monospace;border-bottom:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent)}.side-row .row-x{flex:none;align-self:center;opacity:0;border:0;background:transparent;color:var(--on-surface-variant);font-size:11px;line-height:1;padding:4px 6px;border-radius:8px;cursor:pointer;transition:opacity .1s ease,background .1s ease,color .1s ease}.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)}.team-wf-list{display:flex;flex-wrap:wrap;gap:8px;padding:12px 18px}.team-wf-list .chip{text-decoration:none}.team-form{display:flex;flex-direction:column;gap:14px;padding:18px;max-width:680px}.team-form-row{display:flex;gap:10px;align-items:flex-end}.team-field{display:flex;flex-direction:column;gap:5px}.team-field,.team-field-label{font-size:11px;font-weight:500;color:var(--on-surface-variant);letter-spacing:.045em;text-transform:capitalize}.team-field input,.team-field select,.team-field textarea{font:13px/1.5 var(--font-mono),monospace;color:var(--on-surface);background:var(--surface-container-high);border:1px solid transparent;border-radius:12px;padding:9px 14px;outline:none;text-transform:none;letter-spacing:normal;transition:border-color .12s ease,background .12s ease}.team-field textarea{resize:vertical;font-family:var(--font-mono),monospace}.team-field input:focus,.team-field select:focus,.team-field textarea:focus{border-color:var(--primary);background:var(--surface-container-highest)}.emoji-pick{display:flex;gap:6px;flex-wrap:wrap}.emoji-pick button{font-size:16px;padding:6px 10px;background:transparent;border:1px solid var(--outline-variant);border-radius:12px;cursor:pointer;transition:background .12s ease,border-color .12s ease}.emoji-pick button:hover{background:color-mix(in srgb,var(--on-surface) 6%,transparent)}.emoji-pick button.active{border-color:transparent;background:var(--secondary-container)}.wf-checks{display:flex;flex-direction:column;gap:7px;padding:4px 0}.wf-checks label{display:flex;align-items:baseline;gap:8px;font-size:13px;color:var(--on-surface-variant);text-transform:none;letter-spacing:normal;cursor:pointer}.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(max-width:900px){.team-screen,.team-screen.has-sessions,.team-screen.has-sessions.has-knowledge{grid-template-columns:1fr}.team-form-row{flex-direction:column;align-items:stretch}}
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")}:root{--font-sans: "Roboto";--font-mono: "Roboto Mono";--primary: #f2bd57;--on-primary: #422c00;--primary-container: #5f4100;--on-primary-container: #ffdea9;--secondary: #d9c4a0;--on-secondary: #3b2f15;--secondary-container: #53452a;--on-secondary-container: #f6e0bb;--tertiary: #b1cfa1;--tertiary-container: #354d2a;--on-tertiary-container: #cdebbb;--error: #ffb4ab;--on-error: #690005;--error-container: #93000a;--on-error-container: #ffdad6;--success: #8fd48c;--success-container: #12411a;--on-success-container: #aaf2a4;--surface: #16130e;--on-surface: #eae1d6;--on-surface-variant: #cfc5b4;--surface-container-lowest: #100d08;--surface-container-low: #1e1b14;--surface-container: #221f18;--surface-container-high: #2d2921;--surface-container-highest: #38332b;--outline: #99907f;--outline-variant: #4d4639;--inverse-surface: #eae1d6;--inverse-on-surface: #34302a;--elev-1: 0 1px 2px rgba(0, 0, 0, .3), 0 1px 3px 1px rgba(0, 0, 0, .15);--elev-2: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 6px 2px rgba(0, 0, 0, .15);--elev-3: 0 1px 3px rgba(0, 0, 0, .3), 0 4px 8px 3px rgba(0, 0, 0, .15);color-scheme:dark}:root[data-theme=light]{--primary: #7e5700;--on-primary: #ffffff;--primary-container: #ffdea9;--on-primary-container: #281900;--secondary: #6d5c3f;--on-secondary: #ffffff;--secondary-container: #f6e0bb;--on-secondary-container: #251a04;--tertiary: #4c6540;--tertiary-container: #cdebbb;--on-tertiary-container: #0a2005;--error: #ba1a1a;--on-error: #ffffff;--error-container: #ffdad6;--on-error-container: #410002;--success: #2e6b30;--success-container: #b0f1ab;--on-success-container: #002204;--surface: #fff8f2;--on-surface: #201b13;--on-surface-variant: #4e4639;--surface-container-lowest: #ffffff;--surface-container-low: #faf2e9;--surface-container: #f4ede3;--surface-container-high: #eee7dd;--surface-container-highest: #e9e1d8;--outline: #807663;--outline-variant: #d2c5b1;--inverse-surface: #35302a;--inverse-on-surface: #faf0e7;--elev-1: 0 1px 2px rgba(32, 27, 19, .18), 0 1px 3px 1px rgba(32, 27, 19, .08);--elev-2: 0 1px 2px rgba(32, 27, 19, .18), 0 2px 6px 2px rgba(32, 27, 19, .08);--elev-3: 0 1px 3px rgba(32, 27, 19, .18), 0 4px 8px 3px rgba(32, 27, 19, .08);color-scheme:light}*{box-sizing:border-box;margin:0;padding:0}html{height:100%}body{min-height:100%;background:var(--surface);color:var(--on-surface);font-family:var(--font-sans),system-ui,sans-serif;font-size:14px;line-height:1.5;letter-spacing:.01em;-webkit-font-smoothing:antialiased}a{color:inherit;text-decoration:none}button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}code,pre,.mono{font-family:var(--font-mono),monospace}.topbar{position:sticky;top:0;z-index:10;display:flex;align-items:center;gap:14px;padding:10px 20px;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)}.wordmark{display:flex;align-items:center;gap:10px}.wordmark .lamp-block{width:26px;height:26px;border-radius:9px;background:var(--primary);display:grid;place-items:center}.wordmark .lamp-block span{width:8px;height:8px;border-radius:50%;background:var(--on-primary)}.wordmark b{font-size:15px;font-weight:500;letter-spacing:0}.wordmark small{font-size:12px;color:var(--on-surface-variant)}.wordmark .env-name{font-size:12px;font-weight:500;letter-spacing:.01em;color:var(--on-surface-variant);padding:2px 9px;border-radius:999px;border:1px solid var(--outline-variant);white-space:nowrap;max-width:220px;overflow:hidden;text-overflow:ellipsis}.topbar .spacer{flex:1}.topbar nav{display:flex;gap:4px;position:absolute;left:50%;transform:translate(-50%)}@media(max-width:1100px){.topbar nav{position:static;transform:none;margin-left:12px}}.topbar nav a{font-size:13px;font-weight:500;letter-spacing:.01em;text-transform:capitalize;color:var(--on-surface-variant);padding:6px 14px;border-radius:999px;transition:background .12s ease,color .12s ease}.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:"";position:absolute;left:-16px;top:50%;height:18px;width:1px;transform:translateY(-50%);background:var(--outline-variant)}.info-wrap{position:relative;display:inline-flex}.info-btn{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;color:var(--on-surface-variant);transition:background .12s ease,color .12s ease}.info-btn:hover{background:color-mix(in srgb,var(--on-surface) 8%,transparent);color:var(--on-surface)}.info-pop{position:absolute;top:calc(100% + 8px);right:0;z-index:20;min-width:340px;max-width:min(480px,90vw);background:var(--surface-container-high);border-radius:12px;box-shadow:var(--elev-2);padding:8px 0}.info-row{display:flex;flex-direction:column;gap:2px;padding:8px 16px}.info-row+.info-row{border-top:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent)}.info-v{font-size:13px;color:var(--on-surface)}.info-path{font-size:11px;color:var(--on-surface-variant);overflow-wrap:break-word;word-break:break-all}.info-actions{flex-direction:row;align-items:center;justify-content:space-between}.info-actions .theme-btn{flex:none}.theme-btn{border:1px solid var(--outline);border-radius:999px;padding:6px 14px;font-size:12.5px;font-weight:500;color:var(--on-surface-variant);transition:background .12s ease,color .12s ease}.theme-btn:hover{background:color-mix(in srgb,var(--primary) 10%,transparent);color:var(--on-surface)}.shell{max-width:1240px;margin:0 auto;padding:26px 20px 80px}.microlabel{font-size:11px;font-weight:500;letter-spacing:.045em;text-transform:capitalize;color:var(--on-surface-variant)}.num{font-variant-numeric:tabular-nums}.lamp{width:9px;height:9px;border-radius:50%;flex:none;position:relative}.lamp.ok{background:var(--success)}.lamp.failed,.lamp.blocked{background:var(--error)}.lamp.aborted{background:var(--outline-variant)}.lamp.pending{background:transparent;border:1.5px solid var(--outline)}.lamp.running{background:var(--primary);animation:lamp-pulse 1.4s ease-in-out infinite}@keyframes lamp-pulse{0%,to{box-shadow: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{font-size:12px;font-weight:500;letter-spacing:.03em;text-transform:capitalize}.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{display:flex;align-items:baseline;gap:14px;margin:6px 2px 20px}.page-head h1{font-size:24px;font-weight:400;letter-spacing:0}.page-head .count{color:var(--on-surface-variant);font-size:13px}.run-list{display:grid;gap:10px}.run-card{display:grid;grid-template-columns:12px 200px 1fr auto;gap:8px 16px;align-items:center;background:var(--surface-container-low);border:0;border-radius:12px;padding:14px 20px;box-shadow:var(--elev-1);transition:box-shadow .15s ease,background .15s ease}.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;font-size:12.5px;color:var(--on-surface-variant)}.run-card .wf{font-weight:500;font-size:14px}.run-card .req{color:var(--on-surface-variant);font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:52ch}.run-card .meta{display:flex;gap:18px;align-items:center;font-family:var(--font-mono),monospace;font-size:12px;color:var(--on-surface-variant)}.progress-track{width:90px;height:4px;border-radius:999px;background:var(--surface-container-highest);overflow:hidden}.progress-track i{display:block;height:100%;background:var(--primary);border-radius:999px}.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);border-radius:16px;padding:40px;text-align:center;color:var(--on-surface-variant)}.crumbs{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--on-surface-variant);margin-bottom:14px}.crumbs a:hover{color:var(--primary)}.crumbs .sep{color:var(--outline-variant)}.detail-head{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;margin-bottom:6px}.detail-head h1{font-size:22px;font-weight:400}.detail-head .rid{font-family:var(--font-mono),monospace;font-size:12px;color:var(--on-surface-variant)}.detail-req{color:var(--on-surface-variant);font-size:13px;margin-bottom:18px;max-width:90ch}.statgrid{display:flex;flex-wrap:wrap;gap:26px;margin-bottom:22px}.stat .microlabel{margin-bottom:1px}.stat .v{font-family:var(--font-mono),monospace;font-size:15px;font-weight:500}.columns{display:grid;grid-template-columns:minmax(430px,5fr) minmax(360px,4fr);gap:18px;align-items:start}@media(max-width:1020px){.columns{grid-template-columns:1fr}}.panel{background:var(--surface-container-low);border:0;border-radius:16px;box-shadow:var(--elev-1);overflow:hidden}.panel-head{display:flex;align-items:center;gap:10px;padding:12px 18px;border-bottom:1px solid var(--outline-variant);background:var(--surface-container)}.panel-head .microlabel{color:var(--on-surface-variant);font-size:12px}.panel-head .spacer{flex:1}.phases{padding:6px 0}.phase-row{position:relative;padding:10px 18px 10px 42px}.phase-row+.phase-row{border-top:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent)}.phase-row .lamp{position:absolute;left:19px;top:16px}.phase-row:before{content:"";position:absolute;left:23px;top:0;bottom:0;width:1px;background:var(--outline-variant)}.phase-row:first-child:before{top:16px}.phase-row:last-child:before{bottom:auto;height:16px}.phase-row .lamp{z-index:1}.phase-top{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}.phase-name{font-weight:500;font-size:14px}.chip{font-family:var(--font-mono),monospace;font-size:11px;border:1px solid var(--outline-variant);border-radius:8px;padding:2px 10px;color:var(--on-surface-variant)}.chip.agent{border-color:transparent;background:var(--secondary-container);color:var(--on-secondary-container)}.phase-top .right{margin-left:auto;display:flex;gap:14px;font-family:var(--font-mono),monospace;font-size:11.5px;color:var(--on-surface-variant)}.phase-sub{margin-top:3px;font-size:12.5px;color:var(--on-surface-variant);max-width:72ch}.phase-activity{margin-top:3px;font-family:var(--font-mono),monospace;font-size:11.5px;color:var(--primary)}.phase-activity:before{content:"▸ "}.gate-line{margin-top:5px;display:flex;flex-wrap:wrap;gap:6px}.gate{display:inline-flex;align-items:center;gap:5px;font-family:var(--font-mono),monospace;font-size:11px;border-radius:8px;padding:2px 10px;background:var(--success-container);color:var(--on-success-container)}.gate.failed{background:var(--error-container);color:var(--on-error-container)}.gate-fail-msg{margin-top:4px;font-size:12px;color:var(--error)}.file-list{max-height:300px;overflow:auto}.file-row{display:flex;align-items:center;gap:10px;width:100%;text-align:left;padding:8px 18px;font-family:var(--font-mono),monospace;font-size:12.5px;border-bottom:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent);color:var(--on-surface-variant);transition:background .1s ease}.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{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-row .fsize{color:var(--outline);font-size:11px}.viewer{border-top:1px solid var(--outline-variant)}.viewer-body pre{padding:14px 18px;overflow:auto;max-height:560px;font-size:12px;line-height:1.55;white-space:pre-wrap;word-break:break-word;color:var(--on-surface-variant)}.viewer-body iframe{width:100%;height:620px;border:0;background:#fff;display:block}.viewer-body img{max-width:100%;display:block;padding:14px 18px}.viewer-note{padding:6px 18px;font-size:11px;color:var(--on-surface-variant);border-bottom:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent)}.open-raw{font-size:12px;font-weight:500;color:var(--primary);border:1px solid var(--outline);border-radius:999px;padding:3px 12px;transition:background .12s ease}.open-raw:hover{background:color-mix(in srgb,var(--primary) 10%,transparent)}.live-note{display:inline-flex;align-items:center;gap:7px;font-size:11px;color:var(--on-surface-variant)}.wf-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:14px}.wf-card{display:flex;flex-direction:column;gap:6px;background:var(--surface-container-low);border:0;border-radius:16px;padding:18px 20px;box-shadow:var(--elev-1);transition:box-shadow .15s ease,background .15s ease}.wf-card:hover{background:color-mix(in srgb,var(--on-surface) 5%,var(--surface-container-low));box-shadow:var(--elev-2)}.wf-card-head{display:flex;align-items:baseline;gap:10px}.wf-name{font-weight:500;font-size:16px}.wf-desc{color:var(--on-surface-variant);font-size:13px;flex:1}.wf-meta{display:flex;gap:8px;font-family:var(--font-mono),monospace;font-size:11.5px;color:var(--on-surface-variant)}.wf-workspace{font-size:11.5px;color:var(--on-surface-variant);white-space:pre-wrap}.aid-0{--aid: var(--primary)}.aid-1{--aid: #4fb8a8}.aid-2{--aid: #a78bfa}.aid-3{--aid: #e5793b}.agent-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:0}.agent-card{padding:14px 18px;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)}.agent-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.agent-head b{font-size:14px;font-weight:500}.agent-head .spacer{flex:1}.agent-id{font-size:11px;color:var(--on-surface-variant)}.agent-dot{width:10px;height:10px;border-radius:50%;background:var(--aid)}.agent-tools{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}.tool-chip{font-family:var(--font-mono),monospace;font-size:11px;border:1px solid var(--outline-variant);border-radius:8px;padding:1px 8px;color:var(--on-surface-variant)}.agent-persona{margin-top:8px;font-size:12px;color:var(--on-surface-variant);line-height:1.55;white-space:pre-wrap}.pipeline{padding:8px 0}.step-node{position:relative;display:flex;gap:14px;padding:12px 18px}.step-node+.step-node{border-top:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent)}.step-node:before{content:"";position:absolute;left:31px;top:0;bottom:0;width:1px;background:var(--outline-variant)}.step-node:first-child:before{top:18px}.step-node:last-child:before{bottom:auto;height:18px}.step-index{position:relative;z-index:1;flex:none;width:26px;height:26px;border-radius:50%;margin-top:1px;display:grid;place-items:center;font-family:var(--font-mono),monospace;font-size:11.5px;font-weight:700;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)}.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:transparent}.step-source{margin-top:6px}.step-source summary{cursor:pointer;font-size:12px;font-weight:500;color:var(--on-surface-variant);-webkit-user-select:none;user-select:none}.step-source summary:hover{color:var(--primary)}.step-source pre{margin-top:6px;padding:10px 12px;border:0;border-radius:12px;background:var(--surface-container-high);font-size:11.5px;line-height:1.55;white-space:pre-wrap;word-break:break-word;color:var(--on-surface-variant);max-height:360px;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);border-radius:999px;border:2px solid transparent;background-clip:content-box}::-webkit-scrollbar-track{background:transparent}.run-form{display:flex;gap:10px}.run-form input[type=text]{flex:1;font:13px/1.4 var(--font-mono),monospace;color:var(--on-surface);background:var(--surface-container-high);border:1px solid transparent;border-radius:999px;padding:10px 18px;outline:none;transition:border-color .12s ease,background .12s ease}.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 ease,filter .12s ease}.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-opts{display:flex;flex-wrap:wrap;gap:6px 22px;margin-top:12px}.run-opts label{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--on-surface-variant);cursor:pointer}.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);background:transparent;border:1px solid var(--outline);border-radius:999px;padding:8px 18px;transition:background .12s ease,border-color .12s ease}.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{display:grid;grid-template-columns:300px minmax(0,1fr);align-items:start}.runs-side{position:sticky;top:47px;height:calc(100vh - 47px);display:flex;flex-direction:column;border-right:1px solid var(--outline-variant);background:var(--surface-container-low)}.side-head{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--outline-variant);background:var(--surface-container)}.side-head .spacer{flex:1}.side-list{flex:1;overflow-y:auto;padding:6px}.side-row{display:flex;align-items:flex-start;gap:9px;padding:9px 12px;border-radius:12px;margin-bottom:2px;transition:background .1s ease}.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{display:flex;align-items:baseline;gap:8px}.side-wf{font-weight:500;font-size:12.5px;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.side-when{font-family:var(--font-mono),monospace;font-size:10.5px;color:var(--on-surface-variant)}.side-row-sub{display:flex;align-items:baseline;gap:8px;margin-top:1px}.side-row-sub .side-when{font-size:9px;opacity:.8}.side-req{flex:1;font-size:11.5px;color:var(--on-surface-variant);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.side-row.active .side-req{color:var(--on-secondary-container)}.side-meta{font-family:var(--font-mono),monospace;font-size:10.5px;color:var(--on-surface-variant)}.runs-main{padding:18px 22px 40px;min-width:0}.runs-main .detail-head .spacer{flex:1}.tabs{display:flex;gap:0;background:transparent;border:1px solid var(--outline);border-radius:999px;padding:0;overflow:hidden}.tabs button{font-size:12.5px;font-weight:500;letter-spacing:.01em;text-transform:capitalize;color:var(--on-surface-variant);padding:7px 18px;border-radius:0;transition:background .12s ease,color .12s ease}.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{display:grid;grid-template-columns:280px minmax(0,1fr);gap:14px;height:calc(100vh - 172px);min-height:420px}.art-files{display:flex;flex-direction:column;min-height:0}.art-files .file-list{flex:1;max-height:none}.art-viewer{display:flex;flex-direction:column;min-height:0}.art-viewer .viewer{flex:1;display:flex;flex-direction:column;min-height:0;border-top:0}.art-viewer .viewer-body{flex:1;min-height:0}.art-viewer .viewer-body iframe{height:100%}.art-viewer .viewer-body pre{max-height:none;height:100%;box-sizing:border-box}.art-viewer .viewer-body img{max-height:100%;object-fit:contain}.art-viewer .empty{flex:1;display:grid;place-items:center}.md-toolbar{display:flex;align-items:center;gap:12px}.md-toolbar .tabs button{font-size:11px;padding:3px 12px;text-transform:none}.md-body{height:100%;box-sizing:border-box;overflow:auto;padding:16px 22px;font-size:13.5px;line-height:1.6;color:var(--on-surface)}.md-body>:first-child{margin-top:0}.md-body h1,.md-body h2,.md-body h3,.md-body h4{margin:1.4em 0 .5em;line-height:1.25;font-weight:600}.md-body h1{font-size:20px}.md-body h2{font-size:16px;border-bottom:1px solid var(--outline-variant);padding-bottom:4px}.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;font-size:12px;background:color-mix(in srgb,var(--on-surface) 8%,transparent);padding:1px 5px;border-radius:4px}.md-body pre{background:color-mix(in srgb,var(--on-surface) 6%,transparent);border:1px solid var(--outline-variant);border-radius:8px;padding:10px 14px;overflow-x:auto;margin:.8em 0}.md-body pre code{background:none;padding:0}.md-body blockquote{margin:.8em 0;padding:2px 14px;border-left:3px solid var(--outline);color:var(--on-surface-variant)}.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);padding:5px 10px;text-align:left}.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(max-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{display:flex;flex-direction:column;height:calc(100vh - 47px);padding:16px 20px}.chat-thread{display:flex;flex-direction:column;flex:1;min-height:0;max-width:980px;width:100%;margin:0 auto}.chat-thread .detail-head{flex:none}.chat-thread .detail-head .rid{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:34ch}.chat-scroll{flex:1;min-height:0;overflow-y:auto;padding:14px 2px 20px;display:flex;flex-direction:column;gap:10px}.chat-scroll .empty{margin:auto;border:0}.msg{max-width:76ch;white-space:pre-wrap;word-break:break-word;font-size:14px;line-height:1.6}.msg.user{align-self:flex-end;background:var(--primary-container);color:var(--on-primary-container);border:0;border-radius:20px 20px 6px;padding:10px 16px}.msg.agent{align-self:flex-start;background:var(--surface-container);border:0;border-radius:20px 20px 20px 6px;padding:10px 16px}.msg.error{align-self:flex-start;color:var(--error);font-size:12.5px}.msg.thought{align-self:flex-start;max-width:76ch}.msg.thought summary{cursor:pointer;font-size:12px;font-weight:500;color:var(--on-surface-variant);-webkit-user-select:none;user-select:none}.msg.thought div{margin-top:5px;padding:8px 12px;border-left:2px solid var(--outline-variant);color:var(--on-surface-variant);font-size:12px;white-space:pre-wrap;word-break:break-word}.tool-card{align-self:flex-start;display:inline-flex;align-items:flex-start;gap:9px;font-family:var(--font-mono),monospace;font-size:11.5px;color:var(--on-surface-variant);background:transparent;border:1px solid var(--outline-variant);border-radius:8px;padding:5px 12px;max-width:90ch}.tool-card .lamp{margin-top:4px}.tool-card .chip.tool-kind{flex-shrink:0}.tool-card .tool-title{white-space:pre-wrap;word-break:break-word;overflow:visible;line-height:1.5;min-width:0}.perm-card{align-self:flex-start;border:0;background:var(--tertiary-container);color:var(--on-tertiary-container);border-radius:16px;padding:12px 16px;max-width:76ch;box-shadow:var(--elev-1)}.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{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}.perm-btn{font:500 13px/1 var(--font-sans),sans-serif;border-radius:999px;padding:8px 18px;border:1px solid var(--outline);transition:background .12s ease,filter .12s ease}.perm-btn.allow{color:var(--on-primary);background:var(--primary);border-color:transparent}.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{margin-top:6px;font-size:12px;color:var(--on-surface-variant);font-family:var(--font-mono),monospace}.chat-working{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--on-surface-variant)}.composer{flex:none;display:flex;gap:10px;align-items:flex-end;padding:12px 0 4px;border-top:1px solid var(--outline-variant);position:relative}.skill-menu{position:absolute;bottom:100%;left:0;right:0;margin-bottom:6px;display:flex;flex-direction:column;overflow:hidden;background:var(--surface-container-high);border:1px solid var(--outline-variant);border-radius:14px;box-shadow:var(--elev-1);z-index:5}.skill-menu button{display:flex;align-items:baseline;gap:6px;text-align:left;padding:9px 14px;font-size:13px;background:transparent;border:0}.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);font-size:12px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.skill-menu button .skill-src{margin-left:auto;flex:none;font-size:10.5px;text-transform:uppercase;letter-spacing:.04em}.skill-menu button:hover,.skill-menu button.active{background:color-mix(in srgb,var(--on-surface) 7%,transparent)}.composer textarea{flex:1;resize:none;font:14px/1.5 var(--font-sans),sans-serif;color:var(--on-surface);background:var(--surface-container-high);border:1px solid transparent;border-radius:24px;padding:12px 18px;outline:none;transition:border-color .12s ease,background .12s ease}.composer textarea:focus{border-color:var(--primary);background:var(--surface-container-highest)}.new-chat{max-width:640px;margin:0 auto;width:100%}.new-chat-panel{overflow:visible}.agent-pick{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;padding:14px 16px}.agent-pick-btn{display:flex;flex-direction:column;gap:3px;text-align:left;border:1px solid var(--outline-variant);border-radius:12px;padding:12px 14px;background:transparent;transition:background .12s ease,border-color .12s ease}.agent-pick-btn b{font-size:13.5px;font-weight:500}.agent-pick-btn span{font-size:11.5px;color:var(--on-surface-variant)}.agent-pick-btn:hover{background:color-mix(in srgb,var(--on-surface) 5%,transparent)}.agent-pick-btn.active{border-color:transparent;background:var(--secondary-container);color:var(--on-secondary-container)}.agent-pick-btn.active span{color:var(--on-secondary-container)}@media(max-width:940px){.chat-main{height:auto;min-height:calc(100vh - 47px)}.agent-pick{grid-template-columns:1fr}}.know-intro{padding:12px 18px;font-size:13px;line-height:1.6;color:var(--on-surface-variant)}.know-intro code{font-size:11.5px}.know-newbundle{display:flex;gap:10px;padding:14px 18px}.know-newbundle input{flex:1;font:13px/1.4 var(--font-mono),monospace;color:var(--on-surface);background:var(--surface-container-high);border:1px solid transparent;border-radius:999px;padding:10px 18px;outline:none;transition:border-color .12s ease,background .12s ease}.know-newbundle input:focus{border-color:var(--primary);background:var(--surface-container-highest)}.know-table{width:100%;border-collapse:collapse;font-size:13px}.know-table td{padding:9px 18px;border-bottom:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent);vertical-align:baseline}.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;font-size:11px;color:var(--on-surface-variant);margin-left:8px}.know-type{font-size:11.5px;color:var(--on-surface-variant);white-space:nowrap}.know-flags{text-align:right;white-space:nowrap}.chip.trust.unverified{color:var(--on-surface-variant)}.chip.trust.machine-confirmed{border-color:transparent;background:var(--secondary-container);color:var(--on-secondary-container)}.chip.trust.human-reviewed{border-color:transparent;color:var(--on-success-container);background:var(--success-container)}.chip.stale,.chip.deprecated{border-color:transparent;color:var(--on-error-container);background:var(--error-container)}.chip.draft{border-color:color-mix(in srgb,var(--primary) 45%,var(--outline-variant));color:var(--primary)}.know-sub{display:flex;align-items:center;gap:8px;margin:-8px 2px 14px}.know-sub .rid{font-family:var(--font-mono),monospace;font-size:12px;color:var(--on-surface-variant)}.know-meta{display:flex;flex-direction:column;gap:8px;padding:12px 18px;font-size:13px}.know-meta>div{display:flex;gap:14px;align-items:baseline}.know-meta .microlabel{width:90px;flex:none}.know-verify-entry{display:inline-block;margin-right:14px}.know-folder-row td{padding:10px 18px 4px;border-bottom:none}.know-folder{font-family:var(--font-mono),monospace;font-size:11px;color:var(--on-surface-variant);letter-spacing:.04em}.know-indent{padding-left:32px!important}.team-screen{grid-template-columns:240px minmax(0,1fr)}.team-screen.has-sessions{grid-template-columns:240px 260px minmax(0,1fr)}.team-screen.has-sessions.has-knowledge{grid-template-columns:240px 260px minmax(0,1fr) var(--kside-w, 460px)}.knowledge-side{position:sticky;border-left:1px solid var(--outline-variant);border-right:0}.kside-resizer{position:absolute;left:-3px;top:0;bottom:0;width:7px;cursor:col-resize;z-index:4}.kside-resizer:hover{background:color-mix(in srgb,var(--primary) 25%,transparent)}.kside-bundle{padding:6px 0}.kside-bundle+.kside-bundle{border-top:1px solid var(--outline-variant)}.kside-bundle-name{display:block;padding:6px 14px;font-size:12px;font-weight:600;color:var(--on-surface);text-decoration:none}.kside-bundle-name:hover{color:var(--primary)}.kside-bundle-name .num{font-weight:400;color:var(--on-surface-variant)}.kside-row{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:5px 14px 5px 20px;font-size:12px;color:var(--on-surface-variant)}.kside-row:hover{background:color-mix(in srgb,var(--on-surface) 5%,transparent);color:var(--on-surface)}.kside-row.active{color:var(--on-surface);font-weight:500}.kside-title{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.kside-stale{font-size:9px;text-transform:uppercase;letter-spacing:.05em;color:var(--error, #b3261e);border:1px solid currentColor;border-radius:999px;padding:0 6px}.kside-body.md-body{height:auto;overflow:visible;padding:6px 14px 10px 20px;font-size:12px;border-bottom:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent)}.concept-md{height:auto;overflow:visible}.kside-actions{display:flex;justify-content:flex-end;gap:8px;margin:2px 0 6px}.kside-edit{padding:6px 14px 10px 20px;border-bottom:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent)}.kside-edit .concept-edit{width:100%;box-sizing:border-box}.kside-edit .kside-actions{margin-top:8px}.kside-reopen{position:fixed;right:14px;top:60px;z-index:5;font-size:11px;color:var(--on-surface-variant);background:var(--surface-container-high);border:1px solid var(--outline-variant);border-radius:999px;padding:4px 12px}.kside-reopen:hover{color:var(--on-surface);background:var(--surface-container-highest, var(--surface-container-high))}@media(max-width:1099px){.knowledge-side,.kside-reopen{display:none}.team-screen.has-sessions.has-knowledge{grid-template-columns:240px 260px minmax(0,1fr)}}.team-emoji{font-size:17px;line-height:1.3;flex:none}.team-emoji-lg{font-size:34px;line-height:1}.member-view{display:flex;flex-direction:column;gap:16px}.member-view .detail-head{margin-bottom:0}.m3-list{display:flex;flex-direction:column;padding:4px 0}.m3-row{display:flex;align-items:center;gap:14px;padding:12px 18px;text-align:left;color:inherit}.m3-row+.m3-row,.m3-expand+.m3-row{border-top:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent)}button.m3-toggle{background:none;border:0;width:100%;font:inherit;cursor:pointer}button.m3-toggle:hover{background:color-mix(in srgb,var(--on-surface) 4%,transparent)}.m3-ico{flex:none;width:32px;height:32px;display:grid;place-items:center;font-size:14px;color:var(--on-secondary-container);background:var(--secondary-container);border-radius:50%}.m3-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}.m3-head{font-size:13.5px;font-weight:500;display:flex;align-items:center;gap:8px}.m3-sub{font-size:12px;color:var(--on-surface-variant);line-height:1.5}.m3-sub code{font-size:11px}.m3-sub a{color:inherit}.m3-ellipsis{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.m3-chev{flex:none;color:var(--on-surface-variant);font-size:11px;transition:transform .14s ease}.m3-chev.open{transform:rotate(180deg)}.m3-expand{padding:2px 18px 16px 64px}.m3-expand pre{margin:0;white-space:pre-wrap;font:12.5px/1.65 var(--font-mono),monospace}.m3-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:3px}.m3-chips .chip{text-decoration:none}.m3-switch{position:relative;flex:none;display:inline-block;width:44px;height:24px;cursor:pointer}.m3-switch input{position:absolute;inset:0;opacity:0;margin:0;cursor:pointer}.m3-switch-track{position:absolute;inset:0;border-radius:999px;pointer-events:none;background:var(--surface-container-highest);border:2px solid var(--outline-variant);transition:background .14s ease,border-color .14s ease}.m3-switch-track:after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:var(--on-surface-variant);transition:transform .14s ease,background .14s ease}.m3-switch input:checked+.m3-switch-track{background:var(--primary);border-color:var(--primary)}.m3-switch input:checked+.m3-switch-track:after{transform:translate(20px);background:var(--on-primary)}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{padding:14px 18px 4px;font-family:var(--font-mono),monospace;font-size:11px;letter-spacing:.05em;color:var(--on-surface-variant)}.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}.know-log-row{display:flex;gap:10px;padding:4px 18px;align-items:baseline}.know-log-text{font-size:12.5px;color:var(--on-surface-variant);line-height:1.55;min-width:0;overflow-wrap:break-word}.know-log-text a{color:var(--primary)}.chip.log-kind{flex:none}.chip.log-verification{border-color:transparent;background:var(--success-container);color:var(--on-success-container)}.chip.log-creation,.chip.log-initialization{border-color:transparent;background:var(--secondary-container);color:var(--on-secondary-container)}.detail-cols{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:16px;align-items:start}@media(max-width:1020px){.detail-cols{grid-template-columns:1fr}}.detail-rail{display:flex;flex-direction:column;gap:16px;min-width:0}.rail-list{padding:4px 0}.rail-kv{display:flex;flex-direction:column;gap:3px;padding:10px 18px}.rail-kv+.rail-kv{border-top:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent)}.rail-kv .v{font-size:12.5px;color:var(--on-surface);overflow-wrap:break-word;display:flex;align-items:center;gap:8px;flex-wrap:wrap}.rail-kv .v.dim{color:var(--on-surface-variant)}.rail-kv a{color:var(--primary)}.concept-edit{display:block;width:100%;border:0;outline:none;resize:vertical;padding:14px 18px;background:var(--surface-container-lowest);color:var(--on-surface);font:12.5px/1.65 var(--font-mono),monospace;border-bottom:1px solid color-mix(in srgb,var(--outline-variant) 55%,transparent)}.side-row .row-x{flex:none;align-self:center;opacity:0;border:0;background:transparent;color:var(--on-surface-variant);font-size:11px;line-height:1;padding:4px 6px;border-radius:8px;cursor:pointer;transition:opacity .1s ease,background .1s ease,color .1s ease}.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)}.team-wf-list{display:flex;flex-wrap:wrap;gap:8px;padding:12px 18px}.team-wf-list .chip{text-decoration:none}.team-form{display:flex;flex-direction:column;gap:14px;padding:18px;max-width:680px}.team-form-row{display:flex;gap:10px;align-items:flex-end}.team-field{display:flex;flex-direction:column;gap:5px}.team-field,.team-field-label{font-size:11px;font-weight:500;color:var(--on-surface-variant);letter-spacing:.045em;text-transform:capitalize}.team-field input,.team-field select,.team-field textarea{font:13px/1.5 var(--font-mono),monospace;color:var(--on-surface);background:var(--surface-container-high);border:1px solid transparent;border-radius:12px;padding:9px 14px;outline:none;text-transform:none;letter-spacing:normal;transition:border-color .12s ease,background .12s ease}.team-field textarea{resize:vertical;font-family:var(--font-mono),monospace}.team-field input:focus,.team-field select:focus,.team-field textarea:focus{border-color:var(--primary);background:var(--surface-container-highest)}.emoji-pick{display:flex;gap:6px;flex-wrap:wrap}.emoji-pick button{font-size:16px;padding:6px 10px;background:transparent;border:1px solid var(--outline-variant);border-radius:12px;cursor:pointer;transition:background .12s ease,border-color .12s ease}.emoji-pick button:hover{background:color-mix(in srgb,var(--on-surface) 6%,transparent)}.emoji-pick button.active{border-color:transparent;background:var(--secondary-container)}.wf-checks{display:flex;flex-direction:column;gap:7px;padding:4px 0}.wf-checks label{display:flex;align-items:baseline;gap:8px;font-size:13px;color:var(--on-surface-variant);text-transform:none;letter-spacing:normal;cursor:pointer}.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(max-width:900px){.team-screen,.team-screen.has-sessions,.team-screen.has-sessions.has-knowledge{grid-template-columns:1fr}.team-form-row{flex-direction:column;align-items:stretch}}
@@ -15,8 +15,8 @@
15
15
  } catch (e) {}
16
16
  })();
17
17
  </script>
18
- <script type="module" crossorigin src="/assets/index-y3HSj8q3.js"></script>
19
- <link rel="stylesheet" crossorigin href="/assets/index-Dw72YV0e.css">
18
+ <script type="module" crossorigin src="/assets/index-ClBNh2Ks.js"></script>
19
+ <link rel="stylesheet" crossorigin href="/assets/index-_Ppo4YH9.css">
20
20
  </head>
21
21
  <body>
22
22
  <div id="root"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netnodeag/kraftwerk",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "description": "Deterministic workflow-as-code framework: agents (persona + model + tools + harness) run in bounded phases on headless CLI harnesses (claude -p, codex exec, pi); code owns the control flow, envelopes + gates judge the results",
5
5
  "keywords": [
6
6
  "agents",
@@ -0,0 +1,40 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://raw.githubusercontent.com/NETNODEAG/kraftwerk/main/kraftwerk/schema/kraftwerk.schema.json",
4
+ "title": "kraftwerk project config",
5
+ "description": "kraftwerk.yml at the project root: config file and root marker for the kraftwerk CLI. All fields are optional — an empty file is valid.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "name": {
10
+ "type": "string",
11
+ "description": "Display name of the project (\"environment\"), shown in the inspector header and browser tab"
12
+ },
13
+ "icon": {
14
+ "type": "string",
15
+ "description": "Emoji used as the inspector favicon (browser-tab icon), e.g. \"⚡\""
16
+ },
17
+ "port": {
18
+ "type": "integer",
19
+ "minimum": 1,
20
+ "maximum": 65535,
21
+ "description": "Port `kraftwerk ui` listens on. Default: 1981 (the --port flag wins over this)"
22
+ },
23
+ "workflows": {
24
+ "type": "string",
25
+ "description": "Workflows root relative to this file. Default: src/workflows or workflows"
26
+ },
27
+ "output": {
28
+ "type": "string",
29
+ "description": "Run-artifact directory relative to this file. Default: output"
30
+ },
31
+ "knowledge": {
32
+ "type": "string",
33
+ "description": "OKF knowledge-bundle root relative to this file. Default: knowledge"
34
+ },
35
+ "agents": {
36
+ "type": "string",
37
+ "description": "Team agent-definition root relative to this file. Default: agents"
38
+ }
39
+ }
40
+ }