Add plugin hook enablement config APIs

This commit is contained in:
Abhinav Vedmala
2026-04-26 14:48:00 -07:00
parent 803c16f2d3
commit 3de8182aa9
36 changed files with 1838 additions and 19 deletions

View File

@@ -1804,6 +1804,54 @@
"title": "Skills/config/writeRequest",
"type": "object"
},
{
"properties": {
"id": {
"$ref": "#/definitions/RequestId"
},
"method": {
"enum": [
"hooks/list"
],
"title": "Hooks/listRequestMethod",
"type": "string"
},
"params": {
"$ref": "#/definitions/HooksListParams"
}
},
"required": [
"id",
"method",
"params"
],
"title": "Hooks/listRequest",
"type": "object"
},
{
"properties": {
"id": {
"$ref": "#/definitions/RequestId"
},
"method": {
"enum": [
"hooks/config/write"
],
"title": "Hooks/config/writeRequestMethod",
"type": "string"
},
"params": {
"$ref": "#/definitions/HooksConfigWriteParams"
}
},
"required": [
"id",
"method",
"params"
],
"title": "Hooks/config/writeRequest",
"type": "object"
},
{
"properties": {
"id": {
@@ -6197,6 +6245,27 @@
"title": "HookCompletedNotification",
"type": "object"
},
"HookConfigSource": {
"enum": [
"plugin"
],
"type": "string"
},
"HookErrorInfo": {
"properties": {
"message": {
"type": "string"
},
"path": {
"type": "string"
}
},
"required": [
"message",
"path"
],
"type": "object"
},
"HookEventName": {
"enum": [
"preToolUse",
@@ -6223,6 +6292,75 @@
],
"type": "string"
},
"HookMetadata": {
"properties": {
"command": {
"type": [
"string",
"null"
]
},
"enabled": {
"type": "boolean"
},
"eventName": {
"$ref": "#/definitions/HookEventName"
},
"handlerType": {
"$ref": "#/definitions/HookHandlerType"
},
"key": {
"type": "string"
},
"matcher": {
"type": [
"string",
"null"
]
},
"pluginId": {
"type": [
"string",
"null"
]
},
"source": {
"$ref": "#/definitions/HookSource"
},
"sourcePath": {
"$ref": "#/definitions/AbsolutePathBuf"
},
"sourceRelativePath": {
"type": [
"string",
"null"
]
},
"statusMessage": {
"type": [
"string",
"null"
]
},
"timeoutSec": {
"format": "uint64",
"minimum": 0.0,
"type": [
"integer",
"null"
]
}
},
"required": [
"enabled",
"eventName",
"handlerType",
"key",
"source",
"sourcePath"
],
"type": "object"
},
"HookOutputEntry": {
"properties": {
"kind": {
@@ -6397,6 +6535,104 @@
"title": "HookStartedNotification",
"type": "object"
},
"HooksConfigWriteParams": {
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"enabled": {
"type": "boolean"
},
"key": {
"type": "string"
},
"pluginId": {
"type": [
"string",
"null"
]
},
"source": {
"$ref": "#/definitions/HookConfigSource"
}
},
"required": [
"enabled",
"key",
"source"
],
"title": "HooksConfigWriteParams",
"type": "object"
},
"HooksConfigWriteResponse": {
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"effectiveEnabled": {
"type": "boolean"
}
},
"required": [
"effectiveEnabled"
],
"title": "HooksConfigWriteResponse",
"type": "object"
},
"HooksListEntry": {
"properties": {
"cwd": {
"type": "string"
},
"errors": {
"items": {
"$ref": "#/definitions/HookErrorInfo"
},
"type": "array"
},
"hooks": {
"items": {
"$ref": "#/definitions/HookMetadata"
},
"type": "array"
}
},
"required": [
"cwd",
"errors",
"hooks"
],
"type": "object"
},
"HooksListParams": {
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"cwds": {
"description": "When omitted or empty, defaults to the current session working directory.",
"items": {
"type": "string"
},
"type": [
"array",
"null"
]
}
},
"title": "HooksListParams",
"type": "object"
},
"HooksListResponse": {
"$schema": "http://json-schema.org/draft-07/schema#",
"properties": {
"data": {
"items": {
"$ref": "#/definitions/HooksListEntry"
},
"type": "array"
}
},
"required": [
"data"
],
"title": "HooksListResponse",
"type": "object"
},
"ImageDetail": {
"enum": [
"auto",