anentrypoint-design 0.0.96 → 0.0.97
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/247420.app.js
CHANGED
|
@@ -2,4 +2,4 @@ var qn=Object.defineProperty;var At=(e,t)=>{for(var n in t)qn(e,n,{get:t[n],enum
|
|
|
2
2
|
( o.o )
|
|
3
3
|
> ^ <`;function pn({name:e="aicat",status:t="idle",face:n}={}){return h("div",{class:"aicat-portrait"},h("pre",{class:"aicat-face"},n||xt),h("div",{class:"aicat-meta"},h("span",{class:"name"},e),h("span",{class:"status"},h("span",{class:"dot"},"\u25CF "),t)))}function un({name:e="aicat",messages:t=[],thinking:n,composer:s,status:o="online \xB7 purring"}={}){let a=t.map(i=>i.who==="them"?{...i,aicat:!0,avatar:i.avatar||"=^.^="}:i),r=n?[...a,{who:"them",aicat:!0,avatar:"=^.^=",typing:!0,key:"_thinking"}]:a;return h("div",{class:"chat"},h("div",{class:"chat-head"},h("span",{class:"dot"}),h("span",{},e),h("span",{class:"sub"}," \xB7 "+o),h("span",{class:"spread"}),h("span",{class:"sub"},String(t.length).padStart(2,"0")+" turns")),h("div",{class:"chat-thread"},...r.map((i,l)=>Fe({...i,key:i.key!=null?i.key:l}))),s||null)}F("chat",()=>({messages:Oe.messages,lastKindCounts:{...Oe.lastKindCounts}}));var U=I;var hn={dir:"\u25A3",image:"\u25F0",video:"\u25B0",audio:"\u25CE",code:"\u2318",text:"\xA7",archive:"\u25D0",document:"\u25A2",symlink:"\u2197",other:"\u25CC"};function Le(e){return hn[e]||hn.other}function Ce(e){if(e==null||e===0)return"\u2014";let t=["B","KB","MB","GB","TB"],n=0,s=e;for(;s>=1024&&n<t.length-1;)s/=1024,n++;return s.toFixed(n===0?0:1)+" "+t[n]}function Dt({type:e="other"}={}){return U("span",{class:"ds-file-icon","data-file-type":e},Le(e))}function Et({name:e,type:t="other",size:n,modified:s,code:o,onOpen:a,onAction:r,active:i,key:l}={}){let p=[t==="dir"?null:Ce(n),s||null].filter(Boolean).join(" \xB7 ");return U("div",{key:l,class:"ds-file-row row"+(i?" active":""),"data-file-type":t,onclick:a},o!=null?U("span",{class:"code"},o):null,Dt({type:t}),U("span",{class:"title"},e),U("span",{class:"ds-file-meta meta"},p||"\u2014"),r?U("span",{class:"ds-file-actions",onclick:f=>f.stopPropagation()},U("button",{class:"ds-file-act",title:"download",onclick:()=>r("download")},"\u2193"),U("button",{class:"ds-file-act",title:"rename",onclick:()=>r("rename")},"\u270E"),U("button",{class:"ds-file-act ds-file-act-warn",title:"delete",onclick:()=>r("delete")},"\u2715")):null)}function mn({files:e=[],onOpen:t,onAction:n,emptyText:s="no files here yet"}={}){return e.length?U("div",{class:"ds-file-grid"},...e.map((o,a)=>Et({key:o.path||o.name+a,name:o.name,type:o.type,size:o.size,modified:o.modified,code:o.code,active:o.active,onOpen:t?()=>t(o):null,onAction:n?r=>n(r,o):null}))):M({text:s})}function fn({left:e=[],right:t=[]}={}){return U("div",{class:"ds-file-toolbar"},U("div",{class:"ds-file-toolbar-left"},...e),U("div",{class:"ds-file-toolbar-right"},...t))}function gn({children:e,dragover:t,onDrop:n,onDragOver:s,onDragLeave:o,label:a="drop files here",onPick:r}={}){return U("div",{class:"ds-dropzone"+(t?" dragover":""),ondragover:i=>{i.preventDefault(),s&&s(i)},ondragleave:i=>{o&&o(i)},ondrop:i=>{i.preventDefault(),n&&n(i.dataTransfer.files)}},U("div",{class:"ds-dropzone-inner"},U("span",{class:"ds-dropzone-glyph"},"\u21EA"),U("span",{class:"ds-dropzone-label"},a),r?z({onClick:r,children:"pick files"}):null),...Array.isArray(e)?e:e?[e]:[])}function bn({items:e=[]}={}){return e.length?U("div",{class:"ds-upload-progress"},...e.map((t,n)=>U("div",{key:t.name+n,class:"ds-upload-item"+(t.done?" done":"")+(t.error?" error":"")},U("span",{class:"ds-upload-name"},t.name),U("span",{class:"ds-upload-bar"},U("span",{class:"ds-upload-fill","data-pct":String(Math.max(0,Math.min(100,t.pct||0)))})),U("span",{class:"ds-upload-pct"},t.error?"err":t.done?"ok":(t.pct||0)+"%")))):null}function M({text:e="nothing here",glyph:t="\u25CC"}={}){return U("div",{class:"ds-file-empty"},U("span",{class:"ds-file-empty-glyph"},t),U("span",{class:"ds-file-empty-text"},e))}function vn({segments:e=[],onNav:t,root:n="root"}={}){let s=[U("button",{key:"root",class:"ds-crumb-seg",onclick:()=>t&&t(0)},n)];return e.forEach((o,a)=>{s.push(U("span",{key:"sep"+a,class:"ds-crumb-sep"},"\u203A")),s.push(U("button",{key:"seg"+a,class:"ds-crumb-seg"+(a===e.length-1?" leaf":""),onclick:()=>t&&t(a+1)},o))}),U("div",{class:"ds-crumb-path"},...s)}var Q=I;function It({onClose:e,children:t,kind:n=""}={}){return Q("div",{class:"ds-modal-backdrop",onclick:s=>{s.target===s.currentTarget&&e&&e()}},Q("div",{class:"ds-modal"+(n?" ds-modal-"+n:"")},...Array.isArray(t)?t:[t]))}function wn({title:e="confirm",message:t,confirmLabel:n="confirm",cancelLabel:s="cancel",destructive:o,onConfirm:a,onCancel:r}={}){return It({onClose:r,kind:"small",children:[Q("div",{class:"ds-modal-head"},e),Q("div",{class:"ds-modal-body"},t||""),Q("div",{class:"ds-modal-actions"},z({onClick:r,children:s}),Q("button",{class:o?"btn-stamp flame":"btn-stamp green",onclick:a},n))]})}function yn({title:e="name",value:t="",placeholder:n="",confirmLabel:s="ok",cancelLabel:o="cancel",onConfirm:a,onCancel:r,onInput:i}={}){return It({onClose:r,kind:"small",children:[Q("div",{class:"ds-modal-head"},e),Q("div",{class:"ds-modal-body"},Q("input",{class:"input ds-modal-input",type:"text",value:t,placeholder:n,autofocus:!0,oninput:l=>i&&i(l.target.value),onkeydown:l=>{l.key==="Enter"&&(l.preventDefault(),a&&a(l.target.value)),l.key==="Escape"&&(l.preventDefault(),r&&r())}})),Q("div",{class:"ds-modal-actions"},z({onClick:r,children:o}),Q("button",{class:"btn-stamp green",onclick:()=>a&&a(t)},s))]})}function kn({src:e,type:t="other",name:n}={}){return t==="image"?Q("img",{class:"ds-preview-media",src:e,alt:n||""}):t==="video"?Q("video",{class:"ds-preview-media",src:e,controls:!0}):t==="audio"?Q("audio",{class:"ds-preview-audio",src:e,controls:!0}):Q("div",{class:"ds-preview-fallback"},Q("span",{class:"ds-preview-glyph"},Le(t)),Q("span",{},"no inline preview for "+(t||"this file")))}function Sn({content:e="",lang:t}={}){return Q("pre",{class:"ds-preview-code"+(t?" lang-"+t:"")},Q("code",{class:t?"language-"+t:""},e))}function xn({content:e="",truncated:t}={}){return Q("pre",{class:"ds-preview-text"},Q("code",{},e),t?Q("div",{class:"ds-preview-truncated"},"\u2026 (truncated)"):null)}function Dn({file:e,body:t,onClose:n,onAction:s}={}){if(!e)return null;let o=[e.type,e.size!=null?Ce(e.size):null,e.modified||null].filter(Boolean).join(" \xB7 ");return It({onClose:n,kind:"preview",children:[Q("div",{class:"ds-modal-head ds-preview-head","data-file-type":e.type||"other"},Q("span",{class:"ds-preview-name"},e.name||""),Q("span",{class:"ds-preview-meta"},o),Q("span",{class:"ds-preview-actions"},s?Q("button",{class:"ds-file-act",title:"download",onclick:()=>s("download")},"\u2193"):null,Q("button",{class:"ds-file-act",title:"close",onclick:n},"\u2715"))),Q("div",{class:"ds-preview-body","data-file-type":e.type||"other"},...Array.isArray(t)?t:[t])]})}var k=I;function jt({id:e,name:t,icon:n,active:s,badge:o,onClick:a}={}){let r=(t||"?").slice(0,2).toUpperCase();return k("div",{class:"cm-server-icon"+(s?" active":""),onclick:a,title:t,"data-id":e},k("span",{class:"cm-server-pill"}),n?k("img",{src:n,alt:t}):k("span",{},r),o?k("span",{class:"cm-server-badge"},o>99?"99+":String(o)):null)}function Gt({servers:e=[],activeId:t,onSelect:n,onAdd:s}={}){return k("div",{class:"cm-server-rail"},k("a",{class:"cm-server-back",href:"../",title:"Back"},"\u25F0"),k("div",{class:"cm-server-sep"}),...e.map(o=>jt({...o,active:o.id===t,onClick:()=>n?.(o.id)})),s?k("button",{class:"cm-server-add",onclick:s,title:"Add server"},"+"):null)}function Nt({id:e,name:t,type:n="text",active:s,voiceActive:o,onClick:a,onContext:r}={}){let i=n==="voice"?"\u{1F50A}":n==="forum"?"\u25FB":"#";return k("div",{class:"cm-channel-item"+(s?" active":"")+(o?" voice-active":""),"data-id":e,onclick:a,oncontextmenu:l=>{l.preventDefault(),r?.(e,l.clientX,l.clientY)}},k("span",{class:"cm-ch-icon"},i),k("span",{class:"cm-ch-name"},t))}function et({id:e,name:t,channels:n=[],collapsed:s,activeId:o,onToggle:a,onAddChannel:r,onChannelClick:i,onChannelContext:l}={}){return k("div",{class:"cm-channel-category"},k("div",{class:"cm-category-header"+(s?" collapsed":""),onclick:()=>a?.(e)},k("svg",{class:"cm-cat-arrow",viewBox:"0 0 24 24"},k("path",{d:"M7 10l5 5 5-5z"})),k("span",{class:"cm-cat-name"},t),r?k("button",{class:"cm-cat-add",onclick:p=>{p.stopPropagation(),r(e)},title:"Add channel"},"+"):null),s?null:k("div",{class:"cm-cat-channels"},...n.map(p=>Nt({...p,active:p.id===o,onClick:()=>i?.(p),onContext:l}))))}function En({identity:e,speaking:t,color:n}={}){let s=(e||"?").slice(0,1).toUpperCase();return k("div",{class:"cm-voice-user"+(t?" speaking":"")},k("div",{class:"cm-voice-user-avatar",style:n?`background:${n}`:""},s),k("span",{class:"cm-voice-user-name"},e))}function Ut({name:e,tag:t,color:n,muted:s,deafened:o,onMute:a,onDeafen:r,onSettings:i}={}){let l=(e||"?").slice(0,1).toUpperCase();return k("div",{class:"cm-user-panel"},k("div",{class:"cm-user-avatar",style:n?`background:${n}`:""},k("span",{class:"cm-user-status-dot"}),l),k("div",{class:"cm-user-info"},k("div",{class:"cm-user-name"},e||"You"),t?k("div",{class:"cm-user-tag"},t):null),k("div",{class:"cm-user-controls"},k("button",{class:"cm-user-btn"+(s?" muted":""),onclick:a,title:s?"Unmute":"Mute"},s?"\u{1F507}":"\u{1F3A4}"),k("button",{class:"cm-user-btn"+(o?" deafened":""),onclick:r,title:o?"Undeafen":"Deafen"},o?"\u{1F515}":"\u{1F3A7}"),k("button",{class:"cm-user-btn",onclick:i,title:"Settings"},"\u2699")))}function Qt({serverName:e,channels:t=[],categories:n=[],activeId:s,collapsedCats:o=new Set,onChannelClick:a,onCategoryToggle:r,onAddChannel:i,onChannelContext:l,userPanelProps:p}={}){let f=t.filter(g=>!g.categoryId||!n.find(c=>c.id===g.categoryId)),u=[...n].sort((g,c)=>(g.position||0)-(c.position||0));return k("div",{class:"cm-channel-sidebar"},k("div",{class:"cm-server-header"},k("span",{class:"cm-server-header-name"},e||"Server")),k("div",{class:"cm-channel-list"},...u.map(g=>et({id:g.id,name:g.name,channels:t.filter(c=>c.categoryId===g.id).sort((c,d)=>(c.position||0)-(d.position||0)),collapsed:o.has(g.id),activeId:s,onToggle:r,onAddChannel:i,onChannelClick:a,onChannelContext:l})),f.length?et({id:"uncategorized",name:"CHANNELS",channels:f,activeId:s,onChannelClick:a,onChannelContext:l}):null),p?Ut(p):null)}function Tt({identity:e,name:t,color:n,status:s="online"}={}){let o=(t||e||"?").slice(0,1).toUpperCase();return k("div",{class:"cm-member-item"},k("div",{class:"cm-member-avatar",style:n?`background:${n}`:""},k("span",{class:"cm-member-status"+(s==="online"?" online":"")}),o),k("span",{class:"cm-member-name"},t||e))}function Mt({categories:e=[],open:t}={}){return k("div",{class:"cm-member-list"+(t?" open":"")},...e.flatMap(n=>[k("div",{class:"cm-member-category",key:n.label},`${n.label} \u2014 ${n.members.length}`),...n.members.map((s,o)=>Tt({...s,key:s.identity||o}))]))}function In({icon:e="#",name:t,topic:n,toolbar:s=[]}={}){return k("div",{class:"cm-chat-header"},k("span",{class:"cm-chat-header-icon"},e),k("span",{class:"cm-chat-header-name"},t),n?k("span",{class:"cm-chat-header-topic"},n):null,k("div",{class:"cm-chat-header-toolbar"},...s))}function Pt({channelName:e,status:t,muted:n,deafened:s,onMute:o,onDeafen:a,onLeave:r,open:i}={}){return k("div",{class:"cm-voice-strip"+(i?" open":"")},k("div",{class:"cm-vs-label"},k("span",{class:"cm-vs-channel"},"\u{1F50A} "+(e||"voice")),k("span",{class:"cm-vs-status"},t||"connected")),k("button",{class:"cm-vs-btn",onclick:o,title:"Mute"},n?"\u{1F507}":"\u{1F3A4}"),k("button",{class:"cm-vs-btn",onclick:a,title:"Deafen"},s?"\u{1F515}":"\u{1F3A7}"),k("button",{class:"cm-vs-btn danger",onclick:r,title:"Leave"},"\u2715"))}function jn({serverRailProps:e,sidebarProps:t,children:n,memberListProps:s,voiceStripProps:o}={}){return k("div",{class:"cm-shell"},e?Gt(e):null,t?Qt(t):null,k("div",{class:"cm-main"},...Array.isArray(n)?n:[n]),s?Mt(s):null,o?Pt(o):null)}var _=e=>(e.name||"").replace(/^gm:/,"").replace(/-/g," "),pe=()=>{try{return JSON.parse(localStorage.getItem("fd_recent_cwds")||"[]")}catch{return[]}},ge=e=>{if(!e)return;let t=pe().filter(n=>n!==e);t.unshift(e),localStorage.setItem("fd_recent_cwds",JSON.stringify(t.slice(0,5)))};function os(e){if(typeof e!="string")return null;let t=e.trim();if(!t||t[0]!=="{"&&t[0]!=="[")return null;try{return JSON.parse(t)}catch{return null}}function Ot(e,t=""){let n=[];for(let[s,o]of Object.entries(e||{})){let a=t?t+"."+s:s;o==null?n.push([a,"\u2014"]):typeof o=="object"&&!Array.isArray(o)?n.push(...Ot(o,a)):Array.isArray(o)?n.push([a,o.length===0?"\u2014":o.map(r=>typeof r=="object"?"{\u2026}":String(r)).join(", ")]):n.push([a,String(o)])}return n}function Gn(e){let t=[];for(let[s,o]of Object.entries(e||{}))o&&typeof o=="object"&&!Array.isArray(o)&&t.push(b({title:s,children:Y({rows:Ot(o)})}));let n=Object.entries(e||{}).filter(([s,o])=>!(o&&typeof o=="object"&&!Array.isArray(o))).map(([s,o])=>[s,Array.isArray(o)?"["+o.length+"]":String(o??"\u2014")]);return n.length&&t.unshift(b({title:"top-level",children:Y({rows:n})})),t}function ne(e,t){if(e){e.innerHTML="";for(let n of t){let s=document.createElement("div");if(s.className="fd-msg"+(n.role==="assistant"?" fd-msg-assistant":n.role==="tool"?" fd-msg-tool":""),n.role==="tool"){let o=document.createElement("details");o.className="fd-tool-call";let a=document.createElement("summary");a.textContent=(n.name||"tool")+(n.argsSummary?" \xB7 "+n.argsSummary:""),o.appendChild(a);let r=document.createElement("div");r.className="fd-tool-body";let i=os(n.content);if(i&&typeof i=="object"){let l=document.createElement("table");l.className="kv fd-tool-kv";let p=document.createElement("tbody");for(let[f,u]of Ot(i)){let g=document.createElement("tr"),c=document.createElement("td");c.textContent=f;let d=document.createElement("td");d.textContent=String(u).length>240?String(u).slice(0,240)+"\u2026":String(u),g.appendChild(c),g.appendChild(d),p.appendChild(g)}l.appendChild(p),r.appendChild(l)}else{let l=document.createElement("pre");l.className="fd-pre",l.textContent=n.content||"",r.appendChild(l)}o.appendChild(r),s.appendChild(o)}else{let o=document.createElement("pre");o.className="fd-pre",o.textContent=n.content||"",s.appendChild(o)}e.appendChild(s)}e.scrollTop=e.scrollHeight}}var E=I;async function be(e){let t=await e.pi.sessions.list(),n=e.pi.health(),s=(o,a)=>o==="ts"&&typeof a=="number"?new Date(a).toISOString().replace("T"," ").slice(0,19)+" UTC":typeof a=="boolean"?a?"\u2713":"\u2717":String(a);return[T({title:"freddie",body:"open js agent harness.",accent:e.version||"web"}),J({items:[[t.length,"sessions"],[e.pi.tools.size,"tools"],[e.pi.skills.size,"skills"]]}),b({title:"quick start",children:Y({rows:[["open chat","click 'chat' \u2014 set a working directory"],["pick skill","software dev, research, planning"],["set api key","keys tab \u2192 click chip"],["add cron","cron tab \u2192 form"]]})}),b({title:"system status",children:Y({rows:Object.entries(n).map(([o,a])=>[o,s(o,a)])})})]}function as(e){if(!e)return"";let t=typeof e=="string"?Date.parse(e):Number(e);if(!Number.isFinite(t))return"";let n=(Date.now()-t)/1e3;return n<60?Math.floor(n)+"s ago":n<3600?Math.floor(n/60)+"m ago":n<86400?Math.floor(n/3600)+"h ago":n<86400*30?Math.floor(n/86400)+"d ago":new Date(t).toISOString().slice(0,10)}var Nn={web:"kit",cli:"doc",telegram:"preview",slack:"preview",discord:"preview",api_server:"external",webhook:"external"};async function ve(e){let t=await e.pi.sessions.list(),n=window.__fd_sessFilter=window.__fd_sessFilter||{q:""},s=(n.q||"").toLowerCase(),o=s?t.filter(p=>(p.title||"").toLowerCase().includes(s)||(p.id||"").includes(s)||(p.platform||"").toLowerCase().includes(s)||(p.cwd||"").toLowerCase().includes(s)):t,a=async p=>{let f=await e.pi.sessions.getMessages(p.id),u=window.__fd_chatState=window.__fd_chatState||{messages:[],busy:!1,sessionId:null,cwd:"",skill:"",provider:"",model:""};u.sessionId=p.id,u.messages=f.map(g=>({role:g.role,content:String(g.content||"")})),p.cwd&&(u.cwd=p.cwd),p.skill&&(u.skill=p.skill),typeof window.__fd_nav=="function"&&window.__fd_nav("chat")},r=o.map(p=>{let f=Nn[p.platform]||"doc",u=[p.platform||"\u2014",p.model||"\u2014",p.skill?_({name:p.skill}):null].filter(Boolean),g=p.cwd?"\u2026"+p.cwd.slice(-28):"",c=as(p.updated_at||p.created_at||p.ts);return E("div",{key:p.id,class:"fd-list-row","data-cat":f,role:"button",tabindex:"0",onclick:()=>a(p),onkeydown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),a(p))}},E("span",{class:"fd-list-code"},(p.id||"").slice(0,8)),E("div",{class:"fd-list-main"},E("div",{class:"fd-list-title"},p.title||"(untitled)"),E("div",{class:"fd-list-sub"},u.join(" \xB7 "))),E("div",{class:"fd-list-meta"},g?E("span",{class:"fd-list-meta-mono"},g):null,c?E("span",{class:"fd-list-meta-rel"},c):null))}),i=E("input",{type:"search","aria-label":"filter sessions",placeholder:"filter by title / id / platform / cwd\u2026",value:n.q,oninput:p=>{n.q=p.target.value,typeof window.__fd_nav=="function"&&window.__fd_nav("sessions")},class:"fd-search"}),l=t.length===0?M({text:"no sessions yet \u2014 start one in /chat",glyph:"\u2709"}):o.length===0?M({text:'no matches for "'+n.q+'"',glyph:"\u2315"}):E("div",{class:"fd-list"},...r);return[T({title:"sessions",body:"every chat turn lives here. click a row to continue.",accent:t.length+" total"}),J({items:[[t.length,"sessions"],[o.length,"shown"]]}),b({title:"sessions",count:o.length,right:i,children:l})]}async function we(e){let t=e.pi.projects.list(),n=e.pi.projects.active(),s=E("div",{class:"fd-list"},...t.map(o=>{let a=o.name===n?.name;return E("div",{key:o.name,class:"fd-list-row","data-cat":a?"kit":"doc",role:"button",tabindex:"0",onclick:()=>{a||e.pi.projects.setActive(o.name)},onkeydown:r=>{(r.key==="Enter"||r.key===" ")&&!a&&(r.preventDefault(),e.pi.projects.setActive(o.name))}},E("span",{class:"fd-list-code"},a?"\u25CF":"\u25CB"),E("div",{class:"fd-list-main"},E("div",{class:"fd-list-title"},o.name+(a?" (active)":"")),E("div",{class:"fd-list-sub"},o.path)))}));return[T({title:"projects",body:"each project is its own ~/.freddie home.",accent:n?"active \xB7 "+n.name:"no active project"}),J({items:[[t.length,"projects"],[n?.name||"\u2014","active"]]}),b({title:"add project",children:E("form",{class:"row-form",onsubmit:o=>{o.preventDefault(),e.pi.projects.create({name:o.target.elements.name.value,path:o.target.elements.path.value})}},E("input",{name:"name",placeholder:"name",required:"true"}),E("input",{name:"path",placeholder:"/abs/path"}),E("button",{type:"submit",class:"btn-primary"},"add"))}),b({title:"all projects",count:t.length,children:t.length?s:M({text:"no projects",glyph:"\u25C6"})})]}async function ye(e){let t=typeof e.pi.agents=="function"?await e.pi.agents():{count:0,turns:0,active:null},n=await e.pi.sessions.list(),s=n.slice(0,10),o=!t.count;return[T({title:"agents",body:"agent state machine snapshot. one xstate per turn.",accent:o?"idle":t.count+" active"}),J({items:[[t.count||0,"active"],[t.turns||0,"turns total"],[n.length,"sessions in store"]]}),o?b({title:"no agent running",children:M({text:"start an agent by sending a prompt in /chat",glyph:"\u25CC"})}):b({title:"current agent",children:Y({rows:[["active session",t.active||"(none)"],["total turns",String(t.turns||0)],["last activity",t.last_activity?new Date(t.last_activity).toISOString().replace("T"," ").slice(0,19)+" UTC":"\u2014"]]})}),b({title:"recent sessions",count:s.length,children:s.length===0?M({text:"no recent sessions",glyph:"\u2709"}):E("div",{class:"fd-list"},...s.map(a=>E("div",{key:a.id,class:"fd-list-row","data-cat":Nn[a.platform]||"doc"},E("span",{class:"fd-list-code"},(a.id||"").slice(0,8)),E("div",{class:"fd-list-main"},E("div",{class:"fd-list-title"},a.title||"(untitled)"),E("div",{class:"fd-list-sub"},[a.platform||"\u2014",a.model||"\u2014"].join(" \xB7 "))),E("div",{class:"fd-list-meta"},E("span",{class:"fd-list-meta-mono"},String(a.turns??a.message_count??0)+" turns")))))})]}async function ke(e){let t=await e.pi.sessions.list(),n=[...e.pi.tools.values()],s=[...e.pi.skills.values()],o=t.reduce((u,g)=>{let c=g.platform||"(unset)";return u[c]=(u[c]||0)+1,u},{}),a=t.reduce((u,g)=>{let c=g.model||"(unset)";return u[c]=(u[c]||0)+1,u},{}),r=n.reduce((u,g)=>{let c=g.toolset||"core";return u[c]=(u[c]||0)+1,u},{}),i=s.reduce((u,g)=>{let c=g.category||"other";return u[c]=(u[c]||0)+1,u},{}),l=u=>Object.entries(u).sort((g,c)=>c[1]-g[1]),p={"by platform":"kit","by model":"preview","by toolset":"doc","by skill category":"external"},f=(u,g,c)=>b({title:u,count:Object.keys(g).length,children:Object.keys(g).length===0?M({text:"no data",glyph:c}):E("div",{class:"fd-list fd-list-compact"},...l(g).map(([d,w],S)=>E("div",{key:d,class:"fd-list-row","data-cat":p[u]||"doc"},E("span",{class:"fd-list-code"},String(S+1).padStart(2,"0")),E("div",{class:"fd-list-main"},E("div",{class:"fd-list-title"},d)),E("div",{class:"fd-list-meta"},E("span",{class:"fd-list-meta-mono"},String(w))))))});return[T({title:"analytics",body:"shape of work \u2014 what platforms, what models, what tools."}),J({items:[[t.length,"sessions"],[n.length,"tools"],[s.length,"skills"]]}),f("by platform",o,"\u25C9"),f("by model",a,"\u25CE"),f("by toolset",r,"\u2692"),f("by skill category",i,"\u25C8")]}var P=I;function is(e){let t=[],n=null,s="";for(let o of e.split(`
|
|
4
4
|
`))if(o.startsWith("event: "))n=o.slice(7).trim();else if(o.startsWith("data: "))s=o.slice(6).trim();else if(o===""&&n){try{t.push({event:n,data:JSON.parse(s)})}catch{}n=null,s=""}return t}async function Se(e){let t=[...e.pi.skills.values()],s=(await fetch("/api/providers").then(c=>c.json()).catch(()=>[])).filter(c=>c.configured),o=await fetch("/v1/models").then(c=>c.json()).then(c=>c.data||[]).catch(()=>[]),a=await fetch("/api/models/cached").then(c=>c.json()).catch(()=>({})),r=await fetch("/api/models/sampler").then(c=>c.json()).catch(()=>({status:{}}));(function(){let c=window.__fd_modelPickers=window.__fd_modelPickers||{};c["chat.model"]={key:"chat.model",modelCount:o.length,mountedAt:Date.now()},window.__debug=window.__debug||{},window.__debug.modelPickers=()=>Object.values(window.__fd_modelPickers||{})})();let i=window.__fd_chatState=window.__fd_chatState||{cwd:"",skill:"",provider:"",model:"",messages:[],busy:!1,sessionId:null};try{let c=localStorage.getItem("fd-chat-model");c&&!i.model&&(i.model=c)}catch{}i.cwd||(i.cwd=pe()[0]||"");let l=document.getElementById("app"),p=()=>l.querySelector("#fd-chat-msgs"),f=()=>{i.busy||(i.messages=[],i.sessionId=null,ne(p(),i.messages))},u=async c=>{if(c.preventDefault(),i.busy)return;let d=c.target.elements.prompt,w=d.value.trim();if(w){i.messages.push({role:"user",content:w}),d.value="",d.style.height="auto",i.busy=!0,ge(i.cwd),ne(p(),i.messages);try{let S={prompt:w,cwd:i.cwd||void 0,skill:i.skill||void 0,provider:i.provider||void 0,model:i.model||void 0,sessionId:i.sessionId||void 0},O=await(await fetch("/api/chat",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(S)})).text(),V=is(O),q="";for(let{event:Z,data:A}of V){if(Z==="start"&&A.sessionId&&(i.sessionId=A.sessionId),Z==="done"&&A.sessionId&&(i.sessionId=A.sessionId),Z==="message"){if(A.role==="assistant"){let re=Array.isArray(A.content)?A.content:[{type:"text",text:String(A.content||"")}];for(let $ of re)if($.type==="text"&&(q+=$.text),$.type==="tool_use"){q&&(i.messages.push({role:"assistant",content:q}),q="");let st=Object.keys($.input||{}).slice(0,3).map(m=>m+"="+String($.input[m]).slice(0,20)).join(" ");i.messages.push({role:"tool",name:$.name,argsSummary:st,content:JSON.stringify($.input||{},null,2)})}}else if(A.role==="tool"){let re=Array.isArray(A.content)?A.content[0]:A;i.messages.push({role:"tool",name:"result",argsSummary:"",content:String(re?.content||re?.text||JSON.stringify(re))})}}Z==="done"&&A.result&&!q&&(q=A.result),Z==="error"&&(q="error: "+(A.error||"unknown"))}q&&i.messages.push({role:"assistant",content:q}),V.length||i.messages.push({role:"assistant",content:"(no response)"})}catch(S){i.messages.push({role:"assistant",content:"error: "+S.message})}i.busy=!1,ne(p(),i.messages)}},g=t.reduce((c,d)=>{let w=d.category||"other";return(c[w]=c[w]||[]).push(d),c},{});return setTimeout(()=>ne(p(),i.messages),50),[T({title:"chat",body:"talk to the agent. pick a working dir, optional skill, optional provider.",accent:i.sessionId?"session "+i.sessionId.slice(0,8):"new session"}),b({title:"chat",right:P("button",{class:"btn-primary",onclick:c=>{c.preventDefault(),f()}},"+ new"),children:[P("form",{class:"fd-chat-form",onsubmit:u},P("label",{class:"fd-label"},"working directory"),P("input",{name:"cwd",type:"text",placeholder:"e.g. C:/dev/myproject",value:i.cwd,oninput:c=>{i.cwd=c.target.value}}),P("div",{class:"fd-row"},P("div",{class:"fd-col"},P("label",{class:"fd-label"},"skill"),P("select",{name:"skill",onchange:c=>{i.skill=c.target.value}},P("option",{value:""},"\u2014 no skill \u2014"),...Object.entries(g).map(([c,d])=>P("optgroup",{label:c},...d.map(w=>P("option",{value:w.name,selected:i.skill===w.name?"true":null},_(w))))))),P("div",{class:"fd-col"},P("label",{class:"fd-label"},"provider"),P("select",{name:"provider",onchange:c=>{i.provider=c.target.value}},P("option",{value:""},s.length?"\u2014 auto \u2014":"\u2014 none configured \u2014"),...s.map(c=>P("option",{value:c.name,selected:i.provider===c.name?"true":null},(c.available?"\u25CF ":"\u25CB ")+c.name)))),P("div",{class:"fd-col"},P("label",{class:"fd-label"},"model \xB7 "+o.length+" available"),(function(){let c=r&&r.status?r.status:{},d=S=>{let N=c[S];return N&&N.available===!1},w=o.reduce((S,N)=>{let O=String(N.id||"").indexOf("/"),V=O>0?N.id.slice(0,O):N.owned_by||"other";return(S[V]=S[V]||[]).push(N),S},{});return P("select",{name:"model",onchange:S=>{i.model=S.target.value;try{localStorage.setItem("fd-chat-model",i.model)}catch{}}},P("option",{value:""},"\u2014 auto \u2014"),...Object.entries(w).map(([S,N])=>P("optgroup",{label:S+" \xB7 "+N.length},...N.map(O=>P("option",{value:O.id,selected:i.model===O.id?"true":null,disabled:d(O.id)?"true":null},O.id+(d(O.id)?" \u2715":""))))))})())),P("div",{class:"fd-chat-send-row"},P("textarea",{name:"prompt",placeholder:"describe what you want\u2026",rows:4,oninput:c=>{c.target.style.height="auto",c.target.style.height=Math.min(c.target.scrollHeight,240)+"px"}}),P("button",{type:"submit",class:"btn-primary",disabled:i.busy?"true":null},i.busy?"\u2026":"send"))),P("div",{id:"fd-chat-msgs",class:"fd-chat-thread"})]}),s.length===0?b({title:"no providers configured",children:Y({rows:[["set API key","keys tab \u2192 click chip"],["or use acptoapi","run acptoapi server on localhost:4800"]]})}):null]}var y=I;async function xe(e){let t=typeof e.pi.config?.load=="function"?await e.pi.config.load():{},n=await fetch("/api/providers").then(m=>m.json()).catch(()=>[]),s=n.filter(m=>m.configured),o=await fetch("/api/models/queues").then(m=>m.json()).catch(()=>({})),a=await fetch("/api/models/sampler").then(m=>m.json()).catch(()=>({status:{}})),r=await fetch("/v1/models").then(m=>m.json()).then(m=>m.data||[]).catch(()=>[]),i=Array.isArray(t.agent?.model_preference)?t.agent.model_preference.slice():[];window.__debug=window.__debug||{},window.__debug.models=()=>({providers:n,queues:o,ranking:i,sampler:a.status||{},v1Models:r.length});let l=a.status||{},p=Object.entries(l),f=p.filter(([,m])=>m&&m.available!==!1).length,u=p.length-f,g=async m=>{await e.pi.config.saveValue("agent.model_preference",m),typeof window.__fd_nav=="function"&&window.__fd_nav("models")},c=(m,D)=>{let L=m+D;if(L<0||L>=i.length)return;let ee=i[m];i[m]=i[L],i[L]=ee,g(i)},d=m=>{i.splice(m,1),g(i)},w=(m,D)=>{D.dataTransfer.setData("text/plain",String(m)),D.dataTransfer.effectAllowed="move"},S=m=>{m.preventDefault(),m.dataTransfer.dropEffect="move"},N=(m,D)=>{D.preventDefault();let L=Number(D.dataTransfer.getData("text/plain"));if(!Number.isFinite(L)||L===m)return;let ee=i.splice(L,1)[0];i.splice(m,0,ee),g(i)},O=window.__fd_probeState=window.__fd_probeState||{};async function V(){await Promise.allSettled(s.map(async m=>{O[m.name]="loading";try{let D=await fetch("/api/providers/"+m.name+"/probe",{method:"POST"}).then(L=>L.json());O[m.name]=D.models||D.error||"?"}catch(D){O[m.name]="error: "+D.message}})),typeof window.__fd_nav=="function"&&window.__fd_nav("models")}let q=[],Z=[];for(let m of s){let D=Array.isArray(O[m.name])?O[m.name]:m.models;O[m.name]==="loading"?q.push(b({title:m.name+" \u23F3",children:y("span",{class:"fd-muted"},"probing\u2026")})):D&&D.length>0?q.push(b({title:m.name+(m.available?" \u25CF":" \u25CB"),count:D.length,children:y("div",{class:"fd-list fd-list-compact"},...D.map((ee,Wn)=>y("div",{key:ee,class:"fd-list-row","data-cat":"preview"},y("span",{class:"fd-list-code"},String(Wn+1).padStart(2,"0")),y("div",{class:"fd-list-main"},y("div",{class:"fd-list-title fd-mono"},ee)))))})):Z.push([m.name,m.available?"available":"unavailable",m.modelsError?"error: "+m.modelsError:"\u2014"])}let A=[...q,Z.length?b({title:"unprobed providers",count:Z.length,children:me({headers:["provider","status","note"],rows:Z})}):null].filter(Boolean),re=b({title:"sampler status",count:p.length,right:y("span",{},C({tone:"ok",children:f+" ok"})," ",C({tone:u>0?"miss":"neutral",children:u+" down"})),children:p.length===0?y("span",{class:"fd-muted"},"no sampler entries yet \u2014 probe a provider to populate"):y("div",{class:"fd-list fd-list-compact"},...p.map(([m,D])=>y("div",{key:m,class:"fd-list-row","data-cat":D.available===!1?"external":"kit"},y("span",{class:"fd-list-code"},D.available===!1?"\u2715":"\u25CF"),y("div",{class:"fd-list-main"},y("div",{class:"fd-list-title fd-mono"},m),y("div",{class:"fd-list-sub"},JSON.stringify(D).slice(0,120))))))}),$=m=>{let D=m.target.value;if(!D)return;let L=D.indexOf("/"),ee=i.slice();ee.push(L>0?{provider:D.slice(0,L),model:D.slice(L+1)}:{provider:D,model:""}),g(ee)},st=b({title:"model preference (drag to reorder \xB7 pick from /v1/models including queue/*)",count:i.length,right:y("span",{},y("select",{class:"fd-search",onchange:$},y("option",{value:""},"+ add from /v1/models"),...r.map(m=>y("option",{key:m.id,value:m.id},m.id)))," ",y("button",{class:"btn",onclick:m=>{m.preventDefault(),i.push({provider:"",model:""}),g(i)}},"+ blank")),children:i.length===0?y("span",{class:"fd-muted"},"no preference \u2014 pick from the dropdown above to build a priority chain"):y("div",{class:"fd-list"},...i.map((m,D)=>y("div",{key:"p"+D,class:"fd-list-row","data-cat":"kit",draggable:"true",ondragstart:L=>w(D,L),ondragover:S,ondrop:L=>N(D,L),style:"cursor:move"},y("span",{class:"fd-list-code"},"\u22EE\u22EE"),y("div",{class:"fd-list-main"},y("div",{class:"fd-list-title fd-mono"},"#"+(D+1)+" "+(m.provider||"?")+(m.model?" / "+m.model:"")),y("div",{class:"fd-list-sub"},"drag, or use arrows")),y("div",{class:"fd-list-meta"},y("button",{class:"btn",onclick:L=>{L.preventDefault(),c(D,-1)}},"\u2191"),y("button",{class:"btn",onclick:L=>{L.preventDefault(),c(D,1)}},"\u2193"),y("button",{class:"btn",onclick:L=>{L.preventDefault(),d(D)}},"\u2715")))))});return[T({title:"models",body:"pick a provider, pick a model. probe to list available models.",accent:s.length+" configured \xB7 "+r.length+" models"}),J({items:[[s.length,"configured"],[q.length,"probed"],[n.length-s.length,"unconfigured"],[r.length,"/v1/models"]]}),re,st,b({title:"change active model",children:te({fields:[{name:"provider",placeholder:"provider",value:t.agent?.provider||""},{name:"model",placeholder:"model id",value:t.agent?.model||""}],submit:"update",onSubmit:async m=>{await e.pi.config.saveValue("agent.provider",m.target.elements.provider.value),await e.pi.config.saveValue("agent.model",m.target.elements.model.value)}})}),b({title:"providers",right:y("button",{class:"btn-primary",onclick:m=>{m.preventDefault(),V()}},"probe all"),children:y("div",{class:"fd-chips"},...n.map(m=>C({tone:m.configured?m.available?"ok":"warn":"miss",children:m.name+(m.configured?m.available?" \u25CF":" \u25CB":" \xB7")})))}),...A]}async function De(e){let t=await e.pi.cron.list();return[T({title:"cron",body:"scheduled prompts. cron syntax, fired by freddie.",accent:t.length+" jobs"}),J({items:[[t.length,"jobs"],[t.filter(n=>n.enabled).length,"enabled"]]}),b({title:"add job",children:te({fields:[{name:"cron",placeholder:"0 * * * * (m h dom mon dow)",required:!0},{name:"prompt",placeholder:"prompt to run",required:!0}],submit:"create",onSubmit:async n=>{await e.pi.cron.create({cron:n.target.elements.cron.value,prompt:n.target.elements.prompt.value}),typeof window.__fd_nav=="function"&&window.__fd_nav("cron")}})}),b({title:"cron syntax",children:Y({rows:[["every minute","* * * * *"],["every hour (top)","0 * * * *"],["daily 09:00","0 9 * * *"],["weekdays 18:00","0 18 * * 1-5"],["every 15 min","*/15 * * * *"]]})}),b({title:"jobs",count:t.length,children:t.length===0?M({text:"no cron jobs \u2014 add one with the form above",glyph:"\u25F7"}):y("div",{class:"fd-list"},...t.map(n=>y("div",{key:n.id,class:"fd-list-row","data-cat":n.enabled?"kit":"external"},y("span",{class:"fd-list-code"},n.enabled?"\u25CF":"\u25CB"),y("div",{class:"fd-list-main"},y("div",{class:"fd-list-title"},(n.prompt||"(no prompt)").slice(0,80)),y("div",{class:"fd-list-sub"},n.cron+" \xB7 "+n.id)),y("div",{class:"fd-list-meta"},y("span",{class:"fd-list-meta-mono"},n.enabled?"enabled":"disabled")))))})]}async function Ee(e){let t=[...e.pi.skills.values()],n=t.reduce((s,o)=>((s[o.category||"other"]=s[o.category||"other"]||[]).push(o),s),{});return[T({title:"skills",body:"SKILL.md bundles loaded from ~/.freddie/skills + plugins.",accent:t.length+" loaded"}),J({items:[[t.length,"skills"],[Object.keys(n).length,"categories"]]}),t.length===0?M({text:"no skills \u2014 add SKILL.md files to ~/.freddie/skills/",glyph:"\u25C8"}):null,...Object.entries(n).map(([s,o])=>b({title:s,count:o.length,children:y("div",{class:"fd-list"},...o.map((a,r)=>y("div",{key:a.name,class:"fd-list-row","data-cat":s==="creative"?"preview":s==="software-development"?"kit":s==="planning"?"doc":s==="ops"?"external":"doc"},y("span",{class:"fd-list-code"},String(r+1).padStart(2,"0")),y("div",{class:"fd-list-main"},y("div",{class:"fd-list-title"},_(a)),a.description?y("div",{class:"fd-list-sub"},(a.description||"").slice(0,140)):null))))}))].filter(Boolean)}async function Ie(e){let t=typeof e.pi.env?.list=="function"?e.pi.env.list():[],n=t.filter(a=>a.set).length,s={};for(let a of t){let r=a.key.indexOf("_"),i=r>0?a.key.slice(0,r):"OTHER";(s[i]=s[i]||[]).push(a)}let o=Object.entries(s).sort((a,r)=>r[1].length-a[1].length);return[T({title:"keys",body:"env vars freddie reads. grouped by service prefix. click a chip to set.",accent:n+" / "+t.length+" set"}),J({items:[[n,"set"],[t.length-n,"missing"],[t.length,"total"],[o.length,"groups"]]}),t.length===0?M({text:"no env keys registered",glyph:"\u26BF"}):null,...o.map(([a,r])=>{let i=r.filter(l=>l.set).length;return b({title:a.toLowerCase(),count:r.length,right:i===r.length?C({tone:"ok",children:"all set"}):i===0?C({tone:"miss",children:"none set"}):C({tone:"warn",children:i+"/"+r.length}),children:y("div",{class:"fd-chips"},...r.map(l=>y("span",{key:l.key,onclick:()=>{let p=prompt("set "+l.key+" (empty to unset):");p!=null&&typeof e.pi.env.set=="function"&&e.pi.env.set(l.key,p)},class:"fd-chip-wrap"},C({tone:l.set?"ok":"miss",children:l.key+(l.set?" \u2713":" \xB7")}))))})})].filter(Boolean)}async function je(e){let t=[...e.pi.tools.values()],n=l=>typeof e.pi.env?.isSet=="function"?e.pi.env.isSet(l):!1,s=window.__fd_toolFilter=window.__fd_toolFilter||{q:""},o=(s.q||"").toLowerCase(),a=o?t.filter(l=>(l.name||"").toLowerCase().includes(o)||(l.description||"").toLowerCase().includes(o)||(l.toolset||"").toLowerCase().includes(o)):t,r=a.reduce((l,p)=>((l[p.toolset||"core"]=l[p.toolset||"core"]||[]).push(p),l),{}),i=y("input",{type:"search",placeholder:"filter tools\u2026",value:s.q,oninput:l=>{s.q=l.target.value,typeof window.__fd_nav=="function"&&window.__fd_nav("tools")},class:"fd-search"});return[T({title:"tools",body:"every tool the agent can call. param count + required env per row.",accent:t.length+" tools"}),J({items:[[t.length,"tools"],[a.length,"shown"],[Object.keys(r).length,"toolsets"]]}),b({title:"filter",right:i,children:a.length===0?M({text:'no matches for "'+s.q+'"',glyph:"\u2315"}):y("span",{class:"fd-muted"},a.length+" / "+t.length+" tools shown")}),...Object.entries(r).map(([l,p])=>b({title:"toolset \xB7 "+l,count:p.length,children:y("div",{class:"fd-list"},...p.map(f=>{let u=f.schema?.parameters?.properties?Object.keys(f.schema.parameters.properties).length:0,g=Array.isArray(f.requiresEnv)?f.requiresEnv:[];return y("div",{key:f.name,class:"fd-list-row","data-cat":"kit"},y("span",{class:"fd-list-code"},"\u2692"),y("div",{class:"fd-list-main"},y("div",{class:"fd-list-title fd-mono"},f.name),y("div",{class:"fd-list-sub"},(f.description||f.schema&&f.schema.description||"").slice(0,120))),y("div",{class:"fd-list-meta"},u>0?C({tone:"neutral",children:u+" params"}):null,...g.map(c=>C({tone:n(c)?"ok":"miss",children:c}))))}))}))]}var W=I;async function Ge(e){let t=window.__fd_batchResults=window.__fd_batchResults||[],n=window.__fd_batchStatus=window.__fd_batchStatus||{running:!1,error:null},s=async a=>{let r=a.target.elements.prompts.value.split(`
|
|
5
|
-
`).map(i=>i.trim()).filter(Boolean);if(r.length){n.running=!0,n.error=null,window.__fd_batchResults=[],typeof window.__fd_nav=="function"&&window.__fd_nav("batch");try{let i=await e.pi.batch.run(r,Number(a.target.elements.concurrency.value)||4),l=Array.isArray(i)?i:i&&typeof i=="object"?Object.entries(i).map(([p,f])=>({prompt:p,result:f})):[];window.__fd_batchResults=l}catch(i){n.error=i.message||String(i)}n.running=!1,typeof window.__fd_nav=="function"&&window.__fd_nav("batch")}},o=n.running?b({title:"results",children:W("span",{},"running\u2026")}):n.error?b({title:"results",children:W("span",{class:"fd-muted"},"error: "+n.error)}):t.length===0?b({title:"results",children:M({text:"no results yet",glyph:"\u229E"})}):b({title:"results",count:t.length,children:W("div",{class:"fd-list"},...t.map((a,r)=>W("div",{key:r,class:"fd-list-row","data-cat":a.error?"external":"kit"},W("span",{class:"fd-list-code"},String(r+1).padStart(2,"0")),W("div",{class:"fd-list-main"},W("div",{class:"fd-list-title"},(a.prompt||"").slice(0,80)),W("div",{class:"fd-list-sub"},(a.result||a.error||"").slice(0,160))),W("div",{class:"fd-list-meta"},W("span",{class:"fd-list-meta-mono"},a.error?"error":"ok")))))});return[T({title:"batch",body:"run many prompts in parallel. one per line.",accent:t.length?t.length+" results":"idle"}),b({title:"run batch",children:te({fields:[{name:"prompts",kind:"textarea",placeholder:"one prompt per line",rows:6},{name:"concurrency",type:"number",value:"4"}],submit:"run",onSubmit:s})}),o]}async function Ne(e){let t=typeof e.pi.gateway?.platforms=="function"?e.pi.gateway.platforms():[],n=t.filter(o=>o.enabled),s=o=>typeof e.pi.env?.isSet=="function"?e.pi.env.isSet(o):!1;return[T({title:"gateway",body:"webhook + bot platforms. each adapter declares required env keys.",accent:n.length+" / "+t.length+" active"}),J({items:[[t.length,"platforms"],[n.length,"active"]]}),b({title:"platforms",count:t.length,right:n.length>0?C({tone:"ok",children:n.length+" active"}):C({tone:"miss",children:"none active"}),children:t.length===0?M({text:"no platforms registered",glyph:"\u21CC"}):W("div",{class:"fd-list"},...t.map(o=>{let a=Array.isArray(o.requiresEnv)?o.requiresEnv:[],r=a.filter(s).length,i=a.length===0?"":r===a.length?"\u2713 env ready":"missing "+(a.length-r)+" / "+a.length;return W("div",{key:o.name,class:"fd-list-row","data-cat":o.enabled?"kit":"external"},W("span",{class:"fd-list-code"},o.enabled?"\u25CF":"\u25CB"),W("div",{class:"fd-list-main"},W("div",{class:"fd-list-title"},o.name),W("div",{class:"fd-list-sub"},o.note||"\u2014")),W("div",{class:"fd-list-meta"},W("span",{class:"fd-list-meta-mono"},o.enabled?"enabled":"disabled"),i?W("span",{class:"fd-list-meta-rel"},i):null))}))})]}var x=I,Lt=[{key:"display.skin",label:"skin",kind:"skin"},{key:"display.tool_progress_command",label:"tool progress command",kind:"bool"},{key:"display.background_process_notifications",label:"bg notifications",kind:"enum",options:["all","errors","none"]},{key:"agent.provider",label:"agent provider",kind:"string"},{key:"agent.model",label:"agent model",kind:"modelDropdown"},{key:"agent.max_iterations",label:"max iterations",kind:"number"},{key:"agent.fallback_model",label:"fallback model",kind:"string",nullable:!0},{key:"agent.save_trajectories",label:"save trajectories",kind:"bool"},{key:"agent.model_preference",label:"model preference (json array)",kind:"json"},{key:"memory.provider",label:"memory provider",kind:"string",nullable:!0},{key:"gateway.timeout",label:"gateway timeout (s)",kind:"number"},{key:"terminal.cwd",label:"terminal cwd",kind:"string",nullable:!0}];function Un(e,t){return t.split(".").reduce((n,s)=>n&&s in n?n[s]:void 0,e)}function rs(e,t){let n=window.__fd_modelPickers=window.__fd_modelPickers||{};n[e]={key:e,modelCount:t,mountedAt:Date.now()},typeof window<"u"&&(window.__debug=window.__debug||{},window.__debug.modelPickers=()=>Object.values(window.__fd_modelPickers||{}))}function X(e,t,n){let s=window.__fd_cfg_status=window.__fd_cfg_status||{};s[t]="saving\u2026",Promise.resolve(e.pi.config.saveValue(t,n)).then(()=>{s[t]="saved \u2713",ue(),setTimeout(()=>{delete s[t],ue()},1500)}).catch(o=>{s[t]="err: "+(o.message||o),ue()})}function ue(){typeof window.__fd_nav=="function"&&window.__fd_nav("config")}function ls(e,t,n,s,o,a,r){let i=(window.__fd_cfg_status||{})[e.key],l;if(e.kind==="modelDropdown"){let u=Array.isArray(a)?a:[],g=u.reduce((w,S)=>{let N=String(S.id||"").indexOf("/"),O=N>0?S.id.slice(0,N):S.owned_by||"other";return(w[O]=w[O]||[]).push(S),w},{}),c=r&&r.status?r.status:{},d=w=>{let S=c[w];return S&&S.available===!1};l=x("select",{onchange:w=>X(s,e.key,w.target.value===""&&e.nullable?null:w.target.value)},x("option",{value:"",selected:t?null:"true"},"\u2014 auto \u2014"),...Object.entries(g).map(([w,S])=>x("optgroup",{label:w+" \xB7 "+S.length},...S.map(N=>x("option",{value:N.id,selected:t===N.id?"true":null,disabled:d(N.id)?"true":null},N.id+(d(N.id)?" \u2715":"")))))),rs(e.key,u.length)}else if(e.kind==="skin"){let u=o.length?o:["default"];l=x("select",{onchange:g=>X(s,e.key,g.target.value)},...u.map(g=>x("option",{value:g,selected:g===t?"true":null},g)))}else if(e.kind==="bool")l=x("select",{onchange:u=>X(s,e.key,u.target.value==="true")},x("option",{value:"false",selected:t?null:"true"},"false"),x("option",{value:"true",selected:t?"true":null},"true"));else if(e.kind==="enum")l=x("select",{onchange:u=>X(s,e.key,u.target.value)},...e.options.map(u=>x("option",{value:u,selected:u===t?"true":null},u)));else if(e.kind==="number")l=x("input",{type:"number",value:t==null?"":String(t),onchange:u=>X(s,e.key,u.target.value===""?null:Number(u.target.value))});else if(e.kind==="json"){let u=t==null?"[]":JSON.stringify(t);l=x("input",{type:"text",value:u,placeholder:'[] or [{"provider":"\u2026"}]',onchange:g=>{try{X(s,e.key,JSON.parse(g.target.value||"null"))}catch{(window.__fd_cfg_status=window.__fd_cfg_status||{})[e.key]="invalid json",ue()}}})}else l=x("input",{type:"text",value:t==null?"":String(t),placeholder:e.nullable?"(empty = unset)":"",onchange:u=>X(s,e.key,u.target.value===""&&e.nullable?null:u.target.value)});let p=JSON.stringify(t)===JSON.stringify(n),f=x("span",{class:"fd-cfg-meta"},i?C({tone:i.startsWith("err")||i==="invalid json"?"miss":i==="saved \u2713"?"ok":"warn",children:i}):null,!p&&n!==void 0?x("span",{class:"fd-muted",title:"default: "+JSON.stringify(n)}," default: "+(n===""?'""':JSON.stringify(n))):null);return x("div",{class:"fd-cfg-row",key:e.key},x("label",{class:"fd-cfg-label"},e.label,x("code",{class:"fd-cfg-key"},e.key)),x("div",{class:"fd-cfg-control"},l,f))}function cs(e,t,n,s,o,a){let r=n.provider||"",i=n.model||"",l=o[r]&&o[r].models||[],p=c=>{let d=Je();d[t]={...d[t],provider:c.target.value,model:""},X(e,"agent.model_preference",d)},f=c=>{let d=Je();d[t]={...d[t],model:c.target.value},X(e,"agent.model_preference",d)},u=c=>{let d=Je(),w=t+c;if(w<0||w>=d.length)return;let S=d[t];d[t]=d[w],d[w]=S,X(e,"agent.model_preference",d)},g=()=>{let c=Je();c.splice(t,1),X(e,"agent.model_preference",c)};return x("div",{class:"fd-cfg-row",key:"pref-"+t,"data-idx":t},x("label",{class:"fd-cfg-label"},"#"+(t+1)+" / "+a),x("div",{class:"fd-cfg-control"},x("select",{onchange:p},x("option",{value:""},"(select provider)"),...s.map(c=>x("option",{value:c,selected:c===r?"true":null},c))),l.length>0?x("select",{onchange:f},x("option",{value:""},"(any/default)"),...l.map(c=>x("option",{value:c,selected:c===i?"true":null},c))):x("input",{type:"text",placeholder:"model (run discover for dropdown)",value:i,onchange:f}),x("button",{class:"btn",onclick:c=>{c.preventDefault(),u(-1)}},"\u2191"),x("button",{class:"btn",onclick:c=>{c.preventDefault(),u(1)}},"\u2193"),x("button",{class:"btn",onclick:c=>{c.preventDefault(),g()}},"\u2715")))}function Je(){return(window.__fd_cfg_pref||[]).slice()}function ds(e,t,n,s){let o=Array.isArray(t?.agent?.model_preference)?t.agent.model_preference:[];window.__fd_cfg_pref=o.slice();let a=o.map((p,f)=>cs(e,f,p,n,s,o.length)),r=x("button",{class:"btn-primary",onclick:p=>{p.preventDefault();let f=Je();f.push({provider:"",model:""}),X(e,"agent.model_preference",f)}},"+ add row"),i=x("button",{class:"btn",onclick:async p=>{p.preventDefault(),(window.__fd_cfg_status=window.__fd_cfg_status||{})["agent.discovered_models"]="discovering\u2026",ue();try{await fetch("/api/models/discover",{method:"POST",headers:{"content-type":"application/json"},body:"{}"}),window.__fd_cfg_status["agent.discovered_models"]="discovered \u2713"}catch(f){window.__fd_cfg_status["agent.discovered_models"]="err: "+(f.message||f)}ue()}},"discover models"),l=(window.__fd_cfg_status||{})["agent.discovered_models"];return b({title:"model preference (ordered fallback chain)",count:o.length,right:x("span",{},i," ",r,l?C({tone:l.startsWith("err")?"miss":l==="discovered \u2713"?"ok":"warn",children:l}):null),children:o.length===0?x("div",{class:"fd-muted"},"no preferences \u2014 first available provider key will be used. add a row to override."):x("div",{class:"fd-cfg-prefs"},...a)})}async function Ue(e){let t=typeof e.pi.config?.load=="function"?await e.pi.config.load():{},n=await fetch("/api/config/defaults").then(d=>d.json()).catch(()=>({})),s=await fetch("/api/skins").then(d=>d.json()).catch(()=>["default"]),o=await fetch("/api/models/providers").then(d=>d.json()).catch(()=>({providers:[]})),a=await fetch("/api/models/cached").then(d=>d.json()).catch(()=>({})),r=await fetch("/v1/models").then(d=>d.json()).then(d=>d.data||[]).catch(()=>[]),i=await fetch("/api/models/sampler").then(d=>d.json()).catch(()=>({status:{}})),l=typeof e.pi.cli?.values=="function"?[...e.pi.cli.values()]:[],p=b({title:"settings",count:Lt.length,children:Lt.filter(d=>d.key!=="agent.model_preference").map(d=>ls(d,Un(t,d.key),Un(n,d.key),e,s,r,i))}),f=ds(e,t,o.providers||[],a||{}),u=b({title:"set arbitrary key (power-user)",children:te({fields:[{name:"key",placeholder:"dotted.key",required:!0},{name:"value",placeholder:"value (json or string)",required:!0}],submit:"save",onSubmit:async d=>{let w=d.target.elements.value.value;try{w=JSON.parse(w)}catch{}await e.pi.config.saveValue(d.target.elements.key.value,w),ue()}})}),g=x("details",{class:"fd-cfg-details"},x("summary",{},"all config (read-only)"),...Gn(t)),c=x("details",{class:"fd-cfg-details"},x("summary",{},"commands \xB7 "+l.length),me({headers:["name","description"],rows:l.map(d=>[d.name,d.description||""])}));return[T({title:"config",body:"inline editors for known keys. raw setter is the fallback.",accent:"v"+(t._config_version||0)}),J({items:[[Lt.length,"editable"],[(t?.agent?.model_preference||[]).length,"pref-rows"],[l.length,"commands"],[t._config_version||0,"version"]]}),p,f,u,g,c]}var B=I;function ps(){return window.__fd_voice=window.__fd_voice||{listening:!1,supported:null,transcript:[],partial:"",ttsText:"",ttsBusy:!1,ttsErr:null,voice:"alloy",recogn:null}}function se(){typeof window.__fd_nav=="function"&&window.__fd_nav("voice")}function us(e){if(e.recogn)return e.recogn;let t=window.SpeechRecognition||window.webkitSpeechRecognition;if(!t)return e.supported=!1,null;e.supported=!0;let n=new t;return n.continuous=!0,n.interimResults=!0,n.lang="en-US",n.onresult=s=>{let o="",a="";for(let r=s.resultIndex;r<s.results.length;r++){let i=s.results[r][0].transcript;s.results[r].isFinal?o+=i:a+=i}o&&e.transcript.push({text:o.trim(),ts:Date.now()}),e.partial=a.trim(),se()},n.onend=()=>{if(e.listening)try{n.start()}catch{}},n.onerror=s=>{e.partial="("+(s.error||"mic error")+")",se()},e.recogn=n,n}function hs(e){let t=us(e);if(t){if(e.listening=!e.listening,e.listening)try{t.start()}catch{}else try{t.stop()}catch{}se()}}async function ms(e){let t=e.ttsText.trim();if(t){e.ttsBusy=!0,e.ttsErr=null,se();try{if("speechSynthesis"in window){let n=new SpeechSynthesisUtterance(t);n.onend=()=>{e.ttsBusy=!1,se()},n.onerror=s=>{e.ttsBusy=!1,e.ttsErr=String(s.error||"tts error"),se()},window.speechSynthesis.speak(n)}else e.ttsBusy=!1,e.ttsErr="no speechSynthesis API in this browser",se()}catch(n){e.ttsBusy=!1,e.ttsErr=n.message||String(n),se()}}}function fs(e){e.transcript=[],e.partial="",se()}async function Ct(e){let t=ps(),n="SpeechRecognition"in window||"webkitSpeechRecognition"in window,s="speechSynthesis"in window,o=t.transcript.slice(-50),a={listening:"ok",idle:"neutral",off:"miss"},r=n?b({title:"microphone",right:C({tone:t.listening?a.listening:a.idle,children:t.listening?"listening \u25CF":"idle \u25CB"}),children:[B("div",{class:"fd-voice-controls"},B("button",{class:(t.listening,"btn-primary"),"aria-label":t.listening?"stop listening":"start listening",onclick:l=>{l.preventDefault(),hs(t)}},t.listening?"stop":"start"),B("button",{class:"btn","aria-label":"clear transcript",onclick:l=>{l.preventDefault(),fs(t)},disabled:o.length===0?"true":null},"clear"),t.partial?B("span",{class:"fd-voice-partial"},"\u2026 "+t.partial):null),o.length===0&&!t.partial?M({text:t.listening?"listening \u2014 speak into your mic":"press start to capture speech",glyph:"\u25CC"}):B("div",{class:"fd-list",role:"log","aria-live":"polite"},...o.map((l,p)=>B("div",{key:p,class:"fd-list-row","data-cat":"doc"},B("span",{class:"fd-list-code"},new Date(l.ts).toLocaleTimeString().slice(0,8)),B("div",{class:"fd-list-main"},B("div",{class:"fd-list-title"},l.text)))))]}):b({title:"microphone",children:M({text:"this browser does not expose Web Speech API. try chrome or edge.",glyph:"\u23DA"})}),i=s?b({title:"speak",right:t.ttsErr?C({tone:"miss",children:"error"}):C({tone:t.ttsBusy?"warn":"neutral",children:t.ttsBusy?"speaking":"idle"}),children:B("form",{class:"fd-voice-tts",onsubmit:l=>{l.preventDefault(),ms(t)}},B("label",{class:"fd-label",for:"fd-tts-text"},"text to speak"),B("textarea",{id:"fd-tts-text",name:"tts",rows:3,placeholder:"type something\u2026",value:t.ttsText,oninput:l=>{t.ttsText=l.target.value}}),B("div",{class:"fd-voice-controls"},B("button",{type:"submit",class:"btn-primary",disabled:t.ttsBusy?"true":null},t.ttsBusy?"\u2026":"speak"),t.ttsErr?B("span",{class:"fd-muted"},t.ttsErr):null))}):b({title:"speak",children:M({text:"no speechSynthesis API in this browser.",glyph:"\u23DA"})});return[T({title:"voice",body:"speak in, hear out. browser-native speech recognition + synthesis.",accent:t.listening?"listening":o.length?o.length+" utterances":"idle"}),J({items:[[o.length,"utterances"],[n?"\u25CF":"\u25CB","recognition"],[s?"\u25CF":"\u25CB","synthesis"]]}),r,i,b({title:"how this works",children:Y({rows:[["recognition","webkit Speech API \xB7 client-side, no server"],["synthesis","speechSynthesis API \xB7 client-side, OS voice"],["server tts tool","plugins/tts (OpenAI tts-1 / ElevenLabs) \xB7 runs in agent context"],["voice_mode tool","plugins/voice_mode \xB7 toggles full-duplex on a session"]]})})]}var G=I;async function tt(e,t){let n=await fetch(e,t),o=(n.headers.get("content-type")||"").includes("json")?await n.json():await n.text();if(!n.ok)throw new Error(typeof o=="string"?o:o.error?.message||JSON.stringify(o));return o}async function gs(){return await tt("/api/acptoapi/chains")}async function bs(e,t){return await tt("/api/acptoapi/chains",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:e,links:t})})}async function vs(e){return await tt("/api/acptoapi/chains/"+encodeURIComponent(e),{method:"DELETE"})}async function ws(){try{return await tt("/api/acptoapi/probe")}catch{return{results:[]}}}async function Qe(e){let t=window.__fd_chains=window.__fd_chains||{loaded:!1,error:null,chains:{},builtin:[],runtime:[],probe:[],editing:null,draft:{name:"",links:[]},newLink:""};if(!t.loaded)try{let d=await gs();t.chains=d.chains||{},t.builtin=d.builtin||[],t.runtime=d.runtime||[];let w=await ws();t.probe=w.results||[],t.loaded=!0}catch(d){t.error=d.message,t.loaded=!0}let n=()=>{typeof window.__fd_nav=="function"&&window.__fd_nav("chains")},s=d=>()=>{t.editing=d,t.draft={name:d,links:[...t.chains[d]||[]]},n()},o=()=>{t.editing=null,t.draft={name:"",links:[]},n()},a=()=>{t.editing="__new__",t.draft={name:"",links:[]},n()},r=()=>{t.newLink.trim()&&(t.draft.links.push(t.newLink.trim()),t.newLink="",n())},i=d=>()=>{t.draft.links.splice(d,1),n()},l=async()=>{try{await bs(t.draft.name.trim(),t.draft.links),t.loaded=!1,t.editing=null,n()}catch(d){t.error=d.message,n()}},p=d=>async()=>{if(!t.builtin.includes(d))try{await vs(d),t.loaded=!1,n()}catch(w){t.error=w.message,n()}};if(t.error&&!t.loaded)return[T({title:"chains",body:"fallback chain editor",accent:"error"}),b({title:"error",children:G("span",{class:"fd-muted"},t.error)})];if(t.editing){let d=t.editing==="__new__",w=!d&&t.builtin.includes(t.editing);return[T({title:d?"new chain":"edit "+t.editing,body:"links are tried top-to-bottom",accent:w?"builtin read-only":"editable"}),b({title:"name",children:d?G("input",{class:"fd-input",value:t.draft.name,oninput:S=>{t.draft.name=S.target.value}}):G("code",{},t.draft.name)}),b({title:"links",count:t.draft.links.length,children:t.draft.links.length===0?M({text:"no links yet \u2014 add one below",glyph:"\u21B3"}):G("div",{class:"fd-list"},...t.draft.links.map((S,N)=>G("div",{key:N,class:"fd-list-row","data-cat":"kit"},G("span",{class:"fd-list-code"},String(N+1).padStart(2,"0")),G("div",{class:"fd-list-main"},G("div",{class:"fd-list-title"},S)),w?null:G("button",{class:"fd-btn fd-btn-mini",onclick:i(N)},"remove"))))}),w?null:b({title:"add link",children:G("div",{class:"fd-form-row"},G("input",{class:"fd-input",placeholder:"provider/model (e.g. groq/llama-3.3-70b-versatile)",value:t.newLink,oninput:S=>{t.newLink=S.target.value}}),G("button",{class:"fd-btn",onclick:r},"add"))}),b({title:"actions",children:G("div",{class:"fd-form-row"},w?null:G("button",{class:"fd-btn fd-btn-primary",onclick:l},d?"create":"save"),G("button",{class:"fd-btn",onclick:o},"cancel"))})]}let f=Object.keys(t.chains).sort(),u=t.builtin.length,g=t.runtime.length,c=t.probe.length;return[T({title:"chains",body:"named fallback chains. callers send model=<name> to select one.",accent:f.length+" total"}),J({items:[[u,"builtin"],[g,"runtime"],[c,"working models"]]}),b({title:"create",children:G("button",{class:"fd-btn fd-btn-primary",onclick:a},"+ new chain")}),b({title:"chains",count:f.length,children:f.length===0?M({text:"no chains configured",glyph:"\u229E"}):G("div",{class:"fd-list"},...f.map(d=>{let w=t.chains[d]||[],S=t.builtin.includes(d);return G("div",{key:d,class:"fd-list-row","data-cat":S?"external":"kit"},G("span",{class:"fd-list-code"},S?"\u25C6":"\u25CB"),G("div",{class:"fd-list-main"},G("div",{class:"fd-list-title"},d),G("div",{class:"fd-list-sub"},w.slice(0,3).join(" \u2192 ")+(w.length>3?` (+${w.length-3})`:""))),G("div",{class:"fd-list-meta"},G("span",{class:"fd-list-meta-mono"},S?"builtin":"runtime"),G("button",{class:"fd-btn fd-btn-mini",onclick:s(d)},S?"view":"edit"),S?null:G("button",{class:"fd-btn fd-btn-mini",onclick:p(d)},"delete")))}))}),b({title:"discovered models",count:c,right:c>0?C({tone:"ok",children:"fresh"}):C({tone:"miss",children:"no probe"}),children:c===0?M({text:"run a probe to see working models",glyph:"\u2726"}):G("div",{class:"fd-list"},...t.probe.slice(0,12).map(d=>G("div",{key:d.provider+"/"+d.model,class:"fd-list-row","data-cat":"kit"},G("span",{class:"fd-list-code"},d.provider.slice(0,3)),G("div",{class:"fd-list-main"},G("div",{class:"fd-list-title"},d.provider+"/"+d.model),G("div",{class:"fd-list-sub"},d.ms+"ms")))))})]}var Jt={home:be,chat:Se,voice:Ct,sessions:ve,projects:we,agents:ye,analytics:ke,models:xe,cron:De,skills:Ee,config:Ue,env:Ie,tools:je,batch:Ge,gateway:Ne,chains:Qe};var ys=I;var ae={};At(ae,{animateElement:()=>Ss,animateSelector:()=>xs,animateTree:()=>nt,installMotion:()=>Qn,shouldReduceMotion:()=>ks});function ks(){return!0}function Qn(){}function Ss(e,t,n={}){return Promise.resolve(!1)}function xs(e,t,n={}){return Promise.resolve(!1)}function nt(e,t={}){return 0}var Wt={mounts:0,sends:0},qt=class extends HTMLElement{static get observedAttributes(){return["title","sub","placeholder"]}constructor(){super(),this._messages=[],this._draft="",this._title="chat",this._sub="",this._placeholder="message\u2026"}set messages(t){this._messages=Array.isArray(t)?t:[],this._render()}get messages(){return this._messages}connectedCallback(){if(this.hasAttribute("messages"))try{this._messages=JSON.parse(this.getAttribute("messages"))}catch{}this._title=this.getAttribute("title")||this._title,this._sub=this.getAttribute("sub")||"",this._placeholder=this.getAttribute("placeholder")||this._placeholder,Wt.mounts+=1,this._render()}attributeChangedCallback(t,n,s){t==="title"&&(this._title=s||"chat"),t==="sub"&&(this._sub=s||""),t==="placeholder"&&(this._placeholder=s||"message\u2026"),this._render()}pushMessage(t){this._messages=[...this._messages,t],this._render()}_render(){let t=o=>{Wt.sends+=1,this.dispatchEvent(new CustomEvent("send",{detail:{text:o},bubbles:!0,composed:!0}))},n=o=>{this._draft=o,this._render()},s=$e({title:this._title,sub:this._sub,messages:this._messages,composer:_e({value:this._draft,placeholder:this._placeholder,onInput:n,onSend:t})});he(this,s)}},Rt=!1;function Tn(){Rt||(customElements.get("ds-chat")||customElements.define("ds-chat",qt),Rt=!0)}F("ds-chat",()=>({registered:Rt,...Wt,instances:document.querySelectorAll("ds-chat").length}));var Mn=!1;async function Pn(e){if(Mn&&!e)return;let t=await ct(),n=e||document.head,s=document.createElement("style");s.setAttribute("data-247420",""),s.textContent=t,n.appendChild(s),e||void 0,e||(Mn=!0)}function On(e,t,{autoScope:n=!0}={}){n&&e&&e.classList&&!e.classList.contains(lt.slice(1))&&e.classList.add(lt.slice(1));let s=()=>{he(e,t(s)),requestAnimationFrame(()=>nt(e))};return s(),s}typeof window<"u"&&typeof customElements<"u"&&Tn();var Ln=I;var ie={nav:[["works","#/works"],["project","#/project"],["writing","#/writing"],["manifesto","#/manifesto"],["source \u2197","https://github.com/AnEntrypoint"]],works:[{code:"001",title:"gm",sub:"state machine for coding agents",meta:"2025 \xB7 3k\u2605",body:"a tiny deterministic state machine that lets llms code without losing their minds. it thinks so you don't have to (as much).",href:"#/project",source:"https://github.com/AnEntrypoint/gm"},{code:"002",title:"zellous",sub:"production push-to-talk",meta:"2024 \xB7 live",body:"hold the button. talk. someone on the other side hears you. opus codec, dynamic rooms, 50-message replay.",href:"https://zellous.com",source:"https://github.com/AnEntrypoint/zellous"},{code:"003",title:"spoint",sub:"spawnpoint",meta:"2024 \xB7 live",body:'the directory for "where should we start?" one url, one room, everyone lands in the same place.',href:"https://spoint.world",source:"https://github.com/AnEntrypoint/spoint"},{code:"004",title:"flatspace",sub:"flat-file cms",meta:"wip",body:"still figuring out what to say about this one. come back tuesday.",href:"https://github.com/AnEntrypoint/flatspace",source:"https://github.com/AnEntrypoint/flatspace"},{code:"005",title:"thebird",sub:"\u2014",meta:"wip",body:"yes, the name is a reference. no, we won't tell you to what.",href:"https://github.com/AnEntrypoint/thebird",source:"https://github.com/AnEntrypoint/thebird"},{code:"006",title:"mcp-repl",sub:"repl for mcp",meta:"2024 \xB7 live",body:"executenodejs, executedeno, executebash, astgrep_search.",href:"https://github.com/AnEntrypoint/mcp-repl",source:"https://github.com/AnEntrypoint/mcp-repl"},{code:"007",title:"mutagen",sub:"adaptogen server",meta:"2024 \xB7 live",body:"everything to do with a dapp deg3n. read the source.",href:"https://github.com/AnEntrypoint/mutagen",source:"https://github.com/AnEntrypoint/mutagen"},{code:"008",title:"techshaman",sub:"member site",meta:"ongoing",body:"the official website for the techshaman.",href:"https://github.com/AnEntrypoint/techshaman",source:"https://github.com/AnEntrypoint/techshaman"}],posts:[{date:"2026.04.14",title:"we were here first",tag:"lore",href:"https://247420.xyz"},{date:"2026.03.22",title:"gm v0.4 postmortem, or: why state machines",tag:"gm",href:"https://github.com/AnEntrypoint/gm"},{date:"2026.02.09",title:"push-to-talk is a protocol, not a feature",tag:"zellous",href:"https://github.com/AnEntrypoint/zellous"},{date:"2025.12.11",title:"against the vibe-coded interface",tag:"manifesto",href:"#/manifesto"},{date:"2025.10.03",title:"notes on shipping weird",tag:"notes",href:"https://github.com/AnEntrypoint"}],manifesto:[{text:"we are the creative department of the internet. always open (24/7). always a little bit high on possibility (420)."},{text:"move fast. break things. document honestly. ship the rough draft. humor is load-bearing."},{text:"we will not tolerate simpleton design patterns, trifectas, gradients, or anything silly. nothing lame. we're internet natives and not easily pleased.",dim:!0}],currentlyShipping:[{title:"gm",sub:"state machine v0.4.1",meta:"live",live:!0},{title:"zellous",sub:"push-to-talk",meta:"live",live:!0},{title:"thebird",sub:"\u2014",meta:"wip",live:!1}],project:{name:"gm",tagline:"state machine for coding agents. it thinks, so you don't have to (as much).",install:"npx -y @anentrypoint/mcp-gm",receipt:[["status","live \xB7 ships tuesdays"],["stars","3,124"],["license","MIT"],["lang","typescript \xB7 deno"],["size","2.1mb"],["deps","0 runtime"],["authors","the collective"],["first commit","2024.09.03"]],changelog:[{date:"2026.04.20",ver:"v0.4.1",msg:"ship it. fixed the thing everyone complained about."},{date:"2026.03.22",ver:"v0.4.0",msg:"new state machine runtime. broke everything on purpose."},{date:"2026.02.09",ver:"v0.3.7",msg:"astgrep_search is now astgrep_enhanced_search."},{date:"2025.12.11",ver:"v0.3.0",msg:"first public release. gm, world."}]}},H={route:Cn(),opened:-1,copied:!1};function Cn(){let e=(location.hash||"#/").slice(1).split("/").filter(Boolean);return{page:e[0]||"works",id:e[1]||null}}window.addEventListener("hashchange",()=>{H.route=Cn(),We(),requestAnimationFrame(()=>{ae.animateSelector(".app-main","fadeIn",{duration:"var(--motion-base)"})})});var We;function Jn(e){location.hash="#/"+e}function Ds(){return K.Topbar({brand:"247420",leaf:"an entrypoint",items:ie.nav,active:H.route.page,onNav:Jn})}function Es(){return H.route.page==="project"?K.Crumb({trail:["247420","gm"],leaf:"overview",right:[K.Chip({tone:"accent",children:"\u25CF live"}),K.Chip({tone:"dim",children:"v0.4.1"})]}):K.Crumb({trail:["247420"],leaf:H.route.page})}function Is(){return K.Status({left:["main","\u2022 8 works","\u2022 5 posts"],right:["probably emerging",Ln("a",{href:"https://github.com/AnEntrypoint"},"source \u2197")]})}function js(){let e=H.route.page;return e==="project"?K.ProjectView({project:ie.project,copied:H.copied,onCopy:t=>{navigator.clipboard?.writeText(t),H.copied=!0,We(),requestAnimationFrame(()=>{ae.animateSelector(".cli .copy","pulse",{duration:"var(--motion-fast)"})}),setTimeout(()=>{H.copied=!1,We()},1200)}}):e==="writing"?[K.Section({title:"// recent writing",children:K.WritingList({posts:ie.posts})})]:e==="manifesto"?[K.Section({title:"// manifesto \xB7 rough draft",children:K.Manifesto({paragraphs:ie.manifesto})})]:K.HomeView({state:H,onNav:Jn,onToggleWork:t=>{H.opened=t,We(),t>=0&&requestAnimationFrame(()=>{ae.animateSelector(`[data-work-index="${t}"]`,"fadeInUp",{duration:"var(--motion-fast)"})})},works:ie.works,posts:ie.posts,manifesto:ie.manifesto,currentlyShipping:ie.currentlyShipping})}function Gs(){return K.AppShell({topbar:Ds(),crumb:Es(),main:js(),status:Is(),narrow:H.route.page==="project"})}await Pn();var Ns=document.getElementById("root");We=On(Ns,Gs);requestAnimationFrame(()=>{ae.animateSelector(".app-main","fadeIn",{duration:"var(--motion-base)"})});
|
|
5
|
+
`).map(i=>i.trim()).filter(Boolean);if(r.length){n.running=!0,n.error=null,window.__fd_batchResults=[],typeof window.__fd_nav=="function"&&window.__fd_nav("batch");try{let i=await e.pi.batch.run(r,Number(a.target.elements.concurrency.value)||4),l=Array.isArray(i)?i:i&&typeof i=="object"?Object.entries(i).map(([p,f])=>({prompt:p,result:f})):[];window.__fd_batchResults=l}catch(i){n.error=i.message||String(i)}n.running=!1,typeof window.__fd_nav=="function"&&window.__fd_nav("batch")}},o=n.running?b({title:"results",children:W("span",{},"running\u2026")}):n.error?b({title:"results",children:W("span",{class:"fd-muted"},"error: "+n.error)}):t.length===0?b({title:"results",children:M({text:"no results yet",glyph:"\u229E"})}):b({title:"results",count:t.length,children:W("div",{class:"fd-list"},...t.map((a,r)=>W("div",{key:r,class:"fd-list-row","data-cat":a.error?"external":"kit"},W("span",{class:"fd-list-code"},String(r+1).padStart(2,"0")),W("div",{class:"fd-list-main"},W("div",{class:"fd-list-title"},(a.prompt||"").slice(0,80)),W("div",{class:"fd-list-sub"},(a.result||a.error||"").slice(0,160))),W("div",{class:"fd-list-meta"},W("span",{class:"fd-list-meta-mono"},a.error?"error":"ok")))))});return[T({title:"batch",body:"run many prompts in parallel. one per line.",accent:t.length?t.length+" results":"idle"}),b({title:"run batch",children:te({fields:[{name:"prompts",kind:"textarea",placeholder:"one prompt per line",rows:6},{name:"concurrency",type:"number",value:"4"}],submit:"run",onSubmit:s})}),o]}async function Ne(e){let t=typeof e.pi.gateway?.platforms=="function"?e.pi.gateway.platforms():[],n=t.filter(o=>o.enabled),s=o=>typeof e.pi.env?.isSet=="function"?e.pi.env.isSet(o):!1;return[T({title:"gateway",body:"webhook + bot platforms. each adapter declares required env keys.",accent:n.length+" / "+t.length+" active"}),J({items:[[t.length,"platforms"],[n.length,"active"]]}),b({title:"platforms",count:t.length,right:n.length>0?C({tone:"ok",children:n.length+" active"}):C({tone:"miss",children:"none active"}),children:t.length===0?M({text:"no platforms registered",glyph:"\u21CC"}):W("div",{class:"fd-list"},...t.map(o=>{let a=Array.isArray(o.requiresEnv)?o.requiresEnv:[],r=a.filter(s).length,i=a.length===0?"":r===a.length?"\u2713 env ready":"missing "+(a.length-r)+" / "+a.length;return W("div",{key:o.name,class:"fd-list-row","data-cat":o.enabled?"kit":"external"},W("span",{class:"fd-list-code"},o.enabled?"\u25CF":"\u25CB"),W("div",{class:"fd-list-main"},W("div",{class:"fd-list-title"},o.name),W("div",{class:"fd-list-sub"},o.note||"\u2014")),W("div",{class:"fd-list-meta"},W("span",{class:"fd-list-meta-mono"},o.enabled?"enabled":"disabled"),i?W("span",{class:"fd-list-meta-rel"},i):null))}))})]}var x=I,Lt=[{key:"display.skin",label:"skin",kind:"skin"},{key:"display.tool_progress_command",label:"tool progress command",kind:"bool"},{key:"display.background_process_notifications",label:"bg notifications",kind:"enum",options:["all","errors","none"]},{key:"providers.freddie.baseUrl",label:"freddie URL (thebird \u2192 freddie)",kind:"string",nullable:!0},{key:"providers.openai.baseUrl",label:"acptoapi URL (freddie \u2192 acptoapi)",kind:"string",nullable:!0},{key:"providers.openai.model",label:"default LLM model",kind:"string",nullable:!0},{key:"agent.provider",label:"agent provider",kind:"string"},{key:"agent.model",label:"agent model",kind:"modelDropdown"},{key:"agent.max_iterations",label:"max iterations",kind:"number"},{key:"agent.fallback_model",label:"fallback model",kind:"string",nullable:!0},{key:"agent.save_trajectories",label:"save trajectories",kind:"bool"},{key:"agent.model_preference",label:"model preference (json array)",kind:"json"},{key:"memory.provider",label:"memory provider",kind:"string",nullable:!0},{key:"gateway.timeout",label:"gateway timeout (s)",kind:"number"},{key:"terminal.cwd",label:"terminal cwd",kind:"string",nullable:!0}];function Un(e,t){return t.split(".").reduce((n,s)=>n&&s in n?n[s]:void 0,e)}function rs(e,t){let n=window.__fd_modelPickers=window.__fd_modelPickers||{};n[e]={key:e,modelCount:t,mountedAt:Date.now()},typeof window<"u"&&(window.__debug=window.__debug||{},window.__debug.modelPickers=()=>Object.values(window.__fd_modelPickers||{}))}function X(e,t,n){let s=window.__fd_cfg_status=window.__fd_cfg_status||{};s[t]="saving\u2026",Promise.resolve(e.pi.config.saveValue(t,n)).then(()=>{s[t]="saved \u2713",ue(),setTimeout(()=>{delete s[t],ue()},1500)}).catch(o=>{s[t]="err: "+(o.message||o),ue()})}function ue(){typeof window.__fd_nav=="function"&&window.__fd_nav("config")}function ls(e,t,n,s,o,a,r){let i=(window.__fd_cfg_status||{})[e.key],l;if(e.kind==="modelDropdown"){let u=Array.isArray(a)?a:[],g=u.reduce((w,S)=>{let N=String(S.id||"").indexOf("/"),O=N>0?S.id.slice(0,N):S.owned_by||"other";return(w[O]=w[O]||[]).push(S),w},{}),c=r&&r.status?r.status:{},d=w=>{let S=c[w];return S&&S.available===!1};l=x("select",{onchange:w=>X(s,e.key,w.target.value===""&&e.nullable?null:w.target.value)},x("option",{value:"",selected:t?null:"true"},"\u2014 auto \u2014"),...Object.entries(g).map(([w,S])=>x("optgroup",{label:w+" \xB7 "+S.length},...S.map(N=>x("option",{value:N.id,selected:t===N.id?"true":null,disabled:d(N.id)?"true":null},N.id+(d(N.id)?" \u2715":"")))))),rs(e.key,u.length)}else if(e.kind==="skin"){let u=o.length?o:["default"];l=x("select",{onchange:g=>X(s,e.key,g.target.value)},...u.map(g=>x("option",{value:g,selected:g===t?"true":null},g)))}else if(e.kind==="bool")l=x("select",{onchange:u=>X(s,e.key,u.target.value==="true")},x("option",{value:"false",selected:t?null:"true"},"false"),x("option",{value:"true",selected:t?"true":null},"true"));else if(e.kind==="enum")l=x("select",{onchange:u=>X(s,e.key,u.target.value)},...e.options.map(u=>x("option",{value:u,selected:u===t?"true":null},u)));else if(e.kind==="number")l=x("input",{type:"number",value:t==null?"":String(t),onchange:u=>X(s,e.key,u.target.value===""?null:Number(u.target.value))});else if(e.kind==="json"){let u=t==null?"[]":JSON.stringify(t);l=x("input",{type:"text",value:u,placeholder:'[] or [{"provider":"\u2026"}]',onchange:g=>{try{X(s,e.key,JSON.parse(g.target.value||"null"))}catch{(window.__fd_cfg_status=window.__fd_cfg_status||{})[e.key]="invalid json",ue()}}})}else l=x("input",{type:"text",value:t==null?"":String(t),placeholder:e.nullable?"(empty = unset)":"",onchange:u=>X(s,e.key,u.target.value===""&&e.nullable?null:u.target.value)});let p=JSON.stringify(t)===JSON.stringify(n),f=x("span",{class:"fd-cfg-meta"},i?C({tone:i.startsWith("err")||i==="invalid json"?"miss":i==="saved \u2713"?"ok":"warn",children:i}):null,!p&&n!==void 0?x("span",{class:"fd-muted",title:"default: "+JSON.stringify(n)}," default: "+(n===""?'""':JSON.stringify(n))):null);return x("div",{class:"fd-cfg-row",key:e.key},x("label",{class:"fd-cfg-label"},e.label,x("code",{class:"fd-cfg-key"},e.key)),x("div",{class:"fd-cfg-control"},l,f))}function cs(e,t,n,s,o,a){let r=n.provider||"",i=n.model||"",l=o[r]&&o[r].models||[],p=c=>{let d=Je();d[t]={...d[t],provider:c.target.value,model:""},X(e,"agent.model_preference",d)},f=c=>{let d=Je();d[t]={...d[t],model:c.target.value},X(e,"agent.model_preference",d)},u=c=>{let d=Je(),w=t+c;if(w<0||w>=d.length)return;let S=d[t];d[t]=d[w],d[w]=S,X(e,"agent.model_preference",d)},g=()=>{let c=Je();c.splice(t,1),X(e,"agent.model_preference",c)};return x("div",{class:"fd-cfg-row",key:"pref-"+t,"data-idx":t},x("label",{class:"fd-cfg-label"},"#"+(t+1)+" / "+a),x("div",{class:"fd-cfg-control"},x("select",{onchange:p},x("option",{value:""},"(select provider)"),...s.map(c=>x("option",{value:c,selected:c===r?"true":null},c))),l.length>0?x("select",{onchange:f},x("option",{value:""},"(any/default)"),...l.map(c=>x("option",{value:c,selected:c===i?"true":null},c))):x("input",{type:"text",placeholder:"model (run discover for dropdown)",value:i,onchange:f}),x("button",{class:"btn",onclick:c=>{c.preventDefault(),u(-1)}},"\u2191"),x("button",{class:"btn",onclick:c=>{c.preventDefault(),u(1)}},"\u2193"),x("button",{class:"btn",onclick:c=>{c.preventDefault(),g()}},"\u2715")))}function Je(){return(window.__fd_cfg_pref||[]).slice()}function ds(e,t,n,s){let o=Array.isArray(t?.agent?.model_preference)?t.agent.model_preference:[];window.__fd_cfg_pref=o.slice();let a=o.map((p,f)=>cs(e,f,p,n,s,o.length)),r=x("button",{class:"btn-primary",onclick:p=>{p.preventDefault();let f=Je();f.push({provider:"",model:""}),X(e,"agent.model_preference",f)}},"+ add row"),i=x("button",{class:"btn",onclick:async p=>{p.preventDefault(),(window.__fd_cfg_status=window.__fd_cfg_status||{})["agent.discovered_models"]="discovering\u2026",ue();try{await fetch("/api/models/discover",{method:"POST",headers:{"content-type":"application/json"},body:"{}"}),window.__fd_cfg_status["agent.discovered_models"]="discovered \u2713"}catch(f){window.__fd_cfg_status["agent.discovered_models"]="err: "+(f.message||f)}ue()}},"discover models"),l=(window.__fd_cfg_status||{})["agent.discovered_models"];return b({title:"model preference (ordered fallback chain)",count:o.length,right:x("span",{},i," ",r,l?C({tone:l.startsWith("err")?"miss":l==="discovered \u2713"?"ok":"warn",children:l}):null),children:o.length===0?x("div",{class:"fd-muted"},"no preferences \u2014 first available provider key will be used. add a row to override."):x("div",{class:"fd-cfg-prefs"},...a)})}async function Ue(e){let t=typeof e.pi.config?.load=="function"?await e.pi.config.load():{},n=await fetch("/api/config/defaults").then(d=>d.json()).catch(()=>({})),s=await fetch("/api/skins").then(d=>d.json()).catch(()=>["default"]),o=await fetch("/api/models/providers").then(d=>d.json()).catch(()=>({providers:[]})),a=await fetch("/api/models/cached").then(d=>d.json()).catch(()=>({})),r=await fetch("/v1/models").then(d=>d.json()).then(d=>d.data||[]).catch(()=>[]),i=await fetch("/api/models/sampler").then(d=>d.json()).catch(()=>({status:{}})),l=typeof e.pi.cli?.values=="function"?[...e.pi.cli.values()]:[],p=b({title:"settings",count:Lt.length,children:Lt.filter(d=>d.key!=="agent.model_preference").map(d=>ls(d,Un(t,d.key),Un(n,d.key),e,s,r,i))}),f=ds(e,t,o.providers||[],a||{}),u=b({title:"set arbitrary key (power-user)",children:te({fields:[{name:"key",placeholder:"dotted.key",required:!0},{name:"value",placeholder:"value (json or string)",required:!0}],submit:"save",onSubmit:async d=>{let w=d.target.elements.value.value;try{w=JSON.parse(w)}catch{}await e.pi.config.saveValue(d.target.elements.key.value,w),ue()}})}),g=x("details",{class:"fd-cfg-details"},x("summary",{},"all config (read-only)"),...Gn(t)),c=x("details",{class:"fd-cfg-details"},x("summary",{},"commands \xB7 "+l.length),me({headers:["name","description"],rows:l.map(d=>[d.name,d.description||""])}));return[T({title:"config",body:"inline editors for known keys. raw setter is the fallback.",accent:"v"+(t._config_version||0)}),J({items:[[Lt.length,"editable"],[(t?.agent?.model_preference||[]).length,"pref-rows"],[l.length,"commands"],[t._config_version||0,"version"]]}),p,f,u,g,c]}var B=I;function ps(){return window.__fd_voice=window.__fd_voice||{listening:!1,supported:null,transcript:[],partial:"",ttsText:"",ttsBusy:!1,ttsErr:null,voice:"alloy",recogn:null}}function se(){typeof window.__fd_nav=="function"&&window.__fd_nav("voice")}function us(e){if(e.recogn)return e.recogn;let t=window.SpeechRecognition||window.webkitSpeechRecognition;if(!t)return e.supported=!1,null;e.supported=!0;let n=new t;return n.continuous=!0,n.interimResults=!0,n.lang="en-US",n.onresult=s=>{let o="",a="";for(let r=s.resultIndex;r<s.results.length;r++){let i=s.results[r][0].transcript;s.results[r].isFinal?o+=i:a+=i}o&&e.transcript.push({text:o.trim(),ts:Date.now()}),e.partial=a.trim(),se()},n.onend=()=>{if(e.listening)try{n.start()}catch{}},n.onerror=s=>{e.partial="("+(s.error||"mic error")+")",se()},e.recogn=n,n}function hs(e){let t=us(e);if(t){if(e.listening=!e.listening,e.listening)try{t.start()}catch{}else try{t.stop()}catch{}se()}}async function ms(e){let t=e.ttsText.trim();if(t){e.ttsBusy=!0,e.ttsErr=null,se();try{if("speechSynthesis"in window){let n=new SpeechSynthesisUtterance(t);n.onend=()=>{e.ttsBusy=!1,se()},n.onerror=s=>{e.ttsBusy=!1,e.ttsErr=String(s.error||"tts error"),se()},window.speechSynthesis.speak(n)}else e.ttsBusy=!1,e.ttsErr="no speechSynthesis API in this browser",se()}catch(n){e.ttsBusy=!1,e.ttsErr=n.message||String(n),se()}}}function fs(e){e.transcript=[],e.partial="",se()}async function Ct(e){let t=ps(),n="SpeechRecognition"in window||"webkitSpeechRecognition"in window,s="speechSynthesis"in window,o=t.transcript.slice(-50),a={listening:"ok",idle:"neutral",off:"miss"},r=n?b({title:"microphone",right:C({tone:t.listening?a.listening:a.idle,children:t.listening?"listening \u25CF":"idle \u25CB"}),children:[B("div",{class:"fd-voice-controls"},B("button",{class:(t.listening,"btn-primary"),"aria-label":t.listening?"stop listening":"start listening",onclick:l=>{l.preventDefault(),hs(t)}},t.listening?"stop":"start"),B("button",{class:"btn","aria-label":"clear transcript",onclick:l=>{l.preventDefault(),fs(t)},disabled:o.length===0?"true":null},"clear"),t.partial?B("span",{class:"fd-voice-partial"},"\u2026 "+t.partial):null),o.length===0&&!t.partial?M({text:t.listening?"listening \u2014 speak into your mic":"press start to capture speech",glyph:"\u25CC"}):B("div",{class:"fd-list",role:"log","aria-live":"polite"},...o.map((l,p)=>B("div",{key:p,class:"fd-list-row","data-cat":"doc"},B("span",{class:"fd-list-code"},new Date(l.ts).toLocaleTimeString().slice(0,8)),B("div",{class:"fd-list-main"},B("div",{class:"fd-list-title"},l.text)))))]}):b({title:"microphone",children:M({text:"this browser does not expose Web Speech API. try chrome or edge.",glyph:"\u23DA"})}),i=s?b({title:"speak",right:t.ttsErr?C({tone:"miss",children:"error"}):C({tone:t.ttsBusy?"warn":"neutral",children:t.ttsBusy?"speaking":"idle"}),children:B("form",{class:"fd-voice-tts",onsubmit:l=>{l.preventDefault(),ms(t)}},B("label",{class:"fd-label",for:"fd-tts-text"},"text to speak"),B("textarea",{id:"fd-tts-text",name:"tts",rows:3,placeholder:"type something\u2026",value:t.ttsText,oninput:l=>{t.ttsText=l.target.value}}),B("div",{class:"fd-voice-controls"},B("button",{type:"submit",class:"btn-primary",disabled:t.ttsBusy?"true":null},t.ttsBusy?"\u2026":"speak"),t.ttsErr?B("span",{class:"fd-muted"},t.ttsErr):null))}):b({title:"speak",children:M({text:"no speechSynthesis API in this browser.",glyph:"\u23DA"})});return[T({title:"voice",body:"speak in, hear out. browser-native speech recognition + synthesis.",accent:t.listening?"listening":o.length?o.length+" utterances":"idle"}),J({items:[[o.length,"utterances"],[n?"\u25CF":"\u25CB","recognition"],[s?"\u25CF":"\u25CB","synthesis"]]}),r,i,b({title:"how this works",children:Y({rows:[["recognition","webkit Speech API \xB7 client-side, no server"],["synthesis","speechSynthesis API \xB7 client-side, OS voice"],["server tts tool","plugins/tts (OpenAI tts-1 / ElevenLabs) \xB7 runs in agent context"],["voice_mode tool","plugins/voice_mode \xB7 toggles full-duplex on a session"]]})})]}var G=I;async function tt(e,t){let n=await fetch(e,t),o=(n.headers.get("content-type")||"").includes("json")?await n.json():await n.text();if(!n.ok)throw new Error(typeof o=="string"?o:o.error?.message||JSON.stringify(o));return o}async function gs(){return await tt("/api/acptoapi/chains")}async function bs(e,t){return await tt("/api/acptoapi/chains",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:e,links:t})})}async function vs(e){return await tt("/api/acptoapi/chains/"+encodeURIComponent(e),{method:"DELETE"})}async function ws(){try{return await tt("/api/acptoapi/probe")}catch{return{results:[]}}}async function Qe(e){let t=window.__fd_chains=window.__fd_chains||{loaded:!1,error:null,chains:{},builtin:[],runtime:[],probe:[],editing:null,draft:{name:"",links:[]},newLink:""};if(!t.loaded)try{let d=await gs();t.chains=d.chains||{},t.builtin=d.builtin||[],t.runtime=d.runtime||[];let w=await ws();t.probe=w.results||[],t.loaded=!0}catch(d){t.error=d.message,t.loaded=!0}let n=()=>{typeof window.__fd_nav=="function"&&window.__fd_nav("chains")},s=d=>()=>{t.editing=d,t.draft={name:d,links:[...t.chains[d]||[]]},n()},o=()=>{t.editing=null,t.draft={name:"",links:[]},n()},a=()=>{t.editing="__new__",t.draft={name:"",links:[]},n()},r=()=>{t.newLink.trim()&&(t.draft.links.push(t.newLink.trim()),t.newLink="",n())},i=d=>()=>{t.draft.links.splice(d,1),n()},l=async()=>{try{await bs(t.draft.name.trim(),t.draft.links),t.loaded=!1,t.editing=null,n()}catch(d){t.error=d.message,n()}},p=d=>async()=>{if(!t.builtin.includes(d))try{await vs(d),t.loaded=!1,n()}catch(w){t.error=w.message,n()}};if(t.error&&!t.loaded)return[T({title:"chains",body:"fallback chain editor",accent:"error"}),b({title:"error",children:G("span",{class:"fd-muted"},t.error)})];if(t.editing){let d=t.editing==="__new__",w=!d&&t.builtin.includes(t.editing);return[T({title:d?"new chain":"edit "+t.editing,body:"links are tried top-to-bottom",accent:w?"builtin read-only":"editable"}),b({title:"name",children:d?G("input",{class:"fd-input",value:t.draft.name,oninput:S=>{t.draft.name=S.target.value}}):G("code",{},t.draft.name)}),b({title:"links",count:t.draft.links.length,children:t.draft.links.length===0?M({text:"no links yet \u2014 add one below",glyph:"\u21B3"}):G("div",{class:"fd-list"},...t.draft.links.map((S,N)=>G("div",{key:N,class:"fd-list-row","data-cat":"kit"},G("span",{class:"fd-list-code"},String(N+1).padStart(2,"0")),G("div",{class:"fd-list-main"},G("div",{class:"fd-list-title"},S)),w?null:G("button",{class:"fd-btn fd-btn-mini",onclick:i(N)},"remove"))))}),w?null:b({title:"add link",children:G("div",{class:"fd-form-row"},G("input",{class:"fd-input",placeholder:"provider/model (e.g. groq/llama-3.3-70b-versatile)",value:t.newLink,oninput:S=>{t.newLink=S.target.value}}),G("button",{class:"fd-btn",onclick:r},"add"))}),b({title:"actions",children:G("div",{class:"fd-form-row"},w?null:G("button",{class:"fd-btn fd-btn-primary",onclick:l},d?"create":"save"),G("button",{class:"fd-btn",onclick:o},"cancel"))})]}let f=Object.keys(t.chains).sort(),u=t.builtin.length,g=t.runtime.length,c=t.probe.length;return[T({title:"chains",body:"named fallback chains. callers send model=<name> to select one.",accent:f.length+" total"}),J({items:[[u,"builtin"],[g,"runtime"],[c,"working models"]]}),b({title:"create",children:G("button",{class:"fd-btn fd-btn-primary",onclick:a},"+ new chain")}),b({title:"chains",count:f.length,children:f.length===0?M({text:"no chains configured",glyph:"\u229E"}):G("div",{class:"fd-list"},...f.map(d=>{let w=t.chains[d]||[],S=t.builtin.includes(d);return G("div",{key:d,class:"fd-list-row","data-cat":S?"external":"kit"},G("span",{class:"fd-list-code"},S?"\u25C6":"\u25CB"),G("div",{class:"fd-list-main"},G("div",{class:"fd-list-title"},d),G("div",{class:"fd-list-sub"},w.slice(0,3).join(" \u2192 ")+(w.length>3?` (+${w.length-3})`:""))),G("div",{class:"fd-list-meta"},G("span",{class:"fd-list-meta-mono"},S?"builtin":"runtime"),G("button",{class:"fd-btn fd-btn-mini",onclick:s(d)},S?"view":"edit"),S?null:G("button",{class:"fd-btn fd-btn-mini",onclick:p(d)},"delete")))}))}),b({title:"discovered models",count:c,right:c>0?C({tone:"ok",children:"fresh"}):C({tone:"miss",children:"no probe"}),children:c===0?M({text:"run a probe to see working models",glyph:"\u2726"}):G("div",{class:"fd-list"},...t.probe.slice(0,12).map(d=>G("div",{key:d.provider+"/"+d.model,class:"fd-list-row","data-cat":"kit"},G("span",{class:"fd-list-code"},d.provider.slice(0,3)),G("div",{class:"fd-list-main"},G("div",{class:"fd-list-title"},d.provider+"/"+d.model),G("div",{class:"fd-list-sub"},d.ms+"ms")))))})]}var Jt={home:be,chat:Se,voice:Ct,sessions:ve,projects:we,agents:ye,analytics:ke,models:xe,cron:De,skills:Ee,config:Ue,env:Ie,tools:je,batch:Ge,gateway:Ne,chains:Qe};var ys=I;var ae={};At(ae,{animateElement:()=>Ss,animateSelector:()=>xs,animateTree:()=>nt,installMotion:()=>Qn,shouldReduceMotion:()=>ks});function ks(){return!0}function Qn(){}function Ss(e,t,n={}){return Promise.resolve(!1)}function xs(e,t,n={}){return Promise.resolve(!1)}function nt(e,t={}){return 0}var Wt={mounts:0,sends:0},qt=class extends HTMLElement{static get observedAttributes(){return["title","sub","placeholder"]}constructor(){super(),this._messages=[],this._draft="",this._title="chat",this._sub="",this._placeholder="message\u2026"}set messages(t){this._messages=Array.isArray(t)?t:[],this._render()}get messages(){return this._messages}connectedCallback(){if(this.hasAttribute("messages"))try{this._messages=JSON.parse(this.getAttribute("messages"))}catch{}this._title=this.getAttribute("title")||this._title,this._sub=this.getAttribute("sub")||"",this._placeholder=this.getAttribute("placeholder")||this._placeholder,Wt.mounts+=1,this._render()}attributeChangedCallback(t,n,s){t==="title"&&(this._title=s||"chat"),t==="sub"&&(this._sub=s||""),t==="placeholder"&&(this._placeholder=s||"message\u2026"),this._render()}pushMessage(t){this._messages=[...this._messages,t],this._render()}_render(){let t=o=>{Wt.sends+=1,this.dispatchEvent(new CustomEvent("send",{detail:{text:o},bubbles:!0,composed:!0}))},n=o=>{this._draft=o,this._render()},s=$e({title:this._title,sub:this._sub,messages:this._messages,composer:_e({value:this._draft,placeholder:this._placeholder,onInput:n,onSend:t})});he(this,s)}},Rt=!1;function Tn(){Rt||(customElements.get("ds-chat")||customElements.define("ds-chat",qt),Rt=!0)}F("ds-chat",()=>({registered:Rt,...Wt,instances:document.querySelectorAll("ds-chat").length}));var Mn=!1;async function Pn(e){if(Mn&&!e)return;let t=await ct(),n=e||document.head,s=document.createElement("style");s.setAttribute("data-247420",""),s.textContent=t,n.appendChild(s),e||void 0,e||(Mn=!0)}function On(e,t,{autoScope:n=!0}={}){n&&e&&e.classList&&!e.classList.contains(lt.slice(1))&&e.classList.add(lt.slice(1));let s=()=>{he(e,t(s)),requestAnimationFrame(()=>nt(e))};return s(),s}typeof window<"u"&&typeof customElements<"u"&&Tn();var Ln=I;var ie={nav:[["works","#/works"],["project","#/project"],["writing","#/writing"],["manifesto","#/manifesto"],["source \u2197","https://github.com/AnEntrypoint"]],works:[{code:"001",title:"gm",sub:"state machine for coding agents",meta:"2025 \xB7 3k\u2605",body:"a tiny deterministic state machine that lets llms code without losing their minds. it thinks so you don't have to (as much).",href:"#/project",source:"https://github.com/AnEntrypoint/gm"},{code:"002",title:"zellous",sub:"production push-to-talk",meta:"2024 \xB7 live",body:"hold the button. talk. someone on the other side hears you. opus codec, dynamic rooms, 50-message replay.",href:"https://zellous.com",source:"https://github.com/AnEntrypoint/zellous"},{code:"003",title:"spoint",sub:"spawnpoint",meta:"2024 \xB7 live",body:'the directory for "where should we start?" one url, one room, everyone lands in the same place.',href:"https://spoint.world",source:"https://github.com/AnEntrypoint/spoint"},{code:"004",title:"flatspace",sub:"flat-file cms",meta:"wip",body:"still figuring out what to say about this one. come back tuesday.",href:"https://github.com/AnEntrypoint/flatspace",source:"https://github.com/AnEntrypoint/flatspace"},{code:"005",title:"thebird",sub:"\u2014",meta:"wip",body:"yes, the name is a reference. no, we won't tell you to what.",href:"https://github.com/AnEntrypoint/thebird",source:"https://github.com/AnEntrypoint/thebird"},{code:"006",title:"mcp-repl",sub:"repl for mcp",meta:"2024 \xB7 live",body:"executenodejs, executedeno, executebash, astgrep_search.",href:"https://github.com/AnEntrypoint/mcp-repl",source:"https://github.com/AnEntrypoint/mcp-repl"},{code:"007",title:"mutagen",sub:"adaptogen server",meta:"2024 \xB7 live",body:"everything to do with a dapp deg3n. read the source.",href:"https://github.com/AnEntrypoint/mutagen",source:"https://github.com/AnEntrypoint/mutagen"},{code:"008",title:"techshaman",sub:"member site",meta:"ongoing",body:"the official website for the techshaman.",href:"https://github.com/AnEntrypoint/techshaman",source:"https://github.com/AnEntrypoint/techshaman"}],posts:[{date:"2026.04.14",title:"we were here first",tag:"lore",href:"https://247420.xyz"},{date:"2026.03.22",title:"gm v0.4 postmortem, or: why state machines",tag:"gm",href:"https://github.com/AnEntrypoint/gm"},{date:"2026.02.09",title:"push-to-talk is a protocol, not a feature",tag:"zellous",href:"https://github.com/AnEntrypoint/zellous"},{date:"2025.12.11",title:"against the vibe-coded interface",tag:"manifesto",href:"#/manifesto"},{date:"2025.10.03",title:"notes on shipping weird",tag:"notes",href:"https://github.com/AnEntrypoint"}],manifesto:[{text:"we are the creative department of the internet. always open (24/7). always a little bit high on possibility (420)."},{text:"move fast. break things. document honestly. ship the rough draft. humor is load-bearing."},{text:"we will not tolerate simpleton design patterns, trifectas, gradients, or anything silly. nothing lame. we're internet natives and not easily pleased.",dim:!0}],currentlyShipping:[{title:"gm",sub:"state machine v0.4.1",meta:"live",live:!0},{title:"zellous",sub:"push-to-talk",meta:"live",live:!0},{title:"thebird",sub:"\u2014",meta:"wip",live:!1}],project:{name:"gm",tagline:"state machine for coding agents. it thinks, so you don't have to (as much).",install:"npx -y @anentrypoint/mcp-gm",receipt:[["status","live \xB7 ships tuesdays"],["stars","3,124"],["license","MIT"],["lang","typescript \xB7 deno"],["size","2.1mb"],["deps","0 runtime"],["authors","the collective"],["first commit","2024.09.03"]],changelog:[{date:"2026.04.20",ver:"v0.4.1",msg:"ship it. fixed the thing everyone complained about."},{date:"2026.03.22",ver:"v0.4.0",msg:"new state machine runtime. broke everything on purpose."},{date:"2026.02.09",ver:"v0.3.7",msg:"astgrep_search is now astgrep_enhanced_search."},{date:"2025.12.11",ver:"v0.3.0",msg:"first public release. gm, world."}]}},H={route:Cn(),opened:-1,copied:!1};function Cn(){let e=(location.hash||"#/").slice(1).split("/").filter(Boolean);return{page:e[0]||"works",id:e[1]||null}}window.addEventListener("hashchange",()=>{H.route=Cn(),We(),requestAnimationFrame(()=>{ae.animateSelector(".app-main","fadeIn",{duration:"var(--motion-base)"})})});var We;function Jn(e){location.hash="#/"+e}function Ds(){return K.Topbar({brand:"247420",leaf:"an entrypoint",items:ie.nav,active:H.route.page,onNav:Jn})}function Es(){return H.route.page==="project"?K.Crumb({trail:["247420","gm"],leaf:"overview",right:[K.Chip({tone:"accent",children:"\u25CF live"}),K.Chip({tone:"dim",children:"v0.4.1"})]}):K.Crumb({trail:["247420"],leaf:H.route.page})}function Is(){return K.Status({left:["main","\u2022 8 works","\u2022 5 posts"],right:["probably emerging",Ln("a",{href:"https://github.com/AnEntrypoint"},"source \u2197")]})}function js(){let e=H.route.page;return e==="project"?K.ProjectView({project:ie.project,copied:H.copied,onCopy:t=>{navigator.clipboard?.writeText(t),H.copied=!0,We(),requestAnimationFrame(()=>{ae.animateSelector(".cli .copy","pulse",{duration:"var(--motion-fast)"})}),setTimeout(()=>{H.copied=!1,We()},1200)}}):e==="writing"?[K.Section({title:"// recent writing",children:K.WritingList({posts:ie.posts})})]:e==="manifesto"?[K.Section({title:"// manifesto \xB7 rough draft",children:K.Manifesto({paragraphs:ie.manifesto})})]:K.HomeView({state:H,onNav:Jn,onToggleWork:t=>{H.opened=t,We(),t>=0&&requestAnimationFrame(()=>{ae.animateSelector(`[data-work-index="${t}"]`,"fadeInUp",{duration:"var(--motion-fast)"})})},works:ie.works,posts:ie.posts,manifesto:ie.manifesto,currentlyShipping:ie.currentlyShipping})}function Gs(){return K.AppShell({topbar:Ds(),crumb:Es(),main:js(),status:Is(),narrow:H.route.page==="project"})}await Pn();var Ns=document.getElementById("root");We=On(Ns,Gs);requestAnimationFrame(()=>{ae.animateSelector(".app-main","fadeIn",{duration:"var(--motion-base)"})});
|