@mearl/native-host 3.0.0-beta.3 → 3.0.0-beta.5

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 CHANGED
@@ -158,7 +158,7 @@ try {
158
158
 
159
159
  `capabilities` 返回 Provider 实际支持的 mode、permissions、结构化输出、流式和取消能力。当前 Codex 只提供显式 `{ provider: 'codex', mode: 'agent', permissions: 'read-only' }`,每次使用临时 app-server 会话,禁用已配置的 MCP、Apps、搜索、插件和相关扩展功能,沙箱禁止写入和网络;人工请求直接失败。它仍有只读 Agent 的本机读取能力,不能承诺完全不调用工具,因此 `mode: 'generate'` 明确拒绝,绝不降级。交互侧边栏保持独立会话生命周期。
160
160
 
161
- 请求最多 256 KiB;`outputSchema` 最多 64 KiB,通过 [Codex app-server](https://developers.openai.com/codex/app-server/) 的 `turn/start` 传递。宿主只接受成功 turn 的原始最终消息,并独立解析 JSON、校验 schema,再生成成功任务;Provider 的 willRetry 错误不提前结束执行,终态错误保留具体原因及稳定错误码。`model.delta` 是可缺失的诊断进度,不能拼接成最终结果。最终文本上限 32 MiB,结构化返回 `{ text, output?, provider, mode, model? }`,模型额外业务约束仍由插件校验。
161
+ 请求最多 256 KiB;`outputSchema` 最多 64 KiB,通过 [Codex app-server](https://developers.openai.com/codex/app-server/) 的 `turn/start` 传递。宿主只接受成功 turn 的原始最终消息,并解析 JSON,再生成成功任务;outputSchema 的约束交给模型 Provider,插件负责验证最终数据结构和业务约束;Provider 的 willRetry 错误不提前结束执行,终态错误保留具体原因及稳定错误码。`model.delta` 是可缺失的诊断进度,不能拼接成最终结果。最终文本上限 32 MiB,结构化返回 `{ text, output?, provider, mode, model? }`,模型额外业务约束仍由插件校验。
162
162
 
163
163
  SDK 使用 `PluginModelClient.capabilities/list/start/run`。工具箱使用 `host.model.capabilities/list/start` 和 `waitTask`。`PluginModelClient.run` 的 signal 会取消执行并等待清理,语义与仅停止观察的任务 `wait` 不同。
164
164
 
@@ -185,7 +185,7 @@ export default app => {
185
185
  };
186
186
  ```
187
187
 
188
- `context.checkpoint(data, expectedSequence)` 仅在 service 路由、未绑定页面实例的活动受管理公开命令中可用;子任务可记录检查点,显式恢复仍只接受合格根任务。负载最多 64 KiB,宿主按声明 schema 校验,分配递增检查点序号。数据、版本、宿主计算的 canonical schemaHash、任务快照和 checkpoint 事件写入同一个原子任务记录;并发过期写入明确冲突。检查点不是外部操作的完成证明,与插件 state 事务也不共享提交。外部提交与检查点之间的故障窗口由恢复入口查询操作状态或使用稳定幂等键处理。
188
+ `context.checkpoint(data, expectedSequence)` 仅在 service 路由、未绑定页面实例的活动受管理公开命令中可用;子任务可记录检查点,显式恢复仍只接受合格根任务。负载最多 64 KiB,宿主检查 JSON 和 CAS 序号,分配递增检查点序号;schema 是格式描述与版本身份,插件负责验证检查点数据。数据、版本、宿主计算的 canonical schemaHash、任务快照和 checkpoint 事件写入同一个原子任务记录;并发过期写入明确冲突。检查点不是外部操作的完成证明,与插件 state 事务也不共享提交。外部提交与检查点之间的故障窗口由恢复入口查询操作状态或使用稳定幂等键处理。
189
189
 
190
190
  SDK 使用 `PluginTaskClient.checkpoint(taskId)` / `resume(taskId, { environment?, revision? })`。resume 只接受失败、取消或中断的根命令,创建新的 taskId 和执行代次,记录 `resumedFrom`,原任务保持终态;相同来源任务只有一个直接后继,重复请求返回已有 attempt,配置不同则冲突。继续恢复失败的新 attempt 时,对新 taskId 调用 resume。
191
191
 
@@ -207,7 +207,7 @@ export default app => {
207
207
  };
208
208
  ```
209
209
 
210
- migrateFrom 最多 16 个不同的旧版本(均低于目标版本),历史 schema 必须与检查点写入时记录的宿主 hash 及保留代码声明一致。即使源码没变,依赖环境等动态声明发生格式漂移也拒绝恢复。迁移和恢复进程调用隐藏 handler 前再次比较目标声明签名,普通 checkpoint 写入也校验执行端声明;Python 每次 run 的 ready ACK 前核对完整加载元数据。迁移返回新检查点的数据,宿主校验 JSON、64 KiB 限制和目标 schema,再将新数据及来源元信息原子写入唯一后继任务;旧任务和检查点不变。没有迁移声明、格式不匹配、转换失败或清理未确认均不接纳新任务。
210
+ migrateFrom 最多 16 个不同的旧版本(均低于目标版本),历史 schema 必须与检查点写入时记录的宿主 hash 及保留代码声明一致。即使源码没变,依赖环境等动态声明发生格式漂移也拒绝恢复。迁移和恢复进程调用隐藏 handler 前再次比较目标声明签名,普通 checkpoint 写入也校验执行端声明;Python 每次 run 的 ready ACK 前核对完整加载元数据。迁移返回新检查点的数据,宿主校验 JSON、64 KiB 限制和目标声明身份,再将新数据及来源元信息原子写入唯一后继任务;旧任务和检查点不变。没有迁移声明、格式不匹配、转换失败或清理未确认均不接纳新任务。
211
211
 
212
212
  同一源任务的并发恢复按 revision 选择与环境指纹合并,不同意图冲突;已提交后继的重试先核验请求指纹,不重复转换。迁移在独立受管理进程执行,10 秒期限,与声明解析共享最多 8 个进程预算,无等待队列,服务关闭会取消并等待清理。转换和原执行树均确认停止,且安装和双端代码快照再次核验后才接纳新任务。迁移没有宿主 API、模型、state、页面或嵌套插件调用权限;JS/Python 仍是可信本机代码,具备直接文件和网络访问能力,不构成 OS 沙箱。迁移必须是可重复的纯 JSON 转换:提交前崩溃可能再次执行,不承诺转换恰好执行一次。
213
213
 
@@ -258,7 +258,7 @@ export default app => {
258
258
 
259
259
  页面函数的 `host.emit(name, payload)` 返回接收确认;处理结果通过实例事件查询。`context.page.send/get` 始终绑定当前实例,运行时任务的普通页面动作和复合页面入口被拒绝。每次出队、宿主调用和提交结果都重新检查文档。运行时传输保留控制会话归属、暂停与释放检查,并行处理消息和回调;消息顺序由实例与事件策略负责,等待业务消息不会阻塞同文档的校验或取消。页面 `receive(message, { signal, requestId })` 提供每条消息的协作取消信号;任务取消传播到该文档对应请求,插件异步等待后应检查 signal。取消不强制终止页面 JS,已提交的外部操作仍需核对。后台默认每 10 秒并发续租,每实例校验超时 8 秒,浏览器租约 30 秒;续租只更新内存,独立定时器每 5 秒批量保存轻量租约,完整运行时代码与待确认事件只在对应状态变化时持久化。失效时取消排队和运行任务并释放页面资源。
260
260
 
261
- 事件负载最多 32 KiB,页面待确认队列 64 条;后台每事件默认待处理 32 条(最多 64),每实例活动事件最多 128,有限并发最多 8。历史最多 256 条及 384 KiB,游标缺口明确返回。Native Messaging 的请求与结果各按 192 KiB 分块并校验 SHA-256,单条页面业务消息/结果最多 24 MiB;浏览器与工具箱回复资源各有 32 MiB 总预算及 30 秒过期。
261
+ 事件 schema 保留为格式描述,后台处理器负责验证负载;宿主检查事件绑定、文档归属、大小和调度约束。事件负载最多 32 KiB,页面待确认队列 64 条;后台每事件默认待处理 32 条(最多 64),每实例活动事件最多 128,有限并发最多 8。历史最多 256 条及 384 KiB,游标缺口明确返回。Native Messaging 的请求与结果各按 192 KiB 分块并校验 SHA-256,单条页面业务消息/结果最多 24 MiB;浏览器与工具箱回复资源各有 32 MiB 总预算及 30 秒过期。
262
262
 
263
263
  SDK 使用 `PluginPageClient`。工具箱调用 `host.page.*`,或 `window.mearl.subscribe('page', { instanceId, cursor? }, listener)` 观察后台事件;`events` 接受 `cursor` 与 `waitMs`(0–25000),无新事件时可等待变化;工具箱订阅先读取快照,随后使用长轮询,退订只结束观察。内部 `page_runtime` 是文档适配协议,业务插件使用 `app.page()`。设计稿叠加已迁移,保存事件无需 Popup 转发。
264
264
 
@@ -270,13 +270,13 @@ SDK 使用 `PluginPageClient`。工具箱调用 `host.page.*`,或 `window.mear
270
270
 
271
271
  ### 状态和激活
272
272
 
273
- 插件导出 `stateStorage = { version: 1, collections: { ... } }`,每个集合声明 `scope`(installation/host/browser-session/instance)、`storage`(persistent/cache/memory)、`schemaVersion`、JSON Schema 和可选 `maxEntries/maxBytes/ttlMs`。浏览器会话与实例只接受 cache/memory;memory 只允许这两种作用域,并且只驻留插件执行宿主内存,按需分配,全宿主合计上限 128 MiB / 512 个集合命名空间,宿主重启清空;实例结束释放对应内存。浏览器会话在文档刷新时保留,新的浏览器会话使用独立空间。所有页面作用域都由真实活动页面解析,不能用业务字段伪造。实例结束清理专属缓存;其他缓存默认 TTL 一天,最多七天,读取、定时维护和配额检查会回收过期值。持久配置、缓存、任务记录和二进制资产分别管理。
273
+ schema 是格式元数据,宿主不执行 JSON Schema 关键字校验;状态写入、事件负载、检查点及迁移数据由插件验证。插件导出 `stateStorage = { version: 1, collections: { ... } }`,每个集合声明 `scope`(installation/host/browser-session/instance)、`storage`(persistent/cache/memory)、`schemaVersion`、JSON Schema 和可选 `maxEntries/maxBytes/ttlMs`。浏览器会话与实例只接受 cache/memory;memory 只允许这两种作用域,并且只驻留插件执行宿主内存,按需分配,全宿主合计上限 128 MiB / 512 个集合命名空间,宿主重启清空;实例结束释放对应内存。浏览器会话在文档刷新时保留,新的浏览器会话使用独立空间。所有页面作用域都由真实活动页面解析,不能用业务字段伪造。实例结束清理专属缓存;其他缓存默认 TTL 一天,最多七天,读取、定时维护和配额检查会回收过期值。持久配置、缓存、任务记录和二进制资产分别管理。
274
274
 
275
275
  同一命名空间已有状态时,memory 与磁盘存储之间切换须使用新的集合名或作用域;不支持跨存储介质迁移。
276
276
 
277
277
  `get/list/transact` 在用户级任务服务串行处理,集合的值、CAS 版本、schema 版本、TTL 与最近 64 次幂等回执一起写入单个原子记录。每个 put/delete 必须携带读取获得的 opaque `expectedVersion`;集合版本单调递增,删除和过期不会重用版本。多键事务最多 128 项、512 KiB,单值最多 256 KiB,默认每集合 1024 项/8 MiB,磁盘状态每插件总量 64 MiB;memory 按前述全宿主上限管理。list 返回有界分页,调用方带 `expectedRevision` 检测翻页期间的变动。
278
278
 
279
- 变更 schema 或存储类型需要提升 `schemaVersion`。迁移事务明确带 `migrateFromVersion` 与 `expectedRevision`,全部保留值通过新 schema 后才原子提交;旧 revision 禁止回写新 schema。同步 handler 也校验加载时的声明签名,避免代码更新期间误写。更换安装不会继承旧安装命名空间。
279
+ 变更 schema 或存储类型需要提升 `schemaVersion`。迁移事务明确带 `migrateFromVersion` 与 `expectedRevision`,插件负责验证和转换全部保留值,宿主核验版本及事务约束后原子提交;旧 revision 禁止回写新 schema。同步 handler 也校验加载时的声明签名,避免代码更新期间误写。更换安装不会继承旧安装命名空间。
280
280
 
281
281
  命令使用 `app.state(collection, operation, input)`,或通过自动绑定当前页面实例的 `context.state(...)` 调用。SDK `PluginStateClient` 与工具箱 `host.state.*` 使用同一服务。设计稿叠加的素材和设置使用 browser-session memory,素材通过有界分块读写。用户显式导出的图片不属于缓存。
282
282
 
@@ -196,60 +196,6 @@ Apache License
196
196
 
197
197
  ----------------------------------------
198
198
 
199
- acorn@8.19.0
200
- LICENSE
201
-
202
- MIT License
203
-
204
- Copyright (C) 2012-2022 by various contributors (see AUTHORS)
205
-
206
- Permission is hereby granted, free of charge, to any person obtaining a copy
207
- of this software and associated documentation files (the "Software"), to deal
208
- in the Software without restriction, including without limitation the rights
209
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
210
- copies of the Software, and to permit persons to whom the Software is
211
- furnished to do so, subject to the following conditions:
212
-
213
- The above copyright notice and this permission notice shall be included in
214
- all copies or substantial portions of the Software.
215
-
216
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
217
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
218
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
219
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
220
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
221
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
222
- THE SOFTWARE.
223
-
224
- ----------------------------------------
225
-
226
- ajv@8.20.0
227
- LICENSE
228
-
229
- The MIT License (MIT)
230
-
231
- Copyright (c) 2015-2021 Evgeny Poberezkin
232
-
233
- Permission is hereby granted, free of charge, to any person obtaining a copy
234
- of this software and associated documentation files (the "Software"), to deal
235
- in the Software without restriction, including without limitation the rights
236
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
237
- copies of the Software, and to permit persons to whom the Software is
238
- furnished to do so, subject to the following conditions:
239
-
240
- The above copyright notice and this permission notice shall be included in all
241
- copies or substantial portions of the Software.
242
-
243
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
244
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
245
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
246
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
247
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
248
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
249
- SOFTWARE.
250
-
251
- ----------------------------------------
252
-
253
199
  buffer-crc32@0.2.13
254
200
  LICENSE
255
201
 
@@ -384,69 +330,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
384
330
 
385
331
  ----------------------------------------
386
332
 
387
- fast-deep-equal@3.1.3
388
- LICENSE
389
-
390
- MIT License
391
-
392
- Copyright (c) 2017 Evgeny Poberezkin
393
-
394
- Permission is hereby granted, free of charge, to any person obtaining a copy
395
- of this software and associated documentation files (the "Software"), to deal
396
- in the Software without restriction, including without limitation the rights
397
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
398
- copies of the Software, and to permit persons to whom the Software is
399
- furnished to do so, subject to the following conditions:
400
-
401
- The above copyright notice and this permission notice shall be included in all
402
- copies or substantial portions of the Software.
403
-
404
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
405
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
406
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
407
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
408
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
409
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
410
- SOFTWARE.
411
-
412
- ----------------------------------------
413
-
414
- fast-uri@3.1.9
415
- LICENSE
416
-
417
- Copyright (c) 2011-2021, Gary Court until https://github.com/garycourt/uri-js/commit/a1acf730b4bba3f1097c9f52e7d9d3aba8cdcaae
418
- Copyright (c) 2021-present The Fastify team <https://github.com/fastify/fastify#team>
419
- All rights reserved.
420
-
421
- Redistribution and use in source and binary forms, with or without
422
- modification, are permitted provided that the following conditions are met:
423
- * Redistributions of source code must retain the above copyright
424
- notice, this list of conditions and the following disclaimer.
425
- * Redistributions in binary form must reproduce the above copyright
426
- notice, this list of conditions and the following disclaimer in the
427
- documentation and/or other materials provided with the distribution.
428
- * The names of any contributors may not be used to endorse or promote
429
- products derived from this software without specific prior written
430
- permission.
431
-
432
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
433
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
434
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
435
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY
436
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
437
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
438
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
439
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
440
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
441
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
442
-
443
- * * *
444
-
445
- The complete list of contributors can be found at:
446
- - https://github.com/garycourt/uri-js/graphs/contributors
447
-
448
- ----------------------------------------
449
-
450
333
  fd-slicer@1.1.0
451
334
  LICENSE
452
335
 
@@ -504,33 +387,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
504
387
 
505
388
  ----------------------------------------
506
389
 
507
- json-schema-traverse@1.0.0
508
- LICENSE
509
-
510
- MIT License
511
-
512
- Copyright (c) 2017 Evgeny Poberezkin
513
-
514
- Permission is hereby granted, free of charge, to any person obtaining a copy
515
- of this software and associated documentation files (the "Software"), to deal
516
- in the Software without restriction, including without limitation the rights
517
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
518
- copies of the Software, and to permit persons to whom the Software is
519
- furnished to do so, subject to the following conditions:
520
-
521
- The above copyright notice and this permission notice shall be included in all
522
- copies or substantial portions of the Software.
523
-
524
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
525
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
526
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
527
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
528
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
529
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
530
- SOFTWARE.
531
-
532
- ----------------------------------------
533
-
534
390
  ms@2.1.3
535
391
  license.md
536
392
 
@@ -671,6 +527,43 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
671
527
 
672
528
  ----------------------------------------
673
529
 
530
+ tldts@7.4.19
531
+ LICENSE
532
+
533
+ Copyright (c) 2017 Thomas Parisot, 2018 Rémi Berson
534
+
535
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
536
+ associated documentation files (the "Software"), to deal in the Software without restriction,
537
+ including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
538
+ and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
539
+ subject to the following conditions:
540
+
541
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
542
+
543
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
544
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
545
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
546
+
547
+ ----------------------------------------
548
+
549
+ tough-cookie@6.0.2
550
+ LICENSE
551
+
552
+ Copyright (c) 2015, Salesforce.com, Inc.
553
+ All rights reserved.
554
+
555
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
556
+
557
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
558
+
559
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
560
+
561
+ 3. Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
562
+
563
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
564
+
565
+ ----------------------------------------
566
+
674
567
  uqr@0.1.3
675
568
  LICENSE
676
569
 
@@ -0,0 +1,8 @@
1
+ export type AppAuthorizationProgress = 'installing' | 'connected' | 'authorizing';
2
+ export declare function startAppAuthorization(hook: string, value: unknown, progress?: (phase: AppAuthorizationProgress) => void): Promise<{
3
+ browserId: string;
4
+ qrSvg: string;
5
+ }>;
6
+ export declare function waitAppAuthorization(browserId: string, value: unknown, progress?: (phase: AppAuthorizationProgress) => void): Promise<Record<string, unknown>>;
7
+ export declare function closeAppAuthorization(browserId: string): Promise<void>;
8
+ export declare function closeAppAuthorizations(): Promise<void>;
@@ -1,7 +1,9 @@
1
1
  import { type ResolveAppProfileOptions } from '@mearl/app-profiles';
2
2
  import { type AppProfileCatalogEntry } from '@mearl/browser-core';
3
3
  export declare function findCapabilityAppProfile(id: string): AppProfileCatalogEntry | undefined;
4
- export declare function listInstalledAppProfiles(): Promise<{
4
+ export declare function listInstalledAppProfiles(options?: {
5
+ refresh?: boolean;
6
+ }): Promise<{
5
7
  profiles: AppProfileCatalogEntry[];
6
8
  errors: Array<{
7
9
  plugin: string;
@@ -1,4 +1,4 @@
1
- import type { MtopRequest, ParsedSseEvent, RumEvent, SendMtopRequestParams } from '@mearl/browser-core';
1
+ import type { RequestCookie, MtopRequest, ParsedSseEvent, RumEvent, SendMtopRequestParams } from '@mearl/browser-core';
2
2
  export interface ResolvedMtopRequest {
3
3
  api: string;
4
4
  requestData: unknown;
@@ -47,7 +47,7 @@ export interface MtopStreamCaptureResponse {
47
47
  }
48
48
  export interface MtopCapability {
49
49
  resolveRequest(data: SendMtopRequestParams): ResolvedMtopRequest;
50
- prepareRequest(resolved: ResolvedMtopRequest, cookies: Map<string, string>, stream?: boolean): PreparedSignedMtopRequest;
50
+ prepareRequest(resolved: ResolvedMtopRequest, cookies: readonly RequestCookie[], stream?: boolean): PreparedSignedMtopRequest;
51
51
  parseResponse(text: string): unknown;
52
52
  consumeResponse(response: Response, onReceive: (event: ParsedSseEvent) => void | Promise<void>): Promise<unknown>;
53
53
  createCapture(data: MtopStreamCaptureStart): MtopStreamCapture;
@@ -0,0 +1 @@
1
+ export {};
@@ -4,7 +4,7 @@
4
4
  * Contains: HTTP helper (nodeFetch), cookie utilities, page-load waiters,
5
5
  * viewport helpers, and serialized function sources for page injection.
6
6
  */
7
- import { type PageClickPointerType, type PageDragPoint, type PageDragPointerType } from '@mearl/browser-core';
7
+ import { type CookieCandidate, type PageClickPointerType, type PageDragPoint, type PageDragPointerType } from '@mearl/browser-core';
8
8
  import type { PageSession } from './cdp-session.js';
9
9
  export declare const TYPE_INTO_ELEMENT_SRC: string;
10
10
  export declare const CLICK_ELEMENT_VIA_JS_SRC: string;
@@ -21,8 +21,9 @@ export declare function nodeFetch(urlStr: string, options?: {
21
21
  headers: Record<string, string>;
22
22
  body: string;
23
23
  bodyBuffer: Buffer;
24
+ setCookies: string[];
24
25
  }>;
25
- export declare function getCookiesForUrl(session: PageSession, targetUrl: string): Promise<Map<string, string>>;
26
+ export declare function getCookiesForUrl(session: PageSession, targetUrl: string): Promise<CookieCandidate[]>;
26
27
  export declare function buildMultipartFormBody(fields: Record<string, string>): {
27
28
  contentType: string;
28
29
  body: string;
@@ -8,6 +8,7 @@ import './request-handlers.js';
8
8
  import './mock-handlers.js';
9
9
  import './http-handlers.js';
10
10
  import './browser-handlers.js';
11
+ import './capability-handlers.js';
11
12
  import './rule-handlers.js';
12
13
  import './tab-handlers.js';
13
14
  import './interaction-handlers.js';
@@ -1,7 +1,8 @@
1
+ import { type ResponseCookieSync } from './response-cookies.js';
1
2
  /**
2
3
  * CDP HTTP proxy / MTOP request / API schema handlers.
3
4
  */
4
- import type { SendMtopRequestParams, SendRequestParams } from '@mearl/browser-core';
5
+ import { SendMtopRequestParams, SendRequestParams } from '@mearl/browser-core';
5
6
  import type { PageSession } from './cdp-session.js';
6
7
  export interface CdpMtopStreamRequestMetadata {
7
8
  method: 'GET' | 'POST';
@@ -30,4 +31,5 @@ export declare function cdpSendMtopStreamRequest(session: PageSession, data: Sen
30
31
  success: true;
31
32
  response: unknown;
32
33
  requestData: unknown;
34
+ cookieSync?: ResponseCookieSync;
33
35
  }>;
@@ -0,0 +1,8 @@
1
+ import { type CookieCandidate } from '@mearl/browser-core';
2
+ /** Background proxy requests use the target URL's first-party, schemeful site. */
3
+ export declare function getRequestCookiePartition(url: string): {
4
+ topLevelSite: string;
5
+ hasCrossSiteAncestor: false;
6
+ };
7
+ /** Keep ordinary cookies and only the target site's first-party partition. */
8
+ export declare function selectRequestCookies<T extends CookieCandidate>(cookies: readonly T[], url: string): T[];
@@ -0,0 +1,8 @@
1
+ import type { PageSession } from './cdp-session.js';
2
+ export interface ResponseCookieSync {
3
+ updatedCount: number;
4
+ rejectedCount: number;
5
+ failedCount: number;
6
+ }
7
+ /** Apply response cookies to the same browser context that supplied the request's credentials. */
8
+ export declare function syncResponseCookies(session: PageSession, url: string, headers: readonly string[]): Promise<ResponseCookieSync | undefined>;
@@ -1,2 +1,3 @@
1
- import { type SendRequestParams } from '@mearl/browser-core';
2
- export declare function executeNodeSendRequest(data: SendRequestParams, cookieMap?: Map<string, string>): Promise<any>;
1
+ import { type RequestCookie, type SendRequestParams } from '@mearl/browser-core';
2
+ import type { ResponseCookieSync } from './response-cookies.js';
3
+ export declare function executeNodeSendRequest(data: SendRequestParams, cookies?: readonly RequestCookie[], onResponseCookies?: (url: string, headers: readonly string[]) => Promise<ResponseCookieSync | undefined>): Promise<any>;
@@ -6,7 +6,7 @@ interface Dependencies {
6
6
  transport: () => ControlSessionInfo['transport'];
7
7
  invoke: (action: string, data: any, transport: ControlSessionInfo['transport']) => Promise<any>;
8
8
  deactivate?: (tabs: number[], transport: ControlSessionInfo['transport']) => Promise<void>;
9
- cleanup: (tabs: number[], transport: ControlSessionInfo['transport'], preserveEnvironment: boolean) => Promise<void>;
9
+ cleanup: (tabs: number[], transport: ControlSessionInfo['transport'], preserveEnvironment: boolean, returningToAgent?: boolean) => Promise<void>;
10
10
  download: (data: PageDownloadParams, transport: ControlSessionInfo['transport'], origin: string) => Promise<{
11
11
  filename: string;
12
12
  filePath: string;