@agentforge/core 0.11.3 → 0.11.4
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 +11 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +11 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1029,6 +1029,7 @@ var ToolRegistry = class {
|
|
|
1029
1029
|
* @param name - The tool name
|
|
1030
1030
|
* @param tool - The new tool definition
|
|
1031
1031
|
* @returns True if updated, false if the tool didn't exist
|
|
1032
|
+
* @throws Error if the tool's metadata.name doesn't match the name parameter
|
|
1032
1033
|
*
|
|
1033
1034
|
* @example
|
|
1034
1035
|
* ```ts
|
|
@@ -1039,6 +1040,11 @@ var ToolRegistry = class {
|
|
|
1039
1040
|
if (!this.tools.has(name)) {
|
|
1040
1041
|
return false;
|
|
1041
1042
|
}
|
|
1043
|
+
if (tool.metadata.name !== name) {
|
|
1044
|
+
throw new Error(
|
|
1045
|
+
`Cannot update tool: metadata.name "${tool.metadata.name}" does not match registry key "${name}". To rename a tool, remove it and register it again with the new name.`
|
|
1046
|
+
);
|
|
1047
|
+
}
|
|
1042
1048
|
this.tools.set(name, tool);
|
|
1043
1049
|
this.emit("tool:updated" /* TOOL_UPDATED */, { name, tool });
|
|
1044
1050
|
return true;
|
|
@@ -2127,6 +2133,11 @@ function createStateAnnotation(config) {
|
|
|
2127
2133
|
reducer: channelConfig.reducer,
|
|
2128
2134
|
default: channelConfig.default
|
|
2129
2135
|
});
|
|
2136
|
+
} else if (channelConfig.default) {
|
|
2137
|
+
stateDefinition[key] = (0, import_langgraph.Annotation)({
|
|
2138
|
+
reducer: (_left, right) => right,
|
|
2139
|
+
default: channelConfig.default
|
|
2140
|
+
});
|
|
2130
2141
|
} else {
|
|
2131
2142
|
stateDefinition[key] = (0, import_langgraph.Annotation)();
|
|
2132
2143
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -1294,6 +1294,7 @@ declare class ToolRegistry {
|
|
|
1294
1294
|
* @param name - The tool name
|
|
1295
1295
|
* @param tool - The new tool definition
|
|
1296
1296
|
* @returns True if updated, false if the tool didn't exist
|
|
1297
|
+
* @throws Error if the tool's metadata.name doesn't match the name parameter
|
|
1297
1298
|
*
|
|
1298
1299
|
* @example
|
|
1299
1300
|
* ```ts
|
package/dist/index.d.ts
CHANGED
|
@@ -1294,6 +1294,7 @@ declare class ToolRegistry {
|
|
|
1294
1294
|
* @param name - The tool name
|
|
1295
1295
|
* @param tool - The new tool definition
|
|
1296
1296
|
* @returns True if updated, false if the tool didn't exist
|
|
1297
|
+
* @throws Error if the tool's metadata.name doesn't match the name parameter
|
|
1297
1298
|
*
|
|
1298
1299
|
* @example
|
|
1299
1300
|
* ```ts
|
package/dist/index.js
CHANGED
|
@@ -873,6 +873,7 @@ var ToolRegistry = class {
|
|
|
873
873
|
* @param name - The tool name
|
|
874
874
|
* @param tool - The new tool definition
|
|
875
875
|
* @returns True if updated, false if the tool didn't exist
|
|
876
|
+
* @throws Error if the tool's metadata.name doesn't match the name parameter
|
|
876
877
|
*
|
|
877
878
|
* @example
|
|
878
879
|
* ```ts
|
|
@@ -883,6 +884,11 @@ var ToolRegistry = class {
|
|
|
883
884
|
if (!this.tools.has(name)) {
|
|
884
885
|
return false;
|
|
885
886
|
}
|
|
887
|
+
if (tool.metadata.name !== name) {
|
|
888
|
+
throw new Error(
|
|
889
|
+
`Cannot update tool: metadata.name "${tool.metadata.name}" does not match registry key "${name}". To rename a tool, remove it and register it again with the new name.`
|
|
890
|
+
);
|
|
891
|
+
}
|
|
886
892
|
this.tools.set(name, tool);
|
|
887
893
|
this.emit("tool:updated" /* TOOL_UPDATED */, { name, tool });
|
|
888
894
|
return true;
|
|
@@ -1971,6 +1977,11 @@ function createStateAnnotation(config) {
|
|
|
1971
1977
|
reducer: channelConfig.reducer,
|
|
1972
1978
|
default: channelConfig.default
|
|
1973
1979
|
});
|
|
1980
|
+
} else if (channelConfig.default) {
|
|
1981
|
+
stateDefinition[key] = Annotation({
|
|
1982
|
+
reducer: (_left, right) => right,
|
|
1983
|
+
default: channelConfig.default
|
|
1984
|
+
});
|
|
1974
1985
|
} else {
|
|
1975
1986
|
stateDefinition[key] = Annotation();
|
|
1976
1987
|
}
|