@solazah/solazah-runtime 0.2.36 → 0.2.38

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.36",
3
+ "version": "0.2.38",
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;
@@ -151,6 +154,54 @@ export type BlobSource = string | {
151
154
  region?: ScreenRect;
152
155
  image?: string;
153
156
  };
157
+ /** findFlicker 的参数:在哪块截、截多久、多快,以及闪光判据。坐标都是显示器物理像素、相对显示器左上角。 */
158
+ export interface FlickerOptions {
159
+ /** 目标显示器 id;省略取光标所在显示器 */
160
+ displayId?: number;
161
+ /** 只看这一块;省略整屏。聊天框这类会滚字的界面要排除在外 */
162
+ region?: ScreenRect;
163
+ /** 连截多久,缺省 4000 */
164
+ durationMs?: number;
165
+ /** 每秒截几帧,1..30,缺省 4 */
166
+ fps?: number;
167
+ /** 和前后各几帧比,缺省 4 */
168
+ halfWindow?: number;
169
+ /** 亮度要比前后帧的中位数高出多少才算闪,0..255,缺省 45 */
170
+ lift?: number;
171
+ /** 闪光像素的最低亮度(三通道最大值),缺省 140 */
172
+ minValue?: number;
173
+ /** 闪光的色相范围(角度),缺省 45..85,即偏黄绿的星光 */
174
+ hueLow?: number;
175
+ hueHigh?: number;
176
+ /** 闪光的最低饱和度 0..1,缺省 0.25 */
177
+ minSaturation?: number;
178
+ /** 一个光点的像素数范围,缺省 4..40 */
179
+ minSize?: number;
180
+ maxSize?: number;
181
+ /** 同一帧里多近的闪光像素合成一个光点,缺省 6 */
182
+ groupRadius?: number;
183
+ /** 多近的光点算同一处,缺省 50 */
184
+ clusterRadius?: number;
185
+ /** 最多返回几处,缺省 10 */
186
+ maxResults?: number;
187
+ /** 取消记号,同 WaitOptions.token */
188
+ token?: string;
189
+ }
190
+ /** 反复冒光点的一处:中心(屏幕物理像素)、冒过光点的帧数、光点总数。 */
191
+ export interface FlickerCluster {
192
+ x: number;
193
+ y: number;
194
+ frames: number;
195
+ spots: number;
196
+ }
197
+ /** 按冒过光点的帧数降序;unstableFrames 是画面整体在动、被跳过的帧数。 */
198
+ export interface FlickerResult {
199
+ clusters: FlickerCluster[];
200
+ frames: number;
201
+ unstableFrames: number;
202
+ durationMs: number;
203
+ cancelled: boolean;
204
+ }
154
205
  export interface RecordStartOptions {
155
206
  /** 目标显示器 id;省略取光标所在显示器 */
156
207
  displayId?: number;
@@ -476,6 +527,14 @@ export default class SystemScreen {
476
527
  * @returns `[{x, y, width, height, area, cx, cy}]`;给图片时坐标相对图片左上角,截屏时是屏幕物理像素坐标。找不到是空数组。
477
528
  */
478
529
  findBlobs: (source: BlobSource, options: ColorBlobOptions) => Promise<ColorBlob[]>;
530
+ /**
531
+ * 闪烁光点:在显示器的一块区域上连截一段,找反复冒小光点的地方——游戏里可采集物冒出的星光、界面上闪的提示点。
532
+ * 静止的东西每帧一样亮,只有闪的才比前后帧亮出来;同一处反复冒光点的排在前面。截帧期间视角要保持不动。
533
+ *
534
+ * @param options `{displayId?, region?, durationMs?, fps?, hueLow?, hueHigh?, …, token?}`,见 FlickerOptions。
535
+ * @returns `{clusters: [{x, y, frames, spots}], frames, unstableFrames, durationMs, cancelled}`,坐标是屏幕物理像素;找不到 clusters 为空。
536
+ */
537
+ findFlicker: (options?: FlickerOptions) => Promise<FlickerResult>;
479
538
  /**
480
539
  * 屏幕录制:采集与编码全在宿主的原生线程(mac ScreenCaptureKit + VideoToolbox 硬件 H.264,Windows WGC + Media Foundation),
481
540
  * mp4 或 gif 直接写到给定路径,页面不经手任何帧。同一时刻只有一个会话;本视图销毁、到了 maxSeconds 都会自动停。
@@ -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
  *