@solazah/solazah-runtime 0.0.156

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/index.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";
package/index.js ADDED
@@ -0,0 +1 @@
1
+
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@solazah/solazah-runtime",
3
+ "version": "0.0.156",
4
+ "main": "index.cjs",
5
+ "module": "index.js",
6
+ "types": "types/index.d.ts",
7
+ "files": [
8
+ "index.cjs",
9
+ "index.js",
10
+ "types"
11
+ ],
12
+ "peerDependencies": {
13
+ "electron": ">=25"
14
+ },
15
+ "publishConfig": {
16
+ "access": "public",
17
+ "registry": "https://registry.npmjs.org/"
18
+ }
19
+ }
@@ -0,0 +1,9 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export default class Account {
3
+ private transport;
4
+ constructor(transport?: IpcRenderer);
5
+ login: () => Promise<any>;
6
+ logout: () => Promise<any>;
7
+ getState: () => Promise<any>;
8
+ getUserInfo: () => Promise<any>;
9
+ }
@@ -0,0 +1,97 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export interface CopilotMessage {
3
+ event: string | 'messages/metadata' | 'messages/partial' | 'updates' | 'values' | 'error' | 'done';
4
+ data?: string;
5
+ }
6
+ export interface CopilotMessage {
7
+ role: "user" | "assistant" | "system";
8
+ content: string;
9
+ }
10
+ export interface CopilotBaseOptions {
11
+ model?: string;
12
+ messages?: CopilotMessage[];
13
+ timeout?: number;
14
+ temperature?: number;
15
+ /**
16
+ * 深度思考开关(旧契约,保留作后备):
17
+ * - true: 在 provider 创建 chatModel 时显式打开推理(DeepSeek 走 modelKwargs.thinking = { type: "enabled" })
18
+ * - false: 显式关闭
19
+ * - undefined: 保持模型默认
20
+ * 优先级低于 reasoningEffort:provider 先看 reasoningEffort,缺省才回落到 enableThinking。
21
+ * quick-chat / popup 仍只传 enableThinking:false(不带 reasoningEffort)→ 关思考。
22
+ */
23
+ enableThinking?: boolean;
24
+ /**
25
+ * 深度思考「强度」——主对话输入框的 Effort 选择器下发的抽象档位(默认 max)。
26
+ * 各 provider 自行映射:OpenAI 兼容 → reasoning_effort(minimal/low/medium/high);
27
+ * Anthropic 原生 → thinking.budget_tokens + temperature=1;DeepSeek → thinking on/off。
28
+ */
29
+ reasoningEffort?: "off" | "fast" | "balanced" | "smart" | "max" | "ultra";
30
+ }
31
+ export interface CopilotCompletionOptions extends CopilotBaseOptions {
32
+ }
33
+ export interface CopilotChatOptions extends CopilotBaseOptions {
34
+ requestId: string;
35
+ signal?: AbortSignal;
36
+ stream?: boolean;
37
+ /**
38
+ * 内部字段:main 进程构造,仅用于本进程内回调(不跨 IPC)。
39
+ * 流式调用在 catch 分支抛错时由 streaming 层调用此回调,让上层有机会回滚预占的配额。
40
+ */
41
+ onStreamError?: () => Promise<void> | void;
42
+ }
43
+ export interface CopilotOptions extends CopilotChatOptions {
44
+ mcp?: string[];
45
+ projectDir?: string;
46
+ recursionLimit?: number;
47
+ thread_id?: string;
48
+ run_id?: string;
49
+ streamMode?: string[];
50
+ plugins?: string[];
51
+ tools?: any[];
52
+ skills?: string[];
53
+ chatModel?: any;
54
+ toolCallId?: string;
55
+ /**
56
+ * 编辑历史消息后重新生成:
57
+ * CopilotAgent.invoke 在主流前按这个 id 在 langgraph state 里定位,
58
+ * 把 [该消息, end) 用 RemoveMessage 从 agent 工作记忆里摘掉,DB 按同一批 id 清理,
59
+ * 之后照常以新输入开 invoke。
60
+ */
61
+ editFromMessageId?: string;
62
+ /**
63
+ * 内部字段:run() 给 CopilotAgent 的"本轮入口 HumanMessage id"。
64
+ * 持久化时按这个 id 在 latestState.messages 里找下标,从下标开始 slice 落库。
65
+ * 替代原来"数 prevCount"的脆弱方案——历史 abort 留下的 cancel placeholder
66
+ * 是在下一轮 invoke 启动阶段才被 langgraph 补进 state 的,prevCount 算不到,
67
+ * 会被误并入下一轮的 saveAll 批次,导致 tool 排到 user 前面。
68
+ */
69
+ persistFromMessageId?: string;
70
+ /**
71
+ * 内部字段:resume() 给 CopilotAgent 的锚点 tool_call_id。
72
+ * resume 入口已经把这个 tool 消息单独写进了 DB,持久化时从 state 里找到该 tool 的下标,
73
+ * 从下一条开始 slice,避免重复落库 + 抗历史 placeholder 污染。
74
+ */
75
+ persistFromToolCallId?: string;
76
+ /**
77
+ * 视觉模型的图片输入。每条 image_url 直接作为 content part 拼到本轮 HumanMessage 上,
78
+ * 与 input 文本同一条消息。仅 run() 这条路径用得到;completion/chat 不接。
79
+ * 渲染层负责判定模型是否支持视觉再传,这里不再二次过滤。
80
+ */
81
+ images?: {
82
+ url: string;
83
+ mime?: string;
84
+ }[];
85
+ }
86
+ export type CopilotRunOptions = CopilotOptions;
87
+ export default class Copilot {
88
+ ipcRenderer: IpcRenderer;
89
+ private seq;
90
+ constructor();
91
+ completion: (input: string, options: any) => Promise<any>;
92
+ chat: (input: string, options: CopilotRunOptions) => Promise<AsyncIterableIterator<any>>;
93
+ run: (input: string, options: CopilotRunOptions) => Promise<AsyncIterableIterator<any>>;
94
+ abort: (requestId: string) => Promise<any>;
95
+ resume: (response: any, options: CopilotRunOptions) => Promise<AsyncIterableIterator<any>>;
96
+ private invokeStream;
97
+ }
@@ -0,0 +1,29 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ /** agent 在对话里装好一台 MCP server 后,主进程经 copilot.mcp.installed 推来的 payload。 */
3
+ export interface CopilotMcpInstalledMessage {
4
+ name: string;
5
+ displayName: string;
6
+ transport: string;
7
+ toolNames: string[];
8
+ }
9
+ export default class CopilotMcpServer {
10
+ private transport;
11
+ constructor(transport?: IpcRenderer);
12
+ getServers: () => Promise<any>;
13
+ addServer: (data: any) => Promise<any>;
14
+ updateServer: (id: string, data: any) => Promise<any>;
15
+ removeServer: (id: string) => Promise<any>;
16
+ toggleServer: (id: string, enabled: boolean) => Promise<any>;
17
+ testConnect: (server: string) => Promise<any>;
18
+ /**
19
+ * 订阅"agent 在对话里装好了一台 MCP server"通知。渲染层据此刷新列表、把新 server 并入
20
+ * 当前会话的 usedServers、弹全局 Toast。返回 unsubscribe。
21
+ * 底层 IpcRenderer.on 对同通道 removeAllListeners 后再绑,全局只应有一个订阅者。
22
+ */
23
+ onMcpInstalled: (onInstalled: (msg: CopilotMcpInstalledMessage) => void) => (() => void);
24
+ /** 订阅"agent 在对话里删除/禁用了一台 MCP server"通知。渲染层据此刷新列表、把它移出 usedServers。 */
25
+ onMcpRemoved: (onRemoved: (msg: {
26
+ name: string;
27
+ displayName?: string;
28
+ }) => void) => (() => void);
29
+ }
@@ -0,0 +1,17 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export default class CopilotModel {
3
+ private transport;
4
+ constructor(transport?: IpcRenderer);
5
+ add: (model: any) => Promise<any>;
6
+ update: (modelId: string, model: any) => Promise<any>;
7
+ remove: (modelId: string) => Promise<any>;
8
+ getModels: () => Promise<any>;
9
+ load: (model: string) => Promise<any>;
10
+ eject: (model: string) => Promise<any>;
11
+ getTasks: () => Promise<any>;
12
+ download: (model: string) => Promise<any>;
13
+ cancelDownload: (model: string) => Promise<any>;
14
+ pauseDownload: (model: string) => Promise<any>;
15
+ resumeDownload: (model: string) => Promise<any>;
16
+ getEmbeddedQuota: () => Promise<any>;
17
+ }
@@ -0,0 +1,9 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export default class CopilotProvider {
3
+ private transport;
4
+ constructor(transport?: IpcRenderer);
5
+ getProviders: () => Promise<any>;
6
+ add: (provider: any) => Promise<any>;
7
+ update: (providerId: string, provider: any) => Promise<any>;
8
+ remove: (providerId: string) => Promise<any>;
9
+ }
@@ -0,0 +1,84 @@
1
+ export interface CopilotSubAgentRunDto {
2
+ id: string;
3
+ type: string;
4
+ goal: string;
5
+ status: string;
6
+ result: string | null;
7
+ errorMessage: string | null;
8
+ threadId: string | null;
9
+ toolCallId: string | null;
10
+ metadata: any;
11
+ startedAt: string | null;
12
+ finishedAt: string | null;
13
+ created_at: string;
14
+ updated_at: string;
15
+ }
16
+ export interface CopilotSubAgentArtifactDto {
17
+ id: string;
18
+ runId: string;
19
+ kind: string;
20
+ relPath: string;
21
+ mime: string | null;
22
+ sha256: string | null;
23
+ sizeBytes: number | null;
24
+ label: string | null;
25
+ created_at: string;
26
+ }
27
+ export interface CopilotSubAgentStreamMessage {
28
+ event: string;
29
+ data?: any;
30
+ }
31
+ /** 异步任务完成时,主进程主动推到渲染层的通知 payload(通道 copilot.subagent.task-finished)。 */
32
+ export interface CopilotAsyncTaskFinishedMessage {
33
+ taskId: string;
34
+ threadId: string | null;
35
+ status: string;
36
+ result: string | null;
37
+ errorMessage: string | null;
38
+ goal: string | null;
39
+ durationMs: number;
40
+ }
41
+ /**
42
+ * window.copilotSubagent —— 渲染层访问 subagent 的总入口。
43
+ * 普通查询走 invoke;subscribe 走 MessagePort,跟 window.copilot.chat 同款。
44
+ */
45
+ export default class CopilotSubAgent {
46
+ private readonly ipcRenderer;
47
+ constructor();
48
+ list: (limit?: number, offset?: number) => Promise<CopilotSubAgentRunDto[]>;
49
+ listByThread: (threadId: string) => Promise<CopilotSubAgentRunDto[]>;
50
+ listByScheduledTask: (scheduledTaskId: string) => Promise<CopilotSubAgentRunDto[]>;
51
+ get: (runId: string) => Promise<CopilotSubAgentRunDto | null>;
52
+ getArtifacts: (runId: string) => Promise<CopilotSubAgentArtifactDto[]>;
53
+ readArtifact: (artifactId: string) => Promise<{
54
+ mime: string | null;
55
+ base64: string;
56
+ } | null>;
57
+ getState: (runId: string) => Promise<unknown | null>;
58
+ /**
59
+ * 历史 run 回放:返回完整事件流(从 events.jsonl 读),前端按时间顺序消费一次即可。
60
+ * 跟 subscribe 互补 —— 用于 toolFinished 的旧 task 详情抽屉。
61
+ */
62
+ replay: (runId: string) => Promise<any[]>;
63
+ abort: (runId: string) => Promise<{
64
+ ok: boolean;
65
+ }>;
66
+ /**
67
+ * 订阅一个 run 的实时事件流。
68
+ * onEvent 收到 { event, data } 对象;event === "done" 表示流结束(handler 应自行 unsubscribe)。
69
+ * 返回 unsubscribe 函数。
70
+ *
71
+ * 主进程用 per-runId 的 channel(copilot.subagent.stream.<runId>) 把 port 推回来,
72
+ * 多 subagent 并发也不会串台。
73
+ */
74
+ subscribe: (runId: string, onEvent: (msg: CopilotSubAgentStreamMessage) => void) => (() => void);
75
+ /**
76
+ * 订阅"异步任务完成"通知(主进程在 async-task 跑完时主动广播)。
77
+ * 前端可据此弹 toast / 在对应 thread 上一键让主 agent 拿结果续轮。
78
+ *
79
+ * onFinished 收到 CopilotAsyncTaskFinishedMessage;返回 unsubscribe 函数。
80
+ * 注意:底层 IpcRenderer.on 对同一通道会 removeAllListeners 后再绑,故全局只应有一个订阅者
81
+ * (通常是顶层的任务管理器),需要分发给多个组件时自行在这层之上做扇出。
82
+ */
83
+ onTaskFinished: (onFinished: (msg: CopilotAsyncTaskFinishedMessage) => void) => (() => void);
84
+ }
@@ -0,0 +1,12 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export default class CopilotThread {
3
+ private transport;
4
+ constructor(transport?: IpcRenderer);
5
+ getThreads: (limit?: number, offset?: number) => Promise<any>;
6
+ getMessages: (threadId: string) => Promise<any>;
7
+ add: (thread: any) => Promise<any>;
8
+ update: (id: string, thread: any) => Promise<any>;
9
+ remove: (id: string) => Promise<any>;
10
+ removeAll: () => Promise<any>;
11
+ generateThreadTitle: (id: string) => Promise<any>;
12
+ }
@@ -0,0 +1,43 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export interface WechatAccount {
3
+ accountId: string;
4
+ baseUrl: string;
5
+ cdnBaseUrl: string;
6
+ token?: string;
7
+ configured: boolean;
8
+ userId?: string;
9
+ enabled: boolean;
10
+ }
11
+ export interface WechatLoginStartResult {
12
+ qrcode: string;
13
+ sessionKey: string;
14
+ message: string;
15
+ }
16
+ export interface WechatLoginResult {
17
+ connected: boolean;
18
+ alreadyConnected?: boolean;
19
+ accountId?: string;
20
+ sessionKey?: string;
21
+ baseUrl?: string;
22
+ userId?: string;
23
+ message: string;
24
+ }
25
+ export interface WechatChannelStatus {
26
+ running: boolean;
27
+ account: WechatAccount;
28
+ }
29
+ export default class CopilotWechatBridge {
30
+ private transport;
31
+ constructor(transport?: IpcRenderer);
32
+ startLogin: (params?: {
33
+ force?: boolean;
34
+ }) => Promise<WechatLoginStartResult>;
35
+ waitForLogin: (params: {
36
+ sessionKey: string;
37
+ timeoutMs?: number;
38
+ }) => Promise<WechatLoginResult>;
39
+ logout: () => Promise<void>;
40
+ status: () => Promise<WechatChannelStatus>;
41
+ channelStart: () => Promise<void>;
42
+ channelStop: () => Promise<void>;
43
+ }
File without changes
@@ -0,0 +1,47 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export type WorkspaceCategory = "document" | "image" | "audio" | "video" | "resource";
3
+ export interface FileEntry {
4
+ name: string;
5
+ path: string;
6
+ isDir: boolean;
7
+ size: number;
8
+ mtimeMs: number;
9
+ }
10
+ export interface FileStat {
11
+ isDir: boolean;
12
+ size: number;
13
+ mtimeMs: number;
14
+ ctimeMs: number;
15
+ }
16
+ export interface FileChange {
17
+ type: string;
18
+ path: string | null;
19
+ }
20
+ export interface FileListOptions {
21
+ recursive?: boolean;
22
+ workspaceId?: string | null;
23
+ }
24
+ /**
25
+ * window.file —— 工作空间分类目录(文档/图片/音频/视频/.blob)内的通用文件读写。
26
+ * 寻址按「分类 + 相对路径」,主进程把路径钉死在分类目录内。watch 用每订阅独立频道接收变更,
27
+ * 返回退订闭包(off 跨 contextBridge 失效,清理一律调返回值)。
28
+ */
29
+ export default class File {
30
+ private transport;
31
+ private seq;
32
+ constructor(transport?: IpcRenderer);
33
+ read: (category: WorkspaceCategory, relPath: string, workspaceId?: string | null) => Promise<string>;
34
+ write: (category: WorkspaceCategory, relPath: string, content: string, workspaceId?: string | null) => Promise<void>;
35
+ readBinary: (category: WorkspaceCategory, relPath: string, workspaceId?: string | null) => Promise<Uint8Array>;
36
+ writeBinary: (category: WorkspaceCategory, relPath: string, data: Uint8Array, workspaceId?: string | null) => Promise<void>;
37
+ list: (category: WorkspaceCategory, relPath?: string, options?: FileListOptions) => Promise<FileEntry[]>;
38
+ stat: (category: WorkspaceCategory, relPath: string, workspaceId?: string | null) => Promise<FileStat | null>;
39
+ exists: (category: WorkspaceCategory, relPath: string, workspaceId?: string | null) => Promise<boolean>;
40
+ mkdir: (category: WorkspaceCategory, relPath: string, workspaceId?: string | null) => Promise<void>;
41
+ remove: (category: WorkspaceCategory, relPath: string, workspaceId?: string | null) => Promise<void>;
42
+ rename: (category: WorkspaceCategory, fromRel: string, toRel: string, workspaceId?: string | null) => Promise<void>;
43
+ resolve: (category: WorkspaceCategory, relPath?: string, workspaceId?: string | null) => Promise<string>;
44
+ fileUrl: (category: WorkspaceCategory, relPath?: string, workspaceId?: string | null) => Promise<string>;
45
+ relativePath: (fromCategory: WorkspaceCategory, fromRel: string, toCategory: WorkspaceCategory, toRel: string, workspaceId?: string | null) => Promise<string>;
46
+ watch: (category: WorkspaceCategory, onChange: (change: FileChange) => void, workspaceId?: string | null) => (() => void);
47
+ }
@@ -0,0 +1,25 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export interface HttpRequest {
3
+ method?: string;
4
+ headers?: Record<string, string>;
5
+ body?: string | null;
6
+ timeoutMs?: number;
7
+ maxBytes?: number;
8
+ }
9
+ export interface HttpResponse {
10
+ ok: boolean;
11
+ status: number;
12
+ statusText: string;
13
+ headers: Record<string, string>;
14
+ finalUrl: string;
15
+ body: string;
16
+ }
17
+ /**
18
+ * window.http —— 经主进程发起的任意 http(s) 请求,绕开渲染层 CORS(用于抓取 oEmbed / 链接预览等)。
19
+ * 主进程仅放行 http/https、拦截内网地址,并带超时与响应体大小上限。
20
+ */
21
+ export default class Http {
22
+ private transport;
23
+ constructor(transport?: IpcRenderer);
24
+ fetch: (url: string, request?: HttpRequest) => Promise<HttpResponse>;
25
+ }
@@ -0,0 +1,12 @@
1
+ import { ipcRenderer } from 'electron';
2
+ export declare class IpcRendererException extends Error {
3
+ code: string;
4
+ constructor(code: string, message?: string);
5
+ }
6
+ export default class IpcRenderer {
7
+ once: (...args: Parameters<typeof ipcRenderer.on>) => Promise<Electron.IpcRenderer>;
8
+ on: (...args: Parameters<typeof ipcRenderer.on>) => Promise<Electron.IpcRenderer>;
9
+ off: (...args: Parameters<typeof ipcRenderer.off>) => Promise<Electron.IpcRenderer>;
10
+ send: (...args: Parameters<typeof ipcRenderer.send>) => Promise<void>;
11
+ invoke: (...args: Parameters<typeof ipcRenderer.invoke>) => Promise<any>;
12
+ }
package/types/Kb.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export interface KbSearchHit {
3
+ path: string;
4
+ title: string;
5
+ chunk: string;
6
+ distance: number;
7
+ }
8
+ /** window.kb —— 笔记知识库语义检索(主进程用 provider embedding + sqlite-vec)。 */
9
+ export default class Kb {
10
+ private transport;
11
+ constructor(transport?: IpcRenderer);
12
+ search: (query: string, k?: number) => Promise<KbSearchHit[]>;
13
+ reindex: (force?: boolean) => Promise<{
14
+ ok: boolean;
15
+ }>;
16
+ }
@@ -0,0 +1,55 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export type MailFolderId = "inbox" | "sent" | "drafts" | "trash" | "junk" | "archive";
3
+ export interface MailAccountInput {
4
+ email: string;
5
+ displayName?: string;
6
+ authUser?: string;
7
+ password: string;
8
+ imapHost: string;
9
+ imapPort: number;
10
+ imapSecure?: boolean;
11
+ smtpHost: string;
12
+ smtpPort: number;
13
+ smtpSecure?: boolean;
14
+ }
15
+ export interface SendMailInput {
16
+ to: string;
17
+ cc?: string;
18
+ bcc?: string;
19
+ subject: string;
20
+ text?: string;
21
+ html?: string;
22
+ inReplyTo?: string;
23
+ }
24
+ /**
25
+ * window.mail —— 经主进程的 IMAP(收)/ SMTP(发)。渲染层无裸 socket,协议封在主进程。
26
+ * 账户密码经 safeStorage 加密落库;所有调用按 accountId 复用 IMAP 连接。
27
+ */
28
+ export default class Mail {
29
+ private transport;
30
+ constructor(transport?: IpcRenderer);
31
+ accounts: {
32
+ list: () => Promise<any>;
33
+ get: (id: string) => Promise<any>;
34
+ add: (input: MailAccountInput) => Promise<any>;
35
+ update: (id: string, patch: Partial<MailAccountInput>) => Promise<any>;
36
+ remove: (id: string) => Promise<any>;
37
+ test: (input: MailAccountInput) => Promise<any>;
38
+ };
39
+ folders: {
40
+ list: (accountId: string) => Promise<any>;
41
+ };
42
+ messages: {
43
+ list: (accountId: string, folder: MailFolderId, limit?: number, unseenOnly?: boolean) => Promise<any>;
44
+ read: (accountId: string, folder: MailFolderId, uid: string) => Promise<any>;
45
+ flag: (accountId: string, folder: MailFolderId, uid: string, flags: {
46
+ seen?: boolean;
47
+ flagged?: boolean;
48
+ }) => Promise<any>;
49
+ move: (accountId: string, folder: MailFolderId, uid: string, target: MailFolderId) => Promise<any>;
50
+ delete: (accountId: string, folder: MailFolderId, uid: string) => Promise<any>;
51
+ };
52
+ send: (accountId: string, input: SendMailInput) => Promise<any>;
53
+ saveDraft: (accountId: string, input: SendMailInput, draftKey?: string) => Promise<any>;
54
+ discardDraft: (accountId: string, key: string) => Promise<any>;
55
+ }
@@ -0,0 +1,32 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ import { ToolCall } from 'langchain';
3
+ export interface PluginTool {
4
+ name: string;
5
+ cb: (call: ToolCall) => Promise<string>;
6
+ description: string;
7
+ schema: string;
8
+ }
9
+ export default class Plugin {
10
+ private ipcRenderer;
11
+ private readonly onSearchHandlers;
12
+ private readonly onActionHandlers;
13
+ private readonly tools;
14
+ constructor(ipcRenderer?: IpcRenderer);
15
+ getTools: () => {
16
+ name: string;
17
+ description: string;
18
+ schema: string;
19
+ }[];
20
+ tool: (name: string, description: string, schema: string, cb: any) => any;
21
+ onSearch: (commandName: string, handler: any) => Promise<void>;
22
+ onAction: (commandName: string, action: string, handler: any) => Promise<void>;
23
+ toggleDevTools: () => Promise<any>;
24
+ setHeight: (height: number) => Promise<any>;
25
+ floating: (options?: any) => Promise<any>;
26
+ hide: () => Promise<any>;
27
+ toggleAlwaysOnTop: () => Promise<any>;
28
+ info: () => Promise<any>;
29
+ unregisterCommands: (commands: string[]) => Promise<any>;
30
+ registerCommands: (commandItems: any[]) => Promise<any>;
31
+ setCommands: (commandItems: any[]) => Promise<any>;
32
+ }
@@ -0,0 +1,10 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export default class PluginCommand {
3
+ private transport;
4
+ constructor(transport?: IpcRenderer);
5
+ open: (commandName?: string, payload?: any) => Promise<any>;
6
+ enter: (commandName?: string, payload?: any) => Promise<any>;
7
+ search: (keyword: string) => Promise<any>;
8
+ setAlias: (name: string, alias: string[]) => Promise<any>;
9
+ setEnabled: (name: string, enabled: boolean) => Promise<any>;
10
+ }
@@ -0,0 +1,12 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export default class Plugin {
3
+ private transport;
4
+ constructor(transport?: IpcRenderer);
5
+ toggleDevTools: (pluginId?: string) => Promise<any>;
6
+ closePlugin: (pluginId?: string) => Promise<any>;
7
+ getPluginInfo: (pluginId?: string) => Promise<any>;
8
+ setEnabled: () => Promise<any>;
9
+ getPlugins: () => Promise<any>;
10
+ reloadPlugin: (pluginId: string) => Promise<any>;
11
+ installPlugin: (name: string) => Promise<any>;
12
+ }
@@ -0,0 +1,9 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export default class PluginSettings {
3
+ private transport;
4
+ constructor(transport?: IpcRenderer);
5
+ getSettings: () => Promise<any>;
6
+ getSetting: (key: string) => Promise<any>;
7
+ saveSetting: (key: string, value: any) => Promise<any>;
8
+ removeSetting: (key: string) => Promise<any>;
9
+ }
@@ -0,0 +1,54 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export interface SyncStatusDto {
3
+ enabled: boolean;
4
+ configured: boolean;
5
+ transport: string | null;
6
+ loggedIn: boolean;
7
+ running: boolean;
8
+ lastSyncAt: number | null;
9
+ lastError: string | null;
10
+ pushedSeq: number;
11
+ peers: number;
12
+ /** 当前同步命名空间 = 账号 ID(消毒为路径安全),即 COS 分区目录名。用于核对多设备是否同一账号。 */
13
+ namespace: string | null;
14
+ }
15
+ export interface SyncCosConfig {
16
+ bucket: string;
17
+ region: string;
18
+ prefix?: string;
19
+ secretId?: string;
20
+ secretKey?: string;
21
+ sessionToken?: string;
22
+ }
23
+ export interface SyncConfigPatch {
24
+ enabled?: boolean;
25
+ transport?: "localdir" | "cos";
26
+ localDir?: string;
27
+ passphrase?: string;
28
+ cos?: SyncCosConfig;
29
+ }
30
+ export interface SyncAppliedPayload {
31
+ db?: boolean;
32
+ files?: boolean;
33
+ }
34
+ /**
35
+ * window.sync —— 数据库/工作空间同步的公共 API(sync.* IPC)。
36
+ * 状态变更通过 ipcRenderer 的 "sync.statusChanged" 事件推送(渲染层自行监听)。
37
+ * 同步拉到远端变更后主进程广播 "sync.applied",订阅经 onApplied(本类内部多回调分发,绕开宿主 on 的单监听)。
38
+ */
39
+ export default class Sync {
40
+ private transport;
41
+ private readonly appliedCallbacks;
42
+ private appliedBound;
43
+ constructor(transport?: IpcRenderer);
44
+ getStatus: () => Promise<SyncStatusDto>;
45
+ /** 改配置(开关 / 传输方式 / 本地目录 / 端到端口令),返回最新状态。 */
46
+ configure: (patch: SyncConfigPatch) => Promise<SyncStatusDto>;
47
+ /** 立即同步一次,返回最新状态。 */
48
+ now: () => Promise<SyncStatusDto>;
49
+ /**
50
+ * 订阅"同步已应用"(主进程拉到远端 DB/文件变更后广播)→ 据此重拉刷新。返回退订闭包。
51
+ * 多订阅者共用单条 ipcRenderer 通道(宿主 on 会 removeAllListeners,故在本实例内自行分发)。
52
+ */
53
+ onApplied: (callback: (payload: SyncAppliedPayload) => void) => (() => void);
54
+ }
@@ -0,0 +1,50 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export default class System {
3
+ private transport;
4
+ constructor(transport?: IpcRenderer);
5
+ getPlatform: () => Promise<any>;
6
+ openMainApp: () => Promise<any>;
7
+ showAbout: () => Promise<any>;
8
+ openSettings: () => Promise<any>;
9
+ checkUpdates: () => Promise<any>;
10
+ restartApp: () => Promise<any>;
11
+ quitApp: () => Promise<any>;
12
+ keepAwake: {
13
+ enable: (options?: {
14
+ reason?: string;
15
+ }) => Promise<{
16
+ active: boolean;
17
+ reason: string | null;
18
+ }>;
19
+ disable: () => Promise<{
20
+ active: boolean;
21
+ }>;
22
+ toggle: (options?: {
23
+ reason?: string;
24
+ }) => Promise<{
25
+ active: boolean;
26
+ reason?: string | null;
27
+ }>;
28
+ status: () => Promise<{
29
+ active: boolean;
30
+ reason: string | null;
31
+ }>;
32
+ };
33
+ scheduledTask: {
34
+ create: (input: {
35
+ name: string;
36
+ cron: string;
37
+ action: any;
38
+ enabled?: boolean;
39
+ timezone?: string;
40
+ }) => Promise<any>;
41
+ update: (id: string, patch: any) => Promise<any>;
42
+ delete: (id: string) => Promise<any>;
43
+ list: (filter?: {
44
+ pluginName?: string;
45
+ }) => Promise<any>;
46
+ toggle: (id: string, enabled: boolean) => Promise<any>;
47
+ runNow: (id: string) => Promise<any>;
48
+ validateCron: (expr: string) => Promise<boolean>;
49
+ };
50
+ }
@@ -0,0 +1,8 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export default class SystemAudio {
3
+ private transport;
4
+ constructor(transport?: IpcRenderer);
5
+ play: (soundName: string) => Promise<any>;
6
+ stop: () => Promise<any>;
7
+ list: () => Promise<string[]>;
8
+ }
@@ -0,0 +1,256 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export interface SystemBrowserTab {
3
+ id: number;
4
+ windowId: number;
5
+ index: number;
6
+ url?: string;
7
+ title?: string;
8
+ active: boolean;
9
+ pinned: boolean;
10
+ audible?: boolean;
11
+ mutedInfo?: {
12
+ muted: boolean;
13
+ reason?: string;
14
+ };
15
+ status?: string;
16
+ favIconUrl?: string;
17
+ incognito: boolean;
18
+ groupId?: number;
19
+ }
20
+ export interface SystemBrowserCookie {
21
+ name: string;
22
+ value: string;
23
+ domain: string;
24
+ path: string;
25
+ secure: boolean;
26
+ httpOnly: boolean;
27
+ sameSite?: string;
28
+ session: boolean;
29
+ expirationDate?: number;
30
+ storeId?: string;
31
+ hostOnly?: boolean;
32
+ }
33
+ export interface SystemBrowserBookmark {
34
+ id: string;
35
+ parentId?: string;
36
+ index?: number;
37
+ title: string;
38
+ url?: string;
39
+ dateAdded?: number;
40
+ dateGroupModified?: number;
41
+ children?: SystemBrowserBookmark[];
42
+ }
43
+ export interface SystemBrowserHttpResponse {
44
+ status: number;
45
+ statusText: string;
46
+ ok: boolean;
47
+ url: string;
48
+ redirected: boolean;
49
+ headers: Record<string, string>;
50
+ body: string;
51
+ }
52
+ export type SystemBrowserKind = "chrome" | "edge" | "unknown";
53
+ export type SystemBrowserEventName = "browser.tab.created" | "browser.tab.updated" | "browser.tab.removed" | "browser.tab.activated" | "browser.bookmark.created" | "browser.bookmark.changed" | "browser.bookmark.removed" | "browser.bookmark.moved" | "browser.bridge.hello" | "browser.bridge.status";
54
+ export interface SystemBrowserEventEnvelope<T = any> {
55
+ event: SystemBrowserEventName | string;
56
+ payload: T;
57
+ ts: number;
58
+ }
59
+ /**
60
+ * 暴露给所有 renderer(含 plugin view)的浏览器桥接 API。
61
+ *
62
+ * 设计原则:
63
+ * - 命名跟 main 侧 IPC 通道一一对应,零运行时翻译,方便排查
64
+ * - on/off 监听器走 ipcRenderer 直连而不是 mitt eventBus,因为 plugin view
65
+ * 的 preload 都是同一份 contextBridge,每个 view 自己监听自己想要的事件
66
+ */
67
+ export default class SystemBrowser {
68
+ private transport;
69
+ constructor(transport?: IpcRenderer);
70
+ bridge: {
71
+ status: () => Promise<{
72
+ connected: boolean;
73
+ clients: number;
74
+ browsers: SystemBrowserKind[];
75
+ }>;
76
+ ping: () => Promise<{
77
+ pong: boolean;
78
+ ts: number;
79
+ }>;
80
+ };
81
+ tabs: {
82
+ list: (query?: chrome.tabs.QueryInfo & {
83
+ browser?: SystemBrowserKind;
84
+ }) => Promise<{
85
+ tabs: SystemBrowserTab[];
86
+ }>;
87
+ get: (tabId: number) => Promise<{
88
+ tab: SystemBrowserTab;
89
+ }>;
90
+ create: (params: {
91
+ url?: string;
92
+ active?: boolean;
93
+ windowId?: number;
94
+ pinned?: boolean;
95
+ }) => Promise<{
96
+ tab: SystemBrowserTab;
97
+ }>;
98
+ update: (params: {
99
+ tabId: number;
100
+ url?: string;
101
+ active?: boolean;
102
+ pinned?: boolean;
103
+ muted?: boolean;
104
+ }) => Promise<{
105
+ tab: SystemBrowserTab;
106
+ }>;
107
+ remove: (params: {
108
+ tabId?: number;
109
+ tabIds?: number[];
110
+ }) => Promise<{
111
+ removed: number[];
112
+ }>;
113
+ activate: (tabId: number) => Promise<{
114
+ tab: SystemBrowserTab;
115
+ }>;
116
+ reload: (params: {
117
+ tabId: number;
118
+ bypassCache?: boolean;
119
+ }) => Promise<void>;
120
+ duplicate: (tabId: number) => Promise<{
121
+ tab: SystemBrowserTab | null;
122
+ }>;
123
+ move: (params: {
124
+ tabId: number;
125
+ index: number;
126
+ windowId?: number;
127
+ }) => Promise<{
128
+ tab: SystemBrowserTab;
129
+ }>;
130
+ };
131
+ scripting: {
132
+ eval: (params: {
133
+ tabId: number;
134
+ expression: string;
135
+ world?: "MAIN" | "ISOLATED";
136
+ allFrames?: boolean;
137
+ }) => Promise<any>;
138
+ execute: (params: {
139
+ tabId: number;
140
+ code: string;
141
+ world?: "MAIN" | "ISOLATED";
142
+ allFrames?: boolean;
143
+ args?: any[];
144
+ }) => Promise<any>;
145
+ insertCSS: (params: {
146
+ tabId: number;
147
+ css: string;
148
+ allFrames?: boolean;
149
+ }) => Promise<void>;
150
+ removeCSS: (params: {
151
+ tabId: number;
152
+ css: string;
153
+ allFrames?: boolean;
154
+ }) => Promise<void>;
155
+ };
156
+ page: {
157
+ text: (params: {
158
+ tabId: number;
159
+ selector?: string;
160
+ allFrames?: boolean;
161
+ }) => Promise<any>;
162
+ click: (params: {
163
+ tabId: number;
164
+ selector: string;
165
+ allFrames?: boolean;
166
+ }) => Promise<any>;
167
+ fill: (params: {
168
+ tabId: number;
169
+ selector: string;
170
+ value: string;
171
+ allFrames?: boolean;
172
+ }) => Promise<any>;
173
+ };
174
+ cookies: {
175
+ get: (params: {
176
+ url: string;
177
+ name: string;
178
+ }) => Promise<{
179
+ cookie: SystemBrowserCookie | null;
180
+ }>;
181
+ getAll: (params?: {
182
+ url?: string;
183
+ domain?: string;
184
+ name?: string;
185
+ }) => Promise<{
186
+ cookies: SystemBrowserCookie[];
187
+ }>;
188
+ };
189
+ http: {
190
+ fetch: (params: {
191
+ url: string;
192
+ method?: string;
193
+ headers?: Record<string, string>;
194
+ body?: string | object | null;
195
+ credentials?: "include" | "same-origin" | "omit";
196
+ timeoutMs?: number;
197
+ }) => Promise<SystemBrowserHttpResponse>;
198
+ };
199
+ bookmarks: {
200
+ tree: (params?: {
201
+ browser?: SystemBrowserKind;
202
+ }) => Promise<{
203
+ tree: SystemBrowserBookmark[];
204
+ }>;
205
+ list: (params?: {
206
+ parentId?: string;
207
+ browser?: SystemBrowserKind;
208
+ }) => Promise<{
209
+ items: SystemBrowserBookmark[];
210
+ }>;
211
+ get: (id: string) => Promise<{
212
+ item: SystemBrowserBookmark | null;
213
+ }>;
214
+ search: (query: string | {
215
+ query?: string;
216
+ url?: string;
217
+ title?: string;
218
+ browser?: SystemBrowserKind;
219
+ }) => Promise<{
220
+ items: SystemBrowserBookmark[];
221
+ }>;
222
+ create: (params: {
223
+ parentId?: string;
224
+ title?: string;
225
+ url?: string;
226
+ index?: number;
227
+ }) => Promise<{
228
+ item: SystemBrowserBookmark;
229
+ }>;
230
+ update: (params: {
231
+ id: string;
232
+ title?: string;
233
+ url?: string;
234
+ }) => Promise<{
235
+ item: SystemBrowserBookmark;
236
+ }>;
237
+ move: (params: {
238
+ id: string;
239
+ parentId?: string;
240
+ index?: number;
241
+ }) => Promise<{
242
+ item: SystemBrowserBookmark;
243
+ }>;
244
+ remove: (id: string) => Promise<void>;
245
+ removeTree: (id: string) => Promise<void>;
246
+ };
247
+ /**
248
+ * 订阅扩展事件(tab/bookmark 生命周期 + 桥接连接状态)。返回反订阅函数。
249
+ *
250
+ * const off = window.systemBrowser.events.on("browser.tab.updated", (e) => {...});
251
+ * off();
252
+ */
253
+ events: {
254
+ on: <T = any>(event: SystemBrowserEventName | "*", handler: (envelope: SystemBrowserEventEnvelope<T>) => void) => (() => void);
255
+ };
256
+ }
@@ -0,0 +1,8 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export default class SystemClipboard {
3
+ private transport;
4
+ constructor(transport?: IpcRenderer);
5
+ read: () => Promise<any>;
6
+ write: (content: any) => Promise<any>;
7
+ clear: () => Promise<any>;
8
+ }
@@ -0,0 +1,7 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export default class SystemKeyboard {
3
+ private transport;
4
+ constructor(transport?: IpcRenderer);
5
+ type: (text: string) => Promise<any>;
6
+ copy: () => Promise<any>;
7
+ }
@@ -0,0 +1,13 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ import { Point } from '@computer-use/nut-js';
3
+ export default class SystemMouse {
4
+ private transport;
5
+ constructor(transport?: IpcRenderer);
6
+ clickText: (text: string) => Promise<any>;
7
+ click: (base64String: string) => Promise<any>;
8
+ clickAt: (point: Point) => Promise<any>;
9
+ move: (base64String: string) => Promise<any>;
10
+ moveTo: (point: Point) => Promise<any>;
11
+ doubleClickAt: (point: Point) => Promise<any>;
12
+ rightClickAt: (point: Point) => Promise<any>;
13
+ }
@@ -0,0 +1,18 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export interface SystemNotificationOptions {
3
+ title: string;
4
+ body?: string;
5
+ /** 不播放系统提示音 */
6
+ silent?: boolean;
7
+ /** 副标题,仅 macOS 生效 */
8
+ subtitle?: string;
9
+ }
10
+ export default class SystemNotification {
11
+ private transport;
12
+ constructor(transport?: IpcRenderer);
13
+ isSupported: () => Promise<boolean>;
14
+ show: (options: SystemNotificationOptions) => Promise<string | null>;
15
+ close: (id: string) => Promise<boolean>;
16
+ onClicked: (handler: (id: string) => void) => Promise<Electron.IpcRenderer>;
17
+ onClosed: (handler: (id: string) => void) => Promise<Electron.IpcRenderer>;
18
+ }
@@ -0,0 +1,6 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export default class SystemOCR {
3
+ private transport;
4
+ constructor(transport?: IpcRenderer);
5
+ recognize: (base64String: string) => Promise<any>;
6
+ }
@@ -0,0 +1,14 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ import { Point } from '@computer-use/nut-js';
3
+ export default class SystemScreen {
4
+ private transport;
5
+ constructor(transport?: IpcRenderer);
6
+ captureScene: () => Promise<any>;
7
+ captureDisplay: (displayId?: number) => Promise<any>;
8
+ listDisplays: () => Promise<any>;
9
+ getCursorPoint: () => Promise<any>;
10
+ find: (base64String: string) => Promise<any>;
11
+ waitFor: (base64String: any) => Promise<any>;
12
+ waitForText: (text: string) => Promise<any>;
13
+ colorAt: (point: Point) => Promise<any>;
14
+ }
@@ -0,0 +1,11 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export default class SystemSetting {
3
+ private transport;
4
+ constructor(transport?: IpcRenderer);
5
+ getSettings: () => Promise<any>;
6
+ getSettingValue: (key: string) => Promise<any>;
7
+ saveSettings: (values: {
8
+ [x: string]: any;
9
+ }) => Promise<any>;
10
+ saveSetting: (settingInput: any) => Promise<any>;
11
+ }
@@ -0,0 +1,18 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export default class SystemShell {
3
+ private transport;
4
+ constructor(transport?: IpcRenderer);
5
+ openExternal: (url: string, options?: Electron.OpenExternalOptions) => Promise<any>;
6
+ openPath: (path: string) => Promise<any>;
7
+ /** 在资源管理器/Finder 中显示并选中该文件(或文件夹) */
8
+ showItemInFolder: (path: string) => Promise<any>;
9
+ openTerminal: (options?: {
10
+ command?: string;
11
+ cwd?: string;
12
+ }) => Promise<any>;
13
+ listTerminals: () => Promise<Array<{
14
+ id: string;
15
+ label: string;
16
+ available: boolean;
17
+ }>>;
18
+ }
@@ -0,0 +1,8 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export default class SystemShortcut {
3
+ private transport;
4
+ constructor(transport?: IpcRenderer);
5
+ getShortcuts: () => Promise<any>;
6
+ removeShortcut: (commandName: string) => Promise<any>;
7
+ setShortcut: (name: string, shortcut?: string) => Promise<any>;
8
+ }
@@ -0,0 +1,15 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export default class SystemWindow {
3
+ private transport;
4
+ constructor(transport?: IpcRenderer);
5
+ toast: (type: "info" | "success" | "warn" | "error", text: string) => Promise<any>;
6
+ hide: () => Promise<any>;
7
+ setHeight: (height: number) => Promise<any>;
8
+ goHome: () => Promise<any>;
9
+ open: (url: string, options?: any) => Promise<any>;
10
+ showOpenDialog: (options?: Electron.OpenDialogOptions) => Promise<any>;
11
+ saveText: (content: string, options?: {
12
+ defaultName?: string;
13
+ filters?: Electron.FileFilter[];
14
+ }) => Promise<string | null>;
15
+ }
@@ -0,0 +1,51 @@
1
+ import { default as IpcRenderer } from './IpcRenderer';
2
+ export interface WorkspaceDto {
3
+ id: string;
4
+ name: string;
5
+ path: string;
6
+ kind: "local" | "cloud";
7
+ state: "active" | "indexing" | "stale" | "disabled";
8
+ isDefault: boolean;
9
+ includeGlobs?: string[] | null;
10
+ excludeGlobs?: string[] | null;
11
+ indexFlags: {
12
+ filename: boolean;
13
+ content: boolean;
14
+ };
15
+ embedModel?: string | null;
16
+ lastIndexedAt?: string | null;
17
+ lastOpenedAt?: string | null;
18
+ openedCount: number;
19
+ created_at: string;
20
+ updated_at: string;
21
+ }
22
+ export interface RegisterWorkspaceInputDto {
23
+ name?: string;
24
+ path: string;
25
+ includeGlobs?: string[];
26
+ excludeGlobs?: string[];
27
+ indexFlags?: Partial<{
28
+ filename: boolean;
29
+ content: boolean;
30
+ }>;
31
+ }
32
+ /**
33
+ * window.workspace —— 宿主级工作空间公共 API(workspace.* IPC)。
34
+ * 所有插件(settings 面板 / copilot 反射 / 主搜索框)统一经此消费,不自持注册表。
35
+ */
36
+ export default class Workspace {
37
+ private transport;
38
+ constructor(transport?: IpcRenderer);
39
+ list: () => Promise<WorkspaceDto[]>;
40
+ get: (id: string) => Promise<WorkspaceDto | null>;
41
+ register: (input: RegisterWorkspaceInputDto) => Promise<WorkspaceDto>;
42
+ update: (id: string, patch: Partial<WorkspaceDto>) => Promise<WorkspaceDto | null>;
43
+ /** 目录被移动/改名后重定位:只换路径,索引数据原封不动。 */
44
+ relocate: (id: string, newPath: string) => Promise<WorkspaceDto | null>;
45
+ /** 暂停(false)/恢复(true)。暂停只停监听,索引与配置保留。 */
46
+ toggle: (id: string, enabled: boolean) => Promise<WorkspaceDto | null>;
47
+ /** 注销(不删文件)。默认工作空间不可删除。 */
48
+ remove: (id: string) => Promise<boolean>;
49
+ /** 使用打点(recents 排序)。 */
50
+ touch: (id: string) => Promise<void>;
51
+ }
@@ -0,0 +1,67 @@
1
+ import { default as Account } from './Account';
2
+ import { default as Copilot } from './Copilot';
3
+ import { default as CopilotSubAgent } from './CopilotSubAgent';
4
+ import { default as CopilotMcpServer } from './CopilotMcpServer';
5
+ import { default as CopilotModel } from './CopilotModel';
6
+ import { default as CopilotThread } from './CopilotThread';
7
+ import { default as Plugin } from './Plugin';
8
+ import { default as PluginCommand } from './PluginCommand';
9
+ import { default as PluginSettings } from './PluginSettings';
10
+ import { default as System } from './System';
11
+ import { default as SystemAudio } from './SystemAudio';
12
+ import { default as SystemClipboard } from './SystemClipboard';
13
+ import { default as SystemKeyboard } from './SystemKeyboard';
14
+ import { default as SystemMouse } from './SystemMouse';
15
+ import { default as SystemOCR } from './SystemOCR';
16
+ import { default as SystemSetting } from './SystemSetting';
17
+ import { default as SystemShell } from './SystemShell';
18
+ import { default as SystemBrowser } from './SystemBrowser';
19
+ import { default as SystemShortcut } from './SystemShortcut';
20
+ import { default as SystemWindow } from './SystemWindow';
21
+ import { default as CopilotWechatBridge } from './CopilotWechatBridge';
22
+ import { default as Workspace } from './Workspace';
23
+ import { default as File } from './File';
24
+ import { default as Http } from './Http';
25
+ import { default as Kb } from './Kb';
26
+ import { default as Mail } from './Mail';
27
+ import { default as Sync } from './Sync';
28
+ import { default as SystemNotification } from './SystemNotification';
29
+ import { default as IpcRenderer } from './IpcRenderer';
30
+ declare global {
31
+ interface Window {
32
+ ipcRenderer: IpcRenderer;
33
+ eventBus: {
34
+ on(event: string, handler: (data: unknown) => void): () => void;
35
+ off(event: string, handler: (data: unknown) => void): void;
36
+ emit(event: string, data: unknown): void;
37
+ };
38
+ account: Account;
39
+ copilot: Copilot;
40
+ copilotSubagent: CopilotSubAgent;
41
+ copilotMcpServer: CopilotMcpServer;
42
+ copilotModel: CopilotModel;
43
+ copilotThread: CopilotThread;
44
+ plugin: Plugin;
45
+ pluginCommand: PluginCommand;
46
+ pluginSettings: PluginSettings;
47
+ system: System;
48
+ systemAudio: SystemAudio;
49
+ systemClipboard: SystemClipboard;
50
+ systemKeyboard: SystemKeyboard;
51
+ systemMouse: SystemMouse;
52
+ systemOCR: SystemOCR;
53
+ systemSetting: SystemSetting;
54
+ systemShell: SystemShell;
55
+ systemBrowser: SystemBrowser;
56
+ systemShortcut: SystemShortcut;
57
+ systemWindow: SystemWindow;
58
+ systemNotification: SystemNotification;
59
+ copilotWechatBridge: CopilotWechatBridge;
60
+ workspace: Workspace;
61
+ file: File;
62
+ http: Http;
63
+ kb: Kb;
64
+ mail: Mail;
65
+ sync: Sync;
66
+ }
67
+ }
File without changes