heyio 1.5.4 → 1.6.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 (38) hide show
  1. package/dist/copilot/agents.js +17 -3
  2. package/dist/copilot/gh-token.js +27 -17
  3. package/dist/copilot/orchestrator.js +32 -21
  4. package/dist/copilot/system-message.js +12 -0
  5. package/dist/mcp/registry.js +1 -0
  6. package/package.json +1 -1
  7. package/web-dist/assets/{AuditLogView-NwOkyMb3.js → AuditLogView-BPJtNXCS.js} +1 -1
  8. package/web-dist/assets/ChatView-Brk1nps-.js +11 -0
  9. package/web-dist/assets/{FeedView--RgZv0Fp.js → FeedView-DtpTOb4B.js} +1 -1
  10. package/web-dist/assets/{HistoryView-D8DoZMwH.js → HistoryView-CErxUNk_.js} +1 -1
  11. package/web-dist/assets/{LoginView-BkbYMBhW.js → LoginView-CWiUkg95.js} +1 -1
  12. package/web-dist/assets/McpView-C-td_je_.js +1 -0
  13. package/web-dist/assets/SchedulesView-DAcPfnmZ.js +6 -0
  14. package/web-dist/assets/{SettingsView-Dd835515.js → SettingsView-559gPpax.js} +1 -1
  15. package/web-dist/assets/{SkillsView-DBw8OXU2.js → SkillsView-DtnR6ZeP.js} +1 -1
  16. package/web-dist/assets/{SquadDetailView-BMxPW9wb.js → SquadDetailView-HYYd2HvB.js} +1 -1
  17. package/web-dist/assets/{SquadHealthView-DiaNJ5Fj.js → SquadHealthView-Dt_cBi_C.js} +1 -1
  18. package/web-dist/assets/{SquadsView-mSdbiuao.js → SquadsView-DdywGIi2.js} +1 -1
  19. package/web-dist/assets/ToggleSwitch.vue_vue_type_script_setup_true_lang-qLsSQnXV.js +1 -0
  20. package/web-dist/assets/{UsageView-gaILOX-n.js → UsageView-Dhuu6mVo.js} +1 -1
  21. package/web-dist/assets/{WikiView-C7Igna0s.js → WikiView-DWun-CTD.js} +1 -1
  22. package/web-dist/assets/{api-CKoqb3Uc.js → api-CdLJWHnn.js} +1 -1
  23. package/web-dist/assets/{arrow-left-DB67XHhN.js → arrow-left-27p7HUxd.js} +1 -1
  24. package/web-dist/assets/{file-text-G4fJOXsY.js → file-text-Dk0fT3q_.js} +1 -1
  25. package/web-dist/assets/{git-branch-BYVsshPr.js → git-branch-D5N3GVQo.js} +1 -1
  26. package/web-dist/assets/{index-BOXcmvk8.js → index-CZM0UQQJ.js} +32 -32
  27. package/web-dist/assets/index-CoyYyx4A.css +1 -0
  28. package/web-dist/assets/{plus-DgKU-0vm.js → plus-CoUrXVZm.js} +1 -1
  29. package/web-dist/assets/{save-C44cl5KP.js → save-CttKqFu3.js} +1 -1
  30. package/web-dist/assets/{search-CM4X0KHN.js → search-CMwjTbNl.js} +1 -1
  31. package/web-dist/assets/{trash-2-D8LQMu7D.js → trash-2-C1-PiQou.js} +1 -1
  32. package/web-dist/assets/{triangle-alert-CTfkTIuU.js → triangle-alert-BKZFqU_A.js} +1 -1
  33. package/web-dist/assets/{x-vkAu6_RE.js → x-D82kR2fu.js} +1 -1
  34. package/web-dist/index.html +2 -2
  35. package/web-dist/assets/ChatView-Bs4_ex3x.js +0 -11
  36. package/web-dist/assets/McpView-CDKLXC-c.js +0 -1
  37. package/web-dist/assets/SchedulesView-rTyYBi2M.js +0 -6
  38. package/web-dist/assets/index-Cd9kiyp4.css +0 -1
@@ -120,13 +120,28 @@ export async function delegateTask(squadId, task, instanceId, attachments = [])
120
120
  }
121
121
  }
122
122
  if (pageContents.length > 0) {
123
- wikiKnowledge = `\n## Squad Knowledge Base\nThe following wiki pages contain important decisions, conventions, and context for this squad. Follow these as authoritative guidance:\n\n${pageContents.join("\n\n---\n\n")}\n`;
123
+ wikiKnowledge = `\n## ⚠️ MANDATORY SQUAD RULES & KNOWLEDGE\nYou MUST follow these rules in ALL work. These are non-negotiable constraints set by the project owner. Violating them is a critical failure.\n\n${pageContents.join("\n\n---\n\n")}\n`;
124
124
  }
125
125
  }
126
126
  catch {
127
127
  // Wiki not available — proceed without
128
128
  }
129
129
  const systemMessage = `# Squad Team Lead: ${lead.character_name}
130
+ ${wikiKnowledge}
131
+ ## 🚨 CRITICAL SECURITY RULE — ABSOLUTE, NON-NEGOTIABLE 🚨
132
+
133
+ You must NEVER expose secrets, credentials, or sensitive values in ANY publicly visible location. This includes:
134
+ - GitHub issues, pull requests, PR descriptions, comments, or commit messages
135
+ - Log output, error messages, or stack traces shared externally
136
+ - Wiki pages, feed items, or any content viewable by others
137
+
138
+ What counts as a secret: API keys, access tokens, passwords, connection strings, environment variable values, private config file contents, SSH keys, certificates, webhook URLs with tokens.
139
+
140
+ If you need to reference that a secret exists, use \`<REDACTED>\` or \`***\` as a placeholder. NEVER include the actual value.
141
+
142
+ Violation of this rule is a HARD FAILURE — no exceptions, no workarounds, no "just this once."
143
+
144
+ ## Identity & Role
130
145
 
131
146
  You are ${lead.character_name}, the team lead for this squad. Your role is STRICTLY coordination — you do NOT write code, tests, or implementation of any kind.
132
147
 
@@ -154,8 +169,7 @@ ${agentRoster}
154
169
  - Always use the gh CLI for GitHub interactions
155
170
  - Merge criteria: all veto-capable members have posted approving comments + CI passes + no conflicts
156
171
  - When work is complete, ALWAYS notify the user via feed_post with a summary of what was done
157
- - Consult the squad wiki (wiki_read, wiki_search) for additional context beyond what's provided below
158
- ${wikiKnowledge}
172
+ - Consult the squad wiki (wiki_read, wiki_search) for additional context when needed
159
173
  ${lead.persona ? `## Personality:\n${lead.persona}` : ""}
160
174
  `;
161
175
  let result;
@@ -1,50 +1,60 @@
1
1
  import { execSync } from "node:child_process";
2
- import { loadConfig } from "../config.js";
2
+ import { loadConfig, resetConfigCache } from "../config.js";
3
3
  /**
4
4
  * Cached GitHub token for CLI operations.
5
5
  * Resolution order: GH_TOKEN env → GITHUB_TOKEN env → config.githubToken → `gh auth token` CLI.
6
- * Resolved once at first access and cached for the lifetime of the process.
6
+ * If no token found, retries on next call (config may have been updated).
7
7
  */
8
8
  let cachedToken;
9
9
  let resolved = false;
10
10
  export function getGhToken() {
11
- if (resolved)
11
+ if (resolved && cachedToken)
12
12
  return cachedToken;
13
- resolved = true;
14
13
  // 1. Prefer explicit env vars
15
14
  if (process.env.GH_TOKEN) {
16
15
  cachedToken = process.env.GH_TOKEN;
16
+ resolved = true;
17
17
  return cachedToken;
18
18
  }
19
19
  if (process.env.GITHUB_TOKEN) {
20
20
  cachedToken = process.env.GITHUB_TOKEN;
21
+ resolved = true;
21
22
  return cachedToken;
22
23
  }
23
- // 2. Check IO config file
24
+ // 2. Check IO config file (re-read in case it was updated since last attempt)
24
25
  try {
26
+ if (!cachedToken)
27
+ resetConfigCache();
25
28
  const config = loadConfig();
26
29
  if (config.githubToken) {
27
30
  cachedToken = config.githubToken;
31
+ resolved = true;
28
32
  return cachedToken;
29
33
  }
30
34
  }
31
35
  catch {
32
36
  // Config not available
33
37
  }
34
- // 3. Try extracting from gh CLI auth
35
- try {
36
- const token = execSync("gh auth token", {
37
- timeout: 5_000,
38
- encoding: "utf-8",
39
- stdio: ["pipe", "pipe", "pipe"],
40
- }).trim();
41
- if (token) {
42
- cachedToken = token;
38
+ // 3. Try extracting from gh CLI auth (only on first attempt)
39
+ if (!resolved) {
40
+ try {
41
+ const token = execSync("gh auth token", {
42
+ timeout: 5_000,
43
+ encoding: "utf-8",
44
+ stdio: ["pipe", "pipe", "pipe"],
45
+ }).trim();
46
+ if (token) {
47
+ cachedToken = token;
48
+ resolved = true;
49
+ }
50
+ }
51
+ catch {
52
+ // gh not available or not authenticated
43
53
  }
44
54
  }
45
- catch {
46
- // gh not available or not authenticated
47
- }
55
+ // Mark resolved only if we found a token — otherwise retry next call
56
+ if (cachedToken)
57
+ resolved = true;
48
58
  return cachedToken;
49
59
  }
50
60
  //# sourceMappingURL=gh-token.js.map
@@ -8,6 +8,7 @@ import { getMcpServersForSession } from "../mcp/registry.js";
8
8
  import { resetClient } from "./client.js";
9
9
  import { addAuditEntry } from "../store/audit-log.js";
10
10
  import { buildAttachmentSummary, buildAttachmentPathSummary, saveAttachmentsToDisk, toCopilotBlobAttachments, } from "../chat/attachments.js";
11
+ import { attachTokenTracker } from "./token-tracker.js";
11
12
  let orchestratorSession;
12
13
  let sessionCreatePromise;
13
14
  let healthCheckInterval;
@@ -56,16 +57,18 @@ async function createOrResumeSession(client, opts) {
56
57
  bufferExhaustionThreshold: 0.95,
57
58
  },
58
59
  };
60
+ let session;
59
61
  if (savedId?.value) {
60
62
  try {
61
- const session = await client.resumeSession(savedId.value, sessionConfig);
62
- return session;
63
+ session = await client.resumeSession(savedId.value, sessionConfig);
63
64
  }
64
65
  catch {
65
- // Resume failed, create new
66
+ session = await client.createSession(sessionConfig);
66
67
  }
67
68
  }
68
- const session = await client.createSession(sessionConfig);
69
+ else {
70
+ session = await client.createSession(sessionConfig);
71
+ }
69
72
  // Persist session ID
70
73
  db.prepare("INSERT OR REPLACE INTO session_state (key, value) VALUES ('orchestrator_session_id', ?)").run(session.sessionId);
71
74
  return session;
@@ -120,27 +123,35 @@ async function executeOnSession(msg) {
120
123
  return;
121
124
  }
122
125
  activeMessageAttachments = msg.attachments;
123
- // Save attachments to disk so orchestrator/squads can access them via filesystem tools
124
- const savedAttachments = saveAttachmentsToDisk(msg.attachments);
125
- const pathSummary = buildAttachmentPathSummary(savedAttachments);
126
- const taggedPrompt = `[via ${msg.source}] ${msg.prompt}${pathSummary || buildAttachmentSummary(msg.attachments)}`;
127
- let accumulated = "";
128
- const unsubscribe = orchestratorSession.on("assistant.message_delta", (event) => {
129
- const delta = event.data?.deltaContent ?? "";
130
- accumulated += delta;
131
- msg.callback(accumulated, false);
126
+ const flushTokens = attachTokenTracker(orchestratorSession, {
127
+ agentId: "orchestrator",
132
128
  });
133
129
  try {
134
- const response = await orchestratorSession.sendAndWait({
135
- prompt: taggedPrompt,
136
- attachments: toCopilotBlobAttachments(msg.attachments),
137
- }, 600_000);
138
- const finalContent = response?.data?.content ?? accumulated;
139
- msg.callback(finalContent, true);
130
+ // Save attachments to disk so orchestrator/squads can access them via filesystem tools
131
+ const savedAttachments = saveAttachmentsToDisk(msg.attachments);
132
+ const pathSummary = buildAttachmentPathSummary(savedAttachments);
133
+ const taggedPrompt = `[via ${msg.source}] ${msg.prompt}${pathSummary || buildAttachmentSummary(msg.attachments)}`;
134
+ let accumulated = "";
135
+ const unsubscribe = orchestratorSession.on("assistant.message_delta", (event) => {
136
+ const delta = event.data?.deltaContent ?? "";
137
+ accumulated += delta;
138
+ msg.callback(accumulated, false);
139
+ });
140
+ try {
141
+ const response = await orchestratorSession.sendAndWait({
142
+ prompt: taggedPrompt,
143
+ attachments: toCopilotBlobAttachments(msg.attachments),
144
+ }, 600_000);
145
+ const finalContent = response?.data?.content ?? accumulated;
146
+ msg.callback(finalContent, true);
147
+ }
148
+ finally {
149
+ activeMessageAttachments = [];
150
+ unsubscribe();
151
+ }
140
152
  }
141
153
  finally {
142
- activeMessageAttachments = [];
143
- unsubscribe();
154
+ flushTokens();
144
155
  }
145
156
  }
146
157
  export function feedAgentResult(taskId, agentName, result, callback) {
@@ -20,6 +20,18 @@ You are IO, a personal AI assistant daemon. You run 24/7 on the user's machine,
20
20
  - Schedule recurring tasks and stand-ups
21
21
  - Connect to external tools via MCP servers
22
22
 
23
+ ## 🚨 CRITICAL SECURITY RULE — ABSOLUTE, NON-NEGOTIABLE 🚨
24
+ You must NEVER expose secrets, credentials, or sensitive values in ANY publicly visible location. This includes:
25
+ - GitHub issues, pull requests, PR descriptions, comments, or commit messages
26
+ - Log output, error messages, or stack traces shared externally
27
+ - Wiki pages, feed items, or any content viewable by others
28
+
29
+ What counts as a secret: API keys, access tokens, passwords, connection strings, environment variable values, private config file contents (supabaseAnonKey, telegramToken, etc.), SSH keys, certificates, webhook URLs with tokens.
30
+
31
+ If you need to reference that a secret exists, use \`<REDACTED>\` or \`***\` as a placeholder. NEVER include the actual value.
32
+
33
+ Violation of this rule is a HARD FAILURE — no exceptions, no workarounds, no "just this once."
34
+
23
35
  ## Behavioral Rules
24
36
  - Always pull latest before starting any code work (git fetch origin && git checkout main && git pull origin main)
25
37
  - Always delegate code work to the relevant squad — never implement directly
@@ -14,6 +14,7 @@ export function getMcpServersForSession() {
14
14
  type: "local",
15
15
  command: server.command,
16
16
  args: server.args ?? [],
17
+ env: server.env,
17
18
  tools: ["*"],
18
19
  };
19
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heyio",
3
- "version": "1.5.4",
3
+ "version": "1.6.0",
4
4
  "description": "IO — a personal AI assistant daemon built on the GitHub Copilot SDK",
5
5
  "bin": {
6
6
  "io": "dist/index.js"
@@ -1,4 +1,4 @@
1
- import{l as W,o as X,s as Z,u as a,k as d,h as o,n as P,D as A,a as V,m as S,z as l,T as f,N as T,F as h,w,O as F,j as b,v as n,g as _,q as ee}from"./index-BOXcmvk8.js";import{b as L}from"./api-CKoqb3Uc.js";/**
1
+ import{l as W,o as X,s as Z,u as a,k as d,h as o,n as P,D as A,a as V,m as S,z as l,T as f,N as T,F as h,w,O as F,j as b,v as n,g as _,q as ee}from"./index-CZM0UQQJ.js";import{b as L}from"./api-CdLJWHnn.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1,11 @@
1
+ import{l as U,o as R,G as W,Q as B,s as Y,u as a,k as l,h as r,D as t,n as T,j as y,F as A,w as S,z as v,T as G,O as Q,i as h,S as J,d as Z,q as k,v as x,g as I,_ as ee,f as te,p as z}from"./index-CZM0UQQJ.js";import{F as E}from"./file-text-Dk0fT3q_.js";import{X as se}from"./x-D82kR2fu.js";/**
2
+ * @license lucide-vue-next v0.474.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const F=U("ImageIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
7
+ * @license lucide-vue-next v0.474.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const ae=U("PaperclipIcon",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]),L=10*1024*1024,P=25*1024*1024;function _(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function D(n){return n.mimeType.startsWith("image/")}function ne(n){return`data:${n.mimeType};base64,${n.content}`}async function oe(n){const i=await new Promise((d,g)=>{const m=new FileReader;m.onload=()=>d(String(m.result??"")),m.onerror=()=>g(new Error("Unable to read file")),m.readAsDataURL(n)}),c=i.indexOf(",");if(c===-1)throw new Error(`Unable to parse file content for ${n.name}`);return{name:n.name,mimeType:n.type||"application/octet-stream",size:n.size,content:i.slice(c+1)}}function re(n){for(const c of n)if(c.size>L)return{ok:!1,error:`"${c.name}" exceeds the 10MB per-file limit.`};return n.reduce((c,d)=>c+d.size,0)>P?{ok:!1,error:"Attachments exceed the 25MB per-message limit."}:{ok:!0}}const le={class:"flex flex-col h-full"},ce={key:0,class:"flex items-center justify-center h-full"},ie={class:"text-center text-muted-foreground"},ue={key:0,class:"mb-2 space-y-2"},de=["src","alt"],me={class:"flex items-center gap-2 text-xs"},pe={class:"truncate"},fe={class:"opacity-70"},ve={key:2,class:"text-muted-foreground"},he={key:3,class:"inline-block w-2 h-4 bg-current animate-pulse ml-1"},ge={key:0,class:"mb-2 space-y-2"},ye={class:"flex flex-wrap gap-2"},xe={class:"max-w-[170px] truncate"},_e={class:"opacity-70"},be=["onClick"],ke={class:"text-xs text-muted-foreground"},we={key:1,class:"text-xs text-destructive mb-2"},Te={class:"flex gap-2 items-end"},Ae=["disabled"],Se=["disabled"],$e=R({__name:"ChatView",setup(n){const i=W(),c=x(""),d=x(""),g=x(),m=x(),p=x([]),b=x(!1),j=I(()=>p.value.reduce((e,o)=>e+o.size,0)),C=I(()=>!i.isStreaming&&(c.value.trim().length>0||p.value.length>0));async function M(e){if(!e||e.length===0)return;d.value="";const o=[];try{for(const f of Array.from(e))o.push(await oe(f))}catch(f){d.value=(f==null?void 0:f.message)??"Unable to read one or more files.";return}const s=[...p.value,...o],u=re(s);if(!u.ok){d.value=u.error;return}p.value=s,m.value&&(m.value.value="")}function N(e){p.value.splice(e,1),d.value=""}function O(){var e;(e=m.value)==null||e.click()}function V(e){const o=e.target;M((o==null?void 0:o.files)??null)}async function $(){if(!C.value)return;const e=c.value.trim(),o=[...p.value],s=e||"Please review the attached file(s).";c.value="",p.value=[],d.value="",await i.sendMessage(s,o)}function w(){g.value&&(g.value.scrollTop=g.value.scrollHeight)}function K(e){e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),$())}function q(e){e.preventDefault(),b.value=!0}function H(e){e.preventDefault(),b.value=!1}async function X(e){var o;e.preventDefault(),b.value=!1,await M(((o=e.dataTransfer)==null?void 0:o.files)??null)}return B(()=>i.messages.map(e=>e.content),async()=>{await z(),w()},{deep:!0}),B(()=>i.messages.length,async()=>{await z(),w()}),Y(()=>w()),(e,o)=>(a(),l("div",le,[r("div",{ref_key:"messagesContainer",ref:g,class:"flex-1 overflow-y-auto p-4 space-y-4"},[t(i).messages.length===0?(a(),l("div",ce,[r("div",ie,[T(ee,{size:56,class:"mx-auto mb-4"}),o[1]||(o[1]=r("p",{class:"text-lg font-medium"},"Welcome to IO",-1)),o[2]||(o[2]=r("p",{class:"text-sm mt-1"},"Send a message to get started.",-1))])])):y("",!0),(a(!0),l(A,null,S(t(i).messages,s=>(a(),l("div",{key:s.id,class:k(["flex",s.role==="user"?"justify-end":"justify-start"])},[r("div",{class:k(["max-w-[75%] rounded-lg px-4 py-2 text-sm",s.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"])},[s.attachments.length>0?(a(),l("div",ue,[(a(!0),l(A,null,S(s.attachments,(u,f)=>(a(),l("div",{key:`${s.id}-${f}`,class:"rounded border border-border/50 p-2 bg-background/70 text-foreground"},[t(D)(u)?(a(),l("img",{key:0,src:t(ne)(u),alt:u.name,class:"max-h-44 rounded mb-1 object-contain"},null,8,de)):y("",!0),r("div",me,[t(D)(u)?(a(),h(t(F),{key:0,class:"w-3.5 h-3.5"})):(a(),h(t(E),{key:1,class:"w-3.5 h-3.5"})),r("span",pe,v(u.name),1),r("span",fe,v(t(_)(u.size)),1)])]))),128))])):y("",!0),s.content?(a(),h(te,{key:1,content:s.content,class:k(s.role==="user"?"prose-invert":"")},null,8,["content","class"])):(a(),l("span",ve,"...")),s.streaming?(a(),l("div",he)):y("",!0)],2)],2))),128))],512),r("div",{class:k(["border-t border-border p-4",b.value?"bg-accent/40":""]),onDragover:q,onDragleave:H,onDrop:X},[r("input",{ref_key:"fileInput",ref:m,type:"file",multiple:"",class:"hidden",onChange:V},null,544),p.value.length>0?(a(),l("div",ge,[r("div",ye,[(a(!0),l(A,null,S(p.value,(s,u)=>(a(),l("div",{key:`${s.name}-${u}`,class:"flex items-center gap-2 rounded border border-border px-2 py-1 text-xs bg-muted"},[t(D)(s)?(a(),h(t(F),{key:0,class:"w-3.5 h-3.5"})):(a(),h(t(E),{key:1,class:"w-3.5 h-3.5"})),r("span",xe,v(s.name),1),r("span",_e,v(t(_)(s.size)),1),r("button",{class:"hover:text-destructive",onClick:f=>N(u)},[T(t(se),{class:"w-3.5 h-3.5"})],8,be)]))),128))]),r("p",ke,v(t(_)(j.value))+" attached · Max per file "+v(t(_)(t(L)))+" · Max total "+v(t(_)(t(P))),1)])):y("",!0),d.value?(a(),l("p",we,v(d.value),1)):y("",!0),r("div",Te,[r("button",{class:"rounded-md border border-input p-2 hover:bg-accent disabled:opacity-50",disabled:t(i).isStreaming,onClick:O,title:"Attach files"},[T(t(ae),{class:"w-4 h-4"})],8,Ae),G(r("textarea",{"onUpdate:modelValue":o[0]||(o[0]=s=>c.value=s),onKeydown:K,placeholder:"Send a message...",rows:"1",class:"flex-1 resize-none rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring min-h-[40px] max-h-[120px]"},null,544),[[Q,c.value]]),r("button",{onClick:$,disabled:!C.value,class:"rounded-md bg-primary text-primary-foreground p-2 hover:bg-primary/90 disabled:opacity-50 transition-colors"},[t(i).isStreaming?(a(),h(t(Z),{key:1,class:"w-4 h-4"})):(a(),h(t(J),{key:0,class:"w-4 h-4"}))],8,Se)])],34)]))}});export{$e as default};
@@ -1,4 +1,4 @@
1
- import{l as M,o as D,s as N,u as o,k as n,h as a,F as y,w as b,n as c,D as i,I as V,v as d,g as z,q as f,z as v,r as B,W as k,j as q,f as j}from"./index-BOXcmvk8.js";import{b as C,c as P,a as T}from"./api-CKoqb3Uc.js";import{g as W}from"./squad-colors-B8B_Y-lz.js";import{T as A}from"./trash-2-D8LQMu7D.js";/**
1
+ import{l as M,o as D,s as N,u as o,k as n,h as a,F as y,w as b,n as c,D as i,I as V,v as d,g as z,q as f,z as v,r as B,W as k,j as q,f as j}from"./index-CZM0UQQJ.js";import{b as C,c as P,a as T}from"./api-CdLJWHnn.js";import{g as W}from"./squad-colors-B8B_Y-lz.js";import{T as A}from"./trash-2-C1-PiQou.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{o as U,Q as q,s as z,u as r,k as n,h as t,n as d,D as c,H as V,T,O as D,M as P,j as x,F as $,w as j,q as p,z as g,v as l,g as Q,i as E,f as G}from"./index-BOXcmvk8.js";import{b as A,a as O}from"./api-CKoqb3Uc.js";import{S as R}from"./search-CM4X0KHN.js";import{A as I}from"./arrow-left-DB67XHhN.js";import{T as J}from"./trash-2-D8LQMu7D.js";const K={class:"flex h-full"},W={class:"p-3 border-b border-border space-y-2"},X={class:"flex items-center gap-2"},Y={class:"relative"},Z={class:"flex gap-2"},ee={class:"flex-1"},te={class:"flex-1"},se={class:"flex-1 overflow-y-auto"},oe={key:0,class:"p-4 text-xs text-muted-foreground"},re={key:1,class:"flex flex-col items-center justify-center h-full p-6 text-center text-muted-foreground"},ne=["onClick"],ae={class:"flex-1 min-w-0"},le={class:"text-xs text-foreground line-clamp-2"},ie={class:"flex items-center gap-2 mt-1"},ue={class:"text-xs text-muted-foreground"},de={class:"text-xs text-muted-foreground"},ce=["onClick"],fe={key:2,class:"p-3 text-center"},ve={key:0,class:"flex-1 flex flex-col"},me={class:"flex items-center gap-2 px-4 py-2 border-b border-border"},xe={class:"text-sm font-medium text-muted-foreground"},pe={class:"flex-1 overflow-y-auto p-4 space-y-4"},ge={key:0,class:"text-center text-xs text-muted-foreground py-8"},he={class:"text-xs mt-1 opacity-60"},ye={key:1,class:"hidden md:flex flex-1 items-center justify-center text-muted-foreground"},be={class:"text-center"},_e=50,Le=U({__name:"HistoryView",setup(we){const a=l([]),h=l(0),y=l(!0),f=l(""),v=l(""),m=l(""),u=l(null),b=l([]),_=l(!1),w=l(0);async function k(o=!0){y.value=!0;try{o&&(w.value=0,a.value=[]);const e=new URLSearchParams;f.value&&e.set("q",f.value),v.value&&e.set("from",v.value),m.value&&e.set("to",m.value+"T23:59:59"),e.set("limit",String(_e)),e.set("offset",String(w.value));const i=await A(`/history?${e.toString()}`);a.value=o?i.items:[...a.value,...i.items],h.value=i.total,w.value+=i.items.length}finally{y.value=!1}}async function B(o){u.value=o,_.value=!0;try{b.value=await A(`/history/${o}`)}finally{_.value=!1}}function L(){u.value=null,b.value=[]}async function F(o,e){e.stopPropagation(),confirm("Delete this conversation?")&&(await O(`/history/${o}`),a.value=a.value.filter(i=>i.id!==o),h.value=Math.max(0,h.value-1),u.value===o&&L())}function C(o){return new Date(o).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function H(o,e=100){return o.length>e?o.slice(0,e)+"…":o}const N=Q(()=>a.value.length<h.value);let S=null;return q([f,v,m],()=>{S&&clearTimeout(S),S=setTimeout(()=>k(!0),300)}),z(()=>k(!0)),(o,e)=>{var i;return r(),n("div",K,[t("div",{class:p(["flex flex-col border-r border-border",u.value?"hidden md:flex w-80 shrink-0":"flex-1"])},[t("div",W,[t("div",X,[d(c(V),{class:"w-4 h-4 text-muted-foreground"}),e[4]||(e[4]=t("span",{class:"text-sm font-medium"},"Conversation History",-1))]),t("div",Y,[d(c(R),{class:"absolute left-2.5 top-2.5 w-3.5 h-3.5 text-muted-foreground"}),T(t("input",{"onUpdate:modelValue":e[0]||(e[0]=s=>f.value=s),placeholder:"Search conversations...",class:"w-full rounded-md border border-input bg-background pl-8 pr-3 py-2 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[D,f.value]])]),t("div",Z,[t("div",ee,[e[5]||(e[5]=t("label",{class:"text-xs text-muted-foreground block mb-1"},"From",-1)),T(t("input",{"onUpdate:modelValue":e[1]||(e[1]=s=>v.value=s),type:"date",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[D,v.value]])]),t("div",te,[e[6]||(e[6]=t("label",{class:"text-xs text-muted-foreground block mb-1"},"To",-1)),T(t("input",{"onUpdate:modelValue":e[2]||(e[2]=s=>m.value=s),type:"date",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[D,m.value]])])])]),t("div",se,[y.value&&a.value.length===0?(r(),n("div",oe," Loading... ")):a.value.length===0?(r(),n("div",re,[d(c(P),{class:"w-10 h-10 mb-3 opacity-40"}),e[7]||(e[7]=t("p",{class:"text-sm"},"No conversations found.",-1)),e[8]||(e[8]=t("p",{class:"text-xs mt-1"},"Start chatting to build up your history.",-1))])):x("",!0),(r(!0),n($,null,j(a.value,s=>(r(),n("div",{key:s.id,class:p(["group flex items-start gap-2 px-3 py-3 border-b border-border cursor-pointer hover:bg-accent/50 transition-colors",u.value===s.id?"bg-accent":""]),onClick:M=>B(s.id)},[t("div",ae,[t("p",le,g(H(s.preview)),1),t("div",ie,[t("span",ue,g(C(s.updatedAt)),1),t("span",de,"· "+g(s.messageCount)+" msgs",1)])]),t("button",{class:"opacity-0 group-hover:opacity-100 p-1 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-all",title:"Delete",onClick:M=>F(s.id,M)},[d(c(J),{class:"w-3.5 h-3.5"})],8,ce)],10,ne))),128)),N.value?(r(),n("div",fe,[t("button",{class:"text-xs text-muted-foreground hover:text-foreground underline",onClick:e[3]||(e[3]=s=>k(!1))}," Load more ")])):x("",!0)])],2),u.value?(r(),n("div",ve,[t("div",me,[t("button",{class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Back",onClick:L},[d(c(I),{class:"w-4 h-4"})]),t("span",xe,g(C(((i=a.value.find(s=>s.id===u.value))==null?void 0:i.startedAt)??"")),1)]),t("div",pe,[_.value?(r(),n("div",ge," Loading... ")):x("",!0),(r(!0),n($,null,j(b.value,s=>(r(),n("div",{key:s.id,class:p(["flex",s.role==="user"?"justify-end":"justify-start"])},[t("div",{class:p(["max-w-[75%] rounded-lg px-4 py-2 text-sm",s.role==="user"?"bg-blue-600 text-white":"bg-muted text-foreground"])},[s.content?(r(),E(G,{key:0,content:s.content,class:p(s.role==="user"?"prose-invert":"")},null,8,["content","class"])):x("",!0),t("p",he,g(C(s.createdAt)),1)],2)],2))),128))])])):u.value?x("",!0):(r(),n("div",ye,[t("div",be,[d(c(V),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[9]||(e[9]=t("p",null,"Select a conversation to view",-1))])]))])}}});export{Le as default};
1
+ import{o as U,Q as q,s as z,u as r,k as n,h as t,n as d,D as c,H as V,T,O as D,M as P,j as x,F as $,w as j,q as p,z as g,v as l,g as Q,i as E,f as G}from"./index-CZM0UQQJ.js";import{b as A,a as O}from"./api-CdLJWHnn.js";import{S as R}from"./search-CMwjTbNl.js";import{A as I}from"./arrow-left-27p7HUxd.js";import{T as J}from"./trash-2-C1-PiQou.js";const K={class:"flex h-full"},W={class:"p-3 border-b border-border space-y-2"},X={class:"flex items-center gap-2"},Y={class:"relative"},Z={class:"flex gap-2"},ee={class:"flex-1"},te={class:"flex-1"},se={class:"flex-1 overflow-y-auto"},oe={key:0,class:"p-4 text-xs text-muted-foreground"},re={key:1,class:"flex flex-col items-center justify-center h-full p-6 text-center text-muted-foreground"},ne=["onClick"],ae={class:"flex-1 min-w-0"},le={class:"text-xs text-foreground line-clamp-2"},ie={class:"flex items-center gap-2 mt-1"},ue={class:"text-xs text-muted-foreground"},de={class:"text-xs text-muted-foreground"},ce=["onClick"],fe={key:2,class:"p-3 text-center"},ve={key:0,class:"flex-1 flex flex-col"},me={class:"flex items-center gap-2 px-4 py-2 border-b border-border"},xe={class:"text-sm font-medium text-muted-foreground"},pe={class:"flex-1 overflow-y-auto p-4 space-y-4"},ge={key:0,class:"text-center text-xs text-muted-foreground py-8"},he={class:"text-xs mt-1 opacity-60"},ye={key:1,class:"hidden md:flex flex-1 items-center justify-center text-muted-foreground"},be={class:"text-center"},_e=50,Le=U({__name:"HistoryView",setup(we){const a=l([]),h=l(0),y=l(!0),f=l(""),v=l(""),m=l(""),u=l(null),b=l([]),_=l(!1),w=l(0);async function k(o=!0){y.value=!0;try{o&&(w.value=0,a.value=[]);const e=new URLSearchParams;f.value&&e.set("q",f.value),v.value&&e.set("from",v.value),m.value&&e.set("to",m.value+"T23:59:59"),e.set("limit",String(_e)),e.set("offset",String(w.value));const i=await A(`/history?${e.toString()}`);a.value=o?i.items:[...a.value,...i.items],h.value=i.total,w.value+=i.items.length}finally{y.value=!1}}async function B(o){u.value=o,_.value=!0;try{b.value=await A(`/history/${o}`)}finally{_.value=!1}}function L(){u.value=null,b.value=[]}async function F(o,e){e.stopPropagation(),confirm("Delete this conversation?")&&(await O(`/history/${o}`),a.value=a.value.filter(i=>i.id!==o),h.value=Math.max(0,h.value-1),u.value===o&&L())}function C(o){return new Date(o).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function H(o,e=100){return o.length>e?o.slice(0,e)+"…":o}const N=Q(()=>a.value.length<h.value);let S=null;return q([f,v,m],()=>{S&&clearTimeout(S),S=setTimeout(()=>k(!0),300)}),z(()=>k(!0)),(o,e)=>{var i;return r(),n("div",K,[t("div",{class:p(["flex flex-col border-r border-border",u.value?"hidden md:flex w-80 shrink-0":"flex-1"])},[t("div",W,[t("div",X,[d(c(V),{class:"w-4 h-4 text-muted-foreground"}),e[4]||(e[4]=t("span",{class:"text-sm font-medium"},"Conversation History",-1))]),t("div",Y,[d(c(R),{class:"absolute left-2.5 top-2.5 w-3.5 h-3.5 text-muted-foreground"}),T(t("input",{"onUpdate:modelValue":e[0]||(e[0]=s=>f.value=s),placeholder:"Search conversations...",class:"w-full rounded-md border border-input bg-background pl-8 pr-3 py-2 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[D,f.value]])]),t("div",Z,[t("div",ee,[e[5]||(e[5]=t("label",{class:"text-xs text-muted-foreground block mb-1"},"From",-1)),T(t("input",{"onUpdate:modelValue":e[1]||(e[1]=s=>v.value=s),type:"date",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[D,v.value]])]),t("div",te,[e[6]||(e[6]=t("label",{class:"text-xs text-muted-foreground block mb-1"},"To",-1)),T(t("input",{"onUpdate:modelValue":e[2]||(e[2]=s=>m.value=s),type:"date",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[D,m.value]])])])]),t("div",se,[y.value&&a.value.length===0?(r(),n("div",oe," Loading... ")):a.value.length===0?(r(),n("div",re,[d(c(P),{class:"w-10 h-10 mb-3 opacity-40"}),e[7]||(e[7]=t("p",{class:"text-sm"},"No conversations found.",-1)),e[8]||(e[8]=t("p",{class:"text-xs mt-1"},"Start chatting to build up your history.",-1))])):x("",!0),(r(!0),n($,null,j(a.value,s=>(r(),n("div",{key:s.id,class:p(["group flex items-start gap-2 px-3 py-3 border-b border-border cursor-pointer hover:bg-accent/50 transition-colors",u.value===s.id?"bg-accent":""]),onClick:M=>B(s.id)},[t("div",ae,[t("p",le,g(H(s.preview)),1),t("div",ie,[t("span",ue,g(C(s.updatedAt)),1),t("span",de,"· "+g(s.messageCount)+" msgs",1)])]),t("button",{class:"opacity-0 group-hover:opacity-100 p-1 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-all",title:"Delete",onClick:M=>F(s.id,M)},[d(c(J),{class:"w-3.5 h-3.5"})],8,ce)],10,ne))),128)),N.value?(r(),n("div",fe,[t("button",{class:"text-xs text-muted-foreground hover:text-foreground underline",onClick:e[3]||(e[3]=s=>k(!1))}," Load more ")])):x("",!0)])],2),u.value?(r(),n("div",ve,[t("div",me,[t("button",{class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Back",onClick:L},[d(c(I),{class:"w-4 h-4"})]),t("span",xe,g(C(((i=a.value.find(s=>s.id===u.value))==null?void 0:i.startedAt)??"")),1)]),t("div",pe,[_.value?(r(),n("div",ge," Loading... ")):x("",!0),(r(!0),n($,null,j(b.value,s=>(r(),n("div",{key:s.id,class:p(["flex",s.role==="user"?"justify-end":"justify-start"])},[t("div",{class:p(["max-w-[75%] rounded-lg px-4 py-2 text-sm",s.role==="user"?"bg-blue-600 text-white":"bg-muted text-foreground"])},[s.content?(r(),E(G,{key:0,content:s.content,class:p(s.role==="user"?"prose-invert":"")},null,8,["content","class"])):x("",!0),t("p",he,g(C(s.createdAt)),1)],2)],2))),128))])])):u.value?x("",!0):(r(),n("div",ye,[t("div",be,[d(c(V),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[9]||(e[9]=t("p",null,"Select a conversation to view",-1))])]))])}}});export{Le as default};
@@ -1 +1 @@
1
- import{o as b,E as v,u,k as i,h as t,n as y,W as w,T as m,O as p,z as f,j as h,D as g,v as d,_,K as S}from"./index-BOXcmvk8.js";const V={class:"min-h-screen flex items-center justify-center bg-background p-4"},k={class:"w-full max-w-sm space-y-8"},D={class:"text-center"},A={key:0,class:"text-sm text-destructive"},B=["disabled"],L=b({__name:"LoginView",setup(E){const o=v(),c=S(),r=d(""),n=d(""),s=d("");async function x(){s.value="";try{await o.login(r.value,n.value),c.push("/")}catch(l){s.value=l.message??"Login failed"}}return(l,e)=>(u(),i("div",V,[t("div",k,[t("div",D,[y(_,{size:56,class:"mx-auto mb-4"}),e[2]||(e[2]=t("h1",{class:"text-2xl font-bold bg-gradient-brand bg-clip-text text-transparent"}," IO ",-1)),e[3]||(e[3]=t("p",{class:"text-sm text-muted-foreground mt-1"},"Sign in to your dashboard",-1))]),t("form",{onSubmit:w(x,["prevent"]),class:"space-y-4 bg-card border border-border rounded-lg p-6"},[t("div",null,[e[4]||(e[4]=t("label",{class:"text-sm font-medium text-muted-foreground",for:"email"},"Email",-1)),m(t("input",{id:"email","onUpdate:modelValue":e[0]||(e[0]=a=>r.value=a),type:"email",required:"",class:"mt-1 w-full rounded-md border border-border bg-input px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"you@example.com"},null,512),[[p,r.value]])]),t("div",null,[e[5]||(e[5]=t("label",{class:"text-sm font-medium text-muted-foreground",for:"password"},"Password",-1)),m(t("input",{id:"password","onUpdate:modelValue":e[1]||(e[1]=a=>n.value=a),type:"password",required:"",class:"mt-1 w-full rounded-md border border-border bg-input px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"••••••••"},null,512),[[p,n.value]])]),s.value?(u(),i("div",A,f(s.value),1)):h("",!0),t("button",{type:"submit",disabled:g(o).loading,class:"btn-gradient w-full py-2.5"},f(g(o).loading?"Signing in...":"Sign In"),9,B)],32),e[6]||(e[6]=t("p",{class:"text-center text-xs text-muted-foreground"}," Personal AI Assistant Daemon ",-1))])]))}});export{L as default};
1
+ import{o as b,E as v,u,k as i,h as t,n as y,W as w,T as m,O as p,z as f,j as h,D as g,v as d,_,K as S}from"./index-CZM0UQQJ.js";const V={class:"min-h-screen flex items-center justify-center bg-background p-4"},k={class:"w-full max-w-sm space-y-8"},D={class:"text-center"},A={key:0,class:"text-sm text-destructive"},B=["disabled"],L=b({__name:"LoginView",setup(E){const o=v(),c=S(),r=d(""),n=d(""),s=d("");async function x(){s.value="";try{await o.login(r.value,n.value),c.push("/")}catch(l){s.value=l.message??"Login failed"}}return(l,e)=>(u(),i("div",V,[t("div",k,[t("div",D,[y(_,{size:56,class:"mx-auto mb-4"}),e[2]||(e[2]=t("h1",{class:"text-2xl font-bold bg-gradient-brand bg-clip-text text-transparent"}," IO ",-1)),e[3]||(e[3]=t("p",{class:"text-sm text-muted-foreground mt-1"},"Sign in to your dashboard",-1))]),t("form",{onSubmit:w(x,["prevent"]),class:"space-y-4 bg-card border border-border rounded-lg p-6"},[t("div",null,[e[4]||(e[4]=t("label",{class:"text-sm font-medium text-muted-foreground",for:"email"},"Email",-1)),m(t("input",{id:"email","onUpdate:modelValue":e[0]||(e[0]=a=>r.value=a),type:"email",required:"",class:"mt-1 w-full rounded-md border border-border bg-input px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"you@example.com"},null,512),[[p,r.value]])]),t("div",null,[e[5]||(e[5]=t("label",{class:"text-sm font-medium text-muted-foreground",for:"password"},"Password",-1)),m(t("input",{id:"password","onUpdate:modelValue":e[1]||(e[1]=a=>n.value=a),type:"password",required:"",class:"mt-1 w-full rounded-md border border-border bg-input px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"••••••••"},null,512),[[p,n.value]])]),s.value?(u(),i("div",A,f(s.value),1)):h("",!0),t("button",{type:"submit",disabled:g(o).loading,class:"btn-gradient w-full py-2.5"},f(g(o).loading?"Signing in...":"Sign In"),9,B)],32),e[6]||(e[6]=t("p",{class:"text-center text-xs text-muted-foreground"}," Personal AI Assistant Daemon ",-1))])]))}});export{L as default};
@@ -0,0 +1 @@
1
+ import{o as S,s as C,u as l,k as a,h as s,n as c,D as b,m as E,T as i,O as m,N as j,j as x,c as M,F as P,w as U,v as f,z as p}from"./index-CZM0UQQJ.js";import{b as $,c as I,d as N,a as O}from"./api-CdLJWHnn.js";import{_ as F}from"./ToggleSwitch.vue_vue_type_script_setup_true_lang-qLsSQnXV.js";import{P as G}from"./plus-CoUrXVZm.js";import{T as L}from"./trash-2-C1-PiQou.js";const K={class:"p-6"},Y={class:"flex items-center justify-between mb-6"},h={key:0,class:"border border-border rounded-lg p-4 mb-6 space-y-3 bg-card"},B={class:"grid grid-cols-2 gap-3"},D={key:0},J={key:1},z={key:1,class:"text-muted-foreground"},R={key:2,class:"text-center py-12 text-muted-foreground"},W={key:3,class:"space-y-2"},q={class:"space-y-1"},H={class:"flex items-center gap-2"},Q={class:"font-medium text-sm"},X={class:"text-xs text-muted-foreground bg-secondary px-1.5 py-0.5 rounded"},Z={key:0,class:"text-xs text-muted-foreground"},ee={key:1,class:"text-xs text-muted-foreground"},te={key:2,class:"text-xs text-muted-foreground"},se={class:"flex items-center gap-3"},oe=["onClick"],ie=S({__name:"McpView",setup(ne){const u=f([]),g=f(!0),v=f(!1),o=f({name:"",type:"stdio",command:"",url:"",argsText:"",envText:""});C(async()=>{try{u.value=await $("/mcp")}finally{g.value=!1}});function k(n){return n.split(/\r?\n|,/).map(e=>e.trim()).filter(Boolean)}function w(n){const e={};try{const t=JSON.parse(n);if(t&&typeof t=="object"&&!Array.isArray(t)){for(const[d,r]of Object.entries(t))e[d]=String(r);return e}}catch{}for(const t of n.split(/\r?\n/)){const d=t.trim();if(!d||d.startsWith("#"))continue;const r=d.indexOf("=");if(r===-1)continue;const y=d.slice(0,r).trim(),A=d.slice(r+1).trim();y&&(e[y]=A)}return e}async function _(n){await N(`/mcp/${n.id}`,{enabled:!n.enabled}),n.enabled=!n.enabled}async function T(n){await O(`/mcp/${n}`),u.value=u.value.filter(e=>e.id!==n)}async function V(){const n={name:o.value.name,type:o.value.type,args:k(o.value.argsText),env:w(o.value.envText)};o.value.type==="stdio"?n.command=o.value.command:n.url=o.value.url;const e=await I("/mcp",n);u.value.push(e),v.value=!1,o.value={name:"",type:"stdio",command:"",url:"",argsText:"",envText:""}}return(n,e)=>(l(),a("div",K,[s("div",Y,[e[8]||(e[8]=s("div",null,[s("p",{class:"text-sm font-medium text-primary"},"MCP configuration"),s("h1",{class:"text-2xl font-bold"},"MCP Servers")],-1)),s("button",{onClick:e[0]||(e[0]=t=>v.value=!v.value),class:"btn-gradient inline-flex items-center gap-1"},[c(b(G),{class:"w-4 h-4"}),e[7]||(e[7]=E(" Add Server ",-1))])]),v.value?(l(),a("div",h,[s("div",B,[s("div",null,[e[9]||(e[9]=s("label",{class:"text-sm font-medium"},"Name",-1)),i(s("input",{"onUpdate:modelValue":e[1]||(e[1]=t=>o.value.name=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.name]])]),s("div",null,[e[11]||(e[11]=s("label",{class:"text-sm font-medium"},"Type",-1)),i(s("select",{"onUpdate:modelValue":e[2]||(e[2]=t=>o.value.type=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[10]||(e[10]=[s("option",{value:"stdio"},"stdio",-1),s("option",{value:"http"},"http",-1)])],512),[[j,o.value.type]])])]),o.value.type==="stdio"?(l(),a("div",D,[e[12]||(e[12]=s("label",{class:"text-sm font-medium"},"Command",-1)),i(s("input",{"onUpdate:modelValue":e[3]||(e[3]=t=>o.value.command=t),placeholder:"npx @my/mcp-server",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.command]])])):(l(),a("div",J,[e[13]||(e[13]=s("label",{class:"text-sm font-medium"},"URL",-1)),i(s("input",{"onUpdate:modelValue":e[4]||(e[4]=t=>o.value.url=t),placeholder:"https://...",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.url]])])),s("div",null,[e[14]||(e[14]=s("label",{class:"text-sm font-medium"},"Command args",-1)),i(s("textarea",{"onUpdate:modelValue":e[5]||(e[5]=t=>o.value.argsText=t),rows:"3",placeholder:"--stdio\n--figma-api-key=${FIGMA_API_KEY}",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.argsText]]),e[15]||(e[15]=s("p",{class:"mt-1 text-xs text-muted-foreground"},"Enter one arg per line or comma-separated.",-1))]),s("div",null,[e[16]||(e[16]=s("label",{class:"text-sm font-medium"},"Environment variables",-1)),i(s("textarea",{"onUpdate:modelValue":e[6]||(e[6]=t=>o.value.envText=t),rows:"4",placeholder:"FIGMA_API_KEY=${FIGMA_API_KEY}\nLOG_LEVEL=debug",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm font-mono"},null,512),[[m,o.value.envText]]),e[17]||(e[17]=s("p",{class:"mt-1 text-xs text-muted-foreground"},"Use KEY=value lines, or paste JSON. Values like ${FIGMA_API_KEY} are preserved.",-1))]),s("div",{class:"flex justify-end"},[s("button",{onClick:V,class:"btn-gradient"},"Save")])])):x("",!0),g.value?(l(),a("div",z,"Loading...")):u.value.length===0?(l(),a("div",R,[c(b(M),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[18]||(e[18]=s("p",null,"No MCP servers configured.",-1))])):(l(),a("div",W,[(l(!0),a(P,null,U(u.value,t=>{var d;return l(),a("div",{key:t.id,class:"flex items-center justify-between border border-border rounded-lg px-4 py-3 bg-card"},[s("div",q,[s("div",H,[s("span",Q,p(t.name),1),s("span",X,p(t.type),1)]),t.command||t.url?(l(),a("div",Z,p(t.command||t.url),1)):x("",!0),(d=t.args)!=null&&d.length?(l(),a("div",ee,"Args: "+p(t.args.join(", ")),1)):x("",!0),t.env&&Object.keys(t.env).length>0?(l(),a("div",te,"Env: "+p(Object.keys(t.env).join(", ")),1)):x("",!0)]),s("div",se,[c(F,{"model-value":t.enabled,"aria-label":`Toggle ${t.name}`,"onUpdate:modelValue":r=>_(t)},null,8,["model-value","aria-label","onUpdate:modelValue"]),s("button",{onClick:r=>T(t.id),class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive"},[c(b(L),{class:"w-4 h-4"})],8,oe)])])}),128))]))]))}});export{ie as default};
@@ -0,0 +1,6 @@
1
+ import{l as B,o as I,s as L,u as d,k as l,h as o,n as m,D as p,m as O,F as x,w as y,T as b,N as q,O as S,j as _,b as j,z as n,v as u,g as z,q as M,r as A}from"./index-CZM0UQQJ.js";import{b as h,c as C,d as E,a as F}from"./api-CdLJWHnn.js";import{g as G}from"./squad-colors-B8B_Y-lz.js";import{_ as R}from"./ToggleSwitch.vue_vue_type_script_setup_true_lang-qLsSQnXV.js";import{P as H}from"./plus-CoUrXVZm.js";import{T as J}from"./trash-2-C1-PiQou.js";/**
2
+ * @license lucide-vue-next v0.474.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const K=B("PlayIcon",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]),Q={class:"p-6"},W={class:"flex items-center justify-between mb-6"},X={class:"flex gap-1 border-b border-border mb-4"},Y=["onClick"],Z={key:0,class:"border border-border rounded-lg p-4 mb-4 space-y-3"},ee={class:"grid grid-cols-2 gap-3"},te=["value"],oe=["disabled"],se={key:1,class:"text-muted-foreground"},ae={key:2,class:"text-center py-12 text-muted-foreground"},de={key:3,class:"space-y-2"},le={class:"text-sm font-medium font-mono"},re={key:0,class:"mt-1"},ne={class:"text-xs text-muted-foreground mt-0.5"},ue={class:"text-xs text-muted-foreground mt-0.5"},ie={class:"flex items-center gap-3"},me=["onClick"],pe={key:0,class:"text-xs text-green-500 font-medium"},ce=["onClick"],we=I({__name:"SchedulesView",setup(ve){const r=u([]),i=u([]),w=u(!0),c=u("squad"),v=u(!1),a=u({type:"squad",cron:"",squad_id:"",prompt:""}),f=u(null);L(async()=>{try{const s=await h("/squads");i.value=s.squads,i.value.length>0&&(a.value.squad_id=i.value[0].id),r.value=await h("/schedules")}finally{w.value=!1}});const k=()=>r.value.filter(s=>s.type===c.value);async function T(){const s={type:a.value.type,cron:a.value.cron,squad_id:a.value.squad_id};if(!a.value.squad_id||!a.value.prompt.trim())return;s.prompt=a.value.prompt;const e=await C("/schedules",s);r.value.push(e),v.value=!1}function V(s){if(s)return i.value.find(e=>e.id===s)}const $=z(()=>k().map(s=>({...s,squad:V(s.squad_id)})));async function N(s){const e=!s.enabled;await E(`/schedules/${s.id}`,{enabled:e}),s.enabled=e?1:0}async function P(s){await F(`/schedules/${s}`),r.value=r.value.filter(e=>e.id!==s)}async function U(s){await C(`/schedules/${s.id}/trigger`,{}),f.value=s.id;const e=r.value.findIndex(t=>t.id===s.id);e!==-1&&(r.value[e]={...r.value[e],last_run:new Date().toISOString()}),setTimeout(()=>{f.value=null},3e3)}function D(s){var e;return s?((e=i.value.find(t=>t.id===s))==null?void 0:e.name)??s:"Unknown squad"}return(s,e)=>(d(),l("div",Q,[o("div",W,[e[6]||(e[6]=o("h1",{class:"text-2xl font-bold"},"Schedules",-1)),o("button",{onClick:e[0]||(e[0]=t=>v.value=!v.value),class:"inline-flex items-center gap-1 px-3 py-1.5 text-sm rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors"},[m(p(H),{class:"w-4 h-4"}),e[5]||(e[5]=O(" Add Schedule ",-1))])]),o("div",X,[(d(),l(x,null,y(["squad","io"],t=>o("button",{key:t,onClick:g=>c.value=t,class:M(["px-4 py-2 text-sm font-medium border-b-2 transition-colors",c.value===t?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"])},n(t==="squad"?"Squad Schedules":"IO Schedules"),11,Y)),64))]),v.value?(d(),l("div",Z,[o("div",ee,[o("div",null,[e[8]||(e[8]=o("label",{class:"text-sm font-medium"},"Type",-1)),b(o("select",{"onUpdate:modelValue":e[1]||(e[1]=t=>a.value.type=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[7]||(e[7]=[o("option",{value:"squad"},"Squad",-1),o("option",{value:"io"},"IO",-1)])],512),[[q,a.value.type]])]),o("div",null,[e[9]||(e[9]=o("label",{class:"text-sm font-medium"},"Cron Expression",-1)),b(o("input",{"onUpdate:modelValue":e[2]||(e[2]=t=>a.value.cron=t),placeholder:"0 9 * * 1-5",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[S,a.value.cron]])])]),o("div",null,[e[10]||(e[10]=o("label",{class:"text-sm font-medium"},"Target Squad",-1)),b(o("select",{"onUpdate:modelValue":e[3]||(e[3]=t=>a.value.squad_id=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[(d(!0),l(x,null,y(i.value,t=>(d(),l("option",{key:t.id,value:t.id},n(t.name),9,te))),128))],512),[[q,a.value.squad_id]])]),o("div",null,[e[11]||(e[11]=o("label",{class:"text-sm font-medium"},"Prompt",-1)),b(o("textarea",{"onUpdate:modelValue":e[4]||(e[4]=t=>a.value.prompt=t),rows:"3",placeholder:"e.g. Triage issues, review PRs, ideate on features",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[S,a.value.prompt]])]),o("button",{onClick:T,disabled:!a.value.squad_id||!a.value.prompt.trim(),class:"px-4 py-2 text-sm rounded-md bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed"}," Save ",8,oe)])):_("",!0),w.value?(d(),l("div",se,"Loading...")):k().length===0?(d(),l("div",ae,[m(p(j),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),o("p",null,"No "+n(c.value)+" schedules configured.",1)])):(d(),l("div",de,[(d(!0),l(x,null,y($.value,t=>(d(),l("div",{key:t.id,class:"flex items-center justify-between border border-border rounded-lg px-4 py-3"},[o("div",null,[o("div",le,n(t.cron),1),t.squad?(d(),l("div",re,[o("span",{class:"text-xs px-2 py-0.5 rounded-full",style:A(p(G)(t.squad.color))},n(t.squad.name),5)])):_("",!0),o("div",ne,n(t.prompt?t.prompt.slice(0,80):"(no prompt)"),1),o("div",ue," Squad: "+n(D(t.squad_id)),1)]),o("div",ie,[o("button",{onClick:g=>U(t),class:"p-1.5 rounded hover:bg-primary/10 text-muted-foreground hover:text-primary",title:"Trigger now"},[m(p(K),{class:"w-4 h-4"})],8,me),f.value===t.id?(d(),l("span",pe,"Triggered!")):_("",!0),m(R,{"model-value":!!t.enabled,"aria-label":`Toggle schedule ${t.cron}`,"onUpdate:modelValue":g=>N(t)},null,8,["model-value","aria-label","onUpdate:modelValue"]),o("button",{onClick:g=>P(t.id),class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive"},[m(p(J),{class:"w-4 h-4"})],8,ce)])]))),128))]))]))}});export{we as default};
@@ -1 +1 @@
1
- import{o as w,s as E,u as d,k as s,h as t,z as g,F as x,w as U,T as a,O as n,N as T,L as p,j as b,v as r,q as M}from"./index-BOXcmvk8.js";import{b as V,d as S}from"./api-CKoqb3Uc.js";const z={class:"p-6"},A={class:"flex items-center justify-between mb-6"},N=["disabled"],B={key:0,class:"text-muted-foreground"},C={class:"flex gap-1 border-b border-border mb-6"},I=["onClick"],D={key:0,class:"space-y-4 max-w-lg"},K={class:"flex items-center gap-3"},L={key:1,class:"space-y-4 max-w-lg"},j={class:"flex items-center gap-3"},O={key:2,class:"space-y-4 max-w-lg"},q={key:3,class:"space-y-4 max-w-lg"},F={class:"flex items-center gap-3"},G={class:"flex items-center gap-3"},H=w({__name:"SettingsView",setup(P){const f=r(!0),i=r(!1),m=r(!1),u=r("general"),y=[{id:"general",label:"General"},{id:"telegram",label:"Telegram"},{id:"auth",label:"Auth"},{id:"advanced",label:"Advanced"}],o=r({defaultModel:"",port:3170,telegramEnabled:!1,telegramBotToken:"",authorizedUserId:null,supabaseUrl:"",supabaseAnonKey:"",authorizedEmail:"",backgroundNotifyMode:"meaningful",backgroundNotifyTelegram:!0,selfEditEnabled:!1,watchdogEnabled:!0});async function k(){f.value=!0;try{const v=await V("/settings");o.value=v}finally{f.value=!1}}async function c(){i.value=!0,m.value=!1;try{await S("/settings",o.value),m.value=!0,setTimeout(()=>m.value=!1,2e3)}finally{i.value=!1}}return E(k),(v,e)=>(d(),s("div",z,[t("div",A,[e[12]||(e[12]=t("h1",{class:"text-2xl font-bold"},"Settings",-1)),t("button",{onClick:c,disabled:i.value,class:"px-4 py-2 rounded-md bg-primary text-primary-foreground text-sm hover:bg-primary/90 disabled:opacity-50"},g(i.value?"Saving...":m.value?"Saved ✓":"Save"),9,N)]),f.value?(d(),s("div",B,"Loading...")):(d(),s(x,{key:1},[t("div",C,[(d(),s(x,null,U(y,l=>t("button",{key:l.id,onClick:R=>u.value=l.id,class:M(["px-4 py-2 text-sm font-medium border-b-2 transition-colors",u.value===l.id?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"])},g(l.label),11,I)),64))]),u.value==="general"?(d(),s("div",D,[t("div",null,[e[13]||(e[13]=t("label",{class:"text-sm font-medium"},"Default Model",-1)),a(t("input",{"onUpdate:modelValue":e[0]||(e[0]=l=>o.value.defaultModel=l),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,o.value.defaultModel]])]),t("div",null,[e[14]||(e[14]=t("label",{class:"text-sm font-medium"},"Port",-1)),a(t("input",{"onUpdate:modelValue":e[1]||(e[1]=l=>o.value.port=l),type:"number",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,o.value.port,void 0,{number:!0}]]),e[15]||(e[15]=t("p",{class:"text-xs text-muted-foreground mt-1"},"Requires restart to take effect",-1))]),t("div",null,[e[17]||(e[17]=t("label",{class:"text-sm font-medium"},"Background Notify Mode",-1)),a(t("select",{"onUpdate:modelValue":e[2]||(e[2]=l=>o.value.backgroundNotifyMode=l),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[16]||(e[16]=[t("option",{value:"all"},"All",-1),t("option",{value:"meaningful"},"Meaningful",-1),t("option",{value:"off"},"Off",-1)])],512),[[T,o.value.backgroundNotifyMode]])]),t("div",K,[a(t("input",{"onUpdate:modelValue":e[3]||(e[3]=l=>o.value.backgroundNotifyTelegram=l),type:"checkbox",id:"notifyTelegram",class:"rounded"},null,512),[[p,o.value.backgroundNotifyTelegram]]),e[18]||(e[18]=t("label",{for:"notifyTelegram",class:"text-sm font-medium"},"Send notifications via Telegram",-1))])])):b("",!0),u.value==="telegram"?(d(),s("div",L,[t("div",null,[e[19]||(e[19]=t("label",{class:"text-sm font-medium"},"Bot Token",-1)),a(t("input",{"onUpdate:modelValue":e[4]||(e[4]=l=>o.value.telegramBotToken=l),type:"password",placeholder:"Enter new token to update",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,o.value.telegramBotToken]])]),t("div",null,[e[20]||(e[20]=t("label",{class:"text-sm font-medium"},"Authorized User ID",-1)),a(t("input",{"onUpdate:modelValue":e[5]||(e[5]=l=>o.value.authorizedUserId=l),type:"number",placeholder:"123456789",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,o.value.authorizedUserId,void 0,{number:!0}]])]),t("div",j,[a(t("input",{"onUpdate:modelValue":e[6]||(e[6]=l=>o.value.telegramEnabled=l),type:"checkbox",id:"telegramEnabled",class:"rounded"},null,512),[[p,o.value.telegramEnabled]]),e[21]||(e[21]=t("label",{for:"telegramEnabled",class:"text-sm font-medium"},"Enable Telegram Bot",-1))])])):b("",!0),u.value==="auth"?(d(),s("div",O,[t("div",null,[e[22]||(e[22]=t("label",{class:"text-sm font-medium"},"Supabase URL",-1)),a(t("input",{"onUpdate:modelValue":e[7]||(e[7]=l=>o.value.supabaseUrl=l),placeholder:"https://your-project.supabase.co",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,o.value.supabaseUrl]])]),t("div",null,[e[23]||(e[23]=t("label",{class:"text-sm font-medium"},"Supabase Anon Key",-1)),a(t("input",{"onUpdate:modelValue":e[8]||(e[8]=l=>o.value.supabaseAnonKey=l),type:"password",placeholder:"Enter new key to update",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,o.value.supabaseAnonKey]])]),t("div",null,[e[24]||(e[24]=t("label",{class:"text-sm font-medium"},"Authorized Email",-1)),a(t("input",{"onUpdate:modelValue":e[9]||(e[9]=l=>o.value.authorizedEmail=l),type:"email",placeholder:"you@example.com",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,o.value.authorizedEmail]])])])):b("",!0),u.value==="advanced"?(d(),s("div",q,[t("div",F,[a(t("input",{"onUpdate:modelValue":e[10]||(e[10]=l=>o.value.selfEditEnabled=l),type:"checkbox",id:"selfEdit",class:"rounded"},null,512),[[p,o.value.selfEditEnabled]]),e[25]||(e[25]=t("div",null,[t("label",{for:"selfEdit",class:"text-sm font-medium"},"Self-Edit Mode"),t("p",{class:"text-xs text-muted-foreground"},"Allow IO to modify its own source code")],-1))]),t("div",G,[a(t("input",{"onUpdate:modelValue":e[11]||(e[11]=l=>o.value.watchdogEnabled=l),type:"checkbox",id:"watchdog",class:"rounded"},null,512),[[p,o.value.watchdogEnabled]]),e[26]||(e[26]=t("div",null,[t("label",{for:"watchdog",class:"text-sm font-medium"},"Watchdog"),t("p",{class:"text-xs text-muted-foreground"},"Monitor event loop and zombie instances")],-1))])])):b("",!0)],64))]))}});export{H as default};
1
+ import{o as w,s as E,u as d,k as s,h as t,z as g,F as x,w as U,T as a,O as n,N as T,L as p,j as b,v as r,q as M}from"./index-CZM0UQQJ.js";import{b as V,d as S}from"./api-CdLJWHnn.js";const z={class:"p-6"},A={class:"flex items-center justify-between mb-6"},N=["disabled"],B={key:0,class:"text-muted-foreground"},C={class:"flex gap-1 border-b border-border mb-6"},I=["onClick"],D={key:0,class:"space-y-4 max-w-lg"},K={class:"flex items-center gap-3"},L={key:1,class:"space-y-4 max-w-lg"},j={class:"flex items-center gap-3"},O={key:2,class:"space-y-4 max-w-lg"},q={key:3,class:"space-y-4 max-w-lg"},F={class:"flex items-center gap-3"},G={class:"flex items-center gap-3"},H=w({__name:"SettingsView",setup(P){const f=r(!0),i=r(!1),m=r(!1),u=r("general"),y=[{id:"general",label:"General"},{id:"telegram",label:"Telegram"},{id:"auth",label:"Auth"},{id:"advanced",label:"Advanced"}],o=r({defaultModel:"",port:3170,telegramEnabled:!1,telegramBotToken:"",authorizedUserId:null,supabaseUrl:"",supabaseAnonKey:"",authorizedEmail:"",backgroundNotifyMode:"meaningful",backgroundNotifyTelegram:!0,selfEditEnabled:!1,watchdogEnabled:!0});async function k(){f.value=!0;try{const v=await V("/settings");o.value=v}finally{f.value=!1}}async function c(){i.value=!0,m.value=!1;try{await S("/settings",o.value),m.value=!0,setTimeout(()=>m.value=!1,2e3)}finally{i.value=!1}}return E(k),(v,e)=>(d(),s("div",z,[t("div",A,[e[12]||(e[12]=t("h1",{class:"text-2xl font-bold"},"Settings",-1)),t("button",{onClick:c,disabled:i.value,class:"px-4 py-2 rounded-md bg-primary text-primary-foreground text-sm hover:bg-primary/90 disabled:opacity-50"},g(i.value?"Saving...":m.value?"Saved ✓":"Save"),9,N)]),f.value?(d(),s("div",B,"Loading...")):(d(),s(x,{key:1},[t("div",C,[(d(),s(x,null,U(y,l=>t("button",{key:l.id,onClick:R=>u.value=l.id,class:M(["px-4 py-2 text-sm font-medium border-b-2 transition-colors",u.value===l.id?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"])},g(l.label),11,I)),64))]),u.value==="general"?(d(),s("div",D,[t("div",null,[e[13]||(e[13]=t("label",{class:"text-sm font-medium"},"Default Model",-1)),a(t("input",{"onUpdate:modelValue":e[0]||(e[0]=l=>o.value.defaultModel=l),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,o.value.defaultModel]])]),t("div",null,[e[14]||(e[14]=t("label",{class:"text-sm font-medium"},"Port",-1)),a(t("input",{"onUpdate:modelValue":e[1]||(e[1]=l=>o.value.port=l),type:"number",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,o.value.port,void 0,{number:!0}]]),e[15]||(e[15]=t("p",{class:"text-xs text-muted-foreground mt-1"},"Requires restart to take effect",-1))]),t("div",null,[e[17]||(e[17]=t("label",{class:"text-sm font-medium"},"Background Notify Mode",-1)),a(t("select",{"onUpdate:modelValue":e[2]||(e[2]=l=>o.value.backgroundNotifyMode=l),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[16]||(e[16]=[t("option",{value:"all"},"All",-1),t("option",{value:"meaningful"},"Meaningful",-1),t("option",{value:"off"},"Off",-1)])],512),[[T,o.value.backgroundNotifyMode]])]),t("div",K,[a(t("input",{"onUpdate:modelValue":e[3]||(e[3]=l=>o.value.backgroundNotifyTelegram=l),type:"checkbox",id:"notifyTelegram",class:"rounded"},null,512),[[p,o.value.backgroundNotifyTelegram]]),e[18]||(e[18]=t("label",{for:"notifyTelegram",class:"text-sm font-medium"},"Send notifications via Telegram",-1))])])):b("",!0),u.value==="telegram"?(d(),s("div",L,[t("div",null,[e[19]||(e[19]=t("label",{class:"text-sm font-medium"},"Bot Token",-1)),a(t("input",{"onUpdate:modelValue":e[4]||(e[4]=l=>o.value.telegramBotToken=l),type:"password",placeholder:"Enter new token to update",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,o.value.telegramBotToken]])]),t("div",null,[e[20]||(e[20]=t("label",{class:"text-sm font-medium"},"Authorized User ID",-1)),a(t("input",{"onUpdate:modelValue":e[5]||(e[5]=l=>o.value.authorizedUserId=l),type:"number",placeholder:"123456789",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,o.value.authorizedUserId,void 0,{number:!0}]])]),t("div",j,[a(t("input",{"onUpdate:modelValue":e[6]||(e[6]=l=>o.value.telegramEnabled=l),type:"checkbox",id:"telegramEnabled",class:"rounded"},null,512),[[p,o.value.telegramEnabled]]),e[21]||(e[21]=t("label",{for:"telegramEnabled",class:"text-sm font-medium"},"Enable Telegram Bot",-1))])])):b("",!0),u.value==="auth"?(d(),s("div",O,[t("div",null,[e[22]||(e[22]=t("label",{class:"text-sm font-medium"},"Supabase URL",-1)),a(t("input",{"onUpdate:modelValue":e[7]||(e[7]=l=>o.value.supabaseUrl=l),placeholder:"https://your-project.supabase.co",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,o.value.supabaseUrl]])]),t("div",null,[e[23]||(e[23]=t("label",{class:"text-sm font-medium"},"Supabase Anon Key",-1)),a(t("input",{"onUpdate:modelValue":e[8]||(e[8]=l=>o.value.supabaseAnonKey=l),type:"password",placeholder:"Enter new key to update",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,o.value.supabaseAnonKey]])]),t("div",null,[e[24]||(e[24]=t("label",{class:"text-sm font-medium"},"Authorized Email",-1)),a(t("input",{"onUpdate:modelValue":e[9]||(e[9]=l=>o.value.authorizedEmail=l),type:"email",placeholder:"you@example.com",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,o.value.authorizedEmail]])])])):b("",!0),u.value==="advanced"?(d(),s("div",q,[t("div",F,[a(t("input",{"onUpdate:modelValue":e[10]||(e[10]=l=>o.value.selfEditEnabled=l),type:"checkbox",id:"selfEdit",class:"rounded"},null,512),[[p,o.value.selfEditEnabled]]),e[25]||(e[25]=t("div",null,[t("label",{for:"selfEdit",class:"text-sm font-medium"},"Self-Edit Mode"),t("p",{class:"text-xs text-muted-foreground"},"Allow IO to modify its own source code")],-1))]),t("div",G,[a(t("input",{"onUpdate:modelValue":e[11]||(e[11]=l=>o.value.watchdogEnabled=l),type:"checkbox",id:"watchdog",class:"rounded"},null,512),[[p,o.value.watchdogEnabled]]),e[26]||(e[26]=t("div",null,[t("label",{for:"watchdog",class:"text-sm font-medium"},"Watchdog"),t("p",{class:"text-xs text-muted-foreground"},"Monitor event loop and zombie instances")],-1))])])):b("",!0)],64))]))}});export{H as default};
@@ -1,4 +1,4 @@
1
- import{l as fe,o as me,s as xe,u as o,k as a,h as t,q as E,n as u,D as d,m as q,F as p,T as C,O as M,V as ee,z as r,j as S,P as te,w as se,N as ge,i as oe,f as le,v as n,g as ye,W as ae}from"./index-BOXcmvk8.js";import{b as z,c as O,d as be,a as ke}from"./api-CKoqb3Uc.js";import{P as ne}from"./plus-DgKU-0vm.js";import{S as he}from"./search-CM4X0KHN.js";import{P as _e,S as we}from"./save-C44cl5KP.js";import{X as Ce}from"./x-vkAu6_RE.js";import{T as Se}from"./trash-2-D8LQMu7D.js";/**
1
+ import{l as fe,o as me,s as xe,u as o,k as a,h as t,q as E,n as u,D as d,m as q,F as p,T as C,O as M,V as ee,z as r,j as S,P as te,w as se,N as ge,i as oe,f as le,v as n,g as ye,W as ae}from"./index-CZM0UQQJ.js";import{b as z,c as O,d as be,a as ke}from"./api-CdLJWHnn.js";import{P as ne}from"./plus-CoUrXVZm.js";import{S as he}from"./search-CMwjTbNl.js";import{P as _e,S as we}from"./save-CttKqFu3.js";import{X as Ce}from"./x-D82kR2fu.js";import{T as Se}from"./trash-2-C1-PiQou.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{l as A,o as J,Q as V,s as z,p as R,t as H,u as s,k as o,h as t,n as p,D as c,A as B,q as _,z as i,d as F,m as h,j as v,i as I,F as C,w as D,f as E,v as m,g as G,R as U,r as Q,J as X,x as Z,U as W}from"./index-BOXcmvk8.js";import{b as O,e as K,c as P,a as Y}from"./api-CKoqb3Uc.js";import{g as ee}from"./squad-colors-B8B_Y-lz.js";import{X as te}from"./x-vkAu6_RE.js";import{G as se}from"./git-branch-BYVsshPr.js";import{T as oe}from"./trash-2-D8LQMu7D.js";import{A as re}from"./arrow-left-DB67XHhN.js";/**
1
+ import{l as A,o as J,Q as V,s as z,p as R,t as H,u as s,k as o,h as t,n as p,D as c,A as B,q as _,z as i,d as F,m as h,j as v,i as I,F as C,w as D,f as E,v as m,g as G,R as U,r as Q,J as X,x as Z,U as W}from"./index-CZM0UQQJ.js";import{b as O,e as K,c as P,a as Y}from"./api-CdLJWHnn.js";import{g as ee}from"./squad-colors-B8B_Y-lz.js";import{X as te}from"./x-D82kR2fu.js";import{G as se}from"./git-branch-D5N3GVQo.js";import{T as oe}from"./trash-2-C1-PiQou.js";import{A as re}from"./arrow-left-27p7HUxd.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{b as B}from"./api-CKoqb3Uc.js";import{l as I,o as L,s as M,u as o,k as n,h as t,n as u,D as l,A as T,m as g,e as _,F as f,w as h,v,g as N,q as k,R as P,z as a,i as x,j as p,b,x as V}from"./index-BOXcmvk8.js";import{T as w}from"./triangle-alert-CTfkTIuU.js";import{G as $}from"./git-branch-BYVsshPr.js";/**
1
+ import{b as B}from"./api-CdLJWHnn.js";import{l as I,o as L,s as M,u as o,k as n,h as t,n as u,D as l,A as T,m as g,e as _,F as f,w as h,v,g as N,q as k,R as P,z as a,i as x,j as p,b,x as V}from"./index-CZM0UQQJ.js";import{T as w}from"./triangle-alert-BKZFqU_A.js";import{G as $}from"./git-branch-D5N3GVQo.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{b as y}from"./api-CKoqb3Uc.js";import{g as v}from"./squad-colors-B8B_Y-lz.js";import{l as h,o as k,s as b,u as o,k as r,h as t,n as c,D as l,e as w,F as L,w as C,v as d,i as S,R as B,r as f,x as N,z as n,m as _,j as V}from"./index-BOXcmvk8.js";import{G as j}from"./git-branch-BYVsshPr.js";/**
1
+ import{b as y}from"./api-CdLJWHnn.js";import{g as v}from"./squad-colors-B8B_Y-lz.js";import{l as h,o as k,s as b,u as o,k as r,h as t,n as c,D as l,e as w,F as L,w as C,v as d,i as S,R as B,r as f,x as N,z as n,m as _,j as V}from"./index-CZM0UQQJ.js";import{G as j}from"./git-branch-D5N3GVQo.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1 @@
1
+ import{o as t,u as s,k as r,q as l,h as d}from"./index-CZM0UQQJ.js";const u=["aria-label","aria-checked","disabled"],m=t({__name:"ToggleSwitch",props:{modelValue:{type:Boolean},ariaLabel:{default:"Toggle"},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:o}){const a=e,i=o;function n(){a.disabled||i("update:modelValue",!a.modelValue)}return(c,b)=>(s(),r("button",{type:"button",role:"switch","aria-label":e.ariaLabel,"aria-checked":e.modelValue,disabled:e.disabled,class:l(["inline-flex h-6 w-10 shrink-0 items-center rounded-full border border-border p-0.5 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e.modelValue?"bg-gradient-brand shadow-[0_0_0_1px_rgba(228,58,156,0.35)]":"bg-muted"]),onClick:n},[d("span",{class:l(["pointer-events-none h-4 w-4 rounded-full bg-white shadow-sm ring-1 ring-black/10 transition-transform duration-200",e.modelValue?"translate-x-5":"translate-x-0"])},null,2)],10,u))}});export{m as _};
@@ -1,4 +1,4 @@
1
- import{l as q,o as Q,s as R,u as d,k as r,h as t,n as _,D as k,C as W,F as i,w as m,m as w,z as o,e as X,j as u,T as O,O as B,v as a,q as Y,r as Z,g as tt}from"./index-BOXcmvk8.js";import{b as T,d as z}from"./api-CKoqb3Uc.js";import{T as et}from"./triangle-alert-CTfkTIuU.js";/**
1
+ import{l as q,o as Q,s as R,u as d,k as r,h as t,n as _,D as k,C as W,F as i,w as m,m as w,z as o,e as X,j as u,T as O,O as B,v as a,q as Y,r as Z,g as tt}from"./index-CZM0UQQJ.js";import{b as T,d as z}from"./api-CdLJWHnn.js";import{T as et}from"./triangle-alert-BKZFqU_A.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{l as T,o as oe,Q as se,u as s,k as a,F as b,w as U,g as H,h as t,i as I,D as d,n as v,z as j,r as ce,q as z,W as ve,j as B,v as c,s as pe,B as K,m as S,T as L,O as N,V as O,f as R}from"./index-BOXcmvk8.js";import{b as q,d as E,a as Z}from"./api-CKoqb3Uc.js";import{F as fe}from"./file-text-G4fJOXsY.js";import{S as me}from"./search-CM4X0KHN.js";import{P as G}from"./plus-DgKU-0vm.js";import{P as X,S as J}from"./save-C44cl5KP.js";import{T as Y}from"./trash-2-D8LQMu7D.js";import{X as ee}from"./x-vkAu6_RE.js";/**
1
+ import{l as T,o as oe,Q as se,u as s,k as a,F as b,w as U,g as H,h as t,i as I,D as d,n as v,z as j,r as ce,q as z,W as ve,j as B,v as c,s as pe,B as K,m as S,T as L,O as N,V as O,f as R}from"./index-CZM0UQQJ.js";import{b as q,d as E,a as Z}from"./api-CdLJWHnn.js";import{F as fe}from"./file-text-Dk0fT3q_.js";import{S as me}from"./search-CMwjTbNl.js";import{P as G}from"./plus-CoUrXVZm.js";import{P as X,S as J}from"./save-CttKqFu3.js";import{T as Y}from"./trash-2-C1-PiQou.js";import{X as ee}from"./x-D82kR2fu.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{E as i,y as c}from"./index-BOXcmvk8.js";const o="/api";function u(t){try{return JSON.parse(atob(t.split(".")[1])).exp*1e3<=Date.now()+6e4}catch{return!0}}async function n(){const t=i(),e={"Content-Type":"application/json"};return t.token&&u(t.token)&&await t.refreshToken(),t.token&&(e.Authorization=`Bearer ${t.token}`),e}async function s(t,e){if(t.status===401){const r=i();try{if(await r.refreshToken(),r.token){const a=await e();if(a.status===401)throw r.logout(),c.push("/login"),new Error("Session expired");return a}}catch{}throw r.logout(),c.push("/login"),new Error("Session expired")}return t}async function w(t){const e=await s(await fetch(`${o}${t}`,{headers:await n()}),async()=>fetch(`${o}${t}`,{headers:await n()}));if(!e.ok)throw new Error(`API error: ${e.status}`);return e.json()}async function f(t,e){const r={method:"POST",headers:await n(),body:e?JSON.stringify(e):void 0},a=await s(await fetch(`${o}${t}`,r),async()=>fetch(`${o}${t}`,{...r,headers:await n()}));if(!a.ok)throw new Error(`API error: ${a.status}`);return a.json()}async function $(t,e){const r={method:"PUT",headers:await n(),body:e?JSON.stringify(e):void 0},a=await s(await fetch(`${o}${t}`,r),async()=>fetch(`${o}${t}`,{...r,headers:await n()}));if(!a.ok)throw new Error(`API error: ${a.status}`);return a.json()}async function d(t){const e={method:"DELETE",headers:await n()},r=await s(await fetch(`${o}${t}`,e),async()=>fetch(`${o}${t}`,{...e,headers:await n()}));if(!r.ok)throw new Error(`API error: ${r.status}`);return r.json()}function p(){const t=i(),e=`${o}/stream?token=${t.token??""}`;return new EventSource(e)}export{d as a,w as b,f as c,$ as d,p as e};
1
+ import{E as i,y as c}from"./index-CZM0UQQJ.js";const o="/api";function u(t){try{return JSON.parse(atob(t.split(".")[1])).exp*1e3<=Date.now()+6e4}catch{return!0}}async function n(){const t=i(),e={"Content-Type":"application/json"};return t.token&&u(t.token)&&await t.refreshToken(),t.token&&(e.Authorization=`Bearer ${t.token}`),e}async function s(t,e){if(t.status===401){const r=i();try{if(await r.refreshToken(),r.token){const a=await e();if(a.status===401)throw r.logout(),c.push("/login"),new Error("Session expired");return a}}catch{}throw r.logout(),c.push("/login"),new Error("Session expired")}return t}async function w(t){const e=await s(await fetch(`${o}${t}`,{headers:await n()}),async()=>fetch(`${o}${t}`,{headers:await n()}));if(!e.ok)throw new Error(`API error: ${e.status}`);return e.json()}async function f(t,e){const r={method:"POST",headers:await n(),body:e?JSON.stringify(e):void 0},a=await s(await fetch(`${o}${t}`,r),async()=>fetch(`${o}${t}`,{...r,headers:await n()}));if(!a.ok)throw new Error(`API error: ${a.status}`);return a.json()}async function $(t,e){const r={method:"PUT",headers:await n(),body:e?JSON.stringify(e):void 0},a=await s(await fetch(`${o}${t}`,r),async()=>fetch(`${o}${t}`,{...r,headers:await n()}));if(!a.ok)throw new Error(`API error: ${a.status}`);return a.json()}async function d(t){const e={method:"DELETE",headers:await n()},r=await s(await fetch(`${o}${t}`,e),async()=>fetch(`${o}${t}`,{...e,headers:await n()}));if(!r.ok)throw new Error(`API error: ${r.status}`);return r.json()}function p(){const t=i(),e=`${o}/stream?token=${t.token??""}`;return new EventSource(e)}export{d as a,w as b,f as c,$ as d,p as e};
@@ -1,4 +1,4 @@
1
- import{l as e}from"./index-BOXcmvk8.js";/**
1
+ import{l as e}from"./index-CZM0UQQJ.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{l as e}from"./index-BOXcmvk8.js";/**
1
+ import{l as e}from"./index-CZM0UQQJ.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{l as c}from"./index-BOXcmvk8.js";/**
1
+ import{l as c}from"./index-CZM0UQQJ.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.