Dashboard › opencode › Distillation
c4a56c64-5e8e-43a3-95bd-32abe4a9cb2f["lore_tm_v1_ik1PsBV14Uevczb9O5yUoN7skoviI3I3sGfo-xyFLig"]
Date: Sep 8, 2026
/home/byk/.local/share/opencode/tool-output/tool_07fd0a72f001viMBROo1U1VLmB.PersistentPty.remove resolves the PTY, sends { op: "terminate", id: fromID(xh) }, treats non-"ok" responses as unexpected, removes the matching session-to-PTY mapping from Vf, and publishes Removed with { sessionID, ptyID }.PersistentPty.shutdown calls gp.shutdown, maps failures through unavailable, clears Vf, and treats any returned response whose type is not "ok" as unexpected; PersistentPty.handoff delegates to gp.handoff with the same unavailable-error mapping.Af; PersistentPty.NotFoundError is ignored, PersistentPty.UnavailableError logs "failed to remove visible exited terminal" with the PTY id and error message, and cleanup always removes the ID from Af.PersistentPty.attach first resolves the PTY, subscribes through gp.subscribe(fromID(xh), ...), triggers visible-terminal removal when an event has type === "exited", forwards every event to the caller’s onEvent, stores the terminal group-to-PTY mapping when the subscriber role is "controller", and returns { info, role, generation, replay, activate, detach }.list, get, create, write, resize, control, input, snapshot, read, remove, shutdown, handoff, and attach; configured() uses the default layer when its argument is undefined.runtimeDirectory() uses OPENCODE_PTY_RUNTIME_DIR first; otherwise it uses path.join(XDG_RUNTIME_DIR, "opencode-pty") when XDG_RUNTIME_DIR exists, or path.join(os.tmpdir(), \opencode-pty-${process.getuid() or process.env.USER or "unknown"}`); it then appends crypto.randomUUID()`.pty_persistent_${id}. fromID() rejects IDs without the "pty_persistent_" prefix and rejects parsed numeric IDs unless they are safe integers of at least 1, throwing invalid persistent PTY ID: ${Tn}.toInfo() maps lifecycle status "running" to "running" and every other lifecycle status to "exited"; it maps command element 0 to command, remaining elements to args, missing PID to 0, exited lifecycle exit_code to optional exitCode, group_id to sessionID, and also includes foregroundProcess, terminal { cols, rows }, and output { head: output_head, tail: output_tail }..at(-1); scoped disposal removes that registration and deletes the ID entirely when no registrations remain.rpc.unavailable with "RPC is unavailable: ${th}", rpc.method_not_found with "Unknown RPC method: ${th}.${rh}", rpc.invalid_input with "Invalid RPC input", rpc.invalid_output with "Invalid RPC output", and rpc.internal with "RPC call failed".Reflect.apply(ch, void 0, [uh, Hd]), encode declared errors, log handler defects as "rpc handler failed" with RPC ID, method, and defect, and validate the encoded output against the method’s output schema.rpc.${definition.id}.${eventName}; event definitions are ephemeral with durability: "ephemeral" and event data represented as Record(String, Unknown). Emitting an unknown event fails with Unknown RPC event: ${definition.id}.${eventName}.events.subscribe; subscriptions provide the location service and convert incoming events with logicalEvent, while an unknown event subscription fails with Unknown RPC event: ${definition.id}.${eventName}."no active terminal; use \new` or `use ID`", OPENCODE_PTY_RUNTIME_DIR, XDG_RUNTIME_DIR, opencode-pty, opencode-pty-service.json, "opencode-pty registration is unavailable", "invalid opencode-pty registration", service.lock, "another opencode-pty process already owns the service lock", "failed to spawn thread", "ownership lock poisoned", and "opencode-pty request failed: "`.