heyio 0.40.0 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/api/logout.test.js +129 -0
  2. package/dist/api/server.js +118 -2
  3. package/dist/api/wiki.test.js +283 -0
  4. package/dist/copilot/skills.js +72 -0
  5. package/dist/copilot/skills.test.js +55 -0
  6. package/dist/store/db.js +28 -0
  7. package/dist/store/squads.js +33 -1
  8. package/dist/store/squads.test.js +52 -0
  9. package/package.json +1 -1
  10. package/web-dist/assets/{AgentActivityView-D-xGvKsm.js → AgentActivityView-CedxxE6K.js} +1 -1
  11. package/web-dist/assets/{ChatView-DV4zdwDI.js → ChatView-DMkYQo_V.js} +1 -1
  12. package/web-dist/assets/FeedView-BH4q-31V.js +1 -0
  13. package/web-dist/assets/InboxView-BVwVP4EW.js +1 -0
  14. package/web-dist/assets/{LoginView-DNcKxnq-.js → LoginView-DRPDhnwu.js} +1 -1
  15. package/web-dist/assets/{McpView-CbiIag57.js → McpView-D8yWz-lq.js} +1 -1
  16. package/web-dist/assets/{SchedulesView-uxtLtxEL.js → SchedulesView-BzzyncGF.js} +1 -1
  17. package/web-dist/assets/{SettingsTabs.vue_vue_type_script_setup_true_lang-BE0YBCo4.js → SettingsTabs.vue_vue_type_script_setup_true_lang-oW3ySu7Y.js} +1 -1
  18. package/web-dist/assets/SkillsView-oxpYuhx7.js +1 -0
  19. package/web-dist/assets/SquadsView-CaKUIKlq.js +1 -0
  20. package/web-dist/assets/StatusIndicator.vue_vue_type_script_setup_true_lang-8U15Qp_Q.js +1 -0
  21. package/web-dist/assets/WikiView-C5jXUlfW.js +1 -0
  22. package/web-dist/assets/index-BrWzNw-N.css +10 -0
  23. package/web-dist/assets/{index-D1C7prBJ.js → index-f67odrrt.js} +32 -32
  24. package/web-dist/index.html +2 -2
  25. package/web-dist/assets/FeedView-BBbnBU_A.js +0 -1
  26. package/web-dist/assets/InboxView-C_6LL8bG.js +0 -1
  27. package/web-dist/assets/SkillsView-CobJkgd1.js +0 -1
  28. package/web-dist/assets/SquadsView-DpI4RInq.js +0 -1
  29. package/web-dist/assets/StatusIndicator.vue_vue_type_script_setup_true_lang-BwmRY2qH.js +0 -1
  30. package/web-dist/assets/WikiView-DeY1mFGq.js +0 -1
  31. package/web-dist/assets/index-DMGoXFX1.css +0 -10
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Tests for src/copilot/skills.ts — skill installation, listing, and management.
3
+ */
4
+ import { describe, it } from "node:test";
5
+ import assert from "node:assert/strict";
6
+ import { parseSkillUrl, removeSkill, updateSkill, deleteSkill, } from "./skills.js";
7
+ // ── Tests ─────────────────────────────────────────────────────────────────────
8
+ describe("parseSkillUrl", () => {
9
+ it("parses GitHub blob URLs for SKILL.md", () => {
10
+ const url = "https://github.com/owner/repo/blob/main/SKILL.md";
11
+ const result = parseSkillUrl(url);
12
+ assert.equal(result.type, "file");
13
+ assert.ok("rawUrl" in result);
14
+ assert.ok(result.rawUrl.includes("raw.githubusercontent.com"));
15
+ });
16
+ it("parses GitHub raw content URLs", () => {
17
+ const url = "https://raw.githubusercontent.com/owner/repo/main/SKILL.md";
18
+ const result = parseSkillUrl(url);
19
+ assert.equal(result.type, "file");
20
+ assert.ok("rawUrl" in result);
21
+ });
22
+ it("parses GitHub repo URLs as repo type", () => {
23
+ const url = "https://github.com/owner/repo";
24
+ const result = parseSkillUrl(url);
25
+ assert.equal(result.type, "repo");
26
+ assert.equal(result.url, url);
27
+ });
28
+ it("rejects non-https SKILL.md URLs", () => {
29
+ const url = "http://example.com/SKILL.md";
30
+ assert.throws(() => parseSkillUrl(url));
31
+ });
32
+ it("derives slug from repo name with path prefix", () => {
33
+ const url = "https://github.com/owner/repo/blob/main/skills/ai-chat/SKILL.md";
34
+ const result = parseSkillUrl(url);
35
+ assert.equal(result.type, "file");
36
+ assert.ok(result.slug.includes("repo"));
37
+ });
38
+ });
39
+ describe("skill store functions", () => {
40
+ it("exports updateSkill function", () => {
41
+ assert.ok(typeof updateSkill === "function");
42
+ });
43
+ it("exports deleteSkill function", () => {
44
+ assert.ok(typeof deleteSkill === "function");
45
+ });
46
+ it("exports removeSkill function", () => {
47
+ assert.ok(typeof removeSkill === "function");
48
+ });
49
+ it("deleteSkill is callable (alias)", () => {
50
+ // Just verify these are functions and importable
51
+ assert.ok(deleteSkill !== undefined);
52
+ assert.ok(removeSkill !== undefined);
53
+ });
54
+ });
55
+ //# sourceMappingURL=skills.test.js.map
package/dist/store/db.js CHANGED
@@ -172,6 +172,7 @@ GROUP BY agent_slug`,
172
172
  )`,
173
173
  `CREATE INDEX IF NOT EXISTS idx_unified_feed_type ON unified_feed(type, created_at)`,
174
174
  `CREATE INDEX IF NOT EXISTS idx_unified_feed_unread ON unified_feed(read_at, created_at)`,
175
+ `ALTER TABLE squads ADD COLUMN color TEXT`,
175
176
  `CREATE TABLE IF NOT EXISTS squad_instances (
176
177
  id TEXT PRIMARY KEY,
177
178
  master_squad_slug TEXT NOT NULL,
@@ -213,6 +214,7 @@ GROUP BY agent_slug`,
213
214
  `DROP TABLE unified_feed_old`,
214
215
  `CREATE INDEX IF NOT EXISTS idx_unified_feed_type ON unified_feed(type, created_at)`,
215
216
  `CREATE INDEX IF NOT EXISTS idx_unified_feed_unread ON unified_feed(read_at, created_at)`,
217
+ `ALTER TABLE squads ADD COLUMN color TEXT`,
216
218
  ];
217
219
  for (const migration of migrations) {
218
220
  try {
@@ -242,6 +244,32 @@ GROUP BY agent_slug`,
242
244
  catch {
243
245
  // Migration failed (e.g. old tables don't exist yet on a fresh install) — safe to ignore
244
246
  }
247
+ // One-time migration: assign colors to existing squads that have none
248
+ try {
249
+ const colorMigrated = db.prepare("SELECT value FROM io_state WHERE key = 'squad_colors_migrated'").get();
250
+ if (!colorMigrated) {
251
+ const palette = [
252
+ "#ff6b35", "#ffd000", "#5fff87", "#c4a7ff", "#00d9ff",
253
+ "#ff9800", "#9c27b0", "#2196f3", "#e91e63", "#00bcd4",
254
+ "#8bc34a", "#ff5722",
255
+ ];
256
+ const uncolored = db.prepare("SELECT slug FROM squads WHERE color IS NULL ORDER BY id ASC").all();
257
+ const usedColors = new Set(db.prepare("SELECT color FROM squads WHERE color IS NOT NULL").all().map(r => r.color));
258
+ const update = db.prepare("UPDATE squads SET color = ? WHERE slug = ?");
259
+ let idx = 0;
260
+ for (const { slug } of uncolored) {
261
+ const available = palette.filter(c => !usedColors.has(c));
262
+ const color = available.length > 0 ? available[0] : palette[idx % palette.length];
263
+ update.run(color, slug);
264
+ usedColors.add(color);
265
+ idx++;
266
+ }
267
+ db.prepare("INSERT OR REPLACE INTO io_state (key, value) VALUES ('squad_colors_migrated', '1')").run();
268
+ }
269
+ }
270
+ catch {
271
+ // Safe to ignore on fresh install
272
+ }
245
273
  return db;
246
274
  }
247
275
  export function closeDb() {
@@ -1,11 +1,43 @@
1
1
  import { getDb } from "./db.js";
2
2
  import { nextCharacter, randomUniverse, getOrCreateUniverse } from "../copilot/universes.js";
3
+ // ---------------------------------------------------------------------------
4
+ // Squad color palette — universe-inspired distinct colors
5
+ // ---------------------------------------------------------------------------
6
+ export const SQUAD_COLOR_PALETTE = [
7
+ "#ff6b35", // A-Team orange
8
+ "#ffd000", // Thundercats gold
9
+ "#5fff87", // GI Joe green
10
+ "#c4a7ff", // Ghostbusters purple
11
+ "#00d9ff", // Transformers cyan
12
+ "#ff9800", // extra amber
13
+ "#9c27b0", // extra violet
14
+ "#2196f3", // extra blue
15
+ "#e91e63", // extra pink
16
+ "#00bcd4", // extra teal
17
+ "#8bc34a", // extra lime
18
+ "#ff5722", // extra deep-orange
19
+ ];
20
+ /**
21
+ * Pick a color for a new squad. Prefers an unused palette color; when all
22
+ * are taken, cycles through the palette by position (modular assignment).
23
+ * This guarantees we never throw and always return a valid hex color.
24
+ */
25
+ export function pickSquadColor(existingColors) {
26
+ const used = new Set(existingColors.filter(Boolean));
27
+ const unused = SQUAD_COLOR_PALETTE.filter((c) => !used.has(c));
28
+ if (unused.length > 0)
29
+ return unused[0];
30
+ // All palette colors taken — cycle by squad count
31
+ return SQUAD_COLOR_PALETTE[used.size % SQUAD_COLOR_PALETTE.length];
32
+ }
3
33
  export function createSquad(slug, name, projectPath, universeId) {
4
34
  const db = getDb();
5
35
  const universe = universeId
6
36
  ? getOrCreateUniverse(universeId).id
7
37
  : randomUniverse().id;
8
- db.prepare("INSERT INTO squads (slug, name, project_path, universe) VALUES (?, ?, ?, ?)").run(slug, name, projectPath, universe);
38
+ const existingSquads = listSquads();
39
+ const color = pickSquadColor(existingSquads.map((s) => s.color));
40
+ db.prepare("INSERT INTO squads (slug, name, project_path, universe, color) VALUES (?, ?, ?, ?, ?)").run(slug, name, projectPath, universe, color);
9
41
  return getSquad(slug);
10
42
  }
11
43
  export function getSquad(slug) {
@@ -350,4 +350,56 @@ describe("setSquadQA", () => {
350
350
  assert.equal(getSquadAgent("test-squad", agent.character_name)?.is_qa, 0);
351
351
  });
352
352
  });
353
+ // ── pickSquadColor / squad color assignment ───────────────────────────────────
354
+ import { pickSquadColor, SQUAD_COLOR_PALETTE } from "./squads.js";
355
+ describe("pickSquadColor", () => {
356
+ it("returns a palette color for empty squad list", () => {
357
+ const color = pickSquadColor([]);
358
+ assert.ok(SQUAD_COLOR_PALETTE.includes(color));
359
+ });
360
+ it("returns an unused color when some are taken", () => {
361
+ const taken = [SQUAD_COLOR_PALETTE[0], SQUAD_COLOR_PALETTE[1]];
362
+ const color = pickSquadColor(taken);
363
+ assert.ok(!taken.includes(color));
364
+ assert.ok(SQUAD_COLOR_PALETTE.includes(color));
365
+ });
366
+ it("cycles through palette when all colors are taken", () => {
367
+ const allTaken = [...SQUAD_COLOR_PALETTE];
368
+ const color = pickSquadColor(allTaken);
369
+ // Should fall back to cycling — result is still a valid palette color
370
+ assert.ok(SQUAD_COLOR_PALETTE.includes(color));
371
+ });
372
+ it("ignores null values in existing colors", () => {
373
+ const withNulls = [null, null, SQUAD_COLOR_PALETTE[0]];
374
+ const color = pickSquadColor(withNulls);
375
+ assert.notEqual(color, SQUAD_COLOR_PALETTE[0]);
376
+ });
377
+ });
378
+ describe("createSquad — color assignment", () => {
379
+ it("assigns a non-null color on creation", () => {
380
+ const squad = createSquad("color-squad-1", "Color Squad 1", "/tmp/test");
381
+ assert.ok(squad.color !== null && squad.color !== undefined);
382
+ });
383
+ it("assigns colors from the palette", () => {
384
+ const squad = createSquad("color-squad-2", "Color Squad 2", "/tmp/test");
385
+ assert.ok(SQUAD_COLOR_PALETTE.includes(squad.color));
386
+ });
387
+ it("assigns distinct colors to two squads", () => {
388
+ const a = createSquad("color-squad-3", "Squad A", "/tmp/test");
389
+ const b = createSquad("color-squad-4", "Squad B", "/tmp/test");
390
+ assert.notEqual(a.color, b.color);
391
+ });
392
+ it("all squads up to palette size get distinct colors", () => {
393
+ const slugs = [];
394
+ for (let i = 0; i < SQUAD_COLOR_PALETTE.length; i++) {
395
+ const slug = `palette-squad-${i}`;
396
+ slugs.push(slug);
397
+ createSquad(slug, `Squad ${i}`, "/test");
398
+ }
399
+ const squads = slugs.map(s => getSquad(s));
400
+ const colors = squads.map(s => s.color);
401
+ const uniqueColors = new Set(colors);
402
+ assert.equal(uniqueColors.size, SQUAD_COLOR_PALETTE.length);
403
+ });
404
+ });
353
405
  //# sourceMappingURL=squads.test.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heyio",
3
- "version": "0.40.0",
3
+ "version": "0.42.0",
4
4
  "description": "IO — a personal AI assistant built on the GitHub Copilot SDK",
5
5
  "bin": {
6
6
  "io": "dist/index.js"
@@ -1 +1 @@
1
- import{d as S,o as T,L as N,c as n,a as e,w as R,v as U,F as g,m as _,t as i,g as h,r as l,q as j,G as m,M as A,j as d,s as L,n as V,b as w,H as F,J as B}from"./index-D1C7prBJ.js";import{_ as D}from"./StatusIndicator.vue_vue_type_script_setup_true_lang-BwmRY2qH.js";const E={class:"grid h-full min-h-0 gap-5 p-5 xl:grid-cols-[340px_minmax(0,1fr)]"},J={class:"flex min-h-0 flex-col overflow-hidden rounded-lg border border-border bg-card"},M={class:"border-b border-border px-4 py-4"},O={class:"min-h-0 flex-1 overflow-y-auto p-3"},P=["onClick"],z={class:"flex items-start justify-between gap-3"},I={class:"min-w-0 flex-1"},q={class:"truncate text-sm font-medium"},G={class:"mt-1 font-mono text-[10px] uppercase tracking-[0.18em] text-muted-foreground/55"},H={class:"flex items-center gap-2"},W={class:"font-mono text-[10px] uppercase text-muted-foreground/70"},K={class:"mt-2 font-mono text-[10px] text-muted-foreground/45"},Q={class:"grid min-h-0 gap-5 lg:grid-rows-[auto_minmax(180px,0.7fr)_minmax(0,1fr)]"},X={class:"rounded-lg border border-border bg-card p-5"},Y={class:"flex flex-wrap items-start justify-between gap-3"},Z={class:"mt-2 text-lg font-semibold"},ee=["disabled"],te={class:"mt-4 overflow-x-auto rounded-lg border border-white/[0.06] bg-black/30 p-4 font-mono text-xs leading-6 text-foreground/75"},oe={class:"min-h-0 overflow-hidden rounded-lg border border-border bg-card"},se={class:"h-full overflow-y-auto p-4"},re={class:"whitespace-pre-wrap break-words"},ae={key:0,class:"rounded-lg border border-dashed border-border px-4 py-10 text-center font-mono text-xs uppercase tracking-[0.22em] text-muted-foreground/45"},ne={class:"min-h-0 overflow-hidden rounded-lg border border-primary/20 bg-card"},de={class:"h-full overflow-y-auto px-4 py-4 font-mono text-xs leading-6 text-foreground/75"},ie={key:0,class:"py-8 text-center uppercase tracking-[0.22em] text-muted-foreground/45"},le={key:1,class:"py-8 text-center uppercase tracking-[0.22em] text-muted-foreground/45"},me=S({__name:"AgentActivityView",setup(ce){const c=l([]),a=l(""),v=l(null),f=l([]),u=l([]),x=l("");let s=null;const k=j(()=>{const r=x.value.trim().toLowerCase();return r?c.value.filter(t=>`${t.task_id} ${t.agent_slug} ${t.description} ${t.status}`.toLowerCase().includes(r)):c.value});async function y(){const r=await m("/api/tasks");r.ok&&(c.value=(await r.json()).tasks,!a.value&&c.value[0]&&await b(c.value[0].task_id))}async function C(r){s==null||s.close(),u.value=[];const t=await A(`/api/tasks/${encodeURIComponent(r)}/events`);s=new EventSource(t),s.onmessage=o=>{u.value=[...u.value.slice(-120),o.data]},s.onerror=()=>{s==null||s.close(),s=null}}async function b(r){a.value=r;const[t,o]=await Promise.all([m(`/api/tasks/${encodeURIComponent(r)}`),m(`/api/tasks/${encodeURIComponent(r)}/activity`)]);v.value=t.ok?await t.json():null,f.value=o.ok?(await o.json()).activity??[]:[],await C(r)}async function $(){a.value&&(await m(`/api/tasks/${encodeURIComponent(a.value)}/cancel`,{method:"POST"}),await Promise.all([b(a.value),y()]))}return T(y),N(()=>{s==null||s.close()}),(r,t)=>(d(),n("div",E,[e("section",J,[e("div",M,[t[1]||(t[1]=e("div",{class:"mb-3 font-mono text-[10px] uppercase tracking-[0.28em] text-primary"},"Task Activity",-1)),R(e("input",{"onUpdate:modelValue":t[0]||(t[0]=o=>x.value=o),class:"w-full rounded border border-border bg-sidebar px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/35",placeholder:"Filter by task, agent, or status"},null,512),[[U,x.value]])]),e("div",O,[(d(!0),n(g,null,_(k.value,o=>(d(),n("button",{key:o.task_id,class:L(["mb-2 w-full rounded-lg border px-4 py-3 text-left transition-colors",a.value===o.task_id?"border-primary/40 bg-primary/10":"border-border bg-sidebar/40 hover:bg-white/[0.03]"]),onClick:p=>b(o.task_id)},[e("div",z,[e("div",I,[e("div",q,i(o.description),1),e("div",G,i(o.agent_slug)+" · "+i(o.task_id),1)]),e("div",H,[V(D,{status:w(F)(o.status)},null,8,["status"]),e("span",W,i(o.status),1)])]),e("div",K,i(w(B)(o.started_at)),1)],10,P))),128))])]),e("section",Q,[e("div",X,[e("div",Y,[e("div",null,[t[2]||(t[2]=e("div",{class:"font-mono text-[10px] uppercase tracking-[0.28em] text-accent-foreground"},"Task Detail",-1)),e("div",Z,i(a.value||"Select a task"),1)]),e("button",{class:"rounded border border-destructive/40 px-3 py-1.5 font-mono text-xs text-destructive transition-colors hover:bg-destructive/10",disabled:!a.value,onClick:$},"cancel task",8,ee)]),e("pre",te,i(v.value?JSON.stringify(v.value,null,2):"No task selected."),1)]),e("div",oe,[t[3]||(t[3]=e("div",{class:"border-b border-border px-4 py-3 font-mono text-[10px] uppercase tracking-[0.28em] text-muted-foreground/60"},"Activity log",-1)),e("div",se,[(d(!0),n(g,null,_(f.value,(o,p)=>(d(),n("article",{key:p,class:"mb-3 rounded-lg border border-white/[0.06] bg-sidebar/60 px-4 py-3 font-mono text-xs text-foreground/75"},[e("pre",re,i(JSON.stringify(o,null,2)),1)]))),128)),a.value&&!f.value.length?(d(),n("div",ae,"No activity reported")):h("",!0)])]),e("div",ne,[t[4]||(t[4]=e("div",{class:"border-b border-border px-4 py-3 font-mono text-[10px] uppercase tracking-[0.28em] text-primary"},"Live event preview",-1)),e("div",de,[(d(!0),n(g,null,_(u.value,(o,p)=>(d(),n("div",{key:p,class:"border-b border-border/40 py-2"},i(o),1))),128)),a.value&&!u.value.length?(d(),n("div",ie,"Waiting for live events")):h("",!0),a.value?h("",!0):(d(),n("div",le,"Select a task to attach the stream"))])])])]))}});export{me as default};
1
+ import{d as S,o as T,K as N,c as n,a as e,w as R,v as U,F as g,m as _,t as i,g as h,r as l,q as j,E as m,L as A,j as d,s as L,n as V,b as w,G as E,I as F}from"./index-f67odrrt.js";import{_ as B}from"./StatusIndicator.vue_vue_type_script_setup_true_lang-8U15Qp_Q.js";const D={class:"grid h-full min-h-0 gap-5 p-5 xl:grid-cols-[340px_minmax(0,1fr)]"},I={class:"flex min-h-0 flex-col overflow-hidden rounded-lg border border-border bg-card"},O={class:"border-b border-border px-4 py-4"},P={class:"min-h-0 flex-1 overflow-y-auto p-3"},z=["onClick"],J={class:"flex items-start justify-between gap-3"},M={class:"min-w-0 flex-1"},q={class:"truncate text-sm font-medium"},G={class:"mt-1 font-mono text-[10px] uppercase tracking-[0.18em] text-muted-foreground/55"},K={class:"flex items-center gap-2"},W={class:"font-mono text-[10px] uppercase text-muted-foreground/70"},H={class:"mt-2 font-mono text-[10px] text-muted-foreground/45"},Q={class:"grid min-h-0 gap-5 lg:grid-rows-[auto_minmax(180px,0.7fr)_minmax(0,1fr)]"},X={class:"rounded-lg border border-border bg-card p-5"},Y={class:"flex flex-wrap items-start justify-between gap-3"},Z={class:"mt-2 text-lg font-semibold"},ee=["disabled"],te={class:"mt-4 overflow-x-auto rounded-lg border border-white/[0.06] bg-black/30 p-4 font-mono text-xs leading-6 text-foreground/75"},oe={class:"min-h-0 overflow-hidden rounded-lg border border-border bg-card"},se={class:"h-full overflow-y-auto p-4"},re={class:"whitespace-pre-wrap break-words"},ae={key:0,class:"rounded-lg border border-dashed border-border px-4 py-10 text-center font-mono text-xs uppercase tracking-[0.22em] text-muted-foreground/45"},ne={class:"min-h-0 overflow-hidden rounded-lg border border-primary/20 bg-card"},de={class:"h-full overflow-y-auto px-4 py-4 font-mono text-xs leading-6 text-foreground/75"},ie={key:0,class:"py-8 text-center uppercase tracking-[0.22em] text-muted-foreground/45"},le={key:1,class:"py-8 text-center uppercase tracking-[0.22em] text-muted-foreground/45"},me=S({__name:"AgentActivityView",setup(ce){const c=l([]),a=l(""),v=l(null),f=l([]),u=l([]),x=l("");let s=null;const k=j(()=>{const r=x.value.trim().toLowerCase();return r?c.value.filter(t=>`${t.task_id} ${t.agent_slug} ${t.description} ${t.status}`.toLowerCase().includes(r)):c.value});async function y(){const r=await m("/api/tasks");r.ok&&(c.value=(await r.json()).tasks,!a.value&&c.value[0]&&await b(c.value[0].task_id))}async function C(r){s==null||s.close(),u.value=[];const t=await A(`/api/tasks/${encodeURIComponent(r)}/events`);s=new EventSource(t),s.onmessage=o=>{u.value=[...u.value.slice(-120),o.data]},s.onerror=()=>{s==null||s.close(),s=null}}async function b(r){a.value=r;const[t,o]=await Promise.all([m(`/api/tasks/${encodeURIComponent(r)}`),m(`/api/tasks/${encodeURIComponent(r)}/activity`)]);v.value=t.ok?await t.json():null,f.value=o.ok?(await o.json()).activity??[]:[],await C(r)}async function $(){a.value&&(await m(`/api/tasks/${encodeURIComponent(a.value)}/cancel`,{method:"POST"}),await Promise.all([b(a.value),y()]))}return T(y),N(()=>{s==null||s.close()}),(r,t)=>(d(),n("div",D,[e("section",I,[e("div",O,[t[1]||(t[1]=e("div",{class:"mb-3 font-mono text-[10px] uppercase tracking-[0.28em] text-primary"},"Task Activity",-1)),R(e("input",{"onUpdate:modelValue":t[0]||(t[0]=o=>x.value=o),class:"w-full rounded border border-border bg-sidebar px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/35",placeholder:"Filter by task, agent, or status"},null,512),[[U,x.value]])]),e("div",P,[(d(!0),n(g,null,_(k.value,o=>(d(),n("button",{key:o.task_id,class:L(["mb-2 w-full rounded-lg border px-4 py-3 text-left transition-colors",a.value===o.task_id?"border-primary/40 bg-primary/10":"border-border bg-sidebar/40 hover:bg-white/[0.03]"]),onClick:p=>b(o.task_id)},[e("div",J,[e("div",M,[e("div",q,i(o.description),1),e("div",G,i(o.agent_slug)+" · "+i(o.task_id),1)]),e("div",K,[V(B,{status:w(E)(o.status)},null,8,["status"]),e("span",W,i(o.status),1)])]),e("div",H,i(w(F)(o.started_at)),1)],10,z))),128))])]),e("section",Q,[e("div",X,[e("div",Y,[e("div",null,[t[2]||(t[2]=e("div",{class:"font-mono text-[10px] uppercase tracking-[0.28em] text-accent-foreground"},"Task Detail",-1)),e("div",Z,i(a.value||"Select a task"),1)]),e("button",{class:"rounded border border-destructive/40 px-3 py-1.5 font-mono text-xs text-destructive transition-colors hover:bg-destructive/10",disabled:!a.value,onClick:$},"cancel task",8,ee)]),e("pre",te,i(v.value?JSON.stringify(v.value,null,2):"No task selected."),1)]),e("div",oe,[t[3]||(t[3]=e("div",{class:"border-b border-border px-4 py-3 font-mono text-[10px] uppercase tracking-[0.28em] text-muted-foreground/60"},"Activity log",-1)),e("div",se,[(d(!0),n(g,null,_(f.value,(o,p)=>(d(),n("article",{key:p,class:"mb-3 rounded-lg border border-white/[0.06] bg-sidebar/60 px-4 py-3 font-mono text-xs text-foreground/75"},[e("pre",re,i(JSON.stringify(o,null,2)),1)]))),128)),a.value&&!f.value.length?(d(),n("div",ae,"No activity reported")):h("",!0)])]),e("div",ne,[t[4]||(t[4]=e("div",{class:"border-b border-border px-4 py-3 font-mono text-[10px] uppercase tracking-[0.28em] text-primary"},"Live event preview",-1)),e("div",de,[(d(!0),n(g,null,_(u.value,(o,p)=>(d(),n("div",{key:p,class:"border-b border-border/40 py-2"},i(o),1))),128)),a.value&&!u.value.length?(d(),n("div",ie,"Waiting for live events")):h("",!0),a.value?h("",!0):(d(),n("div",le,"Select a task to attach the stream"))])])])]))}});export{me as default};
@@ -1,4 +1,4 @@
1
- import{d as S,k as M,l as O,c as s,a as e,b as i,F as x,m as f,g as b,f as y,w as T,v as I,e as L,n as N,p as $,r as v,q as h,j as n,t as c,s as u,x as j,_ as V,y as g}from"./index-D1C7prBJ.js";const B={class:"h-full overflow-y-auto p-3 md:p-5"},D={class:"mx-auto flex h-full max-w-[980px] flex-col overflow-hidden rounded-lg border border-border bg-card"},z={class:"flex shrink-0 items-center justify-between border-b border-border px-5 py-4"},E={class:"flex items-center gap-2"},H=["disabled"],K={key:0,class:"mb-6 rounded-lg border border-primary/20 bg-primary/5 p-6"},P={class:"mt-4 flex flex-wrap gap-2"},q=["onClick"],F={class:"space-y-3"},R={key:0,class:"whitespace-pre-wrap text-sm leading-relaxed"},W=["innerHTML"],A={key:2,class:"mt-2 font-mono text-[10px] uppercase tracking-[0.22em] text-primary/70"},U=["onKeydown"],G={class:"mt-3 flex items-center justify-between gap-3"},J={type:"submit",class:"flex items-center gap-1 rounded bg-primary/15 px-3 py-1.5 font-mono text-xs text-primary transition-colors hover:bg-primary/25"},Z=S({__name:"ChatView",setup(Q){const a=M(),d=v(""),l=v(null),w=["Summarize current squad health","List unread feed items that need action","What schedules should I watch today?","Show recent MCP changes"],p=h(()=>a.messages.length?a.messages:[{id:"welcome",role:"assistant",text:"IO online. What do you need?",createdAt:new Date().toISOString(),streaming:!1}]),_=h(()=>p.value.map(o=>`${o.id}:${o.text.length}:${o.streaming}`).join("|"));function k(){l.value&&(l.value.scrollTop=l.value.scrollHeight)}async function m(){const o=d.value.trim();o&&(d.value="",await a.sendMessage(o))}async function C(o){d.value=o,await g()}return O(_,async()=>{await g(),k()}),(o,r)=>(n(),s("div",B,[e("section",D,[e("div",z,[r[3]||(r[3]=e("div",null,[e("div",{class:"font-mono text-[10px] uppercase tracking-[0.3em] text-primary"},"Command Console"),e("div",{class:"mt-2 text-sm text-foreground/80"},"Direct operator channel into the orchestrator stream.")],-1)),e("div",E,[e("button",{class:"rounded border border-border px-3 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:border-primary/40 hover:text-primary",onClick:r[0]||(r[0]=t=>i(a).clearMessages())},"clear"),e("button",{class:"rounded border border-destructive/40 px-3 py-1.5 font-mono text-xs text-destructive transition-colors hover:bg-destructive/10",disabled:!i(a).isLoading,onClick:r[1]||(r[1]=t=>i(a).abortRun())},"abort",8,H)])]),e("div",{ref_key:"scrollPanel",ref:l,class:"flex-1 overflow-y-auto px-5 py-5"},[i(a).messages.length?b("",!0):(n(),s("div",K,[r[4]||(r[4]=e("pre",{class:"font-mono text-xs leading-5 text-primary"},`╔════════════════════════════════════╗
1
+ import{d as S,k as M,l as O,c as s,a as e,b as i,F as x,m as f,g as b,f as y,w as T,v as I,e as L,n as N,p as $,r as v,q as h,j as n,t as c,s as u,x as j,_ as V,y as g}from"./index-f67odrrt.js";const B={class:"h-full overflow-y-auto p-3 md:p-5"},D={class:"mx-auto flex h-full max-w-[980px] flex-col overflow-hidden rounded-lg border border-border bg-card"},z={class:"flex shrink-0 items-center justify-between border-b border-border px-5 py-4"},E={class:"flex items-center gap-2"},H=["disabled"],K={key:0,class:"mb-6 rounded-lg border border-primary/20 bg-primary/5 p-6"},P={class:"mt-4 flex flex-wrap gap-2"},q=["onClick"],F={class:"space-y-3"},R={key:0,class:"whitespace-pre-wrap text-sm leading-relaxed"},W=["innerHTML"],A={key:2,class:"mt-2 font-mono text-[10px] uppercase tracking-[0.22em] text-primary/70"},U=["onKeydown"],G={class:"mt-3 flex items-center justify-between gap-3"},J={type:"submit",class:"flex items-center gap-1 rounded bg-primary/15 px-3 py-1.5 font-mono text-xs text-primary transition-colors hover:bg-primary/25"},Z=S({__name:"ChatView",setup(Q){const a=M(),d=v(""),l=v(null),w=["Summarize current squad health","List unread feed items that need action","What schedules should I watch today?","Show recent MCP changes"],p=h(()=>a.messages.length?a.messages:[{id:"welcome",role:"assistant",text:"IO online. What do you need?",createdAt:new Date().toISOString(),streaming:!1}]),_=h(()=>p.value.map(o=>`${o.id}:${o.text.length}:${o.streaming}`).join("|"));function k(){l.value&&(l.value.scrollTop=l.value.scrollHeight)}async function m(){const o=d.value.trim();o&&(d.value="",await a.sendMessage(o))}async function C(o){d.value=o,await g()}return O(_,async()=>{await g(),k()}),(o,r)=>(n(),s("div",B,[e("section",D,[e("div",z,[r[3]||(r[3]=e("div",null,[e("div",{class:"font-mono text-[10px] uppercase tracking-[0.3em] text-primary"},"Command Console"),e("div",{class:"mt-2 text-sm text-foreground/80"},"Direct operator channel into the orchestrator stream.")],-1)),e("div",E,[e("button",{class:"rounded border border-border px-3 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:border-primary/40 hover:text-primary",onClick:r[0]||(r[0]=t=>i(a).clearMessages())},"clear"),e("button",{class:"rounded border border-destructive/40 px-3 py-1.5 font-mono text-xs text-destructive transition-colors hover:bg-destructive/10",disabled:!i(a).isLoading,onClick:r[1]||(r[1]=t=>i(a).abortRun())},"abort",8,H)])]),e("div",{ref_key:"scrollPanel",ref:l,class:"flex-1 overflow-y-auto px-5 py-5"},[i(a).messages.length?b("",!0):(n(),s("div",K,[r[4]||(r[4]=e("pre",{class:"font-mono text-xs leading-5 text-primary"},`╔════════════════════════════════════╗
2
2
  ║ IO // MISSION CONTROL CONSOLE ║
3
3
  ║ route prompts, inspect streams ║
4
4
  ╚════════════════════════════════════╝`,-1)),e("div",P,[(n(),s(x,null,f(w,t=>e("button",{key:t,class:"rounded-full border border-border bg-sidebar px-3 py-1.5 font-mono text-xs text-foreground/75 transition-colors hover:border-primary/40 hover:text-primary",onClick:X=>C(t)},c(t),9,q)),64))])])),e("div",F,[(n(!0),s(x,null,f(p.value,t=>(n(),s("article",{key:t.id,class:u(["flex",t.role==="user"?"justify-end":"justify-start"])},[e("div",{class:u(["max-w-[82%] rounded-lg border px-4 py-3",t.role==="user"?"rounded-br-sm border-primary/20 bg-primary/15 font-mono text-primary":"rounded-bl-sm border-white/[0.06] bg-white/[0.04] text-foreground/75"])},[e("div",{class:u(["mb-2 font-mono text-[10px] uppercase tracking-[0.2em]",t.role==="user"?"text-primary":"text-muted-foreground/60"])},c(t.role),3),t.role==="user"?(n(),s("div",R,c(t.text),1)):(n(),s("div",{key:1,class:"wiki-content text-sm",innerHTML:i(j)(t.text||(t.streaming?"…":""))},null,8,W)),t.streaming?(n(),s("div",A,"streaming…")):b("",!0)],2)],2))),128))])],512),e("form",{class:"shrink-0 border-t border-border px-5 py-4",onSubmit:y(m,["prevent"])},[T(e("textarea",{"onUpdate:modelValue":r[2]||(r[2]=t=>d.value=t),rows:"4",class:"w-full rounded-lg border border-border bg-sidebar px-4 py-3 text-sm text-foreground placeholder:text-muted-foreground/40",placeholder:"Type a prompt for IO. Ctrl+Enter sends.",onKeydown:L(y(m,["ctrl","prevent"]),["enter"])},null,40,U),[[I,d.value]]),e("div",G,[r[6]||(r[6]=e("div",{class:"font-mono text-[11px] text-muted-foreground/55"},"Ctrl+. opens the floating command bar.",-1)),e("button",J,[N(V,{name:"zap",class:"h-3 w-3"}),r[5]||(r[5]=$(" dispatch ",-1))])])],32)])]))}});export{Z as default};
@@ -0,0 +1 @@
1
+ import{d as w,o as C,c as s,a as t,F as b,m as g,r as c,q as S,E as p,j as a,z as j,b as x,B as F,t as i,s as h,I as T,g as y,n as M,A as z,x as B,T as E,U as I}from"./index-f67odrrt.js";const L={class:"h-full overflow-y-auto p-5"},N={class:"mx-auto max-w-4xl"},O={key:0,class:"rounded-lg border border-border bg-card px-5 py-10 font-mono text-xs uppercase tracking-[0.22em] text-muted-foreground/50"},V={key:1,class:"rounded-lg border border-dashed border-border bg-card/30 px-5 py-10 font-mono text-xs uppercase tracking-[0.22em] text-muted-foreground/50"},A={key:2,class:"space-y-4"},R={class:"border-b border-border/50 px-5 py-3"},D=["onClick"],H={class:"flex items-start gap-3"},P={class:"mt-1.5 shrink-0"},U={key:0,class:"h-1.5 w-1.5 rounded-full bg-primary",style:{boxShadow:"var(--glow-cyan)"}},$={key:1,class:"h-1.5 w-1.5"},q={class:"min-w-0 flex-1"},G={class:"mb-1 flex flex-wrap items-center gap-1.5"},J={class:"font-mono text-[10px] text-muted-foreground/50"},K={class:"text-[10px] text-muted-foreground/50"},Q={class:"flex items-center justify-between gap-2"},W={class:"font-mono text-[10px] text-muted-foreground/40"},X={key:0,class:"text-[10px] text-primary/60"},Y={key:0,class:"mt-3 rounded border border-white/[0.06] bg-black/30 p-3 text-xs text-foreground/60"},Z=["innerHTML"],oe=w({__name:"FeedView",setup(ee){const f=c([]),m=c({}),l=c(null),u=c(!1),_=S(()=>{var r;const o=new Map;for(const n of f.value){const e=n.squad_slug??"io",d=m.value[e];o.has(e)||o.set(e,{key:e,label:(d==null?void 0:d.name)??I(e),color:(d==null?void 0:d.color)??"#8a8a99",entries:[]}),(r=o.get(e))==null||r.entries.push(n)}return[...o.values()]});async function v(){u.value=!0;try{const[o,r]=await Promise.all([p("/api/feed?limit=120"),p("/api/squads")]);if(o.ok&&(f.value=(await o.json()).entries),r.ok){const n=await r.json();m.value=Object.fromEntries(n.squads.map(e=>[e.slug??e.id??e.name.toLowerCase(),{name:e.name,universe:e.universe,color:e.color??"#8a8a99"}]))}}finally{u.value=!1}}async function k(o){l.value=l.value===o.id?null:o.id,o.read_at||(await p(`/api/feed/${o.id}/read`,{method:"POST"}).catch(()=>null),o.read_at=new Date().toISOString())}return C(v),(o,r)=>(a(),s("div",L,[t("div",N,[t("div",{class:"mb-5 flex items-center justify-between gap-3"},[r[0]||(r[0]=t("div",null,[t("div",{class:"font-mono text-[10px] uppercase tracking-[0.3em] text-primary"},"Activity Feed"),t("div",{class:"mt-2 text-sm text-foreground/70"},"Unread events keep the cyan indicator and expand inline for detail.")],-1)),t("button",{class:"rounded border border-border px-3 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:border-primary/40 hover:text-primary",onClick:v},"refresh")]),u.value?(a(),s("div",O,"Syncing feed…")):_.value.length?(a(),s("div",A,[(a(!0),s(b,null,g(_.value,n=>(a(),s("section",{key:n.key,class:"overflow-hidden rounded-lg border border-border bg-card"},[t("div",R,[t("span",{class:"rounded px-1.5 py-0.5 font-mono text-[10px]",style:j({color:n.color,backgroundColor:x(F)(n.color,.15)})},i(n.label),5)]),(a(!0),s(b,null,g(n.entries,e=>(a(),s("article",{key:e.id,class:h(["cursor-pointer border-b border-border/40 px-5 py-4 transition-colors last:border-b-0 hover:bg-white/[0.02]",e.read_at?"":"bg-white/[0.015]"]),onClick:d=>k(e)},[t("div",H,[t("div",P,[e.read_at?(a(),s("div",$)):(a(),s("div",U))]),t("div",q,[t("div",G,[t("span",J,i(e.source_ref??e.instance_id??e.task_id??e.type),1),r[1]||(r[1]=t("span",{class:"font-mono text-[10px] text-muted-foreground/40"},"·",-1)),t("span",K,i(e.source_type??"IO"),1)]),t("div",{class:h(["mb-1 text-sm leading-snug",e.read_at?"text-foreground/70":"text-foreground"])},i(e.title),3),t("div",Q,[t("span",W,i(x(T)(e.created_at)),1),e.body?(a(),s("span",X,i(l.value===e.id?"▲ collapse":"▼ details"),1)):y("",!0)]),M(E,{"enter-active-class":"duration-150 ease-out","enter-from-class":"opacity-0 -translate-y-1","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"duration-100 ease-in","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 -translate-y-1"},{default:z(()=>[l.value===e.id&&e.body?(a(),s("div",Y,[t("div",{class:"wiki-content text-xs font-mono leading-relaxed",innerHTML:x(B)(e.body)},null,8,Z)])):y("",!0)]),_:2},1024)])])],10,D))),128))]))),128))])):(a(),s("div",V,"No feed activity."))])]))}});export{oe as default};
@@ -0,0 +1 @@
1
+ import{d as g,o as _,c as d,a as e,t as o,F as h,m as k,g as y,b as x,x as w,I as b,r as m,q as C,E as f,j as i,s as j}from"./index-f67odrrt.js";const E={class:"grid h-full min-h-0 gap-5 p-5 xl:grid-cols-[360px_minmax(0,1fr)]"},I={class:"flex min-h-0 flex-col overflow-hidden rounded-lg border border-border bg-card"},L={class:"border-b border-border px-5 py-4"},M={class:"mt-2 flex items-end justify-between gap-3"},T={class:"text-3xl font-semibold"},B={class:"min-h-0 flex-1 overflow-y-auto p-3"},F=["onClick"],N={class:"flex items-center justify-between gap-3"},R={class:"truncate text-sm font-medium"},S={class:"font-mono text-[10px] uppercase tracking-[0.2em] text-accent-foreground"},V={class:"mt-2 text-sm leading-6 text-foreground/65"},$={class:"mt-3 font-mono text-[11px] uppercase tracking-[0.18em] text-muted-foreground/55"},q={key:0,class:"rounded-lg border border-dashed border-border px-4 py-12 text-center font-mono text-xs uppercase tracking-[0.22em] text-muted-foreground/45"},D={class:"flex min-h-0 flex-col overflow-hidden rounded-lg border border-border bg-card"},H={class:"border-b border-border px-6 py-4"},z={class:"mt-2 text-lg font-semibold"},P={class:"min-h-0 flex-1 overflow-y-auto px-6 py-6"},A={key:0,class:"grid gap-5 lg:grid-cols-[1fr_220px]"},G=["innerHTML"],J={class:"rounded-lg border border-white/[0.06] bg-sidebar/60 px-5 py-5 font-mono text-xs uppercase tracking-[0.18em] text-muted-foreground/55"},K={class:"mt-2 text-foreground"},O={class:"mt-2 text-accent-foreground"},Q={class:"mt-2 text-foreground/80"},U={key:1,class:"flex h-full items-center justify-center font-mono text-xs uppercase tracking-[0.22em] text-muted-foreground/45"},Z=g({__name:"InboxView",setup(W){const a=m([]),c=m(null),p=m(0),s=C(()=>a.value.find(n=>n.id===c.value)??null);async function u(){var l;const[n,t]=await Promise.all([f("/api/inbox/count"),f("/api/inbox")]);n.ok&&(p.value=(await n.json()).count??0),t.ok&&(a.value=(await t.json()).entries,c.value=((l=a.value[0])==null?void 0:l.id)??null)}async function v(n){await f(`/api/inbox/${n}`,{method:"DELETE"}),await u()}return _(u),(n,t)=>{var l;return i(),d("div",E,[e("section",I,[e("div",L,[t[2]||(t[2]=e("div",{class:"font-mono text-[10px] uppercase tracking-[0.28em] text-accent-foreground"},"Inbox",-1)),e("div",M,[e("div",null,[e("div",T,o(p.value),1),t[1]||(t[1]=e("div",{class:"font-mono text-xs uppercase tracking-[0.18em] text-muted-foreground/55"},"active inbox entries",-1))]),e("button",{class:"rounded border border-border px-3 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:border-accent-foreground/40 hover:text-accent-foreground",onClick:u},"refresh")])]),e("div",B,[(i(!0),d(h,null,k(a.value,r=>(i(),d("button",{key:r.id,class:j(["mb-2 w-full rounded-lg border px-4 py-4 text-left transition-colors",c.value===r.id?"border-accent-foreground/40 bg-accent-foreground/10":"border-border bg-sidebar/40 hover:bg-white/[0.03]"]),onClick:X=>c.value=r.id},[e("div",N,[e("div",R,o(r.title),1),e("div",S,o(r.type),1)]),e("div",V,o(r.body),1),e("div",$,o(x(b)(r.created_at)),1)],10,F))),128)),a.value.length?y("",!0):(i(),d("div",q,"Inbox is empty"))])]),e("section",D,[e("div",H,[t[3]||(t[3]=e("div",{class:"font-mono text-[10px] uppercase tracking-[0.28em] text-primary"},"Selected message",-1)),e("div",z,o(((l=s.value)==null?void 0:l.title)??"No message selected"),1)]),e("div",P,[s.value?(i(),d("div",A,[e("article",{class:"wiki-content rounded-lg border border-white/[0.06] bg-sidebar/60 px-5 py-5 text-sm leading-7 text-foreground/75",innerHTML:x(w)(s.value.body)},null,8,G),e("aside",J,[t[4]||(t[4]=e("div",null,"source",-1)),e("div",K,o(s.value.source_type??"inbox"),1),t[5]||(t[5]=e("div",{class:"mt-4"},"reference",-1)),e("div",O,o(s.value.source_ref??s.value.squad_slug??"—"),1),t[6]||(t[6]=e("div",{class:"mt-4"},"received",-1)),e("div",Q,o(x(b)(s.value.created_at)),1),e("button",{class:"mt-6 w-full rounded border border-destructive/40 px-4 py-2 text-destructive transition-colors hover:bg-destructive/10",onClick:t[0]||(t[0]=r=>v(s.value.id))},"dismiss")])])):(i(),d("div",U,"Select a message from the left rail"))])])])}}});export{Z as default};
@@ -1 +1 @@
1
- import{d as y,u as v,o as w,c as i,a as e,t as c,b as r,w as g,v as f,e as h,f as k,g as _,h as C,r as p,i as V,j as d}from"./index-D1C7prBJ.js";const E={class:"dark flex h-full items-center justify-center bg-background px-6"},M={class:"w-full max-w-md rounded-lg border border-border bg-card px-8 py-8 shadow-[0_20px_60px_rgba(0,0,0,0.45)]"},S={class:"mt-2 text-sm leading-6 text-muted-foreground"},q={key:0,class:"mt-6 space-y-4"},A={class:"block"},B={class:"block"},K=["onKeydown"],j={key:0,class:"rounded border border-destructive/25 bg-destructive/10 px-4 py-3 text-sm text-destructive"},D=["disabled"],N=y({__name:"LoginView",setup(I){const m=C(),b=V(),o=v(),l=p(""),u=p(""),n=p("");async function x(){n.value="";try{await o.signIn(l.value,u.value);const s=typeof b.query.redirect=="string"?b.query.redirect:"/chat";m.push(s)}catch(s){n.value=s instanceof Error?s.message:"Sign-in failed."}}return w(()=>{o.init()}),(s,t)=>(d(),i("div",E,[e("section",M,[t[5]||(t[5]=e("div",{class:"font-mono text-xl font-bold tracking-tight text-primary text-glow-cyan"},"IO",-1)),t[6]||(t[6]=e("div",{class:"mt-3 text-2xl font-semibold"},"Mission Control Login",-1)),e("p",S,c(r(o).authEnabled?"Authenticate against Supabase to access squads, feed, wiki, and orchestration controls.":"Authentication is disabled for this workspace."),1),r(o).authEnabled?(d(),i("div",q,[e("label",A,[t[3]||(t[3]=e("span",{class:"mb-2 block font-mono text-[11px] uppercase tracking-[0.18em] text-muted-foreground/70"},"email",-1)),g(e("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>l.value=a),type:"email",class:"w-full rounded border border-border bg-sidebar px-4 py-3 text-sm text-foreground"},null,512),[[f,l.value]])]),e("label",B,[t[4]||(t[4]=e("span",{class:"mb-2 block font-mono text-[11px] uppercase tracking-[0.18em] text-muted-foreground/70"},"password",-1)),g(e("input",{"onUpdate:modelValue":t[1]||(t[1]=a=>u.value=a),type:"password",class:"w-full rounded border border-border bg-sidebar px-4 py-3 text-sm text-foreground",onKeydown:h(k(x,["prevent"]),["enter"])},null,40,K),[[f,u.value]])]),n.value?(d(),i("div",j,c(n.value),1)):_("",!0),e("button",{class:"w-full rounded bg-primary/15 px-4 py-3 font-mono text-sm text-primary transition-colors hover:bg-primary/25",disabled:r(o).loading,onClick:x},c(r(o).loading?"connecting…":"sign in"),9,D)])):(d(),i("button",{key:1,class:"mt-6 w-full rounded bg-primary/15 px-4 py-3 font-mono text-sm text-primary transition-colors hover:bg-primary/25",onClick:t[2]||(t[2]=a=>r(m).push("/chat"))},"continue to mission control"))])]))}});export{N as default};
1
+ import{d as y,u as v,o as w,c as i,a as e,t as c,b as r,w as g,v as f,e as h,f as k,g as _,h as C,r as p,i as V,j as d}from"./index-f67odrrt.js";const E={class:"dark flex h-full items-center justify-center bg-background px-6"},M={class:"w-full max-w-md rounded-lg border border-border bg-card px-8 py-8 shadow-[0_20px_60px_rgba(0,0,0,0.45)]"},S={class:"mt-2 text-sm leading-6 text-muted-foreground"},q={key:0,class:"mt-6 space-y-4"},A={class:"block"},B={class:"block"},K=["onKeydown"],j={key:0,class:"rounded border border-destructive/25 bg-destructive/10 px-4 py-3 text-sm text-destructive"},D=["disabled"],N=y({__name:"LoginView",setup(I){const m=C(),b=V(),o=v(),l=p(""),u=p(""),n=p("");async function x(){n.value="";try{await o.signIn(l.value,u.value);const s=typeof b.query.redirect=="string"?b.query.redirect:"/chat";m.push(s)}catch(s){n.value=s instanceof Error?s.message:"Sign-in failed."}}return w(()=>{o.init()}),(s,t)=>(d(),i("div",E,[e("section",M,[t[5]||(t[5]=e("div",{class:"font-mono text-xl font-bold tracking-tight text-primary text-glow-cyan"},"IO",-1)),t[6]||(t[6]=e("div",{class:"mt-3 text-2xl font-semibold"},"Mission Control Login",-1)),e("p",S,c(r(o).authEnabled?"Authenticate against Supabase to access squads, feed, wiki, and orchestration controls.":"Authentication is disabled for this workspace."),1),r(o).authEnabled?(d(),i("div",q,[e("label",A,[t[3]||(t[3]=e("span",{class:"mb-2 block font-mono text-[11px] uppercase tracking-[0.18em] text-muted-foreground/70"},"email",-1)),g(e("input",{"onUpdate:modelValue":t[0]||(t[0]=a=>l.value=a),type:"email",class:"w-full rounded border border-border bg-sidebar px-4 py-3 text-sm text-foreground"},null,512),[[f,l.value]])]),e("label",B,[t[4]||(t[4]=e("span",{class:"mb-2 block font-mono text-[11px] uppercase tracking-[0.18em] text-muted-foreground/70"},"password",-1)),g(e("input",{"onUpdate:modelValue":t[1]||(t[1]=a=>u.value=a),type:"password",class:"w-full rounded border border-border bg-sidebar px-4 py-3 text-sm text-foreground",onKeydown:h(k(x,["prevent"]),["enter"])},null,40,K),[[f,u.value]])]),n.value?(d(),i("div",j,c(n.value),1)):_("",!0),e("button",{class:"w-full rounded bg-primary/15 px-4 py-3 font-mono text-sm text-primary transition-colors hover:bg-primary/25",disabled:r(o).loading,onClick:x},c(r(o).loading?"connecting…":"sign in"),9,D)])):(d(),i("button",{key:1,class:"mt-6 w-full rounded bg-primary/15 px-4 py-3 font-mono text-sm text-primary transition-colors hover:bg-primary/25",onClick:t[2]||(t[2]=a=>r(m).push("/chat"))},"continue to mission control"))])]))}});export{N as default};
@@ -1 +1 @@
1
- import{d as V,o as $,D as j,A as w,G as m,r as x,j as n,a as t,n as v,p as U,c as d,w as f,v as h,Q as E,t as a,g as b,f as P,T as A,m as k,z as B,s as _,F as C,_ as S}from"./index-D1C7prBJ.js";import{_ as D}from"./SettingsTabs.vue_vue_type_script_setup_true_lang-BE0YBCo4.js";const O={class:"max-w-2xl space-y-4"},z={class:"flex items-center justify-between"},F={class:"grid grid-cols-2 gap-3"},I={class:"mb-1 block font-mono text-[10px] uppercase tracking-wider text-muted-foreground/60"},L=["placeholder"],R={key:0,class:"rounded border border-destructive/25 bg-destructive/10 px-3 py-2 text-sm text-destructive"},H={class:"flex justify-end gap-2"},J={class:"space-y-2"},G={class:"flex items-center gap-3 px-4 py-3"},Q={class:"min-w-0 flex-1"},q={class:"mb-0.5 flex items-center gap-2"},K={class:"text-sm font-medium"},W={class:"rounded bg-white/5 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground"},X={class:"block truncate font-mono text-[11px] text-muted-foreground/50"},Y=["onClick"],Z=["onClick"],ee={key:0,class:"flex flex-wrap gap-1.5 border-t border-border/40 px-4 py-2"},se=V({__name:"McpView",setup(te){const g=x([]),l=x(!1),s=x({name:"",transport:"stdio",command:""}),i=x("");function u(r){return r.enabled===!1?"disabled":"connected"}function y(r){var e,o;return(e=r.tools)!=null&&e.length?r.tools:(o=r.args)!=null&&o.length?r.args:[]}async function c(){const r=await m("/api/mcp/servers");r.ok&&(g.value=(await r.json()).servers)}async function T(){if(i.value="",!s.value.name.trim()||!s.value.command.trim())return;const r={name:s.value.name.trim()};s.value.transport==="stdio"?r.command=s.value.command.trim():r.url=s.value.command.trim();const e=await m("/api/mcp/servers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!e.ok){i.value=await e.text()||"Unable to add server.";return}s.value={name:"",transport:"stdio",command:""},l.value=!1,await c()}async function M(r){await m(`/api/mcp/servers/${encodeURIComponent(r)}`,{method:"DELETE"}),await c()}async function N(r,e){await m(`/api/mcp/servers/${encodeURIComponent(r)}/toggle`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:!e})}),await c()}return $(c),(r,e)=>(n(),j(D,{active:"mcp"},{default:w(()=>[t("div",O,[t("div",z,[e[6]||(e[6]=t("p",{class:"text-xs text-muted-foreground"},"MCP servers extend IO agents with additional tools and data sources.",-1)),t("button",{class:"flex items-center gap-1.5 rounded border border-border px-3 py-1.5 font-mono text-xs text-muted-foreground transition-all hover:border-primary/40 hover:bg-primary/5 hover:text-primary",onClick:e[0]||(e[0]=o=>l.value=!l.value)},[v(S,{name:"plus",class:"h-3 w-3"}),e[5]||(e[5]=U(" Add server ",-1))])]),v(A,{"enter-active-class":"duration-150 ease-out","enter-from-class":"opacity-0 -translate-y-1","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"duration-100 ease-in","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 -translate-y-1"},{default:w(()=>[l.value?(n(),d("form",{key:0,class:"space-y-3 rounded-lg border border-primary/30 bg-primary/[0.04] p-4",onSubmit:P(T,["prevent"])},[e[11]||(e[11]=t("div",{class:"mb-1 font-mono text-xs text-primary/80"},"New MCP Server",-1)),t("div",F,[t("div",null,[e[7]||(e[7]=t("label",{class:"mb-1 block font-mono text-[10px] uppercase tracking-wider text-muted-foreground/60"},"Name",-1)),f(t("input",{"onUpdate:modelValue":e[1]||(e[1]=o=>s.value.name=o),class:"w-full rounded border border-border bg-black/30 px-3 py-1.5 text-xs font-mono placeholder:text-muted-foreground/30",placeholder:"My Server"},null,512),[[h,s.value.name]])]),t("div",null,[e[9]||(e[9]=t("label",{class:"mb-1 block font-mono text-[10px] uppercase tracking-wider text-muted-foreground/60"},"Transport",-1)),f(t("select",{"onUpdate:modelValue":e[2]||(e[2]=o=>s.value.transport=o),class:"w-full rounded border border-border bg-black/30 px-3 py-1.5 text-xs font-mono"},[...e[8]||(e[8]=[t("option",{value:"stdio"},"stdio",-1),t("option",{value:"http"},"HTTP/SSE",-1)])],512),[[E,s.value.transport]])])]),t("div",null,[t("label",I,a(s.value.transport==="stdio"?"Command":"URL"),1),f(t("input",{"onUpdate:modelValue":e[3]||(e[3]=o=>s.value.command=o),class:"w-full rounded border border-border bg-black/30 px-3 py-1.5 text-xs font-mono placeholder:text-muted-foreground/30",placeholder:s.value.transport==="stdio"?"npx @modelcontextprotocol/server-...":"https://..."},null,8,L),[[h,s.value.command]])]),i.value?(n(),d("div",R,a(i.value),1)):b("",!0),t("div",H,[t("button",{type:"button",class:"px-3 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",onClick:e[4]||(e[4]=o=>l.value=!1)},"Cancel"),e[10]||(e[10]=t("button",{type:"submit",class:"rounded bg-primary/15 px-3 py-1.5 font-mono text-xs text-primary transition-colors hover:bg-primary/25"},"Add",-1))])],32)):b("",!0)]),_:1}),t("div",J,[(n(!0),d(C,null,k(g.value,o=>(n(),d("article",{key:o.name,class:"overflow-hidden rounded-lg border border-border bg-card"},[t("div",G,[t("div",{class:_(["h-2 w-2 shrink-0 rounded-full",u(o)==="connected"?"bg-status-success":"bg-destructive"]),style:B({boxShadow:u(o)==="connected"?"var(--glow-success)":"var(--glow-error)"})},null,6),t("div",Q,[t("div",q,[t("span",K,a(o.name),1),t("span",{class:_(["rounded px-1.5 py-0.5 font-mono text-[10px]",u(o)==="connected"?"bg-status-success/10 text-status-success":"bg-destructive/10 text-destructive"])},a(u(o)),3),t("span",W,a(o.url?"http":"stdio"),1)]),t("code",X,a(o.command??o.url??"—"),1)]),t("button",{class:"rounded border border-border px-2.5 py-1 font-mono text-[10px] text-muted-foreground transition-colors hover:border-primary/40 hover:text-primary",onClick:p=>N(o.name,!!o.enabled)},a(o.enabled===!1?"enable":"disable"),9,Y),t("button",{class:"flex h-7 w-7 shrink-0 items-center justify-center rounded text-muted-foreground/30 transition-colors hover:bg-destructive/10 hover:text-destructive",onClick:p=>M(o.name)},[v(S,{name:"trash",class:"h-3.5 w-3.5"})],8,Z)]),y(o).length?(n(),d("div",ee,[(n(!0),d(C,null,k(y(o),p=>(n(),d("code",{key:p,class:"rounded border border-white/[0.05] bg-white/[0.04] px-1.5 py-0.5 font-mono text-[10px] text-foreground/50"},a(p),1))),128))])):b("",!0)]))),128))])])]),_:1}))}});export{se as default};
1
+ import{d as V,o as $,D as j,A as w,E as m,r as x,j as n,a as t,n as v,p as U,c as d,w as f,v as h,P as E,t as a,g as b,f as P,T as A,m as k,z as B,s as _,F as C,_ as S}from"./index-f67odrrt.js";import{_ as D}from"./SettingsTabs.vue_vue_type_script_setup_true_lang-oW3ySu7Y.js";const O={class:"max-w-2xl space-y-4"},z={class:"flex items-center justify-between"},F={class:"grid grid-cols-2 gap-3"},I={class:"mb-1 block font-mono text-[10px] uppercase tracking-wider text-muted-foreground/60"},L=["placeholder"],R={key:0,class:"rounded border border-destructive/25 bg-destructive/10 px-3 py-2 text-sm text-destructive"},H={class:"flex justify-end gap-2"},J={class:"space-y-2"},q={class:"flex items-center gap-3 px-4 py-3"},G={class:"min-w-0 flex-1"},K={class:"mb-0.5 flex items-center gap-2"},Q={class:"text-sm font-medium"},W={class:"rounded bg-white/5 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground"},X={class:"block truncate font-mono text-[11px] text-muted-foreground/50"},Y=["onClick"],Z=["onClick"],ee={key:0,class:"flex flex-wrap gap-1.5 border-t border-border/40 px-4 py-2"},se=V({__name:"McpView",setup(te){const g=x([]),l=x(!1),s=x({name:"",transport:"stdio",command:""}),i=x("");function u(r){return r.enabled===!1?"disabled":"connected"}function y(r){var e,o;return(e=r.tools)!=null&&e.length?r.tools:(o=r.args)!=null&&o.length?r.args:[]}async function c(){const r=await m("/api/mcp/servers");r.ok&&(g.value=(await r.json()).servers)}async function T(){if(i.value="",!s.value.name.trim()||!s.value.command.trim())return;const r={name:s.value.name.trim()};s.value.transport==="stdio"?r.command=s.value.command.trim():r.url=s.value.command.trim();const e=await m("/api/mcp/servers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!e.ok){i.value=await e.text()||"Unable to add server.";return}s.value={name:"",transport:"stdio",command:""},l.value=!1,await c()}async function M(r){await m(`/api/mcp/servers/${encodeURIComponent(r)}`,{method:"DELETE"}),await c()}async function N(r,e){await m(`/api/mcp/servers/${encodeURIComponent(r)}/toggle`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:!e})}),await c()}return $(c),(r,e)=>(n(),j(D,{active:"mcp"},{default:w(()=>[t("div",O,[t("div",z,[e[6]||(e[6]=t("p",{class:"text-xs text-muted-foreground"},"MCP servers extend IO agents with additional tools and data sources.",-1)),t("button",{class:"flex items-center gap-1.5 rounded border border-border px-3 py-1.5 font-mono text-xs text-muted-foreground transition-all hover:border-primary/40 hover:bg-primary/5 hover:text-primary",onClick:e[0]||(e[0]=o=>l.value=!l.value)},[v(S,{name:"plus",class:"h-3 w-3"}),e[5]||(e[5]=U(" Add server ",-1))])]),v(A,{"enter-active-class":"duration-150 ease-out","enter-from-class":"opacity-0 -translate-y-1","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"duration-100 ease-in","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 -translate-y-1"},{default:w(()=>[l.value?(n(),d("form",{key:0,class:"space-y-3 rounded-lg border border-primary/30 bg-primary/[0.04] p-4",onSubmit:P(T,["prevent"])},[e[11]||(e[11]=t("div",{class:"mb-1 font-mono text-xs text-primary/80"},"New MCP Server",-1)),t("div",F,[t("div",null,[e[7]||(e[7]=t("label",{class:"mb-1 block font-mono text-[10px] uppercase tracking-wider text-muted-foreground/60"},"Name",-1)),f(t("input",{"onUpdate:modelValue":e[1]||(e[1]=o=>s.value.name=o),class:"w-full rounded border border-border bg-black/30 px-3 py-1.5 text-xs font-mono placeholder:text-muted-foreground/30",placeholder:"My Server"},null,512),[[h,s.value.name]])]),t("div",null,[e[9]||(e[9]=t("label",{class:"mb-1 block font-mono text-[10px] uppercase tracking-wider text-muted-foreground/60"},"Transport",-1)),f(t("select",{"onUpdate:modelValue":e[2]||(e[2]=o=>s.value.transport=o),class:"w-full rounded border border-border bg-black/30 px-3 py-1.5 text-xs font-mono"},[...e[8]||(e[8]=[t("option",{value:"stdio"},"stdio",-1),t("option",{value:"http"},"HTTP/SSE",-1)])],512),[[E,s.value.transport]])])]),t("div",null,[t("label",I,a(s.value.transport==="stdio"?"Command":"URL"),1),f(t("input",{"onUpdate:modelValue":e[3]||(e[3]=o=>s.value.command=o),class:"w-full rounded border border-border bg-black/30 px-3 py-1.5 text-xs font-mono placeholder:text-muted-foreground/30",placeholder:s.value.transport==="stdio"?"npx @modelcontextprotocol/server-...":"https://..."},null,8,L),[[h,s.value.command]])]),i.value?(n(),d("div",R,a(i.value),1)):b("",!0),t("div",H,[t("button",{type:"button",class:"px-3 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-foreground",onClick:e[4]||(e[4]=o=>l.value=!1)},"Cancel"),e[10]||(e[10]=t("button",{type:"submit",class:"rounded bg-primary/15 px-3 py-1.5 font-mono text-xs text-primary transition-colors hover:bg-primary/25"},"Add",-1))])],32)):b("",!0)]),_:1}),t("div",J,[(n(!0),d(C,null,k(g.value,o=>(n(),d("article",{key:o.name,class:"overflow-hidden rounded-lg border border-border bg-card"},[t("div",q,[t("div",{class:_(["h-2 w-2 shrink-0 rounded-full",u(o)==="connected"?"bg-status-success":"bg-destructive"]),style:B({boxShadow:u(o)==="connected"?"var(--glow-success)":"var(--glow-error)"})},null,6),t("div",G,[t("div",K,[t("span",Q,a(o.name),1),t("span",{class:_(["rounded px-1.5 py-0.5 font-mono text-[10px]",u(o)==="connected"?"bg-status-success/10 text-status-success":"bg-destructive/10 text-destructive"])},a(u(o)),3),t("span",W,a(o.url?"http":"stdio"),1)]),t("code",X,a(o.command??o.url??"—"),1)]),t("button",{class:"rounded border border-border px-2.5 py-1 font-mono text-[10px] text-muted-foreground transition-colors hover:border-primary/40 hover:text-primary",onClick:p=>N(o.name,!!o.enabled)},a(o.enabled===!1?"enable":"disable"),9,Y),t("button",{class:"flex h-7 w-7 shrink-0 items-center justify-center rounded text-muted-foreground/30 transition-colors hover:bg-destructive/10 hover:text-destructive",onClick:p=>M(o.name)},[v(S,{name:"trash",class:"h-3.5 w-3.5"})],8,Z)]),y(o).length?(n(),d("div",ee,[(n(!0),d(C,null,k(y(o),p=>(n(),d("code",{key:p,class:"rounded border border-white/[0.05] bg-white/[0.04] px-1.5 py-0.5 font-mono text-[10px] text-foreground/50"},a(p),1))),128))])):b("",!0)]))),128))])])]),_:1}))}});export{se as default};
@@ -1 +1 @@
1
- import{d as j,o as E,c as d,a as e,s as p,F as S,m as $,g as m,t as o,r as b,q as C,G as _,j as n,b as g,J as f}from"./index-D1C7prBJ.js";const N={class:"grid h-full min-h-0 gap-5 p-5 xl:grid-cols-[minmax(0,1fr)_360px]"},B={class:"min-h-0 overflow-hidden rounded-lg border border-border bg-card"},F={class:"border-b border-border px-5 py-4"},I={class:"flex flex-wrap items-center justify-between gap-3"},R={class:"mt-3 flex gap-2"},T={class:"min-h-0 overflow-y-auto px-4 py-4"},V={class:"space-y-3"},D=["onClick"],L={class:"font-mono text-lg text-primary"},M={class:"text-sm font-medium"},O={class:"mt-2 text-sm leading-6 text-foreground/65"},P={class:"font-mono text-xs text-muted-foreground/65"},z={class:"mt-2"},G={key:0,class:"mt-2 text-accent-foreground"},J={key:0,class:"rounded-lg border border-dashed border-border px-4 py-16 text-center font-mono text-xs uppercase tracking-[0.22em] text-muted-foreground/45"},A={class:"flex min-h-0 flex-col overflow-hidden rounded-lg border border-border bg-card"},H={class:"border-b border-border px-5 py-4"},K={class:"mt-2 text-lg font-semibold"},Q={key:0,class:"border-b border-border px-5 py-4"},U={class:"grid grid-cols-2 gap-2 font-mono text-[11px] uppercase tracking-[0.16em]"},W={class:"min-h-0 flex-1 overflow-y-auto p-4"},X={class:"space-y-3"},Y={class:"flex items-center justify-between gap-3 font-mono text-xs uppercase tracking-[0.16em]"},Z={class:"text-muted-foreground/55"},ee={class:"mt-3 text-sm text-foreground/75"},te={class:"mt-1 text-sm text-foreground/55"},re={key:0,class:"mt-3 rounded border border-destructive/25 bg-destructive/10 px-3 py-3 text-sm text-destructive"},oe={key:0,class:"rounded-lg border border-dashed border-border px-4 py-12 text-center font-mono text-xs uppercase tracking-[0.22em] text-muted-foreground/45"},ne=j({__name:"SchedulesView",setup(se){const i=b("io"),y=b({io:[],squads:[]}),l=b(""),u=b([]),c=C(()=>y.value[i.value]),a=C(()=>c.value.find(s=>String(s.id)===l.value)??null);async function v(){const s=await _("/api/schedules");s.ok&&(y.value=await s.json(),!l.value&&c.value[0]&&(l.value=String(c.value[0].id),await x()))}async function x(){if(!a.value){u.value=[];return}const s=await _(`/api/schedules/${i.value}/${a.value.id}/runs`);s.ok&&(u.value=(await s.json()).runs)}async function h(s){a.value&&(await _(`/api/schedules/${i.value}/${a.value.id}/${s}`,{method:"POST"}),await Promise.all([v(),x()]))}async function q(){a.value&&(await _(`/api/schedules/${i.value}/${a.value.id}`,{method:"DELETE"}),l.value="",u.value=[],await v())}async function k(s){var r;i.value=s,l.value=String(((r=y.value[s][0])==null?void 0:r.id)??""),await x()}return E(v),(s,r)=>{var w;return n(),d("div",N,[e("section",B,[e("div",F,[e("div",I,[e("div",null,[r[4]||(r[4]=e("div",{class:"font-mono text-[10px] uppercase tracking-[0.28em] text-primary"},"Schedule Matrix",-1)),e("div",R,[e("button",{class:p(["rounded-full border px-3 py-1.5 font-mono text-[11px] uppercase tracking-[0.16em]",i.value==="io"?"border-primary/40 bg-primary/10 text-primary":"border-border text-muted-foreground"]),onClick:r[0]||(r[0]=t=>k("io"))},"IO",2),e("button",{class:p(["rounded-full border px-3 py-1.5 font-mono text-[11px] uppercase tracking-[0.16em]",i.value==="squads"?"border-accent-foreground/40 bg-accent-foreground/10 text-accent-foreground":"border-border text-muted-foreground"]),onClick:r[1]||(r[1]=t=>k("squads"))},"Squads",2)])]),e("button",{class:"rounded border border-border px-3 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:border-primary/40 hover:text-primary",onClick:v},"refresh")])]),e("div",T,[e("div",V,[(n(!0),d(S,null,$(c.value,t=>(n(),d("button",{key:t.id,class:p(["grid w-full gap-3 rounded-lg border px-4 py-4 text-left transition-colors lg:grid-cols-[160px_minmax(0,1fr)_170px]",l.value===String(t.id)?"border-primary/40 bg-primary/8":"border-border bg-sidebar/40 hover:bg-white/[0.03]"]),onClick:ae=>{l.value=String(t.id),x()}},[e("div",null,[e("div",L,o(t.cron_expr),1),e("div",{class:p(["mt-1 font-mono text-[10px] uppercase tracking-[0.18em]",t.enabled?"text-status-success":"text-destructive"])},o(t.enabled?"enabled":"paused"),3)]),e("div",null,[e("div",M,o(t.name),1),e("div",O,o(t.prompt),1)]),e("div",P,[e("div",null,"last "+o(t.last_run_at?g(f)(t.last_run_at):"—"),1),e("div",z,"next "+o(t.next_run_at?g(f)(t.next_run_at):"—"),1),t.squad_slug?(n(),d("div",G,o(t.squad_slug),1)):m("",!0)])],10,D))),128)),c.value.length?m("",!0):(n(),d("div",J,"No schedules in this scope"))])])]),e("section",A,[e("div",H,[r[5]||(r[5]=e("div",{class:"font-mono text-[10px] uppercase tracking-[0.28em] text-accent-foreground"},"Run Inspector",-1)),e("div",K,o(((w=a.value)==null?void 0:w.name)??"Select a schedule"),1)]),a.value?(n(),d("div",Q,[e("div",U,[e("button",{class:"rounded border border-border bg-sidebar px-3 py-2 transition-colors hover:border-primary/40 hover:text-primary",onClick:r[2]||(r[2]=t=>h(a.value.enabled?"pause":"resume"))},o(a.value.enabled?"pause":"resume"),1),e("button",{class:"rounded border border-primary/40 bg-primary/10 px-3 py-2 text-primary",onClick:r[3]||(r[3]=t=>h("run-now"))},"run now"),e("button",{class:"col-span-2 rounded border border-destructive/40 px-3 py-2 text-destructive transition-colors hover:bg-destructive/10",onClick:q},"delete")])])):m("",!0),e("div",W,[e("div",X,[(n(!0),d(S,null,$(u.value,t=>(n(),d("article",{key:t.id,class:"rounded-lg border border-white/[0.06] bg-sidebar/60 px-4 py-4"},[e("div",Y,[e("span",{class:p(t.status==="success"?"text-status-success":t.status==="error"?"text-destructive":"text-primary")},o(t.status),3),e("span",Z,o(t.id),1)]),e("div",ee,"started "+o(g(f)(t.started_at)),1),e("div",te,"completed "+o(t.completed_at?g(f)(t.completed_at):"—"),1),t.error_text?(n(),d("div",re,o(t.error_text),1)):m("",!0)]))),128)),a.value&&!u.value.length?(n(),d("div",oe,"No run history yet")):m("",!0)])])])])}}});export{ne as default};
1
+ import{d as j,o as E,c as d,a as e,s as p,F as S,m as $,g as m,t as o,r as b,q as C,E as _,j as n,b as g,I as f}from"./index-f67odrrt.js";const I={class:"grid h-full min-h-0 gap-5 p-5 xl:grid-cols-[minmax(0,1fr)_360px]"},N={class:"min-h-0 overflow-hidden rounded-lg border border-border bg-card"},B={class:"border-b border-border px-5 py-4"},F={class:"flex flex-wrap items-center justify-between gap-3"},R={class:"mt-3 flex gap-2"},T={class:"min-h-0 overflow-y-auto px-4 py-4"},V={class:"space-y-3"},D=["onClick"],L={class:"font-mono text-lg text-primary"},M={class:"text-sm font-medium"},O={class:"mt-2 text-sm leading-6 text-foreground/65"},P={class:"font-mono text-xs text-muted-foreground/65"},z={class:"mt-2"},A={key:0,class:"mt-2 text-accent-foreground"},G={key:0,class:"rounded-lg border border-dashed border-border px-4 py-16 text-center font-mono text-xs uppercase tracking-[0.22em] text-muted-foreground/45"},H={class:"flex min-h-0 flex-col overflow-hidden rounded-lg border border-border bg-card"},J={class:"border-b border-border px-5 py-4"},K={class:"mt-2 text-lg font-semibold"},Q={key:0,class:"border-b border-border px-5 py-4"},U={class:"grid grid-cols-2 gap-2 font-mono text-[11px] uppercase tracking-[0.16em]"},W={class:"min-h-0 flex-1 overflow-y-auto p-4"},X={class:"space-y-3"},Y={class:"flex items-center justify-between gap-3 font-mono text-xs uppercase tracking-[0.16em]"},Z={class:"text-muted-foreground/55"},ee={class:"mt-3 text-sm text-foreground/75"},te={class:"mt-1 text-sm text-foreground/55"},re={key:0,class:"mt-3 rounded border border-destructive/25 bg-destructive/10 px-3 py-3 text-sm text-destructive"},oe={key:0,class:"rounded-lg border border-dashed border-border px-4 py-12 text-center font-mono text-xs uppercase tracking-[0.22em] text-muted-foreground/45"},ne=j({__name:"SchedulesView",setup(se){const i=b("io"),y=b({io:[],squads:[]}),l=b(""),u=b([]),c=C(()=>y.value[i.value]),a=C(()=>c.value.find(s=>String(s.id)===l.value)??null);async function v(){const s=await _("/api/schedules");s.ok&&(y.value=await s.json(),!l.value&&c.value[0]&&(l.value=String(c.value[0].id),await x()))}async function x(){if(!a.value){u.value=[];return}const s=await _(`/api/schedules/${i.value}/${a.value.id}/runs`);s.ok&&(u.value=(await s.json()).runs)}async function h(s){a.value&&(await _(`/api/schedules/${i.value}/${a.value.id}/${s}`,{method:"POST"}),await Promise.all([v(),x()]))}async function q(){a.value&&(await _(`/api/schedules/${i.value}/${a.value.id}`,{method:"DELETE"}),l.value="",u.value=[],await v())}async function k(s){var r;i.value=s,l.value=String(((r=y.value[s][0])==null?void 0:r.id)??""),await x()}return E(v),(s,r)=>{var w;return n(),d("div",I,[e("section",N,[e("div",B,[e("div",F,[e("div",null,[r[4]||(r[4]=e("div",{class:"font-mono text-[10px] uppercase tracking-[0.28em] text-primary"},"Schedule Matrix",-1)),e("div",R,[e("button",{class:p(["rounded-full border px-3 py-1.5 font-mono text-[11px] uppercase tracking-[0.16em]",i.value==="io"?"border-primary/40 bg-primary/10 text-primary":"border-border text-muted-foreground"]),onClick:r[0]||(r[0]=t=>k("io"))},"IO",2),e("button",{class:p(["rounded-full border px-3 py-1.5 font-mono text-[11px] uppercase tracking-[0.16em]",i.value==="squads"?"border-accent-foreground/40 bg-accent-foreground/10 text-accent-foreground":"border-border text-muted-foreground"]),onClick:r[1]||(r[1]=t=>k("squads"))},"Squads",2)])]),e("button",{class:"rounded border border-border px-3 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:border-primary/40 hover:text-primary",onClick:v},"refresh")])]),e("div",T,[e("div",V,[(n(!0),d(S,null,$(c.value,t=>(n(),d("button",{key:t.id,class:p(["grid w-full gap-3 rounded-lg border px-4 py-4 text-left transition-colors lg:grid-cols-[160px_minmax(0,1fr)_170px]",l.value===String(t.id)?"border-primary/40 bg-primary/8":"border-border bg-sidebar/40 hover:bg-white/[0.03]"]),onClick:ae=>{l.value=String(t.id),x()}},[e("div",null,[e("div",L,o(t.cron_expr),1),e("div",{class:p(["mt-1 font-mono text-[10px] uppercase tracking-[0.18em]",t.enabled?"text-status-success":"text-destructive"])},o(t.enabled?"enabled":"paused"),3)]),e("div",null,[e("div",M,o(t.name),1),e("div",O,o(t.prompt),1)]),e("div",P,[e("div",null,"last "+o(t.last_run_at?g(f)(t.last_run_at):"—"),1),e("div",z,"next "+o(t.next_run_at?g(f)(t.next_run_at):"—"),1),t.squad_slug?(n(),d("div",A,o(t.squad_slug),1)):m("",!0)])],10,D))),128)),c.value.length?m("",!0):(n(),d("div",G,"No schedules in this scope"))])])]),e("section",H,[e("div",J,[r[5]||(r[5]=e("div",{class:"font-mono text-[10px] uppercase tracking-[0.28em] text-accent-foreground"},"Run Inspector",-1)),e("div",K,o(((w=a.value)==null?void 0:w.name)??"Select a schedule"),1)]),a.value?(n(),d("div",Q,[e("div",U,[e("button",{class:"rounded border border-border bg-sidebar px-3 py-2 transition-colors hover:border-primary/40 hover:text-primary",onClick:r[2]||(r[2]=t=>h(a.value.enabled?"pause":"resume"))},o(a.value.enabled?"pause":"resume"),1),e("button",{class:"rounded border border-primary/40 bg-primary/10 px-3 py-2 text-primary",onClick:r[3]||(r[3]=t=>h("run-now"))},"run now"),e("button",{class:"col-span-2 rounded border border-destructive/40 px-3 py-2 text-destructive transition-colors hover:bg-destructive/10",onClick:q},"delete")])])):m("",!0),e("div",W,[e("div",X,[(n(!0),d(S,null,$(u.value,t=>(n(),d("article",{key:t.id,class:"rounded-lg border border-white/[0.06] bg-sidebar/60 px-4 py-4"},[e("div",Y,[e("span",{class:p(t.status==="success"?"text-status-success":t.status==="error"?"text-destructive":"text-primary")},o(t.status),3),e("span",Z,o(t.id),1)]),e("div",ee,"started "+o(g(f)(t.started_at)),1),e("div",te,"completed "+o(t.completed_at?g(f)(t.completed_at):"—"),1),t.error_text?(n(),d("div",re,o(t.error_text),1)):m("",!0)]))),128)),a.value&&!u.value.length?(n(),d("div",oe,"No run history yet")):m("",!0)])])])])}}});export{ne as default};
@@ -1 +1 @@
1
- import{d as m,c as p,a as t,n as s,A as r,s as a,b as n,R as d,S as x,j as f,p as l}from"./index-D1C7prBJ.js";const b={class:"flex h-full flex-col overflow-hidden"},c={class:"shrink-0 px-4 pb-0 pt-5 md:px-6"},u={class:"flex border-b border-border"},v={class:"flex-1 overflow-y-auto px-4 py-5 md:px-6"},_=m({__name:"SettingsTabs",props:{active:{}},setup(o){return(i,e)=>(f(),p("div",b,[t("div",c,[e[2]||(e[2]=t("h2",{class:"mb-4 text-base font-semibold"},"Settings",-1)),t("div",u,[s(n(d),{to:"/skills",class:a(["-mb-px border-b-2 px-4 py-2 font-mono text-xs font-medium transition-colors",o.active==="skills"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"])},{default:r(()=>[...e[0]||(e[0]=[l(" Skills ",-1)])]),_:1},8,["class"]),s(n(d),{to:"/mcp",class:a(["-mb-px border-b-2 px-4 py-2 font-mono text-xs font-medium transition-colors",o.active==="mcp"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"])},{default:r(()=>[...e[1]||(e[1]=[l(" MCP Servers ",-1)])]),_:1},8,["class"])])]),t("div",v,[x(i.$slots,"default")])]))}});export{_};
1
+ import{d as m,c as p,a as t,n as s,b as r,R as a,s as n,A as d,S as x,j as f,p as l}from"./index-f67odrrt.js";const b={class:"flex h-full flex-col overflow-hidden"},c={class:"shrink-0 px-4 pb-0 pt-5 md:px-6"},u={class:"flex border-b border-border"},v={class:"flex-1 overflow-y-auto px-4 py-5 md:px-6"},_=m({__name:"SettingsTabs",props:{active:{}},setup(o){return(i,e)=>(f(),p("div",b,[t("div",c,[e[2]||(e[2]=t("h2",{class:"mb-4 text-base font-semibold"},"Settings",-1)),t("div",u,[s(r(a),{to:"/skills",class:n(["-mb-px border-b-2 px-4 py-2 font-mono text-xs font-medium transition-colors",o.active==="skills"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"])},{default:d(()=>[...e[0]||(e[0]=[l(" Skills ",-1)])]),_:1},8,["class"]),s(r(a),{to:"/mcp",class:n(["-mb-px border-b-2 px-4 py-2 font-mono text-xs font-medium transition-colors",o.active==="mcp"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"])},{default:d(()=>[...e[1]||(e[1]=[l(" MCP Servers ",-1)])]),_:1},8,["class"])])]),t("div",v,[x(i.$slots,"default")])]))}});export{_};
@@ -0,0 +1 @@
1
+ import{d as I,o as P,D as q,n as m,T as D,A as _,M as G,r as i,j as r,c as d,g as $,a as e,_ as J,t as x,w as z,v as V,p as M,F as B,E as T,m as A,z as L,s as F,q as X,N as Y}from"./index-f67odrrt.js";import{_ as Z}from"./SettingsTabs.vue_vue_type_script_setup_true_lang-oW3ySu7Y.js";const ee={key:0,class:"fixed left-1/2 top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 overflow-y-auto rounded-lg border border-border bg-card p-6 max-h-[90vh]"},te={class:"mb-4 flex items-center justify-between"},oe={key:0,class:"mb-4 rounded border border-destructive/50 bg-destructive/10 p-3 text-sm text-destructive"},se={class:"mb-4"},le={class:"mb-4"},ne={class:"mb-4"},ae={class:"flex gap-2 justify-end"},re=["disabled"],ie=["disabled"],de={key:0},ue={key:1},ce=I({__name:"SkillEditModal",props:{open:{type:Boolean},skillName:{},skillSlug:{},skillDescription:{},skillContent:{}},emits:["close","save"],setup(g,{emit:y}){const l=g,a=y,u=i(""),o=i(""),b=i(""),p=i(!1),k=i("");async function N(){if(!u.value.trim()){k.value="Skill name cannot be empty";return}if(!o.value.trim()){k.value="Description cannot be empty";return}p.value=!0,k.value="";try{a("save",{name:u.value,description:o.value,content:b.value})}finally{p.value=!1}}return P(()=>{u.value=l.skillName,o.value=l.skillDescription,b.value=l.skillContent}),(w,n)=>(r(),q(G,{to:"body"},[m(D,{"enter-active-class":"duration-200 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"duration-150 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:_(()=>[g.open?(r(),d("div",{key:0,class:"fixed inset-0 z-40 bg-black/40",onClick:n[0]||(n[0]=f=>a("close"))})):$("",!0)]),_:1}),m(D,{"enter-active-class":"duration-200 ease-out","enter-from-class":"translate-y-4 opacity-0","enter-to-class":"translate-y-0 opacity-100","leave-active-class":"duration-150 ease-in","leave-from-class":"translate-y-0 opacity-100","leave-to-class":"translate-y-4 opacity-0"},{default:_(()=>[g.open?(r(),d("div",ee,[e("div",te,[n[6]||(n[6]=e("h3",{class:"text-lg font-semibold"},"Edit Skill",-1)),e("button",{class:"text-muted-foreground/40 transition-colors hover:text-foreground",onClick:n[1]||(n[1]=f=>a("close"))},[m(J,{name:"x",class:"h-5 w-5"})])]),k.value?(r(),d("div",oe,x(k.value),1)):$("",!0),e("div",se,[n[7]||(n[7]=e("label",{class:"block font-mono text-xs uppercase tracking-wider text-muted-foreground/60"},"Skill Name",-1)),z(e("input",{"onUpdate:modelValue":n[2]||(n[2]=f=>u.value=f),type:"text",class:"mt-1 w-full rounded border border-border bg-sidebar px-3 py-2 text-sm text-foreground font-mono",placeholder:"e.g., grep"},null,512),[[V,u.value]])]),e("div",le,[n[8]||(n[8]=e("label",{class:"block font-mono text-xs uppercase tracking-wider text-muted-foreground/60"},"Description",-1)),z(e("input",{"onUpdate:modelValue":n[3]||(n[3]=f=>o.value=f),type:"text",class:"mt-1 w-full rounded border border-border bg-sidebar px-3 py-2 text-sm text-foreground",placeholder:"Brief description of the skill"},null,512),[[V,o.value]])]),e("div",ne,[n[9]||(n[9]=e("label",{class:"block font-mono text-xs uppercase tracking-wider text-muted-foreground/60 mb-1"},"Content",-1)),z(e("textarea",{"onUpdate:modelValue":n[4]||(n[4]=f=>b.value=f),class:"w-full h-40 rounded border border-border bg-sidebar px-3 py-2 text-sm text-foreground font-mono",placeholder:"Skill implementation content"},null,512),[[V,b.value]])]),e("div",ae,[e("button",{class:"rounded border border-border px-4 py-2 text-sm text-muted-foreground transition-colors hover:bg-white/5 hover:text-foreground",onClick:n[5]||(n[5]=f=>a("close")),disabled:p.value}," Cancel ",8,re),e("button",{class:"rounded bg-primary/15 px-4 py-2 text-sm text-primary transition-colors hover:bg-primary/25 disabled:opacity-50",onClick:N,disabled:p.value},[p.value?(r(),d("span",de,"Saving...")):(r(),d("span",ue,"Save Changes"))],8,ie)])])):$("",!0)]),_:1})]))}}),ve={key:0,class:"fixed left-1/2 top-1/2 z-50 w-full max-w-sm -translate-x-1/2 -translate-y-1/2 rounded-lg border border-border bg-card p-6"},pe={class:"mb-4 text-sm text-muted-foreground"},fe={class:"text-foreground/80 font-mono"},me={class:"flex gap-2 justify-end"},be=I({__name:"SkillDeleteConfirmation",props:{open:{type:Boolean},skillName:{}},emits:["close","confirm"],setup(g){return(y,l)=>(r(),q(G,{to:"body"},[m(D,{"enter-active-class":"duration-200 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"duration-150 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:_(()=>[g.open?(r(),d("div",{key:0,class:"fixed inset-0 z-40 bg-black/40",onClick:l[0]||(l[0]=a=>y.$emit("close"))})):$("",!0)]),_:1}),m(D,{"enter-active-class":"duration-200 ease-out","enter-from-class":"translate-y-4 opacity-0","enter-to-class":"translate-y-0 opacity-100","leave-active-class":"duration-150 ease-in","leave-from-class":"translate-y-0 opacity-100","leave-to-class":"translate-y-4 opacity-0"},{default:_(()=>[g.open?(r(),d("div",ve,[l[5]||(l[5]=e("h3",{class:"mb-2 text-lg font-semibold"},"Delete Skill?",-1)),e("p",pe,[l[3]||(l[3]=M(" Are you sure you want to delete ",-1)),e("code",fe,x(g.skillName),1),l[4]||(l[4]=M("? This action cannot be undone. ",-1))]),e("div",me,[e("button",{class:"rounded border border-border px-4 py-2 text-sm text-muted-foreground transition-colors hover:bg-white/5 hover:text-foreground",onClick:l[1]||(l[1]=a=>y.$emit("close"))}," Cancel "),e("button",{class:"rounded bg-destructive/15 px-4 py-2 text-sm text-destructive transition-colors hover:bg-destructive/25",onClick:l[2]||(l[2]=a=>y.$emit("confirm"))}," Delete ")])])):$("",!0)]),_:1})]))}}),xe={class:"max-w-2xl space-y-6"},ge={key:0,class:"rounded border border-destructive/50 bg-destructive/10 p-3 text-sm text-destructive"},ye={class:"mb-2 flex items-center gap-2"},ke={class:"font-mono text-[10px] text-muted-foreground/40"},we={class:"overflow-hidden rounded-lg border border-border"},Ce={class:"w-36 shrink-0 break-all font-mono text-xs text-foreground/80"},$e={class:"flex-1 text-xs leading-relaxed text-muted-foreground"},he={class:"flex shrink-0 items-center gap-2"},_e=["onClick"],Se=["onClick"],De={key:0,class:"border-t border-border/50 bg-white/[0.03] px-4 py-3"},Ne={class:"mb-3 max-h-40 overflow-y-auto rounded border border-border/50 bg-sidebar p-2 font-mono text-[11px] text-foreground/60 whitespace-pre-wrap break-words"},Te={class:"flex gap-2 justify-end"},ze=I({__name:"SkillsView",setup(g){const y={"File System":"#00d9ff","Code Intelligence":"#5fff87","Git & CI":"#c4a7ff",Communication:"#ffd000"},l=i([]),a=i({}),u=i(null),o=i(null),b=i(!1),p=i(!1),k=i(!1),N=i(!1),w=i(""),n=X(()=>{const s=new Map;for(const t of l.value){const c=Y(t.name,t.path);s.set(c,[...s.get(c)??[],t])}return[...s.entries()]});async function f(){const s=await T("/api/skills");s.ok&&(l.value=(await s.json()).skills,a.value=Object.fromEntries(l.value.map(t=>[t.slug,a.value[t.slug]??!0])))}async function H(s){if(u.value===s)u.value=null,o.value=null;else{u.value=s;const t=await T(`/api/skills/${s}`);t.ok&&(o.value=await t.json())}}function K(s){a.value={...a.value,[s]:!a.value[s]}}async function Q(s){if(o.value){k.value=!0,w.value="";try{const t=await T(`/api/skills/${o.value.slug}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s.name,description:s.description,content:s.content})});if(!t.ok){const h=await t.text();w.value=h||"Failed to save skill";return}const c=l.value.findIndex(h=>{var S;return h.slug===((S=o.value)==null?void 0:S.slug)});c>=0&&(l.value[c]={...l.value[c],name:s.name,description:s.description}),o.value&&(o.value.name=s.name,o.value.description=s.description,o.value.content=s.content),b.value=!1}finally{k.value=!1}}}async function R(){if(o.value){N.value=!0,w.value="";try{const s=await T(`/api/skills/${o.value.slug}`,{method:"DELETE"});if(!s.ok){const t=await s.text();w.value=t||"Failed to delete skill";return}l.value=l.value.filter(t=>{var c;return t.slug!==((c=o.value)==null?void 0:c.slug)}),u.value=null,o.value=null,p.value=!1}finally{N.value=!1}}}return P(f),(s,t)=>{var c,h,S,O,U;return r(),d(B,null,[m(Z,{active:"skills"},{default:_(()=>[e("div",xe,[t[8]||(t[8]=e("p",{class:"text-xs text-muted-foreground"},"Enable or disable capabilities available to IO agents. Click to expand and edit skills.",-1)),w.value?(r(),d("div",ge,[M(x(w.value)+" ",1),e("button",{class:"ml-2 text-destructive/50 hover:text-destructive",onClick:t[0]||(t[0]=C=>w.value="")},"✕")])):$("",!0),(r(!0),d(B,null,A(n.value,([C,E])=>(r(),d("div",{key:C},[e("div",ye,[e("div",{class:"h-1.5 w-1.5 rounded-full",style:L({backgroundColor:y[C]??"#00d9ff"})},null,4),e("span",{class:"font-mono text-[10px] font-semibold uppercase tracking-wider",style:L({color:y[C]??"#00d9ff"})},x(C),5),t[5]||(t[5]=e("div",{class:"h-px flex-1 bg-border/40"},null,-1)),e("span",ke,x(E.filter(v=>a.value[v.slug]).length)+"/"+x(E.length),1)]),e("div",we,[(r(!0),d(B,null,A(E,(v,W)=>(r(),d("div",{key:v.slug},[e("div",{class:F(["flex items-center gap-3 bg-card px-4 py-2.5 transition-colors hover:bg-card/80",W>0?"border-t border-border/50":""])},[e("code",Ce,x(v.name),1),e("span",$e,x(v.description),1),e("div",he,[e("button",{class:"rounded border border-border px-2 py-1 font-mono text-[9px] text-muted-foreground transition-colors hover:text-primary",onClick:j=>H(v.slug)},[m(J,{name:u.value===v.slug?"chevron-up":"chevron-down",class:"h-3 w-3"},null,8,["name"])],8,_e),t[6]||(t[6]=e("span",{class:"shrink-0 font-mono text-[9px] text-muted-foreground/30"},"built-in",-1)),e("button",{type:"button",class:F(["relative h-4 w-8 shrink-0 rounded-full transition-colors",a.value[v.slug]?"bg-primary":"bg-white/10"]),onClick:j=>K(v.slug)},[e("span",{class:F(["absolute left-0.5 top-0.5 h-3 w-3 rounded-full bg-white transition-transform",a.value[v.slug]?"translate-x-4":"translate-x-0"])},null,2)],10,Se)])],2),m(D,{"enter-active-class":"duration-150 ease-out","enter-from-class":"opacity-0 -translate-y-1","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"duration-100 ease-in","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 -translate-y-1"},{default:_(()=>[u.value===v.slug&&o.value?(r(),d("div",De,[t[7]||(t[7]=e("div",{class:"mb-2 text-xs text-muted-foreground/60 font-mono uppercase tracking-wider"},"Content Preview",-1)),e("div",Ne,x(o.value.content),1),e("div",Te,[e("button",{class:"rounded border border-border px-3 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:text-primary",onClick:t[1]||(t[1]=j=>b.value=!0)}," Edit "),e("button",{class:"rounded border border-destructive/40 px-3 py-1.5 font-mono text-xs text-destructive transition-colors hover:bg-destructive/10",onClick:t[2]||(t[2]=j=>p.value=!0)}," Delete ")])])):$("",!0)]),_:2},1024)]))),128))])]))),128))])]),_:1}),m(ce,{open:b.value,"skill-name":((c=o.value)==null?void 0:c.name)??"","skill-slug":((h=o.value)==null?void 0:h.slug)??"","skill-description":((S=o.value)==null?void 0:S.description)??"","skill-content":((O=o.value)==null?void 0:O.content)??"",onClose:t[3]||(t[3]=C=>b.value=!1),onSave:Q},null,8,["open","skill-name","skill-slug","skill-description","skill-content"]),m(be,{open:p.value,"skill-name":((U=o.value)==null?void 0:U.name)??"",onClose:t[4]||(t[4]=C=>p.value=!1),onConfirm:R},null,8,["open","skill-name"])],64)}}});export{ze as default};
@@ -0,0 +1 @@
1
+ import{d as y,j as s,c as a,a as t,n as p,z as h,t as l,g as x,s as G,_ as $,A as M,T as H,r as k,q as j,b as C,B as R,C as J,F as f,m as _,D as S,o as Q,E as v,G as K,H as O,I as W,J as X}from"./index-f67odrrt.js";import{_ as T}from"./StatusIndicator.vue_vue_type_script_setup_true_lang-8U15Qp_Q.js";const Y={class:"flex items-center gap-2 rounded px-2 py-1.5 transition-colors hover:bg-white/[0.03]"},Z={class:"flex shrink-0 gap-1"},ee={key:0,class:"rounded bg-primary/10 px-1 py-0.5 font-mono text-[9px] leading-none text-primary"},te={key:1,class:"rounded bg-status-success/10 px-1 py-0.5 font-mono text-[9px] leading-none text-status-success"},se={class:"min-w-0 flex-1"},ne={key:0,class:"block truncate font-mono text-[11px] text-foreground/60"},ae={key:1,class:"font-mono text-[11px] text-muted-foreground/40"},oe={key:0,class:"mx-2 mb-1.5 rounded border border-white/[0.06] bg-white/[0.03] px-3 py-2"},re={class:"text-xs leading-relaxed text-foreground/60"},de={key:0,class:"mt-2 font-mono text-[10px] text-muted-foreground/45"},le=y({__name:"AgentRow",props:{agent:{},squadColor:{}},setup(e){const u=e,r=k(!1),i=j(()=>u.agent.charter||u.agent.role_title||"No charter available.");return(d,o)=>(s(),a("div",{class:"cursor-pointer",onClick:o[0]||(o[0]=b=>r.value=!r.value)},[t("div",Y,[p(T,{status:e.agent.status},null,8,["status"]),t("span",{class:"shrink-0 font-mono text-xs font-medium",style:h({color:e.squadColor})},l(e.agent.character_name),5),t("div",Z,[e.agent.is_lead?(s(),a("span",ee,"LEAD")):x("",!0),e.agent.is_qa?(s(),a("span",te,"QA")):x("",!0)]),t("div",se,[e.agent.current_task?(s(),a("span",ne,"↳ "+l(e.agent.current_task),1)):(s(),a("span",ae,"idle"))]),p($,{name:"chevron-down",class:G(["h-3 w-3 shrink-0 text-muted-foreground/40 transition-transform",r.value?"rotate-180":""])},null,8,["class"])]),p(H,{"enter-active-class":"duration-150 ease-out","enter-from-class":"opacity-0 -translate-y-1","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"duration-100 ease-in","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 -translate-y-1"},{default:M(()=>[r.value?(s(),a("div",oe,[o[1]||(o[1]=t("div",{class:"mb-1 font-mono text-[10px] uppercase tracking-wider text-muted-foreground/60"},"Charter",-1)),t("div",re,l(i.value),1),e.agent.role_title&&e.agent.charter?(s(),a("div",de,"Role · "+l(e.agent.role_title),1)):x("",!0)])):x("",!0)]),_:1})]))}}),ie={class:"max-w-[120px] truncate text-muted-foreground"},ce=y({__name:"InstancePill",props:{instance:{}},setup(e){const u=e,r=j(()=>J(u.instance.status));return(i,d)=>(s(),a("div",{class:"flex items-center gap-1.5 rounded border px-2 py-1 font-mono text-[10px]",style:h({borderColor:C(R)(r.value,.3),backgroundColor:C(R)(r.value,.08)})},[t("div",{class:"h-1.5 w-1.5 shrink-0 rounded-full",style:h({backgroundColor:r.value})},null,4),t("span",{style:h({color:r.value})},l(e.instance.issue_ref||e.instance.id),5),d[0]||(d[0]=t("span",{class:"text-muted-foreground/50"},"·",-1)),t("span",ie,l(e.instance.branch_name||"detached"),1)],4))}}),ue={class:"flex flex-col overflow-hidden rounded-lg border border-border bg-card"},me={class:"px-4 pb-2.5 pt-3"},xe={class:"mb-2 flex items-start justify-between gap-2"},fe={class:"flex min-w-0 items-center gap-2"},ge={class:"truncate text-sm font-semibold"},pe={key:0,class:"shrink-0 rounded-full bg-destructive px-1.5 py-0.5 font-mono text-[9px] font-bold text-white"},he={class:"truncate font-mono text-[10px] text-muted-foreground/50"},ve={class:"px-2 py-1.5"},_e={class:"px-4 py-2.5"},be={class:"mb-2 flex items-center gap-1.5 font-mono text-[10px] uppercase tracking-wider text-muted-foreground/50"},ke={class:"flex flex-wrap gap-1.5"},ye={class:"px-4 py-2.5"},qe={class:"mb-2 flex items-center gap-1.5 font-mono text-[10px] uppercase tracking-wider text-muted-foreground/50"},we={class:"space-y-1"},$e={class:"flex-1 text-foreground/60"},Ce={class:"shrink-0 font-mono text-muted-foreground/40"},Re=y({__name:"SquadCard",props:{squad:{}},setup(e){const u=e,r=j(()=>u.squad.instances.filter(i=>i.status==="running").length);return(i,d)=>(s(),a("article",ue,[t("div",{class:"h-px",style:h({backgroundColor:e.squad.color,opacity:.6})},null,4),t("div",me,[t("div",xe,[t("div",fe,[p(T,{status:e.squad.status},null,8,["status"]),t("h3",ge,l(e.squad.name),1),e.squad.unread_count>0?(s(),a("span",pe,l(e.squad.unread_count),1)):x("",!0)]),t("span",{class:"shrink-0 rounded px-1.5 py-0.5 font-mono text-[10px]",style:h({color:e.squad.color,backgroundColor:C(R)(e.squad.color,.15)})},l(e.squad.universe),5)]),t("div",he,l(e.squad.project_path),1)]),d[4]||(d[4]=t("div",{class:"mx-3 border-t border-border/50"},null,-1)),t("div",ve,[(s(!0),a(f,null,_(e.squad.agents,o=>(s(),S(le,{key:o.character_name,agent:o,"squad-color":e.squad.color},null,8,["agent","squad-color"]))),128))]),e.squad.instances.length?(s(),a(f,{key:0},[d[0]||(d[0]=t("div",{class:"mx-3 border-t border-border/50"},null,-1)),t("div",_e,[t("div",be,[p($,{name:"git-branch",class:"h-3 w-3"}),t("span",null,"Instances ("+l(r.value)+"/"+l(e.squad.instances.length)+" running)",1)]),t("div",ke,[(s(!0),a(f,null,_(e.squad.instances,o=>(s(),S(ce,{key:o.id,instance:o},null,8,["instance"]))),128))])])],64)):x("",!0),e.squad.recent_decisions.length?(s(),a(f,{key:1},[d[3]||(d[3]=t("div",{class:"mx-3 border-t border-border/50"},null,-1)),t("div",ye,[t("div",qe,[p($,{name:"sparkles",class:"h-3 w-3"}),d[1]||(d[1]=t("span",null,"Decisions",-1))]),t("div",we,[(s(!0),a(f,null,_(e.squad.recent_decisions,o=>(s(),a("div",{key:o.id,class:"flex items-baseline gap-2 text-[11px]"},[d[2]||(d[2]=t("span",{class:"shrink-0 font-mono text-muted-foreground/40"},"·",-1)),t("span",$e,l(o.title),1),t("span",Ce,l(o.timestamp),1)]))),128))])])],64)):x("",!0)]))}}),Se={class:"h-full overflow-y-auto p-5"},je={key:0,class:"mb-4 rounded-lg border border-destructive/25 bg-destructive/10 px-4 py-3 text-sm text-destructive"},Ie={key:1,class:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3"},Ae={key:2,class:"grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3"},Be={key:3,class:"flex h-full min-h-[320px] items-center justify-center rounded-lg border border-dashed border-border bg-card/30 font-mono text-xs uppercase tracking-[0.22em] text-muted-foreground/55"},Ee=y({__name:"SquadsView",setup(e){const u=k(!1),r=k(""),i=k([]);async function d(){u.value=!0,r.value="";try{const[o,b]=await Promise.all([v("/api/squads"),v("/api/feed?limit=200")]),g=o.ok?(await o.json()).squads:[],q=new Map;if(b.ok){const m=(await b.json()).entries;for(const c of m)!c.read_at&&c.squad_slug&&q.set(c.squad_slug,(q.get(c.squad_slug)??0)+1)}i.value=await Promise.all(g.map(async m=>{var E;const c=m.slug??m.id??m.name.toLowerCase().replace(/\s+/g,"-"),[I,A]=await Promise.all([v(`/api/squads/${encodeURIComponent(c)}/agents`),v(`/api/squads/${encodeURIComponent(c)}/instances`)]),U=I.ok?(await I.json()).agents:[],F=A.ok?(await A.json()).instances:[],B=U.map(n=>({character_name:n.character_name??"Unnamed Agent",role_title:n.role_title,charter:n.charter??n.role_title,model_tier:n.model_tier??(n.is_lead?"high":"medium"),status:K(n.status),is_lead:!!n.is_lead,is_qa:!!n.is_qa,current_task:n.currentTask??n.current_task??null})),w=F.map(n=>({id:String(n.id),issue_ref:n.issue_ref,branch_name:n.branch_name,status:O(n.status),worktree_path:n.worktree_path})),z=await Promise.all(w.slice(0,3).map(n=>v(`/api/squads/${encodeURIComponent(c)}/instances/${encodeURIComponent(n.id)}`))),D=[];for(let n=0;n<z.length;n+=1){const N=z[n];if(!N.ok)continue;const V=await N.json();for(const[L,P]of(V.decisions??[]).slice(0,3).entries())D.push({id:`${((E=w[n])==null?void 0:E.id)??n}-${L}`,title:P.decision??"Decision recorded",timestamp:W(P.created_at)})}return{id:m.id??c,slug:c,name:m.name,project_path:m.project_path??"—",universe:m.universe??"Ghostbusters",status:X(B,m),unread_count:q.get(c)??0,agents:B,instances:w,recent_decisions:D.slice(0,4)}}))}catch(o){r.value=o instanceof Error?o.message:"Failed to load squads.",i.value=[]}finally{u.value=!1}}return Q(d),(o,b)=>(s(),a("div",Se,[r.value?(s(),a("div",je,l(r.value),1)):x("",!0),u.value&&!i.value.length?(s(),a("div",Ie,[(s(),a(f,null,_(6,g=>t("div",{key:g,class:"h-64 animate-pulse rounded-lg border border-border bg-card/60"})),64))])):i.value.length?(s(),a("div",Ae,[(s(!0),a(f,null,_(i.value,g=>(s(),S(Re,{key:g.id,squad:g},null,8,["squad"]))),128))])):(s(),a("div",Be," No squads discovered. "))]))}});export{Ee as default};
@@ -0,0 +1 @@
1
+ import{d as r,j as s,c as t,F as l,a}from"./index-f67odrrt.js";const u={class:"relative flex h-3 w-3 shrink-0 items-center justify-center"},d={key:1,class:"status-error-dot h-2 w-2 rounded-full bg-status-error",style:{boxShadow:"var(--glow-error)"}},n={key:2,class:"h-2 w-2 rounded-full bg-status-success",style:{boxShadow:"var(--glow-success)"}},c={key:3,class:"h-2 w-2 rounded-full bg-status-idle opacity-40"},g=r({__name:"StatusIndicator",props:{status:{default:"idle"}},setup(o){return(i,e)=>(s(),t("div",u,[o.status==="working"?(s(),t(l,{key:0},[e[0]||(e[0]=a("div",{class:"status-working-ring absolute h-3 w-3 rounded-full bg-status-working",style:{boxShadow:"var(--glow-success)"}},null,-1)),e[1]||(e[1]=a("div",{class:"h-2 w-2 rounded-full bg-status-working",style:{boxShadow:"var(--glow-success)"}},null,-1))],64)):o.status==="error"?(s(),t("div",d)):o.status==="success"?(s(),t("div",n)):(s(),t("div",c))]))}});export{g as _};
@@ -0,0 +1 @@
1
+ import{d as V,j as s,c as r,z as _,n as d,_ as h,s as L,p as j,t as k,T as C,A as T,F as E,m as M,D,g as w,r as c,O as J,o as R,M as q,E as S,a as t,w as U,P as Q,v as N,l as G,b as K,x as X,q as O,Q as Z}from"./index-f67odrrt.js";const ee={key:0,class:"overflow-hidden"},I=V({__name:"WikiTreeNode",props:{node:{},selectedPath:{},depth:{default:0}},emits:["select"],setup(a,{emit:f}){const o=f,n=c(!0);return(b,u)=>{const y=J("WikiTreeNode",!0);return s(),r("div",null,[a.node.children.length?(s(),r("button",{key:0,class:"flex w-full items-center gap-1.5 rounded px-2 py-1 text-left font-mono text-xs uppercase tracking-wider text-muted-foreground/70 transition-colors hover:bg-white/[0.03]",style:_({paddingLeft:`${a.depth*12+8}px`}),onClick:u[0]||(u[0]=v=>n.value=!n.value)},[d(h,{name:"chevron-right",class:L(["h-3 w-3 shrink-0 transition-transform",n.value?"rotate-90":""])},null,8,["class"]),j(" "+k(a.node.label),1)],4)):(s(),r("button",{key:1,class:L(["flex w-full items-center gap-1.5 rounded px-2 py-1.5 text-left text-xs transition-colors",a.selectedPath===a.node.path?"bg-primary/10 text-primary":"text-foreground/60 hover:bg-white/[0.03] hover:text-foreground"]),style:_({paddingLeft:`${a.depth*12+8}px`}),onClick:u[1]||(u[1]=v=>a.node.path&&o("select",a.node.path))},k(a.node.label),7)),d(C,{"enter-active-class":"duration-150 ease-out","enter-from-class":"opacity-0 -translate-y-1","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"duration-100 ease-in","leave-from-class":"opacity-100 translate-y-0","leave-to-class":"opacity-0 -translate-y-1"},{default:T(()=>[a.node.children.length&&n.value?(s(),r("div",ee,[(s(!0),r(E,null,M(a.node.children,v=>(s(),D(y,{key:v.id,node:v,"selected-path":a.selectedPath,depth:a.depth+1,onSelect:u[2]||(u[2]=g=>o("select",g))},null,8,["node","selected-path","depth"]))),128))])):w("",!0)]),_:1})])}}}),te={key:0,class:"fixed left-1/2 top-1/2 z-50 w-full max-w-lg -translate-x-1/2 -translate-y-1/2 rounded-lg border border-border bg-card p-6"},oe={class:"mb-4 flex items-center justify-between"},se={key:0,class:"mb-4 rounded border border-destructive/50 bg-destructive/10 p-3 text-sm text-destructive"},ae={class:"mb-4"},ne=["value"],le={class:"mb-4"},re=["value"],ie={class:"mb-4"},de={class:"flex gap-2 justify-end"},ue=["disabled"],ce=["disabled"],ve={key:0},pe={key:1},fe=V({__name:"WikiEditModal",props:{open:{type:Boolean},path:{},content:{}},emits:["close","save"],setup(a,{emit:f}){const o=a,n=f,b=c(""),u=c(""),y=c([]),v=c(!1),g=c("");async function z(){const P=await S("/api/wiki-categories");P.ok&&(y.value=(await P.json()).categories)}async function m(){if(!b.value.trim()){g.value="Content cannot be empty";return}v.value=!0,g.value="";try{n("save",{content:b.value,category:u.value})}finally{v.value=!1}}return R(()=>{z(),b.value=o.content}),(P,l)=>(s(),D(q,{to:"body"},[d(C,{"enter-active-class":"duration-200 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"duration-150 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:T(()=>[a.open?(s(),r("div",{key:0,class:"fixed inset-0 z-40 bg-black/40",onClick:l[0]||(l[0]=x=>n("close"))})):w("",!0)]),_:1}),d(C,{"enter-active-class":"duration-200 ease-out","enter-from-class":"translate-y-4 opacity-0","enter-to-class":"translate-y-0 opacity-100","leave-active-class":"duration-150 ease-in","leave-from-class":"translate-y-0 opacity-100","leave-to-class":"translate-y-4 opacity-0"},{default:T(()=>[a.open?(s(),r("div",te,[t("div",oe,[l[5]||(l[5]=t("h3",{class:"text-lg font-semibold"},"Edit Wiki Page",-1)),t("button",{class:"text-muted-foreground/40 transition-colors hover:text-foreground",onClick:l[1]||(l[1]=x=>n("close"))},[d(h,{name:"x",class:"h-5 w-5"})])]),g.value?(s(),r("div",se,k(g.value),1)):w("",!0),t("div",ae,[l[6]||(l[6]=t("label",{class:"block font-mono text-xs uppercase tracking-wider text-muted-foreground/60"},"Page Path",-1)),t("input",{type:"text",value:a.path,disabled:"",class:"mt-1 w-full rounded border border-border bg-sidebar px-3 py-2 text-sm text-foreground/50 font-mono"},null,8,ne)]),t("div",le,[l[8]||(l[8]=t("label",{class:"block font-mono text-xs uppercase tracking-wider text-muted-foreground/60"},"Category",-1)),U(t("select",{"onUpdate:modelValue":l[2]||(l[2]=x=>u.value=x),class:"mt-1 w-full rounded border border-border bg-sidebar px-3 py-2 text-sm text-foreground font-mono"},[l[7]||(l[7]=t("option",{value:""},"Uncategorized",-1)),(s(!0),r(E,null,M(y.value,x=>(s(),r("option",{key:x,value:x},k(x),9,re))),128))],512),[[Q,u.value]])]),t("div",ie,[l[9]||(l[9]=t("label",{class:"block font-mono text-xs uppercase tracking-wider text-muted-foreground/60 mb-1"},"Content",-1)),U(t("textarea",{"onUpdate:modelValue":l[3]||(l[3]=x=>b.value=x),class:"w-full h-48 rounded border border-border bg-sidebar px-3 py-2 text-sm text-foreground font-mono",placeholder:"Enter wiki content (markdown supported)"},null,512),[[N,b.value]])]),t("div",de,[t("button",{class:"rounded border border-border px-4 py-2 text-sm text-muted-foreground transition-colors hover:bg-white/5 hover:text-foreground",onClick:l[4]||(l[4]=x=>n("close")),disabled:v.value}," Cancel ",8,ue),t("button",{class:"rounded bg-primary/15 px-4 py-2 text-sm text-primary transition-colors hover:bg-primary/25 disabled:opacity-50",onClick:m,disabled:v.value},[v.value?(s(),r("span",ve,"Saving...")):(s(),r("span",pe,"Save Changes"))],8,ce)])])):w("",!0)]),_:1})]))}}),me={key:0,class:"fixed left-1/2 top-1/2 z-50 w-full max-w-sm -translate-x-1/2 -translate-y-1/2 rounded-lg border border-border bg-card p-6"},xe={class:"mb-4 text-sm text-muted-foreground"},be={class:"text-foreground/80 font-mono"},ye={class:"flex gap-2 justify-end"},ge=V({__name:"WikiDeleteConfirmation",props:{open:{type:Boolean},path:{}},emits:["close","confirm"],setup(a){return(f,o)=>(s(),D(q,{to:"body"},[d(C,{"enter-active-class":"duration-200 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"duration-150 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:T(()=>[a.open?(s(),r("div",{key:0,class:"fixed inset-0 z-40 bg-black/40",onClick:o[0]||(o[0]=n=>f.$emit("close"))})):w("",!0)]),_:1}),d(C,{"enter-active-class":"duration-200 ease-out","enter-from-class":"translate-y-4 opacity-0","enter-to-class":"translate-y-0 opacity-100","leave-active-class":"duration-150 ease-in","leave-from-class":"translate-y-0 opacity-100","leave-to-class":"translate-y-4 opacity-0"},{default:T(()=>[a.open?(s(),r("div",me,[o[5]||(o[5]=t("h3",{class:"mb-2 text-lg font-semibold"},"Delete Wiki Page?",-1)),t("p",xe,[o[3]||(o[3]=j(" Are you sure you want to delete ",-1)),t("code",be,k(a.path),1),o[4]||(o[4]=j("? This action cannot be undone. ",-1))]),t("div",ye,[t("button",{class:"rounded border border-border px-4 py-2 text-sm text-muted-foreground transition-colors hover:bg-white/5 hover:text-foreground",onClick:o[1]||(o[1]=n=>f.$emit("close"))}," Cancel "),t("button",{class:"rounded bg-destructive/15 px-4 py-2 text-sm text-destructive transition-colors hover:bg-destructive/25",onClick:o[2]||(o[2]=n=>f.$emit("confirm"))}," Delete ")])])):w("",!0)]),_:1})]))}}),he={class:"relative flex h-full flex-col overflow-hidden md:flex-row"},ke={class:"flex shrink-0 items-center gap-2 border-b border-border bg-sidebar px-4 py-2 md:hidden"},we={key:0,class:"absolute left-0 right-0 top-[calc(2.75rem+2.75rem)] z-20 max-h-[60vh] overflow-y-auto border-b border-border bg-sidebar px-2 py-3 md:hidden"},$e={class:"hidden w-52 shrink-0 overflow-y-auto border-r border-border px-2 py-4 md:block"},Ce={class:"flex-1 flex flex-col overflow-hidden"},Te={key:0,class:"flex shrink-0 items-center justify-between border-b border-border bg-sidebar px-4 py-3"},Pe={class:"flex items-center gap-2"},Se={class:"font-mono text-xs text-muted-foreground/70 truncate"},je={class:"flex gap-2"},De={key:1,class:"flex shrink-0 items-center gap-2 border-b border-destructive/50 bg-destructive/10 px-4 py-2"},ze={class:"flex-1 text-xs text-destructive"},Ee={class:"flex-1 overflow-y-auto"},Me={key:0,class:"max-w-2xl px-4 py-5 md:px-8 md:py-6"},Ue={class:"mb-5 text-xl font-semibold"},Ve=["innerHTML"],We={key:1,class:"flex h-full items-center justify-center font-mono text-sm text-muted-foreground/40"},Ne=V({__name:"WikiView",setup(a){const f=c([]),o=c(""),n=c(null),b=c(""),u=c(!1),y=c(!1),v=c(!1),g=c(!1),z=c(!1),m=c(""),P=O(()=>{const i=b.value.trim().toLowerCase();return i?f.value.filter(e=>`${e.path} ${e.title}`.toLowerCase().includes(i)):f.value}),l=O(()=>Z(P.value));async function x(){const i=await S("/api/wiki");i.ok&&(f.value=(await i.json()).pages,!o.value&&f.value[0]&&(o.value=f.value[0].path))}async function F(i){if(!i)return;const e=await S(`/api/wiki/${encodeURIComponent(i)}`);if(!e.ok){n.value=null;return}n.value=await e.json()}function A(i){o.value=i,u.value=!1,m.value=""}async function H(i){g.value=!0,m.value="";try{const e=await S(`/api/wiki/${encodeURIComponent(o.value)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:i.content,category:i.category||null})});if(!e.ok){const $=await e.text();e.status===404?m.value="Page not found":e.status===403?m.value="You do not have permission to edit this page":m.value=$||"Failed to save page";return}await F(o.value),y.value=!1}finally{g.value=!1}}async function Y(){var i;z.value=!0,m.value="";try{const e=await S(`/api/wiki/${encodeURIComponent(o.value)}`,{method:"DELETE"});if(!e.ok){const $=await e.text();e.status===404?m.value="Page not found":e.status===403?m.value="You do not have permission to delete this page":m.value=$||"Failed to delete page";return}await x(),o.value=((i=f.value[0])==null?void 0:i.path)??"",n.value=null,v.value=!1}finally{z.value=!1}}return G(o,i=>{F(i)}),R(x),(i,e)=>{var $,B;return s(),r("div",he,[t("div",ke,[t("button",{class:"flex items-center gap-1.5 rounded border border-border px-3 py-1.5 font-mono text-xs text-muted-foreground transition-colors hover:bg-white/5 hover:text-foreground",onClick:e[0]||(e[0]=p=>u.value=!u.value)},[d(h,{name:"book",class:"h-3.5 w-3.5"}),t("span",null,k((($=n.value)==null?void 0:$.path)??"Pages"),1),d(h,{name:"chevron-down",class:L(["h-3 w-3 transition-transform",u.value?"rotate-180":""])},null,8,["class"])])]),d(C,{"enter-active-class":"duration-200 ease-out","enter-from-class":"-translate-y-2 opacity-0","enter-to-class":"translate-y-0 opacity-100","leave-active-class":"duration-150 ease-in","leave-from-class":"translate-y-0 opacity-100","leave-to-class":"-translate-y-2 opacity-0"},{default:T(()=>[u.value?(s(),r("div",we,[U(t("input",{"onUpdate:modelValue":e[1]||(e[1]=p=>b.value=p),class:"mb-3 w-full rounded border border-border bg-card px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/35",placeholder:"Filter pages"},null,512),[[N,b.value]]),(s(!0),r(E,null,M(l.value,p=>(s(),D(I,{key:p.id,node:p,"selected-path":o.value,onSelect:e[2]||(e[2]=W=>A(W))},null,8,["node","selected-path"]))),128))])):w("",!0)]),_:1}),t("aside",$e,[U(t("input",{"onUpdate:modelValue":e[3]||(e[3]=p=>b.value=p),class:"mb-3 w-full rounded border border-border bg-sidebar px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground/35",placeholder:"Filter pages"},null,512),[[N,b.value]]),(s(!0),r(E,null,M(l.value,p=>(s(),D(I,{key:p.id,node:p,"selected-path":o.value,onSelect:e[4]||(e[4]=W=>o.value=W)},null,8,["node","selected-path"]))),128))]),t("section",Ce,[n.value?(s(),r("div",Te,[t("div",Pe,[d(h,{name:"book",class:"h-4 w-4 text-muted-foreground/50"}),t("span",Se,k(n.value.path),1)]),t("div",je,[t("button",{class:"flex items-center gap-1.5 rounded border border-border px-3 py-1.5 text-xs font-mono text-muted-foreground transition-colors hover:border-primary/40 hover:bg-primary/5 hover:text-primary",onClick:e[5]||(e[5]=p=>y.value=!0)},[d(h,{name:"pencil",class:"h-3 w-3"}),e[10]||(e[10]=j(" Edit ",-1))]),t("button",{class:"flex items-center gap-1.5 rounded border border-destructive/40 px-3 py-1.5 text-xs font-mono text-destructive transition-colors hover:bg-destructive/10",onClick:e[6]||(e[6]=p=>v.value=!0)},[d(h,{name:"trash",class:"h-3 w-3"}),e[11]||(e[11]=j(" Delete ",-1))])])])):w("",!0),m.value?(s(),r("div",De,[d(h,{name:"alert-circle",class:"h-4 w-4 text-destructive"}),t("span",ze,k(m.value),1),t("button",{class:"text-destructive/50 hover:text-destructive",onClick:e[7]||(e[7]=p=>m.value="")},[d(h,{name:"x",class:"h-3 w-3"})])])):w("",!0),t("div",Ee,[n.value?(s(),r("div",Me,[t("h2",Ue,k(n.value.path),1),t("div",{class:"wiki-content",innerHTML:K(X)(n.value.content)},null,8,Ve)])):(s(),r("div",We,"Select an article"))])]),d(fe,{open:y.value,path:o.value,content:((B=n.value)==null?void 0:B.content)??"",onClose:e[8]||(e[8]=p=>y.value=!1),onSave:H},null,8,["open","path","content"]),d(ge,{open:v.value,path:o.value,onClose:e[9]||(e[9]=p=>v.value=!1),onConfirm:Y},null,8,["open","path"])])}}});export{Ne as default};