@cosmicdrift/kumiko-types 0.241.0 → 0.242.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-types",
3
- "version": "0.241.0",
3
+ "version": "0.242.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>",
@@ -12,3 +12,11 @@ export function resolveAgentExposure(
12
12
  risk: def.agent?.risk ?? (kind === "query" ? "low" : "mid"),
13
13
  };
14
14
  }
15
+
16
+ /** Screens are the inverse of handlers: the manifest lists every role-visible
17
+ * screen regardless of `description`, so only an explicit opt-out hides one.
18
+ * Reusing `resolveAgentExposure`'s fail-closed default here would silently
19
+ * drop every screen without a description from the agent's view. */
20
+ export function isAgentVisibleScreen(screen: { readonly agent?: AgentHandlerHints }): boolean {
21
+ return screen.agent?.expose !== false;
22
+ }
package/src/screen.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { FieldIconKey } from "./field-icon";
2
2
  import type { FieldDefinition } from "./fields";
3
- import type { AccessRule } from "./handlers";
3
+ import type { AccessRule, AgentHandlerHints } from "./handlers";
4
4
  import type { IconKey, NavIconKey } from "./nav-icon";
5
5
 
6
6
  export type { FieldIconKey } from "./field-icon";
@@ -340,6 +340,7 @@ export type EntityListScreenDefinition = {
340
340
  readonly nav?: ScreenNavSugar;
341
341
  readonly detailFor?: string;
342
342
  readonly description?: string;
343
+ readonly agent?: AgentHandlerHints;
343
344
  readonly entity: string;
344
345
  readonly columns: readonly ListColumnSpec[];
345
346
  // Row renderer (Desktop) — when omitted, renderer draws the default table
@@ -419,6 +420,7 @@ export type ProjectionListScreenDefinition = {
419
420
  readonly nav?: ScreenNavSugar;
420
421
  readonly detailFor?: string;
421
422
  readonly description?: string;
423
+ readonly agent?: AgentHandlerHints;
422
424
  readonly query: string;
423
425
  readonly columns: readonly ListColumnSpec[];
424
426
  readonly rowRenderer?: PlatformComponent;
@@ -480,6 +482,7 @@ export type ProjectionDetailScreenDefinition = {
480
482
  readonly nav?: ScreenNavSugar;
481
483
  readonly detailFor?: string;
482
484
  readonly description?: string;
485
+ readonly agent?: AgentHandlerHints;
483
486
  readonly query: string;
484
487
  /** Query-payload key for the row-id. Default "id". */
485
488
  readonly idParam?: string;
@@ -665,6 +668,7 @@ export type DashboardScreenDefinition = {
665
668
  readonly nav?: ScreenNavSugar;
666
669
  readonly detailFor?: string;
667
670
  readonly description?: string;
671
+ readonly agent?: AgentHandlerHints;
668
672
  readonly panels: readonly DashboardPanelDefinition[];
669
673
  readonly filter?: DashboardFilterDefinition;
670
674
  readonly slots?: ScreenSlots;
@@ -862,6 +866,7 @@ export type EntityEditScreenDefinition = {
862
866
  readonly nav?: ScreenNavSugar;
863
867
  readonly detailFor?: string;
864
868
  readonly description?: string;
869
+ readonly agent?: AgentHandlerHints;
865
870
  readonly entity: string;
866
871
  readonly layout: EditLayout;
867
872
  /** Optionaler i18n-Key (oder Roh-String) für den Submit-Button. Default
@@ -942,6 +947,7 @@ export type ActionFormScreenDefinition = {
942
947
  readonly nav?: ScreenNavSugar;
943
948
  readonly detailFor?: string;
944
949
  readonly description?: string;
950
+ readonly agent?: AgentHandlerHints;
945
951
  /** Write-Handler-QN der bei Submit gerufen wird. Form-Object landet
946
952
  * 1:1 als payload — Handler-Schema (Zod) validiert weiter. */
947
953
  readonly handler: string;
@@ -998,6 +1004,8 @@ export type CustomScreenDefinition = {
998
1004
  readonly nav?: ScreenNavSugar;
999
1005
  readonly detailFor?: string;
1000
1006
  readonly description?: string;
1007
+ /** Only `expose` is read for screens; `risk` ranks handler tool calls. */
1008
+ readonly agent?: AgentHandlerHints;
1001
1009
  readonly renderer: PlatformComponent;
1002
1010
  readonly routes?: readonly CustomScreenRoute[];
1003
1011
  /** Parent list screen for breadcrumb when this detail is not in nav. */
@@ -1054,6 +1062,7 @@ export type ConfigEditScreenDefinition = {
1054
1062
  readonly nav?: ScreenNavSugar;
1055
1063
  readonly detailFor?: string;
1056
1064
  readonly description?: string;
1065
+ readonly agent?: AgentHandlerHints;
1057
1066
  /** scope für config:write:set Calls. Muss zur Scope-Deklaration der
1058
1067
  * in `configKeys` referenzierten Keys passen — Boot-Validator
1059
1068
  * prüft das gegen die Registry. */
@@ -1097,6 +1106,7 @@ export type SecretsEditScreenDefinition = {
1097
1106
  readonly nav?: ScreenNavSugar;
1098
1107
  readonly detailFor?: string;
1099
1108
  readonly description?: string;
1109
+ readonly agent?: AgentHandlerHints;
1100
1110
  /** field id -> qualified secret name (`<feature>:secret:<kebab>`). */
1101
1111
  readonly secretKeys: Readonly<Record<string, string>>;
1102
1112
  /** field id -> i18n key for the label. */
@@ -1134,10 +1144,10 @@ export type ScreenNavSugar = {
1134
1144
  readonly order?: number;
1135
1145
  };
1136
1146
 
1137
- // `nav`/`detailFor`/`description` live directly on every variant (not only via this
1147
+ // `nav`/`detailFor`/`description`/`agent` live directly on every variant (not only via this
1138
1148
  // union) so a screen typed as its own concrete kind — e.g. `const screen:
1139
1149
  // CustomScreenDefinition = {...}` in a module split out of `feature.ts` —
1140
- // still accepts all three; a union-only intersection drops them the
1150
+ // still accepts all four; a union-only intersection drops them the
1141
1151
  // moment a caller narrows to one member.
1142
1152
  //
1143
1153
  // `detailFor` applies to any screen kind because any kind can be the