(
resolved: Record<string, string | null>,
)
| 6487 | const grantedScopes = grantedScopesFromRow(connectionRow); |
| 6488 | const invokeTool = runtime.plugin.invokeTool; |
| 6489 | const invokeWith = ( |
| 6490 | resolved: Record<string, string | null>, |
| 6491 | ): Effect.Effect<unknown, ToolInvocationError> => { |
| 6492 | const credential: ToolInvocationCredential = { |
| 6493 | owner: parsed.owner, |
| 6494 | integration: parsed.integration, |
| 6495 | connection: parsed.connection, |
| 6496 | template: AuthTemplateSlug.make(connectionRow.template), |
| 6497 | value: resolved[PRIMARY_INPUT_VARIABLE] ?? null, |
| 6498 | values: resolved, |
| 6499 | config: integrationRow ? decodeJsonColumn(integrationRow.config) : undefined, |
| 6500 | ...(grantedScopes ? { grantedScopes } : {}), |
| 6501 | }; |
| 6502 | return wrapInvocationError( |
| 6503 | invokeTool({ |
| 6504 | ctx: runtime.ctx, |
| 6505 | toolRow: row, |
| 6506 | credential, |
| 6507 | args, |
| 6508 | elicit: buildElicit(address, args, handler), |
| 6509 | invokeOptions: options, |
| 6510 | }), |
| 6511 | ); |
| 6512 | }; |
| 6513 | |
| 6514 | const first = yield* invokeWith(values); |
| 6515 | // Reactive refresh. `expires_at` is only ever the AS's ADVERTISED |
no test coverage detected