@knowttl/ha-axi 0.0.0-stage → 0.1.0-alpha.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.
@@ -0,0 +1,168 @@
1
+ import { isUtf8 } from "node:buffer";
2
+ import { readFileSync } from "node:fs";
3
+ import { StringDecoder } from "node:string_decoder";
4
+ import { z } from "zod";
5
+ import { selectProfile } from "../../core/credentials/config.js";
6
+ import { AxiError, errnoCode } from "../../core/credentials/errors.js";
7
+ import { redactPayload } from "../../core/credentials/redact.js";
8
+ import { parse, SELECT, secretName, selector } from "../../core/output/command.js";
9
+ import { connect, MAX_REST_RESPONSE_BYTES, readRest } from "../../core/transport/rest.js";
10
+ import { readWs } from "../../core/transport/ws.js";
11
+ import { passthroughRest, passthroughWs } from "../../core/writes/passthrough.js";
12
+ import { classifyRest, classifyWs } from "./classify.js";
13
+ const FORBIDDEN_HEADERS = new Set([
14
+ "authorization", "proxy-authorization", "cookie", "host", "accept-encoding", "content-length", "transfer-encoding", "connection", "upgrade", "user-agent",
15
+ ]);
16
+ const HTTP_TOKEN = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;
17
+ const DEFAULT_MAX_BYTES = 512 * 1024;
18
+ const MAX_TIMEOUT_MS = 600_000;
19
+ const payloadSchema = z.custom((value) => typeof value === "object" && value !== null && !Array.isArray(value));
20
+ const WS_OPTIONS = { ...SELECT, "payload-file": { type: "string" }, stdin: { type: "boolean" }, timeout: { type: "string" } };
21
+ const OPTIONS = {
22
+ ...SELECT,
23
+ query: { type: "string", multiple: true },
24
+ header: { type: "string", multiple: true },
25
+ "body-file": { type: "string" },
26
+ stdin: { type: "boolean" },
27
+ "max-bytes": { type: "string" },
28
+ timeout: { type: "string" },
29
+ };
30
+ function pairs(items, separator, flag) {
31
+ return (items ?? []).map((item) => {
32
+ const index = item.indexOf(separator);
33
+ const key = item.slice(0, index).trim();
34
+ if (index < 1 || key === "")
35
+ throw new AxiError("INVALID_ARGUMENT", `${flag} expects <name>${separator}<value>`);
36
+ const value = item.slice(index + 1);
37
+ if (flag === "--query") {
38
+ if (secretName(key) || /signature|^sig$/i.test(key)) {
39
+ throw new AxiError("INVALID_ARGUMENT", `--query ${key} is refused: credentials are never accepted in the query string`);
40
+ }
41
+ return [key, value];
42
+ }
43
+ if (!HTTP_TOKEN.test(key))
44
+ throw new AxiError("INVALID_ARGUMENT", "--header expects a valid HTTP field name");
45
+ if (FORBIDDEN_HEADERS.has(key.toLowerCase())) {
46
+ throw new AxiError("INVALID_ARGUMENT", `--header ${key} is refused: ha-axi controls this header`);
47
+ }
48
+ if (/[^\t -~]/.test(value)) {
49
+ throw new AxiError("INVALID_ARGUMENT", "--header values may only contain printable ASCII and tabs");
50
+ }
51
+ return [key, value.trim()];
52
+ });
53
+ }
54
+ function integer(value, flag, max) {
55
+ if (value === undefined)
56
+ return undefined;
57
+ const parsed = /^\d+$/.test(value) ? Number(value) : 0;
58
+ if (parsed < 1 || parsed > max)
59
+ throw new AxiError("INVALID_ARGUMENT", `${flag} must be an integer from 1 to ${String(max)}`);
60
+ return parsed;
61
+ }
62
+ function readInput(path, flag) {
63
+ try {
64
+ return readFileSync(path);
65
+ }
66
+ catch (error) {
67
+ throw new AxiError("INVALID_ARGUMENT", `${flag} ${path} cannot be read (${errnoCode(error) ?? "unknown error"})`);
68
+ }
69
+ }
70
+ function wsPayload(source, flag) {
71
+ if (source === undefined)
72
+ return {};
73
+ if (!isUtf8(source))
74
+ throw new AxiError("INVALID_ARGUMENT", `${flag} is not valid UTF-8`);
75
+ let json;
76
+ try {
77
+ json = JSON.parse(source.toString("utf8"));
78
+ }
79
+ catch {
80
+ throw new AxiError("INVALID_ARGUMENT", `${flag} is not valid JSON`);
81
+ }
82
+ const parsed = payloadSchema.safeParse(json);
83
+ if (!parsed.success)
84
+ throw new AxiError("INVALID_ARGUMENT", `${flag} must contain a JSON object`);
85
+ return parsed.data;
86
+ }
87
+ function vendorBody(response, redactor) {
88
+ const mediaType = response.contentType.split(";", 1)[0]?.trim().toLowerCase();
89
+ if (mediaType === "application/json" || mediaType?.endsWith("+json")) {
90
+ let json;
91
+ try {
92
+ json = JSON.parse(response.text);
93
+ }
94
+ catch {
95
+ json = undefined;
96
+ }
97
+ if (json !== undefined) {
98
+ const body = redactPayload(json, redactor);
99
+ return { body, text: JSON.stringify(body) };
100
+ }
101
+ }
102
+ const text = redactor.text(response.text);
103
+ return { body: text, text };
104
+ }
105
+ const api = async (args, { host, files, redactor, userAgent, stdin }) => {
106
+ const { values, positionals } = parse(args, OPTIONS, 2);
107
+ const [verb = "", raw = ""] = positionals;
108
+ if (!HTTP_TOKEN.test(verb))
109
+ throw new AxiError("INVALID_ARGUMENT", "Method must be a valid HTTP token");
110
+ const method = verb.toUpperCase();
111
+ if (method === "CONNECT")
112
+ throw new AxiError("INVALID_ARGUMENT", "CONNECT is unavailable for raw REST requests");
113
+ const file = values["body-file"];
114
+ const target = classifyRest(method, raw, file !== undefined || values.stdin === true);
115
+ const query = pairs(values.query, "=", "--query");
116
+ const headers = pairs(values.header, ":", "--header");
117
+ if (file !== undefined && values.stdin === true)
118
+ throw new AxiError("INVALID_ARGUMENT", "Use at most one of --body-file and --stdin");
119
+ const body = file !== undefined ? readInput(file, "--body-file") : values.stdin === true ? await stdin() : undefined;
120
+ const maxBytes = integer(values["max-bytes"], "--max-bytes", MAX_REST_RESPONSE_BYTES) ?? DEFAULT_MAX_BYTES;
121
+ const timeoutMs = integer(values.timeout, "--timeout", MAX_TIMEOUT_MS);
122
+ const selection = selectProfile(selector(values), host, files);
123
+ const session = connect(selection, host, files, redactor, userAgent);
124
+ const base = { query, headers, ...(timeoutMs === undefined ? {} : { timeoutMs }), ...(body === undefined ? {} : { body }) };
125
+ const response = target.kind === "read-get"
126
+ ? await readRest(session, { ...base, method: "GET", path: target.path })
127
+ : target.kind === "read-post"
128
+ ? await readRest(session, { ...base, method: "POST", path: target.path })
129
+ : await passthroughRest(session, selection.readOnly, { ...base, method, path: target.path });
130
+ const { body: redactedBody, text } = vendorBody(response, redactor);
131
+ const truncated = Buffer.byteLength(text) > maxBytes;
132
+ return {
133
+ request: `${method} ${target.path}`,
134
+ status: response.status,
135
+ body: truncated ? new StringDecoder("utf8").write(Buffer.from(text).subarray(0, maxBytes)) : redactedBody,
136
+ ...(truncated
137
+ ? { truncated: true, help: [`The body was cut at ${String(maxBytes)} bytes (set by --max-bytes)`] }
138
+ : {}),
139
+ };
140
+ };
141
+ const ws = async (args, { host, files, redactor, userAgent, stdin }) => {
142
+ const { values, positionals } = parse(args, WS_OPTIONS, 1);
143
+ const [type = ""] = positionals;
144
+ const file = values["payload-file"];
145
+ if (file !== undefined && values.stdin === true)
146
+ throw new AxiError("INVALID_ARGUMENT", "Use at most one of --payload-file and --stdin");
147
+ const source = file !== undefined ? readInput(file, "--payload-file") : values.stdin === true ? await stdin() : undefined;
148
+ const payload = wsPayload(source, file !== undefined ? "--payload-file" : "--stdin");
149
+ const target = classifyWs(type, payload);
150
+ const timeoutMs = integer(values.timeout, "--timeout", MAX_TIMEOUT_MS);
151
+ const selection = selectProfile(selector(values), host, files);
152
+ const session = connect(selection, host, files, redactor, userAgent);
153
+ const request = { type, payload, ...(timeoutMs === undefined ? {} : { timeoutMs }) };
154
+ const reply = target.kind === "read"
155
+ ? await readWs(session, { ...request, type: target.type })
156
+ : await passthroughWs(session, selection.readOnly, request);
157
+ if (reply.success)
158
+ return { command: type, success: true, result: redactPayload(reply.result, redactor) };
159
+ return {
160
+ command: type,
161
+ success: false,
162
+ error: redactPayload(reply.error, redactor),
163
+ ...(reply.error.code === "unknown_command"
164
+ ? { help: ["Home Assistant does not recognise this command type; check the spelling and that its integration is loaded"] }
165
+ : {}),
166
+ };
167
+ };
168
+ export const handlers = { api, ws };
@@ -0,0 +1,15 @@
1
+ export const feature = {
2
+ name: "raw",
3
+ commands: [
4
+ {
5
+ name: "api",
6
+ effect: "passthrough",
7
+ summary: "Send a REST request under /api/; writes pass through unless HA_AXI_READ_ONLY=true, deferred v2 families are refused",
8
+ },
9
+ {
10
+ name: "ws",
11
+ effect: "passthrough",
12
+ summary: "Send a WebSocket command; writes pass through unless HA_AXI_READ_ONLY=true, deferred v2 families are refused",
13
+ },
14
+ ],
15
+ };
@@ -0,0 +1,116 @@
1
+ export const registry = {
2
+ "features": [
3
+ {
4
+ "name": "core",
5
+ "commands": [
6
+ {
7
+ "name": "help",
8
+ "effect": "read",
9
+ "summary": "List every ha-axi command with its effect"
10
+ },
11
+ {
12
+ "name": "auth status",
13
+ "effect": "read",
14
+ "summary": "Show the selected profile, origin and token source without contacting Home Assistant"
15
+ },
16
+ {
17
+ "name": "profile list",
18
+ "effect": "read",
19
+ "summary": "List the profiles in config.json"
20
+ },
21
+ {
22
+ "name": "profile set",
23
+ "effect": "read",
24
+ "hosted": "blocked",
25
+ "summary": "Create or replace a local profile in config.json; sends no Home Assistant request"
26
+ },
27
+ {
28
+ "name": "profile remove",
29
+ "effect": "read",
30
+ "hosted": "blocked",
31
+ "summary": "Remove a local profile from config.json; sends no Home Assistant request"
32
+ },
33
+ {
34
+ "name": "config path",
35
+ "effect": "read",
36
+ "summary": "Print the config.json and writes.log paths"
37
+ },
38
+ {
39
+ "name": "doctor",
40
+ "effect": "read",
41
+ "summary": "Check the profile and credentials with one bounded GET /api/config"
42
+ },
43
+ {
44
+ "name": "status",
45
+ "effect": "read",
46
+ "summary": "Show the Home Assistant version, state, location and component count"
47
+ },
48
+ {
49
+ "name": "config check",
50
+ "effect": "read",
51
+ "summary": "Validate the Home Assistant configuration (read-only POST)"
52
+ },
53
+ {
54
+ "name": "writes status",
55
+ "effect": "read",
56
+ "summary": "Show one writes.log entry and its outcome, with reconciliation guidance when the outcome is unknown"
57
+ },
58
+ {
59
+ "name": "writes pending",
60
+ "effect": "read",
61
+ "summary": "List journaled writes whose outcome is pending or unknown"
62
+ }
63
+ ]
64
+ },
65
+ {
66
+ "name": "diagnostics",
67
+ "commands": [
68
+ {
69
+ "name": "logs list",
70
+ "effect": "read",
71
+ "summary": "List system log entries at or above an optional --level, with source file and occurrence count"
72
+ },
73
+ {
74
+ "name": "repairs list",
75
+ "effect": "read",
76
+ "summary": "List repair issues with domain, severity and whether each is fixable or ignored"
77
+ },
78
+ {
79
+ "name": "integrations list",
80
+ "effect": "read",
81
+ "summary": "List integration config entries with domain, title and load state"
82
+ },
83
+ {
84
+ "name": "template render",
85
+ "effect": "read",
86
+ "summary": "Render a Jinja2 template and print the text result (read-only POST)"
87
+ },
88
+ {
89
+ "name": "history get",
90
+ "effect": "read",
91
+ "summary": "Show an entity's state timeline since a duration ago"
92
+ },
93
+ {
94
+ "name": "logbook list",
95
+ "effect": "read",
96
+ "summary": "List logbook entries since a duration ago, optionally for one entity"
97
+ }
98
+ ]
99
+ },
100
+ {
101
+ "name": "raw",
102
+ "commands": [
103
+ {
104
+ "name": "api",
105
+ "effect": "passthrough",
106
+ "summary": "Send a REST request under /api/; writes pass through unless HA_AXI_READ_ONLY=true, deferred v2 families are refused"
107
+ },
108
+ {
109
+ "name": "ws",
110
+ "effect": "passthrough",
111
+ "summary": "Send a WebSocket command; writes pass through unless HA_AXI_READ_ONLY=true, deferred v2 families are refused"
112
+ }
113
+ ]
114
+ }
115
+ ]
116
+ };
package/package.json CHANGED
@@ -1,6 +1,64 @@
1
1
  {
2
2
  "name": "@knowttl/ha-axi",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0-alpha.0",
4
+ "description": "Home Assistant OS core admin AXI CLI for agents (strict TypeScript, standalone and via artium-axi)",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/knowttl/ha-axi.git"
10
+ },
11
+ "bin": {
12
+ "ha-axi": "dist/cli.js"
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "skills/ha-axi",
17
+ "artium-inventory.json",
18
+ "axi-credential.schema.json",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "engines": {
26
+ "node": ">=24.11.0"
27
+ },
28
+ "packageManager": "pnpm@10.34.6",
29
+ "imports": {
30
+ "#core/*": "./src/core/*",
31
+ "#features/*": "./src/features/*",
32
+ "#generated/*": "./src/generated/*"
33
+ },
34
+ "scripts": {
35
+ "check": "node scripts/check.ts",
36
+ "typecheck": "tsc --noEmit -p tsconfig.json",
37
+ "build": "tsc -p tsconfig.build.json",
38
+ "lint": "eslint --flag unstable_native_nodejs_ts_config --max-warnings 0 .",
39
+ "check:comments": "node scripts/checks/comments.ts",
40
+ "check:file-length": "node scripts/checks/file-length.ts",
41
+ "check:layout": "node scripts/checks/layout.ts",
42
+ "check:boundaries": "node scripts/checks/boundaries.ts",
43
+ "registry:generate": "node scripts/registry.ts --write",
44
+ "registry:check": "node scripts/registry.ts",
45
+ "rule-proofs": "node scripts/rule-proofs.ts",
46
+ "check:artium": "node scripts/artium.ts",
47
+ "test": "vitest run",
48
+ "prepack": "pnpm run build"
49
+ },
50
+ "dependencies": {
51
+ "@toon-format/toon": "4.4.0",
52
+ "ws": "8.23.0",
53
+ "zod": "4.6.7"
54
+ },
55
+ "devDependencies": {
56
+ "@eslint/js": "10.0.1",
57
+ "@types/node": "24.19.4",
58
+ "@types/ws": "8.18.2",
59
+ "eslint": "10.16.0",
60
+ "typescript": "6.0.3",
61
+ "typescript-eslint": "8.74.0",
62
+ "vitest": "5.1.2"
63
+ }
64
+ }
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: ha-axi
3
+ description: Manage a Home Assistant OS instance from the command line through the ha-axi AXI CLI. Use when an agent needs to inspect or administer Home Assistant core, states, actions, automations, scripts, scenes, registries, helpers or dashboards.
4
+ ---
5
+
6
+ # ha-axi
7
+
8
+ `ha-axi` is an Agent eXperience Interface (AXI) CLI for Home Assistant OS core administration.
9
+ The npm package is `@knowttl/ha-axi` and its command is `ha-axi`.
10
+ The package is awaiting its first npm release.
11
+ Output is TOON by default; errors are printed to stdout in the same structured format with a non-zero exit code.
12
+
13
+ ## Commands
14
+
15
+ - `ha-axi help` (or `ha-axi --help`): list every command with its effect (`read`, `write` or `passthrough`).
16
+ - `ha-axi --version`: print the installed version.
17
+ - `ha-axi auth status [--profile <name>] [--config <path>]`: show the selected profile, how it was selected, the origin, the token source (`env:<VAR>` or `file:<path>`), file protection, read-only state and write grants. It resolves the token but never prints it.
18
+ - `ha-axi profile list [--config <path>]`: list the profiles in `config.json`.
19
+ - `ha-axi profile set <name> [--config <path>] --origin <url> (--token-env <VAR> | --token-file <path>) [--allow-insecure-http] [--allow-writes] [--allow-op <grantId>]...`: create or replace a profile; it writes `config.json` atomically with private permissions and never accepts a token value.
20
+ - `ha-axi profile remove <name> [--config <path>]`: remove a profile.
21
+ - `ha-axi config path [--config <path>]`: print the `config.json` and `writes.log` paths.
22
+ - `ha-axi doctor [--profile <name>] [--config <path>]`: check the profile and token with one bounded `GET /api/config`; reports the Home Assistant version, state and component count.
23
+ - `ha-axi status [--profile <name>] [--config <path>]`: show the version, state, location, time zone, config source and component count.
24
+ - `ha-axi config check [--profile <name>] [--config <path>]`: validate the Home Assistant configuration; this `POST` is read-only and works under `HA_AXI_READ_ONLY=true`.
25
+ A configuration reported as `invalid` is a validation result with exit `0`.
26
+ - `ha-axi logs list [--level <level>]`: list system log entries at or above `debug`, `info`, `warning`, `error` or `critical`, with stored entry severity, source file and line, occurrence count, last occurrence and last retained distinct message.
27
+ The filter is case-insensitive.
28
+ Output includes the matched `count` and the unfiltered `total`.
29
+ - `ha-axi repairs list`: list repair issues with domain, issue ID, severity, `fixable` and `ignored`, plus the count of active (not ignored) issues.
30
+ - `ha-axi integrations list`: list integration config entries with domain, title, state and entry ID, plus the count of `loaded` entries.
31
+ - `ha-axi template render <template>`: render a Jinja2 template and print the text `result`; this `POST` is read-only and works under `HA_AXI_READ_ONLY=true`.
32
+ HTTP `400` returns `INVALID_ARGUMENT` with the redacted Home Assistant message, using the response text if there is no JSON string `message`.
33
+ If the HTTP `400` response exceeds 16 MiB, the diagnostic reports the size limit.
34
+ For `AUTH_FAILED` on HTTP `401`, check that the profile references a valid long-lived access token from a Home Assistant administrator account.
35
+ A successful response must be `text/plain` and fit within 16 MiB, or the command returns `INVALID_RESPONSE`.
36
+ Use `--` before a template that begins with a dash, as in `ha-axi template render -- -5`.
37
+ Put any options before `--`.
38
+ - `ha-axi history get <entity_id> --since <duration>` shows state rows (`time`, `state`) returned by Home Assistant's minimal history query.
39
+ The timeline starts with the state at the beginning of the window when available, followed by recorded updates that Home Assistant treats as significant.
40
+ For some domains, Home Assistant can include attribute-only updates, so consecutive rows may repeat a state.
41
+ - `ha-axi logbook list [--entity <entity_id>] --since <duration>`: list logbook entries (`when`, `name`, `entityId`, `event`) from that long ago until now.
42
+ The `event` field uses the entry's state when present, then its message, with `null` when both are absent.
43
+ Both commands take `--since` as a positive integer without leading zeroes followed by `s`, `m`, `h` or `d`, from 1 second to 365 days.
44
+ - Every diagnostics command accepts `--profile <name>` and `--config <path>`.
45
+ An empty list prints `count: 0` and replaces the rows with `0 results: <context>`.
46
+ - `ha-axi api <METHOD> <path> [--query <key>=<value>]... [--header <name>:<value>]... [--body-file <path> | --stdin] [--max-bytes <n>] [--timeout <ms>] [--profile <name>] [--config <path>]`: send a raw REST request under `/api/` and print the HTTP status and redacted vendor body.
47
+ - `ha-axi ws <type> [--payload-file <path> | --stdin] [--timeout <ms>] [--profile <name>] [--config <path>]`: send one raw WebSocket command with an optional JSON object payload and print `success` with the redacted `result` or vendor `error`.
48
+ ha-axi sets the envelope `id` and `type`, so leave them out of the payload.
49
+ - `ha-axi writes status <entryId>` and `ha-axi writes pending` inspect the local journal. See the [journal command contract](https://github.com/knowttl/ha-axi/blob/main/docs/design/design.md#write-journal-inspection).
50
+
51
+ Commands expecting JSON, including `doctor`, `status`, `config check` and the JSON diagnostics reads, return `INVALID_RESPONSE` when a successful upstream response has invalid JSON or an unexpected shape.
52
+ More command groups arrive unit by unit; `ha-axi --help` is always the authoritative list.
53
+
54
+ ## Credentials
55
+
56
+ - Profiles live in `$XDG_CONFIG_HOME/ha-axi/config.json` (default `~/.config/ha-axi/config.json`, `%APPDATA%\ha-axi\config.json` on Windows).
57
+ `--config` takes precedence over `HA_AXI_CONFIG` and the default location.
58
+ - `config path` resolves `writes.log` separately, using `HA_AXI_WRITE_LOG` when set.
59
+ Its default is `$XDG_STATE_HOME/ha-axi/writes.log` (fallback `~/.local/state/ha-axi/writes.log`, `%LOCALAPPDATA%\ha-axi\writes.log` on Windows).
60
+ - Profile changes preserve the permissions of an existing override directory.
61
+ On POSIX, the directory must be owned by the current user and must deny group and other write access.
62
+ On Windows, it must have a protected DACL that grants FullControl only to the current user, SYSTEM and Administrators.
63
+ - If a profile change reports an existing temporary file, retry after the active change finishes. If a process was interrupted, remove the temporary file only after confirming that no profile change is running.
64
+ - The profile is chosen by `--profile`, then `HA_AXI_PROFILE`, then a complete environment profile (`HA_AXI_ORIGIN` plus `HA_AXI_TOKEN`), then `defaultProfile`, then the only profile.
65
+ - The token is a Home Assistant long-lived access token referenced by a SecretRef (`{"env": "NAME"}` or `{"file": "/absolute/path"}`, default `{"env": "HA_AXI_TOKEN"}`); secrets are never accepted as flags or inline values.
66
+ - Use a bare `https://` origin without a trailing slash, path, credentials, query or fragment.
67
+ `allowInsecureHttp: true` (or `HA_AXI_ALLOW_INSECURE_HTTP=true` for the environment profile) permits `http://` only for loopback, RFC 1918, link-local, IPv6 ULA, `.local` or single-label LAN hosts.
68
+ `profile set` and `auth status` warn when the option is enabled for the profile.
69
+ - Through artium-axi, the host writes one `artium` profile per call that matches the packaged `axi-credential.schema.json`: HTTPS only, no `allowInsecureHttp`, and a token SecretRef the host supplies.
70
+ The packaged `artium-inventory.json` lists `profile set` and `profile remove` under `blockedCommands`, so they are unavailable there.
71
+
72
+ ## Safety model
73
+
74
+ - Follow the [dedicated write lifecycle](https://github.com/knowttl/ha-axi/blob/main/docs/design/design.md#write-lifecycle-preview-confirmation-pre-dispatch-intent-and-crash-recovery) for preview, confirmation, authorization and request-ID replay.
75
+ For an unresolved write, run `ha-axi writes status <entryId>` and check Home Assistant before deciding what to do next.
76
+ - Check the [raw fallback contract](https://github.com/knowttl/ha-axi/blob/main/docs/design/design.md#raw-api-fallbacks-passthrough-policy-single-classifier) before calling `api` or `ws` for its write passthrough, read-only setting, supported routes, refused inputs and response limits.