@acentric/llm 0.0.0-stage → 0.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 (232) hide show
  1. package/README.md +128 -2
  2. package/dist/catalog/anthropic.d.ts +77 -0
  3. package/dist/catalog/anthropic.d.ts.map +1 -0
  4. package/dist/catalog/anthropic.js +73 -0
  5. package/dist/catalog/anthropic.js.map +1 -0
  6. package/dist/catalog/fireworks.d.ts +93 -0
  7. package/dist/catalog/fireworks.d.ts.map +1 -0
  8. package/dist/catalog/fireworks.js +117 -0
  9. package/dist/catalog/fireworks.js.map +1 -0
  10. package/dist/catalog/openai.d.ts +103 -0
  11. package/dist/catalog/openai.d.ts.map +1 -0
  12. package/dist/catalog/openai.js +102 -0
  13. package/dist/catalog/openai.js.map +1 -0
  14. package/dist/client/anthropic/errors.d.ts +4 -0
  15. package/dist/client/anthropic/errors.d.ts.map +1 -0
  16. package/dist/client/anthropic/errors.js +80 -0
  17. package/dist/client/anthropic/errors.js.map +1 -0
  18. package/dist/client/anthropic/request.d.ts +9 -0
  19. package/dist/client/anthropic/request.d.ts.map +1 -0
  20. package/dist/client/anthropic/request.js +232 -0
  21. package/dist/client/anthropic/request.js.map +1 -0
  22. package/dist/client/anthropic/response.d.ts +13 -0
  23. package/dist/client/anthropic/response.d.ts.map +1 -0
  24. package/dist/client/anthropic/response.js +207 -0
  25. package/dist/client/anthropic/response.js.map +1 -0
  26. package/dist/client/direct.d.ts +18 -0
  27. package/dist/client/direct.d.ts.map +1 -0
  28. package/dist/client/direct.js +104 -0
  29. package/dist/client/direct.js.map +1 -0
  30. package/dist/client/gateway.d.ts +43 -0
  31. package/dist/client/gateway.d.ts.map +1 -0
  32. package/dist/client/gateway.js +72 -0
  33. package/dist/client/gateway.js.map +1 -0
  34. package/dist/client/http.d.ts +41 -0
  35. package/dist/client/http.d.ts.map +1 -0
  36. package/dist/client/http.js +190 -0
  37. package/dist/client/http.js.map +1 -0
  38. package/dist/client/llm.d.ts +41 -0
  39. package/dist/client/llm.d.ts.map +1 -0
  40. package/dist/client/llm.js +100 -0
  41. package/dist/client/llm.js.map +1 -0
  42. package/dist/client/responses/errors.d.ts +13 -0
  43. package/dist/client/responses/errors.d.ts.map +1 -0
  44. package/dist/client/responses/errors.js +144 -0
  45. package/dist/client/responses/errors.js.map +1 -0
  46. package/dist/client/responses/profile.d.ts +50 -0
  47. package/dist/client/responses/profile.d.ts.map +1 -0
  48. package/dist/client/responses/profile.js +4 -0
  49. package/dist/client/responses/profile.js.map +1 -0
  50. package/dist/client/responses/providers.d.ts +4 -0
  51. package/dist/client/responses/providers.d.ts.map +1 -0
  52. package/dist/client/responses/providers.js +75 -0
  53. package/dist/client/responses/providers.js.map +1 -0
  54. package/dist/client/responses/request.d.ts +5 -0
  55. package/dist/client/responses/request.d.ts.map +1 -0
  56. package/dist/client/responses/request.js +248 -0
  57. package/dist/client/responses/request.js.map +1 -0
  58. package/dist/client/responses/response.d.ts +10 -0
  59. package/dist/client/responses/response.d.ts.map +1 -0
  60. package/dist/client/responses/response.js +176 -0
  61. package/dist/client/responses/response.js.map +1 -0
  62. package/dist/client/util.d.ts +21 -0
  63. package/dist/client/util.d.ts.map +1 -0
  64. package/dist/client/util.js +63 -0
  65. package/dist/client/util.js.map +1 -0
  66. package/dist/client.d.ts +9 -0
  67. package/dist/client.d.ts.map +1 -0
  68. package/dist/client.js +10 -0
  69. package/dist/client.js.map +1 -0
  70. package/dist/content.d.ts +38 -0
  71. package/dist/content.d.ts.map +1 -0
  72. package/dist/content.js +5 -0
  73. package/dist/content.js.map +1 -0
  74. package/dist/convert/anthropic.d.ts +3 -0
  75. package/dist/convert/anthropic.d.ts.map +1 -0
  76. package/dist/convert/anthropic.js +114 -0
  77. package/dist/convert/anthropic.js.map +1 -0
  78. package/dist/convert/index.d.ts +12 -0
  79. package/dist/convert/index.d.ts.map +1 -0
  80. package/dist/convert/index.js +221 -0
  81. package/dist/convert/index.js.map +1 -0
  82. package/dist/convert/responses.d.ts +3 -0
  83. package/dist/convert/responses.d.ts.map +1 -0
  84. package/dist/convert/responses.js +197 -0
  85. package/dist/convert/responses.js.map +1 -0
  86. package/dist/convert/types.d.ts +88 -0
  87. package/dist/convert/types.d.ts.map +1 -0
  88. package/dist/convert/types.js +3 -0
  89. package/dist/convert/types.js.map +1 -0
  90. package/dist/cost.d.ts +18 -0
  91. package/dist/cost.d.ts.map +1 -0
  92. package/dist/cost.js +49 -0
  93. package/dist/cost.js.map +1 -0
  94. package/dist/failure.d.ts +90 -0
  95. package/dist/failure.d.ts.map +1 -0
  96. package/dist/failure.js +111 -0
  97. package/dist/failure.js.map +1 -0
  98. package/dist/fields.d.ts +14 -0
  99. package/dist/fields.d.ts.map +1 -0
  100. package/dist/fields.js +3 -0
  101. package/dist/fields.js.map +1 -0
  102. package/dist/formats/anthropic.d.ts +152 -0
  103. package/dist/formats/anthropic.d.ts.map +1 -0
  104. package/dist/formats/anthropic.js +7 -0
  105. package/dist/formats/anthropic.js.map +1 -0
  106. package/dist/formats/responses.d.ts +179 -0
  107. package/dist/formats/responses.d.ts.map +1 -0
  108. package/dist/formats/responses.js +9 -0
  109. package/dist/formats/responses.js.map +1 -0
  110. package/dist/index.d.ts +26 -0
  111. package/dist/index.d.ts.map +1 -0
  112. package/dist/index.js +11 -0
  113. package/dist/index.js.map +1 -0
  114. package/dist/json.d.ts +6 -0
  115. package/dist/json.d.ts.map +1 -0
  116. package/dist/json.js +10 -0
  117. package/dist/json.js.map +1 -0
  118. package/dist/messages.d.ts +82 -0
  119. package/dist/messages.d.ts.map +1 -0
  120. package/dist/messages.js +4 -0
  121. package/dist/messages.js.map +1 -0
  122. package/dist/model.d.ts +36 -0
  123. package/dist/model.d.ts.map +1 -0
  124. package/dist/model.js +4 -0
  125. package/dist/model.js.map +1 -0
  126. package/dist/models.d.ts +9 -0
  127. package/dist/models.d.ts.map +1 -0
  128. package/dist/models.js +19 -0
  129. package/dist/models.js.map +1 -0
  130. package/dist/providers/anthropic.d.ts +130 -0
  131. package/dist/providers/anthropic.d.ts.map +1 -0
  132. package/dist/providers/anthropic.js +5 -0
  133. package/dist/providers/anthropic.js.map +1 -0
  134. package/dist/providers/fireworks.d.ts +108 -0
  135. package/dist/providers/fireworks.d.ts.map +1 -0
  136. package/dist/providers/fireworks.js +6 -0
  137. package/dist/providers/fireworks.js.map +1 -0
  138. package/dist/providers/openai.d.ts +193 -0
  139. package/dist/providers/openai.d.ts.map +1 -0
  140. package/dist/providers/openai.js +4 -0
  141. package/dist/providers/openai.js.map +1 -0
  142. package/dist/providers.d.ts +50 -0
  143. package/dist/providers.d.ts.map +1 -0
  144. package/dist/providers.js +5 -0
  145. package/dist/providers.js.map +1 -0
  146. package/dist/read/anthropic.d.ts +15 -0
  147. package/dist/read/anthropic.d.ts.map +1 -0
  148. package/dist/read/anthropic.js +56 -0
  149. package/dist/read/anthropic.js.map +1 -0
  150. package/dist/read/responses.d.ts +26 -0
  151. package/dist/read/responses.d.ts.map +1 -0
  152. package/dist/read/responses.js +121 -0
  153. package/dist/read/responses.js.map +1 -0
  154. package/dist/read.d.ts +32 -0
  155. package/dist/read.d.ts.map +1 -0
  156. package/dist/read.js +73 -0
  157. package/dist/read.js.map +1 -0
  158. package/dist/request.d.ts +23 -0
  159. package/dist/request.d.ts.map +1 -0
  160. package/dist/request.js +4 -0
  161. package/dist/request.js.map +1 -0
  162. package/dist/response.d.ts +38 -0
  163. package/dist/response.d.ts.map +1 -0
  164. package/dist/response.js +4 -0
  165. package/dist/response.js.map +1 -0
  166. package/dist/secrets.d.ts +22 -0
  167. package/dist/secrets.d.ts.map +1 -0
  168. package/dist/secrets.js +35 -0
  169. package/dist/secrets.js.map +1 -0
  170. package/dist/tool-calls.d.ts +28 -0
  171. package/dist/tool-calls.d.ts.map +1 -0
  172. package/dist/tool-calls.js +4 -0
  173. package/dist/tool-calls.js.map +1 -0
  174. package/dist/tools.d.ts +33 -0
  175. package/dist/tools.d.ts.map +1 -0
  176. package/dist/tools.js +4 -0
  177. package/dist/tools.js.map +1 -0
  178. package/dist/usage.d.ts +31 -0
  179. package/dist/usage.d.ts.map +1 -0
  180. package/dist/usage.js +3 -0
  181. package/dist/usage.js.map +1 -0
  182. package/dist/version.d.ts +2 -0
  183. package/dist/version.d.ts.map +1 -0
  184. package/dist/version.js +6 -0
  185. package/dist/version.js.map +1 -0
  186. package/package.json +33 -3
  187. package/src/catalog/anthropic.ts +83 -0
  188. package/src/catalog/fireworks.ts +121 -0
  189. package/src/catalog/openai.ts +133 -0
  190. package/src/client/anthropic/errors.ts +88 -0
  191. package/src/client/anthropic/request.ts +272 -0
  192. package/src/client/anthropic/response.ts +236 -0
  193. package/src/client/direct.ts +157 -0
  194. package/src/client/gateway.ts +120 -0
  195. package/src/client/http.ts +231 -0
  196. package/src/client/llm.ts +151 -0
  197. package/src/client/responses/errors.ts +166 -0
  198. package/src/client/responses/profile.ts +55 -0
  199. package/src/client/responses/providers.ts +87 -0
  200. package/src/client/responses/request.ts +326 -0
  201. package/src/client/responses/response.ts +203 -0
  202. package/src/client/util.ts +81 -0
  203. package/src/client.ts +20 -0
  204. package/src/content.ts +46 -0
  205. package/src/convert/anthropic.ts +115 -0
  206. package/src/convert/index.ts +275 -0
  207. package/src/convert/responses.ts +203 -0
  208. package/src/convert/types.ts +104 -0
  209. package/src/cost.ts +71 -0
  210. package/src/failure.ts +164 -0
  211. package/src/fields.ts +13 -0
  212. package/src/formats/anthropic.ts +191 -0
  213. package/src/formats/responses.ts +207 -0
  214. package/src/index.ts +44 -0
  215. package/src/json.ts +13 -0
  216. package/src/messages.ts +99 -0
  217. package/src/model.ts +41 -0
  218. package/src/models.ts +23 -0
  219. package/src/providers/anthropic.ts +137 -0
  220. package/src/providers/fireworks.ts +140 -0
  221. package/src/providers/openai.ts +275 -0
  222. package/src/providers.ts +59 -0
  223. package/src/read/anthropic.ts +64 -0
  224. package/src/read/responses.ts +159 -0
  225. package/src/read.ts +108 -0
  226. package/src/request.ts +28 -0
  227. package/src/response.ts +44 -0
  228. package/src/secrets.ts +40 -0
  229. package/src/tool-calls.ts +33 -0
  230. package/src/tools.ts +38 -0
  231. package/src/usage.ts +33 -0
  232. package/src/version.ts +6 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,qEAAqE;AACrE,qDAAqD;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIpD,gCAAgC;AAChC,MAAM,CAAC,MAAM,MAAM,GAA0D;IAC3E,SAAS,EAAE,gBAAgB;IAC3B,MAAM,EAAE,aAAa;IACrB,SAAS,EAAE,gBAAgB;CAC5B,CAAC;AAEF,qEAAqE;AACrE,MAAM,UAAU,SAAS,CAAqB,QAAW,EAAE,EAAU;IACnE,MAAM,MAAM,GAAyB,MAAM,CAAC,QAAQ,CAAC,CAAC;IACtD,+DAA+D;IAC/D,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,CAA6B,CAAC;AAC7E,CAAC"}
@@ -0,0 +1,130 @@
1
+ import type { JsonObject } from '@acentric/types';
2
+ import type { AnthropicCacheControl, AnthropicInputBlock, AnthropicOutputBlock, AnthropicUsage } from '../formats/anthropic.js';
3
+ export type AnthropicCredentials = {
4
+ /** An Anthropic API key, sent as `x-api-key`. */
5
+ readonly apiKey: string;
6
+ /** Sent as `anthropic-workspace-id`, which keys that span workspaces require. */
7
+ readonly workspaceId?: string;
8
+ };
9
+ /**
10
+ * `adaptive` lets the model decide, and is the default on Claude 5 models.
11
+ * Whether thinking can be turned off depends on the model; budgeted
12
+ * (`enabled`) thinking is refused by every Claude 5 model.
13
+ */
14
+ export type AnthropicThinking = {
15
+ readonly type: 'adaptive';
16
+ /** `omitted`, the default, returns empty thinking text; `summarized` returns a summary. */
17
+ readonly display?: 'summarized' | 'omitted' | (string & {});
18
+ readonly block_binding?: {
19
+ readonly prefix_mismatch_behavior: 'error' | 'drop_block';
20
+ };
21
+ } | {
22
+ readonly type: 'disabled';
23
+ } | {
24
+ readonly type: 'between_tools';
25
+ } | {
26
+ readonly type: 'enabled';
27
+ readonly budget_tokens: number;
28
+ };
29
+ export type AnthropicEffort = 'low' | 'medium' | 'high' | 'xhigh' | 'max' | (string & {});
30
+ export type AnthropicToolChoice = {
31
+ readonly type: 'auto';
32
+ readonly disable_parallel_tool_use?: boolean;
33
+ } | {
34
+ readonly type: 'any';
35
+ readonly disable_parallel_tool_use?: boolean;
36
+ } | {
37
+ readonly type: 'tool';
38
+ readonly name: string;
39
+ readonly disable_parallel_tool_use?: boolean;
40
+ } | {
41
+ readonly type: 'none';
42
+ };
43
+ /** A native tool: a server tool, such as `web_search_20260209`, or an Anthropic-defined client tool. */
44
+ export type AnthropicTool = JsonObject & {
45
+ readonly type?: string;
46
+ readonly name: string;
47
+ };
48
+ export type AnthropicOptions = {
49
+ /**
50
+ * The output limit, thinking included. Defaults to the model's maximum
51
+ * (128,000 on Claude 5 models, and for models the client does not know).
52
+ */
53
+ readonly max_tokens?: number;
54
+ /** Sent as the `anthropic-beta` header. A name Anthropic does not know refuses the request. */
55
+ readonly betas?: readonly string[];
56
+ readonly thinking?: AnthropicThinking;
57
+ readonly output_config?: JsonObject & {
58
+ readonly effort?: AnthropicEffort;
59
+ /** Structured output; refused with citations. */
60
+ readonly format?: {
61
+ readonly type: 'json_schema';
62
+ readonly schema: JsonObject;
63
+ };
64
+ };
65
+ /** Server tools and Anthropic-defined client tools, sent after the request's own. */
66
+ readonly tools?: readonly AnthropicTool[];
67
+ readonly tool_choice?: AnthropicToolChoice;
68
+ readonly stop_sequences?: readonly string[];
69
+ /** An opaque user ID for abuse detection; never an email or other personal data. */
70
+ readonly metadata?: {
71
+ readonly user_id?: string;
72
+ };
73
+ /** `auto` uses Priority Tier where the organization has it. */
74
+ readonly service_tier?: 'auto' | 'standard_only';
75
+ /** `us` keeps inference in the US, at 1.1 times the price. */
76
+ readonly inference_geo?: 'global' | 'us' | (string & {});
77
+ /** Automatic caching: one breakpoint on the last block that can be cached. */
78
+ readonly cache_control?: AnthropicCacheControl;
79
+ /** A code execution container to reuse, by ID, or `{ id?, skills? }`. */
80
+ readonly container?: string | JsonObject;
81
+ /** Clearing tool uses or thinking, and compaction past a threshold. */
82
+ readonly context_management?: JsonObject;
83
+ /** Compaction on request. */
84
+ readonly compaction?: JsonObject;
85
+ /** Remote MCP servers. May hold secrets. */
86
+ readonly mcp_servers?: readonly JsonObject[];
87
+ readonly speed?: 'standard' | 'fast';
88
+ /** Retrying on another model after a refusal. */
89
+ readonly fallbacks?: 'default' | readonly JsonObject[];
90
+ readonly diagnostics?: {
91
+ readonly previous_message_id: string | null;
92
+ };
93
+ /** Claude 5 models take only the defaults: `temperature: 1`, `top_p` 0.99 or more. */
94
+ readonly temperature?: number;
95
+ readonly top_p?: number;
96
+ /** The client returns one finished response, so `true` is refused. */
97
+ readonly stream?: false;
98
+ };
99
+ /**
100
+ * The response's own fields, kept in `native`: the stop sequence that matched,
101
+ * why it stopped in more detail (a refusal's category), the code execution
102
+ * container, context management, and the usage fields `usage` does not hold
103
+ * (cache writes by time to live, service tier, where inference ran, speed,
104
+ * server tool counts, iterations).
105
+ */
106
+ export type AnthropicNativeResponse = JsonObject & {
107
+ readonly stop_sequence?: string;
108
+ readonly stop_details?: JsonObject & {
109
+ readonly category?: string | null;
110
+ };
111
+ readonly container?: {
112
+ readonly id: string;
113
+ readonly expires_at?: string;
114
+ };
115
+ readonly context_management?: JsonObject;
116
+ readonly diagnostics?: JsonObject;
117
+ readonly usage?: Omit<AnthropicUsage, 'input_tokens' | 'output_tokens' | 'cache_creation_input_tokens' | 'cache_read_input_tokens' | 'output_tokens_details'>;
118
+ };
119
+ /** Model IDs the types know. Any other works too. */
120
+ export type AnthropicModelId = 'claude-fable-5-1' | 'claude-opus-5-5' | 'claude-sonnet-5-5' | 'claude-haiku-5-5' | 'claude-fable-5' | 'claude-opus-5' | 'claude-sonnet-5';
121
+ export type AnthropicSpec = {
122
+ readonly api: 'anthropic-messages';
123
+ readonly credentials: AnthropicCredentials;
124
+ readonly options: AnthropicOptions;
125
+ readonly inputItem: AnthropicInputBlock;
126
+ readonly outputItem: AnthropicOutputBlock;
127
+ readonly response: AnthropicNativeResponse;
128
+ readonly modelId: AnthropicModelId;
129
+ };
130
+ //# sourceMappingURL=anthropic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../src/providers/anthropic.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACf,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,oBAAoB,GAAG;IACjC,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,iFAAiF;IACjF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GACzB;IACE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,2FAA2F;IAC3F,QAAQ,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAC5D,QAAQ,CAAC,aAAa,CAAC,EAAE;QAAE,QAAQ,CAAC,wBAAwB,EAAE,OAAO,GAAG,YAAY,CAAA;KAAE,CAAC;CACxF,GACD;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAC7B;IAAE,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAA;CA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AQ,EAAE,uBAAuB,CAAC;IAC3C,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;CACpC,CAAC"}
@@ -0,0 +1,5 @@
1
+ // Anthropic's Messages API: its credentials, request options and the response
2
+ // fields kept in `native`. Anthropic refuses fields it does not know, so a typo
3
+ // never passes silently.
4
+ export {};
5
+ //# sourceMappingURL=anthropic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anthropic.js","sourceRoot":"","sources":["../../src/providers/anthropic.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,gFAAgF;AAChF,yBAAyB"}
@@ -0,0 +1,108 @@
1
+ import type { JsonObject } from '@acentric/types';
2
+ import type { ResponsesCompaction, ResponsesCustomToolCall, ResponsesCustomToolCallOutput, ResponsesInputItem, ResponsesItem, ResponsesOutputItem, ResponsesStatus } from '../formats/responses.js';
3
+ export type FireworksCredentials = {
4
+ /** A Fireworks API key, `fw_...`, sent as `Authorization: Bearer`. */
5
+ readonly apiKey: string;
6
+ };
7
+ /** Hosted tools: Fireworks runs them, and their results are in the same output. */
8
+ export type FireworksMcpCall = ResponsesItem<'mcp_call', {
9
+ readonly status?: string;
10
+ readonly server_label?: string;
11
+ readonly name?: string;
12
+ }>;
13
+ export type FireworksWebSearchCall = ResponsesItem<'web_search_call', {
14
+ readonly status?: string;
15
+ }>;
16
+ /** Fireworks has no custom tools and no compaction. */
17
+ type SharedOutputItem = Exclude<ResponsesOutputItem, ResponsesCustomToolCall | ResponsesCompaction>;
18
+ export type FireworksOutputItem = SharedOutputItem | FireworksMcpCall | FireworksWebSearchCall;
19
+ /** An item a `native` message may carry. */
20
+ export type FireworksInputItem = Exclude<ResponsesInputItem, ResponsesCustomToolCall | ResponsesCustomToolCallOutput | ResponsesCompaction> | FireworksOutputItem;
21
+ /**
22
+ * What a model takes depends on the model: gpt-oss only low, medium and high;
23
+ * GLM cannot turn reasoning off. A value a model does not take is refused.
24
+ */
25
+ export type FireworksReasoningEffort = 'none' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | (string & {});
26
+ /** A native tool definition: functions, remote MCP or SSE servers, web search, namespaces. */
27
+ export type FireworksTool = JsonObject & {
28
+ readonly type: 'function' | 'mcp' | 'sse' | 'web_search' | 'namespace' | (string & {});
29
+ };
30
+ export type FireworksTextFormat = {
31
+ readonly type: 'text';
32
+ } | {
33
+ readonly type: 'json_object';
34
+ } | {
35
+ readonly type: 'json_schema';
36
+ readonly name: string;
37
+ readonly schema: JsonObject;
38
+ readonly description?: string;
39
+ readonly strict?: boolean | null;
40
+ };
41
+ export type FireworksOptions = {
42
+ /** Hosted and other native tools, sent after the request's own. */
43
+ readonly tools?: readonly FireworksTool[];
44
+ readonly tool_choice?: 'none' | 'auto' | 'required' | (JsonObject & {
45
+ readonly type: string;
46
+ });
47
+ readonly parallel_tool_calls?: boolean | null;
48
+ /** Caps calls to hosted tools. */
49
+ readonly max_tool_calls?: number | null;
50
+ /** Covers visible output and reasoning. */
51
+ readonly max_output_tokens?: number | null;
52
+ readonly temperature?: number | null;
53
+ readonly top_p?: number | null;
54
+ readonly top_logprobs?: number | null;
55
+ /** The reasoning text always comes back; its summary cannot be set. */
56
+ readonly reasoning?: {
57
+ readonly effort?: FireworksReasoningEffort | null;
58
+ } | null;
59
+ /** A JSON schema turns reasoning off on some models. */
60
+ readonly text?: {
61
+ readonly format?: FireworksTextFormat;
62
+ } | null;
63
+ /**
64
+ * Defaults to `true` at Fireworks: the response is kept for 30 days.
65
+ * Zero-data-retention accounts must send `false`.
66
+ */
67
+ readonly store?: boolean | null;
68
+ /** Only `message.output_text.logprobs`: there is no encrypted reasoning. */
69
+ readonly include?: readonly ('message.output_text.logprobs' | (string & {}))[] | null;
70
+ /**
71
+ * Continues from a stored response, so only the new messages are sent.
72
+ * Instructions and tools are not inherited.
73
+ */
74
+ readonly previous_response_id?: string | null;
75
+ readonly metadata?: {
76
+ readonly [key: string]: string;
77
+ } | null;
78
+ readonly truncation?: 'auto' | 'disabled' | null;
79
+ /** Sends requests to the same replica, for more prompt-cache hits. */
80
+ readonly prompt_cache_key?: string | null;
81
+ readonly user?: string | null;
82
+ readonly service_tier?: 'default' | 'priority' | (string & {}) | null;
83
+ /** The client returns one finished response, so `true` is refused. */
84
+ readonly stream?: false | null;
85
+ /** The client returns one finished response, so `true` is refused. */
86
+ readonly background?: false | null;
87
+ };
88
+ /** The response's own fields, kept in `native`. Fireworks echoes nearly every request field; those are left out. */
89
+ export type FireworksNativeResponse = JsonObject & {
90
+ readonly status: ResponsesStatus;
91
+ readonly created_at?: number;
92
+ readonly incomplete_details?: {
93
+ readonly reason?: string;
94
+ } | null;
95
+ };
96
+ /** Model IDs the types know. Any other model, deployment or router ID works too. */
97
+ export type FireworksModelId = 'accounts/fireworks/models/kimi-k3' | 'accounts/fireworks/routers/kimi-k3-fast' | 'accounts/fireworks/models/ember-1' | 'accounts/fireworks/models/deepseek-v4p1-flash' | 'accounts/fireworks/models/glm-5p3' | 'accounts/fireworks/routers/glm-5p3-fast' | 'accounts/fireworks/models/glm-5p3-flash' | 'accounts/fireworks/models/qwen3p8-max' | 'accounts/fireworks/models/minimax-m3' | 'accounts/fireworks/models/gpt-oss-120b' | 'accounts/fireworks/models/nemotron-lightning-3p5-30b-a3b' | 'accounts/fireworks/models/nemotron-3-ultra-nvfp4' | 'accounts/fireworks/models/inkling';
98
+ export type FireworksSpec = {
99
+ readonly api: 'openai-responses';
100
+ readonly credentials: FireworksCredentials;
101
+ readonly options: FireworksOptions;
102
+ readonly inputItem: FireworksInputItem;
103
+ readonly outputItem: FireworksOutputItem;
104
+ readonly response: FireworksNativeResponse;
105
+ readonly modelId: FireworksModelId;
106
+ };
107
+ export {};
108
+ //# sourceMappingURL=fireworks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fireworks.d.ts","sourceRoot":"","sources":["../../src/providers/fireworks.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KA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;QAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CACnE,CAAC;AAEF,oFAAoF;AACpF,MAAM,MAAM,gBAAgB,GACxB,mCAAmC,GACnC,yCAAyC,GACzC,mCAAmC,GACnC,+CAA+C,GAC/C,mCAAmC,GACnC,yCAAyC,GACzC,yCAAyC,GACzC,uCAAuC,GACvC,sCAAsC,GACtC,wCAAwC,GACxC,0DAA0D,GAC1D,kDAAkD,GAClD,mCAAmC,CAAC;AAExC,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,GAAG,EAAE,kBAAkB,CAAC;IACjC,QAAQ,CAAC,WAAW,EAAE,oBAAoB,CAAC;IAC3C,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,kBAAkB,CAAC;IACvC,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,uBAAuB,CAAC;IAC3C,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;CACpC,CAAC"}
@@ -0,0 +1,6 @@
1
+ // Fireworks AI's Responses API: its credentials, request options, items beyond
2
+ // the shared Responses format, and the response fields kept in `native`.
3
+ // Fireworks accepts request fields it does not know and ignores them, so these
4
+ // types are the only check on them.
5
+ export {};
6
+ //# sourceMappingURL=fireworks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fireworks.js","sourceRoot":"","sources":["../../src/providers/fireworks.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,yEAAyE;AACzE,+EAA+E;AAC/E,oCAAoC"}
@@ -0,0 +1,193 @@
1
+ import type { JsonObject } from '@acentric/types';
2
+ import type { ResponsesCaller, ResponsesInputItem, ResponsesItem, ResponsesOutputItem, ResponsesStatus } from '../formats/responses.js';
3
+ export type OpenAiCredentials = {
4
+ readonly apiKey: string;
5
+ /** Sent as `OpenAI-Organization`. */
6
+ readonly organization?: string;
7
+ /** Sent as `OpenAI-Project`. */
8
+ readonly project?: string;
9
+ };
10
+ type CallStatus = {
11
+ readonly status?: string;
12
+ };
13
+ type Called = {
14
+ readonly call_id: string;
15
+ readonly caller?: ResponsesCaller;
16
+ };
17
+ export type OpenAiWebSearchCall = ResponsesItem<'web_search_call', CallStatus>;
18
+ export type OpenAiFileSearchCall = ResponsesItem<'file_search_call', CallStatus>;
19
+ export type OpenAiCodeInterpreterCall = ResponsesItem<'code_interpreter_call', CallStatus>;
20
+ export type OpenAiImageGenerationCall = ResponsesItem<'image_generation_call', CallStatus & {
21
+ readonly result?: string | null;
22
+ }>;
23
+ export type OpenAiMcpCall = ResponsesItem<'mcp_call', CallStatus & {
24
+ readonly server_label: string;
25
+ readonly name: string;
26
+ }>;
27
+ export type OpenAiMcpListTools = ResponsesItem<'mcp_list_tools', {
28
+ readonly server_label: string;
29
+ }>;
30
+ export type OpenAiComputerCall = ResponsesItem<'computer_call', Called & CallStatus>;
31
+ export type OpenAiShellCall = ResponsesItem<'shell_call', Called & CallStatus>;
32
+ export type OpenAiApplyPatchCall = ResponsesItem<'apply_patch_call', Called & CallStatus>;
33
+ export type OpenAiLocalShellCall = ResponsesItem<'local_shell_call', Called & CallStatus>;
34
+ export type OpenAiToolSearchCall = ResponsesItem<'tool_search_call', CallStatus & {
35
+ readonly call_id?: string | null;
36
+ readonly execution?: 'server' | 'client';
37
+ }>;
38
+ /** A hosted MCP tool waiting for the caller's approval. */
39
+ export type OpenAiMcpApprovalRequest = ResponsesItem<'mcp_approval_request', {
40
+ readonly id: string;
41
+ readonly server_label: string;
42
+ readonly name: string;
43
+ readonly arguments: string;
44
+ }>;
45
+ export type OpenAiComputerCallOutput = ResponsesItem<'computer_call_output', Called>;
46
+ export type OpenAiShellCallOutput = ResponsesItem<'shell_call_output', Called>;
47
+ export type OpenAiApplyPatchCallOutput = ResponsesItem<'apply_patch_call_output', Called & {
48
+ readonly status: 'completed' | 'failed';
49
+ readonly output?: string | null;
50
+ }>;
51
+ export type OpenAiLocalShellCallOutput = ResponsesItem<'local_shell_call_output', {
52
+ readonly output: string;
53
+ }>;
54
+ export type OpenAiToolSearchOutput = ResponsesItem<'tool_search_output', {
55
+ readonly call_id?: string | null;
56
+ readonly tools: readonly OpenAiTool[];
57
+ }>;
58
+ export type OpenAiMcpApprovalResponse = ResponsesItem<'mcp_approval_response', {
59
+ readonly approval_request_id: string;
60
+ readonly approve: boolean;
61
+ readonly reason?: string;
62
+ }>;
63
+ /** Programmatic tool calling: a program the model wrote, and its result. */
64
+ export type OpenAiProgram = ResponsesItem<'program', {
65
+ readonly call_id: string;
66
+ readonly fingerprint: string;
67
+ }>;
68
+ export type OpenAiProgramOutput = ResponsesItem<'program_output', {
69
+ readonly call_id: string;
70
+ }>;
71
+ /** Tools added in the middle of the conversation, at this point. */
72
+ export type OpenAiAdditionalTools = ResponsesItem<'additional_tools', {
73
+ readonly role: string;
74
+ readonly tools: readonly OpenAiTool[];
75
+ }>;
76
+ /** Changes the reasoning effort without breaking the prompt cache. */
77
+ export type OpenAiConfigurationUpdate = ResponsesItem<'configuration_update', {
78
+ readonly reasoning?: {
79
+ readonly effort?: OpenAiReasoningEffort;
80
+ };
81
+ }>;
82
+ /** Compacts the context so far. Must be the last input item. */
83
+ export type OpenAiCompactionTrigger = ResponsesItem<'compaction_trigger'>;
84
+ export type OpenAiOutputItem = ResponsesOutputItem | OpenAiWebSearchCall | OpenAiFileSearchCall | OpenAiCodeInterpreterCall | OpenAiImageGenerationCall | OpenAiMcpCall | OpenAiMcpListTools | OpenAiMcpApprovalRequest | OpenAiMcpApprovalResponse | OpenAiComputerCall | OpenAiShellCall | OpenAiShellCallOutput | OpenAiApplyPatchCall | OpenAiApplyPatchCallOutput | OpenAiLocalShellCall | OpenAiToolSearchCall | OpenAiToolSearchOutput | OpenAiProgram | OpenAiProgramOutput | OpenAiAdditionalTools;
85
+ /** An item a `native` message may carry. */
86
+ export type OpenAiInputItem = ResponsesInputItem | OpenAiOutputItem | OpenAiComputerCallOutput | OpenAiLocalShellCallOutput | OpenAiConfigurationUpdate | OpenAiCompactionTrigger;
87
+ export type OpenAiReasoningEffort = 'none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max';
88
+ /** A native tool definition: hosted tools, namespaces, tool search, MCP, shell, computer. */
89
+ export type OpenAiTool = JsonObject & {
90
+ readonly type: 'function' | 'custom' | 'namespace' | 'tool_search' | 'programmatic_tool_calling' | 'web_search' | 'file_search' | 'code_interpreter' | 'image_generation' | 'mcp' | 'shell' | 'apply_patch' | 'computer' | (string & {});
91
+ };
92
+ export type OpenAiInclude = 'reasoning.encrypted_content' | 'message.output_text.logprobs' | 'message.input_image.image_url' | 'web_search_call.action.sources' | 'web_search_call.results' | 'file_search_call.results' | 'code_interpreter_call.outputs' | 'computer_call_output.output.image_url' | (string & {});
93
+ export type OpenAiServiceTier = 'auto' | 'default' | 'flex' | 'scale' | 'priority' | 'fast' | 'ultrafast';
94
+ export type OpenAiTextFormat = {
95
+ readonly type: 'text';
96
+ } | {
97
+ readonly type: 'json_object';
98
+ } | {
99
+ readonly type: 'json_schema';
100
+ readonly name: string;
101
+ readonly schema: JsonObject;
102
+ readonly description?: string;
103
+ readonly strict?: boolean | null;
104
+ };
105
+ export type OpenAiOptions = {
106
+ /** Hosted and other native tools, sent after the request's own. */
107
+ readonly tools?: readonly OpenAiTool[];
108
+ readonly tool_choice?: 'none' | 'auto' | 'required' | (JsonObject & {
109
+ readonly type: string;
110
+ });
111
+ readonly parallel_tool_calls?: boolean | null;
112
+ /** Caps calls to built-in tools. */
113
+ readonly max_tool_calls?: number | null;
114
+ /** Covers visible output and reasoning. */
115
+ readonly max_output_tokens?: number | null;
116
+ readonly temperature?: number | null;
117
+ readonly top_p?: number | null;
118
+ readonly top_logprobs?: number | null;
119
+ readonly reasoning?: {
120
+ readonly effort?: OpenAiReasoningEffort | null;
121
+ readonly summary?: 'auto' | 'concise' | 'detailed' | null;
122
+ readonly context?: 'auto' | 'current_turn' | 'all_turns' | null;
123
+ readonly mode?: 'standard' | 'pro' | (string & {}) | null;
124
+ } | null;
125
+ readonly text?: {
126
+ readonly format?: OpenAiTextFormat;
127
+ readonly verbosity?: 'low' | 'medium' | 'high' | null;
128
+ } | null;
129
+ /** Defaults to `true` at OpenAI: the response is kept for at least 30 days. */
130
+ readonly store?: boolean | null;
131
+ readonly include?: readonly OpenAiInclude[] | null;
132
+ /**
133
+ * Continues from a stored response, so only the new messages are sent.
134
+ * Instructions and tools are not inherited.
135
+ */
136
+ readonly previous_response_id?: string | null;
137
+ /** A conversation OpenAI keeps. Excludes `previous_response_id`. */
138
+ readonly conversation?: string | {
139
+ readonly id: string;
140
+ } | null;
141
+ /** Compaction by OpenAI inside the request. */
142
+ readonly context_management?: readonly {
143
+ readonly type: 'compaction' | (string & {});
144
+ readonly compact_threshold?: number;
145
+ }[] | null;
146
+ readonly metadata?: {
147
+ readonly [key: string]: string;
148
+ } | null;
149
+ readonly safety_identifier?: string | null;
150
+ readonly prompt_cache_key?: string | null;
151
+ readonly prompt_cache_options?: {
152
+ readonly ttl?: '30m' | (string & {});
153
+ readonly mode?: 'implicit' | 'explicit';
154
+ readonly prewarm?: boolean;
155
+ readonly comparison_response_id?: string;
156
+ } | null;
157
+ readonly service_tier?: OpenAiServiceTier | null;
158
+ readonly moderation?: JsonObject | null;
159
+ readonly access_programs?: JsonObject | null;
160
+ /** The client returns one finished response, so `true` is refused. */
161
+ readonly stream?: false | null;
162
+ /** The client returns one finished response, so `true` is refused. */
163
+ readonly background?: false | null;
164
+ };
165
+ /**
166
+ * The response's own fields, kept in `native`: what it says that the request
167
+ * did not. Echoes of the request and fields already in the response are left out.
168
+ */
169
+ export type OpenAiNativeResponse = JsonObject & {
170
+ readonly status: ResponsesStatus;
171
+ readonly created_at?: number;
172
+ readonly completed_at?: number | null;
173
+ readonly incomplete_details?: {
174
+ readonly reason?: string;
175
+ } | null;
176
+ /** The tier actually used, which may differ from the one asked for. */
177
+ readonly service_tier?: OpenAiServiceTier | null;
178
+ /** The reasoning settings in effect. */
179
+ readonly reasoning?: JsonObject | null;
180
+ };
181
+ /** Model IDs the types know. Any other works too. */
182
+ export type OpenAiModelId = 'gpt-6-astra' | 'gpt-6.1-sol' | 'gpt-6-sol' | 'gpt-6-luna' | 'gpt-5.6-sol' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-5.5' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-4.1';
183
+ export type OpenAiSpec = {
184
+ readonly api: 'openai-responses';
185
+ readonly credentials: OpenAiCredentials;
186
+ readonly options: OpenAiOptions;
187
+ readonly inputItem: OpenAiInputItem;
188
+ readonly outputItem: OpenAiOutputItem;
189
+ readonly response: OpenAiNativeResponse;
190
+ readonly modelId: OpenAiModelId;
191
+ };
192
+ export {};
193
+ //# sourceMappingURL=openai.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../src/providers/openai.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,qCAAqC;IACrC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,gCAAgC;IAChC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,KAAK,UAAU,GAAG;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC/C,KAAK,MAAM,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAA;CAAE,CAAC;AAI9E,MA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B,sEAAsE;IACtE,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CACpC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG;IAC9C,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,kBAAkB,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAClE,uEAAuE;IACvE,QAAQ,CAAC,YAAY,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACjD,wCAAwC;IACxC,QAAQ,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;CACxC,CAAC;AAEF,qDAAqD;AACrD,MAAM,MAAM,aAAa,GACrB,aAAa,GACb,aAAa,GACb,WAAW,GACX,YAAY,GACZ,aAAa,GACb,eAAe,GACf,cAAc,GACd,SAAS,GACT,SAAS,GACT,cAAc,GACd,SAAS,CAAC;AAEd,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,GAAG,EAAE,kBAAkB,CAAC;IACjC,QAAQ,CAAC,WAAW,EAAE,iBAAiB,CAAC;IACxC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,eAAe,CAAC;IACpC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,oBAAoB,CAAC;IACxC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;CACjC,CAAC"}
@@ -0,0 +1,4 @@
1
+ // OpenAI's Responses API: its credentials, request options, items beyond the
2
+ // shared Responses format, and the response fields kept in `native`.
3
+ export {};
4
+ //# sourceMappingURL=openai.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openai.js","sourceRoot":"","sources":["../../src/providers/openai.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,qEAAqE"}
@@ -0,0 +1,50 @@
1
+ import type { JsonObject } from '@acentric/types';
2
+ import type { AnthropicSpec } from './providers/anthropic.js';
3
+ import type { FireworksSpec } from './providers/fireworks.js';
4
+ import type { OpenAiSpec } from './providers/openai.js';
5
+ /** An API format: one request and response shape that several providers may serve. */
6
+ export type ApiFormat = 'openai-responses' | 'anthropic-messages';
7
+ /** What a provider contributes to the types. Every entry in `Providers` satisfies it. */
8
+ export type ProviderSpec = {
9
+ /** The API format this provider is called through. */
10
+ readonly api: ApiFormat;
11
+ /** What the client sends the provider to authenticate. Read from secrets, never from args. */
12
+ readonly credentials: JsonObject;
13
+ /** The provider's own request fields, minus the ones the request owns. */
14
+ readonly options: JsonObject;
15
+ /** A provider-specific input item, carried by a `native` message. */
16
+ readonly inputItem: JsonObject;
17
+ /** One item of the provider's output, kept as it is in an assistant message. */
18
+ readonly outputItem: JsonObject;
19
+ /** The provider's response fields other than its output. */
20
+ readonly response: JsonObject;
21
+ /** Model IDs the types know, for autocomplete. Any other ID works too. */
22
+ readonly modelId: string;
23
+ };
24
+ /** Every provider, by ID. */
25
+ export type Providers = {
26
+ readonly anthropic: AnthropicSpec;
27
+ readonly openai: OpenAiSpec;
28
+ readonly fireworks: FireworksSpec;
29
+ };
30
+ /** Fails to compile when a provider does not satisfy `ProviderSpec`. */
31
+ type Checked<T extends {
32
+ readonly [P in keyof Providers]: ProviderSpec;
33
+ }> = T;
34
+ export type RegisteredProviders = Checked<Providers>;
35
+ export type Provider = keyof Providers;
36
+ export type ApiOf<P extends Provider> = Providers[P]['api'];
37
+ export type Credentials<P extends Provider> = Providers[P]['credentials'];
38
+ export type ProviderOptions<P extends Provider> = Providers[P]['options'];
39
+ export type NativeInputItem<P extends Provider> = Providers[P]['inputItem'];
40
+ export type NativeOutputItem<P extends Provider> = Providers[P]['outputItem'];
41
+ export type NativeResponse<P extends Provider> = Providers[P]['response'];
42
+ export type KnownModelId<P extends Provider> = Providers[P]['modelId'];
43
+ /** A model ID the types know, which autocompletes, or any other the provider serves. */
44
+ export type ModelId<P extends Provider> = KnownModelId<P> | (string & {});
45
+ /** The providers called through `api`. */
46
+ export type ProviderOf<A extends ApiFormat> = {
47
+ [P in Provider]: ApiOf<P> extends A ? P : never;
48
+ }[Provider];
49
+ export {};
50
+ //# sourceMappingURL=providers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../src/providers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,sFAAsF;AACtF,MAAM,MAAM,SAAS,GAAG,kBAAkB,GAAG,oBAAoB,CAAC;AAElE,yFAAyF;AACzF,MAAM,MAAM,YAAY,GAAG;IACzB,sDAAsD;IACtD,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC;IACxB,8FAA8F;IAC9F,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC;IACjC,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,qEAAqE;IACrE,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;IAC/B,gFAAgF;IAChF,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC9B,0EAA0E;IAC1E,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,6BAA6B;AAC7B,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,SA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AAC;AAE1E,0CAA0C;AAC1C,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,SAAS,IAAI;KAC3C,CAAC,IAAI,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK;CAChD,CAAC,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ // The providers, and what each contributes to the types. A provider is called
2
+ // through one API format; the formats are the shapes the client reads and
3
+ // writes, and a provider adds its own items and options to its format's.
4
+ export {};
5
+ //# sourceMappingURL=providers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providers.js","sourceRoot":"","sources":["../src/providers.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,0EAA0E;AAC1E,yEAAyE"}
@@ -0,0 +1,15 @@
1
+ import type { Json } from '@acentric/types';
2
+ import type { ReadCall } from './responses.js';
3
+ /** Text blocks split around citations are joined as written. */
4
+ export declare function outputText(items: readonly Json[]): string;
5
+ /** Anthropic reports a refusal as the stop reason, not as content. */
6
+ export declare function refusals(): string[];
7
+ /** Empty unless the request asked for `display: "summarized"`. */
8
+ export declare function reasoningSummary(items: readonly Json[]): string[];
9
+ /**
10
+ * Calls to the caller's tools. Server tools (`server_tool_use`, `mcp_tool_use`)
11
+ * run at Anthropic and are answered in the same message, so they are not here,
12
+ * and every call here is pending.
13
+ */
14
+ export declare function toolCalls(items: readonly Json[]): ReadCall[];
15
+ //# sourceMappingURL=anthropic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anthropic.d.ts","sourceRoot":"","sources":["../../src/read/anthropic.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,iBAAiB,CAAC;AAGxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAM/C,gEAAgE;AAChE,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,MAAM,CAOzD;AAED,sEAAsE;AACtE,wBAAgB,QAAQ,IAAI,MAAM,EAAE,CAEnC;AAED,kEAAkE;AAClE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,MAAM,EAAE,CAOjE;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,GAAG,QAAQ,EAAE,CAqB5D"}