@inkeep/agents-sdk 0.29.11 → 0.30.0
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 +37 -2
- package/dist/index.js +37 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -852,6 +852,7 @@ var Agent = class {
|
|
|
852
852
|
description: subAgent2.config.description || `Agent ${subAgent2.getName()}`,
|
|
853
853
|
prompt: subAgent2.getInstructions(),
|
|
854
854
|
models: subAgent2.config.models,
|
|
855
|
+
stopWhen: subAgent2.config.stopWhen,
|
|
855
856
|
canTransferTo: transfers.map((h) => h.getId()),
|
|
856
857
|
canDelegateTo: delegates.map((d) => {
|
|
857
858
|
if (typeof d === "object" && "externalAgent" in d) {
|
|
@@ -898,6 +899,36 @@ var Agent = class {
|
|
|
898
899
|
return comp;
|
|
899
900
|
})
|
|
900
901
|
} : void 0;
|
|
902
|
+
const agentToolsObject = {};
|
|
903
|
+
for (const subAgent2 of this.subAgents) {
|
|
904
|
+
const subAgentTools = subAgent2.getTools();
|
|
905
|
+
for (const [_toolName, toolInstance] of Object.entries(subAgentTools)) {
|
|
906
|
+
const toolId = toolInstance.getId();
|
|
907
|
+
if (toolInstance.constructor.name !== "FunctionTool") {
|
|
908
|
+
if (!agentToolsObject[toolId]) {
|
|
909
|
+
if ("config" in toolInstance && "serverUrl" in toolInstance.config) {
|
|
910
|
+
const mcpTool2 = toolInstance;
|
|
911
|
+
agentToolsObject[toolId] = {
|
|
912
|
+
id: toolId,
|
|
913
|
+
name: toolInstance.getName(),
|
|
914
|
+
description: null,
|
|
915
|
+
config: {
|
|
916
|
+
type: "mcp",
|
|
917
|
+
mcp: {
|
|
918
|
+
server: {
|
|
919
|
+
url: mcpTool2.config.serverUrl
|
|
920
|
+
},
|
|
921
|
+
transport: mcpTool2.config.transport,
|
|
922
|
+
activeTools: mcpTool2.config.activeTools
|
|
923
|
+
}
|
|
924
|
+
},
|
|
925
|
+
credentialReferenceId: null
|
|
926
|
+
};
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
}
|
|
901
932
|
return {
|
|
902
933
|
id: this.agentId,
|
|
903
934
|
name: this.agentName,
|
|
@@ -906,11 +937,14 @@ var Agent = class {
|
|
|
906
937
|
subAgents: subAgentsObject,
|
|
907
938
|
externalAgents: externalAgentsObject,
|
|
908
939
|
contextConfig: this.contextConfig?.toObject(),
|
|
940
|
+
// Include tools used by subAgents at agent level (MCP tools only)
|
|
941
|
+
...Object.keys(agentToolsObject).length > 0 && { tools: agentToolsObject },
|
|
942
|
+
// Include function tools at agent level
|
|
909
943
|
...Object.keys(functionToolsObject).length > 0 && { functionTools: functionToolsObject },
|
|
910
944
|
...Object.keys(functionsObject).length > 0 && { functions: functionsObject },
|
|
911
945
|
models: this.models,
|
|
912
|
-
statusUpdates: processedStatusUpdates,
|
|
913
946
|
stopWhen: this.stopWhen,
|
|
947
|
+
statusUpdates: processedStatusUpdates,
|
|
914
948
|
prompt: this.prompt,
|
|
915
949
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
916
950
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -2341,7 +2375,7 @@ var Project = class {
|
|
|
2341
2375
|
}
|
|
2342
2376
|
if ("credential" in mcpTool2.config && mcpTool2.config.credential) {
|
|
2343
2377
|
const credential2 = mcpTool2.config.credential;
|
|
2344
|
-
if (credential2
|
|
2378
|
+
if (credential2?.id && credential2.__type !== "credential-ref") {
|
|
2345
2379
|
if (!credentialReferencesObject[credential2.id]) {
|
|
2346
2380
|
credentialReferencesObject[credential2.id] = {
|
|
2347
2381
|
id: credential2.id,
|
|
@@ -2541,6 +2575,7 @@ var Project = class {
|
|
|
2541
2575
|
stopWhen: this.stopWhen,
|
|
2542
2576
|
agents: agentsObject,
|
|
2543
2577
|
tools: toolsObject,
|
|
2578
|
+
functionTools: Object.keys(functionToolsObject).length > 0 ? functionToolsObject : void 0,
|
|
2544
2579
|
functions: Object.keys(functionsObject).length > 0 ? functionsObject : void 0,
|
|
2545
2580
|
dataComponents: Object.keys(dataComponentsObject).length > 0 ? dataComponentsObject : void 0,
|
|
2546
2581
|
artifactComponents: Object.keys(artifactComponentsObject).length > 0 ? artifactComponentsObject : void 0,
|
package/dist/index.js
CHANGED
|
@@ -825,6 +825,7 @@ var Agent = class {
|
|
|
825
825
|
description: subAgent2.config.description || `Agent ${subAgent2.getName()}`,
|
|
826
826
|
prompt: subAgent2.getInstructions(),
|
|
827
827
|
models: subAgent2.config.models,
|
|
828
|
+
stopWhen: subAgent2.config.stopWhen,
|
|
828
829
|
canTransferTo: transfers.map((h) => h.getId()),
|
|
829
830
|
canDelegateTo: delegates.map((d) => {
|
|
830
831
|
if (typeof d === "object" && "externalAgent" in d) {
|
|
@@ -871,6 +872,36 @@ var Agent = class {
|
|
|
871
872
|
return comp;
|
|
872
873
|
})
|
|
873
874
|
} : void 0;
|
|
875
|
+
const agentToolsObject = {};
|
|
876
|
+
for (const subAgent2 of this.subAgents) {
|
|
877
|
+
const subAgentTools = subAgent2.getTools();
|
|
878
|
+
for (const [_toolName, toolInstance] of Object.entries(subAgentTools)) {
|
|
879
|
+
const toolId = toolInstance.getId();
|
|
880
|
+
if (toolInstance.constructor.name !== "FunctionTool") {
|
|
881
|
+
if (!agentToolsObject[toolId]) {
|
|
882
|
+
if ("config" in toolInstance && "serverUrl" in toolInstance.config) {
|
|
883
|
+
const mcpTool2 = toolInstance;
|
|
884
|
+
agentToolsObject[toolId] = {
|
|
885
|
+
id: toolId,
|
|
886
|
+
name: toolInstance.getName(),
|
|
887
|
+
description: null,
|
|
888
|
+
config: {
|
|
889
|
+
type: "mcp",
|
|
890
|
+
mcp: {
|
|
891
|
+
server: {
|
|
892
|
+
url: mcpTool2.config.serverUrl
|
|
893
|
+
},
|
|
894
|
+
transport: mcpTool2.config.transport,
|
|
895
|
+
activeTools: mcpTool2.config.activeTools
|
|
896
|
+
}
|
|
897
|
+
},
|
|
898
|
+
credentialReferenceId: null
|
|
899
|
+
};
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
}
|
|
874
905
|
return {
|
|
875
906
|
id: this.agentId,
|
|
876
907
|
name: this.agentName,
|
|
@@ -879,11 +910,14 @@ var Agent = class {
|
|
|
879
910
|
subAgents: subAgentsObject,
|
|
880
911
|
externalAgents: externalAgentsObject,
|
|
881
912
|
contextConfig: this.contextConfig?.toObject(),
|
|
913
|
+
// Include tools used by subAgents at agent level (MCP tools only)
|
|
914
|
+
...Object.keys(agentToolsObject).length > 0 && { tools: agentToolsObject },
|
|
915
|
+
// Include function tools at agent level
|
|
882
916
|
...Object.keys(functionToolsObject).length > 0 && { functionTools: functionToolsObject },
|
|
883
917
|
...Object.keys(functionsObject).length > 0 && { functions: functionsObject },
|
|
884
918
|
models: this.models,
|
|
885
|
-
statusUpdates: processedStatusUpdates,
|
|
886
919
|
stopWhen: this.stopWhen,
|
|
920
|
+
statusUpdates: processedStatusUpdates,
|
|
887
921
|
prompt: this.prompt,
|
|
888
922
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
889
923
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -2314,7 +2348,7 @@ var Project = class {
|
|
|
2314
2348
|
}
|
|
2315
2349
|
if ("credential" in mcpTool2.config && mcpTool2.config.credential) {
|
|
2316
2350
|
const credential2 = mcpTool2.config.credential;
|
|
2317
|
-
if (credential2
|
|
2351
|
+
if (credential2?.id && credential2.__type !== "credential-ref") {
|
|
2318
2352
|
if (!credentialReferencesObject[credential2.id]) {
|
|
2319
2353
|
credentialReferencesObject[credential2.id] = {
|
|
2320
2354
|
id: credential2.id,
|
|
@@ -2514,6 +2548,7 @@ var Project = class {
|
|
|
2514
2548
|
stopWhen: this.stopWhen,
|
|
2515
2549
|
agents: agentsObject,
|
|
2516
2550
|
tools: toolsObject,
|
|
2551
|
+
functionTools: Object.keys(functionToolsObject).length > 0 ? functionToolsObject : void 0,
|
|
2517
2552
|
functions: Object.keys(functionsObject).length > 0 ? functionsObject : void 0,
|
|
2518
2553
|
dataComponents: Object.keys(dataComponentsObject).length > 0 ? dataComponentsObject : void 0,
|
|
2519
2554
|
artifactComponents: Object.keys(artifactComponentsObject).length > 0 ? artifactComponentsObject : void 0,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkeep/agents-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "Agents SDK for building and managing agents in the Inkeep Agent Framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"nanoid": "^5.1.5",
|
|
13
13
|
"typescript": "^5.3.3",
|
|
14
14
|
"zod": "^4.1.11",
|
|
15
|
-
"@inkeep/agents-core": "^0.
|
|
15
|
+
"@inkeep/agents-core": "^0.30.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/js-yaml": "^4.0.9",
|