summaryrefslogtreecommitdiff
path: root/abi
diff options
context:
space:
mode:
Diffstat (limited to 'abi')
-rw-r--r--abi/wire.zig23
1 files changed, 17 insertions, 6 deletions
diff --git a/abi/wire.zig b/abi/wire.zig
index 1f7d02d2..8713ba98 100644
--- a/abi/wire.zig
+++ b/abi/wire.zig
@@ -63,18 +63,19 @@ const family = switch (config.platform) {
pub const semantics: u64 = blk: {
@setEvalBranchQuota(1_000_000);
// The grammar set as the four words it was hashed as when it was four
- // options (highlighting, zig, minimal, full), so the hash stays.
+ // options (highlighting, zig, minimal, full), so the hash of a minimal
+ // or a full set stays: every set has highlighting, `none` no grammar.
const g = config.grammars;
// The two long ones (the dependencies, 2.5 KB, and the tape's shape,
// 11 KB) joined on, not formatted: formatting them at comptime was 5 %
// of a compile of the core.
break :blk std.hash.Wyhash.hash(0, std.fmt.comptimePrint(
- "wire {d}\npardes {s} {s}\n{s} grammars {} {} {} {} workspace_tag {} sources {}\nusize {d} {t}\n",
+ "wire {d}\npardes {s} {s}\n{s} grammars true {} {} {} workspace_tag {} sources {}\nusize {d} {t}\n",
.{
- version, build_info.version, build_info.commit orelse "unstamped",
- family, g != .disabled, g != .disabled,
- g == .minimal or g == .full, g == .full, config.workspace_tag,
- config.embed_sources, @sizeOf(usize), builtin.cpu.arch.endian(),
+ version, build_info.version, build_info.commit orelse "unstamped",
+ family, g != .none, g != .none,
+ g == .full, config.workspace_tag, config.embed_sources,
+ @sizeOf(usize), builtin.cpu.arch.endian(),
},
) ++ build_info.deps ++ "\n" ++ pardes.tape.shape);
};
@@ -191,6 +192,10 @@ pub const ServerTag = enum(u8) {
/// unit naming it: the hash, the whole's length and this piece's place
/// (u64le each), then at most 1 MiB of it (core/replica.zig).
blob = 0x0a,
+ /// The session's last word on a link: it ended, with its exit code.
+ ended = 0x0b,
+ /// ...or this client left it running (a Detach typed in it): its name.
+ left = 0x0c,
};
pub const ServerMsg = union(ServerTag) {
@@ -208,6 +213,8 @@ pub const ServerMsg = union(ServerTag) {
blobs: []const u8,
zstd: []const u8,
blob: []const u8,
+ ended: u8,
+ left: []const u8,
};
/// A message's header, for a payload sent on its own (a unit, a dump's
@@ -243,6 +250,8 @@ pub fn decodeServer(tag: u8, payload: []const u8) Error!ServerMsg {
.blobs => return .{ .blobs = payload },
.zstd => return .{ .zstd = payload },
.blob => return .{ .blob = payload },
+ .ended => .{ .ended = try r.takeByte() },
+ .left => .{ .left = try r.take(try r.takeInt(u16, .little)) },
};
try end(&r);
return msg;
@@ -267,6 +276,8 @@ pub fn encodeServer(out: []u8, msg: ServerMsg) Error![]const u8 {
.pong => |v| try w.writeInt(u64, v, .little),
.dump, .unit, .screen, .blobs, .zstd, .blob => |bytes| try w.writeAll(bytes),
.check => |v| try w.writeInt(u64, v, .little),
+ .ended => |code| try w.writeByte(code),
+ .left => |name| try putSlice16(&w, name),
}
try finishMessage(&w, at);
return w.buffered();