@wenathlan/saddle 1.8.2 → 1.8.5
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 +9 -9
- package/browser/playwright.js +22 -0
- package/docs/.gitkeep +0 -0
- package/docs/gapmatrix.md +3 -3
- package/docs/libraryapi.md +1 -0
- package/docs/logs/.gitkeep +0 -0
- package/docs/packageaudit185.md +23 -0
- package/docs/plans/00.index.md +50 -0
- package/docs/plans/01.architecture.md +86 -0
- package/docs/plans/02.research.computer.use.md +58 -0
- package/docs/plans/03.research.captcha.bypass.md +68 -0
- package/docs/plans/04.research.sandbox.ai.md +52 -0
- package/docs/plans/05.capture.platform.md +57 -0
- package/docs/plans/06.dependencies.md +97 -0
- package/docs/plans/07.captcha.test.page.md +41 -0
- package/docs/plans/08.production.infra.md +70 -0
- package/docs/plans/09.database.schema.md +121 -0
- package/docs/plans/10.cloudinary.storage.md +57 -0
- package/docs/plans/11.movement.logs.json.md +72 -0
- package/docs/plans/12.research.atlas.agent.browser.md +79 -0
- package/docs/plans/13.research.anti.detection.md +898 -0
- package/docs/plans/14.research.proxy.md +1495 -0
- package/docs/plans/15.research.retry.rate.limit.md +1958 -0
- package/docs/plans/16.research.crawling.md +1417 -0
- package/docs/plans/17.research.caching.md +1610 -0
- package/docs/plans/18.research.content.extraction.md +1952 -0
- package/docs/plans/19.research.errors.events.md +1523 -0
- package/docs/plans/20.research.zod.validation.md +1350 -0
- package/docs/plans/21.research.batch.concurrency.md +1888 -0
- package/docs/plans/22.research.universal.runtime.md +944 -0
- package/docs/plans/23.research.ai.integration.md +1465 -0
- package/docs/plans/24.research.memory.persistence.md +1979 -0
- package/docs/plans/25.research.server.api.md +342 -0
- package/docs/plans/26.research.compilation.md +249 -0
- package/docs/plans/27.research.html.parsing.md +251 -0
- package/docs/plans/28.action.plan.md +50 -0
- package/docs/plans/29.api.reference.md +174 -0
- package/docs/plans/30.architecture.plan.md +94 -0
- package/docs/plans/31.auditoria.dados.md +163 -0
- package/docs/plans/32.bots.automacao.computacional.md +214 -0
- package/docs/plans/33.bots.codigo.revisao.md +220 -0
- package/docs/plans/34.bots.seguranca.cicd.md +366 -0
- package/docs/plans/35.comparativo.concorrencia.md +464 -0
- package/docs/plans/36.computational.memory.md +340 -0
- package/docs/plans/37.deploystrategy.md +394 -0
- package/docs/plans/38.flow.md +155 -0
- package/docs/plans/39.multi.platform.bot.md +252 -0
- package/docs/plans/40.npm.publish.md +250 -0
- package/docs/plans/41.o.que.falta.md +407 -0
- package/docs/plans/42.pesquisa.concorrencia.md +721 -0
- package/docs/plans/43.plan.universal.architecture.md +496 -0
- package/docs/plans/44.reference.md +100 -0
- package/docs/plans/45.robotarchitecture.md +237 -0
- package/docs/plans/46.scdnintegration.md +284 -0
- package/docs/plans/47.multiforge.readme.md +129 -0
- package/docs/plans/48.theory.v4.repo.os.md +152 -0
- package/docs/plans/49.third.party.infra.md +12 -0
- package/docs/plans/50.file.as.compute.md +39 -0
- package/docs/plans/51.architecture.virtual.processor.md +80 -0
- package/docs/plans/52.manifesto.v8.md +11 -0
- package/docs/plans/58.cdn.list.md +23 -0
- package/docs/plans/59.sql.frameworks.md +33 -0
- package/docs/plans/60.sql.thirdparty.md +26 -0
- package/docs/plans/61.objective.multiforge.md +63 -0
- package/docs/plans/62.huggingface.upload.md +26 -0
- package/docs/plans/63.kaggle.upload.md +24 -0
- package/docs/plans/64.npm.storage.md +30 -0
- package/docs/plans/65.rclone.terabox.md +32 -0
- package/docs/plans/66.buckets.and.models.todo.md +14 -0
- package/docs/plans/67.database.todo.md +13 -0
- package/docs/plans/68.deploy.packages.todo.md +12 -0
- package/docs/plans/69.report.human.operator.md +133 -0
- package/docs/plans/70.report.brain2qwerty.ems.md +135 -0
- package/docs/plans/71.report.hd.infinito.vram.md +155 -0
- package/docs/plans/72.plan.hd.infinito.node.md +146 -0
- package/docs/plans/73.plan.scifi.repos.md +125 -0
- package/docs/plans/74.000.manifesto.v8.flat.2..md +11 -0
- package/docs/plans/README.md +489 -0
- package/docs/plans/aggregate_platforms.mjs +146 -0
- package/docs/plans/examplesession.json +36 -0
- package/docs/plans/missing-facts.md +192 -0
- package/docs/plans/models.md +64 -0
- package/docs/plans/organize.cjs +270 -0
- package/docs/plans/platforms.md +2887 -0
- package/docs/plans/sites.md +31322 -0
- package/docs/platformpipelineaudit.md +18 -0
- package/docs/platformpipelines.md +13 -0
- package/docs/registryresearch.md +4 -0
- package/docs/release.md +4 -4
- package/docs/release182notes.md +2 -0
- package/docs/release184notes.md +7 -0
- package/docs/release185notes.md +7 -0
- package/docs/sources/farm.py +117 -0
- package/docs/sources/html/saddle1.html +132 -0
- package/docs/sources/html/saddle2.html +157 -0
- package/docs/sources/html/saddle3.html +119 -0
- package/docs/sources/html/saddle4.html +144 -0
- package/docs/sources/html/saddle5.html +72 -0
- package/docs/sources/html/saddle6.html +171 -0
- package/docs/sources/html/saddle7.html +236 -0
- package/docs/sources/saddle.ts +74 -0
- package/docs/sources/schema.prisma +88 -0
- package/docs/sources/script.sh +64 -0
- package/docs/sources/workflows.yml +458 -0
- package/docs/talks1/_body.txt +14 -0
- package/docs/talks1/_index.md +15 -0
- package/docs/talks1/_screenshot.png +0 -0
- package/docs/talks1/assistant-01.md +5 -0
- package/docs/talks1/assistant-02.md +5 -0
- package/docs/talks1/assistant-03.md +531 -0
- package/docs/talks1/assistant-04.md +26 -0
- package/docs/talks1/assistant-05.md +774 -0
- package/docs/talks1/assistant-06.md +1718 -0
- package/docs/talks1/scrape-share.cjs +185 -0
- package/docs/talks1/scrape-share.ts +183 -0
- package/docs/talks1/user-01.md +3 -0
- package/docs/talks1/user-02.md +3 -0
- package/docs/talks1/user-03.md +88 -0
- package/docs/talks1/user-04.md +3 -0
- package/docs/talks1/user-05.md +3 -0
- package/docs/talks1/user-06.md +88 -0
- package/docs/talks1/user-07.md +88 -0
- package/docs/talks2/_body.txt +14 -0
- package/docs/talks2/_index.md +16 -0
- package/docs/talks2/_screenshot.png +0 -0
- package/docs/talks2/assistant-01.md +5 -0
- package/docs/talks2/assistant-02.md +5 -0
- package/docs/talks2/assistant-03.md +424 -0
- package/docs/talks2/assistant-04.md +598 -0
- package/docs/talks2/assistant-05.md +1280 -0
- package/docs/talks2/assistant-06.md +1227 -0
- package/docs/talks2/assistant-07.md +1252 -0
- package/docs/talks2/user-01.md +3 -0
- package/docs/talks2/user-02.md +3 -0
- package/docs/talks2/user-03.md +88 -0
- package/docs/talks2/user-04.md +88 -0
- package/docs/talks2/user-05.md +88 -0
- package/docs/talks2/user-06.md +88 -0
- package/docs/talks2/user-07.md +3 -0
- package/docs/talks3/_body.txt +467 -0
- package/docs/talks3/_index.md +10 -0
- package/docs/talks3/_screenshot.png +0 -0
- package/docs/talks3/assistant-01.md +417 -0
- package/docs/talks3/assistant-02.md +417 -0
- package/docs/talks3/assistant-03.md +29 -0
- package/docs/talks3/assistant-04.md +727 -0
- package/docs/talks3/user-01.md +88 -0
- package/docs/talks3/user-02.md +88 -0
- package/docs/talks3/user-03.md +3 -0
- package/docs/talks3/user-04.md +3 -0
- package/docs/talks4/_body.txt +14 -0
- package/docs/talks4/_index.md +12 -0
- package/docs/talks4/_screenshot.png +0 -0
- package/docs/talks4/assistant-01.md +5 -0
- package/docs/talks4/assistant-02.md +5 -0
- package/docs/talks4/assistant-03.md +35 -0
- package/docs/talks4/assistant-04.md +512 -0
- package/docs/talks4/assistant-05.md +599 -0
- package/docs/talks4/user-01.md +3 -0
- package/docs/talks4/user-02.md +3 -0
- package/docs/talks4/user-03.md +88 -0
- package/docs/talks4/user-04.md +88 -0
- package/docs/talks4/user-05.md +7 -0
- package/docs/talks5/_body.txt +14 -0
- package/docs/talks5/_index.md +13 -0
- package/docs/talks5/_screenshot.png +0 -0
- package/docs/talks5/assistant-01.md +5 -0
- package/docs/talks5/assistant-02.md +5 -0
- package/docs/talks5/assistant-03.md +690 -0
- package/docs/talks5/assistant-04.md +758 -0
- package/docs/talks5/assistant-05.md +974 -0
- package/docs/talks5/user-01.md +3 -0
- package/docs/talks5/user-02.md +3 -0
- package/docs/talks5/user-03.md +105 -0
- package/docs/talks5/user-04.md +105 -0
- package/docs/talks5/user-05.md +63 -0
- package/docs/talks5/user-06.md +105 -0
- package/docs/talks6/_body.txt +14 -0
- package/docs/talks6/_index.md +9 -0
- package/docs/talks6/_screenshot.png +0 -0
- package/docs/talks6/assistant-01.md +5 -0
- package/docs/talks6/assistant-02.md +5 -0
- package/docs/talks6/assistant-03.md +1499 -0
- package/docs/talks6/user-01.md +3 -0
- package/docs/talks6/user-02.md +3 -0
- package/docs/talks6/user-03.md +88 -0
- package/docs/talks6/user-04.md +88 -0
- package/docs/talks7/_body.txt +14 -0
- package/docs/talks7/_index.md +10 -0
- package/docs/talks7/_screenshot.png +0 -0
- package/docs/talks7/assistant-01.md +5 -0
- package/docs/talks7/assistant-02.md +5 -0
- package/docs/talks7/assistant-03.md +523 -0
- package/docs/talks7/assistant-04.md +617 -0
- package/docs/talks7/user-01.md +3 -0
- package/docs/talks7/user-02.md +3 -0
- package/docs/talks7/user-03.md +105 -0
- package/docs/talks7/user-04.md +67 -0
- package/docs/talks8/conversa1.txt +1322 -0
- package/docs/talks8/conversa2.txt +237 -0
- package/docs/talks9/Beyond the Obvious_ 50 Plataformas Auto-Hospedadas de Forja de C/303/263digo para Al/303/251m de Gitea e GitLab.md" +174 -0
- package/docs/talks9/De NPM a Multi-Linguagem_ Uma Arquitetura T/303/251cnica para a Execu/303/247/303/243o Integrada de C/303/263digo no Ecossistema Node.js.md" +59 -0
- package/docs/talks9/De NPM a VMs Virtuais_ Uma An/303/241lise Arquitet/303/264nica para a Realiza/303/247/303/243o do Ciclo de Vida do Projeto SADDLE.md" +91 -0
- package/docs/talks9/Mapeamento da Engrenagem Computacional_ Uma Arquitetura para Execu/303/247/303/243o Isolada e Persist/303/252ncia em Ambientes Distribu/303/255dos.md" +116 -0
- package/docs/talks9/O Cen/303/241rio Pr/303/241tico do SADDLE_ Uma An/303/241lise de Viabilidade e Modelo de Ciclo de Vida Integrado.md" +128 -0
- package/docs/talks9/README (2).md +489 -0
- package/docs/talks9/README.md +198 -0
- package/docs/talks9/Viabilidade do Saddle_ Uma An/303/241lise T/303/251cnica da Transforma/303/247/303/243o de Armazenamento Remoto em Mem/303/263ria Computacional.md" +80 -0
- package/docs/talks9/conversa.txt +544 -0
- package/docs/talks9/other (2).md +39 -0
- package/docs/talks9/other.md +57 -0
- package/docs/talks9/outro.txt +24 -0
- package/extension/README.md +3 -3
- package/extension/serviceworker.js +63 -4
- package/extension/worker.js +3 -1
- package/package.json +12 -2
- package/packager/manifest.js +1 -1
- package/scrape/agent.ts +122 -0
- package/scrape/batch.ts +79 -0
- package/scrape/biome.json +76 -0
- package/scrape/browser.ts +222 -0
- package/scrape/cache.ts +84 -0
- package/scrape/chunking.ts +193 -0
- package/scrape/cli.ts +105 -0
- package/scrape/crawler.ts +115 -0
- package/scrape/dev-server.ts +94 -0
- package/scrape/errors.ts +132 -0
- package/scrape/events.ts +26 -0
- package/scrape/extract.ts +165 -0
- package/scrape/fetch.ts +105 -0
- package/scrape/formats.ts +85 -0
- package/scrape/headers.ts +71 -0
- package/scrape/index.ts +92 -0
- package/scrape/jsdom.d.ts +6 -0
- package/scrape/llms-txt.ts +84 -0
- package/scrape/middleware.ts +90 -0
- package/scrape/package-lock.json +9397 -0
- package/scrape/package.json +1420 -0
- package/scrape/pool.ts +95 -0
- package/scrape/port.ts +18 -0
- package/scrape/proxy.ts +103 -0
- package/scrape/rate-limiter.ts +95 -0
- package/scrape/renderer.ts +194 -0
- package/scrape/retry.ts +64 -0
- package/scrape/robots.ts +137 -0
- package/scrape/scrape.ts +123 -0
- package/scrape/serialize.ts +310 -0
- package/scrape/server.ts +137 -0
- package/scrape/session.ts +109 -0
- package/scrape/sitemap.ts +131 -0
- package/scrape/tokens.ts +45 -0
- package/scrape/tsconfig.json +28 -0
- package/scrape/types.ts +214 -0
- package/scrape/utils.ts +77 -0
- package/scrape/vite.config.ts +55 -0
- package/scrape/vitest.config.ts +17 -0
- package/workflow/templates.js +4 -4
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<strong>Storage-backed jobs, scraping contracts and portable runners for Node.js.</strong><br/>
|
|
9
9
|
<strong>Binary computing agent, agent browser, computer-use, scraper and packager.</strong><br/>
|
|
10
10
|
<a href="https://github.com/wenathlan/saddle/actions/workflows/ci.yml"><img src="https://github.com/wenathlan/saddle/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
|
|
11
|
-
<a href="https://github.com/wenathlan/saddle/releases/tag/v1.8.
|
|
11
|
+
<a href="https://github.com/wenathlan/saddle/releases/tag/v1.8.4"><img src="https://img.shields.io/badge/release-v1.8.4-d35d3d" alt="Release 1.8.4" /></a>
|
|
12
12
|
<a href="https://github.com/wenathlan/saddle/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-GPL--3.0-202a2f" alt="GPL 3.0 license" /></a>
|
|
13
13
|
</p>
|
|
14
14
|
|
|
@@ -109,7 +109,7 @@ The caller still chooses how to provide `fetcher`, browser transport, persistenc
|
|
|
109
109
|
|
|
110
110
|
## Browser extension
|
|
111
111
|
|
|
112
|
-
Version 1.8.
|
|
112
|
+
Version 1.8.4 includes a pure JavaScript Manifest V3 reference surface in [`extension/`](extension/). It is deliberately narrow: the user invokes the action, the popup sends a versioned command, the service worker routes it, and an isolated content bridge returns bounded page metadata, visible text or a user initiated action result. The exported `permissionpolicy` keeps base permissions minimal and makes optional escalation caller-owned.
|
|
113
113
|
|
|
114
114
|
```bash
|
|
115
115
|
# load the unpacked extension from chrome://extensions
|
|
@@ -145,12 +145,12 @@ saddle mcp
|
|
|
145
145
|
|
|
146
146
|
| Registry | Artifact | Workflow | Status |
|
|
147
147
|
| --- | --- | --- | --- |
|
|
148
|
-
| GitHub npm | `@wenathlan/saddle@1.8.
|
|
149
|
-
| GHCR | `ghcr.io/wenathlan/saddle:1.8.
|
|
150
|
-
| Maven | `io.wenathlan:saddle:1.8.
|
|
151
|
-
| NuGet | `Saddle.1.8.
|
|
152
|
-
| RubyGems | `saddle 1.8.
|
|
153
|
-
| npmjs | `@wenathlan/saddle@1.8.
|
|
148
|
+
| GitHub npm | `@wenathlan/saddle@1.8.5` | publishgithubnpm.yml | pending release |
|
|
149
|
+
| GHCR | `ghcr.io/wenathlan/saddle:1.8.5` and `latest` | publishghcr.yml | pending release |
|
|
150
|
+
| Maven | `io.wenathlan:saddle:1.8.5` | publishmaven.yml | pending release |
|
|
151
|
+
| NuGet | `Saddle.1.8.5.nupkg` | publishnuget.yml | pending release |
|
|
152
|
+
| RubyGems | `saddle 1.8.5` | publishrubygems.yml | pending release |
|
|
153
|
+
| npmjs | `@wenathlan/saddle@1.8.5` | publishnpmjs.yml | pending release |
|
|
154
154
|
|
|
155
155
|
## Development
|
|
156
156
|
|
|
@@ -188,7 +188,7 @@ Root-based JavaScript ESM layout, no src/ directory, no TypeScript build require
|
|
|
188
188
|
|
|
189
189
|
## Current scope
|
|
190
190
|
|
|
191
|
-
Version 1.8.
|
|
191
|
+
Version 1.8.5 extends the 1.8.4 engine contracts with package metadata for Node.js 26.7.0 and npm 12, an optional Playwright peer, and an explicit Node-only `browser-playwright` adapter. Native runtimes, browser binaries, n8n host registration, provider credentials, persistent databases and production deployment remain caller-selected adapters. The next improvements should extend these contracts without coupling the core to one forge, registry, browser or storage vendor.
|
|
192
192
|
|
|
193
193
|
## License
|
|
194
194
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* browser playwright adapter keeps the optional Node browser provider outside the transport-neutral surface.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/** Creates a caller-owned Playwright browser session when the optional peer is installed. */
|
|
6
|
+
export async function createplaywrightsession(options = {}) {
|
|
7
|
+
let playwright;
|
|
8
|
+
try {
|
|
9
|
+
playwright = await import("playwright");
|
|
10
|
+
} catch (error) {
|
|
11
|
+
const missing = new Error("optional peer dependency 'playwright' is required for the Playwright adapter", { cause: error });
|
|
12
|
+
missing.code = "OPTIONAL_DEPENDENCY_MISSING";
|
|
13
|
+
throw missing;
|
|
14
|
+
}
|
|
15
|
+
const browsername = options.browser ?? "chromium";
|
|
16
|
+
const browsertype = playwright[browsername];
|
|
17
|
+
if (!browsertype || typeof browsertype.launch !== "function") throw new TypeError(`unsupported Playwright browser: ${browsername}`);
|
|
18
|
+
const browser = await browsertype.launch({ headless: options.headless ?? true, ...(options.launch ?? {}) });
|
|
19
|
+
const context = await browser.newContext(options.context ?? {});
|
|
20
|
+
const page = await context.newPage();
|
|
21
|
+
return { browser, context, page, close: () => browser.close() };
|
|
22
|
+
}
|
package/docs/.gitkeep
ADDED
|
File without changes
|
package/docs/gapmatrix.md
CHANGED
|
@@ -16,12 +16,12 @@ This matrix turns the supplied README and conclusions into implementation decisi
|
|
|
16
16
|
| Area | Current state | Gap | Priority | Decision |
|
|
17
17
|
| --- | --- | --- | --- | --- |
|
|
18
18
|
| Root library | Implemented ESM entry point with broad exports | No extension subpath or extension files are shipped | P0 | Add a small `extension/` package surface and export only serializable contracts |
|
|
19
|
-
| Browser agent | Implemented injected action adapter for navigate, click, type, screenshot, DOM, title, scroll and command batches | Vendor-neutral action results and bounded action batches are
|
|
19
|
+
| Browser agent | Implemented injected action adapter for navigate, click, type, screenshot, DOM, title, scroll and command batches | Vendor-neutral action results and bounded action batches are public; optional Playwright provider is isolated behind `browser-playwright` | P1 | Keep the adapter boundary; browser binaries and credentials remain caller-owned |
|
|
20
20
|
| Browser snapshots | Implemented public contract | Snapshot ids, bounded elements, stable refs, stale checks and diffs are covered by deterministic tests | P0 | Reuse the contract from MCP and extension transport |
|
|
21
21
|
| Session replay | Implemented | Replay restores caller-owned window, tab and frame context before actions; context identifiers are validated and counted | P1 | Keep browser selection and restoration in injected adapters |
|
|
22
22
|
| Extension runtime | Surface is only declared in `surfaces/manifest.js` and `surfaces/targets.js` | No Manifest V3 manifest, service worker, content bridge, popup or build artifact | P0 | Implement a pure JavaScript MV3 reference surface with minimal permissions |
|
|
23
23
|
| Extension messaging | Not implemented | No versioned envelope, correlation id, timeout, sender metadata or error response contract | P0 | Add transport-neutral message contracts and Chrome runtime adapter |
|
|
24
|
-
| Service worker resilience |
|
|
24
|
+
| Service worker resilience | Implemented contract slice | Pending command envelopes, attempt metadata and snapshot summaries persist through injected storage; resume remains explicit and user-owned | P0 | Rehydrate metadata on startup and never replay a command without an explicit caller action |
|
|
25
25
|
| Permissions | Contract slice | `permissionpolicy` keeps the base permissions minimal and optional escalation caller-owned | P0 | Start with `storage` and no broad host permissions; make host access caller-configured |
|
|
26
26
|
| Content isolation | Not implemented | No isolated-world DOM bridge or page-to-extension boundary | P0 | Add a narrow content script that reports page facts through the message contract |
|
|
27
27
|
| Task agent | Partial | Jobs, workflows and bot commands exist, but no browser task planner or tool registry | P1 | Reuse workflow, trigger and bot contracts; add browser task commands only after snapshots |
|
|
@@ -29,7 +29,7 @@ This matrix turns the supplied README and conclusions into implementation decisi
|
|
|
29
29
|
| API security | Implemented URL protocol and private hostname/IP checks | Request envelopes, optional authorization, security headers, redirect bounds and injected DNS resolution checks are now available | P0 | Keep credentials caller-owned and reject private or rebinding targets before transport |
|
|
30
30
|
| Apps and bots | Implemented platform adapter, commands, bot and webhook signature contracts | App install/suspend/revoke, command scope checks, idempotency and delivery retry/dead-letter records are now available | P1 | Keep platform tokens and OAuth lifecycle caller-owned |
|
|
31
31
|
| Storage | Implemented local, chunked, S3-compatible, GitHub Contents and file hosting adapters | Range reads, content dedupe, tiered cache, capabilities and conflict-aware sync were missing | P1 | Use the new neutral storage helpers and keep extension storage injected |
|
|
32
|
-
| Queue | Implemented in-memory and
|
|
32
|
+
| Queue | Implemented in-memory, persistent and extension-resumable command contracts | Browser host still owns long-lived queue workers and cancellation policy | P1 | Keep command records serializable and resume explicit through the extension adapter |
|
|
33
33
|
| Remote execution | Implemented provider, scheduler, health, triggers, heartbeat and resumable run contracts | No permissioned extension-to-runner bridge or forge-specific status adapters for every provider | P1 | Require explicit caller-provided endpoint and auth; no default remote host |
|
|
34
34
|
| Scraping | Implemented robots, cache, HTML extraction, schema extraction, scraper and content normalization | Rich document parsers and binary format adapters remain caller-owned | P1 | Keep extraction safe and bounded; add adapters for richer document types |
|
|
35
35
|
| Crawl | Implemented normalized BFS and persistent frontier | Priority and per-domain budget frontier now exist; sitemap refresh remains absent | P1 | Keep frontier state serializable and caller-persistable |
|
package/docs/libraryapi.md
CHANGED
|
@@ -39,6 +39,7 @@ The public API is designed around injected transports. Consumers can use the sam
|
|
|
39
39
|
| `commandguard` | enforce caller-defined bot command scopes |
|
|
40
40
|
| `deliveryqueue` | retry webhook deliveries and retain dead letters |
|
|
41
41
|
| `nodeserver` | expose a Web Request/Response handler through Node HTTP |
|
|
42
|
+
| `@wenathlan/saddle/browser-playwright` | optional Node-only Playwright session adapter; the peer is caller-installed and the root remains vendor-neutral |
|
|
42
43
|
|
|
43
44
|
```js
|
|
44
45
|
import { scrapeurl, formatforagent } from "@wenathlan/saddle";
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# package metadata audit for 1.8.5
|
|
2
|
+
|
|
3
|
+
The attached package manifest was used as a format reference, not as a dependency source. Its large application-oriented dependency graph, TypeScript build paths, workspace references and unrelated command names do not match the Saddle root-based JavaScript ESM library. Copying those entries would increase install cost, introduce unverified runtime coupling and weaken the transport-neutral package boundary.
|
|
4
|
+
|
|
5
|
+
| Field | Decision | Reason |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| `engines` | `node >=26.7.0`, `npm >=10.9.2` | matches the release toolchain and prevents silently testing on the older Node 22 floor |
|
|
8
|
+
| `packageManager` | `npm@12.0.2` | records the current npm major used for the package contract without changing the existing release scripts |
|
|
9
|
+
| `main`, `module`, `browser` | `./index.js` | gives older bundlers and browser-aware tooling a stable hint while `exports` remains authoritative |
|
|
10
|
+
| `sideEffects` | `false` | the exported library modules are contract factories; CLI-only execution is guarded by direct-entry checks |
|
|
11
|
+
| `peerDependencies.playwright` | `^1.62.1`, optional | the new explicit `browser-playwright` adapter dynamically loads a caller-installed provider |
|
|
12
|
+
| `optionalDependencies` | not added | no optional package is required by a current implementation; an empty field would add no behavior |
|
|
13
|
+
| `trustedDependencies` | not added | no install-time package script requires trust escalation; this is not an npm core field |
|
|
14
|
+
| patch metadata | not added | no active dependency patch exists; pnpm 11 no longer reads settings from the `pnpm` field in `package.json` |
|
|
15
|
+
|
|
16
|
+
The root entry remains free of Node-only imports and external runtime imports. The Playwright provider is only reachable through the explicit `./browser-playwright` subpath and is absent from the root transport-neutral graph. Consumers that do not need a browser provider do not need to install Playwright.
|
|
17
|
+
|
|
18
|
+
## References
|
|
19
|
+
|
|
20
|
+
1. [npm package.json documentation](https://docs.npmjs.com/cli/v12/configuring-npm/package-json/)
|
|
21
|
+
2. [pnpm package.json documentation](https://pnpm.io/package_json)
|
|
22
|
+
3. [Node.js package entry points and exports](https://nodejs.org/api/packages.html)
|
|
23
|
+
4. [Playwright npm package](https://www.npmjs.com/package/playwright)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Index
|
|
2
|
+
|
|
3
|
+
Project: **UKA** — computer use agent, sandbox for AI and captcha bypass. Super bot with computational memory. Package `@devthink/saddle`. Domain acquired.
|
|
4
|
+
|
|
5
|
+
Theme: computer use, bypasses, captcha, sandbox for AI, container for AI, multi-platform bot, storage-to-compute memory transformation.
|
|
6
|
+
|
|
7
|
+
## Planning Documents (`docs/plans`)
|
|
8
|
+
|
|
9
|
+
| # | File | Subject |
|
|
10
|
+
|---|------|---------|
|
|
11
|
+
| 01 | [architecture.md](./01.architecture.md) | General system architecture |
|
|
12
|
+
| 02 | [research.computer.use.md](./02.research.computer.use.md) | Research: computer use agents 2026 |
|
|
13
|
+
| 03 | [research.captcha.bypass.md](./03.research.captcha.bypass.md) | Research: hcaptcha cloudflare recaptcha bypass |
|
|
14
|
+
| 04 | [research.sandbox.ai.md](./04.research.sandbox.ai.md) | Research: virtual sandbox and containers for AI |
|
|
15
|
+
| 05 | [capture.platform.md](./05.capture.platform.md) | Browser movement capture platform |
|
|
16
|
+
| 06 | [dependencies.md](./06.dependencies.md) | 60+ project dependencies |
|
|
17
|
+
| 07 | [captcha.test.page.md](./07.captcha.test.page.md) | Test page with hcaptcha cloudflare |
|
|
18
|
+
| 08 | [production.infra.md](./08.production.infra.md) | Production infra (vercel/netlify) and sandbox backend |
|
|
19
|
+
| 09 | [database.schema.md](./09.database.schema.md) | Database schema (drizzle/prisma/mysql2) |
|
|
20
|
+
| 10 | [cloudinary.storage.md](./10.cloudinary.storage.md) | Data storage on cloudinary |
|
|
21
|
+
| 11 | [movement.logs.json.md](./11.movement.logs.json.md) | JSON movement log format (brave) |
|
|
22
|
+
| 12 | [research.atlas.agent.browser.md](./12.research.atlas.agent.browser.md) | Atlas: agent browser repos with same classification |
|
|
23
|
+
| 28 | [action.plan.md](./28.action.plan.md) | Action plan and next steps |
|
|
24
|
+
|
|
25
|
+
## Super Bot Documentation (`docs/plans`)
|
|
26
|
+
|
|
27
|
+
| # | File | Subject |
|
|
28
|
+
|---|------|---------|
|
|
29
|
+
| 45 | [robotarchitecture.md](./45.robotarchitecture.md) | Super bot architecture overview |
|
|
30
|
+
| 37 | [deploystrategy.md](./37.deploystrategy.md) | Deploy strategies (Netlify, Vercel, CI/CD, Docker, VM) |
|
|
31
|
+
| 36 | [computational.memory.md](./36.computational.memory.md) | Storage-to-compute memory transformation system |
|
|
32
|
+
| 39 | [multi.platform.bot.md](./39.multi.platform.bot.md) | Multi-platform bot (GitHub, GitLab, Forgejo, Gitea, Discord) |
|
|
33
|
+
| 40 | [npm.publish.md](./40.npm.publish.md) | NPM package publishing (`@devthink/saddle`) |
|
|
34
|
+
| 46 | [scdnintegration.md](./46.scdnintegration.md) | SCDN integration for assets and deployment |
|
|
35
|
+
| 44 | [reference.md](./44.reference.md) | Reference index for all saddle documentation |
|
|
36
|
+
| 33 | [bots.codigo.revisao.md](./33.bots.codigo.revisao.md) | Best AI code review bots (research) |
|
|
37
|
+
| 32 | [bots.automacao.computacional.md](./32.bots.automacao.computacional.md) | Best computational automation bots (research) |
|
|
38
|
+
| 34 | [bots.seguranca.cicd.md](./34.bots.seguranca.cicd.md) | Bot research (security + CI/CD) |
|
|
39
|
+
|
|
40
|
+
## Folders
|
|
41
|
+
|
|
42
|
+
- `docs/plans/` — planning and research (this index)
|
|
43
|
+
- `docs/talks/` — decision transcripts
|
|
44
|
+
- `docs/logs/` — JSON movement logs from Brave (`examplesession.json`)
|
|
45
|
+
- `tests/` — unit tests (`examples/`, `output/`, `scripts/`)
|
|
46
|
+
- `web/` — production site, deployed to Vercel or Netlify (files at root, no `src/`)
|
|
47
|
+
|
|
48
|
+
## Phase Decision
|
|
49
|
+
|
|
50
|
+
We are in **planning + research**. Platform implementation starts **only after user approval** (see `28.action.plan.md`).
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# 01 Architecture
|
|
2
|
+
|
|
3
|
+
## Goal
|
|
4
|
+
|
|
5
|
+
Build **UKA**, a computer use agent for ai that:
|
|
6
|
+
|
|
7
|
+
1. Captures human movement in the browser (virtual mouse, virtual arrow, click, rotation, coordinates) in a real environment (brave / chromium).
|
|
8
|
+
2. Exports movement as json logs to `docs/logs/`.
|
|
9
|
+
3. Runs in a virtual sandbox to isolate ai agent execution.
|
|
10
|
+
4. Faces strong captchas (hcaptcha, cloudflare turnstile, recaptcha) in controlled tests, opening test pages in brave.
|
|
11
|
+
5. Persists data in production via a deployed site (vercel/netlify) plus db (drizzle/prisma/mysql2) plus cloudinary.
|
|
12
|
+
|
|
13
|
+
## Architecture rules (skill arch)
|
|
14
|
+
|
|
15
|
+
- No `src/` folder. Logic lives at the root of `web/`.
|
|
16
|
+
- No vercel functions. No netlify functions. Use prisma, drizzle, mysql2, socket.
|
|
17
|
+
- No localhost. Host is parametrized (`host`). Ports randomized then locked.
|
|
18
|
+
- Files lowercase. No underscore. No hyphen. English docs. Jsdoc comments.
|
|
19
|
+
- Logic grouped. Up to 20 related logics per file.
|
|
20
|
+
- Runs as a library across modes (computer, browser, cli, binary, headless, etc).
|
|
21
|
+
|
|
22
|
+
## Atlas (the browser)
|
|
23
|
+
|
|
24
|
+
Atlas is the real browser component of UKA. It works across the 30 modes from the
|
|
25
|
+
architecture skill (computer, browser, cli, binary, headless, etc) and its primary
|
|
26
|
+
job is to bypass hcaptcha so the agent can act. It serves both the agent and the
|
|
27
|
+
sandbox, and talks to our own database on vercel/netlify. See
|
|
28
|
+
[12 research atlas agent browser](./12-research-atlas-agent-browser.md) for the
|
|
29
|
+
prior-art survey and the p1 stealth / p2 vlm / p3 token fallback layering.
|
|
30
|
+
|
|
31
|
+
## Components
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
atlas (web/atlas.js + deps)
|
|
35
|
+
- real browser across 30 modes
|
|
36
|
+
- stealth layer + hcaptcha bypass (vlm or token api fallback)
|
|
37
|
+
- feeds agent and sandbox
|
|
38
|
+
|
|
39
|
+
capture ui (web/*.html + web/capture.js)
|
|
40
|
+
- virtual arrow / virtual mouse injected via cdp
|
|
41
|
+
- captures click, drag, scroll, coordinates, rotation
|
|
42
|
+
- exports json to docs/logs/
|
|
43
|
+
|
|
44
|
+
sandbox (web/ + @vercel/sandbox)
|
|
45
|
+
- isolated firecracker microvm per session/agent
|
|
46
|
+
- chrome/brave ready, novnc streaming
|
|
47
|
+
- api https (post/get) to the deployed site
|
|
48
|
+
|
|
49
|
+
production backend (web/, deployed to vercel/netlify)
|
|
50
|
+
- open node server (hono/express), not platform functions
|
|
51
|
+
- db (drizzle + mysql2 + prisma schema)
|
|
52
|
+
- cloudinary for assets and replays
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Main flows
|
|
56
|
+
|
|
57
|
+
### A. Capture (local/dev)
|
|
58
|
+
1. Open brave via playwright/chromium with `chrome.debugger` (cdp).
|
|
59
|
+
2. Inject svg cursor sprite plus event listeners (`Input.dispatchMouseEvent`).
|
|
60
|
+
3. Record each event with timestamp, type, coordinates, target, rng seed.
|
|
61
|
+
4. Compact trajectories and export to `docs/logs/<session>.json`.
|
|
62
|
+
|
|
63
|
+
### B. Captcha test
|
|
64
|
+
1. Open test page (`tests/examples/hcaptchatest.html` or a real site).
|
|
65
|
+
2. Run solver (hcaptcha challenger / vision) or record manual bypass.
|
|
66
|
+
3. Save evidence (screenshot, token, log) to `tests/output/`.
|
|
67
|
+
|
|
68
|
+
### C. Production
|
|
69
|
+
1. Agent calls the deployed site api (`web/`).
|
|
70
|
+
2. Backend writes session to db (drizzle/mysql2) and assets to cloudinary.
|
|
71
|
+
3. Logs and replays available via get https.
|
|
72
|
+
|
|
73
|
+
## Key technologies (details in `06-dependencies.md`)
|
|
74
|
+
|
|
75
|
+
- Browser automation: `playwright`, `puppeteer`, `chromium-bidi`, `@playwright/test`
|
|
76
|
+
- Human mouse: `bezier-js`, `@napi-rs/canvas`, `d3`
|
|
77
|
+
- Ai / vision: `ai`, `@ai-sdk/*`, `@xenova/transformers`, `onnxruntime-web`, `tesseract.js`
|
|
78
|
+
- Sandbox: `@vercel/sandbox`, `vercel`
|
|
79
|
+
- Server: `hono`, `express`, `cors`, `helmet`, `socket.io` (socket realtime)
|
|
80
|
+
- Db: `drizzle-orm`, `mysql2`, `@prisma/client`, `prisma`
|
|
81
|
+
- Storage: `cloudinary`
|
|
82
|
+
- Validation: `zod`, `valibot`, `arktype`
|
|
83
|
+
|
|
84
|
+
## Next steps
|
|
85
|
+
|
|
86
|
+
See `action-plan.md`. Implementation starts after user approval.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# 02 — Pesquisa: Computer Use Agents (2026)
|
|
2
|
+
|
|
3
|
+
## Estado da arte
|
|
4
|
+
|
|
5
|
+
Em 2026, *computer-use agents* deixaram de ser protótipos e entraram em produção para
|
|
6
|
+
tarefas restritas e supervisionadas. Principais provedores e frameworks:
|
|
7
|
+
|
|
8
|
+
- **Anthropic Computer Use** (`computer_use_20251124`): ferramentas `computer` (mouse/teclado),
|
|
9
|
+
`text_editor`, `bash`. Recomenda rodar em **VMs/containers com privilégios mínimos**.
|
|
10
|
+
- **OpenAI Operator / CUA**: 87% de sucesso em sites JS complexos; 58% no WebArena.
|
|
11
|
+
- **Google Project Mariner**: 83.5% WebVoyager, 84% ScreenSpot.
|
|
12
|
+
- **Microsoft UFO²**: funde Windows UI Automation + OmniParser (visão).
|
|
13
|
+
- **browser-use** (open source): 89.1% WebVoyager (abordagem híbrida DOM + visão).
|
|
14
|
+
|
|
15
|
+
### Benchmarks
|
|
16
|
+
- **OSWorld:** humano 72.36% vs SOTA ~12–20% (desktop ainda imaturo).
|
|
17
|
+
- **WebArena:** tops ~71%, produção na faixa 50–60%.
|
|
18
|
+
- **WebVoyager:** browser-use 89.1% (híbrido).
|
|
19
|
+
|
|
20
|
+
### Conclusão de arquitetura
|
|
21
|
+
Ganham abordagens **híbridas**:
|
|
22
|
+
1. Raciocínio por **DOM / accessibility tree** para elementos estruturados.
|
|
23
|
+
2. **Visão** (VLM) para layouts não-padrão, canvas, imagens.
|
|
24
|
+
3. **Scripts determinísticos** para validação e replay.
|
|
25
|
+
4. **Verificação** (screenshot antes/depois, diff de elementos).
|
|
26
|
+
|
|
27
|
+
## Projetos de referência encontrados
|
|
28
|
+
|
|
29
|
+
| Projeto | Diferencial relevante para UKA |
|
|
30
|
+
|---------|-------------------------------|
|
|
31
|
+
| [agentbrowser](https://github.com/AshtonVaughan/agentbrowser) | Cursor visível humano via CDP, trilha SVG, trajetórias Bézier com jitter/overshoot, **traces JSONL** em `~/.agentbrowser/traces/`, replay determinístico por seed, bypass de Cloudflare/OneTrust |
|
|
32
|
+
| [humanjs](https://github.com/totigm/humanjs) | Playwright humanizado: curvas Bézier, ritmo de digitação, scroll, **personalidades** (careful/fast/distracted/precise), gravador → JSON timeline, MCP server |
|
|
33
|
+
| [human-browser-use](https://github.com/andyless/human-browser-use) | Extensão p/ browser-use: trajetória Bézier, typing lognormal, scroll inercial, stealth fingerprint (`navigator.webdriver`, WebGL, canvas) |
|
|
34
|
+
| [agentic-stealth-browser](https://github.com/shanewas/agentic-stealth-browser) | TLS spoofing (JA3/JA4), fingerprint, recovery chain (detecta captcha → rotaciona proxy), account warming |
|
|
35
|
+
| [mantis](https://github.com/mercurialsolo/mantis) | Agent perception-reasoning-action em Xvfb+Chrome+xdotool (sem fingerprint Playwright), vídeo screencast, deploy em Baseten/Modal/EKS/GKE |
|
|
36
|
+
| [win-pilot-mcp](https://github.com/omidmanoochehri/win-pilot-mcp) | MCP Windows computer-use: screen capture, OCR, mouse humano, logging estruturado, replay de macros |
|
|
37
|
+
| [cloakbrowser-human](https://github.com/evelaa123/cloakbrowser-human) | Wrapper Playwright que adiciona camada **comportamental** (mouse Bézier, typing, scroll) — complementa stealth de fingerprint |
|
|
38
|
+
|
|
39
|
+
## Padrões de movimento humano (extraídos da pesquisa)
|
|
40
|
+
|
|
41
|
+
- **Trajetória do mouse:** curva Bézier única, velocidade variável por arc-length:
|
|
42
|
+
- 0–5%: ramp-up (0.3x → 2.5x)
|
|
43
|
+
- 5–75%: cruise (2.3–2.5x) com variação senoidal
|
|
44
|
+
- 75–100%: ease-out cúbico (2.5x → 0.3x)
|
|
45
|
+
- sub-pixel drift final (σ 0.3–1.5px)
|
|
46
|
+
- duração via **Lei de Fitts**: `0.05 + 0.07*log2(1 + distance/20)` s
|
|
47
|
+
- **Overshoot:** ~15% de chance, auto-aumenta em movimentos longos.
|
|
48
|
+
- **Typing:** inter-key delay lognormal (μ=4.17, σ=0.3 → ~65ms), bigram speedup, 2% typo.
|
|
49
|
+
- **Scroll:** wheel events com acel/decel, overshoot, settle delay.
|
|
50
|
+
- **Stealth:** `navigator.webdriver → undefined`, spoof de plugins/WebGL/canvas, flags de launch.
|
|
51
|
+
|
|
52
|
+
## Aplicação no UKA
|
|
53
|
+
|
|
54
|
+
- Implementar `HumanCursor` (SVG overlay + CDP `Input.dispatchMouseEvent`) inspirado no
|
|
55
|
+
agentbrowser/humanjs, com trajetórias Bézier + jitter + overshoot determinísticas por seed.
|
|
56
|
+
- Gravar **todos os eventos** como `SessionEvent` tipado → exportar JSON para `docs/logs/`.
|
|
57
|
+
- Usar replay determinístico (seed) para testes reprodutíveis.
|
|
58
|
+
- Tratar GUI como imagem (visão) + DOM/accessibility para alvos estruturados.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# 03 — Pesquisa: hCaptcha / Cloudflare / reCAPTCHA Bypass
|
|
2
|
+
|
|
3
|
+
## Contexto
|
|
4
|
+
|
|
5
|
+
O UKA precisa **testar** a capacidade do computer-use de enfrentar captchas fortes. A
|
|
6
|
+
pesquisa abaixo levanta abordagens open-source e comerciais (uso edUKAcional / automação
|
|
7
|
+
supervisionada).
|
|
8
|
+
|
|
9
|
+
## hCaptcha
|
|
10
|
+
|
|
11
|
+
### hcaptcha-challenger (QIN2DIM) — referência principal
|
|
12
|
+
- Resolve hCaptcha com **LLM multimodal** (sem Tampermonkey, sem serviço anti-captcha 3º).
|
|
13
|
+
- Modelos plugáveis (ONNX):
|
|
14
|
+
- `image_label_binary` → ResNet ✅
|
|
15
|
+
- `image_label_area_select: point` → YOLOv8 ✅
|
|
16
|
+
- `image_label_area_select: bounding box` → YOLOv8 segmentation
|
|
17
|
+
- `image_drag_drop` → Spatial Chain-of-Thought ✅
|
|
18
|
+
- `image_label_multiple_choice` → ViT zero-shot
|
|
19
|
+
- Pipeline: `install()` → `AgentT.from_page()` → `handle_checkbox()` → `execute()` loop.
|
|
20
|
+
- Deps: `playwright`, `httpx`, `opencv-python`, `pillow`, `loguru`, `pydantic-settings`.
|
|
21
|
+
|
|
22
|
+
### Outros solvers
|
|
23
|
+
- **hCaptcha-Solver (Camoufox + Multibot):** usa Camoufox p/ HSW token + Groq vision +
|
|
24
|
+
**geração de movimento de mouse realista** (Multibot API). Lida com `image_label_binary`,
|
|
25
|
+
`area_select`, `drag_drop`. Requer proxy.
|
|
26
|
+
- **maximedrn/hcaptcha-solver-python-selenium:** userscript Tampermonkey + Selenium (edUKAcional).
|
|
27
|
+
- **auto-captcha-solver / auto-captcha (NopeCHA):** detecta hCaptcha, reCAPTCHA v2/v3,
|
|
28
|
+
Cloudflare Turnstile via **API de token NopeCHA**; injeta token automaticamente. Tem MCP
|
|
29
|
+
server e CLI. Tipos: hCaptcha ✅, reCAPTCHA v2/v3 ✅, Turnstile ⚠️ (lento).
|
|
30
|
+
|
|
31
|
+
## Cloudflare (Turnstile / interstitials)
|
|
32
|
+
|
|
33
|
+
- **agentic-stealth-browser** passa Cloudflare interstitial usando TLS spoofing + fingerprint
|
|
34
|
+
+ comportamento humano + **recovery chain** (detecta captcha → rotaciona proxy/sessão → retry).
|
|
35
|
+
- **auto-captcha** resolve Turnstile via NopeCHA (fila lenta, requer proxy em produção).
|
|
36
|
+
- **captcha-solver (CloakBrowser + 2Captcha/CapSolver):** Turnstile resolvido em ~5s via
|
|
37
|
+
ClickSolver (free) ou fallback pago.
|
|
38
|
+
|
|
39
|
+
## reCAPTCHA
|
|
40
|
+
|
|
41
|
+
- v2/v3/Enterprise: cobertos por hcaptcha-challenger (via proxy), auto-captcha (NopeCHA),
|
|
42
|
+
2Captcha, CapSolver.
|
|
43
|
+
|
|
44
|
+
## Capes (tipos suportados por 2Captcha/CapSolver — 30+)
|
|
45
|
+
|
|
46
|
+
reCAPTCHA v2/v3/Enterprise, Cloudflare Turnstile, hCaptcha, FunCaptcha (Arkose), GeeTest,
|
|
47
|
+
KeyCaptcha, Amazon WAF, DataDome, Akamai, Imperva, Friendly, MTCaptcha, Lemin, Cutcaptcha,
|
|
48
|
+
Tencent, Yandex, ALTCHA, Prosopo, entre outros.
|
|
49
|
+
|
|
50
|
+
## Camadas de defesa que o UKA deve considerar
|
|
51
|
+
|
|
52
|
+
| Camada | O que ataca | Mitigação no UKA |
|
|
53
|
+
|--------|-------------|------------------|
|
|
54
|
+
| Fingerprint (WebDriver, CDP, headless, GPU) | detecta automação | stealth JS + Brave real/CDP, spoof WebGL/canvas |
|
|
55
|
+
| Comportamental (mouse/keyboard/scroll) | analisa padrões | trajetórias Bézier humanas, typing lognormal |
|
|
56
|
+
| TLS (JA3/JA4) | identifica cliente | TLS regional / proxy residencial sticky |
|
|
57
|
+
| IP reputation | bloqueia faixas | proxies residenciais com sessão sticky |
|
|
58
|
+
| Captcha | desafio final | solver VLM (hcaptcha-challenger) ou token API |
|
|
59
|
+
|
|
60
|
+
## Aplicação no UKA
|
|
61
|
+
|
|
62
|
+
- Criar `tests/examples/hcaptcha-test.html` (página de teste local) + usar sites reais fortes
|
|
63
|
+
(Cloudflare, Google reCAPTCHA demo, hCaptcha demo) no Brave.
|
|
64
|
+
- Pipeline de teste: abrir → detectar captcha → resolver (VLM ou token API) → registrar
|
|
65
|
+
token/screenshot/log em `tests/output/`.
|
|
66
|
+
- **Não** usar para abuso: foco em automação supervisionada e pesquisa.
|
|
67
|
+
- Dependências relevantes: `playwright`, `puppeteer`, `@xenova/transformers`,
|
|
68
|
+
`onnxruntime-web`, `tesseract.js`, `cloudinary` (evidências).
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# 04 — Pesquisa: Sandbox Virtual e Containers para IA
|
|
2
|
+
|
|
3
|
+
## Por que sandbox?
|
|
4
|
+
|
|
5
|
+
Computer-use agents executam código/inputs não confiáveis (saída de LLM, uploads de
|
|
6
|
+
usuário). Rodar em sandbox isola a execução, impede acesso ao sistema de produção e limita
|
|
7
|
+
recursos. A pesquisa mostra que provedores ladearam para **microVMs Firecracker**.
|
|
8
|
+
|
|
9
|
+
## Vercel Sandbox (opção principal do UKA)
|
|
10
|
+
|
|
11
|
+
- Compute primitive para rodar código não confiável com segurança (AI agents, code gen).
|
|
12
|
+
- **Firecracker microVM** por sandbox, filesystem e rede próprios, isolamento forte.
|
|
13
|
+
- Runtimes: `node26/24/22`, `python3.13`. Default `node24`.
|
|
14
|
+
- Cada sandbox roda como `vercel-sandbox` (sudo disponível), working dir `/vercel/sandbox`.
|
|
15
|
+
- Startup em **milissegundos**; suporta Docker/FUSE dentro do microVM (privilégio elevado).
|
|
16
|
+
- **Credential brokering:** injeta secrets em requests de saída sem expor dentro do VM
|
|
17
|
+
(`console.log(process.env)` não vaza a chave).
|
|
18
|
+
- **Network policy:** allowlist de domínios, atualizável em runtime.
|
|
19
|
+
- SDK JS e Python; CLI. Multi-agent isolation (usuário Linux por agente, grupos p/ compartilhar).
|
|
20
|
+
|
|
21
|
+
### AI SDK Computer Use (vercel-labs) — template de referência
|
|
22
|
+
- Next.js + AI SDK + Claude Sonnet 4.5 + **Vercel Sandbox**.
|
|
23
|
+
- Snapshot pré-construído com: **Xvnc**, **openbox**, **noVNC + websockify**, **Google
|
|
24
|
+
Chrome**, **xdotool + ImageMagick**.
|
|
25
|
+
- Fluxo: User ↔ Chat UI ↔ AI SDK ↔ Claude → Vercel Sandbox (desktop via noVNC iframe).
|
|
26
|
+
- Ferramentas: `computer` (screenshot/click/type/scroll) + `bash`.
|
|
27
|
+
- Env: `ANTHROPIC_API_KEY`, `SANDBOX_SNAPSHOT_ID`, `VERCEL_OIDC_TOKEN`/`VERCEL_TOKEN`.
|
|
28
|
+
|
|
29
|
+
### vercel-labs/agent-browser (serverless)
|
|
30
|
+
- CLI Rust nativo; roda agent-browser + Chrome em Vercel Sandbox microVM efêmero.
|
|
31
|
+
- Helper `@agent-browser/sandbox/vercel` + `@vercel/sandbox`.
|
|
32
|
+
|
|
33
|
+
### vercel-labs/sandcastle (PoC desktop)
|
|
34
|
+
- Desktop Linux web sobre Vercel Sandbox. Stack: Next.js, Tailwind, **Zustand + SWR**,
|
|
35
|
+
**Neon Postgres + Drizzle ORM**, `@vercel/sandbox`, code-server, Xpra. Auth password/OAuth.
|
|
36
|
+
|
|
37
|
+
## Outras opções
|
|
38
|
+
|
|
39
|
+
- **Modal / Baseten / EKS / GKE** (usados pelo mantis) — containers Docker customizados.
|
|
40
|
+
- **Daytona / Cloudflare** — alternativas de sandbox (citadas mas com menos fit p/ TS).
|
|
41
|
+
- **Containers Docker locais** (xdotool + Xvfb + Chromium) para dev sem nuvem.
|
|
42
|
+
|
|
43
|
+
## Decisão para o UKA
|
|
44
|
+
|
|
45
|
+
- **Produção:** Vercel Sandbox como camada de execução do computer-use; site de controle
|
|
46
|
+
deployado em **Vercel** (ou Netlify) (`web/`).
|
|
47
|
+
- **Banco:** criado no deploy (Drizzle/LibSQL ou Prisma em Neon/Turso), conforme `09-esquema-banco-dados.md`.
|
|
48
|
+
- **Armazenamento:** Cloudinary para assets/replays (`10-cloudinary-storage.md`).
|
|
49
|
+
- **Dev local:** Brave real via Playwright/CDP para a plataforma de captura (`05-plataforma-captura-movimentos.md`).
|
|
50
|
+
- **Comunicação:** requests **POST/GET HTTPS** do agente → site deployado → DB + Cloudinary.
|
|
51
|
+
- Dependências: `@vercel/sandbox`, `vercel`, `@netlify/blobs`, `@netlify/functions`,
|
|
52
|
+
`hono`/`express`, `drizzle-orm`, `@libsql/client`, `socket.io`.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# 05 Capture Platform
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Build a web platform that captures the user/agent movement inside the browser (focus: brave) and exports everything as json logs to `docs/logs/`. This is the base to train and replay the UKA computer use with human behavior.
|
|
6
|
+
|
|
7
|
+
## Core concepts
|
|
8
|
+
|
|
9
|
+
- Virtual mouse / virtual arrow: an svg cursor injected in the page (via cdp init script) that follows the real movement and draws a trail and click ripple.
|
|
10
|
+
- Event capture: click, double click, drag, scroll, coordinates (x,y), rotation (scroll/wheel angle), timing, target (selector/role/text), deterministic seed.
|
|
11
|
+
- Export: compacted json in `docs/logs/<session>.json`.
|
|
12
|
+
|
|
13
|
+
## Platform architecture (root based, no src)
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
web/ (capture frontend)
|
|
17
|
+
├─ index.html # capture page
|
|
18
|
+
├─ capture.js # injects svg cursor + listeners
|
|
19
|
+
├─ recorder.js # collects sessionevent to buffer
|
|
20
|
+
└─ exporter.js # serializes to docs/logs/<session>.json
|
|
21
|
+
|
|
22
|
+
(root logic files, grouped per skill arch)
|
|
23
|
+
├─ humancursor.js # bezier + jitter + overshoot (cdp Input.dispatchMouseEvent)
|
|
24
|
+
├─ trajectory.js # path generator (ghost-cursor / humanjs inspired)
|
|
25
|
+
├─ fingerprint.js # stealth patches webgl/canvas/audio
|
|
26
|
+
├─ recorder.js # json event stream
|
|
27
|
+
├─ replay.js # deterministic replay by seed
|
|
28
|
+
└─ runcapture.js # entrypoint (opens brave via cdp)
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Sessionevent format
|
|
32
|
+
|
|
33
|
+
```ts
|
|
34
|
+
type SessionEvent =
|
|
35
|
+
| { t: number; type: "move"; x: number; y: number; tx: number; ty: number }
|
|
36
|
+
| { t: number; type: "click"; x: number; y: number; button: "left"|"right"; target?: string }
|
|
37
|
+
| { t: number; type: "drag"; x0: number; y0: number; x1: number; y1: number }
|
|
38
|
+
| { t: number; type: "scroll"; dx: number; dy: number; angle: number }
|
|
39
|
+
| { t: number; type: "key"; key: string; target?: string }
|
|
40
|
+
| { t: number; type: string; [k: string]: unknown };
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## How it works (summary)
|
|
44
|
+
|
|
45
|
+
1. Open brave via playwright/chromium with `chrome.debugger` (cdp).
|
|
46
|
+
2. Inject svg cursor sprite plus event listeners (`Input.dispatchMouseEvent`).
|
|
47
|
+
3. Move the cursor humanly (bezier with jitter/overshoot), all via cdp, not locators.
|
|
48
|
+
4. Each action emits a `SessionEvent` with timestamp, coordinates, target, seed.
|
|
49
|
+
5. Compact trajectories (collapse move runs) and export to `docs/logs/`.
|
|
50
|
+
|
|
51
|
+
## Relation with logs
|
|
52
|
+
|
|
53
|
+
The final json format of `docs/logs/` files is detailed in `11-movement-logs-json.md`. An example log is at `docs/logs/examplesession.json`.
|
|
54
|
+
|
|
55
|
+
## Dependencies involved
|
|
56
|
+
|
|
57
|
+
`playwright`, `puppeteer`, `chromium-bidi`, `bezier-js`, `@napi-rs/canvas`, `d3`, `socket.io-client`, `zod` (event validation).
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# 06 Dependencies
|
|
2
|
+
|
|
3
|
+
Dependency list of the `@devthink/UKA` package, grouped by function. Total: 65 packages (including the dev tooling set). The user asked for "50 to 60, or 60+. Counting 10 more", so this set covers browser automation, ai/vision, sandbox, server, db, storage and validation.
|
|
4
|
+
|
|
5
|
+
## Browser automation and mouse (8)
|
|
6
|
+
1. `playwright` — real brave/chromium automation via cdp.
|
|
7
|
+
2. `puppeteer` — fallback automation / stealth.
|
|
8
|
+
3. `chromium-bidi` — bidi protocol for input control.
|
|
9
|
+
4. `@playwright/test` — e2e tests for the platform and captcha.
|
|
10
|
+
5. `bezier-js` — human mouse trajectory generation (bezier).
|
|
11
|
+
6. `@napi-rs/canvas` — draw virtual cursor / trail / ripple.
|
|
12
|
+
7. `d3` — movement trajectory visualization.
|
|
13
|
+
8. `sharp` — screenshot/evidence processing.
|
|
14
|
+
|
|
15
|
+
## Ai / vision / captcha (12)
|
|
16
|
+
9. `ai` — ai sdk core.
|
|
17
|
+
10. `@ai-sdk/anthropic` — claude (computer use).
|
|
18
|
+
11. `@ai-sdk/google` — gemini (vision).
|
|
19
|
+
12. `@ai-sdk/openai` — gpt (vision/reasoning).
|
|
20
|
+
13. `@ai-sdk/react` — agent ui hooks.
|
|
21
|
+
14. `@ai-sdk/vercel` — vercel integration.
|
|
22
|
+
15. `@xenova/transformers` — local vlm models (onnx).
|
|
23
|
+
16. `onnxruntime-web` — onnx inference in browser (yolo/resnet).
|
|
24
|
+
17. `tesseract.js` — ocr for captcha/text.
|
|
25
|
+
18. `openai` — raw sdk for vision/solvers.
|
|
26
|
+
19. `comlink` — workers for inference in a separate thread.
|
|
27
|
+
20. `jsdom` — virtual dom for parsing/tests.
|
|
28
|
+
|
|
29
|
+
## Sandbox and deploy (3)
|
|
30
|
+
21. `@vercel/sandbox` — firecracker microvm for isolated execution.
|
|
31
|
+
22. `vercel` — cli/deploy to vercel.
|
|
32
|
+
23. `nanoid` — short url-safe ids.
|
|
33
|
+
|
|
34
|
+
> Note: `@netlify/functions` and `@netlify/blobs` were removed. The architecture skill rejects netlify/vercel functions and platform locked storage. Realtime uses socket. Db uses prisma/drizzle/mysql2.
|
|
35
|
+
|
|
36
|
+
## Server / api (7)
|
|
37
|
+
24. `hono` — light http api (production).
|
|
38
|
+
25. `express` — alternative api / dev.
|
|
39
|
+
26. `cors` — cors for agent requests.
|
|
40
|
+
27. `helmet` — security headers.
|
|
41
|
+
28. `socket.io` — realtime event streaming (socket).
|
|
42
|
+
29. `socket.io-client` — replay/stream client.
|
|
43
|
+
30. `multer` — file upload (tokens, evidence).
|
|
44
|
+
|
|
45
|
+
## Database / orm (5)
|
|
46
|
+
31. `drizzle-orm` — primary orm.
|
|
47
|
+
32. `mysql2` — mysql driver (skill arch: data uses mysql2).
|
|
48
|
+
33. `@prisma/client` — prisma client.
|
|
49
|
+
34. `prisma` — cli/migrations.
|
|
50
|
+
35. `yaml` — schema/env config.
|
|
51
|
+
|
|
52
|
+
## Storage (1)
|
|
53
|
+
36. `cloudinary` — upload replays, screenshots, assets.
|
|
54
|
+
|
|
55
|
+
## Validation / types (3)
|
|
56
|
+
37. `zod` — event/log schema.
|
|
57
|
+
38. `valibot` — light validation.
|
|
58
|
+
39. `arktype` — runtime types.
|
|
59
|
+
|
|
60
|
+
## Logging (1)
|
|
61
|
+
40. `pino` — structured (json) agent logs.
|
|
62
|
+
|
|
63
|
+
## Frontend / build (8)
|
|
64
|
+
41. `react` — platform ui.
|
|
65
|
+
42. `react-dom` — react render.
|
|
66
|
+
43. `next` — production web framework.
|
|
67
|
+
44. `vite` — bundler.
|
|
68
|
+
45. `@vitejs/plugin-react` — react plugin for vite.
|
|
69
|
+
46. `tailwindcss` — styling.
|
|
70
|
+
47. `@tailwindcss/vite` — tailwind+vite integration.
|
|
71
|
+
48. `@testing-library/react` — component tests.
|
|
72
|
+
49. `@testing-library/dom` — dom test utils.
|
|
73
|
+
50. `@testing-library/jest-dom` — test matchers.
|
|
74
|
+
|
|
75
|
+
## Media / util (4)
|
|
76
|
+
51. `pngjs` — png read/write (click masks).
|
|
77
|
+
52. `ffmpeg-static` — replay video recording.
|
|
78
|
+
53. `@t3-oss/env-core` — typed env validation.
|
|
79
|
+
54. `uuid` — session/agent ids.
|
|
80
|
+
|
|
81
|
+
## Dev tooling (11 — the "10+")
|
|
82
|
+
55. `typescript` — compiler.
|
|
83
|
+
56. `@biomejs/biome` — lint/format.
|
|
84
|
+
57. `vitest` — test runner.
|
|
85
|
+
58. `@vitest/coverage-v8` — coverage.
|
|
86
|
+
59. `tsx` — run ts without build.
|
|
87
|
+
60. `@types/node` — node types.
|
|
88
|
+
61. `@types/react` — react types.
|
|
89
|
+
62. `@types/react-dom` — react dom types.
|
|
90
|
+
63. `@ai-sdk/anthropic` (dev) — mirrored in devdeps.
|
|
91
|
+
64. `@vercel/sandbox` (dev) — mirrored in devdeps.
|
|
92
|
+
65. `prisma` (dev) — cli in devdeps.
|
|
93
|
+
|
|
94
|
+
## Conventions
|
|
95
|
+
- Files lowercase. No underscore. No hyphen.
|
|
96
|
+
- English only. Jsdoc comments. Third person voice.
|
|
97
|
+
- No hardcoded host. Use `host`. Ports randomized then locked.
|