From 42b1ef6e2ca71c5eb812d9fb08835aa9294312b4 Mon Sep 17 00:00:00 2001 From: pi Date: Sat, 11 Apr 2026 02:14:13 +0100 Subject: [PATCH] test(manifest): read README at test time; tighten npm pack assertions; fix ellipsis in tool description --- index.ts | 3 ++- package-manifest.test.mjs | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/index.ts b/index.ts index 49f2e7b..bcbe4c6 100644 --- a/index.ts +++ b/index.ts @@ -336,7 +336,8 @@ export default function question(pi: ExtensionAPI) { name: "question", label: "Question", description: - "Ask the user one or more multiple-choice questions. Every question automatically gets a final Something else… option for free-text answers.", + "Ask the user one or more multiple-choice questions. Every question automatically gets a final Something else... option for free-text answers.", + parameters: QuestionParams, async execute(_toolCallId, params, _signal, _onUpdate, ctx) { diff --git a/package-manifest.test.mjs b/package-manifest.test.mjs index 562aea4..e5e6c0f 100644 --- a/package-manifest.test.mjs +++ b/package-manifest.test.mjs @@ -7,7 +7,7 @@ import { fileURLToPath } from "node:url"; const packageRoot = dirname(fileURLToPath(import.meta.url)); const pkg = JSON.parse(readFileSync(resolve(packageRoot, "package.json"), "utf8")); -const readme = readFileSync(resolve(packageRoot, "README.md"), "utf8"); + function getPackedPaths() { const output = execFileSync("npm", ["pack", "--dry-run", "--json"], { @@ -49,6 +49,7 @@ test("package.json exposes pi-question as a standalone pi package", () => { }); test("README documents local and git installation", () => { + const readme = readFileSync(resolve(packageRoot, "README.md"), "utf8"); assert.match(readme, /pi install \/absolute\/path\/to\/question/); assert.match(readme, /pi install https:\/\/gitea\.rwiesner\.com\/pi\/pi-question/); }); @@ -56,8 +57,7 @@ test("README documents local and git installation", () => { test("npm pack includes runtime package assets", () => { const packedPaths = getPackedPaths(); - assert.ok(packedPaths.includes("README.md")); - assert.ok(packedPaths.includes("package.json")); assert.ok(packedPaths.includes("index.ts")); assert.ok(packedPaths.includes("question-core.mjs")); + assert.deepEqual(packedPaths.filter((p) => p.endsWith('.test.mjs')), []); });