@free-lzj/dsh-browser-use 0.1.0 → 0.1.1
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 +1 -1
- package/lib/types/bsk.d.ts +0 -80
- package/lib/types/tools.d.ts +0 -35
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@free-lzj/dsh-browser-use",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Drive the browser you are already signed into: mention an open tab with @, then read and operate it through BrowserSkill's own tools",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
package/lib/types/bsk.d.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The `bsk` CLI, as this plugin drives it.
|
|
3
|
-
*
|
|
4
|
-
* Everything below is one process per command: no long-lived pipe, no protocol of
|
|
5
|
-
* our own. `bsk` already owns the browser side — the daemon, the extension, the
|
|
6
|
-
* borrowed-tab lifecycle — so the only thing worth building here is (a) one
|
|
7
|
-
* session reused across calls, and (b) the borrow/act/return bracket, which is
|
|
8
|
-
* what keeps a user tab from staying borrowed after a single read.
|
|
9
|
-
*
|
|
10
|
-
* @module @free-lzj/dsh-browser-use/bsk
|
|
11
|
-
*/
|
|
12
|
-
import type { BrowserTab, TabAction } from './protocol.ts';
|
|
13
|
-
/** How to reach the CLI. */
|
|
14
|
-
export interface BskConfig {
|
|
15
|
-
/** Executable name or absolute path; `bsk` on PATH by default. */
|
|
16
|
-
readonly path: string;
|
|
17
|
-
/** Name the browser's own control overlay shows, so the user knows who is driving. */
|
|
18
|
-
readonly agentName: string;
|
|
19
|
-
/** Per-command ceiling; starting a session opens a window, reading a page does not. */
|
|
20
|
-
readonly timeoutMs: number;
|
|
21
|
-
}
|
|
22
|
-
/** One action asked of one borrowed tab. */
|
|
23
|
-
export interface TabRequest {
|
|
24
|
-
readonly tabId: number;
|
|
25
|
-
readonly action: TabAction;
|
|
26
|
-
/** Element ref (`@e3`) for click/fill, URL for navigate; unused elsewhere. */
|
|
27
|
-
readonly target?: string;
|
|
28
|
-
/** Text to type, for fill. */
|
|
29
|
-
readonly value?: string;
|
|
30
|
-
}
|
|
31
|
-
/** What one action produced. */
|
|
32
|
-
export interface TabActionResult {
|
|
33
|
-
/** The command's own output, already trimmed. */
|
|
34
|
-
readonly text: string;
|
|
35
|
-
/** Where a screenshot landed, when the action was one. */
|
|
36
|
-
readonly path?: string;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* One `bsk` session, started on first use.
|
|
40
|
-
*
|
|
41
|
-
* Reused rather than per-call: `session start` opens a window, which is a visible
|
|
42
|
-
* interruption and takes seconds. The session lives as long as this plugin does
|
|
43
|
-
* and is stopped in its disposer.
|
|
44
|
-
*/
|
|
45
|
-
export declare class BskCli {
|
|
46
|
-
#private;
|
|
47
|
-
/**
|
|
48
|
-
* @param config - executable, overlay label, and per-command ceiling.
|
|
49
|
-
*/
|
|
50
|
-
constructor(config?: Partial<BskConfig>);
|
|
51
|
-
/**
|
|
52
|
-
* The active session id, starting one when there is none.
|
|
53
|
-
*
|
|
54
|
-
* A failed start is dropped instead of cached: a browser that was closed and
|
|
55
|
-
* reopened must be able to answer the next `@` without a restart of DSH.
|
|
56
|
-
* @returns the session id.
|
|
57
|
-
*/
|
|
58
|
-
ensureSession(): Promise<string>;
|
|
59
|
-
/**
|
|
60
|
-
* Every tab in the user's own windows.
|
|
61
|
-
*
|
|
62
|
-
* `--scope user` and not `all`: the agent's own Agent Window is a tool this
|
|
63
|
-
* plugin drives, never something the user meant to mention.
|
|
64
|
-
* @returns the tabs, most useful first (active tabs lead within a window).
|
|
65
|
-
*/
|
|
66
|
-
listUserTabs(): Promise<readonly BrowserTab[]>;
|
|
67
|
-
/**
|
|
68
|
-
* Run one action against a user tab, borrowing it for exactly that long.
|
|
69
|
-
*
|
|
70
|
-
* The bracket is not optional: `bsk` protects user tabs, so an unborrowed tab
|
|
71
|
-
* answers nothing, and a borrowed one left behind keeps the browser's control
|
|
72
|
-
* marker on a tab nobody is using.
|
|
73
|
-
* @param request - tab, action, and the action's own argument.
|
|
74
|
-
* @returns the action's output.
|
|
75
|
-
*/
|
|
76
|
-
act(request: TabRequest): Promise<TabActionResult>;
|
|
77
|
-
/** Stop the session this instance started, if any. */
|
|
78
|
-
dispose(): Promise<void>;
|
|
79
|
-
}
|
|
80
|
-
//# sourceMappingURL=bsk.d.ts.map
|
package/lib/types/tools.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The agent tool: read and drive one mentioned tab.
|
|
3
|
-
*
|
|
4
|
-
* A mention alone is only text. Without this tool the model would have to
|
|
5
|
-
* assemble `bsk` command lines by hand, which is both slow and a prompt-injection
|
|
6
|
-
* surface (a page title could become flags). One tool with a closed action set
|
|
7
|
-
* keeps every invocation to argv this file built.
|
|
8
|
-
*
|
|
9
|
-
* @module @free-lzj/dsh-browser-tabs/tools
|
|
10
|
-
*/
|
|
11
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
12
|
-
import type { BskCli } from './bsk.ts';
|
|
13
|
-
/** What one tool call produced. */
|
|
14
|
-
export interface TabToolResult {
|
|
15
|
-
readonly text: string;
|
|
16
|
-
readonly path?: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Recover a tab id from whatever the model copied out of the mention.
|
|
20
|
-
*
|
|
21
|
-
* The chip serializes as `@[页面标题](dsh-browser:299872133)`, so the id usually
|
|
22
|
-
* arrives wrapped; a bare id arrives when the model read it off the candidate
|
|
23
|
-
* row instead. Both are the same tab.
|
|
24
|
-
* @param value - the `tab` argument.
|
|
25
|
-
* @returns the numeric id.
|
|
26
|
-
*/
|
|
27
|
-
export declare function tabIdOf(value: string): number;
|
|
28
|
-
/**
|
|
29
|
-
* Register the tab tool.
|
|
30
|
-
* @param ctx - the Host plugin context.
|
|
31
|
-
* @param cli - the shared `bsk` session.
|
|
32
|
-
* @returns the disposer, for the caller's `ctx.effect`.
|
|
33
|
-
*/
|
|
34
|
-
export declare function registerTabTool(ctx: Context, cli: BskCli): () => void;
|
|
35
|
-
//# sourceMappingURL=tools.d.ts.map
|