@aiaiai-pt/martha-cli 0.51.7 → 0.53.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +85 -1
  2. package/dist/index.js +1289 -34
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,7 +2,91 @@
2
2
 
3
3
  All notable changes to `@aiaiai-pt/martha-cli`. Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). This project adheres to semver — `0.x` releases may include breaking changes between minor versions.
4
4
 
5
- ## [Unreleased]
5
+ ## [0.53.1] — 2026-08-03
6
+
7
+ ### Fixed — `channels install-harness` told a Buzz-less machine to "launch Buzz once"
8
+
9
+ - The command registers Martha as a runtime *inside* Buzz Desktop, so with no
10
+ Desktop on the machine there is nothing to register with. It correctly
11
+ refused and wrote nothing, but the remedy assumed the app was installed and
12
+ merely unopened. It now probes for the application itself and says which of
13
+ the two situations it is: **not installed** (with the release link, and a
14
+ pointer to `martha channels connect buzz`, which needs no Desktop at all) or
15
+ **installed but never launched** (open it once). Both still name the exact
16
+ app-data paths so `--app-data` stays actionable.
17
+
18
+ ## [0.53.0] — 2026-08-02
19
+
20
+ ### Added — `martha channels`: connect an agent to a channel from either side (#1140)
21
+
22
+ - `martha channels install-harness buzz` registers Martha as a **runtime** in
23
+ Buzz Desktop — a tier-3 custom harness definition written into Desktop's
24
+ app-data dir (auto-detected per platform, release or dev build; `--print`,
25
+ `--app-data`, `--force`). The user then picks **Martha** in New agent and sets
26
+ `MARTHA_CLIENT_ID`/`MARTHA_CLIENT_SECRET` per agent in Edit Agent. Desktop
27
+ keeps ownership of the keypair, the NIP-OA attestation, spawning and channel
28
+ attachment; we contribute a definition and the adapter, nothing else. The
29
+ definition pins `BUZZ_ACP_MULTIPLE_EVENT_HANDLING=queue` — Desktop's `steer`
30
+ cancels the in-flight turn, which is right for a local LLM and wrong for a
31
+ remote Martha turn.
32
+ - `martha channels connect buzz` and `martha channels preflight buzz` — the
33
+ same setup starting from Martha. Preflight checks every precondition (both
34
+ binaries, that the `martha` on PATH actually has `acp-serve`, API + credential,
35
+ agent existence/hosting/takeover, its principal, relay reachability, the
36
+ channel identity, and membership) and names the one command that fixes each
37
+ gap. It **exits non-zero rather than half-starting**, and reports a check it
38
+ could not evaluate as WARN rather than claiming the thing is missing.
39
+ `--emit docker|compose|k8s` prints a deployable unit with secrets referenced
40
+ instead of inlined; `--dry-run` shows the launch without starting it.
41
+
42
+ ### Fixed — a service-account invocation could run as a logged-in human
43
+
44
+ - With `MARTHA_CLIENT_ID`/`MARTHA_CLIENT_SECRET` set, the CLI reused whatever
45
+ token was stored for the profile if it was still valid — including a human
46
+ token left by an earlier `martha auth login`. A long-running adapter then
47
+ answered as the developer instead of as its agent, and chat takeover never
48
+ fired. A stored token is now only reused when it belongs to the same client
49
+ (`auth_type` + the JWT's `azp`), which is what the documented auth precedence
50
+ always said. Found by running `martha channels connect` on a real relay.
51
+ - `agents doctor` reported a correctly-bound agent as unbound on any tenant with
52
+ more than 25 clients: the client scan was capped at 25 and swallowed per-client
53
+ errors. The scan now walks the whole list (bounded, with concurrency) and says
54
+ "inconclusive" when it cannot read all of it — an incomplete scan can never
55
+ justify "no client grants this agent", which was advice to mint a second
56
+ principal for an agent that already had one.
57
+ - A failed `client_credentials` login now raises an auth-typed error (exit 2)
58
+ instead of a generic one, so callers can tell "this credential is wrong" apart
59
+ from "the server is unreachable".
60
+
61
+ ### Added — `martha acp-serve`: ACP stdio bridge (#1117)
62
+
63
+ - New `acp-serve` command speaks the Agent Client Protocol (newline-delimited
64
+ JSON-RPC 2.0) over stdio so an ACP harness — Buzz's `buzz-acp`, Zed, or any
65
+ ACP client — can drive a Martha agent as its runtime. `session/new` opens a
66
+ Martha chat session, `session/prompt` sends the user message and re-emits
67
+ Martha's SSE tokens as `session/update` agent_message_chunk notifications,
68
+ `session/cancel` aborts the in-flight turn (`stopReason: "cancelled"`).
69
+ Mid-session Martha errors surface as ACP error results without killing the
70
+ process; unrecoverable startup errors (bad token, unreachable API) exit
71
+ non-zero with a clear stderr line for the harness's circuit breaker. All
72
+ logging is JSON lines on stderr — stdout carries only protocol frames.
73
+ - `--post-reply` (opt-in) posts the turn's final answer back to the triggering
74
+ Buzz channel via the `buzz` CLI — the same reply mechanism Buzz's own
75
+ agents use — parsing the channel and thread anchor from the prompt's
76
+ `[Context]` section. The shim itself never holds or signs with Nostr keys.
77
+ - `martha principals bootstrap` — the CLI now exposes the API's own principal
78
+ noun (`/principals/bootstrap`, #535) with three modes: `human` (what
79
+ `martha init` wraps), `integration` (headless service account), and `agent`
80
+ — a service account bound to ONE Martha-hosted agent via chat takeover, so
81
+ the credential acts as the agent. Agent mode is the one-shot an external
82
+ ACP driver needs: resolve-or-create the agent, provision the principal
83
+ (idempotent — same label returns the same secret), bind, and print the
84
+ `MARTHA_CLIENT_ID/SECRET` + harness env block. The same orchestration ships
85
+ as a "Provision principal" action in the admin UI agents page. (Agent mode
86
+ is composed client-side in v1; a follow-up promotes it server-side.)
87
+ - Fixed in review: `--api-url` now flows through `createContext` — mutating
88
+ `ctx.profile.api_url` after construction (the pattern elsewhere in the CLI)
89
+ never reaches the already-constructed API client.
6
90
 
7
91
  ## [0.51.5] — 2026-07-20
8
92