@wildo-ai/saas-frontend-lib 1.1.13 → 1.1.15
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.
- package/dist/esm/components/ai-elements/meta/agent-wrappers.d.ts +1 -0
- package/dist/esm/components/ai-elements/meta/agent-wrappers.d.ts.map +1 -1
- package/dist/esm/components/ai-elements/meta/agent-wrappers.js.map +1 -1
- package/dist/esm/components/compliance/EmbeddedSigningFrame.d.ts +38 -0
- package/dist/esm/components/compliance/EmbeddedSigningFrame.d.ts.map +1 -0
- package/dist/esm/components/compliance/EmbeddedSigningFrame.js +106 -0
- package/dist/esm/components/compliance/EmbeddedSigningFrame.js.map +1 -0
- package/dist/esm/components/data-display/DisplayValueDispatcher.d.ts.map +1 -1
- package/dist/esm/components/data-display/DisplayValueDispatcher.js +17 -1
- package/dist/esm/components/data-display/DisplayValueDispatcher.js.map +1 -1
- package/dist/esm/components/data-display/ResourceAutomaticDisplayer.d.ts.map +1 -1
- package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js +22 -0
- package/dist/esm/components/data-display/ResourceAutomaticDisplayer.js.map +1 -1
- package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.d.ts.map +1 -1
- package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js +5 -2
- package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js.map +1 -1
- package/dist/esm/components/flows-actors/agent-config.labels.d.ts.map +1 -1
- package/dist/esm/components/flows-actors/agent-config.labels.js +2 -0
- package/dist/esm/components/flows-actors/agent-config.labels.js.map +1 -1
- package/dist/esm/components/flows-actors/approval.d.ts +7 -1
- package/dist/esm/components/flows-actors/approval.d.ts.map +1 -1
- package/dist/esm/components/flows-actors/approval.js +22 -5
- package/dist/esm/components/flows-actors/approval.js.map +1 -1
- package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts.map +1 -1
- package/dist/esm/components/form/automated/ResourceAutomatedForm.js +20 -1
- package/dist/esm/components/form/automated/ResourceAutomatedForm.js.map +1 -1
- package/dist/esm/components/form/chromes/FormFieldChrome.js +1 -1
- package/dist/esm/components/form/chromes/FormFieldChrome.js.map +1 -1
- package/dist/esm/components/form/chromes/field-control-aria.d.ts +8 -1
- package/dist/esm/components/form/chromes/field-control-aria.d.ts.map +1 -1
- package/dist/esm/components/form/chromes/field-control-aria.js +19 -2
- package/dist/esm/components/form/chromes/field-control-aria.js.map +1 -1
- package/dist/esm/components/form/validation-errors/validate-field-url.frontend.d.ts +5 -0
- package/dist/esm/components/form/validation-errors/validate-field-url.frontend.d.ts.map +1 -1
- package/dist/esm/components/form/validation-errors/validate-field-url.frontend.js +6 -2
- package/dist/esm/components/form/validation-errors/validate-field-url.frontend.js.map +1 -1
- package/dist/esm/components/resources/ResourceCollectionBody_Table.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceCollectionBody_Table.js +8 -1
- package/dist/esm/components/resources/ResourceCollectionBody_Table.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_DangerZone.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_DangerZone.js +2 -2
- package/dist/esm/components/resources/ResourceLayout_DangerZone.js.map +1 -1
- package/dist/esm/components/resources/ResourceLayout_RecordSharing.js +2 -2
- package/dist/esm/components/resources/ResourceLayout_RecordSharing.js.map +1 -1
- package/dist/esm/components/resources/ResourceListItemRenderer.d.ts.map +1 -1
- package/dist/esm/components/resources/ResourceListItemRenderer.js +6 -1
- package/dist/esm/components/resources/ResourceListItemRenderer.js.map +1 -1
- package/dist/esm/components/resources/skeleton/DisplayLayout.js +2 -2
- package/dist/esm/components/resources/skeleton/DisplayLayout.js.map +1 -1
- package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.d.ts.map +1 -1
- package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js +71 -16
- package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js.map +1 -1
- package/dist/esm/components/sections/surface.d.ts +12 -0
- package/dist/esm/components/sections/surface.d.ts.map +1 -1
- package/dist/esm/components/sections/surface.js +14 -0
- package/dist/esm/components/sections/surface.js.map +1 -1
- package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.d.ts.map +1 -1
- package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.js +3 -2
- package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.js.map +1 -1
- package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts +15 -0
- package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts.map +1 -1
- package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js +29 -0
- package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js.map +1 -1
- package/dist/esm/core/app-shell/shell-motion/use-shell-motion.d.ts.map +1 -1
- package/dist/esm/core/app-shell/shell-motion/use-shell-motion.js +2 -2
- package/dist/esm/core/app-shell/shell-motion/use-shell-motion.js.map +1 -1
- package/dist/esm/core/branding/useBrandPresentation.d.ts.map +1 -1
- package/dist/esm/core/branding/useBrandPresentation.js +17 -6
- package/dist/esm/core/branding/useBrandPresentation.js.map +1 -1
- package/dist/esm/core/events/events.frontend.schemas.d.ts +40 -0
- package/dist/esm/core/events/events.frontend.schemas.d.ts.map +1 -1
- package/dist/esm/core/events/events.frontend.schemas.js +24 -1
- package/dist/esm/core/events/events.frontend.schemas.js.map +1 -1
- package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.d.ts.map +1 -1
- package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.js +11 -1
- package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.js.map +1 -1
- package/dist/esm/core/i18n/I18nContext.d.ts.map +1 -1
- package/dist/esm/core/i18n/I18nContext.js +8 -2
- package/dist/esm/core/i18n/I18nContext.js.map +1 -1
- package/dist/esm/core/i18n/component-label-resolution.utils.d.ts.map +1 -1
- package/dist/esm/core/i18n/component-label-resolution.utils.js +6 -1
- package/dist/esm/core/i18n/component-label-resolution.utils.js.map +1 -1
- package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts +0 -15
- package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts.map +1 -1
- package/dist/esm/core/monitoring/analytics/AnalyticsContext.js +102 -5
- package/dist/esm/core/monitoring/analytics/AnalyticsContext.js.map +1 -1
- package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.d.ts.map +1 -1
- package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js +12 -3
- package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js.map +1 -1
- package/dist/esm/core/navigation/NavigationContext.d.ts.map +1 -1
- package/dist/esm/core/navigation/NavigationContext.js +60 -17
- package/dist/esm/core/navigation/NavigationContext.js.map +1 -1
- package/dist/esm/core/navigation/launcher-resolution.d.ts +29 -0
- package/dist/esm/core/navigation/launcher-resolution.d.ts.map +1 -1
- package/dist/esm/core/navigation/launcher-resolution.js +31 -0
- package/dist/esm/core/navigation/launcher-resolution.js.map +1 -1
- package/dist/esm/core/navigation/navigation-controller-internals.d.ts +48 -0
- package/dist/esm/core/navigation/navigation-controller-internals.d.ts.map +1 -1
- package/dist/esm/core/navigation/navigation-controller-internals.js +56 -3
- package/dist/esm/core/navigation/navigation-controller-internals.js.map +1 -1
- package/dist/esm/core/navigation/useNavigationRouterSync.d.ts.map +1 -1
- package/dist/esm/core/navigation/useNavigationRouterSync.js +30 -2
- package/dist/esm/core/navigation/useNavigationRouterSync.js.map +1 -1
- package/dist/esm/core/resources/resource-read-cache.frontend.service.d.ts +6 -1
- package/dist/esm/core/resources/resource-read-cache.frontend.service.d.ts.map +1 -1
- package/dist/esm/core/resources/resource-read-cache.frontend.service.js +11 -1
- package/dist/esm/core/resources/resource-read-cache.frontend.service.js.map +1 -1
- package/dist/esm/core/resources/route-parent-relocation.frontend.utils.d.ts +44 -0
- package/dist/esm/core/resources/route-parent-relocation.frontend.utils.d.ts.map +1 -0
- package/dist/esm/core/resources/route-parent-relocation.frontend.utils.js +63 -0
- package/dist/esm/core/resources/route-parent-relocation.frontend.utils.js.map +1 -0
- package/dist/esm/core/resources/useOperationDirectExecution.d.ts.map +1 -1
- package/dist/esm/core/resources/useOperationDirectExecution.js +45 -6
- package/dist/esm/core/resources/useOperationDirectExecution.js.map +1 -1
- package/dist/esm/core/runtime/AppRouter.d.ts.map +1 -1
- package/dist/esm/core/runtime/AppRouter.js +18 -1
- package/dist/esm/core/runtime/AppRouter.js.map +1 -1
- package/dist/esm/core/runtime/ApplicationMainContext.d.ts +1 -1
- package/dist/esm/core/runtime/ApplicationMainContext.d.ts.map +1 -1
- package/dist/esm/core/runtime/ApplicationMainContext.js +12 -3
- package/dist/esm/core/runtime/ApplicationMainContext.js.map +1 -1
- package/dist/esm/core/security/UserOrgsContext.d.ts +6 -1
- package/dist/esm/core/security/UserOrgsContext.d.ts.map +1 -1
- package/dist/esm/core/security/UserOrgsContext.js +87 -10
- package/dist/esm/core/security/UserOrgsContext.js.map +1 -1
- package/dist/esm/core/security/consent-gate.frontend.utils.d.ts +17 -5
- package/dist/esm/core/security/consent-gate.frontend.utils.d.ts.map +1 -1
- package/dist/esm/core/security/consent-gate.frontend.utils.js +16 -7
- package/dist/esm/core/security/consent-gate.frontend.utils.js.map +1 -1
- package/dist/esm/core/security/useConsentGateBehavior.js +1 -1
- package/dist/esm/core/security/useConsentGateBehavior.js.map +1 -1
- package/dist/esm/core/security/useGrantedConsentPurposes.js +1 -1
- package/dist/esm/core/security/useGrantedConsentPurposes.js.map +1 -1
- package/dist/esm/core/ui/inner-control-activation.utils.d.ts +16 -0
- package/dist/esm/core/ui/inner-control-activation.utils.d.ts.map +1 -0
- package/dist/esm/core/ui/inner-control-activation.utils.js +44 -0
- package/dist/esm/core/ui/inner-control-activation.utils.js.map +1 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceAutomaticDisplayer.js","sourceRoot":"","sources":["../../../../src/components/data-display/ResourceAutomaticDisplayer.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEjF,OAAO,EACL,2BAA2B,EAC3B,SAAS,EAET,QAAQ,EAER,kCAAkC,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACzF,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AACjH,OAAO,EACL,qBAAqB,GACtB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,sBAAsB,EAAE,6BAA6B,EAA2B,MAAM,0BAA0B,CAAC;AAE1H,OAAO,EAAE,kBAAkB,EAAiC,MAAM,sBAAsB,CAAC;AAEzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAKxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAAE,2BAA2B,EAAE,MAAM,gEAAgE,CAAC;AAC7G,OAAO,EAAE,4BAA4B,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEzF,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AAC1H,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kEAAkE,CAAC;AACxG,OAAO,EAAE,cAAc,EAAE,MAAM,yDAAyD,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,oCAAoC,EAAE,MAA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jB,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,aAAa,EACnB,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,EACrE,oBAAoB,EAAE,kCAAkC,EACxD,0BAA0B,EAAE,wCAAwC,EACpE,2BAA2B,EAAE,eAAe,CAAC,2BAA2B,EACxE,cAAc,EAAE,cAAc,EAC9B,mBAAmB,EAAE,2BAA2B,IAAI,IAAI,EACxD,qBAAqB,EAAE,qBAAqB,EAC5C,iBAAiB,EAAE,iBAAiB,EACpC,GAAG,EAAE,YAAY,EACjB,mBAAmB,EACjB,CAAC,YAAY,IAAI,6BAA6B,CAAC,8BAA8B,CAAC;gBAC5E,CAAC,CAAC,uBAAuB;gBACzB,CAAC,CAAC,SAAS,EAEf,8BAA8B,EAAE,8BAA8B,EAC9D,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,SAAS,EACpB,wBAAwB,EAAE,wBAAwB,EAClD,iBAAiB,EAAE,iBAAiB,EACpC,iBAAiB,EAAE,iBAAiB,EACpC,wBAAwB,EAAE,wBAAwB,EAClD,gBAAgB,EAAE,uBAAuB,CAAC,gBAAgB,EAC1D,4BAA4B,EAAE,uBAAuB,CAAC,4BAA4B,EAClF,yBAAyB,EAAE,yBAAyB,GACpD,GACU,CACf,CAAC;AACJ,CAAC;AAED,mCAAmC,CAAC,WAAW,GAAG,4BAA4B,CAAC;AAG/E,MAAM,CAAC,MAAM,0BAA0B,GAAyE,mCAAmC,CAAC","sourcesContent":["/**\n * ResourceAutomaticDisplayer Component\n *\n * A fully autonomous display component that derives all configuration from a\n * FrontendResourceOperationContext. It automatically:\n * - Uses the operation's responseDto (or mainSchema) as the display schema\n * - Resolves labels from i18n based on resource type and operation\n * - Fetches data for READ operations\n * - Handles i18n loading via LoadingGate\n * - Generates a display template from schema (DD-9: template-as-skeleton)\n *\n * The template renders unconditionally — when data is still loading, individual\n * DisplayField components show `<Skeleton>` placeholders via DisplayTemplateContext.isLoading.\n */\n\nimport React, { useCallback, useEffect, useMemo, useState, useRef } from 'react';\n\nimport {\n ErrorCustomMessageReference,\n ErrorType,\n WildoError_Frontend,\n DataMode,\n type FieldMetaEntry,\n ResourcesConfig_OperationPathUtils, describeCaughtError } from '@wildo-ai/saas-models';\nimport { buildResourceFileServeBaseUrl } from '~wildo-frontend-lib/core/resources/file-serve-url.frontend.utils';\nimport {\n FrontendComponentType,\n} from '@wildo-ai/presets-components-models';\nimport type { z } from 'zod';\nimport { getPrimaryKeyFieldName, isInlineEditableByDeclaration, type FileFieldEndpoints } from '@wildo-ai/zod-decorators';\n\nimport { AutomaticDisplayer, type AutomaticDisplayerLabels } from './AutomaticDisplayer';\nimport type { ParentReferenceConfig } from './automatic-displayer.utils';\nimport { setNestedValueAtPath } from './display-field-resolution.utils';\nimport type {\n FrontendResourceConfiguration_Operation,\n FrontendResourceOperationContext,\n} from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { useResourceOperationActions } from '~wildo-frontend-lib/core/resources/useResourceOperationActions';\nimport { ResourceOperationDisplayMode, NavigationZoneName } from '@wildo-ai/saas-models';\nimport type { FileActivationOperationDispatcher } from '~wildo-frontend-lib/components/data-display/useFileActivation';\nimport { frontendResourceUtils, FrontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport { useEventBus } from '~wildo-frontend-lib/core/events/useEventBus';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport { ErrorBuilderFrontend } from '~wildo-frontend-lib/core/errors/errors-builder.frontend.services';\nimport { FrontendEvents } from '~wildo-frontend-lib/core/events/events.frontend.schemas';\nimport { describeErrorGuidance, describeResourceErrorForNotification } from '~wildo-frontend-lib/components/form/validation-errors/resource-error-notification-context.utils';\nimport { envLoader } from '~wildo-frontend-lib/core/runtime/env-variable-loader.frontend.service';\nimport { AutomatedLayoutFrontendUtils } from '~wildo-frontend-lib/core/automated-layout/automated-layout.frontend.utils';\nimport { useSearchParams } from 'react-router';\nimport { LoadingGate } from '~wildo-frontend-lib/core/loading/LoadingGate';\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\nimport { resolveDisplayLayoutTemplate } from './display-layout-template.utils';\nimport { fieldsHoldingTheRecordName } from '~wildo-frontend-lib/core/automated-layout/record-fact-roles.frontend.utils';\nimport { ResourceLayoutInlineEditDefault } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { resolveAutomaticRelationshipDisplayShaping } from '~wildo-frontend-lib/core/resources/relationship-surface-runtime.frontend.utils';\nimport { pickInlineFieldWriteOperation, resolveRecordOrganizationId } from '~wildo-frontend-lib/core/resources/resource-addressability.frontend.utils';\nimport { useViewerEffectiveRolesInOrganization } from '~wildo-frontend-lib/core/navigation/launcher-runtime-availability';\n\nimport { RMMEventType, MutationSourceType, ConflictStrategy } from '~wildo-frontend-lib/core/resources/rmm/types';\nimport { useResourceRMM } from '~wildo-frontend-lib/core/resources/rmm/useResourceRMM';\nimport { refetchAuthoritativeRMMState } from '~wildo-frontend-lib/core/resources/rmm/RMMWebSocketBridge';\nimport { useShownRowChangedAt } from '~wildo-frontend-lib/core/resources/useShownRowChangedAt';\nimport {\n canSeedRMMFromLoadedPayload,\n performCanonicalRMMRead,\n resolveCanonicalRMMReadOperationPathKey,\n} from '~wildo-frontend-lib/core/resources/rmm/canonical-read.frontend.utils';\nimport {\n allowsDirectOperationFallback,\n UpdateLikeMutationFallbackMode,\n} from '~wildo-frontend-lib/core/resources/rmm/update-like-mutation-fallback.frontend';\nimport type { NavigationZone } from '~wildo-frontend-lib/core/navigation/navigation.schemas';\nimport { isTransientBackendFailure } from '~wildo-frontend-lib/core/requests/auth-refresh-resilience.frontend';\nimport { isApiNotReadyError } from '~wildo-frontend-lib/core/requests/api-readiness-checker.frontend.service';\nimport {\n normalizeContextResourceIdentifiersForOutcome,\n normalizeContextResourceIdentifiersForTransport,\n} from '~wildo-frontend-lib/core/resources/context-resource-identifiers.frontend.utils';\n\nconst logger = LoggerFrontendService.getLogger();\nconst logDebug = logger.debugByType('ResourceAutomaticDisplayer');\n\n/** First retry of a transiently failed read. Short: most such failures are a restart already nearly over. */\nexport const READ_RETRY_FIRST_DELAY_MS = 2_000;\n/** The backoff's ceiling: a backend down for minutes is asked twice a minute, not ten times. */\nexport const READ_RETRY_MAX_DELAY_MS = 30_000;\nlogger.setDebugTypeLogging('ResourceAutomaticDisplayer', false);\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\n/** What the displayer says about the record it reports through `onDataLoaded` (#3090). */\nexport interface ResourceAutomaticDisplayerShownRecord {\n /**\n * Whether this displayer holds the canonical record, or will once its RMM is seeded (#3092): its payload IS the record\n * (the canonical READ, in RAW mode), or an RMM holds the row. False only beside another payload with no RMM (a row\n * with no update operation) or after the RMM could not be seeded; a host then reads the record itself.\n */\n holdsCanonicalRecord: boolean;\n /**\n * The canonical record itself (#3092): the payload when that IS the record, else the RMM's copy, which an RMM holds\n * whatever the body displays and keeps current through inline edits and other people's changes. `undefined` while\n * the RMM is being seeded, and whenever `holdsCanonicalRecord` is false.\n */\n canonicalRecord: Record<string, unknown> | undefined;\n}\n\nexport interface ResourceAutomaticDisplayerProps {\n /** The resource operation context containing all operation details */\n resourceContext: FrontendResourceOperationContext;\n\n /** Callback when data fetch fails */\n onError?: (error: Error) => void;\n\n /** Additional CSS classes */\n className?: string;\n\n /** Override labels (merged with auto-resolved labels) */\n labelsOverride?: Partial<AutomaticDisplayerLabels>;\n\n\n /**\n * Data mode override (takes priority over query param).\n * Priority: Component prop > Query param > Backend default\n */\n dataMode?: DataMode;\n\n /**\n * The payload this displayer renders, reported every time it changes: the first read, every re-read, and every RMM\n * update (#3090). The record page hands it to its action bar and its nested relationship sections (conditional\n * relationship filtering).\n *\n * `shown` carries the canonical RECORD beside it (#3092), which is what the page hands its header: the payload itself\n * when it IS the record (the canonical READ, in RAW mode), else the copy this displayer's RMM holds, which the RMM\n * keeps current through inline edits and other people's changes. A read-like custom operation or a summary/context\n * data mode renders another payload, which a header template's fields cannot rely on.\n */\n onDataLoaded?: (data: Record<string, unknown>, shown: ResourceAutomaticDisplayerShownRecord) => void;\n\n /**\n * Parent reference configuration for inChildView display (C1: P5-02).\n * Passed through to AutomaticDisplayer → ResourceDisplayContext → FK Display Preset.\n */\n parentReferenceConfig?: ParentReferenceConfig;\n /** Current navigation zone for inline-edit quick-create flows */\n navigationZone?: NavigationZone;\n /**\n * Controls whether engine-default inline edit may downgrade to a direct UPDATE\n * operation when RMM is unavailable. Defaults to `RMM_REQUIRED`.\n */\n updateLikeMutationFallbackMode?: UpdateLikeMutationFallbackMode;\n /**\n * The host shows this record's NAME directly above the body — the READ page, whose header is the record's name.\n *\n * A GENERATED read body then leaves out the field the name was made from (the field whose value IS the name), so\n * the page does not say \"Test\" in its header and \"Title: Test\" in its first tile (#3066, measured on Wonder\n * Procurement's purchase requests and suppliers). Decided by VALUE, the way a list card decides it: the name comes\n * from `getFrontendResourceLabel`, which may be any function of the record, so no field can be named in advance.\n * An authored `layout.display` is the author's, and keeps every field it places. Off by default: a body rendered\n * without the record's name above it (a one-to-one child under its parent) must keep the field.\n */\n recordNameShownAbove?: boolean;\n}\n\n// =============================================================================\n// COMPONENT\n// =============================================================================\n\nfunction ResourceAutomaticDisplayerComponent({\n resourceContext,\n onError,\n className,\n labelsOverride,\n dataMode: propDataMode,\n onDataLoaded,\n parentReferenceConfig,\n navigationZone,\n updateLikeMutationFallbackMode = UpdateLikeMutationFallbackMode.RMM_REQUIRED,\n recordNameShownAbove = false,\n}: ResourceAutomaticDisplayerProps): React.JSX.Element | null {\n // Contexts\n const { doOperation, registry } = useResourceRegistry();\n const { emit, resourceRefreshEvent } = useEventBus();\n const { lastRefreshAt } = resourceRefreshEvent({ ctx: resourceContext as any });\n const { tComponent, isReady, t: tRecordName, formatDate, formatDateTime } = useI18n({ component: FrontendComponentType.RESOURCES_LAYOUTS_READ, resource: resourceContext.resourceType });\n const [searchParams] = useSearchParams();\n\n const i18nKeys = useMemo(() => [\n `resources.${resourceContext.resourceType}`,\n `components.${FrontendComponentType.RESOURCES_LAYOUTS_READ}`,\n ], [resourceContext.resourceType]);\n\n // Refs for stable function references (avoid infinite loops in useEffect)\n const doOperationRef = useRef(doOperation);\n const emitRef = useRef(emit);\n const onErrorRef = useRef(onError);\n const onDataLoadedRef = useRef(onDataLoaded);\n const resourceContextRef = useRef(resourceContext);\n\n // Keep refs updated\n doOperationRef.current = doOperation;\n emitRef.current = emit;\n onErrorRef.current = onError;\n onDataLoadedRef.current = onDataLoaded;\n resourceContextRef.current = resourceContext;\n\n // Error builder (memoized to prevent recreation)\n const errorBuilder = useMemo(() => new ErrorBuilderFrontend(), []);\n\n // Extract from resource context\n const { resourceType, operation, contextResourceIdentifiers } = resourceContext;\n const operationIdentifier = String(operation.operationIdentifier);\n\n // State\n const [data, setData] = useState<Record<string, unknown> | null>(null);\n /**\n * When THIS row last changed while the page renders `data` rather than the RMM's copy (#1782, #3090, #3092): no RMM,\n * a failed RMM seed, or a payload that is not the canonical record (a read-like custom operation, a summary or\n * context data mode). `data` is read once and nothing else reads it back, so an action run on such a row (a\n * workbench secret's \"set\") left the page it was run from showing the old values. Keyed into the fetch effect beside\n * `lastRefreshAt`; set from `useShownRowChangedAt`, below the RMM.\n */\n const [dataStaleAt, setDataStaleAt] = useState<number | null>(null);\n const [fetchError, setFetchError] = useState<WildoError_Frontend | null>(null);\n const [rmmSeedFailed, setRmmSeedFailed] = useState(false);\n\n const loadingScopes = useMemo(() => [{ resourceType, operation: operationIdentifier }], [resourceType, operationIdentifier]);\n\n // Extract dataMode: Component prop > Query param > Backend default\n const dataMode = useMemo(() => {\n return frontendResourceUtils.extractDataMode(searchParams, propDataMode);\n }, [searchParams, propDataMode]);\n const effectiveDataMode = useMemo(() => dataMode ?? DataMode.RAW, [dataMode]);\n\n // Get the display schema from the operation based on dataMode\n const displaySchema = useMemo(() => {\n let schema;\n switch (effectiveDataMode) {\n case DataMode.SUMMARY:\n schema = operation.summaryDto || operation.responseDto;\n break;\n case DataMode.CONTEXT:\n schema = operation.contextDto || operation.responseDto;\n break;\n case DataMode.RAW:\n default:\n schema = operation.responseDto;\n break;\n }\n\n if (!schema) {\n logger.error('[ResourceAutomaticDisplayer] No DTO found', {\n operationIdentifier,\n resourceType,\n dataMode: effectiveDataMode,\n });\n }\n return schema;\n }, [effectiveDataMode, operation, operationIdentifier, resourceType]);\n\n // Get resource configuration for frontendConfiguration\n const resourceConfig = useMemo(() => {\n return registry.resourceConfigurations[resourceType];\n }, [registry, resourceType]);\n\n // Resolve layout refs for i18n label resolution\n const layoutRefs = resourceConfig?.frontendConfiguration?.layout?.refs;\n\n // Build a stable key from contextResourceIdentifiers for memoization\n const contextResourceIdentifiersKey = useMemo(() => {\n return FrontendResourceUtils.buildContextResourceIdentifiersKey(contextResourceIdentifiers);\n }, [contextResourceIdentifiers]);\n\n // Build contextual parameters for API calls\n const contextualParameters = useMemo(() => {\n return FrontendResourceUtils.buildContextualParameters(contextResourceIdentifiers, registry);\n // eslint-disable-next-line react-hooks/exhaustive-deps -- using stable key instead of object reference\n }, [contextResourceIdentifiersKey, registry]);\n\n // Fetch through the actual routed/display operation so request/response DTOs\n // stay aligned for custom read-like surfaces.\n const operationPathKey = useMemo(() => {\n return ResourcesConfig_OperationPathUtils.createOperationPathKeyFromOperation(operation);\n }, [operation]);\n\n // Build labels for AutomaticDisplayer\n // Injects resourceContext for automatic i18n label resolution.\n // Explicit labelsOverride fields/enums/sections take priority over i18n.\n const labels = useMemo<AutomaticDisplayerLabels>(() => {\n return {\n resourceContext: { resourceType, operationId: operationIdentifier },\n ...labelsOverride,\n };\n }, [resourceType, operationIdentifier, labelsOverride]);\n\n // Build fileUploadContext for display. `getMetadata` (global /files) loads file\n // metadata; `serve` is the resource-integrated, AUTHENTICATED byte-serve base for\n // inline image/PDF previews (authorization inherits the parent resource's READ —\n // the display consumer appends `/{fileId}` and fetches via the authed client).\n const fileUploadContext = useMemo<Record<string, FileFieldEndpoints> | undefined>(() => {\n if (!displaySchema) return undefined;\n\n try {\n const fileFieldPaths = AutomatedLayoutFrontendUtils.collectFileFieldPaths(displaySchema);\n if (fileFieldPaths.length === 0) return undefined;\n\n const apiBaseUrl = envLoader.getApiUrl();\n const filesBasePath = `${apiBaseUrl}/api/v1/files`;\n\n // Resolve the resource-integrated serve base per field for the CURRENT record, via\n // the shared builder (see `buildResourceFileServeBaseUrl`). A context-addressed\n // singleton READ (e.g. the user's own profile) has no resourceId in its route, so\n // the record's own `_id` (from the fetched `data`) fills the `{resourceId}` segment —\n // until `data` loads it stays unresolved → serve omitted → neutral card.\n const serveBaseByField: Record<string, string> = {};\n const recordId = data\n ? String((data as Record<string, unknown>)._id\n ?? (data as Record<string, unknown>)[resourceConfig?.resourceFieldIdentifier ?? '_id']\n ?? '')\n : '';\n if (resourceConfig && recordId) {\n for (const fieldName of fileFieldPaths) {\n const serveBase = buildResourceFileServeBaseUrl({\n registry,\n resourceConfig,\n operation,\n resourceType,\n fieldName,\n recordId,\n contextResourceIdentifiers,\n contextualParameters,\n parentResourcesRequirements: resourceContextRef.current.parentResourcesRequirements,\n apiBaseUrl,\n });\n if (serveBase) serveBaseByField[fieldName] = serveBase;\n }\n }\n\n const context: Record<string, FileFieldEndpoints> = {};\n for (const fieldName of fileFieldPaths) {\n context[fieldName] = {\n getMetadata: filesBasePath,\n serve: serveBaseByField[fieldName],\n // Upload/override/delete not needed for display\n upload: '',\n override: undefined,\n delete: '',\n };\n }\n\n return context;\n } catch {\n return undefined;\n }\n // `data` is a dep: the serve base needs the fetched record's id (context-addressed\n // singletons have no resourceId in the READ route), so it must recompute on load.\n }, [displaySchema, resourceConfig, operation, registry, contextResourceIdentifiers, contextualParameters, resourceType, data]);\n\n // Fetch data - use refs to avoid infinite loops from unstable function references\n useEffect(() => {\n let cancelled = false;\n let retryTimer: ReturnType<typeof setTimeout> | undefined;\n let retryDelay = READ_RETRY_FIRST_DELAY_MS;\n\n /*\n * `isRetry` keeps the FAILURE on screen while another attempt is made. Clearing it first would\n * flip the surface error → skeleton → error every few seconds; and a retry is not a reason to\n * pretend the last attempt worked.\n */\n const fetchData = async (isRetry = false) => {\n if (!isRetry) setFetchError(null);\n\n try {\n const result = await doOperationRef.current(\n operationPathKey,\n {\n contextualParameters,\n parentResourcesRequirements: resourceContextRef.current.parentResourcesRequirements,\n dataMode: effectiveDataMode,\n },\n // silent: this displayer owns the read-failure UX — it renders the error\n // inline (setFetchError below) AND emits NOTIFY_RESOURCE_ERROR. Suppress\n // the redundant GLOBAL error toast so a failed read doesn't triple-surface\n // (inline + resource toast + global toast). Matches the resource-owned model.\n { silent: true },\n );\n\n if (cancelled) return;\n setFetchError(null);\n setData(result);\n // The host learns the record from the effect on `effectiveData` below, which also follows the RMM (#3090).\n } catch (error) {\n if (cancelled) return;\n\n // Preserve the real operation path key in diagnostics so custom read-like\n // surfaces are debuggable without pretending they are literal READ ops.\n const originalError = error instanceof Error ? error : new Error(String(error));\n\n const errorRecord = (error && typeof error === 'object') ? error as Record<string, unknown> : {};\n const wildoError = errorBuilder.buildWildoError_Frontend(\n ErrorType.NOT_FOUND,\n {\n customMessageReference: ErrorCustomMessageReference.FRONTEND_FORM_READ_OPERATION_NOT_AVAILABLE,\n operationPathKey,\n context: {\n resourceType,\n operationIdentifier,\n originalErrorMessage: originalError.message,\n originalErrorStack: originalError.stack,\n httpCode: errorRecord.code,\n httpContext: errorRecord.context,\n },\n }\n );\n\n setFetchError(wildoError);\n\n /*\n * A TRANSIENT failure is retried, with backoff, until it succeeds or the surface unmounts.\n *\n * A read that lost a race with a backend restart used to be the END of that surface: the\n * alert below, and nothing else, until the person navigated away and back. Measured\n * 2026-09-20 in a browser drive — a detail pane sat on \"failed to load\" for a full minute\n * while its backend had been answering again for most of it. `ApiNotReadyError` exists\n * precisely so \"callers and retry ladders\" can classify this case, and this caller had none.\n *\n * ONLY transient failures: a 404 or a 403 is an answer, and asking again is how a surface\n * comes to hammer a server that has already said no. The classifier is the framework's own\n * (`isTransientBackendFailure` — no response, 5xx, 408, the readiness gate's bounded refusal).\n *\n * The error event below fires for the FIRST failure of a sequence only, so a backend that is\n * down for two minutes produces one notification, not one per attempt.\n */\n if (isTransientBackendFailure(error) || isApiNotReadyError(error)) {\n if (retryTimer !== undefined) clearTimeout(retryTimer);\n retryTimer = setTimeout(() => { retryTimer = undefined; void fetchData(true); }, retryDelay);\n retryDelay = Math.min(retryDelay * 2, READ_RETRY_MAX_DELAY_MS);\n }\n if (isRetry) return;\n\n // Emit error event\n const currentCtx = resourceContextRef.current;\n const { errorRefusalCode } = describeResourceErrorForNotification(error);\n emitRef.current(FrontendEvents.NOTIFY_RESOURCE_ERROR, {\n ...currentCtx,\n contextResourceIdentifiers: normalizeContextResourceIdentifiersForTransport(\n currentCtx.contextResourceIdentifiers,\n ),\n parentResourcesRequirements: currentCtx.parentResourcesRequirements || [],\n additionalContext: {\n ...currentCtx.additionalContext,\n error: originalError.message,\n // Let the notification layer resolve a localized message (tErrorMessage)\n // instead of falling back to the generic default-error label.\n errorCustomMessageReference: ErrorCustomMessageReference.FRONTEND_FORM_READ_OPERATION_NOT_AVAILABLE,\n // The server's own words outrank that category when it gave any: a declared refusal code and\n // its user guidance, as every other failed-operation notification carries them (#1782 review, F3).\n ...(errorRefusalCode ? { errorRefusalCode } : {}),\n ...describeErrorGuidance(error),\n },\n });\n\n onErrorRef.current?.(originalError);\n logDebug('fetch error', { resourceType, error: originalError.message });\n } finally {\n // no-op — loading tracked by centralized LoadingContext\n }\n };\n\n void fetchData();\n\n return () => {\n cancelled = true;\n if (retryTimer !== undefined) clearTimeout(retryTimer);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- using refs for unstable functions/objects; contextResourceIdentifiersKey is the stable proxy for contextualParameters\n }, [resourceType, operationPathKey, contextResourceIdentifiersKey, errorBuilder, operationIdentifier, effectiveDataMode, lastRefreshAt, dataStaleAt]);\n\n // Extract resource ID for inline editing support (must be before early returns — React hooks rule)\n const currentResourceId = useMemo(() => {\n const ctxValue = contextResourceIdentifiers?.[resourceType];\n if (ctxValue) return frontendResourceUtils.getResourceId(ctxValue);\n // ── READ-bootstrap fallback: the row had no id in its URL, so take it from the loaded data ──\n //\n // This is the path `useResourceRMM`'s own pin is named for — \"fails closed for parent-context\n // singleton updates UNTIL READ BOOTSTRAP PROVIDES THE PERSISTED CHILD ID\". A context-addressed\n // singleton (one `organizationSsoConfig` per organization) is addressed by its parent scope and\n // carries no id of its own in the route, so this is the only place its identity can come from.\n //\n // It asked for `data[resourceFieldIdentifier]` alone, and that name is a URL PARAMETER\n // (`organizationSsoConfigId`), not a payload field. Measured 2026-09-19 on the running\n // application: the READ returns `[\"_id\", \"enforcement\", \"domains\", …]` and the lookup asked for\n // `organizationSsoConfigId`, so the id stayed undefined after a perfectly successful read.\n //\n // The consequences ran three layers deep and were all silent. The RMM is keyed on the resource\n // id, so it never attached; `canInlineEdit` is `!!rmm || <a fallback that also demands an id>`,\n // so it was false; every field on every settings singleton therefore rendered read-only,\n // booleans as a ✓/✕ glyph. That is why no settings schema had ever declared `inlineEditable` —\n // doing so would have changed nothing, because the floor was here.\n //\n // The field-identifier lookup is TRIED FIRST and kept: a payload that does carry it is answered\n // exactly as before, so no resource changes behaviour by this fallback gaining a second leg.\n if (data) {\n // getResourceFieldIdentifierForType throws if unconfigured — which is correct here,\n // since we cannot extract a resource ID without a valid field identifier.\n const fieldId = FrontendResourceUtils.getResourceFieldIdentifierForType(resourceType, registry);\n const byFieldIdentifier = data[fieldId];\n if (byFieldIdentifier != null) return byFieldIdentifier;\n\n // What the row calls its own identity. Read from the resource's declared main schema rather\n // than assuming `_id`, so a resource naming its primary key otherwise is served too.\n const primaryKeyField = resourceConfig?.mainSchema\n ? getPrimaryKeyFieldName(resourceConfig.mainSchema)\n : undefined;\n if (primaryKeyField) return data[primaryKeyField];\n }\n return undefined;\n }, [contextResourceIdentifiers, resourceType, data, registry, resourceConfig?.mainSchema]);\n\n const contextResourceIdentifiersWithResourceId = useMemo(() => {\n if (!currentResourceId || contextResourceIdentifiers?.[resourceType]) {\n return contextResourceIdentifiers;\n }\n\n return {\n ...contextResourceIdentifiers,\n [resourceType]: String(currentResourceId),\n };\n }, [contextResourceIdentifiers, currentResourceId, resourceType]);\n\n const contextualParametersWithResourceId = useMemo(() => {\n const resourceFieldIdentifier = resourceConfig?.resourceFieldIdentifier;\n if (!currentResourceId || !resourceFieldIdentifier) {\n return contextualParameters;\n }\n\n const resourceId = String(currentResourceId);\n if (String(contextualParameters[resourceFieldIdentifier] ?? '') === resourceId) {\n return contextualParameters;\n }\n\n return {\n ...contextualParameters,\n [resourceFieldIdentifier]: resourceId,\n };\n }, [contextualParameters, currentResourceId, resourceConfig?.resourceFieldIdentifier]);\n\n // =============================================================================\n // RMM (Registry-based, inline-edit-capable resources only)\n // =============================================================================\n\n // The viewer's roles in the tenant this record belongs to, which the in-place write pick asks about (#2473).\n const inlineWriteViewer = useViewerEffectiveRolesInOrganization(\n resolveRecordOrganizationId(\n resourceConfig?.resourceIdentifier as string | undefined,\n currentResourceId != null ? String(currentResourceId) : undefined,\n contextResourceIdentifiersWithResourceId as Record<string, unknown> | undefined,\n ),\n );\n\n const resolvedInlineEditOperation = useMemo<FrontendResourceConfiguration_Operation | undefined>(() => {\n if (!resourceConfig) {\n return undefined;\n }\n\n return pickInlineFieldWriteOperation({\n resourceConfig,\n operations: resourceConfig.operations ?? [],\n registry,\n hasResourceId: currentResourceId != null,\n contextResourceIdentifiers: contextResourceIdentifiersWithResourceId,\n contextualParameters: contextualParametersWithResourceId,\n viewer: inlineWriteViewer,\n });\n }, [\n contextResourceIdentifiersWithResourceId,\n contextualParametersWithResourceId,\n currentResourceId,\n operation,\n registry,\n resourceConfig,\n inlineWriteViewer,\n ]);\n\n const hasUpdateOperation = useMemo(() => {\n return resolvedInlineEditOperation !== undefined;\n }, [resolvedInlineEditOperation]);\n\n const { rmm, rmmSnapshot } = useResourceRMM({\n resourceType,\n resourceId: currentResourceId != null ? String(currentResourceId) : null,\n doOperationRef,\n contextualParameters: contextualParametersWithResourceId,\n parentResourcesRequirements: resourceContext.parentResourcesRequirements as unknown[] | undefined,\n contextResourceIdentifiers: contextResourceIdentifiersWithResourceId,\n resourceSchema: resourceConfig?.mainSchema,\n resourceInheritance: resourceConfig?.inheritenceSchemaDefinition,\n enabled: hasUpdateOperation && currentResourceId != null,\n conflictPolicy: { strategy: ConflictStrategy.ACCEPT_REMOTE },\n });\n\n /*\n * Re-read the row when it changes (#1782, #3090, #3092): an operation run from this screen (every operation host\n * announces a success naming the row) or a change made elsewhere (the websocket's READ refresh naming the row). Both\n * are heard by `useShownRowChangedAt`, the one rule every holder of a row keys its reads on.\n *\n * Each copy of the row is re-read by its own means. The RMM, when one holds the row, is re-read for a change made from\n * THIS screen only (a change made elsewhere reaches it through its own websocket bridge), through a version-guarded\n * canonical read that replaces its confirmed state only with a NEWER version, so it never undoes an edit and makes the\n * websocket's echo of the same change a no-op. `data` is re-fetched (`dataStaleAt`) whenever the\n * body renders it rather than the RMM's copy: no RMM, a failed seed, or a payload that is not the canonical record\n * (`bodyRendersRmmCopyRef`). Re-reading only the RMM there would leave the body as it was, since an RMM state change\n * re-fetches the displayed operation only on an RMM event, and a re-seed is not one (#3090 review).\n *\n * Until #3090 an RMM-held row was skipped here on the claim that a remote change reaches the RMM. That holds only\n * while a websocket is connected, and a change run from the page itself by a host that is not the RMM (an overlay\n * form, a form-less action) had nothing else telling the row.\n */\n const loadedRowIdRef = useRef<string | null>(null);\n loadedRowIdRef.current = typeof data?._id === 'string' || typeof data?._id === 'number' ? String(data._id) : null;\n const rendersFromRmm = rmm !== null && !rmmSeedFailed;\n /** Whether the body renders the RMM's copy rather than `data`; assigned where `effectiveData` is decided, below. */\n const bodyRendersRmmCopyRef = useRef(false);\n const rowChange = useShownRowChangedAt({\n resourceType,\n rowIds: [currentResourceId != null ? String(currentResourceId) : null, loadedRowIdRef.current],\n enabled: currentResourceId != null,\n });\n useEffect(() => {\n if (rowChange == null || currentResourceId == null) return;\n // The RMM is re-read for a change made from THIS screen only. A change made elsewhere reaches the RMM through its\n // own websocket bridge, which replays or re-reads it; re-reading here too would be a second path for the same\n // change (#3092 review). `data` is not the RMM's, so it is re-fetched on either.\n if (rendersFromRmm && rmm !== null && !rowChange.madeElsewhere) {\n const routeRowId = String(currentResourceId);\n refetchAuthoritativeRMMState({ resourceType, resourceId: routeRowId, rmm, doOperation: doOperationRef.current })\n .catch((error: unknown) => {\n logger.warn('[ResourceAutomaticDisplayer] Re-reading the row after it changed failed', {\n resourceType,\n resourceId: routeRowId,\n error: describeCaughtError(error),\n });\n });\n }\n if (!rendersFromRmm || !bodyRendersRmmCopyRef.current) setDataStaleAt(rowChange.at);\n // Keyed on the change alone: a new RMM or a new row is not a change of the row it holds.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [rowChange]);\n\n const canonicalReadOperationPathKey = useMemo(() => {\n if (rmm) {\n return rmm.readOperationPathKey;\n }\n\n return resolveCanonicalRMMReadOperationPathKey(resourceType, registry, {\n hasResourceId: currentResourceId != null,\n contextResourceIdentifiers: contextResourceIdentifiersWithResourceId,\n contextualParameters: contextualParametersWithResourceId,\n });\n }, [\n registry,\n resourceType,\n rmm,\n currentResourceId,\n contextResourceIdentifiersWithResourceId,\n contextualParametersWithResourceId,\n ]);\n const effectiveRmm = rmmSeedFailed ? null : rmm;\n\n useEffect(() => {\n logDebug('RMM obtained', {\n resourceType,\n resourceId: currentResourceId != null ? String(currentResourceId) : undefined,\n rmmExists: !!rmm,\n });\n }, [rmm, resourceType, currentResourceId]);\n\n useEffect(() => {\n setRmmSeedFailed(false);\n }, [canonicalReadOperationPathKey, currentResourceId, operationPathKey, resourceType]);\n\n /**\n * Initialize RMM with fetched data. Dedicated useEffect (not inside the fetch effect)\n * because `rmm` may not be available when the fetch fires (currentResourceId comes from\n * fetched data in some cases). The `confirmedData !== null` guard prevents re-initialization\n * when another consumer (e.g., a form) has already seeded the RMM.\n */\n useEffect(() => {\n if (!rmm || !data) return;\n const snapshot = rmm.getSnapshot();\n if (snapshot.confirmedData !== null && lastRefreshAt == null) return;\n if (!canonicalReadOperationPathKey) {\n setRmmSeedFailed(true);\n logger.warn('[ResourceAutomaticDisplayer] Cannot seed RMM without an addressable canonical READ', {\n resourceType,\n resourceId: currentResourceId != null ? String(currentResourceId) : undefined,\n });\n return;\n }\n\n let cancelled = false;\n const seedRMM = async () => {\n const shouldTrustDisplayedPayload = canSeedRMMFromLoadedPayload({\n loadedOperationPathKey: operationPathKey,\n canonicalReadOperationPathKey,\n dataMode: effectiveDataMode,\n });\n\n const sourceData = shouldTrustDisplayedPayload\n ? data\n : await performCanonicalRMMRead({\n doOperation: doOperationRef.current,\n readOperationPathKey: canonicalReadOperationPathKey,\n contextualParameters: contextualParametersWithResourceId,\n parentResourcesRequirements: resourceContextRef.current.parentResourcesRequirements,\n });\n\n if (cancelled) return;\n if (sourceData == null || typeof sourceData !== 'object') {\n // A canonical read that answers no record is a failed seed: without saying so the body would keep claiming to\n // hold the record (`holdsCanonicalRecord`) with none to give, and the page's header would wait for it forever.\n setRmmSeedFailed(true);\n return;\n }\n\n const row = sourceData as Record<string, unknown>;\n const version = (row._version as number | undefined) ?? 0;\n rmm.setInitialState(row, version, row._field_meta as Record<string, FieldMetaEntry> | undefined);\n setRmmSeedFailed(false);\n logDebug('setInitialState', {\n resourceType,\n resourceId: currentResourceId != null ? String(currentResourceId) : undefined,\n version,\n fieldCount: Object.keys(row).length,\n refreshDriven: snapshot.confirmedData !== null,\n seededFromCanonicalRead: !shouldTrustDisplayedPayload,\n });\n };\n\n seedRMM().catch((error: unknown) => {\n setRmmSeedFailed(true);\n logger.warn('[ResourceAutomaticDisplayer] Failed to seed RMM from canonical read', {\n resourceType,\n resourceId: currentResourceId != null ? String(currentResourceId) : undefined,\n error: describeCaughtError(error),\n });\n });\n\n return () => {\n cancelled = true;\n };\n }, [\n rmm,\n data,\n effectiveDataMode,\n operationPathKey,\n canonicalReadOperationPathKey,\n contextualParametersWithResourceId,\n resourceType,\n currentResourceId,\n lastRefreshAt,\n ]);\n\n // RMM event handler — simpler than the form's handler (no RHF state to sync)\n useEffect(() => {\n if (!rmm || !rmmSnapshot?.lastEvent) return;\n const event = rmmSnapshot.lastEvent;\n logDebug('RMM event', {\n type: event.type,\n resourceType,\n resourceId: currentResourceId != null ? String(currentResourceId) : undefined,\n });\n const shouldRefetchDisplayedOperation = canonicalReadOperationPathKey\n ? !canSeedRMMFromLoadedPayload({\n loadedOperationPathKey: operationPathKey,\n canonicalReadOperationPathKey,\n dataMode: effectiveDataMode,\n })\n : false;\n\n const refetchDisplayedData = () => {\n if (!shouldRefetchDisplayedOperation) return;\n doOperationRef.current(operationPathKey, {\n contextualParameters: contextualParametersWithResourceId,\n parentResourcesRequirements: resourceContextRef.current.parentResourcesRequirements,\n dataMode: effectiveDataMode,\n }).then((result: Record<string, unknown>) => {\n setData(result as Record<string, unknown>);\n }).catch((err) => {\n logger.warn('[ResourceAutomaticDisplayer] Summary/context refetch failed (RMM handler)', {\n resourceType,\n error: describeCaughtError(err),\n });\n });\n };\n\n switch (event.type) {\n case RMMEventType.MUTATION_RESULT: {\n if (event.result.success) {\n if (event.source.type === MutationSourceType.DISPLAY) {\n emitRef.current(FrontendEvents.NOTIFY_RESOURCE_SUCCESS, {\n ...resourceContextRef.current,\n contextResourceIdentifiers: normalizeContextResourceIdentifiersForOutcome({\n contextResourceIdentifiers: resourceContextRef.current.contextResourceIdentifiers,\n resourceType,\n result: event.result.responseData,\n }),\n parentResourcesRequirements: resourceContextRef.current.parentResourcesRequirements || [],\n additionalContext: {\n ...resourceContextRef.current.additionalContext,\n inlineEdit: true,\n fieldName: event.result.savedFields?.[0],\n },\n resultSummary: event.result.responseData,\n });\n }\n refetchDisplayedData();\n }\n break;\n }\n\n case RMMEventType.REMOTE_UPDATE:\n case RMMEventType.CONFLICT_RESET: {\n refetchDisplayedData();\n break;\n }\n\n case RMMEventType.RESOURCE_DELETED: {\n break;\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- intentional: event-driven side effects keyed on lastEvent.id\n }, [rmmSnapshot?.lastEvent?.id]);\n\n const canRenderFromRMM = useMemo(() => {\n return canSeedRMMFromLoadedPayload({\n loadedOperationPathKey: operationPathKey,\n canonicalReadOperationPathKey,\n dataMode: effectiveDataMode,\n });\n }, [canonicalReadOperationPathKey, effectiveDataMode, operationPathKey]);\n\n // Effective data source: only the canonical RAW read surface renders RMM data.\n // Other RAW read-like surfaces keep their authored payload shape even if RMM is active.\n const isSummaryMode = effectiveDataMode === DataMode.SUMMARY || effectiveDataMode === DataMode.CONTEXT;\n const effectiveData = (!isSummaryMode && canRenderFromRMM && rmm && rmmSnapshot.optimisticData)\n ? rmmSnapshot.optimisticData\n : data;\n bodyRendersRmmCopyRef.current = !isSummaryMode && canRenderFromRMM && rendersFromRmm;\n\n /*\n * The host learns the payload this displayer RENDERS, and the canonical record beside it, every time either changes\n * (#3090, #3092): the first read, a re-read, and every RMM update (an inline edit, a remote change, a re-read after an\n * operation). The record page hands the payload to its action bar and the canonical record to its header, so they\n * follow the record the body is about. Reporting only the first fetch, as this did, left the header's status and the\n * action bar's enabled verbs on the record as it was when the page opened.\n *\n * What is reported is what is shown, so it includes the RMM's OPTIMISTIC values while an inline edit is in flight:\n * the header and the action bar's `enabledCondition` see the edit as the body does, and see it undone if it fails.\n */\n const rmmCanonicalRecord = rendersFromRmm ? (rmmSnapshot.optimisticData as Record<string, unknown> | null) : null;\n useEffect(() => {\n if (effectiveData == null) return;\n const canonicalRecord = canRenderFromRMM ? (effectiveData as Record<string, unknown>) : (rmmCanonicalRecord ?? undefined);\n onDataLoadedRef.current?.(effectiveData as Record<string, unknown>, {\n // An RMM that is not seeded yet WILL hold the record: saying so keeps the host from reading a copy of its own\n // in the moment between the payload and the seed (#3092 review).\n holdsCanonicalRecord: canRenderFromRMM || rendersFromRmm,\n canonicalRecord,\n });\n }, [effectiveData, canRenderFromRMM, rendersFromRmm, rmmCanonicalRecord]);\n\n useEffect(() => {\n logDebug('effectiveData source', {\n dataMode: effectiveDataMode,\n usingRmmData: canRenderFromRMM && !!rmmSnapshot?.optimisticData,\n });\n }, [canRenderFromRMM, effectiveDataMode, rmmSnapshot?.optimisticData]);\n\n // GAP-1/4: Optimistic data update after successful inline edit (non-RMM fallback path).\n // When RMM is active, snapshot.optimisticData handles this instead.\n const handleInlineEditSuccess = useCallback((fieldName: string, value: unknown) => {\n // Optimistic local merge — update the field in current data state\n setData((prevData: any) => {\n if (!prevData) return prevData;\n return setNestedValueAtPath(prevData, fieldName, value);\n });\n\n // Emit success notification so external listeners (toasts, sibling components) can react\n emitRef.current(FrontendEvents.NOTIFY_RESOURCE_SUCCESS, {\n ...resourceContextRef.current,\n contextResourceIdentifiers: normalizeContextResourceIdentifiersForOutcome({\n contextResourceIdentifiers: resourceContextRef.current.contextResourceIdentifiers,\n resourceType,\n result: value,\n }),\n parentResourcesRequirements: resourceContextRef.current.parentResourcesRequirements || [],\n additionalContext: {\n ...resourceContextRef.current.additionalContext,\n inlineEdit: true,\n fieldName,\n },\n resultSummary: (\n typeof value === 'object' && value !== null\n ? value as Record<string, unknown>\n : setNestedValueAtPath({}, fieldName, value)\n ),\n });\n }, [resourceType]);\n\n // ── Resource layout config (explicit template, default chrome, inline-edit default) ──\n const explicitDisplayTemplate = resourceConfig?.frontendConfiguration?.layout?.display;\n const defaultDisplayChromeMode = resourceConfig?.frontendConfiguration?.layout?.defaultChromeMode?.display;\n // A settings-shaped layout offers its writable fields for in-place editing without each field\n // declaring it. Read here, beside `defaultChromeMode`, because this is the one component that\n // holds BOTH the resource config and the display subtree — the generic displayers below are\n // deliberately resource-unaware. See `ResourceLayoutInlineEditDefault`.\n const defaultInlineEdit = resourceConfig?.frontendConfiguration?.layout?.defaultInlineEdit;\n // How an empty field words itself on this layout — overrides the surface policy's `em-dash` for a\n // settings surface, where a dash refuses to say which kind of emptiness it is.\n const defaultEmptyValue = resourceConfig?.frontendConfiguration?.layout?.defaultEmptyValue;\n\n /*\n * The layout's DISPLAY section container mode. Read here, beside the other three layout defaults,\n * and handed to the template host — the grouping that turns sibling sections into one container\n * inspects each child's props, so this has to reach the HOST rather than the `Section` component.\n */\n const defaultSectionAppearance = resourceConfig?.frontendConfiguration?.layout?.defaultDisplaySectionAppearance;\n\n // ── Template resolution (DD-9: schema-only, stable across data changes) ──\n // Must be before early returns to satisfy Rules of Hooks.\n // Priority: explicit layout.display template > auto-generated from schema.\n // A layout with no display chrome of its own reads its facts as tiles; one that declared a chrome keeps it.\n const layoutTemplate = useMemo(\n () => resolveDisplayLayoutTemplate({ explicitTemplate: explicitDisplayTemplate, displaySchema, defaultDisplayChromeMode, resourceConfig }),\n [explicitDisplayTemplate, displaySchema, defaultDisplayChromeMode, resourceConfig],\n );\n\n // ── CUSTOM file activation → resource operation ─────────────────────────────\n //\n // A file field authored with `FileActivationPolicy.CUSTOM` names an OPERATION on\n // THIS resource. Resolving and running one needs resource context, which the\n // generic display components deliberately lack — so the dispatcher is built here\n // and passed down opaquely (same ownership split as `hiddenFieldNames`).\n //\n // It reuses the ACTION-BAR action set rather than executing anything itself. That\n // is the whole point of naming an operation: the action set has already applied\n // role authorization, `enabledCondition`, feature gating, confirmation policy and\n // the ADDRESSABLE→navigate / EMBEDDED→host / API_ONLY→execute dispatch. Re-deriving\n // any of that here would be a second, drifting authority — and would be the one\n // place in the file surface where a click could bypass authorization.\n //\n // An operation the action set does not expose (unauthorized, disabled by its\n // condition, or simply unknown) yields NO handler, so the activation renders inert\n // rather than as a control that does nothing when pressed.\n const fileActivationOperationActions = useResourceOperationActions({\n resourceType: resourceContext.resourceType,\n displayMode: ResourceOperationDisplayMode.DETAIL,\n currentObject: effectiveData,\n // A card or reference preview shows this data in SUMMARY mode, so a file-activation condition reading a field a\n // SUMMARY row cannot carry is named in development (#2467).\n currentObjectDataMode: effectiveDataMode,\n contextResourceIdentifiers: resourceContext.contextResourceIdentifiers ?? {},\n parentResourcesRequirements: resourceContext.parentResourcesRequirements,\n navigationZone: navigationZone ?? NavigationZoneName.PRIMARY,\n sourceOperation: resourceContext.operation,\n });\n\n const onFileActivationOperation = useCallback<FileActivationOperationDispatcher>((request) => {\n // Narrow to the BUTTON arm: a subgroup carries an `operationIdentifier` but no\n // handler, so matching on the identifier alone would find an unclickable entry.\n const match = fileActivationOperationActions.items.find(\n (item): item is Extract<typeof item, { type?: 'button' }> =>\n (item as { type?: string }).type !== 'separator'\n && (item as { type?: string }).type !== 'subgroup'\n && (item as { operationIdentifier?: string }).operationIdentifier === request.operationIdentifier,\n );\n\n if (!match?.onClick) {\n if (envLoader.isDevelopment()) {\n LoggerFrontendService.getLogger().warn(\n `[ResourceAutomaticDisplayer] File \"${request.fieldName}\" requests operation `\n + `\"${request.operationIdentifier}\", which is not available on ${resourceContext.resourceType} `\n + `for the current user/row (unauthorized, condition-disabled, or unknown). The activation is inert.`,\n );\n }\n return;\n }\n\n match.onClick();\n }, [fileActivationOperationActions.items, resourceContext.resourceType]);\n\n const automaticDisplayShaping = useMemo(() => {\n if (explicitDisplayTemplate) {\n return {\n hiddenFieldNames: [],\n inlineEditDisabledFieldNames: [],\n };\n }\n\n // Relationship ownership can depend on discriminator/condition checks against\n // the loaded parent row. Until data exists, automatic READ stays conservative\n // and does not guess nested-read ownership ahead of the actual payload.\n const relationshipShaping = resolveAutomaticRelationshipDisplayShaping({\n resourceType,\n schema: displaySchema,\n parentData: effectiveData as Record<string, unknown> | undefined,\n registry,\n });\n // A field the reader can edit in place stays: the header shows the name but cannot edit it, so hiding the field\n // would remove the only place to rename the record.\n const layoutOffersInlineEdit = resourceConfig?.frontendConfiguration?.layout?.defaultInlineEdit === ResourceLayoutInlineEditDefault.WRITABLE_FIELDS;\n const displayShape = displaySchema ? AutomatedLayoutFrontendUtils.getObjectLikeFieldShape(displaySchema, { commonOnly: false }) : undefined;\n const nameFieldNames = recordNameShownAbove && !layoutOffersInlineEdit\n ? fieldsHoldingTheRecordName({ resourceType, registry, data: effectiveData, t: tRecordName, formatDate, formatDateTime })\n .filter((fieldName) => {\n const fieldSchema = displayShape?.[fieldName] as z.ZodTypeAny | undefined;\n return !fieldSchema || !isInlineEditableByDeclaration(fieldSchema);\n })\n : [];\n return nameFieldNames.length === 0\n ? relationshipShaping\n : { ...relationshipShaping, hiddenFieldNames: [...relationshipShaping.hiddenFieldNames, ...nameFieldNames] };\n }, [displaySchema, effectiveData, explicitDisplayTemplate, registry, resourceType, resourceConfig, recordNameShownAbove, tRecordName, formatDate, formatDateTime]);\n\n const isLoading = !effectiveData;\n\n /**\n * What a read-failure template may ask (#3349): one of this resource's operations, in this READ's context. Defined before\n * the early returns, as a hook must be.\n */\n const askReadFailureOperation = useCallback(async (requestedOperation: string): Promise<unknown> => {\n const target = (resourceConfig?.operations as readonly { operationIdentifier: unknown; isOperationDefault?: boolean }[] | undefined)\n ?.find((candidate) => String(candidate.operationIdentifier) === requestedOperation && candidate.isOperationDefault === true);\n if (!target) throw new Error(`${resourceType} declares no operation ${requestedOperation}`);\n return doOperationRef.current(\n ResourcesConfig_OperationPathUtils.createOperationPathKeyFromOperation(target as never),\n { contextualParameters, parentResourcesRequirements: resourceContextRef.current.parentResourcesRequirements },\n { silent: true },\n );\n }, [resourceConfig, resourceType, contextualParameters]);\n\n if (isReady === false) return null;\n\n // Error state\n if (fetchError) {\n // A resource that can say WHY its record does not load says it here (#3349): see `ResourceLayoutConfig.readFailure`.\n const ReadFailureTemplate = resourceConfig?.frontendConfiguration?.layout?.readFailure;\n if (ReadFailureTemplate) {\n return (\n <div className={className}>\n <ReadFailureTemplate error={fetchError} resourceContext={resourceContext} askOperation={askReadFailureOperation} />\n </div>\n );\n }\n\n const errorTitle = tComponent(FrontendComponentType.RESOURCES_LAYOUTS_READ, 'failedToLoadData');\n const errorMessage = errorTitle;\n\n return (\n <div className={className}>\n <div role=\"alert\" className=\"p-card bg-destructive/10 border border-destructive rounded-lg\">\n <p className=\"text-destructive font-medium\">{errorTitle}</p>\n <p className=\"text-sm text-destructive/80 mt-item-xs\">{errorMessage}</p>\n </div>\n </div>\n );\n }\n\n // Guard against missing schema\n if (!displaySchema) {\n const configErrorTitle = tComponent(FrontendComponentType.RESOURCES_LAYOUTS_READ, 'configurationError');\n const noSchemaMsg = tComponent(FrontendComponentType.RESOURCES_LAYOUTS_READ, 'noSchemaFound', {\n operation: operationIdentifier,\n resource: resourceType,\n });\n\n return (\n <div className={className}>\n <div role=\"alert\" className=\"p-card bg-destructive/10 border border-destructive rounded-lg\">\n <p className=\"text-destructive font-medium\">{configErrorTitle}</p>\n <p className=\"text-sm text-destructive/80 mt-item-xs\">{noSchemaMsg}</p>\n </div>\n </div>\n );\n }\n\n return (\n <LoadingGate i18nKeys={i18nKeys} loadingScopes={loadingScopes}>\n <AutomaticDisplayer\n schema={displaySchema}\n data={effectiveData}\n className={className}\n labels={labels}\n layoutRefs={layoutRefs}\n resourceType={resourceType}\n resourceId={currentResourceId ? String(currentResourceId) : undefined}\n contextualParameters={contextualParametersWithResourceId}\n contextResourceIdentifiers={contextResourceIdentifiersWithResourceId}\n parentResourcesRequirements={resourceContext.parentResourcesRequirements}\n navigationZone={navigationZone}\n inlineEditOperation={resolvedInlineEditOperation ?? null}\n parentReferenceConfig={parentReferenceConfig}\n fileUploadContext={fileUploadContext}\n rmm={effectiveRmm}\n onInlineEditSuccess={\n !effectiveRmm && allowsDirectOperationFallback(updateLikeMutationFallbackMode)\n ? handleInlineEditSuccess\n : undefined\n }\n updateLikeMutationFallbackMode={updateLikeMutationFallbackMode}\n layoutTemplate={layoutTemplate}\n isLoading={isLoading}\n defaultDisplayChromeMode={defaultDisplayChromeMode}\n defaultInlineEdit={defaultInlineEdit}\n defaultEmptyValue={defaultEmptyValue}\n defaultSectionAppearance={defaultSectionAppearance}\n hiddenFieldNames={automaticDisplayShaping.hiddenFieldNames}\n inlineEditDisabledFieldNames={automaticDisplayShaping.inlineEditDisabledFieldNames}\n onFileActivationOperation={onFileActivationOperation}\n />\n </LoadingGate>\n );\n}\n\nResourceAutomaticDisplayerComponent.displayName = 'ResourceAutomaticDisplayer';\n\n\nexport const ResourceAutomaticDisplayer: typeof ResourceAutomaticDisplayerComponent & { displayName: string } = ResourceAutomaticDisplayerComponent;\n\n"]}
|
|
1
|
+
{"version":3,"file":"ResourceAutomaticDisplayer.js","sourceRoot":"","sources":["../../../../src/components/data-display/ResourceAutomaticDisplayer.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEjF,OAAO,EACL,2BAA2B,EAC3B,SAAS,EAET,QAAQ,EAER,kCAAkC,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACzF,OAAO,EAAE,6BAA6B,EAAE,MAAM,kEAAkE,CAAC;AACjH,OAAO,EACL,qBAAqB,GACtB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,sBAAsB,EAAE,6BAA6B,EAA2B,MAAM,0BAA0B,CAAC;AAE1H,OAAO,EAAE,kBAAkB,EAAiC,MAAM,sBAAsB,CAAC;AAEzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAKxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAAE,2BAA2B,EAAE,MAAM,gEAAgE,CAAC;AAC7G,OAAO,EAAE,4BAA4B,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEzF,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AAC1H,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAC;AAC1E,OAA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qBAAqB,EAAE,qBAAqB,EAC5C,iBAAiB,EAAE,iBAAiB,EACpC,GAAG,EAAE,YAAY,EACjB,mBAAmB,EACjB,CAAC,YAAY,IAAI,6BAA6B,CAAC,8BAA8B,CAAC;gBAC5E,CAAC,CAAC,uBAAuB;gBACzB,CAAC,CAAC,SAAS,EAEf,8BAA8B,EAAE,8BAA8B,EAC9D,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,SAAS,EACpB,wBAAwB,EAAE,wBAAwB,EAClD,iBAAiB,EAAE,iBAAiB,EACpC,iBAAiB,EAAE,iBAAiB,EACpC,wBAAwB,EAAE,wBAAwB,EAClD,gBAAgB,EAAE,uBAAuB,CAAC,gBAAgB,EAC1D,4BAA4B,EAAE,uBAAuB,CAAC,4BAA4B,EAClF,yBAAyB,EAAE,yBAAyB,GACpD,GACU,CACf,CAAC;AACJ,CAAC;AAED,mCAAmC,CAAC,WAAW,GAAG,4BAA4B,CAAC;AAG/E,MAAM,CAAC,MAAM,0BAA0B,GAAyE,mCAAmC,CAAC","sourcesContent":["/**\n * ResourceAutomaticDisplayer Component\n *\n * A fully autonomous display component that derives all configuration from a\n * FrontendResourceOperationContext. It automatically:\n * - Uses the operation's responseDto (or mainSchema) as the display schema\n * - Resolves labels from i18n based on resource type and operation\n * - Fetches data for READ operations\n * - Handles i18n loading via LoadingGate\n * - Generates a display template from schema (DD-9: template-as-skeleton)\n *\n * The template renders unconditionally — when data is still loading, individual\n * DisplayField components show `<Skeleton>` placeholders via DisplayTemplateContext.isLoading.\n */\n\nimport React, { useCallback, useEffect, useMemo, useState, useRef } from 'react';\n\nimport {\n ErrorCustomMessageReference,\n ErrorType,\n WildoError_Frontend,\n DataMode,\n type FieldMetaEntry,\n ResourcesConfig_OperationPathUtils, describeCaughtError } from '@wildo-ai/saas-models';\nimport { buildResourceFileServeBaseUrl } from '~wildo-frontend-lib/core/resources/file-serve-url.frontend.utils';\nimport {\n FrontendComponentType,\n} from '@wildo-ai/presets-components-models';\nimport type { z } from 'zod';\nimport { getPrimaryKeyFieldName, isInlineEditableByDeclaration, type FileFieldEndpoints } from '@wildo-ai/zod-decorators';\n\nimport { AutomaticDisplayer, type AutomaticDisplayerLabels } from './AutomaticDisplayer';\nimport type { ParentReferenceConfig } from './automatic-displayer.utils';\nimport { setNestedValueAtPath } from './display-field-resolution.utils';\nimport type {\n FrontendResourceConfiguration_Operation,\n FrontendResourceOperationContext,\n} from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { useResourceRegistry } from '~wildo-frontend-lib/core/resources/useResourceRegistry';\nimport { useResourceOperationActions } from '~wildo-frontend-lib/core/resources/useResourceOperationActions';\nimport { ResourceOperationDisplayMode, NavigationZoneName } from '@wildo-ai/saas-models';\nimport type { FileActivationOperationDispatcher } from '~wildo-frontend-lib/components/data-display/useFileActivation';\nimport { frontendResourceUtils, FrontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport { useEventBus } from '~wildo-frontend-lib/core/events/useEventBus';\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n';\nimport { ErrorBuilderFrontend } from '~wildo-frontend-lib/core/errors/errors-builder.frontend.services';\nimport { FrontendEvents } from '~wildo-frontend-lib/core/events/events.frontend.schemas';\nimport { describeErrorGuidance, describeResourceErrorForNotification } from '~wildo-frontend-lib/components/form/validation-errors/resource-error-notification-context.utils';\nimport { envLoader } from '~wildo-frontend-lib/core/runtime/env-variable-loader.frontend.service';\nimport { AutomatedLayoutFrontendUtils } from '~wildo-frontend-lib/core/automated-layout/automated-layout.frontend.utils';\nimport { useSearchParams } from 'react-router';\nimport { LoadingGate } from '~wildo-frontend-lib/core/loading/LoadingGate';\nimport { LoggerFrontendService } from '~wildo-frontend-lib/core/monitoring/logger.frontend.service';\nimport { resolveDisplayLayoutTemplate } from './display-layout-template.utils';\nimport { fieldsHoldingTheRecordName } from '~wildo-frontend-lib/core/automated-layout/record-fact-roles.frontend.utils';\nimport { ResourceLayoutInlineEditDefault } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport { resolveAutomaticRelationshipDisplayShaping } from '~wildo-frontend-lib/core/resources/relationship-surface-runtime.frontend.utils';\nimport { pickInlineFieldWriteOperation, resolveRecordOrganizationId } from '~wildo-frontend-lib/core/resources/resource-addressability.frontend.utils';\nimport { useViewerEffectiveRolesInOrganization } from '~wildo-frontend-lib/core/navigation/launcher-runtime-availability';\n\nimport { RMMEventType, MutationSourceType, ConflictStrategy } from '~wildo-frontend-lib/core/resources/rmm/types';\nimport { useResourceRMM } from '~wildo-frontend-lib/core/resources/rmm/useResourceRMM';\nimport { useResourceOperationOutcomeEmitter } from '~wildo-frontend-lib/core/resources/useResourceOperationOutcomeEmitter';\nimport { refetchAuthoritativeRMMState } from '~wildo-frontend-lib/core/resources/rmm/RMMWebSocketBridge';\nimport { useShownRowChangedAt } from '~wildo-frontend-lib/core/resources/useShownRowChangedAt';\nimport {\n canSeedRMMFromLoadedPayload,\n performCanonicalRMMRead,\n resolveCanonicalRMMReadOperationPathKey,\n} from '~wildo-frontend-lib/core/resources/rmm/canonical-read.frontend.utils';\nimport {\n allowsDirectOperationFallback,\n UpdateLikeMutationFallbackMode,\n} from '~wildo-frontend-lib/core/resources/rmm/update-like-mutation-fallback.frontend';\nimport type { NavigationZone } from '~wildo-frontend-lib/core/navigation/navigation.schemas';\nimport { isTransientBackendFailure } from '~wildo-frontend-lib/core/requests/auth-refresh-resilience.frontend';\nimport { isApiNotReadyError } from '~wildo-frontend-lib/core/requests/api-readiness-checker.frontend.service';\nimport {\n normalizeContextResourceIdentifiersForOutcome,\n normalizeContextResourceIdentifiersForTransport,\n} from '~wildo-frontend-lib/core/resources/context-resource-identifiers.frontend.utils';\n\nconst logger = LoggerFrontendService.getLogger();\nconst logDebug = logger.debugByType('ResourceAutomaticDisplayer');\n\n/** First retry of a transiently failed read. Short: most such failures are a restart already nearly over. */\nexport const READ_RETRY_FIRST_DELAY_MS = 2_000;\n/** The backoff's ceiling: a backend down for minutes is asked twice a minute, not ten times. */\nexport const READ_RETRY_MAX_DELAY_MS = 30_000;\nlogger.setDebugTypeLogging('ResourceAutomaticDisplayer', false);\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\n/** What the displayer says about the record it reports through `onDataLoaded` (#3090). */\nexport interface ResourceAutomaticDisplayerShownRecord {\n /**\n * Whether this displayer holds the canonical record, or will once its RMM is seeded (#3092): its payload IS the record\n * (the canonical READ, in RAW mode), or an RMM holds the row. False only beside another payload with no RMM (a row\n * with no update operation) or after the RMM could not be seeded; a host then reads the record itself.\n */\n holdsCanonicalRecord: boolean;\n /**\n * The canonical record itself (#3092): the payload when that IS the record, else the RMM's copy, which an RMM holds\n * whatever the body displays and keeps current through inline edits and other people's changes. `undefined` while\n * the RMM is being seeded, and whenever `holdsCanonicalRecord` is false.\n */\n canonicalRecord: Record<string, unknown> | undefined;\n}\n\nexport interface ResourceAutomaticDisplayerProps {\n /** The resource operation context containing all operation details */\n resourceContext: FrontendResourceOperationContext;\n\n /** Callback when data fetch fails */\n onError?: (error: Error) => void;\n\n /** Additional CSS classes */\n className?: string;\n\n /** Override labels (merged with auto-resolved labels) */\n labelsOverride?: Partial<AutomaticDisplayerLabels>;\n\n\n /**\n * Data mode override (takes priority over query param).\n * Priority: Component prop > Query param > Backend default\n */\n dataMode?: DataMode;\n\n /**\n * The payload this displayer renders, reported every time it changes: the first read, every re-read, and every RMM\n * update (#3090). The record page hands it to its action bar and its nested relationship sections (conditional\n * relationship filtering).\n *\n * `shown` carries the canonical RECORD beside it (#3092), which is what the page hands its header: the payload itself\n * when it IS the record (the canonical READ, in RAW mode), else the copy this displayer's RMM holds, which the RMM\n * keeps current through inline edits and other people's changes. A read-like custom operation or a summary/context\n * data mode renders another payload, which a header template's fields cannot rely on.\n */\n onDataLoaded?: (data: Record<string, unknown>, shown: ResourceAutomaticDisplayerShownRecord) => void;\n\n /**\n * Parent reference configuration for inChildView display (C1: P5-02).\n * Passed through to AutomaticDisplayer → ResourceDisplayContext → FK Display Preset.\n */\n parentReferenceConfig?: ParentReferenceConfig;\n /** Current navigation zone for inline-edit quick-create flows */\n navigationZone?: NavigationZone;\n /**\n * Controls whether engine-default inline edit may downgrade to a direct UPDATE\n * operation when RMM is unavailable. Defaults to `RMM_REQUIRED`.\n */\n updateLikeMutationFallbackMode?: UpdateLikeMutationFallbackMode;\n /**\n * The host shows this record's NAME directly above the body — the READ page, whose header is the record's name.\n *\n * A GENERATED read body then leaves out the field the name was made from (the field whose value IS the name), so\n * the page does not say \"Test\" in its header and \"Title: Test\" in its first tile (#3066, measured on Wonder\n * Procurement's purchase requests and suppliers). Decided by VALUE, the way a list card decides it: the name comes\n * from `getFrontendResourceLabel`, which may be any function of the record, so no field can be named in advance.\n * An authored `layout.display` is the author's, and keeps every field it places. Off by default: a body rendered\n * without the record's name above it (a one-to-one child under its parent) must keep the field.\n */\n recordNameShownAbove?: boolean;\n}\n\n// =============================================================================\n// COMPONENT\n// =============================================================================\n\nfunction ResourceAutomaticDisplayerComponent({\n resourceContext,\n onError,\n className,\n labelsOverride,\n dataMode: propDataMode,\n onDataLoaded,\n parentReferenceConfig,\n navigationZone,\n updateLikeMutationFallbackMode = UpdateLikeMutationFallbackMode.RMM_REQUIRED,\n recordNameShownAbove = false,\n}: ResourceAutomaticDisplayerProps): React.JSX.Element | null {\n // Contexts\n const { doOperation, registry } = useResourceRegistry();\n const { emit, resourceRefreshEvent } = useEventBus();\n const { lastRefreshAt } = resourceRefreshEvent({ ctx: resourceContext as any });\n const { tComponent, isReady, t: tRecordName, formatDate, formatDateTime } = useI18n({ component: FrontendComponentType.RESOURCES_LAYOUTS_READ, resource: resourceContext.resourceType });\n const [searchParams] = useSearchParams();\n\n const i18nKeys = useMemo(() => [\n `resources.${resourceContext.resourceType}`,\n `components.${FrontendComponentType.RESOURCES_LAYOUTS_READ}`,\n ], [resourceContext.resourceType]);\n\n // Refs for stable function references (avoid infinite loops in useEffect)\n const doOperationRef = useRef(doOperation);\n const emitRef = useRef(emit);\n const onErrorRef = useRef(onError);\n const onDataLoadedRef = useRef(onDataLoaded);\n const resourceContextRef = useRef(resourceContext);\n\n // Keep refs updated\n doOperationRef.current = doOperation;\n emitRef.current = emit;\n onErrorRef.current = onError;\n onDataLoadedRef.current = onDataLoaded;\n resourceContextRef.current = resourceContext;\n\n // Error builder (memoized to prevent recreation)\n const errorBuilder = useMemo(() => new ErrorBuilderFrontend(), []);\n\n // Extract from resource context\n const { resourceType, operation, contextResourceIdentifiers } = resourceContext;\n const operationIdentifier = String(operation.operationIdentifier);\n\n // State\n const [data, setData] = useState<Record<string, unknown> | null>(null);\n /**\n * When THIS row last changed while the page renders `data` rather than the RMM's copy (#1782, #3090, #3092): no RMM,\n * a failed RMM seed, or a payload that is not the canonical record (a read-like custom operation, a summary or\n * context data mode). `data` is read once and nothing else reads it back, so an action run on such a row (a\n * workbench secret's \"set\") left the page it was run from showing the old values. Keyed into the fetch effect beside\n * `lastRefreshAt`; set from `useShownRowChangedAt`, below the RMM.\n */\n const [dataStaleAt, setDataStaleAt] = useState<number | null>(null);\n const [fetchError, setFetchError] = useState<WildoError_Frontend | null>(null);\n const [rmmSeedFailed, setRmmSeedFailed] = useState(false);\n\n const loadingScopes = useMemo(() => [{ resourceType, operation: operationIdentifier }], [resourceType, operationIdentifier]);\n\n // Extract dataMode: Component prop > Query param > Backend default\n const dataMode = useMemo(() => {\n return frontendResourceUtils.extractDataMode(searchParams, propDataMode);\n }, [searchParams, propDataMode]);\n const effectiveDataMode = useMemo(() => dataMode ?? DataMode.RAW, [dataMode]);\n\n // Get the display schema from the operation based on dataMode\n const displaySchema = useMemo(() => {\n let schema;\n switch (effectiveDataMode) {\n case DataMode.SUMMARY:\n schema = operation.summaryDto || operation.responseDto;\n break;\n case DataMode.CONTEXT:\n schema = operation.contextDto || operation.responseDto;\n break;\n case DataMode.RAW:\n default:\n schema = operation.responseDto;\n break;\n }\n\n if (!schema) {\n logger.error('[ResourceAutomaticDisplayer] No DTO found', {\n operationIdentifier,\n resourceType,\n dataMode: effectiveDataMode,\n });\n }\n return schema;\n }, [effectiveDataMode, operation, operationIdentifier, resourceType]);\n\n // Get resource configuration for frontendConfiguration\n const resourceConfig = useMemo(() => {\n return registry.resourceConfigurations[resourceType];\n }, [registry, resourceType]);\n\n // Resolve layout refs for i18n label resolution\n const layoutRefs = resourceConfig?.frontendConfiguration?.layout?.refs;\n\n // Build a stable key from contextResourceIdentifiers for memoization\n const contextResourceIdentifiersKey = useMemo(() => {\n return FrontendResourceUtils.buildContextResourceIdentifiersKey(contextResourceIdentifiers);\n }, [contextResourceIdentifiers]);\n\n // Build contextual parameters for API calls\n const contextualParameters = useMemo(() => {\n return FrontendResourceUtils.buildContextualParameters(contextResourceIdentifiers, registry);\n // eslint-disable-next-line react-hooks/exhaustive-deps -- using stable key instead of object reference\n }, [contextResourceIdentifiersKey, registry]);\n\n // Fetch through the actual routed/display operation so request/response DTOs\n // stay aligned for custom read-like surfaces.\n const operationPathKey = useMemo(() => {\n return ResourcesConfig_OperationPathUtils.createOperationPathKeyFromOperation(operation);\n }, [operation]);\n\n // Build labels for AutomaticDisplayer\n // Injects resourceContext for automatic i18n label resolution.\n // Explicit labelsOverride fields/enums/sections take priority over i18n.\n const labels = useMemo<AutomaticDisplayerLabels>(() => {\n return {\n resourceContext: { resourceType, operationId: operationIdentifier },\n ...labelsOverride,\n };\n }, [resourceType, operationIdentifier, labelsOverride]);\n\n // Build fileUploadContext for display. `getMetadata` (global /files) loads file\n // metadata; `serve` is the resource-integrated, AUTHENTICATED byte-serve base for\n // inline image/PDF previews (authorization inherits the parent resource's READ —\n // the display consumer appends `/{fileId}` and fetches via the authed client).\n const fileUploadContext = useMemo<Record<string, FileFieldEndpoints> | undefined>(() => {\n if (!displaySchema) return undefined;\n\n try {\n const fileFieldPaths = AutomatedLayoutFrontendUtils.collectFileFieldPaths(displaySchema);\n if (fileFieldPaths.length === 0) return undefined;\n\n const apiBaseUrl = envLoader.getApiUrl();\n const filesBasePath = `${apiBaseUrl}/api/v1/files`;\n\n // Resolve the resource-integrated serve base per field for the CURRENT record, via\n // the shared builder (see `buildResourceFileServeBaseUrl`). A context-addressed\n // singleton READ (e.g. the user's own profile) has no resourceId in its route, so\n // the record's own `_id` (from the fetched `data`) fills the `{resourceId}` segment —\n // until `data` loads it stays unresolved → serve omitted → neutral card.\n const serveBaseByField: Record<string, string> = {};\n const recordId = data\n ? String((data as Record<string, unknown>)._id\n ?? (data as Record<string, unknown>)[resourceConfig?.resourceFieldIdentifier ?? '_id']\n ?? '')\n : '';\n if (resourceConfig && recordId) {\n for (const fieldName of fileFieldPaths) {\n const serveBase = buildResourceFileServeBaseUrl({\n registry,\n resourceConfig,\n operation,\n resourceType,\n fieldName,\n recordId,\n contextResourceIdentifiers,\n contextualParameters,\n parentResourcesRequirements: resourceContextRef.current.parentResourcesRequirements,\n apiBaseUrl,\n });\n if (serveBase) serveBaseByField[fieldName] = serveBase;\n }\n }\n\n const context: Record<string, FileFieldEndpoints> = {};\n for (const fieldName of fileFieldPaths) {\n context[fieldName] = {\n getMetadata: filesBasePath,\n serve: serveBaseByField[fieldName],\n // Upload/override/delete not needed for display\n upload: '',\n override: undefined,\n delete: '',\n };\n }\n\n return context;\n } catch {\n return undefined;\n }\n // `data` is a dep: the serve base needs the fetched record's id (context-addressed\n // singletons have no resourceId in the READ route), so it must recompute on load.\n }, [displaySchema, resourceConfig, operation, registry, contextResourceIdentifiers, contextualParameters, resourceType, data]);\n\n // Fetch data - use refs to avoid infinite loops from unstable function references\n useEffect(() => {\n let cancelled = false;\n let retryTimer: ReturnType<typeof setTimeout> | undefined;\n let retryDelay = READ_RETRY_FIRST_DELAY_MS;\n\n /*\n * `isRetry` keeps the FAILURE on screen while another attempt is made. Clearing it first would\n * flip the surface error → skeleton → error every few seconds; and a retry is not a reason to\n * pretend the last attempt worked.\n */\n const fetchData = async (isRetry = false) => {\n if (!isRetry) setFetchError(null);\n\n try {\n const result = await doOperationRef.current(\n operationPathKey,\n {\n contextualParameters,\n parentResourcesRequirements: resourceContextRef.current.parentResourcesRequirements,\n dataMode: effectiveDataMode,\n },\n // silent: this displayer owns the read-failure UX — it renders the error\n // inline (setFetchError below) AND emits NOTIFY_RESOURCE_ERROR. Suppress\n // the redundant GLOBAL error toast so a failed read doesn't triple-surface\n // (inline + resource toast + global toast). Matches the resource-owned model.\n { silent: true },\n );\n\n if (cancelled) return;\n setFetchError(null);\n setData(result);\n // The host learns the record from the effect on `effectiveData` below, which also follows the RMM (#3090).\n } catch (error) {\n if (cancelled) return;\n\n // Preserve the real operation path key in diagnostics so custom read-like\n // surfaces are debuggable without pretending they are literal READ ops.\n const originalError = error instanceof Error ? error : new Error(String(error));\n\n const errorRecord = (error && typeof error === 'object') ? error as Record<string, unknown> : {};\n const wildoError = errorBuilder.buildWildoError_Frontend(\n ErrorType.NOT_FOUND,\n {\n customMessageReference: ErrorCustomMessageReference.FRONTEND_FORM_READ_OPERATION_NOT_AVAILABLE,\n operationPathKey,\n context: {\n resourceType,\n operationIdentifier,\n originalErrorMessage: originalError.message,\n originalErrorStack: originalError.stack,\n httpCode: errorRecord.code,\n httpContext: errorRecord.context,\n },\n }\n );\n\n setFetchError(wildoError);\n\n /*\n * A TRANSIENT failure is retried, with backoff, until it succeeds or the surface unmounts.\n *\n * A read that lost a race with a backend restart used to be the END of that surface: the\n * alert below, and nothing else, until the person navigated away and back. Measured\n * 2026-09-20 in a browser drive — a detail pane sat on \"failed to load\" for a full minute\n * while its backend had been answering again for most of it. `ApiNotReadyError` exists\n * precisely so \"callers and retry ladders\" can classify this case, and this caller had none.\n *\n * ONLY transient failures: a 404 or a 403 is an answer, and asking again is how a surface\n * comes to hammer a server that has already said no. The classifier is the framework's own\n * (`isTransientBackendFailure` — no response, 5xx, 408, the readiness gate's bounded refusal).\n *\n * The error event below fires for the FIRST failure of a sequence only, so a backend that is\n * down for two minutes produces one notification, not one per attempt.\n */\n if (isTransientBackendFailure(error) || isApiNotReadyError(error)) {\n if (retryTimer !== undefined) clearTimeout(retryTimer);\n retryTimer = setTimeout(() => { retryTimer = undefined; void fetchData(true); }, retryDelay);\n retryDelay = Math.min(retryDelay * 2, READ_RETRY_MAX_DELAY_MS);\n }\n if (isRetry) return;\n\n // Emit error event\n const currentCtx = resourceContextRef.current;\n const { errorRefusalCode } = describeResourceErrorForNotification(error);\n emitRef.current(FrontendEvents.NOTIFY_RESOURCE_ERROR, {\n ...currentCtx,\n contextResourceIdentifiers: normalizeContextResourceIdentifiersForTransport(\n currentCtx.contextResourceIdentifiers,\n ),\n parentResourcesRequirements: currentCtx.parentResourcesRequirements || [],\n additionalContext: {\n ...currentCtx.additionalContext,\n error: originalError.message,\n // Let the notification layer resolve a localized message (tErrorMessage)\n // instead of falling back to the generic default-error label.\n errorCustomMessageReference: ErrorCustomMessageReference.FRONTEND_FORM_READ_OPERATION_NOT_AVAILABLE,\n // The server's own words outrank that category when it gave any: a declared refusal code and\n // its user guidance, as every other failed-operation notification carries them (#1782 review, F3).\n ...(errorRefusalCode ? { errorRefusalCode } : {}),\n ...describeErrorGuidance(error),\n },\n });\n\n onErrorRef.current?.(originalError);\n logDebug('fetch error', { resourceType, error: originalError.message });\n } finally {\n // no-op — loading tracked by centralized LoadingContext\n }\n };\n\n void fetchData();\n\n return () => {\n cancelled = true;\n if (retryTimer !== undefined) clearTimeout(retryTimer);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps -- using refs for unstable functions/objects; contextResourceIdentifiersKey is the stable proxy for contextualParameters\n }, [resourceType, operationPathKey, contextResourceIdentifiersKey, errorBuilder, operationIdentifier, effectiveDataMode, lastRefreshAt, dataStaleAt]);\n\n // Extract resource ID for inline editing support (must be before early returns — React hooks rule)\n const currentResourceId = useMemo(() => {\n const ctxValue = contextResourceIdentifiers?.[resourceType];\n if (ctxValue) return frontendResourceUtils.getResourceId(ctxValue);\n // ── READ-bootstrap fallback: the row had no id in its URL, so take it from the loaded data ──\n //\n // This is the path `useResourceRMM`'s own pin is named for — \"fails closed for parent-context\n // singleton updates UNTIL READ BOOTSTRAP PROVIDES THE PERSISTED CHILD ID\". A context-addressed\n // singleton (one `organizationSsoConfig` per organization) is addressed by its parent scope and\n // carries no id of its own in the route, so this is the only place its identity can come from.\n //\n // It asked for `data[resourceFieldIdentifier]` alone, and that name is a URL PARAMETER\n // (`organizationSsoConfigId`), not a payload field. Measured 2026-09-19 on the running\n // application: the READ returns `[\"_id\", \"enforcement\", \"domains\", …]` and the lookup asked for\n // `organizationSsoConfigId`, so the id stayed undefined after a perfectly successful read.\n //\n // The consequences ran three layers deep and were all silent. The RMM is keyed on the resource\n // id, so it never attached; `canInlineEdit` is `!!rmm || <a fallback that also demands an id>`,\n // so it was false; every field on every settings singleton therefore rendered read-only,\n // booleans as a ✓/✕ glyph. That is why no settings schema had ever declared `inlineEditable` —\n // doing so would have changed nothing, because the floor was here.\n //\n // The field-identifier lookup is TRIED FIRST and kept: a payload that does carry it is answered\n // exactly as before, so no resource changes behaviour by this fallback gaining a second leg.\n if (data) {\n // getResourceFieldIdentifierForType throws if unconfigured — which is correct here,\n // since we cannot extract a resource ID without a valid field identifier.\n const fieldId = FrontendResourceUtils.getResourceFieldIdentifierForType(resourceType, registry);\n const byFieldIdentifier = data[fieldId];\n if (byFieldIdentifier != null) return byFieldIdentifier;\n\n // What the row calls its own identity. Read from the resource's declared main schema rather\n // than assuming `_id`, so a resource naming its primary key otherwise is served too.\n const primaryKeyField = resourceConfig?.mainSchema\n ? getPrimaryKeyFieldName(resourceConfig.mainSchema)\n : undefined;\n if (primaryKeyField) return data[primaryKeyField];\n }\n return undefined;\n }, [contextResourceIdentifiers, resourceType, data, registry, resourceConfig?.mainSchema]);\n\n const contextResourceIdentifiersWithResourceId = useMemo(() => {\n if (!currentResourceId || contextResourceIdentifiers?.[resourceType]) {\n return contextResourceIdentifiers;\n }\n\n return {\n ...contextResourceIdentifiers,\n [resourceType]: String(currentResourceId),\n };\n }, [contextResourceIdentifiers, currentResourceId, resourceType]);\n\n const contextualParametersWithResourceId = useMemo(() => {\n const resourceFieldIdentifier = resourceConfig?.resourceFieldIdentifier;\n if (!currentResourceId || !resourceFieldIdentifier) {\n return contextualParameters;\n }\n\n const resourceId = String(currentResourceId);\n if (String(contextualParameters[resourceFieldIdentifier] ?? '') === resourceId) {\n return contextualParameters;\n }\n\n return {\n ...contextualParameters,\n [resourceFieldIdentifier]: resourceId,\n };\n }, [contextualParameters, currentResourceId, resourceConfig?.resourceFieldIdentifier]);\n\n // =============================================================================\n // RMM (Registry-based, inline-edit-capable resources only)\n // =============================================================================\n\n // The viewer's roles in the tenant this record belongs to, which the in-place write pick asks about (#2473).\n const inlineWriteViewer = useViewerEffectiveRolesInOrganization(\n resolveRecordOrganizationId(\n resourceConfig?.resourceIdentifier as string | undefined,\n currentResourceId != null ? String(currentResourceId) : undefined,\n contextResourceIdentifiersWithResourceId as Record<string, unknown> | undefined,\n ),\n );\n\n const resolvedInlineEditOperation = useMemo<FrontendResourceConfiguration_Operation | undefined>(() => {\n if (!resourceConfig) {\n return undefined;\n }\n\n return pickInlineFieldWriteOperation({\n resourceConfig,\n operations: resourceConfig.operations ?? [],\n registry,\n hasResourceId: currentResourceId != null,\n contextResourceIdentifiers: contextResourceIdentifiersWithResourceId,\n contextualParameters: contextualParametersWithResourceId,\n viewer: inlineWriteViewer,\n });\n }, [\n contextResourceIdentifiersWithResourceId,\n contextualParametersWithResourceId,\n currentResourceId,\n operation,\n registry,\n resourceConfig,\n inlineWriteViewer,\n ]);\n\n const hasUpdateOperation = useMemo(() => {\n return resolvedInlineEditOperation !== undefined;\n }, [resolvedInlineEditOperation]);\n\n /*\n * An in-place edit is a WRITE, and the screen learns a write happened from `RESOURCE_OPERATION_EXECUTED`, announced by\n * the one emitter every operation host uses. This host announced only the success notification, so every outcome\n * listener missed an inline edit (#3928 review F3): the person's own consent re-read in `UserOrgsProvider` (#1973),\n * which is how a grant or a withdrawal made in place on the Preferences page reaches the consent-based providers;\n * the shown-row and configuration-presence refreshes. Announced as the WRITE operation the edit ran through, and as a\n * partial write: the record stays open on this screen, so a listener that reads \"the operation is done\" leaves it be.\n * This displayer hears it too (`useShownRowChangedAt` below) and re-reads its row once, through the version-guarded\n * canonical read that never undoes an edit and announces nothing, as it already did for every other host's write.\n * Through a ref, because the RMM handler below runs keyed on its event id.\n */\n const announceInlineEditOutcome = useResourceOperationOutcomeEmitter(resourceContext, resolvedInlineEditOperation ?? operation);\n const announceInlineEditOutcomeRef = useRef<((result: unknown) => void) | null>(null);\n announceInlineEditOutcomeRef.current = resolvedInlineEditOperation\n ? (result: unknown) => announceInlineEditOutcome(result, { partialWrite: true })\n : null;\n\n const { rmm, rmmSnapshot } = useResourceRMM({\n resourceType,\n resourceId: currentResourceId != null ? String(currentResourceId) : null,\n doOperationRef,\n contextualParameters: contextualParametersWithResourceId,\n parentResourcesRequirements: resourceContext.parentResourcesRequirements as unknown[] | undefined,\n contextResourceIdentifiers: contextResourceIdentifiersWithResourceId,\n resourceSchema: resourceConfig?.mainSchema,\n resourceInheritance: resourceConfig?.inheritenceSchemaDefinition,\n enabled: hasUpdateOperation && currentResourceId != null,\n conflictPolicy: { strategy: ConflictStrategy.ACCEPT_REMOTE },\n });\n\n /*\n * Re-read the row when it changes (#1782, #3090, #3092): an operation run from this screen (every operation host\n * announces a success naming the row) or a change made elsewhere (the websocket's READ refresh naming the row). Both\n * are heard by `useShownRowChangedAt`, the one rule every holder of a row keys its reads on.\n *\n * Each copy of the row is re-read by its own means. The RMM, when one holds the row, is re-read for a change made from\n * THIS screen only (a change made elsewhere reaches it through its own websocket bridge), through a version-guarded\n * canonical read that replaces its confirmed state only with a NEWER version, so it never undoes an edit and makes the\n * websocket's echo of the same change a no-op. `data` is re-fetched (`dataStaleAt`) whenever the\n * body renders it rather than the RMM's copy: no RMM, a failed seed, or a payload that is not the canonical record\n * (`bodyRendersRmmCopyRef`). Re-reading only the RMM there would leave the body as it was, since an RMM state change\n * re-fetches the displayed operation only on an RMM event, and a re-seed is not one (#3090 review).\n *\n * Until #3090 an RMM-held row was skipped here on the claim that a remote change reaches the RMM. That holds only\n * while a websocket is connected, and a change run from the page itself by a host that is not the RMM (an overlay\n * form, a form-less action) had nothing else telling the row.\n */\n const loadedRowIdRef = useRef<string | null>(null);\n loadedRowIdRef.current = typeof data?._id === 'string' || typeof data?._id === 'number' ? String(data._id) : null;\n const rendersFromRmm = rmm !== null && !rmmSeedFailed;\n /** Whether the body renders the RMM's copy rather than `data`; assigned where `effectiveData` is decided, below. */\n const bodyRendersRmmCopyRef = useRef(false);\n const rowChange = useShownRowChangedAt({\n resourceType,\n rowIds: [currentResourceId != null ? String(currentResourceId) : null, loadedRowIdRef.current],\n enabled: currentResourceId != null,\n });\n useEffect(() => {\n if (rowChange == null || currentResourceId == null) return;\n // The RMM is re-read for a change made from THIS screen only. A change made elsewhere reaches the RMM through its\n // own websocket bridge, which replays or re-reads it; re-reading here too would be a second path for the same\n // change (#3092 review). `data` is not the RMM's, so it is re-fetched on either.\n if (rendersFromRmm && rmm !== null && !rowChange.madeElsewhere) {\n const routeRowId = String(currentResourceId);\n refetchAuthoritativeRMMState({ resourceType, resourceId: routeRowId, rmm, doOperation: doOperationRef.current })\n .catch((error: unknown) => {\n logger.warn('[ResourceAutomaticDisplayer] Re-reading the row after it changed failed', {\n resourceType,\n resourceId: routeRowId,\n error: describeCaughtError(error),\n });\n });\n }\n if (!rendersFromRmm || !bodyRendersRmmCopyRef.current) setDataStaleAt(rowChange.at);\n // Keyed on the change alone: a new RMM or a new row is not a change of the row it holds.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [rowChange]);\n\n const canonicalReadOperationPathKey = useMemo(() => {\n if (rmm) {\n return rmm.readOperationPathKey;\n }\n\n return resolveCanonicalRMMReadOperationPathKey(resourceType, registry, {\n hasResourceId: currentResourceId != null,\n contextResourceIdentifiers: contextResourceIdentifiersWithResourceId,\n contextualParameters: contextualParametersWithResourceId,\n });\n }, [\n registry,\n resourceType,\n rmm,\n currentResourceId,\n contextResourceIdentifiersWithResourceId,\n contextualParametersWithResourceId,\n ]);\n const effectiveRmm = rmmSeedFailed ? null : rmm;\n\n useEffect(() => {\n logDebug('RMM obtained', {\n resourceType,\n resourceId: currentResourceId != null ? String(currentResourceId) : undefined,\n rmmExists: !!rmm,\n });\n }, [rmm, resourceType, currentResourceId]);\n\n useEffect(() => {\n setRmmSeedFailed(false);\n }, [canonicalReadOperationPathKey, currentResourceId, operationPathKey, resourceType]);\n\n /**\n * Initialize RMM with fetched data. Dedicated useEffect (not inside the fetch effect)\n * because `rmm` may not be available when the fetch fires (currentResourceId comes from\n * fetched data in some cases). The `confirmedData !== null` guard prevents re-initialization\n * when another consumer (e.g., a form) has already seeded the RMM.\n */\n useEffect(() => {\n if (!rmm || !data) return;\n const snapshot = rmm.getSnapshot();\n if (snapshot.confirmedData !== null && lastRefreshAt == null) return;\n if (!canonicalReadOperationPathKey) {\n setRmmSeedFailed(true);\n logger.warn('[ResourceAutomaticDisplayer] Cannot seed RMM without an addressable canonical READ', {\n resourceType,\n resourceId: currentResourceId != null ? String(currentResourceId) : undefined,\n });\n return;\n }\n\n let cancelled = false;\n const seedRMM = async () => {\n const shouldTrustDisplayedPayload = canSeedRMMFromLoadedPayload({\n loadedOperationPathKey: operationPathKey,\n canonicalReadOperationPathKey,\n dataMode: effectiveDataMode,\n });\n\n const sourceData = shouldTrustDisplayedPayload\n ? data\n : await performCanonicalRMMRead({\n doOperation: doOperationRef.current,\n readOperationPathKey: canonicalReadOperationPathKey,\n contextualParameters: contextualParametersWithResourceId,\n parentResourcesRequirements: resourceContextRef.current.parentResourcesRequirements,\n });\n\n if (cancelled) return;\n if (sourceData == null || typeof sourceData !== 'object') {\n // A canonical read that answers no record is a failed seed: without saying so the body would keep claiming to\n // hold the record (`holdsCanonicalRecord`) with none to give, and the page's header would wait for it forever.\n setRmmSeedFailed(true);\n return;\n }\n\n const row = sourceData as Record<string, unknown>;\n const version = (row._version as number | undefined) ?? 0;\n rmm.setInitialState(row, version, row._field_meta as Record<string, FieldMetaEntry> | undefined);\n setRmmSeedFailed(false);\n logDebug('setInitialState', {\n resourceType,\n resourceId: currentResourceId != null ? String(currentResourceId) : undefined,\n version,\n fieldCount: Object.keys(row).length,\n refreshDriven: snapshot.confirmedData !== null,\n seededFromCanonicalRead: !shouldTrustDisplayedPayload,\n });\n };\n\n seedRMM().catch((error: unknown) => {\n setRmmSeedFailed(true);\n logger.warn('[ResourceAutomaticDisplayer] Failed to seed RMM from canonical read', {\n resourceType,\n resourceId: currentResourceId != null ? String(currentResourceId) : undefined,\n error: describeCaughtError(error),\n });\n });\n\n return () => {\n cancelled = true;\n };\n }, [\n rmm,\n data,\n effectiveDataMode,\n operationPathKey,\n canonicalReadOperationPathKey,\n contextualParametersWithResourceId,\n resourceType,\n currentResourceId,\n lastRefreshAt,\n ]);\n\n // RMM event handler — simpler than the form's handler (no RHF state to sync)\n useEffect(() => {\n if (!rmm || !rmmSnapshot?.lastEvent) return;\n const event = rmmSnapshot.lastEvent;\n logDebug('RMM event', {\n type: event.type,\n resourceType,\n resourceId: currentResourceId != null ? String(currentResourceId) : undefined,\n });\n const shouldRefetchDisplayedOperation = canonicalReadOperationPathKey\n ? !canSeedRMMFromLoadedPayload({\n loadedOperationPathKey: operationPathKey,\n canonicalReadOperationPathKey,\n dataMode: effectiveDataMode,\n })\n : false;\n\n const refetchDisplayedData = () => {\n if (!shouldRefetchDisplayedOperation) return;\n doOperationRef.current(operationPathKey, {\n contextualParameters: contextualParametersWithResourceId,\n parentResourcesRequirements: resourceContextRef.current.parentResourcesRequirements,\n dataMode: effectiveDataMode,\n }).then((result: Record<string, unknown>) => {\n setData(result as Record<string, unknown>);\n }).catch((err) => {\n logger.warn('[ResourceAutomaticDisplayer] Summary/context refetch failed (RMM handler)', {\n resourceType,\n error: describeCaughtError(err),\n });\n });\n };\n\n switch (event.type) {\n case RMMEventType.MUTATION_RESULT: {\n if (event.result.success) {\n if (event.source.type === MutationSourceType.DISPLAY) {\n emitRef.current(FrontendEvents.NOTIFY_RESOURCE_SUCCESS, {\n ...resourceContextRef.current,\n contextResourceIdentifiers: normalizeContextResourceIdentifiersForOutcome({\n contextResourceIdentifiers: resourceContextRef.current.contextResourceIdentifiers,\n resourceType,\n result: event.result.responseData,\n }),\n parentResourcesRequirements: resourceContextRef.current.parentResourcesRequirements || [],\n additionalContext: {\n ...resourceContextRef.current.additionalContext,\n inlineEdit: true,\n fieldName: event.result.savedFields?.[0],\n },\n resultSummary: event.result.responseData,\n });\n // After the notification, in the same turn, as a form's main save does (see `announceInlineEditOutcome`).\n announceInlineEditOutcomeRef.current?.(event.result.responseData);\n }\n refetchDisplayedData();\n }\n break;\n }\n\n case RMMEventType.REMOTE_UPDATE:\n case RMMEventType.CONFLICT_RESET: {\n refetchDisplayedData();\n break;\n }\n\n case RMMEventType.RESOURCE_DELETED: {\n break;\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- intentional: event-driven side effects keyed on lastEvent.id\n }, [rmmSnapshot?.lastEvent?.id]);\n\n const canRenderFromRMM = useMemo(() => {\n return canSeedRMMFromLoadedPayload({\n loadedOperationPathKey: operationPathKey,\n canonicalReadOperationPathKey,\n dataMode: effectiveDataMode,\n });\n }, [canonicalReadOperationPathKey, effectiveDataMode, operationPathKey]);\n\n // Effective data source: only the canonical RAW read surface renders RMM data.\n // Other RAW read-like surfaces keep their authored payload shape even if RMM is active.\n const isSummaryMode = effectiveDataMode === DataMode.SUMMARY || effectiveDataMode === DataMode.CONTEXT;\n const effectiveData = (!isSummaryMode && canRenderFromRMM && rmm && rmmSnapshot.optimisticData)\n ? rmmSnapshot.optimisticData\n : data;\n bodyRendersRmmCopyRef.current = !isSummaryMode && canRenderFromRMM && rendersFromRmm;\n\n /*\n * The host learns the payload this displayer RENDERS, and the canonical record beside it, every time either changes\n * (#3090, #3092): the first read, a re-read, and every RMM update (an inline edit, a remote change, a re-read after an\n * operation). The record page hands the payload to its action bar and the canonical record to its header, so they\n * follow the record the body is about. Reporting only the first fetch, as this did, left the header's status and the\n * action bar's enabled verbs on the record as it was when the page opened.\n *\n * What is reported is what is shown, so it includes the RMM's OPTIMISTIC values while an inline edit is in flight:\n * the header and the action bar's `enabledCondition` see the edit as the body does, and see it undone if it fails.\n */\n const rmmCanonicalRecord = rendersFromRmm ? (rmmSnapshot.optimisticData as Record<string, unknown> | null) : null;\n useEffect(() => {\n if (effectiveData == null) return;\n const canonicalRecord = canRenderFromRMM ? (effectiveData as Record<string, unknown>) : (rmmCanonicalRecord ?? undefined);\n onDataLoadedRef.current?.(effectiveData as Record<string, unknown>, {\n // An RMM that is not seeded yet WILL hold the record: saying so keeps the host from reading a copy of its own\n // in the moment between the payload and the seed (#3092 review).\n holdsCanonicalRecord: canRenderFromRMM || rendersFromRmm,\n canonicalRecord,\n });\n }, [effectiveData, canRenderFromRMM, rendersFromRmm, rmmCanonicalRecord]);\n\n useEffect(() => {\n logDebug('effectiveData source', {\n dataMode: effectiveDataMode,\n usingRmmData: canRenderFromRMM && !!rmmSnapshot?.optimisticData,\n });\n }, [canRenderFromRMM, effectiveDataMode, rmmSnapshot?.optimisticData]);\n\n // GAP-1/4: Optimistic data update after successful inline edit (non-RMM fallback path).\n // When RMM is active, snapshot.optimisticData handles this instead.\n const handleInlineEditSuccess = useCallback((fieldName: string, value: unknown) => {\n // Optimistic local merge — update the field in current data state\n setData((prevData: any) => {\n if (!prevData) return prevData;\n return setNestedValueAtPath(prevData, fieldName, value);\n });\n\n // Emit success notification so external listeners (toasts, sibling components) can react\n emitRef.current(FrontendEvents.NOTIFY_RESOURCE_SUCCESS, {\n ...resourceContextRef.current,\n contextResourceIdentifiers: normalizeContextResourceIdentifiersForOutcome({\n contextResourceIdentifiers: resourceContextRef.current.contextResourceIdentifiers,\n resourceType,\n result: value,\n }),\n parentResourcesRequirements: resourceContextRef.current.parentResourcesRequirements || [],\n additionalContext: {\n ...resourceContextRef.current.additionalContext,\n inlineEdit: true,\n fieldName,\n },\n resultSummary: (\n typeof value === 'object' && value !== null\n ? value as Record<string, unknown>\n : setNestedValueAtPath({}, fieldName, value)\n ),\n });\n // The same outcome the RMM path announces (see `announceInlineEditOutcome`). The write answered nothing this path\n // keeps, so the edited value stands in for it, as in the notification above.\n announceInlineEditOutcomeRef.current?.(setNestedValueAtPath({}, fieldName, value));\n }, [resourceType]);\n\n // ── Resource layout config (explicit template, default chrome, inline-edit default) ──\n const explicitDisplayTemplate = resourceConfig?.frontendConfiguration?.layout?.display;\n const defaultDisplayChromeMode = resourceConfig?.frontendConfiguration?.layout?.defaultChromeMode?.display;\n // A settings-shaped layout offers its writable fields for in-place editing without each field\n // declaring it. Read here, beside `defaultChromeMode`, because this is the one component that\n // holds BOTH the resource config and the display subtree — the generic displayers below are\n // deliberately resource-unaware. See `ResourceLayoutInlineEditDefault`.\n const defaultInlineEdit = resourceConfig?.frontendConfiguration?.layout?.defaultInlineEdit;\n // How an empty field words itself on this layout — overrides the surface policy's `em-dash` for a\n // settings surface, where a dash refuses to say which kind of emptiness it is.\n const defaultEmptyValue = resourceConfig?.frontendConfiguration?.layout?.defaultEmptyValue;\n\n /*\n * The layout's DISPLAY section container mode. Read here, beside the other three layout defaults,\n * and handed to the template host — the grouping that turns sibling sections into one container\n * inspects each child's props, so this has to reach the HOST rather than the `Section` component.\n */\n const defaultSectionAppearance = resourceConfig?.frontendConfiguration?.layout?.defaultDisplaySectionAppearance;\n\n // ── Template resolution (DD-9: schema-only, stable across data changes) ──\n // Must be before early returns to satisfy Rules of Hooks.\n // Priority: explicit layout.display template > auto-generated from schema.\n // A layout with no display chrome of its own reads its facts as tiles; one that declared a chrome keeps it.\n const layoutTemplate = useMemo(\n () => resolveDisplayLayoutTemplate({ explicitTemplate: explicitDisplayTemplate, displaySchema, defaultDisplayChromeMode, resourceConfig }),\n [explicitDisplayTemplate, displaySchema, defaultDisplayChromeMode, resourceConfig],\n );\n\n // ── CUSTOM file activation → resource operation ─────────────────────────────\n //\n // A file field authored with `FileActivationPolicy.CUSTOM` names an OPERATION on\n // THIS resource. Resolving and running one needs resource context, which the\n // generic display components deliberately lack — so the dispatcher is built here\n // and passed down opaquely (same ownership split as `hiddenFieldNames`).\n //\n // It reuses the ACTION-BAR action set rather than executing anything itself. That\n // is the whole point of naming an operation: the action set has already applied\n // role authorization, `enabledCondition`, feature gating, confirmation policy and\n // the ADDRESSABLE→navigate / EMBEDDED→host / API_ONLY→execute dispatch. Re-deriving\n // any of that here would be a second, drifting authority — and would be the one\n // place in the file surface where a click could bypass authorization.\n //\n // An operation the action set does not expose (unauthorized, disabled by its\n // condition, or simply unknown) yields NO handler, so the activation renders inert\n // rather than as a control that does nothing when pressed.\n const fileActivationOperationActions = useResourceOperationActions({\n resourceType: resourceContext.resourceType,\n displayMode: ResourceOperationDisplayMode.DETAIL,\n currentObject: effectiveData,\n // A card or reference preview shows this data in SUMMARY mode, so a file-activation condition reading a field a\n // SUMMARY row cannot carry is named in development (#2467).\n currentObjectDataMode: effectiveDataMode,\n contextResourceIdentifiers: resourceContext.contextResourceIdentifiers ?? {},\n parentResourcesRequirements: resourceContext.parentResourcesRequirements,\n navigationZone: navigationZone ?? NavigationZoneName.PRIMARY,\n sourceOperation: resourceContext.operation,\n });\n\n const onFileActivationOperation = useCallback<FileActivationOperationDispatcher>((request) => {\n // Narrow to the BUTTON arm: a subgroup carries an `operationIdentifier` but no\n // handler, so matching on the identifier alone would find an unclickable entry.\n const match = fileActivationOperationActions.items.find(\n (item): item is Extract<typeof item, { type?: 'button' }> =>\n (item as { type?: string }).type !== 'separator'\n && (item as { type?: string }).type !== 'subgroup'\n && (item as { operationIdentifier?: string }).operationIdentifier === request.operationIdentifier,\n );\n\n if (!match?.onClick) {\n if (envLoader.isDevelopment()) {\n LoggerFrontendService.getLogger().warn(\n `[ResourceAutomaticDisplayer] File \"${request.fieldName}\" requests operation `\n + `\"${request.operationIdentifier}\", which is not available on ${resourceContext.resourceType} `\n + `for the current user/row (unauthorized, condition-disabled, or unknown). The activation is inert.`,\n );\n }\n return;\n }\n\n match.onClick();\n }, [fileActivationOperationActions.items, resourceContext.resourceType]);\n\n const automaticDisplayShaping = useMemo(() => {\n if (explicitDisplayTemplate) {\n return {\n hiddenFieldNames: [],\n inlineEditDisabledFieldNames: [],\n };\n }\n\n // Relationship ownership can depend on discriminator/condition checks against\n // the loaded parent row. Until data exists, automatic READ stays conservative\n // and does not guess nested-read ownership ahead of the actual payload.\n const relationshipShaping = resolveAutomaticRelationshipDisplayShaping({\n resourceType,\n schema: displaySchema,\n parentData: effectiveData as Record<string, unknown> | undefined,\n registry,\n });\n // A field the reader can edit in place stays: the header shows the name but cannot edit it, so hiding the field\n // would remove the only place to rename the record.\n const layoutOffersInlineEdit = resourceConfig?.frontendConfiguration?.layout?.defaultInlineEdit === ResourceLayoutInlineEditDefault.WRITABLE_FIELDS;\n const displayShape = displaySchema ? AutomatedLayoutFrontendUtils.getObjectLikeFieldShape(displaySchema, { commonOnly: false }) : undefined;\n const nameFieldNames = recordNameShownAbove && !layoutOffersInlineEdit\n ? fieldsHoldingTheRecordName({ resourceType, registry, data: effectiveData, t: tRecordName, formatDate, formatDateTime })\n .filter((fieldName) => {\n const fieldSchema = displayShape?.[fieldName] as z.ZodTypeAny | undefined;\n return !fieldSchema || !isInlineEditableByDeclaration(fieldSchema);\n })\n : [];\n return nameFieldNames.length === 0\n ? relationshipShaping\n : { ...relationshipShaping, hiddenFieldNames: [...relationshipShaping.hiddenFieldNames, ...nameFieldNames] };\n }, [displaySchema, effectiveData, explicitDisplayTemplate, registry, resourceType, resourceConfig, recordNameShownAbove, tRecordName, formatDate, formatDateTime]);\n\n const isLoading = !effectiveData;\n\n /**\n * What a read-failure template may ask (#3349): one of this resource's operations, in this READ's context. Defined before\n * the early returns, as a hook must be.\n */\n const askReadFailureOperation = useCallback(async (requestedOperation: string): Promise<unknown> => {\n const target = (resourceConfig?.operations as readonly { operationIdentifier: unknown; isOperationDefault?: boolean }[] | undefined)\n ?.find((candidate) => String(candidate.operationIdentifier) === requestedOperation && candidate.isOperationDefault === true);\n if (!target) throw new Error(`${resourceType} declares no operation ${requestedOperation}`);\n return doOperationRef.current(\n ResourcesConfig_OperationPathUtils.createOperationPathKeyFromOperation(target as never),\n { contextualParameters, parentResourcesRequirements: resourceContextRef.current.parentResourcesRequirements },\n { silent: true },\n );\n }, [resourceConfig, resourceType, contextualParameters]);\n\n if (isReady === false) return null;\n\n // Error state\n if (fetchError) {\n // A resource that can say WHY its record does not load says it here (#3349): see `ResourceLayoutConfig.readFailure`.\n const ReadFailureTemplate = resourceConfig?.frontendConfiguration?.layout?.readFailure;\n if (ReadFailureTemplate) {\n return (\n <div className={className}>\n <ReadFailureTemplate error={fetchError} resourceContext={resourceContext} askOperation={askReadFailureOperation} />\n </div>\n );\n }\n\n const errorTitle = tComponent(FrontendComponentType.RESOURCES_LAYOUTS_READ, 'failedToLoadData');\n const errorMessage = errorTitle;\n\n return (\n <div className={className}>\n <div role=\"alert\" className=\"p-card bg-destructive/10 border border-destructive rounded-lg\">\n <p className=\"text-destructive font-medium\">{errorTitle}</p>\n <p className=\"text-sm text-destructive/80 mt-item-xs\">{errorMessage}</p>\n </div>\n </div>\n );\n }\n\n // Guard against missing schema\n if (!displaySchema) {\n const configErrorTitle = tComponent(FrontendComponentType.RESOURCES_LAYOUTS_READ, 'configurationError');\n const noSchemaMsg = tComponent(FrontendComponentType.RESOURCES_LAYOUTS_READ, 'noSchemaFound', {\n operation: operationIdentifier,\n resource: resourceType,\n });\n\n return (\n <div className={className}>\n <div role=\"alert\" className=\"p-card bg-destructive/10 border border-destructive rounded-lg\">\n <p className=\"text-destructive font-medium\">{configErrorTitle}</p>\n <p className=\"text-sm text-destructive/80 mt-item-xs\">{noSchemaMsg}</p>\n </div>\n </div>\n );\n }\n\n return (\n <LoadingGate i18nKeys={i18nKeys} loadingScopes={loadingScopes}>\n <AutomaticDisplayer\n schema={displaySchema}\n data={effectiveData}\n className={className}\n labels={labels}\n layoutRefs={layoutRefs}\n resourceType={resourceType}\n resourceId={currentResourceId ? String(currentResourceId) : undefined}\n contextualParameters={contextualParametersWithResourceId}\n contextResourceIdentifiers={contextResourceIdentifiersWithResourceId}\n parentResourcesRequirements={resourceContext.parentResourcesRequirements}\n navigationZone={navigationZone}\n inlineEditOperation={resolvedInlineEditOperation ?? null}\n parentReferenceConfig={parentReferenceConfig}\n fileUploadContext={fileUploadContext}\n rmm={effectiveRmm}\n onInlineEditSuccess={\n !effectiveRmm && allowsDirectOperationFallback(updateLikeMutationFallbackMode)\n ? handleInlineEditSuccess\n : undefined\n }\n updateLikeMutationFallbackMode={updateLikeMutationFallbackMode}\n layoutTemplate={layoutTemplate}\n isLoading={isLoading}\n defaultDisplayChromeMode={defaultDisplayChromeMode}\n defaultInlineEdit={defaultInlineEdit}\n defaultEmptyValue={defaultEmptyValue}\n defaultSectionAppearance={defaultSectionAppearance}\n hiddenFieldNames={automaticDisplayShaping.hiddenFieldNames}\n inlineEditDisabledFieldNames={automaticDisplayShaping.inlineEditDisabledFieldNames}\n onFileActivationOperation={onFileActivationOperation}\n />\n </LoadingGate>\n );\n}\n\nResourceAutomaticDisplayerComponent.displayName = 'ResourceAutomaticDisplayer';\n\n\nexport const ResourceAutomaticDisplayer: typeof ResourceAutomaticDisplayerComponent & { displayName: string } = ResourceAutomaticDisplayerComponent;\n\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-data-provenance.frontend.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/external-data-provenance/external-data-provenance.frontend.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"external-data-provenance.frontend.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/external-data-provenance/external-data-provenance.frontend.ts"],"names":[],"mappings":"AA2BA,OAAO,EAIL,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EACpC,MAAM,qCAAqC,CAAC;AAI7C,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,+DAA+D,CAAC;AACtH,OAAO,KAAK,EAAE,sBAAsB,EAAE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,IAAI,CAGvD"}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* about a value that renders correctly without it; a failed read must not become an error on the field, and must not be
|
|
21
21
|
* retried on every render of every synced field.
|
|
22
22
|
*/
|
|
23
|
-
import {
|
|
23
|
+
import { CoreResourceOperation, isDefaultUrlBearingOperation, } from '@wildo-ai/saas-models';
|
|
24
24
|
import { EXTERNAL_DATA_PROVENANCE_ROUTE_SEGMENT, ExternalDataProvenanceResponseSchema, listExternalDataPipelineSyncedLocalFields, } from '@wildo-ai/saas-models/external-data';
|
|
25
25
|
import { NavigationUtils } from '../../../core/navigation/navigation.utils.js';
|
|
26
26
|
import { FrontendResourceUtils } from '../../../core/resources/frontend-resource.utils.js';
|
|
@@ -61,7 +61,10 @@ export function buildExternalDataProvenancePath(params) {
|
|
|
61
61
|
});
|
|
62
62
|
if (!initiatorInfo)
|
|
63
63
|
return undefined;
|
|
64
|
-
|
|
64
|
+
// The initiator URL is the API route the backend mounts verbatim, and it already begins with `/api/v1`
|
|
65
|
+
// (`buildUrlForParentCombination` with `isFrontend: false`), so it is resolved as it is. Prefixing it again
|
|
66
|
+
// doubled the base path, the defect #3858 found on the validate-field sibling of this composition.
|
|
67
|
+
const resolved = NavigationUtils.resolveUrlPath(initiatorInfo.url, contextualParameters);
|
|
65
68
|
if (!resolved || NavigationUtils.hasUnresolvedPlaceholders(resolved))
|
|
66
69
|
return undefined;
|
|
67
70
|
return `${resolved}/${EXTERNAL_DATA_PROVENANCE_ROUTE_SEGMENT}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"external-data-provenance.frontend.js","sourceRoot":"","sources":["../../../../../src/components/data-display/external-data-provenance/external-data-provenance.frontend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EACL,kBAAkB,EAElB,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sCAAsC,EACtC,oCAAoC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,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YACrH,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9C,CAAC;QAAC,MAAM,CAAC;YACP,KAAK,GAAG,IAAI,CAAC;QACf,CAAC;QACD,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAClD,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACtB,MAAM,EAAE,CAAC;IACX,CAAC,CAAC,EAAE,CAAC;IACL,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,6CAA6C;AAC7C,MAAM,UAAU,gCAAgC;IAC9C,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;IACvB,MAAM,EAAE,CAAC;AACX,CAAC","sourcesContent":["/**\n * Reading a pipeline destination's provenance for the display chrome (#1997) — which fields a pipeline writes, the URL\n * of the destination's provenance route, and a small cache so a record with six synced fields asks once.\n *\n * ## Why a module cache and not a provider in the context tree\n *\n * The answer is per DESTINATION and per ORGANIZATION (the route is scoped by the destination's LIST URL, which carries\n * the organization), it changes at most once per pipeline pass, and only a handful of surfaces ever need it. A provider\n * would have to sit in every application's tree for a read most of them never make. So the cache is keyed by the HTTP\n * CLIENT and the RESOLVED URL (#2109). The URL already names the organization, so switching organizations reads a\n * different entry and never shows another tenant's answer; the client names the BACKEND, because a path is relative to\n * `/api/v1` and two applications rendered in one page (a workbench, a test harness) share paths but not backends. A path\n * alone handed the second application the first one's answer. Entries expire after {@link EXTERNAL_DATA_PROVENANCE_TTL_MS}: the hook schedules\n * a re-read at the expiry of the answer it shows, so a page left open across a pipeline pass does not keep saying\n * \"as of\" an instant the copy has since moved past.\n *\n * ## Failure reads as silence\n *\n * A refused or failed read caches `null` for the same period, and the cue then renders nothing. The cue is a courtesy\n * about a value that renders correctly without it; a failed read must not become an error on the field, and must not be\n * retried on every render of every synced field.\n */\nimport {\n MAIN_API_BASE_PATH,\n type ResourceConfiguration_Operation_UrlInitiatorInfo,\n CoreResourceOperation,\n isDefaultUrlBearingOperation,\n} from '@wildo-ai/saas-models';\nimport {\n EXTERNAL_DATA_PROVENANCE_ROUTE_SEGMENT,\n ExternalDataProvenanceResponseSchema,\n listExternalDataPipelineSyncedLocalFields,\n type ExternalDataPipelineDeclaration,\n type ExternalDataProvenanceResponse,\n} from '@wildo-ai/saas-models/external-data';\n\nimport { NavigationUtils } from '~wildo-frontend-lib/core/navigation/navigation.utils';\nimport { FrontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport type { AnyFrontendResourceConfiguration } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport type { WildoBackendHttpClient } from '~wildo-frontend-lib/core/requests/wildo-http-client.frontend.service';\n\n/** How long one answer is trusted: well under a pipeline's shortest sensible interval, well over one page's life. */\nexport const EXTERNAL_DATA_PROVENANCE_TTL_MS = 5 * 60 * 1000;\n\n/**\n * What the display chrome is handed for a synced field — the provenance answer once a pass has COMPLETED. A pipeline\n * that never completed one produces no cue at all rather than an \"as of\" nobody can state.\n */\nexport interface DisplayFieldProvenance {\n /** The declared system-of-record instance NAME; its words come from `systems_of_record.<name>.displayName`. */\n readonly system: string;\n /** When the most recent completed pass BEGAN reading (ISO 8601) — the instant its rows are current as of. */\n readonly currentAsOf: string;\n}\n\nconst syncedFieldsByDeclaration = new WeakMap<ExternalDataPipelineDeclaration, ReadonlySet<string>>();\n\n/** The pipeline-written local fields of a destination, derived once per declaration object. */\nexport function externalDataSyncedFieldSet(declaration: ExternalDataPipelineDeclaration): ReadonlySet<string> {\n let fields = syncedFieldsByDeclaration.get(declaration);\n if (!fields) {\n fields = new Set(listExternalDataPipelineSyncedLocalFields(declaration));\n syncedFieldsByDeclaration.set(declaration, fields);\n }\n return fields;\n}\n\n/**\n * The provenance route of a destination, composed from its default LIST operation's initiator URL. The LIST operation is\n * selected with `isDefaultUrlBearingOperation`, the same predicate the backend mounts the route with\n * (`external-data-provenance-route.backend.ts`), and exactly one must match there too — so the two sides select one\n * operation and describe one path, rather than two selections that happen to agree.\n *\n * @returns a path under `/api/v1` for the HTTP client, or `undefined` when the destination has no LIST initiator whose\n * parameters the current context can fill — in which case no request is made and no cue is shown.\n */\nexport function buildExternalDataProvenancePath(params: {\n resourceConfiguration: AnyFrontendResourceConfiguration;\n contextualParameters: Record<string, string | number>;\n}): string | undefined {\n const { resourceConfiguration, contextualParameters } = params;\n const listOperations = (resourceConfiguration.operations ?? []).filter((operation) =>\n isDefaultUrlBearingOperation(operation, CoreResourceOperation.LIST));\n if (listOperations.length !== 1) return undefined;\n const initiatorInfos = (listOperations[0]!.initiatorInfos ?? []) as ResourceConfiguration_Operation_UrlInitiatorInfo[];\n if (initiatorInfos.length === 0) return undefined;\n const initiatorInfo = FrontendResourceUtils.selectOperationUrlInitiatorInfo({\n initiatorInfos,\n contextualParameters,\n targetResourceType: resourceConfiguration.resourceIdentifier,\n targetDefaultFieldIdentifier: resourceConfiguration.resourceFieldIdentifier,\n });\n if (!initiatorInfo) return undefined;\n const resolved = NavigationUtils.resolveUrlPath(`${MAIN_API_BASE_PATH}${initiatorInfo.url}`, contextualParameters);\n if (!resolved || NavigationUtils.hasUnresolvedPlaceholders(resolved)) return undefined;\n return `${resolved}/${EXTERNAL_DATA_PROVENANCE_ROUTE_SEGMENT}`;\n}\n\ninterface CacheEntry {\n readonly value: ExternalDataProvenanceResponse | null;\n readonly fetchedAt: number;\n}\n\n/** The client a read goes through; only its identity and `get` are used. */\ntype ProvenanceClient = Pick<WildoBackendHttpClient, 'get'>;\n\ninterface ClientStore {\n readonly cache: Map<string, CacheEntry>;\n readonly inFlight: Map<string, Promise<void>>;\n}\n\n/** One store per client, so an answer read through one backend is never shown for another (#2109). */\nlet stores = new WeakMap<ProvenanceClient, ClientStore>();\nconst listeners = new Set<() => void>();\n\nfunction storeOf(client: ProvenanceClient): ClientStore {\n let store = stores.get(client);\n if (!store) {\n store = { cache: new Map(), inFlight: new Map() };\n stores.set(client, store);\n }\n return store;\n}\n\nfunction notify(): void {\n for (const listener of listeners) listener();\n}\n\n/** `useSyncExternalStore` subscription. */\nexport function subscribeExternalDataProvenance(listener: () => void): () => void {\n listeners.add(listener);\n return () => { listeners.delete(listener); };\n}\n\n/**\n * How long until the cached answer for a path expires (ms, never negative), or `undefined` when nothing is cached — the\n * hook's cue to schedule its re-read.\n */\nexport function msUntilExternalDataProvenanceExpires(\n path: string | undefined,\n client: ProvenanceClient | undefined,\n now: number = Date.now(),\n): number | undefined {\n const entry = path && client ? stores.get(client)?.cache.get(path) : undefined;\n return entry ? Math.max(0, entry.fetchedAt + EXTERNAL_DATA_PROVENANCE_TTL_MS - now) : undefined;\n}\n\n/** The cached answer for a path: the response, `null` for a refused/failed read, `undefined` while unknown. */\nexport function peekExternalDataProvenance(path: string | undefined, client: ProvenanceClient | undefined): ExternalDataProvenanceResponse | null | undefined {\n if (!path || !client) return undefined;\n return stores.get(client)?.cache.get(path)?.value;\n}\n\n/**\n * Read the path unless a fresh answer is cached or a read is already on its way. Every synced field of a record calls\n * this; exactly one request leaves.\n */\nexport function ensureExternalDataProvenance(path: string, httpClient: ProvenanceClient, now: number = Date.now()): void {\n const { cache, inFlight } = storeOf(httpClient);\n const entry = cache.get(path);\n if (entry && now - entry.fetchedAt < EXTERNAL_DATA_PROVENANCE_TTL_MS) return;\n if (inFlight.has(path)) return;\n const read = (async () => {\n let value: ExternalDataProvenanceResponse | null;\n try {\n const parsed = ExternalDataProvenanceResponseSchema.safeParse(await httpClient.get<unknown>(path, { silent: true }));\n value = parsed.success ? parsed.data : null;\n } catch {\n value = null;\n }\n cache.set(path, { value, fetchedAt: Date.now() });\n inFlight.delete(path);\n notify();\n })();\n inFlight.set(path, read);\n}\n\n/** Test seam: forget every cached answer. */\nexport function resetExternalDataProvenanceCache(): void {\n stores = new WeakMap();\n notify();\n}\n"]}
|
|
1
|
+
{"version":3,"file":"external-data-provenance.frontend.js","sourceRoot":"","sources":["../../../../../src/components/data-display/external-data-provenance/external-data-provenance.frontend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAEL,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sCAAsC,EACtC,oCAAoC,EACpC,yCAAyC,GAG1C,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,sDAAsD,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AAInG,qHAAqH;AACrH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAa7D,MAAM,yBAAyB,GAAG,IAAI,OAAO,EAAwD,CAAC;AAEtG,+FAA+F;AAC/F,MAAM,UAAU,0BAA0B,CAAC,WAA4C;IACrF,IAAI,MAAM,GAAG,yBAAyB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACxD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,GAAG,IAAI,GAAG,CAAC,yCAAyC,CAAC,WAAW,CAAC,CAAC,CAAC;QACzE,yBAAyB,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,+BAA+B,CAAC,MAG/C;IACC,MAAM,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC;IAC/D,MAAM,cAAc,GAAG,CAAC,qBAAqB,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CACnF,4BAA4B,CAAC,SAAS,EAAE,qBAAqB,CAA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AC,CAAC;IAC9B,IAAI,KAAK,IAAI,GAAG,GAAG,KAAK,CAAC,SAAS,GAAG,+BAA+B;QAAE,OAAO;IAC7E,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO;IAC/B,MAAM,IAAI,GAAG,CAAC,KAAK,IAAI,EAAE;QACvB,IAAI,KAA4C,CAAC;QACjD,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,oCAAoC,CAAC,SAAS,CAAC,MAAM,UAAU,CAAC,GAAG,CAAU,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YACrH,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9C,CAAC;QAAC,MAAM,CAAC;YACP,KAAK,GAAG,IAAI,CAAC;QACf,CAAC;QACD,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAClD,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACtB,MAAM,EAAE,CAAC;IACX,CAAC,CAAC,EAAE,CAAC;IACL,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,6CAA6C;AAC7C,MAAM,UAAU,gCAAgC;IAC9C,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;IACvB,MAAM,EAAE,CAAC;AACX,CAAC","sourcesContent":["/**\n * Reading a pipeline destination's provenance for the display chrome (#1997) — which fields a pipeline writes, the URL\n * of the destination's provenance route, and a small cache so a record with six synced fields asks once.\n *\n * ## Why a module cache and not a provider in the context tree\n *\n * The answer is per DESTINATION and per ORGANIZATION (the route is scoped by the destination's LIST URL, which carries\n * the organization), it changes at most once per pipeline pass, and only a handful of surfaces ever need it. A provider\n * would have to sit in every application's tree for a read most of them never make. So the cache is keyed by the HTTP\n * CLIENT and the RESOLVED URL (#2109). The URL already names the organization, so switching organizations reads a\n * different entry and never shows another tenant's answer; the client names the BACKEND, because a path is relative to\n * `/api/v1` and two applications rendered in one page (a workbench, a test harness) share paths but not backends. A path\n * alone handed the second application the first one's answer. Entries expire after {@link EXTERNAL_DATA_PROVENANCE_TTL_MS}: the hook schedules\n * a re-read at the expiry of the answer it shows, so a page left open across a pipeline pass does not keep saying\n * \"as of\" an instant the copy has since moved past.\n *\n * ## Failure reads as silence\n *\n * A refused or failed read caches `null` for the same period, and the cue then renders nothing. The cue is a courtesy\n * about a value that renders correctly without it; a failed read must not become an error on the field, and must not be\n * retried on every render of every synced field.\n */\nimport {\n type ResourceConfiguration_Operation_UrlInitiatorInfo,\n CoreResourceOperation,\n isDefaultUrlBearingOperation,\n} from '@wildo-ai/saas-models';\nimport {\n EXTERNAL_DATA_PROVENANCE_ROUTE_SEGMENT,\n ExternalDataProvenanceResponseSchema,\n listExternalDataPipelineSyncedLocalFields,\n type ExternalDataPipelineDeclaration,\n type ExternalDataProvenanceResponse,\n} from '@wildo-ai/saas-models/external-data';\n\nimport { NavigationUtils } from '~wildo-frontend-lib/core/navigation/navigation.utils';\nimport { FrontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport type { AnyFrontendResourceConfiguration } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport type { WildoBackendHttpClient } from '~wildo-frontend-lib/core/requests/wildo-http-client.frontend.service';\n\n/** How long one answer is trusted: well under a pipeline's shortest sensible interval, well over one page's life. */\nexport const EXTERNAL_DATA_PROVENANCE_TTL_MS = 5 * 60 * 1000;\n\n/**\n * What the display chrome is handed for a synced field — the provenance answer once a pass has COMPLETED. A pipeline\n * that never completed one produces no cue at all rather than an \"as of\" nobody can state.\n */\nexport interface DisplayFieldProvenance {\n /** The declared system-of-record instance NAME; its words come from `systems_of_record.<name>.displayName`. */\n readonly system: string;\n /** When the most recent completed pass BEGAN reading (ISO 8601) — the instant its rows are current as of. */\n readonly currentAsOf: string;\n}\n\nconst syncedFieldsByDeclaration = new WeakMap<ExternalDataPipelineDeclaration, ReadonlySet<string>>();\n\n/** The pipeline-written local fields of a destination, derived once per declaration object. */\nexport function externalDataSyncedFieldSet(declaration: ExternalDataPipelineDeclaration): ReadonlySet<string> {\n let fields = syncedFieldsByDeclaration.get(declaration);\n if (!fields) {\n fields = new Set(listExternalDataPipelineSyncedLocalFields(declaration));\n syncedFieldsByDeclaration.set(declaration, fields);\n }\n return fields;\n}\n\n/**\n * The provenance route of a destination, composed from its default LIST operation's initiator URL. The LIST operation is\n * selected with `isDefaultUrlBearingOperation`, the same predicate the backend mounts the route with\n * (`external-data-provenance-route.backend.ts`), and exactly one must match there too — so the two sides select one\n * operation and describe one path, rather than two selections that happen to agree.\n *\n * @returns a path under `/api/v1` for the HTTP client, or `undefined` when the destination has no LIST initiator whose\n * parameters the current context can fill — in which case no request is made and no cue is shown.\n */\nexport function buildExternalDataProvenancePath(params: {\n resourceConfiguration: AnyFrontendResourceConfiguration;\n contextualParameters: Record<string, string | number>;\n}): string | undefined {\n const { resourceConfiguration, contextualParameters } = params;\n const listOperations = (resourceConfiguration.operations ?? []).filter((operation) =>\n isDefaultUrlBearingOperation(operation, CoreResourceOperation.LIST));\n if (listOperations.length !== 1) return undefined;\n const initiatorInfos = (listOperations[0]!.initiatorInfos ?? []) as ResourceConfiguration_Operation_UrlInitiatorInfo[];\n if (initiatorInfos.length === 0) return undefined;\n const initiatorInfo = FrontendResourceUtils.selectOperationUrlInitiatorInfo({\n initiatorInfos,\n contextualParameters,\n targetResourceType: resourceConfiguration.resourceIdentifier,\n targetDefaultFieldIdentifier: resourceConfiguration.resourceFieldIdentifier,\n });\n if (!initiatorInfo) return undefined;\n // The initiator URL is the API route the backend mounts verbatim, and it already begins with `/api/v1`\n // (`buildUrlForParentCombination` with `isFrontend: false`), so it is resolved as it is. Prefixing it again\n // doubled the base path, the defect #3858 found on the validate-field sibling of this composition.\n const resolved = NavigationUtils.resolveUrlPath(initiatorInfo.url, contextualParameters);\n if (!resolved || NavigationUtils.hasUnresolvedPlaceholders(resolved)) return undefined;\n return `${resolved}/${EXTERNAL_DATA_PROVENANCE_ROUTE_SEGMENT}`;\n}\n\ninterface CacheEntry {\n readonly value: ExternalDataProvenanceResponse | null;\n readonly fetchedAt: number;\n}\n\n/** The client a read goes through; only its identity and `get` are used. */\ntype ProvenanceClient = Pick<WildoBackendHttpClient, 'get'>;\n\ninterface ClientStore {\n readonly cache: Map<string, CacheEntry>;\n readonly inFlight: Map<string, Promise<void>>;\n}\n\n/** One store per client, so an answer read through one backend is never shown for another (#2109). */\nlet stores = new WeakMap<ProvenanceClient, ClientStore>();\nconst listeners = new Set<() => void>();\n\nfunction storeOf(client: ProvenanceClient): ClientStore {\n let store = stores.get(client);\n if (!store) {\n store = { cache: new Map(), inFlight: new Map() };\n stores.set(client, store);\n }\n return store;\n}\n\nfunction notify(): void {\n for (const listener of listeners) listener();\n}\n\n/** `useSyncExternalStore` subscription. */\nexport function subscribeExternalDataProvenance(listener: () => void): () => void {\n listeners.add(listener);\n return () => { listeners.delete(listener); };\n}\n\n/**\n * How long until the cached answer for a path expires (ms, never negative), or `undefined` when nothing is cached — the\n * hook's cue to schedule its re-read.\n */\nexport function msUntilExternalDataProvenanceExpires(\n path: string | undefined,\n client: ProvenanceClient | undefined,\n now: number = Date.now(),\n): number | undefined {\n const entry = path && client ? stores.get(client)?.cache.get(path) : undefined;\n return entry ? Math.max(0, entry.fetchedAt + EXTERNAL_DATA_PROVENANCE_TTL_MS - now) : undefined;\n}\n\n/** The cached answer for a path: the response, `null` for a refused/failed read, `undefined` while unknown. */\nexport function peekExternalDataProvenance(path: string | undefined, client: ProvenanceClient | undefined): ExternalDataProvenanceResponse | null | undefined {\n if (!path || !client) return undefined;\n return stores.get(client)?.cache.get(path)?.value;\n}\n\n/**\n * Read the path unless a fresh answer is cached or a read is already on its way. Every synced field of a record calls\n * this; exactly one request leaves.\n */\nexport function ensureExternalDataProvenance(path: string, httpClient: ProvenanceClient, now: number = Date.now()): void {\n const { cache, inFlight } = storeOf(httpClient);\n const entry = cache.get(path);\n if (entry && now - entry.fetchedAt < EXTERNAL_DATA_PROVENANCE_TTL_MS) return;\n if (inFlight.has(path)) return;\n const read = (async () => {\n let value: ExternalDataProvenanceResponse | null;\n try {\n const parsed = ExternalDataProvenanceResponseSchema.safeParse(await httpClient.get<unknown>(path, { silent: true }));\n value = parsed.success ? parsed.data : null;\n } catch {\n value = null;\n }\n cache.set(path, { value, fetchedAt: Date.now() });\n inFlight.delete(path);\n notify();\n })();\n inFlight.set(path, read);\n}\n\n/** Test seam: forget every cached answer. */\nexport function resetExternalDataProvenanceCache(): void {\n stores = new WeakMap();\n notify();\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-config.labels.d.ts","sourceRoot":"","sources":["../../../../src/components/flows-actors/agent-config.labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,mBAAmB,EAA2B,MAAM,qCAAqC,CAAC;AAM1I,eAAO,MAAM,2BAA2B,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"agent-config.labels.d.ts","sourceRoot":"","sources":["../../../../src/components/flows-actors/agent-config.labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,KAAK,mBAAmB,EAA2B,MAAM,qCAAqC,CAAC;AAM1I,eAAO,MAAM,2BAA2B,EAAE,mBAAmB,EAkF5D,CAAC"}
|
|
@@ -70,6 +70,8 @@ export const LowLevelAiAgentConfigLabels = [
|
|
|
70
70
|
// credential is unavailable or the outbound guard refuses the target. The words must describe a
|
|
71
71
|
// CONFIGURATION, so they cannot be read as the resolved function-tool list beside them.
|
|
72
72
|
{ ref: 'mcpRefs', kind: LabelKind.LABEL, purpose: 'Label for the MCP servers this agent is configured to reach (a declared configuration, not a list of tools it can currently call)' },
|
|
73
|
+
// #3930: the same 'configured to', for the same reason as `mcpRefs`.
|
|
74
|
+
{ ref: 'remoteAgentRefs', kind: LabelKind.LABEL, purpose: 'Label for the remote agents (other parties\' A2A agents) this agent is configured to delegate tasks to (a declared configuration, not a list of tools it can currently call)' },
|
|
73
75
|
{ ref: 'noCapabilities', kind: LabelKind.EMPTY_STATE, purpose: 'Shown when the agent has no capabilities configured' },
|
|
74
76
|
{ ref: 'booleanYes', kind: LabelKind.LABEL, purpose: 'Affirmative value shown for a boolean agent attribute' },
|
|
75
77
|
{ ref: 'booleanNo', kind: LabelKind.LABEL, purpose: 'Negative value shown for a boolean agent attribute' },
|