titan-agent 6.1.0-alpha.21 → 6.1.0-alpha.22
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-8BT07CN0.js → AuditPanel-Cq1d4qHl.js} +1 -1
- package/ui/dist/assets/{AutonomyPanel-D77ftutw.js → AutonomyPanel-l1zO62jm.js} +2 -2
- package/ui/dist/assets/{AutopilotPanel-CWcx48Ak.js → AutopilotPanel--VswZwbS.js} +1 -1
- package/ui/dist/assets/{AutoresearchPanel-BXsu3D84.js → AutoresearchPanel-BntNzU0F.js} +1 -1
- package/ui/dist/assets/BackupPanel-B07WhM-X.js +1 -0
- package/ui/dist/assets/{BrowserPanel-C5EVUaKl.js → BrowserPanel-Bgpjizbi.js} +1 -1
- package/ui/dist/assets/{CPActivity-COjLxkKl.js → CPActivity-DR8D-rb9.js} +1 -1
- package/ui/dist/assets/{CPAgentDetail-BQiFi2K_.js → CPAgentDetail-BcvFLyGv.js} +1 -1
- package/ui/dist/assets/{CPAgents-aZXgFuyT.js → CPAgents-0XFKyEEF.js} +1 -1
- package/ui/dist/assets/{CPApprovals-CX1kalsr.js → CPApprovals-Cu6DbFe0.js} +1 -1
- package/ui/dist/assets/{CPCosts-BSolvzGk.js → CPCosts-CpBOyn3E.js} +1 -1
- package/ui/dist/assets/{CPDashboard-BixdZAgR.js → CPDashboard-C7dEizbp.js} +1 -1
- package/ui/dist/assets/{CPFiles-BHzwv3eY.js → CPFiles-Csi3BVQ9.js} +1 -1
- package/ui/dist/assets/{CPGoals-CiwZx2G3.js → CPGoals-Cjy85AX_.js} +1 -1
- package/ui/dist/assets/{CPInbox-DB116yad.js → CPInbox-DQRnNHr3.js} +1 -1
- package/ui/dist/assets/{CPIssueDetail-Dxu9cP-j.js → CPIssueDetail-Dhw5F0OJ.js} +1 -1
- package/ui/dist/assets/{CPIssues-DQ28a9ki.js → CPIssues-4NLnDU3I.js} +1 -1
- package/ui/dist/assets/{CPLayout-BQpfZQhx.js → CPLayout-OPV4uWdD.js} +3 -3
- package/ui/dist/assets/{CPOrg-BcfrUzTy.js → CPOrg-B8PjYnT3.js} +1 -1
- package/ui/dist/assets/{CPRuns-so41BCqP.js → CPRuns-CuVGv8N6.js} +1 -1
- package/ui/dist/assets/{CPSocial-BhTMHeaz.js → CPSocial-CkvN-ZK9.js} +1 -1
- package/ui/dist/assets/ChannelsPanel-CXGwCEix.js +1 -0
- package/ui/dist/assets/{CheckpointsPanel-2O_c14tV.js → CheckpointsPanel-DYqECLje.js} +1 -1
- package/ui/dist/assets/{CommandPostHub-CSkkEOeS.js → CommandPostHub-4x75O9gq.js} +3 -3
- package/ui/dist/assets/{CronPanel-BXuEs50R.js → CronPanel-DyM9YnNg.js} +1 -1
- package/ui/dist/assets/{DataTable-Qr7q00y6.js → DataTable-DI6TqEtq.js} +1 -1
- package/ui/dist/assets/{DreamPanel-Cqfg11Fa.js → DreamPanel-DZm60YhE.js} +1 -1
- package/ui/dist/assets/{EmptyState-CJtHSl9x.js → EmptyState-C7Ew65Up.js} +1 -1
- package/ui/dist/assets/{EvalHarnessPanel-BL68R8eH.js → EvalHarnessPanel-ClC7VCVU.js} +2 -2
- package/ui/dist/assets/{EvalPanel-CnnCE4wR.js → EvalPanel-C9JbwFA5.js} +1 -1
- package/ui/dist/assets/{FileViewer-CV36nNFe.js → FileViewer-CEzuNuzp.js} +1 -1
- package/ui/dist/assets/{FilesPanel-CN60S7vn.js → FilesPanel-BiqfVrp8.js} +2 -2
- package/ui/dist/assets/FleetPanel-e9RKiSGn.js +1 -0
- package/ui/dist/assets/{HomelabPanel-BBi_sOnf.js → HomelabPanel-BoKGvThv.js} +2 -2
- package/ui/dist/assets/InfraView-DwqtH1aU.js +2 -0
- package/ui/dist/assets/{InlineEditableField-D1ejqsIz.js → InlineEditableField-CrONUXJx.js} +1 -1
- package/ui/dist/assets/{Input-BGRt46nj.js → Input-DwXJfZQE.js} +1 -1
- package/ui/dist/assets/IntegrationsPanel-6qP_F4u6.js +1 -0
- package/ui/dist/assets/IntelligenceView-eIu1ewvD.js +2 -0
- package/ui/dist/assets/LearningPanel-CeAdYxRR.js +1 -0
- package/ui/dist/assets/{LogsPanel-o51luvlB.js → LogsPanel-B-MU32zk.js} +1 -1
- package/ui/dist/assets/McpPanel-CFDI5Nme.js +1 -0
- package/ui/dist/assets/{MemoryGraphPanel-B7l9kaow.js → MemoryGraphPanel-B7pDr6Wh.js} +1 -1
- package/ui/dist/assets/{MemoryWikiPanel-hnyGXG_P.js → MemoryWikiPanel-CHnofhru.js} +2 -2
- package/ui/dist/assets/{MeshPanel-BUi6vy8P.js → MeshPanel-Cd9wPGoj.js} +1 -1
- package/ui/dist/assets/MissionCanvas-DsA2w28s.js +15 -0
- package/ui/dist/assets/MissionChat-hzVOsRV2.js +3 -0
- package/ui/dist/assets/MissionLibrary-BK5qUkCA.js +1 -0
- package/ui/dist/assets/MissionStart-BuCXMi2G.js +1 -0
- package/ui/dist/assets/{Modal-Be0_gZAa.js → Modal-CD5NlUD9.js} +1 -1
- package/ui/dist/assets/NvidiaPanel-0yctWbsi.js +1 -0
- package/ui/dist/assets/{OrganismPanel-CDfVzFfN.js → OrganismPanel-CgVp_iVL.js} +1 -1
- package/ui/dist/assets/OverviewPanel-Mnmqtrd1.js +1 -0
- package/ui/dist/assets/{PageHeader-CJ9Gd7zr.js → PageHeader-D28AkFY9.js} +1 -1
- package/ui/dist/assets/{PersonaProfilesPanel-BRj42j3x.js → PersonaProfilesPanel-B3PkKFgT.js} +1 -1
- package/ui/dist/assets/{PersonasPanel-BA592y5P.js → PersonasPanel-CCp1vj89.js} +1 -1
- package/ui/dist/assets/RecipesPanel-Ck5C63rS.js +1 -0
- package/ui/dist/assets/{SecurityPanel-D0toY2UV.js → SecurityPanel-CtkLNLDH.js} +1 -1
- package/ui/dist/assets/SelfImprovePanel-DnpNkUWB.js +1 -0
- package/ui/dist/assets/{SelfProposalsPanel-B1Zv3VHZ.js → SelfProposalsPanel-Cd3xHFmn.js} +2 -2
- package/ui/dist/assets/{SessionsPanel-BDIz9mpQ.js → SessionsPanel-B5uu2UTx.js} +1 -1
- package/ui/dist/assets/{SessionsTab-BaROTK7h.js → SessionsTab-BiMTuNOE.js} +1 -1
- package/ui/dist/assets/SettingsPanel-ppxXav7m.js +1 -0
- package/ui/dist/assets/SettingsView-D9YIqugm.js +2 -0
- package/ui/dist/assets/{SkeletonLoader-i2w1eOGD.js → SkeletonLoader-C3RRc1JS.js} +1 -1
- package/ui/dist/assets/{SkillsPanel-CaNyPVsx.js → SkillsPanel-Fu1XZykR.js} +1 -1
- package/ui/dist/assets/{SomaView-CmRA1YH_.js → SomaView-5n-mlJ20.js} +1 -1
- package/ui/dist/assets/{StatCard-DUScqjv3.js → StatCard-Bg8rFwEp.js} +1 -1
- package/ui/dist/assets/{StatusBadge-y6Q_954x.js → StatusBadge-C0gmL26P.js} +1 -1
- package/ui/dist/assets/{Tabs-C5y4WddV.js → Tabs-B5Mn9d1Z.js} +1 -1
- package/ui/dist/assets/{TeamsPanel-CWP0ac_n.js → TeamsPanel-DTOreSN5.js} +1 -1
- package/ui/dist/assets/TelemetryPanel-DYu3WcHI.js +1 -0
- package/ui/dist/assets/{TitanCanvas-B1R_qmol.js → TitanCanvas-Crd_etVw.js} +39 -39
- package/ui/dist/assets/ToolsView-Bhd95Jh7.js +2 -0
- package/ui/dist/assets/{Tooltip-axc6bk9C.js → Tooltip-Vs_3mrec.js} +1 -1
- package/ui/dist/assets/{TraceViewer-xPN4-Khh.js → TraceViewer-CoiVA_rx.js} +1 -1
- package/ui/dist/assets/TrainingPanel-C9nplQoh.js +1 -0
- package/ui/dist/assets/{VoiceOverlay-CChicn0J.js → VoiceOverlay-BC75-OIG.js} +1 -1
- package/ui/dist/assets/{VramPanel-CwJuYMrX.js → VramPanel-DXKtxGGp.js} +1 -1
- package/ui/dist/assets/{WatchView-CPOOns31.js → WatchView-D_uB10Ze.js} +1 -1
- package/ui/dist/assets/{WorkTab-CIZQLzGw.js → WorkTab-B5ZwjYWM.js} +1 -1
- package/ui/dist/assets/{WorkflowsPanel-DY78h_dY.js → WorkflowsPanel-VtM0siaT.js} +2 -2
- package/ui/dist/assets/{arrow-left-7_fJecFK.js → arrow-left-C40Zzo4e.js} +1 -1
- package/ui/dist/assets/{briefcase-fy1J4JXA.js → briefcase-ilFetX6L.js} +1 -1
- package/ui/dist/assets/{chart-column-BN7avNW3.js → chart-column-DEUwIlQD.js} +1 -1
- package/ui/dist/assets/{check-q1YoP0PN.js → check-BmeA_36a.js} +1 -1
- package/ui/dist/assets/{chevron-down-i32tCQi3.js → chevron-down-C3PrjI-d.js} +1 -1
- package/ui/dist/assets/{chevron-right-CVQ0YoN8.js → chevron-right-D_5QP27T.js} +1 -1
- package/ui/dist/assets/{chevron-up-C0S0X82A.js → chevron-up-xrfX9iXN.js} +1 -1
- package/ui/dist/assets/{circle-check-big-hNb9ZHeR.js → circle-check-big-DjMpXACt.js} +1 -1
- package/ui/dist/assets/{clock-B0yiHOrC.js → clock-D9dj8p1r.js} +1 -1
- package/ui/dist/assets/{dollar-sign-ChurwnNP.js → dollar-sign-BulM6dxR.js} +1 -1
- package/ui/dist/assets/{download-CxK6hbWX.js → download-BHv2bzHU.js} +1 -1
- package/ui/dist/assets/{external-link-CDfr4-Iv.js → external-link-CZh8_LAF.js} +1 -1
- package/ui/dist/assets/{eye-off-DmO4iLYy.js → eye-off-B2xdfJUj.js} +1 -1
- package/ui/dist/assets/{folder-njYuUpTd.js → folder-CHZqSMue.js} +1 -1
- package/ui/dist/assets/{funnel-BwZqmaE7.js → funnel-DpcKgmVb.js} +1 -1
- package/ui/dist/assets/{git-branch-DHLXZ21t.js → git-branch-BOAEl4fG.js} +1 -1
- package/ui/dist/assets/{index-BcjuOJPJ.js → index-BU17I9hX.js} +14 -14
- package/ui/dist/assets/index-DOUUJGQJ.css +1 -0
- package/ui/dist/assets/{layers-DKxebfqW.js → layers-Bo8au1UM.js} +1 -1
- package/ui/dist/assets/{legacy-DuO--7eT.js → legacy-DH1p0zoj.js} +1 -1
- package/ui/dist/assets/{lightbulb-ivkEsURY.js → lightbulb-DjhzedeL.js} +1 -1
- package/ui/dist/assets/{list-todo-B2Q1O--f.js → list-todo-CGI6eQrk.js} +1 -1
- package/ui/dist/assets/{loader-circle-BMmFeXSi.js → loader-circle-BaviPWa-.js} +1 -1
- package/ui/dist/assets/{missions-DaiqWx4f.js → missions-BL8xx-ud.js} +1 -1
- package/ui/dist/assets/{network-CeEc6W6m.js → network-MdOcH_y-.js} +1 -1
- package/ui/dist/assets/{pause-CQjq3ZVd.js → pause-lFQNt654.js} +1 -1
- package/ui/dist/assets/{play-eTK1gops.js → play-aAmkOXFj.js} +1 -1
- package/ui/dist/assets/{plug-DhnwXHHu.js → plug-sJc07-RA.js} +1 -1
- package/ui/dist/assets/{plus-B-cVExJa.js → plus-Dwty0JFZ.js} +1 -1
- package/ui/dist/assets/{proxy-B2GP6Xbv.js → proxy-Bv-wApak.js} +1 -1
- package/ui/dist/assets/{rotate-ccw-C8mUEBJC.js → rotate-ccw-DmpAMnoF.js} +1 -1
- package/ui/dist/assets/{save-BzFgJh-9.js → save-BdOQXAka.js} +1 -1
- package/ui/dist/assets/{search-3HFP0a6X.js → search-BUlbT-aT.js} +1 -1
- package/ui/dist/assets/{send-DoiK0E13.js → send-CWc9tYqk.js} +1 -1
- package/ui/dist/assets/{shield-check-C5br294y.js → shield-check-ChQz9pPn.js} +1 -1
- package/ui/dist/assets/{target-DdW0YJR8.js → target-DIF5T_yj.js} +1 -1
- package/ui/dist/assets/{terminal-Dn8iAGcd.js → terminal-BgpIZWzR.js} +1 -1
- package/ui/dist/assets/{toggle-right-FJcwLyqg.js → toggle-right-ej8RUHjl.js} +1 -1
- package/ui/dist/assets/{trash-2-CA-SZ5ks.js → trash-2-B6ITzg87.js} +1 -1
- package/ui/dist/assets/{trending-up-U-PgGq8y.js → trending-up-BscGb-5s.js} +1 -1
- package/ui/dist/assets/{trophy-D5tTaPmg.js → trophy-DjrU4Va_.js} +1 -1
- package/ui/dist/assets/{users-Y-iozoC0.js → users-DHaLcBWd.js} +1 -1
- package/ui/dist/assets/{wrench-vXNU2nxT.js → wrench-BKGESH8T.js} +1 -1
- package/ui/dist/index.html +2 -2
- package/ui/dist/sw.js +1 -1
- package/ui/dist/assets/BackupPanel-DBG8_vD4.js +0 -1
- package/ui/dist/assets/ChannelsPanel-imfhpIpj.js +0 -1
- package/ui/dist/assets/FleetPanel-B0gpRtTI.js +0 -1
- package/ui/dist/assets/InfraView-CCruR6-4.js +0 -2
- package/ui/dist/assets/IntegrationsPanel-BwEuI-z-.js +0 -1
- package/ui/dist/assets/IntelligenceView-CcjO5xRG.js +0 -2
- package/ui/dist/assets/LearningPanel-DvCphEfP.js +0 -1
- package/ui/dist/assets/McpPanel-DzsuJLtb.js +0 -1
- package/ui/dist/assets/MissionCanvas-DxX7cRg3.js +0 -15
- package/ui/dist/assets/MissionChat-2m8UkkUo.js +0 -3
- package/ui/dist/assets/MissionLibrary-CLzXPVLY.js +0 -1
- package/ui/dist/assets/MissionStart-DJbIIjbS.js +0 -1
- package/ui/dist/assets/NvidiaPanel-CJkZZbwm.js +0 -1
- package/ui/dist/assets/OverviewPanel-D1QUas_B.js +0 -1
- package/ui/dist/assets/RecipesPanel-DPCXO_Y2.js +0 -1
- package/ui/dist/assets/SelfImprovePanel-88xtV8Fr.js +0 -1
- package/ui/dist/assets/SettingsPanel-CePXS5Tw.js +0 -1
- package/ui/dist/assets/SettingsView-C8F4tZrp.js +0 -2
- package/ui/dist/assets/SponsorFooter-DsfmU6cx.js +0 -1
- package/ui/dist/assets/TelemetryPanel-CmVNwBWH.js +0 -1
- package/ui/dist/assets/ToolsView-DG2SUFNr.js +0 -2
- package/ui/dist/assets/TrainingPanel-DbhMsJgj.js +0 -1
- package/ui/dist/assets/index-DDuumDda.css +0 -1
package/dist/utils/constants.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { homedir } from "os";
|
|
3
3
|
import { join } from "path";
|
|
4
|
-
const TITAN_VERSION = "6.1.0-alpha.
|
|
4
|
+
const TITAN_VERSION = "6.1.0-alpha.22";
|
|
5
5
|
const TITAN_CODENAME = "Living Canvas";
|
|
6
6
|
const TITAN_NAME = "TITAN";
|
|
7
7
|
const TITAN_FULL_NAME = "The Intelligent Task Automation Network";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/constants.ts"],"sourcesContent":["/**\n * TITAN Constants\n */\nimport { homedir } from 'os';\nimport { join } from 'path';\n\nexport const TITAN_VERSION = '6.1.0-alpha.
|
|
1
|
+
{"version":3,"sources":["../../src/utils/constants.ts"],"sourcesContent":["/**\n * TITAN Constants\n */\nimport { homedir } from 'os';\nimport { join } from 'path';\n\nexport const TITAN_VERSION = '6.1.0-alpha.22';\nexport const TITAN_CODENAME = 'Living Canvas';\nexport const TITAN_NAME = 'TITAN';\nexport const TITAN_FULL_NAME = 'The Intelligent Task Automation Network';\nexport const TITAN_ASCII_LOGO = `\n╔══════════════════════════════════════════════════════╗\n║ ║\n║ ████████╗██╗████████╗ █████╗ ███╗ ██╗ ║\n║ ██║ ██║ ██║ ██╔══██╗████╗ ██║ ║\n║ ██║ ██║ ██║ ███████║██╔██╗ ██║ ║\n║ ██║ ██║ ██║ ██╔══██║██║╚██╗██║ ║\n║ ██║ ██║ ██║ ██║ ██║██║ ╚████║ ║\n║ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ║\n║ ║\n║ The Intelligent Task Automation Network ║\n║ v${TITAN_VERSION} • by Tony Elliott ║\n╚══════════════════════════════════════════════════════╝`;\n\n// Paths\n// Hunt Finding #03 (2026-04-14): honor TITAN_HOME env var if set.\n// Previously this was hardcoded to `~/.titan`, which meant:\n// - Docker containers couldn't override the config path\n// - Shared machines couldn't isolate per-user state\n// - Test fixtures couldn't run against an isolated home\n// - The systemd unit's `Environment=TITAN_HOME=...` was silently ignored\n// The env var is read once at module load (constants are resolved at import time).\n// If TITAN_HOME starts with `~/`, expand it to the user's home dir.\nfunction resolveTitanHome(): string {\n const envHome = process.env.TITAN_HOME;\n if (envHome && envHome.trim().length > 0) {\n const trimmed = envHome.trim();\n if (trimmed.startsWith('~/')) {\n return join(homedir(), trimmed.slice(2));\n }\n if (trimmed === '~') {\n return homedir();\n }\n return trimmed;\n }\n return join(homedir(), '.titan');\n}\nexport const TITAN_HOME = resolveTitanHome();\nexport const TITAN_CONFIG_PATH = join(TITAN_HOME, 'titan.json');\nexport const TITAN_DB_PATH = join(TITAN_HOME, 'titan.db');\nexport const TITAN_WORKSPACE = join(TITAN_HOME, 'workspace');\nexport const TITAN_SKILLS_DIR = join(TITAN_WORKSPACE, 'skills');\nexport const TITAN_LOGS_DIR = join(TITAN_HOME, 'logs');\nexport const TITAN_MEMORY_DIR = join(TITAN_HOME, 'memory');\n\n// Workspace prompt files (injected into agent context)\nexport const AGENTS_MD = join(TITAN_WORKSPACE, 'AGENTS.md');\nexport const SOUL_MD = join(TITAN_WORKSPACE, 'SOUL.md');\nexport const TOOLS_MD = join(TITAN_WORKSPACE, 'TOOLS.md');\nexport const TITAN_MD_FILENAME = 'TITAN.md';\nexport const AUTOPILOT_MD = join(TITAN_HOME, 'AUTOPILOT.md');\nexport const AUTOPILOT_RUNS_PATH = join(TITAN_HOME, 'autopilot-runs.jsonl');\nexport const TITAN_CREDENTIALS_DIR = join(TITAN_HOME, 'credentials');\n\n// Income & lead tracking\nexport const INCOME_LEDGER_PATH = join(TITAN_HOME, 'income-ledger.jsonl');\nexport const FREELANCE_LEADS_PATH = join(TITAN_HOME, 'freelance-leads.jsonl');\nexport const FREELANCE_PROFILE_PATH = join(TITAN_HOME, 'freelance-profile.json');\nexport const LEADS_PATH = join(TITAN_HOME, 'leads.jsonl');\nexport const TELEMETRY_EVENTS_PATH = join(TITAN_HOME, 'telemetry-events.jsonl');\nexport const SOMADRIVE_STATE_PATH = join(TITAN_HOME, 'soma-drive-state.json');\nexport const ACTIVITY_LOG_PATH = join(TITAN_HOME, 'activity-log.jsonl');\n\n// v6.1.0 — Mission Chat\nexport const MISSIONS_DIR = join(TITAN_HOME, 'missions');\nexport const PLAYS_DIR = join(TITAN_HOME, 'plays');\n\n// Gateway defaults\nexport const DEFAULT_GATEWAY_HOST = '0.0.0.0';\nexport const DEFAULT_GATEWAY_PORT = 48420;\nexport const DEFAULT_WEB_PORT = 48421;\n\n// Agent defaults\n// v6.0.1 — Hardcoded floor only. The actual default at runtime is picked\n// by `getDefaultModelId()` in `src/providers/defaultModel.ts`, which\n// detects the user's available API keys (Anthropic / OpenAI / Google /\n// OpenRouter) and selects accordingly. Falls back to local Ollama when\n// no cloud keys are set. This constant is the last-resort fallback for\n// callsites that don't go through the schema thunk.\nexport const DEFAULT_MODEL = 'anthropic/claude-sonnet-4-20250514';\n/** v5.4.1: User-preference ceiling. Providers clamp per-model via\n * clampMaxTokens() so this can be high without causing 400s on\n * capped endpoints (e.g. Claude Sonnet 4 8K, Cohere 4K). */\nexport const DEFAULT_MAX_TOKENS = 200000;\nexport const DEFAULT_TEMPERATURE = 0.7;\nexport const MAX_CONTEXT_MESSAGES = 50;\nexport const SESSION_TIMEOUT_MS = 30 * 60 * 1000; // 30 minutes\n\n// Security\nexport const DEFAULT_SANDBOX_MODE = 'host';\n/** Default allowed tools. Empty = allow ALL registered tools.\n * Use security.deniedTools to block specific tools instead. */\nexport const ALLOWED_TOOLS_DEFAULT: string[] = [];\nexport const DENIED_TOOLS_DEFAULT: string[] = [];\n"],"mappings":";AAGA,SAAS,eAAe;AACxB,SAAS,YAAY;AAEd,MAAM,gBAAgB;AACtB,MAAM,iBAAiB;AACvB,MAAM,aAAa;AACnB,MAAM,kBAAkB;AACxB,MAAM,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAW1B,aAAa;AAAA;AAYnB,SAAS,mBAA2B;AAChC,QAAM,UAAU,QAAQ,IAAI;AAC5B,MAAI,WAAW,QAAQ,KAAK,EAAE,SAAS,GAAG;AACtC,UAAM,UAAU,QAAQ,KAAK;AAC7B,QAAI,QAAQ,WAAW,IAAI,GAAG;AAC1B,aAAO,KAAK,QAAQ,GAAG,QAAQ,MAAM,CAAC,CAAC;AAAA,IAC3C;AACA,QAAI,YAAY,KAAK;AACjB,aAAO,QAAQ;AAAA,IACnB;AACA,WAAO;AAAA,EACX;AACA,SAAO,KAAK,QAAQ,GAAG,QAAQ;AACnC;AACO,MAAM,aAAa,iBAAiB;AACpC,MAAM,oBAAoB,KAAK,YAAY,YAAY;AACvD,MAAM,gBAAgB,KAAK,YAAY,UAAU;AACjD,MAAM,kBAAkB,KAAK,YAAY,WAAW;AACpD,MAAM,mBAAmB,KAAK,iBAAiB,QAAQ;AACvD,MAAM,iBAAiB,KAAK,YAAY,MAAM;AAC9C,MAAM,mBAAmB,KAAK,YAAY,QAAQ;AAGlD,MAAM,YAAY,KAAK,iBAAiB,WAAW;AACnD,MAAM,UAAU,KAAK,iBAAiB,SAAS;AAC/C,MAAM,WAAW,KAAK,iBAAiB,UAAU;AACjD,MAAM,oBAAoB;AAC1B,MAAM,eAAe,KAAK,YAAY,cAAc;AACpD,MAAM,sBAAsB,KAAK,YAAY,sBAAsB;AACnE,MAAM,wBAAwB,KAAK,YAAY,aAAa;AAG5D,MAAM,qBAAqB,KAAK,YAAY,qBAAqB;AACjE,MAAM,uBAAuB,KAAK,YAAY,uBAAuB;AACrE,MAAM,yBAAyB,KAAK,YAAY,wBAAwB;AACxE,MAAM,aAAa,KAAK,YAAY,aAAa;AACjD,MAAM,wBAAwB,KAAK,YAAY,wBAAwB;AACvE,MAAM,uBAAuB,KAAK,YAAY,uBAAuB;AACrE,MAAM,oBAAoB,KAAK,YAAY,oBAAoB;AAG/D,MAAM,eAAe,KAAK,YAAY,UAAU;AAChD,MAAM,YAAY,KAAK,YAAY,OAAO;AAG1C,MAAM,uBAAuB;AAC7B,MAAM,uBAAuB;AAC7B,MAAM,mBAAmB;AASzB,MAAM,gBAAgB;AAItB,MAAM,qBAAqB;AAC3B,MAAM,sBAAsB;AAC5B,MAAM,uBAAuB;AAC7B,MAAM,qBAAqB,KAAK,KAAK;AAGrC,MAAM,uBAAuB;AAG7B,MAAM,wBAAkC,CAAC;AACzC,MAAM,uBAAiC,CAAC;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "titan-agent",
|
|
3
|
-
"version": "6.1.0-alpha.
|
|
3
|
+
"version": "6.1.0-alpha.22",
|
|
4
4
|
"description": "TITAN — Autonomous AI agent framework with self-improvement, multi-agent orchestration, 36 LLM providers, 16 channel adapters, GPU VRAM management, mesh networking, LiveKit voice, TITAN-Soma homeostatic drives, and a React Mission Control dashboard. Open-source, TypeScript, MIT licensed.",
|
|
5
5
|
"author": "Tony Elliott (https://github.com/Djtony707)",
|
|
6
6
|
"repository": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as S,r as d,j as e,af as A,ag as k}from"./index-
|
|
1
|
+
import{c as S,r as d,j as e,af as A,ag as k}from"./index-BU17I9hX.js";import{R as C}from"./terminal-BgpIZWzR.js";import{F as T}from"./funnel-DpcKgmVb.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 M,r as c,a6 as B,j as e,f as F,Z as E,ae as O,t as C,b,S as g,G as q,e as T}from"./index-
|
|
1
|
+
import{c as M,r as c,a6 as B,j as e,f as F,Z as E,ae as O,t as C,b,S as g,G as q,e as T}from"./index-BU17I9hX.js";import{L as I}from"./loader-circle-BaviPWa-.js";import{S as G}from"./save-BdOQXAka.js";import{C as V}from"./circle-check-big-DjMpXACt.js";import{R as D}from"./terminal-BgpIZWzR.js";import{R}from"./rotate-ccw-DmpAMnoF.js";import{R as H,b as U,a as J,D as Z}from"./TitanCanvas-Crd_etVw.js";import{B as W}from"./wrench-BKGESH8T.js";import{N as K}from"./network-MdOcH_y-.js";import{P as Q}from"./play-aAmkOXFj.js";import{U as X,M as Y}from"./users-DHaLcBWd.js";import"./chevron-up-xrfX9iXN.js";import"./plus-Dwty0JFZ.js";import"./search-BUlbT-aT.js";import"./send-CWc9tYqk.js";import"./VoiceOverlay-BC75-OIG.js";import"./chevron-right-D_5QP27T.js";import"./chevron-down-C3PrjI-d.js";import"./folder-CHZqSMue.js";import"./clock-D9dj8p1r.js";import"./check-BmeA_36a.js";import"./shield-check-ChQz9pPn.js";import"./external-link-CZh8_LAF.js";/**
|
|
2
2
|
* @license lucide-react v0.513.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -8,4 +8,4 @@ import{c as M,r as c,a6 as B,j as e,f as F,Z as E,ae as O,t as C,b,S as g,G as q
|
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const te=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],ae=M("puzzle",te),v=[{key:"autonomy-mode",label:"Autonomous Mode",description:"TITAN acts without asking for approval on moderate-risk tools. Supervised = asks for dangerous ops. Locked = asks for everything.",icon:e.jsx(E,{className:"h-4 w-4"}),section:"autonomy",field:"mode",danger:!0},{key:"autonomy-autoProposeGoals",label:"Auto-Propose Goals",description:"TITAN can create its own goals from drives, observations, and initiatives.",icon:e.jsx(g,{className:"h-4 w-4"}),section:"autonomy",field:"autoProposeGoals"},{key:"autonomy-proactiveInitiative",label:"Proactive Initiative",description:"TITAN takes initiative on its own between user messages.",icon:e.jsx(H,{className:"h-4 w-4"}),section:"autonomy",field:"proactiveInitiative"},{key:"selfMod-enabled",label:"Self-Modification",description:"Captures autonomous code changes and queues them for review.",icon:e.jsx(W,{className:"h-4 w-4"}),section:"selfMod",field:"enabled",danger:!0},{key:"selfMod-autoPR",label:"Auto-Open PRs",description:"When specialists approve a self-mod, automatically open a GitHub PR.",icon:e.jsx(oe,{className:"h-4 w-4"}),section:"selfMod",field:"autoPR"},{key:"commandPost-enabled",label:"Command Post",description:"Org chart, agent registry, approvals, budgets, and goal tracking.",icon:e.jsx(U,{className:"h-4 w-4"}),section:"commandPost",field:"enabled"},{key:"mesh-enabled",label:"Mesh Networking",description:"Distributed TITAN nodes. Share tasks and models across machines.",icon:e.jsx(K,{className:"h-4 w-4"}),section:"mesh",field:"enabled"},{key:"autopilot-enabled",label:"Autopilot",description:"Nightly autonomous checks, goal reviews, and self-improvement runs.",icon:e.jsx(Q,{className:"h-4 w-4"}),section:"autopilot",field:"enabled"},{key:"autopilot-selfInitiate",label:"Autopilot Self-Initiate",description:"Autopilot can create and start its own goals without human trigger.",icon:e.jsx(g,{className:"h-4 w-4"}),section:"autopilot",field:"selfInitiate"},{key:"brain-enabled",label:"Brain (Local Router)",description:"Small local model routes tools instead of sending full schemas to the cloud LLM.",icon:e.jsx(J,{className:"h-4 w-4"}),section:"brain",field:"enabled"},{key:"mcp-server-enabled",label:"MCP Server",description:"Expose TITAN tools as a Model Context Protocol server for other AI apps.",icon:e.jsx(ae,{className:"h-4 w-4"}),section:"mcp",field:"serverEnabled"},{key:"training-enabled",label:"Model Training",description:"Fine-tune local LoRA adapters from session history.",icon:e.jsx(se,{className:"h-4 w-4"}),section:"training",field:"enabled"},{key:"teams-enabled",label:"Teams",description:"Multi-user teams with roles, invites, and permissions.",icon:e.jsx(X,{className:"h-4 w-4"}),section:"teams",field:"enabled"},{key:"tunnel-enabled",label:"Cloudflare Tunnel",description:"Expose TITAN securely on the public internet via Cloudflare.",icon:e.jsx(q,{className:"h-4 w-4"}),section:"tunnel",field:"enabled"},{key:"vault-enabled",label:"Vault",description:"Encrypted secret storage for API keys and credentials.",icon:e.jsx(T,{className:"h-4 w-4"}),section:"vault",field:"enabled"},{key:"capsolver-enabled",label:"CAPTCHA Solver",description:"Automatically solve CAPTCHAs during web browsing.",icon:e.jsx(T,{className:"h-4 w-4"}),section:"capsolver",field:"enabled"},{key:"deliberation-autoDetect",label:"Auto-Deliberation",description:"TITAN automatically deliberates on complex tasks before acting.",icon:e.jsx(Y,{className:"h-4 w-4"}),section:"deliberation",field:"autoDetect"},{key:"selfImprove-autoApply",label:"Auto-Apply Self-Improvements",description:"Apply prompt and config improvements automatically without approval.",icon:e.jsx(g,{className:"h-4 w-4"}),section:"selfImprove",field:"autoApply"},{key:"memory-vectorSearchEnabled",label:"Vector Memory Search",description:"Semantic search across episodic memories using embeddings.",icon:e.jsx(Z,{className:"h-4 w-4"}),section:"memory",field:"vectorSearchEnabled"}];function oe({className:i}){return e.jsx("svg",{className:i,viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"})})}function P({active:i}){return i?e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-success/15 px-2 py-0.5 text-[10px] font-medium text-success",children:[e.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-success shadow-[0_0_4px_rgba(34,197,94,0.4)]"}),"ON"]}):e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-bg-tertiary px-2 py-0.5 text-[10px] font-medium text-text-muted",children:[e.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-border-light"}),"OFF"]})}function Ie(){const[i,y]=c.useState(null),[L,N]=c.useState(!0),[x,j]=c.useState(!1),[f,m]=c.useState(!1),[p,w]=c.useState(null),[d,k]=c.useState(new Set),[h,A]=c.useState({}),l=c.useCallback((s,t)=>{w({type:s,message:t}),setTimeout(()=>w(null),4e3)},[]);c.useEffect(()=>{B().then(s=>{y(s),N(!1)}).catch(s=>{l("error",s instanceof Error?s.message:"Failed to load config"),N(!1)})},[l]);const u=(s,t)=>{if(t==="serverEnabled"){const a=i==null?void 0:i.mcp,n=a==null?void 0:a.server;return!!(n!=null&&n.enabled)}if(t==="selfInitiate"){const a=i==null?void 0:i.autopilot,n=a==null?void 0:a.goals;return!!(n!=null&&n.selfInitiate)}const o=`${s}.${t}`;if(o in h)return h[o];const r=i==null?void 0:i[s];return r?r[t]:!1},S=(s,t,o)=>{const r=`${s}.${t}`;A(a=>({...a,[r]:o})),k(a=>new Set(a).add(r))},$=v.filter(s=>{const t=u(s.section,s.field);return typeof t=="boolean"?t:t==="autonomous"}).length,z=async()=>{j(!0);try{const s={};for(const o of d){const[r,a]=o.split("."),n=h[o];s[r]||(s[r]={}),a==="serverEnabled"?(s.mcp||(s.mcp={}),s.mcp.server={enabled:n}):a==="selfInitiate"?(s.autopilot||(s.autopilot={}),s.autopilot.goals={selfInitiate:n}):s[r][a]=n}const t=await O(s);y(t),A({}),k(new Set),C("autonomy_settings_saved",{changedCount:d.size}),l("success",`Saved ${d.size} change${d.size!==1?"s":""}`)}catch(s){l("error",s instanceof Error?s.message:"Failed to save")}finally{j(!1)}},_=async()=>{m(!0);try{const s=await b("/api/system/request-restart",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:"Settings change via Autonomy Panel",requestedBy:"user"})});if(!s.ok){const n=await s.json().catch(()=>({error:"Request failed"}));l("error",n.error||"Restart request failed"),m(!1);return}const{approval:t}=await s.json(),o=await b(`/api/command-post/approvals/${t.id}/approve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decidedBy:"user",note:"Approved via Autonomy Panel"})});if(!o.ok){const n=await o.json().catch(()=>({error:"Approval failed"}));l("error",n.error||"Restart approval failed"),m(!1);return}l("info","TITAN is restarting..."),C("titan_restart_initiated",{source:"autonomy_panel"});let r=0;const a=setInterval(async()=>{r++;try{(await b("/api/health")).ok&&(clearInterval(a),m(!1),l("success","TITAN restarted successfully"))}catch{}r>30&&(clearInterval(a),m(!1),l("error","Restart timed out — check Titan PC"))},2e3)}catch(s){l("error",s instanceof Error?s.message:"Restart failed"),m(!1)}};return L?e.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((s,t)=>e.jsx("div",{className:"h-32 animate-pulse rounded-xl border border-border bg-bg-secondary"},t))}):e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold text-text",children:"Autonomy & Features"}),e.jsxs("p",{className:"mt-0.5 text-xs text-text-muted",children:[$," of ",v.length," features active"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[d.size>0&&e.jsxs("span",{className:"rounded-full bg-accent/15 px-2.5 py-1 text-[10px] font-medium text-accent",children:[d.size," unsaved"]}),e.jsxs("button",{onClick:z,disabled:x||d.size===0,className:"flex items-center gap-1.5 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:[x?e.jsx(I,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(G,{className:"h-3.5 w-3.5"}),x?"Saving…":"Save Changes"]})]})]}),p&&e.jsxs("div",{className:`flex items-center gap-2 rounded-lg border px-3 py-2 text-xs ${p.type==="success"?"border-success/50 text-success":p.type==="error"?"border-error/50 text-error":"border-accent/50 text-accent"}`,children:[p.type==="success"?e.jsx(V,{className:"h-4 w-4"}):p.type==="error"?e.jsx(F,{className:"h-4 w-4"}):e.jsx(D,{className:"h-4 w-4 animate-spin"}),p.message]}),e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(E,{className:"h-4 w-4 text-accent"}),e.jsx("h3",{className:"text-sm font-medium text-text",children:"Autonomy Level"}),e.jsx(P,{active:u("autonomy","mode")==="autonomous"})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:["locked","supervised","autonomous"].map(s=>e.jsxs("button",{onClick:()=>S("autonomy","mode",s),className:`rounded-lg border p-3 text-left transition-all ${u("autonomy","mode")===s?"border-accent bg-accent/10":"border-border hover:border-border-light"}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-text capitalize",children:s}),s==="autonomous"&&e.jsx("span",{className:"text-[9px] text-error",children:"High"}),s==="supervised"&&e.jsx("span",{className:"text-[9px] text-warning",children:"Med"}),s==="locked"&&e.jsx("span",{className:"text-[9px] text-success",children:"Low"})]}),e.jsxs("p",{className:"mt-1 text-[10px] text-text-muted leading-relaxed",children:[s==="locked"&&"Asks for approval on every tool call.",s==="supervised"&&"Auto-approves safe tools. Asks for dangerous ops.",s==="autonomous"&&"Full auto. Only asks for destructive/rare ops."]})]},s))})]}),e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:v.filter(s=>s.field!=="mode").map(s=>{const t=u(s.section,s.field),o=typeof t=="boolean"?t:!1,r=d.has(`${s.section}.${s.field}`);return e.jsxs("div",{className:`flex items-start gap-3 rounded-xl border p-3 transition-colors ${r?"border-accent/40 bg-accent/5":"border-border bg-bg-secondary"}`,children:[e.jsx("div",{className:`mt-0.5 flex-shrink-0 rounded-lg p-2 ${o?"bg-accent/15 text-accent":"bg-bg-tertiary text-text-muted"}`,children:s.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-text",children:s.label}),e.jsx(P,{active:o})]}),e.jsx("p",{className:"mt-0.5 text-[11px] text-text-muted leading-relaxed",children:s.description})]}),e.jsxs("label",{className:"flex-shrink-0 relative inline-flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:a=>S(s.section,s.field,a.target.checked),className:"sr-only peer"}),e.jsx("div",{className:`relative w-9 h-5 rounded-full transition-colors ${o?"bg-accent":"bg-border"}`,children:e.jsx("div",{className:`absolute top-[2px] left-[2px] bg-white w-4 h-4 rounded-full transition-transform ${o?"translate-x-4":"translate-x-0"}`})})]})]},s.key)})}),e.jsx("div",{className:"rounded-xl border border-warning/30 bg-warning/5 p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(R,{className:"h-4 w-4 text-warning mt-0.5"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-sm font-medium text-text",children:"Restart TITAN"}),e.jsx("p",{className:"mt-0.5 text-[11px] text-text-muted",children:"Some feature changes require a full restart to take effect. This will briefly interrupt service."})]}),e.jsxs("button",{onClick:_,disabled:f,className:"flex items-center gap-1.5 rounded-lg border border-warning/50 px-3 py-1.5 text-xs font-medium text-warning transition-colors hover:bg-warning/10 disabled:opacity-50",children:[f?e.jsx(I,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(R,{className:"h-3.5 w-3.5"}),f?"Restarting…":"Restart"]})]})})]})}export{Ie as default};
|
|
11
|
+
*/const te=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],ae=M("puzzle",te),v=[{key:"autonomy-mode",label:"Autonomous Mode",description:"TITAN acts without asking for approval on moderate-risk tools. Supervised = asks for dangerous ops. Locked = asks for everything.",icon:e.jsx(E,{className:"h-4 w-4"}),section:"autonomy",field:"mode",danger:!0},{key:"autonomy-autoProposeGoals",label:"Auto-Propose Goals",description:"TITAN can create its own goals from drives, observations, and initiatives.",icon:e.jsx(g,{className:"h-4 w-4"}),section:"autonomy",field:"autoProposeGoals"},{key:"autonomy-proactiveInitiative",label:"Proactive Initiative",description:"TITAN takes initiative on its own between user messages.",icon:e.jsx(H,{className:"h-4 w-4"}),section:"autonomy",field:"proactiveInitiative"},{key:"selfMod-enabled",label:"Self-Modification",description:"Captures autonomous code changes and queues them for review.",icon:e.jsx(W,{className:"h-4 w-4"}),section:"selfMod",field:"enabled",danger:!0},{key:"selfMod-autoPR",label:"Auto-Open PRs",description:"When specialists approve a self-mod, automatically open a GitHub PR.",icon:e.jsx(oe,{className:"h-4 w-4"}),section:"selfMod",field:"autoPR"},{key:"commandPost-enabled",label:"Command Post",description:"Org chart, agent registry, approvals, budgets, and goal tracking.",icon:e.jsx(U,{className:"h-4 w-4"}),section:"commandPost",field:"enabled"},{key:"mesh-enabled",label:"Mesh Networking",description:"Distributed TITAN nodes. Share tasks and models across machines.",icon:e.jsx(K,{className:"h-4 w-4"}),section:"mesh",field:"enabled"},{key:"autopilot-enabled",label:"Autopilot",description:"Nightly autonomous checks, goal reviews, and self-improvement runs.",icon:e.jsx(Q,{className:"h-4 w-4"}),section:"autopilot",field:"enabled"},{key:"autopilot-selfInitiate",label:"Autopilot Self-Initiate",description:"Autopilot can create and start its own goals without human trigger.",icon:e.jsx(g,{className:"h-4 w-4"}),section:"autopilot",field:"selfInitiate"},{key:"brain-enabled",label:"Brain (Local Router)",description:"Small local model routes tools instead of sending full schemas to the cloud LLM.",icon:e.jsx(J,{className:"h-4 w-4"}),section:"brain",field:"enabled"},{key:"mcp-server-enabled",label:"MCP Server",description:"Expose TITAN tools as a Model Context Protocol server for other AI apps.",icon:e.jsx(ae,{className:"h-4 w-4"}),section:"mcp",field:"serverEnabled"},{key:"training-enabled",label:"Model Training",description:"Fine-tune local LoRA adapters from session history.",icon:e.jsx(se,{className:"h-4 w-4"}),section:"training",field:"enabled"},{key:"teams-enabled",label:"Teams",description:"Multi-user teams with roles, invites, and permissions.",icon:e.jsx(X,{className:"h-4 w-4"}),section:"teams",field:"enabled"},{key:"tunnel-enabled",label:"Cloudflare Tunnel",description:"Expose TITAN securely on the public internet via Cloudflare.",icon:e.jsx(q,{className:"h-4 w-4"}),section:"tunnel",field:"enabled"},{key:"vault-enabled",label:"Vault",description:"Encrypted secret storage for API keys and credentials.",icon:e.jsx(T,{className:"h-4 w-4"}),section:"vault",field:"enabled"},{key:"capsolver-enabled",label:"CAPTCHA Solver",description:"Automatically solve CAPTCHAs during web browsing.",icon:e.jsx(T,{className:"h-4 w-4"}),section:"capsolver",field:"enabled"},{key:"deliberation-autoDetect",label:"Auto-Deliberation",description:"TITAN automatically deliberates on complex tasks before acting.",icon:e.jsx(Y,{className:"h-4 w-4"}),section:"deliberation",field:"autoDetect"},{key:"selfImprove-autoApply",label:"Auto-Apply Self-Improvements",description:"Apply prompt and config improvements automatically without approval.",icon:e.jsx(g,{className:"h-4 w-4"}),section:"selfImprove",field:"autoApply"},{key:"memory-vectorSearchEnabled",label:"Vector Memory Search",description:"Semantic search across episodic memories using embeddings.",icon:e.jsx(Z,{className:"h-4 w-4"}),section:"memory",field:"vectorSearchEnabled"}];function oe({className:i}){return e.jsx("svg",{className:i,viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"})})}function P({active:i}){return i?e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-success/15 px-2 py-0.5 text-[10px] font-medium text-success",children:[e.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-success shadow-[0_0_4px_rgba(34,197,94,0.4)]"}),"ON"]}):e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-bg-tertiary px-2 py-0.5 text-[10px] font-medium text-text-muted",children:[e.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-border-light"}),"OFF"]})}function Te(){const[i,y]=c.useState(null),[L,N]=c.useState(!0),[x,j]=c.useState(!1),[f,m]=c.useState(!1),[p,w]=c.useState(null),[d,k]=c.useState(new Set),[h,A]=c.useState({}),l=c.useCallback((s,t)=>{w({type:s,message:t}),setTimeout(()=>w(null),4e3)},[]);c.useEffect(()=>{B().then(s=>{y(s),N(!1)}).catch(s=>{l("error",s instanceof Error?s.message:"Failed to load config"),N(!1)})},[l]);const u=(s,t)=>{if(t==="serverEnabled"){const a=i==null?void 0:i.mcp,n=a==null?void 0:a.server;return!!(n!=null&&n.enabled)}if(t==="selfInitiate"){const a=i==null?void 0:i.autopilot,n=a==null?void 0:a.goals;return!!(n!=null&&n.selfInitiate)}const o=`${s}.${t}`;if(o in h)return h[o];const r=i==null?void 0:i[s];return r?r[t]:!1},S=(s,t,o)=>{const r=`${s}.${t}`;A(a=>({...a,[r]:o})),k(a=>new Set(a).add(r))},$=v.filter(s=>{const t=u(s.section,s.field);return typeof t=="boolean"?t:t==="autonomous"}).length,z=async()=>{j(!0);try{const s={};for(const o of d){const[r,a]=o.split("."),n=h[o];s[r]||(s[r]={}),a==="serverEnabled"?(s.mcp||(s.mcp={}),s.mcp.server={enabled:n}):a==="selfInitiate"?(s.autopilot||(s.autopilot={}),s.autopilot.goals={selfInitiate:n}):s[r][a]=n}const t=await O(s);y(t),A({}),k(new Set),C("autonomy_settings_saved",{changedCount:d.size}),l("success",`Saved ${d.size} change${d.size!==1?"s":""}`)}catch(s){l("error",s instanceof Error?s.message:"Failed to save")}finally{j(!1)}},_=async()=>{m(!0);try{const s=await b("/api/system/request-restart",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:"Settings change via Autonomy Panel",requestedBy:"user"})});if(!s.ok){const n=await s.json().catch(()=>({error:"Request failed"}));l("error",n.error||"Restart request failed"),m(!1);return}const{approval:t}=await s.json(),o=await b(`/api/command-post/approvals/${t.id}/approve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decidedBy:"user",note:"Approved via Autonomy Panel"})});if(!o.ok){const n=await o.json().catch(()=>({error:"Approval failed"}));l("error",n.error||"Restart approval failed"),m(!1);return}l("info","TITAN is restarting..."),C("titan_restart_initiated",{source:"autonomy_panel"});let r=0;const a=setInterval(async()=>{r++;try{(await b("/api/health")).ok&&(clearInterval(a),m(!1),l("success","TITAN restarted successfully"))}catch{}r>30&&(clearInterval(a),m(!1),l("error","Restart timed out — check Titan PC"))},2e3)}catch(s){l("error",s instanceof Error?s.message:"Restart failed"),m(!1)}};return L?e.jsx("div",{className:"space-y-4",children:Array.from({length:4}).map((s,t)=>e.jsx("div",{className:"h-32 animate-pulse rounded-xl border border-border bg-bg-secondary"},t))}):e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold text-text",children:"Autonomy & Features"}),e.jsxs("p",{className:"mt-0.5 text-xs text-text-muted",children:[$," of ",v.length," features active"]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[d.size>0&&e.jsxs("span",{className:"rounded-full bg-accent/15 px-2.5 py-1 text-[10px] font-medium text-accent",children:[d.size," unsaved"]}),e.jsxs("button",{onClick:z,disabled:x||d.size===0,className:"flex items-center gap-1.5 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:[x?e.jsx(I,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(G,{className:"h-3.5 w-3.5"}),x?"Saving…":"Save Changes"]})]})]}),p&&e.jsxs("div",{className:`flex items-center gap-2 rounded-lg border px-3 py-2 text-xs ${p.type==="success"?"border-success/50 text-success":p.type==="error"?"border-error/50 text-error":"border-accent/50 text-accent"}`,children:[p.type==="success"?e.jsx(V,{className:"h-4 w-4"}):p.type==="error"?e.jsx(F,{className:"h-4 w-4"}):e.jsx(D,{className:"h-4 w-4 animate-spin"}),p.message]}),e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(E,{className:"h-4 w-4 text-accent"}),e.jsx("h3",{className:"text-sm font-medium text-text",children:"Autonomy Level"}),e.jsx(P,{active:u("autonomy","mode")==="autonomous"})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-2",children:["locked","supervised","autonomous"].map(s=>e.jsxs("button",{onClick:()=>S("autonomy","mode",s),className:`rounded-lg border p-3 text-left transition-all ${u("autonomy","mode")===s?"border-accent bg-accent/10":"border-border hover:border-border-light"}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs font-medium text-text capitalize",children:s}),s==="autonomous"&&e.jsx("span",{className:"text-[9px] text-error",children:"High"}),s==="supervised"&&e.jsx("span",{className:"text-[9px] text-warning",children:"Med"}),s==="locked"&&e.jsx("span",{className:"text-[9px] text-success",children:"Low"})]}),e.jsxs("p",{className:"mt-1 text-[10px] text-text-muted leading-relaxed",children:[s==="locked"&&"Asks for approval on every tool call.",s==="supervised"&&"Auto-approves safe tools. Asks for dangerous ops.",s==="autonomous"&&"Full auto. Only asks for destructive/rare ops."]})]},s))})]}),e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3",children:v.filter(s=>s.field!=="mode").map(s=>{const t=u(s.section,s.field),o=typeof t=="boolean"?t:!1,r=d.has(`${s.section}.${s.field}`);return e.jsxs("div",{className:`flex items-start gap-3 rounded-xl border p-3 transition-colors ${r?"border-accent/40 bg-accent/5":"border-border bg-bg-secondary"}`,children:[e.jsx("div",{className:`mt-0.5 flex-shrink-0 rounded-lg p-2 ${o?"bg-accent/15 text-accent":"bg-bg-tertiary text-text-muted"}`,children:s.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-text",children:s.label}),e.jsx(P,{active:o})]}),e.jsx("p",{className:"mt-0.5 text-[11px] text-text-muted leading-relaxed",children:s.description})]}),e.jsxs("label",{className:"flex-shrink-0 relative inline-flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:a=>S(s.section,s.field,a.target.checked),className:"sr-only peer"}),e.jsx("div",{className:`relative w-9 h-5 rounded-full transition-colors ${o?"bg-accent":"bg-border"}`,children:e.jsx("div",{className:`absolute top-[2px] left-[2px] bg-white w-4 h-4 rounded-full transition-transform ${o?"translate-x-4":"translate-x-0"}`})})]})]},s.key)})}),e.jsx("div",{className:"rounded-xl border border-warning/30 bg-warning/5 p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(R,{className:"h-4 w-4 text-warning mt-0.5"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-sm font-medium text-text",children:"Restart TITAN"}),e.jsx("p",{className:"mt-0.5 text-[11px] text-text-muted",children:"Some feature changes require a full restart to take effect. This will briefly interrupt service."})]}),e.jsxs("button",{onClick:_,disabled:f,className:"flex items-center gap-1.5 rounded-lg border border-warning/50 px-3 py-1.5 text-xs font-medium text-warning transition-colors hover:bg-warning/10 disabled:opacity-50",children:[f?e.jsx(I,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(R,{className:"h-3.5 w-3.5"}),f?"Restarting…":"Restart"]})]})})]})}export{Te as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,b as n,j as e}from"./index-
|
|
1
|
+
import{r,b as n,j as e}from"./index-BU17I9hX.js";import{P as c}from"./PageHeader-D28AkFY9.js";import"./chevron-right-D_5QP27T.js";function p(){const[t,s]=r.useState(null),[l,i]=r.useState(!0);return r.useEffect(()=>{n("/api/config",{headers:{"Content-Type":"application/json"}}).then(a=>a.json()).then(a=>{var o,d;return s({mode:((o=a.autonomy)==null?void 0:o.mode)||"supervised",interval:(d=a.autonomy)==null?void 0:d.autopilotIntervalMs})}).catch(()=>s({mode:"supervised"})).finally(()=>i(!1))},[]),l?e.jsx("div",{className:"text-[var(--text-muted)]",children:"Loading autopilot config..."}):e.jsxs("div",{className:"space-y-6",children:[e.jsx(c,{title:"Autopilot",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"Agent"},{label:"Autopilot"}]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 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:"Mode"}),e.jsx("p",{className:"text-lg font-semibold text-[var(--text)] capitalize",children:t==null?void 0:t.mode})]}),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:"Interval"}),e.jsx("p",{className:"text-lg font-semibold text-[var(--text)]",children:t!=null&&t.interval?`${Math.round(t.interval/6e4)} min`:"Not set"})]})]}),e.jsx("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:"Autopilot mode enables TITAN to run scheduled tasks automatically. Configure via titan.json."})})]})}export{p as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as q,r as p,b as T,j as e,aS as O}from"./index-
|
|
1
|
+
import{c as q,r as p,b as T,j as e,aS as O}from"./index-BU17I9hX.js";import{F as A}from"./folder-CHZqSMue.js";import{P as D}from"./play-aAmkOXFj.js";import{P as W}from"./pause-lFQNt654.js";import{R as B}from"./terminal-BgpIZWzR.js";import{T as H}from"./trophy-DjrU4Va_.js";import{T as G}from"./trending-up-BscGb-5s.js";import{C as U}from"./clock-D9dj8p1r.js";import{C as V}from"./chevron-down-C3PrjI-d.js";import{C as J}from"./chevron-right-D_5QP27T.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 @@
|
|
|
1
|
+
import{r as t,aZ as f,j as e,a_ as u,a$ as h}from"./index-BU17I9hX.js";import{P as g}from"./PageHeader-D28AkFY9.js";import{P as b}from"./plus-Dwty0JFZ.js";import{R as y}from"./terminal-BgpIZWzR.js";import{A as j}from"./TitanCanvas-Crd_etVw.js";import{C as v}from"./circle-check-big-DjMpXACt.js";import"./chevron-right-D_5QP27T.js";import"./chevron-up-xrfX9iXN.js";import"./users-DHaLcBWd.js";import"./wrench-BKGESH8T.js";import"./network-MdOcH_y-.js";import"./save-BdOQXAka.js";import"./rotate-ccw-DmpAMnoF.js";import"./search-BUlbT-aT.js";import"./send-CWc9tYqk.js";import"./VoiceOverlay-BC75-OIG.js";import"./chevron-down-C3PrjI-d.js";import"./folder-CHZqSMue.js";import"./clock-D9dj8p1r.js";import"./check-BmeA_36a.js";import"./shield-check-ChQz9pPn.js";import"./external-link-CZh8_LAF.js";import"./loader-circle-BaviPWa-.js";function J(){const[r,p]=t.useState([]),[i,c]=t.useState(!0),[l,o]=t.useState(!1),[n,m]=t.useState(null),s=t.useCallback(async()=>{c(!0);try{const a=await f();p(a.backups||[])}catch{}c(!1)},[]);t.useEffect(()=>{s()},[s]);const d=async()=>{o(!0);try{await u(),await s()}catch{}o(!1)},x=async a=>{m(a);try{await h(a),alert("Backup verified successfully")}catch{alert("Backup verification failed")}m(null)};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(g,{title:"Backup Manager",breadcrumbs:[{label:"Admin",href:"/overview"},{label:"System"},{label:"Backups"}]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:d,disabled:l,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#6366f1] text-white text-sm font-medium hover:bg-[#4f46e5] disabled:opacity-50",children:[e.jsx(b,{className:"w-4 h-4"})," ",l?"Creating...":"Create Backup"]}),e.jsxs("button",{onClick:s,disabled:i,className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-[#27272a] text-[#a1a1aa] text-sm font-medium hover:bg-[#3f3f46] disabled:opacity-50",children:[e.jsx(y,{className:`w-4 h-4 ${i?"animate-spin":""}`})," Refresh"]})]}),r.length===0&&!i&&e.jsx("div",{className:"text-sm text-[#52525b]",children:"No backups found."}),e.jsx("div",{className:"space-y-2",children:r.map(a=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg bg-[#0a0a0f] border border-[#27272a]",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(j,{className:"w-4 h-4 text-[#6366f1]"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm text-[#e4e4e7]",children:new Date(a.createdAt).toLocaleString()}),e.jsxs("div",{className:"text-xs text-[#52525b]",children:[(a.sizeBytes/1024/1024).toFixed(1)," MB"]})]})]}),e.jsxs("button",{onClick:()=>x(a.path),disabled:n===a.path,className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-md bg-[#27272a] text-[#a1a1aa] text-xs hover:bg-[#3f3f46] disabled:opacity-50",children:[e.jsx(v,{className:"w-3.5 h-3.5"})," ",n===a.path?"Verifying...":"Verify"]})]},a.path))})]})}export{J as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as i,r as s,j as e,G as m,bh as p}from"./index-
|
|
1
|
+
import{c as i,r as s,j as e,G as m,bh as p}from"./index-BU17I9hX.js";import{P as h}from"./PageHeader-D28AkFY9.js";import"./chevron-right-D_5QP27T.js";/**
|
|
2
2
|
* @license lucide-react v0.513.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,bq as y,j as e,A as u,Z as j,T as S}from"./index-
|
|
1
|
+
import{r as a,bq as y,j as e,A as u,Z as j,T as S}from"./index-BU17I9hX.js";import"./Input-DwXJfZQE.js";import{P as A}from"./PageHeader-D28AkFY9.js";import{E as T}from"./EmptyState-C7Ew65Up.js";import{T as E}from"./Tabs-B5Mn9d1Z.js";import{S as N}from"./SkeletonLoader-C3RRc1JS.js";import{W as C,B as w}from"./wrench-BKGESH8T.js";import{S as P}from"./shield-check-ChQz9pPn.js";import{D as $}from"./dollar-sign-BulM6dxR.js";import{T as k}from"./target-DIF5T_yj.js";import"./loader-circle-BaviPWa-.js";import"./chevron-right-D_5QP27T.js";function I(s){const r=Math.floor((Date.now()-new Date(s).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`}const D={agent:w,goal:k,budget:$,approval:P,error:S,tool:C,system:j},M={agent:"text-accent",goal:"text-success",budget:"text-warning",approval:"text-info",error:"text-error",tool:"text-text-secondary",system:"text-text-muted"};function U(){const[s,r]=a.useState([]),[i,f]=a.useState(!0),[o,x]=a.useState(null),[n,h]=a.useState("all"),l=a.useRef(null),c=a.useCallback(async()=>{try{const t=await y(100);r(t),x(null)}catch(t){x(t instanceof Error?t.message:"Failed to load activity")}f(!1)},[]);a.useEffect(()=>(c(),l.current=setInterval(c,1e4),()=>{l.current&&clearInterval(l.current)}),[c]);const p=Array.from(new Set(s.map(t=>t.type))),g=[{id:"all",label:"All",count:s.length},...p.map(t=>({id:t,label:t.charAt(0).toUpperCase()+t.slice(1),count:s.filter(d=>d.type===t).length}))],m=n==="all"?s:s.filter(t=>t.type===n);return e.jsxs("div",{className:"space-y-4",children:[e.jsx(A,{title:"Activity",subtitle:"Auto-refreshes every 10s",breadcrumbs:[{label:"Command Post"},{label:"Activity"}]}),p.length>0&&e.jsx(E,{tabs:g,activeTab:n,onChange:h}),i&&e.jsx(N,{variant:"row",count:8}),o&&e.jsx("div",{className:"text-center py-8 text-error text-sm",children:o}),!i&&!o&&m.length===0&&e.jsx(T,{icon:e.jsx(u,{size:32}),title:"No activity",description:"Agent activity will appear here as events occur."}),!i&&!o&&m.length>0&&e.jsx("div",{className:"divide-y divide-border rounded-xl border border-border bg-bg-secondary overflow-hidden",children:m.map((t,d)=>{const v=D[t.type]??u,b=M[t.type]??"text-text-muted";return e.jsxs("div",{className:"flex items-start gap-3 px-4 py-2.5",children:[e.jsx(v,{size:14,className:`${b} mt-0.5 flex-shrink-0`}),e.jsx("span",{className:"flex-1 text-sm text-text-secondary",children:t.message}),t.agentId&&e.jsx("span",{className:"text-[10px] text-text-muted flex-shrink-0",children:t.agentId}),e.jsx("span",{className:"text-xs text-text-muted flex-shrink-0",children:I(t.timestamp)})]},`${t.id}-${d}`)})})]})}export{U as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as O,u as G,r as s,bo as J,x as K,I as Q,p as V,j as e,L as A,a3 as W}from"./index-
|
|
1
|
+
import{k as O,u as G,r as s,bo as J,x as K,I as Q,p as V,j as e,L as A,a3 as W}from"./index-BU17I9hX.js";import{B as T}from"./Input-DwXJfZQE.js";import{S as c}from"./StatusBadge-C0gmL26P.js";import{P as x}from"./PageHeader-D28AkFY9.js";import{E as X}from"./EmptyState-C7Ew65Up.js";import{T as Y}from"./Tabs-B5Mn9d1Z.js";import{S as Z}from"./SkeletonLoader-C3RRc1JS.js";import{A as _}from"./arrow-left-C40Zzo4e.js";import{C as ee}from"./circle-check-big-DjMpXACt.js";import{D as te}from"./dollar-sign-BulM6dxR.js";import{C as se}from"./clock-D9dj8p1r.js";import{S as ae}from"./save-BdOQXAka.js";import"./loader-circle-BaviPWa-.js";import"./chevron-right-D_5QP27T.js";function k(a){const o=Math.floor((Date.now()-new Date(a).getTime())/1e3);return o<60?`${o}s`:o<3600?`${Math.floor(o/60)}m`:o<86400?`${Math.floor(o/3600)}h`:`${Math.floor(o/86400)}d`}function re(a){return a?a<1e3?`${a}ms`:`${(a/1e3).toFixed(1)}s`:"-"}function je(){const{id:a}=O(),o=G(),[r,m]=s.useState(null),[n,E]=s.useState([]),[u,M]=s.useState([]),[P,b]=s.useState(!0),[p,i]=s.useState(null),[d,z]=s.useState("overview"),[h,g]=s.useState(""),[f,j]=s.useState(""),[v,N]=s.useState(""),[y,S]=s.useState(""),[D,C]=s.useState(!1),[R,$]=s.useState([]),w=s.useCallback(async()=>{if(a){try{const l=(await J()).find(q=>q.id===a);if(!l){i("Agent not found"),b(!1);return}m(l),g(l.role),j(l.reportsTo??""),N(l.title??""),S(l.model??"");const[H,U]=await Promise.all([K(a),Q({assignee:a})]);E(H),M(U),i(null)}catch(t){i(t instanceof Error?t.message:"Failed to load agent")}b(!1)}},[a]);s.useEffect(()=>{w()},[w]),s.useEffect(()=>{V().then(t=>$(t)).catch(()=>{})},[]);const B=async()=>{if(a){C(!0);try{const t=await W(a,{role:h,reportsTo:f||void 0,title:v||void 0,model:y||void 0});m(t)}catch{}C(!1)}},L=[{id:"overview",label:"Overview"},{id:"runs",label:"Runs",count:n.length},{id:"config",label:"Config"}];if(P)return e.jsxs("div",{className:"space-y-6",children:[e.jsx(x,{title:"Agent",breadcrumbs:[{label:"Command Post"},{label:"Agents",href:"/command-post/agents"},{label:"..."}]}),e.jsx(Z,{variant:"card",count:1})]});if(p||!r)return e.jsxs("div",{className:"space-y-6",children:[e.jsx(x,{title:"Agent",breadcrumbs:[{label:"Command Post"},{label:"Agents",href:"/command-post/agents"},{label:"Error"}]}),e.jsxs("div",{className:"text-center py-12",children:[e.jsx("p",{className:"text-error text-sm mb-4",children:p??"Agent not found"}),e.jsx(T,{variant:"secondary",size:"sm",onClick:()=>o("/command-post/agents"),children:"Back to Agents"})]})]});const I=Date.now()-new Date(r.createdAt).getTime(),F=Math.floor(I/36e5);return e.jsxs("div",{className:"space-y-4",children:[e.jsx(x,{title:r.name,subtitle:r.title??r.role,breadcrumbs:[{label:"Command Post"},{label:"Agents",href:"/command-post/agents"},{label:r.name}],actions:e.jsxs(A,{to:"/command-post/agents",className:"flex items-center gap-1 text-xs text-text-muted hover:text-text",children:[e.jsx(_,{size:14})," Back"]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(c,{status:r.status}),e.jsxs("span",{className:"text-xs text-text-muted",children:["Last heartbeat: ",k(r.lastHeartbeat)," ago"]})]}),e.jsx(Y,{tabs:L,activeTab:d,onChange:z}),d==="overview"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[e.jsxs("div",{className:"bg-bg-tertiary/50 border border-border rounded-xl p-4 text-center",children:[e.jsx(ee,{size:16,className:"text-success mx-auto mb-1"}),e.jsx("div",{className:"text-xl font-bold text-text",children:r.totalTasksCompleted}),e.jsx("div",{className:"text-[10px] text-text-muted",children:"Tasks Completed"})]}),e.jsxs("div",{className:"bg-bg-tertiary/50 border border-border rounded-xl p-4 text-center",children:[e.jsx(te,{size:16,className:"text-warning mx-auto mb-1"}),e.jsxs("div",{className:"text-xl font-bold text-text",children:["$",r.totalCostUsd.toFixed(4)]}),e.jsx("div",{className:"text-[10px] text-text-muted",children:"Total Cost"})]}),e.jsxs("div",{className:"bg-bg-tertiary/50 border border-border rounded-xl p-4 text-center",children:[e.jsx(se,{size:16,className:"text-accent mx-auto mb-1"}),e.jsxs("div",{className:"text-xl font-bold text-text",children:[F,"h"]}),e.jsx("div",{className:"text-[10px] text-text-muted",children:"Uptime"})]})]}),e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl overflow-hidden",children:[e.jsx("div",{className:"px-4 py-3 border-b border-border",children:e.jsx("h3",{className:"text-sm font-semibold text-text",children:"Assigned Issues"})}),u.length===0?e.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"No assigned issues"}):e.jsx("div",{className:"divide-y divide-border",children:u.map(t=>e.jsxs(A,{to:`/command-post/issues/${t.id}`,className:"flex items-center gap-2 px-4 py-2 hover:bg-bg-tertiary transition-colors",children:[e.jsx(c,{status:t.status,variant:"dot",size:"sm"}),e.jsx("span",{className:"text-xs text-text flex-1 truncate",children:t.title}),e.jsx("span",{className:"text-[10px] text-text-muted font-mono",children:t.identifier})]},t.id))})]})]}),d==="runs"&&e.jsx("div",{className:"bg-bg-secondary border border-border rounded-xl overflow-hidden",children:n.length===0?e.jsx(X,{title:"No runs",description:"This agent has not executed any runs yet."}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-left",children:[e.jsx("th",{className:"px-4 py-2 text-text-muted font-medium",children:"Source"}),e.jsx("th",{className:"px-4 py-2 text-text-muted font-medium",children:"Status"}),e.jsx("th",{className:"px-4 py-2 text-text-muted font-medium",children:"Duration"}),e.jsx("th",{className:"px-4 py-2 text-text-muted font-medium",children:"Tools"}),e.jsx("th",{className:"px-4 py-2 text-text-muted font-medium",children:"Started"})]})}),e.jsx("tbody",{className:"divide-y divide-border",children:n.map(t=>e.jsxs("tr",{className:"hover:bg-bg-tertiary/50 transition-colors",children:[e.jsx("td",{className:"px-4 py-2 text-text-secondary capitalize",children:t.source}),e.jsx("td",{className:"px-4 py-2",children:e.jsx(c,{status:t.status,size:"sm"})}),e.jsx("td",{className:"px-4 py-2 text-text-secondary",children:re(t.durationMs)}),e.jsx("td",{className:"px-4 py-2 text-text-muted",children:t.toolsUsed.length}),e.jsxs("td",{className:"px-4 py-2 text-text-muted",children:[k(t.startedAt)," ago"]})]},t.id))})]})})}),d==="config"&&e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl p-4 space-y-4 max-w-md",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Role"}),e.jsx("select",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text focus:outline-none focus:border-accent",value:h,onChange:t=>g(t.target.value),children:["ceo","manager","engineer","researcher","general"].map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Reports To"}),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:"Agent ID...",value:f,onChange:t=>j(t.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"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:"e.g. Senior Engineer",value:v,onChange:t=>N(t.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Model"}),e.jsx("input",{list:"cp-agent-models",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:"e.g. ollama/qwen3.5:cloud",value:y,onChange:t=>S(t.target.value)}),e.jsx("datalist",{id:"cp-agent-models",children:R.map(t=>e.jsx("option",{value:t.id,children:t.name??t.id},t.id))})]}),e.jsx(T,{size:"sm",icon:e.jsx(ae,{size:14}),onClick:B,loading:D,children:"Save"})]})]})}export{je as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,bo as m,j as e,L as p,X as u,b as h}from"./index-
|
|
1
|
+
import{r,bo as m,j as e,L as p,X as u,b as h}from"./index-BU17I9hX.js";import"./Input-DwXJfZQE.js";import{S as j}from"./StatusBadge-C0gmL26P.js";import{P as f}from"./PageHeader-D28AkFY9.js";import{E as g}from"./EmptyState-C7Ew65Up.js";import{S as b}from"./SkeletonLoader-C3RRc1JS.js";import{U as N}from"./users-DHaLcBWd.js";import"./loader-circle-BaviPWa-.js";import"./chevron-right-D_5QP27T.js";function y(a){const s=Math.floor((Date.now()-new Date(a).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 v(a){const s=a.split("/");return s[s.length-1]}function D(){const[a,s]=r.useState([]),[c,d]=r.useState(!0),[o,l]=r.useState(null),i=r.useCallback(async()=>{try{const t=await m();s(t),l(null)}catch(t){l(t instanceof Error?t.message:"Failed to load agents")}d(!1)},[]);r.useEffect(()=>{i()},[i]);const x=async(t,n)=>{n.preventDefault(),n.stopPropagation();try{await h(`/api/command-post/agents/${t}`,{method:"DELETE"}),await i()}catch{}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(f,{title:"Agents",breadcrumbs:[{label:"Command Post"},{label:"Agents"}]}),c&&e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:e.jsx(b,{variant:"card",count:6})}),o&&e.jsx("div",{className:"text-center py-8 text-error text-sm",children:o}),!c&&!o&&a.length===0&&e.jsx(g,{icon:e.jsx(N,{size:32}),title:"No agents registered",description:"Agents will appear here once they connect to Command Post."}),!c&&!o&&a.length>0&&e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:a.map(t=>e.jsxs(p,{to:`/command-post/agents/${t.id}`,className:"relative bg-bg-secondary border border-border rounded-xl p-4 hover:border-border-light transition-colors group",children:[t.role!=="ceo"&&e.jsx("button",{onClick:n=>x(t.id,n),className:"absolute top-3 right-3 p-1 rounded-md text-text-muted hover:text-error hover:bg-error/10 opacity-0 group-hover:opacity-100 transition-all",title:"Remove agent",children:e.jsx(u,{size:14})}),e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("span",{className:"text-sm font-semibold text-text",children:t.name}),e.jsx(j,{status:t.status,size:"sm"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase",children:"Role"}),e.jsx("span",{className:"text-xs text-text-secondary capitalize",children:t.role})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase",children:"Model"}),e.jsx("span",{className:"text-xs text-text-secondary truncate max-w-[140px]",children:v(t.model)})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase",children:"Last Heartbeat"}),e.jsxs("span",{className:"text-xs text-text-secondary",children:[y(t.lastHeartbeat)," ago"]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase",children:"Tasks Done"}),e.jsx("span",{className:"text-xs text-text-secondary",children:t.totalTasksCompleted})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase",children:"Cost"}),e.jsxs("span",{className:"text-xs text-text-secondary",children:["$",t.totalCostUsd.toFixed(4)]})]})]})]},t.id))})]})}export{D as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,bp as B,E as P,j as t,T as z,X as R,Q as $,U as _}from"./index-
|
|
1
|
+
import{r as a,bp as B,E as P,j as t,T as z,X as R,Q as $,U as _}from"./index-BU17I9hX.js";import{B as A}from"./Input-DwXJfZQE.js";import{S as D}from"./StatusBadge-C0gmL26P.js";import{P as M}from"./PageHeader-D28AkFY9.js";import{E as L}from"./EmptyState-C7Ew65Up.js";import{T as U}from"./Tabs-B5Mn9d1Z.js";import{S as W}from"./SkeletonLoader-C3RRc1JS.js";import{e as F}from"./approvalHeadline-DB9SgR-9.js";import{S as H}from"./shield-check-ChQz9pPn.js";import{C as I}from"./check-BmeA_36a.js";import"./loader-circle-BaviPWa-.js";import"./chevron-right-D_5QP27T.js";function q(r){const o=Math.floor((Date.now()-new Date(r).getTime())/1e3);return o<60?`${o}s`:o<3600?`${Math.floor(o/60)}m`:o<86400?`${Math.floor(o/3600)}h`:`${Math.floor(o/86400)}d`}function K(r){return r==="high"?"text-error bg-error/10 border-error/30":r==="medium"?"text-warn bg-warn/10 border-warn/30":"text-text-muted bg-bg-tertiary border-border"}const Q=[{id:"all",label:"All"},{id:"pending",label:"Pending"},{id:"approved",label:"Approved"},{id:"rejected",label:"Rejected"}];function ae(){const[r,o]=a.useState([]),[m,k]=a.useState(!0),[i,d]=a.useState(null),[l,w]=a.useState("all"),[h,c]=a.useState(null),[b,v]=a.useState({}),[u,j]=a.useState(null),{toast:p}=B(),x=a.useCallback(async()=>{try{const e=await P();o(e),d(null)}catch(e){d(e instanceof Error?e.message:"Failed to load approvals")}k(!1)},[]);a.useEffect(()=>{x()},[x]);const y=async e=>{var s;c(e.id);try{const n=(s=b[e.id])==null?void 0:s.trim();await $(e.id,"user",n||void 0),await x();const f=e.type==="goal_proposal"||e.type==="soma_proposal",T=e.type==="custom"&&e.payload.kind==="driver_blocked";p("success",f?"Work approved — TITAN is starting…":T?"Unblocked — TITAN is resuming…":"Approved"),v(E=>{const N={...E};return delete N[e.id],N}),j(null)}catch(n){d(n instanceof Error?n.message:"Approve failed"),p("error","Approval failed")}c(null)},S=async e=>{c(e.id);try{await _(e.id,"user"),await x(),p("success","Rejected")}catch(s){d(s instanceof Error?s.message:"Reject failed"),p("error","Rejection failed")}c(null)},g=l==="all"?r:r.filter(e=>e.status===l),C=Q.map(e=>({...e,count:e.id==="all"?r.length:r.filter(s=>s.status===e.id).length}));return t.jsxs("div",{className:"space-y-4",children:[t.jsx(M,{title:"Approvals",breadcrumbs:[{label:"Command Post"},{label:"Approvals"}]}),t.jsx(U,{tabs:C,activeTab:l,onChange:w}),m&&t.jsx(W,{variant:"row",count:5}),i&&t.jsx("div",{className:"text-center py-8 text-error text-sm",children:i}),!m&&!i&&g.length===0&&t.jsx(L,{icon:t.jsx(H,{size:32}),title:"No approvals",description:l==="pending"?"No pending approvals.":"No approvals to show."}),!m&&!i&&g.length>0&&t.jsx("div",{className:"divide-y divide-border rounded-xl border border-border bg-bg-secondary overflow-hidden",children:g.map(e=>{const s=F(e);return t.jsxs("div",{className:"flex items-start gap-3 px-4 py-3",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-1.5 flex-wrap",children:[t.jsxs("span",{className:`text-[10px] px-1.5 py-0.5 rounded border font-medium uppercase tracking-wide ${K(s.urgency)}`,children:[s.urgency==="high"&&t.jsx(z,{size:10,className:"inline mr-0.5"}),s.kindLabel]}),t.jsx(D,{status:e.status,size:"sm"}),t.jsxs("span",{className:"text-xs text-text-muted",children:["from ",t.jsx("span",{className:"font-medium text-text-secondary",children:e.requestedBy})]})]}),t.jsx("div",{className:"text-sm text-text font-medium leading-snug mb-0.5",children:s.headline}),s.detail&&t.jsx("div",{className:"text-xs text-text-secondary leading-snug",children:s.detail}),e.decidedBy&&t.jsxs("div",{className:"text-[10px] text-text-muted mt-1",children:["Decided by ",e.decidedBy,e.decisionNote?`: ${e.decisionNote}`:""]})]}),t.jsx("span",{className:"text-xs text-text-muted flex-shrink-0 pt-0.5",children:q(e.createdAt)}),e.status==="pending"&&t.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[e.type==="custom"&&e.payload.kind==="driver_blocked"&&t.jsx("button",{onClick:()=>j(u===e.id?null:e.id),className:"text-[10px] text-text-muted hover:text-text-secondary px-2 py-1 rounded hover:bg-bg-tertiary transition-colors",children:u===e.id?"Cancel":"Answer"}),t.jsx(A,{size:"sm",variant:"ghost",onClick:()=>y(e),loading:h===e.id,icon:t.jsx(I,{size:14}),children:"Approve"}),t.jsx(A,{size:"sm",variant:"ghost",onClick:()=>S(e),loading:h===e.id,icon:t.jsx(R,{size:14}),children:"Reject"})]}),u===e.id&&t.jsx("input",{type:"text",value:b[e.id]||"",onChange:n=>v(f=>({...f,[e.id]:n.target.value})),placeholder:"Type your answer...",className:"w-64 rounded-md border border-border bg-bg px-3 py-1.5 text-xs text-text outline-none focus:border-accent mt-1",onKeyDown:n=>{n.key==="Enter"&&y(e)},autoFocus:!0})]})]},e.id)})})]})}export{ae as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,bs as E,bt as A,j as e,J as L,a2 as W}from"./index-
|
|
1
|
+
import{r as s,bs as E,bt as A,j as e,J as L,a2 as W}from"./index-BU17I9hX.js";import{B as u}from"./Input-DwXJfZQE.js";import{S as C}from"./StatusBadge-C0gmL26P.js";import{P as M}from"./PageHeader-D28AkFY9.js";import{E as R}from"./EmptyState-C7Ew65Up.js";import{M as G}from"./Modal-CD5NlUD9.js";import{S as H}from"./SkeletonLoader-C3RRc1JS.js";import{P as J}from"./plus-Dwty0JFZ.js";import{D as q}from"./dollar-sign-BulM6dxR.js";import{T as K}from"./trash-2-B6ITzg87.js";import"./loader-circle-BaviPWa-.js";import"./chevron-right-D_5QP27T.js";import"./proxy-Bv-wApak.js";function O(a){const l=a.limitUsd>0?a.currentSpend/a.limitUsd*100:0;return l>=100?"exceeded":l>=a.warningThresholdPercent?"warning":"healthy"}function oe(){const[a,l]=s.useState([]),[m,S]=s.useState([]),[c,k]=s.useState(!0),[n,g]=s.useState(null),[P,r]=s.useState(!1),[B,p]=s.useState(!1),[o,h]=s.useState(""),[d,z]=s.useState("global"),[b,j]=s.useState(""),[f,T]=s.useState("monthly"),[v,N]=s.useState("10"),[y,I]=s.useState("80"),[w,U]=s.useState("warn"),i=s.useCallback(async()=>{try{const t=await E();l(t),g(null)}catch(t){g(t instanceof Error?t.message:"Failed to load budgets")}k(!1)},[]);s.useEffect(()=>{i(),A().then(S).catch(()=>{})},[i]);const D=async()=>{if(o.trim()){p(!0);try{await W({name:o.trim(),scope:{type:d,targetId:b||void 0},period:f,limitUsd:parseFloat(v)||10,warningThresholdPercent:parseInt(y)||80,action:w,enabled:!0}),r(!1),h(""),j(""),N("10"),await i()}catch{}p(!1)}},F=async t=>{try{await L(t),await i()}catch{}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(M,{title:"Costs & Budgets",breadcrumbs:[{label:"Command Post"},{label:"Costs"}],actions:e.jsx(u,{size:"sm",icon:e.jsx(J,{size:14}),onClick:()=>r(!0),children:"Create Budget"})}),c&&e.jsx(H,{variant:"row",count:4}),n&&e.jsx("div",{className:"text-center py-8 text-error text-sm",children:n}),!c&&!n&&a.length===0&&e.jsx(R,{icon:e.jsx(q,{size:32}),title:"No budgets",description:"Create budget policies to control agent spending.",action:{label:"Create Budget",onClick:()=>r(!0)}}),!c&&!n&&a.length>0&&e.jsx("div",{className:"divide-y divide-border rounded-xl border border-border bg-bg-secondary overflow-hidden",children:a.map(t=>{const $=t.limitUsd>0?t.currentSpend/t.limitUsd*100:0,x=O(t);return e.jsxs("div",{className:"flex items-center gap-4 px-4 py-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-sm font-medium text-text",children:t.name}),e.jsx(C,{status:x,size:"sm"}),!t.enabled&&e.jsx(C,{status:"disabled",size:"sm"})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-text-muted",children:[e.jsxs("span",{className:"capitalize",children:[t.scope.type,t.scope.targetId?`: ${t.scope.targetId}`:""]}),e.jsx("span",{className:"capitalize",children:t.period}),e.jsxs("span",{children:["Action: ",t.action]})]})]}),e.jsxs("div",{className:"text-right flex-shrink-0",children:[e.jsxs("div",{className:"text-sm font-medium text-text",children:["$",t.currentSpend.toFixed(2)," / $",t.limitUsd.toFixed(2)]}),e.jsx("div",{className:"w-24 h-1.5 bg-bg-tertiary rounded-full overflow-hidden mt-1",children:e.jsx("div",{className:`h-full rounded-full transition-all ${x==="exceeded"?"bg-error":x==="warning"?"bg-warning":"bg-success"}`,style:{width:`${Math.min(100,$)}%`}})})]}),e.jsx("button",{onClick:()=>F(t.id),className:"p-1.5 rounded-md text-text-muted hover:text-error hover:bg-error/10 transition-colors flex-shrink-0",title:"Delete budget",children:e.jsx(K,{size:14})})]},t.id)})}),m.length>0&&e.jsxs("div",{className:"rounded-xl border border-border bg-bg-secondary overflow-hidden",children:[e.jsx("div",{className:"px-4 py-3 border-b border-border",children:e.jsx("h3",{className:"text-sm font-medium text-text",children:"Active Reservations"})}),e.jsx("div",{className:"divide-y divide-border",children:m.map(t=>e.jsxs("div",{className:"px-4 py-3 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-sm text-text",children:t.agentId}),t.goalId&&e.jsxs("span",{className:"text-xs text-text-muted ml-2",children:["Goal: ",t.goalId]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded-full ${t.status==="reserved"?"bg-warning/20 text-warning":t.status==="settled"?"bg-success/20 text-success":"bg-bg-tertiary text-text-muted"}`,children:t.status}),e.jsxs("span",{className:"text-sm font-mono text-text",children:["$",t.status==="settled"?(t.actualUsd??0).toFixed(4):t.estimatedUsd.toFixed(4)]})]})]},t.id))})]}),e.jsx(G,{open:P,onClose:()=>r(!1),title:"Create Budget Policy",footer:e.jsxs(e.Fragment,{children:[e.jsx(u,{variant:"secondary",size:"sm",onClick:()=>r(!1),children:"Cancel"}),e.jsx(u,{size:"sm",onClick:D,loading:B,disabled:!o.trim(),children:"Create"})]}),children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Name"}),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:"Budget name...",value:o,onChange:t=>h(t.target.value),autoFocus:!0})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Scope"}),e.jsxs("select",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text focus:outline-none focus:border-accent",value:d,onChange:t=>z(t.target.value),children:[e.jsx("option",{value:"global",children:"Global"}),e.jsx("option",{value:"agent",children:"Agent"}),e.jsx("option",{value:"goal",children:"Goal"})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Period"}),e.jsxs("select",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text focus:outline-none focus:border-accent",value:f,onChange:t=>T(t.target.value),children:[e.jsx("option",{value:"daily",children:"Daily"}),e.jsx("option",{value:"weekly",children:"Weekly"}),e.jsx("option",{value:"monthly",children:"Monthly"})]})]})]}),d!=="global"&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Target ID"}),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:`${d} ID...`,value:b,onChange:t=>j(t.target.value)})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Limit (USD)"}),e.jsx("input",{type:"number",className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text focus:outline-none focus:border-accent",value:v,onChange:t=>N(t.target.value)})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Warning %"}),e.jsx("input",{type:"number",className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text focus:outline-none focus:border-accent",value:y,onChange:t=>I(t.target.value)})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs text-text-muted mb-1",children:"Action on Threshold"}),e.jsxs("select",{className:"w-full rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-sm text-text focus:outline-none focus:border-accent",value:w,onChange:t=>U(t.target.value),children:[e.jsx("option",{value:"warn",children:"Warn"}),e.jsx("option",{value:"pause",children:"Pause"}),e.jsx("option",{value:"stop",children:"Stop"})]})]})]})})]})}export{oe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as g,j as t,z as se,bq as le,I as re,E as ae,A as G,L as U}from"./index-BcjuOJPJ.js";import"./Input-BGRt46nj.js";import{S as ie}from"./StatusBadge-y6Q_954x.js";import{P as V}from"./PageHeader-CJ9Gd7zr.js";import{S as oe}from"./SkeletonLoader-i2w1eOGD.js";import{R as ne}from"./terminal-Dn8iAGcd.js";import{U as ce}from"./users-Y-iozoC0.js";import{L as _}from"./list-todo-B2Q1O--f.js";import{D as de}from"./dollar-sign-ChurwnNP.js";import{T as xe}from"./target-DdW0YJR8.js";import"./loader-circle-BMmFeXSi.js";import"./chevron-right-CVQ0YoN8.js";const J={idle:"var(--color-text-secondary)",active:"var(--color-success)",paused:"var(--color-warning)",error:"var(--color-error)",stopped:"var(--color-border-light)"},me={ceo:"C",manager:"M",engineer:"E",researcher:"R",general:"G"};function fe({agents:c,activity:d}){const u=g.useRef(null),R=g.useRef(c),p=g.useRef(d);return R.current=c,p.current=d,g.useEffect(()=>{const b=u.current;if(!b)return;const e=b.getContext("2d");if(!e)return;const w=window.devicePixelRatio||1;let C,L=0;const y=()=>{const o=b.clientWidth,x=b.clientHeight;b.width=o*w,b.height=x*w,e.setTransform(w,0,0,w,0,0)};y(),window.addEventListener("resize",y);const M=()=>{L++;const o=L/15,x=b.clientWidth,m=b.clientHeight,r=R.current,j=p.current;e.fillStyle="var(--color-bg)",e.fillRect(0,0,x,m),e.strokeStyle="#141418",e.lineWidth=.5;for(let s=0;s<x;s+=24)e.beginPath(),e.moveTo(s,m*.72),e.lineTo(s,m),e.stroke();for(let s=m*.72;s<m;s+=24)e.beginPath(),e.moveTo(0,s),e.lineTo(x,s),e.stroke();if(r.length===0){e.fillStyle="var(--color-bg-tertiary)",e.font="12px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center",e.fillText("No agents registered",x/2,m/2-10),e.font="10px -apple-system, BlinkMacSystemFont, sans-serif",e.fillStyle="var(--color-border)",e.fillText("Spawn agents to see them here",x/2,m/2+10),e.textAlign="start",C=requestAnimationFrame(M);return}const I=Math.min(r.length,8),A=Math.min(120,(x-20)/I),Q=(x-A*I)/2+A/2;for(let s=0;s<I;s++){const k=r[s],l=Q+s*A,a=m*.55,f=k.status==="active"?"active":k.status,$=J[f]||J.idle,i=Math.sin(o*.8+s*1.5)*1.5,z=j.some(n=>n.agentId===k.id&&Date.now()-new Date(n.timestamp).getTime()<3e4),D=Math.min(70,A-10),P=10,E=l-D/2,S=a+16;e.fillStyle="var(--color-border)",e.fillRect(E,S,D,P),e.fillStyle="var(--color-border-light)",e.fillRect(E+1,S+1,D-2,P-2),e.fillStyle="var(--color-border)",e.fillRect(E+3,S+P,3,14),e.fillRect(E+D-6,S+P,3,14);const B=26,W=18,H=l-B/2,O=S-W;e.fillStyle="var(--color-bg-tertiary)",e.fillRect(H,O,B,W);const X=f==="error"?"var(--color-error)":f==="active"?"var(--color-success)":"var(--color-accent)";if(e.fillStyle=X+"30",e.fillRect(H+2,O+2,B-4,W-4),f==="active"||z){e.fillStyle=X+"60";const n=2+Math.floor(o%3);for(let h=0;h<n;h++){const T=6+Math.sin(o*2+h+s)*5;e.fillRect(H+3,O+3+h*4,T,1.5)}}e.fillStyle="var(--color-border)",e.fillRect(l-2,S-1,4,3),e.fillStyle="#1e1e22",e.fillRect(l-10,a+10+i,20,8),e.fillRect(l-11,a-2+i,3,20),e.fillStyle="var(--color-border)",e.fillRect(l-7,a+i,14,12);const v=f==="active"&&z?Math.sin(o*1.5+s)*1.5:0;e.fillStyle="var(--color-border-light)",e.fillRect(l-6,a-10+i+v,12,10);const Y=Math.sin(o*.3+s*2)>.95?1:2;if(e.fillStyle=$,f==="stopped"?(e.fillRect(l-4,a-7+i+v,2,1),e.fillRect(l-3,a-6+i+v,2,1),e.fillRect(l+1,a-7+i+v,2,1),e.fillRect(l+2,a-6+i+v,2,1)):(e.fillRect(l-4,a-7+i+v,2,Y),e.fillRect(l+2,a-7+i+v,2,Y)),e.fillStyle="var(--color-border-light)",e.fillRect(l-1,a-14+i+v,2,4),e.fillStyle=$,e.beginPath(),e.arc(l,a-15+i+v,2,0,Math.PI*2),e.fill(),f==="active"&&(e.globalAlpha=.3+Math.sin(o*3+s)*.2,e.beginPath(),e.arc(l,a-15+i+v,5,0,Math.PI*2),e.fill(),e.globalAlpha=1),f==="active"&&z){const n=Math.sin(o*6+s)*2,h=Math.sin(o*6+s+Math.PI)*2;e.fillStyle="var(--color-border)",e.fillRect(l-11,a+3+i+n,4,3),e.fillRect(l+7,a+3+i+h,4,3)}else e.fillStyle="var(--color-border)",e.fillRect(l-10,a+5+i,3,6),e.fillRect(l+7,a+5+i,3,6);if(f==="active"&&z){for(let n=0;n<2;n++){const h=o*1.5+n*Math.PI+s,T=14+Math.sin(o+n)*4,ee=l+Math.cos(h)*T,te=a-3+Math.sin(h)*T*.4+i;e.globalAlpha=.25+Math.sin(o*2+n)*.15,e.fillStyle=$,e.beginPath(),e.arc(ee,te,1,0,Math.PI*2),e.fill()}e.globalAlpha=1}if(f==="error"){for(let n=0;n<3;n++){const h=l+Math.sin(o*4+n*2)*12,T=a-5+Math.cos(o*3+n)*8+i;e.globalAlpha=.4+Math.sin(o+n)*.3,e.fillStyle="var(--color-error)",e.fillRect(h-1,T-1,2,2)}e.globalAlpha=1}e.fillStyle=f==="stopped"?"var(--color-border)":"var(--color-text-muted)",e.font="9px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center";const q=Math.max(44,D+14);let N=k.name;if(e.measureText(N).width>q){for(;N.length>1&&e.measureText(N+"…").width>q;)N=N.slice(0,-1);N=N.trimEnd()+"…"}e.fillText(N,l,S+P+24);const Z=me[k.role]||"G";e.fillStyle=$+"60",e.font="bold 7px -apple-system, BlinkMacSystemFont, sans-serif",e.fillText(Z,l,S+P+33),e.textAlign="start"}if(e.fillStyle="var(--color-bg-tertiary)",e.font="bold 9px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center",e.fillText("COMMAND POST",x/2,m-6),e.textAlign="start",j.length>0){const s=j[j.length-1];if(Date.now()-new Date(s.timestamp).getTime()<6e4){e.fillStyle="var(--color-accent)40",e.fillRect(0,0,x,16),e.fillStyle="var(--color-accent-light)",e.font="8px -apple-system, BlinkMacSystemFont, sans-serif";const l=s.message.length>60?s.message.slice(0,57)+"...":s.message;e.textAlign="center",e.fillText(l,x/2,11),e.textAlign="start"}}C=requestAnimationFrame(M)};return M(),()=>{cancelAnimationFrame(C),window.removeEventListener("resize",y)}},[]),t.jsx("canvas",{ref:u,className:"w-full rounded-xl border border-border",style:{height:220,imageRendering:"pixelated"}})}function K(c){const d=Math.floor((Date.now()-new Date(c).getTime())/1e3);return d<60?`${d}s`:d<3600?`${Math.floor(d/60)}m`:d<86400?`${Math.floor(d/3600)}h`:`${Math.floor(d/86400)}d`}function F({icon:c,label:d,value:u,sub:R,color:p}){return t.jsxs("div",{className:"bg-bg-tertiary/50 border border-border rounded-xl p-4",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx(c,{size:14,className:p}),t.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:d})]}),t.jsx("div",{className:"text-2xl font-bold text-text",children:u}),R&&t.jsx("div",{className:"text-[11px] text-text-muted mt-1",children:R})]})}function Ae(){var m;const[c,d]=g.useState(null),[u,R]=g.useState([]),[p,b]=g.useState([]),[e,w]=g.useState(0),[C,L]=g.useState(!0),y=g.useCallback(async()=>{try{const[r,j,I,A]=await Promise.all([se(),le(20),re(),ae("pending")]);d(r),R(j),b(I),w(A.length)}catch{}L(!1)},[]);if(g.useEffect(()=>{y();const r=setInterval(y,15e3);return()=>clearInterval(r)},[y]),C)return t.jsxs("div",{className:"space-y-6",children:[t.jsx(V,{title:"Dashboard",breadcrumbs:[{label:"Command Post"},{label:"Dashboard"}]}),t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:t.jsx(oe,{variant:"metric",count:4})})]});if(!c)return t.jsx("div",{className:"text-center py-12 text-text-muted",children:"Failed to load dashboard"});const M=c.budgetUtilization??0,o=p.filter(r=>r.status==="in_progress").length,x=p.filter(r=>r.status==="blocked").length;return t.jsxs("div",{className:"space-y-6",children:[t.jsx(V,{title:"Dashboard",breadcrumbs:[{label:"Command Post"},{label:"Dashboard"}],actions:t.jsx("button",{onClick:y,className:"p-1.5 text-text-muted hover:text-text rounded-lg hover:bg-bg-tertiary transition-colors",children:t.jsx(ne,{size:16})})}),t.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[t.jsx(F,{icon:ce,label:"Agents Enabled",value:c.totalAgents,sub:`${c.activeAgents} running, ${Math.max(0,c.totalAgents-c.activeAgents)} paused`,color:"text-info"}),t.jsx(F,{icon:_,label:"Tasks In Progress",value:o,sub:`${p.length} open, ${x} blocked`,color:"text-warning"}),t.jsx(F,{icon:de,label:"Budget Used",value:`${Math.round(M)}%`,sub:M>=80?"Nearing limit":"Healthy",color:M>=80?"text-error":"text-success"}),t.jsx(F,{icon:xe,label:"Goals",value:((m=c.goalTree)==null?void 0:m.length)??0,sub:"in hierarchy",color:"text-purple"})]}),c.agents.length>0&&t.jsx(fe,{agents:c.agents,activity:u}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[t.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(G,{size:14,className:"text-accent"}),t.jsx("h3",{className:"text-sm font-semibold text-text",children:"Recent Activity"})]}),t.jsx(U,{to:"/command-post/activity",className:"text-[10px] text-accent hover:text-accent-hover",children:"View all"})]}),t.jsx("div",{className:"max-h-72 overflow-y-auto divide-y divide-border",children:u.length===0?t.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"No activity yet"}):[...u].reverse().slice(0,15).map((r,j)=>t.jsxs("div",{className:"flex items-start gap-2 px-4 py-2",children:[t.jsx(G,{size:12,className:"text-text-muted mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-[11px] text-text-secondary flex-1",children:r.message}),t.jsx("span",{className:"text-[10px] text-text-muted flex-shrink-0",children:K(r.timestamp)})]},`${r.timestamp}-${j}`))})]}),t.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(_,{size:14,className:"text-accent"}),t.jsx("h3",{className:"text-sm font-semibold text-text",children:"Recent Issues"})]}),t.jsx(U,{to:"/command-post/issues",className:"text-[10px] text-accent hover:text-accent-hover",children:"View all"})]}),t.jsx("div",{className:"max-h-72 overflow-y-auto divide-y divide-border",children:p.length===0?t.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"No issues yet"}):p.slice(0,10).map(r=>t.jsxs(U,{to:`/command-post/issues/${r.id}`,className:"flex items-center gap-2 px-4 py-2 hover:bg-bg-tertiary transition-colors",children:[t.jsx(ie,{status:r.status,variant:"dot",size:"sm"}),t.jsx("span",{className:"text-[11px] text-text-secondary flex-1 truncate",children:r.title}),r.assigneeAgentId&&t.jsx("span",{className:"text-[10px] text-text-muted",children:r.assigneeAgentId}),t.jsx("span",{className:"text-[10px] text-text-muted flex-shrink-0",children:K(r.updatedAt)})]},r.id))})]})]})]})}export{Ae as default};
|
|
1
|
+
import{r as g,j as t,z as se,bq as le,I as re,E as ae,A as G,L as U}from"./index-BU17I9hX.js";import"./Input-DwXJfZQE.js";import{S as ie}from"./StatusBadge-C0gmL26P.js";import{P as V}from"./PageHeader-D28AkFY9.js";import{S as oe}from"./SkeletonLoader-C3RRc1JS.js";import{R as ne}from"./terminal-BgpIZWzR.js";import{U as ce}from"./users-DHaLcBWd.js";import{L as _}from"./list-todo-CGI6eQrk.js";import{D as de}from"./dollar-sign-BulM6dxR.js";import{T as xe}from"./target-DIF5T_yj.js";import"./loader-circle-BaviPWa-.js";import"./chevron-right-D_5QP27T.js";const J={idle:"var(--color-text-secondary)",active:"var(--color-success)",paused:"var(--color-warning)",error:"var(--color-error)",stopped:"var(--color-border-light)"},me={ceo:"C",manager:"M",engineer:"E",researcher:"R",general:"G"};function fe({agents:c,activity:d}){const u=g.useRef(null),R=g.useRef(c),p=g.useRef(d);return R.current=c,p.current=d,g.useEffect(()=>{const b=u.current;if(!b)return;const e=b.getContext("2d");if(!e)return;const w=window.devicePixelRatio||1;let C,L=0;const y=()=>{const o=b.clientWidth,x=b.clientHeight;b.width=o*w,b.height=x*w,e.setTransform(w,0,0,w,0,0)};y(),window.addEventListener("resize",y);const M=()=>{L++;const o=L/15,x=b.clientWidth,m=b.clientHeight,r=R.current,j=p.current;e.fillStyle="var(--color-bg)",e.fillRect(0,0,x,m),e.strokeStyle="#141418",e.lineWidth=.5;for(let s=0;s<x;s+=24)e.beginPath(),e.moveTo(s,m*.72),e.lineTo(s,m),e.stroke();for(let s=m*.72;s<m;s+=24)e.beginPath(),e.moveTo(0,s),e.lineTo(x,s),e.stroke();if(r.length===0){e.fillStyle="var(--color-bg-tertiary)",e.font="12px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center",e.fillText("No agents registered",x/2,m/2-10),e.font="10px -apple-system, BlinkMacSystemFont, sans-serif",e.fillStyle="var(--color-border)",e.fillText("Spawn agents to see them here",x/2,m/2+10),e.textAlign="start",C=requestAnimationFrame(M);return}const I=Math.min(r.length,8),A=Math.min(120,(x-20)/I),Q=(x-A*I)/2+A/2;for(let s=0;s<I;s++){const k=r[s],l=Q+s*A,a=m*.55,f=k.status==="active"?"active":k.status,$=J[f]||J.idle,i=Math.sin(o*.8+s*1.5)*1.5,z=j.some(n=>n.agentId===k.id&&Date.now()-new Date(n.timestamp).getTime()<3e4),D=Math.min(70,A-10),P=10,E=l-D/2,S=a+16;e.fillStyle="var(--color-border)",e.fillRect(E,S,D,P),e.fillStyle="var(--color-border-light)",e.fillRect(E+1,S+1,D-2,P-2),e.fillStyle="var(--color-border)",e.fillRect(E+3,S+P,3,14),e.fillRect(E+D-6,S+P,3,14);const B=26,W=18,H=l-B/2,O=S-W;e.fillStyle="var(--color-bg-tertiary)",e.fillRect(H,O,B,W);const X=f==="error"?"var(--color-error)":f==="active"?"var(--color-success)":"var(--color-accent)";if(e.fillStyle=X+"30",e.fillRect(H+2,O+2,B-4,W-4),f==="active"||z){e.fillStyle=X+"60";const n=2+Math.floor(o%3);for(let h=0;h<n;h++){const T=6+Math.sin(o*2+h+s)*5;e.fillRect(H+3,O+3+h*4,T,1.5)}}e.fillStyle="var(--color-border)",e.fillRect(l-2,S-1,4,3),e.fillStyle="#1e1e22",e.fillRect(l-10,a+10+i,20,8),e.fillRect(l-11,a-2+i,3,20),e.fillStyle="var(--color-border)",e.fillRect(l-7,a+i,14,12);const v=f==="active"&&z?Math.sin(o*1.5+s)*1.5:0;e.fillStyle="var(--color-border-light)",e.fillRect(l-6,a-10+i+v,12,10);const Y=Math.sin(o*.3+s*2)>.95?1:2;if(e.fillStyle=$,f==="stopped"?(e.fillRect(l-4,a-7+i+v,2,1),e.fillRect(l-3,a-6+i+v,2,1),e.fillRect(l+1,a-7+i+v,2,1),e.fillRect(l+2,a-6+i+v,2,1)):(e.fillRect(l-4,a-7+i+v,2,Y),e.fillRect(l+2,a-7+i+v,2,Y)),e.fillStyle="var(--color-border-light)",e.fillRect(l-1,a-14+i+v,2,4),e.fillStyle=$,e.beginPath(),e.arc(l,a-15+i+v,2,0,Math.PI*2),e.fill(),f==="active"&&(e.globalAlpha=.3+Math.sin(o*3+s)*.2,e.beginPath(),e.arc(l,a-15+i+v,5,0,Math.PI*2),e.fill(),e.globalAlpha=1),f==="active"&&z){const n=Math.sin(o*6+s)*2,h=Math.sin(o*6+s+Math.PI)*2;e.fillStyle="var(--color-border)",e.fillRect(l-11,a+3+i+n,4,3),e.fillRect(l+7,a+3+i+h,4,3)}else e.fillStyle="var(--color-border)",e.fillRect(l-10,a+5+i,3,6),e.fillRect(l+7,a+5+i,3,6);if(f==="active"&&z){for(let n=0;n<2;n++){const h=o*1.5+n*Math.PI+s,T=14+Math.sin(o+n)*4,ee=l+Math.cos(h)*T,te=a-3+Math.sin(h)*T*.4+i;e.globalAlpha=.25+Math.sin(o*2+n)*.15,e.fillStyle=$,e.beginPath(),e.arc(ee,te,1,0,Math.PI*2),e.fill()}e.globalAlpha=1}if(f==="error"){for(let n=0;n<3;n++){const h=l+Math.sin(o*4+n*2)*12,T=a-5+Math.cos(o*3+n)*8+i;e.globalAlpha=.4+Math.sin(o+n)*.3,e.fillStyle="var(--color-error)",e.fillRect(h-1,T-1,2,2)}e.globalAlpha=1}e.fillStyle=f==="stopped"?"var(--color-border)":"var(--color-text-muted)",e.font="9px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center";const q=Math.max(44,D+14);let N=k.name;if(e.measureText(N).width>q){for(;N.length>1&&e.measureText(N+"…").width>q;)N=N.slice(0,-1);N=N.trimEnd()+"…"}e.fillText(N,l,S+P+24);const Z=me[k.role]||"G";e.fillStyle=$+"60",e.font="bold 7px -apple-system, BlinkMacSystemFont, sans-serif",e.fillText(Z,l,S+P+33),e.textAlign="start"}if(e.fillStyle="var(--color-bg-tertiary)",e.font="bold 9px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center",e.fillText("COMMAND POST",x/2,m-6),e.textAlign="start",j.length>0){const s=j[j.length-1];if(Date.now()-new Date(s.timestamp).getTime()<6e4){e.fillStyle="var(--color-accent)40",e.fillRect(0,0,x,16),e.fillStyle="var(--color-accent-light)",e.font="8px -apple-system, BlinkMacSystemFont, sans-serif";const l=s.message.length>60?s.message.slice(0,57)+"...":s.message;e.textAlign="center",e.fillText(l,x/2,11),e.textAlign="start"}}C=requestAnimationFrame(M)};return M(),()=>{cancelAnimationFrame(C),window.removeEventListener("resize",y)}},[]),t.jsx("canvas",{ref:u,className:"w-full rounded-xl border border-border",style:{height:220,imageRendering:"pixelated"}})}function K(c){const d=Math.floor((Date.now()-new Date(c).getTime())/1e3);return d<60?`${d}s`:d<3600?`${Math.floor(d/60)}m`:d<86400?`${Math.floor(d/3600)}h`:`${Math.floor(d/86400)}d`}function F({icon:c,label:d,value:u,sub:R,color:p}){return t.jsxs("div",{className:"bg-bg-tertiary/50 border border-border rounded-xl p-4",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx(c,{size:14,className:p}),t.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:d})]}),t.jsx("div",{className:"text-2xl font-bold text-text",children:u}),R&&t.jsx("div",{className:"text-[11px] text-text-muted mt-1",children:R})]})}function Ae(){var m;const[c,d]=g.useState(null),[u,R]=g.useState([]),[p,b]=g.useState([]),[e,w]=g.useState(0),[C,L]=g.useState(!0),y=g.useCallback(async()=>{try{const[r,j,I,A]=await Promise.all([se(),le(20),re(),ae("pending")]);d(r),R(j),b(I),w(A.length)}catch{}L(!1)},[]);if(g.useEffect(()=>{y();const r=setInterval(y,15e3);return()=>clearInterval(r)},[y]),C)return t.jsxs("div",{className:"space-y-6",children:[t.jsx(V,{title:"Dashboard",breadcrumbs:[{label:"Command Post"},{label:"Dashboard"}]}),t.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:t.jsx(oe,{variant:"metric",count:4})})]});if(!c)return t.jsx("div",{className:"text-center py-12 text-text-muted",children:"Failed to load dashboard"});const M=c.budgetUtilization??0,o=p.filter(r=>r.status==="in_progress").length,x=p.filter(r=>r.status==="blocked").length;return t.jsxs("div",{className:"space-y-6",children:[t.jsx(V,{title:"Dashboard",breadcrumbs:[{label:"Command Post"},{label:"Dashboard"}],actions:t.jsx("button",{onClick:y,className:"p-1.5 text-text-muted hover:text-text rounded-lg hover:bg-bg-tertiary transition-colors",children:t.jsx(ne,{size:16})})}),t.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[t.jsx(F,{icon:ce,label:"Agents Enabled",value:c.totalAgents,sub:`${c.activeAgents} running, ${Math.max(0,c.totalAgents-c.activeAgents)} paused`,color:"text-info"}),t.jsx(F,{icon:_,label:"Tasks In Progress",value:o,sub:`${p.length} open, ${x} blocked`,color:"text-warning"}),t.jsx(F,{icon:de,label:"Budget Used",value:`${Math.round(M)}%`,sub:M>=80?"Nearing limit":"Healthy",color:M>=80?"text-error":"text-success"}),t.jsx(F,{icon:xe,label:"Goals",value:((m=c.goalTree)==null?void 0:m.length)??0,sub:"in hierarchy",color:"text-purple"})]}),c.agents.length>0&&t.jsx(fe,{agents:c.agents,activity:u}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[t.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(G,{size:14,className:"text-accent"}),t.jsx("h3",{className:"text-sm font-semibold text-text",children:"Recent Activity"})]}),t.jsx(U,{to:"/command-post/activity",className:"text-[10px] text-accent hover:text-accent-hover",children:"View all"})]}),t.jsx("div",{className:"max-h-72 overflow-y-auto divide-y divide-border",children:u.length===0?t.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"No activity yet"}):[...u].reverse().slice(0,15).map((r,j)=>t.jsxs("div",{className:"flex items-start gap-2 px-4 py-2",children:[t.jsx(G,{size:12,className:"text-text-muted mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-[11px] text-text-secondary flex-1",children:r.message}),t.jsx("span",{className:"text-[10px] text-text-muted flex-shrink-0",children:K(r.timestamp)})]},`${r.timestamp}-${j}`))})]}),t.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl overflow-hidden",children:[t.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(_,{size:14,className:"text-accent"}),t.jsx("h3",{className:"text-sm font-semibold text-text",children:"Recent Issues"})]}),t.jsx(U,{to:"/command-post/issues",className:"text-[10px] text-accent hover:text-accent-hover",children:"View all"})]}),t.jsx("div",{className:"max-h-72 overflow-y-auto divide-y divide-border",children:p.length===0?t.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"No issues yet"}):p.slice(0,10).map(r=>t.jsxs(U,{to:`/command-post/issues/${r.id}`,className:"flex items-center gap-2 px-4 py-2 hover:bg-bg-tertiary transition-colors",children:[t.jsx(ie,{status:r.status,variant:"dot",size:"sm"}),t.jsx("span",{className:"text-[11px] text-text-secondary flex-1 truncate",children:r.title}),r.assigneeAgentId&&t.jsx("span",{className:"text-[10px] text-text-muted",children:r.assigneeAgentId}),t.jsx("span",{className:"text-[10px] text-text-muted flex-shrink-0",children:K(r.updatedAt)})]},r.id))})]})]})]})}export{Ae as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,j as e,b as f,X as j}from"./index-
|
|
1
|
+
import{r as i,j as e,b as f,X as j}from"./index-BU17I9hX.js";import{a as N,F as y}from"./folder-CHZqSMue.js";import{S as v}from"./search-BUlbT-aT.js";import{R as p}from"./terminal-BgpIZWzR.js";import{F as w}from"./users-DHaLcBWd.js";async function h(t){const a=await f(t);if(!a.ok)throw new Error(`HTTP ${a.status}`);return a.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 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`}function k({path:t,onClose:a}){const[r,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:a,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}),r&&"sizeBytes"in r&&e.jsxs("div",{className:"text-xs text-text-muted",children:[b(r.sizeBytes)," · ",r.encoding,r.truncated?" · truncated at 1MB":""]})]}),e.jsx("button",{onClick:a,className:"p-1 rounded hover:bg-bg-tertiary text-text-muted",title:"Close",children:e.jsx(j,{size:18})})]}),e.jsxs("div",{className:"flex-1 overflow-auto p-4",children:[r===null&&e.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:"Loading…"}),r&&"error"in r&&e.jsx("div",{className:"text-error text-sm py-8 text-center",children:r.error}),r&&"content"in r&&e.jsx("pre",{className:"text-[12px] font-mono leading-snug whitespace-pre-wrap text-text-secondary",children:r.content})]})]})})}function C(){const[t,a]=i.useState([]),[r,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");a(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:r?"animate-spin":""}),r?"Loading":"Refresh"]}),e.jsxs("div",{className:"text-xs text-text-muted",children:[x.length," / ",t.length]})]}),r&&t.length===0&&e.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:"Loading…"}),!r&&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(k,{path:o,onClose:()=>n(null)})]})}function S(){const[t,a]=i.useState([]),[r,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");a(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:r?"animate-spin":""}),r?"Loading":"Refresh"]}),e.jsxs("div",{className:"text-xs text-text-muted",children:[t.length," items"]})]}),r&&t.length===0&&e.jsx("div",{className:"text-center py-12 text-text-muted text-sm",children:"Loading…"}),!r&&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 R(){const[t,a]=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:()=>a("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:()=>a("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(y,{size:14})," Research"]})]}),t==="files"?e.jsx(C,{}):e.jsx(S,{})]})}export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,br as D,j as e,X as $,b as N}from"./index-
|
|
1
|
+
import{r as i,br as D,j as e,X as $,b as N}from"./index-BU17I9hX.js";import{B as j}from"./Input-DwXJfZQE.js";import{S as T}from"./StatusBadge-C0gmL26P.js";import{P as M}from"./PageHeader-D28AkFY9.js";import{E as O}from"./EmptyState-C7Ew65Up.js";import{M as A}from"./Modal-CD5NlUD9.js";import{S as F}from"./SkeletonLoader-C3RRc1JS.js";import{P as L}from"./plus-Dwty0JFZ.js";import{T as y}from"./target-DIF5T_yj.js";import{C as B}from"./chevron-down-C3PrjI-d.js";import{C as I}from"./chevron-right-D_5QP27T.js";import{T as U}from"./trash-2-B6ITzg87.js";import"./loader-circle-BaviPWa-.js";import"./proxy-Bv-wApak.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 E(t,a){for(const l of t){if(l.goal.id===a)return l;const d=E(l.children,a);if(d)return d}return null}function le(){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(""),[P,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?E(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:P,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{le as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as A,r as d,bp as D,j as e,al as G,bu as J,u as Y,E as Z,x as ee,bo as te,I as se,i as re,T as I,X as E,L as B,bv as ae,Q as ne,U as ie,bw as oe,b as le}from"./index-
|
|
1
|
+
import{c as A,r as d,bp as D,j as e,al as G,bu as J,u as Y,E as Z,x as ee,bo as te,I as se,i as re,T as I,X as E,L as B,bv as ae,Q as ne,U as ie,bw as oe,b as le}from"./index-BU17I9hX.js";import{B as m}from"./Input-DwXJfZQE.js";import{P as de}from"./PageHeader-D28AkFY9.js";import{E as ce}from"./EmptyState-C7Ew65Up.js";import{T as xe}from"./Tabs-B5Mn9d1Z.js";import{S as ue}from"./SkeletonLoader-C3RRc1JS.js";import{e as pe}from"./approvalHeadline-DB9SgR-9.js";import{M as P}from"./users-DHaLcBWd.js";import{B as q}from"./wrench-BKGESH8T.js";import{C}from"./clock-D9dj8p1r.js";import{S as he}from"./send-CWc9tYqk.js";import{S as me}from"./shield-check-ChQz9pPn.js";import{C as U}from"./check-BmeA_36a.js";import{F as ge}from"./funnel-DpcKgmVb.js";import{C as fe}from"./chevron-up-xrfX9iXN.js";import{C as be}from"./chevron-down-C3PrjI-d.js";import{R as ve}from"./rotate-ccw-DmpAMnoF.js";import"./loader-circle-BaviPWa-.js";import"./chevron-right-D_5QP27T.js";/**
|
|
2
2
|
* @license lucide-react v0.513.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|