Assert a single tool advertises the full read-only contract from #1018.
(tool: ToolDefinition)
| 28 | |
| 29 | /** Assert a single tool advertises the full read-only contract from #1018. */ |
| 30 | function expectReadOnly(tool: ToolDefinition): void { |
| 31 | expect(tool.annotations, `${tool.name} is missing annotations`).toBeDefined(); |
| 32 | // The hint Cursor Ask mode (and other clients) gate on. |
| 33 | expect(tool.annotations!.readOnlyHint).toBe(true); |
| 34 | // The exact triplet the issue asks for, plus the honest closed-world hint. |
| 35 | expect(tool.annotations!.destructiveHint).toBe(false); |
| 36 | expect(tool.annotations!.idempotentHint).toBe(true); |
| 37 | expect(tool.annotations!.openWorldHint).toBe(false); |
| 38 | } |
| 39 | |
| 40 | /** Assert the explore tool in a `tools/list` surface is marked always-load for Claude Code (#1696). */ |
| 41 | function expectExploreAlwaysLoad(surface: ToolDefinition[]): void { |
no outgoing calls
no test coverage detected