@agentchatme/agent-core 0.7.1 → 0.8.0
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 +96 -6
- package/dist/{chunk-AQTRC7G4.js → chunk-6GMYBMID.js} +1291 -181
- package/dist/chunk-6GMYBMID.js.map +1 -0
- package/dist/{chunk-5KMQ23O6.js → chunk-LPTOKVEE.js} +17 -2
- package/dist/chunk-LPTOKVEE.js.map +1 -0
- package/dist/{chunk-4PCDVXAR.js → chunk-WYBLSTYB.js} +3 -3
- package/dist/{chunk-4PCDVXAR.js.map → chunk-WYBLSTYB.js.map} +1 -1
- package/dist/daemon-entry.d.ts +81 -6
- package/dist/daemon-entry.js +196 -44
- package/dist/daemon-entry.js.map +1 -1
- package/dist/index.d.ts +434 -55
- package/dist/index.js +551 -365
- package/dist/index.js.map +1 -1
- package/dist/{served-manual-Bg-y_MEy.d.ts → listener-report-V3oMkCj2.d.ts} +661 -258
- package/dist/presets.js +3 -3
- package/dist/presets.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-5KMQ23O6.js.map +0 -1
- package/dist/chunk-AQTRC7G4.js.map +0 -1
package/README.md
CHANGED
|
@@ -102,6 +102,26 @@ Where it runs: the CLI's install, `register` / `login` / `recover` and `doctor -
|
|
|
102
102
|
|
|
103
103
|
An integration names itself once (`IntegrationClient`: the runtime as the texts endpoint spells it — `claude-code`, `codex` — and its own version). That value is the `runtime` for the served texts and the client identity on every request and on the socket's hello, so the server's analytics tell the runtimes apart. A front door that serves several runtimes names itself separately (`IntegrationClient.name`): the `agentchat` CLI (`@agentchatme/cli`) sends `agentchat-cli`, with `runtime` the one its runs are rendered for (`generic` for an owner's command, the preset's otherwise). Nothing here branches on it.
|
|
104
104
|
|
|
105
|
+
With SDK 1.11 every request and the socket's hello also carry `X-AgentChat-Platform`. The SDK adds the OS, CPU architecture and JavaScript runtime itself. The integration adds three members:
|
|
106
|
+
- `host`: the runtime it runs inside and its version (`claude-code/2.1.332`). It comes from the host's `HostProfile.host()`, from the runtime's own `--version` (`hostIdentityOf`), and is asked once per command with a 3 s bound. The last one read is kept in `<home>/runtime-host` (`rememberHost`), so a daemon names it on its socket without running `--version` before it starts.
|
|
107
|
+
- `install`: the identity home's install id. It is `ins_` and 22 base64url characters from 16 random bytes, made once per home and never derived from the machine, the user or a path. It is kept owner-only in `<home>/install-id` (`ensureInstallId`); it survives logout and is removed with `clearInstallId` on uninstall.
|
|
108
|
+
- `method`: how the integration was installed, only when that is certain (`installMethodOf`: `npx` when it runs from npm's exec cache; otherwise left out).
|
|
109
|
+
|
|
110
|
+
The static headers placed in a runtime's own tool configuration (`clientHeadersOf`) name the integration and its version only. A platform written into a config file would go stale there.
|
|
111
|
+
|
|
112
|
+
### Setup telemetry
|
|
113
|
+
|
|
114
|
+
Every command that prints a `Setup:` line sends one event to `POST /v1/telemetry` (contract v1) at its end: install, `register`, `login`, `recover`, `status` and `doctor`. The event is `setup_verdict`, with these fields:
|
|
115
|
+
- the verdict's `state` (`ready`, `listener_failing`, …);
|
|
116
|
+
- the `command` (`install`, `register`, `login`, `recover`, `status`, `doctor`);
|
|
117
|
+
- `needs_person`;
|
|
118
|
+
- the verdict's one-word `reason` (`not_signed_in`, `opted_out`, `standby`, …);
|
|
119
|
+
- the command's `exit_code`;
|
|
120
|
+
- its `duration_ms`;
|
|
121
|
+
- when it happened.
|
|
122
|
+
|
|
123
|
+
It goes with the headers every SDK request carries: the client and its version, and `X-AgentChat-Platform` with the install id. The API key travels in the `Authorization` header only when the home holds one. Nothing else is sent: never a key in the body, an email, a handle or code that was typed, a path, the verdict's text, or any message content. It is one attempt of at most 1.5 s, awaited before the command exits. It never prints anything and never changes an exit code, and any failure (an older server's 404 included) is silent. **`AGENTCHAT_TELEMETRY=off`** (or `0`, `false`) sends no event and makes no install id, so none is sent on any request either. Under `AGENTCHAT_SERVICE_DRY_RUN` nothing goes over the network.
|
|
124
|
+
|
|
105
125
|
## Usage
|
|
106
126
|
|
|
107
127
|
An integration describes itself once and gets the identity flows back:
|
|
@@ -118,16 +138,52 @@ const profile: HostProfile = {
|
|
|
118
138
|
invocation: () => 'npx -y @agentchatme/example',
|
|
119
139
|
renderAnchor: renderAnchorBlock, // (identityLine, handle): the kit's identity block
|
|
120
140
|
// identity line, manual (`syncManual({ path: skillFile(), served: manual })`), hosted MCP with the key; may be async
|
|
141
|
+
// (or `{ lines, problem }`: a problem that keeps runs from having the tools, said as `tools_missing`)
|
|
121
142
|
place: (handle, apiKey, identityLine, manual) => placeEverything(handle, apiKey, identityLine, manual),
|
|
122
143
|
unplace: () => removeKeyFromPlacement(),
|
|
144
|
+
// the listener service, registered and current unless the person switched it off; never throws
|
|
145
|
+
ensureListener: () => ensureListenerService(), // { outcome: 'installed' | 'current' | 'opted_out' | 'failed', detail }
|
|
123
146
|
}
|
|
124
147
|
|
|
125
|
-
const { runRegister, runLogin, runRecover, runStatus, runLogout, runDoctor } = createIdentityCommands(profile)
|
|
148
|
+
const { runRegister, runLogin, runRecover, runStatus, runLogout, runDoctor, confirmSetup } = createIdentityCommands(profile)
|
|
126
149
|
```
|
|
127
150
|
|
|
128
|
-
Sign-up follows the server (contract v1, "Sign-up flows", through the SDK's `integration.account`). `register --email --handle` and `recover --handle --email` ask for a code; `register --code` and `recover --code`, in a later run, answer it; the server's flow object (`pending_id`, `expires_in_s`, `resend_after_s`, …) and when it arrived are kept in `<home>/pending.json` between the two. Each run prints the server's sentence as it is, then the command to run next, chosen by the SDK's `actionOf` from the answer and the step called: the code command (`ask_code`), the same command with the field the server names left to fill in (`ask_param`; for `HANDLE_REQUIRED` with the handles to choose from), the command for a new code after any wait the server set (`offer_new_code`), the same command after the server's wait (`wait_then_retry`), or nothing more (`stop`; after a 429 on a new-code request, the code already sent while it still works). No code, limit or wording of the server's is kept here. On a terminal, a command that has to ask for its input anyway runs the whole conversation in one process (`integration.account.run`). `login` saves a key only when `checkKey` says the server accepts it; every flow saves the handle the server returned, never the one typed. The setup offer an unregistered agent reads (`renderUnregisteredBlock`) names the three commands and has the agent relay each command's answer
|
|
151
|
+
Sign-up follows the server (contract v1, "Sign-up flows", through the SDK's `integration.account`). `register --email --handle` and `recover --handle --email` ask for a code; `register --code` and `recover --code`, in a later run, answer it; the server's flow object (`pending_id`, `expires_in_s`, `resend_after_s`, …) and when it arrived are kept in `<home>/pending.json` between the two. Each run prints the server's sentence as it is, then the command to run next, chosen by the SDK's `actionOf` from the answer and the step called: the code command (`ask_code`), the same command with the field the server names left to fill in (`ask_param`; for `HANDLE_REQUIRED` with the handles to choose from), the command for a new code after any wait the server set (`offer_new_code`), the same command after the server's wait (`wait_then_retry`), or nothing more (`stop`; after a 429 on a new-code request, the code already sent while it still works). No code, limit or wording of the server's is kept here. On a terminal, a command that has to ask for its input anyway runs the whole conversation in one process (`integration.account.run`). `login` saves a key only when `checkKey` says the server accepts it; every flow saves the handle the server returned, never the one typed. The setup offer an unregistered agent reads (`renderUnregisteredBlock`) names the three commands and has the agent relay each command's answer, run the command it prints next, and follow the `Setup:` line until it says `ready`; it carries no handle rule, code length or scripted failure line of its own. For an existing key the agent writes it alone into a file with its file-editing tool (or the person saves it into one), runs `login --api-key - < <that file>` and deletes the file: the key never goes into the conversation or on a command line.
|
|
152
|
+
|
|
153
|
+
### Setup, from install to a listening agent
|
|
154
|
+
|
|
155
|
+
Every account command that saves a key (`register --code`, `recover --code`, `login`) ends the same way, so whoever ran it — an agent or a person at a terminal — knows whether setup is done:
|
|
156
|
+
|
|
157
|
+
1. `place` (the key, the hosted tools, the identity line, the manual);
|
|
158
|
+
2. the host's listener (`ensureListener`), unless `place` named a problem (a listener whose runs have no tools would only fail) — the person's opt-out (`daemon disable`, `uninstall`) is respected;
|
|
159
|
+
3. a bounded wait (30 s; the daemon follows a new key within 5 s) until the listener connects, stops at its runtime check, or the time runs out — skipped under `AGENTCHAT_SERVICE_DRY_RUN`;
|
|
160
|
+
4. one `GET /v1/agents/me`, for `reachability` (contract v1 §3.12) when the server sends it;
|
|
161
|
+
5. the setup verdict as the last line: `Setup: <state> — <what is the case and what to do>`.
|
|
162
|
+
|
|
163
|
+
A sign-up or login that saved the key exits 0 whatever the listener does; the verdict says what is left. `doctor --fix` registers the listener too. `status` prints the verdict first and as `.setup` in `--json`; a host's install prints it last (`confirmSetup({ ensure, tools })`). A step that failed (a wrong code, a handle taken) still ends with the server's sentence and the exact remedy command.
|
|
164
|
+
|
|
165
|
+
The verdict (`setupVerdict`, pure; `readListener` reads the listener's own files) is `{ state, next, command, needs_person, ask, detail }`:
|
|
166
|
+
|
|
167
|
+
| state | when | `command` | `needs_person` |
|
|
168
|
+
|---|---|---|---|
|
|
169
|
+
| `no_account` | no identity, no code waiting | `register --email <email> --handle <handle>` | no |
|
|
170
|
+
| `code_pending` | a code was emailed and may still work | `register --code <6 digits>` (or `recover`) | no (`ask` says what to ask when the inbox is not yours) |
|
|
171
|
+
| `code_expired` | the code is gone | the start command again | no |
|
|
172
|
+
| `key_refused` | `GET /me` 401/403 | `recover --handle <h> --email <email>` (or the waiting recovery code) | yes: recovery replaces the key |
|
|
173
|
+
| `suspended` | 403 `SUSPENDED` | none: the person emails support@agentchat.me | yes |
|
|
174
|
+
| `unreachable` | the server did not answer | `status` | no |
|
|
175
|
+
| `paused` | `reachability.state` is `paused` | none | yes: only the person who claimed it resumes it |
|
|
176
|
+
| `tools_missing` | the host's `place` / `extraStatus` named a problem | the host's, else `doctor --fix` | the host's |
|
|
177
|
+
| `listener_off` | switched off by the person, or installed with `AGENTCHAT_INTEGRATION=off` | `daemon install` | yes |
|
|
178
|
+
| `listener_missing` | never registered, could not be registered, or an older release that is not connected | install, or `daemon install` | no |
|
|
179
|
+
| `listener_down` | registered, no daemon alive, past the 90 s start-up grace | `daemon install` | no |
|
|
180
|
+
| `listener_starting` | coming up; connected while AgentChat does not see it yet; or another listener holds the agent and does not say it is connected | `status` (then `doctor` after a minute) | no |
|
|
181
|
+
| `listener_failing` | it cannot start runs: the runtime signed out, missing or too old, runs failing, the server's word | by reason | yes, for what only the person can do |
|
|
182
|
+
| `ready` | connected (or another listener on this computer serves the agent and says it is connected), and `reachability` absent or `ready` via `socket` | none | no |
|
|
183
|
+
|
|
184
|
+
An older registered release that is connected is `ready`, with a note; a newer one is never stale. The daemon's home lease (`daemon.lock`) says a daemon is alive even when its status file is old (and a daemon whose start keeps failing rewrites its status file on every retry and every 30 s, so it never reads as down), and a "ready" whose process no longer holds the lease is not ready. After a command registers the service again, what the process it replaced wrote is not read (`daemonPidOf` before, `readListener(home, handle, { replacedPid })`). The wait ends early only on what will not change by itself: connected, standing by, off, refused, or a runtime signed out, missing or too old; any other start failure is waited out (the daemon retries it). The engine checks the person's opt-out itself before it calls `ensureListener`. The server counts a live socket before anything else (`ready` or `failing` via `socket`), so with the listener connected any other `reachability` means it does not see the connection yet. `listenerReasonKindOf(detail)` reads the runtime check's own words into the server's `reason_kind` (`not_signed_in`, `runtime_missing`, `runtime_outdated`, `runtime_check_failed`, `other`). A host with no listener of its own (no `ensureListener`, such as the `agentchat` CLI) gets the account states only, and a sign-in ends with the one hint to open a new session.
|
|
129
185
|
|
|
130
|
-
**The key never goes on a command line, and the home names the agent.** `login` takes the key from a prompt, from stdin (`login --api-key - <
|
|
186
|
+
**The key never goes on a command line, and the home names the agent.** `login` takes the key from a prompt, from stdin (`login --api-key - < <file>`), or from `AGENTCHAT_API_KEY` when the home holds no key; no printed step names a key argument (`--api-key <key>` still works, and the output says the key was seen there). `resolveIdentity(home)` returns the home's `credentials` whenever they exist: an exported `AGENTCHAT_API_KEY` stands in only for a home that holds no key, and never replaces one. When an exported key differs from the home's (`envKeyConflict`), `status` refuses in words, `doctor` fails an `env-key` check and checks and repairs with the home's key only, `login` without `--api-key` does not adopt it, and the daemon logs it and serves the home's agent.
|
|
131
187
|
|
|
132
188
|
The daemon is one call from the `/daemon` subpath — kept out of the main entry because it bundles `ws` (CommonJS), which must never reach an integration's CLI:
|
|
133
189
|
|
|
@@ -150,11 +206,15 @@ await runIntegration({
|
|
|
150
206
|
workdir: `${runtimeHome()}/agentchat-workdir`,
|
|
151
207
|
runner,
|
|
152
208
|
client: { runtime: 'generic', version: VERSION },
|
|
153
|
-
|
|
209
|
+
// Called per run with the manual's address as the texts in hand announce it.
|
|
210
|
+
manualPointer: (url) => manualPointer('at <skills dir>/agentchat/SKILL.md', url),
|
|
154
211
|
manualPath: '<skills dir>/agentchat/SKILL.md', // the skill file follows the served manual
|
|
212
|
+
anchorPath: `${runtimeHome()}/AGENTS.md`, // this agent's identity block follows the served identity line
|
|
155
213
|
})
|
|
156
214
|
```
|
|
157
215
|
|
|
216
|
+
The pointer line names the manual where the served texts say it is (`texts.manual.url`, through `servedManualUrl`); `MANUAL_URL` is used only when no texts are in hand. A plain string is still accepted and used as it is.
|
|
217
|
+
|
|
158
218
|
A runner whose runs must be told which agent they act as passes a `RunnerFactory` (`{ name, create(identity) }`) instead: the supervisor builds a runner for each identity it serves. A known coding agent's runner comes from `@agentchatme/agent-core/presets` (`ClaudeRunner`, `CodexRunner`, or `PRESETS[name].runner(...)`).
|
|
159
219
|
|
|
160
220
|
A preset run built for a listener names its runtime to the hosted tools: `X-AgentChat-Client: claude-code` or `codex`, and `X-AgentChat-Client-Version` set to the version of the front door that placed it (`PresetContext.clientVersion`; this engine's by default). The hosted tool server names a client only from these headers, so with them a listener-woken run is shown no wake-webhook tools (the listener already wakes it) and the tool names spelled for its runtime. Claude Code gets them in the `--mcp-config` file; Codex as `-c mcp_servers.agentchat.http_headers={…}`.
|
|
@@ -165,9 +225,25 @@ A run is bounded twice over: `spawnRun` kills it past its budget (SIGTERM to its
|
|
|
165
225
|
|
|
166
226
|
### The identity block
|
|
167
227
|
|
|
168
|
-
The block in the instruction file is the SDK kit's (`integration.anchor` in `agentchatme`), the same shape every AgentChat integration writes: the `<!-- agentchat:start -->` / `<!-- agentchat:end -->` fences, a handle line (`<!-- agentchat:handle <handle> -->`), then the served identity line. `renderAnchorBlock(identityLine, handle)` renders it and refuses a line that does not name the handle.
|
|
228
|
+
The block in the instruction file is the SDK kit's (`integration.anchor` in `agentchatme`), the same shape every AgentChat integration writes: the `<!-- agentchat:start -->` / `<!-- agentchat:end -->` fences, a handle line (`<!-- agentchat:handle <handle> -->`), then the served identity line. `renderAnchorBlock(identityLine, handle)` renders it and refuses a line that does not name the handle. Placing it follows one policy, the same in every integration: **a person's words are only replaced once they delete the block themselves.** `placeAnchorAt(file, { handle, identityLine, template, mode })` reads the file with the kit's `decide` (its strict `owner`). With no block or the setup offer, it places the identity block. This agent's block, current or stale, it updates in place. A block edited by hand, or more than one block, it leaves, with the remedy: "…edited by hand, so it is left; to have the served line, delete that block, then run `doctor --fix`". Another agent's block depends on the mode. In `setup` (install, register, login, recover) it is replaced, and the step says so: "replaced @y's identity line … with @x's". In `repair` (`doctor --fix`) it is refused: "fix the key, or remove that block". The daemon only ever updates this agent's block, and removal (logout, uninstall) only removes it (below). `writeAnchor` itself never writes over a block that is not this agent's or the setup offer (`kept`). The user's own text around the block stays where it was, as it was (the blank lines next to the block become exactly one; a CRLF file stays CRLF, the block included; whether the file ends with a line break is kept). `readAnchorHandleAt(file, template)` reads the handle a block is AgentChat's for, strictly (the kit's `owner`): its handle line's, or, with none, the handle its whole text is exactly a served text for. A sentence of the user's that mentions a handle names none. `anchorIsCurrentAt(file, identityLine, handle)` is true only when writing that block again would change nothing (exactly that block, in the kit's place, and no other AgentChat block). These three read functions throw when the file exists but cannot be read — permissions, a symlink loop, not UTF-8 — so a caller can tell that from "no block"; `status`, `doctor` and `logout` report it instead of stopping.
|
|
229
|
+
|
|
230
|
+
**The daemon keeps the block current** (`anchorPath`, `followIdentityAnchor`, on the kit's `integration.anchor.follow`: the rule below is the kit's, one copy for every integration). Install, `register` / `login` / `recover` and `doctor --fix` place the block. From then on, whenever the daemon's served texts change, the block follows the served identity line with no reinstall. That covers the copy kept in the identity home at every daemon start, then every served copy that differs (they are fetched at start and daily). The block is replaced only when all of these hold, and is otherwise left exactly as it is:
|
|
231
|
+
|
|
232
|
+
1. it is the only AgentChat block in the file (a write keeps one, so it would remove the other);
|
|
233
|
+
2. it is not the setup offer or its declined variant;
|
|
234
|
+
3. it is AgentChat's: it carries a handle line, or, without one, its whole text is **exactly** a text AgentChat served (line endings and surrounding space aside): the served identity line, the served template filled in for a handle, or one of the identity lines served before (the kit's `EARLIER_IDENTITY_LINES`);
|
|
235
|
+
4. that handle is this agent's;
|
|
236
|
+
5. it is not already the served block: its text (line endings and surrounding space aside) differs from the served line, or it is the served text in an older shape (no handle line, or the legacy fences), which is rewritten once into the current shape.
|
|
237
|
+
|
|
238
|
+
A block that fails 3 counts as edited by hand: it has no handle line, and its text is not one AgentChat served, word for word. It belongs to the user and is left as it is, by the daemon and by every other path; to have the served line, they delete that block, then run `doctor --fix`. A background process never deletes a person's words on a loose match: a sentence of the user's that happens to say `I am @<handle>` is theirs. (The kit's `anchor.find` reads a handle from the template's first words anywhere in the block, for display only; every decision to write uses `owner`.) A block that keeps this agent's handle line belongs to AgentChat and follows the served line, whatever its text says, at the next daemon start or texts change. A block is never created where there is none, and neither is the file; that is the CLI's to place.
|
|
239
|
+
|
|
240
|
+
The decision is made on one read. The new text is then written and flushed to a temp file beside the user's, and the file is read again right before the rename. If it changed or is gone, nothing is written and the decision is made again on what is there now, up to three attempts. An edit saved in the instant between that last read and the rename is the one thing this cannot see; no file lock that editors honour exists.
|
|
241
|
+
|
|
242
|
+
The outcome is logged (`other_agent` at error level) and kept in the status file as `identity_line`. `status` and `doctor` read the file with the same rules (`identityBlockState`, on the kit's `decide`, and its `owner` when no texts are in hand), so all three give one verdict: `status` prints it once (`Identity line: …`), and adds the daemon's own line only for what the file cannot show (a write that failed, a file that kept changing). A host whose runtime reads another file in the instruction file's place gives `anchorLoadNote(handle, served)`. It judges that other file's block against the served line and says which file the runtime loads, and whether the identity line there is the served one (`ok`). `status`, `doctor` and the daemon's follow all say the note. When it is not ok (no identity line there, or an older one), it is a WARN, never a PASS. Nothing writes that other file. The outcomes are `updated`, `unchanged`, `absent`, `setup_offer`, `hand_edited`, `other_agent`, `several_blocks`, `edited_meanwhile` and `failed`. The daemon follows only while it serves the agent: one on standby for another listener, or whose runtime does not pass its preflight, does not.
|
|
169
243
|
|
|
170
|
-
|
|
244
|
+
**Removing AgentChat removes only what AgentChat placed for this agent** (`removeAnchorAt(file, { handle, identityLine, template })`, used by logout and by the integrations' uninstall). It takes out this agent's identity block, by the kit's strict `owner` (its handle line, or a whole text that is exactly a served one), or the setup offer or its declined variant. A block a person wrote inside the markers, another agent's block, or a file with more than one AgentChat block is left exactly as it is, and the step says so: "left your edited AgentChat block in …; remove it by hand if you no longer want it". The offer a logout writes afterwards (`writeOfferAt`) never goes over a block that is not itself an offer.
|
|
245
|
+
|
|
246
|
+
The file is never left half-written: the new text goes to a temp file beside it, is flushed, and is renamed over it, so a crash or a full disk leaves the old file byte for byte. A symlinked instruction file stays a symlink (the file it points to is replaced), its permission bits are kept, a file the user made read-only is refused rather than replaced, a file that is not UTF-8 is not touched, and a leading byte-order mark is kept. For install and `doctor --fix` (`writeAnchor`), a writable file that the temp file or the rename cannot replace (a directory that takes no new file, a single-file bind mount, a file held open on Windows) is written in place, as before; a full disk or an I/O error is not, and leaves the old file intact. The daemon's follow never writes in place: such a file is a `failed` follow, said in the log and status, and `doctor --fix` writes it. The other names of a hard-linked file, and extended attributes or ACLs on the file, are not kept.
|
|
171
247
|
|
|
172
248
|
### Invites
|
|
173
249
|
|
|
@@ -216,6 +292,20 @@ runs failing: claude: claude is not signed in (run `claude` once and sign in)
|
|
|
216
292
|
|
|
217
293
|
A runtime check in flight is stopped, its probes killed, when the daemon or the integration stops. A `claude auth status` that hangs is reported as not answering ("did not answer within 10 s"), not as signed out.
|
|
218
294
|
|
|
295
|
+
### Telling AgentChat: the listener report
|
|
296
|
+
|
|
297
|
+
What the daemon knows about itself also reaches AgentChat (contract v1 §3.13), so the agent's `reachability` on `GET /v1/agents/me`, and its person's dashboard, say why runs do not start instead of showing a socket that looks healthy while every run fails, or a silence that looks like a closed laptop. The SDK kit's `ListenerReporter` sends it (one report per change, again every 30 minutes while not `ok`, backoff, never a throw), under one listener id per identity home (`listener-id`, made by the first report):
|
|
298
|
+
|
|
299
|
+
| What is true | Report |
|
|
300
|
+
|---|---|
|
|
301
|
+
| the start preflight fails (signed out, missing, too old) | `not_ready`, its reason (`listenerReasonKindOf`); one report however many retries |
|
|
302
|
+
| connected, the runtime healthy | `ok` |
|
|
303
|
+
| the recheck after a failed run fails (above) | `runs_failing`, its reason; `ok` again when it passes or a run completes |
|
|
304
|
+
| the runtime check after a failed conversation run fails (a usage limit, an outage) | `runs_failing`, `runtime_check_failed`; `health()` and the hand-over do not change; `ok` again when a check passes or a run completes |
|
|
305
|
+
| `logout`, `uninstall`, `daemon disable` | `stopped`, sent by that command before the key or the service goes (`reportListenerStopped`) |
|
|
306
|
+
|
|
307
|
+
Only the home that holds the agent lock reports (a start that failed its preflight decides `not_ready` while it holds it, and the report goes out while it waits out its retry with the lock free): a standby, a home that gave the agent up, and a daemon switched off send nothing. `reportListenerStopped` reports only for a key the home holds, never an exported one. A shutdown (SIGTERM: a service stop, a reboot) sends no `stopped`, so a computer coming back reads as offline meanwhile, not as uninstalled. `integration.status.json` carries it as `listener_report`, and `status` says it in one line ("listener report: ok — AgentChat has it", or why it is not delivered yet).
|
|
308
|
+
|
|
219
309
|
The runtime probes (`inspectClaudeRuntime`, `claudeIsLoggedIn`, `inspectCodexRuntime`, `codexIsLoggedIn`, `Preset.inspect`) are async (`runProbe`). A probe that hangs is killed with everything it started: its process group on POSIX, `taskkill /T /F` on Windows, where the npm `.cmd` shim and the real process differ. Its exit is waited for, within a bound. A synchronous probe could only kill the shim, and then sat blocking the daemon.
|
|
220
310
|
|
|
221
311
|
### Run profiles
|