@poncho-ai/sdk 1.9.0 → 1.10.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.9.0 build /home/runner/work/poncho-ai/poncho-ai/packages/sdk
2
+ > @poncho-ai/sdk@1.10.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 17.24 KB
11
- ESM ⚡️ Build success in 23ms
11
+ ESM ⚡️ Build success in 21ms
12
12
  DTS Build start
13
- DTS ⚡️ Build success in 1448ms
14
- DTS dist/index.d.ts 27.76 KB
13
+ DTS ⚡️ Build success in 1318ms
14
+ DTS dist/index.d.ts 28.29 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # @poncho-ai/sdk
2
2
 
3
+ ## 1.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#104](https://github.com/cesr/poncho-ai/pull/104) [`9616060`](https://github.com/cesr/poncho-ai/commit/96160607502c2c0b05bc60b67b8fc012f4052ef1) Thanks [@cesr](https://github.com/cesr)! - dev: add a Files mode to the sidebar with VFS browsing, preview, and uploads
8
+
9
+ The web UI sidebar now has a Chats / Files segmented control. Switching to
10
+ Files reveals a folder-tree view of the agent's VFS — the same storage the
11
+ agent reads and writes via `read_file`, `write_file`, and the virtualized
12
+ `bash` tool. Folders expand inline with the same caret/dropdown pattern as
13
+ the Cron jobs section. Clicking a file previews it in the main panel:
14
+ - Text / JSON / source code render as a wrapped `<pre>` (5 MB cap), with an Edit button for inline editing (last-write-wins via PUT).
15
+ - Images render inline.
16
+ - PDFs render in an embedded iframe.
17
+ - Audio and video render with native controls.
18
+ - Anything else shows a placeholder card with a Download button.
19
+
20
+ Files can be added directly from the UI: an Upload button (multi-file
21
+ picker), drag-and-drop onto the explorer or onto a specific folder row, and
22
+ a New folder button. Files and folders are deletable via a hover-X with a
23
+ two-step confirm. Conflicts prompt to overwrite. Four new HTTP routes back
24
+ this UI: `GET /api/vfs-list`, `PUT /api/vfs/{path}`, `DELETE /api/vfs/{path}`,
25
+ and `POST /api/vfs-mkdir`. URLs of the form `/f/{path}` deep-link to a file
26
+ preview; the chat composer is hidden while previewing a file.
27
+
28
+ The same routes are exposed on `AgentClient` for programmatic use:
29
+ `listDir`, `writeFile`, `deleteFile`, and `mkdir` (alongside the existing
30
+ `readFile`). New shared types `ApiVfsEntry`, `ApiVfsListResponse`, and
31
+ `ApiVfsWriteResponse` are exported from `@poncho-ai/sdk`.
32
+
33
+ ### Patch Changes
34
+
35
+ - [`524df41`](https://github.com/cesr/poncho-ai/commit/524df411904bd00c07901695eda6d4dd07dde972) Thanks [@cesr](https://github.com/cesr)! - fix: persist harness messages on cancelled runs so the agent doesn't lose context
36
+
37
+ When a run was cancelled (Stop button, abort signal), `conversation.messages`
38
+ was updated with the partial assistant turn but `conversation._harnessMessages`
39
+ — the canonical history `loadCanonicalHistory` hands to the model on the next
40
+ turn — was left holding a snapshot from the _previous_ successful run. The
41
+ agent had no memory of the cancelled work, even though the user-facing UI
42
+ still showed it. The new verbose-mode harness toggle made this divergence
43
+ directly visible.
44
+
45
+ The fix plumbs an in-flight `messages` snapshot through the `run:cancelled`
46
+ event, trims it to a model-valid prefix (no orphan `tool_use`), and persists
47
+ it as `_harnessMessages` on every cancel path in the CLI.
48
+
3
49
  ## 1.9.0
4
50
 
5
51
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -595,6 +595,27 @@ interface ApiSlashCommand {
595
595
  description: string;
596
596
  type: "command" | "skill";
597
597
  }
598
+ interface ApiVfsEntry {
599
+ name: string;
600
+ type: "file" | "directory" | "symlink";
601
+ size: number;
602
+ mimeType: string | null;
603
+ updatedAt: number | null;
604
+ }
605
+ interface ApiVfsListResponse {
606
+ path: string;
607
+ entries: ApiVfsEntry[];
608
+ usage: {
609
+ fileCount: number;
610
+ totalBytes: number;
611
+ };
612
+ }
613
+ interface ApiVfsWriteResponse {
614
+ path: string;
615
+ size: number;
616
+ mimeType: string | null;
617
+ updatedAt: number;
618
+ }
598
619
 
599
620
  declare const LEVELS: {
600
621
  readonly debug: 10;
@@ -770,6 +791,7 @@ type AgentEvent = {
770
791
  } | {
771
792
  type: "run:cancelled";
772
793
  runId: string;
794
+ messages?: Message[];
773
795
  } | {
774
796
  type: "run:error";
775
797
  runId: string;
@@ -888,4 +910,4 @@ type AgentEvent = {
888
910
  reason: string;
889
911
  };
890
912
 
891
- export { type AgentEvent, type AgentFailure, type ApiApprovalResponse, type ApiCompactResponse, type ApiCreateThreadRequest, type ApiCreateThreadResponse, type ApiSecretEntry, type ApiSlashCommand, type ApiStopRunResponse, type ApiSubagentSummary, type ApiThreadListResponse, type ApiThreadSummary, type ContentPart, FEATURE_DOMAIN_ORDER, type FeatureDomain, type FileContentPart, type FileInput, type JsonSchema, type Logger, 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, type VfsAccess, createLogger, defineTool, fieldsForScope, formatError, getTextContent, muted, num, setLogLevel, url };
913
+ export { type AgentEvent, type AgentFailure, type ApiApprovalResponse, type ApiCompactResponse, type ApiCreateThreadRequest, type ApiCreateThreadResponse, type ApiSecretEntry, type ApiSlashCommand, type ApiStopRunResponse, type ApiSubagentSummary, type ApiThreadListResponse, type ApiThreadSummary, type ApiVfsEntry, type ApiVfsListResponse, type ApiVfsWriteResponse, type ContentPart, FEATURE_DOMAIN_ORDER, type FeatureDomain, type FileContentPart, type FileInput, type JsonSchema, type Logger, 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, type VfsAccess, createLogger, defineTool, fieldsForScope, formatError, getTextContent, muted, num, setLogLevel, url };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poncho-ai/sdk",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "description": "Core types and utilities for building Poncho skills",
5
5
  "repository": {
6
6
  "type": "git",
package/src/api-types.ts CHANGED
@@ -75,3 +75,24 @@ export interface ApiSlashCommand {
75
75
  description: string;
76
76
  type: "command" | "skill";
77
77
  }
78
+
79
+ export interface ApiVfsEntry {
80
+ name: string;
81
+ type: "file" | "directory" | "symlink";
82
+ size: number;
83
+ mimeType: string | null;
84
+ updatedAt: number | null;
85
+ }
86
+
87
+ export interface ApiVfsListResponse {
88
+ path: string;
89
+ entries: ApiVfsEntry[];
90
+ usage: { fileCount: number; totalBytes: number };
91
+ }
92
+
93
+ export interface ApiVfsWriteResponse {
94
+ path: string;
95
+ size: number;
96
+ mimeType: string | null;
97
+ updatedAt: number;
98
+ }
package/src/index.ts CHANGED
@@ -166,7 +166,7 @@ export interface AgentFailure {
166
166
  export type AgentEvent =
167
167
  | { type: "run:started"; runId: string; agentId: string; contextWindow?: number }
168
168
  | { type: "run:completed"; runId: string; result: RunResult; pendingSubagents?: boolean }
169
- | { type: "run:cancelled"; runId: string }
169
+ | { type: "run:cancelled"; runId: string; messages?: Message[] }
170
170
  | { type: "run:error"; runId: string; error: AgentFailure }
171
171
  | { type: "step:started"; step: number }
172
172
  | { type: "step:completed"; step: number; duration: number }