(tool: SkyToolDefinition, args: unknown)
| 250 | * `null` so a caller always gets a well-formed body. |
| 251 | */ |
| 252 | export const skyCallProgram = (tool: SkyToolDefinition, args: unknown): string => { |
| 253 | const call = tool.takesArgs ? `sky.${tool.method}(${jsLiteral(args)})` : `sky.${tool.method}()`; |
| 254 | return [ |
| 255 | `globalThis.sky ??= (await import(${JSON.stringify(SKY_PACKAGE)})).sky;`, |
| 256 | writeJsonResult([], `await ${call}`), |
| 257 | ].join("\n"); |
| 258 | }; |
no test coverage detected