@agentdocumentformat/cli 0.7.2 → 0.7.3

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.
package/README.md CHANGED
@@ -1,44 +1,67 @@
1
1
  # @agentdocumentformat/cli
2
2
 
3
- The ADF CLI: the ADF (Agent Document Format) daemon, command line and terminal app. An ADF agent is a single `.adf` file: config, memory, files and history in one document. This package runs your agents headless from a terminal, with no desktop app. For the desktop app (ADF Studio), see the [releases](https://github.com/christianbalevski/adf/releases).
3
+ The **ADF CLI**: run ADF (Agent Document Format) agents from a terminal, with
4
+ no desktop app. An ADF agent is a single `.adf` file: config, memory, files
5
+ and history in one portable document. For the desktop app, ADF Studio, see
6
+ the [releases](https://github.com/christianbalevski/adf/releases).
7
+
8
+ - `adf`: the **terminal app**. Your fleet of agents in one screen: chat with
9
+ any agent or any of its loops, approve tool calls, edit files, schedule
10
+ inner loops (side loops), watch live events.
11
+ - `adf <command>`: one-shot commands for scripts (`adf help`).
12
+ - `adf daemon`: the background daemon that runs the agents. `adf` starts it
13
+ for you; it keeps running after you quit.
4
14
 
5
15
  ## Install
6
16
 
7
- Requires Node.js 22 or newer.
17
+ Requires Node.js 22 or newer. Native modules (SQLite, OS keychain) come
18
+ prebuilt for Windows, macOS (arm64, x64) and Linux (x64, arm64, glibc).
8
19
 
9
20
  ```bash
10
21
  npm i -g @agentdocumentformat/cli
11
22
  adf
12
23
  ```
13
24
 
14
- Native modules (SQLite, OS keychain) install from prebuilt binaries; no compiler is needed on Windows, macOS (arm64/x64) or Linux (x64/arm64, glibc).
25
+ `EEXIST` on install? Remove the old package first:
26
+ `npm uninstall -g agent-document-format`.
15
27
 
16
- ## Use
28
+ Upgrade: `npm i -g @agentdocumentformat/cli@latest`, then
29
+ `adf daemon restart`.
17
30
 
18
- ```bash
19
- adf # the terminal app; starts the daemon in the background if needed
20
- adf agents # one-shot CLI commands; `adf help` lists them
21
- adf daemon status # the background daemon: status | stop | restart | logs -f
22
- adf daemon # or run the daemon in the foreground (http://127.0.0.1:7385)
23
- adf --version
24
- ```
31
+ ## Quickstart
25
32
 
26
- The daemon keeps running after you quit the terminal app (`adf daemon stop` stops it gracefully). It is only started automatically for a daemon URL on this machine, never next to a running ADF Studio, and not with `--no-daemon` / `ADF_NO_AUTOSTART=1`. `adf --url http://127.0.0.1:7400` (or `ADF_DAEMON_URL`) targets, and if needed starts, a daemon on another port. Other daemon settings: `ADF_DAEMON_HOST`, `ADF_DAEMON_SETTINGS` (settings JSON path), `ADF_USER_DATA_DIR`, `ADF_DAEMON_TOKEN` (required off loopback).
33
+ In the terminal app (a welcome checklist opens on first run):
27
34
 
28
- The daemon shares its settings file with ADF Studio on the same machine by default, so providers and tracked directories you set up in Studio carry over.
35
+ ```text
36
+ /identity create # your owner identity: 12 words, the same as in ADF Studio
37
+ /login chatgpt # or /login grok, or /provider add for an API key
38
+ /new # create an agent; its chat opens
39
+ /loop new consolidator # optional: an inner loop that tidies memory nightly
40
+ ```
29
41
 
30
- ## Identity and sign-in
42
+ Or with one-shot commands:
43
+
44
+ ```bash
45
+ adf identity new
46
+ adf auth login chatgpt
47
+ adf new agent-1 --start
48
+ adf chat agent-1 "hello"
49
+ adf events agent-1
50
+ ```
31
51
 
32
- - `adf identity` shows the owner identity status; `adf identity create` / `adf identity restore` sets it up (the seed phrase is typed at a hidden prompt; the same phrase as Studio means the same owner). The phrase is kept in the OS keychain, or a passphrase-protected file where no keychain exists (`adf identity unlock`).
33
- - `adf providers` lists model providers; `adf auth <provider>` signs in to subscription providers (ChatGPT, Grok) from the terminal.
34
- - `adf new` creates an agent from a template, sealed with the owner identity.
52
+ Daemon: `adf daemon status | stop | restart | logs -f | token`. Studio and
53
+ the CLI share settings and the owner identity on one machine; `adf` does not
54
+ start a daemon while Studio is running.
35
55
 
36
56
  ## Docs
37
57
 
38
- - [Daemon getting started](https://github.com/christianbalevski/adf/blob/main/docs/daemon/getting-started.md)
39
- - [CLI reference](https://github.com/christianbalevski/adf/blob/main/docs/daemon/cli.md)
40
- - [Terminal app](https://github.com/christianbalevski/adf/blob/main/docs/daemon/tui.md)
41
- - [HTTP API](https://github.com/christianbalevski/adf/blob/main/docs/daemon/http-api.md)
58
+ - [ADF CLI](https://github.com/christianbalevski/adf/blob/main/docs/cli/index.md)
59
+ - [Getting started](https://github.com/christianbalevski/adf/blob/main/docs/cli/getting-started.md)
60
+ - [Terminal app](https://github.com/christianbalevski/adf/blob/main/docs/cli/terminal-app.md)
61
+ - [Reference](https://github.com/christianbalevski/adf/blob/main/docs/cli/reference.md): every command, flag, slash command and key
62
+ - [Remote daemon](https://github.com/christianbalevski/adf/blob/main/docs/cli/remote-daemon.md)
63
+ - [Troubleshooting](https://github.com/christianbalevski/adf/blob/main/docs/cli/troubleshooting.md)
64
+ - [Daemon HTTP API](https://github.com/christianbalevski/adf/blob/main/docs/daemon/http-api.md)
42
65
 
43
66
  ## License
44
67
 
package/dist/adf.mjs CHANGED
@@ -9,7 +9,7 @@ import "./chunks/chunk-M2RX3S2T.mjs";
9
9
 
10
10
  // src/main/cli/bin.ts
11
11
  function version() {
12
- return "0.7.2";
12
+ return "0.7.3";
13
13
  }
14
14
  var DAEMON_HELP = `Usage: adf daemon [--port <n>] [--host <h>] [--settings <file>]
15
15
  adf daemon start [--port <n>] [--force]
@@ -27,10 +27,12 @@ on this machine by itself (<data dir>/daemon-token, created on first start);
27
27
  token prints it for a client elsewhere (--token or ADF_DAEMON_TOKEN there).
28
28
  ADF_DAEMON_TOKEN overrides the file, and is required with a non-loopback
29
29
  --host (plus ADF_DAEMON_ALLOWED_HOSTS for host names clients use).
30
+ Behind a reverse proxy on this host set ADF_DAEMON_BEHIND_PROXY=1: identity
31
+ secrets and stop then work only from adf on this host, against its loopback port.
30
32
 
31
33
  Environment: ADF_DAEMON_PORT, ADF_DAEMON_HOST, ADF_DAEMON_SETTINGS,
32
34
  ADF_USER_DATA_DIR, ADF_DAEMON_PIDFILE, ADF_DAEMON_TOKEN,
33
- ADF_DAEMON_ALLOWED_HOSTS`;
35
+ ADF_DAEMON_ALLOWED_HOSTS, ADF_DAEMON_BEHIND_PROXY`;
34
36
  function applyDaemonArgs(args, env = process.env) {
35
37
  for (let i = 0; i < args.length; i++) {
36
38
  let arg = args[i], [flag, inline] = arg.startsWith("--") && arg.includes("=") ? [arg.slice(0, arg.indexOf("=")), arg.slice(arg.indexOf("=") + 1)] : [arg, void 0], value = () => {
@@ -48,7 +50,7 @@ ${DAEMON_HELP}`);
48
50
  }
49
51
  var DAEMON_SUBCOMMANDS = /* @__PURE__ */ new Set(["start", "status", "stop", "restart", "logs", "token"]);
50
52
  async function daemonSubcommand(sub, args) {
51
- let control = await import("./chunks/daemon-control-WDX7PMTC.mjs"), out = (text) => {
53
+ let control = await import("./chunks/daemon-control-HKFVSQTQ.mjs"), out = (text) => {
52
54
  process.stdout.write(text);
53
55
  }, { url, rest } = control.daemonUrlFrom(args), target = control.daemonTarget(url), force = rest.includes("--force"), start = async () => {
54
56
  if (await control.isHealthy(target.url))
@@ -135,12 +137,12 @@ async function main(argv) {
135
137
  `), 2;
136
138
  }
137
139
  if (!process.env.ADF_DAEMON_PIDFILE) {
138
- let { daemonPaths } = await import("./chunks/daemon-control-WDX7PMTC.mjs");
140
+ let { daemonPaths } = await import("./chunks/daemon-control-HKFVSQTQ.mjs");
139
141
  process.env.ADF_DAEMON_PIDFILE = daemonPaths(Number(process.env.ADF_DAEMON_PORT ?? 7385)).pidFile;
140
142
  }
141
- return await import("./chunks/daemon-ZC3FZ2P4.mjs"), -1;
143
+ return await import("./chunks/daemon-G6OQZER2.mjs"), -1;
142
144
  }
143
- let [{ runCli, tuiInvocation }, control] = await Promise.all([import("./chunks/cli-TCMBNZF6.mjs"), import("./chunks/daemon-control-WDX7PMTC.mjs")]);
145
+ let [{ runCli, tuiInvocation }, control] = await Promise.all([import("./chunks/cli-ZGVQRVSQ.mjs"), import("./chunks/daemon-control-HKFVSQTQ.mjs")]);
144
146
  return tuiInvocation(argv) && process.env.NODE_ENV === void 0 && (process.env.NODE_ENV = "production", process.env.ADF_NODE_ENV_DEFAULTED = "1"), await runCli(argv, {
145
147
  fetch: globalThis.fetch.bind(globalThis),
146
148
  stdout: (text) => process.stdout.write(text),