@poncho-ai/harness 0.31.1 → 0.31.3
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 +19 -0
- package/dist/index.d.ts +27 -1
- package/dist/index.js +371 -51
- package/package.json +2 -2
- package/src/compaction.ts +8 -4
- package/src/harness.ts +442 -54
- package/src/state.ts +12 -0
- package/src/telemetry.ts +4 -0
- package/.turbo/turbo-lint.log +0 -6
- package/.turbo/turbo-test.log +0 -34
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @poncho-ai/harness@0.31.
|
|
2
|
+
> @poncho-ai/harness@0.31.3 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,8 +8,8 @@
|
|
|
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[
|
|
12
|
-
[32mESM[39m ⚡️ Build success in
|
|
11
|
+
[32mESM[39m [1mdist/index.js [22m[32m327.98 KB[39m
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 137ms
|
|
13
13
|
[34mDTS[39m Build start
|
|
14
|
-
[32mDTS[39m ⚡️ Build success in
|
|
15
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
14
|
+
[32mDTS[39m ⚡️ Build success in 7094ms
|
|
15
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m33.43 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @poncho-ai/harness
|
|
2
2
|
|
|
3
|
+
## 0.31.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#56](https://github.com/cesr/poncho-ai/pull/56) [`28b2913`](https://github.com/cesr/poncho-ai/commit/28b291379e640dec53a66c41a2795d0a9fbb9ee7) Thanks [@cesr](https://github.com/cesr)! - Fix historical tool result truncation reliability for deployed conversations.
|
|
8
|
+
|
|
9
|
+
This stamps `runId` on all harness-authored assistant messages and adds a fallback truncation boundary for legacy histories that lack `runId` metadata.
|
|
10
|
+
|
|
11
|
+
## 0.31.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#54](https://github.com/cesr/poncho-ai/pull/54) [`2341915`](https://github.com/cesr/poncho-ai/commit/23419152d52c39f3bcaf8cdcd424625d5f897315) Thanks [@cesr](https://github.com/cesr)! - Reduce high-cost outliers with aggressive runtime controls and better cost visibility.
|
|
16
|
+
|
|
17
|
+
This adds older-turn tool result archiving/truncation, tighter retry/step/subagent limits, compaction tuning, selective prompt cache behavior, and richer cache-write token attribution in logs/events.
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [[`2341915`](https://github.com/cesr/poncho-ai/commit/23419152d52c39f3bcaf8cdcd424625d5f897315)]:
|
|
20
|
+
- @poncho-ai/sdk@1.7.1
|
|
21
|
+
|
|
3
22
|
## 0.31.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -131,6 +131,15 @@ interface PendingSubagentResult {
|
|
|
131
131
|
error?: _poncho_ai_sdk.AgentFailure;
|
|
132
132
|
timestamp: number;
|
|
133
133
|
}
|
|
134
|
+
interface ArchivedToolResult$1 {
|
|
135
|
+
toolResultId: string;
|
|
136
|
+
conversationId: string;
|
|
137
|
+
toolName: string;
|
|
138
|
+
toolCallId: string;
|
|
139
|
+
createdAt: number;
|
|
140
|
+
sizeBytes: number;
|
|
141
|
+
payload: string;
|
|
142
|
+
}
|
|
134
143
|
interface Conversation {
|
|
135
144
|
conversationId: string;
|
|
136
145
|
title: string;
|
|
@@ -185,6 +194,8 @@ interface Conversation {
|
|
|
185
194
|
* Unlike `_continuationMessages`, this is always set after a run
|
|
186
195
|
* and does NOT signal that a continuation is pending. */
|
|
187
196
|
_harnessMessages?: Message[];
|
|
197
|
+
/** Archived full-fidelity tool results keyed by toolResultId. */
|
|
198
|
+
_toolResultArchive?: Record<string, ArchivedToolResult$1>;
|
|
188
199
|
createdAt: number;
|
|
189
200
|
updatedAt: number;
|
|
190
201
|
}
|
|
@@ -658,6 +669,15 @@ interface HarnessRunOutput {
|
|
|
658
669
|
events: AgentEvent[];
|
|
659
670
|
messages: Message[];
|
|
660
671
|
}
|
|
672
|
+
interface ArchivedToolResult {
|
|
673
|
+
toolResultId: string;
|
|
674
|
+
conversationId: string;
|
|
675
|
+
toolName: string;
|
|
676
|
+
toolCallId: string;
|
|
677
|
+
createdAt: number;
|
|
678
|
+
sizeBytes: number;
|
|
679
|
+
payload: string;
|
|
680
|
+
}
|
|
661
681
|
declare class AgentHarness {
|
|
662
682
|
private readonly workingDir;
|
|
663
683
|
private readonly environment;
|
|
@@ -685,6 +705,7 @@ declare class AgentHarness {
|
|
|
685
705
|
private agentFileFingerprint;
|
|
686
706
|
private mcpBridge?;
|
|
687
707
|
private subagentManager?;
|
|
708
|
+
private readonly archivedToolResultsByConversation;
|
|
688
709
|
private resolveToolAccess;
|
|
689
710
|
private isToolEnabled;
|
|
690
711
|
private registerIfMissing;
|
|
@@ -697,9 +718,14 @@ declare class AgentHarness {
|
|
|
697
718
|
unregisterTools(names: string[]): void;
|
|
698
719
|
setSubagentManager(manager: SubagentManager): void;
|
|
699
720
|
private registerConfiguredBuiltInTools;
|
|
721
|
+
private createGetToolResultByIdTool;
|
|
700
722
|
private shouldEnableWriteTool;
|
|
701
723
|
constructor(options?: HarnessOptions);
|
|
702
724
|
get frontmatter(): AgentFrontmatter | undefined;
|
|
725
|
+
getToolResultArchive(conversationId: string): Record<string, ArchivedToolResult>;
|
|
726
|
+
private seedToolResultArchive;
|
|
727
|
+
private truncateHistoricalToolResults;
|
|
728
|
+
private shouldPreserveSkillToolResult;
|
|
703
729
|
getTodos(conversationId: string): Promise<TodoItem[]>;
|
|
704
730
|
private listActiveSkills;
|
|
705
731
|
private getAgentMcpIntent;
|
|
@@ -886,4 +912,4 @@ declare class TelemetryEmitter {
|
|
|
886
912
|
|
|
887
913
|
declare const createSubagentTools: (manager: SubagentManager) => ToolDefinition[];
|
|
888
914
|
|
|
889
|
-
export { type AgentFrontmatter, AgentHarness, type AgentIdentity, type AgentLimitsConfig, type AgentModelConfig, type BuiltInToolToggles, type CompactMessagesOptions, type CompactResult, type CompactionConfig, type Conversation, type ConversationState, type ConversationStore, type ConversationSummary, 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, OPENAI_CODEX_CLIENT_ID, type OpenAICodexAuthConfig, type OpenAICodexDeviceAuthRequest, type OpenAICodexSession, type OtlpConfig, type OtlpOption, PONCHO_UPLOAD_SCHEME, type ParsedAgent, type PendingSubagentResult, 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 SubagentManager, type SubagentResult, type SubagentSpawnResult, type SubagentSummary, type TelemetryConfig, TelemetryEmitter, type ToolAccess, type ToolCall, ToolDispatcher, type ToolExecutionResult, type UploadStore, type UploadsConfig, VercelBlobUploadStore, buildAgentDirectoryName, buildSkillContextWindow, compactMessages, completeOpenAICodexDeviceAuth, createConversationStore, createDefaultTools, createDeleteDirectoryTool, createDeleteTool, createEditTool, createMemoryStore, createMemoryTools, createModelProvider, createSearchTools, createSkillTools, createStateStore, createSubagentTools, createUploadStore, createWriteTool, deleteOpenAICodexSession, deriveUploadKey, ensureAgentIdentity, estimateTokens, estimateTotalTokens, findSafeSplitPoint, generateAgentId, getAgentStoreDirectory, getModelContextWindow, getOpenAICodexAccessToken, getOpenAICodexAuthFilePath, getOpenAICodexRequiredScopes, getPonchoStoreRoot, jsonSchemaToZod, loadPonchoConfig, loadSkillContext, loadSkillInstructions, loadSkillMetadata, normalizeOtlp, normalizeScriptPolicyPath, parseAgentFile, parseAgentMarkdown, ponchoDocsTool, readOpenAICodexSession, readSkillResource, renderAgentPrompt, resolveAgentIdentity, resolveCompactionConfig, resolveMemoryConfig, resolveSkillDirs, resolveStateConfig, slugifyStorageComponent, startOpenAICodexDeviceAuth, writeOpenAICodexSession };
|
|
915
|
+
export { type AgentFrontmatter, AgentHarness, type AgentIdentity, type AgentLimitsConfig, type AgentModelConfig, type ArchivedToolResult$1 as ArchivedToolResult, type BuiltInToolToggles, type CompactMessagesOptions, type CompactResult, type CompactionConfig, type Conversation, type ConversationState, type ConversationStore, type ConversationSummary, 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, OPENAI_CODEX_CLIENT_ID, type OpenAICodexAuthConfig, type OpenAICodexDeviceAuthRequest, type OpenAICodexSession, type OtlpConfig, type OtlpOption, PONCHO_UPLOAD_SCHEME, type ParsedAgent, type PendingSubagentResult, 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 SubagentManager, type SubagentResult, type SubagentSpawnResult, type SubagentSummary, type TelemetryConfig, TelemetryEmitter, type ToolAccess, type ToolCall, ToolDispatcher, type ToolExecutionResult, type UploadStore, type UploadsConfig, VercelBlobUploadStore, buildAgentDirectoryName, buildSkillContextWindow, compactMessages, completeOpenAICodexDeviceAuth, createConversationStore, createDefaultTools, createDeleteDirectoryTool, createDeleteTool, createEditTool, createMemoryStore, createMemoryTools, createModelProvider, createSearchTools, createSkillTools, createStateStore, createSubagentTools, createUploadStore, createWriteTool, deleteOpenAICodexSession, deriveUploadKey, ensureAgentIdentity, estimateTokens, estimateTotalTokens, findSafeSplitPoint, generateAgentId, getAgentStoreDirectory, getModelContextWindow, getOpenAICodexAccessToken, getOpenAICodexAuthFilePath, getOpenAICodexRequiredScopes, getPonchoStoreRoot, jsonSchemaToZod, loadPonchoConfig, loadSkillContext, loadSkillInstructions, loadSkillMetadata, normalizeOtlp, normalizeScriptPolicyPath, parseAgentFile, parseAgentMarkdown, ponchoDocsTool, readOpenAICodexSession, readSkillResource, renderAgentPrompt, resolveAgentIdentity, resolveCompactionConfig, resolveMemoryConfig, resolveSkillDirs, resolveStateConfig, slugifyStorageComponent, startOpenAICodexDeviceAuth, writeOpenAICodexSession };
|