diff --git a/.changeset/add-agent-action-approval.md b/.changeset/add-agent-action-approval.md new file mode 100644 index 00000000000..e3a5c1c6789 --- /dev/null +++ b/.changeset/add-agent-action-approval.md @@ -0,0 +1,12 @@ +--- +'@clerk/shared': minor +'@clerk/clerk-js': minor +'@clerk/ui': minor +'@clerk/react': minor +'@clerk/react-router': minor +'@clerk/nextjs': minor +'@clerk/tanstack-react-start': minor +'@clerk/localizations': patch +--- + +Add an experimental `AgentActionApproval` component with an interactive mock approval flow, account and workspace switching, and an unavailable-request state. diff --git a/packages/clerk-js/sandbox/app.ts b/packages/clerk-js/sandbox/app.ts index bf9d3c8b9bf..520933db41b 100644 --- a/packages/clerk-js/sandbox/app.ts +++ b/packages/clerk-js/sandbox/app.ts @@ -36,6 +36,7 @@ const AVAILABLE_COMPONENTS = [ 'configureSSO', 'configureDirectorySync', 'oauthConsent', + 'agentActionApproval', 'oauthDeviceVerification', 'taskChooseOrganization', 'taskResetPassword', @@ -157,6 +158,7 @@ const componentControls: Record = { configureSSO: buildComponentControls('configureSSO'), configureDirectorySync: buildComponentControls('configureDirectorySync'), oauthConsent: buildComponentControls('oauthConsent'), + agentActionApproval: buildComponentControls('agentActionApproval'), oauthDeviceVerification: buildComponentControls('oauthDeviceVerification'), taskChooseOrganization: buildComponentControls('taskChooseOrganization'), taskResetPassword: buildComponentControls('taskResetPassword'), @@ -429,6 +431,10 @@ void (async () => { '/pricing-table': { mount: 'mountPricingTable', component: 'pricingTable' }, '/api-keys': { mount: 'mountAPIKeys', component: 'apiKeys' }, '/configure-sso': { mount: '__internal_mountConfigureSSO', component: 'configureSSO' }, + '/agent-action-approval': { + mount: '__experimental_mountAgentActionApproval', + component: 'agentActionApproval', + }, '/oauth-device-verification': { mount: '__internal_mountOAuthDeviceVerification', component: 'oauthDeviceVerification', diff --git a/packages/clerk-js/sandbox/scenarios/agent-action-approval.ts b/packages/clerk-js/sandbox/scenarios/agent-action-approval.ts new file mode 100644 index 00000000000..cfe7b2b9079 --- /dev/null +++ b/packages/clerk-js/sandbox/scenarios/agent-action-approval.ts @@ -0,0 +1,26 @@ +import { + clerkHandlers, + EnvironmentService, + type MockScenario, + SessionService, + setClerkState, + UserService, +} from '@clerk/msw'; + +export function AgentActionApproval(): MockScenario { + const user = UserService.create(); + const session = SessionService.create(user); + + setClerkState({ + environment: EnvironmentService.MULTI_SESSION, + session, + user, + }); + + return { + description: 'Interactive agent-action approval prototype', + handlers: clerkHandlers, + initialState: { session, user }, + name: 'agent-action-approval', + }; +} diff --git a/packages/clerk-js/sandbox/scenarios/index.ts b/packages/clerk-js/sandbox/scenarios/index.ts index d06dcc56b80..4acb9497f0b 100644 --- a/packages/clerk-js/sandbox/scenarios/index.ts +++ b/packages/clerk-js/sandbox/scenarios/index.ts @@ -5,3 +5,4 @@ export { OrgProfileSeatLimit } from './org-profile-seat-limit'; export { PricingTableSBB } from './pricing-table-sbb'; export { AnnualOnlyPlans } from './annual-only-plans'; export { XProviderEnabled } from './x-provider-enabled'; +export { AgentActionApproval } from './agent-action-approval'; diff --git a/packages/clerk-js/sandbox/template.html b/packages/clerk-js/sandbox/template.html index 4725d21ea3a..500449ea8a3 100644 --- a/packages/clerk-js/sandbox/template.html +++ b/packages/clerk-js/sandbox/template.html @@ -259,6 +259,11 @@ label="OAuth Consent" component="" > + ui.ensureMounted()).then(controls => controls.unmountComponent({ node })); }; + public __experimental_mountAgentActionApproval = (node: HTMLDivElement, props?: AgentActionApprovalProps) => { + this.assertComponentsReady(this.#clerkUI); + const component = 'AgentActionApproval'; + void this.#clerkUI + .then(ui => ui.ensureMounted({ preloadHint: component })) + .then(controls => + controls.mountComponent({ + name: component, + appearanceKey: '__experimental_agentActionApproval', + node, + props, + }), + ); + }; + + public __experimental_unmountAgentActionApproval = (node: HTMLDivElement) => { + void this.#clerkUI?.then(ui => ui.ensureMounted()).then(controls => controls.unmountComponent({ node })); + }; + /** * @deprecated Use mountOAuthConsent instead. */ diff --git a/packages/localizations/src/ar-SA.ts b/packages/localizations/src/ar-SA.ts index 51eb8049416..256a713ad43 100644 --- a/packages/localizations/src/ar-SA.ts +++ b/packages/localizations/src/ar-SA.ts @@ -19,6 +19,32 @@ export const arSA: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/be-BY.ts b/packages/localizations/src/be-BY.ts index 2d3047732f7..1f626f687a4 100644 --- a/packages/localizations/src/be-BY.ts +++ b/packages/localizations/src/be-BY.ts @@ -19,6 +19,32 @@ export const beBY: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/bg-BG.ts b/packages/localizations/src/bg-BG.ts index 97e0dea7866..e394c65c5d1 100644 --- a/packages/localizations/src/bg-BG.ts +++ b/packages/localizations/src/bg-BG.ts @@ -19,6 +19,32 @@ export const bgBG: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/bn-IN.ts b/packages/localizations/src/bn-IN.ts index e4903dd4680..304636ef252 100644 --- a/packages/localizations/src/bn-IN.ts +++ b/packages/localizations/src/bn-IN.ts @@ -19,6 +19,32 @@ export const bnIN: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'নতুন কী যোগ করুন', action__search: 'কী অনুসন্ধান করুন', diff --git a/packages/localizations/src/ca-ES.ts b/packages/localizations/src/ca-ES.ts index 415dfb5651c..2513ccaed08 100644 --- a/packages/localizations/src/ca-ES.ts +++ b/packages/localizations/src/ca-ES.ts @@ -19,6 +19,32 @@ export const caES: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/cs-CZ.ts b/packages/localizations/src/cs-CZ.ts index be7ddf037c6..87876a8f1b5 100644 --- a/packages/localizations/src/cs-CZ.ts +++ b/packages/localizations/src/cs-CZ.ts @@ -19,6 +19,32 @@ export const csCZ: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'Přidat nový klíč', action__search: 'Vyhledat klíče', diff --git a/packages/localizations/src/da-DK.ts b/packages/localizations/src/da-DK.ts index e9b3b4facda..ee0d95f59fb 100644 --- a/packages/localizations/src/da-DK.ts +++ b/packages/localizations/src/da-DK.ts @@ -19,6 +19,32 @@ export const daDK: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/de-DE.ts b/packages/localizations/src/de-DE.ts index 85211a28986..809a84dc182 100644 --- a/packages/localizations/src/de-DE.ts +++ b/packages/localizations/src/de-DE.ts @@ -19,6 +19,32 @@ export const deDE: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'Neuen API-Key hinzufügen', action__search: 'Suche', diff --git a/packages/localizations/src/el-GR.ts b/packages/localizations/src/el-GR.ts index 0467f20fb50..eb006ed368b 100644 --- a/packages/localizations/src/el-GR.ts +++ b/packages/localizations/src/el-GR.ts @@ -19,6 +19,32 @@ export const elGR: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'Προσθήκη', action__search: 'Αναζήτηση', diff --git a/packages/localizations/src/en-GB.ts b/packages/localizations/src/en-GB.ts index e028cff9e6f..1ca5785f58d 100644 --- a/packages/localizations/src/en-GB.ts +++ b/packages/localizations/src/en-GB.ts @@ -19,6 +19,32 @@ export const enGB: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/en-US.ts b/packages/localizations/src/en-US.ts index abbcb744c3f..e0f14cb5716 100644 --- a/packages/localizations/src/en-US.ts +++ b/packages/localizations/src/en-US.ts @@ -7,6 +7,33 @@ export const enUS: LocalizationResource = { title: "We couldn't complete this request", traceIdLabel: 'Reference', }, + agentActionApproval: { + action__approve: 'Approve', + action__deny: 'Deny', + action__switchAccount: 'Switch account', + commentLabel: 'Comment', + commentOptional: 'Optional', + commentPlaceholder: 'Add any additional context for your response', + copyParameter: 'Copy {{parameter}}', + detailsLabel: 'Action details', + expiresIn: 'Approval window closes in {{remaining}}', + parameterCopied: '{{parameter}} copied', + requestedAt: 'Requested {{relativeTime}}', + signedInAs: 'Signed in as {{identifier}}', + terminal: { + approvedSubtitle: 'You can close this window, return to your agent, and continue with your request.', + approvedTitle: 'Action approved', + deniedSubtitle: 'No action was taken. You can close this window and return to your agent.', + deniedTitle: 'Action denied', + expiredSubtitle: + 'The approval window closed. No action was taken. You can close this window and return to your agent.', + expiredTitle: 'Approval window closed', + }, + title: 'Approve agent action', + unavailableSubtitle: 'You can try another account or close this window.', + unavailableTitle: 'This request is unavailable', + workspace: 'Workspace', + }, apiKeys: { action__add: 'Add new key', action__search: 'Search keys', diff --git a/packages/localizations/src/es-CR.ts b/packages/localizations/src/es-CR.ts index f13e61b1055..61cfbf9f708 100644 --- a/packages/localizations/src/es-CR.ts +++ b/packages/localizations/src/es-CR.ts @@ -19,6 +19,32 @@ export const esCR: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/es-ES.ts b/packages/localizations/src/es-ES.ts index 175e88c7ef6..51f9ed01463 100644 --- a/packages/localizations/src/es-ES.ts +++ b/packages/localizations/src/es-ES.ts @@ -19,6 +19,32 @@ export const esES: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/es-MX.ts b/packages/localizations/src/es-MX.ts index 35a9eab3747..f82e47dd7c0 100644 --- a/packages/localizations/src/es-MX.ts +++ b/packages/localizations/src/es-MX.ts @@ -19,6 +19,32 @@ export const esMX: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/es-UY.ts b/packages/localizations/src/es-UY.ts index 5f03cd55126..9f7b480e61e 100644 --- a/packages/localizations/src/es-UY.ts +++ b/packages/localizations/src/es-UY.ts @@ -19,6 +19,32 @@ export const esUY: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/fa-IR.ts b/packages/localizations/src/fa-IR.ts index 72e0ee3f716..2910b1704b1 100644 --- a/packages/localizations/src/fa-IR.ts +++ b/packages/localizations/src/fa-IR.ts @@ -19,6 +19,32 @@ export const faIR: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'افزودن کلید جدید', action__search: 'جستجوی کلیدها', diff --git a/packages/localizations/src/fi-FI.ts b/packages/localizations/src/fi-FI.ts index c3b07cb926e..4a979f30ce6 100644 --- a/packages/localizations/src/fi-FI.ts +++ b/packages/localizations/src/fi-FI.ts @@ -19,6 +19,32 @@ export const fiFI: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'Lisää uusi avain', action__search: 'Etsi avaimia', diff --git a/packages/localizations/src/fr-FR.ts b/packages/localizations/src/fr-FR.ts index 31685940074..a5cc13c2a4c 100644 --- a/packages/localizations/src/fr-FR.ts +++ b/packages/localizations/src/fr-FR.ts @@ -19,6 +19,32 @@ export const frFR: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'Ajouter une nouvelle clé', action__search: 'Rechercher des clés', diff --git a/packages/localizations/src/he-IL.ts b/packages/localizations/src/he-IL.ts index 0c49ef326f3..4cd3ffd7f19 100644 --- a/packages/localizations/src/he-IL.ts +++ b/packages/localizations/src/he-IL.ts @@ -19,6 +19,32 @@ export const heIL: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/hi-IN.ts b/packages/localizations/src/hi-IN.ts index 3b2df157c4a..4f23c50de60 100644 --- a/packages/localizations/src/hi-IN.ts +++ b/packages/localizations/src/hi-IN.ts @@ -19,6 +19,32 @@ export const hiIN: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'नई कुंजी जोड़ें', action__search: 'कुंजियाँ खोजें', diff --git a/packages/localizations/src/hr-HR.ts b/packages/localizations/src/hr-HR.ts index 40c4423cc1c..3e4beb6bada 100644 --- a/packages/localizations/src/hr-HR.ts +++ b/packages/localizations/src/hr-HR.ts @@ -19,6 +19,32 @@ export const hrHR: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'Dodaj novi ključ', action__search: 'Pretraži ključeve', diff --git a/packages/localizations/src/hu-HU.ts b/packages/localizations/src/hu-HU.ts index bd0aeb00fc0..c94b762996c 100644 --- a/packages/localizations/src/hu-HU.ts +++ b/packages/localizations/src/hu-HU.ts @@ -19,6 +19,32 @@ export const huHU: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'Új kulcs hozzáadása', action__search: 'Kulcsok keresése', diff --git a/packages/localizations/src/id-ID.ts b/packages/localizations/src/id-ID.ts index bb8f7a58b70..35cf096226f 100644 --- a/packages/localizations/src/id-ID.ts +++ b/packages/localizations/src/id-ID.ts @@ -19,6 +19,32 @@ export const idID: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/is-IS.ts b/packages/localizations/src/is-IS.ts index f53f4d6cff5..63857367bd7 100644 --- a/packages/localizations/src/is-IS.ts +++ b/packages/localizations/src/is-IS.ts @@ -19,6 +19,32 @@ export const isIS: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'Bæta við lykli', action__search: 'Leita að lyklum', diff --git a/packages/localizations/src/it-IT.ts b/packages/localizations/src/it-IT.ts index 826889a94b4..68803d56be7 100644 --- a/packages/localizations/src/it-IT.ts +++ b/packages/localizations/src/it-IT.ts @@ -19,6 +19,32 @@ export const itIT: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'Aggiungi nuova chiave', action__search: 'Cerca chiavi', diff --git a/packages/localizations/src/ja-JP.ts b/packages/localizations/src/ja-JP.ts index c2cdb2926ad..2a9bc1f1a29 100644 --- a/packages/localizations/src/ja-JP.ts +++ b/packages/localizations/src/ja-JP.ts @@ -19,6 +19,32 @@ export const jaJP: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: '新しいキーを追加', action__search: 'キーを検索', diff --git a/packages/localizations/src/kk-KZ.ts b/packages/localizations/src/kk-KZ.ts index 306bd58ce3c..3ed74a0fad2 100644 --- a/packages/localizations/src/kk-KZ.ts +++ b/packages/localizations/src/kk-KZ.ts @@ -19,6 +19,32 @@ export const kkKZ: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/ko-KR.ts b/packages/localizations/src/ko-KR.ts index 8b76029443a..88e03f84ddb 100644 --- a/packages/localizations/src/ko-KR.ts +++ b/packages/localizations/src/ko-KR.ts @@ -19,6 +19,32 @@ export const koKR: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: '새 키 만들기', action__search: '키 검색', diff --git a/packages/localizations/src/mn-MN.ts b/packages/localizations/src/mn-MN.ts index 375c45efd4a..4e12a154a2e 100644 --- a/packages/localizations/src/mn-MN.ts +++ b/packages/localizations/src/mn-MN.ts @@ -19,6 +19,32 @@ export const mnMN: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/ms-MY.ts b/packages/localizations/src/ms-MY.ts index ed21fbaef48..15124409bfd 100644 --- a/packages/localizations/src/ms-MY.ts +++ b/packages/localizations/src/ms-MY.ts @@ -19,6 +19,32 @@ export const msMY: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'Tambah kunci baharu', action__search: 'Cari kunci', diff --git a/packages/localizations/src/nb-NO.ts b/packages/localizations/src/nb-NO.ts index 9e42aac4b76..c69a3cdc730 100644 --- a/packages/localizations/src/nb-NO.ts +++ b/packages/localizations/src/nb-NO.ts @@ -19,6 +19,32 @@ export const nbNO: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'Legg til ny nøkkel', action__search: 'Søk i nøkler', diff --git a/packages/localizations/src/nl-BE.ts b/packages/localizations/src/nl-BE.ts index ddd60976415..2d986cb7a06 100644 --- a/packages/localizations/src/nl-BE.ts +++ b/packages/localizations/src/nl-BE.ts @@ -19,6 +19,32 @@ export const nlBE: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/nl-NL.ts b/packages/localizations/src/nl-NL.ts index e2a1969b441..5b18fccfb84 100644 --- a/packages/localizations/src/nl-NL.ts +++ b/packages/localizations/src/nl-NL.ts @@ -19,6 +19,32 @@ export const nlNL: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/pl-PL.ts b/packages/localizations/src/pl-PL.ts index 76d3adc7ea9..ddd1f7ab6f0 100644 --- a/packages/localizations/src/pl-PL.ts +++ b/packages/localizations/src/pl-PL.ts @@ -19,6 +19,32 @@ export const plPL: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/pt-BR.ts b/packages/localizations/src/pt-BR.ts index 0d9ac6023a7..018068e6acc 100644 --- a/packages/localizations/src/pt-BR.ts +++ b/packages/localizations/src/pt-BR.ts @@ -19,6 +19,32 @@ export const ptBR: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'Adicionar nova chave', action__search: 'Pesquisar chaves', diff --git a/packages/localizations/src/pt-PT.ts b/packages/localizations/src/pt-PT.ts index 4440c052473..bf657e02d6a 100644 --- a/packages/localizations/src/pt-PT.ts +++ b/packages/localizations/src/pt-PT.ts @@ -19,6 +19,32 @@ export const ptPT: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'Adicionar nova chave', action__search: 'Pesquisar chaves', diff --git a/packages/localizations/src/ro-RO.ts b/packages/localizations/src/ro-RO.ts index b372cf79c68..025c8833d4c 100644 --- a/packages/localizations/src/ro-RO.ts +++ b/packages/localizations/src/ro-RO.ts @@ -19,6 +19,32 @@ export const roRO: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'Adaugă cheie nouă', action__search: 'Caută chei', diff --git a/packages/localizations/src/ru-RU.ts b/packages/localizations/src/ru-RU.ts index 07d081dd992..b0690e50287 100644 --- a/packages/localizations/src/ru-RU.ts +++ b/packages/localizations/src/ru-RU.ts @@ -19,6 +19,32 @@ export const ruRU: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/sk-SK.ts b/packages/localizations/src/sk-SK.ts index fc9169d88d2..39012a2279d 100644 --- a/packages/localizations/src/sk-SK.ts +++ b/packages/localizations/src/sk-SK.ts @@ -19,6 +19,32 @@ export const skSK: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/sr-RS.ts b/packages/localizations/src/sr-RS.ts index cc7fbb83dfb..d00934d0e59 100644 --- a/packages/localizations/src/sr-RS.ts +++ b/packages/localizations/src/sr-RS.ts @@ -19,6 +19,32 @@ export const srRS: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/sv-SE.ts b/packages/localizations/src/sv-SE.ts index 4277bb57a62..82946240b9a 100644 --- a/packages/localizations/src/sv-SE.ts +++ b/packages/localizations/src/sv-SE.ts @@ -19,6 +19,32 @@ export const svSE: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/ta-IN.ts b/packages/localizations/src/ta-IN.ts index 8f8ee372d62..6546f7dcff9 100644 --- a/packages/localizations/src/ta-IN.ts +++ b/packages/localizations/src/ta-IN.ts @@ -19,6 +19,32 @@ export const taIN: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'புதிய விசையைச் சேர்', action__search: 'விசைகளைத் தேடு', diff --git a/packages/localizations/src/te-IN.ts b/packages/localizations/src/te-IN.ts index 957f053751c..33eb26f29c0 100644 --- a/packages/localizations/src/te-IN.ts +++ b/packages/localizations/src/te-IN.ts @@ -19,6 +19,32 @@ export const teIN: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'కొత్త కీని జోడించు', action__search: 'కీలను శోధించు', diff --git a/packages/localizations/src/th-TH.ts b/packages/localizations/src/th-TH.ts index c98233dba9f..14234586151 100644 --- a/packages/localizations/src/th-TH.ts +++ b/packages/localizations/src/th-TH.ts @@ -19,6 +19,32 @@ export const thTH: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'เพิ่มคีย์ใหม่', action__search: 'ค้นหาคีย์', diff --git a/packages/localizations/src/tr-TR.ts b/packages/localizations/src/tr-TR.ts index fe69dcdc525..992ca5305be 100644 --- a/packages/localizations/src/tr-TR.ts +++ b/packages/localizations/src/tr-TR.ts @@ -19,6 +19,32 @@ export const trTR: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/uk-UA.ts b/packages/localizations/src/uk-UA.ts index e3a16b8ea27..5b85d5a84b5 100644 --- a/packages/localizations/src/uk-UA.ts +++ b/packages/localizations/src/uk-UA.ts @@ -19,6 +19,32 @@ export const ukUA: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/vi-VN.ts b/packages/localizations/src/vi-VN.ts index 8c543c1e108..d9cb32ca559 100644 --- a/packages/localizations/src/vi-VN.ts +++ b/packages/localizations/src/vi-VN.ts @@ -19,6 +19,32 @@ export const viVN: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: 'Thêm khoá mới', action__search: 'Tìm kiếm khoá', diff --git a/packages/localizations/src/zh-CN.ts b/packages/localizations/src/zh-CN.ts index 2537e98bae0..2f9fe8b1be5 100644 --- a/packages/localizations/src/zh-CN.ts +++ b/packages/localizations/src/zh-CN.ts @@ -19,6 +19,32 @@ export const zhCN: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: undefined, action__search: undefined, diff --git a/packages/localizations/src/zh-TW.ts b/packages/localizations/src/zh-TW.ts index a8db934fa49..72df48f5cef 100644 --- a/packages/localizations/src/zh-TW.ts +++ b/packages/localizations/src/zh-TW.ts @@ -19,6 +19,32 @@ export const zhTW: LocalizationResource = { title: undefined, traceIdLabel: undefined, }, + agentActionApproval: { + action__approve: undefined, + action__deny: undefined, + action__switchAccount: undefined, + commentLabel: undefined, + commentOptional: undefined, + commentPlaceholder: undefined, + copyParameter: undefined, + detailsLabel: undefined, + expiresIn: undefined, + parameterCopied: undefined, + requestedAt: undefined, + signedInAs: undefined, + terminal: { + approvedSubtitle: undefined, + approvedTitle: undefined, + deniedSubtitle: undefined, + deniedTitle: undefined, + expiredSubtitle: undefined, + expiredTitle: undefined, + }, + title: undefined, + unavailableSubtitle: undefined, + unavailableTitle: undefined, + workspace: undefined, + }, apiKeys: { action__add: '新增金鑰', action__search: '搜尋金鑰', diff --git a/packages/nextjs/src/client-boundary/uiComponents.tsx b/packages/nextjs/src/client-boundary/uiComponents.tsx index 82e719046d6..7daf47fa3bb 100644 --- a/packages/nextjs/src/client-boundary/uiComponents.tsx +++ b/packages/nextjs/src/client-boundary/uiComponents.tsx @@ -12,6 +12,7 @@ import React from 'react'; import { useEnforceCorrectRoutingProps } from './hooks/useEnforceRoutingProps'; export { + AgentActionApproval, APIKeys, CreateOrganization, GoogleOneTap, diff --git a/packages/nextjs/src/index.ts b/packages/nextjs/src/index.ts index 585129c82d7..fc97ccae2b0 100644 --- a/packages/nextjs/src/index.ts +++ b/packages/nextjs/src/index.ts @@ -22,6 +22,7 @@ export { * If you do, app router will break. */ export { + AgentActionApproval, APIKeys, CreateOrganization, GoogleOneTap, diff --git a/packages/react-router/src/__tests__/__snapshots__/exports.test.ts.snap b/packages/react-router/src/__tests__/__snapshots__/exports.test.ts.snap index b186435cbc7..7238c382c8c 100644 --- a/packages/react-router/src/__tests__/__snapshots__/exports.test.ts.snap +++ b/packages/react-router/src/__tests__/__snapshots__/exports.test.ts.snap @@ -17,6 +17,7 @@ exports[`legacy public exports > should not change unexpectedly 1`] = ` exports[`root public exports > should not change unexpectedly 1`] = ` [ "APIKeys", + "AgentActionApproval", "AuthenticateWithRedirectCallback", "ClerkDegraded", "ClerkFailed", diff --git a/packages/react/src/components/index.ts b/packages/react/src/components/index.ts index c241edfb954..75524ce2290 100644 --- a/packages/react/src/components/index.ts +++ b/packages/react/src/components/index.ts @@ -1,4 +1,5 @@ export { + AgentActionApproval, APIKeys, CreateOrganization, GoogleOneTap, diff --git a/packages/react/src/components/uiComponents.tsx b/packages/react/src/components/uiComponents.tsx index 0a101c93f6b..1a43ea9fc33 100644 --- a/packages/react/src/components/uiComponents.tsx +++ b/packages/react/src/components/uiComponents.tsx @@ -1,5 +1,6 @@ import type { __internal_OAuthConsentProps, + AgentActionApprovalProps, APIKeysProps, CreateOrganizationProps, GoogleOneTapProps, @@ -676,6 +677,39 @@ export const OAuthConsent = withClerk( { component: 'OAuthConsent', renderWhileLoading: true }, ); +/** + * Renders an approval flow for an action requested by an agent. + * + * @experimental This component is experimental and may change in future releases. + */ +export const AgentActionApproval = withClerk( + ({ clerk, component, fallback, ...props }: WithClerkProp) => { + const mountingStatus = useWaitForComponentMount(component); + const shouldShowFallback = mountingStatus === 'rendering' || !clerk.loaded; + + const rendererRootProps = { + ...(shouldShowFallback && fallback && { style: { display: 'none' } }), + }; + + return ( + <> + {shouldShowFallback && fallback} + {clerk.loaded && ( + + )} + + ); + }, + { component: 'AgentActionApproval', renderWhileLoading: true }, +); + /** * Renders the OAuth device verification flow for a signed-in user to authorize a device or app. * diff --git a/packages/react/src/isomorphicClerk.ts b/packages/react/src/isomorphicClerk.ts index 1bceeeacdb3..c847b102bbf 100644 --- a/packages/react/src/isomorphicClerk.ts +++ b/packages/react/src/isomorphicClerk.ts @@ -13,6 +13,7 @@ import type { __internal_SubscriptionDetailsProps, __internal_UserVerificationModalProps, __internal_UserVerificationProps, + AgentActionApprovalProps, APIKeysNamespace, APIKeysProps, AuthenticateWithBaseParams, @@ -168,6 +169,7 @@ export class IsomorphicClerk implements IsomorphicLoadedClerk { private premountConfigureSSONodes = new Map(); private premountConfigureDirectorySyncNodes = new Map(); private premountOAuthConsentNodes = new Map(); + private premountAgentActionApprovalNodes = new Map(); private premountOAuthDeviceVerificationNodes = new Map(); private premountTaskChooseOrganizationNodes = new Map(); private premountTaskResetPasswordNodes = new Map(); @@ -812,6 +814,10 @@ export class IsomorphicClerk implements IsomorphicLoadedClerk { clerkjs.__internal_mountOAuthConsent(node, props); }); + this.premountAgentActionApprovalNodes.forEach((props, node) => { + clerkjs.__experimental_mountAgentActionApproval(node, props); + }); + if (typeof clerkjs.__internal_mountOAuthDeviceVerification === 'function') { this.premountOAuthDeviceVerificationNodes.forEach((props, node) => { clerkjs.__internal_mountOAuthDeviceVerification(node, props); @@ -1435,6 +1441,22 @@ export class IsomorphicClerk implements IsomorphicLoadedClerk { this.__internal_unmountOAuthConsent(node); }; + __experimental_mountAgentActionApproval = (node: HTMLDivElement, props?: AgentActionApprovalProps) => { + if (this.clerkjs && this.loaded) { + this.clerkjs.__experimental_mountAgentActionApproval(node, props); + } else { + this.premountAgentActionApprovalNodes.set(node, props); + } + }; + + __experimental_unmountAgentActionApproval = (node: HTMLDivElement) => { + if (this.clerkjs && this.loaded) { + this.clerkjs.__experimental_unmountAgentActionApproval(node); + } else { + this.premountAgentActionApprovalNodes.delete(node); + } + }; + __internal_mountOAuthDeviceVerification = (node: HTMLDivElement, props?: OAuthDeviceVerificationProps) => { if (this.clerkjs && this.loaded) { if (typeof this.clerkjs.__internal_mountOAuthDeviceVerification === 'function') { diff --git a/packages/shared/src/types/clerk.ts b/packages/shared/src/types/clerk.ts index 5c09303315b..347e7c3d43a 100644 --- a/packages/shared/src/types/clerk.ts +++ b/packages/shared/src/types/clerk.ts @@ -851,6 +851,23 @@ export interface Clerk { */ __internal_unmountOAuthConsent: (targetNode: HTMLDivElement) => void; + /** + * Mounts the experimental agent action approval component. + * + * @param targetNode - Target node to mount the component into. + * @param props - Agent action approval configuration. + * @experimental + */ + __experimental_mountAgentActionApproval: (targetNode: HTMLDivElement, props?: AgentActionApprovalProps) => void; + + /** + * Unmounts the experimental agent action approval component. + * + * @param targetNode - Target node to unmount the component from. + * @experimental + */ + __experimental_unmountAgentActionApproval: (targetNode: HTMLDivElement) => void; + /** * Mounts a OAuth consent component at the target element. * @@ -2806,6 +2823,20 @@ export type OAuthConsentProps = { onDeny?: () => void; }; +/** + * Properties for the experimental agent action approval component. + * + * @interface + * + * @experimental + */ +export type AgentActionApprovalProps = { + /** + * Customization options to fully match the Clerk components to your own brand. These options serve as overrides and will be merged with the global `appearance` configuration (if one is provided). + */ + appearance?: ClerkAppearanceTheme; +}; + export type OAuthDeviceVerificationProps = { /** * Customization options to fully match the Clerk component to your own brand. diff --git a/packages/shared/src/types/localization.ts b/packages/shared/src/types/localization.ts index 588bd91a29f..cd9e05bdc19 100644 --- a/packages/shared/src/types/localization.ts +++ b/packages/shared/src/types/localization.ts @@ -1520,6 +1520,32 @@ export type __internal_LocalizationResource = { subtitle: LocalizationValue<'applicationName'>; }; }; + agentActionApproval: { + title: LocalizationValue; + unavailableTitle: LocalizationValue; + unavailableSubtitle: LocalizationValue; + workspace: LocalizationValue; + signedInAs: LocalizationValue<'identifier'>; + requestedAt: LocalizationValue<'relativeTime'>; + commentLabel: LocalizationValue; + commentOptional: LocalizationValue; + commentPlaceholder: LocalizationValue; + detailsLabel: LocalizationValue; + copyParameter: LocalizationValue<'parameter'>; + parameterCopied: LocalizationValue<'parameter'>; + expiresIn: LocalizationValue<'remaining'>; + action__approve: LocalizationValue; + action__deny: LocalizationValue; + action__switchAccount: LocalizationValue; + terminal: { + approvedTitle: LocalizationValue; + approvedSubtitle: LocalizationValue; + deniedTitle: LocalizationValue; + deniedSubtitle: LocalizationValue; + expiredTitle: LocalizationValue; + expiredSubtitle: LocalizationValue; + }; + }; oauthDeviceVerification: { start: { title: LocalizationValue; diff --git a/packages/tanstack-react-start/src/__tests__/__snapshots__/exports.test.ts.snap b/packages/tanstack-react-start/src/__tests__/__snapshots__/exports.test.ts.snap index bc8dc12e555..6ad5fdef6c4 100644 --- a/packages/tanstack-react-start/src/__tests__/__snapshots__/exports.test.ts.snap +++ b/packages/tanstack-react-start/src/__tests__/__snapshots__/exports.test.ts.snap @@ -23,6 +23,7 @@ exports[`legacy public exports > should not change unexpectedly 1`] = ` exports[`root public exports > should not change unexpectedly 1`] = ` [ "APIKeys", + "AgentActionApproval", "AuthenticateWithRedirectCallback", "ClerkDegraded", "ClerkFailed", diff --git a/packages/ui/src/components/AgentActionApproval/ActionDetails.tsx b/packages/ui/src/components/AgentActionApproval/ActionDetails.tsx new file mode 100644 index 00000000000..b65b2deadec --- /dev/null +++ b/packages/ui/src/components/AgentActionApproval/ActionDetails.tsx @@ -0,0 +1,139 @@ +import type { ComponentType } from 'react'; + +import { Box, Dd, Dl, Dt, Flex, Icon, localizationKeys, Text, useLocalizations } from '@/ui/customizables'; +import { IconButton } from '@/ui/elements/IconButton'; +import { useClipboard } from '@/ui/hooks'; +import { Checkmark, Copy } from '@/ui/icons'; +import { animations } from '@/ui/styledSystem'; + +export type ActionDetail = { + key: string; + label: string; + value: string; + secondaryValue?: string; + icon?: ComponentType; + copyable?: boolean; +}; + +export function ActionDetails({ details }: { details: ActionDetail[] }) { + const { t } = useLocalizations(); + + if (details.length === 0) { + return null; + } + + return ( +
({ + borderWidth: theme.borderWidths.$normal, + borderStyle: theme.borderStyles.$solid, + borderColor: theme.colors.$borderAlpha150, + borderRadius: theme.radii.$md, + overflow: 'hidden', + })} + > + {details.map(detail => ( + + ))} +
+ ); +} + +function ActionDetailRow({ detail }: { detail: ActionDetail }) { + const { t } = useLocalizations(); + const { onCopy, hasCopied } = useClipboard(detail.value); + + return ( + ({ + display: 'flex', + alignItems: 'center', + justifyContent: 'space-between', + gap: theme.space.$4, + paddingInline: theme.space.$3, + paddingBlock: theme.space.$3x5, + '&:not(:first-child)': { + borderBlockStartWidth: theme.borderWidths.$normal, + borderBlockStartStyle: theme.borderStyles.$solid, + borderBlockStartColor: theme.colors.$borderAlpha100, + }, + })} + > +
+ {detail.label} +
+
+ + {detail.icon ? ( + + ) : null} + + {detail.value} + + {detail.secondaryValue ? ( + + {detail.secondaryValue} + + ) : null} + {detail.copyable ? ( + ({ + color: hasCopied ? theme.colors.$success500 : 'inherit', + animation: hasCopied + ? `${animations.fadeIn} ${theme.transitionDuration.$fast} ${theme.transitionTiming.$common}` + : undefined, + '@media (prefers-reduced-motion: reduce)': { + animation: 'none', + }, + })} + /> + } + onClick={() => onCopy()} + sx={theme => ({ + width: theme.sizes.$6, + height: theme.sizes.$6, + padding: 0, + borderRadius: theme.radii.$sm, + flexShrink: 0, + })} + /> + ) : null} + +
+
+ ); +} diff --git a/packages/ui/src/components/AgentActionApproval/AgentActionApproval.tsx b/packages/ui/src/components/AgentActionApproval/AgentActionApproval.tsx new file mode 100644 index 00000000000..0e2da4a21f3 --- /dev/null +++ b/packages/ui/src/components/AgentActionApproval/AgentActionApproval.tsx @@ -0,0 +1,271 @@ +import { useId, useMemo, useState } from 'react'; + +import { Button, Col, Flex, Flow, FormLabel, Grid, localizationKeys, Text, useLocalizations } from '@/ui/customizables'; +import { Card } from '@/ui/elements/Card'; +import { withCardStateProvider } from '@/ui/elements/contexts'; +import { Header } from '@/ui/elements/Header'; +import { Menu, MenuItem, MenuList, MenuTrigger } from '@/ui/elements/Menu'; +import { OrgSelect } from '@/ui/elements/OrgSelect'; +import { UserPreview } from '@/ui/elements/UserPreview'; +import { CreditCard, ShieldCheck } from '@/ui/icons'; +import { Textarea } from '@/ui/primitives'; + +import { ActionDetails } from './ActionDetails'; +import { AgentActionIcon } from './AgentActionIcon'; +import { TerminalCard, type TerminalStatus } from './TerminalCard'; +import { formatRemainingTime, useCountdown } from './useCountdown'; + +const mockAction = { + description: 'Refund the most recent charge after the customer reported a duplicate payment.', + parameters: [ + { key: 'refund_amount', label: 'Refund amount', value: '$400.00' }, + { key: 'customer_id', label: 'Refund to', value: 'Cameron Walker' }, + { key: 'payment_method', label: 'Payment method', value: 'Visa', secondaryValue: '⋯ 4242', icon: CreditCard }, + { key: 'payment_intent_id', label: 'Payment intent', value: 'pi_3QkL8mF7bXn4p9V2c6a', copyable: true }, + ], +}; + +type MockWorkspace = { + value: string; + label: string; + response: { status: 200; data: typeof mockAction } | { status: 404 }; +}; + +type MockAccount = { + value: string; + label: string; + identifier: string; + workspaces: MockWorkspace[]; +}; + +const mockAccounts: MockAccount[] = [ + { + value: 'alex', + label: 'Alex Morgan', + identifier: 'alex@example.com', + workspaces: [ + { value: 'acme', label: 'Acme', response: { status: 200, data: mockAction } }, + { value: 'northstar', label: 'Northstar', response: { status: 404 } }, + ], + }, + { + value: 'jordan', + label: 'Jordan Lee', + identifier: 'jordan@example.com', + workspaces: [{ value: 'northstar', label: 'Northstar', response: { status: 404 } }], + }, +]; + +function ApprovalScreen() { + const { locale, t } = useLocalizations(); + const workspaceId = useId(); + const [context, setContext] = useState({ + account: mockAccounts[0], + workspace: mockAccounts[0].workspaces[0], + }); + const { account, workspace } = context; + const [comment, setComment] = useState(''); + const [decision, setDecision] = useState(null); + const timestamps = useMemo( + () => ({ + createdAt: Date.now() - 3 * 60 * 1_000, + expiresAt: Date.now() + 15 * 60 * 1_000, + }), + [], + ); + const { remaining, isExpired } = useCountdown(timestamps.expiresAt, decision !== null); + const action = workspace.response.status === 200 ? workspace.response.data : null; + + if (action && decision) { + return ; + } + + if (action && isExpired) { + return ; + } + + return ( + + + + + + + + + + + + { + const nextWorkspace = account.workspaces.find(option => option.value === value); + if (!nextWorkspace || nextWorkspace.value === workspace.value) { + return; + } + setContext({ account, workspace: nextWorkspace }); + setComment(''); + }} + /> + + {action && ( + <> + + {action.description} + + + + + + + +