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

@@ -1098,6 +1098,54 @@
"title": "Skills/config/writeRequest",
"type": "object"
},
{
"properties": {
"id": {
"$ref": "#/definitions/v2/RequestId"
},
"method": {
"enum": [
"hooks/list"
],
"title": "Hooks/listRequestMethod",
"type": "string"
},
"params": {
"$ref": "#/definitions/v2/HooksListParams"
}
},
"required": [
"id",
"method",
"params"
],
"title": "Hooks/listRequest",
"type": "object"
},
{
"properties": {
"id": {
"$ref": "#/definitions/v2/RequestId"
},
"method": {
"enum": [
"hooks/config/write"
],
"title": "Hooks/config/writeRequestMethod",
"type": "string"
},
"params": {
"$ref": "#/definitions/v2/HooksConfigWriteParams"
}
},
"required": [
"id",
"method",
"params"
],
"title": "Hooks/config/writeRequest",
"type": "object"
},
{
"properties": {
"id": {
@@ -9567,6 +9615,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",
@@ -9593,6 +9662,75 @@
],
"type": "string"
},
"HookMetadata": {
"properties": {
"command": {
"type": [
"string",
"null"
]
},
"enabled": {
"type": "boolean"
},
"eventName": {
"$ref": "#/definitions/v2/HookEventName"
},
"handlerType": {
"$ref": "#/definitions/v2/HookHandlerType"
},
"key": {
"type": "string"
},
"matcher": {
"type": [
"string",
"null"
]
},
"pluginId": {
"type": [
"string",
"null"
]
},
"source": {
"$ref": "#/definitions/v2/HookSource"
},
"sourcePath": {
"$ref": "#/definitions/v2/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": {
@@ -9767,6 +9905,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/v2/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/v2/HookErrorInfo"
},
"type": "array"
},
"hooks": {
"items": {
"$ref": "#/definitions/v2/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/v2/HooksListEntry"
},
"type": "array"
}
},
"required": [
"data"
],
"title": "HooksListResponse",
"type": "object"
},
"ImageDetail": {
"enum": [
"auto",