@psnext/slingcli 2.4.20260507-3 → 2.4.20260509-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (393) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +1 -1
  3. package/bin/sling.js +39 -16
  4. package/node_modules/@aws-sdk/client-bedrock-runtime/package.json +2 -2
  5. package/node_modules/@aws-sdk/token-providers/package.json +1 -1
  6. package/node_modules/{@mariozechner → @earendil-works}/pi-agent-core/dist/agent-loop.js +1 -1
  7. package/node_modules/{@mariozechner → @earendil-works}/pi-agent-core/dist/agent.js +4 -3
  8. package/node_modules/@earendil-works/pi-agent-core/dist/harness/agent-harness.js +526 -0
  9. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/branch-summarization.js +243 -0
  10. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +616 -0
  11. package/node_modules/@earendil-works/pi-agent-core/dist/harness/env/nodejs.js +348 -0
  12. package/node_modules/@earendil-works/pi-agent-core/dist/harness/execution-env.js +3 -0
  13. package/node_modules/@earendil-works/pi-agent-core/dist/harness/factory.js +9 -0
  14. package/node_modules/@earendil-works/pi-agent-core/dist/harness/messages.js +102 -0
  15. package/node_modules/@earendil-works/pi-agent-core/dist/harness/prompt-templates.js +194 -0
  16. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/jsonl.js +92 -0
  17. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/memory.js +42 -0
  18. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/repo/shared.js +31 -0
  19. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/session.js +196 -0
  20. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/jsonl.js +170 -0
  21. package/node_modules/@earendil-works/pi-agent-core/dist/harness/session/storage/memory.js +90 -0
  22. package/node_modules/@earendil-works/pi-agent-core/dist/harness/skills.js +258 -0
  23. package/node_modules/@earendil-works/pi-agent-core/dist/harness/system-prompt.js +30 -0
  24. package/node_modules/@earendil-works/pi-agent-core/dist/harness/types.js +16 -0
  25. package/node_modules/@earendil-works/pi-agent-core/dist/harness/utils/shell-output.js +97 -0
  26. package/node_modules/@earendil-works/pi-agent-core/dist/index.js +26 -0
  27. package/node_modules/{@mariozechner → @earendil-works}/pi-agent-core/dist/proxy.js +1 -1
  28. package/node_modules/{@mariozechner → @earendil-works}/pi-agent-core/package.json +7 -5
  29. package/node_modules/{@mariozechner → @earendil-works}/pi-ai/dist/cli.js +6 -6
  30. package/node_modules/{@mariozechner → @earendil-works}/pi-ai/dist/env-api-keys.js +1 -0
  31. package/node_modules/@earendil-works/pi-ai/dist/image-models.generated.js +307 -0
  32. package/node_modules/@earendil-works/pi-ai/dist/image-models.js +23 -0
  33. package/node_modules/@earendil-works/pi-ai/dist/images-api-registry.js +22 -0
  34. package/node_modules/@earendil-works/pi-ai/dist/images.js +14 -0
  35. package/node_modules/{@mariozechner → @earendil-works}/pi-ai/dist/index.js +4 -0
  36. package/node_modules/{@mariozechner → @earendil-works}/pi-ai/dist/models.generated.js +427 -122
  37. package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.js +129 -0
  38. package/node_modules/@earendil-works/pi-ai/dist/providers/images/register-builtins.js +34 -0
  39. package/node_modules/{@mariozechner → @earendil-works}/pi-ai/dist/providers/openai-codex-responses.js +1 -1
  40. package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/openai-completions.js +150 -122
  41. package/node_modules/{@mariozechner → @earendil-works}/pi-ai/dist/providers/openai-responses-shared.js +14 -1
  42. package/node_modules/{@mariozechner → @earendil-works}/pi-ai/dist/utils/oauth/openai-codex.js +25 -14
  43. package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/overflow.js +3 -0
  44. package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/package.json +5 -4
  45. package/node_modules/@earendil-works/pi-coding-agent/dist/bun/register-bedrock.js +4 -0
  46. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/cli/args.js +1 -0
  47. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/cli/config-selector.js +1 -1
  48. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/cli/list-models.js +1 -1
  49. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/cli/session-picker.js +1 -1
  50. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/config.js +52 -30
  51. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/agent-session.js +1 -1
  52. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/auth-storage.js +2 -2
  53. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/compaction/branch-summarization.js +1 -1
  54. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/compaction/compaction.js +1 -1
  55. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/utils.js +153 -0
  56. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/export-html/template.css +45 -1
  57. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/export-html/template.js +68 -4
  58. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/extensions/loader.js +26 -12
  59. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/keybindings.js +1 -1
  60. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/model-registry.js +3 -2
  61. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/model-resolver.js +2 -1
  62. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/package-manager.js +22 -5
  63. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/provider-display-names.js +1 -0
  64. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/sdk.js +3 -3
  65. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/bash.js +1 -1
  66. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/edit.js +1 -1
  67. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/find.js +1 -1
  68. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/grep.js +1 -1
  69. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/ls.js +1 -1
  70. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/read.js +3 -2
  71. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/render-utils.js +1 -1
  72. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/truncate.js +205 -0
  73. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/write.js +1 -1
  74. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/main.js +2 -2
  75. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/migrations.js +3 -3
  76. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/assistant-message.js +1 -1
  77. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/bash-execution.js +1 -1
  78. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/bordered-loader.js +1 -1
  79. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/branch-summary-message.js +1 -1
  80. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/compaction-summary-message.js +1 -1
  81. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/config-selector.js +25 -3
  82. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/custom-editor.js +1 -1
  83. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/custom-message.js +1 -1
  84. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/earendil-announcement.js +1 -1
  85. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/extension-editor.js +1 -1
  86. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/extension-input.js +1 -1
  87. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/extension-selector.js +1 -1
  88. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/footer.js +1 -1
  89. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/keybinding-hints.js +36 -0
  90. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +4 -3
  91. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/model-selector.js +2 -2
  92. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/oauth-selector.js +1 -1
  93. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/scoped-models-selector.js +1 -1
  94. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/session-selector-search.js +1 -1
  95. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/session-selector.js +1 -1
  96. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/settings-selector.js +4 -2
  97. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/show-images-selector.js +1 -1
  98. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/skill-invocation-message.js +1 -1
  99. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/theme-selector.js +1 -1
  100. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/thinking-selector.js +1 -1
  101. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/tool-execution.js +1 -1
  102. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/tree-selector.js +3 -2
  103. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/user-message-selector.js +1 -1
  104. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/user-message.js +1 -1
  105. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/visual-truncate.js +1 -1
  106. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/interactive-mode.js +47 -32
  107. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/theme/dark.json +1 -1
  108. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/theme/light.json +1 -1
  109. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/theme/theme.js +1 -1
  110. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/package-manager-cli.js +42 -39
  111. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/clipboard.js +9 -2
  112. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/paths.js +16 -0
  113. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/version-check.js +9 -2
  114. package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/package.json +9 -8
  115. package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/image.js +14 -7
  116. package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/markdown.js +24 -84
  117. package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/terminal-image.js +10 -4
  118. package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/tui.js +73 -4
  119. package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/utils.js +33 -7
  120. package/node_modules/{@mariozechner → @earendil-works}/pi-tui/package.json +3 -3
  121. package/node_modules/@mariozechner/clipboard/README.md +58 -0
  122. package/node_modules/@mariozechner/clipboard/index.d.ts +23 -0
  123. package/node_modules/@mariozechner/clipboard-linux-x64-gnu/README.md +3 -0
  124. package/node_modules/@types/node/README.md +1 -1
  125. package/node_modules/@types/node/http2.d.ts +4 -1
  126. package/node_modules/@types/node/package.json +2 -2
  127. package/node_modules/@types/node/stream/web.d.ts +4 -0
  128. package/node_modules/brace-expansion/dist/commonjs/index.js +1 -1
  129. package/node_modules/brace-expansion/dist/commonjs/index.js.map +1 -1
  130. package/node_modules/brace-expansion/dist/esm/index.js +1 -1
  131. package/node_modules/brace-expansion/dist/esm/index.js.map +1 -1
  132. package/node_modules/brace-expansion/package.json +1 -1
  133. package/node_modules/fast-xml-builder/CHANGELOG.md +4 -0
  134. package/node_modules/fast-xml-builder/lib/fxb.cjs +1 -1
  135. package/node_modules/fast-xml-builder/lib/fxb.d.cts +91 -1
  136. package/node_modules/fast-xml-builder/lib/fxb.min.js +1 -1
  137. package/node_modules/fast-xml-builder/lib/fxb.min.js.map +1 -1
  138. package/node_modules/fast-xml-builder/package.json +3 -2
  139. package/node_modules/fast-xml-builder/src/fxb.d.ts +92 -3
  140. package/node_modules/fast-xml-builder/src/fxb.js +92 -31
  141. package/node_modules/fast-xml-builder/src/orderedJs2Xml.js +87 -33
  142. package/node_modules/get-east-asian-width/lookup-data.js +15 -12
  143. package/node_modules/get-east-asian-width/lookup.js +25 -22
  144. package/node_modules/get-east-asian-width/package.json +1 -1
  145. package/node_modules/jiti/README.md +258 -0
  146. package/node_modules/jiti/dist/babel.cjs +257 -0
  147. package/node_modules/jiti/dist/jiti.cjs +1 -0
  148. package/node_modules/jiti/lib/jiti.mjs +29 -0
  149. package/node_modules/jiti/lib/types.d.ts +420 -0
  150. package/node_modules/jiti/package.json +146 -0
  151. package/node_modules/protobufjs/dist/light/protobuf.js +5 -3
  152. package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
  153. package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
  154. package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
  155. package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
  156. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
  157. package/node_modules/protobufjs/dist/protobuf.js +5 -3
  158. package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  159. package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  160. package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  161. package/node_modules/protobufjs/package.json +1 -1
  162. package/node_modules/protobufjs/src/namespace.js +3 -1
  163. package/node_modules/semver/README.md +19 -4
  164. package/node_modules/semver/bin/semver.js +14 -10
  165. package/node_modules/semver/functions/truncate.js +48 -0
  166. package/node_modules/semver/index.js +2 -0
  167. package/node_modules/semver/internal/re.js +1 -1
  168. package/node_modules/semver/package.json +3 -3
  169. package/node_modules/semver/range.bnf +5 -4
  170. package/node_modules/socks/package.json +2 -2
  171. package/node_modules/xml-naming/README.md +189 -0
  172. package/node_modules/xml-naming/package.json +54 -0
  173. package/node_modules/xml-naming/src/index.d.ts +74 -0
  174. package/node_modules/xml-naming/src/index.js +270 -0
  175. package/package.json +6 -6
  176. package/sling-default-packages.json +2 -1
  177. package/slingshot/index.js +442 -23
  178. package/node_modules/@mariozechner/jiti/dist/babel.cjs +0 -246
  179. package/node_modules/@mariozechner/jiti/dist/jiti.cjs +0 -1
  180. package/node_modules/@mariozechner/jiti/package.json +0 -96
  181. package/node_modules/@mariozechner/pi-agent-core/dist/index.js +0 -9
  182. package/node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/dist/cli.js +0 -116
  183. package/node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/dist/env-api-keys.js +0 -166
  184. package/node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/dist/index.js +0 -15
  185. package/node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/dist/models.generated.js +0 -16568
  186. package/node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/dist/providers/amazon-bedrock.js +0 -753
  187. package/node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/dist/providers/openai-codex-responses.js +0 -909
  188. package/node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/dist/providers/openai-responses-shared.js +0 -479
  189. package/node_modules/@mariozechner/pi-agent-core/node_modules/@mariozechner/pi-ai/dist/utils/oauth/openai-codex.js +0 -374
  190. package/node_modules/@mariozechner/pi-ai/dist/api-registry.js +0 -44
  191. package/node_modules/@mariozechner/pi-ai/dist/bedrock-provider.js +0 -6
  192. package/node_modules/@mariozechner/pi-ai/dist/models.js +0 -71
  193. package/node_modules/@mariozechner/pi-ai/dist/oauth.js +0 -2
  194. package/node_modules/@mariozechner/pi-ai/dist/providers/anthropic.js +0 -951
  195. package/node_modules/@mariozechner/pi-ai/dist/providers/azure-openai-responses.js +0 -208
  196. package/node_modules/@mariozechner/pi-ai/dist/providers/cloudflare.js +0 -26
  197. package/node_modules/@mariozechner/pi-ai/dist/providers/faux.js +0 -368
  198. package/node_modules/@mariozechner/pi-ai/dist/providers/github-copilot-headers.js +0 -29
  199. package/node_modules/@mariozechner/pi-ai/dist/providers/google-shared.js +0 -329
  200. package/node_modules/@mariozechner/pi-ai/dist/providers/google-vertex.js +0 -442
  201. package/node_modules/@mariozechner/pi-ai/dist/providers/google.js +0 -400
  202. package/node_modules/@mariozechner/pi-ai/dist/providers/mistral.js +0 -535
  203. package/node_modules/@mariozechner/pi-ai/dist/providers/openai-completions.js +0 -908
  204. package/node_modules/@mariozechner/pi-ai/dist/providers/openai-responses.js +0 -220
  205. package/node_modules/@mariozechner/pi-ai/dist/providers/register-builtins.js +0 -243
  206. package/node_modules/@mariozechner/pi-ai/dist/providers/simple-options.js +0 -39
  207. package/node_modules/@mariozechner/pi-ai/dist/providers/transform-messages.js +0 -184
  208. package/node_modules/@mariozechner/pi-ai/dist/stream.js +0 -27
  209. package/node_modules/@mariozechner/pi-ai/dist/types.js +0 -2
  210. package/node_modules/@mariozechner/pi-ai/dist/utils/event-stream.js +0 -81
  211. package/node_modules/@mariozechner/pi-ai/dist/utils/hash.js +0 -14
  212. package/node_modules/@mariozechner/pi-ai/dist/utils/headers.js +0 -8
  213. package/node_modules/@mariozechner/pi-ai/dist/utils/json-parse.js +0 -113
  214. package/node_modules/@mariozechner/pi-ai/dist/utils/oauth/anthropic.js +0 -335
  215. package/node_modules/@mariozechner/pi-ai/dist/utils/oauth/github-copilot.js +0 -292
  216. package/node_modules/@mariozechner/pi-ai/dist/utils/oauth/index.js +0 -121
  217. package/node_modules/@mariozechner/pi-ai/dist/utils/oauth/oauth-page.js +0 -105
  218. package/node_modules/@mariozechner/pi-ai/dist/utils/oauth/pkce.js +0 -31
  219. package/node_modules/@mariozechner/pi-ai/dist/utils/oauth/types.js +0 -2
  220. package/node_modules/@mariozechner/pi-ai/dist/utils/overflow.js +0 -146
  221. package/node_modules/@mariozechner/pi-ai/dist/utils/sanitize-unicode.js +0 -26
  222. package/node_modules/@mariozechner/pi-ai/dist/utils/typebox-helpers.js +0 -21
  223. package/node_modules/@mariozechner/pi-ai/dist/utils/validation.js +0 -281
  224. package/node_modules/@mariozechner/pi-ai/package.json +0 -108
  225. package/node_modules/@mariozechner/pi-coding-agent/dist/bun/register-bedrock.js +0 -4
  226. package/node_modules/@mariozechner/pi-coding-agent/dist/modes/interactive/components/keybinding-hints.js +0 -22
  227. package/node_modules/@mariozechner/pi-coding-agent/node_modules/@mariozechner/pi-agent-core/dist/agent-loop.js +0 -458
  228. package/node_modules/@mariozechner/pi-coding-agent/node_modules/@mariozechner/pi-agent-core/dist/agent.js +0 -398
  229. package/node_modules/@mariozechner/pi-coding-agent/node_modules/@mariozechner/pi-agent-core/dist/index.js +0 -9
  230. package/node_modules/@mariozechner/pi-coding-agent/node_modules/@mariozechner/pi-agent-core/dist/proxy.js +0 -278
  231. package/node_modules/@mariozechner/pi-coding-agent/node_modules/@mariozechner/pi-agent-core/dist/types.js +0 -2
  232. package/node_modules/@mariozechner/pi-coding-agent/node_modules/@mariozechner/pi-agent-core/package.json +0 -45
  233. package/node_modules/socks/.claude/settings.local.json +0 -26
  234. package/node_modules/std-env/LICENCE +0 -22
  235. package/node_modules/std-env/README.md +0 -118
  236. package/node_modules/std-env/dist/index.cjs +0 -1
  237. package/node_modules/std-env/dist/index.d.cts +0 -92
  238. package/node_modules/std-env/dist/index.d.mts +0 -92
  239. package/node_modules/std-env/dist/index.d.ts +0 -92
  240. package/node_modules/std-env/dist/index.mjs +0 -1
  241. package/node_modules/std-env/package.json +0 -46
  242. package/node_modules/yoctocolors/base.d.ts +0 -47
  243. package/node_modules/yoctocolors/base.js +0 -94
  244. package/node_modules/yoctocolors/index.d.ts +0 -2
  245. package/node_modules/yoctocolors/index.js +0 -2
  246. package/node_modules/yoctocolors/license +0 -9
  247. package/node_modules/yoctocolors/package.json +0 -69
  248. package/node_modules/yoctocolors/readme.md +0 -138
  249. /package/node_modules/{@mariozechner/pi-coding-agent/dist/core → @earendil-works/pi-agent-core/dist/harness}/compaction/utils.js +0 -0
  250. /package/node_modules/{@mariozechner/pi-coding-agent/dist/core/tools → @earendil-works/pi-agent-core/dist/harness/utils}/truncate.js +0 -0
  251. /package/node_modules/{@mariozechner → @earendil-works}/pi-agent-core/dist/types.js +0 -0
  252. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/api-registry.js +0 -0
  253. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/bedrock-provider.js +0 -0
  254. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/models.js +0 -0
  255. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/oauth.js +0 -0
  256. /package/node_modules/{@mariozechner → @earendil-works}/pi-ai/dist/providers/amazon-bedrock.js +0 -0
  257. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/anthropic.js +0 -0
  258. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/azure-openai-responses.js +0 -0
  259. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/cloudflare.js +0 -0
  260. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/faux.js +0 -0
  261. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/github-copilot-headers.js +0 -0
  262. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/google-shared.js +0 -0
  263. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/google-vertex.js +0 -0
  264. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/google.js +0 -0
  265. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/mistral.js +0 -0
  266. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/openai-responses.js +0 -0
  267. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/register-builtins.js +0 -0
  268. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/simple-options.js +0 -0
  269. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/providers/transform-messages.js +0 -0
  270. /package/node_modules/{@mariozechner → @earendil-works}/pi-ai/dist/session-resources.js +0 -0
  271. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/stream.js +0 -0
  272. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/types.js +0 -0
  273. /package/node_modules/{@mariozechner → @earendil-works}/pi-ai/dist/utils/diagnostics.js +0 -0
  274. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/event-stream.js +0 -0
  275. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/hash.js +0 -0
  276. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/headers.js +0 -0
  277. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/json-parse.js +0 -0
  278. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/oauth/anthropic.js +0 -0
  279. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/oauth/github-copilot.js +0 -0
  280. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/oauth/index.js +0 -0
  281. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/oauth/oauth-page.js +0 -0
  282. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/oauth/pkce.js +0 -0
  283. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/oauth/types.js +0 -0
  284. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/sanitize-unicode.js +0 -0
  285. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/typebox-helpers.js +0 -0
  286. /package/node_modules/{@mariozechner/pi-agent-core/node_modules/@mariozechner → @earendil-works}/pi-ai/dist/utils/validation.js +0 -0
  287. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/bun/cli.js +0 -0
  288. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/bun/restore-sandbox-env.js +0 -0
  289. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/cli/file-processor.js +0 -0
  290. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/cli/initial-message.js +0 -0
  291. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/cli.js +0 -0
  292. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/agent-session-runtime.js +0 -0
  293. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/agent-session-services.js +0 -0
  294. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/auth-guidance.js +0 -0
  295. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/bash-executor.js +0 -0
  296. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/compaction/index.js +0 -0
  297. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/defaults.js +0 -0
  298. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/diagnostics.js +0 -0
  299. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/event-bus.js +0 -0
  300. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/exec.js +0 -0
  301. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/export-html/ansi-to-html.js +0 -0
  302. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/export-html/index.js +0 -0
  303. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/export-html/template.html +0 -0
  304. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/export-html/tool-renderer.js +0 -0
  305. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/export-html/vendor/highlight.min.js +0 -0
  306. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/export-html/vendor/marked.min.js +0 -0
  307. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/extensions/index.js +0 -0
  308. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/extensions/runner.js +0 -0
  309. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/extensions/types.js +0 -0
  310. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/extensions/wrapper.js +0 -0
  311. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/footer-data-provider.js +0 -0
  312. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/index.js +0 -0
  313. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/messages.js +0 -0
  314. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/output-guard.js +0 -0
  315. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/prompt-templates.js +0 -0
  316. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/resolve-config-value.js +0 -0
  317. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/resource-loader.js +0 -0
  318. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/session-cwd.js +0 -0
  319. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/session-manager.js +0 -0
  320. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/settings-manager.js +0 -0
  321. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/skills.js +0 -0
  322. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/slash-commands.js +0 -0
  323. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/source-info.js +0 -0
  324. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/system-prompt.js +0 -0
  325. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/telemetry.js +0 -0
  326. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/timings.js +0 -0
  327. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/edit-diff.js +0 -0
  328. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/file-mutation-queue.js +0 -0
  329. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/index.js +0 -0
  330. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/output-accumulator.js +0 -0
  331. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/path-utils.js +0 -0
  332. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/core/tools/tool-definition-wrapper.js +0 -0
  333. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/index.js +0 -0
  334. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/index.js +0 -0
  335. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/assets/clankolas.png +0 -0
  336. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/armin.js +0 -0
  337. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/countdown-timer.js +0 -0
  338. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/daxnuts.js +0 -0
  339. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/diff.js +0 -0
  340. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/dynamic-border.js +0 -0
  341. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/components/index.js +0 -0
  342. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/interactive/theme/theme-schema.json +0 -0
  343. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/print-mode.js +0 -0
  344. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/rpc/jsonl.js +0 -0
  345. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/rpc/rpc-client.js +0 -0
  346. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/rpc/rpc-mode.js +0 -0
  347. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/modes/rpc/rpc-types.js +0 -0
  348. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/changelog.js +0 -0
  349. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/child-process.js +0 -0
  350. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/clipboard-image.js +0 -0
  351. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/clipboard-native.js +0 -0
  352. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/exif-orientation.js +0 -0
  353. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/frontmatter.js +0 -0
  354. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/fs-watch.js +0 -0
  355. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/git.js +0 -0
  356. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/image-convert.js +0 -0
  357. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/image-resize.js +0 -0
  358. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/mime.js +0 -0
  359. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/photon.js +0 -0
  360. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/pi-user-agent.js +0 -0
  361. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/shell.js +0 -0
  362. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/sleep.js +0 -0
  363. /package/node_modules/{@mariozechner → @earendil-works}/pi-coding-agent/dist/utils/tools-manager.js +0 -0
  364. /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/autocomplete.js +0 -0
  365. /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/box.js +0 -0
  366. /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/cancellable-loader.js +0 -0
  367. /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/editor.js +0 -0
  368. /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/input.js +0 -0
  369. /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/loader.js +0 -0
  370. /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/select-list.js +0 -0
  371. /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/settings-list.js +0 -0
  372. /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/spacer.js +0 -0
  373. /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/text.js +0 -0
  374. /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/components/truncated-text.js +0 -0
  375. /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/editor-component.js +0 -0
  376. /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/fuzzy.js +0 -0
  377. /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/index.js +0 -0
  378. /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/keybindings.js +0 -0
  379. /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/keys.js +0 -0
  380. /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/kill-ring.js +0 -0
  381. /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/stdin-buffer.js +0 -0
  382. /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/terminal.js +0 -0
  383. /package/node_modules/{@mariozechner → @earendil-works}/pi-tui/dist/undo-stack.js +0 -0
  384. /package/node_modules/{@mariozechner/jiti → jiti}/LICENSE +0 -0
  385. /package/node_modules/{@mariozechner/jiti → jiti}/lib/jiti-cli.mjs +0 -0
  386. /package/node_modules/{@mariozechner/jiti → jiti}/lib/jiti-hooks.mjs +0 -0
  387. /package/node_modules/{@mariozechner/jiti → jiti}/lib/jiti-native.mjs +0 -0
  388. /package/node_modules/{@mariozechner/jiti → jiti}/lib/jiti-register.d.mts +0 -0
  389. /package/node_modules/{@mariozechner/jiti → jiti}/lib/jiti-register.mjs +0 -0
  390. /package/node_modules/{@mariozechner/jiti/lib/jiti.mjs → jiti/lib/jiti-static.mjs} +0 -0
  391. /package/node_modules/{@mariozechner/jiti → jiti}/lib/jiti.cjs +0 -0
  392. /package/node_modules/{@mariozechner/jiti → jiti}/lib/jiti.d.cts +0 -0
  393. /package/node_modules/{@mariozechner/jiti → jiti}/lib/jiti.d.mts +0 -0
@@ -1,146 +0,0 @@
1
- /**
2
- * Regex patterns to detect context overflow errors from different providers.
3
- *
4
- * These patterns match error messages returned when the input exceeds
5
- * the model's context window.
6
- *
7
- * Provider-specific patterns (with example error messages):
8
- *
9
- * - Anthropic: "prompt is too long: 213462 tokens > 200000 maximum"
10
- * - Anthropic: "413 {\"error\":{\"type\":\"request_too_large\",\"message\":\"Request exceeds the maximum size\"}}"
11
- * - OpenAI: "Your input exceeds the context window of this model"
12
- * - Google: "The input token count (1196265) exceeds the maximum number of tokens allowed (1048575)"
13
- * - xAI: "This model's maximum prompt length is 131072 but the request contains 537812 tokens"
14
- * - Groq: "Please reduce the length of the messages or completion"
15
- * - OpenRouter: "This endpoint's maximum context length is X tokens. However, you requested about Y tokens"
16
- * - llama.cpp: "the request exceeds the available context size, try increasing it"
17
- * - LM Studio: "tokens to keep from the initial prompt is greater than the context length"
18
- * - GitHub Copilot: "prompt token count of X exceeds the limit of Y"
19
- * - MiniMax: "invalid params, context window exceeds limit"
20
- * - Kimi For Coding: "Your request exceeded model token limit: X (requested: Y)"
21
- * - Cerebras: "400/413 status code (no body)"
22
- * - Mistral: "Prompt contains X tokens ... too large for model with Y maximum context length"
23
- * - z.ai: Does NOT error, accepts overflow silently - handled via usage.input > contextWindow
24
- * - Xiaomi MiMo: Truncates input to fill contextWindow exactly, then returns finish_reason "length"
25
- * with output=0 (no room left to generate). Detected via stopReason "length" + zero output +
26
- * input filling the context window.
27
- * - Ollama: Some deployments truncate silently, others return errors like "prompt too long; exceeded max context length by X tokens"
28
- */
29
- const OVERFLOW_PATTERNS = [
30
- /prompt is too long/i, // Anthropic token overflow
31
- /request_too_large/i, // Anthropic request byte-size overflow (HTTP 413)
32
- /input is too long for requested model/i, // Amazon Bedrock
33
- /exceeds the context window/i, // OpenAI (Completions & Responses API)
34
- /input token count.*exceeds the maximum/i, // Google (Gemini)
35
- /maximum prompt length is \d+/i, // xAI (Grok)
36
- /reduce the length of the messages/i, // Groq
37
- /maximum context length is \d+ tokens/i, // OpenRouter (all backends)
38
- /exceeds the limit of \d+/i, // GitHub Copilot
39
- /exceeds the available context size/i, // llama.cpp server
40
- /greater than the context length/i, // LM Studio
41
- /context window exceeds limit/i, // MiniMax
42
- /exceeded model token limit/i, // Kimi For Coding
43
- /too large for model with \d+ maximum context length/i, // Mistral
44
- /model_context_window_exceeded/i, // z.ai non-standard finish_reason surfaced as error text
45
- /prompt too long; exceeded (?:max )?context length/i, // Ollama explicit overflow error
46
- /context[_ ]length[_ ]exceeded/i, // Generic fallback
47
- /too many tokens/i, // Generic fallback
48
- /token limit exceeded/i, // Generic fallback
49
- /^4(?:00|13)\s*(?:status code)?\s*\(no body\)/i, // Cerebras: 400/413 with no body
50
- ];
51
- /**
52
- * Patterns that indicate non-overflow errors (e.g. rate limiting, server errors).
53
- * Error messages matching any of these are excluded from overflow detection
54
- * even if they also match an OVERFLOW_PATTERN.
55
- *
56
- * Example: Bedrock formats throttling errors as "ThrottlingException: Too many tokens,
57
- * please wait before trying again." which would match the /too many tokens/i overflow
58
- * pattern without this exclusion.
59
- */
60
- const NON_OVERFLOW_PATTERNS = [
61
- /^(Throttling error|Service unavailable):/i, // AWS Bedrock non-overflow errors (human-readable prefixes from formatBedrockError)
62
- /rate limit/i, // Generic rate limiting
63
- /too many requests/i, // Generic HTTP 429 style
64
- ];
65
- /**
66
- * Check if an assistant message represents a context overflow error.
67
- *
68
- * This handles two cases:
69
- * 1. Error-based overflow: Most providers return stopReason "error" with a
70
- * specific error message pattern.
71
- * 2. Silent overflow: Some providers accept overflow requests and return
72
- * successfully. For these, we check if usage.input exceeds the context window.
73
- *
74
- * ## Reliability by Provider
75
- *
76
- * **Reliable detection (returns error with detectable message):**
77
- * - Anthropic: "prompt is too long: X tokens > Y maximum" or "request_too_large"
78
- * - OpenAI (Completions & Responses): "exceeds the context window"
79
- * - Google Gemini: "input token count exceeds the maximum"
80
- * - xAI (Grok): "maximum prompt length is X but request contains Y"
81
- * - Groq: "reduce the length of the messages"
82
- * - Cerebras: 400/413 status code (no body)
83
- * - Mistral: "Prompt contains X tokens ... too large for model with Y maximum context length"
84
- * - OpenRouter (all backends): "maximum context length is X tokens"
85
- * - llama.cpp: "exceeds the available context size"
86
- * - LM Studio: "greater than the context length"
87
- * - Kimi For Coding: "exceeded model token limit: X (requested: Y)"
88
- *
89
- * **Unreliable detection:**
90
- * - z.ai: Sometimes accepts overflow silently (detectable via usage.input > contextWindow),
91
- * sometimes returns rate limit errors. Pass contextWindow param to detect silent overflow.
92
- * - Xiaomi MiMo: Truncates input to fit contextWindow then returns stopReason "length" with
93
- * output=0. Pass contextWindow param to detect via the "filled context + zero output" signal.
94
- * - Ollama: May truncate input silently for some setups, but may also return explicit
95
- * overflow errors that match the patterns above. Silent truncation still cannot be
96
- * detected here because we do not know the expected token count.
97
- *
98
- * ## Custom Providers
99
- *
100
- * If you've added custom models via settings.json, this function may not detect
101
- * overflow errors from those providers. To add support:
102
- *
103
- * 1. Send a request that exceeds the model's context window
104
- * 2. Check the errorMessage in the response
105
- * 3. Create a regex pattern that matches the error
106
- * 4. The pattern should be added to OVERFLOW_PATTERNS in this file, or
107
- * check the errorMessage yourself before calling this function
108
- *
109
- * @param message - The assistant message to check
110
- * @param contextWindow - Optional context window size for detecting silent overflow (z.ai)
111
- * @returns true if the message indicates a context overflow
112
- */
113
- export function isContextOverflow(message, contextWindow) {
114
- // Case 1: Check error message patterns
115
- if (message.stopReason === "error" && message.errorMessage) {
116
- // Skip messages matching known non-overflow patterns (e.g. throttling / rate-limit)
117
- const isNonOverflow = NON_OVERFLOW_PATTERNS.some((p) => p.test(message.errorMessage));
118
- if (!isNonOverflow && OVERFLOW_PATTERNS.some((p) => p.test(message.errorMessage))) {
119
- return true;
120
- }
121
- }
122
- // Case 2: Silent overflow (z.ai style) - successful but usage exceeds context
123
- if (contextWindow && message.stopReason === "stop") {
124
- const inputTokens = message.usage.input + message.usage.cacheRead;
125
- if (inputTokens > contextWindow) {
126
- return true;
127
- }
128
- }
129
- // Case 3: Length-stop overflow (Xiaomi MiMo style) - server truncates oversized input
130
- // to fit the context window, leaving no room for output. Returns stopReason "length"
131
- // with output=0 and input+cacheRead filling the context window.
132
- if (contextWindow && message.stopReason === "length" && message.usage.output === 0) {
133
- const inputTokens = message.usage.input + message.usage.cacheRead;
134
- if (inputTokens >= contextWindow * 0.99) {
135
- return true;
136
- }
137
- }
138
- return false;
139
- }
140
- /**
141
- * Get the overflow patterns for testing purposes.
142
- */
143
- export function getOverflowPatterns() {
144
- return [...OVERFLOW_PATTERNS];
145
- }
146
- //# sourceMappingURL=overflow.js.map
@@ -1,26 +0,0 @@
1
- /**
2
- * Removes unpaired Unicode surrogate characters from a string.
3
- *
4
- * Unpaired surrogates (high surrogates 0xD800-0xDBFF without matching low surrogates 0xDC00-0xDFFF,
5
- * or vice versa) cause JSON serialization errors in many API providers.
6
- *
7
- * Valid emoji and other characters outside the Basic Multilingual Plane use properly paired
8
- * surrogates and will NOT be affected by this function.
9
- *
10
- * @param text - The text to sanitize
11
- * @returns The sanitized text with unpaired surrogates removed
12
- *
13
- * @example
14
- * // Valid emoji (properly paired surrogates) are preserved
15
- * sanitizeSurrogates("Hello 🙈 World") // => "Hello 🙈 World"
16
- *
17
- * // Unpaired high surrogate is removed
18
- * const unpaired = String.fromCharCode(0xD83D); // high surrogate without low
19
- * sanitizeSurrogates(`Text ${unpaired} here`) // => "Text here"
20
- */
21
- export function sanitizeSurrogates(text) {
22
- // Replace unpaired high surrogates (0xD800-0xDBFF not followed by low surrogate)
23
- // Replace unpaired low surrogates (0xDC00-0xDFFF not preceded by high surrogate)
24
- return text.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g, "");
25
- }
26
- //# sourceMappingURL=sanitize-unicode.js.map
@@ -1,21 +0,0 @@
1
- import { Type } from "typebox";
2
- /**
3
- * Creates a string enum schema compatible with Google's API and other providers
4
- * that don't support anyOf/const patterns.
5
- *
6
- * @example
7
- * const OperationSchema = StringEnum(["add", "subtract", "multiply", "divide"], {
8
- * description: "The operation to perform"
9
- * });
10
- *
11
- * type Operation = Static<typeof OperationSchema>; // "add" | "subtract" | "multiply" | "divide"
12
- */
13
- export function StringEnum(values, options) {
14
- return Type.Unsafe({
15
- type: "string",
16
- enum: values,
17
- ...(options?.description && { description: options.description }),
18
- ...(options?.default && { default: options.default }),
19
- });
20
- }
21
- //# sourceMappingURL=typebox-helpers.js.map
@@ -1,281 +0,0 @@
1
- import { Compile } from "typebox/compile";
2
- import { Value } from "typebox/value";
3
- const validatorCache = new WeakMap();
4
- const TYPEBOX_KIND = Symbol.for("TypeBox.Kind");
5
- function isRecord(value) {
6
- return typeof value === "object" && value !== null;
7
- }
8
- function isJsonSchemaObject(value) {
9
- return isRecord(value);
10
- }
11
- function hasTypeBoxMetadata(schema) {
12
- return isRecord(schema) && Object.getOwnPropertySymbols(schema).includes(TYPEBOX_KIND);
13
- }
14
- function getSchemaTypes(schema) {
15
- if (typeof schema.type === "string") {
16
- return [schema.type];
17
- }
18
- if (Array.isArray(schema.type)) {
19
- return schema.type.filter((type) => typeof type === "string");
20
- }
21
- return [];
22
- }
23
- function matchesJsonType(value, type) {
24
- switch (type) {
25
- case "number":
26
- return typeof value === "number";
27
- case "integer":
28
- return typeof value === "number" && Number.isInteger(value);
29
- case "boolean":
30
- return typeof value === "boolean";
31
- case "string":
32
- return typeof value === "string";
33
- case "null":
34
- return value === null;
35
- case "array":
36
- return Array.isArray(value);
37
- case "object":
38
- return isRecord(value) && !Array.isArray(value);
39
- default:
40
- return false;
41
- }
42
- }
43
- function isValidatorSchema(value) {
44
- return isRecord(value);
45
- }
46
- function getSubSchemaValidator(schema) {
47
- if (!isValidatorSchema(schema)) {
48
- return undefined;
49
- }
50
- try {
51
- return getValidator(schema);
52
- }
53
- catch {
54
- return undefined;
55
- }
56
- }
57
- function coercePrimitiveByType(value, type) {
58
- switch (type) {
59
- case "number": {
60
- if (value === null) {
61
- return 0;
62
- }
63
- if (typeof value === "string" && value.trim() !== "") {
64
- const parsed = Number(value);
65
- if (Number.isFinite(parsed)) {
66
- return parsed;
67
- }
68
- }
69
- if (typeof value === "boolean") {
70
- return value ? 1 : 0;
71
- }
72
- return value;
73
- }
74
- case "integer": {
75
- if (value === null) {
76
- return 0;
77
- }
78
- if (typeof value === "string" && value.trim() !== "") {
79
- const parsed = Number(value);
80
- if (Number.isInteger(parsed)) {
81
- return parsed;
82
- }
83
- }
84
- if (typeof value === "boolean") {
85
- return value ? 1 : 0;
86
- }
87
- return value;
88
- }
89
- case "boolean": {
90
- if (value === null) {
91
- return false;
92
- }
93
- if (typeof value === "string") {
94
- if (value === "true") {
95
- return true;
96
- }
97
- if (value === "false") {
98
- return false;
99
- }
100
- }
101
- if (typeof value === "number") {
102
- if (value === 1) {
103
- return true;
104
- }
105
- if (value === 0) {
106
- return false;
107
- }
108
- }
109
- return value;
110
- }
111
- case "string": {
112
- if (value === null) {
113
- return "";
114
- }
115
- if (typeof value === "number" || typeof value === "boolean") {
116
- return String(value);
117
- }
118
- return value;
119
- }
120
- case "null": {
121
- if (value === "" || value === 0 || value === false) {
122
- return null;
123
- }
124
- return value;
125
- }
126
- default:
127
- return value;
128
- }
129
- }
130
- function applySchemaObjectCoercion(value, schema) {
131
- const properties = schema.properties;
132
- const definedKeys = new Set(properties ? Object.keys(properties) : []);
133
- if (properties) {
134
- for (const [key, propertySchema] of Object.entries(properties)) {
135
- if (!(key in value)) {
136
- continue;
137
- }
138
- value[key] = coerceWithJsonSchema(value[key], propertySchema);
139
- }
140
- }
141
- if (schema.additionalProperties && isJsonSchemaObject(schema.additionalProperties)) {
142
- for (const [key, propertyValue] of Object.entries(value)) {
143
- if (definedKeys.has(key)) {
144
- continue;
145
- }
146
- value[key] = coerceWithJsonSchema(propertyValue, schema.additionalProperties);
147
- }
148
- }
149
- }
150
- function applySchemaArrayCoercion(value, schema) {
151
- if (Array.isArray(schema.items)) {
152
- for (let index = 0; index < value.length; index++) {
153
- const itemSchema = schema.items[index];
154
- if (!itemSchema) {
155
- continue;
156
- }
157
- value[index] = coerceWithJsonSchema(value[index], itemSchema);
158
- }
159
- return;
160
- }
161
- if (isJsonSchemaObject(schema.items)) {
162
- for (let index = 0; index < value.length; index++) {
163
- value[index] = coerceWithJsonSchema(value[index], schema.items);
164
- }
165
- }
166
- }
167
- function coerceWithUnionSchema(value, schemas) {
168
- for (const schema of schemas) {
169
- const candidate = structuredClone(value);
170
- const coerced = coerceWithJsonSchema(candidate, schema);
171
- const validator = getSubSchemaValidator(schema);
172
- if (validator?.Check(coerced)) {
173
- return coerced;
174
- }
175
- }
176
- return value;
177
- }
178
- function coerceWithJsonSchema(value, schema) {
179
- let nextValue = value;
180
- if (Array.isArray(schema.allOf)) {
181
- for (const nested of schema.allOf) {
182
- nextValue = coerceWithJsonSchema(nextValue, nested);
183
- }
184
- }
185
- if (Array.isArray(schema.anyOf)) {
186
- nextValue = coerceWithUnionSchema(nextValue, schema.anyOf);
187
- }
188
- if (Array.isArray(schema.oneOf)) {
189
- nextValue = coerceWithUnionSchema(nextValue, schema.oneOf);
190
- }
191
- const schemaTypes = getSchemaTypes(schema);
192
- const matchesUnionMember = schemaTypes.length > 1 && schemaTypes.some((schemaType) => matchesJsonType(nextValue, schemaType));
193
- if (schemaTypes.length > 0 && !matchesUnionMember) {
194
- for (const schemaType of schemaTypes) {
195
- const candidate = coercePrimitiveByType(nextValue, schemaType);
196
- if (candidate !== nextValue) {
197
- nextValue = candidate;
198
- break;
199
- }
200
- }
201
- }
202
- if (schemaTypes.includes("object") && isRecord(nextValue) && !Array.isArray(nextValue)) {
203
- applySchemaObjectCoercion(nextValue, schema);
204
- }
205
- if (schemaTypes.includes("array") && Array.isArray(nextValue)) {
206
- applySchemaArrayCoercion(nextValue, schema);
207
- }
208
- return nextValue;
209
- }
210
- function getValidator(schema) {
211
- const key = schema;
212
- const cached = validatorCache.get(key);
213
- if (cached) {
214
- return cached;
215
- }
216
- const validator = Compile(schema);
217
- validatorCache.set(key, validator);
218
- return validator;
219
- }
220
- function formatValidationPath(error) {
221
- if (error.keyword === "required") {
222
- const requiredProperties = error.params.requiredProperties;
223
- const requiredProperty = requiredProperties?.[0];
224
- if (requiredProperty) {
225
- const basePath = error.instancePath.replace(/^\//, "").replace(/\//g, ".");
226
- return basePath ? `${basePath}.${requiredProperty}` : requiredProperty;
227
- }
228
- }
229
- const path = error.instancePath.replace(/^\//, "").replace(/\//g, ".");
230
- return path || "root";
231
- }
232
- /**
233
- * Finds a tool by name and validates the tool call arguments against its TypeBox schema
234
- * @param tools Array of tool definitions
235
- * @param toolCall The tool call from the LLM
236
- * @returns The validated arguments
237
- * @throws Error if tool is not found or validation fails
238
- */
239
- export function validateToolCall(tools, toolCall) {
240
- const tool = tools.find((t) => t.name === toolCall.name);
241
- if (!tool) {
242
- throw new Error(`Tool "${toolCall.name}" not found`);
243
- }
244
- return validateToolArguments(tool, toolCall);
245
- }
246
- /**
247
- * Validates tool call arguments against the tool's TypeBox schema
248
- * @param tool The tool definition with TypeBox schema
249
- * @param toolCall The tool call from the LLM
250
- * @returns The validated (and potentially coerced) arguments
251
- * @throws Error with formatted message if validation fails
252
- */
253
- export function validateToolArguments(tool, toolCall) {
254
- const args = structuredClone(toolCall.arguments);
255
- Value.Convert(tool.parameters, args);
256
- const validator = getValidator(tool.parameters);
257
- if (!hasTypeBoxMetadata(tool.parameters) && isJsonSchemaObject(tool.parameters)) {
258
- const coerced = coerceWithJsonSchema(args, tool.parameters);
259
- if (coerced !== args) {
260
- if (isRecord(args) && isRecord(coerced)) {
261
- for (const key of Object.keys(args)) {
262
- delete args[key];
263
- }
264
- Object.assign(args, coerced);
265
- }
266
- else {
267
- return validator.Check(coerced) ? coerced : args;
268
- }
269
- }
270
- }
271
- if (validator.Check(args)) {
272
- return args;
273
- }
274
- const errors = validator
275
- .Errors(args)
276
- .map((error) => ` - ${formatValidationPath(error)}: ${error.message}`)
277
- .join("\n") || "Unknown validation error";
278
- const errorMessage = `Validation failed for tool "${toolCall.name}":\n${errors}\n\nReceived arguments:\n${JSON.stringify(toolCall.arguments, null, 2)}`;
279
- throw new Error(errorMessage);
280
- }
281
- //# sourceMappingURL=validation.js.map
@@ -1,108 +0,0 @@
1
- {
2
- "name": "@mariozechner/pi-ai",
3
- "version": "0.73.0",
4
- "description": "Unified LLM API with automatic model discovery and provider configuration",
5
- "type": "module",
6
- "main": "./dist/index.js",
7
- "types": "./dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/index.d.ts",
11
- "import": "./dist/index.js"
12
- },
13
- "./anthropic": {
14
- "types": "./dist/providers/anthropic.d.ts",
15
- "import": "./dist/providers/anthropic.js"
16
- },
17
- "./azure-openai-responses": {
18
- "types": "./dist/providers/azure-openai-responses.d.ts",
19
- "import": "./dist/providers/azure-openai-responses.js"
20
- },
21
- "./google": {
22
- "types": "./dist/providers/google.d.ts",
23
- "import": "./dist/providers/google.js"
24
- },
25
- "./google-vertex": {
26
- "types": "./dist/providers/google-vertex.d.ts",
27
- "import": "./dist/providers/google-vertex.js"
28
- },
29
- "./mistral": {
30
- "types": "./dist/providers/mistral.d.ts",
31
- "import": "./dist/providers/mistral.js"
32
- },
33
- "./openai-codex-responses": {
34
- "types": "./dist/providers/openai-codex-responses.d.ts",
35
- "import": "./dist/providers/openai-codex-responses.js"
36
- },
37
- "./openai-completions": {
38
- "types": "./dist/providers/openai-completions.d.ts",
39
- "import": "./dist/providers/openai-completions.js"
40
- },
41
- "./openai-responses": {
42
- "types": "./dist/providers/openai-responses.d.ts",
43
- "import": "./dist/providers/openai-responses.js"
44
- },
45
- "./oauth": {
46
- "types": "./dist/oauth.d.ts",
47
- "import": "./dist/oauth.js"
48
- },
49
- "./bedrock-provider": {
50
- "types": "./dist/bedrock-provider.d.ts",
51
- "import": "./dist/bedrock-provider.js"
52
- }
53
- },
54
- "bin": {
55
- "pi-ai": "./dist/cli.js"
56
- },
57
- "files": [
58
- "dist",
59
- "README.md"
60
- ],
61
- "scripts": {
62
- "clean": "shx rm -rf dist",
63
- "generate-models": "npx tsx scripts/generate-models.ts",
64
- "build": "npm run generate-models && tsgo -p tsconfig.build.json",
65
- "dev": "tsgo -p tsconfig.build.json --watch --preserveWatchOutput",
66
- "dev:tsc": "tsgo -p tsconfig.build.json --watch --preserveWatchOutput",
67
- "test": "vitest --run",
68
- "prepublishOnly": "npm run clean && npm run build"
69
- },
70
- "dependencies": {
71
- "@anthropic-ai/sdk": "^0.91.1",
72
- "@aws-sdk/client-bedrock-runtime": "^3.1030.0",
73
- "@google/genai": "^1.40.0",
74
- "@mistralai/mistralai": "^2.2.0",
75
- "typebox": "^1.1.24",
76
- "chalk": "^5.6.2",
77
- "openai": "6.26.0",
78
- "partial-json": "^0.1.7",
79
- "proxy-agent": "^6.5.0",
80
- "undici": "^7.19.1",
81
- "zod-to-json-schema": "^3.24.6"
82
- },
83
- "keywords": [
84
- "ai",
85
- "llm",
86
- "openai",
87
- "anthropic",
88
- "gemini",
89
- "bedrock",
90
- "unified",
91
- "api"
92
- ],
93
- "author": "Mario Zechner",
94
- "license": "MIT",
95
- "repository": {
96
- "type": "git",
97
- "url": "git+https://github.com/badlogic/pi-mono.git",
98
- "directory": "packages/ai"
99
- },
100
- "engines": {
101
- "node": ">=20.0.0"
102
- },
103
- "devDependencies": {
104
- "@types/node": "^24.3.0",
105
- "canvas": "^3.2.0",
106
- "vitest": "^3.2.4"
107
- }
108
- }
@@ -1,4 +0,0 @@
1
- import { setBedrockProviderModule } from "@mariozechner/pi-ai";
2
- import { bedrockProviderModule } from "@mariozechner/pi-ai/bedrock-provider";
3
- setBedrockProviderModule(bedrockProviderModule);
4
- //# sourceMappingURL=register-bedrock.js.map
@@ -1,22 +0,0 @@
1
- /**
2
- * Utilities for formatting keybinding hints in the UI.
3
- */
4
- import { getKeybindings } from "@mariozechner/pi-tui";
5
- import { theme } from "../theme/theme.js";
6
- function formatKeys(keys) {
7
- if (keys.length === 0)
8
- return "";
9
- if (keys.length === 1)
10
- return keys[0];
11
- return keys.join("/");
12
- }
13
- export function keyText(keybinding) {
14
- return formatKeys(getKeybindings().getKeys(keybinding));
15
- }
16
- export function keyHint(keybinding, description) {
17
- return theme.fg("dim", keyText(keybinding)) + theme.fg("muted", ` ${description}`);
18
- }
19
- export function rawKeyHint(key, description) {
20
- return theme.fg("dim", key) + theme.fg("muted", ` ${description}`);
21
- }
22
- //# sourceMappingURL=keybinding-hints.js.map