ohpichamber-sdk 1.0.0 → 1.1.0

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/API.md CHANGED
@@ -1,14 +1,14 @@
1
1
  # ohpichamber-sdk — developer API reference
2
2
 
3
- What third-party guest authors import and call. Source of truth: `[packages/sdk/src](https://github.com/Shizuku-Yume/ohpichamber/tree/main/packages/sdk/src)`. Longer guides live in the [product docs](https://github.com/Shizuku-Yume/ohpichamber/tree/main/packages/docs/content/docs) (`sdk.mdx`, `sdk/host.mdx`, `sdk/ui.mdx`) and in `[GUEST_SERVICES.md](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/sdk/GUEST_SERVICES.md)` for local services.
3
+ What third-party guest authors import and call. Source of truth: [packages/sdk/src](https://github.com/Shizuku-Yume/ohpichamber/tree/main/packages/sdk/src). Author guides live in the [product docs](https://github.com/Shizuku-Yume/ohpichamber/tree/main/packages/docs/content/docs) (`sdk.mdx`, `sdk/host.mdx`, `sdk/ui.mdx`) and in [GUEST_SERVICES.md](./GUEST_SERVICES.md) for local services.
4
4
 
5
5
  **Package:** `ohpichamber-sdk`
6
6
 
7
7
  **API version:** manifest `apiVersion: 1`, wire envelope `v: 2` (private `MessagePort` bootstrap)
8
8
 
9
- **Runtimes that load guests:** web, desktop, and mobile. Mobile panels and pages need their manifest opt-in.
9
+ **Runtimes that load guests:** Web and Electron. `loadGuestCatalog` currently marks mobile surfaces `unsupported`, so mobile opt-in fields (`panel.mobile`, `page.mobile`) are accepted by the SDK schema but inactive in the current mobile shell.
10
10
 
11
- Wire `v: 2` is the private bootstrap transport; manifest `apiVersion` stays `1` because the manifest/`contributes` schema did not change. SDK 3 refuses the pre-M3 window `hello` and names the mismatch in the pane instead of waiting for a timeout; a v1 bootstrap announcement is dropped without granting anything.
11
+ Wire `v: 2` is the private bootstrap transport; manifest `apiVersion` stays `1` because the `manifest`/`contributes` schema did not change. The host refuses a `v: 1` window `hello` and names the mismatch in the pane instead of waiting for a timeout; a `v: 1` bootstrap announcement is dropped without granting anything.
12
12
 
13
13
  Two entrypoints:
14
14
 
@@ -44,12 +44,12 @@ Two entrypoints:
44
44
  Bundle with the SDK helper from the guest folder (`--node` targets Node for the service):
45
45
 
46
46
  ```bash
47
- bunx openchamber-guest-bundle panel/main.ts panel/main.js
48
- bunx openchamber-guest-bundle --node service/main.ts service/main.js
49
- bunx openchamber-guest-check # says what the host would refuse
47
+ bunx ohpichamber-guest-bundle panel/main.ts panel/main.js
48
+ bunx ohpichamber-guest-bundle --node service/main.ts service/main.js
49
+ bunx ohpichamber-guest-check # says what the host would refuse
50
50
  ```
51
51
 
52
- Zip or folder for install should include at least: `package.json`, `panel/index.html`, `panel/main.js`, and any declared `icon.svg` / `service/main.js`. Skip `node_modules` and TypeScript sources. Zip and git installs land in `{dataDir}/extensions/{id}`. See also `[GUEST_SERVICES.md](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/sdk/GUEST_SERVICES.md)`.
52
+ Zip or folder for install should include at least: `package.json`, `panel/index.html`, `panel/main.js`, and any declared `icon.svg` / `service/main.js`. Skip `node_modules` and TypeScript sources. Zip and git installs land in `{dataDir}/extensions/{id}`. See [GUEST_SERVICES.md](./GUEST_SERVICES.md).
53
53
 
54
54
  ---
55
55
 
@@ -61,7 +61,7 @@ import { connectHost, HostRequestError } from 'ohpichamber-sdk';
61
61
  const host = connectHost();
62
62
  ```
63
63
 
64
- Throws `HOST_UNAVAILABLE` when there is no `window`. Outside an iframe (`parent === self`) it still returns a client, but every call rejects with `HOST_UNAVAILABLE`. The host bootstrap runs before authored Guest metadata and scripts. It creates a per-document private `MessageChannel`, transfers one end to the exact parent, and receives the normal SDK port over that private channel. `connectHost` consumes that port through an internal same-document event; iframe `load` and window-message connect-port envelopes never grant capabilities. Call `dispose()` on teardown; in-flight RPCs then reject as `HOST_UNAVAILABLE`. Silent host for 20s → …
64
+ Throws `HOST_UNAVAILABLE` when there is no `window`. Outside an iframe (`parent === self`) it still returns a client, but every call rejects with `HOST_UNAVAILABLE`. The host bootstrap runs before authored Guest metadata and scripts, creating a per-document private `MessageChannel`, transferring one end to the exact parent, and receiving the SDK port over that private channel. `connectHost` consumes that port through an internal same-document event; iframe `load` and window-message envelopes never grant capabilities. Call `dispose()` on teardown; in-flight RPCs reject as `HOST_UNAVAILABLE`. In-flight RPCs time out after 20 s with `HOST_TIMEOUT`.
65
65
 
66
66
  ### 1.1 Subscriptions (host pushes)
67
67
 
@@ -71,12 +71,12 @@ Each returns an unsubscribe function. State subscriptions replay the last known
71
71
  | Method | Payload | Notes |
72
72
  | ------------------------------ | ----------------------- | ------------------------------------------------------------ |
73
73
  | `onReady(listener)` | `HostReadyContext` | First snapshot and later full refreshes |
74
- | `onDirectory(listener)` | `string | null` |
75
- | `onSession(listener)` | `SessionSnapshot | null` |
74
+ | `onDirectory(listener)` | `string \| null` | |
75
+ | `onSession(listener)` | `SessionSnapshot \| null` | |
76
76
  | `onSessionLifecycle(listener)` | `SessionLifecycleEvent` | `{ sessionId, phase }` — `started` / `completed` / `failure` |
77
77
  | `onConnection(listener)` | `GuestConnection` | `{ connected, account }` |
78
78
  | `onSettings(listener)` | `GuestSettings` | Declared integration fields only (`Record<string, string>`) |
79
- | `onItem(listener)` | `GuestItem | null` | The item this surface was opened for: the chip (`AttachIssueRequest`), a message (`GuestMessageItem`), or a session (`GuestSessionItem`); `null` from the rail icon or + menu |
79
+ | `onItem(listener)` | `GuestItem \| null` | The item this surface was opened for: the chip (`AttachIssueRequest`), a message (`GuestMessageItem`), or a session (`GuestSessionItem`); `null` from the rail icon or + menu |
80
80
  | `onStatusControl(listener)` | `{ id, value? }` | Host Work Status control activation. Register synchronously; only status frames with advertised status controls receive events |
81
81
  | `onPopoverClosed(listener)` | `{ id, reason }` | Dismissal of this frame's anchored popover. Events go to the owner, are not replayed, and identify the opening being closed |
82
82
  | `onResolve(handler)` | `{ command, args }` → `Promise<AttachIssueRequest \| null>` | Answers a `contributes.commands` slash command. Return the chip to attach, `null` for nothing (the user sees a short notice), or throw (the message reaches the user). One handler at a time |
@@ -96,24 +96,21 @@ Each returns an unsubscribe function. State subscriptions replay the last known
96
96
 
97
97
  | Field | Type | Meaning |
98
98
  | -------------- | ------------------------ | ---------------------------------------------------------------------------------------- |
99
- | `theme.mode` | `'light' | 'dark'` |
99
+ | `theme.mode` | `'light' \| 'dark'` | |
100
100
  | `theme.tokens` | surfaces, text, interaction states, `primary`, status colors, `font`, `fontSize` (the app's body text in px, follows the interface font size; absent from older hosts), `mono`, `radius` | Pass to `applyHostReady` before mounting UI |
101
101
  | `locale` | `string` | Host language tag |
102
- | `directory` | `string | null` |
102
+ | `directory` | `string \| null` | |
103
103
  | `session` | snapshot or `null` | Title falls back to `id`. `busy` is live status. `model` is `providerID/id` when present |
104
104
  | `surface` | `'panel' \| 'dialog' \| 'page' \| 'background' \| 'status' \| 'file' \| 'popover' \| 'block'` | Where the host mounted this frame |
105
105
  | `popover` | optional `{ id, data }` | Present in a host-created popover frame. `data` is bounded JSON from the owning frame |
106
106
  | `connection` | `{ connected, account }` | Integration link state; a tracker extension without an integration gets its tracker account |
107
107
  | `settings` | `Record<string, string>` | Declared keys only, without `secret` fields |
108
- | `item` | `GuestItem | null` | Set when the user clicked this guest's chip on the composer, or ran one of this guest's `contributes.actions`. Narrow with `isGuestMessageItem` / `isGuestSessionItem` / `isGuestAttachItem` / `isGuestLinkItem` |
108
+ | `item` | `GuestItem \| null` | Set when the user clicked this guest's chip on the composer, or ran one of this guest's `contributes.actions`. Narrow with `isGuestMessageItem` / `isGuestSessionItem` / `isGuestAttachItem` / `isGuestLinkItem` |
109
109
 
110
110
 
111
- `theme.tokens` includes `primaryText`, `successText`, `warningText`, `errorText`, and `infoText`. The host computes these for text on neutral surfaces and the UI kit's tinted controls. Keep using the base colors for fills and `primaryForeground` for text on a solid primary fill.
112
-
113
- `features` is optional and only advertises implemented host operations: `deviceStorage?: true`, `statusControls?: true`, and `popovers?: true`. Optional syntax tokens are `syntaxKeyword`, `syntaxString`, `syntaxNumber`, `syntaxFunction`, `syntaxType`, `syntaxComment`, `syntaxVariable`, and `syntaxOperator`. `applyHostReady` exposes each as `--oc-syntax-*` and the matching legacy `--syntax-*` name, and clears a missing token on a later snapshot. Use a semantic-token fallback in guest CSS when supporting older hosts.
114
-
115
- `applyHostReady` exposes the computed colors as `--primary-text`, `--success-text`, `--warning-text`, `--error-text`, and `--info-text`, with matching `--oc-*-text` aliases. These are required theme fields. Apply each `onReady` snapshot to update them when the theme changes.
111
+ `theme.tokens` includes `primaryText`, `successText`, `warningText`, `errorText`, and `infoText` for text on neutral surfaces and tinted controls; keep using base colors for fills and `primaryForeground` on a solid primary fill. `applyHostReady` exposes these as `--primary-text`, `--success-text`, `--warning-text`, `--error-text`, `--info-text` (and `--oc-*-text`), plus optional syntax tokens (`syntaxKeyword`, `syntaxString`, `syntaxNumber`, `syntaxFunction`, `syntaxType`, `syntaxComment`, `syntaxVariable`, `syntaxOperator`) as `--oc-syntax-*` and `--syntax-*` (missing tokens clear on later snapshots). Apply each `onReady` snapshot to pick up theme changes.
116
112
 
113
+ `features` is optional and advertises implemented host capabilities: `deviceStorage?: true`, `statusControls?: true`, `popovers?: true`, `lateGenerateResults?: true`, and `microphone?: true`.
117
114
  `GuestItem` is `AttachIssueRequest | GuestMessageItem | GuestSessionItem | GuestSelectionItem | GuestFileItem | GuestDiffItem | GuestLinkItem`:
118
115
 
119
116
  ```ts
@@ -157,9 +154,9 @@ Access tokens never appear in `ready` or in request results.
157
154
  | ----------------- | --------------------------------- | ------------------------------ | ------------------------------------------------------------------------------------- |
158
155
  | `toast` | `{ kind: 'info' \| 'success' \| 'error', message, copy?, dismiss?, persistent? }` | `Promise<void>` | Show a toast, optionally with host-owned Copy and OK buttons; see Toast buttons below |
159
156
  | `openUrl` | `url: string` | `Promise<void>` | Open an http(s) URL. In the desktop app with a project open, a local address (`localhost`, `127.0.0.1`, `[::1]`) opens in the browser panel beside the chat, and other links follow the user's setting for chat links; elsewhere the system browser opens it |
160
- | `openSurface` | `surfaceId: string` | `Promise<void>` | Show that surface; resolves once it is on screen, rejects `NO_DIRECTORY` or `UNSUPPORTED` when it cannot open. On the phone it opens the matching workspace tab (Changes, Files, Terminal, Notes, or an extension panel that opted into the phone) and rejects `UNSUPPORTED` for anything else |
161
- | `writeClipboard` | `text: string` | `Promise<void>` | Copy in the host (1–32000 chars) |
162
- | `compose` | `{ text, mode?: 'append' | 'replace' }` | `Promise<void>` |
157
+ | `openSurface` | `surfaceId: string` | `Promise<void>` | Show that surface; resolves once visible, rejects `NO_DIRECTORY` or `UNSUPPORTED` when it cannot open |
158
+ | `writeClipboard` | `text: string` | `Promise<void>` | Copy in the host (1–32 000 chars) |
159
+ | `compose` | `{ text, mode?: 'append' \| 'replace' }` | `Promise<void>` | Write text into the current composer |
163
160
  | `attach` | `AttachIssueRequest` | `Promise<void>` | Composer chip, alongside other attached items |
164
161
  | `startSession` | `StartSessionRequest` | `Promise<{ sessionId, sent }>` | Create session (+ optional worktree), write snapshot. `text` can become first message |
165
162
  | `prompt` | `{ text, send?: boolean }` | `Promise<{ sent }>` | Current session: omit/`false` = replace-compose; `send: true` = send |
@@ -169,20 +166,20 @@ Access tokens never appear in `ready` or in request results.
169
166
  | `oauthDisconnect` | — | `Promise<void>` | Drop guest tokens / Linear connection |
170
167
  | `request` | `{ method, path, query?, body? }` | `Promise<{ status, body }>` | HTTPS call on declared `apiOrigin`. Host attaches auth |
171
168
  | `serviceRequest` | same shape as `request` | `Promise<{ status, body }>` | Proxy to this guest's local service on loopback |
172
- | `serviceStatus` | — | `Promise<{ status }>` | `stopped` |
169
+ | `serviceStatus` | — | `Promise<{ status }>` | `'stopped' \| 'starting' \| 'ready' \| 'failed'` |
173
170
  | `readFile` | `path: string` | `Promise<{ content }>` | UTF-8 text. Relative = inside the open project (`files`); `/…` or `~/…` = declared `filesystem` pattern |
174
171
  | `writeFile` | `path: string, content: string` | `Promise<{ written: true }>` | Atomic (temp + rename), creates parent folders. Same path rules |
175
172
  | `listDir` | `path: string` | `Promise<{ entries }>` | `{ name, kind: 'file' \| 'directory' \| 'other' }[]`, sorted, capped at 2 000. Same path rules |
176
173
  | `stat` | `path: string` | `Promise<{ kind, size, mtime }>` | `kind` adds `'missing'`; a missing path is not an error. Same path rules |
177
174
  | `setBadge` | `count: number \| null` | `Promise<void>` | Number on this guest's rail icon, 0–999 (clamped); `null` clears. Opening the panel clears it too. In memory only |
178
- | `openCommit` | `sha: string` | `Promise<void>` | Show that commit of the open project in the host's Diff view (commit scope). 7–64 hex characters; the host reads the commit itself. `NO_DIRECTORY` without a project, `NOT_FOUND` for an unknown commit, `UNSUPPORTED` where the host has no Diff view. On the phone it opens the Changes tab on that commit |
179
- | `openWalkthrough` | `{ base: string }` | `Promise<void>` | Show Changes Walkthrough on "This branch" of the open project's checked-out branch, compared with `base`: a branch name, a remote-tracking branch of the repository's bound remote (`origin/main`), or a full `refs/heads/…` / `refs/remotes/…` ref. A bare name takes the bound remote's copy when it has one, as the view's base picker does; a base written as a remote ref (`origin/main`, `refs/remotes/…`) must be that remote-tracking branch and never falls back to a local branch of the same name. Without a bound remote only local branches qualify, so a remote ref rejects there. The base becomes the branch's chosen base; the user can still change it or the scope, and nothing is generated until they click Generate. A base the repository does not have, another remote's branch, or the branch itself rejects `NOT_FOUND` and changes nothing. `NO_DIRECTORY` without a project, `NOT_FOUND` outside a repository or on a detached HEAD, `HOST_UNAVAILABLE` when the repository could not be read or its worktree is still being created, `UNSUPPORTED` on the phone, in Mini Chat and in VS Code. It works in the repository the view shows for the frame's folder, a nested one when that is selected. After `openSession` the extension's frames load again for the new chat, so save what to open with `storage` first and call it from the new frame once `onDirectory` reports the session's directory |
180
- | `setHeight` | `height: number` | `Promise<void>` | Content height in CSS px. The Work Status section sizes its frame to it, clamped to 24–480; taller content scrolls inside. A page docked to a shared surface grows or shrinks its dock to it (a width for a `left`/`right` dock), from 24 px up to half the panel. Other surfaces ignore it |
175
+ | `openCommit` | `sha: string` | `Promise<void>` | Show that commit of the open project in the host's Diff view (commit scope). 7–64 hex chars. `NO_DIRECTORY` without a project, `NOT_FOUND` for an unknown commit, `UNSUPPORTED` where the host has no Diff view |
176
+ | `openWalkthrough` | `{ base: string }` | `Promise<void>` | Show Changes Walkthrough on "This branch" of the open project's checked-out branch, compared with `base` (a branch name, a remote-tracking branch of the bound remote like `origin/main`, or `refs/heads/…` / `refs/remotes/…`). A bare name prefers the bound remote's copy when present; a remote ref requires that remote-tracking branch and never falls back to a local branch. Without a bound remote, only local branches qualify. Unknown base/branch or detached HEAD rejects `NOT_FOUND`; `NO_DIRECTORY` without a project; `HOST_UNAVAILABLE` if unreadable or worktree is creating; `UNSUPPORTED` in Mini Chat or mobile. After `openSession` the frames reload, so persist state via `storage` before navigating |
177
+ | `setHeight` | `height: number` | `Promise<void>` | Content height in CSS px. Work Status clamps to 24–480 (taller content scrolls); docked shared surfaces size 24 px up to half the panel; other surfaces ignore it |
181
178
  | `setStatusControls` | `GuestStatusControl[]` | `Promise<void>` | Replace host-rendered controls for this mounted status frame. Requires `features.statusControls`; old hosts reject with `UNSUPPORTED` |
182
179
  | `openPopover` | `GuestPopoverRequest` | `Promise<void>` | Open a sandboxed frame outside this frame's bounds, anchored to a rectangle in its viewport. Requires `features.popovers` |
183
180
  | `closePopover` | `id, reason?: 'closed' \| 'escape'` | `Promise<void>` | Close this frame's matching opening, or the popover frame itself. A stale id cannot close a replacement |
184
181
  | `setPopoverAnchorActive` | `id, active: boolean` | `Promise<void>` | Report anchor pointer/focus activity so the host can allow travel between the anchor and popover |
185
- | `generate` | `{ prompt, system?, maxOutputTokens? }` | `Promise<{ text }>` | One-off text from the user's Small Model (capability `model`). No session, no history; the host picks the model. Waits up to 90 s |
182
+ | `generate` | `{ prompt, system?, maxOutputTokens? }` | `Promise<{ text }>` | One-off text from the user's Small Model (capability `model`). No session or history; waits up to 960 s (`GUEST_GENERATE_TIMEOUT_MS`) |
186
183
  | `reportFileChange` | `{ dirty, edited }` | `void` | File editors only. `dirty` against the last saved version; `edited` when the document itself changed, which holds autosave back until edits stop |
187
184
  | `requestFileSave` | — | `void` | File editors only. Save now, as Cmd/Ctrl+S does |
188
185
  | `reportFileUnsupported` | — | `void` | File editors only. This file cannot be opened here; the host shows its source and a notice |
@@ -231,11 +228,16 @@ Await subscription registration to handle refusal, then retain its returned unsu
231
228
 
232
229
  Snapshots carry `state: 'loading' | 'ready' | 'error'`; session snapshots also carry per-directory `coverage`. Loading/error may retain data. Only `ready` establishes complete empty success. Reads use existing shared stores and hydration, never a git scan per extension request.
233
230
 
234
- Projects contain `id`, `name`, `directory`. Worktrees contain `directory`, `name`, `branch`, and `status: 'ready' | 'pending' | 'invalid' | 'missing'`. Session records contain `id`, `title`, `projectId`, `directory`, optional `agent`, `parentId`, `createdAt`, `updatedAt`, `archivedAt`, `worktree`, `activity`, `outcome`, `items`, `links`, `inWork`, and `unread`. Item references contain only this extension's `id` and optional `data`. `links` is every thread linked to the session, whoever linked it (the user, the agent through `session.link`, this extension or another), each with `title`, `url`, `kind: 'issue' | 'change'` (`change` is a pull, merge or change request) and `linkedAt`; read-only, and a change to it sends a new snapshot. Hosts older than this field omit it. `inWork` is `true` when the session sits in the sidebar's In work block and always `false` while the user has In work turned off; turning the setting on or off sends a new snapshot. Hosts older than this field omit it. `unread` is `true` when the session's last turn ended and nobody has opened the session since, the mark the sidebar shows; OMP keeps it, so it survives restarts and clears on every device the user reads it on. Hosts older than this field omit it. `tool` is what the session works with while `activity` is `running`: the tool call running now, or the one that ended last while the agent thinks about its result. It has `name` as OMP calls it (`read`, `edit`, `bash`) and `target`, the file or folder the call names relative to the session's `directory` (the bare name for one outside it), or `null` when it names none; a shell command's text never appears. It is `null` whenever the session does not run. `context` is how full the context window was after the session's latest step: `tokens` it held and `limit`, the model's window, or `null` when the host does not know it. It is `null` before the host has seen a step and after a compaction until the next step measures the window. Hosts older than these fields omit them. `tokens` is the cumulative session usage described above, or `null` before any nonzero usage; older hosts omit it.
231
+ Projects contain `id`, `name`, `directory`. Worktrees contain `directory`, `name`, `branch`, and `status: 'ready' | 'pending' | 'invalid' | 'missing'`. Session records contain `id`, `title`, `projectId`, `directory`, optional `agent`, `parentId`, `createdAt`, `updatedAt`, `archivedAt`, `worktree`, `activity`, `outcome`, `items`, `links`, `inWork`, and `unread` (newer optional fields are omitted by older hosts):
235
232
 
236
- `agent` is the session's agent name, available for both top-level sessions and subsessions with the `sessions` capability. It is omitted when the host has no agent name or predates this field. Agent changes send a new snapshot.
237
-
238
- `activity` is `unknown`, `idle`, `running`, `retrying`, `waiting-permission`, or `waiting-question` (the agent put a form, a page or a secret card to the user and is waiting on the answer). `outcome` is the last observed `completed` or `failed` turn, or `null` when unknown or working. Outcomes are in memory for the latest 2,000 observed sessions, reset on runtime switch, and are not reconstructed from persisted history. A later idle event preserves an observed failure until another run starts. `completed` never means the extension's task is Done. Blocking-request contents and approve/reply actions are not exposed.
233
+ - `items` holds only this extension's `id` and optional `data`.
234
+ - `links` lists every thread linked to the session (`title`, `url`, `kind: 'issue' | 'change'`, `linkedAt`), read-only.
235
+ - `inWork` is `true` when the session sits in the sidebar's In work block (`false` when the setting is off).
236
+ - `unread` is `true` when the last turn ended and nobody has opened the session since (persisted in OMP).
237
+ - `tool` is present while `activity` is `running`: `{ name, target }` for the running or just-finished tool (`target` is relative to `directory` or bare name outside it, `null` when none; shell command text never appears).
238
+ - `context` (`{ tokens, limit }`) and `tokens` hold latest-step context fill and cumulative session usage as described above.
239
+ - `agent` is the session's agent name for top-level sessions and subsessions.
240
+ - `activity` is `unknown`, `idle`, `running`, `retrying`, `waiting-permission`, or `waiting-question`. `outcome` is the last observed `completed` or `failed` turn (`null` when unknown or working), kept in memory for the latest 2,000 observed sessions and reset on runtime switch. An idle event preserves an observed failure until another run starts. Blocking-request contents and approve/reply actions are not exposed.
239
241
 
240
242
  ### Running shells
241
243
 
@@ -271,20 +273,19 @@ Omit `options`, or pass `{ scope: 'instance' }`, for this existing server-owned
271
273
 
272
274
  ### Full-screen pages
273
275
 
274
- `contributes.page: true` reuses `panel.entry`; `{ entry: 'panel/page.html', title?: 'Board' }` uses separate package HTML and needs no `panel.entry`, so a package can be only a full-screen page; like a status section it then only hosts itself, and `page: true`, `attach`, `actions`, and `commands` still need `panel.entry` or `background.entry`. A page needs the same installed/approved/enabled state as a panel. The sidebar's Extension pages menu is the only page opener; `openSurface` does not open it. `ctx.surface` is `page`, `close()` closes it, and reload or runtime switch returns to chat. Pages use the existing sandbox and capabilities on web/desktop. On the phone a page shows when it opts in (`page: { …, mobile: true }`, or `page: true` with `panel.mobile: true`): it is listed in the sessions list's More menu and opens full screen with a back arrow, so lay it out for about 360px and touch. VS Code remains unsupported.
276
+ `contributes.page: true` reuses `panel.entry`; `{ entry: 'panel/page.html', title?: 'Board' }` uses separate package HTML and needs no `panel.entry` (`page: true`, `attach`, `actions`, and `commands` still need `panel.entry` or `background.entry`). Pages use the same installed/approved/enabled gate as panels, open only from the sidebar's Extension pages menu (`openSurface` does not open them), report `ctx.surface === 'page'`, close via `close()`, and reset to chat on reload or runtime switch.
275
277
 
276
278
  ### Work Status sections
277
279
 
278
- `contributes.statusSection: true` reuses `panel.entry`; `{ entry: 'status/index.html', title?: 'Recent commits', height?: 160, defaultExpanded?: false, requiresProject?: true }` uses separate package HTML (`.html`, inside the package, built scripts checked at install). The object form needs no `panel.entry`, so an extension can ship only a section and no rail icon. `title` is 1 to 60 characters and replaces `panel.name` on the section header; the icon is `panel.icon`. `height` (24 to 480, default 120) is the frame height before your page calls `setHeight`. Omitted `defaultExpanded` preserves the existing expanded default; a saved user expansion choice still wins. `requiresProject` uses the actual Work Status directory and hides the section when no project is open. The section appears in the chat's Work Status panel and in its section chooser, where the user can hide it or move it. `ctx.surface` is `status`. The frame runs only while the panel is shown and the section is expanded, so keep no state in it that you cannot rebuild. It gets the same sandbox, directory, session, theme, grants, and service as a panel. A status-only package may declare `capabilities`, `service`, `integration`, `filesystem`, and a page with its own `entry`; `page: true`, `attach`, `actions`, and `commands` still need `panel.entry` or `background.entry`. Web, desktop and the phone, which shows the section in its Status tab without any opt-in; the frame is then the phone's width and `ready.device` says so. `apiVersion` remains 1; VS Code remains unsupported.
280
+ `contributes.statusSection: true` reuses `panel.entry`; `{ entry: 'status/index.html', title?: 'Recent commits', height?: 160, defaultExpanded?: false, requiresProject?: true }` uses separate package HTML (checked at install). The object form needs no `panel.entry`. `title` (1–60 chars) replaces `panel.name` on the header; `height` (24–480, default 120) sets initial height before `setHeight`. Omitted `defaultExpanded` preserves the default (a saved user choice wins). `requiresProject` hides the section when no project is open. `ctx.surface` is `'status'`; frames mount only while the panel is visible and expanded, so keep no state you cannot rebuild.
279
281
 
280
- `setStatusControls` accepts zero to four declarations. A button is `{ kind: 'button', id, label, disabled? }`; a select is `{ kind: 'select', id, label, value, options, disabled? }`, with one to 16 unique options and a selected value in that list. IDs are kebab-case and at most 40 characters; labels are 1 to 60 characters; option values are 1 to 80 characters. Register `onStatusControl` synchronously after `connectHost`, then feature-gate `setStatusControls` with `features.statusControls`. Buttons receive no `value`; select events carry a declared value. The host rejects stale, unknown, disabled, or invalid controls. It accepts at most 20 changed control publications per second per frame and avoids semantic no-op updates. Controls exist only for the expanded, mounted status frame that registered them. Folding or hiding the section removes controls and listeners. A project change clears header controls; publish them again from `onDirectory`. Workspace subscriptions remain active. Old hosts return `UNSUPPORTED`; keep a body control visible until `setStatusControls` succeeds.
282
+ `setStatusControls` accepts 0–4 declarations (`kind: 'button' | 'select'`, id kebab-case 1–40 chars, label 1–60 chars; selects take 1–16 unique options with values 1–80 chars and a matching `value`). Register `onStatusControl` synchronously after `connectHost` and gate `setStatusControls` on `features.statusControls`. Controls belong to the expanded mounted frame and clear on fold, hide, or project change (re-publish from `onDirectory`). The host rejects stale, unknown, disabled, or invalid controls, and enforces 20 changed publications per second per frame. Keep a fallback body control visible until `setStatusControls` succeeds on older hosts (`UNSUPPORTED`).
281
283
 
282
284
  ### File editors
283
285
 
284
- `contributes.fileEditors` lists up to 8 editors: `{ id: 'canvas', title: 'Excalidraw', match: ['*.excalidraw', '*.excalidraw.md'], entry: 'editor/index.html' }`. `match` holds 1 to 16 file-name patterns, compared case-insensitively with the name only (no `/`); `*` is any run of characters, `?` one, and a pattern must have at least one character that is not a wildcard. `entry` is package `.html` with built scripts, checked at install. `content` is `"text"` (the default) or `"binary"`: a text editor claims only text files and gets the text with `\n` line endings (the host restores the file's own on write); a binary editor claims any matching file, gets its bytes as a `Uint8Array`, returns bytes, and has no source view, and the host saves its unsaved changes before it moves to or from fullscreen. When the user opens a matching file in Files, the viewer loads your page instead of its own preview; the first enabled, approved extension in the list wins, ahead of the built-in viewers. `ctx.surface` is `file`. The phone's Files tab opens your editor too, without an opt-in, at the phone's width.
285
-
286
- The host keeps the file. It hands you the text (`onFileOpen`), asks for the edited text when it saves or when the user switches to the source view or fullscreen (`onFileSnapshot`), and tells you which snapshot reached the disk (`onFileSaved`). Saving, autosave, the unsaved-changes prompt, line endings, and external changes are the host's. Your page never reads or writes the file and needs no `files` capability for it. Report every change with `reportFileChange`; `createFileSaveTracker(version)` does the dirty bookkeeping. A file you cannot open goes back with `reportFileUnsupported`. Files over 20 000 000 characters (text) or bytes (binary) stay with the host's own view, and a snapshot over that is refused. An editor that hands back the wrong kind (text from a binary editor or bytes from a text one) fails the save. The page is reloaded, with the file handed over again, when the file changes on disk, the user discards changes, or the editor moves to or from fullscreen. A file-editor-only package may declare `capabilities`, `service`, `integration`, `filesystem`, and a page with its own `entry`; `page: true`, `attach`, `actions`, and `commands` still need `panel.entry` or `background.entry`. Web and desktop only; `examples/checklist-editor` is a complete editor.
286
+ `contributes.fileEditors` lists up to 8 editors: `{ id: 'canvas', title: 'Excalidraw', match: ['*.excalidraw', '*.excalidraw.md'], entry: 'editor/index.html' }`. `match` holds 1–16 case-insensitive filename patterns (no `/`, `*` any run, `?` one char, at least one non-wildcard). `content` is `"text"` (default; text files only, `\n` normalized, host restores original line endings on write) or `"binary"` (`Uint8Array`, no source view; host saves unsaved changes before fullscreen transitions). The first enabled, approved matching editor wins ahead of built-in viewers (`ctx.surface === 'file'`). Web and desktop only; `examples/checklist-editor` is a complete editor.
287
287
 
288
+ The host owns file I/O, saving, autosave, unsaved prompts, and external change detection (no `files` capability needed). It sends content via `onFileOpen`, requests snapshots via `onFileSnapshot` (`'save' | 'handoff'`), and confirms disk writes via `onFileSaved`. Report edits with `reportFileChange` (`createFileSaveTracker(version)` handles dirty state) and reject unsupported files with `reportFileUnsupported`. Files over 20 000 000 chars/bytes stay with the host view, wrong-kind snapshots fail the save, and external changes, discards, or fullscreen toggles reload the frame.
288
289
  `sent` **values** (`startSession` / `prompt`): `sent` | `no-model` | `skipped` | `failed`. After `no-model` / `failed` on `startSession`, the session still exists.
289
290
 
290
291
  **File path rules** (`readFile` / `writeFile` / `listDir` / `stat`): a relative path (`README.md`, `src/x.ts`, `.`) is joined to the project that is open when the call runs and needs the `files` capability; no open project is `NO_DIRECTORY`. A path starting with `/` or `~/` is outside the project, must match one of the package's `contributes.filesystem` globs, and needs the `filesystem` capability. Any `..` segment, a backslash, or a symlink that leads out of the allowed tree is `BAD_PATH`. The host compares canonical (realpath) paths, so `/tmp/x` on macOS is checked as `/private/tmp/x` and a pattern's literal prefix is canonicalized the same way. Content over 2 000 000 characters is `FILE_TOO_LARGE` in both directions; an OS permission refusal is `DENIED`.
@@ -297,35 +298,29 @@ The host keeps the file. It hands you the text (`onFileOpen`), asks for the edit
297
298
 
298
299
  `dismiss: true` adds OK. `persistent: true` disables automatic expiry and always adds OK regardless of `dismiss`, so every persistent toast can be closed. Omitted or false `persistent` retains the host's usual duration.
299
300
 
300
- Copy leaves the toast open, reports success on the button, and shows a retryable error when the clipboard fails. OK dismisses only its own toast. Buttons use the host's locale and clipboard helper. They retain only the supplied text and toast identity, work after guest disposal or a runtime switch, and never call back into the extension. The `toast` promise resolves after display acknowledgement, without waiting for a click. Web and desktop use the same behavior; extension support on other runtimes is unchanged.
301
+ Copy leaves the toast open, reports success on the button, and shows a retryable error when the clipboard fails. OK dismisses only its own toast. Buttons use the host's locale and clipboard helper, retain only the supplied text and toast identity, work after guest disposal or a runtime switch, and never call back into the extension. The `toast` promise resolves after display acknowledgement.
301
302
 
302
303
  ### Blocks in the chat
303
304
 
304
- `contributes.blocks` adds components agents write in a UI block, drawn by your page with the grants of your panel. `host.onBlock` gives the call. `host.setHeight` sizes the frame, up to `GUEST_BLOCK_HEIGHT_MAX`. Set `answers: true` on a component that answers: agents are told to ask with it, a waiting page adds no Send button, and the block offers a note the agent reads with the answer; a note alone also answers, with `answered` holding its text. `host.answerBlock(text)`, called from a click, hands the agent `text` as a block's button does and starts its next turn; one answer per block, up to `GUEST_BLOCK_ANSWER_MAX` characters, and `answered` shows it after a reload. Without a click, or on a block that cannot take an answer, it rejects with `HOST_REJECTED`. The phone draws blocks too, without any opt-in, at the reply's width (about 360px).
305
+ `contributes.blocks` adds components agents write in a UI block, drawn by your page with the grants of your panel. `host.onBlock` gives the call. `host.setHeight` sizes the frame, up to `GUEST_BLOCK_HEIGHT_MAX`. Set `answers: true` on a component that answers: agents are told to ask with it, a waiting page adds no Send button, and the block offers a note the agent reads with the answer; a note alone also answers, with `answered` holding its text. `host.answerBlock(text)`, called from a click, hands the agent `text` as a block's button does and starts its next turn; one answer per block, up to `GUEST_BLOCK_ANSWER_MAX` characters, and `answered` shows it after a reload. Without a click, or on a block that cannot take an answer, it rejects with `HOST_REJECTED`.
305
306
 
306
307
  ### Background actions
307
308
 
308
- `contributes.actions[].mode` accepts `"open"` or `"background"`. Omitted mode keeps the existing panel/dialog routing and `onItem` delivery. Background actions load `background.entry` when declared, otherwise `panel.entry`. They never use separate attach-dialog HTML. They run on web, desktop and the phone, including connections through the private relay; VS Code does not load extensions. On the phone an open-mode action needs `panel.mobile: true`, a background action does not.
309
+ `contributes.actions[].mode` accepts `"open"` or `"background"`. Omitted mode keeps panel/dialog routing and `onItem` delivery. Background actions load `background.entry` when declared, otherwise `panel.entry` (never attach-dialog HTML).
309
310
 
310
- `contributes.background` is `{ entry: "<package-local .html>" }`. It starts on demand for an action or command and adds no visible UI. With a background entry, `panel.entry` may be omitted: there is no rail icon, attach picker, or full-screen page, but background actions, slash commands, storage and granted APIs work. Identity remains in `panel.id/name/icon`. Open-mode actions, `page: true`, and enabled `attach` require `panel.entry`; a page with its own `entry` does not; invalid combinations fail as `invalid-panel`. Without either entry, the extension may declare only `tools` and `providerLogos`. Invalid background paths or a missing entry field fail as `invalid-background`.
311
+ `contributes.background` is `{ entry: "<package-local .html>" }`. It starts on demand for an action or command and adds no rail icon, attach picker, or full-screen page. Identity remains in `panel.id/name/icon`. Open-mode actions, `page: true`, and enabled `attach` require `panel.entry`; invalid combinations fail as `invalid-panel`. With neither `panel.entry` nor `background.entry`, only `tools` and `providerLogos` are allowed.
311
312
 
312
- When both entries exist, the visible panel cannot register the slash-command resolver: the hidden background entry handles `onResolve` and receives `surface: "background"`. Existing panel-only commands retain their current behavior. Clicking an attached chip from a background-only extension shows a no-panel notice; its browser action remains available.
313
+ When both entries exist, `background.entry` handles `onResolve` for slash commands (`surface: "background"`) instead of the visible panel. Clicking an attached chip from a background-only extension shows a no-panel notice; its browser action remains available.
313
314
 
314
- Every background click mounts a fresh sandboxed iframe and sends one `action` request with an invocation `id` and a `GuestActionItem` payload. `host.onAction` receives that message or session item and sends `action-result` with `{ ok: true }` when the handler finishes, or `{ ok: false, error }` when it throws. The error is limited to `GUEST_RESOLVE_ERROR_MAX` characters. The host validates the reply and accepts only the matching invocation from that frame. It sends no acknowledgement for `action-result`.
315
-
316
- `ready.surface` is `"background"` and `ready.item` is `null`. Context updates never replay the action. The session and directory context remain scoped to the clicked target; the item itself is the snapshot captured at click time. Calls that explicitly write the composer still write the currently visible composer. `close()` is a no-op in a background frame; returning from the handler completes the action.
317
-
318
- The 20-second deadline covers loading and execution. At most eight background invocations may run concurrently. Completion, failure, timeout, disabling, lost approval, extension update/removal, runtime switch, and host unmount release the frame and its listeners. Late messages are ignored. Already completed or server-accepted effects are not undone, and the host does not automatically retry actions. A background action has the same declared capabilities as its extension. It does not hide the extension's rail icon.
315
+ Each background click mounts a fresh sandboxed iframe and sends one `action` request (`id`, `GuestActionItem`). `host.onAction` sends `action-result` (`{ ok: true }` or `{ ok: false, error }` capped at `GUEST_RESOLVE_ERROR_MAX` chars); there is no acknowledgement for `action-result`. `ready.surface` is `"background"` and `ready.item` is `null`; context updates never replay the action. The 20 s deadline covers loading and execution, with at most 8 concurrent invocations. Completion, failure, timeout, disabling, lost approval, update/removal, runtime switch, and host unmount release the frame without rolling back completed effects or retrying.
319
316
 
320
317
  See [Actions without opening a panel](./README.md#actions-without-opening-a-panel) for a toast example.
321
318
 
322
319
  ### Late generate answers
323
320
 
324
- A model can take minutes, and the user may close the panel, switch to another project, or reload the frame before `generate` answers. The request still runs to the server's deadline; there is no cancellation. When the answer arrives and the frame that asked is gone, the host keeps it. The next frame of the same extension on the same surface, in the same project and the same window, receives it through `onLateGenerateResult` as soon as it registers a listener; an answer that lands while such a frame already listens arrives at once. Each answer is handed over once. One that reaches the frame after its last listener was removed waits in the SDK for the next listener in that frame. A failed generation is kept as `{ ok: false, code, error }`, so the extension can say what happened. Hidden frames (background actions, and a panel entry the host loads only to answer a slash command) do not advertise the feature: they neither receive kept answers nor leave their own behind.
325
-
326
- `request` is the trimmed `{ prompt, system?, maxOutputTokens? }` the frame sent; use it to tell which of your requests this answers. The extension decides what to show; the host shows nothing of its own.
321
+ A `generate` call runs to the server's deadline with no cancellation even if the panel closes, switches projects, or reloads. If the original frame is gone when the answer arrives, the host keeps it for 1 hour (up to 8 per extension, oldest dropped) in memory for the same extension, surface, project, and window, delivering it once via `onLateGenerateResult` as soon as a listener registers (or immediately if one is active). Failed generations are kept as `{ ok: false, code, error }`. Hidden frames (background actions and slash-command resolver frames) do not receive or leave kept answers. Page reload, app restart, another window, disabling/removing/reinstalling, or withdrawing `model` approval drops kept answers. Older hosts omit `features.lateGenerateResults`.
327
322
 
328
- The host keeps answers in memory for one hour, at most 8 per extension, the oldest dropped first. A page reload, an app restart or another window starts empty: the request belongs to the window that sent it. Disabling, removing or reinstalling the extension, or withdrawing its `model` approval, drops its kept answers. Older hosts do not advertise `features.lateGenerateResults` and never deliver them; the SDK then sends nothing. Extension frames load on web, desktop and the phone, directly or through the private relay; VS Code does not load extensions.
323
+ `request` is the trimmed `{ prompt, system?, maxOutputTokens? }` the frame sent; use it to match against your pending requests.
329
324
 
330
325
  ```ts
331
326
  host.onLateGenerateResult((late) => {
@@ -341,7 +336,7 @@ host.onLateGenerateResult((late) => {
341
336
 
342
337
  The host loads the caller's existing package entry in a fresh `sandbox="allow-scripts"` iframe with `surface: 'popover'`. Render the card from `ready.popover.data` instead of mounting your ordinary page. Apply subsequent theme snapshots without repeating data loads. The child inherits the extension's approved capabilities and existing host APIs. It cannot open another popover or choose an entry, URL or HTML document.
343
338
 
344
- Visible web and desktop panel, page and status frames can advertise this feature, and so can the phone's. Dialogs, background frames, file editors, popovers and VS Code do not. On the phone the popover opens in the app's bottom sheet instead of beside its anchor: the sheet's width, the requested height within the sheet's limit, `setHeight` as usual. The sheet stays until the user closes it, so anchor activity does not close it; closing reports `outside`. `mountPopoverAnchor` opens on mouse hover, on keyboard focus, and on a touch or pen tap. The tap opens the preview in place of the element's own click (your click handler does not run for it; a mouse or keyboard click is unchanged), so put what the click did into the preview when a touch user needs it. Dialogs retain their own modal focus boundary. Older hosts reject opening with `UNSUPPORTED`; retain an inline or click-based detail view for them. Each opening loads a new frame, so cold loading and relay transport can delay the preview.
339
+ Visible Web and Electron panel, page, and status frames advertise `features.popovers`; dialogs, background frames, file editors, and popovers do not. `mountPopoverAnchor` opens on mouse hover, keyboard focus, and touch/pen tap (on touch, the tap replaces the element's click). Older hosts reject with `UNSUPPORTED`. Each opening loads a new frame, so cold loading and relay transport can delay the preview.
345
340
 
346
341
  Only one extension popover is active per host document. Opening another retires the previous one. Escape, outside interaction, owner scrolling, resizing, owner removal and changes to project, runtime, installation or authorization dismiss it. A host modal dialog takes precedence and closes previews. Close events name the opening and one of `escape`, `outside`, `anchor`, `owner`, `closed`, or `replaced`. A closing child uses `host.close()` or `closePopover(ready.popover.id)`. The SDK forwards Escape and pointer/focus activity from the child, whose events cannot bubble across the sandbox.
347
342
 
@@ -371,7 +366,7 @@ Use `mountPopoverAnchor` from `ohpichamber-sdk/ui` for DOM anchors. It measures
371
366
  | `DENIED` | The operating system refused the file access |
372
367
  | `NO_MODEL` | `generate` with no usable Small Model |
373
368
  | `MODEL_FAILED` | The Small Model returned an error |
374
- | `UNSUPPORTED` | This host surface cannot do that (for example `openCommit` without a Diff view, or `openWalkthrough` on the phone or in Mini Chat) |
369
+ | `UNSUPPORTED` | This host surface cannot do that (for example `openCommit` without a Diff view, or `openWalkthrough` in Mini Chat) |
375
370
  | `SERVICE_FAILED` | Service crashed or never became ready |
376
371
  | `REQUEST_FAILED` | `serviceRequest` was sent but got no usable answer; the service may have acted on it |
377
372
  | `RESPONSE_TOO_LARGE` | `request` / `serviceRequest` answer over 8 000 000 bytes; the call ran, ask for a smaller page |
@@ -405,7 +400,7 @@ Use `mountPopoverAnchor` from `ohpichamber-sdk/ui` for DOM anchors. It measures
405
400
  | `generate` prompt / system | 64 000 / 8 000 |
406
401
  | `generate` `maxOutputTokens` | 4 000 |
407
402
  | `generate` answer | 256 000 |
408
- | `generate` timeout | 90 000 ms |
403
+ | `generate` timeout | 960 000 ms |
409
404
 
410
405
 
411
406
  ---
@@ -503,9 +498,9 @@ Used by the OhPiChamber host and by tools that validate packages. Guests rarely
503
498
  {
504
499
  "name": "@acme/hello-panel",
505
500
  "version": "1.0.0",
506
- "openchamber": {
501
+ "ohpichamber": {
507
502
  "apiVersion": 1,
508
- "engines": { "openchamber": ">=1.0.0" },
503
+ "engines": { "ohpichamber": ">=1.0.0" },
509
504
  "id": "acme-hello",
510
505
  "name": "Hello",
511
506
  "icon": "window",
@@ -532,29 +527,29 @@ Used by the OhPiChamber host and by tools that validate packages. Guests rarely
532
527
  | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
533
528
  | `version` | Semver required on install (`1.0.0`) |
534
529
  | `apiVersion` | Must be `1` |
535
- | `engines.openchamber` | Optional. Only `1.0.0` or `>=1.0.0`. Older host → `host-too-old` |
530
+ | `engines.ohpichamber` | Optional. Only `1.0.0` or `>=1.0.0`. Older host → `host-too-old` |
536
531
  | `id`, `name`, `icon` | Beside `contributes`. Older packages keep them in `panel`, and that still works. `id` is kebab-case |
537
532
  | `icon` | Remixicon kebab name (`window`) **or** package `.svg` path. Remixicon needs no file. An `.svg` path must exist on disk or install fails (`invalid-manifest`). No URLs/absolute paths |
538
533
  | `panel.entry` | Optional visible-panel HTML path inside the package. No `..`, absolute path, or URL. Its scripts must be built. Omitting it removes the rail icon and visible views; `background.entry` can still run code. With neither entry, only `tools` and `providerLogos` plus package identity/version/engines are allowed. `hasGuestPage` means a visible panel, not background execution |
539
- | `panel.mobile` | Optional `true`. Shows the panel on the phone, as a tab of the workspace drawer, with its live-screen dock and attach. Lay the page out for about 360px wide and touch (`ready.device` says the form factor). Absent: the phone shows no panel, attach or open-mode action, and a link or chip that would open it keeps its usual meaning or says the extension does not open on the phone. `page: true` follows it; the page object takes its own `mobile: true` |
534
+ | `panel.mobile` | Optional `true` in manifest schema (inactive while `loadGuestCatalog` marks mobile `unsupported`) |
540
535
  | `background.entry` | Optional package-local `.html` path. Loaded on demand for background actions and slash commands, preferred over `panel.entry` for these calls. Adds no rail icon. The file and its built scripts must exist. Malformed declarations are `invalid-background` |
541
- | `attach` | `true` / `"panel"` → + menu opens rail (on the phone, the extension's workspace tab); `"dialog"` → host window (full screen on the phone); omit/`false` → off menus. The phone lists it only with `panel.mobile: true`. Object form `{ "mode": "panel" \| "dialog", "entry"?: "panel/attach.html" }`: `entry` (dialog only, same path rules as `panel.entry`, must exist with built scripts) is the page the dialog loads instead of `panel.entry` |
536
+ | `attach` | `true` / `"panel"` → + menu opens rail; `"dialog"` → host window; omit/`false` → off menus. Object form `{ "mode": "panel" \| "dialog", "entry"?: "panel/attach.html" }`: `entry` (dialog only, same path rules as `panel.entry`, must exist with built scripts) loads instead of `panel.entry` |
542
537
  | `capabilities` | Optional list of `prompt`, `sessions`, `files`, `model`, `shells`, `microphone`. `files` is read **and** write inside the open project; `model` is `generate`; `shells` is the running-shell methods; `microphone` is `openMicrophone`. Approved once at install |
543
538
  | `actions` | Optional, 1–8 entries, unique kebab-case `id`, `label` 1–40 chars, optional `icon` with the `panel.icon` rules, `where: "message" \| "session" \| "selection" \| "file" \| "diff"`, optional `display: "label" \| "icon" \| "both"` on a selection, optional `mode: "open" \| "background"`. Message actions may narrow `roles` to `["user"]` / `["assistant"]`, default both. Session actions may request `payload: ["messages"]`, adding the `conversation` capability. Invalid shape is `invalid-actions`. Default `open` mode opens the guest with `ready.item`, using the attach dialog for `attach: "dialog"` and the rail otherwise. `background` calls `onAction` in a temporary hidden frame; see Background actions above |
544
539
  | `commands` | Optional, 1–8 entries, unique `name` matching `/^[a-z][a-z0-9-]{0,23}$/`, optional `description` 1–80 chars (`invalid-commands`). `/name args` in the chat box calls `onResolve` instead of the model and attaches what it returns. A name the composer already has (built-in, OMP command, skill) is ignored with a console warning |
545
- | `tools` | Optional, 1–16 entries that say how the extension's tool calls look in the chat. `match` is the full tool name OMP reports (`jira_search`), 1–128 chars of `[A-Za-z0-9_.:-]`, with `*` allowed once at the end as a suffix wildcard (`jira_*`). Optional `name` (1–40, the header title when `title` is absent or renders empty), `icon` (Remixicon name or package `.svg` path, same rules as `panel.icon`; the SVG is drawn in the text colour at the glyph size), `title` / `subtitle` templates (1–200, `{input.path}` / `{output.path}` / `{metadata.path}` placeholders, a missing path renders empty, values are cut at 200), `output` `"auto"` (default) \| `"text"` \| `"json"` \| `"markdown"` \| `"code"` \| `"table"` \| `"card"`, `language` (code only), `columns` (table only, 1–16 dotted paths; rows are the output array or `output.items`), `card` (card only, see Tool cards below). Bad shape is `invalid-tools`. An exact `match` beats a wildcard from any extension; among equals the first extension wins. Only an enabled, fully approved extension's rules apply. With Code Mode, a finished script that made one call is matched under the tool's direct name (`example.findings` in the script is `example_findings`) and shows as that tool's row, with `output` being what the script returned; a running script, a script with several calls, and a failed call or a failed script keep the script row |
546
- | `providerLogos` | Optional map of 1–256 OMP provider IDs (`/^[a-z0-9][a-z0-9._-]{0,63}$/`, the ID OMP reports; IDs the app draws with the same bundled logo follow it, like `claude` for `anthropic`) to a package `.svg` or `.png`, up to 1 MiB each. An alias is another key with the same file. Bad shape is `invalid-provider-logos`; a missing, empty or larger file fails install as `invalid-manifest`. Order for one provider: uploaded logo, chosen icon, extension logo, bundled logo, models.dev logo, generic mark. The first enabled, fully approved extension wins a provider. The image keeps its colours; `currentColor` in an SVG follows the theme. No capability and no page needed. Web, desktop and the phone: VS Code loads no extensions |
540
+ | `tools` | Optional, 1–16 entries formatting extension tool calls in chat (`invalid-tools`). `match` is the OMP tool name (`jira_search`), 1–128 chars of `[A-Za-z0-9_.:-]`, with optional trailing `*` (`jira_*`). Exact matches beat wildcards; among equals the first enabled, approved extension wins. Optional `name` (1–40), `icon` (Remixicon or package `.svg`), `title` / `subtitle` templates (1–200, `{input.path}` / `{output.path}` / `{metadata.path}`, missing paths render empty, values capped at 200), `output` (`"auto"` \| `"text"` \| `"json"` \| `"markdown"` \| `"code"` \| `"table"` \| `"card"`), `language` (`code`), `columns` (`table`, 1–16 dotted paths over output array or `output.items`), and `card` (`card`, see Tool cards below). With Code Mode, a finished script making one call matches its direct tool name (`example.findings` → `example_findings`) with the script return value as `output` |
541
+ | `providerLogos` | Optional map of 1–256 OMP provider IDs (`/^[a-z0-9][a-z0-9._-]{0,63}$/`) to package `.svg` or `.png` (up to 1 MiB each). Lookup order: uploaded logo, chosen icon, extension logo, bundled logo, models.dev logo, generic mark. First enabled, approved extension wins; SVG `currentColor` follows the theme. Bad shape is `invalid-provider-logos`; missing/empty/oversized file is `invalid-manifest` |
547
542
  | `fileEditors` | Optional, 1–8 editors: unique kebab-case `id`, `title` 1–60 chars, `match` 1–16 file-name patterns (no `/`, not only wildcards), `entry` package `.html` with built scripts, optional `content` `"text"` (default) or `"binary"` (`invalid-file-editors`). See File editors above |
548
543
  | `filesystem` | Optional, 1–16 globs, each 1–256 chars, starting with `/` or `~/`; `**` spans folders, `*` / `?` stay in one segment; no `..`, empty segment, or backslash (`invalid-filesystem`). Declaring it adds the `filesystem` capability and the dialog lists the globs |
549
544
  | `integration` | Optional. Exactly one of `oauth`, `token`, or `host` (`provider: "linear"` only) |
550
- | `service` | Optional. `entry` must be a built `.js` file on disk. `provides: ["browser"]` makes it the agent's browser when the user selects it; `provides: ["source-control"]` makes it a Git host and needs `sourceControl`; `provides: ["notifications"]` makes it a notification channel and needs `notifications`; `provides: ["tracker"]` makes it a work item tracker next to Linear and needs `tracker` (a service is a Git host or a tracker, never both); `provides: ["quota"]` makes it a usage provider next to the built-in ones and needs `quota`; `surface: true` gives it a host-drawn live panel the user can take over (no `panel.entry` then). None of these needs a panel or background entry. See [GUEST_SERVICES.md](https://github.com/openchamber/openchamber/blob/main/packages/sdk/GUEST_SERVICES.md) |
551
- | `sessionEvents` | Optional, needs `service`. `{ "events": [1 to 4 distinct of "turn-finished", "turn-failed", "permission-asked", "question-asked"], "content"?: true }`. OhPiChamber posts each listed event, from every project, to the service at `POST /session-events`, with no window open; the service needs no panel or background entry for it. `content: true` adds the `transcript` capability (the reply, the question, the permission's detail). Bad shape or no `service` is `invalid-session-events`. Older hosts drop the key and send nothing, so set an `engines.openchamber` floor. See [GUEST_SERVICES.md](https://github.com/openchamber/openchamber/blob/main/packages/sdk/GUEST_SERVICES.md#session-events-contributessessionevents) |
552
- | `marks` | Optional `true`, needs `service` (`invalid-marks`). The service puts icons on sidebar rows with `setMark(target, mark)`: `target` is `{ sessionId }`, `{ directory, branch }` (a branch of the repository the folder belongs to) or `{ directory }`; `mark` is `{ icon, tone, text, url? }` or `null`. Adds the `marks` capability, a line of its own in the approval dialog. A mark lasts as long as the service process, so declare `service.keepRunning`. Ships in OhPiChamber 1.0.0, the fork's first release; an upstream host that predates it ignores the key |
553
- | `notifications` | Required with `provides: ["notifications"]`, refused without it. The notification channel the service delivers to: `label` (1 to 64), `instances` (`{ kind: "fixed", origin }` or `{ kind: "user", label, placeholder? }`), `token` (the Git host's token block: `header`, `scheme`, `username?`, `scopes?`, `createPath?`). Strict. `panel.id` is at most 28 characters (the channel id is `ext-<panel.id>`). Errors are `invalid-service`. See [GUEST_SERVICES.md](https://github.com/openchamber/openchamber/blob/main/packages/sdk/GUEST_SERVICES.md#notification-channel-provides-notifications) |
554
- | `tracker` | Required with `provides: ["tracker"]`, refused without it, and refused beside `sourceControl`. The work item tracker the service is: `wire: 1`, `label` (1 to 64), `instances` (`{ kind: "fixed", origin }` or `{ kind: "user", label, placeholder? }`), `auth` (`token` block and/or `oauth` `{ authorizeUrl, tokenUrl, scopes? }`, at least one), `capabilities` (flags, each off by default), `stateFilters` (`open`, `all`, then up to 14 of yours), `identifier` (`key-number`, `number` or `short-code`), `urls.item` (1 to 8 link templates with `{id}`, `{segment}`, `{segments+}` and `?name={id}`). Strict. `panel.id` is at most 28 characters (the tracker id is `ext-<panel.id>`). Errors are `invalid-service`. See [GUEST_SERVICES.md](https://github.com/openchamber/openchamber/blob/main/packages/sdk/GUEST_SERVICES.md#tracker-provides-tracker) |
555
- | `links` | Optional. Identifiers and links in chat messages a click hands to the extension: `{ "action": "open" \| "attach", "identifier"?: { "keys": [1 to 8 unique upper-case keys like "PROJ"] }, "urls"?: { "origin": "https://…", "identifier": "key-number" \| "number" \| "short-code", "item": [1 to 8 link templates] } }`, at least one of `identifier` and `urls`. Keys match as whole words `PROJ-123`, never in code or inside a word or path. `origin` is one public https origin matched exactly, or a subdomain wildcard `https://*.example.com` that matches any subdomain of the domain, never the apex or another port; templates use the tracker's grammar (`{id}` once, in the path or as `?name={id}`, `{segment}`, at most one `{segments+}`), never a regular expression. `open` needs `panel.entry` and opens the extension (its rail panel, or its dialog with `attach: "dialog"`) with a `GuestLinkItem`; `attach` puts a chip on the composer and needs a template without `{segment}` or `{segments+}` so the chip names its link, and with `identifier.keys` an `identifier` other than `number`, since `PROJ-12` never fills a number. Links the app reads itself (tracker items, repository issues and change requests, commits) keep their route. Adds the `links` capability; a version that changes the action, keys, origin or templates asks again (`invalid-links`). Reference: `examples/tasks-demo` |
556
- | `quota` | Required with `provides: ["quota"]`, refused without it. The usage provider the service is: `providers`, up to 16 unique OMP provider ids by shape (`openrouter`, `zai-coding-plan`), the ones whose stored credentials the service receives on every read; may be empty. Strict. `panel.id` is at most 28 characters (the provider id is `ext-<panel.id>`). Errors are `invalid-service`. See [GUEST_SERVICES.md](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/sdk/GUEST_SERVICES.md#usage-provider-provides-quota) |
557
- | `sourceControl` | Required with `provides: ["source-control"]`, refused without it. The Git host the service implements: `wire: 1`, `label`, `terminology`, `referencePrefix`, `repositoryPath`, `instances`, `capabilities`, `token`, `transport`, `limits`, `trackedItems`, `presentation`. Strict; URL templates use only `{owner}`, `{namespace+}`, `{repo}`, `{number}`. `panel.id` is at most 28 characters (the host id is `ext-<panel.id>`). Change-based hosts may add the `change` term, `capabilities.reviewModel` and `capabilities.revisions`, the `submit` merge method (alone), `presentation.features.submitRequirements`, and `token.scheme: "basic"` with `token.username: true`; older hosts refuse these, so set an `engines.openchamber` floor. Errors are `invalid-service`. See [GUEST_SERVICES.md](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/sdk/GUEST_SERVICES.md#source-control-provider-provides-source-control) |
545
+ | `service` | Optional local process (`entry` built `.js`, `runtime: "host"`). `provides` supports `"browser"`, `"source-control"` (needs `sourceControl`), `"notifications"` (needs `notifications`), `"tracker"` (needs `tracker`; mutually exclusive with `sourceControl`), and `"quota"` (needs `quota`). `surface: true` adds a host-drawn shared panel. See [GUEST_SERVICES.md](./GUEST_SERVICES.md) |
546
+ | `sessionEvents` | Optional, needs `service`. `{ "events": [1–4 distinct of "turn-finished", "turn-failed", "permission-asked", "question-asked"], "content"?: true }`. Host posts events across all projects to `POST /session-events`; `content: true` adds the `transcript` capability. Errors are `invalid-session-events`. See [GUEST_SERVICES.md](./GUEST_SERVICES.md#session-events-contributessessionevents) |
547
+ | `marks` | Optional `true`, needs `service` (`invalid-marks`). Adds the `marks` capability so `setMark(target, mark)` can set `{ icon, tone, text, url? }` or `null` on sidebar rows (`{ sessionId }`, `{ directory, branch }`, `{ directory }`). Declare `service.keepRunning` so marks persist |
548
+ | `notifications` | Required with `provides: ["notifications"]`, refused without it (`invalid-service`). Declares `label` (1–64), `instances`, and `token`; `panel.id` max 28 chars (`ext-<panel.id>`). See [GUEST_SERVICES.md](./GUEST_SERVICES.md#notification-channel-provides-notifications) |
549
+ | `tracker` | Required with `provides: ["tracker"]`, refused without it or alongside `sourceControl` (`invalid-service`). Declares `wire: 1`, `label` (1–64), `instances`, `auth` (`token` and/or `oauth`), `capabilities`, `stateFilters` (`open`, `all`, plus up to 14), `identifier` (`key-number` \| `number` \| `short-code`), `urls.item` (1–8 templates); `panel.id` max 28 chars (`ext-<panel.id>`). See [GUEST_SERVICES.md](./GUEST_SERVICES.md#tracker-provides-tracker) |
550
+ | `links` | Optional `{ "action": "open" \| "attach", "identifier"?: { "keys": [1–8 uppercase keys] }, "urls"?: { "origin", "identifier", "item": [1–8 templates] } }`, at least one of `identifier` / `urls`. Keys match whole words (`PROJ-123`) outside code/words/paths; `origin` is an exact `https` origin or `https://*.example.com` subdomain wildcard. `open` needs `panel.entry` (`GuestLinkItem`); `attach` adds a composer chip and disallows `{segment}`/`{segments+}` (and `identifier: "number"` with `identifier.keys`). Built-in app links keep priority. Adds `links` capability; edits re-prompt (`invalid-links`). Reference: `examples/tasks-demo` |
551
+ | `quota` | Required with `provides: ["quota"]`, refused without it (`invalid-service`). Lists up to 16 unique OMP provider IDs (`providers`) whose stored credentials the service receives; `panel.id` max 28 chars (`ext-<panel.id>`). See [GUEST_SERVICES.md](./GUEST_SERVICES.md#usage-provider-provides-quota) |
552
+ | `sourceControl` | Required with `provides: ["source-control"]`, refused without it (`invalid-service`). Declares `wire: 1`, `label`, `terminology`, `referencePrefix`, `repositoryPath`, `instances`, `capabilities`, `token`, `transport`, `limits`, `trackedItems`, `presentation`; `panel.id` max 28 chars (`ext-<panel.id>`). See [GUEST_SERVICES.md](./GUEST_SERVICES.md#source-control-provider-provides-source-control) |
558
553
 
559
554
 
560
555
  Extra keys are dropped, not forwarded.
@@ -594,7 +589,7 @@ At least one of `label`, `title`, `status`, `fields`. Unknown keys are refused.
594
589
  - An object output is one card. An array, or an object with an `items` array, is a list: one row per item with its label, title, first field and status, the first 200 items, no link. In a row `{output.path}` reads the item.
595
590
  - A path that is absent, or holds `null`, a blank string, an object or an array, is missing. A part with nothing resolved is hidden. When no label, title, status or field resolves, or the output is not JSON, the chat shows the output as it would without the rule.
596
591
  - The link shows only for an `https` address without a user name or password, at most 2,048 characters. In a written address every placeholder has to resolve and each value is percent-encoded, so a value cannot change the host or path the manifest wrote; a value that would be a `.` or `..` path step gives no link. In the host a placeholder stands between dots or at either end: `https://tracker.example{output.path}` is refused, and a placeholder that ends the host lets its value choose the host. `https://{settings.site}/browse/{output.key}` works when `site` is a bare host name; a full address, a port or a path in the setting gives no link.
597
- - `card` ships in OhPiChamber 1.0.0, the fork's first release. An upstream host that predates it refuses the package with `invalid-tools`, whatever `engines.openchamber` says.
592
+ - `card` requires a host that supports `output: "card"`; older hosts reject it with `invalid-tools`.
598
593
 
599
594
  ### 3.2 Parse / version helpers
600
595
 
@@ -604,16 +599,16 @@ At least one of `label`, `title`, `status`, `fields`. Unknown keys are refused.
604
599
  | `parseManifest(document)` (`ohpichamber-sdk/schemas`) | Typed document → success/failure (does not throw on junk) |
605
600
  | `parseManifestJson(json)` (`ohpichamber-sdk/schemas`) | String → same result |
606
601
  | `guestToolCardSchema` (`ohpichamber-sdk/schemas`) | The zod schema of a tool rule's `card`, for a host that re-reads a catalog row |
607
- | `resolveAttachMode(attach)` | Normalize to `'panel' |
602
+ | `resolveAttachMode(attach)` | Normalize to `'panel' \| 'dialog' \| null` |
608
603
  | `resolveAttachEntry(contributes)` | Dialog page from the object form, or `null` when the dialog reuses `panel.entry` |
609
604
  | `hasGuestPage(contributes)` | `true` when `panel.entry` is set; background-only and tools-only packages return `false` |
610
605
  | `resolveIntegrationAuth` / `resolveIntegrationApi` | Auth kind and API origin |
611
606
  | `toPublicIntegration` / `toPublicService` | Catalog-safe public slices |
612
607
  | `isGuestPackageSvgIcon` | Whether icon is a package SVG path |
613
- | `compareOpenChamberVersions` | Semver compare |
614
- | `hostMeetsOpenChamberEngine` | Host vs `engines.openchamber` floor |
615
- | `openChamberEngineMinimum` | Normalize `>=1.0.0` → floor string |
616
- | `parseOpenChamberVersion` | Parse `x.y.z` |
608
+ | `compareOhPiChamberVersions` | Semver compare |
609
+ | `hostMeetsOhPiChamberEngine` | Host vs `engines.ohpichamber` floor |
610
+ | `ohPiChamberEngineMinimum` | Normalize `>=1.0.0` → floor string |
611
+ | `parseOhPiChamberVersion` | Parse `x.y.z` |
617
612
 
618
613
 
619
614
  ### 3.3 Protocol helpers (host + guest tooling)
@@ -631,7 +626,7 @@ At least one of `label`, `title`, `status`, `fields`. Unknown keys are refused.
631
626
  | `isHostRequestErrorCode` / `resolveHostRequestErrorCode` | Error code validation |
632
627
 
633
628
 
634
- Constants: `OPENCHAMBER_SDK_CHANNEL`, `OPENCHAMBER_SDK_API_VERSION`, `HOST_LINEAR_API_ORIGIN`, `GUEST_*_MAX`, `GUEST_REQUEST_TIMEOUT_MS`, `GUEST_ACTIONS_MAX`, `GUEST_COMMANDS_MAX`, `GUEST_COMMAND_NAME`, `GUEST_TOOLS_MAX`, `GUEST_TOOL_MATCH`, `GUEST_TOOL_OUTPUTS`, `HOST_REQUEST_ERROR_CODES`, `SERVICE_STATUS_VALUES`, `SESSION_LIFECYCLE_PHASES`, `START_SESSION_SENT`.
629
+ Constants: `OHPICHAMBER_SDK_CHANNEL`, `OHPICHAMBER_SDK_API_VERSION`, `HOST_LINEAR_API_ORIGIN`, `GUEST_*_MAX`, `GUEST_REQUEST_TIMEOUT_MS`, `GUEST_ACTIONS_MAX`, `GUEST_COMMANDS_MAX`, `GUEST_COMMAND_NAME`, `GUEST_TOOLS_MAX`, `GUEST_TOOL_MATCH`, `GUEST_TOOL_OUTPUTS`, `HOST_REQUEST_ERROR_CODES`, `SERVICE_STATUS_VALUES`, `SESSION_LIFECYCLE_PHASES`, `START_SESSION_SENT`.
635
630
 
636
631
  Wire messages added for these: host → guest `resolve` (`{ id, payload: { command, args } }`), guest → host `resolve-result` (`{ id, payload: { item } | { error } }`, no `result` comes back) and `badge` (`{ count }`).
637
632
 
@@ -652,30 +647,24 @@ Panel → `serviceRequest` → host → `127.0.0.1:port` → service process →
652
647
 
653
648
  Manifest sketch: `service.entry` (path to **built** JS, e.g. `service/main.js`), `runtime: "host"`, `permissions.sockets` and/or `permissions.exec`. Install refuses with `missing-build` when that file is absent. Declaring a service adds `service` to the capabilities the user approves at install; until then `serviceRequest` is `NO_SERVICE`.
654
649
 
655
- A service with `provides: ["browser"]` answers the agent's `browser.*` actions at `POST /browser-control` instead of the desktop app's browser panel, once the user selects it in Settings → OhPiChamber Tools. The host starts it on the first action and stops it when idle. Parse the body with `readBrowserProviderRequest`; request and answer types (`BrowserProviderRequest`, `BrowserProviderResult`, per-action `Browser*Parameters` / `Browser*Data`) and the limits (`BROWSER_PROVIDER_*`) are exported from `ohpichamber-sdk`. Full contract in [GUEST_SERVICES.md](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/sdk/GUEST_SERVICES.md#browser-provider-provides-browser).
650
+ Full local-service contracts, provider schemas, outbound proxies, and host callbacks (`createServiceHost`, `contributes.sessionEvents`, `contributes.waits`, `contributes.mentions`, `surface: true`, env vars, `/health`, grants, socket overrides) live in [GUEST_SERVICES.md](./GUEST_SERVICES.md).
656
651
 
657
- A service with `provides: ["source-control"]` is a Git host next to GitHub, GitLab, Gitea and Gerrit, described by `contributes.sourceControl`. OhPiChamber keeps the accounts and tokens and forwards reads and mutation steps to `POST /source-control` (`SOURCE_CONTROL_PROVIDER_PATH`); parse the body with `readSourceControlProviderRequest` and answer `{ ok, data }` or `{ ok: false, error }` (`SourceControlProviderResult`). The service reaches the forge only through `createSourceControlForge({ env: process.env }).request(handle, request)`, which goes through OhPiChamber's outbound proxy (`OPENCHAMBER_HOST_CALLBACK_URL`); OhPiChamber adds the token and keeps the request on the instance. Methods (`SOURCE_CONTROL_PROVIDER_METHODS`), inputs (`SourceControlProviderInputs`), deadlines (`sourceControlProviderTimeoutMs`) and caps (`SOURCE_CONTROL_*`) are exported from `ohpichamber-sdk`; the host's answer schemas are `sourceControlProviderSchemasV1` in `ohpichamber-sdk/schemas`. Full contract in [GUEST_SERVICES.md](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/sdk/GUEST_SERVICES.md#source-control-provider-provides-source-control); reference: `examples/source-control-provider`.
658
-
659
- A service with `provides: ["notifications"]` delivers the user's notifications next to the desktop and the phone, described by `contributes.notifications`. OhPiChamber keeps the account the user connects in Settings → Integrations and forwards three calls to `POST /notifications` (`NOTIFICATIONS_PROVIDER_PATH`): `auth.probe`, `auth.verify` and `notify` (`NOTIFICATIONS_PROVIDER_METHODS`, deadlines in `notificationsProviderTimeoutMs`); parse the body with `readNotificationsProviderRequest` and answer `{ ok, data }` or `{ ok: false, error }` (`NotificationsProviderResult`). The service reaches the channel's server only through `createNotificationsOutbound({ env: process.env }).request(handle, request)`, which goes through OhPiChamber's outbound proxy; OhPiChamber adds the token and keeps the request on the account's origin. The notification shape is `GuestNotification`, its kinds `GUEST_NOTIFICATION_KINDS`; the host's answer schemas are `notificationsProviderSchemasV1` in `ohpichamber-sdk/schemas`. Full contract in [GUEST_SERVICES.md](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/sdk/GUEST_SERVICES.md#notification-channel-provides-notifications); reference: `examples/notification-webhook`.
660
-
661
- A service with `provides: ["tracker"]` is a work item tracker next to Linear, described by `contributes.tracker`. OhPiChamber keeps the accounts the user connects on the tracker's card under Extension accounts in Settings → Integrations (a pasted token, or a browser sign-in it runs itself with the client the user enters) and forwards nine calls to `POST /tracker` (`TRACKER_PROVIDER_PATH`): `auth.probe`, `auth.verify`, `items.list`, `items.get`, `items.updateState`, `items.liveSummaries`, `states.list`, `containers.list` and `comments.create` (`TRACKER_PROVIDER_METHODS`, deadlines in `trackerProviderTimeoutMs`); parse the body with `readTrackerProviderRequest` and answer `{ ok, data }` in the neutral item shapes (`TrackerProviderItemSummary`, `TrackerProviderItem`) or `{ ok: false, error }` (`TrackerProviderResult`). A query that is a link your templates claim, or an identifier of your declared shape, is read through `items.get` first; a bare word `items.get` answers null for reaches `items.list` as a search after all. The service reaches the tracker's server only through `createTrackerOutbound({ env: process.env }).request(handle, request)`, which goes through OhPiChamber's outbound proxy; OhPiChamber adds the credential and keeps the request on the account's origin, and a read's handle sends `GET` only (`isTrackerProviderWriteMethod`). The host's answer schemas are `trackerProviderSchemasV1` in `ohpichamber-sdk/schemas`. Full contract in [GUEST_SERVICES.md](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/sdk/GUEST_SERVICES.md#tracker-provides-tracker); reference: `examples/tracker-provider`.
662
-
663
- A service with `provides: ["quota"]` is a usage provider next to the built-in ones, described by `contributes.quota`. OhPiChamber lists it from the manifest, asks it for usage the way it asks a built-in, one `usage.read` per refresh at `POST /quota` (`QUOTA_PROVIDER_PATH`, deadline `QUOTA_PROVIDER_TIMEOUT_MS`), with `input.credentials` holding the credential OMP stores for each listed provider (`QuotaProviderCredential`) and nothing else; parse the body with `readQuotaProviderRequest` and answer `{ ok, data }` with the result a built-in computes (`QuotaProviderUsageData`: `ok`, `configured`, `error`, `planLabel`, `usage.windows` and `usage.models` of `QuotaProviderWindow`) or `{ ok: false, error }` (`QuotaProviderResult`). OhPiChamber derives the remaining share and the formatted strings itself. The host's answer schema is `quotaProviderSchemasV1` in `ohpichamber-sdk/schemas`. Full contract in [GUEST_SERVICES.md](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/sdk/GUEST_SERVICES.md#usage-provider-provides-quota); reference: `examples/quota-provider`.
664
-
665
- A service calls OhPiChamber on its own through `createServiceHost({ env: process.env })`: `sessions.start`, `sessions.send`, `sessions.retry`, `sessions.status`, `sessions.lastReply`, `sessions.stop`, and with `sessionControl: { answers: true }` `sessions.answerPermission` and `sessions.answerForm`, which answer the agent's requests for the user; `setInstructions`, `emit`, `readSettings`, `needsConfiguration`, and with `contributes.marks` `setMark`, which puts an icon with a tooltip on the sidebar rows of a session, a branch or a folder (`ServiceMark`, `ServiceMarkTarget`, limits in the `SERVICE_MARK*` constants). `service.keepRunning` keeps it up with nobody asking, and `service.schedule` wakes it on a clock at `POST /schedule`; parse the body with `readServiceScheduleRequest`. `contributes.mentions` adds its rows to the composer's `@` menu through `MENTIONS_SEARCH_PATH` and `MENTIONS_RESOLVE_PATH`. Full contract in [GUEST_SERVICES.md](https://github.com/openchamber/openchamber/blob/main/packages/sdk/GUEST_SERVICES.md#calling-openchamber).
666
-
667
- A service whose manifest declares `contributes.sessionEvents` is told what happens in the user's sessions: OhPiChamber posts one request per subscribed event (`turn-finished`, `turn-failed`, `permission-asked`, `question-asked`) to `POST /session-events` (`SESSION_EVENTS_PATH`), from every project, whether or not a window is open. Parse the body with `readSessionEventRequest` (`GuestSessionEventRequest`: `event` with identifiers, and `content` only when the user approved the `transcript` capability that `content: true` asks for) and answer `{ ok: true }` or `{ ok: false, error }` (`GuestSessionEventResult`). Filter on `event.project.directory` yourself. Limits are the `SESSION_EVENT*` constants; the host's answer schema is `sessionEventResultSchema` in `ohpichamber-sdk/schemas`. Full contract in [GUEST_SERVICES.md](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/sdk/GUEST_SERVICES.md#session-events-contributessessionevents); reference: `examples/session-events-log`.
668
-
669
- A service with `surface: true` shows a live picture in the extension's rail panel: the host pulls frames from `GET /surface/frame`, draws them, sends the user's input to `POST /surface/input`, and owns who is in control (nobody, the agent, the user). Paths, event types, and the `readSurface*` parsers are exported from `ohpichamber-sdk`; contract in [GUEST_SERVICES.md](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/sdk/GUEST_SERVICES.md#shared-surface-surface-true).
652
+ Provider HTTP entrypoints and SDK helpers at a glance:
653
+ - `provides: ["browser"]` → `POST /browser-control`, `readBrowserProviderRequest` ([browser provider](./GUEST_SERVICES.md#browser-provider-provides-browser))
654
+ - `provides: ["source-control"]` → `POST /source-control` (`SOURCE_CONTROL_PROVIDER_PATH`), `readSourceControlProviderRequest`, `createSourceControlForge`, `sourceControlProviderSchemasV1` ([source-control provider](./GUEST_SERVICES.md#source-control-provider-provides-source-control), `examples/source-control-provider`)
655
+ - `provides: ["notifications"]` → `POST /notifications` (`NOTIFICATIONS_PROVIDER_PATH`), `readNotificationsProviderRequest`, `createNotificationsOutbound`, `notificationsProviderSchemasV1` ([notification channel](./GUEST_SERVICES.md#notification-channel-provides-notifications), `examples/notification-webhook`)
656
+ - `provides: ["tracker"]` → `POST /tracker` (`TRACKER_PROVIDER_PATH`), `readTrackerProviderRequest`, `createTrackerOutbound`, `trackerProviderSchemasV1` ([tracker](./GUEST_SERVICES.md#tracker-provides-tracker), `examples/tracker-provider`)
657
+ - `provides: ["quota"]` → `POST /quota` (`QUOTA_PROVIDER_PATH`), `readQuotaProviderRequest`, `quotaProviderSchemasV1` ([usage provider](./GUEST_SERVICES.md#usage-provider-provides-quota), `examples/quota-provider`)
658
+ - Host callbacks, marks, schedules, mentions → `createServiceHost`, `readServiceScheduleRequest`, `POST /schedule`, `MENTIONS_SEARCH_PATH`, `MENTIONS_RESOLVE_PATH` ([calling OhPiChamber](./GUEST_SERVICES.md#calling-ohpichamber))
659
+ - Session events (`contributes.sessionEvents`) → `POST /session-events` (`SESSION_EVENTS_PATH`), `readSessionEventRequest`, `sessionEventResultSchema` ([session events](./GUEST_SERVICES.md#session-events-contributessessionevents), `examples/session-events-log`)
660
+ - Shared surface (`surface: true`) → `GET /surface/frame`, `POST /surface/input`, `readSurface*` ([shared surface](./GUEST_SERVICES.md#shared-surface-surface-true))
670
661
 
671
662
  Bundle the service with the Node target:
672
663
 
673
664
  ```bash
674
- bunx openchamber-guest-bundle --node service/main.ts service/main.js
665
+ bunx ohpichamber-guest-bundle --node service/main.ts service/main.js
675
666
  ```
676
667
 
677
- Full contract (env vars, `/health`, grants, socket overrides): `[GUEST_SERVICES.md](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/sdk/GUEST_SERVICES.md)`.
678
-
679
668
  ---
680
669
 
681
670
  ## 5. What this package does not provide
@@ -744,8 +733,8 @@ host.onReady((ctx) => {
744
733
 
745
734
  | File | Audience |
746
735
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------- |
747
- | [README.md](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/sdk/README.md) | Package overview and first hole |
748
- | [DOCUMENTATION.md](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/sdk/DOCUMENTATION.md) | Agent / maintainer invariants |
749
- | [GUEST_SERVICES.md](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/sdk/GUEST_SERVICES.md) | Local service contract |
750
- | [src/ui/DOCUMENTATION.md](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/sdk/src/ui/DOCUMENTATION.md) | UI kit invariants |
751
- | [sdk.mdx](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/docs/content/docs/sdk.mdx) / [sdk/host.mdx](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/docs/content/docs/sdk/host.mdx) / [sdk/ui.mdx](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/docs/content/docs/sdk/ui.mdx) | Author-facing website pages |
736
+ | [README.md](./README.md) | Package overview and first extension |
737
+ | [DOCUMENTATION.md](./DOCUMENTATION.md) | Agent / maintainer invariants |
738
+ | [GUEST_SERVICES.md](./GUEST_SERVICES.md) | Local service contract |
739
+ | [src/ui/DOCUMENTATION.md](./src/ui/DOCUMENTATION.md) | UI kit invariants |
740
+ | [sdk.mdx](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/docs/content/docs/sdk.mdx) / [sdk/host.mdx](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/docs/content/docs/sdk/host.mdx) / [sdk/ui.mdx](https://github.com/Shizuku-Yume/ohpichamber/blob/main/packages/docs/content/docs/sdk/ui.mdx) | Author-facing website pages |