@yaklabs-ai/plugin-sdk 0.42.0 → 0.42.1

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/README.md CHANGED
@@ -13,7 +13,7 @@ it under the name your plugin code actually imports:
13
13
  ```json
14
14
  {
15
15
  "dependencies": {
16
- "@bonsai/plugin-sdk": "npm:@yaklabs-ai/plugin-sdk@^0.42.0"
16
+ "@bonsai/plugin-sdk": "npm:@yaklabs-ai/plugin-sdk@^0.42.1"
17
17
  }
18
18
  }
19
19
  ```
@@ -62,7 +62,7 @@ Every tool the entrypoint registers is declared in the manifest too:
62
62
  "description": "Greets people by name.",
63
63
  "version": "0.1.0",
64
64
  "namespace": "widgets",
65
- "compatibility": { "sdk": "^0.42.0" },
65
+ "compatibility": { "sdk": "^0.42.1" },
66
66
  "targets": {
67
67
  "kay": {
68
68
  "agent": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "package": "@yaklabs-ai/plugin-sdk",
4
- "version": "0.42.0",
4
+ "version": "0.42.1",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [
@@ -2421,8 +2421,11 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2421
2421
  * 0.42.0 hands background work the shared ResolvedCredential in auth.credential. Workflow
2422
2422
  * accounts carry auth resolution outcomes, and Poller callbacks receive only the credential.
2423
2423
  * Older SDK ranges are refused because their background success shape is no longer served.
2424
+ *
2425
+ * 0.42.1 adds current-session tool lifetimes and invocation-bound artifact reads/new outputs,
2426
+ * plus described-tool execution, guidance and permission resource metadata.
2424
2427
  */
2425
- declare const KAY_PLUGIN_SDK_VERSION: "0.42.0";
2428
+ declare const KAY_PLUGIN_SDK_VERSION: "0.42.1";
2426
2429
 
2427
2430
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2428
2431
 
@@ -2871,8 +2874,42 @@ declare interface KayAgentProcessRunResult {
2871
2874
  readonly stderrTruncated?: boolean;
2872
2875
  }
2873
2876
 
2877
+ /** A loaded session's volatile lifetime. Reopening a released session gets a fresh key. */
2878
+ declare interface KayAgentSession {
2879
+ readonly key: string;
2880
+ /** Registers synchronous cleanup, invoked once on release. Returns an unregister function. */
2881
+ onDispose(disposer: () => void): () => void;
2882
+ /** Valid only while this tool call is active. */
2883
+ readonly artifacts: KayAgentSessionArtifacts;
2884
+ }
2885
+
2886
+ /** Metadata returned by a current-session artifact operation; no filesystem authority. */
2887
+ declare interface KayAgentSessionArtifact {
2888
+ readonly uri: string;
2889
+ readonly name: string;
2890
+ readonly mimeType?: string;
2891
+ }
2892
+
2893
+ /** Current-session file access, authorized at each call; never retained between tool calls. */
2894
+ declare interface KayAgentSessionArtifacts {
2895
+ readBytes(input: {
2896
+ readonly uri: string;
2897
+ readonly maxBytes?: number;
2898
+ }): Promise<KayAgentSessionArtifact & {
2899
+ readonly bytes: Uint8Array;
2900
+ }>;
2901
+ publishNew(input: {
2902
+ readonly name: string;
2903
+ readonly bytes: Uint8Array;
2904
+ }): Promise<KayAgentSessionArtifact>;
2905
+ }
2906
+
2907
+ declare type KayAgentToolContext = Parameters<ToolDefinition["execute"]>[4] & {
2908
+ readonly session?: KayAgentSession;
2909
+ };
2910
+
2874
2911
  /** The `execute` a plugin supplies for a tool its manifest describes. */
2875
- declare type KayAgentToolExecute = ToolDefinition["execute"];
2912
+ declare type KayAgentToolExecute = (toolCallId: string, params: Parameters<ToolDefinition["execute"]>[1], signal: AbortSignal | undefined, onUpdate: Parameters<ToolDefinition["execute"]>[3], ctx: KayAgentToolContext) => ReturnType<ToolDefinition["execute"]>;
2876
2913
 
2877
2914
  /**
2878
2915
  * Calls tools on the plugin's own vendored MCP servers. See {@link KayAgentPluginApi.vendoredMcp}.
@@ -3089,13 +3126,14 @@ declare interface KayAppUserFileEntry {
3089
3126
  * The plugin-facing user-files contract: file I/O in folders the user owns, done by the host on
3090
3127
  * its own worker threads.
3091
3128
  *
3092
- * Ungated and always present, like `app.paths`. It confers no authority: a plugin runs in the
3093
- * daemon's process and can call `node:fs` itself. What the door adds is where the work runs. A
3094
- * `node:fs` sync call blocks the daemon's event loop for as long as the path takes to answer,
3095
- * which under a macOS-protected folder or on a drive that stopped answering can be a very long
3096
- * time (kay#11575); an async one holds a thread of the pool the whole daemon shares. The host runs
3097
- * each request on a dedicated worker, gives it a deadline, and answers a typed result instead of
3098
- * throwing.
3129
+ * Ungated and always present, like `app.paths`. It confers no authority: the process a plugin
3130
+ * runs in, the daemon or the plugin host, could call `node:fs` itself. What the door adds is where
3131
+ * the work runs. A `node:fs` sync call blocks that process's event loop for as long as the path
3132
+ * takes to answer, which under a macOS-protected folder or on a drive that stopped answering can
3133
+ * be a very long time (kay#11575); an async one holds a thread of the pool the whole process
3134
+ * shares. The daemon's user-files service runs each request on a dedicated worker, gives it a
3135
+ * deadline, and answers a typed result instead of throwing. A plugin in the plugin host reaches
3136
+ * the same service: each call is sent to the daemon and answered from there.
3099
3137
  *
3100
3138
  * This is a leaf module. It lives beside both target SDKs, like `time.ts`, so the `kay.agent` SDK
3101
3139
  * exposes the same door without importing the `kay.app` surface.
@@ -3136,7 +3174,12 @@ declare interface KayAppUserFiles {
3136
3174
  }
3137
3175
 
3138
3176
  declare interface KayAppUserFilesCallOptions {
3139
- /** Deadline in milliseconds from the call, waiting included. Default 5000, at most 60000. */
3177
+ /**
3178
+ * Deadline in milliseconds, waiting included. Default 5000, at most 60000. It starts when the
3179
+ * daemon's user-files service receives the request: from the call in the daemon, or, for a
3180
+ * plugin in the plugin host, once the request has crossed to the daemon. A daemon that never
3181
+ * reads the request leaves the call waiting until the host's connection to it is closed.
3182
+ */
3140
3183
  readonly timeoutMs?: number;
3141
3184
  readonly signal?: AbortSignal;
3142
3185
  }
@@ -1629,7 +1629,7 @@ declare class InvalidLiteralValue extends Error {
1629
1629
  * `ctx` (with a `credential` for an auth-gated tool) to exercise anything beyond the
1630
1630
  * happy-path default.
1631
1631
  */
1632
- export declare function invokeToolForTest<TDetails = unknown>(tool: ToolDefinition<any, TDetails>, params: Record<string, unknown>, ctx?: ToolContext): Promise<AgentToolResult<TDetails>>;
1632
+ export declare function invokeToolForTest<TDetails = unknown>(tool: ToolDefinition<any, TDetails>, params: Record<string, unknown>, ctx?: KayAgentToolContext): Promise<AgentToolResult<TDetails>>;
1633
1633
 
1634
1634
  /** Returns true if the given value is a TAny. */
1635
1635
  declare function IsAny(value: unknown): value is TAny;
@@ -2475,8 +2475,11 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2475
2475
  * 0.42.0 hands background work the shared ResolvedCredential in auth.credential. Workflow
2476
2476
  * accounts carry auth resolution outcomes, and Poller callbacks receive only the credential.
2477
2477
  * Older SDK ranges are refused because their background success shape is no longer served.
2478
+ *
2479
+ * 0.42.1 adds current-session tool lifetimes and invocation-bound artifact reads/new outputs,
2480
+ * plus described-tool execution, guidance and permission resource metadata.
2478
2481
  */
2479
- declare const KAY_PLUGIN_SDK_VERSION: "0.42.0";
2482
+ declare const KAY_PLUGIN_SDK_VERSION: "0.42.1";
2480
2483
 
2481
2484
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2482
2485
 
@@ -2922,8 +2925,42 @@ declare interface KayAgentProcessRunResult {
2922
2925
  readonly stderrTruncated?: boolean;
2923
2926
  }
2924
2927
 
2928
+ /** A loaded session's volatile lifetime. Reopening a released session gets a fresh key. */
2929
+ declare interface KayAgentSession {
2930
+ readonly key: string;
2931
+ /** Registers synchronous cleanup, invoked once on release. Returns an unregister function. */
2932
+ onDispose(disposer: () => void): () => void;
2933
+ /** Valid only while this tool call is active. */
2934
+ readonly artifacts: KayAgentSessionArtifacts;
2935
+ }
2936
+
2937
+ /** Metadata returned by a current-session artifact operation; no filesystem authority. */
2938
+ declare interface KayAgentSessionArtifact {
2939
+ readonly uri: string;
2940
+ readonly name: string;
2941
+ readonly mimeType?: string;
2942
+ }
2943
+
2944
+ /** Current-session file access, authorized at each call; never retained between tool calls. */
2945
+ declare interface KayAgentSessionArtifacts {
2946
+ readBytes(input: {
2947
+ readonly uri: string;
2948
+ readonly maxBytes?: number;
2949
+ }): Promise<KayAgentSessionArtifact & {
2950
+ readonly bytes: Uint8Array;
2951
+ }>;
2952
+ publishNew(input: {
2953
+ readonly name: string;
2954
+ readonly bytes: Uint8Array;
2955
+ }): Promise<KayAgentSessionArtifact>;
2956
+ }
2957
+
2958
+ declare type KayAgentToolContext = Parameters<ToolDefinition["execute"]>[4] & {
2959
+ readonly session?: KayAgentSession;
2960
+ };
2961
+
2925
2962
  /** The `execute` a plugin supplies for a tool its manifest describes. */
2926
- declare type KayAgentToolExecute = ToolDefinition["execute"];
2963
+ declare type KayAgentToolExecute = (toolCallId: string, params: Parameters<ToolDefinition["execute"]>[1], signal: AbortSignal | undefined, onUpdate: Parameters<ToolDefinition["execute"]>[3], ctx: KayAgentToolContext) => ReturnType<ToolDefinition["execute"]>;
2927
2964
 
2928
2965
  /**
2929
2966
  * Calls tools on the plugin's own vendored MCP servers. See {@link KayAgentPluginApi.vendoredMcp}.
@@ -3140,13 +3177,14 @@ declare interface KayAppUserFileEntry {
3140
3177
  * The plugin-facing user-files contract: file I/O in folders the user owns, done by the host on
3141
3178
  * its own worker threads.
3142
3179
  *
3143
- * Ungated and always present, like `app.paths`. It confers no authority: a plugin runs in the
3144
- * daemon's process and can call `node:fs` itself. What the door adds is where the work runs. A
3145
- * `node:fs` sync call blocks the daemon's event loop for as long as the path takes to answer,
3146
- * which under a macOS-protected folder or on a drive that stopped answering can be a very long
3147
- * time (kay#11575); an async one holds a thread of the pool the whole daemon shares. The host runs
3148
- * each request on a dedicated worker, gives it a deadline, and answers a typed result instead of
3149
- * throwing.
3180
+ * Ungated and always present, like `app.paths`. It confers no authority: the process a plugin
3181
+ * runs in, the daemon or the plugin host, could call `node:fs` itself. What the door adds is where
3182
+ * the work runs. A `node:fs` sync call blocks that process's event loop for as long as the path
3183
+ * takes to answer, which under a macOS-protected folder or on a drive that stopped answering can
3184
+ * be a very long time (kay#11575); an async one holds a thread of the pool the whole process
3185
+ * shares. The daemon's user-files service runs each request on a dedicated worker, gives it a
3186
+ * deadline, and answers a typed result instead of throwing. A plugin in the plugin host reaches
3187
+ * the same service: each call is sent to the daemon and answered from there.
3150
3188
  *
3151
3189
  * This is a leaf module. It lives beside both target SDKs, like `time.ts`, so the `kay.agent` SDK
3152
3190
  * exposes the same door without importing the `kay.app` surface.
@@ -3187,7 +3225,12 @@ declare interface KayAppUserFiles {
3187
3225
  }
3188
3226
 
3189
3227
  declare interface KayAppUserFilesCallOptions {
3190
- /** Deadline in milliseconds from the call, waiting included. Default 5000, at most 60000. */
3228
+ /**
3229
+ * Deadline in milliseconds, waiting included. Default 5000, at most 60000. It starts when the
3230
+ * daemon's user-files service receives the request: from the call in the daemon, or, for a
3231
+ * plugin in the plugin host, once the request has crossed to the daemon. A daemon that never
3232
+ * reads the request leaves the call waiting until the host's connection to it is closed.
3233
+ */
3191
3234
  readonly timeoutMs?: number;
3192
3235
  readonly signal?: AbortSignal;
3193
3236
  }
@@ -5499,6 +5542,12 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5499
5542
  displayName: z.ZodOptional<z.ZodString>;
5500
5543
  description: z.ZodOptional<z.ZodString>;
5501
5544
  parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<authoringCommonSchemas.JsonValue, unknown, z.core.$ZodTypeInternals<authoringCommonSchemas.JsonValue, unknown>>>>;
5545
+ executionMode: z.ZodOptional<z.ZodEnum<{
5546
+ sequential: "sequential";
5547
+ parallel: "parallel";
5548
+ }>>;
5549
+ promptSnippet: z.ZodOptional<z.ZodString>;
5550
+ promptGuidelines: z.ZodOptional<z.ZodArray<z.ZodString>>;
5502
5551
  requiresAuth: z.ZodOptional<z.ZodObject<{
5503
5552
  serviceId: z.ZodString;
5504
5553
  schemeId: z.ZodOptional<z.ZodString>;
@@ -5511,6 +5560,8 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5511
5560
  execute: "execute";
5512
5561
  }>;
5513
5562
  ruleKey: z.ZodOptional<z.ZodString>;
5563
+ scheme: z.ZodOptional<z.ZodString>;
5564
+ resourcePrefix: z.ZodOptional<z.ZodString>;
5514
5565
  resourceArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
5515
5566
  }, z.core.$strict>>;
5516
5567
  localId: z.ZodString;
@@ -124,14 +124,15 @@ function createKayPluginLog(write, bound = {}) {
124
124
 
125
125
  // packages/plugin-sdk/dist/kay-agent/declared-tool.js
126
126
  function permissionHint(permission) {
127
- const { kind, ruleKey, resourceArgs } = permission;
127
+ const { kind, ruleKey, resourceArgs, scheme, resourcePrefix } = permission;
128
128
  return {
129
129
  kind,
130
+ ...scheme === void 0 ? {} : { scheme },
130
131
  ...ruleKey === void 0 ? {} : { ruleKey },
131
132
  ...resourceArgs === void 0 ? {} : {
132
133
  deriveResources: (input) => resourceArgs.flatMap((arg) => {
133
134
  const value = input[arg];
134
- return typeof value === "string" ? [value] : [];
135
+ return typeof value === "string" ? [`${resourcePrefix ?? ""}${value}`] : [];
135
136
  })
136
137
  }
137
138
  };
@@ -146,6 +147,9 @@ function declaredToolDefinition(tool, execute) {
146
147
  label: tool.displayName ?? tool.toolName,
147
148
  description,
148
149
  parameters,
150
+ ...tool.executionMode === void 0 ? {} : { executionMode: tool.executionMode },
151
+ ...tool.promptSnippet === void 0 ? {} : { promptSnippet: tool.promptSnippet },
152
+ ...tool.promptGuidelines === void 0 ? {} : { promptGuidelines: tool.promptGuidelines },
149
153
  ...requiresAuth === void 0 ? {} : {
150
154
  requiresAuth: {
151
155
  serviceId: requiresAuth.serviceId,
@@ -2750,8 +2750,11 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2750
2750
  * 0.42.0 hands background work the shared ResolvedCredential in auth.credential. Workflow
2751
2751
  * accounts carry auth resolution outcomes, and Poller callbacks receive only the credential.
2752
2752
  * Older SDK ranges are refused because their background success shape is no longer served.
2753
+ *
2754
+ * 0.42.1 adds current-session tool lifetimes and invocation-bound artifact reads/new outputs,
2755
+ * plus described-tool execution, guidance and permission resource metadata.
2753
2756
  */
2754
- declare const KAY_PLUGIN_SDK_VERSION: "0.42.0";
2757
+ declare const KAY_PLUGIN_SDK_VERSION: "0.42.1";
2755
2758
 
2756
2759
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2757
2760
 
@@ -3229,8 +3232,42 @@ export declare interface KayAgentProcessRunResult {
3229
3232
  readonly stderrTruncated?: boolean;
3230
3233
  }
3231
3234
 
3235
+ /** A loaded session's volatile lifetime. Reopening a released session gets a fresh key. */
3236
+ export declare interface KayAgentSession {
3237
+ readonly key: string;
3238
+ /** Registers synchronous cleanup, invoked once on release. Returns an unregister function. */
3239
+ onDispose(disposer: () => void): () => void;
3240
+ /** Valid only while this tool call is active. */
3241
+ readonly artifacts: KayAgentSessionArtifacts;
3242
+ }
3243
+
3244
+ /** Metadata returned by a current-session artifact operation; no filesystem authority. */
3245
+ export declare interface KayAgentSessionArtifact {
3246
+ readonly uri: string;
3247
+ readonly name: string;
3248
+ readonly mimeType?: string;
3249
+ }
3250
+
3251
+ /** Current-session file access, authorized at each call; never retained between tool calls. */
3252
+ export declare interface KayAgentSessionArtifacts {
3253
+ readBytes(input: {
3254
+ readonly uri: string;
3255
+ readonly maxBytes?: number;
3256
+ }): Promise<KayAgentSessionArtifact & {
3257
+ readonly bytes: Uint8Array;
3258
+ }>;
3259
+ publishNew(input: {
3260
+ readonly name: string;
3261
+ readonly bytes: Uint8Array;
3262
+ }): Promise<KayAgentSessionArtifact>;
3263
+ }
3264
+
3265
+ export declare type KayAgentToolContext = Parameters<ToolDefinition["execute"]>[4] & {
3266
+ readonly session?: KayAgentSession;
3267
+ };
3268
+
3232
3269
  /** The `execute` a plugin supplies for a tool its manifest describes. */
3233
- export declare type KayAgentToolExecute = ToolDefinition["execute"];
3270
+ export declare type KayAgentToolExecute = (toolCallId: string, params: Parameters<ToolDefinition["execute"]>[1], signal: AbortSignal | undefined, onUpdate: Parameters<ToolDefinition["execute"]>[3], ctx: KayAgentToolContext) => ReturnType<ToolDefinition["execute"]>;
3234
3271
 
3235
3272
  /**
3236
3273
  * The facts a plugin declares about a URI module in its manifest (`contributes.uriModules[]`), so
@@ -3465,13 +3502,14 @@ export declare interface KayAppUserFileEntry {
3465
3502
  * The plugin-facing user-files contract: file I/O in folders the user owns, done by the host on
3466
3503
  * its own worker threads.
3467
3504
  *
3468
- * Ungated and always present, like `app.paths`. It confers no authority: a plugin runs in the
3469
- * daemon's process and can call `node:fs` itself. What the door adds is where the work runs. A
3470
- * `node:fs` sync call blocks the daemon's event loop for as long as the path takes to answer,
3471
- * which under a macOS-protected folder or on a drive that stopped answering can be a very long
3472
- * time (kay#11575); an async one holds a thread of the pool the whole daemon shares. The host runs
3473
- * each request on a dedicated worker, gives it a deadline, and answers a typed result instead of
3474
- * throwing.
3505
+ * Ungated and always present, like `app.paths`. It confers no authority: the process a plugin
3506
+ * runs in, the daemon or the plugin host, could call `node:fs` itself. What the door adds is where
3507
+ * the work runs. A `node:fs` sync call blocks that process's event loop for as long as the path
3508
+ * takes to answer, which under a macOS-protected folder or on a drive that stopped answering can
3509
+ * be a very long time (kay#11575); an async one holds a thread of the pool the whole process
3510
+ * shares. The daemon's user-files service runs each request on a dedicated worker, gives it a
3511
+ * deadline, and answers a typed result instead of throwing. A plugin in the plugin host reaches
3512
+ * the same service: each call is sent to the daemon and answered from there.
3475
3513
  *
3476
3514
  * This is a leaf module. It lives beside both target SDKs, like `time.ts`, so the `kay.agent` SDK
3477
3515
  * exposes the same door without importing the `kay.app` surface.
@@ -3512,7 +3550,12 @@ export declare interface KayAppUserFiles {
3512
3550
  }
3513
3551
 
3514
3552
  export declare interface KayAppUserFilesCallOptions {
3515
- /** Deadline in milliseconds from the call, waiting included. Default 5000, at most 60000. */
3553
+ /**
3554
+ * Deadline in milliseconds, waiting included. Default 5000, at most 60000. It starts when the
3555
+ * daemon's user-files service receives the request: from the call in the daemon, or, for a
3556
+ * plugin in the plugin host, once the request has crossed to the daemon. A daemon that never
3557
+ * reads the request leaves the call waiting until the host's connection to it is closed.
3558
+ */
3516
3559
  readonly timeoutMs?: number;
3517
3560
  readonly signal?: AbortSignal;
3518
3561
  }
@@ -5133,6 +5176,21 @@ declare const PluginCapabilityRefusalV1: z.ZodObject<{
5133
5176
  envelope: z.ZodObject<{
5134
5177
  source: z.ZodString;
5135
5178
  }, z.core.$strict>;
5179
+ }, z.core.$strict>, z.ZodObject<{
5180
+ target: z.ZodLiteral<"kay.agent">;
5181
+ slug: z.ZodLiteral<"session-artifacts.read">;
5182
+ envelope: z.ZodObject<{
5183
+ kind: z.ZodEnum<{
5184
+ output: "output";
5185
+ upload: "upload";
5186
+ }>;
5187
+ }, z.core.$strict>;
5188
+ }, z.core.$strict>, z.ZodObject<{
5189
+ target: z.ZodLiteral<"kay.agent">;
5190
+ slug: z.ZodLiteral<"session-artifacts.create">;
5191
+ envelope: z.ZodObject<{
5192
+ kind: z.ZodLiteral<"output">;
5193
+ }, z.core.$strict>;
5136
5194
  }, z.core.$strict>, z.ZodObject<{
5137
5195
  target: z.ZodLiteral<"kay.app">;
5138
5196
  slug: z.ZodLiteral<"artifacts.read">;
@@ -5477,7 +5535,7 @@ declare const PluginTargetName: z.ZodEnum<{
5477
5535
  declare type PluginTargetName = z.infer<typeof PluginTargetName>;
5478
5536
 
5479
5537
  export declare type PluginToolDefinition<TParams extends ToolParametersWire = ToolParametersWire, TDetails = unknown> = Omit<ToolDefinition<TParams, TDetails>, "execute"> & {
5480
- readonly execute: (toolCallId: string, params: ToolExecutionAwareParams<InferToolInput<TParams>>, signal: AbortSignal | undefined, onUpdate: AgentToolUpdateCallback<TDetails> | undefined, ctx: ToolContext) => Promise<AgentToolResult<TDetails>>;
5538
+ readonly execute: (toolCallId: string, params: ToolExecutionAwareParams<InferToolInput<TParams>>, signal: AbortSignal | undefined, onUpdate: AgentToolUpdateCallback<TDetails> | undefined, ctx: KayAgentToolContext) => Promise<AgentToolResult<TDetails>>;
5481
5539
  };
5482
5540
 
5483
5541
  declare const PluginToolName: z.ZodString;
@@ -9204,7 +9262,7 @@ export declare interface ToolDefinition<TParams extends ToolParametersWire = Too
9204
9262
  * The `execute` of a described tool for {@link KayAgentPluginApi.implementTool}: `body` receives
9205
9263
  * the call's arguments parsed by `schema`, the schema the manifest's `parameters` came from.
9206
9264
  */
9207
- export declare function toolExecute<TSchema extends z_2.ZodType>(schema: TSchema, body: (toolCallId: string, input: z_2.output<TSchema>, signal: AbortSignal | undefined, onUpdate: AgentToolUpdateCallback<unknown> | undefined, ctx: ToolContext) => Promise<AgentToolResult<unknown>>): KayAgentToolExecute;
9265
+ export declare function toolExecute<TSchema extends z_2.ZodType>(schema: TSchema, body: (toolCallId: string, input: z_2.output<TSchema>, signal: AbortSignal | undefined, onUpdate: AgentToolUpdateCallback<unknown> | undefined, ctx: KayAgentToolContext) => Promise<AgentToolResult<unknown>>): KayAgentToolExecute;
9208
9266
 
9209
9267
  /** Runtime execute input shape that always allows reserved execution directives. */
9210
9268
  export declare type ToolExecutionAwareParams<T> = T & {
package/dist/kay-app.d.ts CHANGED
@@ -2726,8 +2726,11 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2726
2726
  * 0.42.0 hands background work the shared ResolvedCredential in auth.credential. Workflow
2727
2727
  * accounts carry auth resolution outcomes, and Poller callbacks receive only the credential.
2728
2728
  * Older SDK ranges are refused because their background success shape is no longer served.
2729
+ *
2730
+ * 0.42.1 adds current-session tool lifetimes and invocation-bound artifact reads/new outputs,
2731
+ * plus described-tool execution, guidance and permission resource metadata.
2729
2732
  */
2730
- declare const KAY_PLUGIN_SDK_VERSION: "0.42.0";
2733
+ declare const KAY_PLUGIN_SDK_VERSION: "0.42.1";
2731
2734
 
2732
2735
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2733
2736
 
@@ -7926,13 +7929,14 @@ export declare interface KayAppUserFileEntry {
7926
7929
  * The plugin-facing user-files contract: file I/O in folders the user owns, done by the host on
7927
7930
  * its own worker threads.
7928
7931
  *
7929
- * Ungated and always present, like `app.paths`. It confers no authority: a plugin runs in the
7930
- * daemon's process and can call `node:fs` itself. What the door adds is where the work runs. A
7931
- * `node:fs` sync call blocks the daemon's event loop for as long as the path takes to answer,
7932
- * which under a macOS-protected folder or on a drive that stopped answering can be a very long
7933
- * time (kay#11575); an async one holds a thread of the pool the whole daemon shares. The host runs
7934
- * each request on a dedicated worker, gives it a deadline, and answers a typed result instead of
7935
- * throwing.
7932
+ * Ungated and always present, like `app.paths`. It confers no authority: the process a plugin
7933
+ * runs in, the daemon or the plugin host, could call `node:fs` itself. What the door adds is where
7934
+ * the work runs. A `node:fs` sync call blocks that process's event loop for as long as the path
7935
+ * takes to answer, which under a macOS-protected folder or on a drive that stopped answering can
7936
+ * be a very long time (kay#11575); an async one holds a thread of the pool the whole process
7937
+ * shares. The daemon's user-files service runs each request on a dedicated worker, gives it a
7938
+ * deadline, and answers a typed result instead of throwing. A plugin in the plugin host reaches
7939
+ * the same service: each call is sent to the daemon and answered from there.
7936
7940
  *
7937
7941
  * This is a leaf module. It lives beside both target SDKs, like `time.ts`, so the `kay.agent` SDK
7938
7942
  * exposes the same door without importing the `kay.app` surface.
@@ -7973,7 +7977,12 @@ export declare interface KayAppUserFiles {
7973
7977
  }
7974
7978
 
7975
7979
  export declare interface KayAppUserFilesCallOptions {
7976
- /** Deadline in milliseconds from the call, waiting included. Default 5000, at most 60000. */
7980
+ /**
7981
+ * Deadline in milliseconds, waiting included. Default 5000, at most 60000. It starts when the
7982
+ * daemon's user-files service receives the request: from the call in the daemon, or, for a
7983
+ * plugin in the plugin host, once the request has crossed to the daemon. A daemon that never
7984
+ * reads the request leaves the call waiting until the host's connection to it is closed.
7985
+ */
7977
7986
  readonly timeoutMs?: number;
7978
7987
  readonly signal?: AbortSignal;
7979
7988
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaklabs-ai/plugin-sdk",
3
- "version": "0.42.0",
3
+ "version": "0.42.1",
4
4
  "description": "The Kay plugin SDK — types and helpers for authoring a Kay directory plugin.",
5
5
  "author": "YakLabs",
6
6
  "type": "module",