@cosmicdrift/kumiko-framework 0.406.0 → 0.410.0

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 (212) hide show
  1. package/AGENTS.md +4 -2
  2. package/agents/api/framework-db.md +1 -0
  3. package/agents/api/framework-engine.md +17 -2
  4. package/agents/api/framework-ui-types.md +15 -0
  5. package/agents/api/renderer-web.md +156 -2
  6. package/agents/api/types.md +113 -71
  7. package/agents/api.md +4 -4
  8. package/agents/boot-rules.md +744 -0
  9. package/agents/examples/anonymous-access.md +23 -1
  10. package/agents/examples/contact.md +173 -0
  11. package/agents/examples/delivery-notifications.md +34 -1
  12. package/agents/examples/record-detail-layout.md +13 -2
  13. package/agents/examples/search.md +65 -3
  14. package/agents/examples/secrets-demo.md +96 -2
  15. package/agents/examples/tenant-inactivity.md +138 -0
  16. package/agents/examples.md +2 -0
  17. package/agents/features-index.md +4 -0
  18. package/agents/features.md +25 -1
  19. package/agents/widgets.md +12 -1
  20. package/dist/api/export/export-rows.js +1 -0
  21. package/dist/compliance/index.d.ts +1 -1
  22. package/dist/db/event-store-executor-read-where.js +15 -5
  23. package/dist/db/index.d.ts +1 -1
  24. package/dist/db/index.js +1 -1
  25. package/dist/db/migrate-generator.js +3 -1
  26. package/dist/db/queries/event-consumer.js +11 -7
  27. package/dist/db/queries/event-store.d.ts +2 -1
  28. package/dist/db/queries/event-store.js +25 -6
  29. package/dist/db/queries/rls-boot-catalog.js +3 -1
  30. package/dist/db/queries/session-advisory-lock.d.ts +7 -0
  31. package/dist/db/queries/session-advisory-lock.js +23 -0
  32. package/dist/db/query.js +7 -10
  33. package/dist/db/row-level-security-connection.js +4 -2
  34. package/dist/engine/access.js +5 -1
  35. package/dist/engine/active-membership.js +1 -0
  36. package/dist/engine/boot-validator/access-declarations.js +76 -33
  37. package/dist/engine/boot-validator/action-wiring.js +8 -6
  38. package/dist/engine/boot-validator/agent-effect-rules.d.ts +12 -0
  39. package/dist/engine/boot-validator/agent-effect-rules.js +12 -0
  40. package/dist/engine/boot-validator/agent-effect.d.ts +2 -0
  41. package/dist/engine/boot-validator/agent-effect.js +20 -0
  42. package/dist/engine/boot-validator/boot-context.js +5 -1
  43. package/dist/engine/boot-validator/boot-environment-rules.d.ts +12 -0
  44. package/dist/engine/boot-validator/boot-environment-rules.js +12 -0
  45. package/dist/engine/boot-validator/boot-phases-app.js +5 -1
  46. package/dist/engine/boot-validator/boot-phases.js +3 -1
  47. package/dist/engine/boot-validator/boot-rules.d.ts +2624 -0
  48. package/dist/engine/boot-validator/boot-rules.js +58 -0
  49. package/dist/engine/boot-validator/bundled-lists-table.js +23 -9
  50. package/dist/engine/boot-validator/config-deps.js +71 -23
  51. package/dist/engine/boot-validator/config-edit-action-rules.d.ts +17 -0
  52. package/dist/engine/boot-validator/config-edit-action-rules.js +17 -0
  53. package/dist/engine/boot-validator/config-key-rules.d.ts +117 -0
  54. package/dist/engine/boot-validator/config-key-rules.js +117 -0
  55. package/dist/engine/boot-validator/custom-screen-write-qns.js +6 -2
  56. package/dist/engine/boot-validator/derived-sql-fields-rules.d.ts +77 -0
  57. package/dist/engine/boot-validator/derived-sql-fields-rules.js +77 -0
  58. package/dist/engine/boot-validator/derived-sql-fields.js +53 -17
  59. package/dist/engine/boot-validator/detail-screens.js +10 -4
  60. package/dist/engine/boot-validator/entity-declaration-rules.d.ts +92 -0
  61. package/dist/engine/boot-validator/entity-declaration-rules.js +92 -0
  62. package/dist/engine/boot-validator/entity-handler-access-rules.d.ts +102 -0
  63. package/dist/engine/boot-validator/entity-handler-access-rules.js +102 -0
  64. package/dist/engine/boot-validator/entity-handler.d.ts +0 -7
  65. package/dist/engine/boot-validator/entity-handler.js +259 -355
  66. package/dist/engine/boot-validator/entity-image-variants.d.ts +2 -0
  67. package/dist/engine/boot-validator/entity-image-variants.js +91 -0
  68. package/dist/engine/boot-validator/entity-list-aggregate-options.js +8 -2
  69. package/dist/engine/boot-validator/entity-reference-embedded-rules.d.ts +117 -0
  70. package/dist/engine/boot-validator/entity-reference-embedded-rules.js +117 -0
  71. package/dist/engine/boot-validator/entity-select-image-rules.d.ts +122 -0
  72. package/dist/engine/boot-validator/entity-select-image-rules.js +122 -0
  73. package/dist/engine/boot-validator/entity-select.d.ts +8 -0
  74. package/dist/engine/boot-validator/entity-select.js +197 -0
  75. package/dist/engine/boot-validator/entity-structure-rules.d.ts +107 -0
  76. package/dist/engine/boot-validator/entity-structure-rules.js +107 -0
  77. package/dist/engine/boot-validator/field-conditions-rules.d.ts +92 -0
  78. package/dist/engine/boot-validator/field-conditions-rules.js +92 -0
  79. package/dist/engine/boot-validator/field-conditions.js +67 -22
  80. package/dist/engine/boot-validator/form-derivations-rules.d.ts +77 -0
  81. package/dist/engine/boot-validator/form-derivations-rules.js +77 -0
  82. package/dist/engine/boot-validator/form-derivations.js +52 -18
  83. package/dist/engine/boot-validator/global-tenancy.js +13 -7
  84. package/dist/engine/boot-validator/handler-declaration-rules.d.ts +77 -0
  85. package/dist/engine/boot-validator/handler-declaration-rules.js +77 -0
  86. package/dist/engine/boot-validator/handler-field-references-rules.d.ts +22 -0
  87. package/dist/engine/boot-validator/handler-field-references-rules.js +22 -0
  88. package/dist/engine/boot-validator/handler-field-references.js +14 -6
  89. package/dist/engine/boot-validator/list-bulk-actions-rules.d.ts +42 -0
  90. package/dist/engine/boot-validator/list-bulk-actions-rules.js +42 -0
  91. package/dist/engine/boot-validator/list-bulk-actions.js +29 -11
  92. package/dist/engine/boot-validator/list-column-layout.js +22 -10
  93. package/dist/engine/boot-validator/list-query-rules.d.ts +107 -0
  94. package/dist/engine/boot-validator/list-query-rules.js +107 -0
  95. package/dist/engine/boot-validator/list-table-aggregate-options.js +43 -15
  96. package/dist/engine/boot-validator/list-table-aggregate-query.js +7 -3
  97. package/dist/engine/boot-validator/list-table-aggregate-rules.d.ts +82 -0
  98. package/dist/engine/boot-validator/list-table-aggregate-rules.js +82 -0
  99. package/dist/engine/boot-validator/list-table-export-options.js +19 -7
  100. package/dist/engine/boot-validator/list-table-options.js +33 -13
  101. package/dist/engine/boot-validator/list-table-reject-unknown-keys.js +6 -2
  102. package/dist/engine/boot-validator/list-table-rules.d.ts +132 -0
  103. package/dist/engine/boot-validator/list-table-rules.js +132 -0
  104. package/dist/engine/boot-validator/nav-rules.d.ts +42 -0
  105. package/dist/engine/boot-validator/nav-rules.js +42 -0
  106. package/dist/engine/boot-validator/nav.js +33 -17
  107. package/dist/engine/boot-validator/ownership-rules.d.ts +27 -0
  108. package/dist/engine/boot-validator/ownership-rules.js +27 -0
  109. package/dist/engine/boot-validator/ownership.js +28 -12
  110. package/dist/engine/boot-validator/parent-ref.js +32 -20
  111. package/dist/engine/boot-validator/projection-list-screens.js +76 -35
  112. package/dist/engine/boot-validator/query-output-columns.js +9 -3
  113. package/dist/engine/boot-validator/query-refs.js +20 -10
  114. package/dist/engine/boot-validator/query-rules.d.ts +37 -0
  115. package/dist/engine/boot-validator/query-rules.js +37 -0
  116. package/dist/engine/boot-validator/read-gate.js +14 -10
  117. package/dist/engine/boot-validator/record-owned.js +5 -1
  118. package/dist/engine/boot-validator/related-list-table-rules.js +17 -7
  119. package/dist/engine/boot-validator/screens-actions-rules.d.ts +185 -0
  120. package/dist/engine/boot-validator/screens-actions-rules.js +185 -0
  121. package/dist/engine/boot-validator/screens-actions.js +169 -93
  122. package/dist/engine/boot-validator/screens-dashboard-chart-rules.d.ts +87 -0
  123. package/dist/engine/boot-validator/screens-dashboard-chart-rules.js +87 -0
  124. package/dist/engine/boot-validator/screens-dashboard-rules.d.ts +227 -0
  125. package/dist/engine/boot-validator/screens-dashboard-rules.js +227 -0
  126. package/dist/engine/boot-validator/screens-dashboard.js +222 -85
  127. package/dist/engine/boot-validator/screens-forms-layout-rules.d.ts +122 -0
  128. package/dist/engine/boot-validator/screens-forms-layout-rules.js +122 -0
  129. package/dist/engine/boot-validator/screens-forms-rules.d.ts +152 -0
  130. package/dist/engine/boot-validator/screens-forms-rules.js +152 -0
  131. package/dist/engine/boot-validator/screens-forms.js +240 -112
  132. package/dist/engine/boot-validator/screens-kind-config-edit.js +72 -16
  133. package/dist/engine/boot-validator/screens-kind-entity-edit.js +15 -7
  134. package/dist/engine/boot-validator/screens-kind-entity-list.js +57 -32
  135. package/dist/engine/boot-validator/screens-kind-projection-detail-rules.d.ts +92 -0
  136. package/dist/engine/boot-validator/screens-kind-projection-detail-rules.js +92 -0
  137. package/dist/engine/boot-validator/screens-kind-projection-detail.js +85 -47
  138. package/dist/engine/boot-validator/screens-kind-rules.d.ts +137 -0
  139. package/dist/engine/boot-validator/screens-kind-rules.js +137 -0
  140. package/dist/engine/boot-validator/screens-kind-secret-mint.js +18 -8
  141. package/dist/engine/boot-validator/screens-kind-shared.js +40 -22
  142. package/dist/engine/boot-validator/screens-lists-rules.d.ts +82 -0
  143. package/dist/engine/boot-validator/screens-lists-rules.js +82 -0
  144. package/dist/engine/boot-validator/screens-lists.js +90 -45
  145. package/dist/engine/boot-validator/screens-rules.d.ts +57 -0
  146. package/dist/engine/boot-validator/screens-rules.js +57 -0
  147. package/dist/engine/boot-validator/screens.js +17 -12
  148. package/dist/engine/boot-validator/transaction-phases.js +12 -4
  149. package/dist/engine/boot-validator/transfer-graph.js +17 -11
  150. package/dist/engine/boot-validator/url-prefill-fields.js +9 -5
  151. package/dist/engine/boot-validator/workspaces.js +11 -5
  152. package/dist/engine/boot-validator/zod-shape.js +6 -2
  153. package/dist/engine/entity-handlers.d.ts +1 -0
  154. package/dist/engine/entity-handlers.js +3 -0
  155. package/dist/engine/entity-list-runtime-options.js +23 -29
  156. package/dist/engine/extensions/tenant-data.d.ts +3 -0
  157. package/dist/engine/factories.d.ts +1 -1
  158. package/dist/engine/factories.js +4 -3
  159. package/dist/engine/index.d.ts +4 -2
  160. package/dist/engine/index.js +2 -0
  161. package/dist/engine/project-app-schema-for-roles.js +29 -14
  162. package/dist/engine/registry-facade.js +7 -8
  163. package/dist/engine/registry-validate.js +5 -1
  164. package/dist/engine/soft-delete-cleanup.d.ts +1 -0
  165. package/dist/engine/soft-delete-cleanup.js +5 -0
  166. package/dist/engine/steps/describe-workflow-step-error.js +1 -0
  167. package/dist/es-ops/operations-schema.d.ts +1 -1
  168. package/dist/event-store/ensure-dead-letter-table.d.ts +2 -0
  169. package/dist/event-store/ensure-dead-letter-table.js +10 -0
  170. package/dist/event-store/rebuild-dead-letter.js +2 -8
  171. package/dist/event-store/upcaster-dead-letter.js +2 -8
  172. package/dist/files/copy-pending-file-refs-to-tenant.d.ts +28 -0
  173. package/dist/files/copy-pending-file-refs-to-tenant.js +87 -0
  174. package/dist/files/file-routes.d.ts +1 -1
  175. package/dist/files/file-routes.js +21 -6
  176. package/dist/files/index.d.ts +2 -0
  177. package/dist/files/index.js +1 -0
  178. package/dist/i18n/required-surface-keys.js +1 -0
  179. package/dist/jobs/job-runner-helpers.js +1 -0
  180. package/dist/jobs/job-runner.js +7 -12
  181. package/dist/logging/utils.js +30 -60
  182. package/dist/observability/metrics-handle.js +10 -21
  183. package/dist/pipeline/cascade-handler.js +7 -6
  184. package/dist/pipeline/dispatch-query.js +18 -5
  185. package/dist/pipeline/dispatch-shared.d.ts +1 -0
  186. package/dist/pipeline/dispatch-shared.js +3 -1
  187. package/dist/pipeline/dispatch-write.js +10 -12
  188. package/dist/pipeline/dispatcher.js +12 -14
  189. package/dist/pipeline/event-dispatcher-admin.js +9 -8
  190. package/dist/pipeline/event-dispatcher-delivery.d.ts +19 -1
  191. package/dist/pipeline/event-dispatcher-delivery.js +121 -29
  192. package/dist/pipeline/event-dispatcher.d.ts +5 -1
  193. package/dist/pipeline/event-dispatcher.js +28 -21
  194. package/dist/pipeline/handler-context-phase-denials.js +2 -0
  195. package/dist/pipeline/multi-stream-apply-context.js +12 -20
  196. package/dist/pipeline/system-hooks.d.ts +4 -1
  197. package/dist/pipeline/system-hooks.js +79 -6
  198. package/dist/pipeline/system-identity-switch.js +10 -7
  199. package/dist/search/build-search-snippet.d.ts +9 -0
  200. package/dist/search/build-search-snippet.js +40 -0
  201. package/dist/search/index.d.ts +1 -0
  202. package/dist/search/index.js +1 -0
  203. package/dist/search/meilisearch-adapter.d.ts +32 -0
  204. package/dist/search/meilisearch-adapter.js +153 -56
  205. package/dist/search/meilisearch-chunking.d.ts +21 -0
  206. package/dist/search/meilisearch-chunking.js +96 -0
  207. package/dist/search/reindex-entity.d.ts +1 -0
  208. package/dist/search/reindex-entity.js +97 -52
  209. package/dist/ui-types/index.d.ts +1 -1
  210. package/dist/upgrade-cli.js +3 -14
  211. package/package.json +3 -3
  212. package/src/changes.json +79 -0
@@ -617,6 +617,20 @@ type DeleteRowsWithoutReplayableStreamArgs = {
617
617
  type PostgresArrayElement = string | number | bigint | null;
618
618
  ```
619
619
 
620
+ ## packages/framework/src/db/queries/session-advisory-lock.ts
621
+
622
+ ```ts
623
+ type TryAdvisoryLockResult<T> =
624
+ | {
625
+ acquired: true;
626
+ value: T;
627
+ }
628
+ | {
629
+ acquired: false;
630
+ }
631
+ ;
632
+ ```
633
+
620
634
  ## packages/framework/src/db/query.ts
621
635
 
622
636
  ```ts
@@ -948,6 +962,7 @@ interface KumikoExtensionOptionsMap {
948
962
  ```ts
949
963
  interface TenantDataExtensionHooks {
950
964
  destroy: TenantDataDestroyHook;
965
+ phase?: TenantDataDestroyPhase;
951
966
  }
952
967
  ```
953
968
 
@@ -1397,6 +1412,9 @@ type Dispatcher = {
1397
1412
  ## packages/framework/src/pipeline/event-dispatcher.ts
1398
1413
 
1399
1414
  ```ts
1415
+ type BatchTurnControl = {
1416
+ holdForRetry: (eventIds: string[], reason: string) => void;
1417
+ };
1400
1418
  type DispatcherPassResult = {
1401
1419
  processed: number;
1402
1420
  failed: number;
@@ -1411,7 +1429,7 @@ type EventConsumer = {
1411
1429
  delivery?: "shared" | "per-instance";
1412
1430
  startFrom?: "beginning" | "now";
1413
1431
  };
1414
- type EventConsumerBatchHandler = (events: StoredEvent[], ctx: AppContext) => Promise<void>;
1432
+ type EventConsumerBatchHandler = (events: StoredEvent[], ctx: AppContext, turn: BatchTurnControl) => Promise<void>;
1415
1433
  type EventConsumerErrorPolicy = {
1416
1434
  skipApplyErrors?: boolean;
1417
1435
  maxAttempts?: number;
@@ -2370,6 +2388,10 @@ type FormSectionNavItem = { // One entry of a form's "on this page" navigation:
2370
2388
  id: string;
2371
2389
  title: string;
2372
2390
  };
2391
+ type InputEndAction = ({ icon: ReactNode; ariaLabel: string; label?: undefined; } | { label: string; icon?: undefined; ariaLabel?: undefined; }) & { // Button inside the right edge of a text input: an icon (e.g. a microphone) or, with `label`, a small primary text button that submits what was typed.
2392
+ onClick: () => void;
2393
+ pressed?: boolean; // Toggle state, e.g. a microphone that is currently recording.
2394
+ };
2373
2395
  type InputFillAction = { // Button beside a single-line text/number input that fills it with a suggestion.
2374
2396
  label: string;
2375
2397
  onPress: () => void;
@@ -2474,13 +2496,11 @@ type ShareButtonProps = ({ target: "whatsapp"; phone?: string; } | { target: "sy
2474
2496
  className?: string; // Layout extras, merged via cn().
2475
2497
  testId?: string;
2476
2498
  };
2477
- type StatusBadgeOptionTone = StatusTone | "accent"; // Tones a select option can request: the status tones plus the brand `accent`.
2478
2499
  type StatusBadgeProps = { // Status pill.
2479
2500
  value: string;
2480
2501
  tone?: StatusBadgeOptionTone;
2481
2502
  testId?: string;
2482
2503
  };
2483
- type StatusTone = "ok" | "warn" | "bad" | "critical" | "muted";
2484
2504
  type StepBarProps = { // Wizard step overview — numbered chips, one per step label, with the active step highlighted.
2485
2505
  steps: string[];
2486
2506
  currentIndex: number;
@@ -2510,9 +2530,10 @@ type StickyActionBarProps = { // Thumb-reach action row for custom screens: pinn
2510
2530
  testId?: string;
2511
2531
  };
2512
2532
  type TabsProps = { // Tab strip for a projectionDetail `layout.mode: "tabs"`.
2513
- items: { id: string; label: string; count?: number; }[];
2533
+ items: { id: string; label: string; count?: number; icon?: ReactNode; detail?: string; }[];
2514
2534
  activeId: string;
2515
2535
  onSelect: (id: string) => void;
2536
+ appearance?: "pill" | "plain" | "filter"; // "pill" (default) = count badge, 44px strip.
2516
2537
  testId?: string;
2517
2538
  };
2518
2539
  type TrailingInputAction = {
@@ -2528,6 +2549,13 @@ type WizardStepGroupProps = { // Wraps a single wizard step so it stays mounted
2528
2549
  };
2529
2550
  ```
2530
2551
 
2552
+ ## packages/renderer/src/status-tone.ts
2553
+
2554
+ ```ts
2555
+ type StatusBadgeOptionTone = StatusTone | "accent"; // Tones a select option can request: the status tones plus the brand `accent`.
2556
+ type StatusTone = "ok" | "warn" | "bad" | "critical" | "muted";
2557
+ ```
2558
+
2531
2559
  ## packages/renderer/src/web/app/client-plugin.tsx
2532
2560
 
2533
2561
  ```ts
@@ -2649,6 +2677,7 @@ interface AiTextFieldBaseProps {
2649
2677
  completionDebounceMs?: number; // Debounce for ghost-text requests, ms.
2650
2678
  actions?: AiTextAction[]; // Toolbar actions to expose.
2651
2679
  translateLanguages?: string[]; // Target languages the translate action offers.
2680
+ endAction?: AiTextEndAction; // Icon button inside the right edge of the control (e.g. a microphone).
2652
2681
  }
2653
2682
  ```
2654
2683
 
@@ -2884,6 +2913,17 @@ type RequestHelperOptions = {
2884
2913
  };
2885
2914
  ```
2886
2915
 
2916
+ ## packages/types/src/agent-hints.ts
2917
+
2918
+ ```ts
2919
+ type AgentExposure = {
2920
+ expose: boolean;
2921
+ risk: AgentRisk;
2922
+ effect?: AgentEffect;
2923
+ };
2924
+ type AgentScreenHints = Pick<AgentHandlerHints, "expose">; // Screens only read `expose`; `risk` ranks handler tool calls, so it is not offered here.
2925
+ ```
2926
+
2887
2927
  ## packages/types/src/aggregate-types.ts
2888
2928
 
2889
2929
  ```ts
@@ -3270,6 +3310,7 @@ type ListFilterOption = {
3270
3310
  type ListRuntimeOptions = {
3271
3311
  searchAdapter?: SearchAdapter;
3272
3312
  includeDeleted?: boolean;
3313
+ onlyDeleted?: boolean;
3273
3314
  referenceSearch?: {
3274
3315
  fields: ReadonlyArray<{ fieldName: string; targetEntityName: string; labelField: string; }>;
3275
3316
  resolveEntity: (entityName: string) => EntityDefinition | undefined;
@@ -3604,7 +3645,6 @@ type EntityIndexDef = { // Composite index on an entity.
3604
3645
  where?: unknown; // Optional SQL fragment for a partial index — `CREATE [UNIQUE] INDEX ...
3605
3646
  };
3606
3647
  type EntityLongTextFieldDef = LongTextFieldDef & ResolvedPiiStance;
3607
- type EntityPiiAbsentSubject = "tenant" | "self";
3608
3648
  type EntityTextFieldDef = TextFieldDef & ResolvedPiiStance;
3609
3649
  type FieldAccess = {
3610
3650
  read?: OwnershipMap | string[];
@@ -3630,7 +3670,6 @@ type FilesFieldDef = PiiAndFieldState & {
3630
3670
  display?: "list" | "dropzone"; // `"list"` (default) shows the picked files as a list with a file picker; `"dropzone"` shows a drag-and-drop zone with one status row per file, a remove action per file and the field's `maxCount`/`accept`/`maxSize` as hints.
3631
3671
  access?: FieldAccess;
3632
3672
  };
3633
- type Findability = "exact" | "fuzzy" | "none" | "secret";
3634
3673
  type FormFieldDefinition = Exclude<FieldDefinition, MoneyFieldDef> | (MoneyFieldDef & { currency: MoneyCurrencySource; }); // FieldDefinition as an entity-less inline form screen (actionForm, secretMint) may declare it: a `money` field there has no entity to borrow `defaultCurrency` from, so it must name its own currency source, or the form seeds a bare `0` that the handler's zod schema then rejects .
3635
3674
  type ImageFieldDef = PiiAndFieldState & {
3636
3675
  type: "image";
@@ -3677,11 +3716,11 @@ type LongTextFieldDef = PiiAndFieldState & { // Long-form text content — sourc
3677
3716
  encrypted?: boolean;
3678
3717
  sensitive?: boolean;
3679
3718
  readAsInstruction?: boolean; // A later run reads this field's value as an instruction — prompt, rule, template.
3719
+ searchable?: boolean; // Set by `find: "fuzzy"`: the value goes into the SearchAdapter document.
3680
3720
  default?: string;
3681
3721
  access?: FieldAccess;
3682
3722
  multiline?: boolean | { rows?: number; };
3683
3723
  };
3684
- type LongTextFindability = "none" | "secret";
3685
3724
  type MoneyCurrencySource = // Where a money field's currency comes from.
3686
3725
  | {
3687
3726
  kind: "tenant";
@@ -3716,12 +3755,6 @@ type MultiSelectFieldDef<TOptions extends string[] = string[]> = PiiAndFieldStat
3716
3755
  maxRows?: number; // Renderer metadata: how many grid rows stay visible before the `"checkboxes"` grid becomes scrollable.
3717
3756
  optionsAvailabilityQuery?: string; // Query returning `{ rows: { value, disabled?, hint?
3718
3757
  };
3719
- type NoPersonalAnnotation = {
3720
- personal?: never;
3721
- find?: never;
3722
- reason?: never;
3723
- anonymize?: never;
3724
- };
3725
3758
  type NumberFieldDef = PiiAndFieldState & { // Storage: `integer` flag decides the Postgres column type, not just Zod validation.
3726
3759
  type: "number";
3727
3760
  description?: string;
@@ -3746,59 +3779,6 @@ type OptionsQueryPayloadValue = // One `optionsQueryPayload` entry: a literal, o
3746
3779
  field: string;
3747
3780
  }
3748
3781
  ;
3749
- type PersonalAnnotations =
3750
- | {
3751
- personal: PersonalSubject;
3752
- find: Findability;
3753
- anonymize?: () => unknown | Promise<unknown>;
3754
- }
3755
- | {
3756
- personal: "ref";
3757
- }
3758
- | {
3759
- personal: false;
3760
- reason: string;
3761
- anonymize?: () => unknown | Promise<unknown>;
3762
- }
3763
- ;
3764
- type PersonalAnnotationsLongText =
3765
- | {
3766
- personal: PersonalSubject;
3767
- find: LongTextFindability;
3768
- anonymize?: () => unknown | Promise<unknown>;
3769
- }
3770
- | {
3771
- personal: "ref";
3772
- }
3773
- | {
3774
- personal: false;
3775
- reason: string;
3776
- anonymize?: () => unknown | Promise<unknown>;
3777
- }
3778
- ;
3779
- type PersonalAnnotationsNoFind =
3780
- | {
3781
- personal: PersonalSubject;
3782
- anonymize?: () => unknown | Promise<unknown>;
3783
- }
3784
- | {
3785
- personal: "ref";
3786
- }
3787
- | {
3788
- personal: false;
3789
- reason: string;
3790
- anonymize?: () => unknown | Promise<unknown>;
3791
- }
3792
- | NoPersonalAnnotation
3793
- ;
3794
- type PersonalSubject =
3795
- | "self"
3796
- | {
3797
- of: string;
3798
- whenAbsent?: EntityPiiAbsentSubject;
3799
- }
3800
- | "tenant"
3801
- ;
3802
3782
  type PiiAndFieldState = ResolvedPiiFlags & FieldStateConditions;
3803
3783
  type ReferenceFieldDef = PiiAndFieldState & {
3804
3784
  type: "reference";
@@ -4022,11 +4002,6 @@ type ActiveMembershipResult =
4022
4002
  reason: ActiveMembershipRejection;
4023
4003
  }
4024
4004
  ;
4025
- type AgentExposure = {
4026
- expose: boolean;
4027
- risk: AgentRisk;
4028
- };
4029
- type AgentScreenHints = Pick<AgentHandlerHints, "expose">; // Screens only read `expose`; `risk` ranks handler tool calls, so it is not offered here.
4030
4005
  type AggregateStreamHandle = {
4031
4006
  events: StoredEvent[];
4032
4007
  version: number;
@@ -4569,6 +4544,73 @@ type WhereRuleContext<TTable = unknown> = {
4569
4544
  };
4570
4545
  ```
4571
4546
 
4547
+ ## packages/types/src/personal-annotations.ts
4548
+
4549
+ ```ts
4550
+ type EntityPiiAbsentSubject = "tenant" | "self";
4551
+ type Findability = "exact" | "fuzzy" | "none" | "secret";
4552
+ type LongTextFindability = "none" | "fuzzy" | "secret";
4553
+ type NoPersonalAnnotation = {
4554
+ personal?: never;
4555
+ find?: never;
4556
+ reason?: never;
4557
+ anonymize?: never;
4558
+ };
4559
+ type PersonalAnnotations =
4560
+ | {
4561
+ personal: PersonalSubject;
4562
+ find: Findability;
4563
+ anonymize?: () => unknown | Promise<unknown>;
4564
+ }
4565
+ | {
4566
+ personal: "ref";
4567
+ }
4568
+ | {
4569
+ personal: false;
4570
+ reason: string;
4571
+ anonymize?: () => unknown | Promise<unknown>;
4572
+ }
4573
+ ;
4574
+ type PersonalAnnotationsLongText =
4575
+ | {
4576
+ personal: PersonalSubject;
4577
+ find: LongTextFindability;
4578
+ anonymize?: () => unknown | Promise<unknown>;
4579
+ }
4580
+ | {
4581
+ personal: "ref";
4582
+ }
4583
+ | {
4584
+ personal: false;
4585
+ reason: string;
4586
+ anonymize?: () => unknown | Promise<unknown>;
4587
+ }
4588
+ ;
4589
+ type PersonalAnnotationsNoFind =
4590
+ | {
4591
+ personal: PersonalSubject;
4592
+ anonymize?: () => unknown | Promise<unknown>;
4593
+ }
4594
+ | {
4595
+ personal: "ref";
4596
+ }
4597
+ | {
4598
+ personal: false;
4599
+ reason: string;
4600
+ anonymize?: () => unknown | Promise<unknown>;
4601
+ }
4602
+ | NoPersonalAnnotation
4603
+ ;
4604
+ type PersonalSubject =
4605
+ | "self"
4606
+ | {
4607
+ of: string;
4608
+ whenAbsent?: EntityPiiAbsentSubject;
4609
+ }
4610
+ | "tenant"
4611
+ ;
4612
+ ```
4613
+
4572
4614
  ## packages/types/src/projection.ts
4573
4615
 
4574
4616
  ```ts
package/agents/api.md CHANGED
@@ -8,13 +8,13 @@ Format: one line per function or constant, object and options types as property
8
8
 
9
9
  | Import path | File | Exports |
10
10
  | --- | --- | --- |
11
- | `@cosmicdrift/kumiko-framework/engine` | `api/framework-engine.md` | 420 |
11
+ | `@cosmicdrift/kumiko-framework/engine` | `api/framework-engine.md` | 426 |
12
12
  | `@cosmicdrift/kumiko-framework/errors` | `api/framework-errors.md` | 25 |
13
- | `@cosmicdrift/kumiko-framework/ui-types` | `api/framework-ui-types.md` | 154 |
14
- | `@cosmicdrift/kumiko-framework/db` | `api/framework-db.md` | 150 |
13
+ | `@cosmicdrift/kumiko-framework/ui-types` | `api/framework-ui-types.md` | 156 |
14
+ | `@cosmicdrift/kumiko-framework/db` | `api/framework-db.md` | 151 |
15
15
  | `@cosmicdrift/kumiko-framework/event-store` | `api/framework-event-store.md` | 38 |
16
16
  | `@cosmicdrift/kumiko-framework/seeding` | `api/framework-seeding.md` | 6 |
17
- | `@cosmicdrift/kumiko-renderer/web` | `api/renderer-web.md` | 298 |
17
+ | `@cosmicdrift/kumiko-renderer/web` | `api/renderer-web.md` | 325 |
18
18
  | `@cosmicdrift/kumiko-testing/stack` | `api/testing-stack.md` | 22 |
19
19
  | `@cosmicdrift/kumiko-testing/helpers` | `api/testing-helpers.md` | 71 |
20
20
  | `@cosmicdrift/kumiko-dev-server/testing` | `api/dev-server-testing.md` | 5 |