@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.
- package/README.md +1 -1
- package/dist/activation.js +366 -106
- package/dist/execution/src/cell-contract.d.ts +2 -1
- package/dist/execution/src/cell-observation.d.ts +1 -1
- package/dist/execution/src/cell-progress.d.ts +1 -1
- package/dist/execution/src/cell-tools.d.ts +2 -1
- package/dist/execution/src/cells.d.ts +1 -1
- package/dist/execution/src/history.d.ts +1 -1
- package/dist/execution/src/invocation-state.d.ts +1 -1
- package/dist/execution/src/invocation.d.ts +79 -2
- package/dist/execution/src/native-tools.d.ts +18 -7
- package/dist/execution/src/nested-call.d.ts +11 -3
- package/dist/execution/src/nested-park.d.ts +9 -0
- package/dist/execution/src/nested-result.d.ts +1 -1
- package/dist/execution/src/tool-contract.d.ts +10 -3
- package/dist/execution/src/tool-namespaces.d.ts +31 -0
- package/dist/execution/src/tool-origin.d.ts +9 -1
- package/dist/execution/src/wait-session.d.ts +1 -1
- package/dist/history.js +18 -11
- package/dist/index.js +366 -106
- package/dist/worker-code/src/guest.d.ts +1 -1
- package/dist/worker-code/src/history.d.ts +4 -4
- package/dist/worker-code/src/index.d.ts +5 -4
- package/dist/worker-code/src/modules.d.ts +1 -1
- package/dist/worker-code/src/output.d.ts +1 -1
- package/dist/worker-code/src/runtime.d.ts +2 -1
- package/dist/worker-code/src/tool-result.d.ts +1 -1
- package/package.json +8 -7
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { Context
|
|
1
|
+
import type { Context } from "@earendil-works/chord/context";
|
|
2
|
+
import type { JsonValue } from "@earendil-works/chord/json";
|
|
2
3
|
import type { ConversationId, Harness, JsonObject, TaskId, ToolExecutionApi, ToolExecutionResult, ToolRegistration } from "@earendil-works/pi-durable";
|
|
3
4
|
import type { ForwardedToolCalls } from "./forwarded-tools.ts";
|
|
4
5
|
/** Drivers own language/runtime globals. The coordinator owns durable execution and tool calls. */
|
|
@@ -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 TaskId, type ToolExecutionApi, type ToolExecutionResult } from "@earendil-works/pi-durable";
|
|
3
3
|
import type { CellObservation } from "./cell-contract.ts";
|
|
4
4
|
import { type InvocationState } from "./invocation-state.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Context } from "@earendil-works/chord/context";
|
|
2
2
|
import { type TaskId, type ToolExecutionApi, type ToolExecutionResult } from "@earendil-works/pi-durable";
|
|
3
3
|
/** The observer owns subscriptions and in-flight callbacks until exec/wait returns. */
|
|
4
4
|
export declare function observeCellProgress(id: TaskId<ToolExecutionResult>, api: ToolExecutionApi, context: Context, budget: number): Promise<() => Promise<void>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Context } from "@earendil-works/chord/context";
|
|
2
|
+
import { type JsonValue } from "@earendil-works/chord/json";
|
|
2
3
|
import type { TaskRuntime, ToolControl, ToolExecutionApi, ToolExecutionResult, ToolRegistration } from "@earendil-works/pi-durable";
|
|
3
4
|
import type { CellCoordinatorOptions } from "./cell-contract.ts";
|
|
4
5
|
import { createNestedToolTask } from "./nested.ts";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Context } from "@earendil-works/chord/context";
|
|
2
2
|
import { type Harness, type JsonObject, type TaskId, type ToolExecutionApi, type ToolExecutionResult } from "@earendil-works/pi-durable";
|
|
3
3
|
import type { CellCoordinatorOptions, CellObservation } from "./cell-contract.ts";
|
|
4
4
|
export type { CellCoordinatorOptions } from "./cell-contract.ts";
|
|
@@ -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 { ConversationId, Harness } from "@earendil-works/pi-durable";
|
|
3
3
|
import type { ForwardedToolCalls } from "./forwarded-tools.ts";
|
|
4
4
|
export interface ExecutionHistoryRequest {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type JsonRepresentation, type JsonValue } from "@earendil-works/chord";
|
|
1
|
+
import { type JsonRepresentation, type JsonValue } from "@earendil-works/chord/json";
|
|
2
2
|
import { type TaskId, type ToolExecutionResult } from "@earendil-works/pi-durable";
|
|
3
3
|
import type { ForwardedToolCalls } from "./forwarded-tools.ts";
|
|
4
4
|
type StoredResult = JsonRepresentation<ToolExecutionResult>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type Context } 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 { TextContent } from "@earendil-works/pi-ai";
|
|
3
4
|
import { type TaskRuntime, type ToolDiagnostic, type ToolExecutionApi, type ToolExecutionResult, type ToolRegistration } from "@earendil-works/pi-durable";
|
|
4
5
|
import { OutputBuffer, type OutputLimits } from "./output.ts";
|
|
@@ -6,7 +7,9 @@ import { Progress } from "./progress.ts";
|
|
|
6
7
|
export declare function executionError(code: string, message: string): ToolExecutionResult;
|
|
7
8
|
export declare function errorText(error: unknown): string;
|
|
8
9
|
/** One invocation owns its output, progress commits, environment and child-task API. */
|
|
9
|
-
export declare function createInvocation<I, S, R, H extends object>(runtime: TaskRuntime<I, S, R, H>, tool: Pick<ToolRegistration, "outputLimits" | "replay">, context: Context
|
|
10
|
+
export declare function createInvocation<I, S, R, H extends object>(runtime: TaskRuntime<I, S, R, H>, tool: Pick<ToolRegistration, "outputLimits" | "replay">, context: Context, resume?: Pick<ToolExecutionApi, "wake" | "checkpoint"> & {
|
|
11
|
+
progress?: Pick<ToolExecutionResult, "details" | "diagnostics">;
|
|
12
|
+
}): {
|
|
10
13
|
/** Resolve the environment after the tracker exists, so environment failures still settle bounded hook results. */
|
|
11
14
|
executionApi(): Promise<ToolExecutionApi>;
|
|
12
15
|
finish(result: ToolExecutionResult): Promise<{
|
|
@@ -24,6 +27,80 @@ export declare function createInvocation<I, S, R, H extends object>(runtime: Tas
|
|
|
24
27
|
content: (import("@earendil-works/pi-ai").ImageContent | TextContent)[];
|
|
25
28
|
}>;
|
|
26
29
|
stop(error: unknown): Promise<void>;
|
|
30
|
+
park(): Promise<{
|
|
31
|
+
progress: {
|
|
32
|
+
readonly output?: ({
|
|
33
|
+
type: "image";
|
|
34
|
+
data: string;
|
|
35
|
+
mimeType: string;
|
|
36
|
+
} | {
|
|
37
|
+
type: "text";
|
|
38
|
+
text: string;
|
|
39
|
+
textSignature?: string;
|
|
40
|
+
})[];
|
|
41
|
+
readonly structuredOutput?: JsonValue;
|
|
42
|
+
readonly isError?: boolean;
|
|
43
|
+
readonly details?: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | /*elided*/ any | {
|
|
44
|
+
[x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any | null;
|
|
45
|
+
} | null)[] | {
|
|
46
|
+
[x: string]: string | number | boolean | any | any | null;
|
|
47
|
+
} | null)[] | {
|
|
48
|
+
[x: string]: string | number | boolean | any | any | null;
|
|
49
|
+
} | null)[] | {
|
|
50
|
+
[x: string]: string | number | boolean | any | any | null;
|
|
51
|
+
} | null)[] | {
|
|
52
|
+
[x: string]: string | number | boolean | any | any | null;
|
|
53
|
+
} | null)[] | {
|
|
54
|
+
[x: string]: string | number | boolean | any | any | null;
|
|
55
|
+
} | null)[] | {
|
|
56
|
+
[x: string]: string | number | boolean | any | any | null;
|
|
57
|
+
} | null)[] | {
|
|
58
|
+
[x: string]: string | number | boolean | any | any | null;
|
|
59
|
+
} | null)[] | {
|
|
60
|
+
[x: string]: string | number | boolean | any | any | null;
|
|
61
|
+
} | null)[] | {
|
|
62
|
+
[x: string]: string | number | boolean | any | any | null;
|
|
63
|
+
} | null)[] | {
|
|
64
|
+
[x: string]: string | number | boolean | any | any | null;
|
|
65
|
+
} | null)[] | {
|
|
66
|
+
[x: string]: string | number | boolean | any | any | null;
|
|
67
|
+
} | null;
|
|
68
|
+
readonly diagnostics?: {
|
|
69
|
+
readonly severity: "info" | "warn" | "error";
|
|
70
|
+
readonly message: string;
|
|
71
|
+
readonly code?: string;
|
|
72
|
+
}[];
|
|
73
|
+
readonly usage?: {
|
|
74
|
+
input: number;
|
|
75
|
+
output: number;
|
|
76
|
+
cacheRead: number;
|
|
77
|
+
cacheWrite: number;
|
|
78
|
+
cacheWrite1h?: number;
|
|
79
|
+
reasoning?: number;
|
|
80
|
+
imageOutput?: number;
|
|
81
|
+
totalTokens: number;
|
|
82
|
+
cost: {
|
|
83
|
+
input: number;
|
|
84
|
+
output: number;
|
|
85
|
+
cacheRead: number;
|
|
86
|
+
cacheWrite: number;
|
|
87
|
+
total: number;
|
|
88
|
+
totalFromProvider?: boolean;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
readonly control?: {
|
|
92
|
+
readonly addTools?: string[];
|
|
93
|
+
readonly terminate?: boolean;
|
|
94
|
+
readonly handoff?: string;
|
|
95
|
+
};
|
|
96
|
+
readonly kind?: never;
|
|
97
|
+
};
|
|
98
|
+
pending: {
|
|
99
|
+
promise: Promise<void>;
|
|
100
|
+
resolve(): void;
|
|
101
|
+
reject(error: unknown): void;
|
|
102
|
+
}[];
|
|
103
|
+
}>;
|
|
27
104
|
limits: OutputLimits;
|
|
28
105
|
output: OutputBuffer;
|
|
29
106
|
progress: Progress;
|
|
@@ -1,11 +1,22 @@
|
|
|
1
|
-
import { type Context } from "@earendil-works/chord";
|
|
2
|
-
import { type JsonObject, type NestedToolExecutionResult, type TaskRuntime } from "@earendil-works/pi-durable";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { type Context } from "@earendil-works/chord/context";
|
|
2
|
+
import { type JsonObject, type NestedToolCall, type NestedToolExecutionResult, type TaskRuntime } from "@earendil-works/pi-durable";
|
|
3
|
+
type CallOptions = {
|
|
4
|
+
readonly key?: string;
|
|
5
|
+
readonly progress?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare function assertNestedKey(key: string): void;
|
|
8
|
+
export declare function nativeToolCalls<I, S, R, H extends object>(runtime: TaskRuntime<I, S, R, H>, callId: string, replay: "safe" | "unsafe" | undefined, resumed: boolean, assertLive: () => void, context: Context): {
|
|
9
|
+
execute: {
|
|
10
|
+
(name: string, args: JsonObject, callContext: Context, options?: CallOptions & {
|
|
11
|
+
readonly wait?: true;
|
|
12
|
+
}): Promise<NestedToolExecutionResult>;
|
|
13
|
+
(name: string, args: JsonObject, callContext: Context, options: CallOptions & {
|
|
14
|
+
readonly wait: false;
|
|
15
|
+
}): Promise<NestedToolCall>;
|
|
16
|
+
};
|
|
17
|
+
drain(): Promise<void>;
|
|
8
18
|
finish(): Promise<void>;
|
|
9
19
|
};
|
|
10
20
|
/** Custom cell callers own native nested slots too, including after recovery. */
|
|
11
21
|
export declare function cleanupNativeCalls<I, S, R, H extends object>(runtime: TaskRuntime<I, S, R, H>, context: Context): Promise<void>;
|
|
22
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { JsonValue } from "@earendil-works/chord";
|
|
1
|
+
import type { JsonValue } from "@earendil-works/chord/json";
|
|
2
2
|
import type { ToolCall } from "@earendil-works/pi-ai";
|
|
3
|
-
import { type Agent, type HookApi, type JsonObject, type TaskId, type TaskRuntime, type ToolExecutionResult, type ToolHookCall, type ToolHooks, type ToolRegistration } from "@earendil-works/pi-durable";
|
|
3
|
+
import { type Agent, type HookApi, type JsonObject, type TaskId, type TaskRuntime, type ToolExecutionResult, type ToolHookCall, type ToolHooks, type ToolRegistration, type WakeReason } from "@earendil-works/pi-durable";
|
|
4
4
|
export type NestedInput = {
|
|
5
5
|
name: string;
|
|
6
6
|
arguments: JsonValue;
|
|
@@ -9,10 +9,18 @@ export type NestedInput = {
|
|
|
9
9
|
};
|
|
10
10
|
export type Checkpoint = {
|
|
11
11
|
phase: "call";
|
|
12
|
-
} | {
|
|
12
|
+
} | (NestedIntent & {
|
|
13
13
|
phase: "execute";
|
|
14
|
+
resume?: {
|
|
15
|
+
wake: WakeReason;
|
|
16
|
+
};
|
|
17
|
+
}) | (NestedIntent & {
|
|
18
|
+
phase: "parked";
|
|
19
|
+
});
|
|
20
|
+
export type NestedIntent = {
|
|
14
21
|
arguments: JsonObject;
|
|
15
22
|
replay: "safe" | "unsafe";
|
|
23
|
+
checkpoint?: JsonValue;
|
|
16
24
|
};
|
|
17
25
|
export type Runtime = TaskRuntime<NestedInput, Checkpoint, ToolExecutionResult, Record<string, never>>;
|
|
18
26
|
export declare function nestedCall(runtime: Runtime, input: NestedInput): ToolHookCall;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Context } from "@earendil-works/chord/context";
|
|
2
|
+
import type { JsonObject, ToolHooks, ToolPark, ToolRegistration } from "@earendil-works/pi-durable";
|
|
3
|
+
import { createInvocation } from "./invocation.ts";
|
|
4
|
+
import type { NestedIntent, Runtime } from "./nested-call.ts";
|
|
5
|
+
export type GateSleep = NonNullable<NonNullable<Awaited<ReturnType<ToolHooks["beforeTool"]>>>["sleep"]>;
|
|
6
|
+
export declare function parkGate(runtime: Runtime, sleep: GateSleep, context: Context): Promise<string | undefined>;
|
|
7
|
+
/** A parked child releases its phase, not its parent cell or its owned work. */
|
|
8
|
+
export declare function parkTool(runtime: Runtime, invocation: ReturnType<typeof createInvocation>, tool: ToolRegistration, args: JsonObject, park: ToolPark, context: Context): Promise<string | undefined>;
|
|
9
|
+
export declare function cancelParkedTool(runtime: Runtime, tool: ToolRegistration | undefined, intent: NestedIntent, context: Context): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Context } from "@earendil-works/chord/context";
|
|
2
2
|
import type { ToolCall } from "@earendil-works/pi-ai";
|
|
3
3
|
import { type JsonObject, type ToolExecutionResult } from "@earendil-works/pi-durable";
|
|
4
4
|
import type { Runtime } from "./nested-call.ts";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { type JsonValue } from "@earendil-works/chord";
|
|
2
|
-
import type { TSchema } from "@earendil-works/pi-ai";
|
|
1
|
+
import { type JsonValue } from "@earendil-works/chord/json";
|
|
3
2
|
import type { ToolRegistration } from "@earendil-works/pi-durable";
|
|
3
|
+
import { type JsToolNamespace } from "./tool-namespaces.ts";
|
|
4
|
+
export declare const nestedToolDiscoveryGuidance = "Tools without a shown call signature: help is required only while their current arguments are unknown. Call with no arguments and read the result before composing an operation. Reuse known arguments without repeating help. Structured discovery uses {}";
|
|
4
5
|
/** Optional runtime presentation and observation policy on an ordinary registration. */
|
|
5
6
|
export interface ExecutionToolHints {
|
|
6
7
|
readonly usage?: string;
|
|
@@ -12,9 +13,13 @@ export interface ExecutionToolHints {
|
|
|
12
13
|
readonly discovery?: "help";
|
|
13
14
|
/** Keep the tool on the provider surface and prohibit calls from execution cells. */
|
|
14
15
|
readonly nativeOnly?: boolean;
|
|
16
|
+
/** Show the native schema; allow named cell calls without listing them in cell discovery. */
|
|
17
|
+
readonly nestedHidden?: boolean;
|
|
15
18
|
}
|
|
16
|
-
export type ExecutionToolRegistration<T extends
|
|
19
|
+
export type ExecutionToolRegistration<T extends object = object, D extends JsonValue = JsonValue> = ToolRegistration<T, D> & {
|
|
17
20
|
readonly executionHints?: ExecutionToolHints;
|
|
21
|
+
/** Older runtimes still invoke the registration by name without this projection. */
|
|
22
|
+
readonly jsNamespace?: JsToolNamespace;
|
|
18
23
|
};
|
|
19
24
|
interface ExecutionToolContract {
|
|
20
25
|
readonly name: string;
|
|
@@ -24,6 +29,8 @@ interface ExecutionToolContract {
|
|
|
24
29
|
readonly inputSchema: JsonValue;
|
|
25
30
|
readonly deferLoading: boolean;
|
|
26
31
|
readonly nativeOnly: boolean;
|
|
32
|
+
readonly nestedHidden: boolean;
|
|
33
|
+
readonly jsNamespace?: JsToolNamespace;
|
|
27
34
|
readonly discovery?: "help";
|
|
28
35
|
readonly yieldTimeMs?: number;
|
|
29
36
|
readonly help: string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { JsonObject } from "@earendil-works/pi-durable";
|
|
2
|
+
interface NamespaceMethod {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
/** Expose this method on a reference-bound namespace and pass it in this argument. */
|
|
5
|
+
readonly bind?: string;
|
|
6
|
+
readonly defaults?: JsonObject;
|
|
7
|
+
}
|
|
8
|
+
export interface JsToolNamespace {
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly methods: readonly NamespaceMethod[];
|
|
11
|
+
readonly prompt: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function validateJsToolNamespace(tool: string, namespace: JsToolNamespace): void;
|
|
14
|
+
export declare function jsToolPrompt(contract: {
|
|
15
|
+
readonly nativeOnly: boolean;
|
|
16
|
+
readonly nestedHidden: boolean;
|
|
17
|
+
readonly deferLoading: boolean;
|
|
18
|
+
readonly jsNamespace?: JsToolNamespace;
|
|
19
|
+
readonly prompt: string;
|
|
20
|
+
}): string[];
|
|
21
|
+
export declare function namespaceDefinitions(tools: readonly {
|
|
22
|
+
readonly name: string;
|
|
23
|
+
readonly jsNamespace?: JsToolNamespace;
|
|
24
|
+
}[]): {
|
|
25
|
+
tool: string;
|
|
26
|
+
name: string;
|
|
27
|
+
methods: readonly NamespaceMethod[];
|
|
28
|
+
}[];
|
|
29
|
+
/** Shared guest bootstrap. Aliases are data; only the ordinary tool dispatcher is callable. */
|
|
30
|
+
export declare const installToolNamespacesSource = "(tools, definitions) => {\n const namespaces = Object.create(null);\n const binders = Object.create(null);\n let active = true;\n const add = (target, key, value) => {\n if (Object.hasOwn(target, key)) throw new Error(\"Duplicate tool namespace member: \" + key);\n target[key] = value;\n };\n const object = (value) => value !== null && typeof value === \"object\" && !Array.isArray(value);\n for (const { tool, name, methods } of definitions) {\n const namespace = namespaces[name] ??= Object.create(null);\n const bound = binders[name] ??= Object.create(null);\n for (const { name: method, bind, defaults } of methods) {\n const invoke = (args, ref) => {\n if (!active)\n throw new Error(\"Tool namespace binding expired; bind the server reference again in this cell\");\n if (args !== undefined && !object(args))\n throw new TypeError(\"Tool namespace arguments must be an object\");\n return tools[tool]({ ...args, ...defaults, ...(bind === undefined ? {} : { [bind]: ref }) });\n };\n if (bind === undefined) {\n add(namespace, method, (args) => invoke(args));\n continue;\n }\n if (!Object.hasOwn(bound, bind)) {\n const members = bound[bind] = Object.create(null);\n add(namespace, bind, (ref) => {\n if (!object(ref)) throw new TypeError(\"Supply a discovered namespace reference\");\n const reference = { ...ref };\n const result = Object.create(null);\n for (const [key, call] of Object.entries(members))\n result[key] = (args) => call(args, reference);\n return Object.freeze(result);\n });\n }\n add(bound[bind], method, invoke);\n }\n }\n for (const namespace of Object.values(namespaces)) Object.freeze(namespace);\n globalThis.toolNamespaces = Object.freeze(namespaces);\n return () => {\n active = false;\n if (globalThis.toolNamespaces === namespaces)\n globalThis.toolNamespaces = Object.freeze(Object.create(null));\n };\n}";
|
|
31
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ConversationId, type TaskId } from "@earendil-works/pi-durable";
|
|
1
|
+
import { type ConversationId, type TaskId, type Tx } from "@earendil-works/pi-durable";
|
|
2
2
|
/** Admission provenance, not authorization: consumers must still verify the live originating slot. */
|
|
3
3
|
export type ToolOrigin = {
|
|
4
4
|
conversationId: ConversationId;
|
|
@@ -9,3 +9,11 @@ export type ToolOrigin = {
|
|
|
9
9
|
export declare const ToolOriginDoc: import("@earendil-works/pi-durable").TaskDocToken<{
|
|
10
10
|
origin?: ToolOrigin;
|
|
11
11
|
}>;
|
|
12
|
+
/** A direct execution invocation has an independently settled result and an admission snapshot. */
|
|
13
|
+
export declare function admittedExecutionCall(tx: Tx, conversation: ConversationId, child: TaskId): Promise<{
|
|
14
|
+
cell: TaskId<import("@earendil-works/chord/json").JsonValue>;
|
|
15
|
+
tool: TaskId<import("@earendil-works/chord/json").JsonValue>;
|
|
16
|
+
call: string;
|
|
17
|
+
} | undefined>;
|
|
18
|
+
/** Resolve immutable admission, never the latest observed assistant entry. */
|
|
19
|
+
export declare function admittedToolRound(tx: Tx, conversation: ConversationId, child: TaskId): Promise<import("@earendil-works/pi-durable").EntryId | undefined>;
|
|
@@ -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 { TaskId, ToolExecutionApi, ToolExecutionResult } from "@earendil-works/pi-durable";
|
|
3
3
|
import type { CellCoordinatorOptions, CellObservation } from "./cell-contract.ts";
|
|
4
4
|
import type { createNestedToolTask } from "./nested.ts";
|
package/dist/history.js
CHANGED
|
@@ -11,7 +11,7 @@ SOURCE: /[\s\S]+/
|
|
|
11
11
|
`;
|
|
12
12
|
|
|
13
13
|
// packages/execution/src/forwarding.ts
|
|
14
|
-
import { copyJson as copyJson2 } from "@earendil-works/chord";
|
|
14
|
+
import { copyJson as copyJson2 } from "@earendil-works/chord/json";
|
|
15
15
|
import {
|
|
16
16
|
LiveDoc,
|
|
17
17
|
NestedCallDoc,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
// packages/execution/src/invocation-state.ts
|
|
22
22
|
import {
|
|
23
23
|
copyJson
|
|
24
|
-
} from "@earendil-works/chord";
|
|
24
|
+
} from "@earendil-works/chord/json";
|
|
25
25
|
import {
|
|
26
26
|
defineDoc
|
|
27
27
|
} from "@earendil-works/pi-durable";
|
|
@@ -91,32 +91,36 @@ function forwardedStatus(result, fallback) {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
// packages/execution/src/nested-result.ts
|
|
94
|
-
import { copyJson as copyJson5 } from "@earendil-works/chord";
|
|
94
|
+
import { copyJson as copyJson5 } from "@earendil-works/chord/json";
|
|
95
95
|
import {
|
|
96
96
|
defineEntry,
|
|
97
97
|
UsageDoc
|
|
98
98
|
} from "@earendil-works/pi-durable";
|
|
99
99
|
|
|
100
100
|
// packages/execution/src/invocation.ts
|
|
101
|
-
import { copyJson as copyJson4 } from "@earendil-works/chord";
|
|
102
101
|
import { awaitWithContext } from "@earendil-works/chord/context";
|
|
102
|
+
import { copyJson as copyJson4 } from "@earendil-works/chord/json";
|
|
103
|
+
import {
|
|
104
|
+
NestedCallDoc as NestedCallDoc3
|
|
105
|
+
} from "@earendil-works/pi-durable";
|
|
106
|
+
import { equal } from "@earendil-works/pi-schema";
|
|
103
107
|
|
|
104
108
|
// packages/execution/src/native-tools.ts
|
|
105
|
-
import {
|
|
106
|
-
|
|
109
|
+
import {
|
|
110
|
+
withoutAbortSignal
|
|
111
|
+
} from "@earendil-works/chord/context";
|
|
112
|
+
import { copyJson as copyJson3 } from "@earendil-works/chord/json";
|
|
107
113
|
import {
|
|
108
114
|
LiveDoc as LiveDoc2,
|
|
109
115
|
NestedCallDoc as NestedCallDoc2,
|
|
110
|
-
ToolTask as
|
|
116
|
+
ToolTask as ToolTask3
|
|
111
117
|
} from "@earendil-works/pi-durable";
|
|
112
118
|
import { Equal } from "typebox/value";
|
|
113
119
|
|
|
114
|
-
// packages/execution/src/progress.ts
|
|
115
|
-
var PROGRESS_BYTES_PER_SECOND = 100 * 1024;
|
|
116
|
-
|
|
117
120
|
// packages/execution/src/tool-origin.ts
|
|
118
121
|
import {
|
|
119
|
-
defineDoc as defineDoc2
|
|
122
|
+
defineDoc as defineDoc2,
|
|
123
|
+
ToolTask as ToolTask2
|
|
120
124
|
} from "@earendil-works/pi-durable";
|
|
121
125
|
var ToolOriginDoc = defineDoc2({
|
|
122
126
|
kind: "howaboua.tool-origin",
|
|
@@ -126,6 +130,9 @@ var ToolOriginDoc = defineDoc2({
|
|
|
126
130
|
initial: () => ({})
|
|
127
131
|
});
|
|
128
132
|
|
|
133
|
+
// packages/execution/src/progress.ts
|
|
134
|
+
var PROGRESS_BYTES_PER_SECOND = 100 * 1024;
|
|
135
|
+
|
|
129
136
|
// packages/execution/src/nested-result.ts
|
|
130
137
|
var NestedResultEntry = defineEntry("howaboua.execution.nested-result");
|
|
131
138
|
|