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,182 @@
|
||||
---
|
||||
title: Hub examples
|
||||
description: Copyable hub.yml configurations for issue triage, PR review, Discord and Slack mentions, and isolated worktrees.
|
||||
nav: Examples
|
||||
order: 70
|
||||
category: Hub
|
||||
---
|
||||
|
||||
# Hub examples
|
||||
|
||||
Complete configurations you can adapt. Field details are in the [`hub.yml` reference](/docs/hub/configuration/hub-yml).
|
||||
|
||||
Every example assumes one environment:
|
||||
|
||||
```yaml
|
||||
environments:
|
||||
- name: dev
|
||||
kind: daemon
|
||||
daemon: my-macbook
|
||||
cwd: /Users/you/code/api
|
||||
```
|
||||
|
||||
## Answer a mention on an issue
|
||||
|
||||
The baseline. An agent runs in your checkout and can push, because GitHub-triggered executions get a scoped `GH_TOKEN`.
|
||||
|
||||
```yaml
|
||||
triggers:
|
||||
- name: mention
|
||||
on: github.issue_comment
|
||||
environment: dev
|
||||
filters:
|
||||
repo: acme/api
|
||||
contains: "@paseo"
|
||||
from_users: [alice, bob]
|
||||
agent:
|
||||
provider: codex
|
||||
mode: full-access
|
||||
prompt: |
|
||||
You were mentioned on ${{ paseo.event.github.trigger_url }}.
|
||||
|
||||
${{ paseo.event.github.comment.body }}
|
||||
|
||||
Reply by commenting on the thread with gh.
|
||||
```
|
||||
|
||||
## Review a pull request in its own worktree
|
||||
|
||||
`checkout-branch` on the PR's head branch puts the agent on the right code without disturbing your working tree.
|
||||
|
||||
```yaml
|
||||
triggers:
|
||||
- name: review
|
||||
on: github.pull_request_review_comment
|
||||
environment: review
|
||||
filters:
|
||||
repo: acme/api
|
||||
contains: "@paseo review"
|
||||
from_users: [alice]
|
||||
agent:
|
||||
provider: claude
|
||||
mode: full-access
|
||||
timeout: 30m
|
||||
auto_archive: true
|
||||
prompt: |
|
||||
Address this review comment on PR #${{ paseo.event.github.pull_request.number }}:
|
||||
|
||||
${{ paseo.event.github.comment.body }}
|
||||
```
|
||||
|
||||
Add the worktree to the environment it uses:
|
||||
|
||||
```yaml
|
||||
environments:
|
||||
- name: review
|
||||
kind: daemon
|
||||
daemon: my-macbook
|
||||
cwd: /Users/you/code/api
|
||||
worktree:
|
||||
mode: checkout-branch
|
||||
branch: ${{ paseo.event.github.pull_request.head.ref }}
|
||||
```
|
||||
|
||||
## Triage new issues on a fresh branch
|
||||
|
||||
```yaml
|
||||
environments:
|
||||
- name: triage
|
||||
kind: daemon
|
||||
daemon: my-macbook
|
||||
cwd: /Users/you/code/api
|
||||
worktree:
|
||||
mode: branch-off
|
||||
newBranch: triage/${{ paseo.event.github.issue.number }}
|
||||
base: main
|
||||
|
||||
triggers:
|
||||
- name: triage
|
||||
on: github.issues
|
||||
environment: triage
|
||||
filters:
|
||||
repo: acme/api
|
||||
from_users: [alice, bob]
|
||||
agent:
|
||||
provider: codex
|
||||
mode: full-access
|
||||
prompt: |
|
||||
Investigate issue #${{ paseo.event.github.issue.number }}:
|
||||
${{ paseo.event.github.issue.title }}
|
||||
|
||||
${{ paseo.event.github.issue.body }}
|
||||
|
||||
If you find the cause, open a pull request.
|
||||
```
|
||||
|
||||
## Discord mention with repository access
|
||||
|
||||
The trigger fires from Discord, so the GitHub token has to be requested by connection slug.
|
||||
|
||||
```yaml
|
||||
triggers:
|
||||
- name: discord
|
||||
on: discord.mention
|
||||
environment: dev
|
||||
filters:
|
||||
guild: "123456789012345678"
|
||||
from_users: ["345678901234567890"]
|
||||
agent:
|
||||
provider: codex
|
||||
mode: full-access
|
||||
env:
|
||||
GH_TOKEN: ${{ paseo.connections.acme-github.token }}
|
||||
allow_outputs:
|
||||
- type: discord.reply
|
||||
prompt: |
|
||||
${{ paseo.event.discord.trigger_message.body }}
|
||||
|
||||
Reply in the thread when you are done.
|
||||
```
|
||||
|
||||
## Slack mention that replies in-thread
|
||||
|
||||
```yaml
|
||||
triggers:
|
||||
- name: slack
|
||||
on: slack.mention
|
||||
environment: dev
|
||||
filters:
|
||||
workspace: T01234567
|
||||
channels: [C01234567]
|
||||
from_users: [U01234567]
|
||||
agent:
|
||||
provider: codex
|
||||
mode: full-access
|
||||
idle_timeout: 10m
|
||||
allow_outputs:
|
||||
- type: slack.reply
|
||||
prompt: ${{ paseo.event.slack.trigger_message.body }}
|
||||
```
|
||||
|
||||
## One trigger, several repositories
|
||||
|
||||
Omit `repo` and the trigger listens to every repository the GitHub connection can see. Pin the connection when the organization has more than one.
|
||||
|
||||
```yaml
|
||||
triggers:
|
||||
- name: any-repo
|
||||
on: github.issue_comment
|
||||
environment: dev
|
||||
filters:
|
||||
connection: acme-github
|
||||
contains: "@paseo"
|
||||
from_users: [alice]
|
||||
agent:
|
||||
provider: codex
|
||||
mode: full-access
|
||||
prompt: |
|
||||
${{ paseo.event.github.repository_full_name }}:
|
||||
${{ paseo.event.github.comment.body }}
|
||||
```
|
||||
|
||||
`cwd` is fixed per environment, so a trigger like this makes sense when the agent works from a token rather than a checkout.
|
||||
@@ -0,0 +1,150 @@
|
||||
---
|
||||
title: hub.yml reference
|
||||
description: Every field in a Paseo Hub configuration: environments, triggers, filters, outputs, and merge variables.
|
||||
nav: hub.yml reference
|
||||
order: 69
|
||||
category: Hub
|
||||
---
|
||||
|
||||
# `hub.yml` reference
|
||||
|
||||
The complete field reference for a Hub configuration. For where the file lives and how it activates, see [Configuration](/docs/hub/configuration).
|
||||
|
||||
```text
|
||||
environments: where agents run
|
||||
triggers: what starts them
|
||||
```
|
||||
|
||||
Both keys are required. `environments` needs at least one entry.
|
||||
|
||||
## Environments
|
||||
|
||||
An environment says where an agent runs.
|
||||
|
||||
```yaml
|
||||
environments:
|
||||
- name: dev
|
||||
kind: daemon
|
||||
daemon: my-macbook
|
||||
cwd: /Users/you/code/your-repo
|
||||
```
|
||||
|
||||
| Field | Required | Notes |
|
||||
| ---------- | -------- | ----------------------------------------------------------- |
|
||||
| `name` | yes | Referenced by a trigger's `environment`. |
|
||||
| `kind` | yes | `daemon`. Only daemon environments run today. |
|
||||
| `daemon` | yes | The daemon's display name, resolved to an id on activation. |
|
||||
| `cwd` | yes | Absolute path on that machine. |
|
||||
| `worktree` | no | Run in an isolated git worktree instead of `cwd` directly. |
|
||||
|
||||
### Worktrees
|
||||
|
||||
```yaml
|
||||
worktree:
|
||||
mode: branch-off
|
||||
newBranch: hub/issue-${{ paseo.event.github.issue.number }}
|
||||
base: main
|
||||
```
|
||||
|
||||
Three modes:
|
||||
|
||||
| Mode | Fields | Behavior |
|
||||
| ----------------- | ---------------------------- | ------------------------------------------ |
|
||||
| `branch-off` | `newBranch`, optional `base` | New branch off `base`, or the current head |
|
||||
| `checkout-branch` | `branch` | Existing branch |
|
||||
| `checkout-pr` | `prNumber` | The pull request's head |
|
||||
|
||||
`newBranch`, `base`, and `branch` accept merge variables. `prNumber` does not, because it is a literal number. For a per-event pull request use `checkout-branch` with `${{ paseo.event.github.pull_request.head.ref }}`.
|
||||
|
||||
See [Git worktrees](/docs/worktrees) for how the daemon sets them up.
|
||||
|
||||
## Triggers
|
||||
|
||||
```yaml
|
||||
triggers:
|
||||
- name: review
|
||||
on: github.pull_request_review_comment
|
||||
environment: dev
|
||||
filters:
|
||||
repo: acme/api
|
||||
contains: "@paseo"
|
||||
from_users: [alice, bob]
|
||||
agent:
|
||||
provider: codex
|
||||
mode: full-access
|
||||
prompt: ${{ paseo.event.github.comment.body }}
|
||||
timeout: 45m
|
||||
idle_timeout: 5m
|
||||
auto_archive: true
|
||||
```
|
||||
|
||||
| Field | Required | Default | Notes |
|
||||
| --------------- | -------- | ------- | --------------------------------------------------------- |
|
||||
| `name` | yes | | Unique within the configuration. |
|
||||
| `on` | yes | | `provider.event`, see below. |
|
||||
| `environment` | yes | | An environment `name`. |
|
||||
| `agent` | yes | | `provider`, `mode`, optional `model`, `thinkingOptionId`. |
|
||||
| `prompt` | yes | | Supports merge variables. |
|
||||
| `filters` | yes | | `from_users` is mandatory. See below. |
|
||||
| `env` | no | | Environment variables for the agent process. |
|
||||
| `allow_outputs` | no | none | Lets the agent reply to the source. |
|
||||
| `timeout` | no | `1h` | Absolute wall clock. Max `24h`. |
|
||||
| `idle_timeout` | no | `5m` | Starts on the first idle report from the daemon. |
|
||||
| `auto_archive` | no | `false` | Archive the agent when the execution ends. |
|
||||
|
||||
Durations are a positive integer plus `ms`, `s`, `m`, or `h`.
|
||||
|
||||
`agent.provider` and `agent.mode` are the same identifiers the Paseo CLI uses, such as `codex`, `claude`, and `full-access`. See [Supported providers](/docs/supported-providers).
|
||||
|
||||
## Events and filters
|
||||
|
||||
`on` and `filters` decide which events reach a trigger. Both are documented in [Triggers](/docs/hub/triggers), with a page per provider for the events and data each one exposes.
|
||||
|
||||
`filters` is required, and `from_users` must be non-empty. Validation rejects a trigger without it.
|
||||
|
||||
## Merge variables
|
||||
|
||||
`${{ ... }}` expressions are available in `prompt`, `env`, and worktree branch fields. Values reach the agent's process only through `env`; nothing else is injected.
|
||||
|
||||
### Event data
|
||||
|
||||
`${{ paseo.event.<provider>.<path> }}` exposes the provider's own payload, unflattened. The full field list per provider lives with its trigger page: [GitHub](/docs/hub/triggers/github), [Slack](/docs/hub/triggers/slack), [Discord](/docs/hub/triggers/discord).
|
||||
|
||||
Manual runs expose `actor`, `input`, `config`, `trigger`, and `delivery_id` under `paseo.event.manual`.
|
||||
|
||||
### Connection credentials
|
||||
|
||||
`${{ paseo.connections.<slug>.token }}` mints a token from a named connection. GitHub connections are the only ones that provide a token today.
|
||||
|
||||
Use it when a trigger needs a provider other than the one that fired it:
|
||||
|
||||
```yaml
|
||||
triggers:
|
||||
- name: discord-fix
|
||||
on: discord.mention
|
||||
environment: dev
|
||||
filters:
|
||||
guild: "123456789"
|
||||
from_users: ["987654321"]
|
||||
agent:
|
||||
provider: codex
|
||||
mode: full-access
|
||||
env:
|
||||
GH_TOKEN: ${{ paseo.connections.acme-github.token }}
|
||||
prompt: ${{ paseo.event.discord.trigger_message.body }}
|
||||
```
|
||||
|
||||
You must name the connection. An organization can hold several GitHub installations and Hub will not guess between them.
|
||||
|
||||
GitHub-triggered executions already receive a scoped `GH_TOKEN` for the triggering repository. You do not need to map one.
|
||||
|
||||
## Outputs
|
||||
|
||||
```yaml
|
||||
allow_outputs:
|
||||
- type: slack.reply
|
||||
```
|
||||
|
||||
`slack.reply` and `discord.reply` give the agent a `reply` tool for the conversation that triggered it. The reply is plain text, posted in-thread, and can be sent once per execution.
|
||||
|
||||
Every execution also gets `finish_execution`, whether or not `allow_outputs` is set.
|
||||
@@ -0,0 +1,59 @@
|
||||
---
|
||||
title: Hub configuration
|
||||
description: Where a project's configuration comes from, how GitHub sync works, and how revisions activate and roll back.
|
||||
nav: Configuration
|
||||
order: 68
|
||||
category: Hub
|
||||
---
|
||||
|
||||
# Hub configuration
|
||||
|
||||
A project is configured by one versioned document. The project's **Configuration** tab shows the active revision, its source, and the last synchronization attempt.
|
||||
|
||||
## Sources
|
||||
|
||||
A configuration comes from exactly one source:
|
||||
|
||||
- **GitHub source**: one repository, the file `.paseo/hub.yml`, on the repository's current default branch.
|
||||
- **Manual source**: edited in the dashboard and saved with **Save and activate**.
|
||||
|
||||
Pick a GitHub source by choosing a repository and clicking **Use for configuration**. That syncs immediately and enables automatic deployment.
|
||||
|
||||
The path and the branch are fixed. There is no setting for either.
|
||||
|
||||
## Sync
|
||||
|
||||
A push to the default branch of the configuration repository triggers a sync:
|
||||
|
||||
1. Hub fetches `.paseo/hub.yml` at that exact commit.
|
||||
2. It validates the document and resolves every repository, workspace, guild, and daemon it names.
|
||||
3. On success the revision becomes active.
|
||||
|
||||
**Sync now** does the same on demand.
|
||||
|
||||
Every attempt is recorded, including failures. The outcomes you will see:
|
||||
|
||||
| Outcome | What happened |
|
||||
| ----------------------- | ------------------------------------------------------------------------------- |
|
||||
| Activated | Valid document, everything resolved, now serving events. |
|
||||
| Invalid | The document failed validation or named something the organization can't reach. |
|
||||
| Fetch failed | The file is missing, or GitHub could not be read. |
|
||||
| Superseded push ignored | A newer commit already moved the branch head. |
|
||||
|
||||
A failed sync never replaces the active revision. A repository with a broken `hub.yml` keeps serving the last good one.
|
||||
|
||||
## Revisions
|
||||
|
||||
Revisions are immutable and numbered per project. Rolling back selects an earlier revision and recompiles its routes. The next valid push activates again, so rollback holds only until the next push.
|
||||
|
||||
## Switching source
|
||||
|
||||
Switching from GitHub to manual copies the active revision into the editor and stops syncing. Switching back means choosing a repository again.
|
||||
|
||||
While a project uses a GitHub source, the dashboard editor is read-only. The repository is the source of truth.
|
||||
|
||||
## The configuration repository does not have to be the repository you watch
|
||||
|
||||
`filters.repo` can name any repository the organization has a connection for. Keeping `hub.yml` in a private repository while triggers watch several public ones is a common setup, because push access to the configuration repository grants access to the organization's connections.
|
||||
|
||||
Next: the [`hub.yml` reference](/docs/hub/configuration/hub-yml).
|
||||
Reference in New Issue
Block a user