tauri-agent-tools 0.6.0 → 0.7.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/.agents/skills/tauri-agent-tools/SKILL.md +94 -5
- package/.agents/skills/tauri-bridge-setup/SKILL.md +45 -13
- package/.agents/skills/tauri-debug-quickstart/SKILL.md +80 -0
- package/README.md +71 -3
- package/dist/bridge/client.d.ts +17 -1
- package/dist/bridge/client.js +82 -1
- package/dist/bridge/client.js.map +1 -1
- package/dist/cli.js +25 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/appPaths.d.ts +2 -0
- package/dist/commands/appPaths.js +97 -0
- package/dist/commands/appPaths.js.map +1 -0
- package/dist/commands/capabilitiesAudit.d.ts +2 -0
- package/dist/commands/capabilitiesAudit.js +105 -0
- package/dist/commands/capabilitiesAudit.js.map +1 -0
- package/dist/commands/configInspect.d.ts +2 -0
- package/dist/commands/configInspect.js +223 -0
- package/dist/commands/configInspect.js.map +1 -0
- package/dist/commands/diagnose.d.ts +2 -0
- package/dist/commands/diagnose.js +311 -0
- package/dist/commands/diagnose.js.map +1 -0
- package/dist/commands/forensics.d.ts +2 -0
- package/dist/commands/forensics.js +331 -0
- package/dist/commands/forensics.js.map +1 -0
- package/dist/commands/health.d.ts +2 -0
- package/dist/commands/health.js +39 -0
- package/dist/commands/health.js.map +1 -0
- package/dist/commands/osLogs.d.ts +2 -0
- package/dist/commands/osLogs.js +130 -0
- package/dist/commands/osLogs.js.map +1 -0
- package/dist/commands/processTree.d.ts +2 -0
- package/dist/commands/processTree.js +45 -0
- package/dist/commands/processTree.js.map +1 -0
- package/dist/commands/sidecarReplay.d.ts +7 -0
- package/dist/commands/sidecarReplay.js +93 -0
- package/dist/commands/sidecarReplay.js.map +1 -0
- package/dist/commands/sidecarTap.d.ts +2 -0
- package/dist/commands/sidecarTap.js +118 -0
- package/dist/commands/sidecarTap.js.map +1 -0
- package/dist/commands/webviewAttach.d.ts +2 -0
- package/dist/commands/webviewAttach.js +64 -0
- package/dist/commands/webviewAttach.js.map +1 -0
- package/dist/platform/oslog/darwin.d.ts +21 -0
- package/dist/platform/oslog/darwin.js +72 -0
- package/dist/platform/oslog/darwin.js.map +1 -0
- package/dist/platform/oslog/linux.d.ts +16 -0
- package/dist/platform/oslog/linux.js +47 -0
- package/dist/platform/oslog/linux.js.map +1 -0
- package/dist/platform/oslog/windows.d.ts +15 -0
- package/dist/platform/oslog/windows.js +16 -0
- package/dist/platform/oslog/windows.js.map +1 -0
- package/dist/schemas/bridge.d.ts +222 -0
- package/dist/schemas/bridge.js +44 -0
- package/dist/schemas/bridge.js.map +1 -1
- package/dist/schemas/osLog.d.ts +34 -0
- package/dist/schemas/osLog.js +18 -0
- package/dist/schemas/osLog.js.map +1 -0
- package/dist/schemas/sidecar.d.ts +33 -0
- package/dist/schemas/sidecar.js +17 -0
- package/dist/schemas/sidecar.js.map +1 -0
- package/dist/schemas/tauriConfig.d.ts +825 -0
- package/dist/schemas/tauriConfig.js +102 -0
- package/dist/schemas/tauriConfig.js.map +1 -0
- package/dist/util/ndjson.d.ts +37 -0
- package/dist/util/ndjson.js +82 -0
- package/dist/util/ndjson.js.map +1 -0
- package/dist/util/tauriConfig.d.ts +63 -0
- package/dist/util/tauriConfig.js +235 -0
- package/dist/util/tauriConfig.js.map +1 -0
- package/examples/frontend-stub/index.html +1 -0
- package/examples/tauri-bridge/Cargo.toml +6 -0
- package/examples/tauri-bridge/build.rs +3 -0
- package/examples/tauri-bridge/icons/icon.png +0 -0
- package/examples/tauri-bridge/src/dev_bridge.rs +424 -11
- package/examples/tauri-bridge/tauri.conf.json +25 -0
- package/package.json +3 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tauri-agent-tools
|
|
3
|
-
description: CLI for inspecting and interacting with Tauri desktop apps — DOM queries, screenshots, interaction (click/type/scroll), IPC monitoring, store inspection, structured assertions
|
|
4
|
-
version: 0.
|
|
5
|
-
tags: [tauri, desktop, debugging, screenshot, dom, inspection, diff, mutations, snapshot, interaction, click, type, scroll, invoke, probe, capture, check, store-inspect]
|
|
3
|
+
description: CLI for inspecting and interacting with Tauri desktop apps — DOM queries, screenshots, interaction (click/type/scroll), IPC monitoring, store inspection, structured assertions, plus bridge-free diagnostics (OS logs, app paths, sidecar NDJSON tap/replay, forensic bundles) and the `diagnose` super-command for one-shot triage
|
|
4
|
+
version: 0.7.0
|
|
5
|
+
tags: [tauri, desktop, debugging, screenshot, dom, inspection, diff, mutations, snapshot, interaction, click, type, scroll, invoke, probe, capture, check, store-inspect, forensics, os-logs, app-paths, sidecar, config-inspect, diagnose]
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# tauri-agent-tools
|
|
@@ -33,16 +33,40 @@ npm install -g tauri-agent-tools
|
|
|
33
33
|
Some commands require the Rust dev bridge running inside the Tauri app. Others work standalone.
|
|
34
34
|
|
|
35
35
|
**Bridge required** (needs running Tauri app with bridge):
|
|
36
|
-
`screenshot --selector`, `dom`, `eval`, `wait --selector`, `wait --eval`, `ipc-monitor`, `console-monitor`, `rust-logs`, `storage`, `page-state`, `mutations`, `snapshot`, `click`, `type`, `scroll`, `focus`, `navigate`, `select`, `invoke`, `capture`, `check`, `store-inspect`
|
|
36
|
+
`screenshot --selector`, `dom`, `eval`, `wait --selector`, `wait --eval`, `ipc-monitor`, `console-monitor`, `rust-logs`, `storage`, `page-state`, `mutations`, `snapshot`, `click`, `type`, `scroll`, `focus`, `navigate`, `select`, `invoke`, `capture`, `check`, `store-inspect`, `process-tree` *(v0.7+)*, `capabilities audit` *(v0.7+)*, `webview attach` *(v0.7+)*, `health` *(v0.7+)*
|
|
37
37
|
|
|
38
38
|
**Standalone** (no bridge needed):
|
|
39
|
-
`screenshot --title` (full window only), `wait --title`, `list-windows`, `info`, `diff`
|
|
39
|
+
`screenshot --title` (full window only), `wait --title`, `list-windows`, `info`, `diff`, `app-paths`, `config inspect`, `os-logs`, `sidecar tap`, `sidecar replay`, `forensics`
|
|
40
40
|
|
|
41
41
|
**Optional bridge:**
|
|
42
42
|
`probe` (works standalone to discover bridges, richer output with bridge)
|
|
43
43
|
|
|
44
44
|
The bridge auto-discovers via token files in `/tmp/tauri-dev-bridge-*.token`. No manual port/token configuration needed.
|
|
45
45
|
|
|
46
|
+
## Don't know where to start? `diagnose`
|
|
47
|
+
|
|
48
|
+
When something's wrong and you're not sure why, run:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
tauri-agent-tools diagnose --config ./src-tauri -o ./diagnose-out
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`diagnose` is a best-effort super-command. It always runs the bridge-free forensics half; if a dev bridge is reachable it also layers `/process`, `/capabilities`, `/devtools`, `/health` data. The master `summary.md` lists "Next steps" pointing at the right deeper command. See the [`tauri-debug-quickstart`](../tauri-debug-quickstart/SKILL.md) skill for a full symptom-to-command decision tree.
|
|
55
|
+
|
|
56
|
+
## Debugging decision tree (precision form)
|
|
57
|
+
|
|
58
|
+
When you know what you're looking at, jump straight to:
|
|
59
|
+
|
|
60
|
+
| Symptom | First command |
|
|
61
|
+
|---------|---------------|
|
|
62
|
+
| Don't know — give me everything | `tauri-agent-tools diagnose -o ./diag` |
|
|
63
|
+
| App is running and bridge is responding | Use the bridge-mediated commands listed above (`screenshot`, `dom`, `eval`, …) |
|
|
64
|
+
| Bridge isn't responding (release build, app crashed, pre-webview boot failure) | `tauri-agent-tools forensics -o ./forensics-out` |
|
|
65
|
+
| You only have the bundle id, no source tree | `tauri-agent-tools app-paths --identifier com.example.app --platform all --exists` |
|
|
66
|
+
| Need a structured snapshot of `tauri.conf.json` + capabilities | `tauri-agent-tools config inspect --json` |
|
|
67
|
+
| Suspicion: a sidecar process is emitting malformed/unexpected NDJSON | Run the sidecar under `tauri-agent-tools sidecar tap --schema <path> -- <cmd>` instead of under Tauri |
|
|
68
|
+
| OS-level error visible in Console.app/journalctl but not in app logs | `tauri-agent-tools os-logs --identifier com.example.app --level error --duration 30000` |
|
|
69
|
+
|
|
46
70
|
## Core Workflows
|
|
47
71
|
|
|
48
72
|
### Inspect DOM then screenshot an element
|
|
@@ -120,6 +144,60 @@ tauri-agent-tools rust-logs --source sidecar --duration 10000 --json
|
|
|
120
144
|
tauri-agent-tools rust-logs --source sidecar:ffmpeg --duration 5000 --json
|
|
121
145
|
```
|
|
122
146
|
|
|
147
|
+
### Bridge-extended diagnostics (process tree, capabilities, devtools, health — requires bridge v0.7.0+)
|
|
148
|
+
|
|
149
|
+
Four commands that talk to new endpoints on the dev bridge. Each calls `GET /version` first to feature-detect and emits a clear "requires bridge v0.7.0+ — re-copy dev_bridge.rs" error against older bridges.
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
# Tauri PID + registered sidecars (uses /process)
|
|
153
|
+
tauri-agent-tools process-tree --json
|
|
154
|
+
|
|
155
|
+
# Devtron-style live capability audit (uses /capabilities)
|
|
156
|
+
tauri-agent-tools capabilities audit --json
|
|
157
|
+
# findings[] flag wildcard "*", over-broad shell:/fs:/http: scopes,
|
|
158
|
+
# capabilities that reference window labels not actually registered, etc.
|
|
159
|
+
|
|
160
|
+
# Inspector URL or platform hint (uses /devtools)
|
|
161
|
+
tauri-agent-tools webview attach # human-readable with hint
|
|
162
|
+
tauri-agent-tools webview attach --print-url # URL alone (empty if none)
|
|
163
|
+
tauri-agent-tools webview attach --open # launch in default browser
|
|
164
|
+
|
|
165
|
+
# "Is this app sick" check (uses /health). Exits non-zero on unhealthy.
|
|
166
|
+
tauri-agent-tools health --json
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Sidecars only appear in `process-tree` / `health` if integrators register them — either by passing `Some(®istry)` to `dev_bridge::spawn_sidecar_monitored`, or by calling `dev_bridge::register_sidecar` after their own spawn.
|
|
170
|
+
|
|
171
|
+
### Bridge-free diagnostics (post-mortem & sidecar workflows)
|
|
172
|
+
|
|
173
|
+
These six commands need no live bridge — useful for release builds, dead apps, and sidecar processes.
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# Resolve the app's OS data/log/cache/config dirs from tauri.conf.json
|
|
177
|
+
tauri-agent-tools app-paths --config ./src-tauri --json
|
|
178
|
+
# All three platforms (handy for cross-OS forensics)
|
|
179
|
+
tauri-agent-tools app-paths --config ./src-tauri --platform all --exists
|
|
180
|
+
|
|
181
|
+
# Structured snapshot of the app config + capability/permission audit
|
|
182
|
+
tauri-agent-tools config inspect --config ./src-tauri --json
|
|
183
|
+
# warnings[] flags wildcard "*" perms, fs:allow-all, capabilities referencing
|
|
184
|
+
# plugins not declared in Cargo.toml, sidecars declared without tauri-plugin-shell.
|
|
185
|
+
|
|
186
|
+
# OS-level log tail, filtered to a Tauri bundle id (NDJSON one-per-line)
|
|
187
|
+
tauri-agent-tools os-logs --identifier com.example.app --duration 5000
|
|
188
|
+
tauri-agent-tools os-logs --level error --source main --duration 30000
|
|
189
|
+
|
|
190
|
+
# Run a sidecar under a tap to see its stdio + validate against a JSON Schema
|
|
191
|
+
tauri-agent-tools sidecar tap --schema ./schema.json --record /tmp/run.ndjson -- node my-sidecar.js
|
|
192
|
+
# Replay deterministically
|
|
193
|
+
tauri-agent-tools sidecar replay /tmp/run.ndjson --to-exec node my-sidecar.js --rate 100
|
|
194
|
+
|
|
195
|
+
# One-shot forensic bundle for post-crash analysis. Works on a DEAD app.
|
|
196
|
+
tauri-agent-tools forensics --config ./src-tauri -o ./forensics-out
|
|
197
|
+
# → ./forensics-out/{summary.md,summary.json,project.json,app-log-tail.txt,live-os-log.ndjson}
|
|
198
|
+
# summary.md includes detected panic markers + suggested next commands.
|
|
199
|
+
```
|
|
200
|
+
|
|
123
201
|
### Watch DOM mutations
|
|
124
202
|
|
|
125
203
|
```bash
|
|
@@ -237,6 +315,17 @@ tauri-agent-tools eval "document.title" --window-label overlay --json
|
|
|
237
315
|
| `capture` | `-o <dir>`, `-s <css>`, `--logs-duration <ms>`, `--json` | yes | Full debug evidence bundle |
|
|
238
316
|
| `check` | `--selector`, `--text`, `--eval`, `--no-errors`, `--json` | yes | Structured assertions (exit 0/1) |
|
|
239
317
|
| `store-inspect` | `--framework`, `--store <name>`, `--depth <n>`, `--json` | yes | Inspect reactive store state |
|
|
318
|
+
| `app-paths` | `--config <path>`, `--identifier <id>`, `--platform <os>`, `--exists`, `--json` | no | Resolve Tauri 2 app's OS data/log/cache/config dirs |
|
|
319
|
+
| `config inspect` | `--config <path>`, `--capabilities-dir <path>`, `--cargo-toml <path>`, `--json` | no | Structured `tauri.conf.json` snapshot + capability audit |
|
|
320
|
+
| `os-logs` | `--identifier <id>`, `--level <lvl>`, `--source <src>`, `--since <dur>`, `--duration <ms>`, `--json` | no | Tail host OS log stream filtered to a Tauri bundle id |
|
|
321
|
+
| `sidecar tap` | `-- <cmd...>`, `--schema <path>`, `--record <path>`, `--raw`, `--json` | no | Wrap-and-run a sidecar, frame NDJSON, validate envelopes |
|
|
322
|
+
| `sidecar replay` | `<file>`, `--to-exec <cmd>`, `--rate <lps>`, `--loop` | no | Replay a recorded NDJSON sidecar stream |
|
|
323
|
+
| `forensics` | `--config <path>`, `--identifier <id>`, `-o <dir>`, `--since <dur>`, `--json` | no | One-shot forensic bundle (works on dead apps) |
|
|
324
|
+
| `process-tree` | `--json` | yes (v0.7+) | Tauri PID + registered sidecars with alive/DEAD status |
|
|
325
|
+
| `capabilities audit` | `--json` | yes (v0.7+) | Live Devtron-style audit of declared Tauri capabilities |
|
|
326
|
+
| `webview attach` | `--print-url`, `--open`, `--json` | yes (v0.7+) | Print webview inspector URL or platform hint |
|
|
327
|
+
| `health` | `--json` | yes (v0.7+) | Uptime + webview/sidecar liveness (exit non-zero if unhealthy) |
|
|
328
|
+
| `diagnose` | `--config <path>`, `-o <dir>`, `--since <dur>`, `--no-bridge`, `--json` | optional | Best-effort super-bundle (forensics + live bridge enrichment) |
|
|
240
329
|
|
|
241
330
|
## Targeting Flags
|
|
242
331
|
|
|
@@ -1,26 +1,34 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tauri-bridge-setup
|
|
3
3
|
description: How to add the tauri-agent-tools Rust dev bridge to a Tauri application
|
|
4
|
-
version: 0.
|
|
5
|
-
tags: [tauri, rust, bridge, setup, integration, multi-window]
|
|
4
|
+
version: 0.7.0
|
|
5
|
+
tags: [tauri, rust, bridge, setup, integration, multi-window, process-tree, capabilities, devtools, health]
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Tauri Dev Bridge Setup
|
|
9
9
|
|
|
10
|
-
Add the dev bridge to a Tauri app so `tauri-agent-tools` can inspect DOM, evaluate JS, monitor IPC, take element screenshots, and interact with the UI.
|
|
10
|
+
Add the dev bridge to a Tauri app so `tauri-agent-tools` can inspect DOM, evaluate JS, monitor IPC, take element screenshots, and interact with the UI. Bridge v0.7 also exposes process tree, capability audit, devtools URL, and health endpoints.
|
|
11
11
|
|
|
12
12
|
The bridge runs **only in debug builds** and is stripped from release builds automatically.
|
|
13
13
|
|
|
14
|
+
## Re-copying for v0.7
|
|
15
|
+
|
|
16
|
+
> **Upgrading from v0.6:** The bridge surface grew with four new endpoints (`/process`, `/capabilities`, `/devtools`, `/health`) and `start_bridge` now returns a third tuple element (the sidecar registry). **Re-copy `dev_bridge.rs` from the latest `examples/tauri-bridge/src/dev_bridge.rs`** and adjust your `main.rs` to destructure the new return shape (see Step 3 below). The CLI's new commands (`process-tree`, `capabilities audit`, `webview attach`, `health`) feature-detect via `GET /version` and emit a clear "requires v0.7.0+" error when the bridge is older — so partial upgrades fail loudly rather than silently.
|
|
17
|
+
|
|
14
18
|
## Bridge Endpoints
|
|
15
19
|
|
|
16
|
-
The bridge exposes
|
|
20
|
+
The bridge exposes eight HTTP endpoints on a random localhost port:
|
|
17
21
|
|
|
18
22
|
| Endpoint | Method | Auth | Purpose |
|
|
19
23
|
|----------|--------|------|---------|
|
|
20
24
|
| `/eval` | POST | token | Evaluate JS in a webview (supports `window` param for multi-window) |
|
|
21
25
|
| `/logs` | POST | token | Drain Rust tracing logs and sidecar output |
|
|
22
26
|
| `/describe` | POST | token | Report PID, window labels, and capabilities |
|
|
23
|
-
| `/version` | GET | none | Bridge version and available endpoints |
|
|
27
|
+
| `/version` | GET | none | Bridge version and available endpoints (used for feature detection) |
|
|
28
|
+
| `/process` | POST | token | Tauri PID + registered sidecars (powers `process-tree`) — **v0.7+** |
|
|
29
|
+
| `/capabilities` | POST | token | Declared Tauri capability set + live window labels (powers `capabilities audit`) — **v0.7+** |
|
|
30
|
+
| `/devtools` | POST | token | Webview inspector URL or platform hint (powers `webview attach`) — **v0.7+** |
|
|
31
|
+
| `/health` | POST | token | Uptime + webview readiness + sidecar liveness (powers `health`) — **v0.7+** |
|
|
24
32
|
|
|
25
33
|
## Step 1 — Add Cargo dependencies
|
|
26
34
|
|
|
@@ -35,8 +43,13 @@ rand = "0.8"
|
|
|
35
43
|
uuid = { version = "1", features = ["v4"] }
|
|
36
44
|
tracing = "0.1"
|
|
37
45
|
tracing-subscriber = { version = "0.3", features = ["registry"] }
|
|
46
|
+
|
|
47
|
+
[target.'cfg(unix)'.dependencies]
|
|
48
|
+
libc = "0.2"
|
|
38
49
|
```
|
|
39
50
|
|
|
51
|
+
(`libc` is used for the cheap `kill(pid, 0)` aliveness probe powering `/process` and `/health` sidecar reporting. Windows is supported but skips the liveness check in v0.7.)
|
|
52
|
+
|
|
40
53
|
## Step 2 — Copy the bridge module
|
|
41
54
|
|
|
42
55
|
Copy `dev_bridge.rs` from the tauri-agent-tools package into your project:
|
|
@@ -74,6 +87,9 @@ fn main() {
|
|
|
74
87
|
builder
|
|
75
88
|
.setup(|app| {
|
|
76
89
|
if cfg!(debug_assertions) {
|
|
90
|
+
// start_bridge returns (port, LogBuffer, SidecarRegistry).
|
|
91
|
+
// Hold onto the registry if you plan to spawn sidecars; otherwise
|
|
92
|
+
// the bound `let _` keeps it alive for the app's lifetime.
|
|
77
93
|
if let Err(e) = dev_bridge::start_bridge(app.handle()).map(|_| ()) {
|
|
78
94
|
eprintln!("Warning: Failed to start dev bridge: {e}");
|
|
79
95
|
}
|
|
@@ -132,25 +148,41 @@ tauri-agent-tools probe --json
|
|
|
132
148
|
# → { "bridges": [{ "windows": ["main", "overlay", "settings"], ... }] }
|
|
133
149
|
```
|
|
134
150
|
|
|
135
|
-
## Optional: Sidecar Log Capture
|
|
151
|
+
## Optional: Sidecar Log Capture + Process Visibility
|
|
136
152
|
|
|
137
|
-
To capture stdout/stderr from sidecar processes (external binaries)
|
|
153
|
+
To capture stdout/stderr from sidecar processes (external binaries) AND have them show up in `process-tree`/`health`, use `spawn_sidecar_monitored()` and pass the registry returned by `start_bridge`:
|
|
138
154
|
|
|
139
155
|
```rust
|
|
140
156
|
if cfg!(debug_assertions) {
|
|
141
|
-
let (_port, log_buffer) = dev_bridge::start_bridge(app.handle())?;
|
|
157
|
+
let (_port, log_buffer, sidecar_registry) = dev_bridge::start_bridge(app.handle())?;
|
|
142
158
|
|
|
143
|
-
// Spawn a sidecar with monitored output
|
|
159
|
+
// Spawn a sidecar with monitored output AND registry tracking
|
|
144
160
|
dev_bridge::spawn_sidecar_monitored(
|
|
145
|
-
"ffmpeg",
|
|
146
|
-
"ffmpeg",
|
|
147
|
-
&["-i", "input.mp4", "-f", "null", "-"],
|
|
161
|
+
"ffmpeg", // name (source: "sidecar:ffmpeg")
|
|
162
|
+
"ffmpeg", // command
|
|
163
|
+
&["-i", "input.mp4", "-f", "null", "-"], // args
|
|
148
164
|
&log_buffer,
|
|
165
|
+
Some(&sidecar_registry), // register for /process + /health
|
|
149
166
|
)?;
|
|
150
167
|
}
|
|
151
168
|
```
|
|
152
169
|
|
|
153
|
-
|
|
170
|
+
Pass `None` for the registry argument to opt out of process tracking (useful for ephemeral one-shot helpers).
|
|
171
|
+
|
|
172
|
+
If you spawn children with your own mechanism, register them after the fact so they appear in `process-tree`:
|
|
173
|
+
|
|
174
|
+
```rust
|
|
175
|
+
let child = my_own_spawn(...)?;
|
|
176
|
+
dev_bridge::register_sidecar(
|
|
177
|
+
&sidecar_registry,
|
|
178
|
+
"my-helper",
|
|
179
|
+
child.id(),
|
|
180
|
+
Some("/path/to/binary".to_string()),
|
|
181
|
+
vec!["--mode=watch".to_string()],
|
|
182
|
+
);
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Then monitor with: `tauri-agent-tools rust-logs --source sidecar --duration 10000`, view the tree with `tauri-agent-tools process-tree`, and check liveness with `tauri-agent-tools health`.
|
|
154
186
|
|
|
155
187
|
## Troubleshooting
|
|
156
188
|
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tauri-debug-quickstart
|
|
3
|
+
description: First-30-seconds triage for a broken Tauri desktop app. Pick the right command for the symptom you're seeing, with one-line escalations to deeper skills.
|
|
4
|
+
version: 0.7.0
|
|
5
|
+
tags: [tauri, debugging, triage, quickstart, decision-tree, forensics, diagnose]
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Tauri Debug Quickstart
|
|
9
|
+
|
|
10
|
+
When something is wrong with a Tauri app, the first 30 seconds matter — they decide whether you spend the next hour reading the right logs or the wrong ones. This skill points you at the right `tauri-agent-tools` command for the symptom you're seeing.
|
|
11
|
+
|
|
12
|
+
## The single-command answer
|
|
13
|
+
|
|
14
|
+
If you don't know where to start, run this first:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
tauri-agent-tools diagnose --config ./src-tauri -o ./diagnose-out
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
`diagnose` is a best-effort super-command that:
|
|
21
|
+
|
|
22
|
+
1. Resolves the app's config + OS data/log paths
|
|
23
|
+
2. Runs a forensics bundle (works even on dead apps — tails app logs for panics, pulls macOS DiagnosticReports, lists app-data files)
|
|
24
|
+
3. If a live dev bridge is reachable, layers `/process`, `/capabilities`, `/devtools`, `/health` data on top
|
|
25
|
+
4. Writes a master `summary.md` with detected anomalies and suggested next steps
|
|
26
|
+
|
|
27
|
+
Then open `./diagnose-out/summary.md` and follow the "Next steps" section.
|
|
28
|
+
|
|
29
|
+
## Symptom → command (when you need precision)
|
|
30
|
+
|
|
31
|
+
Pick the row that matches what's broken. Each command works without the bridge unless noted.
|
|
32
|
+
|
|
33
|
+
| Symptom | First command | Why |
|
|
34
|
+
|---|---|---|
|
|
35
|
+
| Don't know what's wrong | `tauri-agent-tools diagnose -o ./diag` | Everything-bundle; graceful on dead apps |
|
|
36
|
+
| App crashed at startup | `tauri-agent-tools forensics --config ./src-tauri -o ./forensics` | Reads app log + DiagnosticReports without needing a live process |
|
|
37
|
+
| App is running but bridge isn't responding | `tauri-agent-tools probe` | Detects whether the bridge process is up and shows token-file state |
|
|
38
|
+
| App is running, bridge is up, but webview looks wrong | `tauri-agent-tools health --json` *(needs bridge v0.7+)* | Returns webview_ready + sidecar liveness in one call |
|
|
39
|
+
| A sidecar process is the suspect | `tauri-agent-tools sidecar tap --schema ./schema.json -- <cmd>` | Wrap-and-run the sidecar standalone; frame NDJSON; validate envelopes |
|
|
40
|
+
| Need to know exactly which files the app touches | `tauri-agent-tools app-paths --config ./src-tauri --exists` | Resolves Tauri 2's per-platform `app_data_dir`/`app_log_dir`/etc. + checks existence |
|
|
41
|
+
| Need to audit Tauri capabilities for over-broad permissions | `tauri-agent-tools config inspect --config ./src-tauri` (static) **or** `tauri-agent-tools capabilities audit` (live, needs bridge v0.7+) | Flags `*`, `fs:allow-all`, `shell:allow-spawn`, etc. |
|
|
42
|
+
| OS-level error visible in Console.app or journalctl | `tauri-agent-tools os-logs --identifier com.example.app --level error --duration 30000` | Filters platform log stream to the Tauri bundle id |
|
|
43
|
+
| Inspector / webview attach | `tauri-agent-tools webview attach` *(needs bridge v0.7+)* | Returns inspector URL or platform-specific hint |
|
|
44
|
+
| What sidecars did this app spawn? | `tauri-agent-tools process-tree --json` *(needs bridge v0.7+)* | Tauri PID + registered sidecars with alive/dead per-PID |
|
|
45
|
+
|
|
46
|
+
## Decision tree
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
The app is...
|
|
50
|
+
│
|
|
51
|
+
├── crashed / not running ────────► forensics
|
|
52
|
+
│ └─ no source on hand? ────────► forensics --identifier com.foo.bar
|
|
53
|
+
│
|
|
54
|
+
├── running but bridge down ──────► probe → fix bridge → retry
|
|
55
|
+
│
|
|
56
|
+
└── running, bridge up
|
|
57
|
+
├── webview misbehaving ──────► health → snapshot → capabilities audit
|
|
58
|
+
├── sidecar suspected ────────► sidecar tap (run sidecar under it standalone)
|
|
59
|
+
├── IPC slow / wrong ─────────► ipc-monitor → check
|
|
60
|
+
└── DOM / UI inspection ──────► dom → screenshot → eval
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
When in doubt, escalate to `diagnose` — its `summary.md` will tell you which deeper command to use.
|
|
64
|
+
|
|
65
|
+
## Output conventions
|
|
66
|
+
|
|
67
|
+
- All commands accept `--json` for machine-readable output.
|
|
68
|
+
- Bundle commands (`forensics`, `diagnose`) write a `summary.md` agents can open directly and a `summary.json` agents can parse.
|
|
69
|
+
- Streaming commands (`os-logs`, `rust-logs`, `sidecar tap`) emit one NDJSON envelope per line on stdout.
|
|
70
|
+
- Bridge v0.7+ commands feature-detect via `GET /version` and emit a clear "re-copy dev_bridge.rs" error against older bridges.
|
|
71
|
+
|
|
72
|
+
## When this skill is wrong
|
|
73
|
+
|
|
74
|
+
This guidance assumes the agent is inspecting a Tauri 2 desktop app on macOS or Linux. Caveats:
|
|
75
|
+
|
|
76
|
+
- **Tauri 1 apps** — the `dirs`/`directories-next` path semantics that `app-paths` encodes match Tauri 2's `PathResolver`. Tauri 1's paths differ; some derived paths will be slightly off.
|
|
77
|
+
- **Windows** — `os-logs` is stubbed in v0.7 (the Windows event log adapter is planned). `forensics` and `diagnose` still produce useful bundles on Windows; they just skip the live OS-log tail.
|
|
78
|
+
- **The dev bridge requires `cfg!(debug_assertions)`** — release builds strip it, so bridge-dependent commands won't work against signed/notarized release artifacts. Use bridge-free commands (`forensics`, `app-paths`, `os-logs`, `config inspect`, `sidecar tap`) for those.
|
|
79
|
+
|
|
80
|
+
For deeper how-tos see the [`tauri-agent-tools`](../tauri-agent-tools/SKILL.md) skill. For bridge integration setup (Rust side), see [`tauri-bridge-setup`](../tauri-bridge-setup/SKILL.md).
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
**Agent-driven inspection toolkit for Tauri desktop apps**
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
36 commands to screenshot, inspect, interact with, monitor, post-mortem, audit, and diagnose Tauri apps from the CLI.
|
|
8
8
|
|
|
9
9
|
[](https://github.com/cesarandreslopez/tauri-agent-tools/actions/workflows/ci.yml)
|
|
10
10
|
[](https://www.npmjs.com/package/tauri-agent-tools)
|
|
@@ -284,6 +284,74 @@ All bridge-dependent commands support:
|
|
|
284
284
|
| `--pid <n>` | Target a specific app by PID |
|
|
285
285
|
| `--window-label <label>` | Target a specific webview window (default: main) |
|
|
286
286
|
|
|
287
|
+
## Don't know where to start? `diagnose`
|
|
288
|
+
|
|
289
|
+
When something's wrong and you're not sure why, run this first:
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
tauri-agent-tools diagnose --config ./src-tauri -o ./diagnose-out
|
|
293
|
+
# → ./diagnose-out/summary.md (master report with "Next steps")
|
|
294
|
+
# → ./diagnose-out/forensics/ (Tier 1 bundle: log tail, panics, paths)
|
|
295
|
+
# → ./diagnose-out/bridge.json (Tier 2 bridge data when reachable)
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
`diagnose` is a best-effort super-command. It works on dead apps. It layers bridge data on top when a dev bridge is reachable, degrades cleanly when not, and the master `summary.md` includes a "Next steps" section pointing at the right deeper command. Pass `--no-bridge` to skip the bridge phase entirely.
|
|
299
|
+
|
|
300
|
+
See [`docs/troubleshooting/decision-tree.md`](docs/troubleshooting/decision-tree.md) for the full symptom → command flowchart.
|
|
301
|
+
|
|
302
|
+
## Bridge-extending diagnostics (new in 0.7, requires bridge v0.7.0+)
|
|
303
|
+
|
|
304
|
+
Four commands that talk to new dev-bridge endpoints. Each feature-detects via `GET /version` and surfaces an actionable upgrade error when the bridge is older than v0.7.0.
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
# Tauri PID + registered sidecars
|
|
308
|
+
tauri-agent-tools process-tree --json
|
|
309
|
+
|
|
310
|
+
# Live capability audit (vs. config inspect which reads JSON files)
|
|
311
|
+
tauri-agent-tools capabilities audit --json
|
|
312
|
+
|
|
313
|
+
# Webview inspector URL or platform hint
|
|
314
|
+
tauri-agent-tools webview attach --print-url
|
|
315
|
+
tauri-agent-tools webview attach --open
|
|
316
|
+
|
|
317
|
+
# Quick "is this app sick" check — exits non-zero when unhealthy (CI-friendly)
|
|
318
|
+
tauri-agent-tools health --json
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
> **Integrators upgrading from v0.6:** Re-copy `examples/tauri-bridge/src/dev_bridge.rs` into your app. `start_bridge` now returns a third tuple element (`SidecarRegistry`); pass it to `spawn_sidecar_monitored` so sidecars show up in `process-tree`/`health`. See `.agents/skills/tauri-bridge-setup/SKILL.md` for the full upgrade walkthrough.
|
|
322
|
+
|
|
323
|
+
## Bridge-free diagnostics (new in 0.7)
|
|
324
|
+
|
|
325
|
+
Six commands that work **without** the dev bridge — for release builds, dead apps, and sidecar processes that the bridge can't reach.
|
|
326
|
+
|
|
327
|
+
```bash
|
|
328
|
+
# Resolve Tauri 2's OS data/log/cache/config dirs from tauri.conf.json
|
|
329
|
+
tauri-agent-tools app-paths --config ./src-tauri --json
|
|
330
|
+
tauri-agent-tools app-paths --identifier com.example.app --platform all --exists
|
|
331
|
+
|
|
332
|
+
# Structured "tauri info --json" + capability/permission audit
|
|
333
|
+
tauri-agent-tools config inspect --config ./src-tauri --json
|
|
334
|
+
# Warnings: wildcard permissions, fs:allow-all, capability/Cargo.toml plugin mismatches
|
|
335
|
+
|
|
336
|
+
# Tail OS logs filtered to a Tauri bundle id (NDJSON envelopes)
|
|
337
|
+
tauri-agent-tools os-logs --identifier com.example.app --duration 5000
|
|
338
|
+
tauri-agent-tools os-logs --level error --source main --duration 30000
|
|
339
|
+
|
|
340
|
+
# Wrap a sidecar, frame its stdout as NDJSON, validate against a JSON Schema
|
|
341
|
+
tauri-agent-tools sidecar tap --schema ./schema.json --record /tmp/run.ndjson -- node my-sidecar.js
|
|
342
|
+
# Replay the recording deterministically — to stdout or into a fresh sidecar's stdin
|
|
343
|
+
tauri-agent-tools sidecar replay /tmp/run.ndjson --to-exec node my-sidecar.js --rate 100
|
|
344
|
+
|
|
345
|
+
# Forensic bundle for post-crash analysis (composes the above; works on dead apps)
|
|
346
|
+
tauri-agent-tools forensics --config ./src-tauri -o ./forensics-out
|
|
347
|
+
# → ./forensics-out/{summary.md,summary.json,project.json,app-log-tail.txt,live-os-log.ndjson}
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
When to reach for them:
|
|
351
|
+
- **The bridge isn't responding** → start with `forensics`.
|
|
352
|
+
- **A sidecar is the suspect** → run it under `sidecar tap` instead of under Tauri.
|
|
353
|
+
- **You don't have source on hand, just a bundle id** → `app-paths --identifier com.example.app`.
|
|
354
|
+
|
|
287
355
|
## How It Works
|
|
288
356
|
|
|
289
357
|
```
|
|
@@ -349,7 +417,7 @@ This package ships [Agent Skills](https://agentskills.io) so AI coding agents ca
|
|
|
349
417
|
|
|
350
418
|
| Skill | Description |
|
|
351
419
|
|-------|-------------|
|
|
352
|
-
| `tauri-agent-tools` | Using all
|
|
420
|
+
| `tauri-agent-tools` | Using all 36 CLI commands to inspect and interact with Tauri apps |
|
|
353
421
|
| `tauri-bridge-setup` | Adding the Rust dev bridge to a Tauri project |
|
|
354
422
|
|
|
355
423
|
<details>
|
|
@@ -403,7 +471,7 @@ Full documentation is available at the [docs site](https://cesarandreslopez.gith
|
|
|
403
471
|
- [Installation](https://cesarandreslopez.github.io/tauri-agent-tools/getting-started/installation/) — system requirements and setup
|
|
404
472
|
- [Quick Start](https://cesarandreslopez.github.io/tauri-agent-tools/getting-started/quick-start/) — get running in 5 minutes
|
|
405
473
|
- [Bridge Setup](https://cesarandreslopez.github.io/tauri-agent-tools/getting-started/bridge-setup/) — integrate the Rust bridge into your Tauri app
|
|
406
|
-
- [Command Reference](https://cesarandreslopez.github.io/tauri-agent-tools/commands/) — all
|
|
474
|
+
- [Command Reference](https://cesarandreslopez.github.io/tauri-agent-tools/commands/) — all 36 commands with examples
|
|
407
475
|
- [Platform Support](https://cesarandreslopez.github.io/tauri-agent-tools/platform-support/) — X11, Wayland, macOS details
|
|
408
476
|
- [Architecture](https://cesarandreslopez.github.io/tauri-agent-tools/architecture/overview/) — how it works under the hood
|
|
409
477
|
|
package/dist/bridge/client.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import type { BridgeConfig } from '../schemas/bridge.js';
|
|
2
|
-
import type { ElementRect, RustLogEntry, DescribeResponse, VersionResponse } from '../schemas/bridge.js';
|
|
2
|
+
import type { ElementRect, RustLogEntry, DescribeResponse, VersionResponse, ProcessResponse, CapabilitiesResponse, DevtoolsResponse, HealthResponse } from '../schemas/bridge.js';
|
|
3
3
|
import type { A11yNode } from '../schemas/dom.js';
|
|
4
4
|
export declare class BridgeClient {
|
|
5
5
|
private baseUrl;
|
|
6
6
|
private token;
|
|
7
7
|
private windowLabel;
|
|
8
|
+
/** Cached `/version` response. Populated by `requireEndpoint` on first call. */
|
|
9
|
+
private versionCache;
|
|
10
|
+
/** Set when `/version` is unreachable so we don't retry it for every call. */
|
|
11
|
+
private versionUnreachable;
|
|
8
12
|
constructor(config: BridgeConfig, windowLabel?: string);
|
|
9
13
|
eval(js: string, timeout?: number): Promise<unknown>;
|
|
10
14
|
getElementRect(selector: string): Promise<ElementRect | null>;
|
|
@@ -18,4 +22,16 @@ export declare class BridgeClient {
|
|
|
18
22
|
ping(): Promise<boolean>;
|
|
19
23
|
describe(): Promise<DescribeResponse | null>;
|
|
20
24
|
version(): Promise<VersionResponse | null>;
|
|
25
|
+
/**
|
|
26
|
+
* Verify the bridge exposes the requested endpoint. Caches the `/version`
|
|
27
|
+
* response so a CLI command that hits the bridge multiple times only pays
|
|
28
|
+
* one roundtrip for feature detection. Throws an actionable error when the
|
|
29
|
+
* bridge is too old, with a hint pointing integrators at the example.
|
|
30
|
+
*/
|
|
31
|
+
requireEndpoint(path: string): Promise<void>;
|
|
32
|
+
process(): Promise<ProcessResponse>;
|
|
33
|
+
capabilities(): Promise<CapabilitiesResponse>;
|
|
34
|
+
devtools(): Promise<DevtoolsResponse>;
|
|
35
|
+
health(): Promise<HealthResponse>;
|
|
36
|
+
private postAuthed;
|
|
21
37
|
}
|
package/dist/bridge/client.js
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
|
-
import { ElementRectSchema, ViewportSizeSchema, BridgeEvalResponseSchema, BridgeLogsResponseSchema, DescribeResponseSchema, VersionResponseSchema, } from '../schemas/bridge.js';
|
|
1
|
+
import { ElementRectSchema, ViewportSizeSchema, BridgeEvalResponseSchema, BridgeLogsResponseSchema, DescribeResponseSchema, VersionResponseSchema, ProcessResponseSchema, CapabilitiesResponseSchema, DevtoolsResponseSchema, HealthResponseSchema, } from '../schemas/bridge.js';
|
|
2
2
|
import { A11yNodeSchema } from '../schemas/dom.js';
|
|
3
|
+
/**
|
|
4
|
+
* Minimum bridge version supplying a given endpoint. Used by `requireEndpoint`
|
|
5
|
+
* to translate a missing-endpoint condition into an actionable error instead
|
|
6
|
+
* of an opaque 404.
|
|
7
|
+
*/
|
|
8
|
+
const ENDPOINT_MIN_VERSION = {
|
|
9
|
+
'/process': '0.7.0',
|
|
10
|
+
'/capabilities': '0.7.0',
|
|
11
|
+
'/devtools': '0.7.0',
|
|
12
|
+
'/health': '0.7.0',
|
|
13
|
+
};
|
|
3
14
|
export class BridgeClient {
|
|
4
15
|
baseUrl;
|
|
5
16
|
token;
|
|
6
17
|
windowLabel;
|
|
18
|
+
/** Cached `/version` response. Populated by `requireEndpoint` on first call. */
|
|
19
|
+
versionCache = null;
|
|
20
|
+
/** Set when `/version` is unreachable so we don't retry it for every call. */
|
|
21
|
+
versionUnreachable = false;
|
|
7
22
|
constructor(config, windowLabel) {
|
|
8
23
|
this.baseUrl = `http://127.0.0.1:${config.port}`;
|
|
9
24
|
this.token = config.token;
|
|
@@ -172,5 +187,71 @@ export class BridgeClient {
|
|
|
172
187
|
return null;
|
|
173
188
|
}
|
|
174
189
|
}
|
|
190
|
+
/**
|
|
191
|
+
* Verify the bridge exposes the requested endpoint. Caches the `/version`
|
|
192
|
+
* response so a CLI command that hits the bridge multiple times only pays
|
|
193
|
+
* one roundtrip for feature detection. Throws an actionable error when the
|
|
194
|
+
* bridge is too old, with a hint pointing integrators at the example.
|
|
195
|
+
*/
|
|
196
|
+
async requireEndpoint(path) {
|
|
197
|
+
if (this.versionUnreachable) {
|
|
198
|
+
throw new Error(`Bridge at ${this.baseUrl} did not respond to /version. The bridge may be ` +
|
|
199
|
+
`too old (pre-0.6.0) or not running. Confirm the dev server is up and try again.`);
|
|
200
|
+
}
|
|
201
|
+
if (this.versionCache === null) {
|
|
202
|
+
const v = await this.version();
|
|
203
|
+
if (v === null) {
|
|
204
|
+
this.versionUnreachable = true;
|
|
205
|
+
throw new Error(`Bridge at ${this.baseUrl} did not respond to /version. The bridge may be ` +
|
|
206
|
+
`too old (pre-0.6.0) or not running. Confirm the dev server is up and try again.`);
|
|
207
|
+
}
|
|
208
|
+
this.versionCache = v;
|
|
209
|
+
}
|
|
210
|
+
if (this.versionCache.endpoints.includes(path))
|
|
211
|
+
return;
|
|
212
|
+
const minVersion = ENDPOINT_MIN_VERSION[path];
|
|
213
|
+
const versionHint = minVersion
|
|
214
|
+
? `requires bridge v${minVersion}+ (this app reports v${this.versionCache.version})`
|
|
215
|
+
: `is not supported by the running bridge (v${this.versionCache.version})`;
|
|
216
|
+
throw new Error(`${path} ${versionHint}. ` +
|
|
217
|
+
`Re-copy examples/tauri-bridge/src/dev_bridge.rs into your app and rebuild — ` +
|
|
218
|
+
`see rust-bridge/README.md.`);
|
|
219
|
+
}
|
|
220
|
+
async process() {
|
|
221
|
+
await this.requireEndpoint('/process');
|
|
222
|
+
const res = await this.postAuthed('/process');
|
|
223
|
+
return ProcessResponseSchema.parse(await res.json());
|
|
224
|
+
}
|
|
225
|
+
async capabilities() {
|
|
226
|
+
await this.requireEndpoint('/capabilities');
|
|
227
|
+
const res = await this.postAuthed('/capabilities');
|
|
228
|
+
return CapabilitiesResponseSchema.parse(await res.json());
|
|
229
|
+
}
|
|
230
|
+
async devtools() {
|
|
231
|
+
await this.requireEndpoint('/devtools');
|
|
232
|
+
const res = await this.postAuthed('/devtools');
|
|
233
|
+
return DevtoolsResponseSchema.parse(await res.json());
|
|
234
|
+
}
|
|
235
|
+
async health() {
|
|
236
|
+
await this.requireEndpoint('/health');
|
|
237
|
+
const res = await this.postAuthed('/health');
|
|
238
|
+
return HealthResponseSchema.parse(await res.json());
|
|
239
|
+
}
|
|
240
|
+
async postAuthed(path, timeout = 5000) {
|
|
241
|
+
const res = await fetch(`${this.baseUrl}${path}`, {
|
|
242
|
+
method: 'POST',
|
|
243
|
+
headers: { 'Content-Type': 'application/json' },
|
|
244
|
+
body: JSON.stringify({ token: this.token }),
|
|
245
|
+
signal: AbortSignal.timeout(timeout),
|
|
246
|
+
});
|
|
247
|
+
if (!res.ok) {
|
|
248
|
+
if (res.status === 401 || res.status === 403) {
|
|
249
|
+
throw new Error('Bridge authentication failed — check your token');
|
|
250
|
+
}
|
|
251
|
+
const text = await res.text().catch(() => '');
|
|
252
|
+
throw new Error(`Bridge error (${res.status}) on ${path}: ${text}`);
|
|
253
|
+
}
|
|
254
|
+
return res;
|
|
255
|
+
}
|
|
175
256
|
}
|
|
176
257
|
//# sourceMappingURL=client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/bridge/client.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACxB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,
|
|
1
|
+
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AI,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;QACtC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QAC7C,OAAO,oBAAoB,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;IAEO,KAAK,CAAC,UAAU,CAAC,IAAY,EAAE,OAAO,GAAG,IAAI;QACnD,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,OAAO,GAAG,IAAI,EAAE,EAAE;YAChD,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;YAC3C,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC;SACrC,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBAC7C,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;YACrE,CAAC;YACD,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;YAC9C,MAAM,IAAI,KAAK,CAAC,iBAAiB,GAAG,CAAC,MAAM,QAAQ,IAAI,KAAK,IAAI,EAAE,CAAC,CAAC;QACtE,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF"}
|
package/dist/cli.js
CHANGED
|
@@ -34,6 +34,17 @@ import { registerStoreInspect } from './commands/storeInspect.js';
|
|
|
34
34
|
import { registerCheck } from './commands/check.js';
|
|
35
35
|
import { registerProbe } from './commands/probe.js';
|
|
36
36
|
import { registerCapture } from './commands/capture.js';
|
|
37
|
+
import { registerAppPaths } from './commands/appPaths.js';
|
|
38
|
+
import { registerConfigInspect } from './commands/configInspect.js';
|
|
39
|
+
import { registerOsLogs } from './commands/osLogs.js';
|
|
40
|
+
import { registerSidecarTap } from './commands/sidecarTap.js';
|
|
41
|
+
import { registerSidecarReplay } from './commands/sidecarReplay.js';
|
|
42
|
+
import { registerForensics } from './commands/forensics.js';
|
|
43
|
+
import { registerProcessTree } from './commands/processTree.js';
|
|
44
|
+
import { registerCapabilitiesAudit } from './commands/capabilitiesAudit.js';
|
|
45
|
+
import { registerWebviewAttach } from './commands/webviewAttach.js';
|
|
46
|
+
import { registerHealth } from './commands/health.js';
|
|
47
|
+
import { registerDiagnose } from './commands/diagnose.js';
|
|
37
48
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
38
49
|
const pkg = PackageJsonSchema.parse(JSON.parse(readFileSync(resolve(__dirname, '..', 'package.json'), 'utf-8')));
|
|
39
50
|
const program = new Command()
|
|
@@ -83,6 +94,20 @@ registerStoreInspect(program);
|
|
|
83
94
|
registerCheck(program);
|
|
84
95
|
registerProbe(program);
|
|
85
96
|
registerCapture(program, getAdapter);
|
|
97
|
+
// ── Bridge-free diagnostics (Tier 1) ─────────────────────────────────────────
|
|
98
|
+
registerAppPaths(program);
|
|
99
|
+
registerConfigInspect(program);
|
|
100
|
+
registerOsLogs(program);
|
|
101
|
+
registerSidecarTap(program);
|
|
102
|
+
registerSidecarReplay(program);
|
|
103
|
+
registerForensics(program);
|
|
104
|
+
// ── Bridge-extending diagnostics (Tier 2 — requires bridge v0.7.0+) ──────────
|
|
105
|
+
registerProcessTree(program);
|
|
106
|
+
registerCapabilitiesAudit(program);
|
|
107
|
+
registerWebviewAttach(program);
|
|
108
|
+
registerHealth(program);
|
|
109
|
+
// ── Tier 3: super-command (composes Tier 1 + Tier 2) ─────────────────────────
|
|
110
|
+
registerDiagnose(program);
|
|
86
111
|
program.parseAsync().catch((err) => {
|
|
87
112
|
console.error(err instanceof Error ? err.message : String(err));
|
|
88
113
|
process.exitCode = 1;
|