codemie-sdk 0.1.284 → 0.1.286

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.cjs CHANGED
@@ -198,11 +198,24 @@ var AssistantCreateParamsSchema = import_zod.z.object({
198
198
  description: import_zod.z.string().optional(),
199
199
  enabled: import_zod.z.boolean(),
200
200
  config: import_zod.z.object({
201
- command: import_zod.z.string(),
201
+ url: import_zod.z.string().optional(),
202
+ command: import_zod.z.string().optional(),
202
203
  args: import_zod.z.array(import_zod.z.string()).optional(),
203
204
  env: import_zod.z.record(import_zod.z.unknown()).optional(),
204
205
  auth_token: import_zod.z.string().optional()
205
- }).optional(),
206
+ }).optional().refine(
207
+ (config) => {
208
+ if (!config) {
209
+ return true;
210
+ }
211
+ const hasUrl = !!config.url;
212
+ const hasCommand = !!config.command;
213
+ return hasUrl !== hasCommand;
214
+ },
215
+ {
216
+ message: "Either 'url' or 'command' must be provided in config, but not both"
217
+ }
218
+ ),
206
219
  mcp_connect_url: import_zod.z.string().optional(),
207
220
  tools_tokens_size_limit: import_zod.z.number().optional(),
208
221
  command: import_zod.z.string().optional(),
@@ -242,10 +255,7 @@ var AssistantChatParamsSchema = import_zod.z.object({
242
255
  metadata: import_zod.z.record(import_zod.z.unknown()).optional(),
243
256
  mcp_server_single_usage: import_zod.z.boolean().optional(),
244
257
  version: import_zod.z.number().optional(),
245
- output_schema: import_zod.z.union([
246
- import_zod.z.custom((val) => val instanceof import_zod.z.ZodType),
247
- import_zod.z.record(import_zod.z.unknown())
248
- ]).optional()
258
+ output_schema: import_zod.z.union([import_zod.z.custom((val) => val instanceof import_zod.z.ZodType), import_zod.z.record(import_zod.z.unknown())]).optional()
249
259
  }).readonly();
250
260
  var AssistantVersionsListParamsSchema = import_zod.z.object({
251
261
  page: import_zod.z.number().optional(),
@@ -640,27 +650,56 @@ var DatasourceMapper = class _DatasourceMapper {
640
650
  /** Transforms API response into a client-friendly DataSource model, maintaining API-agnostic interface */
641
651
  static mapDatasourceResponse(response) {
642
652
  return omitUndefined({
653
+ ..._DatasourceMapper.mapDataSourceResponseCommonFields(response),
654
+ ...response.index_type === DataSourceType.JIRA && {
655
+ jira: response.jira
656
+ },
657
+ ...response.index_type === DataSourceType.CONFLUENCE && {
658
+ confluence: response.confluence
659
+ },
660
+ ...response.index_type === DataSourceType.GOOGLE && {
661
+ google_doc: response.google_doc_link
662
+ },
663
+ ...response.index_type === DataSourceType.CODE && {
664
+ code: _DatasourceMapper.extractCodeDataSourceResponseFields(
665
+ response
666
+ )
667
+ }
668
+ });
669
+ }
670
+ static mapDataSourceResponseCommonFields(response) {
671
+ return {
643
672
  id: response.id,
644
- project_name: response.project_name,
645
- name: response.repo_name,
673
+ created_by: response.created_by,
674
+ created_date: response.date,
646
675
  description: response.description,
647
- type: response.index_type,
648
676
  embeddings_model: response.embeddings_model,
649
- status: response.status,
650
- setting_id: response.setting_id,
651
- created_date: response.date,
652
- created_by: response.created_by,
653
- shared_with_project: response.project_space_visible,
654
- update_date: response.update_date,
655
677
  error_message: response.text,
656
- user_abilities: response.user_abilities,
657
- processing_info: response.processing_info ? _DatasourceMapper.mapDatasourceProcessingInfoResponse(response.processing_info) : void 0,
678
+ name: response.repo_name,
658
679
  processed_documents: response.processed_files,
680
+ processing_info: response.processing_info ? _DatasourceMapper.mapDatasourceProcessingInfoResponse(response.processing_info) : void 0,
681
+ project_name: response.project_name,
682
+ setting_id: response.setting_id,
683
+ shared_with_project: response.project_space_visible,
684
+ status: response.status,
659
685
  tokens_usage: response.tokens_usage,
660
- code: response.code,
661
- jira: response.jira,
662
- confluence: response.confluence,
663
- google_doc_link: response.google_doc_link
686
+ type: response.index_type,
687
+ update_date: response.update_date,
688
+ user_abilities: response.user_abilities
689
+ };
690
+ }
691
+ static extractCodeDataSourceResponseFields(response) {
692
+ return omitUndefined({
693
+ branch: response.branch,
694
+ docsGeneration: response.docs_generation || false,
695
+ embeddingsModel: response.embeddings_model,
696
+ filesFilter: response.files_filter,
697
+ indexType: response.index_type,
698
+ link: response.link,
699
+ projectSpaceVisible: response.project_space_visible || false,
700
+ prompt: response.prompt,
701
+ settingId: response.setting_id,
702
+ summarizationModel: response.summarization_model
664
703
  });
665
704
  }
666
705
  /** Converts processing metadata from API format to client model format with consistent property naming */
@@ -1309,7 +1348,12 @@ var WorkflowExecutionService = class {
1309
1348
  */
1310
1349
  async resume(executionId, propagateHeaders, headers) {
1311
1350
  const config = { params: { propagate_headers: propagateHeaders } };
1312
- return this.api.put(`/v1/workflows/${this.workflowId}/executions/${executionId}/resume`, {}, config, headers);
1351
+ return this.api.put(
1352
+ `/v1/workflows/${this.workflowId}/executions/${executionId}/resume`,
1353
+ {},
1354
+ config,
1355
+ headers
1356
+ );
1313
1357
  }
1314
1358
  };
1315
1359