@poncho-ai/harness 0.13.0 → 0.14.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 +29 -0
- package/dist/index.d.ts +39 -7
- package/dist/index.js +373 -99
- package/package.json +3 -2
- package/src/agent-parser.ts +1 -0
- package/src/config.ts +29 -3
- package/src/harness.ts +346 -76
- package/src/model-factory.ts +45 -0
- package/src/prompt-cache.ts +47 -0
- package/src/telemetry.ts +2 -33
- package/test/harness.test.ts +227 -8
- package/test/model-factory.test.ts +4 -6
- package/test/telemetry.test.ts +2 -12
- package/tsconfig.json +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @poncho-ai/harness@0.
|
|
2
|
+
> @poncho-ai/harness@0.14.0 build /home/runner/work/poncho-ai/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[32m173.62 KB[39m
|
|
11
|
+
[32mESM[39m ⚡️ Build success in 98ms
|
|
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 5281ms
|
|
14
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m20.92 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,34 @@
|
|
|
1
1
|
# @poncho-ai/harness
|
|
2
2
|
|
|
3
|
+
## 0.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`fed3e87`](https://github.com/cesr/poncho-ai/commit/fed3e870aecaea9dcbe8070f5bb2c828d4eb8921) Thanks [@cesr](https://github.com/cesr)! - Unified tool access configuration and web UI streaming for messaging conversations
|
|
8
|
+
- New `tools` config in `poncho.config.js`: control any tool with `true` (available), `false` (disabled), or `'approval'` (requires human approval). Per-environment overrides via `byEnvironment`. Works for harness, adapter, MCP, and skill tools.
|
|
9
|
+
- Messaging conversations (email via Resend) now stream events to the web UI: live tool progress, approval prompts, and text chunks display in real time.
|
|
10
|
+
- Clicking a conversation with an active run in the web UI sidebar auto-attaches to the event stream.
|
|
11
|
+
- Fix conversation persistence race condition in messaging runner (stale-write clobber).
|
|
12
|
+
- Fix duplicated last section in persisted conversations.
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`9e87d28`](https://github.com/cesr/poncho-ai/commit/9e87d2801ba7b8d4c8b0650563d59e9cad530ff6) Thanks [@cesr](https://github.com/cesr)! - Fix Latitude telemetry not exporting traces
|
|
17
|
+
- Reuse a single `LatitudeTelemetry` instance across runs instead of creating one per run (avoids OpenTelemetry global registration conflicts)
|
|
18
|
+
- Use `disableBatch` mode so spans export immediately instead of being silently lost on a 5s timer
|
|
19
|
+
- Warn at startup when `telemetry.latitude` is configured with missing or misnamed fields (e.g. `apiKeyEnv` instead of `apiKey`)
|
|
20
|
+
- Sanitize agent name for Latitude's path validation
|
|
21
|
+
- Surface OTLP export errors in console output
|
|
22
|
+
|
|
23
|
+
## 0.13.1
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- [#10](https://github.com/cesr/poncho-ai/pull/10) [`d5bce7b`](https://github.com/cesr/poncho-ai/commit/d5bce7be5890c657bea915eb0926feb6de66b218) Thanks [@cesr](https://github.com/cesr)! - Add generic messaging layer with Slack as the first adapter. Agents can now respond to @mentions in Slack by adding `messaging: [{ platform: 'slack' }]` to `poncho.config.js`. Includes signature verification, threaded conversations, processing indicators, and Vercel `waitUntil` support.
|
|
28
|
+
|
|
29
|
+
- Updated dependencies [[`d5bce7b`](https://github.com/cesr/poncho-ai/commit/d5bce7be5890c657bea915eb0926feb6de66b218)]:
|
|
30
|
+
- @poncho-ai/sdk@1.0.1
|
|
31
|
+
|
|
3
32
|
## 0.13.0
|
|
4
33
|
|
|
5
34
|
### Minor Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ interface AgentModelConfig {
|
|
|
8
8
|
name: string;
|
|
9
9
|
temperature?: number;
|
|
10
10
|
maxTokens?: number;
|
|
11
|
+
contextWindow?: number;
|
|
11
12
|
}
|
|
12
13
|
interface AgentLimitsConfig {
|
|
13
14
|
maxSteps?: number;
|
|
@@ -230,20 +231,36 @@ interface UploadsConfig {
|
|
|
230
231
|
region?: string;
|
|
231
232
|
endpoint?: string;
|
|
232
233
|
}
|
|
234
|
+
type ToolAccess = boolean | "approval";
|
|
235
|
+
/** @deprecated Use flat tool keys on `tools` instead. Kept for backward compat. */
|
|
233
236
|
type BuiltInToolToggles = {
|
|
234
237
|
list_directory?: boolean;
|
|
235
238
|
read_file?: boolean;
|
|
236
239
|
write_file?: boolean;
|
|
237
240
|
};
|
|
241
|
+
interface MessagingChannelConfig {
|
|
242
|
+
platform: "slack" | "resend";
|
|
243
|
+
botTokenEnv?: string;
|
|
244
|
+
signingSecretEnv?: string;
|
|
245
|
+
apiKeyEnv?: string;
|
|
246
|
+
webhookSecretEnv?: string;
|
|
247
|
+
fromEnv?: string;
|
|
248
|
+
allowedSenders?: string[];
|
|
249
|
+
mode?: "auto-reply" | "tool";
|
|
250
|
+
allowedRecipients?: string[];
|
|
251
|
+
maxSendsPerRun?: number;
|
|
252
|
+
}
|
|
238
253
|
interface PonchoConfig extends McpConfig {
|
|
239
254
|
harness?: string;
|
|
255
|
+
messaging?: MessagingChannelConfig[];
|
|
240
256
|
tools?: {
|
|
241
257
|
defaults?: BuiltInToolToggles;
|
|
242
258
|
byEnvironment?: {
|
|
243
|
-
development?:
|
|
244
|
-
staging?:
|
|
245
|
-
production?:
|
|
259
|
+
development?: Record<string, ToolAccess>;
|
|
260
|
+
staging?: Record<string, ToolAccess>;
|
|
261
|
+
production?: Record<string, ToolAccess>;
|
|
246
262
|
};
|
|
263
|
+
[toolName: string]: ToolAccess | BuiltInToolToggles | Record<string, Record<string, ToolAccess>> | undefined;
|
|
247
264
|
};
|
|
248
265
|
auth?: {
|
|
249
266
|
required?: boolean;
|
|
@@ -280,6 +297,8 @@ interface PonchoConfig extends McpConfig {
|
|
|
280
297
|
lambda?: Record<string, unknown>;
|
|
281
298
|
fly?: Record<string, unknown>;
|
|
282
299
|
};
|
|
300
|
+
/** Set to `false` to disable the built-in web UI (headless / API-only mode). */
|
|
301
|
+
webUi?: false;
|
|
283
302
|
}
|
|
284
303
|
declare const resolveStateConfig: (config: PonchoConfig | undefined) => StateConfig | undefined;
|
|
285
304
|
declare const resolveMemoryConfig: (config: PonchoConfig | undefined) => MemoryConfig | undefined;
|
|
@@ -330,6 +349,12 @@ declare class S3UploadStore implements UploadStore {
|
|
|
330
349
|
declare const createUploadStore: (config: UploadsConfig | undefined, workingDir: string) => Promise<UploadStore>;
|
|
331
350
|
|
|
332
351
|
type ModelProviderFactory = (modelName: string) => LanguageModel;
|
|
352
|
+
/**
|
|
353
|
+
* Returns the context window size (in tokens) for a given model name.
|
|
354
|
+
* Uses startsWith matching so dated variants (e.g. claude-opus-4-6-20260217)
|
|
355
|
+
* resolve via the base prefix. Longest match wins.
|
|
356
|
+
*/
|
|
357
|
+
declare const getModelContextWindow: (modelName: string) => number;
|
|
333
358
|
/**
|
|
334
359
|
* Creates a model provider factory for the specified AI provider
|
|
335
360
|
* @param provider - The provider name ('openai' or 'anthropic')
|
|
@@ -372,11 +397,19 @@ declare class AgentHarness {
|
|
|
372
397
|
private skillFingerprint;
|
|
373
398
|
private readonly activeSkillNames;
|
|
374
399
|
private readonly registeredMcpToolNames;
|
|
400
|
+
private latitudeTelemetry?;
|
|
401
|
+
private insideTelemetryCapture;
|
|
375
402
|
private parsedAgent?;
|
|
376
403
|
private mcpBridge?;
|
|
377
|
-
private
|
|
378
|
-
private
|
|
404
|
+
private resolveToolAccess;
|
|
405
|
+
private isToolEnabled;
|
|
379
406
|
private registerIfMissing;
|
|
407
|
+
/**
|
|
408
|
+
* Register additional tools after construction (e.g. messaging adapter tools).
|
|
409
|
+
* Existing tools with the same name are overwritten.
|
|
410
|
+
* Tools disabled via `tools` config are skipped.
|
|
411
|
+
*/
|
|
412
|
+
registerTools(tools: ToolDefinition[]): void;
|
|
380
413
|
private registerConfiguredBuiltInTools;
|
|
381
414
|
private shouldEnableWriteTool;
|
|
382
415
|
constructor(options?: HarnessOptions);
|
|
@@ -528,7 +561,6 @@ declare class TelemetryEmitter {
|
|
|
528
561
|
constructor(config?: TelemetryConfig);
|
|
529
562
|
emit(event: AgentEvent): Promise<void>;
|
|
530
563
|
private sendOtlp;
|
|
531
|
-
private sendLatitude;
|
|
532
564
|
}
|
|
533
565
|
|
|
534
566
|
interface ToolCall {
|
|
@@ -554,4 +586,4 @@ declare class ToolDispatcher {
|
|
|
554
586
|
executeBatch(calls: ToolCall[], context: ToolContext): Promise<ToolExecutionResult[]>;
|
|
555
587
|
}
|
|
556
588
|
|
|
557
|
-
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 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 ToolCall, ToolDispatcher, type ToolExecutionResult, type UploadStore, type UploadsConfig, VercelBlobUploadStore, buildAgentDirectoryName, buildSkillContextWindow, createConversationStore, createDefaultTools, createMemoryStore, createMemoryTools, createModelProvider, createSkillTools, createStateStore, createUploadStore, createWriteTool, deriveUploadKey, ensureAgentIdentity, generateAgentId, getAgentStoreDirectory, getPonchoStoreRoot, jsonSchemaToZod, loadPonchoConfig, loadSkillContext, loadSkillInstructions, loadSkillMetadata, normalizeScriptPolicyPath, parseAgentFile, parseAgentMarkdown, readSkillResource, renderAgentPrompt, resolveAgentIdentity, resolveMemoryConfig, resolveSkillDirs, resolveStateConfig, slugifyStorageComponent };
|
|
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 };
|