@tridha643/hestia 1.0.1 → 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/dist/cli.js +1247 -135
- package/dist/cli.js.map +19 -17
- package/dist/daemon.js +889 -108
- package/dist/daemon.js.map +16 -14
- package/package.json +1 -1
- package/skills/hestia/SKILL.md +61 -0
package/package.json
CHANGED
package/skills/hestia/SKILL.md
CHANGED
|
@@ -130,6 +130,62 @@ Hestia owns the process; surface whatever error code comes back (most often
|
|
|
130
130
|
`dns-route-required` on a first-time branch/worktree) instead of working
|
|
131
131
|
around it by hand.
|
|
132
132
|
|
|
133
|
+
## Shared hostnames (externally-pinned URLs)
|
|
134
|
+
|
|
135
|
+
Decide the routing mode by who controls the external side:
|
|
136
|
+
|
|
137
|
+
- **Independent ingestion** (you open the URL; the external app accepts many
|
|
138
|
+
callback URLs): keep per-branch `expose` — full isolation, no arbitration.
|
|
139
|
+
- **Dependent ingestion** (the external side is pinned to ONE URL: a Slack
|
|
140
|
+
app's request URL, a third-party webhook consumer, a strict OAuth
|
|
141
|
+
allowlist): use a SHARED hostname. One stable URL, machine-owned, held by
|
|
142
|
+
exactly one worktree at a time; hestiad routes each request to the holder.
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
hestia expose slack --shared tri-slack --tunnel tri --json # declare + claim
|
|
146
|
+
# The URL defaults to <name>.<zone>. Point ANY FQDN you control (any zone):
|
|
147
|
+
hestia expose slack --shared slk --hostname slack.acme.com --tunnel tri --json
|
|
148
|
+
# Several handles can share ONE hostname, split by URL path prefix (longest wins):
|
|
149
|
+
hestia expose slack --shared slk --hostname acme.com --path /webhooks/slack --tunnel tri --json
|
|
150
|
+
hestia expose stripe --shared str --hostname acme.com --path /webhooks/stripe --tunnel tri --json
|
|
151
|
+
hestia claim tri-slack --wait --json # queue durably; returns when granted
|
|
152
|
+
hestia claim tri-slack --cancel --json # leave the queue
|
|
153
|
+
hestia release tri-slack --json # hand to the next in queue
|
|
154
|
+
hestia share list --json # who holds / who waits (with full URL)
|
|
155
|
+
hestia share requests --json # pending consent requests for you
|
|
156
|
+
hestia share allow tri-slack --json # holder consents — handover now
|
|
157
|
+
hestia share deny tri-slack --json # holder declines — requester stays queued
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
The hostname is arbitrary (any subdomain on any zone you control; apex domains
|
|
161
|
+
need pre-existing DNS). `--path` routes by longest prefix at segment boundaries
|
|
162
|
+
(`/slack` matches `/slack/events`, never `/slackbot`); a request no path covers
|
|
163
|
+
is 404, a declared-but-unclaimed path is 503. cloudflared sees one rule per
|
|
164
|
+
hostname — all path splitting happens in hestiad, so adding a path to an
|
|
165
|
+
existing hostname needs no connector restart.
|
|
166
|
+
|
|
167
|
+
In the Fleet TUI (`hestia tui`), press **`s`** to open the shared-hostnames
|
|
168
|
+
panel: it lists every declared name with its holder and durable FIFO queue
|
|
169
|
+
(denied waiters marked). `j/k` select; **`c`** claims the selected name as the
|
|
170
|
+
currently-selected stack; **`a`/`x`** allow/deny the head as the holder;
|
|
171
|
+
**`r`** releases. It reads the same daemon state as `hestia share list`.
|
|
172
|
+
|
|
173
|
+
Protocol invariants agents must respect:
|
|
174
|
+
|
|
175
|
+
- Claims are **consent-based**: a held name is never stolen. `claim --wait`
|
|
176
|
+
queues; the holder decides with `share allow`/`share deny`, and `release`/
|
|
177
|
+
`down`/a crashed stack grants the queue head automatically.
|
|
178
|
+
- The queue is **durable** (survives daemon restarts and CLI timeouts). Your
|
|
179
|
+
blocked `claim --wait` returning success IS the grant notification; if it
|
|
180
|
+
timed out, your position is kept — re-run `claim --wait` to re-attach.
|
|
181
|
+
- While holding a shared name, check `hestia share requests` at natural
|
|
182
|
+
breakpoints and answer allow/deny — another agent may be blocked on you.
|
|
183
|
+
- Holder switches are hestiad route-table updates: zero connector restarts,
|
|
184
|
+
zero DNS writes. Declaring a NEW shared hostname restarts the connector
|
|
185
|
+
once (~2-5 s public blip) and requires the same wildcard DNS as named mode.
|
|
186
|
+
- `down`/`stop` of the serving workload auto-releases; re-`up` does NOT
|
|
187
|
+
auto-reclaim — claiming is always an explicit `hestia claim`.
|
|
188
|
+
|
|
133
189
|
## Post-up health sweep
|
|
134
190
|
|
|
135
191
|
After every `hestia up` (and again after `expose`), run `hestia doctor --json`
|
|
@@ -204,6 +260,11 @@ workloads can. Named volumes are retained unless `--destroy` is explicit.
|
|
|
204
260
|
| `tunnel-busy` | stop the foreign connector; do not kill processes Hestia did not start — identify via `ps aux \| grep cloudflared` + `cloudflared tunnel list`, then confirm with the human before killing anything (see "Post-up health sweep") |
|
|
205
261
|
| `route-origin-unavailable` | restart the workload through Hestia |
|
|
206
262
|
| `backend-not-stoppable` | use `hestia down` for Docker workloads |
|
|
263
|
+
| `shared-not-found` | `hestia share list` for declared names; `expose <svc> --shared <name>` declares one |
|
|
264
|
+
| `shared-held` | queued durably — `hestia claim <name> --wait` to block on the grant; ask the holder to `share allow` |
|
|
265
|
+
| `shared-not-holder` | only the holding worktree may allow/deny/release; check `hestia share list` |
|
|
266
|
+
| `shared-conflict` | the name or hostname is already declared differently; pick another name or release+remove the old one |
|
|
267
|
+
| `shared-requires-named-tunnel` | pass `--tunnel <name>` — shared hostnames need stable DNS, quick tunnels rotate |
|
|
207
268
|
|
|
208
269
|
`--json` failures are `{ "error": { "code", "message", "details"? } }`.
|
|
209
270
|
`hestia logs --json` is NDJSON, one `LogLine` per line.
|