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,588 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { getAllTools } from "../llm/tools.js";
|
|
3
|
+
import { runBrowserTool, capToolResultText } from "./tool-runner.js";
|
|
4
|
+
import { ToolLoopDetector, detectorOptionsForProtocol, } from "./tool-loop-detection.js";
|
|
5
|
+
import { buildLlmContext, compactMessagesWithState, CONTEXT_BUDGETS, ContextTranscript, createEmptyContextState, estimateMessagesChars, truncateContextSection, } from "./context.js";
|
|
6
|
+
import { executeMemoryAction } from "./executors/memory-executor.js";
|
|
7
|
+
import { executeStoreAction } from "./executors/store-executor.js";
|
|
8
|
+
import { executeSkillAction } from "./executors/skill-executor.js";
|
|
9
|
+
import { executeSchedulerAction } from "./executors/scheduler-executor.js";
|
|
10
|
+
import { executeAttachmentAction } from "./executors/attachment-executor.js";
|
|
11
|
+
import { executeOrgAction } from "./executors/org-executor.js";
|
|
12
|
+
import { executeWebFetchAction } from "./executors/web-fetch-executor.js";
|
|
13
|
+
/** Short loggable preview of chat input (string or multimodal). */
|
|
14
|
+
export function summarizeChatInput(message) {
|
|
15
|
+
if (typeof message === "string")
|
|
16
|
+
return message;
|
|
17
|
+
const kinds = {};
|
|
18
|
+
for (const b of message)
|
|
19
|
+
kinds[b.type] = (kinds[b.type] || 0) + 1;
|
|
20
|
+
const text = message
|
|
21
|
+
.filter((b) => b.type === "text" && b.text)
|
|
22
|
+
.map((b) => b.text)
|
|
23
|
+
.join(" ");
|
|
24
|
+
const kindSummary = Object.entries(kinds)
|
|
25
|
+
.map(([k, v]) => `${v} ${k}`)
|
|
26
|
+
.join(", ");
|
|
27
|
+
return text
|
|
28
|
+
? `[multimodal: ${kindSummary}] ${text.slice(0, 500)}`
|
|
29
|
+
: `[multimodal: ${kindSummary}]`;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Owns the LLM chat loop: history, tool dispatch, summarization, system
|
|
33
|
+
* prompt assembly. The browser lock and per-turn logging are intentionally
|
|
34
|
+
* NOT here — they belong to the caller (Agent) so the same engine can be
|
|
35
|
+
* shared if we ever spawn a second chat surface.
|
|
36
|
+
*/
|
|
37
|
+
export class ChatEngine {
|
|
38
|
+
deps;
|
|
39
|
+
chatHistory = [];
|
|
40
|
+
contextState = createEmptyContextState();
|
|
41
|
+
transcript;
|
|
42
|
+
summarizationCooldown = 0;
|
|
43
|
+
/**
|
|
44
|
+
* Identifies this chat as a logical session to the upstream gateway
|
|
45
|
+
* (e.g. sub2api's sticky-session router). Regenerated on every reset()
|
|
46
|
+
* so a cleared conversation gets a new sticky binding.
|
|
47
|
+
*/
|
|
48
|
+
sessionId = randomUUID();
|
|
49
|
+
constructor(deps) {
|
|
50
|
+
this.deps = deps;
|
|
51
|
+
this.transcript = new ContextTranscript(deps.workspace, "chat");
|
|
52
|
+
}
|
|
53
|
+
/** Clear chat history and earlier-summary context. */
|
|
54
|
+
reset() {
|
|
55
|
+
this.chatHistory = [];
|
|
56
|
+
this.contextState = createEmptyContextState();
|
|
57
|
+
this.transcript = new ContextTranscript(this.deps.workspace, "chat");
|
|
58
|
+
this.summarizationCooldown = 0;
|
|
59
|
+
this.sessionId = randomUUID();
|
|
60
|
+
}
|
|
61
|
+
/** For logging metadata — how many messages currently in history. */
|
|
62
|
+
getHistoryLength() {
|
|
63
|
+
return this.chatHistory.length;
|
|
64
|
+
}
|
|
65
|
+
/** Non-streaming chat turn. Returns the final assistant text. */
|
|
66
|
+
async chat(message) {
|
|
67
|
+
this.pushHistory({ role: "user", content: message }, { source: "user" });
|
|
68
|
+
await this.compressHistory();
|
|
69
|
+
// Read memory + skills indices ONCE per user turn so the cacheable static
|
|
70
|
+
// system prefix stays byte-identical across every tool iteration of this
|
|
71
|
+
// turn. If a tool inside the loop modifies memory or skills, those edits
|
|
72
|
+
// surface on the *next* user turn — that one-turn lag is the price of a
|
|
73
|
+
// stable cache prefix and is fine in practice.
|
|
74
|
+
const loadedInstructionSkills = this.deps.skillGenerator.getAutoLoadedInstructionSkills(summarizeChatInput(message));
|
|
75
|
+
const systemPrompt = this.buildChatSystemPrompt(this.loadChatMemoryIndex(), loadedInstructionSkills);
|
|
76
|
+
const tools = getAllTools({
|
|
77
|
+
imageGeneration: !!this.deps.imageGenerator,
|
|
78
|
+
org: !!this.deps.orgManager,
|
|
79
|
+
});
|
|
80
|
+
const loopDetector = new ToolLoopDetector(detectorOptionsForProtocol(this.deps.llmProtocol));
|
|
81
|
+
let llmContext = this.buildRequestForLlm(systemPrompt);
|
|
82
|
+
let response = await this.deps.llmClient.chat(llmContext.messages, tools, llmContext.systemPrompt, this.cacheHintsFor(llmContext, tools.length));
|
|
83
|
+
let iterations = 0;
|
|
84
|
+
let forceStop = false;
|
|
85
|
+
const maxIter = this.deps.maxIterations;
|
|
86
|
+
while (response.toolCalls.length > 0 && iterations < maxIter && !forceStop) {
|
|
87
|
+
iterations++;
|
|
88
|
+
this.pushHistory({
|
|
89
|
+
role: "assistant",
|
|
90
|
+
content: response.content,
|
|
91
|
+
toolCalls: response.toolCalls,
|
|
92
|
+
}, { source: "llm" });
|
|
93
|
+
for (const tc of response.toolCalls) {
|
|
94
|
+
let result;
|
|
95
|
+
try {
|
|
96
|
+
result = await this.executeToolCall(tc);
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
result = `Error: ${err instanceof Error ? err.message : String(err)}`;
|
|
100
|
+
}
|
|
101
|
+
result = capToolResultText(tc.name, result);
|
|
102
|
+
this.pushHistory({
|
|
103
|
+
role: "tool",
|
|
104
|
+
content: result,
|
|
105
|
+
toolCallId: tc.id,
|
|
106
|
+
}, { source: "tool", toolName: tc.name });
|
|
107
|
+
const action = tc.arguments?.action || tc.name;
|
|
108
|
+
loopDetector.record(tc.name, action, tc.arguments || {}, result);
|
|
109
|
+
}
|
|
110
|
+
const loopCheck = loopDetector.check();
|
|
111
|
+
if (loopCheck.status === "critical") {
|
|
112
|
+
console.log(` Loop detected (${loopCheck.pattern}): forcing stop`);
|
|
113
|
+
this.pushHistory({ role: "user", content: loopCheck.message }, { source: "loop_detector" });
|
|
114
|
+
forceStop = true;
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
else if (loopCheck.status === "warning") {
|
|
118
|
+
console.log(` Loop warning (${loopCheck.pattern}): injecting hint`);
|
|
119
|
+
this.pushHistory({ role: "user", content: loopCheck.message }, { source: "loop_detector" });
|
|
120
|
+
}
|
|
121
|
+
if (response.content && response.content.length > 100) {
|
|
122
|
+
loopDetector.notifySubstantiveResponse();
|
|
123
|
+
}
|
|
124
|
+
await this.compressHistory();
|
|
125
|
+
llmContext = this.buildRequestForLlm(systemPrompt);
|
|
126
|
+
response = await this.deps.llmClient.chat(llmContext.messages, tools, llmContext.systemPrompt, this.cacheHintsFor(llmContext, tools.length));
|
|
127
|
+
}
|
|
128
|
+
if ((iterations >= maxIter && response.toolCalls.length > 0) || forceStop) {
|
|
129
|
+
if (!forceStop && response.content) {
|
|
130
|
+
this.pushHistory({ role: "assistant", content: response.content }, { source: "llm" });
|
|
131
|
+
}
|
|
132
|
+
const stopReason = forceStop
|
|
133
|
+
? "A repetitive action loop was detected and stopped."
|
|
134
|
+
: "You've reached the maximum number of tool-calling iterations allowed.";
|
|
135
|
+
this.pushHistory({
|
|
136
|
+
role: "user",
|
|
137
|
+
content: `${stopReason} Please provide a final response summarizing what you've found and accomplished so far, without calling any more tools.`,
|
|
138
|
+
}, { source: "iteration_limit" });
|
|
139
|
+
await this.compressHistory();
|
|
140
|
+
llmContext = this.buildRequestForLlm(systemPrompt);
|
|
141
|
+
const summary = await this.deps.llmClient.chat(llmContext.messages, undefined, llmContext.systemPrompt, this.cacheHintsFor(llmContext, 0));
|
|
142
|
+
const finalContent = summary.content +
|
|
143
|
+
`\n\n⚠️ ${forceStop ? "Loop detected and stopped" : "Reached the maximum number of steps"}. Send a message to continue where I left off.`;
|
|
144
|
+
this.pushHistory({ role: "assistant", content: finalContent }, { source: "llm" });
|
|
145
|
+
return finalContent;
|
|
146
|
+
}
|
|
147
|
+
this.pushHistory({
|
|
148
|
+
role: "assistant",
|
|
149
|
+
content: response.content,
|
|
150
|
+
}, { source: "llm" });
|
|
151
|
+
return response.content;
|
|
152
|
+
}
|
|
153
|
+
/** Streaming chat turn. Yields text deltas; tool calls happen between yields. */
|
|
154
|
+
async *chatStream(message) {
|
|
155
|
+
this.pushHistory({ role: "user", content: message }, { source: "user" });
|
|
156
|
+
await this.compressHistory();
|
|
157
|
+
// Static system prefix is fixed for the entire turn — see chat() above for
|
|
158
|
+
// the rationale (cache stability).
|
|
159
|
+
const loadedInstructionSkills = this.deps.skillGenerator.getAutoLoadedInstructionSkills(summarizeChatInput(message));
|
|
160
|
+
const systemPrompt = this.buildChatSystemPrompt(this.loadChatMemoryIndex(), loadedInstructionSkills);
|
|
161
|
+
const tools = getAllTools({
|
|
162
|
+
imageGeneration: !!this.deps.imageGenerator,
|
|
163
|
+
org: !!this.deps.orgManager,
|
|
164
|
+
});
|
|
165
|
+
const loopDetector = new ToolLoopDetector(detectorOptionsForProtocol(this.deps.llmProtocol));
|
|
166
|
+
let iterations = 0;
|
|
167
|
+
let forceStop = false;
|
|
168
|
+
const maxIter = this.deps.maxIterations;
|
|
169
|
+
while (iterations < maxIter && !forceStop) {
|
|
170
|
+
iterations++;
|
|
171
|
+
let fullContent = "";
|
|
172
|
+
const toolCalls = [];
|
|
173
|
+
let hadToolCalls = false;
|
|
174
|
+
const llmContext = this.buildRequestForLlm(systemPrompt);
|
|
175
|
+
for await (const event of this.deps.llmClient.chatStream(llmContext.messages, tools, llmContext.systemPrompt, this.cacheHintsFor(llmContext, tools.length))) {
|
|
176
|
+
if (event.type === "text_delta" && event.text) {
|
|
177
|
+
fullContent += event.text;
|
|
178
|
+
yield event.text;
|
|
179
|
+
}
|
|
180
|
+
else if (event.type === "tool_call_end" && event.toolCall) {
|
|
181
|
+
hadToolCalls = true;
|
|
182
|
+
toolCalls.push({
|
|
183
|
+
id: event.toolCall.id,
|
|
184
|
+
name: event.toolCall.name,
|
|
185
|
+
arguments: event.toolCall.arguments || {},
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (!hadToolCalls) {
|
|
190
|
+
this.pushHistory({ role: "assistant", content: fullContent }, { source: "llm" });
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
if (fullContent.length > 100) {
|
|
194
|
+
loopDetector.notifySubstantiveResponse();
|
|
195
|
+
}
|
|
196
|
+
this.pushHistory({
|
|
197
|
+
role: "assistant",
|
|
198
|
+
content: fullContent,
|
|
199
|
+
toolCalls,
|
|
200
|
+
}, { source: "llm" });
|
|
201
|
+
for (const tc of toolCalls) {
|
|
202
|
+
let result;
|
|
203
|
+
try {
|
|
204
|
+
result = await this.executeToolCall(tc);
|
|
205
|
+
}
|
|
206
|
+
catch (err) {
|
|
207
|
+
result = `Error: ${err instanceof Error ? err.message : String(err)}`;
|
|
208
|
+
}
|
|
209
|
+
result = capToolResultText(tc.name, result);
|
|
210
|
+
this.pushHistory({
|
|
211
|
+
role: "tool",
|
|
212
|
+
content: result,
|
|
213
|
+
toolCallId: tc.id,
|
|
214
|
+
}, { source: "tool", toolName: tc.name });
|
|
215
|
+
const action = tc.arguments?.action || tc.name;
|
|
216
|
+
loopDetector.record(tc.name, action, tc.arguments || {}, result);
|
|
217
|
+
}
|
|
218
|
+
const loopCheck = loopDetector.check();
|
|
219
|
+
if (loopCheck.status === "critical") {
|
|
220
|
+
console.log(` Loop detected (${loopCheck.pattern}): forcing stop`);
|
|
221
|
+
this.pushHistory({ role: "user", content: loopCheck.message }, { source: "loop_detector" });
|
|
222
|
+
forceStop = true;
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
else if (loopCheck.status === "warning") {
|
|
226
|
+
console.log(` Loop warning (${loopCheck.pattern}): injecting hint`);
|
|
227
|
+
this.pushHistory({ role: "user", content: loopCheck.message }, { source: "loop_detector" });
|
|
228
|
+
}
|
|
229
|
+
await this.compressHistory();
|
|
230
|
+
yield "\n";
|
|
231
|
+
}
|
|
232
|
+
const stopReason = forceStop
|
|
233
|
+
? "A repetitive action loop was detected and stopped."
|
|
234
|
+
: "You've reached the maximum number of tool-calling iterations allowed.";
|
|
235
|
+
this.pushHistory({
|
|
236
|
+
role: "user",
|
|
237
|
+
content: `${stopReason} Please provide a final response summarizing what you've found and accomplished so far, without calling any more tools.`,
|
|
238
|
+
}, { source: "iteration_limit" });
|
|
239
|
+
await this.compressHistory();
|
|
240
|
+
let summaryContent = "";
|
|
241
|
+
const summaryContext = this.buildRequestForLlm(systemPrompt);
|
|
242
|
+
for await (const event of this.deps.llmClient.chatStream(summaryContext.messages, undefined, summaryContext.systemPrompt, this.cacheHintsFor(summaryContext, 0))) {
|
|
243
|
+
if (event.type === "text_delta" && event.text) {
|
|
244
|
+
summaryContent += event.text;
|
|
245
|
+
yield event.text;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
const suffix = `\n\n⚠️ ${forceStop ? "Loop detected and stopped" : "Reached the maximum number of steps"}. Send a message to continue where I left off.`;
|
|
249
|
+
this.pushHistory({ role: "assistant", content: summaryContent + suffix }, { source: "llm" });
|
|
250
|
+
yield suffix;
|
|
251
|
+
}
|
|
252
|
+
// ---- Tool dispatch ----
|
|
253
|
+
async executeToolCall(tc) {
|
|
254
|
+
const args = tc.arguments;
|
|
255
|
+
const action = args.action;
|
|
256
|
+
switch (tc.name) {
|
|
257
|
+
case "browser": {
|
|
258
|
+
// `args` already carries `action`; runBrowserTool reads it. Pass the
|
|
259
|
+
// full args object so the shared runner can capture timing + ok bit
|
|
260
|
+
// consistently with TaskRunner.
|
|
261
|
+
const r = await runBrowserTool(this.deps.browserActions, {
|
|
262
|
+
...args,
|
|
263
|
+
action,
|
|
264
|
+
});
|
|
265
|
+
return r.text;
|
|
266
|
+
}
|
|
267
|
+
case "memory":
|
|
268
|
+
return executeMemoryAction(this.deps.memory, action, args);
|
|
269
|
+
case "store":
|
|
270
|
+
return executeStoreAction(this.deps.store, action, args);
|
|
271
|
+
case "scheduler":
|
|
272
|
+
return executeSchedulerAction(this.deps.scheduler, action, args);
|
|
273
|
+
case "web_fetch":
|
|
274
|
+
return await executeWebFetchAction(args);
|
|
275
|
+
case "attachment":
|
|
276
|
+
return await executeAttachmentAction({
|
|
277
|
+
workspace: this.deps.workspace,
|
|
278
|
+
skillGenerator: this.deps.skillGenerator,
|
|
279
|
+
getAttachmentSender: this.deps.getAttachmentSender,
|
|
280
|
+
}, action, args);
|
|
281
|
+
case "skill":
|
|
282
|
+
return await executeSkillAction(this.deps.skillGenerator, action, args);
|
|
283
|
+
case "image_generation":
|
|
284
|
+
if (!this.deps.imageGenerator) {
|
|
285
|
+
return "Error: image_generation is not configured (set config.imageGeneration in your config.json).";
|
|
286
|
+
}
|
|
287
|
+
if (action === "generate") {
|
|
288
|
+
return this.deps.imageGenerator.generate(args, this.deps.getAttachmentSender(), this.deps.getProgressNotifier());
|
|
289
|
+
}
|
|
290
|
+
if (action === "edit") {
|
|
291
|
+
return this.deps.imageGenerator.edit(args, this.deps.getAttachmentSender(), this.deps.getProgressNotifier());
|
|
292
|
+
}
|
|
293
|
+
return `Unknown image_generation action: ${action}`;
|
|
294
|
+
case "org":
|
|
295
|
+
return executeOrgAction(this.deps.orgManager, this.deps.orgConfig, action, args);
|
|
296
|
+
default:
|
|
297
|
+
return `Unknown tool: ${tc.name}`;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
// ---- History sizing ----
|
|
301
|
+
estimateHistoryChars() {
|
|
302
|
+
return estimateMessagesChars(this.chatHistory);
|
|
303
|
+
}
|
|
304
|
+
pushHistory(message, meta) {
|
|
305
|
+
this.chatHistory.push(message);
|
|
306
|
+
this.transcript.append(message, meta);
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Compress chat history into structured context state. Raw messages are
|
|
310
|
+
* always retained in the transcript; if summarization fails we keep the live
|
|
311
|
+
* history until the hard limit requires a last-resort trim.
|
|
312
|
+
*/
|
|
313
|
+
async compressHistory() {
|
|
314
|
+
const limits = CONTEXT_BUDGETS.chat;
|
|
315
|
+
const currentChars = this.estimateHistoryChars();
|
|
316
|
+
if (currentChars <= limits.softLimitChars)
|
|
317
|
+
return;
|
|
318
|
+
if (this.summarizationCooldown <= 0) {
|
|
319
|
+
const compacted = await compactMessagesWithState({
|
|
320
|
+
messages: this.chatHistory,
|
|
321
|
+
state: this.contextState,
|
|
322
|
+
llmClient: this.deps.llmClient,
|
|
323
|
+
charBudget: limits.targetChars,
|
|
324
|
+
keepRatio: limits.keepRatio,
|
|
325
|
+
preserveFirst: false,
|
|
326
|
+
transcript: this.transcript,
|
|
327
|
+
sessionId: this.sessionId,
|
|
328
|
+
});
|
|
329
|
+
if (compacted.changed) {
|
|
330
|
+
console.log(`📝 Context compacted: summarized ${compacted.summarizedCount} messages. History now: ${estimateMessagesChars(compacted.messages)} chars.`);
|
|
331
|
+
this.chatHistory = compacted.messages;
|
|
332
|
+
this.contextState = compacted.state;
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
this.summarizationCooldown = 3;
|
|
336
|
+
console.error(`⚠️ Context compaction skipped (${compacted.reason ?? "unknown"}); preserving history.`);
|
|
337
|
+
}
|
|
338
|
+
if (this.summarizationCooldown > 0) {
|
|
339
|
+
this.summarizationCooldown--;
|
|
340
|
+
}
|
|
341
|
+
if (this.estimateHistoryChars() > limits.hardLimitChars) {
|
|
342
|
+
this.simpleTrim(limits.hardLimitChars);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Drop old messages at user-message boundaries to fit budget. Fallback
|
|
347
|
+
* when summarization is unavailable.
|
|
348
|
+
*/
|
|
349
|
+
simpleTrim(maxChars) {
|
|
350
|
+
if (this.estimateHistoryChars() <= maxChars)
|
|
351
|
+
return;
|
|
352
|
+
const history = this.chatHistory;
|
|
353
|
+
const safeCuts = [];
|
|
354
|
+
for (let i = 0; i < history.length; i++) {
|
|
355
|
+
if (history[i].role === "user") {
|
|
356
|
+
safeCuts.push(i);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
for (let ci = safeCuts.length - 1; ci >= 0; ci--) {
|
|
360
|
+
const cutIdx = safeCuts[ci];
|
|
361
|
+
if (cutIdx === 0)
|
|
362
|
+
continue;
|
|
363
|
+
const candidate = history.slice(cutIdx);
|
|
364
|
+
let chars = 0;
|
|
365
|
+
for (const msg of candidate) {
|
|
366
|
+
const c = typeof msg.content === "string"
|
|
367
|
+
? msg.content
|
|
368
|
+
: JSON.stringify(msg.content);
|
|
369
|
+
chars += c.length;
|
|
370
|
+
if (msg.toolCalls)
|
|
371
|
+
chars += JSON.stringify(msg.toolCalls).length;
|
|
372
|
+
}
|
|
373
|
+
if (chars <= maxChars) {
|
|
374
|
+
this.chatHistory = candidate;
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
// Fallback: keep only the last user message and following messages
|
|
379
|
+
for (let i = history.length - 1; i >= 0; i--) {
|
|
380
|
+
if (history[i].role === "user") {
|
|
381
|
+
this.chatHistory = history.slice(i);
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
this.chatHistory = [history[history.length - 1]];
|
|
386
|
+
}
|
|
387
|
+
buildRequestForLlm(systemPrompt) {
|
|
388
|
+
return buildLlmContext({
|
|
389
|
+
baseSystemPrompt: systemPrompt,
|
|
390
|
+
state: this.contextState,
|
|
391
|
+
messages: this.chatHistory,
|
|
392
|
+
contextTitle: "Earlier Conversation State",
|
|
393
|
+
transcript: this.transcript,
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Translate the static/dynamic split into LLM provider cache hints. Anthropic
|
|
398
|
+
* uses these for explicit cache_control breakpoints; OpenAI ignores them.
|
|
399
|
+
*/
|
|
400
|
+
cacheHintsFor(llmContext, toolCount) {
|
|
401
|
+
return {
|
|
402
|
+
systemStaticChars: llmContext.systemPromptStatic.length,
|
|
403
|
+
cacheTools: toolCount > 0,
|
|
404
|
+
cacheMessages: llmContext.messages.length > 0,
|
|
405
|
+
sessionId: this.sessionId,
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
loadChatMemoryIndex() {
|
|
409
|
+
return this.deps.memory.loadIndexCapped({
|
|
410
|
+
maxEntries: CONTEXT_BUDGETS.chat.memoryIndexMaxEntries,
|
|
411
|
+
maxBytes: CONTEXT_BUDGETS.chat.memoryIndexMaxBytes,
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
loadInstalledSkillsIndex() {
|
|
415
|
+
try {
|
|
416
|
+
const skills = this.deps.skillGenerator.listSkills();
|
|
417
|
+
return truncateContextSection(skills, CONTEXT_BUDGETS.chat.installedSkillsMaxChars, "installed skills list truncated");
|
|
418
|
+
}
|
|
419
|
+
catch (err) {
|
|
420
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
421
|
+
return `(could not load installed skills: ${msg})`;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
buildChatSystemPrompt(memoryIndex, loadedInstructionSkills) {
|
|
425
|
+
const installedSkills = this.loadInstalledSkillsIndex();
|
|
426
|
+
const autoLoadedSkills = this.deps.skillGenerator.renderLoadedInstructionSkillSection(loadedInstructionSkills);
|
|
427
|
+
let prompt = `You are "${this.deps.agentName}", a browser automation assistant. You help users by controlling a web browser and managing scheduled tasks.
|
|
428
|
+
|
|
429
|
+
## Capabilities
|
|
430
|
+
- Browse the web: navigate, click, type, take screenshots, extract data
|
|
431
|
+
- Fetch read-only HTTP(S) resources directly with web_fetch for JSON, text,
|
|
432
|
+
markdown, and public REST APIs
|
|
433
|
+
- Manage scheduled tasks: add, remove, enable/disable cron-based tasks
|
|
434
|
+
- Remember things: save and recall important information across sessions
|
|
435
|
+
- Handle attachments: list, read text files, install skills, and send files/images back to the user via the current frontend (Telegram)
|
|
436
|
+
- Manage skills: install markdown skills from attachments or URLs, read
|
|
437
|
+
instruction skills, and save replayable JSON-step skills
|
|
438
|
+
|
|
439
|
+
## How to use attachment tool
|
|
440
|
+
When the user uploads a file or image via Telegram it is saved under
|
|
441
|
+
workspace/attachments/ and referenced in the user message (e.g.
|
|
442
|
+
\`attachments/<filename>\`). Uploaded images also arrive as inline multimodal
|
|
443
|
+
content — you can see them without any tool call.
|
|
444
|
+
|
|
445
|
+
Paths accepted by this tool are the file's name inside attachments/; a
|
|
446
|
+
leading \`attachments/\` is stripped automatically, so both
|
|
447
|
+
\`path="foo.txt"\` and \`path="attachments/foo.txt"\` work. Absolute paths and
|
|
448
|
+
\`..\` escapes are rejected.
|
|
449
|
+
|
|
450
|
+
- Use \`action="list"\` to see what's in attachments/.
|
|
451
|
+
- Use \`action="read_text"\` with \`path\` to read a text file. Rejects
|
|
452
|
+
binary files and anything over 256 KB.
|
|
453
|
+
- Use \`action="send"\` with \`path\` to deliver a file back to the user.
|
|
454
|
+
\`asImage\` is inferred from the extension (.png/.jpg/.jpeg/.webp/.gif →
|
|
455
|
+
photo, otherwise document); set it explicitly to override. The tool only
|
|
456
|
+
returns success after the frontend confirms delivery.
|
|
457
|
+
- Use \`action="install_skill"\` with a markdown skill file to add it to the
|
|
458
|
+
skill library.
|
|
459
|
+
|
|
460
|
+
## How to use instruction skills and web_fetch
|
|
461
|
+
Some installed skills are markdown instructions rather than replayable browser
|
|
462
|
+
scripts. Use \`skill.list\` and \`skill.read\` to inspect them. If an
|
|
463
|
+
instruction skill mentions WebFetch or Bash(curl), map that request to the
|
|
464
|
+
\`web_fetch\` tool instead of trying to run shell commands. For remote skill
|
|
465
|
+
URLs, use \`skill.install\` with \`url\`.
|
|
466
|
+
|
|
467
|
+
## Installed Skills Routing
|
|
468
|
+
The installed skills list below is authoritative routing context. Before asking
|
|
469
|
+
the user which website/platform/source to use, check whether an installed skill
|
|
470
|
+
already matches the request. If it matches, use that skill first.
|
|
471
|
+
|
|
472
|
+
- For article/news/material/content queries involving tags, sources, language,
|
|
473
|
+
keywords, or time windows, prefer an installed source/material library skill
|
|
474
|
+
over generic web browsing.
|
|
475
|
+
- If \`sourcepool\` is installed, use it first for requests about articles,
|
|
476
|
+
news, materials, tags, sources, languages, or "today/recent" content. Read
|
|
477
|
+
\`sourcepool\` with \`skill.read\`, then call its read-only REST endpoints
|
|
478
|
+
with \`web_fetch\`. Do not ask which platform to search unless sourcepool
|
|
479
|
+
does not cover the request or the user explicitly asks for another site.
|
|
480
|
+
|
|
481
|
+
Installed skills:
|
|
482
|
+
${installedSkills}
|
|
483
|
+
|
|
484
|
+
${autoLoadedSkills}
|
|
485
|
+
|
|
486
|
+
To send the user a screenshot, call \`browser.screenshot\` with \`save: true\`
|
|
487
|
+
(or \`saveAs\` to pick a filename) — that writes the image into attachments/
|
|
488
|
+
and the text result gives you the filename to pass to \`attachment.send\`.
|
|
489
|
+
|
|
490
|
+
## How to use browser tool
|
|
491
|
+
The browser tool has two levels:
|
|
492
|
+
- **Top-level actions**: navigate, snapshot, screenshot, tabs, open, focus, close, console, dialog, upload
|
|
493
|
+
- **Interactions via act**: action="act" with kind="click", "type", "press", "hover", "drag", "select", "fill", "resize", "wait", "evaluate", "close"
|
|
494
|
+
|
|
495
|
+
1. Use action "navigate" to go to a URL
|
|
496
|
+
2. Use action "snapshot" to see the page (you'll get element refs like [e1], [e2])
|
|
497
|
+
3. Use action "act" with kind "click", "type", etc. using element refs or CSS selectors
|
|
498
|
+
4. After interactions, snapshot again to verify results
|
|
499
|
+
|
|
500
|
+
Example: { action: "act", kind: "click", ref: "e5" }
|
|
501
|
+
Example: { action: "act", kind: "type", ref: "e3", text: "hello" }
|
|
502
|
+
Example: { action: "act", kind: "evaluate", fn: "document.title" }
|
|
503
|
+
|
|
504
|
+
## Guidelines
|
|
505
|
+
- Always snapshot before interacting with page elements
|
|
506
|
+
- Be concise in responses
|
|
507
|
+
- Manage scheduled tasks with the scheduler tool
|
|
508
|
+
|
|
509
|
+
## Verifying actions actually worked
|
|
510
|
+
A successful click/type/submit is NOT proof the user-visible task happened —
|
|
511
|
+
many sites accept the click without sending the post, or accept text without
|
|
512
|
+
inserting it into the editor. After any submit/post/send/search/upload, you
|
|
513
|
+
MUST verify the resulting page state, ideally by passing an \`expect\` block
|
|
514
|
+
on the same act call. Examples:
|
|
515
|
+
|
|
516
|
+
- After clicking "Post"/"Send"/"Publish": pass expect for a durable state
|
|
517
|
+
change such as urlMatches, selectorGone for the compose/dialog, a visible
|
|
518
|
+
success toast/new item, or inputValue.equals: "" on the submitted editor
|
|
519
|
+
when a cleared editor is the reliable success signal.
|
|
520
|
+
- After search: pass expect with urlContains/urlMatches plus a result-list selector or result text.
|
|
521
|
+
- After upload: pass expect with an attachment/file-list selector or text containing the filename.
|
|
522
|
+
|
|
523
|
+
If you forget the expect block on a submit-like action, take a fresh snapshot
|
|
524
|
+
or call action="verify" with the expectation BEFORE declaring the task done.
|
|
525
|
+
Do not stop immediately after clicking a submit button unless the resulting
|
|
526
|
+
state has been confirmed — otherwise the task may have silently failed.
|
|
527
|
+
|
|
528
|
+
## Efficiency Guidelines
|
|
529
|
+
- Minimize tool calls. Plan multiple steps ahead before acting.
|
|
530
|
+
- Use snapshot with mode "interactive" for clickable/typeable elements only. Use "full" to read content.
|
|
531
|
+
- Use snapshot selector param to scope to a CSS subtree when only part of page is needed.
|
|
532
|
+
- Do NOT repeat the same action if it produced no new results.
|
|
533
|
+
- If you receive a loop warning, immediately change your approach or finalize your answer.
|
|
534
|
+
- **Random delays between actions are injected automatically. Do NOT add artificial delays.**
|
|
535
|
+
- **click, hover, and type auto-scroll the element into view.** No need to scroll first.
|
|
536
|
+
- snapshot captures the **full page tree regardless of scroll position**.
|
|
537
|
+
- For infinite-scroll pages, use act kind "evaluate" with \`window.scrollBy(0, 1000)\` to trigger loading, then snapshot.
|
|
538
|
+
|
|
539
|
+
## Hover
|
|
540
|
+
- Use act kind "hover" with "ref" to trigger tooltips, popups, or hover cards.
|
|
541
|
+
- Do NOT use evaluate to dispatch mouse/click events. Use act kind "hover" or "click". If a normal click with an expect block event-misses or fails verification for the same control and synthetic DOM click is semantically acceptable, retry click once with dispatch="dom". For final submit/post-style clicks where that fallback is appropriate, prefer a single click call with fallbackDispatch="dom" plus expect.
|
|
542
|
+
|
|
543
|
+
## New Actions
|
|
544
|
+
- **console**: Read browser console messages. Useful for debugging evaluate errors.
|
|
545
|
+
- **dialog**: Arm a handler for the next alert/confirm/prompt. Call BEFORE the triggering action.
|
|
546
|
+
- **upload**: Upload files to input elements or file chooser dialogs.
|
|
547
|
+
- **act kind "drag"**: Drag from startRef to endRef.
|
|
548
|
+
- **act kind "fill"**: Batch fill form fields [{ref, value, type?}].
|
|
549
|
+
- **act kind "resize"**: Resize viewport (width, height).
|
|
550
|
+
|
|
551
|
+
## Evaluate (JavaScript) Guidelines
|
|
552
|
+
- Use evaluate primarily for data extraction from the DOM. Keep scripts concise.
|
|
553
|
+
- Use bounded DOM-state writes only when a loaded skill or tool diagnostic
|
|
554
|
+
explicitly calls for that recovery path.
|
|
555
|
+
- NEVER use evaluate for delays, setTimeout, or mouse/click interactions. Use act kind "click" with dispatch="dom" instead of raw element.click() when a guarded DOM click is needed.
|
|
556
|
+
|
|
557
|
+
## Memory
|
|
558
|
+
You have access to a persistent memory store via the memory tool. Save
|
|
559
|
+
(memory.save) ONLY when the user explicitly asks you to remember something.
|
|
560
|
+
Otherwise, use memory.read / memory.list to recall prior knowledge; do not
|
|
561
|
+
volunteer to save on your own.
|
|
562
|
+
|
|
563
|
+
## Store
|
|
564
|
+
For structured cross-run state — processed ids, visited URLs, tickets,
|
|
565
|
+
observations, counters, cursors, compact histories — use the store tool, not
|
|
566
|
+
memory. store.has(collection, id) is an O(1) existence check; store.get reads
|
|
567
|
+
one record; store.put(collection, id, value?, meta?) records or updates one
|
|
568
|
+
entry. Never use memory.read + grep for structured lookups.`;
|
|
569
|
+
if (this.deps.orgManager) {
|
|
570
|
+
const department = Array.isArray(this.deps.orgConfig?.department)
|
|
571
|
+
? this.deps.orgConfig?.department.join(", ")
|
|
572
|
+
: this.deps.orgConfig?.department;
|
|
573
|
+
prompt += `
|
|
574
|
+
|
|
575
|
+
## Organization & Hierarchy (组织与层级)
|
|
576
|
+
You are part of an organization. Your department is "${department || "N/A"}" and your role is "${this.deps.orgConfig?.role || "N/A"}".
|
|
577
|
+
- If you are a **boss** (老板角色), you can manage your team using the \`org\` tool. You can list team members to discover new employees and assign tasks to them. When you assign a task, the worker will receive it, execute it, and the results will be logged automatically.
|
|
578
|
+
- As a boss, you should perform tasks directly yourself (using the browser tool) unless explicitly asked to delegate them or when managing team-wide operations. Do not casually assign your own work to others.
|
|
579
|
+
- If you are a **worker** (员工角色), you will automatically receive tasks from your boss in the background. You should prioritize completing these assignments.
|
|
580
|
+
- Use \`org.list_team\` regularly if you need to know who is online or free to help.`;
|
|
581
|
+
}
|
|
582
|
+
if (memoryIndex.trim().length > 20) {
|
|
583
|
+
prompt += `\n\n## Saved Memories\n${memoryIndex}`;
|
|
584
|
+
}
|
|
585
|
+
return prompt;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
//# sourceMappingURL=chat-engine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-engine.js","sourceRoot":"","sources":["../../src/agent/chat-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAOzC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,EACL,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,GAGvB,MAAM,cAAc,CAAC;AAUtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AA4B1E,mEAAmE;AACnE,MAAM,UAAU,kBAAkB,CAAC,OAAkB;IACnD,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,OAAO,CA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