titan-agent 6.3.0 → 6.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utils/constants.js +1 -1
- package/dist/utils/constants.js.map +1 -1
- package/package.json +1 -1
- package/ui/dist/assets/{AuditPanel-BmFAKA7p.js → AuditPanel-6hTX-30T.js} +1 -1
- package/ui/dist/assets/{AutonomyPanel-BzuCEsiG.js → AutonomyPanel-bEolzW0c.js} +1 -1
- package/ui/dist/assets/{AutopilotPanel-DA1vFEl4.js → AutopilotPanel-BBhP6EEw.js} +1 -1
- package/ui/dist/assets/{AutoresearchPanel-BeUCXYtX.js → AutoresearchPanel-CmSoFu9c.js} +1 -1
- package/ui/dist/assets/{BackupPanel-B6N1pfMT.js → BackupPanel-BMqXOM64.js} +1 -1
- package/ui/dist/assets/{BrowserPanel-BGHaPi3O.js → BrowserPanel-DqpJBtZO.js} +1 -1
- package/ui/dist/assets/{CPActivity-BUSwjFj2.js → CPActivity-kjPVmtna.js} +1 -1
- package/ui/dist/assets/{CPAgentDetail-DlUEVujH.js → CPAgentDetail-DJVqWbIz.js} +1 -1
- package/ui/dist/assets/{CPAgents-CnRmsSMo.js → CPAgents-DvoKU7K3.js} +1 -1
- package/ui/dist/assets/{CPApprovals-CXdkzebd.js → CPApprovals-CgkIcjKy.js} +1 -1
- package/ui/dist/assets/{CPCosts-CfcyIUZg.js → CPCosts-Dh2-rKBQ.js} +1 -1
- package/ui/dist/assets/{CPDashboard-DHlfE1mT.js → CPDashboard-Bk5ehnOo.js} +1 -1
- package/ui/dist/assets/{CPFiles-DyV9vsjE.js → CPFiles-85DnmiZ9.js} +1 -1
- package/ui/dist/assets/{CPGoals-C17G2F0e.js → CPGoals-CmaEWa0s.js} +1 -1
- package/ui/dist/assets/{CPInbox-D5A3ja_Q.js → CPInbox-DyrwUxsn.js} +1 -1
- package/ui/dist/assets/{CPIssueDetail-CoPv27Ll.js → CPIssueDetail-tuKkMZU0.js} +1 -1
- package/ui/dist/assets/{CPIssues-C9EdfW1J.js → CPIssues-CRkGwoU7.js} +1 -1
- package/ui/dist/assets/CPLayout-BUN7FasU.js +2 -0
- package/ui/dist/assets/{CPOrg-DzoVDLKI.js → CPOrg-BiYIRMSl.js} +1 -1
- package/ui/dist/assets/{CPRuns-BHAyFv0K.js → CPRuns-_2GvItJv.js} +1 -1
- package/ui/dist/assets/{CPSocial-CjHD8dKM.js → CPSocial-BBdyKNyq.js} +1 -1
- package/ui/dist/assets/{CPVoice-aybMotU5.js → CPVoice-BnYo-G04.js} +1 -1
- package/ui/dist/assets/{ChannelsPanel-8KfvAEYM.js → ChannelsPanel-e1nT5QcW.js} +1 -1
- package/ui/dist/assets/{CheckpointsPanel-BCyLRLcg.js → CheckpointsPanel-BixKyU53.js} +1 -1
- package/ui/dist/assets/{CommandPostHub-Ce-mWsu2.js → CommandPostHub-Ckh7LlWG.js} +3 -3
- package/ui/dist/assets/{CronPanel-A9JHvU_O.js → CronPanel-BMneWRHA.js} +1 -1
- package/ui/dist/assets/{DataTable-ol6IZMRj.js → DataTable-CEjOtKUe.js} +1 -1
- package/ui/dist/assets/{DreamPanel-ZiOF8ybh.js → DreamPanel-BJO5hRUh.js} +1 -1
- package/ui/dist/assets/{EmptyState-B1i1ZK0x.js → EmptyState-CB9me2NW.js} +1 -1
- package/ui/dist/assets/{EvalHarnessPanel-DRGc1zbp.js → EvalHarnessPanel-Dg_ghVTz.js} +1 -1
- package/ui/dist/assets/{EvalPanel-B_fiFImG.js → EvalPanel-j3fHE-k4.js} +1 -1
- package/ui/dist/assets/{FileViewer-D14G6MQq.js → FileViewer-C7fgbngf.js} +1 -1
- package/ui/dist/assets/{FilesPanel-BIsMoSfg.js → FilesPanel-Cimj2Z8k.js} +1 -1
- package/ui/dist/assets/{FleetPanel-CSjOOsbX.js → FleetPanel-zzprw7Ro.js} +1 -1
- package/ui/dist/assets/{HomelabPanel-XHMxqiHu.js → HomelabPanel-C658fL2z.js} +1 -1
- package/ui/dist/assets/InfraView-DAwJClAs.js +2 -0
- package/ui/dist/assets/{InlineEditableField-AOS-LBh_.js → InlineEditableField-ChiCaepw.js} +1 -1
- package/ui/dist/assets/{Input-CTK9oH9g.js → Input-DoWIY9i3.js} +1 -1
- package/ui/dist/assets/{IntegrationsPanel-BKuC_5El.js → IntegrationsPanel-Xy3HlXti.js} +1 -1
- package/ui/dist/assets/IntelligenceView-CJ2r76hu.js +2 -0
- package/ui/dist/assets/{LearningPanel-RpDaPvCj.js → LearningPanel-Ka17sHxK.js} +1 -1
- package/ui/dist/assets/{LogsPanel-9zIJP1Xv.js → LogsPanel-BiELvlMC.js} +1 -1
- package/ui/dist/assets/{McpPanel-CNE7MhDu.js → McpPanel-BW2r8V3m.js} +1 -1
- package/ui/dist/assets/{MemoryGraphPanel-9DEsbOZF.js → MemoryGraphPanel-DZTQIsys.js} +1 -1
- package/ui/dist/assets/{MemoryWikiPanel-CqNen9A6.js → MemoryWikiPanel-BSbG8c80.js} +1 -1
- package/ui/dist/assets/{MeshPanel-Bq3pHHIT.js → MeshPanel-Ch_uGo4a.js} +1 -1
- package/ui/dist/assets/MissionCanvas-BMv0c-RX.js +72 -0
- package/ui/dist/assets/{MissionChat-BDqlCplQ.js → MissionChat-CFwKDVc8.js} +1 -1
- package/ui/dist/assets/{MissionLibrary-9SMdJnfa.js → MissionLibrary-D2LfLlm2.js} +1 -1
- package/ui/dist/assets/{MissionStart-Cm7C3kyo.js → MissionStart-CTyqZWBT.js} +1 -1
- package/ui/dist/assets/{Modal-B9KCAwCK.js → Modal-BS3rireW.js} +1 -1
- package/ui/dist/assets/{NvidiaPanel-CpGBj1sn.js → NvidiaPanel-53CiSPrh.js} +1 -1
- package/ui/dist/assets/{OrganismPanel-DBHyylxC.js → OrganismPanel-BRbiiY5k.js} +1 -1
- package/ui/dist/assets/{OverviewPanel-DII4H_R7.js → OverviewPanel-CmRVwkE7.js} +1 -1
- package/ui/dist/assets/{PageHeader-Bzb_WXw0.js → PageHeader-Cx4DHJXy.js} +1 -1
- package/ui/dist/assets/{PersonaProfilesPanel-CXZTZhjo.js → PersonaProfilesPanel-hmUdUabW.js} +1 -1
- package/ui/dist/assets/{PersonasPanel-BYbD8XiV.js → PersonasPanel-VfvknF9L.js} +1 -1
- package/ui/dist/assets/{PhoneDeskPanel-Bol7fCCN.js → PhoneDeskPanel-DX_6zrt5.js} +1 -1
- package/ui/dist/assets/{RecipesPanel-BRbXRcEn.js → RecipesPanel-B7NygJvl.js} +1 -1
- package/ui/dist/assets/{SecurityPanel-BR3BT7Rb.js → SecurityPanel-DRZu6PRV.js} +1 -1
- package/ui/dist/assets/{SelfImprovePanel-BX9xYBxl.js → SelfImprovePanel-CgJG9v1W.js} +1 -1
- package/ui/dist/assets/{SelfProposalsPanel-BOoDEAYp.js → SelfProposalsPanel-BenuzEGo.js} +1 -1
- package/ui/dist/assets/{SessionsPanel-BICnNmn0.js → SessionsPanel-CFdsWt2W.js} +1 -1
- package/ui/dist/assets/{SessionsTab-X10FeDWA.js → SessionsTab-8Qtu9BMv.js} +1 -1
- package/ui/dist/assets/{SettingsPanel-MuC32AXw.js → SettingsPanel-CmIAAw_T.js} +1 -1
- package/ui/dist/assets/SettingsView-ByyjhwLz.js +2 -0
- package/ui/dist/assets/{SkeletonLoader-fwI4Z-f0.js → SkeletonLoader-crWOfBFq.js} +1 -1
- package/ui/dist/assets/{SkillsPanel-CKFndekU.js → SkillsPanel-BINP41r2.js} +1 -1
- package/ui/dist/assets/{SomaView-Ch7WlmBy.js → SomaView-CzZ6SCuw.js} +1 -1
- package/ui/dist/assets/{StatCard-Bj2Q_4WS.js → StatCard-DfoksLmM.js} +1 -1
- package/ui/dist/assets/{StatusBadge-NtdTQ8_L.js → StatusBadge-FyqmZDG0.js} +1 -1
- package/ui/dist/assets/{Tabs-CC9aTVuL.js → Tabs-BMzVMYab.js} +1 -1
- package/ui/dist/assets/{TeamsPanel-DjFcLsdR.js → TeamsPanel-CwVNzD77.js} +1 -1
- package/ui/dist/assets/{TelemetryPanel-k7gJbZyS.js → TelemetryPanel-C3JTWWQO.js} +1 -1
- package/ui/dist/assets/{TitanCanvas-MzLkpZhp.js → TitanCanvas-CmVs4TFr.js} +25 -25
- package/ui/dist/assets/{ToolsView-DcxwuM2l.js → ToolsView-C3m7TbnX.js} +2 -2
- package/ui/dist/assets/{Tooltip-CFYHfpgQ.js → Tooltip-DZJl8UaT.js} +1 -1
- package/ui/dist/assets/{TraceViewer-BfLO9vwI.js → TraceViewer-CfFZQJ3K.js} +1 -1
- package/ui/dist/assets/{TrainingPanel-DUl6qChY.js → TrainingPanel-BMunX3EV.js} +1 -1
- package/ui/dist/assets/{VoiceOverlay-Dj_cR5_Y.js → VoiceOverlay-DRjTeQgq.js} +1 -1
- package/ui/dist/assets/{VramPanel-th0_Eo8o.js → VramPanel-C4nG82nu.js} +1 -1
- package/ui/dist/assets/{WatchView-DyGhpKbv.js → WatchView-Cflz1FfL.js} +1 -1
- package/ui/dist/assets/{WorkTab-BG5VBljJ.js → WorkTab-BglKN8Uf.js} +1 -1
- package/ui/dist/assets/{WorkflowsPanel-C1hVHqAc.js → WorkflowsPanel-BZQu93gE.js} +1 -1
- package/ui/dist/assets/{archive-C2_hAJXj.js → archive-C10aphzL.js} +1 -1
- package/ui/dist/assets/{arrow-left-DFCBXvKS.js → arrow-left-CLTerrT5.js} +1 -1
- package/ui/dist/assets/{book-open-BgDKDGcH.js → book-open-DQ4VpfMq.js} +1 -1
- package/ui/dist/assets/{bot-C4ICYImG.js → bot-DNI_W-iH.js} +1 -1
- package/ui/dist/assets/{chart-column-BIFJOG_f.js → chart-column-COymYluE.js} +1 -1
- package/ui/dist/assets/{check-CmCL8yzl.js → check-Dq1bBdnM.js} +1 -1
- package/ui/dist/assets/{chevron-right-U0Ujye5i.js → chevron-right-Dz0EiJIX.js} +1 -1
- package/ui/dist/assets/{chevron-up-B6uSBxbj.js → chevron-up-CaJdgiQv.js} +1 -1
- package/ui/dist/assets/{circle-check-big-BFw1nom4.js → circle-check-big-Bi688_yD.js} +1 -1
- package/ui/dist/assets/{circle-stop-DbtGpdaw.js → circle-stop-BKeZMLyT.js} +1 -1
- package/ui/dist/assets/{clipboard-list-Dd3_U8cK.js → clipboard-list-BvhH8UZ-.js} +1 -1
- package/ui/dist/assets/{clock-DpJIc30t.js → clock-BiDhhRG4.js} +1 -1
- package/ui/dist/assets/{dollar-sign-DlrOHVzA.js → dollar-sign-XvC0BdrI.js} +1 -1
- package/ui/dist/assets/{download-CZ5kTONh.js → download-BUv-3ow-.js} +1 -1
- package/ui/dist/assets/{external-link-CX-GvMky.js → external-link-6i_dEGHo.js} +1 -1
- package/ui/dist/assets/{file-text-BtTsNJbB.js → file-text-CMteaHPb.js} +1 -1
- package/ui/dist/assets/{flask-conical-BaPYppKH.js → flask-conical-DOupoJs-.js} +1 -1
- package/ui/dist/assets/{folder-BOnpha2-.js → folder-Heg9X62R.js} +1 -1
- package/ui/dist/assets/{funnel-DaNi6kwp.js → funnel-C1qSeehb.js} +1 -1
- package/ui/dist/assets/{git-branch-gs6g9dSe.js → git-branch-BgrSzLGu.js} +1 -1
- package/ui/dist/assets/{index-Dbv5oKsp.js → index-CfeeNofL.js} +23 -23
- package/ui/dist/assets/index-DmgXt1oB.css +1 -0
- package/ui/dist/assets/{layers-BKZz8iD1.js → layers-BXjHgthV.js} +1 -1
- package/ui/dist/assets/{legacy-DbwFsW2A.js → legacy-CMWeVEm-.js} +1 -1
- package/ui/dist/assets/{lightbulb-DX6YLtPe.js → lightbulb-CaU3yf0V.js} +1 -1
- package/ui/dist/assets/{list-todo-qdMNm4-Q.js → list-todo-DIH1DDut.js} +1 -1
- package/ui/dist/assets/{message-square-Cwo5FOho.js → message-square-CAJnwIi8.js} +1 -1
- package/ui/dist/assets/{mic-BzvwK4IS.js → mic-a150MaF_.js} +1 -1
- package/ui/dist/assets/{missions-CYlXuJED.js → missions-BCmxIqis.js} +1 -1
- package/ui/dist/assets/{network-Dt-RBtO_.js → network-DpJozzT9.js} +1 -1
- package/ui/dist/assets/{pause-Do3XNLtx.js → pause-B7pXF6wS.js} +1 -1
- package/ui/dist/assets/{pencil-DAGs9RFs.js → pencil-DNQZmkMU.js} +1 -1
- package/ui/dist/assets/{play-CNElkzEq.js → play-CB_hciEJ.js} +1 -1
- package/ui/dist/assets/{plug-DCgrVnB8.js → plug-UdiCBZ6I.js} +1 -1
- package/ui/dist/assets/{plus-BnsXhqXc.js → plus-BNliIo_L.js} +1 -1
- package/ui/dist/assets/{proxy-BXHdgwrk.js → proxy-tgCU20-X.js} +1 -1
- package/ui/dist/assets/{radio-BPz7sHXW.js → radio-KEVgfxWk.js} +1 -1
- package/ui/dist/assets/{refresh-cw-Cs4oDMNE.js → refresh-cw-C4BAymqq.js} +1 -1
- package/ui/dist/assets/{rotate-ccw-DSpsA3Wr.js → rotate-ccw-CyT1wcCY.js} +1 -1
- package/ui/dist/assets/{save-BhGg2pZh.js → save-ICOKiEQf.js} +1 -1
- package/ui/dist/assets/{search-BtxlIgqN.js → search-qz2VMyBQ.js} +1 -1
- package/ui/dist/assets/{send-BzKTXI3q.js → send-AYGyxY6d.js} +1 -1
- package/ui/dist/assets/{server-B1gIgixS.js → server-DMkFokTU.js} +1 -1
- package/ui/dist/assets/{shield-check-C39B-Wi3.js → shield-check-Dtr3ujKk.js} +1 -1
- package/ui/dist/assets/{terminal-CubaeYlJ.js → terminal-ucriUmF-.js} +1 -1
- package/ui/dist/assets/{test-tube-CYYLfFIz.js → test-tube-Co4Kjj0G.js} +1 -1
- package/ui/dist/assets/{toggle-right-BQ3iDgLG.js → toggle-right-NKDEGJdm.js} +1 -1
- package/ui/dist/assets/{trash-2-CSxfLiVB.js → trash-2-CJjOlqMp.js} +1 -1
- package/ui/dist/assets/{trending-up-DXxKT18Q.js → trending-up-CC4itzlz.js} +1 -1
- package/ui/dist/assets/{trophy-osEOm2Vi.js → trophy-BP9FY35i.js} +1 -1
- package/ui/dist/assets/{volume-2-C1OkTurz.js → volume-2-CAQ1nA-B.js} +1 -1
- package/ui/dist/assets/{wifi-off-DAhvsjnD.js → wifi-off-jrnDcc0y.js} +1 -1
- package/ui/dist/index.html +2 -2
- package/ui/dist/sw.js +1 -1
- package/ui/dist/assets/CPLayout-CHrlktMs.js +0 -2
- package/ui/dist/assets/InfraView-DNYgRXkB.js +0 -2
- package/ui/dist/assets/IntelligenceView-BUKpVpDQ.js +0 -2
- package/ui/dist/assets/MissionCanvas-Ci0hbAF0.js +0 -69
- package/ui/dist/assets/SettingsView-Cv9IZqiU.js +0 -2
- package/ui/dist/assets/index-OZm1iJy9.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,j as e,G as k,ah as z,ai as $,aj as b,ak as R,al as I,am as E}from"./index-Dbv5oKsp.js";import{P as h}from"./plug-DCgrVnB8.js";import{R as D}from"./refresh-cw-Cs4oDMNE.js";import{P as L}from"./plus-BnsXhqXc.js";import{S as g}from"./server-B1gIgixS.js";import{T as G,P as B}from"./test-tube-CYYLfFIz.js";import{T as F}from"./trash-2-CSxfLiVB.js";function O(){const[o,j]=d.useState([]),[N,y]=d.useState([]),[f,x]=d.useState(!0),[m,c]=d.useState(!1),[v,p]=d.useState(null),[l,i]=d.useState(null),[s,a]=d.useState({id:"",name:"",description:"",type:"stdio",command:"",args:"",url:""}),n=async()=>{x(!0);try{const[t,r]=await Promise.all([z(),$()]);j(t),y(r)}catch{}x(!1)};d.useEffect(()=>{n()},[]);const C=async()=>{try{await b({id:s.id,name:s.name,description:s.description,type:s.type,...s.type==="stdio"?{command:s.command,args:s.args.split(/\s+/).filter(Boolean)}:{url:s.url}}),c(!1),a({id:"",name:"",description:"",type:"stdio",command:"",args:"",url:""}),n()}catch(t){alert(t.message)}},P=async t=>{try{await b({presetId:t}),n()}catch(r){alert(r.message)}},w=async t=>{confirm(`Remove MCP server "${t}"?`)&&(await E(t),n())},M=async(t,r)=>{await I(t,r),n()},T=async t=>{p(t),i(null);try{const r=await R(t);i({id:t,...r})}catch(r){i({id:t,ok:!1,tools:0,error:r.message})}p(null)},S=t=>t==="connected"?"text-[var(--success)]":t==="error"?"text-[var(--error)]":"text-[var(--text-muted)]",A=t=>t==="connected"?"bg-[var(--success)]":t==="error"?"bg-[var(--error)]":"bg-[var(--text-muted)]",u=N.filter(t=>!o.some(r=>r.id===t.id));return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(h,{className:"w-6 h-6 text-[var(--accent)]"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-[var(--text)]",children:"MCP Connections"}),e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Connect to external tools via Model Context Protocol"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:n,className:"px-3 py-1.5 text-sm rounded-md border border-[var(--border)] text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",children:e.jsx(D,{size:14})}),e.jsxs("button",{onClick:()=>c(!m),className:"flex items-center gap-2 px-3 py-1.5 text-sm rounded-md bg-[var(--accent)] text-white hover:bg-[var(--accent-hover)] transition-colors",children:[e.jsx(L,{size:14})," Add Server"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Configured Servers"}),e.jsx("p",{className:"text-2xl font-bold text-[var(--text)]",children:o.length})]}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Connected"}),e.jsx("p",{className:"text-2xl font-bold text-[var(--success)]",children:o.filter(t=>t.status==="connected").length})]}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"External Tools"}),e.jsx("p",{className:"text-2xl font-bold text-[var(--accent)]",children:o.reduce((t,r)=>t+r.toolCount,0)})]})]}),m&&e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4 space-y-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--text)]",children:"Add MCP Server"}),u.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)] mb-2",children:"Quick Add Presets"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:u.map(t=>e.jsxs("button",{onClick:()=>P(t.id),className:"flex items-center gap-2 px-3 py-1.5 text-xs rounded-md border border-[var(--border)] text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",children:[e.jsx(g,{size:12})," ",t.name]},t.id))})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"ID"}),e.jsx("input",{id:"mcp-server-id",name:"mcp-server-id",value:s.id,onChange:t=>a({...s,id:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"my-server"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Name"}),e.jsx("input",{id:"mcp-server-name",name:"mcp-server-name",value:s.name,onChange:t=>a({...s,name:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"My MCP Server"})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Description"}),e.jsx("input",{id:"mcp-server-description",name:"mcp-server-description",value:s.description,onChange:t=>a({...s,description:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"What does this server do?"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Type"}),e.jsxs("select",{id:"mcp-server-type",name:"mcp-server-type",value:s.type,onChange:t=>a({...s,type:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",children:[e.jsx("option",{value:"stdio",children:"stdio (local process)"}),e.jsx("option",{value:"http",children:"HTTP (remote server)"})]})]}),s.type==="stdio"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Command"}),e.jsx("input",{id:"mcp-server-command",name:"mcp-server-command",value:s.command,onChange:t=>a({...s,command:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"npx @modelcontextprotocol/server-xxx"})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Arguments (space-separated)"}),e.jsx("input",{id:"mcp-server-args",name:"mcp-server-args",value:s.args,onChange:t=>a({...s,args:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"--port 3000"})]})]}):e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Server URL"}),e.jsx("input",{id:"mcp-server-url",name:"mcp-server-url",value:s.url,onChange:t=>a({...s,url:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"http://localhost:3000/mcp"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:C,disabled:!s.id||!s.name,className:"px-4 py-1.5 text-sm rounded-md bg-[var(--accent)] text-white hover:bg-[var(--accent-hover)] disabled:opacity-40 transition-colors",children:"Add Server"}),e.jsx("button",{onClick:()=>c(!1),className:"px-4 py-1.5 text-sm rounded-md border border-[var(--border)] text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",children:"Cancel"})]})]}),f?e.jsx("div",{className:"text-[var(--text-muted)] text-sm",children:"Loading MCP servers..."}):o.length===0?e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-8 text-center",children:[e.jsx(h,{className:"w-10 h-10 text-[var(--text-muted)] mx-auto mb-3"}),e.jsx("p",{className:"text-[var(--text-secondary)] mb-1",children:"No MCP servers configured"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"Add an MCP server to connect TITAN to external tools like databases, APIs, and services."})]}):e.jsx("div",{className:"space-y-3",children:o.map(t=>e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5",children:t.type==="stdio"?e.jsx(g,{size:18,className:"text-[var(--text-muted)]"}):e.jsx(k,{size:18,className:"text-[var(--text-muted)]"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-[var(--text)]",children:t.name}),e.jsxs("span",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${A(t.status)}`}),e.jsx("span",{className:S(t.status),children:t.status})]}),t.toolCount>0&&e.jsxs("span",{className:"text-xs px-1.5 py-0.5 rounded bg-[var(--accent)]/10 text-[var(--accent)]",children:[t.toolCount," tools"]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)] mt-0.5",children:t.description}),e.jsx("p",{className:"text-xs text-[var(--text-muted)] mt-1 font-mono",children:t.type==="stdio"?`${t.command} ${(t.args||[]).join(" ")}`:t.url})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>T(t.id),disabled:v===t.id,title:"Test connection",className:"p-1.5 rounded-md text-[var(--text-muted)] hover:text-[var(--text)] hover:bg-[var(--bg-tertiary)] transition-colors disabled:opacity-40",children:e.jsx(G,{size:14,className:v===t.id?"animate-pulse":""})}),e.jsx("button",{onClick:()=>M(t.id,!t.enabled),title:t.enabled?"Disable":"Enable",className:`p-1.5 rounded-md transition-colors hover:bg-[var(--bg-tertiary)] ${t.enabled?"text-[var(--success)]":"text-[var(--text-muted)]"}`,children:e.jsx(B,{size:14})}),e.jsx("button",{onClick:()=>w(t.id),title:"Remove",className:"p-1.5 rounded-md text-[var(--text-muted)] hover:text-[var(--error)] hover:bg-[var(--bg-tertiary)] transition-colors",children:e.jsx(F,{size:14})})]})]}),(l==null?void 0:l.id)===t.id&&e.jsx("div",{className:`mt-3 px-3 py-2 rounded-md text-xs ${l.ok?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:l.ok?`Connected successfully — ${l.tools} tools discovered`:`Connection failed: ${l.error}`})]},t.id))}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--text)] mb-2",children:"About MCP"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)] leading-relaxed",children:["Model Context Protocol (MCP) is the universal standard for connecting AI agents to external tools. TITAN acts as both an MCP ",e.jsx("strong",{className:"text-[var(--text-secondary)]",children:"server"})," (exposing its tools to other agents) and an MCP ",e.jsx("strong",{className:"text-[var(--text-secondary)]",children:"client"})," (connecting to external MCP servers). Add any MCP-compatible server and its tools automatically become available in TITAN."]})]})]})}export{O as default};
|
|
1
|
+
import{r as d,j as e,G as k,ah as z,ai as $,aj as b,ak as R,al as I,am as E}from"./index-CfeeNofL.js";import{P as h}from"./plug-UdiCBZ6I.js";import{R as D}from"./refresh-cw-C4BAymqq.js";import{P as L}from"./plus-BNliIo_L.js";import{S as g}from"./server-DMkFokTU.js";import{T as G,P as B}from"./test-tube-Co4Kjj0G.js";import{T as F}from"./trash-2-CJjOlqMp.js";function O(){const[o,j]=d.useState([]),[N,y]=d.useState([]),[f,x]=d.useState(!0),[m,c]=d.useState(!1),[v,p]=d.useState(null),[l,i]=d.useState(null),[s,a]=d.useState({id:"",name:"",description:"",type:"stdio",command:"",args:"",url:""}),n=async()=>{x(!0);try{const[t,r]=await Promise.all([z(),$()]);j(t),y(r)}catch{}x(!1)};d.useEffect(()=>{n()},[]);const C=async()=>{try{await b({id:s.id,name:s.name,description:s.description,type:s.type,...s.type==="stdio"?{command:s.command,args:s.args.split(/\s+/).filter(Boolean)}:{url:s.url}}),c(!1),a({id:"",name:"",description:"",type:"stdio",command:"",args:"",url:""}),n()}catch(t){alert(t.message)}},P=async t=>{try{await b({presetId:t}),n()}catch(r){alert(r.message)}},w=async t=>{confirm(`Remove MCP server "${t}"?`)&&(await E(t),n())},M=async(t,r)=>{await I(t,r),n()},T=async t=>{p(t),i(null);try{const r=await R(t);i({id:t,...r})}catch(r){i({id:t,ok:!1,tools:0,error:r.message})}p(null)},S=t=>t==="connected"?"text-[var(--success)]":t==="error"?"text-[var(--error)]":"text-[var(--text-muted)]",A=t=>t==="connected"?"bg-[var(--success)]":t==="error"?"bg-[var(--error)]":"bg-[var(--text-muted)]",u=N.filter(t=>!o.some(r=>r.id===t.id));return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(h,{className:"w-6 h-6 text-[var(--accent)]"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-[var(--text)]",children:"MCP Connections"}),e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Connect to external tools via Model Context Protocol"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:n,className:"px-3 py-1.5 text-sm rounded-md border border-[var(--border)] text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",children:e.jsx(D,{size:14})}),e.jsxs("button",{onClick:()=>c(!m),className:"flex items-center gap-2 px-3 py-1.5 text-sm rounded-md bg-[var(--accent)] text-white hover:bg-[var(--accent-hover)] transition-colors",children:[e.jsx(L,{size:14})," Add Server"]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Configured Servers"}),e.jsx("p",{className:"text-2xl font-bold text-[var(--text)]",children:o.length})]}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Connected"}),e.jsx("p",{className:"text-2xl font-bold text-[var(--success)]",children:o.filter(t=>t.status==="connected").length})]}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"External Tools"}),e.jsx("p",{className:"text-2xl font-bold text-[var(--accent)]",children:o.reduce((t,r)=>t+r.toolCount,0)})]})]}),m&&e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4 space-y-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--text)]",children:"Add MCP Server"}),u.length>0&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-[var(--text-muted)] mb-2",children:"Quick Add Presets"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:u.map(t=>e.jsxs("button",{onClick:()=>P(t.id),className:"flex items-center gap-2 px-3 py-1.5 text-xs rounded-md border border-[var(--border)] text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",children:[e.jsx(g,{size:12})," ",t.name]},t.id))})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"ID"}),e.jsx("input",{id:"mcp-server-id",name:"mcp-server-id",value:s.id,onChange:t=>a({...s,id:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"my-server"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Name"}),e.jsx("input",{id:"mcp-server-name",name:"mcp-server-name",value:s.name,onChange:t=>a({...s,name:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"My MCP Server"})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Description"}),e.jsx("input",{id:"mcp-server-description",name:"mcp-server-description",value:s.description,onChange:t=>a({...s,description:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"What does this server do?"})]}),e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Type"}),e.jsxs("select",{id:"mcp-server-type",name:"mcp-server-type",value:s.type,onChange:t=>a({...s,type:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",children:[e.jsx("option",{value:"stdio",children:"stdio (local process)"}),e.jsx("option",{value:"http",children:"HTTP (remote server)"})]})]}),s.type==="stdio"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Command"}),e.jsx("input",{id:"mcp-server-command",name:"mcp-server-command",value:s.command,onChange:t=>a({...s,command:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"npx @modelcontextprotocol/server-xxx"})]}),e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Arguments (space-separated)"}),e.jsx("input",{id:"mcp-server-args",name:"mcp-server-args",value:s.args,onChange:t=>a({...s,args:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"--port 3000"})]})]}):e.jsxs("div",{className:"md:col-span-2",children:[e.jsx("label",{className:"text-xs text-[var(--text-muted)]",children:"Server URL"}),e.jsx("input",{id:"mcp-server-url",name:"mcp-server-url",value:s.url,onChange:t=>a({...s,url:t.target.value}),className:"w-full mt-1 px-3 py-1.5 text-sm bg-[var(--bg)] border border-[var(--border)] rounded-md text-[var(--text)]",placeholder:"http://localhost:3000/mcp"})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:C,disabled:!s.id||!s.name,className:"px-4 py-1.5 text-sm rounded-md bg-[var(--accent)] text-white hover:bg-[var(--accent-hover)] disabled:opacity-40 transition-colors",children:"Add Server"}),e.jsx("button",{onClick:()=>c(!1),className:"px-4 py-1.5 text-sm rounded-md border border-[var(--border)] text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",children:"Cancel"})]})]}),f?e.jsx("div",{className:"text-[var(--text-muted)] text-sm",children:"Loading MCP servers..."}):o.length===0?e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-8 text-center",children:[e.jsx(h,{className:"w-10 h-10 text-[var(--text-muted)] mx-auto mb-3"}),e.jsx("p",{className:"text-[var(--text-secondary)] mb-1",children:"No MCP servers configured"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"Add an MCP server to connect TITAN to external tools like databases, APIs, and services."})]}):e.jsx("div",{className:"space-y-3",children:o.map(t=>e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5",children:t.type==="stdio"?e.jsx(g,{size:18,className:"text-[var(--text-muted)]"}):e.jsx(k,{size:18,className:"text-[var(--text-muted)]"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"font-medium text-[var(--text)]",children:t.name}),e.jsxs("span",{className:"flex items-center gap-1.5 text-xs",children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${A(t.status)}`}),e.jsx("span",{className:S(t.status),children:t.status})]}),t.toolCount>0&&e.jsxs("span",{className:"text-xs px-1.5 py-0.5 rounded bg-[var(--accent)]/10 text-[var(--accent)]",children:[t.toolCount," tools"]})]}),e.jsx("p",{className:"text-xs text-[var(--text-muted)] mt-0.5",children:t.description}),e.jsx("p",{className:"text-xs text-[var(--text-muted)] mt-1 font-mono",children:t.type==="stdio"?`${t.command} ${(t.args||[]).join(" ")}`:t.url})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:()=>T(t.id),disabled:v===t.id,title:"Test connection",className:"p-1.5 rounded-md text-[var(--text-muted)] hover:text-[var(--text)] hover:bg-[var(--bg-tertiary)] transition-colors disabled:opacity-40",children:e.jsx(G,{size:14,className:v===t.id?"animate-pulse":""})}),e.jsx("button",{onClick:()=>M(t.id,!t.enabled),title:t.enabled?"Disable":"Enable",className:`p-1.5 rounded-md transition-colors hover:bg-[var(--bg-tertiary)] ${t.enabled?"text-[var(--success)]":"text-[var(--text-muted)]"}`,children:e.jsx(B,{size:14})}),e.jsx("button",{onClick:()=>w(t.id),title:"Remove",className:"p-1.5 rounded-md text-[var(--text-muted)] hover:text-[var(--error)] hover:bg-[var(--bg-tertiary)] transition-colors",children:e.jsx(F,{size:14})})]})]}),(l==null?void 0:l.id)===t.id&&e.jsx("div",{className:`mt-3 px-3 py-2 rounded-md text-xs ${l.ok?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:l.ok?`Connected successfully — ${l.tools} tools discovered`:`Connection failed: ${l.error}`})]},t.id))}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--text)] mb-2",children:"About MCP"}),e.jsxs("p",{className:"text-xs text-[var(--text-muted)] leading-relaxed",children:["Model Context Protocol (MCP) is the universal standard for connecting AI agents to external tools. TITAN acts as both an MCP ",e.jsx("strong",{className:"text-[var(--text-secondary)]",children:"server"})," (exposing its tools to other agents) and an MCP ",e.jsx("strong",{className:"text-[var(--text-secondary)]",children:"client"})," (connecting to external MCP servers). Add any MCP-compatible server and its tools automatically become available in TITAN."]})]})]})}export{O as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ye,r as j,b as be,j as o,X as Se}from"./index-
|
|
1
|
+
import{c as ye,r as j,b as be,j as o,X as Se}from"./index-CfeeNofL.js";import{N as ve}from"./network-DpJozzT9.js";import{R as Ce}from"./refresh-cw-C4BAymqq.js";import{T as ke}from"./trash-2-CJjOlqMp.js";import{S as $e}from"./search-qz2VMyBQ.js";/**
|
|
2
2
|
* @license lucide-react v0.513.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as g,r as n,b as h,j as e}from"./index-
|
|
1
|
+
import{c as g,r as n,b as h,j as e}from"./index-CfeeNofL.js";import{P as u}from"./PageHeader-Cx4DHJXy.js";import{A as v}from"./arrow-left-CLTerrT5.js";import{C as w}from"./clock-BiDhhRG4.js";import{S as k}from"./search-qz2VMyBQ.js";import{B as S}from"./book-open-DQ4VpfMq.js";import"./chevron-right-Dz0EiJIX.js";/**
|
|
2
2
|
* @license lucide-react v0.513.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as l,r as n,j as e,ar as y,as as j,at as N,au as f,av as k}from"./index-
|
|
1
|
+
import{c as l,r as n,j as e,ar as y,as as j,at as N,au as f,av as k}from"./index-CfeeNofL.js";import{D as v}from"./DataTable-CEjOtKUe.js";import{R as w}from"./refresh-cw-C4BAymqq.js";import{S as P}from"./shield-check-Dtr3ujKk.js";/**
|
|
2
2
|
* @license lucide-react v0.513.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import{r as o,j as e,p as Ne,u as Se,aB as Ce}from"./index-CfeeNofL.js";import{p as ee,f as Me,h as $e,i as De,g as Te,a as de,s as Ae,b as ze,d as Oe,e as Fe}from"./missions-BCmxIqis.js";import{F as Le}from"./FileViewer-C7fgbngf.js";function Ee({member:t,room:a,anchor:r,availableModels:s,onClose:d,onTalkInChat:u}){const p=o.useRef(null),[l,v]=o.useState("main"),[y,h]=o.useState(""),[b,c]=o.useState(!1),[m,f]=o.useState(!1),[w,j]=o.useState(null);o.useEffect(()=>{const g=E=>{E.key==="Escape"&&d()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[d]);const A=320,T=360,C=Re(r,A,T);async function S(){f(!0),j(null);try{await ee(a.id,`@${t.name} quick check-in — how's it going? Anything I can clear for you?`),d()}catch(g){j(g.message)}finally{f(!1)}}async function L(g){const E=y.trim();if(!(!E||b)){c(!0),j(null);try{await ee(a.id,`@${t.name} ${g}${E}`),h(""),d()}catch(W){j(W.message)}finally{c(!1)}}}async function z(g){f(!0),j(null);try{await De(a.id,t.agentId,g),v("main")}catch(E){j(E.message)}finally{f(!1)}}async function k(){f(!0),j(null);try{await Me(a.id,t.agentId,!t.paused)}catch(g){j(g.message)}finally{f(!1)}}async function R(){f(!0),j(null);try{await $e(a.id,!a.longRunningMode)}catch(g){j(g.message)}finally{f(!1)}}return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-[60]",onClick:d,"aria-hidden":!0}),e.jsxs("div",{ref:p,className:"absolute z-[61] flex flex-col titan-modal-surface overflow-hidden",style:{left:C.x,top:C.y,width:A,maxHeight:T,borderRadius:12},onClick:g=>g.stopPropagation(),children:[e.jsx("div",{className:"h-1.5",style:{background:`linear-gradient(90deg, ${t.color}, ${ue(t.color,-25)})`}}),e.jsxs("div",{className:"px-4 pt-3 pb-2 flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center text-white font-bold text-[14px]",style:{background:`linear-gradient(135deg, ${t.color}, ${ue(t.color,-25)})`},children:t.name[0]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-semibold text-sm",children:t.name}),e.jsxs("div",{className:"text-[11px] text-text-muted",children:[t.role," · ",Pe(t)]})]}),e.jsx("button",{onClick:d,"aria-label":"Close",className:"titan-close-btn w-7 h-7 rounded-full flex items-center justify-center text-sm",style:{border:"1px solid var(--theme-menu-border)"},children:"✕"})]}),t.currentActivity&&e.jsxs("div",{className:"px-4 pb-2 text-[11px] text-text-secondary italic leading-snug border-b border-border/60",children:['"',t.currentActivity,'"']}),w&&e.jsx("div",{className:"px-4 py-2 text-[11px] text-error bg-error/10 border-b border-error/30",children:w}),e.jsxs("div",{className:"flex-1 overflow-y-auto",children:[l==="main"&&e.jsxs("div",{className:"p-2 grid grid-cols-2 gap-2",children:[e.jsx(H,{icon:"👋",label:"Nudge",hint:"A friendly check-in",onClick:S,disabled:m}),e.jsx(H,{icon:"💬",label:"Talk to them",hint:"Send a message just to them",onClick:()=>{u?(u(t.agentId,`@${t.name} `),d()):v("talk")},disabled:m}),e.jsx(H,{icon:"🧭",label:"Steer",hint:"Redirect them mid-task",onClick:()=>v("steer"),disabled:m}),e.jsx(H,{icon:"🧠",label:"Model",hint:t.modelOverride?Ie(t.modelOverride):"default",onClick:()=>v("model"),disabled:m}),e.jsx(H,{icon:t.paused?"▶":"⏸",label:t.paused?"Resume agent":"Pause agent",hint:t.paused?"Bring them back":"Skip them for now",onClick:k,disabled:m,wide:!1}),e.jsx(H,{icon:"🏃",label:a.longRunningMode?"Marathon ON":"Marathon mode",hint:a.longRunningMode?"running 72h goal":"72h auto-run",onClick:R,disabled:m,active:!!a.longRunningMode})]}),(l==="talk"||l==="steer")&&e.jsxs("div",{className:"p-3 flex flex-col gap-2",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-text-muted",children:l==="talk"?`Message ${t.name}`:`Steer ${t.name}`}),e.jsx("textarea",{autoFocus:!0,value:y,onChange:g=>h(g.target.value),rows:4,onKeyDown:g=>{g.key==="Enter"&&(g.metaKey||g.ctrlKey)&&(g.preventDefault(),L(l==="steer"?"steer: ":""))},placeholder:l==="steer"?'e.g. "skip the chart, focus on cost comparison"':"Type a private note to them…",className:"bg-bg-tertiary border border-border rounded-lg p-2 text-sm text-text outline-none focus:border-accent resize-none"}),l==="steer"&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:["Slow down","Be thorough","Wrap it up","Skip the chart"].map(g=>e.jsx("button",{onClick:()=>h(g.toLowerCase()),className:"px-2 py-0.5 text-[11px] bg-bg-tertiary border border-border rounded-full text-text-muted hover:text-text",children:g},g))}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("button",{onClick:()=>v("main"),className:"text-xs text-text-muted hover:text-text",children:"← Back"}),e.jsx("button",{onClick:()=>L(l==="steer"?"steer: ":""),disabled:!y.trim()||b,className:"px-3 py-1.5 rounded-lg font-bold text-bg-deep bg-gradient-to-br from-accent to-accent2 disabled:opacity-50 text-xs",children:b?"Sending…":"Send ⌘↵"})]})]}),l==="model"&&e.jsxs("div",{className:"p-3 flex flex-col gap-2",children:[e.jsxs("div",{className:"text-[10px] uppercase tracking-widest text-text-muted",children:[t.name,"'s brain"]}),e.jsx("div",{className:"text-[11px] text-text-secondary leading-snug",children:"Pick a specific model for this agent on this mission. Empty = the role's default."}),t.modelOverride&&e.jsxs("div",{className:"px-2.5 py-1.5 rounded-lg bg-accent/10 border border-accent/40 text-[12px] text-text flex items-center justify-between",children:[e.jsxs("span",{className:"truncate",children:["Now: ",e.jsx("b",{children:t.modelOverride})]}),e.jsx("button",{onClick:()=>z(null),className:"text-[11px] text-text-muted hover:text-text shrink-0",children:"clear"})]}),e.jsx("div",{className:"flex flex-col gap-1 max-h-48 overflow-y-auto",children:s.length===0?e.jsx("div",{className:"text-[11px] text-text-muted italic",children:"No models discovered. /api/models returned empty."}):s.map(g=>{const E=t.modelOverride===g.id;return e.jsxs("button",{onClick:()=>z(g.id),disabled:m,className:`flex items-center justify-between px-2.5 py-1.5 rounded-lg text-[12px] border text-left ${E?"bg-accent/10 border-accent/60 text-text":"bg-bg-tertiary/40 border-border text-text-secondary hover:text-text hover:border-border-light"}`,children:[e.jsx("span",{className:"truncate",children:g.id}),e.jsx("span",{className:"text-[10px] text-text-muted ml-2 shrink-0",children:g.provider})]},g.id)})}),e.jsx("button",{onClick:()=>v("main"),className:"text-xs text-text-muted hover:text-text self-start mt-1",children:"← Back"})]})]})]})]})}function H({icon:t,label:a,hint:r,onClick:s,disabled:d,wide:u,active:p}){return e.jsxs("button",{onClick:s,disabled:d,className:`text-left p-2.5 rounded-xl border transition-colors ${p?"bg-accent/15 border-accent/50 text-text":"bg-bg-tertiary/40 border-border text-text-secondary hover:text-text hover:border-border-light"} ${u?"col-span-2":""} disabled:opacity-50`,children:[e.jsx("div",{className:"text-lg leading-none mb-1",children:t}),e.jsx("div",{className:"text-[12px] font-semibold leading-tight",children:a}),r&&e.jsx("div",{className:"text-[10px] text-text-muted leading-snug mt-0.5 truncate",children:r})]})}function Re({x:t,y:a},r,s){const d=window.innerWidth,u=window.innerHeight;return{x:Math.max(8,Math.min(t,d-r-8)),y:Math.max(8,Math.min(a,u-s-8))}}function Pe(t){return t.paused?"paused (by you)":t.state==="working"?"working":t.state==="editing"?"editing":t.state==="blocked"?"needs you":t.state==="done"?"done":"idle"}function Ie(t){return t.length<=24?t:t.slice(0,22)+"…"}function ue(t,a){const r=t.replace("#","");if(r.length!==6)return t;const s=parseInt(r,16);let d=s>>16&255,u=s>>8&255,p=s&255;const l=Math.round(255*(a/100));return d=Math.max(0,Math.min(255,d+l)),u=Math.max(0,Math.min(255,u+l)),p=Math.max(0,Math.min(255,p+l)),"#"+(d<<16|u<<8|p).toString(16).padStart(6,"0")}const Be=12;function Ye(t){const a=new Map;for(const s of t){const d=s.activityLog??[];for(const u of d){const p=`${s.agentId}::${u.activity}`,l=a.get(p);if(!l){a.set(p,{id:p,agentId:s.agentId,agentName:s.name,agentColor:s.color,icon:u.icon,activity:u.activity,detail:u.detail,at:u.at,count:1,recentDetails:u.detail?[u.detail]:[]});continue}l.count+=1,u.at>l.at&&(l.at=u.at,l.icon=u.icon,u.detail&&(l.detail=u.detail)),u.detail&&(l.recentDetails=[u.detail,...l.recentDetails.filter(v=>v!==u.detail)].slice(0,3))}}return Array.from(a.values()).sort((s,d)=>s.at<d.at?1:-1).slice(0,Be)}const We=[{cmd:"/slow down",label:"Slow down",hint:"be more careful"},{cmd:"/be thorough",label:"Be thorough",hint:"dig deeper"},{cmd:"/wrap it up",label:"Wrap it up",hint:"finish what you have"},{cmd:"/pause",label:"Pause",hint:"pause the team"}];function He(t){try{const a=localStorage.getItem(he(t));return a?JSON.parse(a):{}}catch{return{}}}function Ge(t,a){try{localStorage.setItem(he(t),JSON.stringify(a))}catch{}}function he(t){return`titan-desk:${t}`}function fe(t){return`titan-desk-furniture:${t}`}function Ke(t){const a={cabinet:[],trash:[],permanentlyHidden:[],cabinetOpen:!1,trashOpen:!1};try{const r=localStorage.getItem(fe(t));if(!r)return a;const s=JSON.parse(r);return{cabinet:Array.isArray(s.cabinet)?s.cabinet:[],trash:Array.isArray(s.trash)?s.trash:[],permanentlyHidden:Array.isArray(s.permanentlyHidden)?s.permanentlyHidden:[],cabinetOpen:!!s.cabinetOpen,trashOpen:!!s.trashOpen}}catch{return a}}function _e(t,a){try{localStorage.setItem(fe(t),JSON.stringify(a))}catch{}}function $t(){const{id:t}=Ne(),a=Se(),[r,s]=o.useState(null),[d,u]=o.useState(!0),[p,l]=o.useState(null),[v,y]=o.useState(""),[h,b]=o.useState(!1),[c,m]=o.useState(!1),f=o.useRef(null),[w,j]=o.useState(()=>({width:typeof window>"u"?1400:window.innerWidth,height:typeof window>"u"?800:window.innerHeight}));o.useLayoutEffect(()=>{const n=f.current;if(!n)return;const i=()=>{const M=n.getBoundingClientRect();j($=>{const P=Math.max(320,Math.round(M.width)),N=Math.max(320,Math.round(M.height));return $.width===P&&$.height===N?$:{width:P,height:N}})};i();const x=typeof ResizeObserver<"u"?new ResizeObserver(i):null;return x==null||x.observe(n),window.addEventListener("resize",i),()=>{x==null||x.disconnect(),window.removeEventListener("resize",i)}},[d,r==null?void 0:r.id]);const A=o.useCallback(()=>{var i;const n=(i=f.current)==null?void 0:i.getBoundingClientRect();return n||{left:0,top:0,width:typeof window>"u"?1400:window.innerWidth,height:typeof window>"u"?800:window.innerHeight}},[]),T=o.useCallback((n,i)=>{const x=A();return{x:n-x.left,y:i-x.top}},[A]),C=o.useCallback((n,i)=>{const x=T(n,i);return{x:Math.max(8,Math.min(x.x,w.width-328)),y:Math.max(8,Math.min(x.y,w.height-368))}},[w,T]),[S,L]=o.useState({});o.useEffect(()=>{t&&L(He(t))},[t]);const z=o.useCallback(n=>{L(n),t&&Ge(t,n)},[t]),[k,R]=o.useState({cabinet:[],trash:[],permanentlyHidden:[],cabinetOpen:!1,trashOpen:!1});o.useEffect(()=>{t&&R(Ke(t))},[t]);const g=o.useCallback(n=>{R(n),t&&_e(t,n)},[t]),[E,W]=o.useState([]);o.useEffect(()=>{Ce().then(W).catch(()=>W([]))},[]);const[B,G]=o.useState(null),[J,V]=o.useState(null),te=o.useCallback(async n=>{if(t){V({ref:n,loading:!0});try{const i=await Te(t,n);V({ref:n,loading:!1,file:i})}catch(i){V({ref:n,loading:!1,error:i.message})}}},[t]);o.useEffect(()=>{if(!t)return;let n=!0;return u(!0),de(t).then(({mission:i})=>{n&&(s(i),u(!1))}).catch(i=>{n&&(l(i.message),u(!1))}),()=>{n=!1}},[t]),o.useEffect(()=>t?Ae(t,i=>{if(i.kind==="mission_deleted"){a("/mission");return}i.kind!=="hello"&&de(t).then(({mission:x})=>s(x)).catch(()=>{})}):void 0,[t,a]);const ae=o.useCallback(async n=>{if(!(!r||!n.trim()||h)){b(!0);try{await ee(r.id,n.trim()),y("")}catch(i){l(i.message)}finally{b(!1)}}},[r,h]),me=o.useCallback(async(n,i)=>{if(r)try{await ze(r.id,n,i)}catch(x){l(x.message)}},[r]),ge=o.useCallback(async()=>{if(!r)return;const n=r.status==="paused"?"working":"paused";try{await Oe(r.id,n)}catch(i){l(i.message)}},[r]),be=o.useCallback(async()=>{if(!(!r||!window.confirm(`Delete this mission?
|
|
2
|
+
|
|
3
|
+
"${r.goal.slice(0,120)}${r.goal.length>120?"…":""}"
|
|
4
|
+
|
|
5
|
+
The file is renamed on disk (recoverable manually), but the mission disappears from the UI immediately.`)))try{await Fe(r.id),a("/mission")}catch(i){l(i.message)}},[r,a]),K=o.useMemo(()=>r?[...r.messages].reverse().find(i=>i.kind==="question"&&!i.answer):void 0,[r]),_=o.useMemo(()=>{if(!r)return[];const n=new Map;for(const i of r.messages)if(!(i.kind!=="agent"||!Array.isArray(i.sources)))for(const x of i.sources)(x.type==="file"||x.type==="report")&&n.set(x.ref,{ref:x.ref,description:x.description,type:x.type});return Array.from(n.values())},[r]),X=o.useMemo(()=>r?Ye(r.team.map(n=>({agentId:n.agentId,name:n.name,color:n.color,activityLog:n.activityLog}))):[],[r]),U=o.useMemo(()=>{if(!r)return[];const n=new Map;for(const i of r.messages)if(!(i.kind!=="agent"||!Array.isArray(i.sources)))for(const x of i.sources)x.type==="fact"&&n.set(x.ref,{ref:x.ref,description:x.description});return Array.from(n.values()).slice(0,8)},[r]),O=o.useMemo(()=>{if(!r)return[];const n=[];n.push({id:"goal",kind:"goal"}),n.push({id:"document",kind:"document"}),n.push({id:"cost",kind:"cost"}),n.push({id:"clock",kind:"clock"}),n.push({id:"cabinet",kind:"cabinet"}),n.push({id:"trash",kind:"trash"});for(const i of r.team)n.push({id:`agent:${i.agentId}`,kind:"agent",ref:i.agentId});for(const i of _)n.push({id:`file:${i.ref}`,kind:"file",ref:i.ref});for(const i of U)n.push({id:`fact:${i.ref}`,kind:"fact",ref:i.ref});for(const i of X)n.push({id:i.id,kind:"activity",ref:i.id});return K&&n.push({id:`q:${K.approvalId}`,kind:"question",ref:K.approvalId}),n},[r,_,U,X,K]),ne=o.useCallback(n=>k.cabinet.includes(n)||k.trash.includes(n)||k.permanentlyHidden.includes(n),[k]),ve=o.useCallback((n,i)=>i==="cabinet"?(g({...k,cabinet:[...new Set([...k.cabinet,n])],trash:k.trash.filter(x=>x!==n)}),!0):i==="trash"?(g({...k,trash:[...new Set([...k.trash,n])],cabinet:k.cabinet.filter(x=>x!==n)}),!0):!1,[k,g]),re=o.useCallback(n=>{g({...k,cabinet:k.cabinet.filter(i=>i!==n),trash:k.trash.filter(i=>i!==n)})},[k,g]),se=o.useCallback(()=>{g({...k,cabinetOpen:!k.cabinetOpen})},[k,g]),ie=o.useCallback(()=>{g({...k,trashOpen:!k.trashOpen})},[k,g]),ye=o.useCallback(n=>{g({...k,trash:k.trash.filter(i=>i!==n),permanentlyHidden:[...new Set([...k.permanentlyHidden,n])]})},[k,g]),Y=o.useCallback((n,i)=>{const x=w.width,M=w.height,$=x/2,P=M/2;if(n.kind==="goal")return{x:$-220,y:90,z:5,rotation:-1.2};if(n.kind==="document")return{x:$-240,y:P-220,z:4,rotation:.4};if(n.kind==="cost")return{x:x-130,y:90,z:6,rotation:2};if(n.kind==="clock")return{x:x-440,y:M-240,z:7,rotation:-1.5};if(n.kind==="cabinet")return{x:30,y:M-280,z:3,rotation:0};if(n.kind==="trash")return{x:x-130,y:M-220,z:13,rotation:0};if(n.kind==="question")return{x:$+120,y:200,z:30,rotation:-3};if(n.kind==="agent"){const N=i.filter(F=>F.kind==="agent").findIndex(F=>F.id===n.id),D=N%2,I=Math.floor(N/2);return{x:x-280+D*20,y:200+I*180+D*30,z:10+N,rotation:(N%2===0?-1:1)*(1.5+N*.5)}}if(n.kind==="file"){const N=i.filter(F=>F.kind==="file").findIndex(F=>F.id===n.id),D=N%2,I=Math.floor(N/2);return{x:60+D*30,y:180+I*180+D*25,z:8+N,rotation:(N%2===0?1:-1)*(2+N*.3)}}if(n.kind==="fact"){const N=i.filter(F=>F.kind==="fact").findIndex(F=>F.id===n.id),D=N%3,I=Math.floor(N/3);return{x:$-160+D*100+(I%2===0?0:25),y:M-280+I*80,z:12+N,rotation:(N%2===0?-1:1)*(4+N*.7)}}if(n.kind==="activity"){const N=i.filter(Z=>Z.kind==="activity").findIndex(Z=>Z.id===n.id),D=Math.max(4,Math.floor((x-120)/180)),I=N%D,F=Math.floor(N/D);return{x:40+I*180+(F%2===0?0:40),y:M-200-F*110,z:14+N,rotation:(N%2===0?-1:1)*(2+N*.3)}}return{x:100,y:100,z:1,rotation:0}},[w]),oe=o.useCallback(n=>S[n.id]??Y(n,O),[S,O,Y]),q=o.useCallback((n,i)=>{const x={...S,[n]:i};z(x)},[S,z]),ke=o.useCallback(n=>{const i=Math.max(0,...O.map(M=>(S[M.id]??Y(M,O)).z)),x=S[n]??Y(O.find(M=>M.id===n),O);x.z>=i||q(n,{...x,z:i+1})},[O,S,Y,q]),we=o.useCallback(()=>{t&&z({})},[t,z]),je=o.useCallback((n,i,x)=>{g({...k,cabinet:k.cabinet.filter(D=>D!==n),trash:k.trash.filter(D=>D!==n)});const M=Math.max(0,...O.map(D=>(S[D.id]??Y(D,O)).z)),$=S[n],P=($==null?void 0:$.rotation)??Math.random()*6-3,N=T(i,x);q(n,{x:N.x-80,y:N.y-20,z:M+1,rotation:P})},[k,g,O,S,Y,q,T]);if(d)return e.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-sm",style:{background:"var(--theme-bg-base, #3a2a1c)",color:"var(--theme-paper-fg, #f3e9d0)"},children:"Setting the desk…"});if(p||!r)return e.jsxs("div",{className:"absolute inset-0 flex items-center justify-center flex-col gap-3",style:{background:"var(--theme-bg-base, #3a2a1c)"},children:[e.jsx("div",{className:"text-[#ffb4a2] text-sm",children:p??"Mission not found."}),e.jsx("button",{onClick:()=>a("/mission"),className:"text-sm hover:underline",style:{color:"var(--theme-paper-fg, #f3e9d0)"},children:"← Start a new mission"})]});const{working:le,blocked:ce}=pe(r);return e.jsxs("div",{ref:f,className:"absolute inset-0 overflow-hidden font-sans",style:{...xt,color:"var(--theme-paper-fg, #f3e9d0)",fontFamily:"var(--theme-font-display, ui-sans-serif, system-ui)"},children:[e.jsx("div",{className:"pointer-events-none absolute inset-0",style:ht}),e.jsx("div",{className:"pointer-events-none absolute inset-0",style:ft}),e.jsxs("header",{className:"relative z-30 flex flex-wrap items-center justify-between gap-3 px-4 py-3 sm:px-5 sm:py-3.5",children:[e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-3",children:[e.jsx("button",{onClick:()=>a("/mission"),className:"hover:text-white text-sm",style:{color:"var(--theme-metal-bright, #e7d6a8)"},title:"New mission",children:"←"}),e.jsx("button",{onClick:()=>a("/mission/library"),className:"text-[10px] uppercase tracking-widest hover:text-white rounded-full px-2 py-0.5",style:{color:"var(--theme-ink-soft, #d9c08c)",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))"},title:"Browse past missions",children:"Library"}),e.jsx("button",{onClick:()=>a("/space/home"),className:"text-[10px] uppercase tracking-widest hover:text-white rounded-full px-2 py-0.5 inline-flex items-center gap-1",style:{color:"var(--theme-ink-soft, #d9c08c)",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))"},title:"Back to the canvas spaces",children:"🌌 Canvas"}),e.jsxs("div",{className:"min-w-0 font-semibold tracking-tight",style:{color:"var(--theme-paper-fg, #f3e9d0)"},children:[e.jsx("span",{style:{background:"linear-gradient(90deg, var(--theme-metal-bright, #f3d27a), var(--theme-metal, #d8a85a))",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"},children:"TITAN"}),e.jsx("span",{className:"font-normal",style:{color:"var(--theme-ink-soft, #d9c08c)"},children:" › "}),e.jsx("span",{className:"font-normal",style:{color:"var(--theme-metal-bright, #e7d6a8)"},children:"Desk"})]})]}),e.jsxs("div",{className:"flex min-w-0 flex-wrap items-center justify-start gap-2 sm:justify-end",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full text-xs",style:{background:"var(--theme-leather, rgba(42,29,17,0.7))",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))"},children:[e.jsx("span",{className:`w-2 h-2 rounded-full ${ce>0?"bg-error animate-pulse":le>0?"bg-accent animate-pulse":"bg-success"}`}),e.jsx("span",{style:{color:"var(--theme-metal-bright, #e7d6a8)"},children:bt(r.status,le,ce)})]}),r.longRunningMode&&e.jsx("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-semibold",style:{background:"linear-gradient(90deg, rgba(245,210,122,0.18), rgba(176,138,58,0.18))",border:"1px solid var(--theme-metal-dark, #b08a3a)",color:"var(--theme-metal-bright, #ffd86e)"},title:"Marathon mode — long-running multi-agent collaboration (72h cap)",children:"🏃 Marathon"}),e.jsx("button",{onClick:we,className:"px-3 py-1.5 text-xs rounded-full hover:text-white",style:{background:"var(--theme-leather, rgba(42,29,17,0.7))",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))",color:"var(--theme-metal-bright, #e7d6a8)"},title:"Reset every item to a sensible starting position",children:"Tidy up"}),e.jsx("button",{onClick:()=>a(`/mission/${r.id}`),className:"px-3 py-1.5 text-xs rounded-full hover:text-white",style:{background:"var(--theme-leather, rgba(42,29,17,0.7))",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))",color:"var(--theme-metal-bright, #e7d6a8)"},title:"Switch to the chat thread view",children:"Chat view"}),e.jsx("button",{onClick:ge,className:"px-3 py-1.5 text-xs rounded-full hover:text-white",style:{background:"var(--theme-leather, rgba(42,29,17,0.7))",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))",color:"var(--theme-metal-bright, #e7d6a8)"},children:r.status==="paused"?"Resume":"Pause"}),e.jsx("button",{onClick:be,className:"px-3 py-1.5 text-xs rounded-full hover:text-[#ff9c9c] hover:border-[#ff9c9c]/50 transition-colors",style:{background:"var(--theme-leather, rgba(42,29,17,0.7))",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))",color:"var(--theme-ink-soft, #d9c08c)"},title:"Delete this mission",children:"🗑 Delete"}),e.jsx("button",{onClick:()=>m(n=>!n),className:"w-8 h-8 rounded-full hover:text-white font-semibold text-sm flex items-center justify-center",style:{background:"var(--theme-leather, rgba(42,29,17,0.7))",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))",color:"var(--theme-metal-bright, #e7d6a8)"},title:"What's this?",children:"?"})]})]}),e.jsx(mt,{items:O,room:r,poseOf:oe,isHidden:ne}),e.jsx("div",{className:"absolute inset-0 z-10 pointer-events-none",children:O.map(n=>{if(ne(n.id))return null;const i=oe(n),x=n.kind==="agent",M=n.kind==="file"||n.kind==="fact"||n.kind==="activity";return e.jsx(Xe,{pose:i,onGrab:()=>ke(n.id),onPose:$=>q(n.id,$),onClick:x?($,P)=>G({agentId:n.ref,anchor:C($,P)}):void 0,onDrop:M?$=>ve(n.id,$):void 0,children:e.jsx(Ue,{item:n,room:r,openQuestion:K,fileSources:_,factSources:U,activityStickies:X,furniture:k,onOpenCabinet:se,onOpenTrash:ie,onOpenFile:te,onAnswer:me})},n.id)})}),k.cabinetOpen&&e.jsx(dt,{itemIds:k.cabinet,items:O,fileSources:_,factSources:U,activityStickies:X,onRestore:re,onRestoreAt:je,onOpenFile:te,onClose:se}),k.trashOpen&&e.jsx(ut,{itemIds:k.trash,items:O,fileSources:_,factSources:U,activityStickies:X,onRestore:re,onDeleteForever:ye,onClose:ie}),B&&(()=>{const n=r.team.find(x=>x.agentId===B.agentId);if(!n)return null;const i=E.map(x=>({id:x.id,label:x.name,provider:x.provider}));return e.jsx(Ee,{member:n,room:r,anchor:B.anchor,availableModels:i,onClose:()=>G(null)})})(),e.jsxs("footer",{className:"absolute left-0 right-0 bottom-0 z-30 px-3 pb-12 pt-3 sm:px-5 md:pb-8 flex flex-col gap-2",style:{background:"linear-gradient(to top, var(--theme-leather-edge, rgba(29,19,10,0.95)), transparent)"},children:[e.jsxs("div",{className:"flex max-h-24 flex-wrap items-center gap-2 overflow-y-auto pr-1 max-w-5xl mx-auto w-full sm:max-h-none sm:overflow-visible sm:pr-0",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-widest",style:{color:"var(--theme-ink-soft, #d9c08c)"},children:"quick steer"}),We.map(n=>e.jsx("button",{onClick:()=>ae(n.cmd),disabled:h,title:n.hint,className:"px-2.5 py-1 text-[11px] rounded-full hover:text-white disabled:opacity-50",style:{color:"var(--theme-metal-bright, #e7d6a8)",background:"var(--theme-leather, rgba(42,29,17,0.7))",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))"},children:n.label},n.cmd))]}),e.jsx("div",{className:"flex items-center gap-3 max-w-5xl mx-auto w-full",children:e.jsxs("form",{onSubmit:n=>{n.preventDefault(),ae(v)},className:"min-w-0 flex-1 h-11 flex items-center gap-2.5 px-3.5 rounded-full",style:{background:"var(--theme-leather, rgba(42,29,17,0.8))",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))"},children:[e.jsx("input",{value:v,onChange:n=>y(n.target.value),placeholder:'Tell the team — "Add a one-line risk note at the top"',className:"min-w-0 flex-1 bg-transparent outline-none text-sm placeholder:text-[#d9c08c]/50",style:{color:"var(--theme-paper-fg, #f3e9d0)"}}),e.jsx("span",{className:"px-2 py-1 text-[10px] uppercase tracking-widest rounded",style:{color:"var(--theme-ink-soft, #d9c08c)",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))"},children:"↵"})]})}),e.jsx("div",{className:"max-w-5xl mx-auto w-full text-center text-[11px] italic",style:{color:"var(--theme-ink-soft, #d9c08c)",opacity:.7},children:"Your team works independently, but asks before risky or sensitive changes."})]}),J&&e.jsx(Le,{state:J,onClose:()=>V(null)}),c&&e.jsxs("div",{className:"absolute left-4 right-4 top-20 z-40 rounded-xl p-4 backdrop-blur-xl shadow-2xl sm:left-auto sm:right-5 sm:w-80",style:{background:"var(--theme-leather, rgba(42,29,17,0.95))",border:"1px solid var(--theme-metal-dark, rgba(138,106,58,0.6))"},children:[e.jsx("button",{onClick:()=>m(!1),className:"absolute top-3 right-3 hover:text-white text-sm",style:{color:"var(--theme-ink-soft, #d9c08c)"},children:"✕"}),e.jsx("h3",{className:"font-semibold text-sm mb-2",style:{color:"var(--theme-paper-fg, #f3e9d0)"},children:"The desk"}),e.jsxs("p",{className:"text-xs leading-relaxed mb-3",style:{color:"var(--theme-metal-bright, #e7d6a8)"},children:["Everything the team produces lands on this desk as a physical object. Drag anything anywhere. ",e.jsx("b",{children:"Tidy up"})," resets the layout if it gets cluttered."]}),e.jsxs("ul",{className:"space-y-2 text-xs",style:{color:"var(--theme-metal-bright, #e7d6a8)"},children:[e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{children:"📜"}),e.jsxs("span",{children:[e.jsx("b",{className:"text-white",children:"Leather placard"})," — your mission goal."]})]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{children:"📄"}),e.jsxs("span",{children:[e.jsx("b",{className:"text-white",children:"Paper sheets"})," — files the team wrote. Double-click to open."]})]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{children:"👤"}),e.jsxs("span",{children:[e.jsx("b",{className:"text-white",children:"Index cards"})," — each AI helper, showing what they're doing now."]})]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{children:"💡"}),e.jsxs("span",{children:[e.jsx("b",{className:"text-white",children:"Sticky notes"})," — facts the team picked up while working."]})]}),e.jsxs("li",{className:"flex gap-2",children:[e.jsx("span",{children:"📕"}),e.jsxs("span",{children:[e.jsx("b",{className:"text-white",children:"Pink card"})," — a question waiting on you."]})]})]})]}),e.jsx("style",{children:pt})]})}function Xe({pose:t,onGrab:a,onPose:r,onClick:s,onDrop:d,children:u}){const[p,l]=o.useState(null),v=p?{x:p.x,y:p.y}:{x:t.x,y:t.y},y=o.useCallback(h=>{if(h.pointerType==="mouse"&&h.button!==0||h.target.closest("[data-no-drag]"))return;h.preventDefault(),a();const c=h.currentTarget,m=h.clientX,f=h.clientY,w=h.pointerId,j=t.x,A=t.y;l({dx:0,dy:0,x:j,y:A});try{c.setPointerCapture(w)}catch{}const T=S=>{if(S.pointerId!==w)return;const L=S.clientX-m,z=S.clientY-f;l({dx:L,dy:z,x:j+L,y:A+z})},C=S=>{if(S.pointerId!==w)return;const L=S.clientX-m,z=S.clientY-f;window.removeEventListener("pointermove",T),window.removeEventListener("pointerup",C),window.removeEventListener("pointercancel",C);try{c.releasePointerCapture(w)}catch{}const k=j+L,R=A+z;if(l(null),!(Math.abs(L)>4||Math.abs(z)>4)){s&&s(S.clientX,S.clientY);return}if(d){const E=document.elementsFromPoint(S.clientX,S.clientY);for(const W of E){const B=W.closest("[data-drop-target]");if(!B||B.contains(c))continue;const G=B.getAttribute("data-drop-target");if(G){if(d(G)!==!1)return;break}}}r({...t,x:k,y:R})};window.addEventListener("pointermove",T),window.addEventListener("pointerup",C),window.addEventListener("pointercancel",C)},[t,a,r,s,d]);return e.jsx("div",{onPointerDown:y,className:"absolute select-none pointer-events-auto cursor-grab touch-none active:cursor-grabbing",style:{left:v.x,top:v.y,zIndex:p?999:t.z,transform:`rotate(${t.rotation}deg) ${p?"scale(1.03)":""}`,transition:p?"transform 80ms ease-out":"transform 200ms ease-out",filter:p?"drop-shadow(0 22px 32px rgba(0,0,0,0.55))":"drop-shadow(0 6px 14px rgba(0,0,0,0.42))",willChange:p?"left, top":void 0},children:u})}function Ue({item:t,room:a,openQuestion:r,fileSources:s,factSources:d,activityStickies:u,furniture:p,onOpenCabinet:l,onOpenTrash:v,onOpenFile:y,onAnswer:h}){if(t.kind==="goal")return e.jsx(qe,{goal:a.goal,status:a.status});if(t.kind==="document")return e.jsx(Ve,{room:a});if(t.kind==="cost")return e.jsx(Ze,{room:a});if(t.kind==="clock")return e.jsx(Qe,{room:a});if(t.kind==="cabinet")return e.jsx(lt,{count:p.cabinet.length,onOpen:l});if(t.kind==="trash")return e.jsx(ct,{count:p.trash.length,onOpen:v});if(t.kind==="agent"){const b=a.team.find(c=>c.agentId===t.ref);return b?e.jsx(tt,{member:b}):null}if(t.kind==="file"){const b=s.find(c=>c.ref===t.ref);return b?e.jsx(nt,{file:b,onOpen:()=>y(b.ref)}):null}if(t.kind==="fact"){const b=d.find(c=>c.ref===t.ref);return b?e.jsx(rt,{fact:b}):null}if(t.kind==="activity"){const b=u.find(c=>c.id===t.ref);return b?e.jsx(st,{sticky:b}):null}return t.kind==="question"&&r?e.jsx(ot,{msg:r,onAnswer:b=>h(r.approvalId,b)}):null}function qe({goal:t,status:a}){const r={forming:{text:"forming the team…",dotColor:"#c4a14a",dotGlow:"#c4a14a"},working:{text:"in progress — TITAN",dotColor:"#8ed1ff",dotGlow:"#8ed1ff"},paused:{text:"paused — your call",dotColor:"#d9c08c",dotGlow:"#d9c08c"},blocked:{text:"needs your input",dotColor:"#ff9c9c",dotGlow:"#ff9c9c"},done:{text:"complete · signed off",dotColor:"#22c55e",dotGlow:"#22c55e"},failed:{text:"stopped — see chat",dotColor:"#ef4444",dotGlow:"#ef4444"}},s=r[a]??r.working;return e.jsxs("div",{className:"w-[420px] px-5 py-4 relative",style:{background:"linear-gradient(140deg, var(--theme-leather, #6b2c2a) 0%, var(--theme-leather-edge, #4a1816) 60%, var(--theme-bolt, #3b110f) 100%)",border:"1px solid var(--theme-bolt, #2a0908)",borderRadius:10,boxShadow:"inset 0 0 24px var(--theme-shadow, rgba(0,0,0,0.5)), 0 0 0 4px rgba(0,0,0,0.08), 0 0 32px color-mix(in srgb, var(--theme-accent, #c45a30) 28%, transparent)",backgroundBlendMode:"multiply",color:"var(--theme-paper-fg, #f3e9d0)"},children:[e.jsx("div",{className:"text-[10px] uppercase mb-1.5",style:{letterSpacing:"0.16em",color:"var(--theme-ink-soft, #d9c08c)",fontWeight:600},children:"Active Mission"}),e.jsx("div",{className:"leading-snug font-semibold tracking-tight",style:{fontSize:22,color:"var(--theme-paper-fg, #f3e9d0)"},children:t}),e.jsxs("div",{className:"mt-2 flex items-center gap-2 text-[10px] uppercase tracking-widest",style:{color:"var(--theme-ink-soft, rgba(217,192,140,0.7))"},children:[e.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${a==="working"||a==="blocked"||a==="forming"?"animate-pulse":""}`,style:{background:s.dotColor,boxShadow:`0 0 6px ${s.dotGlow}`}}),e.jsx("span",{children:s.text})]})]})}function Ve({room:t}){var y;const a=((y=t.artifact)==null?void 0:y.content)??"",r=o.useRef(a.length),[s,d]=o.useState(!1);o.useEffect(()=>{if(a.length>r.current){d(!0);const h=setTimeout(()=>d(!1),2e3);return r.current=a.length,()=>clearTimeout(h)}r.current=a.length},[a]);const u=o.useMemo(()=>a.split(`
|
|
6
|
+
`).filter(b=>b.trim().length>0).slice(0,10),[a]),p=a.trim().split(/\s+/).filter(Boolean).length,l=t.team.some(h=>h.state==="working"||h.state==="editing"),v=l&&t.team.some(h=>(h.state==="working"||h.state==="editing")&&(h.name.toLowerCase().includes("analyst")||(h.role??"").toLowerCase().includes("analyst")));return e.jsxs("div",{className:"w-[620px] max-w-[92vw] rounded-md p-8 pt-7 relative",style:{background:"var(--theme-paper, #f7f5ee)",color:"var(--theme-ink, #1a1f2e)",fontFamily:'var(--theme-font-display, "Iowan Old Style", "Charter", "Georgia", serif)',backgroundImage:"repeating-linear-gradient(180deg, transparent 0 26px, var(--theme-paper-line, #d8d3c2) 26px 27px)",backgroundPosition:"0 56px",boxShadow:"0 18px 40px var(--theme-shadow, rgba(0,0,0,0.45)), 0 6px 14px var(--theme-shadow, rgba(0,0,0,0.35)), 0 0 0 1px color-mix(in srgb, var(--theme-accent, #c45a30) 12%, transparent)"},children:[e.jsx("h1",{className:"text-[22px] font-semibold tracking-tight leading-tight mb-1",children:yt(t.goal,70)}),e.jsxs("div",{className:"text-[11px] uppercase tracking-widest mb-4 flex items-center gap-2",style:{color:"var(--theme-ink-soft, #8a8472)"},children:[e.jsxs("span",{children:["Draft · ",p," words · ",vt(t.status)]}),s&&l&&e.jsxs("span",{className:"inline-flex items-center gap-1",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full animate-pulse",style:{background:"var(--theme-accent, #c4a35a)"}}),e.jsx("span",{className:"text-[10px] italic",children:"Writing…"})]})]}),u.length>0?e.jsx("div",{className:"text-[14px] leading-[1.6] space-y-3",children:u.map((h,b)=>e.jsxs("p",{children:[h,s&&l&&b===u.length-1&&e.jsx("span",{className:"inline-block w-0.5 h-3.5 ml-0.5 align-middle animate-pulse",style:{background:"var(--theme-accent, #c4a35a)"}})]},b))}):e.jsx("div",{className:"text-[12px] italic py-6 text-center",style:{color:"var(--theme-ink-soft, #8a8472)"},children:"The team is just getting started — your document fills in as they work."}),v&&e.jsx(Je,{})]})}function Je(){return e.jsxs("div",{className:"mt-5 pt-4",style:{borderTop:"1px dashed var(--theme-paper-line, #d8d3c2)"},children:[e.jsxs("svg",{viewBox:"0 0 320 110",className:"w-full h-[110px]","aria-hidden":!0,style:{overflow:"visible"},children:[e.jsx("line",{x1:"22",y1:"6",x2:"22",y2:"92",stroke:"var(--theme-ink-soft, #8a8472)",strokeWidth:"1",opacity:"0.5"}),e.jsx("line",{x1:"22",y1:"92",x2:"312",y2:"92",stroke:"var(--theme-ink-soft, #8a8472)",strokeWidth:"1",opacity:"0.5"}),[20,44,68].map(t=>e.jsx("line",{x1:"18",y1:t,x2:"22",y2:t,stroke:"var(--theme-ink-soft, #8a8472)",strokeWidth:"1",opacity:"0.35"},t)),[{x:40,h:52},{x:82,h:68},{x:124,h:32},{x:166,h:78},{x:208,h:46},{x:250,h:62},{x:292,h:40}].map((t,a)=>e.jsx("rect",{x:t.x-12,y:92-t.h,width:24,height:t.h,fill:"none",stroke:"var(--theme-accent, #c45a30)",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.55",style:{animation:"tetherFlow 2.4s linear infinite"}},a))]}),e.jsx("div",{className:"text-[11px] italic mt-1 text-center",style:{color:"var(--theme-ink-soft, #8a8472)"},children:"Analyst computing…"})]})}function Ze({room:t}){return e.jsxs("div",{className:"w-[110px] h-[110px] rounded-full flex flex-col items-center justify-center",style:{background:"radial-gradient(circle at 35% 30%, var(--theme-leather, #2b1a14) 0%, var(--theme-leather-edge, #1a0e08) 70%)",boxShadow:"inset 0 0 18px var(--theme-shadow, rgba(0,0,0,0.6)), 0 0 0 5px var(--theme-metal-dark, #6e4a26), 0 0 0 6px var(--theme-bolt, #382213)",color:"var(--theme-paper-fg, #f3e9d0)"},title:"Tokens + dollars spent this mission",children:[e.jsx("span",{className:"text-[9px] uppercase tracking-widest",style:{color:"var(--theme-ink-soft, #d9c08c)"},children:"spent"}),e.jsxs("span",{className:"text-[20px] font-bold tabular-nums",children:["$",t.cost.usd.toFixed(2)]}),e.jsxs("span",{className:"text-[9px] tabular-nums",style:{color:"var(--theme-ink-soft, rgba(217,192,140,0.8))"},children:[(t.cost.tokens/1e3).toFixed(1),"k tok"]})]})}function Qe({room:t}){const[a,r]=o.useState(()=>new Date);o.useEffect(()=>{const m=setInterval(()=>r(new Date),1e3);return()=>clearInterval(m)},[]);const s=String(a.getHours()).padStart(2,"0"),d=String(a.getMinutes()).padStart(2,"0"),u=String(a.getSeconds()).padStart(2,"0"),p=o.useMemo(()=>{try{const m=new Intl.DateTimeFormat(void 0,{timeZoneName:"short"}).formatToParts(new Date).find(f=>f.type==="timeZoneName");return(m==null?void 0:m.value)??""}catch{return""}},[]),l=o.useMemo(()=>new Date(t.createdAt).getTime(),[t.createdAt]),v=t.status==="paused"||t.status==="done"||t.status==="failed",y=v?Math.max(0,new Date(t.updatedAt).getTime()-l):Math.max(0,a.getTime()-l),h=et(y),{working:b,blocked:c}=pe(t);return e.jsxs("div",{className:"w-[260px] p-4 pb-3",style:{background:"radial-gradient(ellipse at 30% 25%, var(--theme-leather, #4a2e18) 0%, var(--theme-bolt, #2a1808) 75%, var(--theme-leather-edge, #1a0e04) 100%)",borderRadius:14,boxShadow:"0 0 0 3px var(--theme-metal-dark, #b08a3a), 0 0 0 5px var(--theme-bolt, #5a3a14), 0 12px 22px var(--theme-shadow, rgba(0,0,0,0.5)), inset 0 0 16px rgba(0,0,0,0.6)",color:"var(--theme-metal-bright, #f5d27a)"},children:[e.jsxs("div",{className:"text-[9px] uppercase tracking-[0.28em] text-center mb-1.5",style:{color:"var(--theme-metal, #c4a14a)"},children:["TITAN",p?" · "+p:""]}),e.jsxs("div",{className:"flex items-baseline justify-center gap-1 mb-1",style:{fontFamily:'"DSEG7 Classic", "Orbitron", "Menlo", monospace',textShadow:"0 0 10px rgba(245,210,122,0.65), 0 0 22px rgba(245,210,122,0.35)"},children:[e.jsx(xe,{value:s}),e.jsx("span",{className:"text-[28px] font-bold opacity-80 -translate-y-0.5 animate-pulse",children:":"}),e.jsx(xe,{value:d}),e.jsx("span",{className:"text-[20px] font-bold opacity-60 -translate-y-0.5",children:":"}),e.jsx("span",{className:"text-[24px] font-bold opacity-80 tabular-nums",children:u})]}),e.jsxs("div",{className:"text-center text-[10px] uppercase tracking-[0.22em] mb-1.5",style:{fontFamily:"system-ui",color:"var(--theme-metal, rgba(196,161,74,0.85))"},children:["Mission · ",h.hh,":",h.mm,":",h.ss,v&&e.jsxs("span",{className:"ml-1.5",style:{color:"var(--theme-ink-soft, rgba(217,192,140,0.7))"},children:["· ",t.status]})]}),e.jsxs("div",{className:"flex items-center justify-center gap-3 pt-2",style:{fontFamily:"system-ui",borderTop:"1px solid var(--theme-bolt, rgba(90,58,20,0.6))"},children:[e.jsx(Q,{n:b,label:"working",tone:"accent"}),e.jsx(Q,{n:c,label:c===1?"needs you":"need you",tone:"warn"}),e.jsx(Q,{n:t.team.length,label:"on team",tone:"muted"})]})]})}function xe({value:t}){return e.jsx("span",{className:"text-[34px] font-bold tabular-nums leading-none",children:t})}function Q({n:t,label:a,tone:r}){const s=r==="accent"?"#8ed1ff":r==="warn"?"#ff9c9c":"var(--theme-metal, #c4a14a)";return e.jsxs("div",{className:"flex flex-col items-center leading-tight",children:[e.jsx("span",{className:"text-[18px] font-bold tabular-nums",style:{color:s},children:t}),e.jsx("span",{className:"text-[9px] uppercase tracking-widest",style:{color:"var(--theme-metal, rgba(196,161,74,0.8))"},children:a})]})}function et(t){const a=Math.floor(t/1e3),r=String(Math.floor(a/3600)).padStart(2,"0"),s=String(Math.floor(a%3600/60)).padStart(2,"0"),d=String(a%60).padStart(2,"0");return{hh:r,mm:s,ss:d}}function tt({member:t}){const a=t.state==="blocked",r=t.state==="editing",s=t.state==="working",d=t.state==="done",u=s||r,p=at(t.color,a),l=u?`${t.agentId.charCodeAt(0)%10*.34}s`:"0s",v=a?"stickyBreatheUrgent 1.2s ease-in-out infinite":s?"stickyBreathe 1.8s ease-in-out infinite":r?"stickyBreathe 2.4s ease-in-out infinite":"none",y=d?.65:1,h=jt(t.state),b=t.currentActivity??(d?"wrapped up":a?"awaiting your call":"standing by");return e.jsxs("div",{className:"w-[220px] p-3.5 pt-5 text-[#2a2418] relative",style:{background:p,boxShadow:"0 1px 0 rgba(255,255,255,0.55) inset, 0 12px 18px rgba(0,0,0,0.42)",fontFamily:'"Bradley Hand", "Marker Felt", "Comic Sans MS", cursive',animation:v,animationDelay:l,opacity:y,transition:"opacity 400ms ease-out"},children:[e.jsx("div",{className:"absolute -top-1.5 left-1/2 -translate-x-1/2 w-20 h-4 opacity-70 pointer-events-none",style:{background:"linear-gradient(180deg, rgba(255,255,255,0.75), rgba(255,255,255,0.25))",boxShadow:"0 1px 2px rgba(0,0,0,0.15)"}}),e.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[e.jsx("div",{className:"w-7 h-7 rounded-md flex items-center justify-center text-white font-bold text-[13px]",style:{background:`linear-gradient(135deg, ${t.color}, ${Nt(t.color,-25)})`,boxShadow:`0 2px 6px ${t.color}55`,fontFamily:"system-ui"},children:t.name[0]}),e.jsxs("div",{className:"leading-tight",children:[e.jsx("div",{className:"font-semibold text-[15px] text-[#2a2418]",children:t.name}),e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-[#6b5a3a]",style:{fontFamily:"system-ui"},children:t.role})]}),e.jsxs("div",{className:"ml-auto flex items-center gap-1 text-[10px] text-[#6b5a3a]",style:{fontFamily:"system-ui"},children:[d?e.jsx("span",{className:"text-[12px] leading-none","aria-label":"done",children:"✓"}):e.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${kt(t.state)}`,style:{boxShadow:`0 0 6px ${wt(t.state)}`}}),e.jsx("span",{children:h})]})]}),e.jsx("div",{className:"text-[14px] text-[#2a2418] leading-snug min-h-[2.4rem] break-words",children:t.currentActivity??e.jsx("span",{className:"italic text-[#6b5a3a]",children:b})}),(u||a)&&e.jsx("div",{className:"absolute -inset-1 -z-10 pointer-events-none rounded-[2px] blur-md",style:{background:a?"radial-gradient(circle at 50% 50%, rgba(239,68,68,0.6), transparent 70%)":`radial-gradient(circle at 30% 30%, ${t.color}55, transparent 70%)`,animation:a?"deskAlarm 1.2s ease-in-out infinite":"deskGlow 4.2s ease-in-out infinite"}})]})}function at(t,a){if(a)return"linear-gradient(165deg, #ffd6d6 0%, #ffbaba 100%), linear-gradient(45deg, transparent 49%, rgba(0,0,0,0.04) 49% 51%, transparent 51%)";const r=t.toLowerCase();return r.includes("6366f1")||r.includes("8b5cf6")?"linear-gradient(160deg, #e7e1ff 0%, #cfc4ff 100%)":r.includes("22c55e")||r.includes("10b981")?"linear-gradient(160deg, #d9f7d9 0%, #b8edb8 100%)":r.includes("f59e0b")||r.includes("eab308")?"linear-gradient(160deg, #fff2a8 0%, #ffe88a 100%)":r.includes("ef4444")||r.includes("f97316")?"linear-gradient(160deg, #ffd6c2 0%, #ffbf9e 100%)":r.includes("06b6d4")||r.includes("0ea5e9")?"linear-gradient(160deg, #cef3f7 0%, #a8e4ec 100%)":"linear-gradient(160deg, #fff2a8 0%, #ffe88a 100%)"}function nt({file:t,onOpen:a}){const r=o.useMemo(()=>{const s=t.ref.lastIndexOf("/");return s>=0?t.ref.slice(s+1):t.ref},[t.ref]);return e.jsxs("div",{onDoubleClick:a,title:"Double-click to open",className:"w-[200px] p-3",style:{background:"linear-gradient(170deg, var(--theme-paper, #fdfbf3) 0%, var(--theme-paper, #f1eada) 100%)",color:"var(--theme-ink, #1a1f2e)",borderRadius:4,boxShadow:"0 1px 0 rgba(255,255,255,0.6) inset, 0 0 0 1px rgba(0,0,0,0.06)"},children:[e.jsx("div",{className:"absolute top-0 right-0 w-4 h-4",style:{background:"linear-gradient(225deg, var(--theme-paper-line, #d8cdb3) 0%, var(--theme-paper, #f1eada) 50%, transparent 50%)",borderBottomLeftRadius:4}}),e.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[e.jsx("span",{className:"text-base leading-none",children:t.type==="report"?"📊":"📄"}),e.jsx("span",{className:"text-[9px] uppercase tracking-widest",style:{color:"var(--theme-ink-soft, #8a8472)"},children:t.type})]}),e.jsx("div",{className:"font-semibold text-[12px] leading-tight break-words",style:{color:"var(--theme-ink, #1a1f2e)"},children:r}),t.description&&e.jsx("div",{className:"text-[10px] mt-1 leading-snug line-clamp-2",style:{color:"var(--theme-ink-soft, #5a5240)"},children:t.description}),e.jsx("button",{"data-no-drag":!0,onClick:a,className:"mt-2 w-full px-2 py-1 text-[10px] font-semibold uppercase tracking-widest rounded",style:{background:"var(--theme-ink, #1a1f2e)",color:"var(--theme-paper-fg, #f3e9d0)"},children:"Open ↗"})]})}function rt({fact:t}){const a=t.description??t.ref;return e.jsxs("div",{className:"w-[160px] p-3",style:{background:"linear-gradient(160deg, var(--theme-sticky-yellow, #fff2a8) 0%, var(--theme-sticky-yellow, #ffe88a) 100%)",boxShadow:"0 1px 0 rgba(255,255,255,0.5) inset, 0 8px 14px var(--theme-shadow, rgba(0,0,0,0.35))",fontFamily:'"Bradley Hand", "Comic Sans MS", cursive',color:"var(--theme-ink, #3a2e10)"},children:[e.jsx("div",{className:"absolute -top-2 left-1/2 -translate-x-1/2 w-12 h-3.5 opacity-60",style:{background:"linear-gradient(180deg, var(--theme-sticky-tape, rgba(255,255,255,0.65)), rgba(255,255,255,0.25))"}}),e.jsx("div",{className:"text-[12px] leading-snug",children:a})]})}function st({sticky:t}){const a=it(t.agentColor),r=t.count>1,s=r?`${t.agentName} · ${t.activity} × ${t.count}
|
|
7
|
+
latest: ${t.recentDetails[0]??"(no detail)"}
|
|
8
|
+
`+(t.recentDetails.length>1?`prior: ${t.recentDetails.slice(1).join(" · ")}
|
|
9
|
+
`:"")+`most recent at ${new Date(t.at).toLocaleTimeString()}`:`${t.agentName} ${t.activity}${t.detail?": "+t.detail:""} · ${new Date(t.at).toLocaleTimeString()}`;return e.jsxs("div",{className:"w-[170px] p-2.5 relative",title:s,style:{background:a,boxShadow:"0 1px 0 rgba(255,255,255,0.55) inset, 0 6px 10px var(--theme-shadow, rgba(0,0,0,0.32))",fontFamily:'"Bradley Hand", "Marker Felt", "Comic Sans MS", cursive',color:"var(--theme-ink, #2a2418)"},children:[e.jsx("div",{className:"absolute -top-1.5 left-1/2 -translate-x-1/2 w-10 h-3 opacity-60 pointer-events-none",style:{background:"linear-gradient(180deg, var(--theme-sticky-tape, rgba(255,255,255,0.7)), rgba(255,255,255,0.25))"}}),r&&e.jsxs("div",{className:"absolute -top-2 -right-2 min-w-[22px] h-[22px] px-1.5 rounded-full flex items-center justify-center text-[11px] font-semibold pointer-events-none",style:{background:"var(--theme-metal-dark, #5a4818)",color:"var(--theme-sticky-yellow, #fff8c8)",boxShadow:"0 1px 3px rgba(0,0,0,0.35)",fontFamily:"system-ui"},"aria-label":`${t.count} repeated activities`,children:["×",t.count]}),e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("span",{className:"text-base leading-none",children:t.icon}),e.jsx("span",{className:"text-[10px] uppercase tracking-widest truncate",style:{fontFamily:"system-ui",color:"var(--theme-ink-soft, #6b5a3a)"},children:t.agentName})]}),e.jsx("div",{className:"text-[12px] leading-snug",children:t.activity}),t.detail&&e.jsxs("div",{className:"text-[11px] mt-1 leading-snug break-words line-clamp-3",style:{color:"var(--theme-ink-soft, #5a4818)"},children:[r?e.jsx("span",{style:{color:"var(--theme-ink-soft, #5a4818)",opacity:.7},children:"latest: "}):null,t.detail]})]})}function it(t){const a=t.toLowerCase();return a.includes("6366f1")||a.includes("8b5cf6")?"linear-gradient(160deg, #efeaff 0%, #e0d5ff 100%)":a.includes("22c55e")||a.includes("10b981")||a.includes("4adbb5")?"linear-gradient(160deg, #e7faea 0%, #cef0d4 100%)":a.includes("f59e0b")||a.includes("eab308")||a.includes("ff9a4a")?"linear-gradient(160deg, #fff8c8 0%, #ffefa3 100%)":a.includes("ef4444")||a.includes("f97316")||a.includes("ff5d6c")?"linear-gradient(160deg, #ffe2d4 0%, #ffcfba 100%)":a.includes("06b6d4")||a.includes("0ea5e9")||a.includes("6ea8ff")?"linear-gradient(160deg, #e0f5fa 0%, #c5e9f1 100%)":"linear-gradient(160deg, #fff8c8 0%, #ffefa3 100%)"}function ot({msg:t,onAnswer:a}){const[r,s]=o.useState(!1),[d,u]=o.useState(""),p=o.useRef(null);return o.useEffect(()=>{r&&p.current&&p.current.focus()},[r]),e.jsxs("div",{className:"w-[300px] p-4 rounded-xl",style:{background:"linear-gradient(180deg, var(--theme-sticky-pink, #ffe9eb), var(--theme-sticky-pink, #ffd0d4))",boxShadow:"0 18px 36px rgba(255,93,108,0.45), 0 0 0 1.5px var(--theme-accent, rgba(196,90,48,0.6)), 0 0 0 4px rgba(255,93,108,0.12)",animation:"questionLift 4s ease-in-out infinite",color:"#5c1820",transform:"translateY(-10px)"},children:[e.jsx("div",{className:"absolute -top-2 -right-2 w-5 h-5 rounded-full",style:{background:"radial-gradient(circle at 35% 30%, var(--theme-metal-bright, #ffd86e) 0%, var(--theme-metal-dark, #b07a1a) 70%, var(--theme-bolt, #6a4710) 100%)",boxShadow:"0 2px 4px var(--theme-shadow, rgba(0,0,0,0.5))"}}),e.jsxs("div",{className:"text-[10px] uppercase mb-1.5",style:{letterSpacing:"0.16em",color:"rgba(92,24,32,0.7)",fontWeight:600},children:[t.from.name," asks"]}),e.jsxs("div",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 mb-2 bg-[#5c1820] text-[#ffd0d4] text-[10px] uppercase tracking-widest font-bold rounded-full",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-white animate-pulse"}),"TITAN paused — your call."]}),e.jsx("div",{className:"text-[13px] leading-snug",children:t.content}),r?e.jsxs("div",{className:"mt-3",children:[e.jsx("textarea",{ref:p,"data-no-drag":!0,value:d,onChange:l=>u(l.target.value),onKeyDown:l=>{if(l.key==="Enter"&&(l.metaKey||l.ctrlKey)){l.preventDefault();const v=d.trim();v&&a(v)}else l.key==="Escape"&&s(!1)},rows:2,placeholder:"Your answer…",className:"w-full bg-white/90 border border-[rgba(160,41,56,0.25)] rounded-lg p-2 text-[12px] text-[#5c1820] outline-none"}),e.jsxs("div",{className:"flex items-center justify-end gap-2 mt-1",children:[e.jsx("button",{"data-no-drag":!0,onClick:()=>s(!1),className:"text-[10px] text-[#5c1820]/70 hover:text-[#5c1820]",children:"cancel"}),e.jsx("button",{"data-no-drag":!0,onClick:()=>{const l=d.trim();l&&a(l)},disabled:!d.trim(),className:"px-2 py-0.5 rounded text-[11px] font-semibold disabled:opacity-50 text-[var(--theme-paper,#f3e9d0)] bg-[var(--theme-ink,#1a1f2e)]",children:"Send"})]})]}):e.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[t.quickReplies.map((l,v)=>e.jsx("button",{"data-no-drag":!0,onClick:()=>a(l),className:`px-2.5 py-1 rounded-lg text-[11px] font-semibold border ${v===t.quickReplies.length-1?"border-transparent text-[var(--theme-paper,#f3e9d0)] bg-[var(--theme-ink,#1a1f2e)]":"bg-white border-[rgba(160,41,56,0.25)] text-[#5c1820]"}`,children:l},l)),e.jsx("button",{"data-no-drag":!0,onClick:()=>s(!0),className:"px-2.5 py-1 rounded-lg text-[11px] font-medium underline underline-offset-2 text-[#5c1820]/80 hover:text-[#5c1820]",children:"or type…"})]})]})}function lt({count:t,onOpen:a}){return e.jsxs("div",{"data-drop-target":"cabinet",className:"w-[140px] flex flex-col",style:{color:"var(--theme-metal-bright, #f5d27a)"},title:t>0?`${t} filed — click to open`:"Drop files & notes here",children:[e.jsx("button",{"data-no-drag":!0,onClick:a,className:"text-left flex flex-col gap-1 p-0 bg-transparent border-none",children:[0,1].map(r=>e.jsxs("div",{className:"relative w-full h-[58px] flex items-center justify-center",style:{background:"linear-gradient(180deg, var(--theme-leather, #5a3a18) 0%, var(--theme-leather-edge, #3a230b) 100%), repeating-linear-gradient(90deg, rgba(255,180,90,0.05) 0px, rgba(60,30,10,0.08) 2px)",border:"1px solid var(--theme-bolt, #2a1808)",boxShadow:"inset 0 -2px 0 rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.08) inset"},children:[e.jsx("div",{className:"px-3 py-0.5 text-[10px] uppercase tracking-widest font-bold",style:{background:"linear-gradient(180deg, var(--theme-metal-bright, #ffd86e) 0%, var(--theme-metal-dark, #b07a1a) 100%)",borderRadius:2,boxShadow:"0 1px 2px var(--theme-shadow, rgba(0,0,0,0.4))",color:"var(--theme-bolt, #3a2a10)"},children:r===0?"Files":"Drafts"}),e.jsx("div",{className:"absolute right-3 w-6 h-1.5 rounded",style:{background:"linear-gradient(180deg, var(--theme-metal-bright, #ffd86e) 0%, var(--theme-metal-dark, #8a5810) 100%)",boxShadow:"0 1px 2px var(--theme-shadow, rgba(0,0,0,0.5))"}})]},r))}),t>0&&e.jsxs("div",{className:"mt-1 text-center text-[10px] uppercase tracking-widest",style:{color:"var(--theme-ink-soft, #d9c08c)"},children:[t," ",t===1?"item":"items"," inside"]})]})}function ct({count:t,onOpen:a}){const r=Math.min(t,6);return e.jsxs("button",{type:"button","data-drop-target":"trash","data-no-drag":!0,onClick:a,className:"relative w-[110px] h-[120px] p-0 bg-transparent border-none cursor-pointer",title:t>0?`${t} tossed — click to open the bin`:"Drop notes here to toss them",children:[e.jsx("div",{className:"absolute inset-x-3 top-3 bottom-12 flex flex-wrap gap-1 items-end justify-center overflow-hidden",children:Array.from({length:r}).map((s,d)=>e.jsx("div",{className:"rounded-full",style:{width:18+d*5%14,height:18+d*7%12,background:"radial-gradient(circle at 35% 30%, var(--theme-paper, #fffaee) 0%, var(--theme-paper-line, #d6cdb1) 70%, var(--theme-ink-soft, #a99b71) 100%)",boxShadow:"inset -2px -2px 4px rgba(0,0,0,0.18), 0 1px 2px var(--theme-shadow, rgba(0,0,0,0.3))",transform:`rotate(${d*37%60-30}deg)`}},d))}),e.jsx("div",{className:"absolute left-2 right-2 bottom-0 h-[80px] overflow-hidden",style:{clipPath:"polygon(8% 0%, 92% 0%, 100% 100%, 0% 100%)",background:"repeating-linear-gradient(90deg, var(--theme-leather, #5a3a18) 0px, var(--theme-leather, #5a3a18) 2px, var(--theme-leather-edge, #3a230b) 2px, var(--theme-leather-edge, #3a230b) 4px),repeating-linear-gradient(0deg, transparent 0 6px, rgba(0,0,0,0.25) 6px 7px)",border:"1px solid var(--theme-bolt, #2a1808)",borderRadius:4,boxShadow:"inset 0 4px 8px var(--theme-shadow, rgba(0,0,0,0.5))"}}),e.jsx("div",{className:"absolute left-1 right-1 bottom-[78px] h-2.5 rounded-sm",style:{background:"linear-gradient(180deg, var(--theme-metal-dark, #6b4720) 0%, var(--theme-leather-edge, #3a230b) 100%)",border:"1px solid var(--theme-bolt, #1a0f05)",boxShadow:"inset 0 1px 0 rgba(255,255,255,0.1)"}}),t>0&&e.jsxs("div",{className:"absolute -bottom-5 left-1/2 -translate-x-1/2 text-[10px] uppercase tracking-widest whitespace-nowrap",style:{color:"var(--theme-ink-soft, #d9c08c)"},children:[t," tossed"]})]})}function dt({itemIds:t,items:a,fileSources:r,factSources:s,activityStickies:d,onRestore:u,onRestoreAt:p,onOpenFile:l,onClose:v}){const[y,h]=o.useState(null);o.useEffect(()=>{if(!y)return;const c=f=>{h(w=>w?{...w,x:f.clientX,y:f.clientY}:null)},m=f=>{p(y.itemId,f.clientX,f.clientY),h(null)};return window.addEventListener("mousemove",c),window.addEventListener("mouseup",m),()=>{window.removeEventListener("mousemove",c),window.removeEventListener("mouseup",m)}},[y,p]);function b(c,m,f,w){c.target.closest("[data-no-drag]")||(c.preventDefault(),h({itemId:m,label:f,icon:w,x:c.clientX,y:c.clientY}),v())}return e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-6",onClick:v,children:[e.jsxs("div",{className:"relative w-full max-w-2xl max-h-[80vh] flex flex-col rounded-2xl overflow-hidden",onClick:c=>c.stopPropagation(),style:{background:"linear-gradient(180deg, var(--theme-leather, #4a2e18) 0%, var(--theme-bolt, #2a1808) 100%)",boxShadow:"0 0 0 3px var(--theme-metal-dark, #b08a3a), 0 30px 60px var(--theme-shadow, rgba(0,0,0,0.6))",color:"var(--theme-metal-bright, #f5d27a)"},children:[e.jsxs("div",{className:"flex items-center gap-3 px-5 py-3",style:{borderBottom:"1px solid var(--theme-metal-dark, #6e4724)"},children:[e.jsx("span",{className:"text-2xl",children:"🗄️"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"text-sm font-semibold tracking-tight",children:"Filing cabinet"}),e.jsxs("div",{className:"text-[11px]",style:{color:"var(--theme-ink-soft, #d9c08c)"},children:[t.length," item",t.length===1?"":"s"," filed · drag a row out, or click ",e.jsx("b",{children:"to desk"})]})]}),e.jsx("button",{"data-no-drag":!0,onClick:v,className:"w-8 h-8 rounded-full hover:text-white flex items-center justify-center",style:{background:"var(--theme-leather-edge, #1a0f05)",border:"1px solid var(--theme-metal-dark, #6e4724)",color:"var(--theme-ink-soft, #d9c08c)"},children:"✕"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 flex flex-col gap-2",children:[t.length===0&&e.jsx("div",{className:"text-center py-12 italic",style:{color:"var(--theme-ink-soft, #d9c08c)"},children:"Nothing filed yet. Drag a file or sticky note onto the cabinet to file it."}),t.map(c=>{const m=a.find(C=>C.id===c);if(!m)return e.jsxs("div",{className:"flex items-center justify-between px-3 py-2 rounded-lg",style:{background:"var(--theme-leather-edge, rgba(26,15,5,0.4))",border:"1px solid var(--theme-metal-dark, rgba(110,71,36,0.5))",color:"var(--theme-ink-soft, rgba(217,192,140,0.7))"},children:[e.jsxs("span",{className:"text-xs italic",children:[c," (no longer in mission)"]}),e.jsx("button",{"data-no-drag":!0,onClick:()=>u(c),className:"text-[11px] hover:text-white",children:"remove"})]},c);const f=m.kind==="file"?r.find(C=>C.ref===m.ref):void 0,w=m.kind==="fact"?s.find(C=>C.ref===m.ref):void 0,j=m.kind==="activity"?d.find(C=>C.id===m.ref):void 0,A=f?f.type==="report"?"📊":"📄":w?"💡":j?j.icon:"📌",T=(f==null?void 0:f.ref)??(w==null?void 0:w.ref)??(j?`${j.agentName} · ${j.activity}`:c);return e.jsxs("div",{onMouseDown:C=>b(C,c,T,A),className:"flex items-center gap-3 px-3 py-2 rounded-lg transition-colors cursor-grab active:cursor-grabbing",style:{background:"var(--theme-leather-edge, rgba(26,15,5,0.4))",border:"1px solid var(--theme-metal-dark, rgba(110,71,36,0.5))"},title:"Drag out to place on the desk, or use the buttons →",children:[e.jsx("span",{className:"text-lg leading-none",children:A}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs truncate",style:{color:"var(--theme-metal-bright, #f5d27a)"},children:T}),((f==null?void 0:f.description)??(w==null?void 0:w.description))&&e.jsx("div",{className:"text-[10px] truncate",style:{color:"var(--theme-ink-soft, #d9c08c)"},children:(f==null?void 0:f.description)??(w==null?void 0:w.description)})]}),f&&e.jsx("button",{"data-no-drag":!0,onClick:()=>l(f.ref),className:"px-2 py-1 text-[10px] rounded hover:text-white",style:{background:"var(--theme-metal-dark, #6e4724)",border:"1px solid var(--theme-metal-dark, #b08a3a)",color:"var(--theme-metal-bright, #f5d27a)"},children:"Open ↗"}),e.jsx("button",{"data-no-drag":!0,onClick:()=>u(c),className:"px-2 py-1 text-[10px] rounded hover:text-white",style:{background:"var(--theme-leather-edge, #1a0f05)",border:"1px solid var(--theme-metal-dark, #6e4724)",color:"var(--theme-ink-soft, #d9c08c)"},children:"to desk"})]},c)})]})]}),y&&e.jsx("div",{className:"fixed z-[70] pointer-events-none",style:{left:y.x-80,top:y.y-20},children:e.jsxs("div",{className:"px-3 py-2 rounded text-xs flex items-center gap-2 shadow-2xl",style:{transform:"rotate(-2deg)",background:"var(--theme-paper, #fdfbf3)",color:"var(--theme-ink, #1a1f2e)"},children:[e.jsx("span",{children:y.icon}),e.jsx("span",{className:"font-semibold truncate max-w-[200px]",children:y.label})]})})]})}function ut({itemIds:t,items:a,fileSources:r,factSources:s,activityStickies:d,onRestore:u,onDeleteForever:p,onClose:l}){return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-6",onClick:l,children:e.jsxs("div",{className:"relative w-full max-w-2xl max-h-[80vh] flex flex-col rounded-2xl overflow-hidden text-[#f5d27a]",onClick:v=>v.stopPropagation(),style:{background:"linear-gradient(180deg, #4a2018 0%, #2a0e08 100%)",boxShadow:"0 0 0 3px #c46a52, 0 30px 60px var(--theme-shadow, rgba(0,0,0,0.6))"},children:[e.jsxs("div",{className:"flex items-center gap-3 px-5 py-3 border-b border-[#6e3024]",children:[e.jsx("span",{className:"text-2xl",children:"🗑️"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"text-sm font-semibold tracking-tight",children:"Wastebasket"}),e.jsxs("div",{className:"text-[11px] text-[#e9b09a]",children:[t.length," item",t.length===1?"":"s"," tossed ·",e.jsx("span",{className:"ml-1",children:"restore to desk, or delete forever"})]})]}),e.jsx("button",{onClick:l,className:"w-8 h-8 rounded-full bg-[#1a0a08] border border-[#6e3024] text-[#e9b09a] hover:text-white flex items-center justify-center",children:"✕"})]}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 flex flex-col gap-2",children:[t.length===0&&e.jsx("div",{className:"text-center py-12 text-[#e9b09a] italic",children:"Nothing in the bin. Drag a file, sticky, or activity onto the wastebasket to toss it."}),t.map(v=>{const y=a.find(j=>j.id===v),h=(y==null?void 0:y.kind)==="file"?r.find(j=>j.ref===y.ref):void 0,b=(y==null?void 0:y.kind)==="fact"?s.find(j=>j.ref===y.ref):void 0,c=(y==null?void 0:y.kind)==="activity"?d.find(j=>j.id===y.ref):void 0,m=h?h.type==="report"?"📊":"📄":b?"💡":c?c.icon:"📌",f=(h==null?void 0:h.ref)??(b==null?void 0:b.ref)??(c?`${c.agentName} · ${c.activity}`:v),w=(h==null?void 0:h.description)??(b==null?void 0:b.description)??(c==null?void 0:c.detail);return e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 bg-[#1a0a08]/60 border border-[#6e3024]/50 rounded-lg hover:bg-[#1a0a08]/80 transition-colors",title:y?"Restore to the desk or delete forever":"This item no longer exists in the mission",children:[e.jsx("span",{className:"text-lg leading-none opacity-70",children:m}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs text-[#f5d27a] truncate line-through decoration-[#c46a52]/50",children:f}),w&&e.jsx("div",{className:"text-[10px] text-[#e9b09a]/80 truncate",children:w})]}),e.jsx("button",{"data-no-drag":!0,onClick:()=>u(v),className:"px-2.5 py-1 text-[10px] bg-[#1a0a08] border border-[#6e3024] rounded text-[#e9b09a] hover:text-white hover:border-[#c46a52]",title:"Pull this item back out of the bin and put it on the desk",children:"↩ to desk"}),e.jsx("button",{"data-no-drag":!0,onClick:()=>{window.confirm(`Delete this forever?
|
|
10
|
+
|
|
11
|
+
"${f.slice(0,100)}${f.length>100?"…":""}"
|
|
12
|
+
|
|
13
|
+
The item will never reappear on the desk again, even after a reload. This is UI-only — the underlying mission file/note isn't deleted on disk.`)&&p(v)},className:"px-2.5 py-1 text-[10px] bg-[#3a0a08] border border-[#c46a52]/60 rounded text-[#ff9c9c] hover:text-white hover:bg-[#5a0e0a] hover:border-[#ff9c9c]",title:"Permanently hide this item — gone for good",children:"✕ Delete forever"})]},v)})]}),t.length>0&&e.jsx("div",{className:"px-5 py-2 border-t border-[#6e3024] text-center text-[10px] text-[#e9b09a]/70 uppercase tracking-widest",children:"tip: drag items onto the wastebasket from the desk · restore is non-destructive"})]})})}const xt={background:["radial-gradient(ellipse 120px 80px at 78% 28%, rgba(40,18,8,0.55) 0%, rgba(40,18,8,0) 70%)","radial-gradient(ellipse 90px 60px at 22% 72%, rgba(40,18,8,0.45) 0%, rgba(40,18,8,0) 75%)","repeating-linear-gradient(92deg, rgba(255,180,90,0.05) 0px, rgba(60,30,10,0.08) 3px, rgba(255,180,90,0.04) 7px, rgba(60,30,10,0.10) 11px, rgba(255,180,90,0.06) 16px)","repeating-linear-gradient(0deg, rgba(0,0,0,0.04) 0px, rgba(0,0,0,0) 2px, rgba(0,0,0,0.03) 4px)","linear-gradient(180deg, var(--theme-bg-base, #6e4724) 0%, var(--theme-bg-grain, #5a3717) 50%, var(--theme-leather-edge, #482a13) 100%)"].join(",")},ht={background:"radial-gradient(ellipse 80% 60% at 20% 0%, rgba(255,220,140,0.18) 0%, rgba(0,0,0,0) 55%)"},ft={background:"radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 50%, var(--theme-bg-vignette, rgba(0,0,0,0.45)) 100%)"},pt=`
|
|
14
|
+
@keyframes deskGlow {
|
|
15
|
+
0%, 100% { opacity: 0.5; }
|
|
16
|
+
50% { opacity: 0.8; }
|
|
17
|
+
}
|
|
18
|
+
@keyframes deskAlarm {
|
|
19
|
+
0%, 100% { opacity: 0.5; }
|
|
20
|
+
50% { opacity: 1; }
|
|
21
|
+
}
|
|
22
|
+
@keyframes deskFloat {
|
|
23
|
+
0%, 100% { transform: translateY(0); }
|
|
24
|
+
50% { transform: translateY(-3px); }
|
|
25
|
+
}
|
|
26
|
+
/* Phase 3 polish — Sage decision card sits ~10px elevated and
|
|
27
|
+
floats gently. Uses an offset baseline so the card stays raised
|
|
28
|
+
relative to the rest of the desk furniture. */
|
|
29
|
+
@keyframes questionLift {
|
|
30
|
+
0%, 100% { transform: translateY(-10px); }
|
|
31
|
+
50% { transform: translateY(-13px); }
|
|
32
|
+
}
|
|
33
|
+
/* v6.1.0-alpha.24 — gentle bob on working sticky notes. Lives on an
|
|
34
|
+
INNER wrapper so it composes with the parent Draggable's rotation
|
|
35
|
+
transform. */
|
|
36
|
+
@keyframes stickyBreathe {
|
|
37
|
+
0%, 100% { transform: translateY(0); }
|
|
38
|
+
50% { transform: translateY(-2.5px); }
|
|
39
|
+
}
|
|
40
|
+
/* Phase 2 polish — faster breath for "needs you" cards (1.2s). */
|
|
41
|
+
@keyframes stickyBreatheUrgent {
|
|
42
|
+
0%, 100% { transform: translateY(0); }
|
|
43
|
+
50% { transform: translateY(-3.5px); }
|
|
44
|
+
}
|
|
45
|
+
/* Phase 2 polish — generic bead-fade keyframe. Actual path travel
|
|
46
|
+
is implemented via SVG animateMotion + mpath in LivingDeskLayer
|
|
47
|
+
so it works without offset-path support. Kept as a fallback. */
|
|
48
|
+
@keyframes beadFlow {
|
|
49
|
+
0%, 100% { opacity: 0; }
|
|
50
|
+
10%, 90% { opacity: 0.9; }
|
|
51
|
+
}
|
|
52
|
+
/* Tether-line dash flow — animates stroke-dashoffset to give the
|
|
53
|
+
thread a moving-current feel. The dasharray defines the segment
|
|
54
|
+
pattern. */
|
|
55
|
+
@keyframes tetherFlow {
|
|
56
|
+
to { stroke-dashoffset: -20; }
|
|
57
|
+
}
|
|
58
|
+
/* Dust mote drift — slow vertical drift with a gentle horizontal
|
|
59
|
+
wobble. Two duration variants so motes don't tick in unison. */
|
|
60
|
+
@keyframes mote1 {
|
|
61
|
+
0% { transform: translate(0, 0) scale(1); opacity: 0; }
|
|
62
|
+
10% { opacity: 0.55; }
|
|
63
|
+
90% { opacity: 0.45; }
|
|
64
|
+
100% { transform: translate(14px, -90vh) scale(1.1); opacity: 0; }
|
|
65
|
+
}
|
|
66
|
+
@keyframes mote2 {
|
|
67
|
+
0% { transform: translate(0, 0) scale(0.9); opacity: 0; }
|
|
68
|
+
10% { opacity: 0.4; }
|
|
69
|
+
90% { opacity: 0.3; }
|
|
70
|
+
100% { transform: translate(-12px, -90vh) scale(1); opacity: 0; }
|
|
71
|
+
}
|
|
72
|
+
`;function mt({items:t,room:a,poseOf:r,isHidden:s}){const d=t.find(c=>c.kind==="document"),u=d&&!s(d.id)?r(d):null,p=o.useMemo(()=>{if(!u)return[];const c=[];for(const m of t){if(m.kind!=="agent"||s(m.id))continue;const f=a.team.find(w=>w.agentId===m.ref);f&&(f.paused||f.state!=="working"&&f.state!=="editing"||c.push({item:m,member:f,pose:r(m)}))}return c},[t,a.team,r,s,u]),l=p.length>0,v=220,y=110,h=620,b=300;return e.jsxs(e.Fragment,{children:[u&&p.length>0&&e.jsxs("svg",{className:"absolute inset-0 w-full h-full pointer-events-none",style:{zIndex:5},"aria-hidden":!0,children:[e.jsx("defs",{children:e.jsxs("radialGradient",{id:"tetherNodeGlow",children:[e.jsx("stop",{offset:"0%",stopColor:"var(--theme-metal-bright, #ffd86e)",stopOpacity:"0.9"}),e.jsx("stop",{offset:"100%",stopColor:"var(--theme-metal-bright, #ffd86e)",stopOpacity:"0"})]})}),p.map(({item:c,member:m,pose:f})=>{const w=f.x+v/2,j=f.y+y/2,A=u.x+h/2,T=u.y+b/2,C=(w+A)/2,S=(j+T)/2-40,L=`M ${w} ${j} Q ${C} ${S}, ${A} ${T}`,z=m.state==="editing"?"rgba(245, 158, 11, 0.55)":m.state==="blocked"?"rgba(239, 68, 68, 0.7)":"rgba(255, 216, 110, 0.55)",k=m.color,R=`tether-path-${c.id}`;return e.jsxs("g",{children:[e.jsx("path",{id:R,d:L,fill:"none",stroke:z,strokeWidth:1.4,strokeDasharray:"8 8",style:{animation:"tetherFlow 1.6s linear infinite"}}),e.jsx("circle",{cx:w,cy:j,r:14,fill:"url(#tetherNodeGlow)"}),e.jsx("circle",{r:3.2,fill:k,opacity:.95,children:e.jsx("animateMotion",{dur:"2.2s",repeatCount:"indefinite",children:e.jsx("mpath",{href:`#${R}`})})})]},c.id)})]}),l&&e.jsx("div",{className:"absolute inset-0 pointer-events-none overflow-hidden",style:{zIndex:6},"aria-hidden":!0,children:gt.map((c,m)=>e.jsx("span",{className:"absolute rounded-full",style:{left:`${c.left}vw`,bottom:`${-5+c.delay%12}vh`,width:c.size,height:c.size,background:"radial-gradient(circle at 35% 30%, rgba(255,250,235,0.85) 0%, rgba(212,196,158,0.4) 60%, rgba(0,0,0,0) 100%)",animation:`${m%2===0?"mote1":"mote2"} ${c.duration}s linear infinite`,animationDelay:`${c.delay}s`,filter:"blur(0.4px)"}},m))})]})}const gt=[{left:6,size:3,duration:28,delay:0},{left:14,size:2,duration:36,delay:3},{left:22,size:4,duration:30,delay:8},{left:30,size:2,duration:40,delay:1},{left:38,size:3,duration:26,delay:5},{left:46,size:3,duration:34,delay:11},{left:54,size:2,duration:38,delay:2},{left:62,size:4,duration:32,delay:7},{left:70,size:3,duration:30,delay:9},{left:78,size:2,duration:36,delay:4},{left:86,size:3,duration:28,delay:12},{left:94,size:4,duration:34,delay:6}];function pe(t){let a=0,r=0;for(const s of t.team)(s.state==="working"||s.state==="editing")&&a++,s.state==="blocked"&&r++;return{working:a,blocked:r}}function bt(t,a,r){return t==="paused"?"Paused":t==="done"?"Done":t==="failed"?"Stopped":r>0?`${a} working · ${r} needs you`:a>0?`${a} working`:t==="forming"?"Forming team…":"Idle"}function vt(t){return t==="paused"?"paused":t==="done"?"done":t==="failed"?"stopped":t==="blocked"?"waiting on you":"auto-saving"}function yt(t,a){return t.length<=a?t:t.slice(0,a-1)+"…"}function kt(t){switch(t){case"working":return"bg-accent animate-pulse";case"editing":return"bg-warning animate-pulse";case"blocked":return"bg-error animate-pulse";case"done":return"bg-success";default:return"bg-text-muted"}}function wt(t){switch(t){case"working":return"#6366f1";case"editing":return"#f59e0b";case"blocked":return"#ef4444";case"done":return"#22c55e";default:return"#71717a"}}function jt(t){return t==="working"?"working":t==="editing"?"editing":t==="blocked"?"needs you":t==="done"?"done":"idle"}function Nt(t,a){const r=t.replace("#","");if(r.length!==6)return t;const s=parseInt(r,16);let d=s>>16&255,u=s>>8&255,p=s&255;const l=Math.round(255*(a/100));return d=Math.max(0,Math.min(255,d+l)),u=Math.max(0,Math.min(255,u+l)),p=Math.max(0,Math.min(255,p+l)),"#"+(d<<16|u<<8|p).toString(16).padStart(6,"0")}export{$t as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as o,j as e,R as E,p as q,u as W}from"./index-
|
|
1
|
+
import{r as o,j as e,R as E,p as q,u as W}from"./index-CfeeNofL.js";import{g as G,a as R,s as K,p as V,b as Y,d as Q,e as X}from"./missions-BCmxIqis.js";import{F as J}from"./FileViewer-C7fgbngf.js";const Z=/\bhttps?:\/\/[^\s<>()[\]"']+[^\s<>()[\]"',.!?;:]/gi;function ee(t){if(!t)return[];const a=[];let r=0;for(const s of t.matchAll(Z))s.index!==void 0&&(s.index>r&&a.push(t.slice(r,s.index)),a.push({url:s[0]}),r=s.index+s[0].length);return r<t.length&&a.push(t.slice(r)),a}function v(t){try{const a=new URL(t),r=a.host.replace(/^www\./,""),s=(a.pathname+a.search+a.hash).replace(/^\//,"");if(s.length===0)return r;const i=`${r}/${s}`;return i.length<=60?i:i.slice(0,57)+"…"}catch{return t.length<=60?t:t.slice(0,57)+"…"}}function te({text:t,sources:a,onOpenFile:r}){const s=o.useMemo(()=>ee(t),[t]),i=o.useMemo(()=>(a??[]).filter(n=>n.type==="url"),[a]),u=o.useMemo(()=>(a??[]).filter(n=>n.type!=="url"),[a]),d=o.useMemo(()=>{const n=new Set;for(const c of s)typeof c!="string"&&n.add(c.url);return n},[s]),m=o.useMemo(()=>i.filter(n=>!d.has(n.ref)),[i,d]);return e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"whitespace-pre-wrap",children:s.map((n,c)=>typeof n=="string"?e.jsx(E.Fragment,{children:n},c):e.jsx("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.stopPropagation(),className:"text-accent hover:text-accent2 underline underline-offset-2 break-all",children:v(n.url)},c))}),(m.length>0||u.length>0)&&e.jsxs("div",{className:"mt-3 pt-2.5 border-t border-border/50",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-widest text-text-muted mb-1.5",children:"Sources"}),m.length>0&&e.jsx("ul",{className:"space-y-1 mb-1.5",children:m.map((n,c)=>e.jsxs("li",{className:"text-[12px] leading-snug",children:[e.jsx("span",{className:"mr-1.5",children:"🔗"}),e.jsx("a",{href:n.ref,target:"_blank",rel:"noopener noreferrer",onClick:p=>p.stopPropagation(),className:"text-accent hover:text-accent2 underline underline-offset-2 break-all",title:n.ref,children:n.description??v(n.ref)}),n.description&&e.jsxs("span",{className:"text-text-muted ml-2 text-[11px]",children:["(",v(n.ref),")"]})]},`u-${c}`))}),u.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:u.map((n,c)=>{const p=n.type==="file"?"📄":n.type==="fact"?"💡":"📊",f=n.ref.length>50?n.ref.slice(0,47)+"…":n.ref;return(n.type==="file"||n.type==="report")&&!!r?e.jsxs("button",{type:"button",onClick:j=>{j.stopPropagation(),r(n.ref,n.type)},className:"inline-flex items-center gap-1.5 px-2 py-0.5 bg-bg-tertiary/60 border border-border rounded-full text-[11px] text-text-secondary hover:bg-accent/15 hover:text-text hover:border-accent/40 transition-colors cursor-pointer",title:`Open ${n.ref}${n.description?" — "+n.description:""}`,children:[p," ",e.jsx("b",{className:"text-text font-medium",children:f}),e.jsx("span",{className:"text-text-muted text-[10px]",children:"↗"})]},`o-${c}`):e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 bg-bg-tertiary/60 border border-border rounded-full text-[11px] text-text-secondary",title:n.description??n.ref,children:[p," ",e.jsx("b",{className:"text-text font-medium",children:f})]},`o-${c}`)})})]})]})}function ge(){const{id:t}=q(),a=W(),[r,s]=o.useState(null),[i,u]=o.useState(!0),[d,m]=o.useState(null),[n,c]=o.useState(""),[p,f]=o.useState(!1),[k,j]=o.useState(!1),[I,S]=o.useState(!1),[A,L]=o.useState(new Set),U=o.useCallback(l=>{L(x=>{const h=new Set(x);return h.has(l)?h.delete(l):h.add(l),h})},[]),C=o.useRef(null),$=o.useRef(null),F=o.useRef(!0),[T,b]=o.useState(null),B=o.useCallback(async l=>{if(t){b({ref:l,loading:!0});try{const x=await G(t,l);b({ref:l,loading:!1,file:x})}catch(x){b({ref:l,loading:!1,error:x.message})}}},[t]),O=o.useCallback(()=>b(null),[]);o.useEffect(()=>{if(!t)return;let l=!0;return u(!0),R(t).then(({mission:x})=>{l&&(s(x),u(!1))}).catch(x=>{l&&(m(x.message),u(!1))}),()=>{l=!1}},[t]),o.useEffect(()=>t?K(t,x=>{if(x.kind==="mission_deleted"){a("/mission");return}x.kind!=="hello"&&R(t).then(({mission:h})=>s(h)).catch(()=>{})}):void 0,[t,a]),o.useEffect(()=>{const l=C.current;if(!l)return;const x=()=>{F.current=l.scrollHeight-l.scrollTop-l.clientHeight<100};return x(),l.addEventListener("scroll",x,{passive:!0}),()=>{l.removeEventListener("scroll",x)}},[r==null?void 0:r.id]),o.useEffect(()=>{if(!F.current)return;const l=$.current;l&&l.scrollIntoView({behavior:"smooth",block:"end"})},[r==null?void 0:r.messages.length]);const P=o.useCallback(async()=>{if(!(!r||!n.trim()||p)){f(!0);try{await V(r.id,n.trim()),c("")}catch(l){m(l.message)}finally{f(!1)}}},[r,n,p]),_=o.useCallback(async(l,x)=>{if(r)try{await Y(r.id,l,x)}catch(h){m(h.message)}},[r]),z=o.useCallback(async()=>{if(!r)return;const l=r.status==="paused"?"working":"paused";try{await Q(r.id,l)}catch(x){m(x.message)}},[r]),H=o.useCallback(async()=>{if(!(!r||!window.confirm(`Delete this mission?
|
|
2
2
|
|
|
3
3
|
"${r.goal.slice(0,120)}${r.goal.length>120?"…":""}"
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{u as M,r as m,j as e}from"./index-
|
|
1
|
+
import{u as M,r as m,j as e}from"./index-CfeeNofL.js";import{l as j,e as D}from"./missions-BCmxIqis.js";const T=258;function z(){const a=M(),[r,s]=m.useState(null),[o,i]=m.useState(null),[l,c]=m.useState("all"),[d,F]=m.useState("");m.useEffect(()=>{let t=!0;return j().then(({missions:n})=>{t&&s(n)}).catch(n=>{t&&i(n.message)}),()=>{t=!1}},[]);const S=m.useCallback(()=>{s(null),j().then(({missions:t})=>s(t)).catch(t=>i(t.message))},[]),p=m.useCallback(async(t,n)=>{if(window.confirm(`Delete this mission?
|
|
2
2
|
|
|
3
3
|
"${n.slice(0,120)}${n.length>120?"…":""}"
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as b,u as W,j as e}from"./index-Dbv5oKsp.js";import{c as _}from"./missions-CYlXuJED.js";const G={id:"hourly",label:"Every hour",cron:"0 * * * *",cadence:"24 runs/day"},L={id:"every4h",label:"Every 4 hours",cron:"0 */4 * * *",cadence:"6 runs/day"},A={id:"every6h",label:"Every 6 hours",cron:"0 */6 * * *",cadence:"4 runs/day"},I={id:"daily7",label:"Daily at 7am",cron:"0 7 * * *",cadence:"once/day"},M={id:"weekly",label:"Weekly (Mon 9am)",cron:"0 9 * * 1",cadence:"once/week"},H={id:"nightly",label:"Nightly at 11pm",cron:"0 23 * * *",cadence:"once/day"},D={id:"twice",label:"Twice daily (7am + 7pm)",cron:"0 7,19 * * *",cadence:"2 runs/day"},V=[{id:"research-digest",icon:"📰",title:"Daily research digest",blurb:"Scout researches your topic and writes a fresh briefing for the first run.",goalTemplate:'Research the latest developments on "{{topic}}" and produce a clear HTML briefing (write_file with a .html extension) with 5 highlights, an inline SVG chart of the most important trend, and clickable source links throughout.',suggestedPlayId:"research",fields:[{key:"topic",label:"Your topic",hint:"What you want a fresh briefing on each morning",defaultValue:"AI agents in business",placeholder:"AI agents in business"}],schedules:[I,D,M],whatItDoes:"Scout searches the web for fresh developments on your topic, reads the top 5 sources end-to-end, and writes a one-page briefing. The briefing lands on your desk as a paper sheet, and the chat thread captures every URL Scout looked at so you can dig in further if anything catches your eye.",accent:{from:"#6366f1",to:"#8b5cf6"}},{id:"inbox-triage",icon:"📬",title:"Inbox triage",blurb:"Sage sorts and summarizes incoming email so important threads stay visible.",goalTemplate:'Read my inbox and produce a triaged summary: "needs reply within 24h", "informational", "newsletters", and "junk". Cap at 30 messages per run.',suggestedPlayId:"inbox",fields:[],schedules:[L,A,I],whatItDoes:"Sage opens your inbox, classifies up to 30 recent threads into four buckets (urgent / informational / newsletters / junk), and pins the urgent ones to the desk as sticky notes. The full triage lands as a paper sheet you can scan in under a minute.",accent:{from:"#06b6d4",to:"#0ea5e9"}},{id:"code-review",icon:"🔍",title:"Code review",blurb:"Builder reviews your repo changes and reports only meaningful findings.",goalTemplate:"Review the diff in {{repoPath}} since the last review. Flag bugs, regressions, and obvious improvements. Don't nitpick formatting.",suggestedPlayId:"code-review",fields:[{key:"repoPath",label:"Repo path or URL",hint:"Local path on the host, or a GitHub repo URL",defaultValue:"~/Desktop/MyProject",placeholder:"~/projects/repo"}],schedules:[H,D],whatItDoes:"Builder pulls the latest changes from your repo and writes a concise review focused on real defects (logic bugs, regressions, security smells). Formatting nits are skipped. Findings land as a paper sheet; if there's nothing to report, Builder closes silently.",accent:{from:"#22c55e",to:"#10b981"}},{id:"lead-scout",icon:"🎯",title:"Lead scout",blurb:"Scout scans freelance + opportunity boards and surfaces matches for your skills.",goalTemplate:'Scan Upwork, Indeed, and HackerNews "who is hiring" for new postings matching: {{skills}}. Filter to budget >= ${{minBudget}} and remote OK.',suggestedPlayId:"lead-scout",fields:[{key:"skills",label:"Skills to match",hint:"Comma-separated keywords. Scout fuzzy-matches.",defaultValue:"TypeScript, Node.js, AI agents",placeholder:"React, Python, design"},{key:"minBudget",label:"Minimum budget (USD)",hint:"Skip postings paying less.",defaultValue:"500"}],schedules:[L,A,I],whatItDoes:"Scout sweeps the boards you care about for postings that match your skill keywords and budget floor. New matches land as sticky notes; the running log of every posting seen sits as a paper sheet you can browse anytime.",accent:{from:"#f59e0b",to:"#eab308"}},{id:"market-watch",icon:"📈",title:"Market watch",blurb:"Analyst tracks tickers + crypto and writes a brief if anything moves >3%.",goalTemplate:"Check the latest price + 24h move for: {{tickers}}. If any moved more than 3% (up or down) since the last run, produce an HTML brief (write_file with a .html extension) with a sparkline SVG per ticker and a one-paragraph explanation with 2 source links.",suggestedPlayId:"analyst",fields:[{key:"tickers",label:"Tickers / coins",hint:"Comma-separated. Stocks or crypto.",defaultValue:"BTC, ETH, NVDA, AAPL",placeholder:"TSLA, SPY, BTC"}],schedules:[G,L,A],whatItDoes:"Each cycle, Analyst pulls the latest price and 24-hour move for every ticker you listed. If anything jumped or dropped more than 3%, it writes a one-paragraph explanation with 2 source links. Quiet runs close silently — your desk only fills up when something actually moved.",accent:{from:"#ef4444",to:"#f97316"}},{id:"creative-prompts",icon:"🎨",title:"Daily creative prompt",blurb:"Writer creates a fresh writing, sketching, or music prompt for the first run.",goalTemplate:"Generate a fresh {{discipline}} prompt for me today. Make it specific enough to start in 5 minutes but open enough to take in any direction. Include a 1-line warm-up exercise.",fields:[{key:"discipline",label:"Discipline",hint:"What kind of prompt you want.",defaultValue:"songwriting",placeholder:"short fiction · songwriting · sketching"}],schedules:[I,M],whatItDoes:"Writer creates one fresh creative prompt tailored to the discipline you chose, with a quick warm-up exercise to get started. The prompt lands as a sticky note on the desk so you can grab it when you need it.",accent:{from:"#ec4899",to:"#8b5cf6"}}];function Y(s,n){return s.goalTemplate.replace(/\{\{(\w+)\}\}/g,(i,r)=>{const u=n[r];return u&&u.trim().length>0?u.trim():r})}const z=["Plan my mom's 70th birthday party","Write a thank-you note to my landlord","Summarize this long email I got","Draft the Q1 investor update","Review a code change"],x="var(--theme-font-display, 'Iowan Old Style', 'Charter', Georgia, serif)",d="var(--theme-font-mono, 'IBM Plex Mono', 'JetBrains Mono', ui-monospace, monospace)",c="var(--theme-paper, #f3e9d0)",o="var(--theme-ink-soft, #a0a8d0)",t="var(--theme-metal, #c4a35a)",g="var(--theme-metal-bright, #f3d27a)",m="var(--theme-metal-dark, #8a6a3a)",F="var(--theme-bolt, #2a1808)",E="var(--theme-leather, #4a2818)",v="var(--theme-leather-edge, #2a1408)",U="var(--theme-leather-stitch, #d4a060)",h="var(--theme-bg-base, #1a1235)",R="var(--theme-bg-grain, #0e0820)",K="var(--theme-bg-vignette, rgba(0,0,0,0.6))",j="var(--theme-shadow, rgba(0,0,0,0.55))",Q="var(--theme-accent, #c45a30)";function ee(){const[s,n]=b.useState(""),[i,r]=b.useState(!1),[u,N]=b.useState(null),[$,k]=b.useState(null),S=W();async function y(a,p){const f=a.trim();if(!(!f||i)){r(!0),N(null);try{const{mission:w}=await _(f,p);S(`/mission/${w.id}`)}catch(w){N(w.message),r(!1)}}}return e.jsxs("div",{className:"min-h-full w-full flex flex-col items-center",style:{color:c,fontFamily:x,background:`radial-gradient(120% 80% at 50% -10%, ${R} 0%, ${h} 60%, ${h} 100%)`},children:[e.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:`radial-gradient(circle at 50% 12%, ${Q}22 0%, transparent 55%)`}}),e.jsx("div",{className:"pointer-events-none absolute inset-0",style:{boxShadow:`inset 0 0 240px 60px ${K}`}}),e.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-8 w-full max-w-5xl px-6 pt-10 pb-28 md:py-14",children:[e.jsxs("div",{className:"w-full flex items-center",style:{paddingRight:260},children:[e.jsxs("div",{className:"flex items-center gap-3 text-[11px] uppercase tracking-[0.3em]",style:{color:o,fontFamily:d},children:[e.jsx("span",{style:{color:g,fontWeight:700},children:"TITAN"}),e.jsx("span",{style:{opacity:.6},children:"·"}),e.jsx("span",{children:"MISSION CONTROL"})]}),e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.jsx(P,{onClick:()=>S("/mission/library"),title:"See your past missions",children:"Past missions →"}),e.jsx(P,{onClick:()=>S("/space/home"),title:"Back to the canvas spaces",children:"🌌 Canvas"})]})]}),e.jsxs("section",{className:"relative w-full max-w-3xl rounded-3xl overflow-hidden",style:{background:`linear-gradient(180deg, ${E} 0%, ${v} 100%)`,border:`1px solid ${v}`,boxShadow:`0 30px 80px ${j}, inset 0 1px 0 ${t}33`,padding:"36px 36px 28px"},children:[e.jsx(C,{position:"tl"}),e.jsx(C,{position:"tr"}),e.jsx(C,{position:"bl"}),e.jsx(C,{position:"br"}),e.jsx("div",{className:"text-[10px] uppercase tracking-[0.4em] mb-3",style:{color:t,fontFamily:d,fontWeight:600},children:"◆ New Mission"}),e.jsx("h1",{className:"text-4xl md:text-5xl tracking-tight",style:{color:c,fontFamily:x,fontWeight:600,letterSpacing:0,textShadow:`0 2px 12px ${j}`},children:"What's the mission?"}),e.jsx("p",{className:"mt-3 text-[15px] leading-relaxed max-w-xl",style:{color:o},children:"Tell me anything — a thank-you note, a birthday plan, a Q1 report. I’ll assemble a small team of AI specialists and we’ll work it out together."}),e.jsxs("form",{onSubmit:a=>{a.preventDefault(),y(s)},className:"mt-6 flex flex-col gap-3",children:[e.jsx("textarea",{autoFocus:!0,value:s,onChange:a=>n(a.target.value),placeholder:"Try: Help me write a birthday speech for my mom",rows:3,disabled:i,className:"w-full resize-none outline-none rounded-2xl px-5 py-4 text-base leading-relaxed",style:{background:`${h}80`,color:c,border:`1px solid ${t}44`,fontFamily:x,boxShadow:`inset 0 2px 8px ${j}`},onKeyDown:a=>{(a.metaKey||a.ctrlKey)&&a.key==="Enter"&&(a.preventDefault(),y(s))}}),e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("div",{className:"text-[11px] tracking-wide",style:{color:o,fontFamily:d},children:"⌘↵ to dispatch · voice coming soon"}),e.jsxs("div",{className:"flex w-full items-center gap-2 sm:w-auto",children:[e.jsx("button",{type:"button",disabled:!0,title:"Voice is coming next release",className:"w-11 h-11 rounded-full flex items-center justify-center cursor-not-allowed",style:{background:`${h}66`,border:`1px solid ${t}33`,color:o,opacity:.55},children:"🎤"}),e.jsx("button",{type:"submit",disabled:!s.trim()||i,className:"h-11 flex-1 rounded-xl px-5 text-sm font-bold tracking-wide transition-transform sm:flex-none",style:{background:s.trim()&&!i?`linear-gradient(180deg, ${g} 0%, ${t} 60%, ${m} 100%)`:`${m}66`,color:s.trim()&&!i?F:o,border:`1px solid ${m}`,boxShadow:s.trim()&&!i?`0 6px 18px ${j}, inset 0 1px 0 ${g}`:"none",cursor:s.trim()&&!i?"pointer":"not-allowed",fontFamily:x,letterSpacing:"0.04em"},onMouseDown:a=>{s.trim()&&!i&&(a.currentTarget.style.transform="translateY(1px)")},onMouseUp:a=>{a.currentTarget.style.transform=""},onMouseLeave:a=>{a.currentTarget.style.transform=""},children:i?"Dispatching…":"Start mission →"})]})]})]}),u&&e.jsx("div",{className:"mt-4 text-sm rounded-lg px-3 py-2",style:{color:"#ffb4a8",background:"#5a1a1a55",border:"1px solid #8a3a3a"},children:u})]}),e.jsxs("div",{className:"w-full max-w-3xl flex flex-col items-center gap-3",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.35em]",style:{color:o,fontFamily:d},children:"— or try a one-shot —"}),e.jsx("div",{className:"flex flex-wrap gap-2 justify-center",children:z.map(a=>e.jsx("button",{type:"button",onClick:()=>y(a),disabled:i,className:"px-3 py-1.5 text-xs rounded-full transition-colors disabled:opacity-50",style:{background:`${v}99`,color:c,border:`1px solid ${t}33`,fontFamily:x},onMouseEnter:p=>{p.currentTarget.style.borderColor=`${t}88`,p.currentTarget.style.background=`${E}`},onMouseLeave:p=>{p.currentTarget.style.borderColor=`${t}33`,p.currentTarget.style.background=`${v}99`},children:a},a))})]}),e.jsxs("section",{className:"w-full mt-4 flex flex-col gap-4",children:[e.jsxs("header",{className:"flex items-baseline justify-between pb-3",style:{borderBottom:`1px solid ${t}33`},children:[e.jsxs("h2",{className:"text-xl tracking-tight",style:{color:c,fontFamily:x,fontWeight:600},children:["Mission starters",e.jsx("span",{className:"ml-3 text-[10px] uppercase tracking-[0.3em]",style:{color:o,fontFamily:d},children:"saved cadence"})]}),e.jsx("span",{className:"text-[11px] tracking-wide",style:{color:o,fontFamily:d},children:"click → 3 steps → launch"})]}),e.jsx("p",{className:"text-sm leading-relaxed max-w-2xl",style:{color:o},children:"Pick a starter recipe, customize it, and launch the first run. TITAN saves the cadence with the mission request."}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3 mt-2",children:V.map(a=>e.jsx(J,{template:a,onClick:()=>k(a)},a.id))})]}),e.jsx("div",{className:"h-20"})]}),$&&e.jsx(q,{template:$,onClose:()=>k(null),onLaunch:async(a,p,f)=>{try{const w=JSON.parse(localStorage.getItem("titan-pending-schedules")??"[]");w.push({at:new Date().toISOString(),templateId:$.id,goal:a,scheduleId:p}),localStorage.setItem("titan-pending-schedules",JSON.stringify(w))}catch{}k(null),await y(a,f)}})]})}function P({onClick:s,title:n,children:i}){return e.jsx("button",{onClick:s,title:n,className:"px-3 py-1 text-[10px] uppercase tracking-[0.2em] rounded-full transition-colors",style:{color:o,border:`1px solid ${t}33`,background:"transparent",fontFamily:d},onMouseEnter:r=>{r.currentTarget.style.color=c,r.currentTarget.style.borderColor=`${t}99`},onMouseLeave:r=>{r.currentTarget.style.color=o,r.currentTarget.style.borderColor=`${t}33`},children:i})}function C({position:s}){const n={position:"absolute"};return s==="tl"&&(n.top=10,n.left=10),s==="tr"&&(n.top=10,n.right=10),s==="bl"&&(n.bottom=10,n.left=10),s==="br"&&(n.bottom=10,n.right=10),e.jsx("div",{style:{...n,width:6,height:6,borderRadius:"50%",background:t,boxShadow:`0 0 6px ${g}, inset 0 1px 0 ${g}`,opacity:.7,pointerEvents:"none"}})}function J({template:s,onClick:n}){const[i,r]=b.useState(!1);return e.jsxs("button",{type:"button",onClick:n,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),className:"text-left rounded-2xl relative overflow-hidden transition-all",style:{background:`linear-gradient(180deg, ${E} 0%, ${v} 100%)`,border:`1px solid ${i?t:v}`,boxShadow:i?`0 14px 36px ${j}, inset 0 1px 0 ${t}55`:`0 6px 18px ${j}, inset 0 1px 0 ${t}22`,transform:i?"translateY(-2px)":"translateY(0)",padding:"14px 16px 14px"},children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-md mb-3",style:{background:`linear-gradient(180deg, ${g} 0%, ${t} 55%, ${m} 100%)`,border:`1px solid ${m}`,boxShadow:`inset 0 1px 0 ${g}aa, 0 1px 3px ${j}`,color:F},children:[e.jsx("span",{className:"text-base leading-none",children:s.icon}),e.jsx("span",{className:"text-xs uppercase tracking-[0.16em] truncate",style:{fontFamily:x,fontWeight:700,letterSpacing:"0.12em"},children:s.title})]}),e.jsx("p",{className:"text-[13px] leading-snug mb-3",style:{color:c,opacity:.88},children:s.blurb}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[s.schedules.slice(0,2).map(u=>e.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full",style:{background:`${v}cc`,color:c,border:`1px solid ${U}55`,fontFamily:d,opacity:.85},children:u.label},u.id)),e.jsx("span",{className:"ml-auto text-[10px] uppercase tracking-[0.2em] transition-opacity",style:{color:g,fontFamily:d,opacity:i?1:0},children:"Set up →"})]})]})}function q({template:s,onClose:n,onLaunch:i}){const[r,u]=b.useState(1),[N,$]=b.useState(()=>Object.fromEntries(s.fields.map(l=>[l.key,l.defaultValue]))),[k,S]=b.useState(s.schedules[0]),[y,a]=b.useState(!1),p=Y(s,N),f=r!==1||s.fields.every(l=>(N[l.key]??"").trim().length>0);async function w(){if(!y){a(!0);try{await i(p,k.id,s.suggestedPlayId)}finally{a(!1)}}}const B={background:`${h}aa`,color:c,border:`1px solid ${t}33`,fontFamily:x};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center backdrop-blur-sm p-4 md:p-8",style:{background:`${R}cc`},onClick:n,children:e.jsxs("div",{className:"relative w-full max-w-2xl rounded-2xl overflow-hidden flex flex-col",style:{background:`linear-gradient(180deg, ${E} 0%, ${v} 100%)`,border:`1px solid ${t}55`,boxShadow:`0 40px 100px ${j}, inset 0 1px 0 ${t}55`,color:c,fontFamily:x},onClick:l=>l.stopPropagation(),children:[e.jsx("div",{style:{height:4,background:`linear-gradient(90deg, ${m}, ${g}, ${m})`}}),e.jsxs("div",{className:"flex items-center gap-3 px-5 py-3",style:{borderBottom:`1px solid ${t}22`},children:[e.jsx("span",{className:"text-2xl leading-none",children:s.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-semibold text-sm truncate",style:{color:c},children:s.title}),e.jsxs("div",{className:"text-[11px]",style:{color:o,fontFamily:d},children:["Step ",r," of 3 · ",r===1?"Customize":r===2?"Cadence":"Launch"]})]}),e.jsx("button",{onClick:n,className:"w-8 h-8 rounded-full flex items-center justify-center text-sm",style:{background:`${h}66`,border:`1px solid ${t}33`,color:o},title:"Close",children:"✕"})]}),e.jsx("div",{className:"px-5 py-2 flex items-center gap-2",style:{borderBottom:`1px solid ${t}11`},children:[1,2,3].map(l=>e.jsx("div",{className:"h-1 flex-1 rounded-full transition-colors",style:{background:l<=r?`linear-gradient(90deg, ${t}, ${g})`:`${h}66`}},l))}),e.jsxs("div",{className:"p-5 max-h-[60vh] overflow-y-auto",children:[r===1&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"text-sm",style:{color:o},children:s.blurb}),s.fields.length===0&&e.jsxs("div",{className:"text-sm italic",style:{color:o},children:["This template runs as-is — no setup needed. Click ",e.jsx("b",{style:{color:c},children:"Next"})," to pick a cadence."]}),s.fields.map(l=>e.jsxs("label",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em]",style:{color:t,fontFamily:d,fontWeight:600},children:l.label}),e.jsx("input",{value:N[l.key]??"",onChange:T=>$(O=>({...O,[l.key]:T.target.value})),placeholder:l.placeholder??l.defaultValue,className:"px-3 py-2 rounded-lg text-sm outline-none",style:B}),l.hint&&e.jsx("span",{className:"text-[11px]",style:{color:o},children:l.hint})]},l.key)),e.jsxs("div",{className:"mt-2 px-3 py-2.5 rounded-lg",style:{background:`${h}66`,border:`1px solid ${t}22`},children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] mb-1",style:{color:t,fontFamily:d},children:"Preview goal"}),e.jsx("div",{className:"text-sm leading-snug",style:{color:c},children:p})]})]}),r===2&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("div",{className:"text-sm",style:{color:o},children:"Which cadence should TITAN remember?"}),s.schedules.map(l=>{const T=l.id===k.id;return e.jsxs("button",{onClick:()=>S(l),className:"flex items-center justify-between p-3 rounded-xl text-left transition-colors",style:{background:T?`${t}1f`:`${h}55`,border:`1px solid ${T?t:`${t}22`}`,color:T?c:o},children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-semibold text-sm",style:{color:c},children:l.label}),e.jsx("span",{className:"text-[11px]",style:{color:o,fontFamily:d},children:l.cadence})]}),e.jsx("code",{className:"text-[10px]",style:{color:o,fontFamily:d},children:l.cron})]},l.id)}),e.jsx("div",{className:"text-[11px] italic px-1 pt-1",style:{color:o},children:"This starts the first run immediately and saves the cadence selection for recurring mission support."})]}),r===3&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("div",{className:"text-sm",style:{color:o},children:"Quick recap before we kick off."}),e.jsxs("div",{className:"rounded-xl p-4",style:{background:`${h}55`,border:`1px solid ${t}22`},children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] mb-1",style:{color:t,fontFamily:d},children:"What I'll do"}),e.jsx("div",{className:"text-sm leading-relaxed",style:{color:c},children:s.whatItDoes})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[12px]",children:[e.jsxs("div",{className:"rounded-lg p-3",style:{background:`${h}55`,border:`1px solid ${t}22`},children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] mb-1",style:{color:t,fontFamily:d},children:"Goal"}),e.jsx("div",{className:"leading-snug",style:{color:c},children:p})]}),e.jsxs("div",{className:"rounded-lg p-3",style:{background:`${h}55`,border:`1px solid ${t}22`},children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] mb-1",style:{color:t,fontFamily:d},children:"Cadence"}),e.jsx("div",{className:"font-semibold",style:{color:c},children:k.label}),e.jsx("div",{className:"text-[11px] mt-0.5",style:{color:o,fontFamily:d},children:k.cadence})]})]})]})]}),e.jsxs("div",{className:"px-5 py-3 flex items-center justify-between",style:{borderTop:`1px solid ${t}22`,background:`${v}66`},children:[e.jsx("button",{onClick:()=>r>1?u(l=>l-1):n(),className:"px-4 py-2 text-sm",style:{color:o,background:"transparent",fontFamily:x},children:r>1?"← Back":"Cancel"}),r<3?e.jsx("button",{onClick:()=>u(l=>l+1),disabled:!f,className:"px-5 py-2 rounded-lg text-sm font-bold",style:{background:f?`linear-gradient(180deg, ${g} 0%, ${t} 60%, ${m} 100%)`:`${m}55`,color:F,border:`1px solid ${m}`,opacity:f?1:.5,cursor:f?"pointer":"not-allowed",fontFamily:x,letterSpacing:"0.04em"},children:"Next →"}):e.jsx("button",{onClick:w,disabled:y,className:"px-5 py-2 rounded-lg text-sm font-bold",style:{background:y?`${m}55`:`linear-gradient(180deg, ${g} 0%, ${t} 60%, ${m} 100%)`,color:F,border:`1px solid ${m}`,opacity:y?.6:1,cursor:y?"wait":"pointer",fontFamily:x,letterSpacing:"0.04em"},children:y?"Launching…":"Launch first run 🚀"})]})]})})}export{ee as default};
|
|
1
|
+
import{r as b,u as W,j as e}from"./index-CfeeNofL.js";import{c as _}from"./missions-BCmxIqis.js";const G={id:"hourly",label:"Every hour",cron:"0 * * * *",cadence:"24 runs/day"},L={id:"every4h",label:"Every 4 hours",cron:"0 */4 * * *",cadence:"6 runs/day"},A={id:"every6h",label:"Every 6 hours",cron:"0 */6 * * *",cadence:"4 runs/day"},I={id:"daily7",label:"Daily at 7am",cron:"0 7 * * *",cadence:"once/day"},M={id:"weekly",label:"Weekly (Mon 9am)",cron:"0 9 * * 1",cadence:"once/week"},H={id:"nightly",label:"Nightly at 11pm",cron:"0 23 * * *",cadence:"once/day"},D={id:"twice",label:"Twice daily (7am + 7pm)",cron:"0 7,19 * * *",cadence:"2 runs/day"},V=[{id:"research-digest",icon:"📰",title:"Daily research digest",blurb:"Scout researches your topic and writes a fresh briefing for the first run.",goalTemplate:'Research the latest developments on "{{topic}}" and produce a clear HTML briefing (write_file with a .html extension) with 5 highlights, an inline SVG chart of the most important trend, and clickable source links throughout.',suggestedPlayId:"research",fields:[{key:"topic",label:"Your topic",hint:"What you want a fresh briefing on each morning",defaultValue:"AI agents in business",placeholder:"AI agents in business"}],schedules:[I,D,M],whatItDoes:"Scout searches the web for fresh developments on your topic, reads the top 5 sources end-to-end, and writes a one-page briefing. The briefing lands on your desk as a paper sheet, and the chat thread captures every URL Scout looked at so you can dig in further if anything catches your eye.",accent:{from:"#6366f1",to:"#8b5cf6"}},{id:"inbox-triage",icon:"📬",title:"Inbox triage",blurb:"Sage sorts and summarizes incoming email so important threads stay visible.",goalTemplate:'Read my inbox and produce a triaged summary: "needs reply within 24h", "informational", "newsletters", and "junk". Cap at 30 messages per run.',suggestedPlayId:"inbox",fields:[],schedules:[L,A,I],whatItDoes:"Sage opens your inbox, classifies up to 30 recent threads into four buckets (urgent / informational / newsletters / junk), and pins the urgent ones to the desk as sticky notes. The full triage lands as a paper sheet you can scan in under a minute.",accent:{from:"#06b6d4",to:"#0ea5e9"}},{id:"code-review",icon:"🔍",title:"Code review",blurb:"Builder reviews your repo changes and reports only meaningful findings.",goalTemplate:"Review the diff in {{repoPath}} since the last review. Flag bugs, regressions, and obvious improvements. Don't nitpick formatting.",suggestedPlayId:"code-review",fields:[{key:"repoPath",label:"Repo path or URL",hint:"Local path on the host, or a GitHub repo URL",defaultValue:"~/Desktop/MyProject",placeholder:"~/projects/repo"}],schedules:[H,D],whatItDoes:"Builder pulls the latest changes from your repo and writes a concise review focused on real defects (logic bugs, regressions, security smells). Formatting nits are skipped. Findings land as a paper sheet; if there's nothing to report, Builder closes silently.",accent:{from:"#22c55e",to:"#10b981"}},{id:"lead-scout",icon:"🎯",title:"Lead scout",blurb:"Scout scans freelance + opportunity boards and surfaces matches for your skills.",goalTemplate:'Scan Upwork, Indeed, and HackerNews "who is hiring" for new postings matching: {{skills}}. Filter to budget >= ${{minBudget}} and remote OK.',suggestedPlayId:"lead-scout",fields:[{key:"skills",label:"Skills to match",hint:"Comma-separated keywords. Scout fuzzy-matches.",defaultValue:"TypeScript, Node.js, AI agents",placeholder:"React, Python, design"},{key:"minBudget",label:"Minimum budget (USD)",hint:"Skip postings paying less.",defaultValue:"500"}],schedules:[L,A,I],whatItDoes:"Scout sweeps the boards you care about for postings that match your skill keywords and budget floor. New matches land as sticky notes; the running log of every posting seen sits as a paper sheet you can browse anytime.",accent:{from:"#f59e0b",to:"#eab308"}},{id:"market-watch",icon:"📈",title:"Market watch",blurb:"Analyst tracks tickers + crypto and writes a brief if anything moves >3%.",goalTemplate:"Check the latest price + 24h move for: {{tickers}}. If any moved more than 3% (up or down) since the last run, produce an HTML brief (write_file with a .html extension) with a sparkline SVG per ticker and a one-paragraph explanation with 2 source links.",suggestedPlayId:"analyst",fields:[{key:"tickers",label:"Tickers / coins",hint:"Comma-separated. Stocks or crypto.",defaultValue:"BTC, ETH, NVDA, AAPL",placeholder:"TSLA, SPY, BTC"}],schedules:[G,L,A],whatItDoes:"Each cycle, Analyst pulls the latest price and 24-hour move for every ticker you listed. If anything jumped or dropped more than 3%, it writes a one-paragraph explanation with 2 source links. Quiet runs close silently — your desk only fills up when something actually moved.",accent:{from:"#ef4444",to:"#f97316"}},{id:"creative-prompts",icon:"🎨",title:"Daily creative prompt",blurb:"Writer creates a fresh writing, sketching, or music prompt for the first run.",goalTemplate:"Generate a fresh {{discipline}} prompt for me today. Make it specific enough to start in 5 minutes but open enough to take in any direction. Include a 1-line warm-up exercise.",fields:[{key:"discipline",label:"Discipline",hint:"What kind of prompt you want.",defaultValue:"songwriting",placeholder:"short fiction · songwriting · sketching"}],schedules:[I,M],whatItDoes:"Writer creates one fresh creative prompt tailored to the discipline you chose, with a quick warm-up exercise to get started. The prompt lands as a sticky note on the desk so you can grab it when you need it.",accent:{from:"#ec4899",to:"#8b5cf6"}}];function Y(s,n){return s.goalTemplate.replace(/\{\{(\w+)\}\}/g,(i,r)=>{const u=n[r];return u&&u.trim().length>0?u.trim():r})}const z=["Plan my mom's 70th birthday party","Write a thank-you note to my landlord","Summarize this long email I got","Draft the Q1 investor update","Review a code change"],x="var(--theme-font-display, 'Iowan Old Style', 'Charter', Georgia, serif)",d="var(--theme-font-mono, 'IBM Plex Mono', 'JetBrains Mono', ui-monospace, monospace)",c="var(--theme-paper, #f3e9d0)",o="var(--theme-ink-soft, #a0a8d0)",t="var(--theme-metal, #c4a35a)",g="var(--theme-metal-bright, #f3d27a)",m="var(--theme-metal-dark, #8a6a3a)",F="var(--theme-bolt, #2a1808)",E="var(--theme-leather, #4a2818)",v="var(--theme-leather-edge, #2a1408)",U="var(--theme-leather-stitch, #d4a060)",h="var(--theme-bg-base, #1a1235)",R="var(--theme-bg-grain, #0e0820)",K="var(--theme-bg-vignette, rgba(0,0,0,0.6))",j="var(--theme-shadow, rgba(0,0,0,0.55))",Q="var(--theme-accent, #c45a30)";function ee(){const[s,n]=b.useState(""),[i,r]=b.useState(!1),[u,N]=b.useState(null),[$,k]=b.useState(null),S=W();async function y(a,p){const f=a.trim();if(!(!f||i)){r(!0),N(null);try{const{mission:w}=await _(f,p);S(`/mission/${w.id}`)}catch(w){N(w.message),r(!1)}}}return e.jsxs("div",{className:"min-h-full w-full flex flex-col items-center",style:{color:c,fontFamily:x,background:`radial-gradient(120% 80% at 50% -10%, ${R} 0%, ${h} 60%, ${h} 100%)`},children:[e.jsx("div",{className:"pointer-events-none absolute inset-0",style:{background:`radial-gradient(circle at 50% 12%, ${Q}22 0%, transparent 55%)`}}),e.jsx("div",{className:"pointer-events-none absolute inset-0",style:{boxShadow:`inset 0 0 240px 60px ${K}`}}),e.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-8 w-full max-w-5xl px-6 pt-10 pb-28 md:py-14",children:[e.jsxs("div",{className:"w-full flex items-center",style:{paddingRight:260},children:[e.jsxs("div",{className:"flex items-center gap-3 text-[11px] uppercase tracking-[0.3em]",style:{color:o,fontFamily:d},children:[e.jsx("span",{style:{color:g,fontWeight:700},children:"TITAN"}),e.jsx("span",{style:{opacity:.6},children:"·"}),e.jsx("span",{children:"MISSION CONTROL"})]}),e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.jsx(P,{onClick:()=>S("/mission/library"),title:"See your past missions",children:"Past missions →"}),e.jsx(P,{onClick:()=>S("/space/home"),title:"Back to the canvas spaces",children:"🌌 Canvas"})]})]}),e.jsxs("section",{className:"relative w-full max-w-3xl rounded-3xl overflow-hidden",style:{background:`linear-gradient(180deg, ${E} 0%, ${v} 100%)`,border:`1px solid ${v}`,boxShadow:`0 30px 80px ${j}, inset 0 1px 0 ${t}33`,padding:"36px 36px 28px"},children:[e.jsx(C,{position:"tl"}),e.jsx(C,{position:"tr"}),e.jsx(C,{position:"bl"}),e.jsx(C,{position:"br"}),e.jsx("div",{className:"text-[10px] uppercase tracking-[0.4em] mb-3",style:{color:t,fontFamily:d,fontWeight:600},children:"◆ New Mission"}),e.jsx("h1",{className:"text-4xl md:text-5xl tracking-tight",style:{color:c,fontFamily:x,fontWeight:600,letterSpacing:0,textShadow:`0 2px 12px ${j}`},children:"What's the mission?"}),e.jsx("p",{className:"mt-3 text-[15px] leading-relaxed max-w-xl",style:{color:o},children:"Tell me anything — a thank-you note, a birthday plan, a Q1 report. I’ll assemble a small team of AI specialists and we’ll work it out together."}),e.jsxs("form",{onSubmit:a=>{a.preventDefault(),y(s)},className:"mt-6 flex flex-col gap-3",children:[e.jsx("textarea",{autoFocus:!0,value:s,onChange:a=>n(a.target.value),placeholder:"Try: Help me write a birthday speech for my mom",rows:3,disabled:i,className:"w-full resize-none outline-none rounded-2xl px-5 py-4 text-base leading-relaxed",style:{background:`${h}80`,color:c,border:`1px solid ${t}44`,fontFamily:x,boxShadow:`inset 0 2px 8px ${j}`},onKeyDown:a=>{(a.metaKey||a.ctrlKey)&&a.key==="Enter"&&(a.preventDefault(),y(s))}}),e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("div",{className:"text-[11px] tracking-wide",style:{color:o,fontFamily:d},children:"⌘↵ to dispatch · voice coming soon"}),e.jsxs("div",{className:"flex w-full items-center gap-2 sm:w-auto",children:[e.jsx("button",{type:"button",disabled:!0,title:"Voice is coming next release",className:"w-11 h-11 rounded-full flex items-center justify-center cursor-not-allowed",style:{background:`${h}66`,border:`1px solid ${t}33`,color:o,opacity:.55},children:"🎤"}),e.jsx("button",{type:"submit",disabled:!s.trim()||i,className:"h-11 flex-1 rounded-xl px-5 text-sm font-bold tracking-wide transition-transform sm:flex-none",style:{background:s.trim()&&!i?`linear-gradient(180deg, ${g} 0%, ${t} 60%, ${m} 100%)`:`${m}66`,color:s.trim()&&!i?F:o,border:`1px solid ${m}`,boxShadow:s.trim()&&!i?`0 6px 18px ${j}, inset 0 1px 0 ${g}`:"none",cursor:s.trim()&&!i?"pointer":"not-allowed",fontFamily:x,letterSpacing:"0.04em"},onMouseDown:a=>{s.trim()&&!i&&(a.currentTarget.style.transform="translateY(1px)")},onMouseUp:a=>{a.currentTarget.style.transform=""},onMouseLeave:a=>{a.currentTarget.style.transform=""},children:i?"Dispatching…":"Start mission →"})]})]})]}),u&&e.jsx("div",{className:"mt-4 text-sm rounded-lg px-3 py-2",style:{color:"#ffb4a8",background:"#5a1a1a55",border:"1px solid #8a3a3a"},children:u})]}),e.jsxs("div",{className:"w-full max-w-3xl flex flex-col items-center gap-3",children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.35em]",style:{color:o,fontFamily:d},children:"— or try a one-shot —"}),e.jsx("div",{className:"flex flex-wrap gap-2 justify-center",children:z.map(a=>e.jsx("button",{type:"button",onClick:()=>y(a),disabled:i,className:"px-3 py-1.5 text-xs rounded-full transition-colors disabled:opacity-50",style:{background:`${v}99`,color:c,border:`1px solid ${t}33`,fontFamily:x},onMouseEnter:p=>{p.currentTarget.style.borderColor=`${t}88`,p.currentTarget.style.background=`${E}`},onMouseLeave:p=>{p.currentTarget.style.borderColor=`${t}33`,p.currentTarget.style.background=`${v}99`},children:a},a))})]}),e.jsxs("section",{className:"w-full mt-4 flex flex-col gap-4",children:[e.jsxs("header",{className:"flex items-baseline justify-between pb-3",style:{borderBottom:`1px solid ${t}33`},children:[e.jsxs("h2",{className:"text-xl tracking-tight",style:{color:c,fontFamily:x,fontWeight:600},children:["Mission starters",e.jsx("span",{className:"ml-3 text-[10px] uppercase tracking-[0.3em]",style:{color:o,fontFamily:d},children:"saved cadence"})]}),e.jsx("span",{className:"text-[11px] tracking-wide",style:{color:o,fontFamily:d},children:"click → 3 steps → launch"})]}),e.jsx("p",{className:"text-sm leading-relaxed max-w-2xl",style:{color:o},children:"Pick a starter recipe, customize it, and launch the first run. TITAN saves the cadence with the mission request."}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3 mt-2",children:V.map(a=>e.jsx(J,{template:a,onClick:()=>k(a)},a.id))})]}),e.jsx("div",{className:"h-20"})]}),$&&e.jsx(q,{template:$,onClose:()=>k(null),onLaunch:async(a,p,f)=>{try{const w=JSON.parse(localStorage.getItem("titan-pending-schedules")??"[]");w.push({at:new Date().toISOString(),templateId:$.id,goal:a,scheduleId:p}),localStorage.setItem("titan-pending-schedules",JSON.stringify(w))}catch{}k(null),await y(a,f)}})]})}function P({onClick:s,title:n,children:i}){return e.jsx("button",{onClick:s,title:n,className:"px-3 py-1 text-[10px] uppercase tracking-[0.2em] rounded-full transition-colors",style:{color:o,border:`1px solid ${t}33`,background:"transparent",fontFamily:d},onMouseEnter:r=>{r.currentTarget.style.color=c,r.currentTarget.style.borderColor=`${t}99`},onMouseLeave:r=>{r.currentTarget.style.color=o,r.currentTarget.style.borderColor=`${t}33`},children:i})}function C({position:s}){const n={position:"absolute"};return s==="tl"&&(n.top=10,n.left=10),s==="tr"&&(n.top=10,n.right=10),s==="bl"&&(n.bottom=10,n.left=10),s==="br"&&(n.bottom=10,n.right=10),e.jsx("div",{style:{...n,width:6,height:6,borderRadius:"50%",background:t,boxShadow:`0 0 6px ${g}, inset 0 1px 0 ${g}`,opacity:.7,pointerEvents:"none"}})}function J({template:s,onClick:n}){const[i,r]=b.useState(!1);return e.jsxs("button",{type:"button",onClick:n,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),className:"text-left rounded-2xl relative overflow-hidden transition-all",style:{background:`linear-gradient(180deg, ${E} 0%, ${v} 100%)`,border:`1px solid ${i?t:v}`,boxShadow:i?`0 14px 36px ${j}, inset 0 1px 0 ${t}55`:`0 6px 18px ${j}, inset 0 1px 0 ${t}22`,transform:i?"translateY(-2px)":"translateY(0)",padding:"14px 16px 14px"},children:[e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-md mb-3",style:{background:`linear-gradient(180deg, ${g} 0%, ${t} 55%, ${m} 100%)`,border:`1px solid ${m}`,boxShadow:`inset 0 1px 0 ${g}aa, 0 1px 3px ${j}`,color:F},children:[e.jsx("span",{className:"text-base leading-none",children:s.icon}),e.jsx("span",{className:"text-xs uppercase tracking-[0.16em] truncate",style:{fontFamily:x,fontWeight:700,letterSpacing:"0.12em"},children:s.title})]}),e.jsx("p",{className:"text-[13px] leading-snug mb-3",style:{color:c,opacity:.88},children:s.blurb}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[s.schedules.slice(0,2).map(u=>e.jsx("span",{className:"text-[10px] px-2 py-0.5 rounded-full",style:{background:`${v}cc`,color:c,border:`1px solid ${U}55`,fontFamily:d,opacity:.85},children:u.label},u.id)),e.jsx("span",{className:"ml-auto text-[10px] uppercase tracking-[0.2em] transition-opacity",style:{color:g,fontFamily:d,opacity:i?1:0},children:"Set up →"})]})]})}function q({template:s,onClose:n,onLaunch:i}){const[r,u]=b.useState(1),[N,$]=b.useState(()=>Object.fromEntries(s.fields.map(l=>[l.key,l.defaultValue]))),[k,S]=b.useState(s.schedules[0]),[y,a]=b.useState(!1),p=Y(s,N),f=r!==1||s.fields.every(l=>(N[l.key]??"").trim().length>0);async function w(){if(!y){a(!0);try{await i(p,k.id,s.suggestedPlayId)}finally{a(!1)}}}const B={background:`${h}aa`,color:c,border:`1px solid ${t}33`,fontFamily:x};return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center backdrop-blur-sm p-4 md:p-8",style:{background:`${R}cc`},onClick:n,children:e.jsxs("div",{className:"relative w-full max-w-2xl rounded-2xl overflow-hidden flex flex-col",style:{background:`linear-gradient(180deg, ${E} 0%, ${v} 100%)`,border:`1px solid ${t}55`,boxShadow:`0 40px 100px ${j}, inset 0 1px 0 ${t}55`,color:c,fontFamily:x},onClick:l=>l.stopPropagation(),children:[e.jsx("div",{style:{height:4,background:`linear-gradient(90deg, ${m}, ${g}, ${m})`}}),e.jsxs("div",{className:"flex items-center gap-3 px-5 py-3",style:{borderBottom:`1px solid ${t}22`},children:[e.jsx("span",{className:"text-2xl leading-none",children:s.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-semibold text-sm truncate",style:{color:c},children:s.title}),e.jsxs("div",{className:"text-[11px]",style:{color:o,fontFamily:d},children:["Step ",r," of 3 · ",r===1?"Customize":r===2?"Cadence":"Launch"]})]}),e.jsx("button",{onClick:n,className:"w-8 h-8 rounded-full flex items-center justify-center text-sm",style:{background:`${h}66`,border:`1px solid ${t}33`,color:o},title:"Close",children:"✕"})]}),e.jsx("div",{className:"px-5 py-2 flex items-center gap-2",style:{borderBottom:`1px solid ${t}11`},children:[1,2,3].map(l=>e.jsx("div",{className:"h-1 flex-1 rounded-full transition-colors",style:{background:l<=r?`linear-gradient(90deg, ${t}, ${g})`:`${h}66`}},l))}),e.jsxs("div",{className:"p-5 max-h-[60vh] overflow-y-auto",children:[r===1&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"text-sm",style:{color:o},children:s.blurb}),s.fields.length===0&&e.jsxs("div",{className:"text-sm italic",style:{color:o},children:["This template runs as-is — no setup needed. Click ",e.jsx("b",{style:{color:c},children:"Next"})," to pick a cadence."]}),s.fields.map(l=>e.jsxs("label",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-[0.2em]",style:{color:t,fontFamily:d,fontWeight:600},children:l.label}),e.jsx("input",{value:N[l.key]??"",onChange:T=>$(O=>({...O,[l.key]:T.target.value})),placeholder:l.placeholder??l.defaultValue,className:"px-3 py-2 rounded-lg text-sm outline-none",style:B}),l.hint&&e.jsx("span",{className:"text-[11px]",style:{color:o},children:l.hint})]},l.key)),e.jsxs("div",{className:"mt-2 px-3 py-2.5 rounded-lg",style:{background:`${h}66`,border:`1px solid ${t}22`},children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] mb-1",style:{color:t,fontFamily:d},children:"Preview goal"}),e.jsx("div",{className:"text-sm leading-snug",style:{color:c},children:p})]})]}),r===2&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("div",{className:"text-sm",style:{color:o},children:"Which cadence should TITAN remember?"}),s.schedules.map(l=>{const T=l.id===k.id;return e.jsxs("button",{onClick:()=>S(l),className:"flex items-center justify-between p-3 rounded-xl text-left transition-colors",style:{background:T?`${t}1f`:`${h}55`,border:`1px solid ${T?t:`${t}22`}`,color:T?c:o},children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-semibold text-sm",style:{color:c},children:l.label}),e.jsx("span",{className:"text-[11px]",style:{color:o,fontFamily:d},children:l.cadence})]}),e.jsx("code",{className:"text-[10px]",style:{color:o,fontFamily:d},children:l.cron})]},l.id)}),e.jsx("div",{className:"text-[11px] italic px-1 pt-1",style:{color:o},children:"This starts the first run immediately and saves the cadence selection for recurring mission support."})]}),r===3&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("div",{className:"text-sm",style:{color:o},children:"Quick recap before we kick off."}),e.jsxs("div",{className:"rounded-xl p-4",style:{background:`${h}55`,border:`1px solid ${t}22`},children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] mb-1",style:{color:t,fontFamily:d},children:"What I'll do"}),e.jsx("div",{className:"text-sm leading-relaxed",style:{color:c},children:s.whatItDoes})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[12px]",children:[e.jsxs("div",{className:"rounded-lg p-3",style:{background:`${h}55`,border:`1px solid ${t}22`},children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] mb-1",style:{color:t,fontFamily:d},children:"Goal"}),e.jsx("div",{className:"leading-snug",style:{color:c},children:p})]}),e.jsxs("div",{className:"rounded-lg p-3",style:{background:`${h}55`,border:`1px solid ${t}22`},children:[e.jsx("div",{className:"text-[10px] uppercase tracking-[0.2em] mb-1",style:{color:t,fontFamily:d},children:"Cadence"}),e.jsx("div",{className:"font-semibold",style:{color:c},children:k.label}),e.jsx("div",{className:"text-[11px] mt-0.5",style:{color:o,fontFamily:d},children:k.cadence})]})]})]})]}),e.jsxs("div",{className:"px-5 py-3 flex items-center justify-between",style:{borderTop:`1px solid ${t}22`,background:`${v}66`},children:[e.jsx("button",{onClick:()=>r>1?u(l=>l-1):n(),className:"px-4 py-2 text-sm",style:{color:o,background:"transparent",fontFamily:x},children:r>1?"← Back":"Cancel"}),r<3?e.jsx("button",{onClick:()=>u(l=>l+1),disabled:!f,className:"px-5 py-2 rounded-lg text-sm font-bold",style:{background:f?`linear-gradient(180deg, ${g} 0%, ${t} 60%, ${m} 100%)`:`${m}55`,color:F,border:`1px solid ${m}`,opacity:f?1:.5,cursor:f?"pointer":"not-allowed",fontFamily:x,letterSpacing:"0.04em"},children:"Next →"}):e.jsx("button",{onClick:w,disabled:y,className:"px-5 py-2 rounded-lg text-sm font-bold",style:{background:y?`${m}55`:`linear-gradient(180deg, ${g} 0%, ${t} 60%, ${m} 100%)`,color:F,border:`1px solid ${m}`,opacity:y?.6:1,cursor:y?"wait":"pointer",fontFamily:x,letterSpacing:"0.04em"},children:y?"Launching…":"Launch first run 🚀"})]})]})})}export{ee as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,j as e,X as x}from"./index-
|
|
1
|
+
import{r,j as e,X as x}from"./index-CfeeNofL.js";import{c as y}from"./clsx-B-dksMZM.js";import{A as p,m as l}from"./proxy-tgCU20-X.js";const u={sm:"max-w-sm",md:"max-w-lg",lg:"max-w-2xl"};function j({open:s,onClose:t,title:i,children:m,footer:n,size:o="md",hideCloseButton:c=!1}){const a=r.useCallback(d=>{d.key==="Escape"&&t()},[t]);return r.useEffect(()=>{if(s)return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[s,a]),e.jsx(p,{children:s&&e.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",children:[e.jsx(l.div,{className:"absolute inset-0 titan-menu-overlay",onClick:t,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15}}),e.jsxs(l.div,{className:y("relative w-full mx-4 titan-modal-surface",u[o]),initial:{opacity:0,y:-16,scale:.97},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:-16,scale:.97},transition:{duration:.2,ease:"easeOut"},children:[i&&e.jsxs("div",{className:"flex items-center justify-between px-4 py-3",style:{borderBottom:"1px solid var(--theme-menu-border)"},children:[e.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--theme-ink)",fontFamily:"var(--theme-font-display)"},children:i}),!c&&e.jsx("button",{type:"button",onClick:t,className:"titan-close-btn","aria-label":"Close",children:e.jsx(x,{size:16})})]}),e.jsx("div",{className:"px-4 py-4",style:{color:"var(--theme-ink)",fontFamily:"var(--theme-font-display)"},children:m}),n&&e.jsx("div",{className:"flex items-center justify-end gap-2 px-4 py-3",style:{borderTop:"1px solid var(--theme-menu-border)"},children:n})]})]})})}export{j as M};
|