@wildo-ai/saas-frontend-lib 1.1.12 → 1.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/dist/esm/components/data-display/DisplayValueDispatcher.d.ts.map +1 -1
  2. package/dist/esm/components/data-display/DisplayValueDispatcher.js +17 -1
  3. package/dist/esm/components/data-display/DisplayValueDispatcher.js.map +1 -1
  4. package/dist/esm/components/data-display/approval-seal.d.ts +97 -0
  5. package/dist/esm/components/data-display/approval-seal.d.ts.map +1 -0
  6. package/dist/esm/components/data-display/approval-seal.js +208 -0
  7. package/dist/esm/components/data-display/approval-seal.js.map +1 -0
  8. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.d.ts.map +1 -1
  9. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js +5 -2
  10. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js.map +1 -1
  11. package/dist/esm/components/data-display/formatters/display-field-file.d.ts.map +1 -1
  12. package/dist/esm/components/data-display/formatters/display-field-file.js +16 -2
  13. package/dist/esm/components/data-display/formatters/display-field-file.js.map +1 -1
  14. package/dist/esm/components/flows-actors/approval.d.ts.map +1 -1
  15. package/dist/esm/components/flows-actors/approval.js +48 -18
  16. package/dist/esm/components/flows-actors/approval.js.map +1 -1
  17. package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts.map +1 -1
  18. package/dist/esm/components/form/automated/ResourceAutomatedForm.js +20 -1
  19. package/dist/esm/components/form/automated/ResourceAutomatedForm.js.map +1 -1
  20. package/dist/esm/components/form/chromes/FormFieldChrome.js +1 -1
  21. package/dist/esm/components/form/chromes/FormFieldChrome.js.map +1 -1
  22. package/dist/esm/components/form/chromes/field-control-aria.d.ts +8 -1
  23. package/dist/esm/components/form/chromes/field-control-aria.d.ts.map +1 -1
  24. package/dist/esm/components/form/chromes/field-control-aria.js +19 -2
  25. package/dist/esm/components/form/chromes/field-control-aria.js.map +1 -1
  26. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.d.ts +5 -0
  27. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.d.ts.map +1 -1
  28. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.js +6 -2
  29. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.js.map +1 -1
  30. package/dist/esm/components/resources/ResourceCollectionBody_Table.d.ts.map +1 -1
  31. package/dist/esm/components/resources/ResourceCollectionBody_Table.js +8 -1
  32. package/dist/esm/components/resources/ResourceCollectionBody_Table.js.map +1 -1
  33. package/dist/esm/components/resources/ResourceLayout_DangerZone.d.ts.map +1 -1
  34. package/dist/esm/components/resources/ResourceLayout_DangerZone.js +2 -2
  35. package/dist/esm/components/resources/ResourceLayout_DangerZone.js.map +1 -1
  36. package/dist/esm/components/resources/ResourceLayout_RecordSharing.js +2 -2
  37. package/dist/esm/components/resources/ResourceLayout_RecordSharing.js.map +1 -1
  38. package/dist/esm/components/resources/ResourceListItemRenderer.d.ts.map +1 -1
  39. package/dist/esm/components/resources/ResourceListItemRenderer.js +6 -1
  40. package/dist/esm/components/resources/ResourceListItemRenderer.js.map +1 -1
  41. package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.d.ts.map +1 -1
  42. package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.js +5 -1
  43. package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.js.map +1 -1
  44. package/dist/esm/components/resources/skeleton/DisplayLayout.js +2 -2
  45. package/dist/esm/components/resources/skeleton/DisplayLayout.js.map +1 -1
  46. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.d.ts.map +1 -1
  47. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js +71 -16
  48. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js.map +1 -1
  49. package/dist/esm/components/sections/surface.d.ts +12 -0
  50. package/dist/esm/components/sections/surface.d.ts.map +1 -1
  51. package/dist/esm/components/sections/surface.js +14 -0
  52. package/dist/esm/components/sections/surface.js.map +1 -1
  53. package/dist/esm/components/views/chart-dashboard/ChartDashboard.d.ts +27 -24
  54. package/dist/esm/components/views/chart-dashboard/ChartDashboard.d.ts.map +1 -1
  55. package/dist/esm/components/views/chart-dashboard/ChartDashboard.js +27 -33
  56. package/dist/esm/components/views/chart-dashboard/ChartDashboard.js.map +1 -1
  57. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.d.ts +37 -0
  58. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.d.ts.map +1 -0
  59. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.js +100 -0
  60. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.js.map +1 -0
  61. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.labels.d.ts +3 -0
  62. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.labels.d.ts.map +1 -0
  63. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.labels.js +34 -0
  64. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.labels.js.map +1 -0
  65. package/dist/esm/components/views/chart-dashboard/chart-dashboard-layout.utils.d.ts +47 -0
  66. package/dist/esm/components/views/chart-dashboard/chart-dashboard-layout.utils.d.ts.map +1 -0
  67. package/dist/esm/components/views/chart-dashboard/chart-dashboard-layout.utils.js +94 -0
  68. package/dist/esm/components/views/chart-dashboard/chart-dashboard-layout.utils.js.map +1 -0
  69. package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.d.ts +39 -0
  70. package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.d.ts.map +1 -0
  71. package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.js +155 -0
  72. package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.js.map +1 -0
  73. package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.d.ts.map +1 -1
  74. package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.js +3 -2
  75. package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.js.map +1 -1
  76. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts +15 -0
  77. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts.map +1 -1
  78. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js +29 -0
  79. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js.map +1 -1
  80. package/dist/esm/core/app-shell/shell-motion/use-shell-motion.d.ts.map +1 -1
  81. package/dist/esm/core/app-shell/shell-motion/use-shell-motion.js +2 -2
  82. package/dist/esm/core/app-shell/shell-motion/use-shell-motion.js.map +1 -1
  83. package/dist/esm/core/branding/useBrandPresentation.d.ts.map +1 -1
  84. package/dist/esm/core/branding/useBrandPresentation.js +17 -6
  85. package/dist/esm/core/branding/useBrandPresentation.js.map +1 -1
  86. package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.d.ts.map +1 -1
  87. package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.js +2 -0
  88. package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.js.map +1 -1
  89. package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.d.ts.map +1 -1
  90. package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.js +11 -1
  91. package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.js.map +1 -1
  92. package/dist/esm/core/i18n/I18nContext.d.ts.map +1 -1
  93. package/dist/esm/core/i18n/I18nContext.js +8 -2
  94. package/dist/esm/core/i18n/I18nContext.js.map +1 -1
  95. package/dist/esm/core/i18n/component-label-resolution.utils.d.ts.map +1 -1
  96. package/dist/esm/core/i18n/component-label-resolution.utils.js +6 -1
  97. package/dist/esm/core/i18n/component-label-resolution.utils.js.map +1 -1
  98. package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts +0 -15
  99. package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts.map +1 -1
  100. package/dist/esm/core/monitoring/analytics/AnalyticsContext.js +71 -6
  101. package/dist/esm/core/monitoring/analytics/AnalyticsContext.js.map +1 -1
  102. package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.d.ts.map +1 -1
  103. package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js +12 -3
  104. package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js.map +1 -1
  105. package/dist/esm/core/navigation/NavigationContext.d.ts.map +1 -1
  106. package/dist/esm/core/navigation/NavigationContext.js +60 -17
  107. package/dist/esm/core/navigation/NavigationContext.js.map +1 -1
  108. package/dist/esm/core/navigation/launcher-resolution.d.ts +29 -0
  109. package/dist/esm/core/navigation/launcher-resolution.d.ts.map +1 -1
  110. package/dist/esm/core/navigation/launcher-resolution.js +31 -0
  111. package/dist/esm/core/navigation/launcher-resolution.js.map +1 -1
  112. package/dist/esm/core/navigation/navigation-controller-internals.d.ts +48 -0
  113. package/dist/esm/core/navigation/navigation-controller-internals.d.ts.map +1 -1
  114. package/dist/esm/core/navigation/navigation-controller-internals.js +56 -3
  115. package/dist/esm/core/navigation/navigation-controller-internals.js.map +1 -1
  116. package/dist/esm/core/navigation/useNavigationRouterSync.d.ts.map +1 -1
  117. package/dist/esm/core/navigation/useNavigationRouterSync.js +30 -2
  118. package/dist/esm/core/navigation/useNavigationRouterSync.js.map +1 -1
  119. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts +34 -1
  120. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts.map +1 -1
  121. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js +41 -0
  122. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js.map +1 -1
  123. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.d.ts +44 -0
  124. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.d.ts.map +1 -0
  125. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.js +63 -0
  126. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.js.map +1 -0
  127. package/dist/esm/core/resources/useOperationDirectExecution.d.ts.map +1 -1
  128. package/dist/esm/core/resources/useOperationDirectExecution.js +45 -6
  129. package/dist/esm/core/resources/useOperationDirectExecution.js.map +1 -1
  130. package/dist/esm/core/runtime/AppRouter.d.ts.map +1 -1
  131. package/dist/esm/core/runtime/AppRouter.js +18 -1
  132. package/dist/esm/core/runtime/AppRouter.js.map +1 -1
  133. package/dist/esm/core/security/UserOrgsContext.d.ts.map +1 -1
  134. package/dist/esm/core/security/UserOrgsContext.js +61 -8
  135. package/dist/esm/core/security/UserOrgsContext.js.map +1 -1
  136. package/dist/esm/core/ui/inner-control-activation.utils.d.ts +16 -0
  137. package/dist/esm/core/ui/inner-control-activation.utils.d.ts.map +1 -0
  138. package/dist/esm/core/ui/inner-control-activation.utils.js +44 -0
  139. package/dist/esm/core/ui/inner-control-activation.utils.js.map +1 -0
  140. package/dist/esm/index.d.ts +4 -0
  141. package/dist/esm/index.d.ts.map +1 -1
  142. package/dist/esm/index.js +4 -0
  143. package/dist/esm/index.js.map +1 -1
  144. package/dist/tsconfig.build.tsbuildinfo +1 -1
  145. package/package.json +8 -8
@@ -1,13 +1,16 @@
1
1
  "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import * as React from "react";
4
4
  import { AI_ApprovalRequest, AI_ApprovalQueue, } from "../../components/ai-elements/decision/approval.js";
5
- import { AGENT_WORK_REASON_CODE_VOCABULARY, ApplicationConfigVocabulary, FlowsActorsToolLabelSlot, flowsActorsToolLabelKey, flowsActorsToolLabelScope, HumanDecision_Act, HumanDecision_ActOutcomeKind, HumanDecision_Plane, HumanDecision_RefusalReason, HumanDecision_RequesterKind, HumanDecision_RouteKind, HumanDecisionPhraseKind, HUMAN_DECISION_INBOX_FOCUS_PARAM, HUMAN_DECISION_VERDICT_OPTIONS_BY_PLANE, ReviewDeadlineKind, describeHumanDecisionCard, humanDecisionAsksItsOwnQuestion, humanDecisionOptionPhrase, } from "@wildo-ai/saas-models";
5
+ import { AGENT_WORK_REASON_CODE_VOCABULARY, ApplicationConfigVocabulary, FlowsActorsToolLabelSlot, flowsActorsToolLabelKey, flowsActorsToolLabelScope, HumanDecision_Act, HumanDecision_ActOutcomeKind, HumanDecision_Plane, HumanDecision_RefusalReason, HumanDecision_RequesterKind, HumanDecision_RouteKind, HumanDecisionPhraseKind, HUMAN_DECISION_INBOX_FOCUS_PARAM, HUMAN_DECISION_VERDICT_OPTIONS_BY_PLANE, ReviewDeadlineKind, describeHumanDecisionCard, humanDecisionAsksItsOwnQuestion, humanDecisionOptionPhrase, humanDecisionPresentedRowsOf, } from "@wildo-ai/saas-models";
6
6
  import { PendingDecisionsReadState, usePendingDecisions } from "../../core/flows-actors/usePendingDecisions.js";
7
7
  import { useFlowsActors } from "../../core/flows-actors/useFlowsActors.js";
8
8
  import { FrontendComponentType, LabellingTypes, ResourceOperationTextSlot } from "@wildo-ai/presets-components-models";
9
9
  import { useI18n } from "../../core/i18n/useI18n.js";
10
10
  import { describeApprovalModificationRefusal } from "../../components/flows-actors/approval-modification-refusal.utils.js";
11
+ import { DecisionApprovalSeal } from "../../components/data-display/approval-seal.js";
12
+ /** How many decisions answered in this inbox keep their seal shown under it, newest first (#2913). */
13
+ const DECIDED_SEALS_SHOWN = 5;
11
14
  //===============================================================
12
15
  // Flows-Actors Approval Wrappers
13
16
  //
@@ -103,6 +106,12 @@ const NO_OPERATION_RESOURCES = [];
103
106
  export function FlowsActors_ApprovalRequest({ executionId, ...props }) {
104
107
  const { executions, respondToApproval, answerQuestion } = useFlowsActors();
105
108
  const [processingId, setProcessingId] = React.useState(null);
109
+ /**
110
+ * #2913: the decision this card answered, kept once the card's pending decision clears so the card shows its seal in
111
+ * its place. `shown` is what the card showed when it was answered: its decision and its title.
112
+ */
113
+ const [answered, setAnswered] = React.useState(null);
114
+ const shown = React.useRef(null);
106
115
  const execution = executions.get(executionId);
107
116
  const pendingApproval = execution?.pendingApproval;
108
117
  // The paused tool's title is loaded with the card's own words, so the card names the call as the inbox does.
@@ -114,11 +123,13 @@ export function FlowsActors_ApprovalRequest({ executionId, ...props }) {
114
123
  // review F1).
115
124
  const handleApprove = React.useCallback((id, comment, modifiedToolArgs, reasonCode) => {
116
125
  setProcessingId(id);
126
+ setAnswered(shown.current);
117
127
  // The reason rides only when given, so an answer without one keeps the call shape it always had.
118
128
  respondToApproval(executionId, id, true, comment, modifiedToolArgs, ...(reasonCode ? [reasonCode] : []));
119
129
  }, [executionId, respondToApproval]);
120
130
  const handleDeny = React.useCallback((id, comment, reasonCode) => {
121
131
  setProcessingId(id);
132
+ setAnswered(shown.current);
122
133
  if (reasonCode)
123
134
  respondToApproval(executionId, id, false, comment, undefined, reasonCode);
124
135
  else
@@ -127,6 +138,7 @@ export function FlowsActors_ApprovalRequest({ executionId, ...props }) {
127
138
  // #2720: the agent's QUESTION is answered with the person's values, or declined — never approved.
128
139
  const handleAnswer = React.useCallback((id, optionRef, values, comment) => {
129
140
  setProcessingId(id);
141
+ setAnswered(shown.current);
130
142
  answerQuestion(executionId, optionRef, values, comment);
131
143
  }, [executionId, answerQuestion]);
132
144
  const approvalWord = React.useCallback((labelRef) => tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, labelRef), [tComponent]);
@@ -136,8 +148,11 @@ export function FlowsActors_ApprovalRequest({ executionId, ...props }) {
136
148
  React.useEffect(() => {
137
149
  setProcessingId(null);
138
150
  }, [pendingApproval]);
139
- if (!execution || !pendingApproval)
140
- return null;
151
+ if (!execution || !pendingApproval) {
152
+ // Answered here and gone from the pending state: the seal of that answer, signed seconds later (#2913). A decision that
153
+ // sealed nothing (or one answered by someone else) answers 404, and the card draws nothing, as before.
154
+ return answered ? _jsx(DecisionApprovalSeal, { decisionRef: answered.decisionRef, description: answered.title }) : null;
155
+ }
141
156
  const { approvalId, riskLevel, expiresAt, toolName, toolArgs, toolInputSchema, modificationRefusal, rejectedToolArgs, routeKind, reasonCodes, reasonCodeRefused, question, presentation, } = pendingApproval;
142
157
  /*
143
158
  * The card's title, in this reader's words (#3201): the decision's presentation when the server sealed one, else the
@@ -146,6 +161,7 @@ export function FlowsActors_ApprovalRequest({ executionId, ...props }) {
146
161
  * built from the tool's IDENTIFIER and rendered here as written, is gone from the announcement.
147
162
  */
148
163
  const actionDescription = wordHumanDecisionPhrase(presentation?.title ?? describeHumanDecisionCard({ plane: HumanDecision_Plane.CONVERSATIONAL, toolName: toolName ?? '' }).title, t, roleLabel, toolLabel, operationLabel);
164
+ shown.current = pendingApproval.decisionRef ? { decisionRef: pendingApproval.decisionRef, title: actionDescription } : null;
149
165
  /*
150
166
  * Only an OWNER-routed decision is answered here. One routed to an assignee or a role is answered by a
151
167
  * reviewer from their inbox, and the person whose conversation this is may not answer it (separation of
@@ -179,7 +195,8 @@ export function FlowsActors_ApprovalRequest({ executionId, ...props }) {
179
195
  // The call's line names the tool by its title, as the card's title does (#3201).
180
196
  toolLabel: toolName ? toolLabel(toolName) : undefined, executionContext: toolArgs,
181
197
  // #2903: the arguments as the server presented them, rendered verbatim: what the person reads is what is sealed.
182
- presentedArguments: pendingApproval.presentation?.fields, argumentsSchema: toolInputSchema,
198
+ // #2914: then the values of the record the approval covers, which the seal binds too.
199
+ presentedArguments: pendingApproval.presentation ? humanDecisionPresentedRowsOf(pendingApproval.presentation) : undefined, argumentsSchema: toolInputSchema,
183
200
  // The refusal in the approval's own labels, naming the tool and the offending arguments (#1186).
184
201
  argumentModificationError: modificationRefusal
185
202
  ? describeApprovalModificationRefusal(modificationRefusal, (labelRef, params) => tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, labelRef, params))
@@ -262,7 +279,8 @@ operationLabel = (resourceType, operationIdentifier) => `${LabellingTypes.RESOUR
262
279
  */
263
280
  function describeInboxCard(card, t, roleLabel = (roleKey) => roleKey, toolLabel = (toolName) => toolName, operationLabel) {
264
281
  // #2903: the values as the server presented them, rendered verbatim, so what the reviewer reads is what is sealed.
265
- const presented = card.presentation ? { presentedArguments: card.presentation.fields } : {};
282
+ // #2914: with the values of the record the approval covers.
283
+ const presented = card.presentation ? { presentedArguments: humanDecisionPresentedRowsOf(card.presentation) } : {};
266
284
  const actionDescription = wordHumanDecisionPhrase(card.presentation?.title ?? describeHumanDecisionCard(card).title, t, roleLabel, toolLabel, operationLabel);
267
285
  // #2288: an operation approval shows the values the requester sent, as a tool approval shows its arguments.
268
286
  if (card.plane === HumanDecision_Plane.OPERATION_APPROVAL && card.operationApproval) {
@@ -355,10 +373,21 @@ export function FlowsActors_ApprovalQueue(props) {
355
373
  const [processing, setProcessing] = React.useState(() => new Set());
356
374
  const [notices, setNotices] = React.useState(() => new Map());
357
375
  const [reassignCandidates, setReassignCandidates] = React.useState(() => new Map());
376
+ /**
377
+ * #2913: the decisions this person answered here. An answered card leaves the pending list, so its seal is shown under
378
+ * the list instead: signed seconds after the answer, then current or not over the record it is about. Each keeps the
379
+ * title its card showed, read from `cardTitles` when the answer was sent.
380
+ */
381
+ const [decided, setDecided] = React.useState([]);
382
+ const cardTitles = React.useRef(new Map());
358
383
  const run = React.useCallback(async (decisionRef, decisionAct, request) => {
359
384
  setProcessing((previous) => new Set(previous).add(decisionRef));
385
+ const title = cardTitles.current.get(decisionRef);
360
386
  try {
361
387
  const outcome = await act(decisionRef, decisionAct, request);
388
+ if (decisionAct === HumanDecision_Act.ANSWER && outcome.kind === HumanDecision_ActOutcomeKind.APPLIED) {
389
+ setDecided((previous) => [{ decisionRef, ...(title ? { title } : {}) }, ...previous.filter((entry) => entry.decisionRef !== decisionRef)].slice(0, DECIDED_SEALS_SHOWN));
390
+ }
362
391
  const notice = noticeOfOutcome(outcome, t);
363
392
  setNotices((previous) => {
364
393
  const next = new Map(previous);
@@ -420,6 +449,7 @@ export function FlowsActors_ApprovalQueue(props) {
420
449
  allowArgumentModification: card.plane === HumanDecision_Plane.CONVERSATIONAL,
421
450
  argumentsSchema: card.toolInputSchema,
422
451
  })), [decisions, reassignCandidates, notices, t, roleLabel, toolLabel, operationLabel, tSystemEnum, formatDateTime]);
452
+ cardTitles.current = new Map(items.flatMap((item) => (typeof item.actionDescription === 'string' ? [[item.approvalId, item.actionDescription]] : [])));
423
453
  /**
424
454
  * An answer in the one answer shape: the option chosen, and no values. Which option refs "approve" and "deny" mean
425
455
  * depends on the decision's plane — a tool approval's, or a representative admission's (#1612) — so the card decides.
@@ -456,17 +486,17 @@ export function FlowsActors_ApprovalQueue(props) {
456
486
  people.map((person) => ({ value: person.userId, label: person.email ?? person.userId })))))
457
487
  .catch(() => setReassignCandidates((previous) => new Map(previous).set(decisionRef, [])));
458
488
  }, [candidates]);
459
- return (_jsx(AI_ApprovalQueue, { items: items, onApprove: (decisionRef, comment, modifiedToolArgs, reasonCode) => answer(decisionRef, true, comment, modifiedToolArgs, reasonCode), onDeny: (decisionRef, comment, reasonCode) => answer(decisionRef, false, comment, undefined, reasonCode), onEscalate: (decisionRef, comment) => void run(decisionRef, HumanDecision_Act.ESCALATE, comment ? { reason: comment } : {}),
460
- // #2526: the option the reviewer chose and the values it carries, in the one answer shape the server checks against
461
- // the decision's own request (an option it never offered, or values an option does not take, is refused).
462
- onAnswer: (decisionRef, optionRef, values, comment, reasonCode) => void run(decisionRef, HumanDecision_Act.ANSWER, {
463
- answer: { decisionId: decisionRef, optionRef, values: [...values] },
464
- ...presentationEchoOf(decisions, decisionRef),
465
- ...(comment ? { reason: comment } : {}),
466
- // #2539: an actor question that reviews an agent's work may carry a declared reason, as a tool approval does.
467
- ...(reasonCode ? { reasonCode } : {}),
468
- }), onClaim: (decisionRef) => void run(decisionRef, HumanDecision_Act.CLAIM, {}), onUnclaim: (decisionRef) => void run(decisionRef, HumanDecision_Act.UNCLAIM, {}), onReassignOpen: handleReassignOpen, onReassign: (decisionRef, targetUserId, comment) => void run(decisionRef, HumanDecision_Act.REASSIGN, { targetUserId, ...(comment ? { reason: comment } : {}) }), onPauseClock: (decisionRef, pauseStateRef) => void run(decisionRef, HumanDecision_Act.PAUSE_CLOCK, { pauseStateRef }), onResumeClock: (decisionRef) => void run(decisionRef, HumanDecision_Act.RESUME_CLOCK, {}), processingIds: processing,
469
- // #2526: a read still settling, and a read that failed, are states the inbox SHOWS — never an empty inbox.
470
- isLoading: readState === PendingDecisionsReadState.LOADING, loadFailed: readState === PendingDecisionsReadState.FAILED, onRetry: () => { void refresh(); }, ...props }));
489
+ return (_jsxs(_Fragment, { children: [_jsx(AI_ApprovalQueue, { items: items, onApprove: (decisionRef, comment, modifiedToolArgs, reasonCode) => answer(decisionRef, true, comment, modifiedToolArgs, reasonCode), onDeny: (decisionRef, comment, reasonCode) => answer(decisionRef, false, comment, undefined, reasonCode), onEscalate: (decisionRef, comment) => void run(decisionRef, HumanDecision_Act.ESCALATE, comment ? { reason: comment } : {}),
490
+ // #2526: the option the reviewer chose and the values it carries, in the one answer shape the server checks against
491
+ // the decision's own request (an option it never offered, or values an option does not take, is refused).
492
+ onAnswer: (decisionRef, optionRef, values, comment, reasonCode) => void run(decisionRef, HumanDecision_Act.ANSWER, {
493
+ answer: { decisionId: decisionRef, optionRef, values: [...values] },
494
+ ...presentationEchoOf(decisions, decisionRef),
495
+ ...(comment ? { reason: comment } : {}),
496
+ // #2539: an actor question that reviews an agent's work may carry a declared reason, as a tool approval does.
497
+ ...(reasonCode ? { reasonCode } : {}),
498
+ }), onClaim: (decisionRef) => void run(decisionRef, HumanDecision_Act.CLAIM, {}), onUnclaim: (decisionRef) => void run(decisionRef, HumanDecision_Act.UNCLAIM, {}), onReassignOpen: handleReassignOpen, onReassign: (decisionRef, targetUserId, comment) => void run(decisionRef, HumanDecision_Act.REASSIGN, { targetUserId, ...(comment ? { reason: comment } : {}) }), onPauseClock: (decisionRef, pauseStateRef) => void run(decisionRef, HumanDecision_Act.PAUSE_CLOCK, { pauseStateRef }), onResumeClock: (decisionRef) => void run(decisionRef, HumanDecision_Act.RESUME_CLOCK, {}), processingIds: processing,
499
+ // #2526: a read still settling, and a read that failed, are states the inbox SHOWS — never an empty inbox.
500
+ isLoading: readState === PendingDecisionsReadState.LOADING, loadFailed: readState === PendingDecisionsReadState.FAILED, onRetry: () => { void refresh(); }, ...props }), decided.map((entry) => (_jsx(DecisionApprovalSeal, { decisionRef: entry.decisionRef, ...(entry.title ? { description: entry.title } : {}) }, entry.decisionRef)))] }));
471
501
  }
472
502
  //# sourceMappingURL=approval.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"approval.js","sourceRoot":"","sources":["../../../../src/components/flows-actors/approval.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,gBAAgB,GAQjB,MAAM,8DAA8D,CAAC;AACtE,OAAO,EACL,iCAAiC,EACjC,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,EACjB,4BAA4B,EAC5B,mBAAmB,EACnB,2BAA2B,EAC3B,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EACvB,gCAAgC,EAChC,uCAAuC,EACvC,kBAAkB,EAClB,yBAAyB,EACzB,+BAA+B,EAC/B,yBAAyB,GAM1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,MAAM,2DAA2D,CAAC;AAC3H,OAAO,EAAE,cAAc,EAAE,MAAM,sDAAsD,CAAC;AAGtF,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAA;AACtH,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAChE,OAAO,EAAE,mCAAmC,EAAE,MAAM,iFAAiF,CAAC;AAEtI,iEAAiE;AACjE,kCAAkC;AAClC,EAAE;AACF,oEAA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B;QACxC,2GAA2G;QAC3G,SAAS,EAAE,SAAS,KAAK,yBAAyB,CAAC,OAAO,EAC1D,UAAU,EAAE,SAAS,KAAK,yBAAyB,CAAC,MAAM,EAC1D,OAAO,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC,KAC9B,KAAK,GACT,CACH,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n AI_ApprovalRequest,\n AI_ApprovalQueue,\n type AI_ApprovalQueueItem,\n type AI_ApprovalReasonCodeOption,\n type AI_ApprovalReassignCandidate,\n type AI_ApprovalRequestProps,\n type AI_ApprovalQueueProps,\n type AI_DecisionAnswerValue,\n type AI_DecisionQuestion,\n} from \"~wildo-frontend-lib/components/ai-elements/decision/approval\";\nimport {\n AGENT_WORK_REASON_CODE_VOCABULARY,\n ApplicationConfigVocabulary,\n FlowsActorsToolLabelSlot,\n flowsActorsToolLabelKey,\n flowsActorsToolLabelScope,\n HumanDecision_Act,\n HumanDecision_ActOutcomeKind,\n HumanDecision_Plane,\n HumanDecision_RefusalReason,\n HumanDecision_RequesterKind,\n HumanDecision_RouteKind,\n HumanDecisionPhraseKind,\n HUMAN_DECISION_INBOX_FOCUS_PARAM,\n HUMAN_DECISION_VERDICT_OPTIONS_BY_PLANE,\n ReviewDeadlineKind,\n describeHumanDecisionCard,\n humanDecisionAsksItsOwnQuestion,\n humanDecisionOptionPhrase,\n type HumanDecisionPhrase,\n type HumanDecision_ActOutcome,\n type HumanDecision_ActRequest,\n type HumanDecision_PendingCard,\n type HumanDecision_Request,\n} from \"@wildo-ai/saas-models\";\nimport { PendingDecisionsReadState, usePendingDecisions } from \"~wildo-frontend-lib/core/flows-actors/usePendingDecisions\";\nimport { useFlowsActors } from \"~wildo-frontend-lib/core/flows-actors/useFlowsActors\";\nimport type { ComponentProps } from \"react\";\nimport type { SerializableZodSchema } from \"@wildo-ai/zod-decorators\";\nimport { FrontendComponentType, LabellingTypes, ResourceOperationTextSlot } from \"@wildo-ai/presets-components-models\"\nimport { useI18n } from \"~wildo-frontend-lib/core/i18n/useI18n\";\nimport { describeApprovalModificationRefusal } from \"~wildo-frontend-lib/components/flows-actors/approval-modification-refusal.utils\";\n\n//===============================================================\n// Flows-Actors Approval Wrappers\n//\n// Thin context-wired wrappers over the preset decision components.\n//\n// - FlowsActors_ApprovalRequest answers a decision IN its conversation, over the socket the turn runs on.\n// - FlowsActors_ApprovalQueue is the person's INBOX: every decision they may act on, read from the server\n// (#1594 D6), answered and moved over REST.\n//\n// A decision with options of its OWN — an actor system's question, with its fields — is answered in the inbox too\n// (#2526): its card carries the request, and the inbox draws its options in place of Approve and Deny and sends the\n// chosen one, with the field values, in the one answer shape. Two standalone wrappers that answered such a decision\n// outside any list (FlowsActors_DecisionRequest, FlowsActors_HumanInputRequest) had no consumer and were folded into\n// this one path; since #2539 an application raises those decisions on its own actor plane.\n//===============================================================\n\n/**\n * What an act came to, in the approval's own labels. Total over the outcome vocabulary, so an outcome added\n * tomorrow is a compile error here rather than a silent act.\n */\nfunction noticeOfOutcome(\n outcome: HumanDecision_ActOutcome,\n t: (labelRef: string, params?: Record<string, string>) => string,\n): string | undefined {\n // #3316: the arguments a refusal is about, by name: the inbox has no error payload, and the values may all be valid.\n const named = { arguments: (outcome.argumentNames ?? []).join(', ') || t(\"noticeTheseArguments\") };\n const byKind: Readonly<Record<HumanDecision_ActOutcomeKind, string | undefined>> = {\n [HumanDecision_ActOutcomeKind.APPLIED]: undefined,\n // An admitted person's refused clock act names why (#1628); anything else stays one undisclosing notice.\n // #2903: the request changed since it was read; the list just re-read shows it as it is now.\n [HumanDecision_ActOutcomeKind.NOT_ACTIONABLE]: outcome.reason === HumanDecision_RefusalReason.PRESENTATION_STALE ? t(\"noticePresentationStale\")\n : outcome.reason === HumanDecision_RefusalReason.CLOCK_ALREADY_PAUSED ? t(\"noticeClockAlreadyPaused\")\n : outcome.reason === HumanDecision_RefusalReason.CLOCK_NOT_PAUSED ? t(\"noticeClockNotPaused\")\n : outcome.reason === HumanDecision_RefusalReason.PAUSE_STATE_NOT_DECLARED ? t(\"noticePauseStateNotDeclared\")\n : t(\"noticeNotActionable\"),\n [HumanDecision_ActOutcomeKind.LAPSED]: t(\"noticeLapsed\"),\n [HumanDecision_ActOutcomeKind.REQUESTER_AUTHORITY_LAPSED]: t(\"noticeRequesterAuthorityLapsed\"),\n // An edit pointing the call at a record the answerer may not reach says so (#2734): the inbox gets no error payload,\n // only the outcome, so its reason is what tells a representative to put the arguments back.\n // Likewise a call that would not run as read (#3295): the values may be valid, so \"refused\" alone says nothing.\n [HumanDecision_ActOutcomeKind.MODIFICATION_REJECTED]: outcome.reason === HumanDecision_RefusalReason.EDITED_CALL_NOT_REACHABLE\n ? t(\"noticeEditedCallNotReachable\", named)\n : outcome.reason === HumanDecision_RefusalReason.CALL_NOT_RUN_AS_READ\n ? t(\"noticeCallNotRunAsRead\", named)\n : outcome.reason === HumanDecision_RefusalReason.CREDENTIAL_NOT_ACCEPTED\n ? t(\"noticeCredentialNotAccepted\", named)\n : outcome.reason === HumanDecision_RefusalReason.CALL_CANNOT_RUN\n ? t(\"noticeCallCannotRun\")\n : outcome.reason === HumanDecision_RefusalReason.ARGUMENTS_CANNOT_BE_CORRECTED\n ? t(\"noticeArgumentsCannotBeCorrected\", named)\n : t(\"noticeModificationRejected\"),\n [HumanDecision_ActOutcomeKind.REASON_CODE_REJECTED]: t(\"noticeReasonCodeRejected\"),\n [HumanDecision_ActOutcomeKind.CONSENT_REQUIRED]: t(\"noticeConsentRequired\"),\n [HumanDecision_ActOutcomeKind.TARGET_REFUSED]: outcome.reason === HumanDecision_RefusalReason.NO_TARGET ? t(\"noticeNoEscalationTarget\") : t(\"noticeTargetRefused\"),\n [HumanDecision_ActOutcomeKind.SUPERSEDED]: t(\"noticeSuperseded\"),\n };\n return byKind[outcome.kind];\n}\n\n/**\n * The presentation a card was read on (#2903), echoed on its answer: the server rebuilds the decision's presentation and\n * refuses an answer naming none, or one that is no longer current, so what is sealed is what this reviewer read.\n */\nfunction presentationEchoOf(decisions: readonly HumanDecision_PendingCard[], decisionRef: string): Pick<HumanDecision_ActRequest, 'presentationId'> {\n const presentationId = decisions.find((card) => card.decisionRef === decisionRef)?.presentationId;\n return presentationId ? { presentationId } : {};\n}\n\n/**\n * The reason picker's options (#1921): each declared code with its word from `system_enums.AgentWorkReasonCode.<code>`.\n *\n * The codes are the APPLICATION's (`agentWorkReview.reasonCodes`); their words live under the framework's named\n * vocabulary, where the labelling pipeline plans one key per declared code. A code nobody has worded yet shows as the\n * code itself — `tSystemEnum` answers the raw value on a miss — which is a missing label that looks missing, never words\n * invented from the identifier. Exported for the pin that holds that fallback.\n */\nexport function describeReasonCodeOptions(\n reasonCodes: readonly string[] | undefined,\n tSystemEnum: (enumName: typeof AGENT_WORK_REASON_CODE_VOCABULARY, enumValue: string) => string,\n): AI_ApprovalReasonCodeOption[] | undefined {\n if (!reasonCodes || reasonCodes.length === 0) return undefined;\n return reasonCodes.map((code) => ({ value: code, label: tSystemEnum(AGENT_WORK_REASON_CODE_VOCABULARY, code) }));\n}\n\n/**\n * A gate's pause states as the words a reviewer reads (#1864): each state's word under the framework's named vocabulary\n * `system_enums.HumanDecisionPauseState.<state>`, which the labelling pipeline plans from every gate's declared\n * `pauseStates`. A state nobody has worded yet shows as itself — `tSystemEnum` answers the raw value on a miss — a\n * missing label that looks missing. Exported for the pin that holds it.\n */\nexport function describePauseState(\n pauseState: string,\n tSystemEnum: (enumName: ApplicationConfigVocabulary.HUMAN_DECISION_PAUSE_STATE, enumValue: string) => string,\n): string {\n return tSystemEnum(ApplicationConfigVocabulary.HUMAN_DECISION_PAUSE_STATE, pauseState);\n}\n\n/**\n * The label namespaces the approval wrappers read beyond their own component: the reason codes' (#1921) and pause\n * states' (#1864) words, and the roles' (#2526 review F3) — the holder line names a role, and `roles` is not an eager\n * section, so without it every ROLE card named the role by its key.\n */\nconst APPROVAL_LABEL_NAMESPACES = [LabellingTypes.SYSTEM_ENUMS, LabellingTypes.ROLES];\n/** The chat card holds a tool approval, never an operation approval, so it loads no resource's operation titles. */\nconst NO_OPERATION_RESOURCES: readonly string[] = [];\n\n//===============================================================\n// FlowsActors_ApprovalRequest\n//\n// A decision answered in the conversation it was raised in.\n//===============================================================\n\nexport type FlowsActors_ApprovalRequestProps = Omit<\n AI_ApprovalRequestProps,\n \"approvalId\" | \"actionDescription\" | \"riskLevel\" | \"onApprove\" | \"onDeny\" | \"onEscalate\" | \"answerable\"\n> & {\n executionId: string;\n};\n\nexport function FlowsActors_ApprovalRequest({\n executionId,\n ...props\n}: FlowsActors_ApprovalRequestProps): React.JSX.Element | null {\n const { executions, respondToApproval, answerQuestion } = useFlowsActors();\n const [processingId, setProcessingId] = React.useState<string | null>(null);\n const execution = executions.get(executionId);\n const pendingApproval = execution?.pendingApproval;\n // The paused tool's title is loaded with the card's own words, so the card names the call as the inbox does.\n const pendingToolName = pendingApproval?.toolName;\n const toolNames = React.useMemo(() => (pendingToolName ? [pendingToolName] : []), [pendingToolName]);\n const { t, roleLabel, toolLabel, operationLabel, tComponent, tSystemEnum } = useHumanDecisionWords(toolNames, NO_OPERATION_RESOURCES);\n\n // Every hook runs BEFORE the early return below. React requires the same hooks on every render, and the render\n // that clears `pendingApproval` — the moment a decision is answered — used to run three fewer (#534 fourth\n // review F1).\n const handleApprove = React.useCallback((id: string, comment?: string, modifiedToolArgs?: Record<string, unknown>, reasonCode?: string) => {\n setProcessingId(id);\n // The reason rides only when given, so an answer without one keeps the call shape it always had.\n respondToApproval(executionId, id, true, comment, modifiedToolArgs, ...(reasonCode ? [reasonCode] : []));\n }, [executionId, respondToApproval]);\n\n const handleDeny = React.useCallback((id: string, comment?: string, reasonCode?: string) => {\n setProcessingId(id);\n if (reasonCode) respondToApproval(executionId, id, false, comment, undefined, reasonCode);\n else respondToApproval(executionId, id, false, comment);\n }, [executionId, respondToApproval]);\n\n // #2720: the agent's QUESTION is answered with the person's values, or declined — never approved.\n const handleAnswer = React.useCallback((id: string, optionRef: string, values: readonly AI_DecisionAnswerValue[], comment?: string) => {\n setProcessingId(id);\n answerQuestion(executionId, optionRef, values, comment);\n }, [executionId, answerQuestion]);\n const approvalWord = React.useCallback(\n (labelRef: string) => tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, labelRef as never),\n [tComponent],\n );\n\n // A decision answered and then handed BACK arrives as a new pending approval — a refused edit (#587), or a\n // decision the consent requirement refused (#534). Whatever this component recorded as in flight has been\n // answered, so the decision is answerable again instead of staying disabled until the view remounts.\n React.useEffect(() => {\n setProcessingId(null);\n }, [pendingApproval]);\n\n if (!execution || !pendingApproval) return null;\n\n const {\n approvalId, riskLevel, expiresAt, toolName, toolArgs, toolInputSchema, modificationRefusal,\n rejectedToolArgs, routeKind, reasonCodes, reasonCodeRefused, question, presentation,\n } = pendingApproval;\n /*\n * The card's title, in this reader's words (#3201): the decision's presentation when the server sealed one, else the\n * tool-approval title every decision surface derives (`describeHumanDecisionCard`), worded exactly as the inbox words\n * the same decision. The pause carries typed state only: the server's English `Waiting for approval to run \"<tool>\".`,\n * built from the tool's IDENTIFIER and rendered here as written, is gone from the announcement.\n */\n const actionDescription = wordHumanDecisionPhrase(\n presentation?.title ?? describeHumanDecisionCard({ plane: HumanDecision_Plane.CONVERSATIONAL, toolName: toolName ?? '' }).title,\n t, roleLabel, toolLabel, operationLabel,\n );\n /*\n * Only an OWNER-routed decision is answered here. One routed to an assignee or a role is answered by a\n * reviewer from their inbox, and the person whose conversation this is may not answer it (separation of\n * duties, #1594) — so it shows as waiting, with nothing to press that the server would refuse.\n *\n * There is no Escalate here either. It used to send a DENIAL prefixed `[ESCALATED]`, which refused the call\n * and escalated nothing; an OWNER route cannot be escalated at all, and a reviewer escalates from the inbox.\n */\n const answerable = routeKind === undefined || routeKind === HumanDecision_RouteKind.OWNER;\n\n if (question) {\n // #2720: the agent asks its person. Its questions, through their form, in place of the call and its arguments.\n return (\n <AI_ApprovalRequest\n approvalId={approvalId}\n actionDescription={question.title}\n executionId={executionId}\n systemRef={execution.systemRef}\n expiresAt={expiresAt}\n answerable={answerable}\n question={humanDecisionQuestionOf(question, approvalWord)}\n onAnswer={handleAnswer}\n isProcessing={processingId === approvalId}\n {...props}\n />\n );\n }\n\n return (\n <AI_ApprovalRequest\n approvalId={approvalId}\n actionDescription={actionDescription}\n riskLevel={riskLevel}\n executionId={executionId}\n systemRef={execution.systemRef}\n expiresAt={expiresAt}\n answerable={answerable}\n // A refused reason code leaves the approval standing (#1921): it is back on screen, and says why in its own labels.\n actionNotice={!answerable\n ? tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, \"awaitingReview\")\n : reasonCodeRefused ? tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, \"noticeReasonCodeRejected\") : undefined}\n reasonCodeOptions={answerable ? describeReasonCodeOptions(reasonCodes, tSystemEnum) : undefined}\n /*\n * The tool call is WHAT is being approved, and until #528 it did not reach the browser at all.\n * `toolArgs` are the proposed arguments — a person approving \"rename this record\" is approving\n * a specific new title, and an approval surface that hides them is asking for a signature on an\n * unread document.\n *\n * #566 built the carrier for an edited call: the payload takes `modifiedToolArgs`, the server\n * re-validates them against the tool's own `inputSchema`, re-signs the approval over them and\n * records that the decider changed them. So the editor is offered here, where the decision is\n * answered — never where it is only shown.\n */\n allowArgumentModification={answerable}\n toolName={toolName}\n // The call's line names the tool by its title, as the card's title does (#3201).\n toolLabel={toolName ? toolLabel(toolName) : undefined}\n executionContext={toolArgs}\n // #2903: the arguments as the server presented them, rendered verbatim: what the person reads is what is sealed.\n presentedArguments={pendingApproval.presentation?.fields}\n argumentsSchema={toolInputSchema}\n // The refusal in the approval's own labels, naming the tool and the offending arguments (#1186).\n argumentModificationError={modificationRefusal\n ? describeApprovalModificationRefusal(modificationRefusal, (labelRef, params) => tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, labelRef, params))\n : undefined}\n rejectedArguments={rejectedToolArgs}\n onApprove={handleApprove}\n onDeny={handleDeny}\n // Released by the effect above whenever the approval is handed back. Not released while the socket is\n // disconnected: `respondToApproval` then sends nothing and leaves the approval exactly as it was, so its\n // identity never changes — a stuck state that predates #534 and is cured by the view remounting.\n isProcessing={processingId === approvalId}\n {...props}\n />\n );\n}\n\n//===============================================================\n// FlowsActors_ApprovalQueue\n//\n// The person's inbox: every decision they may act on, from the server.\n//===============================================================\n\n/**\n * Who holds a listed decision now, in the approval's own words (#2526). Total over the route vocabulary.\n *\n * The inbox lists only decisions the viewer may ANSWER (#1594 I3), so an ASSIGNEE card is always assigned to the\n * viewer: \"you claimed it\" when they took it from a role, \"assigned to you\" when a resolver, a reassignment or an\n * escalation put it there. A decision a colleague claimed is not in the viewer's list at all. A ROLE card names the role\n * in the roles tree's words, never its key. Exported for the pin that holds it.\n */\nexport function describeDecisionHolder(\n route: HumanDecision_PendingCard['route'],\n t: (labelRef: string, params?: Record<string, string>) => string,\n roleLabel: (roleKey: string) => string,\n formatDateTime: (value: Date | string) => string,\n): string | undefined {\n const byKind: Readonly<Record<HumanDecision_RouteKind, () => string | undefined>> = {\n [HumanDecision_RouteKind.OWNER]: () => t(\"holderOwner\"),\n [HumanDecision_RouteKind.ASSIGNEE]: () => (route.claimedAt ? t(\"holderClaimedByYou\", { when: formatDateTime(route.claimedAt) }) : t(\"holderAssignedToYou\")),\n // A ROLE route always names its role (a gate without one stops the application at startup); none means no line.\n [HumanDecision_RouteKind.ROLE]: () => (route.eligibleRole ? t(\"holderRole\", { role: roleLabel(route.eligibleRole) }) : undefined),\n };\n return byKind[route.kind]();\n}\n\n/**\n * Who raised a listed decision, when that is worth saying (#2526). Total over the requester vocabulary.\n *\n * A person's own request needs no line: the holder line already says whose conversation it is when it is the viewer's,\n * and naming another person by id would show an identifier (naming people is #1852). What a reviewer must not miss is\n * a request with NO person behind it — an autonomous agent, raised by a machine — or one raised through an application a\n * person connected, which resumes only while that delegation holds.\n */\nconst REQUESTER_LABEL: Readonly<Record<HumanDecision_RequesterKind, string | undefined>> = {\n [HumanDecision_RequesterKind.USER]: undefined,\n [HumanDecision_RequesterKind.MACHINE]: \"requesterAutonomousAgent\",\n [HumanDecision_RequesterKind.DELEGATED_CLIENT]: \"requesterConnectedApplication\",\n};\n\nexport function describeDecisionRequester(\n requesterKind: HumanDecision_RequesterKind,\n t: (labelRef: string) => string,\n): string | undefined {\n const labelRef = REQUESTER_LABEL[requesterKind];\n return labelRef ? t(labelRef) : undefined;\n}\n\n/**\n * A phrase of the shared wording (`describeHumanDecisionCard`), in this inbox's words: an approval label through `t`, a\n * role through the roles label tree, a tool through its title in the tool label tree (#2551), a resource operation\n * through its title in the resource label tree (#2288), a host's own words as written.\n */\nfunction wordHumanDecisionPhrase(\n phrase: HumanDecisionPhrase,\n t: (labelRef: string, params?: Record<string, string>) => string,\n roleLabel: (roleKey: string) => string,\n toolLabel: (toolName: string) => string,\n // With no wording function, the operation's label key: a missing label looks missing.\n operationLabel: (resourceType: string, operationIdentifier: string) => string = (resourceType, operationIdentifier) =>\n `${LabellingTypes.RESOURCES}.${resourceType}.operations.${operationIdentifier}.${ResourceOperationTextSlot.TITLE}`,\n): string {\n switch (phrase.kind) {\n case HumanDecisionPhraseKind.LABEL:\n return phrase.params\n ? t(phrase.labelRef, Object.fromEntries(Object.entries(phrase.params).map(([key, value]) => [key, typeof value === 'object' ? wordHumanDecisionPhrase(value, t, roleLabel, toolLabel, operationLabel) : String(value)])))\n : t(phrase.labelRef);\n case HumanDecisionPhraseKind.ROLE:\n return roleLabel(phrase.roleKey);\n case HumanDecisionPhraseKind.TOOL:\n return toolLabel(phrase.toolName);\n case HumanDecisionPhraseKind.RESOURCE_OPERATION:\n return operationLabel(phrase.resourceType, phrase.operationIdentifier);\n case HumanDecisionPhraseKind.TEXT:\n return phrase.text;\n default: {\n const unhandled: never = phrase;\n return unhandled;\n }\n }\n}\n\n/**\n * What one inbox card SAYS, from the wording every decision surface shares (`describeHumanDecisionCard`): the same\n * line a chat card posted for this decision carries. A tool approval also shows the tool and its proposed arguments;\n * a representative admission (#1612) and a card asking its own question show none — there is no tool call.\n */\nfunction describeInboxCard(\n card: HumanDecision_PendingCard,\n t: (labelRef: string, params?: Record<string, string>) => string,\n roleLabel: (roleKey: string) => string = (roleKey) => roleKey,\n toolLabel: (toolName: string) => string = (toolName) => toolName,\n operationLabel?: (resourceType: string, operationIdentifier: string) => string,\n): Pick<AI_ApprovalQueueItem, 'actionDescription' | 'toolName' | 'toolLabel' | 'executionContext' | 'presentedArguments'> {\n // #2903: the values as the server presented them, rendered verbatim, so what the reviewer reads is what is sealed.\n const presented = card.presentation ? { presentedArguments: card.presentation.fields } : {};\n const actionDescription = wordHumanDecisionPhrase(card.presentation?.title ?? describeHumanDecisionCard(card).title, t, roleLabel, toolLabel, operationLabel);\n // #2288: an operation approval shows the values the requester sent, as a tool approval shows its arguments.\n if (card.plane === HumanDecision_Plane.OPERATION_APPROVAL && card.operationApproval) {\n return { actionDescription, executionContext: card.operationApproval.requestedValues, ...presented };\n }\n const isRepresentativeAdmission = card.plane === HumanDecision_Plane.REPRESENTATIVE_ADMISSION && !!card.representativeAdmission;\n if (isRepresentativeAdmission || humanDecisionAsksItsOwnQuestion(card)) return { actionDescription };\n return { actionDescription, toolName: card.toolName, toolLabel: toolLabel(card.toolName), executionContext: card.toolArgs, ...presented };\n}\n\n/**\n * A request as the card asks it: its reason, its options and its fields with their form. An option the engine wrote is\n * worded by the approval label it names (`labelRef`, #2754), through `word` in this reader's language; any other option\n * carries the words its host wrote. The decision is the shared wording's (`humanDecisionOptionPhrase`), so the chat card,\n * the inbox and a notice cannot word one option two ways.\n */\nexport function humanDecisionQuestionOf(request: HumanDecision_Request, word: (labelRef: string) => string): AI_DecisionQuestion {\n return {\n description: request.description,\n options: request.options.map((option) => ({\n ref: option.ref,\n // An option phrase is a label or text: no role and no tool to word, so both pass through.\n label: wordHumanDecisionPhrase(humanDecisionOptionPhrase(option), word, (roleKey) => roleKey, (toolName) => toolName),\n intent: option.intent,\n ...(option.description ? { description: option.description } : {}),\n })),\n fields: request.fields,\n ...(request.form ? { form: request.form } : {}),\n };\n}\n\n/**\n * A card's own question, when it asks one (#2526): the request it carries, on a plane whose options are not the inbox's\n * Approve and Deny — or, on a plane that has those, a request that asks FIELDS, which only an agent's question to its\n * person does (#2720). `undefined` for a request the inbox words itself.\n */\nexport function decisionQuestionOf(card: Pick<HumanDecision_PendingCard, 'plane' | 'request'>, word: (labelRef: string) => string): AI_DecisionQuestion | undefined {\n if (!card.request) return undefined;\n if (!humanDecisionAsksItsOwnQuestion(card)) return undefined;\n // An option is worded by the label it names, on any plane (#2754): an agent's question and a flow's person step name\n // theirs. A host that named its own options keeps its words, whatever refs it chose (#2720 review L6).\n return humanDecisionQuestionOf(card.request, word);\n}\n\nexport type FlowsActors_ApprovalQueueProps = Omit<\n AI_ApprovalQueueProps,\n | \"items\" | \"onApprove\" | \"onDeny\" | \"onEscalate\" | \"onAnswer\" | \"onClaim\" | \"onUnclaim\" | \"onReassignOpen\" | \"onReassign\" | \"onPauseClock\" | \"onResumeClock\"\n | \"processingIds\" | \"isLoading\" | \"loadFailed\" | \"onRetry\"\n>;\n\n/**\n * The words a pending decision is read in, for every surface that shows one: an approval label through `t`, a role\n * through the roles label tree, a tool through its title in the tool label tree (#2551), a resource operation through its\n * title. The inbox and the chat card (#3201) both word a decision through these, so the two cannot read one decision two\n * ways, and neither shows a sentence the server wrote.\n *\n * `toolNames` and `operationResources` name the label scopes to load, so the titles are there when the card renders.\n */\nfunction useHumanDecisionWords(toolNames: readonly string[], operationResources: readonly string[]) {\n const labelKeys = React.useMemo(\n () => [...APPROVAL_LABEL_NAMESPACES, ...toolNames.map(flowsActorsToolLabelScope), ...operationResources.map((type) => `${LabellingTypes.RESOURCES}.${type}`)],\n [toolNames, operationResources],\n );\n const { t: tKey, tComponent, tRole, tSystemEnum, tResourceOperation, formatDateTime } = useI18n({ component: FrontendComponentType.LOW_LEVEL_AI_APPROVAL, keys: labelKeys });\n const t = React.useCallback(\n (labelRef: string, params?: Record<string, string>) => tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, labelRef as never, params),\n [tComponent],\n );\n // A role is worded by the roles label tree, never shown as its identifier.\n const roleLabel = React.useCallback((roleKey: string) => (tRole ? tRole(roleKey, 'label') : roleKey), [tRole]);\n // A tool by its title, as the conversation names the same call; a tool with no words yet by its name.\n const toolLabel = React.useCallback((toolName: string) => {\n const key = flowsActorsToolLabelKey(toolName, FlowsActorsToolLabelSlot.TITLE);\n const resolved = tKey(key);\n return resolved === key || resolved.length === 0 ? toolName : resolved;\n }, [tKey]);\n // An operation by its title, as the application names it everywhere; with no title generated, its key (missing looks missing).\n const operationLabel = React.useCallback(\n (resourceType: string, operationIdentifier: string) => tResourceOperation(resourceType, operationIdentifier, ResourceOperationTextSlot.TITLE),\n [tResourceOperation],\n );\n return { t, roleLabel, toolLabel, operationLabel, tComponent, tSystemEnum, formatDateTime };\n}\n\n/**\n * The inbox's cards with the one a link named first (#2923): a chat card that cannot answer a decision links to it here\n * (`humanDecisionInboxPathOf`), and the person lands on it. The others keep their order.\n */\nexport function withFocusedDecisionFirst<T extends { readonly decisionRef: string }>(cards: readonly T[], search: string): readonly T[] {\n const focused = new URLSearchParams(search).get(HUMAN_DECISION_INBOX_FOCUS_PARAM);\n if (!focused) return cards;\n const named = cards.filter((card) => card.decisionRef === focused);\n return named.length === 0 ? cards : [...named, ...cards.filter((card) => card.decisionRef !== focused)];\n}\n\nexport function FlowsActors_ApprovalQueue(props: FlowsActors_ApprovalQueueProps): React.JSX.Element {\n const { decisions: listed, readState, refresh, act, candidates } = usePendingDecisions();\n // #2923: a link to one decision lists it first.\n const decisions = React.useMemo(() => withFocusedDecisionFirst(listed, window.location.search), [listed]);\n // The words of every tool a listed decision would run (#2551), loaded with the inbox's own.\n const toolNames = React.useMemo(() => [...new Set(decisions.map((card) => card.toolName).filter((name): name is string => !!name))].sort(), [decisions]);\n // #2288: the resources whose held operations are listed, so each operation is named by its title.\n const operationResources = React.useMemo(\n () => [...new Set(decisions.map((card) => card.operationApproval?.resourceType).filter((type): type is string => !!type))].sort(),\n [decisions],\n );\n const { t, roleLabel, toolLabel, operationLabel, tSystemEnum, formatDateTime } = useHumanDecisionWords(toolNames, operationResources);\n // Keyed by decisionRef: a decision is in flight from the act until its outcome returns.\n const [processing, setProcessing] = React.useState<ReadonlySet<string>>(() => new Set());\n const [notices, setNotices] = React.useState<ReadonlyMap<string, string>>(() => new Map());\n const [reassignCandidates, setReassignCandidates] = React.useState<ReadonlyMap<string, readonly AI_ApprovalReassignCandidate[]>>(() => new Map());\n\n const run = React.useCallback(async (decisionRef: string, decisionAct: HumanDecision_Act, request: HumanDecision_ActRequest) => {\n setProcessing((previous) => new Set(previous).add(decisionRef));\n try {\n const outcome = await act(decisionRef, decisionAct, request);\n const notice = noticeOfOutcome(outcome, t);\n setNotices((previous) => {\n const next = new Map(previous);\n if (notice === undefined) next.delete(decisionRef); else next.set(decisionRef, notice);\n return next;\n });\n } catch {\n // Not an outcome the server reported (a network failure): say it did not take, and leave it answerable.\n setNotices((previous) => new Map(previous).set(decisionRef, t(\"noticeNotActionable\")));\n } finally {\n setProcessing((previous) => {\n const next = new Set(previous);\n next.delete(decisionRef);\n return next;\n });\n }\n }, [act, t]);\n\n const items: AI_ApprovalQueueItem[] = React.useMemo(() => decisions.map((card) => ({\n approvalId: card.decisionRef,\n executionId: card.executionId,\n systemRef: card.systemRef,\n // #2526: the assistant by its own name, never its identifier; the risk the call's GATE declares, absent when none.\n systemName: card.systemDisplayName,\n riskLevel: card.riskLevel,\n // #2526: a decision asking its own question is answered by its own options.\n question: decisionQuestionOf(card, t),\n holderNotice: describeDecisionHolder(card.route, t, roleLabel, formatDateTime),\n requesterNotice: describeDecisionRequester(card.requesterKind, t),\n ...describeInboxCard(card, t, roleLabel, toolLabel, operationLabel),\n expiresAt: card.expiresAt ? new Date(card.expiresAt) : undefined,\n createdAt: new Date(card.requestedAt),\n // Only the acts the server says this person may perform — computed with the rule every act is checked by.\n // The inbox's Escalate names nobody, so it is offered only where the gate declares where escalations go;\n // handing it to a person of the reviewer's choosing is Reassign.\n canEscalate: card.permittedActs.includes(HumanDecision_Act.ESCALATE) && card.declaresEscalationTarget,\n canClaim: card.permittedActs.includes(HumanDecision_Act.CLAIM),\n canUnclaim: card.permittedActs.includes(HumanDecision_Act.UNCLAIM),\n canReassign: card.permittedActs.includes(HumanDecision_Act.REASSIGN),\n reassignCandidates: reassignCandidates.get(card.decisionRef),\n actionNotice: notices.get(card.decisionRef),\n // #1628 — the next deadline, or why its deadlines are paused; Pause only with a declared reason to name.\n canPauseClock: card.permittedActs.includes(HumanDecision_Act.PAUSE_CLOCK) && !card.clockPause && card.pauseStates.length > 0,\n canResumeClock: card.permittedActs.includes(HumanDecision_Act.RESUME_CLOCK) && !!card.clockPause,\n // A pause state is the APPLICATION's identifier, shown as its word (#1864) — see `describePauseState`.\n pauseStateOptions: card.pauseStates.map((pauseState) => ({ value: pauseState, label: describePauseState(pauseState, tSystemEnum) })),\n deadlineNotice: card.nextDeadline\n ? t(card.nextDeadline.kind === ReviewDeadlineKind.CLAIM ? \"deadlineClaimBy\" : \"deadlineDecisionBy\", { when: formatDateTime(card.nextDeadline.dueAt) })\n : undefined,\n clockPausedNotice: card.clockPause ? t(\"clockPausedIn\", { pauseState: describePauseState(card.clockPause.pauseStateRef, tSystemEnum) }) : undefined,\n // #1921 — the reviewer may give a reason from the application's vocabulary when correcting the agent, and may\n // CORRECT it by editing the call: the act request carries `modifiedToolArgs`, which the server re-validates against\n // the tool's own schema. Only on a tool approval — a representative admission has no call to edit and no agent to correct.\n reasonCodeOptions: describeReasonCodeOptions(card.reasonCodes, tSystemEnum),\n allowArgumentModification: card.plane === HumanDecision_Plane.CONVERSATIONAL,\n argumentsSchema: card.toolInputSchema as SerializableZodSchema | undefined,\n })), [decisions, reassignCandidates, notices, t, roleLabel, toolLabel, operationLabel, tSystemEnum, formatDateTime]);\n\n /**\n * An answer in the one answer shape: the option chosen, and no values. Which option refs \"approve\" and \"deny\" mean\n * depends on the decision's plane — a tool approval's, or a representative admission's (#1612) — so the card decides.\n */\n const answer = React.useCallback((decisionRef: string, approve: boolean, comment?: string, modifiedToolArgs?: Record<string, unknown>, reasonCode?: string) => {\n const plane = decisions.find((card) => card.decisionRef === decisionRef)?.plane;\n const options = plane ? HUMAN_DECISION_VERDICT_OPTIONS_BY_PLANE[plane] : undefined;\n if (!options) {\n // A plane whose options this inbox does not offer: say it cannot be answered here, and send nothing.\n setNotices((previous) => new Map(previous).set(decisionRef, t(\"noticeNotActionable\")));\n return;\n }\n const optionRef = approve ? options.approve : options.deny;\n void run(decisionRef, HumanDecision_Act.ANSWER, {\n answer: { decisionId: decisionRef, optionRef, values: [] },\n // #2903: the presentation the reviewer read; the server refuses an answer naming none, or one no longer current.\n ...presentationEchoOf(decisions, decisionRef),\n ...(comment ? { reason: comment } : {}),\n // Only when the reviewer edited the call: an absent field means \"run it as proposed\" (#566).\n ...(modifiedToolArgs ? { modifiedToolArgs } : {}),\n // Why the reviewer corrected the agent (#1921); refused with REASON_CODE_REJECTED unless the application declares it.\n ...(reasonCode ? { reasonCode } : {}),\n });\n }, [run, decisions, t]);\n\n const handleReassignOpen = React.useCallback((decisionRef: string) => {\n setReassignCandidates((previous) => {\n const next = new Map(previous);\n next.delete(decisionRef);\n return next;\n });\n void candidates(decisionRef)\n .then((people) => setReassignCandidates((previous) => new Map(previous).set(\n decisionRef,\n // The membership's email is how a same-organization reviewer tells people apart; it is data, not a label.\n people.map((person) => ({ value: person.userId, label: person.email ?? person.userId })),\n )))\n .catch(() => setReassignCandidates((previous) => new Map(previous).set(decisionRef, [])));\n }, [candidates]);\n\n return (\n <AI_ApprovalQueue\n items={items}\n onApprove={(decisionRef, comment, modifiedToolArgs, reasonCode) => answer(decisionRef, true, comment, modifiedToolArgs, reasonCode)}\n onDeny={(decisionRef, comment, reasonCode) => answer(decisionRef, false, comment, undefined, reasonCode)}\n onEscalate={(decisionRef, comment) => void run(decisionRef, HumanDecision_Act.ESCALATE, comment ? { reason: comment } : {})}\n // #2526: the option the reviewer chose and the values it carries, in the one answer shape the server checks against\n // the decision's own request (an option it never offered, or values an option does not take, is refused).\n onAnswer={(decisionRef, optionRef, values, comment, reasonCode) => void run(decisionRef, HumanDecision_Act.ANSWER, {\n answer: { decisionId: decisionRef, optionRef, values: [...values] },\n ...presentationEchoOf(decisions, decisionRef),\n ...(comment ? { reason: comment } : {}),\n // #2539: an actor question that reviews an agent's work may carry a declared reason, as a tool approval does.\n ...(reasonCode ? { reasonCode } : {}),\n })}\n onClaim={(decisionRef) => void run(decisionRef, HumanDecision_Act.CLAIM, {})}\n onUnclaim={(decisionRef) => void run(decisionRef, HumanDecision_Act.UNCLAIM, {})}\n onReassignOpen={handleReassignOpen}\n onReassign={(decisionRef, targetUserId, comment) => void run(decisionRef, HumanDecision_Act.REASSIGN, { targetUserId, ...(comment ? { reason: comment } : {}) })}\n onPauseClock={(decisionRef, pauseStateRef) => void run(decisionRef, HumanDecision_Act.PAUSE_CLOCK, { pauseStateRef })}\n onResumeClock={(decisionRef) => void run(decisionRef, HumanDecision_Act.RESUME_CLOCK, {})}\n processingIds={processing as Set<string>}\n // #2526: a read still settling, and a read that failed, are states the inbox SHOWS — never an empty inbox.\n isLoading={readState === PendingDecisionsReadState.LOADING}\n loadFailed={readState === PendingDecisionsReadState.FAILED}\n onRetry={() => { void refresh(); }}\n {...props}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"approval.js","sourceRoot":"","sources":["../../../../src/components/flows-actors/approval.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,kBAAkB,EAClB,gBAAgB,GAQjB,MAAM,8DAA8D,CAAC;AACtE,OAAO,EACL,iCAAiC,EACjC,2BAA2B,EAC3B,wBAAwB,EACxB,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,EACjB,4BAA4B,EAC5B,mBAAm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,2GAA2G;gBAC3G,SAAS,EAAE,SAAS,KAAK,yBAAyB,CAAC,OAAO,EAC1D,UAAU,EAAE,SAAS,KAAK,yBAAyB,CAAC,MAAM,EAC1D,OAAO,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC,KAC9B,KAAK,GACT,EACD,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CACtB,KAAC,oBAAoB,IAAyB,WAAW,EAAE,KAAK,CAAC,WAAW,KAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAxG,KAAK,CAAC,WAAW,CAA2F,CACxI,CAAC,IACC,CACJ,CAAC;AACJ,CAAC","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n AI_ApprovalRequest,\n AI_ApprovalQueue,\n type AI_ApprovalQueueItem,\n type AI_ApprovalReasonCodeOption,\n type AI_ApprovalReassignCandidate,\n type AI_ApprovalRequestProps,\n type AI_ApprovalQueueProps,\n type AI_DecisionAnswerValue,\n type AI_DecisionQuestion,\n} from \"~wildo-frontend-lib/components/ai-elements/decision/approval\";\nimport {\n AGENT_WORK_REASON_CODE_VOCABULARY,\n ApplicationConfigVocabulary,\n FlowsActorsToolLabelSlot,\n flowsActorsToolLabelKey,\n flowsActorsToolLabelScope,\n HumanDecision_Act,\n HumanDecision_ActOutcomeKind,\n HumanDecision_Plane,\n HumanDecision_RefusalReason,\n HumanDecision_RequesterKind,\n HumanDecision_RouteKind,\n HumanDecisionPhraseKind,\n HUMAN_DECISION_INBOX_FOCUS_PARAM,\n HUMAN_DECISION_VERDICT_OPTIONS_BY_PLANE,\n ReviewDeadlineKind,\n describeHumanDecisionCard,\n humanDecisionAsksItsOwnQuestion,\n humanDecisionOptionPhrase,\n humanDecisionPresentedRowsOf,\n type HumanDecisionPhrase,\n type HumanDecision_ActOutcome,\n type HumanDecision_ActRequest,\n type HumanDecision_PendingCard,\n type HumanDecision_Request,\n} from \"@wildo-ai/saas-models\";\nimport { PendingDecisionsReadState, usePendingDecisions } from \"~wildo-frontend-lib/core/flows-actors/usePendingDecisions\";\nimport { useFlowsActors } from \"~wildo-frontend-lib/core/flows-actors/useFlowsActors\";\nimport type { ComponentProps } from \"react\";\nimport type { SerializableZodSchema } from \"@wildo-ai/zod-decorators\";\nimport { FrontendComponentType, LabellingTypes, ResourceOperationTextSlot } from \"@wildo-ai/presets-components-models\"\nimport { useI18n } from \"~wildo-frontend-lib/core/i18n/useI18n\";\nimport { describeApprovalModificationRefusal } from \"~wildo-frontend-lib/components/flows-actors/approval-modification-refusal.utils\";\nimport { DecisionApprovalSeal } from \"~wildo-frontend-lib/components/data-display/approval-seal\";\n\n/** How many decisions answered in this inbox keep their seal shown under it, newest first (#2913). */\nconst DECIDED_SEALS_SHOWN = 5;\n\n//===============================================================\n// Flows-Actors Approval Wrappers\n//\n// Thin context-wired wrappers over the preset decision components.\n//\n// - FlowsActors_ApprovalRequest answers a decision IN its conversation, over the socket the turn runs on.\n// - FlowsActors_ApprovalQueue is the person's INBOX: every decision they may act on, read from the server\n// (#1594 D6), answered and moved over REST.\n//\n// A decision with options of its OWN — an actor system's question, with its fields — is answered in the inbox too\n// (#2526): its card carries the request, and the inbox draws its options in place of Approve and Deny and sends the\n// chosen one, with the field values, in the one answer shape. Two standalone wrappers that answered such a decision\n// outside any list (FlowsActors_DecisionRequest, FlowsActors_HumanInputRequest) had no consumer and were folded into\n// this one path; since #2539 an application raises those decisions on its own actor plane.\n//===============================================================\n\n/**\n * What an act came to, in the approval's own labels. Total over the outcome vocabulary, so an outcome added\n * tomorrow is a compile error here rather than a silent act.\n */\nfunction noticeOfOutcome(\n outcome: HumanDecision_ActOutcome,\n t: (labelRef: string, params?: Record<string, string>) => string,\n): string | undefined {\n // #3316: the arguments a refusal is about, by name: the inbox has no error payload, and the values may all be valid.\n const named = { arguments: (outcome.argumentNames ?? []).join(', ') || t(\"noticeTheseArguments\") };\n const byKind: Readonly<Record<HumanDecision_ActOutcomeKind, string | undefined>> = {\n [HumanDecision_ActOutcomeKind.APPLIED]: undefined,\n // An admitted person's refused clock act names why (#1628); anything else stays one undisclosing notice.\n // #2903: the request changed since it was read; the list just re-read shows it as it is now.\n [HumanDecision_ActOutcomeKind.NOT_ACTIONABLE]: outcome.reason === HumanDecision_RefusalReason.PRESENTATION_STALE ? t(\"noticePresentationStale\")\n : outcome.reason === HumanDecision_RefusalReason.CLOCK_ALREADY_PAUSED ? t(\"noticeClockAlreadyPaused\")\n : outcome.reason === HumanDecision_RefusalReason.CLOCK_NOT_PAUSED ? t(\"noticeClockNotPaused\")\n : outcome.reason === HumanDecision_RefusalReason.PAUSE_STATE_NOT_DECLARED ? t(\"noticePauseStateNotDeclared\")\n : t(\"noticeNotActionable\"),\n [HumanDecision_ActOutcomeKind.LAPSED]: t(\"noticeLapsed\"),\n [HumanDecision_ActOutcomeKind.REQUESTER_AUTHORITY_LAPSED]: t(\"noticeRequesterAuthorityLapsed\"),\n // An edit pointing the call at a record the answerer may not reach says so (#2734): the inbox gets no error payload,\n // only the outcome, so its reason is what tells a representative to put the arguments back.\n // Likewise a call that would not run as read (#3295): the values may be valid, so \"refused\" alone says nothing.\n [HumanDecision_ActOutcomeKind.MODIFICATION_REJECTED]: outcome.reason === HumanDecision_RefusalReason.EDITED_CALL_NOT_REACHABLE\n ? t(\"noticeEditedCallNotReachable\", named)\n : outcome.reason === HumanDecision_RefusalReason.CALL_NOT_RUN_AS_READ\n ? t(\"noticeCallNotRunAsRead\", named)\n : outcome.reason === HumanDecision_RefusalReason.CREDENTIAL_NOT_ACCEPTED\n ? t(\"noticeCredentialNotAccepted\", named)\n : outcome.reason === HumanDecision_RefusalReason.CALL_CANNOT_RUN\n ? t(\"noticeCallCannotRun\")\n : outcome.reason === HumanDecision_RefusalReason.ARGUMENTS_CANNOT_BE_CORRECTED\n ? t(\"noticeArgumentsCannotBeCorrected\", named)\n : t(\"noticeModificationRejected\"),\n [HumanDecision_ActOutcomeKind.REASON_CODE_REJECTED]: t(\"noticeReasonCodeRejected\"),\n [HumanDecision_ActOutcomeKind.CONSENT_REQUIRED]: t(\"noticeConsentRequired\"),\n [HumanDecision_ActOutcomeKind.TARGET_REFUSED]: outcome.reason === HumanDecision_RefusalReason.NO_TARGET ? t(\"noticeNoEscalationTarget\") : t(\"noticeTargetRefused\"),\n [HumanDecision_ActOutcomeKind.SUPERSEDED]: t(\"noticeSuperseded\"),\n };\n return byKind[outcome.kind];\n}\n\n/**\n * The presentation a card was read on (#2903), echoed on its answer: the server rebuilds the decision's presentation and\n * refuses an answer naming none, or one that is no longer current, so what is sealed is what this reviewer read.\n */\nfunction presentationEchoOf(decisions: readonly HumanDecision_PendingCard[], decisionRef: string): Pick<HumanDecision_ActRequest, 'presentationId'> {\n const presentationId = decisions.find((card) => card.decisionRef === decisionRef)?.presentationId;\n return presentationId ? { presentationId } : {};\n}\n\n/**\n * The reason picker's options (#1921): each declared code with its word from `system_enums.AgentWorkReasonCode.<code>`.\n *\n * The codes are the APPLICATION's (`agentWorkReview.reasonCodes`); their words live under the framework's named\n * vocabulary, where the labelling pipeline plans one key per declared code. A code nobody has worded yet shows as the\n * code itself — `tSystemEnum` answers the raw value on a miss — which is a missing label that looks missing, never words\n * invented from the identifier. Exported for the pin that holds that fallback.\n */\nexport function describeReasonCodeOptions(\n reasonCodes: readonly string[] | undefined,\n tSystemEnum: (enumName: typeof AGENT_WORK_REASON_CODE_VOCABULARY, enumValue: string) => string,\n): AI_ApprovalReasonCodeOption[] | undefined {\n if (!reasonCodes || reasonCodes.length === 0) return undefined;\n return reasonCodes.map((code) => ({ value: code, label: tSystemEnum(AGENT_WORK_REASON_CODE_VOCABULARY, code) }));\n}\n\n/**\n * A gate's pause states as the words a reviewer reads (#1864): each state's word under the framework's named vocabulary\n * `system_enums.HumanDecisionPauseState.<state>`, which the labelling pipeline plans from every gate's declared\n * `pauseStates`. A state nobody has worded yet shows as itself — `tSystemEnum` answers the raw value on a miss — a\n * missing label that looks missing. Exported for the pin that holds it.\n */\nexport function describePauseState(\n pauseState: string,\n tSystemEnum: (enumName: ApplicationConfigVocabulary.HUMAN_DECISION_PAUSE_STATE, enumValue: string) => string,\n): string {\n return tSystemEnum(ApplicationConfigVocabulary.HUMAN_DECISION_PAUSE_STATE, pauseState);\n}\n\n/**\n * The label namespaces the approval wrappers read beyond their own component: the reason codes' (#1921) and pause\n * states' (#1864) words, and the roles' (#2526 review F3) — the holder line names a role, and `roles` is not an eager\n * section, so without it every ROLE card named the role by its key.\n */\nconst APPROVAL_LABEL_NAMESPACES = [LabellingTypes.SYSTEM_ENUMS, LabellingTypes.ROLES];\n/** The chat card holds a tool approval, never an operation approval, so it loads no resource's operation titles. */\nconst NO_OPERATION_RESOURCES: readonly string[] = [];\n\n//===============================================================\n// FlowsActors_ApprovalRequest\n//\n// A decision answered in the conversation it was raised in.\n//===============================================================\n\nexport type FlowsActors_ApprovalRequestProps = Omit<\n AI_ApprovalRequestProps,\n \"approvalId\" | \"actionDescription\" | \"riskLevel\" | \"onApprove\" | \"onDeny\" | \"onEscalate\" | \"answerable\"\n> & {\n executionId: string;\n};\n\nexport function FlowsActors_ApprovalRequest({\n executionId,\n ...props\n}: FlowsActors_ApprovalRequestProps): React.JSX.Element | null {\n const { executions, respondToApproval, answerQuestion } = useFlowsActors();\n const [processingId, setProcessingId] = React.useState<string | null>(null);\n /**\n * #2913: the decision this card answered, kept once the card's pending decision clears so the card shows its seal in\n * its place. `shown` is what the card showed when it was answered: its decision and its title.\n */\n const [answered, setAnswered] = React.useState<{ readonly decisionRef: string; readonly title: string } | null>(null);\n const shown = React.useRef<{ readonly decisionRef: string; readonly title: string } | null>(null);\n const execution = executions.get(executionId);\n const pendingApproval = execution?.pendingApproval;\n // The paused tool's title is loaded with the card's own words, so the card names the call as the inbox does.\n const pendingToolName = pendingApproval?.toolName;\n const toolNames = React.useMemo(() => (pendingToolName ? [pendingToolName] : []), [pendingToolName]);\n const { t, roleLabel, toolLabel, operationLabel, tComponent, tSystemEnum } = useHumanDecisionWords(toolNames, NO_OPERATION_RESOURCES);\n\n // Every hook runs BEFORE the early return below. React requires the same hooks on every render, and the render\n // that clears `pendingApproval` — the moment a decision is answered — used to run three fewer (#534 fourth\n // review F1).\n const handleApprove = React.useCallback((id: string, comment?: string, modifiedToolArgs?: Record<string, unknown>, reasonCode?: string) => {\n setProcessingId(id);\n setAnswered(shown.current);\n // The reason rides only when given, so an answer without one keeps the call shape it always had.\n respondToApproval(executionId, id, true, comment, modifiedToolArgs, ...(reasonCode ? [reasonCode] : []));\n }, [executionId, respondToApproval]);\n\n const handleDeny = React.useCallback((id: string, comment?: string, reasonCode?: string) => {\n setProcessingId(id);\n setAnswered(shown.current);\n if (reasonCode) respondToApproval(executionId, id, false, comment, undefined, reasonCode);\n else respondToApproval(executionId, id, false, comment);\n }, [executionId, respondToApproval]);\n\n // #2720: the agent's QUESTION is answered with the person's values, or declined — never approved.\n const handleAnswer = React.useCallback((id: string, optionRef: string, values: readonly AI_DecisionAnswerValue[], comment?: string) => {\n setProcessingId(id);\n setAnswered(shown.current);\n answerQuestion(executionId, optionRef, values, comment);\n }, [executionId, answerQuestion]);\n const approvalWord = React.useCallback(\n (labelRef: string) => tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, labelRef as never),\n [tComponent],\n );\n\n // A decision answered and then handed BACK arrives as a new pending approval — a refused edit (#587), or a\n // decision the consent requirement refused (#534). Whatever this component recorded as in flight has been\n // answered, so the decision is answerable again instead of staying disabled until the view remounts.\n React.useEffect(() => {\n setProcessingId(null);\n }, [pendingApproval]);\n\n if (!execution || !pendingApproval) {\n // Answered here and gone from the pending state: the seal of that answer, signed seconds later (#2913). A decision that\n // sealed nothing (or one answered by someone else) answers 404, and the card draws nothing, as before.\n return answered ? <DecisionApprovalSeal decisionRef={answered.decisionRef} description={answered.title} /> : null;\n }\n\n const {\n approvalId, riskLevel, expiresAt, toolName, toolArgs, toolInputSchema, modificationRefusal,\n rejectedToolArgs, routeKind, reasonCodes, reasonCodeRefused, question, presentation,\n } = pendingApproval;\n /*\n * The card's title, in this reader's words (#3201): the decision's presentation when the server sealed one, else the\n * tool-approval title every decision surface derives (`describeHumanDecisionCard`), worded exactly as the inbox words\n * the same decision. The pause carries typed state only: the server's English `Waiting for approval to run \"<tool>\".`,\n * built from the tool's IDENTIFIER and rendered here as written, is gone from the announcement.\n */\n const actionDescription = wordHumanDecisionPhrase(\n presentation?.title ?? describeHumanDecisionCard({ plane: HumanDecision_Plane.CONVERSATIONAL, toolName: toolName ?? '' }).title,\n t, roleLabel, toolLabel, operationLabel,\n );\n shown.current = pendingApproval.decisionRef ? { decisionRef: pendingApproval.decisionRef, title: actionDescription } : null;\n /*\n * Only an OWNER-routed decision is answered here. One routed to an assignee or a role is answered by a\n * reviewer from their inbox, and the person whose conversation this is may not answer it (separation of\n * duties, #1594) — so it shows as waiting, with nothing to press that the server would refuse.\n *\n * There is no Escalate here either. It used to send a DENIAL prefixed `[ESCALATED]`, which refused the call\n * and escalated nothing; an OWNER route cannot be escalated at all, and a reviewer escalates from the inbox.\n */\n const answerable = routeKind === undefined || routeKind === HumanDecision_RouteKind.OWNER;\n\n if (question) {\n // #2720: the agent asks its person. Its questions, through their form, in place of the call and its arguments.\n return (\n <AI_ApprovalRequest\n approvalId={approvalId}\n actionDescription={question.title}\n executionId={executionId}\n systemRef={execution.systemRef}\n expiresAt={expiresAt}\n answerable={answerable}\n question={humanDecisionQuestionOf(question, approvalWord)}\n onAnswer={handleAnswer}\n isProcessing={processingId === approvalId}\n {...props}\n />\n );\n }\n\n return (\n <AI_ApprovalRequest\n approvalId={approvalId}\n actionDescription={actionDescription}\n riskLevel={riskLevel}\n executionId={executionId}\n systemRef={execution.systemRef}\n expiresAt={expiresAt}\n answerable={answerable}\n // A refused reason code leaves the approval standing (#1921): it is back on screen, and says why in its own labels.\n actionNotice={!answerable\n ? tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, \"awaitingReview\")\n : reasonCodeRefused ? tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, \"noticeReasonCodeRejected\") : undefined}\n reasonCodeOptions={answerable ? describeReasonCodeOptions(reasonCodes, tSystemEnum) : undefined}\n /*\n * The tool call is WHAT is being approved, and until #528 it did not reach the browser at all.\n * `toolArgs` are the proposed arguments — a person approving \"rename this record\" is approving\n * a specific new title, and an approval surface that hides them is asking for a signature on an\n * unread document.\n *\n * #566 built the carrier for an edited call: the payload takes `modifiedToolArgs`, the server\n * re-validates them against the tool's own `inputSchema`, re-signs the approval over them and\n * records that the decider changed them. So the editor is offered here, where the decision is\n * answered — never where it is only shown.\n */\n allowArgumentModification={answerable}\n toolName={toolName}\n // The call's line names the tool by its title, as the card's title does (#3201).\n toolLabel={toolName ? toolLabel(toolName) : undefined}\n executionContext={toolArgs}\n // #2903: the arguments as the server presented them, rendered verbatim: what the person reads is what is sealed.\n // #2914: then the values of the record the approval covers, which the seal binds too.\n presentedArguments={pendingApproval.presentation ? humanDecisionPresentedRowsOf(pendingApproval.presentation) : undefined}\n argumentsSchema={toolInputSchema}\n // The refusal in the approval's own labels, naming the tool and the offending arguments (#1186).\n argumentModificationError={modificationRefusal\n ? describeApprovalModificationRefusal(modificationRefusal, (labelRef, params) => tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, labelRef, params))\n : undefined}\n rejectedArguments={rejectedToolArgs}\n onApprove={handleApprove}\n onDeny={handleDeny}\n // Released by the effect above whenever the approval is handed back. Not released while the socket is\n // disconnected: `respondToApproval` then sends nothing and leaves the approval exactly as it was, so its\n // identity never changes — a stuck state that predates #534 and is cured by the view remounting.\n isProcessing={processingId === approvalId}\n {...props}\n />\n );\n}\n\n//===============================================================\n// FlowsActors_ApprovalQueue\n//\n// The person's inbox: every decision they may act on, from the server.\n//===============================================================\n\n/**\n * Who holds a listed decision now, in the approval's own words (#2526). Total over the route vocabulary.\n *\n * The inbox lists only decisions the viewer may ANSWER (#1594 I3), so an ASSIGNEE card is always assigned to the\n * viewer: \"you claimed it\" when they took it from a role, \"assigned to you\" when a resolver, a reassignment or an\n * escalation put it there. A decision a colleague claimed is not in the viewer's list at all. A ROLE card names the role\n * in the roles tree's words, never its key. Exported for the pin that holds it.\n */\nexport function describeDecisionHolder(\n route: HumanDecision_PendingCard['route'],\n t: (labelRef: string, params?: Record<string, string>) => string,\n roleLabel: (roleKey: string) => string,\n formatDateTime: (value: Date | string) => string,\n): string | undefined {\n const byKind: Readonly<Record<HumanDecision_RouteKind, () => string | undefined>> = {\n [HumanDecision_RouteKind.OWNER]: () => t(\"holderOwner\"),\n [HumanDecision_RouteKind.ASSIGNEE]: () => (route.claimedAt ? t(\"holderClaimedByYou\", { when: formatDateTime(route.claimedAt) }) : t(\"holderAssignedToYou\")),\n // A ROLE route always names its role (a gate without one stops the application at startup); none means no line.\n [HumanDecision_RouteKind.ROLE]: () => (route.eligibleRole ? t(\"holderRole\", { role: roleLabel(route.eligibleRole) }) : undefined),\n };\n return byKind[route.kind]();\n}\n\n/**\n * Who raised a listed decision, when that is worth saying (#2526). Total over the requester vocabulary.\n *\n * A person's own request needs no line: the holder line already says whose conversation it is when it is the viewer's,\n * and naming another person by id would show an identifier (naming people is #1852). What a reviewer must not miss is\n * a request with NO person behind it — an autonomous agent, raised by a machine — or one raised through an application a\n * person connected, which resumes only while that delegation holds.\n */\nconst REQUESTER_LABEL: Readonly<Record<HumanDecision_RequesterKind, string | undefined>> = {\n [HumanDecision_RequesterKind.USER]: undefined,\n [HumanDecision_RequesterKind.MACHINE]: \"requesterAutonomousAgent\",\n [HumanDecision_RequesterKind.DELEGATED_CLIENT]: \"requesterConnectedApplication\",\n};\n\nexport function describeDecisionRequester(\n requesterKind: HumanDecision_RequesterKind,\n t: (labelRef: string) => string,\n): string | undefined {\n const labelRef = REQUESTER_LABEL[requesterKind];\n return labelRef ? t(labelRef) : undefined;\n}\n\n/**\n * A phrase of the shared wording (`describeHumanDecisionCard`), in this inbox's words: an approval label through `t`, a\n * role through the roles label tree, a tool through its title in the tool label tree (#2551), a resource operation\n * through its title in the resource label tree (#2288), a host's own words as written.\n */\nfunction wordHumanDecisionPhrase(\n phrase: HumanDecisionPhrase,\n t: (labelRef: string, params?: Record<string, string>) => string,\n roleLabel: (roleKey: string) => string,\n toolLabel: (toolName: string) => string,\n // With no wording function, the operation's label key: a missing label looks missing.\n operationLabel: (resourceType: string, operationIdentifier: string) => string = (resourceType, operationIdentifier) =>\n `${LabellingTypes.RESOURCES}.${resourceType}.operations.${operationIdentifier}.${ResourceOperationTextSlot.TITLE}`,\n): string {\n switch (phrase.kind) {\n case HumanDecisionPhraseKind.LABEL:\n return phrase.params\n ? t(phrase.labelRef, Object.fromEntries(Object.entries(phrase.params).map(([key, value]) => [key, typeof value === 'object' ? wordHumanDecisionPhrase(value, t, roleLabel, toolLabel, operationLabel) : String(value)])))\n : t(phrase.labelRef);\n case HumanDecisionPhraseKind.ROLE:\n return roleLabel(phrase.roleKey);\n case HumanDecisionPhraseKind.TOOL:\n return toolLabel(phrase.toolName);\n case HumanDecisionPhraseKind.RESOURCE_OPERATION:\n return operationLabel(phrase.resourceType, phrase.operationIdentifier);\n case HumanDecisionPhraseKind.TEXT:\n return phrase.text;\n default: {\n const unhandled: never = phrase;\n return unhandled;\n }\n }\n}\n\n/**\n * What one inbox card SAYS, from the wording every decision surface shares (`describeHumanDecisionCard`): the same\n * line a chat card posted for this decision carries. A tool approval also shows the tool and its proposed arguments;\n * a representative admission (#1612) and a card asking its own question show none — there is no tool call.\n */\nfunction describeInboxCard(\n card: HumanDecision_PendingCard,\n t: (labelRef: string, params?: Record<string, string>) => string,\n roleLabel: (roleKey: string) => string = (roleKey) => roleKey,\n toolLabel: (toolName: string) => string = (toolName) => toolName,\n operationLabel?: (resourceType: string, operationIdentifier: string) => string,\n): Pick<AI_ApprovalQueueItem, 'actionDescription' | 'toolName' | 'toolLabel' | 'executionContext' | 'presentedArguments'> {\n // #2903: the values as the server presented them, rendered verbatim, so what the reviewer reads is what is sealed.\n // #2914: with the values of the record the approval covers.\n const presented = card.presentation ? { presentedArguments: humanDecisionPresentedRowsOf(card.presentation) } : {};\n const actionDescription = wordHumanDecisionPhrase(card.presentation?.title ?? describeHumanDecisionCard(card).title, t, roleLabel, toolLabel, operationLabel);\n // #2288: an operation approval shows the values the requester sent, as a tool approval shows its arguments.\n if (card.plane === HumanDecision_Plane.OPERATION_APPROVAL && card.operationApproval) {\n return { actionDescription, executionContext: card.operationApproval.requestedValues, ...presented };\n }\n const isRepresentativeAdmission = card.plane === HumanDecision_Plane.REPRESENTATIVE_ADMISSION && !!card.representativeAdmission;\n if (isRepresentativeAdmission || humanDecisionAsksItsOwnQuestion(card)) return { actionDescription };\n return { actionDescription, toolName: card.toolName, toolLabel: toolLabel(card.toolName), executionContext: card.toolArgs, ...presented };\n}\n\n/**\n * A request as the card asks it: its reason, its options and its fields with their form. An option the engine wrote is\n * worded by the approval label it names (`labelRef`, #2754), through `word` in this reader's language; any other option\n * carries the words its host wrote. The decision is the shared wording's (`humanDecisionOptionPhrase`), so the chat card,\n * the inbox and a notice cannot word one option two ways.\n */\nexport function humanDecisionQuestionOf(request: HumanDecision_Request, word: (labelRef: string) => string): AI_DecisionQuestion {\n return {\n description: request.description,\n options: request.options.map((option) => ({\n ref: option.ref,\n // An option phrase is a label or text: no role and no tool to word, so both pass through.\n label: wordHumanDecisionPhrase(humanDecisionOptionPhrase(option), word, (roleKey) => roleKey, (toolName) => toolName),\n intent: option.intent,\n ...(option.description ? { description: option.description } : {}),\n })),\n fields: request.fields,\n ...(request.form ? { form: request.form } : {}),\n };\n}\n\n/**\n * A card's own question, when it asks one (#2526): the request it carries, on a plane whose options are not the inbox's\n * Approve and Deny — or, on a plane that has those, a request that asks FIELDS, which only an agent's question to its\n * person does (#2720). `undefined` for a request the inbox words itself.\n */\nexport function decisionQuestionOf(card: Pick<HumanDecision_PendingCard, 'plane' | 'request'>, word: (labelRef: string) => string): AI_DecisionQuestion | undefined {\n if (!card.request) return undefined;\n if (!humanDecisionAsksItsOwnQuestion(card)) return undefined;\n // An option is worded by the label it names, on any plane (#2754): an agent's question and a flow's person step name\n // theirs. A host that named its own options keeps its words, whatever refs it chose (#2720 review L6).\n return humanDecisionQuestionOf(card.request, word);\n}\n\nexport type FlowsActors_ApprovalQueueProps = Omit<\n AI_ApprovalQueueProps,\n | \"items\" | \"onApprove\" | \"onDeny\" | \"onEscalate\" | \"onAnswer\" | \"onClaim\" | \"onUnclaim\" | \"onReassignOpen\" | \"onReassign\" | \"onPauseClock\" | \"onResumeClock\"\n | \"processingIds\" | \"isLoading\" | \"loadFailed\" | \"onRetry\"\n>;\n\n/**\n * The words a pending decision is read in, for every surface that shows one: an approval label through `t`, a role\n * through the roles label tree, a tool through its title in the tool label tree (#2551), a resource operation through its\n * title. The inbox and the chat card (#3201) both word a decision through these, so the two cannot read one decision two\n * ways, and neither shows a sentence the server wrote.\n *\n * `toolNames` and `operationResources` name the label scopes to load, so the titles are there when the card renders.\n */\nfunction useHumanDecisionWords(toolNames: readonly string[], operationResources: readonly string[]) {\n const labelKeys = React.useMemo(\n () => [...APPROVAL_LABEL_NAMESPACES, ...toolNames.map(flowsActorsToolLabelScope), ...operationResources.map((type) => `${LabellingTypes.RESOURCES}.${type}`)],\n [toolNames, operationResources],\n );\n const { t: tKey, tComponent, tRole, tSystemEnum, tResourceOperation, formatDateTime } = useI18n({ component: FrontendComponentType.LOW_LEVEL_AI_APPROVAL, keys: labelKeys });\n const t = React.useCallback(\n (labelRef: string, params?: Record<string, string>) => tComponent(FrontendComponentType.LOW_LEVEL_AI_APPROVAL, labelRef as never, params),\n [tComponent],\n );\n // A role is worded by the roles label tree, never shown as its identifier.\n const roleLabel = React.useCallback((roleKey: string) => (tRole ? tRole(roleKey, 'label') : roleKey), [tRole]);\n // A tool by its title, as the conversation names the same call; a tool with no words yet by its name.\n const toolLabel = React.useCallback((toolName: string) => {\n const key = flowsActorsToolLabelKey(toolName, FlowsActorsToolLabelSlot.TITLE);\n const resolved = tKey(key);\n return resolved === key || resolved.length === 0 ? toolName : resolved;\n }, [tKey]);\n // An operation by its title, as the application names it everywhere; with no title generated, its key (missing looks missing).\n const operationLabel = React.useCallback(\n (resourceType: string, operationIdentifier: string) => tResourceOperation(resourceType, operationIdentifier, ResourceOperationTextSlot.TITLE),\n [tResourceOperation],\n );\n return { t, roleLabel, toolLabel, operationLabel, tComponent, tSystemEnum, formatDateTime };\n}\n\n/**\n * The inbox's cards with the one a link named first (#2923): a chat card that cannot answer a decision links to it here\n * (`humanDecisionInboxPathOf`), and the person lands on it. The others keep their order.\n */\nexport function withFocusedDecisionFirst<T extends { readonly decisionRef: string }>(cards: readonly T[], search: string): readonly T[] {\n const focused = new URLSearchParams(search).get(HUMAN_DECISION_INBOX_FOCUS_PARAM);\n if (!focused) return cards;\n const named = cards.filter((card) => card.decisionRef === focused);\n return named.length === 0 ? cards : [...named, ...cards.filter((card) => card.decisionRef !== focused)];\n}\n\nexport function FlowsActors_ApprovalQueue(props: FlowsActors_ApprovalQueueProps): React.JSX.Element {\n const { decisions: listed, readState, refresh, act, candidates } = usePendingDecisions();\n // #2923: a link to one decision lists it first.\n const decisions = React.useMemo(() => withFocusedDecisionFirst(listed, window.location.search), [listed]);\n // The words of every tool a listed decision would run (#2551), loaded with the inbox's own.\n const toolNames = React.useMemo(() => [...new Set(decisions.map((card) => card.toolName).filter((name): name is string => !!name))].sort(), [decisions]);\n // #2288: the resources whose held operations are listed, so each operation is named by its title.\n const operationResources = React.useMemo(\n () => [...new Set(decisions.map((card) => card.operationApproval?.resourceType).filter((type): type is string => !!type))].sort(),\n [decisions],\n );\n const { t, roleLabel, toolLabel, operationLabel, tSystemEnum, formatDateTime } = useHumanDecisionWords(toolNames, operationResources);\n // Keyed by decisionRef: a decision is in flight from the act until its outcome returns.\n const [processing, setProcessing] = React.useState<ReadonlySet<string>>(() => new Set());\n const [notices, setNotices] = React.useState<ReadonlyMap<string, string>>(() => new Map());\n const [reassignCandidates, setReassignCandidates] = React.useState<ReadonlyMap<string, readonly AI_ApprovalReassignCandidate[]>>(() => new Map());\n /**\n * #2913: the decisions this person answered here. An answered card leaves the pending list, so its seal is shown under\n * the list instead: signed seconds after the answer, then current or not over the record it is about. Each keeps the\n * title its card showed, read from `cardTitles` when the answer was sent.\n */\n const [decided, setDecided] = React.useState<ReadonlyArray<{ readonly decisionRef: string; readonly title?: string }>>([]);\n const cardTitles = React.useRef<ReadonlyMap<string, string>>(new Map());\n\n const run = React.useCallback(async (decisionRef: string, decisionAct: HumanDecision_Act, request: HumanDecision_ActRequest) => {\n setProcessing((previous) => new Set(previous).add(decisionRef));\n const title = cardTitles.current.get(decisionRef);\n try {\n const outcome = await act(decisionRef, decisionAct, request);\n if (decisionAct === HumanDecision_Act.ANSWER && outcome.kind === HumanDecision_ActOutcomeKind.APPLIED) {\n setDecided((previous) => [{ decisionRef, ...(title ? { title } : {}) }, ...previous.filter((entry) => entry.decisionRef !== decisionRef)].slice(0, DECIDED_SEALS_SHOWN));\n }\n const notice = noticeOfOutcome(outcome, t);\n setNotices((previous) => {\n const next = new Map(previous);\n if (notice === undefined) next.delete(decisionRef); else next.set(decisionRef, notice);\n return next;\n });\n } catch {\n // Not an outcome the server reported (a network failure): say it did not take, and leave it answerable.\n setNotices((previous) => new Map(previous).set(decisionRef, t(\"noticeNotActionable\")));\n } finally {\n setProcessing((previous) => {\n const next = new Set(previous);\n next.delete(decisionRef);\n return next;\n });\n }\n }, [act, t]);\n\n const items: AI_ApprovalQueueItem[] = React.useMemo(() => decisions.map((card) => ({\n approvalId: card.decisionRef,\n executionId: card.executionId,\n systemRef: card.systemRef,\n // #2526: the assistant by its own name, never its identifier; the risk the call's GATE declares, absent when none.\n systemName: card.systemDisplayName,\n riskLevel: card.riskLevel,\n // #2526: a decision asking its own question is answered by its own options.\n question: decisionQuestionOf(card, t),\n holderNotice: describeDecisionHolder(card.route, t, roleLabel, formatDateTime),\n requesterNotice: describeDecisionRequester(card.requesterKind, t),\n ...describeInboxCard(card, t, roleLabel, toolLabel, operationLabel),\n expiresAt: card.expiresAt ? new Date(card.expiresAt) : undefined,\n createdAt: new Date(card.requestedAt),\n // Only the acts the server says this person may perform — computed with the rule every act is checked by.\n // The inbox's Escalate names nobody, so it is offered only where the gate declares where escalations go;\n // handing it to a person of the reviewer's choosing is Reassign.\n canEscalate: card.permittedActs.includes(HumanDecision_Act.ESCALATE) && card.declaresEscalationTarget,\n canClaim: card.permittedActs.includes(HumanDecision_Act.CLAIM),\n canUnclaim: card.permittedActs.includes(HumanDecision_Act.UNCLAIM),\n canReassign: card.permittedActs.includes(HumanDecision_Act.REASSIGN),\n reassignCandidates: reassignCandidates.get(card.decisionRef),\n actionNotice: notices.get(card.decisionRef),\n // #1628 — the next deadline, or why its deadlines are paused; Pause only with a declared reason to name.\n canPauseClock: card.permittedActs.includes(HumanDecision_Act.PAUSE_CLOCK) && !card.clockPause && card.pauseStates.length > 0,\n canResumeClock: card.permittedActs.includes(HumanDecision_Act.RESUME_CLOCK) && !!card.clockPause,\n // A pause state is the APPLICATION's identifier, shown as its word (#1864) — see `describePauseState`.\n pauseStateOptions: card.pauseStates.map((pauseState) => ({ value: pauseState, label: describePauseState(pauseState, tSystemEnum) })),\n deadlineNotice: card.nextDeadline\n ? t(card.nextDeadline.kind === ReviewDeadlineKind.CLAIM ? \"deadlineClaimBy\" : \"deadlineDecisionBy\", { when: formatDateTime(card.nextDeadline.dueAt) })\n : undefined,\n clockPausedNotice: card.clockPause ? t(\"clockPausedIn\", { pauseState: describePauseState(card.clockPause.pauseStateRef, tSystemEnum) }) : undefined,\n // #1921 — the reviewer may give a reason from the application's vocabulary when correcting the agent, and may\n // CORRECT it by editing the call: the act request carries `modifiedToolArgs`, which the server re-validates against\n // the tool's own schema. Only on a tool approval — a representative admission has no call to edit and no agent to correct.\n reasonCodeOptions: describeReasonCodeOptions(card.reasonCodes, tSystemEnum),\n allowArgumentModification: card.plane === HumanDecision_Plane.CONVERSATIONAL,\n argumentsSchema: card.toolInputSchema as SerializableZodSchema | undefined,\n })), [decisions, reassignCandidates, notices, t, roleLabel, toolLabel, operationLabel, tSystemEnum, formatDateTime]);\n cardTitles.current = new Map(items.flatMap((item) => (typeof item.actionDescription === 'string' ? [[item.approvalId, item.actionDescription] as const] : [])));\n\n /**\n * An answer in the one answer shape: the option chosen, and no values. Which option refs \"approve\" and \"deny\" mean\n * depends on the decision's plane — a tool approval's, or a representative admission's (#1612) — so the card decides.\n */\n const answer = React.useCallback((decisionRef: string, approve: boolean, comment?: string, modifiedToolArgs?: Record<string, unknown>, reasonCode?: string) => {\n const plane = decisions.find((card) => card.decisionRef === decisionRef)?.plane;\n const options = plane ? HUMAN_DECISION_VERDICT_OPTIONS_BY_PLANE[plane] : undefined;\n if (!options) {\n // A plane whose options this inbox does not offer: say it cannot be answered here, and send nothing.\n setNotices((previous) => new Map(previous).set(decisionRef, t(\"noticeNotActionable\")));\n return;\n }\n const optionRef = approve ? options.approve : options.deny;\n void run(decisionRef, HumanDecision_Act.ANSWER, {\n answer: { decisionId: decisionRef, optionRef, values: [] },\n // #2903: the presentation the reviewer read; the server refuses an answer naming none, or one no longer current.\n ...presentationEchoOf(decisions, decisionRef),\n ...(comment ? { reason: comment } : {}),\n // Only when the reviewer edited the call: an absent field means \"run it as proposed\" (#566).\n ...(modifiedToolArgs ? { modifiedToolArgs } : {}),\n // Why the reviewer corrected the agent (#1921); refused with REASON_CODE_REJECTED unless the application declares it.\n ...(reasonCode ? { reasonCode } : {}),\n });\n }, [run, decisions, t]);\n\n const handleReassignOpen = React.useCallback((decisionRef: string) => {\n setReassignCandidates((previous) => {\n const next = new Map(previous);\n next.delete(decisionRef);\n return next;\n });\n void candidates(decisionRef)\n .then((people) => setReassignCandidates((previous) => new Map(previous).set(\n decisionRef,\n // The membership's email is how a same-organization reviewer tells people apart; it is data, not a label.\n people.map((person) => ({ value: person.userId, label: person.email ?? person.userId })),\n )))\n .catch(() => setReassignCandidates((previous) => new Map(previous).set(decisionRef, [])));\n }, [candidates]);\n\n return (\n <>\n <AI_ApprovalQueue\n items={items}\n onApprove={(decisionRef, comment, modifiedToolArgs, reasonCode) => answer(decisionRef, true, comment, modifiedToolArgs, reasonCode)}\n onDeny={(decisionRef, comment, reasonCode) => answer(decisionRef, false, comment, undefined, reasonCode)}\n onEscalate={(decisionRef, comment) => void run(decisionRef, HumanDecision_Act.ESCALATE, comment ? { reason: comment } : {})}\n // #2526: the option the reviewer chose and the values it carries, in the one answer shape the server checks against\n // the decision's own request (an option it never offered, or values an option does not take, is refused).\n onAnswer={(decisionRef, optionRef, values, comment, reasonCode) => void run(decisionRef, HumanDecision_Act.ANSWER, {\n answer: { decisionId: decisionRef, optionRef, values: [...values] },\n ...presentationEchoOf(decisions, decisionRef),\n ...(comment ? { reason: comment } : {}),\n // #2539: an actor question that reviews an agent's work may carry a declared reason, as a tool approval does.\n ...(reasonCode ? { reasonCode } : {}),\n })}\n onClaim={(decisionRef) => void run(decisionRef, HumanDecision_Act.CLAIM, {})}\n onUnclaim={(decisionRef) => void run(decisionRef, HumanDecision_Act.UNCLAIM, {})}\n onReassignOpen={handleReassignOpen}\n onReassign={(decisionRef, targetUserId, comment) => void run(decisionRef, HumanDecision_Act.REASSIGN, { targetUserId, ...(comment ? { reason: comment } : {}) })}\n onPauseClock={(decisionRef, pauseStateRef) => void run(decisionRef, HumanDecision_Act.PAUSE_CLOCK, { pauseStateRef })}\n onResumeClock={(decisionRef) => void run(decisionRef, HumanDecision_Act.RESUME_CLOCK, {})}\n processingIds={processing as Set<string>}\n // #2526: a read still settling, and a read that failed, are states the inbox SHOWS — never an empty inbox.\n isLoading={readState === PendingDecisionsReadState.LOADING}\n loadFailed={readState === PendingDecisionsReadState.FAILED}\n onRetry={() => { void refresh(); }}\n {...props}\n />\n {decided.map((entry) => (\n <DecisionApprovalSeal key={entry.decisionRef} decisionRef={entry.decisionRef} {...(entry.title ? { description: entry.title } : {})} />\n ))}\n </>\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ResourceAutomatedForm.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/automated/ResourceAutomatedForm.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAyF,MAAM,OAAO,CAAC;AAE9G,OAAO,EAAE,aAAa,EAA+B,MAAM,iBAAiB,CAAC;AAkD7E,OAAO,EAAqG,eAAe,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC9K,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wDAAwD,CAAC;AAgC7F,OAAO,EAAE,gCAAgC,EAAE,MAAM,+DAA+D,CAAC;AAqDjH,OAAO,EAIL,KAAK,8BAA8B,EACpC,MAAM,+EAA+E,CAAC;AA4GvF,MAAM,WAAW,0BAA0B;IACzC,sEAAsE;IACtE,eAAe,EAAE,gCAAgC,CAAC;IAElD,6CAA6C;IAC7C,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAEhC,0CAA0C;IAC1C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAEtB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,yDAAyD;IACzD,cAAc,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAE9C,wCAAwC;IACxC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,uGAAuG;IACvG,cAAc,CAAC,EAAE,cAAc,CAAC;IAGhC;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,SAAS,CA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a,EAAE,iBAAiB,EAChC,qBAAqB,EACrB,cAAc,EACd,8BAA8B,EAAE,oCAAoC,GACrE,EAAE,0BAA0B,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAi6FvD"}
1
+ {"version":3,"file":"ResourceAutomatedForm.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/automated/ResourceAutomatedForm.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAyF,MAAM,OAAO,CAAC;AAE9G,OAAO,EAAE,aAAa,EAA+B,MAAM,iBAAiB,CAAC;AAkD7E,OAAO,EAAqG,eAAe,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC9K,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wDAAwD,CAAC;AAgC7F,OAAO,EAAE,gCAAgC,EAAE,MAAM,+DAA+D,CAAC;AAsDjH,OAAO,EAIL,KAAK,8BAA8B,EACpC,MAAM,+EAA+E,CAAC;AA4GvF,MAAM,WAAW,0BAA0B;IACzC,sEAAsE;IACtE,eAAe,EAAE,gCAAgC,CAAC;IAElD,6CAA6C;IAC7C,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAEhC,0CAA0C;IAC1C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAEjC;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAEtB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,yDAAyD;IACzD,cAAc,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAE9C,wCAAwC;IACxC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B,uGAAuG;IACvG,cAA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AAO,EACP,QAAQ,EACR,QAAgB,EAChB,SAAS,EACT,cAAc,EACd,gBAAuB,EACvB,cAAc,EACd,cAAc,EACd,WAAW,EACX,aAAa,EAAE,iBAAiB,EAChC,qBAAqB,EACrB,cAAc,EACd,8BAA8B,EAAE,oCAAoC,GACrE,EAAE,0BAA0B,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAm7FvD"}
@@ -59,6 +59,7 @@ import { isLiteralCoreResourceOperation, isRiskyResourceOperation, isSingleResou
59
59
  import { pickPreferredOperationForCoreSemanticAddressability } from '../../../core/resources/resource-addressability.frontend.utils.js';
60
60
  import { useOperationEnabled } from '../../../core/resources/hooks/useOperationEnabled.js';
61
61
  import { frontendResourceUtils, FrontendResourceUtils } from '../../../core/resources/frontend-resource.utils.js';
62
+ import { readRequestFieldRowFields, resolveRouteParentRelocation, rowValuesSetByRequest } from '../../../core/resources/route-parent-relocation.frontend.utils.js';
62
63
  import { resolveRelationshipWriteSurface, } from '../../../core/resources/relationship-surface-runtime.frontend.utils.js';
63
64
  import { useEventBus } from '../../../core/events/useEventBus.js';
64
65
  import { useResourceOperationOutcomeEmitter } from '../../../core/resources/useResourceOperationOutcomeEmitter.js';
@@ -1657,11 +1658,25 @@ export function ResourceAutomatedForm({ resourceContext, onSuccess, onError, onC
1657
1658
  let result;
1658
1659
  // RMM path: queue full submit (cancelPendingAutosavesRef already called rmm.cancelPendingMutations())
1659
1660
  if (rmm) {
1661
+ /*
1662
+ * A write that moves the row out of a parent the route is scoped by (a todo moved out of the list it was opened
1663
+ * in) is not read back: the read is addressed under that parent, which answers 404 once the row has left, and a
1664
+ * failed read-back strips the answer and schedules recovery reads of the same dead address (#3860). The written
1665
+ * row is the answer instead, and the host opens it where it now is (`useOperationDirectExecution`).
1666
+ */
1667
+ const movesRowOutOfRoute = isUpdateLikeOperation && resolveRouteParentRelocation({
1668
+ resourceType,
1669
+ contextResourceIdentifiers: contextResourceIdentifiersWithResourceId,
1670
+ rowValues: rowValuesSetByRequest(data, readRequestFieldRowFields(operation)),
1671
+ registry,
1672
+ }) !== undefined;
1660
1673
  const mutationResult = await rmm.queueMutation(data, {
1661
1674
  type: MutationType.SUBMIT,
1662
1675
  priority: MutationPriority.HIGH,
1663
1676
  source: { type: MutationSourceType.FORM, subscriberId: 'submit' },
1664
- transportOverride: currentOperationTransportOverride,
1677
+ transportOverride: movesRowOutOfRoute
1678
+ ? { ...currentOperationTransportOverride, readBackOnSuccess: false }
1679
+ : currentOperationTransportOverride,
1665
1680
  });
1666
1681
  if (!mutationResult.success) {
1667
1682
  if (isConflictMutationFailure(mutationResult)) {
@@ -1808,7 +1823,11 @@ export function ResourceAutomatedForm({ resourceContext, onSuccess, onError, onC
1808
1823
  }, [
1809
1824
  assertRMMAvailableForDefaultUpdateLikeMutation,
1810
1825
  contextFieldValues,
1826
+ contextResourceIdentifiersWithResourceId,
1811
1827
  currentOperationTransportOverride,
1828
+ isUpdateLikeOperation,
1829
+ registry,
1830
+ resourceType,
1812
1831
  injectServerErrors,
1813
1832
  mergeRequestDataWithBulkSelection,
1814
1833
  operationIdentifier,