dp-worker 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/builtin-skills/sourcepool.md +228 -0
- package/builtin-skills/x.md +263 -0
- package/config.example.json +37 -0
- package/dist/agent/agent-types.d.ts +44 -0
- package/dist/agent/agent-types.js +23 -0
- package/dist/agent/agent-types.js.map +1 -0
- package/dist/agent/agent.d.ts +162 -0
- package/dist/agent/agent.js +670 -0
- package/dist/agent/agent.js.map +1 -0
- package/dist/agent/browser-lock.d.ts +36 -0
- package/dist/agent/browser-lock.js +46 -0
- package/dist/agent/browser-lock.js.map +1 -0
- package/dist/agent/chat-engine.d.ts +87 -0
- package/dist/agent/chat-engine.js +588 -0
- package/dist/agent/chat-engine.js.map +1 -0
- package/dist/agent/chrome-watchdog.d.ts +74 -0
- package/dist/agent/chrome-watchdog.js +136 -0
- package/dist/agent/chrome-watchdog.js.map +1 -0
- package/dist/agent/context.d.ts +148 -0
- package/dist/agent/context.js +521 -0
- package/dist/agent/context.js.map +1 -0
- package/dist/agent/duration.d.ts +2 -0
- package/dist/agent/duration.js +15 -0
- package/dist/agent/duration.js.map +1 -0
- package/dist/agent/executors/attachment-executor.d.ts +19 -0
- package/dist/agent/executors/attachment-executor.js +136 -0
- package/dist/agent/executors/attachment-executor.js.map +1 -0
- package/dist/agent/executors/memory-executor.d.ts +2 -0
- package/dist/agent/executors/memory-executor.js +13 -0
- package/dist/agent/executors/memory-executor.js.map +1 -0
- package/dist/agent/executors/org-executor.d.ts +8 -0
- package/dist/agent/executors/org-executor.js +47 -0
- package/dist/agent/executors/org-executor.js.map +1 -0
- package/dist/agent/executors/scheduler-executor.d.ts +21 -0
- package/dist/agent/executors/scheduler-executor.js +75 -0
- package/dist/agent/executors/scheduler-executor.js.map +1 -0
- package/dist/agent/executors/skill-executor.d.ts +10 -0
- package/dist/agent/executors/skill-executor.js +178 -0
- package/dist/agent/executors/skill-executor.js.map +1 -0
- package/dist/agent/executors/store-executor.d.ts +2 -0
- package/dist/agent/executors/store-executor.js +42 -0
- package/dist/agent/executors/store-executor.js.map +1 -0
- package/dist/agent/executors/web-fetch-executor.d.ts +17 -0
- package/dist/agent/executors/web-fetch-executor.js +164 -0
- package/dist/agent/executors/web-fetch-executor.js.map +1 -0
- package/dist/agent/frontend-multiplexer.d.ts +38 -0
- package/dist/agent/frontend-multiplexer.js +67 -0
- package/dist/agent/frontend-multiplexer.js.map +1 -0
- package/dist/agent/image-generator.d.ts +35 -0
- package/dist/agent/image-generator.js +266 -0
- package/dist/agent/image-generator.js.map +1 -0
- package/dist/agent/image-postprocess.d.ts +25 -0
- package/dist/agent/image-postprocess.js +82 -0
- package/dist/agent/image-postprocess.js.map +1 -0
- package/dist/agent/memory.d.ts +55 -0
- package/dist/agent/memory.js +401 -0
- package/dist/agent/memory.js.map +1 -0
- package/dist/agent/org-manager.d.ts +70 -0
- package/dist/agent/org-manager.js +280 -0
- package/dist/agent/org-manager.js.map +1 -0
- package/dist/agent/scheduler.d.ts +51 -0
- package/dist/agent/scheduler.js +302 -0
- package/dist/agent/scheduler.js.map +1 -0
- package/dist/agent/skill-generator.d.ts +116 -0
- package/dist/agent/skill-generator.js +704 -0
- package/dist/agent/skill-generator.js.map +1 -0
- package/dist/agent/storage-policy.d.ts +55 -0
- package/dist/agent/storage-policy.js +406 -0
- package/dist/agent/storage-policy.js.map +1 -0
- package/dist/agent/store.d.ts +58 -0
- package/dist/agent/store.js +309 -0
- package/dist/agent/store.js.map +1 -0
- package/dist/agent/task-runner.d.ts +34 -0
- package/dist/agent/task-runner.js +705 -0
- package/dist/agent/task-runner.js.map +1 -0
- package/dist/agent/tool-loop-detection.d.ts +60 -0
- package/dist/agent/tool-loop-detection.js +233 -0
- package/dist/agent/tool-loop-detection.js.map +1 -0
- package/dist/agent/tool-runner.d.ts +37 -0
- package/dist/agent/tool-runner.js +72 -0
- package/dist/agent/tool-runner.js.map +1 -0
- package/dist/browser/actions.d.ts +217 -0
- package/dist/browser/actions.js +3097 -0
- package/dist/browser/actions.js.map +1 -0
- package/dist/browser/builtin-page-cleanups.d.ts +19 -0
- package/dist/browser/builtin-page-cleanups.js +111 -0
- package/dist/browser/builtin-page-cleanups.js.map +1 -0
- package/dist/browser/chrome-process.d.ts +55 -0
- package/dist/browser/chrome-process.js +288 -0
- package/dist/browser/chrome-process.js.map +1 -0
- package/dist/browser/dispatch.d.ts +32 -0
- package/dist/browser/dispatch.js +582 -0
- package/dist/browser/dispatch.js.map +1 -0
- package/dist/browser/dom-helpers.d.ts +68 -0
- package/dist/browser/dom-helpers.js +477 -0
- package/dist/browser/dom-helpers.js.map +1 -0
- package/dist/browser/expect.d.ts +66 -0
- package/dist/browser/expect.js +314 -0
- package/dist/browser/expect.js.map +1 -0
- package/dist/browser/humanize.d.ts +56 -0
- package/dist/browser/humanize.js +216 -0
- package/dist/browser/humanize.js.map +1 -0
- package/dist/browser/locator-resolver.d.ts +88 -0
- package/dist/browser/locator-resolver.js +302 -0
- package/dist/browser/locator-resolver.js.map +1 -0
- package/dist/browser/manager.d.ts +95 -0
- package/dist/browser/manager.js +389 -0
- package/dist/browser/manager.js.map +1 -0
- package/dist/browser/script-runner.d.ts +117 -0
- package/dist/browser/script-runner.js +305 -0
- package/dist/browser/script-runner.js.map +1 -0
- package/dist/browser/selectors.d.ts +41 -0
- package/dist/browser/selectors.js +165 -0
- package/dist/browser/selectors.js.map +1 -0
- package/dist/browser/snapshot.d.ts +129 -0
- package/dist/browser/snapshot.js +504 -0
- package/dist/browser/snapshot.js.map +1 -0
- package/dist/browser/workspace-lock.d.ts +37 -0
- package/dist/browser/workspace-lock.js +286 -0
- package/dist/browser/workspace-lock.js.map +1 -0
- package/dist/center/center-client.d.ts +124 -0
- package/dist/center/center-client.js +316 -0
- package/dist/center/center-client.js.map +1 -0
- package/dist/center/center-frontend.d.ts +92 -0
- package/dist/center/center-frontend.js +459 -0
- package/dist/center/center-frontend.js.map +1 -0
- package/dist/center/session-sync.d.ts +85 -0
- package/dist/center/session-sync.js +345 -0
- package/dist/center/session-sync.js.map +1 -0
- package/dist/config/center-config.d.ts +60 -0
- package/dist/config/center-config.js +92 -0
- package/dist/config/center-config.js.map +1 -0
- package/dist/config/types.d.ts +93 -0
- package/dist/config/types.js +136 -0
- package/dist/config/types.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +395 -0
- package/dist/index.js.map +1 -0
- package/dist/llm/client.d.ts +24 -0
- package/dist/llm/client.js +696 -0
- package/dist/llm/client.js.map +1 -0
- package/dist/llm/message-optimizer.d.ts +50 -0
- package/dist/llm/message-optimizer.js +337 -0
- package/dist/llm/message-optimizer.js.map +1 -0
- package/dist/llm/tools.d.ts +37 -0
- package/dist/llm/tools.js +895 -0
- package/dist/llm/tools.js.map +1 -0
- package/dist/llm/types.d.ts +96 -0
- package/dist/llm/types.js +2 -0
- package/dist/llm/types.js.map +1 -0
- package/dist/logging/logger.d.ts +17 -0
- package/dist/logging/logger.js +54 -0
- package/dist/logging/logger.js.map +1 -0
- package/dist/scripts/migrate-history-to-store.d.ts +2 -0
- package/dist/scripts/migrate-history-to-store.js +250 -0
- package/dist/scripts/migrate-history-to-store.js.map +1 -0
- package/dist/telegram/bot.d.ts +28 -0
- package/dist/telegram/bot.js +546 -0
- package/dist/telegram/bot.js.map +1 -0
- package/dist/tui/tui.d.ts +12 -0
- package/dist/tui/tui.js +177 -0
- package/dist/tui/tui.js.map +1 -0
- package/dist/utils/safe-slice.d.ts +25 -0
- package/dist/utils/safe-slice.js +43 -0
- package/dist/utils/safe-slice.js.map +1 -0
- package/node_modules/dp-shared/dist/admin-broadcast.d.ts +26 -0
- package/node_modules/dp-shared/dist/admin-broadcast.d.ts.map +1 -0
- package/node_modules/dp-shared/dist/admin-broadcast.js +7 -0
- package/node_modules/dp-shared/dist/admin-broadcast.js.map +1 -0
- package/node_modules/dp-shared/dist/audit-contracts.d.ts +41 -0
- package/node_modules/dp-shared/dist/audit-contracts.d.ts.map +1 -0
- package/node_modules/dp-shared/dist/audit-contracts.js +30 -0
- package/node_modules/dp-shared/dist/audit-contracts.js.map +1 -0
- package/node_modules/dp-shared/dist/configs-contracts.d.ts +187 -0
- package/node_modules/dp-shared/dist/configs-contracts.d.ts.map +1 -0
- package/node_modules/dp-shared/dist/configs-contracts.js +165 -0
- package/node_modules/dp-shared/dist/configs-contracts.js.map +1 -0
- package/node_modules/dp-shared/dist/db-rows.d.ts +293 -0
- package/node_modules/dp-shared/dist/db-rows.d.ts.map +1 -0
- package/node_modules/dp-shared/dist/db-rows.js +222 -0
- package/node_modules/dp-shared/dist/db-rows.js.map +1 -0
- package/node_modules/dp-shared/dist/deploy-contracts.d.ts +34 -0
- package/node_modules/dp-shared/dist/deploy-contracts.d.ts.map +1 -0
- package/node_modules/dp-shared/dist/deploy-contracts.js +32 -0
- package/node_modules/dp-shared/dist/deploy-contracts.js.map +1 -0
- package/node_modules/dp-shared/dist/domain.d.ts +144 -0
- package/node_modules/dp-shared/dist/domain.d.ts.map +1 -0
- package/node_modules/dp-shared/dist/domain.js +81 -0
- package/node_modules/dp-shared/dist/domain.js.map +1 -0
- package/node_modules/dp-shared/dist/identities.d.ts +35 -0
- package/node_modules/dp-shared/dist/identities.d.ts.map +1 -0
- package/node_modules/dp-shared/dist/identities.js +27 -0
- package/node_modules/dp-shared/dist/identities.js.map +1 -0
- package/node_modules/dp-shared/dist/index.d.ts +24 -0
- package/node_modules/dp-shared/dist/index.d.ts.map +1 -0
- package/node_modules/dp-shared/dist/index.js +24 -0
- package/node_modules/dp-shared/dist/index.js.map +1 -0
- package/node_modules/dp-shared/dist/rest-contracts.d.ts +459 -0
- package/node_modules/dp-shared/dist/rest-contracts.d.ts.map +1 -0
- package/node_modules/dp-shared/dist/rest-contracts.js +318 -0
- package/node_modules/dp-shared/dist/rest-contracts.js.map +1 -0
- package/node_modules/dp-shared/dist/task-history-contracts.d.ts +210 -0
- package/node_modules/dp-shared/dist/task-history-contracts.d.ts.map +1 -0
- package/node_modules/dp-shared/dist/task-history-contracts.js +99 -0
- package/node_modules/dp-shared/dist/task-history-contracts.js.map +1 -0
- package/node_modules/dp-shared/dist/worker-detail-contracts.d.ts +212 -0
- package/node_modules/dp-shared/dist/worker-detail-contracts.d.ts.map +1 -0
- package/node_modules/dp-shared/dist/worker-detail-contracts.js +193 -0
- package/node_modules/dp-shared/dist/worker-detail-contracts.js.map +1 -0
- package/node_modules/dp-shared/dist/ws-protocol.d.ts +839 -0
- package/node_modules/dp-shared/dist/ws-protocol.d.ts.map +1 -0
- package/node_modules/dp-shared/dist/ws-protocol.js +264 -0
- package/node_modules/dp-shared/dist/ws-protocol.js.map +1 -0
- package/node_modules/dp-shared/package.json +31 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +191 -0
- package/node_modules/zod/index.cjs +33 -0
- package/node_modules/zod/index.d.cts +4 -0
- package/node_modules/zod/index.d.ts +4 -0
- package/node_modules/zod/index.js +4 -0
- package/node_modules/zod/locales/index.cjs +17 -0
- package/node_modules/zod/locales/index.d.cts +1 -0
- package/node_modules/zod/locales/index.d.ts +1 -0
- package/node_modules/zod/locales/index.js +1 -0
- package/node_modules/zod/locales/package.json +7 -0
- package/node_modules/zod/mini/index.cjs +32 -0
- package/node_modules/zod/mini/index.d.cts +3 -0
- package/node_modules/zod/mini/index.d.ts +3 -0
- package/node_modules/zod/mini/index.js +3 -0
- package/node_modules/zod/mini/package.json +7 -0
- package/node_modules/zod/package.json +135 -0
- package/node_modules/zod/src/index.ts +4 -0
- package/node_modules/zod/src/locales/index.ts +1 -0
- package/node_modules/zod/src/mini/index.ts +3 -0
- package/node_modules/zod/src/v3/ZodError.ts +330 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
- package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/zod/src/v3/tests/error.test.ts +551 -0
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
- package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
- package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object.test.ts +434 -0
- package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
- package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/zod/src/v3/tests/string.test.ts +916 -0
- package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/zod/src/v3/types.ts +5138 -0
- package/node_modules/zod/src/v4/classic/checks.ts +32 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +70 -0
- package/node_modules/zod/src/v4/classic/errors.ts +82 -0
- package/node_modules/zod/src/v4/classic/external.ts +52 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +659 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +90 -0
- package/node_modules/zod/src/v4/classic/parse.ts +82 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2672 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +59 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +216 -0
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +326 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +573 -0
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +703 -0
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +62 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +302 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +409 -0
- package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +197 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +694 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +807 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +895 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +360 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +939 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +60 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +198 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +46 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +117 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +330 -0
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +325 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +717 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +333 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +450 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +74 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +717 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +631 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +633 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +181 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +134 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +1224 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +771 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +3125 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +496 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +273 -0
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/zod/src/v4/core/api.ts +1823 -0
- package/node_modules/zod/src/v4/core/checks.ts +1293 -0
- package/node_modules/zod/src/v4/core/config.ts +15 -0
- package/node_modules/zod/src/v4/core/core.ts +153 -0
- package/node_modules/zod/src/v4/core/doc.ts +44 -0
- package/node_modules/zod/src/v4/core/errors.ts +455 -0
- package/node_modules/zod/src/v4/core/index.ts +16 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +126 -0
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +666 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +147 -0
- package/node_modules/zod/src/v4/core/parse.ts +195 -0
- package/node_modules/zod/src/v4/core/regexes.ts +190 -0
- package/node_modules/zod/src/v4/core/registries.ts +105 -0
- package/node_modules/zod/src/v4/core/schemas.ts +4730 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
- package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
- package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +215 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +181 -0
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
- package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
- package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
- package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
- package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
- package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +622 -0
- package/node_modules/zod/src/v4/core/util.ts +983 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +115 -0
- package/node_modules/zod/src/v4/locales/az.ts +111 -0
- package/node_modules/zod/src/v4/locales/be.ts +176 -0
- package/node_modules/zod/src/v4/locales/bg.ts +128 -0
- package/node_modules/zod/src/v4/locales/ca.ts +116 -0
- package/node_modules/zod/src/v4/locales/cs.ts +118 -0
- package/node_modules/zod/src/v4/locales/da.ts +123 -0
- package/node_modules/zod/src/v4/locales/de.ts +116 -0
- package/node_modules/zod/src/v4/locales/el.ts +121 -0
- package/node_modules/zod/src/v4/locales/en.ts +123 -0
- package/node_modules/zod/src/v4/locales/eo.ts +118 -0
- package/node_modules/zod/src/v4/locales/es.ts +141 -0
- package/node_modules/zod/src/v4/locales/fa.ts +126 -0
- package/node_modules/zod/src/v4/locales/fi.ts +121 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +116 -0
- package/node_modules/zod/src/v4/locales/fr.ts +132 -0
- package/node_modules/zod/src/v4/locales/he.ts +246 -0
- package/node_modules/zod/src/v4/locales/hr.ts +131 -0
- package/node_modules/zod/src/v4/locales/hu.ts +117 -0
- package/node_modules/zod/src/v4/locales/hy.ts +164 -0
- package/node_modules/zod/src/v4/locales/id.ts +115 -0
- package/node_modules/zod/src/v4/locales/index.ts +52 -0
- package/node_modules/zod/src/v4/locales/is.ts +119 -0
- package/node_modules/zod/src/v4/locales/it.ts +116 -0
- package/node_modules/zod/src/v4/locales/ja.ts +114 -0
- package/node_modules/zod/src/v4/locales/ka.ts +123 -0
- package/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/node_modules/zod/src/v4/locales/km.ts +119 -0
- package/node_modules/zod/src/v4/locales/ko.ts +121 -0
- package/node_modules/zod/src/v4/locales/lt.ts +239 -0
- package/node_modules/zod/src/v4/locales/mk.ts +118 -0
- package/node_modules/zod/src/v4/locales/ms.ts +115 -0
- package/node_modules/zod/src/v4/locales/nl.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +116 -0
- package/node_modules/zod/src/v4/locales/ota.ts +117 -0
- package/node_modules/zod/src/v4/locales/pl.ts +118 -0
- package/node_modules/zod/src/v4/locales/ps.ts +126 -0
- package/node_modules/zod/src/v4/locales/pt.ts +116 -0
- package/node_modules/zod/src/v4/locales/ro.ts +129 -0
- package/node_modules/zod/src/v4/locales/ru.ts +176 -0
- package/node_modules/zod/src/v4/locales/sl.ts +118 -0
- package/node_modules/zod/src/v4/locales/sv.ts +119 -0
- package/node_modules/zod/src/v4/locales/ta.ts +118 -0
- package/node_modules/zod/src/v4/locales/th.ts +119 -0
- package/node_modules/zod/src/v4/locales/tr.ts +111 -0
- package/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/node_modules/zod/src/v4/locales/uk.ts +117 -0
- package/node_modules/zod/src/v4/locales/ur.ts +119 -0
- package/node_modules/zod/src/v4/locales/uz.ts +117 -0
- package/node_modules/zod/src/v4/locales/vi.ts +117 -0
- package/node_modules/zod/src/v4/locales/yo.ts +124 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +116 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +115 -0
- package/node_modules/zod/src/v4/mini/checks.ts +32 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
- package/node_modules/zod/src/v4/mini/external.ts +41 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +66 -0
- package/node_modules/zod/src/v4/mini/parse.ts +14 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +1947 -0
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +24 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +548 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +5 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +993 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +227 -0
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +325 -0
- package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +352 -0
- package/node_modules/zod/src/v4-mini/index.ts +3 -0
- package/node_modules/zod/v3/ZodError.cjs +138 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +133 -0
- package/node_modules/zod/v3/errors.cjs +17 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +22 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +33 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +112 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/package.json +7 -0
- package/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3777 -0
- package/node_modules/zod/v3/types.d.cts +1034 -0
- package/node_modules/zod/v3/types.d.ts +1034 -0
- package/node_modules/zod/v3/types.js +3695 -0
- package/node_modules/zod/v4/classic/checks.cjs +33 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +61 -0
- package/node_modules/zod/v4/classic/compat.d.cts +50 -0
- package/node_modules/zod/v4/classic/compat.d.ts +50 -0
- package/node_modules/zod/v4/classic/compat.js +31 -0
- package/node_modules/zod/v4/classic/errors.cjs +74 -0
- package/node_modules/zod/v4/classic/errors.d.cts +30 -0
- package/node_modules/zod/v4/classic/errors.d.ts +30 -0
- package/node_modules/zod/v4/classic/errors.js +48 -0
- package/node_modules/zod/v4/classic/external.cjs +73 -0
- package/node_modules/zod/v4/classic/external.d.cts +16 -0
- package/node_modules/zod/v4/classic/external.d.ts +16 -0
- package/node_modules/zod/v4/classic/external.js +20 -0
- package/node_modules/zod/v4/classic/from-json-schema.cjs +625 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.js +599 -0
- package/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/zod/v4/classic/index.d.cts +4 -0
- package/node_modules/zod/v4/classic/index.d.ts +4 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +60 -0
- package/node_modules/zod/v4/classic/iso.d.cts +22 -0
- package/node_modules/zod/v4/classic/iso.d.ts +22 -0
- package/node_modules/zod/v4/classic/iso.js +30 -0
- package/node_modules/zod/v4/classic/package.json +7 -0
- package/node_modules/zod/v4/classic/parse.cjs +41 -0
- package/node_modules/zod/v4/classic/parse.d.cts +31 -0
- package/node_modules/zod/v4/classic/parse.d.ts +31 -0
- package/node_modules/zod/v4/classic/parse.js +15 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1511 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +767 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +767 -0
- package/node_modules/zod/v4/classic/schemas.js +1395 -0
- package/node_modules/zod/v4/core/api.cjs +1227 -0
- package/node_modules/zod/v4/core/api.d.cts +325 -0
- package/node_modules/zod/v4/core/api.d.ts +325 -0
- package/node_modules/zod/v4/core/api.js +1087 -0
- package/node_modules/zod/v4/core/checks.cjs +601 -0
- package/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/zod/v4/core/checks.js +575 -0
- package/node_modules/zod/v4/core/core.cjs +85 -0
- package/node_modules/zod/v4/core/core.d.cts +70 -0
- package/node_modules/zod/v4/core/core.d.ts +70 -0
- package/node_modules/zod/v4/core/core.js +78 -0
- package/node_modules/zod/v4/core/doc.cjs +39 -0
- package/node_modules/zod/v4/core/doc.d.cts +14 -0
- package/node_modules/zod/v4/core/doc.d.ts +14 -0
- package/node_modules/zod/v4/core/doc.js +35 -0
- package/node_modules/zod/v4/core/errors.cjs +216 -0
- package/node_modules/zod/v4/core/errors.d.cts +221 -0
- package/node_modules/zod/v4/core/errors.d.ts +221 -0
- package/node_modules/zod/v4/core/errors.js +185 -0
- package/node_modules/zod/v4/core/index.cjs +47 -0
- package/node_modules/zod/v4/core/index.d.cts +16 -0
- package/node_modules/zod/v4/core/index.d.ts +16 -0
- package/node_modules/zod/v4/core/index.js +16 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +99 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.js +95 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +644 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +601 -0
- package/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +88 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +88 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/package.json +7 -0
- package/node_modules/zod/v4/core/parse.cjs +131 -0
- package/node_modules/zod/v4/core/parse.d.cts +49 -0
- package/node_modules/zod/v4/core/parse.d.ts +49 -0
- package/node_modules/zod/v4/core/parse.js +93 -0
- package/node_modules/zod/v4/core/regexes.cjs +172 -0
- package/node_modules/zod/v4/core/regexes.d.cts +85 -0
- package/node_modules/zod/v4/core/regexes.d.ts +85 -0
- package/node_modules/zod/v4/core/regexes.js +139 -0
- package/node_modules/zod/v4/core/registries.cjs +56 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +2270 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1184 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1184 -0
- package/node_modules/zod/v4/core/schemas.js +2239 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +457 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +114 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +114 -0
- package/node_modules/zod/v4/core/to-json-schema.js +448 -0
- package/node_modules/zod/v4/core/util.cjs +734 -0
- package/node_modules/zod/v4/core/util.d.cts +200 -0
- package/node_modules/zod/v4/core/util.d.ts +200 -0
- package/node_modules/zod/v4/core/util.js +674 -0
- package/node_modules/zod/v4/core/versions.cjs +8 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/index.cjs +22 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +3 -0
- package/node_modules/zod/v4/locales/ar.cjs +133 -0
- package/node_modules/zod/v4/locales/ar.d.cts +5 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +106 -0
- package/node_modules/zod/v4/locales/az.cjs +132 -0
- package/node_modules/zod/v4/locales/az.d.cts +5 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +105 -0
- package/node_modules/zod/v4/locales/be.cjs +183 -0
- package/node_modules/zod/v4/locales/be.d.cts +5 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +156 -0
- package/node_modules/zod/v4/locales/bg.cjs +147 -0
- package/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/node_modules/zod/v4/locales/bg.js +120 -0
- package/node_modules/zod/v4/locales/ca.cjs +134 -0
- package/node_modules/zod/v4/locales/ca.d.cts +5 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +107 -0
- package/node_modules/zod/v4/locales/cs.cjs +138 -0
- package/node_modules/zod/v4/locales/cs.d.cts +5 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +111 -0
- package/node_modules/zod/v4/locales/da.cjs +142 -0
- package/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/node_modules/zod/v4/locales/da.js +115 -0
- package/node_modules/zod/v4/locales/de.cjs +135 -0
- package/node_modules/zod/v4/locales/de.d.cts +5 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +108 -0
- package/node_modules/zod/v4/locales/el.cjs +136 -0
- package/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/node_modules/zod/v4/locales/el.js +109 -0
- package/node_modules/zod/v4/locales/en.cjs +140 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +4 -0
- package/node_modules/zod/v4/locales/en.js +113 -0
- package/node_modules/zod/v4/locales/eo.cjs +136 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +4 -0
- package/node_modules/zod/v4/locales/eo.js +109 -0
- package/node_modules/zod/v4/locales/es.cjs +159 -0
- package/node_modules/zod/v4/locales/es.d.cts +5 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +132 -0
- package/node_modules/zod/v4/locales/fa.cjs +141 -0
- package/node_modules/zod/v4/locales/fa.d.cts +5 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +114 -0
- package/node_modules/zod/v4/locales/fi.cjs +139 -0
- package/node_modules/zod/v4/locales/fi.d.cts +5 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +112 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +134 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +107 -0
- package/node_modules/zod/v4/locales/fr.cjs +152 -0
- package/node_modules/zod/v4/locales/fr.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +125 -0
- package/node_modules/zod/v4/locales/he.cjs +241 -0
- package/node_modules/zod/v4/locales/he.d.cts +5 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +214 -0
- package/node_modules/zod/v4/locales/hr.cjs +149 -0
- package/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/node_modules/zod/v4/locales/hr.js +122 -0
- package/node_modules/zod/v4/locales/hu.cjs +135 -0
- package/node_modules/zod/v4/locales/hu.d.cts +5 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +108 -0
- package/node_modules/zod/v4/locales/hy.cjs +174 -0
- package/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/node_modules/zod/v4/locales/hy.js +147 -0
- package/node_modules/zod/v4/locales/id.cjs +133 -0
- package/node_modules/zod/v4/locales/id.d.cts +5 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +106 -0
- package/node_modules/zod/v4/locales/index.cjs +111 -0
- package/node_modules/zod/v4/locales/index.d.cts +52 -0
- package/node_modules/zod/v4/locales/index.d.ts +52 -0
- package/node_modules/zod/v4/locales/index.js +52 -0
- package/node_modules/zod/v4/locales/is.cjs +136 -0
- package/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/node_modules/zod/v4/locales/is.js +109 -0
- package/node_modules/zod/v4/locales/it.cjs +135 -0
- package/node_modules/zod/v4/locales/it.d.cts +5 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +108 -0
- package/node_modules/zod/v4/locales/ja.cjs +134 -0
- package/node_modules/zod/v4/locales/ja.d.cts +5 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +107 -0
- package/node_modules/zod/v4/locales/ka.cjs +139 -0
- package/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/node_modules/zod/v4/locales/ka.js +112 -0
- package/node_modules/zod/v4/locales/kh.cjs +12 -0
- package/node_modules/zod/v4/locales/kh.d.cts +5 -0
- package/node_modules/zod/v4/locales/kh.d.ts +5 -0
- package/node_modules/zod/v4/locales/kh.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +137 -0
- package/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/node_modules/zod/v4/locales/km.js +110 -0
- package/node_modules/zod/v4/locales/ko.cjs +138 -0
- package/node_modules/zod/v4/locales/ko.d.cts +5 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +111 -0
- package/node_modules/zod/v4/locales/lt.cjs +230 -0
- package/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/node_modules/zod/v4/locales/lt.js +203 -0
- package/node_modules/zod/v4/locales/mk.cjs +136 -0
- package/node_modules/zod/v4/locales/mk.d.cts +5 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +109 -0
- package/node_modules/zod/v4/locales/ms.cjs +134 -0
- package/node_modules/zod/v4/locales/ms.d.cts +5 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +107 -0
- package/node_modules/zod/v4/locales/nl.cjs +137 -0
- package/node_modules/zod/v4/locales/nl.d.cts +5 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +110 -0
- package/node_modules/zod/v4/locales/no.cjs +135 -0
- package/node_modules/zod/v4/locales/no.d.cts +5 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +108 -0
- package/node_modules/zod/v4/locales/ota.cjs +136 -0
- package/node_modules/zod/v4/locales/ota.d.cts +5 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +109 -0
- package/node_modules/zod/v4/locales/package.json +7 -0
- package/node_modules/zod/v4/locales/pl.cjs +136 -0
- package/node_modules/zod/v4/locales/pl.d.cts +5 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +109 -0
- package/node_modules/zod/v4/locales/ps.cjs +141 -0
- package/node_modules/zod/v4/locales/ps.d.cts +5 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +114 -0
- package/node_modules/zod/v4/locales/pt.cjs +135 -0
- package/node_modules/zod/v4/locales/pt.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +108 -0
- package/node_modules/zod/v4/locales/ro.cjs +146 -0
- package/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/node_modules/zod/v4/locales/ro.js +119 -0
- package/node_modules/zod/v4/locales/ru.cjs +183 -0
- package/node_modules/zod/v4/locales/ru.d.cts +5 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +156 -0
- package/node_modules/zod/v4/locales/sl.cjs +136 -0
- package/node_modules/zod/v4/locales/sl.d.cts +5 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +109 -0
- package/node_modules/zod/v4/locales/sv.cjs +137 -0
- package/node_modules/zod/v4/locales/sv.d.cts +5 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +110 -0
- package/node_modules/zod/v4/locales/ta.cjs +137 -0
- package/node_modules/zod/v4/locales/ta.d.cts +5 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +110 -0
- package/node_modules/zod/v4/locales/th.cjs +137 -0
- package/node_modules/zod/v4/locales/th.d.cts +5 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +110 -0
- package/node_modules/zod/v4/locales/tr.cjs +132 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +4 -0
- package/node_modules/zod/v4/locales/tr.js +105 -0
- package/node_modules/zod/v4/locales/ua.cjs +12 -0
- package/node_modules/zod/v4/locales/ua.d.cts +5 -0
- package/node_modules/zod/v4/locales/ua.d.ts +5 -0
- package/node_modules/zod/v4/locales/ua.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +135 -0
- package/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/node_modules/zod/v4/locales/uk.js +108 -0
- package/node_modules/zod/v4/locales/ur.cjs +137 -0
- package/node_modules/zod/v4/locales/ur.d.cts +5 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +110 -0
- package/node_modules/zod/v4/locales/uz.cjs +137 -0
- package/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/node_modules/zod/v4/locales/uz.js +110 -0
- package/node_modules/zod/v4/locales/vi.cjs +135 -0
- package/node_modules/zod/v4/locales/vi.d.cts +5 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +108 -0
- package/node_modules/zod/v4/locales/yo.cjs +134 -0
- package/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/node_modules/zod/v4/locales/yo.js +107 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +136 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +109 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +134 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +107 -0
- package/node_modules/zod/v4/mini/checks.cjs +34 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +52 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +22 -0
- package/node_modules/zod/v4/mini/external.cjs +63 -0
- package/node_modules/zod/v4/mini/external.d.cts +13 -0
- package/node_modules/zod/v4/mini/external.d.ts +13 -0
- package/node_modules/zod/v4/mini/external.js +14 -0
- package/node_modules/zod/v4/mini/index.cjs +32 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +64 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +34 -0
- package/node_modules/zod/v4/mini/package.json +7 -0
- package/node_modules/zod/v4/mini/parse.cjs +16 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +1083 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +445 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +445 -0
- package/node_modules/zod/v4/mini/schemas.js +961 -0
- package/node_modules/zod/v4/package.json +7 -0
- package/node_modules/zod/v4-mini/index.cjs +32 -0
- package/node_modules/zod/v4-mini/index.d.cts +3 -0
- package/node_modules/zod/v4-mini/index.d.ts +3 -0
- package/node_modules/zod/v4-mini/index.js +3 -0
- package/node_modules/zod/v4-mini/package.json +7 -0
- package/package.json +69 -0
|
@@ -0,0 +1,504 @@
|
|
|
1
|
+
import { normalizeSelector } from "./selectors.js";
|
|
2
|
+
import { safeSliceHead } from "../utils/safe-slice.js";
|
|
3
|
+
/**
|
|
4
|
+
* ARIA roles that represent interactive/actionable elements.
|
|
5
|
+
* Used by "interactive" mode to filter the snapshot.
|
|
6
|
+
*/
|
|
7
|
+
const INTERACTIVE_ROLES = new Set([
|
|
8
|
+
"link",
|
|
9
|
+
"button",
|
|
10
|
+
"textbox",
|
|
11
|
+
"combobox",
|
|
12
|
+
"searchbox",
|
|
13
|
+
"checkbox",
|
|
14
|
+
"radio",
|
|
15
|
+
"switch",
|
|
16
|
+
"slider",
|
|
17
|
+
"spinbutton",
|
|
18
|
+
"menuitem",
|
|
19
|
+
"menuitemcheckbox",
|
|
20
|
+
"menuitemradio",
|
|
21
|
+
"option",
|
|
22
|
+
"tab",
|
|
23
|
+
"treeitem",
|
|
24
|
+
"select",
|
|
25
|
+
"input",
|
|
26
|
+
"textarea",
|
|
27
|
+
"a",
|
|
28
|
+
]);
|
|
29
|
+
let currentRefs = new Map();
|
|
30
|
+
/**
|
|
31
|
+
* Metadata from the *previous* snapshot. Kept alive across snapshot calls
|
|
32
|
+
* so stale-ref recovery (locator-resolver) can still look up the original
|
|
33
|
+
* role/name/stableSelector when the LLM acts on a ref it grabbed before
|
|
34
|
+
* the most recent snapshot — by far the most common stale-ref scenario
|
|
35
|
+
* in production logs.
|
|
36
|
+
*
|
|
37
|
+
* Cleared by `resetRefs()` (navigation, tab switch, dialog) because those
|
|
38
|
+
* change the page enough that old metadata can't be trusted.
|
|
39
|
+
*/
|
|
40
|
+
let previousRefs = new Map();
|
|
41
|
+
/**
|
|
42
|
+
* Wipe all ref metadata. Called when the page identity changes
|
|
43
|
+
* (navigation, tab switch, page close) — both the live and historical
|
|
44
|
+
* caches refer to a page we no longer have.
|
|
45
|
+
*/
|
|
46
|
+
export function resetRefs() {
|
|
47
|
+
currentRefs = new Map();
|
|
48
|
+
previousRefs = new Map();
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Rotate the current ref map into the historical slot. Called by
|
|
52
|
+
* `takeSnapshot` before populating fresh refs, so an action that uses
|
|
53
|
+
* a ref from the prior snapshot can still recover via stableSelector
|
|
54
|
+
* or role+name fallback.
|
|
55
|
+
*
|
|
56
|
+
* NOT called on navigation — `resetRefs` is the right entry point for that.
|
|
57
|
+
*/
|
|
58
|
+
function rotateRefs() {
|
|
59
|
+
previousRefs = currentRefs;
|
|
60
|
+
currentRefs = new Map();
|
|
61
|
+
}
|
|
62
|
+
export function getElementRef(ref) {
|
|
63
|
+
return currentRefs.get(ref);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Look up a ref's metadata in the previous-snapshot cache only. Used by
|
|
67
|
+
* stale-ref recovery to locate the role/name/stableSelector of a ref the
|
|
68
|
+
* LLM is acting on AFTER taking a fresh snapshot that invalidated it.
|
|
69
|
+
*
|
|
70
|
+
* The recovery code will NOT use this metadata to re-query via aria-ref —
|
|
71
|
+
* that would point at the wrong DOM. It uses the stable attributes
|
|
72
|
+
* (data-testid, etc.) and role+name pair to find the equivalent element
|
|
73
|
+
* in the current snapshot.
|
|
74
|
+
*/
|
|
75
|
+
export function getPreviousElementRef(ref) {
|
|
76
|
+
return previousRefs.get(ref);
|
|
77
|
+
}
|
|
78
|
+
export function getAllRefs() {
|
|
79
|
+
return currentRefs;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Default maxChars for full mode. Sized to leave room for ~30k chars of
|
|
83
|
+
* surrounding history within the chat 60k soft-limit budget. The previous
|
|
84
|
+
* value (40k, copied from OpenClaw) routinely ate two-thirds of the budget
|
|
85
|
+
* in a single tool result and made compaction nearly useless on complex
|
|
86
|
+
* SPAs (social feeds, chat apps, large dashboards).
|
|
87
|
+
*/
|
|
88
|
+
const DEFAULT_FULL_MAX_CHARS = 30_000;
|
|
89
|
+
/** Default maxChars for interactive mode — compact view. */
|
|
90
|
+
const INTERACTIVE_MAX_CHARS = 8_000;
|
|
91
|
+
/**
|
|
92
|
+
* Suffix appended when a snapshot is truncated. Includes an actionable hint —
|
|
93
|
+
* without it the LLM tends to re-snapshot at the same wide scope and waste
|
|
94
|
+
* another 30k chars on the next turn.
|
|
95
|
+
*/
|
|
96
|
+
const SNAPSHOT_TRUNCATED_HINT = '\n[...TRUNCATED - snapshot too large. Next time pass selector="<css>" to scope, mode="interactive" for clickables only, or maxChars=<n> to enlarge.]';
|
|
97
|
+
/**
|
|
98
|
+
* Take a snapshot of the page accessibility tree.
|
|
99
|
+
*
|
|
100
|
+
* Accepts either a SnapshotMode string (backward compat) or SnapshotOptions object.
|
|
101
|
+
*/
|
|
102
|
+
export async function takeSnapshot(page, modeOrOptions, maxCharsOverride) {
|
|
103
|
+
// Normalize arguments
|
|
104
|
+
let opts;
|
|
105
|
+
if (typeof modeOrOptions === "string") {
|
|
106
|
+
opts = { mode: modeOrOptions, maxChars: maxCharsOverride };
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
opts = modeOrOptions ?? {};
|
|
110
|
+
}
|
|
111
|
+
const mode = opts.mode ?? "full";
|
|
112
|
+
// Rotate (not reset) — keep the previous snapshot's metadata for the
|
|
113
|
+
// stale-ref recovery path. Navigation/tab-switch still call resetRefs
|
|
114
|
+
// separately, which wipes both maps because the old metadata refers to
|
|
115
|
+
// a page that's gone.
|
|
116
|
+
rotateRefs();
|
|
117
|
+
// Take snapshot — scoped to selector if provided. The Playwright API for
|
|
118
|
+
// "aria" mode varies by version; we feature-detect rather than relying on
|
|
119
|
+
// a specific signature.
|
|
120
|
+
const fmt = opts.snapshotFormat ?? "ai";
|
|
121
|
+
let snapshot;
|
|
122
|
+
if (opts.selector) {
|
|
123
|
+
const norm = normalizeSelector(opts.selector);
|
|
124
|
+
if (!norm.ok) {
|
|
125
|
+
return {
|
|
126
|
+
text: `Error: selector ${norm.error}. Original: ${JSON.stringify(norm.original)}.`,
|
|
127
|
+
elementRefs: currentRefs,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
try {
|
|
131
|
+
// ariaSnapshot accepts {mode: "ai"} on current Playwright; older
|
|
132
|
+
// versions return the verbose tree by default. Either way, this
|
|
133
|
+
// path is used only when the caller scopes by selector.
|
|
134
|
+
const loc = page.locator(norm.selector).first();
|
|
135
|
+
if (fmt === "ai") {
|
|
136
|
+
snapshot = await loc.ariaSnapshot({ mode: "ai" });
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
snapshot = await loc.ariaSnapshot();
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
catch {
|
|
143
|
+
return {
|
|
144
|
+
text: `Error: selector "${norm.selector}" not found on page.`,
|
|
145
|
+
elementRefs: currentRefs,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
if (fmt === "ai") {
|
|
151
|
+
snapshot = await page.ariaSnapshot({ mode: "ai" });
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
snapshot = await page.ariaSnapshot();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// Apply depth filter
|
|
158
|
+
if (opts.depth != null && opts.depth >= 0) {
|
|
159
|
+
snapshot = truncateByDepth(snapshot, opts.depth);
|
|
160
|
+
}
|
|
161
|
+
// Apply interactive filter
|
|
162
|
+
let filteredSnapshot;
|
|
163
|
+
if (mode === "interactive") {
|
|
164
|
+
filteredSnapshot = filterInteractiveLines(snapshot);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
filteredSnapshot = snapshot;
|
|
168
|
+
}
|
|
169
|
+
// Apply compact filter
|
|
170
|
+
if (opts.compact) {
|
|
171
|
+
filteredSnapshot = compactSnapshot(filteredSnapshot);
|
|
172
|
+
}
|
|
173
|
+
// Apply char limit (pre-enrichment pass — enrichment annotations are
|
|
174
|
+
// typically <100 bytes per ref so we re-cap after).
|
|
175
|
+
const limit = opts.maxChars ?? (mode === "interactive" ? INTERACTIVE_MAX_CHARS : DEFAULT_FULL_MAX_CHARS);
|
|
176
|
+
if (filteredSnapshot.length > limit) {
|
|
177
|
+
filteredSnapshot =
|
|
178
|
+
safeSliceHead(filteredSnapshot, limit) + SNAPSHOT_TRUNCATED_HINT;
|
|
179
|
+
}
|
|
180
|
+
// Parse refs from the (now possibly truncated) snapshot text — only refs
|
|
181
|
+
// that survived filtering get into currentRefs.
|
|
182
|
+
parseRefs(filteredSnapshot);
|
|
183
|
+
// Enrich each visible ref with stable selector / editable / value hints.
|
|
184
|
+
// Skipped on error so a single bad node doesn't kill the whole snapshot.
|
|
185
|
+
if (opts.enrich !== false && currentRefs.size > 0) {
|
|
186
|
+
try {
|
|
187
|
+
await enrichRefs(page);
|
|
188
|
+
filteredSnapshot = annotateSnapshotLines(filteredSnapshot, opts.refs ?? "aria");
|
|
189
|
+
// Re-cap in case annotations grew the text past the limit.
|
|
190
|
+
if (filteredSnapshot.length > limit) {
|
|
191
|
+
filteredSnapshot =
|
|
192
|
+
safeSliceHead(filteredSnapshot, limit) +
|
|
193
|
+
"\n[...TRUNCATED - snapshot too large]";
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
catch {
|
|
197
|
+
// best-effort; raw snapshot still works without enrichment.
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return { text: filteredSnapshot, elementRefs: currentRefs };
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* For every ref in currentRefs, query the underlying DOM node via
|
|
204
|
+
* `aria-ref=eN` and pull stable attributes + editability + value. Runs all
|
|
205
|
+
* refs in parallel so the round-trip cost is roughly one CDP latency
|
|
206
|
+
* regardless of ref count.
|
|
207
|
+
*
|
|
208
|
+
* Stable selector picking happens inside the page context — `document.
|
|
209
|
+
* querySelectorAll` is cheap there, and uniqueness is the deciding factor
|
|
210
|
+
* we cannot evaluate from outside.
|
|
211
|
+
*/
|
|
212
|
+
async function enrichRefs(page) {
|
|
213
|
+
const refs = Array.from(currentRefs.keys());
|
|
214
|
+
await Promise.all(refs.map(async (ref) => {
|
|
215
|
+
const existing = currentRefs.get(ref);
|
|
216
|
+
if (!existing)
|
|
217
|
+
return;
|
|
218
|
+
try {
|
|
219
|
+
const data = await page
|
|
220
|
+
.locator(`aria-ref=${ref}`)
|
|
221
|
+
.first()
|
|
222
|
+
.evaluate(extractRefMetadataInPage);
|
|
223
|
+
if (!data)
|
|
224
|
+
return;
|
|
225
|
+
currentRefs.set(ref, { ...existing, ...data });
|
|
226
|
+
}
|
|
227
|
+
catch {
|
|
228
|
+
// Node went away between snapshot and enrichment — leave the basic ref.
|
|
229
|
+
}
|
|
230
|
+
}));
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Runs in the page context. Pulls stable attributes off `el` and returns the
|
|
234
|
+
* subset that's worth carrying back. Picks `stableSelector` based on
|
|
235
|
+
* uniqueness in the live DOM — testid first, then id/name/aria-label/
|
|
236
|
+
* placeholder if they resolve uniquely.
|
|
237
|
+
*
|
|
238
|
+
* Defined as a named function so it serializes correctly when passed to
|
|
239
|
+
* Playwright's `evaluate`.
|
|
240
|
+
*/
|
|
241
|
+
function extractRefMetadataInPage(el) {
|
|
242
|
+
if (!el || !(el instanceof Element))
|
|
243
|
+
return null;
|
|
244
|
+
const tag = el.tagName.toLowerCase();
|
|
245
|
+
const testid = el.getAttribute("data-testid") ?? undefined;
|
|
246
|
+
const id = el.id || undefined;
|
|
247
|
+
const name = el.getAttribute("name") ?? undefined;
|
|
248
|
+
const ariaLabel = el.getAttribute("aria-label") ?? undefined;
|
|
249
|
+
const placeholder = el.getAttribute("placeholder") ?? undefined;
|
|
250
|
+
const type = el.getAttribute("type") ?? undefined;
|
|
251
|
+
const href = tag === "a" ? el.getAttribute("href") ?? undefined : undefined;
|
|
252
|
+
const editable = tag === "input" ||
|
|
253
|
+
tag === "textarea" ||
|
|
254
|
+
el.isContentEditable === true ||
|
|
255
|
+
el.getAttribute("role") === "textbox";
|
|
256
|
+
let value;
|
|
257
|
+
if (el instanceof HTMLInputElement ||
|
|
258
|
+
el instanceof HTMLTextAreaElement) {
|
|
259
|
+
value = el.value ?? undefined;
|
|
260
|
+
if (value && value.length > 200) {
|
|
261
|
+
// UTF-16 boundary-safe cut: don't split a surrogate pair (emoji/CJK
|
|
262
|
+
// extension) at index 199/200 — the lone surrogate would later land
|
|
263
|
+
// in a JSON payload to the LLM API and fail strict parsing.
|
|
264
|
+
let end = 200;
|
|
265
|
+
const prev = value.charCodeAt(end - 1);
|
|
266
|
+
const curr = value.charCodeAt(end);
|
|
267
|
+
if (prev >= 0xd800 &&
|
|
268
|
+
prev <= 0xdbff &&
|
|
269
|
+
curr >= 0xdc00 &&
|
|
270
|
+
curr <= 0xdfff) {
|
|
271
|
+
end = 199;
|
|
272
|
+
}
|
|
273
|
+
value = value.slice(0, end) + "…";
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
// Arrow form (not `function attrSel()`) is intentional: tsx/esbuild
|
|
277
|
+
// wraps named function declarations with __name() to preserve
|
|
278
|
+
// Function.name, and __name isn't defined in the page context.
|
|
279
|
+
// Serialized via extractRefMetadataInPage.toString() → Playwright
|
|
280
|
+
// evaluate, so the inner-function form would throw ReferenceError
|
|
281
|
+
// on every snapshot enrichment.
|
|
282
|
+
const attrSel = (attr, val) => {
|
|
283
|
+
const escaped = val.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
284
|
+
return `[${attr}="${escaped}"]`;
|
|
285
|
+
};
|
|
286
|
+
const isUnique = (sel) => {
|
|
287
|
+
try {
|
|
288
|
+
return document.querySelectorAll(sel).length === 1;
|
|
289
|
+
}
|
|
290
|
+
catch {
|
|
291
|
+
return false;
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
let stableSelector;
|
|
295
|
+
// testidSelectorCount surfaces non-uniqueness to the LLM via the
|
|
296
|
+
// annotated snapshot output. On repeated feed/list items, many cards have
|
|
297
|
+
// the same action-button testids; those were previously emitted as
|
|
298
|
+
// stableSelector and would auto-click the first matching button regardless
|
|
299
|
+
// of intent.
|
|
300
|
+
let testidSelectorCount;
|
|
301
|
+
if (testid) {
|
|
302
|
+
const sel = attrSel("data-testid", testid);
|
|
303
|
+
const count = document.querySelectorAll(sel).length;
|
|
304
|
+
if (count === 1) {
|
|
305
|
+
stableSelector = sel;
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
testidSelectorCount = count;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
if (!stableSelector) {
|
|
312
|
+
if (id && /^[A-Za-z][\w-]*$/.test(id) && isUnique(`#${id}`)) {
|
|
313
|
+
stableSelector = `#${id}`;
|
|
314
|
+
}
|
|
315
|
+
else if (name && isUnique(attrSel("name", name))) {
|
|
316
|
+
stableSelector = attrSel("name", name);
|
|
317
|
+
}
|
|
318
|
+
else if (ariaLabel && isUnique(attrSel("aria-label", ariaLabel))) {
|
|
319
|
+
stableSelector = attrSel("aria-label", ariaLabel);
|
|
320
|
+
}
|
|
321
|
+
else if (placeholder && isUnique(attrSel("placeholder", placeholder))) {
|
|
322
|
+
stableSelector = attrSel("placeholder", placeholder);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return {
|
|
326
|
+
tag,
|
|
327
|
+
stableSelector,
|
|
328
|
+
editable,
|
|
329
|
+
value,
|
|
330
|
+
href,
|
|
331
|
+
...(testidSelectorCount !== undefined ? { testidSelectorCount } : {}),
|
|
332
|
+
attrs: {
|
|
333
|
+
...(testid !== undefined ? { testid } : {}),
|
|
334
|
+
...(id !== undefined ? { id } : {}),
|
|
335
|
+
...(name !== undefined ? { name } : {}),
|
|
336
|
+
...(ariaLabel !== undefined ? { ariaLabel } : {}),
|
|
337
|
+
...(placeholder !== undefined ? { placeholder } : {}),
|
|
338
|
+
...(type !== undefined ? { type } : {}),
|
|
339
|
+
},
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Append compact metadata annotations to each `[ref=eN]` line in the
|
|
344
|
+
* filtered snapshot text. Format chosen so it parses with the same regex
|
|
345
|
+
* as before (refs are still recoverable) and so a quick read tells the LLM
|
|
346
|
+
* which selector to prefer.
|
|
347
|
+
*/
|
|
348
|
+
function annotateSnapshotLines(snapshot, refStyle) {
|
|
349
|
+
return snapshot
|
|
350
|
+
.split("\n")
|
|
351
|
+
.map((line) => {
|
|
352
|
+
const m = line.match(/\[ref=(e\d+)\]/);
|
|
353
|
+
if (!m)
|
|
354
|
+
return line;
|
|
355
|
+
const meta = currentRefs.get(m[1]);
|
|
356
|
+
if (!meta)
|
|
357
|
+
return line;
|
|
358
|
+
const parts = [];
|
|
359
|
+
if (meta.stableSelector)
|
|
360
|
+
parts.push(`[selector=${meta.stableSelector}]`);
|
|
361
|
+
else if (meta.testidSelectorCount !== undefined && meta.attrs?.testid) {
|
|
362
|
+
// Non-unique testid: surface the ambiguity so the LLM doesn't
|
|
363
|
+
// copy the testid into a click ref expecting it to land on this
|
|
364
|
+
// specific element. Common on repeated social feeds.
|
|
365
|
+
parts.push(`[testid="${meta.attrs.testid}" non-unique x${meta.testidSelectorCount}]`);
|
|
366
|
+
}
|
|
367
|
+
if (meta.editable)
|
|
368
|
+
parts.push("[editable]");
|
|
369
|
+
if (meta.value && meta.value.length > 0)
|
|
370
|
+
parts.push(`[value=${JSON.stringify(meta.value)}]`);
|
|
371
|
+
if (refStyle === "role") {
|
|
372
|
+
// Encode role|name so the resolver can re-resolve via getByRole.
|
|
373
|
+
parts.push(`[role-ref="${meta.role}|${meta.name.replace(/"/g, '\\"')}"]`);
|
|
374
|
+
}
|
|
375
|
+
if (parts.length === 0)
|
|
376
|
+
return line;
|
|
377
|
+
return line + " " + parts.join(" ");
|
|
378
|
+
})
|
|
379
|
+
.join("\n");
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Truncate snapshot lines deeper than maxDepth.
|
|
383
|
+
* Playwright AI snapshot uses 2-space indentation per level.
|
|
384
|
+
*/
|
|
385
|
+
function truncateByDepth(snapshot, maxDepth) {
|
|
386
|
+
const lines = snapshot.split("\n");
|
|
387
|
+
const kept = [];
|
|
388
|
+
for (const line of lines) {
|
|
389
|
+
const indent = line.match(/^(\s*)/)?.[1].length ?? 0;
|
|
390
|
+
const level = Math.floor(indent / 2);
|
|
391
|
+
if (level <= maxDepth) {
|
|
392
|
+
kept.push(line);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
return kept.join("\n");
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Strip consecutive blank lines and trailing whitespace per line.
|
|
399
|
+
*/
|
|
400
|
+
function compactSnapshot(text) {
|
|
401
|
+
return text
|
|
402
|
+
.split("\n")
|
|
403
|
+
.map((line) => line.trimEnd())
|
|
404
|
+
.filter((line, i, arr) => {
|
|
405
|
+
// Remove consecutive blank lines
|
|
406
|
+
if (line === "" && i > 0 && arr[i - 1] === "")
|
|
407
|
+
return false;
|
|
408
|
+
return true;
|
|
409
|
+
})
|
|
410
|
+
.join("\n");
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Filter snapshot lines to only keep interactive elements.
|
|
414
|
+
*
|
|
415
|
+
* Keeps lines that:
|
|
416
|
+
* - Contain a [ref=eN] tag (Playwright assigns refs to interactive elements)
|
|
417
|
+
* - OR have an interactive ARIA role keyword
|
|
418
|
+
*
|
|
419
|
+
* Also preserves headings for structural context (they're cheap and help LLM orient).
|
|
420
|
+
*/
|
|
421
|
+
function filterInteractiveLines(snapshot) {
|
|
422
|
+
const lines = snapshot.split("\n");
|
|
423
|
+
const kept = [];
|
|
424
|
+
for (const line of lines) {
|
|
425
|
+
const trimmed = line.trimStart();
|
|
426
|
+
// Always keep lines with element refs — they are interactive by definition
|
|
427
|
+
if (/\[ref=e\d+\]/.test(trimmed)) {
|
|
428
|
+
kept.push(line);
|
|
429
|
+
continue;
|
|
430
|
+
}
|
|
431
|
+
// Keep headings for structural context (low cost, high orientation value)
|
|
432
|
+
if (/^-\s*heading\s/.test(trimmed)) {
|
|
433
|
+
kept.push(line);
|
|
434
|
+
continue;
|
|
435
|
+
}
|
|
436
|
+
// Check if the line starts with "- role" where role is interactive
|
|
437
|
+
const roleMatch = trimmed.match(/^-\s+(\w+)\s/);
|
|
438
|
+
if (roleMatch && INTERACTIVE_ROLES.has(roleMatch[1].toLowerCase())) {
|
|
439
|
+
kept.push(line);
|
|
440
|
+
continue;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
return kept.join("\n");
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Parse element refs from snapshot text into the currentRefs map.
|
|
447
|
+
*
|
|
448
|
+
* Three passes, richest first. Each pass uses `currentRefs.has` as a
|
|
449
|
+
* "don't overwrite" guard so a later, looser pattern can never replace
|
|
450
|
+
* a name we already captured.
|
|
451
|
+
*
|
|
452
|
+
* Pass C (role-only) exists because Playwright's ai-mode emits refs on
|
|
453
|
+
* structural nodes that have no accessible name — `- generic [ref=e1]:`,
|
|
454
|
+
* `- link [ref=e5]:` when a site wraps several visual elements in a single
|
|
455
|
+
* link with empty aria-name. Without this pass those refs appear in
|
|
456
|
+
* the snapshot text the LLM reads but never enter currentRefs, so any
|
|
457
|
+
* action against them returns "ref not found or stale" *before*
|
|
458
|
+
* stale-ref recovery has any metadata to work with. Exported so unit
|
|
459
|
+
* tests can drive it directly without spinning up a browser.
|
|
460
|
+
*/
|
|
461
|
+
export function parseRefs(snapshot) {
|
|
462
|
+
let match;
|
|
463
|
+
// Pass A — bulleted role with quoted name and trailing ref. Allow any
|
|
464
|
+
// number of intermediate [attr] blocks (e.g. [level=1], [disabled],
|
|
465
|
+
// [checked]) between the name and the [ref=...] marker so attributed
|
|
466
|
+
// nodes don't fall through to the no-name pass and lose their name.
|
|
467
|
+
const namedBullet = /-\s+(\w+)\s+"([^"]*)"(?:\s+\[(?!ref=)[^\]]+\])*\s+\[ref=(e\d+)\]/g;
|
|
468
|
+
while ((match = namedBullet.exec(snapshot)) !== null) {
|
|
469
|
+
if (!currentRefs.has(match[3])) {
|
|
470
|
+
currentRefs.set(match[3], {
|
|
471
|
+
ref: match[3],
|
|
472
|
+
role: match[1],
|
|
473
|
+
name: match[2],
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
// Pass B — legacy "[ref=eN] role \"name\"" form (ref before role). Kept
|
|
478
|
+
// for any callers that emit refs in this order.
|
|
479
|
+
const prefixedRef = /\[ref=(e\d+)\]\s*(\w+)\s*"([^"]*)"/g;
|
|
480
|
+
while ((match = prefixedRef.exec(snapshot)) !== null) {
|
|
481
|
+
if (!currentRefs.has(match[1])) {
|
|
482
|
+
currentRefs.set(match[1], {
|
|
483
|
+
ref: match[1],
|
|
484
|
+
role: match[2],
|
|
485
|
+
name: match[3],
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
// Pass C — bulleted role WITHOUT a quoted name. Same intermediate-attr
|
|
490
|
+
// tolerance as Pass A. Missing this case is what caused four straight
|
|
491
|
+
// hover failures in the BTC-search task: the LLM picked refs on
|
|
492
|
+
// `- link [ref=eN]:` username wrappers and got back "ref not found".
|
|
493
|
+
const roleOnlyBullet = /-\s+(\w+)(?:\s+\[(?!ref=)[^\]]+\])*\s+\[ref=(e\d+)\]/g;
|
|
494
|
+
while ((match = roleOnlyBullet.exec(snapshot)) !== null) {
|
|
495
|
+
if (!currentRefs.has(match[2])) {
|
|
496
|
+
currentRefs.set(match[2], {
|
|
497
|
+
ref: match[2],
|
|
498
|
+
role: match[1],
|
|
499
|
+
name: "",
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
//# sourceMappingURL=snapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshot.js","sourceRoot":"","sources":["../../src/browser/snapshot.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AA2FvD;;;GAGG;AACH,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAChC,MAAM;IACN,QAAQ;IACR,SAAS;IACT,UAAU;IACV,WAAW;IACX,UAAU;IACV,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,YAAY;IACZ,UAAU;IACV,kBAAkB;IAClB,eAAe;IACf,QAAQ;IACR,KAAK;IACL,UAAU;IACV,QAAQ;IACR,OAAO;IACP,UAAU;IACV,GAAG;CACJ,CAAC,CAAC;AAEH,IAAI,WAAW,GAAG,IAAI,GAAG,EAAsB,CAAC;AAChD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C,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QACxD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC/B,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;gBACxB,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;gBACb,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;gBACd,IAAI,EAAE,EAAE;aACT,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File-based workspace ownership.
|
|
3
|
+
*
|
|
4
|
+
* Why a handle and not loose helpers: lock file + pid file are coupled —
|
|
5
|
+
* the pid file is meaningful only while the lock is held, and close-order
|
|
6
|
+
* is load-bearing (pid file must be cleaned before lock release so a
|
|
7
|
+
* concurrent startup sees the workspace as busy until both Chrome is dead
|
|
8
|
+
* and its pid record is gone). Bundling them as a handle keeps callers
|
|
9
|
+
* from accidentally splitting the cleanup.
|
|
10
|
+
*/
|
|
11
|
+
export interface WorkspaceLockHandle {
|
|
12
|
+
/** Record Chrome's pid so the next startup can clean it up if we crash. */
|
|
13
|
+
writePid(pid: number): void;
|
|
14
|
+
/** Clear pid record after Chrome has exited cleanly. */
|
|
15
|
+
clearPid(): void;
|
|
16
|
+
/**
|
|
17
|
+
* Best-effort kill of any orphan Chrome whose pid was recorded by a
|
|
18
|
+
* previous owner of this workspace. Run after acquire(), before spawning
|
|
19
|
+
* a new Chrome. Safe to call when no pid file exists.
|
|
20
|
+
*/
|
|
21
|
+
killOrphanChrome(userDataDir: string): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Release workspace ownership: clear pid file then unlink lock file.
|
|
24
|
+
* Order matters — a concurrent dipclaw startup must see "busy" until
|
|
25
|
+
* both are gone. Safe to call more than once.
|
|
26
|
+
*/
|
|
27
|
+
release(): void;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Claim the workspace (or take over a stale lock) and return a handle.
|
|
31
|
+
*
|
|
32
|
+
* Throws if another live dipclaw owns this workspace, or if contention is
|
|
33
|
+
* pathological and 20 attempts fail. On any internal failure between
|
|
34
|
+
* claim and return, the lock is released before throwing so we don't
|
|
35
|
+
* orphan our own lock file.
|
|
36
|
+
*/
|
|
37
|
+
export declare function acquireWorkspaceLock(userDataDir: string): Promise<WorkspaceLockHandle>;
|