@codemieai/cdk 0.1.296 → 0.1.298
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/cli/index.js +4 -21
- package/dist/index.js +3 -20
- package/package.json +2 -2
package/dist/cli/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import * as readline from 'readline';
|
|
|
13
13
|
|
|
14
14
|
// package.json
|
|
15
15
|
var package_default = {
|
|
16
|
-
version: "0.1.
|
|
16
|
+
version: "0.1.298"};
|
|
17
17
|
var appConfigSchema = z.object({
|
|
18
18
|
rootDir: z.string(),
|
|
19
19
|
codemieConfig: z.string(),
|
|
@@ -586,30 +586,13 @@ function convertMcpServers(servers) {
|
|
|
586
586
|
}
|
|
587
587
|
return validServers;
|
|
588
588
|
}
|
|
589
|
-
function hasValidCodeStructure(code) {
|
|
590
|
-
if (!code || typeof code !== "object") {
|
|
591
|
-
return false;
|
|
592
|
-
}
|
|
593
|
-
const c = code;
|
|
594
|
-
return typeof c.link === "string" && c.link.length > 0;
|
|
595
|
-
}
|
|
596
589
|
function assistantResponseToResource(assistant) {
|
|
597
590
|
const slug = assistant.slug || "";
|
|
598
591
|
const promptFileName = slug || assistant.name.toLowerCase().replaceAll(/\s+/g, "-");
|
|
599
592
|
const mcpServers = convertMcpServers(assistant.mcp_servers);
|
|
600
593
|
const nestedAssistants = assistant.nested_assistants;
|
|
601
|
-
const subAssistants = nestedAssistants?.map((nested) => nested.name);
|
|
602
|
-
const
|
|
603
|
-
let categories;
|
|
604
|
-
if (categoriesRaw && Array.isArray(categoriesRaw)) {
|
|
605
|
-
if (categoriesRaw.length === 0) {
|
|
606
|
-
categories = [];
|
|
607
|
-
} else if (typeof categoriesRaw[0] === "object" && categoriesRaw[0] !== null && "id" in categoriesRaw[0]) {
|
|
608
|
-
categories = categoriesRaw.map((cat) => cat.id);
|
|
609
|
-
} else {
|
|
610
|
-
categories = categoriesRaw;
|
|
611
|
-
}
|
|
612
|
-
}
|
|
594
|
+
const subAssistants = nestedAssistants?.map((nested) => nested.name).filter((name) => Boolean(name));
|
|
595
|
+
const categories = assistant.categories?.map((category) => category.id);
|
|
613
596
|
return {
|
|
614
597
|
name: assistant.name,
|
|
615
598
|
description: assistant.description || "",
|
|
@@ -632,7 +615,7 @@ function assistantResponseToResource(assistant) {
|
|
|
632
615
|
}
|
|
633
616
|
function convertCodeDatasource(datasource, base) {
|
|
634
617
|
const desc = datasource.description || "";
|
|
635
|
-
if (
|
|
618
|
+
if (datasource.code) {
|
|
636
619
|
return {
|
|
637
620
|
...base,
|
|
638
621
|
type: "code",
|
package/dist/index.js
CHANGED
|
@@ -1057,30 +1057,13 @@ function convertMcpServers(servers) {
|
|
|
1057
1057
|
}
|
|
1058
1058
|
return validServers;
|
|
1059
1059
|
}
|
|
1060
|
-
function hasValidCodeStructure(code) {
|
|
1061
|
-
if (!code || typeof code !== "object") {
|
|
1062
|
-
return false;
|
|
1063
|
-
}
|
|
1064
|
-
const c = code;
|
|
1065
|
-
return typeof c.link === "string" && c.link.length > 0;
|
|
1066
|
-
}
|
|
1067
1060
|
function assistantResponseToResource(assistant) {
|
|
1068
1061
|
const slug = assistant.slug || "";
|
|
1069
1062
|
const promptFileName = slug || assistant.name.toLowerCase().replaceAll(/\s+/g, "-");
|
|
1070
1063
|
const mcpServers = convertMcpServers(assistant.mcp_servers);
|
|
1071
1064
|
const nestedAssistants = assistant.nested_assistants;
|
|
1072
|
-
const subAssistants = nestedAssistants?.map((nested) => nested.name);
|
|
1073
|
-
const
|
|
1074
|
-
let categories;
|
|
1075
|
-
if (categoriesRaw && Array.isArray(categoriesRaw)) {
|
|
1076
|
-
if (categoriesRaw.length === 0) {
|
|
1077
|
-
categories = [];
|
|
1078
|
-
} else if (typeof categoriesRaw[0] === "object" && categoriesRaw[0] !== null && "id" in categoriesRaw[0]) {
|
|
1079
|
-
categories = categoriesRaw.map((cat) => cat.id);
|
|
1080
|
-
} else {
|
|
1081
|
-
categories = categoriesRaw;
|
|
1082
|
-
}
|
|
1083
|
-
}
|
|
1065
|
+
const subAssistants = nestedAssistants?.map((nested) => nested.name).filter((name) => Boolean(name));
|
|
1066
|
+
const categories = assistant.categories?.map((category) => category.id);
|
|
1084
1067
|
return {
|
|
1085
1068
|
name: assistant.name,
|
|
1086
1069
|
description: assistant.description || "",
|
|
@@ -1103,7 +1086,7 @@ function assistantResponseToResource(assistant) {
|
|
|
1103
1086
|
}
|
|
1104
1087
|
function convertCodeDatasource(datasource, base) {
|
|
1105
1088
|
const desc = datasource.description || "";
|
|
1106
|
-
if (
|
|
1089
|
+
if (datasource.code) {
|
|
1107
1090
|
return {
|
|
1108
1091
|
...base,
|
|
1109
1092
|
type: "code",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codemieai/cdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.298",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Infrastructure as Code solution for managing Codemie AI assistants, datasources, and workflows through declarative YAML configuration",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@commander-js/extra-typings": "^14.0.0",
|
|
44
|
-
"codemie-sdk": "
|
|
44
|
+
"codemie-sdk": "0.1.291",
|
|
45
45
|
"dotenv": "^17.2.3",
|
|
46
46
|
"p-limit": "^7.2.0",
|
|
47
47
|
"yaml": "^2.8.1",
|