@poncho-ai/harness 0.16.1 → 0.18.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @poncho-ai/harness@0.16.1 build /Users/cesar/Dev/latitude/poncho-ai/packages/harness
2
+ > @poncho-ai/harness@0.18.0 build /home/runner/work/poncho-ai/poncho-ai/packages/harness
3
3
  > tsup src/index.ts --format esm --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -7,8 +7,8 @@
7
7
  CLI tsup v8.5.1
8
8
  CLI Target: es2022
9
9
  ESM Build start
10
- ESM dist/index.js 187.36 KB
11
- ESM ⚡️ Build success in 91ms
10
+ ESM dist/index.js 196.78 KB
11
+ ESM ⚡️ Build success in 133ms
12
12
  DTS Build start
13
- DTS ⚡️ Build success in 3621ms
14
- DTS dist/index.d.ts 22.38 KB
13
+ DTS ⚡️ Build success in 6813ms
14
+ DTS dist/index.d.ts 24.01 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @poncho-ai/harness
2
2
 
3
+ ## 0.18.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`cd6ccd7`](https://github.com/cesr/poncho-ai/commit/cd6ccd7846e16fbaf17167617666796320ec29ce) Thanks [@cesr](https://github.com/cesr)! - Add MCP custom headers support, tool:generating streaming feedback, and cross-owner subagent recovery
8
+ - **MCP custom headers**: `poncho mcp add --header "Name: value"` and `headers` config field let servers like Arcade receive extra HTTP headers alongside bearer auth.
9
+ - **tool:generating event**: the harness now emits `tool:generating` events when the model begins writing tool-call arguments, so the web UI shows real-time "preparing <tool>" feedback instead of appearing stuck during large tool calls.
10
+ - **Subagent recovery**: `list`/`listSummaries` accept optional `ownerId` so stale-subagent recovery on server restart scans across all owners.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`cd6ccd7`](https://github.com/cesr/poncho-ai/commit/cd6ccd7846e16fbaf17167617666796320ec29ce)]:
15
+ - @poncho-ai/sdk@1.3.0
16
+
17
+ ## 0.17.0
18
+
19
+ ### Minor Changes
20
+
21
+ - [#16](https://github.com/cesr/poncho-ai/pull/16) [`972577d`](https://github.com/cesr/poncho-ai/commit/972577d255ab43c2c56f3c3464042a8a617b7f9e) Thanks [@cesr](https://github.com/cesr)! - Add subagent support: agents can spawn recursive copies of themselves as independent sub-conversations with blocking tool calls, read-only memory, approval tunneling to the parent thread, and nested sidebar display in the web UI. Also adds ConversationStore.listSummaries() for fast sidebar loading without reading full conversation files from disk.
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [[`972577d`](https://github.com/cesr/poncho-ai/commit/972577d255ab43c2c56f3c3464042a8a617b7f9e)]:
26
+ - @poncho-ai/sdk@1.2.0
27
+
3
28
  ## 0.16.1
4
29
 
5
30
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { Message, ToolDefinition, ToolContext, RunInput, AgentEvent, RunResult, JsonSchema } from '@poncho-ai/sdk';
1
+ import * as _poncho_ai_sdk from '@poncho-ai/sdk';
2
+ import { Message, ToolDefinition, RunResult, AgentFailure, ToolContext, RunInput, AgentEvent, JsonSchema } from '@poncho-ai/sdk';
2
3
  export { ToolDefinition, defineTool } from '@poncho-ai/sdk';
3
4
  import { LanguageModel } from 'ai';
4
5
  import { z } from 'zod';
@@ -96,11 +97,21 @@ interface Conversation {
96
97
  }>;
97
98
  ownerId: string;
98
99
  tenantId: string | null;
100
+ contextTokens?: number;
101
+ contextWindow?: number;
102
+ parentConversationId?: string;
103
+ subagentMeta?: {
104
+ task: string;
105
+ status: "running" | "completed" | "error" | "stopped";
106
+ result?: _poncho_ai_sdk.RunResult;
107
+ error?: _poncho_ai_sdk.AgentFailure;
108
+ };
99
109
  createdAt: number;
100
110
  updatedAt: number;
101
111
  }
102
112
  interface ConversationStore {
103
113
  list(ownerId?: string): Promise<Conversation[]>;
114
+ listSummaries(ownerId?: string): Promise<ConversationSummary[]>;
104
115
  get(conversationId: string): Promise<Conversation | undefined>;
105
116
  create(ownerId?: string, title?: string): Promise<Conversation>;
106
117
  update(conversation: Conversation): Promise<void>;
@@ -132,12 +143,23 @@ declare class InMemoryConversationStore implements ConversationStore {
132
143
  private isExpired;
133
144
  private purgeExpired;
134
145
  list(ownerId?: string): Promise<Conversation[]>;
146
+ listSummaries(ownerId?: string): Promise<ConversationSummary[]>;
135
147
  get(conversationId: string): Promise<Conversation | undefined>;
136
148
  create(ownerId?: string, title?: string): Promise<Conversation>;
137
149
  update(conversation: Conversation): Promise<void>;
138
150
  rename(conversationId: string, title: string): Promise<Conversation | undefined>;
139
151
  delete(conversationId: string): Promise<boolean>;
140
152
  }
153
+ type ConversationSummary = {
154
+ conversationId: string;
155
+ title: string;
156
+ updatedAt: number;
157
+ createdAt?: number;
158
+ ownerId: string;
159
+ parentConversationId?: string;
160
+ messageCount?: number;
161
+ hasPendingApprovals?: boolean;
162
+ };
141
163
  declare const createStateStore: (config?: StateConfig, options?: {
142
164
  workingDir?: string;
143
165
  agentId?: string;
@@ -183,6 +205,7 @@ interface RemoteMcpServerConfig {
183
205
  type: "bearer";
184
206
  tokenEnv?: string;
185
207
  };
208
+ headers?: Record<string, string>;
186
209
  timeoutMs?: number;
187
210
  reconnectAttempts?: number;
188
211
  reconnectDelayMs?: number;
@@ -400,6 +423,30 @@ interface ProviderConfig {
400
423
  */
401
424
  declare const createModelProvider: (provider?: string, config?: ProviderConfig) => ModelProviderFactory;
402
425
 
426
+ interface SubagentResult {
427
+ subagentId: string;
428
+ status: "completed" | "error" | "stopped";
429
+ latestMessages?: Message[];
430
+ result?: RunResult;
431
+ error?: AgentFailure;
432
+ }
433
+ interface SubagentSummary {
434
+ subagentId: string;
435
+ task: string;
436
+ status: string;
437
+ messageCount: number;
438
+ }
439
+ interface SubagentManager {
440
+ spawn(opts: {
441
+ task: string;
442
+ parentConversationId: string;
443
+ ownerId: string;
444
+ }): Promise<SubagentResult>;
445
+ sendMessage(subagentId: string, message: string): Promise<SubagentResult>;
446
+ stop(subagentId: string): Promise<void>;
447
+ list(parentConversationId: string): Promise<SubagentSummary[]>;
448
+ }
449
+
403
450
  interface ToolCall {
404
451
  id: string;
405
452
  name: string;
@@ -456,6 +503,7 @@ declare class AgentHarness {
456
503
  private _browserMod?;
457
504
  private parsedAgent?;
458
505
  private mcpBridge?;
506
+ private subagentManager?;
459
507
  private resolveToolAccess;
460
508
  private isToolEnabled;
461
509
  private registerIfMissing;
@@ -465,6 +513,8 @@ declare class AgentHarness {
465
513
  * Tools disabled via `tools` config are skipped.
466
514
  */
467
515
  registerTools(tools: ToolDefinition[]): void;
516
+ unregisterTools(names: string[]): void;
517
+ setSubagentManager(manager: SubagentManager): void;
468
518
  private registerConfiguredBuiltInTools;
469
519
  private shouldEnableWriteTool;
470
520
  constructor(options?: HarnessOptions);
@@ -490,6 +540,8 @@ declare class AgentHarness {
490
540
  private initBrowserTools;
491
541
  /** Conversation ID of the currently executing run (set during run, cleared after). */
492
542
  private _currentRunConversationId?;
543
+ /** Owner ID of the currently executing run (used by subagent tools). */
544
+ private _currentRunOwnerId?;
493
545
  get browserSession(): unknown;
494
546
  shutdown(): Promise<void>;
495
547
  listTools(): ToolDefinition[];
@@ -515,16 +567,6 @@ declare class AgentHarness {
515
567
  runToCompletion(input: RunInput): Promise<HarnessRunOutput>;
516
568
  }
517
569
 
518
- /**
519
- * Latitude telemetry integration for Vercel AI SDK
520
- *
521
- * TODO: Implement proper Vercel AI SDK telemetry integration using:
522
- * - LatitudeTelemetry.capture() wrapper around streamText()
523
- * - experimental_telemetry: { isEnabled: true } in streamText() options
524
- *
525
- * This requires @latitude-data/telemetry package which has official
526
- * Vercel AI SDK support.
527
- */
528
570
  interface LatitudeCaptureConfig {
529
571
  apiKeyEnv?: string;
530
572
  projectIdEnv?: string;
@@ -532,8 +574,9 @@ interface LatitudeCaptureConfig {
532
574
  defaultPath?: string;
533
575
  }
534
576
  /**
535
- * Placeholder for Latitude telemetry integration
536
- * This will be properly implemented once Vercel AI SDK migration is complete
577
+ * Reads and validates Latitude telemetry configuration from environment
578
+ * variables. The actual telemetry capture is handled by LatitudeTelemetry
579
+ * from @latitude-data/telemetry in harness.ts (via runWithTelemetry).
537
580
  */
538
581
  declare class LatitudeCapture {
539
582
  private readonly apiKey?;
@@ -636,4 +679,6 @@ declare class TelemetryEmitter {
636
679
  private sendOtlp;
637
680
  }
638
681
 
639
- 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 };
682
+ declare const createSubagentTools: (manager: SubagentManager, getConversationId: () => string | undefined, getOwnerId: () => string) => ToolDefinition[];
683
+
684
+ export { type AgentFrontmatter, AgentHarness, type AgentIdentity, type AgentLimitsConfig, type AgentModelConfig, type BuiltInToolToggles, 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, 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 SubagentManager, type SubagentResult, type SubagentSummary, type TelemetryConfig, TelemetryEmitter, type ToolAccess, type ToolCall, ToolDispatcher, type ToolExecutionResult, type UploadStore, type UploadsConfig, VercelBlobUploadStore, buildAgentDirectoryName, buildSkillContextWindow, createConversationStore, createDefaultTools, createMemoryStore, createMemoryTools, createModelProvider, createSkillTools, createStateStore, createSubagentTools, createUploadStore, createWriteTool, deriveUploadKey, ensureAgentIdentity, generateAgentId, getAgentStoreDirectory, getModelContextWindow, getPonchoStoreRoot, jsonSchemaToZod, loadPonchoConfig, loadSkillContext, loadSkillInstructions, loadSkillMetadata, normalizeScriptPolicyPath, parseAgentFile, parseAgentMarkdown, readSkillResource, renderAgentPrompt, resolveAgentIdentity, resolveMemoryConfig, resolveSkillDirs, resolveStateConfig, slugifyStorageComponent };