@earendil-works/pi-agent-core 0.84.3 → 0.85.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 +4 -0
- package/dist/agent-loop.d.ts.map +1 -1
- package/dist/agent-loop.js +32 -25
- package/dist/agent-loop.js.map +1 -1
- package/dist/harness/agent-harness.d.ts +639 -384
- package/dist/harness/agent-harness.d.ts.map +1 -1
- package/dist/harness/agent-harness.js +5 -251
- package/dist/harness/agent-harness.js.map +1 -1
- package/dist/harness/compaction/branch-summarization.d.ts +12 -6
- package/dist/harness/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/harness/compaction/branch-summarization.js +33 -26
- package/dist/harness/compaction/branch-summarization.js.map +1 -1
- package/dist/harness/compaction/compaction.d.ts +30 -8
- package/dist/harness/compaction/compaction.d.ts.map +1 -1
- package/dist/harness/compaction/compaction.js +53 -63
- package/dist/harness/compaction/compaction.js.map +1 -1
- package/dist/harness/config.d.ts +9 -0
- package/dist/harness/config.d.ts.map +1 -0
- package/dist/harness/config.js +27 -0
- package/dist/harness/config.js.map +1 -0
- package/dist/harness/context.d.ts +9 -0
- package/dist/harness/context.d.ts.map +1 -0
- package/dist/harness/context.js +13 -0
- package/dist/harness/context.js.map +1 -0
- package/dist/harness/env/nodejs.d.ts +24 -28
- package/dist/harness/env/nodejs.d.ts.map +1 -1
- package/dist/harness/env/nodejs.js +242 -87
- package/dist/harness/env/nodejs.js.map +1 -1
- package/dist/harness/events.d.ts +20 -38
- package/dist/harness/events.d.ts.map +1 -1
- package/dist/harness/events.js +240 -55
- package/dist/harness/events.js.map +1 -1
- package/dist/harness/execution/assistant.d.ts +42 -0
- package/dist/harness/execution/assistant.d.ts.map +1 -0
- package/dist/harness/execution/assistant.js +82 -0
- package/dist/harness/execution/assistant.js.map +1 -0
- package/dist/harness/execution/effect-gate.d.ts +22 -0
- package/dist/harness/execution/effect-gate.d.ts.map +1 -0
- package/dist/harness/execution/effect-gate.js +49 -0
- package/dist/harness/execution/effect-gate.js.map +1 -0
- package/dist/harness/execution/tools.d.ts +67 -0
- package/dist/harness/execution/tools.d.ts.map +1 -0
- package/dist/harness/execution/tools.js +121 -0
- package/dist/harness/execution/tools.js.map +1 -0
- package/dist/harness/hooks.d.ts +38 -0
- package/dist/harness/hooks.d.ts.map +1 -0
- package/dist/harness/hooks.js +406 -0
- package/dist/harness/hooks.js.map +1 -0
- package/dist/harness/messages.d.ts +2 -2
- package/dist/harness/messages.d.ts.map +1 -1
- package/dist/harness/messages.js.map +1 -1
- package/dist/harness/prompt-templates.d.ts +3 -2
- package/dist/harness/prompt-templates.d.ts.map +1 -1
- package/dist/harness/prompt-templates.js +17 -17
- package/dist/harness/prompt-templates.js.map +1 -1
- package/dist/harness/result.d.ts +93 -0
- package/dist/harness/result.d.ts.map +1 -1
- package/dist/harness/result.js +40 -0
- package/dist/harness/result.js.map +1 -1
- package/dist/harness/runtime/drive/boundary.d.ts +28 -0
- package/dist/harness/runtime/drive/boundary.d.ts.map +1 -0
- package/dist/harness/runtime/drive/boundary.js +170 -0
- package/dist/harness/runtime/drive/boundary.js.map +1 -0
- package/dist/harness/runtime/drive/checkpoint.d.ts +8 -0
- package/dist/harness/runtime/drive/checkpoint.d.ts.map +1 -0
- package/dist/harness/runtime/drive/checkpoint.js +133 -0
- package/dist/harness/runtime/drive/checkpoint.js.map +1 -0
- package/dist/harness/runtime/drive/deferred.d.ts +15 -0
- package/dist/harness/runtime/drive/deferred.d.ts.map +1 -0
- package/dist/harness/runtime/drive/deferred.js +179 -0
- package/dist/harness/runtime/drive/deferred.js.map +1 -0
- package/dist/harness/runtime/drive/generation.d.ts +8 -0
- package/dist/harness/runtime/drive/generation.d.ts.map +1 -0
- package/dist/harness/runtime/drive/generation.js +205 -0
- package/dist/harness/runtime/drive/generation.js.map +1 -0
- package/dist/harness/runtime/drive/reconcile.d.ts +5 -0
- package/dist/harness/runtime/drive/reconcile.d.ts.map +1 -0
- package/dist/harness/runtime/drive/reconcile.js +140 -0
- package/dist/harness/runtime/drive/reconcile.js.map +1 -0
- package/dist/harness/runtime/drive/recovery.d.ts +8 -0
- package/dist/harness/runtime/drive/recovery.d.ts.map +1 -0
- package/dist/harness/runtime/drive/recovery.js +85 -0
- package/dist/harness/runtime/drive/recovery.js.map +1 -0
- package/dist/harness/runtime/drive/response.d.ts +23 -0
- package/dist/harness/runtime/drive/response.d.ts.map +1 -0
- package/dist/harness/runtime/drive/response.js +394 -0
- package/dist/harness/runtime/drive/response.js.map +1 -0
- package/dist/harness/runtime/drive/retry.d.ts +4 -0
- package/dist/harness/runtime/drive/retry.d.ts.map +1 -0
- package/dist/harness/runtime/drive/retry.js +37 -0
- package/dist/harness/runtime/drive/retry.js.map +1 -0
- package/dist/harness/runtime/drive/structural.d.ts +32 -0
- package/dist/harness/runtime/drive/structural.d.ts.map +1 -0
- package/dist/harness/runtime/drive/structural.js +929 -0
- package/dist/harness/runtime/drive/structural.js.map +1 -0
- package/dist/harness/runtime/drive/terminal.d.ts +7 -0
- package/dist/harness/runtime/drive/terminal.d.ts.map +1 -0
- package/dist/harness/runtime/drive/terminal.js +49 -0
- package/dist/harness/runtime/drive/terminal.js.map +1 -0
- package/dist/harness/runtime/drive/tool-placement.d.ts +14 -0
- package/dist/harness/runtime/drive/tool-placement.d.ts.map +1 -0
- package/dist/harness/runtime/drive/tool-placement.js +244 -0
- package/dist/harness/runtime/drive/tool-placement.js.map +1 -0
- package/dist/harness/runtime/drive/tools.d.ts +6 -0
- package/dist/harness/runtime/drive/tools.d.ts.map +1 -0
- package/dist/harness/runtime/drive/tools.js +449 -0
- package/dist/harness/runtime/drive/tools.js.map +1 -0
- package/dist/harness/runtime/drive.d.ts +6 -0
- package/dist/harness/runtime/drive.d.ts.map +1 -0
- package/dist/harness/runtime/drive.js +93 -0
- package/dist/harness/runtime/drive.js.map +1 -0
- package/dist/harness/runtime/harness.d.ts +59 -0
- package/dist/harness/runtime/harness.d.ts.map +1 -0
- package/dist/harness/runtime/harness.js +311 -0
- package/dist/harness/runtime/harness.js.map +1 -0
- package/dist/harness/runtime/index.d.ts +2 -0
- package/dist/harness/runtime/index.d.ts.map +1 -0
- package/dist/harness/runtime/index.js +2 -0
- package/dist/harness/runtime/index.js.map +1 -0
- package/dist/harness/runtime/lane.d.ts +101 -0
- package/dist/harness/runtime/lane.d.ts.map +1 -0
- package/dist/harness/runtime/lane.js +1575 -0
- package/dist/harness/runtime/lane.js.map +1 -0
- package/dist/harness/runtime/progress.d.ts +15 -0
- package/dist/harness/runtime/progress.d.ts.map +1 -0
- package/dist/harness/runtime/progress.js +66 -0
- package/dist/harness/runtime/progress.js.map +1 -0
- package/dist/harness/runtime/reducer.d.ts +5 -0
- package/dist/harness/runtime/reducer.d.ts.map +1 -0
- package/dist/harness/runtime/reducer.js +240 -0
- package/dist/harness/runtime/reducer.js.map +1 -0
- package/dist/harness/runtime/restore.d.ts +24 -0
- package/dist/harness/runtime/restore.d.ts.map +1 -0
- package/dist/harness/runtime/restore.js +117 -0
- package/dist/harness/runtime/restore.js.map +1 -0
- package/dist/harness/runtime/transcript.d.ts +21 -0
- package/dist/harness/runtime/transcript.d.ts.map +1 -0
- package/dist/harness/runtime/transcript.js +72 -0
- package/dist/harness/runtime/transcript.js.map +1 -0
- package/dist/harness/runtime/types.d.ts +105 -0
- package/dist/harness/runtime/types.d.ts.map +1 -0
- package/dist/harness/runtime/types.js +61 -0
- package/dist/harness/runtime/types.js.map +1 -0
- package/dist/harness/session/commit.d.ts +53 -0
- package/dist/harness/session/commit.d.ts.map +1 -0
- package/dist/harness/session/commit.js +57 -0
- package/dist/harness/session/commit.js.map +1 -0
- package/dist/harness/session/context.d.ts +6 -18
- package/dist/harness/session/context.d.ts.map +1 -1
- package/dist/harness/session/context.js +31 -49
- package/dist/harness/session/context.js.map +1 -1
- package/dist/harness/session/fork-policy.d.ts +13 -0
- package/dist/harness/session/fork-policy.d.ts.map +1 -0
- package/dist/harness/session/fork-policy.js +22 -0
- package/dist/harness/session/fork-policy.js.map +1 -0
- package/dist/harness/session/fork.d.ts +18 -0
- package/dist/harness/session/fork.d.ts.map +1 -0
- package/dist/harness/session/fork.js +127 -0
- package/dist/harness/session/fork.js.map +1 -0
- package/dist/harness/session/in-memory-storage-state.d.ts +39 -0
- package/dist/harness/session/in-memory-storage-state.d.ts.map +1 -0
- package/dist/harness/session/in-memory-storage-state.js +216 -0
- package/dist/harness/session/in-memory-storage-state.js.map +1 -0
- package/dist/harness/session/index.d.ts +9 -5
- package/dist/harness/session/index.d.ts.map +1 -1
- package/dist/harness/session/index.js +7 -4
- package/dist/harness/session/index.js.map +1 -1
- package/dist/harness/session/jsonl/codec.d.ts +19 -8
- package/dist/harness/session/jsonl/codec.d.ts.map +1 -1
- package/dist/harness/session/jsonl/codec.js +34 -218
- package/dist/harness/session/jsonl/codec.js.map +1 -1
- package/dist/harness/session/jsonl/index.d.ts +4 -0
- package/dist/harness/session/jsonl/index.d.ts.map +1 -0
- package/dist/harness/session/jsonl/index.js +4 -0
- package/dist/harness/session/jsonl/index.js.map +1 -0
- package/dist/harness/session/jsonl/legacy-v3.d.ts +18 -0
- package/dist/harness/session/jsonl/legacy-v3.d.ts.map +1 -0
- package/dist/harness/session/jsonl/legacy-v3.js +383 -0
- package/dist/harness/session/jsonl/legacy-v3.js.map +1 -0
- package/dist/harness/session/jsonl/repo.d.ts +26 -19
- package/dist/harness/session/jsonl/repo.d.ts.map +1 -1
- package/dist/harness/session/jsonl/repo.js +266 -156
- package/dist/harness/session/jsonl/repo.js.map +1 -1
- package/dist/harness/session/jsonl/storage.d.ts +39 -41
- package/dist/harness/session/jsonl/storage.d.ts.map +1 -1
- package/dist/harness/session/jsonl/storage.js +238 -181
- package/dist/harness/session/jsonl/storage.js.map +1 -1
- package/dist/harness/session/jsonl/types.d.ts +23 -22
- package/dist/harness/session/jsonl/types.d.ts.map +1 -1
- package/dist/harness/session/jsonl/types.js +2 -1
- package/dist/harness/session/jsonl/types.js.map +1 -1
- package/dist/harness/session/memory.d.ts +46 -40
- package/dist/harness/session/memory.d.ts.map +1 -1
- package/dist/harness/session/memory.js +346 -113
- package/dist/harness/session/memory.js.map +1 -1
- package/dist/harness/session/mutation-line.d.ts +8 -0
- package/dist/harness/session/mutation-line.d.ts.map +1 -0
- package/dist/harness/session/mutation-line.js +21 -0
- package/dist/harness/session/mutation-line.js.map +1 -0
- package/dist/harness/session/session.d.ts +78 -46
- package/dist/harness/session/session.d.ts.map +1 -1
- package/dist/harness/session/session.js +343 -209
- package/dist/harness/session/session.js.map +1 -1
- package/dist/harness/session/testing/benchmark/datasets.d.ts +12 -0
- package/dist/harness/session/testing/benchmark/datasets.d.ts.map +1 -0
- package/dist/harness/session/testing/benchmark/datasets.js +24 -0
- package/dist/harness/session/testing/benchmark/datasets.js.map +1 -0
- package/dist/harness/session/testing/benchmark/session-repo.d.ts +42 -0
- package/dist/harness/session/testing/benchmark/session-repo.d.ts.map +1 -0
- package/dist/harness/session/testing/benchmark/session-repo.js +127 -0
- package/dist/harness/session/testing/benchmark/session-repo.js.map +1 -0
- package/dist/harness/session/testing/benchmark/storage.d.ts +25 -0
- package/dist/harness/session/testing/benchmark/storage.d.ts.map +1 -0
- package/dist/harness/session/testing/benchmark/storage.js +114 -0
- package/dist/harness/session/testing/benchmark/storage.js.map +1 -0
- package/dist/harness/session/testing/conformance/session-repo.d.ts +21 -0
- package/dist/harness/session/testing/conformance/session-repo.d.ts.map +1 -0
- package/dist/harness/session/testing/conformance/session-repo.js +590 -0
- package/dist/harness/session/testing/conformance/session-repo.js.map +1 -0
- package/dist/harness/session/testing/conformance/storage.d.ts +4 -0
- package/dist/harness/session/testing/conformance/storage.d.ts.map +1 -0
- package/dist/harness/session/testing/conformance/storage.js +600 -0
- package/dist/harness/session/testing/conformance/storage.js.map +1 -0
- package/dist/harness/session/testing/gating-storage.d.ts +26 -0
- package/dist/harness/session/testing/gating-storage.d.ts.map +1 -0
- package/dist/harness/session/testing/gating-storage.js +100 -0
- package/dist/harness/session/testing/gating-storage.js.map +1 -0
- package/dist/harness/session/testing/index.d.ts +9 -2
- package/dist/harness/session/testing/index.d.ts.map +1 -1
- package/dist/harness/session/testing/index.js +8 -1
- package/dist/harness/session/testing/index.js.map +1 -1
- package/dist/harness/session/testing/instrumented-storage.d.ts +11 -0
- package/dist/harness/session/testing/instrumented-storage.d.ts.map +1 -0
- package/dist/harness/session/testing/instrumented-storage.js +16 -0
- package/dist/harness/session/testing/instrumented-storage.js.map +1 -0
- package/dist/harness/session/testing/storage-decorator.d.ts +20 -0
- package/dist/harness/session/testing/storage-decorator.d.ts.map +1 -0
- package/dist/harness/session/testing/storage-decorator.js +41 -0
- package/dist/harness/session/testing/storage-decorator.js.map +1 -0
- package/dist/harness/session/testing/types.d.ts +5 -7
- package/dist/harness/session/testing/types.d.ts.map +1 -1
- package/dist/harness/session/testing/types.js.map +1 -1
- package/dist/harness/session/types.d.ts +424 -259
- package/dist/harness/session/types.d.ts.map +1 -1
- package/dist/harness/session/types.js +7 -8
- package/dist/harness/session/types.js.map +1 -1
- package/dist/harness/session/values.d.ts +95 -0
- package/dist/harness/session/values.d.ts.map +1 -0
- package/dist/harness/session/values.js +81 -0
- package/dist/harness/session/values.js.map +1 -0
- package/dist/harness/skills.d.ts +3 -2
- package/dist/harness/skills.d.ts.map +1 -1
- package/dist/harness/skills.js +29 -26
- package/dist/harness/skills.js.map +1 -1
- package/dist/harness/telemetry.d.ts +64 -43
- package/dist/harness/telemetry.d.ts.map +1 -1
- package/dist/harness/telemetry.js +45 -26
- package/dist/harness/telemetry.js.map +1 -1
- package/dist/harness/tools/bash.d.ts +4 -4
- package/dist/harness/tools/bash.d.ts.map +1 -1
- package/dist/harness/tools/bash.js +66 -93
- package/dist/harness/tools/bash.js.map +1 -1
- package/dist/harness/tools/edit.d.ts.map +1 -1
- package/dist/harness/tools/edit.js +10 -10
- package/dist/harness/tools/edit.js.map +1 -1
- package/dist/harness/tools/file-mutation-queue.d.ts +2 -1
- package/dist/harness/tools/file-mutation-queue.d.ts.map +1 -1
- package/dist/harness/tools/file-mutation-queue.js +5 -5
- package/dist/harness/tools/file-mutation-queue.js.map +1 -1
- package/dist/harness/tools/path-utils.d.ts +3 -2
- package/dist/harness/tools/path-utils.d.ts.map +1 -1
- package/dist/harness/tools/path-utils.js +5 -5
- package/dist/harness/tools/path-utils.js.map +1 -1
- package/dist/harness/tools/read.d.ts +2 -1
- package/dist/harness/tools/read.d.ts.map +1 -1
- package/dist/harness/tools/read.js +4 -6
- package/dist/harness/tools/read.js.map +1 -1
- package/dist/harness/tools/write.d.ts.map +1 -1
- package/dist/harness/tools/write.js +7 -7
- package/dist/harness/tools/write.js.map +1 -1
- package/dist/harness/types.d.ts +108 -45
- package/dist/harness/types.d.ts.map +1 -1
- package/dist/harness/types.js.map +1 -1
- package/dist/harness/utils/adaptive-publisher.d.ts +24 -0
- package/dist/harness/utils/adaptive-publisher.d.ts.map +1 -0
- package/dist/harness/utils/adaptive-publisher.js +79 -0
- package/dist/harness/utils/adaptive-publisher.js.map +1 -0
- package/dist/harness/utils/output-capture.d.ts +31 -0
- package/dist/harness/utils/output-capture.d.ts.map +1 -0
- package/dist/harness/utils/output-capture.js +217 -0
- package/dist/harness/utils/output-capture.js.map +1 -0
- package/dist/harness/utils/shell-output.d.ts +12 -5
- package/dist/harness/utils/shell-output.d.ts.map +1 -1
- package/dist/harness/utils/shell-output.js +64 -174
- package/dist/harness/utils/shell-output.js.map +1 -1
- package/dist/harness/utils/truncate.d.ts +1 -0
- package/dist/harness/utils/truncate.d.ts.map +1 -1
- package/dist/harness/utils/truncate.js +1 -1
- package/dist/harness/utils/truncate.js.map +1 -1
- package/dist/harness/utils/usage.d.ts +4 -0
- package/dist/harness/utils/usage.d.ts.map +1 -0
- package/dist/harness/utils/usage.js +33 -0
- package/dist/harness/utils/usage.js.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -6
- package/dist/index.js.map +1 -1
- package/dist/proxy.d.ts +2 -0
- package/dist/proxy.d.ts.map +1 -1
- package/dist/proxy.js +40 -10
- package/dist/proxy.js.map +1 -1
- package/dist/search/index.d.ts +24 -16
- package/dist/search/index.d.ts.map +1 -1
- package/dist/search/index.js +1 -1
- package/dist/search/index.js.map +1 -1
- package/dist/types.d.ts +5 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +25 -4
- package/dist/harness/reducer.d.ts +0 -100
- package/dist/harness/reducer.d.ts.map +0 -1
- package/dist/harness/reducer.js +0 -415
- package/dist/harness/reducer.js.map +0 -1
- package/dist/harness/session/jsonl/errors.d.ts +0 -9
- package/dist/harness/session/jsonl/errors.d.ts.map +0 -1
- package/dist/harness/session/jsonl/errors.js +0 -19
- package/dist/harness/session/jsonl/errors.js.map +0 -1
- package/dist/harness/session/jsonl.d.ts +0 -3
- package/dist/harness/session/jsonl.d.ts.map +0 -1
- package/dist/harness/session/jsonl.js +0 -2
- package/dist/harness/session/jsonl.js.map +0 -1
- package/dist/harness/session/state.d.ts +0 -65
- package/dist/harness/session/state.d.ts.map +0 -1
- package/dist/harness/session/state.js +0 -319
- package/dist/harness/session/state.js.map +0 -1
- package/dist/harness/session/testing/conformance.d.ts +0 -4
- package/dist/harness/session/testing/conformance.d.ts.map +0 -1
- package/dist/harness/session/testing/conformance.js +0 -762
- package/dist/harness/session/testing/conformance.js.map +0 -1
- package/dist/search/scanning.d.ts +0 -29
- package/dist/search/scanning.d.ts.map +0 -1
- package/dist/search/scanning.js +0 -103
- package/dist/search/scanning.js.map +0 -1
|
@@ -1,461 +1,716 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
|
|
1
|
+
import type { JsonRepresentation } from "@earendil-works/chord";
|
|
2
|
+
import type { Api, AssistantMessage, AssistantMessageEvent, AssistantMessageFrame, DeferredHandle, ImageContent, Message, Model, Models, RetryPolicy, ToolResultMessage, Usage } from "@earendil-works/pi-ai";
|
|
3
|
+
import type { AgentMessage, AgentToolResult, QueueMode, ThinkingLevel } from "../types.ts";
|
|
4
|
+
import type { BranchPreparation, BranchSummaryResult } from "./compaction/branch-summarization.ts";
|
|
5
|
+
import type { CompactionPreparation, CompactionSettings, CompactResult } from "./compaction/compaction.ts";
|
|
6
|
+
import type { Context } from "./context.ts";
|
|
7
|
+
import type { Closed, InvalidMessage, InvalidNavigation, LaneBusy, NoActiveOperation, NothingToCompact, NothingToResume, OperationMismatch, Result, UnknownSkill, UnknownTarget, UnknownTemplate } from "./result.ts";
|
|
8
|
+
export { Closed, HarnessClosed, HarnessFault, InvalidLane, InvalidMessage, InvalidNavigation, LaneBusy, NoActiveOperation, NoActiveRun, NothingToCompact, NothingToResume, OperationMismatch, UnknownSkill, UnknownTarget, UnknownTemplate, } from "./result.ts";
|
|
9
|
+
export { SliceNotImplemented } from "./runtime/types.ts";
|
|
10
|
+
import { createAgentHarness } from "./runtime/harness.ts";
|
|
11
|
+
import type { BranchScan, Entry, EntryProjector, JsonValue, LaneConfiguration, OperationError, OperationResultRecord, Session, SessionStats, SettledAssistantMessage, UsageRow } from "./session/types.ts";
|
|
12
|
+
import type { AgentHarnessResources, AgentHarnessStreamOptions, AgentHarnessStreamOptionsPatch, AgentHarnessTool, PromptTemplate, Skill } from "./types.ts";
|
|
13
|
+
/** Convenience-only suspended run observation, constructed when M8 exposes public drive. */
|
|
14
|
+
export interface SuspendedRun {
|
|
11
15
|
operationId: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}> {
|
|
15
|
-
}
|
|
16
|
-
declare const MissingIdentities_base: import("./result.ts").TaggedErrorFactory<"MissingIdentities">;
|
|
17
|
-
export declare class MissingIdentities extends MissingIdentities_base<{
|
|
18
|
-
lane: string;
|
|
19
|
-
tools: string[];
|
|
20
|
-
models: string[];
|
|
21
|
-
message: string;
|
|
22
|
-
}> {
|
|
23
|
-
}
|
|
24
|
-
declare const NoActiveRun_base: import("./result.ts").TaggedErrorFactory<"NoActiveRun">;
|
|
25
|
-
export declare class NoActiveRun extends NoActiveRun_base<{
|
|
26
|
-
lane: string;
|
|
27
|
-
message: string;
|
|
28
|
-
}> {
|
|
29
|
-
}
|
|
30
|
-
declare const NoActiveOperation_base: import("./result.ts").TaggedErrorFactory<"NoActiveOperation">;
|
|
31
|
-
export declare class NoActiveOperation extends NoActiveOperation_base<{
|
|
32
|
-
lane: string;
|
|
33
|
-
message: string;
|
|
34
|
-
}> {
|
|
35
|
-
}
|
|
36
|
-
declare const NothingToResume_base: import("./result.ts").TaggedErrorFactory<"NothingToResume">;
|
|
37
|
-
export declare class NothingToResume extends NothingToResume_base<{
|
|
38
|
-
lane: string;
|
|
39
|
-
message: string;
|
|
40
|
-
}> {
|
|
16
|
+
status: "suspended";
|
|
17
|
+
deferred: DeferredHandle;
|
|
41
18
|
}
|
|
42
|
-
|
|
43
|
-
export
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
19
|
+
export type RunResult = Result<OperationResultRecord | SuspendedRun, LaneBusy | InvalidMessage | UnknownSkill | UnknownTemplate | Closed>;
|
|
20
|
+
export type CompactionResult = Result<{
|
|
21
|
+
compaction: OperationResultRecord;
|
|
22
|
+
run?: OperationResultRecord | SuspendedRun;
|
|
23
|
+
}, LaneBusy | NothingToCompact | Closed>;
|
|
24
|
+
export type NavigationResult = Result<{
|
|
25
|
+
navigation: OperationResultRecord;
|
|
26
|
+
run?: OperationResultRecord | SuspendedRun;
|
|
27
|
+
}, LaneBusy | InvalidNavigation | UnknownTarget | Closed>;
|
|
28
|
+
export type ResumeResult = Result<OperationResultRecord | SuspendedRun, NothingToResume | Closed>;
|
|
29
|
+
export type QueueResult = Result<{
|
|
30
|
+
entryId: string;
|
|
31
|
+
}, InvalidMessage | Closed>;
|
|
32
|
+
export type CancelQueuedResult = Result<{
|
|
33
|
+
kind: "cancelled" | "already_consumed" | "not_found";
|
|
34
|
+
}, Closed>;
|
|
35
|
+
export type AbortResult = Result<{
|
|
36
|
+
operationId: string;
|
|
37
|
+
steer: AgentMessage[];
|
|
38
|
+
followUp: AgentMessage[];
|
|
39
|
+
}, NoActiveOperation | Closed>;
|
|
40
|
+
export type RecordUsageResult = Result<{
|
|
41
|
+
usageId: string;
|
|
42
|
+
}, Closed>;
|
|
43
|
+
export interface NavigateOptions {
|
|
44
|
+
summarize?: boolean;
|
|
45
|
+
label?: string;
|
|
46
|
+
customInstructions?: string;
|
|
48
47
|
}
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
export type OperationRequest = {
|
|
49
|
+
kind: "prompt";
|
|
50
|
+
operationId?: string;
|
|
51
|
+
prompt: string;
|
|
52
|
+
images?: ImageContent[];
|
|
53
|
+
} | {
|
|
54
|
+
kind: "prompt";
|
|
55
|
+
operationId?: string;
|
|
56
|
+
prompt: AgentMessage | AgentMessage[];
|
|
57
|
+
images?: never;
|
|
58
|
+
} | {
|
|
59
|
+
kind: "skill";
|
|
60
|
+
operationId?: string;
|
|
51
61
|
name: string;
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
export declare class UnknownTemplate extends UnknownTemplate_base<{
|
|
62
|
+
additionalInstructions?: string;
|
|
63
|
+
} | {
|
|
64
|
+
kind: "prompt_template";
|
|
65
|
+
operationId?: string;
|
|
57
66
|
name: string;
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
args?: string[];
|
|
68
|
+
} | {
|
|
69
|
+
kind: "compaction";
|
|
70
|
+
operationId?: string;
|
|
71
|
+
customInstructions?: string;
|
|
72
|
+
} | {
|
|
73
|
+
kind: "navigation";
|
|
74
|
+
operationId?: string;
|
|
75
|
+
targetId: string | null;
|
|
76
|
+
options?: NavigateOptions;
|
|
77
|
+
};
|
|
78
|
+
export interface OperationAdmission {
|
|
79
|
+
operationId: string;
|
|
80
|
+
kind: "run" | "compaction" | "navigation";
|
|
81
|
+
startedAt: number;
|
|
66
82
|
}
|
|
67
|
-
|
|
68
|
-
export
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
83
|
+
export type OperationAdmissionError = LaneBusy | InvalidMessage | UnknownSkill | UnknownTemplate | NothingToCompact | InvalidNavigation | UnknownTarget | Closed;
|
|
84
|
+
export type OperationAdmissionResult = Result<OperationAdmission, OperationAdmissionError>;
|
|
85
|
+
export interface DriveOptions {
|
|
86
|
+
operationId: string;
|
|
87
|
+
waitForRetry?: boolean;
|
|
88
|
+
pollDeferred?: boolean;
|
|
73
89
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
message: string;
|
|
78
|
-
}> {
|
|
90
|
+
export interface ModelIdentity {
|
|
91
|
+
provider: string;
|
|
92
|
+
modelId: string;
|
|
79
93
|
}
|
|
80
|
-
|
|
81
|
-
export
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
94
|
+
export type OperationStatus = "running" | "open" | "aborting";
|
|
95
|
+
export interface CurrentOperationInfo {
|
|
96
|
+
id: string;
|
|
97
|
+
kind: "run" | "compaction" | "navigation";
|
|
98
|
+
startedAt: number;
|
|
99
|
+
status: OperationStatus;
|
|
100
|
+
capturedModel?: ModelIdentity;
|
|
86
101
|
}
|
|
87
|
-
|
|
88
|
-
export declare class NothingToCompact extends NothingToCompact_base<{
|
|
102
|
+
export interface LaneExecutionInfo {
|
|
89
103
|
lane: string;
|
|
90
|
-
|
|
91
|
-
|
|
104
|
+
tipId: string | null;
|
|
105
|
+
configuredModel: ModelIdentity;
|
|
106
|
+
current: CurrentOperationInfo | null;
|
|
107
|
+
lastOperationId: string | null;
|
|
92
108
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}> {
|
|
97
|
-
}
|
|
98
|
-
export declare class HarnessFault extends Error {
|
|
99
|
-
readonly cause: unknown;
|
|
100
|
-
constructor(message: string, cause: unknown);
|
|
101
|
-
}
|
|
102
|
-
export declare class HarnessClosed extends Error {
|
|
103
|
-
constructor();
|
|
104
|
-
}
|
|
105
|
-
export declare class HarnessNotImplemented extends Error {
|
|
106
|
-
readonly operation: string;
|
|
107
|
-
constructor(operation: string);
|
|
108
|
-
}
|
|
109
|
-
export interface OperationError {
|
|
110
|
-
code: string;
|
|
111
|
-
message: string;
|
|
112
|
-
}
|
|
113
|
-
export type RunOutcome = {
|
|
114
|
-
kind: "completed";
|
|
115
|
-
leafId: string;
|
|
116
|
-
finalEntryId: string;
|
|
117
|
-
finalMessage: AssistantMessage;
|
|
118
|
-
} | {
|
|
119
|
-
kind: "aborted";
|
|
120
|
-
leafId: string;
|
|
121
|
-
finalEntryId: string;
|
|
122
|
-
finalMessage: AssistantMessage;
|
|
123
|
-
} | {
|
|
124
|
-
kind: "failed";
|
|
125
|
-
leafId: string;
|
|
126
|
-
error: OperationError;
|
|
127
|
-
finalEntryId?: string;
|
|
128
|
-
finalMessage?: AssistantMessage;
|
|
129
|
-
} | {
|
|
130
|
-
kind: "suspended";
|
|
131
|
-
leafId: string;
|
|
132
|
-
finalEntryId: string;
|
|
133
|
-
deferred: DeferredHandle;
|
|
134
|
-
};
|
|
135
|
-
export type CompactionOutcome = {
|
|
136
|
-
kind: "completed";
|
|
137
|
-
leafId: string;
|
|
138
|
-
entry: CompactionEntry;
|
|
109
|
+
export type DriveOutcome = {
|
|
110
|
+
kind: "settled";
|
|
111
|
+
outcome: OperationResultRecord;
|
|
139
112
|
} | {
|
|
140
|
-
kind: "
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
leafId: string;
|
|
145
|
-
error: OperationError;
|
|
146
|
-
};
|
|
147
|
-
export type NavigationOutcome = {
|
|
148
|
-
kind: "completed";
|
|
149
|
-
newLeafId: string | null;
|
|
150
|
-
summaryEntry?: BranchSummaryEntry;
|
|
151
|
-
} | {
|
|
152
|
-
kind: "declined" | "aborted";
|
|
153
|
-
leafId: string | null;
|
|
113
|
+
kind: "waiting";
|
|
114
|
+
operationId: string;
|
|
115
|
+
reason: "retry";
|
|
116
|
+
notBefore: number;
|
|
154
117
|
} | {
|
|
155
|
-
kind: "
|
|
156
|
-
|
|
157
|
-
|
|
118
|
+
kind: "waiting";
|
|
119
|
+
operationId: string;
|
|
120
|
+
reason: "deferred";
|
|
121
|
+
deferred: DeferredHandle;
|
|
158
122
|
};
|
|
159
|
-
export type
|
|
160
|
-
export type
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
export type QueueRejected = NoActiveRun | InvalidMessage | Closed;
|
|
164
|
-
export type CancelQueuedRejected = UnknownQueueItem | Closed;
|
|
165
|
-
export type AbortRejected = NoActiveOperation | Closed;
|
|
166
|
-
export type RunResult = ResultValue<{
|
|
167
|
-
runId: string;
|
|
168
|
-
} & RunOutcome, RunRejected>;
|
|
169
|
-
export type CompactionResult = ResultValue<{
|
|
170
|
-
runId: string;
|
|
171
|
-
} & CompactionOutcome, CompactionRejected>;
|
|
172
|
-
export type NavigationResult = ResultValue<{
|
|
173
|
-
runId: string;
|
|
174
|
-
} & NavigationOutcome, NavigationRejected>;
|
|
175
|
-
export type QueueResult = ResultValue<{
|
|
176
|
-
entryId: string;
|
|
177
|
-
}, QueueRejected>;
|
|
178
|
-
export type CancelQueuedResult = ResultValue<{
|
|
179
|
-
outcome: "cancelled" | "already_consumed" | "already_cleared";
|
|
180
|
-
}, CancelQueuedRejected>;
|
|
181
|
-
export type RecordUsageResult = ResultValue<void, Closed>;
|
|
182
|
-
export type AbortResult = ResultValue<{
|
|
183
|
-
runId: string;
|
|
123
|
+
export type DriveResult = Result<DriveOutcome, OperationMismatch | Closed>;
|
|
124
|
+
export type AbortRequestResult = Result<{
|
|
125
|
+
operationId: string;
|
|
126
|
+
newlyRequested: boolean;
|
|
184
127
|
steer: AgentMessage[];
|
|
185
128
|
followUp: AgentMessage[];
|
|
186
|
-
},
|
|
187
|
-
export
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
export type ResumeResult = ResultValue<ResumeOutcome, ResumeRejected>;
|
|
198
|
-
export type CreateLaneResult = ResultValue<AgentLane, LaneExists | InvalidLane | UnknownTarget | Closed>;
|
|
199
|
-
export interface NavigateOptions {
|
|
200
|
-
summarize?: boolean;
|
|
201
|
-
customInstructions?: string;
|
|
202
|
-
label?: string;
|
|
129
|
+
}, OperationMismatch | Closed>;
|
|
130
|
+
export interface WatchHandle<T> {
|
|
131
|
+
snapshot: T;
|
|
132
|
+
start(listener: EventListener): void;
|
|
133
|
+
resnapshot(context: Context): Promise<T>;
|
|
134
|
+
unsubscribe(): void;
|
|
135
|
+
}
|
|
136
|
+
export interface LaneInfo {
|
|
137
|
+
name: string;
|
|
138
|
+
tipId: string | null;
|
|
139
|
+
operation: CurrentOperationInfo | null;
|
|
203
140
|
}
|
|
204
|
-
export
|
|
141
|
+
export type LaneSnapshotTool = {
|
|
142
|
+
status: "running";
|
|
143
|
+
toolCallId: string;
|
|
144
|
+
toolName: string;
|
|
145
|
+
args: unknown;
|
|
146
|
+
result?: AgentToolResult<unknown>;
|
|
147
|
+
} | {
|
|
148
|
+
status: "settled";
|
|
149
|
+
toolCallId: string;
|
|
150
|
+
toolName: string;
|
|
151
|
+
args: unknown;
|
|
152
|
+
result: AgentToolResult<unknown>;
|
|
153
|
+
isError: boolean;
|
|
154
|
+
};
|
|
155
|
+
export interface OpenOperation {
|
|
205
156
|
lane: string;
|
|
157
|
+
operationId: string;
|
|
206
158
|
kind: "run" | "compaction" | "navigation";
|
|
207
|
-
id: string;
|
|
208
159
|
startedAt: number;
|
|
209
|
-
|
|
210
|
-
prompt?: AgentMessage[];
|
|
211
|
-
deferred?: DeferredHandle;
|
|
212
|
-
aborting?: {
|
|
213
|
-
steer: AgentMessage[];
|
|
214
|
-
followUp: AgentMessage[];
|
|
215
|
-
};
|
|
216
|
-
missing: {
|
|
217
|
-
tools: string[];
|
|
218
|
-
models: string[];
|
|
219
|
-
};
|
|
160
|
+
aborting?: true;
|
|
220
161
|
}
|
|
221
|
-
export
|
|
222
|
-
name: string;
|
|
223
|
-
leafId: string | null;
|
|
224
|
-
operation: null | {
|
|
225
|
-
id: string;
|
|
226
|
-
kind: "run" | "compaction" | "navigation";
|
|
227
|
-
status: "running" | "suspended" | "aborting";
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
export interface QueuedItem {
|
|
162
|
+
export type LaneQueuedItem = {
|
|
231
163
|
entryId: string;
|
|
164
|
+
kind: "steer" | "followUp" | "nextRun" | "write";
|
|
165
|
+
type: "message";
|
|
232
166
|
message: AgentMessage;
|
|
233
|
-
}
|
|
167
|
+
} | {
|
|
168
|
+
entryId: string;
|
|
169
|
+
kind: "write";
|
|
170
|
+
type: "custom";
|
|
171
|
+
customType: string;
|
|
172
|
+
data?: JsonValue;
|
|
173
|
+
};
|
|
234
174
|
export interface LaneSnapshot {
|
|
235
175
|
lane: string;
|
|
236
176
|
transcript: Entry[];
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
nextRun: QueuedItem[];
|
|
243
|
-
};
|
|
244
|
-
pendingWrites: {
|
|
177
|
+
tipId: string | null;
|
|
178
|
+
lastResult?: OperationResultRecord;
|
|
179
|
+
configuration: LaneConfiguration;
|
|
180
|
+
stats: SessionStats;
|
|
181
|
+
operation: null | {
|
|
245
182
|
id: string;
|
|
246
|
-
|
|
247
|
-
|
|
183
|
+
kind: "run" | "compaction" | "navigation";
|
|
184
|
+
startedAt: number;
|
|
185
|
+
fromTipId: string | null;
|
|
186
|
+
status: OperationStatus;
|
|
187
|
+
retry?: {
|
|
188
|
+
attempt: number;
|
|
189
|
+
maxAttempts: number;
|
|
190
|
+
nextAttemptAt: number;
|
|
191
|
+
};
|
|
192
|
+
deferred?: {
|
|
193
|
+
handle: DeferredHandle;
|
|
194
|
+
poll: number;
|
|
195
|
+
};
|
|
196
|
+
streamingMessage?: AssistantMessage;
|
|
197
|
+
runningTools: LaneSnapshotTool[];
|
|
198
|
+
};
|
|
199
|
+
queues: LaneQueuedItem[];
|
|
248
200
|
faulted: boolean;
|
|
249
201
|
}
|
|
250
202
|
export interface SessionSnapshot {
|
|
251
|
-
lanes:
|
|
252
|
-
suspended?: SuspendedOperation;
|
|
253
|
-
})[];
|
|
203
|
+
lanes: LaneInfo[];
|
|
254
204
|
faulted: boolean;
|
|
255
205
|
}
|
|
256
|
-
export type
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
206
|
+
export type HarnessEventPayload = {
|
|
207
|
+
type: "run_start";
|
|
208
|
+
runId: string;
|
|
209
|
+
startedAt: number;
|
|
260
210
|
} | {
|
|
261
|
-
|
|
262
|
-
|
|
211
|
+
type: "run_resume";
|
|
212
|
+
runId: string;
|
|
263
213
|
} | {
|
|
264
|
-
|
|
265
|
-
|
|
214
|
+
type: "run_suspend";
|
|
215
|
+
runId: string;
|
|
216
|
+
reason: "deferred";
|
|
217
|
+
deferred: DeferredHandle;
|
|
218
|
+
poll: number;
|
|
266
219
|
} | {
|
|
267
|
-
|
|
268
|
-
|
|
220
|
+
type: "operation_abort";
|
|
221
|
+
operationId: string;
|
|
222
|
+
steer: AgentMessage[];
|
|
223
|
+
followUp: AgentMessage[];
|
|
224
|
+
} | ({
|
|
225
|
+
type: "run_end";
|
|
226
|
+
runId: string;
|
|
227
|
+
fromTipId: string | null;
|
|
228
|
+
tipId: string | null;
|
|
229
|
+
endedAt: number;
|
|
230
|
+
} & ({
|
|
231
|
+
status: "completed" | "aborted";
|
|
232
|
+
error?: never;
|
|
269
233
|
} | {
|
|
270
|
-
|
|
271
|
-
|
|
234
|
+
status: "failed";
|
|
235
|
+
error: OperationError;
|
|
236
|
+
})) | {
|
|
237
|
+
type: "fault";
|
|
238
|
+
code: string;
|
|
239
|
+
message: string;
|
|
240
|
+
} | ({
|
|
241
|
+
type: "handler_error";
|
|
242
|
+
error: string;
|
|
243
|
+
stack?: string;
|
|
244
|
+
} & ({
|
|
245
|
+
kind: "hook";
|
|
246
|
+
hook: string;
|
|
272
247
|
} | {
|
|
273
|
-
kind: "
|
|
274
|
-
|
|
248
|
+
kind: "event";
|
|
249
|
+
event: string;
|
|
250
|
+
})) | {
|
|
251
|
+
type: "turn_start";
|
|
252
|
+
runId: string;
|
|
253
|
+
turnId: string;
|
|
275
254
|
} | {
|
|
276
|
-
|
|
255
|
+
type: "turn_end";
|
|
256
|
+
runId: string;
|
|
257
|
+
turnId: string;
|
|
258
|
+
message: AssistantMessage;
|
|
259
|
+
toolResults: ToolResultMessage[];
|
|
277
260
|
} | {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
261
|
+
type: "retry_scheduled";
|
|
262
|
+
runId: string;
|
|
263
|
+
step: string;
|
|
264
|
+
attempt: number;
|
|
265
|
+
maxAttempts: number;
|
|
266
|
+
delayMs: number;
|
|
267
|
+
notBefore: number;
|
|
268
|
+
errorMessage: string;
|
|
281
269
|
} | {
|
|
282
|
-
|
|
283
|
-
|
|
270
|
+
type: "retry_start";
|
|
271
|
+
runId: string;
|
|
272
|
+
step: string;
|
|
273
|
+
attempt: number;
|
|
284
274
|
} | {
|
|
285
|
-
|
|
286
|
-
|
|
275
|
+
type: "retry_end";
|
|
276
|
+
runId: string;
|
|
277
|
+
step: string;
|
|
287
278
|
attempt: number;
|
|
279
|
+
success: boolean;
|
|
280
|
+
finalError?: string;
|
|
281
|
+
} | {
|
|
282
|
+
type: "message_start";
|
|
283
|
+
runId?: string;
|
|
284
|
+
message: AgentMessage;
|
|
285
|
+
} | {
|
|
286
|
+
type: "message_update";
|
|
287
|
+
runId: string;
|
|
288
|
+
message: AgentMessage;
|
|
289
|
+
event: AssistantMessageEvent;
|
|
290
|
+
frame?: AssistantMessageFrame;
|
|
291
|
+
} | {
|
|
292
|
+
type: "message_end";
|
|
293
|
+
runId?: string;
|
|
294
|
+
message: AgentMessage;
|
|
295
|
+
entryId?: string;
|
|
288
296
|
} | {
|
|
289
|
-
|
|
297
|
+
type: "tool_start";
|
|
298
|
+
runId: string;
|
|
299
|
+
turnId: string;
|
|
290
300
|
toolCallId: string;
|
|
291
301
|
toolName: string;
|
|
302
|
+
args: unknown;
|
|
292
303
|
} | {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
304
|
+
type: "tool_update";
|
|
305
|
+
runId: string;
|
|
306
|
+
turnId: string;
|
|
307
|
+
toolCallId: string;
|
|
308
|
+
toolName: string;
|
|
309
|
+
partialResult: AgentToolResult<unknown>;
|
|
296
310
|
} | {
|
|
297
|
-
|
|
298
|
-
|
|
311
|
+
type: "tool_end";
|
|
312
|
+
runId: string;
|
|
313
|
+
turnId: string;
|
|
314
|
+
toolCallId: string;
|
|
315
|
+
toolName: string;
|
|
316
|
+
result: AgentToolResult<unknown>;
|
|
317
|
+
isError: boolean;
|
|
318
|
+
terminate: boolean;
|
|
299
319
|
} | {
|
|
300
|
-
|
|
301
|
-
|
|
320
|
+
type: "entry_added";
|
|
321
|
+
entry: Entry;
|
|
322
|
+
} | {
|
|
323
|
+
type: "queue_update";
|
|
324
|
+
queues: LaneQueuedItem[];
|
|
325
|
+
} | ({
|
|
326
|
+
type: "value_update";
|
|
327
|
+
} & ({
|
|
328
|
+
value: "session_name";
|
|
329
|
+
name: string | undefined;
|
|
330
|
+
} | {
|
|
331
|
+
value: "entry_label";
|
|
332
|
+
targetId: string;
|
|
333
|
+
label: string | undefined;
|
|
334
|
+
})) | ({
|
|
335
|
+
type: "config_update";
|
|
336
|
+
} & ({
|
|
337
|
+
property: "model";
|
|
338
|
+
value: {
|
|
339
|
+
provider: string;
|
|
340
|
+
modelId: string;
|
|
341
|
+
};
|
|
342
|
+
previous: unknown;
|
|
343
|
+
} | {
|
|
344
|
+
property: "thinkingLevel";
|
|
345
|
+
value: ThinkingLevel;
|
|
346
|
+
previous: ThinkingLevel;
|
|
347
|
+
} | {
|
|
348
|
+
property: "activeTools";
|
|
349
|
+
value: string[];
|
|
350
|
+
previous: string[];
|
|
351
|
+
} | {
|
|
352
|
+
property: "tools" | "resources";
|
|
353
|
+
} | {
|
|
354
|
+
property: "streamOptions";
|
|
355
|
+
value: AgentHarnessStreamOptions;
|
|
356
|
+
previous: AgentHarnessStreamOptions;
|
|
357
|
+
} | {
|
|
358
|
+
property: "retryPolicy";
|
|
359
|
+
value: RetryPolicy;
|
|
360
|
+
previous: RetryPolicy;
|
|
361
|
+
} | {
|
|
362
|
+
property: "compactionSettings";
|
|
363
|
+
value: CompactionSettings;
|
|
364
|
+
previous: CompactionSettings;
|
|
365
|
+
} | {
|
|
366
|
+
property: "steeringMode";
|
|
367
|
+
value: QueueMode;
|
|
368
|
+
previous: QueueMode;
|
|
369
|
+
} | {
|
|
370
|
+
property: "followUpMode";
|
|
371
|
+
value: QueueMode;
|
|
372
|
+
previous: QueueMode;
|
|
373
|
+
})) | {
|
|
374
|
+
type: "compaction_start";
|
|
375
|
+
runId: string;
|
|
376
|
+
reason: "manual" | "threshold" | "overflow";
|
|
377
|
+
startedAt: number;
|
|
378
|
+
} | ({
|
|
379
|
+
type: "compaction_end";
|
|
380
|
+
runId: string;
|
|
381
|
+
reason: "manual" | "threshold" | "overflow";
|
|
382
|
+
endedAt: number;
|
|
383
|
+
} & ({
|
|
384
|
+
status: "completed";
|
|
385
|
+
entryId: string;
|
|
386
|
+
error?: never;
|
|
387
|
+
} | {
|
|
388
|
+
status: "declined" | "aborted";
|
|
389
|
+
entryId?: never;
|
|
390
|
+
error?: never;
|
|
391
|
+
} | {
|
|
392
|
+
status: "failed";
|
|
393
|
+
entryId?: never;
|
|
394
|
+
error: OperationError;
|
|
395
|
+
})) | {
|
|
396
|
+
type: "navigation_start";
|
|
397
|
+
runId: string;
|
|
398
|
+
targetId: string | null;
|
|
399
|
+
startedAt: number;
|
|
400
|
+
} | ({
|
|
401
|
+
type: "navigation_end";
|
|
402
|
+
runId: string;
|
|
403
|
+
fromTipId: string | null;
|
|
404
|
+
tipId: string | null;
|
|
405
|
+
endedAt: number;
|
|
406
|
+
} & ({
|
|
407
|
+
status: "completed" | "declined" | "aborted";
|
|
408
|
+
error?: never;
|
|
409
|
+
} | {
|
|
410
|
+
status: "failed";
|
|
411
|
+
error: OperationError;
|
|
412
|
+
})) | {
|
|
413
|
+
type: "lane_created";
|
|
414
|
+
at: string | null;
|
|
415
|
+
} | {
|
|
416
|
+
type: "usage";
|
|
417
|
+
lane: string;
|
|
418
|
+
row: UsageRow;
|
|
419
|
+
totals: Usage;
|
|
420
|
+
};
|
|
421
|
+
export type SpecialEventPayload = Extract<HarnessEventPayload, {
|
|
422
|
+
type: "fault" | "value_update" | "usage" | "config_update" | "handler_error";
|
|
423
|
+
}>;
|
|
424
|
+
export type LaneEventPayload = Exclude<HarnessEventPayload, SpecialEventPayload>;
|
|
425
|
+
export type ConfigEventPayload = Extract<HarnessEventPayload, {
|
|
426
|
+
type: "config_update";
|
|
427
|
+
}>;
|
|
428
|
+
export type LaneConfigEventPayload = Extract<ConfigEventPayload, {
|
|
429
|
+
property: "model" | "thinkingLevel" | "activeTools";
|
|
430
|
+
}>;
|
|
431
|
+
export type GlobalConfigEventPayload = Exclude<ConfigEventPayload, LaneConfigEventPayload>;
|
|
432
|
+
export type HandlerErrorPayload = Extract<HarnessEventPayload, {
|
|
433
|
+
type: "handler_error";
|
|
434
|
+
}>;
|
|
435
|
+
export type HarnessEvent = (LaneEventPayload & {
|
|
436
|
+
lane: string;
|
|
437
|
+
recovery?: true;
|
|
438
|
+
}) | (LaneConfigEventPayload & {
|
|
439
|
+
lane: string;
|
|
440
|
+
recovery?: true;
|
|
441
|
+
}) | (Extract<HarnessEventPayload, {
|
|
442
|
+
type: "fault" | "value_update";
|
|
443
|
+
}> & {
|
|
444
|
+
lane?: never;
|
|
445
|
+
recovery?: never;
|
|
446
|
+
}) | (Extract<HarnessEventPayload, {
|
|
447
|
+
type: "usage";
|
|
448
|
+
}> & {
|
|
449
|
+
recovery?: never;
|
|
450
|
+
}) | (GlobalConfigEventPayload & {
|
|
451
|
+
lane?: never;
|
|
452
|
+
recovery?: never;
|
|
453
|
+
}) | (HandlerErrorPayload & ({
|
|
454
|
+
lane: string;
|
|
455
|
+
recovery?: true;
|
|
456
|
+
} | {
|
|
457
|
+
lane?: never;
|
|
458
|
+
recovery?: never;
|
|
459
|
+
}));
|
|
460
|
+
type LaneWatchSourceEvent = Exclude<HarnessEvent, {
|
|
461
|
+
type: "handler_error" | "turn_start" | "turn_end" | "value_update" | "lane_created" | "message_update";
|
|
462
|
+
} | ({
|
|
463
|
+
type: "config_update";
|
|
464
|
+
} & {
|
|
465
|
+
property: string;
|
|
466
|
+
})> | Extract<HarnessEvent, {
|
|
467
|
+
type: "config_update";
|
|
468
|
+
property: "model" | "thinkingLevel" | "activeTools";
|
|
469
|
+
}> | Omit<Extract<HarnessEvent, {
|
|
470
|
+
type: "message_update";
|
|
471
|
+
}>, "event">;
|
|
472
|
+
/** Strict-JSON snapshot representation published to remote transcript consumers. */
|
|
473
|
+
export type LaneTranscriptSnapshot = JsonRepresentation<LaneSnapshot>;
|
|
474
|
+
/** Reducer-relevant strict-JSON Harness events published to remote transcript consumers. */
|
|
475
|
+
export type LaneWatchEvent = JsonRepresentation<LaneWatchSourceEvent>;
|
|
476
|
+
export type HarnessEventType = HarnessEvent["type"];
|
|
477
|
+
export type EventListener<TEvent extends HarnessEvent = HarnessEvent> = (event: TEvent, context: Context) => void | Promise<void>;
|
|
478
|
+
export interface Events {
|
|
479
|
+
on<TType extends HarnessEventType>(type: TType, listener: EventListener<Extract<HarnessEvent, {
|
|
480
|
+
type: TType;
|
|
481
|
+
}>>): () => void;
|
|
482
|
+
}
|
|
483
|
+
export type Resources = AgentHarnessResources<Skill, PromptTemplate>;
|
|
484
|
+
type VoidHookResult = ReturnType<() => void>;
|
|
485
|
+
export interface HookMap {
|
|
486
|
+
before_run: {
|
|
487
|
+
event: {
|
|
488
|
+
prompt: AgentMessage[];
|
|
489
|
+
resources: Resources;
|
|
490
|
+
};
|
|
491
|
+
result: {
|
|
492
|
+
messages?: AgentMessage[];
|
|
493
|
+
} | undefined;
|
|
494
|
+
};
|
|
495
|
+
before_drive: {
|
|
496
|
+
event: {
|
|
497
|
+
operation: "run" | "compaction" | "navigation";
|
|
498
|
+
};
|
|
499
|
+
result: VoidHookResult;
|
|
500
|
+
};
|
|
501
|
+
before_run_end: {
|
|
502
|
+
event: {
|
|
503
|
+
runId: string;
|
|
504
|
+
messages: AgentMessage[];
|
|
505
|
+
};
|
|
506
|
+
result: {
|
|
507
|
+
followUp?: string;
|
|
508
|
+
} | undefined;
|
|
509
|
+
};
|
|
510
|
+
transform_context: {
|
|
511
|
+
event: {
|
|
512
|
+
messages: AgentMessage[];
|
|
513
|
+
systemPrompt: string;
|
|
514
|
+
};
|
|
515
|
+
result: {
|
|
516
|
+
messages?: AgentMessage[];
|
|
517
|
+
systemPrompt?: string;
|
|
518
|
+
} | undefined;
|
|
519
|
+
};
|
|
520
|
+
before_request: {
|
|
521
|
+
event: {
|
|
522
|
+
model: Model<Api>;
|
|
523
|
+
step: "assistant" | "deferred" | "compaction" | "branch_summary";
|
|
524
|
+
attempt: number;
|
|
525
|
+
streamOptions: AgentHarnessStreamOptions;
|
|
526
|
+
};
|
|
527
|
+
result: {
|
|
528
|
+
streamOptions?: AgentHarnessStreamOptionsPatch;
|
|
529
|
+
} | undefined;
|
|
530
|
+
};
|
|
531
|
+
before_payload: {
|
|
532
|
+
event: {
|
|
533
|
+
model: Model<Api>;
|
|
534
|
+
payload: unknown;
|
|
535
|
+
};
|
|
536
|
+
result: {
|
|
537
|
+
payload: unknown;
|
|
538
|
+
} | undefined;
|
|
539
|
+
};
|
|
540
|
+
after_response: {
|
|
541
|
+
event: {
|
|
542
|
+
status?: number;
|
|
543
|
+
headers?: Record<string, string>;
|
|
544
|
+
message: SettledAssistantMessage;
|
|
545
|
+
};
|
|
546
|
+
result: {
|
|
547
|
+
message?: SettledAssistantMessage;
|
|
548
|
+
} | undefined;
|
|
549
|
+
};
|
|
550
|
+
before_tool: {
|
|
551
|
+
event: {
|
|
552
|
+
toolCallId: string;
|
|
553
|
+
toolName: string;
|
|
554
|
+
args: Record<string, JsonValue>;
|
|
555
|
+
};
|
|
556
|
+
result: {
|
|
557
|
+
args?: Record<string, JsonValue>;
|
|
558
|
+
block?: {
|
|
559
|
+
reason: string;
|
|
560
|
+
terminate?: boolean;
|
|
561
|
+
};
|
|
562
|
+
} | undefined;
|
|
563
|
+
};
|
|
564
|
+
after_tool: {
|
|
565
|
+
event: {
|
|
566
|
+
toolCallId: string;
|
|
567
|
+
toolName: string;
|
|
568
|
+
args: Record<string, JsonValue>;
|
|
569
|
+
content: AgentToolResult<unknown>["content"];
|
|
570
|
+
details?: JsonValue;
|
|
571
|
+
isError: boolean;
|
|
572
|
+
usage?: Usage;
|
|
573
|
+
};
|
|
574
|
+
result: {
|
|
575
|
+
content?: AgentToolResult<unknown>["content"];
|
|
576
|
+
details?: JsonValue;
|
|
577
|
+
isError?: boolean;
|
|
578
|
+
usage?: Usage;
|
|
579
|
+
terminate?: boolean;
|
|
580
|
+
} | undefined;
|
|
581
|
+
};
|
|
582
|
+
before_compaction: {
|
|
583
|
+
event: {
|
|
584
|
+
reason: "manual" | "threshold" | "overflow";
|
|
585
|
+
preparation: CompactionPreparation;
|
|
586
|
+
customInstructions?: string;
|
|
587
|
+
};
|
|
588
|
+
result: {
|
|
589
|
+
decline?: boolean;
|
|
590
|
+
compaction?: CompactResult;
|
|
591
|
+
} | undefined;
|
|
592
|
+
};
|
|
593
|
+
before_navigation: {
|
|
594
|
+
event: {
|
|
595
|
+
targetId: string;
|
|
596
|
+
preparation: BranchPreparation;
|
|
597
|
+
customInstructions?: string;
|
|
598
|
+
};
|
|
599
|
+
result: {
|
|
600
|
+
decline?: boolean;
|
|
601
|
+
summary?: BranchSummaryResult;
|
|
602
|
+
} | undefined;
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
export type HookName = keyof HookMap;
|
|
606
|
+
export type HookInvocation<TName extends HookName> = HookMap[TName]["event"] & {
|
|
607
|
+
lane: string;
|
|
608
|
+
runId: string;
|
|
302
609
|
};
|
|
303
|
-
export type HookName =
|
|
610
|
+
export type HookHandler<TName extends HookName> = (event: HookInvocation<TName>, context: Context) => Promise<HookMap[TName]["result"]> | HookMap[TName]["result"];
|
|
304
611
|
export interface Hooks {
|
|
305
|
-
on(name:
|
|
612
|
+
on<TName extends HookName>(name: TName, handler: HookHandler<TName>, options?: {
|
|
306
613
|
id?: string;
|
|
307
614
|
}): () => void;
|
|
308
615
|
}
|
|
309
|
-
export
|
|
310
|
-
|
|
311
|
-
}
|
|
312
|
-
export type HarnessTool = AgentTool & {
|
|
313
|
-
replay?: "never" | "safe";
|
|
314
|
-
};
|
|
315
|
-
export type Resources = AgentHarnessResources<Skill, PromptTemplate>;
|
|
316
|
-
export type StreamOptions = SimpleStreamOptions;
|
|
317
|
-
export type StreamOptionsPatch = Partial<SimpleStreamOptions>;
|
|
318
|
-
export type EntryProjector = (entry: Entry) => AgentMessage[] | Promise<AgentMessage[]>;
|
|
319
|
-
export interface AgentHarnessOptions {
|
|
616
|
+
export type { EntryProjector } from "./session/types.ts";
|
|
617
|
+
export interface AgentHarnessOptions<TContext extends object | undefined = object | undefined> {
|
|
320
618
|
session: Session;
|
|
321
619
|
models: Models;
|
|
322
620
|
model: Model<Api>;
|
|
323
621
|
thinkingLevel?: ThinkingLevel;
|
|
324
622
|
activeToolNames?: string[];
|
|
325
|
-
tools?:
|
|
326
|
-
toolContext?:
|
|
327
|
-
systemPrompt?: string | (() => string | Promise<string>);
|
|
623
|
+
tools?: AgentHarnessTool<TContext>[];
|
|
624
|
+
toolContext?: TContext | ((context: Context) => TContext | Promise<TContext>);
|
|
625
|
+
systemPrompt?: string | ((toolContext: TContext, context: Context) => string | Promise<string>);
|
|
328
626
|
resources?: Resources;
|
|
329
|
-
streamOptions?:
|
|
627
|
+
streamOptions?: AgentHarnessStreamOptions;
|
|
330
628
|
retry?: RetryPolicy;
|
|
331
629
|
compaction?: CompactionSettings;
|
|
332
630
|
steeringMode?: QueueMode;
|
|
333
631
|
followUpMode?: QueueMode;
|
|
334
632
|
toolExecution?: "sequential" | "parallel";
|
|
335
|
-
|
|
336
|
-
toProviderMessages?: (messages: AgentMessage[]) => Message[] | Promise<Message[]>;
|
|
633
|
+
toProviderMessages?: (messages: AgentMessage[], context: Context) => Message[] | Promise<Message[]>;
|
|
337
634
|
entryProjectors?: Record<string, EntryProjector>;
|
|
338
|
-
context?: TelemetryContext;
|
|
339
|
-
}
|
|
340
|
-
export interface WatchHandle<TSnapshot> {
|
|
341
|
-
snapshot: TSnapshot;
|
|
342
|
-
start(listener: (event: unknown) => void): void;
|
|
343
|
-
unsubscribe(): void;
|
|
344
635
|
}
|
|
345
636
|
export interface AgentLane {
|
|
346
637
|
readonly name: string;
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
638
|
+
getTipId(context: Context): Promise<string | null>;
|
|
639
|
+
findEntries(query: BranchScan | undefined, context: Context): Promise<Entry[]>;
|
|
640
|
+
findEntry(query: BranchScan | undefined, context: Context): Promise<Entry | undefined>;
|
|
641
|
+
appendMessage(message: AgentMessage, context: Context): Promise<string>;
|
|
642
|
+
appendCustomEntry(customType: string, data: JsonValue | undefined, context: Context): Promise<string>;
|
|
643
|
+
getResult(operationId: string, context: Context): Promise<OperationResultRecord | undefined>;
|
|
644
|
+
accept(request: OperationRequest, context: Context): Promise<OperationAdmissionResult>;
|
|
645
|
+
drive(options: DriveOptions, context: Context): Promise<DriveResult>;
|
|
646
|
+
requestAbort(operationId: string, context: Context): Promise<AbortRequestResult>;
|
|
647
|
+
inspectExecution(context: Context): Promise<LaneExecutionInfo>;
|
|
648
|
+
prompt(text: string, images: ImageContent[] | undefined, context: Context): Promise<RunResult>;
|
|
649
|
+
prompt(message: AgentMessage | AgentMessage[], context: Context): Promise<RunResult>;
|
|
650
|
+
skill(name: string, additionalInstructions: string | undefined, context: Context): Promise<RunResult>;
|
|
651
|
+
promptFromTemplate(name: string, args: string[] | undefined, context: Context): Promise<RunResult>;
|
|
652
|
+
compact(options: {
|
|
353
653
|
customInstructions?: string;
|
|
354
|
-
}): Promise<CompactionResult>;
|
|
355
|
-
navigateTree(targetId: string | null, options
|
|
356
|
-
resume(): Promise<ResumeResult>;
|
|
357
|
-
abort(): Promise<AbortResult>;
|
|
358
|
-
steer(
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
nextRun(message: AgentMessage): Promise<QueueResult>;
|
|
364
|
-
cancelQueued(entryId: string): Promise<CancelQueuedResult>;
|
|
365
|
-
recordUsage(usage: Usage, options?: {
|
|
654
|
+
} | undefined, context: Context): Promise<CompactionResult>;
|
|
655
|
+
navigateTree(targetId: string | null, options: NavigateOptions | undefined, context: Context): Promise<NavigationResult>;
|
|
656
|
+
resume(context: Context): Promise<ResumeResult>;
|
|
657
|
+
abort(context: Context): Promise<AbortResult>;
|
|
658
|
+
steer(message: string | AgentMessage, images: ImageContent[] | undefined, context: Context): Promise<QueueResult>;
|
|
659
|
+
followUp(message: string | AgentMessage, images: ImageContent[] | undefined, context: Context): Promise<QueueResult>;
|
|
660
|
+
nextRun(message: string | AgentMessage, images: ImageContent[] | undefined, context: Context): Promise<QueueResult>;
|
|
661
|
+
cancelQueued(entryId: string, context: Context): Promise<CancelQueuedResult>;
|
|
662
|
+
recordUsage(usage: Usage, options: {
|
|
366
663
|
entryId?: string;
|
|
367
664
|
details?: JsonValue;
|
|
368
|
-
}): Promise<RecordUsageResult>;
|
|
369
|
-
waitForIdle(): Promise<void>;
|
|
370
|
-
runWhenIdle(callback: () => void | Promise<void
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
getActiveTools(): Promise<string[]>;
|
|
379
|
-
setActiveTools(names: string[]): Promise<void>;
|
|
380
|
-
readonly session: SessionTree;
|
|
381
|
-
watch(): Promise<WatchHandle<LaneSnapshot>>;
|
|
665
|
+
} | undefined, context: Context): Promise<RecordUsageResult>;
|
|
666
|
+
waitForIdle(context: Context): Promise<void>;
|
|
667
|
+
runWhenIdle(callback: (context: Context) => void | Promise<void>, context: Context): Promise<void>;
|
|
668
|
+
getModel(context: Context): Promise<Model<Api> | undefined>;
|
|
669
|
+
setModel(model: ModelIdentity, context: Context): Promise<void>;
|
|
670
|
+
getThinkingLevel(context: Context): Promise<ThinkingLevel>;
|
|
671
|
+
setThinkingLevel(level: ThinkingLevel, context: Context): Promise<void>;
|
|
672
|
+
getActiveTools(context: Context): Promise<string[]>;
|
|
673
|
+
setActiveTools(names: string[], context: Context): Promise<void>;
|
|
674
|
+
watch(context: Context): Promise<WatchHandle<LaneSnapshot>>;
|
|
382
675
|
}
|
|
383
|
-
export
|
|
384
|
-
|
|
385
|
-
|
|
676
|
+
export interface AcquireLaneOptions {
|
|
677
|
+
createAt?: string | null;
|
|
678
|
+
}
|
|
679
|
+
export interface AgentHarness<TContext extends object | undefined = object | undefined> {
|
|
680
|
+
lane(name: string, context: Context): Promise<AgentLane>;
|
|
681
|
+
lane(name: string, options: AcquireLaneOptions, context: Context): Promise<AgentLane>;
|
|
682
|
+
lanes(context: Context): Promise<LaneInfo[]>;
|
|
683
|
+
getName(context: Context): Promise<string | undefined>;
|
|
684
|
+
setName(name: string | undefined, context: Context): Promise<void>;
|
|
685
|
+
getLabel(targetId: string, context: Context): Promise<string | undefined>;
|
|
686
|
+
setLabel(targetId: string, label: string | undefined, context: Context): Promise<void>;
|
|
687
|
+
getTools(context: Context): Promise<AgentHarnessTool<TContext>[]>;
|
|
688
|
+
setTools(tools: AgentHarnessTool<TContext>[], context: Context): Promise<void>;
|
|
689
|
+
getResources(context: Context): Promise<Resources>;
|
|
690
|
+
setResources(resources: Resources, context: Context): Promise<void>;
|
|
691
|
+
getStreamOptions(context: Context): Promise<AgentHarnessStreamOptions>;
|
|
692
|
+
setStreamOptions(options: AgentHarnessStreamOptions, context: Context): Promise<void>;
|
|
693
|
+
getRetryPolicy(context: Context): Promise<RetryPolicy>;
|
|
694
|
+
setRetryPolicy(policy: RetryPolicy, context: Context): Promise<void>;
|
|
695
|
+
getCompactionSettings(context: Context): Promise<CompactionSettings>;
|
|
696
|
+
setCompactionSettings(settings: CompactionSettings, context: Context): Promise<void>;
|
|
697
|
+
getSteeringMode(context: Context): Promise<QueueMode>;
|
|
698
|
+
setSteeringMode(mode: QueueMode, context: Context): Promise<void>;
|
|
699
|
+
getFollowUpMode(context: Context): Promise<QueueMode>;
|
|
700
|
+
setFollowUpMode(mode: QueueMode, context: Context): Promise<void>;
|
|
701
|
+
watchSession(context: Context): Promise<WatchHandle<SessionSnapshot>>;
|
|
386
702
|
readonly hooks: Hooks;
|
|
387
703
|
readonly events: Events;
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
private streamOptions;
|
|
395
|
-
private retryPolicy;
|
|
396
|
-
private compactionSettings;
|
|
397
|
-
private steeringMode;
|
|
398
|
-
private followUpMode;
|
|
399
|
-
private closed;
|
|
400
|
-
private constructor();
|
|
401
|
-
static create(options: AgentHarnessOptions): Promise<{
|
|
402
|
-
harness: AgentHarness;
|
|
403
|
-
suspended: SuspendedOperation[];
|
|
704
|
+
close(context: Context): Promise<void>;
|
|
705
|
+
}
|
|
706
|
+
export interface AgentHarnessConstructor {
|
|
707
|
+
create<TContext extends object | undefined = object | undefined>(options: AgentHarnessOptions<TContext>, context: Context): Promise<{
|
|
708
|
+
harness: AgentHarness<TContext>;
|
|
709
|
+
open: OpenOperation[];
|
|
404
710
|
}>;
|
|
405
|
-
private unavailable;
|
|
406
|
-
getLeafId(): Promise<string | null>;
|
|
407
|
-
prompt(_text: string, _images?: ImageContent[]): Promise<RunResult>;
|
|
408
|
-
prompt(_message: AgentMessage | AgentMessage[]): Promise<RunResult>;
|
|
409
|
-
skill(_name: string, _additionalInstructions?: string): Promise<RunResult>;
|
|
410
|
-
promptFromTemplate(_name: string, _args?: string[]): Promise<RunResult>;
|
|
411
|
-
compact(_options?: {
|
|
412
|
-
customInstructions?: string;
|
|
413
|
-
}): Promise<CompactionResult>;
|
|
414
|
-
navigateTree(_targetId: string | null, _options?: NavigateOptions): Promise<NavigationResult>;
|
|
415
|
-
resume(): Promise<ResumeResult>;
|
|
416
|
-
abort(): Promise<AbortResult>;
|
|
417
|
-
steer(_text: string, _images?: ImageContent[]): Promise<QueueResult>;
|
|
418
|
-
steer(_message: AgentMessage): Promise<QueueResult>;
|
|
419
|
-
followUp(_text: string, _images?: ImageContent[]): Promise<QueueResult>;
|
|
420
|
-
followUp(_message: AgentMessage): Promise<QueueResult>;
|
|
421
|
-
nextRun(_text: string, _images?: ImageContent[]): Promise<QueueResult>;
|
|
422
|
-
nextRun(_message: AgentMessage): Promise<QueueResult>;
|
|
423
|
-
cancelQueued(_entryId: string): Promise<CancelQueuedResult>;
|
|
424
|
-
recordUsage(_usage: Usage, _options?: {
|
|
425
|
-
entryId?: string;
|
|
426
|
-
details?: JsonValue;
|
|
427
|
-
}): Promise<RecordUsageResult>;
|
|
428
|
-
waitForIdle(): Promise<void>;
|
|
429
|
-
runWhenIdle(_callback: () => void | Promise<void>): Promise<void>;
|
|
430
|
-
peekAction(): Promise<ActionInfo | undefined>;
|
|
431
|
-
executeAction(): Promise<ActionInfo | undefined>;
|
|
432
|
-
runToCompletion(): Promise<void>;
|
|
433
|
-
getModel(): Promise<Model<Api>>;
|
|
434
|
-
setModel(model: Model<Api>): Promise<void>;
|
|
435
|
-
getThinkingLevel(): Promise<ThinkingLevel>;
|
|
436
|
-
setThinkingLevel(level: ThinkingLevel): Promise<void>;
|
|
437
|
-
getActiveTools(): Promise<string[]>;
|
|
438
|
-
setActiveTools(names: string[]): Promise<void>;
|
|
439
|
-
watch(): Promise<WatchHandle<LaneSnapshot>>;
|
|
440
|
-
lane(_name: string): Promise<AgentLane | undefined>;
|
|
441
|
-
createLane(_name: string, _at: string | null): Promise<CreateLaneResult>;
|
|
442
|
-
lanes(): Promise<LaneInfo[]>;
|
|
443
|
-
getTools(): Promise<HarnessTool[]>;
|
|
444
|
-
setTools(tools: HarnessTool[], activeNames?: string[]): Promise<void>;
|
|
445
|
-
getResources(): Promise<Resources>;
|
|
446
|
-
setResources(resources: Resources): Promise<void>;
|
|
447
|
-
getStreamOptions(): Promise<StreamOptions>;
|
|
448
|
-
setStreamOptions(options: StreamOptions): Promise<void>;
|
|
449
|
-
getRetryPolicy(): Promise<RetryPolicy>;
|
|
450
|
-
setRetryPolicy(policy: RetryPolicy): Promise<void>;
|
|
451
|
-
getCompactionSettings(): Promise<CompactionSettings>;
|
|
452
|
-
setCompactionSettings(settings: CompactionSettings): Promise<void>;
|
|
453
|
-
getSteeringMode(): Promise<QueueMode>;
|
|
454
|
-
setSteeringMode(mode: QueueMode): Promise<void>;
|
|
455
|
-
getFollowUpMode(): Promise<QueueMode>;
|
|
456
|
-
setFollowUpMode(mode: QueueMode): Promise<void>;
|
|
457
|
-
watchSession(): Promise<WatchHandle<SessionSnapshot>>;
|
|
458
|
-
close(): Promise<void>;
|
|
459
711
|
}
|
|
460
|
-
|
|
712
|
+
/** Runtime constructor for attaching the durable harness to one open session. */
|
|
713
|
+
export declare const AgentHarness: {
|
|
714
|
+
create: typeof createAgentHarness;
|
|
715
|
+
};
|
|
461
716
|
//# sourceMappingURL=agent-harness.d.ts.map
|