@xynogen/pix-toolbox 0.1.6 → 0.1.7
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 +1 -1
- package/src/toolbox.test.ts +14 -10
package/package.json
CHANGED
package/src/toolbox.test.ts
CHANGED
|
@@ -41,7 +41,7 @@ describe("buildRows", () => {
|
|
|
41
41
|
|
|
42
42
|
test("flags MCP tools", () => {
|
|
43
43
|
const rows = buildRows([mcpToolInfo("ctx_search")]);
|
|
44
|
-
expect(rows[0].mcp).toBe(true);
|
|
44
|
+
expect((rows[0] as ToolRow).mcp).toBe(true);
|
|
45
45
|
});
|
|
46
46
|
|
|
47
47
|
test("empty input returns empty", () => {
|
|
@@ -260,6 +260,7 @@ function makeCtx() {
|
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
describe("/toolbox command", () => {
|
|
263
|
+
type Note = { text: string; level?: string };
|
|
263
264
|
const ALL = ["read", "write", "bash", "grep", "find"];
|
|
264
265
|
|
|
265
266
|
async function boot() {
|
|
@@ -281,28 +282,31 @@ describe("/toolbox command", () => {
|
|
|
281
282
|
await host.command("toolbox")?.handler("", ctx);
|
|
282
283
|
expect(notes.length).toBe(1);
|
|
283
284
|
// only non-core tools shown, all start active
|
|
284
|
-
|
|
285
|
-
expect(
|
|
285
|
+
const n0 = notes[0] as Note;
|
|
286
|
+
expect(n0.text).toContain("✓ active grep");
|
|
287
|
+
expect(n0.text).toContain("✓ active find");
|
|
286
288
|
// core tools excluded from toolbox
|
|
287
|
-
expect(
|
|
288
|
-
expect(
|
|
289
|
+
expect(n0.text).not.toContain(" read");
|
|
290
|
+
expect(n0.text).not.toContain(" bash");
|
|
289
291
|
});
|
|
290
292
|
|
|
291
293
|
test("/toolbox list shows non-core tools with status", async () => {
|
|
292
294
|
const host = await boot();
|
|
293
295
|
const { ctx, notes } = makeCtx();
|
|
294
296
|
await host.command("toolbox")?.handler("list", ctx);
|
|
295
|
-
|
|
296
|
-
expect(
|
|
297
|
-
expect(
|
|
297
|
+
const ln0 = notes[0] as Note;
|
|
298
|
+
expect(ln0.text).toContain("grep");
|
|
299
|
+
expect(ln0.text).toContain("find");
|
|
300
|
+
expect(ln0.text).not.toContain(" bash");
|
|
298
301
|
});
|
|
299
302
|
|
|
300
303
|
test("/toolbox list <query> filters", async () => {
|
|
301
304
|
const host = await boot();
|
|
302
305
|
const { ctx, notes } = makeCtx();
|
|
303
306
|
await host.command("toolbox")?.handler("list fin", ctx);
|
|
304
|
-
|
|
305
|
-
expect(
|
|
307
|
+
const fn0 = notes[0] as Note;
|
|
308
|
+
expect(fn0.text).toContain("find");
|
|
309
|
+
expect(fn0.text).not.toContain("✓ active read");
|
|
306
310
|
});
|
|
307
311
|
|
|
308
312
|
test("opens interactive picker when ctx.ui.custom exists", async () => {
|