@axlsdk/axl 0.8.0 → 0.9.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/README.md +3 -1
- package/dist/index.cjs +3 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -8
- package/dist/index.d.ts +10 -8
- package/dist/index.js +4 -43
- package/dist/index.js.map +1 -1
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -7,9 +7,11 @@ Core SDK for orchestrating agentic systems in TypeScript. Part of the [Axl](http
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm install @axlsdk/axl zod
|
|
10
|
+
npm install @axlsdk/axl zod@^4
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
> **Note:** `zod` is a peer dependency — your application and Axl share a single Zod instance. Zod v4 (`^4.0.0`) is required.
|
|
14
|
+
|
|
13
15
|
## Project Structure
|
|
14
16
|
|
|
15
17
|
The recommended pattern separates config, tools, agents, workflows, and runtime into their own modules. Dependencies flow one direction: tools → agents → workflows → runtime.
|
package/dist/index.cjs
CHANGED
|
@@ -2248,48 +2248,9 @@ function resolveConfig(config) {
|
|
|
2248
2248
|
// src/context.ts
|
|
2249
2249
|
var signalStorage = new import_node_async_hooks.AsyncLocalStorage();
|
|
2250
2250
|
function zodToJsonSchema(schema) {
|
|
2251
|
-
const
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
case "ZodString":
|
|
2255
|
-
return { type: "string" };
|
|
2256
|
-
case "ZodNumber":
|
|
2257
|
-
return { type: "number" };
|
|
2258
|
-
case "ZodBoolean":
|
|
2259
|
-
return { type: "boolean" };
|
|
2260
|
-
case "ZodArray":
|
|
2261
|
-
return { type: "array", items: zodToJsonSchema(def.type) };
|
|
2262
|
-
case "ZodObject": {
|
|
2263
|
-
const shape = def.shape?.() ?? {};
|
|
2264
|
-
const properties = {};
|
|
2265
|
-
const required = [];
|
|
2266
|
-
for (const [key, value] of Object.entries(shape)) {
|
|
2267
|
-
properties[key] = zodToJsonSchema(value);
|
|
2268
|
-
const innerDef = value._def;
|
|
2269
|
-
if (innerDef?.typeName !== "ZodOptional" && innerDef?.typeName !== "ZodDefault") {
|
|
2270
|
-
required.push(key);
|
|
2271
|
-
}
|
|
2272
|
-
}
|
|
2273
|
-
return { type: "object", properties, required: required.length > 0 ? required : void 0 };
|
|
2274
|
-
}
|
|
2275
|
-
case "ZodOptional":
|
|
2276
|
-
return zodToJsonSchema(def.innerType);
|
|
2277
|
-
case "ZodDefault":
|
|
2278
|
-
return zodToJsonSchema(def.innerType);
|
|
2279
|
-
case "ZodEnum":
|
|
2280
|
-
return { type: "string", enum: def.values };
|
|
2281
|
-
case "ZodLiteral": {
|
|
2282
|
-
const v = def.value;
|
|
2283
|
-
const t = v === null ? "null" : typeof v;
|
|
2284
|
-
return { type: t, const: v };
|
|
2285
|
-
}
|
|
2286
|
-
case "ZodUnion":
|
|
2287
|
-
return { oneOf: def.options.map((o) => zodToJsonSchema(o)) };
|
|
2288
|
-
case "ZodNullable":
|
|
2289
|
-
return { ...zodToJsonSchema(def.innerType), nullable: true };
|
|
2290
|
-
default:
|
|
2291
|
-
return {};
|
|
2292
|
-
}
|
|
2251
|
+
const result = import_zod.z.toJSONSchema(schema, { unrepresentable: "any" });
|
|
2252
|
+
delete result.$schema;
|
|
2253
|
+
return result;
|
|
2293
2254
|
}
|
|
2294
2255
|
function estimateTokens(text) {
|
|
2295
2256
|
return Math.ceil(text.length / 4);
|