@yaklabs-ai/plugin-sdk 0.48.0 → 0.49.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
@@ -830,6 +830,12 @@ declare function ConstructorParameters_2<Type extends TSchema>(type: Type, optio
830
830
  /** Creates a deferred ConstructorParameters action. */
831
831
  declare function ConstructorParametersDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TConstructorParametersDeferred<Type>;
832
832
 
833
+ /**
834
+ * Stable digest of a read's content, the revision a module without one gets.
835
+ * Prefixed so a provider revision can never collide with it by accident.
836
+ */
837
+ export declare function contentDigest(content: string | Uint8Array): string;
838
+
833
839
  export declare interface CorpusResourceInvocation {
834
840
  readonly eventId: string;
835
841
  /** Envelope recording time, never a run/message/incident identifier. */
@@ -964,6 +970,8 @@ export declare function createUnavailableSkills(message: string): KayAppSkills;
964
970
  */
965
971
  export declare function createUnavailableTools(): KayAppTools;
966
972
 
973
+ export declare function createUnavailableUriCaller(message: string): PluginUriCaller;
974
+
967
975
  /**
968
976
  * A `KayAppUsage` that answers `unavailable` to every call: what a host with no telemetry lane
969
977
  * binds, so `app.usage` stays present on every host.
@@ -1139,6 +1147,9 @@ declare interface Decision<Q extends DecideQuestions = DecideQuestions> {
1139
1147
  readonly usage?: SystemOneTokenUsage;
1140
1148
  }
1141
1149
 
1150
+ /** Builds an app tool from manifest facts, retaining its execution, availability and preview callbacks. */
1151
+ export declare function declaredAppToolDefinition(tool: ToolContribution, implementation: KayAppToolImplementation): KayAppToolDefinition;
1152
+
1142
1153
  /** Createsa uni-directional Codec with Decode only. The Decode function is called on Value.Decode */
1143
1154
  declare function Decode<Type extends TSchema, Callback extends TDecodeCallback<StaticDecode<Type>, unknown>>(type: Type, callback: Callback): TCodec<Type, ReturnType<Callback>>;
1144
1155
 
@@ -2882,8 +2893,15 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2882
2893
  * 0.47.0 adds card layouts and builders; successful card submits now require a summary.
2883
2894
  *
2884
2895
  * 0.48.0 adds the models.complete UI capability.
2896
+ *
2897
+ * 0.48.1 adds app-tool metadata, conditional tool permissions and screen-action declarations.
2898
+ *
2899
+ * 0.49.0 adds sessionless URI calls on both backend targets. It removes app.memory and its note
2900
+ * types; callers use the resource surface instead. Previously admitted SDK contracts are no
2901
+ * longer served because they included app.memory on notebook hosts. No compatibility alias
2902
+ * restores it; callers migrate and declare ^0.49.0.
2885
2903
  */
2886
- declare const KAY_PLUGIN_SDK_VERSION: "0.48.0";
2904
+ declare const KAY_PLUGIN_SDK_VERSION: "0.49.0";
2887
2905
 
2888
2906
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2889
2907
 
@@ -4823,60 +4841,6 @@ export declare interface KayAppMcp {
4823
4841
  }): Promise<VendoredMcpOutcome>;
4824
4842
  }
4825
4843
 
4826
- /**
4827
- * Notes through Memory's ordinary notebook operations, without a chat session. Each call checks
4828
- * `memory.read` or `memory.write`; a missing notebook or refused grant rejects. Paths are note
4829
- * addresses such as `facts/this-computer`, without the `memory://` scheme.
4830
- */
4831
- export declare interface KayAppMemory {
4832
- read(path: string): Promise<KayAppMemoryNote | undefined>;
4833
- /** Create a note; an existing address is a conflict. */
4834
- create(path: string, input: KayAppMemoryNoteInput, options?: {
4835
- readonly signal?: AbortSignal;
4836
- }): Promise<void>;
4837
- /** Edit only the revision returned by `read`; concurrent changes reject as a conflict. */
4838
- edit(path: string, input: KayAppMemoryNoteEdit, options: {
4839
- readonly expectedRevision: string;
4840
- }): Promise<void>;
4841
- }
4842
-
4843
- export declare interface KayAppMemoryNote {
4844
- readonly name: string;
4845
- readonly description: string;
4846
- readonly body: string;
4847
- readonly frontmatter: Readonly<Record<string, unknown>> | undefined;
4848
- readonly revision: string;
4849
- }
4850
-
4851
- export declare interface KayAppMemoryNoteEdit {
4852
- readonly frontmatter?: {
4853
- readonly name?: string;
4854
- readonly description?: string;
4855
- };
4856
- readonly body?: {
4857
- readonly replace: string;
4858
- } | {
4859
- readonly edits: readonly {
4860
- readonly oldText: string;
4861
- readonly newText: string;
4862
- }[];
4863
- };
4864
- }
4865
-
4866
- export declare interface KayAppMemoryNoteInput {
4867
- readonly name: string;
4868
- readonly description: string;
4869
- readonly body: string;
4870
- readonly sources?: readonly KayAppMemoryNoteSource[];
4871
- }
4872
-
4873
- export declare interface KayAppMemoryNoteSource {
4874
- readonly id: string;
4875
- readonly uri: string;
4876
- readonly kind?: "user" | "source";
4877
- readonly at?: string;
4878
- }
4879
-
4880
4844
  /** Input to one bounded direct model completion with no transcript or tools. */
4881
4845
  export declare interface KayAppModelCompleteInput {
4882
4846
  /** Attribution slug (`^[a-z][a-z0-9-]*$`) naming what this call is for. */
@@ -5489,8 +5453,7 @@ export declare interface KayAppPluginApi {
5489
5453
  * present, like {@link signals}.
5490
5454
  */
5491
5455
  readonly skills: KayAppSkills;
5492
- /** Memory note operations; absent when this host has no notebook composition. */
5493
- readonly memory?: KayAppMemory;
5456
+ readonly uri: PluginUriCaller;
5494
5457
  /**
5495
5458
  * Private API: only plugins Bonsai ships; refused for any other. The assistant's personality
5496
5459
  * file, each call checked against `soul.write`. Absent when the host composed no soul store.
@@ -7862,6 +7825,10 @@ export declare interface KayAppToolEvents {
7862
7825
  subscribe(handler: (event: unknown) => void): () => void;
7863
7826
  }
7864
7827
 
7828
+ export declare type KayAppToolImplementation = Omit<KayAppToolDefinition, "label" | "description" | "parameters" | "permission" | "executionMode" | "promptSnippet" | "promptGuidelines"> & {
7829
+ readonly permission?: Pick<ToolPermissionHint, "describePreview">;
7830
+ };
7831
+
7865
7832
  /** Where a described tool or address comes from. */
7866
7833
  export declare type KayAppToolOrigin =
7867
7834
  /** The agent kernel's own (`bash`, `read`, `help`, `skill://`). */
@@ -10169,6 +10136,38 @@ declare const PluginToolName: z.ZodString;
10169
10136
 
10170
10137
  declare type PluginToolName = z.infer<typeof PluginToolName>;
10171
10138
 
10139
+ /**
10140
+ * Sessionless resource calls. Each call checks the calling target's exact scheme and verb grant.
10141
+ * Results retain provider bytes, metadata and revisions; provider failures retain their URI tags.
10142
+ * A cancellation or lost response does not prove a mutation was not applied.
10143
+ */
10144
+ export declare interface PluginUriCaller {
10145
+ read(input: string, options?: PluginUriReadOptions): Promise<RawResource>;
10146
+ list(input: string, params?: UriListParams, options?: PluginUriCallOptions): Promise<UriListResult>;
10147
+ search(input: string, params: UriSearchParams, options?: PluginUriCallOptions): Promise<UriSearchResult>;
10148
+ write(input: string, content?: UriPayload | Uint8Array, options?: PluginUriWriteOptions): Promise<UriMutationResult | void>;
10149
+ edit(input: string, payload: UriPayload, options?: PluginUriMutationOptions): Promise<UriMutationResult>;
10150
+ delete(input: string, options?: PluginUriMutationOptions): Promise<UriMutationResult>;
10151
+ }
10152
+
10153
+ export declare interface PluginUriCallOptions {
10154
+ readonly cwd?: string;
10155
+ readonly signal?: AbortSignal;
10156
+ }
10157
+
10158
+ export declare interface PluginUriMutationOptions extends PluginUriCallOptions {
10159
+ readonly expectedRevision?: string;
10160
+ }
10161
+
10162
+ export declare interface PluginUriReadOptions extends PluginUriCallOptions {
10163
+ readonly knownRevision?: string;
10164
+ }
10165
+
10166
+ export declare interface PluginUriWriteOptions extends PluginUriMutationOptions {
10167
+ readonly sources?: readonly UriWriteSource[];
10168
+ readonly writeSource?: UriSourceDescriptor;
10169
+ }
10170
+
10172
10171
  export declare interface PreparedAccessApproval {
10173
10172
  readonly uri: string;
10174
10173
  readonly content: Record<string, unknown>;
@@ -14200,6 +14199,56 @@ declare interface ToolContext {
14200
14199
  readonly paths?: ExtensionPaths;
14201
14200
  }
14202
14201
 
14202
+ export declare const ToolContribution: z.ZodObject<{
14203
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<authoringCommonSchemas.JsonValue, unknown, z.core.$ZodTypeInternals<authoringCommonSchemas.JsonValue, unknown>>>>;
14204
+ executionMode: z.ZodOptional<z.ZodEnum<{
14205
+ sequential: "sequential";
14206
+ parallel: "parallel";
14207
+ }>>;
14208
+ promptSnippet: z.ZodOptional<z.ZodString>;
14209
+ promptGuidelines: z.ZodOptional<z.ZodArray<z.ZodString>>;
14210
+ permission: z.ZodOptional<z.ZodObject<{
14211
+ kind: z.ZodEnum<{
14212
+ read: "read";
14213
+ mutate: "mutate";
14214
+ destructive: "destructive";
14215
+ execute: "execute";
14216
+ }>;
14217
+ ruleKey: z.ZodOptional<z.ZodString>;
14218
+ scheme: z.ZodOptional<z.ZodString>;
14219
+ resourcePrefix: z.ZodOptional<z.ZodString>;
14220
+ resourceArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
14221
+ resourceTrim: z.ZodOptional<z.ZodLiteral<true>>;
14222
+ defaultPermission: z.ZodOptional<z.ZodEnum<{
14223
+ never: "never";
14224
+ allow: "allow";
14225
+ ask: "ask";
14226
+ }>>;
14227
+ classificationRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
14228
+ when: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
14229
+ arg: z.ZodString;
14230
+ equals: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
14231
+ }, z.core.$strict>, z.ZodObject<{
14232
+ arg: z.ZodString;
14233
+ present: z.ZodBoolean;
14234
+ }, z.core.$strict>]>>;
14235
+ kind: z.ZodEnum<{
14236
+ read: "read";
14237
+ mutate: "mutate";
14238
+ destructive: "destructive";
14239
+ execute: "execute";
14240
+ }>;
14241
+ ruleKey: z.ZodOptional<z.ZodString>;
14242
+ }, z.core.$strict>>>;
14243
+ }, z.core.$strict>>;
14244
+ localId: z.ZodString;
14245
+ toolName: z.ZodString;
14246
+ displayName: z.ZodOptional<z.ZodString>;
14247
+ description: z.ZodOptional<z.ZodString>;
14248
+ }, z.core.$strict>;
14249
+
14250
+ export declare type ToolContribution = z.infer<typeof ToolContribution>;
14251
+
14203
14252
  export declare interface ToolDefinition<TParams extends ToolParametersWire = ToolParametersWire, TDetails = unknown> {
14204
14253
  /** Tool name (used in LLM tool calls) */
14205
14254
  name: string;
@@ -16585,6 +16634,8 @@ declare interface UriResolveContext_2 {
16585
16634
  * resolve a URI outside any verb call.
16586
16635
  */
16587
16636
  readonly sessionId?: string;
16637
+ /** Host-stamped calling plugin; absent for session dispatch and resolver matching. */
16638
+ readonly callerPluginId?: string;
16588
16639
  /**
16589
16640
  * WHO the dispatching session acts as, stamped by the host at the same dispatch site as
16590
16641
  * {@link UriResolveContext.sessionId} and just as un-influenceable by the caller - so a module