@yaklabs-ai/plugin-sdk 0.54.0 → 0.54.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
@@ -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.54.0"
16
+ "@bonsai/plugin-sdk": "npm:@yaklabs-ai/plugin-sdk@^0.54.2"
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.54.0" },
65
+ "compatibility": { "sdk": "^0.54.2" },
66
66
  "targets": {
67
67
  "kay": {
68
68
  "agent": {
@@ -153,7 +153,7 @@ naming both versions, instead of loading it and finding no `activate`.
153
153
  | `@bonsai/plugin-sdk/system-one` | The types and error class for `api.systemOne` / `app.systemOne`, from 0.13.8 |
154
154
  | `@bonsai/plugin-sdk/zod` | `z` (the host's in the daemon), on an entry with no other import, from 0.13.9 |
155
155
 
156
- A plugin that imports these subpaths declares the current supported SDK range (`^0.54.0`).
156
+ A plugin that imports these subpaths declares the current supported SDK range (`^0.54.2`).
157
157
  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
158
158
  vendor's MCP server itself is a separate host decision: Bonsai hosts it once a person approves
159
159
  the plugin's `mcp.host-server` grant for that server's name and URL. A server that needs an OAuth
@@ -161,7 +161,7 @@ sign-in names one of the plugin's auth services in `authService`; that service m
161
161
  one `delegated` scheme, which Bonsai uses to sign the person in to the server. Bonsai declares that
162
162
  scheme at runtime; the plugin's code must not declare it again. From 0.16.2 a plugin's code can also
163
163
  call the server's tools through `api.vendoredMcp.port(<server>)`, typed by this subpath's
164
- `VendoredMcpPort` and `VendoredMcpOutcome` (declare `^0.54.0`).
164
+ `VendoredMcpPort` and `VendoredMcpOutcome` (declare `^0.54.2`).
165
165
 
166
166
  From 0.13.10 the manifest schema carries two facts Bonsai reads for its own plugins only; another
167
167
  plugin's are ignored, with a load diagnostic. An `external-cli` auth scheme's `cli` says how Bonsai
@@ -243,7 +243,7 @@ Provider schemas remain authoritative; declaring a dependency grants no authorit
243
243
  through `app.uri`, parse returned Markdown in the consuming plugin, and retain the read's
244
244
  revision (or `contentDigest` from `/uri`) for edits. The old `memory.read` and `memory.write`
245
245
  grants do not authorize the replacement scheme-and-verb calls. Contracts before 0.49.0 are
246
- refused; migrate and declare `^0.54.0`. The current host also serves the 0.49.0 resource contract.
246
+ refused; migrate and declare `^0.54.2`. The current host also serves the 0.49.0 resource contract.
247
247
 
248
248
  ## What this package is, and is not, at runtime
249
249
 
@@ -308,3 +308,14 @@ relative imports. Multi-file entrypoints are supported, and TypeScript syntax
308
308
  that native stripping cannot execute, such as enums, namespaces, constructor
309
309
  parameter properties, and decorators, is compiled into the bundle. The host
310
310
  SDK remains external and is supplied by the running Bonsai app.
311
+
312
+ ## Plugin workers
313
+
314
+ SDK 0.54.1 lets either backend target run a declared module in a fresh child process.
315
+ Declare `workers: [{ localId: "analyze", module: "./src/analyze.ts" }]` at the manifest's top
316
+ level, export `run(input)` from that module, and call
317
+ `api.workers.run("analyze", input, { timeoutMs: 10_000 })` (or `app.workers.run`). Input and
318
+ return values must be JSON. An optional `signal` cancels the call. The host terminates the child
319
+ on cancellation, timeout or plugin disposal; limits and child failures reject with
320
+ `PluginWorkerError`. Import the capability and error from `@bonsai/plugin-sdk/workers`.
321
+ Calls identify only a worker declared by this plugin and cannot supply executable paths or code.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "package": "@yaklabs-ai/plugin-sdk",
4
- "version": "0.54.0",
4
+ "version": "0.54.2",
5
5
  "target": "npm",
6
6
  "firstPartyLicense": "MIT",
7
7
  "bundled": [
@@ -31,6 +31,19 @@ declare type AgentSessionEvent = Exclude<HerdHarnessEvent, {
31
31
 
32
32
  declare const Alpha: TAlpha;
33
33
 
34
+ /**
35
+ * The ids of the blocks that start a new answer stretch. A person's mid-turn message
36
+ * (`steer_message`) always does. A background input does when the agent answered both before
37
+ * it and after it, so the reply it wakes never turns the earlier answer into a folded middle
38
+ * one. An input with no answer on one side cannot fold one, so it joins the stretch it lands
39
+ * in: a result absorbed mid-run, or a wake the agent left unanswered, starts nothing. When
40
+ * several inputs arrive between two answers, the first one starts the stretch.
41
+ *
42
+ * The turn's opening (the person's message that caused it) is not a block and is never listed;
43
+ * the first stretch starts there.
44
+ */
45
+ export declare function answerStretchStarts(blocks: readonly CanonicalAgentBlock[]): ReadonlySet<string>;
46
+
34
47
  /** Compatibility settings for Anthropic Messages-compatible APIs. */
35
48
  declare interface AnthropicMessagesCompat extends Static<typeof AnthropicMessagesCompatSchema> {
36
49
  }
@@ -1343,6 +1356,16 @@ declare function DependentOptions(type: TDependent): TSchemaOptions;
1343
1356
  */
1344
1357
  declare type DetachedWorkResultChannel = "next_turn" | "steer";
1345
1358
 
1359
+ declare interface DetailsAudienceRow extends TranscriptTypeRowBase {
1360
+ /** `undefined` when the details carry no discriminant this row can read. */
1361
+ readonly audience: (details: unknown) => TranscriptAudience | undefined;
1362
+ /**
1363
+ * What a surface does with a message whose audience cannot be read: hide it, show a generic
1364
+ * version, or show it as unrecognized.
1365
+ */
1366
+ readonly onUndecodable: "hide" | "generic" | "unrecognized";
1367
+ }
1368
+
1346
1369
  declare interface DiagnosticErrorInfo {
1347
1370
  name?: string;
1348
1371
  message: string;
@@ -1647,6 +1670,10 @@ declare interface FinalOutputCapture {
1647
1670
  readonly sessionTitle?: string;
1648
1671
  }
1649
1672
 
1673
+ declare interface FixedAudienceRow extends TranscriptTypeRowBase {
1674
+ readonly audience: TranscriptAudience;
1675
+ }
1676
+
1650
1677
  /** Creates a Function type. */
1651
1678
  declare function _Function_<Parameters extends TSchema[], ReturnType extends TSchema>(parameters: [...Parameters], returnType: ReturnType, options?: TSchemaOptions): TFunction<Parameters, ReturnType>;
1652
1679
 
@@ -3846,14 +3873,20 @@ declare interface RunFailureObservedSessionEvent {
3846
3873
  readonly failure?: RunFailureOccurrence;
3847
3874
  }
3848
3875
 
3849
- declare type RunFailureOccurrence = FailureOccurrence<RunFailureCause>;
3876
+ /**
3877
+ * One run failure record. `Code` and `Domain` default to `string`, as every
3878
+ * reader takes them; a producer passes `RunFailureCode` and
3879
+ * `RunFailureDomain` on the record it makes, so an undeclared code fails to
3880
+ * compile.
3881
+ */
3882
+ declare type RunFailureOccurrence<Code extends string = string, Domain extends string = string> = FailureOccurrence<RunFailureCause, Code, Domain>;
3850
3883
 
3851
3884
  declare type RunFailureReason = (typeof RUN_FAILURE_REASONS)[number];
3852
3885
 
3853
3886
  declare type RunFailureRecord = z.infer<typeof runFailureRecordSchema>;
3854
3887
 
3855
3888
  declare const runFailureRecordSchema: z.ZodObject<{
3856
- failure: z.ZodType<RunFailureOccurrence, unknown, z.core.$ZodTypeInternals<RunFailureOccurrence, unknown>>;
3889
+ failure: z.ZodType<RunFailureOccurrence<string, string>, unknown, z.core.$ZodTypeInternals<RunFailureOccurrence<string, string>, unknown>>;
3857
3890
  errorText: z.ZodString;
3858
3891
  }, z.core.$strict>;
3859
3892
 
@@ -3871,8 +3904,8 @@ declare const runRecoveryOutcomeSchema: z.ZodObject<{
3871
3904
  id: z.ZodString;
3872
3905
  }, z.core.$strict>;
3873
3906
  action: z.ZodEnum<{
3874
- compact: "compact";
3875
3907
  retry: "retry";
3908
+ compact: "compact";
3876
3909
  switch_model: "switch_model";
3877
3910
  switch_account: "switch_account";
3878
3911
  }>;
@@ -4535,6 +4568,15 @@ declare type StaticVoid = void;
4535
4568
 
4536
4569
  declare type StopReason = "pending" | "stop" | "length" | "toolUse" | "error" | "aborted" | "deferred";
4537
4570
 
4571
+ /**
4572
+ * The settled helper and command results that open the stretch starting at `blocks[start]`: the
4573
+ * results among the custom messages that arrived together there, before the agent's next step.
4574
+ * A bar whose stretch opens with any shows its background result line in place of a work
4575
+ * headline, so the headline writer labels no such bar. Empty for a stretch a person's message,
4576
+ * a bare wake or an automation starts.
4577
+ */
4578
+ export declare function stretchOpeningResults(blocks: readonly CanonicalAgentBlock[], start: number): readonly CanonicalCustomMessageBlock[];
4579
+
4538
4580
  /** Matches a literal String with the given quotes */
4539
4581
  declare function String_2<Quotes extends string[], Input extends string>(quotes: [...Quotes], input: Input): TString<Quotes, Input>;
4540
4582
 
@@ -7229,6 +7271,36 @@ declare type TPropertyValues<Properties extends TProperties, Keys extends string
7229
7271
 
7230
7272
  declare type TPropertyValuesReduce<Properties extends TProperties, Keys extends string[], Result extends TSchema[] = []> = Keys extends [infer Left extends string, ...infer Right extends string[]] ? Left extends keyof Properties ? TPropertyValuesReduce<Properties, Right, [...Result, Properties[Left]]> : TPropertyValuesReduce<Properties, Right, Result> : Result;
7231
7273
 
7274
+ /** Every row, keyed by `customType`. */
7275
+ export declare const TRANSCRIPT_TYPE_TABLE: ReadonlyMap<string, TranscriptTypeRow>;
7276
+
7277
+ /**
7278
+ * Who a type is written for: the person reading the transcript, the model only, or the host
7279
+ * alone (records the daemon or the kernel reads back and no surface shows).
7280
+ */
7281
+ declare type TranscriptAudience = "person" | "model" | "host-only";
7282
+
7283
+ /** The kind of information a row carries; `unrecognized` is content the app cannot classify. */
7284
+ declare type TranscriptKind = "said" | "work" | "ask" | "result" | "context" | "notice" | "unrecognized";
7285
+
7286
+ /** The card a message answers: the `ui_render` call that drew it, and the element when known. */
7287
+ declare interface TranscriptTypeAnswer {
7288
+ readonly toolCallId: string;
7289
+ readonly elementId?: string;
7290
+ }
7291
+
7292
+ declare type TranscriptTypeRow = FixedAudienceRow | DetailsAudienceRow;
7293
+
7294
+ declare interface TranscriptTypeRowBase extends CustomMessagePlacementRow {
7295
+ /** Every kind this type can carry; a type whose kind depends on its details lists each. */
7296
+ readonly kinds: readonly [TranscriptKind, ...TranscriptKind[]];
7297
+ /**
7298
+ * Present on a type the card it answers draws (the answer, a sent-draft record), so it paints
7299
+ * no row of its own whatever its audience.
7300
+ */
7301
+ readonly answers?: (details: unknown) => TranscriptTypeAnswer | undefined;
7302
+ }
7303
+
7232
7304
  declare type TReadonly<Type extends TSchema = TSchema> = (Type & {
7233
7305
  '~readonly': true;
7234
7306
  });