@cosmicdrift/kumiko-types 0.334.0 → 0.336.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.
@@ -47,6 +47,10 @@ export type QueryHandlerDefinition<TName extends string = string, TSchema extend
47
47
  * that want boot-time column checks declare `outputSchema` explicitly,
48
48
  * same as `schema` for the input side. */
49
49
  readonly outputSchema?: ZodType;
50
+ /** Entities whose changes this query reflects. Anonymous callers with
51
+ * access to this query receive /api/sse change signals (no field values)
52
+ * for these entities. Every name must be a registered entity. */
53
+ readonly liveEntities?: readonly string[];
50
54
  };
51
55
  export type StreamHandlerDefinition<TName extends string = string, TSchema extends ZodType = ZodType, TChunk = unknown, TMap extends object = KumikoEventTypeMap> = {
52
56
  readonly name: TName;
@@ -22,7 +22,10 @@ export type EntityWriteHandlerOptions = EntityHandlerOptions & {
22
22
  /** Fields this handler never writes. They leave the payload schema as
23
23
  * "must be absent": a payload that still carries one fails validation
24
24
  * instead of being stripped silently. create rejects a required field
25
- * without default here, since the row could never be created. */
25
+ * without default here, since the row could never be created. A readAsInstruction
26
+ * field excluded here but derived by a preSave hook is invisible to the
27
+ * define-time risk floor: declare `agent: { risk: "high" }` explicitly, or the
28
+ * executor gate rejects every call. */
26
29
  readonly excludeFields?: readonly string[];
27
30
  };
28
31
  export type EntityQueryHandlerOptions = EntityHandlerOptions;
package/dist/feature.d.ts CHANGED
@@ -225,6 +225,7 @@ export type FeatureRegistrar<TFeature extends string = string> = {
225
225
  access: AccessRule;
226
226
  rateLimit?: RateLimitDeclaration;
227
227
  outputSchema?: ZodType;
228
+ liveEntities?: readonly string[];
228
229
  description?: string;
229
230
  agent?: AgentHandlerHints;
230
231
  escapeHatch?: EscapeHatchDeclaration;
@@ -473,6 +474,7 @@ export type Registry = {
473
474
  isHandlerSystemScoped(qualifiedHandler: string): boolean;
474
475
  isJobSystemScoped(qualifiedJobName: string): boolean;
475
476
  getHandlerFeature(qualifiedHandler: string): string | undefined;
477
+ getJobFeature(qualifiedJobName: string): string | undefined;
476
478
  hasRateLimitedHandler(): boolean;
477
479
  getAllMetrics(): ReadonlyMap<string, FeatureMetricDef & {
478
480
  readonly featureName: string;
package/dist/fields.d.ts CHANGED
@@ -99,7 +99,9 @@ export type TextFieldDef = {
99
99
  * {rows} / flat results; an unbound custom query handler that returns
100
100
  * executor rows must call maskWriteOnlyFields itself (same scope limit as
101
101
  * access.read). Requires `sensitive` (via `find: "secret"`); forbidden with
102
- * default/searchable/sortable/filterable/lookupable and on screen/form fields. */
102
+ * default/searchable/sortable/filterable/lookupable and on inline form fields
103
+ * (actionForm/wizard). Allowed on configEdit text fields only over an
104
+ * encrypted-at-rest config key, where it is also set automatically. */
103
105
  readonly writeOnly?: boolean;
104
106
  /** A later run reads this field's value as an instruction — prompt, rule,
105
107
  * template. Every create/update whose payload writes it requires agent.risk
@@ -480,6 +480,10 @@ export type QueryHandlerDef = {
480
480
  * `header`/`metrics`, dashboard `valueField`/`subField`/etc.) rather
481
481
  * than requiring it retroactively. See fw#2493. */
482
482
  readonly outputSchema?: ZodType;
483
+ /** Entities whose changes this query reflects. Anonymous callers with
484
+ * access to this query receive /api/sse change signals (no field values)
485
+ * for these entities. Every name must be a registered entity. */
486
+ readonly liveEntities?: readonly string[];
483
487
  readonly escapeHatch?: EscapeHatchDeclaration;
484
488
  };
485
489
  export type StreamHandlerDef = {
package/dist/screen.d.ts CHANGED
@@ -115,12 +115,14 @@ export type ListColumnSpec = string | {
115
115
  readonly hideOnNarrow?: boolean;
116
116
  /** Dashboard list panels only. "bar": field holds a 0..1 fraction, drawn
117
117
  * as bar + percent. "badge": field holds a label, drawn as a pill whose
118
- * tone comes from `badgeToneField`. Other list renderers ignore it. */
118
+ * tone comes from `badgeToneField`. "datetime": field holds an ISO string or
119
+ * epoch ms, shown in the user's locale and time zone. Other list renderers
120
+ * ignore it. */
119
121
  readonly display?: ListColumnDisplay;
120
122
  /** Row field naming the badge tone; only with `display: "badge"`. */
121
123
  readonly badgeToneField?: string;
122
124
  };
123
- export type ListColumnDisplay = "bar" | "badge";
125
+ export type ListColumnDisplay = "bar" | "badge" | "datetime";
124
126
  export type ListBadgeTone = "positive" | "warn" | "negative" | "neutral";
125
127
  export type ListPaginationMode = "pages" | "infinite" | false;
126
128
  export type ListSortDir = "asc" | "desc";
@@ -194,6 +196,14 @@ export type RowActionWriteHandler = {
194
196
  readonly icon?: IconKey;
195
197
  /** Inline render form in the row-action column — see `RowActionDisplay`. */
196
198
  readonly display?: RowActionDisplay;
199
+ /** Where to go after the write succeeded instead of staying on the shown
200
+ * record. Same forms as entityEdit `redirect`. Honored on record actions
201
+ * (projectionDetail header/section actions, entityEdit header/section
202
+ * actions); a valid `returnTo` wins under the same rule as
203
+ * entityEdit.redirect. Not used by list row actions. Without it, an action
204
+ * deleting the shown record (`<feature>:write:<entity>:delete` with that
205
+ * record's id) leaves to `returnTo`/the list; any other action refetches. */
206
+ readonly redirect?: string | ActionFormRedirect;
197
207
  };
198
208
  export type RowActionNavigateBase = {
199
209
  readonly kind: "navigate";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-types",
3
- "version": "0.334.0",
3
+ "version": "0.336.0",
4
4
  "description": "Framework-Type-Definitions für Kumiko — FeatureDefinition, BootCheck-Types und die reinen Engine-Types. Erlaubt Downstream-Konsumenten, gegen die Type-Contracts zu bauen, ohne das ganze Framework-Package zu importieren. Enthaelt keine identitaets-sensitiven Runtime-Werte mehr (Error-Klassen leben seit #1629 in kumiko-framework, Brand-Symbole nutzen Symbol.for) und ist deshalb eine plain dependency, keine peerDependency.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
package/src/changes.json CHANGED
@@ -1,4 +1,18 @@
1
1
  [
2
+ {
3
+ "version": "0.336.0",
4
+ "type": "improvement",
5
+ "title": "Query handlers can declare liveEntities",
6
+ "detail": "`QueryHandlerDefinition` and the inline `queryHandler` options accept `liveEntities`, the entities whose changes the query reflects. Anonymous callers with access to the query receive /api/sse change signals for them.",
7
+ "migration": "No code change needed."
8
+ },
9
+ {
10
+ "version": "0.335.0",
11
+ "type": "improvement",
12
+ "title": "RowActionWriteHandler gets an optional redirect for record actions",
13
+ "detail": "`redirect` takes the same forms as entityEdit `redirect` and is honored on projectionDetail and entityEdit header and section actions, not on list row actions.",
14
+ "migration": "No code change needed."
15
+ },
2
16
  {
3
17
  "version": "0.328.1",
4
18
  "type": "improvement",