hyperview 0.6.1__tar.gz → 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. hyperview-1.0.0/.agents/skills/hyperview-cli/SKILL.md +144 -0
  2. {hyperview-0.6.1 → hyperview-1.0.0}/.agents/skills/hyperview-cli/references/commands.md +229 -12
  3. {hyperview-0.6.1 → hyperview-1.0.0}/.agents/skills/hyperview-cli/references/extensions.md +82 -59
  4. hyperview-1.0.0/.agents/skills/hyperview-cli/references/panel-modules.md +226 -0
  5. {hyperview-0.6.1 → hyperview-1.0.0}/.gitignore +8 -2
  6. {hyperview-0.6.1 → hyperview-1.0.0}/PKG-INFO +30 -10
  7. {hyperview-0.6.1 → hyperview-1.0.0}/README.md +23 -4
  8. {hyperview-0.6.1 → hyperview-1.0.0}/pyproject.toml +8 -4
  9. hyperview-1.0.0/src/hyperview/__init__.py +34 -0
  10. hyperview-1.0.0/src/hyperview/_compat.py +27 -0
  11. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/_version.py +2 -2
  12. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/api.py +526 -35
  13. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/cli.py +707 -96
  14. hyperview-1.0.0/src/hyperview/control/__init__.py +24 -0
  15. hyperview-1.0.0/src/hyperview/control/aliases.py +54 -0
  16. hyperview-1.0.0/src/hyperview/control/models.py +75 -0
  17. hyperview-1.0.0/src/hyperview/control/registry.py +86 -0
  18. hyperview-1.0.0/src/hyperview/control/runtime_commands.py +374 -0
  19. hyperview-1.0.0/src/hyperview/control/service.py +101 -0
  20. hyperview-1.0.0/src/hyperview/control/ui_panel.py +902 -0
  21. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/core/dataset.py +495 -70
  22. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/core/sample.py +50 -17
  23. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/core/selection.py +13 -1
  24. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/embeddings/engine.py +109 -35
  25. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/embeddings/pipelines.py +79 -25
  26. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/embeddings/providers/lancedb_providers.py +64 -1
  27. hyperview-1.0.0/src/hyperview/extensions.py +421 -0
  28. hyperview-1.0.0/src/hyperview/panel_definitions.py +139 -0
  29. hyperview-1.0.0/src/hyperview/runtime.py +3226 -0
  30. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/server/app.py +767 -283
  31. hyperview-1.0.0/src/hyperview/server/security.py +144 -0
  32. hyperview-1.0.0/src/hyperview/server/static/404/index.html +1 -0
  33. hyperview-1.0.0/src/hyperview/server/static/404.html +1 -0
  34. hyperview-1.0.0/src/hyperview/server/static/__next.__PAGE__.txt +23 -0
  35. hyperview-1.0.0/src/hyperview/server/static/__next._full.txt +18 -0
  36. hyperview-1.0.0/src/hyperview/server/static/__next._tree.txt +2 -0
  37. hyperview-1.0.0/src/hyperview/server/static/_next/static/98olFRaLYmqH0ChUkGkaU/_clientMiddlewareManifest.js +1 -0
  38. hyperview-1.0.0/src/hyperview/server/static/_next/static/chunks/1si__g5rfxfy5.js +31 -0
  39. hyperview-1.0.0/src/hyperview/server/static/_next/static/chunks/1z1-ay5ba8832.js +8 -0
  40. hyperview-0.6.1/src/hyperview/server/static/_next/static/chunks/661a08547c83f565.js → hyperview-1.0.0/src/hyperview/server/static/_next/static/chunks/283_7pyqafe21.js +15 -15
  41. hyperview-1.0.0/src/hyperview/server/static/_next/static/chunks/2iw0scz5_gelo.css +2 -0
  42. hyperview-1.0.0/src/hyperview/server/static/_next/static/chunks/2l5mr6qhcmcif.js +22 -0
  43. hyperview-1.0.0/src/hyperview/server/static/_next/static/chunks/2zbk7fyb76ii0.js +1 -0
  44. hyperview-1.0.0/src/hyperview/server/static/_next/static/chunks/3xaos2q7f0t1a.js +1 -0
  45. hyperview-1.0.0/src/hyperview/server/static/_next/static/chunks/3xo3o0sovd-os.js +1 -0
  46. hyperview-1.0.0/src/hyperview/server/static/_next/static/chunks/turbopack-0iv3v71mo2dd1.js +1 -0
  47. hyperview-1.0.0/src/hyperview/server/static/_next/static/media/icon.0nasg43ry7r55.png +0 -0
  48. hyperview-1.0.0/src/hyperview/server/static/_not-found/__next._full.txt +16 -0
  49. hyperview-1.0.0/src/hyperview/server/static/_not-found/__next._not-found.__PAGE__.txt +22 -0
  50. hyperview-1.0.0/src/hyperview/server/static/_not-found/__next._tree.txt +2 -0
  51. hyperview-1.0.0/src/hyperview/server/static/_not-found/index.html +1 -0
  52. hyperview-1.0.0/src/hyperview/server/static/_not-found/index.txt +16 -0
  53. hyperview-1.0.0/src/hyperview/server/static/icon.png +0 -0
  54. hyperview-1.0.0/src/hyperview/server/static/index.html +1 -0
  55. hyperview-1.0.0/src/hyperview/server/static/index.txt +18 -0
  56. hyperview-1.0.0/src/hyperview/shipped_extensions/core/extension.toml +58 -0
  57. hyperview-1.0.0/src/hyperview/shipped_extensions/reference/extension.toml +25 -0
  58. hyperview-1.0.0/src/hyperview/shipped_extensions/reference/panel.jsx +54 -0
  59. hyperview-1.0.0/src/hyperview/shipped_extensions/reference/tools.py +17 -0
  60. hyperview-1.0.0/src/hyperview/static_export.py +1032 -0
  61. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/storage/backend.py +31 -0
  62. hyperview-1.0.0/src/hyperview/storage/fields.py +42 -0
  63. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/storage/geometry.py +8 -14
  64. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/storage/lancedb_backend.py +253 -87
  65. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/storage/memory_backend.py +20 -3
  66. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/storage/metrics.py +0 -27
  67. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/storage/schema.py +93 -18
  68. hyperview-1.0.0/src/hyperview/ui.py +437 -0
  69. hyperview-0.6.1/.agents/skills/hyperview-cli/SKILL.md +0 -98
  70. hyperview-0.6.1/.agents/skills/hyperview-cli/references/panel-modules.md +0 -171
  71. hyperview-0.6.1/src/hyperview/__init__.py +0 -18
  72. hyperview-0.6.1/src/hyperview/extensions.py +0 -230
  73. hyperview-0.6.1/src/hyperview/runtime.py +0 -1258
  74. hyperview-0.6.1/src/hyperview/server/static/404/index.html +0 -1
  75. hyperview-0.6.1/src/hyperview/server/static/404.html +0 -1
  76. hyperview-0.6.1/src/hyperview/server/static/__next.__PAGE__.txt +0 -9
  77. hyperview-0.6.1/src/hyperview/server/static/__next._full.txt +0 -18
  78. hyperview-0.6.1/src/hyperview/server/static/__next._head.txt +0 -5
  79. hyperview-0.6.1/src/hyperview/server/static/__next._index.txt +0 -5
  80. hyperview-0.6.1/src/hyperview/server/static/__next._tree.txt +0 -3
  81. hyperview-0.6.1/src/hyperview/server/static/_next/static/M3GWX_6YZLAMrBouI9UbA/_clientMiddlewareManifest.json +0 -1
  82. hyperview-0.6.1/src/hyperview/server/static/_next/static/chunks/0c17ee078faaeb62.js +0 -8
  83. hyperview-0.6.1/src/hyperview/server/static/_next/static/chunks/567993cf36cd4ab1.js +0 -5
  84. hyperview-0.6.1/src/hyperview/server/static/_next/static/chunks/7acade957a14420e.css +0 -3
  85. hyperview-0.6.1/src/hyperview/server/static/_next/static/chunks/86c1fc4cf542f408.js +0 -1
  86. hyperview-0.6.1/src/hyperview/server/static/_next/static/chunks/a6dad97d9634a72d.js.map +0 -1
  87. hyperview-0.6.1/src/hyperview/server/static/_next/static/chunks/e954ba82c0a04100.js +0 -1
  88. hyperview-0.6.1/src/hyperview/server/static/_next/static/chunks/eac713f252f03efd.js +0 -1
  89. hyperview-0.6.1/src/hyperview/server/static/_next/static/chunks/f29dd35a99c216ea.js +0 -1
  90. hyperview-0.6.1/src/hyperview/server/static/_next/static/chunks/turbopack-cb59e03a04a579d1.js +0 -4
  91. hyperview-0.6.1/src/hyperview/server/static/_next/static/media/1bffadaabf893a1e-s.7cd81963.woff2 +0 -0
  92. hyperview-0.6.1/src/hyperview/server/static/_next/static/media/2bbe8d2671613f1f-s.76dcb0b2.woff2 +0 -0
  93. hyperview-0.6.1/src/hyperview/server/static/_next/static/media/2c55a0e60120577a-s.2a48534a.woff2 +0 -0
  94. hyperview-0.6.1/src/hyperview/server/static/_next/static/media/5476f68d60460930-s.c995e352.woff2 +0 -0
  95. hyperview-0.6.1/src/hyperview/server/static/_next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2 +0 -0
  96. hyperview-0.6.1/src/hyperview/server/static/_next/static/media/9c72aa0f40e4eef8-s.18a48cbc.woff2 +0 -0
  97. hyperview-0.6.1/src/hyperview/server/static/_next/static/media/ad66f9afd8947f86-s.7a40eb73.woff2 +0 -0
  98. hyperview-0.6.1/src/hyperview/server/static/_not-found/__next._full.txt +0 -13
  99. hyperview-0.6.1/src/hyperview/server/static/_not-found/__next._head.txt +0 -5
  100. hyperview-0.6.1/src/hyperview/server/static/_not-found/__next._index.txt +0 -5
  101. hyperview-0.6.1/src/hyperview/server/static/_not-found/__next._not-found.__PAGE__.txt +0 -5
  102. hyperview-0.6.1/src/hyperview/server/static/_not-found/__next._not-found.txt +0 -4
  103. hyperview-0.6.1/src/hyperview/server/static/_not-found/__next._tree.txt +0 -2
  104. hyperview-0.6.1/src/hyperview/server/static/_not-found/index.html +0 -1
  105. hyperview-0.6.1/src/hyperview/server/static/_not-found/index.txt +0 -13
  106. hyperview-0.6.1/src/hyperview/server/static/index.html +0 -1
  107. hyperview-0.6.1/src/hyperview/server/static/index.txt +0 -18
  108. hyperview-0.6.1/src/hyperview/ui.py +0 -251
  109. {hyperview-0.6.1 → hyperview-1.0.0}/LICENSE +0 -0
  110. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/core/__init__.py +0 -0
  111. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/embeddings/__init__.py +0 -0
  112. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/embeddings/compute.py +0 -0
  113. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/embeddings/projection.py +0 -0
  114. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/embeddings/providers/__init__.py +0 -0
  115. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/figures/__init__.py +0 -0
  116. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/figures/colors.py +0 -0
  117. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/figures/render.py +0 -0
  118. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/server/__init__.py +0 -0
  119. {hyperview-0.6.1/src/hyperview/server/static/_next/static/M3GWX_6YZLAMrBouI9UbA → hyperview-1.0.0/src/hyperview/server/static/_next/static/98olFRaLYmqH0ChUkGkaU}/_buildManifest.js +0 -0
  120. {hyperview-0.6.1/src/hyperview/server/static/_next/static/M3GWX_6YZLAMrBouI9UbA → hyperview-1.0.0/src/hyperview/server/static/_next/static/98olFRaLYmqH0ChUkGkaU}/_ssgManifest.js +0 -0
  121. /hyperview-0.6.1/src/hyperview/server/static/_next/static/chunks/a6dad97d9634a72d.js → /hyperview-1.0.0/src/hyperview/server/static/_next/static/chunks/0cz1d0mv5g_q7.js +0 -0
  122. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/skill_install.py +0 -0
  123. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/storage/__init__.py +0 -0
  124. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/storage/config.py +0 -0
  125. {hyperview-0.6.1 → hyperview-1.0.0}/src/hyperview/tools.py +0 -0
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: hyperview-cli
3
+ description: Use HyperView's control-plane CLI for hyperview serve, static workspace export, dataset create, workspace create, embeddings compute, layouts compute, browserless paper figure export, runtime jobs, ui layout set, ui selection set, ui panel add/update, extension add, tools run, panel modules, Python tools, and local HyperView extension workflows.
4
+ license: MIT
5
+ compatibility: Requires Python 3.10-3.13 and the hyperview CLI (`uv tool install --python 3.12 hyperview`). Runtime-control commands require a running HyperView server.
6
+ metadata:
7
+ homepage: https://github.com/Hyper3Labs/HyperView
8
+ ---
9
+
10
+ # HyperView CLI
11
+
12
+ Use the `hyperview` CLI as the primary agent interface to HyperView.
13
+
14
+ ## Install the Skill
15
+
16
+ For users who installed HyperView from a package, install or refresh this agent skill with:
17
+
18
+ ```bash
19
+ uv tool install --python 3.12 --upgrade hyperview && hyperview skill install
20
+ ```
21
+
22
+ HyperView currently supports Python 3.10 through 3.13; `--python 3.12` keeps the persistent CLI on a broadly supported runtime. Re-running `hyperview skill install` replaces old HyperView skill copies. By default this installs into detected agent locations plus the universal `~/.agents/skills/` fallback. Limit targets with repeated `--agent` flags such as `--agent claude-code`, `--agent github-copilot`, `--agent cursor`, or `--agent universal`; use `--all-known` when you explicitly want every known agent profile. Use `--scope project` to write project-local skills such as `.claude/skills/`, `.github/skills/`, `.cursor/skills/`, or `.agents/skills/` depending on the selected agent.
23
+
24
+ ## When to use it
25
+
26
+ - Create or inspect a persisted dataset.
27
+ - Create or inspect a workspace.
28
+ - Set the single dataset attached to a workspace.
29
+ - Start or control a running HyperView runtime.
30
+ - Register a custom embedding provider.
31
+ - Compute embeddings or layouts without restarting the UI.
32
+ - Export paper-ready static 3D embedding figures without opening the UI.
33
+ - Export read-only static demo bundles with `hyperview export`.
34
+ - Switch the active workspace, layout, or selection in a running session.
35
+ - Add, remove, or compose extension-backed panel instances.
36
+ - Create, install, reload, or use a local extension with Python tools and browser panels.
37
+
38
+ ## Core workflow
39
+
40
+ 1. Create a workspace, usually with its dataset in the same command.
41
+ 2. Create the dataset if it does not exist yet.
42
+ 3. Start or target a running `hyperview serve` runtime.
43
+ 4. Register a provider if needed.
44
+ 5. Submit embedding or layout jobs through the runtime.
45
+ 6. Use `hyperview ui ...` commands to switch what the live UI shows.
46
+ 7. Export paper figures with `hyperview figure export` when the user needs screenshots or publication diagrams.
47
+ 8. Export read-only static demos with `hyperview export <workspace-id> --out bundle/`.
48
+ 9. For extensions, create an extension folder and install it into the running workspace.
49
+
50
+ ## Current model
51
+
52
+ - One dataset per workspace.
53
+ - Datasets are created separately from workspaces.
54
+ - The workspace owns the dataset selection.
55
+ - `ui layout set` changes the active layout and opens the matching built-in scatter panel.
56
+ - Samples retrieval state lives under the runtime-managed Samples panel state. `ui samples retrieval set-anchor` selects an anchor sample and pins nearest-neighbor context to an explicit layout or space.
57
+ - Runtime-added panels can be built-in samples panels, typed scatter instances bound to explicit layout keys, or extension-backed panel modules loaded into the host React tree.
58
+ - Runtime control commands use canonical namespaced ids: `workspace.*`, `panel.<type>.*`, and `collection.*`. Older command ids remain deprecated aliases for compatibility only.
59
+ - Command results carry the runtime snapshot in a `CommandResult` envelope (`ok`, `command`, `result`, `workspace`, `snapshot`, `revision`, `error`). Frontends and agents should apply the returned snapshot instead of doing an immediate `/api/runtime` refetch.
60
+ - Runtime-added panels use the stable thin `HyperViewPanelSDK` surface on `window`.
61
+ - Extensions are repo-local folders with `extension.toml`, optional Python tools, and optional panel modules.
62
+ - Extension panels run control commands through the SDK command client; Python tools are still reachable through `hyperview tools run`.
63
+ - Extensions define reusable tools/panels; workspace views compose concrete panel instances and layout. In Python launch scripts, register extensions with `session.ui.add_extension(...)` and place panels with `hv.ui.ExtensionPanel(...)`.
64
+ - Extensions distributed with HyperView use the same manifest and source format as repo-local extensions. Install them with `hyperview extension add --shipped <name>` or `session.ui.add_shipped_extension(...)`; promotion must not require panel/tool source changes.
65
+ - In practice, create datasets and workspaces before starting the runtime for that workspace.
66
+ - `figure export` is browserless and supports 3D layouts only. It reuses the persisted 3D camera for the layout when available, otherwise it chooses a paper-oriented default view.
67
+ - Paper figure defaults are square, white-background, opaque PNGs with a faint sphere guide and direct labels for small label sets.
68
+ - `hyperview export <workspace-id> --out bundle/` writes a self-contained **Shared Space**: a static frontend + JSON/API/media bundle. It is intentionally read-only with respect to durable workspace and backend/model operations, while keeping normal local exploration available: visitors can browse, select, pan/zoom, switch prepared cases, inspect panels, and use exported precomputed data. Backend-only affordances such as arbitrary text inference are hidden when unavailable. The host identifies this mode with the concise `Shared Space` label.
69
+
70
+ ## Session authentication
71
+
72
+ A running server mints a session token. Reads are open; runtime commands that
73
+ mutate state answer `401 Missing or invalid HyperView session token` without
74
+ it. This bites agents that talk to `/api/control/commands/run` directly.
75
+
76
+ - The CLI resolves the token itself, from `HYPERVIEW_API_TOKEN` or from the
77
+ discovery file `server-<port>.json` next to the datasets directory. Prefer
78
+ the CLI over raw HTTP and this stays invisible.
79
+ - For raw HTTP, send `Authorization: Bearer <token>` or `?token=<token>`.
80
+ - Set `HYPERVIEW_NO_AUTH=1` to declare the server public — a Hugging Face
81
+ Space has no way to hand a visitor a token, so panel adds 401 without it.
82
+ Public is not open: anonymous callers keep the viewer commands
83
+ (`workspace.panel.*`, `panel.*`, `collection.*`, selection, active layout)
84
+ and get 403 on provider registration, extension install, `tools run`, and
85
+ embedding/layout compute. Drive those with a token, not by widening the flag.
86
+
87
+ Read [references/commands.md](references/commands.md) for command recipes covering datasets, workspaces, providers, embeddings, layouts, paper figures, runtime UI state, selections, and jobs.
88
+ Read [references/panel-modules.md](references/panel-modules.md) when the task involves authoring a browser panel module.
89
+ Read [references/extensions.md](references/extensions.md) when the task involves packaging or registering custom panel code or Python tools.
90
+
91
+ ## Agent guidance
92
+
93
+ - Prefer CLI commands when the goal is to operate a running HyperView session.
94
+ - Treat dataset creation and workspace binding as separate steps when needed: `dataset create ...` creates persisted data, `workspace create --dataset ...` or `workspace set-dataset ...` binds it to a workspace.
95
+ - Prefer `workspace create --dataset ...` over separate create and dataset-attach calls when setting up a new workspace.
96
+ - In Python dataset setup code, use public ingestion helpers such as `dataset.add_samples([...])` or `dataset.add_images_dir(...)`.
97
+ - Prefer built-in providers before registering custom providers. For Hyper3-CLIP, use `dataset.compute_embeddings(model="hyper3-clip-v0.5", provider="hyper-models")`.
98
+ - In comparison demos, fail fast when a required model/provider cannot compute embeddings; do not silently substitute the baseline model as a "candidate" fallback.
99
+ - When a project truly needs a custom Python provider, use `hyperview provider register ...` from the CLI or `hv.register_provider(...)` in Python.
100
+ - For custom panel code, create an extension under `.hyperview/extensions/<extension-name>/`; do not register arbitrary panel module files directly.
101
+ - For side-by-side embedding comparisons, add typed scatter panels through `hyperview ui panel add --kind scatter --layout-key ... --reference-panel-id ... --direction right`.
102
+ - Use first-class view layout fields for panel sizing and visibility: `hv.ui.PanelLayout(width=..., min_width=...)` in Python, or `hyperview ui panel resize/move/focus/close/show` from the CLI. Do not pass Dockview-specific sizing through panel props.
103
+ - Runtime panel add/update/remove, sizing, placement, focus, visibility, and state commands share the same control path in CLI and Python. Use `hyperview ui panel ...` or `session.ui`/`session.control`; do not call raw panel-control HTTP routes from examples or demos.
104
+ - Live text retrieval is available only when `/api/dataset` exposes an index whose `query_modes` includes `text`. HyperView derives this from the provider attached to the current runtime, so a stored space labelled multimodal is not sufficient by itself. Use `Session.ui.query_by_text(...)` or the native Samples search box; both resolve to a text-capable index and reject an explicitly requested image-only space.
105
+ - When invoking raw commands, prefer canonical command names: `workspace.panel.add/update/remove/resize/move/focus/close/show`, `workspace.panel.state.get/patch`, `panel.samples.retrieval.*`, `collection.neighbors.create`, and `collection.filter.set`. Treat legacy `ui.*` command ids as deprecated aliases.
106
+ - To retitle an existing runtime panel or replace its props, use `hyperview ui panel update --panel-id ... --title ... --props-json ...` instead of remove/re-add when preserving panel identity matters.
107
+ - For nearest-neighbor comparisons, use `hyperview ui samples retrieval set-anchor --sample-id ... --layout-key ...` or run `panel.samples.retrieval.set-anchor` / `collection.neighbors.create` through the SDK command client; do not infer neighbor space from whichever scatter panel is focused.
108
+ - For collection-backed Samples panel actions, use `hyperview panel samples show-results ...`, `hyperview panel samples reset`, `hyperview panel samples show-neighbors ...`, and `hyperview panel labels filter ...`; read the returned `result.collection_id` and `result.collection` when relevant. Use the canonical panel id `samples` for the primary shared search/result surface. When a prepared static workspace needs two independent result panes, bind each `hv.ui.Samples` panel with `props={"mode": "results", "collectionId": collection_id}` and update that documented prop through `usePanelActions()`.
109
+ - Use `hyperview ui panel state get/patch` or SDK `usePanelState()` when a panel needs durable panel-owned state. Keep durable state under runtime panel state instead of browser local storage or ad hoc events.
110
+ - For reset controls in panels, run the relevant runtime command through the SDK command client when both selection and nearest-neighbor context should be cleared.
111
+ - Do not use timers or browser storage to wait for panel readiness or guard startup state. Write the intended state through runtime commands or `usePanelState()`.
112
+ - In panel modules, use `hooks.useSampleResults()` to present a curated set in the canonical Samples panel and synchronize selection/focus. Use `hooks.usePanelActions().updateProps(panelId, props)` when one panel needs to update another panel's documented props, and `hooks.usePanelActions().focusPanel(panelId)` when a user action should activate the relevant sibling panel. These helpers work as durable runtime mutations in full mode and ephemeral client-side interactions in static mode; do not hand-roll panel-control requests or raw command envelopes for these common flows.
113
+ - For extensions, prefer `.hyperview/extensions/<extension-name>/` in the project root. `hyperview serve` auto-discovers those folders and attaches them to the launched workspace, so they can live in version control with the dataset/project code.
114
+ - For demos/spaces that launch HyperView from Python, compose panels with `hv.ui.Horizontal`, `hv.ui.Vertical`, `hv.ui.Tabs`, `hv.ui.Grid`, `hv.ui.Scatter`, `hv.ui.Samples`, `hv.ui.ExtensionPanel`, and `hv.ui.PanelLayout`; keep extension manifests focused on reusable panel/tool definitions.
115
+ - An explicit Samples- or Extension-only `hv.ui.View` can launch from dataset records without an embedding or layout. Only include a Scatter panel when the demo genuinely needs a visualization; Scatter views still require a layout or embedding space.
116
+ - Keep layout orchestration out of panel modules. A panel should not close, hide, or rearrange sibling panels on mount; use `hv.ui.View(...)` or `hyperview ui panel ...` to compose the workspace.
117
+ - Treat host focus/resize helpers as transient user-action helpers, not as startup layout machinery. For durable control from a panel, run the corresponding `workspace.panel.*` command.
118
+ - Pass only documented panel props through `hv.ui.ExtensionPanel(..., props=...)`.
119
+ - Tools can write files under `ctx.extension_storage` and return `ctx.url_for(path)` for panel-renderable artifact URLs.
120
+ - Put query results, benchmark tables, contact sheets, and other generated artifacts behind extension tools or compact panel props. Do not embed large base64 payloads or generated datasets inside panel JavaScript.
121
+ - Keep cross-panel coordination in host/runtime state. Do not use `window.dispatchEvent` / `window.addEventListener` as shared panel state.
122
+ - Keep extensions self-contained: `extension.toml`, tools, a `panel.jsx` module (preferred over `.js`), and any local assets in the same folder.
123
+ - Prefer `--json` output when chaining commands or inspecting results programmatically.
124
+ - Wait for embedding/layout jobs to finish before issuing layout-switch commands that depend on their results.
125
+ - Use `hyperview jobs list` or `hyperview jobs inspect <job-id>` if a compute command is long-running or you started it with `--no-wait`.
126
+ - For provider args, use repeated `--provider-arg key=value` flags.
127
+ - Treat the workspace as the durable unit. Changing datasets means setting a new workspace dataset, not switching among many datasets inside one workspace.
128
+ - Prefer panel modules over raw HTML. The panel system no longer relies on iframes.
129
+ - Author custom panels as `panel.jsx` using `window.HyperViewPanelSDK` public hooks only. HyperView standardizes the data and interaction contract (props, selection, collections, sample results, sibling `updateProps`, panel state), not the panel's visual design. A panel is free to render any JSX, CSS, SVG, Canvas, or WebGL experience that fits its purpose.
130
+ - Do not reach for private runtime/frontend APIs from extension panels. If a behavior is not on the public SDK or CLI/API surface, do not invent a side channel.
131
+ - For paper diagrams, prefer `hyperview figure export` over browser screenshots unless the user explicitly needs exact UI chrome.
132
+ - For public, read-only examples-gallery demos, create a Shared Space with `hyperview export <workspace-id> --out bundle/` instead of keeping a Python server awake. When a bundle belongs below a containing static site, pass its exact URL prefix with `--mount-path /spaces/<slug>` and copy the resulting bundle into that path. Use **Live Space** for the runtime-connected deployment that can run new queries, providers, and workspace mutations.
133
+ - For publication figures, keep the defaults first: `--theme light`, `--guide-style paper`, and `--legend auto`. Use `--show-selection` only when selected samples are meaningful and will be explained in the caption.
134
+ - The first `uv run hyperview ...` invocation in a session can take 30+ seconds (torch/datasets imports). Allow generous timeouts and avoid sending SIGINT.
135
+
136
+ ## Inspecting runtime state
137
+
138
+ The runtime exposes JSON discovery endpoints alongside the CLI. Use them to obtain layout keys, sample IDs, and registered tools/panels for follow-up commands:
139
+
140
+ - `GET /api/runtime?workspace_id=<ws>` &mdash; full snapshot. Read `workspace.ui.active_layout_key`, `workspace.ui.selected_ids`, `workspace.ui.panels`, `workspace.ui.custom_panels[*].state`, `workspace.ui.custom_panels[*].data.module_src`, and registered `extensions`/`tools`.
141
+ - `GET /api/embeddings?workspace_id=<ws>` &mdash; the active or default layout, including `layout_key`, `geometry`, and sample `ids`. Use the returned `layout_key` for `hyperview ui layout set --layout-key ...` and pick from `ids` for `hyperview ui selection set --ids ...`.
142
+ - `GET /api/tools` &mdash; registered tool URIs (also returned by `hyperview tools list --json`).
143
+
144
+ Prefer layout metadata over parsing layout-key strings. Use `/api/dataset`, exported runtime snapshots, or `dataset.list_layouts()` when filtering by geometry, dimension, model, or space.
@@ -60,6 +60,17 @@ hyperview dataset create cifar10_demo \
60
60
  --label-key label
61
61
  ```
62
62
 
63
+ Create a multimodal dataset with captions:
64
+
65
+ ```bash
66
+ hyperview dataset create coco_captions_demo \
67
+ --hf-dataset HuggingFaceM4/COCO \
68
+ --split train \
69
+ --image-key image \
70
+ --text-key sentences \
71
+ --samples 500
72
+ ```
73
+
63
74
  Create a persisted dataset from a local image directory:
64
75
 
65
76
  ```bash
@@ -95,13 +106,29 @@ hyperview status --json
95
106
 
96
107
  ## Providers, Embeddings, and Layouts
97
108
 
98
- Register a custom provider:
109
+ Use built-in providers directly when possible. Hyper3-CLIP is available through
110
+ the `hyper-models` provider:
111
+
112
+ ```python
113
+ dataset.compute_embeddings(model="hyper3-clip-v0.5", provider="hyper-models")
114
+ ```
115
+
116
+ Register a custom provider only when the model is not available through a
117
+ built-in provider:
99
118
 
100
119
  ```bash
101
120
  hyperview provider register my-provider \
102
121
  --import-path my_pkg.provider:MyProvider
103
122
  ```
104
123
 
124
+ The same registration is available from Python:
125
+
126
+ ```python
127
+ import hyperview as hv
128
+
129
+ hv.register_provider("my-provider", "my_pkg.provider:MyProvider", overwrite=True)
130
+ ```
131
+
105
132
  Compute checkpoint-backed embeddings and a layout:
106
133
 
107
134
  ```bash
@@ -144,7 +171,7 @@ hyperview figure export figures/embedding-sphere.png \
144
171
 
145
172
  If `--layout` is omitted, HyperView uses the active 3D layout when one is set, otherwise the first available 3D layout. Use `--layout active` when you specifically want the live UI's active layout and want the command to fail if none is active.
146
173
 
147
- The export path is pure Python and does not require Playwright, browser bundling, Node, or a running frontend. It supports 3D layouts only; 2D layouts are rejected with a validation message.
174
+ The export path does not require opening the UI. It supports 3D layouts only; 2D layouts are rejected with a validation message.
148
175
 
149
176
  Paper defaults are tuned for academic figures:
150
177
 
@@ -188,6 +215,71 @@ hyperview figure export figures/embedding-panel-a.png \
188
215
  --title "ArcFace spherical embeddings"
189
216
  ```
190
217
 
218
+ ## Shared Spaces
219
+
220
+ Export a read-only, self-contained Shared Space for a workspace:
221
+
222
+ ```bash
223
+ hyperview export research --out dist/research-demo
224
+ ```
225
+
226
+ When the bundle will be copied below another static site, declare its stable
227
+ mount path during export:
228
+
229
+ ```bash
230
+ hyperview export research \
231
+ --out dist/research-demo \
232
+ --mount-path /spaces/research
233
+ ```
234
+
235
+ The exporter rebases the frontend shell and records `/spaces/research` in
236
+ `hyperview-static.json`. Copy the bundle contents into that exact directory
237
+ inside the containing site's document root. Static API, media, and panel-module
238
+ requests remain scoped to the mounted bundle; no proxy, cookie, or referrer
239
+ routing is required.
240
+
241
+ Sample similarity is omitted by default. Enable a bounded precomputed index
242
+ when the demo exposes nearest-neighbor browsing:
243
+
244
+ ```bash
245
+ hyperview export research --out dist/research-demo --similarity-k 25
246
+ ```
247
+
248
+ The bundle contains the packaged static frontend, `api/runtime.json`,
249
+ `api/dataset.json`, sample shards under `api/samples/`, media and thumbnails,
250
+ layout coordinate JSON under `api/embeddings/`, materialized collection items
251
+ under `api/collections/`, and extension panel modules under
252
+ `api/panels/content/`. It also writes a versioned `hyperview-static.json`
253
+ manifest and a static-assets-only `wrangler.jsonc` configuration. Deploy the
254
+ bundle to Cloudflare from its output directory with:
255
+
256
+ ```bash
257
+ npx wrangler deploy --config wrangler.jsonc
258
+ ```
259
+
260
+ The generated `index.html` sets `window.__HYPERVIEW_STATIC__ = true`. In this
261
+ mode the frontend reads JSON files from the bundle. Selection, prepared-case
262
+ panel prop changes, panel state, filtering, and result presentation remain
263
+ ephemeral client-side interactions. Durable workspace writes, Python tools,
264
+ model execution, and arbitrary inference/search are unavailable; controls for
265
+ those capabilities are hidden. The host shows the notice
266
+ `Shared Space`.
267
+
268
+ Python launch/session code can export the same bundle:
269
+
270
+ ```python
271
+ session = hv.launch(dataset, block=False)
272
+ session.export("dist/research-demo", workspace_id="research", similarity_k=25)
273
+ ```
274
+
275
+ For persisted workspaces, use the top-level API:
276
+
277
+ ```python
278
+ import hyperview as hv
279
+
280
+ hv.export_workspace("research", "dist/research-demo")
281
+ ```
282
+
191
283
  ## Runtime UI
192
284
 
193
285
  Discover an existing layout key and sample IDs before mutating runtime state:
@@ -199,6 +291,17 @@ curl --max-time 2 'http://127.0.0.1:6262/api/embeddings?workspace_id=research' |
199
291
 
200
292
  If no layout exists yet (`active_layout_key` is `null` and `/api/embeddings` returns nothing), create one with `hyperview embeddings compute ... --layout euclidean:2d` (creates embeddings + layout) or `hyperview layouts compute ... --space-key <space-key> --layout euclidean:2d` (adds a layout to an existing embedding space).
201
293
 
294
+ Runtime command ids are namespaced:
295
+
296
+ - `workspace.*` for workspace/view/panel placement and panel-owned state storage
297
+ - `panel.<type>.*` for panel-owned transitions such as Samples retrieval
298
+ - `collection.*` for materialized filters, neighbors, and query result sets
299
+
300
+ Every control command returns a `CommandResult` envelope with `ok`, `command`,
301
+ `result`, `workspace`, `snapshot`, `revision`, and optional `error`. Apply the
302
+ returned `snapshot` when present. Do not issue an immediate `/api/runtime`
303
+ refetch unless a legacy endpoint did not return a snapshot.
304
+
202
305
  Switch the live UI to a layout and selection:
203
306
 
204
307
  ```bash
@@ -208,18 +311,38 @@ hyperview ui selection set --workspace research --ids sample-1,sample-8
208
311
 
209
312
  `--layout-key` must be an existing layout (use the `layout_key` returned by `/api/embeddings`). When the chosen layout is Euclidean 3D, HyperView opens or focuses the Euclidean 3D scatter panel.
210
313
 
211
- Add a custom panel through an extension:
314
+ Add a custom panel through an extension. Panel add/update/remove and panel
315
+ layout controls share HyperView's public control command path; prefer these CLI
316
+ commands or the matching Python `session.ui` helpers in examples.
212
317
 
213
318
  ```bash
214
319
  hyperview extension add .hyperview/extensions/label-histogram \
215
320
  --workspace research
216
321
 
322
+ # The same manifest/source format can be distributed with HyperView.
323
+ hyperview extension add --shipped <extension-name> \
324
+ --workspace research
325
+
217
326
  hyperview ui panel add \
218
327
  --workspace research \
219
328
  --panel-id label-histogram \
220
329
  --extension label-histogram \
221
330
  --extension-panel label-histogram \
222
331
  --position right \
332
+ --width 340 \
333
+ --min-width 280 \
334
+ ```
335
+
336
+ Add the built-in samples panel through the same runtime panel API:
337
+
338
+ ```bash
339
+ hyperview ui panel add \
340
+ --workspace research \
341
+ --panel-id samples \
342
+ --kind builtin \
343
+ --builtin-panel samples \
344
+ --props-json '{"mode":"browse"}' \
345
+ --position right
223
346
  ```
224
347
 
225
348
  Add two runtime scatter panels bound to explicit layouts, side by side:
@@ -244,8 +367,7 @@ hyperview ui panel add \
244
367
  --direction right
245
368
  ```
246
369
 
247
- Python launch scripts can encode the same composition without calling runtime
248
- internals:
370
+ Python launch scripts can encode the same composition:
249
371
 
250
372
  ```python
251
373
  view = hv.ui.View(
@@ -253,13 +375,68 @@ view = hv.ui.View(
253
375
  hv.ui.Scatter("uncha-poincare", title="UNCHA", layout_key=uncha_layout),
254
376
  hv.ui.Scatter("hycoclip-poincare", title="HyCoCLIP", layout_key=hycoclip_layout),
255
377
  ),
256
- hv.ui.ExtensionPanel("notes", extension="notes", panel="notes", position="right"),
378
+ hv.ui.ExtensionPanel(
379
+ "notes",
380
+ extension="notes",
381
+ panel="notes",
382
+ position="right",
383
+ layout=hv.ui.PanelLayout(width=340, min_width=280),
384
+ ),
385
+ active_panel="notes",
257
386
  )
258
387
  session = hv.launch(dataset, block=False)
259
388
  session.ui.add_extension(".hyperview/extensions/notes")
260
389
  session.ui.apply_view(view)
261
390
  ```
262
391
 
392
+ Update an existing runtime panel title or props without changing its identity:
393
+
394
+ ```bash
395
+ hyperview ui panel update \
396
+ --workspace research \
397
+ --panel-id samples \
398
+ --title "Ranked Samples" \
399
+ --props-json '{"mode":"ranked","rank":{"anchorSampleId":"<sample-id>","layoutKey":"<layout-key>","k":18}}' \
400
+ --json
401
+ ```
402
+
403
+ Resize, move, focus, hide, or show a runtime panel through durable view state:
404
+
405
+ ```bash
406
+ hyperview ui panel resize \
407
+ --workspace research \
408
+ --panel-id notes \
409
+ --width 380 \
410
+ --min-width 300
411
+
412
+ hyperview ui panel move \
413
+ --workspace research \
414
+ --panel-id notes \
415
+ --position right \
416
+ --reference-panel-id samples \
417
+ --direction right
418
+
419
+ hyperview ui panel focus --workspace research --panel-id notes
420
+ hyperview ui panel close --workspace research --panel-id notes
421
+ hyperview ui panel show --workspace research --panel-id notes
422
+ ```
423
+
424
+ Read or patch durable panel-owned state:
425
+
426
+ ```bash
427
+ hyperview ui panel state get \
428
+ --workspace research \
429
+ --panel-id samples \
430
+ --json
431
+
432
+ hyperview ui panel state patch \
433
+ --workspace research \
434
+ --panel-id samples \
435
+ --state-json '{"settings":{"density":"compact"}}' \
436
+ --expected-revision 0 \
437
+ --json
438
+ ```
439
+
263
440
  Remove a runtime panel by id:
264
441
 
265
442
  ```bash
@@ -268,25 +445,65 @@ hyperview ui panel remove \
268
445
  --panel-id hycoclip-poincare
269
446
  ```
270
447
 
271
- Pin nearest-neighbor results to a specific embedding layout:
448
+ Pin nearest-neighbor results to the Samples panel state for a specific embedding layout:
272
449
 
273
450
  ```bash
274
- hyperview ui similarity set \
451
+ hyperview ui samples retrieval set-anchor \
275
452
  --workspace research \
276
453
  --sample-id <sample-id> \
277
- --layout-key <layout-key> \
454
+ --index-id space:<space-key> \
455
+ --k 18
456
+
457
+ hyperview ui samples retrieval set-k \
458
+ --workspace research \
459
+ --k 36
460
+
461
+ hyperview ui samples retrieval set-text \
462
+ --workspace research \
463
+ --query "a dog playing in the park" \
464
+ --index-id space:<space-key> \
278
465
  --k 18
279
466
  ```
280
467
 
281
- Clear the explicit nearest-neighbor context:
468
+ Clear the explicit Samples retrieval context:
282
469
 
283
470
  ```bash
284
- hyperview ui similarity clear --workspace research
471
+ hyperview ui samples retrieval clear --workspace research
472
+ ```
473
+
474
+ Use `hyperview ui samples retrieval ...` for compatibility with existing CLI
475
+ flows. Raw commands should use the canonical `panel.samples.retrieval.*`
476
+ command ids.
477
+
478
+ Use panel collection shortcuts when the desired outcome is a Samples panel collection:
479
+
480
+ ```bash
481
+ hyperview panel samples show-results \
482
+ --workspace research \
483
+ --sample-id sample-1 \
484
+ --sample-id sample-8 \
485
+ --json
486
+
487
+ hyperview panel samples reset --workspace research --json
488
+
489
+ hyperview panel samples show-neighbors \
490
+ --workspace research \
491
+ --sample-id <sample-id> \
492
+ --index-id space:<space-key> \
493
+ --k 18 \
494
+ --json
495
+
496
+ hyperview panel labels filter \
497
+ --workspace research \
498
+ --value cat \
499
+ --json
500
+
501
+ hyperview panel labels filter --workspace research --clear
285
502
  ```
286
503
 
287
504
  ## Extensions and Tools
288
505
 
289
- Create backend-plus-frontend extensions under `.hyperview/extensions/<name>/` so they can be versioned with the project and auto-registered on `hyperview serve`. For a server that is already running, install one explicitly:
506
+ Create extensions under `.hyperview/extensions/<name>/` so they can be versioned with the project and auto-registered on `hyperview serve`. For a server that is already running, install one explicitly:
290
507
 
291
508
  ```bash
292
509
  hyperview extension add .hyperview/extensions/selection-profile \