@boardwalk-labs/runner 0.2.5 → 0.2.7

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.
@@ -1,8 +1,8 @@
1
- import { type LeafResume, type ToolHost, type LspService, type McpTokenResult } from "@boardwalk-labs/engine/core";
1
+ import { type LeafEventBody, type LeafResume, type ToolHost, type LspService, type McpTokenResult } from "@boardwalk-labs/engine/core";
2
2
  import type { AgentOptions } from "@boardwalk-labs/workflow/runtime";
3
3
  import type { BudgetMeter } from "./agent/budget.js";
4
4
  import type { SecretRedactor } from "./agent/secret_redactor.js";
5
- import type { AgentIdentity, TurnEventSink } from "./agent/events.js";
5
+ import type { AgentIdentity, RunEventBody, TurnEventSink } from "./agent/events.js";
6
6
  import type { InferenceProxyTransport } from "./inference_transport.js";
7
7
  import { type DirectInferenceDeps } from "./direct_inference.js";
8
8
  import type { LeafExecutor } from "./workflow_host.js";
@@ -121,4 +121,13 @@ type HostedMcpServerRef = NonNullable<AgentOptions["mcp"]>[number];
121
121
  * the engine connects, not via an MCP-specific allowlist that would be stricter than the platform.
122
122
  */
123
123
  export declare function assertHostedMcpAllowed(refs: readonly HostedMcpServerRef[] | undefined): void;
124
+ /**
125
+ * Project an engine `LeafEventBody` onto the platform's v1 `RunEventBody`. Both are the SDK's v1
126
+ * event kinds (the platform consumes `@boardwalk-labs/workflow`; the engine emits the same shapes),
127
+ * so this is a near-identity copy — `turn_ended` re-stamps the leaf identity the platform tracks,
128
+ * and the body is otherwise passed through verbatim. A discriminated switch keeps it exhaustive
129
+ * (any new engine kind surfaces as a compile error here, not a silent drop).
130
+ */
131
+ /** Engine LeafEventBody → the platform's v1 RunEventBody. Exported for testing. */
132
+ export declare function toRunEventBody(body: LeafEventBody, identity: AgentIdentity): RunEventBody;
124
133
  export {};
@@ -314,7 +314,8 @@ function toUsageDelta(usage) {
314
314
  * and the body is otherwise passed through verbatim. A discriminated switch keeps it exhaustive
315
315
  * (any new engine kind surfaces as a compile error here, not a silent drop).
316
316
  */
317
- function toRunEventBody(body, identity) {
317
+ /** Engine LeafEventBody → the platform's v1 RunEventBody. Exported for testing. */
318
+ export function toRunEventBody(body, identity) {
318
319
  switch (body.kind) {
319
320
  case "turn_ended":
320
321
  return {
@@ -347,5 +348,21 @@ function toRunEventBody(body, identity) {
347
348
  return { kind: "tool_call_result", toolCallId: body.toolCallId, result: body.result };
348
349
  case "tool_call_error":
349
350
  return { kind: "tool_call_error", toolCallId: body.toolCallId, error: body.error };
351
+ case "compaction_started":
352
+ return {
353
+ kind: "compaction_started",
354
+ ...identity,
355
+ tokens: body.tokens,
356
+ budget: body.budget,
357
+ ...(body.contextTokens === undefined ? {} : { contextTokens: body.contextTokens }),
358
+ };
359
+ case "compaction_ended":
360
+ return {
361
+ kind: "compaction_ended",
362
+ ...identity,
363
+ tokens: body.tokens,
364
+ reclaimed: body.reclaimed,
365
+ method: body.method,
366
+ };
350
367
  }
351
368
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boardwalk-labs/runner",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "Boardwalk self-hosted runner: execute cloud-scheduled runs on your own machines. Currently: the canonical runner contract types.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -53,8 +53,8 @@
53
53
  "prebuild": "prebuildify --napi --strip -t 24.0.0"
54
54
  },
55
55
  "dependencies": {
56
- "@boardwalk-labs/engine": "0.2.4",
57
- "@boardwalk-labs/workflow": "0.2.1",
56
+ "@boardwalk-labs/engine": "0.2.6",
57
+ "@boardwalk-labs/workflow": "0.2.2",
58
58
  "@modelcontextprotocol/sdk": "^1.29.0",
59
59
  "node-gyp-build": "^4.8.4",
60
60
  "tar": "^7.5.16",