summaryrefslogtreecommitdiff
path: root/src/tape.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/tape.zig')
-rw-r--r--src/tape.zig19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/tape.zig b/src/tape.zig
index 3c8dd765..b16f39f9 100644
--- a/src/tape.zig
+++ b/src/tape.zig
@@ -107,6 +107,8 @@ pub const Site = enum(u16) {
/// command printed (a pty/run's answer): a screen-state replica's
/// emulator is the last delta's until the next.
prompt,
+ /// What the authority alone holds and a step reads (`authority`).
+ authority,
};
/// What the sites return. wire.semantics hashes their shape with the
@@ -125,6 +127,10 @@ pub const results = .{
anyerror![]u8, anyerror!void,
terminal.Told, ?pardes.ctlfs.pty.Printed,
@typeInfo(@TypeOf(terminal.greeting)).@"fn".return_type.?,
+ // What only the authority holds (`authority`): a closed pane's record,
+ // Recent's entry for a closed jump, the closed panes' names.
+ ?@import("Store.zig").Record, ?@import("recent.zig").Entry,
+ []const @import("Store.zig").Named,
};
/// What a host reports to the core as failed (`shell_failed`, `save_failed`,
@@ -813,6 +819,19 @@ pub fn value(comptime s: Site, comptime f: anytype, args: anytype) @typeInfo(@Ty
return call(s, null, f, args, false);
}
+/// A read of what the authority alone holds (`.authority` state a step
+/// makes digested state from: the store's closed panes and Recent, which
+/// every window of its user writes; the 9P server's readers and socket),
+/// taped as `value` is; a speculation that reaches it waits for the
+/// authority's answer, as at a host call. A replica's own is never read.
+/// What it returns is the tape's arena's on a replay: `f` returns what
+/// lives to the step's end (scratch, or the authority's own), and the
+/// caller copies what it keeps.
+pub fn authority(comptime f: anytype, args: anytype) @typeInfo(@TypeOf(f)).@"fn".return_type.? {
+ poison();
+ return value(.authority, f, args);
+}
+
fn call(comptime s: Site, a: ?std.mem.Allocator, comptime f: anytype, args: anytype, comptime yields: bool) @typeInfo(@TypeOf(f)).@"fn".return_type.? {
const R = @typeInfo(@TypeOf(f)).@"fn".return_type.?;
comptime {