@capybara-hq/plugin-sdk 0.1.0-rc.54 → 0.1.0-rc.56

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/dial-in.d.ts CHANGED
@@ -95,17 +95,34 @@ export declare function parseDialInKernelFrame(text: string, maxBytes: number):
95
95
  * declares `permissions.dialIn = { protocol: "<name>/<major>" }`.
96
96
  */
97
97
  export interface DialInHandler {
98
- /** Called on the gateway replica holding the socket, after the kernel authenticated it. */
99
- onHello(deviceId: string, hello: unknown, signal: AbortSignal): Promise<{
98
+ /**
99
+ * Called on the gateway replica holding the socket, after the kernel authenticated it.
100
+ * `connection` names the machine and the connection the hello arrived on.
101
+ */
102
+ onHello(deviceId: string, hello: unknown, signal: AbortSignal, connection: DialInConnectionInfo): Promise<{
100
103
  ok: true;
101
104
  } | {
102
105
  ok: false;
103
106
  code: string;
104
107
  message: string;
105
108
  }>;
106
- /** Unsolicited frames from the machine (not responses to requests). */
107
- onFrame?(deviceId: string, frame: unknown): Promise<void>;
108
- onClose?(deviceId: string, reason: "offline" | "replaced" | "revoked" | "deleted"): void;
109
+ /** Unsolicited frames from the machine (not responses to requests), with their connection. */
110
+ onFrame?(deviceId: string, frame: unknown, connection: DialInConnectionInfo): Promise<void>;
111
+ /**
112
+ * The connection whose hello this provider accepted closed. `connection` is that connection's,
113
+ * so a `replaced` close names the old machine, never the one that replaced it.
114
+ */
115
+ onClose?(deviceId: string, reason: "offline" | "replaced" | "revoked" | "deleted", connection: DialInConnectionInfo): void;
116
+ }
117
+ /** Which machine and which of its connections a {@link DialInHandler} call is about. */
118
+ export interface DialInConnectionInfo {
119
+ /**
120
+ * The kernel's id of the signed-in machine (its credential): a machine signing in again to the
121
+ * same device, or another machine replacing it, gets another id.
122
+ */
123
+ machineId: string;
124
+ /** The connection id, the same the kernel sends to the machine in `ready`. */
125
+ connectionId: string;
109
126
  }
110
127
  /**
111
128
  * `ctx.dialIn` (requires `permissions.dialIn`): talks to the machines serving this extension's
@@ -121,6 +138,17 @@ export interface DialInChannel {
121
138
  signal?: AbortSignal;
122
139
  }): Promise<unknown>;
123
140
  online(deviceId: string): Promise<boolean>;
141
+ /**
142
+ * The negotiated frame capacity of the machine's current connection: the `maxFrameBytes` the
143
+ * kernel sent in that connection's `ready` (the smaller of the machine's announced
144
+ * `transport.maxFrameBytes` and the deployment's limit). A provider sizes its request bodies
145
+ * and the answers it asks for by it: a `req` frame larger than this is refused. Null when no
146
+ * machine holds the device now. Read from shared state at every call, so a reconnect with
147
+ * another capacity shows at once; it can change between this call and a later request.
148
+ */
149
+ capacity(deviceId: string): Promise<{
150
+ maxFrameBytes: number;
151
+ } | null>;
124
152
  stop(deviceId: string, reason: "drain" | "stop"): Promise<void>;
125
153
  }
126
154
  /**
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "0.1.0-rc.54";
1
+ export declare const SDK_VERSION = "0.1.0-rc.56";
2
2
  export * from "./agent-template.js";
3
3
  export * from "./avatar-presets.js";
4
4
  export * from "./bootstrap.js";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export const SDK_VERSION = "0.1.0-rc.54";
1
+ export const SDK_VERSION = "0.1.0-rc.56";
2
2
  export * from "./agent-template.js";
3
3
  export * from "./avatar-presets.js";
4
4
  export * from "./bootstrap.js";
@@ -1,7 +1,7 @@
1
1
  /** The ARIA / data states a part promises (client extensions spec §7.1). */
2
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.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", "image-placeholder"];
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", "composer.box", "composer.options", "composer.send", "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", "image-placeholder"];
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
@@ -12,6 +12,9 @@ export const UI_PART_NAMES = [
12
12
  "message.assistant",
13
13
  "tool-row",
14
14
  "composer",
15
+ "composer.box",
16
+ "composer.options",
17
+ "composer.send",
15
18
  "properties-panel",
16
19
  "section",
17
20
  "right-panel",
@@ -151,8 +154,38 @@ export const UI_PARTS = [
151
154
  owner: ["packages/design/src/conversation/composer.tsx"],
152
155
  states: ["aria-busy"],
153
156
  description: {
154
- en: "The composer box.",
155
- zh: "输入框。",
157
+ en: "The whole composer: the token warning, the attachments, the text box and the control row. From 600 up with a fine pointer it is the box; in the mobile form (below 600, or a touch device at any width) it draws nothing and `composer.box` is the floating pill, the control row around it.",
158
+ zh: "整个输入框:令牌提醒、附件、文本框与控件行。600 及以上且为精确指针时它就是那个框;移动形态(600 以下,或任意宽度的触屏设备)下它不画任何东西,`composer.box` 是浮动的胶囊,控件行在其上下。",
159
+ },
160
+ },
161
+ {
162
+ name: "composer.box",
163
+ version: 1,
164
+ owner: ["packages/design/src/conversation/composer.tsx"],
165
+ states: [],
166
+ description: {
167
+ en: "The composer's text box: the text with the attach and send buttons. In the mobile form it is the floating pill (round ends, `:focus-within` while the text or one of its buttons has focus, never for the control row); from 600 up with a fine pointer it draws no box of its own (`display: contents`).",
168
+ zh: "输入框的文本框:文字与添加、发送按钮。移动形态下它是浮动胶囊(圆头;文字或其中按钮获得焦点时 `:focus-within`,控件行获得焦点时不会);600 及以上且为精确指针时它不画自己的框(`display: contents`)。",
169
+ },
170
+ },
171
+ {
172
+ name: "composer.options",
173
+ version: 1,
174
+ owner: ["packages/design/src/conversation/composer-options.tsx"],
175
+ states: ["aria-expanded"],
176
+ description: {
177
+ en: "The composer's settings chip (model, effort, device, permission) opening the options sheet: in the mobile form only, above the pill.",
178
+ zh: "输入框的设置胶囊(模型、推理强度、设备、权限),打开选项面板:仅移动形态,位于胶囊上方。",
179
+ },
180
+ },
181
+ {
182
+ name: "composer.send",
183
+ version: 1,
184
+ owner: ["packages/design/src/conversation/composer.tsx"],
185
+ states: ["disabled", "aria-busy"],
186
+ description: {
187
+ en: "The composer's send button, and the stop button in its place while a run is going (its `aria-label` tells them apart). In the mobile form a round button inside `composer.box`.",
188
+ zh: "输入框的发送按钮,运行中同一位置的停止按钮(以 `aria-label` 区分)。移动形态下是 `composer.box` 内的圆形按钮。",
156
189
  },
157
190
  },
158
191
  {
@@ -201,7 +234,11 @@ export const UI_PARTS = [
201
234
  {
202
235
  name: "button",
203
236
  version: 1,
204
- owner: ["packages/design/src/controls/button.tsx"],
237
+ owner: [
238
+ "packages/design/src/controls/button.tsx",
239
+ "packages/design/src/conversation/composer.tsx",
240
+ "packages/design/src/conversation/composer-options.tsx",
241
+ ],
205
242
  states: ["disabled"],
206
243
  description: {
207
244
  en: "Every button.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capybara-hq/plugin-sdk",
3
- "version": "0.1.0-rc.54",
3
+ "version": "0.1.0-rc.56",
4
4
  "description": "Capybara plugin SDK: the types and pure functions plugins are written against",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {