heyio 0.1.19 → 0.1.20

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/README.md CHANGED
@@ -100,21 +100,33 @@ WantedBy=multi-user.target
100
100
 
101
101
  IO stores its configuration at `~/.io/config.json`. The setup wizard (`io setup`) handles initial configuration, but you can also edit the file directly.
102
102
 
103
- ```jsonc
104
- {
105
- // Telegram bot token from @BotFather
106
- "telegramBotToken": "123456:ABC-DEF...",
103
+ ### Parameters
107
104
 
108
- // Your Telegram user ID (for authentication)
109
- "telegramUserId": 123456789,
105
+ | Parameter | Type | Default | Description |
106
+ | --- | --- | --- | --- |
107
+ | `telegramBotToken` | `string` | — | Telegram bot token from [@BotFather](https://t.me/BotFather) |
108
+ | `authorizedUserId` | `number` | — | Your Telegram user ID (only this user can interact with the bot) |
109
+ | `telegramEnabled` | `boolean` | `false` | Enable the Telegram bot interface |
110
+ | `selfEditEnabled` | `boolean` | `false` | Allow IO to modify its own source code |
111
+ | `defaultModel` | `string` | `"gpt-4.1"` | LLM model for the main orchestrator session |
112
+ | `modelTiers` | `object` | *(see below)* | Per-complexity model preferences for squad agents |
113
+ | `modelTiers.high` | `string[]` | `["claude-opus-4.7", "claude-opus-4.6"]` | Models for complex tasks (architecture, debugging, design) |
114
+ | `modelTiers.medium` | `string[]` | `["claude-sonnet-4.6", "gpt-5.5", "claude-opus-4.5"]` | Models for standard tasks (features, tests, reviews) |
115
+ | `modelTiers.low` | `string[]` | `["claude-haiku-4.5", "gpt-5.4-mini"]` | Models for simple tasks (reads, formatting, lookups) |
116
+ | `apiPort` | `number` | `3170` | Port for the HTTP API server |
110
117
 
111
- // Enable self-edit mode by default
112
- "selfEdit": false,
118
+ Each `modelTiers` list is a ranked preference — IO picks the first available model at startup.
113
119
 
114
- // Default model for the orchestrator
115
- "defaultModel": "claude-sonnet-4.6",
120
+ ### Example
116
121
 
117
- // Model tiers for squad agents (ranked preference lists)
122
+ ```jsonc
123
+ {
124
+ "telegramBotToken": "123456:ABC-DEF...",
125
+ "authorizedUserId": 123456789,
126
+ "telegramEnabled": true,
127
+ "selfEditEnabled": false,
128
+ "defaultModel": "claude-sonnet-4.6",
129
+ "apiPort": 3170,
118
130
  "modelTiers": {
119
131
  "high": ["claude-opus-4.7", "claude-opus-4.6"],
120
132
  "medium": ["claude-sonnet-4.6", "gpt-5.5", "claude-opus-4.5"],
@@ -2,7 +2,7 @@ import { approveAll, } from "@github/copilot-sdk";
2
2
  import { config } from "../config.js";
3
3
  import { SESSIONS_DIR } from "../paths.js";
4
4
  import { getState, setState, deleteState, logConversation } from "../store/db.js";
5
- import { clearStaleTasks } from "../store/tasks.js";
5
+ import { clearStaleTasks, getTask } from "../store/tasks.js";
6
6
  import { getSquad, listSquads, createSquad, logDecision, getDecisionsSummary, updateSquadStatus, } from "../store/squads.js";
7
7
  import { readPage, writePage, assertPagePath } from "../wiki/fs.js";
8
8
  import { resolveModelTiers } from "./model-router.js";
@@ -11,6 +11,7 @@ import { getOrchestratorSystemMessage } from "./system-message.js";
11
11
  import { createTools } from "./tools.js";
12
12
  import { getSkillDirectories } from "./skills.js";
13
13
  import { resetClient } from "./client.js";
14
+ import { delegateToAgent, getActiveAgentTasks } from "./agents.js";
14
15
  // ---------------------------------------------------------------------------
15
16
  // Constants
16
17
  // ---------------------------------------------------------------------------
@@ -49,6 +50,14 @@ function getToolDeps() {
49
50
  logDecision,
50
51
  getDecisionsSummary,
51
52
  updateSquadStatus,
53
+ delegateToAgent,
54
+ getTask,
55
+ getActiveAgentTasks: () => getActiveAgentTasks().map((t) => ({
56
+ taskId: t.taskId,
57
+ agentSlug: t.agentSlug,
58
+ description: t.description,
59
+ status: t.status,
60
+ })),
52
61
  };
53
62
  }
54
63
  function getSessionConfig() {
@@ -62,6 +62,16 @@ Squads are persistent project teams. When a user works on a codebase:
62
62
  3. Recall squad context with \`squad_recall\` before doing project work.
63
63
  4. Check squad status with \`squad_status\`.
64
64
 
65
+ ### Delegating Work
66
+ After planning tasks with the user, **use \`squad_delegate\` to send each task to the squad agent for implementation**. The workflow is:
67
+ 1. Plan the work with the user (break into concrete tasks).
68
+ 2. Call \`squad_delegate\` for each task — provide detailed instructions including file paths, expected behavior, and acceptance criteria.
69
+ 3. The agent works autonomously in the background. You get a task ID immediately.
70
+ 4. Use \`squad_task_status\` to check progress and retrieve results.
71
+ 5. Report results back to the user.
72
+
73
+ You can delegate multiple tasks in parallel — each gets its own task ID.
74
+
65
75
  ### Model Selection
66
76
  Squad agents are automatically assigned a model based on task complexity:
67
77
  - **High complexity** (architecture, refactoring, debugging, design) → most capable model
@@ -82,6 +92,8 @@ The model is selected automatically. Tell the user which model tier was chosen w
82
92
  - \`squad_recall\`: Get a squad's context and decisions.
83
93
  - \`squad_status\`: Check squad status.
84
94
  - \`squad_log_decision\`: Log a decision for a squad.
95
+ - \`squad_delegate\`: **Delegate a task to a squad agent.** The agent works autonomously in the background. Returns a task ID.
96
+ - \`squad_task_status\`: Check the status/result of a delegated task, or list all active tasks.
85
97
 
86
98
  ### System
87
99
  - \`shell\`: Run a shell command. You have full system access — you can create directories, install packages, clone repos, etc. **Always use this instead of the built-in \`bash\` tool.**
@@ -121,6 +121,57 @@ export function createTools(deps) {
121
121
  }
122
122
  },
123
123
  });
124
+ const squadDelegate = defineTool("squad_delegate", {
125
+ description: "Delegate a task to a squad agent for autonomous execution. The agent runs in the background and you get a task ID immediately. Use squad_task_status to check progress. Use this after planning work with the user to send each task to the squad for implementation.",
126
+ skipPermission: true,
127
+ parameters: z.object({
128
+ slug: z.string().describe("Squad slug to delegate to"),
129
+ task: z
130
+ .string()
131
+ .describe("Detailed task description. Be specific — include file paths, expected behavior, acceptance criteria. The agent works autonomously with this as its only instruction."),
132
+ }),
133
+ handler: async ({ slug, task }) => {
134
+ console.error(`[io] squad_delegate called: ${slug} — ${task.slice(0, 100)}…`);
135
+ try {
136
+ const taskId = await deps.delegateToAgent(slug, task, (id, result) => {
137
+ console.error(`[io] Agent task ${id} completed for squad ${slug}`);
138
+ });
139
+ return `Task delegated to squad "${slug}". Task ID: ${taskId}\n\nThe agent is working on this in the background. Use squad_task_status to check progress.`;
140
+ }
141
+ catch (err) {
142
+ return `Error delegating task: ${err instanceof Error ? err.message : String(err)}`;
143
+ }
144
+ },
145
+ });
146
+ const squadTaskStatus = defineTool("squad_task_status", {
147
+ description: "Check the status of a delegated squad task, or list all active tasks. Returns status (running/done/failed) and result when complete.",
148
+ skipPermission: true,
149
+ parameters: z.object({
150
+ task_id: z
151
+ .string()
152
+ .optional()
153
+ .describe("Specific task ID to check. If omitted, lists all active tasks."),
154
+ }),
155
+ handler: async ({ task_id }) => {
156
+ if (task_id) {
157
+ const task = deps.getTask(task_id);
158
+ if (!task)
159
+ return `Task not found: ${task_id}`;
160
+ let response = `**Task ${task.task_id}**\nSquad: ${task.agent_slug}\nStatus: ${task.status}\nDescription: ${task.description}`;
161
+ if (task.result) {
162
+ const result = task.result.length > 4000 ? task.result.slice(0, 4000) + "\n[…truncated]" : task.result;
163
+ response += `\n\nResult:\n${result}`;
164
+ }
165
+ return response;
166
+ }
167
+ const tasks = deps.getActiveAgentTasks();
168
+ if (tasks.length === 0)
169
+ return "No active tasks.";
170
+ return tasks
171
+ .map((t) => `- **${t.taskId}** (${t.agentSlug}) — ${t.status} — ${t.description}`)
172
+ .join("\n");
173
+ },
174
+ });
124
175
  const shell = defineTool("shell", {
125
176
  description: "Run a shell command on the host machine. You have FULL ROOT ACCESS. Use for git, apt, npm, build tools, system administration, or anything else. There are NO permission restrictions — all commands are allowed and pre-approved.",
126
177
  skipPermission: true,
@@ -546,7 +597,7 @@ export function createTools(deps) {
546
597
  }
547
598
  },
548
599
  });
549
- return [wikiRead, wikiWrite, wikiSearch, squadCreate, squadRecall, squadStatus, squadLogDecision, shell, fileOps, bash, readFile, viewTool, grepTool, strReplaceEditor, github];
600
+ return [wikiRead, wikiWrite, wikiSearch, squadCreate, squadRecall, squadStatus, squadLogDecision, squadDelegate, squadTaskStatus, shell, fileOps, bash, readFile, viewTool, grepTool, strReplaceEditor, github];
550
601
  }
551
602
  function walkDirectory(dir, maxDepth = 3, depth = 0) {
552
603
  if (depth >= maxDepth)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heyio",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "IO — a personal AI assistant built on the GitHub Copilot SDK",
5
5
  "bin": {
6
6
  "io": "dist/index.js"