diff --git a/docs/reference/operations.md b/docs/reference/operations.md index f8a3aa7a0..abf152076 100644 --- a/docs/reference/operations.md +++ b/docs/reference/operations.md @@ -121,6 +121,7 @@ Generated from `@Operation`-annotated methods by the operation-catalog Doclet; d | `io.github.libtmux.Pane` | `split()` | MUTATION | Splits this pane in half, putting the new one below it. | | `io.github.libtmux.Pane` | `split(java.util.function.Consumer)` | MUTATION | Splits this pane as described. | | `io.github.libtmux.Pane` | `split(io.github.libtmux.SplitSpec)` | MUTATION | Splits this pane according to a spec, which may be reused across panes. | +| `io.github.libtmux.Pane` | `splitId(io.github.libtmux.SplitSpec)` | MUTATION | Splits this pane and returns the ID tmux printed before any subsequent lookup. | | `io.github.libtmux.Pane` | `pasteBuffer(java.lang.String)` | MUTATION | Pastes a named buffer into this pane, as though it had been typed. | | `io.github.libtmux.Pane` | `paste(java.lang.String)` | MUTATION | Pastes text into this pane as one block, leaving nothing behind on the server. | | `io.github.libtmux.Pane` | `paste(java.lang.String, java.lang.Runnable)` | MUTATION | As {@link #paste(String)}, after a caller rechecks state once its private buffer is ready. | @@ -134,6 +135,7 @@ Generated from `@Operation`-annotated methods by the operation-catalog Doclet; d | `io.github.libtmux.Server` | `newSession(java.lang.String)` | MUTATION | Creates a detached session and returns that exact session. | | `io.github.libtmux.Server` | `newSession(java.util.function.Consumer)` | MUTATION | Creates a session as described. | | `io.github.libtmux.Server` | `newSession(io.github.libtmux.SessionSpec)` | MUTATION | Creates a session according to a spec, which may be reused across servers. | +| `io.github.libtmux.Server` | `newSessionId(io.github.libtmux.SessionSpec)` | MUTATION | Starts a session and returns the ID tmux printed before any subsequent lookup. | | `io.github.libtmux.Server` | `hasSession(java.lang.String)` | READ | Whether a session with this name exists. | | `io.github.libtmux.Server` | `killSession(java.lang.String)` | MUTATION | Ends the session with this name, and everything in it. | | `io.github.libtmux.Server` | `isAlive()` | READ | Whether the server is running and answering. | @@ -218,6 +220,7 @@ Generated from `@Operation`-annotated methods by the operation-catalog Doclet; d | `io.github.libtmux.Session` | `newWindow(java.lang.String)` | MUTATION | Creates a window in this session and returns that exact window. | | `io.github.libtmux.Session` | `newWindow(java.util.function.Consumer)` | MUTATION | Creates a window in this session as described. | | `io.github.libtmux.Session` | `newWindow(io.github.libtmux.WindowSpec)` | MUTATION | Creates a window in this session according to a spec, which may be reused across sessions. | +| `io.github.libtmux.Session` | `newWindowId(io.github.libtmux.WindowSpec)` | MUTATION | Creates a window and returns the ID reported by tmux, without a follow-up lookup. | | `io.github.libtmux.Session` | `expand(java.lang.String)` | READ | Expands a tmux format in this session's context, and answers with what it came to. | | `io.github.libtmux.Session` | `rename(java.lang.String)` | MUTATION | Renames this session and returns its replacement capture. | | `io.github.libtmux.Session` | `kill()` | MUTATION | Ends this session. | @@ -245,6 +248,7 @@ Generated from `@Operation`-annotated methods by the operation-catalog Doclet; d | `io.github.libtmux.Window` | `split()` | MUTATION | Splits this window's active pane in half, putting the new one below it. | | `io.github.libtmux.Window` | `split(java.util.function.Consumer)` | MUTATION | Splits this window's active pane as described. | | `io.github.libtmux.Window` | `split(io.github.libtmux.SplitSpec)` | MUTATION | Splits this window's active pane according to a spec, which may be reused across windows. | +| `io.github.libtmux.Window` | `splitId(io.github.libtmux.SplitSpec)` | MUTATION | Splits this window's active pane and returns the ID from the creating command. | | `io.github.libtmux.Window` | `expand(java.lang.String)` | READ | Expands a tmux format in this window's context, and answers with what it came to. | | `io.github.libtmux.Window` | `rename(java.lang.String)` | MUTATION | Renames this window and returns its replacement capture. | | `io.github.libtmux.Window` | `linkTo(io.github.libtmux.Session)` | MUTATION | Links this window into another session, so one window sits in both. | diff --git a/integration-tests/src/test/java/io/github/libtmux/it/SplitIntegrationTest.java b/integration-tests/src/test/java/io/github/libtmux/it/SplitIntegrationTest.java index 1151f59fc..5a36251d6 100644 --- a/integration-tests/src/test/java/io/github/libtmux/it/SplitIntegrationTest.java +++ b/integration-tests/src/test/java/io/github/libtmux/it/SplitIntegrationTest.java @@ -8,9 +8,11 @@ import io.github.libtmux.Pane; import io.github.libtmux.PanePosition; import io.github.libtmux.Server; +import io.github.libtmux.SessionSpec; import io.github.libtmux.SplitSpec; import io.github.libtmux.TmuxVersion; import io.github.libtmux.Window; +import io.github.libtmux.WindowSpec; import io.github.libtmux.exception.TargetGoneException; import io.github.libtmux.exception.UnsupportedFeatureException; import io.github.libtmux.format.RowFormat; @@ -23,6 +25,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.List; +import java.util.concurrent.atomic.AtomicBoolean; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.api.io.TempDir; @@ -176,6 +179,70 @@ void oneSpecDescribesTheSplitOfTwoDifferentPanes(Server server) { assertTrue(fromSecond.edges().right()); } + @Test + void aFastWorkerCanReturnItsCreationIdWithoutReadingTheTargetAgain(Server server, @TempDir Path directory) + throws Exception { + Path receipts = directory.resolve("jobs"); + String[] work = {"/bin/sh", "-c", "printf '%s\\n' \"$TMUX_PANE\" >> \"$1\"", "job", receipts.toString()}; + var awaitingReturn = new AtomicBoolean(); + TmuxTransport delegate = new ProcessTransport(); + TmuxTransport transport = new TmuxTransport() { + @Override + public CommandResult execute(CommandRequest request) { + if (awaitingReturn.get()) { + throw new AssertionError("read after a successful tmux creation: " + request.commands()); + } + CommandResult result = delegate.execute(request); + if (request.commands().stream() + .flatMap(List::stream) + .anyMatch(word -> List.of("new-session", "new-window", "split-window").stream() + .anyMatch(word::contains))) { + awaitingReturn.set(true); + } + return result; + } + + @Override + public void close() { + delegate.close(); + } + }; + try (Server observed = Server.using(server.config(), transport)) { + var anchor = observed.sessions().getFirst(); + var window = anchor.windows().getFirst(); + var pane = window.panes().getFirst(); + var sessionId = + observed.newSessionId(SessionSpec.builder().running(work).build()); + assertTrue(awaitingReturn.getAndSet(false)); + var windowId = anchor.newWindowId(WindowSpec.builder().running(work).build()) + .orElseThrow(); + assertTrue(awaitingReturn.getAndSet(false)); + var spec = SplitSpec.builder().running(work).build(); + var viaPane = pane.splitId(spec); + assertTrue(awaitingReturn.getAndSet(false)); + var viaWindow = window.splitId(spec); + assertTrue(awaitingReturn.getAndSet(false)); + + assertNotEquals(anchor.id(), sessionId); + assertNotEquals(window.id(), windowId); + assertNotEquals(viaPane, viaWindow); + assertTrue(Await.until( + () -> Files.exists(receipts) && read(receipts).lines().count() >= 4)); + List recorded = Files.readAllLines(receipts); + assertEquals(4, recorded.size()); + assertTrue(recorded.containsAll(List.of(viaPane.value(), viaWindow.value()))); + } + } + + @Test + void reusingAWindowOnlyReturnsAnIdWhenTmuxReportsOne(Server server) { + var session = server.sessions().getFirst(); + var spec = WindowSpec.builder().named("reusable").reuseExisting().build(); + var id = session.newWindowId(spec).orElseThrow(); + assertTrue(session.newWindowId(spec).isEmpty()); + assertEquals(id, session.newWindow(spec).id()); + } + @Test void splittingAWindowAndSplittingItsActivePaneAgree(Server server) { Window window = onlyPane(server).window(); diff --git a/libtmux-kotlin/api/libtmux-kotlin.api b/libtmux-kotlin/api/libtmux-kotlin.api index 830b88d78..2fee1d7b9 100644 --- a/libtmux-kotlin/api/libtmux-kotlin.api +++ b/libtmux-kotlin/api/libtmux-kotlin.api @@ -303,6 +303,7 @@ public final class io/github/libtmux/kotlin/PaneOperationsKt { public static final fun sendLiteral (Lio/github/libtmux/kotlin/Pane;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun split (Lio/github/libtmux/kotlin/Pane;Lio/github/libtmux/SplitSpec;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun split (Lio/github/libtmux/kotlin/Pane;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun splitId (Lio/github/libtmux/kotlin/Pane;Lio/github/libtmux/SplitSpec;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun stopPiping (Lio/github/libtmux/kotlin/Pane;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun swapWith (Lio/github/libtmux/kotlin/Pane;Lio/github/libtmux/kotlin/Pane;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun variables (Lio/github/libtmux/kotlin/Pane;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -392,6 +393,7 @@ public final class io/github/libtmux/kotlin/ServerOperationsKt { public static final fun lock (Lio/github/libtmux/kotlin/Server;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun newSession (Lio/github/libtmux/kotlin/Server;Lio/github/libtmux/SessionSpec;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun newSession (Lio/github/libtmux/kotlin/Server;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun newSessionId (Lio/github/libtmux/kotlin/Server;Lio/github/libtmux/SessionSpec;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun pane (Lio/github/libtmux/kotlin/Server;Lio/github/libtmux/PaneId;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun paneFields (Lio/github/libtmux/kotlin/Server;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun panes (Lio/github/libtmux/kotlin/Server;Lio/github/libtmux/query/FilterExpr;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -451,6 +453,7 @@ public final class io/github/libtmux/kotlin/SessionOperationsKt { public static final fun lastWindow (Lio/github/libtmux/kotlin/Session;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun newWindow (Lio/github/libtmux/kotlin/Session;Lio/github/libtmux/WindowSpec;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun newWindow (Lio/github/libtmux/kotlin/Session;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun newWindowId (Lio/github/libtmux/kotlin/Session;Lio/github/libtmux/WindowSpec;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun nextWindow (Lio/github/libtmux/kotlin/Session;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun previousWindow (Lio/github/libtmux/kotlin/Session;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun refresh (Lio/github/libtmux/kotlin/Session;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; @@ -549,6 +552,7 @@ public final class io/github/libtmux/kotlin/WindowOperationsKt { public static final fun selectLayout (Lio/github/libtmux/kotlin/Window;Lio/github/libtmux/Layout;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun split (Lio/github/libtmux/kotlin/Window;Lio/github/libtmux/SplitSpec;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun split (Lio/github/libtmux/kotlin/Window;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static final fun splitId (Lio/github/libtmux/kotlin/Window;Lio/github/libtmux/SplitSpec;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun stopSynchronizingPanes (Lio/github/libtmux/kotlin/Window;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun synchronizePanes (Lio/github/libtmux/kotlin/Window;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun unlink (Lio/github/libtmux/kotlin/Window;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; diff --git a/libtmux/CHANGELOG.md b/libtmux/CHANGELOG.md index e72b9684a..d7d808564 100644 --- a/libtmux/CHANGELOG.md +++ b/libtmux/CHANGELOG.md @@ -16,6 +16,10 @@ changelog](../CHANGELOG.md). ### Added +- **`newSessionId`, `newWindowId` and `splitId` return the ID from tmux.** + Callers can record the creation even if the program exits before the next + listing. A window reused without a reported ID returns an empty optional. + (#221) - **`Server.captureServer()` exposes one captured tmux graph.** Sessions, window links, pane occurrences and clients share the same observations and remain local to traverse. (#20) diff --git a/libtmux/README.md b/libtmux/README.md index 1562c8a27..05d790aaa 100644 --- a/libtmux/README.md +++ b/libtmux/README.md @@ -264,6 +264,20 @@ try { } ``` +A fast child can finish before the library can read its new handle. For a job +with its own completion record, ask for the ID from the native creation: + +```java +// Given: Server server +var spec = SessionSpec.builder().running("true").build(); +SessionId job = server.newSessionId(spec); +job.value().startsWith("$"); // → true +``` + +The reported ID confirms that tmux accepted the creation. The job's own +record tells a coordinator whether its work completed. `newWindowId` returns +an empty optional when tmux reuses an existing window without reporting an ID. + ## Package map - **`io.github.libtmux`** — `Server`, `Session`, `Window`, `Pane`, `Client`, diff --git a/libtmux/src/main/java/io/github/libtmux/Pane.java b/libtmux/src/main/java/io/github/libtmux/Pane.java index b44ecb19f..8808b95b3 100644 --- a/libtmux/src/main/java/io/github/libtmux/Pane.java +++ b/libtmux/src/main/java/io/github/libtmux/Pane.java @@ -4,6 +4,7 @@ import io.github.libtmux.batch.Batch; import io.github.libtmux.catalog.Kind; import io.github.libtmux.catalog.Operation; +import io.github.libtmux.exception.CommandRejectedException; import io.github.libtmux.exception.DispatchException; import io.github.libtmux.exception.LibTmuxException; import io.github.libtmux.exception.MalformedResponseException; @@ -1019,22 +1020,36 @@ public Pane split(Consumer configure) { */ @Operation(Kind.MUTATION) public Pane split(SplitSpec spec) { - return created(server, snapshot, spec.argv(state.id().value(), CREATED.template(), server.version(snapshot))); + return created(server, snapshot, splitId(spec)); } /** - * Runs a command that reports one new pane, and hands back a handle on it. - * - *

The creating command names the pane it made, so the result is exact rather than whichever - * pane a fresh listing happens to put last — two splits racing would otherwise be - * indistinguishable. + * Splits this pane and returns the ID tmux printed before any subsequent lookup. + * + * @param spec the pane to create + * @return the reported pane ID, even if its program has already exited + * @throws CommandRejectedException if tmux refuses the creation + * @throws TargetGoneException if the server captured by this handle was replaced + * @throws MalformedResponseException if tmux creates a pane without reporting its ID + * @throws UnsupportedFeatureException if the spec needs a newer tmux + * @since 0.1.3 */ - static Pane created(Server server, ServerSnapshot previous, List argv) { - List reported = server.run(previous, argv).stdout(); + @Operation(Kind.MUTATION) + public PaneId splitId(SplitSpec spec) { + return splitId(server, snapshot, state.id().value(), spec); + } + + static PaneId splitId(Server server, ServerSnapshot snapshot, String target, SplitSpec spec) { + List argv = spec.argv(target, CREATED.template(), server.version(snapshot)); + List reported = server.run(snapshot, argv).stdout(); if (reported.isEmpty()) { throw new MalformedResponseException("tmux created a pane without reporting which"); } - PaneId id = new PaneId(CREATED.split(reported.get(0)).get(0)); + return new PaneId(CREATED.split(reported.getFirst()).getFirst()); + } + + /** Reads the exact pane ID named by the creating command, including when splits race. */ + static Pane created(Server server, ServerSnapshot previous, PaneId id) { ServerSnapshot fresh = server.refresh(previous); return fresh.panes().stream() .filter(pane -> pane.id().equals(id)) @@ -1043,11 +1058,6 @@ static Pane created(Server server, ServerSnapshot previous, List argv) { .orElseThrow(() -> new TargetGoneException("the pane just created is already gone")); } - /** The format a creating command reports its new pane through. */ - static String createdFormat() { - return CREATED.template(); - } - /** Pastes a named buffer into this pane, as though it had been typed. */ @Operation(Kind.MUTATION) public void pasteBuffer(String name) { diff --git a/libtmux/src/main/java/io/github/libtmux/Server.java b/libtmux/src/main/java/io/github/libtmux/Server.java index 8bcbaa0a3..0df08255b 100644 --- a/libtmux/src/main/java/io/github/libtmux/Server.java +++ b/libtmux/src/main/java/io/github/libtmux/Server.java @@ -264,16 +264,34 @@ public Session newSession(Consumer configure) { */ @Operation(Kind.MUTATION) public Session newSession(SessionSpec spec) { + SessionId created = newSessionId(spec); + ServerSnapshot fresh = snapshot(); + return fresh.session(created) + .map(session -> new Session(this, fresh, session)) + .orElseThrow(() -> new TargetGoneException("the session just created is already gone")); + } + + /** + * Starts a session and returns the ID tmux printed before any subsequent lookup. + * + *

A short-lived program can finish before a session handle can be read. The ID confirms + * tmux accepted the creation, even if the session has already gone. Use the program's own + * completion record to decide whether to retry its work. + * + * @param spec the session to create + * @return the ID reported by the creating command + * @throws CommandRejectedException if tmux refuses the creation + * @throws MalformedResponseException if tmux creates a session without reporting its ID + * @since 0.1.3 + */ + @Operation(Kind.MUTATION) + public SessionId newSessionId(SessionSpec spec) { CommandResult result = run(spec.argv("#{session_id}")); List reported = result.stdout(); if (reported.isEmpty()) { throw new MalformedResponseException(SessionCreation.failureMessage(config, result)); } - SessionId created = new SessionId(reported.get(0)); - ServerSnapshot fresh = snapshot(); - return fresh.session(created) - .map(session -> new Session(this, fresh, session)) - .orElseThrow(() -> new TargetGoneException("the session just created is already gone")); + return new SessionId(reported.get(0)); } /** diff --git a/libtmux/src/main/java/io/github/libtmux/Session.java b/libtmux/src/main/java/io/github/libtmux/Session.java index 24f25c3a8..4d06dc37b 100644 --- a/libtmux/src/main/java/io/github/libtmux/Session.java +++ b/libtmux/src/main/java/io/github/libtmux/Session.java @@ -3,7 +3,9 @@ import com.google.errorprone.annotations.CheckReturnValue; import io.github.libtmux.catalog.Kind; import io.github.libtmux.catalog.Operation; +import io.github.libtmux.exception.CommandRejectedException; import io.github.libtmux.exception.LibTmuxException; +import io.github.libtmux.exception.MalformedResponseException; import io.github.libtmux.exception.ServerUnavailableException; import io.github.libtmux.exception.TargetGoneException; import io.github.libtmux.format.RowFormat; @@ -258,8 +260,7 @@ public Window newWindow(Consumer configure) { */ @Operation(Kind.MUTATION) public Window newWindow(WindowSpec spec) { - List reported = server.run(snapshot, spec.argv(state.id().value(), CREATED.template())) - .stdout(); + Optional reported = createWindow(spec); ServerSnapshot fresh = server.refresh(snapshot); if (reported.isEmpty()) { // Only reuseExisting gets here: tmux selects the window it already had and reports @@ -271,16 +272,47 @@ public Window newWindow(WindowSpec spec) { .findFirst()) .orElseThrow(() -> new TargetGoneException("tmux reported no window and none carries that name")); } - List fields = CREATED.split(reported.get(0)); - WindowContext created = new WindowContext( - new SessionId(fields.get(0)), - new WindowIndex(Integer.parseInt(fields.get(2))), - new WindowId(fields.get(1))); + WindowContext created = reported.orElseThrow(); return fresh.window(created) .map(window -> new Window(server, fresh, window)) .orElseThrow(() -> new TargetGoneException("the window just created is already gone")); } + /** + * Creates a window and returns the ID reported by tmux, without a follow-up lookup. + * + *

The window's program may already have exited when this call returns. When + * {@link WindowSpec.Builder#reuseExisting()} selects an existing window, tmux prints no ID. + * + * @param spec the window to create or reuse + * @return the reported window ID, or empty when tmux reuses a window without naming it + * @throws CommandRejectedException if tmux refuses the creation + * @throws TargetGoneException if the server captured by this handle was replaced + * @throws MalformedResponseException if tmux creates a new window without reporting its ID + * @since 0.1.3 + */ + @Operation(Kind.MUTATION) + public Optional newWindowId(WindowSpec spec) { + Optional created = createWindow(spec); + if (created.isEmpty() && !spec.reuseExisting()) { + throw new MalformedResponseException("tmux created a window without reporting which"); + } + return created.map(WindowContext::window); + } + + private Optional createWindow(WindowSpec spec) { + List reported = server.run(snapshot, spec.argv(state.id().value(), CREATED.template())) + .stdout(); + if (reported.isEmpty()) { + return Optional.empty(); + } + List fields = CREATED.split(reported.get(0)); + return Optional.of(new WindowContext( + new SessionId(fields.get(0)), + new WindowIndex(Integer.parseInt(fields.get(2))), + new WindowId(fields.get(1)))); + } + /** * Expands a tmux format in this session's context, and answers with what it came to. * diff --git a/libtmux/src/main/java/io/github/libtmux/Window.java b/libtmux/src/main/java/io/github/libtmux/Window.java index 65609ba8c..49c530636 100644 --- a/libtmux/src/main/java/io/github/libtmux/Window.java +++ b/libtmux/src/main/java/io/github/libtmux/Window.java @@ -3,6 +3,7 @@ import com.google.errorprone.annotations.CheckReturnValue; import io.github.libtmux.catalog.Kind; import io.github.libtmux.catalog.Operation; +import io.github.libtmux.exception.CommandRejectedException; import io.github.libtmux.exception.LibTmuxException; import io.github.libtmux.exception.MalformedResponseException; import io.github.libtmux.exception.ServerUnavailableException; @@ -251,7 +252,23 @@ public Pane split(Consumer configure) { */ @Operation(Kind.MUTATION) public Pane split(SplitSpec spec) { - return Pane.created(server, snapshot, spec.argv(target(), Pane.createdFormat(), server.version(snapshot))); + return Pane.created(server, snapshot, splitId(spec)); + } + + /** + * Splits this window's active pane and returns the ID from the creating command. + * + * @param spec the pane to create + * @return the reported pane ID, even if its program has already exited + * @throws CommandRejectedException if tmux refuses the creation + * @throws TargetGoneException if the server captured by this handle was replaced + * @throws MalformedResponseException if tmux creates a pane without reporting its ID + * @throws UnsupportedFeatureException if the spec needs a newer tmux + * @since 0.1.3 + */ + @Operation(Kind.MUTATION) + public PaneId splitId(SplitSpec spec) { + return Pane.splitId(server, snapshot, target(), spec); } /**