@keemakr/ui-sdk 1.6.0-dev-20261029174856 → 1.6.0-dev-20261029192909

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.
@@ -0,0 +1,17 @@
1
+ /** The apps a module press may open. */
2
+ export declare const APP_DESTINATIONS: readonly ["consult"];
3
+ export type AppDestination = (typeof APP_DESTINATIONS)[number];
4
+ /** An appointment, as `Appointment/<id>` or a bare `<id>`: the consult door's own rule. */
5
+ export declare const APPOINTMENT_PARAM: RegExp;
6
+ /** True for a press that opens one of Kee's apps. */
7
+ export declare function isAppPress(press: {
8
+ kind: string;
9
+ } | undefined): press is {
10
+ kind: 'app';
11
+ };
12
+ /**
13
+ * The in-app path an app press opens, or null when it is not one this package allows: an unknown
14
+ * app, a param missing or malformed, or anything else. Every renderer uses this, so the path is
15
+ * built in one place and a press never carries a URL.
16
+ */
17
+ export declare function appPressPath(press: unknown): string | null;
@@ -0,0 +1,33 @@
1
+ // An `app` press: a module's button that opens one of Kee's own apps, never a URL. The only app
2
+ // today is the consult room's door for an appointment ("Open consult room" on a TPS schedule), so
3
+ // the room can be reached from the Workspace and not only from its own rail item.
4
+ //
5
+ // The app is an allow-list and each app's params are checked: a module names an app and a lookup
6
+ // key, and the renderer builds the path. Whether the reader may go in is the app's own check on
7
+ // the server (the consult door re-checks the appointment for the signed-in clinician).
8
+ /** The apps a module press may open. */
9
+ export const APP_DESTINATIONS = ['consult'];
10
+ /** An appointment, as `Appointment/<id>` or a bare `<id>`: the consult door's own rule. */
11
+ export const APPOINTMENT_PARAM = /^(Appointment\/)?[A-Za-z0-9\-.]{1,64}$/;
12
+ /** True for a press that opens one of Kee's apps. */
13
+ export function isAppPress(press) {
14
+ return press?.kind === 'app';
15
+ }
16
+ /**
17
+ * The in-app path an app press opens, or null when it is not one this package allows: an unknown
18
+ * app, a param missing or malformed, or anything else. Every renderer uses this, so the path is
19
+ * built in one place and a press never carries a URL.
20
+ */
21
+ export function appPressPath(press) {
22
+ if (typeof press !== 'object' || press === null)
23
+ return null;
24
+ const { kind, app, params } = press;
25
+ if (kind !== 'app' || !APP_DESTINATIONS.includes(app))
26
+ return null;
27
+ if (typeof params !== 'object' || params === null)
28
+ return null;
29
+ const appointment = params.appointment;
30
+ if (typeof appointment !== 'string' || !APPOINTMENT_PARAM.test(appointment))
31
+ return null;
32
+ return `/consult/open?appointment=${encodeURIComponent(appointment)}`;
33
+ }
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- export { UI_SCHEMA_VERSION, pressSchema, chatPressSchema, valuePressSchema, NAVIGATE_OPENS, buttonSchema, cellSchema, factCellSchema, tableCellSchema, dateFormatSchema, nodeSchema, screenPresentationSchema, screenTreeSchema, actionResultSchema, screenLoadRequestSchema, screenLoadResponseSchema, screenActionRequestSchema, interfaceFamilySchema, surfaceDefinitionSchema, surfaceSchema, screenRegistrationSchema, uiManifestSchema, jobIdSchema, jobStatusSchema, screenJobRequestSchema, mediaPathSchema, seekPointSchema, seekPressSchema, focusPressSchema, BADGE_COUNT_MAX, surfaceBadgeSchema, screenBadgesRequestSchema, screenBadgesResponseSchema, TABS_MAX, } from './schema.js';
2
- export type { Press, ChatPress, SeekPress, SeekPoint, FocusPress, ValuePress, NavigatePress, NavigateOpen, ScreenPresentation, ScreenNode, ScreenRootNode, ScreenTree, ActionResult, InterfaceFamily, SurfaceDefinition, Surface, ScreenRegistration, UiManifest, ScreenTreeInput, ActionResultInput, JobStatus, JobStatusInput, SurfaceBadge, SurfaceBadgeInput, ScreenBadgesRequest, ScreenBadgesResponse, } from './schema.js';
1
+ export { UI_SCHEMA_VERSION, pressSchema, chatPressSchema, valuePressSchema, NAVIGATE_OPENS, buttonSchema, cellSchema, factCellSchema, tableCellSchema, dateFormatSchema, nodeSchema, screenPresentationSchema, screenTreeSchema, actionResultSchema, screenLoadRequestSchema, screenLoadResponseSchema, screenActionRequestSchema, interfaceFamilySchema, surfaceDefinitionSchema, surfaceSchema, screenRegistrationSchema, uiManifestSchema, jobIdSchema, jobStatusSchema, screenJobRequestSchema, mediaPathSchema, seekPointSchema, seekPressSchema, focusPressSchema, appPressSchema, BADGE_COUNT_MAX, surfaceBadgeSchema, screenBadgesRequestSchema, screenBadgesResponseSchema, TABS_MAX, } from './schema.js';
2
+ export type { Press, ChatPress, SeekPress, SeekPoint, FocusPress, AppPress, ValuePress, NavigatePress, NavigateOpen, ScreenPresentation, ScreenNode, ScreenRootNode, ScreenTree, ActionResult, InterfaceFamily, SurfaceDefinition, Surface, ScreenRegistration, UiManifest, ScreenTreeInput, ActionResultInput, JobStatus, JobStatusInput, SurfaceBadge, SurfaceBadgeInput, ScreenBadgesRequest, ScreenBadgesResponse, } from './schema.js';
3
3
  export { BADGE_DISPLAY_MAX, answerBadges, badgeSpokenLabel, badgeText, defineBadges, parseScreenBadges, } from './badges.js';
4
4
  export type { BadgesHandler } from './badges.js';
5
5
  export { CHART_POINTS_MAX, thinChart, thinnedIndices } from './chart.js';
@@ -20,6 +20,8 @@ export { MEDIA_CONTENT_TYPES, mediaContentType, mediaPathOf } from './media.js';
20
20
  export { PLAYBACK_RATES, SEEK_AT_MAX, formatPlayhead, isSeekPress, nextPlaybackRate, playbackRateLabel, playheadWords, seekTarget, seeksIn, } from './player.js';
21
21
  export type { PlaybackRate, PlayerKey, SeekReference } from './player.js';
22
22
  export { FOCUSABLE_FIELD_KINDS, focusIssue, focusesIn, isFocusPress } from './focus.js';
23
+ export { APP_DESTINATIONS, APPOINTMENT_PARAM, appPressPath, isAppPress } from './app-press.js';
24
+ export type { AppDestination } from './app-press.js';
23
25
  export type { FocusReference, FormFieldName } from './focus.js';
24
26
  export { heatmapCellText, heatmapIntensity, heatmapMixPercent, heatmapRange, heatmapStrong, } from './heatmap.js';
25
27
  export type { HeatmapLike, HeatmapRange } from './heatmap.js';
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@
6
6
  // platform components, proxies load/action with a grant
7
7
  //
8
8
  // Module code never ships to the browser. UI is data, not code.
9
- export { UI_SCHEMA_VERSION, pressSchema, chatPressSchema, valuePressSchema, NAVIGATE_OPENS, buttonSchema, cellSchema, factCellSchema, tableCellSchema, dateFormatSchema, nodeSchema, screenPresentationSchema, screenTreeSchema, actionResultSchema, screenLoadRequestSchema, screenLoadResponseSchema, screenActionRequestSchema, interfaceFamilySchema, surfaceDefinitionSchema, surfaceSchema, screenRegistrationSchema, uiManifestSchema, jobIdSchema, jobStatusSchema, screenJobRequestSchema, mediaPathSchema, seekPointSchema, seekPressSchema, focusPressSchema, BADGE_COUNT_MAX, surfaceBadgeSchema, screenBadgesRequestSchema, screenBadgesResponseSchema, TABS_MAX, } from './schema.js';
9
+ export { UI_SCHEMA_VERSION, pressSchema, chatPressSchema, valuePressSchema, NAVIGATE_OPENS, buttonSchema, cellSchema, factCellSchema, tableCellSchema, dateFormatSchema, nodeSchema, screenPresentationSchema, screenTreeSchema, actionResultSchema, screenLoadRequestSchema, screenLoadResponseSchema, screenActionRequestSchema, interfaceFamilySchema, surfaceDefinitionSchema, surfaceSchema, screenRegistrationSchema, uiManifestSchema, jobIdSchema, jobStatusSchema, screenJobRequestSchema, mediaPathSchema, seekPointSchema, seekPressSchema, focusPressSchema, appPressSchema, BADGE_COUNT_MAX, surfaceBadgeSchema, screenBadgesRequestSchema, screenBadgesResponseSchema, TABS_MAX, } from './schema.js';
10
10
  export { BADGE_DISPLAY_MAX, answerBadges, badgeSpokenLabel, badgeText, defineBadges, parseScreenBadges, } from './badges.js';
11
11
  export { CHART_POINTS_MAX, thinChart, thinnedIndices } from './chart.js';
12
12
  export { TABS_MAX_1_4_0, foldTabs, onlyTabParamsDiffer, openingTab, tabParamsOf } from './tabs.js';
@@ -21,6 +21,7 @@ export { PUBLISHED_PARSERS } from './published/index.js';
21
21
  export { MEDIA_CONTENT_TYPES, mediaContentType, mediaPathOf } from './media.js';
22
22
  export { PLAYBACK_RATES, SEEK_AT_MAX, formatPlayhead, isSeekPress, nextPlaybackRate, playbackRateLabel, playheadWords, seekTarget, seeksIn, } from './player.js';
23
23
  export { FOCUSABLE_FIELD_KINDS, focusIssue, focusesIn, isFocusPress } from './focus.js';
24
+ export { APP_DESTINATIONS, APPOINTMENT_PARAM, appPressPath, isAppPress } from './app-press.js';
24
25
  export { heatmapCellText, heatmapIntensity, heatmapMixPercent, heatmapRange, heatmapStrong, } from './heatmap.js';
25
26
  export { checkFormInput, chosenSubmit, formPress, formState, formSubmits, initialDraft, isoToLocalInput, localInputToIso, postedValue, searchableOptions, } from './form.js';
26
27
  export { stackedBarParts, stackedBarValue } from './stacked-bar.js';
@@ -97,8 +97,13 @@ import type { ChatPress, ScreenRootNode, ScreenTree } from './schema.js';
97
97
  * is editable without it, so without it every control with a focus press is dropped, a body
98
98
  * button included (never left as muted text, which would read as a label), and a row, card,
99
99
  * entry or image stays but is no longer pressable.
100
+ * - `press.app`: an `app` press opens one of Kee's own apps ("Open consult room" opens the
101
+ * consult door for an appointment), newer than any published release; core's own renderer
102
+ * draws it. Without it, every control with an app press is dropped exactly as for
103
+ * `press.focus` (a body button included: muted text would read as a label), and a row, card,
104
+ * entry or image stays but is no longer pressable.
100
105
  */
101
- export type UiFeature = 'breadcrumbs' | 'button.disabled' | 'section.row' | 'form.field_kinds' | 'form.confirm' | 'press.chat' | 'form.radio' | 'table.cells' | 'header.meta' | 'tabs.many' | 'choice.action' | 'markdown.links' | 'form.disabled' | 'press.seek' | 'edit.inline' | 'timeline.time_tag' | 'stat.bar' | 'stat.sparkline' | 'section.action' | 'facts.meter' | 'form.show_when' | 'press.focus';
106
+ export type UiFeature = 'breadcrumbs' | 'button.disabled' | 'section.row' | 'form.field_kinds' | 'form.confirm' | 'press.chat' | 'form.radio' | 'table.cells' | 'header.meta' | 'tabs.many' | 'choice.action' | 'markdown.links' | 'form.disabled' | 'press.seek' | 'edit.inline' | 'timeline.time_tag' | 'stat.bar' | 'stat.sparkline' | 'section.action' | 'facts.meter' | 'form.show_when' | 'press.focus' | 'press.app';
102
107
  /** The node types and features one ui-sdk release, or one client, draws. */
103
108
  export interface NodeSet {
104
109
  /** For messages: "ui-sdk 1.4.0", "mobile 0.2.5". */
@@ -135,7 +140,7 @@ export declare const UI_SDK_SNAPSHOTS: {
135
140
  readonly current: {
136
141
  readonly name: "ui-sdk (this package)";
137
142
  readonly nodes: readonly ["heading", "text", "markdown", "stat", "button", "form", "table", "timeline", "pending_request", "pending_requests", "choice_cards", "progress", "chart", "section", "tabs", "pagination", "select", "alert", "details", "timestamp", "divider", "board", "link", "tags", "toggle", "segmented", "progress_bar", "conversation", "composer", "calendar", "image", "video", "stacked_bar", "heatmap", "audio", "document"];
138
- readonly features: readonly ["breadcrumbs", "button.disabled", "section.row", "form.field_kinds", "form.confirm", "press.chat", "form.radio", "table.cells", "header.meta", "tabs.many", "choice.action", "markdown.links", "form.disabled", "press.seek", "edit.inline", "timeline.time_tag", "stat.bar", "stat.sparkline", "section.action", "facts.meter", "form.show_when", "press.focus"];
143
+ readonly features: readonly ["breadcrumbs", "button.disabled", "section.row", "form.field_kinds", "form.confirm", "press.chat", "form.radio", "table.cells", "header.meta", "tabs.many", "choice.action", "markdown.links", "form.disabled", "press.seek", "edit.inline", "timeline.time_tag", "stat.bar", "stat.sparkline", "section.action", "facts.meter", "form.show_when", "press.focus", "press.app"];
139
144
  };
140
145
  };
141
146
  export type UiSdkSnapshot = keyof typeof UI_SDK_SNAPSHOTS;
package/dist/negotiate.js CHANGED
@@ -22,6 +22,7 @@
22
22
  // parses with that row's published schema with no safety field lost.
23
23
  import { foldTableCell, isNewerTableCell, meterLabel } from './cells.js';
24
24
  import { conformTree } from './conform.js';
25
+ import { isAppPress } from './app-press.js';
25
26
  import { isFocusPress } from './focus.js';
26
27
  import { withoutScreenLinks } from './markdown-links.js';
27
28
  import { pageRangeLabel } from './pager.js';
@@ -57,6 +58,7 @@ const ALL_FEATURES = [
57
58
  'facts.meter',
58
59
  'form.show_when',
59
60
  'press.focus',
61
+ 'press.app',
60
62
  ];
61
63
  /** The nodes of ui-sdk 1.1.0 and 1.2.0 (one schema). */
62
64
  const NODES_1_1_0 = [
@@ -326,8 +328,12 @@ export function negotiateTree(tree, set) {
326
328
  fallbacks.push({ path, type: 'button', reason: 'press.focus', as: 'dropped' });
327
329
  return null;
328
330
  }
329
- // A client that cannot open its chat, move a recording or focus a field gets no control that
330
- // offers to.
331
+ if (!features.has('press.app') && original.type === 'button' && isAppPress(original.onPress)) {
332
+ fallbacks.push({ path, type: 'button', reason: 'press.app', as: 'dropped' });
333
+ return null;
334
+ }
335
+ // A client that cannot open its chat, move a recording, focus a field or open an app gets no
336
+ // control that offers to.
331
337
  let node = features.has('press.chat')
332
338
  ? original
333
339
  : withoutPresses(original, path, fallbacks, isChatPress, 'press.chat');
@@ -337,6 +343,9 @@ export function negotiateTree(tree, set) {
337
343
  if (node.type !== 'text' && !features.has('press.focus')) {
338
344
  node = withoutPresses(node, path, fallbacks, isFocusPress, 'press.focus');
339
345
  }
346
+ if (node.type !== 'text' && !features.has('press.app')) {
347
+ node = withoutPresses(node, path, fallbacks, isAppPress, 'press.app');
348
+ }
340
349
  if (node !== original && node.type === 'text')
341
350
  return node;
342
351
  // A client that draws no edit control gets the block read-only.
@@ -532,7 +541,8 @@ export function negotiateTree(tree, set) {
532
541
  (!features.has('button.disabled') ||
533
542
  !features.has('press.chat') ||
534
543
  !features.has('press.seek') ||
535
- !features.has('press.focus'))) {
544
+ !features.has('press.focus') ||
545
+ !features.has('press.app'))) {
536
546
  // The header holds buttons only, so one the client cannot draw safely is dropped.
537
547
  const kept = tree.actions.filter((action, index) => {
538
548
  const reason = action.disabled && !features.has('button.disabled')
@@ -543,7 +553,9 @@ export function negotiateTree(tree, set) {
543
553
  ? 'press.seek'
544
554
  : isFocusPress(action.onPress) && !features.has('press.focus')
545
555
  ? 'press.focus'
546
- : null;
556
+ : isAppPress(action.onPress) && !features.has('press.app')
557
+ ? 'press.app'
558
+ : null;
547
559
  if (!reason)
548
560
  return true;
549
561
  fallbacks.push({ path: `actions[${index}]`, type: 'button', reason, as: 'dropped' });
@@ -769,7 +781,7 @@ export function withoutInlineEdit(node, path, fallbacks) {
769
781
  }
770
782
  /**
771
783
  * The node as a client that cannot run one kind of press should get it: no control left on it that
772
- * offers to (see `press.chat`, `press.seek` and `press.focus` above). `matches` picks the presses
784
+ * offers to (see `press.chat`, `press.seek`, `press.focus` and `press.app` above). `matches` picks the presses
773
785
  * to take away and `reason` is the feature the client lacks. Only the node's own presses; its child
774
786
  * nodes are visited on their own. Returns the same object when there is nothing to take away.
775
787
  */
package/dist/schema.d.ts CHANGED
@@ -102,6 +102,24 @@ export declare const focusPressSchema: z.ZodObject<{
102
102
  kind: z.ZodLiteral<"focus">;
103
103
  field: z.ZodString;
104
104
  }, z.core.$strip>;
105
+ /**
106
+ * Opens one of Kee's own apps, for a module's "Open consult room" button: `app` is an allow-listed
107
+ * app and `params` are exactly what that app takes, checked here. Never a URL: the renderer builds
108
+ * the path (`appPressPath`), and the app decides on the server whether the reader may go in.
109
+ *
110
+ * { kind: 'app', app: 'consult', params: { appointment: 'Appointment/123' } }
111
+ * opens the consult room's door for that appointment (`/consult/open?appointment=…`): the
112
+ * lobby or call when the signed-in clinician may enter it now, else why not.
113
+ */
114
+ export declare const appPressSchema: z.ZodObject<{
115
+ kind: z.ZodLiteral<"app">;
116
+ app: z.ZodEnum<{
117
+ consult: "consult";
118
+ }>;
119
+ params: z.ZodObject<{
120
+ appointment: z.ZodString;
121
+ }, z.core.$strict>;
122
+ }, z.core.$strip>;
105
123
  /**
106
124
  * What a control that applies a chosen value calls: a pager, a select, a
107
125
  * toggle, a sort or filter header. The value is merged in (`pressWithValue`),
@@ -124,7 +142,8 @@ export declare const valuePressSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
124
142
  * pressed: call an action, open another screen of the module (as a page, or in
125
143
  * a drawer over this one with `open: 'drawer'`), open the chat with a prompt
126
144
  * typed in (`chat`, never sent), move a recording on the screen to a moment
127
- * (`seek`), or put the caret in a form field on the screen (`focus`).
145
+ * (`seek`), put the caret in a form field on the screen (`focus`), or open one of
146
+ * Kee's own apps (`app`).
128
147
  */
129
148
  export declare const pressSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
130
149
  kind: z.ZodLiteral<"action">;
@@ -149,6 +168,14 @@ export declare const pressSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
149
168
  }, z.core.$strip>, z.ZodObject<{
150
169
  kind: z.ZodLiteral<"focus">;
151
170
  field: z.ZodString;
171
+ }, z.core.$strip>, z.ZodObject<{
172
+ kind: z.ZodLiteral<"app">;
173
+ app: z.ZodEnum<{
174
+ consult: "consult";
175
+ }>;
176
+ params: z.ZodObject<{
177
+ appointment: z.ZodString;
178
+ }, z.core.$strict>;
152
179
  }, z.core.$strip>], "kind">;
153
180
  /**
154
181
  * How a screen writes its dates and times. Set on the tree for the whole screen;
@@ -196,6 +223,14 @@ export declare const buttonSchema: z.ZodObject<{
196
223
  }, z.core.$strip>, z.ZodObject<{
197
224
  kind: z.ZodLiteral<"focus">;
198
225
  field: z.ZodString;
226
+ }, z.core.$strip>, z.ZodObject<{
227
+ kind: z.ZodLiteral<"app">;
228
+ app: z.ZodEnum<{
229
+ consult: "consult";
230
+ }>;
231
+ params: z.ZodObject<{
232
+ appointment: z.ZodString;
233
+ }, z.core.$strict>;
199
234
  }, z.core.$strip>], "kind">;
200
235
  variant: z.ZodDefault<z.ZodEnum<{
201
236
  destructive: "destructive";
@@ -510,6 +545,14 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
510
545
  }, z.core.$strip>, z.ZodObject<{
511
546
  kind: z.ZodLiteral<"focus">;
512
547
  field: z.ZodString;
548
+ }, z.core.$strip>, z.ZodObject<{
549
+ kind: z.ZodLiteral<"app">;
550
+ app: z.ZodEnum<{
551
+ consult: "consult";
552
+ }>;
553
+ params: z.ZodObject<{
554
+ appointment: z.ZodString;
555
+ }, z.core.$strict>;
513
556
  }, z.core.$strip>], "kind">>;
514
557
  selected: z.ZodOptional<z.ZodBoolean>;
515
558
  bar: z.ZodOptional<z.ZodObject<{
@@ -565,6 +608,14 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
565
608
  }, z.core.$strip>, z.ZodObject<{
566
609
  kind: z.ZodLiteral<"focus">;
567
610
  field: z.ZodString;
611
+ }, z.core.$strip>, z.ZodObject<{
612
+ kind: z.ZodLiteral<"app">;
613
+ app: z.ZodEnum<{
614
+ consult: "consult";
615
+ }>;
616
+ params: z.ZodObject<{
617
+ appointment: z.ZodString;
618
+ }, z.core.$strict>;
568
619
  }, z.core.$strip>], "kind">;
569
620
  variant: z.ZodDefault<z.ZodEnum<{
570
621
  destructive: "destructive";
@@ -819,6 +870,14 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
819
870
  }, z.core.$strip>, z.ZodObject<{
820
871
  kind: z.ZodLiteral<"focus">;
821
872
  field: z.ZodString;
873
+ }, z.core.$strip>, z.ZodObject<{
874
+ kind: z.ZodLiteral<"app">;
875
+ app: z.ZodEnum<{
876
+ consult: "consult";
877
+ }>;
878
+ params: z.ZodObject<{
879
+ appointment: z.ZodString;
880
+ }, z.core.$strict>;
822
881
  }, z.core.$strip>], "kind">>;
823
882
  expand: z.ZodOptional<z.ZodObject<{
824
883
  children: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -928,6 +987,14 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
928
987
  }, z.core.$strip>, z.ZodObject<{
929
988
  kind: z.ZodLiteral<"focus">;
930
989
  field: z.ZodString;
990
+ }, z.core.$strip>, z.ZodObject<{
991
+ kind: z.ZodLiteral<"app">;
992
+ app: z.ZodEnum<{
993
+ consult: "consult";
994
+ }>;
995
+ params: z.ZodObject<{
996
+ appointment: z.ZodString;
997
+ }, z.core.$strict>;
931
998
  }, z.core.$strip>], "kind">>;
932
999
  selected: z.ZodOptional<z.ZodBoolean>;
933
1000
  bar: z.ZodOptional<z.ZodObject<{
@@ -983,6 +1050,14 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
983
1050
  }, z.core.$strip>, z.ZodObject<{
984
1051
  kind: z.ZodLiteral<"focus">;
985
1052
  field: z.ZodString;
1053
+ }, z.core.$strip>, z.ZodObject<{
1054
+ kind: z.ZodLiteral<"app">;
1055
+ app: z.ZodEnum<{
1056
+ consult: "consult";
1057
+ }>;
1058
+ params: z.ZodObject<{
1059
+ appointment: z.ZodString;
1060
+ }, z.core.$strict>;
986
1061
  }, z.core.$strip>], "kind">;
987
1062
  variant: z.ZodDefault<z.ZodEnum<{
988
1063
  destructive: "destructive";
@@ -1051,6 +1126,14 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1051
1126
  }, z.core.$strip>, z.ZodObject<{
1052
1127
  kind: z.ZodLiteral<"focus">;
1053
1128
  field: z.ZodString;
1129
+ }, z.core.$strip>, z.ZodObject<{
1130
+ kind: z.ZodLiteral<"app">;
1131
+ app: z.ZodEnum<{
1132
+ consult: "consult";
1133
+ }>;
1134
+ params: z.ZodObject<{
1135
+ appointment: z.ZodString;
1136
+ }, z.core.$strict>;
1054
1137
  }, z.core.$strip>], "kind">;
1055
1138
  variant: z.ZodDefault<z.ZodEnum<{
1056
1139
  destructive: "destructive";
@@ -1193,6 +1276,14 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1193
1276
  }, z.core.$strip>, z.ZodObject<{
1194
1277
  kind: z.ZodLiteral<"focus">;
1195
1278
  field: z.ZodString;
1279
+ }, z.core.$strip>, z.ZodObject<{
1280
+ kind: z.ZodLiteral<"app">;
1281
+ app: z.ZodEnum<{
1282
+ consult: "consult";
1283
+ }>;
1284
+ params: z.ZodObject<{
1285
+ appointment: z.ZodString;
1286
+ }, z.core.$strict>;
1196
1287
  }, z.core.$strip>], "kind">>;
1197
1288
  tone: z.ZodOptional<z.ZodEnum<{
1198
1289
  default: "default";
@@ -1239,6 +1330,14 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1239
1330
  }, z.core.$strip>, z.ZodObject<{
1240
1331
  kind: z.ZodLiteral<"focus">;
1241
1332
  field: z.ZodString;
1333
+ }, z.core.$strip>, z.ZodObject<{
1334
+ kind: z.ZodLiteral<"app">;
1335
+ app: z.ZodEnum<{
1336
+ consult: "consult";
1337
+ }>;
1338
+ params: z.ZodObject<{
1339
+ appointment: z.ZodString;
1340
+ }, z.core.$strict>;
1242
1341
  }, z.core.$strip>], "kind">;
1243
1342
  }, z.core.$strip>>;
1244
1343
  }, z.core.$strip>>;
@@ -1372,6 +1471,14 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1372
1471
  }, z.core.$strip>, z.ZodObject<{
1373
1472
  kind: z.ZodLiteral<"focus">;
1374
1473
  field: z.ZodString;
1474
+ }, z.core.$strip>, z.ZodObject<{
1475
+ kind: z.ZodLiteral<"app">;
1476
+ app: z.ZodEnum<{
1477
+ consult: "consult";
1478
+ }>;
1479
+ params: z.ZodObject<{
1480
+ appointment: z.ZodString;
1481
+ }, z.core.$strict>;
1375
1482
  }, z.core.$strip>], "kind">;
1376
1483
  variant: z.ZodDefault<z.ZodEnum<{
1377
1484
  destructive: "destructive";
@@ -1565,6 +1672,14 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1565
1672
  }, z.core.$strip>, z.ZodObject<{
1566
1673
  kind: z.ZodLiteral<"focus">;
1567
1674
  field: z.ZodString;
1675
+ }, z.core.$strip>, z.ZodObject<{
1676
+ kind: z.ZodLiteral<"app">;
1677
+ app: z.ZodEnum<{
1678
+ consult: "consult";
1679
+ }>;
1680
+ params: z.ZodObject<{
1681
+ appointment: z.ZodString;
1682
+ }, z.core.$strict>;
1568
1683
  }, z.core.$strip>], "kind">>;
1569
1684
  }, z.core.$strip>>;
1570
1685
  }, z.core.$strip>>;
@@ -1703,6 +1818,14 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1703
1818
  }, z.core.$strip>, z.ZodObject<{
1704
1819
  kind: z.ZodLiteral<"focus">;
1705
1820
  field: z.ZodString;
1821
+ }, z.core.$strip>, z.ZodObject<{
1822
+ kind: z.ZodLiteral<"app">;
1823
+ app: z.ZodEnum<{
1824
+ consult: "consult";
1825
+ }>;
1826
+ params: z.ZodObject<{
1827
+ appointment: z.ZodString;
1828
+ }, z.core.$strict>;
1706
1829
  }, z.core.$strip>], "kind">>;
1707
1830
  selected: z.ZodOptional<z.ZodBoolean>;
1708
1831
  }, z.core.$strip>>;
@@ -1902,6 +2025,14 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1902
2025
  }, z.core.$strip>, z.ZodObject<{
1903
2026
  kind: z.ZodLiteral<"focus">;
1904
2027
  field: z.ZodString;
2028
+ }, z.core.$strip>, z.ZodObject<{
2029
+ kind: z.ZodLiteral<"app">;
2030
+ app: z.ZodEnum<{
2031
+ consult: "consult";
2032
+ }>;
2033
+ params: z.ZodObject<{
2034
+ appointment: z.ZodString;
2035
+ }, z.core.$strict>;
1905
2036
  }, z.core.$strip>], "kind">;
1906
2037
  variant: z.ZodDefault<z.ZodEnum<{
1907
2038
  destructive: "destructive";
@@ -1966,6 +2097,14 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1966
2097
  }, z.core.$strip>, z.ZodObject<{
1967
2098
  kind: z.ZodLiteral<"focus">;
1968
2099
  field: z.ZodString;
2100
+ }, z.core.$strip>, z.ZodObject<{
2101
+ kind: z.ZodLiteral<"app">;
2102
+ app: z.ZodEnum<{
2103
+ consult: "consult";
2104
+ }>;
2105
+ params: z.ZodObject<{
2106
+ appointment: z.ZodString;
2107
+ }, z.core.$strict>;
1969
2108
  }, z.core.$strip>], "kind">>;
1970
2109
  }, z.core.$strip>>;
1971
2110
  onSlotPress: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -2026,6 +2165,14 @@ declare const leafNodeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2026
2165
  }, z.core.$strip>, z.ZodObject<{
2027
2166
  kind: z.ZodLiteral<"focus">;
2028
2167
  field: z.ZodString;
2168
+ }, z.core.$strip>, z.ZodObject<{
2169
+ kind: z.ZodLiteral<"app">;
2170
+ app: z.ZodEnum<{
2171
+ consult: "consult";
2172
+ }>;
2173
+ params: z.ZodObject<{
2174
+ appointment: z.ZodString;
2175
+ }, z.core.$strict>;
2029
2176
  }, z.core.$strip>], "kind">>;
2030
2177
  }, z.core.$strip>, z.ZodObject<{
2031
2178
  type: z.ZodLiteral<"video">;
@@ -2332,6 +2479,14 @@ export declare const screenTreeSchema: z.ZodObject<{
2332
2479
  }, z.core.$strip>, z.ZodObject<{
2333
2480
  kind: z.ZodLiteral<"focus">;
2334
2481
  field: z.ZodString;
2482
+ }, z.core.$strip>, z.ZodObject<{
2483
+ kind: z.ZodLiteral<"app">;
2484
+ app: z.ZodEnum<{
2485
+ consult: "consult";
2486
+ }>;
2487
+ params: z.ZodObject<{
2488
+ appointment: z.ZodString;
2489
+ }, z.core.$strict>;
2335
2490
  }, z.core.$strip>], "kind">;
2336
2491
  variant: z.ZodDefault<z.ZodEnum<{
2337
2492
  destructive: "destructive";
@@ -2579,6 +2734,14 @@ export declare const actionResultSchema: z.ZodObject<{
2579
2734
  }, z.core.$strip>, z.ZodObject<{
2580
2735
  kind: z.ZodLiteral<"focus">;
2581
2736
  field: z.ZodString;
2737
+ }, z.core.$strip>, z.ZodObject<{
2738
+ kind: z.ZodLiteral<"app">;
2739
+ app: z.ZodEnum<{
2740
+ consult: "consult";
2741
+ }>;
2742
+ params: z.ZodObject<{
2743
+ appointment: z.ZodString;
2744
+ }, z.core.$strict>;
2582
2745
  }, z.core.$strip>], "kind">;
2583
2746
  variant: z.ZodDefault<z.ZodEnum<{
2584
2747
  destructive: "destructive";
@@ -2819,6 +2982,14 @@ export declare const jobStatusSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2819
2982
  }, z.core.$strip>, z.ZodObject<{
2820
2983
  kind: z.ZodLiteral<"focus">;
2821
2984
  field: z.ZodString;
2985
+ }, z.core.$strip>, z.ZodObject<{
2986
+ kind: z.ZodLiteral<"app">;
2987
+ app: z.ZodEnum<{
2988
+ consult: "consult";
2989
+ }>;
2990
+ params: z.ZodObject<{
2991
+ appointment: z.ZodString;
2992
+ }, z.core.$strict>;
2822
2993
  }, z.core.$strip>], "kind">;
2823
2994
  variant: z.ZodDefault<z.ZodEnum<{
2824
2995
  destructive: "destructive";
@@ -3049,6 +3220,14 @@ export declare const screenLoadResponseSchema: z.ZodObject<{
3049
3220
  }, z.core.$strip>, z.ZodObject<{
3050
3221
  kind: z.ZodLiteral<"focus">;
3051
3222
  field: z.ZodString;
3223
+ }, z.core.$strip>, z.ZodObject<{
3224
+ kind: z.ZodLiteral<"app">;
3225
+ app: z.ZodEnum<{
3226
+ consult: "consult";
3227
+ }>;
3228
+ params: z.ZodObject<{
3229
+ appointment: z.ZodString;
3230
+ }, z.core.$strict>;
3052
3231
  }, z.core.$strip>], "kind">;
3053
3232
  variant: z.ZodDefault<z.ZodEnum<{
3054
3233
  destructive: "destructive";
@@ -3233,6 +3412,7 @@ export type ChatPress = z.infer<typeof chatPressSchema>;
3233
3412
  export type SeekPress = z.infer<typeof seekPressSchema>;
3234
3413
  export type SeekPoint = z.infer<typeof seekPointSchema>;
3235
3414
  export type FocusPress = z.infer<typeof focusPressSchema>;
3415
+ export type AppPress = z.infer<typeof appPressSchema>;
3236
3416
  export type NavigatePress = z.infer<typeof openingNavigatePressSchema>;
3237
3417
  export type NavigateOpen = (typeof NAVIGATE_OPENS)[number];
3238
3418
  export type ScreenPresentation = z.infer<typeof screenPresentationSchema>;
package/dist/schema.js CHANGED
@@ -11,6 +11,7 @@
11
11
  * versions until modules migrate.
12
12
  */
13
13
  import { z } from 'zod';
14
+ import { APP_DESTINATIONS, APPOINTMENT_PARAM } from './app-press.js';
14
15
  import { isTimeZone } from './calendar.js';
15
16
  import { CHART_POINTS_MAX } from './chart.js';
16
17
  import { isDateLocale } from './date-format.js';
@@ -131,6 +132,23 @@ export const focusPressSchema = z.object({
131
132
  /** The `name` of a form field on this screen. */
132
133
  field: slug,
133
134
  });
135
+ /**
136
+ * Opens one of Kee's own apps, for a module's "Open consult room" button: `app` is an allow-listed
137
+ * app and `params` are exactly what that app takes, checked here. Never a URL: the renderer builds
138
+ * the path (`appPressPath`), and the app decides on the server whether the reader may go in.
139
+ *
140
+ * { kind: 'app', app: 'consult', params: { appointment: 'Appointment/123' } }
141
+ * opens the consult room's door for that appointment (`/consult/open?appointment=…`): the
142
+ * lobby or call when the signed-in clinician may enter it now, else why not.
143
+ */
144
+ export const appPressSchema = z.object({
145
+ kind: z.literal('app'),
146
+ app: z.enum(APP_DESTINATIONS),
147
+ params: z.strictObject({
148
+ /** `Appointment/<id>` or a bare `<id>`. */
149
+ appointment: z.string().regex(APPOINTMENT_PARAM, 'Appointment/<id> or a bare <id>'),
150
+ }),
151
+ });
134
152
  /**
135
153
  * What a control that applies a chosen value calls: a pager, a select, a
136
154
  * toggle, a sort or filter header. The value is merged in (`pressWithValue`),
@@ -147,7 +165,8 @@ export const valuePressSchema = z.discriminatedUnion('kind', [
147
165
  * pressed: call an action, open another screen of the module (as a page, or in
148
166
  * a drawer over this one with `open: 'drawer'`), open the chat with a prompt
149
167
  * typed in (`chat`, never sent), move a recording on the screen to a moment
150
- * (`seek`), or put the caret in a form field on the screen (`focus`).
168
+ * (`seek`), put the caret in a form field on the screen (`focus`), or open one of
169
+ * Kee's own apps (`app`).
151
170
  */
152
171
  export const pressSchema = z.discriminatedUnion('kind', [
153
172
  actionPressSchema,
@@ -155,6 +174,7 @@ export const pressSchema = z.discriminatedUnion('kind', [
155
174
  chatPressSchema,
156
175
  seekPressSchema,
157
176
  focusPressSchema,
177
+ appPressSchema,
158
178
  ]);
159
179
  /**
160
180
  * Edit one part of a record where it stands (`edit` on `text`, `markdown`, `details` and a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keemakr/ui-sdk",
3
- "version": "1.6.0-dev-20261029174856",
3
+ "version": "1.6.0-dev-20261029192909",
4
4
  "description": "Product screens for keemakr marketplace modules: a versioned, server-driven UI tree schema plus defineScreen() handlers. Module code never ships to the browser — keemakr-core validates the tree and renders it with platform components.",
5
5
  "license": "MIT",
6
6
  "type": "module",