Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T03:41:27.522Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

workroom_ui.rs

119 lines · 5.2 KB · rust
1//! Sarah workroom GPUI pane (`OMEGA-SW-03` / `OMEGA-SW-04` / `OMEGA-SW-06` /
2//! `SARAH-CW-08`).
3//!
4//! Dock panel + Agent menu entry + open / focus-composer / send / interrupt
5//! actions. Renders the five §7 projections with source, freshness, and gap
6//! labels. GPUI is projection-only: no durable thread, receipt, or turn store
7//! here. Framed requests go to supervised `omega-effectd` only.
8//!
9//! - **OMEGA-SW-04**: interaction states (pending send, tool ladder, answer
10//!   block, terminal reason, interrupt pending→applied). Transport is
11//!   SARAH-NR-06. Honest liveness is the ordered tool ladder — never fake
12//!   token streaming.
13//! - **OMEGA-SW-06**: local unread count + attention marker; proactive tick
14//!   turns render as ordinary transcript rows. Read state is local MVP only
15//!   (NIP-RS is SARAH-NR-07). Autonomous tick stays default off.
16//! - **SARAH-CW-08**: same pane hosts a second, isolated community room
17//!   (membership, work units, experience rank). Not a second dock pane,
18//!   composer, or receipt inspector. Two-room rule: never share membership
19//!   or history with owner-private Sarah.
20
21mod attention;
22mod community;
23mod full_auto;
24mod interaction;
25mod panel;
26mod projections;
27
28pub const PUBLIC_DEMO_ENV: &str = "OMEGA_PUBLIC_DEMO";
29
30pub fn public_demo_mode() -> bool {
31    std::env::var(PUBLIC_DEMO_ENV).as_deref() == Ok("1")
32}
33
34pub use attention::{
35    autonomous_tick_enabled, compute_room_attention, count_unread, empty_room_is_honest,
36    is_attention_role, proactive_turn_as_transcript_row, row_raises_attention,
37    tick_off_honest_note, AttentionMarker, LocalReadState, RoomAttention,
38    OMEGA_AUTONOMOUS_TICK_ENABLED, SARAH_AUTONOMOUS_TICK_FLAG,
39};
40pub use community::{
41    community_sources, copy_forbids_payment, label_implies_payment,
42    quote_as_untrusted_member_content, AgentRosterRow, CommunityRoomMeta, CommunityRoomProjection,
43    ContentTrust, ExperienceAwardRow, ExperienceRankProjection, MemberRosterRow,
44    MembershipProjection, RoomKind, WorkUnitAcceptance, WorkUnitQuoteRow, WorkUnitRow,
45    WorkUnitsProjection, WorkroomSurface, COMMUNITY_ROOM_HEADER, COMMUNITY_ROOM_SUBTITLE,
46    EXPERIENCE_LABEL, FORBIDDEN_EARNINGS_LABEL, MAX_MEMBER_ROWS, MAX_RECENT_AWARDS,
47    MAX_WORK_UNIT_ROWS, OWNER_PRIVATE_ROOM_HEADER, UNTRUSTED_CONTENT_BOUNDARY,
48    V1_NO_PAY_FIRST_RUN_COPY, V1_NO_PAY_ROOM_DESCRIPTION,
49};
50pub use full_auto::WorkroomFullAutoRun;
51pub use interaction::{
52    AnswerState, InteractionEvent, InteractionState, LocalPendingSend, TerminalOutcome,
53    ToolLadderEntry, ToolLadderKind,
54};
55pub use panel::{init, SarahWorkroomPanel};
56pub use projections::{
57    sources, ActivityProjection, ActivityRow, Freshness, GapState, InterruptIntentState,
58    MessageAck, ProjectionMeta, ReceiptRow, ReceiptsProjection, RoomProjection, RunPhase,
59    RunStateProjection, TranscriptProjection, TranscriptRow, WorkroomProjection,
60    MAX_ACTIVITY_ROWS, MAX_RECEIPT_ROWS, MAX_TRANSCRIPT_ROWS, PANE_HEADER,
61};
62
63#[cfg(test)]
64mod tests {
65    use super::*;
66
67    #[test]
68    fn workroom_surface_is_not_full_auto_or_agent_computer() {
69        let names = module_path!();
70        assert!(names.contains("workroom_ui"));
71        assert!(!names.contains("full_auto"));
72        assert!(!names.contains("agent_computer"));
73        assert_eq!(PANE_HEADER, "Sarah");
74        assert_eq!(WorkroomProjection::header(), "Sarah");
75    }
76
77    #[test]
78    fn five_projections_start_honest_not_empty_success() {
79        let p = WorkroomProjection::honest_unsubscribed();
80        assert!(p.room.is_honest_missing());
81        assert_eq!(p.transcript.meta.gap, GapState::Unavailable);
82        assert_eq!(p.activity.meta.gap, GapState::Unavailable);
83        assert_eq!(p.receipts.meta.gap, GapState::Unavailable);
84        assert_eq!(p.run_state.meta.gap, GapState::Unavailable);
85        assert_eq!(p.run_state.interrupt_intent, InterruptIntentState::None);
86    }
87
88    #[test]
89    fn public_demo_projection_is_explicitly_fictional_and_complete() {
90        let projection = WorkroomProjection::public_demo();
91        assert_eq!(
92            projection.room.detail.as_deref(),
93            Some("Fictional public demo data")
94        );
95        assert_eq!(projection.transcript.meta.gap, GapState::None);
96        assert_eq!(projection.activity.meta.gap, GapState::None);
97        assert_eq!(projection.run_state.phase, RunPhase::Finished);
98        assert!(
99            projection
100                .transcript
101                .rows
102                .iter()
103                .all(|row| row.ack == MessageAck::Confirmed)
104        );
105    }
106
107    #[test]
108    fn community_room_is_second_room_not_second_pane() {
109        let surface = WorkroomSurface::honest_unsubscribed();
110        assert_eq!(surface.active, RoomKind::OwnerPrivate);
111        assert_eq!(CommunityRoomProjection::header(), COMMUNITY_ROOM_HEADER);
112        assert_ne!(WorkroomProjection::header(), CommunityRoomProjection::header());
113        assert!(surface.rooms_are_isolated());
114        assert!(surface.community.is_v1_compliant());
115        // Single panel type — community is a room kind, not agent_computer / full_auto.
116        assert_eq!(module_path!().contains("workroom_ui"), true);
117    }
118}
119
Served at tenant.openagents/omega Member data and write actions are omitted.