@yaklabs-ai/plugin-sdk 0.13.8 → 0.13.9

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.13.8"
16
+ "@bonsai/plugin-sdk": "npm:@yaklabs-ai/plugin-sdk@^0.13.9"
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.13.8" },
65
+ "compatibility": { "sdk": "^0.13.9" },
66
66
  "targets": {
67
67
  "kay": {
68
68
  "agent": {
@@ -129,12 +129,15 @@ naming both versions, instead of loading it and finding no `activate`.
129
129
  | `@bonsai/plugin-sdk/app-data` | The app-data size caps, on an entry with no other import, from 0.13.7 |
130
130
  | `@bonsai/plugin-sdk/vendored-mcp` | The kit for a plugin built on a vendor's hosted MCP server, from 0.13.7 |
131
131
  | `@bonsai/plugin-sdk/system-one` | The types and error class for `api.systemOne` / `app.systemOne`, from 0.13.8 |
132
+ | `@bonsai/plugin-sdk/zod` | `z` (the host's in the daemon), on an entry with no other import, from 0.13.9 |
132
133
 
133
134
  A plugin that imports a subpath declares at least the version its row names (`^0.13.7` for the
134
- four from 0.13.7, `^0.13.8` for `system-one`). `vendored-mcp` builds the plugin's URI module (its link cards and help); hosting the
135
+ four from 0.13.7, `^0.13.8` for `system-one`, `^0.13.9` for `zod`). `vendored-mcp` builds the plugin's URI module (its link cards and help); hosting the
135
136
  vendor's MCP server itself is a separate host decision: Bonsai hosts it once a person approves
136
137
  the plugin's `mcp.host-server` grant for that server's name and URL. A server that needs an OAuth
137
- sign-in is, for now, supported only for Bonsai's own plugins.
138
+ sign-in names one of the plugin's auth services in `authService`; that service must declare exactly
139
+ one `delegated` scheme, which Bonsai uses to sign the person in to the server. Bonsai declares that
140
+ scheme at runtime; the plugin's code must not declare it again.
138
141
 
139
142
  `kay-agent/host` is intentionally not published; it is Bonsai's own loading
140
143
  machinery, not an authoring API.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "package": "@yaklabs-ai/plugin-sdk",
4
- "version": "0.13.8",
4
+ "version": "0.13.9",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [
@@ -610,7 +610,7 @@ declare interface DecideBoolAnswer {
610
610
  /** A yes/no question. `criteria` says what yes and what no mean; omit it to leave both open. */
611
611
  declare interface DecideBoolQuestion {
612
612
  readonly type: "bool";
613
- readonly instructions: string;
613
+ readonly instructions: DecideInstructions;
614
614
  readonly criteria?: {
615
615
  readonly true: string;
616
616
  readonly false: string;
@@ -628,10 +628,13 @@ declare interface DecideChoiceAnswer<L extends string = string> {
628
628
  /** A choice among labels. Each label maps to what it means; an empty string leaves it open. */
629
629
  declare interface DecideChoiceQuestion<L extends string = string> {
630
630
  readonly type: "choice";
631
- readonly instructions: string;
631
+ readonly instructions: DecideInstructions;
632
632
  readonly criteria: Readonly<Record<L, string>>;
633
633
  }
634
634
 
635
+ /** What a question asks: text, or a JSON object the client sends as its JSON text. */
636
+ declare type DecideInstructions = string | object;
637
+
635
638
  declare type DecideModelId = "jev" | "clef" | "clef-flash";
636
639
 
637
640
  declare type DecideQuestion = DecideBoolQuestion | DecideChoiceQuestion | DecideScoreQuestion;
@@ -656,7 +659,7 @@ declare interface DecideScoreAnswer {
656
659
  /** A score over ordered levels: the first criterion scores 0, the next 1, and so on. */
657
660
  declare interface DecideScoreQuestion {
658
661
  readonly type: "score";
659
- readonly instructions: string;
662
+ readonly instructions: DecideInstructions;
660
663
  readonly criteria: readonly string[];
661
664
  }
662
665
 
@@ -4604,6 +4607,8 @@ declare interface SystemOneCallOptions {
4604
4607
  readonly signal?: AbortSignal;
4605
4608
  /** Bounds the whole call, retries included. */
4606
4609
  readonly timeoutMs?: number;
4610
+ /** What the call is for, carried to the host's usage accounting. Never sent to a provider. */
4611
+ readonly purpose?: string;
4607
4612
  }
4608
4613
 
4609
4614
  declare interface SystemOneClient {
@@ -768,7 +768,7 @@ var DEFAULT_DECIDE_MODEL = "jev";
768
768
  var SYSTEM_ONE_LIMITS = {
769
769
  /** The serialized request body, in bytes. */
770
770
  maxBodyBytes: 64 * 1024,
771
- maxQuestions: 8,
771
+ maxQuestions: 64,
772
772
  maxFields: 32,
773
773
  minChoiceOptions: 2,
774
774
  maxChoiceOptions: 255,
@@ -521,7 +521,7 @@ declare interface DecideBoolAnswer {
521
521
  /** A yes/no question. `criteria` says what yes and what no mean; omit it to leave both open. */
522
522
  declare interface DecideBoolQuestion {
523
523
  readonly type: "bool";
524
- readonly instructions: string;
524
+ readonly instructions: DecideInstructions;
525
525
  readonly criteria?: {
526
526
  readonly true: string;
527
527
  readonly false: string;
@@ -539,10 +539,13 @@ declare interface DecideChoiceAnswer<L extends string = string> {
539
539
  /** A choice among labels. Each label maps to what it means; an empty string leaves it open. */
540
540
  declare interface DecideChoiceQuestion<L extends string = string> {
541
541
  readonly type: "choice";
542
- readonly instructions: string;
542
+ readonly instructions: DecideInstructions;
543
543
  readonly criteria: Readonly<Record<L, string>>;
544
544
  }
545
545
 
546
+ /** What a question asks: text, or a JSON object the client sends as its JSON text. */
547
+ declare type DecideInstructions = string | object;
548
+
546
549
  declare type DecideModelId = "jev" | "clef" | "clef-flash";
547
550
 
548
551
  declare type DecideQuestion = DecideBoolQuestion | DecideChoiceQuestion | DecideScoreQuestion;
@@ -567,7 +570,7 @@ declare interface DecideScoreAnswer {
567
570
  /** A score over ordered levels: the first criterion scores 0, the next 1, and so on. */
568
571
  declare interface DecideScoreQuestion {
569
572
  readonly type: "score";
570
- readonly instructions: string;
573
+ readonly instructions: DecideInstructions;
571
574
  readonly criteria: readonly string[];
572
575
  }
573
576
 
@@ -4515,6 +4518,8 @@ declare interface SystemOneCallOptions {
4515
4518
  readonly signal?: AbortSignal;
4516
4519
  /** Bounds the whole call, retries included. */
4517
4520
  readonly timeoutMs?: number;
4521
+ /** What the call is for, carried to the host's usage accounting. Never sent to a provider. */
4522
+ readonly purpose?: string;
4518
4523
  }
4519
4524
 
4520
4525
  declare interface SystemOneClient {
@@ -61,7 +61,7 @@ var DEFAULT_DECIDE_MODEL = "jev";
61
61
  var SYSTEM_ONE_LIMITS = {
62
62
  /** The serialized request body, in bytes. */
63
63
  maxBodyBytes: 64 * 1024,
64
- maxQuestions: 8,
64
+ maxQuestions: 64,
65
65
  maxFields: 32,
66
66
  minChoiceOptions: 2,
67
67
  maxChoiceOptions: 255,
@@ -754,7 +754,7 @@ declare interface DecideBoolAnswer {
754
754
  /** A yes/no question. `criteria` says what yes and what no mean; omit it to leave both open. */
755
755
  declare interface DecideBoolQuestion {
756
756
  readonly type: "bool";
757
- readonly instructions: string;
757
+ readonly instructions: DecideInstructions;
758
758
  readonly criteria?: {
759
759
  readonly true: string;
760
760
  readonly false: string;
@@ -772,10 +772,13 @@ declare interface DecideChoiceAnswer<L extends string = string> {
772
772
  /** A choice among labels. Each label maps to what it means; an empty string leaves it open. */
773
773
  declare interface DecideChoiceQuestion<L extends string = string> {
774
774
  readonly type: "choice";
775
- readonly instructions: string;
775
+ readonly instructions: DecideInstructions;
776
776
  readonly criteria: Readonly<Record<L, string>>;
777
777
  }
778
778
 
779
+ /** What a question asks: text, or a JSON object the client sends as its JSON text. */
780
+ declare type DecideInstructions = string | object;
781
+
779
782
  declare type DecideModelId = "jev" | "clef" | "clef-flash";
780
783
 
781
784
  declare type DecideQuestion = DecideBoolQuestion | DecideChoiceQuestion | DecideScoreQuestion;
@@ -800,7 +803,7 @@ declare interface DecideScoreAnswer {
800
803
  /** A score over ordered levels: the first criterion scores 0, the next 1, and so on. */
801
804
  declare interface DecideScoreQuestion {
802
805
  readonly type: "score";
803
- readonly instructions: string;
806
+ readonly instructions: DecideInstructions;
804
807
  readonly criteria: readonly string[];
805
808
  }
806
809
 
@@ -6478,6 +6481,8 @@ declare interface SystemOneCallOptions {
6478
6481
  readonly signal?: AbortSignal;
6479
6482
  /** Bounds the whole call, retries included. */
6480
6483
  readonly timeoutMs?: number;
6484
+ /** What the call is for, carried to the host's usage accounting. Never sent to a provider. */
6485
+ readonly purpose?: string;
6481
6486
  }
6482
6487
 
6483
6488
  declare interface SystemOneClient {
package/dist/kay-app.d.ts CHANGED
@@ -827,7 +827,7 @@ declare interface DecideBoolAnswer {
827
827
  /** A yes/no question. `criteria` says what yes and what no mean; omit it to leave both open. */
828
828
  declare interface DecideBoolQuestion {
829
829
  readonly type: "bool";
830
- readonly instructions: string;
830
+ readonly instructions: DecideInstructions;
831
831
  readonly criteria?: {
832
832
  readonly true: string;
833
833
  readonly false: string;
@@ -845,10 +845,13 @@ declare interface DecideChoiceAnswer<L extends string = string> {
845
845
  /** A choice among labels. Each label maps to what it means; an empty string leaves it open. */
846
846
  declare interface DecideChoiceQuestion<L extends string = string> {
847
847
  readonly type: "choice";
848
- readonly instructions: string;
848
+ readonly instructions: DecideInstructions;
849
849
  readonly criteria: Readonly<Record<L, string>>;
850
850
  }
851
851
 
852
+ /** What a question asks: text, or a JSON object the client sends as its JSON text. */
853
+ declare type DecideInstructions = string | object;
854
+
852
855
  declare type DecideModelId = "jev" | "clef" | "clef-flash";
853
856
 
854
857
  declare type DecideQuestion = DecideBoolQuestion | DecideChoiceQuestion | DecideScoreQuestion;
@@ -873,7 +876,7 @@ declare interface DecideScoreAnswer {
873
876
  /** A score over ordered levels: the first criterion scores 0, the next 1, and so on. */
874
877
  declare interface DecideScoreQuestion {
875
878
  readonly type: "score";
876
- readonly instructions: string;
879
+ readonly instructions: DecideInstructions;
877
880
  readonly criteria: readonly string[];
878
881
  }
879
882
 
@@ -8612,6 +8615,8 @@ declare interface SystemOneCallOptions {
8612
8615
  readonly signal?: AbortSignal;
8613
8616
  /** Bounds the whole call, retries included. */
8614
8617
  readonly timeoutMs?: number;
8618
+ /** What the call is for, carried to the host's usage accounting. Never sent to a provider. */
8619
+ readonly purpose?: string;
8615
8620
  }
8616
8621
 
8617
8622
  declare interface SystemOneClient {
@@ -17,7 +17,7 @@ export declare interface DecideBoolAnswer {
17
17
  /** A yes/no question. `criteria` says what yes and what no mean; omit it to leave both open. */
18
18
  export declare interface DecideBoolQuestion {
19
19
  readonly type: "bool";
20
- readonly instructions: string;
20
+ readonly instructions: DecideInstructions;
21
21
  readonly criteria?: {
22
22
  readonly true: string;
23
23
  readonly false: string;
@@ -35,10 +35,13 @@ export declare interface DecideChoiceAnswer<L extends string = string> {
35
35
  /** A choice among labels. Each label maps to what it means; an empty string leaves it open. */
36
36
  export declare interface DecideChoiceQuestion<L extends string = string> {
37
37
  readonly type: "choice";
38
- readonly instructions: string;
38
+ readonly instructions: DecideInstructions;
39
39
  readonly criteria: Readonly<Record<L, string>>;
40
40
  }
41
41
 
42
+ /** What a question asks: text, or a JSON object the client sends as its JSON text. */
43
+ export declare type DecideInstructions = string | object;
44
+
42
45
  export declare type DecideModelId = "jev" | "clef" | "clef-flash";
43
46
 
44
47
  export declare type DecideQuestion = DecideBoolQuestion | DecideChoiceQuestion | DecideScoreQuestion;
@@ -63,7 +66,7 @@ export declare interface DecideScoreAnswer {
63
66
  /** A score over ordered levels: the first criterion scores 0, the next 1, and so on. */
64
67
  export declare interface DecideScoreQuestion {
65
68
  readonly type: "score";
66
- readonly instructions: string;
69
+ readonly instructions: DecideInstructions;
67
70
  readonly criteria: readonly string[];
68
71
  }
69
72
 
@@ -232,6 +235,8 @@ export declare interface SystemOneCallOptions {
232
235
  readonly signal?: AbortSignal;
233
236
  /** Bounds the whole call, retries included. */
234
237
  readonly timeoutMs?: number;
238
+ /** What the call is for, carried to the host's usage accounting. Never sent to a provider. */
239
+ readonly purpose?: string;
235
240
  }
236
241
 
237
242
  export declare interface SystemOneClient {
@@ -28,7 +28,7 @@ var DEFAULT_DECIDE_MODEL = "jev";
28
28
  var SYSTEM_ONE_LIMITS = {
29
29
  /** The serialized request body, in bytes. */
30
30
  maxBodyBytes: 64 * 1024,
31
- maxQuestions: 8,
31
+ maxQuestions: 64,
32
32
  maxFields: 32,
33
33
  minChoiceOptions: 2,
34
34
  maxChoiceOptions: 255,
package/dist/zod.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+
3
+ export { z }
4
+
5
+ export { }
package/dist/zod.js ADDED
@@ -0,0 +1,5 @@
1
+ // packages/plugin-sdk/dist/zod.js
2
+ import { z } from "zod";
3
+ export {
4
+ z
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaklabs-ai/plugin-sdk",
3
- "version": "0.13.8",
3
+ "version": "0.13.9",
4
4
  "description": "The Kay plugin SDK — types and helpers for authoring a Kay directory plugin.",
5
5
  "author": "YakLabs",
6
6
  "type": "module",
@@ -68,6 +68,10 @@
68
68
  "./system-one": {
69
69
  "types": "./dist/system-one.d.ts",
70
70
  "default": "./dist/system-one.js"
71
+ },
72
+ "./zod": {
73
+ "types": "./dist/zod.d.ts",
74
+ "default": "./dist/zod.js"
71
75
  }
72
76
  },
73
77
  "files": [
@@ -97,7 +97,8 @@ claims all show only after enabling, in `read plugin://<id>`.
97
97
  - Plugin source imports `@bonsai/plugin-sdk/<subpath>` as a **bare specifier**
98
98
  (`@bonsai/plugin-sdk/kay-agent`, `/kay-agent/testing`, `/kay-app`, `/disclosure`, `/fs`, `/jev`,
99
99
  `/signals`, `/phase-shift`, `/time`, `/transcript`, `/transcript-review`, `/agent-conversation`,
100
- `/app-data`, `/vendored-mcp` — only declared exports exist).
100
+ `/app-data`, `/vendored-mcp`, `/system-one`, `/zod` — only declared exports exist). Take `z`
101
+ from the SDK (`/kay-agent`, or `/zod` in code a page also loads), never from `zod` itself.
101
102
  - The daemon's plugin loader bundles each declared TypeScript entrypoint and its relative imports.
102
103
  It keeps `@bonsai/plugin-sdk` imports external and resolves them to the running app's own built SDK.
103
104
  Multi-file plugins are supported, and no plugin-local build is needed for Bonsai to load them.