@bobannomi/app-host 0.1.0-next.1 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/index.d.ts +111 -131
- package/dist/index.js +477 -242
- package/dist/index.js.map +3 -3
- package/dist/node/service-host.d.ts +114 -336
- package/dist/node/service-host.js +88 -153
- package/dist/node/service-host.js.map +3 -3
- package/dist/protocol.d.ts +492 -513
- package/dist/protocol.js +220 -140
- package/dist/protocol.js.map +3 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ JSON 方法使用非空键,文件方法使用宿主签发的文件 ID;页面
|
|
|
27
27
|
|
|
28
28
|
`pnpm --filter @bobannomi/app-host test`、`check-types`、`build` 分别运行测试、浏览器类型检查和 ESM/d.ts 构建。包只发布 dist 与本说明;Desktop 的 main/preload 只能从精确 `@bobannomi/app-host/protocol` 导入共享消息协议。新增公开页面方法须同时补充协议、严格验证和行为测试,不能从根入口导出 Electron 内部 API。
|
|
29
29
|
|
|
30
|
-
构建分别合并浏览器根入口、宿主 `/protocol` 和 Node `/node` 的 JS 与类型声明,内部工作区包只作为构建输入;类型检查分别使用浏览器 `tsconfig.json` 和 Node `tsconfig.node.json`。`verify:pack` 在独立临时项目检查真实 TGZ 的运行、类型与浏览器消费。仅 `@bobannomi/app-host/node` 会加载 `node:process`。Node 服务通过 `connectServiceHost()` 使用自己实际 IPC 的 owner 握手;`context.whenReady()` 等待同一实例的 ready,随后才启动调度计时器,不会创建 Agent
|
|
30
|
+
构建分别合并浏览器根入口、宿主 `/protocol` 和 Node `/node` 的 JS 与类型声明,内部工作区包只作为构建输入;类型检查分别使用浏览器 `tsconfig.json` 和 Node `tsconfig.node.json`。`verify:pack` 在独立临时项目检查真实 TGZ 的运行、类型与浏览器消费。仅 `@bobannomi/app-host/node` 会加载 `node:process`。Node 服务通过 `connectServiceHost()` 使用自己实际 IPC 的 owner 握手;`context.whenReady()` 等待同一实例的 ready,随后才启动调度计时器,不会创建 Agent。服务用 `host.sessions.getConnection({ dataScopeId, sessionId })` 核对已有会话及数据范围,再把 `AgentConnection.clientOptions` 交给普通 Client SDK。控制选项、原动作回执和角色目录分别由 `client.sessions.getControls()`、`client.sessions.getControlResult()` 和 `client.runtime.listAgentPersonas()` 读取。后台凭据始终由宿主管理。
|
|
31
31
|
|
|
32
32
|
`commands-v1` 提供 `host.commands.register(snapshot, invoke)`,回调保存在当前文档内。更新/注销使用 registration UUID 和递增 revision;旧 registration、旧 revision、禁用命令和关闭连接不会分发回调。命令、菜单、快捷键和工具栏都是有限数据,未知写入回执不会自动重放命令。
|
|
33
33
|
|
|
@@ -39,7 +39,7 @@ JSON 方法使用非空键,文件方法使用宿主签发的文件 ID;页面
|
|
|
39
39
|
|
|
40
40
|
协商 `browser-binding-invalidation-v1` 后,`browser-changed` 的 `snapshot` 可直接更新匹配目标和标签的批注界面。`invalidated: true` 表示原绑定已失效,此时快照仅供兼容,页面应重新核对原绑定。旧宿主和旧 SDK 继续使用不带标记的 `browser-changed` 触发读取。
|
|
41
41
|
|
|
42
|
-
协商 `browser-capture-preview-v1` 后,`host.desktop.browser.capturePreview({ targetId, tabId, pageRevision })` 返回当前网页的 PNG 字节与宽高。字节上限为 8 MiB
|
|
42
|
+
协商 `browser-capture-preview-v1` 后,`host.desktop.browser.capturePreview({ targetId, tabId, pageRevision })` 返回当前网页的 PNG 字节与宽高。字节上限为 8 MiB,应用可直接用它们显示预览或下载。
|
|
43
43
|
|
|
44
44
|
支持 `window-chrome-v1` 的宿主提供 `host.window`:getState() 读取平台、最大化、标题栏模式、macOS 控件避让宽度与实际材质,onStateChanged(listener) 返回取消监听函数;minimize()、toggleMaximize()、requestClose() 操作当前所属窗口。openHost({page}) 只打开 manage、settings、about、recovery。调用与监听都需先协商,旧宿主返回 incompatible。应用新接入时使用 `hostApi: "^0.1.1"`;关闭前保存由宿主沿 lifecycle 流程安排,SDK 不直接销毁窗口。
|
|
45
45
|
|
|
@@ -63,7 +63,7 @@ SDK 兼容只有 `code` 和 `message` 的错误回复。每次连接都核对版
|
|
|
63
63
|
|
|
64
64
|
根入口提供 `parsePluginAppComposerContexts`,校验插件输入框上下文。历史交互和 MCP 工具结果从各自的合同包读取。
|
|
65
65
|
|
|
66
|
-
`host.sessions.getConnection()`
|
|
66
|
+
`host.sessions.getConnection()` 只接受无参调用,为当前应用页面提供一条可复用的会话连接。将返回的 `clientOptions` 交给标准 Client SDK,按会话 ID 读取历史、订阅事件,或继续有执行权限的用户会话。Daemon 按每次访问的会话及操作核对授权。附件、辅助会话和原生文件工具沿各自入口指定目标。执行目录是创建请求的业务参数。
|
|
67
67
|
|
|
68
68
|
`host.desktop` fixes an explicit target (scope, draft revision, optional actual root and session), then exposes typed files, Git, terminal, window, browser annotation/capture and MCP App operations. `host.attachments.getConnection` also supports a draft-only target. `host.sessions` exposes auxiliary options/open/query/close using the original standard connection. See `src/desktop.ts`, `src/attachments.ts`, `src/auxiliary.ts`; each wire method validates both request and reply. Connections are recorded in a per-document WeakMap; a fabricated or foreign document connection cannot be bound. The three negotiated features are only available when their actual host services are assembled; they add no installation capability or Agent grant. Recovery methods query original request receipts and do not replay mutations.
|
|
69
69
|
|
package/dist/index.d.ts
CHANGED
|
@@ -45,6 +45,81 @@ declare class AppHostError extends Error {
|
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
interface ServiceStatus {
|
|
49
|
+
state: "absent" | "unauthorized" | "stopped" | "starting" | "recovering" | "ready" | "failed";
|
|
50
|
+
reason?: "dependency_missing" | "service_start_failed" | "service_unavailable" | "result_unknown" | "incompatible" | "revoked";
|
|
51
|
+
instanceId?: string;
|
|
52
|
+
apiVersion?: string;
|
|
53
|
+
}
|
|
54
|
+
interface ServiceWork {
|
|
55
|
+
requestId: string;
|
|
56
|
+
state: ServiceWorkState;
|
|
57
|
+
updatedAt: string;
|
|
58
|
+
result?: JsonValue$1;
|
|
59
|
+
error?: JsonValue$1;
|
|
60
|
+
}
|
|
61
|
+
interface ServiceConnectionDescriptor {
|
|
62
|
+
connectionId: string;
|
|
63
|
+
baseUrl: string;
|
|
64
|
+
apiVersion: string;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
declare const APP_HOST_FEATURES: readonly ["fetch-v1", "fetch-inline-body-v1", "fetch-target-close-v1", "service-v1", "extended-errors-v1", "workspace-v1", "session-resources-v1", "session-controls-v1", "conversation-creation-session-v1", "trusted-desktop-v1", "attachments-v1", "auxiliary-sessions-v1", "system-ui-v1", "lifecycle-v1", "commands-v1", "resource-catalog-v1", "file-content-v1", "window-chrome-v1", "window-updates-v1", "window-update-check-v1", "embedded-browser-v1", "browser-binding-invalidation-v1", "browser-capture-preview-v1"];
|
|
68
|
+
type AppHostFeature = (typeof APP_HOST_FEATURES)[number];
|
|
69
|
+
type FetchDirection = "upload" | "download";
|
|
70
|
+
type PageFetchFrame = {
|
|
71
|
+
protocol: 2;
|
|
72
|
+
} & ({
|
|
73
|
+
type: "fetch-open";
|
|
74
|
+
id: string;
|
|
75
|
+
connectionId: string;
|
|
76
|
+
url: string;
|
|
77
|
+
method: string;
|
|
78
|
+
headers: [string, string][];
|
|
79
|
+
hasBody: boolean;
|
|
80
|
+
inlineBody?: string;
|
|
81
|
+
} | {
|
|
82
|
+
type: "fetch-headers";
|
|
83
|
+
id: string;
|
|
84
|
+
status: number;
|
|
85
|
+
statusText: string;
|
|
86
|
+
headers: [string, string][];
|
|
87
|
+
hasBody: boolean;
|
|
88
|
+
} | {
|
|
89
|
+
type: "fetch-credit";
|
|
90
|
+
id: string;
|
|
91
|
+
direction: FetchDirection;
|
|
92
|
+
sequence: number;
|
|
93
|
+
chunks: number;
|
|
94
|
+
bytes: number;
|
|
95
|
+
} | {
|
|
96
|
+
type: "fetch-chunk";
|
|
97
|
+
id: string;
|
|
98
|
+
direction: FetchDirection;
|
|
99
|
+
sequence: number;
|
|
100
|
+
bytes: Uint8Array;
|
|
101
|
+
} | {
|
|
102
|
+
type: "fetch-end";
|
|
103
|
+
id: string;
|
|
104
|
+
direction: FetchDirection;
|
|
105
|
+
sequence: number;
|
|
106
|
+
} | {
|
|
107
|
+
type: "fetch-consumed";
|
|
108
|
+
id: string;
|
|
109
|
+
direction: "download";
|
|
110
|
+
sequence: number;
|
|
111
|
+
} | {
|
|
112
|
+
type: "fetch-cancel";
|
|
113
|
+
id: string;
|
|
114
|
+
} | {
|
|
115
|
+
type: "fetch-error";
|
|
116
|
+
id: string;
|
|
117
|
+
error: AppHostErrorInfo;
|
|
118
|
+
} | {
|
|
119
|
+
type: "fetch-close";
|
|
120
|
+
connectionId: string;
|
|
121
|
+
});
|
|
122
|
+
|
|
48
123
|
/** How an agent explains findings and delivers results, independently of update timing. */
|
|
49
124
|
type ReplyStyle = "collaborative" | "direct" | "explanatory";
|
|
50
125
|
|
|
@@ -102,26 +177,6 @@ interface SessionCreationReceipt {
|
|
|
102
177
|
revision?: number;
|
|
103
178
|
configuration?: SessionConfigurationSnapshot;
|
|
104
179
|
}
|
|
105
|
-
interface SessionConfigurationBinding {
|
|
106
|
-
revision: number;
|
|
107
|
-
/** Explicit creation choices plus subsequent editor deltas; never accepted as public metadata. */
|
|
108
|
-
configurationInput?: SessionConfigurationInput;
|
|
109
|
-
/** Original non-role defaults for fields that role selection can replace. */
|
|
110
|
-
roleBaseConfiguration?: SessionConfigurationInput;
|
|
111
|
-
effectiveConfiguration: ResolvedSessionConfiguration;
|
|
112
|
-
resolvedResources: (ConfigurationResourceRef & {
|
|
113
|
-
revision: string;
|
|
114
|
-
})[];
|
|
115
|
-
defaultsRevision: string;
|
|
116
|
-
configurationRoot: {
|
|
117
|
-
cwd: string;
|
|
118
|
-
settingsRoot: string;
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
interface ConfigurationResourceRef {
|
|
122
|
-
kind: "model" | "role" | "tool" | "plugin" | "service" | "skill" | "mcp";
|
|
123
|
-
id: string;
|
|
124
|
-
}
|
|
125
180
|
|
|
126
181
|
/** A directory's actual filesystem identity, captured by trusted execution code. */
|
|
127
182
|
interface SessionExecutionRoot {
|
|
@@ -152,7 +207,7 @@ type SessionExecutionSource = {
|
|
|
152
207
|
readonly sessionId: string;
|
|
153
208
|
readonly requestId: string;
|
|
154
209
|
};
|
|
155
|
-
/**
|
|
210
|
+
/** Actual roots and business source captured when work is accepted, then copied to Input/Run. */
|
|
156
211
|
interface SessionExecutionBinding {
|
|
157
212
|
readonly version: 1;
|
|
158
213
|
readonly cwd: SessionExecutionRoot;
|
|
@@ -178,7 +233,8 @@ interface SessionRecord {
|
|
|
178
233
|
agent?: string;
|
|
179
234
|
status: SessionStatus;
|
|
180
235
|
metadata: Record<string, unknown> & {
|
|
181
|
-
|
|
236
|
+
configurationInput?: SessionConfigurationInput;
|
|
237
|
+
pluginIds?: string[];
|
|
182
238
|
executionBinding?: SessionExecutionBinding;
|
|
183
239
|
};
|
|
184
240
|
createdAt: number;
|
|
@@ -240,81 +296,6 @@ type SessionControlOriginal = {
|
|
|
240
296
|
};
|
|
241
297
|
};
|
|
242
298
|
|
|
243
|
-
interface ServiceStatus {
|
|
244
|
-
state: "absent" | "unauthorized" | "stopped" | "starting" | "recovering" | "ready" | "failed";
|
|
245
|
-
reason?: "dependency_missing" | "service_start_failed" | "service_unavailable" | "result_unknown" | "incompatible" | "revoked";
|
|
246
|
-
instanceId?: string;
|
|
247
|
-
apiVersion?: string;
|
|
248
|
-
}
|
|
249
|
-
interface ServiceWork {
|
|
250
|
-
requestId: string;
|
|
251
|
-
state: ServiceWorkState;
|
|
252
|
-
updatedAt: string;
|
|
253
|
-
result?: JsonValue$1;
|
|
254
|
-
error?: JsonValue$1;
|
|
255
|
-
}
|
|
256
|
-
interface ServiceConnectionDescriptor {
|
|
257
|
-
connectionId: string;
|
|
258
|
-
baseUrl: string;
|
|
259
|
-
apiVersion: string;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
declare const APP_HOST_FEATURES: readonly ["fetch-v2", "fetch-inline-body-v1", "fetch-target-close-v1", "service-v1", "extended-errors-v1", "workspace-v1", "session-resources-v1", "session-controls-v1", "conversation-creation-session-v1", "trusted-desktop-v1", "attachments-v1", "auxiliary-sessions-v1", "system-ui-v1", "lifecycle-v1", "commands-v1", "resource-catalog-v1", "file-content-v1", "window-chrome-v1", "embedded-browser-v1", "browser-binding-invalidation-v1", "browser-capture-preview-v1"];
|
|
263
|
-
type AppHostFeature = typeof APP_HOST_FEATURES[number];
|
|
264
|
-
type FetchDirection = "upload" | "download";
|
|
265
|
-
type PageFetchFrame = {
|
|
266
|
-
protocol: 2;
|
|
267
|
-
} & ({
|
|
268
|
-
type: "fetch-open";
|
|
269
|
-
id: string;
|
|
270
|
-
connectionId: string;
|
|
271
|
-
url: string;
|
|
272
|
-
method: string;
|
|
273
|
-
headers: [string, string][];
|
|
274
|
-
hasBody: boolean;
|
|
275
|
-
inlineBody?: string;
|
|
276
|
-
} | {
|
|
277
|
-
type: "fetch-headers";
|
|
278
|
-
id: string;
|
|
279
|
-
status: number;
|
|
280
|
-
statusText: string;
|
|
281
|
-
headers: [string, string][];
|
|
282
|
-
hasBody: boolean;
|
|
283
|
-
} | {
|
|
284
|
-
type: "fetch-credit";
|
|
285
|
-
id: string;
|
|
286
|
-
direction: FetchDirection;
|
|
287
|
-
sequence: number;
|
|
288
|
-
chunks: number;
|
|
289
|
-
bytes: number;
|
|
290
|
-
} | {
|
|
291
|
-
type: "fetch-chunk";
|
|
292
|
-
id: string;
|
|
293
|
-
direction: FetchDirection;
|
|
294
|
-
sequence: number;
|
|
295
|
-
bytes: Uint8Array;
|
|
296
|
-
} | {
|
|
297
|
-
type: "fetch-end";
|
|
298
|
-
id: string;
|
|
299
|
-
direction: FetchDirection;
|
|
300
|
-
sequence: number;
|
|
301
|
-
} | {
|
|
302
|
-
type: "fetch-consumed";
|
|
303
|
-
id: string;
|
|
304
|
-
direction: "download";
|
|
305
|
-
sequence: number;
|
|
306
|
-
} | {
|
|
307
|
-
type: "fetch-cancel";
|
|
308
|
-
id: string;
|
|
309
|
-
} | {
|
|
310
|
-
type: "fetch-error";
|
|
311
|
-
id: string;
|
|
312
|
-
error: AppHostErrorInfo;
|
|
313
|
-
} | {
|
|
314
|
-
type: "fetch-close";
|
|
315
|
-
connectionId: string;
|
|
316
|
-
});
|
|
317
|
-
|
|
318
299
|
interface WorkspaceRef {
|
|
319
300
|
id: string;
|
|
320
301
|
displayName: string;
|
|
@@ -981,14 +962,6 @@ interface DesktopMethodMap {
|
|
|
981
962
|
"desktop.browser.removeAnnotation": Entry<BrowserPage & {
|
|
982
963
|
annotationId: string;
|
|
983
964
|
}, BrowserAnnotationSnapshot>;
|
|
984
|
-
"desktop.browser.capture": Entry<BrowserPage, {
|
|
985
|
-
assetId: string;
|
|
986
|
-
sha256: string;
|
|
987
|
-
mediaType: string;
|
|
988
|
-
byteLength: number;
|
|
989
|
-
width: number;
|
|
990
|
-
height: number;
|
|
991
|
-
}>;
|
|
992
965
|
"desktop.browser.capturePreview": Entry<BrowserPage, {
|
|
993
966
|
bytes: Uint8Array<ArrayBuffer>;
|
|
994
967
|
width: number;
|
|
@@ -1167,7 +1140,7 @@ declare function createAppDesktopApi(rpc: {
|
|
|
1167
1140
|
/** Persist this normalized original alongside a request ID; recovery sends exactly that request. */
|
|
1168
1141
|
declare function canonicalDesktopRequest(value: unknown): string;
|
|
1169
1142
|
|
|
1170
|
-
/** The
|
|
1143
|
+
/** The extension manager's finite operations. */
|
|
1171
1144
|
declare const EXTENSION_INPUTS: {
|
|
1172
1145
|
context: Check;
|
|
1173
1146
|
"plugins.loadIcon": Check;
|
|
@@ -1192,6 +1165,8 @@ declare const EXTENSION_INPUTS: {
|
|
|
1192
1165
|
"plugins.marketplaceOperation": Check;
|
|
1193
1166
|
"skills.snapshot": Check;
|
|
1194
1167
|
"skills.remove": Check;
|
|
1168
|
+
"skills.marketplaceCatalog": Check;
|
|
1169
|
+
"skills.marketplaceInstall": (value: unknown) => boolean;
|
|
1195
1170
|
"mcp.snapshot": Check;
|
|
1196
1171
|
"mcp.exportConfig": Check;
|
|
1197
1172
|
"mcp.getConfig": Check;
|
|
@@ -1295,6 +1270,9 @@ type ModelProviderRequest = {
|
|
|
1295
1270
|
} | {
|
|
1296
1271
|
action: "createCustom";
|
|
1297
1272
|
value: CustomModelProviderInput;
|
|
1273
|
+
} | {
|
|
1274
|
+
action: "syncAccount";
|
|
1275
|
+
value: CustomModelProviderInput;
|
|
1298
1276
|
} | {
|
|
1299
1277
|
action: "updateCustom";
|
|
1300
1278
|
provider: string;
|
|
@@ -1496,7 +1474,7 @@ type SystemEvent = {
|
|
|
1496
1474
|
type: "git-preferences-changed";
|
|
1497
1475
|
defaultTaskLocation: "current" | "worktree";
|
|
1498
1476
|
};
|
|
1499
|
-
declare const SYSTEM_METHODS: readonly ["system.projects", "system.extensions", "system.modelProviders", "system.providerDefaults", "system.open", "system.getPresentationPreferences", "system.setTheme", "system.setWindowMaterial", "system.copyText", "system.openExternal", "system.
|
|
1477
|
+
declare const SYSTEM_METHODS: readonly ["system.projects", "system.extensions", "system.modelProviders", "system.providerDefaults", "system.open", "system.getPresentationPreferences", "system.setTheme", "system.setWindowMaterial", "system.copyText", "system.openExternal", "system.navigationReady", "system.completeNavigation"];
|
|
1500
1478
|
interface SystemMethodMap {
|
|
1501
1479
|
"system.projects": {
|
|
1502
1480
|
params: ProjectRequest;
|
|
@@ -1548,14 +1526,6 @@ interface SystemMethodMap {
|
|
|
1548
1526
|
};
|
|
1549
1527
|
result: void;
|
|
1550
1528
|
};
|
|
1551
|
-
"system.markSessionRead": {
|
|
1552
|
-
params: {
|
|
1553
|
-
connectionId: string;
|
|
1554
|
-
sessionId: string;
|
|
1555
|
-
throughSeq: number;
|
|
1556
|
-
};
|
|
1557
|
-
result: void;
|
|
1558
|
-
};
|
|
1559
1529
|
"system.navigationReady": {
|
|
1560
1530
|
params: Record<string, never>;
|
|
1561
1531
|
result: {
|
|
@@ -1602,11 +1572,6 @@ interface AppHostSystem {
|
|
|
1602
1572
|
copyText(text: string): Promise<void>;
|
|
1603
1573
|
/** Opens an HTTP(S) URL without credentials in the default browser. */
|
|
1604
1574
|
openExternal(url: string): Promise<void>;
|
|
1605
|
-
markSessionRead(input: {
|
|
1606
|
-
connection: AgentConnection;
|
|
1607
|
-
sessionId: string;
|
|
1608
|
-
throughSeq: number;
|
|
1609
|
-
}): Promise<void>;
|
|
1610
1575
|
navigationReady(): Promise<{
|
|
1611
1576
|
pending: DesktopNavigationTarget | null;
|
|
1612
1577
|
}>;
|
|
@@ -1792,15 +1757,10 @@ declare function createAppAuxiliarySessionsApi(rpc: {
|
|
|
1792
1757
|
request<M extends AuxiliaryMethod>(method: M, params: AuxiliaryMethodMap[M]["params"]): Promise<AuxiliaryMethodMap[M]["result"]>;
|
|
1793
1758
|
}, streams: ConnectionStreams): AppHostAuxiliarySessions;
|
|
1794
1759
|
|
|
1795
|
-
interface SessionTarget {
|
|
1796
|
-
dataScopeId: string;
|
|
1797
|
-
sessionId: string;
|
|
1798
|
-
}
|
|
1799
|
-
type SessionConnectionTarget = SessionTarget | Record<string, never>;
|
|
1800
1760
|
interface AppHostSessions {
|
|
1801
|
-
/**
|
|
1802
|
-
*
|
|
1803
|
-
getConnection(
|
|
1761
|
+
/** Handles share the page's connection. Closing any handle ends the
|
|
1762
|
+
* connection and all its in-flight requests. */
|
|
1763
|
+
getConnection(): Promise<AgentConnection>;
|
|
1804
1764
|
}
|
|
1805
1765
|
|
|
1806
1766
|
interface ServiceConnection {
|
|
@@ -1893,6 +1853,20 @@ interface AppWindowMaterialState {
|
|
|
1893
1853
|
shell: "solid" | "translucent" | "transparent";
|
|
1894
1854
|
unavailableReason: "unsupported-platform" | "unsupported-system" | "reduced-transparency" | "material-error" | null;
|
|
1895
1855
|
}
|
|
1856
|
+
/** Host update facts for a custom title bar. Actions stay in the host's About window. */
|
|
1857
|
+
type AppWindowUpdateState = {
|
|
1858
|
+
status: "idle" | "checking" | "error";
|
|
1859
|
+
} | {
|
|
1860
|
+
status: "available" | "downloaded";
|
|
1861
|
+
version: string;
|
|
1862
|
+
} | {
|
|
1863
|
+
status: "downloading";
|
|
1864
|
+
version: string;
|
|
1865
|
+
percent: number;
|
|
1866
|
+
};
|
|
1867
|
+
type AppWindowUpdateCheckResult = AppWindowUpdateState | {
|
|
1868
|
+
status: "unsupported";
|
|
1869
|
+
};
|
|
1896
1870
|
interface AppWindowState {
|
|
1897
1871
|
platform: "win32" | "darwin" | "linux";
|
|
1898
1872
|
maximized: boolean;
|
|
@@ -1900,6 +1874,7 @@ interface AppWindowState {
|
|
|
1900
1874
|
/** Horizontal space to reserve inside the application's title bar, in page coordinates. */
|
|
1901
1875
|
trafficLightInset: number;
|
|
1902
1876
|
material: AppWindowMaterialState;
|
|
1877
|
+
update?: AppWindowUpdateState;
|
|
1903
1878
|
}
|
|
1904
1879
|
interface AppWindowOpenHostInput {
|
|
1905
1880
|
page: "manage" | "settings" | "about" | "recovery";
|
|
@@ -1914,12 +1889,16 @@ interface WindowStateChanged {
|
|
|
1914
1889
|
type: "window-state-changed";
|
|
1915
1890
|
state: AppWindowState;
|
|
1916
1891
|
}
|
|
1917
|
-
declare const WINDOW_METHODS: readonly ["window.getState", "window.minimize", "window.toggleMaximize", "window.requestClose", "window.openHost", "window.reportStartup"];
|
|
1892
|
+
declare const WINDOW_METHODS: readonly ["window.getState", "window.checkForUpdates", "window.minimize", "window.toggleMaximize", "window.requestClose", "window.openHost", "window.reportStartup"];
|
|
1918
1893
|
interface WindowMethodMap {
|
|
1919
1894
|
"window.getState": {
|
|
1920
1895
|
params: Record<string, never>;
|
|
1921
1896
|
result: AppWindowState;
|
|
1922
1897
|
};
|
|
1898
|
+
"window.checkForUpdates": {
|
|
1899
|
+
params: Record<string, never>;
|
|
1900
|
+
result: AppWindowUpdateCheckResult;
|
|
1901
|
+
};
|
|
1923
1902
|
"window.minimize": {
|
|
1924
1903
|
params: Record<string, never>;
|
|
1925
1904
|
result: void;
|
|
@@ -1949,6 +1928,7 @@ declare function validWindowResult(method: WindowMethod, value: unknown): boolea
|
|
|
1949
1928
|
declare function validWindowEvent(value: unknown): value is WindowStateChanged;
|
|
1950
1929
|
interface AppHostWindow {
|
|
1951
1930
|
getState(): Promise<AppWindowState>;
|
|
1931
|
+
checkForUpdates(): Promise<AppWindowUpdateCheckResult>;
|
|
1952
1932
|
onStateChanged(listener: (state: AppWindowState) => void): () => void;
|
|
1953
1933
|
minimize(): Promise<void>;
|
|
1954
1934
|
toggleMaximize(): Promise<void>;
|
|
@@ -1958,7 +1938,7 @@ interface AppHostWindow {
|
|
|
1958
1938
|
reportStartup(input: AppWindowStartupResult): Promise<void>;
|
|
1959
1939
|
}
|
|
1960
1940
|
interface WindowRequester {
|
|
1961
|
-
requireFeature(): void;
|
|
1941
|
+
requireFeature(feature?: "window-update-check-v1"): void;
|
|
1962
1942
|
request<M extends WindowMethod>(method: M, params: WindowMethodMap[M]["params"]): Promise<WindowMethodMap[M]["result"]>;
|
|
1963
1943
|
onEvent(listener: (event: AppHostEvent) => void): () => void;
|
|
1964
1944
|
}
|
|
@@ -2038,4 +2018,4 @@ interface PluginAppConversationInput {
|
|
|
2038
2018
|
declare function parsePluginAppComposerContexts(value: unknown): PluginAppConversationInput[];
|
|
2039
2019
|
|
|
2040
2020
|
export { ATTACHMENTS_METHODS, AUXILIARY_METHODS, AppHostError, BROWSER_CAPTURE_PREVIEW_MAX_BYTES, COMMANDS_METHODS, DESKTOP_METHODS, EXTENSION_INPUTS, RESOURCE_CATALOG_METHODS, SYSTEM_METHODS, SYSTEM_SETTINGS_SECTIONS, SYSTEM_SHORTCUT_IDS, WINDOW_METHODS, canonicalDesktopRequest, connectAppHost, createAppAttachmentsApi, createAppAuxiliarySessionsApi, createAppCommandsApi, createAppDesktopApi, createAppSystemApi, createAppWindowApi, createPageFetchClient, createResourceCatalogApi, isAuxiliaryMethod, isCommandsMethod, isDesktopMethod, isResourceCatalogMethod, isSystemMethod, isWindowMethod, parsePluginAppComposerContexts, validAppCommandSnapshot, validAppWindowState, validAttachmentsInput, validAttachmentsResult, validAuxiliaryInput, validAuxiliaryResult, validBrowserSnapshot, validCommandInvocation, validCommandReceipt, validCommandsInput, validDesktopEvent, validDesktopInput, validDesktopNavigationTarget, validDesktopResult, validDesktopResultForInput, validDesktopTarget, validExtensionRequest, validExtensionResult, validPresentationSnapshot, validProjectRequest, validProjectSnapshot, validResourceCatalogInput, validResourceCatalogResult, validResourceChanged, validSessionSettingsTarget, validSystemEvent, validSystemInput, validSystemResult, validWindowEvent, validWindowInput, validWindowResult, validWorkspaceOperation };
|
|
2041
|
-
export type { AgentConnection, AnnotationMode, AnnotationRect, AnnotationTarget, AppCommandRegistration, AppCommandSnapshot, AppContext, AppHost, AppHostAttachments, AppHostAuxiliarySessions, AppHostCommands, AppHostDesktop, AppHostErrorCode, AppHostErrorInfo, AppHostEvent, AppHostLifecycle, AppHostRetry, AppHostService, AppHostSessions, AppHostStorage, AppHostSystem, AppHostWindow, AppHostWorkspace, AppUnloadHandler, AppUnloadReason, AppUnloadRequest, AppWindowMaterialState, AppWindowOpenHostInput, AppWindowStartupResult, AppWindowState, AppearancePreferences, AttachmentsMethod, AttachmentsMethodMap, AuxiliaryMethod, AuxiliaryMethodMap, AuxiliaryOptions, AuxiliaryReceipt, AuxiliaryRequest, AuxiliarySelection, AuxiliaryWireRequest, BindDesktopTarget, BrowserAnnotationRecord, BrowserAnnotationSnapshot, BrowserPage, ClientConnection, CommandInvocation, CommandReceipt, CommandsMethod, CommandsMethodMap, ConnectParams, ConversationPreparation, DesktopGitChange, DesktopMethod, DesktopMethodMap, DesktopNavigationTarget, DesktopOpener, DesktopRoot, DesktopSearch, DesktopTarget, DesktopTerminal, DesktopTerminalInfo, DesktopTerminalRequestOriginal, DesktopTerminalRequestReceipt, DesktopTerminalSnapshot, DesktopText, DesktopToolEvent, DesktopWindow, ExtensionOperation, ExtensionRequest, JsonValue$1 as JsonValue, LoginResult, ModelProviderConnection, ModelProviderRequest, NavigationCompletionStatus, PluginAppActionReceipt, PluginAppActionResponse, PluginAppCatalog, PluginAppComposerContext, PluginAppHostState, PluginAppModelContext, PluginAppMount, PluginAppPreparedMessage, PluginAppPreparedTool, PluginAppRecord, PluginAppSource$1 as PluginAppSource, PluginAppSubmissionReceipt, PluginAppToolPolicy, PresentationSnapshot, ProjectRequest, ProjectSnapshot, ProviderConnectionTestResult, ProviderDefaultsRequest, ProviderDefaultsSnapshot, ResourceCatalogMethod, ResourceCatalogMethodMap, ResourceChanged, ServiceConnection, ServiceConnectionDescriptor, ServiceStatus, ServiceWork, ServiceWorkState, SessionSettingsTarget, SessionSettingsWireTarget,
|
|
2021
|
+
export type { AgentConnection, AnnotationMode, AnnotationRect, AnnotationTarget, AppCommandRegistration, AppCommandSnapshot, AppContext, AppHost, AppHostAttachments, AppHostAuxiliarySessions, AppHostCommands, AppHostDesktop, AppHostErrorCode, AppHostErrorInfo, AppHostEvent, AppHostLifecycle, AppHostRetry, AppHostService, AppHostSessions, AppHostStorage, AppHostSystem, AppHostWindow, AppHostWorkspace, AppUnloadHandler, AppUnloadReason, AppUnloadRequest, AppWindowMaterialState, AppWindowOpenHostInput, AppWindowStartupResult, AppWindowState, AppWindowUpdateCheckResult, AppWindowUpdateState, AppearancePreferences, AttachmentsMethod, AttachmentsMethodMap, AuxiliaryMethod, AuxiliaryMethodMap, AuxiliaryOptions, AuxiliaryReceipt, AuxiliaryRequest, AuxiliarySelection, AuxiliaryWireRequest, BindDesktopTarget, BrowserAnnotationRecord, BrowserAnnotationSnapshot, BrowserPage, ClientConnection, CommandInvocation, CommandReceipt, CommandsMethod, CommandsMethodMap, ConnectParams, ConversationPreparation, DesktopGitChange, DesktopMethod, DesktopMethodMap, DesktopNavigationTarget, DesktopOpener, DesktopRoot, DesktopSearch, DesktopTarget, DesktopTerminal, DesktopTerminalInfo, DesktopTerminalRequestOriginal, DesktopTerminalRequestReceipt, DesktopTerminalSnapshot, DesktopText, DesktopToolEvent, DesktopWindow, ExtensionOperation, ExtensionRequest, JsonValue$1 as JsonValue, LoginResult, ModelProviderConnection, ModelProviderRequest, NavigationCompletionStatus, PluginAppActionReceipt, PluginAppActionResponse, PluginAppCatalog, PluginAppComposerContext, PluginAppHostState, PluginAppModelContext, PluginAppMount, PluginAppPreparedMessage, PluginAppPreparedTool, PluginAppRecord, PluginAppSource$1 as PluginAppSource, PluginAppSubmissionReceipt, PluginAppToolPolicy, PresentationSnapshot, ProjectRequest, ProjectSnapshot, ProviderConnectionTestResult, ProviderDefaultsRequest, ProviderDefaultsSnapshot, ResourceCatalogMethod, ResourceCatalogMethodMap, ResourceChanged, ServiceConnection, ServiceConnectionDescriptor, ServiceStatus, ServiceWork, ServiceWorkState, SessionSettingsTarget, SessionSettingsWireTarget, StorageGetResult, StoredFile, SystemEvent, SystemMethod, SystemMethodMap, SystemOpenInput, SystemOpenWireInput, SystemProject, SystemRequester, SystemShortcutId, WindowMethod, WindowMethodMap, WindowRequester, WindowStateChanged, WorkspaceConversationCreation, WorkspaceConversationResult, WorkspaceDirectoryPage, WorkspaceFilePage, WorkspaceOperation, WorkspaceOperationKind, WorkspaceOperationOriginal, WorkspaceRef, WorkspaceSelection, WorkspaceText };
|