@smithers-orchestrator/db 0.17.0 → 0.19.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.
Files changed (2) hide show
  1. package/package.json +7 -7
  2. package/src/output.js +25 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithers-orchestrator/db",
3
- "version": "0.17.0",
3
+ "version": "0.19.0",
4
4
  "description": "SQLite and Drizzle persistence adapter for Smithers workflows",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -26,12 +26,12 @@
26
26
  "drizzle-zod": "^0.8.3",
27
27
  "effect": "^3.21.1",
28
28
  "zod": "^4.3.6",
29
- "@smithers-orchestrator/errors": "0.17.0",
30
- "@smithers-orchestrator/graph": "0.17.0",
31
- "@smithers-orchestrator/memory": "0.17.0",
32
- "@smithers-orchestrator/scorers": "0.17.0",
33
- "@smithers-orchestrator/observability": "0.17.0",
34
- "@smithers-orchestrator/scheduler": "0.17.0"
29
+ "@smithers-orchestrator/graph": "0.19.0",
30
+ "@smithers-orchestrator/errors": "0.19.0",
31
+ "@smithers-orchestrator/memory": "0.19.0",
32
+ "@smithers-orchestrator/observability": "0.19.0",
33
+ "@smithers-orchestrator/scorers": "0.19.0",
34
+ "@smithers-orchestrator/scheduler": "0.19.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/bun": "latest",
package/src/output.js CHANGED
@@ -211,6 +211,31 @@ function isZodSchema(val) {
211
211
  * @returns {string}
212
212
  */
213
213
  function describeZodType(schema) {
214
+ if (schema instanceof z.ZodOptional) {
215
+ return `${describeZodType(schema.unwrap())} (optional)`;
216
+ }
217
+ if (schema instanceof z.ZodNullable) {
218
+ return `${describeZodType(schema.unwrap())} | null`;
219
+ }
220
+ if (schema instanceof z.ZodDefault) {
221
+ return describeZodType(schema.removeDefault());
222
+ }
223
+ if (schema instanceof z.ZodString)
224
+ return "string";
225
+ if (schema instanceof z.ZodNumber)
226
+ return "number";
227
+ if (schema instanceof z.ZodBoolean)
228
+ return "boolean";
229
+ if (schema instanceof z.ZodArray)
230
+ return `${describeZodType(schema.element)}[]`;
231
+ if (schema instanceof z.ZodObject)
232
+ return "object";
233
+ if (schema instanceof z.ZodEnum)
234
+ return `enum(${schema.options.join(" | ")})`;
235
+ if (schema instanceof z.ZodLiteral)
236
+ return `literal(${JSON.stringify(schema.value)})`;
237
+ if (schema instanceof z.ZodUnion)
238
+ return schema.options.map((option) => describeZodType(option)).join(" | ");
214
239
  const internal = /** @type {{ _zod?: { def?: Record<string, unknown> } }} */ (/** @type {unknown} */ (schema));
215
240
  if (internal._zod?.def) {
216
241
  const def = internal._zod.def;