@ftrdotdev/pi-tui 0.5.1 → 0.5.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": "@ftrdotdev/pi-tui",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "House TUI components and the pi interface extension: themed boxes, a pure box-frame model, and the header/footer/editor/settings/preview chrome",
5
5
  "keywords": [
6
6
  "components",
@@ -50,17 +50,16 @@
50
50
  "lint": "oxlint && oxlint --type-aware -A all -D typescript/unbound-method",
51
51
  "lint:fix": "oxlint --fix",
52
52
  "fmt": "oxfmt",
53
- "prepare": "bun effect-tsgo patch --typescript --oxlint",
54
53
  "typecheck": "tsc --noEmit"
55
54
  },
56
55
  "dependencies": {
57
- "@effect/platform-node": "4.0.0-rc.116",
58
- "@effect/platform-node-shared": "4.0.0-rc.116",
59
- "effect": "4.0.0-rc.116"
56
+ "@effect/platform-node": "4.0.0",
57
+ "@effect/platform-node-shared": "4.0.0",
58
+ "effect": "4.0.0"
60
59
  },
61
60
  "devDependencies": {
62
- "@effect/tsgo": "0.45.0",
63
- "@effect/vitest": "4.0.0-rc.116",
61
+ "@effect/tsgo": "0.47.2",
62
+ "@effect/vitest": "4.0.0",
64
63
  "@types/bun": "latest",
65
64
  "oxfmt": "^0.63.0",
66
65
  "oxlint": "1.82.0",
@@ -1,5 +1,6 @@
1
+ // @effect-diagnostics unstableApiUsage:off
1
2
  import { Context, Duration, Effect, Layer, Schema, Stream, PlatformError } from "effect";
2
- import * as CP from "effect/unstable/process";
3
+ import * as CP from "effect/process";
3
4
 
4
5
  /** Fixed per-invocation time cap applied to every git command (2 seconds). */
5
6
  export const GIT_EXECUTION_CAP: Duration.Duration = Duration.seconds(2);
@@ -135,9 +135,19 @@ const EXPECTED: Record<string, string[]> = {
135
135
  };
136
136
 
137
137
  // The header prints the installed pi version. Rewrite the frozen tables so a pi
138
- // dependency bump does not break pixel parity.
138
+ // dependency bump does not break pixel parity. A version of a different length
139
+ // changes the top-border padding, so restore each boxed row to its frozen width
140
+ // by adding or removing trailing dashes before the closing corner.
141
+ const FROZEN_VERSION = "v0.84.4";
139
142
  for (const [width, lines] of Object.entries(EXPECTED)) {
140
- EXPECTED[width] = lines.map((line) => line.replaceAll("v0.84.4", `v${VERSION}`));
143
+ EXPECTED[width] = lines.map((line) => {
144
+ if (!line.includes(FROZEN_VERSION)) return line;
145
+ let next = line.replaceAll(FROZEN_VERSION, `v${VERSION}`);
146
+ if (!next.endsWith("\u256e")) return next;
147
+ while (next.length < line.length) next = `${next.slice(0, -1)}\u2500\u256e`;
148
+ while (next.length > line.length) next = `${next.slice(0, -2)}\u256e`;
149
+ return next;
150
+ });
141
151
  }
142
152
 
143
153
  // Render one width through the service layer entry under the fixed seed.
@@ -1,7 +1,7 @@
1
1
  import { assert, it } from "@effect/vitest";
2
2
  import type {
3
3
  ExtensionAPI,
4
- ExtensionContext,
4
+ ExtensionToolContext,
5
5
  Theme,
6
6
  ToolDefinition,
7
7
  } from "@earendil-works/pi-coding-agent";
@@ -548,7 +548,7 @@ it("the preview tool registers with the preview name and a path parameter", () =
548
548
 
549
549
  it("tool execute returns the exact confirmation stub and the display record for a readable file", async () => {
550
550
  const tool = registerTool(makeMemFs({ "/cwd/src/file.md": "# Title" }));
551
- const ctx = { cwd: "/cwd" } as ExtensionContext;
551
+ const ctx = { cwd: "/cwd" } as ExtensionToolContext;
552
552
  const result = await tool.execute("call-1", { path: "src/file.md" }, undefined, undefined, ctx);
553
553
  assert.strictEqual(
554
554
  (result.content[0] as { type: "text"; text: string }).text,
@@ -565,7 +565,7 @@ it("tool execute returns the exact confirmation stub and the display record for
565
565
 
566
566
  it("tool execute keeps the model stub for images and returns an image detail record", async () => {
567
567
  const tool = registerTool(makeMemFs({}, { "/cwd/pic.png": PNG_BYTES }));
568
- const ctx = { cwd: "/cwd" } as ExtensionContext;
568
+ const ctx = { cwd: "/cwd" } as ExtensionToolContext;
569
569
  const result = await tool.execute("call-1", { path: "pic.png" }, undefined, undefined, ctx);
570
570
  assert.strictEqual(
571
571
  (result.content[0] as { type: "text"; text: string }).text,
@@ -586,7 +586,7 @@ it("tool execute keeps the model stub for images and returns an image detail rec
586
586
 
587
587
  it("tool execute returns only the text stub for text files (no image block)", async () => {
588
588
  const tool = registerTool(makeMemFs({ "/cwd/file.md": "# Title" }));
589
- const ctx = { cwd: "/cwd" } as ExtensionContext;
589
+ const ctx = { cwd: "/cwd" } as ExtensionToolContext;
590
590
  const result = await tool.execute("call-1", { path: "file.md" }, undefined, undefined, ctx);
591
591
  assert.strictEqual(result.content.length, 1);
592
592
  assert.strictEqual((result.content[0] as { type: string }).type, "text");
@@ -594,14 +594,14 @@ it("tool execute returns only the text stub for text files (no image block)", as
594
594
 
595
595
  it("tool execute resolves relative paths against the tool context cwd", async () => {
596
596
  const tool = registerTool(makeMemFs({ "/cwd/src/file.md": "# Title" }));
597
- const ctx = { cwd: "/cwd" } as ExtensionContext;
597
+ const ctx = { cwd: "/cwd" } as ExtensionToolContext;
598
598
  const result = await tool.execute("call-1", { path: "src/file.md" }, undefined, undefined, ctx);
599
599
  assert.strictEqual(result.details.path, "/cwd/src/file.md");
600
600
  });
601
601
 
602
602
  it("tool execute returns the exact failure stub and error details when the read fails", async () => {
603
603
  const tool = registerTool();
604
- const ctx = { cwd: "/cwd" } as ExtensionContext;
604
+ const ctx = { cwd: "/cwd" } as ExtensionToolContext;
605
605
  const result = await tool.execute("call-1", { path: "missing.md" }, undefined, undefined, ctx);
606
606
  const expectedMessage = PlatformError.systemError({
607
607
  _tag: "NotFound",
@@ -626,7 +626,7 @@ it("tool execute returns the exact failure stub and error details when the read
626
626
 
627
627
  it("tool execute reports the failure stub when the reference is unresolvable", async () => {
628
628
  const tool = registerTool();
629
- const ctx = { cwd: "/cwd" } as ExtensionContext;
629
+ const ctx = { cwd: "/cwd" } as ExtensionToolContext;
630
630
  const result = await tool.execute(
631
631
  "call-1",
632
632
  { path: "file://host/path" },