⎇ fa8dfd6ed33f76d296e8428ca68a0d3d527c295b
crates/apps/nahual-shell/src/brahman_client.rs
Ñawpa willay
Pi imata llamkarqan
ch'uya
refactor(monorepo): reorganización lógica + renames + SDDs + split CHANGELOG
1//! Card de nahual-shell + spawn del sidecar brahman compartido.
2//!
3//! La lógica de thread + tokio + ping-loop vive en `brahman-sidecar`;
4//! aquí sólo declaramos la identidad de nahual como módulo Widget.
5
6use std::collections::BTreeSet;
7
8use brahman_card::{
9 Card, Flow, Flows, FsPolicy, IpcPolicy, Lifecycle, Payload, Permissions, Priority, Supervision,
10 TypeRef, CARD_SCHEMA_VERSION,
11};
12use ulid::Ulid;
13
14/// Spawn del sidecar con la Card de nahual.
15pub fn spawn() {
16 brahman_sidecar::spawn(build_card());
17}
18
19fn build_card() -> Card {
20 Card {
21 schema_version: CARD_SCHEMA_VERSION,
22 id: Ulid::new(),
23 lineage: None,
24 label: "brahman.ui_engine".into(),
25 provides: BTreeSet::new(),
26 requires: BTreeSet::new(),
27 payload: Payload::Virtual,
28 supervision: Supervision::Delegate,
29 lifecycle: Lifecycle::Widget,
30 priority: Priority::Normal,
31 permissions: Permissions {
32 filesystem: FsPolicy::ReadWrite,
33 ipc: IpcPolicy {
34 allow: vec!["wit-v1".into()],
35 },
36 ..Default::default()
37 },
38 flow: Flows {
39 input: vec![Flow {
40 name: "render-data".into(),
41 ty: TypeRef::Primitive {
42 name: "json".into(),
43 },
44 pin_to: None,
45 }],
46 output: vec![Flow {
47 name: "user-intent".into(),
48 ty: TypeRef::Primitive {
49 name: "json".into(),
50 },
51 pin_to: None,
52 }],
53 },
54 ..Default::default()
55 }
56}