@linxiraos/pi-ai 1.0.10 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (349) hide show
  1. package/CHANGELOG.md +2 -5202
  2. package/LICENSE +23 -0
  3. package/package.json +134 -137
  4. package/src/auth-broker/client.ts +37 -18
  5. package/src/auth-broker/discover.ts +10 -9
  6. package/src/auth-broker/server.ts +10 -5
  7. package/src/auth-broker/snapshot-cache.ts +28 -0
  8. package/src/auth-broker/wire-schemas.ts +402 -40
  9. package/src/auth-gateway/server.ts +31 -5
  10. package/src/auth-retry.ts +41 -3
  11. package/src/auth-storage.ts +243 -82
  12. package/src/dialect/qwen-xml.ts +82 -0
  13. package/src/error/auth-classify.ts +12 -9
  14. package/src/error/flags.ts +162 -17
  15. package/src/error/oauth.ts +2 -1
  16. package/src/error/rate-limit.ts +1 -1
  17. package/src/index.ts +1 -0
  18. package/src/oneshot-retry.ts +1 -0
  19. package/src/providers/amazon-bedrock.ts +69 -29
  20. package/src/providers/anthropic.ts +31 -35
  21. package/src/providers/connect-error-detail.ts +83 -0
  22. package/src/providers/cowork-fetch.ts +80 -29
  23. package/src/providers/cursor/exec-modern.ts +4 -2
  24. package/src/providers/cursor/interaction-query.ts +2 -2
  25. package/src/providers/cursor-pi-args.ts +39 -3
  26. package/src/providers/cursor.ts +619 -111
  27. package/src/providers/devin.ts +80 -17
  28. package/src/providers/gitlab-duo-workflow.ts +6 -6
  29. package/src/providers/google-shared.ts +11 -12
  30. package/src/providers/google-types.ts +7 -0
  31. package/src/providers/mock.ts +4 -1
  32. package/src/providers/openai-chat-server.ts +24 -10
  33. package/src/providers/openai-codex-responses.ts +140 -59
  34. package/src/providers/openai-completions.ts +43 -25
  35. package/src/providers/openai-reasoning-fallback.ts +86 -4
  36. package/src/providers/openai-responses.ts +5 -0
  37. package/src/providers/openai-shared.ts +135 -23
  38. package/src/providers/pi-native-server.ts +3 -0
  39. package/src/providers/vision-guard.ts +37 -2
  40. package/src/registry/oauth/google-antigravity.ts +248 -162
  41. package/src/registry/oauth/index.ts +3 -3
  42. package/src/registry/oauth/types.ts +2 -1
  43. package/src/registry/oauth/xai-oauth.ts +14 -7
  44. package/src/registry/oauth/zai.ts +2 -2
  45. package/src/registry/types.ts +2 -1
  46. package/src/registry/xai-oauth.ts +2 -2
  47. package/src/stream.ts +55 -11
  48. package/src/types.ts +33 -1
  49. package/src/usage/cursor.ts +37 -30
  50. package/src/utils/event-stream.ts +24 -2
  51. package/src/utils/glyph-codec.ts +458 -0
  52. package/src/utils/glyph-notice.md +3 -0
  53. package/src/utils/openrouter-headers.ts +2 -2
  54. package/src/utils/proxy.ts +124 -8
  55. package/src/utils/schema/CONSTRAINTS.md +1 -0
  56. package/src/utils/schema/fields.ts +20 -4
  57. package/src/utils/schema/json-schema-validator.ts +54 -17
  58. package/src/utils/stream-markup-healing.ts +9 -2
  59. package/src/utils/thinking-loop.ts +33 -15
  60. package/src/utils/validation.ts +24 -5
  61. package/dist/types/api-registry.d.ts +0 -30
  62. package/dist/types/auth/sqlite-credential-store.d.ts +0 -102
  63. package/dist/types/auth-broker/client.d.ts +0 -100
  64. package/dist/types/auth-broker/discover.d.ts +0 -39
  65. package/dist/types/auth-broker/index.d.ts +0 -7
  66. package/dist/types/auth-broker/refresher.d.ts +0 -25
  67. package/dist/types/auth-broker/remote-store.d.ts +0 -136
  68. package/dist/types/auth-broker/server.d.ts +0 -48
  69. package/dist/types/auth-broker/snapshot-cache.d.ts +0 -17
  70. package/dist/types/auth-broker/types.d.ts +0 -152
  71. package/dist/types/auth-broker/wire-schema-resource.d.ts +0 -53
  72. package/dist/types/auth-broker/wire-schemas.d.ts +0 -5
  73. package/dist/types/auth-gateway/http.d.ts +0 -56
  74. package/dist/types/auth-gateway/index.d.ts +0 -3
  75. package/dist/types/auth-gateway/server.d.ts +0 -36
  76. package/dist/types/auth-gateway/types.d.ts +0 -127
  77. package/dist/types/auth-retry.d.ts +0 -150
  78. package/dist/types/auth-storage.d.ts +0 -1261
  79. package/dist/types/dialect/anthropic.d.ts +0 -15
  80. package/dist/types/dialect/catalog.d.ts +0 -3
  81. package/dist/types/dialect/coercion.d.ts +0 -23
  82. package/dist/types/dialect/deepseek.d.ts +0 -14
  83. package/dist/types/dialect/demotion.d.ts +0 -30
  84. package/dist/types/dialect/examples.d.ts +0 -18
  85. package/dist/types/dialect/factory.d.ts +0 -3
  86. package/dist/types/dialect/fenced-thinking.d.ts +0 -53
  87. package/dist/types/dialect/gemini.d.ts +0 -17
  88. package/dist/types/dialect/gemma.d.ts +0 -15
  89. package/dist/types/dialect/glm.d.ts +0 -9
  90. package/dist/types/dialect/harmony.d.ts +0 -8
  91. package/dist/types/dialect/hermes.d.ts +0 -9
  92. package/dist/types/dialect/history.d.ts +0 -3
  93. package/dist/types/dialect/index.d.ts +0 -11
  94. package/dist/types/dialect/inventory.d.ts +0 -9
  95. package/dist/types/dialect/kimi.d.ts +0 -14
  96. package/dist/types/dialect/minimax.d.ts +0 -3
  97. package/dist/types/dialect/owned-stream.d.ts +0 -4
  98. package/dist/types/dialect/qwen3.d.ts +0 -9
  99. package/dist/types/dialect/rendering.d.ts +0 -54
  100. package/dist/types/dialect/thinking-fence-strip.d.ts +0 -39
  101. package/dist/types/dialect/thinking.d.ts +0 -6
  102. package/dist/types/dialect/types.d.ts +0 -68
  103. package/dist/types/dialect/xml.d.ts +0 -9
  104. package/dist/types/error/abort.d.ts +0 -14
  105. package/dist/types/error/auth-classify.d.ts +0 -20
  106. package/dist/types/error/auth.d.ts +0 -27
  107. package/dist/types/error/aws.d.ts +0 -31
  108. package/dist/types/error/classes.d.ts +0 -106
  109. package/dist/types/error/finalize.d.ts +0 -41
  110. package/dist/types/error/flags.d.ts +0 -108
  111. package/dist/types/error/format.d.ts +0 -20
  112. package/dist/types/error/gateway.d.ts +0 -20
  113. package/dist/types/error/index.d.ts +0 -14
  114. package/dist/types/error/oauth.d.ts +0 -43
  115. package/dist/types/error/provider.d.ts +0 -44
  116. package/dist/types/error/rate-limit.d.ts +0 -83
  117. package/dist/types/error/retryable.d.ts +0 -27
  118. package/dist/types/error/validation.d.ts +0 -32
  119. package/dist/types/index.d.ts +0 -52
  120. package/dist/types/oneshot-retry.d.ts +0 -89
  121. package/dist/types/provider-details.d.ts +0 -24
  122. package/dist/types/providers/amazon-bedrock.d.ts +0 -39
  123. package/dist/types/providers/anthropic-client.d.ts +0 -106
  124. package/dist/types/providers/anthropic-messages-server-schema.d.ts +0 -937
  125. package/dist/types/providers/anthropic-messages-server.d.ts +0 -17
  126. package/dist/types/providers/anthropic-wire.d.ts +0 -358
  127. package/dist/types/providers/anthropic.d.ts +0 -258
  128. package/dist/types/providers/aws-credentials.d.ts +0 -49
  129. package/dist/types/providers/aws-eventstream.d.ts +0 -39
  130. package/dist/types/providers/aws-sigv4.d.ts +0 -55
  131. package/dist/types/providers/azure-openai-responses.d.ts +0 -17
  132. package/dist/types/providers/bedrock-mantle.d.ts +0 -13
  133. package/dist/types/providers/claude-code-fingerprint.d.ts +0 -19
  134. package/dist/types/providers/cowork-fetch.d.ts +0 -3
  135. package/dist/types/providers/cursor/exec-modern.d.ts +0 -98
  136. package/dist/types/providers/cursor/interaction-query.d.ts +0 -15
  137. package/dist/types/providers/cursor-pi-args.d.ts +0 -119
  138. package/dist/types/providers/cursor.d.ts +0 -230
  139. package/dist/types/providers/devin.d.ts +0 -12
  140. package/dist/types/providers/error-message.d.ts +0 -25
  141. package/dist/types/providers/github-copilot-headers.d.ts +0 -40
  142. package/dist/types/providers/gitlab-duo-workflow.d.ts +0 -254
  143. package/dist/types/providers/gitlab-duo.d.ts +0 -27
  144. package/dist/types/providers/google-auth.d.ts +0 -24
  145. package/dist/types/providers/google-gemini-cli.d.ts +0 -119
  146. package/dist/types/providers/google-shared.d.ts +0 -203
  147. package/dist/types/providers/google-types.d.ts +0 -155
  148. package/dist/types/providers/google-vertex.d.ts +0 -7
  149. package/dist/types/providers/google.d.ts +0 -4
  150. package/dist/types/providers/grammar.d.ts +0 -1
  151. package/dist/types/providers/kimi.d.ts +0 -27
  152. package/dist/types/providers/mock.d.ts +0 -179
  153. package/dist/types/providers/ollama.d.ts +0 -8
  154. package/dist/types/providers/openai-anthropic-shim.d.ts +0 -35
  155. package/dist/types/providers/openai-chat-server-schema.d.ts +0 -1311
  156. package/dist/types/providers/openai-chat-server.d.ts +0 -16
  157. package/dist/types/providers/openai-chat-wire.d.ts +0 -669
  158. package/dist/types/providers/openai-codex/request-transformer.d.ts +0 -111
  159. package/dist/types/providers/openai-codex/response-handler.d.ts +0 -26
  160. package/dist/types/providers/openai-codex-responses.d.ts +0 -238
  161. package/dist/types/providers/openai-completions.d.ts +0 -48
  162. package/dist/types/providers/openai-reasoning-fallback.d.ts +0 -25
  163. package/dist/types/providers/openai-responses-server-schema.d.ts +0 -1314
  164. package/dist/types/providers/openai-responses-server.d.ts +0 -17
  165. package/dist/types/providers/openai-responses-wire.d.ts +0 -6099
  166. package/dist/types/providers/openai-responses.d.ts +0 -132
  167. package/dist/types/providers/openai-shared.d.ts +0 -660
  168. package/dist/types/providers/pi-native-client.d.ts +0 -13
  169. package/dist/types/providers/pi-native-server.d.ts +0 -69
  170. package/dist/types/providers/register-builtins.d.ts +0 -37
  171. package/dist/types/providers/synthetic.d.ts +0 -26
  172. package/dist/types/providers/transform-messages.d.ts +0 -32
  173. package/dist/types/providers/vision-guard.d.ts +0 -24
  174. package/dist/types/registry/aiand.d.ts +0 -7
  175. package/dist/types/registry/aimlapi.d.ts +0 -4
  176. package/dist/types/registry/alibaba-coding-plan.d.ts +0 -8
  177. package/dist/types/registry/alibaba-token-plan.d.ts +0 -18
  178. package/dist/types/registry/amazon-bedrock.d.ts +0 -10
  179. package/dist/types/registry/anthropic.d.ts +0 -10
  180. package/dist/types/registry/api-key-login.d.ts +0 -44
  181. package/dist/types/registry/api-key-validation.d.ts +0 -43
  182. package/dist/types/registry/aws.d.ts +0 -15
  183. package/dist/types/registry/azure.d.ts +0 -4
  184. package/dist/types/registry/baseten.d.ts +0 -7
  185. package/dist/types/registry/bedrock-mantle.d.ts +0 -22
  186. package/dist/types/registry/cerebras.d.ts +0 -7
  187. package/dist/types/registry/cloudflare-ai-gateway.d.ts +0 -13
  188. package/dist/types/registry/coreweave.d.ts +0 -7
  189. package/dist/types/registry/cursor.d.ts +0 -7
  190. package/dist/types/registry/deepseek.d.ts +0 -8
  191. package/dist/types/registry/derived.d.ts +0 -5
  192. package/dist/types/registry/devin.d.ts +0 -8
  193. package/dist/types/registry/exa.d.ts +0 -8
  194. package/dist/types/registry/firepass.d.ts +0 -16
  195. package/dist/types/registry/fireworks.d.ts +0 -7
  196. package/dist/types/registry/github-copilot.d.ts +0 -7
  197. package/dist/types/registry/gitlab-duo-workflow.d.ts +0 -10
  198. package/dist/types/registry/gitlab-duo.d.ts +0 -9
  199. package/dist/types/registry/gmi-cloud.d.ts +0 -7
  200. package/dist/types/registry/google-antigravity.d.ts +0 -9
  201. package/dist/types/registry/google-gemini-cli.d.ts +0 -9
  202. package/dist/types/registry/google-vertex.d.ts +0 -5
  203. package/dist/types/registry/google.d.ts +0 -4
  204. package/dist/types/registry/groq.d.ts +0 -4
  205. package/dist/types/registry/huggingface.d.ts +0 -7
  206. package/dist/types/registry/index.d.ts +0 -4
  207. package/dist/types/registry/kagi.d.ts +0 -14
  208. package/dist/types/registry/kilo.d.ts +0 -7
  209. package/dist/types/registry/kimi-code.d.ts +0 -7
  210. package/dist/types/registry/litellm.d.ts +0 -13
  211. package/dist/types/registry/llama-cpp.d.ts +0 -8
  212. package/dist/types/registry/lm-studio.d.ts +0 -8
  213. package/dist/types/registry/meta.d.ts +0 -7
  214. package/dist/types/registry/minimax-code-cn.d.ts +0 -6
  215. package/dist/types/registry/minimax-code.d.ts +0 -6
  216. package/dist/types/registry/minimax.d.ts +0 -4
  217. package/dist/types/registry/mistral.d.ts +0 -4
  218. package/dist/types/registry/moonshot.d.ts +0 -7
  219. package/dist/types/registry/nanogpt.d.ts +0 -7
  220. package/dist/types/registry/novita.d.ts +0 -6
  221. package/dist/types/registry/nvidia.d.ts +0 -7
  222. package/dist/types/registry/oauth/anthropic-constants.d.ts +0 -12
  223. package/dist/types/registry/oauth/anthropic.d.ts +0 -24
  224. package/dist/types/registry/oauth/callback-server.d.ts +0 -74
  225. package/dist/types/registry/oauth/cursor.d.ts +0 -16
  226. package/dist/types/registry/oauth/device-code.d.ts +0 -25
  227. package/dist/types/registry/oauth/devin.d.ts +0 -5
  228. package/dist/types/registry/oauth/github-copilot.d.ts +0 -30
  229. package/dist/types/registry/oauth/gitlab-duo-workflow.d.ts +0 -6
  230. package/dist/types/registry/oauth/gitlab-duo.d.ts +0 -3
  231. package/dist/types/registry/oauth/google-antigravity.d.ts +0 -15
  232. package/dist/types/registry/oauth/google-gemini-cli.d.ts +0 -22
  233. package/dist/types/registry/oauth/google-oauth-shared.d.ts +0 -56
  234. package/dist/types/registry/oauth/index.d.ts +0 -45
  235. package/dist/types/registry/oauth/kimi.d.ts +0 -21
  236. package/dist/types/registry/oauth/minimax-code.d.ts +0 -27
  237. package/dist/types/registry/oauth/openai-codex.d.ts +0 -33
  238. package/dist/types/registry/oauth/opencode.d.ts +0 -25
  239. package/dist/types/registry/oauth/perplexity.d.ts +0 -9
  240. package/dist/types/registry/oauth/pkce.d.ts +0 -8
  241. package/dist/types/registry/oauth/types.d.ts +0 -87
  242. package/dist/types/registry/oauth/wafer.d.ts +0 -1
  243. package/dist/types/registry/oauth/xai-oauth.d.ts +0 -46
  244. package/dist/types/registry/oauth/xiaomi.d.ts +0 -25
  245. package/dist/types/registry/oauth/zai.d.ts +0 -25
  246. package/dist/types/registry/ollama-cloud.d.ts +0 -7
  247. package/dist/types/registry/ollama.d.ts +0 -12
  248. package/dist/types/registry/openai-codex-device.d.ts +0 -8
  249. package/dist/types/registry/openai-codex.d.ts +0 -9
  250. package/dist/types/registry/openai.d.ts +0 -4
  251. package/dist/types/registry/opencode-go.d.ts +0 -6
  252. package/dist/types/registry/opencode-zen.d.ts +0 -6
  253. package/dist/types/registry/openrouter.d.ts +0 -13
  254. package/dist/types/registry/parallel.d.ts +0 -14
  255. package/dist/types/registry/perplexity.d.ts +0 -7
  256. package/dist/types/registry/qianfan.d.ts +0 -7
  257. package/dist/types/registry/qwen-portal.d.ts +0 -7
  258. package/dist/types/registry/registry.d.ts +0 -372
  259. package/dist/types/registry/sakana.d.ts +0 -7
  260. package/dist/types/registry/siliconflow-cn.d.ts +0 -7
  261. package/dist/types/registry/siliconflow.d.ts +0 -7
  262. package/dist/types/registry/synthetic.d.ts +0 -6
  263. package/dist/types/registry/tavily.d.ts +0 -14
  264. package/dist/types/registry/together.d.ts +0 -6
  265. package/dist/types/registry/types.d.ts +0 -75
  266. package/dist/types/registry/umans.d.ts +0 -7
  267. package/dist/types/registry/venice.d.ts +0 -13
  268. package/dist/types/registry/vercel-ai-gateway.d.ts +0 -7
  269. package/dist/types/registry/vllm.d.ts +0 -7
  270. package/dist/types/registry/wafer-serverless.d.ts +0 -6
  271. package/dist/types/registry/xai-oauth.d.ts +0 -7
  272. package/dist/types/registry/xai.d.ts +0 -7
  273. package/dist/types/registry/xiaomi-token-plan-ams.d.ts +0 -6
  274. package/dist/types/registry/xiaomi-token-plan-cn.d.ts +0 -6
  275. package/dist/types/registry/xiaomi-token-plan-sgp.d.ts +0 -6
  276. package/dist/types/registry/xiaomi.d.ts +0 -6
  277. package/dist/types/registry/zai.d.ts +0 -15
  278. package/dist/types/registry/zenmux.d.ts +0 -7
  279. package/dist/types/registry/zhipu-coding-plan.d.ts +0 -7
  280. package/dist/types/stream.d.ts +0 -53
  281. package/dist/types/types.d.ts +0 -1095
  282. package/dist/types/usage/alibaba-token-plan.d.ts +0 -3
  283. package/dist/types/usage/claude.d.ts +0 -4
  284. package/dist/types/usage/cursor.d.ts +0 -15
  285. package/dist/types/usage/gemini.d.ts +0 -2
  286. package/dist/types/usage/github-copilot.d.ts +0 -7
  287. package/dist/types/usage/google-antigravity.d.ts +0 -15
  288. package/dist/types/usage/kimi.d.ts +0 -4
  289. package/dist/types/usage/minimax-code.d.ts +0 -3
  290. package/dist/types/usage/ollama.d.ts +0 -5
  291. package/dist/types/usage/openai-codex-base-url.d.ts +0 -18
  292. package/dist/types/usage/openai-codex-reset.d.ts +0 -68
  293. package/dist/types/usage/openai-codex.d.ts +0 -10
  294. package/dist/types/usage/opencode-go.d.ts +0 -13
  295. package/dist/types/usage/shared.d.ts +0 -13
  296. package/dist/types/usage/synthetic.d.ts +0 -2
  297. package/dist/types/usage/umans.d.ts +0 -2
  298. package/dist/types/usage/xai-oauth.d.ts +0 -12
  299. package/dist/types/usage/zai.d.ts +0 -3
  300. package/dist/types/usage.d.ts +0 -518
  301. package/dist/types/utils/abort.d.ts +0 -25
  302. package/dist/types/utils/anthropic-auth.d.ts +0 -35
  303. package/dist/types/utils/aws-profile.d.ts +0 -17
  304. package/dist/types/utils/block-symbols.d.ts +0 -74
  305. package/dist/types/utils/deterministic-id.d.ts +0 -16
  306. package/dist/types/utils/empty-completion-retry.d.ts +0 -22
  307. package/dist/types/utils/event-stream.d.ts +0 -39
  308. package/dist/types/utils/foundry.d.ts +0 -1
  309. package/dist/types/utils/google-validation.d.ts +0 -2
  310. package/dist/types/utils/harmony-leak.d.ts +0 -135
  311. package/dist/types/utils/http-inspector.d.ts +0 -49
  312. package/dist/types/utils/idle-iterator.d.ts +0 -149
  313. package/dist/types/utils/leaked-thinking-stream.d.ts +0 -33
  314. package/dist/types/utils/openai-http.d.ts +0 -48
  315. package/dist/types/utils/openrouter-headers.d.ts +0 -1
  316. package/dist/types/utils/parse-bind.d.ts +0 -23
  317. package/dist/types/utils/provider-response.d.ts +0 -3
  318. package/dist/types/utils/proxy.d.ts +0 -39
  319. package/dist/types/utils/request-debug.d.ts +0 -29
  320. package/dist/types/utils/retry-after.d.ts +0 -4
  321. package/dist/types/utils/retry.d.ts +0 -14
  322. package/dist/types/utils/schema/adapt.d.ts +0 -24
  323. package/dist/types/utils/schema/compatibility.d.ts +0 -30
  324. package/dist/types/utils/schema/dereference.d.ts +0 -11
  325. package/dist/types/utils/schema/draft.d.ts +0 -10
  326. package/dist/types/utils/schema/equality.d.ts +0 -4
  327. package/dist/types/utils/schema/fields.d.ts +0 -54
  328. package/dist/types/utils/schema/index.d.ts +0 -14
  329. package/dist/types/utils/schema/json-schema-validator.d.ts +0 -20
  330. package/dist/types/utils/schema/meta-validator.d.ts +0 -2
  331. package/dist/types/utils/schema/normalize.d.ts +0 -153
  332. package/dist/types/utils/schema/spill.d.ts +0 -8
  333. package/dist/types/utils/schema/stamps.d.ts +0 -17
  334. package/dist/types/utils/schema/strict-tool-validation.d.ts +0 -25
  335. package/dist/types/utils/schema/types.d.ts +0 -4
  336. package/dist/types/utils/schema/typescript.d.ts +0 -24
  337. package/dist/types/utils/schema/wire.d.ts +0 -58
  338. package/dist/types/utils/sdk-stream-timeout.d.ts +0 -33
  339. package/dist/types/utils/sse-debug.d.ts +0 -5
  340. package/dist/types/utils/stream-markup-healing.d.ts +0 -87
  341. package/dist/types/utils/thinking-loop.d.ts +0 -94
  342. package/dist/types/utils/tool-call-loop-guard.d.ts +0 -26
  343. package/dist/types/utils/tool-choice.d.ts +0 -52
  344. package/dist/types/utils/validation.d.ts +0 -28
  345. package/dist/types/utils.d.ts +0 -57
  346. package/src/providers/cursor/proto/buf.gen.yaml +0 -6
  347. package/src/providers/cursor/proto/buf.yaml +0 -17
  348. package/src/providers/devin/proto/buf.gen.yaml +0 -33
  349. package/src/providers/devin/proto/buf.yaml +0 -17

There are too many changes on this page to be displayed.


The amount of changes on this page would crash your brower.

You can still verify the content by downloading the package file manually.