stratus-sdk 0.7.6 → 0.8.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.
@@ -3,19 +3,13 @@ import type { FunctionTool } from "./tool";
3
3
  declare const TodoItemSchema: z.ZodObject<{
4
4
  id: z.ZodString;
5
5
  content: z.ZodString;
6
- status: z.ZodEnum<["pending", "in_progress", "completed"]>;
6
+ status: z.ZodEnum<{
7
+ pending: "pending";
8
+ in_progress: "in_progress";
9
+ completed: "completed";
10
+ }>;
7
11
  activeForm: z.ZodOptional<z.ZodString>;
8
- }, "strip", z.ZodTypeAny, {
9
- status: "pending" | "in_progress" | "completed";
10
- content: string;
11
- id: string;
12
- activeForm?: string | undefined;
13
- }, {
14
- status: "pending" | "in_progress" | "completed";
15
- content: string;
16
- id: string;
17
- activeForm?: string | undefined;
18
- }>;
12
+ }, z.core.$strip>;
19
13
  export type Todo = z.infer<typeof TodoItemSchema>;
20
14
  export type TodoStatus = Todo["status"];
21
15
  export type TodoUpdateListener = (todos: readonly Todo[]) => void;
@@ -35,34 +29,14 @@ declare const TodoWriteSchema: z.ZodObject<{
35
29
  todos: z.ZodArray<z.ZodObject<{
36
30
  id: z.ZodString;
37
31
  content: z.ZodString;
38
- status: z.ZodEnum<["pending", "in_progress", "completed"]>;
32
+ status: z.ZodEnum<{
33
+ pending: "pending";
34
+ in_progress: "in_progress";
35
+ completed: "completed";
36
+ }>;
39
37
  activeForm: z.ZodOptional<z.ZodString>;
40
- }, "strip", z.ZodTypeAny, {
41
- status: "pending" | "in_progress" | "completed";
42
- content: string;
43
- id: string;
44
- activeForm?: string | undefined;
45
- }, {
46
- status: "pending" | "in_progress" | "completed";
47
- content: string;
48
- id: string;
49
- activeForm?: string | undefined;
50
- }>, "many">;
51
- }, "strip", z.ZodTypeAny, {
52
- todos: {
53
- status: "pending" | "in_progress" | "completed";
54
- content: string;
55
- id: string;
56
- activeForm?: string | undefined;
57
- }[];
58
- }, {
59
- todos: {
60
- status: "pending" | "in_progress" | "completed";
61
- content: string;
62
- id: string;
63
- activeForm?: string | undefined;
64
- }[];
65
- }>;
38
+ }, z.core.$strip>>;
39
+ }, z.core.$strip>;
66
40
  /**
67
41
  * Creates a tool that lets the agent manage a todo list.
68
42
  *
@@ -1 +1 @@
1
- {"version":3,"file":"todo.d.ts","sourceRoot":"","sources":["../../src/core/todo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAE3C,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;EAQlB,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAClD,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;AAExC,MAAM,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,KAAK,IAAI,CAAC;AAElE,qBAAa,QAAQ;IACpB,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,SAAS,CAA4B;IAE7C,2CAA2C;IAC3C,IAAI,KAAK,IAAI,SAAS,IAAI,EAAE,CAE3B;IAED,0FAA0F;IAC1F,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,GAAG,MAAM,IAAI;IAQlD,kEAAkE;IAClE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI;IAO1B,2BAA2B;IAC3B,KAAK,IAAI,IAAI;CAMb;AAED,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEnB,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,GAAG,OAAO,EAAE,IAAI,EAAE,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,EAAE,QAAQ,CAAC,CAmBpH"}
1
+ {"version":3,"file":"todo.d.ts","sourceRoot":"","sources":["../../src/core/todo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAE3C,QAAA,MAAM,cAAc;;;;;;;;;iBAQlB,CAAC;AAEH,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAClD,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;AAExC,MAAM,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,KAAK,IAAI,CAAC;AAElE,qBAAa,QAAQ;IACpB,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,SAAS,CAA4B;IAE7C,2CAA2C;IAC3C,IAAI,KAAK,IAAI,SAAS,IAAI,EAAE,CAE3B;IAED,0FAA0F;IAC1F,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,GAAG,MAAM,IAAI;IAQlD,kEAAkE;IAClE,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI;IAO1B,2BAA2B;IAC3B,KAAK,IAAI,IAAI;CAMb;AAED,QAAA,MAAM,eAAe;;;;;;;;;;;iBAEnB,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,GAAG,OAAO,EAAE,IAAI,EAAE,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,EAAE,QAAQ,CAAC,CAmBpH"}
@@ -1,5 +1,5 @@
1
- import type { z } from "zod";
1
+ import { type ZodTypeAny } from "zod";
2
2
  type JsonSchema = Record<string, unknown>;
3
- export declare function zodToJsonSchema(schema: z.ZodTypeAny): JsonSchema;
3
+ export declare function zodToJsonSchema(schema: ZodTypeAny): JsonSchema;
4
4
  export {};
5
5
  //# sourceMappingURL=zod.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"zod.d.ts","sourceRoot":"","sources":["../../../src/core/utils/zod.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE1C,wBAAgB,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,GAAG,UAAU,CAEhE"}
1
+ {"version":3,"file":"zod.d.ts","sourceRoot":"","sources":["../../../src/core/utils/zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAgB,MAAM,KAAK,CAAC;AAEpD,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE1C,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAI9D"}
@@ -1,73 +1,7 @@
1
+ import { toJSONSchema } from "zod";
1
2
  export function zodToJsonSchema(schema) {
2
- return convertSchema(schema);
3
- }
4
- function convertSchema(schema) {
5
- const def = schema._def;
6
- const typeName = def.typeName;
7
- switch (typeName) {
8
- case "ZodObject":
9
- return convertObject(schema);
10
- case "ZodString":
11
- return withDescription({ type: "string" }, def.description);
12
- case "ZodNumber":
13
- return withDescription({ type: "number" }, def.description);
14
- case "ZodBoolean":
15
- return withDescription({ type: "boolean" }, def.description);
16
- case "ZodArray":
17
- return withDescription({ type: "array", items: convertSchema(def.type) }, def.description);
18
- case "ZodEnum":
19
- return withDescription({ type: "string", enum: def.values }, def.description);
20
- case "ZodNativeEnum":
21
- return withDescription({ type: "string", enum: Object.values(def.values) }, def.description);
22
- case "ZodOptional":
23
- return convertSchema(def.innerType);
24
- case "ZodNullable":
25
- return { ...convertSchema(def.innerType), nullable: true };
26
- case "ZodDefault":
27
- return convertSchema(def.innerType);
28
- case "ZodLiteral":
29
- return withDescription({ type: typeof def.value, const: def.value }, def.description);
30
- case "ZodUnion": {
31
- const options = def.options.map(convertSchema);
32
- return withDescription({ anyOf: options }, def.description);
33
- }
34
- default:
35
- return {};
36
- }
37
- }
38
- function convertObject(schema) {
39
- const shape = schema.shape;
40
- const properties = {};
41
- const required = [];
42
- for (const [key, value] of Object.entries(shape)) {
43
- const fieldSchema = value;
44
- properties[key] = convertSchema(fieldSchema);
45
- if (!isOptional(fieldSchema)) {
46
- required.push(key);
47
- }
48
- }
49
- const result = {
50
- type: "object",
51
- properties,
52
- additionalProperties: false,
53
- };
54
- if (required.length > 0) {
55
- result.required = required;
56
- }
57
- return withDescription(result, schema._def.description);
58
- }
59
- function isOptional(schema) {
60
- const typeName = schema._def.typeName;
61
- if (typeName === "ZodOptional")
62
- return true;
63
- if (typeName === "ZodDefault")
64
- return true;
65
- return false;
66
- }
67
- function withDescription(schema, description) {
68
- if (description) {
69
- return { ...schema, description };
70
- }
71
- return schema;
3
+ const result = toJSONSchema(schema);
4
+ delete result.$schema;
5
+ return result;
72
6
  }
73
7
  //# sourceMappingURL=zod.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"zod.js","sourceRoot":"","sources":["../../../src/core/utils/zod.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,eAAe,CAAC,MAAoB;IACnD,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AAC9B,CAAC;AAED,SAAS,aAAa,CAAC,MAAoB;IAC1C,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC;IACxB,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAkB,CAAC;IAExC,QAAQ,QAAQ,EAAE,CAAC;QAClB,KAAK,WAAW;YACf,OAAO,aAAa,CAAC,MAAoC,CAAC,CAAC;QAC5D,KAAK,WAAW;YACf,OAAO,eAAe,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;QAC7D,KAAK,WAAW;YACf,OAAO,eAAe,CAAC,EAAE,IAAI,EAAE,Q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,EAAE,WAAW,EAAE,CAAC;IACnC,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"zod.js","sourceRoot":"","sources":["../../../src/core/utils/zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,YAAY,EAAE,MAAM,KAAK,CAAC;AAIpD,MAAM,UAAU,eAAe,CAAC,MAAkB;IACjD,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM,CAAe,CAAC;IAClD,OAAO,MAAM,CAAC,OAAO,CAAC;IACtB,OAAO,MAAM,CAAC;AACf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stratus-sdk",
3
- "version": "0.7.6",
3
+ "version": "0.8.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -28,12 +28,12 @@
28
28
  "test": "bun test"
29
29
  },
30
30
  "peerDependencies": {
31
- "zod": "^3.23.0"
31
+ "zod": "^4.0.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@biomejs/biome": "^1.9.0",
35
35
  "@types/bun": "^1.3.9",
36
36
  "typescript": "^5.6.0",
37
- "zod": "^3.23.0"
37
+ "zod": "^4.0.0"
38
38
  }
39
39
  }