@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.
Files changed (134) hide show
  1. package/LICENSE +201 -0
  2. package/dist/bridge-testing.d.ts +16 -0
  3. package/dist/bridge-testing.d.ts.map +1 -0
  4. package/dist/bridge-testing.js +52 -0
  5. package/dist/bridge-testing.js.map +1 -0
  6. package/dist/bridge.d.ts +83 -0
  7. package/dist/bridge.d.ts.map +1 -0
  8. package/dist/bridge.js +138 -0
  9. package/dist/bridge.js.map +1 -0
  10. package/dist/config.d.ts +7 -0
  11. package/dist/config.d.ts.map +1 -0
  12. package/dist/config.js +44 -0
  13. package/dist/config.js.map +1 -0
  14. package/dist/electron/create-electron-desktop-host.d.ts +12 -0
  15. package/dist/electron/create-electron-desktop-host.d.ts.map +1 -0
  16. package/dist/electron/create-electron-desktop-host.js +18 -0
  17. package/dist/electron/create-electron-desktop-host.js.map +1 -0
  18. package/dist/electron/electron-protocol.d.ts +4 -0
  19. package/dist/electron/electron-protocol.d.ts.map +1 -0
  20. package/dist/electron/electron-protocol.js +13 -0
  21. package/dist/electron/electron-protocol.js.map +1 -0
  22. package/dist/electron/electron-render-service.d.ts +12 -0
  23. package/dist/electron/electron-render-service.d.ts.map +1 -0
  24. package/dist/electron/electron-render-service.js +73 -0
  25. package/dist/electron/electron-render-service.js.map +1 -0
  26. package/dist/electron/electron-shell.d.ts +9 -0
  27. package/dist/electron/electron-shell.d.ts.map +1 -0
  28. package/dist/electron/electron-shell.js +39 -0
  29. package/dist/electron/electron-shell.js.map +1 -0
  30. package/dist/electron/electron-single-instance.d.ts +4 -0
  31. package/dist/electron/electron-single-instance.d.ts.map +1 -0
  32. package/dist/electron/electron-single-instance.js +10 -0
  33. package/dist/electron/electron-single-instance.js.map +1 -0
  34. package/dist/electron/electron-surfaces.d.ts +105 -0
  35. package/dist/electron/electron-surfaces.d.ts.map +1 -0
  36. package/dist/electron/electron-surfaces.js +13 -0
  37. package/dist/electron/electron-surfaces.js.map +1 -0
  38. package/dist/electron/electron-window-lifecycle.d.ts +4 -0
  39. package/dist/electron/electron-window-lifecycle.d.ts.map +1 -0
  40. package/dist/electron/electron-window-lifecycle.js +29 -0
  41. package/dist/electron/electron-window-lifecycle.js.map +1 -0
  42. package/dist/electron/testing.d.ts +37 -0
  43. package/dist/electron/testing.d.ts.map +1 -0
  44. package/dist/electron/testing.js +144 -0
  45. package/dist/electron/testing.js.map +1 -0
  46. package/dist/index.d.ts +30 -0
  47. package/dist/index.d.ts.map +1 -0
  48. package/dist/index.js +30 -0
  49. package/dist/index.js.map +1 -0
  50. package/dist/logging.d.ts +30 -0
  51. package/dist/logging.d.ts.map +1 -0
  52. package/dist/logging.js +131 -0
  53. package/dist/logging.js.map +1 -0
  54. package/dist/paths.d.ts +20 -0
  55. package/dist/paths.d.ts.map +1 -0
  56. package/dist/paths.js +80 -0
  57. package/dist/paths.js.map +1 -0
  58. package/dist/ports.d.ts +29 -0
  59. package/dist/ports.d.ts.map +1 -0
  60. package/dist/ports.js +2 -0
  61. package/dist/ports.js.map +1 -0
  62. package/dist/protocol.d.ts +28 -0
  63. package/dist/protocol.d.ts.map +1 -0
  64. package/dist/protocol.js +47 -0
  65. package/dist/protocol.js.map +1 -0
  66. package/dist/render-service.d.ts +79 -0
  67. package/dist/render-service.d.ts.map +1 -0
  68. package/dist/render-service.js +89 -0
  69. package/dist/render-service.js.map +1 -0
  70. package/dist/shell.d.ts +40 -0
  71. package/dist/shell.d.ts.map +1 -0
  72. package/dist/shell.js +30 -0
  73. package/dist/shell.js.map +1 -0
  74. package/dist/sidecar.d.ts +34 -0
  75. package/dist/sidecar.d.ts.map +1 -0
  76. package/dist/sidecar.js +134 -0
  77. package/dist/sidecar.js.map +1 -0
  78. package/dist/single-instance.d.ts +18 -0
  79. package/dist/single-instance.d.ts.map +1 -0
  80. package/dist/single-instance.js +18 -0
  81. package/dist/single-instance.js.map +1 -0
  82. package/dist/tauri/create-tauri-desktop-host.d.ts +21 -0
  83. package/dist/tauri/create-tauri-desktop-host.d.ts.map +1 -0
  84. package/dist/tauri/create-tauri-desktop-host.js +25 -0
  85. package/dist/tauri/create-tauri-desktop-host.js.map +1 -0
  86. package/dist/tauri/not-implemented.d.ts +5 -0
  87. package/dist/tauri/not-implemented.d.ts.map +1 -0
  88. package/dist/tauri/not-implemented.js +8 -0
  89. package/dist/tauri/not-implemented.js.map +1 -0
  90. package/dist/tauri/tauri-protocol.d.ts +3 -0
  91. package/dist/tauri/tauri-protocol.d.ts.map +1 -0
  92. package/dist/tauri/tauri-protocol.js +20 -0
  93. package/dist/tauri/tauri-protocol.js.map +1 -0
  94. package/dist/tauri/tauri-render-service.d.ts +17 -0
  95. package/dist/tauri/tauri-render-service.d.ts.map +1 -0
  96. package/dist/tauri/tauri-render-service.js +19 -0
  97. package/dist/tauri/tauri-render-service.js.map +1 -0
  98. package/dist/tauri/tauri-shell.d.ts +9 -0
  99. package/dist/tauri/tauri-shell.d.ts.map +1 -0
  100. package/dist/tauri/tauri-shell.js +44 -0
  101. package/dist/tauri/tauri-shell.js.map +1 -0
  102. package/dist/tauri/tauri-sidecar.d.ts +4 -0
  103. package/dist/tauri/tauri-sidecar.d.ts.map +1 -0
  104. package/dist/tauri/tauri-sidecar.js +88 -0
  105. package/dist/tauri/tauri-sidecar.js.map +1 -0
  106. package/dist/tauri/tauri-single-instance.d.ts +11 -0
  107. package/dist/tauri/tauri-single-instance.d.ts.map +1 -0
  108. package/dist/tauri/tauri-single-instance.js +16 -0
  109. package/dist/tauri/tauri-single-instance.js.map +1 -0
  110. package/dist/tauri/tauri-surfaces.d.ts +70 -0
  111. package/dist/tauri/tauri-surfaces.d.ts.map +1 -0
  112. package/dist/tauri/tauri-surfaces.js +19 -0
  113. package/dist/tauri/tauri-surfaces.js.map +1 -0
  114. package/dist/tauri/tauri-window-lifecycle.d.ts +4 -0
  115. package/dist/tauri/tauri-window-lifecycle.d.ts.map +1 -0
  116. package/dist/tauri/tauri-window-lifecycle.js +38 -0
  117. package/dist/tauri/tauri-window-lifecycle.js.map +1 -0
  118. package/dist/tauri/testing.d.ts +35 -0
  119. package/dist/tauri/testing.d.ts.map +1 -0
  120. package/dist/tauri/testing.js +138 -0
  121. package/dist/tauri/testing.js.map +1 -0
  122. package/dist/tokens.d.ts +13 -0
  123. package/dist/tokens.d.ts.map +1 -0
  124. package/dist/tokens.js +16 -0
  125. package/dist/tokens.js.map +1 -0
  126. package/dist/window-lifecycle.d.ts +42 -0
  127. package/dist/window-lifecycle.d.ts.map +1 -0
  128. package/dist/window-lifecycle.js +44 -0
  129. package/dist/window-lifecycle.js.map +1 -0
  130. package/dist/windows-registry.d.ts +14 -0
  131. package/dist/windows-registry.d.ts.map +1 -0
  132. package/dist/windows-registry.js +37 -0
  133. package/dist/windows-registry.js.map +1 -0
  134. package/package.json +51 -0
@@ -0,0 +1,30 @@
1
+ export interface HostLogger {
2
+ error(message: string, meta?: Record<string, unknown>): void;
3
+ info(message: string, meta?: Record<string, unknown>): void;
4
+ warn(message: string, meta?: Record<string, unknown>): void;
5
+ }
6
+ export type LogAppend = (path: string, data: string, encoding: BufferEncoding) => void;
7
+ export declare function appendLogLine(logPath: string, line: string, append?: LogAppend): boolean;
8
+ export declare function createFileLogger(logPath: string, options?: {
9
+ echoToConsole?: boolean;
10
+ }): HostLogger;
11
+ /**
12
+ * Matches the known-harmless undici `setTypeOfService EINVAL` shape (see
13
+ * OD issue #895): certain macOS/VPN configurations refuse to let the
14
+ * kernel set the outbound socket's IP_TOS byte, which has no functional
15
+ * effect on the request. `code` is authoritative when present.
16
+ */
17
+ export declare function isHarmlessSocketOptionError(value: unknown): boolean;
18
+ export interface InstallFatalExceptionHandlersOptions {
19
+ isHarmless?: (error: unknown) => boolean;
20
+ }
21
+ /**
22
+ * Installs `uncaughtException`/`unhandledRejection` handlers that log and
23
+ * swallow harmless errors, and for anything else remove themselves before
24
+ * re-throwing via `setImmediate` — without detaching first, the re-throw
25
+ * would re-enter the same handler and loop forever instead of letting
26
+ * Node's default crash path (and Electron's native error dialog) take
27
+ * over. Returns a function that uninstalls both handlers.
28
+ */
29
+ export declare function installFatalExceptionHandlers(logger: HostLogger, options?: InstallFatalExceptionHandlersOptions): () => void;
30
+ //# sourceMappingURL=logging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../src/logging.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC7D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC5D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC7D;AAiCD,MAAM,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,KAAK,IAAI,CAAC;AAEvF,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAE,SAA0B,GAAG,OAAO,CAOxG;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,UAAU,CAoBvG;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAOnE;AAED,MAAM,WAAW,oCAAoC;IACnD,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CAC1C;AAED;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,UAAU,EAClB,OAAO,GAAE,oCAAyC,GACjD,MAAM,IAAI,CAkCZ"}
@@ -0,0 +1,131 @@
1
+ /**
2
+ * Generalized from OD `apps/packaged/src/logging.ts`. The file-append
3
+ * logger, the console-shim (so `console.log`/`warn`/`error` also land in
4
+ * the log file), and the fatal-`uncaughtException`/`unhandledRejection`
5
+ * handler-that-removes-itself-then-rethrows pattern are all genuinely
6
+ * generic Electron/Node main-process concerns. Dropped: everything tied to
7
+ * OD's `PackagedNamespacePaths`/`SidecarStamp` (the log path and any
8
+ * startup metadata are now plain caller-supplied strings), and the
9
+ * `OD_DESKTOP_LOG_ECHO` env var name (now a plain boolean option). The
10
+ * "harmless setTypeOfService EINVAL" filter is kept as the *default*
11
+ * predicate (it's a real, still-relevant undici/macOS quirk any Electron
12
+ * app embedding fetch can hit) but is now overridable — a generic host
13
+ * package should not hardcode that a caller's error taxonomy matches OD's.
14
+ */
15
+ import { appendFileSync } from 'node:fs';
16
+ function normalizeError(error) {
17
+ if (error instanceof Error)
18
+ return { message: error.message, name: error.name, stack: error.stack };
19
+ return error;
20
+ }
21
+ // `meta` is always defined at this call site (see `serializeMessage`'s
22
+ // `meta == null` guard below) — that guard is the single source of truth
23
+ // for the null check, so this helper takes a required parameter rather
24
+ // than duplicating a defensive (and therefore untestable/dead) check.
25
+ function normalizeMeta(meta) {
26
+ return Object.fromEntries(Object.entries(meta).map(([key, value]) => [key, key === 'error' || key === 'reason' ? normalizeError(value) : value]));
27
+ }
28
+ function serializeMessage(level, message, meta) {
29
+ const timestamp = new Date().toISOString();
30
+ try {
31
+ return `${JSON.stringify({ level, message, timestamp, ...(meta == null ? {} : { meta: normalizeMeta(meta) }) })}\n`;
32
+ }
33
+ catch (error) {
34
+ return `${JSON.stringify({
35
+ level,
36
+ message,
37
+ timestamp,
38
+ meta: { serializationError: error instanceof Error ? error.message : String(error) },
39
+ })}\n`;
40
+ }
41
+ }
42
+ export function appendLogLine(logPath, line, append = appendFileSync) {
43
+ try {
44
+ append(logPath, line, 'utf8');
45
+ return true;
46
+ }
47
+ catch {
48
+ return false;
49
+ }
50
+ }
51
+ export function createFileLogger(logPath, options = {}) {
52
+ const echo = options.echoToConsole ?? true;
53
+ const write = (level, message, meta) => {
54
+ appendLogLine(logPath, serializeMessage(level, message, meta));
55
+ };
56
+ const logger = {
57
+ error(message, meta) {
58
+ write('error', message, meta);
59
+ if (echo)
60
+ console.error(message, meta ?? '');
61
+ },
62
+ info(message, meta) {
63
+ write('info', message, meta);
64
+ if (echo)
65
+ console.info(message, meta ?? '');
66
+ },
67
+ warn(message, meta) {
68
+ write('warn', message, meta);
69
+ if (echo)
70
+ console.warn(message, meta ?? '');
71
+ },
72
+ };
73
+ return logger;
74
+ }
75
+ /**
76
+ * Matches the known-harmless undici `setTypeOfService EINVAL` shape (see
77
+ * OD issue #895): certain macOS/VPN configurations refuse to let the
78
+ * kernel set the outbound socket's IP_TOS byte, which has no functional
79
+ * effect on the request. `code` is authoritative when present.
80
+ */
81
+ export function isHarmlessSocketOptionError(value) {
82
+ if (!(value instanceof Error))
83
+ return false;
84
+ const message = typeof value.message === 'string' ? value.message : '';
85
+ if (!message || !message.includes('setTypeOfService'))
86
+ return false;
87
+ const code = value.code;
88
+ if (typeof code === 'string' && code.length > 0)
89
+ return code === 'EINVAL';
90
+ return message.includes('EINVAL');
91
+ }
92
+ /**
93
+ * Installs `uncaughtException`/`unhandledRejection` handlers that log and
94
+ * swallow harmless errors, and for anything else remove themselves before
95
+ * re-throwing via `setImmediate` — without detaching first, the re-throw
96
+ * would re-enter the same handler and loop forever instead of letting
97
+ * Node's default crash path (and Electron's native error dialog) take
98
+ * over. Returns a function that uninstalls both handlers.
99
+ */
100
+ export function installFatalExceptionHandlers(logger, options = {}) {
101
+ const isHarmless = options.isHarmless ?? isHarmlessSocketOptionError;
102
+ const onUncaughtException = (error) => {
103
+ if (isHarmless(error)) {
104
+ logger.warn('swallowed harmless uncaught exception', { error });
105
+ return;
106
+ }
107
+ logger.error('fatal uncaught exception', { error });
108
+ process.removeListener('uncaughtException', onUncaughtException);
109
+ setImmediate(() => {
110
+ throw error;
111
+ });
112
+ };
113
+ const onUnhandledRejection = (reason) => {
114
+ if (isHarmless(reason)) {
115
+ logger.warn('swallowed harmless unhandled rejection', { reason });
116
+ return;
117
+ }
118
+ logger.error('fatal unhandled rejection', { reason });
119
+ process.removeListener('unhandledRejection', onUnhandledRejection);
120
+ setImmediate(() => {
121
+ throw reason;
122
+ });
123
+ };
124
+ process.on('uncaughtException', onUncaughtException);
125
+ process.on('unhandledRejection', onUnhandledRejection);
126
+ return () => {
127
+ process.removeListener('uncaughtException', onUncaughtException);
128
+ process.removeListener('unhandledRejection', onUnhandledRejection);
129
+ };
130
+ }
131
+ //# sourceMappingURL=logging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.js","sourceRoot":"","sources":["../src/logging.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAUzC,SAAS,cAAc,CAAC,KAAc;IACpC,IAAI,KAAK,YAAY,KAAK;QAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;IACpG,OAAO,KAAK,CAAC;AACf,CAAC;AAED,uEAAuE;AACvE,yEAAyE;AACzE,uEAAuE;AACvE,sEAAsE;AACtE,SAAS,aAAa,CAAC,IAA6B;IAClD,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,C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,cAAc,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAC;QACjE,OAAO,CAAC,cAAc,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAAC;IACrE,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,20 @@
1
+ export interface DesktopHostPathRoots {
2
+ namespaceRoot: string;
3
+ dataRoot: string;
4
+ cacheRoot: string;
5
+ logsRoot: string;
6
+ runtimeRoot: string;
7
+ userDataRoot: string;
8
+ sessionDataRoot: string;
9
+ }
10
+ export declare class DesktopHostPathError extends Error {
11
+ constructor(message: string);
12
+ }
13
+ export interface ResolvePathRootsOptions {
14
+ namespace: string;
15
+ namespaceBaseRoot: string;
16
+ dataDirOverrideEnvVar?: string;
17
+ env?: NodeJS.ProcessEnv;
18
+ }
19
+ export declare function resolveDesktopHostPathRoots(options: ResolvePathRootsOptions): DesktopHostPathRoots;
20
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,oBAAoB;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,oBAAqB,SAAQ,KAAK;gBACjC,OAAO,EAAE,MAAM;CAI5B;AAED,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB;AA+CD,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,uBAAuB,GAAG,oBAAoB,CAYlG"}
package/dist/paths.js ADDED
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Generalized from OD `apps/packaged/src/paths.ts`. On inspection this file
3
+ * was **far more OD-coupled than the task brief expected**: it hardcodes
4
+ * the `OD_DATA_DIR` env var name, "Open Design"-branded error strings, and
5
+ * a dozen OD-specific roots (`desktopIdentityPath`, `headlessIdentityPath`,
6
+ * `webIdentityPath`, `installerObservationRoot`, `updateRoot`, and the
7
+ * `installationRoot` used for cross-namespace installationId persistence —
8
+ * an OD/PostHog-analytics concept). What's actually generic is the layout
9
+ * *pattern* — a base root, a namespace segment, a small fixed set of
10
+ * per-namespace subdirectories, and a data-dir override env var that must
11
+ * resolve to an absolute path and must agree with the active namespace if
12
+ * it already looks namespace-scoped. This port keeps that pattern and
13
+ * drops every OD-specific field and string; the env var name is now
14
+ * caller-supplied instead of hardcoded.
15
+ */
16
+ import { homedir } from 'node:os';
17
+ import { isAbsolute, join, win32 } from 'node:path';
18
+ export class DesktopHostPathError extends Error {
19
+ constructor(message) {
20
+ super(message);
21
+ this.name = 'DesktopHostPathError';
22
+ }
23
+ }
24
+ const HOME_BARE_TOKENS = new Set(['~', '$HOME', '${HOME}']);
25
+ const HOME_PREFIX_RE = /^(~|\$\{HOME\}|\$HOME)[/\\](.*)$/;
26
+ function expandHomePrefix(raw) {
27
+ if (HOME_BARE_TOKENS.has(raw))
28
+ return homedir();
29
+ const match = HOME_PREFIX_RE.exec(raw);
30
+ // Non-null assertion, not a coverage gap to test: `noUncheckedIndexedAccess`
31
+ // types capture-group access as possibly-undefined, but group 2 is `(.*)`
32
+ // — it always participates once the overall regex matches (empty string
33
+ // at worst, e.g. a bare trailing separator), never `undefined`.
34
+ if (match)
35
+ return join(homedir(), match[2]);
36
+ return raw;
37
+ }
38
+ function scopedNamespaceOf(raw) {
39
+ const parts = raw.replace(/[\\/]+$/g, '').split(/[\\/]+/);
40
+ const last = parts.length - 1;
41
+ if (last < 2)
42
+ return null;
43
+ if (parts[last - 2] !== 'namespaces' || parts[last] !== 'data')
44
+ return null;
45
+ // Non-null assertion, not a coverage gap to test: `noUncheckedIndexedAccess`
46
+ // types every index access as possibly-undefined, but `last >= 2` (checked
47
+ // above) guarantees index `last - 1` is within `parts`, and `String.split`
48
+ // never produces holes/undefined elements — this index is always a string.
49
+ return parts[last - 1];
50
+ }
51
+ function resolveDataRoot(namespaceRoot, namespace, dataDirOverrideEnvVar, env) {
52
+ const override = dataDirOverrideEnvVar == null ? undefined : env[dataDirOverrideEnvVar]?.trim();
53
+ if (override != null && override.length > 0) {
54
+ const expanded = expandHomePrefix(override);
55
+ const isAbs = process.platform === 'win32' ? win32.isAbsolute(expanded) : isAbsolute(expanded);
56
+ if (!isAbs) {
57
+ throw new DesktopHostPathError(`${dataDirOverrideEnvVar} must be an absolute path; got: ${override}`);
58
+ }
59
+ const scopedNamespace = scopedNamespaceOf(expanded);
60
+ if (scopedNamespace != null && scopedNamespace !== namespace) {
61
+ throw new DesktopHostPathError(`${dataDirOverrideEnvVar} targets namespace "${scopedNamespace}" but the active namespace is "${namespace}"`);
62
+ }
63
+ return scopedNamespace != null ? expanded : join(expanded, 'namespaces', namespace, 'data');
64
+ }
65
+ return join(namespaceRoot, 'data');
66
+ }
67
+ export function resolveDesktopHostPathRoots(options) {
68
+ const env = options.env ?? process.env;
69
+ const namespaceRoot = join(options.namespaceBaseRoot, options.namespace);
70
+ return {
71
+ namespaceRoot,
72
+ dataRoot: resolveDataRoot(namespaceRoot, options.namespace, options.dataDirOverrideEnvVar, env),
73
+ cacheRoot: join(namespaceRoot, 'cache'),
74
+ logsRoot: join(namespaceRoot, 'logs'),
75
+ runtimeRoot: join(namespaceRoot, 'runtime'),
76
+ userDataRoot: join(namespaceRoot, 'user-data'),
77
+ sessionDataRoot: join(namespaceRoot, 'user-data', 'session'),
78
+ };
79
+ }
80
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":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E,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACvC,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACzE,OAAO;QACL,aAAa;QACb,QAAQ,EAAE,eAAe,CAAC,aAAa,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,qBAAqB,EAAE,GAAG,CAAC;QAC/F,SAAS,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC;QACvC,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC;QACrC,WAAW,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC;QAC3C,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC;QAC9C,eAAe,EAAE,IAAI,CAAC,aAAa,EAAE,WAAW,EAAE,SAAS,CAAC;KAC7D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The shared port set both backends compose against — scope 1's shell
3
+ * primitives plus scope 3's `RenderService`. `createElectronDesktopHost`/
4
+ * `createTauriDesktopHost` each build one of these from their own native
5
+ * surfaces, following the same "compose bound implementations behind one
6
+ * object" shape as `createDaemon({ packs, bindings })`
7
+ * (`packages/core/src/daemon.ts`) — simpler here because a desktop host
8
+ * has a fixed, small port set rather than an open-ended set of packs, so
9
+ * a plain factory function stands in for the pack/bindings machinery.
10
+ */
11
+ import type { SingleInstanceLockPort } from './single-instance.js';
12
+ import type { WindowLifecyclePort } from './window-lifecycle.js';
13
+ import type { ProtocolHandlerPort } from './protocol.js';
14
+ import type { SidecarLauncherPort } from './sidecar.js';
15
+ import type { RenderService } from './render-service.js';
16
+ import type { ShellPort } from './shell.js';
17
+ export interface DesktopHostPorts {
18
+ singleInstance: SingleInstanceLockPort;
19
+ windowLifecycle: WindowLifecyclePort;
20
+ protocolHandler: ProtocolHandlerPort;
21
+ sidecarLauncher: SidecarLauncherPort;
22
+ renderService: RenderService;
23
+ shell: ShellPort;
24
+ }
25
+ export interface DesktopHost {
26
+ readonly backend: 'electron' | 'tauri';
27
+ readonly ports: DesktopHostPorts;
28
+ }
29
+ //# sourceMappingURL=ports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ports.d.ts","sourceRoot":"","sources":["../src/ports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,sBAAsB,CAAC;IACvC,eAAe,EAAE,mBAAmB,CAAC;IACrC,eAAe,EAAE,mBAAmB,CAAC;IACrC,eAAe,EAAE,mBAAmB,CAAC;IACrC,aAAa,EAAE,aAAa,CAAC;IAC7B,KAAK,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC;IACvC,QAAQ,CAAC,KAAK,EAAE,gBAAgB,CAAC;CAClC"}
package/dist/ports.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ports.js","sourceRoot":"","sources":["../src/ports.ts"],"names":[],"mappings":""}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Ported from OD `apps/packaged/src/protocol.ts` (`od://` custom-scheme
3
+ * fetch proxy). Genuinely generic mechanism — a privileged custom scheme
4
+ * whose every request is rewritten onto a local HTTP origin and proxied
5
+ * through `fetch` — de-branded: the scheme string, entry URL, and error
6
+ * code are all caller-supplied/generic instead of hardcoded to `od`/
7
+ * `OD_PROTOCOL_PROXY_FAILED`. The try/catch-to-502 behavior (never let a
8
+ * proxying failure surface as a native "JavaScript error in main process"
9
+ * dialog) is preserved verbatim — it is backend plumbing, not OD-specific.
10
+ */
11
+ export interface ProtocolProxyErrorBody {
12
+ error: string;
13
+ message: string;
14
+ code?: string;
15
+ target: string;
16
+ }
17
+ export declare function buildProtocolProxyTargetUrl(targetBaseUrl: string, requestUrl: string): string;
18
+ export type ProtocolFetch = (request: Request) => Promise<Response>;
19
+ export declare function handleProtocolProxyRequest(request: Request, targetBaseUrl: string, fetchImpl?: ProtocolFetch): Promise<Response>;
20
+ export interface ProtocolSchemeRegistration {
21
+ scheme: string;
22
+ entryUrl: string;
23
+ }
24
+ export interface ProtocolHandlerPort {
25
+ registerSchemeProxy(scheme: string, targetBaseUrl: string): ProtocolSchemeRegistration;
26
+ }
27
+ export declare function schemeEntryUrl(scheme: string): string;
28
+ //# sourceMappingURL=protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAoBD,wBAAgB,2BAA2B,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAO7F;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEpE,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,MAAM,EACrB,SAAS,GAAE,aAAqB,GAC/B,OAAO,CAAC,QAAQ,CAAC,CAOnB;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,0BAA0B,CAAC;CACxF;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAErD"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Ported from OD `apps/packaged/src/protocol.ts` (`od://` custom-scheme
3
+ * fetch proxy). Genuinely generic mechanism — a privileged custom scheme
4
+ * whose every request is rewritten onto a local HTTP origin and proxied
5
+ * through `fetch` — de-branded: the scheme string, entry URL, and error
6
+ * code are all caller-supplied/generic instead of hardcoded to `od`/
7
+ * `OD_PROTOCOL_PROXY_FAILED`. The try/catch-to-502 behavior (never let a
8
+ * proxying failure surface as a native "JavaScript error in main process"
9
+ * dialog) is preserved verbatim — it is backend plumbing, not OD-specific.
10
+ */
11
+ function buildProxyErrorResponse(error, target) {
12
+ const message = error instanceof Error ? error.message : String(error);
13
+ const code = error instanceof Error && typeof error.code === 'string'
14
+ ? error.code
15
+ : null;
16
+ const body = {
17
+ error: 'JINI_PROTOCOL_PROXY_FAILED',
18
+ message,
19
+ target,
20
+ ...(code == null ? {} : { code }),
21
+ };
22
+ return new Response(JSON.stringify(body), {
23
+ status: 502,
24
+ headers: { 'content-type': 'application/json' },
25
+ });
26
+ }
27
+ export function buildProtocolProxyTargetUrl(targetBaseUrl, requestUrl) {
28
+ const incoming = new URL(requestUrl);
29
+ const target = new URL(targetBaseUrl);
30
+ target.pathname = incoming.pathname;
31
+ target.search = incoming.search;
32
+ target.hash = incoming.hash;
33
+ return target.toString();
34
+ }
35
+ export async function handleProtocolProxyRequest(request, targetBaseUrl, fetchImpl = fetch) {
36
+ const target = buildProtocolProxyTargetUrl(targetBaseUrl, request.url);
37
+ try {
38
+ return await fetchImpl(new Request(target, request));
39
+ }
40
+ catch (error) {
41
+ return buildProxyErrorResponse(error, target);
42
+ }
43
+ }
44
+ export function schemeEntryUrl(scheme) {
45
+ return `${scheme}://app/`;
46
+ }
47
+ //# sourceMappingURL=protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH,SAAS,uBAAuB,CAAC,KAAc,EAAE,MAAc;IAC7D,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,MAAM,IAAI,GACR,KAAK,YAAY,KAAK,IAAI,OAAQ,KAA+B,CAAC,IAAI,KAAK,QAAQ;QACjF,CAAC,CAAE,KAA+B,CAAC,IAAI;QACvC,CAAC,CAAC,IAAI,CAAC;IACX,MAAM,IAAI,GAA2B;QACnC,KAAK,EAAE,4BAA4B;QACnC,OAAO;QACP,MAAM;QACN,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;KAClC,CAAC;IACF,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;QACxC,MAAM,EAAE,GAAG;QACX,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;KAChD,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,aAAqB,EAAE,UAAkB;IACnF,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC;IACrC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,aAAa,CAAC,CAAC;IACtC,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;IACpC,MAAM,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;IAChC,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;IAC5B,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;AAC3B,CAAC;AAID,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,OAAgB,EAChB,aAAqB,EACrB,YAA2B,KAAK;IAEhC,MAAM,MAAM,GAAG,2BAA2B,CAAC,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IACvE,IAAI,CAAC;QACH,OAAO,MAAM,SAAS,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACvD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,uBAAuB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC;AACH,CAAC;AAWD,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,OAAO,GAAG,MAAM,SAAS,CAAC;AAC5B,CAAC"}
@@ -0,0 +1,79 @@
1
+ /**
2
+ * `RenderService` port, shaped per extraction-plan.md §12 C7: "a provider
3
+ * bound via the registry, not a kernel service" — `renderToPdf(html) ->
4
+ * bytes` / `capture(html) -> png`, plus viewport/timeout/abort/
5
+ * resource-policy options, with Electron / headless-Chromium / Tauri as
6
+ * adapters. This is NOT a port of OD's `deck-capture.ts`/`pdf-export.ts`
7
+ * (design/slide-specific business logic, explicitly out of scope) —
8
+ * those stay OD-side as a future adapter implementing this same port with
9
+ * OD's own behavior layered on top. This file defines only the
10
+ * provider-agnostic contract; `electron/electron-render-service.ts` is
11
+ * the first real adapter.
12
+ */
13
+ export interface RenderViewport {
14
+ width: number;
15
+ height: number;
16
+ deviceScaleFactor?: number;
17
+ }
18
+ /**
19
+ * Controls what an offscreen render is allowed to do while rendering
20
+ * caller-supplied HTML. Defaults (enforced by adapters, not this file)
21
+ * are the safe ones: no navigation away from the given document, no
22
+ * network access beyond `allowedOrigins`.
23
+ */
24
+ export interface RenderResourcePolicy {
25
+ javascript?: boolean;
26
+ allowNavigation?: boolean;
27
+ allowedOrigins?: string[];
28
+ }
29
+ export interface RenderOptions {
30
+ viewport?: RenderViewport;
31
+ timeoutMs?: number;
32
+ signal?: AbortSignal;
33
+ resourcePolicy?: RenderResourcePolicy;
34
+ }
35
+ export interface PdfMargins {
36
+ top?: number;
37
+ bottom?: number;
38
+ left?: number;
39
+ right?: number;
40
+ }
41
+ export interface RenderToPdfOptions extends RenderOptions {
42
+ landscape?: boolean;
43
+ printBackground?: boolean;
44
+ pageWidth?: number;
45
+ pageHeight?: number;
46
+ margins?: PdfMargins;
47
+ }
48
+ export interface CaptureOptions extends RenderOptions {
49
+ clip?: {
50
+ x: number;
51
+ y: number;
52
+ width: number;
53
+ height: number;
54
+ };
55
+ }
56
+ export interface ExportArtifactOptions extends RenderOptions {
57
+ format: string;
58
+ extra?: Record<string, unknown>;
59
+ }
60
+ export type RenderServiceErrorCode = 'timeout' | 'aborted' | 'load-failed' | 'navigation-blocked' | 'not-implemented';
61
+ export declare class RenderServiceError extends Error {
62
+ readonly code: RenderServiceErrorCode;
63
+ constructor(message: string, code: RenderServiceErrorCode);
64
+ }
65
+ export interface RenderService {
66
+ renderToPdf(html: string, options?: RenderToPdfOptions): Promise<Uint8Array>;
67
+ capture(html: string, options?: CaptureOptions): Promise<Uint8Array>;
68
+ exportArtifact(html: string, options: ExportArtifactOptions): Promise<unknown>;
69
+ }
70
+ /** Data-URL-encodes HTML for loading into an offscreen renderer, base64 (not `encodeURIComponent`) to avoid per-platform URL-length/charset surprises with large documents. */
71
+ export declare function htmlToDataUrl(html: string): string;
72
+ export declare function isOriginAllowed(url: string, allowedOrigins: string[] | undefined): boolean;
73
+ /**
74
+ * Races a promise against a timeout and an optional `AbortSignal`,
75
+ * normalizing both into `RenderServiceError`. Shared by every adapter so
76
+ * the timeout/abort contract behaves identically regardless of backend.
77
+ */
78
+ export declare function withRenderTimeout<T>(promise: Promise<T>, timeoutMs: number | undefined, signal: AbortSignal | undefined): Promise<T>;
79
+ //# sourceMappingURL=render-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-service.d.ts","sourceRoot":"","sources":["../src/render-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,cAAc,CAAC,EAAE,oBAAoB,CAAC;CACvC;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAmB,SAAQ,aAAa;IACvD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAED,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD,IAAI,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAA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->
4
+ * bytes` / `capture(html) -> png`, plus viewport/timeout/abort/
5
+ * resource-policy options, with Electron / headless-Chromium / Tauri as
6
+ * adapters. This is NOT a port of OD's `deck-capture.ts`/`pdf-export.ts`
7
+ * (design/slide-specific business logic, explicitly out of scope) —
8
+ * those stay OD-side as a future adapter implementing this same port with
9
+ * OD's own behavior layered on top. This file defines only the
10
+ * provider-agnostic contract; `electron/electron-render-service.ts` is
11
+ * the first real adapter.
12
+ */
13
+ export class RenderServiceError extends Error {
14
+ code;
15
+ constructor(message, code) {
16
+ super(message);
17
+ this.name = 'RenderServiceError';
18
+ this.code = code;
19
+ }
20
+ }
21
+ /** Data-URL-encodes HTML for loading into an offscreen renderer, base64 (not `encodeURIComponent`) to avoid per-platform URL-length/charset surprises with large documents. */
22
+ export function htmlToDataUrl(html) {
23
+ return `data:text/html;base64,${Buffer.from(html, 'utf8').toString('base64')}`;
24
+ }
25
+ export function isOriginAllowed(url, allowedOrigins) {
26
+ if (allowedOrigins == null)
27
+ return true;
28
+ if (url.startsWith('data:') || url.startsWith('about:'))
29
+ return true;
30
+ try {
31
+ return allowedOrigins.includes(new URL(url).origin);
32
+ }
33
+ catch {
34
+ return false;
35
+ }
36
+ }
37
+ /**
38
+ * Races a promise against a timeout and an optional `AbortSignal`,
39
+ * normalizing both into `RenderServiceError`. Shared by every adapter so
40
+ * the timeout/abort contract behaves identically regardless of backend.
41
+ */
42
+ export async function withRenderTimeout(promise, timeoutMs, signal) {
43
+ if (signal?.aborted)
44
+ throw new RenderServiceError('render aborted before starting', 'aborted');
45
+ if (timeoutMs == null && signal == null)
46
+ return promise;
47
+ return await new Promise((resolve, reject) => {
48
+ let settled = false;
49
+ // No `if (settled) return` guard here (unlike the other three settling
50
+ // sites below): every other path that can settle first (`onAbort`, both
51
+ // `promise.then` handlers) calls `clearTimeout(timer)` as part of
52
+ // settling, and a cleared `setTimeout` is guaranteed by the platform to
53
+ // never invoke its callback — so this callback can only ever run while
54
+ // `settled` is still `false`. Guarding it anyway would be dead code.
55
+ const timer = timeoutMs == null
56
+ ? null
57
+ : setTimeout(() => {
58
+ settled = true;
59
+ reject(new RenderServiceError(`render timed out after ${timeoutMs}ms`, 'timeout'));
60
+ }, timeoutMs);
61
+ const onAbort = () => {
62
+ if (settled)
63
+ return;
64
+ settled = true;
65
+ if (timer != null)
66
+ clearTimeout(timer);
67
+ reject(new RenderServiceError('render aborted', 'aborted'));
68
+ };
69
+ signal?.addEventListener('abort', onAbort, { once: true });
70
+ promise.then((value) => {
71
+ if (settled)
72
+ return;
73
+ settled = true;
74
+ if (timer != null)
75
+ clearTimeout(timer);
76
+ signal?.removeEventListener('abort', onAbort);
77
+ resolve(value);
78
+ }, (error) => {
79
+ if (settled)
80
+ return;
81
+ settled = true;
82
+ if (timer != null)
83
+ clearTimeout(timer);
84
+ signal?.removeEventListener('abort', onAbort);
85
+ reject(error);
86
+ });
87
+ });
88
+ }
89
+ //# sourceMappingURL=render-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-service.js","sourceRoot":"","sources":["../src/render-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAqDH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAClC,IAAI,CAAyB;IAEtC,YAAY,OAAe,EAAE,IAA4B;QACvD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAQD,+KAA+K;AAC/K,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,yBAAyB,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;AACjF,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,GAAW,EAAE,cAAoC;IAC/E,IAAI,cAAc,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IACxC,IAAI,GAAG,CA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AAC,CAAC;QAC9D,CAAC,CAAC;QACF,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAE3D,OAAO,CAAC,IAAI,CACV,CAAC,KAAK,EAAE,EAAE;YACR,IAAI,OAAO;gBAAE,OAAO;YACpB,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,KAAK,IAAI,IAAI;gBAAE,YAAY,CAAC,KAAK,CAAC,CAAC;YACvC,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC9C,OAAO,CAAC,KAAK,CAAC,CAAC;QACjB,CAAC,EACD,CAAC,KAAc,EAAE,EAAE;YACjB,IAAI,OAAO;gBAAE,OAAO;YACpB,OAAO,GAAG,IAAI,CAAC;YACf,IAAI,KAAK,IAAI,IAAI;gBAAE,YAAY,CAAC,KAAK,CAAC,CAAC;YACvC,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC9C,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,40 @@
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 declare class ShellError extends Error {
25
+ constructor(message: string);
26
+ }
27
+ export interface OpenFolderDialogOptions {
28
+ readonly defaultPath?: string;
29
+ }
30
+ export interface ShellPort {
31
+ openExternal(url: string): Promise<void>;
32
+ openPath(path: string): Promise<void>;
33
+ /** True if `path` exists on the local filesystem and is a directory; `false` for a missing path, a non-directory (a file), or any other stat failure. Never throws. */
34
+ dirExists(path: string): Promise<boolean>;
35
+ /** Host-tracked recently-opened locations, most-recent first. Electron backs this with `app.getRecentDocuments()`; Tauri has no equivalent (see module doc) and rejects with `NotImplementedError`. */
36
+ recentDirs(): Promise<string[]>;
37
+ /** Opens a native "choose a folder" dialog. Resolves to the chosen absolute path, or `null` if the user canceled. */
38
+ openFolderDialog(options?: OpenFolderDialogOptions): Promise<string | null>;
39
+ }
40
+ //# sourceMappingURL=shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../src/shell.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,qBAAa,UAAW,SAAQ,KAAK;gBACvB,OAAO,EAAE,MAAM;CAI5B;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,SAAS;IACxB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,uKAAuK;IACvK,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1C,uMAAuM;IACvM,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAChC,qHAAqH;IACrH,gBAAgB,CAAC,OAAO,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC7E"}