@hasna/browser 0.2.6 → 0.3.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/dist/cli/commands/browse.d.ts +3 -0
- package/dist/cli/commands/browse.d.ts.map +1 -0
- package/dist/cli/commands/script.d.ts +3 -0
- package/dist/cli/commands/script.d.ts.map +1 -0
- package/dist/cli/commands/session.d.ts +3 -0
- package/dist/cli/commands/session.d.ts.map +1 -0
- package/dist/cli/commands/tools.d.ts +3 -0
- package/dist/cli/commands/tools.d.ts.map +1 -0
- package/dist/cli/index.js +21946 -21616
- package/dist/db/scripts.d.ts +84 -0
- package/dist/db/scripts.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/lib/ai-inference.d.ts +21 -0
- package/dist/lib/ai-inference.d.ts.map +1 -0
- package/dist/lib/script-engine.d.ts +28 -0
- package/dist/lib/script-engine.d.ts.map +1 -0
- package/dist/mcp/actions.d.ts +3 -0
- package/dist/mcp/actions.d.ts.map +1 -0
- package/dist/mcp/capture.d.ts +3 -0
- package/dist/mcp/capture.d.ts.map +1 -0
- package/dist/mcp/data.d.ts +3 -0
- package/dist/mcp/data.d.ts.map +1 -0
- package/dist/mcp/helpers.d.ts +55 -0
- package/dist/mcp/helpers.d.ts.map +1 -0
- package/dist/mcp/index.js +19355 -19104
- package/dist/mcp/meta.d.ts +3 -0
- package/dist/mcp/meta.d.ts.map +1 -0
- package/dist/mcp/network.d.ts +3 -0
- package/dist/mcp/network.d.ts.map +1 -0
- package/dist/mcp/recordings.d.ts +3 -0
- package/dist/mcp/recordings.d.ts.map +1 -0
- package/dist/mcp/scripts.d.ts +3 -0
- package/dist/mcp/scripts.d.ts.map +1 -0
- package/dist/mcp/sessions.d.ts +3 -0
- package/dist/mcp/sessions.d.ts.map +1 -0
- package/dist/server/index.js +44 -0
- package/package.json +1 -1
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scripts CRUD — SQLite storage for automation scripts, steps, and run history.
|
|
3
|
+
*/
|
|
4
|
+
export interface Script {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
domain: string;
|
|
8
|
+
description: string;
|
|
9
|
+
variables: Record<string, string>;
|
|
10
|
+
created_at: string;
|
|
11
|
+
updated_at: string;
|
|
12
|
+
last_run: string | null;
|
|
13
|
+
run_count: number;
|
|
14
|
+
}
|
|
15
|
+
export interface ScriptStep {
|
|
16
|
+
id: string;
|
|
17
|
+
script_id: string;
|
|
18
|
+
step_order: number;
|
|
19
|
+
type: string;
|
|
20
|
+
config: Record<string, unknown>;
|
|
21
|
+
description: string;
|
|
22
|
+
ai_enabled: boolean;
|
|
23
|
+
ai_config: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
export interface ScriptRun {
|
|
26
|
+
id: string;
|
|
27
|
+
script_id: string;
|
|
28
|
+
status: "running" | "completed" | "failed";
|
|
29
|
+
current_step: number;
|
|
30
|
+
total_steps: number;
|
|
31
|
+
current_description: string;
|
|
32
|
+
variables: Record<string, string>;
|
|
33
|
+
steps_log: Array<{
|
|
34
|
+
step: number;
|
|
35
|
+
type: string;
|
|
36
|
+
description: string;
|
|
37
|
+
status: string;
|
|
38
|
+
duration_ms?: number;
|
|
39
|
+
error?: string;
|
|
40
|
+
}>;
|
|
41
|
+
errors: string[];
|
|
42
|
+
started_at: string;
|
|
43
|
+
completed_at: string | null;
|
|
44
|
+
duration_ms: number | null;
|
|
45
|
+
}
|
|
46
|
+
export declare function createScript(data: {
|
|
47
|
+
name: string;
|
|
48
|
+
domain?: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
variables?: Record<string, string>;
|
|
51
|
+
steps: Array<{
|
|
52
|
+
type: string;
|
|
53
|
+
config: Record<string, unknown>;
|
|
54
|
+
description?: string;
|
|
55
|
+
ai_enabled?: boolean;
|
|
56
|
+
ai_config?: Record<string, unknown>;
|
|
57
|
+
}>;
|
|
58
|
+
}): Script;
|
|
59
|
+
export declare function upsertScript(data: {
|
|
60
|
+
name: string;
|
|
61
|
+
domain?: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
variables?: Record<string, string>;
|
|
64
|
+
steps: Array<{
|
|
65
|
+
type: string;
|
|
66
|
+
config: Record<string, unknown>;
|
|
67
|
+
description?: string;
|
|
68
|
+
ai_enabled?: boolean;
|
|
69
|
+
ai_config?: Record<string, unknown>;
|
|
70
|
+
}>;
|
|
71
|
+
}): Script;
|
|
72
|
+
export declare function getScript(id: string): Script | null;
|
|
73
|
+
export declare function getScriptByName(name: string): Script | null;
|
|
74
|
+
export declare function listScripts(): Script[];
|
|
75
|
+
export declare function deleteScript(id: string): boolean;
|
|
76
|
+
export declare function deleteScriptByName(name: string): boolean;
|
|
77
|
+
export declare function getSteps(scriptId: string): ScriptStep[];
|
|
78
|
+
export declare function startRun(scriptId: string, totalSteps: number): ScriptRun;
|
|
79
|
+
export declare function updateRunProgress(runId: string, step: number, description: string, stepsLog: any[], variables: Record<string, string>): void;
|
|
80
|
+
export declare function completeRun(runId: string, status: "completed" | "failed", errors: string[], durationMs: number): void;
|
|
81
|
+
export declare function getRun(runId: string): ScriptRun | null;
|
|
82
|
+
export declare function listRuns(scriptId?: string): ScriptRun[];
|
|
83
|
+
export declare function migrateJsonScripts(): number;
|
|
84
|
+
//# sourceMappingURL=scripts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scripts.d.ts","sourceRoot":"","sources":["../../src/db/scripts.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAA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AAU,EAAE,CASvD;AAID,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,CAOxE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAK5I;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAWrH;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAUtD;AAED,wBAAgB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,CAWvD;AAID,wBAAgB,kBAAkB,IAAI,MAAM,CAiD3C"}
|
package/dist/index.js
CHANGED
|
@@ -381,6 +381,50 @@ function runMigrations(db) {
|
|
|
381
381
|
);
|
|
382
382
|
CREATE INDEX IF NOT EXISTS idx_api_endpoints_session ON api_endpoints(session_id);
|
|
383
383
|
`
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
version: 9,
|
|
387
|
+
sql: `
|
|
388
|
+
CREATE TABLE IF NOT EXISTS scripts (
|
|
389
|
+
id TEXT PRIMARY KEY,
|
|
390
|
+
name TEXT NOT NULL UNIQUE,
|
|
391
|
+
domain TEXT NOT NULL DEFAULT '',
|
|
392
|
+
description TEXT DEFAULT '',
|
|
393
|
+
variables TEXT NOT NULL DEFAULT '{}',
|
|
394
|
+
created_at TEXT DEFAULT (datetime('now')),
|
|
395
|
+
updated_at TEXT DEFAULT (datetime('now')),
|
|
396
|
+
last_run TEXT,
|
|
397
|
+
run_count INTEGER DEFAULT 0
|
|
398
|
+
);
|
|
399
|
+
|
|
400
|
+
CREATE TABLE IF NOT EXISTS script_steps (
|
|
401
|
+
id TEXT PRIMARY KEY,
|
|
402
|
+
script_id TEXT NOT NULL REFERENCES scripts(id) ON DELETE CASCADE,
|
|
403
|
+
step_order INTEGER NOT NULL,
|
|
404
|
+
type TEXT NOT NULL,
|
|
405
|
+
config TEXT NOT NULL DEFAULT '{}',
|
|
406
|
+
description TEXT DEFAULT '',
|
|
407
|
+
ai_enabled INTEGER DEFAULT 0,
|
|
408
|
+
ai_config TEXT DEFAULT '{}'
|
|
409
|
+
);
|
|
410
|
+
CREATE INDEX IF NOT EXISTS idx_script_steps_order ON script_steps(script_id, step_order);
|
|
411
|
+
|
|
412
|
+
CREATE TABLE IF NOT EXISTS script_runs (
|
|
413
|
+
id TEXT PRIMARY KEY,
|
|
414
|
+
script_id TEXT NOT NULL REFERENCES scripts(id) ON DELETE CASCADE,
|
|
415
|
+
status TEXT NOT NULL DEFAULT 'running',
|
|
416
|
+
current_step INTEGER DEFAULT 0,
|
|
417
|
+
total_steps INTEGER DEFAULT 0,
|
|
418
|
+
current_description TEXT DEFAULT '',
|
|
419
|
+
variables TEXT DEFAULT '{}',
|
|
420
|
+
steps_log TEXT DEFAULT '[]',
|
|
421
|
+
errors TEXT DEFAULT '[]',
|
|
422
|
+
started_at TEXT DEFAULT (datetime('now')),
|
|
423
|
+
completed_at TEXT,
|
|
424
|
+
duration_ms INTEGER
|
|
425
|
+
);
|
|
426
|
+
CREATE INDEX IF NOT EXISTS idx_script_runs_script ON script_runs(script_id, status);
|
|
427
|
+
`
|
|
384
428
|
}
|
|
385
429
|
];
|
|
386
430
|
for (const m of migrations) {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified AI inference layer — single function for all LLM calls in open-browser.
|
|
3
|
+
* Cerebras by default (fastest), Anthropic as fallback.
|
|
4
|
+
*/
|
|
5
|
+
export interface InferOptions {
|
|
6
|
+
provider?: "cerebras" | "anthropic";
|
|
7
|
+
model?: string;
|
|
8
|
+
maxTokens?: number;
|
|
9
|
+
temperature?: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Send a prompt to an LLM and get a text response.
|
|
13
|
+
* Default: Cerebras llama-4-scout (fastest inference available).
|
|
14
|
+
*/
|
|
15
|
+
export declare function infer(prompt: string, opts?: InferOptions): Promise<string>;
|
|
16
|
+
/**
|
|
17
|
+
* Send a prompt and parse the response as JSON.
|
|
18
|
+
* Strips markdown code fences before parsing.
|
|
19
|
+
*/
|
|
20
|
+
export declare function inferJSON<T = unknown>(prompt: string, opts?: InferOptions): Promise<T>;
|
|
21
|
+
//# sourceMappingURL=ai-inference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-inference.d.ts","sourceRoot":"","sources":["../../src/lib/ai-inference.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAkBD;;;GAGG;AACH,wBAAsB,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BhF;AAED;;;GAGG;AACH,wBAAsB,SAAS,CAAC,CAAC,GAAG,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,CAI5F"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Script execution engine — runs automation scripts with native AI integration.
|
|
3
|
+
*
|
|
4
|
+
* AI is not a separate step type — it's a capability woven into every step:
|
|
5
|
+
* - Browser steps: AI self-heals when selectors fail (vision + LLM)
|
|
6
|
+
* - Connector steps: AI parses responses when ai_enabled
|
|
7
|
+
* - Extract steps: always AI-powered (prompt-based, no regex)
|
|
8
|
+
*/
|
|
9
|
+
import type { Page } from "playwright";
|
|
10
|
+
export interface RunResult {
|
|
11
|
+
run_id: string;
|
|
12
|
+
success: boolean;
|
|
13
|
+
steps_executed: number;
|
|
14
|
+
steps_failed: number;
|
|
15
|
+
errors: string[];
|
|
16
|
+
duration_ms: number;
|
|
17
|
+
variables: Record<string, string>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Run a script asynchronously. Returns run_id immediately.
|
|
21
|
+
* Poll with getRun(run_id) for progress.
|
|
22
|
+
*/
|
|
23
|
+
export declare function executeScript(scriptId: string, page: Page, overrides?: Record<string, string>): string;
|
|
24
|
+
/**
|
|
25
|
+
* Run a script synchronously. Returns full result.
|
|
26
|
+
*/
|
|
27
|
+
export declare function executeScriptSync(scriptId: string, page: Page, overrides?: Record<string, string>): Promise<RunResult>;
|
|
28
|
+
//# sourceMappingURL=script-engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"script-engine.d.ts","sourceRoot":"","sources":["../../src/lib/script-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAMvC,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAsBD;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,IAAI,EACV,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GACrC,MAAM,CAUR;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,IAAI,EACV,SAAS,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GACrC,OAAO,CAAC,SAAS,CAAC,CAIpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../src/mcp/actions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA2CzE,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,QAkhBzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/mcp/capture.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA6BzE,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,QAodzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/mcp/data.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,QAIzC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export { z } from "zod";
|
|
2
|
+
export { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
export { createSession, closeSession, getSession, listSessions, getSessionPage, getSessionByName, renameSession, setSessionPage, getTokenBudget, getSessionBunView, isBunSession, getActiveSessionForAgent, getDefaultSession, countActiveSessions, isAutoGallery, } from "../lib/session.js";
|
|
4
|
+
export { navigate, click, type as typeText, fill, scroll, hover, selectOption, checkBox, uploadFile, goBack, goForward, reload, waitForSelector, pressKey, clickText, fillForm, waitForText, watchPage, getWatchChanges, stopWatch, clickRef, typeRef, fillRef, selectRef, checkRef, hoverRef, } from "../lib/actions.js";
|
|
5
|
+
export { getText, getHTML, getLinks, getTitle, getUrl, extract, extractStructured, extractTable, getAriaSnapshot, findElements, elementExists, getPageInfo, } from "../lib/extractor.js";
|
|
6
|
+
export { takeScreenshot, generatePDF } from "../lib/screenshot.js";
|
|
7
|
+
export { enableNetworkLogging, addInterceptRule, clearInterceptRules, startHAR } from "../lib/network.js";
|
|
8
|
+
export { getPerformanceMetrics, startCoverage } from "../lib/performance.js";
|
|
9
|
+
export { enableConsoleCapture } from "../lib/console.js";
|
|
10
|
+
export { getCookies, setCookie, clearCookies, getLocalStorage, setLocalStorage, getSessionStorage, setSessionStorage, } from "../lib/storage.js";
|
|
11
|
+
export { startRecording, stopRecording, replayRecording, recordStep } from "../lib/recorder.js";
|
|
12
|
+
export { crawl } from "../lib/crawler.js";
|
|
13
|
+
export { registerAgent, heartbeat, listAgents, getAgent } from "../lib/agents.js";
|
|
14
|
+
export { ensureProject, listProjects, getProjectByName } from "../db/projects.js";
|
|
15
|
+
export { getNetworkLog } from "../db/network-log.js";
|
|
16
|
+
export { getConsoleLog } from "../db/console-log.js";
|
|
17
|
+
export { listEntries, getEntry, tagEntry, untagEntry, favoriteEntry, deleteEntry, searchEntries, getGalleryStats, } from "../db/gallery.js";
|
|
18
|
+
export { saveToDownloads, listDownloads, getDownload, deleteDownload, cleanStaleDownloads, exportToPath } from "../lib/downloads.js";
|
|
19
|
+
export { diffImages } from "../lib/gallery-diff.js";
|
|
20
|
+
export { takeSnapshot as takeSnapshotFn, diffSnapshots, getLastSnapshot, setLastSnapshot } from "../lib/snapshot.js";
|
|
21
|
+
export { persistFile } from "../lib/files-integration.js";
|
|
22
|
+
export { listRecordings, getRecording } from "../db/recordings.js";
|
|
23
|
+
export { logEvent, getTimeline } from "../db/timeline.js";
|
|
24
|
+
export { newTab, listTabs, switchTab, closeTab } from "../lib/tabs.js";
|
|
25
|
+
export { getDialogs, handleDialog } from "../lib/dialogs.js";
|
|
26
|
+
export { saveProfile, loadProfile, applyProfile, listProfiles as listProfilesFn, deleteProfile, } from "../lib/profiles.js";
|
|
27
|
+
export { UseCase, BrowserError } from "../types/index.js";
|
|
28
|
+
export type { BrowserEngine } from "../types/index.js";
|
|
29
|
+
export declare const networkLogCleanup: Map<string, () => void>;
|
|
30
|
+
export declare const consoleCaptureCleanup: Map<string, () => void>;
|
|
31
|
+
export declare const harCaptures: Map<string, import("../index.js").HARCapture>;
|
|
32
|
+
export declare function json(data: unknown): {
|
|
33
|
+
content: {
|
|
34
|
+
type: "text";
|
|
35
|
+
text: string;
|
|
36
|
+
}[];
|
|
37
|
+
};
|
|
38
|
+
export declare function err(e: unknown): {
|
|
39
|
+
content: {
|
|
40
|
+
type: "text";
|
|
41
|
+
text: string;
|
|
42
|
+
}[];
|
|
43
|
+
isError: true;
|
|
44
|
+
};
|
|
45
|
+
/** Like err() but attempts to capture a screenshot for context. */
|
|
46
|
+
export declare function errWithScreenshot(e: unknown, sessionId?: string): Promise<{
|
|
47
|
+
content: {
|
|
48
|
+
type: "text";
|
|
49
|
+
text: string;
|
|
50
|
+
}[];
|
|
51
|
+
isError: true;
|
|
52
|
+
}>;
|
|
53
|
+
/** Resolve session_id: use explicit value, or auto-select the single active session. */
|
|
54
|
+
export declare function resolveSessionId(sessionId?: string): string;
|
|
55
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/mcp/helpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,EACL,aAAa,EACb,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,wBAAwB,EACxB,iBA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