heyio 1.0.9 → 1.1.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/copilot/tools.js +102 -0
- package/dist/store/squads.js +4 -0
- package/package.json +1 -1
package/dist/copilot/tools.js
CHANGED
|
@@ -148,6 +148,28 @@ export function createTools() {
|
|
|
148
148
|
return `Instance ${instance_id} destroyed.`;
|
|
149
149
|
},
|
|
150
150
|
}),
|
|
151
|
+
defineTool("squad_remove_agent", {
|
|
152
|
+
description: "Remove an agent from a squad",
|
|
153
|
+
parameters: z.object({
|
|
154
|
+
agent_id: z.string().describe("Agent ID to remove"),
|
|
155
|
+
}),
|
|
156
|
+
handler: async ({ agent_id }) => {
|
|
157
|
+
const { removeAgent } = await import("../store/squads.js");
|
|
158
|
+
removeAgent(agent_id);
|
|
159
|
+
return `Agent ${agent_id} removed.`;
|
|
160
|
+
},
|
|
161
|
+
}),
|
|
162
|
+
defineTool("squad_delete", {
|
|
163
|
+
description: "Delete an entire squad and all its agents, tasks, and instances",
|
|
164
|
+
parameters: z.object({
|
|
165
|
+
squad_id: z.string().describe("Squad ID to delete"),
|
|
166
|
+
}),
|
|
167
|
+
handler: async ({ squad_id }) => {
|
|
168
|
+
const { deleteSquad } = await import("../store/squads.js");
|
|
169
|
+
deleteSquad(squad_id);
|
|
170
|
+
return `Squad ${squad_id} deleted.`;
|
|
171
|
+
},
|
|
172
|
+
}),
|
|
151
173
|
// --- Feed Tools ---
|
|
152
174
|
defineTool("feed_post", {
|
|
153
175
|
description: "Post a deliverable to the unified feed/inbox",
|
|
@@ -162,6 +184,18 @@ export function createTools() {
|
|
|
162
184
|
return `Posted to feed: "${title}" (ID: ${item.id})`;
|
|
163
185
|
},
|
|
164
186
|
}),
|
|
187
|
+
defineTool("feed_list", {
|
|
188
|
+
description: "List feed/inbox items. Can filter by unread or source.",
|
|
189
|
+
parameters: z.object({
|
|
190
|
+
unread_only: z.boolean().optional().describe("Only show unread items"),
|
|
191
|
+
source: z.string().optional().describe("Filter by source"),
|
|
192
|
+
limit: z.number().optional().describe("Max items to return (default 20)"),
|
|
193
|
+
}),
|
|
194
|
+
handler: async ({ unread_only, source, limit }) => {
|
|
195
|
+
const { getFeedItems } = await import("../store/feed.js");
|
|
196
|
+
return getFeedItems({ unreadOnly: unread_only, source, limit: limit ?? 20 });
|
|
197
|
+
},
|
|
198
|
+
}),
|
|
165
199
|
// --- MCP Tools ---
|
|
166
200
|
defineTool("mcp_list_servers", {
|
|
167
201
|
description: "List configured MCP servers and their status",
|
|
@@ -190,6 +224,27 @@ export function createTools() {
|
|
|
190
224
|
return `Schedule created: ${schedule.id}`;
|
|
191
225
|
},
|
|
192
226
|
}),
|
|
227
|
+
defineTool("schedule_list", {
|
|
228
|
+
description: "List all schedules, optionally filtered by type",
|
|
229
|
+
parameters: z.object({
|
|
230
|
+
type: z.enum(["squad", "io"]).optional().describe("Filter by schedule type"),
|
|
231
|
+
}),
|
|
232
|
+
handler: async ({ type }) => {
|
|
233
|
+
const { listSchedules } = await import("../store/schedules.js");
|
|
234
|
+
return listSchedules(type);
|
|
235
|
+
},
|
|
236
|
+
}),
|
|
237
|
+
defineTool("schedule_delete", {
|
|
238
|
+
description: "Delete a schedule by ID",
|
|
239
|
+
parameters: z.object({
|
|
240
|
+
id: z.string().describe("Schedule ID to delete"),
|
|
241
|
+
}),
|
|
242
|
+
handler: async ({ id }) => {
|
|
243
|
+
const { deleteSchedule } = await import("../store/schedules.js");
|
|
244
|
+
deleteSchedule(id);
|
|
245
|
+
return `Schedule ${id} deleted.`;
|
|
246
|
+
},
|
|
247
|
+
}),
|
|
193
248
|
// --- Shell Tool ---
|
|
194
249
|
defineTool("shell_exec", {
|
|
195
250
|
description: "Execute a shell command on the host machine. Use for git, gh CLI, file operations, etc. Commands run in the user's environment with their credentials.",
|
|
@@ -217,6 +272,53 @@ export function createTools() {
|
|
|
217
272
|
}
|
|
218
273
|
},
|
|
219
274
|
}),
|
|
275
|
+
// --- Web Tools ---
|
|
276
|
+
defineTool("web_search", {
|
|
277
|
+
description: "Search the web for information. Returns relevant results with titles, URLs, and snippets.",
|
|
278
|
+
parameters: z.object({
|
|
279
|
+
query: z.string().describe("Search query"),
|
|
280
|
+
}),
|
|
281
|
+
handler: async ({ query }) => {
|
|
282
|
+
const { execSync } = await import("node:child_process");
|
|
283
|
+
try {
|
|
284
|
+
// Use ddgr (DuckDuckGo CLI) if available, otherwise fall back to a curl-based approach
|
|
285
|
+
const output = execSync(`ddgr --json --num 5 ${JSON.stringify(query)}`, { encoding: "utf-8", timeout: 15_000 });
|
|
286
|
+
return output.trim();
|
|
287
|
+
}
|
|
288
|
+
catch {
|
|
289
|
+
// Fallback: use DuckDuckGo HTML lite
|
|
290
|
+
try {
|
|
291
|
+
const encoded = encodeURIComponent(query);
|
|
292
|
+
const output = execSync(`curl -sL "https://lite.duckduckgo.com/lite/?q=${encoded}" | grep -oP '(?<=<a rel="nofollow" href=")[^"]+' | head -10`, { encoding: "utf-8", timeout: 15_000 });
|
|
293
|
+
return output.trim() || "No results found.";
|
|
294
|
+
}
|
|
295
|
+
catch {
|
|
296
|
+
return "Web search unavailable. Try using shell_exec with curl to fetch a specific URL.";
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
}),
|
|
301
|
+
defineTool("web_fetch", {
|
|
302
|
+
description: "Fetch the content of a web page or API endpoint. Returns the response body (truncated to 50KB).",
|
|
303
|
+
parameters: z.object({
|
|
304
|
+
url: z.string().describe("URL to fetch"),
|
|
305
|
+
headers: z.record(z.string(), z.string()).optional().describe("Optional HTTP headers"),
|
|
306
|
+
}),
|
|
307
|
+
handler: async ({ url, headers }) => {
|
|
308
|
+
try {
|
|
309
|
+
const headerArgs = headers
|
|
310
|
+
? Object.entries(headers).map(([k, v]) => `-H "${k}: ${v}"`).join(" ")
|
|
311
|
+
: "";
|
|
312
|
+
const { execSync } = await import("node:child_process");
|
|
313
|
+
const output = execSync(`curl -sL --max-time 30 ${headerArgs} ${JSON.stringify(url)}`, { encoding: "utf-8", timeout: 35_000, maxBuffer: 1024 * 1024 });
|
|
314
|
+
// Truncate to 50KB
|
|
315
|
+
return output.length > 50_000 ? output.slice(0, 50_000) + "\n...(truncated)" : output;
|
|
316
|
+
}
|
|
317
|
+
catch (err) {
|
|
318
|
+
return `Error fetching URL: ${err.message}`;
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
}),
|
|
220
322
|
];
|
|
221
323
|
}
|
|
222
324
|
//# sourceMappingURL=tools.js.map
|
package/dist/store/squads.js
CHANGED
|
@@ -48,4 +48,8 @@ export function updateAgentStatus(agentId, status) {
|
|
|
48
48
|
const db = getDb();
|
|
49
49
|
db.prepare("UPDATE agents SET status = ? WHERE id = ?").run(status, agentId);
|
|
50
50
|
}
|
|
51
|
+
export function removeAgent(agentId) {
|
|
52
|
+
const db = getDb();
|
|
53
|
+
db.prepare("DELETE FROM agents WHERE id = ?").run(agentId);
|
|
54
|
+
}
|
|
51
55
|
//# sourceMappingURL=squads.js.map
|