@howaboua/pi-durable-worker-code 0.10.0 → 0.13.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.
@@ -1,4 +1,4 @@
1
- import type { JsonValue } from "@earendil-works/chord";
1
+ import type { JsonValue } from "@earendil-works/chord/json";
2
2
  import { type WorkerCodeLimits } from "./limits.ts";
3
3
  export interface GuestCapabilities {
4
4
  readonly inventory?: JsonValue;
@@ -1,6 +1,6 @@
1
1
  export type { ExecutionHistoryRequest } from "../../execution/src/history.ts";
2
2
  export declare const readForwardedToolCalls: (harness: {
3
- conversation: (id: import("@earendil-works/pi-durable").ConversationId, context: import("@earendil-works/chord").Context) => Promise<import("@earendil-works/pi-durable").Conversation | undefined>;
4
- getTask: <R>(id: import("@earendil-works/pi-durable").TaskId<R>, context: import("@earendil-works/chord").Context) => Promise<import("@earendil-works/pi-durable").TaskRecord<import("@earendil-works/chord").JsonValue, import("@earendil-works/chord").JsonValue, R> | undefined>;
5
- commit: <T>(change: (tx: import("@earendil-works/pi-durable").Tx) => T | Promise<T>, context: import("@earendil-works/chord").Context) => Promise<T>;
6
- }, request: import("../../execution/src/history.ts").ExecutionHistoryRequest, context: import("@earendil-works/chord").Context) => Promise<ReadonlyMap<string, import("./presentation.ts").ForwardedToolCalls>>;
3
+ conversation: (id: import("@earendil-works/pi-durable").ConversationId, context: import("@earendil-works/chord/context").Context) => Promise<import("@earendil-works/pi-durable").Conversation | undefined>;
4
+ getTask: <R>(id: import("@earendil-works/pi-durable").TaskId<R>, context: import("@earendil-works/chord/context").Context) => Promise<import("@earendil-works/pi-durable").TaskRecord<import("@earendil-works/chord/json").JsonValue, import("@earendil-works/chord/json").JsonValue, R> | undefined>;
5
+ commit: <T>(change: (tx: import("@earendil-works/pi-durable").Tx) => T | Promise<T>, context: import("@earendil-works/chord/context").Context, options?: import("@earendil-works/pi-durable").CommitOptions) => Promise<T>;
6
+ }, request: import("../../execution/src/history.ts").ExecutionHistoryRequest, context: import("@earendil-works/chord/context").Context) => Promise<ReadonlyMap<string, import("./presentation.ts").ForwardedToolCalls>>;
@@ -1,4 +1,4 @@
1
- import { type Context } from "@earendil-works/chord";
1
+ import type { Context } from "@earendil-works/chord/context";
2
2
  import { type ToolExecutionApi, type ToolExecutionResult } from "@earendil-works/pi-durable";
3
3
  import { Type } from "typebox";
4
4
  import { type CellCoordinatorOptions } from "../../execution/src/cell-contract.ts";
@@ -20,17 +20,18 @@ export interface WorkerCodeOptions {
20
20
  export declare function createWorkerCode(options: WorkerCodeOptions): {
21
21
  extension: {
22
22
  name: string;
23
+ namespace?: import("@earendil-works/pi-durable").ToolNamespace;
23
24
  hooks?: readonly import("@earendil-works/pi-durable").HookRegistration[];
24
25
  wraps?: readonly import("@earendil-works/pi-durable").Wrap<import("@earendil-works/pi-durable").ToolRegistration>[];
25
26
  tasks?: readonly import("@earendil-works/pi-durable").AnyTask[];
26
27
  tools: (import("@earendil-works/pi-durable").ToolRegistration<Type.TObject<{
27
28
  code: Type.TString;
28
- }>, import("@earendil-works/chord").JsonValue> | import("@earendil-works/pi-durable").ToolRegistration<Type.TObject<{
29
+ }>, import("@earendil-works/chord/json").JsonValue, import("@earendil-works/chord/json").JsonValue> | import("@earendil-works/pi-durable").ToolRegistration<Type.TObject<{
29
30
  cell_id: Type.TString;
30
31
  yield_time_ms: Type.TOptional<Type.TInteger>;
31
32
  max_tokens: Type.TOptional<Type.TInteger>;
32
33
  terminate: Type.TOptional<Type.TBoolean>;
33
- }>, import("@earendil-works/chord").JsonValue>)[];
34
+ }>, import("@earendil-works/chord/json").JsonValue, import("@earendil-works/chord/json").JsonValue>)[];
34
35
  sections: import("@earendil-works/pi-durable").PromptSection<import("@earendil-works/pi-durable").ToolRegistration>[];
35
36
  };
36
37
  /** Bind the owning Harness before execution to retain native nested display receipts. */
@@ -38,7 +39,7 @@ export declare function createWorkerCode(options: WorkerCodeOptions): {
38
39
  budget: typeof interpreterBudget;
39
40
  evaluateModule(request: WorkerModuleRequest, invocation?: {
40
41
  readonly signal?: AbortSignal;
41
- }): Promise<import("@earendil-works/chord").JsonValue>;
42
+ }): Promise<import("@earendil-works/chord/json").JsonValue>;
42
43
  /** Reuse the cell dispatcher under the CURRENT ordinary tool task, not another cell. */
43
44
  executeToolModule(request: WorkerModuleRequest, api: ToolExecutionApi, context: Context, grants?: {
44
45
  readonly allowedTools?: readonly string[];
@@ -1,4 +1,4 @@
1
- import type { JsonValue } from "@earendil-works/chord";
1
+ import type { JsonValue } from "@earendil-works/chord/json";
2
2
  import { type WorkerCodeLimits } from "./limits.ts";
3
3
  export interface WorkerModuleRequest {
4
4
  readonly modules: Readonly<Record<string, string>>;
@@ -1,4 +1,4 @@
1
- import { type JsonValue } from "@earendil-works/chord";
1
+ import { type JsonValue } from "@earendil-works/chord/json";
2
2
  import type { ToolExecutionResult } from "@earendil-works/pi-durable";
3
3
  import type { CellObservation } from "../../execution/src/cell-contract.ts";
4
4
  export declare function guestContent(kind: "text" | "image", value: JsonValue): NonNullable<ToolExecutionResult["output"]>[number];
@@ -1,4 +1,5 @@
1
- import { type Context, type JsonValue } from "@earendil-works/chord";
1
+ import type { Context } from "@earendil-works/chord/context";
2
+ import type { JsonValue } from "@earendil-works/chord/json";
2
3
  import type { ToolExecutionResult } from "@earendil-works/pi-durable";
3
4
  import type { CellEngine, CellEngineApi } from "../../execution/src/cell-contract.ts";
4
5
  import { type GuestCapabilities } from "./guest.ts";
@@ -1,3 +1,3 @@
1
- import type { JsonValue } from "@earendil-works/chord";
1
+ import type { JsonValue } from "@earendil-works/chord/json";
2
2
  import type { ToolExecutionResult } from "@earendil-works/pi-durable";
3
3
  export declare function guestToolResult(value: JsonValue): ToolExecutionResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@howaboua/pi-durable-worker-code",
3
- "version": "0.10.0",
3
+ "version": "0.13.0",
4
4
  "description": "Bounded Worker-native JavaScript execution for Pi Durable",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -41,14 +41,15 @@
41
41
  "dependencies": {
42
42
  "@jitl/quickjs-wasmfile-release-sync": "0.32.0",
43
43
  "quickjs-emscripten": "0.32.0",
44
- "typebox": "1.3.27",
45
- "@howaboua/pi-durable-components": "0.10.0"
44
+ "typebox": "1.4.7",
45
+ "@howaboua/pi-durable-components": "0.13.0",
46
+ "@earendil-works/pi-schema": "1.8.0"
46
47
  },
47
48
  "peerDependencies": {
48
- "@earendil-works/chord": "1.4.0",
49
- "@earendil-works/pi-ai": "1.4.0",
50
- "@earendil-works/pi-durable": "1.4.0",
51
- "@modelcontextprotocol/sdk": ">=1.25.2 <2"
49
+ "@earendil-works/chord": "1.8.0",
50
+ "@earendil-works/pi-ai": "1.8.0",
51
+ "@earendil-works/pi-durable": "1.8.0",
52
+ "@modelcontextprotocol/sdk": ">=1.32.2 <2"
52
53
  },
53
54
  "publishConfig": {
54
55
  "access": "public"