@poncho-ai/cli 0.38.1 → 0.40.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/cli@0.38.1 build /home/runner/work/poncho-ai/poncho-ai/packages/cli
2
+ > @poncho-ai/cli@0.40.0 build /home/runner/work/poncho-ai/poncho-ai/packages/cli
3
3
  > tsup src/index.ts src/cli.ts --format esm --dts
4
4
 
5
5
  CLI Building entry: src/cli.ts, src/index.ts
@@ -9,10 +9,10 @@
9
9
  ESM Build start
10
10
  ESM dist/cli.js 94.00 B
11
11
  ESM dist/index.js 3.10 KB
12
- ESM dist/run-interactive-ink-UKPUGCDW.js 23.38 KB
13
- ESM dist/chunk-W7SQVUB4.js 601.92 KB
14
- ESM ⚡️ Build success in 79ms
12
+ ESM dist/run-interactive-ink-LJTKUUV4.js 23.38 KB
13
+ ESM dist/chunk-KVGMTYDD.js 674.92 KB
14
+ ESM ⚡️ Build success in 84ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 4135ms
16
+ DTS ⚡️ Build success in 4409ms
17
17
  DTS dist/cli.d.ts 20.00 B
18
- DTS dist/index.d.ts 13.24 KB
18
+ DTS dist/index.d.ts 13.25 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,175 @@
1
1
  # @poncho-ai/cli
2
2
 
3
+ ## 0.40.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`496b684`](https://github.com/cesr/poncho-ai/commit/496b6848288cab564e0ff617495f5c34f5c07702) Thanks [@cesr](https://github.com/cesr)! - cli: add `poncho build railway` deploy target
8
+
9
+ Scaffolds `Dockerfile`, `server.js`, and `railway.toml` for deploying a
10
+ poncho agent to Railway. The `railway.toml` pins the builder to
11
+ `dockerfile`, so Railway doesn't fall back to Nixpacks (which misreads
12
+ `pnpm-workspace.yaml` and missing lockfiles, then fails the build before
13
+ producing useful logs — a common gotcha when migrating from Vercel).
14
+ Also accepts `railway` as a `DeployTarget` in the onboarding flow and
15
+ documents the new target in the README and AGENT.md template.
16
+
17
+ ### Patch Changes
18
+
19
+ - [`496b684`](https://github.com/cesr/poncho-ai/commit/496b6848288cab564e0ff617495f5c34f5c07702) Thanks [@cesr](https://github.com/cesr)! - cli: fix `poncho build` Dockerfile scaffolds for docker/railway/fly
20
+
21
+ Three issues with the scaffolded Dockerfiles:
22
+ 1. **Base image was `node:20-slim`**, but `isolated-vm@6.1.2` (used by
23
+ the bash sandbox / `run_code`) only ships prebuilt binaries for Node
24
+ 22+ ABIs. On Node 20, npm fell back to compiling from source, which
25
+ fails because the C++ code references `v8::SourceLocation` — a V8 12
26
+ API not present in Node 20's V8 11. Bumped to `node:22-slim`.
27
+ 2. **Server entrypoint couldn't find `@poncho-ai/cli`.** The Dockerfile
28
+ ran `npm install -g @poncho-ai/cli` but `server.js` does
29
+ `import { startDevServer } from "@poncho-ai/cli"`. Globally installed
30
+ packages aren't on Node's ESM resolution path without `NODE_PATH`,
31
+ so the import failed at runtime. Replaced with `npm install --omit=dev`
32
+ so the CLI (and any other deps in the user's `package.json`) is
33
+ installed locally in `/app/node_modules`.
34
+ 3. **Browser tools didn't work.** When `browser: true` is set in
35
+ `poncho.config.js`, Playwright needs system Chromium libs that
36
+ `node:22-slim` doesn't include. The scaffold now detects browser
37
+ config and conditionally adds an `apt-get install` layer with the
38
+ required libs (`libnss3`, `libxkbcommon0`, etc.) — only when needed,
39
+ so users without browser keep a lean image.
40
+
41
+ Also reordered `COPY package.json` + `RUN npm install` to run before
42
+ copying app code, so `npm install` is cached across edits to `AGENT.md`,
43
+ skills, and tests.
44
+
45
+ ## 0.39.0
46
+
47
+ ### Minor Changes
48
+
49
+ - [`48a52a2`](https://github.com/cesr/poncho-ai/commit/48a52a24831d5a4001d5c04939d37292c91b200f) Thanks [@cesr](https://github.com/cesr)! - feat(web-ui): expose persistent agent memory as `/memory.md` in the Files tree
50
+
51
+ The agent's per-tenant persistent memory document — previously only reachable
52
+ through the `memory_main_get` / `memory_main_write` / `memory_main_edit` tools
53
+ — now appears as a virtual file `memory.md` at the root of the Files mode.
54
+ Clicking it uses the existing markdown preview/edit UX: read inline, click
55
+ Edit to open the textarea, Save to persist. Reading and writing both go
56
+ through `engine.memory` (not the VFS), so changes the agent makes via tools
57
+ and changes a user makes through the UI see the same document.
58
+
59
+ The five VFS routes short-circuit on the path `/memory.md`:
60
+ `GET` reads from `engine.memory`, `PUT` writes (trimmed, mirroring
61
+ `memory_main_write` semantics), `DELETE` returns 400 RESERVED, `vfs-list`
62
+ splices the synthetic entry into the root listing, and `vfs-archive`
63
+ includes it in root-archive downloads. `vfs-mkdir` rejects the path.
64
+
65
+ - [#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
66
+
67
+ The web UI sidebar now has a Chats / Files segmented control. Switching to
68
+ Files reveals a folder-tree view of the agent's VFS — the same storage the
69
+ agent reads and writes via `read_file`, `write_file`, and the virtualized
70
+ `bash` tool. Folders expand inline with the same caret/dropdown pattern as
71
+ the Cron jobs section. Clicking a file previews it in the main panel:
72
+ - Text / JSON / source code render as a wrapped `<pre>` (5 MB cap), with an Edit button for inline editing (last-write-wins via PUT).
73
+ - Images render inline.
74
+ - PDFs render in an embedded iframe.
75
+ - Audio and video render with native controls.
76
+ - Anything else shows a placeholder card with a Download button.
77
+
78
+ Files can be added directly from the UI: an Upload button (multi-file
79
+ picker), drag-and-drop onto the explorer or onto a specific folder row, and
80
+ a New folder button. Files and folders are deletable via a hover-X with a
81
+ two-step confirm. Conflicts prompt to overwrite. Four new HTTP routes back
82
+ this UI: `GET /api/vfs-list`, `PUT /api/vfs/{path}`, `DELETE /api/vfs/{path}`,
83
+ and `POST /api/vfs-mkdir`. URLs of the form `/f/{path}` deep-link to a file
84
+ preview; the chat composer is hidden while previewing a file.
85
+
86
+ The same routes are exposed on `AgentClient` for programmatic use:
87
+ `listDir`, `writeFile`, `deleteFile`, and `mkdir` (alongside the existing
88
+ `readFile`). New shared types `ApiVfsEntry`, `ApiVfsListResponse`, and
89
+ `ApiVfsWriteResponse` are exported from `@poncho-ai/sdk`.
90
+
91
+ - [#105](https://github.com/cesr/poncho-ai/pull/105) [`e127174`](https://github.com/cesr/poncho-ai/commit/e12717415b1114c5e9a58e7c51fcf9e038218f9f) Thanks [@cesr](https://github.com/cesr)! - feat: tenant-authored skills in the VFS
92
+
93
+ Tenants can now author skills in their VFS at `/skills/<name>/SKILL.md`
94
+ (plus sibling files such as `scripts/*.ts` and `references/*.md`). VFS
95
+ skills are merged with the agent's repo skills per-tenant when building
96
+ the `<available_skills>` block in the system prompt; repo skills win on
97
+ name collision (a warning is logged for the dropped VFS skill).
98
+
99
+ VFS skills can ship runnable scripts in their tree (`scripts/foo.ts`
100
+ etc.); the agent runs them via the existing `run_code` tool with
101
+ `file: "/skills/<name>/scripts/foo.ts"`, which executes in the sandboxed
102
+ isolated-vm runtime. `run_skill_script` remains for repo-shipped skills
103
+ only (jiti, full Node access), and returns a clear redirect when
104
+ called against a VFS skill. The agent's tool-policy lookups still
105
+ resolve against repo skills only, so tenants cannot grant themselves
106
+ new MCP tools by uploading a SKILL.md (security boundary).
107
+
108
+ `run_code` is enhanced so skill-authored scripts feel natural:
109
+ - Accepts top-level `export const run = ...`, `export default function ...`,
110
+ and `export default <expr>;` (the keyword is stripped at strip-TypeScript
111
+ time; `export default <expr>` becomes a `__default` binding).
112
+ - New optional `input` parameter, exposed inside the script as the global
113
+ `__input`.
114
+ - If the script defines a top-level `run` / `default` / `main` / `handler`
115
+ function and doesn't `return` on its own, the dispatcher invokes that
116
+ function with `__input` and returns its result. Existing
117
+ return-style scripts are unaffected.
118
+
119
+ The CLI Files sidebar already exposes the VFS, so creating a tenant
120
+ skill is just writing to `/skills/...` from the UI or via the agent's
121
+ own VFS write tools — the harness invalidates its per-tenant skill
122
+ cache on writes under `/skills/`.
123
+
124
+ ### Patch Changes
125
+
126
+ - [`fe55b69`](https://github.com/cesr/poncho-ai/commit/fe55b69a348f530e30d9f6998ddb00666b65a983) Thanks [@cesr](https://github.com/cesr)! - dev: add a `user ↔ harness` message toggle to the web UI in verbose mode
127
+
128
+ When `poncho dev` is run with `-v`, the web UI now shows a small `user`
129
+ toggle button in the topbar. Clicking it switches the message area
130
+ between the user-facing rendering and a raw view of `_harnessMessages` —
131
+ the actual message stream sent to the model API, with role,
132
+ runId/step/id metadata, and pretty-printed JSON content. Useful for
133
+ debugging context construction, tool-call shape, and what the model
134
+ actually sees turn-by-turn. Hidden entirely outside `-v` mode.
135
+
136
+ - [`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
137
+
138
+ When a run was cancelled (Stop button, abort signal), `conversation.messages`
139
+ was updated with the partial assistant turn but `conversation._harnessMessages`
140
+ — the canonical history `loadCanonicalHistory` hands to the model on the next
141
+ turn — was left holding a snapshot from the _previous_ successful run. The
142
+ agent had no memory of the cancelled work, even though the user-facing UI
143
+ still showed it. The new verbose-mode harness toggle made this divergence
144
+ directly visible.
145
+
146
+ The fix plumbs an in-flight `messages` snapshot through the `run:cancelled`
147
+ event, trims it to a model-valid prefix (no orphan `tool_use`), and persists
148
+ it as `_harnessMessages` on every cancel path in the CLI.
149
+
150
+ - [`45c71dc`](https://github.com/cesr/poncho-ai/commit/45c71dcc7ef6af24039c1302769a519671da59c2) Thanks [@cesr](https://github.com/cesr)! - fix(cli): strip large payloads and cap size on the SSE replay buffer
151
+
152
+ The per-conversation event buffer in `broadcastEvent` only excluded
153
+ `browser:frame` events from being retained for replay. But `tool:completed`
154
+ events for `browser_screenshot` carry the full ~134KB base64 JPEG in
155
+ `output.screenshot.data`, and `step:completed` / large tool outputs can be
156
+ similarly heavy. Across a long browser-heavy session these accumulated in
157
+ `stream.buffer` until the dev server OOM'd at ~3.7-3.8 GB heap.
158
+
159
+ Two changes:
160
+ 1. Before pushing into the replay buffer, deep-strip any string > 4 KB
161
+ (replaced with `[stripped-for-replay len=N]`). Live SSE subscribers still
162
+ get the full event in real-time; only the replay buffer (used when a
163
+ client reconnects mid-conversation) holds the stripped copy. A
164
+ reconnecting client that wants the full screenshot can refetch the
165
+ conversation from disk.
166
+ 2. Cap the buffer at the most recent 1000 events per conversation.
167
+
168
+ - Updated dependencies [[`d24c152`](https://github.com/cesr/poncho-ai/commit/d24c152c1ecb9bfe59b086cb1f18a5ab43688223), [`8de45a7`](https://github.com/cesr/poncho-ai/commit/8de45a7ac434fa928ae3b83deec52727073d4658), [`524df41`](https://github.com/cesr/poncho-ai/commit/524df411904bd00c07901695eda6d4dd07dde972), [`8e410a1`](https://github.com/cesr/poncho-ai/commit/8e410a15b246a2b129fded8d1c06b98878e5fd07), [`e127174`](https://github.com/cesr/poncho-ai/commit/e12717415b1114c5e9a58e7c51fcf9e038218f9f), [`9616060`](https://github.com/cesr/poncho-ai/commit/96160607502c2c0b05bc60b67b8fc012f4052ef1), [`2792d84`](https://github.com/cesr/poncho-ai/commit/2792d8448b304bf748f926ce42a91c76f37edf79), [`e127174`](https://github.com/cesr/poncho-ai/commit/e12717415b1114c5e9a58e7c51fcf9e038218f9f)]:
169
+ - @poncho-ai/harness@0.40.0
170
+ - @poncho-ai/sdk@1.10.0
171
+ - @poncho-ai/messaging@0.8.5
172
+
3
173
  ## 0.38.1
4
174
 
5
175
  ### Patch Changes