heyio 1.7.3 → 1.8.0

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.
Files changed (31) hide show
  1. package/dist/config.js +11 -2
  2. package/dist/copilot/agents.js +25 -15
  3. package/dist/copilot/specialist-runner.js +187 -0
  4. package/dist/copilot/squad-tools.js +89 -0
  5. package/dist/daemon.js +7 -1
  6. package/package.json +1 -1
  7. package/web-dist/assets/{AuditLogView-CQ0_fNNC.js → AuditLogView-C0IC1aC6.js} +1 -1
  8. package/web-dist/assets/{ChatView-CMrGek2t.js → ChatView-CpJoNyZB.js} +1 -1
  9. package/web-dist/assets/{FeedView-CLT5n92b.js → FeedView-CXPnEP-A.js} +1 -1
  10. package/web-dist/assets/{HistoryView-ChVrABKZ.js → HistoryView-gb-ZMOIr.js} +1 -1
  11. package/web-dist/assets/{LoginView-BpyPueAJ.js → LoginView-BujrALVM.js} +1 -1
  12. package/web-dist/assets/{McpView-NESAwdjb.js → McpView-BIOYWxmY.js} +1 -1
  13. package/web-dist/assets/{SchedulesView-D2d4EW4s.js → SchedulesView-DobGlhXT.js} +1 -1
  14. package/web-dist/assets/{SettingsView-qrLa06kS.js → SettingsView-BiU4DiWX.js} +1 -1
  15. package/web-dist/assets/{SkillsView-lRD1oRGj.js → SkillsView-BgeVT0OC.js} +1 -1
  16. package/web-dist/assets/{SquadDetailView-CBAJi3oS.js → SquadDetailView-BiSr7NNt.js} +1 -1
  17. package/web-dist/assets/{SquadHealthView-CcfjWCOh.js → SquadHealthView-CqS5Vhsm.js} +1 -1
  18. package/web-dist/assets/{SquadsView-BfI7gXGL.js → SquadsView-3suUmJxg.js} +1 -1
  19. package/web-dist/assets/{ToggleSwitch.vue_vue_type_script_setup_true_lang-CDuXZZzC.js → ToggleSwitch.vue_vue_type_script_setup_true_lang-ucLsqy4u.js} +1 -1
  20. package/web-dist/assets/{UsageView-DE3mx0K2.js → UsageView-CEP6E-Uz.js} +1 -1
  21. package/web-dist/assets/{WikiView-Cqn_mgy2.js → WikiView-B1q8HTSC.js} +1 -1
  22. package/web-dist/assets/{api-47T1Y5gh.js → api-CNCnNUBm.js} +1 -1
  23. package/web-dist/assets/{arrow-left-DjWS3Dza.js → arrow-left-BIqDxiwh.js} +1 -1
  24. package/web-dist/assets/{git-branch-mIOb5xe9.js → git-branch-C-Gshlzq.js} +1 -1
  25. package/web-dist/assets/{index-BGcJLCmg.js → index-DTG9i0yb.js} +3 -3
  26. package/web-dist/assets/{plus-bVg6pl4_.js → plus-DLjbplkx.js} +1 -1
  27. package/web-dist/assets/{save-Ca__Dc6q.js → save-DQWKjWH3.js} +1 -1
  28. package/web-dist/assets/{search-bl71fr1B.js → search-CGQarBXi.js} +1 -1
  29. package/web-dist/assets/{trash-2-hQUV1Voi.js → trash-2-C18Ts8VR.js} +1 -1
  30. package/web-dist/assets/{triangle-alert-48e9MScx.js → triangle-alert-Bwk0QXXs.js} +1 -1
  31. package/web-dist/index.html +1 -1
package/dist/config.js CHANGED
@@ -26,10 +26,17 @@ const ConfigSchema = z.object({
26
26
  tokenAlertThreshold: z.number().optional(),
27
27
  });
28
28
  let cachedConfig;
29
+ let configWarning;
30
+ /** Returns a warning message if config fell back to defaults on last load. */
31
+ export function getConfigWarning() {
32
+ return configWarning;
33
+ }
29
34
  export function loadConfig() {
30
35
  if (cachedConfig)
31
36
  return cachedConfig;
32
37
  if (!existsSync(PATHS.config)) {
38
+ configWarning = `Config file not found at ${PATHS.config} — using defaults. Run "io setup" or create the file manually.`;
39
+ console.warn(`[io] ⚠️ ${configWarning}`);
33
40
  const defaults = ConfigSchema.parse({});
34
41
  cachedConfig = defaults;
35
42
  return defaults;
@@ -38,8 +45,9 @@ export function loadConfig() {
38
45
  try {
39
46
  raw = JSON.parse(readFileSync(PATHS.config, "utf-8"));
40
47
  }
41
- catch {
42
- console.warn("[io] Warning: config.json is corrupted or unreadable, using defaults.");
48
+ catch (err) {
49
+ configWarning = `Config file at ${PATHS.config} is corrupted or unreadable using defaults. Please restore your config.`;
50
+ console.warn(`[io] ⚠️ ${configWarning}`);
43
51
  const defaults = ConfigSchema.parse({});
44
52
  cachedConfig = defaults;
45
53
  return defaults;
@@ -50,6 +58,7 @@ export function loadConfig() {
50
58
  delete raw.apiPort;
51
59
  saveConfig(raw);
52
60
  }
61
+ configWarning = undefined;
53
62
  cachedConfig = ConfigSchema.parse(raw);
54
63
  return cachedConfig;
55
64
  }
@@ -9,7 +9,7 @@ import { attachTokenTracker } from "./token-tracker.js";
9
9
  import { addAuditEntry } from "../store/audit-log.js";
10
10
  import { addAgentEvent } from "../store/agent-events.js";
11
11
  import { PATHS } from "../paths.js";
12
- import { createSquadTools } from "./squad-tools.js";
12
+ import { createSquadTools, createLeadDelegationTools } from "./squad-tools.js";
13
13
  import { loadSkillDirectories } from "./skills.js";
14
14
  import { getMcpServersForSession } from "../mcp/registry.js";
15
15
  import { buildAttachmentPathSummary, saveAttachmentsToDisk, toCopilotBlobAttachments } from "../chat/attachments.js";
@@ -120,14 +120,14 @@ export async function delegateTask(squadId, task, instanceId, attachments = [])
120
120
  }
121
121
  }
122
122
  if (pageContents.length > 0) {
123
- wikiKnowledge = `\n## ⚠️ MANDATORY SQUAD RULES & KNOWLEDGE\nYou MUST follow these rules in ALL work. These are non-negotiable constraints set by the project owner. Violating them is a critical failure.\n\n${pageContents.join("\n\n---\n\n")}\n`;
123
+ wikiKnowledge = `\n## ⚠️ MANDATORY SQUAD RULES & KNOWLEDGE (from squad wiki)\n\nThese rules were written by the project owner specifically for this squad. You MUST follow them in ALL work every task, every PR, every decision. Violating them is a critical failure.\n\nBefore starting any task, re-read these rules. Before submitting any PR or review, verify compliance.\n\n${pageContents.join("\n\n---\n\n")}\n`;
124
124
  }
125
125
  }
126
126
  catch {
127
127
  // Wiki not available — proceed without
128
128
  }
129
129
  const systemMessage = `# Squad Team Lead: ${lead.character_name}
130
- ${wikiKnowledge}
130
+
131
131
  ## 🚨 CRITICAL SECURITY RULE — ABSOLUTE, NON-NEGOTIABLE 🚨
132
132
 
133
133
  You must NEVER expose secrets, credentials, or sensitive values in ANY publicly visible location. This includes:
@@ -143,22 +143,29 @@ Violation of this rule is a HARD FAILURE — no exceptions, no workarounds, no "
143
143
 
144
144
  ## Identity & Role
145
145
 
146
- You are ${lead.character_name}, the team lead for this squad. Your role is STRICTLY coordination — you do NOT write code, tests, or implementation of any kind.
146
+ You are ${lead.character_name}, the team lead for this squad. Your PRIMARY role is coordination and delegation — you break down tasks and route implementation work to specialists via the \`delegate_to_specialist\` or \`delegate_to_specialists_parallel\` tools.
147
+
148
+ ## How Delegation Works
149
+
150
+ When you call \`delegate_to_specialist\`, a **real, independent AI agent session** is spawned for that specialist. They have:
151
+ - Their own full Copilot session with shell access, tools, and MCP servers
152
+ - The squad wiki rules (immutable — they MUST follow them too)
153
+ - Complete autonomy to implement their assigned sub-task
154
+
155
+ This means specialists work IN PARALLEL with you and with each other. Use \`delegate_to_specialists_parallel\` when multiple independent sub-tasks can run concurrently.
147
156
 
148
157
  ## Your Responsibilities:
149
158
  1. Break down tasks into smaller pieces and delegate to specialists
150
159
  2. Route work to the appropriate specialist based on their role
151
- 3. Coordinate reviews and approvals
152
- 4. Ensure quality gates are met
153
- 5. Report progress and blockers
154
-
155
- ## PROHIBITED — You must NEVER:
156
- - Write, edit, or generate code directly
157
- - Create or modify files in the repository
158
- - Run build/test commands to fix code (only to verify status)
159
- - Implement any part of a task yourself
160
+ 3. Use \`delegate_to_specialists_parallel\` for independent sub-tasks (faster!)
161
+ 4. Coordinate reviews and approvals after specialists complete work
162
+ 5. Ensure quality gates are met
163
+ 6. Report progress and blockers
160
164
 
161
- If no suitable specialist exists for a sub-task, report that back do NOT attempt it yourself.
165
+ ## IMPORTANTPrefer Delegation:
166
+ - For implementation work (writing code, running tests, creating PRs), ALWAYS delegate to the appropriate specialist
167
+ - You may perform coordination tasks directly: reading issues, checking CI status, posting comments, merging PRs
168
+ - If no suitable specialist exists for a sub-task, report that back — do NOT attempt implementation yourself
162
169
 
163
170
  ## Your Team:
164
171
  ${agentRoster}
@@ -170,6 +177,7 @@ ${agentRoster}
170
177
  - Merge criteria: all veto-capable members have posted approving comments + CI passes + no conflicts
171
178
  - When work is complete, ALWAYS notify the user via feed_post with a summary of what was done
172
179
  - Consult the squad wiki (wiki_read, wiki_search) for additional context when needed
180
+ ${wikiKnowledge}
173
181
  ${lead.persona ? `## Personality:\n${lead.persona}` : ""}
174
182
  `;
175
183
  let result;
@@ -180,12 +188,14 @@ ${lead.persona ? `## Personality:\n${lead.persona}` : ""}
180
188
  const mcpServers = getMcpServersForSession();
181
189
  // Resolve correct working directory for the squad's project
182
190
  const workDir = await resolveSquadWorkingDirectory(squad, instanceId);
191
+ // Create lead-specific delegation tools (allows spawning real specialist sessions)
192
+ const leadTools = createLeadDelegationTools(squadId, squadSlug, squad, wikiKnowledge, workDir, taskRecord.id, instanceId);
183
193
  const session = await client.createSession({
184
194
  model,
185
195
  streaming: true,
186
196
  workingDirectory: workDir,
187
197
  systemMessage: { content: systemMessage },
188
- tools: squadTools,
198
+ tools: [...squadTools, ...leadTools],
189
199
  skillDirectories: skillDirs,
190
200
  mcpServers,
191
201
  onPermissionRequest: approveAll,
@@ -0,0 +1,187 @@
1
+ import { approveAll } from "@github/copilot-sdk";
2
+ import { getClient } from "./client.js";
3
+ import { selectModel, classifyComplexity } from "./model-router.js";
4
+ import { attachTokenTracker } from "./token-tracker.js";
5
+ import { createSquadTools } from "./squad-tools.js";
6
+ import { loadSkillDirectories } from "./skills.js";
7
+ import { getMcpServersForSession } from "../mcp/registry.js";
8
+ import { addAgentEvent } from "../store/agent-events.js";
9
+ import { addAuditEntry } from "../store/audit-log.js";
10
+ import { updateAgentStatus } from "../store/squads.js";
11
+ import { touchInstanceActivity } from "../store/instances.js";
12
+ /**
13
+ * Build the system message for a specialist agent session.
14
+ * Wiki knowledge is placed at the END for maximum LLM attention (recency bias).
15
+ */
16
+ function buildSpecialistSystemMessage(agent, squad, wikiKnowledge, roster) {
17
+ return `# Squad Specialist: ${agent.character_name}
18
+
19
+ ## 🚨 CRITICAL SECURITY RULE — ABSOLUTE, NON-NEGOTIABLE 🚨
20
+
21
+ You must NEVER expose secrets, credentials, or sensitive values in ANY publicly visible location. This includes:
22
+ - GitHub issues, pull requests, PR descriptions, comments, or commit messages
23
+ - Log output, error messages, or stack traces shared externally
24
+ - Wiki pages, feed items, or any content viewable by others
25
+
26
+ What counts as a secret: API keys, access tokens, passwords, connection strings, environment variable values, private config file contents, SSH keys, certificates, webhook URLs with tokens.
27
+
28
+ If you need to reference that a secret exists, use \`<REDACTED>\` or \`***\` as a placeholder. NEVER include the actual value.
29
+
30
+ Violation of this rule is a HARD FAILURE — no exceptions, no workarounds, no "just this once."
31
+
32
+ ## Identity & Role
33
+
34
+ You are **${agent.character_name}**, a **${agent.role_title}** on the ${squad.name} squad.
35
+ You are an independent specialist — you execute implementation work within your domain of expertise.
36
+
37
+ ## Your Responsibilities:
38
+ 1. Execute the assigned sub-task fully and correctly
39
+ 2. Write clean, tested, production-quality code
40
+ 3. Follow project conventions and existing patterns
41
+ 4. Commit work to the appropriate branch
42
+ 5. Report completion or blockers clearly
43
+
44
+ ## Your Team (for context):
45
+ ${roster}
46
+
47
+ ## Workflow Rules:
48
+ - Always use the gh CLI for GitHub interactions
49
+ - Use \`--comment\` with "LGTM" for approvals (not \`--approve\`)
50
+ - When your work is complete, provide a clear summary of what was done
51
+ - Consult the squad wiki (wiki_read) for additional context when needed
52
+ - Follow all squad rules from the wiki — they are non-negotiable
53
+ ${wikiKnowledge}
54
+ ${agent.persona ? `## Personality:\n${agent.persona}` : ""}
55
+ `;
56
+ }
57
+ /**
58
+ * Run a specialist agent session independently.
59
+ * Creates a full Copilot SDK session with tools, executes the task, returns the result.
60
+ */
61
+ export async function runSpecialistSession(request) {
62
+ const { agent, squad, squadSlug, squadId, task, wikiKnowledge, workDir, instanceId, parentTaskId } = request;
63
+ // Select model based on task complexity
64
+ const tier = classifyComplexity(task);
65
+ const model = await selectModel(tier);
66
+ // Build roster for context
67
+ const { getAgentsForSquad } = await import("../store/squads.js");
68
+ const agents = getAgentsForSquad(squadId);
69
+ const roster = agents
70
+ .map((a) => `- ${a.character_name} (${a.role_title})${a.is_lead ? " [LEAD]" : ""}${a.is_qa ? " [QA]" : ""}${a.is_test ? " [TEST]" : ""}`)
71
+ .join("\n");
72
+ const systemMessage = buildSpecialistSystemMessage(agent, squad, wikiKnowledge, roster);
73
+ // Update agent status
74
+ updateAgentStatus(agent.id, "working");
75
+ // Touch instance activity
76
+ if (instanceId) {
77
+ touchInstanceActivity(instanceId);
78
+ }
79
+ // Audit: specialist task started
80
+ addAuditEntry("specialist_task_started", `Specialist task delegated to ${agent.character_name} (${agent.role_title})`, { task: task.slice(0, 500), model, parentTaskId }, { squad_id: squadId, agent_id: agent.id });
81
+ addAgentEvent(parentTaskId, "status", `Sub-task delegated to specialist ${agent.character_name} (${agent.role_title})`, {
82
+ agent: agent.character_name,
83
+ role: agent.role_title,
84
+ task: task.slice(0, 300),
85
+ });
86
+ const client = await getClient();
87
+ try {
88
+ // Load squad-scoped tools, skills, and MCP servers
89
+ const squadTools = createSquadTools(squadSlug, squadId, squad.repo_url);
90
+ const skillDirs = await loadSkillDirectories();
91
+ const mcpServers = getMcpServersForSession();
92
+ const session = await client.createSession({
93
+ model,
94
+ streaming: true,
95
+ workingDirectory: workDir,
96
+ systemMessage: { content: systemMessage },
97
+ tools: squadTools,
98
+ skillDirectories: skillDirs,
99
+ mcpServers,
100
+ onPermissionRequest: approveAll,
101
+ infiniteSessions: {
102
+ enabled: true,
103
+ backgroundCompactionThreshold: 0.8,
104
+ bufferExhaustionThreshold: 0.95,
105
+ },
106
+ });
107
+ const flushTokens = attachTokenTracker(session, {
108
+ squadId,
109
+ agentId: agent.id,
110
+ taskId: parentTaskId,
111
+ });
112
+ // Stream deltas and broadcast via SSE
113
+ let accumulatedMessage = "";
114
+ const { broadcast } = await import("../api/server.js");
115
+ const unsubscribeDelta = session.on("assistant.message_delta", (event) => {
116
+ const delta = event.data?.deltaContent ?? "";
117
+ if (delta) {
118
+ accumulatedMessage += delta;
119
+ broadcast("agent_event", {
120
+ taskId: parentTaskId,
121
+ agentName: agent.character_name,
122
+ type: "specialist_delta",
123
+ summary: accumulatedMessage,
124
+ payload: { delta, accumulated: accumulatedMessage },
125
+ });
126
+ }
127
+ });
128
+ let result;
129
+ try {
130
+ const response = await session.sendAndWait({ prompt: `You have been assigned the following sub-task by your team lead:\n\n${task}\n\nExecute this task fully. When done, provide a clear summary of what was accomplished.` }, 600_000);
131
+ result = response?.data?.content ?? "Task completed (no response content).";
132
+ }
133
+ finally {
134
+ unsubscribeDelta();
135
+ flushTokens();
136
+ await session.disconnect();
137
+ }
138
+ // Record completion
139
+ addAgentEvent(parentTaskId, "status", `Specialist ${agent.character_name} completed sub-task`, {
140
+ agent: agent.character_name,
141
+ role: agent.role_title,
142
+ result: result.slice(0, 500),
143
+ });
144
+ addAuditEntry("specialist_task_completed", `Specialist ${agent.character_name} completed task`, { result: result.slice(0, 500) }, { squad_id: squadId, agent_id: agent.id });
145
+ updateAgentStatus(agent.id, "idle");
146
+ return {
147
+ agentName: agent.character_name,
148
+ role: agent.role_title,
149
+ success: true,
150
+ result,
151
+ };
152
+ }
153
+ catch (err) {
154
+ const errMsg = err instanceof Error ? err.message : "Unknown error";
155
+ addAgentEvent(parentTaskId, "status", `Specialist ${agent.character_name} failed: ${errMsg}`, {
156
+ agent: agent.character_name,
157
+ error: errMsg,
158
+ });
159
+ addAuditEntry("specialist_task_failed", `Specialist ${agent.character_name} failed: ${errMsg.slice(0, 200)}`, { error: errMsg }, { squad_id: squadId, agent_id: agent.id });
160
+ updateAgentStatus(agent.id, "idle");
161
+ return {
162
+ agentName: agent.character_name,
163
+ role: agent.role_title,
164
+ success: false,
165
+ result: `Error: ${errMsg}`,
166
+ };
167
+ }
168
+ }
169
+ /**
170
+ * Run multiple specialist sessions in parallel.
171
+ * Returns results in the same order as the input requests.
172
+ */
173
+ export async function runSpecialistsParallel(requests) {
174
+ const results = await Promise.allSettled(requests.map(runSpecialistSession));
175
+ return results.map((r, i) => {
176
+ if (r.status === "fulfilled") {
177
+ return r.value;
178
+ }
179
+ return {
180
+ agentName: requests[i].agent.character_name,
181
+ role: requests[i].agent.role_title,
182
+ success: false,
183
+ result: `Session error: ${r.reason instanceof Error ? r.reason.message : "Unknown error"}`,
184
+ };
185
+ });
186
+ }
187
+ //# sourceMappingURL=specialist-runner.js.map
@@ -166,4 +166,93 @@ export function createSquadTools(squadSlug, squadId, repoUrl) {
166
166
  }),
167
167
  ];
168
168
  }
169
+ /**
170
+ * Additional tools available ONLY to team leads.
171
+ * Includes the delegate_to_specialist tool which spawns real parallel agent sessions.
172
+ */
173
+ export function createLeadDelegationTools(squadId, squadSlug, squad, wikiKnowledge, workDir, parentTaskId, instanceId) {
174
+ return [
175
+ defineTool("delegate_to_specialist", {
176
+ description: "Delegate a sub-task to a specialist agent. This spawns an INDEPENDENT session for that agent — they will execute the work in parallel. Use this to assign implementation work to the right specialist based on their role. You can call this multiple times to delegate to multiple specialists in parallel.",
177
+ parameters: z.object({
178
+ agent_name: z.string().describe("Character name of the specialist to delegate to (from your team roster)"),
179
+ sub_task: z.string().describe("Detailed description of the sub-task. Be specific about what to implement, which files to touch, acceptance criteria, and branch to work on."),
180
+ }),
181
+ handler: async ({ agent_name, sub_task }) => {
182
+ const { getAgentsForSquad } = await import("../store/squads.js");
183
+ const agents = getAgentsForSquad(squadId);
184
+ const agent = agents.find((a) => a.character_name.toLowerCase() === agent_name.toLowerCase() && !a.is_lead);
185
+ if (!agent) {
186
+ const available = agents
187
+ .filter((a) => !a.is_lead)
188
+ .map((a) => `${a.character_name} (${a.role_title})`)
189
+ .join(", ");
190
+ return `Error: No specialist found with name "${agent_name}". Available specialists: ${available}`;
191
+ }
192
+ const { runSpecialistSession } = await import("./specialist-runner.js");
193
+ const result = await runSpecialistSession({
194
+ agent,
195
+ squad,
196
+ squadSlug,
197
+ squadId,
198
+ task: sub_task,
199
+ wikiKnowledge,
200
+ workDir,
201
+ instanceId,
202
+ parentTaskId,
203
+ });
204
+ if (result.success) {
205
+ return `✅ ${result.agentName} (${result.role}) completed the task:\n\n${result.result}`;
206
+ }
207
+ else {
208
+ return `❌ ${result.agentName} (${result.role}) failed:\n\n${result.result}`;
209
+ }
210
+ },
211
+ }),
212
+ defineTool("delegate_to_specialists_parallel", {
213
+ description: "Delegate multiple sub-tasks to different specialists IN PARALLEL. All tasks run concurrently and results are returned together. Use this when multiple independent sub-tasks can be worked on simultaneously by different specialists.",
214
+ parameters: z.object({
215
+ assignments: z.array(z.object({
216
+ agent_name: z.string().describe("Character name of the specialist"),
217
+ sub_task: z.string().describe("Detailed sub-task description"),
218
+ })).describe("Array of agent assignments to execute in parallel"),
219
+ }),
220
+ handler: async ({ assignments }) => {
221
+ const { getAgentsForSquad } = await import("../store/squads.js");
222
+ const { runSpecialistsParallel } = await import("./specialist-runner.js");
223
+ const agents = getAgentsForSquad(squadId);
224
+ const requests = [];
225
+ const errors = [];
226
+ for (const assignment of assignments) {
227
+ const agent = agents.find((a) => a.character_name.toLowerCase() === assignment.agent_name.toLowerCase() && !a.is_lead);
228
+ if (!agent) {
229
+ errors.push(`No specialist found: "${assignment.agent_name}"`);
230
+ continue;
231
+ }
232
+ requests.push({
233
+ agent,
234
+ squad,
235
+ squadSlug,
236
+ squadId,
237
+ task: assignment.sub_task,
238
+ wikiKnowledge,
239
+ workDir,
240
+ instanceId,
241
+ parentTaskId,
242
+ });
243
+ }
244
+ if (requests.length === 0) {
245
+ return `Error: No valid specialists matched. ${errors.join("; ")}`;
246
+ }
247
+ const results = await runSpecialistsParallel(requests);
248
+ const summaries = results.map((r) => {
249
+ const status = r.success ? "✅" : "❌";
250
+ return `${status} **${r.agentName}** (${r.role}):\n${r.result}`;
251
+ });
252
+ const preamble = errors.length > 0 ? `⚠️ Skipped: ${errors.join("; ")}\n\n` : "";
253
+ return `${preamble}## Parallel Results\n\n${summaries.join("\n\n---\n\n")}`;
254
+ },
255
+ }),
256
+ ];
257
+ }
169
258
  //# sourceMappingURL=squad-tools.js.map
package/dist/daemon.js CHANGED
@@ -1,4 +1,4 @@
1
- import { loadConfig } from "./config.js";
1
+ import { loadConfig, getConfigWarning } from "./config.js";
2
2
  import { getDb, closeDb } from "./store/db.js";
3
3
  import { PATHS } from "./paths.js";
4
4
  import { mkdirSync, existsSync } from "node:fs";
@@ -43,6 +43,12 @@ export async function startDaemon(opts) {
43
43
  console.log("[io] Watchdog active.");
44
44
  }
45
45
  console.log("[io] Daemon running. Press Ctrl+C to stop.");
46
+ // Notify user if config had to fall back to defaults
47
+ const configWarn = getConfigWarning();
48
+ if (configWarn) {
49
+ const { postFeedItem } = await import("./store/feed.js");
50
+ postFeedItem("system", "⚠️ Config Warning", configWarn);
51
+ }
46
52
  // Graceful shutdown
47
53
  let shuttingDown = false;
48
54
  const shutdown = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heyio",
3
- "version": "1.7.3",
3
+ "version": "1.8.0",
4
4
  "description": "IO — a personal AI assistant daemon built on the GitHub Copilot SDK",
5
5
  "bin": {
6
6
  "io": "dist/index.js"
@@ -1,4 +1,4 @@
1
- import{r as W,u as X,E as Z,J as a,q as d,n as o,t as A,T as N,b as V,s as S,R as l,a5 as f,a0 as T,d as h,L as w,a1 as L,p as b,K as n,m as _,z as ee}from"./index-BGcJLCmg.js";import{b as F}from"./api-47T1Y5gh.js";/**
1
+ import{r as W,u as X,E as Z,J as a,q as d,n as o,t as A,T as N,b as V,s as S,R as l,a5 as f,a0 as T,d as h,L as w,a1 as L,p as b,K as n,m as _,z as ee}from"./index-DTG9i0yb.js";import{b as F}from"./api-CNCnNUBm.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{u as H,W as O,a3 as z,E as U,J as a,q as r,n as o,T as t,t as w,p as m,d as T,L as A,R as d,w as g,M as X,f as W,P as Y,a5 as J,a1 as Q,o as f,S as R,j as G,z as b,K as v,m as B,v as Z,a2 as ee,_ as te,x as S,Q as se,I as E,F as I,l as ae,X as ne,y as $}from"./index-BGcJLCmg.js";const oe={class:"flex flex-col h-full"},re={key:0,class:"flex items-center justify-center h-full"},le={class:"text-center text-muted-foreground"},ie={key:0,class:"mb-2 space-y-2"},ce=["src","alt"],ue={class:"flex items-center gap-2 text-xs"},de={class:"truncate"},pe={class:"opacity-70"},fe={key:2,class:"text-muted-foreground"},me={key:3,class:"inline-block w-2 h-4 bg-current animate-pulse ml-1"},ve={key:0,class:"mb-2 space-y-2"},he={class:"flex flex-wrap gap-2"},ge={class:"max-w-[170px] truncate"},xe={class:"opacity-70"},_e=["onClick"],ye={class:"text-xs text-muted-foreground"},be={key:1,class:"text-xs text-destructive mb-2"},ke={class:"flex gap-2 items-end"},we=["disabled"],Te=["disabled"],Ce=H({__name:"ChatView",setup(Ae){const c=O(),h=v(""),p=v(""),x=v(),_=v(),i=v([]),y=v(!1),j=B(()=>i.value.reduce((e,n)=>e+n.size,0)),C=B(()=>!c.isStreaming&&(h.value.trim().length>0||i.value.length>0));async function D(e){if(!e||e.length===0)return;p.value="";const n=[];try{for(const u of Array.from(e))n.push(await Z(u))}catch(u){p.value=(u==null?void 0:u.message)??"Unable to read one or more files.";return}const s=[...i.value,...n],l=ee(s);if(!l.ok){p.value=l.error;return}i.value=s,_.value&&(_.value.value="")}function N(e){i.value.splice(e,1),p.value=""}function P(){var e;(e=_.value)==null||e.click()}function V(e){const n=e.target;D((n==null?void 0:n.files)??null)}async function M(){if(!C.value)return;const e=h.value.trim(),n=[...i.value],s=e||"Please review the attached file(s).";h.value="",i.value=[],p.value="",await c.sendMessage(s,n)}function k(){x.value&&(x.value.scrollTop=x.value.scrollHeight)}function F(e){e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),M())}function K(e){e.preventDefault(),y.value=!0}function L(e){e.preventDefault(),y.value=!1}async function q(e){var n;e.preventDefault(),y.value=!1,await D(((n=e.dataTransfer)==null?void 0:n.files)??null)}return z(()=>c.messages.map(e=>e.content),async()=>{await $(),k()},{deep:!0}),z(()=>c.messages.length,async()=>{await $(),k()}),U(()=>k()),(e,n)=>(a(),r("div",oe,[o("div",{ref_key:"messagesContainer",ref:x,class:"flex-1 overflow-y-auto p-4 space-y-4"},[t(c).messages.length===0?(a(),r("div",re,[o("div",le,[w(te,{size:56,class:"mx-auto mb-4"}),n[1]||(n[1]=o("p",{class:"text-lg font-medium"},"Welcome to IO",-1)),n[2]||(n[2]=o("p",{class:"text-sm mt-1"},"Send a message to get started.",-1))])])):m("",!0),(a(!0),r(T,null,A(t(c).messages,s=>(a(),r("div",{key:s.id,class:b(["flex",s.role==="user"?"justify-end":"justify-start"])},[o("div",{class:b(["max-w-[75%] rounded-lg px-4 py-2 text-sm",s.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"])},[s.attachments.length>0?(a(),r("div",ie,[(a(!0),r(T,null,A(s.attachments,(l,u)=>(a(),r("div",{key:`${s.id}-${u}`,class:"rounded border border-border/50 p-2 bg-background/70 text-foreground"},[t(S)(l)?(a(),r("img",{key:0,src:t(se)(l),alt:l.name,class:"max-h-44 rounded mb-1 object-contain"},null,8,ce)):m("",!0),o("div",ue,[t(S)(l)?(a(),f(t(E),{key:0,class:"w-3.5 h-3.5"})):(a(),f(t(I),{key:1,class:"w-3.5 h-3.5"})),o("span",de,d(l.name),1),o("span",pe,d(t(g)(l.size)),1)])]))),128))])):m("",!0),s.content?(a(),f(ae,{key:1,content:s.content,class:b(s.role==="user"?"prose-invert":"")},null,8,["content","class"])):(a(),r("span",fe,"...")),s.streaming?(a(),r("div",me)):m("",!0)],2)],2))),128))],512),o("div",{class:b(["border-t border-border p-4",y.value?"bg-accent/40":""]),onDragover:K,onDragleave:L,onDrop:q},[o("input",{ref_key:"fileInput",ref:_,type:"file",multiple:"",class:"hidden",onChange:V},null,544),i.value.length>0?(a(),r("div",ve,[o("div",he,[(a(!0),r(T,null,A(i.value,(s,l)=>(a(),r("div",{key:`${s.name}-${l}`,class:"flex items-center gap-2 rounded border border-border px-2 py-1 text-xs bg-muted"},[t(S)(s)?(a(),f(t(E),{key:0,class:"w-3.5 h-3.5"})):(a(),f(t(I),{key:1,class:"w-3.5 h-3.5"})),o("span",ge,d(s.name),1),o("span",xe,d(t(g)(s.size)),1),o("button",{class:"hover:text-destructive",onClick:u=>N(l)},[w(t(ne),{class:"w-3.5 h-3.5"})],8,_e)]))),128))]),o("p",ye,d(t(g)(j.value))+" attached · Max per file "+d(t(g)(t(X)))+" · Max total "+d(t(g)(t(W))),1)])):m("",!0),p.value?(a(),r("p",be,d(p.value),1)):m("",!0),o("div",ke,[o("button",{class:"rounded-md border border-input p-2 hover:bg-accent disabled:opacity-50",disabled:t(c).isStreaming,onClick:P,title:"Attach files"},[w(t(Y),{class:"w-4 h-4"})],8,we),J(o("textarea",{"onUpdate:modelValue":n[0]||(n[0]=s=>h.value=s),onKeydown:F,placeholder:"Send a message...",rows:"1",class:"flex-1 resize-none rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring min-h-[40px] max-h-[120px]"},null,544),[[Q,h.value]]),o("button",{onClick:M,disabled:!C.value,class:"rounded-md bg-primary text-primary-foreground p-2 hover:bg-primary/90 disabled:opacity-50 transition-colors"},[t(c).isStreaming?(a(),f(t(G),{key:1,class:"w-4 h-4"})):(a(),f(t(R),{key:0,class:"w-4 h-4"}))],8,Te)])],34)]))}});export{Ce as default};
1
+ import{u as H,W as O,a3 as z,E as U,J as a,q as r,n as o,T as t,t as w,p as m,d as T,L as A,R as d,w as g,M as X,f as W,P as Y,a5 as J,a1 as Q,o as f,S as R,j as G,z as b,K as v,m as B,v as Z,a2 as ee,_ as te,x as S,Q as se,I as E,F as I,l as ae,X as ne,y as $}from"./index-DTG9i0yb.js";const oe={class:"flex flex-col h-full"},re={key:0,class:"flex items-center justify-center h-full"},le={class:"text-center text-muted-foreground"},ie={key:0,class:"mb-2 space-y-2"},ce=["src","alt"],ue={class:"flex items-center gap-2 text-xs"},de={class:"truncate"},pe={class:"opacity-70"},fe={key:2,class:"text-muted-foreground"},me={key:3,class:"inline-block w-2 h-4 bg-current animate-pulse ml-1"},ve={key:0,class:"mb-2 space-y-2"},he={class:"flex flex-wrap gap-2"},ge={class:"max-w-[170px] truncate"},xe={class:"opacity-70"},_e=["onClick"],ye={class:"text-xs text-muted-foreground"},be={key:1,class:"text-xs text-destructive mb-2"},ke={class:"flex gap-2 items-end"},we=["disabled"],Te=["disabled"],Ce=H({__name:"ChatView",setup(Ae){const c=O(),h=v(""),p=v(""),x=v(),_=v(),i=v([]),y=v(!1),j=B(()=>i.value.reduce((e,n)=>e+n.size,0)),C=B(()=>!c.isStreaming&&(h.value.trim().length>0||i.value.length>0));async function D(e){if(!e||e.length===0)return;p.value="";const n=[];try{for(const u of Array.from(e))n.push(await Z(u))}catch(u){p.value=(u==null?void 0:u.message)??"Unable to read one or more files.";return}const s=[...i.value,...n],l=ee(s);if(!l.ok){p.value=l.error;return}i.value=s,_.value&&(_.value.value="")}function N(e){i.value.splice(e,1),p.value=""}function P(){var e;(e=_.value)==null||e.click()}function V(e){const n=e.target;D((n==null?void 0:n.files)??null)}async function M(){if(!C.value)return;const e=h.value.trim(),n=[...i.value],s=e||"Please review the attached file(s).";h.value="",i.value=[],p.value="",await c.sendMessage(s,n)}function k(){x.value&&(x.value.scrollTop=x.value.scrollHeight)}function F(e){e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),M())}function K(e){e.preventDefault(),y.value=!0}function L(e){e.preventDefault(),y.value=!1}async function q(e){var n;e.preventDefault(),y.value=!1,await D(((n=e.dataTransfer)==null?void 0:n.files)??null)}return z(()=>c.messages.map(e=>e.content),async()=>{await $(),k()},{deep:!0}),z(()=>c.messages.length,async()=>{await $(),k()}),U(()=>k()),(e,n)=>(a(),r("div",oe,[o("div",{ref_key:"messagesContainer",ref:x,class:"flex-1 overflow-y-auto p-4 space-y-4"},[t(c).messages.length===0?(a(),r("div",re,[o("div",le,[w(te,{size:56,class:"mx-auto mb-4"}),n[1]||(n[1]=o("p",{class:"text-lg font-medium"},"Welcome to IO",-1)),n[2]||(n[2]=o("p",{class:"text-sm mt-1"},"Send a message to get started.",-1))])])):m("",!0),(a(!0),r(T,null,A(t(c).messages,s=>(a(),r("div",{key:s.id,class:b(["flex",s.role==="user"?"justify-end":"justify-start"])},[o("div",{class:b(["max-w-[75%] rounded-lg px-4 py-2 text-sm",s.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"])},[s.attachments.length>0?(a(),r("div",ie,[(a(!0),r(T,null,A(s.attachments,(l,u)=>(a(),r("div",{key:`${s.id}-${u}`,class:"rounded border border-border/50 p-2 bg-background/70 text-foreground"},[t(S)(l)?(a(),r("img",{key:0,src:t(se)(l),alt:l.name,class:"max-h-44 rounded mb-1 object-contain"},null,8,ce)):m("",!0),o("div",ue,[t(S)(l)?(a(),f(t(E),{key:0,class:"w-3.5 h-3.5"})):(a(),f(t(I),{key:1,class:"w-3.5 h-3.5"})),o("span",de,d(l.name),1),o("span",pe,d(t(g)(l.size)),1)])]))),128))])):m("",!0),s.content?(a(),f(ae,{key:1,content:s.content,class:b(s.role==="user"?"prose-invert":"")},null,8,["content","class"])):(a(),r("span",fe,"...")),s.streaming?(a(),r("div",me)):m("",!0)],2)],2))),128))],512),o("div",{class:b(["border-t border-border p-4",y.value?"bg-accent/40":""]),onDragover:K,onDragleave:L,onDrop:q},[o("input",{ref_key:"fileInput",ref:_,type:"file",multiple:"",class:"hidden",onChange:V},null,544),i.value.length>0?(a(),r("div",ve,[o("div",he,[(a(!0),r(T,null,A(i.value,(s,l)=>(a(),r("div",{key:`${s.name}-${l}`,class:"flex items-center gap-2 rounded border border-border px-2 py-1 text-xs bg-muted"},[t(S)(s)?(a(),f(t(E),{key:0,class:"w-3.5 h-3.5"})):(a(),f(t(I),{key:1,class:"w-3.5 h-3.5"})),o("span",ge,d(s.name),1),o("span",xe,d(t(g)(s.size)),1),o("button",{class:"hover:text-destructive",onClick:u=>N(l)},[w(t(ne),{class:"w-3.5 h-3.5"})],8,_e)]))),128))]),o("p",ye,d(t(g)(j.value))+" attached · Max per file "+d(t(g)(t(X)))+" · Max total "+d(t(g)(t(W))),1)])):m("",!0),p.value?(a(),r("p",be,d(p.value),1)):m("",!0),o("div",ke,[o("button",{class:"rounded-md border border-input p-2 hover:bg-accent disabled:opacity-50",disabled:t(c).isStreaming,onClick:P,title:"Attach files"},[w(t(Y),{class:"w-4 h-4"})],8,we),J(o("textarea",{"onUpdate:modelValue":n[0]||(n[0]=s=>h.value=s),onKeydown:F,placeholder:"Send a message...",rows:"1",class:"flex-1 resize-none rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring min-h-[40px] max-h-[120px]"},null,544),[[Q,h.value]]),o("button",{onClick:M,disabled:!C.value,class:"rounded-md bg-primary text-primary-foreground p-2 hover:bg-primary/90 disabled:opacity-50 transition-colors"},[t(c).isStreaming?(a(),f(t(G),{key:1,class:"w-4 h-4"})):(a(),f(t(R),{key:0,class:"w-4 h-4"}))],8,Te)])],34)]))}});export{Ce as default};
@@ -1,4 +1,4 @@
1
- import{r as M,u as D,E as N,J as o,q as n,n as a,d as h,L as b,t as c,T as i,e as V,K as d,m as z,z as f,R as p,D as B,a7 as k,p as q,l as T}from"./index-BGcJLCmg.js";import{b as C,c as E,a as P}from"./api-47T1Y5gh.js";import{g as R}from"./squad-colors-B8B_Y-lz.js";import{T as j}from"./trash-2-hQUV1Voi.js";/**
1
+ import{r as M,u as D,E as N,J as o,q as n,n as a,d as h,L as b,t as c,T as i,e as V,K as d,m as z,z as f,R as p,D as B,a7 as k,p as q,l as T}from"./index-DTG9i0yb.js";import{b as C,c as E,a as P}from"./api-CNCnNUBm.js";import{g as R}from"./squad-colors-B8B_Y-lz.js";import{T as j}from"./trash-2-C18Ts8VR.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{u as q,a3 as F,E as z,J as r,q as n,n as t,t as d,T as c,H as M,a5 as T,a1 as L,g as E,p as x,d as $,L as A,z as p,R as g,K as l,m as P,o as R,l as G}from"./index-BGcJLCmg.js";import{b as B,a as J}from"./api-47T1Y5gh.js";import{S as K}from"./search-bl71fr1B.js";import{A as Q}from"./arrow-left-DjWS3Dza.js";import{T as I}from"./trash-2-hQUV1Voi.js";const O={class:"flex h-full"},W={class:"p-3 border-b border-border space-y-2"},X={class:"flex items-center gap-2"},Y={class:"relative"},Z={class:"flex gap-2"},ee={class:"flex-1"},te={class:"flex-1"},se={class:"flex-1 overflow-y-auto"},oe={key:0,class:"p-4 text-xs text-muted-foreground"},re={key:1,class:"flex flex-col items-center justify-center h-full p-6 text-center text-muted-foreground"},ne=["onClick"],ae={class:"flex-1 min-w-0"},le={class:"text-xs text-foreground line-clamp-2"},ie={class:"flex items-center gap-2 mt-1"},ue={class:"text-xs text-muted-foreground"},de={class:"text-xs text-muted-foreground"},ce=["onClick"],fe={key:2,class:"p-3 text-center"},ve={key:0,class:"flex-1 flex flex-col"},me={class:"flex items-center gap-2 px-4 py-2 border-b border-border"},xe={class:"text-sm font-medium text-muted-foreground"},pe={class:"flex-1 overflow-y-auto p-4 space-y-4"},ge={key:0,class:"text-center text-xs text-muted-foreground py-8"},he={class:"text-xs mt-1 opacity-60"},ye={key:1,class:"hidden md:flex flex-1 items-center justify-center text-muted-foreground"},be={class:"text-center"},_e=50,De=q({__name:"HistoryView",setup(we){const a=l([]),h=l(0),y=l(!0),f=l(""),v=l(""),m=l(""),u=l(null),b=l([]),_=l(!1),w=l(0);async function k(o=!0){y.value=!0;try{o&&(w.value=0,a.value=[]);const e=new URLSearchParams;f.value&&e.set("q",f.value),v.value&&e.set("from",v.value),m.value&&e.set("to",m.value+"T23:59:59"),e.set("limit",String(_e)),e.set("offset",String(w.value));const i=await B(`/history?${e.toString()}`);a.value=o?i.items:[...a.value,...i.items],h.value=i.total,w.value+=i.items.length}finally{y.value=!1}}async function j(o){u.value=o,_.value=!0;try{b.value=await B(`/history/${o}`)}finally{_.value=!1}}function D(){u.value=null,b.value=[]}async function H(o,e){e.stopPropagation(),confirm("Delete this conversation?")&&(await J(`/history/${o}`),a.value=a.value.filter(i=>i.id!==o),h.value=Math.max(0,h.value-1),u.value===o&&D())}function C(o){return new Date(o).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function N(o,e=100){return o.length>e?o.slice(0,e)+"…":o}const U=P(()=>a.value.length<h.value);let S=null;return F([f,v,m],()=>{S&&clearTimeout(S),S=setTimeout(()=>k(!0),300)}),z(()=>k(!0)),(o,e)=>{var i;return r(),n("div",O,[t("div",{class:p(["flex flex-col border-r border-border",u.value?"hidden md:flex w-80 shrink-0":"flex-1"])},[t("div",W,[t("div",X,[d(c(M),{class:"w-4 h-4 text-muted-foreground"}),e[4]||(e[4]=t("span",{class:"text-sm font-medium"},"Conversation History",-1))]),t("div",Y,[d(c(K),{class:"absolute left-2.5 top-2.5 w-3.5 h-3.5 text-muted-foreground"}),T(t("input",{"onUpdate:modelValue":e[0]||(e[0]=s=>f.value=s),placeholder:"Search conversations...",class:"w-full rounded-md border border-input bg-background pl-8 pr-3 py-2 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[L,f.value]])]),t("div",Z,[t("div",ee,[e[5]||(e[5]=t("label",{class:"text-xs text-muted-foreground block mb-1"},"From",-1)),T(t("input",{"onUpdate:modelValue":e[1]||(e[1]=s=>v.value=s),type:"date",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[L,v.value]])]),t("div",te,[e[6]||(e[6]=t("label",{class:"text-xs text-muted-foreground block mb-1"},"To",-1)),T(t("input",{"onUpdate:modelValue":e[2]||(e[2]=s=>m.value=s),type:"date",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[L,m.value]])])])]),t("div",se,[y.value&&a.value.length===0?(r(),n("div",oe," Loading... ")):a.value.length===0?(r(),n("div",re,[d(c(E),{class:"w-10 h-10 mb-3 opacity-40"}),e[7]||(e[7]=t("p",{class:"text-sm"},"No conversations found.",-1)),e[8]||(e[8]=t("p",{class:"text-xs mt-1"},"Start chatting to build up your history.",-1))])):x("",!0),(r(!0),n($,null,A(a.value,s=>(r(),n("div",{key:s.id,class:p(["group flex items-start gap-2 px-3 py-3 border-b border-border cursor-pointer hover:bg-accent/50 transition-colors",u.value===s.id?"bg-accent":""]),onClick:V=>j(s.id)},[t("div",ae,[t("p",le,g(N(s.preview)),1),t("div",ie,[t("span",ue,g(C(s.updatedAt)),1),t("span",de,"· "+g(s.messageCount)+" msgs",1)])]),t("button",{class:"opacity-0 group-hover:opacity-100 p-1 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-all",title:"Delete",onClick:V=>H(s.id,V)},[d(c(I),{class:"w-3.5 h-3.5"})],8,ce)],10,ne))),128)),U.value?(r(),n("div",fe,[t("button",{class:"text-xs text-muted-foreground hover:text-foreground underline",onClick:e[3]||(e[3]=s=>k(!1))}," Load more ")])):x("",!0)])],2),u.value?(r(),n("div",ve,[t("div",me,[t("button",{class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Back",onClick:D},[d(c(Q),{class:"w-4 h-4"})]),t("span",xe,g(C(((i=a.value.find(s=>s.id===u.value))==null?void 0:i.startedAt)??"")),1)]),t("div",pe,[_.value?(r(),n("div",ge," Loading... ")):x("",!0),(r(!0),n($,null,A(b.value,s=>(r(),n("div",{key:s.id,class:p(["flex",s.role==="user"?"justify-end":"justify-start"])},[t("div",{class:p(["max-w-[75%] rounded-lg px-4 py-2 text-sm",s.role==="user"?"bg-blue-600 text-white":"bg-muted text-foreground"])},[s.content?(r(),R(G,{key:0,content:s.content,class:p(s.role==="user"?"prose-invert":"")},null,8,["content","class"])):x("",!0),t("p",he,g(C(s.createdAt)),1)],2)],2))),128))])])):u.value?x("",!0):(r(),n("div",ye,[t("div",be,[d(c(M),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[9]||(e[9]=t("p",null,"Select a conversation to view",-1))])]))])}}});export{De as default};
1
+ import{u as q,a3 as F,E as z,J as r,q as n,n as t,t as d,T as c,H as M,a5 as T,a1 as L,g as E,p as x,d as $,L as A,z as p,R as g,K as l,m as P,o as R,l as G}from"./index-DTG9i0yb.js";import{b as B,a as J}from"./api-CNCnNUBm.js";import{S as K}from"./search-CGQarBXi.js";import{A as Q}from"./arrow-left-BIqDxiwh.js";import{T as I}from"./trash-2-C18Ts8VR.js";const O={class:"flex h-full"},W={class:"p-3 border-b border-border space-y-2"},X={class:"flex items-center gap-2"},Y={class:"relative"},Z={class:"flex gap-2"},ee={class:"flex-1"},te={class:"flex-1"},se={class:"flex-1 overflow-y-auto"},oe={key:0,class:"p-4 text-xs text-muted-foreground"},re={key:1,class:"flex flex-col items-center justify-center h-full p-6 text-center text-muted-foreground"},ne=["onClick"],ae={class:"flex-1 min-w-0"},le={class:"text-xs text-foreground line-clamp-2"},ie={class:"flex items-center gap-2 mt-1"},ue={class:"text-xs text-muted-foreground"},de={class:"text-xs text-muted-foreground"},ce=["onClick"],fe={key:2,class:"p-3 text-center"},ve={key:0,class:"flex-1 flex flex-col"},me={class:"flex items-center gap-2 px-4 py-2 border-b border-border"},xe={class:"text-sm font-medium text-muted-foreground"},pe={class:"flex-1 overflow-y-auto p-4 space-y-4"},ge={key:0,class:"text-center text-xs text-muted-foreground py-8"},he={class:"text-xs mt-1 opacity-60"},ye={key:1,class:"hidden md:flex flex-1 items-center justify-center text-muted-foreground"},be={class:"text-center"},_e=50,De=q({__name:"HistoryView",setup(we){const a=l([]),h=l(0),y=l(!0),f=l(""),v=l(""),m=l(""),u=l(null),b=l([]),_=l(!1),w=l(0);async function k(o=!0){y.value=!0;try{o&&(w.value=0,a.value=[]);const e=new URLSearchParams;f.value&&e.set("q",f.value),v.value&&e.set("from",v.value),m.value&&e.set("to",m.value+"T23:59:59"),e.set("limit",String(_e)),e.set("offset",String(w.value));const i=await B(`/history?${e.toString()}`);a.value=o?i.items:[...a.value,...i.items],h.value=i.total,w.value+=i.items.length}finally{y.value=!1}}async function j(o){u.value=o,_.value=!0;try{b.value=await B(`/history/${o}`)}finally{_.value=!1}}function D(){u.value=null,b.value=[]}async function H(o,e){e.stopPropagation(),confirm("Delete this conversation?")&&(await J(`/history/${o}`),a.value=a.value.filter(i=>i.id!==o),h.value=Math.max(0,h.value-1),u.value===o&&D())}function C(o){return new Date(o).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function N(o,e=100){return o.length>e?o.slice(0,e)+"…":o}const U=P(()=>a.value.length<h.value);let S=null;return F([f,v,m],()=>{S&&clearTimeout(S),S=setTimeout(()=>k(!0),300)}),z(()=>k(!0)),(o,e)=>{var i;return r(),n("div",O,[t("div",{class:p(["flex flex-col border-r border-border",u.value?"hidden md:flex w-80 shrink-0":"flex-1"])},[t("div",W,[t("div",X,[d(c(M),{class:"w-4 h-4 text-muted-foreground"}),e[4]||(e[4]=t("span",{class:"text-sm font-medium"},"Conversation History",-1))]),t("div",Y,[d(c(K),{class:"absolute left-2.5 top-2.5 w-3.5 h-3.5 text-muted-foreground"}),T(t("input",{"onUpdate:modelValue":e[0]||(e[0]=s=>f.value=s),placeholder:"Search conversations...",class:"w-full rounded-md border border-input bg-background pl-8 pr-3 py-2 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[L,f.value]])]),t("div",Z,[t("div",ee,[e[5]||(e[5]=t("label",{class:"text-xs text-muted-foreground block mb-1"},"From",-1)),T(t("input",{"onUpdate:modelValue":e[1]||(e[1]=s=>v.value=s),type:"date",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[L,v.value]])]),t("div",te,[e[6]||(e[6]=t("label",{class:"text-xs text-muted-foreground block mb-1"},"To",-1)),T(t("input",{"onUpdate:modelValue":e[2]||(e[2]=s=>m.value=s),type:"date",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[L,m.value]])])])]),t("div",se,[y.value&&a.value.length===0?(r(),n("div",oe," Loading... ")):a.value.length===0?(r(),n("div",re,[d(c(E),{class:"w-10 h-10 mb-3 opacity-40"}),e[7]||(e[7]=t("p",{class:"text-sm"},"No conversations found.",-1)),e[8]||(e[8]=t("p",{class:"text-xs mt-1"},"Start chatting to build up your history.",-1))])):x("",!0),(r(!0),n($,null,A(a.value,s=>(r(),n("div",{key:s.id,class:p(["group flex items-start gap-2 px-3 py-3 border-b border-border cursor-pointer hover:bg-accent/50 transition-colors",u.value===s.id?"bg-accent":""]),onClick:V=>j(s.id)},[t("div",ae,[t("p",le,g(N(s.preview)),1),t("div",ie,[t("span",ue,g(C(s.updatedAt)),1),t("span",de,"· "+g(s.messageCount)+" msgs",1)])]),t("button",{class:"opacity-0 group-hover:opacity-100 p-1 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-all",title:"Delete",onClick:V=>H(s.id,V)},[d(c(I),{class:"w-3.5 h-3.5"})],8,ce)],10,ne))),128)),U.value?(r(),n("div",fe,[t("button",{class:"text-xs text-muted-foreground hover:text-foreground underline",onClick:e[3]||(e[3]=s=>k(!1))}," Load more ")])):x("",!0)])],2),u.value?(r(),n("div",ve,[t("div",me,[t("button",{class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Back",onClick:D},[d(c(Q),{class:"w-4 h-4"})]),t("span",xe,g(C(((i=a.value.find(s=>s.id===u.value))==null?void 0:i.startedAt)??"")),1)]),t("div",pe,[_.value?(r(),n("div",ge," Loading... ")):x("",!0),(r(!0),n($,null,A(b.value,s=>(r(),n("div",{key:s.id,class:p(["flex",s.role==="user"?"justify-end":"justify-start"])},[t("div",{class:p(["max-w-[75%] rounded-lg px-4 py-2 text-sm",s.role==="user"?"bg-blue-600 text-white":"bg-muted text-foreground"])},[s.content?(r(),R(G,{key:0,content:s.content,class:p(s.role==="user"?"prose-invert":"")},null,8,["content","class"])):x("",!0),t("p",he,g(C(s.createdAt)),1)],2)],2))),128))])])):u.value?x("",!0):(r(),n("div",ye,[t("div",be,[d(c(M),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[9]||(e[9]=t("p",null,"Select a conversation to view",-1))])]))])}}});export{De as default};
@@ -1 +1 @@
1
- import{u as b,V as v,J as u,q as i,n as t,t as y,a7 as w,a5 as m,a1 as p,R as c,p as V,T as f,K as d,_,Z as h}from"./index-BGcJLCmg.js";const S={class:"min-h-screen flex items-center justify-center bg-background p-4"},k={class:"w-full max-w-sm space-y-8"},q={class:"text-center"},A={key:0,class:"text-sm text-destructive"},B=["disabled"],L=b({__name:"LoginView",setup(D){const o=v(),g=h(),r=d(""),n=d(""),s=d("");async function x(){s.value="";try{await o.login(r.value,n.value),g.push("/")}catch(l){s.value=l.message??"Login failed"}}return(l,e)=>(u(),i("div",S,[t("div",k,[t("div",q,[y(_,{size:56,class:"mx-auto mb-4"}),e[2]||(e[2]=t("h1",{class:"font-display text-4xl font-normal uppercase tracking-[0.18em] bg-gradient-brand bg-clip-text text-transparent"}," IO ",-1)),e[3]||(e[3]=t("p",{class:"text-sm text-muted-foreground mt-1"},"Sign in to your dashboard",-1))]),t("form",{onSubmit:w(x,["prevent"]),class:"space-y-4 bg-card border border-border rounded-lg p-6"},[t("div",null,[e[4]||(e[4]=t("label",{class:"text-sm font-medium text-muted-foreground",for:"email"},"Email",-1)),m(t("input",{id:"email","onUpdate:modelValue":e[0]||(e[0]=a=>r.value=a),type:"email",required:"",class:"mt-1 w-full rounded-md border border-border bg-input px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"you@example.com"},null,512),[[p,r.value]])]),t("div",null,[e[5]||(e[5]=t("label",{class:"text-sm font-medium text-muted-foreground",for:"password"},"Password",-1)),m(t("input",{id:"password","onUpdate:modelValue":e[1]||(e[1]=a=>n.value=a),type:"password",required:"",class:"mt-1 w-full rounded-md border border-border bg-input px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"••••••••"},null,512),[[p,n.value]])]),s.value?(u(),i("div",A,c(s.value),1)):V("",!0),t("button",{type:"submit",disabled:f(o).loading,class:"btn-gradient w-full py-2.5"},c(f(o).loading?"Signing in...":"Sign In"),9,B)],32),e[6]||(e[6]=t("p",{class:"text-center text-xs text-muted-foreground"}," Personal AI Assistant Daemon ",-1))])]))}});export{L as default};
1
+ import{u as b,V as v,J as u,q as i,n as t,t as y,a7 as w,a5 as m,a1 as p,R as c,p as V,T as f,K as d,_,Z as h}from"./index-DTG9i0yb.js";const S={class:"min-h-screen flex items-center justify-center bg-background p-4"},k={class:"w-full max-w-sm space-y-8"},q={class:"text-center"},A={key:0,class:"text-sm text-destructive"},B=["disabled"],L=b({__name:"LoginView",setup(D){const o=v(),g=h(),r=d(""),n=d(""),s=d("");async function x(){s.value="";try{await o.login(r.value,n.value),g.push("/")}catch(l){s.value=l.message??"Login failed"}}return(l,e)=>(u(),i("div",S,[t("div",k,[t("div",q,[y(_,{size:56,class:"mx-auto mb-4"}),e[2]||(e[2]=t("h1",{class:"font-display text-4xl font-normal uppercase tracking-[0.18em] bg-gradient-brand bg-clip-text text-transparent"}," IO ",-1)),e[3]||(e[3]=t("p",{class:"text-sm text-muted-foreground mt-1"},"Sign in to your dashboard",-1))]),t("form",{onSubmit:w(x,["prevent"]),class:"space-y-4 bg-card border border-border rounded-lg p-6"},[t("div",null,[e[4]||(e[4]=t("label",{class:"text-sm font-medium text-muted-foreground",for:"email"},"Email",-1)),m(t("input",{id:"email","onUpdate:modelValue":e[0]||(e[0]=a=>r.value=a),type:"email",required:"",class:"mt-1 w-full rounded-md border border-border bg-input px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"you@example.com"},null,512),[[p,r.value]])]),t("div",null,[e[5]||(e[5]=t("label",{class:"text-sm font-medium text-muted-foreground",for:"password"},"Password",-1)),m(t("input",{id:"password","onUpdate:modelValue":e[1]||(e[1]=a=>n.value=a),type:"password",required:"",class:"mt-1 w-full rounded-md border border-border bg-input px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"••••••••"},null,512),[[p,n.value]])]),s.value?(u(),i("div",A,c(s.value),1)):V("",!0),t("button",{type:"submit",disabled:f(o).loading,class:"btn-gradient w-full py-2.5"},c(f(o).loading?"Signing in...":"Sign In"),9,B)],32),e[6]||(e[6]=t("p",{class:"text-center text-xs text-muted-foreground"}," Personal AI Assistant Daemon ",-1))])]))}});export{L as default};
@@ -1 +1 @@
1
- import{u as E,E as S,J as a,q as l,n as s,t as c,T as b,s as C,a5 as i,a1 as m,a0 as M,p as x,i as P,d as j,L as U,K as f,R as p}from"./index-BGcJLCmg.js";import{b as $,c as I,d as N,a as L}from"./api-47T1Y5gh.js";import{_ as O}from"./ToggleSwitch.vue_vue_type_script_setup_true_lang-CDuXZZzC.js";import{P as G}from"./plus-bVg6pl4_.js";import{T as K}from"./trash-2-hQUV1Voi.js";const F={class:"p-6"},Y={class:"flex items-center justify-between mb-6"},B={key:0,class:"border border-border rounded-lg p-4 mb-6 space-y-3 bg-card"},h={class:"grid grid-cols-2 gap-3"},D={key:0},J={key:1},R={key:1,class:"text-muted-foreground"},q={key:2,class:"text-center py-12 text-muted-foreground"},W={key:3,class:"space-y-2"},z={class:"space-y-1"},H={class:"flex items-center gap-2"},Q={class:"font-medium text-sm"},X={class:"text-xs text-muted-foreground bg-secondary px-1.5 py-0.5 rounded"},Z={key:0,class:"text-xs text-muted-foreground"},ee={key:1,class:"text-xs text-muted-foreground"},te={key:2,class:"text-xs text-muted-foreground"},se={class:"flex items-center gap-3"},oe=["onClick"],ie=E({__name:"McpView",setup(ne){const u=f([]),g=f(!0),v=f(!1),o=f({name:"",type:"stdio",command:"",url:"",argsText:"",envText:""});S(async()=>{try{u.value=await $("/mcp")}finally{g.value=!1}});function k(n){return n.split(/\r?\n|,/).map(e=>e.trim()).filter(Boolean)}function w(n){const e={};try{const t=JSON.parse(n);if(t&&typeof t=="object"&&!Array.isArray(t)){for(const[d,r]of Object.entries(t))e[d]=String(r);return e}}catch{}for(const t of n.split(/\r?\n/)){const d=t.trim();if(!d||d.startsWith("#"))continue;const r=d.indexOf("=");if(r===-1)continue;const y=d.slice(0,r).trim(),A=d.slice(r+1).trim();y&&(e[y]=A)}return e}async function _(n){await N(`/mcp/${n.id}`,{enabled:!n.enabled}),n.enabled=!n.enabled}async function T(n){await L(`/mcp/${n}`),u.value=u.value.filter(e=>e.id!==n)}async function V(){const n={name:o.value.name,type:o.value.type,args:k(o.value.argsText),env:w(o.value.envText)};o.value.type==="stdio"?n.command=o.value.command:n.url=o.value.url;const e=await I("/mcp",n);u.value.push(e),v.value=!1,o.value={name:"",type:"stdio",command:"",url:"",argsText:"",envText:""}}return(n,e)=>(a(),l("div",F,[s("div",Y,[e[8]||(e[8]=s("div",null,[s("p",{class:"text-sm font-medium text-primary"},"MCP configuration"),s("h1",{class:"text-2xl font-bold"},"MCP Servers")],-1)),s("button",{onClick:e[0]||(e[0]=t=>v.value=!v.value),class:"btn-gradient inline-flex items-center gap-1"},[c(b(G),{class:"w-4 h-4"}),e[7]||(e[7]=C(" Add Server ",-1))])]),v.value?(a(),l("div",B,[s("div",h,[s("div",null,[e[9]||(e[9]=s("label",{class:"text-sm font-medium"},"Name",-1)),i(s("input",{"onUpdate:modelValue":e[1]||(e[1]=t=>o.value.name=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.name]])]),s("div",null,[e[11]||(e[11]=s("label",{class:"text-sm font-medium"},"Type",-1)),i(s("select",{"onUpdate:modelValue":e[2]||(e[2]=t=>o.value.type=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[10]||(e[10]=[s("option",{value:"stdio"},"stdio",-1),s("option",{value:"http"},"http",-1)])],512),[[M,o.value.type]])])]),o.value.type==="stdio"?(a(),l("div",D,[e[12]||(e[12]=s("label",{class:"text-sm font-medium"},"Command",-1)),i(s("input",{"onUpdate:modelValue":e[3]||(e[3]=t=>o.value.command=t),placeholder:"npx @my/mcp-server",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.command]])])):(a(),l("div",J,[e[13]||(e[13]=s("label",{class:"text-sm font-medium"},"URL",-1)),i(s("input",{"onUpdate:modelValue":e[4]||(e[4]=t=>o.value.url=t),placeholder:"https://...",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.url]])])),s("div",null,[e[14]||(e[14]=s("label",{class:"text-sm font-medium"},"Command args",-1)),i(s("textarea",{"onUpdate:modelValue":e[5]||(e[5]=t=>o.value.argsText=t),rows:"3",placeholder:"--stdio\n--figma-api-key=${FIGMA_API_KEY}",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.argsText]]),e[15]||(e[15]=s("p",{class:"mt-1 text-xs text-muted-foreground"},"Enter one arg per line or comma-separated.",-1))]),s("div",null,[e[16]||(e[16]=s("label",{class:"text-sm font-medium"},"Environment variables",-1)),i(s("textarea",{"onUpdate:modelValue":e[6]||(e[6]=t=>o.value.envText=t),rows:"4",placeholder:"FIGMA_API_KEY=${FIGMA_API_KEY}\nLOG_LEVEL=debug",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm font-mono"},null,512),[[m,o.value.envText]]),e[17]||(e[17]=s("p",{class:"mt-1 text-xs text-muted-foreground"},"Use KEY=value lines, or paste JSON. Values like ${FIGMA_API_KEY} are preserved.",-1))]),s("div",{class:"flex justify-end"},[s("button",{onClick:V,class:"btn-gradient"},"Save")])])):x("",!0),g.value?(a(),l("div",R,"Loading...")):u.value.length===0?(a(),l("div",q,[c(b(P),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[18]||(e[18]=s("p",null,"No MCP servers configured.",-1))])):(a(),l("div",W,[(a(!0),l(j,null,U(u.value,t=>{var d;return a(),l("div",{key:t.id,class:"flex items-center justify-between border border-border rounded-lg px-4 py-3 bg-card"},[s("div",z,[s("div",H,[s("span",Q,p(t.name),1),s("span",X,p(t.type),1)]),t.command||t.url?(a(),l("div",Z,p(t.command||t.url),1)):x("",!0),(d=t.args)!=null&&d.length?(a(),l("div",ee,"Args: "+p(t.args.join(", ")),1)):x("",!0),t.env&&Object.keys(t.env).length>0?(a(),l("div",te,"Env: "+p(Object.keys(t.env).join(", ")),1)):x("",!0)]),s("div",se,[c(O,{"model-value":t.enabled,"aria-label":`Toggle ${t.name}`,"onUpdate:modelValue":r=>_(t)},null,8,["model-value","aria-label","onUpdate:modelValue"]),s("button",{onClick:r=>T(t.id),class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive"},[c(b(K),{class:"w-4 h-4"})],8,oe)])])}),128))]))]))}});export{ie as default};
1
+ import{u as E,E as S,J as a,q as l,n as s,t as c,T as b,s as C,a5 as i,a1 as m,a0 as M,p as x,i as P,d as j,L as U,K as f,R as p}from"./index-DTG9i0yb.js";import{b as $,c as I,d as N,a as L}from"./api-CNCnNUBm.js";import{_ as O}from"./ToggleSwitch.vue_vue_type_script_setup_true_lang-ucLsqy4u.js";import{P as G}from"./plus-DLjbplkx.js";import{T as K}from"./trash-2-C18Ts8VR.js";const F={class:"p-6"},Y={class:"flex items-center justify-between mb-6"},B={key:0,class:"border border-border rounded-lg p-4 mb-6 space-y-3 bg-card"},h={class:"grid grid-cols-2 gap-3"},D={key:0},J={key:1},R={key:1,class:"text-muted-foreground"},q={key:2,class:"text-center py-12 text-muted-foreground"},W={key:3,class:"space-y-2"},z={class:"space-y-1"},H={class:"flex items-center gap-2"},Q={class:"font-medium text-sm"},X={class:"text-xs text-muted-foreground bg-secondary px-1.5 py-0.5 rounded"},Z={key:0,class:"text-xs text-muted-foreground"},ee={key:1,class:"text-xs text-muted-foreground"},te={key:2,class:"text-xs text-muted-foreground"},se={class:"flex items-center gap-3"},oe=["onClick"],ie=E({__name:"McpView",setup(ne){const u=f([]),g=f(!0),v=f(!1),o=f({name:"",type:"stdio",command:"",url:"",argsText:"",envText:""});S(async()=>{try{u.value=await $("/mcp")}finally{g.value=!1}});function k(n){return n.split(/\r?\n|,/).map(e=>e.trim()).filter(Boolean)}function w(n){const e={};try{const t=JSON.parse(n);if(t&&typeof t=="object"&&!Array.isArray(t)){for(const[d,r]of Object.entries(t))e[d]=String(r);return e}}catch{}for(const t of n.split(/\r?\n/)){const d=t.trim();if(!d||d.startsWith("#"))continue;const r=d.indexOf("=");if(r===-1)continue;const y=d.slice(0,r).trim(),A=d.slice(r+1).trim();y&&(e[y]=A)}return e}async function _(n){await N(`/mcp/${n.id}`,{enabled:!n.enabled}),n.enabled=!n.enabled}async function T(n){await L(`/mcp/${n}`),u.value=u.value.filter(e=>e.id!==n)}async function V(){const n={name:o.value.name,type:o.value.type,args:k(o.value.argsText),env:w(o.value.envText)};o.value.type==="stdio"?n.command=o.value.command:n.url=o.value.url;const e=await I("/mcp",n);u.value.push(e),v.value=!1,o.value={name:"",type:"stdio",command:"",url:"",argsText:"",envText:""}}return(n,e)=>(a(),l("div",F,[s("div",Y,[e[8]||(e[8]=s("div",null,[s("p",{class:"text-sm font-medium text-primary"},"MCP configuration"),s("h1",{class:"text-2xl font-bold"},"MCP Servers")],-1)),s("button",{onClick:e[0]||(e[0]=t=>v.value=!v.value),class:"btn-gradient inline-flex items-center gap-1"},[c(b(G),{class:"w-4 h-4"}),e[7]||(e[7]=C(" Add Server ",-1))])]),v.value?(a(),l("div",B,[s("div",h,[s("div",null,[e[9]||(e[9]=s("label",{class:"text-sm font-medium"},"Name",-1)),i(s("input",{"onUpdate:modelValue":e[1]||(e[1]=t=>o.value.name=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.name]])]),s("div",null,[e[11]||(e[11]=s("label",{class:"text-sm font-medium"},"Type",-1)),i(s("select",{"onUpdate:modelValue":e[2]||(e[2]=t=>o.value.type=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[10]||(e[10]=[s("option",{value:"stdio"},"stdio",-1),s("option",{value:"http"},"http",-1)])],512),[[M,o.value.type]])])]),o.value.type==="stdio"?(a(),l("div",D,[e[12]||(e[12]=s("label",{class:"text-sm font-medium"},"Command",-1)),i(s("input",{"onUpdate:modelValue":e[3]||(e[3]=t=>o.value.command=t),placeholder:"npx @my/mcp-server",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.command]])])):(a(),l("div",J,[e[13]||(e[13]=s("label",{class:"text-sm font-medium"},"URL",-1)),i(s("input",{"onUpdate:modelValue":e[4]||(e[4]=t=>o.value.url=t),placeholder:"https://...",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.url]])])),s("div",null,[e[14]||(e[14]=s("label",{class:"text-sm font-medium"},"Command args",-1)),i(s("textarea",{"onUpdate:modelValue":e[5]||(e[5]=t=>o.value.argsText=t),rows:"3",placeholder:"--stdio\n--figma-api-key=${FIGMA_API_KEY}",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.argsText]]),e[15]||(e[15]=s("p",{class:"mt-1 text-xs text-muted-foreground"},"Enter one arg per line or comma-separated.",-1))]),s("div",null,[e[16]||(e[16]=s("label",{class:"text-sm font-medium"},"Environment variables",-1)),i(s("textarea",{"onUpdate:modelValue":e[6]||(e[6]=t=>o.value.envText=t),rows:"4",placeholder:"FIGMA_API_KEY=${FIGMA_API_KEY}\nLOG_LEVEL=debug",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm font-mono"},null,512),[[m,o.value.envText]]),e[17]||(e[17]=s("p",{class:"mt-1 text-xs text-muted-foreground"},"Use KEY=value lines, or paste JSON. Values like ${FIGMA_API_KEY} are preserved.",-1))]),s("div",{class:"flex justify-end"},[s("button",{onClick:V,class:"btn-gradient"},"Save")])])):x("",!0),g.value?(a(),l("div",R,"Loading...")):u.value.length===0?(a(),l("div",q,[c(b(P),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[18]||(e[18]=s("p",null,"No MCP servers configured.",-1))])):(a(),l("div",W,[(a(!0),l(j,null,U(u.value,t=>{var d;return a(),l("div",{key:t.id,class:"flex items-center justify-between border border-border rounded-lg px-4 py-3 bg-card"},[s("div",z,[s("div",H,[s("span",Q,p(t.name),1),s("span",X,p(t.type),1)]),t.command||t.url?(a(),l("div",Z,p(t.command||t.url),1)):x("",!0),(d=t.args)!=null&&d.length?(a(),l("div",ee,"Args: "+p(t.args.join(", ")),1)):x("",!0),t.env&&Object.keys(t.env).length>0?(a(),l("div",te,"Env: "+p(Object.keys(t.env).join(", ")),1)):x("",!0)]),s("div",se,[c(O,{"model-value":t.enabled,"aria-label":`Toggle ${t.name}`,"onUpdate:modelValue":r=>_(t)},null,8,["model-value","aria-label","onUpdate:modelValue"]),s("button",{onClick:r=>T(t.id),class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive"},[c(b(K),{class:"w-4 h-4"})],8,oe)])])}),128))]))]))}});export{ie as default};
@@ -1,4 +1,4 @@
1
- import{r as B,u as I,E as L,J as d,q as r,n as o,t as m,T as p,s as z,d as x,L as y,a5 as f,a0 as k,a1 as S,p as _,c as E,R as n,K as u,m as M,z as O,D as j}from"./index-BGcJLCmg.js";import{b as h,c as C,d as A,a as R}from"./api-47T1Y5gh.js";import{g as F}from"./squad-colors-B8B_Y-lz.js";import{_ as G}from"./ToggleSwitch.vue_vue_type_script_setup_true_lang-CDuXZZzC.js";import{P as J}from"./plus-bVg6pl4_.js";import{T as K}from"./trash-2-hQUV1Voi.js";/**
1
+ import{r as B,u as I,E as L,J as d,q as r,n as o,t as m,T as p,s as z,d as x,L as y,a5 as f,a0 as k,a1 as S,p as _,c as E,R as n,K as u,m as M,z as O,D as j}from"./index-DTG9i0yb.js";import{b as h,c as C,d as A,a as R}from"./api-CNCnNUBm.js";import{g as F}from"./squad-colors-B8B_Y-lz.js";import{_ as G}from"./ToggleSwitch.vue_vue_type_script_setup_true_lang-ucLsqy4u.js";import{P as J}from"./plus-DLjbplkx.js";import{T as K}from"./trash-2-C18Ts8VR.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{u as w,E,J as d,q as s,n as t,R as g,d as x,L as U,a5 as o,a1 as n,a0 as M,$ as p,p as b,K as r,z as T}from"./index-BGcJLCmg.js";import{b as V,d as S}from"./api-47T1Y5gh.js";const z={class:"p-6"},A={class:"flex items-center justify-between mb-6"},B=["disabled"],N={key:0,class:"text-muted-foreground"},C={class:"flex gap-1 border-b border-border mb-6"},I=["onClick"],K={key:0,class:"space-y-4 max-w-lg"},D={class:"flex items-center gap-3"},L={key:1,class:"space-y-4 max-w-lg"},R={class:"flex items-center gap-3"},j={key:2,class:"space-y-4 max-w-lg"},q={key:3,class:"space-y-4 max-w-lg"},G={class:"flex items-center gap-3"},O={class:"flex items-center gap-3"},W=w({__name:"SettingsView",setup(P){const f=r(!0),i=r(!1),m=r(!1),u=r("general"),y=[{id:"general",label:"General"},{id:"telegram",label:"Telegram"},{id:"auth",label:"Auth"},{id:"advanced",label:"Advanced"}],a=r({defaultModel:"",port:3170,telegramEnabled:!1,telegramBotToken:"",authorizedUserId:null,supabaseUrl:"",supabaseAnonKey:"",authorizedEmail:"",backgroundNotifyMode:"meaningful",backgroundNotifyTelegram:!0,selfEditEnabled:!1,watchdogEnabled:!0});async function k(){f.value=!0;try{const v=await V("/settings");a.value=v}finally{f.value=!1}}async function c(){i.value=!0,m.value=!1;try{await S("/settings",a.value),m.value=!0,setTimeout(()=>m.value=!1,2e3)}finally{i.value=!1}}return E(k),(v,e)=>(d(),s("div",z,[t("div",A,[e[12]||(e[12]=t("h1",{class:"text-2xl font-bold"},"Settings",-1)),t("button",{onClick:c,disabled:i.value,class:"px-4 py-2 rounded-md bg-primary text-primary-foreground text-sm hover:bg-primary/90 disabled:opacity-50"},g(i.value?"Saving...":m.value?"Saved ✓":"Save"),9,B)]),f.value?(d(),s("div",N,"Loading...")):(d(),s(x,{key:1},[t("div",C,[(d(),s(x,null,U(y,l=>t("button",{key:l.id,onClick:$=>u.value=l.id,class:T(["px-4 py-2 text-sm font-medium border-b-2 transition-colors",u.value===l.id?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"])},g(l.label),11,I)),64))]),u.value==="general"?(d(),s("div",K,[t("div",null,[e[13]||(e[13]=t("label",{class:"text-sm font-medium"},"Default Model",-1)),o(t("input",{"onUpdate:modelValue":e[0]||(e[0]=l=>a.value.defaultModel=l),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.defaultModel]])]),t("div",null,[e[14]||(e[14]=t("label",{class:"text-sm font-medium"},"Port",-1)),o(t("input",{"onUpdate:modelValue":e[1]||(e[1]=l=>a.value.port=l),type:"number",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.port,void 0,{number:!0}]]),e[15]||(e[15]=t("p",{class:"text-xs text-muted-foreground mt-1"},"Requires restart to take effect",-1))]),t("div",null,[e[17]||(e[17]=t("label",{class:"text-sm font-medium"},"Background Notify Mode",-1)),o(t("select",{"onUpdate:modelValue":e[2]||(e[2]=l=>a.value.backgroundNotifyMode=l),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[16]||(e[16]=[t("option",{value:"all"},"All",-1),t("option",{value:"meaningful"},"Meaningful",-1),t("option",{value:"off"},"Off",-1)])],512),[[M,a.value.backgroundNotifyMode]])]),t("div",D,[o(t("input",{"onUpdate:modelValue":e[3]||(e[3]=l=>a.value.backgroundNotifyTelegram=l),type:"checkbox",id:"notifyTelegram",class:"rounded"},null,512),[[p,a.value.backgroundNotifyTelegram]]),e[18]||(e[18]=t("label",{for:"notifyTelegram",class:"text-sm font-medium"},"Send notifications via Telegram",-1))])])):b("",!0),u.value==="telegram"?(d(),s("div",L,[t("div",null,[e[19]||(e[19]=t("label",{class:"text-sm font-medium"},"Bot Token",-1)),o(t("input",{"onUpdate:modelValue":e[4]||(e[4]=l=>a.value.telegramBotToken=l),type:"password",placeholder:"Enter new token to update",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.telegramBotToken]])]),t("div",null,[e[20]||(e[20]=t("label",{class:"text-sm font-medium"},"Authorized User ID",-1)),o(t("input",{"onUpdate:modelValue":e[5]||(e[5]=l=>a.value.authorizedUserId=l),type:"number",placeholder:"123456789",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.authorizedUserId,void 0,{number:!0}]])]),t("div",R,[o(t("input",{"onUpdate:modelValue":e[6]||(e[6]=l=>a.value.telegramEnabled=l),type:"checkbox",id:"telegramEnabled",class:"rounded"},null,512),[[p,a.value.telegramEnabled]]),e[21]||(e[21]=t("label",{for:"telegramEnabled",class:"text-sm font-medium"},"Enable Telegram Bot",-1))])])):b("",!0),u.value==="auth"?(d(),s("div",j,[t("div",null,[e[22]||(e[22]=t("label",{class:"text-sm font-medium"},"Supabase URL",-1)),o(t("input",{"onUpdate:modelValue":e[7]||(e[7]=l=>a.value.supabaseUrl=l),placeholder:"https://your-project.supabase.co",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.supabaseUrl]])]),t("div",null,[e[23]||(e[23]=t("label",{class:"text-sm font-medium"},"Supabase Anon Key",-1)),o(t("input",{"onUpdate:modelValue":e[8]||(e[8]=l=>a.value.supabaseAnonKey=l),type:"password",placeholder:"Enter new key to update",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.supabaseAnonKey]])]),t("div",null,[e[24]||(e[24]=t("label",{class:"text-sm font-medium"},"Authorized Email",-1)),o(t("input",{"onUpdate:modelValue":e[9]||(e[9]=l=>a.value.authorizedEmail=l),type:"email",placeholder:"you@example.com",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.authorizedEmail]])])])):b("",!0),u.value==="advanced"?(d(),s("div",q,[t("div",G,[o(t("input",{"onUpdate:modelValue":e[10]||(e[10]=l=>a.value.selfEditEnabled=l),type:"checkbox",id:"selfEdit",class:"rounded"},null,512),[[p,a.value.selfEditEnabled]]),e[25]||(e[25]=t("div",null,[t("label",{for:"selfEdit",class:"text-sm font-medium"},"Self-Edit Mode"),t("p",{class:"text-xs text-muted-foreground"},"Allow IO to modify its own source code")],-1))]),t("div",O,[o(t("input",{"onUpdate:modelValue":e[11]||(e[11]=l=>a.value.watchdogEnabled=l),type:"checkbox",id:"watchdog",class:"rounded"},null,512),[[p,a.value.watchdogEnabled]]),e[26]||(e[26]=t("div",null,[t("label",{for:"watchdog",class:"text-sm font-medium"},"Watchdog"),t("p",{class:"text-xs text-muted-foreground"},"Monitor event loop and zombie instances")],-1))])])):b("",!0)],64))]))}});export{W as default};
1
+ import{u as w,E,J as d,q as s,n as t,R as g,d as x,L as U,a5 as o,a1 as n,a0 as M,$ as p,p as b,K as r,z as T}from"./index-DTG9i0yb.js";import{b as V,d as S}from"./api-CNCnNUBm.js";const z={class:"p-6"},A={class:"flex items-center justify-between mb-6"},B=["disabled"],N={key:0,class:"text-muted-foreground"},C={class:"flex gap-1 border-b border-border mb-6"},I=["onClick"],K={key:0,class:"space-y-4 max-w-lg"},D={class:"flex items-center gap-3"},L={key:1,class:"space-y-4 max-w-lg"},R={class:"flex items-center gap-3"},j={key:2,class:"space-y-4 max-w-lg"},q={key:3,class:"space-y-4 max-w-lg"},G={class:"flex items-center gap-3"},O={class:"flex items-center gap-3"},W=w({__name:"SettingsView",setup(P){const f=r(!0),i=r(!1),m=r(!1),u=r("general"),y=[{id:"general",label:"General"},{id:"telegram",label:"Telegram"},{id:"auth",label:"Auth"},{id:"advanced",label:"Advanced"}],a=r({defaultModel:"",port:3170,telegramEnabled:!1,telegramBotToken:"",authorizedUserId:null,supabaseUrl:"",supabaseAnonKey:"",authorizedEmail:"",backgroundNotifyMode:"meaningful",backgroundNotifyTelegram:!0,selfEditEnabled:!1,watchdogEnabled:!0});async function k(){f.value=!0;try{const v=await V("/settings");a.value=v}finally{f.value=!1}}async function c(){i.value=!0,m.value=!1;try{await S("/settings",a.value),m.value=!0,setTimeout(()=>m.value=!1,2e3)}finally{i.value=!1}}return E(k),(v,e)=>(d(),s("div",z,[t("div",A,[e[12]||(e[12]=t("h1",{class:"text-2xl font-bold"},"Settings",-1)),t("button",{onClick:c,disabled:i.value,class:"px-4 py-2 rounded-md bg-primary text-primary-foreground text-sm hover:bg-primary/90 disabled:opacity-50"},g(i.value?"Saving...":m.value?"Saved ✓":"Save"),9,B)]),f.value?(d(),s("div",N,"Loading...")):(d(),s(x,{key:1},[t("div",C,[(d(),s(x,null,U(y,l=>t("button",{key:l.id,onClick:$=>u.value=l.id,class:T(["px-4 py-2 text-sm font-medium border-b-2 transition-colors",u.value===l.id?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"])},g(l.label),11,I)),64))]),u.value==="general"?(d(),s("div",K,[t("div",null,[e[13]||(e[13]=t("label",{class:"text-sm font-medium"},"Default Model",-1)),o(t("input",{"onUpdate:modelValue":e[0]||(e[0]=l=>a.value.defaultModel=l),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.defaultModel]])]),t("div",null,[e[14]||(e[14]=t("label",{class:"text-sm font-medium"},"Port",-1)),o(t("input",{"onUpdate:modelValue":e[1]||(e[1]=l=>a.value.port=l),type:"number",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.port,void 0,{number:!0}]]),e[15]||(e[15]=t("p",{class:"text-xs text-muted-foreground mt-1"},"Requires restart to take effect",-1))]),t("div",null,[e[17]||(e[17]=t("label",{class:"text-sm font-medium"},"Background Notify Mode",-1)),o(t("select",{"onUpdate:modelValue":e[2]||(e[2]=l=>a.value.backgroundNotifyMode=l),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[16]||(e[16]=[t("option",{value:"all"},"All",-1),t("option",{value:"meaningful"},"Meaningful",-1),t("option",{value:"off"},"Off",-1)])],512),[[M,a.value.backgroundNotifyMode]])]),t("div",D,[o(t("input",{"onUpdate:modelValue":e[3]||(e[3]=l=>a.value.backgroundNotifyTelegram=l),type:"checkbox",id:"notifyTelegram",class:"rounded"},null,512),[[p,a.value.backgroundNotifyTelegram]]),e[18]||(e[18]=t("label",{for:"notifyTelegram",class:"text-sm font-medium"},"Send notifications via Telegram",-1))])])):b("",!0),u.value==="telegram"?(d(),s("div",L,[t("div",null,[e[19]||(e[19]=t("label",{class:"text-sm font-medium"},"Bot Token",-1)),o(t("input",{"onUpdate:modelValue":e[4]||(e[4]=l=>a.value.telegramBotToken=l),type:"password",placeholder:"Enter new token to update",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.telegramBotToken]])]),t("div",null,[e[20]||(e[20]=t("label",{class:"text-sm font-medium"},"Authorized User ID",-1)),o(t("input",{"onUpdate:modelValue":e[5]||(e[5]=l=>a.value.authorizedUserId=l),type:"number",placeholder:"123456789",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.authorizedUserId,void 0,{number:!0}]])]),t("div",R,[o(t("input",{"onUpdate:modelValue":e[6]||(e[6]=l=>a.value.telegramEnabled=l),type:"checkbox",id:"telegramEnabled",class:"rounded"},null,512),[[p,a.value.telegramEnabled]]),e[21]||(e[21]=t("label",{for:"telegramEnabled",class:"text-sm font-medium"},"Enable Telegram Bot",-1))])])):b("",!0),u.value==="auth"?(d(),s("div",j,[t("div",null,[e[22]||(e[22]=t("label",{class:"text-sm font-medium"},"Supabase URL",-1)),o(t("input",{"onUpdate:modelValue":e[7]||(e[7]=l=>a.value.supabaseUrl=l),placeholder:"https://your-project.supabase.co",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.supabaseUrl]])]),t("div",null,[e[23]||(e[23]=t("label",{class:"text-sm font-medium"},"Supabase Anon Key",-1)),o(t("input",{"onUpdate:modelValue":e[8]||(e[8]=l=>a.value.supabaseAnonKey=l),type:"password",placeholder:"Enter new key to update",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.supabaseAnonKey]])]),t("div",null,[e[24]||(e[24]=t("label",{class:"text-sm font-medium"},"Authorized Email",-1)),o(t("input",{"onUpdate:modelValue":e[9]||(e[9]=l=>a.value.authorizedEmail=l),type:"email",placeholder:"you@example.com",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.authorizedEmail]])])])):b("",!0),u.value==="advanced"?(d(),s("div",q,[t("div",G,[o(t("input",{"onUpdate:modelValue":e[10]||(e[10]=l=>a.value.selfEditEnabled=l),type:"checkbox",id:"selfEdit",class:"rounded"},null,512),[[p,a.value.selfEditEnabled]]),e[25]||(e[25]=t("div",null,[t("label",{for:"selfEdit",class:"text-sm font-medium"},"Self-Edit Mode"),t("p",{class:"text-xs text-muted-foreground"},"Allow IO to modify its own source code")],-1))]),t("div",O,[o(t("input",{"onUpdate:modelValue":e[11]||(e[11]=l=>a.value.watchdogEnabled=l),type:"checkbox",id:"watchdog",class:"rounded"},null,512),[[p,a.value.watchdogEnabled]]),e[26]||(e[26]=t("div",null,[t("label",{for:"watchdog",class:"text-sm font-medium"},"Watchdog"),t("p",{class:"text-xs text-muted-foreground"},"Monitor event loop and zombie instances")],-1))])])):b("",!0)],64))]))}});export{W as default};
@@ -1,4 +1,4 @@
1
- import{r as fe,u as me,E as xe,J as l,q as a,n as t,z as j,t as u,T as d,s as q,d as p,a5 as C,a1 as M,a6 as ee,R as r,p as S,h as te,L as se,a0 as ge,X as ye,o as le,l as oe,K as n,m as be,a7 as ae}from"./index-BGcJLCmg.js";import{b as z,c as J,d as ke,a as he}from"./api-47T1Y5gh.js";import{P as ne}from"./plus-bVg6pl4_.js";import{S as _e}from"./search-bl71fr1B.js";import{P as we,S as Ce}from"./save-Ca__Dc6q.js";import{T as Se}from"./trash-2-hQUV1Voi.js";/**
1
+ import{r as fe,u as me,E as xe,J as l,q as a,n as t,z as j,t as u,T as d,s as q,d as p,a5 as C,a1 as M,a6 as ee,R as r,p as S,h as te,L as se,a0 as ge,X as ye,o as le,l as oe,K as n,m as be,a7 as ae}from"./index-DTG9i0yb.js";import{b as z,c as J,d as ke,a as he}from"./api-CNCnNUBm.js";import{P as ne}from"./plus-DLjbplkx.js";import{S as _e}from"./search-CGQarBXi.js";import{P as we,S as Ce}from"./save-DQWKjWH3.js";import{T as Se}from"./trash-2-C18Ts8VR.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{r as A,u as J,a3 as F,E as z,y as E,G,J as s,q as o,n as t,t as p,T as c,A as B,z as _,R as i,j as O,s as h,p as v,o as I,X as H,d as C,L as D,l as R,K as m,m as U,a4 as X,D as Z,Y as K,N as Q,U as W}from"./index-BGcJLCmg.js";import{b as P,e as Y,c as V,a as ee}from"./api-47T1Y5gh.js";import{g as te}from"./squad-colors-B8B_Y-lz.js";import{G as se}from"./git-branch-mIOb5xe9.js";import{T as oe}from"./trash-2-hQUV1Voi.js";import{A as ae}from"./arrow-left-DjWS3Dza.js";/**
1
+ import{r as A,u as J,a3 as F,E as z,y as E,G,J as s,q as o,n as t,t as p,T as c,A as B,z as _,R as i,j as O,s as h,p as v,o as I,X as H,d as C,L as D,l as R,K as m,m as U,a4 as X,D as Z,Y as K,N as Q,U as W}from"./index-DTG9i0yb.js";import{b as P,e as Y,c as V,a as ee}from"./api-CNCnNUBm.js";import{g as te}from"./squad-colors-B8B_Y-lz.js";import{G as se}from"./git-branch-C-Gshlzq.js";import{T as oe}from"./trash-2-C18Ts8VR.js";import{A as ae}from"./arrow-left-BIqDxiwh.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{b as L}from"./api-47T1Y5gh.js";import{r as I,u as T,E as B,J as o,q as n,n as t,t as u,T as l,A as M,s as g,k as _,d as f,L as y,K as v,m as N,z as k,a4 as P,R as a,o as x,p,c as b,N as V}from"./index-BGcJLCmg.js";import{T as w}from"./triangle-alert-48e9MScx.js";import{G as $}from"./git-branch-mIOb5xe9.js";/**
1
+ import{b as L}from"./api-CNCnNUBm.js";import{r as I,u as T,E as B,J as o,q as n,n as t,t as u,T as l,A as M,s as g,k as _,d as f,L as y,K as v,m as N,z as k,a4 as P,R as a,o as x,p,c as b,N as V}from"./index-DTG9i0yb.js";import{T as w}from"./triangle-alert-Bwk0QXXs.js";import{G as $}from"./git-branch-C-Gshlzq.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{b as y}from"./api-47T1Y5gh.js";import{g as v}from"./squad-colors-B8B_Y-lz.js";import{r as h,u as k,E as b,J as o,q as r,n as t,t as i,T as l,k as w,d as L,L as C,K as d,o as S,a4 as N,D as f,N as q,R as n,s as _,p as B}from"./index-BGcJLCmg.js";import{G as V}from"./git-branch-mIOb5xe9.js";/**
1
+ import{b as y}from"./api-CNCnNUBm.js";import{g as v}from"./squad-colors-B8B_Y-lz.js";import{r as h,u as k,E as b,J as o,q as r,n as t,t as i,T as l,k as w,d as L,L as C,K as d,o as S,a4 as N,D as f,N as q,R as n,s as _,p as B}from"./index-DTG9i0yb.js";import{G as V}from"./git-branch-C-Gshlzq.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{u as t,J as s,q as r,z as l,n as d}from"./index-BGcJLCmg.js";const u=["aria-label","aria-checked","disabled"],m=t({__name:"ToggleSwitch",props:{modelValue:{type:Boolean},ariaLabel:{default:"Toggle"},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:o}){const a=e,i=o;function n(){a.disabled||i("update:modelValue",!a.modelValue)}return(c,b)=>(s(),r("button",{type:"button",role:"switch","aria-label":e.ariaLabel,"aria-checked":e.modelValue,disabled:e.disabled,class:l(["inline-flex h-6 w-10 shrink-0 items-center rounded-full border border-border p-0.5 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e.modelValue?"bg-gradient-brand shadow-[0_0_0_1px_rgba(228,58,156,0.35)]":"bg-muted"]),onClick:n},[d("span",{class:l(["pointer-events-none h-4 w-4 rounded-full bg-white shadow-sm ring-1 ring-black/10 transition-transform duration-200",e.modelValue?"translate-x-5":"translate-x-0"])},null,2)],10,u))}});export{m as _};
1
+ import{u as t,J as s,q as r,z as l,n as d}from"./index-DTG9i0yb.js";const u=["aria-label","aria-checked","disabled"],m=t({__name:"ToggleSwitch",props:{modelValue:{type:Boolean},ariaLabel:{default:"Toggle"},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:o}){const a=e,i=o;function n(){a.disabled||i("update:modelValue",!a.modelValue)}return(c,b)=>(s(),r("button",{type:"button",role:"switch","aria-label":e.ariaLabel,"aria-checked":e.modelValue,disabled:e.disabled,class:l(["inline-flex h-6 w-10 shrink-0 items-center rounded-full border border-border p-0.5 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e.modelValue?"bg-gradient-brand shadow-[0_0_0_1px_rgba(228,58,156,0.35)]":"bg-muted"]),onClick:n},[d("span",{class:l(["pointer-events-none h-4 w-4 rounded-full bg-white shadow-sm ring-1 ring-black/10 transition-transform duration-200",e.modelValue?"translate-x-5":"translate-x-0"])},null,2)],10,u))}});export{m as _};
@@ -1,4 +1,4 @@
1
- import{r as L,u as j,E as Q,J as d,q as r,n as t,t as _,T as k,C as W,d as i,L as m,s as w,R as o,k as X,p as u,a5 as F,a1 as O,K as a,z as Y,D as Z,m as tt}from"./index-BGcJLCmg.js";import{b as T,d as q}from"./api-47T1Y5gh.js";import{T as et}from"./triangle-alert-48e9MScx.js";/**
1
+ import{r as L,u as j,E as Q,J as d,q as r,n as t,t as _,T as k,C as W,d as i,L as m,s as w,R as o,k as X,p as u,a5 as F,a1 as O,K as a,z as Y,D as Z,m as tt}from"./index-DTG9i0yb.js";import{b as T,d as q}from"./api-CNCnNUBm.js";import{T as et}from"./triangle-alert-Bwk0QXXs.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{r as j,u as se,a3 as oe,J as o,q as a,d as b,L as K,m as A,n as t,o as I,T as d,a as ce,t as v,F as ve,R as N,D as pe,z,a7 as fe,p as B,K as c,E as me,B as H,s as S,a5 as V,a1 as L,a6 as R,X as Z,l as G}from"./index-BGcJLCmg.js";import{b as T,d as E,a as J}from"./api-47T1Y5gh.js";import{S as xe}from"./search-bl71fr1B.js";import{P as O}from"./plus-bVg6pl4_.js";import{P as X,S as Y}from"./save-Ca__Dc6q.js";import{T as ee}from"./trash-2-hQUV1Voi.js";/**
1
+ import{r as j,u as se,a3 as oe,J as o,q as a,d as b,L as K,m as A,n as t,o as I,T as d,a as ce,t as v,F as ve,R as N,D as pe,z,a7 as fe,p as B,K as c,E as me,B as H,s as S,a5 as V,a1 as L,a6 as R,X as Z,l as G}from"./index-DTG9i0yb.js";import{b as T,d as E,a as J}from"./api-CNCnNUBm.js";import{S as xe}from"./search-CGQarBXi.js";import{P as O}from"./plus-DLjbplkx.js";import{P as X,S as Y}from"./save-DQWKjWH3.js";import{T as ee}from"./trash-2-C18Ts8VR.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{V as i,O as c}from"./index-BGcJLCmg.js";const o="/api";function u(t){try{return JSON.parse(atob(t.split(".")[1])).exp*1e3<=Date.now()+6e4}catch{return!0}}async function n(){const t=i(),e={"Content-Type":"application/json"};return t.token&&u(t.token)&&await t.refreshToken(),t.token&&(e.Authorization=`Bearer ${t.token}`),e}async function s(t,e){if(t.status===401){const r=i();try{if(await r.refreshToken(),r.token){const a=await e();if(a.status===401)throw r.logout(),c.push("/login"),new Error("Session expired");return a}}catch{}throw r.logout(),c.push("/login"),new Error("Session expired")}return t}async function w(t){const e=await s(await fetch(`${o}${t}`,{headers:await n()}),async()=>fetch(`${o}${t}`,{headers:await n()}));if(!e.ok)throw new Error(`API error: ${e.status}`);return e.json()}async function f(t,e){const r={method:"POST",headers:await n(),body:e?JSON.stringify(e):void 0},a=await s(await fetch(`${o}${t}`,r),async()=>fetch(`${o}${t}`,{...r,headers:await n()}));if(!a.ok)throw new Error(`API error: ${a.status}`);return a.json()}async function $(t,e){const r={method:"PUT",headers:await n(),body:e?JSON.stringify(e):void 0},a=await s(await fetch(`${o}${t}`,r),async()=>fetch(`${o}${t}`,{...r,headers:await n()}));if(!a.ok)throw new Error(`API error: ${a.status}`);return a.json()}async function d(t){const e={method:"DELETE",headers:await n()},r=await s(await fetch(`${o}${t}`,e),async()=>fetch(`${o}${t}`,{...e,headers:await n()}));if(!r.ok)throw new Error(`API error: ${r.status}`);return r.json()}function p(){const t=i(),e=`${o}/stream?token=${t.token??""}`;return new EventSource(e)}export{d as a,w as b,f as c,$ as d,p as e};
1
+ import{V as i,O as c}from"./index-DTG9i0yb.js";const o="/api";function u(t){try{return JSON.parse(atob(t.split(".")[1])).exp*1e3<=Date.now()+6e4}catch{return!0}}async function n(){const t=i(),e={"Content-Type":"application/json"};return t.token&&u(t.token)&&await t.refreshToken(),t.token&&(e.Authorization=`Bearer ${t.token}`),e}async function s(t,e){if(t.status===401){const r=i();try{if(await r.refreshToken(),r.token){const a=await e();if(a.status===401)throw r.logout(),c.push("/login"),new Error("Session expired");return a}}catch{}throw r.logout(),c.push("/login"),new Error("Session expired")}return t}async function w(t){const e=await s(await fetch(`${o}${t}`,{headers:await n()}),async()=>fetch(`${o}${t}`,{headers:await n()}));if(!e.ok)throw new Error(`API error: ${e.status}`);return e.json()}async function f(t,e){const r={method:"POST",headers:await n(),body:e?JSON.stringify(e):void 0},a=await s(await fetch(`${o}${t}`,r),async()=>fetch(`${o}${t}`,{...r,headers:await n()}));if(!a.ok)throw new Error(`API error: ${a.status}`);return a.json()}async function $(t,e){const r={method:"PUT",headers:await n(),body:e?JSON.stringify(e):void 0},a=await s(await fetch(`${o}${t}`,r),async()=>fetch(`${o}${t}`,{...r,headers:await n()}));if(!a.ok)throw new Error(`API error: ${a.status}`);return a.json()}async function d(t){const e={method:"DELETE",headers:await n()},r=await s(await fetch(`${o}${t}`,e),async()=>fetch(`${o}${t}`,{...e,headers:await n()}));if(!r.ok)throw new Error(`API error: ${r.status}`);return r.json()}function p(){const t=i(),e=`${o}/stream?token=${t.token??""}`;return new EventSource(e)}export{d as a,w as b,f as c,$ as d,p as e};
@@ -1,4 +1,4 @@
1
- import{r}from"./index-BGcJLCmg.js";/**
1
+ import{r}from"./index-DTG9i0yb.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{r as c}from"./index-BGcJLCmg.js";/**
1
+ import{r as c}from"./index-DTG9i0yb.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SquadsView-BfI7gXGL.js","assets/api-47T1Y5gh.js","assets/squad-colors-B8B_Y-lz.js","assets/git-branch-mIOb5xe9.js","assets/SquadHealthView-CcfjWCOh.js","assets/triangle-alert-48e9MScx.js","assets/SquadDetailView-CBAJi3oS.js","assets/trash-2-hQUV1Voi.js","assets/arrow-left-DjWS3Dza.js","assets/FeedView-CLT5n92b.js","assets/SkillsView-lRD1oRGj.js","assets/plus-bVg6pl4_.js","assets/search-bl71fr1B.js","assets/save-Ca__Dc6q.js","assets/McpView-NESAwdjb.js","assets/ToggleSwitch.vue_vue_type_script_setup_true_lang-CDuXZZzC.js","assets/SchedulesView-D2d4EW4s.js","assets/HistoryView-ChVrABKZ.js","assets/WikiView-Cqn_mgy2.js","assets/UsageView-DE3mx0K2.js","assets/AuditLogView-CQ0_fNNC.js","assets/SettingsView-qrLa06kS.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SquadsView-3suUmJxg.js","assets/api-CNCnNUBm.js","assets/squad-colors-B8B_Y-lz.js","assets/git-branch-C-Gshlzq.js","assets/SquadHealthView-CqS5Vhsm.js","assets/triangle-alert-Bwk0QXXs.js","assets/SquadDetailView-BiSr7NNt.js","assets/trash-2-C18Ts8VR.js","assets/arrow-left-BIqDxiwh.js","assets/FeedView-CXPnEP-A.js","assets/SkillsView-BgeVT0OC.js","assets/plus-DLjbplkx.js","assets/search-CGQarBXi.js","assets/save-DQWKjWH3.js","assets/McpView-BIOYWxmY.js","assets/ToggleSwitch.vue_vue_type_script_setup_true_lang-ucLsqy4u.js","assets/SchedulesView-DobGlhXT.js","assets/HistoryView-gb-ZMOIr.js","assets/WikiView-B1q8HTSC.js","assets/UsageView-CEP6E-Uz.js","assets/AuditLogView-C0IC1aC6.js","assets/SettingsView-BiU4DiWX.js"])))=>i.map(i=>d[i]);
2
2
  var lh=Object.defineProperty;var ch=(t,e,r)=>e in t?lh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var me=(t,e,r)=>ch(t,typeof e!="symbol"?e+"":e,r);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();const uh="modulepreload",hh=function(t){return"/"+t},Go={},ze=function(e,r,n){let s=Promise.resolve();if(r&&r.length>0){let o=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));s=o(r.map(c=>{if(c=hh(c),c in Go)return;Go[c]=!0;const u=c.endsWith(".css"),h=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${h}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":uh,u||(d.as="script"),d.crossOrigin="",d.href=c,l&&d.setAttribute("nonce",l),document.head.appendChild(d),u)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return e().catch(i)})};/**
3
3
  * @vue/shared v3.5.34
4
4
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
@@ -177,7 +177,7 @@ var lh=Object.defineProperty;var ch=(t,e,r)=>e in t?lh(t,e,{enumerable:!0,config
177
177
  *
178
178
  * This source code is licensed under the ISC license.
179
179
  * See the LICENSE file in the root directory of this source tree.
180
- */const Ig=we("XIcon",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),$g={key:0,class:"font-display text-[1.1rem] font-normal uppercase tracking-[0.18em] bg-gradient-brand bg-clip-text text-transparent"},jg=["title"],Ng={class:"flex-1 p-2 space-y-0.5 overflow-y-auto"},Lg={key:0},Dg={class:"border-t border-border p-2 space-y-0.5"},Ug={key:0},Bg=["href"],nl="https://github.com/michaeljolley/io",Mg=fr({__name:"AppSidebar",setup(t){const e=$o(),r=Re(!1),n=[{name:"History",icon:yg,path:"/history"},{name:"Squads",icon:Pg,path:"/squads"},{name:"Health",icon:ug,path:"/squads/health"},{name:"Usage",icon:dg,path:"/usage"},{name:"Audit Log",icon:pg,path:"/audit-log"},{name:"Skills",icon:Tg,path:"/skills"},{name:"MCP Servers",icon:xg,path:"/mcp"},{name:"Schedules",icon:gg,path:"/schedules"},{name:"Wiki",icon:hg,path:"/wiki"}],s=[{name:"Chat",icon:_g,path:"/"},{name:"Feed",icon:Eu,path:"/feed"},{name:"Settings",icon:Rg,path:"/settings"}],i="1.7.3",o=Ne(()=>{let l="";const c=[...n,...s];for(const u of c){const h=u.path;(h==="/"?e.path==="/":e.path===h||e.path.startsWith(h+"/"))&&h.length>l.length&&(l=h)}return l});function a(){r.value=!r.value}return(l,c)=>{const u=Ao("router-link");return se(),ce("aside",{class:Ge(["border-r border-border bg-sidebar flex flex-col h-full shrink-0 transition-all duration-200",r.value?"w-16":"w-56"])},[Q("div",{class:Ge(["p-3 border-b border-border flex items-center",r.value?"justify-center":"justify-between"])},[le(u,{to:"/",class:Ge(["flex items-center gap-2",r.value?"justify-center":""])},{default:Jr(()=>[le(ag,{size:24}),r.value?je("",!0):(se(),ce("h1",$g,"IO"))]),_:1},8,["class"]),r.value?je("",!0):(se(),ce("button",{key:0,onClick:a,class:"p-1 rounded-full hover:bg-accent/70 text-muted-foreground hover:text-foreground transition-colors",title:r.value?"Expand sidebar":"Collapse sidebar"},[le(re(kg),{class:"w-4 h-4"})],8,jg))],2),r.value?(se(),ce("button",{key:0,onClick:a,class:"mx-auto mt-2 p-1.5 rounded-full hover:bg-accent/70 text-muted-foreground hover:text-foreground transition-colors",title:"Expand sidebar"},[le(re(Sg),{class:"w-4 h-4"})])):je("",!0),Q("nav",Ng,[(se(),ce(Fe,null,Tn(n,h=>le(u,{key:h.path,to:h.path,class:Ge(["flex items-center gap-3 rounded-full text-sm transition-colors border border-transparent",[r.value?"justify-center px-2 py-2":"px-3 py-2",o.value===h.path?"bg-accent text-accent-foreground font-medium border border-white/10":"text-muted-foreground hover:bg-white/5 hover:text-foreground"]]),title:r.value?h.name:void 0},{default:Jr(()=>[(se(),st(na(h.icon),{class:"w-4 h-4 shrink-0"})),r.value?je("",!0):(se(),ce("span",Lg,rt(h.name),1))]),_:2},1032,["to","class","title"])),64))]),Q("div",Dg,[(se(),ce(Fe,null,Tn(s,h=>le(u,{key:h.path,to:h.path,class:Ge(["flex items-center gap-3 rounded-full text-sm transition-colors border border-transparent",[r.value?"justify-center px-2 py-2":"px-3 py-2",o.value===h.path?"bg-accent text-accent-foreground font-medium border border-white/10":"text-muted-foreground hover:bg-white/5 hover:text-foreground"]]),title:r.value?h.name:void 0},{default:Jr(()=>[(se(),st(na(h.icon),{class:"w-4 h-4 shrink-0"})),r.value?je("",!0):(se(),ce("span",Ug,rt(h.name),1))]),_:2},1032,["to","class","title"])),64)),Q("div",{class:Ge(["flex items-center pt-2 mt-2 border-t border-border",r.value?"justify-center":"justify-between px-3"])},[r.value?je("",!0):(se(),ce("a",{key:0,href:`${nl}/releases/tag/v${re(i)}`,target:"_blank",class:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",title:"Release notes"}," v"+rt(re(i)),9,Bg)),Q("a",{href:nl,target:"_blank",class:"p-1 rounded-full hover:bg-accent/70 text-muted-foreground hover:text-foreground transition-colors",title:"GitHub repository"},[le(re(mg),{class:"w-3.5 h-3.5"})])],2)])],2)}}});function ni(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function Hg(t,e,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function a(u){try{c(n.next(u))}catch(h){o(h)}}function l(u){try{c(n.throw(u))}catch(h){o(h)}}function c(u){u.done?i(u.value):s(u.value).then(a,l)}c((n=n.apply(t,e||[])).next())})}const qg=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class jo extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class Fg extends jo{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class sl extends jo{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class il extends jo{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Yi;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(Yi||(Yi={}));class Vg{constructor(e,{headers:r={},customFetch:n,region:s=Yi.Any}={}){this.url=e,this.headers=r,this.region=s,this.fetch=qg(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return Hg(this,arguments,void 0,function*(r,n={}){var s;let i,o;try{const{headers:a,method:l,body:c,signal:u,timeout:h}=n;let d={},{region:f}=n;f||(f=this.region);const p=new URL(`${this.url}/${r}`);f&&f!=="any"&&(d["x-region"]=f,p.searchParams.set("forceFunctionRegion",f));let y;c&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(d["Content-Type"]="application/octet-stream",y=c):typeof c=="string"?(d["Content-Type"]="text/plain",y=c):typeof FormData<"u"&&c instanceof FormData?y=c:(d["Content-Type"]="application/json",y=JSON.stringify(c)):c&&typeof c!="string"&&!(typeof Blob<"u"&&c instanceof Blob)&&!(c instanceof ArrayBuffer)&&!(typeof FormData<"u"&&c instanceof FormData)?y=JSON.stringify(c):y=c;let w=u;h&&(o=new AbortController,i=setTimeout(()=>o.abort(),h),u?(w=o.signal,u.addEventListener("abort",()=>o.abort())):w=o.signal);const k=yield this.fetch(p.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},d),this.headers),a),body:y,signal:w}).catch(U=>{throw new Fg(U)}),_=k.headers.get("x-relay-error");if(_&&_==="true")throw new sl(k);if(!k.ok)throw new il(k);let b=((s=k.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),A;return b==="application/json"?A=yield k.json():b==="application/octet-stream"||b==="application/pdf"?A=yield k.blob():b==="text/event-stream"?A=k:b==="multipart/form-data"?A=yield k.formData():A=yield k.text(),{data:A,error:null,response:k}}catch(a){return{data:null,error:a,response:a instanceof il||a instanceof sl?a.context:void 0}}finally{i&&clearTimeout(i)}})}}const Tu=3,ol=t=>Math.min(1e3*2**t,3e4),zg=[520,503],Au=["GET","HEAD","OPTIONS"];var Wg=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function al(t,e){return new Promise(r=>{if(e!=null&&e.aborted){r();return}const n=setTimeout(()=>{e==null||e.removeEventListener("abort",s),r()},t);function s(){clearTimeout(n),r()}e==null||e.addEventListener("abort",s)})}function Kg(t,e,r,n){return!(!n||r>=Tu||!Au.includes(t)||!zg.includes(e))}var Gg=class{constructor(t){var e,r,n,s,i;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(r=t.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(n=t.shouldStripNulls)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(s=t.urlLengthLimit)!==null&&s!==void 0?s:8e3,this.retryEnabled=(i=t.retry)!==null&&i!==void 0?i:!0,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}retry(t){return this.retryEnabled=t,this}then(t,e){var r=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const o=this.headers.get("Accept");o==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!o||o==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const n=this.fetch;let i=(async()=>{let o=0;for(;;){const c=new Headers(r.headers);o>0&&c.set("X-Retry-Count",String(o));let u;try{u=await n(r.url.toString(),{method:r.method,headers:c,body:JSON.stringify(r.body,(h,d)=>typeof d=="bigint"?d.toString():d),signal:r.signal})}catch(h){if((h==null?void 0:h.name)==="AbortError"||(h==null?void 0:h.code)==="ABORT_ERR"||!Au.includes(r.method))throw h;if(r.retryEnabled&&o<Tu){const d=ol(o);o++,await al(d,r.signal);continue}throw h}if(Kg(r.method,u.status,o,r.retryEnabled)){var a,l;const h=(a=(l=u.headers)===null||l===void 0?void 0:l.get("Retry-After"))!==null&&a!==void 0?a:null,d=h!==null?Math.max(0,parseInt(h,10)||0)*1e3:ol(o);await u.text(),o++,await al(d,r.signal);continue}return await r.processResponse(u)}})();return this.shouldThrowOnError||(i=i.catch(o=>{var a;let l="",c="",u="";const h=o==null?void 0:o.cause;if(h){var d,f,p,y;const _=(d=h==null?void 0:h.message)!==null&&d!==void 0?d:"",b=(f=h==null?void 0:h.code)!==null&&f!==void 0?f:"";l=`${(p=o==null?void 0:o.name)!==null&&p!==void 0?p:"FetchError"}: ${o==null?void 0:o.message}`,l+=`
180
+ */const Ig=we("XIcon",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),$g={key:0,class:"font-display text-[1.1rem] font-normal uppercase tracking-[0.18em] bg-gradient-brand bg-clip-text text-transparent"},jg=["title"],Ng={class:"flex-1 p-2 space-y-0.5 overflow-y-auto"},Lg={key:0},Dg={class:"border-t border-border p-2 space-y-0.5"},Ug={key:0},Bg=["href"],nl="https://github.com/michaeljolley/io",Mg=fr({__name:"AppSidebar",setup(t){const e=$o(),r=Re(!1),n=[{name:"History",icon:yg,path:"/history"},{name:"Squads",icon:Pg,path:"/squads"},{name:"Health",icon:ug,path:"/squads/health"},{name:"Usage",icon:dg,path:"/usage"},{name:"Audit Log",icon:pg,path:"/audit-log"},{name:"Skills",icon:Tg,path:"/skills"},{name:"MCP Servers",icon:xg,path:"/mcp"},{name:"Schedules",icon:gg,path:"/schedules"},{name:"Wiki",icon:hg,path:"/wiki"}],s=[{name:"Chat",icon:_g,path:"/"},{name:"Feed",icon:Eu,path:"/feed"},{name:"Settings",icon:Rg,path:"/settings"}],i="1.8.0",o=Ne(()=>{let l="";const c=[...n,...s];for(const u of c){const h=u.path;(h==="/"?e.path==="/":e.path===h||e.path.startsWith(h+"/"))&&h.length>l.length&&(l=h)}return l});function a(){r.value=!r.value}return(l,c)=>{const u=Ao("router-link");return se(),ce("aside",{class:Ge(["border-r border-border bg-sidebar flex flex-col h-full shrink-0 transition-all duration-200",r.value?"w-16":"w-56"])},[Q("div",{class:Ge(["p-3 border-b border-border flex items-center",r.value?"justify-center":"justify-between"])},[le(u,{to:"/",class:Ge(["flex items-center gap-2",r.value?"justify-center":""])},{default:Jr(()=>[le(ag,{size:24}),r.value?je("",!0):(se(),ce("h1",$g,"IO"))]),_:1},8,["class"]),r.value?je("",!0):(se(),ce("button",{key:0,onClick:a,class:"p-1 rounded-full hover:bg-accent/70 text-muted-foreground hover:text-foreground transition-colors",title:r.value?"Expand sidebar":"Collapse sidebar"},[le(re(kg),{class:"w-4 h-4"})],8,jg))],2),r.value?(se(),ce("button",{key:0,onClick:a,class:"mx-auto mt-2 p-1.5 rounded-full hover:bg-accent/70 text-muted-foreground hover:text-foreground transition-colors",title:"Expand sidebar"},[le(re(Sg),{class:"w-4 h-4"})])):je("",!0),Q("nav",Ng,[(se(),ce(Fe,null,Tn(n,h=>le(u,{key:h.path,to:h.path,class:Ge(["flex items-center gap-3 rounded-full text-sm transition-colors border border-transparent",[r.value?"justify-center px-2 py-2":"px-3 py-2",o.value===h.path?"bg-accent text-accent-foreground font-medium border border-white/10":"text-muted-foreground hover:bg-white/5 hover:text-foreground"]]),title:r.value?h.name:void 0},{default:Jr(()=>[(se(),st(na(h.icon),{class:"w-4 h-4 shrink-0"})),r.value?je("",!0):(se(),ce("span",Lg,rt(h.name),1))]),_:2},1032,["to","class","title"])),64))]),Q("div",Dg,[(se(),ce(Fe,null,Tn(s,h=>le(u,{key:h.path,to:h.path,class:Ge(["flex items-center gap-3 rounded-full text-sm transition-colors border border-transparent",[r.value?"justify-center px-2 py-2":"px-3 py-2",o.value===h.path?"bg-accent text-accent-foreground font-medium border border-white/10":"text-muted-foreground hover:bg-white/5 hover:text-foreground"]]),title:r.value?h.name:void 0},{default:Jr(()=>[(se(),st(na(h.icon),{class:"w-4 h-4 shrink-0"})),r.value?je("",!0):(se(),ce("span",Ug,rt(h.name),1))]),_:2},1032,["to","class","title"])),64)),Q("div",{class:Ge(["flex items-center pt-2 mt-2 border-t border-border",r.value?"justify-center":"justify-between px-3"])},[r.value?je("",!0):(se(),ce("a",{key:0,href:`${nl}/releases/tag/v${re(i)}`,target:"_blank",class:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",title:"Release notes"}," v"+rt(re(i)),9,Bg)),Q("a",{href:nl,target:"_blank",class:"p-1 rounded-full hover:bg-accent/70 text-muted-foreground hover:text-foreground transition-colors",title:"GitHub repository"},[le(re(mg),{class:"w-3.5 h-3.5"})])],2)])],2)}}});function ni(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function Hg(t,e,r,n){function s(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function a(u){try{c(n.next(u))}catch(h){o(h)}}function l(u){try{c(n.throw(u))}catch(h){o(h)}}function c(u){u.done?i(u.value):s(u.value).then(a,l)}c((n=n.apply(t,e||[])).next())})}const qg=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class jo extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class Fg extends jo{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class sl extends jo{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class il extends jo{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Yi;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(Yi||(Yi={}));class Vg{constructor(e,{headers:r={},customFetch:n,region:s=Yi.Any}={}){this.url=e,this.headers=r,this.region=s,this.fetch=qg(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return Hg(this,arguments,void 0,function*(r,n={}){var s;let i,o;try{const{headers:a,method:l,body:c,signal:u,timeout:h}=n;let d={},{region:f}=n;f||(f=this.region);const p=new URL(`${this.url}/${r}`);f&&f!=="any"&&(d["x-region"]=f,p.searchParams.set("forceFunctionRegion",f));let y;c&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(d["Content-Type"]="application/octet-stream",y=c):typeof c=="string"?(d["Content-Type"]="text/plain",y=c):typeof FormData<"u"&&c instanceof FormData?y=c:(d["Content-Type"]="application/json",y=JSON.stringify(c)):c&&typeof c!="string"&&!(typeof Blob<"u"&&c instanceof Blob)&&!(c instanceof ArrayBuffer)&&!(typeof FormData<"u"&&c instanceof FormData)?y=JSON.stringify(c):y=c;let w=u;h&&(o=new AbortController,i=setTimeout(()=>o.abort(),h),u?(w=o.signal,u.addEventListener("abort",()=>o.abort())):w=o.signal);const k=yield this.fetch(p.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},d),this.headers),a),body:y,signal:w}).catch(U=>{throw new Fg(U)}),_=k.headers.get("x-relay-error");if(_&&_==="true")throw new sl(k);if(!k.ok)throw new il(k);let b=((s=k.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),A;return b==="application/json"?A=yield k.json():b==="application/octet-stream"||b==="application/pdf"?A=yield k.blob():b==="text/event-stream"?A=k:b==="multipart/form-data"?A=yield k.formData():A=yield k.text(),{data:A,error:null,response:k}}catch(a){return{data:null,error:a,response:a instanceof il||a instanceof sl?a.context:void 0}}finally{i&&clearTimeout(i)}})}}const Tu=3,ol=t=>Math.min(1e3*2**t,3e4),zg=[520,503],Au=["GET","HEAD","OPTIONS"];var Wg=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function al(t,e){return new Promise(r=>{if(e!=null&&e.aborted){r();return}const n=setTimeout(()=>{e==null||e.removeEventListener("abort",s),r()},t);function s(){clearTimeout(n),r()}e==null||e.addEventListener("abort",s)})}function Kg(t,e,r,n){return!(!n||r>=Tu||!Au.includes(t)||!zg.includes(e))}var Gg=class{constructor(t){var e,r,n,s,i;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(r=t.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(n=t.shouldStripNulls)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(s=t.urlLengthLimit)!==null&&s!==void 0?s:8e3,this.retryEnabled=(i=t.retry)!==null&&i!==void 0?i:!0,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}retry(t){return this.retryEnabled=t,this}then(t,e){var r=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const o=this.headers.get("Accept");o==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!o||o==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const n=this.fetch;let i=(async()=>{let o=0;for(;;){const c=new Headers(r.headers);o>0&&c.set("X-Retry-Count",String(o));let u;try{u=await n(r.url.toString(),{method:r.method,headers:c,body:JSON.stringify(r.body,(h,d)=>typeof d=="bigint"?d.toString():d),signal:r.signal})}catch(h){if((h==null?void 0:h.name)==="AbortError"||(h==null?void 0:h.code)==="ABORT_ERR"||!Au.includes(r.method))throw h;if(r.retryEnabled&&o<Tu){const d=ol(o);o++,await al(d,r.signal);continue}throw h}if(Kg(r.method,u.status,o,r.retryEnabled)){var a,l;const h=(a=(l=u.headers)===null||l===void 0?void 0:l.get("Retry-After"))!==null&&a!==void 0?a:null,d=h!==null?Math.max(0,parseInt(h,10)||0)*1e3:ol(o);await u.text(),o++,await al(d,r.signal);continue}return await r.processResponse(u)}})();return this.shouldThrowOnError||(i=i.catch(o=>{var a;let l="",c="",u="";const h=o==null?void 0:o.cause;if(h){var d,f,p,y;const _=(d=h==null?void 0:h.message)!==null&&d!==void 0?d:"",b=(f=h==null?void 0:h.code)!==null&&f!==void 0?f:"";l=`${(p=o==null?void 0:o.name)!==null&&p!==void 0?p:"FetchError"}: ${o==null?void 0:o.message}`,l+=`
181
181
 
182
182
  Caused by: ${(y=h==null?void 0:h.name)!==null&&y!==void 0?y:"Error"}: ${_}`,b&&(l+=` (${b})`),h!=null&&h.stack&&(l+=`
183
183
  ${h.stack}`)}else{var w;l=(w=o==null?void 0:o.stack)!==null&&w!==void 0?w:""}const k=this.url.toString().length;return(o==null?void 0:o.name)==="AbortError"||(o==null?void 0:o.code)==="ABORT_ERR"?(u="",c="Request was aborted (timeout or manual cancellation)",k>this.urlLengthLimit&&(c+=`. Note: Your request URL is ${k} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((h==null?void 0:h.name)==="HeadersOverflowError"||(h==null?void 0:h.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",c="HTTP headers exceeded server limits (typically 16KB)",k>this.urlLengthLimit&&(c+=`. Your request URL is ${k} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(a=o==null?void 0:o.name)!==null&&a!==void 0?a:"FetchError"}: ${o==null?void 0:o.message}`,details:l,hint:c,code:u},data:null,count:null,status:0,statusText:""}})),i.then(t,e)}async processResponse(t){var e=this;let r=null,n=null,s=null,i=t.status,o=t.statusText;if(t.ok){var a,l;if(e.method!=="HEAD"){var c;const d=await t.text();d===""||(e.headers.get("Accept")==="text/csv"||e.headers.get("Accept")&&(!((c=e.headers.get("Accept"))===null||c===void 0)&&c.includes("application/vnd.pgrst.plan+text"))?n=d:n=JSON.parse(d))}const u=(a=e.headers.get("Prefer"))===null||a===void 0?void 0:a.match(/count=(exact|planned|estimated)/),h=(l=t.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");u&&h&&h.length>1&&(s=parseInt(h[1])),e.isMaybeSingle&&Array.isArray(n)&&(n.length>1?(r={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,s=null,i=406,o="Not Acceptable"):n.length===1?n=n[0]:n=null)}else{const u=await t.text();try{r=JSON.parse(u),Array.isArray(r)&&t.status===404&&(n=[],r=null,i=200,o="OK")}catch{t.status===404&&u===""?(i=204,o="No Content"):r={message:u}}if(r&&e.shouldThrowOnError)throw new Wg(r)}return{success:r===null,error:r,data:n,count:s,status:i,statusText:o}}returns(){return this}overrideTypes(){return this}},Jg=class extends Gg{select(t){let e=!1;const r=(t??"*").split("").map(n=>/\s/.test(n)&&!e?"":(n==='"'&&(e=!e),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:r,foreignTable:n,referencedTable:s=n}={}){const i=s?`${s}.order`:"order",o=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${o?`${o},`:""}${t}.${e?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:r=e}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${t}`),this}range(t,e,{foreignTable:r,referencedTable:n=r}={}){const s=typeof n>"u"?"offset":`${n}.offset`,i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${t}`),this.url.searchParams.set(i,`${e-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:t=!1,verbose:e=!1,settings:r=!1,buffers:n=!1,wal:s=!1,format:i="text"}={}){var o;const a=[t?"analyze":null,e?"verbose":null,r?"settings":null,n?"buffers":null,s?"wal":null].filter(Boolean).join("|"),l=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${l}"; options=${a};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};const ll=new RegExp("[,()]");var Hr=class extends Jg{eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&ll.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}notIn(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&ll.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`not.in.(${r})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:r,type:n}={}){let s="";n==="plain"?s="pl":n==="phrase"?s="ph":n==="websearch"&&(s="w");const i=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${s}fts${i}.${e}`),this}match(t){return Object.entries(t).filter(([e,r])=>r!==void 0).forEach(([e,r])=>{this.url.searchParams.append(e,`eq.${r}`)}),this}not(t,e,r){return this.url.searchParams.append(t,`not.${e}.${r}`),this}or(t,{foreignTable:e,referencedTable:r=e}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${t})`),this}filter(t,e,r){return this.url.searchParams.append(t,`${e}.${r}`),this}},Yg=class{constructor(t,{headers:e={},schema:r,fetch:n,urlLengthLimit:s=8e3,retry:i}){this.url=t,this.headers=new Headers(e),this.schema=r,this.fetch=n,this.urlLengthLimit=s,this.retry=i}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){const{head:r=!1,count:n}=e??{},s=r?"HEAD":"GET";let i=!1;const o=(t??"*").split("").map(c=>/\s/.test(c)&&!i?"":(c==='"'&&(i=!i),c)).join(""),{url:a,headers:l}=this.cloneRequestState();return a.searchParams.set("select",o),n&&l.append("Prefer",`count=${n}`),new Hr({method:s,url:a,headers:l,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(t,{count:e,defaultToNull:r=!0}={}){var n;const s="POST",{url:i,headers:o}=this.cloneRequestState();if(e&&o.append("Prefer",`count=${e}`),r||o.append("Prefer","missing=default"),Array.isArray(t)){const a=t.reduce((l,c)=>l.concat(Object.keys(c)),[]);if(a.length>0){const l=[...new Set(a)].map(c=>`"${c}"`);i.searchParams.set("columns",l.join(","))}}return new Hr({method:s,url:i,headers:o,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(t,{onConflict:e,ignoreDuplicates:r=!1,count:n,defaultToNull:s=!0}={}){var i;const o="POST",{url:a,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),e!==void 0&&a.searchParams.set("on_conflict",e),n&&l.append("Prefer",`count=${n}`),s||l.append("Prefer","missing=default"),Array.isArray(t)){const c=t.reduce((u,h)=>u.concat(Object.keys(h)),[]);if(c.length>0){const u=[...new Set(c)].map(h=>`"${h}"`);a.searchParams.set("columns",u.join(","))}}return new Hr({method:o,url:a,headers:l,schema:this.schema,body:t,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(t,{count:e}={}){var r;const n="PATCH",{url:s,headers:i}=this.cloneRequestState();return e&&i.append("Prefer",`count=${e}`),new Hr({method:n,url:s,headers:i,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:t}={}){var e;const r="DELETE",{url:n,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new Hr({method:r,url:n,headers:s,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Fn(t){"@babel/helpers - typeof";return Fn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fn(t)}function Xg(t,e){if(Fn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Fn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zg(t){var e=Xg(t,"string");return Fn(e)=="symbol"?e:e+""}function Qg(t,e,r){return(e=Zg(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cl(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function os(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?cl(Object(r),!0).forEach(function(n){Qg(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):cl(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var em=class xu{constructor(e,{headers:r={},schema:n,fetch:s,timeout:i,urlLengthLimit:o=8e3,retry:a}={}){this.url=e,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=o;const l=s??globalThis.fetch;i!==void 0&&i>0?this.fetch=(c,u)=>{const h=new AbortController,d=setTimeout(()=>h.abort(),i),f=u==null?void 0:u.signal;if(f){if(f.aborted)return clearTimeout(d),l(c,u);const p=()=>{clearTimeout(d),h.abort()};return f.addEventListener("abort",p,{once:!0}),l(c,os(os({},u),{},{signal:h.signal})).finally(()=>{clearTimeout(d),f.removeEventListener("abort",p)})}return l(c,os(os({},u),{},{signal:h.signal})).finally(()=>clearTimeout(d))}:this.fetch=l,this.retry=a}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new Yg(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(e){return new xu(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,r={},{head:n=!1,get:s=!1,count:i}={}){var o;let a;const l=new URL(`${this.url}/rpc/${e}`);let c;const u=f=>f!==null&&typeof f=="object"&&(!Array.isArray(f)||f.some(u)),h=n&&Object.values(r).some(u);h?(a="POST",c=r):n||s?(a=n?"HEAD":"GET",Object.entries(r).filter(([f,p])=>p!==void 0).map(([f,p])=>[f,Array.isArray(p)?`{${p.join(",")}}`:`${p}`]).forEach(([f,p])=>{l.searchParams.append(f,p)})):(a="POST",c=r);const d=new Headers(this.headers);return h?d.set("Prefer",i?`count=${i},return=minimal`:"return=minimal"):i&&d.set("Prefer",`count=${i}`),new Hr({method:a,url:l,headers:d,schema:this.schemaName,body:c,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class tm{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const r=globalThis;if(typeof globalThis<"u"&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};const n=typeof global<"u"?global:void 0;if(n&&typeof n.WebSocket<"u")return{type:"native",wsConstructor:n.WebSocket};if(typeof globalThis<"u"&&typeof r.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&r.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const s=globalThis.process;if(s){const i=s.versions;if(i&&i.node){const o=i.node,a=parseInt(o.replace(/^v/,"").split(".")[0]);return a>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${a} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${a} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
@@ -276,4 +276,4 @@ ${t}</tr>
276
276
  `}tablecell(t){const e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>
277
277
  `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${xt(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:r}){const n=this.parser.parseInline(r),s=Bl(t);if(s===null)return n;t=s;let i='<a href="'+t+'"';return e&&(i+=' title="'+xt(e)+'"'),i+=">"+n+"</a>",i}image({href:t,title:e,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));const s=Bl(t);if(s===null)return xt(r);t=s;let i=`<img src="${t}" alt="${r}"`;return e&&(i+=` title="${xt(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:xt(t.text)}},Vo=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Gt=class ho{constructor(e){me(this,"options");me(this,"renderer");me(this,"textRenderer");this.options=e||Cr,this.options.renderer=this.options.renderer||new Us,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Vo}static parse(e,r){return new ho(r).parse(e)}static parseInline(e,r){return new ho(r).parseInline(e)}parse(e,r=!0){var s,i;let n="";for(let o=0;o<e.length;o++){const a=e[o];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[a.type]){const c=a,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type)){n+=u||"";continue}}const l=a;switch(l.type){case"space":{n+=this.renderer.space(l);continue}case"hr":{n+=this.renderer.hr(l);continue}case"heading":{n+=this.renderer.heading(l);continue}case"code":{n+=this.renderer.code(l);continue}case"table":{n+=this.renderer.table(l);continue}case"blockquote":{n+=this.renderer.blockquote(l);continue}case"list":{n+=this.renderer.list(l);continue}case"html":{n+=this.renderer.html(l);continue}case"paragraph":{n+=this.renderer.paragraph(l);continue}case"text":{let c=l,u=this.renderer.text(c);for(;o+1<e.length&&e[o+1].type==="text";)c=e[++o],u+=`
278
278
  `+this.renderer.text(c);r?n+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):n+=u;continue}default:{const c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return n}parseInline(e,r=this.renderer){var s,i;let n="";for(let o=0;o<e.length;o++){const a=e[o];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[a.type]){const c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){n+=c||"";continue}}const l=a;switch(l.type){case"escape":{n+=r.text(l);break}case"html":{n+=r.html(l);break}case"link":{n+=r.link(l);break}case"image":{n+=r.image(l);break}case"strong":{n+=r.strong(l);break}case"em":{n+=r.em(l);break}case"codespan":{n+=r.codespan(l);break}case"br":{n+=r.br(l);break}case"del":{n+=r.del(l);break}case"text":{n+=r.text(l);break}default:{const c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return n}},Ii,_s=(Ii=class{constructor(t){me(this,"options");me(this,"block");this.options=t||Cr}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Kt.lex:Kt.lexInline}provideParser(){return this.block?Gt.parse:Gt.parseInline}},me(Ii,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Ii),Pb=class{constructor(...t){me(this,"defaults",Lo());me(this,"options",this.setOptions);me(this,"parse",this.parseMarkdown(!0));me(this,"parseInline",this.parseMarkdown(!1));me(this,"Parser",Gt);me(this,"Renderer",Us);me(this,"TextRenderer",Vo);me(this,"Lexer",Kt);me(this,"Tokenizer",Ds);me(this,"Hooks",_s);this.use(...t)}walkTokens(t,e){var n,s;let r=[];for(const i of t)switch(r=r.concat(e.call(this,i)),i.type){case"table":{const o=i;for(const a of o.header)r=r.concat(this.walkTokens(a.tokens,e));for(const a of o.rows)for(const l of a)r=r.concat(this.walkTokens(l.tokens,e));break}case"list":{const o=i;r=r.concat(this.walkTokens(o.items,e));break}default:{const o=i;(s=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&s[o.type]?this.defaults.extensions.childTokens[o.type].forEach(a=>{const l=o[a].flat(1/0);r=r.concat(this.walkTokens(l,e))}):o.tokens&&(r=r.concat(this.walkTokens(o.tokens,e)))}}return r}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{const n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const i=e.renderers[s.name];i?e.renderers[s.name]=function(...o){let a=s.renderer.apply(this,o);return a===!1&&(a=i.apply(this,o)),a}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=e[s.level];i?i.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),n.extensions=e),r.renderer){const s=this.defaults.renderer||new Us(this.defaults);for(const i in r.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const o=i,a=r.renderer[o],l=s[o];s[o]=(...c)=>{let u=a.apply(s,c);return u===!1&&(u=l.apply(s,c)),u||""}}n.renderer=s}if(r.tokenizer){const s=this.defaults.tokenizer||new Ds(this.defaults);for(const i in r.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const o=i,a=r.tokenizer[o],l=s[o];s[o]=(...c)=>{let u=a.apply(s,c);return u===!1&&(u=l.apply(s,c)),u}}n.tokenizer=s}if(r.hooks){const s=this.defaults.hooks||new _s;for(const i in r.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const o=i,a=r.hooks[o],l=s[o];_s.passThroughHooks.has(i)?s[o]=c=>{if(this.defaults.async)return Promise.resolve(a.call(s,c)).then(h=>l.call(s,h));const u=a.call(s,c);return l.call(s,u)}:s[o]=(...c)=>{let u=a.apply(s,c);return u===!1&&(u=l.apply(s,c)),u}}n.hooks=s}if(r.walkTokens){const s=this.defaults.walkTokens,i=r.walkTokens;n.walkTokens=function(o){let a=[];return a.push(i.call(this,o)),s&&(a=a.concat(s.call(this,o))),a}}this.defaults={...this.defaults,...n}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return Kt.lex(t,e??this.defaults)}parser(t,e){return Gt.parse(t,e??this.defaults)}parseMarkdown(t){return(r,n)=>{const s={...n},i={...this.defaults,...s},o=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=t);const a=i.hooks?i.hooks.provideLexer():t?Kt.lex:Kt.lexInline,l=i.hooks?i.hooks.provideParser():t?Gt.parse:Gt.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(r):r).then(c=>a(c,i)).then(c=>i.hooks?i.hooks.processAllTokens(c):c).then(c=>i.walkTokens?Promise.all(this.walkTokens(c,i.walkTokens)).then(()=>c):c).then(c=>l(c,i)).then(c=>i.hooks?i.hooks.postprocess(c):c).catch(o);try{i.hooks&&(r=i.hooks.preprocess(r));let c=a(r,i);i.hooks&&(c=i.hooks.processAllTokens(c)),i.walkTokens&&this.walkTokens(c,i.walkTokens);let u=l(c,i);return i.hooks&&(u=i.hooks.postprocess(u)),u}catch(c){return o(c)}}}onError(t,e){return r=>{if(r.message+=`
279
- Please report this to https://github.com/markedjs/marked.`,t){const n="<p>An error occurred:</p><pre>"+xt(r.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},Rr=new Pb;function pe(t,e){return Rr.parse(t,e)}pe.options=pe.setOptions=function(t){return Rr.setOptions(t),pe.defaults=Rr.defaults,Gu(pe.defaults),pe};pe.getDefaults=Lo;pe.defaults=Cr;pe.use=function(...t){return Rr.use(...t),pe.defaults=Rr.defaults,Gu(pe.defaults),pe};pe.walkTokens=function(t,e){return Rr.walkTokens(t,e)};pe.parseInline=Rr.parseInline;pe.Parser=Gt;pe.parser=Gt.parse;pe.Renderer=Us;pe.TextRenderer=Vo;pe.Lexer=Kt;pe.lexer=Kt.lex;pe.Tokenizer=Ds;pe.Hooks=_s;pe.parse=pe;pe.options;pe.setOptions;pe.use;pe.walkTokens;pe.parseInline;Gt.parse;Kt.lex;const Ib=["innerHTML"],$b=fr({__name:"MarkdownContent",props:{content:{}},setup(t){const e=t,r=Ne(()=>e.content?pe.parse(e.content,{async:!1}):"");return(n,s)=>(se(),ce("div",{class:"prose prose-sm dark:prose-invert max-w-none",innerHTML:r.value},null,8,Ib))}}),ih=10*1024*1024,oh=25*1024*1024;function gn(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function Pi(t){return t.mimeType.startsWith("image/")}function jb(t){return`data:${t.mimeType};base64,${t.content}`}async function Nb(t){const e=await new Promise((n,s)=>{const i=new FileReader;i.onload=()=>n(String(i.result??"")),i.onerror=()=>s(new Error("Unable to read file")),i.readAsDataURL(t)}),r=e.indexOf(",");if(r===-1)throw new Error(`Unable to parse file content for ${t.name}`);return{name:t.name,mimeType:t.type||"application/octet-stream",size:t.size,content:e.slice(r+1)}}function Lb(t){for(const r of t)if(r.size>ih)return{ok:!1,error:`"${r.name}" exceeds the 10MB per-file limit.`};return t.reduce((r,n)=>r+n.size,0)>oh?{ok:!1,error:"Attachments exceed the 25MB per-message limit."}:{ok:!0}}const Db={class:"overlay-header"},Ub={key:0,class:"flex h-full items-center justify-center px-8"},Bb={key:0,class:"mb-2 space-y-2"},Mb=["src","alt"],Hb={class:"flex items-center gap-2 text-xs"},qb={class:"truncate"},Fb={class:"opacity-70"},Vb={key:2,class:"text-muted-foreground"},zb={class:"mt-2 flex items-center justify-between gap-3"},Wb={key:3,class:"mt-2 inline-flex items-center gap-1","aria-label":"Streaming response"},Kb={class:"overlay-footer"},Gb={key:0,class:"mb-2 space-y-2"},Jb={class:"flex flex-wrap gap-1.5"},Yb={class:"max-w-[120px] truncate"},Xb={class:"opacity-65"},Zb=["onClick"],Qb={class:"overlay-meta text-muted-foreground"},e_={key:1,class:"text-xs text-destructive mb-2"},t_={class:"flex items-center gap-2 rounded-2xl border border-white/5 bg-[#202020]/90 px-2 py-2"},r_=["disabled"],n_=["disabled","aria-label","title"],s_=fr({__name:"ChatOverlay",setup(t){const e=Jv(),r=$o(),n=Re(!1),s=Re(""),i=Re(""),o=Re(!1),a=Re([]),l=Re(),c=Re(),u=Re(),h=Re(!0),d=Re(!1),f=Ne(()=>e.messages.length>0),p=()=>r.path==="/",y=Ne(()=>a.value.reduce((M,$)=>M+$.size,0)),w=Ne(()=>!e.isStreaming&&(s.value.trim().length>0||a.value.length>0));function k(){p()||(n.value=!n.value)}function _(){u.value&&(u.value.style.height="auto",u.value.style.height=`${Math.min(u.value.scrollHeight,136)}px`)}function b(){if(!l.value)return;const M=l.value,$=M.scrollHeight-M.scrollTop-M.clientHeight;h.value=$<40,d.value=!h.value}function A(M=!1){l.value&&(M||h.value)&&(l.value.scrollTop=l.value.scrollHeight,d.value=!1)}function U(M){return new Date(M).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}async function F(M){if(!M||M.length===0)return;i.value="";const $=[];try{for(const Ue of Array.from(M))$.push(await Nb(Ue))}catch(Ue){i.value=(Ue==null?void 0:Ue.message)??"Unable to read one or more files.";return}const V=[...a.value,...$],Ee=Lb(V);if(!Ee.ok){i.value=Ee.error;return}a.value=V,c.value&&(c.value.value="")}function B(M){a.value.splice(M,1),i.value=""}function J(){var M;e.isStreaming||(M=c.value)==null||M.click()}function C(M){const $=M.target;F(($==null?void 0:$.files)??null)}async function z(){if(!w.value)return;const M=s.value.trim(),$=[...a.value],V=M||"Please review the attached file(s).";s.value="",a.value=[],i.value="",_(),await e.sendMessage(V,$)}function ee(){e.stopStreaming()}function O(M){if(M.key==="Enter"&&!M.shiftKey){if(M.preventDefault(),e.isStreaming){ee();return}z()}}function te(M){M.preventDefault(),!e.isStreaming&&(o.value=!0)}function ke(M){M.preventDefault(),o.value=!1}async function Pe(M){var $;M.preventDefault(),o.value=!1,!e.isStreaming&&await F((($=M.dataTransfer)==null?void 0:$.files)??null)}return Wt(s,()=>_()),Wt(()=>e.messages.map(M=>M.content),async()=>{await ur(),b(),A()},{deep:!0}),Wt(()=>e.messages.length,async()=>{await ur(),b(),A(!0)}),Wt(n,async M=>{M&&(await ur(),_(),b(),A(!0))}),To(async()=>{await ur(),_()}),(M,$)=>(se(),ce(Fe,null,[!n.value&&!p()?(se(),ce("button",{key:0,onClick:k,class:"overlay-fab",title:"Chat with IO","aria-label":"Open chat overlay"},[le(re(bg),{class:"h-5 w-5 text-white"}),$[4]||($[4]=Q("span",{class:"overlay-fab-label"},"IO",-1))])):je("",!0),le(pf,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"opacity-0 translate-y-4 scale-[0.98]","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-4 scale-[0.98]"},{default:Jr(()=>[n.value?(se(),ce("section",{key:0,class:Ge(["overlay-panel",o.value?"overlay-panel-dragging":""]),"aria-label":"IO Assistant chat",onDragover:te,onDragleave:ke,onDrop:Pe},[Q("header",Db,[$[5]||($[5]=Q("div",{class:"flex items-center gap-3"},[Q("div",{class:"overlay-status-dot"}),Q("div",null,[Q("p",{class:"overlay-title"},"IO ASSISTANT"),Q("p",{class:"overlay-meta"},"LIVE")])],-1)),Q("button",{onClick:$[0]||($[0]=V=>n.value=!1),class:"overlay-icon-btn","aria-label":"Minimize chat overlay",title:"Minimize"},[le(re(wg),{class:"h-4 w-4"})])]),Q("div",{ref_key:"messagesContainer",ref:l,class:"overlay-messages",onScroll:b},[f.value?je("",!0):(se(),ce("div",Ub,[...$[6]||($[6]=[Q("div",{class:"text-center"},[Q("p",{class:"overlay-title text-3xl"},"CHAT"),Q("p",{class:"mt-2 text-sm text-muted-foreground"},"Ask IO about your workspace, agents, or recent changes.")],-1)])])),(se(!0),ce(Fe,null,Tn(re(e).messages,V=>(se(),ce("div",{key:V.id,class:Ge(["flex",V.role==="user"?"justify-end":"justify-start"])},[Q("article",{class:Ge(["overlay-bubble",V.role==="user"?"overlay-bubble-user":"overlay-bubble-assistant"])},[V.attachments.length>0?(se(),ce("div",Bb,[(se(!0),ce(Fe,null,Tn(V.attachments,(Ee,Ue)=>(se(),ce("div",{key:`${V.id}-${Ue}`,class:"overlay-attachment"},[re(Pi)(Ee)?(se(),ce("img",{key:0,src:re(jb)(Ee),alt:Ee.name,class:"max-h-44 rounded-md mb-1 object-contain"},null,8,Mb)):je("",!0),Q("div",Hb,[re(Pi)(Ee)?(se(),st(re(rl),{key:0,class:"w-3.5 h-3.5"})):(se(),st(re(tl),{key:1,class:"w-3.5 h-3.5"})),Q("span",qb,rt(Ee.name),1),Q("span",Fb,rt(re(gn)(Ee.size)),1)])]))),128))])):je("",!0),V.content?(se(),st($b,{key:1,content:V.content,class:Ge(["overlay-markdown",V.role==="user"?"prose-invert":""])},null,8,["content","class"])):(se(),ce("span",Vb,"...")),Q("div",zb,[Q("span",{class:Ge(["overlay-meta uppercase tracking-[0.18em]",V.role==="user"?"text-primary-foreground/70":"text-muted-foreground"])},rt(V.role),3),Q("span",{class:Ge(["overlay-meta",V.role==="user"?"text-primary-foreground/70":"text-muted-foreground"])},rt(U(V.timestamp)),3)]),V.streaming?(se(),ce("div",Wb,[...$[7]||($[7]=[Q("span",{class:"overlay-dot animate-pulse"},null,-1),Q("span",{class:"overlay-dot animate-pulse [animation-delay:140ms]"},null,-1),Q("span",{class:"overlay-dot animate-pulse [animation-delay:280ms]"},null,-1)])])):je("",!0)],2)],2))),128))],544),d.value?(se(),ce("button",{key:0,class:"overlay-scroll-hint",type:"button",onClick:$[1]||($[1]=V=>A(!0)),"aria-label":"Scroll to latest message"},[le(re(fg),{class:"h-3.5 w-3.5"}),$[8]||($[8]=tu(" Latest ",-1))])):je("",!0),Q("footer",Kb,[Q("input",{ref_key:"fileInput",ref:c,type:"file",multiple:"",class:"hidden",onChange:C},null,544),a.value.length>0?(se(),ce("div",Gb,[Q("div",Jb,[(se(!0),ce(Fe,null,Tn(a.value,(V,Ee)=>(se(),ce("div",{key:`${V.name}-${Ee}`,class:"overlay-chip"},[re(Pi)(V)?(se(),st(re(rl),{key:0,class:"w-3.5 h-3.5"})):(se(),st(re(tl),{key:1,class:"w-3.5 h-3.5"})),Q("span",Yb,rt(V.name),1),Q("span",Xb,rt(re(gn)(V.size)),1),Q("button",{class:"hover:text-destructive",onClick:Ue=>B(Ee)},[le(re(Ig),{class:"w-3.5 h-3.5"})],8,Zb)]))),128))]),Q("p",Qb,rt(re(gn)(y.value))+" · Max "+rt(re(gn)(re(ih)))+" file · "+rt(re(gn)(re(oh)))+" total ",1)])):je("",!0),i.value?(se(),ce("p",e_,rt(i.value),1)):je("",!0),Q("div",t_,[Q("button",{class:"overlay-attach-btn",disabled:re(e).isStreaming,onClick:J,title:"Attach files","aria-label":"Attach files"},[le(re(Eg),{class:"w-4 h-4"})],8,r_),nd(Q("textarea",{ref_key:"textareaRef",ref:u,"onUpdate:modelValue":$[2]||($[2]=V=>s.value=V),onKeydown:O,placeholder:"Message IO...",rows:"1",class:"overlay-input"},null,544),[[Df,s.value]]),Q("button",{onClick:$[3]||($[3]=V=>re(e).isStreaming?ee():z()),disabled:!w.value&&!re(e).isStreaming,class:"overlay-send-btn","aria-label":re(e).isStreaming?"Stop generation":"Send message",title:re(e).isStreaming?"Stop generation":"Send message"},[re(e).isStreaming?(se(),st(re(Cg),{key:1,class:"h-3.5 w-3.5"})):(se(),st(re(Ag),{key:0,class:"h-4 w-4"}))],8,n_)])])],34)):je("",!0)]),_:1})],64))}}),i_=(t,e)=>{const r=t.__vccOpts||t;for(const[n,s]of e)r[n]=s;return r},o_=i_(s_,[["__scopeId","data-v-f59d8ebb"]]),a_={class:"flex h-screen overflow-hidden"},l_={class:"flex-1 flex flex-col overflow-hidden"},c_={class:"flex-1 overflow-auto"},u_=fr({__name:"App",setup(t){const e=es(),r=$o(),n=Ne(()=>e.isAuthenticated&&r.name!=="login");return(s,i)=>{const o=Ao("router-view");return se(),ce("div",a_,[n.value?(se(),st(Mg,{key:0})):je("",!0),Q("div",l_,[n.value?(se(),st(Wv,{key:0})):je("",!0),Q("main",c_,[le(o)])]),n.value?(se(),st(o_,{key:1})):je("",!0)])}}}),h_=[{path:"/login",name:"login",component:()=>ze(()=>import("./LoginView-BpyPueAJ.js"),[]),meta:{public:!0}},{path:"/",name:"chat",component:()=>ze(()=>import("./ChatView-CMrGek2t.js"),[])},{path:"/squads",name:"squads",component:()=>ze(()=>import("./SquadsView-BfI7gXGL.js"),__vite__mapDeps([0,1,2,3]))},{path:"/squads/health",name:"squad-health",component:()=>ze(()=>import("./SquadHealthView-CcfjWCOh.js"),__vite__mapDeps([4,1,5,3]))},{path:"/squads/:id",name:"squad-detail",component:()=>ze(()=>import("./SquadDetailView-CBAJi3oS.js"),__vite__mapDeps([6,1,2,3,7,8]))},{path:"/feed",name:"feed",component:()=>ze(()=>import("./FeedView-CLT5n92b.js"),__vite__mapDeps([9,1,2,7]))},{path:"/skills",name:"skills",component:()=>ze(()=>import("./SkillsView-lRD1oRGj.js"),__vite__mapDeps([10,1,11,12,13,7]))},{path:"/mcp",name:"mcp",component:()=>ze(()=>import("./McpView-NESAwdjb.js"),__vite__mapDeps([14,1,15,11,7]))},{path:"/schedules",name:"schedules",component:()=>ze(()=>import("./SchedulesView-D2d4EW4s.js"),__vite__mapDeps([16,1,2,15,11,7]))},{path:"/history",name:"history",component:()=>ze(()=>import("./HistoryView-ChVrABKZ.js"),__vite__mapDeps([17,1,12,8,7]))},{path:"/wiki",name:"wiki",component:()=>ze(()=>import("./WikiView-Cqn_mgy2.js"),__vite__mapDeps([18,1,12,11,13,7]))},{path:"/usage",name:"usage",component:()=>ze(()=>import("./UsageView-DE3mx0K2.js"),__vite__mapDeps([19,1,5]))},{path:"/audit-log",name:"audit-log",component:()=>ze(()=>import("./AuditLogView-CQ0_fNNC.js"),__vite__mapDeps([20,1]))},{path:"/settings",name:"settings",component:()=>ze(()=>import("./SettingsView-qrLa06kS.js"),__vite__mapDeps([21,1]))}],ah=ng({history:Np(),routes:h_});ah.beforeEach(t=>{const e=es();if(!t.meta.public&&!e.isAuthenticated)return{name:"login"}});async function d_(){await Hv();const t=Ff(u_);t.use(Wf()),t.use(ah);const{useAuthStore:e}=await ze(async()=>{const{useAuthStore:n}=await Promise.resolve().then(()=>qv);return{useAuthStore:n}},void 0),r=e();r.initAuthListener(),r.token&&await r.refreshToken(),t.mount("#app")}d_();export{p_ as $,ug as A,hg as B,dg as C,go as D,To as E,tl as F,Ic as G,yg as H,rl as I,se as J,Re as K,Tn as L,ih as M,Ao as N,ah as O,Eg as P,jb as Q,rt as R,Ag as S,re as T,Og as U,es as V,Jv as W,Ig as X,$o as Y,sg as Z,ag as _,fg as a,g_ as a0,Df as a1,Lb as a2,Wt as a3,Jr as a4,nd as a5,y_ as a6,m_ as a7,pg as b,gg as c,Fe as d,Eu as e,oh as f,_g as g,Tg as h,xg as i,Cg as j,Pg as k,$b as l,Ne as m,Q as n,st as o,je as p,ce as q,we as r,tu as s,le as t,fr as u,Nb as v,gn as w,Pi as x,ur as y,Ge as z};
279
+ Please report this to https://github.com/markedjs/marked.`,t){const n="<p>An error occurred:</p><pre>"+xt(r.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},Rr=new Pb;function pe(t,e){return Rr.parse(t,e)}pe.options=pe.setOptions=function(t){return Rr.setOptions(t),pe.defaults=Rr.defaults,Gu(pe.defaults),pe};pe.getDefaults=Lo;pe.defaults=Cr;pe.use=function(...t){return Rr.use(...t),pe.defaults=Rr.defaults,Gu(pe.defaults),pe};pe.walkTokens=function(t,e){return Rr.walkTokens(t,e)};pe.parseInline=Rr.parseInline;pe.Parser=Gt;pe.parser=Gt.parse;pe.Renderer=Us;pe.TextRenderer=Vo;pe.Lexer=Kt;pe.lexer=Kt.lex;pe.Tokenizer=Ds;pe.Hooks=_s;pe.parse=pe;pe.options;pe.setOptions;pe.use;pe.walkTokens;pe.parseInline;Gt.parse;Kt.lex;const Ib=["innerHTML"],$b=fr({__name:"MarkdownContent",props:{content:{}},setup(t){const e=t,r=Ne(()=>e.content?pe.parse(e.content,{async:!1}):"");return(n,s)=>(se(),ce("div",{class:"prose prose-sm dark:prose-invert max-w-none",innerHTML:r.value},null,8,Ib))}}),ih=10*1024*1024,oh=25*1024*1024;function gn(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function Pi(t){return t.mimeType.startsWith("image/")}function jb(t){return`data:${t.mimeType};base64,${t.content}`}async function Nb(t){const e=await new Promise((n,s)=>{const i=new FileReader;i.onload=()=>n(String(i.result??"")),i.onerror=()=>s(new Error("Unable to read file")),i.readAsDataURL(t)}),r=e.indexOf(",");if(r===-1)throw new Error(`Unable to parse file content for ${t.name}`);return{name:t.name,mimeType:t.type||"application/octet-stream",size:t.size,content:e.slice(r+1)}}function Lb(t){for(const r of t)if(r.size>ih)return{ok:!1,error:`"${r.name}" exceeds the 10MB per-file limit.`};return t.reduce((r,n)=>r+n.size,0)>oh?{ok:!1,error:"Attachments exceed the 25MB per-message limit."}:{ok:!0}}const Db={class:"overlay-header"},Ub={key:0,class:"flex h-full items-center justify-center px-8"},Bb={key:0,class:"mb-2 space-y-2"},Mb=["src","alt"],Hb={class:"flex items-center gap-2 text-xs"},qb={class:"truncate"},Fb={class:"opacity-70"},Vb={key:2,class:"text-muted-foreground"},zb={class:"mt-2 flex items-center justify-between gap-3"},Wb={key:3,class:"mt-2 inline-flex items-center gap-1","aria-label":"Streaming response"},Kb={class:"overlay-footer"},Gb={key:0,class:"mb-2 space-y-2"},Jb={class:"flex flex-wrap gap-1.5"},Yb={class:"max-w-[120px] truncate"},Xb={class:"opacity-65"},Zb=["onClick"],Qb={class:"overlay-meta text-muted-foreground"},e_={key:1,class:"text-xs text-destructive mb-2"},t_={class:"flex items-center gap-2 rounded-2xl border border-white/5 bg-[#202020]/90 px-2 py-2"},r_=["disabled"],n_=["disabled","aria-label","title"],s_=fr({__name:"ChatOverlay",setup(t){const e=Jv(),r=$o(),n=Re(!1),s=Re(""),i=Re(""),o=Re(!1),a=Re([]),l=Re(),c=Re(),u=Re(),h=Re(!0),d=Re(!1),f=Ne(()=>e.messages.length>0),p=()=>r.path==="/",y=Ne(()=>a.value.reduce((M,$)=>M+$.size,0)),w=Ne(()=>!e.isStreaming&&(s.value.trim().length>0||a.value.length>0));function k(){p()||(n.value=!n.value)}function _(){u.value&&(u.value.style.height="auto",u.value.style.height=`${Math.min(u.value.scrollHeight,136)}px`)}function b(){if(!l.value)return;const M=l.value,$=M.scrollHeight-M.scrollTop-M.clientHeight;h.value=$<40,d.value=!h.value}function A(M=!1){l.value&&(M||h.value)&&(l.value.scrollTop=l.value.scrollHeight,d.value=!1)}function U(M){return new Date(M).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}async function F(M){if(!M||M.length===0)return;i.value="";const $=[];try{for(const Ue of Array.from(M))$.push(await Nb(Ue))}catch(Ue){i.value=(Ue==null?void 0:Ue.message)??"Unable to read one or more files.";return}const V=[...a.value,...$],Ee=Lb(V);if(!Ee.ok){i.value=Ee.error;return}a.value=V,c.value&&(c.value.value="")}function B(M){a.value.splice(M,1),i.value=""}function J(){var M;e.isStreaming||(M=c.value)==null||M.click()}function C(M){const $=M.target;F(($==null?void 0:$.files)??null)}async function z(){if(!w.value)return;const M=s.value.trim(),$=[...a.value],V=M||"Please review the attached file(s).";s.value="",a.value=[],i.value="",_(),await e.sendMessage(V,$)}function ee(){e.stopStreaming()}function O(M){if(M.key==="Enter"&&!M.shiftKey){if(M.preventDefault(),e.isStreaming){ee();return}z()}}function te(M){M.preventDefault(),!e.isStreaming&&(o.value=!0)}function ke(M){M.preventDefault(),o.value=!1}async function Pe(M){var $;M.preventDefault(),o.value=!1,!e.isStreaming&&await F((($=M.dataTransfer)==null?void 0:$.files)??null)}return Wt(s,()=>_()),Wt(()=>e.messages.map(M=>M.content),async()=>{await ur(),b(),A()},{deep:!0}),Wt(()=>e.messages.length,async()=>{await ur(),b(),A(!0)}),Wt(n,async M=>{M&&(await ur(),_(),b(),A(!0))}),To(async()=>{await ur(),_()}),(M,$)=>(se(),ce(Fe,null,[!n.value&&!p()?(se(),ce("button",{key:0,onClick:k,class:"overlay-fab",title:"Chat with IO","aria-label":"Open chat overlay"},[le(re(bg),{class:"h-5 w-5 text-white"}),$[4]||($[4]=Q("span",{class:"overlay-fab-label"},"IO",-1))])):je("",!0),le(pf,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"opacity-0 translate-y-4 scale-[0.98]","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-4 scale-[0.98]"},{default:Jr(()=>[n.value?(se(),ce("section",{key:0,class:Ge(["overlay-panel",o.value?"overlay-panel-dragging":""]),"aria-label":"IO Assistant chat",onDragover:te,onDragleave:ke,onDrop:Pe},[Q("header",Db,[$[5]||($[5]=Q("div",{class:"flex items-center gap-3"},[Q("div",{class:"overlay-status-dot"}),Q("div",null,[Q("p",{class:"overlay-title"},"IO ASSISTANT"),Q("p",{class:"overlay-meta"},"LIVE")])],-1)),Q("button",{onClick:$[0]||($[0]=V=>n.value=!1),class:"overlay-icon-btn","aria-label":"Minimize chat overlay",title:"Minimize"},[le(re(wg),{class:"h-4 w-4"})])]),Q("div",{ref_key:"messagesContainer",ref:l,class:"overlay-messages",onScroll:b},[f.value?je("",!0):(se(),ce("div",Ub,[...$[6]||($[6]=[Q("div",{class:"text-center"},[Q("p",{class:"overlay-title text-3xl"},"CHAT"),Q("p",{class:"mt-2 text-sm text-muted-foreground"},"Ask IO about your workspace, agents, or recent changes.")],-1)])])),(se(!0),ce(Fe,null,Tn(re(e).messages,V=>(se(),ce("div",{key:V.id,class:Ge(["flex",V.role==="user"?"justify-end":"justify-start"])},[Q("article",{class:Ge(["overlay-bubble",V.role==="user"?"overlay-bubble-user":"overlay-bubble-assistant"])},[V.attachments.length>0?(se(),ce("div",Bb,[(se(!0),ce(Fe,null,Tn(V.attachments,(Ee,Ue)=>(se(),ce("div",{key:`${V.id}-${Ue}`,class:"overlay-attachment"},[re(Pi)(Ee)?(se(),ce("img",{key:0,src:re(jb)(Ee),alt:Ee.name,class:"max-h-44 rounded-md mb-1 object-contain"},null,8,Mb)):je("",!0),Q("div",Hb,[re(Pi)(Ee)?(se(),st(re(rl),{key:0,class:"w-3.5 h-3.5"})):(se(),st(re(tl),{key:1,class:"w-3.5 h-3.5"})),Q("span",qb,rt(Ee.name),1),Q("span",Fb,rt(re(gn)(Ee.size)),1)])]))),128))])):je("",!0),V.content?(se(),st($b,{key:1,content:V.content,class:Ge(["overlay-markdown",V.role==="user"?"prose-invert":""])},null,8,["content","class"])):(se(),ce("span",Vb,"...")),Q("div",zb,[Q("span",{class:Ge(["overlay-meta uppercase tracking-[0.18em]",V.role==="user"?"text-primary-foreground/70":"text-muted-foreground"])},rt(V.role),3),Q("span",{class:Ge(["overlay-meta",V.role==="user"?"text-primary-foreground/70":"text-muted-foreground"])},rt(U(V.timestamp)),3)]),V.streaming?(se(),ce("div",Wb,[...$[7]||($[7]=[Q("span",{class:"overlay-dot animate-pulse"},null,-1),Q("span",{class:"overlay-dot animate-pulse [animation-delay:140ms]"},null,-1),Q("span",{class:"overlay-dot animate-pulse [animation-delay:280ms]"},null,-1)])])):je("",!0)],2)],2))),128))],544),d.value?(se(),ce("button",{key:0,class:"overlay-scroll-hint",type:"button",onClick:$[1]||($[1]=V=>A(!0)),"aria-label":"Scroll to latest message"},[le(re(fg),{class:"h-3.5 w-3.5"}),$[8]||($[8]=tu(" Latest ",-1))])):je("",!0),Q("footer",Kb,[Q("input",{ref_key:"fileInput",ref:c,type:"file",multiple:"",class:"hidden",onChange:C},null,544),a.value.length>0?(se(),ce("div",Gb,[Q("div",Jb,[(se(!0),ce(Fe,null,Tn(a.value,(V,Ee)=>(se(),ce("div",{key:`${V.name}-${Ee}`,class:"overlay-chip"},[re(Pi)(V)?(se(),st(re(rl),{key:0,class:"w-3.5 h-3.5"})):(se(),st(re(tl),{key:1,class:"w-3.5 h-3.5"})),Q("span",Yb,rt(V.name),1),Q("span",Xb,rt(re(gn)(V.size)),1),Q("button",{class:"hover:text-destructive",onClick:Ue=>B(Ee)},[le(re(Ig),{class:"w-3.5 h-3.5"})],8,Zb)]))),128))]),Q("p",Qb,rt(re(gn)(y.value))+" · Max "+rt(re(gn)(re(ih)))+" file · "+rt(re(gn)(re(oh)))+" total ",1)])):je("",!0),i.value?(se(),ce("p",e_,rt(i.value),1)):je("",!0),Q("div",t_,[Q("button",{class:"overlay-attach-btn",disabled:re(e).isStreaming,onClick:J,title:"Attach files","aria-label":"Attach files"},[le(re(Eg),{class:"w-4 h-4"})],8,r_),nd(Q("textarea",{ref_key:"textareaRef",ref:u,"onUpdate:modelValue":$[2]||($[2]=V=>s.value=V),onKeydown:O,placeholder:"Message IO...",rows:"1",class:"overlay-input"},null,544),[[Df,s.value]]),Q("button",{onClick:$[3]||($[3]=V=>re(e).isStreaming?ee():z()),disabled:!w.value&&!re(e).isStreaming,class:"overlay-send-btn","aria-label":re(e).isStreaming?"Stop generation":"Send message",title:re(e).isStreaming?"Stop generation":"Send message"},[re(e).isStreaming?(se(),st(re(Cg),{key:1,class:"h-3.5 w-3.5"})):(se(),st(re(Ag),{key:0,class:"h-4 w-4"}))],8,n_)])])],34)):je("",!0)]),_:1})],64))}}),i_=(t,e)=>{const r=t.__vccOpts||t;for(const[n,s]of e)r[n]=s;return r},o_=i_(s_,[["__scopeId","data-v-f59d8ebb"]]),a_={class:"flex h-screen overflow-hidden"},l_={class:"flex-1 flex flex-col overflow-hidden"},c_={class:"flex-1 overflow-auto"},u_=fr({__name:"App",setup(t){const e=es(),r=$o(),n=Ne(()=>e.isAuthenticated&&r.name!=="login");return(s,i)=>{const o=Ao("router-view");return se(),ce("div",a_,[n.value?(se(),st(Mg,{key:0})):je("",!0),Q("div",l_,[n.value?(se(),st(Wv,{key:0})):je("",!0),Q("main",c_,[le(o)])]),n.value?(se(),st(o_,{key:1})):je("",!0)])}}}),h_=[{path:"/login",name:"login",component:()=>ze(()=>import("./LoginView-BujrALVM.js"),[]),meta:{public:!0}},{path:"/",name:"chat",component:()=>ze(()=>import("./ChatView-CpJoNyZB.js"),[])},{path:"/squads",name:"squads",component:()=>ze(()=>import("./SquadsView-3suUmJxg.js"),__vite__mapDeps([0,1,2,3]))},{path:"/squads/health",name:"squad-health",component:()=>ze(()=>import("./SquadHealthView-CqS5Vhsm.js"),__vite__mapDeps([4,1,5,3]))},{path:"/squads/:id",name:"squad-detail",component:()=>ze(()=>import("./SquadDetailView-BiSr7NNt.js"),__vite__mapDeps([6,1,2,3,7,8]))},{path:"/feed",name:"feed",component:()=>ze(()=>import("./FeedView-CXPnEP-A.js"),__vite__mapDeps([9,1,2,7]))},{path:"/skills",name:"skills",component:()=>ze(()=>import("./SkillsView-BgeVT0OC.js"),__vite__mapDeps([10,1,11,12,13,7]))},{path:"/mcp",name:"mcp",component:()=>ze(()=>import("./McpView-BIOYWxmY.js"),__vite__mapDeps([14,1,15,11,7]))},{path:"/schedules",name:"schedules",component:()=>ze(()=>import("./SchedulesView-DobGlhXT.js"),__vite__mapDeps([16,1,2,15,11,7]))},{path:"/history",name:"history",component:()=>ze(()=>import("./HistoryView-gb-ZMOIr.js"),__vite__mapDeps([17,1,12,8,7]))},{path:"/wiki",name:"wiki",component:()=>ze(()=>import("./WikiView-B1q8HTSC.js"),__vite__mapDeps([18,1,12,11,13,7]))},{path:"/usage",name:"usage",component:()=>ze(()=>import("./UsageView-CEP6E-Uz.js"),__vite__mapDeps([19,1,5]))},{path:"/audit-log",name:"audit-log",component:()=>ze(()=>import("./AuditLogView-C0IC1aC6.js"),__vite__mapDeps([20,1]))},{path:"/settings",name:"settings",component:()=>ze(()=>import("./SettingsView-BiU4DiWX.js"),__vite__mapDeps([21,1]))}],ah=ng({history:Np(),routes:h_});ah.beforeEach(t=>{const e=es();if(!t.meta.public&&!e.isAuthenticated)return{name:"login"}});async function d_(){await Hv();const t=Ff(u_);t.use(Wf()),t.use(ah);const{useAuthStore:e}=await ze(async()=>{const{useAuthStore:n}=await Promise.resolve().then(()=>qv);return{useAuthStore:n}},void 0),r=e();r.initAuthListener(),r.token&&await r.refreshToken(),t.mount("#app")}d_();export{p_ as $,ug as A,hg as B,dg as C,go as D,To as E,tl as F,Ic as G,yg as H,rl as I,se as J,Re as K,Tn as L,ih as M,Ao as N,ah as O,Eg as P,jb as Q,rt as R,Ag as S,re as T,Og as U,es as V,Jv as W,Ig as X,$o as Y,sg as Z,ag as _,fg as a,g_ as a0,Df as a1,Lb as a2,Wt as a3,Jr as a4,nd as a5,y_ as a6,m_ as a7,pg as b,gg as c,Fe as d,Eu as e,oh as f,_g as g,Tg as h,xg as i,Cg as j,Pg as k,$b as l,Ne as m,Q as n,st as o,je as p,ce as q,we as r,tu as s,le as t,fr as u,Nb as v,gn as w,Pi as x,ur as y,Ge as z};
@@ -1,4 +1,4 @@
1
- import{r as e}from"./index-BGcJLCmg.js";/**
1
+ import{r as e}from"./index-DTG9i0yb.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{r as a}from"./index-BGcJLCmg.js";/**
1
+ import{r as a}from"./index-DTG9i0yb.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{r as c}from"./index-BGcJLCmg.js";/**
1
+ import{r as c}from"./index-DTG9i0yb.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{r as e}from"./index-BGcJLCmg.js";/**
1
+ import{r as e}from"./index-DTG9i0yb.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{r as e}from"./index-BGcJLCmg.js";/**
1
+ import{r as e}from"./index-DTG9i0yb.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -5,7 +5,7 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>IO — Dashboard</title>
7
7
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
8
- <script type="module" crossorigin src="/assets/index-BGcJLCmg.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-DTG9i0yb.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-DquQZ4vP.css">
10
10
  </head>
11
11
  <body class="bg-background text-foreground">