hax @VERSION@ for Mac OS X 10.4 Tiger

hax @VERSION@, the terminal coding agent by Oleksandr Chekhovskyi, built for
Mac OS X 10.4 on every Mac that runs it: PowerPC (G3, G4 and G5) and Intel.
It is one universal program with its own libcurl 8.23.0, OpenSSL 3.5.9,
jansson 2.15.1 and zlib 1.3.2 inside, so it speaks TLS 1.3 to the services
of today, which Tiger itself cannot. It needs only the Root certificates
package, which has the list of authorities it trusts (see Certificates,
below). It puts in place:

  /usr/local/bin/hax
      hax @VERSION@
  /usr/local/share/hax/cert.pem
      a link to /usr/local/etc/ssl/cert.pem, the root
      certificates of the Root certificates package
  /usr/local/share/doc/hax-tiger
      this Read Me, hax's own README, the licenses,
      update-shell-profile.sh
  /usr/local/share/man
      hax's manual pages: man hax, and hax-config(5),
      hax-sessions(5) and hax-providers(7)

Using it

The installer adds /usr/local/bin to the PATH in your shell profile
(~/.bash_profile for bash, the shell Tiger gives new accounts, or the
.bash_login or .profile you already have) and keeps the old profile beside
it as .haxsave. Open a new Terminal window, go to the folder of your
project with cd, and type hax. hax reads and writes the files there and
runs commands in it, to do what you ask.

hax runs no model itself: it talks to one, on a service or on another
computer. Tell it which, in one of these ways:

- A service, with your key for it in the environment. Put a line such as
  export ANTHROPIC_API_KEY=sk-ant-... in your shell profile. hax also knows
  OPENAI_API_KEY, OPENROUTER_API_KEY, OPENCODE_API_KEY and
  DEEPSEEK_API_KEY.
- A ChatGPT subscription: type /login in hax. It shows a code; open
  auth.openai.com/codex/device in a browser on any computer or phone and
  type the code there.
- A model on another computer of your network, in Ollama or llama.cpp's
  llama-server. Put its address in ~/.config/hax/config.json, as below
  for Ollama. Ollama answers other computers only when it is started
  with OLLAMA_HOST=0.0.0.0.

  {"providers": {"ollama":
      {"base_url": "http://192.168.1.10:11434/v1"}}}

Then type /provider in hax to choose among the ones it found, and /model
for the model. /help lists the rest. hax -p "a question" answers once and
quits, and hax -c goes on with the last session in this folder.

What this build adds

This is tiger.v2core.com's own branch of hax, made from hax @VERSION@. It
adds four things to it.

Steering while hax works. The prompt stays on the screen while hax works,
below the status line. Type there at any time and press
Return: the line waits above the prompt, and the model reads it after the
step it is on, with the results of the commands that were running. If hax
finishes first, the line starts the next turn. A line that is a command,
such as /model, waits until hax has finished. Text you did not send stays
in the prompt.

Esc still pauses hax after the current step, and Esc twice stops it at
once. The lines that wait then come back to the prompt, not sent.
Control-C clears what you typed; twice on an empty prompt, it stops hax
and quits.

Suggested prompts. When hax has finished a turn, the empty prompt may
show, in grey, what you could send next: "run the tests", or an answer to
a question hax ended on. Press Tab to make it your text, then change it
or press Return to send it. Return alone does not send it, and when you
type, it goes out of the way. hax gets the suggestion from the same
model with a second, small request, made while you read the answer: it
holds only your last few prompts and the answers to them. To have no
such requests, type /config suggest off.

Context use on the status line. While hax works, the status line ends
with how much of the model's context the conversation fills, such as
45.2k / 200k (22%), or context 45.2k when hax does not know the model's
limit. It changes before each request to the model, and shows in the
warning colour from 80%.

Subagents. Ask hax to use subagents ("use two subagents, one for the
tests and one for the documents") and it starts a second hax for each
task, with a fresh context. They work at the same time, and each gives
back only its answer. While they work, a line for each shows what it is
doing. What they spend counts in the conversation's total. Esc pauses
them with hax, and Esc twice stops them. To let the model start
subagents when it finds them useful, without being asked, type /config
delegation auto.

A subagent can also work in the background ("start a subagent in the
background for the long tests, and go on"). hax then goes on at once,
and when the subagent ends, its report comes by itself: hax shows it and
the model answers, also when hax was waiting at the prompt. What you were
typing stays. /agents lists the subagents in the background, and /agents
kill a1 stops one.

The window's title. hax names the window or the TigerTTY tab it runs in
after what the conversation is about, and puts a mark before the words
for what it is doing: a filled dot while it works, a hollow one when it
waits for you, a half-filled one while subagents work in the background,
a square when it has stopped (Esc, or its turn limit), and a cross after
an error. The words are "hax" until you send a prompt, then your first
prompt, until the same model sums it up in a few words with a second,
small request. Tiger's Terminal shows only Western European letters in a
title, so there the marks are simpler ones and other letters, such as
Chinese, are left out. When hax quits, the window has its own title
back. To have no such title, type /config title off.

man hax says more, under "Suggested prompts", "Steering while hax works",
"Subagents", "Terminal title" and "Context, compaction, and usage".

The bash hax runs

hax runs its commands in the first bash on your PATH. Tiger's own
/bin/bash is version 2.05b, from 2002, and models write for bash 3 and
later: some of their commands fail there. bash 5.3 for Tiger, from
tiger.v2core.com, goes in /usr/local/bin, and hax then uses it.

The compiler hax uses

When a model builds a program, it types gcc, make or c++. Tiger's own
compiler is Apple's GCC 4.0.1 of 2005, which knows no C11 and no C++11.
With the GCC 13 package from tiger.v2core.com installed, hax puts its
folder, /opt/gcc13/bin, first on the PATH of the commands it runs: gcc,
c++, make, cmake and the rest are then GCC 13's. Your own Terminal keeps
its PATH. To have a command in hax use Apple's compiler, name it as
/usr/bin/gcc.

Terminals

hax draws in UTF-8 and in colour. In Tiger's Terminal, keep the window's
Character Set Encoding at Unicode (UTF-8), the default (Terminal >
Window Settings > Display). TigerTTY works as it is.

Certificates

hax checks the certificate of each service it talks to against the roots
in /usr/local/etc/ssl/cert.pem, not against Tiger's keychain, whose roots
are from 2009. That file is Mozilla's list of the authorities to trust,
and the Root certificates package puts it there. Install that package
before hax: the Installer stops if it is not there. Tiger Packages
installs it with hax, and offers each new list as an update. hax reads
the file through the link /usr/local/share/hax/cert.pem. The environment
variable CURL_CA_BUNDLE gives other roots.

Uninstalling

In Terminal:

  sudo rm /usr/local/bin/hax
  sudo rm -rf /usr/local/share/hax
  sudo rm -rf /usr/local/share/doc/hax-tiger
  sudo rm /usr/local/share/man/man1/hax.1 /usr/local/share/man/man5/hax-*.5
  sudo rm /usr/local/share/man/man7/hax-providers.7
  sudo rm -rf "/Library/Receipts/hax "*.pkg

The root certificates stay: other programs use them too.

Your settings, sessions and the list of models are in ~/.config/hax,
~/.local/state/hax and ~/.cache/hax. If nothing else you use is in
/usr/local/bin, take the "Setting PATH for hax" lines out of your shell
profile.

How it was made

hax was cross-compiled on Linux with GCC 13.4 for powerpc-apple-darwin8 (any
G3 and up) and i686-apple-darwin8, against the Mac OS X 10.4u SDK. Its
source is hax @VERSION@'s with this build's additions (above); hax
--version says @PKGVERSION@. A small layer goes
in front of it and gives it what
Tiger lacks or does differently: poll() on a terminal, waitid(), openat()
and the other *at() calls, clock_gettime(), getline(), open_memstream() and
futimens(), each made of calls that Tiger has. hax loads only Tiger's
libSystem, CoreFoundation, CoreServices and SystemConfiguration. The
package and this disk image were made on Mac OS X 10.4.11 with its own
mkbom, pax and hdiutil.

Everything it was built from (this build's hax source, curl's, OpenSSL's,
jansson's and zlib's source, the compatibility layer and the build
scripts) is in
hax-@PKGVERSION@-tiger-source.tar.gz, beside this disk image.

Built @DATE@.
