-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathcanvastty-plugin.schema.json
More file actions
173 lines (173 loc) · 7.86 KB
/
Copy pathcanvastty-plugin.schema.json
File metadata and controls
173 lines (173 loc) · 7.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://github.com/howdeploy/CanvasTTY/blob/main/docs/canvastty-plugin.schema.json",
"title": "CanvasTTY plugin manifest v1",
"type": "object",
"additionalProperties": false,
"required": ["apiVersion", "id", "name", "version", "description", "permissions", "contributions"],
"anyOf": [
{ "properties": { "contributions": { "minItems": 1 } } },
{ "required": ["hooks"], "properties": { "hooks": { "minItems": 1 } } }
],
"properties": {
"apiVersion": { "const": 1 },
"id": { "type": "string", "minLength": 3, "maxLength": 80, "pattern": "^(?!.*\\.\\.)[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$" },
"name": { "type": "string", "minLength": 1, "maxLength": 80 },
"version": { "type": "string", "maxLength": 40, "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?$" },
"description": { "type": "string", "minLength": 1, "maxLength": 2000 },
"description.ru": { "type": "string", "minLength": 1, "maxLength": 2000 },
"description.en": { "type": "string", "minLength": 1, "maxLength": 2000 },
"icon": { "type": "string", "minLength": 1, "maxLength": 180, "pattern": "^(?!/)(?!.*\\\\)(?!\\.\\.?/)(?!.*(?:/\\.\\.?/|/\\.\\.?$|//)).+$" },
"author": { "type": "string", "minLength": 1, "maxLength": 120 },
"homepage": { "type": "string", "format": "uri", "maxLength": 300, "pattern": "^https?://" },
"settingsContribution": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$" },
"coreFiles": { "type": "array", "minItems": 1, "maxItems": 500, "items": { "$ref": "#/$defs/moduleAsset" } },
"modules": { "type": "array", "maxItems": 16, "items": { "$ref": "#/$defs/module" } },
"platforms": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "type": "string", "minLength": 1, "maxLength": 32, "pattern": "^[a-z0-9][a-z0-9-]{0,31}$" }
},
"minHostVersion": { "type": "string", "pattern": "^\\d+\\.\\d+\\.\\d+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$" },
"permissions": {
"type": "array",
"maxItems": 12,
"uniqueItems": true,
"items": { "enum": ["storage", "secrets", "sessions:read", "limits:read", "launcher:open", "external:open", "browser:open", "media:library", "playlists:read", "playlists:write", "hermes:hud", "network"] }
},
"contributions": {
"type": "array",
"minItems": 0,
"maxItems": 32,
"items": { "$ref": "#/$defs/contribution" }
},
"hooks": {
"type": "array",
"minItems": 1,
"maxItems": 16,
"items": { "$ref": "#/$defs/agentHook" }
}
},
"$defs": {
"moduleAsset": {
"type": "object",
"additionalProperties": false,
"required": ["path", "bytes", "sha256"],
"properties": {
"path": { "type": "string", "minLength": 1, "maxLength": 180 },
"bytes": { "type": "integer", "minimum": 0, "maximum": 8388608 },
"sha256": { "type": "string", "pattern": "^[a-fA-F0-9]{64}$" }
}
},
"module": {
"type": "object",
"additionalProperties": false,
"required": ["id", "title", "defaultSelected", "permissions", "files"],
"properties": {
"id": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$" },
"title": { "type": "string", "minLength": 1, "maxLength": 80 },
"description": { "type": "string", "minLength": 1, "maxLength": 240 },
"defaultSelected": { "type": "boolean" },
"permissions": {
"type": "array",
"maxItems": 12,
"uniqueItems": true,
"items": { "enum": ["storage", "secrets", "sessions:read", "limits:read", "launcher:open", "external:open", "browser:open", "media:library", "playlists:read", "playlists:write", "hermes:hud", "network"] }
},
"files": { "type": "array", "minItems": 1, "maxItems": 500, "items": { "$ref": "#/$defs/moduleAsset" } }
}
},
"agentHook": {
"type": "object",
"additionalProperties": false,
"required": ["id", "title", "entry", "providers", "events"],
"properties": {
"id": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$" },
"title": { "type": "string", "minLength": 1, "maxLength": 80 },
"description": { "type": "string", "minLength": 1, "maxLength": 240 },
"entry": { "type": "string", "minLength": 1, "maxLength": 180, "pattern": "^(?!/)(?!.*\\\\)(?!\\.\\.?/)(?!.*(?:/\\.\\.?/|/\\.\\.?$|//)).+\\.(?:js|mjs|cjs)$" },
"providers": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "enum": ["codex", "claude", "qwen", "kimi", "opencode", "hermes", "grok"] }
},
"events": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "enum": ["session-start", "prompt-submit", "permission-request", "permission-result", "after-tool", "stop", "session-end"] }
},
"module": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$" }
}
},
"baseContribution": {
"type": "object",
"additionalProperties": false,
"required": ["id", "kind", "title", "entry", "defaultSize"],
"properties": {
"id": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$" },
"kind": { "enum": ["home-widget", "canvas-app", "window"] },
"title": { "type": "string", "minLength": 1, "maxLength": 80 },
"description": { "type": "string", "minLength": 1, "maxLength": 240 },
"entry": { "type": "string", "minLength": 1, "maxLength": 180, "pattern": "^(?!/)(?!.*\\\\)(?!\\.\\.?/)(?!.*(?:/\\.\\.?/|/\\.\\.?$|//)).+\\.html$" },
"icon": { "type": "string", "minLength": 1, "maxLength": 180, "pattern": "^(?!/)(?!.*\\\\)(?!\\.\\.?/)(?!.*(?:/\\.\\.?/|/\\.\\.?$|//)).+$" },
"module": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^[a-z0-9](?:[a-z0-9._-]*[a-z0-9])?$" },
"defaultSize": { "type": "object" },
"minSize": { "type": "object" }
}
},
"contribution": {
"oneOf": [
{
"allOf": [
{ "$ref": "#/$defs/baseContribution" },
{
"properties": {
"kind": { "const": "home-widget" },
"defaultSize": {
"type": "object",
"additionalProperties": false,
"required": ["columns", "rows"],
"properties": {
"columns": { "type": "integer", "minimum": 1, "maximum": 48 },
"rows": { "type": "integer", "minimum": 1, "maximum": 36 }
}
}
}
}
]
},
{
"allOf": [
{ "$ref": "#/$defs/baseContribution" },
{
"properties": {
"kind": { "enum": ["canvas-app", "window"] },
"defaultSize": {
"type": "object",
"additionalProperties": false,
"required": ["width", "height"],
"properties": {
"width": { "type": "number", "minimum": 320, "maximum": 1600 },
"height": { "type": "number", "minimum": 220, "maximum": 1100 }
}
},
"minSize": {
"type": "object",
"additionalProperties": false,
"required": ["width", "height"],
"properties": {
"width": { "type": "number", "minimum": 240, "maximum": 1600 },
"height": { "type": "number", "minimum": 140, "maximum": 1100 }
}
}
}
}
]
}
]
}
}
}