From b66da75d539c3de7f29da30c17b7ad187e2656df Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:18:07 +0000 Subject: [PATCH 1/2] Initial plan From 6d8a7555e492d6252e5a1b84f129a542b926eaf4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 14:25:46 +0000 Subject: [PATCH 2/2] fix: resolve TypeScript build errors in stack.zod.ts and error-map.zod.ts - Fix hook.object type mismatch: handle string | string[] union properly - Fix ObjectStackRawIssue: use z.core.$ZodRawIssue to match Zod v4 types - Fix ZodIssueMinimal.path: use PropertyKey[] to match Zod v4's $ZodIssue.path Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com> --- packages/spec/src/shared/error-map.zod.ts | 18 +++--------------- packages/spec/src/stack.zod.ts | 13 +++++++++---- 2 files changed, 12 insertions(+), 19 deletions(-) diff --git a/packages/spec/src/shared/error-map.zod.ts b/packages/spec/src/shared/error-map.zod.ts index 617a71f83b..2eb33ee956 100644 --- a/packages/spec/src/shared/error-map.zod.ts +++ b/packages/spec/src/shared/error-map.zod.ts @@ -5,21 +5,9 @@ import { suggestFieldType, formatSuggestion, findClosestMatches } from './sugges import { FieldType } from '../data/field.zod'; /** - * Zod v4 raw issue structure (subset used by the error map). + * Zod v4 raw issue type used by the error map. */ -export interface ObjectStackRawIssue { - code: string; - path?: (string | number)[]; - input?: unknown; - values?: unknown[]; - origin?: string; - minimum?: number; - maximum?: number; - expected?: string; - format?: string; - keys?: string[]; - [key: string]: unknown; -} +export type ObjectStackRawIssue = z.core.$ZodRawIssue; /** * ObjectStack Custom Zod Error Map @@ -142,7 +130,7 @@ export const objectStackErrorMap = (issue: ObjectStackRawIssue): { message: stri * Zod Issue interface (subset needed for formatting). */ interface ZodIssueMinimal { - path: (string | number)[]; + path: PropertyKey[]; message: string; code?: string; } diff --git a/packages/spec/src/stack.zod.ts b/packages/spec/src/stack.zod.ts index df17d59863..78c89afba2 100644 --- a/packages/spec/src/stack.zod.ts +++ b/packages/spec/src/stack.zod.ts @@ -266,10 +266,15 @@ function validateCrossReferences(config: ObjectStackDefinition): string[] { // Validate hook → object references if (config.hooks) { for (const hook of config.hooks) { - if (hook.object && !objectNames.has(hook.object)) { - errors.push( - `Hook '${hook.name}' references object '${hook.object}' which is not defined in objects.`, - ); + if (hook.object) { + const hookObjects = Array.isArray(hook.object) ? hook.object : [hook.object]; + for (const obj of hookObjects) { + if (!objectNames.has(obj)) { + errors.push( + `Hook '${hook.name}' references object '${obj}' which is not defined in objects.`, + ); + } + } } } }