dhalsim 1.4.0 → 1.5.0
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 +10 -0
- package/dist/index.js +13 -5
- package/dist/session/manager.d.ts +2 -0
- package/dist/subagents/dhalsim.d.ts +4 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -38,6 +38,7 @@ model = "sonnet" # LLM model for the subagent (default: sonnet)
|
|
|
38
38
|
maxIterations = 20 # Max agent loop iterations (default: 15)
|
|
39
39
|
headless = true # Run browser in headless mode (default: true)
|
|
40
40
|
timeoutMs = 600000 # Overall timeout in ms (default: 300000 = 5 min, 0 = disabled)
|
|
41
|
+
disableCache = false # Disable browser cache for lower memory usage (default: false)
|
|
41
42
|
```
|
|
42
43
|
|
|
43
44
|
#### Per-profile configuration
|
|
@@ -57,6 +58,15 @@ maxIterations = 30 # More iterations for deep research
|
|
|
57
58
|
model = "inherit" # Use parent agent's model
|
|
58
59
|
```
|
|
59
60
|
|
|
61
|
+
#### Low-memory environments
|
|
62
|
+
|
|
63
|
+
For resource-constrained environments (e.g., small VMs, containers), enable `disableCache` to reduce browser memory footprint:
|
|
64
|
+
|
|
65
|
+
```toml
|
|
66
|
+
[production.subagents.BrowseWeb]
|
|
67
|
+
disableCache = true # Reduces memory per browser instance
|
|
68
|
+
```
|
|
69
|
+
|
|
60
70
|
### Custom Commands in cli.toml
|
|
61
71
|
|
|
62
72
|
```toml
|
package/dist/index.js
CHANGED
|
@@ -53,7 +53,7 @@ class BrowserSessionManager {
|
|
|
53
53
|
}
|
|
54
54
|
async startBrowser(options = {}) {
|
|
55
55
|
this.logger.debug(`[BrowserSessionManager] startBrowser headless=${options.headless ?? true} url=${options.url ?? "none"}`);
|
|
56
|
-
const { headless = true, url, proxy, geoip = false } = options;
|
|
56
|
+
const { headless = true, url, proxy, geoip = false, disableCache = false } = options;
|
|
57
57
|
const BROWSER_LAUNCH_TIMEOUT = 30000;
|
|
58
58
|
const MAX_RETRIES = 2;
|
|
59
59
|
const RETRY_DELAY = 1000;
|
|
@@ -66,7 +66,8 @@ class BrowserSessionManager {
|
|
|
66
66
|
server: proxy.server,
|
|
67
67
|
username: proxy.username,
|
|
68
68
|
password: proxy.password
|
|
69
|
-
} : undefined
|
|
69
|
+
} : undefined,
|
|
70
|
+
...disableCache && { enable_cache: false }
|
|
70
71
|
};
|
|
71
72
|
const Camoufox = await loadCamoufox();
|
|
72
73
|
let browser;
|
|
@@ -16180,7 +16181,8 @@ Use this for web research, data extraction, form filling, or any web-based task.
|
|
|
16180
16181
|
maxIterations: z14.number().optional().describe("Maximum number of steps before giving up (default: 15, configurable via CLI)"),
|
|
16181
16182
|
model: z14.string().optional().describe("Model to use for the browser agent (default: inherit from parent agent, configurable via CLI)"),
|
|
16182
16183
|
headless: z14.boolean().optional().describe("Run browser in headless mode (default: true, configurable via CLI)"),
|
|
16183
|
-
timeoutMs: z14.number().optional().describe("Overall timeout in ms (default: 300000 = 5 min, 0 = disabled, configurable via CLI)")
|
|
16184
|
+
timeoutMs: z14.number().optional().describe("Overall timeout in ms (default: 300000 = 5 min, 0 = disabled, configurable via CLI)"),
|
|
16185
|
+
disableCache: z14.boolean().optional().describe("Disable browser cache for lower memory usage (default: false, configurable via CLI)")
|
|
16184
16186
|
}),
|
|
16185
16187
|
timeoutMs: 300000
|
|
16186
16188
|
}) {
|
|
@@ -16209,16 +16211,22 @@ Use this for web research, data extraction, form filling, or any web-based task.
|
|
|
16209
16211
|
subagentKey: "headless",
|
|
16210
16212
|
defaultValue: true
|
|
16211
16213
|
});
|
|
16214
|
+
const disableCache = resolveValue(ctx, "BrowseWeb", {
|
|
16215
|
+
runtime: params.disableCache,
|
|
16216
|
+
subagentKey: "disableCache",
|
|
16217
|
+
defaultValue: false
|
|
16218
|
+
});
|
|
16212
16219
|
const collectedMedia = [];
|
|
16213
16220
|
const manager = this.customSessionManager ?? new BrowserSessionManager(logger13);
|
|
16214
16221
|
const isOwnedManager = !this.customSessionManager;
|
|
16215
16222
|
try {
|
|
16216
16223
|
let pageId;
|
|
16217
16224
|
if (isOwnedManager) {
|
|
16218
|
-
logger13?.debug(`[BrowseWeb] Starting browser headless=${headless}...`);
|
|
16225
|
+
logger13?.debug(`[BrowseWeb] Starting browser headless=${headless} disableCache=${disableCache}...`);
|
|
16219
16226
|
const result = await manager.startBrowser({
|
|
16220
16227
|
headless,
|
|
16221
|
-
url: url2
|
|
16228
|
+
url: url2,
|
|
16229
|
+
disableCache
|
|
16222
16230
|
});
|
|
16223
16231
|
pageId = result.pageId;
|
|
16224
16232
|
logger13?.debug(`[BrowseWeb] Browser started pageId=${pageId}`);
|
|
@@ -15,6 +15,8 @@ export interface StartBrowserOptions {
|
|
|
15
15
|
proxy?: ProxyOptions;
|
|
16
16
|
/** Auto-detect timezone/locale from proxy IP */
|
|
17
17
|
geoip?: boolean;
|
|
18
|
+
/** Disable browser cache to reduce memory usage */
|
|
19
|
+
disableCache?: boolean;
|
|
18
20
|
}
|
|
19
21
|
export interface StartBrowserResult {
|
|
20
22
|
browserId: string;
|
|
@@ -29,6 +29,7 @@ declare const Dhalsim_base: new () => {
|
|
|
29
29
|
model: z.ZodOptional<z.ZodString>;
|
|
30
30
|
headless: z.ZodOptional<z.ZodBoolean>;
|
|
31
31
|
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
disableCache: z.ZodOptional<z.ZodBoolean>;
|
|
32
33
|
}, z.core.$strip>;
|
|
33
34
|
name: string | undefined;
|
|
34
35
|
timeoutMs: number | undefined;
|
|
@@ -39,6 +40,7 @@ declare const Dhalsim_base: new () => {
|
|
|
39
40
|
model?: string | undefined;
|
|
40
41
|
headless?: boolean | undefined;
|
|
41
42
|
timeoutMs?: number | undefined;
|
|
43
|
+
disableCache?: boolean | undefined;
|
|
42
44
|
}>[] | undefined;
|
|
43
45
|
readonly params: {
|
|
44
46
|
task: string;
|
|
@@ -47,6 +49,7 @@ declare const Dhalsim_base: new () => {
|
|
|
47
49
|
model?: string | undefined;
|
|
48
50
|
headless?: boolean | undefined;
|
|
49
51
|
timeoutMs?: number | undefined;
|
|
52
|
+
disableCache?: boolean | undefined;
|
|
50
53
|
};
|
|
51
54
|
execute(params: Record<string, unknown>, ctx?: ExecutionContext): import("llmist").GadgetExecuteReturn | Promise<import("llmist").GadgetExecuteReturn>;
|
|
52
55
|
throwIfAborted(ctx?: ExecutionContext): void;
|
|
@@ -66,6 +69,7 @@ declare const Dhalsim_base: new () => {
|
|
|
66
69
|
model?: string | undefined;
|
|
67
70
|
headless?: boolean | undefined;
|
|
68
71
|
timeoutMs?: number | undefined;
|
|
72
|
+
disableCache?: boolean | undefined;
|
|
69
73
|
};
|
|
70
74
|
};
|
|
71
75
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dhalsim",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "Browser automation for llmist agents using Camoufox anti-detect browser",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"bun-types": "^1.3.2",
|
|
99
99
|
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
100
100
|
"lefthook": "^1.6.0",
|
|
101
|
-
"llmist": "
|
|
101
|
+
"llmist": "^10.0.0",
|
|
102
102
|
"semantic-release": "^25.0.2",
|
|
103
103
|
"typescript": "^5.4.5",
|
|
104
104
|
"vitest": "^4.0.15"
|