@capybara-hq/plugin-sdk 0.1.0-rc.6 → 0.1.0-rc.61
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 +1 -1
- package/agent-docs/agent-templates.md +14 -2
- package/agent-docs/concepts.md +14 -5
- package/agent-docs/connector-templates.md +7 -1
- package/agent-docs/extension-points/channel.md +1 -1
- package/agent-docs/extension-points/context.md +15 -0
- package/agent-docs/extension-points/device-provider.md +15 -0
- package/agent-docs/extension-points/file-preview.md +2 -0
- package/agent-docs/extension-points/model-provider.md +3 -1
- package/agent-docs/extension-points/object-store.md +2 -0
- package/agent-docs/extension-points/push-provider.md +17 -0
- package/agent-docs/extensions.md +29 -3
- package/agent-docs/plugin-format.md +52 -2
- package/agent-docs/setup.md +54 -0
- package/dist/agent-template.d.ts +15 -6
- package/dist/agent-template.js +32 -13
- package/dist/avatar-presets.d.ts +8 -0
- package/dist/avatar-presets.js +17 -0
- package/dist/bootstrap.d.ts +109 -1
- package/dist/bootstrap.js +185 -2
- package/dist/cards.d.ts +67 -13
- package/dist/cards.js +91 -21
- package/dist/channel.d.ts +148 -48
- package/dist/channel.js +10 -5
- package/dist/client-css.d.ts +36 -0
- package/dist/client-css.js +326 -0
- package/dist/client-section.d.ts +35 -0
- package/dist/client-section.js +133 -0
- package/dist/config-ui.d.ts +22 -0
- package/dist/config-ui.js +64 -4
- package/dist/connector-auth.d.ts +15 -2
- package/dist/connector-auth.js +97 -8
- package/dist/connector.d.ts +74 -32
- package/dist/context.d.ts +40 -0
- package/dist/context.js +2 -0
- package/dist/ctx.d.ts +132 -29
- package/dist/define-extension.d.ts +26 -12
- package/dist/define-extension.js +12 -5
- package/dist/device-denied-paths.d.ts +18 -0
- package/dist/device-denied-paths.js +84 -0
- package/dist/device-operation.d.ts +333 -0
- package/dist/device-operation.js +312 -0
- package/dist/device-protocol.d.ts +285 -50
- package/dist/device-protocol.js +755 -90
- package/dist/device-provider.d.ts +503 -0
- package/dist/device-provider.js +302 -0
- package/dist/dial-in.d.ts +176 -0
- package/dist/dial-in.js +115 -0
- package/dist/extension-point.d.ts +2 -0
- package/dist/extension-point.js +6 -2
- package/dist/file-preview.d.ts +23 -6
- package/dist/git-hosts.d.ts +53 -0
- package/dist/git-hosts.js +98 -0
- package/dist/hooks.d.ts +125 -20
- package/dist/hooks.js +5 -0
- package/dist/http-access.d.ts +62 -0
- package/dist/http-access.js +12 -0
- package/dist/identity.d.ts +38 -9
- package/dist/identity.js +21 -1
- package/dist/index.d.ts +29 -3
- package/dist/index.js +29 -3
- package/dist/marketplace.d.ts +26 -0
- package/dist/marketplace.js +43 -1
- package/dist/model-params.d.ts +41 -22
- package/dist/model-params.js +28 -15
- package/dist/model.d.ts +206 -71
- package/dist/model.js +152 -19
- package/dist/net.d.ts +52 -0
- package/dist/net.js +34 -0
- package/dist/network-classes.d.ts +98 -0
- package/dist/network-classes.js +291 -0
- package/dist/permissions.d.ts +54 -22
- package/dist/permissions.js +119 -43
- package/dist/plugin-manifest.d.ts +45 -5
- package/dist/plugin-manifest.js +174 -6
- package/dist/plugin-package.d.ts +82 -38
- package/dist/plugin-package.js +61 -29
- package/dist/push.d.ts +75 -0
- package/dist/push.js +87 -0
- package/dist/sandbox-linux-runtime-source.d.ts +1 -0
- package/dist/sandbox-linux-runtime-source.js +2318 -0
- package/dist/sandbox-native-runtime-source.d.ts +10 -0
- package/dist/sandbox-native-runtime-source.js +476 -0
- package/dist/sandbox-runtime-source.d.ts +19 -0
- package/dist/sandbox-runtime-source.js +28 -0
- package/dist/sandbox-write-denies.d.ts +139 -0
- package/dist/sandbox-write-denies.js +869 -0
- package/dist/secret.d.ts +4 -1
- package/dist/secret.js +4 -1
- package/dist/setup-check.d.ts +128 -0
- package/dist/setup-check.js +142 -0
- package/dist/setup-guide-parse.d.ts +121 -0
- package/dist/setup-guide-parse.js +356 -0
- package/dist/setup-guide-render.d.ts +45 -0
- package/dist/setup-guide-render.js +351 -0
- package/dist/setup-guide.d.ts +108 -0
- package/dist/setup-guide.js +367 -0
- package/dist/shell-capabilities.d.ts +211 -0
- package/dist/shell-capabilities.js +44 -0
- package/dist/shell-environment.d.ts +57 -0
- package/dist/shell-environment.js +21 -0
- package/dist/skill.d.ts +27 -17
- package/dist/skill.js +40 -26
- package/dist/storage.d.ts +52 -25
- package/dist/svg-viewbox.d.ts +10 -0
- package/dist/svg-viewbox.js +24 -0
- package/dist/theme-assets.d.ts +55 -0
- package/dist/theme-assets.js +489 -0
- package/dist/theme-readability.d.ts +37 -0
- package/dist/theme-readability.js +145 -0
- package/dist/theme-tokens.generated.d.ts +299 -0
- package/dist/theme-tokens.generated.js +184 -0
- package/dist/theme.d.ts +190 -0
- package/dist/theme.js +471 -0
- package/dist/tool.d.ts +99 -26
- package/dist/tool.js +29 -9
- package/dist/ui-parts.d.ts +23 -0
- package/dist/ui-parts.js +385 -0
- package/dist/ui-resolve.d.ts +35 -0
- package/dist/ui-resolve.js +42 -0
- package/dist/ui-slots.d.ts +65 -0
- package/dist/ui-slots.js +261 -0
- package/dist/ui.d.ts +212 -76
- package/dist/ui.js +101 -27
- package/dist/url.d.ts +4 -1
- package/dist/url.js +4 -1
- package/package.json +13 -1
- package/schemas/bootstrap-extra.v1.schema.json +186 -0
- package/schemas/bootstrap.v1.schema.json +20 -0
- package/schemas/connector-template.v1.schema.json +35 -0
- package/schemas/marketplace.v1.schema.json +14 -0
- package/schemas/plugin.v1.schema.json +122 -3
- package/schemas/theme.v1.schema.json +302 -0
- package/agent-docs/extension-points/sandbox.md +0 -15
- package/dist/sandbox.d.ts +0 -254
- package/dist/sandbox.js +0 -153
package/dist/ui.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { validateInputForm } from "./tool.js";
|
|
2
2
|
import { isHttpUrl } from "./url.js";
|
|
3
|
-
/** A place with the old `conversation` mapped to `panel`. */
|
|
4
|
-
export function normalizePlace(place) {
|
|
5
|
-
return place === "conversation" ? "panel" : place;
|
|
6
|
-
}
|
|
7
3
|
/**
|
|
8
4
|
* Icons a contribution may use (design system icon names; `puzzle` is the default and is drawn as
|
|
9
5
|
* the design `extension` icon). The title-bar button of a panel shows it.
|
|
@@ -21,12 +17,14 @@ export const UI_ICONS = [
|
|
|
21
17
|
"puzzle",
|
|
22
18
|
];
|
|
23
19
|
/**
|
|
24
|
-
*
|
|
25
|
-
* - `blocks
|
|
26
|
-
* - `tableRows
|
|
27
|
-
*
|
|
28
|
-
* - `
|
|
29
|
-
* - `
|
|
20
|
+
* View limits (checked uniformly by {@link validateUiView}):
|
|
21
|
+
* - `blocks`: number of blocks;
|
|
22
|
+
* - `tableRows`: number of table rows, also used as the upper bound for keyValue items, table
|
|
23
|
+
* columns, chart points and buttons;
|
|
24
|
+
* - `checklistItems`: number of checklist items;
|
|
25
|
+
* - `textChars`: total characters of all text in the whole view (form JSON included);
|
|
26
|
+
* - `payloadBytes`: UTF-8 bytes of a single button `payload` after JSON serialization.
|
|
27
|
+
* - `componentDataBytes`: the UTF-8 bytes of a component view's `data` as JSON.
|
|
30
28
|
*/
|
|
31
29
|
export const UI_LIMITS = {
|
|
32
30
|
blocks: 50,
|
|
@@ -34,6 +32,7 @@ export const UI_LIMITS = {
|
|
|
34
32
|
checklistItems: 100,
|
|
35
33
|
textChars: 20000,
|
|
36
34
|
payloadBytes: 2000,
|
|
35
|
+
componentDataBytes: 32768,
|
|
37
36
|
};
|
|
38
37
|
const BADGE_MAX = 32;
|
|
39
38
|
/** Longest item / block `id` and open target `item`. */
|
|
@@ -46,7 +45,7 @@ const isObj = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
|
46
45
|
const MD_INLINE_LINK = /\]\(\s*<?([^\s)>]*)/g;
|
|
47
46
|
const MD_REF_DEF = /^ {0,3}\[[^\]\n]+\]:[ \t]*<?([^\s>]*)/gm;
|
|
48
47
|
const MD_AUTOLINK = /<([a-zA-Z][a-zA-Z0-9+.-]{1,31}:[^<>\s]*)>/g;
|
|
49
|
-
/** Markdown
|
|
48
|
+
/** Link / image targets in Markdown (inline, reference definitions, angle-bracket autolinks). */
|
|
50
49
|
function markdownLinks(md) {
|
|
51
50
|
const out = [];
|
|
52
51
|
for (const re of [MD_INLINE_LINK, MD_REF_DEF, MD_AUTOLINK]) {
|
|
@@ -55,7 +54,7 @@ function markdownLinks(md) {
|
|
|
55
54
|
}
|
|
56
55
|
return out;
|
|
57
56
|
}
|
|
58
|
-
/**
|
|
57
|
+
/** UTF-8 bytes after JSON serialization; undefined when not serializable. */
|
|
59
58
|
function jsonBytes(v) {
|
|
60
59
|
try {
|
|
61
60
|
const s = JSON.stringify(v);
|
|
@@ -65,15 +64,80 @@ function jsonBytes(v) {
|
|
|
65
64
|
return undefined;
|
|
66
65
|
}
|
|
67
66
|
}
|
|
67
|
+
const JSON_KINDS = "null, booleans, finite numbers, strings, arrays, plain objects";
|
|
68
|
+
/**
|
|
69
|
+
* The first part of `v` (`at` is its path) that JSON would not carry as is, or undefined: a value
|
|
70
|
+
* `JSON.stringify` drops, rewrites or throws on (a function, symbol or bigint, NaN or ±Infinity,
|
|
71
|
+
* `undefined` in an array, an object that is not plain such as a Map or a Date, a cycle). A plain
|
|
72
|
+
* object's `undefined` property is accepted: JSON drops it, which reads as an absent optional field.
|
|
73
|
+
*/
|
|
74
|
+
function jsonProblem(v, at, seen = new Set()) {
|
|
75
|
+
if (v === null || typeof v === "boolean" || typeof v === "string")
|
|
76
|
+
return undefined;
|
|
77
|
+
if (typeof v === "number")
|
|
78
|
+
return Number.isFinite(v) ? undefined : `${at} is ${v}`;
|
|
79
|
+
if (v === undefined)
|
|
80
|
+
return `${at} is undefined`;
|
|
81
|
+
if (typeof v !== "object")
|
|
82
|
+
return `${at} is a ${typeof v}`;
|
|
83
|
+
if (seen.has(v))
|
|
84
|
+
return `${at} is a cycle`;
|
|
85
|
+
seen.add(v);
|
|
86
|
+
try {
|
|
87
|
+
if (Array.isArray(v)) {
|
|
88
|
+
for (let i = 0; i < v.length; i++) {
|
|
89
|
+
const p = jsonProblem(v[i], `${at}[${i}]`, seen);
|
|
90
|
+
if (p !== undefined)
|
|
91
|
+
return p;
|
|
92
|
+
}
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
const proto = Object.getPrototypeOf(v);
|
|
96
|
+
if (proto !== Object.prototype && proto !== null) {
|
|
97
|
+
return `${at} is a ${proto.constructor?.name || "non-plain object"}`;
|
|
98
|
+
}
|
|
99
|
+
for (const [k, x] of Object.entries(v)) {
|
|
100
|
+
if (x === undefined)
|
|
101
|
+
continue;
|
|
102
|
+
const p = jsonProblem(x, `${at}.${k}`, seen);
|
|
103
|
+
if (p !== undefined)
|
|
104
|
+
return p;
|
|
105
|
+
}
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
finally {
|
|
109
|
+
seen.delete(v);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
68
112
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
113
|
+
* Validates the view a plugin returns and returns the list of problems (empty = valid). Links and
|
|
114
|
+
* images may only be absolute http(s) addresses;
|
|
115
|
+
* the Markdown check is defense in depth, and web rendering must still accept only http(s) links
|
|
116
|
+
* and not render native HTML.
|
|
117
|
+
* The `actionId` of buttons and forms is unique within the whole view (action callbacks tell the
|
|
118
|
+
* source by it).
|
|
119
|
+
* `data` is accepted only with `opts.component` (the view of a component contribution): JSON as is
|
|
120
|
+
* (nothing JSON would drop or rewrite, see `jsonProblem`), up to `UI_LIMITS.componentDataBytes`
|
|
121
|
+
* bytes of UTF-8.
|
|
72
122
|
*/
|
|
73
|
-
export function validateUiView(v) {
|
|
123
|
+
export function validateUiView(v, opts = {}) {
|
|
74
124
|
if (!isObj(v))
|
|
75
125
|
return ["view must be an object"];
|
|
76
126
|
const out = [];
|
|
127
|
+
if (v.data !== undefined) {
|
|
128
|
+
if (opts.component !== true)
|
|
129
|
+
out.push("view data is only allowed for component views");
|
|
130
|
+
else {
|
|
131
|
+
const problem = jsonProblem(v.data, "data");
|
|
132
|
+
if (problem !== undefined)
|
|
133
|
+
out.push(`view data must be JSON (${JSON_KINDS}): ${problem}`);
|
|
134
|
+
else {
|
|
135
|
+
const n = jsonBytes(v.data) ?? 0;
|
|
136
|
+
if (n > UI_LIMITS.componentDataBytes)
|
|
137
|
+
out.push(`view data is ${n} bytes; the limit is ${UI_LIMITS.componentDataBytes}`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
77
141
|
let chars = 0;
|
|
78
142
|
const text = (at, s, nonEmpty = false) => {
|
|
79
143
|
if (typeof s !== "string" || (nonEmpty && s === "")) {
|
|
@@ -286,22 +350,31 @@ export function validateUiView(v) {
|
|
|
286
350
|
out.push(`view text must be at most ${UI_LIMITS.textChars} characters in total`);
|
|
287
351
|
return out;
|
|
288
352
|
}
|
|
289
|
-
/**
|
|
353
|
+
/**
|
|
354
|
+
* The version marker of the `postMessage` protocol between the outer page and the embedded iframe.
|
|
355
|
+
*/
|
|
290
356
|
export const EMBED_PROTOCOL = "capybara-embed/1";
|
|
291
357
|
const NAV_MAX = 2000;
|
|
292
358
|
const RESIZE_MAX = 10000;
|
|
293
359
|
const TOAST_MAX = 500;
|
|
294
|
-
// capybara:embed-nav-begin
|
|
295
|
-
//
|
|
296
|
-
//
|
|
360
|
+
// capybara:embed-nav-begin (this section is verbatim identical in packages/plugin-sdk/src/ui.ts and apps/web/src/lib/embed-bridge.ts, checked by a test)
|
|
361
|
+
// Control characters and backslash: browsers treat `/\host` as `//host`, and strip newlines / tabs
|
|
362
|
+
// inside a path
|
|
363
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: control characters are exactly what must be rejected
|
|
297
364
|
const NAV_BAD = /[\u0000-\u001f\u007f\\]/;
|
|
298
|
-
/**
|
|
365
|
+
/**
|
|
366
|
+
* Encoded `/`, `\` and control characters in the path part (any case): decoding them would change
|
|
367
|
+
* the path structure.
|
|
368
|
+
*/
|
|
299
369
|
const NAV_BAD_ENCODED = /%(?:2f|5c|[01][0-9a-f]|7f)/i;
|
|
300
370
|
/**
|
|
301
|
-
*
|
|
302
|
-
*
|
|
303
|
-
*
|
|
304
|
-
*
|
|
371
|
+
* In-site path: starts with a single `/`, has no `//` anywhere, no control characters or
|
|
372
|
+
* backslashes; the path part has no `.` / `..` segments
|
|
373
|
+
* (including `%2e` in any case), no encoded `/` (`%2f`), `\` (`%5c`) or control characters
|
|
374
|
+
* (`%00`–`%1f`, `%7f`);
|
|
375
|
+
* and after URL normalization it is exactly identical to the original and does not start with `//`:
|
|
376
|
+
* normalization cannot turn it into another path,
|
|
377
|
+
* so handing it to in-site routing cannot jump outside the site or to a parent directory.
|
|
305
378
|
*/
|
|
306
379
|
function isInSitePath(p) {
|
|
307
380
|
if (!p.startsWith("/") || p.includes("//") || NAV_BAD.test(p))
|
|
@@ -325,8 +398,9 @@ function isInSitePath(p) {
|
|
|
325
398
|
}
|
|
326
399
|
// capybara:embed-nav-end
|
|
327
400
|
/**
|
|
328
|
-
*
|
|
329
|
-
*
|
|
401
|
+
* Parses a message sent by the iframe: returns it only when protocol, type and fields are all right
|
|
402
|
+
* (a new object keeping only known fields), otherwise null.
|
|
403
|
+
* The outer page must also first check that the message source is this iframe.
|
|
330
404
|
*/
|
|
331
405
|
export function parseEmbedChildMessage(m) {
|
|
332
406
|
if (!isObj(m) || m.protocol !== EMBED_PROTOCOL)
|
package/dist/url.d.ts
CHANGED
package/dist/url.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Internal helper (not exported by index.ts): whether it is an absolute http(s) address no longer
|
|
3
|
+
* than max.
|
|
4
|
+
*/
|
|
2
5
|
export function isHttpUrl(v, max = 2000) {
|
|
3
6
|
if (typeof v !== "string" || v.length > max)
|
|
4
7
|
return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capybara-hq/plugin-sdk",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.61",
|
|
4
4
|
"description": "Capybara plugin SDK: the types and pure functions plugins are written against",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"homepage": "https://github.com/capybara-hq/core/tree/main/packages/plugin-sdk#readme",
|
|
12
12
|
"type": "module",
|
|
13
|
+
"sideEffects": false,
|
|
13
14
|
"main": "./dist/index.js",
|
|
14
15
|
"types": "./dist/index.d.ts",
|
|
15
16
|
"exports": {
|
|
@@ -18,6 +19,11 @@
|
|
|
18
19
|
"import": "./dist/index.js",
|
|
19
20
|
"default": "./dist/index.js"
|
|
20
21
|
},
|
|
22
|
+
"./device-protocol": {
|
|
23
|
+
"types": "./dist/device-protocol.d.ts",
|
|
24
|
+
"import": "./dist/device-protocol.js",
|
|
25
|
+
"default": "./dist/device-protocol.js"
|
|
26
|
+
},
|
|
21
27
|
"./package.json": "./package.json"
|
|
22
28
|
},
|
|
23
29
|
"files": [
|
|
@@ -28,7 +34,13 @@
|
|
|
28
34
|
"NOTICE"
|
|
29
35
|
],
|
|
30
36
|
"dependencies": {
|
|
37
|
+
"@types/mdast": "4.0.4",
|
|
31
38
|
"kysely": "^0.29.6",
|
|
39
|
+
"mdast-util-from-markdown": "2.1.0",
|
|
40
|
+
"mdast-util-gfm": "3.1.0",
|
|
41
|
+
"mdast-util-to-markdown": "2.2.0",
|
|
42
|
+
"micromark-extension-gfm": "3.0.0",
|
|
43
|
+
"saxes": "6.0.0",
|
|
32
44
|
"semver": "^7.8.5",
|
|
33
45
|
"yaml": "^2.9.1",
|
|
34
46
|
"zod": "^4.6.7"
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://capybarahq.com/schemas/bootstrap-extra.v1.schema.json",
|
|
4
|
+
"title": "Capybara extra bootstrap manifest bootstrap.extra.json (schemaVersion 1)",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"$schema": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"maxLength": 2000
|
|
10
|
+
},
|
|
11
|
+
"schemaVersion": {
|
|
12
|
+
"type": "number",
|
|
13
|
+
"const": 1
|
|
14
|
+
},
|
|
15
|
+
"marketplaces": {
|
|
16
|
+
"maxItems": 50,
|
|
17
|
+
"type": "array",
|
|
18
|
+
"items": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"properties": {
|
|
21
|
+
"name": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
|
|
24
|
+
},
|
|
25
|
+
"url": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"maxLength": 2000,
|
|
28
|
+
"pattern": "^https:\\/\\/\\S+$"
|
|
29
|
+
},
|
|
30
|
+
"ref": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"minLength": 1,
|
|
33
|
+
"maxLength": 256
|
|
34
|
+
},
|
|
35
|
+
"username": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"pattern": "^[A-Za-z0-9._-]{1,64}$"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"required": [
|
|
41
|
+
"name",
|
|
42
|
+
"url"
|
|
43
|
+
],
|
|
44
|
+
"additionalProperties": false
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"plugins": {
|
|
48
|
+
"maxItems": 500,
|
|
49
|
+
"type": "array",
|
|
50
|
+
"items": {
|
|
51
|
+
"oneOf": [
|
|
52
|
+
{
|
|
53
|
+
"type": "object",
|
|
54
|
+
"properties": {
|
|
55
|
+
"name": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
|
|
58
|
+
},
|
|
59
|
+
"version": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"maxLength": 256,
|
|
62
|
+
"pattern": "^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$"
|
|
63
|
+
},
|
|
64
|
+
"integrity": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"pattern": "^sha512-[A-Za-z0-9+/]{86}==$"
|
|
67
|
+
},
|
|
68
|
+
"required": {
|
|
69
|
+
"type": "boolean"
|
|
70
|
+
},
|
|
71
|
+
"builtin": {
|
|
72
|
+
"type": "boolean"
|
|
73
|
+
},
|
|
74
|
+
"scope": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"enum": [
|
|
77
|
+
"all",
|
|
78
|
+
"optional"
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
"source": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"const": "npm"
|
|
84
|
+
},
|
|
85
|
+
"npm": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"maxLength": 214,
|
|
88
|
+
"pattern": "^(?:@[a-z0-9][a-z0-9._~-]*\\/)?[a-z0-9][a-z0-9._~-]*$"
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"required": [
|
|
92
|
+
"name",
|
|
93
|
+
"version",
|
|
94
|
+
"integrity",
|
|
95
|
+
"source",
|
|
96
|
+
"npm"
|
|
97
|
+
],
|
|
98
|
+
"additionalProperties": false
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"type": "object",
|
|
102
|
+
"properties": {
|
|
103
|
+
"name": {
|
|
104
|
+
"type": "string",
|
|
105
|
+
"pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
|
|
106
|
+
},
|
|
107
|
+
"version": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"maxLength": 256,
|
|
110
|
+
"pattern": "^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(?:\\+[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*)?$"
|
|
111
|
+
},
|
|
112
|
+
"integrity": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"pattern": "^sha512-[A-Za-z0-9+/]{86}==$"
|
|
115
|
+
},
|
|
116
|
+
"required": {
|
|
117
|
+
"type": "boolean"
|
|
118
|
+
},
|
|
119
|
+
"builtin": {
|
|
120
|
+
"type": "boolean"
|
|
121
|
+
},
|
|
122
|
+
"scope": {
|
|
123
|
+
"type": "string",
|
|
124
|
+
"enum": [
|
|
125
|
+
"all",
|
|
126
|
+
"optional"
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
"source": {
|
|
130
|
+
"type": "string",
|
|
131
|
+
"const": "git"
|
|
132
|
+
},
|
|
133
|
+
"marketplace": {
|
|
134
|
+
"type": "string",
|
|
135
|
+
"pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
|
|
136
|
+
},
|
|
137
|
+
"commit": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"pattern": "^[0-9a-f]{40}$"
|
|
140
|
+
},
|
|
141
|
+
"path": {
|
|
142
|
+
"type": "string",
|
|
143
|
+
"maxLength": 512
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"required": [
|
|
147
|
+
"name",
|
|
148
|
+
"version",
|
|
149
|
+
"integrity",
|
|
150
|
+
"source",
|
|
151
|
+
"marketplace",
|
|
152
|
+
"commit",
|
|
153
|
+
"path"
|
|
154
|
+
],
|
|
155
|
+
"additionalProperties": false
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"defaultTheme": {
|
|
161
|
+
"type": "object",
|
|
162
|
+
"properties": {
|
|
163
|
+
"plugin": {
|
|
164
|
+
"type": "string",
|
|
165
|
+
"pattern": "^[a-z0-9][a-z0-9-]{0,63}$"
|
|
166
|
+
},
|
|
167
|
+
"theme": {
|
|
168
|
+
"type": "string",
|
|
169
|
+
"minLength": 1,
|
|
170
|
+
"maxLength": 256
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"required": [
|
|
174
|
+
"plugin",
|
|
175
|
+
"theme"
|
|
176
|
+
],
|
|
177
|
+
"additionalProperties": false
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"required": [
|
|
181
|
+
"schemaVersion",
|
|
182
|
+
"marketplaces",
|
|
183
|
+
"plugins"
|
|
184
|
+
],
|
|
185
|
+
"additionalProperties": false
|
|
186
|
+
}
|
|
@@ -55,6 +55,16 @@
|
|
|
55
55
|
"required": {
|
|
56
56
|
"type": "boolean"
|
|
57
57
|
},
|
|
58
|
+
"builtin": {
|
|
59
|
+
"type": "boolean"
|
|
60
|
+
},
|
|
61
|
+
"scope": {
|
|
62
|
+
"type": "string",
|
|
63
|
+
"enum": [
|
|
64
|
+
"all",
|
|
65
|
+
"optional"
|
|
66
|
+
]
|
|
67
|
+
},
|
|
58
68
|
"source": {
|
|
59
69
|
"type": "string",
|
|
60
70
|
"const": "npm"
|
|
@@ -94,6 +104,16 @@
|
|
|
94
104
|
"required": {
|
|
95
105
|
"type": "boolean"
|
|
96
106
|
},
|
|
107
|
+
"builtin": {
|
|
108
|
+
"type": "boolean"
|
|
109
|
+
},
|
|
110
|
+
"scope": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"enum": [
|
|
113
|
+
"all",
|
|
114
|
+
"optional"
|
|
115
|
+
]
|
|
116
|
+
},
|
|
97
117
|
"source": {
|
|
98
118
|
"type": "string",
|
|
99
119
|
"const": "workspace"
|
|
@@ -36,6 +36,9 @@
|
|
|
36
36
|
"type": "string",
|
|
37
37
|
"maxLength": 512
|
|
38
38
|
},
|
|
39
|
+
"defaultEnabled": {
|
|
40
|
+
"type": "boolean"
|
|
41
|
+
},
|
|
39
42
|
"template": {
|
|
40
43
|
"type": "object",
|
|
41
44
|
"properties": {
|
|
@@ -94,6 +97,38 @@
|
|
|
94
97
|
]
|
|
95
98
|
}
|
|
96
99
|
},
|
|
100
|
+
"git": {
|
|
101
|
+
"type": "object",
|
|
102
|
+
"properties": {
|
|
103
|
+
"hosts": {
|
|
104
|
+
"minItems": 1,
|
|
105
|
+
"maxItems": 8,
|
|
106
|
+
"type": "array",
|
|
107
|
+
"items": {
|
|
108
|
+
"type": "object",
|
|
109
|
+
"properties": {
|
|
110
|
+
"host": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"maxLength": 253
|
|
113
|
+
},
|
|
114
|
+
"username": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"pattern": "^[A-Za-z0-9._-]{1,64}$"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"required": [
|
|
120
|
+
"host",
|
|
121
|
+
"username"
|
|
122
|
+
],
|
|
123
|
+
"additionalProperties": false
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"required": [
|
|
128
|
+
"hosts"
|
|
129
|
+
],
|
|
130
|
+
"additionalProperties": false
|
|
131
|
+
},
|
|
97
132
|
"icon": {
|
|
98
133
|
"type": "string",
|
|
99
134
|
"maxLength": 512
|
|
@@ -129,6 +129,20 @@
|
|
|
129
129
|
"maxLength": 2000,
|
|
130
130
|
"pattern": "^https:\\/\\/\\S+$"
|
|
131
131
|
},
|
|
132
|
+
"icon": {
|
|
133
|
+
"anyOf": [
|
|
134
|
+
{
|
|
135
|
+
"type": "string",
|
|
136
|
+
"maxLength": 2000,
|
|
137
|
+
"pattern": "^https:\\/\\/[^\\s?#]+\\.(?:[sS][vV][gG]|[pP][nN][gG])(?:\\?[^\\s#]*)?$"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"type": "string",
|
|
141
|
+
"maxLength": 512,
|
|
142
|
+
"pattern": "^\\.\\/[^\\s?#]+\\.(?:[sS][vV][gG]|[pP][nN][gG])$"
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
},
|
|
132
146
|
"deprecated": {
|
|
133
147
|
"anyOf": [
|
|
134
148
|
{
|