@yaklabs-ai/plugin-sdk 0.45.0 → 0.47.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/dist/kay-app.d.ts CHANGED
@@ -34,6 +34,60 @@ export declare interface AccessApprovalTypeDefinition {
34
34
  }, ctx: AccessApprovalContext) => Promise<FinalizedAccessApproval>;
35
35
  }
36
36
 
37
+ /**
38
+ * Action binding — maps an event to an action invocation.
39
+ *
40
+ * Used inside the `on` field of a UIElement:
41
+ * ```json
42
+ * { "on": { "press": { "action": "setState", "params": { "statePath": "/x", "value": 1 } } } }
43
+ * ```
44
+ */
45
+ declare interface ActionBinding {
46
+ /** Action name (must be in catalog) */
47
+ action: string;
48
+ /** Parameters to pass to the action handler */
49
+ params?: Record<string, DynamicValue>;
50
+ /** Confirmation dialog before execution */
51
+ confirm?: ActionConfirm;
52
+ /** Handler after successful execution */
53
+ onSuccess?: ActionOnSuccess;
54
+ /** Handler after failed execution */
55
+ onError?: ActionOnError;
56
+ /** Whether to prevent default browser behavior (e.g. navigation on links) */
57
+ preventDefault?: boolean;
58
+ }
59
+
60
+ /**
61
+ * Confirmation dialog configuration
62
+ */
63
+ declare interface ActionConfirm {
64
+ title: string;
65
+ message: string;
66
+ confirmLabel?: string;
67
+ cancelLabel?: string;
68
+ variant?: "default" | "danger";
69
+ }
70
+
71
+ /**
72
+ * Action error handler
73
+ */
74
+ declare type ActionOnError = {
75
+ set: Record<string, unknown>;
76
+ } | {
77
+ action: string;
78
+ };
79
+
80
+ /**
81
+ * Action success handler
82
+ */
83
+ declare type ActionOnSuccess = {
84
+ navigate: string;
85
+ } | {
86
+ set: Record<string, unknown>;
87
+ } | {
88
+ action: string;
89
+ };
90
+
37
91
  declare const AdapterPlacement: z.ZodEnum<{
38
92
  "local-only": "local-only";
39
93
  anywhere: "anywhere";
@@ -107,6 +161,15 @@ export declare type AgentToolUpdateCallback<T = any> = (partialResult: AgentTool
107
161
 
108
162
  declare const Alpha: TAlpha;
109
163
 
164
+ /**
165
+ * AND wrapper — all child conditions must be true.
166
+ * This is the explicit form of the implicit array AND (`SingleCondition[]`).
167
+ * Unlike the implicit form, `$and` supports nested `$or` and `$and` conditions.
168
+ */
169
+ declare type AndCondition = {
170
+ $and: VisibilityCondition[];
171
+ };
172
+
110
173
  /** Compatibility settings for Anthropic Messages-compatible APIs. */
111
174
  declare interface AnthropicMessagesCompat extends Static<typeof AnthropicMessagesCompatSchema> {
112
175
  }
@@ -581,6 +644,9 @@ declare function Capitalize_2<Type extends TSchema>(type: Type, options?: TSchem
581
644
  /** Creates a deferred Capitalize action. */
582
645
  declare function CapitalizeDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TCapitalizeDeferred<Type>;
583
646
 
647
+ /** Build a json-render card; state is shared by every child through JSON pointers. */
648
+ export declare function card(title: string, children: readonly KayAppCardLayout[], state?: Record<string, unknown>): KayAppCardLayout;
649
+
584
650
  declare namespace Char {
585
651
  export {
586
652
  TAlpha,
@@ -676,6 +742,34 @@ declare const CompareResultLeftInside = 2;
676
742
 
677
743
  declare const CompareResultRightInside = 3;
678
744
 
745
+ /**
746
+ * Shared comparison operators for visibility conditions.
747
+ *
748
+ * Use at most ONE comparison operator per condition. If multiple are
749
+ * provided, only the first matching one is evaluated (precedence:
750
+ * eq > neq > gt > gte > lt > lte). With no operator, truthiness is checked.
751
+ *
752
+ * `not` inverts the final result of whichever operator (or truthiness
753
+ * check) is used.
754
+ */
755
+ declare type ComparisonOperators = {
756
+ eq?: unknown;
757
+ neq?: unknown;
758
+ gt?: number | {
759
+ $state: string;
760
+ };
761
+ gte?: number | {
762
+ $state: string;
763
+ };
764
+ lt?: number | {
765
+ $state: string;
766
+ };
767
+ lte?: number | {
768
+ $state: string;
769
+ };
770
+ not?: true;
771
+ };
772
+
679
773
  declare const COMPOSER_REFERENCES_CUSTOM_TYPE = "composer_references";
680
774
 
681
775
  declare interface ComposerReferencesDetails {
@@ -1193,6 +1287,16 @@ declare interface DynamicContextSection {
1193
1287
  readonly items?: readonly DynamicContextItem[];
1194
1288
  }
1195
1289
 
1290
+ /**
1291
+ * Dynamic value - can be a literal or a `{ $state }` reference to the state model.
1292
+ *
1293
+ * Used in action params and validation args where values can either be
1294
+ * hardcoded or resolved from state at runtime.
1295
+ */
1296
+ declare type DynamicValue<T = unknown> = T | {
1297
+ $state: string;
1298
+ };
1299
+
1196
1300
  declare const Element: (input: string) => [unknown, string] | [];
1197
1301
 
1198
1302
  declare const ElementBase: (input: string) => [unknown, string] | [];
@@ -1715,6 +1819,14 @@ declare const IndexArray_0: (input: string, result?: unknown[]) => [unknown[], s
1715
1819
 
1716
1820
  declare function IndexArrayMapping(input: ([unknown, unknown, unknown] | [unknown, unknown])[]): unknown;
1717
1821
 
1822
+ /**
1823
+ * A condition that resolves `$index` to the current repeat array index.
1824
+ * Only meaningful inside a `repeat` scope.
1825
+ */
1826
+ declare type IndexCondition = {
1827
+ $index: true;
1828
+ } & ComparisonOperators;
1829
+
1718
1830
  /** Creates a deferred Index action. */
1719
1831
  declare function IndexDeferred<Type extends TSchema, Indexer extends TSchema>(type: Type, indexer: Indexer, options?: TSchemaOptions): TIndexDeferred<Type, Indexer>;
1720
1832
 
@@ -2005,6 +2117,16 @@ declare function IsUnsafe(value: unknown): value is TUnsafe;
2005
2117
  /** Returns true if the given value is TVoid. */
2006
2118
  declare function IsVoid(value: unknown): value is TVoid;
2007
2119
 
2120
+ /**
2121
+ * A condition that resolves `$item` to a field on the current repeat item.
2122
+ * Only meaningful inside a `repeat` scope.
2123
+ *
2124
+ * Use `""` to reference the whole item, or `"field"` for a specific field.
2125
+ */
2126
+ declare type ItemCondition = {
2127
+ $item: string;
2128
+ } & ComparisonOperators;
2129
+
2008
2130
  declare const JsonObject: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
2009
2131
 
2010
2132
  declare type JsonObject = z.infer<typeof JsonObject>;
@@ -2745,9 +2867,21 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2745
2867
  * 0.44.0 adds `words.kinds` to a reference presentation (#15905): an ordered list of address patterns
2746
2868
  * and the kind each one names. Additive: a plugin that lists them declares ^0.44.0.
2747
2869
  *
2748
- * 0.45.0 adds declared plugin cards and app.implementCard for their read/submit endpoints.
2870
+ * 0.45.0 adds declared plugin cards and app.implementCard for their read/submit endpoints. It also
2871
+ * lets a plugin declare what the window hardcoded about it (#15906). A reference presentation gains
2872
+ * `accountLinks`, how a page opens under the account an address means, and a `local-app` open, for
2873
+ * an item an app on this machine shows; a plugin the person installed can't declare that open. A
2874
+ * `webSession` gains `signInFirst`. A URI module defines `lookupWebLink` and sets `looksUpWebLinks`
2875
+ * to find a page when someone opens the address, and a preview field marks which `part` of a message
2876
+ * it is. A claim's `brandIcon` is a file path and no longer inline markup, which only this repo's
2877
+ * Microsoft plugin used. Otherwise additive: a plugin using any of these declares ^0.45.0.
2878
+ *
2879
+ * 0.46.0 adds `@bonsai/plugin-sdk/artifact-provenance`, so a plugin shipped as files can finalize
2880
+ * and read the provenance the host captured. Additive: a plugin that imports it declares ^0.46.0.
2881
+ *
2882
+ * 0.47.0 adds card layouts and builders; successful card submits now require a summary.
2749
2883
  */
2750
- declare const KAY_PLUGIN_SDK_VERSION: "0.45.0";
2884
+ declare const KAY_PLUGIN_SDK_VERSION: "0.47.0";
2751
2885
 
2752
2886
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2753
2887
 
@@ -3653,14 +3787,15 @@ export declare type KayAppAutomationMatch = {
3653
3787
  readonly requestedBy?: "user" | "agent" | undefined;
3654
3788
  };
3655
3789
 
3656
- /** Match any listed type; filters use strict equality or scalar-list containment. */
3790
+ /**
3791
+ * Match any listed type. `where` is an expression over the event: `==` and `!=` compare a whole
3792
+ * value, and `contains` looks inside a list, as in
3793
+ * `payload.status == 'open' && payload.labels contains 'urgent'`.
3794
+ */
3657
3795
  export declare interface KayAppAutomationPluginEventCondition {
3658
3796
  readonly kind: "plugin-event";
3659
3797
  readonly events: readonly string[];
3660
- readonly where?: readonly {
3661
- readonly path: string;
3662
- readonly equals: string | number | boolean;
3663
- }[];
3798
+ readonly where?: string;
3664
3799
  }
3665
3800
 
3666
3801
  /**
@@ -3972,17 +4107,38 @@ export declare interface KayAppBackgroundCredentialRequest {
3972
4107
  readonly jobId: string;
3973
4108
  }
3974
4109
 
4110
+ export declare interface KayAppCardFieldOptions {
4111
+ readonly label: string;
4112
+ readonly placeholder?: string;
4113
+ readonly required?: boolean;
4114
+ }
4115
+
3975
4116
  /** The background operations of a manifest-declared plugin card. */
3976
4117
  export declare interface KayAppCardImplementation<Input = unknown, Data = unknown, Values = unknown> {
3977
- read(inputs: Input): KayAppCardResult<Data> | Promise<KayAppCardResult<Data>>;
4118
+ read(inputs: Input): KayAppCardReadResult<Data> | Promise<KayAppCardReadResult<Data>>;
3978
4119
  submit(request: {
3979
4120
  readonly inputs: Input;
3980
4121
  readonly values: Values;
3981
- }): KayAppCardResult<Data> | Promise<KayAppCardResult<Data>>;
4122
+ }): KayAppCardSubmitResult<Data> | Promise<KayAppCardSubmitResult<Data>>;
3982
4123
  }
3983
4124
 
4125
+ export declare type KayAppCardLayout = Extract<PluginCardReadResult<never>, {
4126
+ presentation: "layout";
4127
+ }>["layout"];
4128
+
4129
+ export declare type KayAppCardReadResult<T> = PluginCardReadResult<T>;
4130
+
3984
4131
  export declare type KayAppCardResult<T> = PluginCardResult<T>;
3985
4132
 
4133
+ export declare interface KayAppCardSelectOptions extends KayAppCardFieldOptions {
4134
+ readonly options: readonly {
4135
+ readonly value: string;
4136
+ readonly label: string;
4137
+ }[];
4138
+ }
4139
+
4140
+ export declare type KayAppCardSubmitResult<T> = PluginCardSubmitResult<T>;
4141
+
3986
4142
  /**
3987
4143
  * The `kay.app` system-prompt contract (`app.systemPrompt`): text a plugin adds to every chat's
3988
4144
  * system prompt, rendered by the daemon from a few facts about the chat and reused across chats.
@@ -9050,6 +9206,8 @@ declare function ModuleDeferred<Declarations extends TProperties>(declarations:
9050
9206
 
9051
9207
  declare function ModuleMapping(input: [unknown, unknown]): unknown;
9052
9208
 
9209
+ export declare function multiSelect(name: string, options: KayAppCardSelectOptions): KayAppCardLayout;
9210
+
9053
9211
  /** A tool call that another tool made while it ran, for example from a codemode script. */
9054
9212
  declare interface NestedToolCallRecord {
9055
9213
  id: string;
@@ -9315,6 +9473,13 @@ declare const OptionalSemiColon: (input: string) => [unknown, string] | [];
9315
9473
 
9316
9474
  declare function OptionalSemiColonMapping(input: [unknown] | []): unknown;
9317
9475
 
9476
+ /**
9477
+ * OR wrapper — at least one child condition must be true.
9478
+ */
9479
+ declare type OrCondition = {
9480
+ $or: VisibilityCondition[];
9481
+ };
9482
+
9318
9483
  declare const PackageAssetPath: z.ZodString;
9319
9484
 
9320
9485
  declare type PackageAssetPath = z.infer<typeof PackageAssetPath>;
@@ -9817,6 +9982,12 @@ export declare const PluginAgentDefinitionPermissionRule: z.ZodObject<{
9817
9982
 
9818
9983
  export declare type PluginAgentDefinitionPermissionRule = z.infer<typeof PluginAgentDefinitionPermissionRule>;
9819
9984
 
9985
+ declare type PluginCardReadResult<T> = PluginCardResult<T> | {
9986
+ readonly ok: true;
9987
+ readonly presentation: "layout";
9988
+ readonly layout: Spec;
9989
+ };
9990
+
9820
9991
  declare type PluginCardResult<T> = {
9821
9992
  readonly ok: true;
9822
9993
  readonly data: T;
@@ -9826,6 +9997,14 @@ declare type PluginCardResult<T> = {
9826
9997
  readonly message: string;
9827
9998
  };
9828
9999
 
10000
+ declare type PluginCardSubmitResult<T> = {
10001
+ readonly ok: true;
10002
+ readonly data: T;
10003
+ readonly summary: string;
10004
+ } | Extract<PluginCardResult<T>, {
10005
+ readonly ok: false;
10006
+ }>;
10007
+
9829
10008
  export declare const PluginEventEnvelope: z.ZodObject<{
9830
10009
  id: z.ZodString;
9831
10010
  localId: z.ZodString;
@@ -10234,6 +10413,7 @@ declare function refineWebSessionScopeConfined(webSession: {
10234
10413
  readonly probe: {
10235
10414
  readonly url: string;
10236
10415
  };
10416
+ readonly signInFirst?: string | undefined;
10237
10417
  }, ctx: z.RefinementCtx): void;
10238
10418
 
10239
10419
  export declare interface RegisteredHostApprovalType {
@@ -10438,6 +10618,8 @@ declare function ReturnType_2<Type extends TSchema>(type: Type, options?: TSchem
10438
10618
  /** Creates a deferred ReturnType action. */
10439
10619
  declare function ReturnTypeDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TReturnTypeDeferred<Type>;
10440
10620
 
10621
+ export declare function row(children: readonly KayAppCardLayout[]): KayAppCardLayout;
10622
+
10441
10623
  /**
10442
10624
  * The hidden message a continued run rides as its admission ticket (a mid-turn compaction
10443
10625
  * resume, a run-recovery re-drive). The engine writes it; this package's placement rows keep it
@@ -11013,6 +11195,8 @@ declare const SdkSessionDoor: z.ZodEnum<{
11013
11195
 
11014
11196
  declare type SdkSessionDoor = z.infer<typeof SdkSessionDoor>;
11015
11197
 
11198
+ export declare function select(name: string, options: KayAppCardSelectOptions): KayAppCardLayout;
11199
+
11016
11200
  declare type SelectorDisposition = {
11017
11201
  readonly kind: "deferred";
11018
11202
  readonly window?: LineSelector;
@@ -11281,6 +11465,9 @@ declare const SignedInStatusCode: z.ZodNumber;
11281
11465
 
11282
11466
  declare type SignedInStatusCode = z.infer<typeof SignedInStatusCode>;
11283
11467
 
11468
+ /** A single visibility condition (state, item, or index). */
11469
+ declare type SingleCondition = StateCondition | ItemCondition | IndexCondition;
11470
+
11284
11471
  declare interface SourceInfo {
11285
11472
  path: string;
11286
11473
  source: string;
@@ -11303,6 +11490,33 @@ declare type SourceScope = "user" | "project" | "temporary";
11303
11490
  /** Matches from Start and End capturing everything in-between. Start and End are consumed. */
11304
11491
  declare function Span<Start extends string, End extends string, MultiLine extends boolean, Input extends string>(start: Start, end: End, multiLine: MultiLine, input: Input): TSpan<Start, End, MultiLine, Input>;
11305
11492
 
11493
+ /**
11494
+ * Flat UI tree structure (optimized for LLM generation)
11495
+ */
11496
+ declare interface Spec {
11497
+ /** Root element key */
11498
+ root: string;
11499
+ /** Flat map of elements by key */
11500
+ elements: Record<string, UIElement>;
11501
+ /** Optional initial state to seed the state model.
11502
+ * Components using statePath will read from / write to this state. */
11503
+ state?: Record<string, unknown>;
11504
+ }
11505
+
11506
+ export declare function stack(children: readonly KayAppCardLayout[]): KayAppCardLayout;
11507
+
11508
+ /**
11509
+ * A single state-based condition.
11510
+ * Resolves `$state` to a value from the state model, then applies the operator.
11511
+ * Without an operator, checks truthiness.
11512
+ *
11513
+ * When `not` is `true`, the result of the entire condition is inverted.
11514
+ * For example `{ $state: "/count", gt: 5, not: true }` means "NOT greater than 5".
11515
+ */
11516
+ declare type StateCondition = {
11517
+ $state: string;
11518
+ } & ComparisonOperators;
11519
+
11306
11520
  /** Infers a static type from a TypeBox type. */
11307
11521
  declare type Static<Type extends TSchema, Context extends TProperties = {}, Result extends unknown = StaticType<[], 'Encode', Context, {}, Type>> = Result;
11308
11522
 
@@ -11497,6 +11711,8 @@ declare type SubagentResultMessage = CustomMessage<SubagentResultDetails> & {
11497
11711
  readonly display: boolean;
11498
11712
  };
11499
11713
 
11714
+ export declare function submit(label: string): KayAppCardLayout;
11715
+
11500
11716
  export declare interface SummarizeSessionInput {
11501
11717
  readonly sessions: KayAppSessions;
11502
11718
  readonly models: KayAppModels;
@@ -11508,6 +11724,8 @@ export declare interface SummarizeSessionInput {
11508
11724
 
11509
11725
  declare const SUMMARY_VERSION: 4;
11510
11726
 
11727
+ export declare function switchField(name: string, options: KayAppCardFieldOptions): KayAppCardLayout;
11728
+
11511
11729
  /** Creates a Symbol type. */
11512
11730
  declare function Symbol_2(options?: TSchemaOptions): TSymbol;
11513
11731
 
@@ -12526,6 +12744,8 @@ declare type TExprTermTail<Input extends string> = ((Token.TConst<'&', Input> ex
12526
12744
 
12527
12745
  declare type TExprTermTailMapping<Input extends [unknown, unknown, unknown] | []> = (Input);
12528
12746
 
12747
+ export declare function textArea(name: string, options: KayAppCardFieldOptions): KayAppCardLayout;
12748
+
12529
12749
  declare interface TextContent {
12530
12750
  type: "text";
12531
12751
  text: string;
@@ -12674,6 +12894,8 @@ declare type TExtendsUnknown<Inferred extends TProperties, Left extends TUnknown
12674
12894
 
12675
12895
  declare type TExtendsVoid<Inferred extends TProperties, Left extends TVoid, Right extends TSchema> = (Right extends TVoid ? ExtendsResult_2.TExtendsTrue<Inferred> : TExtendsRight<Inferred, Left, Right>);
12676
12896
 
12897
+ export declare function textField(name: string, options: KayAppCardFieldOptions): KayAppCardLayout;
12898
+
12677
12899
  /** Applies an Extract action using the given types. */
12678
12900
  declare type TExtract<Left extends TSchema, Right extends TSchema> = (TExtractAction<Left, Right>);
12679
12901
 
@@ -13901,6 +14123,7 @@ declare const toolCallFailureCauseSchema: z.ZodObject<{
13901
14123
  errorName: z.ZodOptional<z.ZodString>;
13902
14124
  errorCode: z.ZodOptional<z.ZodString>;
13903
14125
  providerCode: z.ZodOptional<z.ZodString>;
14126
+ provider: z.ZodOptional<z.ZodString>;
13904
14127
  status: z.ZodOptional<z.ZodNumber>;
13905
14128
  editIndex: z.ZodOptional<z.ZodNumber>;
13906
14129
  occurrences: z.ZodOptional<z.ZodNumber>;
@@ -15508,6 +15731,33 @@ declare type UiActionMessage = CustomMessage<UiActionDetails> & {
15508
15731
  readonly display: true;
15509
15732
  };
15510
15733
 
15734
+ /**
15735
+ * Base UI element structure for v2
15736
+ */
15737
+ declare interface UIElement<T extends string = string, P = Record<string, unknown>> {
15738
+ /** Component type from the catalog */
15739
+ type: T;
15740
+ /** Component props */
15741
+ props: P;
15742
+ /** Child element keys (flat structure) */
15743
+ children?: string[];
15744
+ /** Visibility condition */
15745
+ visible?: VisibilityCondition;
15746
+ /** Event bindings — maps event names to action bindings */
15747
+ on?: Record<string, ActionBinding | ActionBinding[]>;
15748
+ /** Repeat children once per item in a state array */
15749
+ repeat?: {
15750
+ statePath: string;
15751
+ key?: string;
15752
+ };
15753
+ /**
15754
+ * State watchers — maps JSON Pointer state paths to action bindings.
15755
+ * When the value at a watched path changes, the bound actions fire.
15756
+ * Useful for cascading dependencies (e.g. country → city option loading).
15757
+ */
15758
+ watch?: Record<string, ActionBinding | ActionBinding[]>;
15759
+ }
15760
+
15511
15761
  /** Applies a Uncapitalize action to the given type. */
15512
15762
  declare function Uncapitalize_2<Type extends TSchema>(type: Type, options?: TSchemaOptions): TUncapitalize<Type>;
15513
15763
 
@@ -15652,6 +15902,11 @@ declare type UriClaim = UriSchemeClaim | UriPatternClaim | UrlPatternClaim;
15652
15902
  * - `base64`: unpadded base64 of the UTF-8 text (`{base64(:id :calendar)}`).
15653
15903
  * - `slackTimestamp`: a Slack archive message token as the API's timestamp
15654
15904
  * (`p1783350000000100` becomes `1783350000.000100`).
15905
+ * - `beforeColon`: the part of a `<team>:<user>` id before the colon. It fills nothing for an id
15906
+ * with no colon or nothing before it.
15907
+ * - `beforeTilde`: the part of an id before its last `~`. It fills nothing with no `~`.
15908
+ * - `encoded`: every reserved character escaped, `:` and `@` too, for a whole URL carried as a
15909
+ * query value (`continue={encoded(:url)}`).
15655
15910
  *
15656
15911
  * A transform that cannot read its input fills nothing. A claim whose `normalizeTo` fills nothing
15657
15912
  * does not match; a `sourceUrl` that fills nothing paints no link.
@@ -15893,6 +16148,13 @@ declare interface UriModule_2 {
15893
16148
  readonly uri: string;
15894
16149
  readonly payload: unknown;
15895
16150
  }, ctx: UriResolveContext): Promise<UriOperationDescription | undefined>;
16151
+ /**
16152
+ * Find the web address of `uri` by asking the provider, for a resource whose address alone can't
16153
+ * name its page. Called only when someone opens the address, under the account it means, and never
16154
+ * to draw a reference. `undefined` means there's no page to open. A plugin module that defines
16155
+ * this sets `looksUpWebLinks` in its manifest.
16156
+ */
16157
+ lookupWebLink?(uri: string, ctx: UriResolveContext): Promise<string | undefined>;
15896
16158
  /**
15897
16159
  * Set false when the generic write tool must reject `source` copies before
15898
16160
  * fetching the source. Inline `content` writes remain available.
@@ -16090,6 +16352,11 @@ declare interface UriOperationDescription {
16090
16352
  readonly editable?: true;
16091
16353
  /** Longest edited value, in UTF-16 code units. Meaningful only with `editable`. */
16092
16354
  readonly maxLength?: number;
16355
+ /**
16356
+ * Which part of a message this field is, when the call sends one. A preview with a `to` and
16357
+ * a `text` is drawn as a message; without them it stays labelled rows.
16358
+ */
16359
+ readonly part?: "to" | "cc" | "bcc" | "subject" | "text";
16093
16360
  }[];
16094
16361
  };
16095
16362
  /** True only when every displayed fact comes from the input, independent of the executing account. */
@@ -16816,6 +17083,16 @@ declare type VendoredMcpOutcome =
16816
17083
  readonly serviceId?: string;
16817
17084
  };
16818
17085
 
17086
+ /**
17087
+ * Visibility condition types.
17088
+ * - `boolean` — always/never
17089
+ * - `SingleCondition` — single condition (`$state`, `$item`, or `$index`)
17090
+ * - `SingleCondition[]` — implicit AND (all must be true)
17091
+ * - `AndCondition` — `{ $and: [...] }`, explicit AND (all must be true)
17092
+ * - `OrCondition` — `{ $or: [...] }`, at least one must be true
17093
+ */
17094
+ declare type VisibilityCondition = boolean | SingleCondition | SingleCondition[] | AndCondition | OrCondition;
17095
+
16819
17096
  /** Creates a Void type. */
16820
17097
  declare function Void(options?: TSchemaOptions): TVoid;
16821
17098
 
@@ -16935,9 +17212,6 @@ export declare const WhiteboardTypeInfo: z.ZodObject<{
16935
17212
  displayName: z.ZodString;
16936
17213
  schemaVersion: z.ZodNumber;
16937
17214
  available: z.ZodBoolean;
16938
- presentation: z.ZodOptional<z.ZodObject<{
16939
- app: z.ZodString;
16940
- }, z.core.$strict>>;
16941
17215
  }, z.core.$strict>;
16942
17216
 
16943
17217
  export declare type WhiteboardTypeInfo = Readonly<z.infer<typeof WhiteboardTypeInfo>>;
package/dist/kay-app.js CHANGED
@@ -70,6 +70,65 @@ var JsonValue = z.lazy(() => z.union([
70
70
  var JsonObject = z.record(z.string(), JsonValue);
71
71
  var JsonSchema = z.record(z.string(), JsonValue);
72
72
 
73
+ // packages/plugin-sdk/dist/kay-app/card-layout.js
74
+ function element(type, props) {
75
+ return { root: "root", elements: { root: { type, props } } };
76
+ }
77
+ function group(type, props, children) {
78
+ const layout = element(type, props);
79
+ layout.elements.root.children = children.map((child, index) => {
80
+ const prefix = `${index}-`;
81
+ for (const [key, value] of Object.entries(child.elements)) {
82
+ layout.elements[prefix + key] = {
83
+ ...value,
84
+ ...value.children ? { children: value.children.map((id) => prefix + id) } : {}
85
+ };
86
+ }
87
+ return prefix + child.root;
88
+ });
89
+ return layout;
90
+ }
91
+ function card(title, children, state) {
92
+ return { ...group("Card", { title }, children), ...state ? { state } : {} };
93
+ }
94
+ function row(children) {
95
+ return group("Row", {}, children);
96
+ }
97
+ function stack(children) {
98
+ return group("Stack", {}, children);
99
+ }
100
+ function field(type, name, options) {
101
+ const key = name.replaceAll("~", "~0").replaceAll("/", "~1");
102
+ return element(type, { ...options, value: { $bindState: `/form/${key}` } });
103
+ }
104
+ function textField(name, options) {
105
+ return field("Field", name, options);
106
+ }
107
+ function textArea(name, options) {
108
+ return field("TextArea", name, options);
109
+ }
110
+ function select(name, options) {
111
+ return field("Select", name, options);
112
+ }
113
+ function multiSelect(name, options) {
114
+ return field("MultiSelect", name, options);
115
+ }
116
+ function switchField(name, options) {
117
+ return field("Switch", name, options);
118
+ }
119
+ function submit(label) {
120
+ return {
121
+ root: "root",
122
+ elements: {
123
+ root: {
124
+ type: "Button",
125
+ props: { label },
126
+ on: { press: { action: "submit" } }
127
+ }
128
+ }
129
+ };
130
+ }
131
+
73
132
  // packages/plugin-sdk/dist/signals.js
74
133
  import { z as z2 } from "zod";
75
134
  function createFallbackOnlySignals() {
@@ -125,8 +184,8 @@ var quoted = (value) => JSON.stringify(value.length > 40 ? `${value.slice(0, 40)
125
184
  function grammarProblem(input) {
126
185
  const shape = ObserveShape.safeParse(input);
127
186
  if (!shape.success) {
128
- const field = shape.error.issues[0]?.path.join(".") ?? "";
129
- return field === "" ? "`observe` takes an object with `detector`, `source`, `state`, and `questions`." : `\`${field}\` is missing or has the wrong type.`;
187
+ const field2 = shape.error.issues[0]?.path.join(".") ?? "";
188
+ return field2 === "" ? "`observe` takes an object with `detector`, `source`, `state`, and `questions`." : `\`${field2}\` is missing or has the wrong type.`;
130
189
  }
131
190
  const { detector, source, questions, subject, after, reuse } = shape.data;
132
191
  const { state } = input;
@@ -139,7 +198,7 @@ function grammarProblem(input) {
139
198
  if (!fits(detector.version, VERSION)) {
140
199
  return "`detector.version` must be at most 64 characters: letters and digits in parts joined by single `.`, `-`, or `_`.";
141
200
  }
142
- for (const [field, grammar, rule] of [
201
+ for (const [field2, grammar, rule] of [
143
202
  ["sessionId", POINTER, POINTER_RULE],
144
203
  ["entryId", POINTER, POINTER_RULE],
145
204
  ["openerEntryId", POINTER, POINTER_RULE],
@@ -149,9 +208,9 @@ function grammarProblem(input) {
149
208
  `1 to ${MAX_POINTER} characters with no control character`
150
209
  ]
151
210
  ]) {
152
- const id = source[field];
211
+ const id = source[field2];
153
212
  if (id !== void 0 && !(id.length <= MAX_POINTER && grammar.test(id))) {
154
- return `\`source.${field}\` must be ${rule}.`;
213
+ return `\`source.${field2}\` must be ${rule}.`;
155
214
  }
156
215
  }
157
216
  const occurredAtMs = source.occurredAtMs;
@@ -964,6 +1023,7 @@ export {
964
1023
  UriProviderError,
965
1024
  UriUnsupportedOperationError,
966
1025
  UriValidationError,
1026
+ card,
967
1027
  createConsoleKayPluginLog,
968
1028
  createFallbackOnlySignals,
969
1029
  createKayPluginLog,
@@ -976,12 +1036,20 @@ export {
976
1036
  invalidObservation,
977
1037
  isCredentialShapedText,
978
1038
  isRetryable,
1039
+ multiSelect,
979
1040
  parseLineSelector,
980
1041
  parseStoredTranscriptKindFilter,
981
1042
  pathToFileURL,
982
1043
  payload,
983
1044
  requireWriteContent,
1045
+ row,
1046
+ select,
1047
+ stack,
984
1048
  storedTranscriptKindOf,
1049
+ submit,
1050
+ switchField,
1051
+ textArea,
1052
+ textField,
985
1053
  transcriptMessageText,
986
1054
  transcriptMessageTexts,
987
1055
  transcriptRoleLabel,
@@ -377,6 +377,11 @@ declare type UriClaim = UriSchemeClaim | UriPatternClaim | UrlPatternClaim;
377
377
  * - `base64`: unpadded base64 of the UTF-8 text (`{base64(:id :calendar)}`).
378
378
  * - `slackTimestamp`: a Slack archive message token as the API's timestamp
379
379
  * (`p1783350000000100` becomes `1783350000.000100`).
380
+ * - `beforeColon`: the part of a `<team>:<user>` id before the colon. It fills nothing for an id
381
+ * with no colon or nothing before it.
382
+ * - `beforeTilde`: the part of an id before its last `~`. It fills nothing with no `~`.
383
+ * - `encoded`: every reserved character escaped, `:` and `@` too, for a whole URL carried as a
384
+ * query value (`continue={encoded(:url)}`).
380
385
  *
381
386
  * A transform that cannot read its input fills nothing. A claim whose `normalizeTo` fills nothing
382
387
  * does not match; a `sourceUrl` that fills nothing paints no link.
@@ -635,6 +640,13 @@ declare interface UriModule {
635
640
  readonly uri: string;
636
641
  readonly payload: unknown;
637
642
  }, ctx: UriResolveContext): Promise<UriOperationDescription | undefined>;
643
+ /**
644
+ * Find the web address of `uri` by asking the provider, for a resource whose address alone can't
645
+ * name its page. Called only when someone opens the address, under the account it means, and never
646
+ * to draw a reference. `undefined` means there's no page to open. A plugin module that defines
647
+ * this sets `looksUpWebLinks` in its manifest.
648
+ */
649
+ lookupWebLink?(uri: string, ctx: UriResolveContext): Promise<string | undefined>;
638
650
  readonly getCachePolicy?: UriCachePolicyResolver;
639
651
  /**
640
652
  * Code matching, for the host's own modules whose addresses no claim can describe (a bare file
@@ -756,6 +768,11 @@ declare interface UriOperationDescription {
756
768
  readonly editable?: true;
757
769
  /** Longest edited value, in UTF-16 code units. Meaningful only with `editable`. */
758
770
  readonly maxLength?: number;
771
+ /**
772
+ * Which part of a message this field is, when the call sends one. A preview with a `to` and
773
+ * a `text` is drawn as a message; without them it stays labelled rows.
774
+ */
775
+ readonly part?: "to" | "cc" | "bcc" | "subject" | "text";
759
776
  }[];
760
777
  };
761
778
  /** True only when every displayed fact comes from the input, independent of the executing account. */