feat: support normalizing coordinate spaces
This commit is contained in:
+7
-2
@@ -1,9 +1,9 @@
|
||||
import { test } from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { complete } from "../src/model.js";
|
||||
import { desktopArguments, shellArguments } from "../src/tools.js";
|
||||
import { desktopArguments, shellArguments, toolsForCoordinates } from "../src/tools.js";
|
||||
|
||||
const config = { llamaCppOrigin: "http://example.test", modelId: "test", databasePath: ":memory:" };
|
||||
const config: import("../src/config.js").Config = { coordinateSpace: "pixels", llamaCppOrigin: "http://example.test", modelId: "test", databasePath: ":memory:" };
|
||||
|
||||
test("adapter accepts tool calls and rejects truncated responses", async (t) => {
|
||||
let finish = "tool_calls";
|
||||
@@ -19,6 +19,11 @@ test("adapter accepts tool calls and rejects truncated responses", async (t) =>
|
||||
await assert.rejects(complete(config, [], []), /incomplete/);
|
||||
});
|
||||
|
||||
test("tool descriptions advertise the configured coordinate convention", () => {
|
||||
assert.match(toolsForCoordinates("normalized_1000")[0]?.function.description ?? "", /0\.\.1000/);
|
||||
assert.match(toolsForCoordinates("pixels")[0]?.function.description ?? "", /not normalized/);
|
||||
});
|
||||
|
||||
test("tool inputs reject invalid commands, bounds, and action names", () => {
|
||||
assert.throws(() => shellArguments.parse({ command: "", timeoutSeconds: 1 }));
|
||||
assert.throws(() => shellArguments.parse({ command: "true", timeoutSeconds: 999 }));
|
||||
|
||||
Reference in New Issue
Block a user