@inkeep/agents-cli 0.23.2 → 0.23.3
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.js +35 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -236064,6 +236064,7 @@ __export(variable_name_registry_exports, {
|
|
|
236064
236064
|
});
|
|
236065
236065
|
function collectAllEntities(projectData) {
|
|
236066
236066
|
const entities = [];
|
|
236067
|
+
entities.push({ id: projectData.id, type: "project", data: projectData });
|
|
236067
236068
|
if (projectData.agents) {
|
|
236068
236069
|
for (const [agentId, agentData] of Object.entries(projectData.agents)) {
|
|
236069
236070
|
entities.push({ id: agentId, type: "agent", data: agentData });
|
|
@@ -236164,8 +236165,9 @@ var init_variable_name_registry = __esm({
|
|
|
236164
236165
|
"use strict";
|
|
236165
236166
|
init_esm_shims();
|
|
236166
236167
|
DEFAULT_NAMING_CONVENTIONS = {
|
|
236167
|
-
|
|
236168
|
+
projectSuffix: "Project",
|
|
236168
236169
|
agentSuffix: "Agent",
|
|
236170
|
+
subAgentSuffix: "SubAgent",
|
|
236169
236171
|
toolSuffix: null,
|
|
236170
236172
|
// Usually no suffix needed
|
|
236171
236173
|
dataComponentSuffix: null,
|
|
@@ -236181,6 +236183,7 @@ var init_variable_name_registry = __esm({
|
|
|
236181
236183
|
conflicts;
|
|
236182
236184
|
constructor(conventions = DEFAULT_NAMING_CONVENTIONS) {
|
|
236183
236185
|
this.registry = {
|
|
236186
|
+
projects: /* @__PURE__ */ new Map(),
|
|
236184
236187
|
agents: /* @__PURE__ */ new Map(),
|
|
236185
236188
|
subAgents: /* @__PURE__ */ new Map(),
|
|
236186
236189
|
tools: /* @__PURE__ */ new Map(),
|
|
@@ -236318,6 +236321,8 @@ var init_variable_name_registry = __esm({
|
|
|
236318
236321
|
*/
|
|
236319
236322
|
getSuffixForType(entityType) {
|
|
236320
236323
|
switch (entityType) {
|
|
236324
|
+
case "project":
|
|
236325
|
+
return this.conventions.projectSuffix;
|
|
236321
236326
|
case "agent":
|
|
236322
236327
|
return this.conventions.agentSuffix;
|
|
236323
236328
|
case "subAgent":
|
|
@@ -236343,6 +236348,8 @@ var init_variable_name_registry = __esm({
|
|
|
236343
236348
|
*/
|
|
236344
236349
|
getRegistryMap(entityType) {
|
|
236345
236350
|
switch (entityType) {
|
|
236351
|
+
case "project":
|
|
236352
|
+
return this.registry.projects;
|
|
236346
236353
|
case "agent":
|
|
236347
236354
|
return this.registry.agents;
|
|
236348
236355
|
case "subAgent":
|
|
@@ -237101,6 +237108,7 @@ Generate ONLY the JSON response, no markdown or explanations.`;
|
|
|
237101
237108
|
function formatVariableMappings(registry2, allEntities) {
|
|
237102
237109
|
let result = "";
|
|
237103
237110
|
const byType = {
|
|
237111
|
+
project: [],
|
|
237104
237112
|
agent: [],
|
|
237105
237113
|
subAgent: [],
|
|
237106
237114
|
tool: [],
|
|
@@ -237133,12 +237141,15 @@ ${type.toUpperCase()}S:
|
|
|
237133
237141
|
function formatFileNameMappings(fileNameMappings, allEntities) {
|
|
237134
237142
|
let result = "";
|
|
237135
237143
|
const byType = {
|
|
237144
|
+
project: [],
|
|
237136
237145
|
agent: [],
|
|
237146
|
+
subAgent: [],
|
|
237137
237147
|
tool: [],
|
|
237138
237148
|
dataComponent: [],
|
|
237139
237149
|
artifactComponent: [],
|
|
237140
237150
|
statusComponent: [],
|
|
237141
|
-
credential: []
|
|
237151
|
+
credential: [],
|
|
237152
|
+
environment: []
|
|
237142
237153
|
};
|
|
237143
237154
|
for (const entity of allEntities) {
|
|
237144
237155
|
const fileName = fileNameMappings.get(entity.id);
|
|
@@ -237171,6 +237182,8 @@ ${type.toUpperCase()}S:
|
|
|
237171
237182
|
}
|
|
237172
237183
|
function getRegistryMap(registry2, entityType) {
|
|
237173
237184
|
switch (entityType) {
|
|
237185
|
+
case "project":
|
|
237186
|
+
return registry2.projects;
|
|
237174
237187
|
case "agent":
|
|
237175
237188
|
return registry2.agents;
|
|
237176
237189
|
case "subAgent":
|
|
@@ -237185,6 +237198,8 @@ function getRegistryMap(registry2, entityType) {
|
|
|
237185
237198
|
return registry2.statusComponents;
|
|
237186
237199
|
case "credential":
|
|
237187
237200
|
return registry2.credentials;
|
|
237201
|
+
case "environment":
|
|
237202
|
+
return registry2.environments;
|
|
237188
237203
|
default:
|
|
237189
237204
|
throw new Error(`Unknown entity type: ${entityType}`);
|
|
237190
237205
|
}
|
|
@@ -237392,7 +237407,8 @@ function extractDataForFile(fileInfo, projectData) {
|
|
|
237392
237407
|
case "agent": {
|
|
237393
237408
|
const agentId = fileInfo.entities.find((e2) => e2.entityType === "agent")?.id;
|
|
237394
237409
|
if (agentId && projectData.agents) {
|
|
237395
|
-
|
|
237410
|
+
const agentData = projectData.agents[agentId];
|
|
237411
|
+
return ensureUniqueSubAgentKeys(agentData);
|
|
237396
237412
|
}
|
|
237397
237413
|
return {};
|
|
237398
237414
|
}
|
|
@@ -237578,6 +237594,22 @@ function extractDataForFile(fileInfo, projectData) {
|
|
|
237578
237594
|
return {};
|
|
237579
237595
|
}
|
|
237580
237596
|
}
|
|
237597
|
+
function ensureUniqueSubAgentKeys(agentData) {
|
|
237598
|
+
if (!agentData?.subAgents) {
|
|
237599
|
+
return agentData;
|
|
237600
|
+
}
|
|
237601
|
+
const transformedData = { ...agentData };
|
|
237602
|
+
const transformedSubAgents = {};
|
|
237603
|
+
for (const [subAgentKey, subAgentData] of Object.entries(agentData.subAgents)) {
|
|
237604
|
+
let uniqueKey = subAgentKey;
|
|
237605
|
+
if (subAgentKey === agentData.id) {
|
|
237606
|
+
uniqueKey = `${subAgentKey}_sub`;
|
|
237607
|
+
}
|
|
237608
|
+
transformedSubAgents[uniqueKey] = subAgentData;
|
|
237609
|
+
}
|
|
237610
|
+
transformedData.subAgents = transformedSubAgents;
|
|
237611
|
+
return transformedData;
|
|
237612
|
+
}
|
|
237581
237613
|
var init_unified_generator = __esm({
|
|
237582
237614
|
"src/codegen/unified-generator.ts"() {
|
|
237583
237615
|
"use strict";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-cli",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.3",
|
|
4
4
|
"description": "Inkeep CLI tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"recast": "^0.23.0",
|
|
53
53
|
"ts-morph": "^26.0.0",
|
|
54
54
|
"tsx": "^4.20.5",
|
|
55
|
-
"@inkeep/agents-core": "^0.23.
|
|
56
|
-
"@inkeep/agents-sdk": "^0.23.
|
|
55
|
+
"@inkeep/agents-core": "^0.23.3",
|
|
56
|
+
"@inkeep/agents-sdk": "^0.23.3"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/degit": "^2.8.6",
|