@poncho-ai/harness 0.43.1 → 0.45.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/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +118 -0
- package/dist/index.d.ts +140 -47
- package/dist/index.js +575 -103
- package/package.json +2 -2
- package/src/config.ts +20 -1
- package/src/harness.ts +115 -6
- package/src/index.ts +1 -1
- package/src/orchestrator/orchestrator.ts +46 -0
- package/src/orchestrator/run-conversation-turn.ts +48 -2
- package/src/orchestrator/turn.ts +3 -0
- package/src/state.ts +9 -0
- package/src/storage/schema.ts +19 -0
- package/src/storage/sql-dialect.ts +5 -2
- package/src/subagent-manager.ts +20 -0
- package/src/subagent-tools.ts +62 -0
- package/src/upload-store.ts +27 -0
- package/src/vfs/bash-manager.ts +6 -3
- package/src/vfs/poncho-fs-adapter.ts +333 -51
- package/test/upload-store-decode.test.ts +43 -0
- package/test/vfs.test.ts +111 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @poncho-ai/harness@0.
|
|
2
|
+
> @poncho-ai/harness@0.45.0 build /home/runner/work/poncho-ai/poncho-ai/packages/harness
|
|
3
3
|
> node scripts/embed-docs.js && tsup src/index.ts --format esm --dts
|
|
4
4
|
|
|
5
5
|
[embed-docs] Generated poncho-docs.ts with 4 topics
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
[34mCLI[39m tsup v8.5.1
|
|
9
9
|
[34mCLI[39m Target: es2022
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
-
[32mESM[39m [1mdist/index.js [22m[32m506.50 KB[39m
|
|
12
11
|
[32mESM[39m [1mdist/isolate-VY35DGLM.js [22m[32m49.43 KB[39m
|
|
13
|
-
[32mESM[39m
|
|
12
|
+
[32mESM[39m [1mdist/index.js [22m[32m524.35 KB[39m
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 230ms
|
|
14
14
|
[34mDTS[39m Build start
|
|
15
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
15
|
+
[32mDTS[39m ⚡️ Build success in 7575ms
|
|
16
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m85.07 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,123 @@
|
|
|
1
1
|
# @poncho-ai/harness
|
|
2
2
|
|
|
3
|
+
## 0.45.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`1adaae2`](https://github.com/cesr/poncho-ai/commit/1adaae2d4cc55800f01d602f2a7d6ecc65031443) Thanks [@cesr](https://github.com/cesr)! - harness: device-dispatch mode for tools that execute on a connected client
|
|
8
|
+
|
|
9
|
+
Tools can now be marked `dispatch: "device"` on `loadedConfig.tools`. When
|
|
10
|
+
the model calls such a tool the dispatcher pauses the run, emits a new
|
|
11
|
+
`tool:device:required` event, and checkpoints with the new
|
|
12
|
+
`kind: "device"` discriminator on `pendingApprovals` — same plumbing as
|
|
13
|
+
the approval flow, different trigger and different resume payload.
|
|
14
|
+
Consumers (e.g. PonchOS for iOS device tools) drive the external
|
|
15
|
+
execution and feed the result back via `continueFromToolResult`.
|
|
16
|
+
|
|
17
|
+
Approval can be combined: `{access: "approval", dispatch: "device"}`
|
|
18
|
+
yields the approval card first, then on resume falls through to the
|
|
19
|
+
device-required event. The wire vocabulary for approvals
|
|
20
|
+
(`approvalId` etc.) is unchanged; the `pendingApprovals` column /
|
|
21
|
+
field name stays.
|
|
22
|
+
|
|
23
|
+
`ToolAccess` is broadened to accept both the legacy string `"approval"`
|
|
24
|
+
and the new `{access?, dispatch?}` object form. Existing configs keep
|
|
25
|
+
working unchanged.
|
|
26
|
+
|
|
27
|
+
- [`6132601`](https://github.com/cesr/poncho-ai/commit/613260159cdd80fcc02d68aa58ad52d4465bcede) Thanks [@cesr](https://github.com/cesr)! - harness: add `read_subagent` tool for fetching subagent transcripts
|
|
28
|
+
|
|
29
|
+
Parent agents can now read a spawned subagent's conversation directly
|
|
30
|
+
instead of using `message_subagent` to ask it to repeat its work. The
|
|
31
|
+
new tool accepts a `mode` parameter — `"final"` (last assistant message,
|
|
32
|
+
default), `"assistant"` (assistant messages only), or `"full"` (every
|
|
33
|
+
message including tool calls and results) — plus optional `since_index`
|
|
34
|
+
and `max_messages` for paging long transcripts.
|
|
35
|
+
|
|
36
|
+
Access is restricted to direct children: a parent can only read
|
|
37
|
+
transcripts of subagents whose `parentConversationId` matches its own
|
|
38
|
+
conversation. The `SubagentManager` interface gains a corresponding
|
|
39
|
+
`getTranscript` method.
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- Updated dependencies [[`1adaae2`](https://github.com/cesr/poncho-ai/commit/1adaae2d4cc55800f01d602f2a7d6ecc65031443)]:
|
|
44
|
+
- @poncho-ai/sdk@1.11.0
|
|
45
|
+
|
|
46
|
+
## 0.44.0
|
|
47
|
+
|
|
48
|
+
### Minor Changes
|
|
49
|
+
|
|
50
|
+
- [`e6f5c14`](https://github.com/cesr/poncho-ai/commit/e6f5c142a368389b3eb62e80731612048d9198b5) Thanks [@cesr](https://github.com/cesr)! - VFS adapter now supports read-only virtual mounts. `HarnessOptions.virtualMounts` accepts entries like `{ prefix: "/system/", source: "/path/on/disk" }`; reads under the prefix are served from the local filesystem source directory, writes are rejected with `EROFS`. Used by platforms (e.g. PonchOS) to expose deployment-shipped defaults without persisting them in each tenant's VFS — improvements ship via normal deploys and tenant data stays portable. Empty by default; CLI/dev workflows are unaffected.
|
|
51
|
+
|
|
52
|
+
### Patch Changes
|
|
53
|
+
|
|
54
|
+
- [`b171c0e`](https://github.com/cesr/poncho-ai/commit/b171c0e9c4cdc149e8282611f7333519b5e04e38) Thanks [@cesr](https://github.com/cesr)! - harness: properly decode `FileInput.data` per its documented contract
|
|
55
|
+
|
|
56
|
+
`FileInput.data` is documented in `@poncho-ai/sdk` as accepting raw
|
|
57
|
+
base64, `data:<mime>;base64,<…>` URIs, or `https?://` URLs. The
|
|
58
|
+
runtime used to call `Buffer.from(data, "base64")` unconditionally,
|
|
59
|
+
which silently produced garbage bytes for data URIs (Node's base64
|
|
60
|
+
decoder ignores invalid chars like `:` `;` `,` rather than throwing,
|
|
61
|
+
so the file's magic bytes were destroyed). Anthropic responded with
|
|
62
|
+
"Could not process image" on every turn that attached an image as a
|
|
63
|
+
data URI — including PonchOS's `resolveAttachment`, which built data
|
|
64
|
+
URIs by following the documented format.
|
|
65
|
+
|
|
66
|
+
Introduce `decodeFileInputData(data)` in `upload-store.ts` that
|
|
67
|
+
detects the three formats and decodes accordingly, and call it from
|
|
68
|
+
`AgentHarness.run` and `runConversationTurn` instead of the inline
|
|
69
|
+
`Buffer.from(_, "base64")`. Pinned by a new test that exercises raw
|
|
70
|
+
base64, simple data URIs, and data URIs with mime parameters.
|
|
71
|
+
|
|
72
|
+
Callers that have been passing raw base64 all along see no behavior
|
|
73
|
+
change.
|
|
74
|
+
|
|
75
|
+
- [`4d322f7`](https://github.com/cesr/poncho-ai/commit/4d322f79900f449d1f7783f697eef0351cd45f0a) Thanks [@cesr](https://github.com/cesr)! - fix(harness): reminders.scheduledAt no longer rounds on Postgres
|
|
76
|
+
|
|
77
|
+
Two related Postgres-only bugs in reminder storage:
|
|
78
|
+
1. **Schema precision**: the `reminders.scheduled_at` column was declared
|
|
79
|
+
`REAL` so SQLite would get its 8-byte double. Postgres maps `REAL` to
|
|
80
|
+
`float4` (4 bytes, ~7 digit precision), which silently rounds
|
|
81
|
+
millisecond epoch values (13 digits). Every reminder write+read on
|
|
82
|
+
Postgres returned a different value than it stored — and recurring
|
|
83
|
+
reminders would fire at wrong times. New migration v7 alters the
|
|
84
|
+
column to `BIGINT` (Postgres only; SQLite's `REAL` is already
|
|
85
|
+
double-precision and stays).
|
|
86
|
+
2. **Wire-format coercion**: `rowToReminder` declared `scheduledAt: row.scheduled_at as number`
|
|
87
|
+
but didn't actually coerce. With BIGINT, postgres-js returns the
|
|
88
|
+
value as a string (deliberate, to avoid JS-side precision loss).
|
|
89
|
+
The `as` cast is type-only; the runtime value stayed a string,
|
|
90
|
+
making strict equality and arithmetic fail. Now coerces with
|
|
91
|
+
`Number(...)`, which is safe — ms epochs max at ~10^16 in year 2286,
|
|
92
|
+
well under `Number.MAX_SAFE_INTEGER` (2^53).
|
|
93
|
+
|
|
94
|
+
Same coercion applied to `occurrenceCount` for consistency.
|
|
95
|
+
|
|
96
|
+
Discovered while wiring `/me/reminders` in PonchOS — every PATCH-back
|
|
97
|
+
returned a different scheduledAt than was sent.
|
|
98
|
+
|
|
99
|
+
- [`1499eb4`](https://github.com/cesr/poncho-ai/commit/1499eb4f63cc480fb42ec4e5568e023b84e54b5a) Thanks [@cesr](https://github.com/cesr)! - harness: discover VFS skills written without running bash
|
|
100
|
+
|
|
101
|
+
Per-tenant VFS skill discovery was tied to the storage engine's
|
|
102
|
+
in-memory path cache, which was only ever populated by
|
|
103
|
+
`bash-manager.refreshPathCache` before a bash invocation. Chat-only
|
|
104
|
+
flows (PonchOS's iOS Files browser, the `write_file` tool, any agent
|
|
105
|
+
that never shells out) left the cache empty, the patched `writeFile`'s
|
|
106
|
+
incremental update was a silent no-op (it only mutates when the cache
|
|
107
|
+
is already initialized for that tenant), and the skill fingerprint
|
|
108
|
+
stuck at `""` for the lifetime of the harness instance — so any
|
|
109
|
+
SKILL.md authored after `getSkillsForTenant` first ran for a tenant
|
|
110
|
+
was invisible from that point forward.
|
|
111
|
+
|
|
112
|
+
Refresh the engine's path cache inside `getSkillsForTenant` before
|
|
113
|
+
computing the fingerprint. One extra SELECT-paths round-trip per
|
|
114
|
+
turn (skills are checked once per `buildSystemPrompt`); correctness
|
|
115
|
+
for the increasingly common no-bash deployments wins easily over the
|
|
116
|
+
saved query.
|
|
117
|
+
|
|
118
|
+
Surfaced by PonchOS (no bash, iOS Files + write_file is the only way
|
|
119
|
+
SKILL.md ends up in `/skills/`).
|
|
120
|
+
|
|
3
121
|
## 0.43.1
|
|
4
122
|
|
|
5
123
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { LanguageModel } from 'ai';
|
|
|
2
2
|
import * as _poncho_ai_sdk from '@poncho-ai/sdk';
|
|
3
3
|
import { Message, ToolContext, ToolDefinition, JsonSchema, RunResult, AgentFailure, RunInput, AgentEvent, FileInput } from '@poncho-ai/sdk';
|
|
4
4
|
export { ToolDefinition, defineTool } from '@poncho-ai/sdk';
|
|
5
|
-
import { z } from 'zod';
|
|
6
5
|
import { IFileSystem, BufferEncoding, FsStat, FileContent, MkdirOptions, RmOptions, CpOptions, Bash } from 'just-bash';
|
|
6
|
+
import { z } from 'zod';
|
|
7
7
|
|
|
8
8
|
interface AgentModelConfig {
|
|
9
9
|
provider: string;
|
|
@@ -167,6 +167,15 @@ interface Conversation {
|
|
|
167
167
|
input: Record<string, unknown>;
|
|
168
168
|
}>;
|
|
169
169
|
decision?: "approved" | "denied";
|
|
170
|
+
/**
|
|
171
|
+
* Checkpoint kind discriminator.
|
|
172
|
+
* - "approval" (default for legacy rows): user approve/deny gate.
|
|
173
|
+
* - "device": tool executes on a connected client device (e.g. iOS); the
|
|
174
|
+
* consumer of the harness POSTs a tool result back to resume.
|
|
175
|
+
* Treat `undefined` as "approval" for backward compatibility with rows
|
|
176
|
+
* persisted before this field existed.
|
|
177
|
+
*/
|
|
178
|
+
kind?: "approval" | "device";
|
|
170
179
|
}>;
|
|
171
180
|
runStatus?: "running" | "idle";
|
|
172
181
|
ownerId: string;
|
|
@@ -450,7 +459,20 @@ interface UploadsConfig {
|
|
|
450
459
|
region?: string;
|
|
451
460
|
endpoint?: string;
|
|
452
461
|
}
|
|
453
|
-
type ToolAccess = boolean | "approval"
|
|
462
|
+
type ToolAccess = boolean | "approval" | {
|
|
463
|
+
access?: "approval";
|
|
464
|
+
dispatch?: "device";
|
|
465
|
+
};
|
|
466
|
+
/**
|
|
467
|
+
* Normalize any ToolAccess value into a {access, dispatch} struct.
|
|
468
|
+
* `boolean` collapses to no special handling — the boolean only encodes
|
|
469
|
+
* enable/disable, not dispatch — callers gate behavior on `dispatch` and
|
|
470
|
+
* `access`.
|
|
471
|
+
*/
|
|
472
|
+
declare const normalizeToolAccess: (value: ToolAccess | undefined) => {
|
|
473
|
+
access?: "approval";
|
|
474
|
+
dispatch?: "device";
|
|
475
|
+
};
|
|
454
476
|
/** @deprecated Use flat tool keys on `tools` instead. Kept for backward compat. */
|
|
455
477
|
type BuiltInToolToggles = {
|
|
456
478
|
list_directory?: boolean;
|
|
@@ -738,6 +760,15 @@ interface UploadStore {
|
|
|
738
760
|
}
|
|
739
761
|
/** Derive a content-addressed key from file data. */
|
|
740
762
|
declare const deriveUploadKey: (data: Buffer, mediaType: string) => string;
|
|
763
|
+
/**
|
|
764
|
+
* Decode the `FileInput.data` field per its documented contract: it may be a
|
|
765
|
+
* raw base64 string, a `data:<mime>;base64,<…>` URI, or an `https?://` URL.
|
|
766
|
+
* Returns the decoded bytes. Older versions of the harness called
|
|
767
|
+
* `Buffer.from(data, "base64")` unconditionally; that silently produced
|
|
768
|
+
* garbage bytes for data URIs (the `:` / `;` / `,` in the prefix are not
|
|
769
|
+
* valid base64 chars but Node's decoder ignores them rather than throwing).
|
|
770
|
+
*/
|
|
771
|
+
declare const decodeFileInputData: (data: string) => Promise<Buffer>;
|
|
741
772
|
declare class LocalUploadStore implements UploadStore {
|
|
742
773
|
private readonly uploadsDir;
|
|
743
774
|
constructor(workingDir: string);
|
|
@@ -935,6 +966,78 @@ interface StorageEngine {
|
|
|
935
966
|
};
|
|
936
967
|
}
|
|
937
968
|
|
|
969
|
+
/**
|
|
970
|
+
* Read-only virtual mount mapping a VFS path prefix to a local filesystem
|
|
971
|
+
* directory. All read operations under the prefix resolve via local FS;
|
|
972
|
+
* writes throw. The prefix is normalised internally to end with "/".
|
|
973
|
+
*/
|
|
974
|
+
interface VirtualMount {
|
|
975
|
+
/** VFS prefix, e.g. "/system/". Leading slash required; trailing slash
|
|
976
|
+
* optional (normalised). Must be a single non-root segment in practice
|
|
977
|
+
* but no validation is enforced here. */
|
|
978
|
+
prefix: string;
|
|
979
|
+
/** Absolute local FS path to serve from, e.g. "/srv/poncho/system". */
|
|
980
|
+
source: string;
|
|
981
|
+
}
|
|
982
|
+
declare class PonchoFsAdapter implements IFileSystem {
|
|
983
|
+
private engine;
|
|
984
|
+
private tenantId;
|
|
985
|
+
private limits;
|
|
986
|
+
private mounts;
|
|
987
|
+
constructor(engine: StorageEngine, tenantId: string, limits: {
|
|
988
|
+
maxFileSize: number;
|
|
989
|
+
maxTotalStorage: number;
|
|
990
|
+
}, mounts?: VirtualMount[]);
|
|
991
|
+
/** Find which mount, if any, a normalised VFS path falls under.
|
|
992
|
+
* Returns the relative path within the mount's source dir (empty string
|
|
993
|
+
* when the path is exactly the mount root). */
|
|
994
|
+
private routeToMount;
|
|
995
|
+
/** Treat `np` as a directory and return mount-root segments that should be
|
|
996
|
+
* listed as virtual subdirectories. E.g. with mount "/system/", reading
|
|
997
|
+
* "/" returns ["system"]; reading "/system" goes via routeToMount and
|
|
998
|
+
* serves from local FS instead. */
|
|
999
|
+
private virtualChildrenAt;
|
|
1000
|
+
private toLocal;
|
|
1001
|
+
/** Build an FsStat from a node fs.Stats. */
|
|
1002
|
+
private toFsStat;
|
|
1003
|
+
/** Synthesise a directory stat for a virtual ancestor (e.g. "/system"
|
|
1004
|
+
* when "/system/jobs/" is mounted but "/system" itself isn't a real dir
|
|
1005
|
+
* on disk). Used so `ls /` and `stat /system` work without surprises. */
|
|
1006
|
+
private syntheticDirStat;
|
|
1007
|
+
readFile(path: string, _options?: {
|
|
1008
|
+
encoding?: BufferEncoding | null;
|
|
1009
|
+
} | BufferEncoding): Promise<string>;
|
|
1010
|
+
readFileBuffer(path: string): Promise<Uint8Array>;
|
|
1011
|
+
exists(path: string): Promise<boolean>;
|
|
1012
|
+
stat(path: string): Promise<FsStat>;
|
|
1013
|
+
readdir(path: string): Promise<string[]>;
|
|
1014
|
+
readdirWithFileTypes(path: string): Promise<Array<{
|
|
1015
|
+
name: string;
|
|
1016
|
+
isFile: boolean;
|
|
1017
|
+
isDirectory: boolean;
|
|
1018
|
+
isSymbolicLink: boolean;
|
|
1019
|
+
}>>;
|
|
1020
|
+
writeFile(path: string, content: FileContent, _options?: {
|
|
1021
|
+
encoding?: BufferEncoding;
|
|
1022
|
+
} | BufferEncoding): Promise<void>;
|
|
1023
|
+
appendFile(path: string, content: FileContent, _options?: {
|
|
1024
|
+
encoding?: BufferEncoding;
|
|
1025
|
+
} | BufferEncoding): Promise<void>;
|
|
1026
|
+
mkdir(path: string, options?: MkdirOptions): Promise<void>;
|
|
1027
|
+
rm(path: string, options?: RmOptions): Promise<void>;
|
|
1028
|
+
cp(src: string, dest: string, options?: CpOptions): Promise<void>;
|
|
1029
|
+
mv(src: string, dest: string): Promise<void>;
|
|
1030
|
+
resolvePath(base: string, path: string): string;
|
|
1031
|
+
realpath(path: string): Promise<string>;
|
|
1032
|
+
getAllPaths(): string[];
|
|
1033
|
+
chmod(path: string, mode: number): Promise<void>;
|
|
1034
|
+
utimes(path: string, _atime: Date, mtime: Date): Promise<void>;
|
|
1035
|
+
symlink(target: string, linkPath: string): Promise<void>;
|
|
1036
|
+
link(existingPath: string, newPath: string): Promise<void>;
|
|
1037
|
+
readlink(path: string): Promise<string>;
|
|
1038
|
+
lstat(path: string): Promise<FsStat>;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
938
1041
|
interface SecretsStore {
|
|
939
1042
|
get(tenantId: string): Promise<Record<string, string>>;
|
|
940
1043
|
set(tenantId: string, key: string, value: string): Promise<void>;
|
|
@@ -1020,6 +1123,16 @@ interface SubagentSummary {
|
|
|
1020
1123
|
interface SubagentSpawnResult {
|
|
1021
1124
|
subagentId: string;
|
|
1022
1125
|
}
|
|
1126
|
+
type SubagentTranscriptMode = "final" | "assistant" | "full";
|
|
1127
|
+
interface SubagentTranscript {
|
|
1128
|
+
subagentId: string;
|
|
1129
|
+
task: string;
|
|
1130
|
+
status: string;
|
|
1131
|
+
totalMessages: number;
|
|
1132
|
+
startIndex: number;
|
|
1133
|
+
messages: Message[];
|
|
1134
|
+
truncated: boolean;
|
|
1135
|
+
}
|
|
1023
1136
|
interface SubagentManager {
|
|
1024
1137
|
spawn(opts: {
|
|
1025
1138
|
task: string;
|
|
@@ -1030,6 +1143,13 @@ interface SubagentManager {
|
|
|
1030
1143
|
sendMessage(subagentId: string, message: string): Promise<SubagentSpawnResult>;
|
|
1031
1144
|
stop(subagentId: string): Promise<void>;
|
|
1032
1145
|
list(parentConversationId: string): Promise<SubagentSummary[]>;
|
|
1146
|
+
getTranscript(opts: {
|
|
1147
|
+
subagentId: string;
|
|
1148
|
+
parentConversationId: string;
|
|
1149
|
+
mode: SubagentTranscriptMode;
|
|
1150
|
+
sinceIndex?: number;
|
|
1151
|
+
maxMessages?: number;
|
|
1152
|
+
}): Promise<SubagentTranscript>;
|
|
1033
1153
|
}
|
|
1034
1154
|
|
|
1035
1155
|
interface ToolCall {
|
|
@@ -1082,6 +1202,15 @@ interface HarnessOptions {
|
|
|
1082
1202
|
* `resolveStateConfig`, etc.) run as today regardless of source.
|
|
1083
1203
|
*/
|
|
1084
1204
|
config?: PonchoConfig;
|
|
1205
|
+
/**
|
|
1206
|
+
* Read-only virtual mounts overlaid on the VFS. Each mount maps a VFS
|
|
1207
|
+
* prefix (e.g. "/system/") to a local filesystem directory; reads under
|
|
1208
|
+
* the prefix are served from local disk, writes are rejected. Used by
|
|
1209
|
+
* platforms like PonchOS to expose deployment-shipped defaults (system
|
|
1210
|
+
* jobs, system skills) without storing them in each tenant's VFS.
|
|
1211
|
+
* Empty by default — no system mounts in the CLI / dev workflow.
|
|
1212
|
+
*/
|
|
1213
|
+
virtualMounts?: VirtualMount[];
|
|
1085
1214
|
}
|
|
1086
1215
|
interface HarnessRunOutput {
|
|
1087
1216
|
runId: string;
|
|
@@ -1136,7 +1265,11 @@ declare class AgentHarness {
|
|
|
1136
1265
|
storageEngine?: StorageEngine;
|
|
1137
1266
|
/** Bash environment manager (creates per-tenant bash instances). */
|
|
1138
1267
|
private bashManager?;
|
|
1268
|
+
/** Read-only virtual mounts overlaid on the VFS. Empty by default. */
|
|
1269
|
+
private virtualMounts;
|
|
1139
1270
|
private resolveToolAccess;
|
|
1271
|
+
/** Returns the normalized {access, dispatch} mode for the tool. */
|
|
1272
|
+
private resolveToolMode;
|
|
1140
1273
|
private isToolEnabled;
|
|
1141
1274
|
private registerIfMissing;
|
|
1142
1275
|
/**
|
|
@@ -1602,48 +1735,6 @@ declare function createMemoryStoreFromEngine(engine: StorageEngine, tenantId?: s
|
|
|
1602
1735
|
declare function createTodoStoreFromEngine(engine: StorageEngine): TodoStore;
|
|
1603
1736
|
declare function createReminderStoreFromEngine(engine: StorageEngine): ReminderStore;
|
|
1604
1737
|
|
|
1605
|
-
declare class PonchoFsAdapter implements IFileSystem {
|
|
1606
|
-
private engine;
|
|
1607
|
-
private tenantId;
|
|
1608
|
-
private limits;
|
|
1609
|
-
constructor(engine: StorageEngine, tenantId: string, limits: {
|
|
1610
|
-
maxFileSize: number;
|
|
1611
|
-
maxTotalStorage: number;
|
|
1612
|
-
});
|
|
1613
|
-
readFile(path: string, _options?: {
|
|
1614
|
-
encoding?: BufferEncoding | null;
|
|
1615
|
-
} | BufferEncoding): Promise<string>;
|
|
1616
|
-
readFileBuffer(path: string): Promise<Uint8Array>;
|
|
1617
|
-
exists(path: string): Promise<boolean>;
|
|
1618
|
-
stat(path: string): Promise<FsStat>;
|
|
1619
|
-
readdir(path: string): Promise<string[]>;
|
|
1620
|
-
readdirWithFileTypes(path: string): Promise<Array<{
|
|
1621
|
-
name: string;
|
|
1622
|
-
isFile: boolean;
|
|
1623
|
-
isDirectory: boolean;
|
|
1624
|
-
isSymbolicLink: boolean;
|
|
1625
|
-
}>>;
|
|
1626
|
-
writeFile(path: string, content: FileContent, _options?: {
|
|
1627
|
-
encoding?: BufferEncoding;
|
|
1628
|
-
} | BufferEncoding): Promise<void>;
|
|
1629
|
-
appendFile(path: string, content: FileContent, _options?: {
|
|
1630
|
-
encoding?: BufferEncoding;
|
|
1631
|
-
} | BufferEncoding): Promise<void>;
|
|
1632
|
-
mkdir(path: string, options?: MkdirOptions): Promise<void>;
|
|
1633
|
-
rm(path: string, options?: RmOptions): Promise<void>;
|
|
1634
|
-
cp(src: string, dest: string, options?: CpOptions): Promise<void>;
|
|
1635
|
-
mv(src: string, dest: string): Promise<void>;
|
|
1636
|
-
resolvePath(base: string, path: string): string;
|
|
1637
|
-
realpath(path: string): Promise<string>;
|
|
1638
|
-
getAllPaths(): string[];
|
|
1639
|
-
chmod(path: string, mode: number): Promise<void>;
|
|
1640
|
-
utimes(path: string, _atime: Date, mtime: Date): Promise<void>;
|
|
1641
|
-
symlink(target: string, linkPath: string): Promise<void>;
|
|
1642
|
-
link(existingPath: string, newPath: string): Promise<void>;
|
|
1643
|
-
readlink(path: string): Promise<string>;
|
|
1644
|
-
lstat(path: string): Promise<FsStat>;
|
|
1645
|
-
}
|
|
1646
|
-
|
|
1647
1738
|
declare class BashEnvironmentManager {
|
|
1648
1739
|
private engine;
|
|
1649
1740
|
private limits;
|
|
@@ -1651,10 +1742,11 @@ declare class BashEnvironmentManager {
|
|
|
1651
1742
|
private filesystems;
|
|
1652
1743
|
private readonly workingDir;
|
|
1653
1744
|
private readonly bashOptions;
|
|
1745
|
+
private readonly virtualMounts;
|
|
1654
1746
|
constructor(engine: StorageEngine, limits: {
|
|
1655
1747
|
maxFileSize: number;
|
|
1656
1748
|
maxTotalStorage: number;
|
|
1657
|
-
}, workingDir: string | null, bashConfig?: BashConfig, network?: NetworkConfig);
|
|
1749
|
+
}, workingDir: string | null, bashConfig?: BashConfig, network?: NetworkConfig, virtualMounts?: VirtualMount[]);
|
|
1658
1750
|
/** Return the combined IFileSystem (VFS + optional /project mount) for a tenant. */
|
|
1659
1751
|
getFs(tenantId: string): IFileSystem;
|
|
1660
1752
|
getOrCreate(tenantId: string): Bash;
|
|
@@ -1769,12 +1861,13 @@ declare const executeConversationTurn: ({ harness, runInput, events, initialCont
|
|
|
1769
1861
|
onEvent?: (event: AgentEvent, draft: TurnDraftState) => void | Promise<void>;
|
|
1770
1862
|
}) => Promise<ExecuteTurnResult>;
|
|
1771
1863
|
declare const normalizeApprovalCheckpoint: (approval: StoredApproval, fallbackMessages: Message[]) => StoredApproval;
|
|
1772
|
-
declare const buildApprovalCheckpoints: ({ approvals, runId, checkpointMessages, baseMessageCount, pendingToolCalls, }: {
|
|
1864
|
+
declare const buildApprovalCheckpoints: ({ approvals, runId, checkpointMessages, baseMessageCount, pendingToolCalls, kind, }: {
|
|
1773
1865
|
approvals: ApprovalEventItem[];
|
|
1774
1866
|
runId: string;
|
|
1775
1867
|
checkpointMessages: Message[];
|
|
1776
1868
|
baseMessageCount: number;
|
|
1777
1869
|
pendingToolCalls: PendingToolCall[];
|
|
1870
|
+
kind?: "approval" | "device";
|
|
1778
1871
|
}) => NonNullable<Conversation["pendingApprovals"]>;
|
|
1779
1872
|
declare const applyTurnMetadata: (conv: Conversation, meta: TurnResultMetadata, opts?: {
|
|
1780
1873
|
clearContinuation?: boolean;
|
|
@@ -1962,4 +2055,4 @@ interface RunConversationTurnResult {
|
|
|
1962
2055
|
}
|
|
1963
2056
|
declare const runConversationTurn: (opts: RunConversationTurnOpts) => Promise<RunConversationTurnResult>;
|
|
1964
2057
|
|
|
1965
|
-
export { type ActiveConversationRun, type ActiveSubagentRun, type AgentFrontmatter, AgentHarness, type AgentIdentity, type AgentLimitsConfig, type AgentModelConfig, AgentOrchestrator, type ApprovalEventItem, type ArchivedToolResult$1 as ArchivedToolResult, type BashConfig, BashEnvironmentManager, type BashExecutionLimits, type BuiltInToolToggles, CALLBACK_LOCK_STALE_MS, type CompactMessagesOptions, type CompactResult, type CompactionConfig, type ContinuationHooks, type Conversation, type ConversationCreateInit, type ConversationState, type ConversationStatusSnapshot, type ConversationStore, type ConversationSummary, type CreateSkillToolsOptions, type CronJobConfig, DEFAULT_AGENT_DESCRIPTION, DEFAULT_AGENT_NAME, DEFAULT_MAX_STEPS, DEFAULT_MODEL_NAME, DEFAULT_MODEL_PROVIDER, DEFAULT_TEMPERATURE, DEFAULT_TIMEOUT, type DefaultAgentDefinitionOptions, type EventSink, type ExecuteTurnResult, type HarnessOptions, type HarnessRunOutput, type HistorySource, InMemoryConversationStore, InMemoryEngine, InMemoryStateStore, type IsolateBinding, type IsolateConfig, LocalMcpBridge, LocalUploadStore, MAX_CONCURRENT_SUBAGENTS, MAX_CONTINUATION_COUNT, MAX_SUBAGENT_CALLBACK_COUNT, MAX_SUBAGENT_NESTING, type MainMemory, type McpConfig, type MemoryConfig, type MemoryStore, type MessagingChannelConfig, type ModelProviderFactory, type NetworkConfig, OPENAI_CODEX_CLIENT_ID, type OpenAICodexAuthConfig, type OpenAICodexDeviceAuthRequest, type OpenAICodexSession, type OrchestratorHooks, type OrchestratorOptions, type OtlpConfig, type OtlpOption, PONCHO_UPLOAD_SCHEME, type ParsedAgent, type PendingSubagentApproval, type PendingSubagentResult, type PendingToolCall, type PonchoConfig, PonchoFsAdapter, PostgresEngine, type ProviderConfig, type Recurrence, type RecurrenceType, type Reminder, type ReminderCreateInput, type ReminderStatus, type ReminderStore, type RemoteMcpServerConfig, type RunConversationTurnOpts, type RunConversationTurnResult, type RunOutcome, type RunRequest, type RuntimeRenderContext, S3UploadStore, STALE_SUBAGENT_THRESHOLD_MS, STORAGE_SCHEMA_VERSION, type SecretsStore, type SkillContextEntry, type SkillMetadata, type SkillSource, SqliteEngine, type StateConfig, type StateProviderName, type StateStore, type StorageConfig, type StorageEngine, type StorageFactoryOptions, type StorageProvider, type StoredApproval, type SubagentManager, type SubagentResult, type SubagentSpawnResult, type SubagentSummary, TOOL_RESULT_ARCHIVE_PARAM, type TelemetryConfig, TelemetryEmitter, type TenantTokenPayload, type ToolAccess, type ToolCall, ToolDispatcher, type ToolExecutionResult, type TurnDraftState, type TurnResultMetadata, type TurnSection, type UploadStore, type UploadsConfig, VFS_SCHEME, VercelBlobUploadStore, type VfsDirEntry, type VfsStat, applyTurnMetadata, buildAgentDirectoryName, buildApprovalCheckpoints, buildAssistantMetadata, buildSkillContextWindow, buildToolCompletedText, cloneSections, compactMessages, completeOpenAICodexDeviceAuth, computeNextOccurrence, createBashTool, createConversationStore, createConversationStoreFromEngine, createDefaultTools, createDeleteDirectoryTool, createDeleteTool, createEditTool, createMemoryStore, createMemoryStoreFromEngine, createMemoryTools, createModelProvider, createReminderStore, createReminderStoreFromEngine, createReminderTools, createSearchTools, createSecretsStore, createSkillTools, createStateStore, createStorageEngine, createSubagentTools, createTodoStoreFromEngine, createTurnDraftState, createUploadStore, createWriteTool, defaultAgentDefinition, deleteOpenAICodexSession, deriveUploadKey, ensureAgentIdentity, estimateTokens, estimateTotalTokens, executeConversationTurn, findSafeSplitPoint, flushTurnDraft, generateAgentId, getAgentStoreDirectory, getModelContextWindow, getOpenAICodexAccessToken, getOpenAICodexAuthFilePath, getOpenAICodexRequiredScopes, getPonchoStoreRoot, isMessageArray, jsonSchemaToZod, loadCanonicalHistory, loadPonchoConfig, loadRunHistory, loadSkillContext, loadSkillInstructions, loadSkillMetadata, loadVfsSkillMetadata, mergeSkills, normalizeApprovalCheckpoint, normalizeOtlp, normalizeScriptPolicyPath, parseAgentFile, parseAgentMarkdown, parseSkillFrontmatter, ponchoDocsTool, readOpenAICodexSession, readSkillResource, recordStandardTurnEvent, renderAgentPrompt, resolveAgentIdentity, resolveCompactionConfig, resolveEnv, resolveMemoryConfig, resolveRunRequest, resolveSkillDirs, resolveStateConfig, runConversationTurn, slugifyStorageComponent, startOpenAICodexDeviceAuth, verifyTenantToken, withToolResultArchiveParam, writeOpenAICodexSession };
|
|
2058
|
+
export { type ActiveConversationRun, type ActiveSubagentRun, type AgentFrontmatter, AgentHarness, type AgentIdentity, type AgentLimitsConfig, type AgentModelConfig, AgentOrchestrator, type ApprovalEventItem, type ArchivedToolResult$1 as ArchivedToolResult, type BashConfig, BashEnvironmentManager, type BashExecutionLimits, type BuiltInToolToggles, CALLBACK_LOCK_STALE_MS, type CompactMessagesOptions, type CompactResult, type CompactionConfig, type ContinuationHooks, type Conversation, type ConversationCreateInit, type ConversationState, type ConversationStatusSnapshot, type ConversationStore, type ConversationSummary, type CreateSkillToolsOptions, type CronJobConfig, DEFAULT_AGENT_DESCRIPTION, DEFAULT_AGENT_NAME, DEFAULT_MAX_STEPS, DEFAULT_MODEL_NAME, DEFAULT_MODEL_PROVIDER, DEFAULT_TEMPERATURE, DEFAULT_TIMEOUT, type DefaultAgentDefinitionOptions, type EventSink, type ExecuteTurnResult, type HarnessOptions, type HarnessRunOutput, type HistorySource, InMemoryConversationStore, InMemoryEngine, InMemoryStateStore, type IsolateBinding, type IsolateConfig, LocalMcpBridge, LocalUploadStore, MAX_CONCURRENT_SUBAGENTS, MAX_CONTINUATION_COUNT, MAX_SUBAGENT_CALLBACK_COUNT, MAX_SUBAGENT_NESTING, type MainMemory, type McpConfig, type MemoryConfig, type MemoryStore, type MessagingChannelConfig, type ModelProviderFactory, type NetworkConfig, OPENAI_CODEX_CLIENT_ID, type OpenAICodexAuthConfig, type OpenAICodexDeviceAuthRequest, type OpenAICodexSession, type OrchestratorHooks, type OrchestratorOptions, type OtlpConfig, type OtlpOption, PONCHO_UPLOAD_SCHEME, type ParsedAgent, type PendingSubagentApproval, type PendingSubagentResult, type PendingToolCall, type PonchoConfig, PonchoFsAdapter, PostgresEngine, type ProviderConfig, type Recurrence, type RecurrenceType, type Reminder, type ReminderCreateInput, type ReminderStatus, type ReminderStore, type RemoteMcpServerConfig, type RunConversationTurnOpts, type RunConversationTurnResult, type RunOutcome, type RunRequest, type RuntimeRenderContext, S3UploadStore, STALE_SUBAGENT_THRESHOLD_MS, STORAGE_SCHEMA_VERSION, type SecretsStore, type SkillContextEntry, type SkillMetadata, type SkillSource, SqliteEngine, type StateConfig, type StateProviderName, type StateStore, type StorageConfig, type StorageEngine, type StorageFactoryOptions, type StorageProvider, type StoredApproval, type SubagentManager, type SubagentResult, type SubagentSpawnResult, type SubagentSummary, type SubagentTranscript, type SubagentTranscriptMode, TOOL_RESULT_ARCHIVE_PARAM, type TelemetryConfig, TelemetryEmitter, type TenantTokenPayload, type ToolAccess, type ToolCall, ToolDispatcher, type ToolExecutionResult, type TurnDraftState, type TurnResultMetadata, type TurnSection, type UploadStore, type UploadsConfig, VFS_SCHEME, VercelBlobUploadStore, type VfsDirEntry, type VfsStat, type VirtualMount, applyTurnMetadata, buildAgentDirectoryName, buildApprovalCheckpoints, buildAssistantMetadata, buildSkillContextWindow, buildToolCompletedText, cloneSections, compactMessages, completeOpenAICodexDeviceAuth, computeNextOccurrence, createBashTool, createConversationStore, createConversationStoreFromEngine, createDefaultTools, createDeleteDirectoryTool, createDeleteTool, createEditTool, createMemoryStore, createMemoryStoreFromEngine, createMemoryTools, createModelProvider, createReminderStore, createReminderStoreFromEngine, createReminderTools, createSearchTools, createSecretsStore, createSkillTools, createStateStore, createStorageEngine, createSubagentTools, createTodoStoreFromEngine, createTurnDraftState, createUploadStore, createWriteTool, decodeFileInputData, defaultAgentDefinition, deleteOpenAICodexSession, deriveUploadKey, ensureAgentIdentity, estimateTokens, estimateTotalTokens, executeConversationTurn, findSafeSplitPoint, flushTurnDraft, generateAgentId, getAgentStoreDirectory, getModelContextWindow, getOpenAICodexAccessToken, getOpenAICodexAuthFilePath, getOpenAICodexRequiredScopes, getPonchoStoreRoot, isMessageArray, jsonSchemaToZod, loadCanonicalHistory, loadPonchoConfig, loadRunHistory, loadSkillContext, loadSkillInstructions, loadSkillMetadata, loadVfsSkillMetadata, mergeSkills, normalizeApprovalCheckpoint, normalizeOtlp, normalizeScriptPolicyPath, normalizeToolAccess, parseAgentFile, parseAgentMarkdown, parseSkillFrontmatter, ponchoDocsTool, readOpenAICodexSession, readSkillResource, recordStandardTurnEvent, renderAgentPrompt, resolveAgentIdentity, resolveCompactionConfig, resolveEnv, resolveMemoryConfig, resolveRunRequest, resolveSkillDirs, resolveStateConfig, runConversationTurn, slugifyStorageComponent, startOpenAICodexDeviceAuth, verifyTenantToken, withToolResultArchiveParam, writeOpenAICodexSession };
|