dsh-duet 0.2.1 → 0.3.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/README.md +26 -6
- package/assets/avatar/character.glb +0 -0
- package/assets/avatar/desktop/character.glb +0 -0
- package/assets/avatar/desktop/companion.mjs +3 -3
- package/assets/avatar/desktop/index.html +10 -0
- package/assets/avatar/desktop/manifest.json +4 -4
- package/assets/avatar/desktop/portrait.png +0 -0
- package/assets/avatar/portrait.png +0 -0
- package/config/duet.patch.yml +176 -0
- package/node_modules/dsh-duet-superagent/LICENSE +21 -0
- package/node_modules/dsh-duet-superagent/README.md +39 -0
- package/node_modules/dsh-duet-superagent/cordis.patch.yml +193 -0
- package/node_modules/dsh-duet-superagent/lib/client.js +6883 -0
- package/node_modules/dsh-duet-superagent/lib/deployment-CFE4xX4v.d.ts +736 -0
- package/node_modules/dsh-duet-superagent/lib/duet.d.ts +1160 -0
- package/node_modules/dsh-duet-superagent/lib/duet.js +837 -0
- package/node_modules/dsh-duet-superagent/lib/engine-B2un4KNA.d.ts +243 -0
- package/node_modules/dsh-duet-superagent/lib/feishu-rAGM9U9b.js +1324 -0
- package/node_modules/dsh-duet-superagent/lib/feishu-watch.d.ts +125 -0
- package/node_modules/dsh-duet-superagent/lib/feishu-watch.js +2 -0
- package/node_modules/dsh-duet-superagent/lib/github-pull-gSbjzypm.js +596 -0
- package/node_modules/dsh-duet-superagent/lib/github-watch.d.ts +2 -0
- package/node_modules/dsh-duet-superagent/lib/github-watch.js +832 -0
- package/node_modules/dsh-duet-superagent/lib/index.d.ts +129 -0
- package/node_modules/dsh-duet-superagent/lib/index.js +107 -0
- package/node_modules/dsh-duet-superagent/lib/poll-Dh7J1cdM.js +872 -0
- package/node_modules/dsh-duet-superagent/lib/registry-BTgyFZ8S.d.ts +1509 -0
- package/node_modules/dsh-duet-superagent/lib/runtime-CbDPyQoo.js +10653 -0
- package/node_modules/dsh-duet-superagent/locale/en.json +6 -0
- package/node_modules/dsh-duet-superagent/locale/zh.json +6 -0
- package/node_modules/dsh-duet-superagent/package.json +113 -0
- package/node_modules/dsh-duet-superagent/prompts/admission.md +68 -0
- package/node_modules/dsh-duet-superagent/prompts/cli.md +17 -0
- package/node_modules/dsh-duet-superagent/prompts/dispatch.md +59 -0
- package/node_modules/dsh-duet-superagent/prompts/handoff-orchestrator.md +4 -0
- package/node_modules/dsh-duet-superagent/prompts/handoff-worker.md +7 -0
- package/node_modules/dsh-duet-superagent/prompts/handoff.md +6 -0
- package/node_modules/dsh-duet-superagent/prompts/orchestrator.md +16 -0
- package/node_modules/dsh-duet-superagent/prompts/replies.md +35 -0
- package/node_modules/dsh-duet-superagent/prompts/shared.md +7 -0
- package/node_modules/dsh-duet-superagent/prompts/subscriptions.md +13 -0
- package/node_modules/dsh-duet-superagent/prompts/team/communication.md +97 -0
- package/node_modules/dsh-duet-superagent/prompts/team/delivery.md +28 -0
- package/node_modules/dsh-duet-superagent/prompts/team/scope.md +22 -0
- package/node_modules/dsh-duet-superagent/prompts/work.md +49 -0
- package/node_modules/dsh-duet-superagent/prompts/worker.md +10 -0
- package/node_modules/dsh-duet-superagent/skills/dsh-superagent-feishu/SKILL.md +12 -0
- package/node_modules/dsh-duet-superagent/skills/dsh-superagent-github/SKILL.md +14 -0
- package/node_modules/graceful-fs/LICENSE.md +55 -0
- package/node_modules/graceful-fs/README.md +143 -0
- package/node_modules/graceful-fs/clone.js +23 -0
- package/node_modules/graceful-fs/graceful-fs.js +448 -0
- package/node_modules/graceful-fs/legacy-streams.js +118 -0
- package/node_modules/graceful-fs/package.json +52 -0
- package/node_modules/graceful-fs/polyfills.js +355 -0
- package/node_modules/proper-lockfile/CHANGELOG.md +108 -0
- package/node_modules/proper-lockfile/LICENSE +21 -0
- package/node_modules/proper-lockfile/README.md +183 -0
- package/node_modules/proper-lockfile/index.js +40 -0
- package/node_modules/proper-lockfile/lib/adapter.js +85 -0
- package/node_modules/proper-lockfile/lib/lockfile.js +342 -0
- package/node_modules/proper-lockfile/lib/mtime-precision.js +55 -0
- package/node_modules/proper-lockfile/package.json +71 -0
- package/node_modules/retry/.npmignore +3 -0
- package/node_modules/retry/.travis.yml +15 -0
- package/node_modules/retry/License +21 -0
- package/node_modules/retry/Makefile +18 -0
- package/node_modules/retry/README.md +227 -0
- package/node_modules/retry/equation.gif +0 -0
- package/node_modules/retry/example/dns.js +31 -0
- package/node_modules/retry/example/stop.js +40 -0
- package/node_modules/retry/index.js +1 -0
- package/node_modules/retry/lib/retry.js +100 -0
- package/node_modules/retry/lib/retry_operation.js +158 -0
- package/node_modules/retry/package.json +32 -0
- package/node_modules/retry/test/common.js +10 -0
- package/node_modules/retry/test/integration/test-forever.js +24 -0
- package/node_modules/retry/test/integration/test-retry-operation.js +258 -0
- package/node_modules/retry/test/integration/test-retry-wrap.js +101 -0
- package/node_modules/retry/test/integration/test-timeouts.js +69 -0
- package/node_modules/signal-exit/LICENSE.txt +16 -0
- package/node_modules/signal-exit/README.md +39 -0
- package/node_modules/signal-exit/index.js +202 -0
- package/node_modules/signal-exit/package.json +38 -0
- package/node_modules/signal-exit/signals.js +53 -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 +5 -2
- package/src/avatar/companion.html +10 -0
- package/src/avatar/companion.mjs +1 -1
- package/src/avatar/surface.mjs +2 -0
- package/src/client/agent-tasks.mjs +165 -0
- package/src/client/audio.mjs +30 -4
- package/src/client/avatar-surfaces.mjs +7 -4
- package/src/client/avatar-tasks.mjs +5 -2
- package/src/client/avatar.mjs +21 -2
- package/src/client/browser.mjs +70 -36
- package/src/client/composer-bridge.mjs +1 -1
- package/src/client/connection-hint.mjs +1 -1
- package/src/client/entry.js +1 -1
- package/src/client/feedback.mjs +1 -1
- package/src/client/identity.mjs +2 -2
- package/src/client/settings.html +19 -4
- package/src/client/tutorial-adapter.mjs +11 -4
- package/src/client/tutorial.mjs +11 -4
- package/src/client/work-mode.mjs +250 -0
- package/src/client/workspaces.mjs +1 -1
- package/src/host/agent-connection.mjs +199 -0
- package/src/host/agent-trace.mjs +56 -0
- package/src/host/assets.mjs +2 -0
- package/src/host/diagnostics.mjs +37 -2
- package/src/host/plugin.mjs +93 -11
- package/src/host/proxy.mjs +65 -18
- package/src/host/service-info.mjs +30 -0
- package/src/host/settings.mjs +23 -2
- package/src/host/trace.mjs +4 -1
- package/src/shared/avatar-menu-ui.mjs +5 -3
- package/src/shared/avatar-menu.mjs +3 -0
- package/src/shared/avatar-surface.mjs +2 -1
- package/src/shared/state.mjs +17 -4
- package/src/shared/work-mode.mjs +59 -0
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ https://github.com/user-attachments/assets/83152138-c292-4057-a820-efc2bc96f33a
|
|
|
7
7
|
duet,意为「二重奏」。这里的 duet 使用全双工语音模型,可以边听边说,
|
|
8
8
|
让你与 DSH 的交流不必一人一句地等待。
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
说出需求,让 duet 帮你执行任务,或者把想法写进 DSH 输入框。你可以随时插话、补充或纠正。处理任务之外,也可以聊聊天。
|
|
11
11
|
|
|
12
12
|
当然,你也可以用 duet 帮你只播报结果,让你不用一直盯着屏幕。
|
|
13
13
|
|
|
@@ -49,9 +49,19 @@ Desktop 用户在插件管理页面更新。
|
|
|
49
49
|
|
|
50
50
|
## 使用
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
### 选择工作方式
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
| 工作方式 | 适合怎样使用 |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| **代理模式** | 直接帮你执行任务。说出需求,duet 会安排任务、跟进进展,需要补充信息时再问你。 |
|
|
57
|
+
| **输入模式** | 帮你把需求输入文本框。可以修改内容,确认后再说“发送”,也可以用语音管理会话。 |
|
|
58
|
+
|
|
59
|
+
可以在设置中切换工作方式。使用代理模式时,先选择或创建一个工作区;推荐创建 dsh-duet 专属工作区。
|
|
60
|
+
代理模式需要你的授权,会以完整权限执行任务,包括运行命令、读写文件和访问网络。
|
|
61
|
+
|
|
62
|
+
### 开口交互,或只听播报
|
|
63
|
+
|
|
64
|
+
两种工作方式都支持交互和播报:
|
|
55
65
|
|
|
56
66
|
| 按钮 | 模式 | 用途 |
|
|
57
67
|
| --- | --- | --- |
|
|
@@ -72,7 +82,17 @@ duet 支持两种模式。
|
|
|
72
82
|
|
|
73
83
|
你还可以在设置中给助手起个昵称,或直接用语音改名。
|
|
74
84
|
|
|
75
|
-
###
|
|
85
|
+
### 代理模式:直接交给 duet
|
|
86
|
+
|
|
87
|
+
| 操作 | 你可以这样说 |
|
|
88
|
+
| --- | --- |
|
|
89
|
+
| 开始任务 | “帮我整理一下这周的计划” |
|
|
90
|
+
| 继续修改 | “刚才那份计划,改成按天排列” |
|
|
91
|
+
| 询问进展 | “刚才的任务做得怎么样了?” |
|
|
92
|
+
| 回答追问 | “就用这周,把周末也算上” |
|
|
93
|
+
| 停止任务 | “停止刚才整理计划的任务” |
|
|
94
|
+
|
|
95
|
+
### 输入模式:用声音操作 DSH
|
|
76
96
|
|
|
77
97
|
| 操作 | 你可以这样说 |
|
|
78
98
|
| --- | --- |
|
|
@@ -87,8 +107,8 @@ duet 支持两种模式。
|
|
|
87
107
|
| 分叉会话 | “从当前会话分叉一个新会话” |
|
|
88
108
|
| 归档会话 | “归档这个会话” |
|
|
89
109
|
| 回答 DSH 的问题 | “选第二个”“用中文就好” |
|
|
90
|
-
|
|
91
|
-
|
|
110
|
+
|
|
111
|
+
两种工作方式下都可以自由聊天,也可以说“把你的名字改成沐沐”,给助手起个昵称。
|
|
92
112
|
|
|
93
113
|
## 麦克风与隐私
|
|
94
114
|
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{mountAvatarRenderer as st}from"./renderer.mjs";var ve=Object.freeze({large:1,medium:.75,small:.5}),j=e=>Object.hasOwn(ve,e)?e:"large";var mt=Object.freeze({enabled:!0,webOnly:!1,size:"large"}),ue=class{constructor(t=15e3,i=Date.now(),l=6e4){this.interval=t,this.timeout=l,this.last=this.tick=i}touch(t=Date.now()){this.last=t}expired(t=Date.now()){return(t-this.tick>this.interval*2||t<this.tick)&&(this.last=t),this.tick=t,t-this.last>this.timeout}},ft=Object.freeze({off:"\u5F53\u524D\u663E\u793A\uFF1A\u5DF2\u5173\u95ED",desktop:"\u5F53\u524D\u663E\u793A\uFF1A\u684C\u9762\u6D6E\u52A8\u7A97\u53E3",connecting:"\u5F53\u524D\u663E\u793A\uFF1A\u6B63\u5728\u542F\u52A8\u684C\u9762\u7A97\u53E3",recovering:"\u5F53\u524D\u663E\u793A\uFF1A\u684C\u9762\u8FDE\u63A5\u6062\u590D\u4E2D",other:"\u5F53\u524D\u663E\u793A\uFF1A\u7531\u53E6\u4E00\u4E2A DSH \u9875\u9762\u7BA1\u7406\u684C\u9762\u7A97\u53E3",web:"\u5F53\u524D\u663E\u793A\uFF1A\u7F51\u9875\u5185",fallback:"\u5F53\u524D\u663E\u793A\uFF1A\u7F51\u9875\u5185\uFF08\u684C\u9762\u7EC4\u4EF6\u6682\u4E0D\u53EF\u7528\uFF09",unavailable:"\u5F53\u524D\u663E\u793A\uFF1A\u5F62\u8C61\u52A0\u8F7D\u5931\u8D25"});function Oe(e){if(!e||!["off","online","tts_only"].includes(e.mode)||!Number.isFinite(e.rms)||e.rms<0||e.rms>1)throw Error("invalid_avatar_frame");return{type:"frame",mode:e.mode,ready:e.ready===!0,rms:e.rms,size:j(e.size),viseme:["A","I","U","E","O"].includes(e.viseme)?e.viseme:"A",text:typeof e.text=="string"?e.text.slice(-240):"",utterance:typeof e.utterance=="string"?e.utterance.slice(0,100):""}}function qe(e){if(e?.type!=="input_effect"||typeof e.text!="string"||!e.text||e.text.length>600)throw Error("invalid_avatar_input_effect");return{type:"input_effect",text:e.text}}var pe=Object.keys(ve),we={large:"\u5927\uFF08100%\uFF09",medium:"\u4E2D\uFF0875%\uFF09",small:"\u5C0F\uFF0850%\uFF09"},se=e=>pe[(pe.indexOf(j(e))+1)%pe.length];function re(e,t,{label:i=!1}={}){let l=j(t),n=`\u5F62\u8C61\u5927\u5C0F\uFF1A${we[l]}\uFF0C\u70B9\u51FB\u5207\u6362\u4E3A${we[se(l)]}`;e.type="button",e.dataset.size=l,e.setAttribute("aria-label",n),e.title=n;let a=pe.filter(d=>d!==l).concat(l).map(d=>{let o={large:18,medium:12,small:6}[d];return`<rect data-size-square="${d}" x="3" y="${21-o}" width="${o}" height="${o}" stroke-width="${d===l?"2.8":"1"}"/>`}).join("");e.innerHTML=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true">${a}</svg>${i?`<span>${we[l]}</span>`:""}`}function Ne({onChange:e=()=>{},floating:t=!1,origin:i="page",anchor:l=()=>null,viewport:n=()=>[0,0,innerWidth,innerHeight]}={}){let a=null,d,o,_,v=!1,k=()=>{if(!t||!o)return;let f=l()?.getBoundingClientRect();if(!f)return;let g=o.getBoundingClientRect(),[p,r,h,m]=n(),w=f.top-g.height-16>=r+12?f.top-g.height-16:f.bottom+12;o.style.left=Math.max(p+12,Math.min(f.left+f.width/2-g.width/2,p+h-g.width-12))+"px",o.style.top=Math.max(r+12,Math.min(w,r+m-g.height-12))+"px",o.style.bottom="auto"},S=f=>{if(!a)return;let g=d;a=null,d=null,document.removeEventListener("keydown",T,!0),window.removeEventListener("resize",k),o?.remove(),o=null,_?.isConnected&&_.focus({preventScroll:!0}),e(),g(f)},T=f=>{if(f.key==="Escape")f.preventDefault(),f.stopImmediatePropagation(),S(!1);else if(f.key==="Tab"&&!t){f.preventDefault();let g=[...o.querySelectorAll("button")],p=g.indexOf(document.activeElement);g[(p+(f.shiftKey?-1:1)+g.length)%g.length].focus()}};return{ask(){if(v)return Promise.resolve(!1);if(a)return a;_=document.activeElement,a=new Promise(r=>d=r),o=document.createElement("div"),o.dataset.avatarCloseOverlay="",o.style.cssText="position:fixed;inset:0;z-index:2147483600;display:flex;align-items:center;justify-content:center;padding:12px;box-sizing:border-box;background:#0003;pointer-events:auto",t&&(o.dataset.duetAvatarSurface="110",o.dataset.duetSurfaceOrigin=i,o.style.cssText="position:fixed;left:12px;bottom:100px;width:260px;max-width:calc(100vw - 24px);z-index:2147483600;pointer-events:auto");let f=document.createElement("div");f.dataset.avatarCloseConfirm="",f.setAttribute("role","alertdialog"),f.setAttribute("aria-modal",String(!t)),f.setAttribute("aria-label","\u9690\u85CF\u62DF\u4EBA\u89D2\u8272\uFF1F"),f.style.cssText="box-sizing:border-box;width:260px;max-width:100%;padding:16px;border:1px solid #8dc5ed55;border-radius:16px;background:#142638;color:#e9f4ff;font:13px/1.6 system-ui;box-shadow:0 8px 28px #0005";let g=document.createElement("div");g.textContent="\u9690\u85CF\u62DF\u4EBA\u89D2\u8272\uFF1F",g.style.cssText="font-size:14px;font-weight:600;margin-bottom:14px";let p=document.createElement("div");p.style.cssText="display:flex;justify-content:flex-end;gap:8px";for(let[r,h]of[["\u53D6\u6D88",!1],["\u9690\u85CF\u62DF\u4EBA\u89D2\u8272",!0]]){let m=document.createElement("button");m.type="button",m.textContent=r,m.dataset.avatarCloseChoice=h?"confirm":"cancel",m.style.cssText=`font:13px system-ui;display:block;width:auto;min-width:56px;min-height:32px;padding:6px 10px;border:0;border-radius:8px;cursor:pointer;background:${h?"#dcefff":"#294154"};color:${h?"#185a89":"#e9f4ff"}`,m.onclick=()=>S(h),p.append(m)}return f.append(g,p),o.append(f),document.body.append(o),document.addEventListener("keydown",T,!0),window.addEventListener("resize",k),k(),p.firstChild.focus(),e(),a},cancel(){S(!1)},dispose(){v=!0,S(!1)},get element(){return o}}}function Be(e,t,i,l){let[n,a,d,o]=t;return!d||!o||i<n||l<a||i>=n+d||l>=a+o||e?.length!==3072?!1:e[Math.floor((l-a)/o*64)*48+Math.floor((i-n)/d*48)]===1}function $e({tools:e,avatar:t,hitTest:i=()=>!1,onChange:l=()=>{}}){let n=!1,a=!1,d=!1,o=!1,_={x:-1,y:-1,overAvatar:!1},v,k,S=b=>{let A=b.getBoundingClientRect();return[A.x,A.y,A.width,A.height]},T=([b,A,ne,ye])=>_.x>=b&&_.y>=A&&_.x<b+ne&&_.y<A+ye,f=()=>{let b=t.getBoundingClientRect(),A=e.getBoundingClientRect();return[Math.min(b.left,A.left),b.bottom-2,Math.max(b.right,A.right)-Math.min(b.left,A.left),Math.max(0,A.top-b.bottom)+4]},g=()=>{e.dataset.revealed=String(a),e.dataset.interactive=String(d),e.dataset.confirming=String(o),l()},p=()=>o||e.dataset.keyboard==="true"&&!!e.querySelector(":focus-visible")||_.overAvatar||d&&(T(S(e))||T(f())),r=()=>{n||(p()?(clearTimeout(v),v=null,clearTimeout(k),k=null,(!a||!d)&&(a=!0,d=!0,g())):a&&!v&&(v=setTimeout(()=>{if(v=null,n||p())return r();a=!1,g(),k=setTimeout(()=>{if(k=null,!n){if(p())return r();d=!1,g()}},500)},180)))},h=b=>{n||(_={x:Number.isFinite(b.x)?b.x:-1,y:Number.isFinite(b.y)?b.y:-1,overAvatar:b.overAvatar===!0},t.style.pointerEvents=_.overAvatar?"auto":"none",r())},m=b=>h({x:b.clientX,y:b.clientY,overAvatar:i(b.clientX,b.clientY)}),w=()=>h({x:-1,y:-1,overAvatar:!1}),N=()=>queueMicrotask(r),te=b=>{["Shift","Control","Alt","Meta"].includes(b.key)||(e.dataset.keyboard="true"),N()},B=()=>{e.dataset.keyboard="false",N()},M=()=>{e.dataset.keyboard="false",w()},R=(b,A,ne)=>(b.addEventListener(A,ne),()=>b.removeEventListener(A,ne)),V=[R(document,"pointermove",m),R(document,"pointerleave",w),R(document,"focusin",N),R(document,"focusout",N),R(document,"keydown",te),R(document,"pointerdown",B),R(window,"blur",M)];return e.dataset.keyboard="false",e.dataset.revealed="false",e.dataset.interactive="false",e.dataset.confirming="false",t.style.pointerEvents="none",{pointer:h,refresh(){r()},setConfirmation(b){o=!!b,g(),r()},get interactive(){return d},regions(){return d?[S(e),f()]:[]},dispose(){n=!0,clearTimeout(v),clearTimeout(k),V.forEach(b=>b())}}}function Le(e){if(e?.type!=="surface")throw Error("invalid_surface");if(e.panel===null)return{type:"surface",panel:null};let t=e.panel;if(!t||!/^s\d+$/.test(t.id)||!Number.isSafeInteger(t.revision)||t.revision<1||!Array.isArray(t.nodes)||t.nodes.length>160)throw Error("invalid_surface");let i=0,l=t.nodes.map(n=>{if(!n||!["text","heading","button","checkbox","break"].includes(n.kind)||typeof n.text!="string"||n.text.length>4e3||(i+=n.text.length,i>1e4))throw Error("invalid_surface");let a={kind:n.kind,text:n.text};if(n.kind==="button"||n.kind==="checkbox"){if(!/^a\d+$/.test(n.action))throw Error("invalid_surface");Object.assign(a,{action:n.action,disabled:n.disabled===!0,checked:n.checked===!0,gesture:n.gesture===!0,label:String(n.label||"").slice(0,100)})}return a});return{type:"surface",panel:{id:t.id,revision:t.revision,nodes:l,target:["online","tts_only"].includes(t.target)?t.target:null}}}function De(e,{send:t,changed:i}){let l=null,n="",a=new Map;return{update(d){let o=Le(d).panel,_=JSON.stringify(o);if(_===n)return;let v=e.contains(document.activeElement)?document.activeElement.dataset.surfaceAction:null,k=e.scrollTop,S=l?.id===o?.id;n=_,l=o,e.hidden=!o;let T=[],f=new Map,g=(p,r)=>{let h=S?a.get(p):null,m=h?.tagName.toLowerCase()===r?h:document.createElement(r);return f.set(p,m),T.push(m),m};if(o){if(o.nodes.some(p=>p.gesture)){let p=o.nodes.find(h=>h.gesture&&h.kind==="button"),r=g("gesture","p");r.className="gesture-note",r.textContent=p?.text==="\u5F00\u59CB\u6559\u5B66"?"\u8BF7\u56DE\u5230 DSH\uFF0C\u70B9\u51FB\u201C\u5F00\u59CB\u6559\u5B66\u201D\u3002":"\u8BF7\u56DE\u5230 DSH\uFF0C\u70B9\u51FB\u201C\u542F\u52A8\u97F3\u9891\u64AD\u653E\u201D\u3002"}for(let[p,r]of o.nodes.entries()){let h=r.kind==="break"?"br":r.kind==="heading"?"h3":r.kind==="button"?"button":r.kind==="checkbox"?"input":"span",m=g(r.action||"node"+p,h);if(m.textContent!==r.text&&(m.textContent=r.text),r.kind==="checkbox"&&(m.type="checkbox",m.checked=r.checked),r.kind==="button"||r.kind==="checkbox"){m.dataset.surfaceAction=r.action,r.kind==="button"&&(m.type="button"),m.disabled=r.disabled||r.gesture,r.label?m.setAttribute("aria-label",r.label):m.removeAttribute("aria-label");let w=()=>{l!==o||m.disabled||t({type:"surface_action",id:o.id,revision:o.revision,action:r.action,checked:m.checked===!0})};r.kind==="checkbox"?m.onchange=w:m.onclick=w}}}for(T.forEach((p,r)=>{e.children[r]!==p&&e.insertBefore(p,e.children[r]||null)});e.children.length>T.length;)e.lastElementChild.remove();if(a=f,v){let p=a.get(v);p&&!p.disabled&&document.activeElement!==p&&p.focus({preventScroll:!0})}e.scrollTop=k,i(!!o,o?.target)}}}var He="avatar_local_v1";var nt=["open_dsh","pending","settings","tutorial","hide","notifications","size","bubble","view","dismiss"],_e=["small","medium","large"],it=["completed","failed","stopped","approval","question","plan_review"];var me=(e,t)=>typeof e=="string"?e.slice(0,t):"";function Ue(e){if(e?.type!=="menu_action"||!nt.includes(e.action)||!/^[a-zA-Z0-9-]{1,64}$/.test(e.request_id||""))throw Error("invalid_avatar_menu_action");let t={type:"menu_action",request_id:e.request_id,action:e.action};if(["size","bubble"].includes(e.action)){if(!_e.includes(e.value))throw Error("invalid_avatar_size");t.value=e.value}if(["view","dismiss"].includes(e.action)){if(typeof e.id!="string"||!e.id||e.id.length>512)throw Error("invalid_avatar_notice");t.id=e.id}if(e.action==="notifications"){if(typeof e.value!="boolean")throw Error("invalid_avatar_preference");t.value=e.value}if(e.action==="snooze"){if(![0,30].includes(e.value))throw Error("invalid_avatar_snooze");t.value=e.value}return t}function Pe(e){if(e?.type!=="local_state"||e.protocol!==He||!Number.isSafeInteger(e.revision)||e.revision<0||!Array.isArray(e.items)||e.items.length>32)throw Error("invalid_avatar_local_state");let t=e.items.map(i=>{if(!it.includes(i.status)||!i.id||typeof i.id!="string"||i.id.length>512)throw Error("invalid_avatar_notice");return{id:i.id,session_id:me(i.session_id,256),name:me(i.name,100),status:i.status,summary:me(i.summary,240),pending:i.pending===!0,unread:i.unread===!0}});for(;JSON.stringify(t).length>12e3;)t.pop();return{type:"local_state",protocol:He,revision:e.revision,items:t,size:_e.includes(e.size)?e.size:"large",bubble:_e.includes(e.bubble)?e.bubble:"medium",enabled:e.enabled!==!1,snoozed:e.snoozed===!0,running:Math.max(0,Math.min(1e4,Number(e.running)||0)),available:e.available===!0,toast:t.some(i=>i.id===e.toast)?e.toast:null}}function Ve(e){if(e?.type!=="menu_result"||!/^[a-zA-Z0-9-]{1,64}$/.test(e.request_id||""))throw Error("invalid_avatar_menu_result");return{type:"menu_result",request_id:e.request_id,ok:e.ok===!0,message:me(e.message,180)}}var je={completed:"\u672C\u8F6E\u5DF2\u5B8C\u6210",failed:"\u6267\u884C\u5931\u8D25",stopped:"\u5DF2\u505C\u6B62",approval:"\u7B49\u5F85\u6388\u6743",question:"\u7B49\u5F85\u56DE\u7B54",plan_review:"\u7B49\u5F85\u65B9\u6848\u786E\u8BA4"},Fe={small:"\u7D27\u51D1",medium:"\u6807\u51C6",large:"\u5BBD\u677E"},ke={open:"M14 3h7v7m0-7L10 14M10 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-5",pending:"M8 4h8m-9 0H5v17h14V4h-2M8 3h8v4H8zM8 12h8m-8 4h5",bubble:"M5 4h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H9l-5 3v-3H3V6a2 2 0 0 1 2-2zM7 9h10m-10 4h6",tutorial:"m9 5 10 7-10 7z",settings:"M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8M9 3h6l1 3 3 1 2 5-2 5-3 1-1 3H9l-1-3-3-1-2-5 2-5 3-1z",hide:"m4 4 16 16M9 5a11 11 0 0 1 12 7l-3 4M6 6a13 13 0 0 0-5 6s4 7 11 7l3-1M10 10a3 3 0 0 0 4 4",back:"m14 5-7 7 7 7"},at=e=>{let t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("aria-hidden","true"),t.innerHTML=`<path d="${ke[e]||ke.pending}"/>`,t};function Ye({anchor:e,viewport:t=()=>[0,0,innerWidth,innerHeight],send:i,changed:l=()=>{}}){let n={items:[],running:0,enabled:!0,size:"large",bubble:"medium"},a,d,o,_="main",v,k=!1,S,T,f,g,p=document.createElement("style");p.textContent=`
|
|
1
|
+
import{mountAvatarRenderer as lt}from"./renderer.mjs";var ve=Object.freeze({large:1,medium:.75,small:.5}),Y=e=>Object.hasOwn(ve,e)?e:"large";var ht=Object.freeze({enabled:!0,webOnly:!1,size:"large"}),ue=class{constructor(t=15e3,i=Date.now(),l=6e4){this.interval=t,this.timeout=l,this.last=this.tick=i}touch(t=Date.now()){this.last=t}expired(t=Date.now()){return(t-this.tick>this.interval*2||t<this.tick)&&(this.last=t),this.tick=t,t-this.last>this.timeout}},bt=Object.freeze({off:"\u5F53\u524D\u663E\u793A\uFF1A\u5DF2\u5173\u95ED",desktop:"\u5F53\u524D\u663E\u793A\uFF1A\u684C\u9762\u6D6E\u52A8\u7A97\u53E3",connecting:"\u5F53\u524D\u663E\u793A\uFF1A\u6B63\u5728\u542F\u52A8\u684C\u9762\u7A97\u53E3",recovering:"\u5F53\u524D\u663E\u793A\uFF1A\u684C\u9762\u8FDE\u63A5\u6062\u590D\u4E2D",other:"\u5F53\u524D\u663E\u793A\uFF1A\u7531\u53E6\u4E00\u4E2A DSH \u9875\u9762\u7BA1\u7406\u684C\u9762\u7A97\u53E3",web:"\u5F53\u524D\u663E\u793A\uFF1A\u7F51\u9875\u5185",fallback:"\u5F53\u524D\u663E\u793A\uFF1A\u7F51\u9875\u5185\uFF08\u684C\u9762\u7EC4\u4EF6\u6682\u4E0D\u53EF\u7528\uFF09",unavailable:"\u5F53\u524D\u663E\u793A\uFF1A\u5F62\u8C61\u52A0\u8F7D\u5931\u8D25"});function Oe(e){if(!e||!["off","online","tts_only"].includes(e.mode)||!Number.isFinite(e.rms)||e.rms<0||e.rms>1)throw Error("invalid_avatar_frame");return{type:"frame",mode:e.mode,ready:e.ready===!0,rms:e.rms,size:Y(e.size),viseme:["A","I","U","E","O"].includes(e.viseme)?e.viseme:"A",text:typeof e.text=="string"?e.text.slice(-240):"",utterance:typeof e.utterance=="string"?e.utterance.slice(0,100):""}}function qe(e){if(e?.type!=="input_effect"||typeof e.text!="string"||!e.text||e.text.length>600)throw Error("invalid_avatar_input_effect");return{type:"input_effect",text:e.text}}var pe=Object.keys(ve),we={large:"\u5927\uFF08100%\uFF09",medium:"\u4E2D\uFF0875%\uFF09",small:"\u5C0F\uFF0850%\uFF09"},se=e=>pe[(pe.indexOf(Y(e))+1)%pe.length];function re(e,t,{label:i=!1}={}){let l=Y(t),n=`\u5F62\u8C61\u5927\u5C0F\uFF1A${we[l]}\uFF0C\u70B9\u51FB\u5207\u6362\u4E3A${we[se(l)]}`;e.type="button",e.dataset.size=l,e.setAttribute("aria-label",n),e.title=n;let a=pe.filter(d=>d!==l).concat(l).map(d=>{let o={large:18,medium:12,small:6}[d];return`<rect data-size-square="${d}" x="3" y="${21-o}" width="${o}" height="${o}" stroke-width="${d===l?"2.8":"1"}"/>`}).join("");e.innerHTML=`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" aria-hidden="true">${a}</svg>${i?`<span>${we[l]}</span>`:""}`}function Be({onChange:e=()=>{},floating:t=!1,origin:i="page",anchor:l=()=>null,viewport:n=()=>[0,0,innerWidth,innerHeight]}={}){let a=null,d,o,_,v=!1,k=()=>{if(!t||!o)return;let f=l()?.getBoundingClientRect();if(!f)return;let g=o.getBoundingClientRect(),[p,r,h,m]=n(),w=f.top-g.height-16>=r+12?f.top-g.height-16:f.bottom+12;o.style.left=Math.max(p+12,Math.min(f.left+f.width/2-g.width/2,p+h-g.width-12))+"px",o.style.top=Math.max(r+12,Math.min(w,r+m-g.height-12))+"px",o.style.bottom="auto"},z=f=>{if(!a)return;let g=d;a=null,d=null,document.removeEventListener("keydown",M,!0),window.removeEventListener("resize",k),o?.remove(),o=null,_?.isConnected&&_.focus({preventScroll:!0}),e(),g(f)},M=f=>{if(f.key==="Escape")f.preventDefault(),f.stopImmediatePropagation(),z(!1);else if(f.key==="Tab"&&!t){f.preventDefault();let g=[...o.querySelectorAll("button")],p=g.indexOf(document.activeElement);g[(p+(f.shiftKey?-1:1)+g.length)%g.length].focus()}};return{ask(){if(v)return Promise.resolve(!1);if(a)return a;_=document.activeElement,a=new Promise(r=>d=r),o=document.createElement("div"),o.dataset.avatarCloseOverlay="",o.style.cssText="position:fixed;inset:0;z-index:2147483600;display:flex;align-items:center;justify-content:center;padding:12px;box-sizing:border-box;background:#0003;pointer-events:auto",t&&(o.dataset.duetAvatarSurface="110",o.dataset.duetSurfaceOrigin=i,o.style.cssText="position:fixed;left:12px;bottom:100px;width:260px;max-width:calc(100vw - 24px);z-index:2147483600;pointer-events:auto");let f=document.createElement("div");f.dataset.avatarCloseConfirm="",f.setAttribute("role","alertdialog"),f.setAttribute("aria-modal",String(!t)),f.setAttribute("aria-label","\u9690\u85CF\u62DF\u4EBA\u89D2\u8272\uFF1F"),f.style.cssText="box-sizing:border-box;width:260px;max-width:100%;padding:16px;border:1px solid #8dc5ed55;border-radius:16px;background:#142638;color:#e9f4ff;font:13px/1.6 system-ui;box-shadow:0 8px 28px #0005";let g=document.createElement("div");g.textContent="\u9690\u85CF\u62DF\u4EBA\u89D2\u8272\uFF1F",g.style.cssText="font-size:14px;font-weight:600;margin-bottom:14px";let p=document.createElement("div");p.style.cssText="display:flex;justify-content:flex-end;gap:8px";for(let[r,h]of[["\u53D6\u6D88",!1],["\u9690\u85CF\u62DF\u4EBA\u89D2\u8272",!0]]){let m=document.createElement("button");m.type="button",m.textContent=r,m.dataset.avatarCloseChoice=h?"confirm":"cancel",m.style.cssText=`font:13px system-ui;display:block;width:auto;min-width:56px;min-height:32px;padding:6px 10px;border:0;border-radius:8px;cursor:pointer;background:${h?"#dcefff":"#294154"};color:${h?"#185a89":"#e9f4ff"}`,m.onclick=()=>z(h),p.append(m)}return f.append(g,p),o.append(f),document.body.append(o),document.addEventListener("keydown",M,!0),window.addEventListener("resize",k),k(),p.firstChild.focus(),e(),a},cancel(){z(!1)},dispose(){v=!0,z(!1)},get element(){return o}}}function Ne(e,t,i,l){let[n,a,d,o]=t;return!d||!o||i<n||l<a||i>=n+d||l>=a+o||e?.length!==3072?!1:e[Math.floor((l-a)/o*64)*48+Math.floor((i-n)/d*48)]===1}function $e({tools:e,avatar:t,hitTest:i=()=>!1,onChange:l=()=>{}}){let n=!1,a=!1,d=!1,o=!1,_={x:-1,y:-1,overAvatar:!1},v,k,z=b=>{let A=b.getBoundingClientRect();return[A.x,A.y,A.width,A.height]},M=([b,A,F,ye])=>_.x>=b&&_.y>=A&&_.x<b+F&&_.y<A+ye,f=()=>{let b=t.getBoundingClientRect(),A=e.getBoundingClientRect();return[Math.min(b.left,A.left),b.bottom-2,Math.max(b.right,A.right)-Math.min(b.left,A.left),Math.max(0,A.top-b.bottom)+4]},g=()=>{e.dataset.revealed=String(a),e.dataset.interactive=String(d),e.dataset.confirming=String(o),l()},p=()=>o||e.dataset.keyboard==="true"&&!!e.querySelector(":focus-visible")||_.overAvatar||d&&(M(z(e))||M(f())),r=()=>{n||(p()?(clearTimeout(v),v=null,clearTimeout(k),k=null,(!a||!d)&&(a=!0,d=!0,g())):a&&!v&&(v=setTimeout(()=>{if(v=null,n||p())return r();a=!1,g(),k=setTimeout(()=>{if(k=null,!n){if(p())return r();d=!1,g()}},500)},180)))},h=b=>{n||(_={x:Number.isFinite(b.x)?b.x:-1,y:Number.isFinite(b.y)?b.y:-1,overAvatar:b.overAvatar===!0},t.style.pointerEvents=_.overAvatar?"auto":"none",r())},m=b=>h({x:b.clientX,y:b.clientY,overAvatar:i(b.clientX,b.clientY)}),w=()=>h({x:-1,y:-1,overAvatar:!1}),N=()=>queueMicrotask(r),V=b=>{["Shift","Control","Alt","Meta"].includes(b.key)||(e.dataset.keyboard="true"),N()},H=()=>{e.dataset.keyboard="false",N()},C=()=>{e.dataset.keyboard="false",w()},R=(b,A,F)=>(b.addEventListener(A,F),()=>b.removeEventListener(A,F)),j=[R(document,"pointermove",m),R(document,"pointerleave",w),R(document,"focusin",N),R(document,"focusout",N),R(document,"keydown",V),R(document,"pointerdown",H),R(window,"blur",C)];return e.dataset.keyboard="false",e.dataset.revealed="false",e.dataset.interactive="false",e.dataset.confirming="false",t.style.pointerEvents="none",{pointer:h,refresh(){r()},setConfirmation(b){o=!!b,g(),r()},get interactive(){return d},regions(){return d?[z(e),f()]:[]},dispose(){n=!0,clearTimeout(v),clearTimeout(k),j.forEach(b=>b())}}}function Le(e){if(e?.type!=="surface")throw Error("invalid_surface");if(e.panel===null)return{type:"surface",panel:null};let t=e.panel;if(!t||!/^s\d+$/.test(t.id)||!Number.isSafeInteger(t.revision)||t.revision<1||!Array.isArray(t.nodes)||t.nodes.length>160)throw Error("invalid_surface");let i=0,l=t.nodes.map(n=>{if(!n||!["text","heading","button","checkbox","break"].includes(n.kind)||typeof n.text!="string"||n.text.length>4e3||(i+=n.text.length,i>1e4))throw Error("invalid_surface");let a={kind:n.kind,text:n.text};if(["running","completed","waiting","failed","stopped"].includes(n.taskState)&&(a.taskState=n.taskState),n.kind==="button"||n.kind==="checkbox"){if(!/^a\d+$/.test(n.action))throw Error("invalid_surface");Object.assign(a,{action:n.action,disabled:n.disabled===!0,checked:n.checked===!0,gesture:n.gesture===!0,label:String(n.label||"").slice(0,100)})}return a});return{type:"surface",panel:{id:t.id,revision:t.revision,nodes:l,target:["online","tts_only"].includes(t.target)?t.target:null,...t.layout==="tasks"?{layout:"tasks"}:{}}}}function De(e,{send:t,changed:i}){let l=null,n="",a=new Map;return{update(d){let o=Le(d).panel,_=JSON.stringify(o);if(_===n)return;let v=e.contains(document.activeElement)?document.activeElement.dataset.surfaceAction:null,k=e.scrollTop,z=l?.id===o?.id;n=_,l=o,e.hidden=!o,e.dataset.layout=o?.layout||"";let M=[],f=new Map,g=(p,r)=>{let h=z?a.get(p):null,m=h?.tagName.toLowerCase()===r?h:document.createElement(r);return f.set(p,m),M.push(m),m};if(o){if(o.nodes.some(p=>p.gesture)){let p=o.nodes.find(h=>h.gesture&&h.kind==="button"),r=g("gesture","p");r.className="gesture-note",r.textContent=p?.text==="\u5F00\u59CB\u6559\u5B66"?"\u8BF7\u56DE\u5230 DSH\uFF0C\u70B9\u51FB\u201C\u5F00\u59CB\u6559\u5B66\u201D\u3002":"\u8BF7\u56DE\u5230 DSH\uFF0C\u70B9\u51FB\u201C\u542F\u52A8\u97F3\u9891\u64AD\u653E\u201D\u3002"}for(let[p,r]of o.nodes.entries()){let h=r.kind==="break"?"br":r.kind==="heading"?"h3":r.kind==="button"?"button":r.kind==="checkbox"?"input":"span",m=g(r.action||"node"+p,h);if(r.taskState?m.dataset.taskState=r.taskState:delete m.dataset.taskState,m.textContent!==r.text&&(m.textContent=r.text),r.kind==="checkbox"&&(m.type="checkbox",m.checked=r.checked),r.kind==="button"||r.kind==="checkbox"){m.dataset.surfaceAction=r.action,r.kind==="button"&&(m.type="button"),m.disabled=r.disabled||r.gesture,r.label?m.setAttribute("aria-label",r.label):m.removeAttribute("aria-label");let w=()=>{l!==o||m.disabled||t({type:"surface_action",id:o.id,revision:o.revision,action:r.action,checked:m.checked===!0})};r.kind==="checkbox"?m.onchange=w:m.onclick=w}}}for(M.forEach((p,r)=>{e.children[r]!==p&&e.insertBefore(p,e.children[r]||null)});e.children.length>M.length;)e.lastElementChild.remove();if(a=f,v){let p=a.get(v);p&&!p.disabled&&document.activeElement!==p&&p.focus({preventScroll:!0})}e.scrollTop=k,i(!!o,o?.target)}}}var He="avatar_local_v1";var it=["open_dsh","pending","settings","tutorial","hide","notifications","size","bubble","view","dismiss"],_e=["small","medium","large"],at=["completed","failed","stopped","approval","question","plan_review"];var me=(e,t)=>typeof e=="string"?e.slice(0,t):"";function Ue(e){if(e?.type!=="menu_action"||!it.includes(e.action)||!/^[a-zA-Z0-9-]{1,64}$/.test(e.request_id||""))throw Error("invalid_avatar_menu_action");let t={type:"menu_action",request_id:e.request_id,action:e.action};if(["size","bubble"].includes(e.action)){if(!_e.includes(e.value))throw Error("invalid_avatar_size");t.value=e.value}if(["view","dismiss"].includes(e.action)){if(typeof e.id!="string"||!e.id||e.id.length>512)throw Error("invalid_avatar_notice");t.id=e.id}if(e.action==="notifications"){if(typeof e.value!="boolean")throw Error("invalid_avatar_preference");t.value=e.value}if(e.action==="snooze"){if(![0,30].includes(e.value))throw Error("invalid_avatar_snooze");t.value=e.value}return t}function Pe(e){if(e?.type!=="local_state"||e.protocol!==He||!Number.isSafeInteger(e.revision)||e.revision<0||!Array.isArray(e.items)||e.items.length>32)throw Error("invalid_avatar_local_state");let t=e.items.map(i=>{if(!at.includes(i.status)||!i.id||typeof i.id!="string"||i.id.length>512)throw Error("invalid_avatar_notice");return{id:i.id,session_id:me(i.session_id,256),name:me(i.name,100),status:i.status,summary:me(i.summary,240),pending:i.pending===!0,unread:i.unread===!0}});for(;JSON.stringify(t).length>12e3;)t.pop();return{type:"local_state",protocol:He,revision:e.revision,items:t,size:_e.includes(e.size)?e.size:"large",bubble:_e.includes(e.bubble)?e.bubble:"medium",enabled:e.enabled!==!1,snoozed:e.snoozed===!0,running:Math.max(0,Math.min(1e4,Number(e.running)||0)),available:e.available===!0,toast:t.some(i=>i.id===e.toast)?e.toast:null}}function Ve(e){if(e?.type!=="menu_result"||!/^[a-zA-Z0-9-]{1,64}$/.test(e.request_id||""))throw Error("invalid_avatar_menu_result");return{type:"menu_result",request_id:e.request_id,ok:e.ok===!0,message:me(e.message,180)}}var je={completed:"\u672C\u8F6E\u5DF2\u5B8C\u6210",failed:"\u6267\u884C\u5931\u8D25",stopped:"\u5DF2\u505C\u6B62",approval:"\u7B49\u5F85\u6388\u6743",question:"\u7B49\u5F85\u56DE\u7B54",plan_review:"\u7B49\u5F85\u65B9\u6848\u786E\u8BA4"},Fe={small:"\u7D27\u51D1",medium:"\u6807\u51C6",large:"\u5BBD\u677E"},ot="border:0;border-radius:12px;background:#dcefff;color:#185a89;font:12px system-ui;padding:4px 7px;cursor:pointer;pointer-events:auto",ke={open:"M14 3h7v7m0-7L10 14M10 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-5",pending:"M8 4h8m-9 0H5v17h14V4h-2M8 3h8v4H8zM8 12h8m-8 4h5",bubble:"M5 4h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H9l-5 3v-3H3V6a2 2 0 0 1 2-2zM7 9h10m-10 4h6",tutorial:"m9 5 10 7-10 7z",settings:"M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8M9 3h6l1 3 3 1 2 5-2 5-3 1-1 3H9l-1-3-3-1-2-5 2-5 3-1z",hide:"m4 4 16 16M9 5a11 11 0 0 1 12 7l-3 4M6 6a13 13 0 0 0-5 6s4 7 11 7l3-1M10 10a3 3 0 0 0 4 4",back:"m14 5-7 7 7 7"},st=e=>{let t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("aria-hidden","true"),t.innerHTML=`<path d="${ke[e]||ke.pending}"/>`,t};function Ye({anchor:e,viewport:t=()=>[0,0,innerWidth,innerHeight],send:i,changed:l=()=>{}}){let n={items:[],running:0,enabled:!0,size:"large",bubble:"medium"},a,d,o,_="main",v,k=!1,z,M,f,g,p=document.createElement("style");p.textContent=`
|
|
2
2
|
.duet-pet-menu{position:fixed;z-index:2147483601;box-sizing:border-box;width:264px;max-width:calc(100vw - 24px);padding:9px;border:1px solid #a7c5dc30;border-radius:18px;background:#142330f7;color:#eaf2f8;font:13px/1.5 Inter,"PingFang SC",sans-serif;box-shadow:0 16px 48px #0004,0 2px 8px #0002;backdrop-filter:blur(20px);pointer-events:auto;overflow:auto}
|
|
3
3
|
.duet-pet-menu button{position:relative;display:flex;align-items:center;justify-content:flex-start;gap:10px;box-sizing:border-box;width:100%;min-height:39px;margin:0;border:0;border-radius:10px;padding:8px 11px;background:transparent;color:inherit;text-align:left;font:inherit;cursor:pointer;height:auto;flex-shrink:0;letter-spacing:normal}
|
|
4
4
|
.duet-pet-menu button>[data-label]{min-width:0;flex:1;overflow-wrap:anywhere}
|
|
@@ -12,7 +12,7 @@ import{mountAvatarRenderer as st}from"./renderer.mjs";var ve=Object.freeze({larg
|
|
|
12
12
|
.duet-pet-menu [data-switch]:after{content:'';position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:white;transition:transform .15s}.duet-pet-menu [aria-checked=true] [data-switch]{background:#6eabc9}.duet-pet-menu [aria-checked=true] [data-switch]:after{transform:translateX(12px)}
|
|
13
13
|
.duet-pet-menu [data-bubble-preview]{margin:12px 9px;padding:12px 14px;border-radius:15px 15px 15px 4px;border:1px solid #8dc5ed45;background:#213b4c;white-space:pre-wrap;overflow:auto;line-height:1.7;scrollbar-width:thin}
|
|
14
14
|
.duet-pet-menu p{margin:10px 12px;color:#a7bdd0}.duet-pet-menu [data-notice-title]{padding:8px 11px;font-weight:600}
|
|
15
|
-
`,document.head.append(p);let r=s=>{let[
|
|
15
|
+
`,document.head.append(p);let r=s=>{let[u,E,x,y]=t();s.style.maxHeight=Math.max(40,y-24)+"px",s.style.maxWidth=Math.max(40,x-24)+"px";let T=e().getBoundingClientRect(),$=s.getBoundingClientRect(),q=z?.y??(T.top-$.height-12>=E?T.top-$.height-12:T.bottom+12);s.style.left=Math.max(u+12,Math.min(z?.x??T.left,u+x-$.width-12))+"px",s.style.top=Math.max(E+12,Math.min(q,E+y-$.height-12))+"px"},h=()=>{a?.remove(),a=null,z=null,M?.isConnected&&M.focus({preventScroll:!0}),l()},m=(s,u,E)=>i(Ue({type:"menu_action",request_id:crypto.randomUUID(),action:s,value:u,id:E})),w=(s,u,E=u,x)=>{let y=document.createElement("button");y.type="button",y.setAttribute("role","menuitem"),y.dataset.menuAction=u,ke[E]&&y.append(st(E));let T=document.createElement("span");return T.dataset.label="",T.textContent=s,y.append(T),y.onclick=()=>{if(["pending","bubble_panel","back"].includes(u)){_=u==="back"?"main":u,R();return}h(),m(u,void 0,x)},y},N=()=>n.items.filter(s=>s.unread).length,V=()=>{let s=N();return"\u5F85\u5904\u7406\u4E8B\u9879\u4E0E\u901A\u77E5"+(s?`\uFF08${s}\uFF09`:"")},H=s=>{let u=document.createElement("span");return u.dataset.value="",s.append(u),u},C=()=>{if(!a)return;let s=a.querySelector("[data-menu-action=size]");if(s){let T=s.querySelector("[data-size-icon]");re(T,n.size),s.querySelector("[data-value]").textContent={large:"\u5927",medium:"\u4E2D",small:"\u5C0F"}[n.size],s.setAttribute("aria-label",T.getAttribute("aria-label"))}a.querySelector("[data-menu-action=notifications]")?.setAttribute("aria-checked",String(n.enabled));let E=a.querySelector("[data-menu-action=bubble]");E&&(E.querySelector("[data-value]").textContent=Fe[n.bubble],E.setAttribute("aria-label",`\u6C14\u6CE1\u5927\u5C0F\uFF1A${Fe[n.bubble]}\uFF0C\u70B9\u51FB\u5207\u6362`));let x=a.querySelector("[data-bubble-preview]");x&&(x.style.maxHeight={small:60,medium:110,large:180}[n.bubble]+"px",x.dataset.size=n.bubble);let y=a.querySelector("[data-menu-action=pending] span");y&&(y.textContent=V()),r(a),l()},R=()=>{if(!a)return;a.replaceChildren();let s=document.createElement("div");s.dataset.wordmark="",s.append("duet");let u=document.createElement("span");u.textContent=".",s.append(u),a.append(s);let E=()=>a.append(document.createElement("hr"));if(_==="main"){a.append(w("\u6253\u5F00 DSH","open_dsh","open"),w(V(),"pending"));let x=w("\u4EFB\u52A1\u901A\u77E5","notifications","pending");x.setAttribute("role","menuitemcheckbox");let y=document.createElement("span");y.dataset.switch="",x.append(y),x.onclick=()=>{n.enabled=!n.enabled,C(),m("notifications",n.enabled)},a.append(x),E();let T=w("\u5F62\u8C61\u5927\u5C0F","size"),$=document.createElement("span");$.dataset.sizeIcon="",T.prepend($),H(T),T.onclick=()=>{n.size=se(n.size),C(),m("size",n.size)},a.append(T,w("\u6C14\u6CE1\u5927\u5C0F","bubble_panel","bubble")),E(),a.append(w("\u4F7F\u7528\u6559\u5B66","tutorial"),w("duet \u8BBE\u7F6E","settings"),w("\u9690\u85CF\u5F62\u8C61","hide"))}else if(_==="bubble_panel"){let x=w("\u6C14\u6CE1\u5927\u5C0F","bubble","bubble");H(x),x.onclick=()=>{n.bubble={small:"medium",medium:"large",large:"small"}[n.bubble],C(),m("bubble",n.bubble)},a.append(x);let y=document.createElement("div");y.dataset.bubblePreview="",y.setAttribute("aria-label","\u793A\u4F8B\u6C14\u6CE1"),y.textContent=`\u597D\u7684\uFF0C\u6211\u6765\u5E2E\u4F60\u3002
|
|
16
16
|
\u4EFB\u52A1\u5B8C\u6210\u540E\uFF0C\u6211\u4F1A\u5728\u8FD9\u91CC\u544A\u8BC9\u4F60\u7ED3\u679C\u3002
|
|
17
17
|
\u4E5F\u53EF\u4EE5\u968F\u65F6\u6253\u65AD\u6211\uFF0C\u7EE7\u7EED\u804A\u804A\u4F60\u7684\u65B0\u60F3\u6CD5\u3002
|
|
18
|
-
\u8FD9\u662F\u4E00\u6BB5\u8F83\u957F\u7684\u6587\u5B57\uFF0C\u4F60\u53EF\u4EE5\u770B\u770B\u5F53\u524D\u6C14\u6CE1\u80FD\u663E\u793A\u591A\u5C11\u5185\u5BB9\u3002`,a.append(y,w("\u8FD4\u56DE","back"))}else{if(!n.available){let x=document.createElement("p");x.textContent="\u6B63\u5728\u8FDE\u63A5 DSH",a.append(x)}if(!n.items.length){let x=document.createElement("p");x.textContent="\u6682\u65F6\u6CA1\u6709\u5F85\u5904\u7406\u4E8B\u9879\u6216\u65B0\u901A\u77E5",a.append(x)}for(let x of n.items){let y=w(`${x.unread?"\u25CF ":""}${x.name||"\u672A\u547D\u540D\u4F1A\u8BDD"} \xB7 ${je[x.status]}`,"view","pending",x.id);y.title=x.summary,a.append(y)}a.append(w("\u8FD4\u56DE","back"))}B(),a.querySelector("button")?.focus({preventScroll:!0})},R=(s,c="main")=>{k||(s?.preventDefault(),s?.stopPropagation(),h(),T=document.activeElement,_=c,S=s&&Number.isFinite(s.clientX)&&s.clientX>0?{x:s.clientX,y:s.clientY}:null,a=document.createElement("div"),a.className="duet-pet-menu",a.dataset.duetContextMenu="",a.setAttribute("role","menu"),a.setAttribute("aria-label","duet \u5F62\u8C61\u83DC\u5355"),document.body.append(a),M())},V=s=>{a&&!a.contains(s.target)&&(s.preventDefault(),s.stopPropagation(),h())},b=s=>{if(!a)return;if(s.key==="Escape"){s.preventDefault(),s.stopImmediatePropagation(),h();return}let c=[...a.querySelectorAll("button")],E=c.indexOf(document.activeElement);["ArrowDown","ArrowUp","Home","End","Tab"].includes(s.key)&&(s.preventDefault(),c[s.key==="Home"?0:s.key==="End"?c.length-1:(E+(s.key==="ArrowUp"||s.key==="Tab"&&s.shiftKey?-1:1)+c.length)%c.length]?.focus())},A=(s,c)=>{s.className="duet-pet-menu",s.setAttribute("aria-label",c)},ne=s=>{n=Pe(s),o??=document.createElement("button"),o.type="button",o.dataset.duetNoticeBadge="",o.style.cssText="position:fixed;z-index:2147483600;border:0;border-radius:12px;background:#dcefff;color:#185a89;font:12px system-ui;padding:4px 7px;cursor:pointer;pointer-events:auto";let c=n.items.filter(I=>I.pending||I.unread).length;o.textContent=c?String(c):"",o.setAttribute("aria-label",N()),o.hidden=!c||!n.enabled,o.onclick=I=>R(I,"pending"),o.isConnected||document.body.append(o);let E=e().getBoundingClientRect(),[x,y,C,L]=t();if(o.style.left=Math.max(x+12,Math.min((E.right??E.left+E.width)-24,x+C-36))+"px",o.style.top=Math.max(y+12,Math.min(E.top,y+L-30))+"px",f!==n.toast){clearTimeout(v),clearTimeout(g),d?.remove(),d=null,f=n.toast;let I=n.items.find(oe=>oe.id===n.toast);if(I){d=document.createElement("section"),d.dataset.duetLocalNotice="",A(d,"DSH \u4EFB\u52A1\u901A\u77E5");let oe=document.createElement("div");oe.dataset.noticeTitle="",oe.textContent=`${I.name||"\u672A\u547D\u540D\u4F1A\u8BDD"} \xB7 ${je[I.status]}`,d.append(oe,w(I.pending?"\u53BB\u5904\u7406":"\u67E5\u770B","view","open",I.id),w("\u6536\u8D77","dismiss","hide",I.id)),document.body.append(d),r(d),I.pending||(v=setTimeout(()=>{d?.remove(),d=null,l()},8e3))}}B(),l()},ye=s=>{let c=Ve(s);c.message&&(clearTimeout(g),d?.remove(),d=document.createElement("section"),A(d,"\u64CD\u4F5C\u63D0\u793A"),d.textContent=c.message,document.body.append(d),r(d),l(),g=setTimeout(()=>{d?.remove(),d=null,l()},4e3))},Ie=()=>{a&&r(a),d&&r(d)};return document.addEventListener("pointerdown",V,!0),document.addEventListener("keydown",b,!0),window.addEventListener("resize",Ie),window.addEventListener("blur",h),{open:R,close:h,update:ne,result:ye,get active(){return!!a},regions(){return[a,d,o].filter(s=>s?.isConnected&&!s.hidden).map(s=>{let c=s.getBoundingClientRect();return[c.x,c.y,c.width,c.height]})},dispose(){k=!0,h(),p.remove(),clearTimeout(v),clearTimeout(g),d?.remove(),o?.remove(),document.removeEventListener("pointerdown",V,!0),document.removeEventListener("keydown",b,!0),window.removeEventListener("resize",Ie),window.removeEventListener("blur",h)}}}var F=(e,t,i)=>Number.isFinite(e)&&e>=t&&e<=i,Ae=e=>e&&F(e.width,1,1e6)&&F(e.height,1,1e6)?{width:e.width,height:e.height}:null;function We(e){if(!e||!["desktop_physical","viewport_css"].includes(e.space))return null;let t=Ae(e.total_resolution),i=e.avatar_position;if(!t||!i||!F(i.x,-1e6,1e6)||!F(i.y,-1e6,1e6)||!Ae(i))return null;let l={space:e.space,total_resolution:t,avatar_position:{x:i.x,y:i.y,width:i.width,height:i.height}};if(e.space==="desktop_physical"){if(!e.desktop_origin||!F(e.desktop_origin.x,-1e6,1e6)||!F(e.desktop_origin.y,-1e6,1e6)||!F(e.scale,.25,16))return null;l.desktop_origin={x:e.desktop_origin.x,y:e.desktop_origin.y},l.scale=e.scale}else{let n=Ae(e.viewport_resolution);if(!n)return null;l.viewport_resolution=n}return l}var ie=window.__DUET_AVATAR__,U=(e,t)=>window.__TAURI__.core.invoke(e,t);if(!ie||!/^ws:\/\/127\.0\.0\.1:\d+\/?$/.test(ie.url)||!/^[a-f0-9]{64}$/.test(ie.token))throw Error("companion must be started by duet");var u=e=>document.getElementById(e),H=new WebSocket(ie.url,[`duet-avatar-${ie.token}`]),xe=!1,X=!1,$=!1,Y=Date.now(),G,be,W=null,Ee=!1,J=null,fe=null,K=j(ie.size),ce=!1,Se=null,O,Ke="medium",Je,z={mode:"off",ready:!1,rms:0,viseme:"A",text:"",utterance:""},de=null,Ce=[],Ge,Ze,ge=null,ze=!1,Xe="";async function rt(){if(!(!xe||$||ze)){ze=!0;try{let e=await U("avatar_geometry"),t=u("avatar").getBoundingClientRect(),i=e.scale,l=We({space:"desktop_physical",total_resolution:e.total_resolution,desktop_origin:e.desktop_origin,scale:i,avatar_position:{x:e.window_origin.x+t.x*i,y:e.window_origin.y+t.y*i,width:t.width*i,height:t.height*i}}),n=JSON.stringify(l);l&&n!==Xe&&(Xe=n,q({type:"avatar_geometry",position:l}))}catch{}finally{ze=!1}}}var Re=()=>{if(!ge)return[0,0,innerWidth,innerHeight];let[e,t,i,l]=ge,n=Math.max(0,e),a=Math.max(0,t);return[n,a,Math.max(1,Math.min(innerWidth,e+i)-n),Math.max(1,Math.min(innerHeight,t+l)-a)]},Q=$e({tools:u("tools"),avatar:u("avatar"),hitTest:(e,t)=>Be(Ce,le(u("avatar")),e,t),onChange:()=>{ee()}}),Qe={getBoundingClientRect(){let e=u("avatar").getBoundingClientRect(),t=u("tools").getBoundingClientRect();return{left:e.left,width:e.width,top:e.top,bottom:Math.max(e.bottom,t.bottom)}}},Z=Ne({floating:!0,origin:"avatar",anchor:()=>Qe,viewport:Re,onChange:()=>Q.setConfirmation(ce||!!Z.element||O?.active)}),lt=De(u("surface"),{send:e=>q(e),changed:(e,t)=>{ce=e,e||(Se=null),Q.setConfirmation(e||!!Z.element||O?.active);for(let i of document.querySelectorAll("[data-mode]"))i.toggleAttribute("data-teaching",i.dataset.mode===t);ae(),ee()}});O=Ye({anchor:()=>Qe,viewport:Re,send:async e=>{if(e.action==="hide")u("close").click();else{if(["open_dsh","view","settings"].includes(e.action))try{await U("focus_dsh")}catch{O.result({type:"menu_result",request_id:e.request_id,ok:!1,message:"\u672A\u80FD\u5524\u8D77 DSH\uFF0C\u8BF7\u786E\u8BA4\u6240\u5C5E\u7A97\u53E3\u4ECD\u7136\u6253\u5F00\uFF1B\u82E5\u521A\u66F4\u65B0\u63D2\u4EF6\uFF0C\u8BF7\u66F4\u65B0\u684C\u9762\u5F62\u8C61\u3002"});return}q(e)}},changed:()=>{Q.setConfirmation(ce||!!Z.element||O.active),ee()}});var dt=Promise.all([window.__TAURI__.event.listen("avatar-pointer",e=>Q.pointer(e.payload)).then(e=>{$?e():Ge=e}),window.__TAURI__.event.listen("avatar-viewport",e=>{!Array.isArray(e.payload)||e.payload.length!==4||!e.payload.every(Number.isFinite)||ge?.every((t,i)=>t===e.payload[i])||(ge=e.payload,ae(),window.dispatchEvent(new Event("resize")),ee())}).then(e=>{$?e():Ze=e})]).catch(()=>{X=!0,q({type:"failed"}),P()});re(u("size"),K);var q=e=>{H.readyState===1&&H.bufferedAmount<16e3&&H.send(JSON.stringify(e))};function ae(){let e=u("bubble"),t=u("surface"),i=[e,t].filter(M=>!M.hidden);if(!i.length)return;let[l,n,a,d]=Re(),o=u("avatar").getBoundingClientRect(),_=u("tools").getBoundingClientRect(),v=o.width/u("avatar").offsetWidth||1,k=12*v;e.style.width="256px",e.style.right="auto";for(let M of i)M.style.maxHeight=Math.max(1,d-24)/v+"px";let S=e.hidden?0:Math.min({small:90,medium:180,large:260}[Ke]*v,e.getBoundingClientRect().height),T=t.hidden?0:Math.min(256*v,t.getBoundingClientRect().height),f=i.length>1?k:0,g=S+T+f,p=Math.max(0,o.top-k-(n+12)),r=Math.max(0,n+d-12-(_.bottom+k)),h=ce?Se:null;(!h||(h==="above"?p:r)<Math.min(g,80*v))&&(h=p>=g?"above":r>=g?"below":p>=r?"above":"below"),ce&&(Se=h);let m=h==="above"?p:r,w=t.hidden?m:Math.min(S,Math.max(0,(m-f)*.3)),N=Math.min(S,w),te=Math.min(T,Math.max(0,m-N-f));e.hidden||(e.style.maxHeight=Math.max(1,N/v)+"px"),t.hidden||(t.style.maxHeight=Math.max(1,te/v)+"px");let B=h==="above"?o.top-k:_.bottom+k;for(let M of i){let R=M.getBoundingClientRect(),V=M.offsetParent.getBoundingClientRect(),b=Math.max(l+12,Math.min(o.left+o.width/2-R.width/2,l+a-12-R.width)),A=h==="above"?B-R.height:B;M.style.left=(b-V.left)/v+"px",M.style.top=(A-V.top)/v+"px",M.style.bottom="auto",M.style.right="auto",B=h==="above"?A-k:A+R.height+k}e.hidden||(e.scrollTop=e.scrollHeight)}var Te=()=>{let e=de?.text||z.text,t=u("bubble").hidden===!!e||u("text").textContent!==e;u("bubble").hidden=!e,u("bubble").dataset.input=String(!!de),u("keyboard").toggleAttribute("hidden",!de),u("text").textContent!==e&&(u("text").textContent=e),t&&ae()},he=()=>{clearTimeout(be),de=null,Te()},ct=()=>{for(let t of document.querySelectorAll("[data-mode]")){let i=z.mode===t.dataset.mode;t.disabled=!1,t.setAttribute("aria-pressed",String(i)),t.setAttribute("aria-busy",String(i&&!z.ready)),t.querySelector("[data-connecting-ring]").hidden=!(i&&!z.ready),t.setAttribute("aria-label",`${i?"\u5173\u95ED":"\u6253\u5F00"}${t.dataset.mode==="online"?"\u4EA4\u4E92\u6A21\u5F0F":"\u64AD\u62A5\u6A21\u5F0F"}`),t.title=i&&!z.ready?`\u6B63\u5728\u8FDE\u63A5${t.dataset.mode==="online"?"\u4EA4\u4E92\u6A21\u5F0F":"\u64AD\u62A5\u6A21\u5F0F"}`:t.getAttribute("aria-label")}u("dot").style.color=z.ready?"#7fd6a6":"#ed9b35";let e=z.mode==="off"?"\u8BED\u97F3\u672A\u5F00\u542F":z.ready?z.mode==="online"?"\u4EA4\u4E92\u6A21\u5F0F":"\u64AD\u62A5\u6A21\u5F0F":"\u6B63\u5728\u8FDE\u63A5\u2026";u("status").textContent!==e&&(u("status").textContent=e)},P=()=>{$||($=!0,O.dispose(),Z.dispose(),Q.dispose(),Ge?.(),Ze?.(),clearInterval(ut),clearInterval(pt),clearTimeout(be),G?.update({...z,rms:0,text:""}),G?.dispose(),H.close(),U("hide_avatar").catch(()=>{}))},Me=()=>{X?q({type:"failed"}):xe&&q({type:"ready",protocol:2})},et=e=>(K=j(e),J||K===fe?J||Promise.resolve():(J=(async()=>{for(await W;!$&&K!==fe;){let t=K,i=!0,l=await U("set_avatar_size",{size:t,panel:i});if(!l||!Number.isFinite(l.scale)||l.scale<=0||l.scale>1)throw Error("invalid_avatar_layout");u("shell").style.transform=`scale(${l.fit??1})`,u("shell").dataset.panel=String(i),u("stage").dataset.size=t,u("stage").style.setProperty("--scale",l.scale),re(u("size"),t),fe=t,Q.refresh(),ae()}})().catch(()=>{X=!0,q({type:"failed"}),P()}).finally(()=>{J=null}),J));try{G=st(u("avatar"),{modelURL:"./character.glb",onReady(){Promise.all([dt,et(K)]).then(async()=>{if(!($||X)&&(xe=!0,await ee(),!$))return Me(),U("show_avatar")}).catch(()=>{X=!0,q({type:"failed"}),P()})},onError(){X=!0,Me()}})}catch{X=!0}H.onopen=Me;var tt=new ue(1e3);H.onmessage=e=>{tt.touch();try{let t=JSON.parse(e.data);if(t.type==="frame")z=Oe(t),Y=Date.now(),G?.update(z),et(z.size),z.mode==="off"&&he(),Te(),ct();else if(t.type==="input_effect")de=qe(t),Y=Date.now(),clearTimeout(be),Te(),be=setTimeout(he,1600);else if(t.type==="clear_input_effect")he();else if(t.type==="surface")lt.update(t),Y=Date.now();else if(t.type==="local_state")O.update(t),Ke=t.bubble,ae(),Y=Date.now(),t.toast&&t.toast!==Je&&z.mode==="off"&&t.items.find(i=>i.id===t.toast)?.status==="completed"&&G?.update({...z,text:"\u5B8C\u6210\u4E86",utterance:"notice-"+t.toast}),Je=t.toast;else if(t.type==="menu_result")O.result(t),Y=Date.now();else if(t.type==="owner_focus")U("remember_dsh").catch(()=>{}),Y=Date.now();else if(t.type!=="alive")throw Error("invalid_avatar_message")}catch{H.close(1008,"invalid_avatar_message")}};H.onclose=P;H.onerror=P;var ut=setInterval(()=>{if(tt.expired()){P();return}Date.now()-Y>1500&&(G?.update({...z,rms:0,text:""}),z={...z,text:""},he()),q({type:"alive"}),rt()},1e3),le=e=>{let t=e.getBoundingClientRect();return[t.x,t.y,t.width,t.height]};function ee(){if(!(!xe||J||$||document.hidden))return W?(Ee=!0,W):(W=(async()=>{do{if(Ee=!1,$||J||document.hidden)break;let e=Z.element?[le(Z.element)]:O.active?[[0,0,innerWidth,innerHeight]]:[...Q.regions(),...u("bubble").hidden?[]:[le(u("bubble"))],...u("surface").hidden?[]:[le(u("surface"))],...O.regions()];Ce=G.hitMask(),await U("avatar_hit_mask",{mask:Ce,avatar:le(u("avatar")),regions:e})}while(Ee)})().catch(()=>{}).finally(()=>{W=null}),W)}var pt=setInterval(()=>{W||ee()},350);for(let e of document.querySelectorAll("[data-mode]")){let t=document.createElement("span");t.dataset.connectingRing="",t.hidden=!0,t.innerHTML='<svg viewBox="0 0 30 30" preserveAspectRatio="none" aria-hidden="true"><rect x="1" y="1" width="28" height="28" rx="7" pathLength="100"/></svg>',e.append(t),e.onclick=()=>q({type:"mode",mode:e.dataset.mode})}u("close").onclick=async()=>{await Z.ask()&&!$&&(q({type:"hide"}),P())};u("size").onclick=()=>q({type:"size",size:se(fe||K)});var D=null;u("avatar").tabIndex=0;u("avatar").oncontextmenu=e=>{D=null,O.open(e)};u("avatar").onkeydown=e=>{(e.key==="ContextMenu"||e.key==="F10"&&e.shiftKey)&&(D=null,O.open(e))};u("avatar").onpointerdown=e=>{e.button===0&&!e.ctrlKey&&!O.active&&(D={x:e.clientX,y:e.clientY})};u("avatar").onpointermove=e=>{D&&!O.active&&e.buttons===1&&Math.hypot(e.clientX-D.x,e.clientY-D.y)>4&&(D=null,U("drag_avatar").catch(()=>{}))};window.addEventListener("pointerup",()=>{D=null});window.addEventListener("blur",()=>{D=null});window.addEventListener("resize",()=>{ae(),ee()});window.addEventListener("pagehide",P,{once:!0});
|
|
18
|
+
\u8FD9\u662F\u4E00\u6BB5\u8F83\u957F\u7684\u6587\u5B57\uFF0C\u4F60\u53EF\u4EE5\u770B\u770B\u5F53\u524D\u6C14\u6CE1\u80FD\u663E\u793A\u591A\u5C11\u5185\u5BB9\u3002`,a.append(y,w("\u8FD4\u56DE","back"))}else{if(!n.available){let x=document.createElement("p");x.textContent="\u6B63\u5728\u8FDE\u63A5 DSH",a.append(x)}if(!n.items.length){let x=document.createElement("p");x.textContent="\u6682\u65F6\u6CA1\u6709\u5F85\u5904\u7406\u4E8B\u9879\u6216\u65B0\u901A\u77E5",a.append(x)}for(let x of n.items){let y=w(`${x.unread?"\u25CF ":""}${x.name||"\u672A\u547D\u540D\u4F1A\u8BDD"} \xB7 ${je[x.status]}`,"view","pending",x.id);y.title=x.summary,a.append(y)}a.append(w("\u8FD4\u56DE","back"))}C(),a.querySelector("button")?.focus({preventScroll:!0})},j=(s,u="main")=>{k||(s?.preventDefault(),s?.stopPropagation(),h(),M=document.activeElement,_=u,z=s&&Number.isFinite(s.clientX)&&s.clientX>0?{x:s.clientX,y:s.clientY}:null,a=document.createElement("div"),a.className="duet-pet-menu",a.dataset.duetContextMenu="",a.setAttribute("role","menu"),a.setAttribute("aria-label","duet \u5F62\u8C61\u83DC\u5355"),document.body.append(a),R())},b=s=>{a&&!a.contains(s.target)&&(s.preventDefault(),s.stopPropagation(),h())},A=s=>{if(!a)return;if(s.key==="Escape"){s.preventDefault(),s.stopImmediatePropagation(),h();return}let u=[...a.querySelectorAll("button")],E=u.indexOf(document.activeElement);["ArrowDown","ArrowUp","Home","End","Tab"].includes(s.key)&&(s.preventDefault(),u[s.key==="Home"?0:s.key==="End"?u.length-1:(E+(s.key==="ArrowUp"||s.key==="Tab"&&s.shiftKey?-1:1)+u.length)%u.length]?.focus())},F=(s,u)=>{s.className="duet-pet-menu",s.setAttribute("aria-label",u)},ye=s=>{n=Pe(s),o??=document.createElement("button"),o.type="button",o.dataset.duetNoticeBadge="",o.style.cssText="position:fixed;z-index:2147483600;"+ot;let u=N();o.textContent=u?String(u):"",o.setAttribute("aria-label",V()),o.hidden=!u||!n.enabled,o.onclick=q=>j(q,"pending"),o.isConnected||document.body.append(o);let E=e().getBoundingClientRect(),[x,y,T,$]=t();if(o.style.left=Math.max(x+12,Math.min((E.right??E.left+E.width)-24,x+T-36))+"px",o.style.top=Math.max(y+12,Math.min(E.top,y+$-30))+"px",f!==n.toast){clearTimeout(v),clearTimeout(g),d?.remove(),d=null,f=n.toast;let q=n.items.find(oe=>oe.id===n.toast);if(q){d=document.createElement("section"),d.dataset.duetLocalNotice="",F(d,"DSH \u4EFB\u52A1\u901A\u77E5");let oe=document.createElement("div");oe.dataset.noticeTitle="",oe.textContent=`${q.name||"\u672A\u547D\u540D\u4F1A\u8BDD"} \xB7 ${je[q.status]}`,d.append(oe,w(q.pending?"\u53BB\u5904\u7406":"\u67E5\u770B","view","open",q.id),w("\u6536\u8D77","dismiss","hide",q.id)),document.body.append(d),r(d),q.pending||(v=setTimeout(()=>{d?.remove(),d=null,l()},8e3))}}C(),l()},nt=s=>{let u=Ve(s);u.message&&(clearTimeout(g),d?.remove(),d=document.createElement("section"),F(d,"\u64CD\u4F5C\u63D0\u793A"),d.textContent=u.message,document.body.append(d),r(d),l(),g=setTimeout(()=>{d?.remove(),d=null,l()},4e3))},Ie=()=>{a&&r(a),d&&r(d)};return document.addEventListener("pointerdown",b,!0),document.addEventListener("keydown",A,!0),window.addEventListener("resize",Ie),window.addEventListener("blur",h),{open:j,close:h,update:ye,result:nt,get active(){return!!a},regions(){return[a,d,o].filter(s=>s?.isConnected&&!s.hidden).map(s=>{let u=s.getBoundingClientRect();return[u.x,u.y,u.width,u.height]})},dispose(){k=!0,h(),p.remove(),clearTimeout(v),clearTimeout(g),d?.remove(),o?.remove(),document.removeEventListener("pointerdown",b,!0),document.removeEventListener("keydown",A,!0),window.removeEventListener("resize",Ie),window.removeEventListener("blur",h)}}}var W=(e,t,i)=>Number.isFinite(e)&&e>=t&&e<=i,Ae=e=>e&&W(e.width,1,1e6)&&W(e.height,1,1e6)?{width:e.width,height:e.height}:null;function We(e){if(!e||!["desktop_physical","viewport_css"].includes(e.space))return null;let t=Ae(e.total_resolution),i=e.avatar_position;if(!t||!i||!W(i.x,-1e6,1e6)||!W(i.y,-1e6,1e6)||!Ae(i))return null;let l={space:e.space,total_resolution:t,avatar_position:{x:i.x,y:i.y,width:i.width,height:i.height}};if(e.space==="desktop_physical"){if(!e.desktop_origin||!W(e.desktop_origin.x,-1e6,1e6)||!W(e.desktop_origin.y,-1e6,1e6)||!W(e.scale,.25,16))return null;l.desktop_origin={x:e.desktop_origin.x,y:e.desktop_origin.y},l.scale=e.scale}else{let n=Ae(e.viewport_resolution);if(!n)return null;l.viewport_resolution=n}return l}var ie=window.__DUET_AVATAR__,U=(e,t)=>window.__TAURI__.core.invoke(e,t);if(!ie||!/^ws:\/\/127\.0\.0\.1:\d+\/?$/.test(ie.url)||!/^[a-f0-9]{64}$/.test(ie.token))throw Error("companion must be started by duet");var c=e=>document.getElementById(e),D=new WebSocket(ie.url,[`duet-avatar-${ie.token}`]),xe=!1,G=!1,B=!1,J=Date.now(),Q,be,X=null,Ee=!1,K=null,fe=null,Z=Y(ie.size),ce=!1,ze=null,I,Ke="medium",Je,S={mode:"off",ready:!1,rms:0,viseme:"A",text:"",utterance:""},de=null,Ce=[],Ge,Ze,ge=null,Se=!1,Xe="";async function dt(){if(!(!xe||B||Se)){Se=!0;try{let e=await U("avatar_geometry"),t=c("avatar").getBoundingClientRect(),i=e.scale,l=We({space:"desktop_physical",total_resolution:e.total_resolution,desktop_origin:e.desktop_origin,scale:i,avatar_position:{x:e.window_origin.x+t.x*i,y:e.window_origin.y+t.y*i,width:t.width*i,height:t.height*i}}),n=JSON.stringify(l);l&&n!==Xe&&(Xe=n,O({type:"avatar_geometry",position:l}))}catch{}finally{Se=!1}}}var Re=()=>{if(!ge)return[0,0,innerWidth,innerHeight];let[e,t,i,l]=ge,n=Math.max(0,e),a=Math.max(0,t);return[n,a,Math.max(1,Math.min(innerWidth,e+i)-n),Math.max(1,Math.min(innerHeight,t+l)-a)]},te=$e({tools:c("tools"),avatar:c("avatar"),hitTest:(e,t)=>Ne(Ce,le(c("avatar")),e,t),onChange:()=>{ne()}}),Qe={getBoundingClientRect(){let e=c("avatar").getBoundingClientRect(),t=c("tools").getBoundingClientRect();return{left:e.left,width:e.width,top:e.top,bottom:Math.max(e.bottom,t.bottom)}}},ee=Be({floating:!0,origin:"avatar",anchor:()=>Qe,viewport:Re,onChange:()=>te.setConfirmation(ce||!!ee.element||I?.active)}),ct=De(c("surface"),{send:e=>O(e),changed:(e,t)=>{ce=e,e||(ze=null),te.setConfirmation(e||!!ee.element||I?.active);for(let i of document.querySelectorAll("[data-mode]"))i.toggleAttribute("data-teaching",i.dataset.mode===t);ae(),ne()}});I=Ye({anchor:()=>Qe,viewport:Re,send:async e=>{if(e.action==="hide")c("close").click();else{if(["open_dsh","view","settings"].includes(e.action))try{await U("focus_dsh")}catch{I.result({type:"menu_result",request_id:e.request_id,ok:!1,message:"\u672A\u80FD\u5524\u8D77 DSH\uFF0C\u8BF7\u786E\u8BA4\u6240\u5C5E\u7A97\u53E3\u4ECD\u7136\u6253\u5F00\uFF1B\u82E5\u521A\u66F4\u65B0\u63D2\u4EF6\uFF0C\u8BF7\u66F4\u65B0\u684C\u9762\u5F62\u8C61\u3002"});return}O(e)}},changed:()=>{te.setConfirmation(ce||!!ee.element||I.active),ne()}});var ut=Promise.all([window.__TAURI__.event.listen("avatar-pointer",e=>te.pointer(e.payload)).then(e=>{B?e():Ge=e}),window.__TAURI__.event.listen("avatar-viewport",e=>{!Array.isArray(e.payload)||e.payload.length!==4||!e.payload.every(Number.isFinite)||ge?.every((t,i)=>t===e.payload[i])||(ge=e.payload,ae(),window.dispatchEvent(new Event("resize")),ne())}).then(e=>{B?e():Ze=e})]).catch(()=>{G=!0,O({type:"failed"}),P()});re(c("size"),Z);var O=e=>{D.readyState===1&&D.bufferedAmount<16e3&&D.send(JSON.stringify(e))};function ae(){let e=c("bubble"),t=c("surface"),i=[e,t].filter(C=>!C.hidden);if(!i.length)return;let[l,n,a,d]=Re(),o=c("avatar").getBoundingClientRect(),_=c("tools").getBoundingClientRect(),v=o.width/c("avatar").offsetWidth||1,k=12*v;e.style.width="256px",e.style.right="auto";for(let C of i)C.style.maxHeight=Math.max(1,d-24)/v+"px";let z=e.hidden?0:Math.min({small:90,medium:180,large:260}[Ke]*v,e.getBoundingClientRect().height),M=t.hidden?0:Math.min((t.dataset.layout==="tasks"?384:256)*v,t.getBoundingClientRect().height),f=i.length>1?k:0,g=z+M+f,p=Math.max(0,o.top-k-(n+12)),r=Math.max(0,n+d-12-(_.bottom+k)),h=ce?ze:null;(!h||(h==="above"?p:r)<Math.min(g,80*v))&&(h=p>=g?"above":r>=g?"below":p>=r?"above":"below"),ce&&(ze=h);let m=h==="above"?p:r,w=t.hidden?m:Math.min(z,Math.max(0,(m-f)*.3)),N=Math.min(z,w),V=Math.min(M,Math.max(0,m-N-f));e.hidden||(e.style.maxHeight=Math.max(1,N/v)+"px"),t.hidden||(t.style.maxHeight=Math.max(1,V/v)+"px");let H=h==="above"?o.top-k:_.bottom+k;for(let C of i){let R=C.getBoundingClientRect(),j=C.offsetParent.getBoundingClientRect(),b=Math.max(l+12,Math.min(o.left+o.width/2-R.width/2,l+a-12-R.width)),A=h==="above"?H-R.height:H;C.style.left=(b-j.left)/v+"px",C.style.top=(A-j.top)/v+"px",C.style.bottom="auto",C.style.right="auto",H=h==="above"?A-k:A+R.height+k}e.hidden||(e.scrollTop=e.scrollHeight)}var Te=()=>{let e=de?.text||S.text,t=c("bubble").hidden===!!e||c("text").textContent!==e;c("bubble").hidden=!e,c("bubble").dataset.input=String(!!de),c("keyboard").toggleAttribute("hidden",!de),c("text").textContent!==e&&(c("text").textContent=e),t&&ae()},he=()=>{clearTimeout(be),de=null,Te()},pt=()=>{for(let t of document.querySelectorAll("[data-mode]")){let i=S.mode===t.dataset.mode;t.disabled=!1,t.setAttribute("aria-pressed",String(i)),t.setAttribute("aria-busy",String(i&&!S.ready)),t.querySelector("[data-connecting-ring]").hidden=!(i&&!S.ready),t.setAttribute("aria-label",`${i?"\u5173\u95ED":"\u6253\u5F00"}${t.dataset.mode==="online"?"\u4EA4\u4E92\u6A21\u5F0F":"\u64AD\u62A5\u6A21\u5F0F"}`),t.title=i&&!S.ready?`\u6B63\u5728\u8FDE\u63A5${t.dataset.mode==="online"?"\u4EA4\u4E92\u6A21\u5F0F":"\u64AD\u62A5\u6A21\u5F0F"}`:t.getAttribute("aria-label")}c("dot").style.color=S.ready?"#7fd6a6":"#ed9b35";let e=S.mode==="off"?"\u8BED\u97F3\u672A\u5F00\u542F":S.ready?S.mode==="online"?"\u4EA4\u4E92\u6A21\u5F0F":"\u64AD\u62A5\u6A21\u5F0F":"\u6B63\u5728\u8FDE\u63A5\u2026";c("status").textContent!==e&&(c("status").textContent=e)},P=()=>{B||(B=!0,I.dispose(),ee.dispose(),te.dispose(),Ge?.(),Ze?.(),clearInterval(mt),clearInterval(ft),clearTimeout(be),Q?.update({...S,rms:0,text:""}),Q?.dispose(),D.close(),U("hide_avatar").catch(()=>{}))},Me=()=>{G?O({type:"failed"}):xe&&O({type:"ready",protocol:2})},et=e=>(Z=Y(e),K||Z===fe?K||Promise.resolve():(K=(async()=>{for(await X;!B&&Z!==fe;){let t=Z,i=!0,l=await U("set_avatar_size",{size:t,panel:i});if(!l||!Number.isFinite(l.scale)||l.scale<=0||l.scale>1)throw Error("invalid_avatar_layout");c("shell").style.transform=`scale(${l.fit??1})`,c("shell").dataset.panel=String(i),c("stage").dataset.size=t,c("stage").style.setProperty("--scale",l.scale),re(c("size"),t),fe=t,te.refresh(),ae()}})().catch(()=>{G=!0,O({type:"failed"}),P()}).finally(()=>{K=null}),K));try{Q=lt(c("avatar"),{modelURL:"./character.glb",onReady(){Promise.all([ut,et(Z)]).then(async()=>{if(!(B||G)&&(xe=!0,await ne(),!B))return Me(),U("show_avatar")}).catch(()=>{G=!0,O({type:"failed"}),P()})},onError(){G=!0,Me()}})}catch{G=!0}D.onopen=Me;var tt=new ue(1e3);D.onmessage=e=>{tt.touch();try{let t=JSON.parse(e.data);if(t.type==="frame")S=Oe(t),J=Date.now(),Q?.update(S),et(S.size),S.mode==="off"&&he(),Te(),pt();else if(t.type==="input_effect")de=qe(t),J=Date.now(),clearTimeout(be),Te(),be=setTimeout(he,1600);else if(t.type==="clear_input_effect")he();else if(t.type==="surface")ct.update(t),J=Date.now();else if(t.type==="local_state")I.update(t),Ke=t.bubble,ae(),J=Date.now(),t.toast&&t.toast!==Je&&S.mode==="off"&&t.items.find(i=>i.id===t.toast)?.status==="completed"&&Q?.update({...S,text:"\u5B8C\u6210\u4E86",utterance:"notice-"+t.toast}),Je=t.toast;else if(t.type==="menu_result")I.result(t),J=Date.now();else if(t.type==="owner_focus")U("remember_dsh").catch(()=>{}),J=Date.now();else if(t.type!=="alive")throw Error("invalid_avatar_message")}catch{D.close(1008,"invalid_avatar_message")}};D.onclose=P;D.onerror=P;var mt=setInterval(()=>{if(tt.expired()){P();return}Date.now()-J>1500&&(Q?.update({...S,rms:0,text:""}),S={...S,text:""},he()),O({type:"alive"}),dt()},1e3),le=e=>{let t=e.getBoundingClientRect();return[t.x,t.y,t.width,t.height]};function ne(){if(!(!xe||K||B||document.hidden))return X?(Ee=!0,X):(X=(async()=>{do{if(Ee=!1,B||K||document.hidden)break;let e=ee.element?[le(ee.element)]:I.active?[[0,0,innerWidth,innerHeight]]:[...te.regions(),...c("bubble").hidden?[]:[le(c("bubble"))],...c("surface").hidden?[]:[le(c("surface"))],...I.regions()];Ce=Q.hitMask(),await U("avatar_hit_mask",{mask:Ce,avatar:le(c("avatar")),regions:e})}while(Ee)})().catch(()=>{}).finally(()=>{X=null}),X)}var ft=setInterval(()=>{X||ne()},350);for(let e of document.querySelectorAll("[data-mode]")){let t=document.createElement("span");t.dataset.connectingRing="",t.hidden=!0,t.innerHTML='<svg viewBox="0 0 30 30" preserveAspectRatio="none" aria-hidden="true"><rect x="1" y="1" width="28" height="28" rx="7" pathLength="100"/></svg>',e.append(t),e.onclick=()=>O({type:"mode",mode:e.dataset.mode})}c("close").onclick=async()=>{await ee.ask()&&!B&&(O({type:"hide"}),P())};c("size").onclick=()=>O({type:"size",size:se(fe||Z)});var L=null;c("avatar").tabIndex=0;c("avatar").oncontextmenu=e=>{L=null,I.open(e)};c("avatar").onkeydown=e=>{(e.key==="ContextMenu"||e.key==="F10"&&e.shiftKey)&&(L=null,I.open(e))};c("avatar").onpointerdown=e=>{e.button===0&&!e.ctrlKey&&!I.active&&(L={x:e.clientX,y:e.clientY})};c("avatar").onpointermove=e=>{L&&!I.active&&e.buttons===1&&Math.hypot(e.clientX-L.x,e.clientY-L.y)>4&&(L=null,U("drag_avatar").catch(()=>{}))};window.addEventListener("pointerup",()=>{L=null});window.addEventListener("blur",()=>{L=null});window.addEventListener("resize",()=>{ae(),ne()});window.addEventListener("pagehide",P,{once:!0});
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
<!doctype html><html lang="zh-CN"><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
|
2
2
|
<title>duet</title><style>
|
|
3
|
+
#surface[data-layout=tasks]{background:transparent;border:0;box-shadow:none;padding:4px;white-space:normal}
|
|
4
|
+
#surface[data-layout=tasks] br{display:none}
|
|
5
|
+
#surface[data-layout=tasks] button{display:flex;align-items:center;gap:12px;box-sizing:border-box;width:100%;margin:0 0 8px;padding:14px 16px;border:1px solid #ffffffa0;border-radius:20px;background:#f7f9fbea;color:#253344;text-align:left;font:550 14px/1.5 -apple-system,BlinkMacSystemFont,system-ui,sans-serif;box-shadow:0 6px 18px -8px #172c4938;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);cursor:pointer}
|
|
6
|
+
#surface[data-layout=tasks] button:hover{background:#fff}
|
|
7
|
+
#surface[data-layout=tasks] [data-task-state]::before{content:'';display:block;flex:0 0 18px;width:18px;height:18px;box-sizing:border-box;border:2px solid #62a0cd45;border-top-color:#468abf;border-radius:50%;animation:duet-task-spin 1s linear infinite}
|
|
8
|
+
#surface[data-layout=tasks] [data-task-state=completed]::before{content:'✓';border:0;background:#dcefe8;color:#23845e;text-align:center;font:600 14px/18px system-ui;animation:none}
|
|
9
|
+
#surface[data-layout=tasks] [data-task-state=waiting]::before{content:'?';border:0;background:#fff0d9;color:#ad7523;text-align:center;font:600 13px/18px system-ui;animation:none}
|
|
10
|
+
#surface[data-layout=tasks] [data-task-state=failed]::before,#surface[data-layout=tasks] [data-task-state=stopped]::before{content:'!';border:0;background:#f8e3e3;color:#b45353;text-align:center;font:600 13px/18px system-ui;animation:none}
|
|
11
|
+
@keyframes duet-task-spin{to{transform:rotate(360deg)}}
|
|
3
12
|
html,body{margin:0;background:transparent;font:13px/1.6 system-ui;overflow:hidden;color:#e9f4ff;user-select:none}
|
|
4
13
|
#stage{--scale:1;position:absolute;left:0;top:0;width:280px;height:calc(210px + 280px * var(--scale));transform-origin:top left}
|
|
5
14
|
#avatar{position:absolute;left:calc((280px - 260px * var(--scale)) / 2);top:140px;height:calc(280px * var(--scale));width:calc(260px * var(--scale));cursor:grab;touch-action:none}
|
|
15
|
+
#avatar,#avatar canvas{outline:none;-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}
|
|
6
16
|
#bubble{position:absolute;bottom:calc(100% - 134px);left:12px;right:12px;padding:12px 14px;background:#142638ed;border:1px solid #8dc5ed45;border-radius:17px;box-shadow:0 5px 20px #0002;max-height:180px;overflow-y:auto;white-space:pre-wrap;overflow-wrap:anywhere;scrollbar-width:thin}
|
|
7
17
|
#bubble{box-sizing:border-box}#bubble[hidden]{display:none}#bubble[data-input=true]{background:#193b53f5;border-color:#7cb8e599}
|
|
8
18
|
#keyboard{display:inline-block;vertical-align:middle;margin-right:7px}#keyboard[hidden]{display:none}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"protocol": 2,
|
|
3
3
|
"files": {
|
|
4
|
-
"index.html": "
|
|
5
|
-
"companion.mjs": "
|
|
4
|
+
"index.html": "28752006598f995ca6064318dfc0e15d2f0d4b94a3ee7aaf88a0adfec3de5b02",
|
|
5
|
+
"companion.mjs": "51222563dc8ca87fa199bb410322cb4c1a85c144936417711860e3fac1610793",
|
|
6
6
|
"renderer.mjs": "2cbfccca5c10ca2dc720461b3a9a2c5b59a5ef679210206869fa9159316b5650",
|
|
7
|
-
"character.glb": "
|
|
8
|
-
"portrait.png": "
|
|
7
|
+
"character.glb": "4d39cf66e6ce8d389ec18884e2f4de0e142aa4a08d552f68d01d640ed5976471",
|
|
8
|
+
"portrait.png": "6d739465edf7d53f2b621c275a3486e9e8cfd8e363a5fae39792df59053268b4"
|
|
9
9
|
}
|
|
10
10
|
}
|
|
Binary file
|
|
Binary file
|
package/config/duet.patch.yml
CHANGED
|
@@ -1,3 +1,179 @@
|
|
|
1
1
|
- insert:
|
|
2
|
+
- id: duet-superagent
|
|
3
|
+
name: 'dsh-duet-superagent/duet'
|
|
2
4
|
- id: duplex-harness-control
|
|
3
5
|
name: 'dsh-duet'
|
|
6
|
+
- id: duet-superagent-worker-preset
|
|
7
|
+
name: '@deepseek-ai/dsh-agent-preset'
|
|
8
|
+
config:
|
|
9
|
+
id: duet-superagent-worker
|
|
10
|
+
name: dsh-duet 任务执行器
|
|
11
|
+
description: 执行已分配的任务。
|
|
12
|
+
order: 90
|
|
13
|
+
plugins:
|
|
14
|
+
- id: persona
|
|
15
|
+
name: '@deepseek-ai/dsh-persona'
|
|
16
|
+
config:
|
|
17
|
+
prefix: You are a coding agent powered by the {{model}} model.
|
|
18
|
+
- id: agent-instructions
|
|
19
|
+
name: '@deepseek-ai/dsh-agent-instructions'
|
|
20
|
+
config:
|
|
21
|
+
maxBytes: 65536
|
|
22
|
+
- id: time-context
|
|
23
|
+
name: '@deepseek-ai/dsh-time-context'
|
|
24
|
+
# A foreground command waits at most 5 s, then the shell tool moves it to a background job.
|
|
25
|
+
- id: shell
|
|
26
|
+
name: cordis:group
|
|
27
|
+
group: true
|
|
28
|
+
isolate:
|
|
29
|
+
shell: true
|
|
30
|
+
config:
|
|
31
|
+
- id: bash-sandbox
|
|
32
|
+
name: '@deepseek-ai/dsh-bash-sandbox'
|
|
33
|
+
disabled: !!js process.platform === 'win32'
|
|
34
|
+
config:
|
|
35
|
+
timeoutMs: 5000
|
|
36
|
+
maxTimeoutMs: 5000
|
|
37
|
+
- id: pwsh-sandbox
|
|
38
|
+
name: '@deepseek-ai/dsh-pwsh-sandbox'
|
|
39
|
+
disabled: !!js process.platform !== 'win32'
|
|
40
|
+
config:
|
|
41
|
+
timeoutMs: 5000
|
|
42
|
+
maxTimeoutMs: 5000
|
|
43
|
+
- id: tool-bash
|
|
44
|
+
name: '@deepseek-ai/dsh-tool-bash'
|
|
45
|
+
disabled: !!js process.platform === 'win32'
|
|
46
|
+
- id: tool-pwsh
|
|
47
|
+
name: '@deepseek-ai/dsh-tool-pwsh'
|
|
48
|
+
disabled: !!js process.platform !== 'win32'
|
|
49
|
+
- id: tool-fs
|
|
50
|
+
name: '@deepseek-ai/dsh-tool-fs'
|
|
51
|
+
- id: tool-fs-search
|
|
52
|
+
name: '@deepseek-ai/dsh-tool-fs-search'
|
|
53
|
+
config:
|
|
54
|
+
sampleOverCapGlobResults: false
|
|
55
|
+
# A wait for a job ends after 5 s too; the job's end wakes the worker with its result.
|
|
56
|
+
- id: tool-jobs
|
|
57
|
+
name: '@deepseek-ai/dsh-tool-jobs'
|
|
58
|
+
config:
|
|
59
|
+
waitTimeoutMs: 5000
|
|
60
|
+
maxWaitTimeoutMs: 5000
|
|
61
|
+
- id: skill-filesystem
|
|
62
|
+
name: '@deepseek-ai/dsh-skill-filesystem'
|
|
63
|
+
- id: tool-skill
|
|
64
|
+
name: '@deepseek-ai/dsh-tool-skill'
|
|
65
|
+
- id: compaction
|
|
66
|
+
name: cordis:group
|
|
67
|
+
group: true
|
|
68
|
+
isolate:
|
|
69
|
+
compaction: true
|
|
70
|
+
toolResultPruner: true
|
|
71
|
+
config:
|
|
72
|
+
- id: compaction-basic
|
|
73
|
+
name: '@deepseek-ai/dsh-compaction-basic'
|
|
74
|
+
- id: command-compact
|
|
75
|
+
name: '@deepseek-ai/dsh-command-compact'
|
|
76
|
+
- id: tool-result-pruner
|
|
77
|
+
name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
|
|
78
|
+
config:
|
|
79
|
+
thresholdChars: 8192
|
|
80
|
+
headChars: 4096
|
|
81
|
+
tailChars: 1024
|
|
82
|
+
- id: delegation
|
|
83
|
+
name: cordis:group
|
|
84
|
+
group: true
|
|
85
|
+
isolate:
|
|
86
|
+
workflowEngine: true
|
|
87
|
+
config:
|
|
88
|
+
- id: tool-subagent-control
|
|
89
|
+
name: '@deepseek-ai/dsh-tool-subagent-control'
|
|
90
|
+
- id: tool-subagent
|
|
91
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
92
|
+
config:
|
|
93
|
+
provider: spawn
|
|
94
|
+
toolName: subagent
|
|
95
|
+
modelSelection: true
|
|
96
|
+
modelDiscovery: true
|
|
97
|
+
agentPreset: standard
|
|
98
|
+
- id: tool-todo
|
|
99
|
+
name: '@deepseek-ai/dsh-tool-todo'
|
|
100
|
+
config:
|
|
101
|
+
allowParallelInProgress: true
|
|
102
|
+
- id: tool-web
|
|
103
|
+
name: '@deepseek-ai/dsh-tool-web'
|
|
104
|
+
config:
|
|
105
|
+
fetch: false
|
|
106
|
+
searchTimeoutMs: 60000
|
|
107
|
+
# The agent preset of the main Session (ROUTER_PRESET in src/app/sessions.ts). The worker's 5-second shell and job waits, so a command or a wait does not hold back the next candidates, and
|
|
108
|
+
# only what the main Session uses: no subagents, web, file search or writes, todo list, questions to a person, presenting,
|
|
109
|
+
# plan mode, plugin manager, scheduling, goals or workflows. No persona: the main Session's prompt is complete, so it has
|
|
110
|
+
# no other section.
|
|
111
|
+
- id: duet-superagent-router-preset
|
|
112
|
+
name: '@deepseek-ai/dsh-agent-preset'
|
|
113
|
+
config:
|
|
114
|
+
id: duet-superagent-router
|
|
115
|
+
name: dsh-duet 任务助手
|
|
116
|
+
description: 理解需求,跟进任务进展。
|
|
117
|
+
order: 91
|
|
118
|
+
plugins:
|
|
119
|
+
- id: agent-instructions
|
|
120
|
+
name: '@deepseek-ai/dsh-agent-instructions'
|
|
121
|
+
config:
|
|
122
|
+
maxBytes: 65536
|
|
123
|
+
- id: time-context
|
|
124
|
+
name: '@deepseek-ai/dsh-time-context'
|
|
125
|
+
- id: shell
|
|
126
|
+
name: cordis:group
|
|
127
|
+
group: true
|
|
128
|
+
isolate:
|
|
129
|
+
shell: true
|
|
130
|
+
config:
|
|
131
|
+
- id: bash-sandbox
|
|
132
|
+
name: '@deepseek-ai/dsh-bash-sandbox'
|
|
133
|
+
disabled: !!js process.platform === 'win32'
|
|
134
|
+
config:
|
|
135
|
+
timeoutMs: 5000
|
|
136
|
+
maxTimeoutMs: 5000
|
|
137
|
+
- id: pwsh-sandbox
|
|
138
|
+
name: '@deepseek-ai/dsh-pwsh-sandbox'
|
|
139
|
+
disabled: !!js process.platform !== 'win32'
|
|
140
|
+
config:
|
|
141
|
+
timeoutMs: 5000
|
|
142
|
+
maxTimeoutMs: 5000
|
|
143
|
+
- id: tool-bash
|
|
144
|
+
name: '@deepseek-ai/dsh-tool-bash'
|
|
145
|
+
disabled: !!js process.platform === 'win32'
|
|
146
|
+
- id: tool-pwsh
|
|
147
|
+
name: '@deepseek-ai/dsh-tool-pwsh'
|
|
148
|
+
disabled: !!js process.platform !== 'win32'
|
|
149
|
+
- id: tool-fs
|
|
150
|
+
name: '@deepseek-ai/dsh-tool-fs'
|
|
151
|
+
config:
|
|
152
|
+
write: false
|
|
153
|
+
edit: false
|
|
154
|
+
- id: tool-jobs
|
|
155
|
+
name: '@deepseek-ai/dsh-tool-jobs'
|
|
156
|
+
config:
|
|
157
|
+
waitTimeoutMs: 5000
|
|
158
|
+
maxWaitTimeoutMs: 5000
|
|
159
|
+
- id: skill-filesystem
|
|
160
|
+
name: '@deepseek-ai/dsh-skill-filesystem'
|
|
161
|
+
- id: tool-skill
|
|
162
|
+
name: '@deepseek-ai/dsh-tool-skill'
|
|
163
|
+
- id: compaction
|
|
164
|
+
name: cordis:group
|
|
165
|
+
group: true
|
|
166
|
+
isolate:
|
|
167
|
+
compaction: true
|
|
168
|
+
toolResultPruner: true
|
|
169
|
+
config:
|
|
170
|
+
- id: compaction-basic
|
|
171
|
+
name: '@deepseek-ai/dsh-compaction-basic'
|
|
172
|
+
- id: command-compact
|
|
173
|
+
name: '@deepseek-ai/dsh-command-compact'
|
|
174
|
+
- id: tool-result-pruner
|
|
175
|
+
name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
|
|
176
|
+
config:
|
|
177
|
+
thresholdChars: 8192
|
|
178
|
+
headChars: 4096
|
|
179
|
+
tailChars: 1024
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DeepSeek Harness Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# dsh-superagent
|
|
2
|
+
|
|
3
|
+
> **Research prototype for reference only, not an official DeepSeek product.** This code grew out of our team's day-to-day development work, with much of the engineering done by coding agents. Treat it as research code, not production-ready software. It may still contain bugs, and its coding style and engineering practices may be inconsistent. Review and adapt it before using it in your own environment.
|
|
4
|
+
>
|
|
5
|
+
> We have adapted it for publication, so it is not identical to our internal version or the implementation described in *Exploring Super-agent Design: Towards a More Autonomous Agent System*. Some designs discussed in the article are directions for future development and are not implemented in this prototype.
|
|
6
|
+
|
|
7
|
+
dsh-superagent is a proactive coding agent for one GitHub repository, packaged as a bundle for [DeepSeek Harness](https://www.deepseek.com/en/harness/). It listens to GitHub and, optionally, Feishu. When someone allowed asks the agent for work, it opens a work item, works on it in its own agent session and directory, and answers in the original conversation, for example with a pull request. A web panel shows what needs a person.
|
|
8
|
+
|
|
9
|
+
It is also a way of working with an agent: **take as little human attention as possible, and give as much value as possible.** An agent that can act for a whole team can also waste a whole team's attention, so it acts only when asked or when a rule the team wrote allows it, and speaks only when someone must act or can use a result. [docs/000-philosophy.md](docs/000-philosophy.md) explains the principle and what it asks of the operator.
|
|
10
|
+
|
|
11
|
+
## Setup
|
|
12
|
+
|
|
13
|
+
Setup has many steps, so an agent does it with you. Ask your coding agent:
|
|
14
|
+
|
|
15
|
+
> Read SETUP.md in this repository and set up dsh-superagent with me.
|
|
16
|
+
|
|
17
|
+
It asks one short question at a time, shows the full plan once, and then installs and configures everything. [SETUP.md](SETUP.md) is what it follows.
|
|
18
|
+
|
|
19
|
+
## Documentation
|
|
20
|
+
|
|
21
|
+
Read the numbered documents in order; each builds only on the ones before it.
|
|
22
|
+
|
|
23
|
+
- [000 Philosophy](docs/000-philosophy.md)
|
|
24
|
+
- [001 Domain model](docs/001-domain.md)
|
|
25
|
+
- [002 Authorization](docs/002-authorization.md)
|
|
26
|
+
- [003 Execution](docs/003-execution.md)
|
|
27
|
+
- [004 Prompts](docs/004-prompts.md)
|
|
28
|
+
- [005 Panel](docs/005-panel.md)
|
|
29
|
+
- [006 Deployment](docs/006-deployment.md): manual setup, configuration, upgrades and troubleshooting
|
|
30
|
+
- [007 Architecture](docs/007-architecture.md)
|
|
31
|
+
- [008 Cookbook](docs/008-cookbook.md): adding a Source
|
|
32
|
+
|
|
33
|
+
## Development
|
|
34
|
+
|
|
35
|
+
`pnpm check` runs the typecheck, the tests and the build.
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
|
|
39
|
+
[MIT](LICENSE)
|