ui: field help text + editable program commands

- Add a 'hint' to the shared Field/TextField; annotate the config forms with
  short, accurate descriptions of each field:
  - program: source (working copy castle builds from), behavior (tool/daemon/
    frontend), stack (optional toolchain template), repo/ref (for clone),
    system deps (listed for reference, NOT auto-installed), commands.
  - service: port (listened-on, health-checked, proxied; map via ${port}),
    health path, proxy path vs proxy host, runs.
  - job: schedule (cron → systemd timer), runs.
- ProgramFields: the Commands section is now editable (build/test/lint/
  type-check/run), so a program with no stack can declare its own dev verbs
  by hand — a declared command overrides the stack default. Verified the
  commands/build shape round-trips through the config API.

App builds clean.
This commit is contained in:
2026-06-15 08:50:03 -07:00
parent 32e2ac1f8e
commit ba60019a52
4 changed files with 165 additions and 36 deletions

View File

@@ -88,7 +88,10 @@ export function ServiceFields({ service, onSave, onDelete }: Props) {
return (
<div className="space-y-4">
<TextField label="Description" value={description} onChange={setDescription} />
<Field label="Runs">
<Field
label="Runs"
hint="The console script (python runner) or command this service executes."
>
<span className="text-sm font-mono text-[var(--muted)]">{runnerLabel(runner)} &middot; </span>
<input
value={runProgram}
@@ -96,10 +99,41 @@ export function ServiceFields({ service, onSave, onDelete }: Props) {
className="w-56 bg-black/30 border border-[var(--border)] rounded px-2 py-1 text-xs font-mono focus:outline-none focus:border-[var(--primary)]"
/>
</Field>
<TextField label="Port" value={port} onChange={setPort} width="w-32" mono placeholder="9001" />
<TextField label="Health path" value={health} onChange={setHealth} width="w-48" mono placeholder="/health" />
<TextField label="Proxy path" value={proxyPath} onChange={setProxyPath} width="w-48" mono placeholder="/my-service" />
<TextField label="Proxy host" value={proxyHost} onChange={setProxyHost} mono placeholder="my-service.lan" />
<TextField
label="Port"
value={port}
onChange={setPort}
width="w-32"
mono
placeholder="9001"
hint="The port the service listens on. Castle health-checks and proxies this port; map it to the program's own var with ${port} in Environment."
/>
<TextField
label="Health path"
value={health}
onChange={setHealth}
width="w-48"
mono
placeholder="/health"
hint="HTTP path castle polls to report up/down."
/>
<TextField
label="Proxy path"
value={proxyPath}
onChange={setProxyPath}
width="w-48"
mono
placeholder="/my-service"
hint="Gateway prefix — reachable at gateway:9000<path>/ (reverse-proxied to the port)."
/>
<TextField
label="Proxy host"
value={proxyHost}
onChange={setProxyHost}
mono
placeholder="my-service.lan"
hint="Optional: route a whole hostname to this service instead of a path (lets a root-based app serve unchanged)."
/>
{envEditor}
<FormFooter
saving={saving}