@hy-sde-org/dsh-browser 0.1.1-rc.2
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 +37 -0
- package/README.md +33 -0
- package/cordis.patch.yml +21 -0
- package/dist/aria-bundle.d.ts +9 -0
- package/dist/aria-bundle.d.ts.map +1 -0
- package/dist/aria-bundle.js +16 -0
- package/dist/aria-bundle.js.map +1 -0
- package/dist/aria.d.ts +45 -0
- package/dist/aria.d.ts.map +1 -0
- package/dist/aria.js +79 -0
- package/dist/aria.js.map +1 -0
- package/dist/assets/background.js.txt +242 -0
- package/dist/assets/manifest.json.txt +14 -0
- package/dist/assets/options.html.txt +53 -0
- package/dist/assets/options.js.txt +23 -0
- package/dist/index.d.ts +45 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/invariant.d.ts +16 -0
- package/dist/invariant.d.ts.map +1 -0
- package/dist/invariant.js +22 -0
- package/dist/invariant.js.map +1 -0
- package/dist/relay/bridge.d.ts +36 -0
- package/dist/relay/bridge.d.ts.map +1 -0
- package/dist/relay/bridge.js +860 -0
- package/dist/relay/bridge.js.map +1 -0
- package/dist/relay/index.d.ts +16 -0
- package/dist/relay/index.d.ts.map +1 -0
- package/dist/relay/index.js +15 -0
- package/dist/relay/index.js.map +1 -0
- package/dist/relay/kind.d.ts +30 -0
- package/dist/relay/kind.d.ts.map +1 -0
- package/dist/relay/kind.js +33 -0
- package/dist/relay/kind.js.map +1 -0
- package/dist/relay/protocol.d.ts +101 -0
- package/dist/relay/protocol.d.ts.map +1 -0
- package/dist/relay/protocol.js +12 -0
- package/dist/relay/protocol.js.map +1 -0
- package/dist/relay/server.d.ts +44 -0
- package/dist/relay/server.d.ts.map +1 -0
- package/dist/relay/server.js +173 -0
- package/dist/relay/server.js.map +1 -0
- package/dist/service.d.ts +157 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +291 -0
- package/dist/service.js.map +1 -0
- package/dist/stealth-scripts.d.ts +11 -0
- package/dist/stealth-scripts.d.ts.map +1 -0
- package/dist/stealth-scripts.js +2010 -0
- package/dist/stealth-scripts.js.map +1 -0
- package/dist/stealth.d.ts +62 -0
- package/dist/stealth.d.ts.map +1 -0
- package/dist/stealth.js +194 -0
- package/dist/stealth.js.map +1 -0
- package/dist/types.d.ts +58 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/examples/agent-preset/agent.cordis.yml +19 -0
- package/examples/agent-preset/preset.yml +3 -0
- package/package.json +99 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>OMP Browser Relay settings</title>
|
|
6
|
+
<style>
|
|
7
|
+
body {
|
|
8
|
+
font-family: system-ui, sans-serif;
|
|
9
|
+
max-width: 28rem;
|
|
10
|
+
margin: 2rem auto;
|
|
11
|
+
padding: 0 1rem;
|
|
12
|
+
color: #1f2328;
|
|
13
|
+
}
|
|
14
|
+
label {
|
|
15
|
+
display: block;
|
|
16
|
+
margin: 1rem 0 0.25rem;
|
|
17
|
+
font-weight: 600;
|
|
18
|
+
}
|
|
19
|
+
input {
|
|
20
|
+
width: 100%;
|
|
21
|
+
padding: 0.4rem 0.5rem;
|
|
22
|
+
font: inherit;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
}
|
|
25
|
+
button {
|
|
26
|
+
margin-top: 1.25rem;
|
|
27
|
+
padding: 0.45rem 1.1rem;
|
|
28
|
+
font: inherit;
|
|
29
|
+
}
|
|
30
|
+
#status {
|
|
31
|
+
margin-left: 0.75rem;
|
|
32
|
+
color: #1a7f37;
|
|
33
|
+
}
|
|
34
|
+
p.hint {
|
|
35
|
+
color: #57606a;
|
|
36
|
+
font-size: 0.85rem;
|
|
37
|
+
}
|
|
38
|
+
</style>
|
|
39
|
+
</head>
|
|
40
|
+
<body>
|
|
41
|
+
<h1>OMP Browser Relay</h1>
|
|
42
|
+
<p class="hint">
|
|
43
|
+
The extension connects to a local <code>omp-browser-relay</code> process. Values here must match the flags the
|
|
44
|
+
relay was started with.
|
|
45
|
+
</p>
|
|
46
|
+
<label for="port">Relay port</label>
|
|
47
|
+
<input id="port" type="number" min="1" max="65535" />
|
|
48
|
+
<label for="token">Token (optional)</label>
|
|
49
|
+
<input id="token" type="text" autocomplete="off" />
|
|
50
|
+
<button id="save">Save</button><span id="status"></span>
|
|
51
|
+
<script src="options.js"></script>
|
|
52
|
+
</body>
|
|
53
|
+
</html>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Options page for the OMP Browser Relay extension (plain JS: shipped as-is).
|
|
2
|
+
const DEFAULT_PORT = 9224;
|
|
3
|
+
const portInput = document.getElementById("port");
|
|
4
|
+
const tokenInput = document.getElementById("token");
|
|
5
|
+
const status = document.getElementById("status");
|
|
6
|
+
|
|
7
|
+
chrome.storage.local.get({ port: DEFAULT_PORT, token: "" }).then(stored => {
|
|
8
|
+
portInput.value = String(stored.port);
|
|
9
|
+
tokenInput.value = String(stored.token);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
document.getElementById("save").addEventListener("click", async () => {
|
|
13
|
+
const port = Number(portInput.value);
|
|
14
|
+
if (!Number.isInteger(port) || port <= 0 || port > 65535) {
|
|
15
|
+
status.textContent = "invalid port";
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
await chrome.storage.local.set({ port, token: tokenInput.value });
|
|
19
|
+
status.textContent = "saved";
|
|
20
|
+
setTimeout(() => {
|
|
21
|
+
status.textContent = "";
|
|
22
|
+
}, 1500);
|
|
23
|
+
});
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic browser for the DeepSeek Harness: `ctx.browser`, a host-plane
|
|
3
|
+
* browser service (launch with stealth, CDP-attach, and local relay over the
|
|
4
|
+
* user's own tabs via the companion Chrome extension) that the browser tool
|
|
5
|
+
* in `@hy-sde-org/dsh-tool-browser` resolves.
|
|
6
|
+
*
|
|
7
|
+
* Port of omp (oh-my-pi)'s browser tool — see port_omp.md item: browser tool
|
|
8
|
+
* with stealth + relay/CDP-attach. The service holds no durable state and
|
|
9
|
+
* owns its browser process(es) per session, so it mounts in the base bundle
|
|
10
|
+
* alongside `ctx.git` / `ctx.memory`; the model-facing tools resolve it from
|
|
11
|
+
* a preset row.
|
|
12
|
+
* @module @hy-sde-org/dsh-browser
|
|
13
|
+
*/
|
|
14
|
+
import { Context } from '@deepseek-ai/cordis';
|
|
15
|
+
import { BrowserService } from './service.ts';
|
|
16
|
+
import type { BrowserConfig } from './types.ts';
|
|
17
|
+
export * from './types.ts';
|
|
18
|
+
export * from './aria.ts';
|
|
19
|
+
export * from './stealth.ts';
|
|
20
|
+
export * from './service.ts';
|
|
21
|
+
export * from './relay/kind.ts';
|
|
22
|
+
export * from './relay/protocol.ts';
|
|
23
|
+
declare module '@deepseek-ai/cordis' {
|
|
24
|
+
interface Context {
|
|
25
|
+
/** The browser service: tabs over launch/CDP-attach/relay backends. */
|
|
26
|
+
browser: BrowserService;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export { BrowserService } from './service.ts';
|
|
30
|
+
/**
|
|
31
|
+
* Register `ctx.browser`. Host-plane row: browser processes must be shared
|
|
32
|
+
* across sessions within one process so tabs survive; the service is disposed
|
|
33
|
+
* with its owning context.
|
|
34
|
+
* @param ctx - the host-plane plugin context.
|
|
35
|
+
* @param config - service configuration (browser path, viewport, relay).
|
|
36
|
+
*/
|
|
37
|
+
export declare function apply(ctx: Context, config?: BrowserConfig): void;
|
|
38
|
+
/** Cordis plugin name for loader diagnostics. */
|
|
39
|
+
export declare const name = "browser";
|
|
40
|
+
declare const _default: {
|
|
41
|
+
name: string;
|
|
42
|
+
apply: typeof apply;
|
|
43
|
+
};
|
|
44
|
+
export default _default;
|
|
45
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AAEnC,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf,uEAAuE;QACvE,OAAO,EAAE,cAAc,CAAA;KACxB;CACF;AAED,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,GAAE,aAAkB,GAAG,IAAI,CAEpE;AAED,iDAAiD;AACjD,eAAO,MAAM,IAAI,YAAY,CAAA;;;;;AAE7B,wBAA8B"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic browser for the DeepSeek Harness: `ctx.browser`, a host-plane
|
|
3
|
+
* browser service (launch with stealth, CDP-attach, and local relay over the
|
|
4
|
+
* user's own tabs via the companion Chrome extension) that the browser tool
|
|
5
|
+
* in `@hy-sde-org/dsh-tool-browser` resolves.
|
|
6
|
+
*
|
|
7
|
+
* Port of omp (oh-my-pi)'s browser tool — see port_omp.md item: browser tool
|
|
8
|
+
* with stealth + relay/CDP-attach. The service holds no durable state and
|
|
9
|
+
* owns its browser process(es) per session, so it mounts in the base bundle
|
|
10
|
+
* alongside `ctx.git` / `ctx.memory`; the model-facing tools resolve it from
|
|
11
|
+
* a preset row.
|
|
12
|
+
* @module @hy-sde-org/dsh-browser
|
|
13
|
+
*/
|
|
14
|
+
import { BrowserService } from "./service.js";
|
|
15
|
+
export * from "./types.js";
|
|
16
|
+
export * from "./aria.js";
|
|
17
|
+
export * from "./stealth.js";
|
|
18
|
+
export * from "./service.js";
|
|
19
|
+
export * from "./relay/kind.js";
|
|
20
|
+
export * from "./relay/protocol.js";
|
|
21
|
+
export { BrowserService } from "./service.js";
|
|
22
|
+
/**
|
|
23
|
+
* Register `ctx.browser`. Host-plane row: browser processes must be shared
|
|
24
|
+
* across sessions within one process so tabs survive; the service is disposed
|
|
25
|
+
* with its owning context.
|
|
26
|
+
* @param ctx - the host-plane plugin context.
|
|
27
|
+
* @param config - service configuration (browser path, viewport, relay).
|
|
28
|
+
*/
|
|
29
|
+
export function apply(ctx, config = {}) {
|
|
30
|
+
void new BrowserService(ctx, config);
|
|
31
|
+
}
|
|
32
|
+
/** Cordis plugin name for loader diagnostics. */
|
|
33
|
+
export const name = 'browser';
|
|
34
|
+
export default { name, apply };
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAG7C,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AASnC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAC,GAAY,EAAE,SAAwB,EAAE;IAC5D,KAAK,IAAI,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;AACtC,CAAC;AAED,iDAAiD;AACjD,MAAM,CAAC,MAAM,IAAI,GAAG,SAAS,CAAA;AAE7B,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package-owned invariant companion for `@hy-sde-org/dsh-browser`.
|
|
3
|
+
* @module @hy-sde-org/dsh-browser/invariant
|
|
4
|
+
*/
|
|
5
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
+
/** Cordis companion plugin name. */
|
|
7
|
+
export declare const name = "browser-invariant";
|
|
8
|
+
/** Service required before the companion can reserve package ownership. */
|
|
9
|
+
export declare const inject: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Register this package's invariant companion.
|
|
12
|
+
* @param ctx - Cordis context carrying the invariant service.
|
|
13
|
+
* @returns the installed registration's disposer after setup succeeds.
|
|
14
|
+
*/
|
|
15
|
+
export declare const apply: (ctx: Context) => Promise<() => void>;
|
|
16
|
+
//# sourceMappingURL=invariant.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invariant.d.ts","sourceRoot":"","sources":["../src/invariant.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKlD,oCAAoC;AACpC,eAAO,MAAM,IAAI,sBAAsB,CAAA;AACvC,2EAA2E;AAC3E,eAAO,MAAM,MAAM,UAAiB,CAAA;AAQpC;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAAI,KAAK,OAAO,KAAG,OAAO,CAAC,MAAM,IAAI,CACU,CAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package-owned invariant companion for `@hy-sde-org/dsh-browser`.
|
|
3
|
+
* @module @hy-sde-org/dsh-browser/invariant
|
|
4
|
+
*/
|
|
5
|
+
const PACKAGE_NAME = '@hy-sde-org/dsh-browser';
|
|
6
|
+
/** Cordis companion plugin name. */
|
|
7
|
+
export const name = 'browser-invariant';
|
|
8
|
+
/** Service required before the companion can reserve package ownership. */
|
|
9
|
+
export const inject = ['invariants'];
|
|
10
|
+
/**
|
|
11
|
+
* No runtime invariant: the service launches browser processes per call and
|
|
12
|
+
* holds no durable state that outlives its fiber.
|
|
13
|
+
*/
|
|
14
|
+
const install = () => { };
|
|
15
|
+
/**
|
|
16
|
+
* Register this package's invariant companion.
|
|
17
|
+
* @param ctx - Cordis context carrying the invariant service.
|
|
18
|
+
* @returns the installed registration's disposer after setup succeeds.
|
|
19
|
+
*/
|
|
20
|
+
export const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
21
|
+
/* jscpd:ignore-end */
|
|
22
|
+
//# sourceMappingURL=invariant.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invariant.js","sourceRoot":"","sources":["../src/invariant.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,YAAY,GAAG,yBAAyB,CAAA;AAE9C,oCAAoC;AACpC,MAAM,CAAC,MAAM,IAAI,GAAG,mBAAmB,CAAA;AACvC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,YAAY,CAAC,CAAA;AAEpC;;;GAGG;AACH,MAAM,OAAO,GAAuB,GAAG,EAAE,GAAE,CAAC,CAAA;AAE5C;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAY,EAAuB,EAAE,CACzD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAA;AACjE,sBAAsB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Transport-agnostic websocket surface the bridge writes to. */
|
|
2
|
+
export interface RelaySocket {
|
|
3
|
+
send(text: string): void;
|
|
4
|
+
close(): void;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Multiplexing CDP bridge between downstream puppeteer connections and the
|
|
8
|
+
* relay extension. One instance per relay server; all state lives here so an
|
|
9
|
+
* extension service-worker restart only has to re-handshake.
|
|
10
|
+
*/
|
|
11
|
+
export declare class RelayBridge {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(opts?: {
|
|
14
|
+
log?: (message: string, data?: Record<string, unknown>) => void;
|
|
15
|
+
/** Group tabs the agent actively drives under one per-window Chrome tab group. */
|
|
16
|
+
group?: {
|
|
17
|
+
title: string;
|
|
18
|
+
color: string;
|
|
19
|
+
} | null;
|
|
20
|
+
});
|
|
21
|
+
/** True once the extension has completed its hello handshake. */
|
|
22
|
+
get ready(): boolean;
|
|
23
|
+
/** Payload for `GET /json/version`. */
|
|
24
|
+
versionInfo(wsUrl: string): Record<string, string>;
|
|
25
|
+
/** Payload for `GET /json/list` (debugging aid; per-target endpoints are not served). */
|
|
26
|
+
listTargets(): Array<Record<string, string>>;
|
|
27
|
+
/** A new extension socket connected; replaces any previous one. */
|
|
28
|
+
extConnected(socket: RelaySocket): void;
|
|
29
|
+
extClosed(socket: RelaySocket): void;
|
|
30
|
+
extMessage(socket: RelaySocket, raw: string): void;
|
|
31
|
+
/** Register a downstream CDP websocket; returns the connection id. */
|
|
32
|
+
cdpConnected(socket: RelaySocket): number;
|
|
33
|
+
cdpClosed(connId: number): void;
|
|
34
|
+
cdpMessage(connId: number, raw: string): void;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../src/relay/bridge.ts"],"names":[],"mappings":"AA4BA,iEAAiE;AACjE,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,KAAK,IAAI,IAAI,CAAA;CACd;AA6GD;;;;GAIG;AACH,qBAAa,WAAW;;gBAuBpB,IAAI,GAAE;QACJ,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;QAC/D,kFAAkF;QAClF,KAAK,CAAC,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,GAAG,IAAI,CAAA;KAC3C;IAMR,iEAAiE;IACjE,IAAI,KAAK,IAAI,OAAO,CAEnB;IAED,uCAAuC;IACvC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAYlD,yFAAyF;IACzF,WAAW,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAW5C,mEAAmE;IACnE,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAQvC,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI;IAuBpC,UAAU,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAsElD,sEAAsE;IACtE,YAAY,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM;IAOzC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IA2B/B,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;CAklB9C"}
|