@agnishc/edb-subagents 0.14.0 → 0.14.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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.13.0] - 2026-05-23
4
+
5
+ ### Added
6
+ - `loadCustomAgents` tests for custom agents context frontmatter parsing.
7
+
3
8
  ## [0.12.0] - 2026-05-22
4
9
 
5
10
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agnishc/edb-subagents",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "description": "Pi extension: Claude Code-style autonomous sub-agents with live widget, parallel execution, mid-run steering, and custom agent types",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -0,0 +1,38 @@
1
+ import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
2
+ import { tmpdir } from "node:os";
3
+ import { join } from "node:path";
4
+ import { afterEach, describe, expect, it } from "vitest";
5
+ import { loadCustomAgents } from "./custom-agents.js";
6
+
7
+ describe("loadCustomAgents", () => {
8
+ let cwd: string | undefined;
9
+
10
+ afterEach(() => {
11
+ if (cwd) rmSync(cwd, { recursive: true, force: true });
12
+ cwd = undefined;
13
+ });
14
+
15
+ it("loads context frontmatter for orchestrator guidance", () => {
16
+ cwd = mkdtempSync(join(tmpdir(), "edb-subagents-"));
17
+ const agentsDir = join(cwd, ".pi", "agents");
18
+ mkdirSync(agentsDir, { recursive: true });
19
+ writeFileSync(
20
+ join(agentsDir, "reviewer.md"),
21
+ `---
22
+ description: Security reviewer
23
+ context: Use when a change touches authentication, authorization, secrets, or external inputs.
24
+ tools: read, grep, find, bash
25
+ ---
26
+
27
+ You review security-sensitive code.
28
+ `,
29
+ "utf-8",
30
+ );
31
+
32
+ const agents = loadCustomAgents(cwd);
33
+
34
+ expect(agents.get("reviewer")?.context).toBe(
35
+ "Use when a change touches authentication, authorization, secrets, or external inputs.",
36
+ );
37
+ });
38
+ });
@@ -94,12 +94,14 @@ export class ConversationViewer implements Component {
94
94
  this.lastInnerW = innerW;
95
95
  const lines: string[] = [];
96
96
 
97
+ const normalizeForRender = (s: string) => s.replace(/\t/g, " ");
97
98
  const pad = (s: string, len: number) => {
98
- const vis = visibleWidth(s);
99
- return s + " ".repeat(Math.max(0, len - vis));
99
+ const normalized = normalizeForRender(s);
100
+ const clipped = truncateToWidth(normalized, len, "");
101
+ const vis = visibleWidth(clipped);
102
+ return clipped + " ".repeat(Math.max(0, len - vis));
100
103
  };
101
- const row = (content: string) =>
102
- `${th.fg("border", "│")} ${truncateToWidth(pad(content, innerW), innerW)} ${th.fg("border", "│")}`;
104
+ const row = (content: string) => `${th.fg("border", "│")} ${pad(content, innerW)} ${th.fg("border", "│")}`;
103
105
  const hrTop = th.fg("border", `╭${"─".repeat(width - 2)}╮`);
104
106
  const hrBot = th.fg("border", `╰${"─".repeat(width - 2)}╯`);
105
107
  const hrMid = row(th.fg("dim", "─".repeat(innerW)));