forge-openclaw-plugin 0.2.98 → 0.2.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/activity-copy-Bj4h9OcF.js +1 -0
- package/dist/assets/activity-page-5oyCFOns.js +1 -0
- package/dist/assets/ai-surface-workspace-qgk_B57-.js +1 -0
- package/dist/assets/atlas-panel-rfH2qOez.js +1 -0
- package/dist/assets/{board-Ju0h0SeG.js → board-BkDRaMp6.js} +1 -1
- package/dist/assets/calendar-display-preferences-Cid-2RnL.js +1 -0
- package/dist/assets/calendar-page-Bo2iua-a.js +1 -0
- package/dist/assets/calendar-rules-DA1g3QUk.js +1 -0
- package/dist/assets/calendar-ui-Cy1XRwzV.js +1 -0
- package/dist/assets/calendar-week-toolbar-DU1Q4RYj.js +1 -0
- package/dist/assets/charts-P7EVhIog.js +36 -0
- package/dist/assets/companion-sync-lab-page-CosNknOK.js +1 -0
- package/dist/assets/daily-metrics-dashboard-LjuGAB3f.js +1 -0
- package/dist/assets/date-keys-Cj1G3TOn.js +1 -0
- package/dist/assets/entity-links-DwpxhW2H.js +1 -0
- package/dist/assets/entity-note-count-link-BmGDB572.js +1 -0
- package/dist/assets/entity-notes-surface-DgEgicaE.js +1 -0
- package/dist/assets/execution-board-CDRXQB85.js +1 -0
- package/dist/assets/faceted-token-search-CE1YauRd.js +1 -0
- package/dist/assets/flagship-signal-deck-DDds90Gl.js +1 -0
- package/dist/assets/floating-action-menu-CJkI2iFy.js +1 -0
- package/dist/assets/forms-BFlTgZ3W.js +1 -0
- package/dist/assets/goal-detail-page-cJvHaLMQ.js +1 -0
- package/dist/assets/goals-page-f_39hvUV.js +1 -0
- package/dist/assets/graph-BZV40eAE.css +1 -0
- package/dist/assets/graph-D6JLqDbD.js +318 -0
- package/dist/assets/habits-page-DKb96_mj.js +1 -0
- package/dist/assets/health-link-options-Cpx8w7uM.js +1 -0
- package/dist/assets/index-BHTUu_4M.js +19 -0
- package/dist/assets/index-CZbuZQjw.css +1 -0
- package/dist/assets/insight-flow-dialog-pzAzyayN.js +1 -0
- package/dist/assets/insights-page-Dc9oFltJ.js +8 -0
- package/dist/assets/kanban-page-JAxerYh6.js +1 -0
- package/dist/assets/knowledge-graph-page-UQ3skqEi.js +1 -0
- package/dist/assets/life-force-page-BGDbQuVh.js +1 -0
- package/dist/assets/life-force-workspace-B1fYSXRC.js +1 -0
- package/dist/assets/maps-B-YMMjus.css +1 -0
- package/dist/assets/maps-ClgJoCjz.js +803 -0
- package/dist/assets/metric-tile-DX6TclqM.js +1 -0
- package/dist/assets/{motion-DRPJkN3a.js → motion-BeD44FeG.js} +1 -1
- package/dist/assets/movement-page-6HP6nGJx.js +1 -0
- package/dist/assets/note-markdown-DiW2-5d3.js +3 -0
- package/dist/assets/note-tags-input-DDLXf54U.js +1 -0
- package/dist/assets/notes-page-BuguDjhz.js +1 -0
- package/dist/assets/open-in-graph-button-Cg5VrKsC.js +1 -0
- package/dist/assets/orbit-map-GD05-0oS.js +1 -0
- package/dist/assets/overview-page-DuOs2OCB.js +1 -0
- package/dist/assets/page-hero-CQWo1Mm_.js +1 -0
- package/dist/assets/pill-cluster-BJogDRDJ.js +1 -0
- package/dist/assets/preference-entity-handoff-button-D4WAs9pC.js +1 -0
- package/dist/assets/preferences-page-BaJTMU1I.js +1 -0
- package/dist/assets/project-collections-DvaX20q_.js +1 -0
- package/dist/assets/project-detail-page-drPIFZGb.js +1 -0
- package/dist/assets/project-management-hierarchy-page-BUbRXvny.js +1 -0
- package/dist/assets/project-management-section-nav-C2Ud8Zdd.js +1 -0
- package/dist/assets/projects-page-BGzEZUtg.js +1 -0
- package/dist/assets/psyche-behaviors-page-Dmm_Io9D.js +5 -0
- package/dist/assets/psyche-flashcards-page-BgNKJ6QJ.js +1 -0
- package/dist/assets/psyche-goal-map-page-DXJs98Vr.js +1 -0
- package/dist/assets/psyche-graph-CFgs_Bqc.js +1 -0
- package/dist/assets/psyche-metrics-page-zYTJDbyZ.js +1 -0
- package/dist/assets/psyche-mode-guide-page-XPgRfCOf.js +1 -0
- package/dist/assets/psyche-modes-page-B-GA8oRF.js +1 -0
- package/dist/assets/psyche-page--r6a3e1t.js +1 -0
- package/dist/assets/psyche-patterns-page-BM5-3bMm.js +5 -0
- package/dist/assets/psyche-questionnaire-builder-page-CJshQ-mg.js +1 -0
- package/dist/assets/psyche-questionnaire-detail-page-USmR5G5A.js +1 -0
- package/dist/assets/psyche-questionnaire-run-detail-page-D7iBCmTi.js +1 -0
- package/dist/assets/psyche-questionnaire-run-page-Cpil-kDh.js +1 -0
- package/dist/assets/psyche-questionnaires-page-C-_y3VwS.js +1 -0
- package/dist/assets/psyche-report-detail-page--dkSPRaj.js +3 -0
- package/dist/assets/psyche-reports-page-CUaOXmIN.js +1 -0
- package/dist/assets/psyche-schemas-HFmg37Wj.js +1 -0
- package/dist/assets/psyche-schemas-beliefs-page-BX6xaap3.js +9 -0
- package/dist/assets/psyche-screen-time-page-CAAI4mD7.js +1 -0
- package/dist/assets/psyche-self-observation-page-BZ6FLuwa.js +1 -0
- package/dist/assets/psyche-values-page-yEV6MGt8.js +5 -0
- package/dist/assets/query-cache-IQ8W-LNC.js +1 -0
- package/dist/assets/report-chain-fields-fZ8Xd4H6.js +1 -0
- package/dist/assets/rewards-page-C2HQjIAf.js +1 -0
- package/dist/assets/scheduling-rules-editor-BHOpHOrV.js +1 -0
- package/dist/assets/schema-badge-DyKbxb51.js +1 -0
- package/dist/assets/schema-visuals-D6nxjbYC.js +1 -0
- package/dist/assets/select-menu-BX-pZNqL.js +1 -0
- package/dist/assets/settings-agents-page-VuYXTiyc.js +6 -0
- package/dist/assets/settings-bin-page-BNzvYaOk.js +1 -0
- package/dist/assets/settings-calendar-page-CjSFB53S.js +5 -0
- package/dist/assets/settings-data-page-CGSlryuI.js +1 -0
- package/dist/assets/settings-logs-page-BTK5fine.js +1 -0
- package/dist/assets/settings-mobile-page-CRaObOGo.js +1 -0
- package/dist/assets/settings-models-page-DFshpYF8.js +1 -0
- package/dist/assets/settings-page-BP81Mb5R.js +1 -0
- package/dist/assets/settings-rewards-page-CDJ1PH2G.js +1 -0
- package/dist/assets/settings-section-nav-CCFm27r2.js +1 -0
- package/dist/assets/settings-users-page-TdUocFPa.js +1 -0
- package/dist/assets/settings-wiki-page-B2zX0QQG.js +1 -0
- package/dist/assets/sleep-page-cI1GMVzk.js +1 -0
- package/dist/assets/sports-page-06LTqp0V.js +1 -0
- package/dist/assets/state-B-4sS1xO.js +1 -0
- package/dist/assets/strategies-page-DXP9Kx8s.js +1 -0
- package/dist/assets/strategy-detail-page-D6mx_Mik.js +1 -0
- package/dist/assets/strategy-dialog-BvzomTaF.js +1 -0
- package/dist/assets/{table-DewbFlTh.js → table-WfAPUppN.js} +1 -1
- package/dist/assets/task-detail-page-BIWIggdp.js +1 -0
- package/dist/assets/timebox-planning-dialog-CaCnoslG.js +1 -0
- package/dist/assets/today-page-DO2mRPT2.js +1 -0
- package/dist/assets/training-load-page-CyZ0mlEr.js +1 -0
- package/dist/assets/{ui-C2IvSrAz.js → ui-C13Nbgas.js} +4 -4
- package/dist/assets/use-psyche-focus-target-C1C_XjYG.js +1 -0
- package/dist/assets/vendor-CRS-psbw.css +1 -0
- package/dist/assets/vendor-DHkYh85p.js +1052 -0
- package/dist/assets/vitals-page-BQvEjTc6.js +1 -0
- package/dist/assets/weekly-review-page-Tp6Q9CRj.js +1 -0
- package/dist/assets/weight-loss-page-BBzlhLVV.js +1 -0
- package/dist/assets/wiki-article-markdown-DQYohmW2.js +4 -0
- package/dist/assets/wiki-editor-page-Dem_3eZv.js +26 -0
- package/dist/assets/wiki-ingest-history-page-BxoOcCoJ.js +1 -0
- package/dist/assets/wiki-ingest-modal-DhguKk3J.js +1 -0
- package/dist/assets/wiki-page-BLRxVXkl.js +1 -0
- package/dist/assets/workbench-flow-page-DqMkCCTy.js +5 -0
- package/dist/assets/workbench-page-BWd02wPw.js +1 -0
- package/dist/assets/workout-detail-page-BD8u7GyL.js +2 -0
- package/dist/index.html +148 -9
- package/dist/openclaw/tools.js +340 -0
- package/dist/server/server/migrations/065_weight_loss_nutrition_insights.sql +236 -0
- package/dist/server/server/migrations/066_watch_action_receipts.sql +20 -0
- package/dist/server/server/src/app.js +266 -13
- package/dist/server/server/src/health-weight-loss.js +1378 -0
- package/dist/server/server/src/health.js +188 -35
- package/dist/server/server/src/openapi.js +449 -0
- package/dist/server/server/src/services/context.js +6 -7
- package/dist/server/server/src/services/doctor.js +39 -4
- package/dist/server/server/src/services/gamification.js +146 -34
- package/dist/server/server/src/watch-mobile.js +564 -4
- package/dist/server/server/src/web.js +18 -5
- package/dist/server/src/components/ui/info-tooltip.js +48 -3
- package/dist/server/src/lib/api.js +131 -0
- package/dist/server/src/lib/weight-loss-types.js +1 -0
- package/openclaw.plugin.json +14 -1
- package/package.json +1 -1
- package/server/migrations/065_weight_loss_nutrition_insights.sql +236 -0
- package/server/migrations/066_watch_action_receipts.sql +20 -0
- package/skills/forge-openclaw/SKILL.md +26 -5
- package/skills/forge-openclaw/entity_conversation_playbooks.md +134 -5
- package/skills/forge-openclaw/psyche_entity_playbooks.md +45 -0
- package/dist/assets/index-Cn5Wpwau.css +0 -1
- package/dist/assets/index-CwvGs8n4.js +0 -91
- package/dist/assets/vendor-B-Lq_OG3.css +0 -1
- package/dist/assets/vendor-DL2K5ayT.js +0 -2186
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{r as x,j as e,c7 as Ae,aC as ra,bk as na,bB as ze,bX as vt,ca as la,cm as ia,dG as oa,dH as _t,dI as Rt,aG as Et,b2 as da,dJ as Ot,dD as Pt,dK as Kt,dL as At,dM as zt,cr as ca,cc as ua,b5 as pa}from"./vendor-DHkYh85p.js";import{O as ha}from"./open-in-graph-button-Cg5VrKsC.js";import{P as ma}from"./page-hero-CQWo1Mm_.js";import{fr as xa,fs as ga,F as C,B as I,a9 as Mt,b as jt,fp as ba,Z as R,aq as V,Q as fa,ft as ya,fu as wa,aU as va,fv as kt,fw as ja,fx as ka,fy as Na,fz as Ca,fA as Sa,fB as Ia,fC as Ta,L as Fa,a as _a,E as Ra}from"./index-BHTUu_4M.js";import{i as Ea,B as Oa,a as Pa,b as Ka,c as Aa,H as za,P as Nt}from"./graph-D6JLqDbD.js";import{R as Ma,P as Wa,O as $a,C as Ha,T as La,D as Ua,a as qa}from"./ui-C13Nbgas.js";import{F as Ba}from"./faceted-token-search-CE1YauRd.js";import"./state-B-4sS1xO.js";import"./board-BkDRaMp6.js";import"./motion-BeD44FeG.js";import"./forms-BFlTgZ3W.js";function je(a){switch(a){case"exec":return 4;case"read_write":return 3;case"write":return 2;case"read":default:return 1}}function Va(a,i){return je(a)>=je(i)?a:i}function Ct(a,i){return a==="forge.search_entities"?"Search across Forge entities. You can optionally narrow the search to specific entity types.":a==="forge.create_note"?"Create a Forge note from generated content or captured markdown.":a==="forge.update_task_status"?"Move a task between execution states such as backlog, focus, in progress, blocked, and done.":i.sort((r,l)=>l.length-r.length)[0]??"Workbench tool"}function Da(a){const i=new Map;for(const r of a)for(const l of r.tools){const c=i.get(l.key);if(!c){i.set(l.key,{key:l.key,label:l.label,description:Ct(l.key,[l.description]),accessMode:l.accessMode,argsSchema:l.argsSchema,sources:[r.title],sourceSurfaceIds:r.surfaceId?[r.surfaceId]:[]});continue}c.accessMode=Va(c.accessMode,l.accessMode),c.label=c.label.length>=l.label.length?c.label:l.label,c.description=Ct(l.key,[c.description,l.description]),c.argsSchema=c.argsSchema??l.argsSchema,c.sources.includes(r.title)||c.sources.push(r.title),r.surfaceId&&!c.sourceSurfaceIds.includes(r.surfaceId)&&c.sourceSurfaceIds.push(r.surfaceId)}return[...i.values()].sort((r,l)=>{const c=je(l.accessMode)-je(r.accessMode);return c!==0?c:r.label.localeCompare(l.label)})}const w="rounded-[18px] border border-white/10 bg-black/20 px-4 py-3 text-sm text-white outline-none",We=[...ya],Wt={summary:"border-amber-300/28 bg-amber-300/12 text-amber-100",markdown:"border-violet-300/28 bg-violet-300/12 text-violet-100",text:"border-sky-300/28 bg-sky-300/12 text-sky-100",number:"border-emerald-300/28 bg-emerald-300/12 text-emerald-100",boolean:"border-lime-300/28 bg-lime-300/12 text-lime-100",entity:"border-fuchsia-300/28 bg-fuchsia-300/12 text-fuchsia-100",entity_list:"border-pink-300/28 bg-pink-300/12 text-pink-100",context:"border-cyan-300/28 bg-cyan-300/12 text-cyan-100",metrics:"border-teal-300/28 bg-teal-300/12 text-teal-100",filters:"border-orange-300/28 bg-orange-300/12 text-orange-100",record:"border-indigo-300/28 bg-indigo-300/12 text-indigo-100",record_list:"border-purple-300/28 bg-purple-300/12 text-purple-100",selection:"border-rose-300/28 bg-rose-300/12 text-rose-100",timeline:"border-blue-300/28 bg-blue-300/12 text-blue-100",json:"border-slate-300/28 bg-slate-300/12 text-slate-100",object:"border-slate-300/28 bg-slate-300/12 text-slate-100",array:"border-zinc-300/28 bg-zinc-300/12 text-zinc-100",tool:"border-red-300/28 bg-red-300/12 text-red-100"};function ve(a){return typeof a=="string"?a:typeof a=="number"||typeof a=="boolean"?String(a):Array.isArray(a)||a&&typeof a=="object"?JSON.stringify(a,null,2):""}function $t(a,i){if(a==="array"||a==="entity_list"||a==="record_list"||a==="object"||a==="json"||a==="record"||a==="context"||a==="filters"||a==="metrics"||a==="timeline"||a==="selection"||a==="entity"){if(!i.trim())return"";try{return JSON.parse(i)}catch{return i}}if(a==="boolean")return i.trim()?i.trim().toLowerCase()==="true"?!0:i.trim().toLowerCase()==="false"?!1:i:"";if(a==="number"){const r=i.trim();if(!r)return"";const l=Number(r);return Number.isFinite(l)?l:i}return i}function Ga(a,i){if(i==null||typeof i=="string"&&i.trim().length===0)return!a.required;switch(a.kind){case"text":case"markdown":case"summary":return typeof i=="string";case"number":return typeof i=="number"&&Number.isFinite(i);case"boolean":return typeof i=="boolean";case"array":case"entity_list":case"record_list":return Array.isArray(i);case"object":case"json":case"record":case"context":case"filters":case"metrics":case"timeline":case"selection":case"entity":return!!i&&typeof i=="object";default:return!0}}function Ht(a){switch(a){case"box":case"box_input":return{inputs:[],outputs:[{key:"summary",label:"Summary",kind:"summary",description:"Human-readable summary of the box snapshot.",modelName:"WorkbenchBoxSummary"}]};case"user_input":return{inputs:[],outputs:[{key:"message",label:"Message",kind:"text",description:"Raw user message passed into the flow.",modelName:"WorkbenchUserMessage"},{key:"context",label:"Structured context",kind:"context",description:"Structured context fields that arrived with the user input.",modelName:"WorkbenchUserContext"}]};case"value":return{inputs:[],outputs:[{key:"value",label:"Value",kind:"record",description:"Literal value emitted by this node.",modelName:"WorkbenchLiteralValue"}]};case"functor":case"chat":return{inputs:[{key:"input",label:"Flow input",kind:"context",required:!1,description:"Context gathered from upstream nodes."}],outputs:[{key:"answer",label:"Answer",kind:"markdown",description:"Primary answer returned by this AI node.",modelName:"WorkbenchAiAnswer"}]};case"merge":return{inputs:[{key:"left",label:"Left input",kind:"context",required:!1,description:"First context record to merge."},{key:"right",label:"Right input",kind:"context",required:!1,description:"Second context record to merge."}],outputs:[{key:"merged",label:"Merged context",kind:"context",description:"Combined context assembled from upstream nodes.",modelName:"WorkbenchMergedContext"}]};case"template":return{inputs:[{key:"input",label:"Template input",kind:"context",required:!1,description:"Structured context available to the template."}],outputs:[{key:"rendered",label:"Rendered output",kind:"markdown",description:"Rendered text produced by the template node.",modelName:"WorkbenchTemplateOutput"}]};case"pick_key":return{inputs:[{key:"object",label:"Source object",kind:"object",required:!1,description:"Object record the node should read from."}],outputs:[{key:"selected",label:"Selected value",kind:"record",description:"Value extracted from the chosen key.",modelName:"WorkbenchSelectedValue"}]};case"output":return{inputs:[{key:"result",label:"Published result",kind:"context",required:!1,description:"Final value the flow should publish."}],outputs:[]}}}function Ja(a){switch(a){case"box":case"box_input":return{icon:e.jsx(ca,{className:"size-4"}),badge:"box"};case"chat":return{icon:e.jsx(zt,{className:"size-4"}),badge:"chat"};case"functor":return{icon:e.jsx(Et,{className:"size-4"}),badge:"functor"};case"output":return{icon:e.jsx(At,{className:"size-4"}),badge:"output"};case"value":return{icon:e.jsx(Rt,{className:"size-4"}),badge:"value"};case"merge":return{icon:e.jsx(Ot,{className:"size-4"}),badge:"merge"};case"template":return{icon:e.jsx(Pt,{className:"size-4"}),badge:"template"};case"pick_key":return{icon:e.jsx(Kt,{className:"size-4"}),badge:"pick key"};default:return{icon:e.jsx(_t,{className:"size-4"}),badge:"input"}}}function Lt(a,i){var c,p,m,o;const r=(n,u)=>n.map((h,y)=>{const b=kt(h),g=b.key==="primary"?u==="output"?a.type==="functor"||a.type==="chat"?"answer":a.type==="box"||a.type==="box_input"?"summary":a.type==="value"?"value":a.type==="merge"?"merged":a.type==="template"?"rendered":a.type==="pick_key"?"selected":"result":a.type==="functor"||a.type==="chat"?"input":a.type==="output"?"result":b.key:b.key;return kt({...b,key:g,kind:g===b.key?b.kind:void 0})});if(a.type==="box"||a.type==="box_input"){const n=i.find(u=>u.id===a.data.boxId);return{inputs:r((n==null?void 0:n.inputs)??[],"input"),outputs:(c=n==null?void 0:n.output)!=null&&c.length?r(n.output,"output"):r([{key:"summary",label:"Summary",kind:"summary",description:"Human-readable summary of the box snapshot.",modelName:"WorkbenchBoxSummary"}],"output"),enabledToolKeys:(p=a.data.enabledToolKeys)!=null&&p.length?a.data.enabledToolKeys:((n==null?void 0:n.tools)??[]).map(u=>u.key),boxId:(n==null?void 0:n.id)??a.data.boxId??null}}const l=Ht(a.type);return{inputs:r((m=a.data.inputs)!=null&&m.length?a.data.inputs:l.inputs,"input"),outputs:r((o=a.data.outputs)!=null&&o.length?a.data.outputs:l.outputs,"output"),enabledToolKeys:a.data.enabledToolKeys??[],boxId:a.data.boxId??null}}function Qa(a,i){var l,c,p;const r=(l=a.data.outputKey)==null?void 0:l.trim();return!r||r==="primary"?((c=i[0])==null?void 0:c.key)??"":i.some(m=>m.key===r)?r:((p=i[0])==null?void 0:p.key)??r}function St(a,i,r){var l,c;return i.length===0?null:!a||a==="primary"?r&&i.some(p=>p.key===r)?r:((l=i[0])==null?void 0:l.key)??null:i.some(p=>p.key===a)?a:r&&i.some(p=>p.key===r)?r:((c=i[0])==null?void 0:c.key)??null}function Me(a,i){const r=a.graph.nodes.map(p=>{const m=Lt(p,i),o={...p,data:{...p.data,inputs:m.inputs,outputs:m.outputs,outputKey:Qa(p,m.outputs)}};return $e(o,i)}),l=new Map(r.map(p=>[p.id,p])),c=a.graph.edges.map(p=>{var h,y,b,g;const m=l.get(p.source),o=l.get(p.target),n=St(p.sourceHandle,(m==null?void 0:m.data.outputs)??[],(y=(h=m==null?void 0:m.data.outputs)==null?void 0:h[0])==null?void 0:y.key),u=St(p.targetHandle,(o==null?void 0:o.data.inputs)??[],(g=(b=o==null?void 0:o.data.inputs)==null?void 0:b[0])==null?void 0:g.key);return Ut({...p,sourceHandle:n,targetHandle:u})});return{nodes:r,edges:c}}function $e(a,i){const r=Lt(a,i);return{id:a.id,type:"workbench",position:a.position,data:{...a.data,nodeType:a.type==="box_input"?"box":a.type,boxId:r.boxId,enabledToolKeys:r.enabledToolKeys,inputs:r.inputs,outputs:r.outputs,params:a.data.params??[],paramValues:a.data.paramValues??{}}}}function Ut(a){return{id:a.id,source:a.source,target:a.target,sourceHandle:a.sourceHandle??void 0,targetHandle:a.targetHandle??void 0,label:a.label??void 0,style:{stroke:"rgba(188, 194, 255, 0.44)",strokeWidth:1.6}}}function qt(a){return{id:a.id,type:a.data.nodeType==="box"?"box":a.data.nodeType,position:a.position,data:{label:a.data.label,description:a.data.description,boxId:a.data.boxId??null,prompt:a.data.prompt??"",promptTemplate:a.data.promptTemplate??"",systemPrompt:a.data.systemPrompt??"",outputKey:a.data.outputKey??"",enabledToolKeys:a.data.enabledToolKeys??[],inputs:a.data.inputs??[],outputs:a.data.outputs??[],params:a.data.params??[],paramValues:a.data.paramValues??{},template:a.data.template??"",selectedKey:a.data.selectedKey??"",valueType:a.data.valueType??"string",valueLiteral:a.data.valueLiteral??"",modelConfig:a.data.modelConfig}}}function Ya(a){return{id:a.id,source:a.source,target:a.target,sourceHandle:a.sourceHandle??null,targetHandle:a.targetHandle??null,label:typeof a.label=="string"?a.label:null}}function It(a,i,r){var c;const l=Ht(a);return{id:`node_${crypto.randomUUID().replaceAll("-","").slice(0,8)}`,type:"workbench",position:{x:120+i.length%3*320,y:80+Math.floor(i.length/3)*220},data:{nodeType:a,label:(r==null?void 0:r.title)??(a==="functor"?"Functor":a==="chat"?"Chat node":a==="output"?"Output":a==="value"?"Value":a==="template"?"Template":a==="pick_key"?"Pick key":a==="merge"?"Merge":"User input"),description:(r==null?void 0:r.description)??(a==="box"?"Registered Forge box.":a==="chat"?"Conversational flow node.":a==="functor"?"Single transformation node.":"Workbench node."),boxId:(r==null?void 0:r.id)??null,enabledToolKeys:((r==null?void 0:r.tools)??[]).map(p=>p.key),inputs:(r==null?void 0:r.inputs)??l.inputs,outputs:(r==null?void 0:r.output)??l.outputs,params:(r==null?void 0:r.params)??[],paramValues:{},prompt:"",promptTemplate:"",systemPrompt:"",template:"",selectedKey:"",valueType:"string",valueLiteral:"",outputKey:((c=((r==null?void 0:r.output)??l.outputs)[0])==null?void 0:c.key)??"summary",modelConfig:{connectionId:null,provider:null,baseUrl:null,model:"",thinking:null,verbosity:null}}}}function Xa(a){return[a.kind,a.modelName,a.itemKind?`item:${a.itemKind}`:null].filter(Boolean).join(" · ")}function Za(a,i){switch(a){case"dirty":return"Unsaved changes";case"saving":return"Saving…";case"saved":return"All changes saved";case"error":return i?`Save failed: ${i}`:"Save failed";default:return"Saved"}}function es(a){const i=crypto.randomUUID().replaceAll("-","").slice(0,4);return{key:`${a}_${i}`,label:a==="input"?"New input":"New output",kind:a==="input"?"context":"record",description:"",required:!1,modelName:a==="input"?"WorkbenchInputContract":"WorkbenchOutputContract"}}function ts(){return{key:`flow_input_${crypto.randomUUID().replaceAll("-","").slice(0,4)}`,label:"New flow input",kind:"text",description:"",required:!1,modelName:"WorkbenchFlowInput",bindings:[]}}function ke({kind:a}){return e.jsx("span",{className:R("inline-flex items-center rounded-full border px-2.5 py-1 text-[10px] uppercase tracking-[0.16em]",Wt[a]??"border-white/12 bg-white/[0.05] text-white/60"),children:a.replaceAll("_"," ")})}function M({label:a,onClick:i,emphasis:r=!1}){return e.jsx("button",{type:"button",className:R("rounded-full border px-3 py-1.5 text-[11px] font-medium transition",r?"border-[rgba(192,193,255,0.32)] bg-[rgba(192,193,255,0.18)] text-white hover:bg-[rgba(192,193,255,0.24)]":"border-white/10 bg-white/[0.05] text-white/60 hover:bg-white/[0.08] hover:text-white"),onPointerDown:l=>l.stopPropagation(),onClick:l=>{l.stopPropagation(),i()},children:a})}function we({title:a,description:i,ports:r,onChange:l,prefix:c}){return e.jsxs("div",{className:"grid gap-3 rounded-[24px] border border-white/8 bg-white/[0.03] p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-white",children:[e.jsx("span",{children:a}),e.jsx(V,{content:i,label:`Explain ${a.toLowerCase()}`})]}),e.jsx("div",{className:"mt-1 text-sm leading-6 text-white/54",children:i})]}),e.jsxs(I,{type:"button",variant:"secondary",size:"sm",onClick:()=>l([...r??[],es(c)]),children:["Add ",c]})]}),e.jsxs("div",{className:"grid gap-3",children:[r.length===0?e.jsxs("div",{className:"rounded-[18px] border border-dashed border-white/10 px-4 py-3 text-sm text-white/42",children:["No ",c,"s defined yet."]}):null,r.map((p,m)=>e.jsxs("div",{className:"grid gap-3 rounded-[20px] border border-white/8 bg-black/20 p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(ke,{kind:p.kind}),e.jsx("span",{className:"text-sm font-medium text-white",children:p.label})]}),e.jsx(I,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(r.filter((o,n)=>n!==m)),children:"Remove"})]}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsx(C,{label:"Key",description:"Downstream nodes reference this exact key.",labelHelp:"Keep keys stable once edges depend on them. Use snake_case names that describe the value clearly.",children:e.jsx("input",{value:p.key,onChange:o=>l(r.map((n,u)=>u===m?{...n,key:o.target.value}:n)),className:w})}),e.jsx(C,{label:"Label",description:"Readable name shown in the graph editor.",children:e.jsx("input",{value:p.label,onChange:o=>l(r.map((n,u)=>u===m?{...n,label:o.target.value}:n)),className:w})})]}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsx(C,{label:"Value type",description:"This colors the port and tells the flow what sort of value should move through it.",children:e.jsx("select",{value:p.kind,onChange:o=>l(r.map((n,u)=>u===m?{...n,kind:o.target.value}:n)),className:w,children:We.map(o=>e.jsx("option",{value:o,children:o.replaceAll("_"," ")},o))})}),e.jsx(C,{label:"Model name",description:"Semantic model name for this port, used in previews and runtime contracts.",children:e.jsx("input",{value:p.modelName??"",onChange:o=>l(r.map((n,u)=>u===m?{...n,modelName:o.target.value||void 0}:n)),placeholder:"WorkbenchTaskSearchResults",className:w})})]}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsx(C,{label:"Item kind",description:"Optional entity or item subtype when this port carries a collection.",children:e.jsx("input",{value:p.itemKind??"",onChange:o=>l(r.map((n,u)=>u===m?{...n,itemKind:o.target.value||void 0}:n)),placeholder:"task",className:w})}),e.jsx(C,{label:"Example value",description:"Short example shown in collapsed previews.",children:e.jsx("input",{value:p.exampleValue??"",onChange:o=>l(r.map((n,u)=>u===m?{...n,exampleValue:o.target.value||void 0}:n)),placeholder:c==="input"?"task ids and filters":"summarized result",className:w})})]}),e.jsx(C,{label:"Expectation",description:"Describe what should actually be inside this value so the graph stays legible.",children:e.jsx("textarea",{rows:3,value:p.description??"",onChange:o=>l(r.map((n,u)=>u===m?{...n,description:o.target.value||void 0}:n)),placeholder:c==="input"?"Explain what upstream nodes should provide here.":"Explain what downstream nodes can expect from this output.",className:w})}),e.jsxs("details",{className:"rounded-[18px] border border-white/8 bg-white/[0.03] p-4",children:[e.jsx("summary",{className:"cursor-pointer text-sm font-medium text-white",children:"Shape fields"}),e.jsxs("div",{className:"mt-3 grid gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsx("div",{className:"text-sm leading-6 text-white/54",children:"Describe the object structure or list item shape this port carries."}),e.jsx(I,{type:"button",variant:"secondary",size:"sm",onClick:()=>l(r.map((o,n)=>n===m?{...o,shape:[...o.shape??[],{key:`field_${crypto.randomUUID().replaceAll("-","").slice(0,4)}`,label:"New field",kind:"text",required:!1}]}:o)),children:"Add field"})]}),(p.shape??[]).length===0?e.jsx("div",{className:"rounded-[16px] border border-dashed border-white/10 px-4 py-3 text-sm text-white/42",children:"No explicit structure fields yet."}):null,(p.shape??[]).map((o,n)=>e.jsxs("div",{className:"grid gap-3 rounded-[16px] border border-white/8 bg-black/20 p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsx(ke,{kind:o.kind}),e.jsx(I,{type:"button",variant:"ghost",size:"sm",onClick:()=>l(r.map((u,h)=>h===m?{...u,shape:(u.shape??[]).filter((y,b)=>b!==n)}:u)),children:"Remove field"})]}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsx("input",{value:o.key,onChange:u=>l(r.map((h,y)=>y===m?{...h,shape:(h.shape??[]).map((b,g)=>g===n?{...b,key:u.target.value}:b)}:h)),placeholder:"field_key",className:w}),e.jsx("input",{value:o.label,onChange:u=>l(r.map((h,y)=>y===m?{...h,shape:(h.shape??[]).map((b,g)=>g===n?{...b,label:u.target.value}:b)}:h)),placeholder:"Field label",className:w})]}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsx("select",{value:o.kind,onChange:u=>l(r.map((h,y)=>y===m?{...h,shape:(h.shape??[]).map((b,g)=>g===n?{...b,kind:u.target.value}:b)}:h)),className:w,children:We.map(u=>e.jsx("option",{value:u,children:u.replaceAll("_"," ")},u))}),e.jsxs("label",{className:"flex items-center gap-2 rounded-[18px] border border-white/10 bg-black/20 px-4 py-3 text-sm text-white/64",children:[e.jsx("input",{type:"checkbox",checked:!!o.required,onChange:u=>l(r.map((h,y)=>y===m?{...h,shape:(h.shape??[]).map((b,g)=>g===n?{...b,required:u.target.checked}:b)}:h))}),"Required field"]})]}),e.jsx("textarea",{rows:2,value:o.description??"",onChange:u=>l(r.map((h,y)=>y===m?{...h,shape:(h.shape??[]).map((b,g)=>g===n?{...b,description:u.target.value||void 0}:b)}:h)),placeholder:"What should this field contain?",className:w})]},`${p.key}-shape-${o.key}-${n}`))]})]}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/64",children:[e.jsx("input",{type:"checkbox",checked:!!p.required,onChange:o=>l(r.map((n,u)=>u===m?{...n,required:o.target.checked}:n))}),"Required port"]})]},`${c}-${p.key}-${m}`))]})]})}function as({inputs:a,nodes:i,onChange:r}){return e.jsxs("div",{className:"grid gap-3 rounded-[24px] border border-white/8 bg-white/[0.03] p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-white",children:[e.jsx("span",{children:"Flow inputs"}),e.jsx(V,{content:"These are the typed inputs your Workbench flow exposes to the API and the Run modal.",label:"Explain flow inputs"})]}),e.jsx("div",{className:"mt-1 text-sm leading-6 text-white/54",children:"Define the external contract once, then bind each input to the node inputs or parameters that should consume it."})]}),e.jsx(I,{type:"button",variant:"secondary",size:"sm",onClick:()=>r([...a??[],ts()]),children:"Add flow input"})]}),a.length===0?e.jsx("div",{className:"rounded-[18px] border border-dashed border-white/10 px-4 py-3 text-sm text-white/42",children:"No public flow inputs defined yet."}):null,e.jsx("div",{className:"grid gap-3",children:a.map((l,c)=>{const p=i.filter(o=>(o.data.inputs??[]).length>0||(o.data.params??[]).length>0),m=o=>r(a.map((n,u)=>u===c?{...n,...o}:n));return e.jsxs("div",{className:"grid gap-3 rounded-[20px] border border-white/8 bg-black/20 p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(ke,{kind:l.kind}),e.jsx("span",{className:"text-sm font-medium text-white",children:l.label})]}),e.jsx(I,{type:"button",variant:"ghost",size:"sm",onClick:()=>r(a.filter((o,n)=>n!==c)),children:"Remove"})]}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsx(C,{label:"Key",description:"External API key callers will send.",children:e.jsx("input",{value:l.key,onChange:o=>m({key:o.target.value}),className:w})}),e.jsx(C,{label:"Label",description:"Human-readable name used in the Run modal.",children:e.jsx("input",{value:l.label,onChange:o=>m({label:o.target.value}),className:w})})]}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsx(C,{label:"Value type",description:"Expected type for this flow input.",children:e.jsx("select",{value:l.kind,onChange:o=>m({kind:o.target.value}),className:w,children:We.map(o=>e.jsx("option",{value:o,children:o.replaceAll("_"," ")},o))})}),e.jsx(C,{label:"Default value",description:"Used when a caller omits this input.",children:e.jsx("textarea",{rows:3,value:ve(l.defaultValue),onChange:o=>m({defaultValue:$t(l.kind,o.target.value)}),className:w})})]}),e.jsx(C,{label:"Description",description:"Explain what callers should send here.",children:e.jsx("textarea",{rows:3,value:l.description??"",onChange:o=>m({description:o.target.value}),className:w})}),e.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/64",children:[e.jsx("input",{type:"checkbox",checked:!!l.required,onChange:o=>m({required:o.target.checked})}),"Required input"]}),e.jsxs("div",{className:"grid gap-2 rounded-[18px] border border-white/8 bg-white/[0.03] p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-white",children:["Bindings",e.jsx(V,{content:"Bind this public input to one or more node inputs or parameters. If you leave bindings empty and a node uses the same key, Forge will auto-bind it by key.",label:"Explain bindings"})]}),(l.bindings??[]).map((o,n)=>{const u=i.find(y=>y.id===o.nodeId)??null,h=o.targetKind==="param"?(u==null?void 0:u.data.params)??[]:(u==null?void 0:u.data.inputs)??[];return e.jsxs("div",{className:"grid gap-3 rounded-[16px] bg-black/20 p-3 md:grid-cols-[1.2fr_1fr_1fr_auto]",children:[e.jsxs("select",{value:o.nodeId,onChange:y=>m({bindings:(l.bindings??[]).map((b,g)=>g===n?{...b,nodeId:y.target.value,targetKey:""}:b)}),className:w,children:[e.jsx("option",{value:"",children:"Select node"}),p.map(y=>e.jsx("option",{value:y.id,children:y.data.label},y.id))]}),e.jsxs("select",{value:o.targetKind,onChange:y=>m({bindings:(l.bindings??[]).map((b,g)=>g===n?{...b,targetKind:y.target.value,targetKey:""}:b)}),className:w,children:[e.jsx("option",{value:"input",children:"Node input"}),e.jsx("option",{value:"param",children:"Node parameter"})]}),e.jsxs("select",{value:o.targetKey,onChange:y=>m({bindings:(l.bindings??[]).map((b,g)=>g===n?{...b,targetKey:y.target.value}:b)}),className:w,children:[e.jsx("option",{value:"",children:"Select target"}),h.map(y=>e.jsx("option",{value:y.key,children:y.label},y.key))]}),e.jsx(I,{type:"button",variant:"ghost",size:"sm",onClick:()=>m({bindings:(l.bindings??[]).filter((y,b)=>b!==n)}),children:"Remove"})]},`${o.nodeId}-${o.targetKey}-${n}`)}),e.jsx(I,{type:"button",variant:"secondary",size:"sm",onClick:()=>m({bindings:[...l.bindings??[],{nodeId:"",targetKind:"input",targetKey:""}]}),children:"Add binding"})]})]},`${l.key}-${c}`)})})]})}function Tt({side:a,ports:i,collapsed:r}){return e.jsxs("div",{className:"grid gap-1.5",children:[e.jsxs("div",{className:R("flex items-center gap-1 px-1 text-[10px] font-medium uppercase tracking-[0.18em] text-white/34",a==="left"?"text-left":"text-right"),children:[e.jsx("span",{children:a==="left"?"Inputs":"Outputs"}),e.jsx(V,{content:a==="left"?"Inputs are values this node expects from earlier nodes in the flow.":"Outputs are the values this node publishes for later nodes to consume.",label:a==="left"?"Explain node inputs":"Explain node outputs"})]}),i.length===0?e.jsx("div",{className:R("rounded-full border border-dashed border-white/8 px-3 py-1.5 text-[11px] text-white/28",a==="left"?"text-left":"text-right"),children:"None"}):null,i.map(l=>e.jsxs("div",{className:R("relative min-h-6 rounded-[16px] border px-3 py-2 text-[11px] tracking-[0.01em] text-white/62",a==="left"?"pl-5 text-left":"pr-5 text-right",r?"bg-white/[0.02]":"bg-white/[0.04]",Wt[l.kind]??"border-white/8"),children:[e.jsx(za,{type:a==="left"?"target":"source",position:a==="left"?Nt.Left:Nt.Right,id:l.key,className:"!size-2.5 !border !border-white/80 !bg-[#b8c5ff]",style:{[a]:6}}),r?null:e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{children:l.label}),e.jsx(ke,{kind:l.kind})]}),e.jsx("div",{className:"mt-1 text-[10px] text-white/36",children:Xa(l)})]})]},`${a}-${l.key}`))]})}function ss(a){var u,h,y,b;const i=wa(a.data.boxId??null),[r,l]=x.useState(!1),[c,p]=x.useState(!1),m=Ja(a.data.nodeType),o=((u=a.data.params)==null?void 0:u.length)??0,n=`${((h=a.data.inputs)==null?void 0:h.length)??0} in · ${((y=a.data.outputs)==null?void 0:y.length)??0} out`;if(i&&a.data.nodeType==="box"){const g=i.NodeView;return e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"absolute right-3 top-3 z-10 flex flex-wrap items-center justify-end gap-2",children:[e.jsx(M,{label:"Edit",onClick:()=>{var k,F;return(F=(k=a.data).onEditRequest)==null?void 0:F.call(k)}}),e.jsx(M,{label:n,onClick:()=>{var k,F;return(F=(k=a.data).onContractEditRequest)==null?void 0:F.call(k)}}),o>0?e.jsx(M,{label:`${o} parameter${o===1?"":"s"}`,onClick:()=>{var k,F;return(F=(k=a.data).onParameterEditRequest)==null?void 0:F.call(k)},emphasis:!0}):null]}),e.jsx("div",{className:R("rounded-[28px] p-[2px] transition",a.selected?"bg-[linear-gradient(135deg,rgba(191,198,255,0.6),rgba(67,98,255,0.28))]":"bg-transparent"),children:e.jsx(g,{nodeId:a.id,inputs:void 0,params:void 0,compact:!1})})]})}return e.jsxs("div",{className:R("min-w-[270px] rounded-[24px] border border-white/10 bg-[linear-gradient(180deg,rgba(20,28,45,0.98),rgba(11,16,29,0.98))] p-3 shadow-[0_26px_80px_rgba(0,0,0,0.4)]",a.selected&&"border-[rgba(191,198,255,0.52)]"),children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 text-white",children:[m.icon,e.jsx("div",{className:"truncate text-sm font-semibold",children:a.data.label})]}),a.data.description?e.jsx("div",{className:"mt-1 line-clamp-2 text-[12px] leading-5 text-white/48",children:a.data.description}):null]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{label:r?"Show ports":"Hide labels",onClick:()=>l(g=>!g)}),e.jsx("div",{className:"rounded-full bg-white/[0.06] px-2.5 py-1 text-[10px] uppercase tracking-[0.16em] text-white/56",children:m.badge})]})]}),a.data.boxId?e.jsx("div",{className:"mt-3 rounded-full bg-white/[0.05] px-3 py-1.5 text-[11px] text-white/56",children:a.data.boxId}):null,e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[(b=a.data.enabledToolKeys)!=null&&b.length?e.jsxs("div",{className:"rounded-full bg-white/[0.05] px-3 py-1.5 text-[11px] text-white/56",children:[a.data.enabledToolKeys.length," tool",a.data.enabledToolKeys.length===1?"":"s"," enabled"]}):null,e.jsx(M,{label:c?"Hide schema":"Preview schema",onClick:()=>p(g=>!g)}),e.jsx(M,{label:"Edit",onClick:()=>{var g,k;return(k=(g=a.data).onEditRequest)==null?void 0:k.call(g)}}),e.jsx(M,{label:n,onClick:()=>{var g,k;return(k=(g=a.data).onContractEditRequest)==null?void 0:k.call(g)}}),o>0?e.jsx(M,{label:`${o} parameter${o===1?"":"s"}`,onClick:()=>{var g,k;return(k=(g=a.data).onParameterEditRequest)==null?void 0:k.call(g)},emphasis:!0}):null]}),e.jsxs("div",{className:"mt-3 grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)] gap-3",children:[e.jsx(Tt,{side:"left",ports:a.data.inputs??[],collapsed:r}),e.jsx(Tt,{side:"right",ports:a.data.outputs??[],collapsed:r})]}),c?e.jsxs("div",{className:"mt-3 rounded-[18px] border border-white/8 bg-black/20 p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[10px] uppercase tracking-[0.18em] text-white/38",children:[e.jsx("span",{children:"Node contract"}),e.jsx(V,{content:"This preview shows the shape of the values and tools this node exposes inside the flow graph.",label:"Explain node contract preview"})]}),e.jsx("pre",{className:"mt-2 overflow-auto whitespace-pre-wrap text-[11px] leading-5 text-white/64",children:JSON.stringify({inputs:(a.data.inputs??[]).map(({key:g,kind:k,required:F})=>({key:g,kind:k,required:!!F})),outputs:(a.data.outputs??[]).map(({key:g,kind:k,required:F})=>({key:g,kind:k,required:!!F})),tools:a.data.enabledToolKeys??[]},null,2)})]}):null]})}const rs={workbench:ss};function ie(a){return a==="functor"||a==="chat"}function ns(a){const i=a instanceof Mt||a instanceof Error?a.message:String(a);return i.includes("No model connection is configured for this connector node.")?["This flow uses an AI node, but Forge does not have any model connection configured yet.","Open Settings > Models, add a model connection, then run the flow again.","Once a model exists, the node can use the default model automatically or you can pick a specific model inside the node editor."].join(`
|
|
2
|
+
|
|
3
|
+
`):i}function ls(a){return a.map(({key:i,kind:r,required:l,description:c,modelName:p,itemKind:m,shape:o,exampleValue:n})=>({key:i,kind:r,required:!!l,description:c,modelName:p,itemKind:m,shape:o,exampleValue:n}))}function is(a){const i=Array.from(new Set(a.map(l=>l.trim()).filter(Boolean)));return(i.includes("answer")?i:["answer",...i]).map(l=>({key:l,label:l==="answer"?"Answer":l.split(/[_-]+/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join(" "),kind:l==="answer"?"markdown":"record",description:l==="answer"?"Primary answer returned by this AI node.":`Named output published for downstream nodes under "${l}".`,modelName:l==="answer"?"WorkbenchAiAnswer":`Workbench${l.split(/[_-]+/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("")}`,exampleValue:l==="answer"?"Concise answer":void 0}))}function os(a,i){return Bt(a,i)[0]??null}function Bt(a,i){var m,o;const r=[],l=new Map(a.map(n=>[n.id,n]));a.length===0&&r.push("Add at least one node before running the flow.");const c=a.filter(n=>n.data.nodeType==="output");c.length===0&&r.push("Add an Output node so Forge knows what result the flow should publish.");const p=new Map;for(const n of i){p.set(n.target,(p.get(n.target)??0)+1);const u=l.get(n.source),h=l.get(n.target),y=(u==null?void 0:u.data.outputs)??[],b=(h==null?void 0:h.data.inputs)??[];u&&(n.sourceHandle&&!y.some(g=>g.key===n.sourceHandle)?r.push(`Edge from "${u.data.label}" points to missing output "${n.sourceHandle}". Update the edge or restore that output contract.`):!n.sourceHandle&&y.length>1&&r.push(`Edge from "${u.data.label}" does not name which output it should use. Pick one explicit output handle.`)),h&&(n.targetHandle&&!b.some(g=>g.key===n.targetHandle)?r.push(`Edge into "${h.data.label}" points to missing input "${n.targetHandle}". Update the edge or restore that input contract.`):!n.targetHandle&&b.length>1&&r.push(`Edge into "${h.data.label}" does not name which input it should feed. Pick one explicit input handle.`))}for(const n of c){(p.get(n.id)??0)===0&&r.push(`Connect something into the output node "${n.data.label}" so the flow has something to return.`);const u=i.filter(h=>h.target===n.id).flatMap(h=>{const y=l.get(h.source),b=(y==null?void 0:y.data.outputs)??[];return h.sourceHandle?b.filter(g=>g.key===h.sourceHandle).map(g=>g.key):b.map(g=>g.key)});n.data.outputKey&&u.length>0&&!u.includes(n.data.outputKey)&&r.push(`Output node "${n.data.label}" is configured to publish "${n.data.outputKey}", but that key is not arriving from its upstream nodes.`)}for(const n of a){const u=p.get(n.id)??0,h=i.filter(y=>y.source===n.id).length;n.data.nodeType!=="user_input"&&n.data.nodeType!=="value"&&u===0&&n.data.nodeType!=="box"&&r.push(`Connect an upstream source into "${n.data.label}" so it has real input to work with.`),n.data.nodeType==="merge"&&u<2&&r.push(`Merge node "${n.data.label}" should receive both left and right inputs before you run it.`),n.data.nodeType==="template"&&!(n.data.template??"").trim()&&r.push(`Add a template string to "${n.data.label}" before running the flow.`),n.data.nodeType==="pick_key"&&!(n.data.selectedKey??"").trim()&&r.push(`Choose which key "${n.data.label}" should pick from incoming objects.`),n.data.nodeType!=="output"&&h===0&&r.push(`Connect the output of "${n.data.label}" somewhere useful or remove the node from the graph.`)}for(const n of a)ie(n.data.nodeType)&&!((m=n.data.promptTemplate)!=null&&m.trim()||(o=n.data.prompt)!=null&&o.trim())&&r.push(`Add a prompt to the AI node "${n.data.label}" before running the flow.`);return r}function le({open:a,onOpenChange:i,title:r,description:l,children:c}){return e.jsx(Ma,{open:a,onOpenChange:i,children:e.jsxs(Wa,{children:[e.jsx($a,{className:"fixed inset-0 z-50 bg-[rgba(3,7,18,0.72)] backdrop-blur-sm"}),e.jsxs(Ha,{className:"fixed inset-x-4 bottom-4 top-4 z-50 mx-auto flex max-w-[min(44rem,calc(100vw-2rem))] flex-col overflow-hidden rounded-[32px] border border-white/10 bg-[linear-gradient(180deg,rgba(12,18,33,0.985),rgba(8,13,24,0.985))] shadow-[0_36px_96px_rgba(0,0,0,0.46)] md:left-1/2 md:right-auto md:top-[8vh] md:h-[min(82vh,58rem)] md:w-[min(44rem,calc(100vw-1.25rem))] md:-translate-x-1/2 md:bottom-auto",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-white/8 px-5 py-4 backdrop-blur-xl",children:[e.jsxs("div",{children:[e.jsx(La,{className:"font-display text-[1.28rem] tracking-[-0.04em] text-white",children:r}),l?e.jsx(Ua,{className:"mt-1 text-sm leading-6 text-white/54",children:l}):null]}),e.jsx(qa,{asChild:!0,children:e.jsx(va,{"aria-label":"Close workbench flow dialog"})})]}),e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain px-5 py-5",children:c})]})]})})}function Ft({title:a,description:i,kind:r,publicInputs:l,nodes:c,edges:p}){return{title:a,description:i,kind:r,publicInputs:l,graph:{nodes:c.map(qt),edges:p.map(Ya)}}}function ds({flow:a,boxes:i,modelConnections:r,runs:l,onSave:c,onDelete:p,onRun:m,onChat:o}){var Ze,et,tt,at,st,rt,nt,lt,it,ot,dt,ct,ut,pt,ht,mt,xt,gt,bt,ft,yt,wt;const[n,u]=x.useState(a.title),[h,y]=x.useState(a.description),[b,g]=x.useState(a.kind),[k,F]=x.useState(a.publicInputs??[]),[T,W]=x.useState(()=>Me(a,i).nodes),[E,Q]=x.useState(()=>Me(a,i).edges),[oe,Ne]=x.useState(null),[Vt,de]=x.useState(!1),[He,$]=x.useState(!1),[ce,ue]=x.useState("overview"),[Dt,Ce]=x.useState(void 0),[Gt,pe]=x.useState(!1),[Jt,Se]=x.useState(!1),[Ie,Te]=x.useState(!1),[Fe,Qt]=x.useState(""),[_e,Yt]=x.useState([]),[Re,Xt]=x.useState(""),[H,Y]=x.useState({}),[Ee,Zt]=x.useState(!0),[he,L]=x.useState(null),[X,U]=x.useState("idle"),[ea,me]=x.useState(null),[D,Le]=x.useState(((Ze=l[0])==null?void 0:Ze.id)??null),[xe,Ue]=x.useState(null),O=x.useMemo(()=>JSON.stringify(Ft({title:a.title,description:a.description,kind:a.kind,publicInputs:a.publicInputs??[],nodes:a.graph.nodes.map(t=>$e(t,i)),edges:a.graph.edges.map(Ut)})),[i,a]),G=x.useRef(O),Oe=x.useRef(O),qe=x.useRef({}),ge=x.useRef(O),be=x.useRef(null),fe=x.useRef(!1);x.useEffect(()=>{if(O===Oe.current)return;Oe.current=O,G.current=O,ge.current=O,u(a.title),y(a.description),g(a.kind),F(a.publicInputs??[]);const t=Me(a,i);W(t.nodes),Q(t.edges),U("idle"),me(null)},[i,a,O]),x.useEffect(()=>{Y(Object.fromEntries((a.publicInputs??[]).filter(t=>t.defaultValue!==void 0).map(t=>[t.key,t.defaultValue])))},[a.publicInputs]),x.useEffect(()=>{var t;Le(((t=l[0])==null?void 0:t.id)??null)},[l]),x.useEffect(()=>{W(t=>t.map(s=>s.data.nodeType!=="box"||!s.data.boxId?s:$e(qt(s),i)))},[i]);const ta=x.useMemo(()=>Array.from(new Set(i.map(s=>s.category))).map(s=>({id:`category:${s}`,label:s,description:"Workbench box category"})),[i]),Be=x.useMemo(()=>{const t=Fe.trim().toLowerCase();return i.filter(s=>{const d=t.length===0||[s.title,s.description,s.category,s.routePath??"",...s.tags].join(" ").toLowerCase().includes(t),j=_e.every(N=>N.startsWith("category:")?s.category===N.replace("category:",""):!0);return d&&j})},[_e,Fe,i]),f=x.useMemo(()=>T.find(t=>t.id===oe)??null,[T,oe]),Z=l[0]??null,q=l.find(t=>t.id===D)??Z??null,J=xa({flowId:a.id,runId:D??""},{skip:!D||!Ie}),P=((et=J.data)==null?void 0:et.nodeResults.find(t=>t.nodeId===xe))??null,K=ga({flowId:a.id,runId:D??"",nodeId:xe??""},{skip:!D||!xe||!Ie}),ye=x.useMemo(()=>Bt(T,E),[T,E]),Ve=x.useMemo(()=>T.some(t=>ie(t.data.nodeType)),[T]),Pe=x.useMemo(()=>T.some(t=>t.data.nodeType==="user_input")||(k??[]).length===0,[T,k]);x.useEffect(()=>{var s,d;const t=((d=(s=J.data)==null?void 0:s.nodeResults[0])==null?void 0:d.nodeId)??null;Ue(t)},[(tt=J.data)==null?void 0:tt.nodeResults]);const De=x.useMemo(()=>!!(f&&f.data.nodeType!=="box"&&f.data.nodeType!=="box_input"),[f]),Ge=x.useMemo(()=>f?E.filter(t=>t.target===f.id).flatMap(t=>{const s=T.find(j=>j.id===t.source),d=(s==null?void 0:s.data.outputs)??[];return t.sourceHandle?d.filter(j=>j.key===t.sourceHandle):d}):[],[E,T,f]),ee=x.useMemo(()=>Da(i),[i]),te=x.useMemo(()=>{if(!f||!ie(f.data.nodeType))return[];const t=new Set(f.data.enabledToolKeys??[]);return ee.filter(s=>t.has(s.key))},[ee,f]),Ke=x.useMemo(()=>Ft({title:n,description:h,kind:b,publicInputs:k,nodes:T,edges:E}),[h,E,b,T,k,n]),ae=x.useMemo(()=>JSON.stringify(Ke),[Ke]),Je=ae!==G.current;x.useEffect(()=>{if(qe.current=Ke,ge.current=ae,ae===G.current){me(null),U(t=>t==="saved"?t:"idle");return}U(t=>t==="saving"?t:"dirty")},[ae]);const aa=x.useMemo(()=>!f||!ie(f.data.nodeType)?[]:[{id:"overview",eyebrow:f.data.nodeType==="chat"?"Chat node":"Functor node",title:"Define what this node is responsible for",description:"Give the node a clear role in the flow before configuring prompts and models.",render:(t,s)=>e.jsxs(e.Fragment,{children:[e.jsx(C,{label:"Label",description:"This is the name shown on the canvas and in debug traces.",children:e.jsx("input",{value:t.label,onChange:d=>s({label:d.target.value}),className:w})}),e.jsx(C,{label:"Description",description:"Explain what this node should do with the incoming flow context.",children:e.jsx("textarea",{rows:4,value:t.description,onChange:d=>s({description:d.target.value}),className:w})})]})},{id:"prompts",eyebrow:"Prompts",title:"Set the prompt contract",description:"Separate the main prompt from the system instruction so this node stays easier to maintain.",render:(t,s)=>e.jsxs(e.Fragment,{children:[e.jsx(C,{label:"Prompt template",description:"This is the main instruction the node sends with the current flow input.",children:e.jsx("textarea",{rows:8,value:t.promptTemplate??t.prompt??"",onChange:d=>s({promptTemplate:d.target.value,prompt:d.target.value}),className:w})}),e.jsx(C,{label:"System prompt",description:"Use this for durable behavior and output rules that should stay consistent.",children:e.jsx("textarea",{rows:5,value:t.systemPrompt??"",onChange:d=>s({systemPrompt:d.target.value}),className:w})})]})},{id:"model",eyebrow:"Model",title:"Choose how this node reaches a model",description:"Pick a specific model connection or leave it on the Forge default once models are configured.",render:(t,s)=>{var d,j,N;return e.jsxs(e.Fragment,{children:[r.length===0?e.jsx("div",{className:"rounded-[20px] border border-amber-400/20 bg-amber-400/10 px-4 py-3 text-sm leading-6 text-amber-100",children:"No model connection is configured yet. Open Settings > Models, add one connection, then come back here."}):null,e.jsx(C,{label:"Model connection",description:"This can stay empty if you want the node to use Forge's default configured model.",children:e.jsxs("select",{value:((d=t.modelConfig)==null?void 0:d.connectionId)??"",onChange:v=>{var A,z;const S=r.find(B=>B.id===v.target.value);s({modelConfig:{connectionId:(S==null?void 0:S.id)??null,provider:(S==null?void 0:S.provider)??null,baseUrl:(S==null?void 0:S.baseUrl)??null,model:(S==null?void 0:S.model)??"",thinking:((A=t.modelConfig)==null?void 0:A.thinking)??null,verbosity:((z=t.modelConfig)==null?void 0:z.verbosity)??null}})},className:w,children:[e.jsx("option",{value:"",children:"Use Forge default model"}),r.map(v=>e.jsx("option",{value:v.id,children:v.label},v.id))]})}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(C,{label:"Thinking effort",description:"Optional reasoning setting for models that support it.",children:e.jsxs("select",{value:((j=t.modelConfig)==null?void 0:j.thinking)??"",onChange:v=>{var S,A,z,B,ne;return s({modelConfig:{connectionId:((S=t.modelConfig)==null?void 0:S.connectionId)??null,provider:((A=t.modelConfig)==null?void 0:A.provider)??null,baseUrl:((z=t.modelConfig)==null?void 0:z.baseUrl)??null,model:((B=t.modelConfig)==null?void 0:B.model)??"",thinking:v.target.value||null,verbosity:((ne=t.modelConfig)==null?void 0:ne.verbosity)??null}})},className:w,children:[e.jsx("option",{value:"",children:"Default"}),e.jsx("option",{value:"low",children:"Low"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"high",children:"High"})]})}),e.jsx(C,{label:"Verbosity",description:"Optional output detail setting for models that support it.",children:e.jsxs("select",{value:((N=t.modelConfig)==null?void 0:N.verbosity)??"",onChange:v=>{var S,A,z,B,ne;return s({modelConfig:{connectionId:((S=t.modelConfig)==null?void 0:S.connectionId)??null,provider:((A=t.modelConfig)==null?void 0:A.provider)??null,baseUrl:((z=t.modelConfig)==null?void 0:z.baseUrl)??null,model:((B=t.modelConfig)==null?void 0:B.model)??"",thinking:((ne=t.modelConfig)==null?void 0:ne.thinking)??null,verbosity:v.target.value||null}})},className:w,children:[e.jsx("option",{value:"",children:"Default"}),e.jsx("option",{value:"low",children:"Low"}),e.jsx("option",{value:"medium",children:"Medium"}),e.jsx("option",{value:"high",children:"High"})]})})]})]})}},{id:"contracts",eyebrow:"Contracts",title:"Define the input and output contract",description:"Give this AI node truthful port names, value types, and expectations so the graph stays readable.",render:(t,s)=>e.jsxs("div",{className:"grid gap-4",children:[e.jsx(we,{title:"Inputs",description:"Name the upstream values this AI node expects to receive.",ports:t.inputs??[],onChange:d=>s({inputs:d}),prefix:"input"}),e.jsx(we,{title:"Outputs",description:"Describe exactly what this AI node will publish for later nodes.",ports:t.outputs??[],onChange:d=>s({outputs:d}),prefix:"output"})]})},{id:"tools",eyebrow:"Outputs and tools",title:"Control what this node can call and publish",description:"Keep tool access tight and name any extra outputs the rest of the flow should consume.",render:(t,s)=>e.jsxs(e.Fragment,{children:[e.jsx(C,{label:"Enabled tools",description:"Only checked tools will be available to this AI node during execution.",children:e.jsx("div",{className:"grid max-h-[18rem] gap-2 overflow-y-auto pr-1",children:ee.length>0?ee.map(d=>{const j=(t.enabledToolKeys??[]).includes(d.key);return e.jsxs("label",{className:"flex items-start gap-3 rounded-[16px] bg-white/[0.03] px-3 py-2 text-left",children:[e.jsx("input",{type:"checkbox",checked:j,onChange:N=>{const v=new Set(t.enabledToolKeys??[]);N.target.checked?v.add(d.key):v.delete(d.key),s({enabledToolKeys:[...v]})}}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-white",children:[e.jsx("span",{children:d.label}),e.jsx("span",{className:"rounded-full bg-white/[0.06] px-2 py-0.5 text-[10px] uppercase tracking-[0.16em] text-white/48",children:d.accessMode.replace("_"," ")})]}),e.jsx("div",{className:"text-[12px] leading-5 text-white/46",children:d.description}),d.sources.length>0?e.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:d.sources.map(N=>e.jsx("span",{className:"rounded-full bg-white/[0.05] px-2 py-1 text-[10px] text-white/44",children:N},`${d.key}-${N}`))}):null,e.jsx("div",{className:"mt-1 font-mono text-[10px] text-white/32",children:d.key}),d.argsSchema?e.jsxs("details",{className:"mt-2 rounded-[14px] border border-white/8 bg-black/20 px-3 py-2",children:[e.jsx("summary",{className:"cursor-pointer text-[11px] text-white/56",children:"Preview tool arguments"}),e.jsx("pre",{className:"mt-2 overflow-auto whitespace-pre-wrap text-[10px] leading-5 text-white/44",children:JSON.stringify(d.argsSchema,null,2)})]}):null]})]},d.key)}):e.jsx("div",{className:"text-sm text-white/48",children:"No registered Forge tools are available yet."})})}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(C,{label:"Enabled tool preview",description:"Collapsed by default in the node card, this is the contract the AI node can call at run time.",children:e.jsxs("details",{className:"rounded-[18px] border border-white/8 bg-black/20 px-4 py-3",children:[e.jsx("summary",{className:"cursor-pointer text-sm text-white/70",children:te.length>0?`${te.length} tool contract${te.length===1?"":"s"}`:"No tool contract yet"}),e.jsx("pre",{className:"mt-3 overflow-auto whitespace-pre-wrap text-[11px] leading-5 text-white/58",children:JSON.stringify(te.map(d=>({key:d.key,label:d.label,accessMode:d.accessMode,sources:d.sources,argsSchema:d.argsSchema})),null,2)})]})}),e.jsx(C,{label:"Output preview",description:"This is the structure downstream nodes will see from this AI node.",children:e.jsxs("details",{className:"rounded-[18px] border border-white/8 bg-black/20 px-4 py-3",children:[e.jsxs("summary",{className:"cursor-pointer text-sm text-white/70",children:[(t.outputs??[]).length," published output",(t.outputs??[]).length===1?"":"s"]}),e.jsx("pre",{className:"mt-3 overflow-auto whitespace-pre-wrap text-[11px] leading-5 text-white/58",children:JSON.stringify(ls(t.outputs??[]),null,2)})]})})]}),e.jsx(C,{label:"Named outputs",description:"Add comma-separated output keys when later nodes should read more than the primary answer.",children:e.jsx("input",{value:(t.outputs??[]).filter(d=>d.key!=="answer").map(d=>d.key).join(", "),onChange:d=>s({outputs:is(["answer",...d.target.value.split(",")])}),placeholder:"summary, plan, next_steps",className:w})}),e.jsxs("div",{className:"rounded-[20px] border border-white/8 bg-white/[0.03] p-4",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-white/40",children:"Danger zone"}),e.jsx("div",{className:"mt-2 text-sm leading-6 text-white/58",children:"Remove this node from the graph if you no longer need it."}),e.jsxs(I,{type:"button",variant:"secondary",className:"mt-4",onClick:()=>{Qe(f.id),$(!1)},children:[e.jsx(Ae,{className:"size-4"}),"Delete node"]})]})]})}],[ee,r,te,f]),se=x.useCallback(async()=>{const t=ge.current,s=qe.current;if(t===G.current)return U("saved"),!0;if(be.current)return fe.current=!0,be.current;U("saving"),me(null);const d=c(s).then(()=>(G.current=t,Oe.current=t,U("saved"),!0)).catch(j=>{const N=j instanceof Mt||j instanceof Error?j.message:String(j);return me(N),U("error"),!1}).finally(()=>{be.current=null,fe.current&&ge.current!==G.current?(fe.current=!1,se()):fe.current=!1});return be.current=d,d},[c]);x.useEffect(()=>{if(!Je)return;const t=window.setTimeout(()=>{se()},2e3);return()=>window.clearTimeout(t)},[Je,se,ae]);const re=x.useCallback((t,s="overview")=>{Ne(t),ue(s),Ce(s==="contracts"?"contracts":"overview"),$(!0)},[]),sa=x.useMemo(()=>T.map(t=>({...t,data:{...t.data,onEditRequest:()=>re(t.id,"overview"),onContractEditRequest:()=>re(t.id,"contracts"),onParameterEditRequest:()=>re(t.id,"parameters")}})),[T,re]);function _(t){oe&&W(s=>s.map(d=>d.id===oe?t(d):d))}function Qe(t){W(s=>s.filter(d=>d.id!==t)),Q(s=>s.filter(d=>d.source!==t&&d.target!==t)),Ne(s=>s===t?null:s)}async function Ye(){await se()}async function Xe(t){if(!await se()){L("Forge could not save the latest flow changes before running. Fix the save error and try again.");return}const d=os(T,E);if(d){L(d);return}if(Ve&&r.length===0){L(["This flow includes an AI node, but no model is configured in Forge yet.","Open Settings > Models, add a model connection, then try again."].join(`
|
|
4
|
+
|
|
5
|
+
`));return}L(null);const j={};for(const N of k){const v=H[N.key];if(!Ga(N,v)){L(`Flow input "${N.label}" must match the ${N.kind} type.`);return}v!=null&&!(typeof v=="string"&&v.trim().length===0)&&(j[N.key]=v)}try{t==="run"?await m({userInput:Pe?Re:"",inputs:j,debug:Ee}):await o({userInput:Pe?Re:"",inputs:j,debug:Ee}),pe(!1)}catch(N){L(ns(N))}}return e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsxs(ra,{to:"/workbench",className:"inline-flex h-9 items-center gap-2 rounded-full bg-white/[0.05] px-3 text-sm text-white/68 transition hover:bg-white/[0.08] hover:text-white",children:[e.jsx(na,{className:"size-4"}),"Flows"]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx(jt,{kind:"workbench",label:"Workbench Flow",compact:!0,gradient:!1}),e.jsx("div",{className:"truncate font-display text-[1.55rem] tracking-[-0.05em] text-white",children:n})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(jt,{kind:ba(b),label:b==="chat"?"Chat flow":"Functor flow",compact:!0,gradient:!1}),e.jsx("div",{className:R("rounded-full border px-3 py-2 text-[12px]",X==="error"?"border-rose-300/20 bg-rose-300/10 text-rose-100":X==="saving"?"border-sky-300/20 bg-sky-300/10 text-sky-100":X==="dirty"?"border-amber-300/20 bg-amber-300/10 text-amber-100":"border-emerald-300/20 bg-emerald-300/10 text-emerald-100"),children:Za(X,ea)}),Z?e.jsxs("button",{type:"button",className:"rounded-full bg-white/[0.05] px-3 py-2 text-[12px] text-white/58 transition hover:bg-white/[0.08] hover:text-white",onClick:()=>Te(!0),children:["Latest ",Z.mode," · ",Z.status]}):null,e.jsxs(I,{type:"button",variant:"secondary",onClick:()=>pe(!0),children:[e.jsx(ze,{className:"size-4"}),"Run"]}),e.jsxs(I,{type:"button",variant:"primary",pending:X==="saving",pendingLabel:"Saving…",onClick:()=>void Ye(),children:[e.jsx(vt,{className:"size-4"}),"Save now"]})]})]}),e.jsxs("div",{className:"relative h-[76vh] overflow-hidden rounded-[32px] border border-white/8 bg-[linear-gradient(180deg,rgba(10,15,26,0.98),rgba(7,11,20,0.98))]",children:[ye.length>0?e.jsxs("div",{className:"pointer-events-none absolute left-4 top-4 z-20 max-w-[32rem] rounded-[24px] border border-amber-300/20 bg-[rgba(61,40,9,0.88)] p-4 shadow-[0_18px_48px_rgba(0,0,0,0.35)] backdrop-blur-xl",children:[e.jsxs("div",{className:"pointer-events-auto flex items-center gap-2 text-[11px] uppercase tracking-[0.18em] text-amber-100/76",children:[e.jsx("span",{children:"Graph checks"}),e.jsx(V,{content:"These are preflight issues Forge found in the current graph before runtime. Fixing them here should prevent brittle run failures later.",label:"Explain graph checks"})]}),e.jsx("ul",{className:"mt-3 grid gap-2 text-sm leading-6 text-amber-50",children:ye.map(t=>e.jsx("li",{className:"list-inside list-disc",children:t},t))})]}):null,e.jsx(Ea,{nodeTypes:rs,nodes:sa,edges:E,onNodesChange:t=>W(s=>Aa(t,s)),onEdgesChange:t=>Q(s=>Ka(t,s)),onConnect:t=>Q(s=>Pa({...t,id:`edge_${crypto.randomUUID().replaceAll("-","").slice(0,8)}`,style:{stroke:"rgba(188, 194, 255, 0.44)",strokeWidth:1.6}},s)),onEdgeClick:(t,s)=>{Q(d=>d.filter(j=>j.id!==s.id))},onNodeClick:(t,s)=>{Ne(s.id)},onNodeDoubleClick:(t,s)=>{re(s.id,"overview")},fitView:!0,proOptions:{hideAttribution:!0},className:"bg-transparent",children:e.jsx(Oa,{color:"rgba(255,255,255,0.055)",gap:28})}),e.jsx("div",{className:"pointer-events-none absolute right-4 bottom-4 z-20 flex flex-col gap-2",children:e.jsxs("div",{className:"pointer-events-auto flex flex-col items-end gap-2",children:[e.jsxs("button",{type:"button",className:"inline-flex h-11 items-center gap-2 rounded-full bg-[rgba(31,41,69,0.92)] px-4 text-sm font-medium text-white shadow-[0_18px_42px_rgba(0,0,0,0.35)] transition hover:bg-[rgba(42,54,88,0.96)]",onClick:()=>de(!0),children:[e.jsx(la,{className:"size-4"}),"Add node"]}),e.jsxs("button",{type:"button",className:"inline-flex h-11 items-center gap-2 rounded-full bg-[rgba(31,41,69,0.92)] px-4 text-sm font-medium text-white shadow-[0_18px_42px_rgba(0,0,0,0.35)] transition hover:bg-[rgba(42,54,88,0.96)]",onClick:()=>Se(!0),children:[e.jsx(ia,{className:"size-4"}),"Flow settings"]}),e.jsxs("button",{type:"button",className:"inline-flex h-11 items-center gap-2 rounded-full bg-[rgba(31,41,69,0.92)] px-4 text-sm font-medium text-white shadow-[0_18px_42px_rgba(0,0,0,0.35)] transition hover:bg-[rgba(42,54,88,0.96)]",onClick:()=>pe(!0),children:[e.jsx(ze,{className:"size-4"}),"Run flow"]}),Z?e.jsxs("button",{type:"button",className:"inline-flex h-11 items-center gap-2 rounded-full bg-[rgba(31,41,69,0.92)] px-4 text-sm font-medium text-white shadow-[0_18px_42px_rgba(0,0,0,0.35)] transition hover:bg-[rgba(42,54,88,0.96)]",onClick:()=>Te(!0),children:[e.jsx(oa,{className:"size-4"}),"Latest trace"]}):null]})})]}),e.jsx(le,{open:Vt,onOpenChange:de,title:"Add node",description:"Add a Forge box, AI node, or utility node to the flow.",children:e.jsxs("div",{className:"grid gap-4",children:[e.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:[{type:"user_input",label:"User input",icon:e.jsx(_t,{className:"size-4"})},{type:"value",label:"Value",icon:e.jsx(Rt,{className:"size-4"})},{type:"functor",label:"Functor",icon:e.jsx(Et,{className:"size-4"})},{type:"chat",label:"Chat",icon:e.jsx(da,{className:"size-4"})},{type:"merge",label:"Merge",icon:e.jsx(Ot,{className:"size-4"})},{type:"template",label:"Template",icon:e.jsx(Pt,{className:"size-4"})},{type:"pick_key",label:"Pick key",icon:e.jsx(Kt,{className:"size-4"})},{type:"output",label:"Output",icon:e.jsx(At,{className:"size-4"})}].map(t=>e.jsxs("button",{type:"button",className:"flex items-center gap-3 rounded-[20px] bg-white/[0.04] px-4 py-3 text-left text-white transition hover:bg-white/[0.08]",onClick:()=>{W(s=>[...s,It(t.type,s)]),de(!1)},children:[t.icon,e.jsx("span",{children:t.label})]},t.type))}),e.jsx(Ba,{title:"Forge boxes",description:"",query:Fe,onQueryChange:Qt,options:ta,selectedOptionIds:_e,onSelectedOptionIdsChange:Yt,resultSummary:`${Be.length} boxes`,placeholder:"Search visible Forge boxes by title, route, or category",emptyStateMessage:"No boxes match the current query."}),e.jsx("div",{className:"grid max-h-[18rem] gap-2 overflow-auto pr-1",children:Be.map(t=>e.jsxs("button",{type:"button",className:"rounded-[20px] bg-white/[0.04] px-4 py-3 text-left transition hover:bg-white/[0.08]",onClick:()=>{W(s=>[...s,It("box",s,t)]),de(!1)},children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsx("div",{className:"text-sm font-medium text-white",children:t.title}),e.jsxs("div",{className:"flex shrink-0 flex-wrap gap-2 text-[10px] uppercase tracking-[0.14em] text-white/42",children:[e.jsxs("span",{children:[t.output.length," output",t.output.length===1?"":"s"]}),e.jsxs("span",{children:[t.tools.length," tool",t.tools.length===1?"":"s"]})]})]}),e.jsx("div",{className:"mt-1 text-[12px] leading-5 text-white/50",children:t.description}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsx("div",{className:"rounded-full bg-white/[0.05] px-2.5 py-1 text-[11px] text-white/56",children:t.category}),t.routePath?e.jsx("div",{className:"rounded-full bg-white/[0.05] px-2.5 py-1 text-[11px] text-white/56",children:t.routePath}):null]})]},t.id))})]})}),f&&ie(f.data.nodeType)?e.jsx(fa,{open:He,onOpenChange:t=>{$(t),t||Ce(void 0)},eyebrow:`Workbench · ${f.data.nodeType==="chat"?"Chat node":"Functor node"}`,title:f.data.label??"Edit node",description:"Configure this AI node with the same paged editor Forge uses elsewhere.",value:f.data,onChange:t=>_(s=>({...s,data:t})),draftPersistenceKey:`workbench.ai-node.${f.id}`,steps:aa,initialStepId:Dt,onSubmit:async()=>{$(!1),Ce(void 0)},submitLabel:"Done",contentClassName:"md:w-[min(60rem,calc(100vw-1.5rem))]"}):e.jsx(le,{open:He,onOpenChange:t=>{$(t),t||ue("overview")},title:(f==null?void 0:f.data.label)??"Edit node",description:"Edit the selected node without covering the graph with permanent forms.",children:f?e.jsxs("div",{className:"grid gap-3",children:[e.jsx("div",{className:"flex flex-wrap gap-2 rounded-full bg-white/[0.04] p-1",children:[{id:"overview",label:"Overview"},{id:"contracts",label:"Contracts"},{id:"parameters",label:"Parameters"}].filter(t=>t.id!=="contracts"||De).filter(t=>{var s;return t.id!=="parameters"||(((s=f.data.params)==null?void 0:s.length)??0)>0}).map(t=>e.jsx("button",{type:"button",className:R("rounded-full px-3 py-2 text-sm transition",ce===t.id?"bg-[rgba(192,193,255,0.18)] text-white":"text-white/58 hover:bg-white/[0.05] hover:text-white"),onClick:()=>ue(t.id),children:t.label},t.id))}),ce==="overview"?e.jsxs("div",{className:"grid gap-3",children:[e.jsx("input",{value:f.data.label,onChange:t=>_(s=>({...s,data:{...s.data,label:t.target.value}})),className:w}),e.jsx("textarea",{rows:3,value:f.data.description,onChange:t=>_(s=>({...s,data:{...s.data,description:t.target.value}})),className:w}),f.data.nodeType==="box"||f.data.nodeType==="box_input"?e.jsxs("select",{value:f.data.boxId??"",onChange:t=>{const s=i.find(d=>d.id===t.target.value);_(d=>({...d,data:{...d.data,boxId:t.target.value,label:(s==null?void 0:s.title)??d.data.label,description:(s==null?void 0:s.description)??d.data.description,inputs:(s==null?void 0:s.inputs)??[],outputs:(s==null?void 0:s.output)??[],params:(s==null?void 0:s.params)??[],enabledToolKeys:((s==null?void 0:s.tools)??[]).map(j=>j.key)}}))},className:w,children:[e.jsx("option",{value:"",children:"Select Forge box"}),i.map(t=>e.jsx("option",{value:t.id,children:t.title},t.id))]}):null,f.data.nodeType==="template"?e.jsx("textarea",{rows:4,value:f.data.template??"",onChange:t=>_(s=>({...s,data:{...s.data,template:t.target.value}})),placeholder:"Template string",className:w}):null,f.data.nodeType==="pick_key"?e.jsx("input",{value:f.data.selectedKey??"",onChange:t=>_(s=>({...s,data:{...s.data,selectedKey:t.target.value}})),placeholder:"Key to select from object input",className:w}):null,f.data.nodeType==="output"?e.jsxs("div",{className:"grid gap-3",children:[e.jsx("select",{value:f.data.outputKey??"answer",onChange:t=>_(s=>({...s,data:{...s.data,outputKey:t.target.value}})),className:w,children:Ge.length>0?Ge.map(t=>e.jsxs("option",{value:t.key,children:[t.label," (",t.key,")"]},t.key)):e.jsx("option",{value:f.data.outputKey??"answer",children:f.data.outputKey??"answer"})}),e.jsx("div",{className:"rounded-[18px] border border-white/8 bg-white/[0.03] px-4 py-3 text-sm leading-6 text-white/58",children:"Publish one upstream output as the flow result. If the output key is missing from the graph, Forge will flag it in graph checks."})]}):null,f.data.nodeType==="value"?e.jsxs(e.Fragment,{children:[e.jsx("select",{value:f.data.valueType??"string",onChange:t=>_(s=>({...s,data:{...s.data,valueType:t.target.value}})),className:w,children:["string","number","boolean","null","array","object"].map(t=>e.jsx("option",{value:t,children:t},t))}),e.jsx("textarea",{rows:4,value:f.data.valueLiteral??"",onChange:t=>_(s=>({...s,data:{...s.data,valueLiteral:t.target.value}})),placeholder:"Value literal or JSON",className:w})]}):null]}):null,ce==="contracts"?De?e.jsxs("div",{className:"grid gap-4",children:[e.jsx(we,{title:"Inputs",description:"Name the values this node expects so upstream wiring stays obvious.",ports:f.data.inputs??[],onChange:t=>_(s=>({...s,data:{...s.data,inputs:t}})),prefix:"input"}),e.jsx(we,{title:"Outputs",description:"Describe exactly what this node publishes, including semantic model names.",ports:f.data.outputs??[],onChange:t=>_(s=>({...s,data:{...s.data,outputs:t}})),prefix:"output"})]}):e.jsx("div",{className:"rounded-[20px] border border-white/8 bg-white/[0.03] px-4 py-4 text-sm leading-6 text-white/58",children:"This node inherits its contract from the registered Forge box. Edit the box definition in the registry when the contract itself needs to change."}):null,ce==="parameters"?e.jsxs("div",{className:"grid gap-3",children:[(f.data.params??[]).length===0?e.jsx("div",{className:"rounded-[20px] border border-white/8 bg-white/[0.03] px-4 py-4 text-sm leading-6 text-white/58",children:"This node does not expose any configurable parameters."}):null,(f.data.params??[]).map(t=>{var s,d,j;return e.jsxs("div",{className:"grid gap-2",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-white/40",children:t.label}),t.kind==="boolean"?e.jsxs("label",{className:"flex items-center gap-3 rounded-[18px] border border-white/10 bg-black/20 px-4 py-3 text-sm text-white",children:[e.jsx("input",{type:"checkbox",checked:!!((s=f.data.paramValues)!=null&&s[t.key]),onChange:N=>_(v=>({...v,data:{...v.data,paramValues:{...v.data.paramValues??{},[t.key]:N.target.checked}}}))}),t.description??"Enabled"]}):t.kind==="array"||t.kind==="json"?e.jsx("textarea",{value:ve((d=f.data.paramValues)==null?void 0:d[t.key]),onChange:N=>_(v=>({...v,data:{...v.data,paramValues:{...v.data.paramValues??{},[t.key]:N.target.value}}})),placeholder:t.description??t.label,className:R(w,"min-h-[104px] resize-y")}):e.jsx("input",{type:t.kind==="number"?"number":"text",value:ve((j=f.data.paramValues)==null?void 0:j[t.key]),onChange:N=>_(v=>({...v,data:{...v.data,paramValues:{...v.data.paramValues??{},[t.key]:$t(t.kind,N.target.value)}}})),placeholder:t.description??t.label,className:w})]},t.key)})]}):null,e.jsxs("div",{className:"flex flex-wrap justify-between gap-2 pt-2",children:[e.jsxs(I,{type:"button",variant:"secondary",onClick:()=>{Qe(f.id),$(!1)},children:[e.jsx(Ae,{className:"size-4"}),"Delete node"]}),e.jsx(I,{type:"button",variant:"primary",onClick:()=>{$(!1),ue("overview")},children:"Done"})]})]}):null}),e.jsx(le,{open:Jt,onOpenChange:Se,title:"Flow settings",description:"Edit the flow identity and persistence without covering the graph with permanent forms.",children:e.jsxs("div",{className:"grid gap-3",children:[e.jsx("input",{value:n,onChange:t=>u(t.target.value),placeholder:"Flow title",className:w}),e.jsx("textarea",{rows:4,value:h,onChange:t=>y(t.target.value),placeholder:"Flow description",className:w}),e.jsxs("select",{value:b,onChange:t=>g(t.target.value),className:w,children:[e.jsx("option",{value:"functor",children:"Functor flow"}),e.jsx("option",{value:"chat",children:"Chat flow"})]}),e.jsx(as,{inputs:k,nodes:T,onChange:F}),e.jsx("div",{className:"rounded-[18px] border border-white/8 bg-white/[0.03] px-4 py-3 text-sm text-white/58",children:a.id}),e.jsxs("div",{className:"flex flex-wrap justify-between gap-2 pt-2",children:[e.jsxs(I,{type:"button",variant:"secondary",onClick:async()=>{await p()},children:[e.jsx(Ae,{className:"size-4"}),"Delete flow"]}),e.jsxs(I,{type:"button",variant:"primary",onClick:async()=>{await Ye(),Se(!1)},children:[e.jsx(vt,{className:"size-4"}),"Save settings"]})]})]})}),e.jsx(le,{open:Gt,onOpenChange:t=>{pe(t),t&&L(null)},title:"Run flow",description:"Run the flow or chat with it and keep the debug trace for every node.",children:e.jsxs("div",{className:"grid gap-3",children:[he?e.jsx("div",{className:"rounded-[20px] border border-rose-400/20 bg-rose-400/10 px-4 py-3 text-sm leading-6 text-rose-100",children:he}):null,!he&&ye.length>0?e.jsxs("div",{className:"rounded-[20px] border border-amber-400/20 bg-amber-400/10 px-4 py-3 text-sm leading-6 text-amber-100",children:[e.jsx("div",{className:"font-medium",children:"Fix these graph issues before running:"}),e.jsx("ul",{className:"mt-2 grid gap-1",children:ye.slice(0,4).map(t=>e.jsxs("li",{children:["• ",t]},t))})]}):null,!he&&Ve&&r.length===0?e.jsx("div",{className:"rounded-[20px] border border-sky-400/20 bg-sky-400/10 px-4 py-3 text-sm leading-6 text-sky-100",children:"This flow contains AI nodes, but Forge does not have a model connection yet. Open Settings > Models, add one connection, then come back and run the flow."}):null,k.length>0?e.jsxs("div",{className:"grid gap-3 rounded-[20px] border border-white/8 bg-white/[0.03] p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-white",children:["Flow inputs",e.jsx(V,{content:"These are the typed inputs this flow exposes through the API and the Run modal.",label:"Explain flow inputs"})]}),e.jsx("div",{className:"grid gap-3",children:k.map(t=>e.jsx(C,{label:t.label,description:t.description||"Typed input for this flow.",children:t.kind==="boolean"?e.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/68",children:[e.jsx("input",{type:"checkbox",checked:!!H[t.key],onChange:s=>Y(d=>({...d,[t.key]:s.target.checked}))}),t.label]}):t.kind==="number"?e.jsx("input",{type:"number",value:typeof H[t.key]=="number"?String(H[t.key]):"",onChange:s=>Y(d=>({...d,[t.key]:s.target.value.trim().length===0?void 0:Number(s.target.value)})),className:w}):t.kind==="array"||t.kind==="entity_list"||t.kind==="record_list"||t.kind==="object"||t.kind==="json"||t.kind==="record"||t.kind==="context"||t.kind==="filters"||t.kind==="metrics"||t.kind==="timeline"||t.kind==="selection"||t.kind==="entity"?e.jsx("textarea",{rows:4,value:ve(H[t.key]),onChange:s=>{const d=s.target.value;let j=d;if(!d.trim())j=void 0;else try{j=JSON.parse(d)}catch{j=d}Y(N=>({...N,[t.key]:j}))},placeholder:'{"key":"value"}',className:w}):e.jsx("input",{value:typeof H[t.key]=="string"?H[t.key]:"",onChange:s=>Y(d=>({...d,[t.key]:s.target.value})),placeholder:t.exampleValue||t.label,className:w})},t.key))})]}):null,Pe?e.jsx("textarea",{rows:5,value:Re,onChange:t=>Xt(t.target.value),placeholder:"User input",className:w}):null,e.jsxs("label",{className:"flex items-center gap-2 text-sm text-white/64",children:[e.jsx("input",{type:"checkbox",checked:Ee,onChange:t=>Zt(t.target.checked)}),"Return debug trace"]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(I,{type:"button",variant:"primary",onClick:()=>void Xe("run"),children:[e.jsx(ze,{className:"size-4"}),"Run"]}),e.jsxs(I,{type:"button",variant:"secondary",onClick:()=>void Xe("chat"),children:[e.jsx(zt,{className:"size-4"}),"Chat"]})]}),e.jsx("div",{className:"grid gap-2 pt-2",children:l.slice(0,5).map(t=>{var s;return e.jsxs("div",{className:"rounded-[18px] border border-white/8 bg-white/[0.04] px-4 py-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 text-[12px] text-white/48",children:[e.jsx("span",{children:t.mode}),e.jsx("span",{children:new Date(t.createdAt).toLocaleString()})]}),e.jsx("div",{className:"mt-2 text-sm text-white/78",children:((s=t.result)==null?void 0:s.primaryText)??t.error??"No output yet."})]},t.id)})})]})}),e.jsx(le,{open:Ie,onOpenChange:Te,title:"Run inspector",description:"Inspect whole-flow outputs and stable node-level results for any saved run.",children:q?e.jsx("div",{className:"grid gap-4",children:e.jsxs("div",{className:"grid gap-3 md:grid-cols-[0.9fr_1.1fr]",children:[e.jsxs("div",{className:"rounded-[20px] border border-white/8 bg-white/[0.04] p-4",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-white/42",children:"Run history"}),e.jsx("div",{className:"mt-3 grid gap-2",children:l.slice(0,12).map(t=>{var s;return e.jsxs("button",{type:"button",className:R("rounded-[18px] border px-4 py-3 text-left transition",D===t.id?"border-[var(--secondary)]/40 bg-[var(--secondary)]/12":"border-white/8 bg-black/20 hover:bg-white/[0.05]"),onClick:()=>Le(t.id),children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 text-[12px] text-white/50",children:[e.jsx("span",{children:t.mode}),e.jsx("span",{children:new Date(t.createdAt).toLocaleString()})]}),e.jsx("div",{className:"mt-2 text-sm text-white/80",children:((s=t.result)==null?void 0:s.primaryText)??t.error??"No output yet."})]},t.id)})})]}),e.jsxs("div",{className:"grid gap-3",children:[e.jsxs("div",{className:"rounded-[20px] border border-white/8 bg-white/[0.04] p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 text-[12px] text-white/50",children:[e.jsx("span",{children:q.mode}),e.jsx("span",{children:new Date(q.createdAt).toLocaleString()})]}),e.jsx("div",{className:"mt-3 text-sm leading-6 text-white/82",children:((at=q.result)==null?void 0:at.primaryText)??q.error??"No output yet."}),(st=q.result)!=null&&st.outputs?e.jsxs("details",{className:"mt-3 rounded-[16px] bg-black/20 p-3",children:[e.jsx("summary",{className:"cursor-pointer text-[11px] uppercase tracking-[0.16em] text-white/38",children:"Published outputs"}),e.jsx("pre",{className:"mt-3 overflow-auto whitespace-pre-wrap text-[12px] leading-5 text-white/66",children:JSON.stringify(q.result.outputs,null,2)})]}):null]}),(((rt=J.data)==null?void 0:rt.nodeResults)??[]).length>0?e.jsxs("div",{className:"grid gap-3 xl:grid-cols-[0.9fr_1.1fr]",children:[e.jsxs("div",{className:"rounded-[20px] border border-white/8 bg-white/[0.04] p-4",children:[e.jsx("div",{className:"text-[11px] uppercase tracking-[0.18em] text-white/42",children:"Node results"}),e.jsx("div",{className:"mt-3 grid gap-2",children:(((nt=J.data)==null?void 0:nt.nodeResults)??[]).map(t=>e.jsx("button",{type:"button",className:R("rounded-[18px] border px-4 py-3 text-left transition",xe===t.nodeId?"border-[var(--secondary)]/40 bg-[var(--secondary)]/12":"border-white/8 bg-black/20 hover:bg-white/[0.05]"),onClick:()=>Ue(t.nodeId),children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-white",children:t.label}),e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/40",children:t.nodeType})]}),e.jsxs("div",{className:"rounded-full bg-white/[0.05] px-3 py-1 text-[11px] text-white/56",children:[Object.keys(t.outputMap).length," outputs"]})]})},t.nodeId))})]}),e.jsx("div",{className:"rounded-[20px] border border-white/8 bg-white/[0.04] p-4",children:P||(lt=K.data)!=null&<.nodeResult?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-white",children:(ot=((it=K.data)==null?void 0:it.nodeResult)??P)==null?void 0:ot.label}),e.jsx("div",{className:"text-[11px] uppercase tracking-[0.16em] text-white/38",children:(ct=((dt=K.data)==null?void 0:dt.nodeResult)??P)==null?void 0:ct.nodeType})]}),e.jsxs("div",{className:"rounded-full bg-white/[0.05] px-3 py-1 text-[11px] text-white/56",children:[(((pt=((ut=K.data)==null?void 0:ut.nodeResult)??P)==null?void 0:pt.tools)??[]).length," ","tool",(((mt=((ht=K.data)==null?void 0:ht.nodeResult)??P)==null?void 0:mt.tools)??[]).length===1?"":"s"]})]}),e.jsxs("div",{className:"mt-3 grid gap-3",children:[e.jsxs("details",{className:"rounded-[16px] bg-black/20 p-3",children:[e.jsx("summary",{className:"cursor-pointer text-[11px] uppercase tracking-[0.16em] text-white/38",children:"Inputs"}),e.jsx("pre",{className:"mt-3 overflow-auto whitespace-pre-wrap text-[12px] leading-5 text-white/66",children:JSON.stringify(((gt=((xt=K.data)==null?void 0:xt.nodeResult)??P)==null?void 0:gt.input)??[],null,2)})]}),e.jsxs("details",{className:"rounded-[16px] bg-black/20 p-3",children:[e.jsx("summary",{className:"cursor-pointer text-[11px] uppercase tracking-[0.16em] text-white/38",children:"Output map"}),e.jsx("pre",{className:"mt-3 overflow-auto whitespace-pre-wrap text-[12px] leading-5 text-white/66",children:JSON.stringify(((ft=((bt=K.data)==null?void 0:bt.nodeResult)??P)==null?void 0:ft.outputMap)??{},null,2)})]}),e.jsxs("details",{className:"rounded-[16px] bg-black/20 p-3",children:[e.jsx("summary",{className:"cursor-pointer text-[11px] uppercase tracking-[0.16em] text-white/38",children:"Payload"}),e.jsx("pre",{className:"mt-3 overflow-auto whitespace-pre-wrap text-[12px] leading-5 text-white/66",children:JSON.stringify(((wt=((yt=K.data)==null?void 0:yt.nodeResult)??P)==null?void 0:wt.payload)??null,null,2)})]})]})]}):e.jsx("div",{className:"text-sm text-white/56",children:"Pick a node result to inspect its resolved inputs and outputs."})})]}):e.jsx("div",{className:"rounded-[20px] border border-white/8 bg-white/[0.04] p-4 text-sm text-white/56",children:J.isFetching?"Loading node results…":"This run does not have stored node results yet."})]})]})}):e.jsx("div",{className:"text-sm text-white/56",children:"Run the flow once to inspect its published outputs and node-level results here."})})]})}function vs(){const a=ua(),i=pa(),r=a.flowId??"",l=ja(),c=ka(r,{skip:r.length===0}),p=Na(),[m]=Ca(),[o]=Sa(),[n]=Ia(),[u]=Ta();return c.isLoading||p.isLoading?e.jsx(Fa,{eyebrow:"Workbench Flow",title:"Loading flow",description:"Preparing the Workbench graph editor."}):c.isError||p.isError||!c.data?!c.data&&!c.isError&&!p.isError?e.jsx(_a,{eyebrow:"Workbench Flow",title:"Flow unavailable",description:"Forge could not find that flow."}):e.jsx(Ra,{eyebrow:"Workbench Flow",error:c.error??p.error??null}):e.jsxs("div",{className:"grid gap-5",children:[e.jsx(ma,{entityKind:c.data.flow.kind,title:c.data.flow.title,titleText:c.data.flow.title,description:c.data.flow.description||"Inspect, run, and publish this Workbench flow.",badge:c.data.flow.kind,actions:e.jsx(ha,{entityType:"workbench_flow",entityId:c.data.flow.id})}),e.jsx(ds,{flow:c.data.flow,boxes:l,modelConnections:(p.data.settings.modelSettings.connections??[]).map(h=>({id:h.id,label:h.label,provider:h.provider,model:h.model,baseUrl:h.baseUrl})),runs:c.data.runs,onSave:async h=>{await m({flowId:r,patch:h}).unwrap()},onDelete:async()=>{await o(r).unwrap(),i("/workbench")},onRun:async h=>{await n({flowId:r,input:h}).unwrap()},onChat:async h=>{await u({flowId:r,input:h}).unwrap()}})]})}export{vs as WorkbenchFlowPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b5 as j,c2 as v,r as o,j as t}from"./vendor-DHkYh85p.js";import{j as S,i as N,k as F}from"./state-B-4sS1xO.js";import{F as C}from"./faceted-token-search-CE1YauRd.js";import{P as I}from"./page-hero-CQWo1Mm_.js";import{fo as Q,B as p,b as W,fp as q,fq as K}from"./index-BHTUu_4M.js";import"./board-BkDRaMp6.js";import"./ui-C13Nbgas.js";import"./motion-BeD44FeG.js";import"./forms-BFlTgZ3W.js";import"./graph-D6JLqDbD.js";function R(){var u;const l=j(),m=S(),[f]=v(),g=f.get("surface"),[i,b]=o.useState(""),[c,w]=o.useState([]),x=N({queryKey:["forge-workbench-flows"],queryFn:K}),d=F({mutationFn:e=>Q({title:e==="chat"?"New chat flow":"New flow",description:e==="chat"?"Conversational workbench flow.":"Reusable workbench transformation flow.",kind:e,homeSurfaceId:g}),onSuccess:({flow:e})=>{m.invalidateQueries({queryKey:["forge-workbench-flows"]}),l(`/workbench/${e.id}`)}}),a=((u=x.data)==null?void 0:u.flows)??[],y=o.useMemo(()=>{const e=[{id:"kind:functor",label:"Functor",description:"Single transformation flows"},{id:"kind:chat",label:"Chat",description:"Conversational flows with user input"}],r=Array.from(new Set(a.map(s=>s.homeSurfaceId).filter(s=>!!s))).map(s=>({id:`surface:${s}`,label:s,description:"Home surface"}));return[...e,...r]},[a]),h=o.useMemo(()=>{const e=i.trim().toLowerCase();return a.filter(r=>{const s=e.length===0||[r.title,r.description,r.kind,r.homeSurfaceId??"",...r.graph.nodes.map(n=>n.data.label)].join(" ").toLowerCase().includes(e),k=c.every(n=>n.startsWith("kind:")?r.kind===n.replace("kind:",""):n.startsWith("surface:")?r.homeSurfaceId===n.replace("surface:",""):!0);return s&&k})},[a,i,c]);return t.jsxs("div",{className:"grid gap-5",children:[t.jsx(I,{entityKind:"workbench",title:"Workbench",titleText:"Workbench",description:"Search and launch reusable Forge flows, then open a flow to edit its graph, tools, prompts, and outputs.",badge:`${a.length} flows`}),t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsx(p,{type:"button",variant:"primary",onClick:()=>void d.mutateAsync("functor"),children:"New flow"}),t.jsx(p,{type:"button",variant:"secondary",onClick:()=>void d.mutateAsync("chat"),children:"New chat flow"})]}),t.jsx(C,{title:"Flow search",description:"Filter by flow kind or surface, then open a flow to edit or run it.",query:i,onQueryChange:b,options:y,selectedOptionIds:c,onSelectedOptionIdsChange:w,resultSummary:`${h.length} of ${a.length} flows`,placeholder:"Search flow title, description, nodes, or home surface"}),t.jsx("div",{className:"grid gap-3 lg:grid-cols-2",children:h.map(e=>t.jsxs("button",{type:"button",className:"rounded-[26px] border border-white/8 bg-[linear-gradient(180deg,rgba(20,28,46,0.92),rgba(10,16,29,0.96))] p-5 text-left transition hover:border-white/12 hover:bg-[linear-gradient(180deg,rgba(24,34,55,0.94),rgba(12,18,34,0.98))]",onClick:()=>l(`/workbench/${e.id}`),children:[t.jsxs("div",{className:"flex items-start justify-between gap-4",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("div",{className:"truncate text-lg font-semibold text-white",children:e.title}),t.jsx("div",{className:"mt-1 line-clamp-2 text-sm leading-6 text-white/54",children:e.description||"No description yet."})]}),t.jsx(W,{kind:q(e.kind),label:e.kind==="chat"?"Chat flow":"Functor flow",compact:!0,gradient:!1})]}),t.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-[12px] text-white/44",children:[t.jsxs("span",{children:[e.graph.nodes.length," nodes"]}),t.jsxs("span",{children:[e.graph.edges.length," edges"]}),e.homeSurfaceId?t.jsx("span",{children:e.homeSurfaceId}):null]})]},e.id))})]})}export{R as WorkbenchPage};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/maps-ClgJoCjz.js","assets/vendor-DHkYh85p.js","assets/vendor-CRS-psbw.css","assets/maps-B-YMMjus.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{eH as $,S as H,E as B,c as j,C as c,T as D,I as E,B as F,eM as P,eN as I}from"./index-BHTUu_4M.js";import{cc as K,r as p,j as e,aC as W,bk as Q,bK as O,bU as q,dw as Z,bX as U}from"./vendor-DHkYh85p.js";import{j as X,i as Y,k as G}from"./state-B-4sS1xO.js";import"./maps-ClgJoCjz.js";import{P as V}from"./page-hero-CQWo1Mm_.js";import{R as M,A as J,C as ee,X as C,Y as T,T as _,a as te,f as se,B as ae}from"./charts-P7EVhIog.js";import"./board-BkDRaMp6.js";import"./ui-C13Nbgas.js";import"./motion-BeD44FeG.js";import"./forms-BFlTgZ3W.js";import"./graph-D6JLqDbD.js";const A={below_z1:"#94a3b8",zone_1:"#38bdf8",zone_2:"#22c55e",zone_3:"#eab308",zone_4:"#f97316",zone_5:"#ef4444"};function v(t){return t?`${Math.round(t/60)}m`:"0m"}function z(t,a){const l=new Intl.DateTimeFormat(void 0,{weekday:"short",day:"numeric",month:"short"}),n=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"});return`${l.format(new Date(t))} · ${n.format(new Date(t))} - ${n.format(new Date(a))}`}function ie(t,a){if(typeof t=="number"){const l=Number.isInteger(t)?String(t):t.toFixed(1);return a&&a!=="count"?`${l} ${a}`:l}return typeof t=="boolean"?t?"Yes":"No":t==null?"n/a":String(t)}function re(t){return t.length===0?null:{minLat:Math.min(...t.map(a=>a.latitude)),maxLat:Math.max(...t.map(a=>a.latitude)),minLon:Math.min(...t.map(a=>a.longitude)),maxLon:Math.max(...t.map(a=>a.longitude))}}function ne({points:t}){var w;const a=p.useRef(null),[l,n]=p.useState(!1),x=typeof window<"u"?((w=window.localStorage.getItem("forge.map.tile-url"))==null?void 0:w.trim())??"":"";p.useEffect(()=>{let h=!1,i=null;if(!x||!a.current||t.length<2){n(!1);return}return P(()=>import("./maps-ClgJoCjz.js").then(r=>r.m),__vite__mapDeps([0,1,2,3])).then(r=>{h||!a.current||(i=new r.Map({container:a.current,style:{version:8,sources:{tiles:{type:"raster",tiles:[x],tileSize:256}},layers:[{id:"tiles",type:"raster",source:"tiles"}]},center:[t[0].longitude,t[0].latitude],zoom:13,attributionControl:!1}),i.on("load",()=>{if(!i)return;const d=t.map(m=>[m.longitude,m.latitude]);i.addSource("route",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"LineString",coordinates:d}}}),i.addLayer({id:"route",type:"line",source:"route",paint:{"line-color":"#f97316","line-width":4}});const u=d.reduce((m,g)=>m.extend(g),new r.LngLatBounds(d[0],d[0]));i.fitBounds(u,{padding:44,maxZoom:15}),n(!0)}))}),()=>{h=!0,i==null||i.remove()}},[t,x]);const o=re(t),f=p.useMemo(()=>{if(!o||t.length<2)return"";const h=720,i=280,r=Math.max(1e-6,o.maxLon-o.minLon),d=Math.max(1e-6,o.maxLat-o.minLat);return t.map(u=>{const m=(u.longitude-o.minLon)/r*h,g=i-(u.latitude-o.minLat)/d*i;return`${m.toFixed(1)},${g.toFixed(1)}`}).join(" ")},[o,t]);return e.jsxs("div",{className:"relative min-h-[280px] overflow-hidden rounded-[8px] border border-white/10 bg-white/[0.035]",children:[e.jsx("div",{ref:a,className:"absolute inset-0"}),l?null:e.jsxs("svg",{viewBox:"0 0 720 280",className:"absolute inset-0 h-full w-full",children:[e.jsx("rect",{width:"720",height:"280",fill:"rgba(255,255,255,0.025)"}),f?e.jsx("polyline",{points:f,fill:"none",stroke:"#f97316",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"}):null]}),e.jsx("div",{className:"absolute left-3 top-3 rounded-[8px] border border-white/10 bg-black/50 px-3 py-2 text-xs text-white/70 backdrop-blur",children:x?"Local-first map tiles configured":"No tile source configured; showing private route shape only"})]})}function le({zones:t}){return e.jsx("div",{className:"grid gap-3",children:t.map(a=>e.jsxs("div",{className:"grid gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm",children:[e.jsx("span",{className:"text-white/72",children:a.label}),e.jsxs("span",{className:"text-white",children:[(a.percentage*100).toFixed(1),"% · ",v(a.seconds)]})]}),e.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-white/[0.08]",children:e.jsx("div",{className:"h-full rounded-full",style:{width:`${Math.max(1,a.percentage*100)}%`,background:A[a.key]??"#f8fafc"}})})]},a.key))})}function je(){var g,N,y,b,k,S,L,R;const{workoutId:t=""}=K(),a=X(),l=Y({queryKey:["workout-detail",t],queryFn:()=>I(t),enabled:t.length>0}),n=l.data,[x,o]=p.useState(""),[f,w]=p.useState("");p.useEffect(()=>{n!=null&&n.workout&&(o(n.workout.meaningText??""),w(n.workout.tags.join(", ")))},[n==null?void 0:n.workout]);const h=G({mutationFn:()=>$(t,{meaningText:x,tags:f.split(",").map(s=>s.trim()).filter(Boolean)}),onSuccess:async()=>{await a.invalidateQueries({queryKey:["workout-detail",t]}),await a.invalidateQueries({queryKey:["forge-fitness"]})}});if(l.isLoading)return e.jsx(H,{title:"Loading workout"});if(l.isError||!n)return e.jsx(B,{eyebrow:"Workout detail",error:l.error??new Error("Forge could not load this workout detail."),onRetry:()=>void l.refetch()});const{workout:i,analytics:r,evidence:d}=n,u=d.timeSeries.filter(s=>s.metricKey==="heart_rate").map(s=>({time:new Date(s.startedAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),bpm:s.value})),m=r.zoneDurations.map(s=>({zone:s.label,minutes:Math.round(s.seconds/60),fill:A[s.key]??"#f8fafc"}));return e.jsxs("div",{className:"grid gap-6",children:[e.jsxs(W,{to:"/sports",className:"inline-flex w-fit items-center gap-2 text-sm text-white/62 transition hover:text-white",children:[e.jsx(Q,{className:"size-4"}),"Back to sports"]}),e.jsx(V,{eyebrow:"Workout evidence",title:i.workoutTypeLabel??i.workoutType,description:`${z(i.startedAt,i.endedAt)} · ${i.sourceDevice||"Apple Health"}`,actions:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(j,{children:v(i.durationSeconds)}),e.jsxs(j,{tone:"meta",children:[r.confidence," HR zones"]}),(g=r.routeSummary)!=null&&g.hasRoute?e.jsxs(j,{tone:"meta",children:[r.routeSummary.pointCount," route points"]}):null]})}),e.jsxs("section",{className:"grid gap-4 lg:grid-cols-4",children:[e.jsxs(c,{children:[e.jsx("div",{className:"text-sm text-white/58",children:"Avg HR"}),e.jsx("div",{className:"mt-3 font-display text-4xl text-white",children:r.hrSummary.averageHr??i.averageHeartRate??"n/a"}),e.jsx("div",{className:"mt-1 text-sm text-white/48",children:"bpm"})]}),e.jsxs(c,{children:[e.jsx("div",{className:"text-sm text-white/58",children:"Max HR"}),e.jsx("div",{className:"mt-3 font-display text-4xl text-white",children:r.hrSummary.maxHr??i.maxHeartRate??"n/a"}),e.jsx("div",{className:"mt-1 text-sm text-white/48",children:"bpm"})]}),e.jsxs(c,{children:[e.jsx("div",{className:"text-sm text-white/58",children:"Training load"}),e.jsx("div",{className:"mt-3 font-display text-4xl text-white",children:r.load.trimp??"n/a"}),e.jsx("div",{className:"mt-1 text-sm text-white/48",children:"Forge TRIMP"})]}),e.jsxs(c,{children:[e.jsx("div",{className:"text-sm text-white/58",children:"HR coverage"}),e.jsxs("div",{className:"mt-3 font-display text-4xl text-white",children:[Math.round((r.dataQuality.sampleCoverage??0)*100),"%"]}),e.jsxs("div",{className:"mt-1 text-sm text-white/48",children:[r.dataQuality.heartRateSampleCount??0," samples"]})]})]}),e.jsxs("section",{className:"grid min-w-0 gap-4 xl:grid-cols-[minmax(0,1.25fr)_minmax(280px,0.75fr)]",children:[e.jsxs(c,{className:"min-h-[360px] min-w-0 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 text-white",children:[e.jsx(O,{className:"size-4 text-[var(--primary)]"}),"Heart-rate timeline"]}),e.jsx("div",{className:"mt-4 h-[300px]",children:u.length>0?e.jsx(M,{width:"100%",height:"100%",children:e.jsxs(J,{data:u,children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"hrFill",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:"#ef4444",stopOpacity:.38}),e.jsx("stop",{offset:"100%",stopColor:"#ef4444",stopOpacity:.04})]})}),e.jsx(ee,{stroke:"rgba(255,255,255,0.08)",vertical:!1}),e.jsx(C,{dataKey:"time",interval:"preserveStartEnd",tick:{fill:"rgba(255,255,255,0.55)",fontSize:11}}),e.jsx(T,{tick:{fill:"rgba(255,255,255,0.55)",fontSize:11},width:42}),e.jsx(_,{contentStyle:{background:"rgba(8,12,22,0.94)",border:"1px solid rgba(255,255,255,0.12)",borderRadius:8,color:"white"}}),e.jsx(te,{type:"monotone",dataKey:"bpm",stroke:"#ef4444",fill:"url(#hrFill)",strokeWidth:2,dot:!1})]})}):e.jsx("div",{className:"grid h-full place-items-center rounded-[8px] bg-white/[0.035] text-sm text-white/54",children:"No raw HR timeline has been synced for this workout yet."})})]}),e.jsxs(c,{className:"min-w-0 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 text-white",children:[e.jsx(q,{className:"size-4 text-[var(--primary)]"}),"Zone mix"]}),e.jsx("div",{className:"mt-4",children:e.jsx(le,{zones:r.zoneDurations})}),e.jsx("div",{className:"mt-5 h-[180px]",children:e.jsx(M,{width:"100%",height:"100%",children:e.jsxs(se,{data:m,children:[e.jsx(C,{dataKey:"zone",tick:{fill:"rgba(255,255,255,0.55)",fontSize:10}}),e.jsx(T,{tick:{fill:"rgba(255,255,255,0.55)",fontSize:10},width:34}),e.jsx(_,{contentStyle:{background:"rgba(8,12,22,0.94)",border:"1px solid rgba(255,255,255,0.12)",borderRadius:8,color:"white"}}),e.jsx(ae,{dataKey:"minutes",radius:[4,4,0,0]})]})})})]})]}),e.jsxs("section",{className:"grid min-w-0 gap-4 xl:grid-cols-[minmax(0,1fr)_360px]",children:[e.jsxs(c,{className:"min-w-0 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 text-white",children:[e.jsx(Z,{className:"size-4 text-[var(--primary)]"}),"Route"]}),e.jsx("div",{className:"mt-4",children:d.routePoints.length>1?e.jsx(ne,{points:d.routePoints}):e.jsx("div",{className:"grid min-h-[240px] place-items-center rounded-[8px] bg-white/[0.035] text-sm text-white/54",children:"No route evidence is available for this workout."})})]}),e.jsxs(c,{className:"min-w-0 overflow-hidden",children:[e.jsx("div",{className:"text-white",children:"Captured metrics"}),e.jsx("div",{className:"mt-4 grid gap-3",children:(((N=i.details)==null?void 0:N.metrics)??[]).slice(0,14).map(s=>e.jsxs("div",{className:"rounded-[8px] bg-white/[0.04] px-3 py-2",children:[e.jsx("div",{className:"text-sm text-white/58",children:s.label}),e.jsx("div",{className:"mt-1 text-white",children:ie(s.value,s.unit)})]},`${s.category}:${s.key}:${s.statistic}`))})]})]}),e.jsxs("section",{className:"grid min-w-0 gap-4 lg:grid-cols-[minmax(0,1fr)_minmax(280px,0.7fr)]",children:[e.jsxs(c,{className:"min-w-0 overflow-hidden",children:[e.jsx("div",{className:"text-white",children:"Events and phases"}),e.jsxs("div",{className:"mt-4 grid gap-3",children:[[...((y=i.details)==null?void 0:y.events)??[],...((b=i.details)==null?void 0:b.components)??[]].slice(0,18).map(s=>e.jsxs("div",{className:"rounded-[8px] bg-white/[0.04] px-4 py-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"text-white",children:"label"in s?s.label:s.activity.canonicalLabel}),e.jsx(j,{tone:"meta",children:v(s.durationSeconds)})]}),e.jsx("div",{className:"mt-1 text-sm text-white/52",children:z(s.startedAt,s.endedAt??s.startedAt)})]},`${"type"in s?s.type:s.externalUid}:${s.startedAt}`)),(((S=(k=i.details)==null?void 0:k.events)==null?void 0:S.length)??0)+(((R=(L=i.details)==null?void 0:L.components)==null?void 0:R.length)??0)===0?e.jsx("div",{className:"rounded-[8px] bg-white/[0.035] p-4 text-sm text-white/52",children:"No provider events or phases were captured."}):null]})]}),e.jsxs(c,{className:"min-w-0 overflow-hidden",children:[e.jsx("div",{className:"text-white",children:"Reflection"}),e.jsxs("div",{className:"mt-4 grid gap-4",children:[e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-white/58",children:"Meaning and impact"}),e.jsx(D,{className:"min-h-[160px]",value:x,onChange:s=>o(s.target.value)})]}),e.jsxs("label",{className:"grid gap-2",children:[e.jsx("span",{className:"text-sm text-white/58",children:"Tags"}),e.jsx(E,{value:f,onChange:s=>w(s.target.value)})]}),e.jsxs(F,{type:"button",pending:h.isPending,pendingLabel:"Saving",onClick:()=>h.mutate(),children:[e.jsx(U,{className:"size-4"}),"Save reflection"]})]})]})]})]})}export{je as WorkoutDetailPage};
|
package/dist/index.html
CHANGED
|
@@ -13,16 +13,155 @@
|
|
|
13
13
|
/>
|
|
14
14
|
<link rel="icon" type="image/png" href="/forge/assets/favicon-BCHm9dUV.ico" />
|
|
15
15
|
<link rel="alternate icon" href="/forge/assets/favicon-BCHm9dUV.ico" />
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
<style>
|
|
17
|
+
:root {
|
|
18
|
+
color-scheme: dark;
|
|
19
|
+
background: #0b1326;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
body {
|
|
23
|
+
margin: 0;
|
|
24
|
+
min-height: 100vh;
|
|
25
|
+
background:
|
|
26
|
+
radial-gradient(
|
|
27
|
+
circle at top left,
|
|
28
|
+
rgba(192, 193, 255, 0.18),
|
|
29
|
+
transparent 28%
|
|
30
|
+
),
|
|
31
|
+
radial-gradient(
|
|
32
|
+
circle at 82% 16%,
|
|
33
|
+
rgba(78, 222, 163, 0.12),
|
|
34
|
+
transparent 24%
|
|
35
|
+
),
|
|
36
|
+
linear-gradient(180deg, #111a31 0%, #0b1326 52%, #09101f 100%);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
#root {
|
|
40
|
+
min-height: 100vh;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.forge-boot-shell {
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
display: grid;
|
|
46
|
+
min-height: 100vh;
|
|
47
|
+
place-items: center;
|
|
48
|
+
padding: 2rem;
|
|
49
|
+
color: rgba(238, 242, 255, 0.92);
|
|
50
|
+
font-family:
|
|
51
|
+
"Plus Jakarta Sans Variable", "Plus Jakarta Sans", Inter, system-ui,
|
|
52
|
+
sans-serif;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.forge-boot-panel {
|
|
56
|
+
width: min(100%, 31rem);
|
|
57
|
+
border: 1px solid rgba(255, 255, 255, 0.12);
|
|
58
|
+
border-radius: 1.25rem;
|
|
59
|
+
background: rgba(13, 20, 35, 0.82);
|
|
60
|
+
box-shadow: 0 32px 90px rgba(3, 8, 18, 0.38);
|
|
61
|
+
padding: 1.5rem;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.forge-boot-kicker {
|
|
65
|
+
margin: 0 0 0.75rem;
|
|
66
|
+
color: rgba(192, 193, 255, 0.82);
|
|
67
|
+
font-size: 0.72rem;
|
|
68
|
+
font-weight: 700;
|
|
69
|
+
letter-spacing: 0.08em;
|
|
70
|
+
text-transform: uppercase;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.forge-boot-title {
|
|
74
|
+
margin: 0;
|
|
75
|
+
font-size: clamp(1.65rem, 6vw, 2.25rem);
|
|
76
|
+
font-weight: 780;
|
|
77
|
+
letter-spacing: 0;
|
|
78
|
+
line-height: 1.05;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.forge-boot-copy {
|
|
82
|
+
margin: 0.75rem 0 0;
|
|
83
|
+
color: rgba(238, 242, 255, 0.68);
|
|
84
|
+
font-size: 0.92rem;
|
|
85
|
+
line-height: 1.55;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.forge-boot-bar {
|
|
89
|
+
position: relative;
|
|
90
|
+
height: 0.45rem;
|
|
91
|
+
margin-top: 1.25rem;
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
border-radius: 999px;
|
|
94
|
+
background: rgba(255, 255, 255, 0.08);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.forge-boot-bar::after {
|
|
98
|
+
position: absolute;
|
|
99
|
+
inset: 0;
|
|
100
|
+
width: 42%;
|
|
101
|
+
border-radius: inherit;
|
|
102
|
+
background: linear-gradient(90deg, #c0c1ff, #4edea3);
|
|
103
|
+
content: "";
|
|
104
|
+
animation: forge-boot-scan 1.35s ease-in-out infinite;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.forge-boot-note {
|
|
108
|
+
margin: 1rem 0 0;
|
|
109
|
+
color: rgba(238, 242, 255, 0.48);
|
|
110
|
+
font-size: 0.75rem;
|
|
111
|
+
line-height: 1.45;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@keyframes forge-boot-scan {
|
|
115
|
+
0% {
|
|
116
|
+
transform: translateX(-110%);
|
|
117
|
+
}
|
|
118
|
+
100% {
|
|
119
|
+
transform: translateX(250%);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
@media (prefers-reduced-motion: reduce) {
|
|
124
|
+
.forge-boot-bar::after {
|
|
125
|
+
animation: none;
|
|
126
|
+
transform: none;
|
|
127
|
+
width: 100%;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
</style>
|
|
131
|
+
<script type="module" crossorigin src="/forge/assets/index-BHTUu_4M.js"></script>
|
|
132
|
+
<link rel="modulepreload" crossorigin href="/forge/assets/vendor-DHkYh85p.js">
|
|
133
|
+
<link rel="modulepreload" crossorigin href="/forge/assets/state-B-4sS1xO.js">
|
|
134
|
+
<link rel="modulepreload" crossorigin href="/forge/assets/board-BkDRaMp6.js">
|
|
135
|
+
<link rel="modulepreload" crossorigin href="/forge/assets/ui-C13Nbgas.js">
|
|
136
|
+
<link rel="modulepreload" crossorigin href="/forge/assets/motion-BeD44FeG.js">
|
|
137
|
+
<link rel="modulepreload" crossorigin href="/forge/assets/forms-BFlTgZ3W.js">
|
|
138
|
+
<link rel="modulepreload" crossorigin href="/forge/assets/graph-D6JLqDbD.js">
|
|
139
|
+
<link rel="stylesheet" crossorigin href="/forge/assets/vendor-CRS-psbw.css">
|
|
140
|
+
<link rel="stylesheet" crossorigin href="/forge/assets/graph-BZV40eAE.css">
|
|
141
|
+
<link rel="stylesheet" crossorigin href="/forge/assets/index-CZbuZQjw.css">
|
|
24
142
|
</head>
|
|
25
143
|
<body class="bg-canvas text-ink antialiased">
|
|
26
|
-
<div id="root"
|
|
144
|
+
<div id="root">
|
|
145
|
+
<main class="forge-boot-shell" aria-live="polite" aria-busy="true">
|
|
146
|
+
<section
|
|
147
|
+
class="forge-boot-panel"
|
|
148
|
+
role="status"
|
|
149
|
+
aria-label="Forge is loading"
|
|
150
|
+
>
|
|
151
|
+
<p class="forge-boot-kicker">Forge runtime</p>
|
|
152
|
+
<h1 class="forge-boot-title">Forge is starting</h1>
|
|
153
|
+
<p class="forge-boot-copy">
|
|
154
|
+
The app shell is loading from the local development server. If this
|
|
155
|
+
message stays visible after a hard refresh, the browser did not
|
|
156
|
+
finish loading the Forge JavaScript bundle.
|
|
157
|
+
</p>
|
|
158
|
+
<div class="forge-boot-bar" aria-hidden="true"></div>
|
|
159
|
+
<p class="forge-boot-note">
|
|
160
|
+
This screen is built into the HTML entrypoint so the Tailscale page
|
|
161
|
+
never starts as an empty white document.
|
|
162
|
+
</p>
|
|
163
|
+
</section>
|
|
164
|
+
</main>
|
|
165
|
+
</div>
|
|
27
166
|
</body>
|
|
28
167
|
</html>
|