@wenathlan/saddle 1.8.8 → 1.8.9
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 +15 -15
- package/dist/adapters/forge.d.ts +17 -0
- package/dist/adapters/forge.d.ts.map +1 -0
- package/dist/adapters/forge.js +19 -0
- package/dist/adapters/forge.js.map +1 -0
- package/dist/adapters/forgejo.d.ts +49 -0
- package/dist/adapters/forgejo.d.ts.map +1 -0
- package/{adapters → dist/adapters}/forgejo.js +1 -1
- package/dist/adapters/forgejo.js.map +1 -0
- package/dist/adapters/github.d.ts +12 -0
- package/dist/adapters/github.d.ts.map +1 -0
- package/dist/adapters/github.js +20 -0
- package/dist/adapters/github.js.map +1 -0
- package/dist/adapters/gitlab.d.ts +17 -0
- package/dist/adapters/gitlab.d.ts.map +1 -0
- package/dist/adapters/gitlab.js +10 -0
- package/dist/adapters/gitlab.js.map +1 -0
- package/dist/adapters/huggingface.d.ts +17 -0
- package/dist/adapters/huggingface.d.ts.map +1 -0
- package/{adapters → dist/adapters}/huggingface.js +1 -1
- package/dist/adapters/huggingface.js.map +1 -0
- package/dist/adapters/socket.d.ts +11 -0
- package/dist/adapters/socket.d.ts.map +1 -0
- package/dist/adapters/socket.js +17 -0
- package/dist/adapters/socket.js.map +1 -0
- package/dist/adapters/transport.d.ts +7 -0
- package/dist/adapters/transport.d.ts.map +1 -0
- package/dist/adapters/transport.js +36 -0
- package/dist/adapters/transport.js.map +1 -0
- package/dist/ai/chunk.d.ts +2 -0
- package/dist/ai/chunk.d.ts.map +1 -0
- package/dist/ai/chunk.js +36 -0
- package/dist/ai/chunk.js.map +1 -0
- package/dist/ai/llmstxt.d.ts +6 -0
- package/dist/ai/llmstxt.d.ts.map +1 -0
- package/dist/ai/llmstxt.js +12 -0
- package/dist/ai/llmstxt.js.map +1 -0
- package/dist/ai/provenance.d.ts +22 -0
- package/dist/ai/provenance.d.ts.map +1 -0
- package/dist/ai/provenance.js +25 -0
- package/dist/ai/provenance.js.map +1 -0
- package/dist/ai/rag.d.ts +26 -0
- package/dist/ai/rag.d.ts.map +1 -0
- package/dist/ai/rag.js +22 -0
- package/dist/ai/rag.js.map +1 -0
- package/dist/ai/tokens.d.ts +15 -0
- package/dist/ai/tokens.d.ts.map +1 -0
- package/{ai → dist/ai}/tokens.js +1 -1
- package/dist/ai/tokens.js.map +1 -0
- package/dist/api/auth.d.ts +16 -0
- package/dist/api/auth.d.ts.map +1 -0
- package/dist/api/auth.js +19 -0
- package/dist/api/auth.js.map +1 -0
- package/dist/api/contracts.d.ts +28 -0
- package/dist/api/contracts.d.ts.map +1 -0
- package/{api → dist/api}/contracts.js +3 -6
- package/dist/api/contracts.js.map +1 -0
- package/dist/api/control.d.ts +10 -0
- package/dist/api/control.d.ts.map +1 -0
- package/dist/api/control.js +35 -0
- package/dist/api/control.js.map +1 -0
- package/dist/api/http.d.ts +7 -0
- package/dist/api/http.d.ts.map +1 -0
- package/{api → dist/api}/http.js +5 -5
- package/dist/api/http.js.map +1 -0
- package/dist/api/rate.d.ts +28 -0
- package/dist/api/rate.d.ts.map +1 -0
- package/dist/api/rate.js +36 -0
- package/dist/api/rate.js.map +1 -0
- package/dist/api/security.d.ts +12 -0
- package/dist/api/security.d.ts.map +1 -0
- package/dist/api/security.js +56 -0
- package/dist/api/security.js.map +1 -0
- package/dist/api/service.d.ts +5 -0
- package/dist/api/service.d.ts.map +1 -0
- package/dist/api/service.js +70 -0
- package/dist/api/service.js.map +1 -0
- package/dist/apps/registry.d.ts +33 -0
- package/dist/apps/registry.d.ts.map +1 -0
- package/dist/apps/registry.js +24 -0
- package/dist/apps/registry.js.map +1 -0
- package/dist/binary/build.d.ts +29 -0
- package/dist/binary/build.d.ts.map +1 -0
- package/dist/binary/build.js +17 -0
- package/dist/binary/build.js.map +1 -0
- package/dist/bot/adapter.d.ts +5 -0
- package/dist/bot/adapter.d.ts.map +1 -0
- package/dist/bot/adapter.js +11 -0
- package/dist/bot/adapter.js.map +1 -0
- package/dist/bot/bot.d.ts +28 -0
- package/dist/bot/bot.d.ts.map +1 -0
- package/dist/bot/bot.js +52 -0
- package/dist/bot/bot.js.map +1 -0
- package/dist/bot/commands.d.ts +8 -0
- package/dist/bot/commands.d.ts.map +1 -0
- package/dist/bot/commands.js +19 -0
- package/dist/bot/commands.js.map +1 -0
- package/dist/bot/permissions.d.ts +13 -0
- package/dist/bot/permissions.d.ts.map +1 -0
- package/dist/bot/permissions.js +16 -0
- package/dist/bot/permissions.js.map +1 -0
- package/dist/browser/actions.d.ts +33 -0
- package/dist/browser/actions.d.ts.map +1 -0
- package/dist/browser/actions.js +44 -0
- package/dist/browser/actions.js.map +1 -0
- package/dist/browser/agent.d.ts +21 -0
- package/dist/browser/agent.d.ts.map +1 -0
- package/dist/browser/agent.js +13 -0
- package/dist/browser/agent.js.map +1 -0
- package/dist/browser/context.d.ts +43 -0
- package/dist/browser/context.d.ts.map +1 -0
- package/dist/browser/context.js +54 -0
- package/dist/browser/context.js.map +1 -0
- package/dist/browser/fingerprint.d.ts +4 -0
- package/dist/browser/fingerprint.d.ts.map +1 -0
- package/{browser → dist/browser}/fingerprint.js +4 -4
- package/dist/browser/fingerprint.js.map +1 -0
- package/dist/browser/index.d.ts +11 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/{browser → dist/browser}/index.js +1 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/playwright.d.ts +11 -0
- package/dist/browser/playwright.d.ts.map +1 -0
- package/dist/browser/playwright.js +24 -0
- package/dist/browser/playwright.js.map +1 -0
- package/dist/browser/recorder.d.ts +27 -0
- package/dist/browser/recorder.d.ts.map +1 -0
- package/dist/browser/recorder.js +22 -0
- package/dist/browser/recorder.js.map +1 -0
- package/dist/browser/session.d.ts +14 -0
- package/dist/browser/session.d.ts.map +1 -0
- package/dist/browser/session.js +21 -0
- package/dist/browser/session.js.map +1 -0
- package/dist/browser/snapshot.d.ts +57 -0
- package/dist/browser/snapshot.d.ts.map +1 -0
- package/dist/browser/snapshot.js +57 -0
- package/dist/browser/snapshot.js.map +1 -0
- package/dist/captcha/contract.d.ts +35 -0
- package/dist/captcha/contract.d.ts.map +1 -0
- package/dist/captcha/contract.js +17 -0
- package/dist/captcha/contract.js.map +1 -0
- package/dist/captcha/evidence.d.ts +10 -0
- package/dist/captcha/evidence.d.ts.map +1 -0
- package/dist/captcha/evidence.js +9 -0
- package/dist/captcha/evidence.js.map +1 -0
- package/dist/captcha/guard.d.ts +23 -0
- package/dist/captcha/guard.d.ts.map +1 -0
- package/dist/captcha/guard.js +12 -0
- package/dist/captcha/guard.js.map +1 -0
- package/dist/cli/main.d.ts +4 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/main.js +46 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/core/errors.d.ts +84 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +54 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/events.d.ts +9 -0
- package/dist/core/events.d.ts.map +1 -0
- package/dist/core/events.js +21 -0
- package/dist/core/events.js.map +1 -0
- package/dist/core/hash.d.ts +10 -0
- package/dist/core/hash.d.ts.map +1 -0
- package/dist/core/hash.js +82 -0
- package/dist/core/hash.js.map +1 -0
- package/dist/core/ids.d.ts +10 -0
- package/dist/core/ids.d.ts.map +1 -0
- package/dist/core/ids.js +15 -0
- package/dist/core/ids.js.map +1 -0
- package/dist/deploy/index.d.ts +6 -0
- package/dist/deploy/index.d.ts.map +1 -0
- package/dist/deploy/index.js +6 -0
- package/dist/deploy/index.js.map +1 -0
- package/dist/dispatch/resumable.d.ts +85 -0
- package/dist/dispatch/resumable.d.ts.map +1 -0
- package/dist/dispatch/resumable.js +39 -0
- package/dist/dispatch/resumable.js.map +1 -0
- package/dist/dispatch/workflow.d.ts +6 -0
- package/dist/dispatch/workflow.d.ts.map +1 -0
- package/dist/dispatch/workflow.js +37 -0
- package/dist/dispatch/workflow.js.map +1 -0
- package/dist/domain/artifacts.d.ts +12 -0
- package/dist/domain/artifacts.d.ts.map +1 -0
- package/dist/domain/artifacts.js +14 -0
- package/dist/domain/artifacts.js.map +1 -0
- package/dist/domain/jobs.d.ts +12 -0
- package/dist/domain/jobs.d.ts.map +1 -0
- package/dist/domain/jobs.js +20 -0
- package/dist/domain/jobs.js.map +1 -0
- package/dist/domain/providers.d.ts +10 -0
- package/dist/domain/providers.d.ts.map +1 -0
- package/{domain → dist/domain}/providers.js +2 -2
- package/dist/domain/providers.js.map +1 -0
- package/dist/domain/runtime.d.ts +14 -0
- package/dist/domain/runtime.d.ts.map +1 -0
- package/{domain → dist/domain}/runtime.js +3 -3
- package/dist/domain/runtime.js.map +1 -0
- package/dist/domain/sessions.d.ts +12 -0
- package/dist/domain/sessions.d.ts.map +1 -0
- package/dist/domain/sessions.js +57 -0
- package/dist/domain/sessions.js.map +1 -0
- package/dist/examples/localjob.d.ts +2 -0
- package/dist/examples/localjob.d.ts.map +1 -0
- package/{examples → dist/examples}/localjob.js +1 -1
- package/dist/examples/localjob.js.map +1 -0
- package/dist/examples/publicapi.d.ts +2 -0
- package/dist/examples/publicapi.d.ts.map +1 -0
- package/{examples → dist/examples}/publicapi.js +1 -1
- package/dist/examples/publicapi.js.map +1 -0
- package/dist/extension/build.d.ts +9 -0
- package/dist/extension/build.d.ts.map +1 -0
- package/dist/extension/build.js +61 -0
- package/dist/extension/build.js.map +1 -0
- package/dist/extension/content.d.ts +6 -0
- package/dist/extension/content.d.ts.map +1 -0
- package/dist/extension/content.js +135 -0
- package/dist/extension/content.js.map +1 -0
- package/dist/extension/index.d.ts +7 -0
- package/dist/extension/index.d.ts.map +1 -0
- package/{extension → dist/extension}/index.js +1 -0
- package/dist/extension/index.js.map +1 -0
- package/dist/extension/pagebridge.d.ts +6 -0
- package/dist/extension/pagebridge.d.ts.map +1 -0
- package/dist/extension/pagebridge.js +42 -0
- package/dist/extension/pagebridge.js.map +1 -0
- package/dist/extension/permissions.d.ts +26 -0
- package/dist/extension/permissions.d.ts.map +1 -0
- package/dist/extension/permissions.js +28 -0
- package/dist/extension/permissions.js.map +1 -0
- package/dist/extension/popup.d.ts +5 -0
- package/dist/extension/popup.d.ts.map +1 -0
- package/dist/extension/popup.js +26 -0
- package/dist/extension/popup.js.map +1 -0
- package/dist/extension/protocol.d.ts +58 -0
- package/dist/extension/protocol.d.ts.map +1 -0
- package/dist/extension/protocol.js +101 -0
- package/dist/extension/protocol.js.map +1 -0
- package/dist/extension/serviceworker.d.ts +25 -0
- package/dist/extension/serviceworker.d.ts.map +1 -0
- package/dist/extension/serviceworker.js +102 -0
- package/dist/extension/serviceworker.js.map +1 -0
- package/dist/extension/worker.d.ts +28 -0
- package/dist/extension/worker.d.ts.map +1 -0
- package/dist/extension/worker.js +22 -0
- package/dist/extension/worker.js.map +1 -0
- package/dist/format/check.d.ts +8 -0
- package/dist/format/check.d.ts.map +1 -0
- package/dist/format/check.js +38 -0
- package/dist/format/check.js.map +1 -0
- package/dist/index.d.ts +117 -0
- package/dist/index.d.ts.map +1 -0
- package/{index.js → dist/index.js} +1 -0
- package/dist/index.js.map +1 -0
- package/dist/library/public.d.ts +53 -0
- package/dist/library/public.d.ts.map +1 -0
- package/dist/library/public.js +83 -0
- package/dist/library/public.js.map +1 -0
- package/dist/mcp/browser.d.ts +9 -0
- package/dist/mcp/browser.d.ts.map +1 -0
- package/dist/mcp/browser.js +13 -0
- package/dist/mcp/browser.js.map +1 -0
- package/dist/mcp/server.d.ts +35 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +40 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/transport.d.ts +7 -0
- package/dist/mcp/transport.d.ts.map +1 -0
- package/dist/mcp/transport.js +17 -0
- package/dist/mcp/transport.js.map +1 -0
- package/dist/memory/bridge.d.ts +14 -0
- package/dist/memory/bridge.d.ts.map +1 -0
- package/dist/memory/bridge.js +16 -0
- package/dist/memory/bridge.js.map +1 -0
- package/dist/memory/engine.d.ts +28 -0
- package/dist/memory/engine.d.ts.map +1 -0
- package/dist/memory/engine.js +59 -0
- package/dist/memory/engine.js.map +1 -0
- package/dist/memory/modes.d.ts +43 -0
- package/dist/memory/modes.d.ts.map +1 -0
- package/dist/memory/modes.js +66 -0
- package/dist/memory/modes.js.map +1 -0
- package/dist/memory/objects.d.ts +21 -0
- package/dist/memory/objects.d.ts.map +1 -0
- package/dist/memory/objects.js +20 -0
- package/dist/memory/objects.js.map +1 -0
- package/dist/memory/targets.d.ts +78 -0
- package/dist/memory/targets.d.ts.map +1 -0
- package/dist/memory/targets.js +29 -0
- package/dist/memory/targets.js.map +1 -0
- package/dist/memory/transforms.d.ts +19 -0
- package/dist/memory/transforms.d.ts.map +1 -0
- package/dist/memory/transforms.js +14 -0
- package/dist/memory/transforms.js.map +1 -0
- package/dist/modes/matrix.d.ts +23 -0
- package/dist/modes/matrix.d.ts.map +1 -0
- package/{modes → dist/modes}/matrix.js +8 -10
- package/dist/modes/matrix.js.map +1 -0
- package/dist/modes/modes.d.ts +33 -0
- package/dist/modes/modes.d.ts.map +1 -0
- package/{modes → dist/modes}/modes.js +3 -4
- package/dist/modes/modes.js.map +1 -0
- package/dist/modes/resolve.d.ts +41 -0
- package/dist/modes/resolve.d.ts.map +1 -0
- package/dist/modes/resolve.js +39 -0
- package/dist/modes/resolve.js.map +1 -0
- package/dist/observability/metrics.d.ts +14 -0
- package/dist/observability/metrics.d.ts.map +1 -0
- package/dist/observability/metrics.js +18 -0
- package/dist/observability/metrics.js.map +1 -0
- package/dist/packager/manifest.d.ts +49 -0
- package/dist/packager/manifest.d.ts.map +1 -0
- package/dist/packager/manifest.js +49 -0
- package/dist/packager/manifest.js.map +1 -0
- package/dist/packager/publish.d.ts +51 -0
- package/dist/packager/publish.d.ts.map +1 -0
- package/dist/packager/publish.js +18 -0
- package/dist/packager/publish.js.map +1 -0
- package/dist/packager/targetcli.d.ts +7 -0
- package/dist/packager/targetcli.d.ts.map +1 -0
- package/dist/packager/targetcli.js +22 -0
- package/dist/packager/targetcli.js.map +1 -0
- package/dist/persistence/adapter.d.ts +5 -0
- package/dist/persistence/adapter.d.ts.map +1 -0
- package/dist/persistence/adapter.js +11 -0
- package/dist/persistence/adapter.js.map +1 -0
- package/dist/persistence/drizzle.d.ts +2 -0
- package/dist/persistence/drizzle.d.ts.map +1 -0
- package/dist/persistence/drizzle.js +12 -0
- package/dist/persistence/drizzle.js.map +1 -0
- package/dist/persistence/memory.d.ts +2 -0
- package/dist/persistence/memory.d.ts.map +1 -0
- package/dist/persistence/memory.js +27 -0
- package/dist/persistence/memory.js.map +1 -0
- package/dist/persistence/migrations.d.ts +19 -0
- package/dist/persistence/migrations.d.ts.map +1 -0
- package/{persistence → dist/persistence}/migrations.js +4 -5
- package/dist/persistence/migrations.js.map +1 -0
- package/dist/persistence/prisma.d.ts +2 -0
- package/dist/persistence/prisma.d.ts.map +1 -0
- package/dist/persistence/prisma.js +25 -0
- package/dist/persistence/prisma.js.map +1 -0
- package/dist/persistence/schema.d.ts +63 -0
- package/dist/persistence/schema.d.ts.map +1 -0
- package/dist/persistence/schema.js +28 -0
- package/dist/persistence/schema.js.map +1 -0
- package/dist/persistence/sql.d.ts +3 -0
- package/dist/persistence/sql.d.ts.map +1 -0
- package/dist/persistence/sql.js +37 -0
- package/dist/persistence/sql.js.map +1 -0
- package/dist/protocol/blocks.d.ts +10 -0
- package/dist/protocol/blocks.d.ts.map +1 -0
- package/dist/protocol/blocks.js +26 -0
- package/dist/protocol/blocks.js.map +1 -0
- package/dist/protocol/json.d.ts +6 -0
- package/dist/protocol/json.d.ts.map +1 -0
- package/{protocol → dist/protocol}/json.js +1 -0
- package/dist/protocol/json.js.map +1 -0
- package/dist/protocol/ndjson.d.ts +3 -0
- package/dist/protocol/ndjson.d.ts.map +1 -0
- package/dist/protocol/ndjson.js +20 -0
- package/dist/protocol/ndjson.js.map +1 -0
- package/dist/protocol/sse.d.ts +7 -0
- package/dist/protocol/sse.d.ts.map +1 -0
- package/dist/protocol/sse.js +25 -0
- package/dist/protocol/sse.js.map +1 -0
- package/dist/proxy/pool.d.ts +9 -0
- package/dist/proxy/pool.d.ts.map +1 -0
- package/dist/proxy/pool.js +27 -0
- package/dist/proxy/pool.js.map +1 -0
- package/dist/queue/idempotency.d.ts +10 -0
- package/dist/queue/idempotency.d.ts.map +1 -0
- package/dist/queue/idempotency.js +13 -0
- package/dist/queue/idempotency.js.map +1 -0
- package/dist/queue/persistent.d.ts +13 -0
- package/dist/queue/persistent.d.ts.map +1 -0
- package/dist/queue/persistent.js +49 -0
- package/dist/queue/persistent.js.map +1 -0
- package/dist/queue/queue.d.ts +7 -0
- package/dist/queue/queue.d.ts.map +1 -0
- package/dist/queue/queue.js +55 -0
- package/dist/queue/queue.js.map +1 -0
- package/dist/queue/saga.d.ts +5 -0
- package/dist/queue/saga.d.ts.map +1 -0
- package/dist/queue/saga.js +20 -0
- package/dist/queue/saga.js.map +1 -0
- package/dist/release/assets.d.ts +118 -0
- package/dist/release/assets.d.ts.map +1 -0
- package/dist/release/assets.js +69 -0
- package/dist/release/assets.js.map +1 -0
- package/dist/runners/health.d.ts +36 -0
- package/dist/runners/health.d.ts.map +1 -0
- package/dist/runners/health.js +26 -0
- package/dist/runners/health.js.map +1 -0
- package/dist/runners/heartbeat.d.ts +23 -0
- package/dist/runners/heartbeat.d.ts.map +1 -0
- package/dist/runners/heartbeat.js +29 -0
- package/dist/runners/heartbeat.js.map +1 -0
- package/dist/runners/inprocess.d.ts +17 -0
- package/dist/runners/inprocess.d.ts.map +1 -0
- package/dist/runners/inprocess.js +20 -0
- package/dist/runners/inprocess.js.map +1 -0
- package/dist/runners/scheduler.d.ts +5 -0
- package/dist/runners/scheduler.d.ts.map +1 -0
- package/dist/runners/scheduler.js +19 -0
- package/dist/runners/scheduler.js.map +1 -0
- package/dist/runtime/abort.d.ts +8 -0
- package/dist/runtime/abort.d.ts.map +1 -0
- package/dist/runtime/abort.js +13 -0
- package/dist/runtime/abort.js.map +1 -0
- package/dist/runtime/compatibility.d.ts +37 -0
- package/dist/runtime/compatibility.d.ts.map +1 -0
- package/{runtime → dist/runtime}/compatibility.js +1 -4
- package/dist/runtime/compatibility.js.map +1 -0
- package/dist/runtime/detect.d.ts +13 -0
- package/dist/runtime/detect.d.ts.map +1 -0
- package/dist/runtime/detect.js +18 -0
- package/dist/runtime/detect.js.map +1 -0
- package/dist/runtime/engine.d.ts +20 -0
- package/dist/runtime/engine.d.ts.map +1 -0
- package/dist/runtime/engine.js +61 -0
- package/dist/runtime/engine.js.map +1 -0
- package/dist/runtime/retry.d.ts +19 -0
- package/dist/runtime/retry.d.ts.map +1 -0
- package/dist/runtime/retry.js +54 -0
- package/dist/runtime/retry.js.map +1 -0
- package/dist/runtime/worker.d.ts +10 -0
- package/dist/runtime/worker.d.ts.map +1 -0
- package/dist/runtime/worker.js +25 -0
- package/dist/runtime/worker.js.map +1 -0
- package/dist/scrape/cache.d.ts +45 -0
- package/dist/scrape/cache.d.ts.map +1 -0
- package/dist/scrape/cache.js +45 -0
- package/dist/scrape/cache.js.map +1 -0
- package/dist/scrape/crawl.d.ts +47 -0
- package/dist/scrape/crawl.d.ts.map +1 -0
- package/dist/scrape/crawl.js +114 -0
- package/dist/scrape/crawl.js.map +1 -0
- package/dist/scrape/extract.d.ts +63 -0
- package/dist/scrape/extract.d.ts.map +1 -0
- package/dist/scrape/extract.js +47 -0
- package/dist/scrape/extract.js.map +1 -0
- package/dist/scrape/normalize.d.ts +52 -0
- package/dist/scrape/normalize.d.ts.map +1 -0
- package/dist/scrape/normalize.js +102 -0
- package/dist/scrape/normalize.js.map +1 -0
- package/dist/scrape/robots.d.ts +37 -0
- package/dist/scrape/robots.d.ts.map +1 -0
- package/dist/scrape/robots.js +71 -0
- package/dist/scrape/robots.js.map +1 -0
- package/dist/scrape/schema.d.ts +5 -0
- package/dist/scrape/schema.d.ts.map +1 -0
- package/dist/scrape/schema.js +25 -0
- package/dist/scrape/schema.js.map +1 -0
- package/dist/scrape/scraper.d.ts +6 -0
- package/dist/scrape/scraper.d.ts.map +1 -0
- package/dist/scrape/scraper.js +46 -0
- package/dist/scrape/scraper.js.map +1 -0
- package/dist/scrape/semantic.d.ts +25 -0
- package/dist/scrape/semantic.d.ts.map +1 -0
- package/dist/scrape/semantic.js +27 -0
- package/dist/scrape/semantic.js.map +1 -0
- package/dist/server/node.d.ts +7 -0
- package/dist/server/node.d.ts.map +1 -0
- package/dist/server/node.js +38 -0
- package/dist/server/node.js.map +1 -0
- package/dist/sessions/file.d.ts +25 -0
- package/dist/sessions/file.d.ts.map +1 -0
- package/dist/sessions/file.js +13 -0
- package/dist/sessions/file.js.map +1 -0
- package/dist/sessions/replay.d.ts +9 -0
- package/dist/sessions/replay.d.ts.map +1 -0
- package/dist/sessions/replay.js +70 -0
- package/dist/sessions/replay.js.map +1 -0
- package/dist/sessions/store.d.ts +25 -0
- package/dist/sessions/store.d.ts.map +1 -0
- package/dist/sessions/store.js +13 -0
- package/dist/sessions/store.js.map +1 -0
- package/dist/storage/adapter.d.ts +5 -0
- package/dist/storage/adapter.d.ts.map +1 -0
- package/dist/storage/adapter.js +11 -0
- package/dist/storage/adapter.js.map +1 -0
- package/dist/storage/cache.d.ts +23 -0
- package/dist/storage/cache.d.ts.map +1 -0
- package/dist/storage/cache.js +79 -0
- package/dist/storage/cache.js.map +1 -0
- package/dist/storage/checksum.d.ts +3 -0
- package/dist/storage/checksum.d.ts.map +1 -0
- package/dist/storage/checksum.js +19 -0
- package/dist/storage/checksum.js.map +1 -0
- package/dist/storage/chunked.d.ts +21 -0
- package/dist/storage/chunked.d.ts.map +1 -0
- package/dist/storage/chunked.js +67 -0
- package/dist/storage/chunked.js.map +1 -0
- package/dist/storage/content.d.ts +24 -0
- package/dist/storage/content.d.ts.map +1 -0
- package/dist/storage/content.js +44 -0
- package/dist/storage/content.js.map +1 -0
- package/dist/storage/filehosting.d.ts +2 -0
- package/dist/storage/filehosting.d.ts.map +1 -0
- package/dist/storage/filehosting.js +24 -0
- package/dist/storage/filehosting.js.map +1 -0
- package/dist/storage/githubcontents.d.ts +2 -0
- package/dist/storage/githubcontents.d.ts.map +1 -0
- package/dist/storage/githubcontents.js +29 -0
- package/dist/storage/githubcontents.js.map +1 -0
- package/dist/storage/index.d.ts +11 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/{storage → dist/storage}/index.js +1 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/local.d.ts +2 -0
- package/dist/storage/local.d.ts.map +1 -0
- package/dist/storage/local.js +72 -0
- package/dist/storage/local.js.map +1 -0
- package/dist/storage/memory.d.ts +6 -0
- package/dist/storage/memory.d.ts.map +1 -0
- package/dist/storage/memory.js +36 -0
- package/dist/storage/memory.js.map +1 -0
- package/dist/storage/s3compatible.d.ts +2 -0
- package/dist/storage/s3compatible.d.ts.map +1 -0
- package/dist/storage/s3compatible.js +31 -0
- package/dist/storage/s3compatible.js.map +1 -0
- package/dist/storage/sync.d.ts +47 -0
- package/dist/storage/sync.d.ts.map +1 -0
- package/dist/storage/sync.js +75 -0
- package/dist/storage/sync.js.map +1 -0
- package/dist/surfaces/adapters.d.ts +97 -0
- package/dist/surfaces/adapters.d.ts.map +1 -0
- package/dist/surfaces/adapters.js +50 -0
- package/dist/surfaces/adapters.js.map +1 -0
- package/dist/surfaces/controls.d.ts +18 -0
- package/dist/surfaces/controls.d.ts.map +1 -0
- package/dist/surfaces/controls.js +45 -0
- package/dist/surfaces/controls.js.map +1 -0
- package/dist/surfaces/manifest.d.ts +68 -0
- package/dist/surfaces/manifest.d.ts.map +1 -0
- package/dist/surfaces/manifest.js +42 -0
- package/dist/surfaces/manifest.js.map +1 -0
- package/dist/surfaces/n8n.d.ts +25 -0
- package/dist/surfaces/n8n.d.ts.map +1 -0
- package/dist/surfaces/n8n.js +31 -0
- package/dist/surfaces/n8n.js.map +1 -0
- package/dist/surfaces/operations.d.ts +32 -0
- package/dist/surfaces/operations.d.ts.map +1 -0
- package/dist/surfaces/operations.js +53 -0
- package/dist/surfaces/operations.js.map +1 -0
- package/dist/surfaces/targets.d.ts +196 -0
- package/dist/surfaces/targets.d.ts.map +1 -0
- package/dist/surfaces/targets.js +27 -0
- package/dist/surfaces/targets.js.map +1 -0
- package/dist/webhook/delivery.d.ts +18 -0
- package/dist/webhook/delivery.d.ts.map +1 -0
- package/dist/webhook/delivery.js +36 -0
- package/dist/webhook/delivery.js.map +1 -0
- package/dist/webhook/receiver.d.ts +26 -0
- package/dist/webhook/receiver.d.ts.map +1 -0
- package/dist/webhook/receiver.js +24 -0
- package/dist/webhook/receiver.js.map +1 -0
- package/dist/webhook/signature.d.ts +3 -0
- package/dist/webhook/signature.d.ts.map +1 -0
- package/{webhook → dist/webhook}/signature.js +1 -1
- package/dist/webhook/signature.js.map +1 -0
- package/dist/workflow/manifest.d.ts +21 -0
- package/dist/workflow/manifest.d.ts.map +1 -0
- package/dist/workflow/manifest.js +20 -0
- package/dist/workflow/manifest.js.map +1 -0
- package/dist/workflow/registry.d.ts +7 -0
- package/dist/workflow/registry.d.ts.map +1 -0
- package/dist/workflow/registry.js +18 -0
- package/dist/workflow/registry.js.map +1 -0
- package/dist/workflow/templates.d.ts +6 -0
- package/dist/workflow/templates.d.ts.map +1 -0
- package/dist/workflow/templates.js +18 -0
- package/dist/workflow/templates.js.map +1 -0
- package/dist/workflow/triggers.d.ts +36 -0
- package/dist/workflow/triggers.d.ts.map +1 -0
- package/dist/workflow/triggers.js +33 -0
- package/dist/workflow/triggers.js.map +1 -0
- package/docs/enginearchitecture.md +2 -2
- package/docs/gapmatrix.md +2 -2
- package/docs/libraryapi.md +1 -1
- package/docs/release.md +5 -5
- package/docs/releaseassets.md +1 -1
- package/docs/reorganization-1.8.9.md +28 -0
- package/docs/toolchainresearch-1.8.9.md +18 -0
- package/extension/manifest.json +1 -1
- package/package.json +61 -88
- package/adapters/forge.js +0 -16
- package/adapters/github.js +0 -19
- package/adapters/gitlab.js +0 -10
- package/adapters/socket.js +0 -14
- package/adapters/transport.js +0 -30
- package/ai/chunk.js +0 -22
- package/ai/llmstxt.js +0 -12
- package/ai/provenance.js +0 -18
- package/ai/rag.js +0 -14
- package/api/auth.js +0 -13
- package/api/control.js +0 -33
- package/api/rate.js +0 -31
- package/api/security.js +0 -42
- package/api/service.js +0 -36
- package/binary/build.js +0 -17
- package/bot/adapter.js +0 -8
- package/bot/bot.js +0 -39
- package/bot/commands.js +0 -18
- package/bot/permissions.js +0 -16
- package/browser/actions.js +0 -33
- package/browser/agent.js +0 -9
- package/browser/context.js +0 -52
- package/browser/playwright.js +0 -22
- package/browser/recorder.js +0 -21
- package/browser/session.js +0 -19
- package/browser/snapshot.js +0 -57
- package/captcha/contract.js +0 -15
- package/captcha/evidence.js +0 -9
- package/captcha/guard.js +0 -10
- package/cli/main.js +0 -36
- package/core/errors.js +0 -57
- package/core/events.js +0 -21
- package/core/hash.js +0 -73
- package/core/ids.js +0 -15
- package/dispatch/resumable.js +0 -31
- package/dispatch/workflow.js +0 -33
- package/domain/artifacts.js +0 -13
- package/domain/jobs.js +0 -20
- package/domain/sessions.js +0 -46
- package/extension/build.js +0 -46
- package/extension/content.js +0 -127
- package/extension/pagebridge.js +0 -41
- package/extension/permissions.js +0 -22
- package/extension/popup.css +0 -13
- package/extension/popup.html +0 -24
- package/extension/popup.js +0 -25
- package/extension/protocol.js +0 -95
- package/extension/serviceworker.js +0 -109
- package/extension/worker.js +0 -22
- package/format/check.js +0 -21
- package/library/public.js +0 -85
- package/mcp/browser.js +0 -12
- package/mcp/server.js +0 -28
- package/mcp/transport.js +0 -14
- package/memory/bridge.js +0 -16
- package/memory/engine.js +0 -45
- package/memory/modes.js +0 -55
- package/memory/objects.js +0 -18
- package/memory/targets.js +0 -21
- package/memory/transforms.js +0 -15
- package/modes/resolve.js +0 -39
- package/packager/manifest.js +0 -28
- package/packager/publish.js +0 -15
- package/persistence/adapter.js +0 -8
- package/persistence/drizzle.js +0 -10
- package/persistence/memory.js +0 -26
- package/persistence/prisma.js +0 -23
- package/persistence/schema.js +0 -29
- package/persistence/sql.js +0 -30
- package/protocol/blocks.js +0 -18
- package/protocol/ndjson.js +0 -17
- package/protocol/sse.js +0 -22
- package/proxy/pool.js +0 -12
- package/queue/idempotency.js +0 -12
- package/queue/persistent.js +0 -44
- package/queue/queue.js +0 -50
- package/queue/saga.js +0 -13
- package/release/assets.js +0 -70
- package/runners/health.js +0 -23
- package/runners/heartbeat.js +0 -26
- package/runners/inprocess.js +0 -19
- package/runners/scheduler.js +0 -16
- package/runtime/abort.js +0 -10
- package/runtime/detect.js +0 -14
- package/runtime/engine.js +0 -56
- package/runtime/retry.js +0 -27
- package/runtime/worker.js +0 -18
- package/scrape/agent.ts +0 -122
- package/scrape/batch.ts +0 -79
- package/scrape/biome.json +0 -76
- package/scrape/browser.ts +0 -222
- package/scrape/cache.js +0 -14
- package/scrape/cache.ts +0 -84
- package/scrape/chunking.ts +0 -193
- package/scrape/cli.ts +0 -105
- package/scrape/crawl.js +0 -104
- package/scrape/crawler.ts +0 -115
- package/scrape/dev-server.ts +0 -94
- package/scrape/errors.ts +0 -132
- package/scrape/events.ts +0 -26
- package/scrape/extract.js +0 -14
- package/scrape/extract.ts +0 -165
- package/scrape/fetch.ts +0 -105
- package/scrape/formats.ts +0 -85
- package/scrape/headers.ts +0 -71
- package/scrape/index.ts +0 -92
- package/scrape/jsdom.d.ts +0 -6
- package/scrape/llms-txt.ts +0 -84
- package/scrape/middleware.ts +0 -90
- package/scrape/normalize.js +0 -86
- package/scrape/pool.ts +0 -95
- package/scrape/port.ts +0 -18
- package/scrape/proxy.ts +0 -103
- package/scrape/rate-limiter.ts +0 -95
- package/scrape/renderer.ts +0 -194
- package/scrape/retry.ts +0 -64
- package/scrape/robots.js +0 -32
- package/scrape/robots.ts +0 -137
- package/scrape/schema.js +0 -21
- package/scrape/scrape.ts +0 -123
- package/scrape/scraper.js +0 -40
- package/scrape/semantic.js +0 -22
- package/scrape/serialize.ts +0 -310
- package/scrape/server.ts +0 -137
- package/scrape/session.ts +0 -109
- package/scrape/sitemap.ts +0 -131
- package/scrape/tokens.ts +0 -45
- package/scrape/tsconfig.json +0 -28
- package/scrape/types.ts +0 -214
- package/scrape/utils.ts +0 -77
- package/scrape/vite.config.ts +0 -55
- package/scrape/vitest.config.ts +0 -17
- package/server/node.js +0 -34
- package/sessions/file.js +0 -13
- package/sessions/replay.js +0 -61
- package/sessions/store.js +0 -13
- package/storage/adapter.js +0 -8
- package/storage/cache.js +0 -54
- package/storage/checksum.js +0 -17
- package/storage/chunked.js +0 -58
- package/storage/content.js +0 -42
- package/storage/filehosting.js +0 -17
- package/storage/githubcontents.js +0 -18
- package/storage/local.js +0 -35
- package/storage/memory.js +0 -28
- package/storage/s3compatible.js +0 -23
- package/storage/sync.js +0 -55
- package/surfaces/adapters.js +0 -48
- package/surfaces/controls.js +0 -37
- package/surfaces/manifest.js +0 -25
- package/surfaces/n8n.js +0 -24
- package/surfaces/operations.js +0 -43
- package/surfaces/targets.js +0 -16
- package/webhook/delivery.js +0 -26
- package/webhook/receiver.js +0 -20
- package/workflow/manifest.js +0 -20
- package/workflow/registry.js +0 -16
- package/workflow/templates.js +0 -18
- package/workflow/triggers.js +0 -31
package/scrape/tokens.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
export type ModelType = 'gpt-4o' | 'gpt-4' | 'gpt-3.5-turbo' | 'claude' | 'gemini' | 'default';
|
|
2
|
-
|
|
3
|
-
const MODEL_TOKEN_RATIOS: Record<ModelType, number> = {
|
|
4
|
-
'gpt-4o': 3.5,
|
|
5
|
-
'gpt-4': 3.5,
|
|
6
|
-
'gpt-3.5-turbo': 4,
|
|
7
|
-
'claude': 3.2,
|
|
8
|
-
'gemini': 3.5,
|
|
9
|
-
'default': 4,
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export function estimateTokens(text: string, model: ModelType = 'default'): number {
|
|
13
|
-
const ratio = MODEL_TOKEN_RATIOS[model] || 4;
|
|
14
|
-
return Math.ceil(text.length / ratio);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function countTokens(text: string, model: ModelType = 'default'): number {
|
|
18
|
-
return estimateTokens(text, model);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function fitsInContext(text: string, maxTokens: number, model: ModelType = 'default'): boolean {
|
|
22
|
-
return estimateTokens(text, model) <= maxTokens;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export function truncateToTokens(text: string, maxTokens: number, model: ModelType = 'default'): string {
|
|
26
|
-
const estimatedTokens = estimateTokens(text, model);
|
|
27
|
-
if (estimatedTokens <= maxTokens) return text;
|
|
28
|
-
const charLimit = Math.floor(maxTokens * (MODEL_TOKEN_RATIOS[model] || 4));
|
|
29
|
-
return text.slice(0, charLimit) + '...';
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function tokenCost(text: string, model: ModelType, pricePer1kTokens: number): number {
|
|
33
|
-
const tokens = estimateTokens(text, model);
|
|
34
|
-
return (tokens / 1000) * pricePer1kTokens;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export const MODEL_PRICES: Record<string, { input: number; output: number }> = {
|
|
38
|
-
'gpt-4o': { input: 0.0025, output: 0.01 },
|
|
39
|
-
'gpt-4o-mini': { input: 0.00015, output: 0.0006 },
|
|
40
|
-
'gpt-4-turbo': { input: 0.01, output: 0.03 },
|
|
41
|
-
'claude-3-5-sonnet': { input: 0.003, output: 0.015 },
|
|
42
|
-
'claude-3-haiku': { input: 0.00025, output: 0.00125 },
|
|
43
|
-
'gemini-1.5-pro': { input: 0.00125, output: 0.005 },
|
|
44
|
-
'gemini-1.5-flash': { input: 0.000075, output: 0.0003 },
|
|
45
|
-
};
|
package/scrape/tsconfig.json
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2024",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"lib": ["ES2024", "DOM", "DOM.Iterable"],
|
|
6
|
-
"moduleResolution": "bundler",
|
|
7
|
-
"strict": true,
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"declarationMap": true,
|
|
10
|
-
"sourceMap": true,
|
|
11
|
-
"outDir": "./dist",
|
|
12
|
-
"rootDir": ".",
|
|
13
|
-
"noEmit": true,
|
|
14
|
-
"esModuleInterop": true,
|
|
15
|
-
"skipLibCheck": true,
|
|
16
|
-
"forceConsistentCasingInFileNames": true,
|
|
17
|
-
"resolveJsonModule": true,
|
|
18
|
-
"isolatedModules": true,
|
|
19
|
-
"verbatimModuleSyntax": true,
|
|
20
|
-
"noUnusedLocals": true,
|
|
21
|
-
"noUnusedParameters": true,
|
|
22
|
-
"noImplicitReturns": true,
|
|
23
|
-
"noFallthroughCasesInSwitch": true,
|
|
24
|
-
"types": ["node"]
|
|
25
|
-
},
|
|
26
|
-
"include": ["*.ts"],
|
|
27
|
-
"exclude": ["node_modules", "dist", "web", "vite.config.ts", "vitest.config.ts", "tests"]
|
|
28
|
-
}
|
package/scrape/types.ts
DELETED
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
export const ScrapeFormatSchema = z.enum(['markdown', 'html', 'text', 'json', 'xml', 'redis']);
|
|
4
|
-
export type ScrapeFormat = z.infer<typeof ScrapeFormatSchema>;
|
|
5
|
-
|
|
6
|
-
export const SerializeTargetSchema = z.enum(['markdown', 'xml', 'json', 'redis', 'text']);
|
|
7
|
-
export type SerializeTarget = z.infer<typeof SerializeTargetSchema>;
|
|
8
|
-
|
|
9
|
-
export const ScrapeOptionsSchema = z.strictObject({
|
|
10
|
-
url: z.string().url().optional(),
|
|
11
|
-
html: z.string().optional(),
|
|
12
|
-
mode: z.enum(['auto', 'fetch', 'browser']).prefault('auto').optional(),
|
|
13
|
-
waitUntil: z.enum(['load', 'domcontentloaded', 'networkidle', 'commit']).prefault('networkidle').optional(),
|
|
14
|
-
timeout: z.number().positive().prefault(30000).optional(),
|
|
15
|
-
scroll: z.boolean().prefault(false).optional(),
|
|
16
|
-
scrollDelay: z.number().nonnegative().prefault(300).optional(),
|
|
17
|
-
maxScrolls: z.number().positive().prefault(50).optional(),
|
|
18
|
-
removeSelectors: z.array(z.string()).prefault([]).optional(),
|
|
19
|
-
extractImages: z.boolean().prefault(true).optional(),
|
|
20
|
-
extractLinks: z.boolean().prefault(true).optional(),
|
|
21
|
-
extractTables: z.boolean().prefault(true).optional(),
|
|
22
|
-
maxContentLength: z.number().positive().optional(),
|
|
23
|
-
format: ScrapeFormatSchema.prefault('markdown').optional(),
|
|
24
|
-
language: z.string().optional(),
|
|
25
|
-
proxy: z.string().optional(),
|
|
26
|
-
retries: z.number().nonnegative().prefault(3).optional(),
|
|
27
|
-
retryDelay: z.number().positive().prefault(1000).optional(),
|
|
28
|
-
userAgent: z.string().optional(),
|
|
29
|
-
headers: z.record(z.string(), z.string()).prefault({}).optional(),
|
|
30
|
-
cache: z.boolean().prefault(false).optional(),
|
|
31
|
-
cacheTtlMs: z.number().positive().prefault(300000).optional(),
|
|
32
|
-
readable: z.boolean().optional(),
|
|
33
|
-
});
|
|
34
|
-
export type ScrapeOptions = z.infer<typeof ScrapeOptionsSchema>;
|
|
35
|
-
|
|
36
|
-
export interface ScrapeResult {
|
|
37
|
-
url: string;
|
|
38
|
-
title: string;
|
|
39
|
-
content: string;
|
|
40
|
-
format: ScrapeFormat;
|
|
41
|
-
text: string;
|
|
42
|
-
links: LinkInfo[];
|
|
43
|
-
images: ImageInfo[];
|
|
44
|
-
tables: TableInfo[];
|
|
45
|
-
metadata: PageMetadata;
|
|
46
|
-
extractedAt: string;
|
|
47
|
-
duration: number;
|
|
48
|
-
size: number;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface PageMetadata {
|
|
52
|
-
title: string;
|
|
53
|
-
description?: string;
|
|
54
|
-
favicon?: string;
|
|
55
|
-
charset?: string;
|
|
56
|
-
language?: string;
|
|
57
|
-
author?: string;
|
|
58
|
-
publishedDate?: string;
|
|
59
|
-
ogImage?: string;
|
|
60
|
-
ogType?: string;
|
|
61
|
-
keywords?: string[];
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export interface LinkInfo {
|
|
65
|
-
href: string;
|
|
66
|
-
text: string;
|
|
67
|
-
isInternal: boolean;
|
|
68
|
-
isExternal: boolean;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export interface ImageInfo {
|
|
72
|
-
src: string;
|
|
73
|
-
alt: string;
|
|
74
|
-
width?: number;
|
|
75
|
-
height?: number;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface TableInfo {
|
|
79
|
-
headers: string[];
|
|
80
|
-
rows: string[][];
|
|
81
|
-
caption?: string;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export const BrowserAgentConfigSchema = z.strictObject({
|
|
85
|
-
headless: z.boolean().prefault(true).optional(),
|
|
86
|
-
userAgent: z.string().optional(),
|
|
87
|
-
viewport: z
|
|
88
|
-
.strictObject({
|
|
89
|
-
width: z.number().positive().prefault(1280),
|
|
90
|
-
height: z.number().positive().prefault(720),
|
|
91
|
-
})
|
|
92
|
-
.prefault({ width: 1280, height: 720 })
|
|
93
|
-
.optional(),
|
|
94
|
-
locale: z.string().prefault('en-US').optional(),
|
|
95
|
-
geolocation: z
|
|
96
|
-
.strictObject({
|
|
97
|
-
latitude: z.number(),
|
|
98
|
-
longitude: z.number(),
|
|
99
|
-
})
|
|
100
|
-
.optional(),
|
|
101
|
-
timeout: z.number().positive().prefault(30000).optional(),
|
|
102
|
-
recordVideo: z.boolean().prefault(false).optional(),
|
|
103
|
-
proxy: z.string().prefault('').optional(),
|
|
104
|
-
storageState: z.string().prefault('').optional(),
|
|
105
|
-
blockAds: z.boolean().prefault(true).optional(),
|
|
106
|
-
stealth: z.boolean().prefault(true).optional(),
|
|
107
|
-
});
|
|
108
|
-
export type BrowserAgentConfig = z.infer<typeof BrowserAgentConfigSchema>;
|
|
109
|
-
|
|
110
|
-
export interface ExtractOptions {
|
|
111
|
-
readable?: boolean;
|
|
112
|
-
stripTags?: string[];
|
|
113
|
-
preserveLinks?: boolean;
|
|
114
|
-
preserveImages?: boolean;
|
|
115
|
-
preserveTables?: boolean;
|
|
116
|
-
maxLength?: number;
|
|
117
|
-
removeSelectors?: string[];
|
|
118
|
-
baseUrl?: string;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export interface SerializeOptions {
|
|
122
|
-
format: SerializeTarget;
|
|
123
|
-
pretty?: boolean;
|
|
124
|
-
maxChunkSize?: number;
|
|
125
|
-
includeMetadata?: boolean;
|
|
126
|
-
redisKey?: string;
|
|
127
|
-
xmlRoot?: string;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export interface SerializedOutput {
|
|
131
|
-
format: SerializeTarget;
|
|
132
|
-
content: string;
|
|
133
|
-
chunks?: string[];
|
|
134
|
-
size: number;
|
|
135
|
-
metadata?: Record<string, unknown>;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export interface AgentOutput {
|
|
139
|
-
summary: string;
|
|
140
|
-
content: string;
|
|
141
|
-
keyPoints: string[];
|
|
142
|
-
relevantUrls: string[];
|
|
143
|
-
structured?: Record<string, unknown>;
|
|
144
|
-
tokens: number;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export interface RenderOptions {
|
|
148
|
-
width?: number;
|
|
149
|
-
height?: number;
|
|
150
|
-
fullPage?: boolean;
|
|
151
|
-
type?: 'png' | 'jpeg';
|
|
152
|
-
quality?: number;
|
|
153
|
-
output?: string;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export interface ChromeCommand {
|
|
157
|
-
action: 'goto' | 'click' | 'type' | 'screenshot' | 'evaluate' | 'wait' | 'scroll' | 'extract';
|
|
158
|
-
args?: Record<string, unknown>;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export interface CliOptions {
|
|
162
|
-
url?: string;
|
|
163
|
-
file?: string;
|
|
164
|
-
format?: ScrapeFormat;
|
|
165
|
-
output?: string;
|
|
166
|
-
'no-headless'?: boolean;
|
|
167
|
-
timeout?: number;
|
|
168
|
-
scroll?: boolean;
|
|
169
|
-
readable?: boolean;
|
|
170
|
-
agent?: boolean;
|
|
171
|
-
pretty?: boolean;
|
|
172
|
-
proxy?: string;
|
|
173
|
-
retries?: number;
|
|
174
|
-
mode?: 'auto' | 'fetch' | 'browser';
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export interface RetryConfig {
|
|
178
|
-
retries: number;
|
|
179
|
-
delay: number;
|
|
180
|
-
backoff: 'exponential' | 'linear' | 'constant';
|
|
181
|
-
maxDelay?: number;
|
|
182
|
-
statusCodes?: number[];
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
export interface ProxyConfig {
|
|
186
|
-
url: string;
|
|
187
|
-
username?: string;
|
|
188
|
-
password?: string;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export interface CacheConfig {
|
|
192
|
-
enabled: boolean;
|
|
193
|
-
ttlMs?: number;
|
|
194
|
-
maxEntries?: number;
|
|
195
|
-
storage?: 'memory' | 'redis' | 'sqlite' | 'indexeddb';
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
export interface CrawlStats {
|
|
199
|
-
totalUrls: number;
|
|
200
|
-
successful: number;
|
|
201
|
-
failed: number;
|
|
202
|
-
skipped: number;
|
|
203
|
-
duration: number;
|
|
204
|
-
avgResponseTime: number;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
export interface BatchOptions {
|
|
208
|
-
urls: string[];
|
|
209
|
-
concurrency?: number;
|
|
210
|
-
mode?: 'auto' | 'fetch' | 'browser';
|
|
211
|
-
format?: ScrapeFormat;
|
|
212
|
-
onProgress?: (completed: number, total: number, currentUrl: string) => void;
|
|
213
|
-
onError?: (url: string, error: Error) => void;
|
|
214
|
-
}
|
package/scrape/utils.ts
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { dirname } from 'node:path';
|
|
3
|
-
|
|
4
|
-
export function ensureDir(path: string): void {
|
|
5
|
-
const dir = dirname(path);
|
|
6
|
-
if (!existsSync(dir)) {
|
|
7
|
-
mkdirSync(dir, { recursive: true });
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function writeOutput(path: string, content: string): void {
|
|
12
|
-
ensureDir(path);
|
|
13
|
-
writeFileSync(path, content, 'utf-8');
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export function slugify(text: string): string {
|
|
17
|
-
return text
|
|
18
|
-
.toLowerCase()
|
|
19
|
-
.replace(/[^\w\s-]/g, '')
|
|
20
|
-
.replace(/[\s_]+/g, '-')
|
|
21
|
-
.replace(/^-+|-+$/g, '');
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function truncate(text: string, max: number, suffix = '...'): string {
|
|
25
|
-
if (text.length <= max) return text;
|
|
26
|
-
return text.slice(0, max - suffix.length) + suffix;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export function estimateTokens(text: string): number {
|
|
30
|
-
return Math.ceil(text.length / 4);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function chunkText(text: string, chunkSize: number): string[] {
|
|
34
|
-
const chunks: string[] = [];
|
|
35
|
-
let i = 0;
|
|
36
|
-
while (i < text.length) {
|
|
37
|
-
let end = i + chunkSize;
|
|
38
|
-
if (end < text.length) {
|
|
39
|
-
const breakIdx = text.lastIndexOf('\n', end);
|
|
40
|
-
if (breakIdx > i) end = breakIdx + 1;
|
|
41
|
-
}
|
|
42
|
-
chunks.push(text.slice(i, end).trim());
|
|
43
|
-
i = end;
|
|
44
|
-
}
|
|
45
|
-
return chunks;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function delay(ms: number): Promise<void> {
|
|
49
|
-
return new Promise(r => setTimeout(r, ms));
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export function isValidUrl(url: string): boolean {
|
|
53
|
-
try {
|
|
54
|
-
new URL(url);
|
|
55
|
-
return true;
|
|
56
|
-
} catch {
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export function normalizeUrl(url: string, base?: string): string {
|
|
62
|
-
try {
|
|
63
|
-
return new URL(url, base).href;
|
|
64
|
-
} catch {
|
|
65
|
-
return url;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export function isInternalUrl(href: string, base: string): boolean {
|
|
70
|
-
try {
|
|
71
|
-
const baseUrl = new URL(base);
|
|
72
|
-
const target = new URL(href, base);
|
|
73
|
-
return target.hostname === baseUrl.hostname;
|
|
74
|
-
} catch {
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
}
|
package/scrape/vite.config.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "vite";
|
|
2
|
-
import dts from "vite-plugin-dts";
|
|
3
|
-
import { resolve } from "node:path";
|
|
4
|
-
import { randomPort } from './utils/port.js';
|
|
5
|
-
|
|
6
|
-
const VITE_PORT = randomPort();
|
|
7
|
-
|
|
8
|
-
export default defineConfig({
|
|
9
|
-
root: "web",
|
|
10
|
-
build: {
|
|
11
|
-
lib: {
|
|
12
|
-
entry: resolve(__dirname, "index.ts"),
|
|
13
|
-
name: "DevThinkWebScrape",
|
|
14
|
-
formats: ["es", "cjs"],
|
|
15
|
-
fileName: (format) => `index.${format === "es" ? "mjs" : "js"}`,
|
|
16
|
-
},
|
|
17
|
-
rollupOptions: {
|
|
18
|
-
external: [
|
|
19
|
-
"playwright",
|
|
20
|
-
"cheerio",
|
|
21
|
-
"jsdom",
|
|
22
|
-
"turndown",
|
|
23
|
-
"turndown-plugin-gfm",
|
|
24
|
-
"@mozilla/readability",
|
|
25
|
-
"zod",
|
|
26
|
-
"p-retry",
|
|
27
|
-
"p-limit",
|
|
28
|
-
"p-queue",
|
|
29
|
-
"robots-parser",
|
|
30
|
-
"sitemapper",
|
|
31
|
-
"lru-cache",
|
|
32
|
-
"keyv",
|
|
33
|
-
"hono",
|
|
34
|
-
"hono/cors",
|
|
35
|
-
"commander",
|
|
36
|
-
"emittery",
|
|
37
|
-
"normalize-url",
|
|
38
|
-
"node:fs",
|
|
39
|
-
"node:fs/promises",
|
|
40
|
-
"node:path",
|
|
41
|
-
"node:child_process",
|
|
42
|
-
"node:http",
|
|
43
|
-
"node:crypto",
|
|
44
|
-
],
|
|
45
|
-
},
|
|
46
|
-
sourcemap: true,
|
|
47
|
-
minify: false,
|
|
48
|
-
},
|
|
49
|
-
plugins: [dts()],
|
|
50
|
-
server: {
|
|
51
|
-
port: VITE_PORT,
|
|
52
|
-
host: "127.0.0.1",
|
|
53
|
-
cors: true,
|
|
54
|
-
},
|
|
55
|
-
});
|
package/scrape/vitest.config.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "vitest/config";
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
test: {
|
|
5
|
-
environment: "jsdom",
|
|
6
|
-
include: ["tests/**/*.{test,spec}.{ts,mjs}", "tests/**/*.test.ts"],
|
|
7
|
-
globals: true,
|
|
8
|
-
testTimeout: 10000,
|
|
9
|
-
coverage: {
|
|
10
|
-
provider: "v8",
|
|
11
|
-
reporter: ["text", "json", "html"],
|
|
12
|
-
include: ["*.ts"],
|
|
13
|
-
exclude: ["tests/**", "scripts/**", "web/**", "ink-components/**", "node_modules/**", "dist/**", "coverage/**"],
|
|
14
|
-
thresholds: { lines: 60, functions: 50, branches: 50, statements: 60 },
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
});
|
package/server/node.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* node server is an optional adapter around the universal service contract.
|
|
3
|
-
*/
|
|
4
|
-
import { createServer } from "node:http";
|
|
5
|
-
|
|
6
|
-
/** Creates a Node HTTP adapter with explicit host, port, and request handler. */
|
|
7
|
-
export function nodeserver(options = {}) {
|
|
8
|
-
if (!options.host || !Number.isInteger(options.port) || options.port < 1) throw new TypeError("node server requires host and port");
|
|
9
|
-
if (typeof options.handle !== "function") throw new TypeError("node server requires handle");
|
|
10
|
-
/* Request translation stays inside the Node adapter. */
|
|
11
|
-
const server = createServer(async (request, response) => {
|
|
12
|
-
try {
|
|
13
|
-
const chunks = [];
|
|
14
|
-
for await (const chunk of request) chunks.push(chunk);
|
|
15
|
-
const body = Buffer.concat(chunks).toString("utf8");
|
|
16
|
-
const headers = new Headers(request.headers);
|
|
17
|
-
const webrequest = new Request(new URL(request.url ?? "/", `http://${options.host}:${options.port}`), { method: request.method, headers, body: body || undefined });
|
|
18
|
-
const result = await options.handle(webrequest);
|
|
19
|
-
response.statusCode = result.status;
|
|
20
|
-
result.headers.forEach((value, key) => response.setHeader(key, value));
|
|
21
|
-
response.end(Buffer.from(await result.arrayBuffer()));
|
|
22
|
-
} catch (error) {
|
|
23
|
-
response.statusCode = 500;
|
|
24
|
-
response.setHeader("content-type", "application/json");
|
|
25
|
-
response.end(JSON.stringify({ error: error.message }));
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
/* Lifecycle methods keep the server optional for library consumers. */
|
|
29
|
-
return {
|
|
30
|
-
server,
|
|
31
|
-
listen() { return new Promise((resolve, reject) => { server.once("error", reject); server.listen(options.port, options.host, () => resolve({ host: options.host, port: options.port })); }); },
|
|
32
|
-
close() { return new Promise((resolve, reject) => server.close((error) => error ? reject(error) : resolve())); }
|
|
33
|
-
};
|
|
34
|
-
}
|
package/sessions/file.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* file session persistence writes one validated JSON document per session.
|
|
3
|
-
*/
|
|
4
|
-
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
5
|
-
import { dirname, join } from "node:path";
|
|
6
|
-
import { validatesession } from "../domain/sessions.js";
|
|
7
|
-
|
|
8
|
-
export function filesessions(root) {
|
|
9
|
-
return {
|
|
10
|
-
async save(session) { const valid = validatesession(session); const path = join(root, `${valid.id}.json`); await mkdir(dirname(path), { recursive: true }); await writeFile(path, JSON.stringify(valid, null, 2)); return valid; },
|
|
11
|
-
async load(id) { const value = JSON.parse(await readFile(join(root, `${id}.json`), "utf8")); return validatesession(value); }
|
|
12
|
-
};
|
|
13
|
-
}
|
package/sessions/replay.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* replay maps validated session events to an injected browser adapter.
|
|
3
|
-
*/
|
|
4
|
-
export async function replay(session, adapter, options = {}) {
|
|
5
|
-
if (!session?.events || typeof adapter?.move !== "function") throw new TypeError("replay requires session events and browser adapter");
|
|
6
|
-
const speed = options.speed ?? 1;
|
|
7
|
-
let previous = 0;
|
|
8
|
-
let currentcontext = normalizecontext(options.initialcontext);
|
|
9
|
-
let contextswitches = 0;
|
|
10
|
-
for (const event of session.events) {
|
|
11
|
-
const wait = Math.max(0, (event.t - previous) / speed);
|
|
12
|
-
if (wait) await delay(wait);
|
|
13
|
-
previous = event.t;
|
|
14
|
-
const eventcontext = normalizecontext(event.context ?? event);
|
|
15
|
-
if (eventcontext && contextchanged(currentcontext, eventcontext)) {
|
|
16
|
-
await restorecontext(adapter, eventcontext, currentcontext);
|
|
17
|
-
currentcontext = eventcontext;
|
|
18
|
-
contextswitches += 1;
|
|
19
|
-
}
|
|
20
|
-
if (event.type === "move") await adapter.move(event);
|
|
21
|
-
else if (event.type === "click") await adapter.click(event);
|
|
22
|
-
else if (event.type === "drag") await adapter.drag(event);
|
|
23
|
-
else if (event.type === "scroll") await adapter.scroll(event);
|
|
24
|
-
else if (event.type === "key") await adapter.key(event);
|
|
25
|
-
}
|
|
26
|
-
return { events: session.events.length, duration: previous / speed, contextswitches };
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function normalizecontext(value) {
|
|
30
|
-
if (value === undefined || value === null) return undefined;
|
|
31
|
-
if (typeof value !== "object" || Array.isArray(value)) throw new TypeError("replay context must be an object");
|
|
32
|
-
const context = {};
|
|
33
|
-
for (const name of ["windowid", "tabid", "frameid"]) if (value[name] !== undefined) {
|
|
34
|
-
if (typeof value[name] !== "string" || !value[name]) throw new TypeError(`replay ${name} must be a non-empty string`);
|
|
35
|
-
context[name] = value[name];
|
|
36
|
-
}
|
|
37
|
-
return Object.keys(context).length ? context : undefined;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function contextchanged(previous, next) {
|
|
41
|
-
return ["windowid", "tabid", "frameid"].some((name) => previous?.[name] !== next[name]);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
async function restorecontext(adapter, next, previous) {
|
|
45
|
-
if (typeof adapter.restorecontext === "function") {
|
|
46
|
-
await adapter.restorecontext({ ...next }, previous ? { ...previous } : undefined);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
const methods = [["windowid", "selectwindow"], ["tabid", "selecttab"], ["frameid", "selectframe"]];
|
|
50
|
-
for (const [name, method] of methods) if (next[name] !== undefined && previous?.[name] !== next[name]) {
|
|
51
|
-
if (typeof adapter[method] !== "function") {
|
|
52
|
-
const error = new Error(`replay adapter cannot restore ${name}`);
|
|
53
|
-
error.code = "REPLAY_CONTEXT_UNSUPPORTED";
|
|
54
|
-
error.context = name;
|
|
55
|
-
throw error;
|
|
56
|
-
}
|
|
57
|
-
await adapter[method](next[name], { ...next });
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function delay(milliseconds) { return new Promise((resolve) => setTimeout(resolve, milliseconds)); }
|
package/sessions/store.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* jsonl session storage keeps append only traces independent from browser adapters.
|
|
3
|
-
*/
|
|
4
|
-
import { appendFile, mkdir, readFile } from "node:fs/promises";
|
|
5
|
-
import { join } from "node:path";
|
|
6
|
-
import { validatesession } from "../domain/sessions.js";
|
|
7
|
-
|
|
8
|
-
export function sessionstore(root) {
|
|
9
|
-
return {
|
|
10
|
-
async append(session) { const valid = validatesession(session); await mkdir(root, { recursive: true }); await appendFile(join(root, `${valid.id}.jsonl`), `${JSON.stringify(valid)}\n`); return valid; },
|
|
11
|
-
async read(id) { const text = await readFile(join(root, `${id}.jsonl`), "utf8"); return text.trim().split("\n").filter(Boolean).map((line) => validatesession(JSON.parse(line))); }
|
|
12
|
-
};
|
|
13
|
-
}
|
package/storage/adapter.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* storage adapters keep remote services out of the engine core.
|
|
3
|
-
*/
|
|
4
|
-
export function storageadapter(methods) {
|
|
5
|
-
const required = ["put", "get", "head", "delete", "list"];
|
|
6
|
-
for (const name of required) if (typeof methods?.[name] !== "function") throw new TypeError(`storage adapter requires ${name}`);
|
|
7
|
-
return methods;
|
|
8
|
-
}
|
package/storage/cache.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* tiered cache keeps a bounded hot tier and an optional persistent cold tier with stale-while-revalidate.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/** Creates a cache with caller supplied encode, decode, clock and persistent storage policies. */
|
|
6
|
-
export function tieredcache(options = {}) {
|
|
7
|
-
const hot = new Map();
|
|
8
|
-
const maxentries = Number(options.maxentries ?? 256);
|
|
9
|
-
const ttl = Number(options.ttl ?? 300000);
|
|
10
|
-
const stale = Number(options.stale ?? ttl);
|
|
11
|
-
const now = options.now ?? (() => Date.now());
|
|
12
|
-
const cold = options.storage;
|
|
13
|
-
const encode = options.encode ?? ((value) => new TextEncoder().encode(JSON.stringify(value)));
|
|
14
|
-
const decode = options.decode ?? ((bytes) => JSON.parse(new TextDecoder().decode(bytes)));
|
|
15
|
-
const stats = { hits: 0, misses: 0, stalehits: 0, evictions: 0, revalidations: 0 };
|
|
16
|
-
|
|
17
|
-
function readhot(key) {
|
|
18
|
-
const item = hot.get(key);
|
|
19
|
-
if (!item) return null;
|
|
20
|
-
const current = now();
|
|
21
|
-
if (current <= item.expires) { stats.hits += 1; return { value: item.value, fresh: true }; }
|
|
22
|
-
if (current <= item.stale) { stats.stalehits += 1; return { value: item.value, fresh: false }; }
|
|
23
|
-
hot.delete(key);
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function writehot(key, value, options = {}) {
|
|
28
|
-
if (hot.size >= maxentries && !hot.has(key)) { hot.delete(hot.keys().next().value); stats.evictions += 1; }
|
|
29
|
-
const current = now();
|
|
30
|
-
hot.set(key, { value, expires: current + Number(options.ttl ?? ttl), stale: current + Number(options.stale ?? stale) });
|
|
31
|
-
return value;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async function get(key, options = {}) {
|
|
35
|
-
const hotvalue = readhot(key);
|
|
36
|
-
if (hotvalue?.fresh || (hotvalue && options.allowstale !== false)) return hotvalue.value;
|
|
37
|
-
if (!cold) { stats.misses += 1; return null; }
|
|
38
|
-
try { const value = decode(await cold.get(key)); writehot(key, value, options); return value; } catch { stats.misses += 1; return null; }
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
async function set(key, value, valueoptions = {}) { writehot(key, value, valueoptions); if (cold) await cold.put({ key, data: encode(value), contenttype: "application/json" }); return value; }
|
|
42
|
-
async function getorload(key, loader, options = {}) {
|
|
43
|
-
if (typeof loader !== "function") throw new TypeError("cache loader must be a function");
|
|
44
|
-
const current = readhot(key);
|
|
45
|
-
if (current?.fresh) return current.value;
|
|
46
|
-
if (current && options.allowstale !== false) { stats.revalidations += 1; Promise.resolve(loader()).then((value) => set(key, value, options)).catch(() => undefined); return current.value; }
|
|
47
|
-
const value = await loader();
|
|
48
|
-
return set(key, value, options);
|
|
49
|
-
}
|
|
50
|
-
async function remove(key) { hot.delete(key); await cold?.delete?.(key); }
|
|
51
|
-
function clear() { hot.clear(); }
|
|
52
|
-
function inspect() { return { ...stats, hotentries: hot.size, maxentries, ttl, stale }; }
|
|
53
|
-
return { get, set, getorload, delete: remove, clear, inspect };
|
|
54
|
-
}
|
package/storage/checksum.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* byte collection and hashing are grouped because every storage adapter uses them.
|
|
3
|
-
*/
|
|
4
|
-
import { sha256 } from "../core/hash.js";
|
|
5
|
-
|
|
6
|
-
export { sha256 } from "../core/hash.js";
|
|
7
|
-
|
|
8
|
-
export async function collectbytes(input) {
|
|
9
|
-
if (input instanceof Uint8Array) return input;
|
|
10
|
-
const chunks = [];
|
|
11
|
-
let size = 0;
|
|
12
|
-
for await (const chunk of input) { chunks.push(chunk); size += chunk.byteLength; }
|
|
13
|
-
const output = new Uint8Array(size);
|
|
14
|
-
let offset = 0;
|
|
15
|
-
for (const chunk of chunks) { output.set(chunk, offset); offset += chunk.byteLength; }
|
|
16
|
-
return output;
|
|
17
|
-
}
|