@capybara-hq/plugin-sdk 0.1.0-rc.43 → 0.1.0-rc.45
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/device-protocol.d.ts +8 -0
- package/dist/device-protocol.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/shell-capabilities.d.ts +113 -0
- package/dist/shell-capabilities.js +19 -0
- package/dist/shell-environment.js +5 -0
- package/dist/theme-tokens.generated.d.ts +14 -2
- package/dist/theme-tokens.generated.js +8 -0
- package/package.json +1 -1
|
@@ -101,6 +101,14 @@ export interface LegacyDeviceHello {
|
|
|
101
101
|
* A malformed value is dropped by the parser.
|
|
102
102
|
*/
|
|
103
103
|
bootId?: string;
|
|
104
|
+
/**
|
|
105
|
+
* The identity of this run of the program: random, chosen once when the process starts and
|
|
106
|
+
* the same on every connection it makes (never the OS pid). The results a program keeps for a
|
|
107
|
+
* reconnect live in its memory, so a value that differs from the one a request was sent to
|
|
108
|
+
* proves that request's result can no longer arrive: the kernel ends its wait at once instead of
|
|
109
|
+
* at the deadline. Same format as {@link bootId}; a malformed value is dropped by the parser.
|
|
110
|
+
*/
|
|
111
|
+
programRunId?: string;
|
|
104
112
|
}
|
|
105
113
|
/** A hello's `bootId`: 1 to 128 characters of letters, digits, `.`, `_`, `:` and `-`. */
|
|
106
114
|
export declare const DEVICE_BOOT_ID_RE: RegExp;
|
package/dist/device-protocol.js
CHANGED
|
@@ -278,6 +278,8 @@ function optionalHelloFields(o) {
|
|
|
278
278
|
}
|
|
279
279
|
if (isDeviceBootId(o.bootId))
|
|
280
280
|
out.bootId = o.bootId;
|
|
281
|
+
if (isDeviceBootId(o.programRunId))
|
|
282
|
+
out.programRunId = o.programRunId;
|
|
281
283
|
return { ...out, ...optionalPolicy(o.policy) };
|
|
282
284
|
}
|
|
283
285
|
/** A summary field that is dropped when absent or unreadable. */
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -6,10 +6,16 @@
|
|
|
6
6
|
*/
|
|
7
7
|
/** Capability keys, `name@major`; each value is a key of `SHELL_CAPABILITIES`. */
|
|
8
8
|
export declare const SHELL_CAPABILITY_KEYS: {
|
|
9
|
+
readonly chrome: "chrome@1";
|
|
9
10
|
readonly device: "device@1";
|
|
10
11
|
readonly notify: "notify@1";
|
|
11
12
|
readonly openExternal: "openExternal@1";
|
|
12
13
|
readonly signIn: "signIn@1";
|
|
14
|
+
readonly haptics: "haptics@1";
|
|
15
|
+
readonly share: "share@1";
|
|
16
|
+
readonly menu: "menu@1";
|
|
17
|
+
readonly nav: "nav@1";
|
|
18
|
+
readonly profiles: "profiles@1";
|
|
13
19
|
};
|
|
14
20
|
export type KeepAwakeMode = "off" | "while-busy" | "connected";
|
|
15
21
|
export type DeviceConnection = "starting" | "online" | "offline" | "draining" | "stopped";
|
|
@@ -86,3 +92,110 @@ export interface OpenExternalCapabilityV1 {
|
|
|
86
92
|
export interface SignInCapabilityV1 {
|
|
87
93
|
start(): Promise<"signedIn" | "cancelled">;
|
|
88
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* The page's main color tokens (the computed `--cb-bg`, `--cb-panel`, `--cb-ink`, `--cb-muted`,
|
|
97
|
+
* `--cb-line`, `--cb-accent`, `--cb-on-accent`), each a CSS hex or `rgb()` / `rgba()` color. The
|
|
98
|
+
* shell validates them and uses them only as custom properties of its own pages, never as markup.
|
|
99
|
+
*/
|
|
100
|
+
export interface ShellChromeTokens {
|
|
101
|
+
bg: string;
|
|
102
|
+
panel: string;
|
|
103
|
+
ink: string;
|
|
104
|
+
muted: string;
|
|
105
|
+
line: string;
|
|
106
|
+
accent: string;
|
|
107
|
+
onAccent: string;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* `chrome@1` (mobile layout spec §9.2): the native chrome (window background, title bar, the
|
|
111
|
+
* shell's own pages) follows the page's theme. `tokens` is sent only when all seven are colors;
|
|
112
|
+
* `singleScheme` is true under a UI theme with one scheme (no light / dark toggle on either side).
|
|
113
|
+
*/
|
|
114
|
+
export interface ChromeCapabilityV1 {
|
|
115
|
+
setAppearance(input: {
|
|
116
|
+
scheme: "light" | "dark";
|
|
117
|
+
background: string;
|
|
118
|
+
tokens?: ShellChromeTokens;
|
|
119
|
+
singleScheme?: boolean;
|
|
120
|
+
}): Promise<void>;
|
|
121
|
+
/** The web's first paint is done (mobile app spec §5.2); a shell may leave it out. */
|
|
122
|
+
ready?(): Promise<void>;
|
|
123
|
+
}
|
|
124
|
+
export type HapticKind = "selection" | "light" | "success" | "warning";
|
|
125
|
+
/** `haptics@1`: a haptic impact (mobile app spec §5.2). */
|
|
126
|
+
export interface HapticsCapabilityV1 {
|
|
127
|
+
impact(kind: HapticKind): Promise<void>;
|
|
128
|
+
}
|
|
129
|
+
export interface ShareInputV1 {
|
|
130
|
+
title?: string;
|
|
131
|
+
text?: string;
|
|
132
|
+
url?: string;
|
|
133
|
+
}
|
|
134
|
+
/** `share@1`: the system share sheet; resolves whether shared or dismissed. */
|
|
135
|
+
export interface ShareCapabilityV1 {
|
|
136
|
+
share(input: ShareInputV1): Promise<void>;
|
|
137
|
+
}
|
|
138
|
+
export interface MenuItemV1 {
|
|
139
|
+
id: string;
|
|
140
|
+
label: string;
|
|
141
|
+
destructive?: boolean;
|
|
142
|
+
disabled?: boolean;
|
|
143
|
+
}
|
|
144
|
+
export interface MenuInputV1 {
|
|
145
|
+
title?: string;
|
|
146
|
+
items: MenuItemV1[];
|
|
147
|
+
/** A rect in CSS px from the web view's top-left corner. */
|
|
148
|
+
anchor?: {
|
|
149
|
+
x: number;
|
|
150
|
+
y: number;
|
|
151
|
+
width: number;
|
|
152
|
+
height: number;
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
/** `menu@1`: a native menu; resolves the chosen item id, or null when dismissed. */
|
|
156
|
+
export interface MenuCapabilityV1 {
|
|
157
|
+
show(input: MenuInputV1): Promise<string | null>;
|
|
158
|
+
}
|
|
159
|
+
/** The shell validates every input against these (and the web keeps within them). */
|
|
160
|
+
export declare const MOBILE_SHELL_LIMITS: {
|
|
161
|
+
readonly menuItems: 12;
|
|
162
|
+
readonly menuLabel: 64;
|
|
163
|
+
readonly menuTitle: 128;
|
|
164
|
+
readonly shareTitle: 256;
|
|
165
|
+
readonly shareText: 4000;
|
|
166
|
+
readonly url: 2048;
|
|
167
|
+
};
|
|
168
|
+
/** The menu item id pattern, checked on `menu@1.show` (the shell validates every input). */
|
|
169
|
+
export declare const MENU_ITEM_ID: RegExp;
|
|
170
|
+
export type NavSectionId = "chats" | "inbox" | "agents" | "schedules";
|
|
171
|
+
/** The strip's sections in display order. */
|
|
172
|
+
export declare const NAV_SECTION_ORDER: readonly NavSectionId[];
|
|
173
|
+
export interface NavBadgeV1 {
|
|
174
|
+
count?: number;
|
|
175
|
+
countMore?: boolean;
|
|
176
|
+
}
|
|
177
|
+
export interface NavItemV1 extends NavBadgeV1 {
|
|
178
|
+
id: NavSectionId;
|
|
179
|
+
label: string;
|
|
180
|
+
}
|
|
181
|
+
export interface NavMenuV1 extends NavBadgeV1 {
|
|
182
|
+
label: string;
|
|
183
|
+
}
|
|
184
|
+
export interface NavStateV1 {
|
|
185
|
+
/** The sections the person sees, in NAV_SECTION_ORDER (a guest has no `schedules`). */
|
|
186
|
+
items: NavItemV1[];
|
|
187
|
+
current: NavSectionId | null;
|
|
188
|
+
/** The strip's menu button, or null for none (non-null while the web's class is compact). */
|
|
189
|
+
menu: NavMenuV1 | null;
|
|
190
|
+
}
|
|
191
|
+
/** `nav@1`: offered only while the window has a strip (mobile app spec §6.1): presence is visibility. */
|
|
192
|
+
export interface NavCapabilityV1 {
|
|
193
|
+
set(state: NavStateV1): Promise<void>;
|
|
194
|
+
onSelect(listener: (id: NavSectionId) => void): () => void;
|
|
195
|
+
onMenu(listener: () => void): () => void;
|
|
196
|
+
}
|
|
197
|
+
/** `profiles@1`: the native profile switcher. */
|
|
198
|
+
export interface ProfilesCapabilityV1 {
|
|
199
|
+
/** Opens the native profile switcher; resolves when it closes, with nothing. */
|
|
200
|
+
show(): Promise<void>;
|
|
201
|
+
}
|
|
@@ -6,8 +6,27 @@
|
|
|
6
6
|
*/
|
|
7
7
|
/** Capability keys, `name@major`; each value is a key of `SHELL_CAPABILITIES`. */
|
|
8
8
|
export const SHELL_CAPABILITY_KEYS = {
|
|
9
|
+
chrome: "chrome@1",
|
|
9
10
|
device: "device@1",
|
|
10
11
|
notify: "notify@1",
|
|
11
12
|
openExternal: "openExternal@1",
|
|
12
13
|
signIn: "signIn@1",
|
|
14
|
+
haptics: "haptics@1",
|
|
15
|
+
share: "share@1",
|
|
16
|
+
menu: "menu@1",
|
|
17
|
+
nav: "nav@1",
|
|
18
|
+
profiles: "profiles@1",
|
|
13
19
|
};
|
|
20
|
+
/** The shell validates every input against these (and the web keeps within them). */
|
|
21
|
+
export const MOBILE_SHELL_LIMITS = {
|
|
22
|
+
menuItems: 12,
|
|
23
|
+
menuLabel: 64,
|
|
24
|
+
menuTitle: 128,
|
|
25
|
+
shareTitle: 256,
|
|
26
|
+
shareText: 4000,
|
|
27
|
+
url: 2048,
|
|
28
|
+
};
|
|
29
|
+
/** The menu item id pattern, checked on `menu@1.show` (the shell validates every input). */
|
|
30
|
+
export const MENU_ITEM_ID = /^[A-Za-z0-9_.-]{1,64}$/;
|
|
31
|
+
/** The strip's sections in display order. */
|
|
32
|
+
export const NAV_SECTION_ORDER = ["chats", "inbox", "agents", "schedules"];
|
|
@@ -13,4 +13,9 @@ export const SHELL_CAPABILITIES = [
|
|
|
13
13
|
{ key: "openExternal@1", owner: "desktop client spec (2026-11-07-desktop-client-design.md)" },
|
|
14
14
|
{ key: "signIn@1", owner: "desktop client spec (2026-11-07-desktop-client-design.md), §6.5" },
|
|
15
15
|
{ key: "chrome@1", owner: "mobile layout spec (2026-11-19-mobile-layout-design.md)" },
|
|
16
|
+
{ key: "haptics@1", owner: "mobile app spec (2026-11-20-mobile-app-design.md), §5.2" },
|
|
17
|
+
{ key: "share@1", owner: "mobile app spec (2026-11-20-mobile-app-design.md), §5.2" },
|
|
18
|
+
{ key: "menu@1", owner: "mobile app spec (2026-11-20-mobile-app-design.md), §5.2" },
|
|
19
|
+
{ key: "nav@1", owner: "mobile app spec (2026-11-20-mobile-app-design.md), §5.2" },
|
|
20
|
+
{ key: "profiles@1", owner: "mobile app spec (2026-11-20-mobile-app-design.md), §5.2" },
|
|
16
21
|
];
|
|
@@ -121,6 +121,14 @@ export declare const THEME_TOKENS: {
|
|
|
121
121
|
readonly dark: "rgba(0,0,0,.88)";
|
|
122
122
|
readonly light: "rgba(10,10,10,.80)";
|
|
123
123
|
};
|
|
124
|
+
readonly "float-ground": {
|
|
125
|
+
readonly dark: "rgba(28,28,26,0.85)";
|
|
126
|
+
readonly light: "rgba(255,255,255,0.85)";
|
|
127
|
+
};
|
|
128
|
+
readonly "float-line": {
|
|
129
|
+
readonly dark: "rgba(255,255,255,0.08)";
|
|
130
|
+
readonly light: "rgba(26,26,24,0.08)";
|
|
131
|
+
};
|
|
124
132
|
readonly "diff-add": {
|
|
125
133
|
readonly dark: "rgba(63,212,131,.08)";
|
|
126
134
|
readonly light: "rgba(22,128,63,.10)";
|
|
@@ -263,6 +271,10 @@ export declare const THEME_TOKENS: {
|
|
|
263
271
|
readonly dark: "0 8px 24px rgba(0,0,0,.45)";
|
|
264
272
|
readonly light: "0 8px 24px rgba(26,26,24,.08)";
|
|
265
273
|
};
|
|
274
|
+
readonly "shadow-float-touch": {
|
|
275
|
+
readonly dark: "0 6px 20px rgba(0,0,0,.35)";
|
|
276
|
+
readonly light: "0 6px 20px rgba(26,26,24,.10)";
|
|
277
|
+
};
|
|
266
278
|
};
|
|
267
279
|
readonly radius: {
|
|
268
280
|
readonly sm: 4;
|
|
@@ -277,8 +289,8 @@ export declare const THEME_FONTS: {
|
|
|
277
289
|
};
|
|
278
290
|
/** The tokens a theme may override: no avatar colors, no color-mix values (they derive). */
|
|
279
291
|
export declare const THEME_OVERRIDABLE: {
|
|
280
|
-
readonly color: readonly ["bg", "panel", "panel-2", "sidebar", "sidebar-active", "raised", "selected", "hover", "line-soft", "line", "line-strong", "line-card", "scroll-thumb", "ink", "muted", "faint", "disabled", "accent", "accent-hover", "accent-press", "on-accent", "focus-ring", "ok", "fail", "warn", "scrim", "lightbox", "diff-add", "diff-del"];
|
|
281
|
-
readonly shadow: readonly ["shadow-1", "shadow-2", "shadow-sheet", "shadow-float"];
|
|
292
|
+
readonly color: readonly ["bg", "panel", "panel-2", "sidebar", "sidebar-active", "raised", "selected", "hover", "line-soft", "line", "line-strong", "line-card", "scroll-thumb", "ink", "muted", "faint", "disabled", "accent", "accent-hover", "accent-press", "on-accent", "focus-ring", "ok", "fail", "warn", "scrim", "lightbox", "float-ground", "float-line", "diff-add", "diff-del"];
|
|
293
|
+
readonly shadow: readonly ["shadow-1", "shadow-2", "shadow-sheet", "shadow-float", "shadow-float-touch"];
|
|
282
294
|
readonly radius: readonly ["sm", "md", "bubble"];
|
|
283
295
|
};
|
|
284
296
|
/** [foreground, background, floor] or, with a fourth element, the surface it sits on. */
|
|
@@ -33,6 +33,8 @@ export const THEME_TOKENS = {
|
|
|
33
33
|
"preview-light": { dark: "#FAF9F6", light: "#FAF9F6" },
|
|
34
34
|
"preview-dark": { dark: "#0A0A0A", light: "#0A0A0A" },
|
|
35
35
|
"lightbox": { dark: "rgba(0,0,0,.88)", light: "rgba(10,10,10,.80)" },
|
|
36
|
+
"float-ground": { dark: "rgba(28,28,26,0.85)", light: "rgba(255,255,255,0.85)" },
|
|
37
|
+
"float-line": { dark: "rgba(255,255,255,0.08)", light: "rgba(26,26,24,0.08)" },
|
|
36
38
|
"diff-add": { dark: "rgba(63,212,131,.08)", light: "rgba(22,128,63,.10)" },
|
|
37
39
|
"diff-del": { dark: "rgba(255,92,82,.08)", light: "rgba(207,34,46,.08)" },
|
|
38
40
|
"avatar-black": { dark: "#1C1C1A", light: "#1C1C1A" },
|
|
@@ -70,6 +72,7 @@ export const THEME_TOKENS = {
|
|
|
70
72
|
"shadow-2": { dark: "0 16px 48px rgba(0,0,0,.50)", light: "0 8px 24px rgba(10,10,10,.12)" },
|
|
71
73
|
"shadow-sheet": { dark: "-16px 0 40px rgba(0,0,0,.40)", light: "-4px 0 16px rgba(10,10,10,.08)" },
|
|
72
74
|
"shadow-float": { dark: "0 8px 24px rgba(0,0,0,.45)", light: "0 8px 24px rgba(26,26,24,.08)" },
|
|
75
|
+
"shadow-float-touch": { dark: "0 6px 20px rgba(0,0,0,.35)", light: "0 6px 20px rgba(26,26,24,.10)" },
|
|
73
76
|
},
|
|
74
77
|
radius: { sm: 4, md: 8, bubble: 10 },
|
|
75
78
|
};
|
|
@@ -108,6 +111,8 @@ export const THEME_OVERRIDABLE = {
|
|
|
108
111
|
"warn",
|
|
109
112
|
"scrim",
|
|
110
113
|
"lightbox",
|
|
114
|
+
"float-ground",
|
|
115
|
+
"float-line",
|
|
111
116
|
"diff-add",
|
|
112
117
|
"diff-del",
|
|
113
118
|
],
|
|
@@ -116,6 +121,7 @@ export const THEME_OVERRIDABLE = {
|
|
|
116
121
|
"shadow-2",
|
|
117
122
|
"shadow-sheet",
|
|
118
123
|
"shadow-float",
|
|
124
|
+
"shadow-float-touch",
|
|
119
125
|
],
|
|
120
126
|
radius: ["sm", "md", "bubble"],
|
|
121
127
|
};
|
|
@@ -127,6 +133,8 @@ export const THEME_CONTRAST = [
|
|
|
127
133
|
["muted", "sidebar", 4.5],
|
|
128
134
|
["muted", "panel-2", 4.5],
|
|
129
135
|
["muted", "raised", 4.5],
|
|
136
|
+
["ink", "float-ground", 4.5, "bg"],
|
|
137
|
+
["muted", "float-ground", 4.5, "bg"],
|
|
130
138
|
["muted", "selected", 4.5],
|
|
131
139
|
["muted", "hover", 4.5],
|
|
132
140
|
["ink", "hover", 4.5, "panel"],
|