titan-agent 6.3.3 → 6.3.4
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-srKuRJBx.js → AuditPanel-C7rrUHBM.js} +1 -1
- package/ui/dist/assets/{AutonomyPanel-DTOg92_8.js → AutonomyPanel-CcOxsveF.js} +1 -1
- package/ui/dist/assets/{AutopilotPanel-C-XlExji.js → AutopilotPanel-CjrYEF2s.js} +1 -1
- package/ui/dist/assets/{AutoresearchPanel-BYffkknO.js → AutoresearchPanel-CBdGRAdZ.js} +1 -1
- package/ui/dist/assets/{BackupPanel-BpqVqS2y.js → BackupPanel-BhU-utCn.js} +1 -1
- package/ui/dist/assets/{BrowserPanel-CpcHkt_q.js → BrowserPanel-Dr-B5Kva.js} +1 -1
- package/ui/dist/assets/{CPActivity-BDsBsGAV.js → CPActivity-C5kJWqWc.js} +1 -1
- package/ui/dist/assets/{CPAgentDetail-C8kfr8IG.js → CPAgentDetail-BVE3LoLA.js} +1 -1
- package/ui/dist/assets/{CPAgents-DO7kdGWL.js → CPAgents-BKBSyXHs.js} +1 -1
- package/ui/dist/assets/{CPApprovals-UJ-Rs0IT.js → CPApprovals-AkRGu05y.js} +1 -1
- package/ui/dist/assets/{CPCosts-C7ZevZP2.js → CPCosts-DC5mPwVm.js} +1 -1
- package/ui/dist/assets/{CPDashboard-BZN7lJ4t.js → CPDashboard-C7G-H6HW.js} +1 -1
- package/ui/dist/assets/{CPFiles-Bx4ttNJ8.js → CPFiles-IhcbsdvY.js} +1 -1
- package/ui/dist/assets/{CPGoals-Bvzkk8W6.js → CPGoals-BL0rrvT5.js} +1 -1
- package/ui/dist/assets/{CPInbox-BczZjFbO.js → CPInbox-CBUkqu4i.js} +1 -1
- package/ui/dist/assets/{CPIssueDetail-DRVr_aqu.js → CPIssueDetail-HuI9tPu4.js} +1 -1
- package/ui/dist/assets/{CPIssues-DpeO_37Y.js → CPIssues-Do9d-evH.js} +1 -1
- package/ui/dist/assets/CPLayout-DlpdPzBu.js +2 -0
- package/ui/dist/assets/{CPOrg-CZaFupL_.js → CPOrg-WHkSBNGU.js} +1 -1
- package/ui/dist/assets/{CPRuns-LfgKZcY5.js → CPRuns-B4Pz5QkG.js} +1 -1
- package/ui/dist/assets/{CPSocial-aV6eplfG.js → CPSocial-DayQlwZL.js} +1 -1
- package/ui/dist/assets/{CPVoice-CJfW9Rmi.js → CPVoice-C2ry-Muk.js} +1 -1
- package/ui/dist/assets/{ChannelsPanel-C2BO3kax.js → ChannelsPanel-CeIEB9Es.js} +1 -1
- package/ui/dist/assets/{CheckpointsPanel-CBcHZncd.js → CheckpointsPanel-BkqqvLDL.js} +1 -1
- package/ui/dist/assets/{CommandPostHub-CLnqGM62.js → CommandPostHub-Jd5_PAh3.js} +3 -3
- package/ui/dist/assets/{CronPanel-DGraqIbo.js → CronPanel-COkBBcTV.js} +1 -1
- package/ui/dist/assets/{DataTable-BJlvWF1y.js → DataTable-YQ9l5Xab.js} +1 -1
- package/ui/dist/assets/{DreamPanel-DfczImsZ.js → DreamPanel-B5M--_sB.js} +1 -1
- package/ui/dist/assets/{EmptyState-D_fRWCXx.js → EmptyState-DtSIPEVv.js} +1 -1
- package/ui/dist/assets/{EvalHarnessPanel-Benn3gFG.js → EvalHarnessPanel-DXU9jNmm.js} +1 -1
- package/ui/dist/assets/{EvalPanel-DDDTr1W8.js → EvalPanel-CY1kmmoG.js} +1 -1
- package/ui/dist/assets/{FileViewer-CFDLpbl3.js → FileViewer-BPLxBXEr.js} +1 -1
- package/ui/dist/assets/{FilesPanel-g8k7Z_ea.js → FilesPanel-B5RpGquX.js} +1 -1
- package/ui/dist/assets/{FleetPanel-01gxZlxR.js → FleetPanel-1g-MrF81.js} +1 -1
- package/ui/dist/assets/{HomelabPanel-C_Kpp-jq.js → HomelabPanel-CxkWfeeN.js} +1 -1
- package/ui/dist/assets/InfraView-CYH3ieie.js +2 -0
- package/ui/dist/assets/{InlineEditableField-zyYfa5Jl.js → InlineEditableField-BuXVLQiL.js} +1 -1
- package/ui/dist/assets/{Input-Cm4ppgbt.js → Input-C6OxbFDH.js} +1 -1
- package/ui/dist/assets/{IntegrationsPanel-DLfYHy7-.js → IntegrationsPanel-CPZclot5.js} +1 -1
- package/ui/dist/assets/IntelligenceView-DqwlFo91.js +2 -0
- package/ui/dist/assets/{LearningPanel-2LcS5Vqm.js → LearningPanel-DHQSZZGb.js} +1 -1
- package/ui/dist/assets/{LogsPanel-YDE1-OQU.js → LogsPanel-XfC4fyQ6.js} +1 -1
- package/ui/dist/assets/{McpPanel-D1v3LwyX.js → McpPanel-CBN7xizL.js} +1 -1
- package/ui/dist/assets/{MemoryGraphPanel-CtWA8YuJ.js → MemoryGraphPanel-BBxgK2Lo.js} +1 -1
- package/ui/dist/assets/{MemoryWikiPanel-Cqps7hGG.js → MemoryWikiPanel-BNv9ycwr.js} +1 -1
- package/ui/dist/assets/{MeshPanel-BNBI60Kh.js → MeshPanel-GFPkWStS.js} +1 -1
- package/ui/dist/assets/{MissionCanvas-CPmsOHNs.js → MissionCanvas-BR9tT-Vs.js} +1 -1
- package/ui/dist/assets/{MissionChat-BhdcG_8G.js → MissionChat-B_fuBUn5.js} +1 -1
- package/ui/dist/assets/{MissionLibrary-Deks4dm7.js → MissionLibrary-C9fCMdpu.js} +1 -1
- package/ui/dist/assets/{MissionStart-ClQzNvvk.js → MissionStart-Bb2fCB2u.js} +1 -1
- package/ui/dist/assets/{Modal-D3kmdSBW.js → Modal-9_l_CYE2.js} +1 -1
- package/ui/dist/assets/{NvidiaPanel-BhSsBbMG.js → NvidiaPanel-CiB9Nlbq.js} +1 -1
- package/ui/dist/assets/{OrganismPanel-5eKj-u5O.js → OrganismPanel-d6mPFcBq.js} +1 -1
- package/ui/dist/assets/{OverviewPanel-C7YJgjIS.js → OverviewPanel-DF7eBJCF.js} +1 -1
- package/ui/dist/assets/{PageHeader-0FZrM9sX.js → PageHeader-BQEb_uAl.js} +1 -1
- package/ui/dist/assets/{PersonaProfilesPanel-Kbyz2S3M.js → PersonaProfilesPanel-qAgZyu1B.js} +1 -1
- package/ui/dist/assets/{PersonasPanel-DzJFmfaz.js → PersonasPanel-CxDpp_3j.js} +1 -1
- package/ui/dist/assets/{PhoneDeskPanel-DZDPkVmm.js → PhoneDeskPanel-CLp3E_Ry.js} +1 -1
- package/ui/dist/assets/{RecipesPanel-sG2wIUOY.js → RecipesPanel-DqMMQnyc.js} +1 -1
- package/ui/dist/assets/{SecurityPanel-R8QcTvYn.js → SecurityPanel-BQ3-aMmO.js} +1 -1
- package/ui/dist/assets/{SelfImprovePanel-Burrv2Jw.js → SelfImprovePanel-C-ylXP-k.js} +1 -1
- package/ui/dist/assets/{SelfProposalsPanel-DdHyA7M7.js → SelfProposalsPanel-d5W-0A3P.js} +1 -1
- package/ui/dist/assets/{SessionsPanel-ByV8dYnL.js → SessionsPanel-DzbNc8iW.js} +1 -1
- package/ui/dist/assets/{SessionsTab-BRpcK3SC.js → SessionsTab-CuRh8SAw.js} +1 -1
- package/ui/dist/assets/{SettingsPanel-E5WyEqka.js → SettingsPanel-C1FbNM3W.js} +1 -1
- package/ui/dist/assets/SettingsView-ZTklN8Q3.js +2 -0
- package/ui/dist/assets/{SkeletonLoader-BxTaQoW_.js → SkeletonLoader-CrZUFaIM.js} +1 -1
- package/ui/dist/assets/{SkillsPanel-BXyiyd7F.js → SkillsPanel-eyCYqSuP.js} +1 -1
- package/ui/dist/assets/{SomaView-w865kZBc.js → SomaView-CvHD2r-j.js} +1 -1
- package/ui/dist/assets/{StatCard-D2OzXAEF.js → StatCard-_MlD8k-5.js} +1 -1
- package/ui/dist/assets/{StatusBadge-9A-LF8XO.js → StatusBadge-MIQ4EfQR.js} +1 -1
- package/ui/dist/assets/{Tabs-C7UF63vs.js → Tabs-DkooY-W7.js} +1 -1
- package/ui/dist/assets/{TeamsPanel-BeNA1P-k.js → TeamsPanel-fa--osWi.js} +1 -1
- package/ui/dist/assets/{TelemetryPanel-D8gu25aT.js → TelemetryPanel-BEEWcoNE.js} +1 -1
- package/ui/dist/assets/{TitanCanvas-D7KEvDFz.js → TitanCanvas-LWyPGpf5.js} +27 -27
- package/ui/dist/assets/{ToolsView-CDeB3RtS.js → ToolsView-UCDMsvb1.js} +2 -2
- package/ui/dist/assets/{Tooltip-1mExUZjj.js → Tooltip-DrpHNalN.js} +1 -1
- package/ui/dist/assets/{TraceViewer-MDRjeVoy.js → TraceViewer-XsmYbc0e.js} +1 -1
- package/ui/dist/assets/{TrainingPanel-CS9oWB58.js → TrainingPanel-CmJXLn4n.js} +1 -1
- package/ui/dist/assets/{VoiceOverlay-BeQ9oiym.js → VoiceOverlay-D2N-c76K.js} +1 -1
- package/ui/dist/assets/{VramPanel-BNOFAvif.js → VramPanel-h6zjNx-6.js} +1 -1
- package/ui/dist/assets/{WatchView-COyUaBza.js → WatchView-DDNt13KH.js} +1 -1
- package/ui/dist/assets/{WorkTab-BFYrzFcn.js → WorkTab-CLXkjuee.js} +1 -1
- package/ui/dist/assets/{WorkflowsPanel-DEz8opv0.js → WorkflowsPanel-BYtLGQVm.js} +1 -1
- package/ui/dist/assets/{archive-D0TMs-ec.js → archive-BSupLPZM.js} +1 -1
- package/ui/dist/assets/{arrow-left-BflMGFJr.js → arrow-left-BaVVZjqf.js} +1 -1
- package/ui/dist/assets/{book-open-DucGf6Ry.js → book-open-CZxMkLs8.js} +1 -1
- package/ui/dist/assets/{bot-DlZ9827e.js → bot-Cv-edYov.js} +1 -1
- package/ui/dist/assets/{chart-column-Dva45R9X.js → chart-column-BSVdQ9RP.js} +1 -1
- package/ui/dist/assets/{check-o_c7GSUi.js → check-DbgTEg8O.js} +1 -1
- package/ui/dist/assets/{chevron-right-B2xN7vZr.js → chevron-right-DfToq0aQ.js} +1 -1
- package/ui/dist/assets/{chevron-up-DNehgPl9.js → chevron-up-DMS2Tjip.js} +1 -1
- package/ui/dist/assets/{circle-check-big-BTui49nQ.js → circle-check-big-BBQqeCVt.js} +1 -1
- package/ui/dist/assets/{circle-stop-GEGv_qUQ.js → circle-stop-CZNS3Uri.js} +1 -1
- package/ui/dist/assets/{clipboard-list-Dy-3UtJn.js → clipboard-list-CzMXlUCb.js} +1 -1
- package/ui/dist/assets/{clock-DSVWc_hS.js → clock-BvWNugZo.js} +1 -1
- package/ui/dist/assets/{dollar-sign-B57wYnbN.js → dollar-sign-pghzkByE.js} +1 -1
- package/ui/dist/assets/{download-BYoF2I2k.js → download-CupMD2Qi.js} +1 -1
- package/ui/dist/assets/{external-link-BbZ5ZMbT.js → external-link-8Pnd2MvS.js} +1 -1
- package/ui/dist/assets/{file-text-BsTFGmBj.js → file-text-rkojc4Uq.js} +1 -1
- package/ui/dist/assets/{flask-conical-D8gouq57.js → flask-conical-BtbE3rIA.js} +1 -1
- package/ui/dist/assets/{folder-C0s6yhdf.js → folder-65U1Euur.js} +1 -1
- package/ui/dist/assets/{funnel-CYj9F_J0.js → funnel-D9FpWHn9.js} +1 -1
- package/ui/dist/assets/{git-branch-BFjAPkNq.js → git-branch-D6YV_OC1.js} +1 -1
- package/ui/dist/assets/{index-Dnvk3jCu.js → index-BslUQuVl.js} +61 -61
- package/ui/dist/assets/{layers-7OM7j4xy.js → layers-rc37Q5yX.js} +1 -1
- package/ui/dist/assets/{legacy-DWFG28eD.js → legacy-BydeSW77.js} +1 -1
- package/ui/dist/assets/{lightbulb-KE9dVLJ1.js → lightbulb-BEx7BdxD.js} +1 -1
- package/ui/dist/assets/{list-todo-I7S4ILfX.js → list-todo-6N1AZe4i.js} +1 -1
- package/ui/dist/assets/{message-square-BktXdPkG.js → message-square-BEGY8pHF.js} +1 -1
- package/ui/dist/assets/{mic-CQcJXVlD.js → mic-CGj6cLoV.js} +1 -1
- package/ui/dist/assets/{missions-DoFF2JOc.js → missions-BohoEPZo.js} +1 -1
- package/ui/dist/assets/{network-CxR7yDrR.js → network-DxIkmFJR.js} +1 -1
- package/ui/dist/assets/{pause-CoNV7lxb.js → pause-CxvyFedA.js} +1 -1
- package/ui/dist/assets/{pencil-BfcTfeAV.js → pencil-D5LooNFk.js} +1 -1
- package/ui/dist/assets/{play-BQj0nGq2.js → play-6W8amqUG.js} +1 -1
- package/ui/dist/assets/{plug-Bt3RMNci.js → plug-C3Ecy-Ji.js} +1 -1
- package/ui/dist/assets/{plus-D3aWFzy1.js → plus-BtmCDNeU.js} +1 -1
- package/ui/dist/assets/{proxy-Dxc39wKi.js → proxy-BD29vUSb.js} +1 -1
- package/ui/dist/assets/{radio-DwaUeLWj.js → radio-Bl9Tibea.js} +1 -1
- package/ui/dist/assets/{refresh-cw-pV7an3cE.js → refresh-cw-BHphkMjv.js} +1 -1
- package/ui/dist/assets/{rotate-ccw-DQ2_e6Ey.js → rotate-ccw-DQzGCkVc.js} +1 -1
- package/ui/dist/assets/{save-Bc5LT98_.js → save-Bk90yLic.js} +1 -1
- package/ui/dist/assets/{search-5DwwxYyL.js → search-DxM6zcDJ.js} +1 -1
- package/ui/dist/assets/{send-D1b4UjEx.js → send-ChZ5Hsne.js} +1 -1
- package/ui/dist/assets/{server-DjUE1pG1.js → server-CSOB40Ah.js} +1 -1
- package/ui/dist/assets/{shield-check-CFFgZVUJ.js → shield-check-uMK1alGs.js} +1 -1
- package/ui/dist/assets/{terminal-BgivA6PX.js → terminal-lIpm0q0K.js} +1 -1
- package/ui/dist/assets/{test-tube-dYWRJTXm.js → test-tube-DuTInDo7.js} +1 -1
- package/ui/dist/assets/{toggle-right-C0WDq8zW.js → toggle-right-j4jgj1NQ.js} +1 -1
- package/ui/dist/assets/{trash-2-BYDarYfk.js → trash-2-2Qmp8Fyr.js} +1 -1
- package/ui/dist/assets/{trending-up-gomnMzHI.js → trending-up-BydxQces.js} +1 -1
- package/ui/dist/assets/{trophy-BdGosdNp.js → trophy-B8Fq83wO.js} +1 -1
- package/ui/dist/assets/{volume-2-UXO66-b3.js → volume-2-B6qThcBF.js} +1 -1
- package/ui/dist/assets/{wifi-off-BBMJbZvM.js → wifi-off-BX5XYuML.js} +1 -1
- package/ui/dist/index.html +1 -1
- package/ui/dist/sw.js +1 -1
- package/ui/dist/assets/CPLayout-B2Odh1We.js +0 -2
- package/ui/dist/assets/InfraView-DLhemt3r.js +0 -2
- package/ui/dist/assets/IntelligenceView-I7i3t8kE.js +0 -2
- package/ui/dist/assets/SettingsView-BPVPhIUK.js +0 -2
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.3.
|
|
4
|
+
const TITAN_VERSION = "6.3.4";
|
|
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.3.
|
|
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.3.4';\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.3.
|
|
3
|
+
"version": "6.3.4",
|
|
4
4
|
"description": "TITAN — TypeScript AI agent framework with multi-agent orchestration, provider routing, approval gates, receipts, evals, gateway APIs, and a React Mission Control dashboard. Open-source, MIT licensed.",
|
|
5
5
|
"author": "Tony Elliott (https://github.com/Djtony707)",
|
|
6
6
|
"repository": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as d,j as e,aJ as S,aK as A}from"./index-
|
|
1
|
+
import{r as d,j as e,aJ as S,aK as A}from"./index-BslUQuVl.js";import{C as v}from"./clipboard-list-CzMXlUCb.js";import{R as C}from"./refresh-cw-BHphkMjv.js";import{F as T}from"./funnel-D9FpWHn9.js";function E(){var b;const[c,p]=d.useState([]),[r,h]=d.useState(null),[g,i]=d.useState(!0),[a,n]=d.useState(""),[l,x]=d.useState(""),m=async()=>{i(!0);try{const[t,s]=await Promise.all([S({source:a||void 0,action:l||void 0,limit:100}),A(24)]);p(t),h(s)}catch{}i(!1)};d.useEffect(()=>{m()},[a,l]);const j=t=>t==="success"?"text-[var(--success)]":t==="failure"?"text-[var(--error)]":t==="escalated"?"text-[var(--warning)]":"text-[var(--text-muted)]",f=t=>t==="success"?"bg-[var(--success)]/10 border-[var(--success)]/20":t==="failure"?"bg-[var(--error)]/10 border-[var(--error)]/20":t==="escalated"?"bg-[var(--warning)]/10 border-[var(--warning)]/20":"bg-[var(--bg-tertiary)] border-[var(--border)]",u=t=>t.startsWith("daemon")?"bg-purple-500/10 text-purple-400 border-purple-500/20":t==="autopilot"?"bg-blue-500/10 text-blue-400 border-blue-500/20":t==="user"?"bg-emerald-500/10 text-emerald-400 border-emerald-500/20":t==="initiative"?"bg-amber-500/10 text-amber-400 border-amber-500/20":"bg-[var(--bg-tertiary)] text-[var(--text-muted)] border-[var(--border)]",N=t=>{try{const s=new Date(t),o=new Date().getTime()-s.getTime();return o<6e4?`${Math.round(o/1e3)}s ago`:o<36e5?`${Math.round(o/6e4)}m ago`:o<864e5?`${Math.round(o/36e5)}h ago`:s.toLocaleDateString()}catch{return t}},y=[...new Set(c.map(t=>t.source))].sort(),w=[...new Set(c.map(t=>t.action))].sort();return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(v,{className:"w-6 h-6 text-[var(--accent)]"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-[var(--text)]",children:"Audit Log"}),e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Every autonomous action logged for accountability"})]})]}),e.jsx("button",{onClick:m,className:"p-2 rounded-md border border-[var(--border)] text-[var(--text-secondary)] hover:bg-[var(--bg-tertiary)] transition-colors",children:e.jsx(C,{size:14})})]}),r&&e.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 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:"Actions (24h)"}),e.jsx("p",{className:"text-2xl font-bold text-[var(--text)]",children:r.totalActions})]}),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:"Success Rate"}),e.jsxs("p",{className:`text-2xl font-bold ${r.successRate>=80?"text-[var(--success)]":r.successRate>=50?"text-[var(--warning)]":"text-[var(--error)]"}`,children:[r.successRate,"%"]})]}),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:"Sources"}),e.jsx("p",{className:"text-2xl font-bold text-[var(--text)]",children:Object.keys(r.bySource).length})]}),e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:"Top Tool"}),e.jsx("p",{className:"text-lg font-semibold text-[var(--accent)] truncate",children:((b=r.topTools[0])==null?void 0:b.tool)||"none"})]})]}),r&&Object.keys(r.bySource).length>0&&e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-[var(--text)] mb-3",children:"Actions by Source (24h)"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(r.bySource).sort((t,s)=>s[1]-t[1]).map(([t,s])=>e.jsxs("button",{onClick:()=>n(a===t?"":t),className:`px-3 py-1.5 text-xs rounded-md border transition-colors ${a===t?"bg-[var(--accent)] text-white border-[var(--accent)]":u(t)}`,children:[t,": ",s]},t))})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(T,{size:14,className:"text-[var(--text-muted)]"}),e.jsxs("select",{value:a,onChange:t=>n(t.target.value),className:"px-3 py-1.5 text-xs bg-[var(--bg-secondary)] border border-[var(--border)] rounded-md text-[var(--text)]",children:[e.jsx("option",{value:"",children:"All Sources"}),y.map(t=>e.jsx("option",{value:t,children:t},t))]}),e.jsxs("select",{value:l,onChange:t=>x(t.target.value),className:"px-3 py-1.5 text-xs bg-[var(--bg-secondary)] border border-[var(--border)] rounded-md text-[var(--text)]",children:[e.jsx("option",{value:"",children:"All Actions"}),w.map(t=>e.jsx("option",{value:t,children:t},t))]}),(a||l)&&e.jsx("button",{onClick:()=>{n(""),x("")},className:"text-xs text-[var(--accent)] hover:underline",children:"Clear"})]}),g?e.jsx("div",{className:"text-[var(--text-muted)] text-sm",children:"Loading audit log..."}):c.length===0?e.jsxs("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg p-8 text-center",children:[e.jsx(v,{className:"w-10 h-10 text-[var(--text-muted)] mx-auto mb-3"}),e.jsx("p",{className:"text-[var(--text-secondary)]",children:"No audit entries found"}),e.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"Autonomous actions will appear here as TITAN operates."})]}):e.jsx("div",{className:"bg-[var(--bg-secondary)] border border-[var(--border)] rounded-lg overflow-hidden",children: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-[var(--border)] text-[var(--text-muted)]",children:[e.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Time"}),e.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Action"}),e.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Source"}),e.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Tool"}),e.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Result"}),e.jsx("th",{className:"text-left px-4 py-2 font-medium",children:"Detail"})]})}),e.jsx("tbody",{children:c.map((t,s)=>e.jsxs("tr",{className:"border-b border-[var(--border)]/50 last:border-0 hover:bg-[var(--bg-tertiary)] transition-colors",children:[e.jsx("td",{className:"px-4 py-2 text-[var(--text-muted)] whitespace-nowrap",children:N(t.timestamp)}),e.jsx("td",{className:"px-4 py-2 text-[var(--text)] font-medium",children:t.action}),e.jsx("td",{className:"px-4 py-2",children:e.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] border ${u(t.source)}`,children:t.source})}),e.jsx("td",{className:"px-4 py-2 text-[var(--text-secondary)] font-mono",children:t.tool||"-"}),e.jsx("td",{className:"px-4 py-2",children:t.result?e.jsx("span",{className:`px-2 py-0.5 rounded text-[10px] border ${f(t.result)} ${j(t.result)}`,children:t.result}):"-"}),e.jsx("td",{className:"px-4 py-2 text-[var(--text-muted)] max-w-[200px] truncate",children:t.detail?JSON.stringify(t.detail):"-"})]},s))})]})})})]})}export{E as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as M,r as c,a8 as B,j as e,L as C,i as F,Z as E,a9 as O,t as T,b,f as g,B as q,U as G,G as V,h as I}from"./index-
|
|
1
|
+
import{c as M,r as c,a8 as B,j as e,L as C,i as F,Z as E,a9 as O,t as T,b,f as g,B as q,U as G,G as V,h as I}from"./index-BslUQuVl.js";import{S as D}from"./save-Bk90yLic.js";import{C as H}from"./circle-check-big-BBQqeCVt.js";import{R as U}from"./refresh-cw-BHphkMjv.js";import{R}from"./rotate-ccw-DQzGCkVc.js";import{R as J}from"./radio-Bl9Tibea.js";import{B as Z}from"./bot-Cv-edYov.js";import{S as W}from"./server-CSOB40Ah.js";import{N as K}from"./network-DxIkmFJR.js";import{P as Q}from"./play-6W8amqUG.js";import{M as X}from"./message-square-BEGY8pHF.js";import{D as Y}from"./TitanCanvas-LWyPGpf5.js";import"./chevron-up-DMS2Tjip.js";import"./plus-BtmCDNeU.js";import"./file-text-rkojc4Uq.js";import"./terminal-lIpm0q0K.js";import"./book-open-CZxMkLs8.js";import"./pencil-D5LooNFk.js";import"./search-DxM6zcDJ.js";import"./send-ChZ5Hsne.js";import"./mic-CGj6cLoV.js";import"./flask-conical-BtbE3rIA.js";import"./clock-BvWNugZo.js";import"./archive-BSupLPZM.js";import"./test-tube-DuTInDo7.js";import"./VoiceOverlay-D2N-c76K.js";import"./chevron-right-DfToq0aQ.js";import"./volume-2-B6qThcBF.js";import"./folder-65U1Euur.js";import"./check-DbgTEg8O.js";import"./shield-check-uMK1alGs.js";import"./external-link-8Pnd2MvS.js";import"./wifi-off-BX5XYuML.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,b as n,j as e}from"./index-
|
|
1
|
+
import{r,b as n,j as e}from"./index-BslUQuVl.js";import{P as c}from"./PageHeader-BQEb_uAl.js";import"./chevron-right-DfToq0aQ.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,a7 as O,V as W}from"./index-
|
|
1
|
+
import{c as q,r as p,b as T,j as e,a7 as O,V as W}from"./index-BslUQuVl.js";import{F as A}from"./flask-conical-BtbE3rIA.js";import{P as D}from"./play-6W8amqUG.js";import{P as B}from"./pause-CxvyFedA.js";import{R as H}from"./refresh-cw-BHphkMjv.js";import{T as V}from"./trophy-B8Fq83wO.js";import{T as G}from"./trending-up-BydxQces.js";import{C as U}from"./clock-BvWNugZo.js";import{C as J}from"./chevron-right-DfToq0aQ.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 s,aN as p,j as e,aO as u,aP as h}from"./index-
|
|
1
|
+
import{r as s,aN as p,j as e,aO as u,aP as h}from"./index-BslUQuVl.js";import{P as g}from"./PageHeader-BQEb_uAl.js";import{P as b}from"./plus-BtmCDNeU.js";import{R as y}from"./refresh-cw-BHphkMjv.js";import{A as j}from"./archive-BSupLPZM.js";import{C as v}from"./circle-check-big-BBQqeCVt.js";import"./chevron-right-DfToq0aQ.js";function A(){const[c,m]=s.useState([]),[i,r]=s.useState(!0),[l,n]=s.useState(!1),[d,o]=s.useState(null),t=s.useCallback(async()=>{r(!0);try{const a=await p();m(a.backups||[])}catch{}r(!1)},[]);s.useEffect(()=>{t()},[t]);const x=async()=>{n(!0);try{await u(),await t()}catch{}n(!1)},f=async a=>{o(a);try{await h(a),alert("Backup verified successfully")}catch{alert("Backup verification failed")}o(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:x,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:t,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"]})]}),c.length===0&&!i&&e.jsx("div",{className:"text-sm text-[#52525b]",children:"No backups found."}),e.jsx("div",{className:"space-y-2",children:c.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:()=>f(a.path),disabled:d===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"})," ",d===a.path?"Verifying...":"Verify"]})]},a.path))})]})}export{A as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as i,r as s,j as e,G as m,aw as p}from"./index-
|
|
1
|
+
import{c as i,r as s,j as e,G as m,aw as p}from"./index-BslUQuVl.js";import{P as h}from"./PageHeader-BQEb_uAl.js";import"./chevron-right-DfToq0aQ.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,x as b,j as e,A as u,Z as j,W as S,K as A,T as E}from"./index-
|
|
1
|
+
import{r as a,x as b,j as e,A as u,Z as j,W as S,K as A,T as E}from"./index-BslUQuVl.js";import"./Input-C6OxbFDH.js";import{P as N}from"./PageHeader-BQEb_uAl.js";import{E as T}from"./EmptyState-DtSIPEVv.js";import{T as C}from"./Tabs-DkooY-W7.js";import{S as w}from"./SkeletonLoader-CrZUFaIM.js";import{S as P}from"./shield-check-uMK1alGs.js";import{D as $}from"./dollar-sign-pghzkByE.js";import{B as k}from"./bot-Cv-edYov.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DfToq0aQ.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:k,goal:E,budget:$,approval:P,error:A,tool:S,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 K(){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 b(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(N,{title:"Activity",subtitle:"Auto-refreshes every 10s",breadcrumbs:[{label:"Command Post"},{label:"Activity"}]}),p.length>0&&e.jsx(C,{tabs:g,activeTab:n,onChange:h}),i&&e.jsx(w,{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,y=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:`${y} 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{K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as O,u as Y,r as s,$ as G,Y as J,y as K,aB as Q,j as e,D as A,be as V}from"./index-
|
|
1
|
+
import{p as O,u as Y,r as s,$ as G,Y as J,y as K,aB as Q,j as e,D as A,be as V}from"./index-BslUQuVl.js";import{B as T}from"./Input-C6OxbFDH.js";import{S as c}from"./StatusBadge-MIQ4EfQR.js";import{P as x}from"./PageHeader-BQEb_uAl.js";import{E as W}from"./EmptyState-DtSIPEVv.js";import{T as X}from"./Tabs-DkooY-W7.js";import{S as Z}from"./SkeletonLoader-CrZUFaIM.js";import{A as _}from"./arrow-left-BaVVZjqf.js";import{C as ee}from"./circle-check-big-BBQqeCVt.js";import{D as te}from"./dollar-sign-pghzkByE.js";import{C as se}from"./clock-BvWNugZo.js";import{S as ae}from"./save-Bk90yLic.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DfToq0aQ.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=Y(),[r,m]=s.useState(null),[n,E]=s.useState([]),[u,M]=s.useState([]),[P,b]=s.useState(!0),[p,i]=s.useState(null),[d,D]=s.useState("overview"),[h,g]=s.useState(""),[f,j]=s.useState(""),[v,N]=s.useState(""),[y,S]=s.useState(""),[z,C]=s.useState(!1),[R,$]=s.useState([]),w=s.useCallback(async()=>{if(a){try{const l=(await G()).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([J(a),K({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(()=>{Q().then(t=>$(t)).catch(()=>{})},[]);const B=async()=>{if(a){C(!0);try{const t=await V(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(X,{tabs:L,activeTab:d,onChange:D}),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(W,{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:z,children:"Save"})]})]})}export{je as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,$ as m,j as e,U as p,D as u,X as h,b as j}from"./index-
|
|
1
|
+
import{r,$ as m,j as e,U as p,D as u,X as h,b as j}from"./index-BslUQuVl.js";import"./Input-C6OxbFDH.js";import{S as g}from"./StatusBadge-MIQ4EfQR.js";import{P as f}from"./PageHeader-BQEb_uAl.js";import{E as b}from"./EmptyState-DtSIPEVv.js";import{S as N}from"./SkeletonLoader-CrZUFaIM.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DfToq0aQ.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 j(`/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(N,{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(b,{icon:e.jsx(p,{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(u,{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(h,{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(g,{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,J as P,z,j as t,K as B,X as R,O as $,P as _}from"./index-
|
|
1
|
+
import{r as a,J as P,z,j as t,K as B,X as R,O as $,P as _}from"./index-BslUQuVl.js";import{B as A}from"./Input-C6OxbFDH.js";import{S as D}from"./StatusBadge-MIQ4EfQR.js";import{P as M}from"./PageHeader-BQEb_uAl.js";import{E as L}from"./EmptyState-DtSIPEVv.js";import{T as W}from"./Tabs-DkooY-W7.js";import{S as F}from"./SkeletonLoader-CrZUFaIM.js";import{e as H}from"./approvalHeadline-DB9SgR-9.js";import{S as I}from"./shield-check-uMK1alGs.js";import{C as K}from"./check-DbgTEg8O.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DfToq0aQ.js";function U(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 q(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 J=[{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}=P(),x=a.useCallback(async()=>{try{const e=await z();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=J.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(W,{tabs:C,activeTab:l,onChange:w}),m&&t.jsx(F,{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(I,{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=H(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 ${q(s.urgency)}`,children:[s.urgency==="high"&&t.jsx(B,{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:U(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(K,{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,a2 as F,j as e,a3 as I,a4 as $}from"./index-
|
|
1
|
+
import{r as s,a2 as F,j as e,a3 as I,a4 as $}from"./index-BslUQuVl.js";import{B as u}from"./Input-C6OxbFDH.js";import{S as w}from"./StatusBadge-MIQ4EfQR.js";import{P as A}from"./PageHeader-BQEb_uAl.js";import{E as L}from"./EmptyState-DtSIPEVv.js";import{M as W}from"./Modal-9_l_CYE2.js";import{S as M}from"./SkeletonLoader-CrZUFaIM.js";import{P as G}from"./plus-BtmCDNeU.js";import{D as H}from"./dollar-sign-pghzkByE.js";import{T as R}from"./trash-2-2Qmp8Fyr.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DfToq0aQ.js";import"./proxy-BD29vUSb.js";function q(r){const l=r.limitUsd>0?r.currentSpend/r.limitUsd*100:0;return l>=100?"exceeded":l>=r.warningThresholdPercent?"warning":"healthy"}function ae(){const[r,l]=s.useState([]),[c,C]=s.useState(!0),[n,m]=s.useState(null),[S,a]=s.useState(!1),[k,g]=s.useState(!1),[o,p]=s.useState(""),[i,P]=s.useState("global"),[h,b]=s.useState(""),[j,B]=s.useState("monthly"),[f,v]=s.useState("10"),[y,z]=s.useState("80"),[N,T]=s.useState("warn"),d=s.useCallback(async()=>{try{const t=await F();l(t),m(null)}catch(t){m(t instanceof Error?t.message:"Failed to load budgets")}C(!1)},[]);s.useEffect(()=>{d()},[d]);const D=async()=>{if(o.trim()){g(!0);try{await $({name:o.trim(),scope:{type:i,targetId:h||void 0},period:j,limitUsd:parseFloat(f)||10,warningThresholdPercent:parseInt(y)||80,action:N,enabled:!0}),a(!1),p(""),b(""),v("10"),await d()}catch{}g(!1)}},E=async t=>{try{await I(t),await d()}catch{}};return e.jsxs("div",{className:"space-y-4",children:[e.jsx(A,{title:"Costs & Budgets",breadcrumbs:[{label:"Command Post"},{label:"Costs"}],actions:e.jsx(u,{size:"sm",icon:e.jsx(G,{size:14}),onClick:()=>a(!0),children:"Create Budget"})}),c&&e.jsx(M,{variant:"row",count:4}),n&&e.jsx("div",{className:"text-center py-8 text-error text-sm",children:n}),!c&&!n&&r.length===0&&e.jsx(L,{icon:e.jsx(H,{size:32}),title:"No budgets",description:"Create budget policies to control agent spending.",action:{label:"Create Budget",onClick:()=>a(!0)}}),!c&&!n&&r.length>0&&e.jsx("div",{className:"divide-y divide-border rounded-xl border border-border bg-bg-secondary overflow-hidden",children:r.map(t=>{const U=t.limitUsd>0?t.currentSpend/t.limitUsd*100:0,x=q(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(w,{status:x,size:"sm"}),!t.enabled&&e.jsx(w,{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,U)}%`}})})]}),e.jsx("button",{onClick:()=>E(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(R,{size:14})})]},t.id)})}),e.jsx(W,{open:S,onClose:()=>a(!1),title:"Create Budget Policy",footer:e.jsxs(e.Fragment,{children:[e.jsx(u,{variant:"secondary",size:"sm",onClick:()=>a(!1),children:"Cancel"}),e.jsx(u,{size:"sm",onClick:D,loading:k,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=>p(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:i,onChange:t=>P(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:j,onChange:t=>B(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"})]})]})]}),i!=="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:`${i} ID...`,value:h,onChange:t=>b(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:f,onChange:t=>v(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=>z(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:N,onChange:t=>T(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{ae as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as g,j as t,w as ae,x as re,y as ie,z as ne,U as oe,T as ce,A as q,D as X}from"./index-Dnvk3jCu.js";import"./Input-Cm4ppgbt.js";import{S as de}from"./StatusBadge-9A-LF8XO.js";import{P as J}from"./PageHeader-0FZrM9sX.js";import{S as xe}from"./SkeletonLoader-BxTaQoW_.js";import{R as me}from"./refresh-cw-pV7an3cE.js";import{L as K}from"./list-todo-I7S4ILfX.js";import{D as fe}from"./dollar-sign-B57wYnbN.js";import"./clsx-B-dksMZM.js";import"./chevron-right-B2xN7vZr.js";const Q={idle:"textSecondary",active:"success",paused:"warning",error:"error",stopped:"borderLight"},he={ceo:"C",manager:"M",engineer:"E",researcher:"R",general:"G"};function ge({agents:x,activity:m}){const v=g.useRef(null),R=g.useRef(x),p=g.useRef(m);return R.current=x,p.current=m,g.useEffect(()=>{const b=v.current;if(!b)return;const e=b.getContext("2d");if(!e)return;const w=window.devicePixelRatio||1;let L,$=0;const A=()=>{const i=document.documentElement,c=getComputedStyle(i),s=(u,j,l)=>{const k=u?c.getPropertyValue(u).trim():"";return k||c.getPropertyValue(j).trim()||l};return{bg:s("--theme-bg-base","--color-bg","#09090b"),bgTertiary:s("--theme-bg-grain","--color-bg-tertiary","#27272a"),border:s("--theme-metal-dark","--color-border","#3f3f46"),borderLight:s("--theme-metal","--color-border-light","#52525b"),textMuted:s("--theme-ink-soft","--color-text-muted","#71717a"),textSecondary:s("--theme-paper-fg","--color-text-secondary","#a1a1aa"),accent:s("--theme-accent","--color-accent","#6366f1"),accentLight:s(null,"--color-accent-light","#a5b4fc"),success:s(null,"--color-success","#22c55e"),warning:s(null,"--color-warning","#f59e0b"),error:s(null,"--color-error","#ef4444")}},M=()=>{const i=b.clientWidth,c=b.clientHeight;b.width=i*w,b.height=c*w,e.setTransform(w,0,0,w,0,0)};M(),window.addEventListener("resize",M);const I=()=>{$++;const i=$/15,c=b.clientWidth,s=b.clientHeight,u=R.current,j=p.current,l=A();e.fillStyle=l.bg,e.fillRect(0,0,c,s),e.strokeStyle="#141418",e.lineWidth=.5;for(let a=0;a<c;a+=24)e.beginPath(),e.moveTo(a,s*.72),e.lineTo(a,s),e.stroke();for(let a=s*.72;a<s;a+=24)e.beginPath(),e.moveTo(0,a),e.lineTo(c,a),e.stroke();if(u.length===0){e.fillStyle=l.bgTertiary,e.font="12px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center",e.fillText("No agents registered",c/2,s/2-10),e.font="10px -apple-system, BlinkMacSystemFont, sans-serif",e.fillStyle=l.border,e.fillText("Spawn agents to see them here",c/2,s/2+10),e.textAlign="start",L=requestAnimationFrame(I);return}const k=Math.min(u.length,8),D=Math.min(120,(c-20)/k),ee=(c-D*k)/2+D/2;for(let a=0;a<k;a++){const P=u[a],r=ee+a*D,n=s*.55,f=P.status==="active"?"active":P.status,z=l[Q[f]||Q.idle],o=Math.sin(i*.8+a*1.5)*1.5,F=j.some(d=>d.agentId===P.id&&Date.now()-new Date(d.timestamp).getTime()<3e4),E=Math.min(70,D-10),T=10,B=r-E/2,S=n+16;e.fillStyle=l.border,e.fillRect(B,S,E,T),e.fillStyle=l.borderLight,e.fillRect(B+1,S+1,E-2,T-2),e.fillStyle=l.border,e.fillRect(B+3,S+T,3,14),e.fillRect(B+E-6,S+T,3,14);const H=26,O=18,V=r-H/2,U=S-O;e.fillStyle=l.bgTertiary,e.fillRect(V,U,H,O);const Y=f==="error"?l.error:f==="active"?l.success:l.accent;if(e.fillStyle=Y+"30",e.fillRect(V+2,U+2,H-4,O-4),f==="active"||F){e.fillStyle=Y+"60";const d=2+Math.floor(i%3);for(let h=0;h<d;h++){const C=6+Math.sin(i*2+h+a)*5;e.fillRect(V+3,U+3+h*4,C,1.5)}}e.fillStyle=l.border,e.fillRect(r-2,S-1,4,3),e.fillStyle="#1e1e22",e.fillRect(r-10,n+10+o,20,8),e.fillRect(r-11,n-2+o,3,20),e.fillStyle=l.border,e.fillRect(r-7,n+o,14,12);const y=f==="active"&&F?Math.sin(i*1.5+a)*1.5:0;e.fillStyle=l.borderLight,e.fillRect(r-6,n-10+o+y,12,10);const G=Math.sin(i*.3+a*2)>.95?1:2;if(e.fillStyle=z,f==="stopped"?(e.fillRect(r-4,n-7+o+y,2,1),e.fillRect(r-3,n-6+o+y,2,1),e.fillRect(r+1,n-7+o+y,2,1),e.fillRect(r+2,n-6+o+y,2,1)):(e.fillRect(r-4,n-7+o+y,2,G),e.fillRect(r+2,n-7+o+y,2,G)),e.fillStyle=l.borderLight,e.fillRect(r-1,n-14+o+y,2,4),e.fillStyle=z,e.beginPath(),e.arc(r,n-15+o+y,2,0,Math.PI*2),e.fill(),f==="active"&&(e.globalAlpha=.3+Math.sin(i*3+a)*.2,e.beginPath(),e.arc(r,n-15+o+y,5,0,Math.PI*2),e.fill(),e.globalAlpha=1),f==="active"&&F){const d=Math.sin(i*6+a)*2,h=Math.sin(i*6+a+Math.PI)*2;e.fillStyle=l.border,e.fillRect(r-11,n+3+o+d,4,3),e.fillRect(r+7,n+3+o+h,4,3)}else e.fillStyle=l.border,e.fillRect(r-10,n+5+o,3,6),e.fillRect(r+7,n+5+o,3,6);if(f==="active"&&F){for(let d=0;d<2;d++){const h=i*1.5+d*Math.PI+a,C=14+Math.sin(i+d)*4,se=r+Math.cos(h)*C,le=n-3+Math.sin(h)*C*.4+o;e.globalAlpha=.25+Math.sin(i*2+d)*.15,e.fillStyle=z,e.beginPath(),e.arc(se,le,1,0,Math.PI*2),e.fill()}e.globalAlpha=1}if(f==="error"){for(let d=0;d<3;d++){const h=r+Math.sin(i*4+d*2)*12,C=n-5+Math.cos(i*3+d)*8+o;e.globalAlpha=.4+Math.sin(i+d)*.3,e.fillStyle=l.error,e.fillRect(h-1,C-1,2,2)}e.globalAlpha=1}e.fillStyle=f==="stopped"?l.border:l.textMuted,e.font="9px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center";const _=Math.max(44,E+14);let N=P.name;if(e.measureText(N).width>_){for(;N.length>1&&e.measureText(N+"…").width>_;)N=N.slice(0,-1);N=N.trimEnd()+"…"}e.fillText(N,r,S+T+24);const te=he[P.role]||"G";e.fillStyle=z+"60",e.font="bold 7px -apple-system, BlinkMacSystemFont, sans-serif",e.fillText(te,r,S+T+33),e.textAlign="start"}if(e.fillStyle=l.bgTertiary,e.font="bold 9px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center",e.fillText("COMMAND POST",c/2,s-6),e.textAlign="start",j.length>0){const a=j[j.length-1];if(Date.now()-new Date(a.timestamp).getTime()<6e4){e.fillStyle=l.accent+"40",e.fillRect(0,0,c,16),e.fillStyle=l.accentLight,e.font="8px -apple-system, BlinkMacSystemFont, sans-serif";const r=a.message.length>60?a.message.slice(0,57)+"...":a.message;e.textAlign="center",e.fillText(r,c/2,11),e.textAlign="start"}}L=requestAnimationFrame(I)};return I(),()=>{cancelAnimationFrame(L),window.removeEventListener("resize",M)}},[]),t.jsx("canvas",{ref:v,className:"w-full rounded-xl border border-border",style:{height:220,imageRendering:"pixelated"}})}function Z(x){const m=Math.floor((Date.now()-new Date(x).getTime())/1e3);return m<60?`${m}s`:m<3600?`${Math.floor(m/60)}m`:m<86400?`${Math.floor(m/3600)}h`:`${Math.floor(m/86400)}d`}function W({icon:x,label:m,value:v,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(x,{size:14,className:p}),t.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:m})]}),t.jsx("div",{className:"text-2xl font-bold text-text",children:v}),R&&t.jsx("div",{className:"text-[11px] text-text-muted mt-1",children:R})]})}function Ae(){var c;const[x,m]=g.useState(null),[v,R]=g.useState([]),[p,b]=g.useState([]),[e,w]=g.useState(0),[L,$]=g.useState(!0),A=g.useCallback(async()=>{try{const[s,u,j,l]=await Promise.all([ae(),re(20),ie(),ne("pending")]);m(s),R(u),b(j),w(l.length)}catch{}$(!1)},[]);if(g.useEffect(()=>{A();const s=setInterval(A,15e3);return()=>clearInterval(s)},[A]),L)return t.jsxs("div",{className:"space-y-6",children:[t.jsx(J,{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(xe,{variant:"metric",count:4})})]});if(!x)return t.jsx("div",{className:"text-center py-12 text-text-muted",children:"Failed to load dashboard"});const M=x.budgetUtilization??0,I=p.filter(s=>s.status==="in_progress").length,i=p.filter(s=>s.status==="blocked").length;return t.jsxs("div",{className:"space-y-6",children:[t.jsx(J,{title:"Dashboard",breadcrumbs:[{label:"Command Post"},{label:"Dashboard"}],actions:t.jsx("button",{onClick:A,className:"p-1.5 text-text-muted hover:text-text rounded-lg hover:bg-bg-tertiary transition-colors",children:t.jsx(me,{size:16})})}),t.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[t.jsx(W,{icon:oe,label:"Agents Enabled",value:x.totalAgents,sub:`${x.activeAgents} running, ${Math.max(0,x.totalAgents-x.activeAgents)} paused`,color:"text-info"}),t.jsx(W,{icon:K,label:"Tasks In Progress",value:I,sub:`${p.length} open, ${i} blocked`,color:"text-warning"}),t.jsx(W,{icon:fe,label:"Budget Used",value:`${Math.round(M)}%`,sub:M>=80?"Nearing limit":"Healthy",color:M>=80?"text-error":"text-success"}),t.jsx(W,{icon:ce,label:"Goals",value:((c=x.goalTree)==null?void 0:c.length)??0,sub:"in hierarchy",color:"text-purple"})]}),x.agents.length>0&&t.jsx(ge,{agents:x.agents,activity:v}),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(q,{size:14,className:"text-accent"}),t.jsx("h3",{className:"text-sm font-semibold text-text",children:"Recent Activity"})]}),t.jsx(X,{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:v.length===0?t.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"No activity yet"}):[...v].reverse().slice(0,15).map((s,u)=>t.jsxs("div",{className:"flex items-start gap-2 px-4 py-2",children:[t.jsx(q,{size:12,className:"text-text-muted mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-[11px] text-text-secondary flex-1",children:s.message}),t.jsx("span",{className:"text-[10px] text-text-muted flex-shrink-0",children:Z(s.timestamp)})]},`${s.timestamp}-${u}`))})]}),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(K,{size:14,className:"text-accent"}),t.jsx("h3",{className:"text-sm font-semibold text-text",children:"Recent Issues"})]}),t.jsx(X,{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(s=>t.jsxs(X,{to:`/command-post/issues/${s.id}`,className:"flex items-center gap-2 px-4 py-2 hover:bg-bg-tertiary transition-colors",children:[t.jsx(de,{status:s.status,variant:"dot",size:"sm"}),t.jsx("span",{className:"text-[11px] text-text-secondary flex-1 truncate",children:s.title}),s.assigneeAgentId&&t.jsx("span",{className:"text-[10px] text-text-muted",children:s.assigneeAgentId}),t.jsx("span",{className:"text-[10px] text-text-muted flex-shrink-0",children:Z(s.updatedAt)})]},s.id))})]})]})]})}export{Ae as default};
|
|
1
|
+
import{r as g,j as t,w as ae,x as re,y as ie,z as ne,U as oe,T as ce,A as q,D as X}from"./index-BslUQuVl.js";import"./Input-C6OxbFDH.js";import{S as de}from"./StatusBadge-MIQ4EfQR.js";import{P as J}from"./PageHeader-BQEb_uAl.js";import{S as xe}from"./SkeletonLoader-CrZUFaIM.js";import{R as me}from"./refresh-cw-BHphkMjv.js";import{L as K}from"./list-todo-6N1AZe4i.js";import{D as fe}from"./dollar-sign-pghzkByE.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DfToq0aQ.js";const Q={idle:"textSecondary",active:"success",paused:"warning",error:"error",stopped:"borderLight"},he={ceo:"C",manager:"M",engineer:"E",researcher:"R",general:"G"};function ge({agents:x,activity:m}){const v=g.useRef(null),R=g.useRef(x),p=g.useRef(m);return R.current=x,p.current=m,g.useEffect(()=>{const b=v.current;if(!b)return;const e=b.getContext("2d");if(!e)return;const w=window.devicePixelRatio||1;let L,$=0;const A=()=>{const i=document.documentElement,c=getComputedStyle(i),s=(u,j,l)=>{const k=u?c.getPropertyValue(u).trim():"";return k||c.getPropertyValue(j).trim()||l};return{bg:s("--theme-bg-base","--color-bg","#09090b"),bgTertiary:s("--theme-bg-grain","--color-bg-tertiary","#27272a"),border:s("--theme-metal-dark","--color-border","#3f3f46"),borderLight:s("--theme-metal","--color-border-light","#52525b"),textMuted:s("--theme-ink-soft","--color-text-muted","#71717a"),textSecondary:s("--theme-paper-fg","--color-text-secondary","#a1a1aa"),accent:s("--theme-accent","--color-accent","#6366f1"),accentLight:s(null,"--color-accent-light","#a5b4fc"),success:s(null,"--color-success","#22c55e"),warning:s(null,"--color-warning","#f59e0b"),error:s(null,"--color-error","#ef4444")}},M=()=>{const i=b.clientWidth,c=b.clientHeight;b.width=i*w,b.height=c*w,e.setTransform(w,0,0,w,0,0)};M(),window.addEventListener("resize",M);const I=()=>{$++;const i=$/15,c=b.clientWidth,s=b.clientHeight,u=R.current,j=p.current,l=A();e.fillStyle=l.bg,e.fillRect(0,0,c,s),e.strokeStyle="#141418",e.lineWidth=.5;for(let a=0;a<c;a+=24)e.beginPath(),e.moveTo(a,s*.72),e.lineTo(a,s),e.stroke();for(let a=s*.72;a<s;a+=24)e.beginPath(),e.moveTo(0,a),e.lineTo(c,a),e.stroke();if(u.length===0){e.fillStyle=l.bgTertiary,e.font="12px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center",e.fillText("No agents registered",c/2,s/2-10),e.font="10px -apple-system, BlinkMacSystemFont, sans-serif",e.fillStyle=l.border,e.fillText("Spawn agents to see them here",c/2,s/2+10),e.textAlign="start",L=requestAnimationFrame(I);return}const k=Math.min(u.length,8),D=Math.min(120,(c-20)/k),ee=(c-D*k)/2+D/2;for(let a=0;a<k;a++){const P=u[a],r=ee+a*D,n=s*.55,f=P.status==="active"?"active":P.status,z=l[Q[f]||Q.idle],o=Math.sin(i*.8+a*1.5)*1.5,F=j.some(d=>d.agentId===P.id&&Date.now()-new Date(d.timestamp).getTime()<3e4),E=Math.min(70,D-10),T=10,B=r-E/2,S=n+16;e.fillStyle=l.border,e.fillRect(B,S,E,T),e.fillStyle=l.borderLight,e.fillRect(B+1,S+1,E-2,T-2),e.fillStyle=l.border,e.fillRect(B+3,S+T,3,14),e.fillRect(B+E-6,S+T,3,14);const H=26,O=18,V=r-H/2,U=S-O;e.fillStyle=l.bgTertiary,e.fillRect(V,U,H,O);const Y=f==="error"?l.error:f==="active"?l.success:l.accent;if(e.fillStyle=Y+"30",e.fillRect(V+2,U+2,H-4,O-4),f==="active"||F){e.fillStyle=Y+"60";const d=2+Math.floor(i%3);for(let h=0;h<d;h++){const C=6+Math.sin(i*2+h+a)*5;e.fillRect(V+3,U+3+h*4,C,1.5)}}e.fillStyle=l.border,e.fillRect(r-2,S-1,4,3),e.fillStyle="#1e1e22",e.fillRect(r-10,n+10+o,20,8),e.fillRect(r-11,n-2+o,3,20),e.fillStyle=l.border,e.fillRect(r-7,n+o,14,12);const y=f==="active"&&F?Math.sin(i*1.5+a)*1.5:0;e.fillStyle=l.borderLight,e.fillRect(r-6,n-10+o+y,12,10);const G=Math.sin(i*.3+a*2)>.95?1:2;if(e.fillStyle=z,f==="stopped"?(e.fillRect(r-4,n-7+o+y,2,1),e.fillRect(r-3,n-6+o+y,2,1),e.fillRect(r+1,n-7+o+y,2,1),e.fillRect(r+2,n-6+o+y,2,1)):(e.fillRect(r-4,n-7+o+y,2,G),e.fillRect(r+2,n-7+o+y,2,G)),e.fillStyle=l.borderLight,e.fillRect(r-1,n-14+o+y,2,4),e.fillStyle=z,e.beginPath(),e.arc(r,n-15+o+y,2,0,Math.PI*2),e.fill(),f==="active"&&(e.globalAlpha=.3+Math.sin(i*3+a)*.2,e.beginPath(),e.arc(r,n-15+o+y,5,0,Math.PI*2),e.fill(),e.globalAlpha=1),f==="active"&&F){const d=Math.sin(i*6+a)*2,h=Math.sin(i*6+a+Math.PI)*2;e.fillStyle=l.border,e.fillRect(r-11,n+3+o+d,4,3),e.fillRect(r+7,n+3+o+h,4,3)}else e.fillStyle=l.border,e.fillRect(r-10,n+5+o,3,6),e.fillRect(r+7,n+5+o,3,6);if(f==="active"&&F){for(let d=0;d<2;d++){const h=i*1.5+d*Math.PI+a,C=14+Math.sin(i+d)*4,se=r+Math.cos(h)*C,le=n-3+Math.sin(h)*C*.4+o;e.globalAlpha=.25+Math.sin(i*2+d)*.15,e.fillStyle=z,e.beginPath(),e.arc(se,le,1,0,Math.PI*2),e.fill()}e.globalAlpha=1}if(f==="error"){for(let d=0;d<3;d++){const h=r+Math.sin(i*4+d*2)*12,C=n-5+Math.cos(i*3+d)*8+o;e.globalAlpha=.4+Math.sin(i+d)*.3,e.fillStyle=l.error,e.fillRect(h-1,C-1,2,2)}e.globalAlpha=1}e.fillStyle=f==="stopped"?l.border:l.textMuted,e.font="9px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center";const _=Math.max(44,E+14);let N=P.name;if(e.measureText(N).width>_){for(;N.length>1&&e.measureText(N+"…").width>_;)N=N.slice(0,-1);N=N.trimEnd()+"…"}e.fillText(N,r,S+T+24);const te=he[P.role]||"G";e.fillStyle=z+"60",e.font="bold 7px -apple-system, BlinkMacSystemFont, sans-serif",e.fillText(te,r,S+T+33),e.textAlign="start"}if(e.fillStyle=l.bgTertiary,e.font="bold 9px -apple-system, BlinkMacSystemFont, sans-serif",e.textAlign="center",e.fillText("COMMAND POST",c/2,s-6),e.textAlign="start",j.length>0){const a=j[j.length-1];if(Date.now()-new Date(a.timestamp).getTime()<6e4){e.fillStyle=l.accent+"40",e.fillRect(0,0,c,16),e.fillStyle=l.accentLight,e.font="8px -apple-system, BlinkMacSystemFont, sans-serif";const r=a.message.length>60?a.message.slice(0,57)+"...":a.message;e.textAlign="center",e.fillText(r,c/2,11),e.textAlign="start"}}L=requestAnimationFrame(I)};return I(),()=>{cancelAnimationFrame(L),window.removeEventListener("resize",M)}},[]),t.jsx("canvas",{ref:v,className:"w-full rounded-xl border border-border",style:{height:220,imageRendering:"pixelated"}})}function Z(x){const m=Math.floor((Date.now()-new Date(x).getTime())/1e3);return m<60?`${m}s`:m<3600?`${Math.floor(m/60)}m`:m<86400?`${Math.floor(m/3600)}h`:`${Math.floor(m/86400)}d`}function W({icon:x,label:m,value:v,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(x,{size:14,className:p}),t.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:m})]}),t.jsx("div",{className:"text-2xl font-bold text-text",children:v}),R&&t.jsx("div",{className:"text-[11px] text-text-muted mt-1",children:R})]})}function Ae(){var c;const[x,m]=g.useState(null),[v,R]=g.useState([]),[p,b]=g.useState([]),[e,w]=g.useState(0),[L,$]=g.useState(!0),A=g.useCallback(async()=>{try{const[s,u,j,l]=await Promise.all([ae(),re(20),ie(),ne("pending")]);m(s),R(u),b(j),w(l.length)}catch{}$(!1)},[]);if(g.useEffect(()=>{A();const s=setInterval(A,15e3);return()=>clearInterval(s)},[A]),L)return t.jsxs("div",{className:"space-y-6",children:[t.jsx(J,{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(xe,{variant:"metric",count:4})})]});if(!x)return t.jsx("div",{className:"text-center py-12 text-text-muted",children:"Failed to load dashboard"});const M=x.budgetUtilization??0,I=p.filter(s=>s.status==="in_progress").length,i=p.filter(s=>s.status==="blocked").length;return t.jsxs("div",{className:"space-y-6",children:[t.jsx(J,{title:"Dashboard",breadcrumbs:[{label:"Command Post"},{label:"Dashboard"}],actions:t.jsx("button",{onClick:A,className:"p-1.5 text-text-muted hover:text-text rounded-lg hover:bg-bg-tertiary transition-colors",children:t.jsx(me,{size:16})})}),t.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[t.jsx(W,{icon:oe,label:"Agents Enabled",value:x.totalAgents,sub:`${x.activeAgents} running, ${Math.max(0,x.totalAgents-x.activeAgents)} paused`,color:"text-info"}),t.jsx(W,{icon:K,label:"Tasks In Progress",value:I,sub:`${p.length} open, ${i} blocked`,color:"text-warning"}),t.jsx(W,{icon:fe,label:"Budget Used",value:`${Math.round(M)}%`,sub:M>=80?"Nearing limit":"Healthy",color:M>=80?"text-error":"text-success"}),t.jsx(W,{icon:ce,label:"Goals",value:((c=x.goalTree)==null?void 0:c.length)??0,sub:"in hierarchy",color:"text-purple"})]}),x.agents.length>0&&t.jsx(ge,{agents:x.agents,activity:v}),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(q,{size:14,className:"text-accent"}),t.jsx("h3",{className:"text-sm font-semibold text-text",children:"Recent Activity"})]}),t.jsx(X,{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:v.length===0?t.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"No activity yet"}):[...v].reverse().slice(0,15).map((s,u)=>t.jsxs("div",{className:"flex items-start gap-2 px-4 py-2",children:[t.jsx(q,{size:12,className:"text-text-muted mt-0.5 flex-shrink-0"}),t.jsx("span",{className:"text-[11px] text-text-secondary flex-1",children:s.message}),t.jsx("span",{className:"text-[10px] text-text-muted flex-shrink-0",children:Z(s.timestamp)})]},`${s.timestamp}-${u}`))})]}),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(K,{size:14,className:"text-accent"}),t.jsx("h3",{className:"text-sm font-semibold text-text",children:"Recent Issues"})]}),t.jsx(X,{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(s=>t.jsxs(X,{to:`/command-post/issues/${s.id}`,className:"flex items-center gap-2 px-4 py-2 hover:bg-bg-tertiary transition-colors",children:[t.jsx(de,{status:s.status,variant:"dot",size:"sm"}),t.jsx("span",{className:"text-[11px] text-text-secondary flex-1 truncate",children:s.title}),s.assigneeAgentId&&t.jsx("span",{className:"text-[10px] text-text-muted",children:s.assigneeAgentId}),t.jsx("span",{className:"text-[10px] text-text-muted flex-shrink-0",children:Z(s.updatedAt)})]},s.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-BslUQuVl.js";import{F as N}from"./folder-65U1Euur.js";import{F as y}from"./flask-conical-BtbE3rIA.js";import{S as v}from"./search-DxM6zcDJ.js";import{R as p}from"./refresh-cw-BHphkMjv.js";import{F as w}from"./file-text-rkojc4Uq.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 M(){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{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,Q as D,j as e,T as N,V as $,X as M,b as y}from"./index-
|
|
1
|
+
import{r as i,Q as D,j as e,T as N,V as $,X as M,b as y}from"./index-BslUQuVl.js";import{B as j}from"./Input-C6OxbFDH.js";import{S as T}from"./StatusBadge-MIQ4EfQR.js";import{P as O}from"./PageHeader-BQEb_uAl.js";import{E as A}from"./EmptyState-DtSIPEVv.js";import{M as F}from"./Modal-9_l_CYE2.js";import{S as L}from"./SkeletonLoader-CrZUFaIM.js";import{P as B}from"./plus-BtmCDNeU.js";import{C as I}from"./chevron-right-DfToq0aQ.js";import{T as U}from"./trash-2-2Qmp8Fyr.js";import"./clsx-B-dksMZM.js";import"./proxy-BD29vUSb.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 y(`/api/goals/${r.id}`,{method:"DELETE"}),l(),a()}catch{}c(!1)},o=async n=>{m(!0);try{await y(`/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(M,{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($,{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(N,{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 ae(){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 y("/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(O,{title:"Goals",breadcrumbs:[{label:"Command Post"},{label:"Goals"}],actions:e.jsx(j,{size:"sm",icon:e.jsx(B,{size:14}),onClick:()=>u(!0),children:"Create Goal"})}),l&&e.jsx(L,{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(A,{icon:e.jsx(N,{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(N,{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(F,{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{ae as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as A,r as d,J as P,j as e,bi as Y,bL as G,u as Q,z as Z,Y as ee,$ as te,y as se,l as re,K as I,X as E,V as ae,D as B,bM as ne,O as ie,P as oe,bN as le,b as de}from"./index-
|
|
1
|
+
import{c as A,r as d,J as P,j as e,bi as Y,bL as G,u as Q,z as Z,Y as ee,$ as te,y as se,l as re,K as I,X as E,V as ae,D as B,bM as ne,O as ie,P as oe,bN as le,b as de}from"./index-BslUQuVl.js";import{B as m}from"./Input-C6OxbFDH.js";import{P as ce}from"./PageHeader-BQEb_uAl.js";import{E as xe}from"./EmptyState-DtSIPEVv.js";import{T as ue}from"./Tabs-DkooY-W7.js";import{S as pe}from"./SkeletonLoader-CrZUFaIM.js";import{e as he}from"./approvalHeadline-DB9SgR-9.js";import{M as U}from"./message-square-BEGY8pHF.js";import{B as q}from"./bot-Cv-edYov.js";import{C}from"./clock-BvWNugZo.js";import{S as me}from"./send-ChZ5Hsne.js";import{S as ge}from"./shield-check-uMK1alGs.js";import{C as D}from"./check-DbgTEg8O.js";import{F as fe}from"./funnel-D9FpWHn9.js";import{C as be}from"./chevron-up-DMS2Tjip.js";import{R as ve}from"./rotate-ccw-DQzGCkVc.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DfToq0aQ.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{p as D,u as $,r,bI as B,b as S,bJ as M,j as e,D as L,ba as C}from"./index-
|
|
1
|
+
import{p as D,u as $,r,bI as B,b as S,bJ as M,j as e,D as L,ba as C}from"./index-BslUQuVl.js";import{B as c}from"./Input-C6OxbFDH.js";import{S as O}from"./StatusBadge-MIQ4EfQR.js";import{P as h}from"./PageHeader-BQEb_uAl.js";import{S as U}from"./SkeletonLoader-CrZUFaIM.js";import{A as R}from"./arrow-left-BaVVZjqf.js";import{M as _}from"./message-square-BEGY8pHF.js";import{S as F}from"./send-ChZ5Hsne.js";import"./clsx-B-dksMZM.js";import"./chevron-right-DfToq0aQ.js";function b(a){const i=Math.floor((Date.now()-new Date(a).getTime())/1e3);return i<60?`${i}s`:i<3600?`${Math.floor(i/60)}m`:i<86400?`${Math.floor(i/3600)}h`:`${Math.floor(i/86400)}d`}const K={critical:"text-error",high:"text-warning",medium:"text-accent",low:"text-text-muted"},J=["backlog","todo","in_progress","in_review","done","blocked","cancelled"];function te(){const{id:a}=D(),i=$(),[s,o]=r.useState(null),[l,k]=r.useState([]),[I,P]=r.useState(!0),[g,f]=r.useState(null),[A,x]=r.useState(!1),[m,u]=r.useState(""),[n,j]=r.useState(""),[E,y]=r.useState(!1),[v,T]=r.useState(""),p=r.useCallback(async()=>{if(a){try{const t=await B(a);o(t),u(t.title);try{const d=await S(`/api/command-post/issues/${a}/comments`);d.ok&&k(await d.json())}catch{}f(null)}catch(t){f(t instanceof Error?t.message:"Failed to load issue")}P(!1)}},[a]);r.useEffect(()=>{p()},[p]),r.useEffect(()=>{s!=null&&s.id&&M(s.id).then(t=>T(t.ancestry)).catch(()=>{})},[s==null?void 0:s.id]);const z=async t=>{if(!(!a||!s))try{const d=await C(a,{status:t});o(d)}catch{}},N=async()=>{if(!(!a||!s||!m.trim()))try{const t=await C(a,{title:m.trim()});o(t),x(!1)}catch{}},w=async()=>{if(!(!a||!n.trim())){y(!0);try{await S(`/api/command-post/issues/${a}/comments`,{method:"POST",body:JSON.stringify({body:n.trim()})}),j(""),await p()}catch{}y(!1)}};return I?e.jsxs("div",{className:"space-y-6",children:[e.jsx(h,{title:"Issue",breadcrumbs:[{label:"Command Post"},{label:"Issues",href:"/command-post/issues"},{label:"..."}]}),e.jsx(U,{variant:"card",count:1})]}):g||!s?e.jsxs("div",{className:"space-y-6",children:[e.jsx(h,{title:"Issue",breadcrumbs:[{label:"Command Post"},{label:"Issues",href:"/command-post/issues"},{label:"Error"}]}),e.jsxs("div",{className:"text-center py-12",children:[e.jsx("p",{className:"text-error text-sm mb-4",children:g??"Issue not found"}),e.jsx(c,{variant:"secondary",size:"sm",onClick:()=>i("/command-post/issues"),children:"Back to Issues"})]})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsx(h,{title:s.identifier,breadcrumbs:[{label:"Command Post"},{label:"Issues",href:"/command-post/issues"},{label:s.identifier}],actions:e.jsxs(L,{to:"/command-post/issues",className:"flex items-center gap-1 text-xs text-text-muted hover:text-text",children:[e.jsx(R,{size:14})," Back"]})}),v&&e.jsx("div",{className:"bg-bg-tertiary/30 border border-border rounded-lg px-4 py-3 mb-4",children:e.jsx("pre",{className:"text-xs text-text-secondary whitespace-pre-wrap font-mono leading-relaxed",children:v})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl p-4",children:[A?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("input",{className:"flex-1 rounded-lg border border-border bg-bg-tertiary px-3 py-2 text-base font-semibold text-text focus:outline-none focus:border-accent",value:m,onChange:t=>u(t.target.value),onKeyDown:t=>t.key==="Enter"&&N(),autoFocus:!0}),e.jsx(c,{size:"sm",onClick:N,children:"Save"}),e.jsx(c,{size:"sm",variant:"ghost",onClick:()=>{x(!1),u(s.title)},children:"Cancel"})]}):e.jsx("h2",{className:"text-lg font-semibold text-text cursor-pointer hover:text-accent transition-colors",onClick:()=>x(!0),title:"Click to edit",children:s.title}),s.description&&e.jsx("p",{className:"mt-3 text-sm text-text-secondary whitespace-pre-wrap",children:s.description})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:J.map(t=>e.jsx("button",{onClick:()=>z(t),disabled:s.status===t,className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors border ${s.status===t?"border-accent bg-accent/10 text-accent":"border-border bg-bg-tertiary text-text-muted hover:text-text hover:border-border-light"}`,children:t.replace(/_/g," ")},t))}),e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl overflow-hidden",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:[e.jsx(_,{size:14,className:"text-accent"}),e.jsx("h3",{className:"text-sm font-semibold text-text",children:"Comments"}),e.jsxs("span",{className:"text-xs text-text-muted",children:["(",l.length,")"]})]}),l.length===0?e.jsx("div",{className:"py-8 text-center text-xs text-text-muted",children:"No comments yet"}):e.jsx("div",{className:"divide-y divide-border max-h-96 overflow-y-auto",children:l.map(t=>e.jsxs("div",{className:"px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-xs font-medium text-text",children:t.authorAgentId??t.authorUser??"Unknown"}),e.jsxs("span",{className:"text-[10px] text-text-muted",children:[b(t.createdAt)," ago"]})]}),e.jsx("p",{className:"text-sm text-text-secondary whitespace-pre-wrap",children:t.body})]},t.id))}),e.jsxs("div",{className:"border-t border-border px-4 py-3 flex items-center gap-2",children:[e.jsx("input",{className:"flex-1 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:"Add a comment...",value:n,onChange:t=>j(t.target.value),onKeyDown:t=>t.key==="Enter"&&!t.shiftKey&&w()}),e.jsx(c,{size:"sm",onClick:w,loading:E,disabled:!n.trim(),icon:e.jsx(F,{size:14}),children:"Send"})]})]})]}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"bg-bg-secondary border border-border rounded-xl p-4 space-y-3",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:"Status"}),e.jsx("div",{className:"mt-1",children:e.jsx(O,{status:s.status})})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:"Priority"}),e.jsx("div",{className:`mt-1 text-sm font-medium capitalize ${K[s.priority]??"text-text"}`,children:s.priority})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:"Assignee"}),e.jsx("div",{className:"mt-1 text-sm text-text-secondary",children:s.assigneeAgentId??"Unassigned"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:"Identifier"}),e.jsx("div",{className:"mt-1 text-sm text-text font-mono",children:s.identifier})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:"Created"}),e.jsxs("div",{className:"mt-1 text-sm text-text-secondary",children:[b(s.createdAt)," ago"]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[10px] text-text-muted uppercase tracking-wider",children:"Updated"}),e.jsxs("div",{className:"mt-1 text-sm text-text-secondary",children:[b(s.updatedAt)," ago"]})]})]})})]})]})}export{te as default};
|