Liking cljdoc? Tell your friends :D

hive-addon.vessel

IVessel: the contract for a host environment that provides headed capabilities.

A vessel abstracts the headed environment (Emacs, tmux, VS Code, a web UI) behind a protocol, the way a window manager abstracts a screen. It supplies terminals, editors, delivery channels, REPLs, and it owns the mapping from an agent to the context that agent runs in.

It lives here, beside IAddon, for the reason IAddon does: a vessel ships as an addon, so it must compile against the contract alone. Defining it in a host would force every vessel to compile-depend on that host, which is what this leaf lib exists to prevent.

Vessels are a registry, not a singleton: several can be active at once (Emacs and tmux, Emacs and a web UI). The registry itself belongs to the host; only the contract is here.

IVessel and IAddon are implemented on SEPARATE objects. Both declare capabilities, initialize! and shutdown!, so one reify cannot carry both.

Reload-safety: defprotocol is not idempotent, so the declaration is guarded: re-evaluating this namespace will not orphan existing implementations.

IVessel: the contract for a host environment that provides headed
capabilities.

A vessel abstracts the headed environment (Emacs, tmux, VS Code, a web UI)
behind a protocol, the way a window manager abstracts a screen. It supplies
terminals, editors, delivery channels, REPLs, and it owns the mapping from
an agent to the context that agent runs in.

It lives here, beside IAddon, for the reason IAddon does: a vessel ships as
an addon, so it must compile against the contract alone. Defining it in a
host would force every vessel to compile-depend on that host, which is what
this leaf lib exists to prevent.

Vessels are a registry, not a singleton: several can be active at once
(Emacs and tmux, Emacs and a web UI). The registry itself belongs to the
host; only the contract is here.

IVessel and IAddon are implemented on SEPARATE objects. Both declare
`capabilities`, `initialize!` and `shutdown!`, so one reify cannot carry
both.

Reload-safety: `defprotocol` is not idempotent, so the declaration is
guarded: re-evaluating this namespace will not orphan existing
implementations.
raw docstring

IVesselclj/sprotocol

A host environment providing headed capabilities.

A host environment providing headed capabilities.

addonclj/s

(addon this capability)

The concrete implementation of CAPABILITY, or nil when this vessel does not provide it. :terminal -> hive-addon.terminal/ITerminalAddon :editor -> the host's editor contract :delivery -> the host's delivery-channel contract

The concrete implementation of CAPABILITY, or nil when this vessel does
not provide it.
:terminal -> hive-addon.terminal/ITerminalAddon
:editor   -> the host's editor contract
:delivery -> the host's delivery-channel contract

capabilitiesclj/s

(capabilities this)

The set of capabilities this vessel provides, drawn from #{:terminal :editor :grid :delivery :repl}.

The set of capabilities this vessel provides, drawn from
#{:terminal :editor :grid :delivery :repl}.

initialize!clj/s

(initialize! this config)

Initialize the vessel from CONFIG. Called during host startup.

Initialize the vessel from CONFIG. Called during host startup.

resolve-contextclj/s

(resolve-context this agent-id)

The context AGENT-ID runs in, as {:project-id :cwd :session-id}, or nil when this vessel does not know the agent. The vessel owns this mapping; a host must not fall back to ambient current-directory state.

The context AGENT-ID runs in, as {:project-id :cwd :session-id}, or nil
when this vessel does not know the agent. The vessel owns this mapping;
a host must not fall back to ambient current-directory state.

shutdown!clj/s

(shutdown! this)

Shut the vessel down and release its resources.

Shut the vessel down and release its resources.

vessel-idclj/s

(vessel-id this)

The keyword identifying this vessel, used as the registry's dispatch key. Examples: :emacs, :tmux, :web-ui, :vscode. Must be stable.

The keyword identifying this vessel, used as the registry's dispatch
key. Examples: :emacs, :tmux, :web-ui, :vscode. Must be stable.
sourceraw docstring

vessel-addon?clj/s

(vessel-addon? x)

True iff X satisfies both IAddon and IVessel. Rare: a vessel and its addon are normally separate objects, because the two protocols share method names.

True iff X satisfies both IAddon and IVessel. Rare: a vessel and its addon
are normally separate objects, because the two protocols share method
names.
sourceraw docstring

vessel?clj/s

(vessel? x)

True iff X satisfies IVessel.

True iff X satisfies IVessel.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close