@dazl/api-client 1.0.26 → 1.0.28

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.
@@ -1,6 +1,10 @@
1
1
  export type ClientOptions = {
2
2
  baseUrl: `${string}://${string}` | (string & {});
3
3
  };
4
+ export type StreamTextChunk = {
5
+ type: 'text-delta' | 'reasoning-delta';
6
+ text: string;
7
+ };
4
8
  export type UserRaw = {
5
9
  id: number;
6
10
  createdAt: string;
@@ -32,7 +36,7 @@ export type WorkspaceBase = {
32
36
  isDefault: boolean;
33
37
  repoId: string | null;
34
38
  };
35
- export type WorkspaceWithRepo = {
39
+ export type WorkspaceWithRepoAndMembers = {
36
40
  id: string;
37
41
  name: string;
38
42
  dazlUserId: string | null;
@@ -47,6 +51,27 @@ export type WorkspaceWithRepo = {
47
51
  * The host of the repo associated with this workspace, if any.
48
52
  */
49
53
  repoHost: string | null;
54
+ owner?: {
55
+ /**
56
+ * Dazl ID for the type = "user"
57
+ */
58
+ id: string;
59
+ email: string;
60
+ name?: string;
61
+ picture?: string;
62
+ role: 'workspace_member' | 'owner';
63
+ } | null;
64
+ members?: Array<{
65
+ /**
66
+ * Dazl ID for the type = "user"
67
+ */
68
+ id: string;
69
+ email: string;
70
+ name?: string;
71
+ picture?: string;
72
+ role: 'workspace_member' | 'owner';
73
+ }>;
74
+ projectCount?: number;
50
75
  };
51
76
  export type CreateSessionAuthorized = {
52
77
  status: 'authorized';
@@ -63,6 +88,303 @@ export type ConnectionStatus = {
63
88
  integrationName: IntegrationName;
64
89
  isConnected: boolean;
65
90
  };
91
+ export type GenerateTextResponse = {
92
+ text: string;
93
+ output?: unknown;
94
+ reasoningText?: string;
95
+ /**
96
+ * Tool calls in ToolCallPart shape, directly reusable as assistant message content parts
97
+ */
98
+ toolCalls: Array<ToolCallPart>;
99
+ usage: TextGenerationUsage;
100
+ finishReason: FinishReason;
101
+ providerMetadata?: ProviderMetadata;
102
+ files?: Array<GeneratedFile>;
103
+ };
104
+ export type ToolCallPart = {
105
+ type: 'tool-call';
106
+ toolCallId: string;
107
+ toolName: string;
108
+ input?: unknown;
109
+ providerExecuted?: boolean;
110
+ providerOptions?: ProviderOptions;
111
+ };
112
+ /**
113
+ * Provider-specific options passed through to the underlying provider, keyed by provider name
114
+ */
115
+ export type ProviderOptions = {
116
+ [key: string]: {
117
+ [key: string]: unknown;
118
+ };
119
+ };
120
+ export type TextGenerationUsage = {
121
+ /**
122
+ * Model that actually served the request
123
+ */
124
+ model: 'claude-sonnet-5-anthropic' | 'claude-sonnet-5-vertex' | 'claude-sonnet-4-6-anthropic' | 'claude-sonnet-4-6-vertex' | 'claude-opus-4-8-anthropic' | 'claude-opus-4-8-vertex' | 'claude-opus-4-7-anthropic' | 'claude-opus-4-7-vertex' | 'claude-haiku-4-5-anthropic' | 'claude-haiku-4-5-vertex' | 'gemini-3-0-flash-vertex' | 'gemini-3-5-flash-vertex' | 'gemini-3-1-pro-vertex' | 'qwen-3-coder-openrouter' | 'qwen-3-coder-next-openrouter' | 'qwen-3-6-plus-openrouter' | 'qwen-3-5-flash-openrouter' | 'grok-code-fast-openrouter' | 'deepseek-v3-1-openrouter' | 'deepseek-v4-pro-openrouter' | 'deepseek-v4-flash-openrouter' | 'kimi-k-2-6-openrouter' | 'gpt-5-5-bedrock' | 'gpt-5-4-bedrock' | 'grok-4-3-bedrock' | 'glm-5-bedrock' | 'gpt-5-4-nano-openrouter' | 'gpt-5-4-mini-openrouter' | 'gpt-5-3-codex-openrouter' | 'minimax-m-2-7-openrouter' | 'hy3-preview-openrouter' | 'gemini-3-0-pro-image' | 'gemini-3-1-flash-image';
125
+ inputTokens: number;
126
+ inputTokensCost: number;
127
+ outputTokens: number;
128
+ outputTokensCost: number;
129
+ cacheWriteTokens: number;
130
+ cacheWriteTokensCost: number;
131
+ cacheReadTokens: number;
132
+ cacheReadTokensCost: number;
133
+ totalCost: number;
134
+ };
135
+ export type FinishReason = 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other';
136
+ /**
137
+ * Provider-specific metadata returned by the underlying provider, keyed by provider name
138
+ */
139
+ export type ProviderMetadata = {
140
+ [key: string]: {
141
+ [key: string]: unknown;
142
+ };
143
+ };
144
+ export type GeneratedFile = {
145
+ base64: string;
146
+ mediaType: string;
147
+ };
148
+ export type GenerateTextRequest = {
149
+ /**
150
+ * Primary model id
151
+ */
152
+ model: 'claude-sonnet-5-anthropic' | 'claude-sonnet-5-vertex' | 'claude-sonnet-4-6-anthropic' | 'claude-sonnet-4-6-vertex' | 'claude-opus-4-8-anthropic' | 'claude-opus-4-8-vertex' | 'claude-opus-4-7-anthropic' | 'claude-opus-4-7-vertex' | 'claude-haiku-4-5-anthropic' | 'claude-haiku-4-5-vertex' | 'gemini-3-0-flash-vertex' | 'gemini-3-5-flash-vertex' | 'gemini-3-1-pro-vertex' | 'qwen-3-coder-openrouter' | 'qwen-3-coder-next-openrouter' | 'qwen-3-6-plus-openrouter' | 'qwen-3-5-flash-openrouter' | 'grok-code-fast-openrouter' | 'deepseek-v3-1-openrouter' | 'deepseek-v4-pro-openrouter' | 'deepseek-v4-flash-openrouter' | 'kimi-k-2-6-openrouter' | 'gpt-5-5-bedrock' | 'gpt-5-4-bedrock' | 'grok-4-3-bedrock' | 'glm-5-bedrock' | 'gpt-5-4-nano-openrouter' | 'gpt-5-4-mini-openrouter' | 'gpt-5-3-codex-openrouter' | 'minimax-m-2-7-openrouter' | 'hy3-preview-openrouter' | 'gemini-3-0-pro-image' | 'gemini-3-1-flash-image';
153
+ /**
154
+ * Ordered fallback models, tried when the primary model fails before any output is produced
155
+ */
156
+ fallbackModels?: Array<TextGenerationModelId>;
157
+ /**
158
+ * Conversation messages: user, assistant, and tool
159
+ */
160
+ messages: Array<ModelMessage>;
161
+ /**
162
+ * System prompt: plain string, a single system message, or an array of system messages
163
+ */
164
+ system?: string | SystemModelMessage | Array<SystemModelMessage>;
165
+ /**
166
+ * Tool definitions available to the model, keyed by tool name
167
+ */
168
+ tools?: {
169
+ [key: string]: ToolDefinition;
170
+ };
171
+ /**
172
+ * Subset of tool names from tools enabled for this call
173
+ */
174
+ activeTools?: Array<string>;
175
+ reasoning?: ReasoningEffort;
176
+ maxOutputTokens?: number;
177
+ temperature?: number;
178
+ maxRetries?: number;
179
+ providerOptions?: ProviderOptions;
180
+ output?: TextGenerationOutput;
181
+ /**
182
+ * Correlation id attached to the operation logs; generated when omitted
183
+ */
184
+ opId?: string;
185
+ };
186
+ export type TextGenerationModelId = 'claude-sonnet-5-anthropic' | 'claude-sonnet-5-vertex' | 'claude-sonnet-4-6-anthropic' | 'claude-sonnet-4-6-vertex' | 'claude-opus-4-8-anthropic' | 'claude-opus-4-8-vertex' | 'claude-opus-4-7-anthropic' | 'claude-opus-4-7-vertex' | 'claude-haiku-4-5-anthropic' | 'claude-haiku-4-5-vertex' | 'gemini-3-0-flash-vertex' | 'gemini-3-5-flash-vertex' | 'gemini-3-1-pro-vertex' | 'qwen-3-coder-openrouter' | 'qwen-3-coder-next-openrouter' | 'qwen-3-6-plus-openrouter' | 'qwen-3-5-flash-openrouter' | 'grok-code-fast-openrouter' | 'deepseek-v3-1-openrouter' | 'deepseek-v4-pro-openrouter' | 'deepseek-v4-flash-openrouter' | 'kimi-k-2-6-openrouter' | 'gpt-5-5-bedrock' | 'gpt-5-4-bedrock' | 'grok-4-3-bedrock' | 'glm-5-bedrock' | 'gpt-5-4-nano-openrouter' | 'gpt-5-4-mini-openrouter' | 'gpt-5-3-codex-openrouter' | 'minimax-m-2-7-openrouter' | 'hy3-preview-openrouter' | 'gemini-3-0-pro-image' | 'gemini-3-1-flash-image';
187
+ export type ModelMessage = ({
188
+ role: 'user';
189
+ } & UserModelMessage) | ({
190
+ role: 'assistant';
191
+ } & AssistantModelMessage) | ({
192
+ role: 'tool';
193
+ } & ToolModelMessage);
194
+ export type UserModelMessage = {
195
+ role: 'user';
196
+ content: string | Array<TextPart | ImagePart | FilePart>;
197
+ providerOptions?: ProviderOptions;
198
+ };
199
+ export type TextPart = {
200
+ type: 'text';
201
+ text: string;
202
+ providerOptions?: ProviderOptions;
203
+ };
204
+ export type ImagePart = {
205
+ type: 'image';
206
+ /**
207
+ * Base64-encoded image data, a data url, or an http(s) url
208
+ */
209
+ image: string;
210
+ mediaType?: string;
211
+ providerOptions?: ProviderOptions;
212
+ };
213
+ export type FilePart = {
214
+ type: 'file';
215
+ /**
216
+ * Base64-encoded file data, a data url, or an http(s) url
217
+ */
218
+ data: string;
219
+ filename?: string;
220
+ /**
221
+ * IANA media type (e.g. image/png) or top-level segment (e.g. image)
222
+ */
223
+ mediaType: string;
224
+ providerOptions?: ProviderOptions;
225
+ };
226
+ export type AssistantModelMessage = {
227
+ role: 'assistant';
228
+ content: string | Array<TextPart | ReasoningPart | FilePart | ToolCallPart>;
229
+ providerOptions?: ProviderOptions;
230
+ };
231
+ export type ReasoningPart = {
232
+ type: 'reasoning';
233
+ text: string;
234
+ providerOptions?: ProviderOptions;
235
+ };
236
+ export type ToolModelMessage = {
237
+ role: 'tool';
238
+ content: Array<ToolResultPart>;
239
+ providerOptions?: ProviderOptions;
240
+ };
241
+ export type ToolResultPart = {
242
+ type: 'tool-result';
243
+ /**
244
+ * Must match the toolCallId of the corresponding tool call
245
+ */
246
+ toolCallId: string;
247
+ toolName: string;
248
+ output: ToolResultOutput;
249
+ providerOptions?: ProviderOptions;
250
+ };
251
+ export type ToolResultOutput = {
252
+ type: 'text';
253
+ value: string;
254
+ } | {
255
+ type: 'json';
256
+ value?: unknown;
257
+ } | {
258
+ type: 'error-text';
259
+ value: string;
260
+ } | {
261
+ type: 'error-json';
262
+ value?: unknown;
263
+ } | {
264
+ type: 'content';
265
+ value: Array<{
266
+ type: 'text';
267
+ text: string;
268
+ } | {
269
+ type: 'file-data';
270
+ data: string;
271
+ mediaType: string;
272
+ }>;
273
+ };
274
+ export type SystemModelMessage = {
275
+ role: 'system';
276
+ content: string;
277
+ providerOptions?: ProviderOptions;
278
+ };
279
+ export type ToolDefinition = {
280
+ description?: string;
281
+ /**
282
+ * JSON Schema of the tool input
283
+ */
284
+ inputSchema: {
285
+ [key: string]: unknown;
286
+ };
287
+ };
288
+ /**
289
+ * Reasoning effort for models that support it
290
+ */
291
+ export type ReasoningEffort = 'none' | 'low' | 'medium' | 'high';
292
+ /**
293
+ * Requested output mode: plain text, an object matching schema, or an array of elements matching elementSchema
294
+ */
295
+ export type TextGenerationOutput = {
296
+ type: 'text';
297
+ } | {
298
+ type: 'object';
299
+ schema: {
300
+ [key: string]: unknown;
301
+ };
302
+ } | {
303
+ type: 'array';
304
+ elementSchema: {
305
+ [key: string]: unknown;
306
+ };
307
+ };
308
+ /**
309
+ * Data payload of one server-sent event: text-delta and reasoning-delta events carry StreamTextChunk, the done event carries the final GenerateTextResponse, the error event carries ErrorResponse. A stream ending without done or error was aborted or truncated.
310
+ */
311
+ export type StreamTextEvent = StreamTextChunk | StreamTextResult | ErrorResponse;
312
+ export type StreamTextResult = {
313
+ text: string;
314
+ output?: unknown;
315
+ reasoningText?: string;
316
+ /**
317
+ * Tool calls in ToolCallPart shape, directly reusable as assistant message content parts
318
+ */
319
+ toolCalls: Array<ToolCallPart>;
320
+ usage: TextGenerationUsage;
321
+ finishReason: FinishReason;
322
+ providerMetadata?: ProviderMetadata;
323
+ files?: Array<GeneratedFile>;
324
+ };
325
+ export type StreamTextRequest = {
326
+ /**
327
+ * Primary model id
328
+ */
329
+ model: 'claude-sonnet-5-anthropic' | 'claude-sonnet-5-vertex' | 'claude-sonnet-4-6-anthropic' | 'claude-sonnet-4-6-vertex' | 'claude-opus-4-8-anthropic' | 'claude-opus-4-8-vertex' | 'claude-opus-4-7-anthropic' | 'claude-opus-4-7-vertex' | 'claude-haiku-4-5-anthropic' | 'claude-haiku-4-5-vertex' | 'gemini-3-0-flash-vertex' | 'gemini-3-5-flash-vertex' | 'gemini-3-1-pro-vertex' | 'qwen-3-coder-openrouter' | 'qwen-3-coder-next-openrouter' | 'qwen-3-6-plus-openrouter' | 'qwen-3-5-flash-openrouter' | 'grok-code-fast-openrouter' | 'deepseek-v3-1-openrouter' | 'deepseek-v4-pro-openrouter' | 'deepseek-v4-flash-openrouter' | 'kimi-k-2-6-openrouter' | 'gpt-5-5-bedrock' | 'gpt-5-4-bedrock' | 'grok-4-3-bedrock' | 'glm-5-bedrock' | 'gpt-5-4-nano-openrouter' | 'gpt-5-4-mini-openrouter' | 'gpt-5-3-codex-openrouter' | 'minimax-m-2-7-openrouter' | 'hy3-preview-openrouter' | 'gemini-3-0-pro-image' | 'gemini-3-1-flash-image';
330
+ /**
331
+ * Ordered fallback models, tried when the primary model fails before any output is produced
332
+ */
333
+ fallbackModels?: Array<TextGenerationModelId>;
334
+ /**
335
+ * Conversation messages: user, assistant, and tool
336
+ */
337
+ messages: Array<ModelMessage>;
338
+ /**
339
+ * System prompt: plain string, a single system message, or an array of system messages
340
+ */
341
+ system?: string | SystemModelMessage | Array<SystemModelMessage>;
342
+ /**
343
+ * Tool definitions available to the model, keyed by tool name
344
+ */
345
+ tools?: {
346
+ [key: string]: ToolDefinition;
347
+ };
348
+ /**
349
+ * Subset of tool names from tools enabled for this call
350
+ */
351
+ activeTools?: Array<string>;
352
+ reasoning?: ReasoningEffort;
353
+ maxOutputTokens?: number;
354
+ temperature?: number;
355
+ maxRetries?: number;
356
+ providerOptions?: ProviderOptions;
357
+ output?: TextGenerationOutput;
358
+ /**
359
+ * Correlation id attached to the operation logs; generated when omitted
360
+ */
361
+ opId?: string;
362
+ };
363
+ export type GenerateImageResponse = {
364
+ base64: string;
365
+ mediaType: ImageMediaType;
366
+ usage: ImageGenerationUsage;
367
+ };
368
+ export type ImageMediaType = 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp';
369
+ export type ImageGenerationUsage = {
370
+ model: ImageGenerationModelId;
371
+ totalCost: number;
372
+ inputTokens?: number;
373
+ outputTokens?: number;
374
+ totalTokens?: number;
375
+ };
376
+ export type ImageGenerationModelId = 'imagen-4-0-fast' | 'imagen-4-0' | 'imagen-4-0-ultra';
377
+ export type GenerateImageRequest = {
378
+ model: ImageGenerationModelId;
379
+ prompt: string;
380
+ aspectRatio: AspectRatio;
381
+ providerOptions?: ProviderOptions;
382
+ /**
383
+ * Correlation id attached to the operation logs; generated when omitted
384
+ */
385
+ opId?: string;
386
+ };
387
+ export type AspectRatio = '1:1' | '3:4' | '4:3' | '9:16' | '16:9';
66
388
  export type UserMention = {
67
389
  dazlUserId: string;
68
390
  };
@@ -524,7 +846,7 @@ export type GetWorkspaceResponses = {
524
846
  * Returns the workspace with the given ID
525
847
  */
526
848
  200: {
527
- workspace: WorkspaceWithRepo;
849
+ workspace: WorkspaceWithRepoAndMembers;
528
850
  };
529
851
  };
530
852
  export type GetWorkspaceResponse = GetWorkspaceResponses[keyof GetWorkspaceResponses];
@@ -667,42 +989,7 @@ export type GetAllWorkspacesWithCreateResponses = {
667
989
  * Returns the list of workspaces for the current user
668
990
  */
669
991
  200: {
670
- workspaces: Array<{
671
- id: string;
672
- name: string;
673
- dazlUserId: string | null;
674
- createdAt: string;
675
- isDefault: boolean;
676
- repoId: string | null;
677
- /**
678
- * The full name of the repo associated with this workspace, if any.
679
- */
680
- repoFullName: string | null;
681
- /**
682
- * The host of the repo associated with this workspace, if any.
683
- */
684
- repoHost: string | null;
685
- owner?: {
686
- /**
687
- * Dazl ID for the type = "user"
688
- */
689
- id: string;
690
- email: string;
691
- name?: string;
692
- picture?: string;
693
- role: 'workspace_member' | 'owner';
694
- } | null;
695
- members?: Array<{
696
- /**
697
- * Dazl ID for the type = "user"
698
- */
699
- id: string;
700
- email: string;
701
- name?: string;
702
- picture?: string;
703
- role: 'workspace_member' | 'owner';
704
- }>;
705
- }>;
992
+ workspaces: Array<WorkspaceWithRepoAndMembers>;
706
993
  };
707
994
  };
708
995
  export type GetAllWorkspacesWithCreateResponse = GetAllWorkspacesWithCreateResponses[keyof GetAllWorkspacesWithCreateResponses];
@@ -1483,6 +1770,147 @@ export type GetConnectionStatusResponses = {
1483
1770
  200: Array<ConnectionStatus>;
1484
1771
  };
1485
1772
  export type GetConnectionStatusResponse = GetConnectionStatusResponses[keyof GetConnectionStatusResponses];
1773
+ export type GenerateTextData = {
1774
+ body: GenerateTextRequest;
1775
+ path?: never;
1776
+ query?: never;
1777
+ url: '/ai-gateway/generate-text';
1778
+ };
1779
+ export type GenerateTextErrors = {
1780
+ /**
1781
+ * Bad request - Invalid parameters or malformed JSON
1782
+ */
1783
+ 400: {
1784
+ message: string;
1785
+ issues?: string;
1786
+ };
1787
+ /**
1788
+ * Unauthorized
1789
+ */
1790
+ 401: ErrorResponse;
1791
+ /**
1792
+ * Forbidden
1793
+ */
1794
+ 403: ErrorResponse;
1795
+ /**
1796
+ * Not Found
1797
+ */
1798
+ 404: ErrorResponse;
1799
+ /**
1800
+ * Conflict
1801
+ */
1802
+ 409: ErrorResponse;
1803
+ /**
1804
+ * Internal server error
1805
+ */
1806
+ 500: ErrorResponse;
1807
+ /**
1808
+ * Service Unavailable
1809
+ */
1810
+ 503: ErrorResponse;
1811
+ };
1812
+ export type GenerateTextError = GenerateTextErrors[keyof GenerateTextErrors];
1813
+ export type GenerateTextResponses = {
1814
+ /**
1815
+ * Generates text response from selected AI model
1816
+ */
1817
+ 200: GenerateTextResponse;
1818
+ };
1819
+ export type GenerateTextResponse2 = GenerateTextResponses[keyof GenerateTextResponses];
1820
+ export type StreamTextData = {
1821
+ body: StreamTextRequest;
1822
+ path?: never;
1823
+ query?: never;
1824
+ url: '/ai-gateway/stream-text';
1825
+ };
1826
+ export type StreamTextErrors = {
1827
+ /**
1828
+ * Bad request - Invalid parameters or malformed JSON
1829
+ */
1830
+ 400: {
1831
+ message: string;
1832
+ issues?: string;
1833
+ };
1834
+ /**
1835
+ * Unauthorized
1836
+ */
1837
+ 401: ErrorResponse;
1838
+ /**
1839
+ * Forbidden
1840
+ */
1841
+ 403: ErrorResponse;
1842
+ /**
1843
+ * Not Found
1844
+ */
1845
+ 404: ErrorResponse;
1846
+ /**
1847
+ * Conflict
1848
+ */
1849
+ 409: ErrorResponse;
1850
+ /**
1851
+ * Internal server error
1852
+ */
1853
+ 500: ErrorResponse;
1854
+ /**
1855
+ * Service Unavailable
1856
+ */
1857
+ 503: ErrorResponse;
1858
+ };
1859
+ export type StreamTextError = StreamTextErrors[keyof StreamTextErrors];
1860
+ export type StreamTextResponses = {
1861
+ /**
1862
+ * Streams text chunks using Server-Sent Events
1863
+ */
1864
+ 200: StreamTextEvent;
1865
+ };
1866
+ export type StreamTextResponse = StreamTextResponses[keyof StreamTextResponses];
1867
+ export type GenerateImageData = {
1868
+ body: GenerateImageRequest;
1869
+ path?: never;
1870
+ query?: never;
1871
+ url: '/ai-gateway/generate-image';
1872
+ };
1873
+ export type GenerateImageErrors = {
1874
+ /**
1875
+ * Bad request - Invalid parameters or malformed JSON
1876
+ */
1877
+ 400: {
1878
+ message: string;
1879
+ issues?: string;
1880
+ };
1881
+ /**
1882
+ * Unauthorized
1883
+ */
1884
+ 401: ErrorResponse;
1885
+ /**
1886
+ * Forbidden
1887
+ */
1888
+ 403: ErrorResponse;
1889
+ /**
1890
+ * Not Found
1891
+ */
1892
+ 404: ErrorResponse;
1893
+ /**
1894
+ * Conflict
1895
+ */
1896
+ 409: ErrorResponse;
1897
+ /**
1898
+ * Internal server error
1899
+ */
1900
+ 500: ErrorResponse;
1901
+ /**
1902
+ * Service Unavailable
1903
+ */
1904
+ 503: ErrorResponse;
1905
+ };
1906
+ export type GenerateImageError = GenerateImageErrors[keyof GenerateImageErrors];
1907
+ export type GenerateImageResponses = {
1908
+ /**
1909
+ * Generates an image and returns base64 payload and usage
1910
+ */
1911
+ 200: GenerateImageResponse;
1912
+ };
1913
+ export type GenerateImageResponse2 = GenerateImageResponses[keyof GenerateImageResponses];
1486
1914
  export type DeleteCommentData = {
1487
1915
  body?: never;
1488
1916
  path: {