@yaklabs-ai/plugin-sdk 0.28.0 → 0.29.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/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.28.0"
16
+ "@bonsai/plugin-sdk": "npm:@yaklabs-ai/plugin-sdk@^0.29.0"
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.28.0" },
65
+ "compatibility": { "sdk": "^0.29.0" },
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.28.0",
4
+ "version": "0.29.0",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [
@@ -2341,8 +2341,14 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2341
2341
  * host holds may name one too. A plugin using a removed member or value stops loading until it is
2342
2342
  * rebuilt; a code search found none outside this repo. A plugin with a sign-in declares ^0.28.0. 0.26.3 and 0.27.1
2343
2343
  * stay served for a plugin that uses none of these.
2344
+ *
2345
+ * 0.29.0 replaces `servedSimulators` (`KayServedSimulators`, a lookup by adapter id) with
2346
+ * `simulator` on both targets (#14929): what the plugin's own simulator built, handed over once by
2347
+ * whichever process runs the plugin. A plugin's simulator file exports `createPluginSimulator`
2348
+ * (`KayPluginSimulatorFactory`). A clean break: only this repo's plugins read the old member, and
2349
+ * a plugin with no simulator is unaffected, so 0.28.0 stays served.
2344
2350
  */
2345
- declare const KAY_PLUGIN_SDK_VERSION: "0.28.0";
2351
+ declare const KAY_PLUGIN_SDK_VERSION: "0.29.0";
2346
2352
 
2347
2353
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2348
2354
 
@@ -2578,11 +2584,11 @@ declare interface KayAgentPluginApi {
2578
2584
  /** Absent unless the `knownResources` grant is requested and effectively granted. */
2579
2585
  readonly knownResources?: KayAgentKnownResources;
2580
2586
  /**
2581
- * Optional: absent unless a simulating Bonsai daemon serves this plugin a simulator (SDK 0.18.1).
2582
- * A production daemon never does. In this version only plugins the release carries are served;
2583
- * any plugin may ship a `./simulator` later. See {@link KayServedSimulators}.
2587
+ * What this plugin's own simulator built, in a simulated run only (SDK 0.29.0): absent in every
2588
+ * other, so treat absence as the normal case. Use it in place of the real backend; its shape is
2589
+ * the plugin's own, so narrow it before use. See {@link KayPluginSimulatorFactory}.
2584
2590
  */
2585
- readonly servedSimulators?: KayServedSimulators;
2591
+ readonly simulator?: unknown;
2586
2592
  /**
2587
2593
  * Present when the host composes Whiteboard. Each operation is checked against its exact
2588
2594
  * `whiteboard.<operation> {scope}` claim; handle presence is not consent.
@@ -3222,24 +3228,6 @@ declare const KayPluginProtocolVersion: z.ZodLiteral<"kay.plugin.v1">;
3222
3228
 
3223
3229
  declare type KayPluginProtocolVersion = z.infer<typeof KayPluginProtocolVersion>;
3224
3230
 
3225
- /**
3226
- * The simulators a simulating Bonsai daemon (evals, dev, tests) serves this plugin, keyed by the
3227
- * adapter id its simulated URI connection rows name. The daemon builds each from the plugin's own
3228
- * dev-only `./simulator` subpath; the plugin never imports its simulator.
3229
- *
3230
- * The member that carries this, `servedSimulators` on both plugin APIs, is optional and absent
3231
- * unless a simulating daemon serves it. A production daemon never does, so treat absence as the
3232
- * normal case. In this version the daemon serves it only to plugins the release carries; the seam
3233
- * is not specific to them, and any plugin may ship a `./simulator` later.
3234
- */
3235
- declare interface KayServedSimulators {
3236
- /**
3237
- * What this plugin's simulator built for `adapterId`, or `undefined` when none was served for
3238
- * that id. The shape is the plugin's own simulator contract; narrow it before use.
3239
- */
3240
- get(adapterId: string): unknown;
3241
- }
3242
-
3243
3231
  /** Applies a KeyOf action to the given type. */
3244
3232
  declare function KeyOf<Type extends TSchema>(type: Type, options?: TSchemaOptions): TKeyOf_2<Type>;
3245
3233
 
@@ -2395,8 +2395,14 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2395
2395
  * host holds may name one too. A plugin using a removed member or value stops loading until it is
2396
2396
  * rebuilt; a code search found none outside this repo. A plugin with a sign-in declares ^0.28.0. 0.26.3 and 0.27.1
2397
2397
  * stay served for a plugin that uses none of these.
2398
+ *
2399
+ * 0.29.0 replaces `servedSimulators` (`KayServedSimulators`, a lookup by adapter id) with
2400
+ * `simulator` on both targets (#14929): what the plugin's own simulator built, handed over once by
2401
+ * whichever process runs the plugin. A plugin's simulator file exports `createPluginSimulator`
2402
+ * (`KayPluginSimulatorFactory`). A clean break: only this repo's plugins read the old member, and
2403
+ * a plugin with no simulator is unaffected, so 0.28.0 stays served.
2398
2404
  */
2399
- declare const KAY_PLUGIN_SDK_VERSION: "0.28.0";
2405
+ declare const KAY_PLUGIN_SDK_VERSION: "0.29.0";
2400
2406
 
2401
2407
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2402
2408
 
@@ -2629,11 +2635,11 @@ declare interface KayAgentPluginApi {
2629
2635
  /** Absent unless the `knownResources` grant is requested and effectively granted. */
2630
2636
  readonly knownResources?: KayAgentKnownResources;
2631
2637
  /**
2632
- * Optional: absent unless a simulating Bonsai daemon serves this plugin a simulator (SDK 0.18.1).
2633
- * A production daemon never does. In this version only plugins the release carries are served;
2634
- * any plugin may ship a `./simulator` later. See {@link KayServedSimulators}.
2638
+ * What this plugin's own simulator built, in a simulated run only (SDK 0.29.0): absent in every
2639
+ * other, so treat absence as the normal case. Use it in place of the real backend; its shape is
2640
+ * the plugin's own, so narrow it before use. See {@link KayPluginSimulatorFactory}.
2635
2641
  */
2636
- readonly servedSimulators?: KayServedSimulators;
2642
+ readonly simulator?: unknown;
2637
2643
  /**
2638
2644
  * Present when the host composes Whiteboard. Each operation is checked against its exact
2639
2645
  * `whiteboard.<operation> {scope}` claim; handle presence is not consent.
@@ -3273,24 +3279,6 @@ declare const KayPluginProtocolVersion: z.ZodLiteral<"kay.plugin.v1">;
3273
3279
 
3274
3280
  declare type KayPluginProtocolVersion = z.infer<typeof KayPluginProtocolVersion>;
3275
3281
 
3276
- /**
3277
- * The simulators a simulating Bonsai daemon (evals, dev, tests) serves this plugin, keyed by the
3278
- * adapter id its simulated URI connection rows name. The daemon builds each from the plugin's own
3279
- * dev-only `./simulator` subpath; the plugin never imports its simulator.
3280
- *
3281
- * The member that carries this, `servedSimulators` on both plugin APIs, is optional and absent
3282
- * unless a simulating daemon serves it. A production daemon never does, so treat absence as the
3283
- * normal case. In this version the daemon serves it only to plugins the release carries; the seam
3284
- * is not specific to them, and any plugin may ship a `./simulator` later.
3285
- */
3286
- declare interface KayServedSimulators {
3287
- /**
3288
- * What this plugin's simulator built for `adapterId`, or `undefined` when none was served for
3289
- * that id. The shape is the plugin's own simulator contract; narrow it before use.
3290
- */
3291
- get(adapterId: string): unknown;
3292
- }
3293
-
3294
3282
  /** Applies a KeyOf action to the given type. */
3295
3283
  declare function KeyOf<Type extends TSchema>(type: Type, options?: TSchemaOptions): TKeyOf_2<Type>;
3296
3284
 
@@ -2670,8 +2670,14 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2670
2670
  * host holds may name one too. A plugin using a removed member or value stops loading until it is
2671
2671
  * rebuilt; a code search found none outside this repo. A plugin with a sign-in declares ^0.28.0. 0.26.3 and 0.27.1
2672
2672
  * stay served for a plugin that uses none of these.
2673
+ *
2674
+ * 0.29.0 replaces `servedSimulators` (`KayServedSimulators`, a lookup by adapter id) with
2675
+ * `simulator` on both targets (#14929): what the plugin's own simulator built, handed over once by
2676
+ * whichever process runs the plugin. A plugin's simulator file exports `createPluginSimulator`
2677
+ * (`KayPluginSimulatorFactory`). A clean break: only this repo's plugins read the old member, and
2678
+ * a plugin with no simulator is unaffected, so 0.28.0 stays served.
2673
2679
  */
2674
- declare const KAY_PLUGIN_SDK_VERSION: "0.28.0";
2680
+ declare const KAY_PLUGIN_SDK_VERSION: "0.29.0";
2675
2681
 
2676
2682
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2677
2683
 
@@ -2936,11 +2942,11 @@ export declare interface KayAgentPluginApi {
2936
2942
  /** Absent unless the `knownResources` grant is requested and effectively granted. */
2937
2943
  readonly knownResources?: KayAgentKnownResources;
2938
2944
  /**
2939
- * Optional: absent unless a simulating Bonsai daemon serves this plugin a simulator (SDK 0.18.1).
2940
- * A production daemon never does. In this version only plugins the release carries are served;
2941
- * any plugin may ship a `./simulator` later. See {@link KayServedSimulators}.
2945
+ * What this plugin's own simulator built, in a simulated run only (SDK 0.29.0): absent in every
2946
+ * other, so treat absence as the normal case. Use it in place of the real backend; its shape is
2947
+ * the plugin's own, so narrow it before use. See {@link KayPluginSimulatorFactory}.
2942
2948
  */
2943
- readonly servedSimulators?: KayServedSimulators;
2949
+ readonly simulator?: unknown;
2944
2950
  /**
2945
2951
  * Present when the host composes Whiteboard. Each operation is checked against its exact
2946
2952
  * `whiteboard.<operation> {scope}` claim; handle presence is not consent.
@@ -3599,21 +3605,19 @@ declare const KayPluginProtocolVersion: z.ZodLiteral<"kay.plugin.v1">;
3599
3605
  declare type KayPluginProtocolVersion = z.infer<typeof KayPluginProtocolVersion>;
3600
3606
 
3601
3607
  /**
3602
- * The simulators a simulating Bonsai daemon (evals, dev, tests) serves this plugin, keyed by the
3603
- * adapter id its simulated URI connection rows name. The daemon builds each from the plugin's own
3604
- * dev-only `./simulator` subpath; the plugin never imports its simulator.
3605
- *
3606
- * The member that carries this, `servedSimulators` on both plugin APIs, is optional and absent
3607
- * unless a simulating daemon serves it. A production daemon never does, so treat absence as the
3608
- * normal case. In this version the daemon serves it only to plugins the release carries; the seam
3609
- * is not specific to them, and any plugin may ship a `./simulator` later.
3608
+ * What a plugin's dev-only simulator file exports as `createPluginSimulator`. Whichever process
3609
+ * runs the plugin calls it once and hands the result to that plugin alone, as `simulator` on both
3610
+ * plugin APIs. The result's shape is the plugin's own: nothing between the two reads it, and the
3611
+ * plugin never imports its simulator.
3610
3612
  */
3611
- export declare interface KayServedSimulators {
3612
- /**
3613
- * What this plugin's simulator built for `adapterId`, or `undefined` when none was served for
3614
- * that id. The shape is the plugin's own simulator contract; narrow it before use.
3615
- */
3616
- get(adapterId: string): unknown;
3613
+ export declare type KayPluginSimulatorFactory = (options: KayPluginSimulatorOptions) => unknown;
3614
+
3615
+ /**
3616
+ * What the launcher of a simulated run (evals, dev, tests) gives a plugin's simulator: the folder
3617
+ * its worlds live under. The simulator picks its own folders inside it.
3618
+ */
3619
+ export declare interface KayPluginSimulatorOptions {
3620
+ readonly stateRoot: string;
3617
3621
  }
3618
3622
 
3619
3623
  /** Applies a KeyOf action to the given type. */
package/dist/kay-app.d.ts CHANGED
@@ -2627,8 +2627,14 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2627
2627
  * host holds may name one too. A plugin using a removed member or value stops loading until it is
2628
2628
  * rebuilt; a code search found none outside this repo. A plugin with a sign-in declares ^0.28.0. 0.26.3 and 0.27.1
2629
2629
  * stay served for a plugin that uses none of these.
2630
+ *
2631
+ * 0.29.0 replaces `servedSimulators` (`KayServedSimulators`, a lookup by adapter id) with
2632
+ * `simulator` on both targets (#14929): what the plugin's own simulator built, handed over once by
2633
+ * whichever process runs the plugin. A plugin's simulator file exports `createPluginSimulator`
2634
+ * (`KayPluginSimulatorFactory`). A clean break: only this repo's plugins read the old member, and
2635
+ * a plugin with no simulator is unaffected, so 0.28.0 stays served.
2630
2636
  */
2631
- declare const KAY_PLUGIN_SDK_VERSION: "0.28.0";
2637
+ declare const KAY_PLUGIN_SDK_VERSION: "0.29.0";
2632
2638
 
2633
2639
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2634
2640
 
@@ -5153,13 +5159,11 @@ export declare interface KayAppPluginApi {
5153
5159
  /** Exact-account credential resolution for declared background-job purposes. */
5154
5160
  readonly backgroundAuth?: KayAppBackgroundAuth;
5155
5161
  /**
5156
- * Optional: absent unless a simulating Bonsai daemon serves this plugin a simulator (SDK 0.18.1).
5157
- * A production daemon never does. In this version only plugins the release carries are served;
5158
- * any plugin may ship a `./simulator` later. The `kay.app` target reads the same simulators its
5159
- * `kay.agent` part does, so a background job runs on the simulator its URI target does. See
5160
- * {@link KayServedSimulators}.
5162
+ * What this plugin's own simulator built, in a simulated run only (SDK 0.29.0): absent in every
5163
+ * other. Its shape is the plugin's own, so narrow it before use. See
5164
+ * {@link KayPluginSimulatorFactory}.
5161
5165
  */
5162
- readonly servedSimulators?: KayServedSimulators;
5166
+ readonly simulator?: unknown;
5163
5167
  /**
5164
5168
  * Read and write this plugin's OWN manifest-declared config sections (value + provenance), and
5165
5169
  * observe changes. Present whenever the host has a config store and the plugin declares at least
@@ -8535,21 +8539,19 @@ declare const KayPluginProtocolVersion: z.ZodLiteral<"kay.plugin.v1">;
8535
8539
  declare type KayPluginProtocolVersion = z.infer<typeof KayPluginProtocolVersion>;
8536
8540
 
8537
8541
  /**
8538
- * The simulators a simulating Bonsai daemon (evals, dev, tests) serves this plugin, keyed by the
8539
- * adapter id its simulated URI connection rows name. The daemon builds each from the plugin's own
8540
- * dev-only `./simulator` subpath; the plugin never imports its simulator.
8541
- *
8542
- * The member that carries this, `servedSimulators` on both plugin APIs, is optional and absent
8543
- * unless a simulating daemon serves it. A production daemon never does, so treat absence as the
8544
- * normal case. In this version the daemon serves it only to plugins the release carries; the seam
8545
- * is not specific to them, and any plugin may ship a `./simulator` later.
8542
+ * What a plugin's dev-only simulator file exports as `createPluginSimulator`. Whichever process
8543
+ * runs the plugin calls it once and hands the result to that plugin alone, as `simulator` on both
8544
+ * plugin APIs. The result's shape is the plugin's own: nothing between the two reads it, and the
8545
+ * plugin never imports its simulator.
8546
8546
  */
8547
- export declare interface KayServedSimulators {
8548
- /**
8549
- * What this plugin's simulator built for `adapterId`, or `undefined` when none was served for
8550
- * that id. The shape is the plugin's own simulator contract; narrow it before use.
8551
- */
8552
- get(adapterId: string): unknown;
8547
+ export declare type KayPluginSimulatorFactory = (options: KayPluginSimulatorOptions) => unknown;
8548
+
8549
+ /**
8550
+ * What the launcher of a simulated run (evals, dev, tests) gives a plugin's simulator: the folder
8551
+ * its worlds live under. The simulator picks its own folders inside it.
8552
+ */
8553
+ export declare interface KayPluginSimulatorOptions {
8554
+ readonly stateRoot: string;
8553
8555
  }
8554
8556
 
8555
8557
  /** Applies a KeyOf action to the given type. */
@@ -0,0 +1,4 @@
1
+ /** Normalize underscores to hyphens; return undefined unless the result is a valid Agent Skills name (at most 64 characters). */
2
+ export declare function skillInstallTargetName(sourceName: string): string | undefined;
3
+
4
+ export { }
package/dist/skills.js ADDED
@@ -0,0 +1,12 @@
1
+ // packages/plugin-sdk/dist/skills.js
2
+ var AGENT_SKILL_NAME_PATTERN = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;
3
+ function skillInstallTargetName(sourceName) {
4
+ const targetName = sourceName.replace(/_+/g, "-");
5
+ if (targetName.length > 64 || targetName.includes("--") || !AGENT_SKILL_NAME_PATTERN.test(targetName)) {
6
+ return void 0;
7
+ }
8
+ return targetName;
9
+ }
10
+ export {
11
+ skillInstallTargetName
12
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaklabs-ai/plugin-sdk",
3
- "version": "0.28.0",
3
+ "version": "0.29.0",
4
4
  "description": "The Kay plugin SDK — types and helpers for authoring a Kay directory plugin.",
5
5
  "author": "YakLabs",
6
6
  "type": "module",
@@ -61,6 +61,10 @@
61
61
  "types": "./dist/whiteboard.d.ts",
62
62
  "default": "./dist/whiteboard.js"
63
63
  },
64
+ "./skills": {
65
+ "types": "./dist/skills.d.ts",
66
+ "default": "./dist/skills.js"
67
+ },
64
68
  "./transcript-review": {
65
69
  "types": "./dist/transcript-review.d.ts",
66
70
  "default": "./dist/transcript-review.js"