(appsEnabled: boolean)
| 142 | |
| 143 | it("registers app metadata and app-only tools only for apps-enabled requests", async () => { |
| 144 | const inspect = async (appsEnabled: boolean) => { |
| 145 | let observed: |
| 146 | | { |
| 147 | readonly names: readonly string[]; |
| 148 | readonly createMeta: Record<string, unknown> | undefined; |
| 149 | readonly resourceCount: number; |
| 150 | } |
| 151 | | undefined; |
| 152 | await withClient( |
| 153 | { |
| 154 | engine: makeStubEngine(), |
| 155 | appsEnabled, |
| 156 | loadAppShellHtml: async () => "<html></html>", |
| 157 | }, |
| 158 | async (client) => { |
| 159 | const tools = (await client.listTools()).tools; |
| 160 | observed = { |
| 161 | names: tools.map(({ name }) => name), |
| 162 | createMeta: tools.find(({ name }) => name === "create-artifact")?._meta, |
| 163 | resourceCount: (await client.listResources()).resources.length, |
| 164 | }; |
| 165 | }, |
| 166 | ); |
| 167 | return observed; |
| 168 | }; |
| 169 | |
| 170 | const enabled = await inspect(true); |
| 171 | expect(enabled?.names).toContain("execute-action"); |
no test coverage detected