titan-agent 5.0.2 → 5.0.3
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/agent/agent.js +48 -3
- package/dist/agent/agent.js.map +1 -1
- package/dist/agent/agentLoop.js +83 -5
- package/dist/agent/agentLoop.js.map +1 -1
- package/dist/agent/commandPost.js +1 -1
- package/dist/agent/commandPost.js.map +1 -1
- package/dist/agent/goalProposer.js +2 -2
- package/dist/agent/goalProposer.js.map +1 -1
- package/dist/agent/missionDriver.js +1 -1
- package/dist/agent/missionDriver.js.map +1 -1
- package/dist/agent/promptBudget.js +85 -0
- package/dist/agent/promptBudget.js.map +1 -0
- package/dist/agent/structuredSpawn.js +1 -1
- package/dist/agent/structuredSpawn.js.map +1 -1
- package/dist/agent/subtaskTaxonomy.js +1 -1
- package/dist/agent/subtaskTaxonomy.js.map +1 -1
- package/dist/agent/systemPromptParts.js +10 -1
- package/dist/agent/systemPromptParts.js.map +1 -1
- package/dist/agent/toolRunner.js +16 -0
- package/dist/agent/toolRunner.js.map +1 -1
- package/dist/agent/toolSearch.js +4 -1
- package/dist/agent/toolSearch.js.map +1 -1
- package/dist/analytics/bugReports.js +1 -1
- package/dist/analytics/bugReports.js.map +1 -1
- package/dist/channels/messenger.js +1 -1
- package/dist/channels/messenger.js.map +1 -1
- package/dist/eval/harness.js +141 -0
- package/dist/eval/harness.js.map +1 -0
- package/dist/gateway/server.js +374 -74
- package/dist/gateway/server.js.map +1 -1
- package/dist/hooks/shellHooks.js +1 -1
- package/dist/hooks/shellHooks.js.map +1 -1
- package/dist/lib/auto-heal/repair-strategies.js.map +1 -1
- package/dist/memory/promptIncludes.js +58 -0
- package/dist/memory/promptIncludes.js.map +1 -0
- package/dist/organism/alertsStore.js +70 -0
- package/dist/organism/alertsStore.js.map +1 -0
- package/dist/plugins/memoryRetrieval.js.map +1 -1
- package/dist/providers/ollama.js +7 -7
- package/dist/providers/ollama.js.map +1 -1
- package/dist/safety/invariants.js +60 -0
- package/dist/safety/invariants.js.map +1 -0
- package/dist/safety/opusReview.js +1 -1
- package/dist/safety/opusReview.js.map +1 -1
- package/dist/security/commandScanner.js +2 -2
- package/dist/security/commandScanner.js.map +1 -1
- package/dist/security/secretGuard.js +4 -4
- package/dist/security/secretGuard.js.map +1 -1
- package/dist/skills/builtin/widget_gallery.js +28 -1
- package/dist/skills/builtin/widget_gallery.js.map +1 -1
- package/dist/skills/frontmatterLoader.js +119 -0
- package/dist/skills/frontmatterLoader.js.map +1 -0
- package/dist/skills/registry.js +20 -0
- package/dist/skills/registry.js.map +1 -1
- package/dist/testing/testHealthMonitor.js +1 -2
- package/dist/testing/testHealthMonitor.js.map +1 -1
- package/dist/utils/constants.js +2 -2
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/replyQuality.js +1 -1
- package/dist/utils/replyQuality.js.map +1 -1
- package/dist/utils/tokens.js +1 -1
- package/dist/utils/tokens.js.map +1 -1
- package/docs/bleeding-edge-agents-2026.md +450 -0
- package/docs/langchain-analysis.md +598 -0
- package/docs/langchain-code-analysis.md +363 -0
- package/docs/space-agent-analysis.md +300 -0
- package/package.json +1 -1
- package/ui/dist/assets/{AuditPanel-G7YA1HzV.js → AuditPanel-B84Mp16G.js} +2 -2
- package/ui/dist/assets/AutonomyPanel-DOtiTFxV.js +11 -0
- package/ui/dist/assets/{AutopilotPanel-CHRjxdh0.js → AutopilotPanel-nTb1Dnru.js} +1 -1
- package/ui/dist/assets/AutoresearchPanel-D46mX8VF.js +6 -0
- package/ui/dist/assets/BackupPanel-DGM1XXbG.js +1 -0
- package/ui/dist/assets/BrowserPanel-Cn1tTN3y.js +6 -0
- package/ui/dist/assets/{CPAgents-D5533PhK.js → CPAgents-CEraUkME.js} +1 -1
- package/ui/dist/assets/{CPDashboard-C-GgqDsI.js → CPDashboard-B_yidGAe.js} +2 -2
- package/ui/dist/assets/CPFiles-BBS8jtYH.js +1 -0
- package/ui/dist/assets/CPGoals-DL5v21TZ.js +1 -0
- package/ui/dist/assets/CPInbox-CyLQJBYF.js +11 -0
- package/ui/dist/assets/{CPSocial-mUQsrSh5.js → CPSocial-BkEtQ1Um.js} +3 -3
- package/ui/dist/assets/ChannelsPanel-CD2kHhA5.js +1 -0
- package/ui/dist/assets/CheckpointsPanel-BrUTFPu_.js +1 -0
- package/ui/dist/assets/CommandPostHub-BPPaUv1B.js +29 -0
- package/ui/dist/assets/CronPanel-CsfQctFp.js +1 -0
- package/ui/dist/assets/DaemonPanel-CNUggBbL.js +1 -0
- package/ui/dist/assets/DataTable-DuAEp_QJ.js +1 -0
- package/ui/dist/assets/{EmptyState-D60-wQrz.js → EmptyState-DFrAEZDm.js} +1 -1
- package/ui/dist/assets/EvalPanel-DEX0a5-b.js +1 -0
- package/ui/dist/assets/{FilesPanel-BNN3h_HW.js → FilesPanel-DATsiAqG.js} +1 -1
- package/ui/dist/assets/FleetPanel-QYQKqx4W.js +1 -0
- package/ui/dist/assets/{HomelabPanel-1mfhRBh6.js → HomelabPanel-DhuXd3ZD.js} +2 -2
- package/ui/dist/assets/{InfraView-Df6SFI7b.js → InfraView-eS7cpESw.js} +2 -2
- package/ui/dist/assets/InlineEditableField-zIAnW4AR.js +1 -0
- package/ui/dist/assets/{Input-DYukme8A.js → Input-bFsLI0fq.js} +1 -1
- package/ui/dist/assets/IntegrationsPanel-C_FswSRN.js +1 -0
- package/ui/dist/assets/IntelligenceView-smQ6aBwx.js +2 -0
- package/ui/dist/assets/{LearningPanel-BPx05bBu.js → LearningPanel-BEgF_iND.js} +1 -1
- package/ui/dist/assets/{LogsPanel-D3Qfp2SE.js → LogsPanel-Br1P8ST6.js} +1 -1
- package/ui/dist/assets/McpPanel-ByvQ12J_.js +1 -0
- package/ui/dist/assets/{MemoryGraphPanel-BFovwaSG.js → MemoryGraphPanel-BGOeSaET.js} +1 -1
- package/ui/dist/assets/MemoryWikiPanel-CR8btd66.js +11 -0
- package/ui/dist/assets/MeshPanel-BjkcSOMz.js +11 -0
- package/ui/dist/assets/NvidiaPanel-NYt42w7L.js +1 -0
- package/ui/dist/assets/OrganismPanel-PHvISvVn.js +1 -0
- package/ui/dist/assets/OverviewPanel-q35zdMr6.js +6 -0
- package/ui/dist/assets/{PageHeader-BdvxKoad.js → PageHeader-Cwn3OALc.js} +1 -1
- package/ui/dist/assets/PaperclipPanel-BDpQki0d.js +1 -0
- package/ui/dist/assets/{PersonasPanel-BpI6Npxv.js → PersonasPanel-DxrGW5C4.js} +1 -1
- package/ui/dist/assets/RecipesPanel-CYRdBx5u.js +1 -0
- package/ui/dist/assets/{SecurityPanel-CBDsEAFz.js → SecurityPanel-i1QMctV0.js} +1 -1
- package/ui/dist/assets/SelfImprovePanel-DbybAZWp.js +1 -0
- package/ui/dist/assets/SelfProposalsPanel-DtcTUDDd.js +2 -0
- package/ui/dist/assets/SessionsPanel-B7QmOizR.js +1 -0
- package/ui/dist/assets/SessionsTab-BdJj_vsI.js +1 -0
- package/ui/dist/assets/{SettingsPanel-BiWHsOAJ.js → SettingsPanel-DnEvJUFe.js} +1 -1
- package/ui/dist/assets/SettingsView-C39dk_yr.js +2 -0
- package/ui/dist/assets/{SkeletonLoader-CGtpZJ-7.js → SkeletonLoader-CsiR8ED9.js} +1 -1
- package/ui/dist/assets/{SkillsPanel-Z_9jA6dU.js → SkillsPanel-DM4qBFDS.js} +1 -1
- package/ui/dist/assets/{SomaView-AP3BXqf-.js → SomaView-CWnPKEQI.js} +1 -1
- package/ui/dist/assets/{StatCard-CrnvXPg5.js → StatCard-CY8lgeWm.js} +1 -1
- package/ui/dist/assets/{StatusBadge-B6r5EWBA.js → StatusBadge-CGvKbP7R.js} +1 -1
- package/ui/dist/assets/TeamsPanel-Bf6GaUni.js +1 -0
- package/ui/dist/assets/{TelemetryPanel-D6o14H-i.js → TelemetryPanel-JZ90gJXC.js} +1 -1
- package/ui/dist/assets/TitanCanvas-Hk49NFcA.js +1092 -0
- package/ui/dist/assets/ToolsView-Cq7Fuq3i.js +2 -0
- package/ui/dist/assets/{Tooltip-DNsYGHC9.js → Tooltip-CcoZrKsl.js} +1 -1
- package/ui/dist/assets/{TraceViewer-TOpdmqLF.js → TraceViewer-ojGf0drx.js} +1 -1
- package/ui/dist/assets/TrainingPanel-CWnP4H2l.js +1 -0
- package/ui/dist/assets/{VoiceOverlay-XIyCbAP7.js → VoiceOverlay-Dn6iaYgd.js} +1 -1
- package/ui/dist/assets/VramPanel-CLd9Ggck.js +1 -0
- package/ui/dist/assets/WatchView-CQBemwsm.js +13 -0
- package/ui/dist/assets/WorkTab-BOfTN-Bd.js +1 -0
- package/ui/dist/assets/WorkflowsPanel-qzNS0p0u.js +11 -0
- package/ui/dist/assets/{arrow-left-CQF-yBIU.js → arrow-left-c-8OFZUV.js} +1 -1
- package/ui/dist/assets/{chart-column-1smg0GbX.js → chart-column-x6L66Qw7.js} +1 -1
- package/ui/dist/assets/{circle-check-big-BiMDFx6C.js → circle-check-big-WaW3U3Xl.js} +1 -1
- package/ui/dist/assets/{dollar-sign-DMYH4Q_a.js → dollar-sign-D2Oce4Ru.js} +1 -1
- package/ui/dist/assets/{download-BYFd-yl6.js → download-YvPDLlFJ.js} +1 -1
- package/ui/dist/assets/eye-off-DIMcxsdQ.js +6 -0
- package/ui/dist/assets/{funnel-pWBglhfw.js → funnel-DqD9srZu.js} +1 -1
- package/ui/dist/assets/{git-branch-Cgqic2Us.js → git-branch-0FamUEbU.js} +1 -1
- package/ui/dist/assets/index-D932CbpQ.css +1 -0
- package/ui/dist/assets/index-NatBSFxj.js +227 -0
- package/ui/dist/assets/{legacy-BHbi-Nm_.js → legacy-DOO7F5cq.js} +1 -1
- package/ui/dist/assets/{lightbulb-D_y0Mtyq.js → lightbulb-Bk6KlR6q.js} +1 -1
- package/ui/dist/assets/pause-DDC_zUiJ.js +6 -0
- package/ui/dist/assets/{play-2xR4_zUG.js → play-BPXbHToG.js} +1 -1
- package/ui/dist/assets/{plug-DhvhYYy_.js → plug-Dxp-sWVF.js} +1 -1
- package/ui/dist/assets/proxy-vU7v4NVM.js +9 -0
- package/ui/dist/assets/square-Bn_0tYME.js +6 -0
- package/ui/dist/assets/target-BrtxUtzl.js +6 -0
- package/ui/dist/assets/toggle-right-CYphlpN5.js +11 -0
- package/ui/dist/assets/{trash-2-DmRaMz9e.js → trash-2-C_Jsp23A.js} +1 -1
- package/ui/dist/assets/{trending-up-DsDcs3Jo.js → trending-up-DrtLViSm.js} +1 -1
- package/ui/dist/assets/trophy-DdRzAOfo.js +6 -0
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/CPFiles-G7veSjMg.js +0 -6
- package/ui/dist/assets/CPGoals-C3DlKJrJ.js +0 -1
- package/ui/dist/assets/CPInbox-D10curQs.js +0 -16
- package/ui/dist/assets/ChannelsPanel-M3pO2htW.js +0 -1
- package/ui/dist/assets/CommandPostHub-CW9OY1A4.js +0 -37
- package/ui/dist/assets/InlineEditableField-CH-jR3LC.js +0 -11
- package/ui/dist/assets/IntegrationsPanel-EaN999Te.js +0 -1
- package/ui/dist/assets/IntelligenceView-Q4DBmJpJ.js +0 -2
- package/ui/dist/assets/McpPanel-zC7jTaSx.js +0 -6
- package/ui/dist/assets/MeshPanel-CqtYZ74K.js +0 -11
- package/ui/dist/assets/NvidiaPanel-BVIZFHet.js +0 -1
- package/ui/dist/assets/SelfImprovePanel-PSCYO6sx.js +0 -11
- package/ui/dist/assets/SessionsTab-Cn3dGgjX.js +0 -1
- package/ui/dist/assets/SettingsView-3BSIzAfW.js +0 -2
- package/ui/dist/assets/TitanCanvas-cnb7R1gS.js +0 -1056
- package/ui/dist/assets/ToolsView-Dp-xUWJG.js +0 -2
- package/ui/dist/assets/WorkTab-Pgq-iLz9.js +0 -1
- package/ui/dist/assets/WorkflowsPanel-B91LeW7r.js +0 -21
- package/ui/dist/assets/eye-BfW7UcEC.js +0 -11
- package/ui/dist/assets/index-BWSnB6Kr.js +0 -227
- package/ui/dist/assets/index-Dtw1pbjc.css +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as a}from"./index-NatBSFxj.js";/**
|
|
2
|
+
* @license lucide-react v0.513.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const p=[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]],e=a("trophy",p);export{e as T};
|
package/ui/dist/index.html
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
<link rel="manifest" href="/manifest.json" />
|
|
10
10
|
<link rel="apple-touch-icon" href="/titan-logo.png" />
|
|
11
11
|
<title>TITAN Mission Control</title>
|
|
12
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
12
|
+
<script type="module" crossorigin src="/assets/index-NatBSFxj.js"></script>
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/index-D932CbpQ.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body class="bg-zinc-950 text-zinc-100">
|
|
16
16
|
<div id="root"></div>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{c as f,r as i,j as e,b as j,X as y}from"./index-BWSnB6Kr.js";import{n as N,a as v,R as p,F as w}from"./TitanCanvas-cnb7R1gS.js";import"./VoiceOverlay-XIyCbAP7.js";/**
|
|
2
|
-
* @license lucide-react v0.513.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const k=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],C=f("flask-conical",k);async function h(t){const r=await j(t);if(!r.ok)throw new Error(`HTTP ${r.status}`);return r.json()}function b(t){return t===void 0?"—":t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}K`:`${(t/1024/1024).toFixed(1)}M`}function g(t){const r=Math.floor((Date.now()-new Date(t).getTime())/1e3);return r<60?`${r}s`:r<3600?`${Math.floor(r/60)}m`:r<86400?`${Math.floor(r/3600)}h`:`${Math.floor(r/86400)}d`}function S({path:t,onClose:r}){const[a,c]=i.useState(null);return i.useEffect(()=>{c(null),h(`/api/files/content?path=${encodeURIComponent(t)}`).then(l=>c(l)).catch(l=>c({error:String(l)}))},[t]),e.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 flex items-center justify-center p-4",onClick:r,children:e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl w-full max-w-5xl max-h-[90vh] flex flex-col shadow-2xl",onClick:l=>l.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-text truncate",children:t}),a&&"sizeBytes"in a&&e.jsxs("div",{className:"text-xs text-text-muted",children:[b(a.sizeBytes)," · ",a.encoding,a.truncated?" · truncated at 1MB":""]})]}),e.jsx("button",{onClick:r,className:"p-1 rounded hover:bg-bg-tertiary text-text-muted",title:"Close",children:e.jsx(y,{size:18})})]}),e.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[a===null&&e.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:"Loading…"}),a&&"error"in a&&e.jsx("div",{className:"text-error text-sm py-8 text-center",children:a.error}),a&&"content"in a&&e.jsx("pre",{className:"text-[12px] font-mono leading-snug whitespace-pre-wrap text-text-secondary",children:a.content})]})]})})}function z(){const[t,r]=i.useState([]),[a,c]=i.useState(!0),[l,m]=i.useState(""),[o,n]=i.useState(null),d=i.useCallback(async()=>{c(!0);try{const s=await h("/api/files/edited?limit=300");r(s.files||[])}catch{}c(!1)},[]);i.useEffect(()=>{d()},[d]);const x=l?t.filter(s=>s.path.toLowerCase().includes(l.toLowerCase())):t;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded-lg border border-border bg-bg-secondary",children:[e.jsx(v,{size:14,className:"text-text-muted"}),e.jsx("input",{type:"text",placeholder:"Filter by path…",value:l,onChange:s=>m(s.target.value),className:"flex-1 bg-transparent text-sm outline-none"})]}),e.jsxs("button",{onClick:d,className:"px-3 py-1.5 rounded-lg border border-border bg-bg-secondary text-sm hover:bg-bg-tertiary flex items-center gap-1.5",title:"Refresh",children:[e.jsx(p,{size:14,className:a?"animate-spin":""}),a?"Loading":"Refresh"]}),e.jsxs("div",{className:"text-xs text-text-muted",children:[x.length," / ",t.length]})]}),a&&t.length===0&&e.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:"Loading…"}),!a&&x.length===0&&e.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:l?"No files match filter":"No file edits recorded yet"}),x.length>0&&e.jsx("div",{className:"divide-y divide-border rounded-xl border border-border bg-bg-secondary overflow-hidden",children:x.map(s=>e.jsxs("button",{onClick:()=>s.readable&&s.exists&&n(s.path),disabled:!s.readable||!s.exists,className:"w-full flex items-start gap-3 px-4 py-2.5 text-left hover:bg-bg-tertiary transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[e.jsx(w,{size:14,className:s.isSelfMod?"text-accent mt-0.5 flex-shrink-0":"text-text-muted mt-0.5 flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-mono text-text truncate",children:s.path}),e.jsxs("div",{className:"text-xs text-text-muted mt-0.5 flex items-center gap-2 flex-wrap",children:[s.isSelfMod&&e.jsx("span",{className:"px-1 rounded bg-accent/15 text-accent text-[10px]",children:"self-mod"}),e.jsxs("span",{children:["×",s.writeCount]}),s.tools.length>0&&e.jsx("span",{children:s.tools.join("+")}),s.channels.length>0&&e.jsxs("span",{children:["via ",s.channels.join(", ")]}),!s.exists&&e.jsx("span",{className:"text-warn",children:"deleted"}),e.jsx("span",{children:b(s.sizeBytes)})]})]}),e.jsx("div",{className:"text-xs text-text-muted flex-shrink-0",children:g(s.lastWrittenAt)})]},s.path))}),o&&e.jsx(S,{path:o,onClose:()=>n(null)})]})}function F(){const[t,r]=i.useState([]),[a,c]=i.useState(!0),[l,m]=i.useState(null),o=i.useCallback(async()=>{c(!0);try{const n=await h("/api/research/recent?limit=50");r(n.research||[])}catch{}c(!1)},[]);return i.useEffect(()=>{o()},[o]),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:o,className:"px-3 py-1.5 rounded-lg border border-border bg-bg-secondary text-sm hover:bg-bg-tertiary flex items-center gap-1.5",children:[e.jsx(p,{size:14,className:a?"animate-spin":""}),a?"Loading":"Refresh"]}),e.jsxs("div",{className:"text-xs text-text-muted",children:[t.length," items"]})]}),a&&t.length===0&&e.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:"Loading…"}),!a&&t.length===0&&e.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:"No research recorded yet. Complete a goal and results will appear here."}),e.jsx("div",{className:"space-y-2",children:t.map(n=>{var u;const d=l===n.id,x=n.content.slice(0,200),s=n.subtaskTitle?`${n.goalTitle} — ${n.subtaskTitle}`:((u=n.tags)==null?void 0:u.join(" · "))||n.kind;return e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary overflow-hidden",children:[e.jsxs("button",{onClick:()=>m(d?null:n.id),className:"w-full text-left px-4 py-3 hover:bg-bg-tertiary transition-colors",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-bg-tertiary text-text-muted uppercase tracking-wide font-medium",children:n.kind.replace(/_/g," ")}),e.jsx("span",{className:"text-xs text-text-muted",children:g(n.at)})]}),e.jsx("div",{className:"text-sm font-medium text-text truncate",children:s}),!d&&e.jsxs("div",{className:"text-xs text-text-secondary mt-1 line-clamp-2",children:[x,n.content.length>200?"…":""]})]}),d&&e.jsx("div",{className:"px-4 pb-4",children:e.jsx("pre",{className:"text-[12px] font-mono leading-snug whitespace-pre-wrap text-text-secondary",children:n.content})})]},n.id)})})]})}function L(){const[t,r]=i.useState("files");return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>r("files"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm transition-colors ${t==="files"?"bg-accent/15 text-accent border border-accent/30":"text-text-secondary hover:text-text hover:bg-bg-tertiary border border-transparent"}`,children:[e.jsx(N,{size:14})," Files edited"]}),e.jsxs("button",{onClick:()=>r("research"),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm transition-colors ${t==="research"?"bg-accent/15 text-accent border border-accent/30":"text-text-secondary hover:text-text hover:bg-bg-tertiary border border-transparent"}`,children:[e.jsx(C,{size:14})," Research"]})]}),t==="files"?e.jsx(z,{}):e.jsx(F,{})]})}export{L as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as i,aP as D,j as e,X as $,b as N}from"./index-BWSnB6Kr.js";import{B as j}from"./Input-DYukme8A.js";import{S as T}from"./StatusBadge-B6r5EWBA.js";import{P as M}from"./PageHeader-BdvxKoad.js";import{E as O}from"./EmptyState-D60-wQrz.js";import{M as A}from"./CommandPostHub-CW9OY1A4.js";import{S as F}from"./SkeletonLoader-CGtpZJ-7.js";import{P as L}from"./TitanCanvas-cnb7R1gS.js";import{T as y}from"./InlineEditableField-CH-jR3LC.js";import{a as B,C as I}from"./VoiceOverlay-XIyCbAP7.js";import{T as U}from"./trash-2-DmRaMz9e.js";import"./Tooltip-DNsYGHC9.js";import"./dollar-sign-DMYH4Q_a.js";import"./git-branch-Cgqic2Us.js";import"./chart-column-1smg0GbX.js";function _(t){const a=Math.floor((Date.now()-new Date(t).getTime())/1e3);return a<60?`${a}s`:a<3600?`${Math.floor(a/60)}m`:a<86400?`${Math.floor(a/3600)}h`:`${Math.floor(a/86400)}d`}const H=["pending","in_progress","completed","blocked"];function J({node:t,onClose:a,onRefresh:l}){const[d,c]=i.useState(!1),[x,m]=i.useState(!1),r=t.goal,g=async()=>{c(!0);try{await N(`/api/goals/${r.id}`,{method:"DELETE"}),l(),a()}catch{}c(!1)},o=async n=>{m(!0);try{await N(`/api/goals/${r.id}`,{method:"PATCH",body:JSON.stringify({status:n})}),l()}catch{}m(!1)};return e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-lg font-semibold text-text",children:r.title}),r.description&&e.jsx("p",{className:"text-sm text-text-secondary mt-1",children:r.description})]}),e.jsx("button",{onClick:a,className:"p-1 text-text-muted hover:text-text rounded-lg hover:bg-bg-tertiary transition-colors",children:e.jsx($,{size:16})})]}),e.jsxs("div",{className:"flex flex-wrap gap-3 text-xs",children:[e.jsxs("div",{className:"bg-bg-tertiary/50 rounded-lg px-3 py-2",children:[e.jsx("span",{className:"text-text-muted",children:"Status: "}),e.jsx(T,{status:r.status,size:"sm"})]}),r.progress>0&&e.jsxs("div",{className:"bg-bg-tertiary/50 rounded-lg px-3 py-2",children:[e.jsx("span",{className:"text-text-muted",children:"Progress: "}),e.jsxs("span",{className:"text-text font-medium",children:[Math.round(r.progress),"%"]})]}),t.children.length>0&&e.jsxs("div",{className:"bg-bg-tertiary/50 rounded-lg px-3 py-2",children:[e.jsx("span",{className:"text-text-muted",children:"Sub-goals: "}),e.jsxs("span",{className:"text-text font-medium",children:[t.children.filter(n=>n.goal.status==="completed"||n.goal.status==="done").length,"/",t.children.length," done"]})]}),e.jsxs("div",{className:"bg-bg-tertiary/50 rounded-lg px-3 py-2",children:[e.jsx("span",{className:"text-text-muted",children:"Updated: "}),e.jsxs("span",{className:"text-text font-medium",children:[_(r.updatedAt||r.createdAt||new Date().toISOString())," ago"]})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-2",children:"Change Status"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:H.map(n=>e.jsx("button",{disabled:x||r.status===n,onClick:()=>o(n),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors ${r.status===n?"bg-accent/20 text-accent border border-accent/30":"bg-bg-tertiary text-text-secondary hover:bg-bg-tertiary/80 border border-border"} disabled:opacity-50`,children:n.replace("_"," ")},n))})]}),e.jsx("div",{className:"pt-2 border-t border-border flex justify-end",children:e.jsxs("button",{onClick:g,disabled:d,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium text-error hover:bg-error/10 transition-colors disabled:opacity-50",children:[e.jsx(U,{size:12}),d?"Deleting...":"Delete Goal"]})})]})}function z({node:t,expanded:a,toggleExpand:l,selectedId:d,onSelect:c}){const x=t.children.length>0,m=a.has(t.goal.id),r=d===t.goal.id,g=t.children.filter(o=>o.goal.status==="completed"||o.goal.status==="done").length;return e.jsxs("div",{children:[e.jsxs("div",{className:`flex items-center gap-2 py-2 px-3 rounded-lg transition-colors cursor-pointer group ${r?"bg-accent/10 border-l-2 border-accent":"hover:bg-bg-tertiary/50"}`,style:{paddingLeft:`${t.depth*24+12}px`},onClick:()=>c(t),children:[x?e.jsx("button",{onClick:o=>{o.stopPropagation(),l(t.goal.id)},className:"p-0.5 rounded hover:bg-bg-tertiary transition-colors",children:m?e.jsx(B,{size:14,className:"text-text-muted"}):e.jsx(I,{size:14,className:"text-text-muted"})}):e.jsx("span",{className:"w-[18px] flex-shrink-0"}),e.jsx(y,{size:14,className:r?"text-accent":"text-text-muted"}),e.jsx("span",{className:"text-sm text-text flex-1 truncate",children:t.goal.title}),e.jsx(T,{status:t.goal.status,size:"sm"}),x&&e.jsxs("span",{className:"text-[10px] text-text-muted",children:[g,"/",t.children.length]}),t.goal.progress>0&&e.jsx("div",{className:"w-16 h-1.5 bg-bg-tertiary rounded-full overflow-hidden flex-shrink-0",children:e.jsx("div",{className:"h-full bg-accent rounded-full transition-all",style:{width:`${Math.min(100,t.goal.progress)}%`}})})]}),x&&m&&e.jsx("div",{children:t.children.map(o=>e.jsx(z,{node:o,expanded:a,toggleExpand:l,selectedId:d,onSelect:c},o.goal.id))})]})}function P(t,a){for(const l of t){if(l.goal.id===a)return l;const d=P(l.children,a);if(d)return d}return null}function oe(){const[t,a]=i.useState([]),[l,d]=i.useState(!0),[c,x]=i.useState(null),[m,r]=i.useState(new Set),[g,o]=i.useState(null),[n,u]=i.useState(!1),[p,v]=i.useState(""),[E,S]=i.useState(!1),b=i.useCallback(async()=>{try{const s=await D();a(s),r(new Set(s.map(h=>h.goal.id))),x(null)}catch(s){x(s instanceof Error?s.message:"Failed to load goals")}d(!1)},[]);i.useEffect(()=>{b()},[b]);const C=s=>{r(h=>{const f=new Set(h);return f.has(s)?f.delete(s):f.add(s),f})},G=s=>{o(h=>h===s.goal.id?null:s.goal.id),s.children.length>0&&!m.has(s.goal.id)&&C(s.goal.id)},w=async()=>{if(p.trim()){S(!0);try{await N("/api/command-post/goals",{method:"POST",body:JSON.stringify({title:p.trim()})}),u(!1),v(""),await b()}catch{}S(!1)}},k=g?P(t,g):null;return e.jsxs("div",{className:"space-y-4",children:[e.jsx(M,{title:"Goals",breadcrumbs:[{label:"Command Post"},{label:"Goals"}],actions:e.jsx(j,{size:"sm",icon:e.jsx(L,{size:14}),onClick:()=>u(!0),children:"Create Goal"})}),l&&e.jsx(F,{variant:"row",count:5}),c&&e.jsx("div",{className:"text-center py-8 text-error text-sm",children:c}),!l&&!c&&t.length===0&&e.jsx(O,{icon:e.jsx(y,{size:32}),title:"No goals",description:"Create your first goal to start organizing agent work.",action:{label:"Create Goal",onClick:()=>u(!0)}}),!l&&!c&&t.length>0&&e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"lg:col-span-2 rounded-xl border border-border bg-bg-secondary overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between",children:[e.jsxs("span",{className:"text-xs text-text-muted",children:[t.length," top-level goal",t.length!==1?"s":""]}),e.jsx("span",{className:"text-[10px] text-text-muted",children:"Click a goal to view details"})]}),e.jsx("div",{className:"divide-y divide-border",children:t.map(s=>e.jsx(z,{node:s,expanded:m,toggleExpand:C,selectedId:g,onSelect:G},s.goal.id))})]}),e.jsx("div",{className:"lg:col-span-1",children:k?e.jsx(J,{node:k,onClose:()=>o(null),onRefresh:b}):e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl p-8 text-center",children:[e.jsx(y,{size:24,className:"text-text-muted mx-auto mb-2"}),e.jsx("p",{className:"text-xs text-text-muted",children:"Select a goal to view details"})]})})]}),e.jsx(A,{open:n,onClose:()=>u(!1),title:"Create Goal",footer:e.jsxs(e.Fragment,{children:[e.jsx(j,{variant:"secondary",size:"sm",onClick:()=>u(!1),children:"Cancel"}),e.jsx(j,{size:"sm",onClick:w,loading:E,disabled:!p.trim(),children:"Create"})]}),children:e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Goal Title"}),e.jsx("input",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text placeholder:text-text-muted focus:outline-none focus:border-accent",placeholder:"Enter goal title...",value:p,onChange:s=>v(s.target.value),onKeyDown:s=>s.key==="Enter"&&w(),autoFocus:!0})]})})]})}export{oe as default};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{c as _,j as e,n as C,r as h,aw as P,ax as J,ay as Y,i as Z,az as ee,o as te,aA as se,aB as re,f as ae,T as B,X as F,aC as q,aD as ne,aE as ie,aF as oe,aG as le,b as de}from"./index-BWSnB6Kr.js";import{B as v}from"./Input-DYukme8A.js";import{P as ce}from"./PageHeader-BdvxKoad.js";import{E as ue}from"./EmptyState-D60-wQrz.js";import{S as pe}from"./SkeletonLoader-CGtpZJ-7.js";import{M as D,B as U,C as z,S as xe,k as he,e as L,m as ge,l as me}from"./TitanCanvas-cnb7R1gS.js";import{F as fe}from"./funnel-pWBglhfw.js";import{a as be}from"./VoiceOverlay-XIyCbAP7.js";/**
|
|
2
|
-
* @license lucide-react v0.513.0 - ISC
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the ISC license.
|
|
5
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const ye=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],ve=_("inbox",ye);/**
|
|
7
|
-
* @license lucide-react v0.513.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const je=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ke=_("square-check-big",je);/**
|
|
12
|
-
* @license lucide-react v0.513.0 - ISC
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the ISC license.
|
|
15
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const we=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Ne=_("square",we);function $e({tabs:n,activeTab:s,onChange:p,className:m}){return e.jsx("div",{className:C("flex gap-1 border-b border-border",m),children:n.map(u=>e.jsxs("button",{onClick:()=>p(u.id),className:C("flex items-center gap-1.5 px-3 py-2 text-sm font-medium transition-colors border-b-2 -mb-px",s===u.id?"border-accent text-accent":"border-transparent text-text-muted hover:text-text-secondary"),children:[u.icon,u.label,u.count!==void 0&&e.jsx("span",{className:C("ml-1 rounded-full px-1.5 py-0.5 text-[10px] font-medium",s===u.id?"bg-accent/15 text-accent":"bg-bg-tertiary text-text-muted"),children:u.count})]},u.id))})}function Se(n){var u,f;const s=n.payload||{},p=s.kind;if(p==="driver_blocked"){const o=s.question||"Specialist needs clarification",l=[];return s.goalTitle&&l.push(`Goal: ${s.goalTitle}`),s.subtaskTitle&&l.push(`Task: ${s.subtaskTitle}`),s.specialist&&l.push(`Agent: ${s.specialist}`),s.attempts&&l.push(`${s.attempts} attempt(s)`),s.lastError&&l.push(`Error: ${String(s.lastError).slice(0,120)}`),{kindLabel:"Driver blocked",headline:o.length>120?o.slice(0,120)+"…":o,detail:l.join(" · ")||void 0,urgency:"high"}}if(p==="self_mod_pr"){const o=n.payload,l=o.initialFileCount,x=o.firstFile,a=o.proposedBy,b=[];return typeof l=="number"&&l>0&&b.push(`${l} file${l===1?"":"s"}`),x&&b.push(x.split("/").slice(-2).join("/")),s.target&&b.push(`→ ${s.target}`),a&&b.push(`by ${a}`),{kindLabel:"Self-mod PR",headline:s.goalTitle?`Code changes for: ${s.goalTitle}`:"Code changes pending review",detail:b.length>0?b.join(" · "):s.suggestedAction,urgency:"medium"}}if(p==="self_repair"){const l=(s.evidence||{}).driveId,x=s.finding||"finding";return{kindLabel:"Self-repair",headline:s.reason||`${x}${l?` (${l})`:""}`,detail:s.suggestedAction,urgency:s.severity||"medium"}}if(p==="canary_regression"){const o=s.regressions||[],l=o.length>0?o.map(x=>`${x.taskId} ${(x.baseline*100).toFixed(0)}%→${(x.current*100).toFixed(0)}%`).join(", "):null;return{kindLabel:"Canary regression",headline:l?`Quality drop on ${o.length} task(s): ${l}`:s.reason||"Model quality regression detected",detail:s.suggestedAction||(s.model?`Model: ${s.model}`:void 0),urgency:"high"}}if(n.type==="goal_proposal"||n.type==="soma_proposal"||p==="goal_proposal")return{kindLabel:n.type==="soma_proposal"?"Soma proposal":"New goal proposal",headline:s.title||s.goalTitle||"Goal proposal",detail:((u=s.description)==null?void 0:u.slice(0,180))||((f=s.rationale)==null?void 0:f.slice(0,180)),urgency:"medium"};if(n.type==="hire_agent")return{kindLabel:"Hire agent",headline:s.name?`Hire "${s.name}" as ${s.role||"agent"}`:"Hire new agent",urgency:"medium"};if(n.type==="budget_override")return{kindLabel:"Budget override",headline:"Agent requesting budget continuation",detail:s.reason,urgency:"medium"};const m=s.question||s.title||s.goalTitle||s.reason||s.finding||s.description||s.rationale||`${n.type.replace(/_/g," ")} from ${n.requestedBy}`;return{kindLabel:(p||n.type).replace(/_/g," "),headline:String(m).slice(0,200),urgency:s.urgency||"low"}}function Ae(n){return new Date(n).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Ce({approval:n,onReply:s}){const[p,m]=h.useState(""),[u,f]=h.useState(!1),{toast:o}=P(),l=n.thread||[],x=async()=>{if(p.trim()){f(!0);try{await Y(n.id,"user",p.trim()),m(""),s==null||s(),o("success","Reply sent")}catch{o("error","Failed to send reply")}f(!1)}};return e.jsxs("div",{className:"space-y-3 mt-3",children:[l.length===0&&e.jsxs("div",{className:"text-xs text-text-muted italic flex items-center gap-1",children:[e.jsx(D,{size:12}),"No replies yet. Start the conversation below."]}),l.map(a=>e.jsxs("div",{className:`flex gap-2 ${a.authorUser?"flex-row":"flex-row-reverse"}`,children:[e.jsx("div",{className:`w-6 h-6 rounded-full flex items-center justify-center flex-shrink-0 ${a.authorUser?"bg-accent/20 text-accent":"bg-warning/20 text-warning"}`,children:a.authorUser?e.jsx(J,{size:12}):e.jsx(U,{size:12})}),e.jsxs("div",{className:`max-w-[80%] rounded-lg px-3 py-2 text-xs ${a.authorUser?"bg-bg-tertiary text-text":"bg-warning/10 text-text border border-warning/20"}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("span",{className:"font-semibold",children:a.authorUser||a.authorAgentId||"Agent"}),e.jsx(z,{size:10,className:"text-text-muted"}),e.jsx("span",{className:"text-text-muted",children:Ae(a.createdAt)})]}),e.jsx("div",{className:"whitespace-pre-wrap",children:a.body})]})]},a.id)),e.jsxs("div",{className:"flex items-end gap-2 pt-2",children:[e.jsx("textarea",{value:p,onChange:a=>m(a.target.value),placeholder:"Reply to this agent...",className:"flex-1 min-h-[60px] rounded-lg border border-border bg-bg px-3 py-2 text-xs text-text outline-none focus:border-accent resize-none",onKeyDown:a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),x())}}),e.jsx("button",{onClick:x,disabled:u||!p.trim(),className:"h-8 w-8 rounded-lg bg-accent text-white flex items-center justify-center disabled:opacity-40 hover:bg-accent/90 transition-colors",children:e.jsx(xe,{size:14})})]})]})}function ze(n){const s=Math.floor((Date.now()-new Date(n).getTime())/1e3);return s<60?`${s}s`:s<3600?`${Math.floor(s/60)}m`:s<86400?`${Math.floor(s/3600)}h`:`${Math.floor(s/86400)}d`}function _e(n){return!!n.snoozedUntil&&new Date(n.snoozedUntil)>new Date}function Pe(){const[n,s]=h.useState([]),[p,m]=h.useState(!0),[u,f]=h.useState(null),[o,l]=h.useState("all"),[x,a]=h.useState(null),[b,M]=h.useState(null),[N,S]=h.useState(new Set),[$,H]=h.useState("all"),{toast:g}=P(),V=Z(),y=h.useCallback(async()=>{try{const[t,d,i,k]=await Promise.all([ee("pending"),te(void 0,50),se(),re({status:"blocked"})]),c=[];t.forEach(r=>{const w=Se(r),j=r.type==="custom"&&r.payload.kind==="driver_blocked",E=r.type==="custom"&&r.payload.kind==="self_mod_pr";c.push({id:`approval-${r.id}`,kind:"approval",icon:he,iconColor:j?"text-error":E?"text-warning":"text-accent",urgency:j||E?"high":"medium",message:`${w.kindLabel}: ${w.headline}`,timestamp:r.createdAt,data:r})}),d.filter(r=>r.status==="failed"||r.status==="error").forEach(r=>c.push({id:`run-${r.id}`,kind:"failed_run",icon:ae,iconColor:"text-error",urgency:"high",message:`Run failed: ${r.agentId} — ${r.error??"unknown error"}`,timestamp:r.finishedAt??r.startedAt,data:r})),i.filter(r=>r.status==="error").forEach(r=>c.push({id:`agent-${r.id}`,kind:"error_agent",icon:B,iconColor:"text-error",urgency:"high",message:`Agent error: ${r.name}`,timestamp:r.lastHeartbeat,data:r})),k.forEach(r=>c.push({id:`issue-${r.id}`,kind:"blocked_issue",icon:B,iconColor:"text-warning",urgency:"medium",message:`Blocked: ${r.identifier} — ${r.title}`,timestamp:r.updatedAt,data:r})),c.sort((r,w)=>{const j={high:0,medium:1,low:2};return j[r.urgency]!==j[w.urgency]?j[r.urgency]-j[w.urgency]:new Date(w.timestamp).getTime()-new Date(r.timestamp).getTime()}),s(c),f(null)}catch(t){f(t instanceof Error?t.message:"Failed to load inbox")}m(!1)},[]);h.useEffect(()=>{y()},[y]);const G=async t=>{a(t.id);try{await ie(t.id,"user"),await y();const d=t.type==="goal_proposal"||t.type==="soma_proposal",i=t.type==="custom"&&t.payload.kind==="driver_blocked";g("success",d?"Work approved — TITAN is starting…":i?"Unblocked — TITAN is resuming…":"Approved"),(d||i)&&V("/command-post",{state:{tab:"Work"}})}catch{g("error","Approval failed")}a(null)},K=async t=>{a(t.id);try{await oe(t.id,"user"),await y(),g("success","Rejected")}catch{g("error","Reject failed")}a(null)},O=async(t,d)=>{a(t.id);try{const i=new Date(Date.now()+d*6e4).toISOString();await le(t.id,i),await y(),g("success",`Snoozed for ${d}m`)}catch{g("error","Snooze failed")}a(null)},W=async t=>{a(t.id);try{const d=await de(`/api/command-post/runs/${t.id}/retry`,{method:"POST"});if(!d.ok)throw new Error(`${d.status} ${d.statusText}`);await y(),g("success","Retry queued — TITAN will try again")}catch{g("error","Retry failed")}a(null)},X=t=>{S(d=>{const i=new Set(d);return i.has(t)?i.delete(t):i.add(t),i})},T=async t=>{const d=Array.from(N).map(i=>{var k;return(k=n.find(c=>c.id===i))==null?void 0:k.data}).filter(i=>(i==null?void 0:i.id)!==void 0).map(i=>i.id);if(d.length!==0){a("batch");try{await ne(d,t,"user"),S(new Set),await y(),g("success",`${t==="approve"?"Approved":"Rejected"} ${d.length} item(s)`)}catch{g("error","Batch action failed")}a(null)}},A=n.filter(t=>o==="all"?!0:o==="approvals"?t.kind==="approval":o==="failed_runs"?t.kind==="failed_run":o==="errors"?t.kind==="error_agent"||t.kind==="blocked_issue":!0).filter(t=>$==="all"?!0:t.kind==="approval"?t.data.requestedBy===$:t.kind==="failed_run"?t.data.agentId===$:!0),R=n.filter(t=>t.kind==="approval"),Q=[{id:"all",label:"All",count:n.length},{id:"approvals",label:"Approvals",count:R.length},{id:"failed_runs",label:"Failed Runs",count:n.filter(t=>t.kind==="failed_run").length},{id:"errors",label:"Errors",count:n.filter(t=>t.kind==="error_agent"||t.kind==="blocked_issue").length}],I=Array.from(new Set(R.map(t=>t.data.requestedBy))).filter(Boolean);return e.jsxs("div",{className:"space-y-4",children:[e.jsx(ce,{title:"Inbox",breadcrumbs:[{label:"Command Post"},{label:"Inbox"}]}),N.size>0&&e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-accent/10 border border-accent/20",children:[e.jsxs("span",{className:"text-xs font-medium text-accent",children:[N.size," selected"]}),e.jsx("div",{className:"flex-1"}),e.jsx(v,{size:"sm",variant:"ghost",onClick:()=>T("approve"),loading:x==="batch",icon:e.jsx(L,{size:14}),children:"Approve All"}),e.jsx(v,{size:"sm",variant:"ghost",onClick:()=>T("reject"),loading:x==="batch",icon:e.jsx(F,{size:14}),children:"Reject All"}),e.jsx("button",{onClick:()=>S(new Set),className:"text-xs text-text-muted hover:text-text px-2",children:"Clear"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($e,{tabs:Q,activeTab:o,onChange:l}),e.jsx("div",{className:"flex-1"}),o==="approvals"&&I.length>0&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(fe,{size:12,className:"text-text-muted"}),e.jsxs("select",{value:$,onChange:t=>H(t.target.value),className:"text-xs bg-bg border border-border rounded px-2 py-1 outline-none focus:border-accent",children:[e.jsx("option",{value:"all",children:"All agents"}),I.map(t=>e.jsx("option",{value:t,children:t},t))]})]})]}),p&&e.jsx(pe,{variant:"row",count:5}),u&&e.jsx("div",{className:"text-center py-8 text-error text-sm",children:u}),!p&&!u&&A.length===0&&e.jsx(ue,{icon:e.jsx(ve,{size:32}),title:"Inbox empty",description:"No pending items require your attention."}),!p&&!u&&A.length>0&&e.jsx("div",{className:"space-y-2",children:A.map(t=>{const d=t.icon,i=b===t.id,k=N.has(t.id),c=t.kind==="approval"?t.data:null;return e.jsxs("div",{className:`rounded-xl border overflow-hidden transition-colors ${t.urgency==="high"?"border-error/30 bg-error/5":t.urgency==="medium"?"border-warning/20 bg-warning/[0.03]":"border-border bg-bg-secondary"}`,children:[e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[t.kind==="approval"&&e.jsx("button",{onClick:()=>X(t.id),className:"text-text-muted hover:text-accent transition-colors",children:k?e.jsx(ke,{size:16,className:"text-accent"}):e.jsx(Ne,{size:16})}),e.jsx(d,{size:16,className:t.iconColor}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm text-text font-medium truncate",children:t.message}),e.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-text-muted mt-0.5",children:[c&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(U,{size:10}),c.requestedBy]}),c.thread&&c.thread.length>0&&e.jsxs("span",{className:"flex items-center gap-1 text-accent",children:[e.jsx(D,{size:10}),c.thread.length]}),_e(c)&&e.jsxs("span",{className:"flex items-center gap-1 text-warning",children:[e.jsx(z,{size:10}),"Snoozed"]})]}),e.jsx("span",{children:ze(t.timestamp)})]})]}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[t.kind==="approval"&&e.jsxs(e.Fragment,{children:[e.jsx(v,{size:"sm",variant:"ghost",onClick:()=>G(t.data),loading:x===t.data.id,icon:e.jsx(L,{size:14}),children:"Approve"}),e.jsx(v,{size:"sm",variant:"ghost",onClick:()=>K(t.data),loading:x===t.data.id,icon:e.jsx(F,{size:14}),children:"Reject"}),e.jsxs("div",{className:"relative group",children:[e.jsx(v,{size:"sm",variant:"ghost",icon:e.jsx(z,{size:14}),children:"Snooze"}),e.jsx("div",{className:"absolute right-0 top-full mt-1 hidden group-hover:flex flex-col gap-1 bg-bg border border-border rounded-lg p-1 shadow-lg z-10",children:[15,60,240,1440].map(r=>e.jsx("button",{onClick:()=>O(t.data,r),className:"text-xs text-left px-2 py-1 rounded hover:bg-bg-tertiary whitespace-nowrap",children:r<60?`${r}m`:r<1440?`${r/60}h`:`${r/1440}d`},r))})]}),e.jsx("button",{onClick:()=>M(i?null:t.id),className:"p-1.5 rounded hover:bg-bg-tertiary text-text-muted",children:i?e.jsx(ge,{size:14}):e.jsx(be,{size:14})})]}),t.kind==="failed_run"&&e.jsx(v,{size:"sm",variant:"ghost",onClick:()=>W(t.data),loading:x===t.data.id,icon:e.jsx(me,{size:14}),children:"Retry"}),t.kind==="blocked_issue"&&e.jsx(q,{to:`/command-post/issues/${t.data.id}`,children:e.jsx(v,{size:"sm",variant:"ghost",children:"View"})}),t.kind==="error_agent"&&e.jsx(q,{to:`/command-post/agents/${t.data.id}`,children:e.jsx(v,{size:"sm",variant:"ghost",children:"View"})})]})]}),i&&c&&e.jsxs("div",{className:"px-4 pb-4 border-t border-border/50",children:[c.payload&&!!c.payload.shadowVerdict&&e.jsxs("div",{className:"mt-3 p-2 rounded-lg bg-bg-tertiary/50 text-xs",children:[e.jsx("div",{className:"font-medium text-text-muted mb-1",children:"Shadow Rehearsal"}),e.jsx("div",{className:"text-text-secondary",children:(()=>{const r=c.payload.shadowVerdict;return r?e.jsxs("div",{className:"space-y-1",children:[r.estimatedCostUsd?e.jsxs("div",{children:["Cost: $",Number(r.estimatedCostUsd).toFixed(2)]}):null,r.reversibilityScore!==void 0?e.jsxs("div",{children:["Reversibility: ",Number(r.reversibilityScore).toFixed(2)]}):null,r.breakRisks&&Array.isArray(r.breakRisks)&&r.breakRisks.length>0?e.jsxs("div",{className:"text-error",children:["Risks: ",r.breakRisks.join(", ")]}):null]}):null})()})]}),e.jsx(Ce,{approval:c,onReply:y})]})]},t.id)})})]})}export{Pe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as a,j as e,C as $,ao as E,ap as D,aq as F}from"./index-BWSnB6Kr.js";import{P as R}from"./PageHeader-BdvxKoad.js";import{R as O,c as W}from"./TitanCanvas-cnb7R1gS.js";import{C as _}from"./circle-check-big-BiMDFx6C.js";import{a as G,C as H}from"./VoiceOverlay-XIyCbAP7.js";import{E as K,a as I}from"./eye-BfW7UcEC.js";const L=[{id:"discord",label:"Discord",description:"Discord bot via discord.js",fields:[{key:"token",label:"Bot Token",placeholder:"Bot token from Discord Developer Portal"}]},{id:"telegram",label:"Telegram",description:"Telegram bot via Grammy",fields:[{key:"token",label:"Bot Token",placeholder:"Token from @BotFather"}]},{id:"slack",label:"Slack",description:"Slack workspace via Bolt SDK",fields:[{key:"token",label:"Bot Token",placeholder:"xoxb-..."},{key:"apiKey",label:"Signing Secret",placeholder:"Signing secret from Slack app settings"}]},{id:"whatsapp",label:"WhatsApp",description:"WhatsApp via Twilio",fields:[{key:"token",label:"Auth Token",placeholder:"Twilio auth token"},{key:"apiKey",label:"Account SID",placeholder:"Twilio account SID"}]},{id:"googlechat",label:"Google Chat",description:"Google Chat spaces",fields:[{key:"token",label:"Service Account Key",placeholder:"JSON key path or content"}]},{id:"matrix",label:"Matrix",description:"Matrix protocol (Element, etc.)",fields:[{key:"token",label:"Access Token",placeholder:"Matrix access token"}]},{id:"signal",label:"Signal",description:"Signal messenger",fields:[{key:"token",label:"API Token",placeholder:"Signal API token"}]},{id:"msteams",label:"Microsoft Teams",description:"MS Teams via Bot Framework",fields:[{key:"token",label:"App Password",placeholder:"Bot framework app password"},{key:"apiKey",label:"App ID",placeholder:"Bot framework app ID"}]},{id:"irc",label:"IRC",description:"Internet Relay Chat",fields:[{key:"token",label:"Password",placeholder:"NickServ password (optional)"}]},{id:"mattermost",label:"Mattermost",description:"Self-hosted team chat",fields:[{key:"token",label:"Bot Token",placeholder:"Mattermost bot access token"}]},{id:"lark",label:"Lark",description:"Lark/Feishu messaging",fields:[{key:"token",label:"App Token",placeholder:"Lark app token"},{key:"apiKey",label:"App Secret",placeholder:"Lark app secret"}]},{id:"email_inbound",label:"Email (Inbound)",description:"IMAP email webhook",fields:[{key:"token",label:"IMAP Password",placeholder:"IMAP password or app password"}]},{id:"line",label:"LINE",description:"LINE messaging platform",fields:[{key:"token",label:"Channel Access Token",placeholder:"LINE channel access token"},{key:"apiKey",label:"Channel Secret",placeholder:"LINE channel secret"}]},{id:"zulip",label:"Zulip",description:"Zulip team chat",fields:[{key:"apiKey",label:"API Key",placeholder:"Zulip API key"}]}],Z=[{value:"pairing",label:"Pairing",desc:"User must pair first"},{value:"open",label:"Open",desc:"Anyone can DM"},{value:"closed",label:"Closed",desc:"DMs disabled"}];function q({def:l,config:o,status:b,onSave:f,saving:v}){const[d,k]=a.useState(!1),[x,N]=a.useState(o.enabled),[p,c]=a.useState(""),[m,u]=a.useState(""),[g,w]=a.useState(o.dmPolicy),[y,t]=a.useState(!1),[n,h]=a.useState(!1),[r,i]=a.useState(!1),j=v===l.id,C=(b==null?void 0:b.status)==="connected",A=!!o.token,P=!!o.apiKey,M=()=>{N(!x),i(!0)},B=async()=>{const s={enabled:x,dmPolicy:g};p&&(s.token=p),m&&(s.apiKey=m),await f(l.id,s),c(""),u(""),i(!1)},S=l.fields.find(s=>s.key==="token"),T=l.fields.find(s=>s.key==="apiKey");return e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary",children:[e.jsxs("button",{onClick:()=>k(!d),className:"flex w-full items-center justify-between px-4 py-3 text-left",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[d?e.jsx(G,{className:"h-4 w-4 text-text-muted"}):e.jsx(H,{className:"h-4 w-4 text-text-muted"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm font-medium text-text",children:l.label}),e.jsx("span",{className:"ml-2 text-xs text-text-muted",children:l.description})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[C&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-success/10 px-2.5 py-0.5 text-xs font-medium text-success",children:[e.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-success"}),"Connected"]}),e.jsx("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium ${o.enabled?"bg-accent/10 text-accent-hover":"bg-border-light/20 text-text-muted"}`,children:o.enabled?"Enabled":"Disabled"})]})]}),d&&e.jsxs("div",{className:"border-t border-bg-tertiary px-4 py-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("label",{className:"text-sm text-text-secondary",children:"Enabled"}),e.jsx("button",{onClick:M,className:`relative inline-flex h-6 w-11 items-center rounded-full transition-colors ${x?"bg-accent":"bg-border"}`,children:e.jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${x?"translate-x-6":"translate-x-1"}`})})]}),S&&e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 flex items-center gap-2 text-xs text-text-muted",children:[S.label,A&&e.jsx("span",{className:"rounded bg-success/10 px-1.5 py-0.5 text-[10px] text-success",children:"set"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:`channel-${l.id}-token`,name:`channel-${l.id}-token`,type:y?"text":"password",value:p,onChange:s=>{c(s.target.value),i(!0)},placeholder:A?"(configured — enter new value to change)":S.placeholder,className:"w-full rounded-lg border border-border bg-bg px-3 py-2 pr-10 text-sm text-text outline-none focus:border-accent"}),e.jsx("button",{type:"button",onClick:()=>t(!y),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary",children:y?e.jsx(K,{className:"h-4 w-4"}):e.jsx(I,{className:"h-4 w-4"})})]})]}),T&&e.jsxs("div",{children:[e.jsxs("label",{className:"mb-1 flex items-center gap-2 text-xs text-text-muted",children:[T.label,P&&e.jsx("span",{className:"rounded bg-success/10 px-1.5 py-0.5 text-[10px] text-success",children:"set"})]}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:`channel-${l.id}-api-key`,name:`channel-${l.id}-api-key`,type:n?"text":"password",value:m,onChange:s=>{u(s.target.value),i(!0)},placeholder:P?"(configured — enter new value to change)":T.placeholder,className:"w-full rounded-lg border border-border bg-bg px-3 py-2 pr-10 text-sm text-text outline-none focus:border-accent"}),e.jsx("button",{type:"button",onClick:()=>h(!n),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-secondary",children:n?e.jsx(K,{className:"h-4 w-4"}):e.jsx(I,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"mb-1 block text-xs text-text-muted",children:"DM Policy"}),e.jsx("div",{className:"flex gap-2",children:Z.map(s=>e.jsx("button",{onClick:()=>{w(s.value),i(!0)},className:`rounded-lg border px-3 py-1.5 text-xs transition-colors ${g===s.value?"border-accent bg-accent/10 text-accent-hover":"border-border text-text-muted hover:border-border-light"}`,title:s.desc,children:s.label},s.value))})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:B,disabled:j||!r,className:"flex items-center gap-2 rounded-lg bg-accent px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-accent/80 disabled:opacity-50",children:[e.jsx(W,{className:"h-3.5 w-3.5"}),j?"Saving...":"Save"]})})]})]})}function Y(){const[l,o]=a.useState([]),[b,f]=a.useState({}),[v,d]=a.useState(!0),[k,x]=a.useState(null),[N,p]=a.useState(null),[c,m]=a.useState(null),u=async()=>{try{const[t,n]=await Promise.all([E(),D()]);o(t),f(n)}catch(t){x(t instanceof Error?t.message:"Failed to fetch channels")}finally{d(!1)}};a.useEffect(()=>{u()},[]);const g=(t,n)=>{m({type:t,message:n}),setTimeout(()=>m(null),3e3)},w=async(t,n)=>{var h;p(t);try{await F(t,n);const[r,i]=await Promise.all([E(),D()]);o(r),f(i);const j=((h=L.find(C=>C.id===t))==null?void 0:h.label)??t;g("success",`${j} settings saved (restart gateway to apply)`)}catch(r){g("error",r instanceof Error?r.message:"Failed to save")}finally{p(null)}};if(v)return e.jsx("div",{className:"space-y-2",children:Array.from({length:5}).map((t,n)=>e.jsx("div",{className:"h-14 animate-pulse rounded-xl border border-border bg-bg-secondary"},n))});if(k)return e.jsx("div",{className:"rounded-xl border border-error/50 bg-bg-secondary p-6 text-center text-error",children:k});const y={enabled:!1,allowFrom:[],dmPolicy:"pairing"};return e.jsxs("div",{className:"space-y-6",children:[e.jsx(R,{title:"Channels",subtitle:`Configure messaging channels — ${l.filter(t=>t.status==="connected").length} connected`,breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Tools"},{label:"Channels"}],actions:e.jsxs("button",{onClick:()=>{d(!0),u()},className:"flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs text-text-secondary hover:border-border-light hover:text-text",children:[e.jsx(O,{className:"h-3.5 w-3.5"}),"Refresh"]})}),c&&e.jsxs("div",{className:`flex items-center gap-2 rounded-lg border px-4 py-2 text-sm ${c.type==="success"?"border-success/50 text-success":"border-error/50 text-error"}`,children:[c.type==="success"?e.jsx(_,{className:"h-4 w-4"}):e.jsx($,{className:"h-4 w-4"}),c.message]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Built-in"}),e.jsxs("div",{className:"rounded-xl border border-bg-tertiary bg-bg-secondary px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium text-text",children:"WebChat"}),e.jsx("span",{className:"text-xs text-text-muted",children:"HTTP/WebSocket — always enabled"})]}),e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-success/10 px-2.5 py-0.5 text-xs font-medium text-success",children:[e.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full bg-success"}),"Connected"]})]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wider text-text-muted mb-3",children:"Messaging Channels"}),e.jsx("div",{className:"space-y-2",children:L.map(t=>{const n=b[t.id]??y,h=l.find(r=>r.name===t.id||r.type===t.id);return e.jsx(q,{def:t,config:n,status:h,onSave:w,saving:N},t.id)})})]}),e.jsx("p",{className:"text-xs text-text-muted text-center",children:"Channel changes are saved to config. Restart the gateway to connect/disconnect channels."})]})}export{Y as default};
|