This library is in flux. APIs may change without notice. Generated from source on 3/14/2026.
Bridge
Resource Bridge Standard Library
bridge.kz
Resource Bridge Standard Library
Persistent handle storage for long-running interactive sessions (Hollywood OS mode)
DESIGN:
- Bridge holds a HandlePool with persistent allocation
- Multiple interpreter runs share the same bridge
- Per-handle locking for concurrent access
- No return values from runs - side effects accumulate on bridge
- Session end triggers discharge_all
// ============================================================================
// CREATE - Create a new bridge session
// ============================================================================
~pub event create {
id: []const u8
}
| session { bridge: *Bridge[session!] }// ============================================================================
// GET_HANDLES - Query handles currently on the bridge
// ============================================================================
~pub event get_handles {
br: *Bridge
}
| handles { count: u32 }// ============================================================================
// CLOSE - End a bridge session, discharge all handles
// ============================================================================
~pub event close {
br: *Bridge[!session]
}
| closed { discharged: u32 }// ============================================================================
// TEST_RUN - Test helper: create bridge, run source, report handle count
// ============================================================================
~pub event test_run {
source: []const u8,
scope: []const u8,
budget: u64
}
| pass { handles: u32 }
| fail { reason: []const u8 }