@jini-ai/desktop-host 0.1.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/LICENSE +201 -0
- package/dist/bridge-testing.d.ts +16 -0
- package/dist/bridge-testing.d.ts.map +1 -0
- package/dist/bridge-testing.js +52 -0
- package/dist/bridge-testing.js.map +1 -0
- package/dist/bridge.d.ts +83 -0
- package/dist/bridge.d.ts.map +1 -0
- package/dist/bridge.js +138 -0
- package/dist/bridge.js.map +1 -0
- package/dist/config.d.ts +7 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +44 -0
- package/dist/config.js.map +1 -0
- package/dist/electron/create-electron-desktop-host.d.ts +12 -0
- package/dist/electron/create-electron-desktop-host.d.ts.map +1 -0
- package/dist/electron/create-electron-desktop-host.js +18 -0
- package/dist/electron/create-electron-desktop-host.js.map +1 -0
- package/dist/electron/electron-protocol.d.ts +4 -0
- package/dist/electron/electron-protocol.d.ts.map +1 -0
- package/dist/electron/electron-protocol.js +13 -0
- package/dist/electron/electron-protocol.js.map +1 -0
- package/dist/electron/electron-render-service.d.ts +12 -0
- package/dist/electron/electron-render-service.d.ts.map +1 -0
- package/dist/electron/electron-render-service.js +73 -0
- package/dist/electron/electron-render-service.js.map +1 -0
- package/dist/electron/electron-shell.d.ts +9 -0
- package/dist/electron/electron-shell.d.ts.map +1 -0
- package/dist/electron/electron-shell.js +39 -0
- package/dist/electron/electron-shell.js.map +1 -0
- package/dist/electron/electron-single-instance.d.ts +4 -0
- package/dist/electron/electron-single-instance.d.ts.map +1 -0
- package/dist/electron/electron-single-instance.js +10 -0
- package/dist/electron/electron-single-instance.js.map +1 -0
- package/dist/electron/electron-surfaces.d.ts +105 -0
- package/dist/electron/electron-surfaces.d.ts.map +1 -0
- package/dist/electron/electron-surfaces.js +13 -0
- package/dist/electron/electron-surfaces.js.map +1 -0
- package/dist/electron/electron-window-lifecycle.d.ts +4 -0
- package/dist/electron/electron-window-lifecycle.d.ts.map +1 -0
- package/dist/electron/electron-window-lifecycle.js +29 -0
- package/dist/electron/electron-window-lifecycle.js.map +1 -0
- package/dist/electron/testing.d.ts +37 -0
- package/dist/electron/testing.d.ts.map +1 -0
- package/dist/electron/testing.js +144 -0
- package/dist/electron/testing.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/logging.d.ts +30 -0
- package/dist/logging.d.ts.map +1 -0
- package/dist/logging.js +131 -0
- package/dist/logging.js.map +1 -0
- package/dist/paths.d.ts +20 -0
- package/dist/paths.d.ts.map +1 -0
- package/dist/paths.js +80 -0
- package/dist/paths.js.map +1 -0
- package/dist/ports.d.ts +29 -0
- package/dist/ports.d.ts.map +1 -0
- package/dist/ports.js +2 -0
- package/dist/ports.js.map +1 -0
- package/dist/protocol.d.ts +28 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +47 -0
- package/dist/protocol.js.map +1 -0
- package/dist/render-service.d.ts +79 -0
- package/dist/render-service.d.ts.map +1 -0
- package/dist/render-service.js +89 -0
- package/dist/render-service.js.map +1 -0
- package/dist/shell.d.ts +40 -0
- package/dist/shell.d.ts.map +1 -0
- package/dist/shell.js +30 -0
- package/dist/shell.js.map +1 -0
- package/dist/sidecar.d.ts +34 -0
- package/dist/sidecar.d.ts.map +1 -0
- package/dist/sidecar.js +134 -0
- package/dist/sidecar.js.map +1 -0
- package/dist/single-instance.d.ts +18 -0
- package/dist/single-instance.d.ts.map +1 -0
- package/dist/single-instance.js +18 -0
- package/dist/single-instance.js.map +1 -0
- package/dist/tauri/create-tauri-desktop-host.d.ts +21 -0
- package/dist/tauri/create-tauri-desktop-host.d.ts.map +1 -0
- package/dist/tauri/create-tauri-desktop-host.js +25 -0
- package/dist/tauri/create-tauri-desktop-host.js.map +1 -0
- package/dist/tauri/not-implemented.d.ts +5 -0
- package/dist/tauri/not-implemented.d.ts.map +1 -0
- package/dist/tauri/not-implemented.js +8 -0
- package/dist/tauri/not-implemented.js.map +1 -0
- package/dist/tauri/tauri-protocol.d.ts +3 -0
- package/dist/tauri/tauri-protocol.d.ts.map +1 -0
- package/dist/tauri/tauri-protocol.js +20 -0
- package/dist/tauri/tauri-protocol.js.map +1 -0
- package/dist/tauri/tauri-render-service.d.ts +17 -0
- package/dist/tauri/tauri-render-service.d.ts.map +1 -0
- package/dist/tauri/tauri-render-service.js +19 -0
- package/dist/tauri/tauri-render-service.js.map +1 -0
- package/dist/tauri/tauri-shell.d.ts +9 -0
- package/dist/tauri/tauri-shell.d.ts.map +1 -0
- package/dist/tauri/tauri-shell.js +44 -0
- package/dist/tauri/tauri-shell.js.map +1 -0
- package/dist/tauri/tauri-sidecar.d.ts +4 -0
- package/dist/tauri/tauri-sidecar.d.ts.map +1 -0
- package/dist/tauri/tauri-sidecar.js +88 -0
- package/dist/tauri/tauri-sidecar.js.map +1 -0
- package/dist/tauri/tauri-single-instance.d.ts +11 -0
- package/dist/tauri/tauri-single-instance.d.ts.map +1 -0
- package/dist/tauri/tauri-single-instance.js +16 -0
- package/dist/tauri/tauri-single-instance.js.map +1 -0
- package/dist/tauri/tauri-surfaces.d.ts +70 -0
- package/dist/tauri/tauri-surfaces.d.ts.map +1 -0
- package/dist/tauri/tauri-surfaces.js +19 -0
- package/dist/tauri/tauri-surfaces.js.map +1 -0
- package/dist/tauri/tauri-window-lifecycle.d.ts +4 -0
- package/dist/tauri/tauri-window-lifecycle.d.ts.map +1 -0
- package/dist/tauri/tauri-window-lifecycle.js +38 -0
- package/dist/tauri/tauri-window-lifecycle.js.map +1 -0
- package/dist/tauri/testing.d.ts +35 -0
- package/dist/tauri/testing.d.ts.map +1 -0
- package/dist/tauri/testing.js +138 -0
- package/dist/tauri/testing.js.map +1 -0
- package/dist/tokens.d.ts +13 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +16 -0
- package/dist/tokens.js.map +1 -0
- package/dist/window-lifecycle.d.ts +42 -0
- package/dist/window-lifecycle.d.ts.map +1 -0
- package/dist/window-lifecycle.js +44 -0
- package/dist/window-lifecycle.js.map +1 -0
- package/dist/windows-registry.d.ts +14 -0
- package/dist/windows-registry.d.ts.map +1 -0
- package/dist/windows-registry.js +37 -0
- package/dist/windows-registry.js.map +1 -0
- package/package.json +51 -0
package/dist/shell.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Backs the bridge's `shell.openExternal`/`shell.openPath` (`bridge.ts`)
|
|
3
|
+
* from the host side — this was missing from scope 1's file list even
|
|
4
|
+
* though C7's narrow slice explicitly names "open-path/open-external" as
|
|
5
|
+
* something both the Electron and Tauri adapters must provide. Filed here
|
|
6
|
+
* rather than retroactively editing scope 1, since it only became
|
|
7
|
+
* apparent as a gap while wiring the Tauri adapter (scope 4) against the
|
|
8
|
+
* same `DesktopHostPorts` shape scope 3 established.
|
|
9
|
+
*
|
|
10
|
+
* **2026-07-22 addition — `dirExists`/`recentDirs`/`openFolderDialog`.**
|
|
11
|
+
* OD route-parity gap-fill: OD's daemon exposes `/api/dir-exists`,
|
|
12
|
+
* `/api/recent-dirs`, and `/api/dialog/open-folder` as HTTP routes, but
|
|
13
|
+
* those are host-process bridge capabilities (a directory picker, a
|
|
14
|
+
* recent-locations list, a filesystem existence check against the local
|
|
15
|
+
* machine the desktop shell is running on) — `@jini-ai/http` has no
|
|
16
|
+
* desktop/Electron-bridge concept and never will, so this is where the
|
|
17
|
+
* capability actually belongs: the same `ShellPort` a chat UI's
|
|
18
|
+
* `window.__jini__` bridge already reaches for `openExternal`/`openPath`.
|
|
19
|
+
* See `packages/desktop-host/source-map.md`'s dated entry for the full
|
|
20
|
+
* per-adapter provenance, including the one deliberate gap:
|
|
21
|
+
* `recentDirs` has no Tauri equivalent and throws `NotImplementedError`
|
|
22
|
+
* there rather than being silently stubbed to an empty array.
|
|
23
|
+
*/
|
|
24
|
+
export class ShellError extends Error {
|
|
25
|
+
constructor(message) {
|
|
26
|
+
super(message);
|
|
27
|
+
this.name = 'ShellError';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=shell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shell.js","sourceRoot":"","sources":["../src/shell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,MAAM,OAAO,UAAW,SAAQ,KAAK;IACnC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface SidecarProcessHandle {
|
|
2
|
+
readonly pid: number | undefined;
|
|
3
|
+
onExit(listener: (code: number | null, signal: NodeJS.Signals | null) => void): void;
|
|
4
|
+
kill(signal?: NodeJS.Signals): boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface SidecarLaunchOptions {
|
|
7
|
+
command: string;
|
|
8
|
+
args?: string[];
|
|
9
|
+
env?: NodeJS.ProcessEnv;
|
|
10
|
+
cwd?: string;
|
|
11
|
+
logPath?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface SidecarReadyOptions<T> {
|
|
14
|
+
probe: () => Promise<T>;
|
|
15
|
+
isReady: (status: T) => boolean;
|
|
16
|
+
timeoutMs?: number;
|
|
17
|
+
pollIntervalMs?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface SidecarShutdownOptions {
|
|
20
|
+
requestShutdown?: () => Promise<void>;
|
|
21
|
+
gracefulTimeoutMs?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface SidecarHandle {
|
|
24
|
+
readonly process: SidecarProcessHandle;
|
|
25
|
+
readonly logPath: string | null;
|
|
26
|
+
waitUntilReady<T>(options: SidecarReadyOptions<T>): Promise<T>;
|
|
27
|
+
shutdown(options?: SidecarShutdownOptions): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
export interface SidecarLauncherPort {
|
|
30
|
+
launch(options: SidecarLaunchOptions): Promise<SidecarHandle>;
|
|
31
|
+
}
|
|
32
|
+
export declare function createNodeSidecarLauncher(): SidecarLauncherPort;
|
|
33
|
+
export declare function appendSidecarLifecycleLog(logPath: string, message: string): Promise<void>;
|
|
34
|
+
//# sourceMappingURL=sidecar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidecar.d.ts","sourceRoot":"","sources":["../src/sidecar.ts"],"names":[],"mappings":"AAsBA,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,MAAM,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI,CAAC;IACrF,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;CACxC;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACpC,KAAK,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;IACxB,OAAO,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,eAAe,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,oBAAoB,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,cAAc,CAAC,CAAC,EAAE,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC/D,QAAQ,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3D;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAC/D;AAmFD,wBAAgB,yBAAyB,IAAI,mBAAmB,CAsC/D;AAED,wBAAsB,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAG/F"}
|
package/dist/sidecar.js
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generalized from OD `apps/packaged/src/sidecars.ts`'s spawn/discover/
|
|
3
|
+
* shutdown mechanics (`startPackagedSidecars`/`waitForStatus`/
|
|
4
|
+
* `closeManagedChild`) — NOT a lift of that file, which is ~620 lines deep
|
|
5
|
+
* in OD's own two-sidecar (daemon+web) model, `@open-design/sidecar-proto`'s
|
|
6
|
+
* JSON-IPC wire format, PostHog/telemetry env forwarding, and legacy-data
|
|
7
|
+
* migration timeouts. None of that is generic. What C7 actually names
|
|
8
|
+
* ("sidecar launch/discovery... shutdown, crash recovery") is: spawn a
|
|
9
|
+
* child process with output captured to a log file, poll a
|
|
10
|
+
* caller-supplied readiness probe until it reports ready — racing the
|
|
11
|
+
* child's own exit so a sidecar that crashes at startup fails fast instead
|
|
12
|
+
* of hanging out the full timeout — then, on shutdown, ask the child to
|
|
13
|
+
* stop gracefully with a caller-supplied request and fall back to a signal
|
|
14
|
+
* kill if it doesn't exit in time. This file rebuilds exactly that,
|
|
15
|
+
* transport-agnostic (the probe/shutdown-request functions are the
|
|
16
|
+
* caller's business, not a specific IPC wire format this package invents).
|
|
17
|
+
*/
|
|
18
|
+
import { spawn } from 'node:child_process';
|
|
19
|
+
import { appendFile, mkdir, open } from 'node:fs/promises';
|
|
20
|
+
import { dirname } from 'node:path';
|
|
21
|
+
import { setTimeout as sleep } from 'node:timers/promises';
|
|
22
|
+
const DEFAULT_READY_TIMEOUT_MS = 35_000;
|
|
23
|
+
const DEFAULT_POLL_INTERVAL_MS = 150;
|
|
24
|
+
const DEFAULT_GRACEFUL_SHUTDOWN_TIMEOUT_MS = 5_000;
|
|
25
|
+
async function waitForProcessExit(child, timeoutMs) {
|
|
26
|
+
if (child.exitCode !== null || child.signalCode !== null)
|
|
27
|
+
return true;
|
|
28
|
+
return await new Promise((resolve) => {
|
|
29
|
+
const timer = setTimeout(() => {
|
|
30
|
+
child.off('exit', onExit);
|
|
31
|
+
resolve(false);
|
|
32
|
+
}, timeoutMs);
|
|
33
|
+
const onExit = () => {
|
|
34
|
+
clearTimeout(timer);
|
|
35
|
+
resolve(true);
|
|
36
|
+
};
|
|
37
|
+
child.once('exit', onExit);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
async function waitUntilReady(child, logPath, options) {
|
|
41
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_READY_TIMEOUT_MS;
|
|
42
|
+
const pollIntervalMs = options.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS;
|
|
43
|
+
const startedAt = Date.now();
|
|
44
|
+
let lastError;
|
|
45
|
+
let exited = child.exitCode !== null || child.signalCode !== null ? { code: child.exitCode, signal: child.signalCode } : null;
|
|
46
|
+
const onExit = (code, signal) => {
|
|
47
|
+
exited = { code, signal };
|
|
48
|
+
};
|
|
49
|
+
child.once('exit', onExit);
|
|
50
|
+
try {
|
|
51
|
+
while (Date.now() - startedAt < timeoutMs) {
|
|
52
|
+
if (exited !== null) {
|
|
53
|
+
throw new Error(`sidecar exited before reporting ready (code=${exited.code}, signal=${exited.signal ?? 'none'})${logPath == null ? '' : `; see ${logPath} for details`}`);
|
|
54
|
+
}
|
|
55
|
+
try {
|
|
56
|
+
const status = await options.probe();
|
|
57
|
+
if (options.isReady(status))
|
|
58
|
+
return status;
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
lastError = error;
|
|
62
|
+
}
|
|
63
|
+
await sleep(pollIntervalMs);
|
|
64
|
+
}
|
|
65
|
+
throw new Error(`timed out waiting for sidecar to become ready${lastError instanceof Error ? ` (${lastError.message})` : ''}`);
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
child.off('exit', onExit);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
async function shutdownChild(child, options = {}) {
|
|
72
|
+
if (options.requestShutdown != null) {
|
|
73
|
+
try {
|
|
74
|
+
await options.requestShutdown();
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
// Fall through to process-level termination below.
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const gracefulTimeoutMs = options.gracefulTimeoutMs ?? DEFAULT_GRACEFUL_SHUTDOWN_TIMEOUT_MS;
|
|
81
|
+
if (await waitForProcessExit(child, gracefulTimeoutMs))
|
|
82
|
+
return;
|
|
83
|
+
child.kill('SIGKILL');
|
|
84
|
+
await waitForProcessExit(child, gracefulTimeoutMs);
|
|
85
|
+
}
|
|
86
|
+
async function openLogHandle(logPath) {
|
|
87
|
+
if (logPath == null)
|
|
88
|
+
return null;
|
|
89
|
+
await mkdir(dirname(logPath), { recursive: true });
|
|
90
|
+
return await open(logPath, 'a');
|
|
91
|
+
}
|
|
92
|
+
export function createNodeSidecarLauncher() {
|
|
93
|
+
return {
|
|
94
|
+
async launch(options) {
|
|
95
|
+
const logHandle = await openLogHandle(options.logPath);
|
|
96
|
+
const child = spawn(options.command, options.args ?? [], {
|
|
97
|
+
cwd: options.cwd,
|
|
98
|
+
env: options.env,
|
|
99
|
+
stdio: ['ignore', logHandle?.fd ?? 'ignore', logHandle?.fd ?? 'ignore'],
|
|
100
|
+
});
|
|
101
|
+
await new Promise((resolveSpawn, rejectSpawn) => {
|
|
102
|
+
child.once('error', rejectSpawn);
|
|
103
|
+
child.once('spawn', resolveSpawn);
|
|
104
|
+
});
|
|
105
|
+
const processHandle = {
|
|
106
|
+
pid: child.pid,
|
|
107
|
+
onExit(listener) {
|
|
108
|
+
child.on('exit', listener);
|
|
109
|
+
},
|
|
110
|
+
kill(signal) {
|
|
111
|
+
return child.kill(signal);
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
return {
|
|
115
|
+
process: processHandle,
|
|
116
|
+
logPath: options.logPath ?? null,
|
|
117
|
+
waitUntilReady: (readyOptions) => waitUntilReady(child, options.logPath ?? null, readyOptions),
|
|
118
|
+
async shutdown(shutdownOptions) {
|
|
119
|
+
try {
|
|
120
|
+
await shutdownChild(child, shutdownOptions);
|
|
121
|
+
}
|
|
122
|
+
finally {
|
|
123
|
+
await logHandle?.close().catch(() => undefined);
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
export async function appendSidecarLifecycleLog(logPath, message) {
|
|
131
|
+
await mkdir(dirname(logPath), { recursive: true });
|
|
132
|
+
await appendFile(logPath, `${message}\n`, 'utf8').catch(() => undefined);
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=sidecar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sidecar.js","sourceRoot":"","sources":["../src/sidecar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,KAAK,EAAqB,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAmB,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,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ch.ts`'s
|
|
3
|
+
* `claimPackagedSingleInstanceLock` — the only OD-specific thing about the
|
|
4
|
+
* original was its name and the namespace-scoped paths threaded alongside it
|
|
5
|
+
* elsewhere in that file. The lock mechanism itself was already generic.
|
|
6
|
+
*/
|
|
7
|
+
export interface SingleInstanceApp {
|
|
8
|
+
requestSingleInstanceLock(): boolean;
|
|
9
|
+
quit(): void;
|
|
10
|
+
onSecondInstance(listener: () => void): void;
|
|
11
|
+
}
|
|
12
|
+
/** Bound to one host app instance, matching how `WindowLifecyclePort`/`ProtocolHandlerPort` are bound at construction rather than taking the host handle per call. */
|
|
13
|
+
export interface SingleInstanceLockPort {
|
|
14
|
+
claim(onSecondInstance: () => void): boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function claimSingleInstanceLock(app: SingleInstanceApp, onSecondInstance: () => void): boolean;
|
|
17
|
+
export declare function createSingleInstanceLockPort(app: SingleInstanceApp): SingleInstanceLockPort;
|
|
18
|
+
//# sourceMappingURL=single-instance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-instance.d.ts","sourceRoot":"","sources":["../src/single-instance.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,iBAAiB;IAChC,yBAAyB,IAAI,OAAO,CAAC;IACrC,IAAI,IAAI,IAAI,CAAC;IACb,gBAAgB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CAC9C;AAED,sKAAsK;AACtK,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,gBAAgB,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC;CAC9C;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,IAAI,GAAG,OAAO,CAOrG;AAED,wBAAgB,4BAA4B,CAAC,GAAG,EAAE,iBAAiB,GAAG,sBAAsB,CAE3F"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generalized from OD `apps/packaged/src/launch.ts`'s
|
|
3
|
+
* `claimPackagedSingleInstanceLock` — the only OD-specific thing about the
|
|
4
|
+
* original was its name and the namespace-scoped paths threaded alongside it
|
|
5
|
+
* elsewhere in that file. The lock mechanism itself was already generic.
|
|
6
|
+
*/
|
|
7
|
+
export function claimSingleInstanceLock(app, onSecondInstance) {
|
|
8
|
+
if (!app.requestSingleInstanceLock()) {
|
|
9
|
+
app.quit();
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
app.onSecondInstance(onSecondInstance);
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
export function createSingleInstanceLockPort(app) {
|
|
16
|
+
return { claim: (onSecondInstance) => claimSingleInstanceLock(app, onSecondInstance) };
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=single-instance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-instance.js","sourceRoot":"","sources":["../src/single-instance.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,MAAM,UAAU,uBAAuB,CAAC,GAAsB,EAAE,gBAA4B;IAC1F,IAAI,CAAC,GAAG,CAAC,yBAAyB,EAAE,EAAE,CAAC;QACrC,GAAG,CAAC,IAAI,EAAE,CAAC;QACX,OAAO,KAAK,CAAC;IACf,CAAC;IACD,GAAG,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACvC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,GAAsB;IACjE,OAAO,EAAE,KAAK,EAAE,CAAC,gBAAgB,EAAE,EAAE,CAAC,uBAAuB,CAAC,GAAG,EAAE,gBAAgB,CAAC,EAAE,CAAC;AACzF,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { DesktopHost, DesktopHostPorts } from '../ports.js';
|
|
2
|
+
import type { TauriDialogApi, TauriFsApi, TauriShellApi, TauriSidecarCommandApi, TauriSingleInstanceApi, TauriWindowFactory } from './tauri-surfaces.js';
|
|
3
|
+
export interface TauriDesktopHostSurfaces {
|
|
4
|
+
singleInstance: TauriSingleInstanceApi;
|
|
5
|
+
createWindow: TauriWindowFactory;
|
|
6
|
+
shell: TauriShellApi;
|
|
7
|
+
sidecarCommands: TauriSidecarCommandApi;
|
|
8
|
+
/** Backs `ShellPort.dirExists` (2026-07-22 addition — see `shell.ts`'s module doc). */
|
|
9
|
+
fs: TauriFsApi;
|
|
10
|
+
/** Backs `ShellPort.openFolderDialog` (2026-07-22 addition — see `shell.ts`'s module doc). */
|
|
11
|
+
dialog: TauriDialogApi;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Narrow C7 spike: sidecar launch/discovery, URL load, shutdown, crash
|
|
15
|
+
* recovery, single-instance, open-path/open-external. `protocolHandler`
|
|
16
|
+
* and `renderService` are NotImplementedError-throwing stubs — see
|
|
17
|
+
* `tauri-protocol.ts`/`tauri-render-service.ts` for why each is out of
|
|
18
|
+
* scope for this pass.
|
|
19
|
+
*/
|
|
20
|
+
export declare function createTauriDesktopHost(surfaces: TauriDesktopHostSurfaces, overrides?: Partial<DesktopHostPorts>): DesktopHost;
|
|
21
|
+
//# sourceMappingURL=create-tauri-desktop-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-tauri-desktop-host.d.ts","sourceRoot":"","sources":["../../src/tauri/create-tauri-desktop-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAOjE,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzJ,MAAM,WAAW,wBAAwB;IACvC,cAAc,EAAE,sBAAsB,CAAC;IACvC,YAAY,EAAE,kBAAkB,CAAC;IACjC,KAAK,EAAE,aAAa,CAAC;IACrB,eAAe,EAAE,sBAAsB,CAAC;IACxC,uFAAuF;IACvF,EAAE,EAAE,UAAU,CAAC;IACf,8FAA8F;IAC9F,MAAM,EAAE,cAAc,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,wBAAwB,EAClC,SAAS,GAAE,OAAO,CAAC,gBAAgB,CAAM,GACxC,WAAW,CAUb"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createTauriSingleInstanceLockPort } from './tauri-single-instance.js';
|
|
2
|
+
import { createTauriWindowLifecyclePort } from './tauri-window-lifecycle.js';
|
|
3
|
+
import { createTauriProtocolHandlerPort } from './tauri-protocol.js';
|
|
4
|
+
import { createTauriSidecarLauncher } from './tauri-sidecar.js';
|
|
5
|
+
import { createTauriRenderService } from './tauri-render-service.js';
|
|
6
|
+
import { createTauriShellPort } from './tauri-shell.js';
|
|
7
|
+
/**
|
|
8
|
+
* Narrow C7 spike: sidecar launch/discovery, URL load, shutdown, crash
|
|
9
|
+
* recovery, single-instance, open-path/open-external. `protocolHandler`
|
|
10
|
+
* and `renderService` are NotImplementedError-throwing stubs — see
|
|
11
|
+
* `tauri-protocol.ts`/`tauri-render-service.ts` for why each is out of
|
|
12
|
+
* scope for this pass.
|
|
13
|
+
*/
|
|
14
|
+
export function createTauriDesktopHost(surfaces, overrides = {}) {
|
|
15
|
+
const ports = {
|
|
16
|
+
singleInstance: overrides.singleInstance ?? createTauriSingleInstanceLockPort(surfaces.singleInstance),
|
|
17
|
+
windowLifecycle: overrides.windowLifecycle ?? createTauriWindowLifecyclePort(surfaces.createWindow),
|
|
18
|
+
protocolHandler: overrides.protocolHandler ?? createTauriProtocolHandlerPort(),
|
|
19
|
+
sidecarLauncher: overrides.sidecarLauncher ?? createTauriSidecarLauncher(surfaces.sidecarCommands),
|
|
20
|
+
renderService: overrides.renderService ?? createTauriRenderService(),
|
|
21
|
+
shell: overrides.shell ?? createTauriShellPort({ shell: surfaces.shell, fs: surfaces.fs, dialog: surfaces.dialog }),
|
|
22
|
+
};
|
|
23
|
+
return { backend: 'tauri', ports };
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=create-tauri-desktop-host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-tauri-desktop-host.js","sourceRoot":"","sources":["../../src/tauri/create-tauri-desktop-host.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAcxD;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CACpC,QAAkC,EAClC,YAAuC,EAAE;IAEzC,MAAM,KAAK,GAAqB;QAC9B,cAAc,EAAE,SAAS,CAAC,cAAc,IAAI,iCAAiC,CAAC,QAAQ,CAAC,cAAc,CAAC;QACtG,eAAe,EAAE,SAAS,CAAC,eAAe,IAAI,8BAA8B,CAAC,QAAQ,CAAC,YAAY,CAAC;QACnG,eAAe,EAAE,SAAS,CAAC,eAAe,IAAI,8BAA8B,EAAE;QAC9E,eAAe,EAAE,SAAS,CAAC,eAAe,IAAI,0BAA0B,CAAC,QAAQ,CAAC,eAAe,CAAC;QAClG,aAAa,EAAE,SAAS,CAAC,aAAa,IAAI,wBAAwB,EAAE;QACpE,KAAK,EAAE,SAAS,CAAC,KAAK,IAAI,oBAAoB,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;KACpH,CAAC;IACF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Shared marker error for the Tauri adapter's explicitly-out-of-scope port methods (RenderService, ProtocolHandlerPort — see each file's header comment for why). */
|
|
2
|
+
export declare class NotImplementedError extends Error {
|
|
3
|
+
constructor(message: string);
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=not-implemented.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not-implemented.d.ts","sourceRoot":"","sources":["../../src/tauri/not-implemented.ts"],"names":[],"mappings":"AAAA,sKAAsK;AACtK,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM;CAI5B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Shared marker error for the Tauri adapter's explicitly-out-of-scope port methods (RenderService, ProtocolHandlerPort — see each file's header comment for why). */
|
|
2
|
+
export class NotImplementedError extends Error {
|
|
3
|
+
constructor(message) {
|
|
4
|
+
super(message);
|
|
5
|
+
this.name = 'NotImplementedError';
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=not-implemented.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not-implemented.js","sourceRoot":"","sources":["../../src/tauri/not-implemented.ts"],"names":[],"mappings":"AAAA,sKAAsK;AACtK,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC5C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tauri-protocol.d.ts","sourceRoot":"","sources":["../../src/tauri/tauri-protocol.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,wBAAgB,8BAA8B,IAAI,mBAAmB,CAQpE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom-scheme-as-fetch-proxy registration (`registerSchemesAsPrivileged`
|
|
3
|
+
* + `protocol.handle`) is an Electron main-process API with no JS-callable
|
|
4
|
+
* Tauri equivalent — Tauri's custom protocol handlers are registered in
|
|
5
|
+
* Rust at build/config time (`tauri.conf.json` + a Rust `register_uri_scheme_protocol`
|
|
6
|
+
* call), not from the webview's JS runtime. C7's narrow Tauri slice does
|
|
7
|
+
* not name protocol handling at all (it names "URL load", which
|
|
8
|
+
* `tauri-window-lifecycle.ts` already covers via `navigate`), so this is a
|
|
9
|
+
* clearly-marked stub rather than a real adapter, same treatment as
|
|
10
|
+
* `tauri-render-service.ts`.
|
|
11
|
+
*/
|
|
12
|
+
import { NotImplementedError } from './not-implemented.js';
|
|
13
|
+
export function createTauriProtocolHandlerPort() {
|
|
14
|
+
return {
|
|
15
|
+
registerSchemeProxy() {
|
|
16
|
+
throw new NotImplementedError('ProtocolHandlerPort.registerSchemeProxy is not implemented by the Tauri adapter — custom scheme registration is a Rust/tauri.conf.json-time concern with no JS-callable equivalent, and is out of scope for the C7 narrow spike');
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=tauri-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tauri-protocol.js","sourceRoot":"","sources":["../../src/tauri/tauri-protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAG3D,MAAM,UAAU,8BAA8B;IAC5C,OAAO;QACL,mBAAmB;YACjB,MAAM,IAAI,mBAAmB,CAC3B,iOAAiO,CAClO,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per the task brief: "if RenderService genuinely can't be satisfied by
|
|
3
|
+
* Tauri without more work than a spike warrants, implement a
|
|
4
|
+
* clearly-marked NotImplementedError-throwing stub for just that port."
|
|
5
|
+
* That's the case here — Tauri has no equivalent of Electron's
|
|
6
|
+
* `webContents.printToPDF`/`capturePage` reachable from a narrow JS-side
|
|
7
|
+
* spike; a real implementation would mean driving a headless-Chromium (or
|
|
8
|
+
* wry/WebView2-native) rendering pipeline from the Rust side, which is
|
|
9
|
+
* real work belonging to a follow-up task, not this one. This stub proves
|
|
10
|
+
* the port boundary is honest (the type system still requires a
|
|
11
|
+
* `RenderService`) without pretending Tauri rendering exists yet.
|
|
12
|
+
*/
|
|
13
|
+
import type { RenderService } from '../render-service.js';
|
|
14
|
+
import { NotImplementedError } from './not-implemented.js';
|
|
15
|
+
export { NotImplementedError };
|
|
16
|
+
export declare function createTauriRenderService(): RenderService;
|
|
17
|
+
//# sourceMappingURL=tauri-render-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tauri-render-service.d.ts","sourceRoot":"","sources":["../../src/tauri/tauri-render-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAQ/B,wBAAgB,wBAAwB,IAAI,aAAa,CAYxD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { NotImplementedError } from './not-implemented.js';
|
|
2
|
+
export { NotImplementedError };
|
|
3
|
+
function notImplemented(method) {
|
|
4
|
+
throw new NotImplementedError(`RenderService.${method} is not implemented by the Tauri adapter — out of scope for the C7 narrow spike (sidecar/window/shutdown/single-instance/shell only)`);
|
|
5
|
+
}
|
|
6
|
+
export function createTauriRenderService() {
|
|
7
|
+
return {
|
|
8
|
+
async renderToPdf() {
|
|
9
|
+
return notImplemented('renderToPdf');
|
|
10
|
+
},
|
|
11
|
+
async capture() {
|
|
12
|
+
return notImplemented('capture');
|
|
13
|
+
},
|
|
14
|
+
async exportArtifact() {
|
|
15
|
+
return notImplemented('exportArtifact');
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=tauri-render-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tauri-render-service.js","sourceRoot":"","sources":["../../src/tauri/tauri-render-service.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAE/B,SAAS,cAAc,CAAC,MAAc;IACpC,MAAM,IAAI,mBAAmB,CAC3B,iBAAiB,MAAM,sIAAsI,CAC9J,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wBAAwB;IACtC,OAAO;QACL,KAAK,CAAC,WAAW;YACf,OAAO,cAAc,CAAC,aAAa,CAAC,CAAC;QACvC,CAAC;QACD,KAAK,CAAC,OAAO;YACX,OAAO,cAAc,CAAC,SAAS,CAAC,CAAC;QACnC,CAAC;QACD,KAAK,CAAC,cAAc;YAClB,OAAO,cAAc,CAAC,gBAAgB,CAAC,CAAC;QAC1C,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ShellPort } from '../shell.js';
|
|
2
|
+
import type { TauriDialogApi, TauriFsApi, TauriShellApi } from './tauri-surfaces.js';
|
|
3
|
+
export interface TauriShellSurfaces {
|
|
4
|
+
shell: TauriShellApi;
|
|
5
|
+
fs: TauriFsApi;
|
|
6
|
+
dialog: TauriDialogApi;
|
|
7
|
+
}
|
|
8
|
+
export declare function createTauriShellPort(surfaces: TauriShellSurfaces): ShellPort;
|
|
9
|
+
//# sourceMappingURL=tauri-shell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tauri-shell.d.ts","sourceRoot":"","sources":["../../src/tauri/tauri-shell.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA2B,SAAS,EAAE,MAAM,aAAa,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAErF,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,aAAa,CAAC;IACrB,EAAE,EAAE,UAAU,CAAC;IACf,MAAM,EAAE,cAAc,CAAC;CACxB;AAQD,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,kBAAkB,GAAG,SAAS,CAmC5E"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { NotImplementedError } from './not-implemented.js';
|
|
2
|
+
function notImplemented(method) {
|
|
3
|
+
throw new NotImplementedError(`ShellPort.${method} is not implemented by the Tauri adapter — Tauri has no recent-documents API equivalent to Electron's app.getRecentDocuments() (see shell.ts's module doc)`);
|
|
4
|
+
}
|
|
5
|
+
export function createTauriShellPort(surfaces) {
|
|
6
|
+
return {
|
|
7
|
+
openExternal: (url) => surfaces.shell.openUrl(url),
|
|
8
|
+
openPath: (path) => surfaces.shell.openPath(path),
|
|
9
|
+
async dirExists(path) {
|
|
10
|
+
// ShellPort.dirExists documents "never throws" — a permission error, or the path vanishing
|
|
11
|
+
// between exists() and stat(), must resolve false, matching the Electron adapter.
|
|
12
|
+
try {
|
|
13
|
+
const exists = await surfaces.fs.exists(path);
|
|
14
|
+
if (!exists)
|
|
15
|
+
return false;
|
|
16
|
+
const info = await surfaces.fs.stat(path);
|
|
17
|
+
return info.isDirectory;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
// Tauri's single-instance-style "there is no JS-callable equivalent" pattern already
|
|
24
|
+
// documented in `tauri-surfaces.ts` applies here too, for a different reason: the
|
|
25
|
+
// `tauri-plugin-fs`/`tauri-plugin-dialog` surfaces this adapter is built against have no
|
|
26
|
+
// recent-documents concept at all (unlike Electron's `app.getRecentDocuments()`) — this is a
|
|
27
|
+
// genuine platform gap, not a missing wiring. Explicit `NotImplementedError`, matching
|
|
28
|
+
// `tauri-render-service.ts`/`tauri-protocol.ts`'s established precedent for exactly this
|
|
29
|
+
// shape (a real port method the Tauri adapter cannot honestly satisfy).
|
|
30
|
+
async recentDirs() {
|
|
31
|
+
return notImplemented('recentDirs');
|
|
32
|
+
},
|
|
33
|
+
async openFolderDialog(options) {
|
|
34
|
+
const result = await surfaces.dialog.open({
|
|
35
|
+
directory: true,
|
|
36
|
+
...(options?.defaultPath !== undefined ? { defaultPath: options.defaultPath } : {}),
|
|
37
|
+
});
|
|
38
|
+
if (result === null)
|
|
39
|
+
return null;
|
|
40
|
+
return Array.isArray(result) ? (result[0] ?? null) : result;
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=tauri-shell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tauri-shell.js","sourceRoot":"","sources":["../../src/tauri/tauri-shell.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAS3D,SAAS,cAAc,CAAC,MAAc;IACpC,MAAM,IAAI,mBAAmB,CAC3B,aAAa,MAAM,4JAA4J,CAChL,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,QAA4B;IAC/D,OAAO;QACL,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAClD,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;QACjD,KAAK,CAAC,SAAS,CAAC,IAAY;YAC1B,2FAA2F;YAC3F,kFAAkF;YAClF,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBAC9C,IAAI,CAAC,MAAM;oBAAE,OAAO,KAAK,CAAC;gBAC1B,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC1C,OAAO,IAAI,CAAC,WAAW,CAAC;YAC1B,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,KAAK,CAAC;YACf,CAAC;QACH,CAAC;QACD,qFAAqF;QACrF,kFAAkF;QAClF,yFAAyF;QACzF,6FAA6F;QAC7F,uFAAuF;QACvF,yFAAyF;QACzF,wEAAwE;QACxE,KAAK,CAAC,UAAU;YACd,OAAO,cAAc,CAAC,YAAY,CAAC,CAAC;QACtC,CAAC;QACD,KAAK,CAAC,gBAAgB,CAAC,OAAiC;YACtD,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;gBACxC,SAAS,EAAE,IAAI;gBACf,GAAG,CAAC,OAAO,EAAE,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;aACpF,CAAC,CAAC;YACH,IAAI,MAAM,KAAK,IAAI;gBAAE,OAAO,IAAI,CAAC;YACjC,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAC9D,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SidecarLauncherPort } from '../sidecar.js';
|
|
2
|
+
import type { TauriSidecarCommandApi } from './tauri-surfaces.js';
|
|
3
|
+
export declare function createTauriSidecarLauncher(api: TauriSidecarCommandApi): SidecarLauncherPort;
|
|
4
|
+
//# sourceMappingURL=tauri-sidecar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tauri-sidecar.d.ts","sourceRoot":"","sources":["../../src/tauri/tauri-sidecar.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAuC,mBAAmB,EAAqE,MAAM,eAAe,CAAC;AACjK,OAAO,KAAK,EAAyB,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AA2DzF,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,sBAAsB,GAAG,mBAAmB,CAiB3F"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Same launch/discovery/shutdown contract as `../sidecar.ts`'s
|
|
3
|
+
* `createNodeSidecarLauncher`, reimplemented against Tauri's sidecar
|
|
4
|
+
* command API instead of `node:child_process` — a real Tauri webview has
|
|
5
|
+
* no direct Node process-spawning access; sidecars are launched through
|
|
6
|
+
* the shell plugin's allowlisted `Command.sidecar` mechanism. Duplicated
|
|
7
|
+
* rather than shared because the two process handle shapes
|
|
8
|
+
* (`node:child_process.ChildProcess` vs `TauriChildProcessLike`) are
|
|
9
|
+
* different enough that a common implementation would need its own
|
|
10
|
+
* abstraction layer for no real benefit at this package's size.
|
|
11
|
+
*/
|
|
12
|
+
import { setTimeout as sleep } from 'node:timers/promises';
|
|
13
|
+
const DEFAULT_READY_TIMEOUT_MS = 35_000;
|
|
14
|
+
const DEFAULT_POLL_INTERVAL_MS = 150;
|
|
15
|
+
const DEFAULT_GRACEFUL_SHUTDOWN_TIMEOUT_MS = 5_000;
|
|
16
|
+
async function waitForProcessExit(child, timeoutMs) {
|
|
17
|
+
return await new Promise((resolve) => {
|
|
18
|
+
let exited = false;
|
|
19
|
+
child.onExit(() => {
|
|
20
|
+
exited = true;
|
|
21
|
+
resolve(true);
|
|
22
|
+
});
|
|
23
|
+
setTimeout(() => {
|
|
24
|
+
if (!exited)
|
|
25
|
+
resolve(false);
|
|
26
|
+
}, timeoutMs);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
async function waitUntilReady(child, options) {
|
|
30
|
+
const timeoutMs = options.timeoutMs ?? DEFAULT_READY_TIMEOUT_MS;
|
|
31
|
+
const pollIntervalMs = options.pollIntervalMs ?? DEFAULT_POLL_INTERVAL_MS;
|
|
32
|
+
const startedAt = Date.now();
|
|
33
|
+
let lastError;
|
|
34
|
+
let exited = null;
|
|
35
|
+
child.onExit((code, signal) => {
|
|
36
|
+
exited = { code, signal };
|
|
37
|
+
});
|
|
38
|
+
while (Date.now() - startedAt < timeoutMs) {
|
|
39
|
+
if (exited !== null) {
|
|
40
|
+
const info = exited;
|
|
41
|
+
throw new Error(`sidecar exited before reporting ready (code=${info.code}, signal=${info.signal ?? 'none'})`);
|
|
42
|
+
}
|
|
43
|
+
try {
|
|
44
|
+
const status = await options.probe();
|
|
45
|
+
if (options.isReady(status))
|
|
46
|
+
return status;
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
lastError = error;
|
|
50
|
+
}
|
|
51
|
+
await sleep(pollIntervalMs);
|
|
52
|
+
}
|
|
53
|
+
throw new Error(`timed out waiting for sidecar to become ready${lastError instanceof Error ? ` (${lastError.message})` : ''}`);
|
|
54
|
+
}
|
|
55
|
+
async function shutdownChild(child, options = {}) {
|
|
56
|
+
if (options.requestShutdown != null) {
|
|
57
|
+
try {
|
|
58
|
+
await options.requestShutdown();
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
// Fall through to process-level termination below.
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const gracefulTimeoutMs = options.gracefulTimeoutMs ?? DEFAULT_GRACEFUL_SHUTDOWN_TIMEOUT_MS;
|
|
65
|
+
if (await waitForProcessExit(child, gracefulTimeoutMs))
|
|
66
|
+
return;
|
|
67
|
+
child.kill('SIGKILL');
|
|
68
|
+
await waitForProcessExit(child, gracefulTimeoutMs);
|
|
69
|
+
}
|
|
70
|
+
export function createTauriSidecarLauncher(api) {
|
|
71
|
+
return {
|
|
72
|
+
async launch(options) {
|
|
73
|
+
const child = await api.spawnSidecar(options.command, options.args ?? [], options.env);
|
|
74
|
+
const processHandle = {
|
|
75
|
+
pid: child.pid,
|
|
76
|
+
onExit: (listener) => child.onExit(listener),
|
|
77
|
+
kill: (signal) => child.kill(signal),
|
|
78
|
+
};
|
|
79
|
+
return {
|
|
80
|
+
process: processHandle,
|
|
81
|
+
logPath: null,
|
|
82
|
+
waitUntilReady: (readyOptions) => waitUntilReady(child, readyOptions),
|
|
83
|
+
shutdown: (shutdownOptions) => shutdownChild(child, shutdownOptions),
|
|
84
|
+
};
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=tauri-sidecar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tauri-sidecar.js","sourceRoot":"","sources":["../../src/tauri/tauri-sidecar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAI3D,MAAM,wBAAwB,GAAG,MAAM,CAAC;AACxC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AACrC,MAAM,oCAAoC,GAAG,KAAK,CAAC;AAEnD,KAAK,UAAU,kBAAkB,CAAC,KAA4B,EAAE,SAAiB;IAC/E,OAAO,MAAM,IAAI,OAAO,CAAU,CAAC,OAAO,EAAE,EAAE;QAC5C,IAAI,MAAM,GAAG,KAAK,CAAC;QACnB,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE;YAChB,MAAM,GAAG,IAAI,CAAC;YACd,OAAO,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;QACH,UAAU,CAAC,GAAG,EAAE;YACd,IAAI,CAAC,MAAM;gBAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAC9B,CAAC,EAAE,SAAS,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CA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type { SingleInstanceLockPort } from '../single-instance.js';
|
|
2
|
+
import type { TauriSingleInstanceApi } from './tauri-surfaces.js';
|
|
3
|
+
/**
|
|
4
|
+
* Tauri's single-instance guarantee is enforced Rust-side before this
|
|
5
|
+
* instance's JS ever runs, so `claim` has nothing to request — it just
|
|
6
|
+
* registers the "a second launch was attempted" listener and reports
|
|
7
|
+
* `true`, since by construction this JS is only running because the lock
|
|
8
|
+
* was already granted.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createTauriSingleInstanceLockPort(api: TauriSingleInstanceApi): SingleInstanceLockPort;
|
|
11
|
+
//# sourceMappingURL=tauri-single-instance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tauri-single-instance.d.ts","sourceRoot":"","sources":["../../src/tauri/tauri-single-instance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,GAAG,EAAE,sBAAsB,GAAG,sBAAsB,CAOrG"}
|