@yaklabs-ai/plugin-protocol 0.10.0 → 0.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,7 +11,7 @@ flow.
11
11
  ```json
12
12
  {
13
13
  "dependencies": {
14
- "@kay/plugin-protocol": "npm:@yaklabs-ai/plugin-protocol@^0.10.0"
14
+ "@kay/plugin-protocol": "npm:@yaklabs-ai/plugin-protocol@^0.12.2"
15
15
  }
16
16
  }
17
17
  ```
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "package": "@yaklabs-ai/plugin-protocol",
4
- "version": "0.10.0",
4
+ "version": "0.12.2",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [],
@@ -12,12 +12,6 @@
12
12
  "source": "https://github.com/colinhacks/zod",
13
13
  "note": "Installed as a consumer dependency; it is not bundled into the staged artifacts.",
14
14
  "versionRange": "^4.0.0"
15
- },
16
- {
17
- "name": "@typesafe-ai/sdk",
18
- "license": "MIT",
19
- "source": "https://github.com/typesafe-ai/typesafe-sdk-js",
20
- "note": "Types-only: the SDK re-exports the vendor's Jev client types, and the vendor's nominal class must stay a single declaration across entrypoints. Installed as a consumer dependency; a plugin never declares it itself."
21
15
  }
22
16
  ]
23
17
  }
package/dist/index.d.ts CHANGED
@@ -263,6 +263,7 @@ export declare const ArtifactProvenanceCaptureContextSchema: z.ZodObject<{
263
263
  "turn-settled": "turn-settled";
264
264
  "phase-shift": "phase-shift";
265
265
  "human-message": "human-message";
266
+ "ui-action": "ui-action";
266
267
  }>;
267
268
  entryId: z.ZodString;
268
269
  runId: z.ZodOptional<z.ZodString>;
@@ -355,6 +356,7 @@ export declare const ArtifactProvenanceCaptureContextSchema: z.ZodObject<{
355
356
  "turn-settled": "turn-settled";
356
357
  "phase-shift": "phase-shift";
357
358
  "human-message": "human-message";
359
+ "ui-action": "ui-action";
358
360
  }>;
359
361
  entryId: z.ZodString;
360
362
  runId: z.ZodOptional<z.ZodString>;
@@ -451,6 +453,7 @@ export declare const ArtifactProvenanceCause: z.ZodDiscriminatedUnion<[z.ZodObje
451
453
  "turn-settled": "turn-settled";
452
454
  "phase-shift": "phase-shift";
453
455
  "human-message": "human-message";
456
+ "ui-action": "ui-action";
454
457
  }>;
455
458
  entryId: z.ZodString;
456
459
  runId: z.ZodOptional<z.ZodString>;
@@ -528,6 +531,7 @@ export declare const ArtifactProvenanceEnvelopeV1: z.ZodPipe<z.ZodUnknown, z.Zod
528
531
  "turn-settled": "turn-settled";
529
532
  "phase-shift": "phase-shift";
530
533
  "human-message": "human-message";
534
+ "ui-action": "ui-action";
531
535
  }>;
532
536
  entryId: z.ZodString;
533
537
  runId: z.ZodOptional<z.ZodString>;
@@ -619,6 +623,7 @@ export declare const ArtifactProvenanceEnvelopeV1: z.ZodPipe<z.ZodUnknown, z.Zod
619
623
  "turn-settled": "turn-settled";
620
624
  "phase-shift": "phase-shift";
621
625
  "human-message": "human-message";
626
+ "ui-action": "ui-action";
622
627
  }>;
623
628
  entryId: z.ZodString;
624
629
  runId: z.ZodOptional<z.ZodString>;
@@ -735,6 +740,7 @@ export declare const ArtifactProvenanceEnvelopeV1: z.ZodPipe<z.ZodUnknown, z.Zod
735
740
  "turn-settled": "turn-settled";
736
741
  "phase-shift": "phase-shift";
737
742
  "human-message": "human-message";
743
+ "ui-action": "ui-action";
738
744
  }>;
739
745
  entryId: z.ZodString;
740
746
  runId: z.ZodOptional<z.ZodString>;
@@ -906,6 +912,7 @@ export declare const ArtifactProvenanceMutation: z.ZodObject<{
906
912
  "turn-settled": "turn-settled";
907
913
  "phase-shift": "phase-shift";
908
914
  "human-message": "human-message";
915
+ "ui-action": "ui-action";
909
916
  }>;
910
917
  entryId: z.ZodString;
911
918
  runId: z.ZodOptional<z.ZodString>;
@@ -1001,6 +1008,7 @@ export declare const ArtifactProvenanceOperation: z.ZodObject<{
1001
1008
  "turn-settled": "turn-settled";
1002
1009
  "phase-shift": "phase-shift";
1003
1010
  "human-message": "human-message";
1011
+ "ui-action": "ui-action";
1004
1012
  }>;
1005
1013
  entryId: z.ZodString;
1006
1014
  runId: z.ZodOptional<z.ZodString>;
@@ -1141,6 +1149,7 @@ export declare const ArtifactProvenanceSession: z.ZodObject<{
1141
1149
  "turn-settled": "turn-settled";
1142
1150
  "phase-shift": "phase-shift";
1143
1151
  "human-message": "human-message";
1152
+ "ui-action": "ui-action";
1144
1153
  }>;
1145
1154
  entryId: z.ZodString;
1146
1155
  runId: z.ZodOptional<z.ZodString>;
@@ -1869,6 +1878,23 @@ export declare const HttpsUrl: z.ZodURL;
1869
1878
 
1870
1879
  export declare type HttpsUrl = z.infer<typeof HttpsUrl>;
1871
1880
 
1881
+ /**
1882
+ * An Interaction driver (a backend behind the harness-owned `interaction_*` tools) the plugin's
1883
+ * `kay.agent` entrypoint registers with `api.registerInteractionDriver`. The driver's `id` must be
1884
+ * this `localId`; `kind` says whether it drives web pages ("browser", Browser Interaction) or
1885
+ * native apps ("computer-use", Computer Use Interaction).
1886
+ */
1887
+ export declare const InteractionDriverContribution: z.ZodObject<{
1888
+ localId: z.ZodString;
1889
+ displayName: z.ZodOptional<z.ZodString>;
1890
+ kind: z.ZodEnum<{
1891
+ browser: "browser";
1892
+ "computer-use": "computer-use";
1893
+ }>;
1894
+ }, z.core.$strict>;
1895
+
1896
+ export declare type InteractionDriverContribution = z.infer<typeof InteractionDriverContribution>;
1897
+
1872
1898
  /** Whether the report permits the plugin to load. */
1873
1899
  export declare function isCompatible(report: KayPluginCompatibilityReport): boolean;
1874
1900
 
@@ -1935,7 +1961,7 @@ export declare const KAY_APP_DATA_SNAPSHOT_MAX_BYTES: number;
1935
1961
  export declare const KAY_EVENT_PUBLISHER_ID: "kay";
1936
1962
 
1937
1963
  /** Released SDK contracts still implemented by the host, alongside its current SDK. */
1938
- export declare const KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS: readonly ["0.8.0", "0.8.1", "0.8.2", "0.8.3", "0.8.4", "0.8.5", "0.9.0", "0.9.1"];
1964
+ export declare const KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS: readonly ["0.8.0", "0.8.1", "0.8.2", "0.8.3", "0.8.4", "0.8.5", "0.9.0", "0.9.1", "0.10.0", "0.11.0", "0.11.1", "0.12.0", "0.12.1"];
1939
1965
 
1940
1966
  export declare const KAY_PLUGIN_PROTOCOL_PACKAGE_NAME: "@kay/plugin-protocol";
1941
1967
 
@@ -2061,8 +2087,63 @@ export declare const KAY_PLUGIN_PROTOCOL_VERSION: "kay.plugin.v1";
2061
2087
  * `app.automations.create` with a `spawn-session` effect now throws
2062
2088
  * explicitly at the call site instead of being accepted, for any plugin
2063
2089
  * regardless of its declared SDK range.
2090
+ *
2091
+ * 0.11.0 adds `producedResources` to `KayAppAutomationRunDetail` (every URI a
2092
+ * run wrote, edited or declared, as one list deduplicated by URI) and the
2093
+ * `produced-resource-unnamed` member to `KayAppProvenanceGapCode`. An
2094
+ * authoring-type break only: code that builds a run detail must supply the
2095
+ * new list, and an exhaustive switch over gap codes must handle the new one.
2096
+ * 0.10.0 stays in the runtime-contract retention list below, because a plugin
2097
+ * compiled against it reads the same run detail and simply ignores the list.
2098
+ *
2099
+ * 0.11.1 adds read-only skill metadata (`app.skills`: `list`, `read`, `history`),
2100
+ * checked per call against the new `skills.read` claim. Additive: a plugin
2101
+ * compiled against 0.11.0 never reads the member. A plugin that calls it
2102
+ * declares `^0.11.1`, so an older host refuses it at load instead of the call
2103
+ * failing.
2104
+ *
2105
+ * 0.12.0 replaces the vendor client `api.withJev` hands its callback. `use`
2106
+ * now receives Kay's own `JevClient` (`@kay/plugin-sdk/jev`): one method,
2107
+ * `classify({state, questions})`, in Kay's question and answer vocabulary
2108
+ * (yes/no is `bool` answering `probability`; instructions and criteria are
2109
+ * text; the state is a JSON object), rejecting with a classified
2110
+ * `JevCallError`. TypeSafe's `TypeSafeClient`, `SystemOneRequest`,
2111
+ * `SystemOneResult`, `Questions`, and the `NoulResponse`/`ChoiceResponse`/
2112
+ * `ScoreResponse` re-exports are gone, and the SDK no longer depends on
2113
+ * `@typesafe-ai/sdk`. `app.signals.observe` takes the same questions, answers
2114
+ * `invalid` for a state that is not a JSON object, and its reads type stored
2115
+ * answers as `KayAppSignalAnswer` (a `JevAnswer`, or a yes/no answer recorded
2116
+ * before 0.12.0 as `{type: "noul", noul}`).
2117
+ *
2118
+ * A clean break with no shim, and deliberately NOT a load refusal: every
2119
+ * earlier release stays in the retention list below. `withJev`'s contract was
2120
+ * always that `use` may fail and the fallback then runs, so a plugin compiled
2121
+ * against 0.11 that calls `jev.systemOne` throws inside `use` and runs its
2122
+ * fallback on this host. This fallback guarantee does not cover `signals.observe`:
2123
+ * old text/array states now return `invalid`; old object states with `noul`
2124
+ * questions can classify but receive `bool` answers, so reading `.noul` yields
2125
+ * undefined. Stored pre-0.12 answers retain `noul`. Retention allows activation,
2126
+ * not vocabulary compatibility: old plugins must migrate both surfaces.
2127
+ *
2128
+ * 0.12.1 adds `app.time` (`KayAppTime`): `snapshot()` returns the daemon's clock and the time
2129
+ * zone the user is in, as `{ nowMs, zone, zoneSource }`, where `zoneSource: "utc-fallback"` marks a
2130
+ * zone the host does not know. The member is always present and ungated, like `app.paths`.
2131
+ * Additive: a plugin compiled against 0.12.0 never reads it. A plugin that calls it declares
2132
+ * `^0.12.1`, so an older host refuses a directory or repository plugin at load instead of the
2133
+ * call failing. That check needs a host that knows its own version, and it never runs for a
2134
+ * bundled plugin, which ships with the SDK it calls.
2135
+ *
2136
+ * 0.12.2 adds the `ui-action` session event (`KayAppUiActionSessionEvent`), a fourth member of the
2137
+ * `KayAppSessionEvent` union: the daemon publishes it once per accepted answer to a card the agent
2138
+ * drew with `ui_render` (pressing Send on a drafted message, submitting a form), carrying the
2139
+ * projected entry's id and the answered call's id and no payload. A typed message still publishes
2140
+ * only `human-message`. Additive: a plugin compiled against 0.12.1 never subscribes to it, and
2141
+ * code that narrows the union by `type` meets one more member, as it must for any future one. A
2142
+ * plugin that subscribes to it declares `^0.12.2`, so an older host refuses a directory or
2143
+ * repository plugin at load instead of the subscription never firing. That check never runs for a
2144
+ * bundled plugin, which ships with the SDK it calls.
2064
2145
  */
2065
- export declare const KAY_PLUGIN_SDK_VERSION: "0.10.0";
2146
+ export declare const KAY_PLUGIN_SDK_VERSION: "0.12.2";
2066
2147
 
2067
2148
  export declare const KAY_PLUGIN_TARGET_NAMES: readonly ["kay.agent", "kay.app", "kay.ui"];
2068
2149
 
@@ -2155,6 +2236,14 @@ export declare const KayAgentTargetManifest: z.ZodObject<{
2155
2236
  displayName: z.ZodOptional<z.ZodString>;
2156
2237
  schemes: z.ZodOptional<z.ZodArray<z.ZodString>>;
2157
2238
  }, z.core.$strict>>>;
2239
+ interactionDrivers: z.ZodOptional<z.ZodArray<z.ZodObject<{
2240
+ localId: z.ZodString;
2241
+ displayName: z.ZodOptional<z.ZodString>;
2242
+ kind: z.ZodEnum<{
2243
+ browser: "browser";
2244
+ "computer-use": "computer-use";
2245
+ }>;
2246
+ }, z.core.$strict>>>;
2158
2247
  entityResolvers: z.ZodOptional<z.ZodArray<z.ZodObject<{
2159
2248
  localId: z.ZodString;
2160
2249
  displayName: z.ZodOptional<z.ZodString>;
@@ -2495,6 +2584,14 @@ export declare const KayPluginManifestV1: z.ZodObject<{
2495
2584
  displayName: z.ZodOptional<z.ZodString>;
2496
2585
  schemes: z.ZodOptional<z.ZodArray<z.ZodString>>;
2497
2586
  }, z.core.$strict>>>;
2587
+ interactionDrivers: z.ZodOptional<z.ZodArray<z.ZodObject<{
2588
+ localId: z.ZodString;
2589
+ displayName: z.ZodOptional<z.ZodString>;
2590
+ kind: z.ZodEnum<{
2591
+ browser: "browser";
2592
+ "computer-use": "computer-use";
2593
+ }>;
2594
+ }, z.core.$strict>>>;
2498
2595
  entityResolvers: z.ZodOptional<z.ZodArray<z.ZodObject<{
2499
2596
  localId: z.ZodString;
2500
2597
  displayName: z.ZodOptional<z.ZodString>;
@@ -2759,12 +2856,12 @@ export declare const KayPluginManifestV1: z.ZodObject<{
2759
2856
  capabilities: z.ZodOptional<z.ZodObject<{
2760
2857
  endpoints: z.ZodOptional<z.ZodArray<z.ZodString>>;
2761
2858
  host: z.ZodOptional<z.ZodArray<z.ZodEnum<{
2859
+ "skills.read": "skills.read";
2762
2860
  "automations.run": "automations.run";
2763
2861
  "navigation.open-session": "navigation.open-session";
2764
2862
  "cost.read": "cost.read";
2765
2863
  "billing.read": "billing.read";
2766
2864
  "context.read": "context.read";
2767
- "skills.read": "skills.read";
2768
2865
  "memory.read": "memory.read";
2769
2866
  "usage.read": "usage.read";
2770
2867
  "self-improvement.read": "self-improvement.read";
@@ -3195,12 +3292,12 @@ export declare const KayPluginProtocolVersion: z.ZodLiteral<"kay.plugin.v1">;
3195
3292
  export declare type KayPluginProtocolVersion = z.infer<typeof KayPluginProtocolVersion>;
3196
3293
 
3197
3294
  export declare const KayUiAppHostCapability: z.ZodEnum<{
3295
+ "skills.read": "skills.read";
3198
3296
  "automations.run": "automations.run";
3199
3297
  "navigation.open-session": "navigation.open-session";
3200
3298
  "cost.read": "cost.read";
3201
3299
  "billing.read": "billing.read";
3202
3300
  "context.read": "context.read";
3203
- "skills.read": "skills.read";
3204
3301
  "memory.read": "memory.read";
3205
3302
  "usage.read": "usage.read";
3206
3303
  "self-improvement.read": "self-improvement.read";
@@ -3341,12 +3438,12 @@ export declare const KayUiTargetManifest: z.ZodObject<{
3341
3438
  capabilities: z.ZodOptional<z.ZodObject<{
3342
3439
  endpoints: z.ZodOptional<z.ZodArray<z.ZodString>>;
3343
3440
  host: z.ZodOptional<z.ZodArray<z.ZodEnum<{
3441
+ "skills.read": "skills.read";
3344
3442
  "automations.run": "automations.run";
3345
3443
  "navigation.open-session": "navigation.open-session";
3346
3444
  "cost.read": "cost.read";
3347
3445
  "billing.read": "billing.read";
3348
3446
  "context.read": "context.read";
3349
- "skills.read": "skills.read";
3350
3447
  "memory.read": "memory.read";
3351
3448
  "usage.read": "usage.read";
3352
3449
  "self-improvement.read": "self-improvement.read";
@@ -3582,7 +3679,7 @@ export declare function parseResolvedPluginContractV1(value: unknown): ResolvedP
3582
3679
  export declare function parseSemver(value: string): ParsedSemver | undefined;
3583
3680
 
3584
3681
  /** Every capability slug {@link PluginCapabilityClaimV1} can express, for exhaustive table checks. */
3585
- export declare const PLUGIN_CAPABILITY_SLUGS: readonly ["sessions.run", "network.connect", "web-session.request", "web-session.download", "filesystem.read", "filesystem.write", "process.spawn", "corpus.read", "signals.read", "workspace.command", "sessions.create", "sessions.update", "models.complete", "jev.use", "automations.write", "automations.run", "workflows.define", "session-events.subscribe", "agents.run", "dynamic-context.register", "app-data.register", "account.assert", "account.update", "agents.permissions", "tool-interception.register", "config.declare-section", "auth.own-service", "auth.shared-identity", "cli.bind", "whiteboard.discover", "whiteboard.read", "whiteboard.create", "whiteboard.update", "whiteboard.remove"];
3682
+ export declare const PLUGIN_CAPABILITY_SLUGS: readonly ["sessions.run", "network.connect", "web-session.request", "web-session.download", "filesystem.read", "filesystem.write", "process.spawn", "corpus.read", "signals.read", "skills.read", "workspace.command", "sessions.create", "sessions.update", "models.complete", "jev.use", "automations.write", "automations.run", "workflows.define", "session-events.subscribe", "agents.run", "dynamic-context.register", "app-data.register", "account.assert", "account.update", "agents.permissions", "tool-interception.register", "interaction.surface", "config.declare-section", "auth.own-service", "auth.shared-identity", "cli.bind", "whiteboard.discover", "whiteboard.read", "whiteboard.create", "whiteboard.update", "whiteboard.remove"];
3586
3683
 
3587
3684
  /** The root `<svg>` attribute a tile icon declares itself with. */
3588
3685
  export declare const PLUGIN_ICON_SHAPE_ATTRIBUTE = "data-icon-shape";
@@ -3617,6 +3714,7 @@ export declare const PluginAgentDefinitionPermissionRule: z.ZodObject<{
3617
3714
  default: "default";
3618
3715
  allow: "allow";
3619
3716
  ask: "ask";
3717
+ auto: "auto";
3620
3718
  }>>;
3621
3719
  }, z.core.$strict>;
3622
3720
 
@@ -4017,6 +4115,10 @@ export declare const PluginCapabilityClaimV1: z.ZodDiscriminatedUnion<[z.ZodObje
4017
4115
  target: z.ZodLiteral<"kay.app">;
4018
4116
  slug: z.ZodLiteral<"signals.read">;
4019
4117
  envelope: z.ZodObject<{}, z.core.$strict>;
4118
+ }, z.core.$strict>, z.ZodObject<{
4119
+ target: z.ZodLiteral<"kay.app">;
4120
+ slug: z.ZodLiteral<"skills.read">;
4121
+ envelope: z.ZodObject<{}, z.core.$strict>;
4020
4122
  }, z.core.$strict>, z.ZodObject<{
4021
4123
  target: z.ZodLiteral<"kay.app">;
4022
4124
  slug: z.ZodLiteral<"workspace.command">;
@@ -4096,6 +4198,7 @@ export declare const PluginCapabilityClaimV1: z.ZodDiscriminatedUnion<[z.ZodObje
4096
4198
  default: "default";
4097
4199
  allow: "allow";
4098
4200
  ask: "ask";
4201
+ auto: "auto";
4099
4202
  }>>;
4100
4203
  }, z.core.$strict>>;
4101
4204
  fallback: z.ZodArray<z.ZodObject<{
@@ -4112,6 +4215,7 @@ export declare const PluginCapabilityClaimV1: z.ZodDiscriminatedUnion<[z.ZodObje
4112
4215
  default: "default";
4113
4216
  allow: "allow";
4114
4217
  ask: "ask";
4218
+ auto: "auto";
4115
4219
  }>>;
4116
4220
  }, z.core.$strict>>;
4117
4221
  }, z.core.$strict>;
@@ -4119,6 +4223,15 @@ export declare const PluginCapabilityClaimV1: z.ZodDiscriminatedUnion<[z.ZodObje
4119
4223
  target: z.ZodLiteral<"kay.agent">;
4120
4224
  slug: z.ZodLiteral<"tool-interception.register">;
4121
4225
  envelope: z.ZodObject<{}, z.core.$strict>;
4226
+ }, z.core.$strict>, z.ZodObject<{
4227
+ target: z.ZodLiteral<"kay.agent">;
4228
+ slug: z.ZodLiteral<"interaction.surface">;
4229
+ envelope: z.ZodObject<{
4230
+ surface: z.ZodEnum<{
4231
+ "browser-pane": "browser-pane";
4232
+ desktop: "desktop";
4233
+ }>;
4234
+ }, z.core.$strict>;
4122
4235
  }, z.core.$strict>, z.ZodObject<{
4123
4236
  target: z.ZodLiteral<"plugin">;
4124
4237
  slug: z.ZodLiteral<"config.declare-section">;
@@ -4222,6 +4335,10 @@ export declare const PluginCapabilityDecisionV1: z.ZodDiscriminatedUnion<[z.ZodO
4222
4335
  target: z.ZodLiteral<"kay.app">;
4223
4336
  slug: z.ZodLiteral<"signals.read">;
4224
4337
  envelope: z.ZodObject<{}, z.core.$strict>;
4338
+ }, z.core.$strict>, z.ZodObject<{
4339
+ target: z.ZodLiteral<"kay.app">;
4340
+ slug: z.ZodLiteral<"skills.read">;
4341
+ envelope: z.ZodObject<{}, z.core.$strict>;
4225
4342
  }, z.core.$strict>, z.ZodObject<{
4226
4343
  target: z.ZodLiteral<"kay.app">;
4227
4344
  slug: z.ZodLiteral<"workspace.command">;
@@ -4301,6 +4418,7 @@ export declare const PluginCapabilityDecisionV1: z.ZodDiscriminatedUnion<[z.ZodO
4301
4418
  default: "default";
4302
4419
  allow: "allow";
4303
4420
  ask: "ask";
4421
+ auto: "auto";
4304
4422
  }>>;
4305
4423
  }, z.core.$strict>>;
4306
4424
  fallback: z.ZodArray<z.ZodObject<{
@@ -4317,6 +4435,7 @@ export declare const PluginCapabilityDecisionV1: z.ZodDiscriminatedUnion<[z.ZodO
4317
4435
  default: "default";
4318
4436
  allow: "allow";
4319
4437
  ask: "ask";
4438
+ auto: "auto";
4320
4439
  }>>;
4321
4440
  }, z.core.$strict>>;
4322
4441
  }, z.core.$strict>;
@@ -4324,6 +4443,15 @@ export declare const PluginCapabilityDecisionV1: z.ZodDiscriminatedUnion<[z.ZodO
4324
4443
  target: z.ZodLiteral<"kay.agent">;
4325
4444
  slug: z.ZodLiteral<"tool-interception.register">;
4326
4445
  envelope: z.ZodObject<{}, z.core.$strict>;
4446
+ }, z.core.$strict>, z.ZodObject<{
4447
+ target: z.ZodLiteral<"kay.agent">;
4448
+ slug: z.ZodLiteral<"interaction.surface">;
4449
+ envelope: z.ZodObject<{
4450
+ surface: z.ZodEnum<{
4451
+ "browser-pane": "browser-pane";
4452
+ desktop: "desktop";
4453
+ }>;
4454
+ }, z.core.$strict>;
4327
4455
  }, z.core.$strict>, z.ZodObject<{
4328
4456
  target: z.ZodLiteral<"plugin">;
4329
4457
  slug: z.ZodLiteral<"config.declare-section">;
@@ -4422,6 +4550,10 @@ export declare const PluginCapabilityDecisionV1: z.ZodDiscriminatedUnion<[z.ZodO
4422
4550
  target: z.ZodLiteral<"kay.app">;
4423
4551
  slug: z.ZodLiteral<"signals.read">;
4424
4552
  envelope: z.ZodObject<{}, z.core.$strict>;
4553
+ }, z.core.$strict>, z.ZodObject<{
4554
+ target: z.ZodLiteral<"kay.app">;
4555
+ slug: z.ZodLiteral<"skills.read">;
4556
+ envelope: z.ZodObject<{}, z.core.$strict>;
4425
4557
  }, z.core.$strict>, z.ZodObject<{
4426
4558
  target: z.ZodLiteral<"kay.app">;
4427
4559
  slug: z.ZodLiteral<"workspace.command">;
@@ -4501,6 +4633,7 @@ export declare const PluginCapabilityDecisionV1: z.ZodDiscriminatedUnion<[z.ZodO
4501
4633
  default: "default";
4502
4634
  allow: "allow";
4503
4635
  ask: "ask";
4636
+ auto: "auto";
4504
4637
  }>>;
4505
4638
  }, z.core.$strict>>;
4506
4639
  fallback: z.ZodArray<z.ZodObject<{
@@ -4517,6 +4650,7 @@ export declare const PluginCapabilityDecisionV1: z.ZodDiscriminatedUnion<[z.ZodO
4517
4650
  default: "default";
4518
4651
  allow: "allow";
4519
4652
  ask: "ask";
4653
+ auto: "auto";
4520
4654
  }>>;
4521
4655
  }, z.core.$strict>>;
4522
4656
  }, z.core.$strict>;
@@ -4524,6 +4658,15 @@ export declare const PluginCapabilityDecisionV1: z.ZodDiscriminatedUnion<[z.ZodO
4524
4658
  target: z.ZodLiteral<"kay.agent">;
4525
4659
  slug: z.ZodLiteral<"tool-interception.register">;
4526
4660
  envelope: z.ZodObject<{}, z.core.$strict>;
4661
+ }, z.core.$strict>, z.ZodObject<{
4662
+ target: z.ZodLiteral<"kay.agent">;
4663
+ slug: z.ZodLiteral<"interaction.surface">;
4664
+ envelope: z.ZodObject<{
4665
+ surface: z.ZodEnum<{
4666
+ "browser-pane": "browser-pane";
4667
+ desktop: "desktop";
4668
+ }>;
4669
+ }, z.core.$strict>;
4527
4670
  }, z.core.$strict>, z.ZodObject<{
4528
4671
  target: z.ZodLiteral<"plugin">;
4529
4672
  slug: z.ZodLiteral<"config.declare-section">;
@@ -4685,6 +4828,10 @@ export declare const PluginCapabilityRefusalV1: z.ZodObject<{
4685
4828
  target: z.ZodLiteral<"kay.app">;
4686
4829
  slug: z.ZodLiteral<"signals.read">;
4687
4830
  envelope: z.ZodObject<{}, z.core.$strict>;
4831
+ }, z.core.$strict>, z.ZodObject<{
4832
+ target: z.ZodLiteral<"kay.app">;
4833
+ slug: z.ZodLiteral<"skills.read">;
4834
+ envelope: z.ZodObject<{}, z.core.$strict>;
4688
4835
  }, z.core.$strict>, z.ZodObject<{
4689
4836
  target: z.ZodLiteral<"kay.app">;
4690
4837
  slug: z.ZodLiteral<"workspace.command">;
@@ -4764,6 +4911,7 @@ export declare const PluginCapabilityRefusalV1: z.ZodObject<{
4764
4911
  default: "default";
4765
4912
  allow: "allow";
4766
4913
  ask: "ask";
4914
+ auto: "auto";
4767
4915
  }>>;
4768
4916
  }, z.core.$strict>>;
4769
4917
  fallback: z.ZodArray<z.ZodObject<{
@@ -4780,6 +4928,7 @@ export declare const PluginCapabilityRefusalV1: z.ZodObject<{
4780
4928
  default: "default";
4781
4929
  allow: "allow";
4782
4930
  ask: "ask";
4931
+ auto: "auto";
4783
4932
  }>>;
4784
4933
  }, z.core.$strict>>;
4785
4934
  }, z.core.$strict>;
@@ -4787,6 +4936,15 @@ export declare const PluginCapabilityRefusalV1: z.ZodObject<{
4787
4936
  target: z.ZodLiteral<"kay.agent">;
4788
4937
  slug: z.ZodLiteral<"tool-interception.register">;
4789
4938
  envelope: z.ZodObject<{}, z.core.$strict>;
4939
+ }, z.core.$strict>, z.ZodObject<{
4940
+ target: z.ZodLiteral<"kay.agent">;
4941
+ slug: z.ZodLiteral<"interaction.surface">;
4942
+ envelope: z.ZodObject<{
4943
+ surface: z.ZodEnum<{
4944
+ "browser-pane": "browser-pane";
4945
+ desktop: "desktop";
4946
+ }>;
4947
+ }, z.core.$strict>;
4790
4948
  }, z.core.$strict>, z.ZodObject<{
4791
4949
  target: z.ZodLiteral<"plugin">;
4792
4950
  slug: z.ZodLiteral<"config.declare-section">;
@@ -4905,6 +5063,7 @@ export declare const PluginContributionKind: z.ZodEnum<{
4905
5063
  artifactUriModule: "artifactUriModule";
4906
5064
  cliBinding: "cliBinding";
4907
5065
  searchProvider: "searchProvider";
5066
+ interactionDriver: "interactionDriver";
4908
5067
  entityResolver: "entityResolver";
4909
5068
  agentRenderer: "agentRenderer";
4910
5069
  eventDefinition: "eventDefinition";
@@ -5882,12 +6041,12 @@ export declare const ResolvedKayUiApp: z.ZodObject<{
5882
6041
  globalId: z.ZodString;
5883
6042
  }, z.core.$strict>>>;
5884
6043
  host: z.ZodOptional<z.ZodArray<z.ZodEnum<{
6044
+ "skills.read": "skills.read";
5885
6045
  "automations.run": "automations.run";
5886
6046
  "navigation.open-session": "navigation.open-session";
5887
6047
  "cost.read": "cost.read";
5888
6048
  "billing.read": "billing.read";
5889
6049
  "context.read": "context.read";
5890
- "skills.read": "skills.read";
5891
6050
  "memory.read": "memory.read";
5892
6051
  "usage.read": "usage.read";
5893
6052
  "self-improvement.read": "self-improvement.read";
@@ -6168,6 +6327,7 @@ export declare const ResolvedPluginContractV1: z.ZodObject<{
6168
6327
  artifactUriModule: "artifactUriModule";
6169
6328
  cliBinding: "cliBinding";
6170
6329
  searchProvider: "searchProvider";
6330
+ interactionDriver: "interactionDriver";
6171
6331
  entityResolver: "entityResolver";
6172
6332
  agentRenderer: "agentRenderer";
6173
6333
  eventDefinition: "eventDefinition";
@@ -6731,12 +6891,12 @@ export declare const ResolvedPluginContractV1: z.ZodObject<{
6731
6891
  globalId: z.ZodString;
6732
6892
  }, z.core.$strict>>>;
6733
6893
  host: z.ZodOptional<z.ZodArray<z.ZodEnum<{
6894
+ "skills.read": "skills.read";
6734
6895
  "automations.run": "automations.run";
6735
6896
  "navigation.open-session": "navigation.open-session";
6736
6897
  "cost.read": "cost.read";
6737
6898
  "billing.read": "billing.read";
6738
6899
  "context.read": "context.read";
6739
- "skills.read": "skills.read";
6740
6900
  "memory.read": "memory.read";
6741
6901
  "usage.read": "usage.read";
6742
6902
  "self-improvement.read": "self-improvement.read";
@@ -6772,6 +6932,7 @@ export declare const ResolvedPluginContributionId: z.ZodObject<{
6772
6932
  artifactUriModule: "artifactUriModule";
6773
6933
  cliBinding: "cliBinding";
6774
6934
  searchProvider: "searchProvider";
6935
+ interactionDriver: "interactionDriver";
6775
6936
  entityResolver: "entityResolver";
6776
6937
  agentRenderer: "agentRenderer";
6777
6938
  eventDefinition: "eventDefinition";
@@ -7507,6 +7668,7 @@ export declare const SessionCausedByEvent: z.ZodObject<{
7507
7668
  "turn-settled": "turn-settled";
7508
7669
  "phase-shift": "phase-shift";
7509
7670
  "human-message": "human-message";
7671
+ "ui-action": "ui-action";
7510
7672
  }>;
7511
7673
  entryId: z.ZodString;
7512
7674
  runId: z.ZodOptional<z.ZodString>;
@@ -7730,6 +7892,7 @@ export declare const SessionProvenanceRecord: z.ZodObject<{
7730
7892
  "turn-settled": "turn-settled";
7731
7893
  "phase-shift": "phase-shift";
7732
7894
  "human-message": "human-message";
7895
+ "ui-action": "ui-action";
7733
7896
  }>;
7734
7897
  entryId: z.ZodString;
7735
7898
  runId: z.ZodOptional<z.ZodString>;
@@ -8072,6 +8235,13 @@ export declare type TurnMessageOrigin =
8072
8235
  /** Neither the session nor the message establishes human authorship. */
8073
8236
  | "unknown";
8074
8237
 
8238
+ /**
8239
+ * Who wrote one message, read from what the transcript carries: `clientIntentId` AND
8240
+ * `details.deliveryId` mean a person typed it. The one definition the turn packet and every other
8241
+ * reader of a message's authorship share.
8242
+ */
8243
+ export declare function turnMessageOrigin(entry: Pick<TurnPacketEntry, "message">): TurnMessageOrigin;
8244
+
8075
8245
  export declare interface TurnPacket {
8076
8246
  /** The message that opened the turn. */
8077
8247
  readonly personMessage: TurnPacketMessage;
@@ -8132,12 +8302,12 @@ export declare interface TurnPacketMessage {
8132
8302
  export declare const UiAppCapabilities: z.ZodObject<{
8133
8303
  endpoints: z.ZodOptional<z.ZodArray<z.ZodString>>;
8134
8304
  host: z.ZodOptional<z.ZodArray<z.ZodEnum<{
8305
+ "skills.read": "skills.read";
8135
8306
  "automations.run": "automations.run";
8136
8307
  "navigation.open-session": "navigation.open-session";
8137
8308
  "cost.read": "cost.read";
8138
8309
  "billing.read": "billing.read";
8139
8310
  "context.read": "context.read";
8140
- "skills.read": "skills.read";
8141
8311
  "memory.read": "memory.read";
8142
8312
  "usage.read": "usage.read";
8143
8313
  "self-improvement.read": "self-improvement.read";
@@ -8168,12 +8338,12 @@ export declare const UiAppContribution: z.ZodObject<{
8168
8338
  capabilities: z.ZodOptional<z.ZodObject<{
8169
8339
  endpoints: z.ZodOptional<z.ZodArray<z.ZodString>>;
8170
8340
  host: z.ZodOptional<z.ZodArray<z.ZodEnum<{
8341
+ "skills.read": "skills.read";
8171
8342
  "automations.run": "automations.run";
8172
8343
  "navigation.open-session": "navigation.open-session";
8173
8344
  "cost.read": "cost.read";
8174
8345
  "billing.read": "billing.read";
8175
8346
  "context.read": "context.read";
8176
- "skills.read": "skills.read";
8177
8347
  "memory.read": "memory.read";
8178
8348
  "usage.read": "usage.read";
8179
8349
  "self-improvement.read": "self-improvement.read";
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ function textOf(entry) {
30
30
  return "";
31
31
  return content.map((part) => typeof part === "object" && part !== null && part.type === "text" && typeof part.text === "string" ? part.text : "").join("");
32
32
  }
33
- function originOf(entry) {
33
+ function turnMessageOrigin(entry) {
34
34
  const m = entry.message;
35
35
  if (m === void 0 || typeof m.clientIntentId !== "string")
36
36
  return "unknown";
@@ -71,7 +71,7 @@ function turnPacket(entries, settleEntryId, options = {}) {
71
71
  entryId: entry.id,
72
72
  timestamp: entry.timestamp,
73
73
  text: textOf(entry),
74
- origin: originOf(entry)
74
+ origin: turnMessageOrigin(entry)
75
75
  });
76
76
  return {
77
77
  personMessage: toPacket(opener),
@@ -96,7 +96,7 @@ function precedingPersonMessages(entries, packet, count) {
96
96
  continue;
97
97
  if (e.type !== "message" || e.message?.role !== "user")
98
98
  continue;
99
- if (originOf(e) !== "human-verified")
99
+ if (turnMessageOrigin(e) !== "human-verified")
100
100
  continue;
101
101
  found.push({
102
102
  entryId: e.id,
@@ -115,7 +115,7 @@ import { z as z2 } from "zod";
115
115
  import { z } from "zod";
116
116
  var KAY_PLUGIN_PROTOCOL_VERSION = "kay.plugin.v1";
117
117
  var KAY_PLUGIN_PROTOCOL_PACKAGE_NAME = "@kay/plugin-protocol";
118
- var KAY_PLUGIN_SDK_VERSION = "0.10.0";
118
+ var KAY_PLUGIN_SDK_VERSION = "0.12.2";
119
119
  var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
120
120
  "0.8.0",
121
121
  "0.8.1",
@@ -124,7 +124,12 @@ var KAY_PLUGIN_COMPATIBLE_SDK_VERSIONS = [
124
124
  "0.8.4",
125
125
  "0.8.5",
126
126
  "0.9.0",
127
- "0.9.1"
127
+ "0.9.1",
128
+ "0.10.0",
129
+ "0.11.0",
130
+ "0.11.1",
131
+ "0.12.0",
132
+ "0.12.1"
128
133
  ];
129
134
  var KAY_PLUGIN_TARGET_NAMES = [
130
135
  "kay.agent",
@@ -343,7 +348,12 @@ var SessionCausedByEventShape = z3.strictObject({
343
348
  /** Required when `kind` is `"session-event"` or absent; must be omitted when `kind` is `"backfill"`. */
344
349
  event: z3.strictObject({
345
350
  /** {@link KayAppSessionEventType} in `@kay/plugin-sdk`, mirrored: a closed, extensible union. */
346
- type: z3.enum(["turn-settled", "phase-shift", "human-message"]),
351
+ type: z3.enum([
352
+ "turn-settled",
353
+ "phase-shift",
354
+ "human-message",
355
+ "ui-action"
356
+ ]),
347
357
  entryId: NonEmptyString2,
348
358
  /** The source run captured at the event boundary; absence remains unresolved. */
349
359
  runId: NonEmptyString2.optional(),
@@ -1292,7 +1302,7 @@ var PluginAgentDefinitionPermissionRule = z5.strictObject({
1292
1302
  /** Restrict to matching resources (a path glob, or a URI-shaped policy address). */
1293
1303
  resource: NonEmptyString.optional(),
1294
1304
  /** Restrict the rule to one permission mode; omit to apply in all modes. */
1295
- mode: z5.enum(["default", "ask", "allow"]).optional()
1305
+ mode: z5.enum(["default", "ask", "allow", "auto"]).optional()
1296
1306
  });
1297
1307
  var RETIRED_PERMISSION_ASK_KEYS = [
1298
1308
  "network",
@@ -1515,6 +1525,14 @@ var PluginCapabilityClaimV1 = z6.discriminatedUnion("slug", [
1515
1525
  slug: z6.literal("signals.read"),
1516
1526
  envelope: z6.strictObject({})
1517
1527
  }),
1528
+ z6.strictObject({
1529
+ // Read-only metadata about every managed skill: identity, versions, history, suggestions.
1530
+ // Never a skill's bytes (an agent reads those through `skill://`) and never a write. An
1531
+ // empty envelope because the grant itself is the visibility decision, as with `signals.read`.
1532
+ target: z6.literal("kay.app"),
1533
+ slug: z6.literal("skills.read"),
1534
+ envelope: z6.strictObject({})
1535
+ }),
1518
1536
  z6.strictObject({
1519
1537
  target: z6.literal("kay.app"),
1520
1538
  slug: z6.literal("workspace.command"),
@@ -1613,6 +1631,12 @@ var PluginCapabilityClaimV1 = z6.discriminatedUnion("slug", [
1613
1631
  slug: z6.literal("tool-interception.register"),
1614
1632
  envelope: z6.strictObject({})
1615
1633
  }),
1634
+ z6.strictObject({
1635
+ target: z6.literal("kay.agent"),
1636
+ slug: z6.literal("interaction.surface"),
1637
+ /** The one Kay-shipped interaction surface this plugin may drive; one claim per surface. */
1638
+ envelope: z6.strictObject({ surface: z6.enum(["browser-pane", "desktop"]) })
1639
+ }),
1616
1640
  z6.strictObject({
1617
1641
  target: z6.literal("plugin"),
1618
1642
  slug: z6.literal("config.declare-section"),
@@ -1649,6 +1673,7 @@ var PLUGIN_CAPABILITY_SLUGS = [
1649
1673
  "process.spawn",
1650
1674
  "corpus.read",
1651
1675
  "signals.read",
1676
+ "skills.read",
1652
1677
  "workspace.command",
1653
1678
  "sessions.create",
1654
1679
  "sessions.update",
@@ -1665,6 +1690,7 @@ var PLUGIN_CAPABILITY_SLUGS = [
1665
1690
  "account.update",
1666
1691
  "agents.permissions",
1667
1692
  "tool-interception.register",
1693
+ "interaction.surface",
1668
1694
  "config.declare-section",
1669
1695
  "auth.own-service",
1670
1696
  "auth.shared-identity",
@@ -1753,6 +1779,7 @@ function sameClaim(a, b) {
1753
1779
  case "sessions.update":
1754
1780
  case "corpus.read":
1755
1781
  case "signals.read":
1782
+ case "skills.read":
1756
1783
  case "workspace.command":
1757
1784
  case "models.complete":
1758
1785
  case "jev.use":
@@ -1775,6 +1802,8 @@ function sameClaim(a, b) {
1775
1802
  return (b.slug === "filesystem.read" || b.slug === "filesystem.write") && a.envelope.root === b.envelope.root;
1776
1803
  case "process.spawn":
1777
1804
  return b.slug === "process.spawn" && a.envelope.command === b.envelope.command && a.envelope.argvClass === b.envelope.argvClass;
1805
+ case "interaction.surface":
1806
+ return b.slug === "interaction.surface" && a.envelope.surface === b.envelope.surface;
1778
1807
  case "dynamic-context.register":
1779
1808
  return b.slug === "dynamic-context.register" && a.envelope.contributor === b.envelope.contributor;
1780
1809
  case "app-data.register":
@@ -1817,6 +1846,7 @@ function envelopePairs(a, b) {
1817
1846
  case "sessions.update":
1818
1847
  case "corpus.read":
1819
1848
  case "signals.read":
1849
+ case "skills.read":
1820
1850
  case "workspace.command":
1821
1851
  case "models.complete":
1822
1852
  case "jev.use":
@@ -1845,6 +1875,8 @@ function envelopePairs(a, b) {
1845
1875
  [a.envelope.command, b.envelope.command],
1846
1876
  [a.envelope.argvClass, b.envelope.argvClass]
1847
1877
  ] : [];
1878
+ case "interaction.surface":
1879
+ return b.slug === "interaction.surface" ? [[a.envelope.surface, b.envelope.surface]] : [];
1848
1880
  case "dynamic-context.register":
1849
1881
  return b.slug === "dynamic-context.register" ? [[a.envelope.contributor, b.envelope.contributor]] : [];
1850
1882
  case "app-data.register":
@@ -2386,6 +2418,11 @@ var SearchProviderContribution = z7.strictObject({
2386
2418
  displayName: OptionalDisplayName,
2387
2419
  schemes: z7.array(UriScheme).optional()
2388
2420
  });
2421
+ var InteractionDriverContribution = z7.strictObject({
2422
+ localId: LocalContributionId,
2423
+ displayName: OptionalDisplayName,
2424
+ kind: z7.enum(["browser", "computer-use"])
2425
+ });
2389
2426
  var EntityResolverContribution = z7.strictObject({
2390
2427
  localId: LocalContributionId,
2391
2428
  displayName: OptionalDisplayName,
@@ -2642,6 +2679,7 @@ var PluginContributionKind = z7.enum([
2642
2679
  "resource",
2643
2680
  "skill",
2644
2681
  "searchProvider",
2682
+ "interactionDriver",
2645
2683
  "entityResolver",
2646
2684
  "agentRenderer",
2647
2685
  "endpoint",
@@ -2748,6 +2786,7 @@ var KayAgentTargetManifest = z8.strictObject({
2748
2786
  resources: z8.array(ResourceContribution).optional(),
2749
2787
  skills: z8.array(SkillContribution).optional(),
2750
2788
  searchProviders: z8.array(SearchProviderContribution).optional(),
2789
+ interactionDrivers: z8.array(InteractionDriverContribution).optional(),
2751
2790
  entityResolvers: z8.array(EntityResolverContribution).optional(),
2752
2791
  renderers: z8.array(AgentRenderContribution).optional(),
2753
2792
  // Handler restricted to skill | tool by the manifest-level refinement below (see
@@ -3711,6 +3750,7 @@ function collectDeclaredContributionIds(manifest) {
3711
3750
  pushContributionIds(output, ["targets", "kay", "agent", "contributes", "resources"], agent?.resources);
3712
3751
  pushContributionIds(output, ["targets", "kay", "agent", "contributes", "skills"], agent?.skills);
3713
3752
  pushContributionIds(output, ["targets", "kay", "agent", "contributes", "searchProviders"], agent?.searchProviders);
3753
+ pushContributionIds(output, ["targets", "kay", "agent", "contributes", "interactionDrivers"], agent?.interactionDrivers);
3714
3754
  pushContributionIds(output, ["targets", "kay", "agent", "contributes", "entityResolvers"], agent?.entityResolvers);
3715
3755
  pushContributionIds(output, ["targets", "kay", "agent", "contributes", "renderers"], agent?.renderers);
3716
3756
  pushContributionIds(output, ["targets", "kay", "agent", "contributes", "commands"], agent?.commands);
@@ -4052,6 +4092,7 @@ function collectContributionSources(manifest) {
4052
4092
  pushAll(output, "kay.agent", "resource", agent?.resources);
4053
4093
  pushAll(output, "kay.agent", "skill", agent?.skills);
4054
4094
  pushAll(output, "kay.agent", "searchProvider", agent?.searchProviders);
4095
+ pushAll(output, "kay.agent", "interactionDriver", agent?.interactionDrivers);
4055
4096
  pushAll(output, "kay.agent", "entityResolver", agent?.entityResolvers);
4056
4097
  pushAll(output, "kay.agent", "agentRenderer", agent?.renderers);
4057
4098
  pushAll(output, "kay.agent", "command", agent?.commands);
@@ -4676,6 +4717,7 @@ export {
4676
4717
  GlobalContributionId,
4677
4718
  HttpStatusCode,
4678
4719
  HttpsUrl,
4720
+ InteractionDriverContribution,
4679
4721
  JsonObject,
4680
4722
  JsonPointer,
4681
4723
  JsonSchema,
@@ -4871,6 +4913,7 @@ export {
4871
4913
  satisfiesSemverRange,
4872
4914
  sessionHealthEntrySchema,
4873
4915
  sessionHealthPWellDecile,
4916
+ turnMessageOrigin,
4874
4917
  turnPacket,
4875
4918
  urlHostWithinDomain,
4876
4919
  validateKayUiEventSubscription,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaklabs-ai/plugin-protocol",
3
- "version": "0.10.0",
3
+ "version": "0.12.2",
4
4
  "description": "The Kay plugin manifest schema (`kay.plugin.v1`) — parse and validate a kay-plugin.json.",
5
5
  "author": "YakLabs",
6
6
  "type": "module",