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,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* High-level DOM inspection helpers, exposed as act-kinds so the LLM can
|
|
3
|
+
* extract page data without writing free-form JavaScript.
|
|
4
|
+
*
|
|
5
|
+
* Why these exist: production logs showed 7 cases of `evaluate` syntax
|
|
6
|
+
* errors — the model wrote ad-hoc DOM-walking JavaScript, mistyped a
|
|
7
|
+
* comma or paren, and burned a tool round-trip. Each helper here covers
|
|
8
|
+
* a recurring extraction pattern with no JS surface for the LLM to misuse.
|
|
9
|
+
*
|
|
10
|
+
* Output shape conventions:
|
|
11
|
+
* - Return strings (cap-applied, JSON or human-readable).
|
|
12
|
+
* - When the helper finds elements, include each item's stable selector
|
|
13
|
+
* if one exists, so the LLM can chain into click/type/hover.
|
|
14
|
+
*/
|
|
15
|
+
import type { Page } from "playwright";
|
|
16
|
+
export interface ExtractVisibleTextArgs {
|
|
17
|
+
selector?: string;
|
|
18
|
+
/** Bounded char cap (default 8000). */
|
|
19
|
+
maxChars?: number;
|
|
20
|
+
}
|
|
21
|
+
export declare function extractVisibleText(page: Page, args?: ExtractVisibleTextArgs): Promise<string>;
|
|
22
|
+
export interface QueryByTextArgs {
|
|
23
|
+
text: string;
|
|
24
|
+
/** When true, match substring case-insensitively. Default false (exact). */
|
|
25
|
+
fuzzy?: boolean;
|
|
26
|
+
/** Cap how many results to return. Default 20. */
|
|
27
|
+
limit?: number;
|
|
28
|
+
}
|
|
29
|
+
export declare function queryByText(page: Page, args: QueryByTextArgs): Promise<string>;
|
|
30
|
+
export interface FindClickableNearTextArgs {
|
|
31
|
+
text: string;
|
|
32
|
+
/** Max ancestor levels to search. Default 5. */
|
|
33
|
+
maxAncestors?: number;
|
|
34
|
+
/** Cap candidate count. Default 10. */
|
|
35
|
+
limit?: number;
|
|
36
|
+
}
|
|
37
|
+
export declare function findClickableNearText(page: Page, args: FindClickableNearTextArgs): Promise<string>;
|
|
38
|
+
export interface ExtractLinksArgs {
|
|
39
|
+
selector?: string;
|
|
40
|
+
/** Cap link count. Default 50. */
|
|
41
|
+
limit?: number;
|
|
42
|
+
}
|
|
43
|
+
export declare function extractLinks(page: Page, args?: ExtractLinksArgs): Promise<string>;
|
|
44
|
+
/**
|
|
45
|
+
* Site-specific social post extraction used by the built-in x skill and
|
|
46
|
+
* retained for backward compatibility. Walks visible post cells and pulls
|
|
47
|
+
* author handle, display name, post text, timestamp, status URL, and stable
|
|
48
|
+
* selectors for action buttons when present.
|
|
49
|
+
*
|
|
50
|
+
* Optional `limit` caps how many cells to read; default is the first 20.
|
|
51
|
+
*/
|
|
52
|
+
export interface ExtractTweetCardsArgs {
|
|
53
|
+
limit?: number;
|
|
54
|
+
}
|
|
55
|
+
export declare function extractTweetCards(page: Page, args?: ExtractTweetCardsArgs): Promise<string>;
|
|
56
|
+
/**
|
|
57
|
+
* Quick syntactic sanity check for `evaluate` scripts. We compile via
|
|
58
|
+
* `new Function` which throws on parse error without ever executing the
|
|
59
|
+
* code. Catches the most common LLM syntax slips (missing parens, stray
|
|
60
|
+
* commas, illegal identifiers) before a round-trip to the page.
|
|
61
|
+
*/
|
|
62
|
+
export declare function wrapEvaluateScript(script: string): string;
|
|
63
|
+
export declare function preflightEvaluateScript(script: string): {
|
|
64
|
+
ok: true;
|
|
65
|
+
} | {
|
|
66
|
+
ok: false;
|
|
67
|
+
message: string;
|
|
68
|
+
};
|
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
import { normalizeSelector } from "./selectors.js";
|
|
2
|
+
import { safeSliceHead } from "../utils/safe-slice.js";
|
|
3
|
+
const HELPER_DEFAULT_MAX = 8_000;
|
|
4
|
+
export async function extractVisibleText(page, args = {}) {
|
|
5
|
+
let scopeSel;
|
|
6
|
+
if (args.selector) {
|
|
7
|
+
const norm = normalizeSelector(args.selector);
|
|
8
|
+
if (!norm.ok)
|
|
9
|
+
return `Error: ${norm.error}`;
|
|
10
|
+
scopeSel = norm.selector;
|
|
11
|
+
}
|
|
12
|
+
const text = await page.evaluate((sel) => {
|
|
13
|
+
// Arrow form (not `function visibleText()` / method shorthand) is
|
|
14
|
+
// intentional: tsx/esbuild wraps named functions with __name() to
|
|
15
|
+
// preserve Function.name, and __name isn't defined in the page
|
|
16
|
+
// context. Same reason `acceptNode` is written as a property with
|
|
17
|
+
// an arrow value rather than method shorthand.
|
|
18
|
+
const visibleText = (root) => {
|
|
19
|
+
const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT, {
|
|
20
|
+
acceptNode: (n) => {
|
|
21
|
+
const t = (n.textContent ?? "").trim();
|
|
22
|
+
if (!t)
|
|
23
|
+
return NodeFilter.FILTER_REJECT;
|
|
24
|
+
const parent = n.parentElement;
|
|
25
|
+
if (!parent)
|
|
26
|
+
return NodeFilter.FILTER_REJECT;
|
|
27
|
+
if (parent.closest("script,style,noscript,template,svg")) {
|
|
28
|
+
return NodeFilter.FILTER_REJECT;
|
|
29
|
+
}
|
|
30
|
+
const style = window.getComputedStyle(parent);
|
|
31
|
+
if (style.display === "none" ||
|
|
32
|
+
style.visibility === "hidden" ||
|
|
33
|
+
style.opacity === "0")
|
|
34
|
+
return NodeFilter.FILTER_REJECT;
|
|
35
|
+
return NodeFilter.FILTER_ACCEPT;
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
const out = [];
|
|
39
|
+
let n = walker.nextNode();
|
|
40
|
+
while (n) {
|
|
41
|
+
out.push((n.textContent ?? "").trim());
|
|
42
|
+
n = walker.nextNode();
|
|
43
|
+
}
|
|
44
|
+
return out.join("\n");
|
|
45
|
+
};
|
|
46
|
+
if (sel) {
|
|
47
|
+
const root = document.querySelector(sel);
|
|
48
|
+
if (!root)
|
|
49
|
+
return null;
|
|
50
|
+
return visibleText(root);
|
|
51
|
+
}
|
|
52
|
+
return visibleText(document.body);
|
|
53
|
+
}, scopeSel);
|
|
54
|
+
if (text == null) {
|
|
55
|
+
return `Error: selector "${scopeSel}" not found on page.`;
|
|
56
|
+
}
|
|
57
|
+
return capChars(text, args.maxChars ?? HELPER_DEFAULT_MAX);
|
|
58
|
+
}
|
|
59
|
+
export async function queryByText(page, args) {
|
|
60
|
+
if (!args.text || typeof args.text !== "string") {
|
|
61
|
+
return "Error: queryByText requires `text`.";
|
|
62
|
+
}
|
|
63
|
+
const limit = args.limit ?? 20;
|
|
64
|
+
const fuzzy = args.fuzzy === true;
|
|
65
|
+
const results = await page.evaluate(({ needle, fuzzy, limit }) => {
|
|
66
|
+
// UTF-16 boundary-safe truncation. A naive `slice(0, n)` may split a
|
|
67
|
+
// surrogate pair (emoji etc.) and produce a lone surrogate, which the
|
|
68
|
+
// Anthropic API later rejects as "invalid high surrogate in string".
|
|
69
|
+
const __safeCut = (s, n) => {
|
|
70
|
+
if (s.length <= n)
|
|
71
|
+
return s;
|
|
72
|
+
const a = s.charCodeAt(n - 1);
|
|
73
|
+
const b = s.charCodeAt(n);
|
|
74
|
+
return s.slice(0, a >= 0xd800 && a <= 0xdbff && b >= 0xdc00 && b <= 0xdfff ? n - 1 : n);
|
|
75
|
+
};
|
|
76
|
+
const want = fuzzy ? needle.toLowerCase() : needle;
|
|
77
|
+
const out = [];
|
|
78
|
+
const all = document.querySelectorAll("*");
|
|
79
|
+
for (let i = 0; i < all.length && out.length < limit; i++) {
|
|
80
|
+
const el = all[i];
|
|
81
|
+
const text = el.innerText ?? "";
|
|
82
|
+
if (!text)
|
|
83
|
+
continue;
|
|
84
|
+
const compare = fuzzy ? text.toLowerCase() : text;
|
|
85
|
+
const match = fuzzy ? compare.includes(want) : compare === want;
|
|
86
|
+
if (!match)
|
|
87
|
+
continue;
|
|
88
|
+
// Skip if a descendant also matches — we want the deepest match,
|
|
89
|
+
// i.e. the smallest containing element.
|
|
90
|
+
let descendantMatches = false;
|
|
91
|
+
for (let j = 0; j < el.children.length; j++) {
|
|
92
|
+
const childText = el.children[j].innerText ?? "";
|
|
93
|
+
const childCmp = fuzzy ? childText.toLowerCase() : childText;
|
|
94
|
+
if ((fuzzy && childCmp.includes(want)) ||
|
|
95
|
+
(!fuzzy && childCmp === want)) {
|
|
96
|
+
descendantMatches = true;
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (descendantMatches)
|
|
101
|
+
continue;
|
|
102
|
+
// Selector picking with the same uniqueness discipline as the
|
|
103
|
+
// snapshot enricher: only emit a selector when it actually
|
|
104
|
+
// resolves to ONE element on the live page. Non-unique testids
|
|
105
|
+
// (repeated feed/list action buttons) are extremely common and
|
|
106
|
+
// emitting them as `selector` would mislead the LLM into clicking
|
|
107
|
+
// the first match.
|
|
108
|
+
const testid = el.getAttribute("data-testid");
|
|
109
|
+
const id = el.id;
|
|
110
|
+
let selector = null;
|
|
111
|
+
if (testid) {
|
|
112
|
+
const sel = `[data-testid="${testid}"]`;
|
|
113
|
+
if (document.querySelectorAll(sel).length === 1)
|
|
114
|
+
selector = sel;
|
|
115
|
+
}
|
|
116
|
+
if (!selector && id && /^[A-Za-z][\w-]*$/.test(id)) {
|
|
117
|
+
if (document.querySelectorAll(`#${id}`).length === 1)
|
|
118
|
+
selector = `#${id}`;
|
|
119
|
+
}
|
|
120
|
+
out.push({
|
|
121
|
+
tag: el.tagName.toLowerCase(),
|
|
122
|
+
role: el.getAttribute("role"),
|
|
123
|
+
text: text.length > 200 ? __safeCut(text, 200) + "…" : text,
|
|
124
|
+
selector,
|
|
125
|
+
href: el.tagName === "A" ? el.href || null : null,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return out;
|
|
129
|
+
}, { needle: args.text, fuzzy, limit });
|
|
130
|
+
if (results.length === 0) {
|
|
131
|
+
return `(no elements matched ${JSON.stringify(args.text)})`;
|
|
132
|
+
}
|
|
133
|
+
return JSON.stringify(results, null, 2);
|
|
134
|
+
}
|
|
135
|
+
export async function findClickableNearText(page, args) {
|
|
136
|
+
if (!args.text)
|
|
137
|
+
return "Error: findClickableNearText requires `text`.";
|
|
138
|
+
const maxAncestors = args.maxAncestors ?? 5;
|
|
139
|
+
const limit = args.limit ?? 10;
|
|
140
|
+
const results = await page.evaluate(({ needle, maxAncestors, limit }) => {
|
|
141
|
+
// Arrow form for the same __name reason documented in
|
|
142
|
+
// extractVisibleText above — keep all inline helpers as const
|
|
143
|
+
// arrows so this evaluate body survives tsx/esbuild bundling.
|
|
144
|
+
// UTF-16 boundary-safe truncation; see queryByText for rationale.
|
|
145
|
+
const __safeCut = (s, n) => {
|
|
146
|
+
if (s.length <= n)
|
|
147
|
+
return s;
|
|
148
|
+
const a = s.charCodeAt(n - 1);
|
|
149
|
+
const b = s.charCodeAt(n);
|
|
150
|
+
return s.slice(0, a >= 0xd800 && a <= 0xdbff && b >= 0xdc00 && b <= 0xdfff ? n - 1 : n);
|
|
151
|
+
};
|
|
152
|
+
const isClickable = (el) => {
|
|
153
|
+
const tag = el.tagName.toLowerCase();
|
|
154
|
+
if (tag === "a" || tag === "button")
|
|
155
|
+
return true;
|
|
156
|
+
const role = el.getAttribute("role");
|
|
157
|
+
if (role === "button" ||
|
|
158
|
+
role === "link" ||
|
|
159
|
+
role === "menuitem" ||
|
|
160
|
+
role === "tab")
|
|
161
|
+
return true;
|
|
162
|
+
if (el.onclick != null)
|
|
163
|
+
return true;
|
|
164
|
+
const tabindex = el.getAttribute("tabindex");
|
|
165
|
+
if (tabindex && tabindex !== "-1")
|
|
166
|
+
return true;
|
|
167
|
+
return false;
|
|
168
|
+
};
|
|
169
|
+
// Find anchors with the requested text first.
|
|
170
|
+
const all = document.querySelectorAll("*");
|
|
171
|
+
const anchors = [];
|
|
172
|
+
for (let i = 0; i < all.length; i++) {
|
|
173
|
+
const el = all[i];
|
|
174
|
+
const text = el.innerText ?? "";
|
|
175
|
+
if (text.includes(needle)) {
|
|
176
|
+
// prefer deepest match (smallest container)
|
|
177
|
+
let deeper = false;
|
|
178
|
+
for (let j = 0; j < el.children.length; j++) {
|
|
179
|
+
const c = el.children[j].innerText ?? "";
|
|
180
|
+
if (c.includes(needle)) {
|
|
181
|
+
deeper = true;
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (!deeper)
|
|
186
|
+
anchors.push(el);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
const candidates = [];
|
|
190
|
+
const seen = new Set();
|
|
191
|
+
// Same uniqueness discipline as the snapshot enricher: emit a
|
|
192
|
+
// selector only when it resolves to a single element on the page.
|
|
193
|
+
const pickUniqueSelector = (node) => {
|
|
194
|
+
const testid = node.getAttribute("data-testid");
|
|
195
|
+
const id = node.id;
|
|
196
|
+
if (testid) {
|
|
197
|
+
const sel = `[data-testid="${testid}"]`;
|
|
198
|
+
if (document.querySelectorAll(sel).length === 1)
|
|
199
|
+
return sel;
|
|
200
|
+
}
|
|
201
|
+
if (id && /^[A-Za-z][\w-]*$/.test(id)) {
|
|
202
|
+
if (document.querySelectorAll(`#${id}`).length === 1)
|
|
203
|
+
return `#${id}`;
|
|
204
|
+
}
|
|
205
|
+
return null;
|
|
206
|
+
};
|
|
207
|
+
const pickRoleRef = (node, text) => {
|
|
208
|
+
const role = node.getAttribute("role");
|
|
209
|
+
if (!role || !/^[a-z]+$/.test(role))
|
|
210
|
+
return null;
|
|
211
|
+
const name = text.trim().replace(/\s+/g, " ");
|
|
212
|
+
if (!name || name.length > 120)
|
|
213
|
+
return null;
|
|
214
|
+
return `${role}|${name}`;
|
|
215
|
+
};
|
|
216
|
+
for (const anchor of anchors) {
|
|
217
|
+
// Walk up looking for a clickable ancestor first.
|
|
218
|
+
let node = anchor;
|
|
219
|
+
let levels = 0;
|
|
220
|
+
while (node && levels <= maxAncestors) {
|
|
221
|
+
if (isClickable(node) && !seen.has(node)) {
|
|
222
|
+
seen.add(node);
|
|
223
|
+
const text = node.innerText ?? "";
|
|
224
|
+
candidates.push({
|
|
225
|
+
tag: node.tagName.toLowerCase(),
|
|
226
|
+
role: node.getAttribute("role"),
|
|
227
|
+
text: text.length > 200 ? __safeCut(text, 200) + "…" : text,
|
|
228
|
+
ref: pickRoleRef(node, text),
|
|
229
|
+
selector: pickUniqueSelector(node),
|
|
230
|
+
anchorText: __safeCut(anchor.innerText ?? "", 80),
|
|
231
|
+
});
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
node = node.parentElement;
|
|
235
|
+
levels++;
|
|
236
|
+
}
|
|
237
|
+
// Then look for clickable descendants within the anchor.
|
|
238
|
+
const desc = anchor.querySelectorAll("a,button,[role=button],[role=link],[role=menuitem],[role=tab]");
|
|
239
|
+
for (let i = 0; i < desc.length && candidates.length < limit; i++) {
|
|
240
|
+
const node = desc[i];
|
|
241
|
+
if (seen.has(node))
|
|
242
|
+
continue;
|
|
243
|
+
if (!isClickable(node))
|
|
244
|
+
continue;
|
|
245
|
+
seen.add(node);
|
|
246
|
+
const text = node.innerText ?? "";
|
|
247
|
+
candidates.push({
|
|
248
|
+
tag: node.tagName.toLowerCase(),
|
|
249
|
+
role: node.getAttribute("role"),
|
|
250
|
+
text: text.length > 200 ? __safeCut(text, 200) + "…" : text,
|
|
251
|
+
ref: pickRoleRef(node, text),
|
|
252
|
+
selector: pickUniqueSelector(node),
|
|
253
|
+
anchorText: __safeCut(anchor.innerText ?? "", 80),
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
if (candidates.length >= limit)
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
return candidates.slice(0, limit);
|
|
260
|
+
}, { needle: args.text, maxAncestors, limit });
|
|
261
|
+
if (results.length === 0) {
|
|
262
|
+
return `(no clickable element found near ${JSON.stringify(args.text)})`;
|
|
263
|
+
}
|
|
264
|
+
return JSON.stringify(results, null, 2);
|
|
265
|
+
}
|
|
266
|
+
export async function extractLinks(page, args = {}) {
|
|
267
|
+
let scopeSel;
|
|
268
|
+
if (args.selector) {
|
|
269
|
+
const norm = normalizeSelector(args.selector);
|
|
270
|
+
if (!norm.ok)
|
|
271
|
+
return `Error: ${norm.error}`;
|
|
272
|
+
scopeSel = norm.selector;
|
|
273
|
+
}
|
|
274
|
+
const limit = args.limit ?? 50;
|
|
275
|
+
const links = await page.evaluate(({ scope, limit }) => {
|
|
276
|
+
// UTF-16 boundary-safe truncation; see queryByText for rationale.
|
|
277
|
+
const __safeCut = (s, n) => {
|
|
278
|
+
if (s.length <= n)
|
|
279
|
+
return s;
|
|
280
|
+
const a = s.charCodeAt(n - 1);
|
|
281
|
+
const b = s.charCodeAt(n);
|
|
282
|
+
return s.slice(0, a >= 0xd800 && a <= 0xdbff && b >= 0xdc00 && b <= 0xdfff ? n - 1 : n);
|
|
283
|
+
};
|
|
284
|
+
const root = scope ? document.querySelector(scope) : document.body;
|
|
285
|
+
if (!root)
|
|
286
|
+
return null;
|
|
287
|
+
const anchors = root.querySelectorAll("a[href]");
|
|
288
|
+
const out = [];
|
|
289
|
+
for (let i = 0; i < anchors.length && out.length < limit; i++) {
|
|
290
|
+
const a = anchors[i];
|
|
291
|
+
const text = (a.innerText ?? "").trim();
|
|
292
|
+
if (!text && !a.getAttribute("aria-label"))
|
|
293
|
+
continue;
|
|
294
|
+
const testid = a.getAttribute("data-testid");
|
|
295
|
+
let selector = null;
|
|
296
|
+
if (testid) {
|
|
297
|
+
const sel = `[data-testid="${testid}"]`;
|
|
298
|
+
if (document.querySelectorAll(sel).length === 1)
|
|
299
|
+
selector = sel;
|
|
300
|
+
}
|
|
301
|
+
out.push({
|
|
302
|
+
text: text.length > 200
|
|
303
|
+
? __safeCut(text, 200) + "…"
|
|
304
|
+
: text || a.getAttribute("aria-label") || "",
|
|
305
|
+
href: a.href,
|
|
306
|
+
selector,
|
|
307
|
+
role: a.getAttribute("role"),
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
return out;
|
|
311
|
+
}, { scope: scopeSel, limit });
|
|
312
|
+
if (links == null) {
|
|
313
|
+
return `Error: selector "${scopeSel}" not found on page.`;
|
|
314
|
+
}
|
|
315
|
+
if (links.length === 0) {
|
|
316
|
+
return "(no visible links)";
|
|
317
|
+
}
|
|
318
|
+
return JSON.stringify(links, null, 2);
|
|
319
|
+
}
|
|
320
|
+
export async function extractTweetCards(page, args = {}) {
|
|
321
|
+
const limit = args.limit ?? 20;
|
|
322
|
+
const cards = await page.evaluate((limit) => {
|
|
323
|
+
const cells = document.querySelectorAll('[data-testid="cellInnerDiv"]');
|
|
324
|
+
const out = [];
|
|
325
|
+
for (let i = 0; i < cells.length && out.length < limit; i++) {
|
|
326
|
+
const cell = cells[i];
|
|
327
|
+
// Each cell may host a post, ad, or other; only pull when an article exists.
|
|
328
|
+
const article = cell.querySelector('article[role="article"]');
|
|
329
|
+
if (!article)
|
|
330
|
+
continue;
|
|
331
|
+
const tweetTextEl = article.querySelector('[data-testid="tweetText"]');
|
|
332
|
+
const userNameEl = article.querySelector('[data-testid="User-Name"]');
|
|
333
|
+
const timeEl = article.querySelector("time");
|
|
334
|
+
const linkEl = timeEl?.parentElement;
|
|
335
|
+
const statusUrl = linkEl?.href ?? null;
|
|
336
|
+
// Build a per-card scope so each action button selector resolves to
|
|
337
|
+
// exactly THIS card. The status URL is the only timeline-stable
|
|
338
|
+
// anchor (cell index changes as the feed scrolls), so we use
|
|
339
|
+
// :has(a[href$="/status/N"]) when one is available. Fall back to
|
|
340
|
+
// the cell's nth-of-type so the LLM still gets a usable handle —
|
|
341
|
+
// less stable across feed updates but accurate at extraction time.
|
|
342
|
+
let cardScope;
|
|
343
|
+
const statusPath = statusUrl
|
|
344
|
+
? new URL(statusUrl, window.location.href).pathname
|
|
345
|
+
: null;
|
|
346
|
+
if (statusPath) {
|
|
347
|
+
// CSS attribute selectors don't need to escape forward slashes.
|
|
348
|
+
cardScope = `[data-testid="cellInnerDiv"]:has(a[href$="${statusPath}"])`;
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
// 1-indexed CSS nth-of-type matches our `i` counter directly.
|
|
352
|
+
cardScope = `[data-testid="cellInnerDiv"]:nth-of-type(${i + 1})`;
|
|
353
|
+
}
|
|
354
|
+
// Action buttons typically have data-testid values like reply/repost/like.
|
|
355
|
+
// Each one is non-unique on the page, so we ALWAYS scope it to the
|
|
356
|
+
// owning card. Bare `[data-testid="reply"]` would point at the first
|
|
357
|
+
// matching reply button regardless of which card was extracted.
|
|
358
|
+
const buttons = {};
|
|
359
|
+
article
|
|
360
|
+
.querySelectorAll("[data-testid]")
|
|
361
|
+
.forEach((b) => {
|
|
362
|
+
const tid = b.getAttribute("data-testid") || "";
|
|
363
|
+
if (tid === "reply" ||
|
|
364
|
+
tid === "retweet" ||
|
|
365
|
+
tid === "unretweet" ||
|
|
366
|
+
tid === "like" ||
|
|
367
|
+
tid === "unlike" ||
|
|
368
|
+
tid === "bookmark" ||
|
|
369
|
+
tid === "removeBookmark") {
|
|
370
|
+
buttons[tid] = `${cardScope} [data-testid="${tid}"]`;
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
out.push({
|
|
374
|
+
index: out.length,
|
|
375
|
+
text: tweetTextEl?.textContent ?? null,
|
|
376
|
+
author: userNameEl?.textContent ?? null,
|
|
377
|
+
timestamp: timeEl?.getAttribute("datetime") ?? null,
|
|
378
|
+
statusUrl,
|
|
379
|
+
cardSelector: cardScope,
|
|
380
|
+
buttons,
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
return out;
|
|
384
|
+
}, limit);
|
|
385
|
+
if (cards.length === 0) {
|
|
386
|
+
return "(no social post cards found — are you on a supported timeline/profile/search page?)";
|
|
387
|
+
}
|
|
388
|
+
return JSON.stringify(cards, null, 2);
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Quick syntactic sanity check for `evaluate` scripts. We compile via
|
|
392
|
+
* `new Function` which throws on parse error without ever executing the
|
|
393
|
+
* code. Catches the most common LLM syntax slips (missing parens, stray
|
|
394
|
+
* commas, illegal identifiers) before a round-trip to the page.
|
|
395
|
+
*/
|
|
396
|
+
export function wrapEvaluateScript(script) {
|
|
397
|
+
const src = script.trim();
|
|
398
|
+
const inner = shouldInvokeEvaluateScript(src) ? `(${src})()` : `(${src})`;
|
|
399
|
+
return `(async () => { const __r = await (${inner}); return __r === undefined ? 'ok' : __r; })()`;
|
|
400
|
+
}
|
|
401
|
+
export function preflightEvaluateScript(script) {
|
|
402
|
+
if (!script || typeof script !== "string") {
|
|
403
|
+
return { ok: false, message: "evaluate requires a non-empty `fn` string" };
|
|
404
|
+
}
|
|
405
|
+
// Wrap matches the runtime wrapping in actions.evaluate so we catch
|
|
406
|
+
// parse failures specific to the same execution shape.
|
|
407
|
+
const wrapped = wrapEvaluateScript(script);
|
|
408
|
+
try {
|
|
409
|
+
new Function(wrapped);
|
|
410
|
+
return { ok: true };
|
|
411
|
+
}
|
|
412
|
+
catch (err) {
|
|
413
|
+
return {
|
|
414
|
+
ok: false,
|
|
415
|
+
message: err instanceof Error ? err.message : String(err),
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
function shouldInvokeEvaluateScript(src) {
|
|
420
|
+
if (/^(async\s+)?function\b/.test(src))
|
|
421
|
+
return true;
|
|
422
|
+
return isArrowFunctionLiteral(src);
|
|
423
|
+
}
|
|
424
|
+
function isArrowFunctionLiteral(src) {
|
|
425
|
+
const s = src.startsWith("async ") ? src.slice(6).trimStart() : src;
|
|
426
|
+
if (/^[A-Za-z_$][\w$]*\s*=>/.test(s))
|
|
427
|
+
return true;
|
|
428
|
+
if (!s.startsWith("("))
|
|
429
|
+
return false;
|
|
430
|
+
const close = findMatchingParen(s, 0);
|
|
431
|
+
if (close < 0)
|
|
432
|
+
return false;
|
|
433
|
+
if (/^\s*=>/.test(s.slice(close + 1)))
|
|
434
|
+
return true;
|
|
435
|
+
if (close === s.length - 1) {
|
|
436
|
+
return isArrowFunctionLiteral(s.slice(1, close).trim());
|
|
437
|
+
}
|
|
438
|
+
return false;
|
|
439
|
+
}
|
|
440
|
+
function findMatchingParen(src, open) {
|
|
441
|
+
let depth = 0;
|
|
442
|
+
for (let i = open; i < src.length; i++) {
|
|
443
|
+
const ch = src[i];
|
|
444
|
+
if (ch === '"' || ch === "'" || ch === "`") {
|
|
445
|
+
i = skipString(src, i, ch);
|
|
446
|
+
continue;
|
|
447
|
+
}
|
|
448
|
+
if (ch === "(")
|
|
449
|
+
depth++;
|
|
450
|
+
else if (ch === ")") {
|
|
451
|
+
depth--;
|
|
452
|
+
if (depth === 0)
|
|
453
|
+
return i;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
return -1;
|
|
457
|
+
}
|
|
458
|
+
function skipString(src, start, quote) {
|
|
459
|
+
for (let i = start + 1; i < src.length; i++) {
|
|
460
|
+
if (src[i] === "\\") {
|
|
461
|
+
i++;
|
|
462
|
+
continue;
|
|
463
|
+
}
|
|
464
|
+
if (src[i] === quote)
|
|
465
|
+
return i;
|
|
466
|
+
}
|
|
467
|
+
return src.length - 1;
|
|
468
|
+
}
|
|
469
|
+
function capChars(text, max) {
|
|
470
|
+
if (text.length <= max)
|
|
471
|
+
return text;
|
|
472
|
+
// Use safeSliceHead so we never leave a lone surrogate at the cut point —
|
|
473
|
+
// capped strings flow back through tool results into LLM request bodies.
|
|
474
|
+
const cut = safeSliceHead(text, max);
|
|
475
|
+
return cut + `\n[...truncated ${text.length - cut.length} chars]`;
|
|
476
|
+
}
|
|
477
|
+
//# sourceMappingURL=dom-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dom-helpers.js","sourceRoot":"","sources":["../../src/browser/dom-helpers.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAQjC,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,IAAU,EACV,OAA+B,EAAE;IAEjC,IAAI,QAA4B,CAAC;IACjC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QAClB,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9C,IAAI,CAAC,IAAI,CAAC,EAAE;YAAE,OAAO,UAAU,IAAI,CAAC,KAAK,EAAE,CAAC;QAC5C,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC3B,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAuB,EAAE,EAAE;QAC3D,kEAAkE;QAClE,kEAAkE;QAClE,+DAA+D;QAC/D,kEAAkE;QAClE,+CAA+C;QAC/C,MAAM,WAAW,GAAG,CAAC,IAAwB,EAAU,EAAE;YACvD,MAAM,MAAM,GAAG,QAAQ,CAAC,gBAAg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AK,KAAK;YAAE,OAAO,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;AACxB,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY,EAAE,GAAW;IACzC,IAAI,IAAI,CAAC,MAAM,IAAI,GAAG;QAAE,OAAO,IAAI,CAAC;IACpC,0EAA0E;IAC1E,yEAAyE;IACzE,MAAM,GAAG,GAAG,aAAa,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACrC,OAAO,GAAG,GAAG,mBAAmB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,SAAS,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { Page } from "playwright";
|
|
2
|
+
/**
|
|
3
|
+
* Post-action verification: an action that succeeds at the Playwright level
|
|
4
|
+
* (e.g. a click() didn't throw) can still leave the page in a state where
|
|
5
|
+
* the user-visible task hasn't actually happened — the message didn't post,
|
|
6
|
+
* the search didn't navigate, the rich-text editor didn't accept the input.
|
|
7
|
+
*
|
|
8
|
+
* `BrowserExpectation` lets the LLM assert what the page should look like
|
|
9
|
+
* after the action. The verifier polls until either the assertion passes
|
|
10
|
+
* or `timeoutMs` runs out.
|
|
11
|
+
*
|
|
12
|
+
* Each field is independently optional. When multiple fields are set, ALL
|
|
13
|
+
* must pass within the timeout window — useful for "url changed AND
|
|
14
|
+
* loading spinner gone".
|
|
15
|
+
*/
|
|
16
|
+
export interface BrowserExpectation {
|
|
17
|
+
/** Page or element text contains this substring. */
|
|
18
|
+
text?: string;
|
|
19
|
+
/** Text disappears (matches our wait `textGone` semantics). */
|
|
20
|
+
textGone?: string;
|
|
21
|
+
/**
|
|
22
|
+
* A selector resolves to a visible element. Alias `selectorVisible` is
|
|
23
|
+
* preferred and exposed in the LLM-facing prompts because "visible" is
|
|
24
|
+
* the semantic the model actually wants — DOM presence is rarely enough
|
|
25
|
+
* on SPAs that mount nodes empty before populating them.
|
|
26
|
+
*/
|
|
27
|
+
selector?: string;
|
|
28
|
+
selectorVisible?: string;
|
|
29
|
+
/**
|
|
30
|
+
* A selector is no longer visible (or resolves to nothing). `selectorGone`
|
|
31
|
+
* and `selectorHidden` are aliases — both go through the same `state:
|
|
32
|
+
* "hidden"` Playwright path.
|
|
33
|
+
*/
|
|
34
|
+
selectorGone?: string;
|
|
35
|
+
selectorHidden?: string;
|
|
36
|
+
/** location.href contains this substring. */
|
|
37
|
+
urlContains?: string;
|
|
38
|
+
/** location.href matches this regex (string compiled with `new RegExp`). */
|
|
39
|
+
urlMatches?: string;
|
|
40
|
+
/** Verify an input/textarea/contenteditable carries the given text. */
|
|
41
|
+
inputValue?: {
|
|
42
|
+
selector?: string;
|
|
43
|
+
ref?: string;
|
|
44
|
+
contains?: string;
|
|
45
|
+
equals?: string;
|
|
46
|
+
};
|
|
47
|
+
/** Total budget for the whole expectation block (default 8000ms). */
|
|
48
|
+
timeoutMs?: number;
|
|
49
|
+
}
|
|
50
|
+
export interface ExpectResult {
|
|
51
|
+
ok: boolean;
|
|
52
|
+
/** Short human-readable summary suitable for tool result text. */
|
|
53
|
+
summary: string;
|
|
54
|
+
/** Per-field outcomes for diagnostics. */
|
|
55
|
+
details: Array<{
|
|
56
|
+
field: string;
|
|
57
|
+
ok: boolean;
|
|
58
|
+
message?: string;
|
|
59
|
+
}>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Run all expectation fields against the page. Returns a structured result
|
|
63
|
+
* the caller can stitch into a tool result string. Never throws — every
|
|
64
|
+
* failure mode is captured as a `details` entry.
|
|
65
|
+
*/
|
|
66
|
+
export declare function runExpectation(page: Page, expect: BrowserExpectation): Promise<ExpectResult>;
|