@codemieai/cdk 0.1.440 → 0.1.445

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.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { Integration, BaseDataSourceCreateParams, BaseCodeParams, DataSourceType, BaseConfluenceParams, BaseJiraParams, BaseGoogleParams, BaseFileParams, AssistantCreateParams, ToolKitDetails, ToolDetails, MCPServerDetails, WorkflowCreateParams, CodeMieClient } from 'codemie-sdk';
2
+ import { AssistantCreateParams, ToolKitDetails, ToolDetails, Integration, MCPServerDetails, Assistant, BaseDataSourceCreateParams, BaseCodeParams, DataSourceType, BaseConfluenceParams, BaseJiraParams, BaseGoogleParams, BaseFileParams, WorkflowCreateParams, CodeMieClient } from 'codemie-sdk';
3
3
 
4
4
  declare const appConfigSchema: z.ZodObject<{
5
5
  rootDir: z.ZodString;
@@ -9,6 +9,9 @@ declare const appConfigSchema: z.ZodObject<{
9
9
  }, z.core.$strip>;
10
10
  type AppConfig = z.infer<typeof appConfigSchema>;
11
11
 
12
+ type AssistantWithSkills = Assistant & {
13
+ skill_ids?: string[];
14
+ };
12
15
  interface CodemieConfig {
13
16
  version: string;
14
17
  project: {
@@ -39,6 +42,7 @@ interface CodemieConfig {
39
42
  assistants?: AssistantResource[];
40
43
  datasources?: DatasourceResource[];
41
44
  workflows?: WorkflowResource[];
45
+ skills?: SkillResource[];
42
46
  };
43
47
  }
44
48
  type IntegrationDefinition = Integration;
@@ -113,6 +117,7 @@ interface AssistantResource extends Partial<Omit<AssistantCreateParams, 'project
113
117
  sub_assistants?: string[];
114
118
  datasource_names?: string[];
115
119
  categories?: string[];
120
+ skills?: string[];
116
121
  }
117
122
  /**
118
123
  * Base datasource configuration (IaC-specific fields only)
@@ -168,7 +173,7 @@ interface FileDatasourceResource extends BaseDatasourceConfig, Partial<BaseFileP
168
173
  * Other/generic datasource configuration (for any other SDK datasource types)
169
174
  */
170
175
  interface OtherDatasourceResource extends BaseDatasourceConfig {
171
- type?: typeof DataSourceType.BEDROCK | typeof DataSourceType.CHUNK_SUMMARY | typeof DataSourceType.JSON | typeof DataSourceType.PROVIDER | typeof DataSourceType.SUMMARY;
176
+ type?: typeof DataSourceType.BEDROCK | typeof DataSourceType.JSON | typeof DataSourceType.PROVIDER;
172
177
  }
173
178
  /**
174
179
  * Discriminated union of all datasource types
@@ -176,6 +181,16 @@ interface OtherDatasourceResource extends BaseDatasourceConfig {
176
181
  * New datasource types in SDK will be automatically supported
177
182
  */
178
183
  type DatasourceResource = CodeDatasourceResource | ConfluenceDatasourceResource | JiraDatasourceResource | GoogleDatasourceResource | FileDatasourceResource | OtherDatasourceResource;
184
+ /**
185
+ * Skill resource configuration (IaC layer)
186
+ */
187
+ interface SkillResource {
188
+ name: string;
189
+ description: string;
190
+ file: string;
191
+ categories?: string[];
192
+ visibility?: string;
193
+ }
179
194
  /**
180
195
  * Base Workflow configuration (IaC-specific fields only)
181
196
  */
@@ -208,6 +223,7 @@ interface StateFile {
208
223
  assistants: Record<string, AssistantState>;
209
224
  datasources: Record<string, DatasourceState>;
210
225
  workflows: Record<string, WorkflowState>;
226
+ skills: Record<string, SkillState>;
211
227
  };
212
228
  }
213
229
  interface AssistantState {
@@ -227,6 +243,12 @@ interface WorkflowState {
227
243
  workflowYamlChecksum: string;
228
244
  configChecksum: string;
229
245
  }
246
+ interface SkillState {
247
+ id: string;
248
+ lastDeployed: string;
249
+ contentChecksum: string;
250
+ configChecksum: string;
251
+ }
230
252
  interface WorkflowYaml {
231
253
  assistants: WorkflowAssistantReference[];
232
254
  states: WorkflowStateDefinition[];
@@ -250,7 +272,7 @@ interface WorkflowStateDefinition {
250
272
  }
251
273
  interface Change {
252
274
  type: 'create' | 'update' | 'no-change' | 'delete';
253
- resourceType: 'assistant' | 'datasource' | 'workflow';
275
+ resourceType: 'assistant' | 'datasource' | 'workflow' | 'skill';
254
276
  name: string;
255
277
  details?: string;
256
278
  }
@@ -266,6 +288,10 @@ declare class CodemieConfigLoader {
266
288
  * Load assistant prompt file
267
289
  */
268
290
  loadPrompt(promptPath: string): string;
291
+ /**
292
+ * Load skill content file (.skill.md)
293
+ */
294
+ loadSkillContent(contentPath: string): string;
269
295
  /**
270
296
  * Load assistant configuration file
271
297
  */
@@ -421,23 +447,36 @@ declare class StateManager {
421
447
  deleteWorkflowState(name: string): void;
422
448
  /**
423
449
  * Get all managed resources (for cleanup/destroy)
424
- * Returns: { assistants: [name1, name2], datasources: [name1], workflows: [name1] }
450
+ * Returns: { assistants: [name1, name2], datasources: [name1], workflows: [name1], skills: [name1] }
425
451
  */
426
452
  getAllManagedResources(): {
427
453
  assistants: string[];
428
454
  datasources: string[];
429
455
  workflows: string[];
456
+ skills: string[];
430
457
  };
431
458
  /**
432
459
  * Check if a resource is managed by IaC (exists in state.json)
433
- * @param type Resource type ('assistant', 'datasource', 'workflow')
460
+ * @param type Resource type ('assistant', 'datasource', 'workflow', 'skill')
434
461
  * @param name Resource name
435
462
  */
436
- isManagedResource(type: 'assistant' | 'datasource' | 'workflow', name: string): boolean;
463
+ isManagedResource(type: 'assistant' | 'datasource' | 'workflow' | 'skill', name: string): boolean;
437
464
  /**
438
465
  * Get ID by name for a specific resource type
439
466
  */
440
- getIdByName(type: 'assistant' | 'datasource' | 'workflow', name: string): string | undefined;
467
+ getIdByName(type: 'assistant' | 'datasource' | 'workflow' | 'skill', name: string): string | undefined;
468
+ /**
469
+ * Update skill state (keyed by NAME)
470
+ */
471
+ updateSkillState(name: string, id: string, content: string, skillResource: SkillResource): void;
472
+ /**
473
+ * Get skill state by NAME
474
+ */
475
+ getSkillState(name: string): SkillState | undefined;
476
+ /**
477
+ * Delete skill state by NAME
478
+ */
479
+ deleteSkillState(name: string): void;
441
480
  }
442
481
 
443
482
  /**
@@ -456,9 +495,10 @@ interface CleanupResult {
456
495
  assistants: string[];
457
496
  datasources: string[];
458
497
  workflows: string[];
498
+ skills: string[];
459
499
  };
460
500
  errors: Array<{
461
- type: 'assistant' | 'datasource' | 'workflow';
501
+ type: 'assistant' | 'datasource' | 'workflow' | 'skill';
462
502
  name: string;
463
503
  error: string;
464
504
  }>;
@@ -486,6 +526,7 @@ declare class CleanupManager {
486
526
  assistants: string[];
487
527
  datasources: string[];
488
528
  workflows: string[];
529
+ skills: string[];
489
530
  };
490
531
  /**
491
532
  * Delete orphaned resources from platform
@@ -496,6 +537,7 @@ declare class CleanupManager {
496
537
  assistants: string[];
497
538
  datasources: string[];
498
539
  workflows: string[];
540
+ skills?: string[];
499
541
  }): Promise<CleanupResult>;
500
542
  /**
501
543
  * Get summary of orphaned resources
@@ -504,6 +546,7 @@ declare class CleanupManager {
504
546
  assistants: string[];
505
547
  datasources: string[];
506
548
  workflows: string[];
549
+ skills?: string[];
507
550
  }): string;
508
551
  }
509
552
 
@@ -538,6 +581,11 @@ interface DeploymentStats {
538
581
  * Extracted from main() for better maintainability
539
582
  */
540
583
  declare function deployAssistants(config: ReturnType<CodemieConfigLoader['loadConfig']>, client: Awaited<ReturnType<typeof createClient>>, loader: CodemieConfigLoader, stateManager: StateManager): Promise<DeploymentStats>;
584
+ /**
585
+ * Deploy all skills from configuration
586
+ * Skills must be deployed before assistants so skill_ids can be resolved
587
+ */
588
+ declare function deploySkills(config: ReturnType<CodemieConfigLoader['loadConfig']>, client: Awaited<ReturnType<typeof createClient>>, loader: CodemieConfigLoader, stateManager: StateManager): Promise<DeploymentStats>;
541
589
  /**
542
590
  * Deploy all datasources from configuration
543
591
  * Extracted from main() for better maintainability
@@ -576,9 +624,20 @@ declare function backupResources(options: {
576
624
  appConfig: AppConfig;
577
625
  }): Promise<void>;
578
626
 
627
+ type ImportResourceType = 'assistant' | 'datasource' | 'workflow' | 'skill';
628
+ interface ImportOptions {
629
+ appConfig: AppConfig;
630
+ resourceType: ImportResourceType;
631
+ slug: string;
632
+ }
633
+ /**
634
+ * Import a single resource from the CodeMie platform into the local IaC configuration.
635
+ */
636
+ declare function importResource(options: ImportOptions): Promise<void>;
637
+
579
638
  declare function destroyResources(options: {
580
639
  appConfig: AppConfig;
581
640
  force?: boolean;
582
641
  }): Promise<void>;
583
642
 
584
- export { type AssistantConfig, type AssistantResource, type AssistantState, type Change, CleanupManager, type CodeDatasourceResource, type CodemieConfig, CodemieConfigLoader, type ConfluenceDatasourceResource, type DatasourceResource, type DatasourceState, type FileDatasourceResource, type GoogleDatasourceResource, type IaCMcpServer, type IaCTool, type IaCToolkit, type ImportedResource, type IntegrationDefinition, type IntegrationRef, type IntegrationReference, type JiraDatasourceResource, LogLevel, type OtherDatasourceResource, type StateFile, StateManager, type ToolDefinition, type WorkflowAssistantReference, type WorkflowResource, type WorkflowState, type WorkflowStateDefinition, type WorkflowYaml, backupResources, createClient, deployAssistants, deployDatasources, deployResources, deployWorkflows, destroyResources, logger, previewChanges, validateConfig };
643
+ export { type AssistantConfig, type AssistantResource, type AssistantState, type AssistantWithSkills, type Change, CleanupManager, type CodeDatasourceResource, type CodemieConfig, CodemieConfigLoader, type ConfluenceDatasourceResource, type DatasourceResource, type DatasourceState, type FileDatasourceResource, type GoogleDatasourceResource, type IaCMcpServer, type IaCTool, type IaCToolkit, type ImportOptions, type ImportResourceType, type ImportedResource, type IntegrationDefinition, type IntegrationRef, type IntegrationReference, type JiraDatasourceResource, LogLevel, type OtherDatasourceResource, type SkillResource, type SkillState, type StateFile, StateManager, type ToolDefinition, type WorkflowAssistantReference, type WorkflowResource, type WorkflowState, type WorkflowStateDefinition, type WorkflowYaml, backupResources, createClient, deployAssistants, deployDatasources, deployResources, deploySkills, deployWorkflows, destroyResources, importResource, logger, previewChanges, validateConfig };