@dazl/api-client 1.0.27 → 1.0.29

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.
@@ -35,6 +35,10 @@ export type PromotionNames = {
35
35
  'PRO_FEATURE_SET_BY_ADMIN'
36
36
  ];
37
37
  };
38
+ export type StreamTextChunk = {
39
+ type: 'text-delta' | 'reasoning-delta';
40
+ text: string;
41
+ };
38
42
  export type UserRaw = {
39
43
  id: number;
40
44
  createdAt: string;
@@ -533,6 +537,303 @@ export type ConnectionStatus = {
533
537
  integrationName: IntegrationName;
534
538
  isConnected: boolean;
535
539
  };
540
+ export type GenerateTextResponse = {
541
+ text: string;
542
+ output?: unknown;
543
+ reasoningText?: string;
544
+ /**
545
+ * Tool calls in ToolCallPart shape, directly reusable as assistant message content parts
546
+ */
547
+ toolCalls: Array<ToolCallPart>;
548
+ usage: TextGenerationUsage;
549
+ finishReason: FinishReason;
550
+ providerMetadata?: ProviderMetadata;
551
+ files?: Array<GeneratedFile>;
552
+ };
553
+ export type ToolCallPart = {
554
+ type: 'tool-call';
555
+ toolCallId: string;
556
+ toolName: string;
557
+ input?: unknown;
558
+ providerExecuted?: boolean;
559
+ providerOptions?: ProviderOptions;
560
+ };
561
+ /**
562
+ * Provider-specific options passed through to the underlying provider, keyed by provider name
563
+ */
564
+ export type ProviderOptions = {
565
+ [key: string]: {
566
+ [key: string]: unknown;
567
+ };
568
+ };
569
+ export type TextGenerationUsage = {
570
+ /**
571
+ * Model that actually served the request
572
+ */
573
+ 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';
574
+ inputTokens: number;
575
+ inputTokensCost: number;
576
+ outputTokens: number;
577
+ outputTokensCost: number;
578
+ cacheWriteTokens: number;
579
+ cacheWriteTokensCost: number;
580
+ cacheReadTokens: number;
581
+ cacheReadTokensCost: number;
582
+ totalCost: number;
583
+ };
584
+ export type FinishReason = 'stop' | 'length' | 'content-filter' | 'tool-calls' | 'error' | 'other';
585
+ /**
586
+ * Provider-specific metadata returned by the underlying provider, keyed by provider name
587
+ */
588
+ export type ProviderMetadata = {
589
+ [key: string]: {
590
+ [key: string]: unknown;
591
+ };
592
+ };
593
+ export type GeneratedFile = {
594
+ base64: string;
595
+ mediaType: string;
596
+ };
597
+ export type GenerateTextRequest = {
598
+ /**
599
+ * Primary model id
600
+ */
601
+ 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';
602
+ /**
603
+ * Ordered fallback models, tried when the primary model fails before any output is produced
604
+ */
605
+ fallbackModels?: Array<TextGenerationModelId>;
606
+ /**
607
+ * Conversation messages: user, assistant, and tool
608
+ */
609
+ messages: Array<ModelMessage>;
610
+ /**
611
+ * System prompt: plain string, a single system message, or an array of system messages
612
+ */
613
+ system?: string | SystemModelMessage | Array<SystemModelMessage>;
614
+ /**
615
+ * Tool definitions available to the model, keyed by tool name
616
+ */
617
+ tools?: {
618
+ [key: string]: ToolDefinition;
619
+ };
620
+ /**
621
+ * Subset of tool names from tools enabled for this call
622
+ */
623
+ activeTools?: Array<string>;
624
+ reasoning?: ReasoningEffort;
625
+ maxOutputTokens?: number;
626
+ temperature?: number;
627
+ maxRetries?: number;
628
+ providerOptions?: ProviderOptions;
629
+ output?: TextGenerationOutput;
630
+ /**
631
+ * Correlation id attached to the operation logs; generated when omitted
632
+ */
633
+ opId?: string;
634
+ };
635
+ 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';
636
+ export type ModelMessage = ({
637
+ role: 'user';
638
+ } & UserModelMessage) | ({
639
+ role: 'assistant';
640
+ } & AssistantModelMessage) | ({
641
+ role: 'tool';
642
+ } & ToolModelMessage);
643
+ export type UserModelMessage = {
644
+ role: 'user';
645
+ content: string | Array<TextPart | ImagePart | FilePart>;
646
+ providerOptions?: ProviderOptions;
647
+ };
648
+ export type TextPart = {
649
+ type: 'text';
650
+ text: string;
651
+ providerOptions?: ProviderOptions;
652
+ };
653
+ export type ImagePart = {
654
+ type: 'image';
655
+ /**
656
+ * Base64-encoded image data, a data url, or an http(s) url
657
+ */
658
+ image: string;
659
+ mediaType?: string;
660
+ providerOptions?: ProviderOptions;
661
+ };
662
+ export type FilePart = {
663
+ type: 'file';
664
+ /**
665
+ * Base64-encoded file data, a data url, or an http(s) url
666
+ */
667
+ data: string;
668
+ filename?: string;
669
+ /**
670
+ * IANA media type (e.g. image/png) or top-level segment (e.g. image)
671
+ */
672
+ mediaType: string;
673
+ providerOptions?: ProviderOptions;
674
+ };
675
+ export type AssistantModelMessage = {
676
+ role: 'assistant';
677
+ content: string | Array<TextPart | ReasoningPart | FilePart | ToolCallPart>;
678
+ providerOptions?: ProviderOptions;
679
+ };
680
+ export type ReasoningPart = {
681
+ type: 'reasoning';
682
+ text: string;
683
+ providerOptions?: ProviderOptions;
684
+ };
685
+ export type ToolModelMessage = {
686
+ role: 'tool';
687
+ content: Array<ToolResultPart>;
688
+ providerOptions?: ProviderOptions;
689
+ };
690
+ export type ToolResultPart = {
691
+ type: 'tool-result';
692
+ /**
693
+ * Must match the toolCallId of the corresponding tool call
694
+ */
695
+ toolCallId: string;
696
+ toolName: string;
697
+ output: ToolResultOutput;
698
+ providerOptions?: ProviderOptions;
699
+ };
700
+ export type ToolResultOutput = {
701
+ type: 'text';
702
+ value: string;
703
+ } | {
704
+ type: 'json';
705
+ value?: unknown;
706
+ } | {
707
+ type: 'error-text';
708
+ value: string;
709
+ } | {
710
+ type: 'error-json';
711
+ value?: unknown;
712
+ } | {
713
+ type: 'content';
714
+ value: Array<{
715
+ type: 'text';
716
+ text: string;
717
+ } | {
718
+ type: 'file-data';
719
+ data: string;
720
+ mediaType: string;
721
+ }>;
722
+ };
723
+ export type SystemModelMessage = {
724
+ role: 'system';
725
+ content: string;
726
+ providerOptions?: ProviderOptions;
727
+ };
728
+ export type ToolDefinition = {
729
+ description?: string;
730
+ /**
731
+ * JSON Schema of the tool input
732
+ */
733
+ inputSchema: {
734
+ [key: string]: unknown;
735
+ };
736
+ };
737
+ /**
738
+ * Reasoning effort for models that support it
739
+ */
740
+ export type ReasoningEffort = 'none' | 'low' | 'medium' | 'high';
741
+ /**
742
+ * Requested output mode: plain text, an object matching schema, or an array of elements matching elementSchema
743
+ */
744
+ export type TextGenerationOutput = {
745
+ type: 'text';
746
+ } | {
747
+ type: 'object';
748
+ schema: {
749
+ [key: string]: unknown;
750
+ };
751
+ } | {
752
+ type: 'array';
753
+ elementSchema: {
754
+ [key: string]: unknown;
755
+ };
756
+ };
757
+ /**
758
+ * 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.
759
+ */
760
+ export type StreamTextEvent = StreamTextChunk | StreamTextResult | ErrorResponse;
761
+ export type StreamTextResult = {
762
+ text: string;
763
+ output?: unknown;
764
+ reasoningText?: string;
765
+ /**
766
+ * Tool calls in ToolCallPart shape, directly reusable as assistant message content parts
767
+ */
768
+ toolCalls: Array<ToolCallPart>;
769
+ usage: TextGenerationUsage;
770
+ finishReason: FinishReason;
771
+ providerMetadata?: ProviderMetadata;
772
+ files?: Array<GeneratedFile>;
773
+ };
774
+ export type StreamTextRequest = {
775
+ /**
776
+ * Primary model id
777
+ */
778
+ 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';
779
+ /**
780
+ * Ordered fallback models, tried when the primary model fails before any output is produced
781
+ */
782
+ fallbackModels?: Array<TextGenerationModelId>;
783
+ /**
784
+ * Conversation messages: user, assistant, and tool
785
+ */
786
+ messages: Array<ModelMessage>;
787
+ /**
788
+ * System prompt: plain string, a single system message, or an array of system messages
789
+ */
790
+ system?: string | SystemModelMessage | Array<SystemModelMessage>;
791
+ /**
792
+ * Tool definitions available to the model, keyed by tool name
793
+ */
794
+ tools?: {
795
+ [key: string]: ToolDefinition;
796
+ };
797
+ /**
798
+ * Subset of tool names from tools enabled for this call
799
+ */
800
+ activeTools?: Array<string>;
801
+ reasoning?: ReasoningEffort;
802
+ maxOutputTokens?: number;
803
+ temperature?: number;
804
+ maxRetries?: number;
805
+ providerOptions?: ProviderOptions;
806
+ output?: TextGenerationOutput;
807
+ /**
808
+ * Correlation id attached to the operation logs; generated when omitted
809
+ */
810
+ opId?: string;
811
+ };
812
+ export type GenerateImageResponse = {
813
+ base64: string;
814
+ mediaType: ImageMediaType;
815
+ usage: ImageGenerationUsage;
816
+ };
817
+ export type ImageMediaType = 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp';
818
+ export type ImageGenerationUsage = {
819
+ model: ImageGenerationModelId;
820
+ totalCost: number;
821
+ inputTokens?: number;
822
+ outputTokens?: number;
823
+ totalTokens?: number;
824
+ };
825
+ export type ImageGenerationModelId = 'imagen-4-0-fast' | 'imagen-4-0' | 'imagen-4-0-ultra';
826
+ export type GenerateImageRequest = {
827
+ model: ImageGenerationModelId;
828
+ prompt: string;
829
+ aspectRatio: AspectRatio;
830
+ providerOptions?: ProviderOptions;
831
+ /**
832
+ * Correlation id attached to the operation logs; generated when omitted
833
+ */
834
+ opId?: string;
835
+ };
836
+ export type AspectRatio = '1:1' | '3:4' | '4:3' | '9:16' | '16:9';
536
837
  export type CreateCommentInput = {
537
838
  content: string;
538
839
  /**
@@ -2444,6 +2745,7 @@ export type UpdateProjectData = {
2444
2745
  latestScreenshot?: string | null;
2445
2746
  archivedAt?: string | string | null;
2446
2747
  remoteEnvConfigId?: string | null;
2748
+ workspaceId?: string;
2447
2749
  /**
2448
2750
  * The dazl ID of the requesting user, used for permission checks
2449
2751
  */
@@ -7231,6 +7533,147 @@ export type GetConnectionStatusResponses = {
7231
7533
  200: Array<ConnectionStatus>;
7232
7534
  };
7233
7535
  export type GetConnectionStatusResponse = GetConnectionStatusResponses[keyof GetConnectionStatusResponses];
7536
+ export type GenerateTextData = {
7537
+ body: GenerateTextRequest;
7538
+ path?: never;
7539
+ query?: never;
7540
+ url: '/ai-gateway/generate-text';
7541
+ };
7542
+ export type GenerateTextErrors = {
7543
+ /**
7544
+ * Bad request - Invalid parameters or malformed JSON
7545
+ */
7546
+ 400: {
7547
+ message: string;
7548
+ issues?: string;
7549
+ };
7550
+ /**
7551
+ * Unauthorized
7552
+ */
7553
+ 401: ErrorResponse;
7554
+ /**
7555
+ * Forbidden
7556
+ */
7557
+ 403: ErrorResponse;
7558
+ /**
7559
+ * Not Found
7560
+ */
7561
+ 404: ErrorResponse;
7562
+ /**
7563
+ * Conflict
7564
+ */
7565
+ 409: ErrorResponse;
7566
+ /**
7567
+ * Internal server error
7568
+ */
7569
+ 500: ErrorResponse;
7570
+ /**
7571
+ * Service Unavailable
7572
+ */
7573
+ 503: ErrorResponse;
7574
+ };
7575
+ export type GenerateTextError = GenerateTextErrors[keyof GenerateTextErrors];
7576
+ export type GenerateTextResponses = {
7577
+ /**
7578
+ * Generates text response from selected AI model
7579
+ */
7580
+ 200: GenerateTextResponse;
7581
+ };
7582
+ export type GenerateTextResponse2 = GenerateTextResponses[keyof GenerateTextResponses];
7583
+ export type StreamTextData = {
7584
+ body: StreamTextRequest;
7585
+ path?: never;
7586
+ query?: never;
7587
+ url: '/ai-gateway/stream-text';
7588
+ };
7589
+ export type StreamTextErrors = {
7590
+ /**
7591
+ * Bad request - Invalid parameters or malformed JSON
7592
+ */
7593
+ 400: {
7594
+ message: string;
7595
+ issues?: string;
7596
+ };
7597
+ /**
7598
+ * Unauthorized
7599
+ */
7600
+ 401: ErrorResponse;
7601
+ /**
7602
+ * Forbidden
7603
+ */
7604
+ 403: ErrorResponse;
7605
+ /**
7606
+ * Not Found
7607
+ */
7608
+ 404: ErrorResponse;
7609
+ /**
7610
+ * Conflict
7611
+ */
7612
+ 409: ErrorResponse;
7613
+ /**
7614
+ * Internal server error
7615
+ */
7616
+ 500: ErrorResponse;
7617
+ /**
7618
+ * Service Unavailable
7619
+ */
7620
+ 503: ErrorResponse;
7621
+ };
7622
+ export type StreamTextError = StreamTextErrors[keyof StreamTextErrors];
7623
+ export type StreamTextResponses = {
7624
+ /**
7625
+ * Streams text chunks using Server-Sent Events
7626
+ */
7627
+ 200: StreamTextEvent;
7628
+ };
7629
+ export type StreamTextResponse = StreamTextResponses[keyof StreamTextResponses];
7630
+ export type GenerateImageData = {
7631
+ body: GenerateImageRequest;
7632
+ path?: never;
7633
+ query?: never;
7634
+ url: '/ai-gateway/generate-image';
7635
+ };
7636
+ export type GenerateImageErrors = {
7637
+ /**
7638
+ * Bad request - Invalid parameters or malformed JSON
7639
+ */
7640
+ 400: {
7641
+ message: string;
7642
+ issues?: string;
7643
+ };
7644
+ /**
7645
+ * Unauthorized
7646
+ */
7647
+ 401: ErrorResponse;
7648
+ /**
7649
+ * Forbidden
7650
+ */
7651
+ 403: ErrorResponse;
7652
+ /**
7653
+ * Not Found
7654
+ */
7655
+ 404: ErrorResponse;
7656
+ /**
7657
+ * Conflict
7658
+ */
7659
+ 409: ErrorResponse;
7660
+ /**
7661
+ * Internal server error
7662
+ */
7663
+ 500: ErrorResponse;
7664
+ /**
7665
+ * Service Unavailable
7666
+ */
7667
+ 503: ErrorResponse;
7668
+ };
7669
+ export type GenerateImageError = GenerateImageErrors[keyof GenerateImageErrors];
7670
+ export type GenerateImageResponses = {
7671
+ /**
7672
+ * Generates an image and returns base64 payload and usage
7673
+ */
7674
+ 200: GenerateImageResponse;
7675
+ };
7676
+ export type GenerateImageResponse2 = GenerateImageResponses[keyof GenerateImageResponses];
7234
7677
  export type DeleteCommentData = {
7235
7678
  body?: never;
7236
7679
  path: {