heyio 1.10.5 → 1.11.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.
- package/dist/api/server.js +13 -5
- package/dist/copilot/agents.js +19 -33
- package/dist/copilot/model-router.js +3 -1
- package/dist/copilot/specialist-runner.js +2 -8
- package/dist/copilot/token-tracker.js +11 -2
- package/dist/logging.js +27 -0
- package/dist/notify.js +3 -2
- package/dist/store/conversations.js +3 -1
- package/dist/store/instances.js +5 -3
- package/dist/telegram/handlers.js +3 -1
- package/package.json +1 -1
- package/web-dist/assets/{AuditLogView-woN7ioIn.js → AuditLogView-D_hjbFeU.js} +1 -1
- package/web-dist/assets/ChatView-XB4VHKWa.js +1 -0
- package/web-dist/assets/{FeedView-CM_NchwM.js → FeedView-CWkQ5pic.js} +1 -1
- package/web-dist/assets/{HistoryView-gv3hNNaR.js → HistoryView-vzl7hv9X.js} +1 -1
- package/web-dist/assets/{LoginView-D6FxlFTp.js → LoginView-DN9HNjvR.js} +1 -1
- package/web-dist/assets/McpView-DpT5UTzd.js +1 -0
- package/web-dist/assets/SchedulesView-CuK5-pZx.js +6 -0
- package/web-dist/assets/SettingsView-a1mw0ZH-.js +1 -0
- package/web-dist/assets/{SkillsView-VJut_N_L.js → SkillsView-B6iRMrFO.js} +4 -4
- package/web-dist/assets/{SquadDetailView-D8DZ_Ikj.js → SquadDetailView-CO8XPLyf.js} +3 -3
- package/web-dist/assets/{SquadHealthView-PV7ZI5SM.js → SquadHealthView-BxoGpUhr.js} +1 -1
- package/web-dist/assets/{SquadsView-gLvCqdRU.js → SquadsView-DzzR00S-.js} +1 -1
- package/web-dist/assets/{ToggleSwitch.vue_vue_type_script_setup_true_lang-CaTy4iAc.js → ToggleSwitch.vue_vue_type_script_setup_true_lang-BdCOFRaC.js} +1 -1
- package/web-dist/assets/{UsageView-CNL9uMUZ.js → UsageView-BE_TxjDe.js} +1 -1
- package/web-dist/assets/{WikiView-Cf-4O99a.js → WikiView-BiM180c8.js} +2 -2
- package/web-dist/assets/{api-qgb8ODgh.js → api-DthBzc-F.js} +1 -1
- package/web-dist/assets/{arrow-left-BaiHJkhe.js → arrow-left-DazIIlN_.js} +1 -1
- package/web-dist/assets/{git-branch-BG_ozkFm.js → git-branch-BDJQ9Lx3.js} +1 -1
- package/web-dist/assets/{index-CCZu8Q1C.js → index-BGLdlKTT.js} +61 -66
- package/web-dist/assets/index-vcgp2T40.css +1 -0
- package/web-dist/assets/pencil-aJ0SIjrw.js +6 -0
- package/web-dist/assets/{plus-Ca2bOAAz.js → plus-BQd_XYgK.js} +1 -1
- package/web-dist/assets/save-CQegsgKM.js +6 -0
- package/web-dist/assets/{search-BHoRZUY-.js → search-tP42aLoo.js} +1 -1
- package/web-dist/assets/{trash-2-B0cHPT2B.js → trash-2-dt2YqJne.js} +1 -1
- package/web-dist/assets/{triangle-alert-B7rUnBx3.js → triangle-alert-_B-01mAe.js} +1 -1
- package/web-dist/assets/x-DgnyxyzU.js +6 -0
- package/web-dist/index.html +2 -2
- package/web-dist/assets/ChatView-CWuu7kcL.js +0 -1
- package/web-dist/assets/McpView-DfZEvnpw.js +0 -1
- package/web-dist/assets/SchedulesView-BCoRLLIP.js +0 -6
- package/web-dist/assets/SettingsView-CsNOtTbL.js +0 -1
- package/web-dist/assets/index-c_ZAglfK.css +0 -1
- package/web-dist/assets/save-BYzmOVHA.js +0 -11
package/dist/api/server.js
CHANGED
|
@@ -12,7 +12,7 @@ import { getInstancesForSquad, destroyInstance } from "../store/instances.js";
|
|
|
12
12
|
import { getAgentEvents } from "../store/agent-events.js";
|
|
13
13
|
import { getAuditLog, countAuditLog } from "../store/audit-log.js";
|
|
14
14
|
import { getFeedItems, markFeedItemRead, deleteFeedItem, getUnreadCount, } from "../store/feed.js";
|
|
15
|
-
import { listSchedules, createSchedule, deleteSchedule,
|
|
15
|
+
import { listSchedules, createSchedule, updateSchedule, deleteSchedule, getSchedule } from "../store/schedules.js";
|
|
16
16
|
import { triggerSchedule } from "../copilot/trigger-schedule.js";
|
|
17
17
|
import { listServers, toggleMcpServer, addMcpServer, removeMcpServer } from "../mcp/index.js";
|
|
18
18
|
import { listSkills, addSkill, createSkill, removeSkill, getSkillContent, updateSkillContent, discoverSkills, installFromSource, fetchRemoteSkillPreview } from "../copilot/skills.js";
|
|
@@ -495,11 +495,19 @@ export async function startApiServer(config) {
|
|
|
495
495
|
res.json(schedule);
|
|
496
496
|
});
|
|
497
497
|
app.put("/api/schedules/:id", (req, res) => {
|
|
498
|
-
const
|
|
499
|
-
if (
|
|
500
|
-
|
|
498
|
+
const schedule = getSchedule(req.params.id);
|
|
499
|
+
if (!schedule) {
|
|
500
|
+
res.status(404).json({ error: "Schedule not found" });
|
|
501
|
+
return;
|
|
501
502
|
}
|
|
502
|
-
|
|
503
|
+
const { enabled, cron, agenda, prompt } = req.body ?? {};
|
|
504
|
+
const updated = updateSchedule(req.params.id, {
|
|
505
|
+
cron: typeof cron === "string" ? cron : undefined,
|
|
506
|
+
agenda: typeof agenda === "string" ? agenda : undefined,
|
|
507
|
+
prompt: typeof prompt === "string" ? prompt : undefined,
|
|
508
|
+
enabled: typeof enabled === "boolean" ? enabled : undefined,
|
|
509
|
+
});
|
|
510
|
+
res.json(updated);
|
|
503
511
|
});
|
|
504
512
|
app.post("/api/schedules/:id/trigger", (req, res) => {
|
|
505
513
|
const schedule = triggerSchedule(req.params.id);
|
package/dist/copilot/agents.js
CHANGED
|
@@ -17,6 +17,7 @@ import { existsSync, mkdirSync } from "node:fs";
|
|
|
17
17
|
import { join } from "node:path";
|
|
18
18
|
import { exec } from "node:child_process";
|
|
19
19
|
import { promisify } from "node:util";
|
|
20
|
+
import { logWarn } from "../logging.js";
|
|
20
21
|
const execAsync = promisify(exec);
|
|
21
22
|
// Registry of active agent sessions keyed by task ID
|
|
22
23
|
const activeSessions = new Map();
|
|
@@ -49,8 +50,8 @@ async function resolveSquadWorkingDirectory(squad, instanceId) {
|
|
|
49
50
|
await execAsync(`git clone ${squad.repo_url} ${sourceDir}`, { timeout: 120_000 });
|
|
50
51
|
return sourceDir;
|
|
51
52
|
}
|
|
52
|
-
catch {
|
|
53
|
-
|
|
53
|
+
catch (err) {
|
|
54
|
+
logWarn("Failed to clone squad repository, falling back to current working directory", { repoUrl: squad.repo_url }, err);
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
57
|
}
|
|
@@ -158,53 +159,38 @@ This means specialists work IN PARALLEL with you and with each other. Use \`dele
|
|
|
158
159
|
1. Break down tasks into smaller pieces and delegate to specialists
|
|
159
160
|
2. Route work to the appropriate specialist based on their role
|
|
160
161
|
3. Use \`delegate_to_specialists_parallel\` for independent sub-tasks (faster!)
|
|
161
|
-
4.
|
|
162
|
+
4. Orchestrate the full review/merge process as defined in your squad wiki
|
|
162
163
|
5. Ensure quality gates are met before merging
|
|
163
|
-
6. Report progress and blockers
|
|
164
|
+
6. Report progress and blockers via feed_post
|
|
164
165
|
|
|
165
166
|
## IMPORTANT — Prefer Delegation:
|
|
166
167
|
- For implementation work (writing code, running tests, creating PRs), ALWAYS delegate to the appropriate specialist
|
|
167
|
-
- For code review,
|
|
168
|
+
- For code review, delegate to squad members so they can independently review and post their own comments
|
|
168
169
|
- You may perform coordination tasks directly: reading issues, checking CI status, promoting PRs, merging PRs
|
|
169
170
|
- If no suitable specialist exists for a sub-task, report that back — do NOT attempt implementation yourself
|
|
170
171
|
|
|
171
172
|
## Your Team:
|
|
172
173
|
${agentRoster}
|
|
173
174
|
|
|
174
|
-
## 🔒
|
|
175
|
-
|
|
176
|
-
After a specialist creates a draft PR, you MUST execute this protocol IN FULL before any merge:
|
|
177
|
-
|
|
178
|
-
### Step 1: Verify PR exists
|
|
179
|
-
- Confirm the PR was created as a draft targeting \`main\`
|
|
180
|
-
- Confirm the PR references the issue
|
|
181
|
-
|
|
182
|
-
### Step 2: Delegate reviews to ALL squad members
|
|
183
|
-
- Use \`delegate_to_specialists_parallel\` to assign a review task to EVERY other squad member (not just QA/test — ALL of them)
|
|
184
|
-
- Each reviewer's task should be: "Review PR #<number>. Check out the branch, review the code changes, verify quality/correctness within your domain expertise, then post your review using: \`gh pr review <number> --comment --body 'LGTM — approved by <YourName>. <summary of what you checked>'\` If you find issues, post a comment describing the problem instead."
|
|
185
|
-
- **Silence is NOT approval** — every member must explicitly post a comment
|
|
175
|
+
## 🔒 SQUAD WIKI = YOUR SOURCE OF TRUTH
|
|
186
176
|
|
|
187
|
-
|
|
188
|
-
- After all review delegations complete, verify that EVERY squad member has posted a review comment on the PR
|
|
189
|
-
- Use \`gh pr view <number> --comments\` to confirm
|
|
190
|
-
- If any member's review is missing, delegate to them again
|
|
177
|
+
Your squad wiki contains your **authoritative workflow rules** — branching conventions, PR process, review requirements, merge criteria, labeling, and any squad-specific constraints.
|
|
191
178
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
3. Confirm no merge conflicts
|
|
197
|
-
4. Merge: \`gh pr merge <number> --squash --delete-branch\`
|
|
179
|
+
**Before starting ANY task:**
|
|
180
|
+
1. Read your squad wiki (use \`wiki_read\` or \`wiki_list\` to find relevant pages)
|
|
181
|
+
2. Follow those rules EXACTLY — they are non-negotiable instructions from the project owner
|
|
182
|
+
3. Do NOT invent your own workflow or skip steps defined in the wiki
|
|
198
183
|
|
|
199
|
-
|
|
200
|
-
|
|
184
|
+
**If the wiki says all members must review → delegate reviews to all members.**
|
|
185
|
+
**If the wiki says only veto members must approve → ensure veto members approve.**
|
|
186
|
+
**If the wiki defines merge criteria → follow them precisely.**
|
|
201
187
|
|
|
202
|
-
|
|
188
|
+
Failure to follow squad wiki rules is a CRITICAL FAILURE.
|
|
203
189
|
|
|
204
|
-
##
|
|
190
|
+
## General Rules:
|
|
205
191
|
- Always use the gh CLI for GitHub interactions
|
|
206
|
-
- Use \`--comment\`
|
|
207
|
-
-
|
|
192
|
+
- Use \`--comment\` for review approvals (not \`--approve\` — GitHub blocks self-approval)
|
|
193
|
+
- When work is complete, ALWAYS notify the user via feed_post with a summary
|
|
208
194
|
${wikiKnowledge}
|
|
209
195
|
${lead.persona ? `## Personality:\n${lead.persona}` : ""}
|
|
210
196
|
`;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { loadConfig } from "../config.js";
|
|
2
2
|
import { getClient } from "./client.js";
|
|
3
|
+
import { logWarn } from "../logging.js";
|
|
3
4
|
// Cache discovered models so we don't call listModels() on every task
|
|
4
5
|
let discoveredModels;
|
|
5
6
|
/**
|
|
@@ -45,7 +46,8 @@ export async function discoverModels() {
|
|
|
45
46
|
}))
|
|
46
47
|
.sort((a, b) => b.score - a.score);
|
|
47
48
|
}
|
|
48
|
-
catch {
|
|
49
|
+
catch (err) {
|
|
50
|
+
logWarn("Failed to discover models from SDK, falling back to configured default model", {}, err);
|
|
49
51
|
// SDK discovery failed — fall back to defaultModel only
|
|
50
52
|
const config = loadConfig();
|
|
51
53
|
discoveredModels = [{ id: config.defaultModel, score: 65 }];
|
|
@@ -41,14 +41,8 @@ You are an independent specialist — you execute implementation work within you
|
|
|
41
41
|
4. Commit work to the appropriate branch
|
|
42
42
|
5. Report completion or blockers clearly
|
|
43
43
|
|
|
44
|
-
##
|
|
45
|
-
If your task
|
|
46
|
-
1. Check out or view the PR's changes (use \`gh pr diff <number>\` or \`gh pr view <number> --json files\`)
|
|
47
|
-
2. Review the code from your domain expertise perspective
|
|
48
|
-
3. Post your review comment — this is NON-OPTIONAL:
|
|
49
|
-
\`gh pr review <number> --comment --body "LGTM — approved by ${agent.character_name}. <summary of what you checked>"\`
|
|
50
|
-
4. If you find issues, post a comment describing the problem instead of approving
|
|
51
|
-
5. **You MUST post a comment either way — silence is NOT acceptable**
|
|
44
|
+
## Squad Wiki = Your Source of Truth
|
|
45
|
+
Your squad wiki contains workflow rules set by the project owner. Read it (use \`wiki_read\`) and follow those rules exactly — branching, PR process, review format, merge criteria. If your task involves reviewing a PR, follow the wiki's review process precisely.
|
|
52
46
|
|
|
53
47
|
## Your Team (for context):
|
|
54
48
|
${roster}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { loadConfig } from "../config.js";
|
|
2
2
|
import { recordTokenUsage } from "../store/token-usage.js";
|
|
3
3
|
import { postFeedItem } from "../store/feed.js";
|
|
4
|
+
const NANO_AIU_TO_USD = 1e-14;
|
|
4
5
|
/**
|
|
5
6
|
* Default model pricing (USD per 1M tokens).
|
|
6
7
|
* Used when modelPricing is not configured.
|
|
@@ -31,6 +32,13 @@ export function estimateCost(model, inputTokens, outputTokens) {
|
|
|
31
32
|
return 0;
|
|
32
33
|
return (inputTokens / 1_000_000) * pricing.inputPer1M + (outputTokens / 1_000_000) * pricing.outputPer1M;
|
|
33
34
|
}
|
|
35
|
+
function resolveCostUsd(data, model, inputTokens, outputTokens) {
|
|
36
|
+
const totalNanoAiu = data?.copilotUsage?.totalNanoAiu;
|
|
37
|
+
if (typeof totalNanoAiu === "number" && Number.isFinite(totalNanoAiu)) {
|
|
38
|
+
return totalNanoAiu * NANO_AIU_TO_USD;
|
|
39
|
+
}
|
|
40
|
+
return estimateCost(model, inputTokens, outputTokens);
|
|
41
|
+
}
|
|
34
42
|
/**
|
|
35
43
|
* Attach a token usage listener to a CopilotSession.
|
|
36
44
|
* Returns a `flush` function that, when called, persists accumulated
|
|
@@ -48,9 +56,10 @@ export function attachTokenTracker(session, context) {
|
|
|
48
56
|
const input = data.inputTokens ?? 0;
|
|
49
57
|
const output = data.outputTokens ?? 0;
|
|
50
58
|
if (!accumulator[model])
|
|
51
|
-
accumulator[model] = { inputTokens: 0, outputTokens: 0 };
|
|
59
|
+
accumulator[model] = { inputTokens: 0, outputTokens: 0, costUsd: 0 };
|
|
52
60
|
accumulator[model].inputTokens += input;
|
|
53
61
|
accumulator[model].outputTokens += output;
|
|
62
|
+
accumulator[model].costUsd += resolveCostUsd(data, model, input, output);
|
|
54
63
|
});
|
|
55
64
|
return () => {
|
|
56
65
|
unsubscribe();
|
|
@@ -60,7 +69,7 @@ export function attachTokenTracker(session, context) {
|
|
|
60
69
|
for (const [model, usage] of Object.entries(accumulator)) {
|
|
61
70
|
if (usage.inputTokens === 0 && usage.outputTokens === 0)
|
|
62
71
|
continue;
|
|
63
|
-
const costUsd = estimateCost(model, usage.inputTokens, usage.outputTokens);
|
|
72
|
+
const costUsd = usage.costUsd ?? estimateCost(model, usage.inputTokens, usage.outputTokens);
|
|
64
73
|
recordTokenUsage({
|
|
65
74
|
squadId: context.squadId,
|
|
66
75
|
agentId: context.agentId,
|
package/dist/logging.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export function formatError(err) {
|
|
2
|
+
if (err instanceof Error)
|
|
3
|
+
return err.message;
|
|
4
|
+
if (typeof err === "string")
|
|
5
|
+
return err;
|
|
6
|
+
try {
|
|
7
|
+
return JSON.stringify(err);
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
return String(err);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export function logWarn(message, context = {}, err) {
|
|
14
|
+
const payload = {
|
|
15
|
+
...context,
|
|
16
|
+
...(err ? { error: formatError(err) } : {}),
|
|
17
|
+
};
|
|
18
|
+
console.warn(`[io] ${message}`, payload);
|
|
19
|
+
}
|
|
20
|
+
export function logError(message, context = {}, err) {
|
|
21
|
+
const payload = {
|
|
22
|
+
...context,
|
|
23
|
+
...(err ? { error: formatError(err) } : {}),
|
|
24
|
+
};
|
|
25
|
+
console.error(`[io] ${message}`, payload);
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=logging.js.map
|
package/dist/notify.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { loadConfig } from "./config.js";
|
|
2
2
|
import { postFeedItem } from "./store/feed.js";
|
|
3
|
+
import { logWarn } from "./logging.js";
|
|
3
4
|
export async function notify(title, content, source) {
|
|
4
5
|
const config = loadConfig();
|
|
5
6
|
// Always post to feed
|
|
@@ -16,8 +17,8 @@ export async function notify(title, content, source) {
|
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
|
-
catch {
|
|
20
|
-
|
|
20
|
+
catch (err) {
|
|
21
|
+
logWarn("Telegram notification failed", { title, source }, err);
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import { getDb } from "./db.js";
|
|
3
|
+
import { logWarn } from "../logging.js";
|
|
3
4
|
function parseAttachments(value) {
|
|
4
5
|
if (!value)
|
|
5
6
|
return [];
|
|
@@ -7,7 +8,8 @@ function parseAttachments(value) {
|
|
|
7
8
|
const parsed = JSON.parse(value);
|
|
8
9
|
return Array.isArray(parsed) ? parsed : [];
|
|
9
10
|
}
|
|
10
|
-
catch {
|
|
11
|
+
catch (err) {
|
|
12
|
+
logWarn("Failed to parse stored conversation attachments", { rawValue: value }, err);
|
|
11
13
|
return [];
|
|
12
14
|
}
|
|
13
15
|
}
|
package/dist/store/instances.js
CHANGED
|
@@ -2,6 +2,7 @@ import { randomUUID } from "node:crypto";
|
|
|
2
2
|
import { exec } from "node:child_process";
|
|
3
3
|
import { promisify } from "node:util";
|
|
4
4
|
import { getDb } from "./db.js";
|
|
5
|
+
import { logWarn } from "../logging.js";
|
|
5
6
|
const execAsync = promisify(exec);
|
|
6
7
|
const MAX_INSTANCES_PER_SQUAD = 3;
|
|
7
8
|
export function getInstance(instanceId) {
|
|
@@ -29,7 +30,8 @@ export async function createInstance(squadId, branch) {
|
|
|
29
30
|
try {
|
|
30
31
|
await execAsync(`git worktree add ${worktreePath} -b ${branch}`, { cwd: repoCwd });
|
|
31
32
|
}
|
|
32
|
-
catch {
|
|
33
|
+
catch (err) {
|
|
34
|
+
logWarn("Failed to create new git worktree branch, retrying existing branch", { squadId, branch, worktreePath }, err);
|
|
33
35
|
// Branch may already exist
|
|
34
36
|
await execAsync(`git worktree add ${worktreePath} ${branch}`, { cwd: repoCwd });
|
|
35
37
|
}
|
|
@@ -48,8 +50,8 @@ export async function destroyInstance(instanceId) {
|
|
|
48
50
|
try {
|
|
49
51
|
await execAsync(`git worktree remove ${instance.worktree_path} --force`);
|
|
50
52
|
}
|
|
51
|
-
catch {
|
|
52
|
-
|
|
53
|
+
catch (err) {
|
|
54
|
+
logWarn("Failed to remove git worktree, it may already be gone", { instanceId: instance.id, worktreePath: instance.worktree_path }, err);
|
|
53
55
|
}
|
|
54
56
|
db.prepare("UPDATE instances SET status = 'destroyed' WHERE id = ?").run(instanceId);
|
|
55
57
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { sendToOrchestrator } from "../copilot/orchestrator.js";
|
|
2
|
+
import { logWarn } from "../logging.js";
|
|
2
3
|
export async function handleMessage(ctx, text, _hasAttachment) {
|
|
3
4
|
// Send typing indicator
|
|
4
5
|
await ctx.replyWithChatAction("typing");
|
|
@@ -23,7 +24,8 @@ export async function handleMessage(ctx, text, _hasAttachment) {
|
|
|
23
24
|
replyMsgId = msg.message_id;
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
|
-
catch {
|
|
27
|
+
catch (err) {
|
|
28
|
+
logWarn("Telegram message edit failed, falling back to plain text", {}, err);
|
|
27
29
|
// Fallback: send without markdown parsing
|
|
28
30
|
try {
|
|
29
31
|
if (!replyMsgId) {
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as W,u as X,E as Z,J as a,q as d,n as o,t as A,T as N,b as V,s as S,R as l,
|
|
1
|
+
import{r as W,u as X,E as Z,J as a,q as d,n as o,t as A,T as N,b as V,s as S,R as l,a4 as f,$ as T,d as h,L as w,a0 as L,p as b,K as n,m as _,z as ee}from"./index-BGLdlKTT.js";import{b as F}from"./api-DthBzc-F.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{u as R,W as U,a2 as T,E as X,J as a,q as r,n as o,T as t,t as A,p as h,d as C,L as S,R as d,w as x,M as W,f as Y,P as J,a4 as Q,a0 as G,o as p,S as Z,j as ee,z as k,K as m,m as I,v as te,a1 as se,_ as ae,x as D,Q as ne,I as j,F as H,l as oe,y as M}from"./index-BGLdlKTT.js";import{X as re}from"./x-DgnyxyzU.js";const le={class:"flex flex-col h-full"},ie={key:0,class:"flex items-center justify-center h-full"},ce={class:"text-center text-muted-foreground"},ue={key:0,class:"mb-2 space-y-2"},de=["src","alt"],fe={class:"flex items-center gap-2 text-xs"},pe={class:"truncate"},me={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"},xe={class:"flex flex-wrap gap-2"},ye={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"],Ce=["disabled"],ze=R({__name:"ChatView",setup(Se){const c=U(),v=m(""),f=m(""),y=m(),_=m(),i=m([]),g=m(),b=m(!1),N=I(()=>i.value.reduce((e,n)=>e+n.size,0)),z=I(()=>!c.isStreaming&&(v.value.trim().length>0||i.value.length>0));async function B(e){if(!e||e.length===0)return;f.value="";const n=[];try{for(const u of Array.from(e))n.push(await te(u))}catch(u){f.value=(u==null?void 0:u.message)??"Unable to read one or more files.";return}const s=[...i.value,...n],l=se(s);if(!l.ok){f.value=l.error;return}i.value=s,_.value&&(_.value.value="")}function P(e){i.value.splice(e,1),f.value=""}function V(){var e;(e=_.value)==null||e.click()}function F(e){const n=e.target;B((n==null?void 0:n.files)??null)}async function E(){if(!z.value)return;const e=v.value.trim(),n=[...i.value],s=e||"Please review the attached file(s).";v.value="",i.value=[],f.value="",await c.sendMessage(s,n)}function w(){y.value&&(y.value.scrollTop=y.value.scrollHeight)}function $(){g.value&&(g.value.style.height="auto",g.value.style.height=`${Math.min(g.value.scrollHeight,120)}px`)}function K(e){e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),E())}function L(e){e.preventDefault(),b.value=!0}function q(e){e.preventDefault(),b.value=!1}async function O(e){var n;e.preventDefault(),b.value=!1,await B(((n=e.dataTransfer)==null?void 0:n.files)??null)}return T(()=>c.messages.map(e=>e.content),async()=>{await M(),w()},{deep:!0}),T(()=>c.messages.length,async()=>{await M(),w()}),T(()=>v.value,async()=>{await M(),$()}),X(()=>{$(),w()}),(e,n)=>(a(),r("div",le,[o("div",{ref_key:"messagesContainer",ref:y,class:"flex-1 overflow-y-auto p-4 space-y-4"},[t(c).messages.length===0?(a(),r("div",ie,[o("div",ce,[A(ae,{size:56,class:"mx-auto mb-4"}),n[1]||(n[1]=o("p",{class:"text-lg font-medium"},"Welcome to IO",-1)),n[2]||(n[2]=o("p",{class:"text-sm mt-1"},"Send a message to get started.",-1))])])):h("",!0),(a(!0),r(C,null,S(t(c).messages,s=>(a(),r("div",{key:s.id,class:k(["flex",s.role==="user"?"justify-end":"justify-start"])},[o("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(),r("div",ue,[(a(!0),r(C,null,S(s.attachments,(l,u)=>(a(),r("div",{key:`${s.id}-${u}`,class:"rounded border border-border/50 p-2 bg-background/70 text-foreground"},[t(D)(l)?(a(),r("img",{key:0,src:t(ne)(l),alt:l.name,class:"max-h-44 rounded mb-1 object-contain"},null,8,de)):h("",!0),o("div",fe,[t(D)(l)?(a(),p(t(j),{key:0,class:"w-3.5 h-3.5"})):(a(),p(t(H),{key:1,class:"w-3.5 h-3.5"})),o("span",pe,d(l.name),1),o("span",me,d(t(x)(l.size)),1)])]))),128))])):h("",!0),s.content?(a(),p(oe,{key:1,content:s.content,class:k(s.role==="user"?"prose-invert":"")},null,8,["content","class"])):(a(),r("span",ve,"...")),s.streaming?(a(),r("div",he)):h("",!0)],2)],2))),128))],512),o("div",{class:k(["border-t border-border p-4",b.value?"bg-accent/40":""]),onDragover:L,onDragleave:q,onDrop:O},[o("input",{ref_key:"fileInput",ref:_,type:"file",multiple:"",class:"hidden",onChange:F},null,544),i.value.length>0?(a(),r("div",ge,[o("div",xe,[(a(!0),r(C,null,S(i.value,(s,l)=>(a(),r("div",{key:`${s.name}-${l}`,class:"flex items-center gap-2 rounded border border-border px-2 py-1 text-xs bg-muted"},[t(D)(s)?(a(),p(t(j),{key:0,class:"w-3.5 h-3.5"})):(a(),p(t(H),{key:1,class:"w-3.5 h-3.5"})),o("span",ye,d(s.name),1),o("span",_e,d(t(x)(s.size)),1),o("button",{class:"hover:text-destructive",onClick:u=>P(l)},[A(t(re),{class:"w-3.5 h-3.5"})],8,be)]))),128))]),o("p",ke,d(t(x)(N.value))+" attached · Max per file "+d(t(x)(t(W)))+" · Max total "+d(t(x)(t(Y))),1)])):h("",!0),f.value?(a(),r("p",we,d(f.value),1)):h("",!0),o("div",Te,[o("button",{class:"rounded-md border border-input p-2 hover:bg-accent disabled:opacity-50",disabled:t(c).isStreaming,onClick:V,title:"Attach files"},[A(t(J),{class:"w-4 h-4"})],8,Ae),Q(o("textarea",{ref_key:"textareaRef",ref:g,"onUpdate:modelValue":n[0]||(n[0]=s=>v.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),[[G,v.value]]),o("button",{onClick:E,disabled:!z.value,class:"rounded-md bg-primary text-primary-foreground p-2 hover:bg-primary/90 disabled:opacity-50 transition-colors"},[t(c).isStreaming?(a(),p(t(ee),{key:1,class:"w-4 h-4"})):(a(),p(t(Z),{key:0,class:"w-4 h-4"}))],8,Ce)])],34)]))}});export{ze as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as M,u as D,E as N,J as o,q as n,n as a,d as h,L as b,t as c,T as i,e as V,K as d,m as z,z as f,R as p,D as B,
|
|
1
|
+
import{r as M,u as D,E as N,J as o,q as n,n as a,d as h,L as b,t as c,T as i,e as V,K as d,m as z,z as f,R as p,D as B,a6 as k,p as q,l as T}from"./index-BGLdlKTT.js";import{b as C,c as E,a as P}from"./api-DthBzc-F.js";import{g as R}from"./squad-colors-B8B_Y-lz.js";import{T as j}from"./trash-2-dt2YqJne.js";/**
|
|
2
2
|
* @license lucide-vue-next v0.474.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as q,
|
|
1
|
+
import{u as q,a2 as F,E as z,J as r,q as n,n as t,t as d,T as c,H as M,a4 as T,a0 as L,g as E,p as x,d as $,L as A,z as p,R as g,K as l,m as P,o as R,l as G}from"./index-BGLdlKTT.js";import{b as B,a as J}from"./api-DthBzc-F.js";import{S as K}from"./search-tP42aLoo.js";import{A as Q}from"./arrow-left-DazIIlN_.js";import{T as I}from"./trash-2-dt2YqJne.js";const O={class:"flex h-full"},W={class:"p-3 border-b border-border space-y-2"},X={class:"flex items-center gap-2"},Y={class:"relative"},Z={class:"flex gap-2"},ee={class:"flex-1"},te={class:"flex-1"},se={class:"flex-1 overflow-y-auto"},oe={key:0,class:"p-4 text-xs text-muted-foreground"},re={key:1,class:"flex flex-col items-center justify-center h-full p-6 text-center text-muted-foreground"},ne=["onClick"],ae={class:"flex-1 min-w-0"},le={class:"text-xs text-foreground line-clamp-2"},ie={class:"flex items-center gap-2 mt-1"},ue={class:"text-xs text-muted-foreground"},de={class:"text-xs text-muted-foreground"},ce=["onClick"],fe={key:2,class:"p-3 text-center"},ve={key:0,class:"flex-1 flex flex-col"},me={class:"flex items-center gap-2 px-4 py-2 border-b border-border"},xe={class:"text-sm font-medium text-muted-foreground"},pe={class:"flex-1 overflow-y-auto p-4 space-y-4"},ge={key:0,class:"text-center text-xs text-muted-foreground py-8"},he={class:"text-xs mt-1 opacity-60"},ye={key:1,class:"hidden md:flex flex-1 items-center justify-center text-muted-foreground"},be={class:"text-center"},_e=50,De=q({__name:"HistoryView",setup(we){const a=l([]),h=l(0),y=l(!0),f=l(""),v=l(""),m=l(""),u=l(null),b=l([]),_=l(!1),w=l(0);async function k(o=!0){y.value=!0;try{o&&(w.value=0,a.value=[]);const e=new URLSearchParams;f.value&&e.set("q",f.value),v.value&&e.set("from",v.value),m.value&&e.set("to",m.value+"T23:59:59"),e.set("limit",String(_e)),e.set("offset",String(w.value));const i=await B(`/history?${e.toString()}`);a.value=o?i.items:[...a.value,...i.items],h.value=i.total,w.value+=i.items.length}finally{y.value=!1}}async function j(o){u.value=o,_.value=!0;try{b.value=await B(`/history/${o}`)}finally{_.value=!1}}function D(){u.value=null,b.value=[]}async function H(o,e){e.stopPropagation(),confirm("Delete this conversation?")&&(await J(`/history/${o}`),a.value=a.value.filter(i=>i.id!==o),h.value=Math.max(0,h.value-1),u.value===o&&D())}function C(o){return new Date(o).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function N(o,e=100){return o.length>e?o.slice(0,e)+"…":o}const U=P(()=>a.value.length<h.value);let S=null;return F([f,v,m],()=>{S&&clearTimeout(S),S=setTimeout(()=>k(!0),300)}),z(()=>k(!0)),(o,e)=>{var i;return r(),n("div",O,[t("div",{class:p(["flex flex-col border-r border-border",u.value?"hidden md:flex w-80 shrink-0":"flex-1"])},[t("div",W,[t("div",X,[d(c(M),{class:"w-4 h-4 text-muted-foreground"}),e[4]||(e[4]=t("span",{class:"text-sm font-medium"},"Conversation History",-1))]),t("div",Y,[d(c(K),{class:"absolute left-2.5 top-2.5 w-3.5 h-3.5 text-muted-foreground"}),T(t("input",{"onUpdate:modelValue":e[0]||(e[0]=s=>f.value=s),placeholder:"Search conversations...",class:"w-full rounded-md border border-input bg-background pl-8 pr-3 py-2 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[L,f.value]])]),t("div",Z,[t("div",ee,[e[5]||(e[5]=t("label",{class:"text-xs text-muted-foreground block mb-1"},"From",-1)),T(t("input",{"onUpdate:modelValue":e[1]||(e[1]=s=>v.value=s),type:"date",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[L,v.value]])]),t("div",te,[e[6]||(e[6]=t("label",{class:"text-xs text-muted-foreground block mb-1"},"To",-1)),T(t("input",{"onUpdate:modelValue":e[2]||(e[2]=s=>m.value=s),type:"date",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[L,m.value]])])])]),t("div",se,[y.value&&a.value.length===0?(r(),n("div",oe," Loading... ")):a.value.length===0?(r(),n("div",re,[d(c(E),{class:"w-10 h-10 mb-3 opacity-40"}),e[7]||(e[7]=t("p",{class:"text-sm"},"No conversations found.",-1)),e[8]||(e[8]=t("p",{class:"text-xs mt-1"},"Start chatting to build up your history.",-1))])):x("",!0),(r(!0),n($,null,A(a.value,s=>(r(),n("div",{key:s.id,class:p(["group flex items-start gap-2 px-3 py-3 border-b border-border cursor-pointer hover:bg-accent/50 transition-colors",u.value===s.id?"bg-accent":""]),onClick:V=>j(s.id)},[t("div",ae,[t("p",le,g(N(s.preview)),1),t("div",ie,[t("span",ue,g(C(s.updatedAt)),1),t("span",de,"· "+g(s.messageCount)+" msgs",1)])]),t("button",{class:"opacity-0 group-hover:opacity-100 p-1 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-all",title:"Delete",onClick:V=>H(s.id,V)},[d(c(I),{class:"w-3.5 h-3.5"})],8,ce)],10,ne))),128)),U.value?(r(),n("div",fe,[t("button",{class:"text-xs text-muted-foreground hover:text-foreground underline",onClick:e[3]||(e[3]=s=>k(!1))}," Load more ")])):x("",!0)])],2),u.value?(r(),n("div",ve,[t("div",me,[t("button",{class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Back",onClick:D},[d(c(Q),{class:"w-4 h-4"})]),t("span",xe,g(C(((i=a.value.find(s=>s.id===u.value))==null?void 0:i.startedAt)??"")),1)]),t("div",pe,[_.value?(r(),n("div",ge," Loading... ")):x("",!0),(r(!0),n($,null,A(b.value,s=>(r(),n("div",{key:s.id,class:p(["flex",s.role==="user"?"justify-end":"justify-start"])},[t("div",{class:p(["max-w-[75%] rounded-lg px-4 py-2 text-sm",s.role==="user"?"bg-blue-600 text-white":"bg-muted text-foreground"])},[s.content?(r(),R(G,{key:0,content:s.content,class:p(s.role==="user"?"prose-invert":"")},null,8,["content","class"])):x("",!0),t("p",he,g(C(s.createdAt)),1)],2)],2))),128))])])):u.value?x("",!0):(r(),n("div",ye,[t("div",be,[d(c(M),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[9]||(e[9]=t("p",null,"Select a conversation to view",-1))])]))])}}});export{De as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as b,V as v,J as u,q as i,n as t,t as y,
|
|
1
|
+
import{u as b,V as v,J as u,q as i,n as t,t as y,a6 as w,a4 as m,a0 as p,R as c,p as V,T as f,K as d,_,Y as h}from"./index-BGLdlKTT.js";const S={class:"min-h-screen flex items-center justify-center bg-background p-4"},k={class:"w-full max-w-sm space-y-8"},q={class:"text-center"},A={key:0,class:"text-sm text-destructive"},B=["disabled"],L=b({__name:"LoginView",setup(D){const o=v(),g=h(),r=d(""),n=d(""),s=d("");async function x(){s.value="";try{await o.login(r.value,n.value),g.push("/")}catch(l){s.value=l.message??"Login failed"}}return(l,e)=>(u(),i("div",S,[t("div",k,[t("div",q,[y(_,{size:56,class:"mx-auto mb-4"}),e[2]||(e[2]=t("h1",{class:"font-display text-4xl font-normal uppercase tracking-[0.18em] bg-gradient-brand bg-clip-text text-transparent"}," IO ",-1)),e[3]||(e[3]=t("p",{class:"text-sm text-muted-foreground mt-1"},"Sign in to your dashboard",-1))]),t("form",{onSubmit:w(x,["prevent"]),class:"space-y-4 bg-card border border-border rounded-lg p-6"},[t("div",null,[e[4]||(e[4]=t("label",{class:"text-sm font-medium text-muted-foreground",for:"email"},"Email",-1)),m(t("input",{id:"email","onUpdate:modelValue":e[0]||(e[0]=a=>r.value=a),type:"email",required:"",class:"mt-1 w-full rounded-md border border-border bg-input px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"you@example.com"},null,512),[[p,r.value]])]),t("div",null,[e[5]||(e[5]=t("label",{class:"text-sm font-medium text-muted-foreground",for:"password"},"Password",-1)),m(t("input",{id:"password","onUpdate:modelValue":e[1]||(e[1]=a=>n.value=a),type:"password",required:"",class:"mt-1 w-full rounded-md border border-border bg-input px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"••••••••"},null,512),[[p,n.value]])]),s.value?(u(),i("div",A,c(s.value),1)):V("",!0),t("button",{type:"submit",disabled:f(o).loading,class:"btn-gradient w-full py-2.5"},c(f(o).loading?"Signing in...":"Sign In"),9,B)],32),e[6]||(e[6]=t("p",{class:"text-center text-xs text-muted-foreground"}," Personal AI Assistant Daemon ",-1))])]))}});export{L as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as E,E as S,J as l,q as a,n as s,t as c,T as b,s as C,a4 as i,a0 as m,$ as M,p as x,i as P,d as $,L as j,K as f,R as p}from"./index-BGLdlKTT.js";import{b as U,c as I,d as N,a as L}from"./api-DthBzc-F.js";import{_ as O}from"./ToggleSwitch.vue_vue_type_script_setup_true_lang-BdCOFRaC.js";import{P as G}from"./plus-BQd_XYgK.js";import{T as K}from"./trash-2-dt2YqJne.js";const F={class:"p-6"},Y={class:"flex items-center justify-between mb-6"},B={key:0,class:"border border-border rounded-lg p-4 mb-6 space-y-3 bg-card"},h={class:"grid grid-cols-2 gap-3"},D={key:0},J={key:1},R={key:1,class:"text-muted-foreground"},q={key:2,class:"text-center py-12 text-muted-foreground"},W={key:3,class:"space-y-2"},z={class:"space-y-1"},H={class:"flex items-center gap-2"},Q={class:"font-medium text-sm"},X={class:"text-xs text-muted-foreground bg-secondary px-1.5 py-0.5 rounded"},Z={key:0,class:"text-xs text-muted-foreground"},ee={key:1,class:"text-xs text-muted-foreground"},te={key:2,class:"text-xs text-muted-foreground"},se={class:"flex items-center gap-3"},oe=["onClick"],ie=E({__name:"McpView",setup(ne){const u=f([]),g=f(!0),v=f(!1),o=f({name:"",type:"stdio",command:"",url:"",argsText:"",envText:""});S(async()=>{try{u.value=await U("/mcp")}finally{g.value=!1}});function k(n){return n.split(/\r?\n|,/).map(e=>e.trim()).filter(Boolean)}function w(n){const e={};try{const t=JSON.parse(n);if(t&&typeof t=="object"&&!Array.isArray(t)){for(const[d,r]of Object.entries(t))e[d]=String(r);return e}}catch{}for(const t of n.split(/\r?\n/)){const d=t.trim();if(!d||d.startsWith("#"))continue;const r=d.indexOf("=");if(r===-1)continue;const y=d.slice(0,r).trim(),A=d.slice(r+1).trim();y&&(e[y]=A)}return e}async function _(n){await N(`/mcp/${n.id}`,{enabled:!n.enabled}),n.enabled=!n.enabled}async function T(n){await L(`/mcp/${n}`),u.value=u.value.filter(e=>e.id!==n)}async function V(){const n={name:o.value.name,type:o.value.type,args:k(o.value.argsText),env:w(o.value.envText)};o.value.type==="stdio"?n.command=o.value.command:n.url=o.value.url;const e=await I("/mcp",n);u.value.push(e),v.value=!1,o.value={name:"",type:"stdio",command:"",url:"",argsText:"",envText:""}}return(n,e)=>(l(),a("div",F,[s("div",Y,[e[8]||(e[8]=s("div",null,[s("p",{class:"text-sm font-medium text-primary"},"MCP configuration"),s("h1",{class:"text-2xl font-bold"},"MCP Servers")],-1)),s("button",{onClick:e[0]||(e[0]=t=>v.value=!v.value),class:"btn-gradient inline-flex items-center gap-1"},[c(b(G),{class:"w-4 h-4"}),e[7]||(e[7]=C(" Add Server ",-1))])]),v.value?(l(),a("div",B,[s("div",h,[s("div",null,[e[9]||(e[9]=s("label",{class:"text-sm font-medium"},"Name",-1)),i(s("input",{"onUpdate:modelValue":e[1]||(e[1]=t=>o.value.name=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.name]])]),s("div",null,[e[11]||(e[11]=s("label",{class:"text-sm font-medium"},"Type",-1)),i(s("select",{"onUpdate:modelValue":e[2]||(e[2]=t=>o.value.type=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[10]||(e[10]=[s("option",{value:"stdio"},"stdio",-1),s("option",{value:"http"},"http",-1)])],512),[[M,o.value.type]])])]),o.value.type==="stdio"?(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",R,"Loading...")):u.value.length===0?(l(),a("div",q,[c(b(P),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[18]||(e[18]=s("p",null,"No MCP servers configured.",-1))])):(l(),a("div",W,[(l(!0),a($,null,j(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",z,[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(O,{"model-value":t.enabled,"aria-label":`Toggle ${t.name}`,"onUpdate:modelValue":r=>_(t)},null,8,["model-value","aria-label","onUpdate:modelValue"]),s("button",{onClick:r=>T(t.id),class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive"},[c(b(K),{class:"w-4 h-4"})],8,oe)])])}),128))]))]))}});export{ie as default};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{r as O,u as A,E as R,J as d,q as r,n as o,t as c,T as v,s as C,d as _,L as k,a4 as b,$,a0 as w,p as S,c as F,R as i,K as n,m as G,z as J,D as K}from"./index-BGLdlKTT.js";import{b as P,c as T,d as V,a as H}from"./api-DthBzc-F.js";import{g as Q}from"./squad-colors-B8B_Y-lz.js";import{_ as W}from"./ToggleSwitch.vue_vue_type_script_setup_true_lang-BdCOFRaC.js";import{P as X}from"./plus-BQd_XYgK.js";import{P as Y}from"./pencil-aJ0SIjrw.js";import{T as Z}from"./trash-2-dt2YqJne.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 ee=O("PlayIcon",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]),te={class:"p-6"},oe={class:"flex items-center justify-between mb-6"},se={class:"flex gap-1 border-b border-border mb-4"},ae=["onClick"],de={key:0,class:"border border-border rounded-lg p-4 mb-4 space-y-3"},re={class:"grid grid-cols-2 gap-3"},ne=["value"],le=["disabled"],ue={key:1,class:"text-muted-foreground"},ie={key:2,class:"text-center py-12 text-muted-foreground"},pe={key:3,class:"space-y-2"},me={class:"text-sm font-medium font-mono"},ce={key:0,class:"mt-1"},ve={class:"text-xs text-muted-foreground mt-0.5"},be={key:0,class:"mt-2 space-y-2"},fe={class:"flex gap-2"},ge=["onClick"],xe={key:1,class:"mt-2 flex items-center justify-between gap-3"},ye=["onClick"],_e={class:"text-xs text-muted-foreground mt-0.5"},ke={class:"flex items-center gap-3"},we=["onClick"],Se={key:0,class:"text-xs text-green-500 font-medium"},qe=["onClick"],Ne=A({__name:"SchedulesView",setup(he){const l=n([]),p=n([]),q=n(!0),f=n("squad"),g=n(!1),a=n({type:"squad",cron:"",squad_id:"",prompt:""}),x=n(null),m=n(""),y=n(null);R(async()=>{try{const s=await P("/squads");p.value=s.squads,p.value.length>0&&(a.value.squad_id=p.value[0].id),l.value=await P("/schedules")}finally{q.value=!1}});const h=()=>l.value.filter(s=>s.type===f.value);async function U(){const s={type:a.value.type,cron:a.value.cron,squad_id:a.value.squad_id};if(!a.value.squad_id||!a.value.prompt.trim())return;s.prompt=a.value.prompt;const e=await T("/schedules",s);l.value.push(e),g.value=!1}function E(s){if(s)return p.value.find(e=>e.id===s)}const N=G(()=>h().map(s=>({...s,squad:E(s.squad_id)})));async function D(s){const e=!s.enabled,t=await V(`/schedules/${s.id}`,{enabled:e});s.enabled=t.enabled}function I(s){x.value=s.id,m.value=s.prompt}async function B(s){const e=await V(`/schedules/${s.id}`,{prompt:m.value});s.prompt=e.prompt,x.value=null,m.value=""}function L(){x.value=null,m.value=""}async function j(s){await H(`/schedules/${s}`),l.value=l.value.filter(e=>e.id!==s)}async function z(s){await T(`/schedules/${s.id}/trigger`,{}),y.value=s.id;const e=l.value.findIndex(t=>t.id===s.id);e!==-1&&(l.value[e]={...l.value[e],last_run:new Date().toISOString()}),setTimeout(()=>{y.value=null},3e3)}function M(s){var e;return s?((e=p.value.find(t=>t.id===s))==null?void 0:e.name)??s:"Unknown squad"}return(s,e)=>(d(),r("div",te,[o("div",oe,[e[8]||(e[8]=o("h1",{class:"text-2xl font-bold"},"Schedules",-1)),o("button",{onClick:e[0]||(e[0]=t=>g.value=!g.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"},[c(v(X),{class:"w-4 h-4"}),e[7]||(e[7]=C(" Add Schedule ",-1))])]),o("div",se,[(d(),r(_,null,k(["squad","io"],t=>o("button",{key:t,onClick:u=>f.value=t,class:J(["px-4 py-2 text-sm font-medium border-b-2 transition-colors",f.value===t?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"])},i(t==="squad"?"Squad Schedules":"IO Schedules"),11,ae)),64))]),g.value?(d(),r("div",de,[o("div",re,[o("div",null,[e[10]||(e[10]=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[9]||(e[9]=[o("option",{value:"squad"},"Squad",-1),o("option",{value:"io"},"IO",-1)])],512),[[$,a.value.type]])]),o("div",null,[e[11]||(e[11]=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),[[w,a.value.cron]])])]),o("div",null,[e[12]||(e[12]=o("label",{class:"text-sm font-medium"},"Target Squad",-1)),b(o("select",{"onUpdate:modelValue":e[3]||(e[3]=t=>a.value.squad_id=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[(d(!0),r(_,null,k(p.value,t=>(d(),r("option",{key:t.id,value:t.id},i(t.name),9,ne))),128))],512),[[$,a.value.squad_id]])]),o("div",null,[e[13]||(e[13]=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),[[w,a.value.prompt]])]),o("button",{onClick:U,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,le)])):S("",!0),q.value?(d(),r("div",ue,"Loading...")):h().length===0?(d(),r("div",ie,[c(v(F),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),o("p",null,"No "+i(f.value)+" schedules configured.",1)])):(d(),r("div",pe,[(d(!0),r(_,null,k(N.value,t=>(d(),r("div",{key:t.id,class:"flex items-center justify-between border border-border rounded-lg px-4 py-3"},[o("div",null,[o("div",me,i(t.cron),1),t.squad?(d(),r("div",ce,[o("span",{class:"text-xs px-2 py-0.5 rounded-full",style:K(v(Q)(t.squad.color))},i(t.squad.name),5)])):S("",!0),o("div",ve,[x.value===t.id?(d(),r("div",be,[b(o("textarea",{"onUpdate:modelValue":e[5]||(e[5]=u=>m.value=u),rows:"3",class:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm",placeholder:"Schedule prompt"},null,512),[[w,m.value]]),o("div",fe,[o("button",{onClick:u=>B(t),class:"px-3 py-1.5 text-xs rounded-md bg-primary text-primary-foreground hover:bg-primary/90"}," Save ",8,ge),o("button",{onClick:e[6]||(e[6]=u=>L()),class:"px-3 py-1.5 text-xs rounded-md border border-border hover:bg-muted/50"}," Cancel ")])])):(d(),r("div",xe,[o("span",null,i(t.prompt?t.prompt:"(no prompt)"),1),o("button",{onClick:u=>I(t),class:"inline-flex items-center gap-1 px-2 py-1 text-xs rounded-md border border-border hover:bg-muted/50"},[c(v(Y),{class:"w-3 h-3"}),e[14]||(e[14]=C(" Edit prompt ",-1))],8,ye)]))]),o("div",_e," Squad: "+i(M(t.squad_id)),1)]),o("div",ke,[o("button",{onClick:u=>z(t),class:"p-1.5 rounded hover:bg-primary/10 text-muted-foreground hover:text-primary",title:"Trigger now"},[c(v(ee),{class:"w-4 h-4"})],8,we),y.value===t.id?(d(),r("span",Se,"Triggered!")):S("",!0),c(W,{"model-value":!!t.enabled,"aria-label":`Toggle schedule ${t.cron}`,"onUpdate:modelValue":u=>D(t)},null,8,["model-value","aria-label","onUpdate:modelValue"]),o("button",{onClick:u=>j(t.id),class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive"},[c(v(Z),{class:"w-4 h-4"})],8,qe)])]))),128))]))]))}});export{Ne as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as w,E,J as d,q as s,n as t,R as g,d as x,L as U,a4 as o,a0 as n,$ as M,Z as p,p as b,K as r,z as T}from"./index-BGLdlKTT.js";import{b as V,d as S}from"./api-DthBzc-F.js";const z={class:"p-6"},A={class:"flex items-center justify-between mb-6"},B=["disabled"],N={key:0,class:"text-muted-foreground"},C={class:"flex gap-1 border-b border-border mb-6"},I=["onClick"],K={key:0,class:"space-y-4 max-w-lg"},D={class:"flex items-center gap-3"},L={key:1,class:"space-y-4 max-w-lg"},R={class:"flex items-center gap-3"},j={key:2,class:"space-y-4 max-w-lg"},q={key:3,class:"space-y-4 max-w-lg"},G={class:"flex items-center gap-3"},O={class:"flex items-center gap-3"},W=w({__name:"SettingsView",setup(P){const f=r(!0),i=r(!1),m=r(!1),u=r("general"),y=[{id:"general",label:"General"},{id:"telegram",label:"Telegram"},{id:"auth",label:"Auth"},{id:"advanced",label:"Advanced"}],a=r({defaultModel:"",port:3170,telegramEnabled:!1,telegramBotToken:"",authorizedUserId:null,supabaseUrl:"",supabaseAnonKey:"",authorizedEmail:"",backgroundNotifyMode:"meaningful",backgroundNotifyTelegram:!0,selfEditEnabled:!1,watchdogEnabled:!0});async function k(){f.value=!0;try{const v=await V("/settings");a.value=v}finally{f.value=!1}}async function c(){i.value=!0,m.value=!1;try{await S("/settings",a.value),m.value=!0,setTimeout(()=>m.value=!1,2e3)}finally{i.value=!1}}return E(k),(v,e)=>(d(),s("div",z,[t("div",A,[e[12]||(e[12]=t("h1",{class:"text-2xl font-bold"},"Settings",-1)),t("button",{onClick:c,disabled:i.value,class:"px-4 py-2 rounded-md bg-primary text-primary-foreground text-sm hover:bg-primary/90 disabled:opacity-50"},g(i.value?"Saving...":m.value?"Saved ✓":"Save"),9,B)]),f.value?(d(),s("div",N,"Loading...")):(d(),s(x,{key:1},[t("div",C,[(d(),s(x,null,U(y,l=>t("button",{key:l.id,onClick:$=>u.value=l.id,class:T(["px-4 py-2 text-sm font-medium border-b-2 transition-colors",u.value===l.id?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"])},g(l.label),11,I)),64))]),u.value==="general"?(d(),s("div",K,[t("div",null,[e[13]||(e[13]=t("label",{class:"text-sm font-medium"},"Default Model",-1)),o(t("input",{"onUpdate:modelValue":e[0]||(e[0]=l=>a.value.defaultModel=l),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.defaultModel]])]),t("div",null,[e[14]||(e[14]=t("label",{class:"text-sm font-medium"},"Port",-1)),o(t("input",{"onUpdate:modelValue":e[1]||(e[1]=l=>a.value.port=l),type:"number",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.port,void 0,{number:!0}]]),e[15]||(e[15]=t("p",{class:"text-xs text-muted-foreground mt-1"},"Requires restart to take effect",-1))]),t("div",null,[e[17]||(e[17]=t("label",{class:"text-sm font-medium"},"Background Notify Mode",-1)),o(t("select",{"onUpdate:modelValue":e[2]||(e[2]=l=>a.value.backgroundNotifyMode=l),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[16]||(e[16]=[t("option",{value:"all"},"All",-1),t("option",{value:"meaningful"},"Meaningful",-1),t("option",{value:"off"},"Off",-1)])],512),[[M,a.value.backgroundNotifyMode]])]),t("div",D,[o(t("input",{"onUpdate:modelValue":e[3]||(e[3]=l=>a.value.backgroundNotifyTelegram=l),type:"checkbox",id:"notifyTelegram",class:"rounded"},null,512),[[p,a.value.backgroundNotifyTelegram]]),e[18]||(e[18]=t("label",{for:"notifyTelegram",class:"text-sm font-medium"},"Send notifications via Telegram",-1))])])):b("",!0),u.value==="telegram"?(d(),s("div",L,[t("div",null,[e[19]||(e[19]=t("label",{class:"text-sm font-medium"},"Bot Token",-1)),o(t("input",{"onUpdate:modelValue":e[4]||(e[4]=l=>a.value.telegramBotToken=l),type:"password",placeholder:"Enter new token to update",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.telegramBotToken]])]),t("div",null,[e[20]||(e[20]=t("label",{class:"text-sm font-medium"},"Authorized User ID",-1)),o(t("input",{"onUpdate:modelValue":e[5]||(e[5]=l=>a.value.authorizedUserId=l),type:"number",placeholder:"123456789",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.authorizedUserId,void 0,{number:!0}]])]),t("div",R,[o(t("input",{"onUpdate:modelValue":e[6]||(e[6]=l=>a.value.telegramEnabled=l),type:"checkbox",id:"telegramEnabled",class:"rounded"},null,512),[[p,a.value.telegramEnabled]]),e[21]||(e[21]=t("label",{for:"telegramEnabled",class:"text-sm font-medium"},"Enable Telegram Bot",-1))])])):b("",!0),u.value==="auth"?(d(),s("div",j,[t("div",null,[e[22]||(e[22]=t("label",{class:"text-sm font-medium"},"Supabase URL",-1)),o(t("input",{"onUpdate:modelValue":e[7]||(e[7]=l=>a.value.supabaseUrl=l),placeholder:"https://your-project.supabase.co",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.supabaseUrl]])]),t("div",null,[e[23]||(e[23]=t("label",{class:"text-sm font-medium"},"Supabase Anon Key",-1)),o(t("input",{"onUpdate:modelValue":e[8]||(e[8]=l=>a.value.supabaseAnonKey=l),type:"password",placeholder:"Enter new key to update",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.supabaseAnonKey]])]),t("div",null,[e[24]||(e[24]=t("label",{class:"text-sm font-medium"},"Authorized Email",-1)),o(t("input",{"onUpdate:modelValue":e[9]||(e[9]=l=>a.value.authorizedEmail=l),type:"email",placeholder:"you@example.com",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.authorizedEmail]])])])):b("",!0),u.value==="advanced"?(d(),s("div",q,[t("div",G,[o(t("input",{"onUpdate:modelValue":e[10]||(e[10]=l=>a.value.selfEditEnabled=l),type:"checkbox",id:"selfEdit",class:"rounded"},null,512),[[p,a.value.selfEditEnabled]]),e[25]||(e[25]=t("div",null,[t("label",{for:"selfEdit",class:"text-sm font-medium"},"Self-Edit Mode"),t("p",{class:"text-xs text-muted-foreground"},"Allow IO to modify its own source code")],-1))]),t("div",O,[o(t("input",{"onUpdate:modelValue":e[11]||(e[11]=l=>a.value.watchdogEnabled=l),type:"checkbox",id:"watchdog",class:"rounded"},null,512),[[p,a.value.watchdogEnabled]]),e[26]||(e[26]=t("div",null,[t("label",{for:"watchdog",class:"text-sm font-medium"},"Watchdog"),t("p",{class:"text-xs text-muted-foreground"},"Monitor event loop and zombie instances")],-1))])])):b("",!0)],64))]))}});export{W as default};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{r as
|
|
1
|
+
import{r as me,u as fe,E as xe,J as o,q as a,n as t,z as j,t as u,T as d,s as q,d as p,a4 as C,a0 as M,a5 as ee,R as r,p as S,h as te,L as se,$ as ge,o as oe,l as le,K as n,m as ye,a6 as ae}from"./index-BGLdlKTT.js";import{b as z,c as J,d as be,a as ke}from"./api-DthBzc-F.js";import{P as ne}from"./plus-BQd_XYgK.js";import{S as he}from"./search-tP42aLoo.js";import{P as _e}from"./pencil-aJ0SIjrw.js";import{S as we}from"./save-CQegsgKM.js";import{X as Ce}from"./x-DgnyxyzU.js";import{T as Se}from"./trash-2-dt2YqJne.js";/**
|
|
2
2
|
* @license lucide-vue-next v0.474.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const Q=
|
|
6
|
+
*/const Q=me("GlobeIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]),$e={class:"flex h-full"},Le={class:"w-72 border-r border-border flex flex-col shrink-0"},Ie={class:"flex border-b border-border"},Fe={class:"p-3 border-b border-border space-y-2"},Me={class:"flex gap-1"},Te={key:0,class:"space-y-1.5"},Ue={class:"flex gap-1"},Ve=["disabled"],De={key:1,class:"space-y-1.5"},Ee={key:0,class:"mt-0.5 text-xs text-muted-foreground font-mono"},Pe={class:"flex gap-1"},je=["disabled"],ze={class:"flex-1 overflow-y-auto p-2"},Ne={key:0,class:"text-xs text-muted-foreground p-2"},Ae={key:1,class:"text-center py-8 text-muted-foreground"},Ke=["onClick"],Ge={class:"min-w-0 flex-1"},Be={class:"font-medium truncate"},Re={class:"text-muted-foreground truncate"},qe=["onClick"],Je={class:"p-3 border-b border-border space-y-2"},Qe={class:"relative"},Xe=["disabled"],He={class:"flex-1 overflow-y-auto p-2"},Oe={key:0,class:"text-xs text-muted-foreground p-2"},We={key:1,class:"text-xs text-destructive p-2"},Ye={key:2,class:"text-center py-8 text-muted-foreground"},Ze=["onClick"],et={class:"min-w-0 flex-1"},tt={class:"font-medium truncate"},st=["title"],ot=["onClick","disabled"],lt={key:1,class:"shrink-0 mt-0.5 px-1.5 py-0.5 text-xs rounded bg-muted text-muted-foreground"},at={class:"flex-1 flex flex-col"},nt={key:0,class:"flex items-center justify-center h-full text-muted-foreground"},rt={class:"text-center"},it={class:"flex items-center justify-between px-4 py-2 border-b border-border"},ut={class:"text-sm font-medium"},dt={class:"text-xs text-muted-foreground ml-2 font-mono"},ct={class:"flex gap-1"},vt={class:"flex-1 overflow-y-auto p-4"},pt={key:0,class:"text-muted-foreground text-sm"},mt={key:0,class:"flex items-center justify-center h-full text-muted-foreground"},ft={class:"text-center"},xt={class:"flex items-center justify-between px-4 py-2 border-b border-border"},gt={class:"min-w-0 flex-1"},yt={class:"text-sm font-medium"},bt={class:"text-xs text-muted-foreground ml-2"},kt=["disabled"],ht={key:1,class:"ml-2 shrink-0 px-3 py-1 text-xs rounded bg-muted text-muted-foreground"},_t={class:"flex-1 overflow-y-auto p-4"},wt={key:0,class:"text-muted-foreground text-sm"},Ct={key:0,class:"absolute bottom-4 left-4 text-sm text-destructive bg-background border border-destructive/30 px-3 py-2 rounded-md"},re=`# My Skill
|
|
7
7
|
|
|
8
8
|
A brief description of what this skill does.
|
|
9
9
|
|
|
10
10
|
## Usage
|
|
11
11
|
|
|
12
12
|
Instructions for how to use this skill...
|
|
13
|
-
`,
|
|
13
|
+
`,Dt=fe({__name:"SkillsView",setup(St){const T=n([]),N=n(!0),U=n(!1),A=n("git"),g=n(""),f=n(""),y=n(re),m=n(!1),i=n(""),X=ye(()=>f.value.trim().replace(/[^a-z0-9-]/gi,"-").toLowerCase().replace(/-+/g,"-").replace(/^-|-$/g,"")),v=n(null),x=n(""),b=n(!1),$=n(""),K=n(!1),k=n("installed"),G=n("awesome-copilot"),V=n(""),L=n([]),I=n(!1),D=n(""),c=n(null),h=n(""),B=n(!1),_=n("");async function w(){N.value=!0;try{T.value=await z("/skills")}finally{N.value=!1}}function H(l){A.value=l,U.value=!0,i.value=""}function E(){U.value=!1,g.value="",f.value="",y.value=re,i.value=""}async function O(){if(g.value.trim()){m.value=!0,i.value="";try{await J("/skills",{url:g.value.trim()}),E(),await w()}catch(l){i.value=l.message||"Failed to install skill"}finally{m.value=!1}}}async function ie(){if(!(!f.value.trim()||!y.value.trim())){m.value=!0,i.value="";try{await J("/skills",{slug:X.value,content:y.value}),E(),await w()}catch(l){i.value=l.message||"Failed to create skill"}finally{m.value=!1}}}async function ue(l){var e;try{await ke(`/skills/${l}`),((e=v.value)==null?void 0:e.slug)===l&&(v.value=null,x.value=""),await w()}catch(s){i.value=s.message||"Failed to remove skill"}}async function de(l){v.value=l,b.value=!1,K.value=!0;try{const e=await z(`/skills/${l.slug}/content`);x.value=e.content}catch(e){x.value=`Error loading skill: ${e.message}`}finally{K.value=!1}}function ce(){$.value=x.value,b.value=!0}async function ve(){if(v.value)try{await be(`/skills/${v.value.slug}/content`,{content:$.value}),x.value=$.value,b.value=!1,await w()}catch(l){i.value=l.message||"Failed to save skill"}}async function P(){I.value=!0,D.value="",c.value=null,h.value="";try{const l=new URLSearchParams({source:G.value});V.value.trim()&&l.set("q",V.value.trim()),L.value=await z(`/skills/discover?${l}`)}catch(l){D.value=l.message||"Failed to fetch community skills",L.value=[]}finally{I.value=!1}}async function pe(l){c.value=l,B.value=!0,h.value="";try{const e=await z(`/skills/preview?source=${l.source}&slug=${encodeURIComponent(l.slug)}`);h.value=e.content}catch(e){h.value=`Error loading preview: ${e.message}`}finally{B.value=!1}}async function W(l){_.value=l.slug,i.value="";try{await J("/skills",{source:l.source,slug:l.slug}),await w(),k.value="installed"}catch(e){i.value=e.message||"Failed to install skill"}finally{_.value=""}}function Y(l){return T.value.some(e=>e.slug===l)}function Z(l){k.value=l,v.value=null,c.value=null,x.value="",h.value="",l==="discover"&&L.value.length===0&&P()}return xe(w),(l,e)=>(o(),a("div",$e,[t("div",Le,[t("div",Ie,[t("button",{onClick:e[0]||(e[0]=s=>Z("installed")),class:j(["flex-1 px-3 py-2 text-xs font-medium transition-colors",k.value==="installed"?"border-b-2 border-primary text-primary":"text-muted-foreground hover:text-foreground"])}," Installed ",2),t("button",{onClick:e[1]||(e[1]=s=>Z("discover")),class:j(["flex-1 px-3 py-2 text-xs font-medium transition-colors",k.value==="discover"?"border-b-2 border-primary text-primary":"text-muted-foreground hover:text-foreground"])},[u(d(Q),{class:"w-3 h-3 inline mr-1"}),e[12]||(e[12]=q(" Discover ",-1))],2)]),k.value==="installed"?(o(),a(p,{key:0},[t("div",Fe,[t("div",Me,[t("button",{onClick:e[2]||(e[2]=s=>H("git")),class:"flex-1 flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs rounded-md bg-primary text-primary-foreground hover:bg-primary/90"},[u(d(ne),{class:"w-3.5 h-3.5"}),e[13]||(e[13]=q(" From Git ",-1))]),t("button",{onClick:e[3]||(e[3]=s=>H("create")),class:"flex-1 flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs rounded-md border border-border hover:bg-accent"},[u(d(ne),{class:"w-3.5 h-3.5"}),e[14]||(e[14]=q(" Create New ",-1))])]),U.value&&A.value==="git"?(o(),a("div",Te,[C(t("input",{"onUpdate:modelValue":e[4]||(e[4]=s=>g.value=s),type:"text",placeholder:"https://github.com/user/skill-repo.git",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring",onKeyup:ee(O,["enter"])},null,544),[[M,g.value]]),t("div",Ue,[t("button",{onClick:O,disabled:m.value||!g.value.trim(),class:"flex-1 px-2 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50"},r(m.value?"Installing...":"Install"),9,Ve),t("button",{onClick:E,class:"px-2 py-1 text-xs rounded border border-border hover:bg-accent"}," Cancel ")])])):S("",!0),U.value&&A.value==="create"?(o(),a("div",De,[t("div",null,[C(t("input",{"onUpdate:modelValue":e[5]||(e[5]=s=>f.value=s),type:"text",placeholder:"Skill title",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[M,f.value]]),f.value.trim()?(o(),a("p",Ee," slug: "+r(X.value),1)):S("",!0)]),C(t("textarea",{"onUpdate:modelValue":e[6]||(e[6]=s=>y.value=s),rows:"8",placeholder:`# My Skill
|
|
14
14
|
|
|
15
|
-
Describe your skill in Markdown...`,class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs font-mono focus:outline-none focus:ring-1 focus:ring-ring resize-none"},null,512),[[M,y.value]]),t("div",Pe,[t("button",{onClick:ie,disabled:
|
|
15
|
+
Describe your skill in Markdown...`,class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs font-mono focus:outline-none focus:ring-1 focus:ring-ring resize-none"},null,512),[[M,y.value]]),t("div",Pe,[t("button",{onClick:ie,disabled:m.value||!f.value.trim()||!y.value.trim(),class:"flex-1 px-2 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50"},r(m.value?"Creating...":"Create"),9,je),t("button",{onClick:E,class:"px-2 py-1 text-xs rounded border border-border hover:bg-accent"}," Cancel ")])])):S("",!0)]),t("div",ze,[N.value?(o(),a("div",Ne,"Loading...")):T.value.length===0?(o(),a("div",Ae,[u(d(te),{class:"w-8 h-8 mx-auto mb-2 opacity-50"}),e[15]||(e[15]=t("p",{class:"text-xs"},"No skills installed.",-1))])):S("",!0),(o(!0),a(p,null,se(T.value,s=>{var F;return o(),a("div",{key:s.slug,onClick:R=>de(s),class:j(["flex items-center justify-between px-2 py-2 text-xs rounded cursor-pointer hover:bg-accent transition-colors group",{"bg-accent font-medium":((F=v.value)==null?void 0:F.slug)===s.slug}])},[t("div",Ge,[t("div",Be,r(s.name),1),t("div",Re,r(s.slug),1)]),t("button",{onClick:ae(R=>ue(s.slug),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 rounded hover:bg-destructive/10 text-destructive transition-opacity shrink-0",title:"Remove"},[u(d(Se),{class:"w-3.5 h-3.5"})],8,qe)],10,Ke)}),128))])],64)):(o(),a(p,{key:1},[t("div",Je,[C(t("select",{"onUpdate:modelValue":e[7]||(e[7]=s=>G.value=s),onChange:P,class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},[...e[16]||(e[16]=[t("option",{value:"awesome-copilot"},"awesome-copilot",-1),t("option",{value:"skillssh"},"skills.sh",-1)])],544),[[ge,G.value]]),t("div",Qe,[u(d(he),{class:"absolute left-2 top-1/2 -translate-y-1/2 w-3 h-3 text-muted-foreground"}),C(t("input",{"onUpdate:modelValue":e[8]||(e[8]=s=>V.value=s),type:"text",placeholder:"Search skills...",class:"w-full rounded-md border border-input bg-background pl-6 pr-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring",onKeyup:ee(P,["enter"])},null,544),[[M,V.value]])]),t("button",{onClick:P,disabled:I.value,class:"w-full px-2 py-1.5 text-xs rounded-md bg-secondary text-secondary-foreground hover:bg-secondary/80 disabled:opacity-50"},r(I.value?"Searching...":"Search"),9,Xe)]),t("div",He,[I.value?(o(),a("div",Oe,"Loading...")):D.value?(o(),a("div",We,r(D.value),1)):L.value.length===0?(o(),a("div",Ye,[u(d(Q),{class:"w-8 h-8 mx-auto mb-2 opacity-50"}),e[17]||(e[17]=t("p",{class:"text-xs"},"No skills found.",-1))])):S("",!0),(o(!0),a(p,null,se(L.value,s=>{var F;return o(),a("div",{key:s.slug,onClick:R=>pe(s),class:j(["flex items-start justify-between px-2 py-2 text-xs rounded cursor-pointer hover:bg-accent transition-colors gap-1",{"bg-accent":((F=c.value)==null?void 0:F.slug)===s.slug}])},[t("div",et,[t("div",tt,r(s.slug),1),t("div",{class:"text-muted-foreground line-clamp-2 mt-0.5",title:s.description},r(s.description),9,st)]),Y(s.slug)?(o(),a("span",lt," Installed ")):(o(),a("button",{key:0,onClick:ae(R=>W(s),["stop"]),disabled:_.value===s.slug,class:"shrink-0 mt-0.5 px-1.5 py-0.5 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50",title:"Install"},r(_.value===s.slug?"...":"Install"),9,ot))],10,Ze)}),128))])],64))]),t("div",at,[k.value==="installed"?(o(),a(p,{key:0},[v.value?(o(),a(p,{key:1},[t("div",it,[t("div",null,[t("span",ut,r(v.value.name),1),t("span",dt,r(v.value.slug)+"/SKILL.md",1)]),t("div",ct,[b.value?(o(),a(p,{key:1},[t("button",{onClick:ve,class:"p-1.5 rounded hover:bg-accent text-green-500",title:"Save"},[u(d(we),{class:"w-4 h-4"})]),t("button",{onClick:e[9]||(e[9]=s=>b.value=!1),class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Cancel"},[u(d(Ce),{class:"w-4 h-4"})])],64)):(o(),a("button",{key:0,onClick:ce,class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Edit"},[u(d(_e),{class:"w-4 h-4"})]))])]),t("div",vt,[K.value?(o(),a("div",pt,"Loading...")):b.value?C((o(),a("textarea",{key:1,"onUpdate:modelValue":e[10]||(e[10]=s=>$.value=s),class:"w-full h-full min-h-[400px] font-mono text-sm bg-background border border-input rounded-md p-3 focus:outline-none focus:ring-1 focus:ring-ring resize-none"},null,512)),[[M,$.value]]):(o(),oe(le,{key:2,content:x.value},null,8,["content"]))])],64)):(o(),a("div",nt,[t("div",rt,[u(d(te),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[18]||(e[18]=t("p",null,"Select a skill to view",-1))])]))],64)):(o(),a(p,{key:1},[c.value?(o(),a(p,{key:1},[t("div",xt,[t("div",gt,[t("span",yt,r(c.value.slug),1),t("span",bt,r(c.value.source),1)]),Y(c.value.slug)?(o(),a("span",ht," Installed ")):(o(),a("button",{key:0,onClick:e[11]||(e[11]=s=>W(c.value)),disabled:_.value===c.value.slug,class:"ml-2 shrink-0 px-3 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50"},r(_.value===c.value.slug?"Installing...":"Install"),9,kt))]),t("div",_t,[B.value?(o(),a("div",wt,"Loading preview...")):(o(),oe(le,{key:1,content:h.value},null,8,["content"]))])],64)):(o(),a("div",mt,[t("div",ft,[u(d(Q),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[19]||(e[19]=t("p",null,"Select a skill to preview",-1))])]))],64))]),i.value?(o(),a("p",Ct,r(i.value),1)):S("",!0)]))}});export{Dt as default};
|