heyio 0.1.6 → 0.1.8

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.
@@ -187,14 +187,15 @@ async function executeOnSession(prompt, callback) {
187
187
  const session = await ensureOrchestratorSession();
188
188
  let accumulated = "";
189
189
  const unsubDelta = session.on("assistant.message_delta", (event) => {
190
- accumulated += event.data.deltaContent;
191
- callback(accumulated, false);
190
+ const delta = event.data.deltaContent;
191
+ accumulated += delta;
192
+ callback(delta, false);
192
193
  });
193
194
  try {
194
195
  const result = await session.sendAndWait({ prompt }, SEND_TIMEOUT_MS);
195
196
  unsubDelta();
196
197
  const finalText = result?.data.content ?? accumulated;
197
- callback(finalText, true);
198
+ callback("", true);
198
199
  return finalText;
199
200
  }
200
201
  catch (err) {
@@ -202,7 +203,7 @@ async function executeOnSession(prompt, callback) {
202
203
  // If we accumulated partial text, return it gracefully on timeout
203
204
  if (accumulated && err instanceof Error && err.message.includes("timeout")) {
204
205
  console.error("[io] Session sendAndWait timed out, returning partial response");
205
- callback(accumulated, true);
206
+ callback("", true);
206
207
  return accumulated;
207
208
  }
208
209
  // Session-level errors: invalidate and let caller retry
@@ -76,7 +76,7 @@ Squads are persistent project teams. When a user works on a codebase:
76
76
 
77
77
  ### System
78
78
  - \`shell\`: Run a shell command.
79
- - \`web_fetch\`: Fetch a URL and return content.
79
+ - \`web_fetch\`: (built-in) Fetch a URL and return content.
80
80
 
81
81
  ## Guidelines
82
82
 
@@ -139,33 +139,6 @@ export function createTools(deps) {
139
139
  }
140
140
  },
141
141
  });
142
- const webFetch = defineTool("web_fetch", {
143
- description: "Fetch a URL and return its content as text.",
144
- parameters: z.object({
145
- url: z.string().describe("URL to fetch"),
146
- max_length: z.number().optional().describe("Max chars to return (default: 5000)"),
147
- }),
148
- handler: async ({ url, max_length }) => {
149
- try {
150
- const response = await fetch(url, {
151
- headers: { "User-Agent": "IO-Assistant/1.0" },
152
- signal: AbortSignal.timeout(15000),
153
- });
154
- if (!response.ok) {
155
- return `HTTP ${response.status}: ${response.statusText}`;
156
- }
157
- const text = await response.text();
158
- const limit = max_length ?? 5000;
159
- if (text.length > limit) {
160
- return text.slice(0, limit) + "\n\n[…truncated]";
161
- }
162
- return text;
163
- }
164
- catch (err) {
165
- return `Fetch error: ${err instanceof Error ? err.message : String(err)}`;
166
- }
167
- },
168
- });
169
142
  const fileOps = defineTool("file_ops", {
170
143
  description: "Read, write, or list files on the local filesystem.",
171
144
  parameters: z.object({
@@ -216,7 +189,7 @@ export function createTools(deps) {
216
189
  }
217
190
  },
218
191
  });
219
- return [wikiRead, wikiWrite, wikiSearch, squadCreate, squadRecall, squadStatus, squadLogDecision, shell, webFetch, fileOps];
192
+ return [wikiRead, wikiWrite, wikiSearch, squadCreate, squadRecall, squadStatus, squadLogDecision, shell, fileOps];
220
193
  }
221
194
  function walkDirectory(dir, maxDepth = 3, depth = 0) {
222
195
  if (depth >= maxDepth)
@@ -32,7 +32,10 @@ export function createBot() {
32
32
  let pendingEdit;
33
33
  const editReply = async (content) => {
34
34
  try {
35
- await ctx.api.editMessageText(chatId, placeholder.message_id, content);
35
+ const truncated = content.length > TELEGRAM_MAX_LENGTH
36
+ ? content.slice(0, TELEGRAM_MAX_LENGTH - 20) + "\n\n[…truncated]"
37
+ : content;
38
+ await ctx.api.editMessageText(chatId, placeholder.message_id, truncated);
36
39
  }
37
40
  catch (err) {
38
41
  const message = err instanceof Error ? err.message : String(err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heyio",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "IO — a personal AI assistant built on the GitHub Copilot SDK",
5
5
  "bin": {
6
6
  "io": "dist/index.js"