@qilin-agent/browser-use 0.0.0-stage → 3.1.3

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 kkutysllb
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,37 @@
1
+ # Bilingual-pair consistency record for README.md (docs/i18n/README.md): per heading
2
+ # section, a hash of its English and Chinese blocks outside code blocks and generated regions.
3
+ # After editing either side, bring the other along and re-record with:
4
+ # pnpm run verify-translation-pairing --write packages/browser-use/browser-use/README.md
5
+ /:
6
+ en: f40b34f771caa863
7
+ zh: f61d7ce73e0720e2
8
+ /qilin-browser-use:
9
+ en: 3faed0ad44a63838
10
+ zh: 1647a85ef39b0ab2
11
+ /qilin-browser-use/summary:
12
+ en: 3e2c0d4aad911b93
13
+ zh: 3e3903754a46de8e
14
+ /qilin-browser-use/table-of-contents:
15
+ en: d152484eb41ac6b4
16
+ zh: f14f34fce35a8d90
17
+ /qilin-browser-use/use-this-package:
18
+ en: b981e34a09985257
19
+ zh: c482fb97bc096e1a
20
+ /qilin-browser-use/understand-the-implementation:
21
+ en: c4d9ec0df22a30ea
22
+ zh: 06057e2a56cebbb9
23
+ /qilin-browser-use/further-exploration:
24
+ en: c32c24ca938f2a97
25
+ zh: fb577661f82fcac7
26
+ /qilin-browser-use/model-experience:
27
+ en: 8780c250dfaefaaa
28
+ zh: f1fd94f7531b60a1
29
+ /qilin-browser-use/model-experience/kv-cache-effect:
30
+ en: 0cc866a67a19d08b
31
+ zh: c6a46b147b042cff
32
+ /qilin-browser-use/known-limitations-and-deferred-work:
33
+ en: 43952e97817e9e32
34
+ zh: a5e494860a71fc71
35
+ /qilin-browser-use/known-limitations-and-deferred-work/dev-note:
36
+ en: e67f633dc6fe7773
37
+ zh: 8ec3e73528ddb1a6
package/README.md CHANGED
@@ -1,3 +1,88 @@
1
- # Temporary Holding Version
1
+ ---
2
+ description: "Browser-use provider registration for deployments that enable one browser backend at a time."
3
+ kind: "package-reference"
4
+ ---
2
5
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
6
+ # @qilin-agent/browser-use
7
+
8
+ English | [中文](README.zh.md)
9
+
10
+ ## Summary
11
+
12
+ A deployment can enable one browser-use provider at a time. Loading another provider fails with the registered provider name. Each provider supplies its own tools and owns browser sessions. This package adds no model-visible tools or browser operations.
13
+
14
+ ## Table of Contents
15
+
16
+ - [Use this package](#use-this-package)
17
+ - [Understand the implementation](#understand-the-implementation)
18
+ - [Further Exploration](#further-exploration)
19
+ - [Model Experience](#model-experience)
20
+ - [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
21
+ - [Dev Note](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## Use this package
27
+
28
+ Mount the service once beside the chosen provider in a Cordis composition:
29
+
30
+ ```yaml
31
+ - name: '@qilin-agent/browser-use'
32
+ ```
33
+
34
+ The service has no configuration. Provider plugins inject `browserUse` and call `ctx.browserUse.register(BrowserUseProviderName(name))`; the brand is exported from `@qilin-agent/browser-use/brand`. The returned effect disposer releases that registration.
35
+
36
+ Providers stop admitting tool calls, close their resources, and await owned work before releasing the registration. `ctx.browserUse.providerName` reports the registered name until release.
37
+
38
+ -----
39
+
40
+ <a id="understand-the-implementation"></a>
41
+ ## Understand the implementation
42
+
43
+ <details>
44
+ <summary>Implementation internals — click to expand</summary>
45
+
46
+ One private name owns the slot. Cordis effects remove contributions when their plugin unloads; a repeated disposer cannot remove a later registration. The [source](src/index.ts) contains no browser object, operation interface, resource lifecycle, or provider selector.
47
+
48
+ </details>
49
+
50
+ -----
51
+
52
+ <a id="further-exploration"></a>
53
+ ## Further Exploration
54
+
55
+ - [Browser use](../../../docs/subsystems/browser-use.md) — provider selection and Session ownership.
56
+ - [Playwright MCP provider](../../experimental/browser-use-playwright-mcp/README.md) — Playwright browser tools.
57
+ - [Chrome DevTools MCP provider](../../experimental/browser-use-chrome-devtools-mcp/README.md) — Chromium inspection and control.
58
+ - [Stagehand provider](../../experimental/browser-use-stagehand-native/README.md) — native browser operations with AI assistance.
59
+
60
+ -----
61
+
62
+ <a id="model-experience"></a>
63
+ ## Model Experience
64
+
65
+ None, as this registry only records provider names.
66
+
67
+ #### KV Cache effect
68
+
69
+ Registration does not alter model requests. Provider-owned tools and guidance determine their own request-prefix effects.
70
+
71
+ ## Known Limitations and Deferred Work
72
+
73
+ <a id="known-limitations-and-deferred-work"></a>
74
+
75
+ The service limits registrations within its Cordis service instance.
76
+
77
+ - **Browser ownership** — providers own browser resources and enforce Session isolation; this service stores no browser state.
78
+ - **Provider selection** — configuration selects the provider; the model cannot switch registered backends at runtime.
79
+
80
+ <a id="dev-note"></a>
81
+ ### Dev Note
82
+
83
+ <details>
84
+ <summary>Working context for maintainers — click to expand</summary>
85
+
86
+ None.
87
+
88
+ </details>
package/README.zh.md ADDED
@@ -0,0 +1,88 @@
1
+ ---
2
+ description: "浏览器操作 提供方 注册服务,供一次启用一个浏览器后端的部署使用。"
3
+ kind: "package-reference"
4
+ ---
5
+
6
+ # @qilin-agent/browser-use
7
+
8
+ [English](README.md) | 中文
9
+
10
+ ## 概述
11
+
12
+ 部署可以一次启用一个浏览器操作 提供方。加载另一个 提供方 时会报错并指出已注册的 提供方 名称。各 提供方 提供自己的工具并拥有浏览器会话。本包不添加模型可见工具或浏览器操作。
13
+
14
+ ## 目录
15
+
16
+ - [使用本包](#use-this-package)
17
+ - [理解实现](#understand-the-implementation)
18
+ - [延伸阅读](#further-exploration)
19
+ - [模型体验](#model-experience)
20
+ - [已知限制与延期工作](#known-limitations-and-deferred-work)
21
+ - [开发备注](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## 使用本包
27
+
28
+ 在 Cordis 组合中,将服务与所选 提供方 一起挂载一次:
29
+
30
+ ```yaml
31
+ - name: '@qilin-agent/browser-use'
32
+ ```
33
+
34
+ 服务没有配置。提供方 插件注入 `browserUse` 并调用 `ctx.browserUse.register(BrowserUseProviderName(name))`;品牌类型从 `@qilin-agent/browser-use/brand` 导出。返回的 effect 清理器释放该注册。
35
+
36
+ 提供方 在释放注册前停止接收工具调用、关闭资源并等待自己拥有的工作结束。`ctx.browserUse.providerName` 在释放之前持续报告已注册名称。
37
+
38
+ -----
39
+
40
+ <a id="understand-the-implementation"></a>
41
+ ## 理解实现
42
+
43
+ <details>
44
+ <summary>实现内部机制 — 点击展开</summary>
45
+
46
+ 一个私有名称拥有该注册位。Cordis effect 在插件卸载时移除贡献;重复调用清理器不能移除后续注册。[源码](src/index.ts) 不包含浏览器对象、操作接口、资源生命周期或 提供方 选择器。
47
+
48
+ </details>
49
+
50
+ -----
51
+
52
+ <a id="further-exploration"></a>
53
+ ## 延伸阅读
54
+
55
+ - [浏览器操作](../../../docs/subsystems/browser-use.zh.md) — 提供方 选择与 Session 所有权。
56
+ - [Playwright MCP 提供方](../../experimental/browser-use-playwright-mcp/README.zh.md) — Playwright 浏览器工具。
57
+ - [Chrome DevTools MCP 提供方](../../experimental/browser-use-chrome-devtools-mcp/README.zh.md) — Chromium 检查与控制。
58
+ - [Stagehand 提供方](../../experimental/browser-use-stagehand-native/README.zh.md) — 支持 AI(人工智能)辅助的原生浏览器操作。
59
+
60
+ -----
61
+
62
+ <a id="model-experience"></a>
63
+ ## 模型体验
64
+
65
+ 无,因为此注册表只记录 提供方 名称。
66
+
67
+ #### KV Cache 影响
68
+
69
+ 注册不改变模型请求。提供方 拥有的工具与指导决定各自对请求前缀的影响。
70
+
71
+ ## 已知限制与延期工作
72
+
73
+ <a id="known-limitations-and-deferred-work"></a>
74
+
75
+ 服务在其 Cordis 服务实例内限制注册。
76
+
77
+ - **浏览器所有权** — 提供方 拥有浏览器资源并实施 Session 隔离;此服务不保存浏览器状态。
78
+ - **提供方 选择** — 配置选择 提供方;模型不能在运行时切换已注册后端。
79
+
80
+ <a id="dev-note"></a>
81
+ ### 开发备注
82
+
83
+ <details>
84
+ <summary>维护者工作上下文 — 点击展开</summary>
85
+
86
+ 无。
87
+
88
+ </details>
package/lib/index.js ADDED
@@ -0,0 +1,35 @@
1
+ import { Service } from "@qilin-agent/kylin";
2
+ //#region lib/types/index.js
3
+ /**
4
+ * Exclusive named registration for the browser-use capability.
5
+ * @module @qilin-agent/browser-use
6
+ */
7
+ /** Owns one optional provider registration in the shared browser-use service. */
8
+ var BrowserUseRegistry = class extends Service {
9
+ registration;
10
+ constructor(ctx) {
11
+ super(ctx, "browserUse");
12
+ }
13
+ /** Name of the registered provider, including while its resources are closing. */
14
+ get providerName() {
15
+ return this.registration;
16
+ }
17
+ /**
18
+ * Reserve the sole provider slot until the contribution is disposed.
19
+ * A second registration fails even when it repeats the current name. Providers
20
+ * must stop their tools and await owned work before releasing this registration.
21
+ * @param name - provider-owned name used in registration diagnostics.
22
+ * @returns the effect disposer for this exact registration.
23
+ */
24
+ register(name) {
25
+ if (this.registration !== void 0) throw new Error(`browser use provider "${this.registration}" is already registered`);
26
+ return this.ctx.effect(() => {
27
+ this.registration = name;
28
+ return () => {
29
+ this.registration = void 0;
30
+ };
31
+ }, "browserUse.register()");
32
+ }
33
+ };
34
+ //#endregion
35
+ export { BrowserUseRegistry, BrowserUseRegistry as default };
@@ -0,0 +1,11 @@
1
+ /** Browser-use provider identities. @module @qilin-agent/browser-use/brand */
2
+ import type { Branded } from '@qilin-agent/brand';
3
+ /** Provider-owned name identifying a browser-use registration. */
4
+ export type BrowserUseProviderName = Branded<'BrowserUseProviderName'>;
5
+ /**
6
+ * Brand a provider-owned name without changing or validating it.
7
+ * @param name - name chosen by the provider implementation.
8
+ * @returns the same name with its browser-use provider brand.
9
+ */
10
+ export declare function BrowserUseProviderName(name: string): BrowserUseProviderName;
11
+ //# sourceMappingURL=brand.d.ts.map
@@ -0,0 +1,10 @@
1
+ /** Browser-use provider identities. @module @qilin-agent/browser-use/brand */
2
+ /**
3
+ * Brand a provider-owned name without changing or validating it.
4
+ * @param name - name chosen by the provider implementation.
5
+ * @returns the same name with its browser-use provider brand.
6
+ */
7
+ export function BrowserUseProviderName(name) {
8
+ return name;
9
+ }
10
+ //# sourceMappingURL=brand.js.map
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Exclusive named registration for the browser-use capability.
3
+ * @module @qilin-agent/browser-use
4
+ */
5
+ import { Context, Service } from '@qilin-agent/kylin';
6
+ import type { BrowserUseProviderName } from './brand.ts';
7
+ declare module '@qilin-agent/kylin' {
8
+ interface Context {
9
+ browserUse: BrowserUseRegistry;
10
+ }
11
+ }
12
+ /** Owns one optional provider registration in the shared browser-use service. */
13
+ export declare class BrowserUseRegistry extends Service {
14
+ private registration;
15
+ constructor(ctx: Context);
16
+ /** Name of the registered provider, including while its resources are closing. */
17
+ get providerName(): BrowserUseProviderName | undefined;
18
+ /**
19
+ * Reserve the sole provider slot until the contribution is disposed.
20
+ * A second registration fails even when it repeats the current name. Providers
21
+ * must stop their tools and await owned work before releasing this registration.
22
+ * @param name - provider-owned name used in registration diagnostics.
23
+ * @returns the effect disposer for this exact registration.
24
+ */
25
+ register(name: BrowserUseProviderName): () => Promise<void>;
26
+ }
27
+ export default BrowserUseRegistry;
28
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Exclusive named registration for the browser-use capability.
3
+ * @module @qilin-agent/browser-use
4
+ */
5
+ import { Service } from '@qilin-agent/kylin';
6
+ /** Owns one optional provider registration in the shared browser-use service. */
7
+ export class BrowserUseRegistry extends Service {
8
+ registration;
9
+ constructor(ctx) {
10
+ super(ctx, 'browserUse');
11
+ }
12
+ /** Name of the registered provider, including while its resources are closing. */
13
+ get providerName() {
14
+ return this.registration;
15
+ }
16
+ /**
17
+ * Reserve the sole provider slot until the contribution is disposed.
18
+ * A second registration fails even when it repeats the current name. Providers
19
+ * must stop their tools and await owned work before releasing this registration.
20
+ * @param name - provider-owned name used in registration diagnostics.
21
+ * @returns the effect disposer for this exact registration.
22
+ */
23
+ register(name) {
24
+ if (this.registration !== undefined) {
25
+ throw new Error(`browser use provider "${this.registration}" is already registered`);
26
+ }
27
+ return this.ctx.effect(() => {
28
+ this.registration = name;
29
+ return () => {
30
+ this.registration = undefined;
31
+ };
32
+ }, 'browserUse.register()');
33
+ }
34
+ }
35
+ export default BrowserUseRegistry;
36
+ //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,45 @@
1
1
  {
2
2
  "name": "@qilin-agent/browser-use",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "description": "Exclusive named browser-use provider registration",
4
+ "version": "3.1.3",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/kkutysllb/QiLin.git",
11
+ "directory": "packages/browser-use/browser-use"
12
+ },
13
+ "engines": {
14
+ "node": "^22.19.0 || >=24.0.0"
15
+ },
16
+ "type": "module",
17
+ "main": "lib/index.js",
18
+ "types": "lib/types/index.d.ts",
19
+ "exports": {
20
+ ".": {
21
+ "types": "./lib/types/index.d.ts",
22
+ "default": "./lib/index.js"
23
+ },
24
+ "./src/*": "./src/*",
25
+ "./package.json": "./package.json",
26
+ "./brand": {
27
+ "types": "./lib/types/brand.d.ts",
28
+ "default": "./lib/types/brand.js"
29
+ }
30
+ },
31
+ "files": [
32
+ "lib/index.js",
33
+ "lib/types/**/*.js",
34
+ "lib/types/**/*.d.ts"
35
+ ],
36
+ "license": "MIT",
37
+ "peerDependencies": {
38
+ "@qilin-agent/kylin": "~4.0.3",
39
+ "@qilin-agent/brand": "3.1.3"
40
+ },
41
+ "devDependencies": {
42
+ "@qilin-agent/brand": "3.1.3",
43
+ "@qilin-agent/kylin": "~4.0.3"
44
+ }
6
45
  }