@code-yeongyu/senpi 2026.9.9 → 2026.9.10

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 (1065) hide show
  1. package/CHANGELOG.md +82 -1
  2. package/README.md +2 -0
  3. package/dist/beta/omo-local-update-worker.js.map +1 -1
  4. package/dist/beta/omo-local-update.d.ts.map +1 -1
  5. package/dist/brand-dir-migration.js.map +1 -1
  6. package/dist/cli/args.d.ts.map +1 -1
  7. package/dist/cli/args.js +1 -0
  8. package/dist/cli/args.js.map +1 -1
  9. package/dist/cli/auth-check.js.map +1 -1
  10. package/dist/cli/experimental/command.d.ts.map +1 -1
  11. package/dist/cli/grok-neo-gate.js.map +1 -1
  12. package/dist/cli/startup-ui.js.map +1 -1
  13. package/dist/cli.js.map +1 -1
  14. package/dist/client/remote-session.d.ts.map +1 -1
  15. package/dist/client/remote-session.js.map +1 -1
  16. package/dist/config.d.ts.map +1 -1
  17. package/dist/config.js +43 -19
  18. package/dist/config.js.map +1 -1
  19. package/dist/core/agent-abort-provenance.d.ts.map +1 -1
  20. package/dist/core/agent-session-runtime.d.ts.map +1 -1
  21. package/dist/core/agent-session-runtime.js.map +1 -1
  22. package/dist/core/agent-session.d.ts +46 -7
  23. package/dist/core/agent-session.d.ts.map +1 -1
  24. package/dist/core/agent-session.js +109 -6
  25. package/dist/core/agent-session.js.map +1 -1
  26. package/dist/core/agent-settled-delivery.d.ts.map +1 -1
  27. package/dist/core/auth-providers.js.map +1 -1
  28. package/dist/core/auth-storage.d.ts.map +1 -1
  29. package/dist/core/auth-storage.js.map +1 -1
  30. package/dist/core/brand.js.map +1 -1
  31. package/dist/core/compaction/branch-summarization.js.map +1 -1
  32. package/dist/core/compaction/compaction.js.map +1 -1
  33. package/dist/core/compaction/lifecycle.d.ts.map +1 -1
  34. package/dist/core/compaction/stream-watchdog.d.ts.map +1 -1
  35. package/dist/core/compaction/utils.js.map +1 -1
  36. package/dist/core/credential-accounts.js.map +1 -1
  37. package/dist/core/credential-pool/classify.js.map +1 -1
  38. package/dist/core/credential-pool/failover.d.ts.map +1 -1
  39. package/dist/core/credential-pool/rotation-stream.js.map +1 -1
  40. package/dist/core/credential-pool/state-store.d.ts +2 -2
  41. package/dist/core/credential-pool/state-store.d.ts.map +1 -1
  42. package/dist/core/credential-pool/state-store.js.map +1 -1
  43. package/dist/core/dynamic-prompt/verification.d.ts.map +1 -1
  44. package/dist/core/edited-assistant-message.d.ts +24 -0
  45. package/dist/core/edited-assistant-message.d.ts.map +1 -0
  46. package/dist/core/edited-assistant-message.js +57 -0
  47. package/dist/core/edited-assistant-message.js.map +1 -0
  48. package/dist/core/experimental.d.ts.map +1 -1
  49. package/dist/core/extensions/builtin/ask-user/extension.d.ts +3 -0
  50. package/dist/core/extensions/builtin/ask-user/extension.d.ts.map +1 -0
  51. package/dist/core/extensions/builtin/ask-user/extension.js +47 -0
  52. package/dist/core/extensions/builtin/ask-user/extension.js.map +1 -0
  53. package/dist/core/extensions/builtin/ask-user/family.d.ts +8 -0
  54. package/dist/core/extensions/builtin/ask-user/family.d.ts.map +1 -0
  55. package/dist/core/extensions/builtin/ask-user/family.js +6 -0
  56. package/dist/core/extensions/builtin/ask-user/family.js.map +1 -0
  57. package/dist/core/extensions/builtin/ask-user/format.d.ts +22 -0
  58. package/dist/core/extensions/builtin/ask-user/format.d.ts.map +1 -0
  59. package/dist/core/extensions/builtin/ask-user/format.js +109 -0
  60. package/dist/core/extensions/builtin/ask-user/format.js.map +1 -0
  61. package/dist/core/extensions/builtin/ask-user/index.d.ts +4 -0
  62. package/dist/core/extensions/builtin/ask-user/index.d.ts.map +1 -0
  63. package/dist/core/extensions/builtin/ask-user/index.js +4 -0
  64. package/dist/core/extensions/builtin/ask-user/index.js.map +1 -0
  65. package/dist/core/extensions/builtin/ask-user/params.d.ts +27 -0
  66. package/dist/core/extensions/builtin/ask-user/params.d.ts.map +1 -0
  67. package/dist/core/extensions/builtin/ask-user/params.js +78 -0
  68. package/dist/core/extensions/builtin/ask-user/params.js.map +1 -0
  69. package/dist/core/extensions/builtin/ask-user/pending.d.ts +58 -0
  70. package/dist/core/extensions/builtin/ask-user/pending.d.ts.map +1 -0
  71. package/dist/core/extensions/builtin/ask-user/pending.js +130 -0
  72. package/dist/core/extensions/builtin/ask-user/pending.js.map +1 -0
  73. package/dist/core/extensions/builtin/ask-user/registry.d.ts +21 -0
  74. package/dist/core/extensions/builtin/ask-user/registry.d.ts.map +1 -0
  75. package/dist/core/extensions/builtin/ask-user/registry.js +20 -0
  76. package/dist/core/extensions/builtin/ask-user/registry.js.map +1 -0
  77. package/dist/core/extensions/builtin/ask-user/render.d.ts +4 -0
  78. package/dist/core/extensions/builtin/ask-user/render.d.ts.map +1 -0
  79. package/dist/core/extensions/builtin/ask-user/render.js +25 -0
  80. package/dist/core/extensions/builtin/ask-user/render.js.map +1 -0
  81. package/dist/core/extensions/builtin/ask-user/resume.d.ts +4 -0
  82. package/dist/core/extensions/builtin/ask-user/resume.d.ts.map +1 -0
  83. package/dist/core/extensions/builtin/ask-user/resume.js +85 -0
  84. package/dist/core/extensions/builtin/ask-user/resume.js.map +1 -0
  85. package/dist/core/extensions/builtin/ask-user/schema.d.ts +40 -0
  86. package/dist/core/extensions/builtin/ask-user/schema.d.ts.map +1 -0
  87. package/dist/core/extensions/builtin/ask-user/schema.js +102 -0
  88. package/dist/core/extensions/builtin/ask-user/schema.js.map +1 -0
  89. package/dist/core/extensions/builtin/ask-user/tool.d.ts +8 -0
  90. package/dist/core/extensions/builtin/ask-user/tool.d.ts.map +1 -0
  91. package/dist/core/extensions/builtin/ask-user/tool.js +195 -0
  92. package/dist/core/extensions/builtin/ask-user/tool.js.map +1 -0
  93. package/dist/core/extensions/builtin/bash-timeout/timeout.js.map +1 -1
  94. package/dist/core/extensions/builtin/btw/panel.d.ts.map +1 -1
  95. package/dist/core/extensions/builtin/btw/side-query.js.map +1 -1
  96. package/dist/core/extensions/builtin/cache-keepalive/index.d.ts.map +1 -1
  97. package/dist/core/extensions/builtin/cache-keepalive/index.js.map +1 -1
  98. package/dist/core/extensions/builtin/claude-sdk-oauth/account-command.js.map +1 -1
  99. package/dist/core/extensions/builtin/claude-sdk-oauth/account-management.js.map +1 -1
  100. package/dist/core/extensions/builtin/claude-sdk-oauth/accounts.d.ts.map +1 -1
  101. package/dist/core/extensions/builtin/claude-sdk-oauth/accounts.js.map +1 -1
  102. package/dist/core/extensions/builtin/claude-sdk-oauth/affinity.d.ts.map +1 -1
  103. package/dist/core/extensions/builtin/claude-sdk-oauth/affinity.js.map +1 -1
  104. package/dist/core/extensions/builtin/claude-sdk-oauth/availability.d.ts +11 -0
  105. package/dist/core/extensions/builtin/claude-sdk-oauth/availability.d.ts.map +1 -1
  106. package/dist/core/extensions/builtin/claude-sdk-oauth/availability.js +12 -1
  107. package/dist/core/extensions/builtin/claude-sdk-oauth/availability.js.map +1 -1
  108. package/dist/core/extensions/builtin/claude-sdk-oauth/bounded-queue.d.ts.map +1 -1
  109. package/dist/core/extensions/builtin/claude-sdk-oauth/custom-tools.d.ts.map +1 -1
  110. package/dist/core/extensions/builtin/claude-sdk-oauth/errors.d.ts.map +1 -1
  111. package/dist/core/extensions/builtin/claude-sdk-oauth/executable-path-lookup.d.ts +14 -0
  112. package/dist/core/extensions/builtin/claude-sdk-oauth/executable-path-lookup.d.ts.map +1 -0
  113. package/dist/core/extensions/builtin/claude-sdk-oauth/executable-path-lookup.js +42 -0
  114. package/dist/core/extensions/builtin/claude-sdk-oauth/executable-path-lookup.js.map +1 -0
  115. package/dist/core/extensions/builtin/claude-sdk-oauth/executable.d.ts +18 -0
  116. package/dist/core/extensions/builtin/claude-sdk-oauth/executable.d.ts.map +1 -1
  117. package/dist/core/extensions/builtin/claude-sdk-oauth/executable.js +105 -36
  118. package/dist/core/extensions/builtin/claude-sdk-oauth/executable.js.map +1 -1
  119. package/dist/core/extensions/builtin/claude-sdk-oauth/failover.d.ts.map +1 -1
  120. package/dist/core/extensions/builtin/claude-sdk-oauth/index.js.map +1 -1
  121. package/dist/core/extensions/builtin/claude-sdk-oauth/refusal.d.ts.map +1 -1
  122. package/dist/core/extensions/builtin/claude-sdk-oauth/sdk-boundary.d.ts.map +1 -1
  123. package/dist/core/extensions/builtin/claude-sdk-oauth/session-binding.d.ts.map +1 -1
  124. package/dist/core/extensions/builtin/claude-sdk-oauth/session-commit-boundary.d.ts.map +1 -1
  125. package/dist/core/extensions/builtin/claude-sdk-oauth/session-reaper.d.ts.map +1 -1
  126. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.d.ts.map +1 -1
  127. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-pump.js.map +1 -1
  128. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry-state.d.ts.map +1 -1
  129. package/dist/core/extensions/builtin/claude-sdk-oauth/session-registry.d.ts.map +1 -1
  130. package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.d.ts.map +1 -1
  131. package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.js +4 -1
  132. package/dist/core/extensions/builtin/claude-sdk-oauth/session-stream.js.map +1 -1
  133. package/dist/core/extensions/builtin/claude-sdk-oauth/session-sync.js.map +1 -1
  134. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-attempt.d.ts.map +1 -1
  135. package/dist/core/extensions/builtin/claude-sdk-oauth/session-turn-types.d.ts.map +1 -1
  136. package/dist/core/extensions/builtin/claude-sdk-oauth/settings.js.map +1 -1
  137. package/dist/core/extensions/builtin/claude-sdk-oauth/stream-protocol.d.ts +1 -1
  138. package/dist/core/extensions/builtin/claude-sdk-oauth/tool-watch.js.map +1 -1
  139. package/dist/core/extensions/builtin/claude-sdk-oauth/tools.d.ts.map +1 -1
  140. package/dist/core/extensions/builtin/compaction/context-reduction.js.map +1 -1
  141. package/dist/core/extensions/builtin/compaction/deterministic-fallback.js.map +1 -1
  142. package/dist/core/extensions/builtin/compaction/index.js.map +1 -1
  143. package/dist/core/extensions/builtin/compaction/lane-policy.js.map +1 -1
  144. package/dist/core/extensions/builtin/compaction/log.js.map +1 -1
  145. package/dist/core/extensions/builtin/compaction/model-usability-budget.d.ts.map +1 -1
  146. package/dist/core/extensions/builtin/compaction/openai-remote-convert.js.map +1 -1
  147. package/dist/core/extensions/builtin/compaction/openai-remote.js.map +1 -1
  148. package/dist/core/extensions/builtin/compaction/overflow-retry.d.ts.map +1 -1
  149. package/dist/core/extensions/builtin/compaction/resume-admission.d.ts +7 -0
  150. package/dist/core/extensions/builtin/compaction/resume-admission.d.ts.map +1 -0
  151. package/dist/core/extensions/builtin/compaction/resume-admission.js +7 -0
  152. package/dist/core/extensions/builtin/compaction/resume-admission.js.map +1 -0
  153. package/dist/core/extensions/builtin/compaction/resume-slice.d.ts +23 -0
  154. package/dist/core/extensions/builtin/compaction/resume-slice.d.ts.map +1 -0
  155. package/dist/core/extensions/builtin/compaction/resume-slice.js +99 -0
  156. package/dist/core/extensions/builtin/compaction/resume-slice.js.map +1 -0
  157. package/dist/core/extensions/builtin/compaction/speculative.d.ts.map +1 -1
  158. package/dist/core/extensions/builtin/compaction/summarization-retry.js.map +1 -1
  159. package/dist/core/extensions/builtin/config-reload/index.d.ts.map +1 -1
  160. package/dist/core/extensions/builtin/config-reload/index.js.map +1 -1
  161. package/dist/core/extensions/builtin/config-reload/log.js.map +1 -1
  162. package/dist/core/extensions/builtin/config-reload/protocol.d.ts.map +1 -1
  163. package/dist/core/extensions/builtin/config-reload/reload-deferral.d.ts.map +1 -1
  164. package/dist/core/extensions/builtin/config-reload/watch-engine.d.ts.map +1 -1
  165. package/dist/core/extensions/builtin/config-reload/watch-event-source.js.map +1 -1
  166. package/dist/core/extensions/builtin/cursor-cli-oauth/account-command.js.map +1 -1
  167. package/dist/core/extensions/builtin/cursor-cli-oauth/accounts.d.ts.map +1 -1
  168. package/dist/core/extensions/builtin/cursor-cli-oauth/affinity.d.ts.map +1 -1
  169. package/dist/core/extensions/builtin/cursor-cli-oauth/affinity.js.map +1 -1
  170. package/dist/core/extensions/builtin/cursor-cli-oauth/diagnostics.d.ts.map +1 -1
  171. package/dist/core/extensions/builtin/cursor-cli-oauth/diagnostics.js.map +1 -1
  172. package/dist/core/extensions/builtin/cursor-cli-oauth/executable.d.ts.map +1 -1
  173. package/dist/core/extensions/builtin/cursor-cli-oauth/executable.js.map +1 -1
  174. package/dist/core/extensions/builtin/cursor-cli-oauth/failover.d.ts.map +1 -1
  175. package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.d.ts.map +1 -1
  176. package/dist/core/extensions/builtin/cursor-cli-oauth/guardrails.js.map +1 -1
  177. package/dist/core/extensions/builtin/cursor-cli-oauth/index.js.map +1 -1
  178. package/dist/core/extensions/builtin/cursor-cli-oauth/oauth-login.js.map +1 -1
  179. package/dist/core/extensions/builtin/cursor-cli-oauth/session-router.d.ts.map +1 -1
  180. package/dist/core/extensions/builtin/cursor-cli-oauth/session-router.js.map +1 -1
  181. package/dist/core/extensions/builtin/cursor-cli-oauth/stream-parser.d.ts.map +1 -1
  182. package/dist/core/extensions/builtin/cursor-cli-oauth/stream-parser.js.map +1 -1
  183. package/dist/core/extensions/builtin/cursor-cli-oauth/stream.js.map +1 -1
  184. package/dist/core/extensions/builtin/cursor-cli-oauth/transport.d.ts.map +1 -1
  185. package/dist/core/extensions/builtin/goal/cache-warm-renderer.js.map +1 -1
  186. package/dist/core/extensions/builtin/goal/command-registration.js.map +1 -1
  187. package/dist/core/extensions/builtin/goal/direct-input-lifecycle.d.ts.map +1 -1
  188. package/dist/core/extensions/builtin/goal/elapsed-ticker.d.ts.map +1 -1
  189. package/dist/core/extensions/builtin/goal/errors.d.ts.map +1 -1
  190. package/dist/core/extensions/builtin/goal/monitor-continuation.d.ts.map +1 -1
  191. package/dist/core/extensions/builtin/goal/monitor-continuation.js +57 -4
  192. package/dist/core/extensions/builtin/goal/monitor-continuation.js.map +1 -1
  193. package/dist/core/extensions/builtin/goal/persistence.js.map +1 -1
  194. package/dist/core/extensions/builtin/goal/prompt.d.ts.map +1 -1
  195. package/dist/core/extensions/builtin/goal/prompt.js +9 -6
  196. package/dist/core/extensions/builtin/goal/prompt.js.map +1 -1
  197. package/dist/core/extensions/builtin/goal/store.js.map +1 -1
  198. package/dist/core/extensions/builtin/goal/tool-registration.js +1 -1
  199. package/dist/core/extensions/builtin/goal/tool-registration.js.map +1 -1
  200. package/dist/core/extensions/builtin/goal/turn-usage.d.ts.map +1 -1
  201. package/dist/core/extensions/builtin/goal/types.d.ts.map +1 -1
  202. package/dist/core/extensions/builtin/goal/ui.js.map +1 -1
  203. package/dist/core/extensions/builtin/goal/wait-progress.js.map +1 -1
  204. package/dist/core/extensions/builtin/goal/wait-ticker.d.ts.map +1 -1
  205. package/dist/core/extensions/builtin/gpt-account.d.ts.map +1 -1
  206. package/dist/core/extensions/builtin/gpt-account.js +1 -0
  207. package/dist/core/extensions/builtin/gpt-account.js.map +1 -1
  208. package/dist/core/extensions/builtin/gpt-apply-patch/apply.js.map +1 -1
  209. package/dist/core/extensions/builtin/gpt-apply-patch/errors.d.ts.map +1 -1
  210. package/dist/core/extensions/builtin/gpt-apply-patch/extension.d.ts.map +1 -1
  211. package/dist/core/extensions/builtin/gpt-apply-patch/preview-format.js.map +1 -1
  212. package/dist/core/extensions/builtin/gpt-apply-patch/preview.js.map +1 -1
  213. package/dist/core/extensions/builtin/gpt-apply-patch/streaming-parser.d.ts.map +1 -1
  214. package/dist/core/extensions/builtin/gpt-apply-patch/tool.js.map +1 -1
  215. package/dist/core/extensions/builtin/help/panel.d.ts.map +1 -1
  216. package/dist/core/extensions/builtin/history-search/index.js.map +1 -1
  217. package/dist/core/extensions/builtin/history-search/overlay.d.ts.map +1 -1
  218. package/dist/core/extensions/builtin/hooks/command-runner.js.map +1 -1
  219. package/dist/core/extensions/builtin/hooks/dispatcher.js.map +1 -1
  220. package/dist/core/extensions/builtin/hooks/plugin-loader.js.map +1 -1
  221. package/dist/core/extensions/builtin/hooks/tool-adapter.js.map +1 -1
  222. package/dist/core/extensions/builtin/hooks/trust-storage.d.ts.map +1 -1
  223. package/dist/core/extensions/builtin/hooks/trust.js.map +1 -1
  224. package/dist/core/extensions/builtin/hooks/types.d.ts.map +1 -1
  225. package/dist/core/extensions/builtin/imagegen/index.js.map +1 -1
  226. package/dist/core/extensions/builtin/imagegen/params.d.ts +45 -0
  227. package/dist/core/extensions/builtin/imagegen/params.d.ts.map +1 -0
  228. package/dist/core/extensions/builtin/imagegen/params.js +81 -0
  229. package/dist/core/extensions/builtin/imagegen/params.js.map +1 -0
  230. package/dist/core/extensions/builtin/imagegen/paths.d.ts +10 -4
  231. package/dist/core/extensions/builtin/imagegen/paths.d.ts.map +1 -1
  232. package/dist/core/extensions/builtin/imagegen/paths.js +43 -10
  233. package/dist/core/extensions/builtin/imagegen/paths.js.map +1 -1
  234. package/dist/core/extensions/builtin/imagegen/reference-images.d.ts +20 -0
  235. package/dist/core/extensions/builtin/imagegen/reference-images.d.ts.map +1 -0
  236. package/dist/core/extensions/builtin/imagegen/reference-images.js +70 -0
  237. package/dist/core/extensions/builtin/imagegen/reference-images.js.map +1 -0
  238. package/dist/core/extensions/builtin/imagegen/skill/SKILL.md +58 -33
  239. package/dist/core/extensions/builtin/imagegen/tool.d.ts +15 -19
  240. package/dist/core/extensions/builtin/imagegen/tool.d.ts.map +1 -1
  241. package/dist/core/extensions/builtin/imagegen/tool.js +74 -52
  242. package/dist/core/extensions/builtin/imagegen/tool.js.map +1 -1
  243. package/dist/core/extensions/builtin/index.d.ts.map +1 -1
  244. package/dist/core/extensions/builtin/index.js +2 -0
  245. package/dist/core/extensions/builtin/index.js.map +1 -1
  246. package/dist/core/extensions/builtin/look-at/model-selector.d.ts.map +1 -1
  247. package/dist/core/extensions/builtin/look-at/runner.js.map +1 -1
  248. package/dist/core/extensions/builtin/loop/command.js.map +1 -1
  249. package/dist/core/extensions/builtin/loop/cron-planner.js.map +1 -1
  250. package/dist/core/extensions/builtin/loop/index.d.ts.map +1 -1
  251. package/dist/core/extensions/builtin/loop/index.js.map +1 -1
  252. package/dist/core/extensions/builtin/loop/loopfile.d.ts.map +1 -1
  253. package/dist/core/extensions/builtin/loop/scheduler.js.map +1 -1
  254. package/dist/core/extensions/builtin/loop/status.d.ts.map +1 -1
  255. package/dist/core/extensions/builtin/loop/store.d.ts.map +1 -1
  256. package/dist/core/extensions/builtin/loop/types.d.ts.map +1 -1
  257. package/dist/core/extensions/builtin/loop-guard/detectors.d.ts.map +1 -1
  258. package/dist/core/extensions/builtin/loop-guard/escalation.d.ts.map +1 -1
  259. package/dist/core/extensions/builtin/loop-guard/escalation.js.map +1 -1
  260. package/dist/core/extensions/builtin/loop-guard/index.js.map +1 -1
  261. package/dist/core/extensions/builtin/loop-guard/notice.js.map +1 -1
  262. package/dist/core/extensions/builtin/loop-guard/renderer.js.map +1 -1
  263. package/dist/core/extensions/builtin/loop-guard/tracker.d.ts.map +1 -1
  264. package/dist/core/extensions/builtin/mcp/active-set.js.map +1 -1
  265. package/dist/core/extensions/builtin/mcp/auth/callback.d.ts.map +1 -1
  266. package/dist/core/extensions/builtin/mcp/auth/oauth-errors.d.ts.map +1 -1
  267. package/dist/core/extensions/builtin/mcp/auth/oauth-errors.js.map +1 -1
  268. package/dist/core/extensions/builtin/mcp/auth/oauth-provider.d.ts.map +1 -1
  269. package/dist/core/extensions/builtin/mcp/auth/oauth-refresh.d.ts.map +1 -1
  270. package/dist/core/extensions/builtin/mcp/auth/oauth-refresh.js.map +1 -1
  271. package/dist/core/extensions/builtin/mcp/auth/oauth.js.map +1 -1
  272. package/dist/core/extensions/builtin/mcp/auth/token-store.d.ts.map +1 -1
  273. package/dist/core/extensions/builtin/mcp/catalog.js.map +1 -1
  274. package/dist/core/extensions/builtin/mcp/config-schema.d.ts +28 -28
  275. package/dist/core/extensions/builtin/mcp/config.d.ts.map +1 -1
  276. package/dist/core/extensions/builtin/mcp/connection.d.ts.map +1 -1
  277. package/dist/core/extensions/builtin/mcp/elicitation.d.ts.map +1 -1
  278. package/dist/core/extensions/builtin/mcp/elicitation.js.map +1 -1
  279. package/dist/core/extensions/builtin/mcp/errors.d.ts.map +1 -1
  280. package/dist/core/extensions/builtin/mcp/errors.js.map +1 -1
  281. package/dist/core/extensions/builtin/mcp/expose/register.js.map +1 -1
  282. package/dist/core/extensions/builtin/mcp/expose/session.js.map +1 -1
  283. package/dist/core/extensions/builtin/mcp/guard/output-guard.d.ts.map +1 -1
  284. package/dist/core/extensions/builtin/mcp/guard/output-guard.js.map +1 -1
  285. package/dist/core/extensions/builtin/mcp/log.js.map +1 -1
  286. package/dist/core/extensions/builtin/mcp/reconnect.d.ts.map +1 -1
  287. package/dist/core/extensions/builtin/mcp/service-register.js.map +1 -1
  288. package/dist/core/extensions/builtin/mcp/service.d.ts.map +1 -1
  289. package/dist/core/extensions/builtin/mcp/service.js.map +1 -1
  290. package/dist/core/extensions/builtin/nested-agents-md/core/errors.d.ts.map +1 -1
  291. package/dist/core/extensions/builtin/nested-agents-md/core/injection-cache.d.ts.map +1 -1
  292. package/dist/core/extensions/builtin/nested-agents-md/core/types.d.ts.map +1 -1
  293. package/dist/core/extensions/builtin/oauth-login-interaction.d.ts +13 -6
  294. package/dist/core/extensions/builtin/oauth-login-interaction.d.ts.map +1 -1
  295. package/dist/core/extensions/builtin/oauth-login-interaction.js +43 -19
  296. package/dist/core/extensions/builtin/oauth-login-interaction.js.map +1 -1
  297. package/dist/core/extensions/builtin/openai-image-gen/inject.d.ts +5 -3
  298. package/dist/core/extensions/builtin/openai-image-gen/inject.d.ts.map +1 -1
  299. package/dist/core/extensions/builtin/openai-image-gen/inject.js +7 -4
  300. package/dist/core/extensions/builtin/openai-image-gen/inject.js.map +1 -1
  301. package/dist/core/extensions/builtin/permission-system/arity.d.ts.map +1 -1
  302. package/dist/core/extensions/builtin/permission-system/parsers.d.ts.map +1 -1
  303. package/dist/core/extensions/builtin/permission-system/prompt.js.map +1 -1
  304. package/dist/core/extensions/builtin/permission-system/service.d.ts.map +1 -1
  305. package/dist/core/extensions/builtin/permission-system/service.js.map +1 -1
  306. package/dist/core/extensions/builtin/permission-system/types.d.ts.map +1 -1
  307. package/dist/core/extensions/builtin/permission-system/wildcard.d.ts.map +1 -1
  308. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js +1 -1
  309. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5-1.js.map +1 -1
  310. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js +1 -1
  311. package/dist/core/extensions/builtin/prompt-preset/claude-fable-5.js.map +1 -1
  312. package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js +1 -1
  313. package/dist/core/extensions/builtin/prompt-preset/claude-opus-5.js.map +1 -1
  314. package/dist/core/extensions/builtin/prompt-preset/execution-tooling.d.ts.map +1 -1
  315. package/dist/core/extensions/builtin/prompt-preset/glm-5.d.ts +1 -1
  316. package/dist/core/extensions/builtin/prompt-preset/glm-5.d.ts.map +1 -1
  317. package/dist/core/extensions/builtin/prompt-preset/glm-5.js +1 -1
  318. package/dist/core/extensions/builtin/prompt-preset/glm-5.js.map +1 -1
  319. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.d.ts.map +1 -1
  320. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js +1 -1
  321. package/dist/core/extensions/builtin/prompt-preset/gpt-5.6.js.map +1 -1
  322. package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts +4 -4
  323. package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.d.ts.map +1 -1
  324. package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js +4 -4
  325. package/dist/core/extensions/builtin/prompt-preset/gpt-6-astra.js.map +1 -1
  326. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js +1 -1
  327. package/dist/core/extensions/builtin/prompt-preset/kimi-k3.js.map +1 -1
  328. package/dist/core/extensions/builtin/prompt-preset/presets.js.map +1 -1
  329. package/dist/core/extensions/builtin/rule-activation/renderer.js.map +1 -1
  330. package/dist/core/extensions/builtin/rules/commands.js.map +1 -1
  331. package/dist/core/extensions/builtin/rules/config.js.map +1 -1
  332. package/dist/core/extensions/builtin/rules/rules/errors.d.ts.map +1 -1
  333. package/dist/core/extensions/builtin/rules/rules/project-root.js.map +1 -1
  334. package/dist/core/extensions/builtin/rules/ui/dynamic-border.d.ts.map +1 -1
  335. package/dist/core/extensions/builtin/rules/ui/rules-banner.d.ts.map +1 -1
  336. package/dist/core/extensions/builtin/terminal/extension.d.ts.map +1 -1
  337. package/dist/core/extensions/builtin/terminal/manager.d.ts.map +1 -1
  338. package/dist/core/extensions/builtin/terminal/manager.js.map +1 -1
  339. package/dist/core/extensions/builtin/terminal/monitor-notify.d.ts.map +1 -1
  340. package/dist/core/extensions/builtin/terminal/monitor-registry.d.ts.map +1 -1
  341. package/dist/core/extensions/builtin/terminal/monitor-status-ticker.d.ts.map +1 -1
  342. package/dist/core/extensions/builtin/terminal/notify.d.ts.map +1 -1
  343. package/dist/core/extensions/builtin/terminal/restore.d.ts.map +1 -1
  344. package/dist/core/extensions/builtin/terminal/runtime-session.d.ts.map +1 -1
  345. package/dist/core/extensions/builtin/terminal/session-bundle.d.ts.map +1 -1
  346. package/dist/core/extensions/builtin/terminal/terminal-manifest.d.ts.map +1 -1
  347. package/dist/core/extensions/builtin/terminal/tools/render.d.ts.map +1 -1
  348. package/dist/core/extensions/builtin/todotools/index.js.map +1 -1
  349. package/dist/core/extensions/builtin/todotools/normalize.js.map +1 -1
  350. package/dist/core/extensions/builtin/todotools/todo-operations.js.map +1 -1
  351. package/dist/core/extensions/builtin/todotools/todo-widget-component.d.ts.map +1 -1
  352. package/dist/core/extensions/builtin/todotools/todo-widget-component.js.map +1 -1
  353. package/dist/core/extensions/builtin/todotools/tools/todo.js.map +1 -1
  354. package/dist/core/extensions/builtin/tool-search/native-search.d.ts.map +1 -1
  355. package/dist/core/extensions/builtin/tool-search/service.d.ts.map +1 -1
  356. package/dist/core/extensions/builtin/tool-search/service.js.map +1 -1
  357. package/dist/core/extensions/builtin/ttsr/detectors/leak-context.d.ts.map +1 -1
  358. package/dist/core/extensions/builtin/ttsr/detectors/token-grammar.d.ts.map +1 -1
  359. package/dist/core/extensions/builtin/ttsr/manager.d.ts.map +1 -1
  360. package/dist/core/extensions/builtin/ttsr/message-update.js.map +1 -1
  361. package/dist/core/extensions/builtin/ttsr/repetitive-turns-lane.d.ts.map +1 -1
  362. package/dist/core/extensions/builtin/ttsr/stream-utils.d.ts.map +1 -1
  363. package/dist/core/extensions/builtin/ttsr/watch.d.ts.map +1 -1
  364. package/dist/core/extensions/builtin/webfetch/webfetch/errors.d.ts.map +1 -1
  365. package/dist/core/extensions/builtin/webfetch/webfetch/tool.d.ts +1 -1
  366. package/dist/core/extensions/builtin/websearch/websearch/native.js.map +1 -1
  367. package/dist/core/extensions/loader.d.ts +2 -1
  368. package/dist/core/extensions/loader.d.ts.map +1 -1
  369. package/dist/core/extensions/loader.js +17 -8
  370. package/dist/core/extensions/loader.js.map +1 -1
  371. package/dist/core/extensions/notice/box.d.ts.map +1 -1
  372. package/dist/core/extensions/notice/box.js +13 -5
  373. package/dist/core/extensions/notice/box.js.map +1 -1
  374. package/dist/core/extensions/runner.d.ts +11 -0
  375. package/dist/core/extensions/runner.d.ts.map +1 -1
  376. package/dist/core/extensions/runner.js +23 -0
  377. package/dist/core/extensions/runner.js.map +1 -1
  378. package/dist/core/extensions/types.d.ts +76 -1
  379. package/dist/core/extensions/types.d.ts.map +1 -1
  380. package/dist/core/extensions/types.js.map +1 -1
  381. package/dist/core/footer-data-provider.d.ts.map +1 -1
  382. package/dist/core/footer-data-provider.js.map +1 -1
  383. package/dist/core/http-dispatcher.d.ts.map +1 -1
  384. package/dist/core/http-dispatcher.js.map +1 -1
  385. package/dist/core/keybindings.d.ts +182 -177
  386. package/dist/core/keybindings.d.ts.map +1 -1
  387. package/dist/core/keybindings.js +5 -0
  388. package/dist/core/keybindings.js.map +1 -1
  389. package/dist/core/lockfile-policy.d.ts.map +1 -1
  390. package/dist/core/messages.js.map +1 -1
  391. package/dist/core/model-config-schema.d.ts +150 -150
  392. package/dist/core/model-config-schema.d.ts.map +1 -1
  393. package/dist/core/model-config.d.ts.map +1 -1
  394. package/dist/core/model-config.js.map +1 -1
  395. package/dist/core/model-registry.d.ts.map +1 -1
  396. package/dist/core/model-registry.js.map +1 -1
  397. package/dist/core/model-resolver.d.ts.map +1 -1
  398. package/dist/core/model-resolver.js +1 -0
  399. package/dist/core/model-resolver.js.map +1 -1
  400. package/dist/core/model-runtime.d.ts.map +1 -1
  401. package/dist/core/model-runtime.js.map +1 -1
  402. package/dist/core/models-store.d.ts.map +1 -1
  403. package/dist/core/models-store.js.map +1 -1
  404. package/dist/core/package-manager.d.ts.map +1 -1
  405. package/dist/core/provider-display-names.d.ts.map +1 -1
  406. package/dist/core/provider-display-names.js +1 -0
  407. package/dist/core/provider-display-names.js.map +1 -1
  408. package/dist/core/remote-catalog-provider.js.map +1 -1
  409. package/dist/core/resource-loader.d.ts +2 -0
  410. package/dist/core/resource-loader.d.ts.map +1 -1
  411. package/dist/core/resource-loader.js +11 -7
  412. package/dist/core/resource-loader.js.map +1 -1
  413. package/dist/core/retry-fallback/controller.d.ts.map +1 -1
  414. package/dist/core/retry-fallback/cooldown.d.ts.map +1 -1
  415. package/dist/core/retry-fallback/cooldown.js.map +1 -1
  416. package/dist/core/retry-fallback/expansion.js.map +1 -1
  417. package/dist/core/retry-fallback/log.js.map +1 -1
  418. package/dist/core/retry-fallback/probe-scheduler.d.ts.map +1 -1
  419. package/dist/core/runtime-credentials.d.ts.map +1 -1
  420. package/dist/core/sdk.d.ts.map +1 -1
  421. package/dist/core/sdk.js +24 -1
  422. package/dist/core/sdk.js.map +1 -1
  423. package/dist/core/session-activity.d.ts.map +1 -1
  424. package/dist/core/session-cwd.d.ts.map +1 -1
  425. package/dist/core/session-log.js.map +1 -1
  426. package/dist/core/session-manager.d.ts.map +1 -1
  427. package/dist/core/session-manager.js.map +1 -1
  428. package/dist/core/session-resident-store.d.ts.map +1 -1
  429. package/dist/core/session-sidecar-store.d.ts.map +1 -1
  430. package/dist/core/session-summary-lru.d.ts.map +1 -1
  431. package/dist/core/session-work-barrier.d.ts.map +1 -1
  432. package/dist/core/settings-manager.d.ts +6 -1
  433. package/dist/core/settings-manager.d.ts.map +1 -1
  434. package/dist/core/settings-manager.js +14 -0
  435. package/dist/core/settings-manager.js.map +1 -1
  436. package/dist/core/settings-shapes.d.ts +7 -0
  437. package/dist/core/settings-shapes.d.ts.map +1 -1
  438. package/dist/core/settings-shapes.js +3 -1
  439. package/dist/core/settings-shapes.js.map +1 -1
  440. package/dist/core/telemetry.js.map +1 -1
  441. package/dist/core/timings.js.map +1 -1
  442. package/dist/core/tools/bash.d.ts.map +1 -1
  443. package/dist/core/tools/bounded-realpath.js.map +1 -1
  444. package/dist/core/tools/edit.d.ts.map +1 -1
  445. package/dist/core/tools/find.d.ts.map +1 -1
  446. package/dist/core/tools/find.js.map +1 -1
  447. package/dist/core/tools/grep.d.ts.map +1 -1
  448. package/dist/core/tools/ls.d.ts.map +1 -1
  449. package/dist/core/tools/output-accumulator.d.ts.map +1 -1
  450. package/dist/core/tools/output-accumulator.js.map +1 -1
  451. package/dist/core/tools/powershell.d.ts.map +1 -1
  452. package/dist/core/tools/read-classifiers.d.ts +17 -0
  453. package/dist/core/tools/read-classifiers.d.ts.map +1 -0
  454. package/dist/core/tools/read-classifiers.js +26 -0
  455. package/dist/core/tools/read-classifiers.js.map +1 -0
  456. package/dist/core/tools/read.d.ts +5 -1
  457. package/dist/core/tools/read.d.ts.map +1 -1
  458. package/dist/core/tools/read.js +21 -1
  459. package/dist/core/tools/read.js.map +1 -1
  460. package/dist/core/tools/tail-window.d.ts.map +1 -1
  461. package/dist/core/tools/truncate.js.map +1 -1
  462. package/dist/core/tools/write-result.js.map +1 -1
  463. package/dist/core/tools/write.d.ts.map +1 -1
  464. package/dist/core/trust-manager.d.ts.map +1 -1
  465. package/dist/extensions/llama/client.d.ts.map +1 -1
  466. package/dist/extensions/llama/client.js.map +1 -1
  467. package/dist/extensions/llama/huggingface.d.ts.map +1 -1
  468. package/dist/extensions/llama/huggingface.js.map +1 -1
  469. package/dist/extensions/llama/provider.js.map +1 -1
  470. package/dist/from-source-config-guard.js.map +1 -1
  471. package/dist/index.d.ts +1 -0
  472. package/dist/index.d.ts.map +1 -1
  473. package/dist/index.js +1 -0
  474. package/dist/index.js.map +1 -1
  475. package/dist/main.d.ts.map +1 -1
  476. package/dist/main.js +4 -0
  477. package/dist/main.js.map +1 -1
  478. package/dist/modes/app-server/daemon/occupancy.d.ts.map +1 -1
  479. package/dist/modes/app-server/daemon/process.d.ts.map +1 -1
  480. package/dist/modes/app-server/daemon/process.js.map +1 -1
  481. package/dist/modes/app-server/daemon.js.map +1 -1
  482. package/dist/modes/app-server/protocol/collaboration-mode.d.ts.map +1 -1
  483. package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputAnswer.d.ts +7 -0
  484. package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputAnswer.d.ts.map +1 -0
  485. package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputAnswer.js +4 -0
  486. package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputAnswer.js.map +1 -0
  487. package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputOption.d.ts +8 -0
  488. package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputOption.d.ts.map +1 -0
  489. package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputOption.js +4 -0
  490. package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputOption.js.map +1 -0
  491. package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputParams.d.ts +12 -0
  492. package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputParams.d.ts.map +1 -0
  493. package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputParams.js +4 -0
  494. package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputParams.js.map +1 -0
  495. package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputQuestion.d.ts +13 -0
  496. package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputQuestion.d.ts.map +1 -0
  497. package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputQuestion.js +4 -0
  498. package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputQuestion.js.map +1 -0
  499. package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputResponse.d.ts +10 -0
  500. package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputResponse.d.ts.map +1 -0
  501. package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputResponse.js +4 -0
  502. package/dist/modes/app-server/protocol/generated/v2/ToolRequestUserInputResponse.js.map +1 -0
  503. package/dist/modes/app-server/protocol/index.d.ts +2 -0
  504. package/dist/modes/app-server/protocol/index.d.ts.map +1 -1
  505. package/dist/modes/app-server/protocol/index.js.map +1 -1
  506. package/dist/modes/app-server/protocol/methods.d.ts +1 -0
  507. package/dist/modes/app-server/protocol/methods.d.ts.map +1 -1
  508. package/dist/modes/app-server/protocol/methods.js +1 -0
  509. package/dist/modes/app-server/protocol/methods.js.map +1 -1
  510. package/dist/modes/app-server/rpc/errors.d.ts.map +1 -1
  511. package/dist/modes/app-server/runtime.d.ts.map +1 -1
  512. package/dist/modes/app-server/runtime.js +22 -6
  513. package/dist/modes/app-server/runtime.js.map +1 -1
  514. package/dist/modes/app-server/search/fuzzy-files.js.map +1 -1
  515. package/dist/modes/app-server/search/fuzzy-search-service.d.ts.map +1 -1
  516. package/dist/modes/app-server/server/account.js.map +1 -1
  517. package/dist/modes/app-server/server/approval-bridge.d.ts.map +1 -1
  518. package/dist/modes/app-server/server/approval-types.d.ts.map +1 -1
  519. package/dist/modes/app-server/server/approval-ui-context.d.ts +2 -1
  520. package/dist/modes/app-server/server/approval-ui-context.d.ts.map +1 -1
  521. package/dist/modes/app-server/server/approval-ui-context.js +9 -1
  522. package/dist/modes/app-server/server/approval-ui-context.js.map +1 -1
  523. package/dist/modes/app-server/server/catalogs.js.map +1 -1
  524. package/dist/modes/app-server/server/config.js.map +1 -1
  525. package/dist/modes/app-server/server/connection.d.ts.map +1 -1
  526. package/dist/modes/app-server/server/models.js.map +1 -1
  527. package/dist/modes/app-server/server/notifications.d.ts.map +1 -1
  528. package/dist/modes/app-server/server/notifications.js.map +1 -1
  529. package/dist/modes/app-server/server/server-core.d.ts.map +1 -1
  530. package/dist/modes/app-server/server/server-core.js.map +1 -1
  531. package/dist/modes/app-server/server/skills.js.map +1 -1
  532. package/dist/modes/app-server/server/user-input-bridge.d.ts +16 -0
  533. package/dist/modes/app-server/server/user-input-bridge.d.ts.map +1 -0
  534. package/dist/modes/app-server/server/user-input-bridge.js +142 -0
  535. package/dist/modes/app-server/server/user-input-bridge.js.map +1 -0
  536. package/dist/modes/app-server/server/user-input-types.d.ts +43 -0
  537. package/dist/modes/app-server/server/user-input-types.d.ts.map +1 -0
  538. package/dist/modes/app-server/server/user-input-types.js +51 -0
  539. package/dist/modes/app-server/server/user-input-types.js.map +1 -0
  540. package/dist/modes/app-server/threads/archive-state.d.ts.map +1 -1
  541. package/dist/modes/app-server/threads/handlers.js.map +1 -1
  542. package/dist/modes/app-server/threads/mcp-wire-status.d.ts.map +1 -1
  543. package/dist/modes/app-server/threads/metadata-state.d.ts.map +1 -1
  544. package/dist/modes/app-server/threads/projection-file-changes.js.map +1 -1
  545. package/dist/modes/app-server/threads/projection-message-items.d.ts.map +1 -1
  546. package/dist/modes/app-server/threads/projection-turn-diff.d.ts.map +1 -1
  547. package/dist/modes/app-server/threads/projection-web-search.js.map +1 -1
  548. package/dist/modes/app-server/threads/projection.d.ts.map +1 -1
  549. package/dist/modes/app-server/threads/registry.d.ts.map +1 -1
  550. package/dist/modes/app-server/threads/registry.js.map +1 -1
  551. package/dist/modes/app-server/threads/search-cache.d.ts.map +1 -1
  552. package/dist/modes/app-server/threads/turn-log.d.ts.map +1 -1
  553. package/dist/modes/app-server/threads/turn-runtime.d.ts.map +1 -1
  554. package/dist/modes/app-server/threads/turn-runtime.js.map +1 -1
  555. package/dist/modes/app-server/threads/turns.js.map +1 -1
  556. package/dist/modes/app-server/threads/wire-thread.js.map +1 -1
  557. package/dist/modes/app-server/transports/unix-socket.d.ts.map +1 -1
  558. package/dist/modes/app-server/transports/unix-socket.js.map +1 -1
  559. package/dist/modes/app-server/transports/websocket.d.ts.map +1 -1
  560. package/dist/modes/app-server/turn-adapter.d.ts +3 -3
  561. package/dist/modes/app-server/turn-adapter.d.ts.map +1 -1
  562. package/dist/modes/app-server/turn-adapter.js +36 -5
  563. package/dist/modes/app-server/turn-adapter.js.map +1 -1
  564. package/dist/modes/interactive/compaction-queue-transfer.js.map +1 -1
  565. package/dist/modes/interactive/components/armin.d.ts.map +1 -1
  566. package/dist/modes/interactive/components/armin.js.map +1 -1
  567. package/dist/modes/interactive/components/ask-user-async-widget.d.ts +39 -0
  568. package/dist/modes/interactive/components/ask-user-async-widget.d.ts.map +1 -0
  569. package/dist/modes/interactive/components/ask-user-async-widget.js +82 -0
  570. package/dist/modes/interactive/components/ask-user-async-widget.js.map +1 -0
  571. package/dist/modes/interactive/components/ask-user-question-keys.d.ts +21 -0
  572. package/dist/modes/interactive/components/ask-user-question-keys.d.ts.map +1 -0
  573. package/dist/modes/interactive/components/ask-user-question-keys.js +115 -0
  574. package/dist/modes/interactive/components/ask-user-question-keys.js.map +1 -0
  575. package/dist/modes/interactive/components/ask-user-question-render.d.ts +17 -0
  576. package/dist/modes/interactive/components/ask-user-question-render.d.ts.map +1 -0
  577. package/dist/modes/interactive/components/ask-user-question-render.js +75 -0
  578. package/dist/modes/interactive/components/ask-user-question-render.js.map +1 -0
  579. package/dist/modes/interactive/components/ask-user-question-state.d.ts +52 -0
  580. package/dist/modes/interactive/components/ask-user-question-state.d.ts.map +1 -0
  581. package/dist/modes/interactive/components/ask-user-question-state.js +134 -0
  582. package/dist/modes/interactive/components/ask-user-question-state.js.map +1 -0
  583. package/dist/modes/interactive/components/ask-user-question.d.ts +50 -0
  584. package/dist/modes/interactive/components/ask-user-question.d.ts.map +1 -0
  585. package/dist/modes/interactive/components/ask-user-question.js +148 -0
  586. package/dist/modes/interactive/components/ask-user-question.js.map +1 -0
  587. package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
  588. package/dist/modes/interactive/components/assistant-message.js.map +1 -1
  589. package/dist/modes/interactive/components/assistant-render-descriptors.js.map +1 -1
  590. package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
  591. package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
  592. package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
  593. package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
  594. package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
  595. package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
  596. package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
  597. package/dist/modes/interactive/components/config-selector.js.map +1 -1
  598. package/dist/modes/interactive/components/continuity-notice.d.ts.map +1 -1
  599. package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
  600. package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
  601. package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
  602. package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
  603. package/dist/modes/interactive/components/custom-message.js.map +1 -1
  604. package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
  605. package/dist/modes/interactive/components/diff.js.map +1 -1
  606. package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
  607. package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
  608. package/dist/modes/interactive/components/earendil-announcement.d.ts.map +1 -1
  609. package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
  610. package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
  611. package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
  612. package/dist/modes/interactive/components/extension-selector.js.map +1 -1
  613. package/dist/modes/interactive/components/favorite-models-selector.d.ts.map +1 -1
  614. package/dist/modes/interactive/components/first-time-setup.d.ts.map +1 -1
  615. package/dist/modes/interactive/components/footer.d.ts.map +1 -1
  616. package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
  617. package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
  618. package/dist/modes/interactive/components/login-dialog.js.map +1 -1
  619. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  620. package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
  621. package/dist/modes/interactive/components/progressive-transcript-container.d.ts.map +1 -1
  622. package/dist/modes/interactive/components/render-signature.js.map +1 -1
  623. package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
  624. package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
  625. package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
  626. package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
  627. package/dist/modes/interactive/components/settings-selector.js.map +1 -1
  628. package/dist/modes/interactive/components/shortcut-overlay.d.ts.map +1 -1
  629. package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
  630. package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
  631. package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
  632. package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
  633. package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
  634. package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
  635. package/dist/modes/interactive/components/tool-execution-images.d.ts.map +1 -1
  636. package/dist/modes/interactive/components/tool-execution-renderer.d.ts.map +1 -1
  637. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  638. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  639. package/dist/modes/interactive/components/tool-renderer-boundary.d.ts.map +1 -1
  640. package/dist/modes/interactive/components/tree-selector.d.ts +4 -0
  641. package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
  642. package/dist/modes/interactive/components/tree-selector.js +17 -0
  643. package/dist/modes/interactive/components/tree-selector.js.map +1 -1
  644. package/dist/modes/interactive/components/trust-selector.d.ts.map +1 -1
  645. package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
  646. package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
  647. package/dist/modes/interactive/components/user-message.js.map +1 -1
  648. package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
  649. package/dist/modes/interactive/grok/chrome.d.ts.map +1 -1
  650. package/dist/modes/interactive/grok/footer.d.ts.map +1 -1
  651. package/dist/modes/interactive/grok/input-card.d.ts.map +1 -1
  652. package/dist/modes/interactive/grok/palette.d.ts.map +1 -1
  653. package/dist/modes/interactive/grok/tool-row.d.ts.map +1 -1
  654. package/dist/modes/interactive/grok/welcome-card.d.ts.map +1 -1
  655. package/dist/modes/interactive/interactive-host-runtime.d.ts +6 -0
  656. package/dist/modes/interactive/interactive-host-runtime.d.ts.map +1 -1
  657. package/dist/modes/interactive/interactive-host-runtime.js +32 -3
  658. package/dist/modes/interactive/interactive-host-runtime.js.map +1 -1
  659. package/dist/modes/interactive/interactive-mode.d.ts +35 -0
  660. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  661. package/dist/modes/interactive/interactive-mode.js +413 -100
  662. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  663. package/dist/modes/interactive/login-outcome.d.ts +20 -0
  664. package/dist/modes/interactive/login-outcome.d.ts.map +1 -0
  665. package/dist/modes/interactive/login-outcome.js +35 -0
  666. package/dist/modes/interactive/login-outcome.js.map +1 -0
  667. package/dist/modes/interactive/startup-tools.js.map +1 -1
  668. package/dist/modes/interactive/streaming-reveal-content.d.ts.map +1 -1
  669. package/dist/modes/interactive/streaming-reveal-content.js.map +1 -1
  670. package/dist/modes/interactive/streaming-reveal.d.ts.map +1 -1
  671. package/dist/modes/interactive/theme/theme-controller.d.ts.map +1 -1
  672. package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
  673. package/dist/modes/interactive/theme/theme.js.map +1 -1
  674. package/dist/modes/interactive/tips/catalog/input-tips.d.ts +7 -7
  675. package/dist/modes/interactive/tips/catalog/input-tips.d.ts.map +1 -1
  676. package/dist/modes/interactive/tips/catalog/input-tips.js +5 -0
  677. package/dist/modes/interactive/tips/catalog/input-tips.js.map +1 -1
  678. package/dist/modes/interactive/tips/catalog/model-tips.d.ts +1 -1
  679. package/dist/modes/interactive/tips/catalog/workspace-tips.d.ts +1 -1
  680. package/dist/modes/interactive/tips/scheduler.js.map +1 -1
  681. package/dist/modes/interactive/tips/working-tip.d.ts.map +1 -1
  682. package/dist/modes/interactive/tool-args-reveal.d.ts.map +1 -1
  683. package/dist/modes/interactive/tool-result-reveal.d.ts.map +1 -1
  684. package/dist/modes/print-mode.d.ts.map +1 -1
  685. package/dist/modes/print-mode.js +8 -0
  686. package/dist/modes/print-mode.js.map +1 -1
  687. package/dist/modes/provider-native-rendering.d.ts.map +1 -1
  688. package/dist/modes/provider-native-rendering.js +35 -0
  689. package/dist/modes/provider-native-rendering.js.map +1 -1
  690. package/dist/modes/rpc/connection-handler.d.ts.map +1 -1
  691. package/dist/modes/rpc/connection-handler.js +72 -1
  692. package/dist/modes/rpc/connection-handler.js.map +1 -1
  693. package/dist/modes/rpc/connection-question-bridge.d.ts +18 -0
  694. package/dist/modes/rpc/connection-question-bridge.d.ts.map +1 -0
  695. package/dist/modes/rpc/connection-question-bridge.js +156 -0
  696. package/dist/modes/rpc/connection-question-bridge.js.map +1 -0
  697. package/dist/modes/rpc/custom-capability.d.ts +2 -0
  698. package/dist/modes/rpc/custom-capability.d.ts.map +1 -1
  699. package/dist/modes/rpc/custom-capability.js +2 -0
  700. package/dist/modes/rpc/custom-capability.js.map +1 -1
  701. package/dist/modes/rpc/event-output-buffer.js.map +1 -1
  702. package/dist/modes/rpc/host-ensure.js.map +1 -1
  703. package/dist/modes/rpc/host-lifecycle.d.ts.map +1 -1
  704. package/dist/modes/rpc/host-lifecycle.js.map +1 -1
  705. package/dist/modes/rpc/host-watchdog.js.map +1 -1
  706. package/dist/modes/rpc/jsonl.js.map +1 -1
  707. package/dist/modes/rpc/multi-session-host.js.map +1 -1
  708. package/dist/modes/rpc/ownership-safe-lock.d.ts.map +1 -1
  709. package/dist/modes/rpc/ownership-safe-lock.js.map +1 -1
  710. package/dist/modes/rpc/rpc-client.d.ts +20 -1
  711. package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  712. package/dist/modes/rpc/rpc-client.js +35 -3
  713. package/dist/modes/rpc/rpc-client.js.map +1 -1
  714. package/dist/modes/rpc/rpc-input-validation.js.map +1 -1
  715. package/dist/modes/rpc/rpc-types.d.ts +103 -3
  716. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  717. package/dist/modes/rpc/rpc-types.js +6 -0
  718. package/dist/modes/rpc/rpc-types.js.map +1 -1
  719. package/dist/modes/rpc/session-binding.js.map +1 -1
  720. package/dist/modes/rpc/session-command-router.d.ts +4 -4
  721. package/dist/modes/rpc/session-command-router.d.ts.map +1 -1
  722. package/dist/modes/rpc/session-command-router.js +14 -8
  723. package/dist/modes/rpc/session-command-router.js.map +1 -1
  724. package/dist/modes/rpc/session-event-fanout.d.ts +2 -0
  725. package/dist/modes/rpc/session-event-fanout.d.ts.map +1 -1
  726. package/dist/modes/rpc/session-event-fanout.js +25 -1
  727. package/dist/modes/rpc/session-event-fanout.js.map +1 -1
  728. package/dist/modes/rpc/session-event-writer.d.ts +7 -1
  729. package/dist/modes/rpc/session-event-writer.d.ts.map +1 -1
  730. package/dist/modes/rpc/session-event-writer.js +17 -4
  731. package/dist/modes/rpc/session-event-writer.js.map +1 -1
  732. package/dist/modes/rpc/session-extension-ui-requests.d.ts.map +1 -1
  733. package/dist/modes/rpc/session-registry.d.ts.map +1 -1
  734. package/dist/modes/rpc/session-registry.js +11 -1
  735. package/dist/modes/rpc/session-registry.js.map +1 -1
  736. package/dist/modes/rpc/session-worker-client.d.ts.map +1 -1
  737. package/dist/modes/rpc/session-worker-client.js.map +1 -1
  738. package/dist/modes/rpc/session-worker-protocol.d.ts.map +1 -1
  739. package/dist/modes/rpc/session-worker-requests.d.ts.map +1 -1
  740. package/dist/modes/rpc/session-worker-requests.js +1 -1
  741. package/dist/modes/rpc/session-worker-requests.js.map +1 -1
  742. package/dist/modes/rpc/session-worker.js +10 -2
  743. package/dist/modes/rpc/session-worker.js.map +1 -1
  744. package/dist/modes/rpc/socket-event-fanout.d.ts +14 -1
  745. package/dist/modes/rpc/socket-event-fanout.d.ts.map +1 -1
  746. package/dist/modes/rpc/socket-event-fanout.js +48 -2
  747. package/dist/modes/rpc/socket-event-fanout.js.map +1 -1
  748. package/dist/modes/rpc/socket-ownership.js.map +1 -1
  749. package/dist/modes/rpc/worker-session-registry.d.ts.map +1 -1
  750. package/dist/modes/rpc/worker-session-registry.js +2 -1
  751. package/dist/modes/rpc/worker-session-registry.js.map +1 -1
  752. package/dist/package-manager-cli.js.map +1 -1
  753. package/dist/self-update-bootstrap.js.map +1 -1
  754. package/dist/utils/ansi.js.map +1 -1
  755. package/dist/utils/clipboard-image.js.map +1 -1
  756. package/dist/utils/clipboard-native.js.map +1 -1
  757. package/dist/utils/clipboard.js.map +1 -1
  758. package/dist/utils/exif-orientation.js.map +1 -1
  759. package/dist/utils/frontmatter.d.ts.map +1 -1
  760. package/dist/utils/image-resize.js.map +1 -1
  761. package/dist/utils/management-http.js.map +1 -1
  762. package/dist/utils/paths.js.map +1 -1
  763. package/dist/utils/photon.js.map +1 -1
  764. package/dist/utils/pi-user-agent.js.map +1 -1
  765. package/dist/utils/shell.d.ts.map +1 -1
  766. package/dist/utils/shell.js.map +1 -1
  767. package/dist/utils/syntax-highlight.js.map +1 -1
  768. package/dist/utils/version-check.js.map +1 -1
  769. package/docs/app-server.md +14 -0
  770. package/docs/extensions.md +28 -1
  771. package/docs/keybindings.md +1 -0
  772. package/docs/providers.md +1 -0
  773. package/docs/rpc.md +95 -3
  774. package/docs/settings.md +18 -0
  775. package/docs/skills.md +1 -1
  776. package/docs/tui.md +6 -0
  777. package/docs/usage.md +2 -1
  778. package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +30 -0
  779. package/node_modules/@code-yeongyu/senpi-codemode/README.md +17 -2
  780. package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
  781. package/node_modules/@code-yeongyu/senpi-codemode/src/config/settings.ts +35 -15
  782. package/node_modules/@code-yeongyu/senpi-codemode/src/index.ts +13 -2
  783. package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt-template.ts +76 -0
  784. package/node_modules/@code-yeongyu/senpi-codemode/src/prompt/eval-prompt.ts +6 -77
  785. package/node_modules/@code-yeongyu/senpi-codemode/src/timeouts/run-budget.ts +107 -0
  786. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-deadlines.ts +76 -0
  787. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/cell-execution.ts +25 -14
  788. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-contract.ts +4 -0
  789. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-manager.ts +47 -40
  790. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-notification.ts +2 -0
  791. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/detached-cell-snapshot.ts +5 -0
  792. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool-options.ts +8 -3
  793. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/eval-tool.ts +17 -187
  794. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/run-eval-cell.ts +189 -0
  795. package/node_modules/@code-yeongyu/senpi-codemode/src/tool/types.ts +66 -56
  796. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.d.ts.map +1 -1
  797. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js +1 -1
  798. package/node_modules/@earendil-works/pi-agent-core/dist/agent-loop.js.map +1 -1
  799. package/node_modules/@earendil-works/pi-agent-core/dist/agent.d.ts.map +1 -1
  800. package/node_modules/@earendil-works/pi-agent-core/dist/agent.js.map +1 -1
  801. package/node_modules/@earendil-works/pi-agent-core/dist/assistant-terminal-state.d.ts.map +1 -1
  802. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.d.ts.map +1 -1
  803. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js.map +1 -1
  804. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js.map +1 -1
  805. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.d.ts.map +1 -1
  806. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js.map +1 -1
  807. package/node_modules/@earendil-works/pi-agent-core/dist/harness/events.d.ts.map +1 -1
  808. package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js.map +1 -1
  809. package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js.map +1 -1
  810. package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.d.ts.map +1 -1
  811. package/node_modules/@earendil-works/pi-agent-core/dist/harness/reducer.js.map +1 -1
  812. package/node_modules/@earendil-works/pi-agent-core/dist/harness/result.d.ts.map +1 -1
  813. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/context.js.map +1 -1
  814. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/errors.d.ts.map +1 -1
  815. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.d.ts.map +1 -1
  816. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/repo.js.map +1 -1
  817. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.d.ts.map +1 -1
  818. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/jsonl/storage.js.map +1 -1
  819. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.d.ts.map +1 -1
  820. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/memory.js.map +1 -1
  821. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.d.ts.map +1 -1
  822. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js.map +1 -1
  823. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.d.ts.map +1 -1
  824. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/state.js.map +1 -1
  825. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/testing/conformance.js.map +1 -1
  826. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/types.d.ts.map +1 -1
  827. package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.d.ts +36 -36
  828. package/node_modules/@earendil-works/pi-agent-core/dist/harness/telemetry.d.ts.map +1 -1
  829. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.d.ts.map +1 -1
  830. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/truncate.js.map +1 -1
  831. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.d.ts.map +1 -1
  832. package/node_modules/@earendil-works/pi-agent-core/dist/proxy.js.map +1 -1
  833. package/node_modules/@earendil-works/pi-agent-core/dist/search/scanning.js.map +1 -1
  834. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts +5 -0
  835. package/node_modules/@earendil-works/pi-agent-core/dist/types.d.ts.map +1 -1
  836. package/node_modules/@earendil-works/pi-agent-core/dist/types.js.map +1 -1
  837. package/node_modules/@earendil-works/pi-agent-core/package.json +4 -4
  838. package/node_modules/@earendil-works/pi-ai/README.md +1 -0
  839. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts +3 -1
  840. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.d.ts.map +1 -1
  841. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js +6 -2
  842. package/node_modules/@earendil-works/pi-ai/dist/api/anthropic-messages.js.map +1 -1
  843. package/node_modules/@earendil-works/pi-ai/dist/api/azure-openai-responses.js.map +1 -1
  844. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.js.map +1 -1
  845. package/node_modules/@earendil-works/pi-ai/dist/api/bedrock-converse-stream.lazy.js.map +1 -1
  846. package/node_modules/@earendil-works/pi-ai/dist/api/context-room.d.ts.map +1 -1
  847. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/gen/agent_pb.d.ts.map +1 -1
  848. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/measure.js.map +1 -1
  849. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent/stream-retry.d.ts.map +1 -1
  850. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.js.map +1 -1
  851. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-agent.lazy.js.map +1 -1
  852. package/node_modules/@earendil-works/pi-ai/dist/api/cursor-conversation-rotation.js.map +1 -1
  853. package/node_modules/@earendil-works/pi-ai/dist/api/google-generative-ai.js.map +1 -1
  854. package/node_modules/@earendil-works/pi-ai/dist/api/google-shared.js.map +1 -1
  855. package/node_modules/@earendil-works/pi-ai/dist/api/google-vertex.js.map +1 -1
  856. package/node_modules/@earendil-works/pi-ai/dist/api/openai-codex-responses.js.map +1 -1
  857. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.d.ts.map +1 -1
  858. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js +5 -0
  859. package/node_modules/@earendil-works/pi-ai/dist/api/openai-completions.js.map +1 -1
  860. package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-edit.d.ts +4 -0
  861. package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-edit.d.ts.map +1 -0
  862. package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-edit.js +15 -0
  863. package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-edit.js.map +1 -0
  864. package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-params.d.ts +60 -0
  865. package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-params.d.ts.map +1 -0
  866. package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-params.js +93 -0
  867. package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-params.js.map +1 -0
  868. package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-result.d.ts +12 -0
  869. package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-result.d.ts.map +1 -0
  870. package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-result.js +96 -0
  871. package/node_modules/@earendil-works/pi-ai/dist/api/openai-images-result.js.map +1 -0
  872. package/node_modules/@earendil-works/pi-ai/dist/api/openai-images.d.ts +3 -6
  873. package/node_modules/@earendil-works/pi-ai/dist/api/openai-images.d.ts.map +1 -1
  874. package/node_modules/@earendil-works/pi-ai/dist/api/openai-images.js +26 -119
  875. package/node_modules/@earendil-works/pi-ai/dist/api/openai-images.js.map +1 -1
  876. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses-shared.js.map +1 -1
  877. package/node_modules/@earendil-works/pi-ai/dist/api/openai-responses.js.map +1 -1
  878. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.d.ts.map +1 -1
  879. package/node_modules/@earendil-works/pi-ai/dist/api/pi-messages.js.map +1 -1
  880. package/node_modules/@earendil-works/pi-ai/dist/api/transform-messages.js.map +1 -1
  881. package/node_modules/@earendil-works/pi-ai/dist/api/warm-prompt-cache.js.map +1 -1
  882. package/node_modules/@earendil-works/pi-ai/dist/auth/credential-store.d.ts.map +1 -1
  883. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.d.ts.map +1 -1
  884. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/load.js.map +1 -1
  885. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth/openai-codex.js.map +1 -1
  886. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth-refresh.d.ts +47 -0
  887. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth-refresh.d.ts.map +1 -0
  888. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth-refresh.js +126 -0
  889. package/node_modules/@earendil-works/pi-ai/dist/auth/oauth-refresh.js.map +1 -0
  890. package/node_modules/@earendil-works/pi-ai/dist/auth/pool/failover.d.ts.map +1 -1
  891. package/node_modules/@earendil-works/pi-ai/dist/auth/pool/select.d.ts.map +1 -1
  892. package/node_modules/@earendil-works/pi-ai/dist/auth/refresh-credential.d.ts +12 -0
  893. package/node_modules/@earendil-works/pi-ai/dist/auth/refresh-credential.d.ts.map +1 -0
  894. package/node_modules/@earendil-works/pi-ai/dist/auth/refresh-credential.js +44 -0
  895. package/node_modules/@earendil-works/pi-ai/dist/auth/refresh-credential.js.map +1 -0
  896. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts +2 -0
  897. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.d.ts.map +1 -1
  898. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js +26 -35
  899. package/node_modules/@earendil-works/pi-ai/dist/auth/resolve.js.map +1 -1
  900. package/node_modules/@earendil-works/pi-ai/dist/compat.js.map +1 -1
  901. package/node_modules/@earendil-works/pi-ai/dist/cursor/model-capabilities.js.map +1 -1
  902. package/node_modules/@earendil-works/pi-ai/dist/cursor/selection-descriptor.js.map +1 -1
  903. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.d.ts.map +1 -1
  904. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js +1 -0
  905. package/node_modules/@earendil-works/pi-ai/dist/env-api-keys.js.map +1 -1
  906. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts +99 -66
  907. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.d.ts.map +1 -1
  908. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +34 -1
  909. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js.map +1 -1
  910. package/node_modules/@earendil-works/pi-ai/dist/images.d.ts +1 -0
  911. package/node_modules/@earendil-works/pi-ai/dist/images.d.ts.map +1 -1
  912. package/node_modules/@earendil-works/pi-ai/dist/images.js +1 -0
  913. package/node_modules/@earendil-works/pi-ai/dist/images.js.map +1 -1
  914. package/node_modules/@earendil-works/pi-ai/dist/models-store.d.ts.map +1 -1
  915. package/node_modules/@earendil-works/pi-ai/dist/models.d.ts.map +1 -1
  916. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +2 -0
  917. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
  918. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +2 -0
  919. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
  920. package/node_modules/@earendil-works/pi-ai/dist/models.js +3 -28
  921. package/node_modules/@earendil-works/pi-ai/dist/models.js.map +1 -1
  922. package/node_modules/@earendil-works/pi-ai/dist/node/provider-scope.d.ts.map +1 -1
  923. package/node_modules/@earendil-works/pi-ai/dist/providers/all.d.ts.map +1 -1
  924. package/node_modules/@earendil-works/pi-ai/dist/providers/all.js +2 -0
  925. package/node_modules/@earendil-works/pi-ai/dist/providers/all.js.map +1 -1
  926. package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
  927. package/node_modules/@earendil-works/pi-ai/dist/providers/data/amazon-bedrock.json +1 -1
  928. package/node_modules/@earendil-works/pi-ai/dist/providers/data/nvidia.json +1 -1
  929. package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode-go.json +1 -1
  930. package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
  931. package/node_modules/@earendil-works/pi-ai/dist/providers/data/venice.json +1 -0
  932. package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
  933. package/node_modules/@earendil-works/pi-ai/dist/providers/faux.js.map +1 -1
  934. package/node_modules/@earendil-works/pi-ai/dist/providers/ollama.js.map +1 -1
  935. package/node_modules/@earendil-works/pi-ai/dist/providers/radius.js.map +1 -1
  936. package/node_modules/@earendil-works/pi-ai/dist/providers/venice.d.ts +3 -0
  937. package/node_modules/@earendil-works/pi-ai/dist/providers/venice.d.ts.map +1 -0
  938. package/node_modules/@earendil-works/pi-ai/dist/providers/venice.js +15 -0
  939. package/node_modules/@earendil-works/pi-ai/dist/providers/venice.js.map +1 -0
  940. package/node_modules/@earendil-works/pi-ai/dist/providers/venice.models.d.ts +4 -0
  941. package/node_modules/@earendil-works/pi-ai/dist/providers/venice.models.d.ts.map +1 -0
  942. package/node_modules/@earendil-works/pi-ai/dist/providers/venice.models.js +6 -0
  943. package/node_modules/@earendil-works/pi-ai/dist/providers/venice.models.js.map +1 -0
  944. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/context-transformer.js.map +1 -1
  945. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/anthropic-xml/recovery-wrapper-state.d.ts.map +1 -1
  946. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/protocols/kimi-xtml/parse.js.map +1 -1
  947. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-content-lifecycle.d.ts.map +1 -1
  948. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-event-stream.d.ts.map +1 -1
  949. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-native-projection.d.ts.map +1 -1
  950. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-native-projection.js.map +1 -1
  951. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-stream-terminal.d.ts.map +1 -1
  952. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-stream-wrapper.js.map +1 -1
  953. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-text-projection.d.ts.map +1 -1
  954. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/recovery-text-projection.js.map +1 -1
  955. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-thinking-projection.d.ts.map +1 -1
  956. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper-shared.d.ts.map +1 -1
  957. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper-shared.js.map +1 -1
  958. package/node_modules/@earendil-works/pi-ai/dist/tool-call-middleware/stream-wrapper.js.map +1 -1
  959. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts +20 -3
  960. package/node_modules/@earendil-works/pi-ai/dist/types.d.ts.map +1 -1
  961. package/node_modules/@earendil-works/pi-ai/dist/types.js.map +1 -1
  962. package/node_modules/@earendil-works/pi-ai/dist/utils/deferred-tools.js.map +1 -1
  963. package/node_modules/@earendil-works/pi-ai/dist/utils/event-stream.d.ts.map +1 -1
  964. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts +3 -1
  965. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.d.ts.map +1 -1
  966. package/node_modules/@earendil-works/pi-ai/dist/utils/prompt-cache-ttl.js.map +1 -1
  967. package/node_modules/@earendil-works/pi-ai/dist/utils/provider-retry.js.map +1 -1
  968. package/node_modules/@earendil-works/pi-ai/dist/utils/retry.js.map +1 -1
  969. package/node_modules/@earendil-works/pi-ai/dist/utils/validation.js.map +1 -1
  970. package/node_modules/@earendil-works/pi-ai/package.json +3 -3
  971. package/node_modules/@earendil-works/pi-pty/dist/loader.d.ts.map +1 -1
  972. package/node_modules/@earendil-works/pi-pty/dist/loader.js.map +1 -1
  973. package/node_modules/@earendil-works/pi-pty/dist/pipe-fallback.d.ts.map +1 -1
  974. package/node_modules/@earendil-works/pi-pty/dist/pipe-fallback.js.map +1 -1
  975. package/node_modules/@earendil-works/pi-pty/dist/quarantine.js.map +1 -1
  976. package/node_modules/@earendil-works/pi-pty/dist/registry-types.d.ts.map +1 -1
  977. package/node_modules/@earendil-works/pi-pty/dist/registry.d.ts.map +1 -1
  978. package/node_modules/@earendil-works/pi-pty/dist/registry.js.map +1 -1
  979. package/node_modules/@earendil-works/pi-pty/dist/screen.d.ts.map +1 -1
  980. package/node_modules/@earendil-works/pi-pty/dist/screen.js.map +1 -1
  981. package/node_modules/@earendil-works/pi-pty/dist/session-bun.js.map +1 -1
  982. package/node_modules/@earendil-works/pi-pty/dist/session.d.ts.map +1 -1
  983. package/node_modules/@earendil-works/pi-pty/dist/session.js.map +1 -1
  984. package/node_modules/@earendil-works/pi-pty/package.json +2 -2
  985. package/node_modules/@earendil-works/pi-telemetry/package.json +1 -1
  986. package/node_modules/@earendil-works/pi-tui/dist/alt-screen-search.d.ts.map +1 -1
  987. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.d.ts.map +1 -1
  988. package/node_modules/@earendil-works/pi-tui/dist/autocomplete.js.map +1 -1
  989. package/node_modules/@earendil-works/pi-tui/dist/components/alt-screen-flash.d.ts.map +1 -1
  990. package/node_modules/@earendil-works/pi-tui/dist/components/box.d.ts.map +1 -1
  991. package/node_modules/@earendil-works/pi-tui/dist/components/cancellable-loader.d.ts.map +1 -1
  992. package/node_modules/@earendil-works/pi-tui/dist/components/editor.d.ts.map +1 -1
  993. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js.map +1 -1
  994. package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.d.ts.map +1 -1
  995. package/node_modules/@earendil-works/pi-tui/dist/components/h-stack.js.map +1 -1
  996. package/node_modules/@earendil-works/pi-tui/dist/components/image.d.ts.map +1 -1
  997. package/node_modules/@earendil-works/pi-tui/dist/components/image.js.map +1 -1
  998. package/node_modules/@earendil-works/pi-tui/dist/components/input.d.ts.map +1 -1
  999. package/node_modules/@earendil-works/pi-tui/dist/components/latex.d.ts.map +1 -1
  1000. package/node_modules/@earendil-works/pi-tui/dist/components/loader.d.ts.map +1 -1
  1001. package/node_modules/@earendil-works/pi-tui/dist/components/loader.js.map +1 -1
  1002. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.d.ts.map +1 -1
  1003. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js.map +1 -1
  1004. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.d.ts.map +1 -1
  1005. package/node_modules/@earendil-works/pi-tui/dist/components/scroll-view.js.map +1 -1
  1006. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.d.ts.map +1 -1
  1007. package/node_modules/@earendil-works/pi-tui/dist/components/select-list.js.map +1 -1
  1008. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.d.ts.map +1 -1
  1009. package/node_modules/@earendil-works/pi-tui/dist/components/settings-list.js.map +1 -1
  1010. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.d.ts.map +1 -1
  1011. package/node_modules/@earendil-works/pi-tui/dist/components/spacer.js.map +1 -1
  1012. package/node_modules/@earendil-works/pi-tui/dist/components/stack.d.ts.map +1 -1
  1013. package/node_modules/@earendil-works/pi-tui/dist/components/stack.js.map +1 -1
  1014. package/node_modules/@earendil-works/pi-tui/dist/components/text.d.ts.map +1 -1
  1015. package/node_modules/@earendil-works/pi-tui/dist/components/text.js.map +1 -1
  1016. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.d.ts.map +1 -1
  1017. package/node_modules/@earendil-works/pi-tui/dist/components/truncated-text.js.map +1 -1
  1018. package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.d.ts.map +1 -1
  1019. package/node_modules/@earendil-works/pi-tui/dist/components/v-stack.js.map +1 -1
  1020. package/node_modules/@earendil-works/pi-tui/dist/image-markers.d.ts.map +1 -1
  1021. package/node_modules/@earendil-works/pi-tui/dist/index.js.map +1 -1
  1022. package/node_modules/@earendil-works/pi-tui/dist/keybindings.d.ts.map +1 -1
  1023. package/node_modules/@earendil-works/pi-tui/dist/keybindings.js.map +1 -1
  1024. package/node_modules/@earendil-works/pi-tui/dist/keys.d.ts.map +1 -1
  1025. package/node_modules/@earendil-works/pi-tui/dist/keys.js.map +1 -1
  1026. package/node_modules/@earendil-works/pi-tui/dist/kill-ring.d.ts.map +1 -1
  1027. package/node_modules/@earendil-works/pi-tui/dist/mux.js.map +1 -1
  1028. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +1 -1
  1029. package/node_modules/@earendil-works/pi-tui/dist/native-module-path.js.map +1 -1
  1030. package/node_modules/@earendil-works/pi-tui/dist/paste-markers.d.ts.map +1 -1
  1031. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.d.ts.map +1 -1
  1032. package/node_modules/@earendil-works/pi-tui/dist/stdin-buffer.js.map +1 -1
  1033. package/node_modules/@earendil-works/pi-tui/dist/terminal-capabilities.js.map +1 -1
  1034. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
  1035. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
  1036. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
  1037. package/node_modules/@earendil-works/pi-tui/dist/tmux-image-probe.js.map +1 -1
  1038. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.d.ts.map +1 -1
  1039. package/node_modules/@earendil-works/pi-tui/dist/tui-alt-screen.js.map +1 -1
  1040. package/node_modules/@earendil-works/pi-tui/dist/tui-main-screen.d.ts.map +1 -1
  1041. package/node_modules/@earendil-works/pi-tui/dist/tui.d.ts.map +1 -1
  1042. package/node_modules/@earendil-works/pi-tui/dist/tui.js.map +1 -1
  1043. package/node_modules/@earendil-works/pi-tui/dist/undo-stack.d.ts.map +1 -1
  1044. package/node_modules/@earendil-works/pi-tui/dist/utils.js.map +1 -1
  1045. package/node_modules/@earendil-works/pi-tui/package.json +2 -2
  1046. package/node_modules/css-tree/cjs/data-patch.cjs +853 -5
  1047. package/node_modules/css-tree/cjs/data.cjs +13598 -3
  1048. package/node_modules/css-tree/cjs/version.cjs +1 -3
  1049. package/node_modules/css-tree/lib/data-patch.js +853 -4
  1050. package/node_modules/css-tree/lib/data.js +13598 -5
  1051. package/node_modules/css-tree/lib/version.js +1 -5
  1052. package/package.json +8 -8
  1053. package/vendor/pi-client/client.d.ts.map +1 -1
  1054. package/vendor/pi-client/client.js.map +1 -1
  1055. package/vendor/pi-client/connection.d.ts.map +1 -1
  1056. package/vendor/pi-client/connection.js.map +1 -1
  1057. package/vendor/pi-client/errors.d.ts.map +1 -1
  1058. package/vendor/pi-client/session-handle.d.ts.map +1 -1
  1059. package/vendor/pi-client/state.d.ts.map +1 -1
  1060. package/vendor/pi-protocol/cbor/decoder.js.map +1 -1
  1061. package/vendor/pi-protocol/cbor/options.d.ts.map +1 -1
  1062. package/vendor/pi-protocol/codec.d.ts.map +1 -1
  1063. package/vendor/pi-protocol/codec.js.map +1 -1
  1064. package/vendor/pi-protocol/framing.d.ts.map +1 -1
  1065. package/vendor/pi-protocol/schemas.d.ts +678 -678
@@ -0,0 +1,45 @@
1
+ import { Type } from "typebox";
2
+ export declare const DEFAULT_IMAGE_MODEL = "gpt-image-2.5-sunburst";
3
+ export declare const IMAGE_MODEL_NAMES: {
4
+ readonly "gpt-image-2.5-sunburst": "GPT Image 2.5 Sunburst";
5
+ readonly "gpt-image-2.5-flare": "GPT Image 2.5 Flare";
6
+ readonly "gpt-image-2": "GPT Image 2";
7
+ };
8
+ export declare const Params: Type.TObject<{
9
+ prompt: Type.TString;
10
+ model: Type.TOptional<Type.TUnion<[Type.TLiteral<"gpt-image-2.5-sunburst">, Type.TLiteral<"gpt-image-2.5-flare">, Type.TLiteral<"gpt-image-2">]>>;
11
+ size: Type.TOptional<Type.TString>;
12
+ quality: Type.TOptional<Type.TUnion<[Type.TLiteral<"auto">, Type.TLiteral<"low">, Type.TLiteral<"medium">, Type.TLiteral<"high">, Type.TLiteral<"xhigh">, Type.TLiteral<"max">]>>;
13
+ reference_image_paths: Type.TOptional<Type.TArray<Type.TString>>;
14
+ mask_image_path: Type.TOptional<Type.TString>;
15
+ background: Type.TOptional<Type.TUnion<[Type.TLiteral<"auto">, Type.TLiteral<"transparent">, Type.TLiteral<"opaque">]>>;
16
+ output_format: Type.TOptional<Type.TUnion<[Type.TLiteral<"png">, Type.TLiteral<"jpeg">, Type.TLiteral<"webp">]>>;
17
+ output_compression: Type.TOptional<Type.TInteger>;
18
+ moderation: Type.TOptional<Type.TUnion<[Type.TLiteral<"auto">, Type.TLiteral<"low">]>>;
19
+ n: Type.TOptional<Type.TInteger>;
20
+ output_path: Type.TOptional<Type.TString>;
21
+ }>;
22
+ export interface GenerateImageDetails {
23
+ paths: string[];
24
+ model: string;
25
+ source: string;
26
+ size: string;
27
+ quality: string;
28
+ background: string;
29
+ outputFormat: string;
30
+ requested: number;
31
+ generated: number;
32
+ revisedPrompts: string[];
33
+ /** Provider-reported transparency of the saved images, when it reports one. */
34
+ transparentBackground?: boolean;
35
+ error?: string;
36
+ reason?: "missing_config" | "provider_native_bypass" | "invalid_params" | "write_failed" | "provider_error";
37
+ }
38
+ export declare function failure(message: string, reason: NonNullable<GenerateImageDetails["reason"]>, base: Pick<GenerateImageDetails, "model" | "size" | "quality" | "background" | "outputFormat" | "requested" | "source">): {
39
+ content: {
40
+ type: "text";
41
+ text: string;
42
+ }[];
43
+ details: GenerateImageDetails;
44
+ };
45
+ //# sourceMappingURL=params.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/imagegen/params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAC5D,eAAO,MAAM,iBAAiB;aAC7B,wBAAwB,EAAE,wBAAwB;aAClD,qBAAqB,EAAE,qBAAqB;aAC5C,aAAa,EAAE,aAAa;CACnB,CAAC;AAEX,eAAO,MAAM,MAAM;;;;;;;;;;;;;EAoGlB,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACpC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,+EAA+E;IAC/E,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,gBAAgB,GAAG,wBAAwB,GAAG,gBAAgB,GAAG,cAAc,GAAG,gBAAgB,CAAC;CAC5G;AAED,wBAAgB,OAAO,CACtB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,WAAW,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC,EACnD,IAAI,EAAE,IAAI,CACT,oBAAoB,EACpB,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,YAAY,GAAG,cAAc,GAAG,WAAW,GAAG,QAAQ,CACrF;;cAU0B,MAAM;;;;EACjC"}
@@ -0,0 +1,81 @@
1
+ import { Type } from "typebox";
2
+ export const DEFAULT_IMAGE_MODEL = "gpt-image-2.5-sunburst";
3
+ export const IMAGE_MODEL_NAMES = {
4
+ "gpt-image-2.5-sunburst": "GPT Image 2.5 Sunburst",
5
+ "gpt-image-2.5-flare": "GPT Image 2.5 Flare",
6
+ "gpt-image-2": "GPT Image 2",
7
+ };
8
+ export const Params = Type.Object({
9
+ prompt: Type.String({
10
+ minLength: 1,
11
+ maxLength: 32_000,
12
+ description: "Detailed description of the desired image, including the end state for edits.",
13
+ }),
14
+ model: Type.Optional(Type.Union([Type.Literal("gpt-image-2.5-sunburst"), Type.Literal("gpt-image-2.5-flare"), Type.Literal("gpt-image-2")], {
15
+ default: DEFAULT_IMAGE_MODEL,
16
+ description: "Sunburst (default) is the most capable: highest quality, precise edits, reference fidelity, best for final assets; Flare is the small model optimized for speed, with quality comparable to gpt-image-2; gpt-image-2 is the previous generation.",
17
+ })),
18
+ size: Type.Optional(Type.String({
19
+ default: "auto",
20
+ description: "auto, 1024x1024, 1536x1024, 1024x1536, or any WIDTHxHEIGHT with both divisible by 16, aspect between 1:3 and 3:1, max 3840x2160 (e.g. 2048x2048, 2048x1152, 3840x2160)",
21
+ })),
22
+ quality: Type.Optional(Type.Union([
23
+ Type.Literal("auto"),
24
+ Type.Literal("low"),
25
+ Type.Literal("medium"),
26
+ Type.Literal("high"),
27
+ Type.Literal("xhigh"),
28
+ Type.Literal("max"),
29
+ ], {
30
+ default: "auto",
31
+ description: "Rendering quality. Defaults to auto. xhigh/max are gpt-image-2.5 only, slower and costlier.",
32
+ })),
33
+ reference_image_paths: Type.Optional(Type.Array(Type.String({ minLength: 1 }), {
34
+ minItems: 1,
35
+ maxItems: 5,
36
+ description: "Local PNG/JPEG/WEBP images to edit or use as references (1-5 files, each at most 50 MB). Paths may be absolute or relative to the working directory.",
37
+ })),
38
+ mask_image_path: Type.Optional(Type.String({
39
+ minLength: 1,
40
+ description: "Inpainting mask (PNG with an alpha channel, same size as the first reference image): transparent areas are repainted. Requires reference_image_paths.",
41
+ })),
42
+ background: Type.Optional(Type.Union([Type.Literal("auto"), Type.Literal("transparent"), Type.Literal("opaque")], {
43
+ default: "auto",
44
+ description: "Output background. transparent needs output_format png or webp and keeps the alpha channel; auto lets the model decide.",
45
+ })),
46
+ output_format: Type.Optional(Type.Union([Type.Literal("png"), Type.Literal("jpeg"), Type.Literal("webp")], {
47
+ default: "png",
48
+ description: "File format. png (default) is lossless and supports transparency; jpeg is fastest; webp is small and supports transparency.",
49
+ })),
50
+ output_compression: Type.Optional(Type.Integer({
51
+ minimum: 0,
52
+ maximum: 100,
53
+ description: "Compression level 0-100 for jpeg or webp output only (100 = best quality).",
54
+ })),
55
+ moderation: Type.Optional(Type.Union([Type.Literal("auto"), Type.Literal("low")], {
56
+ default: "auto",
57
+ description: "Content filter strictness: auto (standard) or low (less restrictive).",
58
+ })),
59
+ n: Type.Optional(Type.Integer({
60
+ minimum: 1,
61
+ maximum: 10,
62
+ default: 1,
63
+ description: "How many variants of this one prompt to generate; distinct assets need distinct calls.",
64
+ })),
65
+ output_path: Type.Optional(Type.String({
66
+ minLength: 1,
67
+ description: "Where to write the image, relative to the working directory. The extension must match output_format (.png, .jpg/.jpeg, .webp) or be omitted. Defaults to generated-images/.",
68
+ })),
69
+ }, { additionalProperties: false });
70
+ export function failure(message, reason, base) {
71
+ const details = {
72
+ ...base,
73
+ paths: [],
74
+ generated: 0,
75
+ revisedPrompts: [],
76
+ error: message,
77
+ reason,
78
+ };
79
+ return { content: [{ type: "text", text: message }], details };
80
+ }
81
+ //# sourceMappingURL=params.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"params.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/imagegen/params.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,MAAM,CAAC,MAAM,mBAAmB,GAAG,wBAAwB,CAAC;AAC5D,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC,wBAAwB,EAAE,wBAAwB;IAClD,qBAAqB,EAAE,qBAAqB;IAC5C,aAAa,EAAE,aAAa;CACnB,CAAC;AAEX,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAChC;IACC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;QACnB,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,MAAM;QACjB,WAAW,EAAE,+EAA+E;KAC5F,CAAC;IACF,KAAK,EAAE,IAAI,CAAC,QAAQ,CACnB,IAAI,CAAC,KAAK,CACT,CAAC,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,EAC1G;QACC,OAAO,EAAE,mBAAmB;QAC5B,WAAW,EACV,kPAAkP;KACnP,CACD,CACD;IACD,IAAI,EAAE,IAAI,CAAC,QAAQ,CAClB,IAAI,CAAC,MAAM,CAAC;QACX,OAAO,EAAE,MAAM;QACf,WAAW,EACV,wKAAwK;KACzK,CAAC,CACF;IACD,OAAO,EAAE,IAAI,CAAC,QAAQ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NAMES = {\n\t\"gpt-image-2.5-sunburst\": \"GPT Image 2.5 Sunburst\",\n\t\"gpt-image-2.5-flare\": \"GPT Image 2.5 Flare\",\n\t\"gpt-image-2\": \"GPT Image 2\",\n} as const;\n\nexport const Params = Type.Object(\n\t{\n\t\tprompt: Type.String({\n\t\t\tminLength: 1,\n\t\t\tmaxLength: 32_000,\n\t\t\tdescription: \"Detailed description of the desired image, including the end state for edits.\",\n\t\t}),\n\t\tmodel: Type.Optional(\n\t\t\tType.Union(\n\t\t\t\t[Type.Literal(\"gpt-image-2.5-sunburst\"), Type.Literal(\"gpt-image-2.5-flare\"), Type.Literal(\"gpt-image-2\")],\n\t\t\t\t{\n\t\t\t\t\tdefault: DEFAULT_IMAGE_MODEL,\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"Sunburst (default) is the most capable: highest quality, precise edits, reference fidelity, best for final assets; Flare is the small model optimized for speed, with quality comparable to gpt-image-2; gpt-image-2 is the previous generation.\",\n\t\t\t\t},\n\t\t\t),\n\t\t),\n\t\tsize: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tdefault: \"auto\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"auto, 1024x1024, 1536x1024, 1024x1536, or any WIDTHxHEIGHT with both divisible by 16, aspect between 1:3 and 3:1, max 3840x2160 (e.g. 2048x2048, 2048x1152, 3840x2160)\",\n\t\t\t}),\n\t\t),\n\t\tquality: Type.Optional(\n\t\t\tType.Union(\n\t\t\t\t[\n\t\t\t\t\tType.Literal(\"auto\"),\n\t\t\t\t\tType.Literal(\"low\"),\n\t\t\t\t\tType.Literal(\"medium\"),\n\t\t\t\t\tType.Literal(\"high\"),\n\t\t\t\t\tType.Literal(\"xhigh\"),\n\t\t\t\t\tType.Literal(\"max\"),\n\t\t\t\t],\n\t\t\t\t{\n\t\t\t\t\tdefault: \"auto\",\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"Rendering quality. Defaults to auto. xhigh/max are gpt-image-2.5 only, slower and costlier.\",\n\t\t\t\t},\n\t\t\t),\n\t\t),\n\t\treference_image_paths: Type.Optional(\n\t\t\tType.Array(Type.String({ minLength: 1 }), {\n\t\t\t\tminItems: 1,\n\t\t\t\tmaxItems: 5,\n\t\t\t\tdescription:\n\t\t\t\t\t\"Local PNG/JPEG/WEBP images to edit or use as references (1-5 files, each at most 50 MB). Paths may be absolute or relative to the working directory.\",\n\t\t\t}),\n\t\t),\n\t\tmask_image_path: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tminLength: 1,\n\t\t\t\tdescription:\n\t\t\t\t\t\"Inpainting mask (PNG with an alpha channel, same size as the first reference image): transparent areas are repainted. Requires reference_image_paths.\",\n\t\t\t}),\n\t\t),\n\t\tbackground: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"auto\"), Type.Literal(\"transparent\"), Type.Literal(\"opaque\")], {\n\t\t\t\tdefault: \"auto\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Output background. transparent needs output_format png or webp and keeps the alpha channel; auto lets the model decide.\",\n\t\t\t}),\n\t\t),\n\t\toutput_format: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"png\"), Type.Literal(\"jpeg\"), Type.Literal(\"webp\")], {\n\t\t\t\tdefault: \"png\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"File format. png (default) is lossless and supports transparency; jpeg is fastest; webp is small and supports transparency.\",\n\t\t\t}),\n\t\t),\n\t\toutput_compression: Type.Optional(\n\t\t\tType.Integer({\n\t\t\t\tminimum: 0,\n\t\t\t\tmaximum: 100,\n\t\t\t\tdescription: \"Compression level 0-100 for jpeg or webp output only (100 = best quality).\",\n\t\t\t}),\n\t\t),\n\t\tmoderation: Type.Optional(\n\t\t\tType.Union([Type.Literal(\"auto\"), Type.Literal(\"low\")], {\n\t\t\t\tdefault: \"auto\",\n\t\t\t\tdescription: \"Content filter strictness: auto (standard) or low (less restrictive).\",\n\t\t\t}),\n\t\t),\n\t\tn: Type.Optional(\n\t\t\tType.Integer({\n\t\t\t\tminimum: 1,\n\t\t\t\tmaximum: 10,\n\t\t\t\tdefault: 1,\n\t\t\t\tdescription: \"How many variants of this one prompt to generate; distinct assets need distinct calls.\",\n\t\t\t}),\n\t\t),\n\t\toutput_path: Type.Optional(\n\t\t\tType.String({\n\t\t\t\tminLength: 1,\n\t\t\t\tdescription:\n\t\t\t\t\t\"Where to write the image, relative to the working directory. The extension must match output_format (.png, .jpg/.jpeg, .webp) or be omitted. Defaults to generated-images/.\",\n\t\t\t}),\n\t\t),\n\t},\n\t{ additionalProperties: false },\n);\n\nexport interface GenerateImageDetails {\n\tpaths: string[];\n\tmodel: string;\n\tsource: string;\n\tsize: string;\n\tquality: string;\n\tbackground: string;\n\toutputFormat: string;\n\trequested: number;\n\tgenerated: number;\n\trevisedPrompts: string[];\n\t/** Provider-reported transparency of the saved images, when it reports one. */\n\ttransparentBackground?: boolean;\n\terror?: string;\n\treason?: \"missing_config\" | \"provider_native_bypass\" | \"invalid_params\" | \"write_failed\" | \"provider_error\";\n}\n\nexport function failure(\n\tmessage: string,\n\treason: NonNullable<GenerateImageDetails[\"reason\"]>,\n\tbase: Pick<\n\t\tGenerateImageDetails,\n\t\t\"model\" | \"size\" | \"quality\" | \"background\" | \"outputFormat\" | \"requested\" | \"source\"\n\t>,\n) {\n\tconst details: GenerateImageDetails = {\n\t\t...base,\n\t\tpaths: [],\n\t\tgenerated: 0,\n\t\trevisedPrompts: [],\n\t\terror: message,\n\t\treason,\n\t};\n\treturn { content: [{ type: \"text\" as const, text: message }], details };\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  export declare const GENERATED_IMAGE_DIRECTORY = "generated-images";
2
+ export type OutputFormat = "png" | "jpeg" | "webp";
2
3
  export type TargetPaths = {
3
4
  ok: true;
4
5
  paths: string[];
@@ -16,11 +17,16 @@ export declare function sanitizeImageStem(identifier: string): string;
16
17
  * Resolves the absolute destination paths for a generation call.
17
18
  *
18
19
  * A relative output_path resolves against the working directory. An omitted path
19
- * falls back to generated-images/<sanitized tool call id>.png. An extensionless
20
- * path gains .png; any other extension is rejected. With more than one image a
21
- * zero-padded index is inserted before the extension.
20
+ * falls back to generated-images/<sanitized tool call id> with the format's
21
+ * extension. An extensionless path gains that extension; an extension that does
22
+ * not belong to the format is rejected (.jpg and .jpeg both serve jpeg). With more
23
+ * than one image a zero-padded index is inserted before the extension.
22
24
  */
23
- export declare function resolveTargets(cwd: string, toolCallId: string, count: number, outputPath: string | undefined): TargetPaths;
25
+ export declare function resolveTargets(cwd: string, toolCallId: string, count: number, outputPath: string | undefined, outputFormat?: OutputFormat): TargetPaths;
26
+ /** The output format a returned MIME type denotes, or undefined for anything outside the supported three. */
27
+ export declare function outputFormatOf(mimeType: string): OutputFormat | undefined;
28
+ /** Swaps a target's extension so the file name matches the bytes a provider actually returned. */
29
+ export declare function withFormatExtension(path: string, outputFormat: OutputFormat): string;
24
30
  /** Prefers a path relative to the working directory, falling back to absolute. */
25
31
  export declare function displayPath(cwd: string, absolute: string): string;
26
32
  //# sourceMappingURL=paths.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/imagegen/paths.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,yBAAyB,qBAAqB,CAAC;AAI5D,MAAM,MAAM,WAAW,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvF;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAG5D;AAMD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC7B,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,GAAG,SAAS,GAC5B,WAAW,CAmBb;AAED,kFAAkF;AAClF,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGjE"}
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/imagegen/paths.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,yBAAyB,qBAAqB,CAAC;AAI5D,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAOnD,MAAM,MAAM,WAAW,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvF;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAG5D;AAMD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC7B,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,YAAY,GAAE,YAAoB,GAChC,WAAW,CA2Bb;AAED,6GAA6G;AAC7G,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAKzE;AAED,kGAAkG;AAClG,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,GAAG,MAAM,CAMpF;AAED,kFAAkF;AAClF,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGjE"}
@@ -2,6 +2,11 @@ import { isAbsolute, relative, resolve } from "node:path";
2
2
  export const GENERATED_IMAGE_DIRECTORY = "generated-images";
3
3
  const DEFAULT_DIRECTORY = GENERATED_IMAGE_DIRECTORY;
4
4
  const MAX_TOOL_CALL_ID_CHARS = 64;
5
+ const EXTENSIONS = {
6
+ png: [".png"],
7
+ jpeg: [".jpg", ".jpeg"],
8
+ webp: [".webp"],
9
+ };
5
10
  /**
6
11
  * Reduces a provider-supplied identifier to a safe file stem: path separators and
7
12
  * any other unexpected character collapse to `_`, the result is length-capped, and
@@ -18,32 +23,60 @@ function sanitizeToolCallId(toolCallId) {
18
23
  * Resolves the absolute destination paths for a generation call.
19
24
  *
20
25
  * A relative output_path resolves against the working directory. An omitted path
21
- * falls back to generated-images/<sanitized tool call id>.png. An extensionless
22
- * path gains .png; any other extension is rejected. With more than one image a
23
- * zero-padded index is inserted before the extension.
26
+ * falls back to generated-images/<sanitized tool call id> with the format's
27
+ * extension. An extensionless path gains that extension; an extension that does
28
+ * not belong to the format is rejected (.jpg and .jpeg both serve jpeg). With more
29
+ * than one image a zero-padded index is inserted before the extension.
24
30
  */
25
- export function resolveTargets(cwd, toolCallId, count, outputPath) {
31
+ export function resolveTargets(cwd, toolCallId, count, outputPath, outputFormat = "png") {
32
+ const allowed = EXTENSIONS[outputFormat];
33
+ const defaultExtension = allowed[0] ?? ".png";
26
34
  const requested = outputPath?.trim();
27
35
  let base;
36
+ let extension;
28
37
  if (requested === undefined || requested.length === 0) {
29
- base = resolve(cwd, DEFAULT_DIRECTORY, `${sanitizeToolCallId(toolCallId)}.png`);
38
+ base = resolve(cwd, DEFAULT_DIRECTORY, `${sanitizeToolCallId(toolCallId)}${defaultExtension}`);
39
+ extension = defaultExtension;
30
40
  }
31
41
  else {
32
42
  const absolute = isAbsolute(requested) ? requested : resolve(cwd, requested);
33
43
  const extensionMatch = /\.[^./\\]+$/.exec(absolute);
34
- if (extensionMatch && extensionMatch[0].toLowerCase() !== ".png") {
35
- return { ok: false, error: `Error: output_path must end in .png (got "${requested}").` };
44
+ if (extensionMatch && !allowed.includes(extensionMatch[0].toLowerCase())) {
45
+ return {
46
+ ok: false,
47
+ error: `Error: output_path must end in ${allowed.join(" or ")} for output_format ${outputFormat} (got "${requested}").`,
48
+ };
36
49
  }
37
- base = extensionMatch ? absolute : `${absolute}.png`;
50
+ extension = extensionMatch ? extensionMatch[0] : defaultExtension;
51
+ base = extensionMatch ? absolute : `${absolute}${defaultExtension}`;
38
52
  }
39
53
  if (count === 1)
40
54
  return { ok: true, paths: [base] };
41
- const stem = base.slice(0, -".png".length);
55
+ const stem = base.slice(0, -extension.length);
42
56
  return {
43
57
  ok: true,
44
- paths: Array.from({ length: count }, (_, index) => `${stem}-${String(index + 1).padStart(2, "0")}.png`),
58
+ paths: Array.from({ length: count }, (_, index) => `${stem}-${String(index + 1).padStart(2, "0")}${extension}`),
45
59
  };
46
60
  }
61
+ /** The output format a returned MIME type denotes, or undefined for anything outside the supported three. */
62
+ export function outputFormatOf(mimeType) {
63
+ if (mimeType === "image/png")
64
+ return "png";
65
+ if (mimeType === "image/jpeg")
66
+ return "jpeg";
67
+ if (mimeType === "image/webp")
68
+ return "webp";
69
+ return undefined;
70
+ }
71
+ /** Swaps a target's extension so the file name matches the bytes a provider actually returned. */
72
+ export function withFormatExtension(path, outputFormat) {
73
+ const extension = EXTENSIONS[outputFormat][0] ?? ".png";
74
+ const extensionMatch = /\.[^./\\]+$/.exec(path);
75
+ const current = extensionMatch?.[0].toLowerCase();
76
+ if (current !== undefined && EXTENSIONS[outputFormat].includes(current))
77
+ return path;
78
+ return extensionMatch ? `${path.slice(0, -extensionMatch[0].length)}${extension}` : `${path}${extension}`;
79
+ }
47
80
  /** Prefers a path relative to the working directory, falling back to absolute. */
48
81
  export function displayPath(cwd, absolute) {
49
82
  const relativePath = relative(cwd, absolute);
@@ -1 +1 @@
1
- {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/imagegen/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE1D,MAAM,CAAC,MAAM,yBAAyB,GAAG,kBAAkB,CAAC;AAC5D,MAAM,iBAAiB,GAAG,yBAAyB,CAAC;AACpD,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AAC,CAAC,CAAC,GAAG,QAAQ,MAAM,CAAC;IACtD,CAAC;IACD,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;IACpD,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC3C,OAAO;QACN,EAAE,EAAE,IAAI;QACR,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC;KACvG,CAAC;AACH,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,WAAW,CAAC,GAAW,EAAE,QAAgB;IACxD,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC7C,OAAO,YAAY,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC9G,CAAC","sourcesContent":["import { isAbsolute, relative, resolve } from \"node:path\";\n\nexport const GENERATED_IMAGE_DIRECTORY = \"generated-images\";\nconst DEFAULT_DIRECTORY = GENERATED_IMAGE_DIRECTORY;\nconst MAX_TOOL_CALL_ID_CHARS = 64;\n\nexport type TargetPaths = { ok: true; paths: string[] } | { ok: false; error: string };\n\n/**\n * Reduces a provider-supplied identifier to a safe file stem: path separators and\n * any other unexpected character collapse to `_`, the result is length-capped, and\n * an identifier that sanitizes to nothing falls back to `image`.\n */\nexport function sanitizeImageStem(identifier: string): string {\n\tconst sanitized = identifier.replace(/[^A-Za-z0-9_-]/g, \"_\").slice(0, MAX_TOOL_CALL_ID_CHARS);\n\treturn sanitized.length > 0 ? sanitized : \"image\";\n}\n\nfunction sanitizeToolCallId(toolCallId: string): string {\n\treturn sanitizeImageStem(toolCallId);\n}\n\n/**\n * Resolves the absolute destination paths for a generation call.\n *\n * A relative output_path resolves against the working directory. An omitted path\n * falls back to generated-images/<sanitized tool call id>.png. An extensionless\n * path gains .png; any other extension is rejected. With more than one image a\n * zero-padded index is inserted before the extension.\n */\nexport function resolveTargets(\n\tcwd: string,\n\ttoolCallId: string,\n\tcount: number,\n\toutputPath: string | undefined,\n): TargetPaths {\n\tconst requested = outputPath?.trim();\n\tlet base: string;\n\tif (requested === undefined || requested.length === 0) {\n\t\tbase = resolve(cwd, DEFAULT_DIRECTORY, `${sanitizeToolCallId(toolCallId)}.png`);\n\t} else {\n\t\tconst absolute = isAbsolute(requested) ? requested : resolve(cwd, requested);\n\t\tconst extensionMatch = /\\.[^./\\\\]+$/.exec(absolute);\n\t\tif (extensionMatch && extensionMatch[0].toLowerCase() !== \".png\") {\n\t\t\treturn { ok: false, error: `Error: output_path must end in .png (got \"${requested}\").` };\n\t\t}\n\t\tbase = extensionMatch ? absolute : `${absolute}.png`;\n\t}\n\tif (count === 1) return { ok: true, paths: [base] };\n\tconst stem = base.slice(0, -\".png\".length);\n\treturn {\n\t\tok: true,\n\t\tpaths: Array.from({ length: count }, (_, index) => `${stem}-${String(index + 1).padStart(2, \"0\")}.png`),\n\t};\n}\n\n/** Prefers a path relative to the working directory, falling back to absolute. */\nexport function displayPath(cwd: string, absolute: string): string {\n\tconst relativePath = relative(cwd, absolute);\n\treturn relativePath && !relativePath.startsWith(\"..\") && !isAbsolute(relativePath) ? relativePath : absolute;\n}\n"]}
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/imagegen/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WA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from \"node:path\";\n\nexport const GENERATED_IMAGE_DIRECTORY = \"generated-images\";\nconst DEFAULT_DIRECTORY = GENERATED_IMAGE_DIRECTORY;\nconst MAX_TOOL_CALL_ID_CHARS = 64;\n\nexport type OutputFormat = \"png\" | \"jpeg\" | \"webp\";\nconst EXTENSIONS: Record<OutputFormat, readonly string[]> = {\n\tpng: [\".png\"],\n\tjpeg: [\".jpg\", \".jpeg\"],\n\twebp: [\".webp\"],\n};\n\nexport type TargetPaths = { ok: true; paths: string[] } | { ok: false; error: string };\n\n/**\n * Reduces a provider-supplied identifier to a safe file stem: path separators and\n * any other unexpected character collapse to `_`, the result is length-capped, and\n * an identifier that sanitizes to nothing falls back to `image`.\n */\nexport function sanitizeImageStem(identifier: string): string {\n\tconst sanitized = identifier.replace(/[^A-Za-z0-9_-]/g, \"_\").slice(0, MAX_TOOL_CALL_ID_CHARS);\n\treturn sanitized.length > 0 ? sanitized : \"image\";\n}\n\nfunction sanitizeToolCallId(toolCallId: string): string {\n\treturn sanitizeImageStem(toolCallId);\n}\n\n/**\n * Resolves the absolute destination paths for a generation call.\n *\n * A relative output_path resolves against the working directory. An omitted path\n * falls back to generated-images/<sanitized tool call id> with the format's\n * extension. An extensionless path gains that extension; an extension that does\n * not belong to the format is rejected (.jpg and .jpeg both serve jpeg). With more\n * than one image a zero-padded index is inserted before the extension.\n */\nexport function resolveTargets(\n\tcwd: string,\n\ttoolCallId: string,\n\tcount: number,\n\toutputPath: string | undefined,\n\toutputFormat: OutputFormat = \"png\",\n): TargetPaths {\n\tconst allowed = EXTENSIONS[outputFormat];\n\tconst defaultExtension = allowed[0] ?? \".png\";\n\tconst requested = outputPath?.trim();\n\tlet base: string;\n\tlet extension: string;\n\tif (requested === undefined || requested.length === 0) {\n\t\tbase = resolve(cwd, DEFAULT_DIRECTORY, `${sanitizeToolCallId(toolCallId)}${defaultExtension}`);\n\t\textension = defaultExtension;\n\t} else {\n\t\tconst absolute = isAbsolute(requested) ? requested : resolve(cwd, requested);\n\t\tconst extensionMatch = /\\.[^./\\\\]+$/.exec(absolute);\n\t\tif (extensionMatch && !allowed.includes(extensionMatch[0].toLowerCase())) {\n\t\t\treturn {\n\t\t\t\tok: false,\n\t\t\t\terror: `Error: output_path must end in ${allowed.join(\" or \")} for output_format ${outputFormat} (got \"${requested}\").`,\n\t\t\t};\n\t\t}\n\t\textension = extensionMatch ? extensionMatch[0] : defaultExtension;\n\t\tbase = extensionMatch ? absolute : `${absolute}${defaultExtension}`;\n\t}\n\tif (count === 1) return { ok: true, paths: [base] };\n\tconst stem = base.slice(0, -extension.length);\n\treturn {\n\t\tok: true,\n\t\tpaths: Array.from({ length: count }, (_, index) => `${stem}-${String(index + 1).padStart(2, \"0\")}${extension}`),\n\t};\n}\n\n/** The output format a returned MIME type denotes, or undefined for anything outside the supported three. */\nexport function outputFormatOf(mimeType: string): OutputFormat | undefined {\n\tif (mimeType === \"image/png\") return \"png\";\n\tif (mimeType === \"image/jpeg\") return \"jpeg\";\n\tif (mimeType === \"image/webp\") return \"webp\";\n\treturn undefined;\n}\n\n/** Swaps a target's extension so the file name matches the bytes a provider actually returned. */\nexport function withFormatExtension(path: string, outputFormat: OutputFormat): string {\n\tconst extension = EXTENSIONS[outputFormat][0] ?? \".png\";\n\tconst extensionMatch = /\\.[^./\\\\]+$/.exec(path);\n\tconst current = extensionMatch?.[0].toLowerCase();\n\tif (current !== undefined && EXTENSIONS[outputFormat].includes(current)) return path;\n\treturn extensionMatch ? `${path.slice(0, -extensionMatch[0].length)}${extension}` : `${path}${extension}`;\n}\n\n/** Prefers a path relative to the working directory, falling back to absolute. */\nexport function displayPath(cwd: string, absolute: string): string {\n\tconst relativePath = relative(cwd, absolute);\n\treturn relativePath && !relativePath.startsWith(\"..\") && !isAbsolute(relativePath) ? relativePath : absolute;\n}\n"]}
@@ -0,0 +1,20 @@
1
+ import type { ImageContent } from "@earendil-works/pi-ai/compat";
2
+ type ReferenceImages = {
3
+ ok: true;
4
+ images: ImageContent[];
5
+ } | {
6
+ ok: false;
7
+ error: string;
8
+ };
9
+ type LoadedImage = {
10
+ ok: true;
11
+ image: ImageContent;
12
+ } | {
13
+ ok: false;
14
+ error: string;
15
+ };
16
+ export declare function loadReferenceImages(cwd: string, paths: string[] | undefined): Promise<ReferenceImages>;
17
+ /** The inpainting mask is one more local image, bound to the first reference by the API. */
18
+ export declare function loadMaskImage(cwd: string, path: string | undefined, referenceCount: number): Promise<LoadedImage | undefined>;
19
+ export {};
20
+ //# sourceMappingURL=reference-images.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reference-images.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/imagegen/reference-images.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAQjE,KAAK,eAAe,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,YAAY,EAAE,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAC3F,KAAK,WAAW,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAiCpF,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,SAAS,GAAG,OAAO,CAAC,eAAe,CAAC,CAY5G;AAED,4FAA4F;AAC5F,wBAAsB,aAAa,CAClC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,cAAc,EAAE,MAAM,GACpB,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC,CAMlC"}
@@ -0,0 +1,70 @@
1
+ import { constants } from "node:fs";
2
+ import { open } from "node:fs/promises";
3
+ import { resolve } from "node:path";
4
+ const MAX_REFERENCE_BYTES = 50 * 1024 * 1024;
5
+ const PNG_SIGNATURE = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
6
+ const JPEG_SIGNATURE = Buffer.from([0xff, 0xd8, 0xff]);
7
+ const RIFF_SIGNATURE = Buffer.from("RIFF");
8
+ const WEBP_SIGNATURE = Buffer.from("WEBP");
9
+ function imageMimeType(bytes) {
10
+ if (bytes.subarray(0, 8).equals(PNG_SIGNATURE))
11
+ return "image/png";
12
+ if (bytes.subarray(0, 3).equals(JPEG_SIGNATURE))
13
+ return "image/jpeg";
14
+ if (bytes.subarray(0, 4).equals(RIFF_SIGNATURE) && bytes.subarray(8, 12).equals(WEBP_SIGNATURE)) {
15
+ return "image/webp";
16
+ }
17
+ return undefined;
18
+ }
19
+ async function loadImageFile(cwd, path, label) {
20
+ try {
21
+ // Nonblocking open lets us reject FIFOs without waiting for a writer.
22
+ const file = await open(resolve(cwd, path), constants.O_RDONLY | constants.O_NONBLOCK);
23
+ try {
24
+ const stat = await file.stat();
25
+ if (!stat.isFile())
26
+ throw new Error("must be a regular file");
27
+ if (stat.size > MAX_REFERENCE_BYTES)
28
+ throw new Error("must be at most 50 MB");
29
+ const bytes = await file.readFile();
30
+ if (bytes.length > MAX_REFERENCE_BYTES)
31
+ throw new Error("must be at most 50 MB");
32
+ const mimeType = imageMimeType(bytes);
33
+ if (mimeType === undefined)
34
+ throw new Error("must be a PNG, JPEG, or WEBP image (invalid magic bytes)");
35
+ return { ok: true, image: { type: "image", data: bytes.toString("base64"), mimeType } };
36
+ }
37
+ finally {
38
+ await file.close();
39
+ }
40
+ }
41
+ catch (error) {
42
+ const reason = error instanceof Error ? error.message : String(error);
43
+ return { ok: false, error: `Error: ${label} "${path}": ${reason}` };
44
+ }
45
+ }
46
+ export async function loadReferenceImages(cwd, paths) {
47
+ if (paths === undefined)
48
+ return { ok: true, images: [] };
49
+ if (paths.length < 1 || paths.length > 5) {
50
+ return { ok: false, error: `Error: reference_image_paths must contain 1 to 5 paths (got ${paths.length}).` };
51
+ }
52
+ const images = [];
53
+ for (const path of paths) {
54
+ const loaded = await loadImageFile(cwd, path, "reference image");
55
+ if (!loaded.ok)
56
+ return loaded;
57
+ images.push(loaded.image);
58
+ }
59
+ return { ok: true, images };
60
+ }
61
+ /** The inpainting mask is one more local image, bound to the first reference by the API. */
62
+ export async function loadMaskImage(cwd, path, referenceCount) {
63
+ if (path === undefined)
64
+ return undefined;
65
+ if (referenceCount === 0) {
66
+ return { ok: false, error: "Error: mask_image_path requires at least one reference_image_paths entry to edit." };
67
+ }
68
+ return loadImageFile(cwd, path, "mask image");
69
+ }
70
+ //# sourceMappingURL=reference-images.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reference-images.js","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/imagegen/reference-images.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,mBAAmB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAC7C,MAAM,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AACpF,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AACvD,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC3C,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAK3C,SAAS,aAAa,CAAC,KAAa;IACnC,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC,EA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D,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC7B,CAAC;AAED,4FAA4F;AAC5F,MAAM,CAAC,KAAK,UAAU,aAAa,CAClC,GAAW,EACX,IAAwB,EACxB,cAAsB;IAEtB,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACzC,IAAI,cAAc,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,mFAAmF,EAAE,CAAC;IAClH,CAAC;IACD,OAAO,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import { constants } from \"node:fs\";\nimport { open } from \"node:fs/promises\";\nimport { resolve } from \"node:path\";\nimport type { ImageContent } from \"@earendil-works/pi-ai/compat\";\n\nconst MAX_REFERENCE_BYTES = 50 * 1024 * 1024;\nconst PNG_SIGNATURE = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);\nconst JPEG_SIGNATURE = Buffer.from([0xff, 0xd8, 0xff]);\nconst RIFF_SIGNATURE = Buffer.from(\"RIFF\");\nconst WEBP_SIGNATURE = Buffer.from(\"WEBP\");\n\ntype ReferenceImages = { ok: true; images: ImageContent[] } | { ok: false; error: string };\ntype LoadedImage = { ok: true; image: ImageContent } | { ok: false; error: string };\n\nfunction imageMimeType(bytes: Buffer): string | undefined {\n\tif (bytes.subarray(0, 8).equals(PNG_SIGNATURE)) return \"image/png\";\n\tif (bytes.subarray(0, 3).equals(JPEG_SIGNATURE)) return \"image/jpeg\";\n\tif (bytes.subarray(0, 4).equals(RIFF_SIGNATURE) && bytes.subarray(8, 12).equals(WEBP_SIGNATURE)) {\n\t\treturn \"image/webp\";\n\t}\n\treturn undefined;\n}\n\nasync function loadImageFile(cwd: string, path: string, label: string): Promise<LoadedImage> {\n\ttry {\n\t\t// Nonblocking open lets us reject FIFOs without waiting for a writer.\n\t\tconst file = await open(resolve(cwd, path), constants.O_RDONLY | constants.O_NONBLOCK);\n\t\ttry {\n\t\t\tconst stat = await file.stat();\n\t\t\tif (!stat.isFile()) throw new Error(\"must be a regular file\");\n\t\t\tif (stat.size > MAX_REFERENCE_BYTES) throw new Error(\"must be at most 50 MB\");\n\t\t\tconst bytes = await file.readFile();\n\t\t\tif (bytes.length > MAX_REFERENCE_BYTES) throw new Error(\"must be at most 50 MB\");\n\t\t\tconst mimeType = imageMimeType(bytes);\n\t\t\tif (mimeType === undefined) throw new Error(\"must be a PNG, JPEG, or WEBP image (invalid magic bytes)\");\n\t\t\treturn { ok: true, image: { type: \"image\", data: bytes.toString(\"base64\"), mimeType } };\n\t\t} finally {\n\t\t\tawait file.close();\n\t\t}\n\t} catch (error) {\n\t\tconst reason = error instanceof Error ? error.message : String(error);\n\t\treturn { ok: false, error: `Error: ${label} \"${path}\": ${reason}` };\n\t}\n}\n\nexport async function loadReferenceImages(cwd: string, paths: string[] | undefined): Promise<ReferenceImages> {\n\tif (paths === undefined) return { ok: true, images: [] };\n\tif (paths.length < 1 || paths.length > 5) {\n\t\treturn { ok: false, error: `Error: reference_image_paths must contain 1 to 5 paths (got ${paths.length}).` };\n\t}\n\tconst images: ImageContent[] = [];\n\tfor (const path of paths) {\n\t\tconst loaded = await loadImageFile(cwd, path, \"reference image\");\n\t\tif (!loaded.ok) return loaded;\n\t\timages.push(loaded.image);\n\t}\n\treturn { ok: true, images };\n}\n\n/** The inpainting mask is one more local image, bound to the first reference by the API. */\nexport async function loadMaskImage(\n\tcwd: string,\n\tpath: string | undefined,\n\treferenceCount: number,\n): Promise<LoadedImage | undefined> {\n\tif (path === undefined) return undefined;\n\tif (referenceCount === 0) {\n\t\treturn { ok: false, error: \"Error: mask_image_path requires at least one reference_image_paths entry to edit.\" };\n\t}\n\treturn loadImageFile(cwd, path, \"mask image\");\n}\n"]}
@@ -1,67 +1,92 @@
1
1
  ---
2
2
  name: gpt-image-gen
3
- description: MUST read before generating images. Detailed prompt-crafting guide for gpt-image models, covering tool routing (native image_generation server tool vs the generate_image tool), prompt structure from subject to background, verbatim text rendering, anti-patterns, and the revised_prompt feedback loop for iteration.
3
+ description: MUST read before generating images. Prompt-crafting guide for gpt-image-2.5 covering tool routing (native image_generation server tool vs the generate_image tool), model and quality selection, prompt structure, exact text rendering, reference-image editing, transparent assets, output formats, and multi-turn refinement.
4
4
  ---
5
5
 
6
6
  # GPT Image Generation
7
7
 
8
- How to write image prompts that come back right the first time, and how to fix them fast when they don't. Read this before your first generation call.
8
+ How to get the image right the first time, and how to fix it fast when it is not. Read this before your first generation call.
9
9
 
10
10
  ## Which tool
11
11
 
12
12
  When image generation tooling is present in your tool set, pick the surface that actually exists right now:
13
13
 
14
14
  - If a native `image_generation` server tool is available, use it. The provider runs generation server-side and returns the image in the response stream.
15
- - Otherwise, call the `generate_image` tool. It sends your prompt to the configured OpenAI-compatible endpoint and saves the result to a file.
15
+ - Otherwise, call the `generate_image` tool. It sends your prompt and optional reference images to the configured OpenAI-compatible endpoint and saves the result as a png, jpeg, or webp file. The model, quality, size, background, and format controls below apply to `generate_image`, not to the native server tool.
16
16
 
17
- Check your current tool set before choosing. Skill visibility refreshes on reload, but tool state can change mid-session (model switch, credential change), so trust the tools you can see over what this page said at startup. If both surfaces ever appear, prefer the native server tool.
17
+ Check your current tool set before choosing. Tool state can change mid-session (model switch, credential change), so trust the tools you can see over what this page said at startup. If both surfaces ever appear, prefer the native server tool. When the request is clear, generate directly instead of asking for confirmation; ask only when a required reference image is missing.
18
+
19
+ ## Model selection
20
+
21
+ - `gpt-image-2.5-sunburst` (default): the base model, optimized for quality, above gpt-image-2. Use it for precise edits, fidelity to reference subjects and products, dense text or diagrams, and final production assets.
22
+ - `gpt-image-2.5-flare`: the small model, optimized for speed, with quality comparable to gpt-image-2. Reach for it when latency or volume matters more than the last increment of quality.
23
+ - `gpt-image-2`: previous generation; quality tiers stop at `high`, transparency is preview-level.
24
+
25
+ The default is the better model on purpose. When a workflow turns out to be latency-sensitive, run the same prompt and inputs on Flare and switch only if the result still meets the bar.
18
26
 
19
27
  ## Prompt crafting
20
28
 
21
- This section is the core of the skill. gpt-image models reward detail, and the single most common failure mode is a one-line prompt.
29
+ Start from the deliverable, then describe what is visible. Match the prompt's specificity to the user's request:
22
30
 
23
- Build each prompt from six parts, in this order:
31
+ - A specific request (exact text, a named layout, a product photo brief) is normalized, not padded. Keep every stated requirement; do not add objects, people, brands, slogans, or story beats the user did not ask for.
32
+ - A generic request ("a logo for a bakery") gets tasteful concreteness: medium, composition, lighting, palette, materials. Stay within what the request implies.
24
33
 
25
- 1. Subject. Who or what, with concrete physical detail. "A middle-aged baker with flour on her forearms and a gray-streaked braid" beats "a baker".
26
- 2. Medium and style. One style, stated plainly: "35mm film photograph", "watercolor illustration", "flat vector poster". Pick one lane.
27
- 3. Composition and camera. Framing, angle, focal length or its visual equivalent. "Eye-level medium close-up, shallow depth of field, subject left of center".
28
- 4. Lighting and color. Direction, quality, palette. "Soft window light from the left, warm amber tones against deep shadow".
29
- 5. Mood. The emotional register: quiet, tense, celebratory, clinical.
30
- 6. Background. What sits behind the subject, and how much of it is in focus.
34
+ Cover these when they matter: the deliverable and its use (poster, product shot, UI mockup, diagram, icon); the subject with concrete physical detail; one medium or style, stated plainly; composition and camera (framing, angle, focal length or its visual equivalent); lighting and color; mood; background and how much of it is in focus. For people, describe body framing, gaze, and interaction ("full body visible, feet included", "looking down at the open book").
31
35
 
32
- A good prompt reads as a short paragraph, not a list and not a lone sentence. If your prompt fits on one line, it is under-specified, and the model will fill the gaps with whatever it likes.
36
+ A short specific prompt is fine. For complex requests, organize the prompt into labeled sections (scene, subject, details, constraints); a descriptive paragraph and a labeled spec express the same intent, so choose whichever is easier to read and update. Request "photorealistic" or "real photograph" explicitly when that is the goal; camera specifications are cues for appearance, not a guarantee of exact optics.
33
37
 
34
38
  ### Rendering text in the image
35
39
 
36
- When the image must contain readable text (a sign, a label, a headline), put the exact string in double quotes and state the font style and placement:
40
+ Put the exact string in double quotes, say how many times it appears, and describe its position and typography: `A weathered wooden sign above the door reads "OPEN TIL LATE" once, in hand-painted white serif letters, centered, slightly faded.` Spell unusual words or brand names letter by letter when they matter. Add "no other text" so the model does not invent captions. Keep on-image text short; long passages smear. Use `quality` `medium` or `high` for small text, dense labels, or multiple fonts, then check spelling and legibility in the result.
37
41
 
38
- A weathered wooden sign above the door reads "OPEN TIL LATE" in hand-painted white serif letters, centered, slightly faded.
42
+ ### Anti-patterns
39
43
 
40
- Keep on-image text short. Long passages smear. If the layout matters, say where each string sits.
44
+ - Contradictory instructions. "Photorealistic watercolor" or "minimalist scene packed with detail" averages two opposing goals, and you get neither.
45
+ - Element overcrowding. Past roughly five or six distinct elements, small ones get dropped or mangled. Cut before you add.
46
+ - Style-list collisions. "In the style of anime, oil painting, and pixel art" is three prompts. Choose one style per image and generate variants separately.
47
+ - Invented content. Extra characters, logos, watermarks, or slogans the user never asked for. State exclusions when the model tends to add them ("no watermark, no logo").
41
48
 
42
- ### Anti-patterns
49
+ ## Quality, size, and format
50
+
51
+ `quality` accepts `low`, `medium`, `high`, `xhigh`, `max`, or `auto` (default). Explore with `auto` or a lower tier; raise it for the final image only while it fixes an unmet requirement, since a higher tier does not guarantee a better image and costs more latency. `xhigh` and `max` exist only on GPT Image 2.5; the API rejects them on `gpt-image-2`.
52
+
53
+ `size` defaults to `auto`. Presets: `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait). Custom `WIDTHxHEIGHT` works when both edges are multiples of 16, the aspect ratio stays within 1:3 to 3:1, neither edge exceeds 3840, and the total pixel count is between 655,360 and 8,294,400 (4K is `3840x2160` or `2160x3840`, not `3840x3840`). Outputs above `2560x1440` are experimental; square images are usually fastest.
54
+
55
+ `output_format`: `png` (default) is lossless and keeps alpha; `jpeg` is the fastest and smallest for photos with no transparency; `webp` is small and keeps alpha. `output_compression` (0-100) applies to jpeg and webp only. The `output_path` extension must match the format or be omitted.
56
+
57
+ ### Transparent assets
58
+
59
+ For logos, stickers, cutouts, and UI icons set `background: "transparent"` with `output_format` `png` or `webp`, and also ask for an isolated subject in the prompt ("isolated on a transparent background, no drop shadow"). A drawn checkerboard is not transparency: after saving, confirm the file has an alpha channel (the result reports `Background: transparent` when the provider confirms it) and inspect edges, hair, glass, and shadows. Repeat the transparent requirement on every later edit of that asset. On `gpt-image-2` transparency is a preview feature; prefer a 2.5 model and verify the alpha channel either way.
60
+
61
+ ## Editing with reference images
43
62
 
44
- - Contradictory instructions. "Photorealistic watercolor" or "minimalist scene packed with detail" forces the model to average two opposing goals, and you get neither.
45
- - Element overcrowding. Every named object competes for pixels and attention. Past roughly five or six distinct elements, small ones get dropped or mangled. Cut before you add.
46
- - Style-list collisions. "In the style of anime, oil painting, and pixel art" is three prompts in a trench coat. Choose one style per image and generate variants separately.
63
+ Pass `reference_image_paths` to edit an existing image or to use images as references: 1-5 local png, jpeg, or webp files, each at most 50 MB, absolute or relative to the working directory. With references the tool sends an image-edit request; without them it generates from text. Assign each input a role by position ("image 1 is the product to keep unchanged; image 2 is the style reference") and say how they combine.
47
64
 
48
- ### The revised_prompt loop
65
+ Separate the change from the constraints. Say "change only X" and list what must stay fixed: identity, geometry, layout, lighting, labels, colors, surrounding objects. Describe the desired END STATE, not only the delta.
49
66
 
50
- Both surfaces can return a `revised_prompt`: the prompt the model actually used after its own rewrite. Always read it.
67
+ For a local repaint, add `mask_image_path`: a png with an alpha channel the same size as the first reference, where transparent pixels mark the area to repaint. Masking is prompt-guided, so restate the edit and the preserved regions in words too.
51
68
 
52
- 1. Diff it against your intent. Note what the model added, dropped, or reinterpreted.
53
- 2. Fold the delta into your next prompt explicitly. If the rewrite dropped "overcast sky", put "overcast sky, no direct sunlight" back with more weight. If it added something you dislike, name the exclusion ("no lens flare").
54
- 3. Regenerate. Treat each round as a conversation with the rewriter, not a fresh roll of the dice.
69
+ ```json
70
+ {
71
+ "prompt": "The same red fox from image 1, now wearing a knitted blue scarf, in an eye-level wildlife photograph. Change only the scarf. Preserve its face, fur markings, pose, and forest background; soft overcast light, muted woodland colors, shallow depth of field.",
72
+ "model": "gpt-image-2.5-sunburst",
73
+ "reference_image_paths": ["art/fox.png"],
74
+ "quality": "high",
75
+ "size": "2048x1152",
76
+ "output_path": "art/fox-with-scarf.png"
77
+ }
78
+ ```
55
79
 
56
- ## Editing and masks
80
+ Use a new `output_path` so the source stays intact. Only the native server tool returns a `revised_prompt` (the mainline model's rewrite); the client tool reports one in `details.revisedPrompts` only when the provider sends it, so judge the saved image against your request rather than waiting for a rewrite.
57
81
 
58
- v1 has no editing surface. The `generate_image` tool is text-only: it accepts a prompt and returns new images. There is no image input, no mask, no inpainting, no variation mode. The native `image_generation` server tool may perform provider-side edits on its own (action=auto), but no edit controls are exposed here.
82
+ ## Multi-turn refinement
59
83
 
60
- Don't build workflows around editing. If the user asks to change an existing image, say that v1 generates from text only, then offer the closest text-only path: describe the desired end state as a full new prompt. Editing, masks, and image input are planned for a future version.
84
+ - Generate one image first and inspect it against every clause of the request before spending more.
85
+ - Refine one thing per turn: pass the previous output as the next `reference_image_paths` entry, request the single change, and restate the constraints that must survive. "Same style as before" carries context, but restate critical details if the result drifts.
86
+ - For a recurring character or product, establish one reference image and reuse it in every scene, repeating its defining details.
87
+ - `n` produces variants of one prompt; distinct assets need distinct calls. Use `n` only after the prompt is proven.
88
+ - Keep the full prompt text in the conversation as the reproducibility record.
61
89
 
62
- ## Iteration workflow
90
+ ## Check the result
63
91
 
64
- - Generate one image first. Inspect the result against every clause of your prompt before spending more.
65
- - Correct deviations by editing the prompt, not by hoping. Name what was wrong and what stays fixed.
66
- - Batch with `n` only after the prompt is proven. `n` variants of a bad prompt is `n` bad images.
67
- - Keep the full prompt text in the conversation. It is your reproducibility record: anyone can re-run the exact call later, and you can diff prompt versions when results drift.
92
+ Before handing the image over: required text is spelled correctly and legible; identities, product shapes, and labels survived; the edit changed only what was requested; a transparent asset has real alpha rather than a painted background; diagram labels and relationships are correct. Fix a miss by editing the prompt or masking the region, not by regenerating blindly.
@@ -1,22 +1,18 @@
1
- import { Type } from "typebox";
2
- export interface GenerateImageDetails {
3
- paths: string[];
4
- model: string;
5
- source: string;
6
- size: string;
7
- quality: string;
8
- requested: number;
9
- generated: number;
10
- revisedPrompts: string[];
11
- error?: string;
12
- reason?: "missing_config" | "provider_native_bypass" | "invalid_params" | "write_failed" | "provider_error";
13
- }
1
+ import { type GenerateImageDetails } from "./params.ts";
2
+ export type { GenerateImageDetails } from "./params.ts";
14
3
  export declare const GENERATE_IMAGE_TOOL_NAME = "generate_image";
15
- export declare const generateImageTool: import("../../types.ts").ToolDefinition<Type.TObject<{
16
- prompt: Type.TString;
17
- size: Type.TOptional<Type.TUnion<[Type.TLiteral<"auto">, Type.TLiteral<"1024x1024">, Type.TLiteral<"1024x1536">, Type.TLiteral<"1536x1024">]>>;
18
- quality: Type.TOptional<Type.TUnion<[Type.TLiteral<"auto">, Type.TLiteral<"low">, Type.TLiteral<"medium">, Type.TLiteral<"high">]>>;
19
- n: Type.TOptional<Type.TInteger>;
20
- output_path: Type.TOptional<Type.TString>;
4
+ export declare const generateImageTool: import("../../types.ts").ToolDefinition<import("typebox").TObject<{
5
+ prompt: import("typebox").TString;
6
+ model: import("typebox").TOptional<import("typebox").TUnion<[import("typebox").TLiteral<"gpt-image-2.5-sunburst">, import("typebox").TLiteral<"gpt-image-2.5-flare">, import("typebox").TLiteral<"gpt-image-2">]>>;
7
+ size: import("typebox").TOptional<import("typebox").TString>;
8
+ quality: import("typebox").TOptional<import("typebox").TUnion<[import("typebox").TLiteral<"auto">, import("typebox").TLiteral<"low">, import("typebox").TLiteral<"medium">, import("typebox").TLiteral<"high">, import("typebox").TLiteral<"xhigh">, import("typebox").TLiteral<"max">]>>;
9
+ reference_image_paths: import("typebox").TOptional<import("typebox").TArray<import("typebox").TString>>;
10
+ mask_image_path: import("typebox").TOptional<import("typebox").TString>;
11
+ background: import("typebox").TOptional<import("typebox").TUnion<[import("typebox").TLiteral<"auto">, import("typebox").TLiteral<"transparent">, import("typebox").TLiteral<"opaque">]>>;
12
+ output_format: import("typebox").TOptional<import("typebox").TUnion<[import("typebox").TLiteral<"png">, import("typebox").TLiteral<"jpeg">, import("typebox").TLiteral<"webp">]>>;
13
+ output_compression: import("typebox").TOptional<import("typebox").TInteger>;
14
+ moderation: import("typebox").TOptional<import("typebox").TUnion<[import("typebox").TLiteral<"auto">, import("typebox").TLiteral<"low">]>>;
15
+ n: import("typebox").TOptional<import("typebox").TInteger>;
16
+ output_path: import("typebox").TOptional<import("typebox").TString>;
21
17
  }>, GenerateImageDetails, any> & import("../../types.ts").ToolDefinition<any, any, any>;
22
18
  //# sourceMappingURL=tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/imagegen/tool.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAyC/B,MAAM,WAAW,oBAAoB;IACpC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,gBAAgB,GAAG,wBAAwB,GAAG,gBAAgB,GAAG,cAAc,GAAG,gBAAgB,CAAC;CAC5G;AAiFD,eAAO,MAAM,wBAAwB,mBAAmB,CAAC;AAEzD,eAAO,MAAM,iBAAiB;;;;;;uFA4F5B,CAAC"}
1
+ {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../../../../src/core/extensions/builtin/imagegen/tool.ts"],"names":[],"mappings":"AAYA,OAAO,EAAgC,KAAK,oBAAoB,EAA6B,MAAM,aAAa,CAAC;AAKjH,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAoExD,eAAO,MAAM,wBAAwB,mBAAmB,CAAC;AAEzD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;uFAoJ5B,CAAC"}