feat(studio): Welcome page Phase B — embedded doc reader (v0.38.0)

Second slice of the Welcome surface. Operator-facing
documentation now lives inside Studio as bundled assets and
renders inline via a modal sheet — no browser, no external
link, air-gap-tauglich.

- Four operator-readable explainers under `assets/docs/`,
  each with an EN + DE pair:
    architecture[_de].md  — Hub / Module / Flow + how they fit
    security[_de].md       — sandbox model, declared perms,
                              operator ceiling
    audit[_de].md          — hash-chained log, WORM-1 mechanics,
                              `fai admin verify-events`
    flows[_de].md          — flow YAML, templating reference,
                              extract→summarize example
  These are short (≈ 300-500 words each), operator-shaped
  prose. Not copies of the architecture docs in
  fai_platform/docs/architecture/ — those are
  contributor-dense.

- pubspec.yaml declares `assets/docs/` so the markdown ships
  inside the Studio binary. Air-gap deployments read them
  with no network access.

- New `_DocReaderSheet` modal: 85 %-of-viewport bottom sheet,
  drag handle + title bar with the doc icon and close button,
  scrollable Markdown body styled to match Studio chrome.
  Loads `assets/docs/<slug>_<locale>.md` first, falls back to
  the EN file. Locale comes from
  `Localizations.localeOf(context)`.

- `_DocsRow` on the Welcome page sits below the trust-posture
  deck. Two-column grid on ≥ 640 dp, single column below.
  Each card is icon + title + one-line blurb + chevron;
  click opens the reader sheet for that slug.

- 12 new ARB keys for the docs section (header, blurb, four
  card titles + blurbs, close button, error message).
- 4 new icons reused: `account_tree_outlined` (architecture),
  `shield_outlined` (security), `verified_outlined` (audit),
  `alt_route_outlined` (flows).

Implements Phase B of `docs/landing-page-design.md`. Phase C
(live getting-started checklist with persistent state) is the
last remaining slice.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-05-09 00:24:31 +02:00
parent 3a7d0e74ad
commit 3b07d340d5
16 changed files with 1051 additions and 3 deletions

92
assets/docs/flows_de.md Normal file
View file

@ -0,0 +1,92 @@
# Flow-Komposition
Ein Flow ist eine YAML-Datei mit drei Top-Level-Schlüsseln:
`inputs:`, `steps:`, `outputs:`. Von oben nach unten gelesen,
sagt sie dem Hub, welche Eingaben er akzeptiert, welche Module
in welcher Reihenfolge aufgerufen werden und was am Ende als
Ergebnis nach außen geht.
## Kleinster möglicher Flow
```yaml
name: hello
description: Gibt einen Namen als Begrüßung zurück.
inputs:
name:
type: text
steps:
- id: greet
module: debug.echo
inputs:
payload: "Hallo, {{ inputs.name }}"
outputs:
greeting: "{{ steps.greet.outputs.payload }}"
```
`fai run flows/hello.yaml --input name=Welt` ergibt:
```json
{ "greeting": "Hallo, Welt" }
```
## Realbeispiel: extract → summarize
Der mitgelieferte Flow `flows/extract-summarize.yaml`
verkettet zwei Module:
```yaml
steps:
- id: extract
module: text.extract
inputs:
document: "{{ inputs.file }}"
- id: summarize
module: text.summarize
inputs:
text: "{{ steps.extract.outputs.text }}"
style: "drei Stichpunkte"
```
Das Template `{{ steps.extract.outputs.text }}` reicht die
Ausgabe eines Schritts an den nächsten weiter. Die Flow-Engine
konvertiert JSON / FileRef / Text passend zum Ziel-Modul-
Manifest, ohne explizite Wandlungs-Schritte.
## Templating-Referenz (kurz)
| Ausdruck | Löst sich auf zu |
|------------------------------------|------------------------------|
| `{{ inputs.X }}` | Eingabe namens X |
| `{{ steps.Y.outputs.Z }}` | Ausgabe Z von Schritt Y |
| `{{ env.OPENAI_API_KEY }}` | Env-Var (deklariert nötig) |
| `{{ now }}` | ISO-8601-UTC-Zeitstempel |
| `{{ flow.execution_id }}` | Lauf-ID (Audit-Log-Schlüssel)|
## Audit-Posture
Jeder Schritt emittiert vier Events:
- `step.started` — Modul-Name, Version, Manifest-Hash
- `step.completed` — Dauer, Output-Größe, gewhitelistete Felder
automatisch elevated (`model_digest`, `engine`, …)
- `step.failed` — Fehler-Name + Nachricht
- `flow.completed` — Summe der Schritt-Dauern, Events gesamt
Alle hash-verkettet im gleichen Audit-Log. Siehe Audit-Log-
Erklärung für die Ketten-Mechanik.
## Was du in dieser App siehst
- **Flows-Seite**: Liste der gespeicherten Flows unter
`~/.fai/data/flows/`. `Starten` klicken, geforderte Eingaben
ausfüllen, Ergebnis verfolgen.
- **Protokoll-Seite**: Schritt-Events erscheinen Sekunden
nach Flow-Ende. `Flow`-Filter zeigt nur Flow-Level-Zeilen.
- **Store**: Jedes installierte Modul taucht als verfügbares
`module:` in der Flow-YAML auf. Synthetische föderierte
Einträge (`mcp.<server>.<tool>`, `n8n.<endpoint>.<workflow>`)
funktionieren genauso.