@yaklabs-ai/plugin-sdk 0.48.1 → 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.1"
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.1" },
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.1",
4
+ "version": "0.49.0",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [
@@ -2448,8 +2448,13 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2448
2448
  * 0.48.0 adds the models.complete UI capability.
2449
2449
  *
2450
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.
2451
2456
  */
2452
- declare const KAY_PLUGIN_SDK_VERSION: "0.48.1";
2457
+ declare const KAY_PLUGIN_SDK_VERSION: "0.49.0";
2453
2458
 
2454
2459
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2455
2460
 
@@ -2674,7 +2679,7 @@ declare interface KayAgentNetwork {
2674
2679
  * here; the plugin never touches an `ExtensionApi`, `child_process`, credentials, or Electron.
2675
2680
  */
2676
2681
  declare interface KayAgentPluginApi {
2677
- readonly uri: {
2682
+ readonly uri: PluginUriCaller & {
2678
2683
  /** Register a whole URI module (a scheme handler that owns its address space, e.g. `drive://`). */
2679
2684
  registerModule(module: UriExtensionModule): void;
2680
2685
  };
@@ -4499,6 +4504,38 @@ declare const PluginToolName: z.ZodString;
4499
4504
 
4500
4505
  declare type PluginToolName = z.infer<typeof PluginToolName>;
4501
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
+
4502
4539
  declare const Properties: (input: string) => [unknown, string] | [];
4503
4540
 
4504
4541
  declare function PropertiesMapping(input: [unknown, unknown, unknown]): unknown;
@@ -10063,6 +10100,8 @@ declare interface UriResolveContext {
10063
10100
  * resolve a URI outside any verb call.
10064
10101
  */
10065
10102
  readonly sessionId?: string;
10103
+ /** Host-stamped calling plugin; absent for session dispatch and resolver matching. */
10104
+ readonly callerPluginId?: string;
10066
10105
  /**
10067
10106
  * WHO the dispatching session acts as, stamped by the host at the same dispatch site as
10068
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
 
@@ -2502,8 +2502,13 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2502
2502
  * 0.48.0 adds the models.complete UI capability.
2503
2503
  *
2504
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.
2505
2510
  */
2506
- declare const KAY_PLUGIN_SDK_VERSION: "0.48.1";
2511
+ declare const KAY_PLUGIN_SDK_VERSION: "0.49.0";
2507
2512
 
2508
2513
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2509
2514
 
@@ -2725,7 +2730,7 @@ declare interface KayAgentNetwork {
2725
2730
  * here; the plugin never touches an `ExtensionApi`, `child_process`, credentials, or Electron.
2726
2731
  */
2727
2732
  declare interface KayAgentPluginApi {
2728
- readonly uri: {
2733
+ readonly uri: PluginUriCaller & {
2729
2734
  /** Register a whole URI module (a scheme handler that owns its address space, e.g. `drive://`). */
2730
2735
  registerModule(module: UriExtensionModule): void;
2731
2736
  };
@@ -4495,6 +4500,38 @@ declare const PluginToolName: z.ZodString;
4495
4500
 
4496
4501
  declare type PluginToolName = z.infer<typeof PluginToolName>;
4497
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
+
4498
4535
  /**
4499
4536
  * What a run did to a URI. The words match the automation run wire's artifact actions. When one
4500
4537
  * run both creates and updates a URI, the reader reports `created`.
@@ -11326,6 +11363,8 @@ declare interface UriResolveContext {
11326
11363
  * resolve a URI outside any verb call.
11327
11364
  */
11328
11365
  readonly sessionId?: string;
11366
+ /** Host-stamped calling plugin; absent for session dispatch and resolver matching. */
11367
+ readonly callerPluginId?: string;
11329
11368
  /**
11330
11369
  * WHO the dispatching session acts as, stamped by the host at the same dispatch site as
11331
11370
  * {@link UriResolveContext.sessionId} and just as un-influenceable by the caller - so a module
@@ -277,6 +277,16 @@ var USER_FILE_METHODS = [
277
277
  ];
278
278
  function fauxKayAgentCapabilities() {
279
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
+ },
280
290
  network: { fetch: unwired("network.fetch") },
281
291
  webSession: {
282
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;
@@ -2777,8 +2779,13 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2777
2779
  * 0.48.0 adds the models.complete UI capability.
2778
2780
  *
2779
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.
2780
2787
  */
2781
- declare const KAY_PLUGIN_SDK_VERSION: "0.48.1";
2788
+ declare const KAY_PLUGIN_SDK_VERSION: "0.49.0";
2782
2789
 
2783
2790
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2784
2791
 
@@ -3032,7 +3039,7 @@ export declare interface KayAgentNetwork {
3032
3039
  * here; the plugin never touches an `ExtensionApi`, `child_process`, credentials, or Electron.
3033
3040
  */
3034
3041
  export declare interface KayAgentPluginApi {
3035
- readonly uri: {
3042
+ readonly uri: PluginUriCaller & {
3036
3043
  /** Register a whole URI module (a scheme handler that owns its address space, e.g. `drive://`). */
3037
3044
  registerModule(module: UriExtensionModule): void;
3038
3045
  };
@@ -5105,13 +5112,22 @@ declare const PluginCapabilityRefusalV1: z.ZodObject<{
5105
5112
  slug: z.ZodLiteral<"signals.read">;
5106
5113
  envelope: z.ZodObject<{}, z.core.$strict>;
5107
5114
  }, z.core.$strict>, z.ZodObject<{
5108
- target: z.ZodLiteral<"kay.app">;
5109
- slug: z.ZodLiteral<"memory.read">;
5110
- envelope: z.ZodObject<{}, z.core.$strict>;
5111
- }, z.core.$strict>, z.ZodObject<{
5112
- target: z.ZodLiteral<"kay.app">;
5113
- slug: z.ZodLiteral<"memory.write">;
5114
- 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>;
5115
5131
  }, z.core.$strict>, z.ZodObject<{
5116
5132
  target: z.ZodLiteral<"kay.app">;
5117
5133
  slug: z.ZodLiteral<"skills.read">;
@@ -5566,6 +5582,38 @@ declare const PluginToolName: z.ZodString;
5566
5582
 
5567
5583
  declare type PluginToolName = z.infer<typeof PluginToolName>;
5568
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
+
5569
5617
  /**
5570
5618
  * What a run did to a URI. The words match the automation run wire's artifact actions. When one
5571
5619
  * run both creates and updates a URI, the reader reports `created`.
@@ -11454,6 +11502,8 @@ export declare interface UriResolveContext {
11454
11502
  * resolve a URI outside any verb call.
11455
11503
  */
11456
11504
  readonly sessionId?: string;
11505
+ /** Host-stamped calling plugin; absent for session dispatch and resolver matching. */
11506
+ readonly callerPluginId?: string;
11457
11507
  /**
11458
11508
  * WHO the dispatching session acts as, stamped by the host at the same dispatch site as
11459
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,
package/dist/kay-app.d.ts CHANGED
@@ -830,6 +830,12 @@ declare function ConstructorParameters_2<Type extends TSchema>(type: Type, optio
830
830
  /** Creates a deferred ConstructorParameters action. */
831
831
  declare function ConstructorParametersDeferred<Type extends TSchema>(type: Type, options?: TSchemaOptions): TConstructorParametersDeferred<Type>;
832
832
 
833
+ /**
834
+ * Stable digest of a read's content, the revision a module without one gets.
835
+ * Prefixed so a provider revision can never collide with it by accident.
836
+ */
837
+ export declare function contentDigest(content: string | Uint8Array): string;
838
+
833
839
  export declare interface CorpusResourceInvocation {
834
840
  readonly eventId: string;
835
841
  /** Envelope recording time, never a run/message/incident identifier. */
@@ -964,6 +970,8 @@ export declare function createUnavailableSkills(message: string): KayAppSkills;
964
970
  */
965
971
  export declare function createUnavailableTools(): KayAppTools;
966
972
 
973
+ export declare function createUnavailableUriCaller(message: string): PluginUriCaller;
974
+
967
975
  /**
968
976
  * A `KayAppUsage` that answers `unavailable` to every call: what a host with no telemetry lane
969
977
  * binds, so `app.usage` stays present on every host.
@@ -2887,8 +2895,13 @@ declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2887
2895
  * 0.48.0 adds the models.complete UI capability.
2888
2896
  *
2889
2897
  * 0.48.1 adds app-tool metadata, conditional tool permissions and screen-action declarations.
2898
+ *
2899
+ * 0.49.0 adds sessionless URI calls on both backend targets. It removes app.memory and its note
2900
+ * types; callers use the resource surface instead. Previously admitted SDK contracts are no
2901
+ * longer served because they included app.memory on notebook hosts. No compatibility alias
2902
+ * restores it; callers migrate and declare ^0.49.0.
2890
2903
  */
2891
- declare const KAY_PLUGIN_SDK_VERSION: "0.48.1";
2904
+ declare const KAY_PLUGIN_SDK_VERSION: "0.49.0";
2892
2905
 
2893
2906
  declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2894
2907
 
@@ -4828,60 +4841,6 @@ export declare interface KayAppMcp {
4828
4841
  }): Promise<VendoredMcpOutcome>;
4829
4842
  }
4830
4843
 
4831
- /**
4832
- * Notes through Memory's ordinary notebook operations, without a chat session. Each call checks
4833
- * `memory.read` or `memory.write`; a missing notebook or refused grant rejects. Paths are note
4834
- * addresses such as `facts/this-computer`, without the `memory://` scheme.
4835
- */
4836
- export declare interface KayAppMemory {
4837
- read(path: string): Promise<KayAppMemoryNote | undefined>;
4838
- /** Create a note; an existing address is a conflict. */
4839
- create(path: string, input: KayAppMemoryNoteInput, options?: {
4840
- readonly signal?: AbortSignal;
4841
- }): Promise<void>;
4842
- /** Edit only the revision returned by `read`; concurrent changes reject as a conflict. */
4843
- edit(path: string, input: KayAppMemoryNoteEdit, options: {
4844
- readonly expectedRevision: string;
4845
- }): Promise<void>;
4846
- }
4847
-
4848
- export declare interface KayAppMemoryNote {
4849
- readonly name: string;
4850
- readonly description: string;
4851
- readonly body: string;
4852
- readonly frontmatter: Readonly<Record<string, unknown>> | undefined;
4853
- readonly revision: string;
4854
- }
4855
-
4856
- export declare interface KayAppMemoryNoteEdit {
4857
- readonly frontmatter?: {
4858
- readonly name?: string;
4859
- readonly description?: string;
4860
- };
4861
- readonly body?: {
4862
- readonly replace: string;
4863
- } | {
4864
- readonly edits: readonly {
4865
- readonly oldText: string;
4866
- readonly newText: string;
4867
- }[];
4868
- };
4869
- }
4870
-
4871
- export declare interface KayAppMemoryNoteInput {
4872
- readonly name: string;
4873
- readonly description: string;
4874
- readonly body: string;
4875
- readonly sources?: readonly KayAppMemoryNoteSource[];
4876
- }
4877
-
4878
- export declare interface KayAppMemoryNoteSource {
4879
- readonly id: string;
4880
- readonly uri: string;
4881
- readonly kind?: "user" | "source";
4882
- readonly at?: string;
4883
- }
4884
-
4885
4844
  /** Input to one bounded direct model completion with no transcript or tools. */
4886
4845
  export declare interface KayAppModelCompleteInput {
4887
4846
  /** Attribution slug (`^[a-z][a-z0-9-]*$`) naming what this call is for. */
@@ -5494,8 +5453,7 @@ export declare interface KayAppPluginApi {
5494
5453
  * present, like {@link signals}.
5495
5454
  */
5496
5455
  readonly skills: KayAppSkills;
5497
- /** Memory note operations; absent when this host has no notebook composition. */
5498
- readonly memory?: KayAppMemory;
5456
+ readonly uri: PluginUriCaller;
5499
5457
  /**
5500
5458
  * Private API: only plugins Bonsai ships; refused for any other. The assistant's personality
5501
5459
  * file, each call checked against `soul.write`. Absent when the host composed no soul store.
@@ -10178,6 +10136,38 @@ declare const PluginToolName: z.ZodString;
10178
10136
 
10179
10137
  declare type PluginToolName = z.infer<typeof PluginToolName>;
10180
10138
 
10139
+ /**
10140
+ * Sessionless resource calls. Each call checks the calling target's exact scheme and verb grant.
10141
+ * Results retain provider bytes, metadata and revisions; provider failures retain their URI tags.
10142
+ * A cancellation or lost response does not prove a mutation was not applied.
10143
+ */
10144
+ export declare interface PluginUriCaller {
10145
+ read(input: string, options?: PluginUriReadOptions): Promise<RawResource>;
10146
+ list(input: string, params?: UriListParams, options?: PluginUriCallOptions): Promise<UriListResult>;
10147
+ search(input: string, params: UriSearchParams, options?: PluginUriCallOptions): Promise<UriSearchResult>;
10148
+ write(input: string, content?: UriPayload | Uint8Array, options?: PluginUriWriteOptions): Promise<UriMutationResult | void>;
10149
+ edit(input: string, payload: UriPayload, options?: PluginUriMutationOptions): Promise<UriMutationResult>;
10150
+ delete(input: string, options?: PluginUriMutationOptions): Promise<UriMutationResult>;
10151
+ }
10152
+
10153
+ export declare interface PluginUriCallOptions {
10154
+ readonly cwd?: string;
10155
+ readonly signal?: AbortSignal;
10156
+ }
10157
+
10158
+ export declare interface PluginUriMutationOptions extends PluginUriCallOptions {
10159
+ readonly expectedRevision?: string;
10160
+ }
10161
+
10162
+ export declare interface PluginUriReadOptions extends PluginUriCallOptions {
10163
+ readonly knownRevision?: string;
10164
+ }
10165
+
10166
+ export declare interface PluginUriWriteOptions extends PluginUriMutationOptions {
10167
+ readonly sources?: readonly UriWriteSource[];
10168
+ readonly writeSource?: UriSourceDescriptor;
10169
+ }
10170
+
10181
10171
  export declare interface PreparedAccessApproval {
10182
10172
  readonly uri: string;
10183
10173
  readonly content: Record<string, unknown>;
@@ -16644,6 +16634,8 @@ declare interface UriResolveContext_2 {
16644
16634
  * resolve a URI outside any verb call.
16645
16635
  */
16646
16636
  readonly sessionId?: string;
16637
+ /** Host-stamped calling plugin; absent for session dispatch and resolver matching. */
16638
+ readonly callerPluginId?: string;
16647
16639
  /**
16648
16640
  * WHO the dispatching session acts as, stamped by the host at the same dispatch site as
16649
16641
  * {@link UriResolveContext.sessionId} and just as un-influenceable by the caller - so a module