@yaklabs-ai/plugin-sdk 0.48.0 → 0.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,7 +13,7 @@ it under the name your plugin code actually imports:
13
13
  ```json
14
14
  {
15
15
  "dependencies": {
16
- "@bonsai/plugin-sdk": "npm:@yaklabs-ai/plugin-sdk@^0.48.0"
16
+ "@bonsai/plugin-sdk": "npm:@yaklabs-ai/plugin-sdk@^0.49.0"
17
17
  }
18
18
  }
19
19
  ```
@@ -62,7 +62,7 @@ Every tool the entrypoint registers is declared in the manifest too:
62
62
  "description": "Greets people by name.",
63
63
  "version": "0.1.0",
64
64
  "namespace": "widgets",
65
- "compatibility": { "sdk": "^0.48.0" },
65
+ "compatibility": { "sdk": "^0.49.0" },
66
66
  "targets": {
67
67
  "kay": {
68
68
  "agent": {
@@ -134,22 +134,23 @@ naming both versions, instead of loading it and finding no `activate`.
134
134
 
135
135
  ## Entrypoints
136
136
 
137
- | Import | What it gives you |
138
- | --------------------------------------- | ------------------------------------------------------------------------------- |
139
- | `@bonsai/plugin-sdk/kay-agent` | Tools, URI modules, search providers, auth — the per-session agent surface |
140
- | `@bonsai/plugin-sdk/kay-app` | App-lifetime surface: storage, endpoints, app-scoped URI modules |
141
- | `@bonsai/plugin-sdk/kay-agent/testing` | `invokeToolForTest`, `fauxAuthContext` — for your own `node --test` runs |
142
- | `@bonsai/plugin-sdk/disclosure` | The conformance audit Bonsai gates your plugin with — run it before you ship |
143
- | `@bonsai/plugin-sdk/time` | `Temporal` (Bonsai's own instance) and the time-zone helpers, from 0.13.6 |
144
- | `@bonsai/plugin-sdk/transcript` | The active-branch walk; the turn walk and run records from 0.13.6 |
145
- | `@bonsai/plugin-sdk/transcript-review` | The review fold: a session's spans, tool-call attempts and records, from 0.13.7 |
146
- | `@bonsai/plugin-sdk/agent-conversation` | How a session's agent-to-agent traffic groups into conversations, from 0.13.7 |
147
- | `@bonsai/plugin-sdk/app-data` | The app-data size caps, on an entry with no other import, from 0.13.7 |
148
- | `@bonsai/plugin-sdk/vendored-mcp` | The kit for a plugin built on a vendor's hosted MCP server, from 0.13.7 |
149
- | `@bonsai/plugin-sdk/system-one` | The types and error class for `api.systemOne` / `app.systemOne`, from 0.13.8 |
150
- | `@bonsai/plugin-sdk/zod` | `z` (the host's in the daemon), on an entry with no other import, from 0.13.9 |
151
-
152
- A plugin that imports these subpaths declares the current supported SDK range (`^0.19.0`).
137
+ | Import | What it gives you |
138
+ | --------------------------------------- | ---------------------------------------------------------------------------------------- |
139
+ | `@bonsai/plugin-sdk/kay-agent` | Tools, URI modules, search providers, auth — the per-session agent surface |
140
+ | `@bonsai/plugin-sdk/kay-app` | App-lifetime surface: storage, endpoints, app-scoped URI modules |
141
+ | `@bonsai/plugin-sdk/uri` | Sessionless resource caller types, revision digest and unavailable fallback, from 0.49.0 |
142
+ | `@bonsai/plugin-sdk/kay-agent/testing` | `invokeToolForTest`, `fauxAuthContext` — for your own `node --test` runs |
143
+ | `@bonsai/plugin-sdk/disclosure` | The conformance audit Bonsai gates your plugin with — run it before you ship |
144
+ | `@bonsai/plugin-sdk/time` | `Temporal` (Bonsai's own instance) and the time-zone helpers, from 0.13.6 |
145
+ | `@bonsai/plugin-sdk/transcript` | The active-branch walk; the turn walk and run records from 0.13.6 |
146
+ | `@bonsai/plugin-sdk/transcript-review` | The review fold: a session's spans, tool-call attempts and records, from 0.13.7 |
147
+ | `@bonsai/plugin-sdk/agent-conversation` | How a session's agent-to-agent traffic groups into conversations, from 0.13.7 |
148
+ | `@bonsai/plugin-sdk/app-data` | The app-data size caps, on an entry with no other import, from 0.13.7 |
149
+ | `@bonsai/plugin-sdk/vendored-mcp` | The kit for a plugin built on a vendor's hosted MCP server, from 0.13.7 |
150
+ | `@bonsai/plugin-sdk/system-one` | The types and error class for `api.systemOne` / `app.systemOne`, from 0.13.8 |
151
+ | `@bonsai/plugin-sdk/zod` | `z` (the host's in the daemon), on an entry with no other import, from 0.13.9 |
152
+
153
+ A plugin that imports these subpaths declares the current supported SDK range (`^0.49.0`).
153
154
  The rows record when each subpath appeared, not retained runtime compatibility. `vendored-mcp` builds the plugin's URI module (its link cards and help); hosting the
154
155
  vendor's MCP server itself is a separate host decision: Bonsai hosts it once a person approves
155
156
  the plugin's `mcp.host-server` grant for that server's name and URL. A server that needs an OAuth
@@ -157,7 +158,7 @@ sign-in names one of the plugin's auth services in `authService`; that service m
157
158
  one `delegated` scheme, which Bonsai uses to sign the person in to the server. Bonsai declares that
158
159
  scheme at runtime; the plugin's code must not declare it again. From 0.16.2 a plugin's code can also
159
160
  call the server's tools through `api.vendoredMcp.port(<server>)`, typed by this subpath's
160
- `VendoredMcpPort` and `VendoredMcpOutcome` (declare `^0.19.0`).
161
+ `VendoredMcpPort` and `VendoredMcpOutcome` (declare `^0.49.0`).
161
162
 
162
163
  From 0.13.10 the manifest schema carries two facts Bonsai reads for its own plugins only; another
163
164
  plugin's are ignored, with a load diagnostic. An `external-cli` auth scheme's `cli` says how Bonsai
@@ -227,6 +228,19 @@ A newer floor always has a release: every change to the rule set publishes a
227
228
  version of this package as it lands, so "update and re-run" is never blocked on
228
229
  someone remembering to cut one. If the numbers differ, a newer version exists.
229
230
 
231
+ ## Sessionless calls (0.49.0)
232
+
233
+ Both backend targets expose `uri.read/list/search/write/edit/delete`. Calls return native
234
+ resources, bytes and revisions. Exact `uri.call` grants name the canonical scheme and verb;
235
+ declaring a dependency grants no authority. Declared cross-plugin endpoint calls are deferred
236
+ to the next slice of #15758.
237
+
238
+ `app.memory` and its `KayAppMemory*` types are removed. Use complete `memory://` addresses
239
+ through `app.uri`, parse returned Markdown in the consuming plugin, and retain the read's
240
+ revision (or `contentDigest` from `/uri`) for edits. The old `memory.read` and `memory.write`
241
+ grants do not authorize the replacement scheme-and-verb calls. Earlier SDK contracts are
242
+ refused; migrate and declare `^0.49.0`.
243
+
230
244
  ## What this package is, and is not, at runtime
231
245
 
232
246
  Installing this SDK gives you **types, editor completion, and a runtime you can
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "package": "@yaklabs-ai/plugin-sdk",
4
- "version": "0.48.0",
4
+ "version": "0.49.0",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [
@@ -2446,8 +2446,15 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2446
2446
  * 0.47.0 adds card layouts and builders; successful card submits now require a summary.
2447
2447
  *
2448
2448
  * 0.48.0 adds the models.complete UI capability.
2449
+ *
2450
+ * 0.48.1 adds app-tool metadata, conditional tool permissions and screen-action declarations.
2451
+ *
2452
+ * 0.49.0 adds sessionless URI calls on both backend targets. It removes app.memory and its note
2453
+ * types; callers use the resource surface instead. Previously admitted SDK contracts are no
2454
+ * longer served because they included app.memory on notebook hosts. No compatibility alias
2455
+ * restores it; callers migrate and declare ^0.49.0.
2449
2456
  */
2450
- declare const KAY_PLUGIN_SDK_VERSION: "0.48.0";
2457
+ declare const KAY_PLUGIN_SDK_VERSION: "0.49.0";
2451
2458
 
2452
2459
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2453
2460
 
@@ -2672,7 +2679,7 @@ declare interface KayAgentNetwork {
2672
2679
  * here; the plugin never touches an `ExtensionApi`, `child_process`, credentials, or Electron.
2673
2680
  */
2674
2681
  declare interface KayAgentPluginApi {
2675
- readonly uri: {
2682
+ readonly uri: PluginUriCaller & {
2676
2683
  /** Register a whole URI module (a scheme handler that owns its address space, e.g. `drive://`). */
2677
2684
  registerModule(module: UriExtensionModule): void;
2678
2685
  };
@@ -4497,6 +4504,38 @@ declare const PluginToolName: z.ZodString;
4497
4504
 
4498
4505
  declare type PluginToolName = z.infer<typeof PluginToolName>;
4499
4506
 
4507
+ /**
4508
+ * Sessionless resource calls. Each call checks the calling target's exact scheme and verb grant.
4509
+ * Results retain provider bytes, metadata and revisions; provider failures retain their URI tags.
4510
+ * A cancellation or lost response does not prove a mutation was not applied.
4511
+ */
4512
+ declare interface PluginUriCaller {
4513
+ read(input: string, options?: PluginUriReadOptions): Promise<RawResource>;
4514
+ list(input: string, params?: UriListParams, options?: PluginUriCallOptions): Promise<UriListResult>;
4515
+ search(input: string, params: UriSearchParams, options?: PluginUriCallOptions): Promise<UriSearchResult>;
4516
+ write(input: string, content?: UriPayload | Uint8Array, options?: PluginUriWriteOptions): Promise<UriMutationResult | void>;
4517
+ edit(input: string, payload: UriPayload, options?: PluginUriMutationOptions): Promise<UriMutationResult>;
4518
+ delete(input: string, options?: PluginUriMutationOptions): Promise<UriMutationResult>;
4519
+ }
4520
+
4521
+ declare interface PluginUriCallOptions {
4522
+ readonly cwd?: string;
4523
+ readonly signal?: AbortSignal;
4524
+ }
4525
+
4526
+ declare interface PluginUriMutationOptions extends PluginUriCallOptions {
4527
+ readonly expectedRevision?: string;
4528
+ }
4529
+
4530
+ declare interface PluginUriReadOptions extends PluginUriCallOptions {
4531
+ readonly knownRevision?: string;
4532
+ }
4533
+
4534
+ declare interface PluginUriWriteOptions extends PluginUriMutationOptions {
4535
+ readonly sources?: readonly UriWriteSource[];
4536
+ readonly writeSource?: UriSourceDescriptor;
4537
+ }
4538
+
4500
4539
  declare const Properties: (input: string) => [unknown, string] | [];
4501
4540
 
4502
4541
  declare function PropertiesMapping(input: [unknown, unknown, unknown]): unknown;
@@ -10061,6 +10100,8 @@ declare interface UriResolveContext {
10061
10100
  * resolve a URI outside any verb call.
10062
10101
  */
10063
10102
  readonly sessionId?: string;
10103
+ /** Host-stamped calling plugin; absent for session dispatch and resolver matching. */
10104
+ readonly callerPluginId?: string;
10064
10105
  /**
10065
10106
  * WHO the dispatching session acts as, stamped by the host at the same dispatch site as
10066
10107
  * {@link UriResolveContext.sessionId} and just as un-influenceable by the caller - so a module
@@ -722,6 +722,21 @@ async function auditSkillCodegenPairFile(skill, declaration, packageDir) {
722
722
  return violations;
723
723
  }
724
724
 
725
+ // packages/plugin-sdk/dist/uri.js
726
+ function createUnavailableUriCaller(message) {
727
+ const unavailable = async () => {
728
+ throw new Error(message);
729
+ };
730
+ return {
731
+ read: unavailable,
732
+ list: unavailable,
733
+ search: unavailable,
734
+ write: unavailable,
735
+ edit: unavailable,
736
+ delete: unavailable
737
+ };
738
+ }
739
+
725
740
  // packages/plugin-sdk/dist/kay-agent/endpoints.js
726
741
  function createUnavailableEndpoints(message) {
727
742
  return {
@@ -917,6 +932,7 @@ function collectUriModulesFromKayAgentActivate(activate) {
917
932
  const modules = [];
918
933
  const fakeApi = {
919
934
  uri: {
935
+ ...createUnavailableUriCaller("URI calls are unavailable while probing a plugin"),
920
936
  registerModule: (module) => {
921
937
  modules.push(module);
922
938
  }
@@ -1196,7 +1196,7 @@ declare function FactorMapping(input: [unknown, unknown, unknown, unknown, unkno
1196
1196
  export declare function fauxAuthContext(overrides?: Partial<ExtensionAuthContext>): ExtensionAuthContext;
1197
1197
 
1198
1198
  /** The capability handles a `KayAgentPluginApi` always carries - authority is decided per call. */
1199
- export declare type FauxKayAgentCapabilities = Pick<KayAgentPluginApi, "network" | "webSession" | "process" | "whiteboard" | "interaction" | "interceptToolCall" | "implementTool" | "systemOne" | "events" | "featureFlags" | "time" | "log" | "userFiles" | "familyFolder" | "vendoredMcp" | "endpoints" | "compiler">;
1199
+ export declare type FauxKayAgentCapabilities = Pick<KayAgentPluginApi, "uri" | "network" | "webSession" | "process" | "whiteboard" | "interaction" | "interceptToolCall" | "implementTool" | "systemOne" | "events" | "featureFlags" | "time" | "log" | "userFiles" | "familyFolder" | "vendoredMcp" | "endpoints" | "compiler">;
1200
1200
 
1201
1201
  export declare function fauxKayAgentCapabilities(): FauxKayAgentCapabilities;
1202
1202
 
@@ -2500,8 +2500,15 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2500
2500
  * 0.47.0 adds card layouts and builders; successful card submits now require a summary.
2501
2501
  *
2502
2502
  * 0.48.0 adds the models.complete UI capability.
2503
+ *
2504
+ * 0.48.1 adds app-tool metadata, conditional tool permissions and screen-action declarations.
2505
+ *
2506
+ * 0.49.0 adds sessionless URI calls on both backend targets. It removes app.memory and its note
2507
+ * types; callers use the resource surface instead. Previously admitted SDK contracts are no
2508
+ * longer served because they included app.memory on notebook hosts. No compatibility alias
2509
+ * restores it; callers migrate and declare ^0.49.0.
2503
2510
  */
2504
- declare const KAY_PLUGIN_SDK_VERSION: "0.48.0";
2511
+ declare const KAY_PLUGIN_SDK_VERSION: "0.49.0";
2505
2512
 
2506
2513
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2507
2514
 
@@ -2723,7 +2730,7 @@ declare interface KayAgentNetwork {
2723
2730
  * here; the plugin never touches an `ExtensionApi`, `child_process`, credentials, or Electron.
2724
2731
  */
2725
2732
  declare interface KayAgentPluginApi {
2726
- readonly uri: {
2733
+ readonly uri: PluginUriCaller & {
2727
2734
  /** Register a whole URI module (a scheme handler that owns its address space, e.g. `drive://`). */
2728
2735
  registerModule(module: UriExtensionModule): void;
2729
2736
  };
@@ -4493,6 +4500,38 @@ declare const PluginToolName: z.ZodString;
4493
4500
 
4494
4501
  declare type PluginToolName = z.infer<typeof PluginToolName>;
4495
4502
 
4503
+ /**
4504
+ * Sessionless resource calls. Each call checks the calling target's exact scheme and verb grant.
4505
+ * Results retain provider bytes, metadata and revisions; provider failures retain their URI tags.
4506
+ * A cancellation or lost response does not prove a mutation was not applied.
4507
+ */
4508
+ declare interface PluginUriCaller {
4509
+ read(input: string, options?: PluginUriReadOptions): Promise<RawResource>;
4510
+ list(input: string, params?: UriListParams, options?: PluginUriCallOptions): Promise<UriListResult>;
4511
+ search(input: string, params: UriSearchParams, options?: PluginUriCallOptions): Promise<UriSearchResult>;
4512
+ write(input: string, content?: UriPayload | Uint8Array, options?: PluginUriWriteOptions): Promise<UriMutationResult | void>;
4513
+ edit(input: string, payload: UriPayload, options?: PluginUriMutationOptions): Promise<UriMutationResult>;
4514
+ delete(input: string, options?: PluginUriMutationOptions): Promise<UriMutationResult>;
4515
+ }
4516
+
4517
+ declare interface PluginUriCallOptions {
4518
+ readonly cwd?: string;
4519
+ readonly signal?: AbortSignal;
4520
+ }
4521
+
4522
+ declare interface PluginUriMutationOptions extends PluginUriCallOptions {
4523
+ readonly expectedRevision?: string;
4524
+ }
4525
+
4526
+ declare interface PluginUriReadOptions extends PluginUriCallOptions {
4527
+ readonly knownRevision?: string;
4528
+ }
4529
+
4530
+ declare interface PluginUriWriteOptions extends PluginUriMutationOptions {
4531
+ readonly sources?: readonly UriWriteSource[];
4532
+ readonly writeSource?: UriSourceDescriptor;
4533
+ }
4534
+
4496
4535
  /**
4497
4536
  * What a run did to a URI. The words match the automation run wire's artifact actions. When one
4498
4537
  * run both creates and updates a URI, the reader reports `created`.
@@ -5364,6 +5403,32 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5364
5403
  }, z.core.$strict>;
5365
5404
  }, z.core.$strict>>;
5366
5405
  kayAgentUriModules: z.ZodOptional<z.ZodArray<z.ZodObject<{
5406
+ screenActions: z.ZodExactOptional<z.ZodObject<{
5407
+ scheme: z.ZodString;
5408
+ hosts: z.ZodArray<z.ZodString>;
5409
+ paths: z.ZodOptional<z.ZodArray<z.ZodString>>;
5410
+ apps: z.ZodArray<z.ZodString>;
5411
+ options: z.ZodRecord<z.ZodString, z.ZodDiscriminatedUnion<[z.ZodObject<{
5412
+ kind: z.ZodLiteral<"exact">;
5413
+ description: z.ZodString;
5414
+ verb: z.ZodEnum<{
5415
+ read: "read";
5416
+ write: "write";
5417
+ edit: "edit";
5418
+ delete: "delete";
5419
+ }>;
5420
+ uri: z.ZodString;
5421
+ }, z.core.$strict>, z.ZodObject<{
5422
+ kind: z.ZodLiteral<"catch-all">;
5423
+ description: z.ZodString;
5424
+ verb: z.ZodEnum<{
5425
+ read: "read";
5426
+ write: "write";
5427
+ edit: "edit";
5428
+ delete: "delete";
5429
+ }>;
5430
+ }, z.core.$strict>], "kind">>;
5431
+ }, z.core.$strict>>;
5367
5432
  claims: z.ZodExactOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
5368
5433
  kind: z.ZodLiteral<"scheme">;
5369
5434
  scheme: z.ZodString;
@@ -5400,27 +5465,27 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5400
5465
  list: "list";
5401
5466
  read: "read";
5402
5467
  write: "write";
5403
- help: "help";
5404
5468
  edit: "edit";
5405
5469
  delete: "delete";
5470
+ help: "help";
5406
5471
  }>>>;
5407
5472
  operationDocs: z.ZodExactOptional<z.ZodRecord<z.ZodEnum<{
5408
5473
  search: "search";
5409
5474
  list: "list";
5410
5475
  read: "read";
5411
5476
  write: "write";
5412
- help: "help";
5413
5477
  edit: "edit";
5414
5478
  delete: "delete";
5479
+ help: "help";
5415
5480
  }> & z.core.$partial, z.ZodString>>;
5416
5481
  operationDefaults: z.ZodExactOptional<z.ZodRecord<z.ZodEnum<{
5417
5482
  search: "search";
5418
5483
  list: "list";
5419
5484
  read: "read";
5420
5485
  write: "write";
5421
- help: "help";
5422
5486
  edit: "edit";
5423
5487
  delete: "delete";
5488
+ help: "help";
5424
5489
  }> & z.core.$partial, z.ZodEnum<{
5425
5490
  never: "never";
5426
5491
  allow: "allow";
@@ -5482,9 +5547,9 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5482
5547
  list: "list";
5483
5548
  read: "read";
5484
5549
  write: "write";
5485
- help: "help";
5486
5550
  edit: "edit";
5487
5551
  delete: "delete";
5552
+ help: "help";
5488
5553
  }>>>;
5489
5554
  routes: z.ZodExactOptional<z.ZodArray<z.ZodString>>;
5490
5555
  query: z.ZodExactOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -5495,9 +5560,9 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5495
5560
  list: "list";
5496
5561
  read: "read";
5497
5562
  write: "write";
5498
- help: "help";
5499
5563
  edit: "edit";
5500
5564
  delete: "delete";
5565
+ help: "help";
5501
5566
  }>>>;
5502
5567
  routes: z.ZodExactOptional<z.ZodArray<z.ZodString>>;
5503
5568
  query: z.ZodExactOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
@@ -5586,15 +5651,80 @@ declare const ResolvedPluginContractV1: z.ZodObject<{
5586
5651
  scheme: z.ZodOptional<z.ZodString>;
5587
5652
  resourcePrefix: z.ZodOptional<z.ZodString>;
5588
5653
  resourceArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
5654
+ resourceTrim: z.ZodOptional<z.ZodLiteral<true>>;
5655
+ defaultPermission: z.ZodOptional<z.ZodEnum<{
5656
+ never: "never";
5657
+ allow: "allow";
5658
+ ask: "ask";
5659
+ }>>;
5660
+ classificationRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
5661
+ when: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
5662
+ arg: z.ZodString;
5663
+ equals: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
5664
+ }, z.core.$strict>, z.ZodObject<{
5665
+ arg: z.ZodString;
5666
+ present: z.ZodBoolean;
5667
+ }, z.core.$strict>]>>;
5668
+ kind: z.ZodEnum<{
5669
+ read: "read";
5670
+ mutate: "mutate";
5671
+ destructive: "destructive";
5672
+ execute: "execute";
5673
+ }>;
5674
+ ruleKey: z.ZodOptional<z.ZodString>;
5675
+ }, z.core.$strict>>>;
5589
5676
  }, z.core.$strict>>;
5590
5677
  localId: z.ZodString;
5591
5678
  globalId: z.ZodString;
5592
5679
  toolName: z.ZodString;
5593
5680
  }, z.core.$strict>>>;
5594
5681
  kayAppTools: z.ZodOptional<z.ZodArray<z.ZodObject<{
5682
+ description: z.ZodOptional<z.ZodString>;
5595
5683
  localId: z.ZodString;
5596
- globalId: z.ZodString;
5684
+ displayName: z.ZodOptional<z.ZodString>;
5597
5685
  toolName: z.ZodString;
5686
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<authoringCommonSchemas.JsonValue, unknown, z.core.$ZodTypeInternals<authoringCommonSchemas.JsonValue, unknown>>>>;
5687
+ executionMode: z.ZodOptional<z.ZodEnum<{
5688
+ sequential: "sequential";
5689
+ parallel: "parallel";
5690
+ }>>;
5691
+ promptSnippet: z.ZodOptional<z.ZodString>;
5692
+ promptGuidelines: z.ZodOptional<z.ZodArray<z.ZodString>>;
5693
+ permission: z.ZodOptional<z.ZodObject<{
5694
+ kind: z.ZodEnum<{
5695
+ read: "read";
5696
+ mutate: "mutate";
5697
+ destructive: "destructive";
5698
+ execute: "execute";
5699
+ }>;
5700
+ ruleKey: z.ZodOptional<z.ZodString>;
5701
+ scheme: z.ZodOptional<z.ZodString>;
5702
+ resourcePrefix: z.ZodOptional<z.ZodString>;
5703
+ resourceArgs: z.ZodOptional<z.ZodArray<z.ZodString>>;
5704
+ resourceTrim: z.ZodOptional<z.ZodLiteral<true>>;
5705
+ defaultPermission: z.ZodOptional<z.ZodEnum<{
5706
+ never: "never";
5707
+ allow: "allow";
5708
+ ask: "ask";
5709
+ }>>;
5710
+ classificationRules: z.ZodOptional<z.ZodArray<z.ZodObject<{
5711
+ when: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
5712
+ arg: z.ZodString;
5713
+ equals: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
5714
+ }, z.core.$strict>, z.ZodObject<{
5715
+ arg: z.ZodString;
5716
+ present: z.ZodBoolean;
5717
+ }, z.core.$strict>]>>;
5718
+ kind: z.ZodEnum<{
5719
+ read: "read";
5720
+ mutate: "mutate";
5721
+ destructive: "destructive";
5722
+ execute: "execute";
5723
+ }>;
5724
+ ruleKey: z.ZodOptional<z.ZodString>;
5725
+ }, z.core.$strict>>>;
5726
+ }, z.core.$strict>>;
5727
+ globalId: z.ZodString;
5598
5728
  }, z.core.$strict>>>;
5599
5729
  kayAppApprovalTypes: z.ZodOptional<z.ZodArray<z.ZodObject<{
5600
5730
  kind: z.ZodLiteral<"message">;
@@ -11233,6 +11363,8 @@ declare interface UriResolveContext {
11233
11363
  * resolve a URI outside any verb call.
11234
11364
  */
11235
11365
  readonly sessionId?: string;
11366
+ /** Host-stamped calling plugin; absent for session dispatch and resolver matching. */
11367
+ readonly callerPluginId?: string;
11236
11368
  /**
11237
11369
  * WHO the dispatching session acts as, stamped by the host at the same dispatch site as
11238
11370
  * {@link UriResolveContext.sessionId} and just as un-influenceable by the caller - so a module
@@ -123,16 +123,31 @@ function createKayPluginLog(write, bound = {}) {
123
123
  }
124
124
 
125
125
  // packages/plugin-sdk/dist/kay-agent/declared-tool.js
126
- function permissionHint(permission) {
127
- const { kind, ruleKey, resourceArgs, scheme, resourcePrefix } = permission;
126
+ function declaredToolPermission(permission) {
127
+ const { kind, ruleKey, resourceArgs, scheme, resourcePrefix, resourceTrim, defaultPermission, classificationRules } = permission;
128
128
  return {
129
129
  kind,
130
130
  ...scheme === void 0 ? {} : { scheme },
131
131
  ...ruleKey === void 0 ? {} : { ruleKey },
132
+ ...defaultPermission === void 0 ? {} : { defaultPermission },
133
+ ...classificationRules === void 0 ? {} : {
134
+ deriveClassification: (input) => {
135
+ const rule = classificationRules.find((candidate) => candidate.when.every((condition) => {
136
+ const value = Object.hasOwn(input, condition.arg) ? input[condition.arg] : void 0;
137
+ return "equals" in condition ? value === condition.equals : value !== void 0 === condition.present;
138
+ }));
139
+ return rule === void 0 ? void 0 : {
140
+ kind: rule.kind,
141
+ ...rule.ruleKey === void 0 ? {} : { ruleKey: rule.ruleKey }
142
+ };
143
+ }
144
+ },
132
145
  ...resourceArgs === void 0 ? {} : {
133
146
  deriveResources: (input) => resourceArgs.flatMap((arg) => {
134
147
  const value = input[arg];
135
- return typeof value === "string" ? [`${resourcePrefix ?? ""}${value}`] : [];
148
+ return typeof value === "string" ? [
149
+ `${resourcePrefix ?? ""}${resourceTrim === true ? value.trim() : value}`
150
+ ] : [];
136
151
  })
137
152
  }
138
153
  };
@@ -156,7 +171,7 @@ function declaredToolDefinition(tool, execute) {
156
171
  ...requiresAuth.schemeId === void 0 ? {} : { schemeId: requiresAuth.schemeId }
157
172
  }
158
173
  },
159
- ...permission === void 0 ? {} : { permission: permissionHint(permission) },
174
+ ...permission === void 0 ? {} : { permission: declaredToolPermission(permission) },
160
175
  execute
161
176
  };
162
177
  }
@@ -262,6 +277,16 @@ var USER_FILE_METHODS = [
262
277
  ];
263
278
  function fauxKayAgentCapabilities() {
264
279
  return {
280
+ uri: {
281
+ read: unwired("uri.read"),
282
+ list: unwired("uri.list"),
283
+ search: unwired("uri.search"),
284
+ write: unwired("uri.write"),
285
+ edit: unwired("uri.edit"),
286
+ delete: unwired("uri.delete"),
287
+ registerModule: () => {
288
+ }
289
+ },
265
290
  network: { fetch: unwired("network.fetch") },
266
291
  webSession: {
267
292
  request: unwired("webSession.request"),
@@ -813,6 +813,8 @@ export declare function createUnavailableCompiler(message: string): KayAgentComp
813
813
  */
814
814
  export declare function createUnavailableEndpoints(message: string): KayAgentEndpoints;
815
815
 
816
+ export declare function createUnavailableUriCaller(message: string): PluginUriCaller;
817
+
816
818
  /** What the module holds at mutation time: a provider revision, the current content, or both. */
817
819
  export declare interface CurrentResourceState {
818
820
  readonly revision?: string;
@@ -2775,8 +2777,15 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2775
2777
  * 0.47.0 adds card layouts and builders; successful card submits now require a summary.
2776
2778
  *
2777
2779
  * 0.48.0 adds the models.complete UI capability.
2780
+ *
2781
+ * 0.48.1 adds app-tool metadata, conditional tool permissions and screen-action declarations.
2782
+ *
2783
+ * 0.49.0 adds sessionless URI calls on both backend targets. It removes app.memory and its note
2784
+ * types; callers use the resource surface instead. Previously admitted SDK contracts are no
2785
+ * longer served because they included app.memory on notebook hosts. No compatibility alias
2786
+ * restores it; callers migrate and declare ^0.49.0.
2778
2787
  */
2779
- declare const KAY_PLUGIN_SDK_VERSION: "0.48.0";
2788
+ declare const KAY_PLUGIN_SDK_VERSION: "0.49.0";
2780
2789
 
2781
2790
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2782
2791
 
@@ -3030,7 +3039,7 @@ export declare interface KayAgentNetwork {
3030
3039
  * here; the plugin never touches an `ExtensionApi`, `child_process`, credentials, or Electron.
3031
3040
  */
3032
3041
  export declare interface KayAgentPluginApi {
3033
- readonly uri: {
3042
+ readonly uri: PluginUriCaller & {
3034
3043
  /** Register a whole URI module (a scheme handler that owns its address space, e.g. `drive://`). */
3035
3044
  registerModule(module: UriExtensionModule): void;
3036
3045
  };
@@ -5103,13 +5112,22 @@ declare const PluginCapabilityRefusalV1: z.ZodObject<{
5103
5112
  slug: z.ZodLiteral<"signals.read">;
5104
5113
  envelope: z.ZodObject<{}, z.core.$strict>;
5105
5114
  }, z.core.$strict>, z.ZodObject<{
5106
- target: z.ZodLiteral<"kay.app">;
5107
- slug: z.ZodLiteral<"memory.read">;
5108
- envelope: z.ZodObject<{}, z.core.$strict>;
5109
- }, z.core.$strict>, z.ZodObject<{
5110
- target: z.ZodLiteral<"kay.app">;
5111
- slug: z.ZodLiteral<"memory.write">;
5112
- envelope: z.ZodObject<{}, z.core.$strict>;
5115
+ target: z.ZodEnum<{
5116
+ "kay.agent": "kay.agent";
5117
+ "kay.app": "kay.app";
5118
+ }>;
5119
+ slug: z.ZodLiteral<"uri.call">;
5120
+ envelope: z.ZodObject<{
5121
+ scheme: z.ZodString;
5122
+ verb: z.ZodEnum<{
5123
+ search: "search";
5124
+ list: "list";
5125
+ read: "read";
5126
+ write: "write";
5127
+ edit: "edit";
5128
+ delete: "delete";
5129
+ }>;
5130
+ }, z.core.$strict>;
5113
5131
  }, z.core.$strict>, z.ZodObject<{
5114
5132
  target: z.ZodLiteral<"kay.app">;
5115
5133
  slug: z.ZodLiteral<"skills.read">;
@@ -5564,6 +5582,38 @@ declare const PluginToolName: z.ZodString;
5564
5582
 
5565
5583
  declare type PluginToolName = z.infer<typeof PluginToolName>;
5566
5584
 
5585
+ /**
5586
+ * Sessionless resource calls. Each call checks the calling target's exact scheme and verb grant.
5587
+ * Results retain provider bytes, metadata and revisions; provider failures retain their URI tags.
5588
+ * A cancellation or lost response does not prove a mutation was not applied.
5589
+ */
5590
+ export declare interface PluginUriCaller {
5591
+ read(input: string, options?: PluginUriReadOptions): Promise<RawResource>;
5592
+ list(input: string, params?: UriListParams, options?: PluginUriCallOptions): Promise<UriListResult>;
5593
+ search(input: string, params: UriSearchParams, options?: PluginUriCallOptions): Promise<UriSearchResult>;
5594
+ write(input: string, content?: UriPayload | Uint8Array, options?: PluginUriWriteOptions): Promise<UriMutationResult | void>;
5595
+ edit(input: string, payload: UriPayload, options?: PluginUriMutationOptions): Promise<UriMutationResult>;
5596
+ delete(input: string, options?: PluginUriMutationOptions): Promise<UriMutationResult>;
5597
+ }
5598
+
5599
+ export declare interface PluginUriCallOptions {
5600
+ readonly cwd?: string;
5601
+ readonly signal?: AbortSignal;
5602
+ }
5603
+
5604
+ export declare interface PluginUriMutationOptions extends PluginUriCallOptions {
5605
+ readonly expectedRevision?: string;
5606
+ }
5607
+
5608
+ export declare interface PluginUriReadOptions extends PluginUriCallOptions {
5609
+ readonly knownRevision?: string;
5610
+ }
5611
+
5612
+ export declare interface PluginUriWriteOptions extends PluginUriMutationOptions {
5613
+ readonly sources?: readonly UriWriteSource[];
5614
+ readonly writeSource?: UriSourceDescriptor;
5615
+ }
5616
+
5567
5617
  /**
5568
5618
  * What a run did to a URI. The words match the automation run wire's artifact actions. When one
5569
5619
  * run both creates and updates a URI, the reader reports `created`.
@@ -11452,6 +11502,8 @@ export declare interface UriResolveContext {
11452
11502
  * resolve a URI outside any verb call.
11453
11503
  */
11454
11504
  readonly sessionId?: string;
11505
+ /** Host-stamped calling plugin; absent for session dispatch and resolver matching. */
11506
+ readonly callerPluginId?: string;
11455
11507
  /**
11456
11508
  * WHO the dispatching session acts as, stamped by the host at the same dispatch site as
11457
11509
  * {@link UriResolveContext.sessionId} and just as un-influenceable by the caller - so a module
package/dist/kay-agent.js CHANGED
@@ -982,6 +982,21 @@ function capability(spec) {
982
982
  return { ...spec };
983
983
  }
984
984
 
985
+ // packages/plugin-sdk/dist/uri.js
986
+ function createUnavailableUriCaller(message) {
987
+ const unavailable = async () => {
988
+ throw new Error(message);
989
+ };
990
+ return {
991
+ read: unavailable,
992
+ list: unavailable,
993
+ search: unavailable,
994
+ write: unavailable,
995
+ edit: unavailable,
996
+ delete: unavailable
997
+ };
998
+ }
999
+
985
1000
  // packages/herd-uri-extensions/dist/limits.js
986
1001
  var MAX_BYTES = 50 * 1024 * 1024;
987
1002
  var MAX_OUTPUT_CHARS = 5e5;
@@ -1716,6 +1731,7 @@ export {
1716
1731
  createOsascriptRunner,
1717
1732
  createUnavailableCompiler,
1718
1733
  createUnavailableEndpoints,
1734
+ createUnavailableUriCaller,
1719
1735
  declareProducedResources,
1720
1736
  defineAuthedTool,
1721
1737
  defineTool,