codemie-sdk 0.1.227 → 0.1.229

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.
package/dist/index.d.cts CHANGED
@@ -188,6 +188,7 @@ interface Assistant extends AssistantBase {
188
188
  user_abilities?: unknown[];
189
189
  mcp_servers: MCPServerDetails[];
190
190
  assistant_ids: string[];
191
+ version_count?: number;
191
192
  }
192
193
  interface AssistantRequestBase extends AssistantBase {
193
194
  system_prompt: string;
@@ -223,6 +224,22 @@ interface BaseModelResponse {
223
224
  thoughts?: Record<string, unknown>[];
224
225
  task_id?: string;
225
226
  }
227
+ interface AssistantVersion {
228
+ version_number: number;
229
+ created_date: string;
230
+ created_by?: BaseUser;
231
+ change_notes?: string;
232
+ description?: string;
233
+ system_prompt: string;
234
+ llm_model_type?: string;
235
+ temperature?: number;
236
+ top_p?: number;
237
+ context: Context[];
238
+ toolkits: ToolKitDetails[];
239
+ mcp_servers: MCPServerDetails[];
240
+ assistant_ids: string[];
241
+ [key: string]: unknown;
242
+ }
226
243
 
227
244
  declare const AssistantListParamsSchema: z.ZodReadonly<z.ZodObject<{
228
245
  minimal_response: z.ZodDefault<z.ZodBoolean>;
@@ -382,14 +399,13 @@ declare const AssistantCreateParamsSchema: z.ZodReadonly<z.ZodObject<{
382
399
  assistant_ids: z.ZodArray<z.ZodString, "many">;
383
400
  }, "strip", z.ZodTypeAny, {
384
401
  project: string;
385
- name: string;
386
402
  description: string;
387
403
  system_prompt: string;
404
+ llm_model_type: string;
388
405
  context: {
389
406
  name: string;
390
407
  context_type: "knowledge_base" | "code";
391
408
  }[];
392
- llm_model_type: string;
393
409
  toolkits: {
394
410
  toolkit: string;
395
411
  tools: {
@@ -404,7 +420,6 @@ declare const AssistantCreateParamsSchema: z.ZodReadonly<z.ZodObject<{
404
420
  is_external: boolean;
405
421
  settings?: any;
406
422
  }[];
407
- conversation_starters: string[];
408
423
  mcp_servers: {
409
424
  name: string;
410
425
  enabled: boolean;
@@ -423,23 +438,24 @@ declare const AssistantCreateParamsSchema: z.ZodReadonly<z.ZodObject<{
423
438
  mcp_connect_auth_token?: any;
424
439
  }[];
425
440
  assistant_ids: string[];
441
+ name: string;
442
+ conversation_starters: string[];
443
+ temperature?: number | undefined;
444
+ top_p?: number | undefined;
426
445
  icon_url?: string | undefined;
427
446
  shared?: boolean | undefined;
428
447
  is_react?: boolean | undefined;
429
448
  is_global?: boolean | undefined;
430
449
  slug?: string | undefined;
431
- temperature?: number | undefined;
432
- top_p?: number | undefined;
433
450
  }, {
434
451
  project: string;
435
- name: string;
436
452
  description: string;
437
453
  system_prompt: string;
454
+ llm_model_type: string;
438
455
  context: {
439
456
  name: string;
440
457
  context_type: "knowledge_base" | "code";
441
458
  }[];
442
- llm_model_type: string;
443
459
  toolkits: {
444
460
  toolkit: string;
445
461
  tools: {
@@ -454,7 +470,6 @@ declare const AssistantCreateParamsSchema: z.ZodReadonly<z.ZodObject<{
454
470
  is_external: boolean;
455
471
  settings?: any;
456
472
  }[];
457
- conversation_starters: string[];
458
473
  mcp_servers: {
459
474
  name: string;
460
475
  enabled: boolean;
@@ -473,13 +488,15 @@ declare const AssistantCreateParamsSchema: z.ZodReadonly<z.ZodObject<{
473
488
  mcp_connect_auth_token?: any;
474
489
  }[];
475
490
  assistant_ids: string[];
491
+ name: string;
492
+ conversation_starters: string[];
493
+ temperature?: number | undefined;
494
+ top_p?: number | undefined;
476
495
  icon_url?: string | undefined;
477
496
  shared?: boolean | undefined;
478
497
  is_react?: boolean | undefined;
479
498
  is_global?: boolean | undefined;
480
499
  slug?: string | undefined;
481
- temperature?: number | undefined;
482
- top_p?: number | undefined;
483
500
  }>>;
484
501
  type AssistantCreateParams = z.infer<typeof AssistantCreateParamsSchema>;
485
502
  declare const AssistantUpdateParamsSchema: z.ZodReadonly<z.ZodObject<{
@@ -620,14 +637,13 @@ declare const AssistantUpdateParamsSchema: z.ZodReadonly<z.ZodObject<{
620
637
  assistant_ids: z.ZodArray<z.ZodString, "many">;
621
638
  }, "strip", z.ZodTypeAny, {
622
639
  project: string;
623
- name: string;
624
640
  description: string;
625
641
  system_prompt: string;
642
+ llm_model_type: string;
626
643
  context: {
627
644
  name: string;
628
645
  context_type: "knowledge_base" | "code";
629
646
  }[];
630
- llm_model_type: string;
631
647
  toolkits: {
632
648
  toolkit: string;
633
649
  tools: {
@@ -642,7 +658,6 @@ declare const AssistantUpdateParamsSchema: z.ZodReadonly<z.ZodObject<{
642
658
  is_external: boolean;
643
659
  settings?: any;
644
660
  }[];
645
- conversation_starters: string[];
646
661
  mcp_servers: {
647
662
  name: string;
648
663
  enabled: boolean;
@@ -661,23 +676,24 @@ declare const AssistantUpdateParamsSchema: z.ZodReadonly<z.ZodObject<{
661
676
  mcp_connect_auth_token?: any;
662
677
  }[];
663
678
  assistant_ids: string[];
679
+ name: string;
680
+ conversation_starters: string[];
681
+ temperature?: number | undefined;
682
+ top_p?: number | undefined;
664
683
  icon_url?: string | undefined;
665
684
  shared?: boolean | undefined;
666
685
  is_react?: boolean | undefined;
667
686
  is_global?: boolean | undefined;
668
687
  slug?: string | undefined;
669
- temperature?: number | undefined;
670
- top_p?: number | undefined;
671
688
  }, {
672
689
  project: string;
673
- name: string;
674
690
  description: string;
675
691
  system_prompt: string;
692
+ llm_model_type: string;
676
693
  context: {
677
694
  name: string;
678
695
  context_type: "knowledge_base" | "code";
679
696
  }[];
680
- llm_model_type: string;
681
697
  toolkits: {
682
698
  toolkit: string;
683
699
  tools: {
@@ -692,7 +708,6 @@ declare const AssistantUpdateParamsSchema: z.ZodReadonly<z.ZodObject<{
692
708
  is_external: boolean;
693
709
  settings?: any;
694
710
  }[];
695
- conversation_starters: string[];
696
711
  mcp_servers: {
697
712
  name: string;
698
713
  enabled: boolean;
@@ -711,13 +726,15 @@ declare const AssistantUpdateParamsSchema: z.ZodReadonly<z.ZodObject<{
711
726
  mcp_connect_auth_token?: any;
712
727
  }[];
713
728
  assistant_ids: string[];
729
+ name: string;
730
+ conversation_starters: string[];
731
+ temperature?: number | undefined;
732
+ top_p?: number | undefined;
714
733
  icon_url?: string | undefined;
715
734
  shared?: boolean | undefined;
716
735
  is_react?: boolean | undefined;
717
736
  is_global?: boolean | undefined;
718
737
  slug?: string | undefined;
719
- temperature?: number | undefined;
720
- top_p?: number | undefined;
721
738
  }>>;
722
739
  type AssistantUpdateParams = z.infer<typeof AssistantUpdateParamsSchema>;
723
740
  declare const AssistantChatParamsSchema: z.ZodReadonly<z.ZodObject<{
@@ -743,6 +760,7 @@ declare const AssistantChatParamsSchema: z.ZodReadonly<z.ZodObject<{
743
760
  background_task: z.ZodOptional<z.ZodBoolean>;
744
761
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
745
762
  mcp_server_single_usage: z.ZodOptional<z.ZodBoolean>;
763
+ version: z.ZodOptional<z.ZodNumber>;
746
764
  output_schema: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
747
765
  }, "strip", z.ZodTypeAny, {
748
766
  text: string;
@@ -761,6 +779,7 @@ declare const AssistantChatParamsSchema: z.ZodReadonly<z.ZodObject<{
761
779
  background_task?: boolean | undefined;
762
780
  metadata?: Record<string, unknown> | undefined;
763
781
  mcp_server_single_usage?: boolean | undefined;
782
+ version?: number | undefined;
764
783
  output_schema?: any;
765
784
  }, {
766
785
  text: string;
@@ -779,9 +798,21 @@ declare const AssistantChatParamsSchema: z.ZodReadonly<z.ZodObject<{
779
798
  background_task?: boolean | undefined;
780
799
  metadata?: Record<string, unknown> | undefined;
781
800
  mcp_server_single_usage?: boolean | undefined;
801
+ version?: number | undefined;
782
802
  output_schema?: any;
783
803
  }>>;
784
804
  type AssistantChatParams = z.infer<typeof AssistantChatParamsSchema>;
805
+ declare const AssistantVersionsListParamsSchema: z.ZodReadonly<z.ZodObject<{
806
+ page: z.ZodOptional<z.ZodNumber>;
807
+ per_page: z.ZodOptional<z.ZodNumber>;
808
+ }, "strip", z.ZodTypeAny, {
809
+ page?: number | undefined;
810
+ per_page?: number | undefined;
811
+ }, {
812
+ page?: number | undefined;
813
+ per_page?: number | undefined;
814
+ }>>;
815
+ type AssistantVersionsListParams = Partial<z.infer<typeof AssistantVersionsListParamsSchema>>;
785
816
 
786
817
  declare class AssistantService {
787
818
  private api;
@@ -822,10 +853,30 @@ declare class AssistantService {
822
853
  * Get prebuilt assistant by slug.
823
854
  */
824
855
  getPrebuiltBySlug(slug: string): Promise<Assistant>;
856
+ /**
857
+ * List assistant versions.
858
+ */
859
+ listVersions(assistantId: string, _params?: AssistantVersionsListParams): Promise<AssistantVersion[]>;
860
+ /**
861
+ * Get a specific assistant version by number.
862
+ */
863
+ getVersion(assistantId: string, versionNumber: number): Promise<AssistantVersion>;
825
864
  /**
826
865
  * Send a chat request to an assistant.
827
866
  */
828
867
  chat(assistantId: string, _params: AssistantChatParams): Promise<BaseModelResponse>;
868
+ /**
869
+ * Compare two assistant versions.
870
+ */
871
+ compareVersions(assistantId: string, v1: number, v2: number): Promise<Record<string, unknown>>;
872
+ /**
873
+ * Rollback assistant to a specific version. Creates a new version mirroring the target.
874
+ */
875
+ rollbackToVersion(assistantId: string, versionNumber: number): Promise<AnyJson>;
876
+ /**
877
+ * Send a chat request to a specific assistant version.
878
+ */
879
+ chatWithVersion(assistantId: string, versionNumber: number, _params: AssistantChatParams): Promise<BaseModelResponse>;
829
880
  }
830
881
 
831
882
  interface Conversation {
@@ -2200,4 +2251,4 @@ declare class NotFoundError extends ApiError {
2200
2251
  constructor(resourceType: string, resourceId: string);
2201
2252
  }
2202
2253
 
2203
- export { type AboutUser, type AboutUserResponse, type AnyJson, ApiError, type Assistant, type AssistantBase, type AssistantChatParams, AssistantChatParamsSchema, type AssistantCreateParams, AssistantCreateParamsSchema, type AssistantDataItem, type AssistantDetailsData, type AssistantListParams, AssistantListParamsSchema, type AssistantRequestBase, type AssistantUpdateParams, AssistantUpdateParamsSchema, type BackgroundTaskEntity, BackgroundTaskStatus, type BackgroundTaskStatusType, type BaseCodeParams, type BaseConfluenceParams, type BaseDataSourceCreateDto, type BaseDataSourceCreateParams, type BaseDataSourceUpdateDto, type BaseDataSourceUpdateParams, type BaseFileParams, type BaseGoogleParams, type BaseJiraParams, type BaseModelApiResponse, type BaseModelResponse, type BaseUser, type ChatMessage, ChatRole, type Code, type CodeDataSourceCreateDto, type CodeDataSourceCreateParams, CodeDataSourceType, type CodeDataSourceTypeType, type CodeDataSourceUpdateDto, type CodeDataSourceUpdateParams, CodeMieClient, type CodeMieClientConfig, CodeMieError, type Confluence, type ConfluenceDataSourceCreateDto, type ConfluenceDataSourceCreateParams, type ConfluenceDataSourceUpdateDto, type ConfluenceDataSourceUpdateParams, type Context, type ContextItem, ContextType, type Conversation, type ConversationCreateParams, ConversationCreateParamsSchema, type ConversationCreateRequest, type ConversationDetails, type ConversationDetailsData, type CostConfig, CredentialTypes, type CredentialTypesType, type CredentialValues, type DataSource, type DataSourceCreateDto, type DataSourceCreateParams, type DataSourceListParams, type DataSourceProcessingInfo, type DataSourceProcessingInfoResponse, type DataSourceResponse, DataSourceStatus, type DataSourceStatusType, DataSourceType, type DataSourceTypeType, type DataSourceUpdateDto, type DataSourceUpdateParams, ExecutionStatus, type ExecutionStatusType, type File, type FileDataSourceCreateDto, type FileDataSourceCreateParams, type FileDataSourceUpdateDto, type FileDataSourceUpdateParams, type Files, type Google, type GoogleDataSourceCreateDto, type GoogleDataSourceCreateParams, type GoogleDataSourceUpdateDto, type GoogleDataSourceUpdateParams, type HistoryItem, type HistoryMark, type Integration, type IntegrationCreateParams, IntegrationCreateParamsSchema, type IntegrationGetByAliasParams, IntegrationGetByAliasParamsSchema, type IntegrationGetParams, IntegrationGetParamsSchema, type IntegrationListParams, IntegrationListParamsSchema, IntegrationType, type IntegrationTypeType, type IntegrationUpdateParams, IntegrationUpdateParamsSchema, type Jira, type JiraDataSourceCreateDto, type JiraDataSourceCreateParams, type JiraDataSourceUpdateDto, type JiraDataSourceUpdateParams, type LLMFeatures, type LLMModel, LLMProvider, type LLMProviderType, type MCPServerConfig, type MCPServerDetails, type Mark, NotFoundError, type Operator, type OtherDataSourceCreateParams, type OtherDataSourceUpdateParams, type PaginatedResponse, type PaginationParams, type SortOrder, type SystemPromptHistory, type TaskUser, type Thought, type TokensUsage, type ToolDetails, type ToolItem, type ToolKitDetails, type UserData, type Workflow, type WorkflowCreateParams, WorkflowCreateParamsSchema, type WorkflowExecution, type WorkflowExecutionCreateParams, WorkflowExecutionCreateParamsSchema, type WorkflowExecutionListParams, WorkflowExecutionListParamsSchema, type WorkflowExecutionResponse, type WorkflowExecutionState, type WorkflowExecutionStateListParams, WorkflowExecutionStateListParamsSchema, type WorkflowExecutionStateOutput, type WorkflowExecutionStateThought, type WorkflowListParams, WorkflowListParamsSchema, WorkflowMode, type WorkflowModeType, type WorkflowResponse, type WorkflowUpdateParams, WorkflowUpdateParamsSchema };
2254
+ export { type AboutUser, type AboutUserResponse, type AnyJson, ApiError, type Assistant, type AssistantBase, type AssistantChatParams, AssistantChatParamsSchema, type AssistantCreateParams, AssistantCreateParamsSchema, type AssistantDataItem, type AssistantDetailsData, type AssistantListParams, AssistantListParamsSchema, type AssistantRequestBase, type AssistantUpdateParams, AssistantUpdateParamsSchema, type AssistantVersion, type AssistantVersionsListParams, AssistantVersionsListParamsSchema, type BackgroundTaskEntity, BackgroundTaskStatus, type BackgroundTaskStatusType, type BaseCodeParams, type BaseConfluenceParams, type BaseDataSourceCreateDto, type BaseDataSourceCreateParams, type BaseDataSourceUpdateDto, type BaseDataSourceUpdateParams, type BaseFileParams, type BaseGoogleParams, type BaseJiraParams, type BaseModelApiResponse, type BaseModelResponse, type BaseUser, type ChatMessage, ChatRole, type Code, type CodeDataSourceCreateDto, type CodeDataSourceCreateParams, CodeDataSourceType, type CodeDataSourceTypeType, type CodeDataSourceUpdateDto, type CodeDataSourceUpdateParams, CodeMieClient, type CodeMieClientConfig, CodeMieError, type Confluence, type ConfluenceDataSourceCreateDto, type ConfluenceDataSourceCreateParams, type ConfluenceDataSourceUpdateDto, type ConfluenceDataSourceUpdateParams, type Context, type ContextItem, ContextType, type Conversation, type ConversationCreateParams, ConversationCreateParamsSchema, type ConversationCreateRequest, type ConversationDetails, type ConversationDetailsData, type CostConfig, CredentialTypes, type CredentialTypesType, type CredentialValues, type DataSource, type DataSourceCreateDto, type DataSourceCreateParams, type DataSourceListParams, type DataSourceProcessingInfo, type DataSourceProcessingInfoResponse, type DataSourceResponse, DataSourceStatus, type DataSourceStatusType, DataSourceType, type DataSourceTypeType, type DataSourceUpdateDto, type DataSourceUpdateParams, ExecutionStatus, type ExecutionStatusType, type File, type FileDataSourceCreateDto, type FileDataSourceCreateParams, type FileDataSourceUpdateDto, type FileDataSourceUpdateParams, type Files, type Google, type GoogleDataSourceCreateDto, type GoogleDataSourceCreateParams, type GoogleDataSourceUpdateDto, type GoogleDataSourceUpdateParams, type HistoryItem, type HistoryMark, type Integration, type IntegrationCreateParams, IntegrationCreateParamsSchema, type IntegrationGetByAliasParams, IntegrationGetByAliasParamsSchema, type IntegrationGetParams, IntegrationGetParamsSchema, type IntegrationListParams, IntegrationListParamsSchema, IntegrationType, type IntegrationTypeType, type IntegrationUpdateParams, IntegrationUpdateParamsSchema, type Jira, type JiraDataSourceCreateDto, type JiraDataSourceCreateParams, type JiraDataSourceUpdateDto, type JiraDataSourceUpdateParams, type LLMFeatures, type LLMModel, LLMProvider, type LLMProviderType, type MCPServerConfig, type MCPServerDetails, type Mark, NotFoundError, type Operator, type OtherDataSourceCreateParams, type OtherDataSourceUpdateParams, type PaginatedResponse, type PaginationParams, type SortOrder, type SystemPromptHistory, type TaskUser, type Thought, type TokensUsage, type ToolDetails, type ToolItem, type ToolKitDetails, type UserData, type Workflow, type WorkflowCreateParams, WorkflowCreateParamsSchema, type WorkflowExecution, type WorkflowExecutionCreateParams, WorkflowExecutionCreateParamsSchema, type WorkflowExecutionListParams, WorkflowExecutionListParamsSchema, type WorkflowExecutionResponse, type WorkflowExecutionState, type WorkflowExecutionStateListParams, WorkflowExecutionStateListParamsSchema, type WorkflowExecutionStateOutput, type WorkflowExecutionStateThought, type WorkflowListParams, WorkflowListParamsSchema, WorkflowMode, type WorkflowModeType, type WorkflowResponse, type WorkflowUpdateParams, WorkflowUpdateParamsSchema };
package/dist/index.d.ts CHANGED
@@ -188,6 +188,7 @@ interface Assistant extends AssistantBase {
188
188
  user_abilities?: unknown[];
189
189
  mcp_servers: MCPServerDetails[];
190
190
  assistant_ids: string[];
191
+ version_count?: number;
191
192
  }
192
193
  interface AssistantRequestBase extends AssistantBase {
193
194
  system_prompt: string;
@@ -223,6 +224,22 @@ interface BaseModelResponse {
223
224
  thoughts?: Record<string, unknown>[];
224
225
  task_id?: string;
225
226
  }
227
+ interface AssistantVersion {
228
+ version_number: number;
229
+ created_date: string;
230
+ created_by?: BaseUser;
231
+ change_notes?: string;
232
+ description?: string;
233
+ system_prompt: string;
234
+ llm_model_type?: string;
235
+ temperature?: number;
236
+ top_p?: number;
237
+ context: Context[];
238
+ toolkits: ToolKitDetails[];
239
+ mcp_servers: MCPServerDetails[];
240
+ assistant_ids: string[];
241
+ [key: string]: unknown;
242
+ }
226
243
 
227
244
  declare const AssistantListParamsSchema: z.ZodReadonly<z.ZodObject<{
228
245
  minimal_response: z.ZodDefault<z.ZodBoolean>;
@@ -382,14 +399,13 @@ declare const AssistantCreateParamsSchema: z.ZodReadonly<z.ZodObject<{
382
399
  assistant_ids: z.ZodArray<z.ZodString, "many">;
383
400
  }, "strip", z.ZodTypeAny, {
384
401
  project: string;
385
- name: string;
386
402
  description: string;
387
403
  system_prompt: string;
404
+ llm_model_type: string;
388
405
  context: {
389
406
  name: string;
390
407
  context_type: "knowledge_base" | "code";
391
408
  }[];
392
- llm_model_type: string;
393
409
  toolkits: {
394
410
  toolkit: string;
395
411
  tools: {
@@ -404,7 +420,6 @@ declare const AssistantCreateParamsSchema: z.ZodReadonly<z.ZodObject<{
404
420
  is_external: boolean;
405
421
  settings?: any;
406
422
  }[];
407
- conversation_starters: string[];
408
423
  mcp_servers: {
409
424
  name: string;
410
425
  enabled: boolean;
@@ -423,23 +438,24 @@ declare const AssistantCreateParamsSchema: z.ZodReadonly<z.ZodObject<{
423
438
  mcp_connect_auth_token?: any;
424
439
  }[];
425
440
  assistant_ids: string[];
441
+ name: string;
442
+ conversation_starters: string[];
443
+ temperature?: number | undefined;
444
+ top_p?: number | undefined;
426
445
  icon_url?: string | undefined;
427
446
  shared?: boolean | undefined;
428
447
  is_react?: boolean | undefined;
429
448
  is_global?: boolean | undefined;
430
449
  slug?: string | undefined;
431
- temperature?: number | undefined;
432
- top_p?: number | undefined;
433
450
  }, {
434
451
  project: string;
435
- name: string;
436
452
  description: string;
437
453
  system_prompt: string;
454
+ llm_model_type: string;
438
455
  context: {
439
456
  name: string;
440
457
  context_type: "knowledge_base" | "code";
441
458
  }[];
442
- llm_model_type: string;
443
459
  toolkits: {
444
460
  toolkit: string;
445
461
  tools: {
@@ -454,7 +470,6 @@ declare const AssistantCreateParamsSchema: z.ZodReadonly<z.ZodObject<{
454
470
  is_external: boolean;
455
471
  settings?: any;
456
472
  }[];
457
- conversation_starters: string[];
458
473
  mcp_servers: {
459
474
  name: string;
460
475
  enabled: boolean;
@@ -473,13 +488,15 @@ declare const AssistantCreateParamsSchema: z.ZodReadonly<z.ZodObject<{
473
488
  mcp_connect_auth_token?: any;
474
489
  }[];
475
490
  assistant_ids: string[];
491
+ name: string;
492
+ conversation_starters: string[];
493
+ temperature?: number | undefined;
494
+ top_p?: number | undefined;
476
495
  icon_url?: string | undefined;
477
496
  shared?: boolean | undefined;
478
497
  is_react?: boolean | undefined;
479
498
  is_global?: boolean | undefined;
480
499
  slug?: string | undefined;
481
- temperature?: number | undefined;
482
- top_p?: number | undefined;
483
500
  }>>;
484
501
  type AssistantCreateParams = z.infer<typeof AssistantCreateParamsSchema>;
485
502
  declare const AssistantUpdateParamsSchema: z.ZodReadonly<z.ZodObject<{
@@ -620,14 +637,13 @@ declare const AssistantUpdateParamsSchema: z.ZodReadonly<z.ZodObject<{
620
637
  assistant_ids: z.ZodArray<z.ZodString, "many">;
621
638
  }, "strip", z.ZodTypeAny, {
622
639
  project: string;
623
- name: string;
624
640
  description: string;
625
641
  system_prompt: string;
642
+ llm_model_type: string;
626
643
  context: {
627
644
  name: string;
628
645
  context_type: "knowledge_base" | "code";
629
646
  }[];
630
- llm_model_type: string;
631
647
  toolkits: {
632
648
  toolkit: string;
633
649
  tools: {
@@ -642,7 +658,6 @@ declare const AssistantUpdateParamsSchema: z.ZodReadonly<z.ZodObject<{
642
658
  is_external: boolean;
643
659
  settings?: any;
644
660
  }[];
645
- conversation_starters: string[];
646
661
  mcp_servers: {
647
662
  name: string;
648
663
  enabled: boolean;
@@ -661,23 +676,24 @@ declare const AssistantUpdateParamsSchema: z.ZodReadonly<z.ZodObject<{
661
676
  mcp_connect_auth_token?: any;
662
677
  }[];
663
678
  assistant_ids: string[];
679
+ name: string;
680
+ conversation_starters: string[];
681
+ temperature?: number | undefined;
682
+ top_p?: number | undefined;
664
683
  icon_url?: string | undefined;
665
684
  shared?: boolean | undefined;
666
685
  is_react?: boolean | undefined;
667
686
  is_global?: boolean | undefined;
668
687
  slug?: string | undefined;
669
- temperature?: number | undefined;
670
- top_p?: number | undefined;
671
688
  }, {
672
689
  project: string;
673
- name: string;
674
690
  description: string;
675
691
  system_prompt: string;
692
+ llm_model_type: string;
676
693
  context: {
677
694
  name: string;
678
695
  context_type: "knowledge_base" | "code";
679
696
  }[];
680
- llm_model_type: string;
681
697
  toolkits: {
682
698
  toolkit: string;
683
699
  tools: {
@@ -692,7 +708,6 @@ declare const AssistantUpdateParamsSchema: z.ZodReadonly<z.ZodObject<{
692
708
  is_external: boolean;
693
709
  settings?: any;
694
710
  }[];
695
- conversation_starters: string[];
696
711
  mcp_servers: {
697
712
  name: string;
698
713
  enabled: boolean;
@@ -711,13 +726,15 @@ declare const AssistantUpdateParamsSchema: z.ZodReadonly<z.ZodObject<{
711
726
  mcp_connect_auth_token?: any;
712
727
  }[];
713
728
  assistant_ids: string[];
729
+ name: string;
730
+ conversation_starters: string[];
731
+ temperature?: number | undefined;
732
+ top_p?: number | undefined;
714
733
  icon_url?: string | undefined;
715
734
  shared?: boolean | undefined;
716
735
  is_react?: boolean | undefined;
717
736
  is_global?: boolean | undefined;
718
737
  slug?: string | undefined;
719
- temperature?: number | undefined;
720
- top_p?: number | undefined;
721
738
  }>>;
722
739
  type AssistantUpdateParams = z.infer<typeof AssistantUpdateParamsSchema>;
723
740
  declare const AssistantChatParamsSchema: z.ZodReadonly<z.ZodObject<{
@@ -743,6 +760,7 @@ declare const AssistantChatParamsSchema: z.ZodReadonly<z.ZodObject<{
743
760
  background_task: z.ZodOptional<z.ZodBoolean>;
744
761
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
745
762
  mcp_server_single_usage: z.ZodOptional<z.ZodBoolean>;
763
+ version: z.ZodOptional<z.ZodNumber>;
746
764
  output_schema: z.ZodOptional<z.ZodUnion<[z.ZodType<any, z.ZodTypeDef, any>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
747
765
  }, "strip", z.ZodTypeAny, {
748
766
  text: string;
@@ -761,6 +779,7 @@ declare const AssistantChatParamsSchema: z.ZodReadonly<z.ZodObject<{
761
779
  background_task?: boolean | undefined;
762
780
  metadata?: Record<string, unknown> | undefined;
763
781
  mcp_server_single_usage?: boolean | undefined;
782
+ version?: number | undefined;
764
783
  output_schema?: any;
765
784
  }, {
766
785
  text: string;
@@ -779,9 +798,21 @@ declare const AssistantChatParamsSchema: z.ZodReadonly<z.ZodObject<{
779
798
  background_task?: boolean | undefined;
780
799
  metadata?: Record<string, unknown> | undefined;
781
800
  mcp_server_single_usage?: boolean | undefined;
801
+ version?: number | undefined;
782
802
  output_schema?: any;
783
803
  }>>;
784
804
  type AssistantChatParams = z.infer<typeof AssistantChatParamsSchema>;
805
+ declare const AssistantVersionsListParamsSchema: z.ZodReadonly<z.ZodObject<{
806
+ page: z.ZodOptional<z.ZodNumber>;
807
+ per_page: z.ZodOptional<z.ZodNumber>;
808
+ }, "strip", z.ZodTypeAny, {
809
+ page?: number | undefined;
810
+ per_page?: number | undefined;
811
+ }, {
812
+ page?: number | undefined;
813
+ per_page?: number | undefined;
814
+ }>>;
815
+ type AssistantVersionsListParams = Partial<z.infer<typeof AssistantVersionsListParamsSchema>>;
785
816
 
786
817
  declare class AssistantService {
787
818
  private api;
@@ -822,10 +853,30 @@ declare class AssistantService {
822
853
  * Get prebuilt assistant by slug.
823
854
  */
824
855
  getPrebuiltBySlug(slug: string): Promise<Assistant>;
856
+ /**
857
+ * List assistant versions.
858
+ */
859
+ listVersions(assistantId: string, _params?: AssistantVersionsListParams): Promise<AssistantVersion[]>;
860
+ /**
861
+ * Get a specific assistant version by number.
862
+ */
863
+ getVersion(assistantId: string, versionNumber: number): Promise<AssistantVersion>;
825
864
  /**
826
865
  * Send a chat request to an assistant.
827
866
  */
828
867
  chat(assistantId: string, _params: AssistantChatParams): Promise<BaseModelResponse>;
868
+ /**
869
+ * Compare two assistant versions.
870
+ */
871
+ compareVersions(assistantId: string, v1: number, v2: number): Promise<Record<string, unknown>>;
872
+ /**
873
+ * Rollback assistant to a specific version. Creates a new version mirroring the target.
874
+ */
875
+ rollbackToVersion(assistantId: string, versionNumber: number): Promise<AnyJson>;
876
+ /**
877
+ * Send a chat request to a specific assistant version.
878
+ */
879
+ chatWithVersion(assistantId: string, versionNumber: number, _params: AssistantChatParams): Promise<BaseModelResponse>;
829
880
  }
830
881
 
831
882
  interface Conversation {
@@ -2200,4 +2251,4 @@ declare class NotFoundError extends ApiError {
2200
2251
  constructor(resourceType: string, resourceId: string);
2201
2252
  }
2202
2253
 
2203
- export { type AboutUser, type AboutUserResponse, type AnyJson, ApiError, type Assistant, type AssistantBase, type AssistantChatParams, AssistantChatParamsSchema, type AssistantCreateParams, AssistantCreateParamsSchema, type AssistantDataItem, type AssistantDetailsData, type AssistantListParams, AssistantListParamsSchema, type AssistantRequestBase, type AssistantUpdateParams, AssistantUpdateParamsSchema, type BackgroundTaskEntity, BackgroundTaskStatus, type BackgroundTaskStatusType, type BaseCodeParams, type BaseConfluenceParams, type BaseDataSourceCreateDto, type BaseDataSourceCreateParams, type BaseDataSourceUpdateDto, type BaseDataSourceUpdateParams, type BaseFileParams, type BaseGoogleParams, type BaseJiraParams, type BaseModelApiResponse, type BaseModelResponse, type BaseUser, type ChatMessage, ChatRole, type Code, type CodeDataSourceCreateDto, type CodeDataSourceCreateParams, CodeDataSourceType, type CodeDataSourceTypeType, type CodeDataSourceUpdateDto, type CodeDataSourceUpdateParams, CodeMieClient, type CodeMieClientConfig, CodeMieError, type Confluence, type ConfluenceDataSourceCreateDto, type ConfluenceDataSourceCreateParams, type ConfluenceDataSourceUpdateDto, type ConfluenceDataSourceUpdateParams, type Context, type ContextItem, ContextType, type Conversation, type ConversationCreateParams, ConversationCreateParamsSchema, type ConversationCreateRequest, type ConversationDetails, type ConversationDetailsData, type CostConfig, CredentialTypes, type CredentialTypesType, type CredentialValues, type DataSource, type DataSourceCreateDto, type DataSourceCreateParams, type DataSourceListParams, type DataSourceProcessingInfo, type DataSourceProcessingInfoResponse, type DataSourceResponse, DataSourceStatus, type DataSourceStatusType, DataSourceType, type DataSourceTypeType, type DataSourceUpdateDto, type DataSourceUpdateParams, ExecutionStatus, type ExecutionStatusType, type File, type FileDataSourceCreateDto, type FileDataSourceCreateParams, type FileDataSourceUpdateDto, type FileDataSourceUpdateParams, type Files, type Google, type GoogleDataSourceCreateDto, type GoogleDataSourceCreateParams, type GoogleDataSourceUpdateDto, type GoogleDataSourceUpdateParams, type HistoryItem, type HistoryMark, type Integration, type IntegrationCreateParams, IntegrationCreateParamsSchema, type IntegrationGetByAliasParams, IntegrationGetByAliasParamsSchema, type IntegrationGetParams, IntegrationGetParamsSchema, type IntegrationListParams, IntegrationListParamsSchema, IntegrationType, type IntegrationTypeType, type IntegrationUpdateParams, IntegrationUpdateParamsSchema, type Jira, type JiraDataSourceCreateDto, type JiraDataSourceCreateParams, type JiraDataSourceUpdateDto, type JiraDataSourceUpdateParams, type LLMFeatures, type LLMModel, LLMProvider, type LLMProviderType, type MCPServerConfig, type MCPServerDetails, type Mark, NotFoundError, type Operator, type OtherDataSourceCreateParams, type OtherDataSourceUpdateParams, type PaginatedResponse, type PaginationParams, type SortOrder, type SystemPromptHistory, type TaskUser, type Thought, type TokensUsage, type ToolDetails, type ToolItem, type ToolKitDetails, type UserData, type Workflow, type WorkflowCreateParams, WorkflowCreateParamsSchema, type WorkflowExecution, type WorkflowExecutionCreateParams, WorkflowExecutionCreateParamsSchema, type WorkflowExecutionListParams, WorkflowExecutionListParamsSchema, type WorkflowExecutionResponse, type WorkflowExecutionState, type WorkflowExecutionStateListParams, WorkflowExecutionStateListParamsSchema, type WorkflowExecutionStateOutput, type WorkflowExecutionStateThought, type WorkflowListParams, WorkflowListParamsSchema, WorkflowMode, type WorkflowModeType, type WorkflowResponse, type WorkflowUpdateParams, WorkflowUpdateParamsSchema };
2254
+ export { type AboutUser, type AboutUserResponse, type AnyJson, ApiError, type Assistant, type AssistantBase, type AssistantChatParams, AssistantChatParamsSchema, type AssistantCreateParams, AssistantCreateParamsSchema, type AssistantDataItem, type AssistantDetailsData, type AssistantListParams, AssistantListParamsSchema, type AssistantRequestBase, type AssistantUpdateParams, AssistantUpdateParamsSchema, type AssistantVersion, type AssistantVersionsListParams, AssistantVersionsListParamsSchema, type BackgroundTaskEntity, BackgroundTaskStatus, type BackgroundTaskStatusType, type BaseCodeParams, type BaseConfluenceParams, type BaseDataSourceCreateDto, type BaseDataSourceCreateParams, type BaseDataSourceUpdateDto, type BaseDataSourceUpdateParams, type BaseFileParams, type BaseGoogleParams, type BaseJiraParams, type BaseModelApiResponse, type BaseModelResponse, type BaseUser, type ChatMessage, ChatRole, type Code, type CodeDataSourceCreateDto, type CodeDataSourceCreateParams, CodeDataSourceType, type CodeDataSourceTypeType, type CodeDataSourceUpdateDto, type CodeDataSourceUpdateParams, CodeMieClient, type CodeMieClientConfig, CodeMieError, type Confluence, type ConfluenceDataSourceCreateDto, type ConfluenceDataSourceCreateParams, type ConfluenceDataSourceUpdateDto, type ConfluenceDataSourceUpdateParams, type Context, type ContextItem, ContextType, type Conversation, type ConversationCreateParams, ConversationCreateParamsSchema, type ConversationCreateRequest, type ConversationDetails, type ConversationDetailsData, type CostConfig, CredentialTypes, type CredentialTypesType, type CredentialValues, type DataSource, type DataSourceCreateDto, type DataSourceCreateParams, type DataSourceListParams, type DataSourceProcessingInfo, type DataSourceProcessingInfoResponse, type DataSourceResponse, DataSourceStatus, type DataSourceStatusType, DataSourceType, type DataSourceTypeType, type DataSourceUpdateDto, type DataSourceUpdateParams, ExecutionStatus, type ExecutionStatusType, type File, type FileDataSourceCreateDto, type FileDataSourceCreateParams, type FileDataSourceUpdateDto, type FileDataSourceUpdateParams, type Files, type Google, type GoogleDataSourceCreateDto, type GoogleDataSourceCreateParams, type GoogleDataSourceUpdateDto, type GoogleDataSourceUpdateParams, type HistoryItem, type HistoryMark, type Integration, type IntegrationCreateParams, IntegrationCreateParamsSchema, type IntegrationGetByAliasParams, IntegrationGetByAliasParamsSchema, type IntegrationGetParams, IntegrationGetParamsSchema, type IntegrationListParams, IntegrationListParamsSchema, IntegrationType, type IntegrationTypeType, type IntegrationUpdateParams, IntegrationUpdateParamsSchema, type Jira, type JiraDataSourceCreateDto, type JiraDataSourceCreateParams, type JiraDataSourceUpdateDto, type JiraDataSourceUpdateParams, type LLMFeatures, type LLMModel, LLMProvider, type LLMProviderType, type MCPServerConfig, type MCPServerDetails, type Mark, NotFoundError, type Operator, type OtherDataSourceCreateParams, type OtherDataSourceUpdateParams, type PaginatedResponse, type PaginationParams, type SortOrder, type SystemPromptHistory, type TaskUser, type Thought, type TokensUsage, type ToolDetails, type ToolItem, type ToolKitDetails, type UserData, type Workflow, type WorkflowCreateParams, WorkflowCreateParamsSchema, type WorkflowExecution, type WorkflowExecutionCreateParams, WorkflowExecutionCreateParamsSchema, type WorkflowExecutionListParams, WorkflowExecutionListParamsSchema, type WorkflowExecutionResponse, type WorkflowExecutionState, type WorkflowExecutionStateListParams, WorkflowExecutionStateListParamsSchema, type WorkflowExecutionStateOutput, type WorkflowExecutionStateThought, type WorkflowListParams, WorkflowListParamsSchema, WorkflowMode, type WorkflowModeType, type WorkflowResponse, type WorkflowUpdateParams, WorkflowUpdateParamsSchema };
package/dist/index.js CHANGED
@@ -164,11 +164,16 @@ var AssistantChatParamsSchema = z.object({
164
164
  background_task: z.boolean().optional(),
165
165
  metadata: z.record(z.unknown()).optional(),
166
166
  mcp_server_single_usage: z.boolean().optional(),
167
+ version: z.number().optional(),
167
168
  output_schema: z.union([
168
169
  z.custom((val) => val instanceof z.ZodType),
169
170
  z.record(z.unknown())
170
171
  ]).optional()
171
172
  }).readonly();
173
+ var AssistantVersionsListParamsSchema = z.object({
174
+ page: z.number().optional(),
175
+ per_page: z.number().optional()
176
+ }).readonly();
172
177
 
173
178
  // src/utils/http.ts
174
179
  import { Agent as Agent2 } from "https";
@@ -340,6 +345,37 @@ var AssistantService = class {
340
345
  async getPrebuiltBySlug(slug) {
341
346
  return this.api.get(`/v1/assistants/prebuilt/${slug}`);
342
347
  }
348
+ /**
349
+ * List assistant versions.
350
+ */
351
+ async listVersions(assistantId, _params = {}) {
352
+ const params = AssistantVersionsListParamsSchema.parse(_params);
353
+ const response = await this.api.get(
354
+ `/v1/assistants/${assistantId}/versions`,
355
+ params
356
+ );
357
+ if (Array.isArray(response)) {
358
+ return response;
359
+ }
360
+ if (response && "data" in response && Array.isArray(response.data)) {
361
+ return response.data;
362
+ }
363
+ if (response && "versions" in response && Array.isArray(response.versions)) {
364
+ return response.versions;
365
+ }
366
+ if (response && "items" in response && Array.isArray(response.items)) {
367
+ return response.items;
368
+ }
369
+ return [];
370
+ }
371
+ /**
372
+ * Get a specific assistant version by number.
373
+ */
374
+ async getVersion(assistantId, versionNumber) {
375
+ return this.api.get(
376
+ `/v1/assistants/${assistantId}/versions/${versionNumber}`
377
+ );
378
+ }
343
379
  /**
344
380
  * Send a chat request to an assistant.
345
381
  */
@@ -366,6 +402,49 @@ var AssistantService = class {
366
402
  }
367
403
  return mapped;
368
404
  }
405
+ /**
406
+ * Compare two assistant versions.
407
+ */
408
+ async compareVersions(assistantId, v1, v2) {
409
+ return this.api.get(
410
+ `/v1/assistants/${assistantId}/versions/${v1}/compare/${v2}`
411
+ );
412
+ }
413
+ /**
414
+ * Rollback assistant to a specific version. Creates a new version mirroring the target.
415
+ */
416
+ async rollbackToVersion(assistantId, versionNumber) {
417
+ return this.api.post(
418
+ `/v1/assistants/${assistantId}/versions/${versionNumber}/rollback`,
419
+ {}
420
+ );
421
+ }
422
+ /**
423
+ * Send a chat request to a specific assistant version.
424
+ */
425
+ async chatWithVersion(assistantId, versionNumber, _params) {
426
+ let zodSchema = void 0;
427
+ let params = { ..._params };
428
+ if (params.output_schema && params.output_schema instanceof z2.ZodType) {
429
+ zodSchema = params.output_schema;
430
+ params.output_schema = zodToJsonSchema(zodSchema, {
431
+ definitions: {}
432
+ });
433
+ }
434
+ params = AssistantChatParamsSchema.parse(params);
435
+ const response = await this.api.post(
436
+ `/v1/assistants/${assistantId}/model`,
437
+ { ...params, version: versionNumber },
438
+ {
439
+ responseType: params.stream ? "stream" : void 0
440
+ }
441
+ );
442
+ const mapped = AssistantMapper.mapBaseModelApiResponse(response);
443
+ if (!params.stream && zodSchema && mapped.generated) {
444
+ mapped.generated = zodSchema.parse(mapped.generated);
445
+ }
446
+ return mapped;
447
+ }
369
448
  };
370
449
 
371
450
  // src/schemas/conversation.ts
@@ -1342,6 +1421,7 @@ export {
1342
1421
  AssistantCreateParamsSchema,
1343
1422
  AssistantListParamsSchema,
1344
1423
  AssistantUpdateParamsSchema,
1424
+ AssistantVersionsListParamsSchema,
1345
1425
  BackgroundTaskStatus,
1346
1426
  ChatRole,
1347
1427
  CodeDataSourceType,