The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 03:37 UTC
| 1 | import { assert, describe, it } from "@effect/vitest"; |
| 2 | import * as Schema from "effect/Schema"; |
| 3 | |
| 4 | import { ThreadMetadataMcpUpdateInput } from "./threadMetadataMcp.ts"; |
| 5 | |
| 6 | const decodeUpdate = Schema.decodeUnknownSync(ThreadMetadataMcpUpdateInput); |
| 7 | |
| 8 | describe("ThreadMetadataMcpUpdateInput", () => { |
| 9 | it("rejects malformed client request ids without normalizing valid keys", () => { |
| 10 | const validKey = "metadata-\ud83d\ude80-1"; |
| 11 | assert.equal( |
| 12 | decodeUpdate({ action: "regenerate_title", clientRequestId: validKey }).clientRequestId, |
| 13 | validKey, |
| 14 | ); |
| 15 | assert.throws(() => |
| 16 | decodeUpdate({ action: "regenerate_title", clientRequestId: "metadata-\ud800" }), |
| 17 | ); |
| 18 | assert.throws(() => |
| 19 | decodeUpdate({ action: "regenerate_title", clientRequestId: "metadata-\udc00" }), |
| 20 | ); |
| 21 | }); |
| 22 | }); |