heyio 0.1.12 → 0.1.14

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.
@@ -76,7 +76,7 @@ Squads are persistent project teams. When a user works on a codebase:
76
76
  - \`squad_log_decision\`: Log a decision for a squad.
77
77
 
78
78
  ### System
79
- - \`shell\`: Run a shell command. You have full system access — you can create directories, install packages, clone repos, etc.
79
+ - \`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.**
80
80
  - \`file_ops\`: Read, write, or list files anywhere on the filesystem. Can create directories automatically.
81
81
  - \`web_fetch\`: (built-in) Fetch a URL and return content.
82
82
 
@@ -90,6 +90,7 @@ Squads are persistent project teams. When a user works on a codebase:
90
90
  6. **Always try before refusing.** You run as a privileged daemon with full root access. Never assume a command will fail due to permissions — call the tool and report the actual result. Do not say "I can't" or "I don't have permission" without first attempting the operation. If a tool call returns an error, report the ACTUAL error message.
91
91
  7. **Use your tools proactively.** When a task requires shell or file operations, call the appropriate tool immediately. Do not describe what command you *would* run — just run it. For git operations, use the \`shell\` tool. For file operations, use \`file_ops\` or \`shell\`.
92
92
  8. **Never fabricate errors.** Only report errors that a tool actually returned. If you haven't called a tool, you don't know whether it will succeed or fail.
93
+ 9. **Prefer your custom tools over built-in tools.** Always use \`shell\` instead of \`bash\`. Always use \`file_ops\` instead of built-in file tools like \`str_replace_editor\` or \`read_file\`.
93
94
  ${selfEditBlock}${memoryBlock}`;
94
95
  }
95
96
  //# sourceMappingURL=system-message.js.map
@@ -204,7 +204,66 @@ export function createTools(deps) {
204
204
  }
205
205
  },
206
206
  });
207
- return [wikiRead, wikiWrite, wikiSearch, squadCreate, squadRecall, squadStatus, squadLogDecision, shell, fileOps];
207
+ // Override built-in bash tool so the model uses our implementation
208
+ const bash = defineTool("bash", {
209
+ description: "Run a bash command on the host machine with full root access.",
210
+ skipPermission: true,
211
+ overridesBuiltInTool: true,
212
+ parameters: z.object({
213
+ command: z.string().describe("The command to run"),
214
+ }),
215
+ handler: async ({ command }) => {
216
+ console.error(`[io] bash tool called: ${command}`);
217
+ try {
218
+ const result = execSync(command, {
219
+ encoding: "utf-8",
220
+ timeout: 60_000,
221
+ maxBuffer: 1024 * 1024,
222
+ });
223
+ const output = result.trim();
224
+ if (output.length > 8000) {
225
+ return output.slice(0, 8000) + "\n\n[…truncated]";
226
+ }
227
+ return output || "(no output)";
228
+ }
229
+ catch (err) {
230
+ const execErr = err;
231
+ const stderr = execErr.stderr?.trim() ?? "";
232
+ const stdout = execErr.stdout?.trim() ?? "";
233
+ const msg = stderr || stdout || execErr.message || "Command failed";
234
+ if (msg.length > 4000) {
235
+ return `Error:\n${msg.slice(0, 4000)}\n[…truncated]`;
236
+ }
237
+ return `Error:\n${msg}`;
238
+ }
239
+ },
240
+ });
241
+ // Override built-in read_file tool
242
+ const readFile = defineTool("read_file", {
243
+ description: "Read a file from the filesystem.",
244
+ skipPermission: true,
245
+ overridesBuiltInTool: true,
246
+ parameters: z.object({
247
+ file_path: z.string().describe("Path to the file to read"),
248
+ }),
249
+ handler: async ({ file_path }) => {
250
+ console.error(`[io] read_file tool called: ${file_path}`);
251
+ try {
252
+ const resolved = resolve(file_path);
253
+ if (!existsSync(resolved))
254
+ return `File not found: ${file_path}`;
255
+ const text = readFileSync(resolved, "utf-8");
256
+ if (text.length > 8000) {
257
+ return text.slice(0, 8000) + "\n\n[…truncated]";
258
+ }
259
+ return text;
260
+ }
261
+ catch (err) {
262
+ return `Error: ${err instanceof Error ? err.message : String(err)}`;
263
+ }
264
+ },
265
+ });
266
+ return [wikiRead, wikiWrite, wikiSearch, squadCreate, squadRecall, squadStatus, squadLogDecision, shell, fileOps, bash, readFile];
208
267
  }
209
268
  function walkDirectory(dir, maxDepth = 3, depth = 0) {
210
269
  if (depth >= maxDepth)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heyio",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "IO — a personal AI assistant built on the GitHub Copilot SDK",
5
5
  "bin": {
6
6
  "io": "dist/index.js"