@poncho-ai/sdk 1.4.1 → 1.6.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/sdk@1.4.1 build /Users/cesar/Dev/latitude/poncho-ai/packages/sdk
2
+ > @poncho-ai/sdk@1.6.0 build /home/runner/work/poncho-ai/poncho-ai/packages/sdk
3
3
  > tsup src/index.ts --format esm --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,7 +8,7 @@
8
8
  CLI Target: es2022
9
9
  ESM Build start
10
10
  ESM dist/index.js 11.44 KB
11
- ESM ⚡️ Build success in 42ms
11
+ ESM ⚡️ Build success in 21ms
12
12
  DTS Build start
13
- DTS ⚡️ Build success in 922ms
14
- DTS dist/index.d.ts 21.50 KB
13
+ DTS ⚡️ Build success in 1333ms
14
+ DTS dist/index.d.ts 22.16 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @poncho-ai/sdk
2
2
 
3
+ ## 1.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#42](https://github.com/cesr/poncho-ai/pull/42) [`e58a984`](https://github.com/cesr/poncho-ai/commit/e58a984efaa673b649318102bbf735fb4c2f9172) Thanks [@cesr](https://github.com/cesr)! - Add continuation model and fire-and-forget subagents
8
+
9
+ **Continuation model**: Agents no longer send a synthetic `"Continue"` user message between steps. Instead, the harness injects a transient signal when needed, and the full internal message chain is preserved across continuations so the LLM never loses context. `RunInput` gains `disableSoftDeadline` and `RunResult` gains `continuationMessages`.
10
+
11
+ **Fire-and-forget subagents**: Subagents now run asynchronously in the background. `spawn_subagent` returns immediately with a subagent ID; results are delivered back to the parent conversation as a callback once the subagent completes. Subagents cannot spawn their own subagents. The web UI shows results in a collapsible disclosure and reconnects the live event stream automatically when the parent agent resumes.
12
+
13
+ **Bug fixes**:
14
+ - Fixed a race condition where concurrent runs on the same harness instance could assign a subagent or browser tab to the wrong parent conversation (shared `_currentRunConversationId` field replaced with per-run `ToolContext.conversationId`).
15
+ - Fixed Upstash KV store silently dropping large values by switching from URL-path encoding to request body format for `SET`/`SETEX` commands.
16
+ - Fixed empty assistant content blocks causing Anthropic `text content blocks must be non-empty` errors.
17
+
18
+ **Client**: Added `getConversationStatus()` and `waitForSubagents` option on `sendMessage()`.
19
+
20
+ ## 1.5.0
21
+
22
+ ### Minor Changes
23
+
24
+ - [`6f0abfd`](https://github.com/cesr/poncho-ai/commit/6f0abfd9f729b545cf293741ee813f705910aaf3) Thanks [@cesr](https://github.com/cesr)! - Add context compaction for long conversations. Automatically summarizes older messages when the context window fills up, keeping conversations going indefinitely. Includes auto-compaction in the run loop, `/compact` command, Web UI divider with expandable summary, and visual history preservation.
25
+
3
26
  ## 1.4.1
4
27
 
5
28
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -529,6 +529,7 @@ interface Message {
529
529
  type: "text" | "tools";
530
530
  content: string | string[];
531
531
  }>;
532
+ isCompactionSummary?: boolean;
532
533
  };
533
534
  }
534
535
  /** Extract the text content from a message, regardless of content format. */
@@ -569,6 +570,8 @@ interface RunInput {
569
570
  abortSignal?: AbortSignal;
570
571
  /** When set, Latitude telemetry groups all turns in this conversation under a single trace. */
571
572
  conversationId?: string;
573
+ /** When true, ignores PONCHO_MAX_DURATION soft deadline (used for background subagent runs). */
574
+ disableSoftDeadline?: boolean;
572
575
  }
573
576
  interface TokenUsage {
574
577
  input: number;
@@ -582,6 +585,8 @@ interface RunResult {
582
585
  tokens: TokenUsage;
583
586
  duration: number;
584
587
  continuation?: boolean;
588
+ /** Full message chain from the harness run (populated when continuation=true). */
589
+ continuationMessages?: Message[];
585
590
  maxSteps?: number;
586
591
  }
587
592
  interface AgentFailure {
@@ -598,6 +603,7 @@ type AgentEvent = {
598
603
  type: "run:completed";
599
604
  runId: string;
600
605
  result: RunResult;
606
+ pendingSubagents?: boolean;
601
607
  } | {
602
608
  type: "run:cancelled";
603
609
  runId: string;
@@ -701,6 +707,21 @@ type AgentEvent = {
701
707
  tool: string;
702
708
  approvalId: string;
703
709
  input?: Record<string, unknown>;
710
+ } | {
711
+ type: "compaction:started";
712
+ estimatedTokens: number;
713
+ } | {
714
+ type: "compaction:completed";
715
+ tokensBefore: number;
716
+ tokensAfter: number;
717
+ messagesBefore: number;
718
+ messagesAfter: number;
719
+ compactedMessages?: Message[];
720
+ } | {
721
+ type: "subagents:pending";
722
+ } | {
723
+ type: "compaction:warning";
724
+ reason: string;
704
725
  };
705
726
 
706
727
  export { type AgentEvent, type AgentFailure, type ContentPart, FEATURE_DOMAIN_ORDER, type FeatureDomain, type FileContentPart, type FileInput, type JsonSchema, type Message, ONBOARDING_FIELDS, type OnboardingField, type OnboardingFieldCondition, type OnboardingFieldKind, type OnboardingFieldTarget, type OnboardingOption, type OnboardingScope, type Role, type RunInput, type RunResult, type TextContentPart, type TokenUsage, type ToolContext, type ToolDefinition, type ToolHandler, defineTool, fieldsForScope, getTextContent };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poncho-ai/sdk",
3
- "version": "1.4.1",
3
+ "version": "1.6.0",
4
4
  "description": "Core types and utilities for building Poncho skills",
5
5
  "repository": {
6
6
  "type": "git",
package/src/index.ts CHANGED
@@ -36,6 +36,7 @@ export interface Message {
36
36
  step?: number;
37
37
  toolActivity?: string[];
38
38
  sections?: Array<{ type: "text" | "tools"; content: string | string[] }>;
39
+ isCompactionSummary?: boolean;
39
40
  };
40
41
  }
41
42
 
@@ -101,6 +102,8 @@ export interface RunInput {
101
102
  abortSignal?: AbortSignal;
102
103
  /** When set, Latitude telemetry groups all turns in this conversation under a single trace. */
103
104
  conversationId?: string;
105
+ /** When true, ignores PONCHO_MAX_DURATION soft deadline (used for background subagent runs). */
106
+ disableSoftDeadline?: boolean;
104
107
  }
105
108
 
106
109
  export interface TokenUsage {
@@ -116,6 +119,8 @@ export interface RunResult {
116
119
  tokens: TokenUsage;
117
120
  duration: number;
118
121
  continuation?: boolean;
122
+ /** Full message chain from the harness run (populated when continuation=true). */
123
+ continuationMessages?: Message[];
119
124
  maxSteps?: number;
120
125
  }
121
126
 
@@ -127,7 +132,7 @@ export interface AgentFailure {
127
132
 
128
133
  export type AgentEvent =
129
134
  | { type: "run:started"; runId: string; agentId: string; contextWindow?: number }
130
- | { type: "run:completed"; runId: string; result: RunResult }
135
+ | { type: "run:completed"; runId: string; result: RunResult; pendingSubagents?: boolean }
131
136
  | { type: "run:cancelled"; runId: string }
132
137
  | { type: "run:error"; runId: string; error: AgentFailure }
133
138
  | { type: "step:started"; step: number }
@@ -176,4 +181,15 @@ export type AgentEvent =
176
181
  tool: string;
177
182
  approvalId: string;
178
183
  input?: Record<string, unknown>;
179
- };
184
+ }
185
+ | { type: "compaction:started"; estimatedTokens: number }
186
+ | {
187
+ type: "compaction:completed";
188
+ tokensBefore: number;
189
+ tokensAfter: number;
190
+ messagesBefore: number;
191
+ messagesAfter: number;
192
+ compactedMessages?: Message[];
193
+ }
194
+ | { type: "subagents:pending" }
195
+ | { type: "compaction:warning"; reason: string };
@@ -1,6 +0,0 @@
1
-
2
- > @poncho-ai/sdk@0.6.0 lint /Users/cesar/Dev/latitude/poncho-ai/packages/sdk
3
- > eslint src/
4
-
5
- sh: eslint: command not found
6
-  ELIFECYCLE  Command failed.
@@ -1,14 +0,0 @@
1
-
2
- > @poncho-ai/sdk@1.1.1 test /Users/cesar/Dev/latitude/poncho-ai/packages/sdk
3
- > vitest
4
-
5
-
6
-  RUN  v1.6.1 /Users/cesar/Dev/latitude/poncho-ai/packages/sdk
7
-
8
- ✓ test/sdk.test.ts  (1 test) 3ms
9
-
10
-  Test Files  1 passed (1)
11
-  Tests  1 passed (1)
12
-  Start at  17:47:36
13
-  Duration  992ms (transform 343ms, setup 0ms, collect 429ms, tests 3ms, environment 0ms, prepare 129ms)
14
-