niahere 0.4.1 → 0.4.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "niahere",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "A personal AI assistant daemon — chat, scheduled jobs, persona system, extensible via skills.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -44,9 +44,9 @@
44
44
  "license": "MIT",
45
45
  "private": false,
46
46
  "dependencies": {
47
- "@anthropic-ai/claude-agent-sdk": "^0.2.126",
48
- "@anthropic-ai/sdk": "^0.88.0",
49
- "@modelcontextprotocol/sdk": "^1.27.1",
47
+ "@anthropic-ai/claude-agent-sdk": "^0.3.190",
48
+ "@anthropic-ai/sdk": "^0.105.0",
49
+ "@modelcontextprotocol/sdk": "^1.29.0",
50
50
  "@slack/bolt": "^4.6.0",
51
51
  "cron-parser": "^5.5.0",
52
52
  "grammy": "^1.41.1",
@@ -1,5 +1,5 @@
1
1
  import type { AgentEvent, Normalizer } from "../types";
2
- import { truncate, formatToolUse } from "../../utils/format-activity";
2
+ import { truncate } from "../../utils/format-activity";
3
3
  import { isRetryableApiError, isProviderDownError } from "../../utils/retry";
4
4
 
5
5
  /**
@@ -30,22 +30,14 @@ export class SdkNormalizer implements Normalizer {
30
30
  }
31
31
 
32
32
  if (msg.type === "tool_use_summary") {
33
- return [
34
- {
35
- type: "tool",
36
- name: msg.tool_name || "tool",
37
- summary: formatToolUse(msg.tool_name || "tool", msg.tool_input),
38
- },
39
- ];
33
+ // The SDK provides a ready-made human-readable summary (e.g. "Read foo.ts").
34
+ // (Older code read tool_name/tool_input, which this event does not carry.)
35
+ return msg.summary ? [{ type: "tool", name: "tool", summary: truncate(msg.summary, 70) }] : [];
40
36
  }
41
37
 
42
38
  if (msg.type === "tool_progress") {
43
- if (msg.tool_name === "Bash" && msg.content) {
44
- return [{ type: "tool", name: "Bash", summary: `$ ${truncate(msg.content, 60)}` }];
45
- }
46
- if (msg.content) {
47
- return [{ type: "tool", name: msg.tool_name || "tool", summary: truncate(msg.content, 70) }];
48
- }
39
+ // Carries only tool_use_id/tool_name/elapsed_time no displayable content,
40
+ // and fires repeatedly. tool_use_summary already covers tool activity.
49
41
  return [];
50
42
  }
51
43
 
@@ -151,8 +151,14 @@ class ClaudeSession implements AgentSession {
151
151
  retry = true;
152
152
  break;
153
153
  }
154
- yield ev;
155
- if (ev.type === "result" || ev.type === "error") {
154
+ // A retryable error that survived all our retries means the provider is
155
+ // effectively down for us flag it so the consumer can fail over.
156
+ const out =
157
+ ev.type === "error" && ev.retryable && this.retryCount >= MAX_SEND_RETRIES
158
+ ? { ...ev, providerDown: true }
159
+ : ev;
160
+ yield out;
161
+ if (out.type === "result" || out.type === "error") {
156
162
  this.retryCount = 0;
157
163
  return;
158
164
  }