pi-kot 0.1.28 → 0.1.30

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.
Files changed (41) hide show
  1. package/README.md +51 -0
  2. package/dist/client/assets/index-BaOXsuRp.js +158 -0
  3. package/dist/client/assets/index-BaOXsuRp.js.map +1 -0
  4. package/dist/client/assets/index-t8g65CYx.css +1 -0
  5. package/dist/client/assets/vendor-markdown-DEQqhGsz.js +35 -0
  6. package/dist/client/assets/vendor-markdown-DEQqhGsz.js.map +1 -0
  7. package/dist/client/index.html +4 -4
  8. package/dist/server/contexts/web-ui.md +25 -0
  9. package/dist/server/index.d.ts.map +1 -1
  10. package/dist/server/index.js +2 -0
  11. package/dist/server/index.js.map +1 -1
  12. package/dist/server/routes/artifacts.d.ts +9 -0
  13. package/dist/server/routes/artifacts.d.ts.map +1 -0
  14. package/dist/server/routes/artifacts.js +178 -0
  15. package/dist/server/routes/artifacts.js.map +1 -0
  16. package/dist/server/routes/control.d.ts.map +1 -1
  17. package/dist/server/routes/control.js +102 -13
  18. package/dist/server/routes/control.js.map +1 -1
  19. package/dist/server/routes/exec.d.ts.map +1 -1
  20. package/dist/server/routes/exec.js +44 -30
  21. package/dist/server/routes/exec.js.map +1 -1
  22. package/dist/server/routes/session-extensions.d.ts.map +1 -1
  23. package/dist/server/routes/session-extensions.js +8 -1
  24. package/dist/server/routes/session-extensions.js.map +1 -1
  25. package/dist/server/routes/sessions.d.ts.map +1 -1
  26. package/dist/server/routes/sessions.js +20 -2
  27. package/dist/server/routes/sessions.js.map +1 -1
  28. package/dist/server/session-store.d.ts +4 -12
  29. package/dist/server/session-store.d.ts.map +1 -1
  30. package/dist/server/session-store.js +27 -9
  31. package/dist/server/session-store.js.map +1 -1
  32. package/dist/server/ui-settings-store.d.ts +2 -0
  33. package/dist/server/ui-settings-store.d.ts.map +1 -1
  34. package/dist/server/ui-settings-store.js +6 -0
  35. package/dist/server/ui-settings-store.js.map +1 -1
  36. package/package.json +1 -1
  37. package/dist/client/assets/index-B4KQi2-0.js +0 -158
  38. package/dist/client/assets/index-B4KQi2-0.js.map +0 -1
  39. package/dist/client/assets/index-awAtSW5y.css +0 -1
  40. package/dist/client/assets/vendor-markdown-H08B1Mko.js +0 -35
  41. package/dist/client/assets/vendor-markdown-H08B1Mko.js.map +0 -1
package/README.md CHANGED
@@ -35,6 +35,7 @@ This project was built out of **love and curiosity**.
35
35
  | **🎨 Unified Theme System** | Consistent light/dark theme tokens across panels, modals, inputs, and terminal chrome |
36
36
  | **🔌 Tunnel** | Built-in tunnel helper UI for exposing local pi-kot traffic via supported providers, with install checks, diagnostics, and one-click start/stop |
37
37
  | **📦 Extensions** | Discover and install pi extensions from the UI — some features only appear after installing the right extension |
38
+ | **🎨 Artifacts** | Agent-created HTML, SVG, Mermaid diagrams, and other files render inline in chat via sandboxed previews |
38
39
 
39
40
  ---
40
41
 
@@ -205,6 +206,56 @@ The Git panel shows the current repository's status — modified files, staged c
205
206
 
206
207
  ---
207
208
 
209
+ ## Artifacts
210
+
211
+ pi-kot can render agent-created content inline in chat — HTML pages, SVG images, Mermaid diagrams, and more.
212
+
213
+ ### How it works
214
+
215
+ 1. The agent writes files to `.pi/artifacts/` in your project directory
216
+ 2. Files are served via `/api/v1/artifacts/<filename>`
217
+ 3. The chat renderer detects HTML/SVG/JSON/Markdown content and shows a live preview
218
+
219
+ ### Supported formats
220
+
221
+ | Format | Detection | Preview |
222
+ |---|---|---|
223
+ | **HTML** | `<!DOCTYPE html>`, `<html>`, or ` ```html` | Sandboxed iframe |
224
+ | **SVG** | `<svg>` or ` ```svg` | Sandboxed iframe |
225
+ | **Mermaid** | ` ```mermaid` | Rendered diagram |
226
+ | **Markdown** | ` ```markdown` | Rendered markdown |
227
+ | **JSON** | ` ```json` or valid JSON tool output | Syntax highlighted |
228
+ | **Image** | `data:image/...` or ` ```image` | `<img>` tag |
229
+
230
+ ### Agent context injection
231
+
232
+ pi-kot automatically injects a **web UI context** into every session, telling the agent:
233
+
234
+ - It's running in a browser (not a terminal)
235
+ - To write user-visible files to `.pi/artifacts/` in the current directory
236
+ - To use `/api/v1/artifacts/<filename>` links for previews
237
+ - To use Mermaid instead of ASCII art for diagrams
238
+
239
+ This means the agent will automatically produce web-compatible output when creating diagrams, reports, or interactive content.
240
+
241
+ ### Example
242
+
243
+ Ask the agent:
244
+ > "Create a futuristic button with hover effects"
245
+
246
+ The agent will:
247
+ 1. Write the HTML to `.pi/web/artifacts/button.html`
248
+ 2. Output: `[Live Preview](/api/v1/artifacts/button.html)`
249
+ 3. You see the rendered button inline in chat
250
+
251
+ ### API route
252
+
253
+ | Method | Path | Purpose |
254
+ |---|---|---|
255
+ | `GET` | `/api/v1/artifacts/:filename` | Serve an artifact file (no auth required) |
256
+
257
+ ---
258
+
208
259
  ## Settings
209
260
 
210
261
  Access settings via the **⚙** icon in the header.