my-durable 0.0.0-stage → 0.0.2

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 (259) hide show
  1. package/.env.example +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +328 -2
  4. package/ai_docs/durable_pi/announcement.md +860 -0
  5. package/ai_docs/durable_pi/changelog.md +51 -0
  6. package/ai_docs/durable_pi/chord-delta-findings.md +362 -0
  7. package/ai_docs/durable_pi/coding-agent-integration.md +70 -0
  8. package/ai_docs/durable_pi/pico-v5-chord-usage.md +391 -0
  9. package/ai_docs/durable_pi/pico-v5-handoff.md +921 -0
  10. package/ai_docs/durable_pi/readme.md +617 -0
  11. package/ai_docs/durable_pi/sources.md +22 -0
  12. package/ai_docs/durable_pi/spec.md +4696 -0
  13. package/ai_docs/durable_pi/vacation-planner.md +57 -0
  14. package/ai_docs/pi/chord.md +268 -0
  15. package/ai_docs/pi/cli-integration.md +110 -0
  16. package/ai_docs/pi/cli.md +325 -0
  17. package/ai_docs/pi/codemode.md +211 -0
  18. package/ai_docs/pi/compaction.md +467 -0
  19. package/ai_docs/pi/configuration.md +51 -0
  20. package/ai_docs/pi/containerization.md +187 -0
  21. package/ai_docs/pi/custom-provider.md +177 -0
  22. package/ai_docs/pi/environment-variables.md +102 -0
  23. package/ai_docs/pi/extensions.md +278 -0
  24. package/ai_docs/pi/how-pi-works.md +53 -0
  25. package/ai_docs/pi/index.md +43 -0
  26. package/ai_docs/pi/json.md +230 -0
  27. package/ai_docs/pi/keybindings.md +198 -0
  28. package/ai_docs/pi/llama-cpp.md +118 -0
  29. package/ai_docs/pi/mcp.md +274 -0
  30. package/ai_docs/pi/message-types.md +265 -0
  31. package/ai_docs/pi/models.md +209 -0
  32. package/ai_docs/pi/overview.md +166 -0
  33. package/ai_docs/pi/packages.md +133 -0
  34. package/ai_docs/pi/pi-agent-core.md +568 -0
  35. package/ai_docs/pi/pi-ai.md +1942 -0
  36. package/ai_docs/pi/prompt-templates.md +63 -0
  37. package/ai_docs/pi/providers.md +204 -0
  38. package/ai_docs/pi/quickstart.md +140 -0
  39. package/ai_docs/pi/readme.md +99 -0
  40. package/ai_docs/pi/rpc-commands.md +864 -0
  41. package/ai_docs/pi/rpc-extension-ui.md +204 -0
  42. package/ai_docs/pi/rpc.md +197 -0
  43. package/ai_docs/pi/sdk.md +151 -0
  44. package/ai_docs/pi/security.md +103 -0
  45. package/ai_docs/pi/session-format.md +297 -0
  46. package/ai_docs/pi/sessions.md +70 -0
  47. package/ai_docs/pi/settings.md +173 -0
  48. package/ai_docs/pi/shell-aliases.md +97 -0
  49. package/ai_docs/pi/skills.md +97 -0
  50. package/ai_docs/pi/slash-commands.md +64 -0
  51. package/ai_docs/pi/sources.md +57 -0
  52. package/ai_docs/pi/terminal-setup.md +223 -0
  53. package/ai_docs/pi/termux.md +121 -0
  54. package/ai_docs/pi/themes.md +140 -0
  55. package/ai_docs/pi/tmux.md +59 -0
  56. package/ai_docs/pi/toolkit.md +168 -0
  57. package/ai_docs/pi/tui.md +129 -0
  58. package/ai_docs/pi/usage.md +98 -0
  59. package/ai_docs/pi/virtual-models.md +118 -0
  60. package/ai_docs/pi/windows.md +71 -0
  61. package/apps/dpi-backend/.nvmrc +1 -0
  62. package/apps/dpi-backend/API.md +99 -0
  63. package/apps/dpi-backend/README.md +119 -0
  64. package/apps/dpi-backend/deploy/backend.env.example +9 -0
  65. package/apps/dpi-backend/deploy/dpi-backend.plist +26 -0
  66. package/apps/dpi-backend/deploy/dpi-backend.service +22 -0
  67. package/apps/dpi-backend/package.json +33 -0
  68. package/apps/dpi-backend/prompts/one_sentence.md +3 -0
  69. package/apps/dpi-backend/prompts/smart_ass_opus_fix.md +169 -0
  70. package/apps/dpi-backend/scripts/check-contract.mjs +151 -0
  71. package/apps/dpi-backend/scripts/migrate-playground.ts +66 -0
  72. package/apps/dpi-backend/scripts/record-nested-fixture.mts +154 -0
  73. package/apps/dpi-backend/scripts/token.ts +57 -0
  74. package/apps/dpi-backend/src/addons.ts +139 -0
  75. package/apps/dpi-backend/src/auth.ts +20 -0
  76. package/apps/dpi-backend/src/config.ts +54 -0
  77. package/apps/dpi-backend/src/contract-check.ts +118 -0
  78. package/apps/dpi-backend/src/errors.ts +50 -0
  79. package/apps/dpi-backend/src/extensions.ts +510 -0
  80. package/apps/dpi-backend/src/faux.ts +80 -0
  81. package/apps/dpi-backend/src/history.ts +165 -0
  82. package/apps/dpi-backend/src/idempotency.ts +20 -0
  83. package/apps/dpi-backend/src/jev.ts +43 -0
  84. package/apps/dpi-backend/src/jobs.ts +790 -0
  85. package/apps/dpi-backend/src/main.ts +76 -0
  86. package/apps/dpi-backend/src/model-catalog.ts +180 -0
  87. package/apps/dpi-backend/src/pairing-files.ts +142 -0
  88. package/apps/dpi-backend/src/pairing.ts +459 -0
  89. package/apps/dpi-backend/src/routes.ts +217 -0
  90. package/apps/dpi-backend/src/shared-state.ts +85 -0
  91. package/apps/dpi-backend/src/store.ts +1240 -0
  92. package/apps/dpi-backend/src/streams.ts +256 -0
  93. package/apps/dpi-backend/src/tunnel.ts +955 -0
  94. package/apps/dpi-backend/tsconfig.json +13 -0
  95. package/apps/dpi-playground/README.md +83 -0
  96. package/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/index-CFGc7lHT.js +77 -0
  97. package/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/index-DFdKpwm_.css +1 -0
  98. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/anthropic.png +0 -0
  99. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/deepseek.png +0 -0
  100. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/durable-pi.svg +14 -0
  101. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/gemini.png +0 -0
  102. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/grok.png +0 -0
  103. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/kimi.png +0 -0
  104. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/lab.png +0 -0
  105. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/meta.png +0 -0
  106. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/minimax.png +0 -0
  107. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/openai.png +0 -0
  108. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/qwen.png +0 -0
  109. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/xiaomi.png +0 -0
  110. package/apps/dpi-playground/apps/dpi-playground-fe/dist/icons/zai.png +0 -0
  111. package/apps/dpi-playground/apps/dpi-playground-fe/dist/index.html +16 -0
  112. package/apps/dpi-playground/apps/dpi-playground-fe/index.html +15 -0
  113. package/apps/dpi-playground/apps/dpi-playground-fe/package.json +5 -0
  114. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/anthropic.png +0 -0
  115. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/deepseek.png +0 -0
  116. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/durable-pi.svg +14 -0
  117. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/gemini.png +0 -0
  118. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/grok.png +0 -0
  119. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/kimi.png +0 -0
  120. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/lab.png +0 -0
  121. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/meta.png +0 -0
  122. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/minimax.png +0 -0
  123. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/openai.png +0 -0
  124. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/qwen.png +0 -0
  125. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/xiaomi.png +0 -0
  126. package/apps/dpi-playground/apps/dpi-playground-fe/public/icons/zai.png +0 -0
  127. package/apps/dpi-playground/apps/dpi-playground-fe/src/App.vue +180 -0
  128. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/commands.ts +119 -0
  129. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/composables.ts +129 -0
  130. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/hub.ts +40 -0
  131. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/icon-path.ts +7 -0
  132. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/ids.ts +2 -0
  133. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/jobs.ts +80 -0
  134. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/link-policy.ts +16 -0
  135. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/markdown-policy.ts +115 -0
  136. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/markdown.ts +60 -0
  137. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/pair-close.ts +23 -0
  138. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/pair-handoff.ts +56 -0
  139. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/pair.ts +166 -0
  140. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/qrcode.ts +323 -0
  141. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/signature.ts +146 -0
  142. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/store.ts +373 -0
  143. package/apps/dpi-playground/apps/dpi-playground-fe/src/client/stream.ts +183 -0
  144. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/AgentView.vue +342 -0
  145. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/Composer.vue +198 -0
  146. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/ContextBar.vue +254 -0
  147. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/DeviceCredentialsDialog.vue +40 -0
  148. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/DeviceIcon.vue +56 -0
  149. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/DirBrowser.vue +95 -0
  150. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/ExtensionsPanel.vue +96 -0
  151. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/HelpDialog.vue +69 -0
  152. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/Inspector.vue +425 -0
  153. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/JobCard.vue +221 -0
  154. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/MobileNav.vue +39 -0
  155. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/ModelPicker.vue +71 -0
  156. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/NetworkSidebar.vue +236 -0
  157. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/NewSessionDialog.vue +114 -0
  158. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/OfflinePanel.vue +128 -0
  159. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/PairDeviceWizard.vue +433 -0
  160. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/PromptDialog.vue +89 -0
  161. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/StateEditor.vue +179 -0
  162. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/TasksPanel.vue +280 -0
  163. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/Toast.vue +11 -0
  164. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/TokenManager.vue +175 -0
  165. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/TopBar.vue +114 -0
  166. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/TranscriptItem.vue +152 -0
  167. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/TreeRow.vue +195 -0
  168. package/apps/dpi-playground/apps/dpi-playground-fe/src/components/TunnelStatusBar.vue +107 -0
  169. package/apps/dpi-playground/apps/dpi-playground-fe/src/extensions.css +105 -0
  170. package/apps/dpi-playground/apps/dpi-playground-fe/src/jobs.css +655 -0
  171. package/apps/dpi-playground/apps/dpi-playground-fe/src/main.ts +22 -0
  172. package/apps/dpi-playground/apps/dpi-playground-fe/src/network.css +675 -0
  173. package/apps/dpi-playground/apps/dpi-playground-fe/src/style.css +3203 -0
  174. package/apps/dpi-playground/apps/dpi-playground-fe/tsconfig.json +16 -0
  175. package/apps/dpi-playground/apps/dpi-playground-fe/vite.config.ts +14 -0
  176. package/apps/dpi-playground/apps/dpi-playground-hub/package.json +5 -0
  177. package/apps/dpi-playground/apps/dpi-playground-hub/src/audit.ts +406 -0
  178. package/apps/dpi-playground/apps/dpi-playground-hub/src/client-ip.ts +72 -0
  179. package/apps/dpi-playground/apps/dpi-playground-hub/src/credentials.ts +265 -0
  180. package/apps/dpi-playground/apps/dpi-playground-hub/src/guard.ts +43 -0
  181. package/apps/dpi-playground/apps/dpi-playground-hub/src/http-errors.ts +156 -0
  182. package/apps/dpi-playground/apps/dpi-playground-hub/src/identity.ts +60 -0
  183. package/apps/dpi-playground/apps/dpi-playground-hub/src/limiter.ts +165 -0
  184. package/apps/dpi-playground/apps/dpi-playground-hub/src/main.ts +460 -0
  185. package/apps/dpi-playground/apps/dpi-playground-hub/src/monitor.ts +320 -0
  186. package/apps/dpi-playground/apps/dpi-playground-hub/src/mux.ts +277 -0
  187. package/apps/dpi-playground/apps/dpi-playground-hub/src/pairing.ts +816 -0
  188. package/apps/dpi-playground/apps/dpi-playground-hub/src/proxy.ts +128 -0
  189. package/apps/dpi-playground/apps/dpi-playground-hub/src/rotation.ts +583 -0
  190. package/apps/dpi-playground/apps/dpi-playground-hub/src/seed.ts +11 -0
  191. package/apps/dpi-playground/apps/dpi-playground-hub/src/transport.ts +108 -0
  192. package/apps/dpi-playground/apps/dpi-playground-hub/src/tunnel-token.ts +11 -0
  193. package/apps/dpi-playground/apps/dpi-playground-hub/src/tunnel-transport.ts +560 -0
  194. package/apps/dpi-playground/apps/dpi-playground-hub/src/tunnel.ts +873 -0
  195. package/apps/dpi-playground/apps/dpi-playground-hub/tsconfig.json +13 -0
  196. package/apps/dpi-playground/package.json +37 -0
  197. package/apps/dpi-sdk/README.md +74 -0
  198. package/apps/dpi-sdk/package.json +20 -0
  199. package/apps/dpi-sdk/scripts/net.ts +73 -0
  200. package/apps/dpi-sdk/src/api.ts +631 -0
  201. package/apps/dpi-sdk/src/app-state.ts +111 -0
  202. package/apps/dpi-sdk/src/client.ts +330 -0
  203. package/apps/dpi-sdk/src/errors.ts +16 -0
  204. package/apps/dpi-sdk/src/jobs.ts +99 -0
  205. package/apps/dpi-sdk/src/models.ts +472 -0
  206. package/apps/dpi-sdk/src/node/chunk.ts +488 -0
  207. package/apps/dpi-sdk/src/node/config.ts +175 -0
  208. package/apps/dpi-sdk/src/node/drivers.ts +402 -0
  209. package/apps/dpi-sdk/src/node/ops.ts +114 -0
  210. package/apps/dpi-sdk/src/node/private-dir.ts +48 -0
  211. package/apps/dpi-sdk/src/node/registry-migration.ts +549 -0
  212. package/apps/dpi-sdk/src/node/registry.ts +390 -0
  213. package/apps/dpi-sdk/src/node/sse-writer.ts +151 -0
  214. package/apps/dpi-sdk/src/protocol/backoff.ts +31 -0
  215. package/apps/dpi-sdk/src/protocol/limits.ts +199 -0
  216. package/apps/dpi-sdk/src/protocol/pairing.ts +311 -0
  217. package/apps/dpi-sdk/src/protocol/rest-routes.ts +105 -0
  218. package/apps/dpi-sdk/src/protocol/tunnel.ts +331 -0
  219. package/apps/dpi-sdk/src/sse.ts +117 -0
  220. package/apps/dpi-sdk/src/transcript.ts +291 -0
  221. package/apps/dpi-sdk/tsconfig.json +13 -0
  222. package/apps/dpi-sdk/w +20 -0
  223. package/apps/dpi-tui/README.md +54 -0
  224. package/apps/dpi-tui/bin/dpi-tui.mjs +5 -0
  225. package/apps/dpi-tui/package.json +20 -0
  226. package/apps/dpi-tui/src/app.ts +433 -0
  227. package/apps/dpi-tui/src/commands.ts +151 -0
  228. package/apps/dpi-tui/src/main.ts +122 -0
  229. package/apps/dpi-tui/src/pairing.ts +287 -0
  230. package/apps/dpi-tui/src/pickers.ts +238 -0
  231. package/apps/dpi-tui/src/render.ts +164 -0
  232. package/apps/dpi-tui/src/theme.ts +57 -0
  233. package/apps/dpi-tui/tsconfig.json +14 -0
  234. package/bin/device.mjs +5 -0
  235. package/bin/hub.mjs +5 -0
  236. package/bin/tui.mjs +5 -0
  237. package/deploy/Caddyfile +120 -0
  238. package/docs/verification.md +102 -0
  239. package/dpi-network.example.yaml +62 -0
  240. package/images/01_durable_agent_network.svg +185 -0
  241. package/images/02_pi_made_durable.svg +204 -0
  242. package/images/03_restart_mid_tool.svg +168 -0
  243. package/images/07_one_api_every_client.svg +123 -0
  244. package/images/08_device_session_agent.svg +123 -0
  245. package/images/09_compact_keep_history.svg +143 -0
  246. package/images/10_shared_app_state.svg +177 -0
  247. package/images/11_durable_jobs_wait.svg +141 -0
  248. package/images/12_tools_change_mid_run.svg +231 -0
  249. package/images/13_hook_blocks_tool.svg +122 -0
  250. package/images/14_fork_at_any_entry.svg +119 -0
  251. package/images/15_web_client.png +0 -0
  252. package/images/16_terminal_client.svg +43 -0
  253. package/images/17_devices_are_data.svg +182 -0
  254. package/images/18_should_every_agent_be_durable.svg +118 -0
  255. package/images/19_sqlite_on_every_device.svg +155 -0
  256. package/images/20_admission_and_effects.svg +134 -0
  257. package/justfile +33 -0
  258. package/package.json +41 -4
  259. package/scripts/verify.mjs +210 -0
@@ -0,0 +1,864 @@
1
+ > Source: [packages/coding-agent/docs/rpc-commands.md](https://github.com/earendil-works/pi/blob/b78e6a9085343ec0f308c3d377da72528b4cf7ee/packages/coding-agent/docs/rpc-commands.md)
2
+ > Retrieved with Firecrawl: 2026-10-05. Repository snapshot: `b78e6a9085343ec0f308c3d377da72528b4cf7ee`.
3
+ > Relative documentation links point to local copies where available, otherwise to the source snapshot.
4
+
5
+ # RPC Commands
6
+
7
+ This reference lists commands accepted on stdin in [RPC mode](rpc.md). Each command and response is one JSON object. Shared message values use the [message types](message-types.md).
8
+
9
+ ## Prompting
10
+
11
+ ### prompt
12
+
13
+ Send a user prompt to the agent. The command response is emitted after the prompt is accepted, queued, or handled. Events continue streaming asynchronously after acceptance.
14
+
15
+ ```json
16
+ {"id": "req-1", "type": "prompt", "message": "Hello, world!"}
17
+ ```
18
+
19
+ With images:
20
+ ```json
21
+ {"type": "prompt", "message": "What's in this image?", "images": [{"type": "image", "data": "base64-encoded-data", "mimeType": "image/png"}]}
22
+ ```
23
+
24
+ **During streaming**: If the agent is already streaming, you must specify `streamingBehavior` to queue the message:
25
+
26
+ ```json
27
+ {"type": "prompt", "message": "New instruction", "streamingBehavior": "steer"}
28
+ ```
29
+
30
+ - `"steer"`: Queue the message while the agent is running. It is delivered after the current assistant turn finishes executing its tool calls, before the next LLM call.
31
+ - `"followUp"`: Wait until the agent finishes. Message is delivered only when agent stops.
32
+
33
+ If the agent is streaming and no `streamingBehavior` is specified, the command returns an error.
34
+
35
+ **Extension commands**: If the message is an extension command (e.g., `/mycommand`), it executes immediately even during streaming. Extension commands manage their own LLM interaction via `pi.sendMessage()`.
36
+
37
+ **Input expansion**: Skill commands (`/skill:name`) and prompt templates (`/template`) are expanded before sending/queueing.
38
+
39
+ Response:
40
+ ```json
41
+ {"id": "req-1", "type": "response", "command": "prompt", "success": true, "data": {"disposition": "started"}}
42
+ ```
43
+
44
+ `data.disposition` is `"handled"` if an extension command or input handler consumed the prompt, `"queued"` if Pi queued it during a run, or `"started"` if Pi accepted it to start a run. This describes the submitted prompt, not independent work started by an extension or a guarantee of completion.
45
+
46
+ `success: true` means the prompt was accepted, queued, or handled immediately. `success: false` means the prompt was rejected before acceptance. Failures after acceptance are reported through the normal event and message stream, not as a second `response` for the same request id.
47
+
48
+ The `images` field is optional. Each image uses `ImageContent` format: `{"type": "image", "data": "base64-encoded-data", "mimeType": "image/png"}`.
49
+
50
+ ### steer
51
+
52
+ Queue a steering message while the agent is running. It is delivered after the current assistant turn finishes executing its tool calls, before the next LLM call. Skill commands and prompt templates are expanded. Extension commands are not allowed (use `prompt` instead).
53
+
54
+ ```json
55
+ {"type": "steer", "message": "Stop and do this instead"}
56
+ ```
57
+
58
+ With images:
59
+ ```json
60
+ {"type": "steer", "message": "Look at this instead", "images": [{"type": "image", "data": "base64-encoded-data", "mimeType": "image/png"}]}
61
+ ```
62
+
63
+ The `images` field is optional. Each image uses `ImageContent` format (same as `prompt`).
64
+
65
+ Response:
66
+ ```json
67
+ {"type": "response", "command": "steer", "success": true, "data": {"disposition": "queued"}}
68
+ ```
69
+
70
+ `data.disposition` is `"handled"` if an input handler consumed this steer, or `"queued"` if Pi queued it (including after a handler transformed it). It does not guarantee this message remains queued.
71
+
72
+ See [set_steering_mode](#set_steering_mode) for controlling how steering messages are processed.
73
+
74
+ ### follow_up
75
+
76
+ Queue a follow-up message to be processed after the agent finishes. Delivered only when agent has no more tool calls or steering messages. Skill commands and prompt templates are expanded. Extension commands are not allowed (use `prompt` instead).
77
+
78
+ ```json
79
+ {"type": "follow_up", "message": "After you're done, also do this"}
80
+ ```
81
+
82
+ With images:
83
+ ```json
84
+ {"type": "follow_up", "message": "Also check this image", "images": [{"type": "image", "data": "base64-encoded-data", "mimeType": "image/png"}]}
85
+ ```
86
+
87
+ The `images` field is optional. Each image uses `ImageContent` format (same as `prompt`).
88
+
89
+ Response:
90
+ ```json
91
+ {"type": "response", "command": "follow_up", "success": true, "data": {"disposition": "queued"}}
92
+ ```
93
+
94
+ `data.disposition` has the same `"handled"` or `"queued"` meaning as for `steer`, applied to this follow-up.
95
+
96
+ See [set_follow_up_mode](#set_follow_up_mode) for controlling how follow-up messages are processed.
97
+
98
+ ### abort
99
+
100
+ Abort the current operation and wait for the session to become idle before responding.
101
+
102
+ ```json
103
+ {"type": "abort"}
104
+ ```
105
+
106
+ Response:
107
+ ```json
108
+ {"type": "response", "command": "abort", "success": true}
109
+ ```
110
+
111
+ ### clear_queue
112
+
113
+ Remove queued steering and follow-up messages and return their text.
114
+
115
+ ```json
116
+ {"type": "clear_queue"}
117
+ ```
118
+
119
+ Response:
120
+ ```json
121
+ {
122
+ "type": "response",
123
+ "command": "clear_queue",
124
+ "success": true,
125
+ "data": {
126
+ "steering": ["Change direction"],
127
+ "followUp": ["Summarize when finished"]
128
+ }
129
+ }
130
+ ```
131
+
132
+ To implement interactive Esc behavior, send `clear_queue` before `abort`, then restore the returned text in the client editor. `abort` continues queued messages when they remain in the session.
133
+
134
+ ### new_session
135
+
136
+ Start a fresh session. Can be canceled by a `session_before_switch` extension event handler.
137
+
138
+ ```json
139
+ {"type": "new_session"}
140
+ ```
141
+
142
+ With optional parent session tracking:
143
+ ```json
144
+ {"type": "new_session", "parentSession": "/path/to/parent-session.jsonl"}
145
+ ```
146
+
147
+ Response:
148
+ ```json
149
+ {"type": "response", "command": "new_session", "success": true, "data": {"cancelled": false}}
150
+ ```
151
+
152
+ If an extension canceled:
153
+ ```json
154
+ {"type": "response", "command": "new_session", "success": true, "data": {"cancelled": true}}
155
+ ```
156
+
157
+ ## State
158
+
159
+ ### get_state
160
+
161
+ Get current session state.
162
+
163
+ ```json
164
+ {"type": "get_state"}
165
+ ```
166
+
167
+ Response:
168
+ ```json
169
+ {
170
+ "type": "response",
171
+ "command": "get_state",
172
+ "success": true,
173
+ "data": {
174
+ "model": {...},
175
+ "thinkingLevel": "medium",
176
+ "isStreaming": false,
177
+ "isCompacting": false,
178
+ "steeringMode": "all",
179
+ "followUpMode": "one-at-a-time",
180
+ "sessionFile": "/path/to/session.jsonl",
181
+ "sessionId": "abc123",
182
+ "sessionName": "my-feature-work",
183
+ "autoCompactionEnabled": true,
184
+ "messageCount": 5,
185
+ "pendingMessageCount": 0
186
+ }
187
+ }
188
+ ```
189
+
190
+ The `model` field is a full [Model](#model-object) object, or omitted when no model is selected. The `sessionName` field is the display name set via `set_session_name`, or omitted if not set.
191
+
192
+ ### get_messages
193
+
194
+ Get all messages in the conversation.
195
+
196
+ ```json
197
+ {"type": "get_messages"}
198
+ ```
199
+
200
+ Response:
201
+ ```json
202
+ {
203
+ "type": "response",
204
+ "command": "get_messages",
205
+ "success": true,
206
+ "data": {"messages": [...]}
207
+ }
208
+ ```
209
+
210
+ Messages are `AgentMessage` objects (see [Message Types](message-types.md)).
211
+
212
+ ## Model
213
+
214
+ ### set_model
215
+
216
+ Switch to a specific model.
217
+
218
+ ```json
219
+ {"type": "set_model", "provider": "anthropic", "modelId": "claude-sonnet-4-20250514"}
220
+ ```
221
+
222
+ Response contains the full [Model](#model-object) object:
223
+ ```json
224
+ {
225
+ "type": "response",
226
+ "command": "set_model",
227
+ "success": true,
228
+ "data": {...}
229
+ }
230
+ ```
231
+
232
+ ### cycle_model
233
+
234
+ Cycle to the next available model. Returns `null` data if only one model available.
235
+
236
+ ```json
237
+ {"type": "cycle_model"}
238
+ ```
239
+
240
+ Response:
241
+ ```json
242
+ {
243
+ "type": "response",
244
+ "command": "cycle_model",
245
+ "success": true,
246
+ "data": {
247
+ "model": {...},
248
+ "thinkingLevel": "medium",
249
+ "isScoped": false
250
+ }
251
+ }
252
+ ```
253
+
254
+ The `model` field is a full [Model](#model-object) object.
255
+
256
+ ### get_available_models
257
+
258
+ List all configured models.
259
+
260
+ ```json
261
+ {"type": "get_available_models"}
262
+ ```
263
+
264
+ Response contains an array of full [Model](#model-object) objects:
265
+ ```json
266
+ {
267
+ "type": "response",
268
+ "command": "get_available_models",
269
+ "success": true,
270
+ "data": {
271
+ "models": [...]
272
+ }
273
+ }
274
+ ```
275
+
276
+ ## Thinking
277
+
278
+ ### set_thinking_level
279
+
280
+ Set the reasoning/thinking level for models that support it.
281
+
282
+ ```json
283
+ {"type": "set_thinking_level", "level": "high"}
284
+ ```
285
+
286
+ Levels: `"off"`, `"minimal"`, `"low"`, `"medium"`, `"high"`, `"xhigh"`, `"max"`
287
+
288
+ `"xhigh"` and `"max"` are exposed only when supported by the selected model. Some models, including GPT-5.6, expose both.
289
+
290
+ Response:
291
+ ```json
292
+ {"type": "response", "command": "set_thinking_level", "success": true}
293
+ ```
294
+
295
+ ### cycle_thinking_level
296
+
297
+ Cycle through available thinking levels. Returns `null` data if model doesn't support thinking.
298
+
299
+ ```json
300
+ {"type": "cycle_thinking_level"}
301
+ ```
302
+
303
+ Response:
304
+ ```json
305
+ {
306
+ "type": "response",
307
+ "command": "cycle_thinking_level",
308
+ "success": true,
309
+ "data": {"level": "high"}
310
+ }
311
+ ```
312
+
313
+ ### get_available_thinking_levels
314
+
315
+ List the thinking levels supported by the current model. Returns `["off"]` for a model without reasoning support.
316
+
317
+ ```json
318
+ {"type": "get_available_thinking_levels"}
319
+ ```
320
+
321
+ Response:
322
+ ```json
323
+ {
324
+ "type": "response",
325
+ "command": "get_available_thinking_levels",
326
+ "success": true,
327
+ "data": {
328
+ "levels": ["off", "minimal", "low", "medium", "high"]
329
+ }
330
+ }
331
+ ```
332
+
333
+ ## Queue modes
334
+
335
+ ### set_steering_mode
336
+
337
+ Control how steering messages (from `steer`) are delivered.
338
+
339
+ ```json
340
+ {"type": "set_steering_mode", "mode": "one-at-a-time"}
341
+ ```
342
+
343
+ Modes:
344
+ - `"all"`: Deliver all steering messages after the current assistant turn finishes executing its tool calls
345
+ - `"one-at-a-time"`: Deliver one steering message per completed assistant turn (default)
346
+
347
+ Response:
348
+ ```json
349
+ {"type": "response", "command": "set_steering_mode", "success": true}
350
+ ```
351
+
352
+ ### set_follow_up_mode
353
+
354
+ Control how follow-up messages (from `follow_up`) are delivered.
355
+
356
+ ```json
357
+ {"type": "set_follow_up_mode", "mode": "one-at-a-time"}
358
+ ```
359
+
360
+ Modes:
361
+ - `"all"`: Deliver all follow-up messages when agent finishes
362
+ - `"one-at-a-time"`: Deliver one follow-up message per agent completion (default)
363
+
364
+ Response:
365
+ ```json
366
+ {"type": "response", "command": "set_follow_up_mode", "success": true}
367
+ ```
368
+
369
+ ## Compaction
370
+
371
+ ### compact
372
+
373
+ Manually compact conversation context to reduce token usage.
374
+
375
+ ```json
376
+ {"type": "compact"}
377
+ ```
378
+
379
+ With custom instructions:
380
+ ```json
381
+ {"type": "compact", "customInstructions": "Focus on code changes"}
382
+ ```
383
+
384
+ Response:
385
+ ```json
386
+ {
387
+ "type": "response",
388
+ "command": "compact",
389
+ "success": true,
390
+ "data": {
391
+ "summary": "Summary of conversation...",
392
+ "firstKeptEntryId": "abc123",
393
+ "tokensBefore": 150000,
394
+ "estimatedTokensAfter": 32000,
395
+ "usage": {
396
+ "input": 32000,
397
+ "output": 1200,
398
+ "cacheRead": 0,
399
+ "cacheWrite": 0,
400
+ "totalTokens": 33200,
401
+ "cost": {"input": 0.01, "output": 0.02, "cacheRead": 0, "cacheWrite": 0, "total": 0.03}
402
+ },
403
+ "details": {}
404
+ }
405
+ }
406
+ ```
407
+
408
+ `estimatedTokensAfter` is a heuristic estimate over the rebuilt message context immediately after compaction, not a provider-exact token count. `usage` reports the LLM call or calls that generated the summary and may be omitted by custom compaction handlers.
409
+
410
+ ### set_auto_compaction
411
+
412
+ Enable or disable automatic compaction when context is nearly full.
413
+
414
+ ```json
415
+ {"type": "set_auto_compaction", "enabled": true}
416
+ ```
417
+
418
+ Response:
419
+ ```json
420
+ {"type": "response", "command": "set_auto_compaction", "success": true}
421
+ ```
422
+
423
+ ## Retry
424
+
425
+ ### set_auto_retry
426
+
427
+ Enable or disable automatic retry on transient errors (overloaded, rate limit, 5xx).
428
+
429
+ ```json
430
+ {"type": "set_auto_retry", "enabled": true}
431
+ ```
432
+
433
+ Response:
434
+ ```json
435
+ {"type": "response", "command": "set_auto_retry", "success": true}
436
+ ```
437
+
438
+ ### abort_retry
439
+
440
+ Abort an in-progress retry (cancel the delay and stop retrying).
441
+
442
+ ```json
443
+ {"type": "abort_retry"}
444
+ ```
445
+
446
+ Response:
447
+ ```json
448
+ {"type": "response", "command": "abort_retry", "success": true}
449
+ ```
450
+
451
+ ## Bash
452
+
453
+ ### bash
454
+
455
+ Execute a shell command and add output to conversation context. Output streams as `bash_execution_update` events while the command runs; the response contains the final result.
456
+
457
+ ```json
458
+ {"id": "req-1", "type": "bash", "command": "ls -la"}
459
+ ```
460
+
461
+ Set `excludeFromContext` to `true` when the command output should be stored in the session but omitted from the model context on the next prompt.
462
+
463
+ Include an `id` to associate streamed `bash_execution_update` events with this command.
464
+
465
+ Response:
466
+ ```json
467
+ {
468
+ "id": "req-1",
469
+ "type": "response",
470
+ "command": "bash",
471
+ "success": true,
472
+ "data": {
473
+ "output": "total 48\ndrwxr-xr-x ...",
474
+ "exitCode": 0,
475
+ "cancelled": false,
476
+ "truncated": false
477
+ }
478
+ }
479
+ ```
480
+
481
+ If output was truncated, includes `fullOutputPath`:
482
+ ```json
483
+ {
484
+ "type": "response",
485
+ "command": "bash",
486
+ "success": true,
487
+ "data": {
488
+ "output": "truncated output...",
489
+ "exitCode": 0,
490
+ "cancelled": false,
491
+ "truncated": true,
492
+ "fullOutputPath": "/tmp/pi-bash-abc123.log"
493
+ }
494
+ }
495
+ ```
496
+
497
+ **How bash results reach the LLM:**
498
+
499
+ The `bash` command executes immediately and returns a `BashResult`. Internally, a `BashExecutionMessage` is created and stored in the agent's message state.
500
+
501
+ When the next `prompt` command is sent, Pi transforms context messages before sending them to the model. Unless `excludeFromContext` is true, the `BashExecutionMessage` becomes a `UserMessage` with this format:
502
+
503
+ ````
504
+ Ran `ls -la`
505
+ ```
506
+ total 48
507
+ drwxr-xr-x ...
508
+ ```
509
+ ````
510
+
511
+ This means:
512
+ 1. Included bash output reaches the model on the **next prompt**, not immediately.
513
+ 2. Multiple bash commands can run before a prompt; Pi includes each output that does not set `excludeFromContext`.
514
+
515
+ ### abort_bash
516
+
517
+ Abort a running bash command.
518
+
519
+ ```json
520
+ {"type": "abort_bash"}
521
+ ```
522
+
523
+ Response:
524
+ ```json
525
+ {"type": "response", "command": "abort_bash", "success": true}
526
+ ```
527
+
528
+ ## Session
529
+
530
+ ### get_session_stats
531
+
532
+ Get token usage, cost statistics, and current context window usage.
533
+
534
+ ```json
535
+ {"type": "get_session_stats"}
536
+ ```
537
+
538
+ Response:
539
+ ```json
540
+ {
541
+ "type": "response",
542
+ "command": "get_session_stats",
543
+ "success": true,
544
+ "data": {
545
+ "sessionFile": "/path/to/session.jsonl",
546
+ "sessionId": "abc123",
547
+ "userMessages": 5,
548
+ "assistantMessages": 5,
549
+ "toolCalls": 12,
550
+ "toolResults": 12,
551
+ "totalMessages": 22,
552
+ "tokens": {
553
+ "input": 50000,
554
+ "output": 10000,
555
+ "cacheRead": 40000,
556
+ "cacheWrite": 5000,
557
+ "total": 105000
558
+ },
559
+ "cost": 0.45,
560
+ "contextUsage": {
561
+ "tokens": 60000,
562
+ "contextWindow": 200000,
563
+ "percent": 30
564
+ }
565
+ }
566
+ }
567
+ ```
568
+
569
+ `tokens` and `cost` include assistant messages, usage reported by tools, and compaction/branch-summary generation across the full session. `contextUsage` contains the actual current context-window estimate used for compaction and footer display.
570
+
571
+ `contextUsage` is omitted when no model or context window is available. `contextUsage.tokens` and `contextUsage.percent` are `null` immediately after compaction until a fresh post-compaction assistant response provides valid usage data.
572
+
573
+ ### export_html
574
+
575
+ Export session to an HTML file.
576
+
577
+ ```json
578
+ {"type": "export_html"}
579
+ ```
580
+
581
+ With custom path:
582
+ ```json
583
+ {"type": "export_html", "outputPath": "/tmp/session.html"}
584
+ ```
585
+
586
+ Response:
587
+ ```json
588
+ {
589
+ "type": "response",
590
+ "command": "export_html",
591
+ "success": true,
592
+ "data": {"path": "/tmp/session.html"}
593
+ }
594
+ ```
595
+
596
+ ### switch_session
597
+
598
+ Load a different session file. Can be canceled by a `session_before_switch` extension event handler.
599
+
600
+ ```json
601
+ {"type": "switch_session", "sessionPath": "/path/to/session.jsonl"}
602
+ ```
603
+
604
+ Response:
605
+ ```json
606
+ {"type": "response", "command": "switch_session", "success": true, "data": {"cancelled": false}}
607
+ ```
608
+
609
+ If an extension canceled the switch:
610
+ ```json
611
+ {"type": "response", "command": "switch_session", "success": true, "data": {"cancelled": true}}
612
+ ```
613
+
614
+ ### fork
615
+
616
+ Create a new fork from a previous user message on the active branch. Can be canceled by a `session_before_fork` extension event handler. Returns the text of the message being forked from.
617
+
618
+ ```json
619
+ {"type": "fork", "entryId": "abc123"}
620
+ ```
621
+
622
+ Response:
623
+ ```json
624
+ {
625
+ "type": "response",
626
+ "command": "fork",
627
+ "success": true,
628
+ "data": {"text": "The original prompt text...", "cancelled": false}
629
+ }
630
+ ```
631
+
632
+ If an extension canceled the fork:
633
+ ```json
634
+ {
635
+ "type": "response",
636
+ "command": "fork",
637
+ "success": true,
638
+ "data": {"cancelled": true}
639
+ }
640
+ ```
641
+
642
+ ### clone
643
+
644
+ Duplicate the current active branch into a new session at the current position. Can be canceled by a `session_before_fork` extension event handler.
645
+
646
+ ```json
647
+ {"type": "clone"}
648
+ ```
649
+
650
+ Response:
651
+ ```json
652
+ {
653
+ "type": "response",
654
+ "command": "clone",
655
+ "success": true,
656
+ "data": {"cancelled": false}
657
+ }
658
+ ```
659
+
660
+ If an extension canceled the clone:
661
+ ```json
662
+ {
663
+ "type": "response",
664
+ "command": "clone",
665
+ "success": true,
666
+ "data": {"cancelled": true}
667
+ }
668
+ ```
669
+
670
+ ### get_fork_messages
671
+
672
+ Get user messages available for forking.
673
+
674
+ ```json
675
+ {"type": "get_fork_messages"}
676
+ ```
677
+
678
+ Response:
679
+ ```json
680
+ {
681
+ "type": "response",
682
+ "command": "get_fork_messages",
683
+ "success": true,
684
+ "data": {
685
+ "messages": [
686
+ {"entryId": "abc123", "text": "First prompt..."},
687
+ {"entryId": "def456", "text": "Second prompt..."}
688
+ ]
689
+ }
690
+ }
691
+ ```
692
+
693
+ ### get_entries
694
+
695
+ Get all session entries in append order (excluding the session header). The session is an append-only tree of entries with stable ids, so an entry id works as a durable cursor: pass the last entry id you have seen as `since` to get only entries strictly after it, even across client restarts. Unlike `get_messages`, this includes pre-compaction history and abandoned branches.
696
+
697
+ ```json
698
+ {"type": "get_entries"}
699
+ ```
700
+
701
+ With a cursor:
702
+ ```json
703
+ {"type": "get_entries", "since": "abc123"}
704
+ ```
705
+
706
+ Response:
707
+ ```json
708
+ {
709
+ "type": "response",
710
+ "command": "get_entries",
711
+ "success": true,
712
+ "data": {
713
+ "entries": [
714
+ {"type": "message", "id": "def456", "parentId": "abc123", "timestamp": "...", "message": {"role": "user", "...": "..."}}
715
+ ],
716
+ "leafId": "def456"
717
+ }
718
+ }
719
+ ```
720
+
721
+ `leafId` is the id of the current leaf entry (`null` for an empty session), so a client can tell in one round trip whether the active branch moved. If `since` does not match any entry id, the response is `success: false`.
722
+
723
+ ### get_tree
724
+
725
+ Get the session as a tree of entries. Each node is `{entry, children, label?, labelTimestamp?}`. The result is an array because navigation APIs can create multiple roots; orphaned entries with broken parent chains also appear as roots.
726
+
727
+ ```json
728
+ {"type": "get_tree"}
729
+ ```
730
+
731
+ Response:
732
+ ```json
733
+ {
734
+ "type": "response",
735
+ "command": "get_tree",
736
+ "success": true,
737
+ "data": {
738
+ "tree": [
739
+ {
740
+ "entry": {"type": "message", "id": "abc123", "parentId": null, "...": "..."},
741
+ "children": [
742
+ {"entry": {"type": "message", "id": "def456", "parentId": "abc123", "...": "..."}, "children": []}
743
+ ]
744
+ }
745
+ ],
746
+ "leafId": "def456"
747
+ }
748
+ }
749
+ ```
750
+
751
+ ### get_last_assistant_text
752
+
753
+ Get the text content of the last assistant message.
754
+
755
+ ```json
756
+ {"type": "get_last_assistant_text"}
757
+ ```
758
+
759
+ Response:
760
+ ```json
761
+ {
762
+ "type": "response",
763
+ "command": "get_last_assistant_text",
764
+ "success": true,
765
+ "data": {"text": "The assistant's response..."}
766
+ }
767
+ ```
768
+
769
+ The `text` value is `null` if no assistant text exists.
770
+
771
+ ### set_session_name
772
+
773
+ Set a display name for the current session. The name appears in session listings and helps identify sessions.
774
+
775
+ ```json
776
+ {"type": "set_session_name", "name": "my-feature-work"}
777
+ ```
778
+
779
+ Response:
780
+ ```json
781
+ {
782
+ "type": "response",
783
+ "command": "set_session_name",
784
+ "success": true
785
+ }
786
+ ```
787
+
788
+ The current session name is available via `get_state` in the `sessionName` field. To set the initial name when starting RPC mode, pass `--name <name>` or `-n <name>` to the `pi --mode rpc` process.
789
+
790
+ ## Discoverable commands
791
+
792
+ ### get_commands
793
+
794
+ Get available commands (extension commands, prompt templates, and skills). Run one through the `prompt` command by prefixing its name with `/`.
795
+
796
+ ```json
797
+ {"type": "get_commands"}
798
+ ```
799
+
800
+ Response:
801
+ ```json
802
+ {
803
+ "type": "response",
804
+ "command": "get_commands",
805
+ "success": true,
806
+ "data": {
807
+ "commands": [
808
+ {
809
+ "name": "fix-tests",
810
+ "description": "Fix failing tests",
811
+ "source": "prompt",
812
+ "sourceInfo": {
813
+ "path": "/home/user/myproject/.pi/agent/prompts/fix-tests.md",
814
+ "source": "local",
815
+ "scope": "project",
816
+ "origin": "top-level"
817
+ }
818
+ }
819
+ ]
820
+ }
821
+ }
822
+ ```
823
+
824
+ Each command has:
825
+ - `name`: Command name (use `/name`)
826
+ - `description`: Human-readable description (optional for extension commands)
827
+ - `source`: What kind of command:
828
+ - `"extension"`: Registered via `pi.registerCommand()` in an extension
829
+ - `"prompt"`: Loaded from a prompt template `.md` file
830
+ - `"skill"`: Loaded from a skill directory (name is prefixed with `skill:`)
831
+ - `sourceInfo`: Metadata for the resource that registered the command:
832
+ - `path`: Absolute path to the resource
833
+ - `source`: How Pi discovered it, such as `"local"`, `"auto"`, or `"cli"`
834
+ - `scope`: `"user"`, `"project"`, or `"temporary"`
835
+ - `origin`: `"top-level"` for a directly loaded resource or `"package"` for a package resource
836
+ - `baseDir`: Package base directory, when applicable
837
+
838
+ **Note**: Built-in TUI commands (`/settings`, `/hotkeys`, etc.) are not included. They are handled only in interactive mode and would not execute if sent via `prompt`.
839
+
840
+ ## Model object
841
+
842
+ Model commands return the complete configured model definition. Costs are in US dollars per million tokens.
843
+
844
+ ```json
845
+ {
846
+ "id": "claude-sonnet-4-20250514",
847
+ "name": "Claude Sonnet 4",
848
+ "api": "anthropic-messages",
849
+ "provider": "anthropic",
850
+ "baseUrl": "https://api.anthropic.com",
851
+ "reasoning": true,
852
+ "input": ["text", "image"],
853
+ "contextWindow": 200000,
854
+ "maxTokens": 16384,
855
+ "cost": {
856
+ "input": 3.0,
857
+ "output": 15.0,
858
+ "cacheRead": 0.3,
859
+ "cacheWrite": 3.75
860
+ }
861
+ }
862
+ ```
863
+
864
+ For model configuration, see [Configure a compatible endpoint](models.md#configure-a-compatible-endpoint). For TypeScript, use the exported `Model` type from `@earendil-works/pi-ai`.