@polderlabs/bizar 5.6.0-beta.10 → 5.6.0-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polderlabs/bizar",
3
- "version": "5.6.0-beta.10",
3
+ "version": "5.6.0-beta.11",
4
4
  "description": "Norse-pantheon multi-agent system for cline — 13 agents across 4 cost tiers with cost-aware routing, plans, and a configurable agent harness. v4 ships as a single npm package bundling the dashboard server, cline plugin, and typed SDK.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polderlabs/bizar-sdk",
3
- "version": "0.2.0-beta.10",
3
+ "version": "0.2.0-beta.11",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -136,11 +136,12 @@ export function readGlyphFeedback(
136
136
  const fm = raw.match(/^---\n([\s\S]+?)\n---/);
137
137
  let body = raw;
138
138
  if (fm) {
139
- for (const line of fm[1].split("\n")) {
139
+ const yaml = fm[1] ?? "";
140
+ for (const line of yaml.split("\n")) {
140
141
  const m = line.match(/^(\w+):\s*(.*)$/);
141
- if (m) meta[m[1]] = m[2];
142
+ if (m) meta[m[1]!] = m[2]!;
142
143
  }
143
- body = raw.slice(fm[0].length).replace(/^\s+/, "");
144
+ if (fm[0]) body = raw.slice(fm[0].length).replace(/^\s+/, "");
144
145
  }
145
146
 
146
147
  const commentCount = parseInt(meta.commentCount || "0", 10) || 0;
@@ -211,24 +211,24 @@ describe("executeToolInvocation — happy path", () => {
211
211
  const slug = "inv-get-canvas";
212
212
  await executeSideEffect({ kind: "create_plan", slug, template: null }, ctx(), optsWith(planTools()));
213
213
 
214
- const realPlanTool = planTools().bizar_plan_action;
214
+ const realPlanTool = planTools().bizar_plan_action!;
215
215
  let capturedCtx: AgentToolContext | null = null;
216
216
  let capturedArgs: unknown = null;
217
217
  const spy: AgentTool = createTool({
218
- name: realPlanTool.name,
219
- description: realPlanTool.description,
220
- inputSchema: (realPlanTool as unknown as { inputSchema: Record<string, unknown> }).inputSchema,
218
+ name: realPlanTool!.name,
219
+ description: realPlanTool!.description,
220
+ inputSchema: (realPlanTool! as unknown as { inputSchema: Record<string, unknown> }).inputSchema,
221
221
  execute: async (a, c) => {
222
222
  capturedCtx = c;
223
223
  capturedArgs = a;
224
- return (realPlanTool.execute as (a: unknown, c: unknown) => Promise<unknown>)(a, c);
224
+ return (realPlanTool!.execute as (a: unknown, c: unknown) => Promise<unknown>)(a, c);
225
225
  },
226
226
  });
227
227
 
228
228
  const tools: Record<string, AgentTool> = {
229
229
  bizar_plan_action: spy,
230
- bizar_get_plan_comments: planTools().bizar_get_plan_comments,
231
- bizar_wait_for_feedback: planTools().bizar_wait_for_feedback,
230
+ bizar_get_plan_comments: planTools().bizar_get_plan_comments!,
231
+ bizar_wait_for_feedback: planTools().bizar_wait_for_feedback!,
232
232
  };
233
233
 
234
234
  const sideEffect: SideEffect = { kind: "tool_invocation", toolName: "bizar_plan_action", args: { action: "get_canvas", planSlug: slug } };
@@ -1,3 +1,4 @@
1
+ import { type AgentTool } from "@cline/sdk";
1
2
  /**
2
3
  * slash-command.test.ts — Integration tests for the full slash-command
3
4
  * hook → parser → side-effect → file-I/O path.
@@ -82,9 +83,9 @@ function makeCtx(): ExecutorContext {
82
83
  function makeOpts(): ExecuteOptions {
83
84
  return {
84
85
  tools: {
85
- bizar_plan_action: createPlanActionTool({ worktree, logger }),
86
- bizar_get_plan_comments: createBgGetCommentsTool({ worktree, logger }),
87
- bizar_wait_for_feedback: createWaitForFeedbackTool({ worktree, logger }),
86
+ bizar_plan_action: createPlanActionTool({ worktree, logger }) as unknown as AgentTool<unknown, unknown>,
87
+ bizar_get_plan_comments: createBgGetCommentsTool({ worktree, logger }) as unknown as AgentTool<unknown, unknown>,
88
+ bizar_wait_for_feedback: createWaitForFeedbackTool({ worktree, logger }) as unknown as AgentTool<unknown, unknown>,
88
89
  },
89
90
  defaultTemplate: "blank",
90
91
  defaultPort: 4321,
@@ -21,7 +21,7 @@ const {
21
21
 
22
22
  describe("createMemoryWriteOnEnd — factory", () => {
23
23
  test("returns an object with memoryWriteOnEnd function", () => {
24
- const logger = { debug: () => {}, warn: () => {}, info: () => {} };
24
+ const logger = { log: () => {}, debug: () => {}, info: () => {}, warn: () => {}, error: () => {} };
25
25
  const { memoryWriteOnEnd } = createMemoryWriteOnEnd({
26
26
  worktree: "/tmp/fake",
27
27
  logger,
@@ -33,7 +33,7 @@ describe("createMemoryWriteOnEnd — factory", () => {
33
33
 
34
34
  describe("createMemoryWriteOnEnd — disabled path", () => {
35
35
  test("returns immediately without fetching when enabled=false", async () => {
36
- const logger = { debug: () => {}, warn: () => {}, info: () => {} };
36
+ const logger = { log: () => {}, debug: () => {}, info: () => {}, warn: () => {}, error: () => {} };
37
37
  const { memoryWriteOnEnd } = createMemoryWriteOnEnd({
38
38
  worktree: "/tmp/fake",
39
39
  logger,
@@ -62,7 +62,7 @@ describe("createMemoryWriteOnEnd — idempotency", () => {
62
62
  // (which will fail), but the second call with the same sessionID should
63
63
  // skip the fetch entirely due to the in-memory Set guard.
64
64
  process.env.BIZAR_DASHBOARD_PORT = "59999";
65
- const logger = { debug: () => {}, warn: () => {}, info: () => {} };
65
+ const logger = { log: () => {}, debug: () => {}, info: () => {}, warn: () => {}, error: () => {} };
66
66
  const { memoryWriteOnEnd } = createMemoryWriteOnEnd({
67
67
  worktree: "/tmp/fake",
68
68
  logger,
@@ -219,18 +219,20 @@ describe("graph-query", () => {
219
219
  it("returns ok for known nodes", async () => {
220
220
  const { createGraphQueryTool } = await import("../src/tools/graph-query.js");
221
221
  const tool = createGraphQueryTool({ worktree: tmpWork, logger: silentLogger as never });
222
- const r = await tool.execute({ query: "Module" }, { sessionId: "s", agentId: "a", metadata: { worktree: tmpWork } });
222
+ const r = await tool.execute({ query: "Module" }, { sessionId: "s", agentId: "a", iteration: 1, metadata: { worktree: tmpWork } });
223
223
  expect(r.ok).toBe(true);
224
224
  if (r.ok) {
225
225
  expect(r.count).toBe(1);
226
- expect(r.nodes[0].id).toBe("a");
226
+ const firstNode = r.nodes[0];
227
+ expect(firstNode).toBeDefined();
228
+ expect(firstNode?.id).toBe("a");
227
229
  }
228
230
  });
229
231
 
230
232
  it("finds the shortest path", async () => {
231
233
  const { createGraphPathTool } = await import("../src/tools/graph-query.js");
232
234
  const tool = createGraphPathTool({ worktree: tmpWork, logger: silentLogger as never });
233
- const r = await tool.execute({ from: "a", to: "c" }, { sessionId: "s", agentId: "a", metadata: { worktree: tmpWork } });
235
+ const r = await tool.execute({ from: "a", to: "c" }, { sessionId: "s", agentId: "a", iteration: 1, metadata: { worktree: tmpWork } });
234
236
  expect(r.ok).toBe(true);
235
237
  if (r.ok) {
236
238
  expect(r.hops).toBe(2);
@@ -241,12 +243,14 @@ describe("graph-query", () => {
241
243
  it("explains a node with its neighbors", async () => {
242
244
  const { createGraphExplainTool } = await import("../src/tools/graph-query.js");
243
245
  const tool = createGraphExplainTool({ worktree: tmpWork, logger: silentLogger as never });
244
- const r = await tool.execute({ node: "a" }, { sessionId: "s", agentId: "a", metadata: { worktree: tmpWork } });
246
+ const r = await tool.execute({ node: "a" }, { sessionId: "s", agentId: "a", iteration: 1, metadata: { worktree: tmpWork } });
245
247
  expect(r.ok).toBe(true);
246
248
  if (r.ok) {
247
249
  expect(r.node.id).toBe("a");
248
250
  expect(r.neighbors.length).toBe(1);
249
- expect(r.neighbors[0].node.id).toBe("b");
251
+ const firstNeighbor = r.neighbors[0];
252
+ expect(firstNeighbor).toBeDefined();
253
+ expect(firstNeighbor?.node.id).toBe("b");
250
254
  }
251
255
  });
252
256
  });