@solazah/solazah-runtime 0.2.37 → 0.2.39

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solazah/solazah-runtime",
3
- "version": "0.2.37",
3
+ "version": "0.2.39",
4
4
  "main": "index.cjs",
5
5
  "module": "index.js",
6
6
  "types": "types/index.d.ts",
@@ -72,6 +72,8 @@ export type CopilotInputImage = {
72
72
  /** 待投递给主 agent 的一条内容:notice = 后台任务完成通知,interject = 用户在生成途中插的话。 */
73
73
  export interface CopilotPendingInjection {
74
74
  kind: "notice" | "interject";
75
+ /** 通知的执行端 subAgentType;插话不带。 */
76
+ source?: string;
75
77
  /** 注入时用作消息 id(落库切片按 id 去重),同时是撤回的凭据。 */
76
78
  id: string;
77
79
  /** 投给模型看的整段文案。两条投递路径共用同一份,保证模型在轮中和轮间看到的内容一致。 */
package/types/Mail.d.ts CHANGED
@@ -19,7 +19,10 @@ export interface SendMailInput {
19
19
  subject: string;
20
20
  text?: string;
21
21
  html?: string;
22
+ /** 回复时填原信的 Message-ID。 */
22
23
  inReplyTo?: string;
24
+ /** 回复时填原信的 References 链 + 原信 Message-ID,收件方据此归到同一会话。 */
25
+ references?: string[];
23
26
  }
24
27
  /**
25
28
  * window.mail —— 经主进程的 IMAP(收)/ SMTP(发)。渲染层无裸 socket,协议封在主进程。
@@ -101,12 +104,23 @@ export default class Mail {
101
104
  */
102
105
  list: (accountId: string, folder: MailFolderId, limit?: number, unseenOnly?: boolean) => Promise<any>;
103
106
  /**
104
- * 读取单封邮件的完整正文(text/html、收发人、附件元信息)。
107
+ * 在服务器端搜索一个文件夹:主题 / 发件人 / 收件人 / 正文任一包含关键词即命中,整个文件夹都搜。
108
+ *
109
+ * @param accountId 账户唯一标识。
110
+ * @param folder 逻辑文件夹:`inbox` / `sent` / `drafts` / `trash` / `junk` / `archive`。
111
+ * @param query 关键词;空串返回空数组。
112
+ * @param limit 返回条数上限,缺省 20,取最新的那几封。
113
+ * @returns 命中的邮件头列表(MailHeaderDto[]),最新在前。
114
+ * @throws 账户不存在报 MAIL_ACCOUNT_NOT_FOUND(404)。
115
+ */
116
+ search: (accountId: string, folder: MailFolderId, query: string, limit?: number) => Promise<any>;
117
+ /**
118
+ * 读取单封邮件的完整正文(text/html、收发人、附件元信息)。不改变已读状态,标已读用 flag。
105
119
  *
106
120
  * @param accountId 账户唯一标识。
107
121
  * @param folder 邮件所在逻辑文件夹。
108
122
  * @param uid 邮件唯一标识(IMAP UID)。
109
- * @returns 邮件完整正文(MailBodyDto),含 text / html / 收发人 / 附件元信息。
123
+ * @returns 邮件完整正文(MailBodyDto),含 text / html / 收发人 / Reply-To / Message-ID 与 References / 附件元信息。
110
124
  * @throws 账户不存在或 uid 无对应邮件时抛错。
111
125
  */
112
126
  read: (accountId: string, folder: MailFolderId, uid: string) => Promise<any>;
@@ -151,8 +165,8 @@ export default class Mail {
151
165
  * 投递成功后会尽力把副本追加到「已发送」文件夹(追加失败不影响发信结果)。
152
166
  *
153
167
  * @param accountId 账户唯一标识。
154
- * @param input 发信参数:to / subject 必填,cc / bcc / text / html / inReplyTo 可选。
155
- * @returns 发送结果,含 `messageId`(SMTP 返回的 message-id)。
168
+ * @param input 发信参数:to / subject 必填,cc / bcc / text / html / inReplyTo / references 可选。
169
+ * @returns 发送结果:`messageId`(SMTP 返回的 message-id)与 `appendedToSent`(false 表示已发出但没能存进「已发送」)。
156
170
  * @throws 账户不存在或 SMTP 投递失败时抛错。
157
171
  */
158
172
  send: (accountId: string, input: SendMailInput) => Promise<any>;
package/types/System.d.ts CHANGED
@@ -8,6 +8,18 @@ export default class System {
8
8
  /** Solazah 在用户家目录下的**本渠道**根目录绝对路径(机器级:日志、缓存、运行时;账号的东西在 accounts/<账号>/ 下)。
9
9
  * @returns 形如 `C:\Users\<用户>\.solazah` 的绝对路径 */
10
10
  getSolazahHome: () => Promise<string>;
11
+ /** 当前用户常用目录的绝对路径,取自操作系统登记的位置(已跟随 OneDrive 等重定向)。
12
+ * 自己拼「家目录 + Desktop」在桌面被重定向时会指错地方,要用这里的值。
13
+ * @returns `{home, desktop, downloads, documents, pictures, music, videos}`,各为绝对路径;系统没登记的那一项为 null */
14
+ getUserFolders: () => Promise<{
15
+ home: string | null;
16
+ desktop: string | null;
17
+ downloads: string | null;
18
+ documents: string | null;
19
+ pictures: string | null;
20
+ music: string | null;
21
+ videos: string | null;
22
+ }>;
11
23
  /** 显示并聚焦 Solazah 主窗口(搜索框);主窗口不存在时不做任何事。
12
24
  * @returns 无返回 */
13
25
  openMainApp: () => Promise<any>;
@@ -5,7 +5,7 @@ export default class SystemAudio {
5
5
  /**
6
6
  * 播放内置音效目录下的指定音频文件。
7
7
  * 同一时刻只能播放一个音效,新播放会自动中断当前正在播放的音效。
8
- * macOS 上通过系统 afplay 子进程播放,其余平台通过原生 addon 播放。
8
+ * 通过原生 addon 播放:Windows PlaySound / macOS NSSound。
9
9
  *
10
10
  * @param soundName 音效文件名,不含扩展名时自动补 `.wav`。
11
11
  * @returns 无返回值(播放是异步副作用)。
@@ -14,7 +14,7 @@ export default class SystemAudio {
14
14
  play: (soundName: string) => Promise<any>;
15
15
  /**
16
16
  * 停止当前正在播放的音效。
17
- * macOS 上终止 afplay 子进程,其余平台通过原生 addon 停止。
17
+ * 停止当前由原生 addon 播放的音效。
18
18
  * 若无音效在播则不执行任何操作。
19
19
  *
20
20
  * @returns 无返回值。
@@ -1,5 +1,8 @@
1
1
  import { default as IpcRenderer } from './IpcRenderer';
2
- import { Point } from '@computer-use/nut-js';
2
+ export interface Point {
3
+ x: number;
4
+ y: number;
5
+ }
3
6
  export default class SystemMouse {
4
7
  private transport;
5
8
  constructor(transport?: IpcRenderer);
@@ -1,5 +1,8 @@
1
1
  import { default as IpcRenderer } from './IpcRenderer';
2
- import { Point } from '@computer-use/nut-js';
2
+ export interface Point {
3
+ x: number;
4
+ y: number;
5
+ }
3
6
  /** 原始位图:BGRA、自顶向下、每像素 4 字节,与截图流 raw 帧同一格式。手里已经是像素时直接给它,省掉编码与解码。 */
4
7
  export interface RawImage {
5
8
  width: number;
@@ -42,6 +42,14 @@ export default class Workspace {
42
42
  * @returns 工作空间数组,每项的 path 已被覆写为本机有效路径(本地覆盖优先于同步值)。空列表表示尚无工作空间。
43
43
  */
44
44
  list: () => Promise<WorkspaceDto[]>;
45
+ /**
46
+ * 宿主默认的排除规则(敏感文件 + 大型生成目录),注册工作空间不指定 excludeGlobs 时用的就是它。
47
+ * 插件扫描工作空间以外的目录时用这一份,不要自带名单;匹配语义:以 `/` 结尾的匹配任一层目录名,
48
+ * 其余按简化 glob(`*` 不跨目录、`**` 跨目录、`?` 单字符)匹配相对路径或文件名。
49
+ *
50
+ * @returns glob 数组。
51
+ */
52
+ defaultExcludeGlobs: () => Promise<string[]>;
45
53
  /**
46
54
  * 按 id 获取单个工作空间。
47
55
  *