@poncho-ai/harness 0.14.0 → 0.14.2
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/.turbo/turbo-lint.log +6 -0
- package/.turbo/turbo-test.log +137 -0
- package/CHANGELOG.md +26 -0
- package/dist/index.d.ts +79 -49
- package/dist/index.js +199 -113
- package/package.json +2 -2
- package/src/config.ts +13 -8
- package/src/harness.ts +195 -115
- package/src/latitude-capture.ts +9 -10
- package/src/memory.ts +8 -13
- package/src/model-factory.ts +13 -6
- package/src/state.ts +18 -12
- package/src/telemetry.ts +2 -2
- package/test/telemetry.test.ts +3 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @poncho-ai/harness@0.14.
|
|
2
|
+
> @poncho-ai/harness@0.14.2 build /Users/cesar/Dev/latitude/poncho-ai/packages/harness
|
|
3
3
|
> tsup src/index.ts --format esm --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
[34mCLI[39m tsup v8.5.1
|
|
8
8
|
[34mCLI[39m Target: es2022
|
|
9
9
|
[34mESM[39m Build start
|
|
10
|
-
[32mESM[39m [1mdist/index.js [22m[
|
|
11
|
-
[32mESM[39m ⚡️ Build success in
|
|
10
|
+
[32mESM[39m [1mdist/index.js [22m[32m177.01 KB[39m
|
|
11
|
+
[32mESM[39m ⚡️ Build success in 73ms
|
|
12
12
|
[34mDTS[39m Build start
|
|
13
|
-
[32mDTS[39m ⚡️ Build success in
|
|
14
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
13
|
+
[32mDTS[39m ⚡️ Build success in 3459ms
|
|
14
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m21.71 KB[39m
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
|
|
2
|
+
> @poncho-ai/harness@0.14.0 test /Users/cesar/Dev/latitude/poncho-ai/packages/harness
|
|
3
|
+
> vitest
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
[7m[1m[36m RUN [39m[22m[27m [36mv1.6.1[39m [90m/Users/cesar/Dev/latitude/poncho-ai/packages/harness[39m
|
|
7
|
+
|
|
8
|
+
[event] step:completed {"type":"step:completed","step":1,"duration":1}
|
|
9
|
+
[event] step:started {"type":"step:started","step":2}
|
|
10
|
+
[32m✓[39m test/telemetry.test.ts [2m ([22m[2m3 tests[22m[2m)[22m[90m 11[2mms[22m[39m
|
|
11
|
+
[32m✓[39m test/schema-converter.test.ts [2m ([22m[2m27 tests[22m[2m)[22m[90m 21[2mms[22m[39m
|
|
12
|
+
[90mstdout[2m | test/mcp.test.ts[2m > [22m[2mmcp bridge protocol transports[2m > [22m[2mdiscovers and calls tools over streamable HTTP[22m[39m
|
|
13
|
+
[poncho][mcp] {"event":"catalog.loaded","server":"remote","discoveredCount":1}
|
|
14
|
+
[poncho][mcp] {"event":"tools.selected","requestedPatternCount":1,"registeredCount":1,"filteredByPolicyCount":0,"filteredByIntentCount":0}
|
|
15
|
+
|
|
16
|
+
[90mstdout[2m | test/mcp.test.ts[2m > [22m[2mmcp bridge protocol transports[2m > [22m[2mselects discovered tools by requested patterns[22m[39m
|
|
17
|
+
[poncho][mcp] {"event":"catalog.loaded","server":"remote","discoveredCount":2}
|
|
18
|
+
[poncho][mcp] {"event":"tools.selected","requestedPatternCount":1,"registeredCount":1,"filteredByPolicyCount":0,"filteredByIntentCount":1}
|
|
19
|
+
[poncho][mcp] {"event":"tools.selected","requestedPatternCount":1,"registeredCount":2,"filteredByPolicyCount":0,"filteredByIntentCount":0}
|
|
20
|
+
|
|
21
|
+
[90mstdout[2m | test/mcp.test.ts[2m > [22m[2mmcp bridge protocol transports[2m > [22m[2mskips discovery when bearer token env value is missing[22m[39m
|
|
22
|
+
[poncho][mcp] {"event":"tools.selected","requestedPatternCount":1,"registeredCount":0,"filteredByPolicyCount":0,"filteredByIntentCount":0}
|
|
23
|
+
|
|
24
|
+
[90mstderr[2m | test/mcp.test.ts[2m > [22m[2mmcp bridge protocol transports[2m > [22m[2mskips discovery when bearer token env value is missing[22m[39m
|
|
25
|
+
[poncho][mcp] {"event":"auth.token_missing","server":"remote","tokenEnv":"MISSING_TOKEN_ENV"}
|
|
26
|
+
|
|
27
|
+
[90mstdout[2m | test/mcp.test.ts[2m > [22m[2mmcp bridge protocol transports[2m > [22m[2mreturns actionable errors for 403 permission failures[22m[39m
|
|
28
|
+
[poncho][mcp] {"event":"catalog.loaded","server":"remote","discoveredCount":1}
|
|
29
|
+
[poncho][mcp] {"event":"tools.selected","requestedPatternCount":1,"registeredCount":1,"filteredByPolicyCount":0,"filteredByIntentCount":0}
|
|
30
|
+
|
|
31
|
+
[32m✓[39m test/mcp.test.ts [2m ([22m[2m6 tests[22m[2m)[22m[33m 516[2mms[22m[39m
|
|
32
|
+
[32m✓[39m test/agent-parser.test.ts [2m ([22m[2m10 tests[22m[2m)[22m[90m 130[2mms[22m[39m
|
|
33
|
+
[32m✓[39m test/memory.test.ts [2m ([22m[2m4 tests[22m[2m)[22m[90m 192[2mms[22m[39m
|
|
34
|
+
[32m✓[39m test/state.test.ts [2m ([22m[2m5 tests[22m[2m)[22m[90m 294[2mms[22m[39m
|
|
35
|
+
[32m✓[39m test/model-factory.test.ts [2m ([22m[2m4 tests[22m[2m)[22m[90m 8[2mms[22m[39m
|
|
36
|
+
[32m✓[39m test/agent-identity.test.ts [2m ([22m[2m2 tests[22m[2m)[22m[90m 33[2mms[22m[39m
|
|
37
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mregisters default filesystem tools[22m[39m
|
|
38
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
39
|
+
|
|
40
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mdisables write_file by default in production environment[22m[39m
|
|
41
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
42
|
+
|
|
43
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mallows disabling built-in tools via poncho.config.js[22m[39m
|
|
44
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
45
|
+
|
|
46
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2msupports per-environment tool overrides[22m[39m
|
|
47
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
48
|
+
|
|
49
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2msupports per-environment tool overrides[22m[39m
|
|
50
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
51
|
+
|
|
52
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mdoes not auto-register exported tool objects from skill scripts[22m[39m
|
|
53
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
54
|
+
|
|
55
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mrefreshes skill metadata and tools in development mode[22m[39m
|
|
56
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
57
|
+
|
|
58
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mrefreshes skill metadata and tools in development mode[22m[39m
|
|
59
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"skills:changed","requestedPatterns":[]}
|
|
60
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"activate:beta","requestedPatterns":[]}
|
|
61
|
+
|
|
62
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mprunes removed active skills after refresh in development mode[22m[39m
|
|
63
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
64
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"activate:obsolete","requestedPatterns":[]}
|
|
65
|
+
|
|
66
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mprunes removed active skills after refresh in development mode[22m[39m
|
|
67
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"skills:changed","requestedPatterns":[]}
|
|
68
|
+
|
|
69
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mdoes not refresh skills outside development mode[22m[39m
|
|
70
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
71
|
+
|
|
72
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mclears active skills when skill metadata changes in development mode[22m[39m
|
|
73
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
74
|
+
|
|
75
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mclears active skills when skill metadata changes in development mode[22m[39m
|
|
76
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"activate:alpha","requestedPatterns":[]}
|
|
77
|
+
|
|
78
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mclears active skills when skill metadata changes in development mode[22m[39m
|
|
79
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"skills:changed","requestedPatterns":[]}
|
|
80
|
+
|
|
81
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mlists skill scripts through list_skill_scripts[22m[39m
|
|
82
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
83
|
+
|
|
84
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mruns JavaScript/TypeScript skill scripts through run_skill_script[22m[39m
|
|
85
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
86
|
+
|
|
87
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mruns AGENT-scope scripts from root scripts directory[22m[39m
|
|
88
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
89
|
+
|
|
90
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mblocks path traversal in run_skill_script[22m[39m
|
|
91
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
92
|
+
|
|
93
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mrequires allowed-tools entries for non-standard script directories[22m[39m
|
|
94
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
95
|
+
|
|
96
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mregisters MCP tools dynamically for stacked active skills and supports deactivation[22m[39m
|
|
97
|
+
[poncho][mcp] {"event":"catalog.loaded","server":"remote","discoveredCount":2}
|
|
98
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
99
|
+
[poncho][mcp] {"event":"tools.selected","requestedPatternCount":1,"registeredCount":1,"filteredByPolicyCount":0,"filteredByIntentCount":1}
|
|
100
|
+
[poncho][mcp] {"event":"tools.refreshed","reason":"activate:skill-a","requestedPatterns":["remote/a"],"registeredCount":1,"activeSkills":["skill-a"]}
|
|
101
|
+
[poncho][mcp] {"event":"tools.selected","requestedPatternCount":2,"registeredCount":2,"filteredByPolicyCount":0,"filteredByIntentCount":0}
|
|
102
|
+
[poncho][mcp] {"event":"tools.refreshed","reason":"activate:skill-b","requestedPatterns":["remote/a","remote/b"],"registeredCount":2,"activeSkills":["skill-a","skill-b"]}
|
|
103
|
+
[poncho][mcp] {"event":"tools.selected","requestedPatternCount":1,"registeredCount":1,"filteredByPolicyCount":0,"filteredByIntentCount":1}
|
|
104
|
+
[poncho][mcp] {"event":"tools.refreshed","reason":"deactivate:skill-a","requestedPatterns":["remote/b"],"registeredCount":1,"activeSkills":["skill-b"]}
|
|
105
|
+
|
|
106
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2msupports flat tool access config format[22m[39m
|
|
107
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
108
|
+
|
|
109
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mflat tool access takes priority over legacy defaults[22m[39m
|
|
110
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
111
|
+
|
|
112
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mbyEnvironment overrides flat tool access[22m[39m
|
|
113
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
114
|
+
|
|
115
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mregisterTools skips tools disabled via config[22m[39m
|
|
116
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
117
|
+
|
|
118
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mapproval access level registers the tool but marks it for approval[22m[39m
|
|
119
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
120
|
+
|
|
121
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mtools without approval config do not require approval[22m[39m
|
|
122
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
123
|
+
|
|
124
|
+
[90mstdout[2m | test/harness.test.ts[2m > [22m[2magent harness[2m > [22m[2mallows in-flight MCP calls to finish after skill deactivation[22m[39m
|
|
125
|
+
[poncho][mcp] {"event":"catalog.loaded","server":"remote","discoveredCount":1}
|
|
126
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"initialize","requestedPatterns":[]}
|
|
127
|
+
[poncho][mcp] {"event":"tools.selected","requestedPatternCount":1,"registeredCount":1,"filteredByPolicyCount":0,"filteredByIntentCount":0}
|
|
128
|
+
[poncho][mcp] {"event":"tools.refreshed","reason":"activate:skill-slow","requestedPatterns":["remote/slow"],"registeredCount":1,"activeSkills":["skill-slow"]}
|
|
129
|
+
[poncho][mcp] {"event":"tools.cleared","reason":"deactivate:skill-slow","requestedPatterns":[]}
|
|
130
|
+
|
|
131
|
+
[32m✓[39m test/harness.test.ts [2m ([22m[2m25 tests[22m[2m)[22m[33m 429[2mms[22m[39m
|
|
132
|
+
|
|
133
|
+
[2m Test Files [22m [1m[32m9 passed[39m[22m[90m (9)[39m
|
|
134
|
+
[2m Tests [22m [1m[32m86 passed[39m[22m[90m (86)[39m
|
|
135
|
+
[2m Start at [22m 10:02:54
|
|
136
|
+
[2m Duration [22m 4.19s[2m (transform 2.16s, setup 0ms, collect 7.51s, tests 1.63s, environment 1ms, prepare 1.97s)[22m
|
|
137
|
+
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @poncho-ai/harness
|
|
2
2
|
|
|
3
|
+
## 0.14.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1f47bb4`](https://github.com/cesr/poncho-ai/commit/1f47bb49e5d48dc17644172012b057190b316469) Thanks [@cesr](https://github.com/cesr)! - Add conversation rename via double-click on the title in the web UI, standardize all credential config fields to the `*Env` naming pattern, and sync the init README template with the repo README.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`1f47bb4`](https://github.com/cesr/poncho-ai/commit/1f47bb49e5d48dc17644172012b057190b316469)]:
|
|
10
|
+
- @poncho-ai/sdk@1.0.3
|
|
11
|
+
|
|
12
|
+
## 0.14.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`e000b96`](https://github.com/cesr/poncho-ai/commit/e000b96837cbbb8d95c868c91a614f458868c444) Thanks [@cesr](https://github.com/cesr)! - Durable approval checkpoints, email conversation improvements, and web UI fixes
|
|
17
|
+
- Simplify approval system to checkpoint-only (remove legacy blocking approvalHandler)
|
|
18
|
+
- Optimize checkpoint storage with delta messages instead of full history
|
|
19
|
+
- Add sidebar sections for conversations awaiting approval with status indicator
|
|
20
|
+
- Fix nested checkpoint missing baseMessageCount in resumeRunFromCheckpoint
|
|
21
|
+
- Improve email conversation titles (sender email + subject)
|
|
22
|
+
- Remove email threading — each incoming email creates its own conversation
|
|
23
|
+
- Fix streaming after approval to preserve existing messages (liveOnly mode)
|
|
24
|
+
- Preserve newlines in user messages in web UI
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [[`e000b96`](https://github.com/cesr/poncho-ai/commit/e000b96837cbbb8d95c868c91a614f458868c444)]:
|
|
27
|
+
- @poncho-ai/sdk@1.0.2
|
|
28
|
+
|
|
3
29
|
## 0.14.0
|
|
4
30
|
|
|
5
31
|
### Minor Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Message, ToolDefinition, RunInput, AgentEvent, RunResult, JsonSchema
|
|
1
|
+
import { Message, ToolDefinition, ToolContext, RunInput, AgentEvent, RunResult, JsonSchema } from '@poncho-ai/sdk';
|
|
2
2
|
export { ToolDefinition, defineTool } from '@poncho-ai/sdk';
|
|
3
3
|
import { LanguageModel } from 'ai';
|
|
4
4
|
import { z } from 'zod';
|
|
@@ -84,7 +84,15 @@ interface Conversation {
|
|
|
84
84
|
approvalId: string;
|
|
85
85
|
runId: string;
|
|
86
86
|
tool: string;
|
|
87
|
+
toolCallId?: string;
|
|
87
88
|
input: Record<string, unknown>;
|
|
89
|
+
checkpointMessages?: Message[];
|
|
90
|
+
baseMessageCount?: number;
|
|
91
|
+
pendingToolCalls?: Array<{
|
|
92
|
+
id: string;
|
|
93
|
+
name: string;
|
|
94
|
+
input: Record<string, unknown>;
|
|
95
|
+
}>;
|
|
88
96
|
}>;
|
|
89
97
|
ownerId: string;
|
|
90
98
|
tenantId: string | null;
|
|
@@ -103,8 +111,8 @@ type StateProviderName = "local" | "memory" | "redis" | "upstash" | "dynamodb";
|
|
|
103
111
|
interface StateConfig {
|
|
104
112
|
provider?: StateProviderName;
|
|
105
113
|
ttl?: number;
|
|
106
|
-
|
|
107
|
-
|
|
114
|
+
urlEnv?: string;
|
|
115
|
+
tokenEnv?: string;
|
|
108
116
|
table?: string;
|
|
109
117
|
region?: string;
|
|
110
118
|
}
|
|
@@ -146,8 +154,8 @@ interface MainMemory {
|
|
|
146
154
|
interface MemoryConfig {
|
|
147
155
|
enabled?: boolean;
|
|
148
156
|
provider?: StateProviderName;
|
|
149
|
-
|
|
150
|
-
|
|
157
|
+
urlEnv?: string;
|
|
158
|
+
tokenEnv?: string;
|
|
151
159
|
table?: string;
|
|
152
160
|
region?: string;
|
|
153
161
|
ttl?: number;
|
|
@@ -210,8 +218,8 @@ declare class LocalMcpBridge {
|
|
|
210
218
|
|
|
211
219
|
interface StorageConfig {
|
|
212
220
|
provider?: "local" | "memory" | "redis" | "upstash" | "dynamodb";
|
|
213
|
-
|
|
214
|
-
|
|
221
|
+
urlEnv?: string;
|
|
222
|
+
tokenEnv?: string;
|
|
215
223
|
table?: string;
|
|
216
224
|
region?: string;
|
|
217
225
|
ttl?: number | {
|
|
@@ -266,6 +274,7 @@ interface PonchoConfig extends McpConfig {
|
|
|
266
274
|
required?: boolean;
|
|
267
275
|
type?: "bearer" | "header" | "custom";
|
|
268
276
|
headerName?: string;
|
|
277
|
+
tokenEnv?: string;
|
|
269
278
|
validate?: (token: string, req?: unknown) => Promise<boolean> | boolean;
|
|
270
279
|
};
|
|
271
280
|
state?: {
|
|
@@ -275,12 +284,20 @@ interface PonchoConfig extends McpConfig {
|
|
|
275
284
|
};
|
|
276
285
|
memory?: MemoryConfig;
|
|
277
286
|
storage?: StorageConfig;
|
|
287
|
+
providers?: {
|
|
288
|
+
openai?: {
|
|
289
|
+
apiKeyEnv?: string;
|
|
290
|
+
};
|
|
291
|
+
anthropic?: {
|
|
292
|
+
apiKeyEnv?: string;
|
|
293
|
+
};
|
|
294
|
+
};
|
|
278
295
|
telemetry?: {
|
|
279
296
|
enabled?: boolean;
|
|
280
297
|
otlp?: string;
|
|
281
298
|
latitude?: {
|
|
282
|
-
|
|
283
|
-
|
|
299
|
+
apiKeyEnv?: string;
|
|
300
|
+
projectIdEnv?: string;
|
|
284
301
|
path?: string;
|
|
285
302
|
documentPath?: string;
|
|
286
303
|
};
|
|
@@ -355,24 +372,48 @@ type ModelProviderFactory = (modelName: string) => LanguageModel;
|
|
|
355
372
|
* resolve via the base prefix. Longest match wins.
|
|
356
373
|
*/
|
|
357
374
|
declare const getModelContextWindow: (modelName: string) => number;
|
|
375
|
+
interface ProviderConfig {
|
|
376
|
+
openai?: {
|
|
377
|
+
apiKeyEnv?: string;
|
|
378
|
+
};
|
|
379
|
+
anthropic?: {
|
|
380
|
+
apiKeyEnv?: string;
|
|
381
|
+
};
|
|
382
|
+
}
|
|
358
383
|
/**
|
|
359
|
-
* Creates a model provider factory for the specified AI provider
|
|
360
|
-
*
|
|
361
|
-
*
|
|
384
|
+
* Creates a model provider factory for the specified AI provider.
|
|
385
|
+
* API keys are read from environment variables; override the env var
|
|
386
|
+
* name via the `providers` config in `poncho.config.js`.
|
|
362
387
|
*/
|
|
363
|
-
declare const createModelProvider: (provider?: string) => ModelProviderFactory;
|
|
388
|
+
declare const createModelProvider: (provider?: string, config?: ProviderConfig) => ModelProviderFactory;
|
|
389
|
+
|
|
390
|
+
interface ToolCall {
|
|
391
|
+
id: string;
|
|
392
|
+
name: string;
|
|
393
|
+
input: Record<string, unknown>;
|
|
394
|
+
}
|
|
395
|
+
interface ToolExecutionResult {
|
|
396
|
+
callId: string;
|
|
397
|
+
tool: string;
|
|
398
|
+
output?: unknown;
|
|
399
|
+
error?: string;
|
|
400
|
+
}
|
|
401
|
+
declare class ToolDispatcher {
|
|
402
|
+
private readonly tools;
|
|
403
|
+
register(tool: ToolDefinition): void;
|
|
404
|
+
registerMany(tools: ToolDefinition[]): void;
|
|
405
|
+
unregister(name: string): void;
|
|
406
|
+
unregisterMany(names: Iterable<string>): void;
|
|
407
|
+
list(): ToolDefinition[];
|
|
408
|
+
get(name: string): ToolDefinition | undefined;
|
|
409
|
+
execute(call: ToolCall, context: ToolContext): Promise<ToolExecutionResult>;
|
|
410
|
+
executeBatch(calls: ToolCall[], context: ToolContext): Promise<ToolExecutionResult[]>;
|
|
411
|
+
}
|
|
364
412
|
|
|
365
413
|
interface HarnessOptions {
|
|
366
414
|
workingDir?: string;
|
|
367
415
|
environment?: "development" | "staging" | "production";
|
|
368
416
|
toolDefinitions?: ToolDefinition[];
|
|
369
|
-
approvalHandler?: (request: {
|
|
370
|
-
tool: string;
|
|
371
|
-
input: Record<string, unknown>;
|
|
372
|
-
runId: string;
|
|
373
|
-
step: number;
|
|
374
|
-
approvalId: string;
|
|
375
|
-
}) => Promise<boolean> | boolean;
|
|
376
417
|
modelProvider?: ModelProviderFactory;
|
|
377
418
|
uploadStore?: UploadStore;
|
|
378
419
|
}
|
|
@@ -388,7 +429,6 @@ declare class AgentHarness {
|
|
|
388
429
|
private modelProvider;
|
|
389
430
|
private readonly modelProviderInjected;
|
|
390
431
|
private readonly dispatcher;
|
|
391
|
-
private readonly approvalHandler?;
|
|
392
432
|
readonly uploadStore?: UploadStore;
|
|
393
433
|
private skillContextWindow;
|
|
394
434
|
private memoryStore?;
|
|
@@ -439,6 +479,19 @@ declare class AgentHarness {
|
|
|
439
479
|
*/
|
|
440
480
|
runWithTelemetry(input: RunInput): AsyncGenerator<AgentEvent>;
|
|
441
481
|
run(input: RunInput): AsyncGenerator<AgentEvent>;
|
|
482
|
+
executeTools(calls: ToolCall[], context: ToolContext): Promise<ToolExecutionResult[]>;
|
|
483
|
+
continueFromToolResult(input: {
|
|
484
|
+
messages: Message[];
|
|
485
|
+
toolResults: Array<{
|
|
486
|
+
callId: string;
|
|
487
|
+
toolName: string;
|
|
488
|
+
result?: unknown;
|
|
489
|
+
error?: string;
|
|
490
|
+
}>;
|
|
491
|
+
conversationId?: string;
|
|
492
|
+
parameters?: Record<string, unknown>;
|
|
493
|
+
abortSignal?: AbortSignal;
|
|
494
|
+
}): AsyncGenerator<AgentEvent>;
|
|
442
495
|
runToCompletion(input: RunInput): Promise<HarnessRunOutput>;
|
|
443
496
|
}
|
|
444
497
|
|
|
@@ -453,8 +506,8 @@ declare class AgentHarness {
|
|
|
453
506
|
* Vercel AI SDK support.
|
|
454
507
|
*/
|
|
455
508
|
interface LatitudeCaptureConfig {
|
|
456
|
-
|
|
457
|
-
|
|
509
|
+
apiKeyEnv?: string;
|
|
510
|
+
projectIdEnv?: string;
|
|
458
511
|
path?: string;
|
|
459
512
|
defaultPath?: string;
|
|
460
513
|
}
|
|
@@ -549,8 +602,8 @@ interface TelemetryConfig {
|
|
|
549
602
|
enabled?: boolean;
|
|
550
603
|
otlp?: string;
|
|
551
604
|
latitude?: {
|
|
552
|
-
|
|
553
|
-
|
|
605
|
+
apiKeyEnv?: string;
|
|
606
|
+
projectIdEnv?: string;
|
|
554
607
|
path?: string;
|
|
555
608
|
documentPath?: string;
|
|
556
609
|
};
|
|
@@ -563,27 +616,4 @@ declare class TelemetryEmitter {
|
|
|
563
616
|
private sendOtlp;
|
|
564
617
|
}
|
|
565
618
|
|
|
566
|
-
|
|
567
|
-
id: string;
|
|
568
|
-
name: string;
|
|
569
|
-
input: Record<string, unknown>;
|
|
570
|
-
}
|
|
571
|
-
interface ToolExecutionResult {
|
|
572
|
-
callId: string;
|
|
573
|
-
tool: string;
|
|
574
|
-
output?: unknown;
|
|
575
|
-
error?: string;
|
|
576
|
-
}
|
|
577
|
-
declare class ToolDispatcher {
|
|
578
|
-
private readonly tools;
|
|
579
|
-
register(tool: ToolDefinition): void;
|
|
580
|
-
registerMany(tools: ToolDefinition[]): void;
|
|
581
|
-
unregister(name: string): void;
|
|
582
|
-
unregisterMany(names: Iterable<string>): void;
|
|
583
|
-
list(): ToolDefinition[];
|
|
584
|
-
get(name: string): ToolDefinition | undefined;
|
|
585
|
-
execute(call: ToolCall, context: ToolContext): Promise<ToolExecutionResult>;
|
|
586
|
-
executeBatch(calls: ToolCall[], context: ToolContext): Promise<ToolExecutionResult[]>;
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
export { type AgentFrontmatter, AgentHarness, type AgentIdentity, type AgentLimitsConfig, type AgentModelConfig, type BuiltInToolToggles, type Conversation, type ConversationState, type ConversationStore, type CronJobConfig, type HarnessOptions, type HarnessRunOutput, InMemoryConversationStore, InMemoryStateStore, LatitudeCapture, type LatitudeCaptureConfig, LocalMcpBridge, LocalUploadStore, type MainMemory, type McpConfig, type MemoryConfig, type MemoryStore, type MessagingChannelConfig, type ModelProviderFactory, PONCHO_UPLOAD_SCHEME, type ParsedAgent, type PonchoConfig, type RemoteMcpServerConfig, type RuntimeRenderContext, S3UploadStore, STORAGE_SCHEMA_VERSION, type SkillContextEntry, type SkillMetadata, type StateConfig, type StateProviderName, type StateStore, type StorageConfig, type TelemetryConfig, TelemetryEmitter, type ToolAccess, type ToolCall, ToolDispatcher, type ToolExecutionResult, type UploadStore, type UploadsConfig, VercelBlobUploadStore, buildAgentDirectoryName, buildSkillContextWindow, createConversationStore, createDefaultTools, createMemoryStore, createMemoryTools, createModelProvider, createSkillTools, createStateStore, createUploadStore, createWriteTool, deriveUploadKey, ensureAgentIdentity, generateAgentId, getAgentStoreDirectory, getModelContextWindow, getPonchoStoreRoot, jsonSchemaToZod, loadPonchoConfig, loadSkillContext, loadSkillInstructions, loadSkillMetadata, normalizeScriptPolicyPath, parseAgentFile, parseAgentMarkdown, readSkillResource, renderAgentPrompt, resolveAgentIdentity, resolveMemoryConfig, resolveSkillDirs, resolveStateConfig, slugifyStorageComponent };
|
|
619
|
+
export { type AgentFrontmatter, AgentHarness, type AgentIdentity, type AgentLimitsConfig, type AgentModelConfig, type BuiltInToolToggles, type Conversation, type ConversationState, type ConversationStore, type CronJobConfig, type HarnessOptions, type HarnessRunOutput, InMemoryConversationStore, InMemoryStateStore, LatitudeCapture, type LatitudeCaptureConfig, LocalMcpBridge, LocalUploadStore, type MainMemory, type McpConfig, type MemoryConfig, type MemoryStore, type MessagingChannelConfig, type ModelProviderFactory, PONCHO_UPLOAD_SCHEME, type ParsedAgent, type PonchoConfig, type ProviderConfig, type RemoteMcpServerConfig, type RuntimeRenderContext, S3UploadStore, STORAGE_SCHEMA_VERSION, type SkillContextEntry, type SkillMetadata, type StateConfig, type StateProviderName, type StateStore, type StorageConfig, type TelemetryConfig, TelemetryEmitter, type ToolAccess, type ToolCall, ToolDispatcher, type ToolExecutionResult, type UploadStore, type UploadsConfig, VercelBlobUploadStore, buildAgentDirectoryName, buildSkillContextWindow, createConversationStore, createDefaultTools, createMemoryStore, createMemoryTools, createModelProvider, createSkillTools, createStateStore, createUploadStore, createWriteTool, deriveUploadKey, ensureAgentIdentity, generateAgentId, getAgentStoreDirectory, getModelContextWindow, getPonchoStoreRoot, jsonSchemaToZod, loadPonchoConfig, loadSkillContext, loadSkillInstructions, loadSkillMetadata, normalizeScriptPolicyPath, parseAgentFile, parseAgentMarkdown, readSkillResource, renderAgentPrompt, resolveAgentIdentity, resolveMemoryConfig, resolveSkillDirs, resolveStateConfig, slugifyStorageComponent };
|