@openchamber/sdk 2.3.1 → 2.3.3

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.
Files changed (48) hide show
  1. package/GUEST_SERVICES.md +1 -0
  2. package/dist/contract.d.ts +7 -7
  3. package/dist/contract.js +1 -1
  4. package/dist/host.js +7 -7
  5. package/dist/index.js +15 -15
  6. package/dist/manifest.d.ts +12 -12
  7. package/dist/parse.d.ts +26 -26
  8. package/dist/parse.js +4 -4
  9. package/dist/popover-schemas.d.ts +3 -3
  10. package/dist/popover-schemas.js +1 -1
  11. package/dist/popover.d.ts +2 -2
  12. package/dist/protocol.d.ts +222 -222
  13. package/dist/protocol.js +7 -7
  14. package/dist/schemas.js +7 -7
  15. package/dist/service-provider-schemas.d.ts +6 -6
  16. package/dist/service-provider-schemas.js +1 -1
  17. package/dist/service-providers.d.ts +3 -3
  18. package/dist/service-surface-schemas.d.ts +9 -9
  19. package/dist/service-surface-schemas.js +1 -1
  20. package/dist/service-surface.d.ts +2 -2
  21. package/dist/shells.d.ts +1 -1
  22. package/dist/status-control-schemas.js +1 -1
  23. package/dist/ui/badge.js +2 -2
  24. package/dist/ui/banner.js +3 -3
  25. package/dist/ui/button.js +2 -2
  26. package/dist/ui/checkbox.js +3 -3
  27. package/dist/ui/dom.js +1 -1
  28. package/dist/ui/empty.js +3 -3
  29. package/dist/ui/field.js +2 -2
  30. package/dist/ui/icons.d.ts +4 -4
  31. package/dist/ui/index.js +19 -19
  32. package/dist/ui/list.js +4 -4
  33. package/dist/ui/menu.js +6 -6
  34. package/dist/ui/navigation.d.ts +1 -1
  35. package/dist/ui/option.d.ts +1 -1
  36. package/dist/ui/option.js +2 -2
  37. package/dist/ui/popup.js +1 -1
  38. package/dist/ui/progress.js +3 -3
  39. package/dist/ui/search.js +3 -3
  40. package/dist/ui/select.js +6 -6
  41. package/dist/ui/separator.js +2 -2
  42. package/dist/ui/spinner.js +2 -2
  43. package/dist/ui/style.js +1 -1
  44. package/dist/ui/tabs.js +3 -3
  45. package/dist/ui/text.js +2 -2
  46. package/dist/workspace-schemas.d.ts +14 -14
  47. package/dist/workspace-schemas.js +1 -1
  48. package/package.json +2 -2
package/dist/protocol.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { z } from 'zod';
2
- import { guestSessionWorktreeSchema, guestStorageRequestSchema, guestStorageResultSchema, guestWorkspaceQuerySchema, guestWorkspaceSnapshotSchema } from "./workspace-schemas.js";
3
- import { guestStatusControlEventSchema, guestStatusControlsSchema } from "./status-control-schemas.js";
4
- import { guestPopoverClosedEventSchema, guestPopoverDataSchema, guestPopoverRequestSchema } from "./popover-schemas.js";
5
- import { GUEST_SHELL_END_STATUSES, GUEST_SHELL_ID_MAX, GUEST_SHELLS_MAX, GUEST_SHELL_OUTPUT_TAIL_MAX } from "./shells.js";
6
- import { OPENCHAMBER_SDK_API_VERSION, OPENCHAMBER_SDK_CHANNEL } from "./api-version.js";
7
- import { SERVICE_STATUS_VALUES, ATTACH_PROVIDER_ID, GUEST_ACCOUNT_MAX, GUEST_ATTACH_AUTHOR_MAX, GUEST_BADGE_MAX, GUEST_FRAME_HEIGHT_MAX, GUEST_COMMIT_SHA, GUEST_ITEM_MESSAGE_TEXT_MAX, GUEST_ITEM_SESSION_MAX, GUEST_RESOLVE_ERROR_MAX, GUEST_ATTACH_BRANCH_MAX, GUEST_ATTACH_DATA_MAX, GUEST_ATTACH_ID_MAX, GUEST_ATTACH_TEXT_MAX, GUEST_ATTACH_TITLE_MAX, GUEST_ATTACH_URL_MAX, GUEST_CLIPBOARD_TEXT_MAX, GUEST_COMPOSE_TEXT_MAX, GUEST_FILE_CONTENT_MAX, GUEST_FILE_ENTRY_KINDS, GUEST_FILE_LIST_MAX, GUEST_GENERATE_OUTPUT_TOKENS_MAX, GUEST_GENERATE_PROMPT_MAX, GUEST_GENERATE_SYSTEM_MAX, GUEST_GENERATE_TEXT_MAX, GUEST_FILE_PATH_MAX, GUEST_FILE_STAT_KINDS, GUEST_REQUEST_BODY_MAX, GUEST_REQUEST_PATH_MAX, GUEST_REQUEST_RESPONSE_MAX, GUEST_SESSION_AGENT_MAX, GUEST_SESSION_MODEL_MAX, GUEST_SETTING_VALUE_MAX, GUEST_TOAST_MAX, SESSION_LIFECYCLE_PHASES, SETTING_KEY, START_SESSION_SENT, isGuestFilePath, isGuestRequestPath, resolveHostRequestErrorCode, } from "./contract.js";
8
- import { GUEST_FILE_EDITOR_CONTENT_MAX, GUEST_FILE_EDITOR_VERSION_MAX } from "./file-editor.js";
2
+ import { guestSessionWorktreeSchema, guestStorageRequestSchema, guestStorageResultSchema, guestWorkspaceQuerySchema, guestWorkspaceSnapshotSchema } from './workspace-schemas.js';
3
+ import { guestStatusControlEventSchema, guestStatusControlsSchema } from './status-control-schemas.js';
4
+ import { guestPopoverClosedEventSchema, guestPopoverDataSchema, guestPopoverRequestSchema } from './popover-schemas.js';
5
+ import { GUEST_SHELL_END_STATUSES, GUEST_SHELL_ID_MAX, GUEST_SHELLS_MAX, GUEST_SHELL_OUTPUT_TAIL_MAX } from './shells.js';
6
+ import { OPENCHAMBER_SDK_API_VERSION, OPENCHAMBER_SDK_CHANNEL } from './api-version.js';
7
+ import { SERVICE_STATUS_VALUES, ATTACH_PROVIDER_ID, GUEST_ACCOUNT_MAX, GUEST_ATTACH_AUTHOR_MAX, GUEST_BADGE_MAX, GUEST_FRAME_HEIGHT_MAX, GUEST_COMMIT_SHA, GUEST_ITEM_MESSAGE_TEXT_MAX, GUEST_ITEM_SESSION_MAX, GUEST_RESOLVE_ERROR_MAX, GUEST_ATTACH_BRANCH_MAX, GUEST_ATTACH_DATA_MAX, GUEST_ATTACH_ID_MAX, GUEST_ATTACH_TEXT_MAX, GUEST_ATTACH_TITLE_MAX, GUEST_ATTACH_URL_MAX, GUEST_CLIPBOARD_TEXT_MAX, GUEST_COMPOSE_TEXT_MAX, GUEST_FILE_CONTENT_MAX, GUEST_FILE_ENTRY_KINDS, GUEST_FILE_LIST_MAX, GUEST_GENERATE_OUTPUT_TOKENS_MAX, GUEST_GENERATE_PROMPT_MAX, GUEST_GENERATE_SYSTEM_MAX, GUEST_GENERATE_TEXT_MAX, GUEST_FILE_PATH_MAX, GUEST_FILE_STAT_KINDS, GUEST_REQUEST_BODY_MAX, GUEST_REQUEST_PATH_MAX, GUEST_REQUEST_RESPONSE_MAX, GUEST_SESSION_AGENT_MAX, GUEST_SESSION_MODEL_MAX, GUEST_SETTING_VALUE_MAX, GUEST_TOAST_MAX, SESSION_LIFECYCLE_PHASES, SETTING_KEY, START_SESSION_SENT, isGuestFilePath, isGuestRequestPath, resolveHostRequestErrorCode, } from './contract.js';
8
+ import { GUEST_FILE_EDITOR_CONTENT_MAX, GUEST_FILE_EDITOR_VERSION_MAX } from './file-editor.js';
9
9
  // Structured clone recreates a frame's Uint8Array in the receiving realm, so
10
10
  // `instanceof` holds for bytes that crossed postMessage.
11
11
  const fileBytesSchema = z.instanceof(Uint8Array).refine((bytes) => bytes.byteLength <= GUEST_FILE_EDITOR_CONTENT_MAX);
package/dist/schemas.js CHANGED
@@ -1,10 +1,10 @@
1
1
  // Host-side parsing. OpenChamber (browser host and server) imports this to
2
2
  // validate an untrusted guest's manifest and messages with zod. Guests import
3
3
  // `@openchamber/sdk`, which carries no schema library.
4
- export { openChamberManifestSchema, PACKAGE_VERSION_PATTERN, packageManifestSchema, parseManifest, parseManifestJson, } from "./parse.js";
5
- export { guestStorageRequestSchema, guestStorageResultSchema, guestWorkspaceSnapshotSchema } from "./workspace-schemas.js";
6
- export { guestStatusControlsSchema, guestStatusControlEventSchema } from "./status-control-schemas.js";
7
- export { guestPopoverClosedEventSchema, guestPopoverRequestSchema } from "./popover-schemas.js";
8
- export { guestMessageSchema, hostMessageSchema, parseGuestMessage, parseHostMessage, } from "./protocol.js";
9
- export { browserControlActionSchema, browserProviderResultSchema } from "./service-provider-schemas.js";
10
- export { surfaceClipboardAnswerSchema, surfaceControllerSchema, surfaceHostMessageSchema, surfaceInputEventSchema, surfaceResizeAnswerSchema, surfaceViewerMessageSchema, } from "./service-surface-schemas.js";
4
+ export { openChamberManifestSchema, PACKAGE_VERSION_PATTERN, packageManifestSchema, parseManifest, parseManifestJson, } from './parse.js';
5
+ export { guestStorageRequestSchema, guestStorageResultSchema, guestWorkspaceSnapshotSchema } from './workspace-schemas.js';
6
+ export { guestStatusControlsSchema, guestStatusControlEventSchema } from './status-control-schemas.js';
7
+ export { guestPopoverClosedEventSchema, guestPopoverRequestSchema } from './popover-schemas.js';
8
+ export { guestMessageSchema, hostMessageSchema, parseGuestMessage, parseHostMessage, } from './protocol.js';
9
+ export { browserControlActionSchema, browserProviderResultSchema } from './service-provider-schemas.js';
10
+ export { surfaceClipboardAnswerSchema, surfaceControllerSchema, surfaceHostMessageSchema, surfaceInputEventSchema, surfaceResizeAnswerSchema, surfaceViewerMessageSchema, } from './service-surface-schemas.js';
@@ -12,14 +12,14 @@ export declare const browserProviderResultSchema: z.ZodUnion<readonly [z.ZodObje
12
12
  error: z.ZodString;
13
13
  }, z.core.$strip>]>;
14
14
  export declare const browserControlActionSchema: z.ZodEnum<{
15
- "browser.open": "browser.open";
16
- "browser.snapshot": "browser.snapshot";
17
- "browser.click": "browser.click";
18
- "browser.type": "browser.type";
19
- "browser.scroll": "browser.scroll";
20
15
  "browser.back": "browser.back";
16
+ "browser.capture": "browser.capture";
17
+ "browser.click": "browser.click";
21
18
  "browser.forward": "browser.forward";
22
19
  "browser.inspect": "browser.inspect";
23
- "browser.capture": "browser.capture";
20
+ "browser.open": "browser.open";
24
21
  "browser.resize": "browser.resize";
22
+ "browser.scroll": "browser.scroll";
23
+ "browser.snapshot": "browser.snapshot";
24
+ "browser.type": "browser.type";
25
25
  }>;
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { BROWSER_CONTROL_ACTIONS } from "./service-providers.js";
2
+ import { BROWSER_CONTROL_ACTIONS } from './service-providers.js';
3
3
  /**
4
4
  * Host-side parse of what a browser provider answers. `data` stays whatever
5
5
  * the service produced: the host hands it to the agent as is, and only
@@ -10,11 +10,11 @@
10
10
  */
11
11
  /** Route on the service loopback the host posts every action to. */
12
12
  export declare const BROWSER_PROVIDER_PATH = "/browser-control";
13
- export declare const BROWSER_CONTROL_ACTIONS: readonly ["browser.open", "browser.snapshot", "browser.click", "browser.type", "browser.scroll", "browser.back", "browser.forward", "browser.inspect", "browser.capture", "browser.resize"];
13
+ export declare const BROWSER_CONTROL_ACTIONS: readonly ['browser.open', 'browser.snapshot', 'browser.click', 'browser.type', 'browser.scroll', 'browser.back', 'browser.forward', 'browser.inspect', 'browser.capture', 'browser.resize'];
14
14
  export type BrowserControlAction = (typeof BROWSER_CONTROL_ACTIONS)[number];
15
- export declare const BROWSER_VIEWPORT_MODES: readonly ["mobile", "tablet", "desktop", "fill"];
15
+ export declare const BROWSER_VIEWPORT_MODES: readonly ['mobile', 'tablet', 'desktop', 'fill'];
16
16
  export type BrowserViewportMode = (typeof BROWSER_VIEWPORT_MODES)[number];
17
- export declare const BROWSER_SCROLL_DIRECTIONS: readonly ["up", "down", "top", "bottom"];
17
+ export declare const BROWSER_SCROLL_DIRECTIONS: readonly ['up', 'down', 'top', 'bottom'];
18
18
  export type BrowserScrollDirection = (typeof BROWSER_SCROLL_DIRECTIONS)[number];
19
19
  /** `browser.open` may wait for a slow page; every other action is quick. */
20
20
  export declare const BROWSER_PROVIDER_OPEN_TIMEOUT_MS = 45000;
@@ -2,9 +2,9 @@ import { z } from 'zod';
2
2
  export declare const surfaceInputEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3
3
  type: z.ZodLiteral<"pointer">;
4
4
  action: z.ZodEnum<{
5
- up: "up";
6
5
  down: "down";
7
6
  move: "move";
7
+ up: "up";
8
8
  }>;
9
9
  x: z.ZodNumber;
10
10
  y: z.ZodNumber;
@@ -31,8 +31,8 @@ export declare const surfaceInputEventSchema: z.ZodDiscriminatedUnion<[z.ZodObje
31
31
  }, z.core.$strip>, z.ZodObject<{
32
32
  type: z.ZodLiteral<"key">;
33
33
  action: z.ZodEnum<{
34
- up: "up";
35
34
  down: "down";
35
+ up: "up";
36
36
  }>;
37
37
  key: z.ZodString;
38
38
  code: z.ZodString;
@@ -55,9 +55,9 @@ export declare const surfaceViewerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodO
55
55
  events: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
56
56
  type: z.ZodLiteral<"pointer">;
57
57
  action: z.ZodEnum<{
58
- up: "up";
59
58
  down: "down";
60
59
  move: "move";
60
+ up: "up";
61
61
  }>;
62
62
  x: z.ZodNumber;
63
63
  y: z.ZodNumber;
@@ -84,8 +84,8 @@ export declare const surfaceViewerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodO
84
84
  }, z.core.$strip>, z.ZodObject<{
85
85
  type: z.ZodLiteral<"key">;
86
86
  action: z.ZodEnum<{
87
- up: "up";
88
87
  down: "down";
88
+ up: "up";
89
89
  }>;
90
90
  key: z.ZodString;
91
91
  code: z.ZodString;
@@ -111,9 +111,9 @@ export declare const surfaceViewerMessageSchema: z.ZodDiscriminatedUnion<[z.ZodO
111
111
  }, z.core.$strip>], "type">;
112
112
  export type SurfaceViewerMessage = z.infer<typeof surfaceViewerMessageSchema>;
113
113
  export declare const surfaceControllerSchema: z.ZodEnum<{
114
- user: "user";
115
- none: "none";
116
114
  agent: "agent";
115
+ none: "none";
116
+ user: "user";
117
117
  }>;
118
118
  /**
119
119
  * What the host sends a viewer. A `frame` text message is followed by one
@@ -137,9 +137,9 @@ export declare const surfaceHostMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObj
137
137
  }, z.core.$strip>, z.ZodObject<{
138
138
  type: z.ZodLiteral<"control">;
139
139
  controller: z.ZodEnum<{
140
- user: "user";
141
- none: "none";
142
140
  agent: "agent";
141
+ none: "none";
142
+ user: "user";
143
143
  }>;
144
144
  mine: z.ZodBoolean;
145
145
  }, z.core.$strip>, z.ZodObject<{
@@ -157,9 +157,9 @@ export declare const surfaceHostMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObj
157
157
  }, z.core.$strip>, z.ZodObject<{
158
158
  type: z.ZodLiteral<"ended">;
159
159
  reason: z.ZodEnum<{
160
- "service-stopped": "service-stopped";
161
160
  "extension-unavailable": "extension-unavailable";
162
161
  "host-shutdown": "host-shutdown";
162
+ "service-stopped": "service-stopped";
163
163
  }>;
164
164
  }, z.core.$strip>], "type">;
165
165
  export type SurfaceHostMessage = z.infer<typeof surfaceHostMessageSchema>;
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { SURFACE_CONTROLLERS, SURFACE_DIMENSION_MAX, SURFACE_FRAME_MIMES, SURFACE_INPUT_BATCH_MAX, SURFACE_TEXT_MAX, SURFACE_TITLE_MAX, } from "./service-surface.js";
2
+ import { SURFACE_CONTROLLERS, SURFACE_DIMENSION_MAX, SURFACE_FRAME_MIMES, SURFACE_INPUT_BATCH_MAX, SURFACE_TEXT_MAX, SURFACE_TITLE_MAX, } from './service-surface.js';
3
3
  const modifiersSchema = z.object({ alt: z.boolean(), ctrl: z.boolean(), meta: z.boolean(), shift: z.boolean() });
4
4
  const finite = z.number().finite();
5
5
  export const surfaceInputEventSchema = z.discriminatedUnion('type', [
@@ -50,7 +50,7 @@ export declare const SURFACE_VIEWER_HEADER = "x-surface-viewer";
50
50
  export declare const SURFACE_FRAME_SEQ_HEADER = "x-surface-frame-seq";
51
51
  /** Host → service, on page `serviceRequest`s only: `1` while that viewer holds control, else `0`. */
52
52
  export declare const SURFACE_VIEWER_CONTROLS_HEADER = "x-surface-viewer-controls";
53
- export declare const SURFACE_FRAME_MIMES: readonly ["image/jpeg", "image/png"];
53
+ export declare const SURFACE_FRAME_MIMES: readonly ['image/jpeg', 'image/png'];
54
54
  export type SurfaceFrameMime = (typeof SURFACE_FRAME_MIMES)[number];
55
55
  /** How long the host lets one frame request wait before asking again. */
56
56
  export declare const SURFACE_FRAME_WAIT_MS = 25000;
@@ -104,7 +104,7 @@ export type SurfaceInputEvent = SurfacePointerEvent | SurfaceWheelEvent | Surfac
104
104
  export type SurfaceInputBatch = {
105
105
  events: SurfaceInputEvent[];
106
106
  };
107
- export declare const SURFACE_CONTROLLERS: readonly ["none", "agent", "user"];
107
+ export declare const SURFACE_CONTROLLERS: readonly ['none', 'agent', 'user'];
108
108
  export type SurfaceController = (typeof SURFACE_CONTROLLERS)[number];
109
109
  export type SurfaceControlNotice = {
110
110
  controller: SurfaceController;
package/dist/shells.d.ts CHANGED
@@ -10,7 +10,7 @@ export type GuestRunningShell = {
10
10
  /** True for a job the turn does not wait for; false while the turn that ran it is blocked on it. */
11
11
  background: boolean;
12
12
  };
13
- export declare const GUEST_SHELL_END_STATUSES: readonly ["exited", "timeout", "killed", "stopped", "unknown"];
13
+ export declare const GUEST_SHELL_END_STATUSES: readonly ['exited', 'timeout', 'killed', 'stopped', 'unknown'];
14
14
  /**
15
15
  * How a shell command ended: `exited` on its own (see `exit`), `timeout`,
16
16
  * `killed` by a signal, `stopped` by a user (Stop, or aborting the turn that
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { GUEST_STATUS_CONTROL_ID, GUEST_STATUS_CONTROL_LABEL_MAX, GUEST_STATUS_CONTROL_OPTIONS_MAX, GUEST_STATUS_CONTROL_VALUE_MAX, GUEST_STATUS_CONTROLS_MAX, } from "./status-controls.js";
2
+ import { GUEST_STATUS_CONTROL_ID, GUEST_STATUS_CONTROL_LABEL_MAX, GUEST_STATUS_CONTROL_OPTIONS_MAX, GUEST_STATUS_CONTROL_VALUE_MAX, GUEST_STATUS_CONTROLS_MAX, } from './status-controls.js';
3
3
  const idSchema = z.string().regex(GUEST_STATUS_CONTROL_ID);
4
4
  const labelSchema = z.string().min(1).max(GUEST_STATUS_CONTROL_LABEL_MAX);
5
5
  const optionSchema = z.object({
package/dist/ui/badge.js CHANGED
@@ -1,5 +1,5 @@
1
- import { el, ensureStyle, setAttr, setText } from "./dom.js";
2
- import { UI_CSS } from "./style.js";
1
+ import { el, ensureStyle, setAttr, setText } from './dom.js';
2
+ import { UI_CSS } from './style.js';
3
3
  /** Writes `data-tone` for toned colours; neutral removes it. */
4
4
  export const applyTone = (node, tone) => {
5
5
  setAttr(node, 'data-tone', tone && tone !== 'neutral' ? tone : null);
package/dist/ui/banner.js CHANGED
@@ -1,6 +1,6 @@
1
- import { mountButton } from "./button.js";
2
- import { el, ensureStyle, setText } from "./dom.js";
3
- import { UI_CSS } from "./style.js";
1
+ import { mountButton } from './button.js';
2
+ import { el, ensureStyle, setText } from './dom.js';
3
+ import { UI_CSS } from './style.js';
4
4
  export const mountBanner = (root, initial) => {
5
5
  ensureStyle(UI_CSS);
6
6
  let props = initial;
package/dist/ui/button.js CHANGED
@@ -1,5 +1,5 @@
1
- import { button, ensureStyle, setText } from "./dom.js";
2
- import { UI_CSS } from "./style.js";
1
+ import { button, ensureStyle, setText } from './dom.js';
2
+ import { UI_CSS } from './style.js';
3
3
  const ring = () => {
4
4
  const spinner = document.createElement('span');
5
5
  spinner.className = 'oc-sdk-spinner-ring';
@@ -1,6 +1,6 @@
1
- import { button, el, ensureStyle, setText } from "./dom.js";
2
- import { icon } from "./icons.js";
3
- import { UI_CSS } from "./style.js";
1
+ import { button, el, ensureStyle, setText } from './dom.js';
2
+ import { icon } from './icons.js';
3
+ import { UI_CSS } from './style.js';
4
4
  const mountToggle = (root, initial, role) => {
5
5
  ensureStyle(UI_CSS);
6
6
  let props = initial;
package/dist/ui/dom.js CHANGED
@@ -1,4 +1,4 @@
1
- import { installGuestScrollbarActivity } from "../scrollbar-style.js";
1
+ import { installGuestScrollbarActivity } from '../scrollbar-style.js';
2
2
  const STYLE_ID = 'oc-sdk-ui-style';
3
3
  export const clearNode = (node) => {
4
4
  while (node.firstChild) {
package/dist/ui/empty.js CHANGED
@@ -1,6 +1,6 @@
1
- import { mountButton } from "./button.js";
2
- import { el, ensureStyle, setText } from "./dom.js";
3
- import { UI_CSS } from "./style.js";
1
+ import { mountButton } from './button.js';
2
+ import { el, ensureStyle, setText } from './dom.js';
3
+ import { UI_CSS } from './style.js';
4
4
  export const mountEmpty = (root, initial) => {
5
5
  ensureStyle(UI_CSS);
6
6
  let props = initial;
package/dist/ui/field.js CHANGED
@@ -1,5 +1,5 @@
1
- import { el, ensureStyle, setAttr, setText } from "./dom.js";
2
- import { UI_CSS } from "./style.js";
1
+ import { el, ensureStyle, setAttr, setText } from './dom.js';
2
+ import { UI_CSS } from './style.js';
3
3
  export const mountTextField = (root, initial) => {
4
4
  ensureStyle(UI_CSS);
5
5
  let props = initial;
@@ -1,9 +1,9 @@
1
1
  /** Remixicon outlines. Add a shape only when a primitive paints it. */
2
2
  declare const ICON_PATH: {
3
- readonly search: "M18.031 16.617l4.283 4.282-1.415 1.415-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9 9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617zm-2.006-.742A6.977 6.977 0 0 0 18 11c0-3.868-3.133-7-7-7-3.868 0-7 3.132-7 7 0 3.867 3.132 7 7 7a6.977 6.977 0 0 0 4.875-1.975l.15-.15z";
4
- readonly chevron: "M12 13.172l4.95-4.95 1.414 1.414L12 16 5.636 9.636 7.05 8.222z";
5
- readonly check: "M10 15.172l9.192-9.193 1.415 1.414L10 18l-6.364-6.364 1.414-1.414z";
6
- readonly close: "M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z";
3
+ readonly search: 'M18.031 16.617l4.283 4.282-1.415 1.415-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9 9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617zm-2.006-.742A6.977 6.977 0 0 0 18 11c0-3.868-3.133-7-7-7-3.868 0-7 3.132-7 7 0 3.867 3.132 7 7 7a6.977 6.977 0 0 0 4.875-1.975l.15-.15z';
4
+ readonly chevron: 'M12 13.172l4.95-4.95 1.414 1.414L12 16 5.636 9.636 7.05 8.222z';
5
+ readonly check: 'M10 15.172l9.192-9.193 1.415 1.414L10 18l-6.364-6.364 1.414-1.414z';
6
+ readonly close: 'M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z';
7
7
  };
8
8
  type IconName = keyof typeof ICON_PATH;
9
9
  export declare const icon: (name: IconName, size: number, className?: string) => SVGSVGElement;
package/dist/ui/index.js CHANGED
@@ -1,19 +1,19 @@
1
- export { applyHostReady, applyHostTheme } from "./theme.js";
2
- export { GUEST_UI_LOOK_CSS } from "./style.js";
3
- export { mountButton } from "./button.js";
4
- export { mountTextField } from "./field.js";
5
- export { mountSearchField } from "./search.js";
6
- export { filterSelectOptions, mountSelect } from "./select.js";
7
- export { mountCheckbox, mountSwitch } from "./checkbox.js";
8
- export { mountTabs } from "./tabs.js";
9
- export { mountBadge } from "./badge.js";
10
- export { mountList } from "./list.js";
11
- export { moveListSelection, navigationKey } from "./navigation.js";
12
- export { mountEmpty } from "./empty.js";
13
- export { mountSpinner } from "./spinner.js";
14
- export { mountBanner } from "./banner.js";
15
- export { mountSeparator } from "./separator.js";
16
- export { mountProgress } from "./progress.js";
17
- export { mountMenu } from "./menu.js";
18
- export { mountText, splitTextMedia } from "./text.js";
19
- export { mountPopoverAnchor } from "./popover-anchor.js";
1
+ export { applyHostReady, applyHostTheme } from './theme.js';
2
+ export { GUEST_UI_LOOK_CSS } from './style.js';
3
+ export { mountButton } from './button.js';
4
+ export { mountTextField } from './field.js';
5
+ export { mountSearchField } from './search.js';
6
+ export { filterSelectOptions, mountSelect } from './select.js';
7
+ export { mountCheckbox, mountSwitch } from './checkbox.js';
8
+ export { mountTabs } from './tabs.js';
9
+ export { mountBadge } from './badge.js';
10
+ export { mountList } from './list.js';
11
+ export { moveListSelection, navigationKey } from './navigation.js';
12
+ export { mountEmpty } from './empty.js';
13
+ export { mountSpinner } from './spinner.js';
14
+ export { mountBanner } from './banner.js';
15
+ export { mountSeparator } from './separator.js';
16
+ export { mountProgress } from './progress.js';
17
+ export { mountMenu } from './menu.js';
18
+ export { mountText, splitTextMedia } from './text.js';
19
+ export { mountPopoverAnchor } from './popover-anchor.js';
package/dist/ui/list.js CHANGED
@@ -1,7 +1,7 @@
1
- import { applyTone } from "./badge.js";
2
- import { button, clearNode, el, ensureStyle, setAttr } from "./dom.js";
3
- import { moveListSelection, navigationKey } from "./navigation.js";
4
- import { UI_CSS } from "./style.js";
1
+ import { applyTone } from './badge.js';
2
+ import { button, clearNode, el, ensureStyle, setAttr } from './dom.js';
3
+ import { moveListSelection, navigationKey } from './navigation.js';
4
+ import { UI_CSS } from './style.js';
5
5
  let listCount = 0;
6
6
  export const mountList = (root, initial) => {
7
7
  ensureStyle(UI_CSS);
package/dist/ui/menu.js CHANGED
@@ -1,9 +1,9 @@
1
- import { mountButton } from "./button.js";
2
- import { clearNode, el, ensureStyle } from "./dom.js";
3
- import { moveListSelection, navigationKey } from "./navigation.js";
4
- import { createOption, highlightOption } from "./option.js";
5
- import { openPopup } from "./popup.js";
6
- import { UI_CSS } from "./style.js";
1
+ import { mountButton } from './button.js';
2
+ import { clearNode, el, ensureStyle } from './dom.js';
3
+ import { moveListSelection, navigationKey } from './navigation.js';
4
+ import { createOption, highlightOption } from './option.js';
5
+ import { openPopup } from './popup.js';
6
+ import { UI_CSS } from './style.js';
7
7
  const actions = (items) => (items.filter((item) => !('separator' in item)));
8
8
  let menuCount = 0;
9
9
  export const mountMenu = (root, initial) => {
@@ -9,7 +9,7 @@ type KeyLike = {
9
9
  ctrlKey: boolean;
10
10
  };
11
11
  /** Maps a keyboard event to a navigation step. Ctrl+N / Ctrl+P mirror the arrow keys, as in the host. */
12
- export declare const navigationKey: (event: KeyLike, axis?: "vertical" | "horizontal") => NavigationKey | null;
12
+ export declare const navigationKey: (event: KeyLike, axis?: 'vertical' | 'horizontal') => NavigationKey | null;
13
13
  /**
14
14
  * Returns the id that `key` lands on from `currentId`, skipping disabled items and
15
15
  * stopping at the edges. Returns `null` when nothing is enabled.
@@ -7,7 +7,7 @@ type OptionSpec = {
7
7
  destructive?: boolean;
8
8
  disabled?: boolean;
9
9
  };
10
- export declare const createOption: (uid: string, role: "option" | "menuitem", spec: OptionSpec, on: {
10
+ export declare const createOption: (uid: string, role: 'option' | 'menuitem', spec: OptionSpec, on: {
11
11
  hover: () => void;
12
12
  pick: () => void;
13
13
  }) => HTMLButtonElement;
package/dist/ui/option.js CHANGED
@@ -1,5 +1,5 @@
1
- import { button, el, setAttr } from "./dom.js";
2
- import { icon } from "./icons.js";
1
+ import { button, el, setAttr } from './dom.js';
2
+ import { icon } from './icons.js';
3
3
  const optionId = (uid, id) => `${uid}-${id ?? ''}`;
4
4
  export const createOption = (uid, role, spec, on) => {
5
5
  const node = button('oc-sdk-option');
package/dist/ui/popup.js CHANGED
@@ -1,4 +1,4 @@
1
- import { onOutsideClick } from "./dom.js";
1
+ import { onOutsideClick } from './dom.js';
2
2
  /** Places a fixed popup under `trigger`; flips above when the room below is too small. */
3
3
  const placePopup = (popup, trigger) => {
4
4
  const rect = trigger.getBoundingClientRect();
@@ -1,6 +1,6 @@
1
- import { applyTone } from "./badge.js";
2
- import { el, ensureStyle, setText } from "./dom.js";
3
- import { UI_CSS } from "./style.js";
1
+ import { applyTone } from './badge.js';
2
+ import { el, ensureStyle, setText } from './dom.js';
3
+ import { UI_CSS } from './style.js';
4
4
  export const clampProgress = (value) => (Number.isFinite(value) ? Math.min(100, Math.max(0, Math.round(value))) : 0);
5
5
  export const mountProgress = (root, initial) => {
6
6
  ensureStyle(UI_CSS);
package/dist/ui/search.js CHANGED
@@ -1,6 +1,6 @@
1
- import { button, el, ensureStyle, setAttr } from "./dom.js";
2
- import { icon } from "./icons.js";
3
- import { UI_CSS } from "./style.js";
1
+ import { button, el, ensureStyle, setAttr } from './dom.js';
2
+ import { icon } from './icons.js';
3
+ import { UI_CSS } from './style.js';
4
4
  export const mountSearchField = (root, initial) => {
5
5
  ensureStyle(UI_CSS);
6
6
  let props = initial;
package/dist/ui/select.js CHANGED
@@ -1,9 +1,9 @@
1
- import { button, clearNode, el, ensureStyle, setText } from "./dom.js";
2
- import { icon } from "./icons.js";
3
- import { moveListSelection, navigationKey } from "./navigation.js";
4
- import { createOption, highlightOption } from "./option.js";
5
- import { openPopup } from "./popup.js";
6
- import { UI_CSS } from "./style.js";
1
+ import { button, clearNode, el, ensureStyle, setText } from './dom.js';
2
+ import { icon } from './icons.js';
3
+ import { moveListSelection, navigationKey } from './navigation.js';
4
+ import { createOption, highlightOption } from './option.js';
5
+ import { openPopup } from './popup.js';
6
+ import { UI_CSS } from './style.js';
7
7
  /** Case-insensitive substring match on label and id. Empty query keeps every option. */
8
8
  export const filterSelectOptions = (options, query) => {
9
9
  const needle = query.trim().toLowerCase();
@@ -1,5 +1,5 @@
1
- import { el, ensureStyle, setText } from "./dom.js";
2
- import { UI_CSS } from "./style.js";
1
+ import { el, ensureStyle, setText } from './dom.js';
2
+ import { UI_CSS } from './style.js';
3
3
  export const mountSeparator = (root, initial = {}) => {
4
4
  ensureStyle(UI_CSS);
5
5
  let props = initial;
@@ -1,5 +1,5 @@
1
- import { el, ensureStyle, setText } from "./dom.js";
2
- import { UI_CSS } from "./style.js";
1
+ import { el, ensureStyle, setText } from './dom.js';
2
+ import { UI_CSS } from './style.js';
3
3
  export const mountSpinner = (root, initial = {}) => {
4
4
  ensureStyle(UI_CSS);
5
5
  let props = initial;
package/dist/ui/style.js CHANGED
@@ -1,4 +1,4 @@
1
- import { GUEST_SCROLLBAR_CSS } from "../scrollbar-style.js";
1
+ import { GUEST_SCROLLBAR_CSS } from '../scrollbar-style.js';
2
2
  /** Host CSS variable → `--oc-*` alias written by `theme.ts`. */
3
3
  const OC_ALIAS = {
4
4
  'surface-background': 'bg',
package/dist/ui/tabs.js CHANGED
@@ -1,6 +1,6 @@
1
- import { button, clearNode, el, ensureStyle } from "./dom.js";
2
- import { moveListSelection, navigationKey } from "./navigation.js";
3
- import { UI_CSS } from "./style.js";
1
+ import { button, clearNode, el, ensureStyle } from './dom.js';
2
+ import { moveListSelection, navigationKey } from './navigation.js';
3
+ import { UI_CSS } from './style.js';
4
4
  export const mountTabs = (root, initial) => {
5
5
  ensureStyle(UI_CSS);
6
6
  let props = initial;
package/dist/ui/text.js CHANGED
@@ -1,5 +1,5 @@
1
- import { clearNode, el, ensureStyle } from "./dom.js";
2
- import { UI_CSS } from "./style.js";
1
+ import { clearNode, el, ensureStyle } from './dom.js';
2
+ import { UI_CSS } from './style.js';
3
3
  const MARKDOWN_TOKEN = /(!?)\[([^\]]*)\]\((https?:\/\/[^)\s]+)\)/g;
4
4
  export const isHttpUrl = (value) => {
5
5
  try {
@@ -11,9 +11,9 @@ export declare const guestWorkspaceQuerySchema: z.ZodDiscriminatedUnion<[z.ZodOb
11
11
  export declare const guestWorkspaceSnapshotSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
12
12
  kind: z.ZodLiteral<"projects">;
13
13
  state: z.ZodEnum<{
14
+ error: "error";
14
15
  loading: "loading";
15
16
  ready: "ready";
16
- error: "error";
17
17
  }>;
18
18
  projects: z.ZodArray<z.ZodObject<{
19
19
  id: z.ZodString;
@@ -24,35 +24,35 @@ export declare const guestWorkspaceSnapshotSchema: z.ZodDiscriminatedUnion<[z.Zo
24
24
  kind: z.ZodLiteral<"worktrees">;
25
25
  projectId: z.ZodString;
26
26
  state: z.ZodEnum<{
27
+ error: "error";
27
28
  loading: "loading";
28
29
  ready: "ready";
29
- error: "error";
30
30
  }>;
31
31
  worktrees: z.ZodArray<z.ZodObject<{
32
32
  directory: z.ZodString;
33
33
  name: z.ZodString;
34
34
  branch: z.ZodString;
35
35
  status: z.ZodEnum<{
36
- ready: "ready";
37
- pending: "pending";
38
36
  invalid: "invalid";
39
37
  missing: "missing";
38
+ pending: "pending";
39
+ ready: "ready";
40
40
  }>;
41
41
  }, z.core.$strip>>;
42
42
  }, z.core.$strip>, z.ZodObject<{
43
43
  kind: z.ZodLiteral<"sessions">;
44
44
  projectId: z.ZodString;
45
45
  state: z.ZodEnum<{
46
+ error: "error";
46
47
  loading: "loading";
47
48
  ready: "ready";
48
- error: "error";
49
49
  }>;
50
50
  coverage: z.ZodArray<z.ZodObject<{
51
51
  directory: z.ZodString;
52
52
  state: z.ZodEnum<{
53
+ error: "error";
53
54
  loading: "loading";
54
55
  ready: "ready";
55
- error: "error";
56
56
  }>;
57
57
  }, z.core.$strip>>;
58
58
  sessions: z.ZodArray<z.ZodObject<{
@@ -69,17 +69,17 @@ export declare const guestWorkspaceSnapshotSchema: z.ZodDiscriminatedUnion<[z.Zo
69
69
  name: z.ZodString;
70
70
  branch: z.ZodString;
71
71
  status: z.ZodEnum<{
72
- ready: "ready";
73
- pending: "pending";
74
72
  invalid: "invalid";
75
73
  missing: "missing";
74
+ pending: "pending";
75
+ ready: "ready";
76
76
  }>;
77
77
  }, z.core.$strip>>;
78
78
  activity: z.ZodEnum<{
79
- unknown: "unknown";
80
79
  idle: "idle";
81
- running: "running";
82
80
  retrying: "retrying";
81
+ running: "running";
82
+ unknown: "unknown";
83
83
  "waiting-permission": "waiting-permission";
84
84
  "waiting-question": "waiting-question";
85
85
  }>;
@@ -105,29 +105,29 @@ export declare const guestStorageRequestSchema: z.ZodDiscriminatedUnion<[z.ZodOb
105
105
  op: z.ZodLiteral<"get">;
106
106
  key: z.ZodString;
107
107
  scope: z.ZodOptional<z.ZodEnum<{
108
- instance: "instance";
109
108
  device: "device";
109
+ instance: "instance";
110
110
  }>>;
111
111
  }, z.core.$strict>, z.ZodObject<{
112
112
  op: z.ZodLiteral<"delete">;
113
113
  key: z.ZodString;
114
114
  scope: z.ZodOptional<z.ZodEnum<{
115
- instance: "instance";
116
115
  device: "device";
116
+ instance: "instance";
117
117
  }>>;
118
118
  }, z.core.$strict>, z.ZodObject<{
119
119
  op: z.ZodLiteral<"set">;
120
120
  key: z.ZodString;
121
121
  value: z.ZodJSONSchema;
122
122
  scope: z.ZodOptional<z.ZodEnum<{
123
- instance: "instance";
124
123
  device: "device";
124
+ instance: "instance";
125
125
  }>>;
126
126
  }, z.core.$strict>, z.ZodObject<{
127
127
  op: z.ZodLiteral<"keys">;
128
128
  scope: z.ZodOptional<z.ZodEnum<{
129
- instance: "instance";
130
129
  device: "device";
130
+ instance: "instance";
131
131
  }>>;
132
132
  }, z.core.$strict>], "op">;
133
133
  export declare const guestStorageResultSchema: z.ZodUnion<readonly [z.ZodObject<{
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { GUEST_STORAGE_KEY_MAX, GUEST_STORAGE_VALUE_BYTES, GUEST_STORAGE_KEYS_MAX } from "./workspace.js";
2
+ import { GUEST_STORAGE_KEY_MAX, GUEST_STORAGE_VALUE_BYTES, GUEST_STORAGE_KEYS_MAX } from './workspace.js';
3
3
  const identity = z.string().trim().min(1).max(1024);
4
4
  const state = z.enum(['loading', 'ready', 'error']);
5
5
  const worktree = z.object({