(
resolved: Record<string, string | null>,
)
| 5986 | const grantedScopes = grantedScopesFromRow(connectionRow); |
| 5987 | const invokeTool = runtime.plugin.invokeTool; |
| 5988 | const invokeWith = ( |
| 5989 | resolved: Record<string, string | null>, |
| 5990 | ): Effect.Effect<unknown, ToolInvocationError> => { |
| 5991 | const credential: ToolInvocationCredential = { |
| 5992 | owner: parsed.owner, |
| 5993 | integration: parsed.integration, |
| 5994 | connection: parsed.connection, |
| 5995 | template: AuthTemplateSlug.make(connectionRow.template), |
| 5996 | value: resolved[PRIMARY_INPUT_VARIABLE] ?? null, |
| 5997 | values: resolved, |
| 5998 | config: integrationRow ? decodeJsonColumn(integrationRow.config) : undefined, |
| 5999 | ...(grantedScopes ? { grantedScopes } : {}), |
| 6000 | }; |
| 6001 | return wrapInvocationError( |
| 6002 | invokeTool({ |
| 6003 | ctx: runtime.ctx, |
| 6004 | toolRow: row, |
| 6005 | credential, |
| 6006 | args, |
| 6007 | elicit: buildElicit(address, args, handler), |
| 6008 | invokeOptions: options, |
| 6009 | }), |
| 6010 | ); |
| 6011 | }; |
| 6012 | |
| 6013 | const first = yield* invokeWith(values); |
| 6014 | // Reactive refresh. `expires_at` is only ever the AS's ADVERTISED |
no test coverage detected