@poncho-ai/harness 0.31.1 → 0.31.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @poncho-ai/harness@0.31.1 build /Users/cesar/Dev/latitude/poncho-ai/packages/harness
2
+ > @poncho-ai/harness@0.31.2 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
  CLI tsup v8.5.1
9
9
  CLI Target: es2022
10
10
  ESM Build start
11
- ESM dist/index.js 315.41 KB
12
- ESM ⚡️ Build success in 33ms
11
+ ESM dist/index.js 327.57 KB
12
+ ESM ⚡️ Build success in 170ms
13
13
  DTS Build start
14
- DTS ⚡️ Build success in 2913ms
15
- DTS dist/index.d.ts 32.56 KB
14
+ DTS ⚡️ Build success in 7684ms
15
+ DTS dist/index.d.ts 33.43 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @poncho-ai/harness
2
2
 
3
+ ## 0.31.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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.
8
+
9
+ 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.
10
+
11
+ - Updated dependencies [[`2341915`](https://github.com/cesr/poncho-ai/commit/23419152d52c39f3bcaf8cdcd424625d5f897315)]:
12
+ - @poncho-ai/sdk@1.7.1
13
+
3
14
  ## 0.31.1
4
15
 
5
16
  ### 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 };