@capybara-hq/plugin-sdk 0.1.0-rc.13 → 0.1.0-rc.15
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/dist/bootstrap.d.ts +15 -1
- package/dist/bootstrap.js +17 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/ui-parts.d.ts +2 -2
- package/dist/ui-parts.js +102 -3
- package/package.json +1 -1
- package/schemas/bootstrap.v1.schema.json +6 -0
package/dist/bootstrap.d.ts
CHANGED
|
@@ -9,11 +9,19 @@ import { z } from "zod";
|
|
|
9
9
|
* the official plugins are published: `path` is packed with `packages/plugin-tools`, which is
|
|
10
10
|
* byte-reproducible, and `integrity` is that pack's sha512).
|
|
11
11
|
*
|
|
12
|
+
* `required` and `builtin` are two different promises. A required entry is imported in the first
|
|
13
|
+
* pass, before the extensions load, and the start fails without it (so it can ship no skills or
|
|
14
|
+
* templates: those need object storage, which is not running then). A `builtin` entry is imported
|
|
15
|
+
* once the extensions have loaded (object storage available), so it may ship skills; its failure
|
|
16
|
+
* is logged and retried on the next start. Both give the plugin a builtin catalog item (scope
|
|
17
|
+
* `all`, on in every org, not switchable) and are imported again when missing. An entry is never
|
|
18
|
+
* both.
|
|
19
|
+
*
|
|
12
20
|
* Objects are strict (unknown keys rejected, `$schema` allowed): the manifest ships with core, so
|
|
13
21
|
* there is no older reader to stay compatible with and a misspelt key is a mistake. The committed
|
|
14
22
|
* JSON Schema (`schemas/bootstrap.v1.schema.json`) is generated from {@link BootstrapManifestSchema}
|
|
15
23
|
* by `pnpm gen:package-schemas`; the cross-field rules (unique names, `marketplace` required with an
|
|
16
|
-
* npm entry) are decided only by {@link parseBootstrapManifest}.
|
|
24
|
+
* npm entry, not both `required` and `builtin`) are decided only by {@link parseBootstrapManifest}.
|
|
17
25
|
*/
|
|
18
26
|
/** Manifest format version. */
|
|
19
27
|
export declare const BOOTSTRAP_MANIFEST_SCHEMA_VERSION = 1;
|
|
@@ -30,6 +38,11 @@ export type BootstrapEntry = {
|
|
|
30
38
|
integrity: string;
|
|
31
39
|
/** Enabled in every org and neither disableable nor uninstallable. */
|
|
32
40
|
required: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Builtin but not required: imported after the extensions loaded (it may ship skills), its
|
|
43
|
+
* catalog item builtin; a failure does not stop the start. Never together with `required`.
|
|
44
|
+
*/
|
|
45
|
+
builtin?: boolean;
|
|
33
46
|
} | {
|
|
34
47
|
name: string;
|
|
35
48
|
source: "workspace";
|
|
@@ -38,6 +51,7 @@ export type BootstrapEntry = {
|
|
|
38
51
|
version: string;
|
|
39
52
|
integrity: string;
|
|
40
53
|
required: boolean;
|
|
54
|
+
builtin?: boolean;
|
|
41
55
|
};
|
|
42
56
|
/** `bootstrap.json`. */
|
|
43
57
|
export interface BootstrapManifest {
|
package/dist/bootstrap.js
CHANGED
|
@@ -10,11 +10,19 @@ import { CATALOG_ITEM_NAME_RE, NPM_PACKAGE_NAME_RE, SEMVER_VERSION_RE, SHA512_IN
|
|
|
10
10
|
* the official plugins are published: `path` is packed with `packages/plugin-tools`, which is
|
|
11
11
|
* byte-reproducible, and `integrity` is that pack's sha512).
|
|
12
12
|
*
|
|
13
|
+
* `required` and `builtin` are two different promises. A required entry is imported in the first
|
|
14
|
+
* pass, before the extensions load, and the start fails without it (so it can ship no skills or
|
|
15
|
+
* templates: those need object storage, which is not running then). A `builtin` entry is imported
|
|
16
|
+
* once the extensions have loaded (object storage available), so it may ship skills; its failure
|
|
17
|
+
* is logged and retried on the next start. Both give the plugin a builtin catalog item (scope
|
|
18
|
+
* `all`, on in every org, not switchable) and are imported again when missing. An entry is never
|
|
19
|
+
* both.
|
|
20
|
+
*
|
|
13
21
|
* Objects are strict (unknown keys rejected, `$schema` allowed): the manifest ships with core, so
|
|
14
22
|
* there is no older reader to stay compatible with and a misspelt key is a mistake. The committed
|
|
15
23
|
* JSON Schema (`schemas/bootstrap.v1.schema.json`) is generated from {@link BootstrapManifestSchema}
|
|
16
24
|
* by `pnpm gen:package-schemas`; the cross-field rules (unique names, `marketplace` required with an
|
|
17
|
-
* npm entry) are decided only by {@link parseBootstrapManifest}.
|
|
25
|
+
* npm entry, not both `required` and `builtin`) are decided only by {@link parseBootstrapManifest}.
|
|
18
26
|
*/
|
|
19
27
|
/** Manifest format version. */
|
|
20
28
|
export const BOOTSTRAP_MANIFEST_SCHEMA_VERSION = 1;
|
|
@@ -35,6 +43,7 @@ const common = {
|
|
|
35
43
|
.string()
|
|
36
44
|
.regex(SHA512_INTEGRITY_RE, { message: "integrity must be sha512-<86 base64 chars>==" }),
|
|
37
45
|
required: z.boolean(),
|
|
46
|
+
builtin: z.boolean().optional(),
|
|
38
47
|
};
|
|
39
48
|
const entry = z.discriminatedUnion("source", [
|
|
40
49
|
z.strictObject({
|
|
@@ -74,6 +83,13 @@ const schema = z
|
|
|
74
83
|
});
|
|
75
84
|
}
|
|
76
85
|
seen.add(e.name);
|
|
86
|
+
if (e.required && e.builtin === true) {
|
|
87
|
+
ctx.addIssue({
|
|
88
|
+
code: "custom",
|
|
89
|
+
path: ["plugins", i, "builtin"],
|
|
90
|
+
message: "an entry is either required or builtin, not both",
|
|
91
|
+
});
|
|
92
|
+
}
|
|
77
93
|
});
|
|
78
94
|
if (m.marketplace === undefined && m.plugins.some((e) => e.source === "npm")) {
|
|
79
95
|
ctx.addIssue({
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/ui-parts.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** The ARIA / data states a part promises (client extensions spec §7.1). */
|
|
2
|
-
export type UiPartState = "aria-current" | "aria-selected" | "aria-expanded" | "aria-busy" | "disabled";
|
|
2
|
+
export type UiPartState = "aria-current" | "aria-selected" | "aria-expanded" | "aria-busy" | "aria-checked" | "aria-pressed" | "disabled";
|
|
3
3
|
/** Every part name of the catalog, in catalog order. */
|
|
4
|
-
export declare const UI_PART_NAMES: readonly ["shell", "sidebar", "sidebar.brand", "sidebar.item", "title-bar", "page-header", "thread", "message.user", "message.assistant", "tool-row", "composer", "properties-panel", "section", "right-panel", "status-bar", "button", "button.primary", "card", "input", "dialog"];
|
|
4
|
+
export declare const UI_PART_NAMES: readonly ["shell", "sidebar", "sidebar.brand", "sidebar.item", "title-bar", "page-header", "thread", "message.user", "message.user.bubble", "message.assistant", "tool-row", "composer", "properties-panel", "section", "right-panel", "status-bar", "button", "button.primary", "card", "input", "dialog", "code-block", "menu", "segmented", "stat-card", "switch", "switch.knob", "org-avatar", "agent-chip"];
|
|
5
5
|
export type UiPartName = (typeof UI_PART_NAMES)[number];
|
|
6
6
|
/** One built-in element plugin CSS may select with `[data-cap-part~="<name>"]`. */
|
|
7
7
|
export interface UiPartSpec {
|
package/dist/ui-parts.js
CHANGED
|
@@ -8,6 +8,7 @@ export const UI_PART_NAMES = [
|
|
|
8
8
|
"page-header",
|
|
9
9
|
"thread",
|
|
10
10
|
"message.user",
|
|
11
|
+
"message.user.bubble",
|
|
11
12
|
"message.assistant",
|
|
12
13
|
"tool-row",
|
|
13
14
|
"composer",
|
|
@@ -20,6 +21,14 @@ export const UI_PART_NAMES = [
|
|
|
20
21
|
"card",
|
|
21
22
|
"input",
|
|
22
23
|
"dialog",
|
|
24
|
+
"code-block",
|
|
25
|
+
"menu",
|
|
26
|
+
"segmented",
|
|
27
|
+
"stat-card",
|
|
28
|
+
"switch",
|
|
29
|
+
"switch.knob",
|
|
30
|
+
"org-avatar",
|
|
31
|
+
"agent-chip",
|
|
23
32
|
];
|
|
24
33
|
export const UI_PARTS = [
|
|
25
34
|
{
|
|
@@ -105,14 +114,24 @@ export const UI_PARTS = [
|
|
|
105
114
|
zh: "用户发出的消息。",
|
|
106
115
|
},
|
|
107
116
|
},
|
|
117
|
+
{
|
|
118
|
+
name: "message.user.bubble",
|
|
119
|
+
version: 1,
|
|
120
|
+
owner: ["packages/design/src/conversation/bubble.tsx"],
|
|
121
|
+
states: [],
|
|
122
|
+
description: {
|
|
123
|
+
en: "The bubble of a person's message (inside the full-width `message.user` row).",
|
|
124
|
+
zh: "用户消息的气泡本身(在占满宽度的 message.user 行之内)。",
|
|
125
|
+
},
|
|
126
|
+
},
|
|
108
127
|
{
|
|
109
128
|
name: "message.assistant",
|
|
110
129
|
version: 1,
|
|
111
130
|
owner: ["apps/web/src/components/conversation/Thread.tsx"],
|
|
112
|
-
states: [],
|
|
131
|
+
states: ["aria-busy"],
|
|
113
132
|
description: {
|
|
114
|
-
en: "An assistant turn.",
|
|
115
|
-
zh: "
|
|
133
|
+
en: "An assistant turn; `aria-busy` while its text is still streaming (the live reply).",
|
|
134
|
+
zh: "智能体的一轮回复;正在流式输出时带 aria-busy(正在生成的回复)。",
|
|
116
135
|
},
|
|
117
136
|
},
|
|
118
137
|
{
|
|
@@ -232,6 +251,86 @@ export const UI_PARTS = [
|
|
|
232
251
|
zh: "对话框或抽屉。",
|
|
233
252
|
},
|
|
234
253
|
},
|
|
254
|
+
{
|
|
255
|
+
name: "code-block",
|
|
256
|
+
version: 1,
|
|
257
|
+
owner: ["packages/design/src/display/chat.tsx"],
|
|
258
|
+
states: [],
|
|
259
|
+
description: {
|
|
260
|
+
en: "A code block (Markdown code, setup guides, diffs).",
|
|
261
|
+
zh: "代码块(Markdown 代码、设置指引、差异)。",
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
name: "menu",
|
|
266
|
+
version: 1,
|
|
267
|
+
owner: ["packages/design/src/overlays/menus.tsx", "packages/design/src/conversation/menu.tsx"],
|
|
268
|
+
states: [],
|
|
269
|
+
description: {
|
|
270
|
+
en: "A menu, submenu, popover or the composer's menus.",
|
|
271
|
+
zh: "菜单、子菜单、弹出层或输入框的菜单。",
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
name: "segmented",
|
|
276
|
+
version: 1,
|
|
277
|
+
owner: ["packages/design/src/display/tabs.tsx"],
|
|
278
|
+
states: [],
|
|
279
|
+
description: {
|
|
280
|
+
en: "A segmented control (its segments are radios with `aria-checked`).",
|
|
281
|
+
zh: "分段控件(各段是带 aria-checked 的单选项)。",
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
name: "stat-card",
|
|
286
|
+
version: 1,
|
|
287
|
+
owner: ["packages/design/src/display/stat-cards.tsx"],
|
|
288
|
+
states: [],
|
|
289
|
+
description: {
|
|
290
|
+
en: "A metric card of a StatCards row.",
|
|
291
|
+
zh: "指标卡片行里的一张指标卡。",
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
name: "switch",
|
|
296
|
+
version: 1,
|
|
297
|
+
owner: ["packages/design/src/controls/toggles.tsx"],
|
|
298
|
+
states: ["aria-checked", "disabled"],
|
|
299
|
+
description: {
|
|
300
|
+
en: "A switch; `aria-checked` says on or off.",
|
|
301
|
+
zh: "开关;aria-checked 表示开或关。",
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
name: "switch.knob",
|
|
306
|
+
version: 1,
|
|
307
|
+
owner: ["packages/design/src/controls/toggles.tsx"],
|
|
308
|
+
states: [],
|
|
309
|
+
description: {
|
|
310
|
+
en: "The knob inside a `switch` (style it from the switch's state).",
|
|
311
|
+
zh: "开关里的滑块(按所在开关的状态设置样式)。",
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
name: "org-avatar",
|
|
316
|
+
version: 1,
|
|
317
|
+
owner: ["packages/design/src/shell/sidebar.tsx"],
|
|
318
|
+
states: [],
|
|
319
|
+
description: {
|
|
320
|
+
en: "The org's initial block in the sidebar's org switcher.",
|
|
321
|
+
zh: "侧边栏组织切换器里的组织首字方块。",
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
name: "agent-chip",
|
|
326
|
+
version: 1,
|
|
327
|
+
owner: ["packages/design/src/conversation/agent-row.tsx"],
|
|
328
|
+
states: ["aria-pressed"],
|
|
329
|
+
description: {
|
|
330
|
+
en: "An agent chip of the new conversation's agents row; `aria-pressed` on the selected one.",
|
|
331
|
+
zh: "新会话智能体行里的智能体标签;选中的那个带 aria-pressed。",
|
|
332
|
+
},
|
|
333
|
+
},
|
|
235
334
|
];
|
|
236
335
|
export function uiPart(name) {
|
|
237
336
|
return UI_PARTS.find((p) => p.name === name);
|
package/package.json
CHANGED
|
@@ -55,6 +55,9 @@
|
|
|
55
55
|
"required": {
|
|
56
56
|
"type": "boolean"
|
|
57
57
|
},
|
|
58
|
+
"builtin": {
|
|
59
|
+
"type": "boolean"
|
|
60
|
+
},
|
|
58
61
|
"source": {
|
|
59
62
|
"type": "string",
|
|
60
63
|
"const": "npm"
|
|
@@ -94,6 +97,9 @@
|
|
|
94
97
|
"required": {
|
|
95
98
|
"type": "boolean"
|
|
96
99
|
},
|
|
100
|
+
"builtin": {
|
|
101
|
+
"type": "boolean"
|
|
102
|
+
},
|
|
97
103
|
"source": {
|
|
98
104
|
"type": "string",
|
|
99
105
|
"const": "workspace"
|