@yaklabs-ai/plugin-sdk 0.13.0 → 0.13.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 +37 -33
- package/THIRD-PARTY-INVENTORY.json +1 -1
- package/dist/disclosure.d.ts +47 -23
- package/dist/jev.d.ts +1 -1
- package/dist/kay-agent-testing.d.ts +45 -21
- package/dist/kay-agent.d.ts +50 -26
- package/dist/kay-app.d.ts +155 -58
- package/dist/kay-app.js +22 -1
- package/dist/signals.d.ts +175 -1
- package/dist/signals.js +141 -2
- package/package.json +1 -1
- package/skills/directory-plugin-authoring/SKILL.md +18 -17
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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:
|
|
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
|
|
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.
|
|
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
|
|
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`.
|
|
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" (
|
|
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 —
|
|
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 (
|
|
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.
|
|
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;
|
|
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;
|
|
@@ -3304,7 +3318,15 @@ declare interface UriModule {
|
|
|
3304
3318
|
normalize?(input: string, ctx: UriResolveContext): UriNormalizeResult | undefined;
|
|
3305
3319
|
describe?(input: string, ctx: UriDescribeContext): UriResourceDescription | undefined;
|
|
3306
3320
|
locate?(input: string, ctx: UriLocateContext): Promise<UriLocateResult>;
|
|
3321
|
+
/**
|
|
3322
|
+
* `read`, `help`, `list` and `search` observe; they never change the resource or anything
|
|
3323
|
+
* outside the host. Repeating one with the same input must be harmless: the kernel reruns a
|
|
3324
|
+
* call of these verbs that a crash cut off, with the same input, without asking the user
|
|
3325
|
+
* again. Idempotent bookkeeping (a cache fill, an index of what was read, a usage count) is
|
|
3326
|
+
* fine; a send, a mark-as-read or a create is not, and belongs on a mutating verb.
|
|
3327
|
+
*/
|
|
3307
3328
|
read(input: string, ctx: UriResolveContext): Promise<RawResource>;
|
|
3329
|
+
/** Observes only; see {@link read}. */
|
|
3308
3330
|
help?(input: string, ctx: UriResolveContext): Promise<UriHelp>;
|
|
3309
3331
|
write?(input: string, content: UriPayload, ctx: UriResolveContext): Promise<UriMutationResult | void>;
|
|
3310
3332
|
/** Opt-in structured write with one or more host-resolved resources delivered beside the content. */
|
|
@@ -3327,7 +3349,9 @@ declare interface UriModule {
|
|
|
3327
3349
|
*/
|
|
3328
3350
|
writeBytes?(input: string, bytes: Uint8Array, source: UriSourceDescriptor, ctx: UriResolveContext): Promise<UriMutationResult | void>;
|
|
3329
3351
|
edit?(input: string, patch: UriPayload, ctx: UriResolveContext): Promise<UriMutationResult>;
|
|
3352
|
+
/** Observes only; see {@link read}. */
|
|
3330
3353
|
list?(input: string, params: UriListParams, ctx: UriResolveContext): Promise<UriListResult>;
|
|
3354
|
+
/** Observes only; see {@link read}. */
|
|
3331
3355
|
search?(input: string, params: UriSearchParams, ctx: UriResolveContext): Promise<UriSearchResult>;
|
|
3332
3356
|
delete?(input: string, ctx: UriResolveContext): Promise<UriMutationResult>;
|
|
3333
3357
|
toMarkdown?(input: UriMarkdownRenderInput, ctx: UriResolveContext): string | undefined;
|
|
@@ -3545,7 +3569,7 @@ declare interface UriResolveContext {
|
|
|
3545
3569
|
* {@link UriResolveContext.sessionId} and just as un-influenceable by the caller — so a module
|
|
3546
3570
|
* writing to a store it owns can record the actor without the agent being able to choose one.
|
|
3547
3571
|
*
|
|
3548
|
-
* Free text minted by the host's own runtime (
|
|
3572
|
+
* Free text minted by the host's own runtime (Bonsai's form is `user`, `subagent`,
|
|
3549
3573
|
* `system/<surface>`, `followup/<surface>`) rather than a closed union: the surface half is the
|
|
3550
3574
|
* host's vocabulary, and a second enumeration of it here would drift from the first.
|
|
3551
3575
|
*
|
package/dist/kay-agent.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
@@ -2968,7 +2968,7 @@ export declare function num(record: Record<string, unknown> | undefined, key: st
|
|
|
2968
2968
|
export declare function numLike(record: Record<string, unknown> | undefined, key: string): number | undefined;
|
|
2969
2969
|
|
|
2970
2970
|
/**
|
|
2971
|
-
* Who may supply the OAuth client for a scheme:
|
|
2971
|
+
* Who may supply the OAuth client for a scheme: Bonsai's embedded client, or one the user pastes in
|
|
2972
2972
|
* (BYOOC). An UNORDERED SET — list order carries no meaning (nothing reads it as a preference).
|
|
2973
2973
|
*/
|
|
2974
2974
|
declare type OAuthClientSupplier = "kay" | "user";
|
|
@@ -2990,7 +2990,7 @@ declare interface OAuthRedirectResult {
|
|
|
2990
2990
|
|
|
2991
2991
|
/**
|
|
2992
2992
|
* The two client-supply axes, structured so the illegal cell is unrepresentable: a `confidential`
|
|
2993
|
-
* exchange's secret may only ever be
|
|
2993
|
+
* exchange's secret may only ever be Bonsai's (held by the host's broker, never pasted by a
|
|
2994
2994
|
* customer), so `confidential` types `clientSuppliers` as `readonly ["kay"]` — `confidential ×
|
|
2995
2995
|
* user` is a compile-time impossibility in v1, not a runtime refusal. `pkce`'s `clientSuppliers`
|
|
2996
2996
|
* is a non-empty set; {@link createOAuthPkceAuthScheme} dedupes it and refuses empty.
|
|
@@ -3626,7 +3626,7 @@ export declare interface PluginDelegatedScheme {
|
|
|
3626
3626
|
readonly connect: (ctx: PluginDelegatedConnectContext) => Promise<PluginDelegatedConnectResult>;
|
|
3627
3627
|
/**
|
|
3628
3628
|
* Mint fresh material from the current (expiring) material, including the `data` the last
|
|
3629
|
-
* connect or refresh returned.
|
|
3629
|
+
* connect or refresh returned. Bonsai calls this only inside its credential authority, which holds
|
|
3630
3630
|
* the refresh lease and saves the result; this hook performs the exchange and nothing else.
|
|
3631
3631
|
* Returned `data` replaces the stored `data`; omitted `data` keeps it. Returned `expiresAt`
|
|
3632
3632
|
* replaces the stored expiry; omitted `expiresAt` means the new material does not expire.
|
|
@@ -3706,7 +3706,7 @@ export declare type PluginOAuthPkceScheme = PluginOAuthSchemeClientAxes & {
|
|
|
3706
3706
|
readonly summary?: string;
|
|
3707
3707
|
readonly authorizationUrl: string;
|
|
3708
3708
|
readonly tokenUrl: string;
|
|
3709
|
-
/** The
|
|
3709
|
+
/** The Bonsai-supplied embedded client id; omit for a `confidential` scheme or a `pkce` scheme
|
|
3710
3710
|
* the host ships no client for. */
|
|
3711
3711
|
readonly clientId?: string;
|
|
3712
3712
|
/**
|
|
@@ -3755,7 +3755,7 @@ export declare interface PluginServiceDescriptor {
|
|
|
3755
3755
|
* (one record per plugin, not per skill) because a skill's asset tree is everything under
|
|
3756
3756
|
* `dirname(contribution.path)` by convention — a multi-file `SKILL.md` + `references/` tree
|
|
3757
3757
|
* 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
|
|
3758
|
+
* plugin's compiled-in codegen pair of one `SKILL.md`. The Bonsai runtime materializes this record to real
|
|
3759
3759
|
* files on disk at daemon composition (`<managed>/plugin-assets/<pluginId>/<packageRelativePath>`)
|
|
3760
3760
|
* so relative references inside a skill resolve the same way a filesystem skill's do — no plugin
|
|
3761
3761
|
* declares one today, so this is authoring surface ahead of use, not yet exercised by a bundled
|
|
@@ -4437,6 +4437,14 @@ export declare interface ToolDefinition<TParams extends ToolParametersWire = Too
|
|
|
4437
4437
|
* explicit Stop.
|
|
4438
4438
|
*/
|
|
4439
4439
|
durationClass?: "fast" | "long";
|
|
4440
|
+
/**
|
|
4441
|
+
* Set only for a tool whose rerun with the same arguments is harmless, such
|
|
4442
|
+
* as one keyed on its own call: after a crash cuts a call off, a pi-durable
|
|
4443
|
+
* session may rerun it with its recorded arguments (without `before_tool`)
|
|
4444
|
+
* instead of ending it as an interrupted error. Absent: never rerun. Ignored
|
|
4445
|
+
* on pi 0.99.1.
|
|
4446
|
+
*/
|
|
4447
|
+
replaySafe?: true;
|
|
4440
4448
|
/**
|
|
4441
4449
|
* Optional capability⇄scheme binding. When present this tool is auth-gated: discoverable when
|
|
4442
4450
|
* unauthed, callable once the binding is satisfied. The SDK's {@link withResolvedAuth}
|
|
@@ -4528,9 +4536,9 @@ export declare type ToolParametersWire = unknown;
|
|
|
4528
4536
|
*
|
|
4529
4537
|
* The host is trusted to supply honest values; a declared `kind` of `read` moves a call below
|
|
4530
4538
|
* 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`.
|
|
4539
|
+
* touch protected config must NOT declare `read`. Bonsai's embedded-experience tools never touch
|
|
4532
4540
|
* `configDir`, so this is safe for them. `read` is also what every capability surface reports as
|
|
4533
|
-
* "read-only" (
|
|
4541
|
+
* "read-only" (Bonsai's Permissions page groups and defaults on it), so it is a claim about what the
|
|
4534
4542
|
* tool DOES — never a way to buy silence. A tool that should raise no ask on its own account
|
|
4535
4543
|
* declares {@link ToolPermissionHint.quiet} and keeps its honest `kind`.
|
|
4536
4544
|
*/
|
|
@@ -4571,7 +4579,7 @@ declare interface ToolPermissionHint {
|
|
|
4571
4579
|
* because the same tool can read on one input and execute on another, which a static `kind`
|
|
4572
4580
|
* cannot express.
|
|
4573
4581
|
*
|
|
4574
|
-
* Exemplar —
|
|
4582
|
+
* Exemplar — Bonsai's `mcp` proxy tool, one tool spanning every server: `search`/`describe` derive
|
|
4575
4583
|
* `{ kind: "read" }` (metadata lookups), while `call` derives
|
|
4576
4584
|
* `{ kind: "execute", ruleKey: "mcp:<server>::<tool>", scheme: "<server>" }`, so a
|
|
4577
4585
|
* `{ scheme: "<server>" }` rule gates a whole server and a `{ ruleKey: "mcp:<server>::<tool>" }`
|
|
@@ -4612,7 +4620,7 @@ declare interface ToolPermissionHint {
|
|
|
4612
4620
|
* really had — not that the result is always stricter than the target's. How much gate is left
|
|
4613
4621
|
* on such a call is exactly how much the CARRIER carries: an `execute` carrier is stricter than
|
|
4614
4622
|
* a `read` target and equal to a `mutate`/`destructive` one outside allow mode, while a
|
|
4615
|
-
* {@link quiet} carrier (
|
|
4623
|
+
* {@link quiet} carrier (Bonsai's own `call_tool`) contributes no mode default at all, so the
|
|
4616
4624
|
* fallback leaves nothing but the carrier's rules and the protected-path deny — and the carrier
|
|
4617
4625
|
* names no path, so that deny has nothing to fire on. This is why a carrier must refuse a target
|
|
4618
4626
|
* that is itself a carrier: no chain long or circular enough to reach the fallback can be built,
|
|
@@ -4636,7 +4644,7 @@ declare interface ToolPermissionHint {
|
|
|
4636
4644
|
* whose only effect is invoking the target the gate is already classifying beside it: the
|
|
4637
4645
|
* target's kind, rules, resources and the protected-path deny all still decide, so a proxied
|
|
4638
4646
|
* call is gated exactly like the direct one — no more, and no ask the direct call would never
|
|
4639
|
-
* have raised.
|
|
4647
|
+
* have raised. Bonsai's `call_tool` declares `{ kind: "execute", quiet: true }` (owner ruling,
|
|
4640
4648
|
* 2026-08-18): honest about everything it can reach, silent on its own account.
|
|
4641
4649
|
*
|
|
4642
4650
|
* Quiet is not ungated, but it IS nearly all the gate a lone carrier has. On a call that
|
|
@@ -4881,13 +4889,19 @@ export declare interface UriExtensionModule extends Omit<UriModule, "verbs"> {
|
|
|
4881
4889
|
readonly permissionDefaults?: UriPermissionDefaults;
|
|
4882
4890
|
/** Requires a resolved URI connection before any verb handler runs. */
|
|
4883
4891
|
readonly requiresConnection?: boolean;
|
|
4884
|
-
/** Pure route-aware permission facts;
|
|
4892
|
+
/** Pure route-aware permission facts; see {@link UriExtensionOperationPermissionPolicy}. */
|
|
4885
4893
|
readonly permission?: UriExtensionOperationPermissionPolicy;
|
|
4886
4894
|
/** False rejects generic write-tool `source` copies before source fetch. */
|
|
4887
4895
|
readonly acceptsSourceCopy?: boolean;
|
|
4888
4896
|
}
|
|
4889
4897
|
|
|
4890
4898
|
declare interface UriExtensionOperationPermissionPolicy {
|
|
4899
|
+
/**
|
|
4900
|
+
* Classify one canonical route, purely. `write`/`edit`/`delete` may only be made stricter
|
|
4901
|
+
* than the verb default; `help`/`read`/`list`/`search` must stay `"read"` (a `ruleKey` is
|
|
4902
|
+
* allowed), because the kernel reruns a crash-interrupted read without asking again. Any
|
|
4903
|
+
* other answer, or a throw, fails the call closed.
|
|
4904
|
+
*/
|
|
4891
4905
|
classifyOperation(request: {
|
|
4892
4906
|
readonly operation: UriOperation;
|
|
4893
4907
|
readonly uri: string;
|
|
@@ -5115,7 +5129,15 @@ export declare interface UriModule {
|
|
|
5115
5129
|
normalize?(input: string, ctx: UriResolveContext): UriNormalizeResult | undefined;
|
|
5116
5130
|
describe?(input: string, ctx: UriDescribeContext): UriResourceDescription | undefined;
|
|
5117
5131
|
locate?(input: string, ctx: UriLocateContext): Promise<UriLocateResult>;
|
|
5132
|
+
/**
|
|
5133
|
+
* `read`, `help`, `list` and `search` observe; they never change the resource or anything
|
|
5134
|
+
* outside the host. Repeating one with the same input must be harmless: the kernel reruns a
|
|
5135
|
+
* call of these verbs that a crash cut off, with the same input, without asking the user
|
|
5136
|
+
* again. Idempotent bookkeeping (a cache fill, an index of what was read, a usage count) is
|
|
5137
|
+
* fine; a send, a mark-as-read or a create is not, and belongs on a mutating verb.
|
|
5138
|
+
*/
|
|
5118
5139
|
read(input: string, ctx: UriResolveContext): Promise<RawResource>;
|
|
5140
|
+
/** Observes only; see {@link read}. */
|
|
5119
5141
|
help?(input: string, ctx: UriResolveContext): Promise<UriHelp>;
|
|
5120
5142
|
write?(input: string, content: UriPayload, ctx: UriResolveContext): Promise<UriMutationResult | void>;
|
|
5121
5143
|
/** Opt-in structured write with one or more host-resolved resources delivered beside the content. */
|
|
@@ -5138,7 +5160,9 @@ export declare interface UriModule {
|
|
|
5138
5160
|
*/
|
|
5139
5161
|
writeBytes?(input: string, bytes: Uint8Array, source: UriSourceDescriptor, ctx: UriResolveContext): Promise<UriMutationResult | void>;
|
|
5140
5162
|
edit?(input: string, patch: UriPayload, ctx: UriResolveContext): Promise<UriMutationResult>;
|
|
5163
|
+
/** Observes only; see {@link read}. */
|
|
5141
5164
|
list?(input: string, params: UriListParams, ctx: UriResolveContext): Promise<UriListResult>;
|
|
5165
|
+
/** Observes only; see {@link read}. */
|
|
5142
5166
|
search?(input: string, params: UriSearchParams, ctx: UriResolveContext): Promise<UriSearchResult>;
|
|
5143
5167
|
delete?(input: string, ctx: UriResolveContext): Promise<UriMutationResult>;
|
|
5144
5168
|
toMarkdown?(input: UriMarkdownRenderInput, ctx: UriResolveContext): string | undefined;
|
|
@@ -5412,7 +5436,7 @@ export declare interface UriResolveContext {
|
|
|
5412
5436
|
* {@link UriResolveContext.sessionId} and just as un-influenceable by the caller — so a module
|
|
5413
5437
|
* writing to a store it owns can record the actor without the agent being able to choose one.
|
|
5414
5438
|
*
|
|
5415
|
-
* Free text minted by the host's own runtime (
|
|
5439
|
+
* Free text minted by the host's own runtime (Bonsai's form is `user`, `subagent`,
|
|
5416
5440
|
* `system/<surface>`, `followup/<surface>`) rather than a closed union: the surface half is the
|
|
5417
5441
|
* host's vocabulary, and a second enumeration of it here would drift from the first.
|
|
5418
5442
|
*
|