@syncshio/kano-plugin-sdk 0.0.0-stage → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +265 -2
- package/dist/api/contributions.d.ts +140 -0
- package/dist/api/launch-tools.d.ts +136 -0
- package/dist/api/types.d.ts +178 -0
- package/dist/contracts/app-context.d.ts +32 -0
- package/dist/contracts/app-lifecycle.d.ts +119 -0
- package/dist/contracts/app-plugin.d.ts +72 -0
- package/dist/contracts/drop.d.ts +35 -0
- package/dist/contracts/install-recipe.d.ts +140 -0
- package/dist/contracts/launch-pipeline.d.ts +272 -0
- package/dist/contracts/launch.d.ts +137 -0
- package/dist/contracts/model-market.d.ts +112 -0
- package/dist/contracts/models.d.ts +119 -0
- package/dist/contracts/params.d.ts +150 -0
- package/dist/contracts/providers.d.ts +344 -0
- package/dist/contracts/session.d.ts +64 -0
- package/dist/helpers/define-plugin.d.ts +2 -0
- package/dist/helpers/params.d.ts +14 -0
- package/dist/host.d.ts +626 -0
- package/dist/host.js +94 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +629 -0
- package/dist/manifest/plugin-manifest.d.ts +33 -0
- package/dist/manifest/validate.d.ts +12 -0
- package/dist/versions.d.ts +12 -0
- package/package.json +40 -4
- package/src/schemas/plugin-manifest.schema.json +262 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PluginEnginesManifest } from './manifest/plugin-manifest';
|
|
2
|
+
export interface RuntimeVersionSet {
|
|
3
|
+
kano: string;
|
|
4
|
+
pluginSdk: string;
|
|
5
|
+
}
|
|
6
|
+
export interface EngineCompatibilityResult {
|
|
7
|
+
compatible: boolean;
|
|
8
|
+
errors: string[];
|
|
9
|
+
}
|
|
10
|
+
export declare function satisfiesVersionRange(versionValue: string, range: string): boolean;
|
|
11
|
+
export declare function validatePluginEngineCompatibility(engines: PluginEnginesManifest | undefined, versions: RuntimeVersionSet): EngineCompatibilityResult;
|
|
12
|
+
export declare function compareStableVersions(left: string, right: string): number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncshio/kano-plugin-sdk",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"description": "Kano plugin contracts and helpers",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./host": {
|
|
14
|
+
"types": "./dist/host.d.ts",
|
|
15
|
+
"import": "./dist/host.js"
|
|
16
|
+
},
|
|
17
|
+
"./schemas/plugin-manifest.schema.json": "./src/schemas/plugin-manifest.schema.json",
|
|
18
|
+
"./package.json": "./package.json"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"src/schemas",
|
|
23
|
+
"README.md"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "node scripts/build.mjs",
|
|
27
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
28
|
+
"prepack": "npm run build"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"vue": "^3.4.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"esbuild": "0.28.2",
|
|
35
|
+
"typescript": "5.9.3",
|
|
36
|
+
"vue": "^3.4.30"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public",
|
|
40
|
+
"registry": "https://registry.npmjs.org/"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://kano.dev/schemas/plugin-manifest.schema.json",
|
|
4
|
+
"title": "Kano Plugin Manifest v2",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["manifestVersion", "id", "name", "version", "runtime"],
|
|
8
|
+
"$defs": {
|
|
9
|
+
"condition": {
|
|
10
|
+
"anyOf": [
|
|
11
|
+
{
|
|
12
|
+
"type": "object",
|
|
13
|
+
"required": ["param"],
|
|
14
|
+
"minProperties": 2,
|
|
15
|
+
"maxProperties": 2,
|
|
16
|
+
"additionalProperties": false,
|
|
17
|
+
"properties": {
|
|
18
|
+
"param": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"minLength": 1
|
|
21
|
+
},
|
|
22
|
+
"equals": {},
|
|
23
|
+
"notEquals": {},
|
|
24
|
+
"in": {
|
|
25
|
+
"type": "array"
|
|
26
|
+
},
|
|
27
|
+
"truthy": {
|
|
28
|
+
"type": "boolean"
|
|
29
|
+
},
|
|
30
|
+
"set": {
|
|
31
|
+
"type": "boolean"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"type": "object",
|
|
37
|
+
"minProperties": 1,
|
|
38
|
+
"maxProperties": 1,
|
|
39
|
+
"additionalProperties": false,
|
|
40
|
+
"properties": {
|
|
41
|
+
"and": {
|
|
42
|
+
"$ref": "#/$defs/conditionList"
|
|
43
|
+
},
|
|
44
|
+
"or": {
|
|
45
|
+
"$ref": "#/$defs/conditionList"
|
|
46
|
+
},
|
|
47
|
+
"not": {
|
|
48
|
+
"$ref": "#/$defs/condition"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"conditionList": {
|
|
55
|
+
"type": "array",
|
|
56
|
+
"items": {
|
|
57
|
+
"$ref": "#/$defs/condition"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"properties": {
|
|
62
|
+
"manifestVersion": {
|
|
63
|
+
"type": "integer",
|
|
64
|
+
"const": 2
|
|
65
|
+
},
|
|
66
|
+
"id": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"pattern": "^[a-z0-9][a-z0-9-]*$"
|
|
69
|
+
},
|
|
70
|
+
"name": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"minLength": 1
|
|
73
|
+
},
|
|
74
|
+
"version": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"minLength": 1
|
|
77
|
+
},
|
|
78
|
+
"description": {
|
|
79
|
+
"type": "string"
|
|
80
|
+
},
|
|
81
|
+
"author": {
|
|
82
|
+
"type": "string"
|
|
83
|
+
},
|
|
84
|
+
"homepage": {
|
|
85
|
+
"type": "string"
|
|
86
|
+
},
|
|
87
|
+
"keywords": {
|
|
88
|
+
"type": "array",
|
|
89
|
+
"items": {
|
|
90
|
+
"type": "string"
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
"settings": {
|
|
94
|
+
"type": "array",
|
|
95
|
+
"items": {
|
|
96
|
+
"type": "object",
|
|
97
|
+
"additionalProperties": false,
|
|
98
|
+
"required": ["id", "label", "type"],
|
|
99
|
+
"properties": {
|
|
100
|
+
"id": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"minLength": 1
|
|
103
|
+
},
|
|
104
|
+
"label": {
|
|
105
|
+
"type": "string",
|
|
106
|
+
"minLength": 1
|
|
107
|
+
},
|
|
108
|
+
"description": {
|
|
109
|
+
"type": "string"
|
|
110
|
+
},
|
|
111
|
+
"type": {
|
|
112
|
+
"enum": ["boolean", "string", "number", "select", "path", "text", "port"]
|
|
113
|
+
},
|
|
114
|
+
"default": {},
|
|
115
|
+
"required": {
|
|
116
|
+
"type": "boolean"
|
|
117
|
+
},
|
|
118
|
+
"optional": {
|
|
119
|
+
"type": "boolean"
|
|
120
|
+
},
|
|
121
|
+
"options": {
|
|
122
|
+
"type": "array",
|
|
123
|
+
"items": {
|
|
124
|
+
"type": "object",
|
|
125
|
+
"additionalProperties": false,
|
|
126
|
+
"required": ["value", "label"],
|
|
127
|
+
"properties": {
|
|
128
|
+
"label": {
|
|
129
|
+
"type": "string"
|
|
130
|
+
},
|
|
131
|
+
"value": {
|
|
132
|
+
"anyOf": [
|
|
133
|
+
{
|
|
134
|
+
"type": "string"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"type": "boolean"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"type": "number"
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
"description": {
|
|
145
|
+
"type": "string"
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"pathKind": {
|
|
151
|
+
"enum": ["file", "directory"]
|
|
152
|
+
},
|
|
153
|
+
"fileFilters": {
|
|
154
|
+
"type": "array",
|
|
155
|
+
"items": {
|
|
156
|
+
"type": "object",
|
|
157
|
+
"additionalProperties": false,
|
|
158
|
+
"required": ["name", "extensions"],
|
|
159
|
+
"properties": {
|
|
160
|
+
"name": {
|
|
161
|
+
"type": "string"
|
|
162
|
+
},
|
|
163
|
+
"extensions": {
|
|
164
|
+
"type": "array",
|
|
165
|
+
"items": {
|
|
166
|
+
"type": "string"
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"min": {
|
|
173
|
+
"type": "number"
|
|
174
|
+
},
|
|
175
|
+
"max": {
|
|
176
|
+
"type": "number"
|
|
177
|
+
},
|
|
178
|
+
"step": {
|
|
179
|
+
"type": "number"
|
|
180
|
+
},
|
|
181
|
+
"integer": {
|
|
182
|
+
"type": "boolean"
|
|
183
|
+
},
|
|
184
|
+
"order": {
|
|
185
|
+
"type": "number"
|
|
186
|
+
},
|
|
187
|
+
"placeholder": {
|
|
188
|
+
"type": "string"
|
|
189
|
+
},
|
|
190
|
+
"warning": {
|
|
191
|
+
"type": "string"
|
|
192
|
+
},
|
|
193
|
+
"showWhen": {
|
|
194
|
+
"$ref": "#/$defs/condition"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
"runtime": {
|
|
200
|
+
"type": "object",
|
|
201
|
+
"additionalProperties": false,
|
|
202
|
+
"required": ["entry"],
|
|
203
|
+
"properties": {
|
|
204
|
+
"entry": {
|
|
205
|
+
"type": "string",
|
|
206
|
+
"minLength": 1
|
|
207
|
+
},
|
|
208
|
+
"style": {
|
|
209
|
+
"type": "string",
|
|
210
|
+
"minLength": 1
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
"permissions": {
|
|
215
|
+
"type": "object",
|
|
216
|
+
"additionalProperties": false,
|
|
217
|
+
"properties": {
|
|
218
|
+
"network": {
|
|
219
|
+
"type": "array",
|
|
220
|
+
"items": {
|
|
221
|
+
"type": "string",
|
|
222
|
+
"pattern": "^https://[^/]+$"
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
"rpc": {
|
|
226
|
+
"type": "array",
|
|
227
|
+
"items": {
|
|
228
|
+
"type": "string"
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
"shell": {
|
|
232
|
+
"type": "array",
|
|
233
|
+
"items": {
|
|
234
|
+
"enum": ["openExternal", "openFolder", "showItemInFolder"]
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
"launchPipeline": {
|
|
238
|
+
"type": "boolean"
|
|
239
|
+
},
|
|
240
|
+
"systemMetrics": {
|
|
241
|
+
"type": "boolean",
|
|
242
|
+
"description": "读取当前执行端的 CPU、内存与显卡实时状态"
|
|
243
|
+
},
|
|
244
|
+
"storage": {
|
|
245
|
+
"type": "boolean"
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
"engines": {
|
|
250
|
+
"type": "object",
|
|
251
|
+
"additionalProperties": false,
|
|
252
|
+
"properties": {
|
|
253
|
+
"kano": {
|
|
254
|
+
"type": "string"
|
|
255
|
+
},
|
|
256
|
+
"pluginSdk": {
|
|
257
|
+
"type": "string"
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|