(
resolved: Record<string, string | null>,
)
| 5909 | const grantedScopes = grantedScopesFromRow(connectionRow); |
| 5910 | const invokeTool = runtime.plugin.invokeTool; |
| 5911 | const invokeWith = ( |
| 5912 | resolved: Record<string, string | null>, |
| 5913 | ): Effect.Effect<unknown, ToolInvocationError> => { |
| 5914 | const credential: ToolInvocationCredential = { |
| 5915 | owner: parsed.owner, |
| 5916 | integration: parsed.integration, |
| 5917 | connection: parsed.connection, |
| 5918 | template: AuthTemplateSlug.make(connectionRow.template), |
| 5919 | value: resolved[PRIMARY_INPUT_VARIABLE] ?? null, |
| 5920 | values: resolved, |
| 5921 | config: integrationRow ? decodeJsonColumn(integrationRow.config) : undefined, |
| 5922 | ...(grantedScopes ? { grantedScopes } : {}), |
| 5923 | }; |
| 5924 | return wrapInvocationError( |
| 5925 | invokeTool({ |
| 5926 | ctx: runtime.ctx, |
| 5927 | toolRow: row, |
| 5928 | credential, |
| 5929 | args, |
| 5930 | elicit: buildElicit(address, args, handler), |
| 5931 | invokeOptions: options, |
| 5932 | }), |
| 5933 | ); |
| 5934 | }; |
| 5935 | |
| 5936 | const first = yield* invokeWith(values); |
| 5937 | // Reactive refresh. `expires_at` is only ever the AS's ADVERTISED |
no test coverage detected