@ai-matrx/content-ir-react 0.16.1 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +1 -1
  3. package/dist/{component-resolution.types-DLO2w-0n.d.cts → component-resolution.types-DY4pGymy.d.cts} +1 -1
  4. package/dist/{component-resolution.types-DLO2w-0n.d.ts → component-resolution.types-DY4pGymy.d.ts} +1 -1
  5. package/dist/{component-resolution.types-C1MzCf2s.d.cts → component-resolution.types-DwKSF64x.d.cts} +1 -1
  6. package/dist/{component-resolution.types-C1MzCf2s.d.ts → component-resolution.types-DwKSF64x.d.ts} +1 -1
  7. package/dist/db-component.d.cts +1 -1
  8. package/dist/db-component.d.ts +1 -1
  9. package/dist/{directive-host-C4TcPpxX.d.cts → directive-host-BOML4BQ7.d.cts} +27 -1
  10. package/dist/{directive-host-C4TcPpxX.d.ts → directive-host-BOML4BQ7.d.ts} +27 -1
  11. package/dist/directives.cjs +101 -8
  12. package/dist/directives.cjs.map +1 -1
  13. package/dist/directives.d.cts +19 -3
  14. package/dist/directives.d.ts +19 -3
  15. package/dist/directives.js +101 -8
  16. package/dist/directives.js.map +1 -1
  17. package/dist/{host-types-a0XEr5b3.d.cts → host-types-CKu4ap5K.d.cts} +2 -2
  18. package/dist/{host-types-CEc86R-v.d.ts → host-types-CQ2oIzUy.d.ts} +2 -2
  19. package/dist/host.cjs.map +1 -1
  20. package/dist/host.d.cts +4 -4
  21. package/dist/host.d.ts +4 -4
  22. package/dist/host.js.map +1 -1
  23. package/dist/index.cjs +101 -8
  24. package/dist/index.cjs.map +1 -1
  25. package/dist/index.d.cts +22 -6
  26. package/dist/index.d.ts +22 -6
  27. package/dist/index.js +101 -8
  28. package/dist/index.js.map +1 -1
  29. package/dist/react.cjs +99 -8
  30. package/dist/react.cjs.map +1 -1
  31. package/dist/react.d.cts +4 -4
  32. package/dist/react.d.ts +4 -4
  33. package/dist/react.js +99 -8
  34. package/dist/react.js.map +1 -1
  35. package/dist/resolver.d.cts +2 -2
  36. package/dist/resolver.d.ts +2 -2
  37. package/dist/{route-De9c5YgW.d.ts → route-D0f5H63n.d.ts} +29 -3
  38. package/dist/{route-YcoyR3Fj.d.cts → route-D2Yz3El4.d.cts} +29 -3
  39. package/dist/route.cjs.map +1 -1
  40. package/dist/route.d.cts +2 -2
  41. package/dist/route.d.ts +2 -2
  42. package/dist/route.js.map +1 -1
  43. package/package.json +3 -3
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { C as ComponentResolutionSource, a as ComponentResolution, b as ContentIrErrorReporter } from './component-resolution.types-DLO2w-0n.cjs';
2
- export { c as ComponentRole, d as ContentIrErrorReport, J as JsonObject, K as KindComponentRow, S as SystemComponentEntry, e as consoleErrorReporter } from './component-resolution.types-DLO2w-0n.cjs';
3
- import { C as ContentIrHost, K as KindRouteEnv, a as KindDefinitionSource, D as DirectiveRecordRef } from './route-YcoyR3Fj.cjs';
4
- export { b as ContentIrRenderSeams, c as DB_KIND_COMPONENT_KEY, d as DIRECTIVE_BLOCK_TYPE, e as DirectiveApplyResult, f as DirectiveApplyState, g as DirectiveAskRequest, h as DirectiveCopyProps, i as DirectiveHost, j as DirectiveHostProvider, k as DirectiveHostProviderProps, l as DirectiveOpenItemOptions, m as DirectiveRecordProps, n as DirectiveScope, o as DirectiveScopeProvider, p as DirectiveShell, G as GENERIC_STRUCTURED_COMPONENT_KEY, q as GenericFallbackReason, I as IR_PROVISIONAL_KEY, r as IR_ROUTE_KEY, s as IrRenderBlock, t as IrRoutableBlock, u as IrRouteMarker, v as KindRouteBinding, w as KindRouteOptions, P as PartialRenderOptions, x as ProvisionalKindRender, S as StructuredValueRenderProps, y as SupersededKindRender, z as applyIrKindRoute, A as createKindRouteBinding, B as envelopeFromPartialKind, E as isPartialReadyKind, F as isProvisionalBlock, H as kindServerDataFromStoredValue, J as markKindPartialUnsafe, L as readIrRouteMarker, M as resetPartialUnsafeKinds, N as resetSourcelessDbRowReports, O as resolveAnnouncedKindLoading, Q as resolveProvisionalKindRender, R as resolveSupersededKindRender, T as routeEnvOf, U as useDirectiveHost, V as useDirectiveScope } from './route-YcoyR3Fj.cjs';
1
+ import { C as ComponentResolutionSource, a as ComponentResolution, b as ContentIrErrorReporter } from './component-resolution.types-DY4pGymy.cjs';
2
+ export { c as ComponentRole, d as ContentIrErrorReport, J as JsonObject, K as KindComponentRow, S as SystemComponentEntry, e as consoleErrorReporter } from './component-resolution.types-DY4pGymy.cjs';
3
+ import { C as ContentIrHost, K as KindRouteEnv, a as KindDefinitionSource, D as DirectiveFailure, b as DirectiveFailureWords, c as DirectiveRecordRef } from './route-D2Yz3El4.cjs';
4
+ export { d as ContentIrRenderSeams, e as DB_KIND_COMPONENT_KEY, f as DIRECTIVE_BLOCK_TYPE, g as DirectiveApplyResult, h as DirectiveApplyState, i as DirectiveAskRequest, j as DirectiveCopyProps, k as DirectiveHost, l as DirectiveHostProvider, m as DirectiveHostProviderProps, n as DirectiveOpenItemOptions, o as DirectiveRecordProps, p as DirectiveScope, q as DirectiveScopeProvider, r as DirectiveShell, G as GENERIC_STRUCTURED_COMPONENT_KEY, s as GenericFallbackReason, I as IR_PROVISIONAL_KEY, t as IR_ROUTE_KEY, u as IrRenderBlock, v as IrRoutableBlock, w as IrRouteMarker, x as KindRouteBinding, y as KindRouteOptions, P as PartialRenderOptions, z as ProvisionalKindRender, S as StructuredValueRenderProps, A as SupersededKindRender, B as applyIrKindRoute, E as createKindRouteBinding, F as envelopeFromPartialKind, H as isPartialReadyKind, J as isProvisionalBlock, L as kindServerDataFromStoredValue, M as markKindPartialUnsafe, N as readIrRouteMarker, O as resetPartialUnsafeKinds, Q as resetSourcelessDbRowReports, R as resolveAnnouncedKindLoading, T as resolveProvisionalKindRender, U as resolveSupersededKindRender, V as routeEnvOf, W as useDirectiveHost, X as useDirectiveScope } from './route-D2Yz3El4.cjs';
5
5
  import * as react from 'react';
6
6
  import react__default, { ReactNode, ComponentType } from 'react';
7
7
  export { ComponentResolver, ComponentResolverOptions } from './resolver.cjs';
@@ -105,7 +105,7 @@ declare function KindInstanceRender(props: KindInstanceRenderProps): react.JSX.E
105
105
  /**
106
106
  * The safety net + the "still arriving" affordance for a provisional kind
107
107
  * render (streaming partial kinds — see `route/partial-kind-route.ts` and
108
- * `common-docs/systems/content-ir-system/STREAMING_PARTIAL_KINDS.md`).
108
+ * `common-docs/systems/architecture/content-ir/STREAMING_PARTIAL_KINDS.md`).
109
109
  *
110
110
  * TWO JOBS
111
111
  * --------
@@ -377,6 +377,22 @@ interface DirectiveRenderProps {
377
377
  }
378
378
  declare function DirectiveRender({ conversationId, ...props }: DirectiveRenderProps): react.JSX.Element;
379
379
 
380
+ /**
381
+ * THE WORDS A FAILED APPLY SHOWS A PERSON.
382
+ *
383
+ * A card used to print the server's text as its sentence — e.g.
384
+ * "unknown / non-writable noun 'task'. Writable: [...]" (G5 review,
385
+ * 2026-10-02). A person needs WHAT failed and WHAT TO DO, in plain words; the
386
+ * technical text is for whoever debugs it, behind a Details toggle. The host
387
+ * may name a failure it recognises (`DirectiveHost.explainFailure`); otherwise
388
+ * these verb-aware defaults answer.
389
+ */
390
+
391
+ /** The card's own words for a failure the host did not name. */
392
+ declare function defaultFailureWords(failure: DirectiveFailure): DirectiveFailureWords;
393
+ /** The host's words when it names this failure, else the default. */
394
+ declare function failureWords(failure: DirectiveFailure, explain?: (failure: DirectiveFailure) => DirectiveFailureWords | null): DirectiveFailureWords;
395
+
380
396
  type RecordValuesStatus = "idle" | "loading" | "ready" | "unavailable";
381
397
  interface RecordValues {
382
398
  /** The record's fields now, or null until (or unless) they are read. */
@@ -649,4 +665,4 @@ declare class DbKindComponentErrorBoundary extends react.Component<DbKindCompone
649
665
  render(): react.ReactNode;
650
666
  }
651
667
 
652
- export { ApplyDirectiveButton, type ApplyDirectiveButtonProps, CHANGE_VALUE_MAX, type ChangeValue, type CompiledDbKindComponent, ComponentResolution, ComponentResolutionSource, ContentIrErrorReporter, ContentIrHost, ContentIrRenderProvider, type ContentIrRenderProviderProps, type DbKindActionResult, type DbKindCompileResult, type DbKindComponentCache, type DbKindComponentCachePorts, type DbKindComponentCompiler, DbKindComponentErrorBoundary, type DbKindComponentErrorBoundaryProps, type DbKindComponentIncident, type DbKindComponentIncidentSink, type DbKindComponentIncidentType, type DbKindComponentRenderProps, DelegatedOutput, type DelegatedOutputProps, DirectiveChangeList, DirectiveFallbackCard, type DirectiveFallbackCardProps, DirectiveProvisionalCard, type DirectiveProvisionalCardProps, DirectiveRecordRef, DirectiveRender, type DirectiveRenderProps, type DirectiveRenderer, type DirectiveRendererProps, GenericStructuredView, type GenericStructuredViewProps, type ItemChange, type ItemChangesOptions, type KindComponentUiOptions, KindDefinitionSource, KindInstanceRender, type KindInstanceRenderProps, KindRouteEnv, type KindVersionSources, NodeOutcomeView, type NodeOutcomeViewProps, ProvisionalKindBoundary, ProvisionalKindFrame, type RecordReader, type RecordValues, type RecordValuesStatus, type ResolveKindValue, type RunDbKindAction, RunResultView, type RunResultViewProps, SideEffectDirectiveCard, type SideEffectDirectiveCardProps, TARGETING_CLASSES, createDbKindComponentCache, describeChangeValue, fieldLabel, getDirectiveRenderer, isDbKindComponentBodyPending, isRecordValue, itemChanges, itemRecordId, kindIsRoutable, provisionalDirectiveSlug, recordFallbackName, registerDirectiveRenderer, resetDirectiveRenderers, useContentIrHost, useContentIrHostOrNull, useContentIrKindVersion, useKindRouteEnv, useRecordValues };
668
+ export { ApplyDirectiveButton, type ApplyDirectiveButtonProps, CHANGE_VALUE_MAX, type ChangeValue, type CompiledDbKindComponent, ComponentResolution, ComponentResolutionSource, ContentIrErrorReporter, ContentIrHost, ContentIrRenderProvider, type ContentIrRenderProviderProps, type DbKindActionResult, type DbKindCompileResult, type DbKindComponentCache, type DbKindComponentCachePorts, type DbKindComponentCompiler, DbKindComponentErrorBoundary, type DbKindComponentErrorBoundaryProps, type DbKindComponentIncident, type DbKindComponentIncidentSink, type DbKindComponentIncidentType, type DbKindComponentRenderProps, DelegatedOutput, type DelegatedOutputProps, DirectiveChangeList, DirectiveFailure, DirectiveFailureWords, DirectiveFallbackCard, type DirectiveFallbackCardProps, DirectiveProvisionalCard, type DirectiveProvisionalCardProps, DirectiveRecordRef, DirectiveRender, type DirectiveRenderProps, type DirectiveRenderer, type DirectiveRendererProps, GenericStructuredView, type GenericStructuredViewProps, type ItemChange, type ItemChangesOptions, type KindComponentUiOptions, KindDefinitionSource, KindInstanceRender, type KindInstanceRenderProps, KindRouteEnv, type KindVersionSources, NodeOutcomeView, type NodeOutcomeViewProps, ProvisionalKindBoundary, ProvisionalKindFrame, type RecordReader, type RecordValues, type RecordValuesStatus, type ResolveKindValue, type RunDbKindAction, RunResultView, type RunResultViewProps, SideEffectDirectiveCard, type SideEffectDirectiveCardProps, TARGETING_CLASSES, createDbKindComponentCache, defaultFailureWords, describeChangeValue, failureWords, fieldLabel, getDirectiveRenderer, isDbKindComponentBodyPending, isRecordValue, itemChanges, itemRecordId, kindIsRoutable, provisionalDirectiveSlug, recordFallbackName, registerDirectiveRenderer, resetDirectiveRenderers, useContentIrHost, useContentIrHostOrNull, useContentIrKindVersion, useKindRouteEnv, useRecordValues };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { C as ComponentResolutionSource, a as ComponentResolution, b as ContentIrErrorReporter } from './component-resolution.types-DLO2w-0n.js';
2
- export { c as ComponentRole, d as ContentIrErrorReport, J as JsonObject, K as KindComponentRow, S as SystemComponentEntry, e as consoleErrorReporter } from './component-resolution.types-DLO2w-0n.js';
3
- import { C as ContentIrHost, K as KindRouteEnv, a as KindDefinitionSource, D as DirectiveRecordRef } from './route-De9c5YgW.js';
4
- export { b as ContentIrRenderSeams, c as DB_KIND_COMPONENT_KEY, d as DIRECTIVE_BLOCK_TYPE, e as DirectiveApplyResult, f as DirectiveApplyState, g as DirectiveAskRequest, h as DirectiveCopyProps, i as DirectiveHost, j as DirectiveHostProvider, k as DirectiveHostProviderProps, l as DirectiveOpenItemOptions, m as DirectiveRecordProps, n as DirectiveScope, o as DirectiveScopeProvider, p as DirectiveShell, G as GENERIC_STRUCTURED_COMPONENT_KEY, q as GenericFallbackReason, I as IR_PROVISIONAL_KEY, r as IR_ROUTE_KEY, s as IrRenderBlock, t as IrRoutableBlock, u as IrRouteMarker, v as KindRouteBinding, w as KindRouteOptions, P as PartialRenderOptions, x as ProvisionalKindRender, S as StructuredValueRenderProps, y as SupersededKindRender, z as applyIrKindRoute, A as createKindRouteBinding, B as envelopeFromPartialKind, E as isPartialReadyKind, F as isProvisionalBlock, H as kindServerDataFromStoredValue, J as markKindPartialUnsafe, L as readIrRouteMarker, M as resetPartialUnsafeKinds, N as resetSourcelessDbRowReports, O as resolveAnnouncedKindLoading, Q as resolveProvisionalKindRender, R as resolveSupersededKindRender, T as routeEnvOf, U as useDirectiveHost, V as useDirectiveScope } from './route-De9c5YgW.js';
1
+ import { C as ComponentResolutionSource, a as ComponentResolution, b as ContentIrErrorReporter } from './component-resolution.types-DY4pGymy.js';
2
+ export { c as ComponentRole, d as ContentIrErrorReport, J as JsonObject, K as KindComponentRow, S as SystemComponentEntry, e as consoleErrorReporter } from './component-resolution.types-DY4pGymy.js';
3
+ import { C as ContentIrHost, K as KindRouteEnv, a as KindDefinitionSource, D as DirectiveFailure, b as DirectiveFailureWords, c as DirectiveRecordRef } from './route-D0f5H63n.js';
4
+ export { d as ContentIrRenderSeams, e as DB_KIND_COMPONENT_KEY, f as DIRECTIVE_BLOCK_TYPE, g as DirectiveApplyResult, h as DirectiveApplyState, i as DirectiveAskRequest, j as DirectiveCopyProps, k as DirectiveHost, l as DirectiveHostProvider, m as DirectiveHostProviderProps, n as DirectiveOpenItemOptions, o as DirectiveRecordProps, p as DirectiveScope, q as DirectiveScopeProvider, r as DirectiveShell, G as GENERIC_STRUCTURED_COMPONENT_KEY, s as GenericFallbackReason, I as IR_PROVISIONAL_KEY, t as IR_ROUTE_KEY, u as IrRenderBlock, v as IrRoutableBlock, w as IrRouteMarker, x as KindRouteBinding, y as KindRouteOptions, P as PartialRenderOptions, z as ProvisionalKindRender, S as StructuredValueRenderProps, A as SupersededKindRender, B as applyIrKindRoute, E as createKindRouteBinding, F as envelopeFromPartialKind, H as isPartialReadyKind, J as isProvisionalBlock, L as kindServerDataFromStoredValue, M as markKindPartialUnsafe, N as readIrRouteMarker, O as resetPartialUnsafeKinds, Q as resetSourcelessDbRowReports, R as resolveAnnouncedKindLoading, T as resolveProvisionalKindRender, U as resolveSupersededKindRender, V as routeEnvOf, W as useDirectiveHost, X as useDirectiveScope } from './route-D0f5H63n.js';
5
5
  import * as react from 'react';
6
6
  import react__default, { ReactNode, ComponentType } from 'react';
7
7
  export { ComponentResolver, ComponentResolverOptions } from './resolver.js';
@@ -105,7 +105,7 @@ declare function KindInstanceRender(props: KindInstanceRenderProps): react.JSX.E
105
105
  /**
106
106
  * The safety net + the "still arriving" affordance for a provisional kind
107
107
  * render (streaming partial kinds — see `route/partial-kind-route.ts` and
108
- * `common-docs/systems/content-ir-system/STREAMING_PARTIAL_KINDS.md`).
108
+ * `common-docs/systems/architecture/content-ir/STREAMING_PARTIAL_KINDS.md`).
109
109
  *
110
110
  * TWO JOBS
111
111
  * --------
@@ -377,6 +377,22 @@ interface DirectiveRenderProps {
377
377
  }
378
378
  declare function DirectiveRender({ conversationId, ...props }: DirectiveRenderProps): react.JSX.Element;
379
379
 
380
+ /**
381
+ * THE WORDS A FAILED APPLY SHOWS A PERSON.
382
+ *
383
+ * A card used to print the server's text as its sentence — e.g.
384
+ * "unknown / non-writable noun 'task'. Writable: [...]" (G5 review,
385
+ * 2026-10-02). A person needs WHAT failed and WHAT TO DO, in plain words; the
386
+ * technical text is for whoever debugs it, behind a Details toggle. The host
387
+ * may name a failure it recognises (`DirectiveHost.explainFailure`); otherwise
388
+ * these verb-aware defaults answer.
389
+ */
390
+
391
+ /** The card's own words for a failure the host did not name. */
392
+ declare function defaultFailureWords(failure: DirectiveFailure): DirectiveFailureWords;
393
+ /** The host's words when it names this failure, else the default. */
394
+ declare function failureWords(failure: DirectiveFailure, explain?: (failure: DirectiveFailure) => DirectiveFailureWords | null): DirectiveFailureWords;
395
+
380
396
  type RecordValuesStatus = "idle" | "loading" | "ready" | "unavailable";
381
397
  interface RecordValues {
382
398
  /** The record's fields now, or null until (or unless) they are read. */
@@ -649,4 +665,4 @@ declare class DbKindComponentErrorBoundary extends react.Component<DbKindCompone
649
665
  render(): react.ReactNode;
650
666
  }
651
667
 
652
- export { ApplyDirectiveButton, type ApplyDirectiveButtonProps, CHANGE_VALUE_MAX, type ChangeValue, type CompiledDbKindComponent, ComponentResolution, ComponentResolutionSource, ContentIrErrorReporter, ContentIrHost, ContentIrRenderProvider, type ContentIrRenderProviderProps, type DbKindActionResult, type DbKindCompileResult, type DbKindComponentCache, type DbKindComponentCachePorts, type DbKindComponentCompiler, DbKindComponentErrorBoundary, type DbKindComponentErrorBoundaryProps, type DbKindComponentIncident, type DbKindComponentIncidentSink, type DbKindComponentIncidentType, type DbKindComponentRenderProps, DelegatedOutput, type DelegatedOutputProps, DirectiveChangeList, DirectiveFallbackCard, type DirectiveFallbackCardProps, DirectiveProvisionalCard, type DirectiveProvisionalCardProps, DirectiveRecordRef, DirectiveRender, type DirectiveRenderProps, type DirectiveRenderer, type DirectiveRendererProps, GenericStructuredView, type GenericStructuredViewProps, type ItemChange, type ItemChangesOptions, type KindComponentUiOptions, KindDefinitionSource, KindInstanceRender, type KindInstanceRenderProps, KindRouteEnv, type KindVersionSources, NodeOutcomeView, type NodeOutcomeViewProps, ProvisionalKindBoundary, ProvisionalKindFrame, type RecordReader, type RecordValues, type RecordValuesStatus, type ResolveKindValue, type RunDbKindAction, RunResultView, type RunResultViewProps, SideEffectDirectiveCard, type SideEffectDirectiveCardProps, TARGETING_CLASSES, createDbKindComponentCache, describeChangeValue, fieldLabel, getDirectiveRenderer, isDbKindComponentBodyPending, isRecordValue, itemChanges, itemRecordId, kindIsRoutable, provisionalDirectiveSlug, recordFallbackName, registerDirectiveRenderer, resetDirectiveRenderers, useContentIrHost, useContentIrHostOrNull, useContentIrKindVersion, useKindRouteEnv, useRecordValues };
668
+ export { ApplyDirectiveButton, type ApplyDirectiveButtonProps, CHANGE_VALUE_MAX, type ChangeValue, type CompiledDbKindComponent, ComponentResolution, ComponentResolutionSource, ContentIrErrorReporter, ContentIrHost, ContentIrRenderProvider, type ContentIrRenderProviderProps, type DbKindActionResult, type DbKindCompileResult, type DbKindComponentCache, type DbKindComponentCachePorts, type DbKindComponentCompiler, DbKindComponentErrorBoundary, type DbKindComponentErrorBoundaryProps, type DbKindComponentIncident, type DbKindComponentIncidentSink, type DbKindComponentIncidentType, type DbKindComponentRenderProps, DelegatedOutput, type DelegatedOutputProps, DirectiveChangeList, DirectiveFailure, DirectiveFailureWords, DirectiveFallbackCard, type DirectiveFallbackCardProps, DirectiveProvisionalCard, type DirectiveProvisionalCardProps, DirectiveRecordRef, DirectiveRender, type DirectiveRenderProps, type DirectiveRenderer, type DirectiveRendererProps, GenericStructuredView, type GenericStructuredViewProps, type ItemChange, type ItemChangesOptions, type KindComponentUiOptions, KindDefinitionSource, KindInstanceRender, type KindInstanceRenderProps, KindRouteEnv, type KindVersionSources, NodeOutcomeView, type NodeOutcomeViewProps, ProvisionalKindBoundary, ProvisionalKindFrame, type RecordReader, type RecordValues, type RecordValuesStatus, type ResolveKindValue, type RunDbKindAction, RunResultView, type RunResultViewProps, SideEffectDirectiveCard, type SideEffectDirectiveCardProps, TARGETING_CLASSES, createDbKindComponentCache, defaultFailureWords, describeChangeValue, failureWords, fieldLabel, getDirectiveRenderer, isDbKindComponentBodyPending, isRecordValue, itemChanges, itemRecordId, kindIsRoutable, provisionalDirectiveSlug, recordFallbackName, registerDirectiveRenderer, resetDirectiveRenderers, useContentIrHost, useContentIrHostOrNull, useContentIrKindVersion, useKindRouteEnv, useRecordValues };
package/dist/index.js CHANGED
@@ -832,6 +832,30 @@ function itemChanges(item, current, options = {}) {
832
832
  return out;
833
833
  }
834
834
 
835
+ // directives/failure-words.ts
836
+ var PAST = {
837
+ create: "created",
838
+ update: "updated",
839
+ delete: "deleted"
840
+ };
841
+ function defaultFailureWords(failure) {
842
+ const verbed = PAST[failure.directiveClass] ?? "applied";
843
+ const noun = failure.nounLabel.trim().toLowerCase() || "item";
844
+ if (failure.failed && failure.total && failure.total > 1) {
845
+ return {
846
+ what: `${failure.failed} of ${failure.total} weren't ${verbed}.`,
847
+ next: "Retry to try those again."
848
+ };
849
+ }
850
+ return {
851
+ what: `The ${noun} wasn't ${verbed}.`,
852
+ next: "Try again in a moment."
853
+ };
854
+ }
855
+ function failureWords(failure, explain) {
856
+ return explain?.(failure) ?? defaultFailureWords(failure);
857
+ }
858
+
835
859
  // directives/icons.tsx
836
860
  import { jsx as jsx3, jsxs } from "react/jsx-runtime";
837
861
  function Svg({ children, ...props }) {
@@ -1089,10 +1113,23 @@ function ApplyDirectiveButton({
1089
1113
  children: [
1090
1114
  /* @__PURE__ */ jsxs2("span", { className: "inline-flex min-w-0 items-start gap-1", children: [
1091
1115
  bad ? /* @__PURE__ */ jsx4(AlertIcon, { className: "mt-px h-3.5 w-3.5 shrink-0" }) : /* @__PURE__ */ jsx4(CheckCircleIcon, { className: "mt-px h-3.5 w-3.5 shrink-0" }),
1092
- /* @__PURE__ */ jsxs2("span", { className: "min-w-0", children: [
1093
- state.message ?? `Applied ${state.applied}`,
1094
- bad && !state.message ? ` \xB7 ${state.failed} failed` : ""
1095
- ] })
1116
+ bad ? /* @__PURE__ */ jsx4(
1117
+ FailureNotice,
1118
+ {
1119
+ words: failureWords(
1120
+ {
1121
+ raw: state.message ?? `${state.failed} failed`,
1122
+ directiveClass: directive.directiveClass,
1123
+ noun: directive.noun,
1124
+ nounLabel: nounText,
1125
+ failed: state.failed,
1126
+ total: state.applied + state.failed
1127
+ },
1128
+ host.explainFailure
1129
+ ),
1130
+ raw: state.message
1131
+ }
1132
+ ) : /* @__PURE__ */ jsx4("span", { className: "min-w-0", children: state.message ?? `Applied ${state.applied}` })
1096
1133
  ] }),
1097
1134
  state.copies > 1 ? /* @__PURE__ */ jsx4(
1098
1135
  "span",
@@ -1169,10 +1206,64 @@ function ApplyDirectiveButton({
1169
1206
  ]
1170
1207
  }
1171
1208
  ),
1172
- state.status === "error" ? /* @__PURE__ */ jsxs2("span", { className: "inline-flex max-w-sm items-start gap-1 text-xs text-destructive", children: [
1173
- /* @__PURE__ */ jsx4(AlertIcon, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }),
1174
- /* @__PURE__ */ jsx4("span", { children: state.message })
1175
- ] }) : null
1209
+ state.status === "error" ? /* @__PURE__ */ jsxs2(
1210
+ "span",
1211
+ {
1212
+ className: "inline-flex max-w-sm items-start gap-1 text-xs text-destructive",
1213
+ "data-apply-state": "error",
1214
+ children: [
1215
+ /* @__PURE__ */ jsx4(AlertIcon, { className: "mt-0.5 h-3.5 w-3.5 shrink-0" }),
1216
+ /* @__PURE__ */ jsx4(
1217
+ FailureNotice,
1218
+ {
1219
+ words: failureWords(
1220
+ {
1221
+ raw: state.message,
1222
+ directiveClass: directive.directiveClass,
1223
+ noun: directive.noun,
1224
+ nounLabel: nounText
1225
+ },
1226
+ host.explainFailure
1227
+ ),
1228
+ raw: state.message
1229
+ }
1230
+ )
1231
+ ]
1232
+ }
1233
+ ) : null
1234
+ ] });
1235
+ }
1236
+ function FailureNotice({
1237
+ words,
1238
+ raw
1239
+ }) {
1240
+ const [open, setOpen] = useState(false);
1241
+ const detail = raw?.trim() ?? "";
1242
+ return /* @__PURE__ */ jsxs2("span", { className: "flex min-w-0 flex-col gap-0.5", "data-apply-failure": true, children: [
1243
+ /* @__PURE__ */ jsxs2("span", { className: "min-w-0", children: [
1244
+ words.what,
1245
+ " ",
1246
+ words.next,
1247
+ detail ? /* @__PURE__ */ jsx4(
1248
+ "button",
1249
+ {
1250
+ type: "button",
1251
+ onClick: () => setOpen((v) => !v),
1252
+ "aria-expanded": open,
1253
+ className: "ml-1 underline underline-offset-2 hover:no-underline",
1254
+ "data-apply-failure-details-toggle": true,
1255
+ children: open ? "Hide details" : "Details"
1256
+ }
1257
+ ) : null
1258
+ ] }),
1259
+ open && detail ? /* @__PURE__ */ jsx4(
1260
+ "span",
1261
+ {
1262
+ className: "block max-w-sm select-text break-words font-mono text-[11px] text-muted-foreground",
1263
+ "data-apply-failure-details": true,
1264
+ children: detail
1265
+ }
1266
+ ) : null
1176
1267
  ] });
1177
1268
  }
1178
1269
 
@@ -1963,8 +2054,10 @@ export {
1963
2054
  consoleErrorReporter,
1964
2055
  createDbKindComponentCache,
1965
2056
  createKindRouteBinding,
2057
+ defaultFailureWords,
1966
2058
  describeChangeValue,
1967
2059
  envelopeFromPartialKind,
2060
+ failureWords,
1968
2061
  fieldLabel,
1969
2062
  getDirectiveRenderer,
1970
2063
  isDbKindComponentBodyPending,