tauri-agent-tools 0.6.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +72 -4
- 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/bridge/tokenDiscovery.js +29 -29
- package/dist/bridge/tokenDiscovery.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/capture.js +1 -1
- 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/invoke.js +14 -4
- package/dist/commands/invoke.js.map +1 -1
- package/dist/commands/ipcMonitor.d.ts +3 -0
- package/dist/commands/ipcMonitor.js +22 -10
- package/dist/commands/ipcMonitor.js.map +1 -1
- 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/pageState.d.ts +1 -0
- package/dist/commands/pageState.js +2 -2
- package/dist/commands/pageState.js.map +1 -1
- 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/snapshot.js +1 -1
- 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 +536 -43
- package/examples/tauri-bridge/tauri.conf.json +25 -0
- package/package.json +3 -1
- package/rust-bridge/README.md +10 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { readdir, readFile, unlink } from 'node:fs/promises';
|
|
2
2
|
import { tmpdir } from 'node:os';
|
|
3
|
+
import { join } from 'node:path';
|
|
3
4
|
import { TokenFileSchema } from '../schemas/bridge.js';
|
|
4
|
-
const
|
|
5
|
+
const FALLBACK_TOKEN_DIR = '/tmp';
|
|
5
6
|
const TOKEN_PREFIX = 'tauri-dev-bridge-';
|
|
6
7
|
const TOKEN_SUFFIX = '.token';
|
|
7
8
|
function isPidAlive(pid) {
|
|
@@ -13,18 +14,21 @@ function isPidAlive(pid) {
|
|
|
13
14
|
return false;
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
+
function getTokenDirs() {
|
|
18
|
+
return [...new Set([tmpdir(), FALLBACK_TOKEN_DIR])];
|
|
19
|
+
}
|
|
20
|
+
async function scanTokenDir(tokenDir) {
|
|
17
21
|
let files;
|
|
18
22
|
try {
|
|
19
|
-
files = await readdir(
|
|
23
|
+
files = await readdir(tokenDir);
|
|
20
24
|
}
|
|
21
25
|
catch {
|
|
22
|
-
return
|
|
26
|
+
return [];
|
|
23
27
|
}
|
|
24
28
|
const tokenFiles = files.filter((f) => f.startsWith(TOKEN_PREFIX) && f.endsWith(TOKEN_SUFFIX));
|
|
25
|
-
|
|
29
|
+
const found = [];
|
|
26
30
|
for (const file of tokenFiles) {
|
|
27
|
-
const filePath =
|
|
31
|
+
const filePath = join(tokenDir, file);
|
|
28
32
|
try {
|
|
29
33
|
const content = await readFile(filePath, 'utf-8');
|
|
30
34
|
const data = TokenFileSchema.parse(JSON.parse(content));
|
|
@@ -33,9 +37,10 @@ export async function discoverBridge() {
|
|
|
33
37
|
await unlink(filePath).catch(() => { });
|
|
34
38
|
continue;
|
|
35
39
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
found.push({
|
|
41
|
+
pid: data.pid,
|
|
42
|
+
config: { port: data.port, token: data.token },
|
|
43
|
+
});
|
|
39
44
|
}
|
|
40
45
|
catch {
|
|
41
46
|
// Skip malformed files
|
|
@@ -44,29 +49,24 @@ export async function discoverBridge() {
|
|
|
44
49
|
}
|
|
45
50
|
return found;
|
|
46
51
|
}
|
|
52
|
+
export async function discoverBridge() {
|
|
53
|
+
let first = null;
|
|
54
|
+
for (const tokenDir of getTokenDirs()) {
|
|
55
|
+
const bridges = await scanTokenDir(tokenDir);
|
|
56
|
+
if (!first && bridges.length > 0) {
|
|
57
|
+
first = bridges[0].config;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return first;
|
|
61
|
+
}
|
|
47
62
|
export async function discoverBridgesByPid() {
|
|
48
63
|
const result = new Map();
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return result;
|
|
55
|
-
}
|
|
56
|
-
const tokenFiles = files.filter((f) => f.startsWith(TOKEN_PREFIX) && f.endsWith(TOKEN_SUFFIX));
|
|
57
|
-
for (const file of tokenFiles) {
|
|
58
|
-
const filePath = `${TOKEN_DIR}/${file}`;
|
|
59
|
-
try {
|
|
60
|
-
const content = await readFile(filePath, 'utf-8');
|
|
61
|
-
const data = TokenFileSchema.parse(JSON.parse(content));
|
|
62
|
-
if (!isPidAlive(data.pid)) {
|
|
63
|
-
await unlink(filePath).catch(() => { });
|
|
64
|
-
continue;
|
|
64
|
+
for (const tokenDir of getTokenDirs()) {
|
|
65
|
+
const bridges = await scanTokenDir(tokenDir);
|
|
66
|
+
for (const bridge of bridges) {
|
|
67
|
+
if (!result.has(bridge.pid)) {
|
|
68
|
+
result.set(bridge.pid, bridge.config);
|
|
65
69
|
}
|
|
66
|
-
result.set(data.pid, { port: data.port, token: data.token });
|
|
67
|
-
}
|
|
68
|
-
catch {
|
|
69
|
-
continue;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenDiscovery.js","sourceRoot":"","sources":["../../src/bridge/tokenDiscovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,
|
|
1
|
+
{"version":3,"file":"tokenDiscovery.js","sourceRoot":"","sources":["../../src/bridge/tokenDiscovery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAClC,MAAM,YAAY,GAAG,mBAAmB,CAAC;AACzC,MAAM,YAAY,GAAG,QAAQ,CAAC;AAO9B,SAAS,UAAU,CAAC,GAAW;IAC7B,IAAI,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,SAAS,YAAY;IACnB,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,KAAK,UAAU,YAAY,CAAC,QAAgB;IAC1C,IAAI,KAAe,CAAC;IACpB,IAA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AAI,YAAY,EAAE,EAAE,CAAC;QACtC,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACjC,KAAK,GAAG,OAAO,CAAC,CAAC,CAAE,CAAC,MAAM,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAwB,CAAC;IAE/C,KAAK,MAAM,QAAQ,IAAI,YAAY,EAAE,EAAE,CAAC;QACtC,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC7C,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC5B,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;YACxC,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
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;
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,OA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,OAAO,CAAC,CAAC;AACvB,eAAe,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAErC,gFAAgF;AAChF,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAC1B,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAC/B,cAAc,CAAC,OAAO,CAAC,CAAC;AACxB,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAC5B,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAC/B,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAE3B,gFAAgF;AAChF,mBAAmB,CAAC,OAAO,CAAC,CAAC;AAC7B,yBAAyB,CAAC,OAAO,CAAC,CAAC;AACnC,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAC/B,cAAc,CAAC,OAAO,CAAC,CAAC;AAExB,gFAAgF;AAChF,gBAAgB,CAAC,OAAO,CAAC,CAAC;AAE1B,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IAC1C,OAAO,CAAC,KAAK,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { existsSync, statSync } from 'node:fs';
|
|
3
|
+
import { currentPlatform, resolveTauriPaths, resolveTauriProject } from '../util/tauriConfig.js';
|
|
4
|
+
export function registerAppPaths(program) {
|
|
5
|
+
const cmd = new Command('app-paths')
|
|
6
|
+
.description('Resolve a Tauri 2 app\'s OS data/log/cache/config directories')
|
|
7
|
+
.option('--config <path>', 'Path to tauri.conf.json (or its directory). Auto-detected if omitted.')
|
|
8
|
+
.option('--identifier <id>', 'Bundle identifier override (skips tauri.conf.json identifier lookup)')
|
|
9
|
+
.option('--platform <name>', 'Platform to resolve for: darwin | linux | win32 | all (default: current host)')
|
|
10
|
+
.option('--exists', 'Annotate each path with whether it currently exists on disk')
|
|
11
|
+
.option('--json', 'Output as JSON')
|
|
12
|
+
.action(async (opts) => {
|
|
13
|
+
const platform = (opts.platform ?? currentPlatform()).toLowerCase();
|
|
14
|
+
if (!['darwin', 'linux', 'win32', 'all'].includes(platform)) {
|
|
15
|
+
throw new Error(`Invalid --platform: ${opts.platform}. Expected one of: darwin, linux, win32, all.`);
|
|
16
|
+
}
|
|
17
|
+
// Identifier-only mode: skip tauri.conf.json discovery entirely. Useful when
|
|
18
|
+
// the user only wants to compute paths from a known bundle id (e.g., a release
|
|
19
|
+
// build with no source tree on disk).
|
|
20
|
+
if (opts.identifier && !opts.config) {
|
|
21
|
+
const allPaths = resolveTauriPaths(opts.identifier);
|
|
22
|
+
emit({
|
|
23
|
+
identifier: opts.identifier,
|
|
24
|
+
productName: null,
|
|
25
|
+
configPath: null,
|
|
26
|
+
platform: platform === 'all' ? null : platform,
|
|
27
|
+
paths: platform === 'all'
|
|
28
|
+
? allPaths
|
|
29
|
+
: { [platform]: allPaths[platform] },
|
|
30
|
+
}, opts);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const resolved = await resolveTauriProject({
|
|
34
|
+
configPath: opts.config,
|
|
35
|
+
identifierOverride: opts.identifier,
|
|
36
|
+
});
|
|
37
|
+
const paths = platform === 'all'
|
|
38
|
+
? resolved.paths
|
|
39
|
+
: { [platform]: resolved.paths[platform] };
|
|
40
|
+
emit({
|
|
41
|
+
identifier: resolved.identifier,
|
|
42
|
+
productName: resolved.productName,
|
|
43
|
+
configPath: resolved.configPath,
|
|
44
|
+
platform: platform === 'all' ? null : platform,
|
|
45
|
+
paths,
|
|
46
|
+
}, opts);
|
|
47
|
+
});
|
|
48
|
+
program.addCommand(cmd);
|
|
49
|
+
}
|
|
50
|
+
function emit(out, opts) {
|
|
51
|
+
if (opts.exists) {
|
|
52
|
+
out = annotateExistence(out);
|
|
53
|
+
}
|
|
54
|
+
if (opts.json) {
|
|
55
|
+
console.log(JSON.stringify(out, null, 2));
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
console.log(`Identifier: ${out.identifier}`);
|
|
59
|
+
if (out.productName)
|
|
60
|
+
console.log(`Product name: ${out.productName}`);
|
|
61
|
+
if (out.configPath)
|
|
62
|
+
console.log(`Config: ${out.configPath}`);
|
|
63
|
+
for (const [plat, pathSet] of Object.entries(out.paths)) {
|
|
64
|
+
console.log(`\n[${plat}]`);
|
|
65
|
+
for (const [key, value] of Object.entries(pathSet)) {
|
|
66
|
+
console.log(` ${key.padEnd(16)} ${value}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Add `__exists` annotations alongside each path string. Only checks paths that
|
|
72
|
+
* point at the *current* platform (it makes no sense to test if a Windows path
|
|
73
|
+
* exists from inside macOS).
|
|
74
|
+
*/
|
|
75
|
+
function annotateExistence(out) {
|
|
76
|
+
const current = currentPlatform();
|
|
77
|
+
const annotated = {};
|
|
78
|
+
for (const [plat, pathSet] of Object.entries(out.paths)) {
|
|
79
|
+
if (plat !== current) {
|
|
80
|
+
annotated[plat] = pathSet;
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
const inflated = {};
|
|
84
|
+
for (const [key, value] of Object.entries(pathSet)) {
|
|
85
|
+
const exists = existsSync(value);
|
|
86
|
+
const detail = exists
|
|
87
|
+
? statSync(value).isDirectory()
|
|
88
|
+
? ' (dir exists)'
|
|
89
|
+
: ' (file exists)'
|
|
90
|
+
: ' (missing)';
|
|
91
|
+
inflated[key] = `${value}${detail}`;
|
|
92
|
+
}
|
|
93
|
+
annotated[plat] = inflated;
|
|
94
|
+
}
|
|
95
|
+
return { ...out, paths: annotated };
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=appPaths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appPa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EAAE,CAAC;YACnD,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;YACjC,MAAM,MAAM,GAAG,MAAM;gBACnB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE;oBAC7B,CAAC,CAAC,eAAe;oBACjB,CAAC,CAAC,gBAAgB;gBACpB,CAAC,CAAC,YAAY,CAAC;YACjB,QAAQ,CAAC,GAAG,CAAC,GAAG,GAAG,KAAK,GAAG,MAAM,EAAE,CAAC;QACtC,CAAC;QACD,SAAS,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC;IAC7B,CAAC;IACD,OAAO,EAAE,GAAG,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { addBridgeOptions, resolveBridge } from './shared.js';
|
|
3
|
+
const OVERBROAD_PERMISSIONS = new Set([
|
|
4
|
+
'fs:allow-all',
|
|
5
|
+
'fs:default',
|
|
6
|
+
'shell:allow-execute',
|
|
7
|
+
'shell:allow-spawn',
|
|
8
|
+
'http:allow-all',
|
|
9
|
+
]);
|
|
10
|
+
export function registerCapabilitiesAudit(program) {
|
|
11
|
+
const cmd = new Command('capabilities')
|
|
12
|
+
.description('Audit Tauri capabilities live from a running app (requires bridge v0.7.0+)');
|
|
13
|
+
const sub = cmd
|
|
14
|
+
.command('audit')
|
|
15
|
+
.description('Fetch the live capability set from the bridge and flag risky permissions')
|
|
16
|
+
.option('--json', 'Output as JSON');
|
|
17
|
+
addBridgeOptions(sub);
|
|
18
|
+
sub.action(async (opts) => {
|
|
19
|
+
const bridge = await resolveBridge(opts);
|
|
20
|
+
const caps = await bridge.capabilities();
|
|
21
|
+
const findings = audit(caps);
|
|
22
|
+
const out = {
|
|
23
|
+
windows: caps.windows,
|
|
24
|
+
capabilities: caps.declared,
|
|
25
|
+
findings,
|
|
26
|
+
};
|
|
27
|
+
if (opts.json) {
|
|
28
|
+
console.log(JSON.stringify(out, null, 2));
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
renderHuman(out);
|
|
32
|
+
});
|
|
33
|
+
program.addCommand(cmd);
|
|
34
|
+
}
|
|
35
|
+
function audit(caps) {
|
|
36
|
+
const findings = [];
|
|
37
|
+
for (const cap of caps.declared) {
|
|
38
|
+
if (cap.permissions.length === 0) {
|
|
39
|
+
// Capability declared by JSON-file reference is reported as a bare
|
|
40
|
+
// identifier with no permissions array — the bridge can't read the file.
|
|
41
|
+
// Surface it as info so the user knows we don't have details.
|
|
42
|
+
findings.push({
|
|
43
|
+
level: 'info',
|
|
44
|
+
capability: cap.identifier,
|
|
45
|
+
message: 'Permissions list is empty (capability may be declared by file reference; use `config inspect` for static analysis)',
|
|
46
|
+
});
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
for (const perm of cap.permissions) {
|
|
50
|
+
if (perm === '*') {
|
|
51
|
+
findings.push({
|
|
52
|
+
level: 'error',
|
|
53
|
+
capability: cap.identifier,
|
|
54
|
+
message: 'Grants wildcard permission "*"',
|
|
55
|
+
});
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (OVERBROAD_PERMISSIONS.has(perm)) {
|
|
59
|
+
findings.push({
|
|
60
|
+
level: 'warn',
|
|
61
|
+
capability: cap.identifier,
|
|
62
|
+
message: `Uses over-broad permission "${perm}"`,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (cap.windows.length === 0) {
|
|
67
|
+
findings.push({
|
|
68
|
+
level: 'info',
|
|
69
|
+
capability: cap.identifier,
|
|
70
|
+
message: 'No window scope declared — capability applies to all windows',
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
const unknown = cap.windows.filter((w) => !caps.windows.includes(w) && !w.includes('*') && !w.includes('?'));
|
|
75
|
+
if (unknown.length > 0) {
|
|
76
|
+
findings.push({
|
|
77
|
+
level: 'warn',
|
|
78
|
+
capability: cap.identifier,
|
|
79
|
+
message: `References window label(s) not registered with this app: ${unknown.join(', ')}`,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return findings;
|
|
85
|
+
}
|
|
86
|
+
function renderHuman(out) {
|
|
87
|
+
console.log(`Live windows (${out.windows.length}): ${out.windows.join(', ') || '(none)'}`);
|
|
88
|
+
console.log(`Capabilities (${out.capabilities.length}):`);
|
|
89
|
+
for (const cap of out.capabilities) {
|
|
90
|
+
const winScope = cap.windows.length === 0 ? 'all windows' : cap.windows.join(', ');
|
|
91
|
+
console.log(` [${cap.identifier}] ${cap.permissions.length} permission(s), scope: ${winScope}`);
|
|
92
|
+
if (cap.description)
|
|
93
|
+
console.log(` ${cap.description}`);
|
|
94
|
+
}
|
|
95
|
+
if (out.findings.length === 0) {
|
|
96
|
+
console.log('\nNo findings.');
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
console.log(`\nFindings (${out.findings.length}):`);
|
|
100
|
+
for (const f of out.findings) {
|
|
101
|
+
const tag = f.level.toUpperCase().padEnd(5);
|
|
102
|
+
console.log(` ${tag} [${f.capability}] ${f.message}`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=capabilitiesAudit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilitiesAudit.js","sourceRoot":"","sources":["../../src/commands/capabilitiesAudit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAgB9D,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IACpC,cAAc;IACd,YAAY;IACZ,qBAAqB;IACrB,mBAAmB;IACnB,gBAAgB;CACjB,CAAC,CAAC;AAEH,MAAM,UAAU,yBAAyB,CAAC,OAAgB;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AAC,WAAW,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC5C,OAAO,CAAC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACzD,CAAC;AACH,CAAC"}
|
package/dist/commands/capture.js
CHANGED
|
@@ -13,7 +13,7 @@ const PAGE_STATE_SCRIPT = `(() => {
|
|
|
13
13
|
viewport: { width: window.innerWidth, height: window.innerHeight },
|
|
14
14
|
scroll: { x: Math.round(window.scrollX), y: Math.round(window.scrollY) },
|
|
15
15
|
document: { width: document.documentElement.scrollWidth, height: document.documentElement.scrollHeight },
|
|
16
|
-
hasTauri: !!(window.__TAURI__)
|
|
16
|
+
hasTauri: !!(window.__TAURI_INTERNALS__ || window.__TAURI__)
|
|
17
17
|
});
|
|
18
18
|
})()`;
|
|
19
19
|
const STORAGE_SCRIPT = `(() => {
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { readFile } from 'node:fs/promises';
|
|
3
|
+
import { existsSync } from 'node:fs';
|
|
4
|
+
import { join } from 'node:path';
|
|
5
|
+
import { loadCapability, resolveTauriProject } from '../util/tauriConfig.js';
|
|
6
|
+
const OVERBROAD_PERMISSIONS = new Set([
|
|
7
|
+
'fs:allow-all',
|
|
8
|
+
'fs:default',
|
|
9
|
+
'shell:allow-execute',
|
|
10
|
+
'shell:allow-spawn',
|
|
11
|
+
'http:allow-all',
|
|
12
|
+
]);
|
|
13
|
+
export function registerConfigInspect(program) {
|
|
14
|
+
const cmd = new Command('config')
|
|
15
|
+
.description('Inspect a Tauri app config (paths, capabilities, sidecars)');
|
|
16
|
+
cmd
|
|
17
|
+
.command('inspect')
|
|
18
|
+
.description('Emit a structured snapshot of tauri.conf.json + capabilities')
|
|
19
|
+
.option('--config <path>', 'Path to tauri.conf.json (or its directory). Auto-detected if omitted.')
|
|
20
|
+
.option('--capabilities-dir <path>', 'Directory holding capability *.json files (default: <project>/src-tauri/capabilities/)')
|
|
21
|
+
.option('--cargo-toml <path>', 'Path to the Rust crate\'s Cargo.toml (default: <project>/src-tauri/Cargo.toml). Used to cross-check plugin declarations.')
|
|
22
|
+
.option('--json', 'Output as JSON')
|
|
23
|
+
.action(async (opts) => {
|
|
24
|
+
const resolved = await resolveTauriProject({
|
|
25
|
+
configPath: opts.config,
|
|
26
|
+
capabilitiesDir: opts.capabilitiesDir,
|
|
27
|
+
});
|
|
28
|
+
const capabilities = await loadAllCapabilities(resolved.capabilityFiles);
|
|
29
|
+
const cargoTomlPath = opts.cargoToml ?? defaultCargoToml(resolved.configPath);
|
|
30
|
+
const cargoTomlExists = existsSync(cargoTomlPath);
|
|
31
|
+
const declaredPlugins = cargoTomlExists ? await readDeclaredPlugins(cargoTomlPath) : [];
|
|
32
|
+
const warnings = collectWarnings(capabilities, declaredPlugins, resolved.sidecars, cargoTomlExists);
|
|
33
|
+
const out = {
|
|
34
|
+
identifier: resolved.identifier,
|
|
35
|
+
productName: resolved.productName,
|
|
36
|
+
version: resolved.version,
|
|
37
|
+
mainBinaryName: resolved.mainBinaryName,
|
|
38
|
+
devUrl: resolved.devUrl,
|
|
39
|
+
devPort: resolved.devPort,
|
|
40
|
+
frontendDist: resolved.frontendDist,
|
|
41
|
+
sidecars: resolved.sidecars,
|
|
42
|
+
windows: resolved.windows,
|
|
43
|
+
configPath: resolved.configPath,
|
|
44
|
+
capabilities,
|
|
45
|
+
declaredPlugins,
|
|
46
|
+
warnings,
|
|
47
|
+
};
|
|
48
|
+
if (opts.json) {
|
|
49
|
+
console.log(JSON.stringify(out, null, 2));
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
printHumanReadable(out);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
program.addCommand(cmd);
|
|
56
|
+
}
|
|
57
|
+
async function loadAllCapabilities(files) {
|
|
58
|
+
const out = [];
|
|
59
|
+
for (const file of files) {
|
|
60
|
+
let cap;
|
|
61
|
+
try {
|
|
62
|
+
cap = await loadCapability(file);
|
|
63
|
+
}
|
|
64
|
+
catch (err) {
|
|
65
|
+
// Surface as a degenerate entry rather than aborting — the warning collector
|
|
66
|
+
// wants to know about malformed capability files too.
|
|
67
|
+
out.push({
|
|
68
|
+
file,
|
|
69
|
+
identifier: '<parse-error>',
|
|
70
|
+
description: err instanceof Error ? err.message : String(err),
|
|
71
|
+
windows: [],
|
|
72
|
+
platforms: [],
|
|
73
|
+
permissions: [],
|
|
74
|
+
permissionCount: 0,
|
|
75
|
+
});
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
const perms = cap.permissions.map(permissionToEntry);
|
|
79
|
+
out.push({
|
|
80
|
+
file,
|
|
81
|
+
identifier: cap.identifier,
|
|
82
|
+
description: cap.description ?? null,
|
|
83
|
+
windows: cap.windows ?? [],
|
|
84
|
+
platforms: cap.platforms ?? [],
|
|
85
|
+
permissions: perms,
|
|
86
|
+
permissionCount: perms.length,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return out;
|
|
90
|
+
}
|
|
91
|
+
function permissionToEntry(p) {
|
|
92
|
+
if (typeof p === 'string') {
|
|
93
|
+
return { identifier: p, hasAllow: false, hasDeny: false };
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
identifier: p.identifier,
|
|
97
|
+
hasAllow: Array.isArray(p.allow) && p.allow.length > 0,
|
|
98
|
+
hasDeny: Array.isArray(p.deny) && p.deny.length > 0,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function defaultCargoToml(configPath) {
|
|
102
|
+
// configPath is .../src-tauri/tauri.conf.json → Cargo.toml lives alongside.
|
|
103
|
+
return join(configPath, '..', 'Cargo.toml');
|
|
104
|
+
}
|
|
105
|
+
async function readDeclaredPlugins(cargoToml) {
|
|
106
|
+
const text = await readFile(cargoToml, 'utf-8');
|
|
107
|
+
// Match `tauri-plugin-<name>` package names in dependencies. Conservative regex —
|
|
108
|
+
// doesn't try to parse TOML; just grabs the plugin family that matters for the
|
|
109
|
+
// capability/plugin cross-check.
|
|
110
|
+
const matches = text.matchAll(/\b(tauri-plugin-[a-z0-9_-]+)\b/g);
|
|
111
|
+
const plugins = new Set();
|
|
112
|
+
for (const m of matches) {
|
|
113
|
+
const name = m[1];
|
|
114
|
+
if (name)
|
|
115
|
+
plugins.add(name);
|
|
116
|
+
}
|
|
117
|
+
return Array.from(plugins).sort();
|
|
118
|
+
}
|
|
119
|
+
function collectWarnings(capabilities, declaredPlugins, sidecars, cargoTomlPresent) {
|
|
120
|
+
const out = [];
|
|
121
|
+
for (const cap of capabilities) {
|
|
122
|
+
if (cap.identifier === '<parse-error>') {
|
|
123
|
+
out.push({
|
|
124
|
+
level: 'error',
|
|
125
|
+
message: `Capability file failed to parse: ${cap.file}`,
|
|
126
|
+
context: { error: cap.description ?? '' },
|
|
127
|
+
});
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (cap.permissions.length === 0) {
|
|
131
|
+
out.push({
|
|
132
|
+
level: 'info',
|
|
133
|
+
message: `Capability "${cap.identifier}" has no permissions declared`,
|
|
134
|
+
context: { file: cap.file },
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
for (const perm of cap.permissions) {
|
|
138
|
+
if (perm.identifier === '*') {
|
|
139
|
+
out.push({
|
|
140
|
+
level: 'error',
|
|
141
|
+
message: `Capability "${cap.identifier}" grants wildcard permission "*"`,
|
|
142
|
+
context: { file: cap.file },
|
|
143
|
+
});
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
if (OVERBROAD_PERMISSIONS.has(perm.identifier)) {
|
|
147
|
+
out.push({
|
|
148
|
+
level: 'warn',
|
|
149
|
+
message: `Capability "${cap.identifier}" uses over-broad permission "${perm.identifier}"`,
|
|
150
|
+
context: { file: cap.file },
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
// Cross-check: if the permission references a plugin family, that plugin
|
|
154
|
+
// should also be declared in Cargo.toml. (Built-in `core:*` permissions are
|
|
155
|
+
// exempt — they don't map to a tauri-plugin-* crate.) Skip the check entirely
|
|
156
|
+
// when Cargo.toml is missing — we have no ground truth, so reporting would
|
|
157
|
+
// be a false positive.
|
|
158
|
+
const [family] = perm.identifier.split(':');
|
|
159
|
+
if (family && family !== 'core' && cargoTomlPresent) {
|
|
160
|
+
const expectedCrate = `tauri-plugin-${family}`;
|
|
161
|
+
if (!declaredPlugins.includes(expectedCrate)) {
|
|
162
|
+
out.push({
|
|
163
|
+
level: 'warn',
|
|
164
|
+
message: `Capability "${cap.identifier}" references plugin "${family}" but ${expectedCrate} is not in Cargo.toml`,
|
|
165
|
+
context: { file: cap.file },
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
// Sidecars declared in bundle.externalBin but no shell plugin → unusable.
|
|
172
|
+
if (sidecars.length > 0 && cargoTomlPresent && !declaredPlugins.includes('tauri-plugin-shell')) {
|
|
173
|
+
out.push({
|
|
174
|
+
level: 'warn',
|
|
175
|
+
message: `bundle.externalBin declares ${sidecars.length} sidecar(s) but tauri-plugin-shell is not in Cargo.toml — sidecars are launched through the shell plugin`,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
return out;
|
|
179
|
+
}
|
|
180
|
+
function printHumanReadable(out) {
|
|
181
|
+
console.log(`Identifier: ${out.identifier}`);
|
|
182
|
+
console.log(`Product name: ${out.productName}`);
|
|
183
|
+
if (out.version)
|
|
184
|
+
console.log(`Version: ${out.version}`);
|
|
185
|
+
if (out.devUrl)
|
|
186
|
+
console.log(`Dev URL: ${out.devUrl} (port ${out.devPort ?? 'unknown'})`);
|
|
187
|
+
if (out.frontendDist)
|
|
188
|
+
console.log(`Frontend dist: ${out.frontendDist}`);
|
|
189
|
+
if (out.sidecars.length > 0) {
|
|
190
|
+
console.log(`\nSidecars (${out.sidecars.length}):`);
|
|
191
|
+
for (const s of out.sidecars)
|
|
192
|
+
console.log(` • ${s}`);
|
|
193
|
+
}
|
|
194
|
+
if (out.windows.length > 0) {
|
|
195
|
+
console.log(`\nWindows (${out.windows.length}):`);
|
|
196
|
+
for (const w of out.windows)
|
|
197
|
+
console.log(` • ${w}`);
|
|
198
|
+
}
|
|
199
|
+
if (out.declaredPlugins.length > 0) {
|
|
200
|
+
console.log(`\nDeclared plugins (${out.declaredPlugins.length}):`);
|
|
201
|
+
for (const p of out.declaredPlugins)
|
|
202
|
+
console.log(` • ${p}`);
|
|
203
|
+
}
|
|
204
|
+
console.log(`\nCapabilities (${out.capabilities.length}):`);
|
|
205
|
+
for (const cap of out.capabilities) {
|
|
206
|
+
console.log(` [${cap.identifier}] ${cap.permissionCount} permission(s)`);
|
|
207
|
+
if (cap.description)
|
|
208
|
+
console.log(` ${cap.description}`);
|
|
209
|
+
if (cap.windows.length > 0)
|
|
210
|
+
console.log(` windows: ${cap.windows.join(', ')}`);
|
|
211
|
+
}
|
|
212
|
+
if (out.warnings.length > 0) {
|
|
213
|
+
console.log(`\nWarnings (${out.warnings.length}):`);
|
|
214
|
+
for (const w of out.warnings) {
|
|
215
|
+
const tag = w.level.toUpperCase().padEnd(5);
|
|
216
|
+
console.log(` ${tag} ${w.message}`);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
console.log(`\nNo warnings.`);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
//# sourceMappingURL=configInspect.js.map
|