@botbotgo/agent-harness 0.0.169 → 0.0.171
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/README.md
CHANGED
|
@@ -154,6 +154,8 @@ Boundary documents live in:
|
|
|
154
154
|
- `docs/development/extensions.html`
|
|
155
155
|
- `docs/development/runtime-operations.html`
|
|
156
156
|
- `docs/development/testing-and-release.html`
|
|
157
|
+
- `docs/development/api-reference.html`
|
|
158
|
+
- `docs/development/cookbook.html`
|
|
157
159
|
- `docs/upstream-feature-matrix.md`
|
|
158
160
|
- `docs/product-boundary.md`
|
|
159
161
|
- `docs/runtime-blueprint-assessment.md`
|
package/README.zh.md
CHANGED
|
@@ -154,6 +154,8 @@ AI 让 agent 逻辑、工具调用和工作流代码更容易生成,真正更
|
|
|
154
154
|
- `docs/development/extensions.html`
|
|
155
155
|
- `docs/development/runtime-operations.html`
|
|
156
156
|
- `docs/development/testing-and-release.html`
|
|
157
|
+
- `docs/development/api-reference.html`
|
|
158
|
+
- `docs/development/cookbook.html`
|
|
157
159
|
- `docs/upstream-feature-matrix.md`
|
|
158
160
|
- `docs/product-boundary.md`
|
|
159
161
|
- `docs/runtime-blueprint-assessment.md`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export declare const AGENT_HARNESS_VERSION = "0.0.170";
|
package/dist/package-version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const AGENT_HARNESS_VERSION = "0.0.
|
|
1
|
+
export const AGENT_HARNESS_VERSION = "0.0.170";
|
|
@@ -14,5 +14,7 @@ export declare function wrapResolvedToolWithModelFacingName<T>(resolvedTool: T,
|
|
|
14
14
|
export declare function hasCallableToolHandler(value: unknown): value is ResolvedToolLike;
|
|
15
15
|
export declare function normalizeResolvedToolSchema(resolvedTool: ResolvedToolLike): Record<string, unknown> | {
|
|
16
16
|
parse?: (input: unknown) => unknown;
|
|
17
|
-
} | z.ZodObject<{
|
|
17
|
+
} | z.ZodObject<{
|
|
18
|
+
[x: string]: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
19
|
+
}, z.core.$strip> | z.ZodObject<{}, z.core.$loose> | undefined;
|
|
18
20
|
export declare function asStructuredExecutableTool(resolvedTool: unknown, modelFacingName: string, description: string): unknown;
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { tool as createLangChainTool } from "@langchain/core/tools";
|
|
3
|
+
function isZodSchemaLike(value) {
|
|
4
|
+
return typeof value === "object" && value !== null && typeof value.parse === "function";
|
|
5
|
+
}
|
|
6
|
+
function isZodRawShape(value) {
|
|
7
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
const entries = Object.values(value);
|
|
11
|
+
return entries.length > 0 && entries.every((entry) => isZodSchemaLike(entry));
|
|
12
|
+
}
|
|
3
13
|
export function asRecord(value) {
|
|
4
14
|
return typeof value === "object" && value !== null && !Array.isArray(value)
|
|
5
15
|
? { ...value }
|
|
@@ -38,9 +48,12 @@ export function hasCallableToolHandler(value) {
|
|
|
38
48
|
}
|
|
39
49
|
export function normalizeResolvedToolSchema(resolvedTool) {
|
|
40
50
|
const schema = resolvedTool.schema;
|
|
41
|
-
if (schema &&
|
|
51
|
+
if (isZodSchemaLike(schema) && "_def" in schema) {
|
|
42
52
|
return resolvedTool.schema;
|
|
43
53
|
}
|
|
54
|
+
if (isZodRawShape(schema)) {
|
|
55
|
+
return z.object(schema);
|
|
56
|
+
}
|
|
44
57
|
if (schema && (schema.type === "object" || typeof schema.properties === "object")) {
|
|
45
58
|
return schema;
|
|
46
59
|
}
|