fix(hooks): correct JSON schema type for hooks configuration

- Add 'array' type support to SettingItemDefinition
- Change hooks field from object to array type
- Add additionalProperties constraint for env fields
- Fix additionalProperties generation to only apply for object types

This ensures the hooks configuration schema correctly represents hooks as an array
and properly validates environment variable objects.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
tanzhenxin 2026-03-15 20:32:56 +08:00
parent d5eda197c2
commit 8161ac4523
3 changed files with 18 additions and 12 deletions

View file

@ -85,7 +85,7 @@ export interface SettingDefinition {
* Supports simple types (string, number, boolean) and complex object types.
*/
export interface SettingItemDefinition {
type: 'string' | 'number' | 'boolean' | 'object';
type: 'string' | 'number' | 'boolean' | 'object' | 'array';
properties?: Record<
string,
SettingItemDefinition & {
@ -125,7 +125,7 @@ const HOOK_DEFINITION_ITEMS: SettingItemDefinition = {
'Whether the hooks should be executed sequentially instead of in parallel.',
},
hooks: {
type: 'object',
type: 'array',
description: 'The list of hook configurations to execute.',
required: true,
items: {