@bobannomi/app-host 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +5 -1
- package/dist/index.js +132 -33
- package/dist/index.js.map +2 -2
- package/dist/protocol.d.ts +5 -1
- package/dist/protocol.js +61 -9
- package/dist/protocol.js.map +2 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -2127,7 +2127,11 @@ interface WindowRequester {
|
|
|
2127
2127
|
request<M extends WindowMethod>(method: M, params: WindowMethodMap[M]["params"]): Promise<WindowMethodMap[M]["result"]>;
|
|
2128
2128
|
onEvent(listener: (event: AppHostEvent) => void): () => void;
|
|
2129
2129
|
}
|
|
2130
|
-
|
|
2130
|
+
interface NativeWindowControls {
|
|
2131
|
+
request(method: string): Promise<unknown>;
|
|
2132
|
+
onStateChanged(listener: (state: unknown) => void): () => void;
|
|
2133
|
+
}
|
|
2134
|
+
declare function createAppWindowApi(requester: WindowRequester, native?: NativeWindowControls): AppHostWindow;
|
|
2131
2135
|
|
|
2132
2136
|
interface AppHostStorage {
|
|
2133
2137
|
get(key: string): Promise<StorageGetResult>;
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,29 @@ var APP_HOST_ERROR_RETRY = {
|
|
|
24
24
|
model_not_configured: "never"
|
|
25
25
|
};
|
|
26
26
|
var HOST_REQUEST_ID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
27
|
+
var HOST_DIAGNOSTIC_EVENT_TYPES = /* @__PURE__ */ new Set([
|
|
28
|
+
"before-unload",
|
|
29
|
+
"browser-changed",
|
|
30
|
+
"browser-open-requested",
|
|
31
|
+
"command-invoked",
|
|
32
|
+
"connection-revoked",
|
|
33
|
+
"context-changed",
|
|
34
|
+
"git-preferences-changed",
|
|
35
|
+
"plugin-app-resources-changed",
|
|
36
|
+
"plugin-app-revoked",
|
|
37
|
+
"presentation-preferences-changed",
|
|
38
|
+
"resources-changed",
|
|
39
|
+
"service-changed",
|
|
40
|
+
"system-navigation-requested",
|
|
41
|
+
"terminal-event",
|
|
42
|
+
"visibility",
|
|
43
|
+
"window-state-changed",
|
|
44
|
+
"workbench-computer-activity",
|
|
45
|
+
"workbench-computer-prompt"
|
|
46
|
+
]);
|
|
47
|
+
function isHostDiagnosticEventType(value) {
|
|
48
|
+
return typeof value === "string" && HOST_DIAGNOSTIC_EVENT_TYPES.has(value);
|
|
49
|
+
}
|
|
27
50
|
function isSafeErrorDetails(value, depth = 0) {
|
|
28
51
|
if (depth > 8) return false;
|
|
29
52
|
if (value === null || typeof value === "boolean") return true;
|
|
@@ -35,7 +58,12 @@ function isSafeErrorDetails(value, depth = 0) {
|
|
|
35
58
|
const entries = Reflect.ownKeys(value);
|
|
36
59
|
return entries.length <= 32 && entries.every((key) => {
|
|
37
60
|
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
38
|
-
|
|
61
|
+
if (!descriptor.enumerable || !Object.hasOwn(descriptor, "value")) return false;
|
|
62
|
+
if (key === "frameKind") return ["unknown", "response", "event", "lifecycle", "fetch"].includes(descriptor.value);
|
|
63
|
+
if (key === "stage") return ["envelope", "protocol", "feature", "sequence", "payload", "result", "error"].includes(descriptor.value);
|
|
64
|
+
if (key === "method") return typeof descriptor.value === "string" && /^[a-zA-Z0-9.]{1,96}$/.test(descriptor.value);
|
|
65
|
+
if (key === "eventType") return isHostDiagnosticEventType(descriptor.value);
|
|
66
|
+
return typeof key === "string" && ["state", "reason", "capability", "dependency", "count", "limit", "retryAfterMs", "available"].includes(key) && isSafeErrorDetails(descriptor.value, depth + 1);
|
|
39
67
|
});
|
|
40
68
|
}
|
|
41
69
|
function isAppHostErrorInfo(value) {
|
|
@@ -55,6 +83,7 @@ function appHostErrorMessage(code, details) {
|
|
|
55
83
|
return "Timed out connecting to the desktop host.";
|
|
56
84
|
case "host_response_timeout":
|
|
57
85
|
return "The desktop host did not respond in time.";
|
|
86
|
+
case "host_invalid_result":
|
|
58
87
|
case "host_invalid_response":
|
|
59
88
|
return "The desktop host returned an invalid response.";
|
|
60
89
|
case "host_send_failed":
|
|
@@ -1089,12 +1118,13 @@ var cancel = object({ selectionId: text(256) });
|
|
|
1089
1118
|
var name = object({ name: text(256) });
|
|
1090
1119
|
var login = object({ loginId: text(256) });
|
|
1091
1120
|
var skillSelection = { id: text(64), version: text(32), sha256: digest };
|
|
1092
|
-
var
|
|
1121
|
+
var skillInstallOptions = { allowWhileRunning: bool };
|
|
1122
|
+
var personalSkillInstall = object({ ...skillSelection, scope: enumeration("personal") }, skillInstallOptions);
|
|
1093
1123
|
var projectSkillInstall = object({
|
|
1094
1124
|
...skillSelection,
|
|
1095
1125
|
scope: enumeration("project"),
|
|
1096
1126
|
projectPath: (value) => typeof value === "string" && value.trim().length > 0 && text(4096)(value)
|
|
1097
|
-
});
|
|
1127
|
+
}, skillInstallOptions);
|
|
1098
1128
|
var EXTENSION_INPUTS = {
|
|
1099
1129
|
context: empty,
|
|
1100
1130
|
"plugins.loadIcon": object({ src: text(8192) }),
|
|
@@ -1689,7 +1719,7 @@ function validWindowEvent(value) {
|
|
|
1689
1719
|
state: validAppWindowState
|
|
1690
1720
|
})(value);
|
|
1691
1721
|
}
|
|
1692
|
-
function createAppWindowApi(requester) {
|
|
1722
|
+
function createAppWindowApi(requester, native) {
|
|
1693
1723
|
async function send(method, params) {
|
|
1694
1724
|
requester.requireFeature();
|
|
1695
1725
|
if (method === "window.checkForUpdates")
|
|
@@ -1698,18 +1728,39 @@ function createAppWindowApi(requester) {
|
|
|
1698
1728
|
throw new AppHostError("invalid_request");
|
|
1699
1729
|
return requester.request(method, params);
|
|
1700
1730
|
}
|
|
1731
|
+
async function control(method) {
|
|
1732
|
+
if (!native) return send(method, {});
|
|
1733
|
+
const result = await native.request(method).catch(() => void 0);
|
|
1734
|
+
if (result && typeof result === "object" && "ok" in result) {
|
|
1735
|
+
if (result.ok === true) {
|
|
1736
|
+
const value = "value" in result ? result.value : void 0;
|
|
1737
|
+
if (validWindowResult(method, value)) return value;
|
|
1738
|
+
}
|
|
1739
|
+
if (result.ok === false && "error" in result && isAppHostErrorInfo(result.error)) {
|
|
1740
|
+
const { code, details, requestId } = result.error;
|
|
1741
|
+
throw new AppHostError(code, appHostErrorMessage(code, details), {
|
|
1742
|
+
...details === void 0 ? {} : { details },
|
|
1743
|
+
...requestId === void 0 ? {} : { requestId }
|
|
1744
|
+
});
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1747
|
+
throw new AppHostError("host_unavailable");
|
|
1748
|
+
}
|
|
1701
1749
|
return {
|
|
1702
1750
|
checkForUpdates: () => send("window.checkForUpdates", {}),
|
|
1703
|
-
getState: () =>
|
|
1704
|
-
minimize: () =>
|
|
1705
|
-
toggleMaximize: () =>
|
|
1706
|
-
requestClose: () =>
|
|
1751
|
+
getState: () => control("window.getState"),
|
|
1752
|
+
minimize: () => control("window.minimize"),
|
|
1753
|
+
toggleMaximize: () => control("window.toggleMaximize"),
|
|
1754
|
+
requestClose: () => control("window.requestClose"),
|
|
1707
1755
|
openHost: (input) => send("window.openHost", input),
|
|
1708
1756
|
reportStartup: (input) => send("window.reportStartup", input),
|
|
1709
1757
|
onStateChanged: (listener) => {
|
|
1710
|
-
requester.requireFeature();
|
|
1758
|
+
if (!native) requester.requireFeature();
|
|
1711
1759
|
if (typeof listener !== "function")
|
|
1712
1760
|
throw new AppHostError("invalid_request");
|
|
1761
|
+
if (native) return native.onStateChanged((state2) => {
|
|
1762
|
+
if (validAppWindowState(state2)) listener(state2);
|
|
1763
|
+
});
|
|
1713
1764
|
return requester.onEvent((event) => {
|
|
1714
1765
|
if (event.type === "window-state-changed") listener(event.state);
|
|
1715
1766
|
});
|
|
@@ -1987,12 +2038,16 @@ var APP_HOST_METHODS = [
|
|
|
1987
2038
|
|
|
1988
2039
|
// src/transport/fetch-client.ts
|
|
1989
2040
|
function createPageFetchClient(options) {
|
|
2041
|
+
return createDocumentPageFetchClient(options);
|
|
2042
|
+
}
|
|
2043
|
+
function createDocumentPageFetchClient(options, getDocumentCloseError) {
|
|
1990
2044
|
const streams = /* @__PURE__ */ new Map(), closedTargets = /* @__PURE__ */ new Set();
|
|
1991
2045
|
let nextId = 0, closed = false;
|
|
1992
2046
|
let offMessage = () => {
|
|
1993
2047
|
}, offClose = () => {
|
|
1994
2048
|
};
|
|
1995
2049
|
const error = (code) => new AppHostError(code);
|
|
2050
|
+
const documentCloseError = () => getDocumentCloseError?.() ?? error("connection_revoked");
|
|
1996
2051
|
const timeout = (reason) => {
|
|
1997
2052
|
const details = { reason };
|
|
1998
2053
|
return new AppHostError("host_unavailable", appHostErrorMessage("host_unavailable", details), { details });
|
|
@@ -2061,12 +2116,15 @@ function createPageFetchClient(options) {
|
|
|
2061
2116
|
clearTimeout(s.idleTimer);
|
|
2062
2117
|
s.idleTimer = setTimeout(() => finish(s, timeout("idle_timeout"), true), FETCH_IDLE_TIMEOUT_MS);
|
|
2063
2118
|
};
|
|
2119
|
+
const waitForHeaders = (s) => {
|
|
2120
|
+
if (!s.headers) s.headTimer = setTimeout(() => finish(s, timeout("headers_timeout"), true), FETCH_HEADERS_TIMEOUT_MS);
|
|
2121
|
+
};
|
|
2064
2122
|
const shutdown = () => {
|
|
2065
2123
|
if (closed) return;
|
|
2066
2124
|
closed = true;
|
|
2067
2125
|
offMessage();
|
|
2068
2126
|
offClose();
|
|
2069
|
-
for (const s of [...streams.values()]) finish(s,
|
|
2127
|
+
for (const s of [...streams.values()]) finish(s, documentCloseError());
|
|
2070
2128
|
closedTargets.clear();
|
|
2071
2129
|
};
|
|
2072
2130
|
const pump = async (s) => {
|
|
@@ -2082,6 +2140,8 @@ function createPageFetchClient(options) {
|
|
|
2082
2140
|
s.uploadDone = true;
|
|
2083
2141
|
s.reader = void 0;
|
|
2084
2142
|
reader.releaseLock();
|
|
2143
|
+
touch(s);
|
|
2144
|
+
waitForHeaders(s);
|
|
2085
2145
|
send({ protocol: 2, type: "fetch-end", id: s.id, direction: "upload", sequence: s.uploadSequence });
|
|
2086
2146
|
complete(s);
|
|
2087
2147
|
return;
|
|
@@ -2211,7 +2271,8 @@ function createPageFetchClient(options) {
|
|
|
2211
2271
|
fetchFor(connectionId, baseUrl) {
|
|
2212
2272
|
pageFetchPath(baseUrl, baseUrl);
|
|
2213
2273
|
return async (input, init) => {
|
|
2214
|
-
if (closed
|
|
2274
|
+
if (closed) throw documentCloseError();
|
|
2275
|
+
if (closedTargets.has(connectionId)) throw error("connection_revoked");
|
|
2215
2276
|
const inputUrl = input instanceof Request ? input.url : String(input);
|
|
2216
2277
|
const request = new Request(input, init);
|
|
2217
2278
|
const id3 = String(nextId + 1);
|
|
@@ -2254,10 +2315,10 @@ function createPageFetchClient(options) {
|
|
|
2254
2315
|
outstanding: 0,
|
|
2255
2316
|
grantSequence: 0,
|
|
2256
2317
|
downloadSequence: 0,
|
|
2257
|
-
headTimer: setTimeout(() => finish(s, timeout("headers_timeout"), true), FETCH_HEADERS_TIMEOUT_MS),
|
|
2258
2318
|
idleTimer: setTimeout(() => finish(s, timeout("idle_timeout"), true), FETCH_IDLE_TIMEOUT_MS),
|
|
2259
2319
|
offAbort: () => request.signal.removeEventListener("abort", abort)
|
|
2260
2320
|
};
|
|
2321
|
+
if (s.uploadDone) waitForHeaders(s);
|
|
2261
2322
|
streams.set(id3, s);
|
|
2262
2323
|
request.signal.addEventListener("abort", abort, { once: true });
|
|
2263
2324
|
try {
|
|
@@ -2289,6 +2350,10 @@ function createPageFetchClient(options) {
|
|
|
2289
2350
|
// src/connection.ts
|
|
2290
2351
|
var SKILL_MARKETPLACE_TIMEOUT_MS = 3e5;
|
|
2291
2352
|
var failure = (code) => new AppHostError(code);
|
|
2353
|
+
function invalidHostResponse(reason, frameKind, stage, operation) {
|
|
2354
|
+
const details = { reason, frameKind, stage, ...operation };
|
|
2355
|
+
return new AppHostError("host_unavailable", appHostErrorMessage("host_unavailable", details), { details });
|
|
2356
|
+
}
|
|
2292
2357
|
var hostFailure = (reason, requestId) => {
|
|
2293
2358
|
const details = { reason };
|
|
2294
2359
|
return new AppHostError(
|
|
@@ -2482,7 +2547,7 @@ var DocumentConnection = class {
|
|
|
2482
2547
|
}
|
|
2483
2548
|
}
|
|
2484
2549
|
});
|
|
2485
|
-
fetchClient =
|
|
2550
|
+
fetchClient = createDocumentPageFetchClient({
|
|
2486
2551
|
allowsInlineBody: () => this.features.has("fetch-inline-body-v1"),
|
|
2487
2552
|
allowsTargetClose: () => this.features.has("fetch-target-close-v1"),
|
|
2488
2553
|
send: (frame) => {
|
|
@@ -2501,12 +2566,12 @@ var DocumentConnection = class {
|
|
|
2501
2566
|
this.closeListeners.delete(listener);
|
|
2502
2567
|
};
|
|
2503
2568
|
}
|
|
2504
|
-
});
|
|
2569
|
+
}, () => this.closed);
|
|
2505
2570
|
requireFeature(feature) {
|
|
2506
2571
|
if (this.closed) throw this.closed;
|
|
2507
2572
|
if (!this.features.has(feature)) throw failure("incompatible");
|
|
2508
2573
|
}
|
|
2509
|
-
pagehide = () => this.
|
|
2574
|
+
pagehide = () => this.broken();
|
|
2510
2575
|
receivePort = (event) => {
|
|
2511
2576
|
if (event.source !== this.page || !keys2(event.data, ["type", "protocol"]) || event.data.type !== APP_HOST_PORT || event.data.protocol !== APP_HOST_PROTOCOL || event.ports.length !== 1)
|
|
2512
2577
|
return;
|
|
@@ -2524,7 +2589,9 @@ var DocumentConnection = class {
|
|
|
2524
2589
|
for (const waiter of this.waiting) waiter.resolve();
|
|
2525
2590
|
this.waiting.clear();
|
|
2526
2591
|
};
|
|
2527
|
-
broken = () => this.close(
|
|
2592
|
+
broken = () => this.close(new AppHostError("connection_revoked", void 0, {
|
|
2593
|
+
details: { reason: "host_port_closed" }
|
|
2594
|
+
}));
|
|
2528
2595
|
close(error) {
|
|
2529
2596
|
if (this.closed) return;
|
|
2530
2597
|
this.closed = error;
|
|
@@ -2549,32 +2616,56 @@ var DocumentConnection = class {
|
|
|
2549
2616
|
}
|
|
2550
2617
|
receive = (event) => {
|
|
2551
2618
|
const data = event.data;
|
|
2619
|
+
let frameKind = "unknown";
|
|
2620
|
+
let stage = "envelope";
|
|
2621
|
+
let eventType;
|
|
2552
2622
|
try {
|
|
2553
2623
|
if (!record2(data)) throw failure("host_unavailable");
|
|
2554
2624
|
const frameType = Object.getOwnPropertyDescriptor(data, "type")?.value;
|
|
2555
2625
|
if (typeof frameType === "string" && frameType.startsWith("fetch-")) {
|
|
2626
|
+
frameKind = "fetch";
|
|
2627
|
+
stage = "payload";
|
|
2556
2628
|
if (!isPageFetchFrame(data)) throw failure("host_unavailable");
|
|
2629
|
+
stage = "feature";
|
|
2557
2630
|
this.requireFeature("fetch-v1");
|
|
2631
|
+
stage = "payload";
|
|
2558
2632
|
for (const listener of this.fetchListeners) listener(data);
|
|
2559
2633
|
return;
|
|
2560
2634
|
}
|
|
2635
|
+
if (frameType === "response" || frameType === "event") frameKind = frameType;
|
|
2636
|
+
else if (typeof frameType === "string" && frameType.startsWith("lifecycle-")) frameKind = "lifecycle";
|
|
2637
|
+
stage = "protocol";
|
|
2561
2638
|
if (data.protocol !== APP_HOST_PROTOCOL)
|
|
2562
2639
|
throw failure("host_unavailable");
|
|
2563
|
-
if (
|
|
2640
|
+
if (frameKind === "lifecycle") {
|
|
2641
|
+
stage = "feature";
|
|
2564
2642
|
this.requireFeature("lifecycle-v1");
|
|
2643
|
+
stage = "payload";
|
|
2565
2644
|
if (!isAppLifecycleFrame(data) || data.type === "lifecycle-result")
|
|
2566
2645
|
throw failure("host_unavailable");
|
|
2567
2646
|
this.lifecycle.receive(data);
|
|
2568
2647
|
return;
|
|
2569
2648
|
}
|
|
2570
|
-
if (
|
|
2571
|
-
|
|
2649
|
+
if (frameKind === "event") {
|
|
2650
|
+
stage = "envelope";
|
|
2651
|
+
if (!keys2(data, ["protocol", "type", "sequence", "event"]))
|
|
2652
|
+
throw failure("host_unavailable");
|
|
2653
|
+
if (record2(data.event)) {
|
|
2654
|
+
const type = Object.getOwnPropertyDescriptor(data.event, "type")?.value;
|
|
2655
|
+
if (isHostDiagnosticEventType(type)) eventType = type;
|
|
2656
|
+
}
|
|
2657
|
+
stage = "payload";
|
|
2658
|
+
if (!validEvent(data.event) || payloadSize(data.event) > APP_HOST_MAX_PAYLOAD_BYTES)
|
|
2659
|
+
throw failure("host_unavailable");
|
|
2660
|
+
stage = "sequence";
|
|
2661
|
+
if (!Number.isSafeInteger(data.sequence) || data.sequence <= 0)
|
|
2572
2662
|
throw failure("host_unavailable");
|
|
2573
2663
|
if (data.sequence <= this.sequence) return;
|
|
2574
2664
|
if (data.sequence !== this.sequence + 1)
|
|
2575
2665
|
throw failure("host_unavailable");
|
|
2576
2666
|
this.sequence = data.sequence;
|
|
2577
2667
|
const appEvent = data.event;
|
|
2668
|
+
stage = "feature";
|
|
2578
2669
|
if (appEvent.type === "command-invoked")
|
|
2579
2670
|
this.requireFeature("commands-v1");
|
|
2580
2671
|
if (appEvent.type === "resources-changed")
|
|
@@ -2591,7 +2682,7 @@ var DocumentConnection = class {
|
|
|
2591
2682
|
if (validWorkbenchComputerEvent(appEvent)) this.requireFeature(WORKBENCH_COMPUTER_FEATURE);
|
|
2592
2683
|
const observers = [...this.listeners];
|
|
2593
2684
|
if (appEvent.type === "connection-revoked")
|
|
2594
|
-
this.
|
|
2685
|
+
this.broken();
|
|
2595
2686
|
for (const listener of observers) {
|
|
2596
2687
|
try {
|
|
2597
2688
|
listener(appEvent);
|
|
@@ -2600,18 +2691,22 @@ var DocumentConnection = class {
|
|
|
2600
2691
|
}
|
|
2601
2692
|
return;
|
|
2602
2693
|
}
|
|
2603
|
-
|
|
2694
|
+
stage = "envelope";
|
|
2695
|
+
if (frameKind !== "response" || typeof data.id !== "string" || !(data.ok === true ? keys2(data, ["protocol", "type", "id", "ok"], ["value"]) : data.ok === false && keys2(data, ["protocol", "type", "id", "ok", "error"])))
|
|
2604
2696
|
throw failure("host_unavailable");
|
|
2605
2697
|
const p = this.pending.get(data.id);
|
|
2606
2698
|
if (!p) return;
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2699
|
+
clearTimeout(p.timer);
|
|
2700
|
+
this.pending.delete(data.id);
|
|
2701
|
+
stage = data.ok ? "result" : "error";
|
|
2702
|
+
try {
|
|
2703
|
+
if (data.ok === true) {
|
|
2704
|
+
if (!validResult(p.method, data.value) || !responsePayloadFits(p.method, data.value))
|
|
2705
|
+
throw failure("host_unavailable");
|
|
2706
|
+
p.resolve(data.value);
|
|
2707
|
+
return;
|
|
2708
|
+
}
|
|
2709
|
+
if (!isAppHostErrorInfo(data.error) || payloadSize(data.error) > APP_HOST_MAX_PAYLOAD_BYTES)
|
|
2615
2710
|
throw failure("host_unavailable");
|
|
2616
2711
|
const error = new AppHostError(
|
|
2617
2712
|
data.error.code,
|
|
@@ -2621,12 +2716,15 @@ var DocumentConnection = class {
|
|
|
2621
2716
|
...data.error.details === void 0 ? {} : { details: data.error.details }
|
|
2622
2717
|
}
|
|
2623
2718
|
);
|
|
2624
|
-
clearTimeout(p.timer);
|
|
2625
|
-
this.pending.delete(data.id);
|
|
2626
2719
|
p.reject(error);
|
|
2720
|
+
} catch {
|
|
2721
|
+
const fatal = p.method === "connect" || p.method === "negotiate";
|
|
2722
|
+
const error = invalidHostResponse(fatal ? "host_invalid_response" : "host_invalid_result", frameKind, stage, { method: p.method });
|
|
2723
|
+
p.reject(error);
|
|
2724
|
+
if (fatal) this.close(error);
|
|
2627
2725
|
}
|
|
2628
2726
|
} catch {
|
|
2629
|
-
this.close(
|
|
2727
|
+
this.close(invalidHostResponse("host_invalid_response", frameKind, stage, eventType ? { eventType } : void 0));
|
|
2630
2728
|
}
|
|
2631
2729
|
};
|
|
2632
2730
|
waitForPort() {
|
|
@@ -2667,6 +2765,7 @@ var DocumentConnection = class {
|
|
|
2667
2765
|
requireFeature: () => this.requireFeature("session-controls-v1"),
|
|
2668
2766
|
request: (method, params2) => this.request(method, params2)
|
|
2669
2767
|
});
|
|
2768
|
+
const nativeWindow = this.page.nomiNative?.appWindow;
|
|
2670
2769
|
const host = {
|
|
2671
2770
|
hasFeature: (feature) => this.features.has(feature),
|
|
2672
2771
|
commands: createAppCommandsApi({
|
|
@@ -2705,7 +2804,7 @@ var DocumentConnection = class {
|
|
|
2705
2804
|
this.listeners.delete(listener);
|
|
2706
2805
|
};
|
|
2707
2806
|
}
|
|
2708
|
-
}),
|
|
2807
|
+
}, this.features.has("window-chrome-v1") ? nativeWindow : void 0),
|
|
2709
2808
|
desktop: createAppDesktopApi(
|
|
2710
2809
|
{
|
|
2711
2810
|
requireFeature: (method) => {
|