H (hiness) Elixir API Reference

Copy Markdown View Source

hiness packages the :harness OTP application (H.*): the local coding-agent daemon with branched conversations, file-backed WAL commits, and behaviour contracts for extensions, tools, storage backends, and execution environments.

For binary installation (hi, h-daemon, H.app), interactive walkthroughs, and the full operator manual, visit hiness.dev and hiness.app.

Embed :harness in an Elixir/OTP application

Use Elixir 1.20 and Erlang/OTP 29. Add this dependency to mix.exs and run mix deps.get. The dependency key is the OTP application (:harness); hex: :hiness selects the package on Hex.

def deps do
  [
    {:harness, "~> 0.3.0", hex: :hiness}
  ]
end

To start an in-VM daemon with your application, configure a dedicated private store in config/runtime.exs:

import Config

config :harness, data_dir: "/path/to/private/store"

With this configuration, H.Application starts the daemon without TCP or Unix API listeners by default. Call H.Daemon in-VM to create sessions, submit commands, and read conversation or catalog streams. Give the instance its own :data_dir; H.StoreLock holds the store exclusively. Host tools execute with the OS user's file and shell permissions.

For a standalone listener, leave the embedded configuration unset and call H.serve/1 instead:

{:ok, info} = H.serve(data_dir: "/path/to/private/store", port: 4100)

Install the standalone CLI and web workbench

The Hex package contains the daemon and its Elixir API. To run hi and hiweb, follow the signed bundle installation guide.

Module map and canonical guides

This HexDocs site documents the Elixir modules, callbacks, and typespecs of :harness. Read the architectural guides and operating instructions on hiness.dev:

TopicElixir entry pointsGuide on hiness.dev
Daemon lifecycle & commandsH, H.Application, H.Daemon, H.CatalogManage the daemon · Local HTTP and SSE API
Session state & recoveryH.Session, H.Conversation, H.Entry, H.Task, H.SubmissionArchitecture and recovery · Sessions and branches
Extensions, harnesses & toolsH.Extension, H.Harness, H.Tool, H.Harness.CodingWrite a startup extension · Extension directory
Execution environments & leasesH.ExecutionEnv, H.ExecutionEnv.Host, H.WorkspaceLease, H.EnvRegistrySecurity boundaries · Subagents
Storage & providersH.Storage, H.Storage.File, H.Storage.Memory, H.Provider, H.AccountsConfigure providers · Configuration