@strayl/agent 0.1.10 → 0.1.11

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/agent.js CHANGED
@@ -7201,6 +7201,9 @@ var LLMClient = class {
7201
7201
  }
7202
7202
  }
7203
7203
  }
7204
+ if (choice.finish_reason) {
7205
+ console.error(`[LLM] finish_reason: ${choice.finish_reason}, partialToolCalls: ${partialToolCalls.size}`);
7206
+ }
7204
7207
  if (choice.finish_reason === "tool_calls" || choice.finish_reason === "stop") {
7205
7208
  if (!emittedToolCalls) {
7206
7209
  emittedToolCalls = true;
@@ -7220,10 +7223,11 @@ var LLMClient = class {
7220
7223
  };
7221
7224
  }
7222
7225
  }
7223
- if (!emittedToolCalls) {
7226
+ if (!emittedToolCalls && partialToolCalls.size > 0) {
7227
+ console.error(`[LLM] Fallback tool call emit: ${partialToolCalls.size} partial calls`);
7224
7228
  for (const [, partial] of partialToolCalls) {
7225
- if (partial.id && partial.name && partial.arguments) {
7226
- yield { type: "tool_call_complete", id: partial.id, name: partial.name, arguments: partial.arguments };
7229
+ if (partial.id && partial.name) {
7230
+ yield { type: "tool_call_complete", id: partial.id, name: partial.name, arguments: partial.arguments || "{}" };
7227
7231
  }
7228
7232
  }
7229
7233
  }
@@ -13401,15 +13405,16 @@ function createPlanModeMiddleware(getMode) {
13401
13405
  name: "planModeFilter",
13402
13406
  filterTools: (tools) => {
13403
13407
  const mode2 = getMode();
13408
+ const getName2 = (t) => t.type === "function" ? t.function.name : "";
13404
13409
  if (mode2 === "plan") {
13405
- return tools.filter((t) => !PLAN_MODE_BLOCKED.has(t.function.name));
13410
+ return tools.filter((t) => !PLAN_MODE_BLOCKED.has(getName2(t)));
13406
13411
  }
13407
13412
  if (mode2 === "implement") {
13408
13413
  return tools.filter(
13409
- (t) => !IMPL_MODE_BLOCKED.has(t.function.name) && t.function.name !== "enterPlanMode"
13414
+ (t) => !IMPL_MODE_BLOCKED.has(getName2(t)) && getName2(t) !== "enterPlanMode"
13410
13415
  );
13411
13416
  }
13412
- return tools.filter((t) => !IMPL_MODE_BLOCKED.has(t.function.name));
13417
+ return tools.filter((t) => !IMPL_MODE_BLOCKED.has(getName2(t)));
13413
13418
  },
13414
13419
  wrapToolCall: async (call, next) => {
13415
13420
  const mode2 = getMode();
@@ -13717,7 +13722,11 @@ ${IMPLEMENTATION_MODE_PROMPT2}`);
13717
13722
  context_left_percent: leftPercent
13718
13723
  });
13719
13724
  }
13720
- if (completedToolCalls.length === 0) break;
13725
+ if (completedToolCalls.length === 0) {
13726
+ console.error(`[Agent] Iteration ${iteration}: No tool calls. assistantText: ${assistantText.length} chars. Breaking.`);
13727
+ break;
13728
+ }
13729
+ console.error(`[Agent] Iteration ${iteration}: ${completedToolCalls.length} tool call(s): ${completedToolCalls.map((tc) => tc.function.name).join(", ")}`);
13721
13730
  for (const tc of completedToolCalls) {
13722
13731
  if (stdin.isCancelled()) {
13723
13732
  context.addToolResult(tc.id, tc.function.name, JSON.stringify({ error: "Cancelled by user." }));
package/package.json CHANGED
@@ -1,27 +1,27 @@
1
- {
2
- "name": "@strayl/agent",
3
- "version": "0.1.10",
4
- "type": "module",
5
- "publishConfig": {
6
- "access": "public"
7
- },
8
- "main": "dist/index.js",
9
- "files": [
10
- "dist",
11
- "skills"
12
- ],
13
- "scripts": {
14
- "build": "esbuild src/index.ts --bundle --platform=node --target=node20 --format=esm --outfile=dist/agent.js --external:fsevents",
15
- "dev": "tsx watch src/index.ts"
16
- },
17
- "dependencies": {
18
- "openai": "^5.8.0",
19
- "zod": "^3.25.67"
20
- },
21
- "devDependencies": {
22
- "esbuild": "^0.25.5",
23
- "tsx": "^4.19.4",
24
- "typescript": "^5.8.3",
25
- "@types/node": "^22.15.31"
26
- }
27
- }
1
+ {
2
+ "name": "@strayl/agent",
3
+ "version": "0.1.11",
4
+ "type": "module",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "main": "dist/index.js",
9
+ "files": [
10
+ "dist",
11
+ "skills"
12
+ ],
13
+ "scripts": {
14
+ "build": "esbuild src/index.ts --bundle --platform=node --target=node20 --format=esm --outfile=dist/agent.js --external:fsevents",
15
+ "dev": "tsx watch src/index.ts"
16
+ },
17
+ "dependencies": {
18
+ "openai": "^5.8.0",
19
+ "zod": "^3.25.67"
20
+ },
21
+ "devDependencies": {
22
+ "esbuild": "^0.25.5",
23
+ "tsx": "^4.19.4",
24
+ "typescript": "^5.8.3",
25
+ "@types/node": "^22.15.31"
26
+ }
27
+ }