@hydraharness/harness-client-ui-layout 0.0.0-stage → 0.1.1-rc.6
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/LICENSE +21 -0
- package/README.md +34 -2
- package/lib/client.js +19613 -0
- package/lib/index.js +6 -0
- package/lib/invariant.js +24 -0
- package/lib/types/client/AppFrame.d.ts +12 -0
- package/lib/types/client/BrowserSection.d.ts +54 -0
- package/lib/types/client/DesktopBrowserPanel.d.ts +254 -0
- package/lib/types/client/DesktopFilesPanel.d.ts +46 -0
- package/lib/types/client/DesktopTerminalPanel.d.ts +18 -0
- package/lib/types/client/DesktopTitleBar.d.ts +11 -0
- package/lib/types/client/browser-locales.d.ts +126 -0
- package/lib/types/client/columns.d.ts +48 -0
- package/lib/types/client/index.d.ts +126 -0
- package/lib/types/client/service.d.ts +47 -0
- package/lib/types/client/stores.d.ts +49 -0
- package/lib/types/client/theme-presenter.d.ts +35 -0
- package/lib/types/index.d.ts +4 -0
- package/lib/types/invariant.d.ts +16 -0
- package/package.json +79 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DeepSeek
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @hydraharness/harness-client-ui-layout
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Settings → Browser groups the global Browsing, Downloads, and Uploads policies in one three-column Browser permissions card. The controls persist through the existing Host settings scope and use a single column on narrow screens. Browser history access and existing site managers keep their independent controls.
|
|
4
|
+
|
|
5
|
+
Shell plugin: three-column AppFrame (drag handles and concession chain) plus the `ctx.layout` panel-geometry service; it registers into the runtime-owned `root` slot and declares `sidebar`, `conversation`, `details`, `review`, and `shell.overlay`. The sidebar resize boundary is an invisible hit strip, while the details boundary retains its floating pill; only details shrinks during concession and then auto-closes. Each column boundary is a focusable separator whose Arrow keys step the width through the store from the rendered width. A closed sidebar retains a 56px control rail while details closes to zero width. The package also seats the theme presenter: it consumes resolved `ctx.theme` snapshots and projects them onto the document (`html { color-scheme }` for native UA chrome, `body[data-ds-dark-theme]` from the active color scheme, the theme's alias tokens as inline variables on body, and one owned `<meta name="theme-color">` whose content follows the computed body background). Measuring after palette and token application keeps the rendered background as the single color authority; disposing the presenter removes its metadata node with its other global writes. Embedded browser chrome receives the same resolved scheme and semantic palette, while clearing the override restores Electron's OS preference. Both terminal panels refresh xterm colors on theme changes without recreating the terminal or its PTY, so hiding or restyling a panel preserves its session output.
|
|
6
|
+
|
|
7
|
+
Electron adds a desktop-only top bar inside the titlebar overlay. Back and Forward buttons, Sidebar, and File, Edit, View, and Help menus use the shared `Menu` and `Tooltip` primitives with keyboard-operable triggers; actions route through the existing session, workspace, and panel services. The trailing section seats the panel controls (Expand right panel, Toggle bottom terminal, and Toggle right panel) across the full window width; Electron environment variables reserve the native caption width and height across window sizes and renderer zoom levels. The preload exposes only the allowlisted native actions needed for editing, zoom, fullscreen, close, and help, and keeps native symbols synchronized with the resolved Hydra theme while the transparent overlay lets renderer masks cover the controls area. Unsupported ChatGPT-only entries are omitted.
|
|
8
|
+
|
|
9
|
+
When the Electron preload exposes the embedded browser, this desktop feature owner contributes the Browser Settings section and declares `settings.browser.item`, where the built-in Web Search configuration card contributes. The section persists Browser control, URL destinations, annotation screenshots, downloads, navigation, uploads, history access, and Full CDP opt-in under `browser-electron`; accepted Host snapshots configure the desktop controller, while `BrowserSessionService` remains the authority for Host-side control, upload, and history policies. Full CDP stays locked when the effective native capability denies it and requires native confirmation before an opt-in is persisted.
|
|
10
|
+
|
|
11
|
+
Narrow preload callbacks let the section clear browsing data; search and remove navigation-history or download-ledger rows; add, edit, or remove exact-origin access/media overrides; and manage encrypted autofill logins and contacts when Electron secure storage is available. Login lists and edits never return stored passwords to the renderer: an empty edit password preserves the existing secret, and the transient password field is cleared after each save attempt. Contact management reads only the vault's explicit field allowlist. Older preloads and unavailable secure storage keep both managers disabled and fail closed.
|
|
12
|
+
|
|
13
|
+
AppFrame always mounts the conversation and details columns; a connected Session renders through `SessionProvider`. The transient layout store starts the sidebar at its default width and details closed, and it never reads or writes `localStorage`. On desktop, the optional right panel starts closed and opens through its persistent control or `Ctrl+T`; its header keeps Files, Side chat, Browser, Terminal, and Review options visible in a compact options row above the tab row, and selecting one opens or focuses the matching tab. Selecting Terminal or pressing Ctrl+` creates a new tab with an independent PTY; closing a tab stops only that PTY, and hiding it preserves its output. Each terminal tab captures its creation workspace, and new or restarted panes start in that registered root. The bottom Terminal preserves a separate tab set per workspace. Both placements use the same tab host: New Terminal (+) creates a tab, while Split Terminal divides only the selected tab into panes. New tabs use the smallest available display number while PTY IDs remain unique. The process trash button waits for termination before removing a pane and closes the tab when its last pane is removed; a failed stop keeps it available for retry. Tabs keep their PTYs and output when hidden. Switching workspaces leaves existing PTYs and their current directories intact. An unavailable registered workspace fails startup; only terminals opened without a workspace use the desktop launch directory. On Windows these terminals run Windows PowerShell without loading profiles. The terminal panel supports splitting into side-by-side panes with independent PTY processes, selecting text to display a floating `Quote Ctrl+L` pill that attaches the excerpt directly into the active session chat as an element annotation card, and a collapsible sidebar tracking running terminal processes grouped under the active conversation with split and kill controls. The tab strip is a roving-tabindex tablist whose arrows, Home, End, and Delete keys select or close tabs; each tab labels its tabpanel. Closing the last tab leaves a native-like empty panel with direct options, and a failed Terminal stop leaves the tab open with an error. Hero and other unselected states also derive a zero rendered details width without changing that stored preference. AppFrame retains the last non-blank Session id across those states: the first Session remains closed, an explicit details action opens the contract default width, returning to the same Session restores its unchanged width, and selecting a different Session closes details before paint. The conversation owner share is empty, while the sidebar owner share contains only `collapsed` and `width`; registrants obtain business data from standard hooks and actions from their own inject faces.
|
|
14
|
+
|
|
15
|
+
In Electron, `Ctrl+P` opens the Files tab and focuses its filter for the current registered Workspace; without one, Files stays empty. The Explorer features a resizable splitter (160px–480px) and three collapsible sections: Open Editors with dirty indicators and Save All/Close All actions, Workspace Files with folders first in natural name order, color-coded extension icons, search filter, inline creation, and drag-and-drop moves, and an Outline section extracting code symbols (functions, classes, interfaces, types, headings) with click-to-jump line navigation.
|
|
16
|
+
|
|
17
|
+
Selecting an eligible UTF-8 text file opens the in-panel editor with multi-document tabs and breadcrumbs path navigation. The editor provides a line numbers gutter with active line highlighting, Word Wrap toggling (`Alt+Z`), Go to Line (`Ctrl+G`), Diff with disk view, Prettier formatting (`Shift+Alt+F`), atomic version-checked saves (`Ctrl+S`), and a status bar displaying cursor coordinates, selection count, line count, indentation, encoding, line endings, and language mode. Drafts above 50,000 characters stay plain to keep editing responsive, and opening another file, closing a tab, or switching Workspace guards unsaved changes.
|
|
18
|
+
|
|
19
|
+
The renderer sends only an opaque Workspace id. Electron re-resolves that id through the Host, validates the IPC sender, canonicalizes and confines every list, search, create, read, format, and save path to the registered root, excludes symlink traversal, accepts only one validated leaf name for creation, and creates without overwriting an existing entry. Editable content must be valid non-binary UTF-8 and no larger than 1 MB. Confinement and version checks reject stable outside paths and stale states; they are not an operating-system sandbox or an atomic compare-and-swap against an external process that replaces a path during the final filesystem operation. This remains a bounded textarea editor: it does not provide Monaco, per-file editor tabs, language diagnostics, or persisted edit buffers.
|
|
20
|
+
|
|
21
|
+
The `/client` exports are the plugin body (`apply`/`inject`), `LayoutController`, and the four owner-share interfaces. AppFrame, the panel store, and the concession solver remain package-internal.
|
|
22
|
+
|
|
23
|
+
## Model Experience
|
|
24
|
+
|
|
25
|
+
None, as the layout shell manages browser viewing state; nothing here reaches a model request.
|
|
26
|
+
|
|
27
|
+
#### KV Cache effect
|
|
28
|
+
|
|
29
|
+
None; this package neither assembles nor sends a provider request.
|
|
30
|
+
|
|
31
|
+
## Known Limitations and Deferred Work
|
|
32
|
+
|
|
33
|
+
- **Panel geometry is transient** — reload restores the sidebar default and details closed; switching between distinct Session ids also closes details and forgets its dragged width, while unselected surfaces render details at zero width without modifying geometry.
|
|
34
|
+
- **Concession-chain auto-close derives a zero width without touching the preferred width** — the panel restores itself when the window widens; consumers must not read the stored details width as the rendered truth.
|
|
35
|
+
- **No scroll anchoring during squeeze reflow** — layout changes may move the reader's viewport.
|