Document Hub and let docs pages nest (#2864)
* feat(website): nest docs pages under landable groups The docs sidebar could already render groups from subdirectories in public-docs, but nothing used it because every doc was a flat file, and two things stopped it being usable. A group had no page of its own, so its label was only a toggle and its name came from the directory name via formatLabel. A directory's index.md now supplies the group's label, order, and href, which makes the group landable and lets the label be authored rather than derived. Categories and top-level directories named the same thing, so a categorised doc at hub/index.md produced a group nested inside its own category. Only directories below the top level become groups now. Also fixes two behaviours in the sidebar: - The open/closed effect assigned containsActive on every change, so a group you expanded to browse collapsed the moment you navigated anywhere else. Navigating in now opens a group and navigating away leaves it alone. - The sidebar scrolls independently of the page and never scrolled the active entry into view, so loading or refreshing a page far down the list left the sidebar parked at the top with no visible position. The group row is a single target: it navigates and expands, and collapses when clicked again from the page it points at. A separate chevron button would put two actions a few pixels apart. * docs(hub): document Hub Adds a Hub section covering what it is, how it works, daemons, triggers, configuration, activity, and the two ways to run it. The section separates using Hub from running it. Overview, quickstart, daemons, triggers, and configuration hold regardless of who operates the deployment; the self-hosting branch owns deploying the service and creating the GitHub, Slack, and Discord apps it talks to. That split falls on a real seam, because those apps are exactly what a hosted Hub would own on your behalf. Hosted is a placeholder until it ships. Each provider gets a trigger page carrying its events, filter semantics, and the full paseo.event.* reference for the data a prompt can read. That data is the thing a config author actually needs and the thing they cannot get from anywhere else. Every YAML block was parsed against the Hub config schema rather than eyeballed, which kept several plausible-looking things out of the docs: worktree prNumber takes a literal number and not a merge variable, only daemon environments run today, and github.push has no actor so it can never satisfy the required from_users filter. Troubleshooting moves to order 90 so it stays last. * refactor(website): let the active docs entry scroll itself into view The layout queried the sidebar for the active entry after every navigation, which coupled it to when that entry mounts. A link inside a collapsed group only mounts once the group's own effect opens it, so the query could run against a DOM that does not contain it yet. Moving the scroll to the entry removes the ordering question rather than answering it, and drops the ref and the cross-component query. Reported by Greptile on #2864. The failure it described does not reproduce: navigating from a page outside a collapsed group into one of its children still scrolls correctly, verified with the group confirmed collapsed and the sidebar forced to the top. The coupling was real even though the bug was not. * docs(hub): stop listing BETTER_AUTH_URL as required It falls back to PASEO_CLOUD_PUBLIC_URL, so a deployment that sets the public origin already has a correct auth base URL. Listing it as required made the Fly recipe look incomplete when it was not. Moved to optional with its default, and recorded what actually breaks without BETTER_AUTH_SECRET: the auth routes close and nobody can sign in. Reported by Codex on #2864, which read the same inconsistency the other way round and proposed adding the variable to the Fly example. * docs(hub): attach a database in the Fly recipe The Fly section showed inline config and a secrets command, neither of which supplied DATABASE_URL. It defaults to localhost:5432, which on Fly reaches nothing, so the documented deployment could not start. fly postgres attach sets DATABASE_URL as a secret, so the step is the attach itself rather than another variable to copy. Reported by Codex on #2864. * docs: align Hub self-hosting contract
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
---
|
||||
title: Daemons in Hub
|
||||
description: Enroll a machine with Hub, reference it from configuration, and understand what Hub owns once it is connected.
|
||||
nav: Daemons
|
||||
order: 63
|
||||
category: Hub
|
||||
---
|
||||
|
||||
# Daemons in Hub
|
||||
|
||||
A daemon is one of your machines running the Paseo daemon. Enroll it once with your Hub organization, then any project can reference it.
|
||||
|
||||
## Connect
|
||||
|
||||
On the machine:
|
||||
|
||||
```sh
|
||||
paseo hub connect https://hub.example.com
|
||||
```
|
||||
|
||||
The CLI prints a URL and a verification code, and opens your browser if it can. In Hub, open **Daemons → Register a daemon**, enter the code, name the daemon, and approve it.
|
||||
|
||||
The name you choose here is what configuration references. It can be renamed later, but renaming after a configuration is active means updating that configuration.
|
||||
|
||||
For unattended setup, skip the browser with an enrollment token:
|
||||
|
||||
```sh
|
||||
paseo hub connect https://hub.example.com --token <token>
|
||||
```
|
||||
|
||||
Check and undo:
|
||||
|
||||
```sh
|
||||
paseo hub status
|
||||
paseo hub disconnect
|
||||
paseo hub disconnect --force # drop local authority when Hub is unreachable
|
||||
```
|
||||
|
||||
One daemon has one Hub relationship. Connecting a daemon that already has one is refused.
|
||||
|
||||
## Reference it from configuration
|
||||
|
||||
```yaml
|
||||
environments:
|
||||
- name: dev
|
||||
kind: daemon
|
||||
daemon: my-macbook
|
||||
cwd: /Users/you/code/your-repo
|
||||
```
|
||||
|
||||
`daemon` is the display name. It resolves to a daemon id when the configuration activates, so a daemon that no longer exists fails activation instead of failing at dispatch.
|
||||
|
||||
`cwd` is a path on that machine. Hub does not clone anything for you; the directory must already exist.
|
||||
|
||||
To keep executions off your working tree, add a worktree:
|
||||
|
||||
```yaml
|
||||
worktree:
|
||||
mode: branch-off
|
||||
newBranch: hub/${{ paseo.event.github.issue.number }}
|
||||
base: main
|
||||
```
|
||||
|
||||
See [Git worktrees](/docs/worktrees) for setup hooks and scripts.
|
||||
|
||||
## What Hub owns
|
||||
|
||||
For agents it dispatched, Hub owns creation, reconnect recovery, output observation, and completion. Agents you start yourself are untouched.
|
||||
|
||||
If Hub loses the create response, or the daemon restarts mid-execution, Hub resends the same create intent with the same execution id. The daemon returns the existing agent rather than running the prompt again. An agent that closed or errored is recorded as interrupted; Hub never silently starts a second one.
|
||||
|
||||
## Status
|
||||
|
||||
| Status | Meaning |
|
||||
| ----------------- | ---------------------------------------------- |
|
||||
| Approval required | The CLI is waiting for you to approve the code |
|
||||
| Connected | Online and accepting dispatch |
|
||||
| Offline | Enrolled but not currently connected |
|
||||
| Revoked | Access removed from Hub |
|
||||
|
||||
An event that arrives while a daemon is offline fails dispatch with `daemon_not_connected`. Nothing is queued for later. The event is in the project's Activity, and the trigger has to fire again.
|
||||
|
||||
Revoking from **Daemons → Revoke daemon** ends the relationship from Hub's side. The daemon keeps running your local agents.
|
||||
Reference in New Issue
Block a user