Skip to main content

Module park_agents

Module park_agents 

Source

Functions§

agent_of_block 🔒
The agent a block belongs to: the instance bound to the block (a block launched from a template keeps the template’s id in agentId and binds its agent that way), else the agent agentId names.
delete_parked_blocks_of 🔒
Delete every parked block of the agent agent_id, stopping its process first: deleting the agent is the one thing that deletes its block. A block is the agent’s through agent_of_block, so deleting a template leaves the blocks of the agents launched from it. Returns how many went. A block that is shown in a tab is not touched, as before.
enabled 🔒
Whether closing parks an agent’s block (the agents:always_available setting).
extra_blocks 🔒
The closing blocks among block_ids that extras_to_close drops.
extras_to_close 🔒
Of the blocks being closed, the ones that are extra blocks of their agent and so are closed, not parked. batch is each closing parkable block with its agent; all every agent block in a tab or parked with its agent; runs says whether a block has the agent’s live process.
is_parkable 🔒
An agent’s pane block of an agent that still exists. A terminal, a browser or a drawer is not one, and neither is the block of a deleted agent: nothing would ever open it again.
keeps_block 🔒
Whether a block that is closing now is kept: parkable, with the setting on.
not_parked 🔒
block_ids without the parked ones: what the close still stops and deletes.
park_agent_blocks 🔒
Park the agent blocks among block_ids (each in the tab the reducer has it in) and return the ids parked. A park the reducer refuses leaves that block to the close, which deletes it as before. force parks with the setting off too: an explicit detach.
park_window_agents 🔒
A window that closes and is kept (a closed window of the workspace): park the agent blocks of its tabs (block_ids) so the close stops only what isn’t an agent. A parked block keeps its layout leaf: parking leaves the tab’s tree alone, and the tree prunes only blocks that are gone, so the window reopens with its agents where they were (reattach_window_agents). Returns the ids parked.
reattach_window_agents 🔒
A closed window reopening: the agent blocks it parked at its close (parked, from its closed-window record) go back into the tab they were parked from, where their layout leaf still is. A block that is not parked any more (its agent was opened elsewhere, or deleted) is not brought back, and its leaf is removed from the window’s layout so the window doesn’t show the agent twice. A block already back in one of its tabs (the reopen is tried again until the window shows) is left as it is. Returns how many came back.
record_running_as_desired 🔒
An agent that is running when its pane closes is wanted running, so a restart brings it back (restart_resume); a block from before desired states has no record of it.