(
resolved: Record<string, string | null>,
)
| 3883 | const grantedScopes = grantedScopesFromRow(connectionRow); |
| 3884 | const invokeTool = runtime.plugin.invokeTool; |
| 3885 | const invokeWith = ( |
| 3886 | resolved: Record<string, string | null>, |
| 3887 | ): Effect.Effect<unknown, ToolInvocationError> => { |
| 3888 | const credential: ToolInvocationCredential = { |
| 3889 | owner: parsed.owner, |
| 3890 | integration: parsed.integration, |
| 3891 | connection: parsed.connection, |
| 3892 | template: AuthTemplateSlug.make(connectionRow.template), |
| 3893 | value: resolved[PRIMARY_INPUT_VARIABLE] ?? null, |
| 3894 | values: resolved, |
| 3895 | config: integrationRow ? decodeJsonColumn(integrationRow.config) : undefined, |
| 3896 | ...(grantedScopes ? { grantedScopes } : {}), |
| 3897 | }; |
| 3898 | return wrapInvocationError( |
| 3899 | invokeTool({ |
| 3900 | ctx: runtime.ctx, |
| 3901 | toolRow: row, |
| 3902 | credential, |
| 3903 | args, |
| 3904 | elicit: buildElicit(address, args, handler), |
| 3905 | invokeOptions: options, |
| 3906 | }), |
| 3907 | ); |
| 3908 | }; |
| 3909 | |
| 3910 | const first = yield* invokeWith(values); |
| 3911 | // Reactive refresh. `expires_at` is only ever the AS's ADVERTISED |
no test coverage detected