@wildo-ai/saas-frontend-lib 1.1.3 → 1.1.4

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 (127) hide show
  1. package/dist/esm/companion-exports.d.ts +1 -1
  2. package/dist/esm/companion-exports.d.ts.map +1 -1
  3. package/dist/esm/companion-exports.js +1 -1
  4. package/dist/esm/companion-exports.js.map +1 -1
  5. package/dist/esm/components/ai-elements/decision/approval.d.ts +13 -1
  6. package/dist/esm/components/ai-elements/decision/approval.d.ts.map +1 -1
  7. package/dist/esm/components/ai-elements/decision/approval.js.map +1 -1
  8. package/dist/esm/components/flows-actors/approval.d.ts.map +1 -1
  9. package/dist/esm/components/flows-actors/approval.js +12 -7
  10. package/dist/esm/components/flows-actors/approval.js.map +1 -1
  11. package/dist/esm/components/flows-actors/approval.labels.d.ts.map +1 -1
  12. package/dist/esm/components/flows-actors/approval.labels.js +3 -0
  13. package/dist/esm/components/flows-actors/approval.labels.js.map +1 -1
  14. package/dist/esm/components/flows-actors/execution-plan.js +1 -1
  15. package/dist/esm/components/flows-actors/execution-plan.js.map +1 -1
  16. package/dist/esm/components/flows-actors/task-memory.js +1 -1
  17. package/dist/esm/components/flows-actors/task-memory.js.map +1 -1
  18. package/dist/esm/components/form/automated/generated-relationship-field.hooks.d.ts +1 -1
  19. package/dist/esm/components/form/controls/number/slider.d.ts +1 -1
  20. package/dist/esm/components/form/fields/form-field-file-provider-constraints.frontend.utils.d.ts +1 -1
  21. package/dist/esm/components/form/fields/form-field-file-provider-constraints.frontend.utils.d.ts.map +1 -1
  22. package/dist/esm/components/form/fields/form-field-file-provider-constraints.frontend.utils.js.map +1 -1
  23. package/dist/esm/components/form/fields/form-field-file.d.ts.map +1 -1
  24. package/dist/esm/components/form/fields/form-field-file.js +66 -17
  25. package/dist/esm/components/form/fields/form-field-file.js.map +1 -1
  26. package/dist/esm/components/form/fields/form-field-file.labels.js +2 -2
  27. package/dist/esm/components/form/fields/form-field-file.labels.js.map +1 -1
  28. package/dist/esm/components/form/form-field-types.d.ts +20 -0
  29. package/dist/esm/components/form/form-field-types.d.ts.map +1 -1
  30. package/dist/esm/components/form/form-field-types.js.map +1 -1
  31. package/dist/esm/components/navigation/NavigationItemBadge.d.ts +7 -1
  32. package/dist/esm/components/navigation/NavigationItemBadge.d.ts.map +1 -1
  33. package/dist/esm/components/navigation/NavigationItemBadge.js +29 -1
  34. package/dist/esm/components/navigation/NavigationItemBadge.js.map +1 -1
  35. package/dist/esm/components/navigation/menu-bar.d.ts +1 -1
  36. package/dist/esm/components/overlays/containers/OverlayContainer.d.ts.map +1 -1
  37. package/dist/esm/components/overlays/containers/OverlayContainer.js +36 -9
  38. package/dist/esm/components/overlays/containers/OverlayContainer.js.map +1 -1
  39. package/dist/esm/components/overlays/floating/context-menu.d.ts +1 -1
  40. package/dist/esm/components/overlays/floating/dropdown-menu.d.ts +1 -1
  41. package/dist/esm/components/resources/ResourceLayout_FilterChips.js +1 -1
  42. package/dist/esm/components/resources/ResourceLayout_FilterChips.js.map +1 -1
  43. package/dist/esm/components/resources/ResourceListItemRenderer.js +1 -1
  44. package/dist/esm/components/resources/ResourceListItemRenderer.js.map +1 -1
  45. package/dist/esm/components/resources/skeleton/ResourceHeaderTitle.d.ts +12 -0
  46. package/dist/esm/components/resources/skeleton/ResourceHeaderTitle.d.ts.map +1 -1
  47. package/dist/esm/components/resources/skeleton/ResourceHeaderTitle.js +13 -1
  48. package/dist/esm/components/resources/skeleton/ResourceHeaderTitle.js.map +1 -1
  49. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.d.ts +106 -49
  50. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.d.ts.map +1 -1
  51. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.js +311 -109
  52. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.js.map +1 -1
  53. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.labels.d.ts.map +1 -1
  54. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.labels.js +32 -2
  55. package/dist/esm/components/settings/AppPage_ConnectedAccountsSettings.labels.js.map +1 -1
  56. package/dist/esm/components/settings/SettingsHub.d.ts.map +1 -1
  57. package/dist/esm/components/settings/SettingsHub.js +30 -6
  58. package/dist/esm/components/settings/SettingsHub.js.map +1 -1
  59. package/dist/esm/components/views/onboarding-view/OnboardingView.d.ts.map +1 -1
  60. package/dist/esm/components/views/onboarding-view/OnboardingView.js +9 -2
  61. package/dist/esm/components/views/onboarding-view/OnboardingView.js.map +1 -1
  62. package/dist/esm/core/automated-layout/automated-layout.frontend.schemas.d.ts +16 -0
  63. package/dist/esm/core/automated-layout/automated-layout.frontend.schemas.d.ts.map +1 -1
  64. package/dist/esm/core/automated-layout/automated-layout.frontend.schemas.js +17 -0
  65. package/dist/esm/core/automated-layout/automated-layout.frontend.schemas.js.map +1 -1
  66. package/dist/esm/core/automated-layout/default-layout-generator.frontend.utils.d.ts.map +1 -1
  67. package/dist/esm/core/automated-layout/default-layout-generator.frontend.utils.js +3 -2
  68. package/dist/esm/core/automated-layout/default-layout-generator.frontend.utils.js.map +1 -1
  69. package/dist/esm/core/billing/billing-launcher.js +1 -1
  70. package/dist/esm/core/billing/billing-launcher.js.map +1 -1
  71. package/dist/esm/core/components-registry/provider-component-registry.frontend.service.d.ts +64 -4
  72. package/dist/esm/core/components-registry/provider-component-registry.frontend.service.d.ts.map +1 -1
  73. package/dist/esm/core/components-registry/provider-component-registry.frontend.service.js +76 -4
  74. package/dist/esm/core/components-registry/provider-component-registry.frontend.service.js.map +1 -1
  75. package/dist/esm/core/components-registry/useProviderComponent.frontend.hooks.d.ts +8 -0
  76. package/dist/esm/core/components-registry/useProviderComponent.frontend.hooks.d.ts.map +1 -1
  77. package/dist/esm/core/components-registry/useProviderComponent.frontend.hooks.js +1 -0
  78. package/dist/esm/core/components-registry/useProviderComponent.frontend.hooks.js.map +1 -1
  79. package/dist/esm/core/config/chart-view.frontend.schemas.d.ts +8 -8
  80. package/dist/esm/core/config/composite-view.schemas.d.ts +4 -4
  81. package/dist/esm/core/config/engine-settings-destinations.d.ts +0 -69
  82. package/dist/esm/core/config/engine-settings-destinations.d.ts.map +1 -1
  83. package/dist/esm/core/config/engine-settings-destinations.js +35 -74
  84. package/dist/esm/core/config/engine-settings-destinations.js.map +1 -1
  85. package/dist/esm/core/config/settings-hub.frontend.schemas.d.ts +10 -1
  86. package/dist/esm/core/config/settings-hub.frontend.schemas.d.ts.map +1 -1
  87. package/dist/esm/core/config/settings-hub.frontend.schemas.js +9 -0
  88. package/dist/esm/core/config/settings-hub.frontend.schemas.js.map +1 -1
  89. package/dist/esm/core/config/useSettingsHubConfig.d.ts.map +1 -1
  90. package/dist/esm/core/config/useSettingsHubConfig.js +8 -1
  91. package/dist/esm/core/config/useSettingsHubConfig.js.map +1 -1
  92. package/dist/esm/core/events/events.frontend.schemas.d.ts +4 -4
  93. package/dist/esm/core/external-providers/ProviderFilePickerHost.d.ts +12 -1
  94. package/dist/esm/core/external-providers/ProviderFilePickerHost.d.ts.map +1 -1
  95. package/dist/esm/core/external-providers/ProviderFilePickerHost.js +15 -2
  96. package/dist/esm/core/external-providers/ProviderFilePickerHost.js.map +1 -1
  97. package/dist/esm/core/external-providers/provider-file-selection.frontend.utils.d.ts +1 -2
  98. package/dist/esm/core/external-providers/provider-file-selection.frontend.utils.d.ts.map +1 -1
  99. package/dist/esm/core/external-providers/provider-file-selection.frontend.utils.js.map +1 -1
  100. package/dist/esm/core/flows-actors/FlowsActorsContext.d.ts +6 -1
  101. package/dist/esm/core/flows-actors/FlowsActorsContext.d.ts.map +1 -1
  102. package/dist/esm/core/flows-actors/FlowsActorsContext.js +10 -2
  103. package/dist/esm/core/flows-actors/FlowsActorsContext.js.map +1 -1
  104. package/dist/esm/core/i18n/I18nContext.d.ts +23 -0
  105. package/dist/esm/core/i18n/I18nContext.d.ts.map +1 -1
  106. package/dist/esm/core/i18n/I18nContext.js +6 -1
  107. package/dist/esm/core/i18n/I18nContext.js.map +1 -1
  108. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts +75 -2
  109. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts.map +1 -1
  110. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js +52 -0
  111. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js.map +1 -1
  112. package/dist/esm/core/requests/wildo-http-client-resources.frontend.service.d.ts +3 -2
  113. package/dist/esm/core/requests/wildo-http-client-resources.frontend.service.d.ts.map +1 -1
  114. package/dist/esm/core/requests/wildo-http-client-resources.frontend.service.js +57 -4
  115. package/dist/esm/core/requests/wildo-http-client-resources.frontend.service.js.map +1 -1
  116. package/dist/esm/core/resources/ResourceReadCacheBridge.d.ts.map +1 -1
  117. package/dist/esm/core/resources/ResourceReadCacheBridge.js +130 -37
  118. package/dist/esm/core/resources/ResourceReadCacheBridge.js.map +1 -1
  119. package/dist/esm/core/resources/resources.frontend.schemas.d.ts +2 -2
  120. package/dist/esm/core/runtime/start-application.frontend.service.d.ts.map +1 -1
  121. package/dist/esm/core/runtime/start-application.frontend.service.js +17 -9
  122. package/dist/esm/core/runtime/start-application.frontend.service.js.map +1 -1
  123. package/dist/esm/core/security/UserOrgsContext.d.ts.map +1 -1
  124. package/dist/esm/core/security/UserOrgsContext.js +61 -5
  125. package/dist/esm/core/security/UserOrgsContext.js.map +1 -1
  126. package/dist/tsconfig.build.tsbuildinfo +1 -1
  127. package/package.json +6 -6
@@ -32,12 +32,15 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
32
32
  import { useCallback, useEffect, useMemo, useState } from 'react';
33
33
  import { BUILTIN_PROVIDER_CAPABILITY } from '@wildo-ai/saas-models/public-runtime';
34
34
  import { useApplication } from '../../core/runtime/useApplication.js';
35
+ import { getManualCallsHttpClient } from '../../core/requests/wildo-http-client-manual-calls.frontend.service.js';
35
36
  import { ProviderComponentStatus, useProviderComponent, useProviderComponentChoices, } from '../../core/components-registry/useProviderComponent.frontend.hooks.js';
36
37
  import { receiveProviderFileSelections, } from './provider-file-selection.frontend.utils.js';
37
38
  const FILE_PICKER_CAPABILITY = BUILTIN_PROVIDER_CAPABILITY.FRONTEND_FILE_PICKER;
38
39
  export function ProviderFilePickerHost(props) {
39
40
  const { providerComponentRegistry, frontendProviderRegistry } = useApplication();
40
- const choices = useProviderComponentChoices(FILE_PICKER_CAPABILITY);
41
+ const allChoices = useProviderComponentChoices(FILE_PICKER_CAPABILITY);
42
+ const acceptedStorages = props.acceptedStorages;
43
+ const choices = useMemo(() => allChoices.filter((choice) => choice.fileStorage === undefined || (acceptedStorages?.includes(choice.fileStorage) ?? false)), [allChoices, acceptedStorages]);
41
44
  const [chosen, setChosen] = useState(
42
45
  // A single provider needs no chooser: presenting one option as a choice is
43
46
  // a click that carries no information. Several is a genuine decision and is
@@ -85,6 +88,16 @@ export function ProviderFilePickerHost(props) {
85
88
  onProviderFailure?.({ providerRef: chosen, error });
86
89
  }, [chosen, onProviderFailure]);
87
90
  const handleCancel = useCallback(() => onCancel?.(), [onCancel]);
91
+ // The caller's own token for the chosen provider, from the one door that hands one out (#394 P4).
92
+ // Resolved lazily — a picker asks when it opens, never before — and `undefined` when nothing is
93
+ // connected, which the picker reports in its own words. Never read from `publicConfig`, which is
94
+ // served to every browser.
95
+ const getAccessToken = useCallback(async () => {
96
+ if (chosen === undefined)
97
+ return undefined;
98
+ const granted = await getManualCallsHttpClient().getProviderConnectionAccessToken(chosen);
99
+ return granted?.accessToken;
100
+ }, [chosen]);
88
101
  if (choices.length === 0)
89
102
  return null;
90
103
  const chooser = props.renderChooser?.({ choices, chosen, choose: setChosen })
@@ -93,7 +106,7 @@ export function ProviderFilePickerHost(props) {
93
106
  // not make the registry know any capability's props. The narrowing happens
94
107
  // HERE, where the capability is known, and it is the only cast in the path.
95
108
  const Picker = Component;
96
- return (_jsxs(_Fragment, { children: [choices.length > 1 ? chooser : null, status === ProviderComponentStatus.READY && Picker !== null && chosen !== undefined ? (_jsx(Picker, { providerRef: chosen, publicConfig: publicConfig, constraints: props.constraints, onSelect: handleSelect, onCancel: handleCancel, onError: handleError })) : null] }));
109
+ return (_jsxs(_Fragment, { children: [choices.length > 1 ? chooser : null, status === ProviderComponentStatus.READY && Picker !== null && chosen !== undefined ? (_jsx(Picker, { providerRef: chosen, publicConfig: publicConfig, constraints: props.constraints, getAccessToken: getAccessToken, onSelect: handleSelect, onCancel: handleCancel, onError: handleError })) : null] }));
97
110
  }
98
111
  function defaultChooser(input) {
99
112
  return (_jsx("div", { role: "group", children: input.choices.map((choice) => (_jsx("button", { type: "button", "aria-pressed": choice.providerRef === input.chosen, onClick: () => input.choose(choice.providerRef), children: choice.displayName ?? choice.providerRef }, choice.providerRef))) }));
@@ -1 +1 @@
1
- {"version":3,"file":"ProviderFilePickerHost.js","sourceRoot":"","sources":["../../../../src/core/external-providers/ProviderFilePickerHost.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAMnF,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,2BAA2B,GAE5B,MAAM,kFAAkF,CAAC;AAC1F,OAAO,EACL,6BAA6B,GAE9B,MAAM,0CAA0C,CAAC;AAElD,MAAM,sBAAsB,GAAG,2BAA2B,CAAC,oBAA0C,CAAC;AA6BtG,MAAM,UAAU,sBAAsB,CAAC,KAAkC;IACvE,MAAM,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,GAAG,cAAc,EAAE,CAAC;IACjF,MAAM,OAAO,GAAG,2BAA2B,CAAC,sBAAsB,CAAC,CAAC;IACpE,MAAM,CAAC,MA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AAO,CACL,8BACG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EACnC,MAAM,KAAK,uBAAuB,CAAC,KAAK,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CACrF,KAAC,MAAM,IACL,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,WAAW,GACpB,CACH,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,KAIvB;IACC,OAAO,CACL,cAAK,IAAI,EAAC,OAAO,YACd,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC7B,iBAEE,IAAI,EAAC,QAAQ,kBACC,MAAM,CAAC,WAAW,KAAK,KAAK,CAAC,MAAM,EACjD,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,YAI9C,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,WAAW,IAPpC,MAAM,CAAC,WAAW,CAQhB,CACV,CAAC,GACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["/**\n * The framework side of a provider file picker: choose a provider, load its\n * component on demand, mount it, and hold whatever it returns to the contract\n * it declared.\n *\n * This is the seam issue #380 exists to create. Before it, a provider could not\n * contribute a component at all, and resolution beside the registry was\n * first-match — so a Drive picker and a Dropbox picker could not coexist for one\n * field, and which one won depended on map order.\n *\n * ## What this component decides and what it deliberately does not\n *\n * It decides NOTHING about which provider is right. `useProviderComponentChoices`\n * returns every live provider that carries a picker, in a stable order, and this\n * host renders them for a person to choose between. A framework that picked one\n * would be making a product decision in a lookup table, which is the defect the\n * registry was rebuilt to remove.\n *\n * It also does not interpret a selection. Routing a `REMOTE_REFERENCE` to the\n * application's executor door, or uploading a `BROWSER_READABLE_FILE`, is the\n * FIELD's job — this host hands up an outcome that is already checked against\n * the provider's declaration, so the field can branch on a `kind` it can trust.\n *\n * ## Chrome\n *\n * There is none beyond a list of buttons and the mounted component. Every label\n * is an i18n KEY resolved by the caller: a provider's display name is\n * locale-bound copy, and freezing it into a framework component is how a missing\n * translation becomes invisible.\n */\n\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport type { ProviderCapability } from '@wildo-ai/saas-models';\nimport { BUILTIN_PROVIDER_CAPABILITY } from '@wildo-ai/saas-models/public-runtime';\nimport type {\n ProviderFilePickerConstraints,\n ProviderFilePickerProps,\n ProviderFileSelection,\n} from '@wildo-ai/external-connectors-public/app';\nimport { useApplication } from '~wildo-frontend-lib/core/runtime/useApplication';\nimport {\n ProviderComponentStatus,\n useProviderComponent,\n useProviderComponentChoices,\n type ProviderComponentChoice,\n} from '~wildo-frontend-lib/core/components-registry/useProviderComponent.frontend.hooks';\nimport {\n receiveProviderFileSelections,\n type ProviderFileSelectionRejection,\n} from './provider-file-selection.frontend.utils';\n\nconst FILE_PICKER_CAPABILITY = BUILTIN_PROVIDER_CAPABILITY.FRONTEND_FILE_PICKER as ProviderCapability;\n\nexport interface ProviderFilePickerHostProps {\n readonly constraints: ProviderFilePickerConstraints;\n /**\n * Called with selections that have already been checked against the chosen\n * provider's declaration, so every `kind` here is the one that provider said\n * it would produce.\n */\n onSelect(providerRef: string, selections: readonly ProviderFileSelection[]): void;\n onCancel?(): void;\n /**\n * A provider's picker failed, or contradicted its own declaration. Both reach\n * here because both mean the same thing to a user — this picker did not work —\n * while the distinction that matters to a developer is in the rejection.\n */\n onProviderFailure?(failure: { readonly providerRef: string; readonly error?: Error; readonly rejections?: readonly ProviderFileSelectionRejection[] }): void;\n /**\n * Renders the chooser. Supplied by the caller, because a chooser is chrome and\n * this package's components are injected rather than hard-coded. The default\n * below is plain buttons: enough to be usable, not enough to be a design.\n */\n renderChooser?(input: {\n readonly choices: readonly ProviderComponentChoice[];\n readonly chosen: string | undefined;\n choose(providerRef: string): void;\n }): React.ReactNode;\n}\n\nexport function ProviderFilePickerHost(props: ProviderFilePickerHostProps): React.ReactElement | null {\n const { providerComponentRegistry, frontendProviderRegistry } = useApplication();\n const choices = useProviderComponentChoices(FILE_PICKER_CAPABILITY);\n const [chosen, setChosen] = useState<string | undefined>(\n // A single provider needs no chooser: presenting one option as a choice is\n // a click that carries no information. Several is a genuine decision and is\n // never made here.\n () => (choices.length === 1 ? choices[0]?.providerRef : undefined),\n );\n\n const soleProviderRef = choices.length === 1 ? choices[0]?.providerRef : undefined;\n useEffect(() => {\n // The initializer above runs ONCE. In today's runtime that is enough — the\n // registry is populated before application services are handed out and the\n // context gates children on them — but a host whose only correctness\n // argument lives in another file's ordering is one refactor from rendering\n // nothing at all: with a single late-arriving provider there would be no\n // chooser (length is 1) and no picker (nothing chosen).\n if (soleProviderRef !== undefined && chosen === undefined) setChosen(soleProviderRef);\n }, [soleProviderRef, chosen]);\n const { status, Component } = useProviderComponent(FILE_PICKER_CAPABILITY, chosen);\n\n const publicConfig = useMemo(() => {\n if (chosen === undefined) return {};\n return frontendProviderRegistry?.getProviderByRef(chosen as never)?.publicConfig ?? {};\n }, [chosen, frontendProviderRegistry]);\n\n // Destructured, not read off `props` inside the callbacks: `props` is a fresh\n // object every render, so depending on it would give both callbacks a new\n // identity on every parent render — and a picker keying an effect on\n // `onSelect` would then re-run its whole open sequence each time.\n const { onSelect, onCancel, onProviderFailure } = props;\n\n const handleSelect = useCallback(\n (selections: readonly ProviderFileSelection[]) => {\n if (chosen === undefined) return;\n\n const outcome = receiveProviderFileSelections({\n providerRef: chosen,\n descriptor: providerComponentRegistry?.describe(FILE_PICKER_CAPABILITY, chosen),\n selections,\n });\n\n if (outcome.rejections.length > 0) {\n onProviderFailure?.({ providerRef: chosen, rejections: outcome.rejections });\n return;\n }\n\n onSelect(chosen, outcome.accepted);\n },\n [chosen, providerComponentRegistry, onSelect, onProviderFailure],\n );\n\n const handleError = useCallback(\n (error: Error) => {\n if (chosen === undefined) return;\n onProviderFailure?.({ providerRef: chosen, error });\n },\n [chosen, onProviderFailure],\n );\n\n const handleCancel = useCallback(() => onCancel?.(), [onCancel]);\n\n if (choices.length === 0) return null;\n\n const chooser = props.renderChooser?.({ choices, chosen, choose: setChosen })\n ?? defaultChooser({ choices, chosen, choose: setChosen });\n\n // `Component` is typed as the registry's opaque component: this package must\n // not make the registry know any capability's props. The narrowing happens\n // HERE, where the capability is known, and it is the only cast in the path.\n const Picker = Component as React.ComponentType<ProviderFilePickerProps> | null;\n\n return (\n <>\n {choices.length > 1 ? chooser : null}\n {status === ProviderComponentStatus.READY && Picker !== null && chosen !== undefined ? (\n <Picker\n providerRef={chosen}\n publicConfig={publicConfig}\n constraints={props.constraints}\n onSelect={handleSelect}\n onCancel={handleCancel}\n onError={handleError}\n />\n ) : null}\n </>\n );\n}\n\nfunction defaultChooser(input: {\n readonly choices: readonly ProviderComponentChoice[];\n readonly chosen: string | undefined;\n choose(providerRef: string): void;\n}): React.ReactNode {\n return (\n <div role=\"group\">\n {input.choices.map((choice) => (\n <button\n key={choice.providerRef}\n type=\"button\"\n aria-pressed={choice.providerRef === input.chosen}\n onClick={() => input.choose(choice.providerRef)}\n >\n {/* The authored fallback, NOT a translation — a surface that has an\n i18n service should pass `renderChooser` and resolve the key. */}\n {choice.displayName ?? choice.providerRef}\n </button>\n ))}\n </div>\n );\n}\n"]}
1
+ {"version":3,"file":"ProviderFilePickerHost.js","sourceRoot":"","sources":["../../../../src/core/external-providers/ProviderFilePickerHost.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAO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AAC,CAAC,IAAI,EACnC,MAAM,KAAK,uBAAuB,CAAC,KAAK,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CACrF,KAAC,MAAM,IACL,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,WAAW,GACpB,CACH,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,CAAC;AACJ,CAAC;AAED,SAAS,cAAc,CAAC,KAIvB;IACC,OAAO,CACL,cAAK,IAAI,EAAC,OAAO,YACd,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAC7B,iBAEE,IAAI,EAAC,QAAQ,kBACC,MAAM,CAAC,WAAW,KAAK,KAAK,CAAC,MAAM,EACjD,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,YAI9C,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,WAAW,IAPpC,MAAM,CAAC,WAAW,CAQhB,CACV,CAAC,GACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["/**\n * The framework side of a provider file picker: choose a provider, load its\n * component on demand, mount it, and hold whatever it returns to the contract\n * it declared.\n *\n * This is the seam issue #380 exists to create. Before it, a provider could not\n * contribute a component at all, and resolution beside the registry was\n * first-match — so a Drive picker and a Dropbox picker could not coexist for one\n * field, and which one won depended on map order.\n *\n * ## What this component decides and what it deliberately does not\n *\n * It decides NOTHING about which provider is right. `useProviderComponentChoices`\n * returns every live provider that carries a picker, in a stable order, and this\n * host renders them for a person to choose between. A framework that picked one\n * would be making a product decision in a lookup table, which is the defect the\n * registry was rebuilt to remove.\n *\n * It also does not interpret a selection. Routing a `REMOTE_REFERENCE` to the\n * application's executor door, or uploading a `BROWSER_READABLE_FILE`, is the\n * FIELD's job — this host hands up an outcome that is already checked against\n * the provider's declaration, so the field can branch on a `kind` it can trust.\n *\n * ## Chrome\n *\n * There is none beyond a list of buttons and the mounted component. Every label\n * is an i18n KEY resolved by the caller: a provider's display name is\n * locale-bound copy, and freezing it into a framework component is how a missing\n * translation becomes invisible.\n */\n\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport type { ProviderCapability } from '@wildo-ai/saas-models';\nimport { BUILTIN_PROVIDER_CAPABILITY } from '@wildo-ai/saas-models/public-runtime';\nimport type { FileStorageAccepted } from '@wildo-ai/saas-models/public-runtime';\nimport type {\n ProviderFilePickerConstraints,\n ProviderFilePickerProps,\n ProviderFileSelection,\n} from '@wildo-ai/saas-models/public-runtime';\nimport { useApplication } from '~wildo-frontend-lib/core/runtime/useApplication';\nimport { getManualCallsHttpClient } from '~wildo-frontend-lib/core/requests/wildo-http-client-manual-calls.frontend.service';\nimport {\n ProviderComponentStatus,\n useProviderComponent,\n useProviderComponentChoices,\n type ProviderComponentChoice,\n} from '~wildo-frontend-lib/core/components-registry/useProviderComponent.frontend.hooks';\nimport {\n receiveProviderFileSelections,\n type ProviderFileSelectionRejection,\n} from './provider-file-selection.frontend.utils';\n\nconst FILE_PICKER_CAPABILITY = BUILTIN_PROVIDER_CAPABILITY.FRONTEND_FILE_PICKER as ProviderCapability;\n\nexport interface ProviderFilePickerHostProps {\n readonly constraints: ProviderFilePickerConstraints;\n /**\n * The field's `z_file({ storageAccepted })` (#394 P5). A provider whose picker\n * fronts a storage (a `REMOTE_REFERENCE` picker — the file stays at the\n * vendor) is offered only when this names that storage, because the link it\n * produces lands in that storage and the backend refuses it otherwise. A\n * provider declaring no storage delivers bytes into the field's own storage\n * and is offered regardless. Undefined — the field declared nothing — accepts\n * no vendor storage: the default storage is the framework's.\n */\n readonly acceptedStorages?: ReadonlyArray<FileStorageAccepted>;\n /**\n * Called with selections that have already been checked against the chosen\n * provider's declaration, so every `kind` here is the one that provider said\n * it would produce.\n */\n onSelect(providerRef: string, selections: readonly ProviderFileSelection[]): void;\n onCancel?(): void;\n /**\n * A provider's picker failed, or contradicted its own declaration. Both reach\n * here because both mean the same thing to a user — this picker did not work —\n * while the distinction that matters to a developer is in the rejection.\n */\n onProviderFailure?(failure: { readonly providerRef: string; readonly error?: Error; readonly rejections?: readonly ProviderFileSelectionRejection[] }): void;\n /**\n * Renders the chooser. Supplied by the caller, because a chooser is chrome and\n * this package's components are injected rather than hard-coded. The default\n * below is plain buttons: enough to be usable, not enough to be a design.\n */\n renderChooser?(input: {\n readonly choices: readonly ProviderComponentChoice[];\n readonly chosen: string | undefined;\n choose(providerRef: string): void;\n }): React.ReactNode;\n}\n\nexport function ProviderFilePickerHost(props: ProviderFilePickerHostProps): React.ReactElement | null {\n const { providerComponentRegistry, frontendProviderRegistry } = useApplication();\n const allChoices = useProviderComponentChoices(FILE_PICKER_CAPABILITY);\n const acceptedStorages = props.acceptedStorages;\n const choices = useMemo(\n () => allChoices.filter((choice) => choice.fileStorage === undefined || (acceptedStorages?.includes(choice.fileStorage) ?? false)),\n [allChoices, acceptedStorages],\n );\n const [chosen, setChosen] = useState<string | undefined>(\n // A single provider needs no chooser: presenting one option as a choice is\n // a click that carries no information. Several is a genuine decision and is\n // never made here.\n () => (choices.length === 1 ? choices[0]?.providerRef : undefined),\n );\n\n const soleProviderRef = choices.length === 1 ? choices[0]?.providerRef : undefined;\n useEffect(() => {\n // The initializer above runs ONCE. In today's runtime that is enough — the\n // registry is populated before application services are handed out and the\n // context gates children on them — but a host whose only correctness\n // argument lives in another file's ordering is one refactor from rendering\n // nothing at all: with a single late-arriving provider there would be no\n // chooser (length is 1) and no picker (nothing chosen).\n if (soleProviderRef !== undefined && chosen === undefined) setChosen(soleProviderRef);\n }, [soleProviderRef, chosen]);\n const { status, Component } = useProviderComponent(FILE_PICKER_CAPABILITY, chosen);\n\n const publicConfig = useMemo(() => {\n if (chosen === undefined) return {};\n return frontendProviderRegistry?.getProviderByRef(chosen as never)?.publicConfig ?? {};\n }, [chosen, frontendProviderRegistry]);\n\n // Destructured, not read off `props` inside the callbacks: `props` is a fresh\n // object every render, so depending on it would give both callbacks a new\n // identity on every parent render — and a picker keying an effect on\n // `onSelect` would then re-run its whole open sequence each time.\n const { onSelect, onCancel, onProviderFailure } = props;\n\n const handleSelect = useCallback(\n (selections: readonly ProviderFileSelection[]) => {\n if (chosen === undefined) return;\n\n const outcome = receiveProviderFileSelections({\n providerRef: chosen,\n descriptor: providerComponentRegistry?.describe(FILE_PICKER_CAPABILITY, chosen),\n selections,\n });\n\n if (outcome.rejections.length > 0) {\n onProviderFailure?.({ providerRef: chosen, rejections: outcome.rejections });\n return;\n }\n\n onSelect(chosen, outcome.accepted);\n },\n [chosen, providerComponentRegistry, onSelect, onProviderFailure],\n );\n\n const handleError = useCallback(\n (error: Error) => {\n if (chosen === undefined) return;\n onProviderFailure?.({ providerRef: chosen, error });\n },\n [chosen, onProviderFailure],\n );\n\n const handleCancel = useCallback(() => onCancel?.(), [onCancel]);\n\n // The caller's own token for the chosen provider, from the one door that hands one out (#394 P4).\n // Resolved lazily — a picker asks when it opens, never before — and `undefined` when nothing is\n // connected, which the picker reports in its own words. Never read from `publicConfig`, which is\n // served to every browser.\n const getAccessToken = useCallback(async (): Promise<string | undefined> => {\n if (chosen === undefined) return undefined;\n const granted = await getManualCallsHttpClient().getProviderConnectionAccessToken(chosen);\n return granted?.accessToken;\n }, [chosen]);\n\n if (choices.length === 0) return null;\n\n const chooser = props.renderChooser?.({ choices, chosen, choose: setChosen })\n ?? defaultChooser({ choices, chosen, choose: setChosen });\n\n // `Component` is typed as the registry's opaque component: this package must\n // not make the registry know any capability's props. The narrowing happens\n // HERE, where the capability is known, and it is the only cast in the path.\n const Picker = Component as React.ComponentType<ProviderFilePickerProps> | null;\n\n return (\n <>\n {choices.length > 1 ? chooser : null}\n {status === ProviderComponentStatus.READY && Picker !== null && chosen !== undefined ? (\n <Picker\n providerRef={chosen}\n publicConfig={publicConfig}\n constraints={props.constraints}\n getAccessToken={getAccessToken}\n onSelect={handleSelect}\n onCancel={handleCancel}\n onError={handleError}\n />\n ) : null}\n </>\n );\n}\n\nfunction defaultChooser(input: {\n readonly choices: readonly ProviderComponentChoice[];\n readonly chosen: string | undefined;\n choose(providerRef: string): void;\n}): React.ReactNode {\n return (\n <div role=\"group\">\n {input.choices.map((choice) => (\n <button\n key={choice.providerRef}\n type=\"button\"\n aria-pressed={choice.providerRef === input.chosen}\n onClick={() => input.choose(choice.providerRef)}\n >\n {/* The authored fallback, NOT a translation — a surface that has an\n i18n service should pass `renderChooser` and resolve the key. */}\n {choice.displayName ?? choice.providerRef}\n </button>\n ))}\n </div>\n );\n}\n"]}
@@ -51,8 +51,7 @@
51
51
  * nothing in the log. A returned result lets the mounting surface show the user
52
52
  * that the picker misbehaved and lets the diagnostic name the provider.
53
53
  */
54
- import { ProviderFrontendSelectionDelivery, type ProviderFrontendComponentDescriptor } from '@wildo-ai/saas-models/public-runtime';
55
- import type { ProviderFileSelection } from '@wildo-ai/external-connectors-public/app';
54
+ import { ProviderFrontendSelectionDelivery, type ProviderFileSelection, type ProviderFrontendComponentDescriptor } from '@wildo-ai/saas-models/public-runtime';
56
55
  /** Why a selection a picker produced was not accepted. */
57
56
  export declare enum ProviderFileSelectionRejectionKind {
58
57
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"provider-file-selection.frontend.utils.d.ts","sourceRoot":"","sources":["../../../../src/core/external-providers/provider-file-selection.frontend.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,OAAO,EACL,iCAAiC,EACjC,KAAK,mCAAmC,EACzC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAEtF,0DAA0D;AAC1D,oBAAY,kCAAkC;IAC5C;;;;;OAKG;IACH,6BAA6B,kCAAkC;IAC/D;;;;;OAKG;IACH,gCAAgC,qCAAqC;CACtE;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,IAAI,EAAE,kCAAkC,CAAC;IAClD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,CAAC,EAAE,iCAAiC,CAAC;IACtD,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,CAAC,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAC;CACnD;AAED,MAAM,WAAW,4BAA4B;IAC3C,2FAA2F;IAC3F,QAAQ,CAAC,QAAQ,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACpD,QAAQ,CAAC,UAAU,EAAE,SAAS,8BAA8B,EAAE,CAAC;CAChE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE;IACnD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,mCAAmC,GAAG,SAAS,CAAC;IACrE,QAAQ,CAAC,UAAU,EAAE,SAAS,qBAAqB,EAAE,CAAC;CACvD,GAAG,4BAA4B,CAqC/B"}
1
+ {"version":3,"file":"provider-file-selection.frontend.utils.d.ts","sourceRoot":"","sources":["../../../../src/core/external-providers/provider-file-selection.frontend.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,OAAO,EACL,iCAAiC,EACjC,KAAK,qBAAqB,EAC1B,KAAK,mCAAmC,EACzC,MAAM,sCAAsC,CAAC;AAE9C,0DAA0D;AAC1D,oBAAY,kCAAkC;IAC5C;;;;;OAKG;IACH,6BAA6B,kCAAkC;IAC/D;;;;;OAKG;IACH,gCAAgC,qCAAqC;CACtE;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,IAAI,EAAE,kCAAkC,CAAC;IAClD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gEAAgE;IAChE,QAAQ,CAAC,QAAQ,CAAC,EAAE,iCAAiC,CAAC;IACtD,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,CAAC,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAC;CACnD;AAED,MAAM,WAAW,4BAA4B;IAC3C,2FAA2F;IAC3F,QAAQ,CAAC,QAAQ,EAAE,SAAS,qBAAqB,EAAE,CAAC;IACpD,QAAQ,CAAC,UAAU,EAAE,SAAS,8BAA8B,EAAE,CAAC;CAChE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE;IACnD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,mCAAmC,GAAG,SAAS,CAAC;IACrE,QAAQ,CAAC,UAAU,EAAE,SAAS,qBAAqB,EAAE,CAAC;CACvD,GAAG,4BAA4B,CAqC/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"provider-file-selection.frontend.utils.js","sourceRoot":"","sources":["../../../../src/core/external-providers/provider-file-selection.frontend.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAQH,0DAA0D;AAC1D,MAAM,CAAN,IAAY,kCAeX;AAfD,WAAY,kCAAkC;IAC5C;;;;;OAKG;IACH,qGAA+D,CAAA;IAC/D;;;;;OAKG;IACH,2GAAqE,CAAA;AACvE,CAAC,EAfW,kCAAkC,KAAlC,kCAAkC,QAe7C;AAkBD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,6BAA6B,CAAC,KAI7C;IACC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,EAAE,iBAAiB,CAAC;IAErD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO;YACL,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,CAAC;oBACX,IAAI,EAAE,kCAAkC,CAAC,6BAA6B;oBACtE,WAAW,EAAE,KAAK,CAAC,WAAW;oBAC9B,OAAO,EACL,aAAa,KAAK,CAAC,WAAW,8CAA8C;0BAC1E,qFAAqF;0BACrF,wFAAwF;0BACxF,4FAA4F;iBACjG,CAAC;SACH,CAAC;IACJ,CAAC;IAED,MAAM,UAAU,GAAqC,EAAE,CAAC;IACxD,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;QACzC,IAAI,SAAS,CAAC,IAAI,KAAK,QAAQ;YAAE,SAAS;QAC1C,UAAU,CAAC,IAAI,CAAC;YACd,IAAI,EAAE,kCAAkC,CAAC,gCAAgC;YACzE,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,QAAQ;YACR,QAAQ,EAAE,SAAS,CAAC,IAAI;YACxB,OAAO,EACL,aAAa,KAAK,CAAC,WAAW,wCAAwC,QAAQ,mBAAmB;kBAC/F,IAAI,SAAS,CAAC,IAAI,0EAA0E;kBAC5F,6FAA6F;kBAC7F,yEAAyE;SAC9E,CAAC,CAAC;IACL,CAAC;IAED,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC;QAC1B,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE;QAC9B,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC;AACrD,CAAC","sourcesContent":["/**\n * Holding a provider's file picker to the selection contract it DECLARED.\n *\n * ## Why this exists at all\n *\n * Issue #383 (Q5) settled what \"an application calls a third party directly from\n * a custom frontend component\" means when the component is a file picker, and\n * the answer was **per vendor, declared**: a picker for a credentialed vendor\n * hands back an opaque remote reference the backend resolves, a picker running\n * on a browser-safe grant hands back bytes or a URL the browser already has, and\n * a provider states which of the two it is.\n *\n * The union alone would have been the hedge that decision rejected. Three arms\n * with a runtime discriminant is a shape that says *\"one of these three, we will\n * find out when it happens\"* — and an application's file field cannot be written\n * against that: the reference arm has to be posted to the executor door, the\n * browser-readable arms go through the ordinary upload path, and choosing\n * between them at runtime means every field carries both.\n *\n * So the declaration is enforced here. A provider that declares\n * `REMOTE_REFERENCE` and hands back a `File` is refused, loudly, naming both\n * sides. Without this the declaration would be decoration, and a reviewer\n * reading a provider's manifest would be reading a wish rather than a contract.\n *\n * ## It is the SANCTIONED seam, not the only possible one\n *\n * `ProviderFilePickerHost` is the path that calls this, and it is what a surface\n * should use. But the registry and the `useProviderComponent` hooks are public\n * too — an application can resolve a provider's component itself, cast it and\n * mount it, and a selection then reaches that application without passing\n * through here.\n *\n * That is deliberate and it is stated rather than closed off: a framework that\n * could only mount a provider component one way would be unable to serve a\n * surface the framework has not thought of, which is the whole reason the\n * capability vocabulary is open. What the framework guarantees is that ITS\n * routing honours the declaration; an application taking the component directly\n * has taken the contract with it, and should call this function.\n *\n * An earlier revision of this paragraph said \"the one seam every selection\n * crosses\", which stopped being true in the same change that exported the other\n * path. Kept as a correction because a load-bearing sentence that quietly goes\n * false is how the next reader inherits a guarantee nobody makes.\n *\n * ## Why refusal is REPORTED rather than thrown\n *\n * This runs inside a picker's own callback, which is usually a vendor SDK's\n * event handler rather than a React render. A throw there does not reach an\n * error boundary — it reaches the vendor's own dispatcher, which typically\n * swallows it — so the surface would stop responding with nothing on screen and\n * nothing in the log. A returned result lets the mounting surface show the user\n * that the picker misbehaved and lets the diagnostic name the provider.\n */\n\nimport {\n ProviderFrontendSelectionDelivery,\n type ProviderFrontendComponentDescriptor,\n} from '@wildo-ai/saas-models/public-runtime';\nimport type { ProviderFileSelection } from '@wildo-ai/external-connectors-public/app';\n\n/** Why a selection a picker produced was not accepted. */\nexport enum ProviderFileSelectionRejectionKind {\n /**\n * The provider declared no `selectionDelivery` for its file picker, so the\n * framework cannot know whether the result is a backend reference or bytes —\n * and therefore cannot route it anywhere. An authoring defect in the provider\n * package, not a user error.\n */\n PROVIDER_DECLARED_NO_DELIVERY = 'PROVIDER_DECLARED_NO_DELIVERY',\n /**\n * The picker returned a selection whose kind is not the one it declared. This\n * is the case the whole declaration exists to catch: a `REMOTE_REFERENCE`\n * provider handing back a `File` means bytes reached the browser on a path\n * nobody reviewed for it.\n */\n DELIVERY_CONTRADICTS_DECLARATION = 'DELIVERY_CONTRADICTS_DECLARATION',\n}\n\nexport interface ProviderFileSelectionRejection {\n readonly kind: ProviderFileSelectionRejectionKind;\n readonly providerRef: string;\n readonly message: string;\n /** The delivery the provider declared, when it declared one. */\n readonly declared?: ProviderFrontendSelectionDelivery;\n /** The kind the picker actually produced, for the contradiction case. */\n readonly received?: ProviderFileSelection['kind'];\n}\n\nexport interface ProviderFileSelectionOutcome {\n /** Selections that match the declaration. Empty when anything was rejected — see below. */\n readonly accepted: readonly ProviderFileSelection[];\n readonly rejections: readonly ProviderFileSelectionRejection[];\n}\n\n/**\n * Checks every selection against what the provider declared.\n *\n * **All or nothing.** One contradicting selection rejects the whole batch rather\n * than the offending item, and that is deliberate: a picker that returned three\n * files of which one has the wrong shape is a picker whose contract is not what\n * it says, and accepting the other two would leave an application holding a\n * partial result it never asked for from a component it can no longer trust.\n * Silently dropping one of a user's three chosen files is the worse outcome —\n * the user sees two, has no idea why, and nothing anywhere says so.\n */\nexport function receiveProviderFileSelections(input: {\n readonly providerRef: string;\n readonly descriptor: ProviderFrontendComponentDescriptor | undefined;\n readonly selections: readonly ProviderFileSelection[];\n}): ProviderFileSelectionOutcome {\n const declared = input.descriptor?.selectionDelivery;\n\n if (declared === undefined) {\n return {\n accepted: [],\n rejections: [{\n kind: ProviderFileSelectionRejectionKind.PROVIDER_DECLARED_NO_DELIVERY,\n providerRef: input.providerRef,\n message:\n `Provider \"${input.providerRef}\" contributes a file picker but declares no `\n + '`selectionDelivery`, so the framework cannot tell whether a selection is a backend '\n + 'reference or bytes the browser already holds — and therefore cannot route it. Declare '\n + 'one on the component: `components: { FRONTEND_FILE_PICKER: { load, selectionDelivery } }`.',\n }],\n };\n }\n\n const rejections: ProviderFileSelectionRejection[] = [];\n for (const selection of input.selections) {\n if (selection.kind === declared) continue;\n rejections.push({\n kind: ProviderFileSelectionRejectionKind.DELIVERY_CONTRADICTS_DECLARATION,\n providerRef: input.providerRef,\n declared,\n received: selection.kind,\n message:\n `Provider \"${input.providerRef}\" declared its file picker delivers \"${declared}\" and returned a `\n + `\"${selection.kind}\" selection. Which one a provider emits is a declaration, not a runtime `\n + 'choice (issue #383): a surface routes a selection before it mounts the picker, so a picker '\n + 'that contradicts its own declaration is refused rather than guessed at.',\n });\n }\n\n return rejections.length > 0\n ? { accepted: [], rejections }\n : { accepted: input.selections, rejections: [] };\n}\n"]}
1
+ {"version":3,"file":"provider-file-selection.frontend.utils.js","sourceRoot":"","sources":["../../../../src/core/external-providers/provider-file-selection.frontend.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAQH,0DAA0D;AAC1D,MAAM,CAAN,IAAY,kCAeX;AAfD,WAAY,kCAAkC;IAC5C;;;;;OAKG;IACH,qGAA+D,CAAA;IAC/D;;;;;OAKG;IACH,2GAAqE,CAAA;AACvE,CAAC,EAfW,kCAAkC,KAAlC,kCAAkC,QAe7C;AAkBD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,6BAA6B,CAAC,KAI7C;IACC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,EAAE,iBAAiB,CAAC;IAErD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO;YACL,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,CAAC;oBACX,IAAI,EAAE,kCAAkC,CAAC,6BAA6B;oBACtE,WAAW,EAAE,KAAK,CAAC,WAAW;oBAC9B,OAAO,EACL,aAAa,KAAK,CAAC,WAAW,8CAA8C;0BAC1E,qFAAqF;0BACrF,wFAAwF;0BACxF,4FAA4F;iBACjG,CAAC;SACH,CAAC;IACJ,CAAC;IAED,MAAM,UAAU,GAAqC,EAAE,CAAC;IACxD,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC;QACzC,IAAI,SAAS,CAAC,IAAI,KAAK,QAAQ;YAAE,SAAS;QAC1C,UAAU,CAAC,IAAI,CAAC;YACd,IAAI,EAAE,kCAAkC,CAAC,gCAAgC;YACzE,WAAW,EAAE,KAAK,CAAC,WAAW;YAC9B,QAAQ;YACR,QAAQ,EAAE,SAAS,CAAC,IAAI;YACxB,OAAO,EACL,aAAa,KAAK,CAAC,WAAW,wCAAwC,QAAQ,mBAAmB;kBAC/F,IAAI,SAAS,CAAC,IAAI,0EAA0E;kBAC5F,6FAA6F;kBAC7F,yEAAyE;SAC9E,CAAC,CAAC;IACL,CAAC;IAED,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC;QAC1B,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE;QAC9B,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC;AACrD,CAAC","sourcesContent":["/**\n * Holding a provider's file picker to the selection contract it DECLARED.\n *\n * ## Why this exists at all\n *\n * Issue #383 (Q5) settled what \"an application calls a third party directly from\n * a custom frontend component\" means when the component is a file picker, and\n * the answer was **per vendor, declared**: a picker for a credentialed vendor\n * hands back an opaque remote reference the backend resolves, a picker running\n * on a browser-safe grant hands back bytes or a URL the browser already has, and\n * a provider states which of the two it is.\n *\n * The union alone would have been the hedge that decision rejected. Three arms\n * with a runtime discriminant is a shape that says *\"one of these three, we will\n * find out when it happens\"* — and an application's file field cannot be written\n * against that: the reference arm has to be posted to the executor door, the\n * browser-readable arms go through the ordinary upload path, and choosing\n * between them at runtime means every field carries both.\n *\n * So the declaration is enforced here. A provider that declares\n * `REMOTE_REFERENCE` and hands back a `File` is refused, loudly, naming both\n * sides. Without this the declaration would be decoration, and a reviewer\n * reading a provider's manifest would be reading a wish rather than a contract.\n *\n * ## It is the SANCTIONED seam, not the only possible one\n *\n * `ProviderFilePickerHost` is the path that calls this, and it is what a surface\n * should use. But the registry and the `useProviderComponent` hooks are public\n * too — an application can resolve a provider's component itself, cast it and\n * mount it, and a selection then reaches that application without passing\n * through here.\n *\n * That is deliberate and it is stated rather than closed off: a framework that\n * could only mount a provider component one way would be unable to serve a\n * surface the framework has not thought of, which is the whole reason the\n * capability vocabulary is open. What the framework guarantees is that ITS\n * routing honours the declaration; an application taking the component directly\n * has taken the contract with it, and should call this function.\n *\n * An earlier revision of this paragraph said \"the one seam every selection\n * crosses\", which stopped being true in the same change that exported the other\n * path. Kept as a correction because a load-bearing sentence that quietly goes\n * false is how the next reader inherits a guarantee nobody makes.\n *\n * ## Why refusal is REPORTED rather than thrown\n *\n * This runs inside a picker's own callback, which is usually a vendor SDK's\n * event handler rather than a React render. A throw there does not reach an\n * error boundary — it reaches the vendor's own dispatcher, which typically\n * swallows it — so the surface would stop responding with nothing on screen and\n * nothing in the log. A returned result lets the mounting surface show the user\n * that the picker misbehaved and lets the diagnostic name the provider.\n */\n\nimport {\n ProviderFrontendSelectionDelivery,\n type ProviderFileSelection,\n type ProviderFrontendComponentDescriptor,\n} from '@wildo-ai/saas-models/public-runtime';\n\n/** Why a selection a picker produced was not accepted. */\nexport enum ProviderFileSelectionRejectionKind {\n /**\n * The provider declared no `selectionDelivery` for its file picker, so the\n * framework cannot know whether the result is a backend reference or bytes —\n * and therefore cannot route it anywhere. An authoring defect in the provider\n * package, not a user error.\n */\n PROVIDER_DECLARED_NO_DELIVERY = 'PROVIDER_DECLARED_NO_DELIVERY',\n /**\n * The picker returned a selection whose kind is not the one it declared. This\n * is the case the whole declaration exists to catch: a `REMOTE_REFERENCE`\n * provider handing back a `File` means bytes reached the browser on a path\n * nobody reviewed for it.\n */\n DELIVERY_CONTRADICTS_DECLARATION = 'DELIVERY_CONTRADICTS_DECLARATION',\n}\n\nexport interface ProviderFileSelectionRejection {\n readonly kind: ProviderFileSelectionRejectionKind;\n readonly providerRef: string;\n readonly message: string;\n /** The delivery the provider declared, when it declared one. */\n readonly declared?: ProviderFrontendSelectionDelivery;\n /** The kind the picker actually produced, for the contradiction case. */\n readonly received?: ProviderFileSelection['kind'];\n}\n\nexport interface ProviderFileSelectionOutcome {\n /** Selections that match the declaration. Empty when anything was rejected — see below. */\n readonly accepted: readonly ProviderFileSelection[];\n readonly rejections: readonly ProviderFileSelectionRejection[];\n}\n\n/**\n * Checks every selection against what the provider declared.\n *\n * **All or nothing.** One contradicting selection rejects the whole batch rather\n * than the offending item, and that is deliberate: a picker that returned three\n * files of which one has the wrong shape is a picker whose contract is not what\n * it says, and accepting the other two would leave an application holding a\n * partial result it never asked for from a component it can no longer trust.\n * Silently dropping one of a user's three chosen files is the worse outcome —\n * the user sees two, has no idea why, and nothing anywhere says so.\n */\nexport function receiveProviderFileSelections(input: {\n readonly providerRef: string;\n readonly descriptor: ProviderFrontendComponentDescriptor | undefined;\n readonly selections: readonly ProviderFileSelection[];\n}): ProviderFileSelectionOutcome {\n const declared = input.descriptor?.selectionDelivery;\n\n if (declared === undefined) {\n return {\n accepted: [],\n rejections: [{\n kind: ProviderFileSelectionRejectionKind.PROVIDER_DECLARED_NO_DELIVERY,\n providerRef: input.providerRef,\n message:\n `Provider \"${input.providerRef}\" contributes a file picker but declares no `\n + '`selectionDelivery`, so the framework cannot tell whether a selection is a backend '\n + 'reference or bytes the browser already holds — and therefore cannot route it. Declare '\n + 'one on the component: `components: { FRONTEND_FILE_PICKER: { load, selectionDelivery } }`.',\n }],\n };\n }\n\n const rejections: ProviderFileSelectionRejection[] = [];\n for (const selection of input.selections) {\n if (selection.kind === declared) continue;\n rejections.push({\n kind: ProviderFileSelectionRejectionKind.DELIVERY_CONTRADICTS_DECLARATION,\n providerRef: input.providerRef,\n declared,\n received: selection.kind,\n message:\n `Provider \"${input.providerRef}\" declared its file picker delivers \"${declared}\" and returned a `\n + `\"${selection.kind}\" selection. Which one a provider emits is a declaration, not a runtime `\n + 'choice (issue #383): a surface routes a selection before it mounts the picker, so a picker '\n + 'that contradicts its own declaration is refused rather than guessed at.',\n });\n }\n\n return rejections.length > 0\n ? { accepted: [], rejections }\n : { accepted: input.selections, rejections: [] };\n}\n"]}
@@ -80,7 +80,12 @@ export interface FlowsActorsContextType {
80
80
  /** Start a new execution (fire-and-forget via WebSocket; returns local executionId) */
81
81
  startExecution: (systemRef: string, initialInput?: Record<string, unknown>, existingExecutionId?: string) => string | null;
82
82
  /** Respond to an approval request (fire-and-forget via WebSocket) */
83
- respondToApproval: (executionId: string, approvalId: string, approved: boolean, comment?: string) => void;
83
+ /**
84
+ * `modifiedToolArgs` (#566) replaces the arguments the agent proposed. Absent means "run the call
85
+ * as proposed"; the server validates the edit against the tool's own schema and refuses through
86
+ * `FLOWS_ACTORS_ERROR` with the approval left pending.
87
+ */
88
+ respondToApproval: (executionId: string, approvalId: string, approved: boolean, comment?: string, modifiedToolArgs?: Record<string, unknown>) => void;
84
89
  /** Remove a completed/errored execution from state */
85
90
  clearExecution: (executionId: string) => void;
86
91
  /** Get execution by ID (reads from ref; consume `executions` to re-render on changes) */
@@ -1 +1 @@
1
- {"version":3,"file":"FlowsActorsContext.d.ts","sourceRoot":"","sources":["../../../../src/core/flows-actors/FlowsActorsContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA2B,SAAS,EAA2C,MAAM,OAAO,CAAC;AAC3G,OAAO,EACL,4BAA4B,EAM5B,KAAK,uCAAuC,EAU7C,MAAM,uBAAuB,CAAC;AAwD/B;;GAEG;AACH,oBAAY,0BAA0B;IACpC,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,iBAAiB,sBAAsB;IACvC,SAAS,cAAc;IACvB,KAAK,UAAU;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MA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AE,SAAS,CAAA;CAAE,CA+djE,CAAC"}
1
+ {"version":3,"file":"FlowsActorsContext.d.ts","sourceRoot":"","sources":["../../../../src/core/flows-actors/FlowsActorsContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA2B,SAAS,EAA2C,MAAM,OAAO,CAAC;AAC3G,OAAO,EACL,4BAA4B,EAM5B,KAAK,uCAAuC,EAU7C,MAAM,uBAAuB,CAAC;AAwD/B;;GAEG;AACH,oBAAY,0BAA0B;IACpC,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,iBAAiB,sBAAsB;IACvC,SAAS,cAAc;IACvB,KAAK,UAAU;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,0BAA0B,CAAC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,KAAK,CAAC;QACd,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,CAAC;QAChD,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC/B,SAAS,EAAE,IAAI,CAAC;QAChB;;;;;WAKG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;IACH;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,SAAS,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;QACnD,SAAS,CAAC,EAAE,IAAI,CAAC;QACjB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;QACzB,0FAA0F;QAC1F,QAAQ,CAAC,EAAE,MAAM,C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AwB;IACxB,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,4BAA4B,GAAG,SAAS,CAAC;IAE3E,mCAAmC;IACnC,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpC;;;;;;OAMG;IACH,wBAAwB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,uCAAuC,CAAC,YAAY,CAAC,CAAC,CAAC;IAEhH;;;;OAIG;IACH,kBAAkB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAgE,CAAC;AAElJ;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,CAwejE,CAAC"}
@@ -225,7 +225,7 @@ export const FlowsActorsProvider = ({ children }) => {
225
225
  * Respond to an approval request via WebSocket (fire-and-forget).
226
226
  * Backend confirms via FLOWS_ACTORS_STATUS_UPDATE / FLOWS_ACTORS_ERROR events.
227
227
  */
228
- const respondToApproval = useCallback((executionId, approvalId, approved, comment) => {
228
+ const respondToApproval = useCallback((executionId, approvalId, approved, comment, modifiedToolArgs) => {
229
229
  const execution = executionsRef.current.get(executionId);
230
230
  if (!execution) {
231
231
  logDebug('Cannot respond to approval — execution not found', { executionId, approvalId });
@@ -235,7 +235,7 @@ export const FlowsActorsProvider = ({ children }) => {
235
235
  logDebug('Cannot respond to approval — WebSocket not connected', { executionId, approvalId });
236
236
  return;
237
237
  }
238
- logDebug('Responding to approval', { executionId, approvalId, approved });
238
+ logDebug('Responding to approval', { executionId, approvalId, approved, modified: modifiedToolArgs !== undefined });
239
239
  emit(CoreWebSocketEvent.FLOWS_ACTORS_APPROVAL_RESPONSE, {
240
240
  systemRef: execution.systemRef,
241
241
  executionId,
@@ -250,6 +250,14 @@ export const FlowsActorsProvider = ({ children }) => {
250
250
  * unconditionally for exactly this reason.
251
251
  */
252
252
  resourceServerInstanceRef: execution.pendingApproval?.resourceServerInstanceRef,
253
+ /*
254
+ * The arguments the approver AUTHORED (#566), when they edited the proposed call.
255
+ *
256
+ * Sent only when present. Sending `{}` for an unedited approval would reach the server as a
257
+ * modification the tool's schema then rejects, turning every ordinary approval into a
258
+ * refusal — the mirror of the defect that made this field necessary.
259
+ */
260
+ ...(modifiedToolArgs ? { modifiedToolArgs } : {}),
253
261
  });
254
262
  updateExecution(executionId, exec => ({
255
263
  ...exec,
@@ -1 +1 @@
1
- {"version":3,"file":"FlowsActorsContext.js","sourceRoot":"","sources":["../../../../src/core/flows-actors/FlowsActorsContext.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,aAAa,EAAE,QAAQ,EAAa,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3G,OAAO,EAGL,kBAAkB,EAClB,6BAA6B,EAC7B,wBAAwB,EACxB,kBAAkB,EAMlB,4CAA4C,GAK7C,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,6DAA6D,CAAC;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,mEAAmE,CAAC;AACpG,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,2DAA2D,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAC3F,OAAO,EAAE,wBAAwB,EAAE,MAAM,iEAAiE,CAAC;AAE3G,MAAM,MAAM,GAA0B,qBAAqB,CAAC,SAAS,EAAE,CAAC;AACxE,MAAM,QAAQ,GAAiE,MAA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P,SAAS;QACT,KAAK;QACL,UAAU;QACV,cAAc;QACd,iBAAiB;QACjB,cAAc;QACd,YAAY;QACZ,SAAS;QACT,cAAc;QACd,wBAAwB;QACxB,kBAAkB;KACnB,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,iBAAiB,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,wBAAwB,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAEvL,OAAO,CACL,KAAC,kBAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,YAAY,YAC7C,QAAQ,GACmB,CAC/B,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React, { createContext, useState, ReactNode, useMemo, useEffect, useCallback, useRef } from 'react';\nimport {\n FlowActorSystem_FrontendInfo,\n FlowsActors_FrontendInfoResponse,\n MAIN_API_BASE_PATH,\n MANUAL_CONTROLLER_ROUTES_URLS,\n ManualControllerRouteKey,\n CoreWebSocketEvent,\n type FlowsActors_ConversationHistoryResponse,\n type WS_FlowsActorsStartPayload,\n type WS_FlowsActorsStartedPayload,\n type WS_FlowsActorsMessagePayload,\n type WS_FlowsActorsApprovalRequestPayload,\n WS_FlowsActorsApprovalAnnouncementDataSchema,\n type WS_FlowsActorsApprovalResponsePayload,\n type WS_FlowsActorsStatusUpdatePayload,\n type WS_FlowsActorsCompletedPayload,\n type WS_FlowsActorsErrorPayload,\n} from '@wildo-ai/saas-models';\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\nimport { errorManagement } from '~wildo-frontend-lib/core/errors/error-management.frontend.service';\nimport { useApplication } from '~wildo-frontend-lib/core/runtime/useApplication';\nimport { useUserOrgs } from '~wildo-frontend-lib/core/security/useUserOrgs';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { useWebSocket } from '~wildo-frontend-lib/core/requests/websockets/useWebSocket';\nimport { useEmitLoadingScope } from '~wildo-frontend-lib/core/loading/useEmitLoadingScope';\nimport { ContextLoadingIdentifier } from '~wildo-frontend-lib/core/loading/loading-types.frontend.schemas';\n\nconst logger: LoggerFrontendService = LoggerFrontendService.getLogger();\nconst logDebug: (message: string, context?: Record<string, unknown>) => void = logger.debugByType('FlowsActorsContext');\nlogger.setDebugTypeLogging('FlowsActorsContext', false);\n\nconst MAX_MESSAGES_PER_EXECUTION: number = 500;\n\ntype ExecutionMessage = FlowsActorsExecution['messages'][number];\n\nfunction appendMessages(existing: ExecutionMessage[], ...newMsgs: ExecutionMessage[]): ExecutionMessage[] {\n const combined = [...existing, ...newMsgs];\n return combined.length > MAX_MESSAGES_PER_EXECUTION\n ? combined.slice(combined.length - MAX_MESSAGES_PER_EXECUTION)\n : combined;\n}\n\n/**\n * Merge one streamed message event into the list. When the event carries a\n * `messageId` matching an existing message, that message is updated in place:\n * a delta event (`isFinal !== true`) appends its `content`; the terminal event\n * (`isFinal === true`) replaces `content` with the authoritative full text (and\n * adopts its rendered `type`, e.g. text → markdown). Events without a known\n * `messageId` are appended as new entries (one-shot / legacy behavior).\n */\nfunction mergeStreamedMessage(\n existing: ExecutionMessage[],\n incoming: ExecutionMessage,\n isFinal: boolean,\n): ExecutionMessage[] {\n if (incoming.messageId) {\n const index = existing.findIndex(m => m.messageId === incoming.messageId);\n if (index >= 0) {\n const updated = [...existing];\n const prev = updated[index];\n updated[index] = {\n ...prev,\n type: incoming.type,\n content: isFinal ? incoming.content : prev.content + incoming.content,\n data: incoming.data ?? prev.data,\n timestamp: incoming.timestamp,\n };\n return updated;\n }\n }\n return appendMessages(existing, incoming);\n}\n\n/**\n * FlowsActors Execution Status\n */\nexport enum FlowsActorsExecutionStatus {\n IDLE = 'idle',\n STARTING = 'starting',\n RUNNING = 'running',\n AWAITING_APPROVAL = 'awaiting_approval',\n COMPLETED = 'completed',\n ERROR = 'error',\n}\n\n/**\n * Active Execution State\n */\nexport interface FlowsActorsExecution {\n executionId: string;\n systemRef: string;\n status: FlowsActorsExecutionStatus;\n progress?: number;\n currentStep?: string;\n messages: Array<{\n type: 'text' | 'markdown' | 'progress' | 'data';\n content: string;\n data?: Record<string, unknown>;\n timestamp: Date;\n /**\n * Correlation id for streamed messages. Consecutive `messageId`-sharing\n * events belong to one logical message: non-final events append their\n * delta to `content`; the final event replaces `content` with the full text.\n * Absent for one-shot messages (each is its own entry).\n */\n messageId?: string;\n }>;\n /**\n * The decision a paused turn is waiting on.\n *\n * `riskLevel` and `requiredRoles` are OPTIONAL because nothing populates them: they belong to\n * `WS_FlowsActorsApprovalRequestPayload`, a payload no code has ever emitted. What the server\n * actually announces is `WS_FlowsActorsApprovalAnnouncementData`, carried in the `data` bag of a\n * PROGRESS message — tool name, tool arguments, timing, and the isolation axis (#528). Typing\n * them as required would let a surface render a risk claim nothing declared.\n */\n pendingApproval?: {\n approvalId: string;\n actionDescription: string;\n riskLevel?: 'low' | 'medium' | 'high' | 'critical';\n expiresAt?: Date;\n requiredRoles?: string[];\n /** The tool call being gated, and its arguments — the structured thing being approved. */\n toolName?: string;\n toolArgs?: Record<string, unknown>;\n requestedAt?: Date;\n /**\n * ECHOED back on the decision. Dropping it filters the resume against the default-instance\n * sentinel, so an approval raised on a named agent instance matches no row and is discarded\n * silently, leaving the turn paused forever.\n */\n resourceServerInstanceRef?: string;\n };\n /** Set when the last error is recoverable (UI can offer a retry action) */\n recoverable?: boolean;\n result?: Record<string, unknown>;\n duration?: number;\n errorCode?: string;\n}\n\n/**\n * FlowsActors Context Type\n */\nexport interface FlowsActorsContextType {\n /** Available frontend-visible FlowActorSystems */\n systems: FlowActorSystem_FrontendInfo[];\n\n /** Loading state */\n isLoading: boolean;\n\n /** Error state */\n error: Error | null;\n\n /** Active executions */\n executions: Map<string, FlowsActorsExecution>;\n\n /** Start a new execution (fire-and-forget via WebSocket; returns local executionId) */\n startExecution: (systemRef: string, initialInput?: Record<string, unknown>, existingExecutionId?: string) => string | null;\n\n /** Respond to an approval request (fire-and-forget via WebSocket) */\n respondToApproval: (executionId: string, approvalId: string, approved: boolean, comment?: string) => void;\n\n /** Remove a completed/errored execution from state */\n clearExecution: (executionId: string) => void;\n\n /** Get execution by ID (reads from ref; consume `executions` to re-render on changes) */\n getExecution: (executionId: string) => FlowsActorsExecution | undefined;\n\n /** Get system by ref */\n getSystem: (systemRef: string) => FlowActorSystem_FrontendInfo | undefined;\n\n /** Refresh systems from backend */\n refreshSystems: () => Promise<void>;\n\n /**\n * Fetch the caller's OWN persisted conversation history for a system (chat\n * threads), most recent last. Server-authoritative (the executions resource,\n * USER_SELF-scoped to the caller) — this is what repopulates the discussions\n * sidebar + transcripts on a fresh page load. Returns `[]` when the backend has\n * no flows-actors history surface (feature absent).\n */\n fetchConversationHistory: (systemRef: string) => Promise<FlowsActors_ConversationHistoryResponse['executions']>;\n\n /**\n * Delete ONE of the caller's own persisted conversations (a discussion). Runs\n * under the caller's auth, so the executions resource's USER_SELF owner filter\n * only ever deletes the caller's own row. Resolves once the server confirms.\n */\n deleteConversation: (executionId: string) => Promise<void>;\n}\n\n/**\n * FlowsActors Context\n * @internal - Use useFlowsActors() hook instead of accessing this directly\n */\nexport const FlowsActorsContext: React.Context<FlowsActorsContextType | undefined> = createContext<FlowsActorsContextType | undefined>(undefined);\n\n/**\n * FlowsActors Provider\n *\n * Manages:\n * - Available FlowActorSystems (fetched at startup)\n * - Active execution state\n * - WebSocket communication for real-time updates\n */\nexport const FlowsActorsProvider: React.FC<{ children: ReactNode }> = ({ children }) => {\n const { appConfig, frontendConfiguration, httpClient } = useApplication();\n const userOrgs = useUserOrgs();\n const appScope = useAppScopeSafe();\n const { on, emit, isConnected } = useWebSocket();\n const hasInitializedRef = useRef(false);\n const hasConfiguredFlowsActorsViews = (frontendConfiguration?.flowsActorsViews?.length ?? 0) > 0;\n\n const [systems, setSystems] = useState<FlowActorSystem_FrontendInfo[]>([]);\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const [executions, setExecutions] = useState<Map<string, FlowsActorsExecution>>(new Map());\n // L-2.b: explicit \"has the registry ever completed at least one successful\n // fetch\" marker, distinct from `systems.length > 0` (an empty registry is\n // still a successful fetch — the backend may legitimately ship zero\n // flow-actor systems for a given app, and we don't want every refresh of an\n // empty registry to render as INITIAL phase).\n const [hasCompletedFetch, setHasCompletedFetch] = useState(false);\n\n useEmitLoadingScope({\n identifier: ContextLoadingIdentifier.FLOWS_ACTORS,\n isLoading,\n hasLoadedOnce: hasCompletedFetch,\n });\n const executionsRef = useRef(executions);\n executionsRef.current = executions;\n\n const updateExecution = useCallback((\n executionId: string,\n updater: (execution: FlowsActorsExecution) => FlowsActorsExecution,\n ): void => {\n setExecutions(prev => {\n const existing = prev.get(executionId);\n if (!existing) return prev;\n const next = new Map(prev);\n next.set(executionId, updater(existing));\n return next;\n });\n }, []);\n\n /**\n * Fetch frontend-visible systems from backend\n */\n const refreshSystems = useCallback(async () => {\n if (!appConfig?.runtime?.endPoints?.main_backend_api) {\n logDebug('Cannot refresh systems - API endpoint not configured');\n return;\n }\n\n if (!httpClient) {\n logDebug('Cannot refresh systems - httpClient not available');\n return;\n }\n\n setIsLoading(true);\n setError(null);\n\n try {\n // Use httpClient which handles authentication automatically. The path is\n // built from the shared route registry (same source the backend controller\n // registers with) so both sides stay in lockstep under MAIN_API_BASE_PATH.\n const data = await httpClient.get<FlowsActors_FrontendInfoResponse>(\n `${MAIN_API_BASE_PATH}${MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.FLOWS_ACTORS_FRONTEND_INFO]}`\n );\n setSystems(data.systems);\n setHasCompletedFetch(true);\n\n logDebug('Systems refreshed', { count: data.systems.length });\n\n } catch (err) {\n if (errorManagement.isNotFoundError(err)) {\n logDebug('FlowsActors backend support not available - skipping systems bootstrap');\n setSystems([]);\n setError(null);\n setHasCompletedFetch(true);\n return;\n }\n\n const error = err instanceof Error ? err : new Error('Unknown error');\n setError(error);\n logDebug('Failed to refresh systems', { error: error.message });\n } finally {\n setIsLoading(false);\n }\n }, [appConfig?.runtime?.endPoints?.main_backend_api, httpClient]);\n\n /**\n * Fetch the caller's persisted conversation history for a system. Runs under\n * the caller's own auth (httpClient), so the executions resource's USER_SELF\n * owner filter restricts rows to the caller's threads. A missing backend\n * surface (feature absent) resolves to `[]`, never an error.\n */\n const fetchConversationHistory = useCallback(async (\n systemRef: string,\n ): Promise<FlowsActors_ConversationHistoryResponse['executions']> => {\n if (!httpClient) {\n logDebug('Cannot fetch conversation history - httpClient not available');\n return [];\n }\n try {\n const basePath = `${MAIN_API_BASE_PATH}${MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.FLOWS_ACTORS_HISTORY]}`;\n const data = await httpClient.get<FlowsActors_ConversationHistoryResponse>(\n `${basePath}?systemRef=${encodeURIComponent(systemRef)}`,\n );\n logDebug('Conversation history fetched', { systemRef, count: data.executions.length });\n return data.executions;\n } catch (err) {\n if (errorManagement.isNotFoundError(err)) {\n logDebug('FlowsActors history surface not available - returning empty history', { systemRef });\n return [];\n }\n logDebug('Failed to fetch conversation history', { systemRef, error: err instanceof Error ? err.message : 'unknown' });\n return [];\n }\n }, [httpClient]);\n\n /**\n * Delete one of the caller's persisted conversations. Owner-scoped server-side\n * (USER_SELF), so a user can only delete their own discussion.\n */\n const deleteConversation = useCallback(async (executionId: string): Promise<void> => {\n if (!httpClient) {\n logDebug('Cannot delete conversation - httpClient not available');\n return;\n }\n const basePath = `${MAIN_API_BASE_PATH}${MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.FLOWS_ACTORS_HISTORY]}`;\n await httpClient.delete(`${basePath}?executionId=${encodeURIComponent(executionId)}`);\n logDebug('Conversation deleted', { executionId });\n }, [httpClient]);\n\n /**\n * Start a new execution via WebSocket (fire-and-forget).\n * Errors are delivered asynchronously via FLOWS_ACTORS_STARTED / FLOWS_ACTORS_ERROR events.\n */\n const startExecution = useCallback((\n systemRef: string,\n initialInput?: Record<string, unknown>,\n existingExecutionId?: string,\n ): string | null => {\n if (!isConnected) {\n logDebug('Cannot start execution — WebSocket not connected', { systemRef });\n return null;\n }\n\n // Reuse the id to CONTINUE a discussion (one execution = one thread); mint a\n // new one to start a fresh discussion.\n const executionId = existingExecutionId ?? crypto.randomUUID();\n logDebug('Starting execution', { systemRef, executionId, hasInput: !!initialInput, isContinuation: !!existingExecutionId });\n\n const contextResourceIdentifiers: Record<string, string> = {};\n if (appScope?.currentOrganizationId) {\n contextResourceIdentifiers.organizationId = appScope.currentOrganizationId;\n }\n\n setExecutions(prev => {\n const next = new Map(prev);\n // Reset messages every turn: the live execution holds ONLY the current\n // turn's streamed reply. Prior turns of a continued thread live in the\n // view's transcript, so keeping them here would make the streamed bubble\n // replay the whole thread (duplicate content).\n next.set(executionId, {\n executionId,\n systemRef,\n status: FlowsActorsExecutionStatus.STARTING,\n messages: [],\n });\n return next;\n });\n\n emit<WS_FlowsActorsStartPayload>(CoreWebSocketEvent.FLOWS_ACTORS_START, {\n systemRef,\n executionId,\n contextResourceIdentifiers,\n initialInput,\n });\n\n return executionId;\n }, [isConnected, emit, appScope?.currentOrganizationId]);\n\n /**\n * Respond to an approval request via WebSocket (fire-and-forget).\n * Backend confirms via FLOWS_ACTORS_STATUS_UPDATE / FLOWS_ACTORS_ERROR events.\n */\n const respondToApproval = useCallback((\n executionId: string,\n approvalId: string,\n approved: boolean,\n comment?: string\n ): void => {\n const execution = executionsRef.current.get(executionId);\n if (!execution) {\n logDebug('Cannot respond to approval — execution not found', { executionId, approvalId });\n return;\n }\n\n if (!isConnected) {\n logDebug('Cannot respond to approval — WebSocket not connected', { executionId, approvalId });\n return;\n }\n\n logDebug('Responding to approval', { executionId, approvalId, approved });\n\n emit<WS_FlowsActorsApprovalResponsePayload>(CoreWebSocketEvent.FLOWS_ACTORS_APPROVAL_RESPONSE, {\n systemRef: execution.systemRef,\n executionId,\n approvalId,\n approved,\n comment,\n /*\n * Echoed, never omitted. The resume filters on owner FK + machine credential + AGENT\n * INSTANCE; without this axis the read is filtered against the default-instance sentinel, so\n * a decision on an approval raised by a NAMED agent matches no row and is dropped silently —\n * logged as \"no pending approval matches\", with the turn paused forever. The server sends it\n * unconditionally for exactly this reason.\n */\n resourceServerInstanceRef: execution.pendingApproval?.resourceServerInstanceRef,\n });\n\n updateExecution(executionId, exec => ({\n ...exec,\n status: approved ? FlowsActorsExecutionStatus.RUNNING : exec.status,\n pendingApproval: undefined,\n }));\n }, [isConnected, emit, updateExecution]);\n\n /**\n * Get execution by ID\n */\n const getExecution = useCallback((executionId: string): FlowsActorsExecution | undefined => {\n return executionsRef.current.get(executionId);\n }, []);\n\n /**\n * Get system by ref\n */\n const getSystem = useCallback((systemRef: string): FlowActorSystem_FrontendInfo | undefined => {\n return systems.find(s => s.ref === systemRef);\n }, [systems]);\n\n const clearExecution = useCallback((executionId: string): void => {\n setExecutions(prev => {\n if (!prev.has(executionId)) return prev;\n const next = new Map(prev);\n next.delete(executionId);\n return next;\n });\n }, []);\n\n /**\n * Initialize on mount when authenticated\n */\n useEffect(() => {\n if (userOrgs.isAuthenticated()) {\n return;\n }\n\n hasInitializedRef.current = false;\n setSystems([]);\n setError(null);\n setExecutions(new Map());\n }, [userOrgs]);\n\n useEffect(() => {\n if (\n !hasInitializedRef.current\n && hasConfiguredFlowsActorsViews\n && appConfig?.runtime?.endPoints?.main_backend_api\n && httpClient\n && userOrgs.isAuthenticated()\n ) {\n hasInitializedRef.current = true;\n refreshSystems();\n }\n }, [\n appConfig?.runtime?.endPoints?.main_backend_api,\n hasConfiguredFlowsActorsViews,\n httpClient,\n userOrgs,\n refreshSystems,\n ]);\n\n /**\n * WebSocket event listeners for FlowsActors inbound events.\n * Follows the WebSocketEventBridge pattern: subscribe on connect, cleanup on disconnect.\n */\n useEffect(() => {\n if (!isConnected) {\n return;\n }\n\n const unsubStarted = on<WS_FlowsActorsStartedPayload>(\n CoreWebSocketEvent.FLOWS_ACTORS_STARTED,\n (payload) => {\n logDebug('Execution started', { executionId: payload.executionId, success: payload.success });\n if (payload.success) {\n updateExecution(payload.executionId, exec => ({\n ...exec,\n status: FlowsActorsExecutionStatus.RUNNING,\n }));\n } else {\n updateExecution(payload.executionId, exec => ({\n ...exec,\n status: FlowsActorsExecutionStatus.ERROR,\n messages: appendMessages(exec.messages, {\n type: 'text' as const,\n content: payload.error ?? 'Execution failed to start',\n timestamp: new Date(),\n }),\n }));\n }\n }\n );\n\n const unsubMessage = on<WS_FlowsActorsMessagePayload>(\n CoreWebSocketEvent.FLOWS_ACTORS_MESSAGE,\n (payload) => {\n logDebug('Execution message', { executionId: payload.executionId, type: payload.messageType, messageId: payload.messageId, isFinal: payload.isFinal });\n\n /*\n * A pause is announced HERE, inside a PROGRESS message's `data` bag — not on\n * `FLOWS_ACTORS_APPROVAL_REQUEST`, which nothing emits. Parsed rather than key-picked, so\n * the browser and the producer share one named contract; a bag that is not an announcement\n * simply fails the parse and the message is stored like any other (#528).\n */\n const announcement = WS_FlowsActorsApprovalAnnouncementDataSchema.safeParse(payload.data);\n if (announcement.success) {\n const { approvalId, toolName, toolArgs, requestedAt, expiresAt, resourceServerInstanceRef } = announcement.data;\n logDebug('Approval requested', { executionId: payload.executionId, approvalId, toolName });\n updateExecution(payload.executionId, exec => ({\n ...exec,\n status: FlowsActorsExecutionStatus.AWAITING_APPROVAL,\n pendingApproval: {\n approvalId,\n // The server's own PROGRESS text, reused rather than composed here: manufacturing\n // display text from `toolName` in the browser would invent wording that no i18n\n // tree owns.\n actionDescription: payload.content,\n toolName,\n toolArgs,\n requestedAt: new Date(requestedAt),\n expiresAt: expiresAt ? new Date(expiresAt) : undefined,\n resourceServerInstanceRef,\n },\n }));\n }\n\n updateExecution(payload.executionId, exec => ({\n ...exec,\n messages: mergeStreamedMessage(\n exec.messages,\n {\n type: payload.messageType,\n content: payload.content,\n data: payload.data,\n timestamp: payload.timestamp instanceof Date ? payload.timestamp : new Date(payload.timestamp),\n messageId: payload.messageId,\n },\n payload.isFinal === true,\n ),\n }));\n }\n );\n\n /*\n * UNREACHABLE TODAY, and kept deliberately rather than deleted.\n *\n * No code anywhere emits `FLOWS_ACTORS_APPROVAL_REQUEST` — the string occurs once in the whole\n * tree, in its own enum declaration — so this handler has never run. The live announcement is\n * parsed in the FLOWS_ACTORS_MESSAGE handler above. Whether the richer payload\n * (`actionDescription`, `riskLevel`, `requiredRoles`) should be populated by the server or\n * withdrawn is a decision recorded on #528, not something to settle by deleting the listener:\n * if it is ever emitted, an approval must still be observable here.\n *\n * Note it cannot supply `resourceServerInstanceRef` — its payload has no such field — so a\n * decision answered from this path alone would still be unresumable on a named agent instance.\n * That is another reason the payload's fate needs deciding rather than assuming.\n */\n const unsubApproval = on<WS_FlowsActorsApprovalRequestPayload>(\n CoreWebSocketEvent.FLOWS_ACTORS_APPROVAL_REQUEST,\n (payload) => {\n logDebug('Approval requested', { executionId: payload.executionId, approvalId: payload.approvalId, riskLevel: payload.riskLevel });\n updateExecution(payload.executionId, exec => ({\n ...exec,\n status: FlowsActorsExecutionStatus.AWAITING_APPROVAL,\n pendingApproval: {\n approvalId: payload.approvalId,\n actionDescription: payload.actionDescription,\n riskLevel: payload.riskLevel,\n expiresAt: payload.expiresAt instanceof Date ? payload.expiresAt : (payload.expiresAt ? new Date(payload.expiresAt) : undefined),\n requiredRoles: payload.requiredRoles,\n },\n }));\n }\n );\n\n const unsubStatus = on<WS_FlowsActorsStatusUpdatePayload>(\n CoreWebSocketEvent.FLOWS_ACTORS_STATUS_UPDATE,\n (payload) => {\n logDebug('Status update', { executionId: payload.executionId, status: payload.status, progress: payload.progress });\n updateExecution(payload.executionId, exec => ({\n ...exec,\n status: FlowsActorsExecutionStatus.RUNNING,\n progress: payload.progress,\n currentStep: payload.currentStep ?? payload.status,\n }));\n }\n );\n\n const unsubCompleted = on<WS_FlowsActorsCompletedPayload>(\n CoreWebSocketEvent.FLOWS_ACTORS_COMPLETED,\n (payload) => {\n logDebug('Execution completed', { executionId: payload.executionId, success: payload.success, duration: payload.duration });\n updateExecution(payload.executionId, exec => ({\n ...exec,\n status: payload.success ? FlowsActorsExecutionStatus.COMPLETED : FlowsActorsExecutionStatus.ERROR,\n progress: payload.success ? 100 : exec.progress,\n pendingApproval: undefined,\n result: payload.result,\n duration: payload.duration,\n messages: payload.success\n ? exec.messages\n : appendMessages(exec.messages, {\n type: 'text' as const,\n content: 'Execution completed with errors',\n timestamp: new Date(),\n }),\n }));\n }\n );\n\n const unsubError = on<WS_FlowsActorsErrorPayload>(\n CoreWebSocketEvent.FLOWS_ACTORS_ERROR,\n (payload) => {\n logDebug('Execution error', { executionId: payload.executionId, errorCode: payload.errorCode, recoverable: payload.recoverable });\n updateExecution(payload.executionId, exec => ({\n ...exec,\n status: FlowsActorsExecutionStatus.ERROR,\n recoverable: payload.recoverable,\n errorCode: payload.errorCode,\n pendingApproval: undefined,\n messages: appendMessages(exec.messages, {\n type: 'text' as const,\n content: payload.errorMessage,\n timestamp: new Date(),\n }),\n }));\n }\n );\n\n return () => {\n unsubStarted();\n unsubMessage();\n unsubApproval();\n unsubStatus();\n unsubCompleted();\n unsubError();\n };\n }, [isConnected, on, updateExecution]);\n\n const contextValue = useMemo<FlowsActorsContextType>(() => ({\n systems,\n isLoading,\n error,\n executions,\n startExecution,\n respondToApproval,\n clearExecution,\n getExecution,\n getSystem,\n refreshSystems,\n fetchConversationHistory,\n deleteConversation,\n }), [systems, isLoading, error, executions, startExecution, respondToApproval, clearExecution, getExecution, getSystem, refreshSystems, fetchConversationHistory, deleteConversation]);\n\n return (\n <FlowsActorsContext.Provider value={contextValue}>\n {children}\n </FlowsActorsContext.Provider>\n );\n};\n"]}
1
+ {"version":3,"file":"FlowsActorsContext.js","sourceRoot":"","sources":["../../../../src/core/flows-actors/FlowsActorsContext.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,aAAa,EAAE,QAAQ,EAAa,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC3G,OAAO,EAGL,kBAAkB,EAClB,6BAA6B,EAC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} from 'react';\nimport {\n FlowActorSystem_FrontendInfo,\n FlowsActors_FrontendInfoResponse,\n MAIN_API_BASE_PATH,\n MANUAL_CONTROLLER_ROUTES_URLS,\n ManualControllerRouteKey,\n CoreWebSocketEvent,\n type FlowsActors_ConversationHistoryResponse,\n type WS_FlowsActorsStartPayload,\n type WS_FlowsActorsStartedPayload,\n type WS_FlowsActorsMessagePayload,\n type WS_FlowsActorsApprovalRequestPayload,\n WS_FlowsActorsApprovalAnnouncementDataSchema,\n type WS_FlowsActorsApprovalResponsePayload,\n type WS_FlowsActorsStatusUpdatePayload,\n type WS_FlowsActorsCompletedPayload,\n type WS_FlowsActorsErrorPayload,\n} from '@wildo-ai/saas-models';\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\nimport { errorManagement } from '~wildo-frontend-lib/core/errors/error-management.frontend.service';\nimport { useApplication } from '~wildo-frontend-lib/core/runtime/useApplication';\nimport { useUserOrgs } from '~wildo-frontend-lib/core/security/useUserOrgs';\nimport { useAppScopeSafe } from '~wildo-frontend-lib/core/scope/useAppScope';\nimport { useWebSocket } from '~wildo-frontend-lib/core/requests/websockets/useWebSocket';\nimport { useEmitLoadingScope } from '~wildo-frontend-lib/core/loading/useEmitLoadingScope';\nimport { ContextLoadingIdentifier } from '~wildo-frontend-lib/core/loading/loading-types.frontend.schemas';\n\nconst logger: LoggerFrontendService = LoggerFrontendService.getLogger();\nconst logDebug: (message: string, context?: Record<string, unknown>) => void = logger.debugByType('FlowsActorsContext');\nlogger.setDebugTypeLogging('FlowsActorsContext', false);\n\nconst MAX_MESSAGES_PER_EXECUTION: number = 500;\n\ntype ExecutionMessage = FlowsActorsExecution['messages'][number];\n\nfunction appendMessages(existing: ExecutionMessage[], ...newMsgs: ExecutionMessage[]): ExecutionMessage[] {\n const combined = [...existing, ...newMsgs];\n return combined.length > MAX_MESSAGES_PER_EXECUTION\n ? combined.slice(combined.length - MAX_MESSAGES_PER_EXECUTION)\n : combined;\n}\n\n/**\n * Merge one streamed message event into the list. When the event carries a\n * `messageId` matching an existing message, that message is updated in place:\n * a delta event (`isFinal !== true`) appends its `content`; the terminal event\n * (`isFinal === true`) replaces `content` with the authoritative full text (and\n * adopts its rendered `type`, e.g. text → markdown). Events without a known\n * `messageId` are appended as new entries (one-shot / legacy behavior).\n */\nfunction mergeStreamedMessage(\n existing: ExecutionMessage[],\n incoming: ExecutionMessage,\n isFinal: boolean,\n): ExecutionMessage[] {\n if (incoming.messageId) {\n const index = existing.findIndex(m => m.messageId === incoming.messageId);\n if (index >= 0) {\n const updated = [...existing];\n const prev = updated[index];\n updated[index] = {\n ...prev,\n type: incoming.type,\n content: isFinal ? incoming.content : prev.content + incoming.content,\n data: incoming.data ?? prev.data,\n timestamp: incoming.timestamp,\n };\n return updated;\n }\n }\n return appendMessages(existing, incoming);\n}\n\n/**\n * FlowsActors Execution Status\n */\nexport enum FlowsActorsExecutionStatus {\n IDLE = 'idle',\n STARTING = 'starting',\n RUNNING = 'running',\n AWAITING_APPROVAL = 'awaiting_approval',\n COMPLETED = 'completed',\n ERROR = 'error',\n}\n\n/**\n * Active Execution State\n */\nexport interface FlowsActorsExecution {\n executionId: string;\n systemRef: string;\n status: FlowsActorsExecutionStatus;\n progress?: number;\n currentStep?: string;\n messages: Array<{\n type: 'text' | 'markdown' | 'progress' | 'data';\n content: string;\n data?: Record<string, unknown>;\n timestamp: Date;\n /**\n * Correlation id for streamed messages. Consecutive `messageId`-sharing\n * events belong to one logical message: non-final events append their\n * delta to `content`; the final event replaces `content` with the full text.\n * Absent for one-shot messages (each is its own entry).\n */\n messageId?: string;\n }>;\n /**\n * The decision a paused turn is waiting on.\n *\n * `riskLevel` and `requiredRoles` are OPTIONAL because nothing populates them: they belong to\n * `WS_FlowsActorsApprovalRequestPayload`, a payload no code has ever emitted. What the server\n * actually announces is `WS_FlowsActorsApprovalAnnouncementData`, carried in the `data` bag of a\n * PROGRESS message — tool name, tool arguments, timing, and the isolation axis (#528). Typing\n * them as required would let a surface render a risk claim nothing declared.\n */\n pendingApproval?: {\n approvalId: string;\n actionDescription: string;\n riskLevel?: 'low' | 'medium' | 'high' | 'critical';\n expiresAt?: Date;\n requiredRoles?: string[];\n /** The tool call being gated, and its arguments — the structured thing being approved. */\n toolName?: string;\n toolArgs?: Record<string, unknown>;\n requestedAt?: Date;\n /**\n * ECHOED back on the decision. Dropping it filters the resume against the default-instance\n * sentinel, so an approval raised on a named agent instance matches no row and is discarded\n * silently, leaving the turn paused forever.\n */\n resourceServerInstanceRef?: string;\n };\n /** Set when the last error is recoverable (UI can offer a retry action) */\n recoverable?: boolean;\n result?: Record<string, unknown>;\n duration?: number;\n errorCode?: string;\n}\n\n/**\n * FlowsActors Context Type\n */\nexport interface FlowsActorsContextType {\n /** Available frontend-visible FlowActorSystems */\n systems: FlowActorSystem_FrontendInfo[];\n\n /** Loading state */\n isLoading: boolean;\n\n /** Error state */\n error: Error | null;\n\n /** Active executions */\n executions: Map<string, FlowsActorsExecution>;\n\n /** Start a new execution (fire-and-forget via WebSocket; returns local executionId) */\n startExecution: (systemRef: string, initialInput?: Record<string, unknown>, existingExecutionId?: string) => string | null;\n\n /** Respond to an approval request (fire-and-forget via WebSocket) */\n /**\n * `modifiedToolArgs` (#566) replaces the arguments the agent proposed. Absent means \"run the call\n * as proposed\"; the server validates the edit against the tool's own schema and refuses through\n * `FLOWS_ACTORS_ERROR` with the approval left pending.\n */\n respondToApproval: (executionId: string, approvalId: string, approved: boolean, comment?: string, modifiedToolArgs?: Record<string, unknown>) => void;\n\n /** Remove a completed/errored execution from state */\n clearExecution: (executionId: string) => void;\n\n /** Get execution by ID (reads from ref; consume `executions` to re-render on changes) */\n getExecution: (executionId: string) => FlowsActorsExecution | undefined;\n\n /** Get system by ref */\n getSystem: (systemRef: string) => FlowActorSystem_FrontendInfo | undefined;\n\n /** Refresh systems from backend */\n refreshSystems: () => Promise<void>;\n\n /**\n * Fetch the caller's OWN persisted conversation history for a system (chat\n * threads), most recent last. Server-authoritative (the executions resource,\n * USER_SELF-scoped to the caller) — this is what repopulates the discussions\n * sidebar + transcripts on a fresh page load. Returns `[]` when the backend has\n * no flows-actors history surface (feature absent).\n */\n fetchConversationHistory: (systemRef: string) => Promise<FlowsActors_ConversationHistoryResponse['executions']>;\n\n /**\n * Delete ONE of the caller's own persisted conversations (a discussion). Runs\n * under the caller's auth, so the executions resource's USER_SELF owner filter\n * only ever deletes the caller's own row. Resolves once the server confirms.\n */\n deleteConversation: (executionId: string) => Promise<void>;\n}\n\n/**\n * FlowsActors Context\n * @internal - Use useFlowsActors() hook instead of accessing this directly\n */\nexport const FlowsActorsContext: React.Context<FlowsActorsContextType | undefined> = createContext<FlowsActorsContextType | undefined>(undefined);\n\n/**\n * FlowsActors Provider\n *\n * Manages:\n * - Available FlowActorSystems (fetched at startup)\n * - Active execution state\n * - WebSocket communication for real-time updates\n */\nexport const FlowsActorsProvider: React.FC<{ children: ReactNode }> = ({ children }) => {\n const { appConfig, frontendConfiguration, httpClient } = useApplication();\n const userOrgs = useUserOrgs();\n const appScope = useAppScopeSafe();\n const { on, emit, isConnected } = useWebSocket();\n const hasInitializedRef = useRef(false);\n const hasConfiguredFlowsActorsViews = (frontendConfiguration?.flowsActorsViews?.length ?? 0) > 0;\n\n const [systems, setSystems] = useState<FlowActorSystem_FrontendInfo[]>([]);\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n const [executions, setExecutions] = useState<Map<string, FlowsActorsExecution>>(new Map());\n // L-2.b: explicit \"has the registry ever completed at least one successful\n // fetch\" marker, distinct from `systems.length > 0` (an empty registry is\n // still a successful fetch — the backend may legitimately ship zero\n // flow-actor systems for a given app, and we don't want every refresh of an\n // empty registry to render as INITIAL phase).\n const [hasCompletedFetch, setHasCompletedFetch] = useState(false);\n\n useEmitLoadingScope({\n identifier: ContextLoadingIdentifier.FLOWS_ACTORS,\n isLoading,\n hasLoadedOnce: hasCompletedFetch,\n });\n const executionsRef = useRef(executions);\n executionsRef.current = executions;\n\n const updateExecution = useCallback((\n executionId: string,\n updater: (execution: FlowsActorsExecution) => FlowsActorsExecution,\n ): void => {\n setExecutions(prev => {\n const existing = prev.get(executionId);\n if (!existing) return prev;\n const next = new Map(prev);\n next.set(executionId, updater(existing));\n return next;\n });\n }, []);\n\n /**\n * Fetch frontend-visible systems from backend\n */\n const refreshSystems = useCallback(async () => {\n if (!appConfig?.runtime?.endPoints?.main_backend_api) {\n logDebug('Cannot refresh systems - API endpoint not configured');\n return;\n }\n\n if (!httpClient) {\n logDebug('Cannot refresh systems - httpClient not available');\n return;\n }\n\n setIsLoading(true);\n setError(null);\n\n try {\n // Use httpClient which handles authentication automatically. The path is\n // built from the shared route registry (same source the backend controller\n // registers with) so both sides stay in lockstep under MAIN_API_BASE_PATH.\n const data = await httpClient.get<FlowsActors_FrontendInfoResponse>(\n `${MAIN_API_BASE_PATH}${MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.FLOWS_ACTORS_FRONTEND_INFO]}`\n );\n setSystems(data.systems);\n setHasCompletedFetch(true);\n\n logDebug('Systems refreshed', { count: data.systems.length });\n\n } catch (err) {\n if (errorManagement.isNotFoundError(err)) {\n logDebug('FlowsActors backend support not available - skipping systems bootstrap');\n setSystems([]);\n setError(null);\n setHasCompletedFetch(true);\n return;\n }\n\n const error = err instanceof Error ? err : new Error('Unknown error');\n setError(error);\n logDebug('Failed to refresh systems', { error: error.message });\n } finally {\n setIsLoading(false);\n }\n }, [appConfig?.runtime?.endPoints?.main_backend_api, httpClient]);\n\n /**\n * Fetch the caller's persisted conversation history for a system. Runs under\n * the caller's own auth (httpClient), so the executions resource's USER_SELF\n * owner filter restricts rows to the caller's threads. A missing backend\n * surface (feature absent) resolves to `[]`, never an error.\n */\n const fetchConversationHistory = useCallback(async (\n systemRef: string,\n ): Promise<FlowsActors_ConversationHistoryResponse['executions']> => {\n if (!httpClient) {\n logDebug('Cannot fetch conversation history - httpClient not available');\n return [];\n }\n try {\n const basePath = `${MAIN_API_BASE_PATH}${MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.FLOWS_ACTORS_HISTORY]}`;\n const data = await httpClient.get<FlowsActors_ConversationHistoryResponse>(\n `${basePath}?systemRef=${encodeURIComponent(systemRef)}`,\n );\n logDebug('Conversation history fetched', { systemRef, count: data.executions.length });\n return data.executions;\n } catch (err) {\n if (errorManagement.isNotFoundError(err)) {\n logDebug('FlowsActors history surface not available - returning empty history', { systemRef });\n return [];\n }\n logDebug('Failed to fetch conversation history', { systemRef, error: err instanceof Error ? err.message : 'unknown' });\n return [];\n }\n }, [httpClient]);\n\n /**\n * Delete one of the caller's persisted conversations. Owner-scoped server-side\n * (USER_SELF), so a user can only delete their own discussion.\n */\n const deleteConversation = useCallback(async (executionId: string): Promise<void> => {\n if (!httpClient) {\n logDebug('Cannot delete conversation - httpClient not available');\n return;\n }\n const basePath = `${MAIN_API_BASE_PATH}${MANUAL_CONTROLLER_ROUTES_URLS[ManualControllerRouteKey.FLOWS_ACTORS_HISTORY]}`;\n await httpClient.delete(`${basePath}?executionId=${encodeURIComponent(executionId)}`);\n logDebug('Conversation deleted', { executionId });\n }, [httpClient]);\n\n /**\n * Start a new execution via WebSocket (fire-and-forget).\n * Errors are delivered asynchronously via FLOWS_ACTORS_STARTED / FLOWS_ACTORS_ERROR events.\n */\n const startExecution = useCallback((\n systemRef: string,\n initialInput?: Record<string, unknown>,\n existingExecutionId?: string,\n ): string | null => {\n if (!isConnected) {\n logDebug('Cannot start execution — WebSocket not connected', { systemRef });\n return null;\n }\n\n // Reuse the id to CONTINUE a discussion (one execution = one thread); mint a\n // new one to start a fresh discussion.\n const executionId = existingExecutionId ?? crypto.randomUUID();\n logDebug('Starting execution', { systemRef, executionId, hasInput: !!initialInput, isContinuation: !!existingExecutionId });\n\n const contextResourceIdentifiers: Record<string, string> = {};\n if (appScope?.currentOrganizationId) {\n contextResourceIdentifiers.organizationId = appScope.currentOrganizationId;\n }\n\n setExecutions(prev => {\n const next = new Map(prev);\n // Reset messages every turn: the live execution holds ONLY the current\n // turn's streamed reply. Prior turns of a continued thread live in the\n // view's transcript, so keeping them here would make the streamed bubble\n // replay the whole thread (duplicate content).\n next.set(executionId, {\n executionId,\n systemRef,\n status: FlowsActorsExecutionStatus.STARTING,\n messages: [],\n });\n return next;\n });\n\n emit<WS_FlowsActorsStartPayload>(CoreWebSocketEvent.FLOWS_ACTORS_START, {\n systemRef,\n executionId,\n contextResourceIdentifiers,\n initialInput,\n });\n\n return executionId;\n }, [isConnected, emit, appScope?.currentOrganizationId]);\n\n /**\n * Respond to an approval request via WebSocket (fire-and-forget).\n * Backend confirms via FLOWS_ACTORS_STATUS_UPDATE / FLOWS_ACTORS_ERROR events.\n */\n const respondToApproval = useCallback((\n executionId: string,\n approvalId: string,\n approved: boolean,\n comment?: string,\n modifiedToolArgs?: Record<string, unknown>\n ): void => {\n const execution = executionsRef.current.get(executionId);\n if (!execution) {\n logDebug('Cannot respond to approval — execution not found', { executionId, approvalId });\n return;\n }\n\n if (!isConnected) {\n logDebug('Cannot respond to approval — WebSocket not connected', { executionId, approvalId });\n return;\n }\n\n logDebug('Responding to approval', { executionId, approvalId, approved, modified: modifiedToolArgs !== undefined });\n\n emit<WS_FlowsActorsApprovalResponsePayload>(CoreWebSocketEvent.FLOWS_ACTORS_APPROVAL_RESPONSE, {\n systemRef: execution.systemRef,\n executionId,\n approvalId,\n approved,\n comment,\n /*\n * Echoed, never omitted. The resume filters on owner FK + machine credential + AGENT\n * INSTANCE; without this axis the read is filtered against the default-instance sentinel, so\n * a decision on an approval raised by a NAMED agent matches no row and is dropped silently —\n * logged as \"no pending approval matches\", with the turn paused forever. The server sends it\n * unconditionally for exactly this reason.\n */\n resourceServerInstanceRef: execution.pendingApproval?.resourceServerInstanceRef,\n /*\n * The arguments the approver AUTHORED (#566), when they edited the proposed call.\n *\n * Sent only when present. Sending `{}` for an unedited approval would reach the server as a\n * modification the tool's schema then rejects, turning every ordinary approval into a\n * refusal — the mirror of the defect that made this field necessary.\n */\n ...(modifiedToolArgs ? { modifiedToolArgs } : {}),\n });\n\n updateExecution(executionId, exec => ({\n ...exec,\n status: approved ? FlowsActorsExecutionStatus.RUNNING : exec.status,\n pendingApproval: undefined,\n }));\n }, [isConnected, emit, updateExecution]);\n\n /**\n * Get execution by ID\n */\n const getExecution = useCallback((executionId: string): FlowsActorsExecution | undefined => {\n return executionsRef.current.get(executionId);\n }, []);\n\n /**\n * Get system by ref\n */\n const getSystem = useCallback((systemRef: string): FlowActorSystem_FrontendInfo | undefined => {\n return systems.find(s => s.ref === systemRef);\n }, [systems]);\n\n const clearExecution = useCallback((executionId: string): void => {\n setExecutions(prev => {\n if (!prev.has(executionId)) return prev;\n const next = new Map(prev);\n next.delete(executionId);\n return next;\n });\n }, []);\n\n /**\n * Initialize on mount when authenticated\n */\n useEffect(() => {\n if (userOrgs.isAuthenticated()) {\n return;\n }\n\n hasInitializedRef.current = false;\n setSystems([]);\n setError(null);\n setExecutions(new Map());\n }, [userOrgs]);\n\n useEffect(() => {\n if (\n !hasInitializedRef.current\n && hasConfiguredFlowsActorsViews\n && appConfig?.runtime?.endPoints?.main_backend_api\n && httpClient\n && userOrgs.isAuthenticated()\n ) {\n hasInitializedRef.current = true;\n refreshSystems();\n }\n }, [\n appConfig?.runtime?.endPoints?.main_backend_api,\n hasConfiguredFlowsActorsViews,\n httpClient,\n userOrgs,\n refreshSystems,\n ]);\n\n /**\n * WebSocket event listeners for FlowsActors inbound events.\n * Follows the WebSocketEventBridge pattern: subscribe on connect, cleanup on disconnect.\n */\n useEffect(() => {\n if (!isConnected) {\n return;\n }\n\n const unsubStarted = on<WS_FlowsActorsStartedPayload>(\n CoreWebSocketEvent.FLOWS_ACTORS_STARTED,\n (payload) => {\n logDebug('Execution started', { executionId: payload.executionId, success: payload.success });\n if (payload.success) {\n updateExecution(payload.executionId, exec => ({\n ...exec,\n status: FlowsActorsExecutionStatus.RUNNING,\n }));\n } else {\n updateExecution(payload.executionId, exec => ({\n ...exec,\n status: FlowsActorsExecutionStatus.ERROR,\n messages: appendMessages(exec.messages, {\n type: 'text' as const,\n content: payload.error ?? 'Execution failed to start',\n timestamp: new Date(),\n }),\n }));\n }\n }\n );\n\n const unsubMessage = on<WS_FlowsActorsMessagePayload>(\n CoreWebSocketEvent.FLOWS_ACTORS_MESSAGE,\n (payload) => {\n logDebug('Execution message', { executionId: payload.executionId, type: payload.messageType, messageId: payload.messageId, isFinal: payload.isFinal });\n\n /*\n * A pause is announced HERE, inside a PROGRESS message's `data` bag — not on\n * `FLOWS_ACTORS_APPROVAL_REQUEST`, which nothing emits. Parsed rather than key-picked, so\n * the browser and the producer share one named contract; a bag that is not an announcement\n * simply fails the parse and the message is stored like any other (#528).\n */\n const announcement = WS_FlowsActorsApprovalAnnouncementDataSchema.safeParse(payload.data);\n if (announcement.success) {\n const { approvalId, toolName, toolArgs, requestedAt, expiresAt, resourceServerInstanceRef } = announcement.data;\n logDebug('Approval requested', { executionId: payload.executionId, approvalId, toolName });\n updateExecution(payload.executionId, exec => ({\n ...exec,\n status: FlowsActorsExecutionStatus.AWAITING_APPROVAL,\n pendingApproval: {\n approvalId,\n // The server's own PROGRESS text, reused rather than composed here: manufacturing\n // display text from `toolName` in the browser would invent wording that no i18n\n // tree owns.\n actionDescription: payload.content,\n toolName,\n toolArgs,\n requestedAt: new Date(requestedAt),\n expiresAt: expiresAt ? new Date(expiresAt) : undefined,\n resourceServerInstanceRef,\n },\n }));\n }\n\n updateExecution(payload.executionId, exec => ({\n ...exec,\n messages: mergeStreamedMessage(\n exec.messages,\n {\n type: payload.messageType,\n content: payload.content,\n data: payload.data,\n timestamp: payload.timestamp instanceof Date ? payload.timestamp : new Date(payload.timestamp),\n messageId: payload.messageId,\n },\n payload.isFinal === true,\n ),\n }));\n }\n );\n\n /*\n * UNREACHABLE TODAY, and kept deliberately rather than deleted.\n *\n * No code anywhere emits `FLOWS_ACTORS_APPROVAL_REQUEST` — the string occurs once in the whole\n * tree, in its own enum declaration — so this handler has never run. The live announcement is\n * parsed in the FLOWS_ACTORS_MESSAGE handler above. Whether the richer payload\n * (`actionDescription`, `riskLevel`, `requiredRoles`) should be populated by the server or\n * withdrawn is a decision recorded on #528, not something to settle by deleting the listener:\n * if it is ever emitted, an approval must still be observable here.\n *\n * Note it cannot supply `resourceServerInstanceRef` — its payload has no such field — so a\n * decision answered from this path alone would still be unresumable on a named agent instance.\n * That is another reason the payload's fate needs deciding rather than assuming.\n */\n const unsubApproval = on<WS_FlowsActorsApprovalRequestPayload>(\n CoreWebSocketEvent.FLOWS_ACTORS_APPROVAL_REQUEST,\n (payload) => {\n logDebug('Approval requested', { executionId: payload.executionId, approvalId: payload.approvalId, riskLevel: payload.riskLevel });\n updateExecution(payload.executionId, exec => ({\n ...exec,\n status: FlowsActorsExecutionStatus.AWAITING_APPROVAL,\n pendingApproval: {\n approvalId: payload.approvalId,\n actionDescription: payload.actionDescription,\n riskLevel: payload.riskLevel,\n expiresAt: payload.expiresAt instanceof Date ? payload.expiresAt : (payload.expiresAt ? new Date(payload.expiresAt) : undefined),\n requiredRoles: payload.requiredRoles,\n },\n }));\n }\n );\n\n const unsubStatus = on<WS_FlowsActorsStatusUpdatePayload>(\n CoreWebSocketEvent.FLOWS_ACTORS_STATUS_UPDATE,\n (payload) => {\n logDebug('Status update', { executionId: payload.executionId, status: payload.status, progress: payload.progress });\n updateExecution(payload.executionId, exec => ({\n ...exec,\n status: FlowsActorsExecutionStatus.RUNNING,\n progress: payload.progress,\n currentStep: payload.currentStep ?? payload.status,\n }));\n }\n );\n\n const unsubCompleted = on<WS_FlowsActorsCompletedPayload>(\n CoreWebSocketEvent.FLOWS_ACTORS_COMPLETED,\n (payload) => {\n logDebug('Execution completed', { executionId: payload.executionId, success: payload.success, duration: payload.duration });\n updateExecution(payload.executionId, exec => ({\n ...exec,\n status: payload.success ? FlowsActorsExecutionStatus.COMPLETED : FlowsActorsExecutionStatus.ERROR,\n progress: payload.success ? 100 : exec.progress,\n pendingApproval: undefined,\n result: payload.result,\n duration: payload.duration,\n messages: payload.success\n ? exec.messages\n : appendMessages(exec.messages, {\n type: 'text' as const,\n content: 'Execution completed with errors',\n timestamp: new Date(),\n }),\n }));\n }\n );\n\n const unsubError = on<WS_FlowsActorsErrorPayload>(\n CoreWebSocketEvent.FLOWS_ACTORS_ERROR,\n (payload) => {\n logDebug('Execution error', { executionId: payload.executionId, errorCode: payload.errorCode, recoverable: payload.recoverable });\n updateExecution(payload.executionId, exec => ({\n ...exec,\n status: FlowsActorsExecutionStatus.ERROR,\n recoverable: payload.recoverable,\n errorCode: payload.errorCode,\n pendingApproval: undefined,\n messages: appendMessages(exec.messages, {\n type: 'text' as const,\n content: payload.errorMessage,\n timestamp: new Date(),\n }),\n }));\n }\n );\n\n return () => {\n unsubStarted();\n unsubMessage();\n unsubApproval();\n unsubStatus();\n unsubCompleted();\n unsubError();\n };\n }, [isConnected, on, updateExecution]);\n\n const contextValue = useMemo<FlowsActorsContextType>(() => ({\n systems,\n isLoading,\n error,\n executions,\n startExecution,\n respondToApproval,\n clearExecution,\n getExecution,\n getSystem,\n refreshSystems,\n fetchConversationHistory,\n deleteConversation,\n }), [systems, isLoading, error, executions, startExecution, respondToApproval, clearExecution, getExecution, getSystem, refreshSystems, fetchConversationHistory, deleteConversation]);\n\n return (\n <FlowsActorsContext.Provider value={contextValue}>\n {children}\n </FlowsActorsContext.Provider>\n );\n};\n"]}
@@ -136,6 +136,29 @@ export interface I18nContextType {
136
136
  makeTrComponent: (componentType: FrontendComponentType) => (key: string, params?: Record<string, string | number>) => string;
137
137
  makeTrSystemEnum: (enumName: SystemEnumName) => (enumValue: string) => string;
138
138
  }
139
+ /**
140
+ * What an unresolved catalogue label renders as — the RAW KEY, never words invented from it.
141
+ *
142
+ * These keys name things an operator authored (a billing product, a feature, a limit, a credit
143
+ * pool, a role, a milestone category), and until 2026-09-08 a missing label was replaced by a
144
+ * humanizer: `'ai_assistant'` became `'Ai Assistant'`, in English, in every locale. It read as a
145
+ * finished surface, so nobody ever added the label — the whole defect #420 records. It was also
146
+ * wrong on the cases it could not see (`GDPR` -> `Gdpr`, `EUR` -> `Eur`), because which all-caps
147
+ * token is an acronym is not knowable from the string.
148
+ *
149
+ * The key itself is the honest rendering: visible, greppable, obviously not a label, and identical
150
+ * in every locale because it is not a translation. It is what `t()` already returns for an
151
+ * unresolved key, so this is the surrounding convention rather than a new one.
152
+ *
153
+ * It is only ever reached AFTER labels have settled — surfaces gate on `useI18n().isReady`, which
154
+ * settles on a failed bundle as well as a loaded one, so a key is never flashed during the load.
155
+ *
156
+ * EXPORTED so the convention has one home. A second surface outside this module needs it —
157
+ * `NavigationItemBadge`, whose accessible name falls back to a badge identity — and an inlined
158
+ * `?? someKey` there would be the same decision taken twice, in a place where nothing records that
159
+ * it IS a decision. Callers outside this file should reach it through the package root.
160
+ */
161
+ export declare function unresolvedLabel(key: string): string;
139
162
  /**
140
163
  * I18n Context
141
164
  * Exported for use in separate hook file (Fast Refresh compatibility)
@@ -1 +1 @@
1
- {"version":3,"file":"I18nContext.d.ts","sourceRoot":"","sources":["../../../../src/core/i18n/I18nContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA2B,SAAS,EAAuD,MAAM,OAAO,CAAC;AAGvH,OAAO,EACW,qBAAqB,EAAE,iBAAiB,EACxD,cAAc,EAA6C,aAAa,EACxE,KAAK,wBAAwB,EAE7B,yBAAyB,EAC1B,MAAM,qCAAqC,CAAC;AAU7C,OAAO,EAGL,uBAAuB,EACvB,eAAe,EACf,KAAK,mBAAmB,EAGzB,MAAM,uBAAuB,CAAC;AAI/B;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,WAAW;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC;CACrC;AAED,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AAEpE,MAAM,WAAW,eAAe;IAE9B,eAAe,EAAE,iBAAiB,CAAC;IACnC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,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;IAC1H,wBAAwB,EAAK,CAAE,eAAe,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;IAC9H,qBAAqB,EAAQ,CAAE,YAAY,EAAE,MAAM,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;IAC1H,eAAe,EAAc,CAAE,aAAa,EAAE,qBAAqB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;IAC1I,gBAAgB,EAAa,CAAC,QAAQ,EAAE,cAAc,KAAK,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;CAC1F;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,OAAO,CAAC,eAAe,GAAG,SAAS,CAAyD,CAAC;AAI7H,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,CAqyC1D,CAAC"}
@@ -31,8 +31,13 @@ export { TextDirection } from '@wildo-ai/presets-components-models';
31
31
  *
32
32
  * It is only ever reached AFTER labels have settled — surfaces gate on `useI18n().isReady`, which
33
33
  * settles on a failed bundle as well as a loaded one, so a key is never flashed during the load.
34
+ *
35
+ * EXPORTED so the convention has one home. A second surface outside this module needs it —
36
+ * `NavigationItemBadge`, whose accessible name falls back to a badge identity — and an inlined
37
+ * `?? someKey` there would be the same decision taken twice, in a place where nothing records that
38
+ * it IS a decision. Callers outside this file should reach it through the package root.
34
39
  */
35
- function unresolvedLabel(key) {
40
+ export function unresolvedLabel(key) {
36
41
  return key;
37
42
  }
38
43
  /**