heyio 1.4.1 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/copilot/agents.js +47 -3
  2. package/dist/copilot/squad-tools.js +72 -1
  3. package/dist/copilot/system-message.js +4 -0
  4. package/dist/copilot/tools.js +17 -1
  5. package/dist/store/instances.js +4 -0
  6. package/package.json +1 -1
  7. package/web-dist/assets/{AuditLogView-Cdx7vZdd.js → AuditLogView-blV2zh1J.js} +1 -1
  8. package/web-dist/assets/{ChatView-CXL0xMzV.js → ChatView-rktzvf02.js} +1 -1
  9. package/web-dist/assets/{FeedView-CL_gGs8m.js → FeedView-BaGHVS5k.js} +1 -1
  10. package/web-dist/assets/{HistoryView-BEv5KtjC.js → HistoryView-54tTZBvl.js} +1 -1
  11. package/web-dist/assets/{LoginView-a30NhZ-S.js → LoginView-Bwl96p9a.js} +1 -1
  12. package/web-dist/assets/{McpView-Bg7ikSzn.js → McpView-D1HjpDaS.js} +1 -1
  13. package/web-dist/assets/{SchedulesView-dzgRNuBk.js → SchedulesView-heDgZ6EX.js} +1 -1
  14. package/web-dist/assets/{SettingsView-C3ucjaBU.js → SettingsView-BkzrjzlA.js} +1 -1
  15. package/web-dist/assets/{SkillsView-DRDyKLbJ.js → SkillsView-BFEE6Dr7.js} +1 -1
  16. package/web-dist/assets/{SquadDetailView-CUIzmUNq.js → SquadDetailView-B8eH9uCp.js} +1 -1
  17. package/web-dist/assets/{SquadHealthView-FXC83WjQ.js → SquadHealthView-S7L-ux5R.js} +1 -1
  18. package/web-dist/assets/{SquadsView-CHUgkqrF.js → SquadsView-CYHJHUTi.js} +1 -1
  19. package/web-dist/assets/{UsageView-TD-tGZmI.js → UsageView-Brck8R6H.js} +1 -1
  20. package/web-dist/assets/{WikiView-CoJ4i7WL.js → WikiView-CXXw3RGo.js} +1 -1
  21. package/web-dist/assets/{api-BDaG6Xip.js → api-C7MAaSLt.js} +1 -1
  22. package/web-dist/assets/{arrow-left-CYcbDJsp.js → arrow-left-4L8HoaXC.js} +1 -1
  23. package/web-dist/assets/{git-branch-DqLb0pDI.js → git-branch-CmEyTvTW.js} +1 -1
  24. package/web-dist/assets/{index-C0KbNiVo.js → index-1mPHTPeR.js} +3 -3
  25. package/web-dist/assets/{plus-Dd6C-pDL.js → plus-BhwZCs3M.js} +1 -1
  26. package/web-dist/assets/{save-BbLvUy1x.js → save-Cl5b973n.js} +1 -1
  27. package/web-dist/assets/{search-CfUBmHvO.js → search-BeUz6qvn.js} +1 -1
  28. package/web-dist/assets/{trash-2-BRFreQyG.js → trash-2-CQowMVCO.js} +1 -1
  29. package/web-dist/assets/{triangle-alert-DHtoc69N.js → triangle-alert-zxlYFyjw.js} +1 -1
  30. package/web-dist/assets/{x-fwHpZ8VZ.js → x-Czw2unv0.js} +1 -1
  31. package/web-dist/index.html +1 -1
@@ -2,17 +2,59 @@ import { approveAll } from "@github/copilot-sdk";
2
2
  import { getClient } from "./client.js";
3
3
  import { getLeadForSquad, getAgentsForSquad, updateAgentStatus, getSquad } from "../store/squads.js";
4
4
  import { createTask, updateTaskStatus, getTask } from "../store/tasks.js";
5
- import { touchInstanceActivity } from "../store/instances.js";
5
+ import { touchInstanceActivity, getInstance } from "../store/instances.js";
6
6
  import { selectModel, classifyComplexity } from "./model-router.js";
7
7
  import { postFeedItem } from "../store/feed.js";
8
8
  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
+ import { PATHS } from "../paths.js";
11
12
  import { createSquadTools } from "./squad-tools.js";
12
13
  import { loadSkillDirectories } from "./skills.js";
13
14
  import { getMcpServersForSession } from "../mcp/registry.js";
15
+ import { existsSync, mkdirSync } from "node:fs";
16
+ import { join } from "node:path";
17
+ import { exec } from "node:child_process";
18
+ import { promisify } from "node:util";
19
+ const execAsync = promisify(exec);
14
20
  // Registry of active agent sessions keyed by task ID
15
21
  const activeSessions = new Map();
22
+ /**
23
+ * Resolve the working directory for a squad agent session.
24
+ * Priority: instance worktree → cloned repo → process.cwd()
25
+ */
26
+ async function resolveSquadWorkingDirectory(squad, instanceId) {
27
+ // If an instance is specified, use its worktree path
28
+ if (instanceId) {
29
+ const instance = getInstance(instanceId);
30
+ if (instance?.worktree_path && existsSync(instance.worktree_path)) {
31
+ return instance.worktree_path;
32
+ }
33
+ }
34
+ // Derive from squad repo_url → ~/.io/source/{owner}/{repo}
35
+ if (squad.repo_url) {
36
+ const match = squad.repo_url.match(/[/:]([^/]+)\/([^/.]+?)(?:\.git)?$/);
37
+ if (match) {
38
+ const [, owner, repo] = match;
39
+ const sourceDir = join(PATHS.source, owner, repo);
40
+ if (existsSync(sourceDir)) {
41
+ return sourceDir;
42
+ }
43
+ // Attempt to clone if missing
44
+ const parentDir = join(PATHS.source, owner);
45
+ if (!existsSync(parentDir))
46
+ mkdirSync(parentDir, { recursive: true });
47
+ try {
48
+ await execAsync(`git clone ${squad.repo_url} ${sourceDir}`, { timeout: 120_000 });
49
+ return sourceDir;
50
+ }
51
+ catch {
52
+ // Clone failed — fall through to default
53
+ }
54
+ }
55
+ }
56
+ return process.cwd();
57
+ }
16
58
  /**
17
59
  * Stop a running agent by task ID. Disconnects the session and marks the task as stopped.
18
60
  */
@@ -93,13 +135,15 @@ ${lead.persona ? `## Personality:\n${lead.persona}` : ""}
93
135
  let result;
94
136
  try {
95
137
  // Load squad-scoped tools, skills, and MCP servers
96
- const squadTools = createSquadTools(squadSlug, squadId);
138
+ const squadTools = createSquadTools(squadSlug, squadId, squad?.repo_url);
97
139
  const skillDirs = await loadSkillDirectories();
98
140
  const mcpServers = getMcpServersForSession();
141
+ // Resolve correct working directory for the squad's project
142
+ const workDir = await resolveSquadWorkingDirectory(squad, instanceId);
99
143
  const session = await client.createSession({
100
144
  model,
101
145
  streaming: true,
102
- workingDirectory: process.cwd(),
146
+ workingDirectory: workDir,
103
147
  systemMessage: { content: systemMessage },
104
148
  tools: squadTools,
105
149
  skillDirectories: skillDirs,
@@ -1,12 +1,31 @@
1
1
  import { z } from "zod";
2
2
  import { defineTool } from "@github/copilot-sdk";
3
+ import { exec } from "node:child_process";
4
+ import { promisify } from "node:util";
5
+ import { join } from "node:path";
6
+ import { PATHS } from "../paths.js";
7
+ const execAsync = promisify(exec);
8
+ /**
9
+ * Resolve the project root directory for a squad from its repo_url.
10
+ * Returns the path under ~/.io/source/{owner}/{repo} or null if unknown.
11
+ */
12
+ function resolveSquadProjectDir(repoUrl) {
13
+ if (!repoUrl)
14
+ return null;
15
+ const match = repoUrl.match(/[/:]([^/]+)\/([^/.]+?)(?:\.git)?$/);
16
+ if (!match)
17
+ return null;
18
+ const [, owner, repo] = match;
19
+ return join(PATHS.source, owner, repo);
20
+ }
3
21
  /**
4
22
  * Creates a scoped set of tools for squad agent sessions.
5
23
  * Wiki tools are sandboxed to the squad's own wiki subfolder.
6
24
  * Feed posts are locked to the squad's source identifier.
7
25
  */
8
- export function createSquadTools(squadSlug, squadId) {
26
+ export function createSquadTools(squadSlug, squadId, repoUrl) {
9
27
  const wikiPrefix = `squads/${squadSlug}`;
28
+ const projectDir = resolveSquadProjectDir(repoUrl ?? null);
10
29
  return [
11
30
  // --- Wiki Tools (scoped to squads/{slug}/) ---
12
31
  defineTool("wiki_read", {
@@ -97,6 +116,58 @@ export function createSquadTools(squadSlug, squadId) {
97
116
  return getTasksForSquad(squadId);
98
117
  },
99
118
  }),
119
+ // --- Shell Tool (scoped to project directory) ---
120
+ defineTool("shell_exec", {
121
+ description: "Execute a shell command in the squad's project directory. Use for git, build tools, test runners, file operations, etc.",
122
+ parameters: z.object({
123
+ command: z.string().describe("Shell command to execute"),
124
+ cwd: z
125
+ .string()
126
+ .optional()
127
+ .describe("Working directory relative to project root (optional, defaults to project root)"),
128
+ }),
129
+ handler: async ({ command, cwd }) => {
130
+ const baseDir = projectDir ?? process.cwd();
131
+ // If cwd is provided, resolve it relative to the project dir
132
+ const workDir = cwd ? join(baseDir, cwd) : baseDir;
133
+ // Safety: ensure workDir is under baseDir
134
+ const resolved = join(workDir);
135
+ if (!resolved.startsWith(baseDir)) {
136
+ return `Error: cannot execute commands outside the project directory`;
137
+ }
138
+ try {
139
+ // Ensure GitHub CLI auth is available — prefer GH_TOKEN from env,
140
+ // fall back to extracting from gh auth if available
141
+ const shellEnv = { ...process.env, GH_PROMPT_DISABLED: "1" };
142
+ if (!shellEnv.GH_TOKEN && !shellEnv.GITHUB_TOKEN) {
143
+ try {
144
+ const { stdout: token } = await execAsync("gh auth token", {
145
+ timeout: 5_000,
146
+ env: process.env,
147
+ });
148
+ if (token.trim()) {
149
+ shellEnv.GH_TOKEN = token.trim();
150
+ }
151
+ }
152
+ catch {
153
+ // gh auth not available — agents won't be able to push
154
+ }
155
+ }
156
+ const { stdout } = await execAsync(command, {
157
+ cwd: workDir,
158
+ timeout: 120_000,
159
+ maxBuffer: 2 * 1024 * 1024,
160
+ env: shellEnv,
161
+ });
162
+ return stdout.trim() || "(no output)";
163
+ }
164
+ catch (err) {
165
+ const stderr = err.stderr?.toString().trim() ?? "";
166
+ const stdout = err.stdout?.toString().trim() ?? "";
167
+ return `Error (exit ${err.code ?? 1}): ${stderr || stdout || err.message}`;
168
+ }
169
+ },
170
+ }),
100
171
  ];
101
172
  }
102
173
  //# sourceMappingURL=squad-tools.js.map
@@ -25,6 +25,7 @@ You are IO, a personal AI assistant daemon. You run 24/7 on the user's machine,
25
25
  - Always delegate code work to the relevant squad — never implement directly
26
26
  - Always delegate to the team lead, never to a specific agent (unless explicitly named by the user)
27
27
  - Never delegate unless explicitly asked — creating an issue ≠ request to start work
28
+ - When delegating, ALWAYS instruct the squad to notify the user via the inbox (feed_post) when work is complete
28
29
  - When creating squads, research the universe dynamically — never use hardcoded character lists
29
30
  - **Always use the gh CLI** for all GitHub interactions (repos, issues, PRs, releases, actions, etc.). Only fall back to the GitHub API or other methods if gh is unavailable or cannot accomplish the task.
30
31
  - For complex tasks involving multiple specialists, use squad_meeting to have the team plan together before executing. Use squad_delegate for straightforward single-domain tasks.
@@ -37,9 +38,12 @@ If a project has a squad assigned to it, you (the orchestrator) must NEVER:
37
38
  - Research, analyze, or investigate the project's code, issues, or state yourself
38
39
  - Attempt any work — even preliminary analysis — before delegating
39
40
  - "Look into" or "check on" something before passing it to the squad
41
+ - Wait for the squad to finish before responding to the user
40
42
 
41
43
  When a request comes in about a squad-owned project, you IMMEDIATELY delegate to that squad's team lead with no pre-processing. The squad handles ALL work including research, analysis, planning, and execution.
42
44
 
45
+ After delegating, IMMEDIATELY confirm to the user that the task is in the squad's hands (e.g., "I've handed this off to [squad name]. They'll work on it and post updates to your inbox."). Do NOT block or wait for the squad to complete — they work asynchronously in the background.
46
+
43
47
  The ONLY thing you are allowed to do regarding a squad-owned project (without delegating) is:
44
48
  - Answer questions about what the squad has already done (using feed/task history)
45
49
  - Report squad status, task progress, or past deliverables
@@ -336,12 +336,28 @@ export function createTools() {
336
336
  const { promisify } = await import("node:util");
337
337
  const { homedir } = await import("node:os");
338
338
  const execAsync = promisify(exec);
339
+ // Ensure GitHub CLI auth is available in the shell environment
340
+ const shellEnv = { ...process.env, GH_PROMPT_DISABLED: "1" };
341
+ if (!shellEnv.GH_TOKEN && !shellEnv.GITHUB_TOKEN) {
342
+ try {
343
+ const { stdout: token } = await execAsync("gh auth token", {
344
+ timeout: 5_000,
345
+ env: process.env,
346
+ });
347
+ if (token.trim()) {
348
+ shellEnv.GH_TOKEN = token.trim();
349
+ }
350
+ }
351
+ catch {
352
+ // gh auth not available
353
+ }
354
+ }
339
355
  try {
340
356
  const { stdout } = await execAsync(command, {
341
357
  cwd: cwd ?? homedir(),
342
358
  timeout: 60_000,
343
359
  maxBuffer: 1024 * 1024,
344
- env: { ...process.env, GH_PROMPT_DISABLED: "1" },
360
+ env: shellEnv,
345
361
  });
346
362
  const output = stdout.trim() || "(no output)";
347
363
  addAuditEntry("shell_command", `Command: ${command.slice(0, 200)}`, { command, cwd, output: output.slice(0, 500), exit_code: 0 });
@@ -4,6 +4,10 @@ import { promisify } from "node:util";
4
4
  import { getDb } from "./db.js";
5
5
  const execAsync = promisify(exec);
6
6
  const MAX_INSTANCES_PER_SQUAD = 3;
7
+ export function getInstance(instanceId) {
8
+ const db = getDb();
9
+ return db.prepare("SELECT * FROM instances WHERE id = ?").get(instanceId);
10
+ }
7
11
  export async function createInstance(squadId, branch) {
8
12
  const db = getDb();
9
13
  // Check max instances
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heyio",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
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{l as W,o as X,s as Z,u as a,k as d,h as o,n as P,D as A,a as V,m as S,z as l,T as f,N as T,F as h,w,O as F,j as b,v as n,g as _,q as ee}from"./index-C0KbNiVo.js";import{b as L}from"./api-BDaG6Xip.js";/**
1
+ import{l as W,o as X,s as Z,u as a,k as d,h as o,n as P,D as A,a as V,m as S,z as l,T as f,N as T,F as h,w,O as F,j as b,v as n,g as _,q as ee}from"./index-1mPHTPeR.js";import{b as L}from"./api-C7MAaSLt.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{o as h,G as _,Q as p,s as b,u as a,k as o,h as e,D as r,j as x,F as k,w,T as S,O as C,i as u,S as B,d as T,v as g,q as m,f as j,p as y}from"./index-C0KbNiVo.js";const V={class:"flex flex-col h-full"},D={key:0,class:"flex items-center justify-center h-full"},K={key:1,class:"text-muted-foreground"},M={key:2,class:"inline-block w-2 h-4 bg-current animate-pulse ml-1"},q={class:"border-t border-border p-4"},z={class:"flex gap-2 items-end"},E=["disabled"],O=h({__name:"ChatView",setup(F){const n=_(),l=g(""),i=g();async function f(){const s=l.value.trim();!s||n.isStreaming||(l.value="",await n.sendMessage(s))}function c(){i.value&&(i.value.scrollTop=i.value.scrollHeight)}function v(s){s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),f())}return p(()=>n.messages.map(s=>s.content),async()=>{await y(),c()},{deep:!0}),p(()=>n.messages.length,async()=>{await y(),c()}),b(()=>c()),(s,d)=>(a(),o("div",V,[e("div",{ref_key:"messagesContainer",ref:i,class:"flex-1 overflow-y-auto p-4 space-y-4"},[r(n).messages.length===0?(a(),o("div",D,[...d[1]||(d[1]=[e("div",{class:"text-center text-muted-foreground"},[e("div",{class:"text-4xl mb-3"},"🤖"),e("p",{class:"text-lg font-medium"},"Welcome to IO"),e("p",{class:"text-sm mt-1"},"Send a message to get started.")],-1)])])):x("",!0),(a(!0),o(k,null,w(r(n).messages,t=>(a(),o("div",{key:t.id,class:m(["flex",t.role==="user"?"justify-end":"justify-start"])},[e("div",{class:m(["max-w-[75%] rounded-lg px-4 py-2 text-sm",t.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"])},[t.content?(a(),u(j,{key:0,content:t.content,class:m(t.role==="user"?"prose-invert":"")},null,8,["content","class"])):(a(),o("span",K,"...")),t.streaming?(a(),o("div",M)):x("",!0)],2)],2))),128))],512),e("div",q,[e("div",z,[S(e("textarea",{"onUpdate:modelValue":d[0]||(d[0]=t=>l.value=t),onKeydown:v,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),[[C,l.value]]),e("button",{onClick:f,disabled:!l.value.trim()||r(n).isStreaming,class:"rounded-md bg-primary text-primary-foreground p-2 hover:bg-primary/90 disabled:opacity-50 transition-colors"},[r(n).isStreaming?(a(),u(r(T),{key:1,class:"w-4 h-4"})):(a(),u(r(B),{key:0,class:"w-4 h-4"}))],8,E)])])]))}});export{O as default};
1
+ import{o as h,G as _,Q as p,s as b,u as a,k as o,h as e,D as r,j as x,F as k,w,T as S,O as C,i as u,S as B,d as T,v as g,q as m,f as j,p as y}from"./index-1mPHTPeR.js";const V={class:"flex flex-col h-full"},D={key:0,class:"flex items-center justify-center h-full"},K={key:1,class:"text-muted-foreground"},M={key:2,class:"inline-block w-2 h-4 bg-current animate-pulse ml-1"},q={class:"border-t border-border p-4"},z={class:"flex gap-2 items-end"},E=["disabled"],O=h({__name:"ChatView",setup(F){const n=_(),l=g(""),i=g();async function f(){const s=l.value.trim();!s||n.isStreaming||(l.value="",await n.sendMessage(s))}function c(){i.value&&(i.value.scrollTop=i.value.scrollHeight)}function v(s){s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),f())}return p(()=>n.messages.map(s=>s.content),async()=>{await y(),c()},{deep:!0}),p(()=>n.messages.length,async()=>{await y(),c()}),b(()=>c()),(s,d)=>(a(),o("div",V,[e("div",{ref_key:"messagesContainer",ref:i,class:"flex-1 overflow-y-auto p-4 space-y-4"},[r(n).messages.length===0?(a(),o("div",D,[...d[1]||(d[1]=[e("div",{class:"text-center text-muted-foreground"},[e("div",{class:"text-4xl mb-3"},"🤖"),e("p",{class:"text-lg font-medium"},"Welcome to IO"),e("p",{class:"text-sm mt-1"},"Send a message to get started.")],-1)])])):x("",!0),(a(!0),o(k,null,w(r(n).messages,t=>(a(),o("div",{key:t.id,class:m(["flex",t.role==="user"?"justify-end":"justify-start"])},[e("div",{class:m(["max-w-[75%] rounded-lg px-4 py-2 text-sm",t.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"])},[t.content?(a(),u(j,{key:0,content:t.content,class:m(t.role==="user"?"prose-invert":"")},null,8,["content","class"])):(a(),o("span",K,"...")),t.streaming?(a(),o("div",M)):x("",!0)],2)],2))),128))],512),e("div",q,[e("div",z,[S(e("textarea",{"onUpdate:modelValue":d[0]||(d[0]=t=>l.value=t),onKeydown:v,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),[[C,l.value]]),e("button",{onClick:f,disabled:!l.value.trim()||r(n).isStreaming,class:"rounded-md bg-primary text-primary-foreground p-2 hover:bg-primary/90 disabled:opacity-50 transition-colors"},[r(n).isStreaming?(a(),u(r(T),{key:1,class:"w-4 h-4"})):(a(),u(r(B),{key:0,class:"w-4 h-4"}))],8,E)])])]))}});export{O as default};
@@ -1,4 +1,4 @@
1
- import{l as M,o as D,s as N,u as o,k as n,h as a,F as y,w as b,n as c,D as i,I as V,v as d,g as z,q as f,z as v,r as B,W as k,j as q,f as j}from"./index-C0KbNiVo.js";import{b as C,c as P,a as T}from"./api-BDaG6Xip.js";import{g as W}from"./squad-colors-B8B_Y-lz.js";import{T as A}from"./trash-2-BRFreQyG.js";/**
1
+ import{l as M,o as D,s as N,u as o,k as n,h as a,F as y,w as b,n as c,D as i,I as V,v as d,g as z,q as f,z as v,r as B,W as k,j as q,f as j}from"./index-1mPHTPeR.js";import{b as C,c as P,a as T}from"./api-C7MAaSLt.js";import{g as W}from"./squad-colors-B8B_Y-lz.js";import{T as A}from"./trash-2-CQowMVCO.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{o as U,Q as q,s as z,u as r,k as n,h as t,n as d,D as c,H as V,T,O as D,M as P,j as x,F as $,w as j,q as p,z as g,v as l,g as Q,i as E,f as G}from"./index-C0KbNiVo.js";import{b as A,a as O}from"./api-BDaG6Xip.js";import{S as R}from"./search-CfUBmHvO.js";import{A as I}from"./arrow-left-CYcbDJsp.js";import{T as J}from"./trash-2-BRFreQyG.js";const K={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,Le=U({__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 A(`/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 B(o){u.value=o,_.value=!0;try{b.value=await A(`/history/${o}`)}finally{_.value=!1}}function L(){u.value=null,b.value=[]}async function F(o,e){e.stopPropagation(),confirm("Delete this conversation?")&&(await O(`/history/${o}`),a.value=a.value.filter(i=>i.id!==o),h.value=Math.max(0,h.value-1),u.value===o&&L())}function C(o){return new Date(o).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function H(o,e=100){return o.length>e?o.slice(0,e)+"…":o}const N=Q(()=>a.value.length<h.value);let S=null;return q([f,v,m],()=>{S&&clearTimeout(S),S=setTimeout(()=>k(!0),300)}),z(()=>k(!0)),(o,e)=>{var i;return r(),n("div",K,[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(V),{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(R),{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),[[D,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),[[D,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),[[D,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(P),{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,j(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:M=>B(s.id)},[t("div",ae,[t("p",le,g(H(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:M=>F(s.id,M)},[d(c(J),{class:"w-3.5 h-3.5"})],8,ce)],10,ne))),128)),N.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:L},[d(c(I),{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,j(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(),E(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(V),{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{Le as default};
1
+ import{o as U,Q as q,s as z,u as r,k as n,h as t,n as d,D as c,H as V,T,O as D,M as P,j as x,F as $,w as j,q as p,z as g,v as l,g as Q,i as E,f as G}from"./index-1mPHTPeR.js";import{b as A,a as O}from"./api-C7MAaSLt.js";import{S as R}from"./search-BeUz6qvn.js";import{A as I}from"./arrow-left-4L8HoaXC.js";import{T as J}from"./trash-2-CQowMVCO.js";const K={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,Le=U({__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 A(`/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 B(o){u.value=o,_.value=!0;try{b.value=await A(`/history/${o}`)}finally{_.value=!1}}function L(){u.value=null,b.value=[]}async function F(o,e){e.stopPropagation(),confirm("Delete this conversation?")&&(await O(`/history/${o}`),a.value=a.value.filter(i=>i.id!==o),h.value=Math.max(0,h.value-1),u.value===o&&L())}function C(o){return new Date(o).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function H(o,e=100){return o.length>e?o.slice(0,e)+"…":o}const N=Q(()=>a.value.length<h.value);let S=null;return q([f,v,m],()=>{S&&clearTimeout(S),S=setTimeout(()=>k(!0),300)}),z(()=>k(!0)),(o,e)=>{var i;return r(),n("div",K,[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(V),{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(R),{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),[[D,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),[[D,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),[[D,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(P),{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,j(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:M=>B(s.id)},[t("div",ae,[t("p",le,g(H(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:M=>F(s.id,M)},[d(c(J),{class:"w-3.5 h-3.5"})],8,ce)],10,ne))),128)),N.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:L},[d(c(I),{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,j(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(),E(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(V),{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{Le as default};
@@ -1 +1 @@
1
- import{o as b,E as v,u,k as i,h as t,n as y,W as w,T as m,O as p,z as f,j as h,D as g,v as d,_,K as S}from"./index-C0KbNiVo.js";const V={class:"min-h-screen flex items-center justify-center bg-background p-4"},k={class:"w-full max-w-sm space-y-8"},D={class:"text-center"},A={key:0,class:"text-sm text-destructive"},B=["disabled"],L=b({__name:"LoginView",setup(E){const o=v(),c=S(),r=d(""),n=d(""),s=d("");async function x(){s.value="";try{await o.login(r.value,n.value),c.push("/")}catch(l){s.value=l.message??"Login failed"}}return(l,e)=>(u(),i("div",V,[t("div",k,[t("div",D,[y(_,{size:56,class:"mx-auto mb-4"}),e[2]||(e[2]=t("h1",{class:"text-2xl font-bold 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,f(s.value),1)):h("",!0),t("button",{type:"submit",disabled:g(o).loading,class:"btn-gradient w-full py-2.5"},f(g(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{o as b,E as v,u,k as i,h as t,n as y,W as w,T as m,O as p,z as f,j as h,D as g,v as d,_,K as S}from"./index-1mPHTPeR.js";const V={class:"min-h-screen flex items-center justify-center bg-background p-4"},k={class:"w-full max-w-sm space-y-8"},D={class:"text-center"},A={key:0,class:"text-sm text-destructive"},B=["disabled"],L=b({__name:"LoginView",setup(E){const o=v(),c=S(),r=d(""),n=d(""),s=d("");async function x(){s.value="";try{await o.login(r.value,n.value),c.push("/")}catch(l){s.value=l.message??"Login failed"}}return(l,e)=>(u(),i("div",V,[t("div",k,[t("div",D,[y(_,{size:56,class:"mx-auto mb-4"}),e[2]||(e[2]=t("h1",{class:"text-2xl font-bold 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,f(s.value),1)):h("",!0),t("button",{type:"submit",disabled:g(o).loading,class:"btn-gradient w-full py-2.5"},f(g(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{o as k,s as C,u as a,k as n,h as t,n as m,D as p,m as h,T as u,O as v,N as S,j as _,c as V,F as N,w as M,v as i,z as b,q as y}from"./index-C0KbNiVo.js";import{b as P,c as T,d as U,a as $}from"./api-BDaG6Xip.js";import{P as D}from"./plus-Dd6C-pDL.js";import{T as j}from"./trash-2-BRFreQyG.js";const B={class:"p-6"},L={class:"flex items-center justify-between mb-6"},z={key:0,class:"border border-border rounded-lg p-4 mb-6 space-y-3"},A={class:"grid grid-cols-2 gap-3"},F={key:0},q={key:1},E={key:1,class:"text-muted-foreground"},G={key:2,class:"text-center py-12 text-muted-foreground"},O={key:3,class:"space-y-2"},R={class:"font-medium text-sm"},H={class:"ml-2 text-xs text-muted-foreground bg-secondary px-1.5 py-0.5 rounded"},I={class:"flex items-center gap-3"},J=["onClick"],K=["onClick"],ee=k({__name:"McpView",setup(Q){const d=i([]),c=i(!0),r=i(!1),o=i({name:"",type:"stdio",command:"",url:""});C(async()=>{try{d.value=await P("/mcp")}finally{c.value=!1}});async function f(l){await U(`/mcp/${l.id}`,{enabled:!l.enabled}),l.enabled=!l.enabled}async function x(l){await $(`/mcp/${l}`),d.value=d.value.filter(e=>e.id!==l)}async function g(){const l={name:o.value.name,type:o.value.type};o.value.type==="stdio"?l.command=o.value.command:l.url=o.value.url;const e=await T("/mcp",l);d.value.push(e),r.value=!1,o.value={name:"",type:"stdio",command:"",url:""}}return(l,e)=>(a(),n("div",B,[t("div",L,[e[6]||(e[6]=t("h1",{class:"text-2xl font-bold"},"MCP Servers",-1)),t("button",{onClick:e[0]||(e[0]=s=>r.value=!r.value),class:"inline-flex items-center gap-1 px-3 py-1.5 text-sm rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors"},[m(p(D),{class:"w-4 h-4"}),e[5]||(e[5]=h(" Add Server ",-1))])]),r.value?(a(),n("div",z,[t("div",A,[t("div",null,[e[7]||(e[7]=t("label",{class:"text-sm font-medium"},"Name",-1)),u(t("input",{"onUpdate:modelValue":e[1]||(e[1]=s=>o.value.name=s),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[v,o.value.name]])]),t("div",null,[e[9]||(e[9]=t("label",{class:"text-sm font-medium"},"Type",-1)),u(t("select",{"onUpdate:modelValue":e[2]||(e[2]=s=>o.value.type=s),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[8]||(e[8]=[t("option",{value:"stdio"},"stdio",-1),t("option",{value:"http"},"http",-1)])],512),[[S,o.value.type]])])]),o.value.type==="stdio"?(a(),n("div",F,[e[10]||(e[10]=t("label",{class:"text-sm font-medium"},"Command",-1)),u(t("input",{"onUpdate:modelValue":e[3]||(e[3]=s=>o.value.command=s),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),[[v,o.value.command]])])):(a(),n("div",q,[e[11]||(e[11]=t("label",{class:"text-sm font-medium"},"URL",-1)),u(t("input",{"onUpdate:modelValue":e[4]||(e[4]=s=>o.value.url=s),placeholder:"https://...",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[v,o.value.url]])])),t("button",{onClick:g,class:"px-4 py-2 text-sm rounded-md bg-primary text-primary-foreground hover:bg-primary/90"},"Save")])):_("",!0),c.value?(a(),n("div",E,"Loading...")):d.value.length===0?(a(),n("div",G,[m(p(V),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[12]||(e[12]=t("p",null,"No MCP servers configured.",-1))])):(a(),n("div",O,[(a(!0),n(N,null,M(d.value,s=>(a(),n("div",{key:s.id,class:"flex items-center justify-between border border-border rounded-lg px-4 py-3"},[t("div",null,[t("span",R,b(s.name),1),t("span",H,b(s.type),1)]),t("div",I,[t("button",{onClick:w=>f(s),class:y(["relative w-10 h-5 rounded-full transition-colors",s.enabled?"bg-primary":"bg-muted"])},[t("span",{class:y(["absolute top-0.5 w-4 h-4 rounded-full bg-white transition-transform",s.enabled?"translate-x-5":"translate-x-0.5"])},null,2)],10,J),t("button",{onClick:w=>x(s.id),class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive"},[m(p(j),{class:"w-4 h-4"})],8,K)])]))),128))]))]))}});export{ee as default};
1
+ import{o as k,s as C,u as a,k as n,h as t,n as m,D as p,m as h,T as u,O as v,N as S,j as _,c as V,F as N,w as M,v as i,z as b,q as y}from"./index-1mPHTPeR.js";import{b as P,c as T,d as U,a as $}from"./api-C7MAaSLt.js";import{P as D}from"./plus-BhwZCs3M.js";import{T as j}from"./trash-2-CQowMVCO.js";const B={class:"p-6"},L={class:"flex items-center justify-between mb-6"},z={key:0,class:"border border-border rounded-lg p-4 mb-6 space-y-3"},A={class:"grid grid-cols-2 gap-3"},F={key:0},q={key:1},E={key:1,class:"text-muted-foreground"},G={key:2,class:"text-center py-12 text-muted-foreground"},O={key:3,class:"space-y-2"},R={class:"font-medium text-sm"},H={class:"ml-2 text-xs text-muted-foreground bg-secondary px-1.5 py-0.5 rounded"},I={class:"flex items-center gap-3"},J=["onClick"],K=["onClick"],ee=k({__name:"McpView",setup(Q){const d=i([]),c=i(!0),r=i(!1),o=i({name:"",type:"stdio",command:"",url:""});C(async()=>{try{d.value=await P("/mcp")}finally{c.value=!1}});async function f(l){await U(`/mcp/${l.id}`,{enabled:!l.enabled}),l.enabled=!l.enabled}async function x(l){await $(`/mcp/${l}`),d.value=d.value.filter(e=>e.id!==l)}async function g(){const l={name:o.value.name,type:o.value.type};o.value.type==="stdio"?l.command=o.value.command:l.url=o.value.url;const e=await T("/mcp",l);d.value.push(e),r.value=!1,o.value={name:"",type:"stdio",command:"",url:""}}return(l,e)=>(a(),n("div",B,[t("div",L,[e[6]||(e[6]=t("h1",{class:"text-2xl font-bold"},"MCP Servers",-1)),t("button",{onClick:e[0]||(e[0]=s=>r.value=!r.value),class:"inline-flex items-center gap-1 px-3 py-1.5 text-sm rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors"},[m(p(D),{class:"w-4 h-4"}),e[5]||(e[5]=h(" Add Server ",-1))])]),r.value?(a(),n("div",z,[t("div",A,[t("div",null,[e[7]||(e[7]=t("label",{class:"text-sm font-medium"},"Name",-1)),u(t("input",{"onUpdate:modelValue":e[1]||(e[1]=s=>o.value.name=s),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[v,o.value.name]])]),t("div",null,[e[9]||(e[9]=t("label",{class:"text-sm font-medium"},"Type",-1)),u(t("select",{"onUpdate:modelValue":e[2]||(e[2]=s=>o.value.type=s),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[8]||(e[8]=[t("option",{value:"stdio"},"stdio",-1),t("option",{value:"http"},"http",-1)])],512),[[S,o.value.type]])])]),o.value.type==="stdio"?(a(),n("div",F,[e[10]||(e[10]=t("label",{class:"text-sm font-medium"},"Command",-1)),u(t("input",{"onUpdate:modelValue":e[3]||(e[3]=s=>o.value.command=s),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),[[v,o.value.command]])])):(a(),n("div",q,[e[11]||(e[11]=t("label",{class:"text-sm font-medium"},"URL",-1)),u(t("input",{"onUpdate:modelValue":e[4]||(e[4]=s=>o.value.url=s),placeholder:"https://...",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[v,o.value.url]])])),t("button",{onClick:g,class:"px-4 py-2 text-sm rounded-md bg-primary text-primary-foreground hover:bg-primary/90"},"Save")])):_("",!0),c.value?(a(),n("div",E,"Loading...")):d.value.length===0?(a(),n("div",G,[m(p(V),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[12]||(e[12]=t("p",null,"No MCP servers configured.",-1))])):(a(),n("div",O,[(a(!0),n(N,null,M(d.value,s=>(a(),n("div",{key:s.id,class:"flex items-center justify-between border border-border rounded-lg px-4 py-3"},[t("div",null,[t("span",R,b(s.name),1),t("span",H,b(s.type),1)]),t("div",I,[t("button",{onClick:w=>f(s),class:y(["relative w-10 h-5 rounded-full transition-colors",s.enabled?"bg-primary":"bg-muted"])},[t("span",{class:y(["absolute top-0.5 w-4 h-4 rounded-full bg-white transition-transform",s.enabled?"translate-x-5":"translate-x-0.5"])},null,2)],10,J),t("button",{onClick:w=>x(s.id),class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive"},[m(p(j),{class:"w-4 h-4"})],8,K)])]))),128))]))]))}});export{ee as default};
@@ -1,4 +1,4 @@
1
- import{l as B,o as L,s as O,u as r,k as d,h as o,n as v,D as m,m as j,F as x,w as y,T as b,N as S,O as h,j as _,b as z,z as l,v as u,g as M,q as w,r as A}from"./index-C0KbNiVo.js";import{b as C,c as T,d as E,a as F}from"./api-BDaG6Xip.js";import{g as G}from"./squad-colors-B8B_Y-lz.js";import{P as R}from"./plus-Dd6C-pDL.js";import{T as H}from"./trash-2-BRFreQyG.js";/**
1
+ import{l as B,o as L,s as O,u as r,k as d,h as o,n as v,D as m,m as j,F as x,w as y,T as b,N as S,O as h,j as _,b as z,z as l,v as u,g as M,q as w,r as A}from"./index-1mPHTPeR.js";import{b as C,c as T,d as E,a as F}from"./api-C7MAaSLt.js";import{g as G}from"./squad-colors-B8B_Y-lz.js";import{P as R}from"./plus-BhwZCs3M.js";import{T as H}from"./trash-2-CQowMVCO.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{o as w,s as E,u as d,k as s,h as t,z as g,F as x,w as U,T as a,O as n,N as T,L as p,j as b,v as r,q as M}from"./index-C0KbNiVo.js";import{b as V,d as S}from"./api-BDaG6Xip.js";const z={class:"p-6"},A={class:"flex items-center justify-between mb-6"},N=["disabled"],B={key:0,class:"text-muted-foreground"},C={class:"flex gap-1 border-b border-border mb-6"},I=["onClick"],D={key:0,class:"space-y-4 max-w-lg"},K={class:"flex items-center gap-3"},L={key:1,class:"space-y-4 max-w-lg"},j={class:"flex items-center gap-3"},O={key:2,class:"space-y-4 max-w-lg"},q={key:3,class:"space-y-4 max-w-lg"},F={class:"flex items-center gap-3"},G={class:"flex items-center gap-3"},H=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"}],o=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");o.value=v}finally{f.value=!1}}async function c(){i.value=!0,m.value=!1;try{await S("/settings",o.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,N)]),f.value?(d(),s("div",B,"Loading...")):(d(),s(x,{key:1},[t("div",C,[(d(),s(x,null,U(y,l=>t("button",{key:l.id,onClick:R=>u.value=l.id,class:M(["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",D,[t("div",null,[e[13]||(e[13]=t("label",{class:"text-sm font-medium"},"Default Model",-1)),a(t("input",{"onUpdate:modelValue":e[0]||(e[0]=l=>o.value.defaultModel=l),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,o.value.defaultModel]])]),t("div",null,[e[14]||(e[14]=t("label",{class:"text-sm font-medium"},"Port",-1)),a(t("input",{"onUpdate:modelValue":e[1]||(e[1]=l=>o.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,o.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)),a(t("select",{"onUpdate:modelValue":e[2]||(e[2]=l=>o.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),[[T,o.value.backgroundNotifyMode]])]),t("div",K,[a(t("input",{"onUpdate:modelValue":e[3]||(e[3]=l=>o.value.backgroundNotifyTelegram=l),type:"checkbox",id:"notifyTelegram",class:"rounded"},null,512),[[p,o.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)),a(t("input",{"onUpdate:modelValue":e[4]||(e[4]=l=>o.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,o.value.telegramBotToken]])]),t("div",null,[e[20]||(e[20]=t("label",{class:"text-sm font-medium"},"Authorized User ID",-1)),a(t("input",{"onUpdate:modelValue":e[5]||(e[5]=l=>o.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,o.value.authorizedUserId,void 0,{number:!0}]])]),t("div",j,[a(t("input",{"onUpdate:modelValue":e[6]||(e[6]=l=>o.value.telegramEnabled=l),type:"checkbox",id:"telegramEnabled",class:"rounded"},null,512),[[p,o.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",O,[t("div",null,[e[22]||(e[22]=t("label",{class:"text-sm font-medium"},"Supabase URL",-1)),a(t("input",{"onUpdate:modelValue":e[7]||(e[7]=l=>o.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,o.value.supabaseUrl]])]),t("div",null,[e[23]||(e[23]=t("label",{class:"text-sm font-medium"},"Supabase Anon Key",-1)),a(t("input",{"onUpdate:modelValue":e[8]||(e[8]=l=>o.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,o.value.supabaseAnonKey]])]),t("div",null,[e[24]||(e[24]=t("label",{class:"text-sm font-medium"},"Authorized Email",-1)),a(t("input",{"onUpdate:modelValue":e[9]||(e[9]=l=>o.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,o.value.authorizedEmail]])])])):b("",!0),u.value==="advanced"?(d(),s("div",q,[t("div",F,[a(t("input",{"onUpdate:modelValue":e[10]||(e[10]=l=>o.value.selfEditEnabled=l),type:"checkbox",id:"selfEdit",class:"rounded"},null,512),[[p,o.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",G,[a(t("input",{"onUpdate:modelValue":e[11]||(e[11]=l=>o.value.watchdogEnabled=l),type:"checkbox",id:"watchdog",class:"rounded"},null,512),[[p,o.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{H as default};
1
+ import{o as w,s as E,u as d,k as s,h as t,z as g,F as x,w as U,T as a,O as n,N as T,L as p,j as b,v as r,q as M}from"./index-1mPHTPeR.js";import{b as V,d as S}from"./api-C7MAaSLt.js";const z={class:"p-6"},A={class:"flex items-center justify-between mb-6"},N=["disabled"],B={key:0,class:"text-muted-foreground"},C={class:"flex gap-1 border-b border-border mb-6"},I=["onClick"],D={key:0,class:"space-y-4 max-w-lg"},K={class:"flex items-center gap-3"},L={key:1,class:"space-y-4 max-w-lg"},j={class:"flex items-center gap-3"},O={key:2,class:"space-y-4 max-w-lg"},q={key:3,class:"space-y-4 max-w-lg"},F={class:"flex items-center gap-3"},G={class:"flex items-center gap-3"},H=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"}],o=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");o.value=v}finally{f.value=!1}}async function c(){i.value=!0,m.value=!1;try{await S("/settings",o.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,N)]),f.value?(d(),s("div",B,"Loading...")):(d(),s(x,{key:1},[t("div",C,[(d(),s(x,null,U(y,l=>t("button",{key:l.id,onClick:R=>u.value=l.id,class:M(["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",D,[t("div",null,[e[13]||(e[13]=t("label",{class:"text-sm font-medium"},"Default Model",-1)),a(t("input",{"onUpdate:modelValue":e[0]||(e[0]=l=>o.value.defaultModel=l),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,o.value.defaultModel]])]),t("div",null,[e[14]||(e[14]=t("label",{class:"text-sm font-medium"},"Port",-1)),a(t("input",{"onUpdate:modelValue":e[1]||(e[1]=l=>o.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,o.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)),a(t("select",{"onUpdate:modelValue":e[2]||(e[2]=l=>o.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),[[T,o.value.backgroundNotifyMode]])]),t("div",K,[a(t("input",{"onUpdate:modelValue":e[3]||(e[3]=l=>o.value.backgroundNotifyTelegram=l),type:"checkbox",id:"notifyTelegram",class:"rounded"},null,512),[[p,o.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)),a(t("input",{"onUpdate:modelValue":e[4]||(e[4]=l=>o.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,o.value.telegramBotToken]])]),t("div",null,[e[20]||(e[20]=t("label",{class:"text-sm font-medium"},"Authorized User ID",-1)),a(t("input",{"onUpdate:modelValue":e[5]||(e[5]=l=>o.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,o.value.authorizedUserId,void 0,{number:!0}]])]),t("div",j,[a(t("input",{"onUpdate:modelValue":e[6]||(e[6]=l=>o.value.telegramEnabled=l),type:"checkbox",id:"telegramEnabled",class:"rounded"},null,512),[[p,o.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",O,[t("div",null,[e[22]||(e[22]=t("label",{class:"text-sm font-medium"},"Supabase URL",-1)),a(t("input",{"onUpdate:modelValue":e[7]||(e[7]=l=>o.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,o.value.supabaseUrl]])]),t("div",null,[e[23]||(e[23]=t("label",{class:"text-sm font-medium"},"Supabase Anon Key",-1)),a(t("input",{"onUpdate:modelValue":e[8]||(e[8]=l=>o.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,o.value.supabaseAnonKey]])]),t("div",null,[e[24]||(e[24]=t("label",{class:"text-sm font-medium"},"Authorized Email",-1)),a(t("input",{"onUpdate:modelValue":e[9]||(e[9]=l=>o.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,o.value.authorizedEmail]])])])):b("",!0),u.value==="advanced"?(d(),s("div",q,[t("div",F,[a(t("input",{"onUpdate:modelValue":e[10]||(e[10]=l=>o.value.selfEditEnabled=l),type:"checkbox",id:"selfEdit",class:"rounded"},null,512),[[p,o.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",G,[a(t("input",{"onUpdate:modelValue":e[11]||(e[11]=l=>o.value.watchdogEnabled=l),type:"checkbox",id:"watchdog",class:"rounded"},null,512),[[p,o.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{H as default};
@@ -1,4 +1,4 @@
1
- import{l as fe,o as me,s as xe,u as o,k as a,h as t,q as E,n as u,D as d,m as q,F as p,T as C,O as M,V as ee,z as r,j as S,P as te,w as se,N as ge,i as oe,f as le,v as n,g as ye,W as ae}from"./index-C0KbNiVo.js";import{b as z,c as O,d as be,a as ke}from"./api-BDaG6Xip.js";import{P as ne}from"./plus-Dd6C-pDL.js";import{S as he}from"./search-CfUBmHvO.js";import{P as _e,S as we}from"./save-BbLvUy1x.js";import{X as Ce}from"./x-fwHpZ8VZ.js";import{T as Se}from"./trash-2-BRFreQyG.js";/**
1
+ import{l as fe,o as me,s as xe,u as o,k as a,h as t,q as E,n as u,D as d,m as q,F as p,T as C,O as M,V as ee,z as r,j as S,P as te,w as se,N as ge,i as oe,f as le,v as n,g as ye,W as ae}from"./index-1mPHTPeR.js";import{b as z,c as O,d as be,a as ke}from"./api-C7MAaSLt.js";import{P as ne}from"./plus-BhwZCs3M.js";import{S as he}from"./search-BeUz6qvn.js";import{P as _e,S as we}from"./save-Cl5b973n.js";import{X as Ce}from"./x-Czw2unv0.js";import{T as Se}from"./trash-2-CQowMVCO.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{l as A,o as J,Q as V,s as z,p as R,t as H,u as s,k as o,h as t,n as p,D as c,A as B,q as _,z as i,d as F,m as h,j as v,i as I,F as C,w as D,f as E,v as m,g as G,R as U,r as Q,J as X,x as Z,U as W}from"./index-C0KbNiVo.js";import{b as O,e as K,c as P,a as Y}from"./api-BDaG6Xip.js";import{g as ee}from"./squad-colors-B8B_Y-lz.js";import{X as te}from"./x-fwHpZ8VZ.js";import{G as se}from"./git-branch-DqLb0pDI.js";import{T as oe}from"./trash-2-BRFreQyG.js";import{A as re}from"./arrow-left-CYcbDJsp.js";/**
1
+ import{l as A,o as J,Q as V,s as z,p as R,t as H,u as s,k as o,h as t,n as p,D as c,A as B,q as _,z as i,d as F,m as h,j as v,i as I,F as C,w as D,f as E,v as m,g as G,R as U,r as Q,J as X,x as Z,U as W}from"./index-1mPHTPeR.js";import{b as O,e as K,c as P,a as Y}from"./api-C7MAaSLt.js";import{g as ee}from"./squad-colors-B8B_Y-lz.js";import{X as te}from"./x-Czw2unv0.js";import{G as se}from"./git-branch-CmEyTvTW.js";import{T as oe}from"./trash-2-CQowMVCO.js";import{A as re}from"./arrow-left-4L8HoaXC.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 B}from"./api-BDaG6Xip.js";import{l as I,o as L,s as M,u as o,k as n,h as t,n as u,D as l,A as T,m as g,e as _,F as f,w as h,v,g as N,q as k,R as P,z as a,i as x,j as p,b,x as V}from"./index-C0KbNiVo.js";import{T as w}from"./triangle-alert-DHtoc69N.js";import{G as $}from"./git-branch-DqLb0pDI.js";/**
1
+ import{b as B}from"./api-C7MAaSLt.js";import{l as I,o as L,s as M,u as o,k as n,h as t,n as u,D as l,A as T,m as g,e as _,F as f,w as h,v,g as N,q as k,R as P,z as a,i as x,j as p,b,x as V}from"./index-1mPHTPeR.js";import{T as w}from"./triangle-alert-zxlYFyjw.js";import{G as $}from"./git-branch-CmEyTvTW.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-BDaG6Xip.js";import{g as v}from"./squad-colors-B8B_Y-lz.js";import{l as h,o as k,s as b,u as o,k as r,h as t,n as c,D as l,e as w,F as L,w as C,v as d,i as S,R as B,r as f,x as N,z as n,m as _,j as V}from"./index-C0KbNiVo.js";import{G as j}from"./git-branch-DqLb0pDI.js";/**
1
+ import{b as y}from"./api-C7MAaSLt.js";import{g as v}from"./squad-colors-B8B_Y-lz.js";import{l as h,o as k,s as b,u as o,k as r,h as t,n as c,D as l,e as w,F as L,w as C,v as d,i as S,R as B,r as f,x as N,z as n,m as _,j as V}from"./index-1mPHTPeR.js";import{G as j}from"./git-branch-CmEyTvTW.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{l as q,o as Q,s as R,u as d,k as r,h as t,n as _,D as k,C as W,F as i,w as m,m as w,z as o,e as X,j as u,T as O,O as B,v as a,q as Y,r as Z,g as tt}from"./index-C0KbNiVo.js";import{b as T,d as z}from"./api-BDaG6Xip.js";import{T as et}from"./triangle-alert-DHtoc69N.js";/**
1
+ import{l as q,o as Q,s as R,u as d,k as r,h as t,n as _,D as k,C as W,F as i,w as m,m as w,z as o,e as X,j as u,T as O,O as B,v as a,q as Y,r as Z,g as tt}from"./index-1mPHTPeR.js";import{b as T,d as z}from"./api-C7MAaSLt.js";import{T as et}from"./triangle-alert-zxlYFyjw.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{l as P,o as oe,Q as se,u as s,k as a,F as y,w as Q,g as A,h as t,i as B,D as d,n as v,z as j,r as ce,q as E,W as ve,j as I,v as c,s as pe,B as K,m as S,T as L,O as N,V as Z,f as O}from"./index-C0KbNiVo.js";import{b as M,d as z,a as R}from"./api-BDaG6Xip.js";import{S as fe}from"./search-CfUBmHvO.js";import{P as G}from"./plus-Dd6C-pDL.js";import{P as X,S as J}from"./save-BbLvUy1x.js";import{T as Y}from"./trash-2-BRFreQyG.js";import{X as ee}from"./x-fwHpZ8VZ.js";/**
1
+ import{l as P,o as oe,Q as se,u as s,k as a,F as y,w as Q,g as A,h as t,i as B,D as d,n as v,z as j,r as ce,q as E,W as ve,j as I,v as c,s as pe,B as K,m as S,T as L,O as N,V as Z,f as O}from"./index-1mPHTPeR.js";import{b as M,d as z,a as R}from"./api-C7MAaSLt.js";import{S as fe}from"./search-BeUz6qvn.js";import{P as G}from"./plus-BhwZCs3M.js";import{P as X,S as J}from"./save-Cl5b973n.js";import{T as Y}from"./trash-2-CQowMVCO.js";import{X as ee}from"./x-Czw2unv0.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{E as i,y as c}from"./index-C0KbNiVo.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{E as i,y as c}from"./index-1mPHTPeR.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{l as e}from"./index-C0KbNiVo.js";/**
1
+ import{l as e}from"./index-1mPHTPeR.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{l as c}from"./index-C0KbNiVo.js";/**
1
+ import{l as c}from"./index-1mPHTPeR.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-CHUgkqrF.js","assets/api-BDaG6Xip.js","assets/squad-colors-B8B_Y-lz.js","assets/git-branch-DqLb0pDI.js","assets/SquadHealthView-FXC83WjQ.js","assets/triangle-alert-DHtoc69N.js","assets/SquadDetailView-CUIzmUNq.js","assets/x-fwHpZ8VZ.js","assets/trash-2-BRFreQyG.js","assets/arrow-left-CYcbDJsp.js","assets/FeedView-CL_gGs8m.js","assets/SkillsView-DRDyKLbJ.js","assets/plus-Dd6C-pDL.js","assets/search-CfUBmHvO.js","assets/save-BbLvUy1x.js","assets/McpView-Bg7ikSzn.js","assets/SchedulesView-dzgRNuBk.js","assets/HistoryView-BEv5KtjC.js","assets/WikiView-CoJ4i7WL.js","assets/UsageView-TD-tGZmI.js","assets/AuditLogView-Cdx7vZdd.js","assets/SettingsView-C3ucjaBU.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SquadsView-CYHJHUTi.js","assets/api-C7MAaSLt.js","assets/squad-colors-B8B_Y-lz.js","assets/git-branch-CmEyTvTW.js","assets/SquadHealthView-S7L-ux5R.js","assets/triangle-alert-zxlYFyjw.js","assets/SquadDetailView-B8eH9uCp.js","assets/x-Czw2unv0.js","assets/trash-2-CQowMVCO.js","assets/arrow-left-4L8HoaXC.js","assets/FeedView-BaGHVS5k.js","assets/SkillsView-BFEE6Dr7.js","assets/plus-BhwZCs3M.js","assets/search-BeUz6qvn.js","assets/save-Cl5b973n.js","assets/McpView-D1HjpDaS.js","assets/SchedulesView-heDgZ6EX.js","assets/HistoryView-54tTZBvl.js","assets/WikiView-CXXw3RGo.js","assets/UsageView-Brck8R6H.js","assets/AuditLogView-blV2zh1J.js","assets/SettingsView-BkzrjzlA.js"])))=>i.map(i=>d[i]);
2
2
  var rh=Object.defineProperty;var nh=(t,e,r)=>e in t?rh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var fe=(t,e,r)=>nh(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 sh="modulepreload",ih=function(t){return"/"+t},zo={},Me=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=ih(c),c in zo)return;zo[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":sh,u||(d.as="script"),d.crossOrigin="",d.href=c,l&&d.setAttribute("nonce",l),document.head.appendChild(d),u)return new Promise((f,g)=>{d.addEventListener("load",f),d.addEventListener("error",()=>g(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
@@ -152,7 +152,7 @@ var rh=Object.defineProperty;var nh=(t,e,r)=>e in t?rh(t,e,{enumerable:!0,config
152
152
  *
153
153
  * This source code is licensed under the ISC license.
154
154
  * See the LICENSE file in the root directory of this source tree.
155
- */const Sg=Te("UsersIcon",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),Eg={key:0,class:"text-base font-bold tracking-tight bg-gradient-brand bg-clip-text text-transparent"},Tg=["title"],Ag={class:"flex-1 p-2 space-y-0.5 overflow-y-auto"},xg={key:0},Rg={class:"border-t border-border p-2 space-y-0.5"},Cg={key:0},Og=["href"],Xa="https://github.com/michaeljolley/io",Pg=ur({__name:"AppSidebar",setup(t){const e=Oo(),r=et(!1),n=[{name:"Chat",icon:Za,path:"/"},{name:"History",icon:hg,path:"/history"},{name:"Squads",icon:Sg,path:"/squads"},{name:"Health",icon:ig,path:"/squads/health"},{name:"Usage",icon:ag,path:"/usage"},{name:"Audit Log",icon:lg,path:"/audit-log"},{name:"Skills",icon:yg,path:"/skills"},{name:"MCP Servers",icon:bg,path:"/mcp"},{name:"Schedules",icon:cg,path:"/schedules"},{name:"Wiki",icon:og,path:"/wiki"}],s=[{name:"Chat",icon:Za,path:"/"},{name:"Feed",icon:_u,path:"/feed"},{name:"Settings",icon:_g,path:"/settings"}],i="1.4.1",o=Ue(()=>{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=So("router-link");return oe(),Ee("aside",{class:at(["border-r border-border bg-sidebar flex flex-col h-full shrink-0 transition-all duration-200",r.value?"w-16":"w-56"])},[ve("div",{class:at(["p-3 border-b border-border flex items-center",r.value?"justify-center":"justify-between"])},[ue(u,{to:"/",class:at(["flex items-center gap-2",r.value?"justify-center":""])},{default:Kr(()=>[ue(rg,{size:24}),r.value?Qe("",!0):(oe(),Ee("h1",Eg,"IO"))]),_:1},8,["class"]),r.value?Qe("",!0):(oe(),Ee("button",{key:0,onClick:a,class:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:r.value?"Expand sidebar":"Collapse sidebar"},[ue(_e(gg),{class:"w-4 h-4"})],8,Tg))],2),r.value?(oe(),Ee("button",{key:0,onClick:a,class:"mx-auto mt-2 p-1.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:"Expand sidebar"},[ue(_e(mg),{class:"w-4 h-4"})])):Qe("",!0),ve("nav",Ag,[(oe(),Ee(Ye,null,Ni(n,h=>ue(u,{key:h.path,to:h.path,class:at(["flex items-center gap-3 rounded-md text-sm transition-colors",[r.value?"justify-center px-2 py-2":"px-3 py-2",o.value===h.path?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-accent hover:text-foreground"]]),title:r.value?h.name:void 0},{default:Kr(()=>[(oe(),Wt(ea(h.icon),{class:"w-4 h-4 shrink-0"})),r.value?Qe("",!0):(oe(),Ee("span",xg,ps(h.name),1))]),_:2},1032,["to","class","title"])),64))]),ve("div",Rg,[(oe(),Ee(Ye,null,Ni(s,h=>ue(u,{key:h.path,to:h.path,class:at(["flex items-center gap-3 rounded-md text-sm transition-colors",[r.value?"justify-center px-2 py-2":"px-3 py-2",o.value===h.path?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-accent hover:text-foreground"]]),title:r.value?h.name:void 0},{default:Kr(()=>[(oe(),Wt(ea(h.icon),{class:"w-4 h-4 shrink-0"})),r.value?Qe("",!0):(oe(),Ee("span",Cg,ps(h.name),1))]),_:2},1032,["to","class","title"])),64)),ve("div",{class:at(["flex items-center pt-2 mt-2 border-t border-border",r.value?"justify-center":"justify-between px-3"])},[r.value?Qe("",!0):(oe(),Ee("a",{key:0,href:`${Xa}/releases/tag/v${_e(i)}`,target:"_blank",class:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",title:"Release notes"}," v"+ps(_e(i)),9,Og)),ve("a",{href:Xa,target:"_blank",class:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:"GitHub repository"},[ue(_e(ug),{class:"w-3.5 h-3.5"})])],2)])],2)}}});function ti(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 Ig(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 jg=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class Po 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 $g extends Po{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class el extends Po{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class tl extends Po{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Gi;(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"})(Gi||(Gi={}));class Ng{constructor(e,{headers:r={},customFetch:n,region:s=Gi.Any}={}){this.url=e,this.headers=r,this.region=s,this.fetch=jg(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return Ig(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 g=new URL(`${this.url}/${r}`);f&&f!=="any"&&(d["x-region"]=f,g.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 k=u;h&&(o=new AbortController,i=setTimeout(()=>o.abort(),h),u?(k=o.signal,u.addEventListener("abort",()=>o.abort())):k=o.signal);const w=yield this.fetch(g.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},d),this.headers),a),body:y,signal:k}).catch(D=>{throw new $g(D)}),_=w.headers.get("x-relay-error");if(_&&_==="true")throw new el(w);if(!w.ok)throw new tl(w);let b=((s=w.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),x;return b==="application/json"?x=yield w.json():b==="application/octet-stream"||b==="application/pdf"?x=yield w.blob():b==="text/event-stream"?x=w:b==="multipart/form-data"?x=yield w.formData():x=yield w.text(),{data:x,error:null,response:w}}catch(a){return{data:null,error:a,response:a instanceof tl||a instanceof el?a.context:void 0}}finally{i&&clearTimeout(i)}})}}const wu=3,rl=t=>Math.min(1e3*2**t,3e4),Lg=[520,503],ku=["GET","HEAD","OPTIONS"];var Dg=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 nl(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 Ug(t,e,r,n){return!(!n||r>=wu||!ku.includes(t)||!Lg.includes(e))}var Bg=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"||!ku.includes(r.method))throw h;if(r.retryEnabled&&o<wu){const d=rl(o);o++,await nl(d,r.signal);continue}throw h}if(Ug(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:rl(o);await u.text(),o++,await nl(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,g,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=`${(g=o==null?void 0:o.name)!==null&&g!==void 0?g:"FetchError"}: ${o==null?void 0:o.message}`,l+=`
155
+ */const Sg=Te("UsersIcon",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),Eg={key:0,class:"text-base font-bold tracking-tight bg-gradient-brand bg-clip-text text-transparent"},Tg=["title"],Ag={class:"flex-1 p-2 space-y-0.5 overflow-y-auto"},xg={key:0},Rg={class:"border-t border-border p-2 space-y-0.5"},Cg={key:0},Og=["href"],Xa="https://github.com/michaeljolley/io",Pg=ur({__name:"AppSidebar",setup(t){const e=Oo(),r=et(!1),n=[{name:"Chat",icon:Za,path:"/"},{name:"History",icon:hg,path:"/history"},{name:"Squads",icon:Sg,path:"/squads"},{name:"Health",icon:ig,path:"/squads/health"},{name:"Usage",icon:ag,path:"/usage"},{name:"Audit Log",icon:lg,path:"/audit-log"},{name:"Skills",icon:yg,path:"/skills"},{name:"MCP Servers",icon:bg,path:"/mcp"},{name:"Schedules",icon:cg,path:"/schedules"},{name:"Wiki",icon:og,path:"/wiki"}],s=[{name:"Chat",icon:Za,path:"/"},{name:"Feed",icon:_u,path:"/feed"},{name:"Settings",icon:_g,path:"/settings"}],i="1.4.3",o=Ue(()=>{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=So("router-link");return oe(),Ee("aside",{class:at(["border-r border-border bg-sidebar flex flex-col h-full shrink-0 transition-all duration-200",r.value?"w-16":"w-56"])},[ve("div",{class:at(["p-3 border-b border-border flex items-center",r.value?"justify-center":"justify-between"])},[ue(u,{to:"/",class:at(["flex items-center gap-2",r.value?"justify-center":""])},{default:Kr(()=>[ue(rg,{size:24}),r.value?Qe("",!0):(oe(),Ee("h1",Eg,"IO"))]),_:1},8,["class"]),r.value?Qe("",!0):(oe(),Ee("button",{key:0,onClick:a,class:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:r.value?"Expand sidebar":"Collapse sidebar"},[ue(_e(gg),{class:"w-4 h-4"})],8,Tg))],2),r.value?(oe(),Ee("button",{key:0,onClick:a,class:"mx-auto mt-2 p-1.5 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:"Expand sidebar"},[ue(_e(mg),{class:"w-4 h-4"})])):Qe("",!0),ve("nav",Ag,[(oe(),Ee(Ye,null,Ni(n,h=>ue(u,{key:h.path,to:h.path,class:at(["flex items-center gap-3 rounded-md text-sm transition-colors",[r.value?"justify-center px-2 py-2":"px-3 py-2",o.value===h.path?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-accent hover:text-foreground"]]),title:r.value?h.name:void 0},{default:Kr(()=>[(oe(),Wt(ea(h.icon),{class:"w-4 h-4 shrink-0"})),r.value?Qe("",!0):(oe(),Ee("span",xg,ps(h.name),1))]),_:2},1032,["to","class","title"])),64))]),ve("div",Rg,[(oe(),Ee(Ye,null,Ni(s,h=>ue(u,{key:h.path,to:h.path,class:at(["flex items-center gap-3 rounded-md text-sm transition-colors",[r.value?"justify-center px-2 py-2":"px-3 py-2",o.value===h.path?"bg-primary/10 text-primary font-medium":"text-muted-foreground hover:bg-accent hover:text-foreground"]]),title:r.value?h.name:void 0},{default:Kr(()=>[(oe(),Wt(ea(h.icon),{class:"w-4 h-4 shrink-0"})),r.value?Qe("",!0):(oe(),Ee("span",Cg,ps(h.name),1))]),_:2},1032,["to","class","title"])),64)),ve("div",{class:at(["flex items-center pt-2 mt-2 border-t border-border",r.value?"justify-center":"justify-between px-3"])},[r.value?Qe("",!0):(oe(),Ee("a",{key:0,href:`${Xa}/releases/tag/v${_e(i)}`,target:"_blank",class:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",title:"Release notes"}," v"+ps(_e(i)),9,Og)),ve("a",{href:Xa,target:"_blank",class:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors",title:"GitHub repository"},[ue(_e(ug),{class:"w-3.5 h-3.5"})])],2)])],2)}}});function ti(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 Ig(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 jg=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class Po 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 $g extends Po{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class el extends Po{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class tl extends Po{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Gi;(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"})(Gi||(Gi={}));class Ng{constructor(e,{headers:r={},customFetch:n,region:s=Gi.Any}={}){this.url=e,this.headers=r,this.region=s,this.fetch=jg(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return Ig(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 g=new URL(`${this.url}/${r}`);f&&f!=="any"&&(d["x-region"]=f,g.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 k=u;h&&(o=new AbortController,i=setTimeout(()=>o.abort(),h),u?(k=o.signal,u.addEventListener("abort",()=>o.abort())):k=o.signal);const w=yield this.fetch(g.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},d),this.headers),a),body:y,signal:k}).catch(D=>{throw new $g(D)}),_=w.headers.get("x-relay-error");if(_&&_==="true")throw new el(w);if(!w.ok)throw new tl(w);let b=((s=w.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),x;return b==="application/json"?x=yield w.json():b==="application/octet-stream"||b==="application/pdf"?x=yield w.blob():b==="text/event-stream"?x=w:b==="multipart/form-data"?x=yield w.formData():x=yield w.text(),{data:x,error:null,response:w}}catch(a){return{data:null,error:a,response:a instanceof tl||a instanceof el?a.context:void 0}}finally{i&&clearTimeout(i)}})}}const wu=3,rl=t=>Math.min(1e3*2**t,3e4),Lg=[520,503],ku=["GET","HEAD","OPTIONS"];var Dg=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 nl(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 Ug(t,e,r,n){return!(!n||r>=wu||!ku.includes(t)||!Lg.includes(e))}var Bg=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"||!ku.includes(r.method))throw h;if(r.retryEnabled&&o<wu){const d=rl(o);o++,await nl(d,r.signal);continue}throw h}if(Ug(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:rl(o);await u.text(),o++,await nl(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,g,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=`${(g=o==null?void 0:o.name)!==null&&g!==void 0?g:"FetchError"}: ${o==null?void 0:o.message}`,l+=`
156
156
 
157
157
  Caused by: ${(y=h==null?void 0:h.name)!==null&&y!==void 0?y:"Error"}: ${_}`,b&&(l+=` (${b})`),h!=null&&h.stack&&(l+=`
158
158
  ${h.stack}`)}else{var k;l=(k=o==null?void 0:o.stack)!==null&&k!==void 0?k:""}const w=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)",w>this.urlLengthLimit&&(c+=`. Note: Your request URL is ${w} 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)",w>this.urlLengthLimit&&(c+=`. Your request URL is ${w} 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 Dg(r)}return{success:r===null,error:r,data:n,count:s,status:i,statusText:o}}returns(){return this}overrideTypes(){return this}},Mg=class extends Bg{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 sl=new RegExp("[,()]");var Br=class extends Mg{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"&&sl.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"&&sl.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}},Hg=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 Br({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 Br({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 Br({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 Br({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 Br({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 Mn(t){"@babel/helpers - typeof";return Mn=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},Mn(t)}function qg(t,e){if(Mn(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Mn(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Fg(t){var e=qg(t,"string");return Mn(e)=="symbol"?e:e+""}function Vg(t,e,r){return(e=Fg(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function il(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 ns(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?il(Object(r),!0).forEach(function(n){Vg(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):il(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var zg=class Su{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 g=()=>{clearTimeout(d),h.abort()};return f.addEventListener("abort",g,{once:!0}),l(c,ns(ns({},u),{},{signal:h.signal})).finally(()=>{clearTimeout(d),f.removeEventListener("abort",g)})}return l(c,ns(ns({},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 Hg(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 Su(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,g])=>g!==void 0).map(([f,g])=>[f,Array.isArray(g)?`{${g.join(",")}}`:`${g}`]).forEach(([f,g])=>{l.searchParams.append(f,g)})):(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 Br({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 Wg{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:
@@ -251,4 +251,4 @@ ${t}</tr>
251
251
  `}tablecell(t){const e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+`</${r}>
252
252
  `}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>${St(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=Nl(t);if(s===null)return n;t=s;let i='<a href="'+t+'"';return e&&(i+=' title="'+St(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=Nl(t);if(s===null)return St(r);t=s;let i=`<img src="${t}" alt="${r}"`;return e&&(i+=` title="${St(e)}"`),i+=">",i}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:St(t.text)}},Ho=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""}},Vt=class co{constructor(e){fe(this,"options");fe(this,"renderer");fe(this,"textRenderer");this.options=e||xr,this.options.renderer=this.options.renderer||new Ls,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ho}static parse(e,r){return new co(r).parse(e)}static parseInline(e,r){return new co(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+=`
253
253
  `+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}},Ci,vs=(Ci=class{constructor(t){fe(this,"options");fe(this,"block");this.options=t||xr}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?Ft.lex:Ft.lexInline}provideParser(){return this.block?Vt.parse:Vt.parseInline}},fe(Ci,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Ci),kb=class{constructor(...t){fe(this,"defaults",jo());fe(this,"options",this.setOptions);fe(this,"parse",this.parseMarkdown(!0));fe(this,"parseInline",this.parseMarkdown(!1));fe(this,"Parser",Vt);fe(this,"Renderer",Ls);fe(this,"TextRenderer",Ho);fe(this,"Lexer",Ft);fe(this,"Tokenizer",Ns);fe(this,"Hooks",vs);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 Ls(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 Ns(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 vs;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];vs.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 Ft.lex(t,e??this.defaults)}parser(t,e){return Vt.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?Ft.lex:Ft.lexInline,l=i.hooks?i.hooks.provideParser():t?Vt.parse:Vt.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+=`
254
- Please report this to https://github.com/markedjs/marked.`,t){const n="<p>An error occurred:</p><pre>"+St(r.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},Ar=new kb;function ce(t,e){return Ar.parse(t,e)}ce.options=ce.setOptions=function(t){return Ar.setOptions(t),ce.defaults=Ar.defaults,Vu(ce.defaults),ce};ce.getDefaults=jo;ce.defaults=xr;ce.use=function(...t){return Ar.use(...t),ce.defaults=Ar.defaults,Vu(ce.defaults),ce};ce.walkTokens=function(t,e){return Ar.walkTokens(t,e)};ce.parseInline=Ar.parseInline;ce.Parser=Vt;ce.parser=Vt.parse;ce.Renderer=Ls;ce.TextRenderer=Ho;ce.Lexer=Ft;ce.lexer=Ft.lex;ce.Tokenizer=Ns;ce.Hooks=vs;ce.parse=ce;ce.options;ce.setOptions;ce.use;ce.walkTokens;ce.parseInline;Vt.parse;Ft.lex;const Sb=["innerHTML"],Eb=ur({__name:"MarkdownContent",props:{content:{}},setup(t){const e=t,r=Ue(()=>e.content?ce.parse(e.content,{async:!1}):"");return(n,s)=>(oe(),Ee("div",{class:"prose prose-sm dark:prose-invert max-w-none",innerHTML:r.value},null,8,Sb))}}),Tb={key:0,class:"fixed bottom-6 right-6 z-50 w-96 h-[500px] bg-card border border-border rounded-xl shadow-2xl flex flex-col overflow-hidden"},Ab={class:"flex items-center justify-between px-4 py-3 border-b border-border bg-header"},xb={key:0,class:"flex items-center justify-center h-full"},Rb={key:1,class:"text-muted-foreground"},Cb={key:2,class:"inline-block w-1.5 h-3 bg-current animate-pulse ml-1"},Ob={class:"border-t border-border p-3"},Pb={class:"flex gap-2 items-end"},Ib=["disabled"],jb=ur({__name:"ChatOverlay",setup(t){const e=Mv(),r=Oo(),n=et(!1),s=et(""),i=et(),o=()=>r.path==="/";function a(){o()||(n.value=!n.value)}async function l(){const h=s.value.trim();!h||e.isStreaming||(s.value="",await e.sendMessage(h))}function c(h){h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),l())}function u(){i.value&&(i.value.scrollTop=i.value.scrollHeight)}return Er(()=>e.messages.map(h=>h.content),async()=>{await Yr(),u()},{deep:!0}),Er(()=>e.messages.length,async()=>{await Yr(),u()}),(h,d)=>(oe(),Ee(Ye,null,[!n.value&&!o()?(oe(),Ee("button",{key:0,onClick:a,class:"fixed bottom-6 right-6 z-50 w-12 h-12 rounded-full btn-gradient flex items-center justify-center shadow-glow-lg hover:scale-105 transition-transform",title:"Chat with IO"},[ue(_e(fg),{class:"w-5 h-5 text-white"})])):Qe("",!0),ue(cf,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"opacity-0 translate-y-4 scale-95","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-95"},{default:Kr(()=>[n.value?(oe(),Ee("div",Tb,[ve("div",Ab,[d[2]||(d[2]=ve("div",{class:"flex items-center gap-2"},[ve("div",{class:"w-2 h-2 rounded-full bg-emerald-400 animate-pulse"}),ve("span",{class:"text-sm font-medium"},"IO Assistant")],-1)),ve("button",{onClick:d[0]||(d[0]=f=>n.value=!1),class:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors"},[ue(_e(pg),{class:"w-4 h-4"})])]),ve("div",{ref_key:"messagesContainer",ref:i,class:"flex-1 overflow-y-auto p-3 space-y-3"},[_e(e).messages.length===0?(oe(),Ee("div",xb,[...d[3]||(d[3]=[ve("p",{class:"text-xs text-muted-foreground"},"Send a message to chat with IO",-1)])])):Qe("",!0),(oe(!0),Ee(Ye,null,Ni(_e(e).messages,f=>(oe(),Ee("div",{key:f.id,class:at(["flex",f.role==="user"?"justify-end":"justify-start"])},[ve("div",{class:at(["max-w-[80%] rounded-lg px-3 py-2 text-xs",f.role==="user"?"bg-primary text-primary-foreground":"bg-secondary text-foreground"])},[f.content?(oe(),Wt(Eb,{key:0,content:f.content,class:at(f.role==="user"?"prose-invert":"")},null,8,["content","class"])):(oe(),Ee("span",Rb,"...")),f.streaming?(oe(),Ee("div",Cb)):Qe("",!0)],2)],2))),128))],512),ve("div",Ob,[ve("div",Pb,[Qh(ve("textarea",{"onUpdate:modelValue":d[1]||(d[1]=f=>s.value=f),onKeydown:c,placeholder:"Message IO...",rows:"1",class:"flex-1 resize-none rounded-md border border-input bg-input px-3 py-2 text-xs focus:outline-none focus:ring-1 focus:ring-ring min-h-[36px] max-h-[80px]"},null,544),[[If,s.value]]),ve("button",{onClick:l,disabled:!s.value.trim()||_e(e).isStreaming,class:"rounded-md bg-primary text-primary-foreground p-2 hover:bg-primary/90 disabled:opacity-50 transition-colors"},[_e(e).isStreaming?(oe(),Wt(_e(wg),{key:1,class:"w-3.5 h-3.5"})):(oe(),Wt(_e(vg),{key:0,class:"w-3.5 h-3.5"}))],8,Ib)])])])):Qe("",!0)]),_:1})],64))}}),$b={class:"flex h-screen overflow-hidden"},Nb={class:"flex-1 flex flex-col overflow-hidden"},Lb={class:"flex-1 overflow-auto"},Db=ur({__name:"App",setup(t){const e=Qn(),r=Oo(),n=Ue(()=>e.isAuthenticated&&r.name!=="login");return(s,i)=>{const o=So("router-view");return oe(),Ee("div",$b,[n.value?(oe(),Wt(Pg,{key:0})):Qe("",!0),ve("div",Nb,[n.value?(oe(),Wt(Dv,{key:0})):Qe("",!0),ve("main",Lb,[ue(o)])]),n.value?(oe(),Wt(jb,{key:1})):Qe("",!0)])}}}),Ub=[{path:"/login",name:"login",component:()=>Me(()=>import("./LoginView-a30NhZ-S.js"),[]),meta:{public:!0}},{path:"/",name:"chat",component:()=>Me(()=>import("./ChatView-CXL0xMzV.js"),[])},{path:"/squads",name:"squads",component:()=>Me(()=>import("./SquadsView-CHUgkqrF.js"),__vite__mapDeps([0,1,2,3]))},{path:"/squads/health",name:"squad-health",component:()=>Me(()=>import("./SquadHealthView-FXC83WjQ.js"),__vite__mapDeps([4,1,5,3]))},{path:"/squads/:id",name:"squad-detail",component:()=>Me(()=>import("./SquadDetailView-CUIzmUNq.js"),__vite__mapDeps([6,1,2,7,3,8,9]))},{path:"/feed",name:"feed",component:()=>Me(()=>import("./FeedView-CL_gGs8m.js"),__vite__mapDeps([10,1,2,8]))},{path:"/skills",name:"skills",component:()=>Me(()=>import("./SkillsView-DRDyKLbJ.js"),__vite__mapDeps([11,1,12,13,14,7,8]))},{path:"/mcp",name:"mcp",component:()=>Me(()=>import("./McpView-Bg7ikSzn.js"),__vite__mapDeps([15,1,12,8]))},{path:"/schedules",name:"schedules",component:()=>Me(()=>import("./SchedulesView-dzgRNuBk.js"),__vite__mapDeps([16,1,2,12,8]))},{path:"/history",name:"history",component:()=>Me(()=>import("./HistoryView-BEv5KtjC.js"),__vite__mapDeps([17,1,13,9,8]))},{path:"/wiki",name:"wiki",component:()=>Me(()=>import("./WikiView-CoJ4i7WL.js"),__vite__mapDeps([18,1,13,12,14,8,7]))},{path:"/usage",name:"usage",component:()=>Me(()=>import("./UsageView-TD-tGZmI.js"),__vite__mapDeps([19,1,5]))},{path:"/audit-log",name:"audit-log",component:()=>Me(()=>import("./AuditLogView-Cdx7vZdd.js"),__vite__mapDeps([20,1]))},{path:"/settings",name:"settings",component:()=>Me(()=>import("./SettingsView-C3ucjaBU.js"),__vite__mapDeps([21,1]))}],th=Zp({history:Op(),routes:Ub});th.beforeEach(t=>{const e=Qn();if(!t.meta.public&&!e.isAuthenticated)return{name:"login"}});async function Bb(){await Iv();const t=Uf(Db);t.use(Hf()),t.use(th);const{useAuthStore:e}=await Me(async()=>{const{useAuthStore:n}=await Promise.resolve().then(()=>jv);return{useAuthStore:n}},void 0),r=e();r.initAuthListener(),r.token&&await r.refreshToken(),t.mount("#app")}Bb();export{ig as A,og as B,ag as C,_e as D,Qn as E,Ye as F,Mv as G,hg as H,_u as I,Oo as J,Xp as K,Hb as L,Za as M,qb as N,If as O,yg as P,Er as Q,Kr as R,vg as S,Qh as T,kg as U,Vb as V,Fb as W,rg as _,lg as a,cg as b,bg as c,wg as d,Sg as e,Eb as f,Ue as g,ve as h,Wt as i,Qe as j,Ee as k,Te as l,zd as m,ue as n,ur as o,Yr as p,at as q,fo as r,xc as s,Cc as t,oe as u,et as v,Ni as w,So as x,th as y,ps as z};
254
+ Please report this to https://github.com/markedjs/marked.`,t){const n="<p>An error occurred:</p><pre>"+St(r.message+"",!0)+"</pre>";return e?Promise.resolve(n):n}if(e)return Promise.reject(r);throw r}}},Ar=new kb;function ce(t,e){return Ar.parse(t,e)}ce.options=ce.setOptions=function(t){return Ar.setOptions(t),ce.defaults=Ar.defaults,Vu(ce.defaults),ce};ce.getDefaults=jo;ce.defaults=xr;ce.use=function(...t){return Ar.use(...t),ce.defaults=Ar.defaults,Vu(ce.defaults),ce};ce.walkTokens=function(t,e){return Ar.walkTokens(t,e)};ce.parseInline=Ar.parseInline;ce.Parser=Vt;ce.parser=Vt.parse;ce.Renderer=Ls;ce.TextRenderer=Ho;ce.Lexer=Ft;ce.lexer=Ft.lex;ce.Tokenizer=Ns;ce.Hooks=vs;ce.parse=ce;ce.options;ce.setOptions;ce.use;ce.walkTokens;ce.parseInline;Vt.parse;Ft.lex;const Sb=["innerHTML"],Eb=ur({__name:"MarkdownContent",props:{content:{}},setup(t){const e=t,r=Ue(()=>e.content?ce.parse(e.content,{async:!1}):"");return(n,s)=>(oe(),Ee("div",{class:"prose prose-sm dark:prose-invert max-w-none",innerHTML:r.value},null,8,Sb))}}),Tb={key:0,class:"fixed bottom-6 right-6 z-50 w-96 h-[500px] bg-card border border-border rounded-xl shadow-2xl flex flex-col overflow-hidden"},Ab={class:"flex items-center justify-between px-4 py-3 border-b border-border bg-header"},xb={key:0,class:"flex items-center justify-center h-full"},Rb={key:1,class:"text-muted-foreground"},Cb={key:2,class:"inline-block w-1.5 h-3 bg-current animate-pulse ml-1"},Ob={class:"border-t border-border p-3"},Pb={class:"flex gap-2 items-end"},Ib=["disabled"],jb=ur({__name:"ChatOverlay",setup(t){const e=Mv(),r=Oo(),n=et(!1),s=et(""),i=et(),o=()=>r.path==="/";function a(){o()||(n.value=!n.value)}async function l(){const h=s.value.trim();!h||e.isStreaming||(s.value="",await e.sendMessage(h))}function c(h){h.key==="Enter"&&!h.shiftKey&&(h.preventDefault(),l())}function u(){i.value&&(i.value.scrollTop=i.value.scrollHeight)}return Er(()=>e.messages.map(h=>h.content),async()=>{await Yr(),u()},{deep:!0}),Er(()=>e.messages.length,async()=>{await Yr(),u()}),(h,d)=>(oe(),Ee(Ye,null,[!n.value&&!o()?(oe(),Ee("button",{key:0,onClick:a,class:"fixed bottom-6 right-6 z-50 w-12 h-12 rounded-full btn-gradient flex items-center justify-center shadow-glow-lg hover:scale-105 transition-transform",title:"Chat with IO"},[ue(_e(fg),{class:"w-5 h-5 text-white"})])):Qe("",!0),ue(cf,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"opacity-0 translate-y-4 scale-95","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-95"},{default:Kr(()=>[n.value?(oe(),Ee("div",Tb,[ve("div",Ab,[d[2]||(d[2]=ve("div",{class:"flex items-center gap-2"},[ve("div",{class:"w-2 h-2 rounded-full bg-emerald-400 animate-pulse"}),ve("span",{class:"text-sm font-medium"},"IO Assistant")],-1)),ve("button",{onClick:d[0]||(d[0]=f=>n.value=!1),class:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors"},[ue(_e(pg),{class:"w-4 h-4"})])]),ve("div",{ref_key:"messagesContainer",ref:i,class:"flex-1 overflow-y-auto p-3 space-y-3"},[_e(e).messages.length===0?(oe(),Ee("div",xb,[...d[3]||(d[3]=[ve("p",{class:"text-xs text-muted-foreground"},"Send a message to chat with IO",-1)])])):Qe("",!0),(oe(!0),Ee(Ye,null,Ni(_e(e).messages,f=>(oe(),Ee("div",{key:f.id,class:at(["flex",f.role==="user"?"justify-end":"justify-start"])},[ve("div",{class:at(["max-w-[80%] rounded-lg px-3 py-2 text-xs",f.role==="user"?"bg-primary text-primary-foreground":"bg-secondary text-foreground"])},[f.content?(oe(),Wt(Eb,{key:0,content:f.content,class:at(f.role==="user"?"prose-invert":"")},null,8,["content","class"])):(oe(),Ee("span",Rb,"...")),f.streaming?(oe(),Ee("div",Cb)):Qe("",!0)],2)],2))),128))],512),ve("div",Ob,[ve("div",Pb,[Qh(ve("textarea",{"onUpdate:modelValue":d[1]||(d[1]=f=>s.value=f),onKeydown:c,placeholder:"Message IO...",rows:"1",class:"flex-1 resize-none rounded-md border border-input bg-input px-3 py-2 text-xs focus:outline-none focus:ring-1 focus:ring-ring min-h-[36px] max-h-[80px]"},null,544),[[If,s.value]]),ve("button",{onClick:l,disabled:!s.value.trim()||_e(e).isStreaming,class:"rounded-md bg-primary text-primary-foreground p-2 hover:bg-primary/90 disabled:opacity-50 transition-colors"},[_e(e).isStreaming?(oe(),Wt(_e(wg),{key:1,class:"w-3.5 h-3.5"})):(oe(),Wt(_e(vg),{key:0,class:"w-3.5 h-3.5"}))],8,Ib)])])])):Qe("",!0)]),_:1})],64))}}),$b={class:"flex h-screen overflow-hidden"},Nb={class:"flex-1 flex flex-col overflow-hidden"},Lb={class:"flex-1 overflow-auto"},Db=ur({__name:"App",setup(t){const e=Qn(),r=Oo(),n=Ue(()=>e.isAuthenticated&&r.name!=="login");return(s,i)=>{const o=So("router-view");return oe(),Ee("div",$b,[n.value?(oe(),Wt(Pg,{key:0})):Qe("",!0),ve("div",Nb,[n.value?(oe(),Wt(Dv,{key:0})):Qe("",!0),ve("main",Lb,[ue(o)])]),n.value?(oe(),Wt(jb,{key:1})):Qe("",!0)])}}}),Ub=[{path:"/login",name:"login",component:()=>Me(()=>import("./LoginView-Bwl96p9a.js"),[]),meta:{public:!0}},{path:"/",name:"chat",component:()=>Me(()=>import("./ChatView-rktzvf02.js"),[])},{path:"/squads",name:"squads",component:()=>Me(()=>import("./SquadsView-CYHJHUTi.js"),__vite__mapDeps([0,1,2,3]))},{path:"/squads/health",name:"squad-health",component:()=>Me(()=>import("./SquadHealthView-S7L-ux5R.js"),__vite__mapDeps([4,1,5,3]))},{path:"/squads/:id",name:"squad-detail",component:()=>Me(()=>import("./SquadDetailView-B8eH9uCp.js"),__vite__mapDeps([6,1,2,7,3,8,9]))},{path:"/feed",name:"feed",component:()=>Me(()=>import("./FeedView-BaGHVS5k.js"),__vite__mapDeps([10,1,2,8]))},{path:"/skills",name:"skills",component:()=>Me(()=>import("./SkillsView-BFEE6Dr7.js"),__vite__mapDeps([11,1,12,13,14,7,8]))},{path:"/mcp",name:"mcp",component:()=>Me(()=>import("./McpView-D1HjpDaS.js"),__vite__mapDeps([15,1,12,8]))},{path:"/schedules",name:"schedules",component:()=>Me(()=>import("./SchedulesView-heDgZ6EX.js"),__vite__mapDeps([16,1,2,12,8]))},{path:"/history",name:"history",component:()=>Me(()=>import("./HistoryView-54tTZBvl.js"),__vite__mapDeps([17,1,13,9,8]))},{path:"/wiki",name:"wiki",component:()=>Me(()=>import("./WikiView-CXXw3RGo.js"),__vite__mapDeps([18,1,13,12,14,8,7]))},{path:"/usage",name:"usage",component:()=>Me(()=>import("./UsageView-Brck8R6H.js"),__vite__mapDeps([19,1,5]))},{path:"/audit-log",name:"audit-log",component:()=>Me(()=>import("./AuditLogView-blV2zh1J.js"),__vite__mapDeps([20,1]))},{path:"/settings",name:"settings",component:()=>Me(()=>import("./SettingsView-BkzrjzlA.js"),__vite__mapDeps([21,1]))}],th=Zp({history:Op(),routes:Ub});th.beforeEach(t=>{const e=Qn();if(!t.meta.public&&!e.isAuthenticated)return{name:"login"}});async function Bb(){await Iv();const t=Uf(Db);t.use(Hf()),t.use(th);const{useAuthStore:e}=await Me(async()=>{const{useAuthStore:n}=await Promise.resolve().then(()=>jv);return{useAuthStore:n}},void 0),r=e();r.initAuthListener(),r.token&&await r.refreshToken(),t.mount("#app")}Bb();export{ig as A,og as B,ag as C,_e as D,Qn as E,Ye as F,Mv as G,hg as H,_u as I,Oo as J,Xp as K,Hb as L,Za as M,qb as N,If as O,yg as P,Er as Q,Kr as R,vg as S,Qh as T,kg as U,Vb as V,Fb as W,rg as _,lg as a,cg as b,bg as c,wg as d,Sg as e,Eb as f,Ue as g,ve as h,Wt as i,Qe as j,Ee as k,Te as l,zd as m,ue as n,ur as o,Yr as p,at as q,fo as r,xc as s,Cc as t,oe as u,et as v,Ni as w,So as x,th as y,ps as z};
@@ -1,4 +1,4 @@
1
- import{l as e}from"./index-C0KbNiVo.js";/**
1
+ import{l as e}from"./index-1mPHTPeR.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{l as a}from"./index-C0KbNiVo.js";/**
1
+ import{l as a}from"./index-1mPHTPeR.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{l as c}from"./index-C0KbNiVo.js";/**
1
+ import{l as c}from"./index-1mPHTPeR.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{l as e}from"./index-C0KbNiVo.js";/**
1
+ import{l as e}from"./index-1mPHTPeR.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{l as e}from"./index-C0KbNiVo.js";/**
1
+ import{l as e}from"./index-1mPHTPeR.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{l as e}from"./index-C0KbNiVo.js";/**
1
+ import{l as e}from"./index-1mPHTPeR.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-C0KbNiVo.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-1mPHTPeR.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-CQ_szaoT.css">
10
10
  </head>
11
11
  <body class="bg-background text-foreground">