@yaklabs-ai/plugin-sdk 0.13.0 → 0.13.2

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.
@@ -20,7 +20,7 @@ declare interface AccountIdentity {
20
20
  readonly displayName?: string;
21
21
  /** Absolute URL of the account's avatar. */
22
22
  readonly avatarUrl?: string;
23
- /** Issuer-asserted beta-tester flag; only Kay's product-account service sets it. */
23
+ /** Issuer-asserted beta-tester flag; only Bonsai's product-account service sets it. */
24
24
  readonly betaTester?: boolean;
25
25
  readonly activeOrganizationId?: string;
26
26
  readonly organizationSelectionState?: "selected" | "unresolved";
@@ -28,7 +28,7 @@ declare interface AccountIdentity {
28
28
  /**
29
29
  * Provider-native session id claim (WorkOS's `sid`), needed to call the provider's own
30
30
  * session-revocation endpoint at sign-out (`POST /user_management/sessions/revoke`, not yet
31
- * wired — see `docs/kay-account-auth.md`'s "Sign-out guarantee" section). Only Kay's WorkOS
31
+ * wired — see `docs/kay-account-auth.md`'s "Sign-out guarantee" section). Only Bonsai's WorkOS
32
32
  * product-account exchange/refresh sets it; every other provider leaves it absent.
33
33
  */
34
34
  readonly providerSessionId?: string;
@@ -164,7 +164,7 @@ declare interface ApiKeyAuthSchemeField {
164
164
  readonly label: string;
165
165
  }
166
166
 
167
- /** Provider-owned instructions for creating a credential outside Kay. */
167
+ /** Provider-owned instructions for creating a credential outside Bonsai. */
168
168
  declare interface ApiKeyAuthSchemeSetup {
169
169
  readonly instructions: string;
170
170
  /** Absolute HTTPS page where the user can create or manage the credential. */
@@ -641,7 +641,7 @@ declare interface InteractionCandidate {
641
641
  declare type InteractionCandidateKind = "click" | "fill" | "select" | "scroll" | "wait" | "activate" | "press";
642
642
 
643
643
  declare interface InteractionDriver {
644
- /** Unique in the session. `builtin:` is reserved for Kay's own drivers. */
644
+ /** Unique in the session. `builtin:` is reserved for Bonsai's own drivers. */
645
645
  readonly id: string;
646
646
  /** Human-readable name the agent sees beside the driver's targets. */
647
647
  readonly label: string;
@@ -664,7 +664,7 @@ declare interface InteractionDriver {
664
664
  }
665
665
 
666
666
  /**
667
- * The Interaction driver contract: what a plugin implements to let Kay's agent drive something
667
+ * The Interaction driver contract: what a plugin implements to let Bonsai's agent drive something
668
668
  * on the user's machine (a browser, an app, a remote screen) through the harness-owned
669
669
  * Interaction engine.
670
670
  *
@@ -677,7 +677,7 @@ declare interface InteractionDriver {
677
677
  * every tool work on every driver.
678
678
  *
679
679
  * Shape mirrors `SearchProvider` behind `web_search`: one tool set owned by the harness, many
680
- * backends registered per session, the `builtin:` id namespace reserved for Kay's own.
680
+ * backends registered per session, the `builtin:` id namespace reserved for Bonsai's own.
681
681
  */
682
682
  /** "Browser Interaction" drives web pages; "Computer Use Interaction" drives native apps. */
683
683
  declare type InteractionDriverKind = "browser" | "computer-use";
@@ -736,7 +736,7 @@ declare interface InteractionRegion {
736
736
  }
737
737
 
738
738
  /**
739
- * One surface Kay ships, in the driver contract's own shape, so a plugin's driver is the surface
739
+ * One surface Bonsai ships, in the driver contract's own shape, so a plugin's driver is the surface
740
740
  * plus an identity: `{ id, label, kind, ...api.interaction.desktop }`. Each call is checked
741
741
  * against the plugin's `interaction.surface {surface}` grant, and then against the session's
742
742
  * permissions exactly as the agent's `interaction_*` tools are: an act is judged as the plugin
@@ -876,7 +876,7 @@ declare interface JevScoreQuestion {
876
876
  * Those are host-side (`@kay/agent-runtime`'s `kay/jev/`).
877
877
  * ---
878
878
  *
879
- * The vocabulary is Kay's own (SDK 0.12.0). Before it, `use` received TypeSafe's `TypeSafeClient`
879
+ * The vocabulary is Bonsai's own (SDK 0.12.0). Before it, `use` received TypeSafe's `TypeSafeClient`
880
880
  * and plugins coded against a vendor's types. It follows pi's classifier contract, which the host
881
881
  * runs Jev through: a yes/no question is `bool` and answers a `probability`, every instruction and
882
882
  * criterion is text, and the state is a JSON object.
@@ -944,7 +944,7 @@ declare interface KayAgentInteractionSurfaces {
944
944
  readonly browserPane: InteractionSurface;
945
945
  /**
946
946
  * The user's desktop through the platform's accessibility APIs: native apps as targets
947
- * (`app://<bundle id>`), their windows' controls as elements. On macOS Kay drives it with its
947
+ * (`app://<bundle id>`), their windows' controls as elements. On macOS Bonsai drives it with its
948
948
  * bundled accessibility worker under the app's Accessibility permission; on a platform with no
949
949
  * backend it reports itself unavailable.
950
950
  */
@@ -1101,7 +1101,7 @@ declare interface KayAgentPluginApi {
1101
1101
  */
1102
1102
  readonly process: KayAgentProcess;
1103
1103
  /**
1104
- * Always present; the interaction surfaces Kay ships (its browser pane, and the desktop through
1104
+ * Always present; the interaction surfaces Bonsai ships (its browser pane, and the desktop through
1105
1105
  * the platform accessibility APIs), each call checked against `interaction.surface {surface}`
1106
1106
  * and the session's permissions (see {@link InteractionSurface}).
1107
1107
  * Wrap one in an {@link InteractionDriver} and register it with
@@ -1700,7 +1700,7 @@ declare type ModelPromptCache = Partial<Record<Exclude<CacheRetention, "none">,
1700
1700
  declare type ModelThinkingLevel = "off" | ThinkingLevel;
1701
1701
 
1702
1702
  /**
1703
- * Who may supply the OAuth client for a scheme: Kay's embedded client, or one the user pastes in
1703
+ * Who may supply the OAuth client for a scheme: Bonsai's embedded client, or one the user pastes in
1704
1704
  * (BYOOC). An UNORDERED SET — list order carries no meaning (nothing reads it as a preference).
1705
1705
  */
1706
1706
  declare type OAuthClientSupplier = "kay" | "user";
@@ -1713,7 +1713,7 @@ declare interface OAuthRedirectResult {
1713
1713
 
1714
1714
  /**
1715
1715
  * The two client-supply axes, structured so the illegal cell is unrepresentable: a `confidential`
1716
- * exchange's secret may only ever be Kay's (held by the host's broker, never pasted by a
1716
+ * exchange's secret may only ever be Bonsai's (held by the host's broker, never pasted by a
1717
1717
  * customer), so `confidential` types `clientSuppliers` as `readonly ["kay"]` — `confidential ×
1718
1718
  * user` is a compile-time impossibility in v1, not a runtime refusal. `pkce`'s `clientSuppliers`
1719
1719
  * is a non-empty set; {@link createOAuthPkceAuthScheme} dedupes it and refuses empty.
@@ -1952,7 +1952,7 @@ declare interface PluginDelegatedScheme {
1952
1952
  readonly connect: (ctx: PluginDelegatedConnectContext) => Promise<PluginDelegatedConnectResult>;
1953
1953
  /**
1954
1954
  * Mint fresh material from the current (expiring) material, including the `data` the last
1955
- * connect or refresh returned. Kay calls this only inside its credential authority, which holds
1955
+ * connect or refresh returned. Bonsai calls this only inside its credential authority, which holds
1956
1956
  * the refresh lease and saves the result; this hook performs the exchange and nothing else.
1957
1957
  * Returned `data` replaces the stored `data`; omitted `data` keeps it. Returned `expiresAt`
1958
1958
  * replaces the stored expiry; omitted `expiresAt` means the new material does not expire.
@@ -2026,7 +2026,7 @@ declare type PluginOAuthPkceScheme = PluginOAuthSchemeClientAxes & {
2026
2026
  readonly summary?: string;
2027
2027
  readonly authorizationUrl: string;
2028
2028
  readonly tokenUrl: string;
2029
- /** The Kay-supplied embedded client id; omit for a `confidential` scheme or a `pkce` scheme
2029
+ /** The Bonsai-supplied embedded client id; omit for a `confidential` scheme or a `pkce` scheme
2030
2030
  * the host ships no client for. */
2031
2031
  readonly clientId?: string;
2032
2032
  /**
@@ -2689,6 +2689,14 @@ declare interface ToolDefinition<TParams extends ToolParametersWire = ToolParame
2689
2689
  * explicit Stop.
2690
2690
  */
2691
2691
  durationClass?: "fast" | "long";
2692
+ /**
2693
+ * Set only for a tool whose rerun with the same arguments is harmless, such
2694
+ * as one keyed on its own call: after a crash cuts a call off, a pi-durable
2695
+ * session may rerun it with its recorded arguments (without `before_tool`)
2696
+ * instead of ending it as an interrupted error. Absent: never rerun. Ignored
2697
+ * on pi 0.99.1.
2698
+ */
2699
+ replaySafe?: true;
2692
2700
  /**
2693
2701
  * Optional capability⇄scheme binding. When present this tool is auth-gated: discoverable when
2694
2702
  * unauthed, callable once the binding is satisfied. The SDK's {@link withResolvedAuth}
@@ -2772,9 +2780,9 @@ declare type ToolParametersWire = unknown;
2772
2780
  *
2773
2781
  * The host is trusted to supply honest values; a declared `kind` of `read` moves a call below
2774
2782
  * the protected-path hard-deny (which only fires for non-read kinds), so a tool that could
2775
- * touch protected config must NOT declare `read`. Kay's embedded-experience tools never touch
2783
+ * touch protected config must NOT declare `read`. Bonsai's embedded-experience tools never touch
2776
2784
  * `configDir`, so this is safe for them. `read` is also what every capability surface reports as
2777
- * "read-only" (Kay's Permissions page groups and defaults on it), so it is a claim about what the
2785
+ * "read-only" (Bonsai's Permissions page groups and defaults on it), so it is a claim about what the
2778
2786
  * tool DOES — never a way to buy silence. A tool that should raise no ask on its own account
2779
2787
  * declares {@link ToolPermissionHint.quiet} and keeps its honest `kind`.
2780
2788
  */
@@ -2815,7 +2823,7 @@ declare interface ToolPermissionHint {
2815
2823
  * because the same tool can read on one input and execute on another, which a static `kind`
2816
2824
  * cannot express.
2817
2825
  *
2818
- * Exemplar — Kay's `mcp` proxy tool, one tool spanning every server: `search`/`describe` derive
2826
+ * Exemplar — Bonsai's `mcp` proxy tool, one tool spanning every server: `search`/`describe` derive
2819
2827
  * `{ kind: "read" }` (metadata lookups), while `call` derives
2820
2828
  * `{ kind: "execute", ruleKey: "mcp:<server>::<tool>", scheme: "<server>" }`, so a
2821
2829
  * `{ scheme: "<server>" }` rule gates a whole server and a `{ ruleKey: "mcp:<server>::<tool>" }`
@@ -2856,7 +2864,7 @@ declare interface ToolPermissionHint {
2856
2864
  * really had — not that the result is always stricter than the target's. How much gate is left
2857
2865
  * on such a call is exactly how much the CARRIER carries: an `execute` carrier is stricter than
2858
2866
  * a `read` target and equal to a `mutate`/`destructive` one outside allow mode, while a
2859
- * {@link quiet} carrier (Kay's own `call_tool`) contributes no mode default at all, so the
2867
+ * {@link quiet} carrier (Bonsai's own `call_tool`) contributes no mode default at all, so the
2860
2868
  * fallback leaves nothing but the carrier's rules and the protected-path deny — and the carrier
2861
2869
  * names no path, so that deny has nothing to fire on. This is why a carrier must refuse a target
2862
2870
  * that is itself a carrier: no chain long or circular enough to reach the fallback can be built,
@@ -2880,7 +2888,7 @@ declare interface ToolPermissionHint {
2880
2888
  * whose only effect is invoking the target the gate is already classifying beside it: the
2881
2889
  * target's kind, rules, resources and the protected-path deny all still decide, so a proxied
2882
2890
  * call is gated exactly like the direct one — no more, and no ask the direct call would never
2883
- * have raised. Kay's `call_tool` declares `{ kind: "execute", quiet: true }` (owner ruling,
2891
+ * have raised. Bonsai's `call_tool` declares `{ kind: "execute", quiet: true }` (owner ruling,
2884
2892
  * 2026-08-18): honest about everything it can reach, silent on its own account.
2885
2893
  *
2886
2894
  * Quiet is not ungated, but it IS nearly all the gate a lone carrier has. On a call that
@@ -3070,13 +3078,19 @@ declare interface UriExtensionModule extends Omit<UriModule, "verbs"> {
3070
3078
  readonly permissionDefaults?: UriPermissionDefaults;
3071
3079
  /** Requires a resolved URI connection before any verb handler runs. */
3072
3080
  readonly requiresConnection?: boolean;
3073
- /** Pure route-aware permission facts; may only strengthen the verb default. */
3081
+ /** Pure route-aware permission facts; see {@link UriExtensionOperationPermissionPolicy}. */
3074
3082
  readonly permission?: UriExtensionOperationPermissionPolicy;
3075
3083
  /** False rejects generic write-tool `source` copies before source fetch. */
3076
3084
  readonly acceptsSourceCopy?: boolean;
3077
3085
  }
3078
3086
 
3079
3087
  declare interface UriExtensionOperationPermissionPolicy {
3088
+ /**
3089
+ * Classify one canonical route, purely. `write`/`edit`/`delete` may only be made stricter
3090
+ * than the verb default; `help`/`read`/`list`/`search` must stay `"read"` (a `ruleKey` is
3091
+ * allowed), because the kernel reruns a crash-interrupted read without asking again. Any
3092
+ * other answer, or a throw, fails the call closed.
3093
+ */
3080
3094
  classifyOperation(request: {
3081
3095
  readonly operation: UriOperation;
3082
3096
  readonly uri: string;
@@ -3114,6 +3128,12 @@ declare interface UriHelp {
3114
3128
  readonly templates?: readonly UriTemplate[];
3115
3129
  readonly examples?: readonly UriExample[];
3116
3130
  readonly notes?: readonly string[];
3131
+ /**
3132
+ * Set when this help, for the address it was asked about, carries text a third party wrote and
3133
+ * the module relays as it received it (an MCP server's own tool names and descriptions), rather
3134
+ * than text the module's author wrote. Absent: the module's own text.
3135
+ */
3136
+ readonly thirdPartyContent?: true;
3117
3137
  }
3118
3138
 
3119
3139
  declare interface UriHintTriggers {
@@ -3304,7 +3324,15 @@ declare interface UriModule {
3304
3324
  normalize?(input: string, ctx: UriResolveContext): UriNormalizeResult | undefined;
3305
3325
  describe?(input: string, ctx: UriDescribeContext): UriResourceDescription | undefined;
3306
3326
  locate?(input: string, ctx: UriLocateContext): Promise<UriLocateResult>;
3327
+ /**
3328
+ * `read`, `help`, `list` and `search` observe; they never change the resource or anything
3329
+ * outside the host. Repeating one with the same input must be harmless: the kernel reruns a
3330
+ * call of these verbs that a crash cut off, with the same input, without asking the user
3331
+ * again. Idempotent bookkeeping (a cache fill, an index of what was read, a usage count) is
3332
+ * fine; a send, a mark-as-read or a create is not, and belongs on a mutating verb.
3333
+ */
3307
3334
  read(input: string, ctx: UriResolveContext): Promise<RawResource>;
3335
+ /** Observes only; see {@link read}. */
3308
3336
  help?(input: string, ctx: UriResolveContext): Promise<UriHelp>;
3309
3337
  write?(input: string, content: UriPayload, ctx: UriResolveContext): Promise<UriMutationResult | void>;
3310
3338
  /** Opt-in structured write with one or more host-resolved resources delivered beside the content. */
@@ -3327,7 +3355,9 @@ declare interface UriModule {
3327
3355
  */
3328
3356
  writeBytes?(input: string, bytes: Uint8Array, source: UriSourceDescriptor, ctx: UriResolveContext): Promise<UriMutationResult | void>;
3329
3357
  edit?(input: string, patch: UriPayload, ctx: UriResolveContext): Promise<UriMutationResult>;
3358
+ /** Observes only; see {@link read}. */
3330
3359
  list?(input: string, params: UriListParams, ctx: UriResolveContext): Promise<UriListResult>;
3360
+ /** Observes only; see {@link read}. */
3331
3361
  search?(input: string, params: UriSearchParams, ctx: UriResolveContext): Promise<UriSearchResult>;
3332
3362
  delete?(input: string, ctx: UriResolveContext): Promise<UriMutationResult>;
3333
3363
  toMarkdown?(input: UriMarkdownRenderInput, ctx: UriResolveContext): string | undefined;
@@ -3545,7 +3575,7 @@ declare interface UriResolveContext {
3545
3575
  * {@link UriResolveContext.sessionId} and just as un-influenceable by the caller — so a module
3546
3576
  * writing to a store it owns can record the actor without the agent being able to choose one.
3547
3577
  *
3548
- * Free text minted by the host's own runtime (Kay's form is `user`, `subagent`,
3578
+ * Free text minted by the host's own runtime (Bonsai's form is `user`, `subagent`,
3549
3579
  * `system/<surface>`, `followup/<surface>`) rather than a closed union: the surface half is the
3550
3580
  * host's vocabulary, and a second enumeration of it here would drift from the first.
3551
3581
  *
@@ -21,7 +21,7 @@ export declare interface AccountIdentity {
21
21
  readonly displayName?: string;
22
22
  /** Absolute URL of the account's avatar. */
23
23
  readonly avatarUrl?: string;
24
- /** Issuer-asserted beta-tester flag; only Kay's product-account service sets it. */
24
+ /** Issuer-asserted beta-tester flag; only Bonsai's product-account service sets it. */
25
25
  readonly betaTester?: boolean;
26
26
  readonly activeOrganizationId?: string;
27
27
  readonly organizationSelectionState?: "selected" | "unresolved";
@@ -29,7 +29,7 @@ export declare interface AccountIdentity {
29
29
  /**
30
30
  * Provider-native session id claim (WorkOS's `sid`), needed to call the provider's own
31
31
  * session-revocation endpoint at sign-out (`POST /user_management/sessions/revoke`, not yet
32
- * wired — see `docs/kay-account-auth.md`'s "Sign-out guarantee" section). Only Kay's WorkOS
32
+ * wired — see `docs/kay-account-auth.md`'s "Sign-out guarantee" section). Only Bonsai's WorkOS
33
33
  * product-account exchange/refresh sets it; every other provider leaves it absent.
34
34
  */
35
35
  readonly providerSessionId?: string;
@@ -206,7 +206,7 @@ declare interface ApiKeyAuthSchemeField {
206
206
  readonly label: string;
207
207
  }
208
208
 
209
- /** Provider-owned instructions for creating a credential outside Kay. */
209
+ /** Provider-owned instructions for creating a credential outside Bonsai. */
210
210
  declare interface ApiKeyAuthSchemeSetup {
211
211
  readonly instructions: string;
212
212
  /** Absolute HTTPS page where the user can create or manage the credential. */
@@ -704,7 +704,7 @@ declare interface DelegatedConnectResult {
704
704
 
705
705
  /**
706
706
  * The terminal failure of {@link PluginDelegatedScheme.refresh}: the provider no longer accepts the
707
- * stored grant (an OAuth `invalid_grant`, say), so only a reconnect helps. Kay marks the account
707
+ * stored grant (an OAuth `invalid_grant`, say), so only a reconnect helps. Bonsai marks the account
708
708
  * as needing a reconnect. Throw any other error for a failure that may pass on its own.
709
709
  */
710
710
  export declare class DelegatedRefreshRejectedError extends Error {
@@ -972,7 +972,7 @@ export declare interface InteractionCandidate {
972
972
  export declare type InteractionCandidateKind = "click" | "fill" | "select" | "scroll" | "wait" | "activate" | "press";
973
973
 
974
974
  export declare interface InteractionDriver {
975
- /** Unique in the session. `builtin:` is reserved for Kay's own drivers. */
975
+ /** Unique in the session. `builtin:` is reserved for Bonsai's own drivers. */
976
976
  readonly id: string;
977
977
  /** Human-readable name the agent sees beside the driver's targets. */
978
978
  readonly label: string;
@@ -995,7 +995,7 @@ export declare interface InteractionDriver {
995
995
  }
996
996
 
997
997
  /**
998
- * The Interaction driver contract: what a plugin implements to let Kay's agent drive something
998
+ * The Interaction driver contract: what a plugin implements to let Bonsai's agent drive something
999
999
  * on the user's machine (a browser, an app, a remote screen) through the harness-owned
1000
1000
  * Interaction engine.
1001
1001
  *
@@ -1008,7 +1008,7 @@ export declare interface InteractionDriver {
1008
1008
  * every tool work on every driver.
1009
1009
  *
1010
1010
  * Shape mirrors `SearchProvider` behind `web_search`: one tool set owned by the harness, many
1011
- * backends registered per session, the `builtin:` id namespace reserved for Kay's own.
1011
+ * backends registered per session, the `builtin:` id namespace reserved for Bonsai's own.
1012
1012
  */
1013
1013
  /** "Browser Interaction" drives web pages; "Computer Use Interaction" drives native apps. */
1014
1014
  export declare type InteractionDriverKind = "browser" | "computer-use";
@@ -1067,7 +1067,7 @@ export declare interface InteractionRegion {
1067
1067
  }
1068
1068
 
1069
1069
  /**
1070
- * One surface Kay ships, in the driver contract's own shape, so a plugin's driver is the surface
1070
+ * One surface Bonsai ships, in the driver contract's own shape, so a plugin's driver is the surface
1071
1071
  * plus an identity: `{ id, label, kind, ...api.interaction.desktop }`. Each call is checked
1072
1072
  * against the plugin's `interaction.surface {surface}` grant, and then against the session's
1073
1073
  * permissions exactly as the agent's `interaction_*` tools are: an act is judged as the plugin
@@ -1077,7 +1077,7 @@ export declare interface InteractionRegion {
1077
1077
  */
1078
1078
  export declare type InteractionSurface = Pick<InteractionDriver, "isAvailable" | "targets" | "observe" | "act" | "screenshot" | "open">;
1079
1079
 
1080
- /** The interaction surfaces Kay itself ships, which plugins drive through `api.interaction`. */
1080
+ /** The interaction surfaces Bonsai itself ships, which plugins drive through `api.interaction`. */
1081
1081
  export declare type InteractionSurfaceName = "browser-pane" | "desktop";
1082
1082
 
1083
1083
  /**
@@ -1224,7 +1224,7 @@ export declare interface JevScoreQuestion {
1224
1224
  * Those are host-side (`@kay/agent-runtime`'s `kay/jev/`).
1225
1225
  * ---
1226
1226
  *
1227
- * The vocabulary is Kay's own (SDK 0.12.0). Before it, `use` received TypeSafe's `TypeSafeClient`
1227
+ * The vocabulary is Bonsai's own (SDK 0.12.0). Before it, `use` received TypeSafe's `TypeSafeClient`
1228
1228
  * and plugins coded against a vendor's types. It follows pi's classifier contract, which the host
1229
1229
  * runs Jev through: a yes/no question is `bool` and answers a `probability`, every instruction and
1230
1230
  * criterion is text, and the state is a JSON object.
@@ -1273,7 +1273,7 @@ declare type JsonValue_3 = string | number | boolean | null | JsonValue_3[] | {
1273
1273
 
1274
1274
  declare const JsonValue_3: z.ZodType<JsonValue_3>;
1275
1275
 
1276
- /** A plugin's Kay agent activation — receives only the brokered {@link KayAgentPluginApi}. */
1276
+ /** A plugin's Bonsai agent activation — receives only the brokered {@link KayAgentPluginApi}. */
1277
1277
  export declare type KayAgentActivate = (api: KayAgentPluginApi) => void;
1278
1278
 
1279
1279
  export declare type KayAgentAdvertisedApiKeyScheme = WithoutImplementation<PluginApiKeyScheme, "validate">;
@@ -1334,7 +1334,7 @@ export declare interface KayAgentAdvertisementAuthApi {
1334
1334
  * means the host bound no concrete authority. A plugin should surface a `grant` refusal to the user
1335
1335
  * and give up quietly on a `source-class` one. Within `grant`, branch on `code` before wording a
1336
1336
  * prompt: `not-granted` means the user has not consented (or has revoked it), while
1337
- * `grant-read-failed` means Kay could not read its own consent store and refused rather than
1337
+ * `grant-read-failed` means Bonsai could not read its own consent store and refused rather than
1338
1338
  * assume — the second is not something a grant prompt fixes.
1339
1339
  *
1340
1340
  * Broker handles are always present, so presence does not imply a current grant or concrete
@@ -1389,7 +1389,7 @@ export declare interface KayAgentInteractionSurfaces {
1389
1389
  readonly browserPane: InteractionSurface;
1390
1390
  /**
1391
1391
  * The user's desktop through the platform's accessibility APIs: native apps as targets
1392
- * (`app://<bundle id>`), their windows' controls as elements. On macOS Kay drives it with its
1392
+ * (`app://<bundle id>`), their windows' controls as elements. On macOS Bonsai drives it with its
1393
1393
  * bundled accessibility worker under the app's Accessibility permission; on a platform with no
1394
1394
  * backend it reports itself unavailable.
1395
1395
  */
@@ -1546,7 +1546,7 @@ export declare interface KayAgentPluginApi {
1546
1546
  */
1547
1547
  readonly process: KayAgentProcess;
1548
1548
  /**
1549
- * Always present; the interaction surfaces Kay ships (its browser pane, and the desktop through
1549
+ * Always present; the interaction surfaces Bonsai ships (its browser pane, and the desktop through
1550
1550
  * the platform accessibility APIs), each call checked against `interaction.surface {surface}`
1551
1551
  * and the session's permissions (see {@link InteractionSurface}).
1552
1552
  * Wrap one in an {@link InteractionDriver} and register it with
@@ -2811,6 +2811,7 @@ declare const KayPluginManifestV1: z.ZodObject<{
2811
2811
  minKayVersion: z.ZodOptional<z.ZodString>;
2812
2812
  sdk: z.ZodOptional<z.ZodString>;
2813
2813
  }, z.core.$strict>>>;
2814
+ ownedByBonsai: z.ZodOptional<z.ZodBoolean>;
2814
2815
  dependencies: z.ZodOptional<z.ZodObject<{
2815
2816
  plugins: z.ZodOptional<z.ZodArray<z.ZodString>>;
2816
2817
  }, z.core.$strict>>;
@@ -2968,7 +2969,7 @@ export declare function num(record: Record<string, unknown> | undefined, key: st
2968
2969
  export declare function numLike(record: Record<string, unknown> | undefined, key: string): number | undefined;
2969
2970
 
2970
2971
  /**
2971
- * Who may supply the OAuth client for a scheme: Kay's embedded client, or one the user pastes in
2972
+ * Who may supply the OAuth client for a scheme: Bonsai's embedded client, or one the user pastes in
2972
2973
  * (BYOOC). An UNORDERED SET — list order carries no meaning (nothing reads it as a preference).
2973
2974
  */
2974
2975
  declare type OAuthClientSupplier = "kay" | "user";
@@ -2990,7 +2991,7 @@ declare interface OAuthRedirectResult {
2990
2991
 
2991
2992
  /**
2992
2993
  * The two client-supply axes, structured so the illegal cell is unrepresentable: a `confidential`
2993
- * exchange's secret may only ever be Kay's (held by the host's broker, never pasted by a
2994
+ * exchange's secret may only ever be Bonsai's (held by the host's broker, never pasted by a
2994
2995
  * customer), so `confidential` types `clientSuppliers` as `readonly ["kay"]` — `confidential ×
2995
2996
  * user` is a compile-time impossibility in v1, not a runtime refusal. `pkce`'s `clientSuppliers`
2996
2997
  * is a non-empty set; {@link createOAuthPkceAuthScheme} dedupes it and refuses empty.
@@ -3422,6 +3423,10 @@ declare const PluginCapabilityRefusalV1: z.ZodObject<{
3422
3423
  target: z.ZodLiteral<"kay.app">;
3423
3424
  slug: z.ZodLiteral<"skills.read">;
3424
3425
  envelope: z.ZodObject<{}, z.core.$strict>;
3426
+ }, z.core.$strict>, z.ZodObject<{
3427
+ target: z.ZodLiteral<"kay.app">;
3428
+ slug: z.ZodLiteral<"tools.describe">;
3429
+ envelope: z.ZodObject<{}, z.core.$strict>;
3425
3430
  }, z.core.$strict>, z.ZodObject<{
3426
3431
  target: z.ZodLiteral<"kay.app">;
3427
3432
  slug: z.ZodLiteral<"workspace.command">;
@@ -3626,7 +3631,7 @@ export declare interface PluginDelegatedScheme {
3626
3631
  readonly connect: (ctx: PluginDelegatedConnectContext) => Promise<PluginDelegatedConnectResult>;
3627
3632
  /**
3628
3633
  * Mint fresh material from the current (expiring) material, including the `data` the last
3629
- * connect or refresh returned. Kay calls this only inside its credential authority, which holds
3634
+ * connect or refresh returned. Bonsai calls this only inside its credential authority, which holds
3630
3635
  * the refresh lease and saves the result; this hook performs the exchange and nothing else.
3631
3636
  * Returned `data` replaces the stored `data`; omitted `data` keeps it. Returned `expiresAt`
3632
3637
  * replaces the stored expiry; omitted `expiresAt` means the new material does not expire.
@@ -3706,7 +3711,7 @@ export declare type PluginOAuthPkceScheme = PluginOAuthSchemeClientAxes & {
3706
3711
  readonly summary?: string;
3707
3712
  readonly authorizationUrl: string;
3708
3713
  readonly tokenUrl: string;
3709
- /** The Kay-supplied embedded client id; omit for a `confidential` scheme or a `pkce` scheme
3714
+ /** The Bonsai-supplied embedded client id; omit for a `confidential` scheme or a `pkce` scheme
3710
3715
  * the host ships no client for. */
3711
3716
  readonly clientId?: string;
3712
3717
  /**
@@ -3755,7 +3760,7 @@ export declare interface PluginServiceDescriptor {
3755
3760
  * (one record per plugin, not per skill) because a skill's asset tree is everything under
3756
3761
  * `dirname(contribution.path)` by convention — a multi-file `SKILL.md` + `references/` tree
3757
3762
  * belongs to the plugin as a whole, the same way {@link PluginSkillDefinition.content} is the
3758
- * plugin's compiled-in codegen pair of one `SKILL.md`. The Kay runtime materializes this record to real
3763
+ * plugin's compiled-in codegen pair of one `SKILL.md`. The Bonsai runtime materializes this record to real
3759
3764
  * files on disk at daemon composition (`<managed>/plugin-assets/<pluginId>/<packageRelativePath>`)
3760
3765
  * so relative references inside a skill resolve the same way a filesystem skill's do — no plugin
3761
3766
  * declares one today, so this is authoring surface ahead of use, not yet exercised by a bundled
@@ -4437,6 +4442,14 @@ export declare interface ToolDefinition<TParams extends ToolParametersWire = Too
4437
4442
  * explicit Stop.
4438
4443
  */
4439
4444
  durationClass?: "fast" | "long";
4445
+ /**
4446
+ * Set only for a tool whose rerun with the same arguments is harmless, such
4447
+ * as one keyed on its own call: after a crash cuts a call off, a pi-durable
4448
+ * session may rerun it with its recorded arguments (without `before_tool`)
4449
+ * instead of ending it as an interrupted error. Absent: never rerun. Ignored
4450
+ * on pi 0.99.1.
4451
+ */
4452
+ replaySafe?: true;
4440
4453
  /**
4441
4454
  * Optional capability⇄scheme binding. When present this tool is auth-gated: discoverable when
4442
4455
  * unauthed, callable once the binding is satisfied. The SDK's {@link withResolvedAuth}
@@ -4528,9 +4541,9 @@ export declare type ToolParametersWire = unknown;
4528
4541
  *
4529
4542
  * The host is trusted to supply honest values; a declared `kind` of `read` moves a call below
4530
4543
  * the protected-path hard-deny (which only fires for non-read kinds), so a tool that could
4531
- * touch protected config must NOT declare `read`. Kay's embedded-experience tools never touch
4544
+ * touch protected config must NOT declare `read`. Bonsai's embedded-experience tools never touch
4532
4545
  * `configDir`, so this is safe for them. `read` is also what every capability surface reports as
4533
- * "read-only" (Kay's Permissions page groups and defaults on it), so it is a claim about what the
4546
+ * "read-only" (Bonsai's Permissions page groups and defaults on it), so it is a claim about what the
4534
4547
  * tool DOES — never a way to buy silence. A tool that should raise no ask on its own account
4535
4548
  * declares {@link ToolPermissionHint.quiet} and keeps its honest `kind`.
4536
4549
  */
@@ -4571,7 +4584,7 @@ declare interface ToolPermissionHint {
4571
4584
  * because the same tool can read on one input and execute on another, which a static `kind`
4572
4585
  * cannot express.
4573
4586
  *
4574
- * Exemplar — Kay's `mcp` proxy tool, one tool spanning every server: `search`/`describe` derive
4587
+ * Exemplar — Bonsai's `mcp` proxy tool, one tool spanning every server: `search`/`describe` derive
4575
4588
  * `{ kind: "read" }` (metadata lookups), while `call` derives
4576
4589
  * `{ kind: "execute", ruleKey: "mcp:<server>::<tool>", scheme: "<server>" }`, so a
4577
4590
  * `{ scheme: "<server>" }` rule gates a whole server and a `{ ruleKey: "mcp:<server>::<tool>" }`
@@ -4612,7 +4625,7 @@ declare interface ToolPermissionHint {
4612
4625
  * really had — not that the result is always stricter than the target's. How much gate is left
4613
4626
  * on such a call is exactly how much the CARRIER carries: an `execute` carrier is stricter than
4614
4627
  * a `read` target and equal to a `mutate`/`destructive` one outside allow mode, while a
4615
- * {@link quiet} carrier (Kay's own `call_tool`) contributes no mode default at all, so the
4628
+ * {@link quiet} carrier (Bonsai's own `call_tool`) contributes no mode default at all, so the
4616
4629
  * fallback leaves nothing but the carrier's rules and the protected-path deny — and the carrier
4617
4630
  * names no path, so that deny has nothing to fire on. This is why a carrier must refuse a target
4618
4631
  * that is itself a carrier: no chain long or circular enough to reach the fallback can be built,
@@ -4636,7 +4649,7 @@ declare interface ToolPermissionHint {
4636
4649
  * whose only effect is invoking the target the gate is already classifying beside it: the
4637
4650
  * target's kind, rules, resources and the protected-path deny all still decide, so a proxied
4638
4651
  * call is gated exactly like the direct one — no more, and no ask the direct call would never
4639
- * have raised. Kay's `call_tool` declares `{ kind: "execute", quiet: true }` (owner ruling,
4652
+ * have raised. Bonsai's `call_tool` declares `{ kind: "execute", quiet: true }` (owner ruling,
4640
4653
  * 2026-08-18): honest about everything it can reach, silent on its own account.
4641
4654
  *
4642
4655
  * Quiet is not ungated, but it IS nearly all the gate a lone carrier has. On a call that
@@ -4881,13 +4894,19 @@ export declare interface UriExtensionModule extends Omit<UriModule, "verbs"> {
4881
4894
  readonly permissionDefaults?: UriPermissionDefaults;
4882
4895
  /** Requires a resolved URI connection before any verb handler runs. */
4883
4896
  readonly requiresConnection?: boolean;
4884
- /** Pure route-aware permission facts; may only strengthen the verb default. */
4897
+ /** Pure route-aware permission facts; see {@link UriExtensionOperationPermissionPolicy}. */
4885
4898
  readonly permission?: UriExtensionOperationPermissionPolicy;
4886
4899
  /** False rejects generic write-tool `source` copies before source fetch. */
4887
4900
  readonly acceptsSourceCopy?: boolean;
4888
4901
  }
4889
4902
 
4890
4903
  declare interface UriExtensionOperationPermissionPolicy {
4904
+ /**
4905
+ * Classify one canonical route, purely. `write`/`edit`/`delete` may only be made stricter
4906
+ * than the verb default; `help`/`read`/`list`/`search` must stay `"read"` (a `ruleKey` is
4907
+ * allowed), because the kernel reruns a crash-interrupted read without asking again. Any
4908
+ * other answer, or a throw, fails the call closed.
4909
+ */
4891
4910
  classifyOperation(request: {
4892
4911
  readonly operation: UriOperation;
4893
4912
  readonly uri: string;
@@ -4925,6 +4944,12 @@ declare interface UriHelp {
4925
4944
  readonly templates?: readonly UriTemplate[];
4926
4945
  readonly examples?: readonly UriExample[];
4927
4946
  readonly notes?: readonly string[];
4947
+ /**
4948
+ * Set when this help, for the address it was asked about, carries text a third party wrote and
4949
+ * the module relays as it received it (an MCP server's own tool names and descriptions), rather
4950
+ * than text the module's author wrote. Absent: the module's own text.
4951
+ */
4952
+ readonly thirdPartyContent?: true;
4928
4953
  }
4929
4954
 
4930
4955
  declare interface UriHintTriggers {
@@ -5115,7 +5140,15 @@ export declare interface UriModule {
5115
5140
  normalize?(input: string, ctx: UriResolveContext): UriNormalizeResult | undefined;
5116
5141
  describe?(input: string, ctx: UriDescribeContext): UriResourceDescription | undefined;
5117
5142
  locate?(input: string, ctx: UriLocateContext): Promise<UriLocateResult>;
5143
+ /**
5144
+ * `read`, `help`, `list` and `search` observe; they never change the resource or anything
5145
+ * outside the host. Repeating one with the same input must be harmless: the kernel reruns a
5146
+ * call of these verbs that a crash cut off, with the same input, without asking the user
5147
+ * again. Idempotent bookkeeping (a cache fill, an index of what was read, a usage count) is
5148
+ * fine; a send, a mark-as-read or a create is not, and belongs on a mutating verb.
5149
+ */
5118
5150
  read(input: string, ctx: UriResolveContext): Promise<RawResource>;
5151
+ /** Observes only; see {@link read}. */
5119
5152
  help?(input: string, ctx: UriResolveContext): Promise<UriHelp>;
5120
5153
  write?(input: string, content: UriPayload, ctx: UriResolveContext): Promise<UriMutationResult | void>;
5121
5154
  /** Opt-in structured write with one or more host-resolved resources delivered beside the content. */
@@ -5138,7 +5171,9 @@ export declare interface UriModule {
5138
5171
  */
5139
5172
  writeBytes?(input: string, bytes: Uint8Array, source: UriSourceDescriptor, ctx: UriResolveContext): Promise<UriMutationResult | void>;
5140
5173
  edit?(input: string, patch: UriPayload, ctx: UriResolveContext): Promise<UriMutationResult>;
5174
+ /** Observes only; see {@link read}. */
5141
5175
  list?(input: string, params: UriListParams, ctx: UriResolveContext): Promise<UriListResult>;
5176
+ /** Observes only; see {@link read}. */
5142
5177
  search?(input: string, params: UriSearchParams, ctx: UriResolveContext): Promise<UriSearchResult>;
5143
5178
  delete?(input: string, ctx: UriResolveContext): Promise<UriMutationResult>;
5144
5179
  toMarkdown?(input: UriMarkdownRenderInput, ctx: UriResolveContext): string | undefined;
@@ -5412,7 +5447,7 @@ export declare interface UriResolveContext {
5412
5447
  * {@link UriResolveContext.sessionId} and just as un-influenceable by the caller — so a module
5413
5448
  * writing to a store it owns can record the actor without the agent being able to choose one.
5414
5449
  *
5415
- * Free text minted by the host's own runtime (Kay's form is `user`, `subagent`,
5450
+ * Free text minted by the host's own runtime (Bonsai's form is `user`, `subagent`,
5416
5451
  * `system/<surface>`, `followup/<surface>`) rather than a closed union: the surface half is the
5417
5452
  * host's vocabulary, and a second enumeration of it here would drift from the first.
5418
5453
  *