heyio 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/api/server.js +22 -0
  2. package/dist/copilot/agents.js +41 -3
  3. package/dist/copilot/orchestrator.js +2 -0
  4. package/dist/copilot/scheduler.js +3 -2
  5. package/dist/copilot/squad-tools.js +102 -0
  6. package/dist/copilot/system-message.js +2 -1
  7. package/dist/copilot/trigger-schedule.js +31 -0
  8. package/dist/store/schedules.js +4 -0
  9. package/dist/store/squad-colors.js +10 -8
  10. package/dist/wiki/search.js +13 -2
  11. package/package.json +1 -1
  12. package/web-dist/assets/{AuditLogView-xgSZ2MOJ.js → AuditLogView-DqxVzjd_.js} +2 -2
  13. package/web-dist/assets/ChatView-BBopM_A3.js +1 -0
  14. package/web-dist/assets/FeedView-Bo4p1stx.js +6 -0
  15. package/web-dist/assets/HistoryView-ChTuQvXr.js +1 -0
  16. package/web-dist/assets/LoginView-AnOP3Mau.js +1 -0
  17. package/web-dist/assets/McpView-DPcihjuB.js +1 -0
  18. package/web-dist/assets/SchedulesView-B2o3vMm-.js +6 -0
  19. package/web-dist/assets/SettingsView-rtMUmH43.js +1 -0
  20. package/web-dist/assets/SkillsView-D_NHLk7C.js +15 -0
  21. package/web-dist/assets/SquadDetailView-BKXLWvwn.js +26 -0
  22. package/web-dist/assets/SquadHealthView-CVJiAgVW.js +11 -0
  23. package/web-dist/assets/SquadsView-fammrB7r.js +6 -0
  24. package/web-dist/assets/{UsageView-CCS6pp6n.js → UsageView-Cy5Mbprb.js} +4 -4
  25. package/web-dist/assets/WikiView-B5TOMnOg.js +36 -0
  26. package/web-dist/assets/{arrow-left-CkDjCT7Z.js → arrow-left-CGMB1w_A.js} +1 -1
  27. package/web-dist/assets/{git-branch-Bu9s__XL.js → git-branch-C_Hu39uh.js} +1 -1
  28. package/web-dist/assets/index-CQ_szaoT.css +1 -0
  29. package/web-dist/assets/index-CiZnRvN4.js +253 -0
  30. package/web-dist/assets/{plus-GvGwcjX5.js → plus-DIBAaEMT.js} +1 -1
  31. package/web-dist/assets/{save-fQ_rr5hX.js → save-Chqlu7QA.js} +1 -1
  32. package/web-dist/assets/{search-C3fxUixl.js → search-Cl8HcIsG.js} +1 -1
  33. package/web-dist/assets/{trash-2-Ba_1SAua.js → trash-2-CQSzbVIr.js} +1 -1
  34. package/web-dist/assets/{triangle-alert-BTBlX3kg.js → triangle-alert-C1OjMvP5.js} +1 -1
  35. package/web-dist/assets/{x-CJifAZQa.js → x-DThJHYFm.js} +1 -1
  36. package/web-dist/index.html +2 -2
  37. package/web-dist/assets/ChatView-BU3Jvu5y.js +0 -11
  38. package/web-dist/assets/FeedView-BwkWbe1p.js +0 -6
  39. package/web-dist/assets/HistoryView-Doh9Y3Na.js +0 -1
  40. package/web-dist/assets/LoginView-CoTEOrwE.js +0 -1
  41. package/web-dist/assets/MarkdownContent.vue_vue_type_script_setup_true_lang-CObjuCHH.js +0 -56
  42. package/web-dist/assets/McpView-ByXoAnED.js +0 -1
  43. package/web-dist/assets/SchedulesView-BkUdRYwk.js +0 -1
  44. package/web-dist/assets/SettingsView-_q-IpzFy.js +0 -1
  45. package/web-dist/assets/SkillsView-_FkOdD2U.js +0 -15
  46. package/web-dist/assets/SquadDetailView-CV6_n_If.js +0 -31
  47. package/web-dist/assets/SquadHealthView-DmQqPq7H.js +0 -11
  48. package/web-dist/assets/SquadsView-Dkhtu5MQ.js +0 -6
  49. package/web-dist/assets/WikiView-CpXzff_L.js +0 -31
  50. package/web-dist/assets/api-CaqVk-rG.js +0 -1
  51. package/web-dist/assets/index-D3DNfwXI.css +0 -1
  52. package/web-dist/assets/index-DfdD_qE4.js +0 -158
@@ -12,6 +12,7 @@ import { getAgentEvents } from "../store/agent-events.js";
12
12
  import { getAuditLog, countAuditLog } from "../store/audit-log.js";
13
13
  import { getFeedItems, markFeedItemRead, deleteFeedItem, getUnreadCount, } from "../store/feed.js";
14
14
  import { listSchedules, createSchedule, deleteSchedule, toggleSchedule } from "../store/schedules.js";
15
+ import { triggerSchedule } from "../copilot/trigger-schedule.js";
15
16
  import { listServers, toggleMcpServer, addMcpServer, removeMcpServer } from "../mcp/index.js";
16
17
  import { listSkills, addSkill, createSkill, removeSkill, getSkillContent, updateSkillContent, discoverSkills, installFromSource, fetchRemoteSkillPreview } from "../copilot/skills.js";
17
18
  import { readPage, writePage, deletePage, listPages, listTemplates, readTemplate, writeTemplate, deleteTemplate } from "../wiki/fs.js";
@@ -179,6 +180,19 @@ export async function startApiServer(config) {
179
180
  const events = getAgentEvents(req.params.taskId);
180
181
  res.json(events);
181
182
  });
183
+ // --- Stop Task ---
184
+ app.post("/api/tasks/:taskId/stop", async (req, res) => {
185
+ try {
186
+ const { stopTask } = await import("../copilot/agents.js");
187
+ await stopTask(req.params.taskId);
188
+ res.json({ ok: true });
189
+ }
190
+ catch (err) {
191
+ const msg = err?.message ?? "Unknown error";
192
+ const isNotRunning = msg.toLowerCase().includes("not currently running") || msg.toLowerCase().includes("already completed");
193
+ res.status(isNotRunning ? 404 : 500).json({ error: msg });
194
+ }
195
+ });
182
196
  // --- Audit Log ---
183
197
  app.get("/api/audit-log", (req, res) => {
184
198
  const squad_id = req.query.squad_id;
@@ -440,6 +454,14 @@ export async function startApiServer(config) {
440
454
  }
441
455
  res.json({ ok: true });
442
456
  });
457
+ app.post("/api/schedules/:id/trigger", (req, res) => {
458
+ const schedule = triggerSchedule(req.params.id);
459
+ if (!schedule) {
460
+ res.status(404).json({ error: "Schedule not found" });
461
+ return;
462
+ }
463
+ res.json({ ok: true, schedule });
464
+ });
443
465
  app.delete("/api/schedules/:id", (req, res) => {
444
466
  deleteSchedule(req.params.id);
445
467
  res.json({ ok: true });
@@ -1,18 +1,47 @@
1
1
  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
- import { createTask, updateTaskStatus } from "../store/tasks.js";
4
+ import { createTask, updateTaskStatus, getTask } from "../store/tasks.js";
5
5
  import { touchInstanceActivity } 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 { createSquadTools } from "./squad-tools.js";
12
+ import { loadSkillDirectories } from "./skills.js";
13
+ import { getMcpServersForSession } from "../mcp/registry.js";
14
+ // Registry of active agent sessions keyed by task ID
15
+ const activeSessions = new Map();
16
+ /**
17
+ * Stop a running agent by task ID. Disconnects the session and marks the task as stopped.
18
+ */
19
+ export async function stopTask(taskId) {
20
+ const session = activeSessions.get(taskId);
21
+ if (!session) {
22
+ throw new Error(`Task is not currently running or has already completed`);
23
+ }
24
+ try {
25
+ await session.disconnect();
26
+ }
27
+ finally {
28
+ activeSessions.delete(taskId);
29
+ }
30
+ updateTaskStatus(taskId, "stopped", "Stopped by user");
31
+ addAgentEvent(taskId, "status", "Task stopped by user", { reason: "user_requested" });
32
+ // Reset agent status to idle
33
+ const task = getTask(taskId);
34
+ if (task?.agent_id) {
35
+ updateAgentStatus(task.agent_id, "idle");
36
+ }
37
+ }
11
38
  export async function delegateTask(squadId, task, instanceId) {
12
39
  const lead = getLeadForSquad(squadId);
13
40
  if (!lead) {
14
41
  throw new Error("Squad has no team lead. Add a lead agent first.");
15
42
  }
43
+ const squad = getSquad(squadId);
44
+ const squadSlug = squad?.slug ?? squadId;
16
45
  const agents = getAgentsForSquad(squadId);
17
46
  const taskRecord = createTask(squadId, task, instanceId, lead.id);
18
47
  // Update lead status
@@ -63,11 +92,18 @@ ${lead.persona ? `## Personality:\n${lead.persona}` : ""}
63
92
  `;
64
93
  let result;
65
94
  try {
95
+ // Load squad-scoped tools, skills, and MCP servers
96
+ const squadTools = createSquadTools(squadSlug, squadId);
97
+ const skillDirs = await loadSkillDirectories();
98
+ const mcpServers = getMcpServersForSession();
66
99
  const session = await client.createSession({
67
100
  model,
68
101
  streaming: true,
69
102
  workingDirectory: process.cwd(),
70
103
  systemMessage: { content: systemMessage },
104
+ tools: squadTools,
105
+ skillDirectories: skillDirs,
106
+ mcpServers,
71
107
  onPermissionRequest: approveAll,
72
108
  infiniteSessions: {
73
109
  enabled: true,
@@ -75,6 +111,8 @@ ${lead.persona ? `## Personality:\n${lead.persona}` : ""}
75
111
  bufferExhaustionThreshold: 0.95,
76
112
  },
77
113
  });
114
+ // Register session so it can be stopped externally
115
+ activeSessions.set(taskRecord.id, session);
78
116
  const flushTokens = attachTokenTracker(session, {
79
117
  squadId,
80
118
  agentId: lead.id,
@@ -119,6 +157,7 @@ ${lead.persona ? `## Personality:\n${lead.persona}` : ""}
119
157
  }
120
158
  }
121
159
  finally {
160
+ activeSessions.delete(taskRecord.id);
122
161
  flushTokens();
123
162
  await session.disconnect();
124
163
  }
@@ -143,8 +182,7 @@ ${lead.persona ? `## Personality:\n${lead.persona}` : ""}
143
182
  result: result.slice(0, 500),
144
183
  });
145
184
  // Post to feed
146
- const squad = getSquad(squadId);
147
- const squadSource = squad ? `squad-${squad.slug}` : `squad-${squadId}`;
185
+ const squadSource = `squad-${squadSlug}`;
148
186
  postFeedItem(squadSource, `Task completed by ${lead.character_name}`, result.slice(0, 2000));
149
187
  return result;
150
188
  }
@@ -4,6 +4,7 @@ import { loadConfig } from "../config.js";
4
4
  import { buildSystemMessage } from "./system-message.js";
5
5
  import { createTools } from "./tools.js";
6
6
  import { loadSkillDirectories } from "./skills.js";
7
+ import { getMcpServersForSession } from "../mcp/registry.js";
7
8
  import { resetClient } from "./client.js";
8
9
  import { addAuditEntry } from "../store/audit-log.js";
9
10
  let orchestratorSession;
@@ -45,6 +46,7 @@ async function createOrResumeSession(client, opts) {
45
46
  systemMessage: { content: systemMessage },
46
47
  tools,
47
48
  skillDirectories: skillDirs,
49
+ mcpServers: getMcpServersForSession(),
48
50
  onPermissionRequest: approveAll,
49
51
  infiniteSessions: {
50
52
  enabled: true,
@@ -21,8 +21,9 @@ function checkSquadSchedules() {
21
21
  continue;
22
22
  }
23
23
  updateScheduleLastRun(schedule.id);
24
- const agenda = schedule.agenda || "triage";
25
- const prompt = `[Squad Schedule] Run "${agenda}" stand-up for squad ${schedule.squad_id}. Agenda: ${agenda}`;
24
+ const prompt = schedule.prompt
25
+ ? `[Squad Schedule] Run for squad ${schedule.squad_id}. Prompt: ${schedule.prompt}`
26
+ : `[Squad Schedule] Run "triage" stand-up for squad ${schedule.squad_id}. Agenda: triage`;
26
27
  sendToOrchestrator(prompt, "scheduler", (_text, done) => {
27
28
  if (done) {
28
29
  console.log(`[scheduler] Squad stand-up completed for ${schedule.squad_id}`);
@@ -0,0 +1,102 @@
1
+ import { z } from "zod";
2
+ import { defineTool } from "@github/copilot-sdk";
3
+ /**
4
+ * Creates a scoped set of tools for squad agent sessions.
5
+ * Wiki tools are sandboxed to the squad's own wiki subfolder.
6
+ * Feed posts are locked to the squad's source identifier.
7
+ */
8
+ export function createSquadTools(squadSlug, squadId) {
9
+ const wikiPrefix = `squads/${squadSlug}`;
10
+ return [
11
+ // --- Wiki Tools (scoped to squads/{slug}/) ---
12
+ defineTool("wiki_read", {
13
+ description: `Read a wiki page from the squad wiki (paths are relative to your squad's wiki folder)`,
14
+ parameters: z.object({
15
+ path: z.string().describe("Page path (e.g., 'decisions.md', 'notes/architecture.md')"),
16
+ }),
17
+ handler: async ({ path }) => {
18
+ const { readPage } = await import("../wiki/fs.js");
19
+ return await readPage(`${wikiPrefix}/${path}`);
20
+ },
21
+ }),
22
+ defineTool("wiki_write", {
23
+ description: "Write or update a wiki page in the squad wiki",
24
+ parameters: z.object({
25
+ path: z.string().describe("Page path (e.g., 'decisions.md')"),
26
+ content: z.string().describe("Markdown content to write"),
27
+ }),
28
+ handler: async ({ path, content }) => {
29
+ const { writePage } = await import("../wiki/fs.js");
30
+ await writePage(`${wikiPrefix}/${path}`, content);
31
+ return `Page saved: ${path}`;
32
+ },
33
+ }),
34
+ defineTool("wiki_list", {
35
+ description: "List all wiki pages in the squad wiki",
36
+ parameters: z.object({}),
37
+ handler: async () => {
38
+ const { listPages } = await import("../wiki/fs.js");
39
+ return await listPages(wikiPrefix);
40
+ },
41
+ }),
42
+ defineTool("wiki_search", {
43
+ description: "Search squad wiki pages by keyword",
44
+ parameters: z.object({
45
+ query: z.string().describe("Search query"),
46
+ }),
47
+ handler: async ({ query }) => {
48
+ const { searchSquadPages } = await import("../wiki/search.js");
49
+ return await searchSquadPages(query, wikiPrefix);
50
+ },
51
+ }),
52
+ defineTool("wiki_delete", {
53
+ description: "Delete a wiki page from the squad wiki",
54
+ parameters: z.object({
55
+ path: z.string().describe("Page path to delete"),
56
+ }),
57
+ handler: async ({ path }) => {
58
+ const { deletePage } = await import("../wiki/fs.js");
59
+ await deletePage(`${wikiPrefix}/${path}`);
60
+ return `Page deleted: ${path}`;
61
+ },
62
+ }),
63
+ defineTool("wiki_backlinks", {
64
+ description: "Find all squad wiki pages that link to the given page",
65
+ parameters: z.object({
66
+ path: z.string().describe("Page path (e.g., 'decisions.md')"),
67
+ }),
68
+ handler: async ({ path }) => {
69
+ const { getBacklinks } = await import("../wiki/backlinks.js");
70
+ const allBacklinks = await getBacklinks(`${wikiPrefix}/${path}`);
71
+ // Filter to only show backlinks within squad wiki, strip prefix for display
72
+ return allBacklinks
73
+ .filter((bl) => bl.startsWith(`${wikiPrefix}/`))
74
+ .map((bl) => bl.slice(wikiPrefix.length + 1));
75
+ },
76
+ }),
77
+ // --- Feed Tools ---
78
+ defineTool("feed_post", {
79
+ description: "Post a message or deliverable to the user's inbox. Use for progress updates, questions, blockers, or completed work.",
80
+ parameters: z.object({
81
+ title: z.string().describe("Title of the message"),
82
+ content: z.string().describe("Full content (markdown supported)"),
83
+ }),
84
+ handler: async ({ title, content }) => {
85
+ const { postFeedItem } = await import("../store/feed.js");
86
+ const source = `squad-${squadSlug}`;
87
+ const item = postFeedItem(source, title, content);
88
+ return `Posted to inbox: "${title}" (ID: ${item.id})`;
89
+ },
90
+ }),
91
+ // --- Task Tools ---
92
+ defineTool("squad_task_status", {
93
+ description: "Check the status of tasks for your squad",
94
+ parameters: z.object({}),
95
+ handler: async () => {
96
+ const { getTasksForSquad } = await import("../store/tasks.js");
97
+ return getTasksForSquad(squadId);
98
+ },
99
+ }),
100
+ ];
101
+ }
102
+ //# sourceMappingURL=squad-tools.js.map
@@ -13,7 +13,8 @@ You are IO, a personal AI assistant daemon. You run 24/7 on the user's machine,
13
13
  ## Core Capabilities
14
14
  - Manage project squads (teams of AI agents themed after pop culture universes)
15
15
  - Read and write to a persistent wiki knowledge base at ~/.io/wiki/
16
- - Each squad has its own wiki at ~/.io/wiki/squads/{squad-slug}/ (use the slug, never the UUID)
16
+ - Each squad has its own wiki at ~/.io/wiki/pages/squads/{squad-slug}/ (use the slug, never the UUID)
17
+ - Squad wiki templates at ~/.io/wiki/templates/squad/ are auto-copied to new squads on creation
17
18
  - Delegate complex tasks to squad team leads
18
19
  - Track deliverables in a unified feed
19
20
  - Schedule recurring tasks and stand-ups
@@ -0,0 +1,31 @@
1
+ import { getSchedule, updateScheduleLastRun } from "../store/schedules.js";
2
+ import { sendToOrchestrator } from "./orchestrator.js";
3
+ import { buildSquadScopedPrompt } from "./io-scheduler.js";
4
+ /**
5
+ * Trigger a schedule immediately, bypassing cron timing.
6
+ * Returns the schedule if triggered successfully, or undefined if not found.
7
+ */
8
+ export function triggerSchedule(id) {
9
+ const schedule = getSchedule(id);
10
+ if (!schedule)
11
+ return undefined;
12
+ updateScheduleLastRun(schedule.id);
13
+ if (schedule.type === "squad") {
14
+ const agenda = schedule.agenda || "triage";
15
+ const prompt = `[Squad Schedule] Run "${agenda}" stand-up for squad ${schedule.squad_id}. Agenda: ${agenda}`;
16
+ sendToOrchestrator(prompt, "scheduler", (_text, done) => {
17
+ if (done) {
18
+ console.log(`[trigger] Squad stand-up completed for ${schedule.squad_id}`);
19
+ }
20
+ });
21
+ }
22
+ else {
23
+ sendToOrchestrator(buildSquadScopedPrompt(schedule), "io-scheduler", (_text, done) => {
24
+ if (done) {
25
+ console.log(`[trigger] IO schedule ${schedule.id} completed.`);
26
+ }
27
+ });
28
+ }
29
+ return schedule;
30
+ }
31
+ //# sourceMappingURL=trigger-schedule.js.map
@@ -11,6 +11,10 @@ export function createSchedule(input) {
11
11
  VALUES (?, ?, ?, ?, ?, ?)`).run(id, input.type, squadId, input.cron, input.agenda ?? "", input.prompt ?? "");
12
12
  return db.prepare("SELECT * FROM schedules WHERE id = ?").get(id);
13
13
  }
14
+ export function getSchedule(id) {
15
+ const db = getDb();
16
+ return db.prepare("SELECT * FROM schedules WHERE id = ?").get(id);
17
+ }
14
18
  export function listSchedules(type) {
15
19
  const db = getDb();
16
20
  if (type) {
@@ -1,12 +1,14 @@
1
+ // Palette complementary to the site's brand gradient (magenta #E43A9C → violet #F041FF)
2
+ // Avoiding direct brand colors; using analogous/complementary hues that look cohesive
1
3
  export const SQUAD_COLOR_PALETTE = [
2
- "#ef4444",
3
- "#f97316",
4
- "#eab308",
5
- "#22c55e",
6
- "#06b6d4",
7
- "#3b82f6",
8
- "#8b5cf6",
9
- "#ec4899",
4
+ "#06b6d4", // cyan (complementary to magenta)
5
+ "#14b8a6", // teal
6
+ "#f59e0b", // amber (warm contrast)
7
+ "#8b5cf6", // violet (analogous)
8
+ "#3b82f6", // blue
9
+ "#10b981", // emerald
10
+ "#f43f5e", // rose (analogous warm)
11
+ "#6366f1", // indigo
10
12
  ];
11
13
  const DEFAULT_SQUAD_COLOR = "#3b82f6";
12
14
  export function pickSquadColor(usedColors, random = Math.random) {
@@ -2,7 +2,18 @@ import { existsSync, readFileSync, readdirSync } from "node:fs";
2
2
  import { join } from "node:path";
3
3
  import { PATHS } from "../paths.js";
4
4
  export async function searchPages(query) {
5
- if (!existsSync(PATHS.wikiPages))
5
+ return searchInDirectory(PATHS.wikiPages, query);
6
+ }
7
+ /**
8
+ * Search wiki pages within a specific subfolder (e.g., "squads/my-squad").
9
+ * Results have paths relative to the subfolder.
10
+ */
11
+ export async function searchSquadPages(query, subdir) {
12
+ const root = join(PATHS.wikiPages, subdir);
13
+ return searchInDirectory(root, query);
14
+ }
15
+ function searchInDirectory(root, query) {
16
+ if (!existsSync(root))
6
17
  return [];
7
18
  const results = [];
8
19
  const lower = query.toLowerCase();
@@ -30,7 +41,7 @@ export async function searchPages(query) {
30
41
  }
31
42
  }
32
43
  };
33
- walk(PATHS.wikiPages, "");
44
+ walk(root, "");
34
45
  return results;
35
46
  }
36
47
  //# sourceMappingURL=search.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heyio",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "IO — a personal AI assistant daemon built on the GitHub Copilot SDK",
5
5
  "bin": {
6
6
  "io": "dist/index.js"
@@ -1,6 +1,6 @@
1
- import{h as W,k as X,p as Z,r as a,g as d,d as o,j as P,x as A,a as V,i as S,w as l,N as f,G as T,F as h,t as w,J as F,f as b,s as n,c as _,m as ee}from"./index-DfdD_qE4.js";import{b as L}from"./api-CaqVk-rG.js";/**
1
+ import{q as W,t as X,x as Z,z as a,o as d,l as o,s as A,K as N,a as V,r as S,J as l,Y as f,T,F as h,E as w,V as F,n as b,D as n,h as L,k as _,v as ee}from"./index-CiZnRvN4.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
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const te=W("FilterIcon",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]),oe={class:"p-6"},se={class:"flex items-center justify-between mb-6"},ae={class:"text-2xl font-bold flex items-center gap-2"},de={class:"text-sm text-muted-foreground"},le={class:"border border-border rounded-lg p-4 mb-6 space-y-3"},re={class:"flex items-center gap-2 text-sm font-medium text-muted-foreground mb-1"},ne={class:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3"},ue=["value"],ie=["value"],ce=["value"],pe={key:0,class:"text-muted-foreground"},ve={key:1,class:"text-center py-12 text-muted-foreground"},me={key:2,class:"space-y-1"},ge=["onClick"],xe={class:"flex-1 min-w-0"},fe={class:"flex flex-wrap items-center gap-2 mb-1"},be={key:0,class:"text-xs bg-secondary text-secondary-foreground px-2 py-0.5 rounded-full"},_e={key:1,class:"text-xs bg-secondary text-secondary-foreground px-2 py-0.5 rounded-full"},ye={class:"text-sm truncate"},ke={class:"text-xs text-muted-foreground mt-0.5"},he={class:"text-xs text-muted-foreground mt-1 shrink-0"},we={key:0,class:"border-t border-border px-4 py-3"},qe={key:0,class:"text-xs text-muted-foreground mb-2"},Ce={class:"font-mono"},Ne={class:"text-xs bg-muted rounded p-3 overflow-x-auto whitespace-pre-wrap break-words"},Pe={key:3,class:"flex items-center justify-between mt-4"},Ae=["disabled"],Se={class:"text-xs text-muted-foreground"},Te=["disabled"],u=50,Ie=X({__name:"AuditLogView",setup(Ve){const q=n([]),c=n(0),C=n(!0),y=n(null),N=n([]),k=n([]),i=n(""),p=n(""),v=n(""),m=n(""),g=n(""),r=n(0),M=["message_received","task_delegated","task_completed","task_failed","shell_command","squad_created","squad_meeting"],I={message_received:"bg-blue-500/20 text-blue-400",task_delegated:"bg-purple-500/20 text-purple-400",task_completed:"bg-green-500/20 text-green-400",task_failed:"bg-red-500/20 text-red-400",shell_command:"bg-yellow-500/20 text-yellow-400",squad_created:"bg-indigo-500/20 text-indigo-400",squad_meeting:"bg-teal-500/20 text-teal-400"};function O(s){return I[s]??"bg-secondary text-secondary-foreground"}async function x(){C.value=!0;try{const s=new URLSearchParams;i.value&&s.set("squad_id",i.value),p.value&&s.set("agent_id",p.value),v.value&&s.set("action_type",v.value),m.value&&s.set("from",m.value),g.value&&s.set("to",g.value),s.set("limit",String(u)),s.set("offset",String(r.value));const t=await L(`/audit-log?${s.toString()}`);q.value=t.entries,c.value=t.total}finally{C.value=!1}}async function U(){const s=await L("/squads");N.value=s.squads,k.value=s.agents}function $(){r.value=0,x()}function D(){i.value="",p.value="",v.value="",m.value="",g.value="",r.value=0,x()}function j(){r.value>0&&(r.value=Math.max(0,r.value-u),x())}function B(){r.value+u<c.value&&(r.value=r.value+u,x())}function E(s){y.value=y.value===s?null:s}function J(s){try{return JSON.stringify(JSON.parse(s.payload),null,2)}catch{return s.payload}}function R(s){var t;return s?((t=N.value.find(e=>e.id===s))==null?void 0:t.name)??s.slice(0,8):""}function G(s){if(!s)return"";const t=k.value.find(e=>e.id===s);return t?`${t.character_name} (${t.role_title})`:s.slice(0,8)}const Y=_(()=>r.value+u<c.value),z=_(()=>r.value>0),H=_(()=>Math.floor(r.value/u)+1),K=_(()=>Math.max(1,Math.ceil(c.value/u))),Q=_(()=>i.value?k.value.filter(s=>s.squad_id===i.value):k.value);return Z(async()=>{await Promise.all([x(),U()])}),(s,t)=>(a(),d("div",oe,[o("div",se,[o("h1",ae,[P(A(V),{class:"w-6 h-6"}),t[6]||(t[6]=S(" Audit Log ",-1))]),o("span",de,l(c.value)+" entries",1)]),o("div",le,[o("div",re,[P(A(te),{class:"w-4 h-4"}),t[7]||(t[7]=S(" Filters ",-1))]),o("div",ne,[f(o("select",{"onUpdate:modelValue":t[0]||(t[0]=e=>i.value=e),class:"px-2 py-1.5 text-sm rounded-md border border-border bg-background",onChange:t[1]||(t[1]=e=>p.value="")},[t[8]||(t[8]=o("option",{value:""},"All squads",-1)),(a(!0),d(h,null,w(N.value,e=>(a(),d("option",{key:e.id,value:e.id},l(e.name),9,ue))),128))],544),[[T,i.value]]),f(o("select",{"onUpdate:modelValue":t[2]||(t[2]=e=>p.value=e),class:"px-2 py-1.5 text-sm rounded-md border border-border bg-background"},[t[9]||(t[9]=o("option",{value:""},"All agents",-1)),(a(!0),d(h,null,w(Q.value,e=>(a(),d("option",{key:e.id,value:e.id},l(e.character_name),9,ie))),128))],512),[[T,p.value]]),f(o("select",{"onUpdate:modelValue":t[3]||(t[3]=e=>v.value=e),class:"px-2 py-1.5 text-sm rounded-md border border-border bg-background"},[t[10]||(t[10]=o("option",{value:""},"All action types",-1)),(a(),d(h,null,w(M,e=>o("option",{key:e,value:e},l(e),9,ce)),64))],512),[[T,v.value]]),f(o("input",{"onUpdate:modelValue":t[4]||(t[4]=e=>m.value=e),type:"datetime-local",placeholder:"From",class:"px-2 py-1.5 text-sm rounded-md border border-border bg-background"},null,512),[[F,m.value]]),f(o("input",{"onUpdate:modelValue":t[5]||(t[5]=e=>g.value=e),type:"datetime-local",placeholder:"To",class:"px-2 py-1.5 text-sm rounded-md border border-border bg-background"},null,512),[[F,g.value]])]),o("div",{class:"flex gap-2"},[o("button",{onClick:$,class:"px-3 py-1.5 text-xs rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors"}," Apply "),o("button",{onClick:D,class:"px-3 py-1.5 text-xs rounded-md border border-border text-muted-foreground hover:text-foreground transition-colors"}," Reset ")])]),C.value?(a(),d("div",pe,"Loading...")):q.value.length===0?(a(),d("div",ve,[P(A(V),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),t[11]||(t[11]=o("p",null,"No audit log entries found.",-1))])):(a(),d("div",me,[(a(!0),d(h,null,w(q.value,e=>(a(),d("div",{key:e.id,class:"border border-border rounded-lg overflow-hidden"},[o("div",{onClick:Fe=>E(e.id),class:"flex items-start gap-3 px-4 py-3 cursor-pointer hover:bg-muted/50 transition-colors"},[o("div",xe,[o("div",fe,[o("span",{class:ee(["text-xs px-2 py-0.5 rounded-full font-mono",O(e.action_type)])},l(e.action_type),3),e.squad_id?(a(),d("span",be,l(R(e.squad_id)),1)):b("",!0),e.agent_id?(a(),d("span",_e,l(G(e.agent_id)),1)):b("",!0)]),o("p",ye,l(e.summary),1),o("p",ke,l(e.created_at),1)]),o("span",he,l(y.value===e.id?"▲":"▼"),1)],8,ge),y.value===e.id?(a(),d("div",we,[e.task_id?(a(),d("div",qe,[t[12]||(t[12]=S(" Task ID: ",-1)),o("code",Ce,l(e.task_id),1)])):b("",!0),o("pre",Ne,l(J(e)),1)])):b("",!0)]))),128))])),c.value>u?(a(),d("div",Pe,[o("button",{disabled:!z.value,onClick:j,class:"px-3 py-1.5 text-xs rounded-md border border-border text-muted-foreground disabled:opacity-40 hover:text-foreground transition-colors"}," ← Previous ",8,Ae),o("span",Se," Page "+l(H.value)+" of "+l(K.value),1),o("button",{disabled:!Y.value,onClick:B,class:"px-3 py-1.5 text-xs rounded-md border border-border text-muted-foreground disabled:opacity-40 hover:text-foreground transition-colors"}," Next → ",8,Te)])):b("",!0)]))}});export{Ie as default};
6
+ */const te=W("FilterIcon",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]),oe={class:"p-6"},se={class:"flex items-center justify-between mb-6"},ae={class:"text-2xl font-bold flex items-center gap-2"},de={class:"text-sm text-muted-foreground"},le={class:"border border-border rounded-lg p-4 mb-6 space-y-3"},re={class:"flex items-center gap-2 text-sm font-medium text-muted-foreground mb-1"},ne={class:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3"},ue=["value"],ie=["value"],ce=["value"],pe={key:0,class:"text-muted-foreground"},ve={key:1,class:"text-center py-12 text-muted-foreground"},me={key:2,class:"space-y-1"},ge=["onClick"],xe={class:"flex-1 min-w-0"},fe={class:"flex flex-wrap items-center gap-2 mb-1"},be={key:0,class:"text-xs bg-secondary text-secondary-foreground px-2 py-0.5 rounded-full"},_e={key:1,class:"text-xs bg-secondary text-secondary-foreground px-2 py-0.5 rounded-full"},ye={class:"text-sm truncate"},ke={class:"text-xs text-muted-foreground mt-0.5"},he={class:"text-xs text-muted-foreground mt-1 shrink-0"},we={key:0,class:"border-t border-border px-4 py-3"},qe={key:0,class:"text-xs text-muted-foreground mb-2"},Ce={class:"font-mono"},Pe={class:"text-xs bg-muted rounded p-3 overflow-x-auto whitespace-pre-wrap break-words"},Ae={key:3,class:"flex items-center justify-between mt-4"},Ne=["disabled"],Se={class:"text-xs text-muted-foreground"},Te=["disabled"],u=50,Me=X({__name:"AuditLogView",setup(Ve){const q=n([]),c=n(0),C=n(!0),y=n(null),P=n([]),k=n([]),i=n(""),p=n(""),v=n(""),m=n(""),g=n(""),r=n(0),M=["message_received","task_delegated","task_completed","task_failed","shell_command","squad_created","squad_meeting"],I={message_received:"bg-blue-500/20 text-blue-400",task_delegated:"bg-purple-500/20 text-purple-400",task_completed:"bg-green-500/20 text-green-400",task_failed:"bg-red-500/20 text-red-400",shell_command:"bg-yellow-500/20 text-yellow-400",squad_created:"bg-indigo-500/20 text-indigo-400",squad_meeting:"bg-teal-500/20 text-teal-400"};function O(s){return I[s]??"bg-secondary text-secondary-foreground"}async function x(){C.value=!0;try{const s=new URLSearchParams;i.value&&s.set("squad_id",i.value),p.value&&s.set("agent_id",p.value),v.value&&s.set("action_type",v.value),m.value&&s.set("from",m.value),g.value&&s.set("to",g.value),s.set("limit",String(u)),s.set("offset",String(r.value));const t=await L(`/audit-log?${s.toString()}`);q.value=t.entries,c.value=t.total}finally{C.value=!1}}async function U(){const s=await L("/squads");P.value=s.squads,k.value=s.agents}function D(){r.value=0,x()}function $(){i.value="",p.value="",v.value="",m.value="",g.value="",r.value=0,x()}function E(){r.value>0&&(r.value=Math.max(0,r.value-u),x())}function B(){r.value+u<c.value&&(r.value=r.value+u,x())}function J(s){y.value=y.value===s?null:s}function R(s){try{return JSON.stringify(JSON.parse(s.payload),null,2)}catch{return s.payload}}function Y(s){var t;return s?((t=P.value.find(e=>e.id===s))==null?void 0:t.name)??s.slice(0,8):""}function j(s){if(!s)return"";const t=k.value.find(e=>e.id===s);return t?`${t.character_name} (${t.role_title})`:s.slice(0,8)}const z=_(()=>r.value+u<c.value),G=_(()=>r.value>0),K=_(()=>Math.floor(r.value/u)+1),H=_(()=>Math.max(1,Math.ceil(c.value/u))),Q=_(()=>i.value?k.value.filter(s=>s.squad_id===i.value):k.value);return Z(async()=>{await Promise.all([x(),U()])}),(s,t)=>(a(),d("div",oe,[o("div",se,[o("h1",ae,[A(N(V),{class:"w-6 h-6"}),t[6]||(t[6]=S(" Audit Log ",-1))]),o("span",de,l(c.value)+" entries",1)]),o("div",le,[o("div",re,[A(N(te),{class:"w-4 h-4"}),t[7]||(t[7]=S(" Filters ",-1))]),o("div",ne,[f(o("select",{"onUpdate:modelValue":t[0]||(t[0]=e=>i.value=e),class:"px-2 py-1.5 text-sm rounded-md border border-border bg-background",onChange:t[1]||(t[1]=e=>p.value="")},[t[8]||(t[8]=o("option",{value:""},"All squads",-1)),(a(!0),d(h,null,w(P.value,e=>(a(),d("option",{key:e.id,value:e.id},l(e.name),9,ue))),128))],544),[[T,i.value]]),f(o("select",{"onUpdate:modelValue":t[2]||(t[2]=e=>p.value=e),class:"px-2 py-1.5 text-sm rounded-md border border-border bg-background"},[t[9]||(t[9]=o("option",{value:""},"All agents",-1)),(a(!0),d(h,null,w(Q.value,e=>(a(),d("option",{key:e.id,value:e.id},l(e.character_name),9,ie))),128))],512),[[T,p.value]]),f(o("select",{"onUpdate:modelValue":t[3]||(t[3]=e=>v.value=e),class:"px-2 py-1.5 text-sm rounded-md border border-border bg-background"},[t[10]||(t[10]=o("option",{value:""},"All action types",-1)),(a(),d(h,null,w(M,e=>o("option",{key:e,value:e},l(e),9,ce)),64))],512),[[T,v.value]]),f(o("input",{"onUpdate:modelValue":t[4]||(t[4]=e=>m.value=e),type:"datetime-local",placeholder:"From",class:"px-2 py-1.5 text-sm rounded-md border border-border bg-background"},null,512),[[F,m.value]]),f(o("input",{"onUpdate:modelValue":t[5]||(t[5]=e=>g.value=e),type:"datetime-local",placeholder:"To",class:"px-2 py-1.5 text-sm rounded-md border border-border bg-background"},null,512),[[F,g.value]])]),o("div",{class:"flex gap-2"},[o("button",{onClick:D,class:"px-3 py-1.5 text-xs rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors"}," Apply "),o("button",{onClick:$,class:"px-3 py-1.5 text-xs rounded-md border border-border text-muted-foreground hover:text-foreground transition-colors"}," Reset ")])]),C.value?(a(),d("div",pe,"Loading...")):q.value.length===0?(a(),d("div",ve,[A(N(V),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),t[11]||(t[11]=o("p",null,"No audit log entries found.",-1))])):(a(),d("div",me,[(a(!0),d(h,null,w(q.value,e=>(a(),d("div",{key:e.id,class:"border border-border rounded-lg overflow-hidden"},[o("div",{onClick:Fe=>J(e.id),class:"flex items-start gap-3 px-4 py-3 cursor-pointer hover:bg-muted/50 transition-colors"},[o("div",xe,[o("div",fe,[o("span",{class:ee(["text-xs px-2 py-0.5 rounded-full font-mono",O(e.action_type)])},l(e.action_type),3),e.squad_id?(a(),d("span",be,l(Y(e.squad_id)),1)):b("",!0),e.agent_id?(a(),d("span",_e,l(j(e.agent_id)),1)):b("",!0)]),o("p",ye,l(e.summary),1),o("p",ke,l(e.created_at),1)]),o("span",he,l(y.value===e.id?"▲":"▼"),1)],8,ge),y.value===e.id?(a(),d("div",we,[e.task_id?(a(),d("div",qe,[t[12]||(t[12]=S(" Task ID: ",-1)),o("code",Ce,l(e.task_id),1)])):b("",!0),o("pre",Pe,l(R(e)),1)])):b("",!0)]))),128))])),c.value>u?(a(),d("div",Ae,[o("button",{disabled:!G.value,onClick:E,class:"px-3 py-1.5 text-xs rounded-md border border-border text-muted-foreground disabled:opacity-40 hover:text-foreground transition-colors"}," ← Previous ",8,Ne),o("span",Se," Page "+l(K.value)+" of "+l(H.value),1),o("button",{disabled:!z.value,onClick:B,class:"px-3 py-1.5 text-xs rounded-md border border-border text-muted-foreground disabled:opacity-40 hover:text-foreground transition-colors"}," Next → ",8,Te)])):b("",!0)]))}});export{Me as default};
@@ -0,0 +1 @@
1
+ import{t as h,N as _,W as p,x as b,z as a,o,l as e,K as r,n as x,F as k,E as w,Y as S,V as C,m as u,S as B,d as V,D as g,v as m,f as K,u as y}from"./index-CiZnRvN4.js";const T={class:"flex flex-col h-full"},j={key:0,class:"flex items-center justify-center h-full"},z={key:1,class:"text-muted-foreground"},D={key:2,class:"inline-block w-2 h-4 bg-current animate-pulse ml-1"},E={class:"border-t border-border p-4"},M={class:"flex gap-2 items-end"},N=["disabled"],q=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",T,[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",j,[...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(K,{key:0,content:t.content,class:m(t.role==="user"?"prose-invert":"")},null,8,["content","class"])):(a(),o("span",z,"...")),t.streaming?(a(),o("div",D)):x("",!0)],2)],2))),128))],512),e("div",E,[e("div",M,[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(V),{key:1,class:"w-4 h-4"})):(a(),u(r(B),{key:0,class:"w-4 h-4"}))],8,N)])])]))}});export{q as default};
@@ -0,0 +1,6 @@
1
+ import{q as M,t as D,x as N,z as o,o as n,l as a,F as y,E as b,s as c,K as i,I as V,D as d,h as k,k as z,v as f,J as v,w as B,$ as q,n as C,f as E,i as P,g as T}from"./index-CiZnRvN4.js";import{g as j}from"./squad-colors-B8B_Y-lz.js";import{T as A}from"./trash-2-CQSzbVIr.js";/**
2
+ * @license lucide-vue-next v0.474.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const G=M("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),J={class:"p-6"},K={class:"flex items-center justify-between mb-6"},R={class:"flex gap-2"},U=["onClick"],W={key:0,class:"text-muted-foreground"},H={key:1,class:"text-center py-12 text-muted-foreground"},O={key:2,class:"space-y-2"},Q=["onClick"],X={class:"flex-1 min-w-0"},Y={class:"flex items-center gap-2"},Z={class:"text-xs text-muted-foreground mt-0.5"},ee={class:"flex gap-1"},te=["onClick"],se=["onClick"],ae={key:0,class:"px-4 pb-3 border-t border-border pt-3"},le=D({__name:"FeedView",setup(oe){const r=d([]),m=d([]),l=d(0),p=d("all"),x=d(!0),u=d(null);async function g(){x.value=!0;try{const e=await k(`/feed?unread=${p.value==="unread"}`);r.value=e.items,l.value=e.unreadCount}finally{x.value=!1}}async function w(){const e=await k("/squads");m.value=e.squads}async function h(e){await P(`/feed/${e}/read`);const s=r.value.find(t=>t.id===e);s&&(s.read=1,l.value=Math.max(0,l.value-1))}async function $(e){await T(`/feed/${e}`),r.value=r.value.filter(s=>s.id!==e)}function I(e){u.value=u.value===e?null:e,u.value===e&&h(e)}function S(e){if(!e.startsWith("squad-"))return;const s=e.slice(6);return m.value.find(t=>t.id===s)}const F=z(()=>r.value.map(e=>{const s=S(e.source);return{...e,squad:s}}));N(async()=>{await Promise.all([g(),w()])});function L(e){var s;return((s=e.squad)==null?void 0:s.name)??e.source}return(e,s)=>(o(),n("div",J,[a("div",K,[s[0]||(s[0]=a("h1",{class:"text-2xl font-bold"},"Feed",-1)),a("div",R,[(o(),n(y,null,b(["all","unread"],t=>a("button",{key:t,onClick:_=>{p.value=t,g()},class:f(["px-3 py-1.5 text-xs rounded-md border transition-colors",p.value===t?"bg-primary text-primary-foreground border-primary":"border-border text-muted-foreground hover:text-foreground"])},v(t==="all"?"All":`Unread (${l.value})`),11,U)),64))])]),x.value?(o(),n("div",W,"Loading...")):r.value.length===0?(o(),n("div",H,[c(i(V),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),s[1]||(s[1]=a("p",null,"No feed items.",-1))])):(o(),n("div",O,[(o(!0),n(y,null,b(F.value,t=>(o(),n("div",{key:t.id,class:f(["border border-border rounded-lg overflow-hidden",{"border-l-2 border-l-primary":!t.read}])},[a("div",{onClick:_=>I(t.id),class:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-muted/50 transition-colors"},[a("div",X,[a("div",Y,[a("span",{class:f(["text-xs px-2 py-0.5 rounded-full",{"bg-secondary text-secondary-foreground":!t.squad}]),style:B(t.squad?i(j)(t.squad.color):{})},v(L(t)),7),a("span",{class:f(["text-sm font-medium truncate",{"font-bold":!t.read}])},v(t.title),3)]),a("p",Z,v(t.created_at),1)]),a("div",ee,[t.read?C("",!0):(o(),n("button",{key:0,onClick:q(_=>h(t.id),["stop"]),class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Mark as read"},[c(i(G),{class:"w-3.5 h-3.5"})],8,te)),a("button",{onClick:q(_=>$(t.id),["stop"]),class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive",title:"Delete"},[c(i(A),{class:"w-3.5 h-3.5"})],8,se)])],8,Q),u.value===t.id?(o(),n("div",ae,[c(E,{content:t.content},null,8,["content"])])):C("",!0)],2))),128))]))]))}});export{le as default};
@@ -0,0 +1 @@
1
+ import{t as U,W as q,x as z,z as r,o as n,l as t,s as d,K as c,H as M,Y as T,V as D,M as E,n as m,F as $,E as A,v as p,J as g,D as a,h as B,k as P,m as G,f as J,g as K}from"./index-CiZnRvN4.js";import{S as Q}from"./search-Cl8HcIsG.js";import{A as R}from"./arrow-left-CGMB1w_A.js";import{T as W}from"./trash-2-CQSzbVIr.js";const Y={class:"flex h-full"},I={class:"p-3 border-b border-border space-y-2"},O={class:"flex items-center gap-2"},X={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"],le={class:"flex-1 min-w-0"},ae={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"},xe={class:"flex items-center gap-2 px-4 py-2 border-b border-border"},me={class:"text-sm font-medium text-muted-foreground"},pe={class:"flex-1 overflow-y-auto p-4 space-y-4"},ge={key:0,class:"text-center text-xs text-muted-foreground py-8"},he={class:"text-xs mt-1 opacity-60"},ye={key:1,class:"hidden md:flex flex-1 items-center justify-center text-muted-foreground"},be={class:"text-center"},_e=50,De=U({__name:"HistoryView",setup(ke){const l=a([]),h=a(0),y=a(!0),f=a(""),v=a(""),x=a(""),u=a(null),b=a([]),_=a(!1),k=a(0);async function w(o=!0){y.value=!0;try{o&&(k.value=0,l.value=[]);const e=new URLSearchParams;f.value&&e.set("q",f.value),v.value&&e.set("from",v.value),x.value&&e.set("to",x.value+"T23:59:59"),e.set("limit",String(_e)),e.set("offset",String(k.value));const i=await B(`/history?${e.toString()}`);l.value=o?i.items:[...l.value,...i.items],h.value=i.total,k.value+=i.items.length}finally{y.value=!1}}async function j(o){u.value=o,_.value=!0;try{b.value=await B(`/history/${o}`)}finally{_.value=!1}}function L(){u.value=null,b.value=[]}async function F(o,e){e.stopPropagation(),confirm("Delete this conversation?")&&(await K(`/history/${o}`),l.value=l.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=P(()=>l.value.length<h.value);let S=null;return q([f,v,x],()=>{S&&clearTimeout(S),S=setTimeout(()=>w(!0),300)}),z(()=>w(!0)),(o,e)=>{var i;return r(),n("div",Y,[t("div",{class:p(["flex flex-col border-r border-border",u.value?"hidden md:flex w-80 shrink-0":"flex-1"])},[t("div",I,[t("div",O,[d(c(M),{class:"w-4 h-4 text-muted-foreground"}),e[4]||(e[4]=t("span",{class:"text-sm font-medium"},"Conversation History",-1))]),t("div",X,[d(c(Q),{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=>x.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,x.value]])])])]),t("div",se,[y.value&&l.value.length===0?(r(),n("div",oe," Loading... ")):l.value.length===0?(r(),n("div",re,[d(c(E),{class:"w-10 h-10 mb-3 opacity-40"}),e[7]||(e[7]=t("p",{class:"text-sm"},"No conversations found.",-1)),e[8]||(e[8]=t("p",{class:"text-xs mt-1"},"Start chatting to build up your history.",-1))])):m("",!0),(r(!0),n($,null,A(l.value,s=>(r(),n("div",{key:s.id,class:p(["group flex items-start gap-2 px-3 py-3 border-b border-border cursor-pointer hover:bg-accent/50 transition-colors",u.value===s.id?"bg-accent":""]),onClick:V=>j(s.id)},[t("div",le,[t("p",ae,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:V=>F(s.id,V)},[d(c(W),{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=>w(!1))}," Load more ")])):m("",!0)])],2),u.value?(r(),n("div",ve,[t("div",xe,[t("button",{class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Back",onClick:L},[d(c(R),{class:"w-4 h-4"})]),t("span",me,g(C(((i=l.value.find(s=>s.id===u.value))==null?void 0:i.startedAt)??"")),1)]),t("div",pe,[_.value?(r(),n("div",ge," Loading... ")):m("",!0),(r(!0),n($,null,A(b.value,s=>(r(),n("div",{key:s.id,class:p(["flex",s.role==="user"?"justify-end":"justify-start"])},[t("div",{class:p(["max-w-[75%] rounded-lg px-4 py-2 text-sm",s.role==="user"?"bg-blue-600 text-white":"bg-muted text-foreground"])},[s.content?(r(),G(J,{key:0,content:s.content,class:p(s.role==="user"?"prose-invert":"")},null,8,["content","class"])):m("",!0),t("p",he,g(C(s.createdAt)),1)],2)],2))),128))])])):u.value?m("",!0):(r(),n("div",ye,[t("div",be,[d(c(M),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[9]||(e[9]=t("p",null,"Select a conversation to view",-1))])]))])}}});export{De as default};
@@ -0,0 +1 @@
1
+ import{t as b,L as v,z as u,o as i,l as t,s as y,$ as w,Y as m,V as p,J as f,n as V,K as g,D as d,_,Q as h}from"./index-CiZnRvN4.js";const S={class:"min-h-screen flex items-center justify-center bg-background p-4"},k={class:"w-full max-w-sm space-y-8"},D={class:"text-center"},L={key:0,class:"text-sm text-destructive"},A=["disabled"],N=b({__name:"LoginView",setup(B){const o=v(),c=h(),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",S,[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",L,f(s.value),1)):V("",!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,A)],32),e[6]||(e[6]=t("p",{class:"text-center text-xs text-muted-foreground"}," Personal AI Assistant Daemon ",-1))])]))}});export{N as default};
@@ -0,0 +1 @@
1
+ import{t as k,x as C,h,z as a,o as n,l as t,s as m,K as p,r as S,Y as u,V as v,T as V,n as _,c as M,F as N,E as P,D as i,i as T,J as b,v as y,j as U,g as $}from"./index-CiZnRvN4.js";import{P as D}from"./plus-DIBAaEMT.js";import{T as j}from"./trash-2-CQSzbVIr.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"},E={key:0},F={key:1},G={key:1,class:"text-muted-foreground"},J={key:2,class:"text-center py-12 text-muted-foreground"},K={key:3,class:"space-y-2"},R={class:"font-medium text-sm"},Y={class:"ml-2 text-xs text-muted-foreground bg-secondary px-1.5 py-0.5 rounded"},q={class:"flex items-center gap-3"},H=["onClick"],I=["onClick"],Z=k({__name:"McpView",setup(O){const d=i([]),c=i(!0),r=i(!1),o=i({name:"",type:"stdio",command:"",url:""});C(async()=>{try{d.value=await h("/mcp")}finally{c.value=!1}});async function x(l){await U(`/mcp/${l.id}`,{enabled:!l.enabled}),l.enabled=!l.enabled}async function f(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]=S(" 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),[[V,o.value.type]])])]),o.value.type==="stdio"?(a(),n("div",E,[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",F,[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",G,"Loading...")):d.value.length===0?(a(),n("div",J,[m(p(M),{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",K,[(a(!0),n(N,null,P(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",Y,b(s.type),1)]),t("div",q,[t("button",{onClick:w=>x(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,H),t("button",{onClick:w=>f(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,I)])]))),128))]))]))}});export{Z as default};
@@ -0,0 +1,6 @@
1
+ import{q as B,t as L,x as j,h as S,z as d,o as r,l as o,s as v,K as p,r as z,F as x,E as y,Y as b,T as h,V as C,n as _,b as E,J as l,D as u,i as T,k as M,v as w,w as O,j as A,g as F}from"./index-CiZnRvN4.js";import{g as G}from"./squad-colors-B8B_Y-lz.js";import{P as J}from"./plus-DIBAaEMT.js";import{T as K}from"./trash-2-CQSzbVIr.js";/**
2
+ * @license lucide-vue-next v0.474.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const R=B("PlayIcon",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]),Y={class:"p-6"},H={class:"flex items-center justify-between mb-6"},Q={class:"flex gap-1 border-b border-border mb-4"},W=["onClick"],X={key:0,class:"border border-border rounded-lg p-4 mb-4 space-y-3"},Z={class:"grid grid-cols-2 gap-3"},ee=["value"],te=["disabled"],oe={key:1,class:"text-muted-foreground"},se={key:2,class:"text-center py-12 text-muted-foreground"},ae={key:3,class:"space-y-2"},de={class:"text-sm font-medium font-mono"},re={key:0,class:"mt-1"},ne={class:"text-xs text-muted-foreground mt-0.5"},le={class:"text-xs text-muted-foreground mt-0.5"},ue={class:"flex items-center gap-3"},ie=["onClick"],pe={key:0,class:"text-xs text-green-500 font-medium"},me=["onClick"],ce=["onClick"],ye=L({__name:"SchedulesView",setup(ve){const n=u([]),i=u([]),k=u(!0),m=u("squad"),c=u(!1),a=u({type:"squad",cron:"",squad_id:"",prompt:""}),f=u(null);j(async()=>{try{const s=await S("/squads");i.value=s.squads,i.value.length>0&&(a.value.squad_id=i.value[0].id),n.value=await S("/schedules")}finally{k.value=!1}});const q=()=>n.value.filter(s=>s.type===m.value);async function V(){const s={type:a.value.type,cron:a.value.cron,squad_id:a.value.squad_id};if(!a.value.squad_id||!a.value.prompt.trim())return;s.prompt=a.value.prompt;const e=await T("/schedules",s);n.value.push(e),c.value=!1}function P(s){if(s)return i.value.find(e=>e.id===s)}const $=M(()=>q().map(s=>({...s,squad:P(s.squad_id)})));async function N(s){const e=!s.enabled;await A(`/schedules/${s.id}`,{enabled:e}),s.enabled=e?1:0}async function D(s){await F(`/schedules/${s}`),n.value=n.value.filter(e=>e.id!==s)}async function I(s){await T(`/schedules/${s.id}/trigger`,{}),f.value=s.id;const e=n.value.findIndex(t=>t.id===s.id);e!==-1&&(n.value[e]={...n.value[e],last_run:new Date().toISOString()}),setTimeout(()=>{f.value=null},3e3)}function U(s){var e;return s?((e=i.value.find(t=>t.id===s))==null?void 0:e.name)??s:"Unknown squad"}return(s,e)=>(d(),r("div",Y,[o("div",H,[e[6]||(e[6]=o("h1",{class:"text-2xl font-bold"},"Schedules",-1)),o("button",{onClick:e[0]||(e[0]=t=>c.value=!c.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"},[v(p(J),{class:"w-4 h-4"}),e[5]||(e[5]=z(" Add Schedule ",-1))])]),o("div",Q,[(d(),r(x,null,y(["squad","io"],t=>o("button",{key:t,onClick:g=>m.value=t,class:w(["px-4 py-2 text-sm font-medium border-b-2 transition-colors",m.value===t?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"])},l(t==="squad"?"Squad Schedules":"IO Schedules"),11,W)),64))]),c.value?(d(),r("div",X,[o("div",Z,[o("div",null,[e[8]||(e[8]=o("label",{class:"text-sm font-medium"},"Type",-1)),b(o("select",{"onUpdate:modelValue":e[1]||(e[1]=t=>a.value.type=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[7]||(e[7]=[o("option",{value:"squad"},"Squad",-1),o("option",{value:"io"},"IO",-1)])],512),[[h,a.value.type]])]),o("div",null,[e[9]||(e[9]=o("label",{class:"text-sm font-medium"},"Cron Expression",-1)),b(o("input",{"onUpdate:modelValue":e[2]||(e[2]=t=>a.value.cron=t),placeholder:"0 9 * * 1-5",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[C,a.value.cron]])])]),o("div",null,[e[10]||(e[10]=o("label",{class:"text-sm font-medium"},"Target Squad",-1)),b(o("select",{"onUpdate:modelValue":e[3]||(e[3]=t=>a.value.squad_id=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[(d(!0),r(x,null,y(i.value,t=>(d(),r("option",{key:t.id,value:t.id},l(t.name),9,ee))),128))],512),[[h,a.value.squad_id]])]),o("div",null,[e[11]||(e[11]=o("label",{class:"text-sm font-medium"},"Prompt",-1)),b(o("textarea",{"onUpdate:modelValue":e[4]||(e[4]=t=>a.value.prompt=t),rows:"3",placeholder:"e.g. Triage issues, review PRs, ideate on features",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[C,a.value.prompt]])]),o("button",{onClick:V,disabled:!a.value.squad_id||!a.value.prompt.trim(),class:"px-4 py-2 text-sm rounded-md bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed"}," Save ",8,te)])):_("",!0),k.value?(d(),r("div",oe,"Loading...")):q().length===0?(d(),r("div",se,[v(p(E),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),o("p",null,"No "+l(m.value)+" schedules configured.",1)])):(d(),r("div",ae,[(d(!0),r(x,null,y($.value,t=>(d(),r("div",{key:t.id,class:"flex items-center justify-between border border-border rounded-lg px-4 py-3"},[o("div",null,[o("div",de,l(t.cron),1),t.squad?(d(),r("div",re,[o("span",{class:"text-xs px-2 py-0.5 rounded-full",style:O(p(G)(t.squad.color))},l(t.squad.name),5)])):_("",!0),o("div",ne,l(t.prompt?t.prompt.slice(0,80):"(no prompt)"),1),o("div",le," Squad: "+l(U(t.squad_id)),1)]),o("div",ue,[o("button",{onClick:g=>I(t),class:"p-1.5 rounded hover:bg-primary/10 text-muted-foreground hover:text-primary",title:"Trigger now"},[v(p(R),{class:"w-4 h-4"})],8,ie),f.value===t.id?(d(),r("span",pe,"Triggered!")):_("",!0),o("button",{onClick:g=>N(t),class:w(["relative w-10 h-5 rounded-full transition-colors",t.enabled?"bg-primary":"bg-muted"])},[o("span",{class:w(["absolute top-0.5 w-4 h-4 rounded-full bg-white transition-transform",t.enabled?"translate-x-5":"translate-x-0.5"])},null,2)],10,me),o("button",{onClick:g=>D(t.id),class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive"},[v(p(K),{class:"w-4 h-4"})],8,ce)])]))),128))]))]))}});export{ye as default};
@@ -0,0 +1 @@
1
+ import{t as w,x as E,z as d,o as s,l as t,J as g,F as x,E as U,Y as a,V as n,T,R as p,n as b,D as r,h as V,j as M,v as S}from"./index-CiZnRvN4.js";const z={class:"p-6"},A={class:"flex items-center justify-between mb-6"},B=["disabled"],N={key:0,class:"text-muted-foreground"},C={class:"flex gap-1 border-b border-border mb-6"},D=["onClick"],I={key:0,class:"space-y-4 max-w-lg"},K={class:"flex items-center gap-3"},j={key:1,class:"space-y-4 max-w-lg"},L={class:"flex items-center gap-3"},R={key:2,class:"space-y-4 max-w-lg"},F={key:3,class:"space-y-4 max-w-lg"},G={class:"flex items-center gap-3"},O={class:"flex items-center gap-3"},W=w({__name:"SettingsView",setup(P){const v=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(){v.value=!0;try{const f=await V("/settings");o.value=f}finally{v.value=!1}}async function c(){i.value=!0,m.value=!1;try{await M("/settings",o.value),m.value=!0,setTimeout(()=>m.value=!1,2e3)}finally{i.value=!1}}return E(k),(f,e)=>(d(),s("div",z,[t("div",A,[e[12]||(e[12]=t("h1",{class:"text-2xl font-bold"},"Settings",-1)),t("button",{onClick:c,disabled:i.value,class:"px-4 py-2 rounded-md bg-primary text-primary-foreground text-sm hover:bg-primary/90 disabled:opacity-50"},g(i.value?"Saving...":m.value?"Saved ✓":"Save"),9,B)]),v.value?(d(),s("div",N,"Loading...")):(d(),s(x,{key:1},[t("div",C,[(d(),s(x,null,U(y,l=>t("button",{key:l.id,onClick:q=>u.value=l.id,class:S(["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,D)),64))]),u.value==="general"?(d(),s("div",I,[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",j,[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",L,[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",R,[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",F,[t("div",G,[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",O,[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{W as default};
@@ -0,0 +1,15 @@
1
+ import{q as fe,t as me,x as xe,z as l,o as a,l as t,v as j,s as u,K as d,r as q,F as p,Y as C,V as M,Z as ee,J as r,n as S,P as te,E as se,T as ge,m as le,f as oe,D as n,k as ye,h as z,i as J,j as be,$ as ae,g as ke}from"./index-CiZnRvN4.js";import{P as ne}from"./plus-DIBAaEMT.js";import{S as he}from"./search-Cl8HcIsG.js";import{P as _e,S as we}from"./save-Chqlu7QA.js";import{X as Ce}from"./x-DThJHYFm.js";import{T as Se}from"./trash-2-CQSzbVIr.js";/**
2
+ * @license lucide-vue-next v0.474.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Q=fe("GlobeIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]),$e={class:"flex h-full"},Ie={class:"w-72 border-r border-border flex flex-col shrink-0"},Le={class:"flex border-b border-border"},Fe={class:"p-3 border-b border-border space-y-2"},Me={class:"flex gap-1"},Ve={key:0,class:"space-y-1.5"},De={class:"flex gap-1"},Te=["disabled"],Ue={key:1,class:"space-y-1.5"},Ee={key:0,class:"mt-0.5 text-xs text-muted-foreground font-mono"},Pe={class:"flex gap-1"},je=["disabled"],ze={class:"flex-1 overflow-y-auto p-2"},Ne={key:0,class:"text-xs text-muted-foreground p-2"},Ae={key:1,class:"text-center py-8 text-muted-foreground"},Ke=["onClick"],Ge={class:"min-w-0 flex-1"},Be={class:"font-medium truncate"},Re={class:"text-muted-foreground truncate"},qe=["onClick"],Je={class:"p-3 border-b border-border space-y-2"},Qe={class:"relative"},Xe=["disabled"],Ye={class:"flex-1 overflow-y-auto p-2"},Ze={key:0,class:"text-xs text-muted-foreground p-2"},He={key:1,class:"text-xs text-destructive p-2"},Oe={key:2,class:"text-center py-8 text-muted-foreground"},We=["onClick"],et={class:"min-w-0 flex-1"},tt={class:"font-medium truncate"},st=["title"],lt=["onClick","disabled"],ot={key:1,class:"shrink-0 mt-0.5 px-1.5 py-0.5 text-xs rounded bg-muted text-muted-foreground"},at={class:"flex-1 flex flex-col"},nt={key:0,class:"flex items-center justify-center h-full text-muted-foreground"},rt={class:"text-center"},it={class:"flex items-center justify-between px-4 py-2 border-b border-border"},ut={class:"text-sm font-medium"},dt={class:"text-xs text-muted-foreground ml-2 font-mono"},ct={class:"flex gap-1"},vt={class:"flex-1 overflow-y-auto p-4"},pt={key:0,class:"text-muted-foreground text-sm"},ft={key:0,class:"flex items-center justify-center h-full text-muted-foreground"},mt={class:"text-center"},xt={class:"flex items-center justify-between px-4 py-2 border-b border-border"},gt={class:"min-w-0 flex-1"},yt={class:"text-sm font-medium"},bt={class:"text-xs text-muted-foreground ml-2"},kt=["disabled"],ht={key:1,class:"ml-2 shrink-0 px-3 py-1 text-xs rounded bg-muted text-muted-foreground"},_t={class:"flex-1 overflow-y-auto p-4"},wt={key:0,class:"text-muted-foreground text-sm"},Ct={key:0,class:"absolute bottom-4 left-4 text-sm text-destructive bg-background border border-destructive/30 px-3 py-2 rounded-md"},re=`# My Skill
7
+
8
+ A brief description of what this skill does.
9
+
10
+ ## Usage
11
+
12
+ Instructions for how to use this skill...
13
+ `,Dt=me({__name:"SkillsView",setup(St){const V=n([]),N=n(!0),D=n(!1),A=n("git"),g=n(""),m=n(""),y=n(re),f=n(!1),i=n(""),X=ye(()=>m.value.trim().replace(/[^a-z0-9-]/gi,"-").toLowerCase().replace(/-+/g,"-").replace(/^-|-$/g,"")),v=n(null),x=n(""),b=n(!1),$=n(""),K=n(!1),k=n("installed"),G=n("awesome-copilot"),T=n(""),I=n([]),L=n(!1),U=n(""),c=n(null),h=n(""),B=n(!1),_=n("");async function w(){N.value=!0;try{V.value=await z("/skills")}finally{N.value=!1}}function Y(o){A.value=o,D.value=!0,i.value=""}function E(){D.value=!1,g.value="",m.value="",y.value=re,i.value=""}async function Z(){if(g.value.trim()){f.value=!0,i.value="";try{await J("/skills",{url:g.value.trim()}),E(),await w()}catch(o){i.value=o.message||"Failed to install skill"}finally{f.value=!1}}}async function ie(){if(!(!m.value.trim()||!y.value.trim())){f.value=!0,i.value="";try{await J("/skills",{slug:X.value,content:y.value}),E(),await w()}catch(o){i.value=o.message||"Failed to create skill"}finally{f.value=!1}}}async function ue(o){var e;try{await ke(`/skills/${o}`),((e=v.value)==null?void 0:e.slug)===o&&(v.value=null,x.value=""),await w()}catch(s){i.value=s.message||"Failed to remove skill"}}async function de(o){v.value=o,b.value=!1,K.value=!0;try{const e=await z(`/skills/${o.slug}/content`);x.value=e.content}catch(e){x.value=`Error loading skill: ${e.message}`}finally{K.value=!1}}function ce(){$.value=x.value,b.value=!0}async function ve(){if(v.value)try{await be(`/skills/${v.value.slug}/content`,{content:$.value}),x.value=$.value,b.value=!1,await w()}catch(o){i.value=o.message||"Failed to save skill"}}async function P(){L.value=!0,U.value="",c.value=null,h.value="";try{const o=new URLSearchParams({source:G.value});T.value.trim()&&o.set("q",T.value.trim()),I.value=await z(`/skills/discover?${o}`)}catch(o){U.value=o.message||"Failed to fetch community skills",I.value=[]}finally{L.value=!1}}async function pe(o){c.value=o,B.value=!0,h.value="";try{const e=await z(`/skills/preview?source=${o.source}&slug=${encodeURIComponent(o.slug)}`);h.value=e.content}catch(e){h.value=`Error loading preview: ${e.message}`}finally{B.value=!1}}async function H(o){_.value=o.slug,i.value="";try{await J("/skills",{source:o.source,slug:o.slug}),await w(),k.value="installed"}catch(e){i.value=e.message||"Failed to install skill"}finally{_.value=""}}function O(o){return V.value.some(e=>e.slug===o)}function W(o){k.value=o,v.value=null,c.value=null,x.value="",h.value="",o==="discover"&&I.value.length===0&&P()}return xe(w),(o,e)=>(l(),a("div",$e,[t("div",Ie,[t("div",Le,[t("button",{onClick:e[0]||(e[0]=s=>W("installed")),class:j(["flex-1 px-3 py-2 text-xs font-medium transition-colors",k.value==="installed"?"border-b-2 border-primary text-primary":"text-muted-foreground hover:text-foreground"])}," Installed ",2),t("button",{onClick:e[1]||(e[1]=s=>W("discover")),class:j(["flex-1 px-3 py-2 text-xs font-medium transition-colors",k.value==="discover"?"border-b-2 border-primary text-primary":"text-muted-foreground hover:text-foreground"])},[u(d(Q),{class:"w-3 h-3 inline mr-1"}),e[12]||(e[12]=q(" Discover ",-1))],2)]),k.value==="installed"?(l(),a(p,{key:0},[t("div",Fe,[t("div",Me,[t("button",{onClick:e[2]||(e[2]=s=>Y("git")),class:"flex-1 flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs rounded-md bg-primary text-primary-foreground hover:bg-primary/90"},[u(d(ne),{class:"w-3.5 h-3.5"}),e[13]||(e[13]=q(" From Git ",-1))]),t("button",{onClick:e[3]||(e[3]=s=>Y("create")),class:"flex-1 flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs rounded-md border border-border hover:bg-accent"},[u(d(ne),{class:"w-3.5 h-3.5"}),e[14]||(e[14]=q(" Create New ",-1))])]),D.value&&A.value==="git"?(l(),a("div",Ve,[C(t("input",{"onUpdate:modelValue":e[4]||(e[4]=s=>g.value=s),type:"text",placeholder:"https://github.com/user/skill-repo.git",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",onKeyup:ee(Z,["enter"])},null,544),[[M,g.value]]),t("div",De,[t("button",{onClick:Z,disabled:f.value||!g.value.trim(),class:"flex-1 px-2 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50"},r(f.value?"Installing...":"Install"),9,Te),t("button",{onClick:E,class:"px-2 py-1 text-xs rounded border border-border hover:bg-accent"}," Cancel ")])])):S("",!0),D.value&&A.value==="create"?(l(),a("div",Ue,[t("div",null,[C(t("input",{"onUpdate:modelValue":e[5]||(e[5]=s=>m.value=s),type:"text",placeholder:"Skill title",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),[[M,m.value]]),m.value.trim()?(l(),a("p",Ee," slug: "+r(X.value),1)):S("",!0)]),C(t("textarea",{"onUpdate:modelValue":e[6]||(e[6]=s=>y.value=s),rows:"8",placeholder:`# My Skill
14
+
15
+ Describe your skill in Markdown...`,class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs font-mono focus:outline-none focus:ring-1 focus:ring-ring resize-none"},null,512),[[M,y.value]]),t("div",Pe,[t("button",{onClick:ie,disabled:f.value||!m.value.trim()||!y.value.trim(),class:"flex-1 px-2 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50"},r(f.value?"Creating...":"Create"),9,je),t("button",{onClick:E,class:"px-2 py-1 text-xs rounded border border-border hover:bg-accent"}," Cancel ")])])):S("",!0)]),t("div",ze,[N.value?(l(),a("div",Ne,"Loading...")):V.value.length===0?(l(),a("div",Ae,[u(d(te),{class:"w-8 h-8 mx-auto mb-2 opacity-50"}),e[15]||(e[15]=t("p",{class:"text-xs"},"No skills installed.",-1))])):S("",!0),(l(!0),a(p,null,se(V.value,s=>{var F;return l(),a("div",{key:s.slug,onClick:R=>de(s),class:j(["flex items-center justify-between px-2 py-2 text-xs rounded cursor-pointer hover:bg-accent transition-colors group",{"bg-accent font-medium":((F=v.value)==null?void 0:F.slug)===s.slug}])},[t("div",Ge,[t("div",Be,r(s.name),1),t("div",Re,r(s.slug),1)]),t("button",{onClick:ae(R=>ue(s.slug),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 rounded hover:bg-destructive/10 text-destructive transition-opacity shrink-0",title:"Remove"},[u(d(Se),{class:"w-3.5 h-3.5"})],8,qe)],10,Ke)}),128))])],64)):(l(),a(p,{key:1},[t("div",Je,[C(t("select",{"onUpdate:modelValue":e[7]||(e[7]=s=>G.value=s),onChange:P,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"},[...e[16]||(e[16]=[t("option",{value:"awesome-copilot"},"awesome-copilot",-1),t("option",{value:"skillssh"},"skills.sh",-1)])],544),[[ge,G.value]]),t("div",Qe,[u(d(he),{class:"absolute left-2 top-1/2 -translate-y-1/2 w-3 h-3 text-muted-foreground"}),C(t("input",{"onUpdate:modelValue":e[8]||(e[8]=s=>T.value=s),type:"text",placeholder:"Search skills...",class:"w-full rounded-md border border-input bg-background pl-6 pr-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring",onKeyup:ee(P,["enter"])},null,544),[[M,T.value]])]),t("button",{onClick:P,disabled:L.value,class:"w-full px-2 py-1.5 text-xs rounded-md bg-secondary text-secondary-foreground hover:bg-secondary/80 disabled:opacity-50"},r(L.value?"Searching...":"Search"),9,Xe)]),t("div",Ye,[L.value?(l(),a("div",Ze,"Loading...")):U.value?(l(),a("div",He,r(U.value),1)):I.value.length===0?(l(),a("div",Oe,[u(d(Q),{class:"w-8 h-8 mx-auto mb-2 opacity-50"}),e[17]||(e[17]=t("p",{class:"text-xs"},"No skills found.",-1))])):S("",!0),(l(!0),a(p,null,se(I.value,s=>{var F;return l(),a("div",{key:s.slug,onClick:R=>pe(s),class:j(["flex items-start justify-between px-2 py-2 text-xs rounded cursor-pointer hover:bg-accent transition-colors gap-1",{"bg-accent":((F=c.value)==null?void 0:F.slug)===s.slug}])},[t("div",et,[t("div",tt,r(s.slug),1),t("div",{class:"text-muted-foreground line-clamp-2 mt-0.5",title:s.description},r(s.description),9,st)]),O(s.slug)?(l(),a("span",ot," Installed ")):(l(),a("button",{key:0,onClick:ae(R=>H(s),["stop"]),disabled:_.value===s.slug,class:"shrink-0 mt-0.5 px-1.5 py-0.5 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50",title:"Install"},r(_.value===s.slug?"...":"Install"),9,lt))],10,We)}),128))])],64))]),t("div",at,[k.value==="installed"?(l(),a(p,{key:0},[v.value?(l(),a(p,{key:1},[t("div",it,[t("div",null,[t("span",ut,r(v.value.name),1),t("span",dt,r(v.value.slug)+"/SKILL.md",1)]),t("div",ct,[b.value?(l(),a(p,{key:1},[t("button",{onClick:ve,class:"p-1.5 rounded hover:bg-accent text-green-500",title:"Save"},[u(d(we),{class:"w-4 h-4"})]),t("button",{onClick:e[9]||(e[9]=s=>b.value=!1),class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Cancel"},[u(d(Ce),{class:"w-4 h-4"})])],64)):(l(),a("button",{key:0,onClick:ce,class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Edit"},[u(d(_e),{class:"w-4 h-4"})]))])]),t("div",vt,[K.value?(l(),a("div",pt,"Loading...")):b.value?C((l(),a("textarea",{key:1,"onUpdate:modelValue":e[10]||(e[10]=s=>$.value=s),class:"w-full h-full min-h-[400px] font-mono text-sm bg-background border border-input rounded-md p-3 focus:outline-none focus:ring-1 focus:ring-ring resize-none"},null,512)),[[M,$.value]]):(l(),le(oe,{key:2,content:x.value},null,8,["content"]))])],64)):(l(),a("div",nt,[t("div",rt,[u(d(te),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[18]||(e[18]=t("p",null,"Select a skill to view",-1))])]))],64)):(l(),a(p,{key:1},[c.value?(l(),a(p,{key:1},[t("div",xt,[t("div",gt,[t("span",yt,r(c.value.slug),1),t("span",bt,r(c.value.source),1)]),O(c.value.slug)?(l(),a("span",ht," Installed ")):(l(),a("button",{key:0,onClick:e[11]||(e[11]=s=>H(c.value)),disabled:_.value===c.value.slug,class:"ml-2 shrink-0 px-3 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50"},r(_.value===c.value.slug?"Installing...":"Install"),9,kt))]),t("div",_t,[B.value?(l(),a("div",wt,"Loading preview...")):(l(),le(oe,{key:1,content:h.value},null,8,["content"]))])],64)):(l(),a("div",ft,[t("div",mt,[u(d(Q),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[19]||(e[19]=t("p",null,"Select a skill to preview",-1))])]))],64))]),i.value?(l(),a("p",Ct,r(i.value),1)):S("",!0)]))}});export{Dt as default};