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/src/host/plugin.mjs
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
/** duet Host entry: session operations, authenticated settings, and client assets. */
|
|
2
2
|
|
|
3
|
-
import { readFile } from 'node:fs/promises'
|
|
3
|
+
import { readFile, mkdir, realpath } from 'node:fs/promises'
|
|
4
|
+
import { homedir } from 'node:os'
|
|
5
|
+
import { join } from 'node:path'
|
|
4
6
|
import { randomUUID } from 'node:crypto'
|
|
5
7
|
import { registerDuetProxy, duetConfig } from './proxy.mjs'
|
|
6
8
|
import { DuetSettings, settingsWriteAllowed } from './settings.mjs'
|
|
7
9
|
import { NICKNAME_LIMIT } from '../shared/nickname.mjs'
|
|
8
10
|
import { IDENTITY_TRANSPORT_HEADER, IDENTITY_TRANSPORT } from '../shared/identity.mjs'
|
|
9
11
|
import { ServiceNotices } from './notices.mjs'
|
|
10
|
-
import { ServiceInfo } from './service-info.mjs'
|
|
12
|
+
import { ServiceInfo,WorkModePolicy } from './service-info.mjs'
|
|
13
|
+
import {effectiveWorkPolicy} from '../shared/work-mode.mjs'
|
|
11
14
|
import { DuetTrace } from './trace.mjs'
|
|
15
|
+
import { diagnosticPayload } from '../shared/diagnostics.mjs'
|
|
12
16
|
import { FeedbackService } from './feedback-store.mjs'
|
|
13
17
|
import { RemoteFeedback } from './feedback-files.mjs'
|
|
14
18
|
import { PLUGIN_VERSION } from '../shared/state.mjs'
|
|
@@ -162,6 +166,34 @@ import { ResultFeed } from './result-feed.mjs'
|
|
|
162
166
|
import { registerSyncFeed } from './sync-feed.mjs'
|
|
163
167
|
|
|
164
168
|
export function apply(ctx, options = {}) {
|
|
169
|
+
let creatingWorkspace
|
|
170
|
+
const dedicatedDir=()=>join(homedir(),'DSH-workspaces','dsh-duet')
|
|
171
|
+
async function registeredDedicated(rows){
|
|
172
|
+
// Runtime and task history use the canonical directory as their identity.
|
|
173
|
+
for(const name of ['dsh-duet','duet']){
|
|
174
|
+
const dir=join(homedir(),'DSH-workspaces',name)
|
|
175
|
+
const canonical=await realpath(dir).catch(()=>dir)
|
|
176
|
+
const row=rows.find(w=>w.path===canonical)
|
|
177
|
+
if(row)return row
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
async function dedicatedWorkspace() {
|
|
181
|
+
const existing=await registeredDedicated(ctx.workspaceRegistry.list())
|
|
182
|
+
if(existing){
|
|
183
|
+
let name=existing.title||existing.name
|
|
184
|
+
if(name==='duet' && ctx.workspaceController.rename){
|
|
185
|
+
await ctx.workspaceController.rename({workspaceId:existing.id,title:'dsh-duet'})
|
|
186
|
+
name='dsh-duet'
|
|
187
|
+
}
|
|
188
|
+
return {id:existing.id,name:name||'dsh-duet'}
|
|
189
|
+
}
|
|
190
|
+
const path = dedicatedDir()
|
|
191
|
+
await mkdir(path,{recursive:true, mode:0o700})
|
|
192
|
+
const canonical = await realpath(path)
|
|
193
|
+
const result = await ctx.workspaceController.create({path:canonical})
|
|
194
|
+
if(!result?.workspace?.workspaceId) throw Error('workspace_creation_failed')
|
|
195
|
+
return {id:result.workspace.workspaceId,name:result.workspace.title||result.workspace.name||'dsh-duet'}
|
|
196
|
+
}
|
|
165
197
|
const resultFeed = new ResultFeed()
|
|
166
198
|
ctx.effect(() => () => resultFeed.notify())
|
|
167
199
|
const jobs = new Map()
|
|
@@ -192,11 +224,16 @@ export function apply(ctx, options = {}) {
|
|
|
192
224
|
ctx.effect(() => { const avatar=registerAvatarHost(ctx);return ()=>avatar.close() })
|
|
193
225
|
Object.assign(voice, settings.effective())
|
|
194
226
|
voice.nickname = () => settings.public().nickname
|
|
227
|
+
voice.workMode = () => settings.public().work_mode
|
|
228
|
+
voice.workPolicy = () => effectiveWorkPolicy(settings.public(),workPolicy.current)
|
|
229
|
+
voice.agentService = () => ctx.get('duetAgent')
|
|
195
230
|
const audit = new DuetTrace({ kind: 'host', plugin_version: PLUGIN_VERSION, pid: process.pid },
|
|
196
231
|
{ ...options.traceOptions, secrets: [voice.authorization] })
|
|
197
232
|
ctx.effect(() => () => { void audit.close({ reason: 'plugin_dispose' }) })
|
|
198
233
|
const discovery = new EndpointDiscovery(() => settings.effective(), {...options.endpointDiscoveryOptions, changed: () => {notices.invalidate();serviceInfo.invalidate()}})
|
|
199
|
-
const
|
|
234
|
+
const voiceRoot=duetEnv('VOICE_LIBRARY_DIR')
|
|
235
|
+
const voices = new DuetVoices(() => discovery.effective(), {scope:()=>settings.effective().endpoints.online,
|
|
236
|
+
...(voiceRoot?{root:voiceRoot}:{}),...options.voiceOptions})
|
|
200
237
|
voice.prepareVoice = () => voices.prepare()
|
|
201
238
|
voice.respondVoiceChallenge = challenge => voices.respondChallenge(challenge)
|
|
202
239
|
voice.applyVoicePolicy = policy => voices.applyPolicy(policy)
|
|
@@ -204,13 +241,14 @@ export function apply(ctx, options = {}) {
|
|
|
204
241
|
ctx.effect(() => () => voices.close())
|
|
205
242
|
const notices = new ServiceNotices(() => discovery.effective(), (url,options) => discovery.fetch(url,options))
|
|
206
243
|
const serviceInfo = new ServiceInfo(() => discovery.effective(), (url,options) => discovery.fetch(url,options))
|
|
244
|
+
const workPolicy = new WorkModePolicy(()=>discovery.effective(),(url,options)=>discovery.fetch(url,options))
|
|
207
245
|
discovery.refreshIfDue()
|
|
208
246
|
const feedbackStore = options.feedbackStore ?? (options.feedbackDisabled ? null : new RemoteFeedback(()=>discovery.effective(),{keyPath:options.feedbackIdentityPath}))
|
|
209
247
|
const feedback = new FeedbackService(feedbackStore)
|
|
210
248
|
const avatarActivity = new AvatarActivityOutbox(()=>discovery.effective(), options.avatarActivityOptions)
|
|
211
249
|
ctx.effect(()=>()=>avatarActivity.close())
|
|
212
250
|
let duetProxy
|
|
213
|
-
ctx.effect(() => { duetProxy = registerDuetProxy(ctx, voice, feedback, () =>
|
|
251
|
+
ctx.effect(() => { duetProxy = registerDuetProxy(ctx, voice, feedback, () => true, discovery); return duetProxy })
|
|
214
252
|
|
|
215
253
|
ctx.effect(() => () => { hostAbort.abort() })
|
|
216
254
|
|
|
@@ -335,7 +373,8 @@ export function apply(ctx, options = {}) {
|
|
|
335
373
|
|
|
336
374
|
const listSessions = async ({forCatalog = false} = {}) => {
|
|
337
375
|
const { items } = await ctx.sessionController.list({}, hostAbort.signal)
|
|
338
|
-
const
|
|
376
|
+
const managed = new Set(await ctx.get?.('duetAgent')?.managedSessionIds?.() || [])
|
|
377
|
+
const catalog = buildSessionCatalog(items.filter(item=>!managed.has(item.sessionId)), {
|
|
339
378
|
archivedIds: ctx.workspaceRegistry.archivedSessionIds,
|
|
340
379
|
workspaces: ctx.workspaceRegistry.list?.() || [],
|
|
341
380
|
activeId: activeSessionId,
|
|
@@ -603,20 +642,53 @@ export function apply(ctx, options = {}) {
|
|
|
603
642
|
const body = await readJson(req)
|
|
604
643
|
if (JSON.stringify(body).length > 24000) { sendError(res, 413, 'diagnostic too large'); return }
|
|
605
644
|
audit.event('client.diagnostic', body)
|
|
606
|
-
|
|
607
|
-
|
|
645
|
+
if (!diagnosticPayload(body)) {
|
|
646
|
+
sendJson(res, 200, {ok:true, delivery:'local_only', logging:audit.snapshot()}); return
|
|
647
|
+
}
|
|
648
|
+
const accepted = duetProxy?.reportDiagnostic?.(req, body) === true
|
|
649
|
+
sendJson(res, accepted ? 202 : 409, {ok:accepted, delivery:accepted ? 'accepted' : 'not_queued'}); return
|
|
608
650
|
}
|
|
609
651
|
if (req.method === 'GET' && pathname === `${ROUTE}/api/voice/service-info`) {
|
|
610
652
|
sendJson(res, 200, await serviceInfo.get())
|
|
611
653
|
return
|
|
612
654
|
}
|
|
655
|
+
if (req.method === 'POST' && pathname === `${ROUTE}/api/voice/dedicated-workspace`) {
|
|
656
|
+
const rejection=ctx.connection.requestRejection(req)
|
|
657
|
+
if(rejection || !identityWriteAllowed(req)){sendError(res,rejection||403,'DSH connection required');return}
|
|
658
|
+
if(await workPolicy.get()==='direct_only'){sendError(res,403,'agent_mode_disabled');return}
|
|
659
|
+
try {
|
|
660
|
+
creatingWorkspace ??= dedicatedWorkspace().finally(()=>{creatingWorkspace=null})
|
|
661
|
+
sendJson(res,200,await creatingWorkspace)
|
|
662
|
+
} catch {sendError(res,503,'无法使用 dsh-duet 专属工作区,可以选择已有工作区。')}
|
|
663
|
+
return
|
|
664
|
+
}
|
|
665
|
+
if (req.method === 'GET' && pathname === `${ROUTE}/api/voice/work-options`) {
|
|
666
|
+
const models = await ctx.sessionController.modelCatalog()
|
|
667
|
+
const rows=ctx.workspaceRegistry.list()
|
|
668
|
+
sendJson(res, 200, {dedicated_workspace_id:(await registeredDedicated(rows))?.id??null,
|
|
669
|
+
workspaces:rows.map(w=>({id:w.id,path:w.path,name:w.title||w.name})),
|
|
670
|
+
models:{default:models.default,groups:models.groups}})
|
|
671
|
+
return
|
|
672
|
+
}
|
|
673
|
+
if(req.method==='GET' && pathname===`${ROUTE}/api/voice/agent-tasks`){
|
|
674
|
+
const rejection=ctx.connection.requestRejection(req)
|
|
675
|
+
if(rejection){sendError(res,rejection,'DSH connection required');return}
|
|
676
|
+
const policy=effectiveWorkPolicy(settings.public(),await workPolicy.get())
|
|
677
|
+
if(policy.work_mode!=='agent'||policy.agent_permission_version!==1){sendJson(res,200,{rows:[]});return}
|
|
678
|
+
try{
|
|
679
|
+
const rows=await ctx.get('duetAgent').taskRows(policy.agent_options.workspace_id)
|
|
680
|
+
sendJson(res,200,{rows:rows.map(({name,state,session_id,finished_at})=>({name,state,
|
|
681
|
+
...(/^worker-[a-f0-9]{32}$/.test(session_id)?{session_id,finished_at}:{} )}))})
|
|
682
|
+
}catch{sendError(res,503,'任务状态暂不可用')}
|
|
683
|
+
return
|
|
684
|
+
}
|
|
613
685
|
if (req.method === 'GET' && pathname === `${ROUTE}/api/voice/config`) {
|
|
614
686
|
let identity
|
|
615
687
|
try {
|
|
616
688
|
if(req.headers[IDENTITY_TRANSPORT_HEADER.toLowerCase()]===IDENTITY_TRANSPORT)identity=feedbackStore?.ensureCredential?.(req,res)
|
|
617
689
|
else feedbackStore?.ensureIdentity?.(req,res)
|
|
618
690
|
} catch {sendJson(res,503,{error_code:'feedback_identity_unavailable'});return}
|
|
619
|
-
sendJson(res, 200, { ...settings.public(), plugin_version: PLUGIN_VERSION, feedback_enabled: feedback.enabled,
|
|
691
|
+
sendJson(res, 200, { ...effectiveWorkPolicy(settings.public(),await workPolicy.get()), plugin_version: PLUGIN_VERSION, feedback_enabled: feedback.enabled,
|
|
620
692
|
avatar: { web_only: duetEnv('AVATAR_WEB_ONLY') === '1' },
|
|
621
693
|
...(identity?{feedback_identity:identity}:{}), connection: duetProxy?.snapshot?.() || { online: 0, tts_only: 0 } })
|
|
622
694
|
return
|
|
@@ -624,7 +696,17 @@ export function apply(ctx, options = {}) {
|
|
|
624
696
|
if (req.method === 'PUT' && pathname === `${ROUTE}/api/voice/config`) {
|
|
625
697
|
if (!identityWriteAllowed(req)) { sendError(res, 403, 'same-origin settings request required'); return }
|
|
626
698
|
try {
|
|
627
|
-
const
|
|
699
|
+
const input = await readJson(req)
|
|
700
|
+
const rule=await workPolicy.get()
|
|
701
|
+
if(rule==='direct_only' && input.work_mode==='agent'){sendError(res,403,'agent_mode_disabled');return}
|
|
702
|
+
if ((input.work_mode ?? effectiveWorkPolicy(settings.public(),rule).work_mode) === 'agent') {
|
|
703
|
+
const options=input.agent_options || settings.public().agent_options
|
|
704
|
+
if (!ctx.workspaceRegistry.list().some(w=>w.id===options?.workspace_id)) throw Error('workspace_selection_required')
|
|
705
|
+
const service=ctx.get('duetAgent')
|
|
706
|
+
if(!service?.validateConfiguration)throw Error('duet_agent_unavailable')
|
|
707
|
+
await service.validateConfiguration(options)
|
|
708
|
+
}
|
|
709
|
+
const result = await settings.save(input)
|
|
628
710
|
Object.assign(voice, settings.effective())
|
|
629
711
|
discovery.invalidate()
|
|
630
712
|
feedback.sessions.clear() // Never send an old rating to a newly selected backend.
|
|
@@ -632,7 +714,7 @@ export function apply(ctx, options = {}) {
|
|
|
632
714
|
notices.invalidate()
|
|
633
715
|
serviceInfo.invalidate()
|
|
634
716
|
duetProxy?.closeConnections?.('voice_settings_changed')
|
|
635
|
-
sendJson(res, 200, result)
|
|
717
|
+
sendJson(res, 200, effectiveWorkPolicy(result,await workPolicy.get()))
|
|
636
718
|
} catch (error) { sendError(res, 400, error.message) }
|
|
637
719
|
return
|
|
638
720
|
}
|
|
@@ -1230,7 +1312,7 @@ export function apply(ctx, options = {}) {
|
|
|
1230
1312
|
const handler = async (req, res) => {
|
|
1231
1313
|
const pathname = new URL(req.url || '/', 'http://localhost').pathname
|
|
1232
1314
|
try {
|
|
1233
|
-
if ([PAGE_ROUTE, `${PAGE_ROUTE}/`, ROUTE, `${ROUTE}/`, `${ROUTE}/api/voice/config`, `${ROUTE}/api/voice/service-info`, `${ROUTE}/api/voice/diagnostic`, `${ROUTE}/api/announcements`].includes(pathname)) {
|
|
1315
|
+
if ([PAGE_ROUTE, `${PAGE_ROUTE}/`, ROUTE, `${ROUTE}/`, `${ROUTE}/api/voice/config`, `${ROUTE}/api/voice/work-options`, `${ROUTE}/api/voice/service-info`, `${ROUTE}/api/voice/diagnostic`, `${ROUTE}/api/announcements`].includes(pathname)) {
|
|
1234
1316
|
const rejection = ctx.connection.requestRejection(req)
|
|
1235
1317
|
if (rejection) { sendError(res, rejection, '请先打开并登录 DSH 主页面'); return }
|
|
1236
1318
|
}
|
package/src/host/proxy.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Same-origin voice relay; endpoint and compatibility policy belong to the DSH host. */
|
|
2
2
|
import { createRequire } from 'node:module'
|
|
3
3
|
import { DuetTrace } from './trace.mjs'
|
|
4
|
-
import { ConnectionDiagnostics,
|
|
4
|
+
import { ConnectionDiagnostics, acquireHostDiagnostics } from './diagnostics.mjs'
|
|
5
5
|
import { DIAGNOSTICS_PROTOCOL } from '../shared/diagnostics.mjs'
|
|
6
6
|
import { PLUGIN_VERSION } from '../shared/state.mjs'
|
|
7
7
|
import { duetEnv } from './environment.mjs'
|
|
@@ -11,11 +11,13 @@ import {VOICE_PROTOCOL} from '../shared/identity.mjs'
|
|
|
11
11
|
import { broadcastText } from '../shared/result-notification.mjs'
|
|
12
12
|
import { sessionLabel } from '../shared/catalog.mjs'
|
|
13
13
|
import { normalizeNickname } from '../shared/nickname.mjs'
|
|
14
|
+
import { AgentConnection } from './agent-connection.mjs'
|
|
15
|
+
import { workModeIssue } from '../shared/work-mode.mjs'
|
|
14
16
|
import { DEFAULT_DUET_URL, publicServiceAuthorization } from './service-defaults.mjs'
|
|
15
17
|
export { DEFAULT_DUET_URL } from './service-defaults.mjs'
|
|
16
18
|
const require = createRequire(import.meta.url)
|
|
17
19
|
|
|
18
|
-
export function compatibleVersion(version, min = '0.1.0', maxExclusive = '0.
|
|
20
|
+
export function compatibleVersion(version, min = '0.1.0', maxExclusive = '0.4.0') {
|
|
19
21
|
const parse = v => /^\d+\.\d+\.\d+$/.test(v || '') ? v.split('.').map(Number) : null
|
|
20
22
|
const compare = (a, b) => a[0] - b[0] || a[1] - b[1] || a[2] - b[2]
|
|
21
23
|
const v = parse(version), low = parse(min), high = parse(maxExclusive)
|
|
@@ -29,7 +31,7 @@ export function duetConfig(env = process.env) {
|
|
|
29
31
|
}
|
|
30
32
|
return {
|
|
31
33
|
min_version: duetEnv('MIN_VERSION', env) || '0.1.0',
|
|
32
|
-
max_version_exclusive: duetEnv('MAX_VERSION_EXCLUSIVE', env) || '0.
|
|
34
|
+
max_version_exclusive: duetEnv('MAX_VERSION_EXCLUSIVE', env) || '0.4.0',
|
|
33
35
|
control_transport: duetEnv('CONTROL_TRANSPORT', env) || 'client_rpc_v1',
|
|
34
36
|
authorization: publicServiceAuthorization(endpoints),
|
|
35
37
|
endpoints,
|
|
@@ -63,8 +65,8 @@ export function registerDuetProxy(ctx, config = duetConfig(), feedback = null, c
|
|
|
63
65
|
const server = new WebSocketServer({ noServer: true, maxPayload: 2_100_000,
|
|
64
66
|
handleProtocols: protocols => protocols.has(VOICE_PROTOCOL) ? VOICE_PROTOCOL : false })
|
|
65
67
|
const connections = new Map()
|
|
66
|
-
const reporters
|
|
67
|
-
|
|
68
|
+
const {reporters, outbox:diagnosticOutbox, release:releaseDiagnostics} =
|
|
69
|
+
acquireHostDiagnostics(ctx.webServer, config.diagnosticOptions)
|
|
68
70
|
const stop = ctx.webServer.registerUpgrade({
|
|
69
71
|
path: '/duplex-control/voice/ws',
|
|
70
72
|
handler(req, socket, head) {
|
|
@@ -92,6 +94,9 @@ export function registerDuetProxy(ctx, config = duetConfig(), feedback = null, c
|
|
|
92
94
|
})
|
|
93
95
|
let back, feedbackTicket = null, connectionRoute, selectedConfig, diagnostics
|
|
94
96
|
let chosenVoice = 'default'
|
|
97
|
+
const policy = config.workPolicy?.()
|
|
98
|
+
const agentMode = (policy?.work_mode ?? config.workMode?.()) === 'agent'
|
|
99
|
+
let agentConnection
|
|
95
100
|
let voiceChallengeStarted = false
|
|
96
101
|
const opening = new AbortController()
|
|
97
102
|
front.once('close', () => feedback?.close(feedbackTicket))
|
|
@@ -107,26 +112,36 @@ export function registerDuetProxy(ctx, config = duetConfig(), feedback = null, c
|
|
|
107
112
|
if (front.readyState === WebSocket.OPEN) front.send(JSON.stringify({ type: 'error', error: { code } }))
|
|
108
113
|
front.close(code === 'capacity_exhausted' ? 1013 : 1008)
|
|
109
114
|
back?.close()
|
|
115
|
+
agentConnection?.close()
|
|
110
116
|
}
|
|
111
117
|
const mode = params.get('mode')
|
|
112
118
|
if (!compatibleVersion(params.get('plugin_version'), config.min_version, config.max_version_exclusive)) { fail('plugin_upgrade_required'); return }
|
|
113
119
|
if (!['online', 'tts_only'].includes(mode)) { fail('invalid_voice_mode'); return }
|
|
120
|
+
if(policy) {
|
|
121
|
+
const issue=workModeIssue(policy)
|
|
122
|
+
if(issue){fail(issue);return}
|
|
123
|
+
}
|
|
114
124
|
let anonymousUserId
|
|
115
125
|
try{anonymousUserId=feedback?.user(req)}catch{ /* Identity is optional, not admission. */ }
|
|
116
|
-
const clientMetadata=sessionMetadata(params,mode,anonymousUserId)
|
|
126
|
+
const clientMetadata={...sessionMetadata(params,mode,anonymousUserId),work_mode:agentMode?'agent':'direct',
|
|
127
|
+
...(agentMode?{agent_trace_protocol:'duet_trace_v1'}:{}),
|
|
128
|
+
work_protocol:agentMode?'duet_agent_v1':'harness_direct_v1'}
|
|
117
129
|
diagnostics = new ConnectionDiagnostics({client_trace_id:clientMetadata.client_trace_id,
|
|
118
130
|
page_id:clientMetadata.page_id, plugin_version:clientMetadata.version, host_version:PLUGIN_VERSION, mode},
|
|
119
131
|
diagnosticOutbox.fetcher, diagnosticOutbox)
|
|
120
|
-
|
|
132
|
+
const reporter = {diagnostics, page_id:clientMetadata.page_id, user:anonymousUserId}
|
|
133
|
+
reporters.set(clientMetadata.client_trace_id, reporter)
|
|
121
134
|
// Allow keepalive HTTP diagnostics to arrive after the browser socket closed.
|
|
122
|
-
front.once('close', () => { const timer=setTimeout(()=>
|
|
135
|
+
front.once('close', () => { const timer=setTimeout(()=>{
|
|
136
|
+
if (reporters.get(clientMetadata.client_trace_id) === reporter) reporters.delete(clientMetadata.client_trace_id)
|
|
137
|
+
},30000); timer.unref() })
|
|
123
138
|
trace.event('session.metadata',clientMetadata)
|
|
124
139
|
if (!canUseVoice()) { fail('workspace_required'); return }
|
|
125
140
|
connections.set(front, { mode, ready: false, trace })
|
|
126
141
|
front.on('close', () => connections.delete(front))
|
|
127
142
|
const target = config.endpoints[mode]
|
|
128
143
|
if (!target) { fail('voice_mode_unavailable'); return }
|
|
129
|
-
const clientRPC = mode === 'online' && config.control_transport === 'client_rpc_v1'
|
|
144
|
+
const clientRPC = !agentMode && mode === 'online' && config.control_transport === 'client_rpc_v1'
|
|
130
145
|
const rpcRequests = new Map()
|
|
131
146
|
const pending = []
|
|
132
147
|
const startup = setTimeout(() => fail('voice_start_timeout'), 20000)
|
|
@@ -180,7 +195,7 @@ export function registerDuetProxy(ctx, config = duetConfig(), feedback = null, c
|
|
|
180
195
|
initialized = true
|
|
181
196
|
let nickname = null
|
|
182
197
|
try { nickname = normalizeNickname(config.nickname?.()) } catch { /* Default identity. */ }
|
|
183
|
-
|
|
198
|
+
const update = { type: 'session.update',
|
|
184
199
|
client: {...clientMetadata, diagnostics_protocol:DIAGNOSTICS_PROTOCOL,
|
|
185
200
|
...(message.client?.audio_text_protocol === 'audio_text_delta_v1'
|
|
186
201
|
? {audio_text_protocol:'audio_text_delta_v1'} : {}),
|
|
@@ -190,10 +205,21 @@ export function registerDuetProxy(ctx, config = duetConfig(), feedback = null, c
|
|
|
190
205
|
type: 'realtime', preset_id: 'server_default',
|
|
191
206
|
duet_nickname: nickname,
|
|
192
207
|
io_mode:mode === 'tts_only'?'external_only':'online',
|
|
208
|
+
...(agentMode?{work_mode:'agent',work_protocol:'duet_agent_v1'}:{}),
|
|
193
209
|
...(clientRPC ? { harness: { transport: 'client_rpc_v1' } } : {}),
|
|
194
210
|
audio: { input: { format: { type: 'audio/pcm', rate: 16000 } } },
|
|
195
211
|
debug: { enabled: false, slot_grid: false },
|
|
196
|
-
} }
|
|
212
|
+
} }
|
|
213
|
+
if (agentMode) {
|
|
214
|
+
agentConnection = new AgentConnection(config.agentService?.(), message => forward(JSON.stringify(message)),
|
|
215
|
+
frame=>{if(!terminal && front.readyState===WebSocket.OPEN)front.send(JSON.stringify(frame))},
|
|
216
|
+
{target:()=>new URL(target).origin,
|
|
217
|
+
canSend:()=>!terminal && back?.readyState===WebSocket.OPEN && back.bufferedAmount<16*1024 && pending.length===0})
|
|
218
|
+
void agentConnection.prepare(policy?.agent_options?.workspace_id ?? message.workspace_id,policy?.agent_options).then(agent => {
|
|
219
|
+
if (!terminal && front.readyState === WebSocket.OPEN) forward(JSON.stringify({...update,
|
|
220
|
+
session:{...update.session, task_mode:'duplex_no_tts_agent', agent}}))
|
|
221
|
+
}).catch(error => fail(error.message))
|
|
222
|
+
} else forward(JSON.stringify(update))
|
|
197
223
|
return
|
|
198
224
|
}
|
|
199
225
|
if (!initialized) throw new Error('session_not_started')
|
|
@@ -214,8 +240,13 @@ export function registerDuetProxy(ctx, config = duetConfig(), feedback = null, c
|
|
|
214
240
|
return
|
|
215
241
|
}
|
|
216
242
|
if (message.type === 'external_message') {
|
|
217
|
-
if (mode !== 'tts_only') throw new Error('external_only_session_required')
|
|
218
|
-
|
|
243
|
+
if (!agentMode && mode !== 'tts_only') throw new Error('external_only_session_required')
|
|
244
|
+
const notification = externalWithState(message, state)
|
|
245
|
+
if (agentMode && (!agentConnection?.ready || !notification.source)) throw Error('invalid_external_message_source')
|
|
246
|
+
if (agentMode && agentConnection.source.owns(notification.source.session_id)) {
|
|
247
|
+
// The native event stream is authoritative. Release the page's single-flight queue.
|
|
248
|
+
front.send(JSON.stringify({type:'external_message.done',message_id:notification.message_id,status:'handled_by_agent'}))
|
|
249
|
+
} else forward(JSON.stringify(notification))
|
|
219
250
|
} else if (['output_audio_buffer.playback_progress', 'output_audio_buffer.cleared', 'session.close'].includes(message.type)) {
|
|
220
251
|
forward(raw.toString())
|
|
221
252
|
} else throw new Error('unsupported_voice_event')
|
|
@@ -268,16 +299,31 @@ export function registerDuetProxy(ctx, config = duetConfig(), feedback = null, c
|
|
|
268
299
|
if (!binary) {
|
|
269
300
|
try {
|
|
270
301
|
const event = JSON.parse(data.toString())
|
|
302
|
+
if(event.type==='duet.local.tasks')return // local native navigation is never server-directed
|
|
303
|
+
if(event.type?.startsWith('duet.trace.')){agentConnection?.handle(event);return}
|
|
304
|
+
if (agentMode && event.type?.startsWith('duet.agent.')) {
|
|
305
|
+
if (mode === 'tts_only' && event.type === 'duet.agent.request') {
|
|
306
|
+
fail('input_audio_disabled'); return
|
|
307
|
+
}
|
|
308
|
+
try { agentConnection.handle(event) } catch(error) { fail(error.message) }
|
|
309
|
+
return
|
|
310
|
+
}
|
|
271
311
|
if (event.type === 'harness.rpc.request') {
|
|
272
312
|
if (!clientRPC || rpcRequests.size >= 8) { fail('invalid_harness_rpc'); return }
|
|
273
313
|
rpcRequests.set(event.request_id, event.connection_id)
|
|
274
314
|
}
|
|
275
315
|
if (event.type === 'session.created') {
|
|
316
|
+
if(event.session?.config?.work_mode && event.session.config.work_mode !== (agentMode?'agent':'direct')) {
|
|
317
|
+
fail('work_mode_protocol_mismatch'); return
|
|
318
|
+
}
|
|
319
|
+
if (agentMode) {
|
|
320
|
+
try { agentConnection.offer(event) } catch(error) { fail(error.message); return }
|
|
321
|
+
}
|
|
276
322
|
if (!diagnostics.target) { fail('voice_server_upgrade_required'); return }
|
|
277
323
|
if (clientRPC && event.harness_sync?.protocol === 'harness_sync_v1') resultPushConnection = event.harness_sync.connection_id
|
|
278
324
|
hintReporting=event.connection_hint_reporting===true
|
|
279
325
|
if (clientRPC && event.session?.config?.harness_control_transport !== 'client_rpc_v1') { fail('harness_rpc_backend_upgrade_required'); return }
|
|
280
|
-
if (mode === 'tts_only' && event.session?.config?.external_message_protocol !== 'harness_result_v2') { fail('harness_result_backend_upgrade_required'); return }
|
|
326
|
+
if (!agentMode && mode === 'tts_only' && event.session?.config?.external_message_protocol !== 'harness_result_v2') { fail('harness_result_backend_upgrade_required'); return }
|
|
281
327
|
const connection = connections.get(front)
|
|
282
328
|
if (connection) connection.ready = true
|
|
283
329
|
clearTimeout(startup)
|
|
@@ -313,13 +359,14 @@ export function registerDuetProxy(ctx, config = duetConfig(), feedback = null, c
|
|
|
313
359
|
diagnostics.add({event:'proxy.browser_closed',code})
|
|
314
360
|
trace.event('rpc.pending_at_close', { request_ids: [...rpcRequests.keys()] })
|
|
315
361
|
opening.abort(); clearTimeout(startup); back?.close(1000, 'duet_browser_closed')
|
|
362
|
+
agentConnection?.close()
|
|
316
363
|
const timer = setTimeout(() => back?.terminate(), 1000)
|
|
317
364
|
timer.unref()
|
|
318
365
|
})
|
|
319
366
|
})
|
|
320
367
|
},
|
|
321
368
|
})
|
|
322
|
-
const dispose = () => { stop(); for (const socket of server.clients) socket.close(1001); server.close();
|
|
369
|
+
const dispose = () => { stop(); for (const socket of server.clients) socket.close(1001); server.close(); releaseDiagnostics() }
|
|
323
370
|
dispose.snapshot = () => ({
|
|
324
371
|
online: [...connections.values()].filter(c => c.mode === 'online' && c.ready).length,
|
|
325
372
|
tts_only: [...connections.values()].filter(c => c.mode === 'tts_only' && c.ready).length,
|
|
@@ -328,9 +375,9 @@ export function registerDuetProxy(ctx, config = duetConfig(), feedback = null, c
|
|
|
328
375
|
})
|
|
329
376
|
dispose.reportDiagnostic = (req, row) => {
|
|
330
377
|
const entry = reporters.get(row?.client_trace_id)
|
|
331
|
-
if (!entry || entry.page_id !== row.page_id) return
|
|
332
|
-
if (entry.user && feedback?.user(req) !== entry.user) return
|
|
333
|
-
entry.diagnostics.add(row)
|
|
378
|
+
if (!entry || entry.page_id !== row.page_id) return false
|
|
379
|
+
if (entry.user && feedback?.user(req) !== entry.user) return false
|
|
380
|
+
return entry.diagnostics.add(row)
|
|
334
381
|
}
|
|
335
382
|
dispose.closeConnections = code => {
|
|
336
383
|
for (const socket of connections.keys()) {
|
|
@@ -1,4 +1,34 @@
|
|
|
1
1
|
/** Read-only public model aliases from the configured voice service. */
|
|
2
|
+
export class WorkModePolicy {
|
|
3
|
+
constructor(getConfig,fetcher=fetch){this.getConfig=getConfig;this.fetcher=fetcher;this.invalidate()}
|
|
4
|
+
invalidate(){this.entry=null}
|
|
5
|
+
get current(){return this.entry?.value||'default_direct'}
|
|
6
|
+
async get(){
|
|
7
|
+
const config=await this.getConfig(),url=new URL(config.endpoints.online)
|
|
8
|
+
url.protocol=url.protocol==='wss:'?'https:':'http:'
|
|
9
|
+
url.pathname=url.pathname.replace(/\/ws\/?$/,'').replace(/\/$/,'')+'/api/work-mode-policy';url.search='';url.hash=''
|
|
10
|
+
if(this.entry?.url!==url.href)this.entry={url:url.href,value:'default_direct',expires:0}
|
|
11
|
+
const entry=this.entry
|
|
12
|
+
if(Date.now()<entry.expires)return entry.value
|
|
13
|
+
return entry.pending??=(async()=>{
|
|
14
|
+
let ttl=5000
|
|
15
|
+
try{
|
|
16
|
+
const r=await this.fetcher(url,{redirect:'error',signal:AbortSignal.timeout(2000),
|
|
17
|
+
headers:config.authorization?{Authorization:config.authorization}:{}})
|
|
18
|
+
if(r.status===404){await r.body?.cancel();entry.value='recommend_agent';ttl=30000}
|
|
19
|
+
else if(r.ok){
|
|
20
|
+
const reader=r.body.getReader(),chunks=[];let size=0
|
|
21
|
+
try{for(;;){const v=await reader.read();if(v.done)break
|
|
22
|
+
size+=v.value.byteLength;if(size>1024)throw Error('invalid_policy');chunks.push(v.value)}}
|
|
23
|
+
finally{await reader.cancel().catch(()=>{})}
|
|
24
|
+
const p=JSON.parse(Buffer.concat(chunks).toString()).work_mode_policy
|
|
25
|
+
if(['recommend_agent','default_direct','direct_only'].includes(p)){entry.value=p;ttl=30000}
|
|
26
|
+
}else await r.body?.cancel()
|
|
27
|
+
}catch{/* Keep the last policy for this endpoint. */}
|
|
28
|
+
entry.expires=Date.now()+ttl;entry.pending=null;return entry.value
|
|
29
|
+
})()
|
|
30
|
+
}
|
|
31
|
+
}
|
|
2
32
|
export class ServiceInfo {
|
|
3
33
|
constructor(getConfig, fetchImpl = fetch) {
|
|
4
34
|
this.getConfig = getConfig; this.fetch = fetchImpl
|
package/src/host/settings.mjs
CHANGED
|
@@ -8,6 +8,12 @@ import { duetEnv } from './environment.mjs'
|
|
|
8
8
|
import { publicServiceAuthorization, isPublicTrialEndpoint } from './service-defaults.mjs'
|
|
9
9
|
import { migrateRetiredSettings } from './settings-migration.mjs'
|
|
10
10
|
import { normalizeNickname } from '../shared/nickname.mjs'
|
|
11
|
+
import { WORK_MODE_VERSION, agentOptions } from '../shared/work-mode.mjs'
|
|
12
|
+
|
|
13
|
+
export function normalizeWorkMode(value = 'direct') {
|
|
14
|
+
if (!['direct', 'agent'].includes(value)) throw Error('invalid_work_mode')
|
|
15
|
+
return value
|
|
16
|
+
}
|
|
11
17
|
|
|
12
18
|
export function normalizeBackendURL(value) {
|
|
13
19
|
if (typeof value !== 'string' || value.length > 2048) throw new Error('invalid_backend_url')
|
|
@@ -46,11 +52,15 @@ export class DuetSettings {
|
|
|
46
52
|
|
|
47
53
|
validate(data) {
|
|
48
54
|
if (!data || typeof data !== 'object' || Array.isArray(data)) throw new Error('invalid_voice_settings')
|
|
49
|
-
|
|
55
|
+
const work_mode = normalizeWorkMode(data.work_mode)
|
|
56
|
+
const work = {work_mode, work_mode_choice_version:data.work_mode_choice_version===WORK_MODE_VERSION?WORK_MODE_VERSION:0,
|
|
57
|
+
agent_permission_version:data.agent_permission_version===WORK_MODE_VERSION?WORK_MODE_VERSION:0,
|
|
58
|
+
agent_options:agentOptions(data.agent_options)}
|
|
59
|
+
if (data.backend_url === undefined && data.nickname != null) return {nickname:normalizeNickname(data.nickname), ...work}
|
|
50
60
|
const backend_url = validateBackendURL(data.backend_url, data.insecure_origin)
|
|
51
61
|
const url = new URL(backend_url)
|
|
52
62
|
const insecure_origin = url.protocol === 'ws:' && url.origin === data.insecure_origin ? url.origin : null
|
|
53
|
-
return { backend_url, ...(insecure_origin ? { insecure_origin } : {}),
|
|
63
|
+
return { backend_url, ...work, ...(insecure_origin ? { insecure_origin } : {}),
|
|
54
64
|
...(data.nickname != null ? {nickname:normalizeNickname(data.nickname)} : {}) }
|
|
55
65
|
}
|
|
56
66
|
|
|
@@ -74,6 +84,10 @@ export class DuetSettings {
|
|
|
74
84
|
auth_configured: Boolean(config.authorization),
|
|
75
85
|
debug: this.debug, revision: this.revision,
|
|
76
86
|
nickname: this.saved?.nickname ?? null,
|
|
87
|
+
work_mode: this.saved?.work_mode ?? 'direct',
|
|
88
|
+
work_mode_choice_version:this.saved?.work_mode_choice_version??0,
|
|
89
|
+
agent_permission_version:this.saved?.agent_permission_version??0,
|
|
90
|
+
agent_options:agentOptions(this.saved?.agent_options),
|
|
77
91
|
insecure_transport: new URL(config.endpoints.online).protocol !== 'wss:',
|
|
78
92
|
}
|
|
79
93
|
}
|
|
@@ -85,8 +99,15 @@ export class DuetSettings {
|
|
|
85
99
|
const normalized = normalizeBackendURL(input.backend_url)
|
|
86
100
|
const insecureOrigin = input.allow_insecure_http === true ? new URL(normalized).origin : this.saved?.insecure_origin
|
|
87
101
|
const url = validateBackendURL(normalized, insecureOrigin)
|
|
102
|
+
const explicit=input.work_mode!==undefined
|
|
103
|
+
const permission=input.agent_permission===true?WORK_MODE_VERSION:input.agent_permission===false?0:this.saved?.agent_permission_version??0
|
|
88
104
|
const next = this.validate({ backend_url: url, insecure_origin: insecureOrigin,
|
|
105
|
+
work_mode_choice_version:explicit?WORK_MODE_VERSION:this.saved?.work_mode_choice_version,
|
|
106
|
+
agent_permission_version:permission,
|
|
107
|
+
agent_options:input.agent_options===undefined?this.saved?.agent_options:input.agent_options,
|
|
108
|
+
work_mode: input.work_mode === undefined ? this.saved?.work_mode : input.work_mode,
|
|
89
109
|
nickname: input.nickname === undefined ? this.saved?.nickname : input.nickname })
|
|
110
|
+
if(next.work_mode==='agent'&&(!permission||!next.agent_options.workspace_id))throw Error(!permission?'agent_permission_required':'workspace_selection_required')
|
|
90
111
|
return this.persist(next, input.revision)
|
|
91
112
|
}
|
|
92
113
|
|
package/src/host/trace.mjs
CHANGED
|
@@ -88,7 +88,10 @@ export class DuetTrace {
|
|
|
88
88
|
if (binary) { this.event(direction, { wire: 'binary' }, Buffer.from(raw)); return }
|
|
89
89
|
try {
|
|
90
90
|
const message = JSON.parse(raw.toString())
|
|
91
|
-
if
|
|
91
|
+
if(message.type==='duet.trace.batch') {
|
|
92
|
+
const {data,...metadata}=message
|
|
93
|
+
this.event(direction,{...metadata,compressed_base64_bytes:typeof data==='string'?data.length:0})
|
|
94
|
+
} else if (/audio/.test(message.type || '') && typeof message.delta === 'string') {
|
|
92
95
|
const data = { ...message, delta: { stored_as: 'blob', encoding: 'base64' } }
|
|
93
96
|
this.event(direction, data, Buffer.from(message.delta, 'base64'))
|
|
94
97
|
} else this.event(direction, message)
|
|
@@ -2,6 +2,7 @@ import {avatarLocalState,avatarMenuAction,avatarMenuResult} from './avatar-menu.
|
|
|
2
2
|
import {sizeButton,nextAvatarSize} from './avatar-ui.mjs'
|
|
3
3
|
const labels={completed:'本轮已完成',failed:'执行失败',stopped:'已停止',approval:'等待授权',question:'等待回答',plan_review:'等待方案确认'}
|
|
4
4
|
const names={small:'紧凑',medium:'标准',large:'宽松'}
|
|
5
|
+
export const noticeBadgeStyle='border:0;border-radius:12px;background:#dcefff;color:#185a89;font:12px system-ui;padding:4px 7px;cursor:pointer;pointer-events:auto'
|
|
5
6
|
const paths={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'}
|
|
6
7
|
const icon=name=>{const s=document.createElementNS('http://www.w3.org/2000/svg','svg');s.setAttribute('viewBox','0 0 24 24');s.setAttribute('aria-hidden','true');s.innerHTML=`<path d="${paths[name]||paths.pending}"/>`;return s}
|
|
7
8
|
export function mountAvatarMenu({anchor,viewport=()=>[0,0,innerWidth,innerHeight],send,changed=()=>{}}){
|
|
@@ -33,7 +34,8 @@ export function mountAvatarMenu({anchor,viewport=()=>[0,0,innerWidth,innerHeight
|
|
|
33
34
|
if(paths[iconName])b.append(icon(iconName));const t=document.createElement('span');t.dataset.label='';t.textContent=label;b.append(t)
|
|
34
35
|
b.onclick=()=>{if(['pending','bubble_panel','back'].includes(action)){section=action==='back'?'main':action;render();return}close();command(action,undefined,id)};return b
|
|
35
36
|
}
|
|
36
|
-
const
|
|
37
|
+
const unreadCount=()=>state.items.filter(i=>i.unread).length
|
|
38
|
+
const countLabel=()=>{const n=unreadCount();return '待处理事项与通知'+(n?`(${n})`:'')}
|
|
37
39
|
const valueSpan=b=>{const v=document.createElement('span');v.dataset.value='';b.append(v);return v}
|
|
38
40
|
const refreshControls=()=>{
|
|
39
41
|
if(!root)return
|
|
@@ -72,8 +74,8 @@ export function mountAvatarMenu({anchor,viewport=()=>[0,0,innerWidth,innerHeight
|
|
|
72
74
|
const keys=e=>{if(!root)return;if(e.key==='Escape'){e.preventDefault();e.stopImmediatePropagation();close();return}const buttons=[...root.querySelectorAll('button')],index=buttons.indexOf(document.activeElement);if(['ArrowDown','ArrowUp','Home','End','Tab'].includes(e.key)){e.preventDefault();buttons[e.key==='Home'?0:e.key==='End'?buttons.length-1:(index+(e.key==='ArrowUp'||e.key==='Tab'&&e.shiftKey?-1:1)+buttons.length)%buttons.length]?.focus()}}
|
|
73
75
|
const decorate=(node,label)=>{node.className='duet-pet-menu';node.setAttribute('aria-label',label)}
|
|
74
76
|
const update=value=>{
|
|
75
|
-
state=avatarLocalState(value);badge??=document.createElement('button');badge.type='button';badge.dataset.duetNoticeBadge='';badge.style.cssText='position:fixed;z-index:2147483600;
|
|
76
|
-
const count=
|
|
77
|
+
state=avatarLocalState(value);badge??=document.createElement('button');badge.type='button';badge.dataset.duetNoticeBadge='';badge.style.cssText='position:fixed;z-index:2147483600;'+noticeBadgeStyle
|
|
78
|
+
const count=unreadCount();badge.textContent=count?String(count):'';badge.setAttribute('aria-label',countLabel());badge.hidden=!count||!state.enabled;badge.onclick=e=>open(e,'pending');if(!badge.isConnected)document.body.append(badge)
|
|
77
79
|
const a=anchor().getBoundingClientRect(),[x,y,w,h]=viewport();badge.style.left=Math.max(x+12,Math.min((a.right??a.left+a.width)-24,x+w-36))+'px';badge.style.top=Math.max(y+12,Math.min(a.top,y+h-30))+'px'
|
|
78
80
|
if(toastId!==state.toast){clearTimeout(timer);clearTimeout(ackTimer);toast?.remove();toast=null;toastId=state.toast;const item=state.items.find(i=>i.id===state.toast);if(item){toast=document.createElement('section');toast.dataset.duetLocalNotice='';decorate(toast,'DSH 任务通知');const p=document.createElement('div');p.dataset.noticeTitle='';p.textContent=`${item.name||'未命名会话'} · ${labels[item.status]}`;toast.append(p,row(item.pending?'去处理':'查看','view','open',item.id),row('收起','dismiss','hide',item.id));document.body.append(toast);place(toast);if(!item.pending)timer=setTimeout(()=>{toast?.remove();toast=null;changed()},8000)}}
|
|
79
81
|
refreshControls();changed()
|
|
@@ -73,6 +73,9 @@ export class AvatarNotices {
|
|
|
73
73
|
this.revision++
|
|
74
74
|
}
|
|
75
75
|
read(id){const item=this.items.get(id);if(item)item.unread=false;if(this.toast===id)this.toast=null;this.revision++}
|
|
76
|
+
readSession(sessionId){
|
|
77
|
+
for(const item of this.items.values())if(item.session_id===sessionId&&item.unread)this.read(item.id)
|
|
78
|
+
}
|
|
76
79
|
dismiss(id){if(this.items.has(id))this.dismissed.add(id);if(this.toast===id)this.toast=null;this.revision++}
|
|
77
80
|
state(prefs,size,available=true){
|
|
78
81
|
const pending=[...this.items.values()].find(i=>i.pending&&i.unread&&!this.dismissed.has(i.id))
|
|
@@ -10,13 +10,14 @@ export function avatarSurface(value) {
|
|
|
10
10
|
if(!n||!['text','heading','button','checkbox','break'].includes(n.kind)||typeof n.text!=='string'||n.text.length>4000)throw Error('invalid_surface')
|
|
11
11
|
length+=n.text.length;if(length>10000)throw Error('invalid_surface')
|
|
12
12
|
const node={kind:n.kind,text:n.text}
|
|
13
|
+
if(['running','completed','waiting','failed','stopped'].includes(n.taskState))node.taskState=n.taskState
|
|
13
14
|
if(n.kind==='button'||n.kind==='checkbox') {
|
|
14
15
|
if(!/^a\d+$/.test(n.action))throw Error('invalid_surface')
|
|
15
16
|
Object.assign(node,{action:n.action,disabled:n.disabled===true,checked:n.checked===true,gesture:n.gesture===true,label:String(n.label||'').slice(0,100)})
|
|
16
17
|
}
|
|
17
18
|
return node
|
|
18
19
|
})
|
|
19
|
-
return {type:'surface',panel:{id:p.id,revision:p.revision,nodes,target:['online','tts_only'].includes(p.target)?p.target:null}}
|
|
20
|
+
return {type:'surface',panel:{id:p.id,revision:p.revision,nodes,target:['online','tts_only'].includes(p.target)?p.target:null,...(p.layout==='tasks'?{layout:'tasks'}:{})}}
|
|
20
21
|
}
|
|
21
22
|
export function avatarSurfaceAction(v) {
|
|
22
23
|
if(v?.type!=='surface_action'||!/^s\d+$/.test(v.id)||!/^a\d+$/.test(v.action)||!Number.isSafeInteger(v.revision)||v.revision<1)throw Error('invalid_surface_action')
|
package/src/shared/state.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Desired voice mode is independent of a temporarily suspended connection. */
|
|
2
|
-
export const PLUGIN_VERSION = '0.
|
|
2
|
+
export const PLUGIN_VERSION = '0.3.0'
|
|
3
3
|
export const IDLE_RELEASE_MS = 60_000
|
|
4
4
|
|
|
5
5
|
const safeVersion = value => typeof value === 'string' && value.length <= 32 && /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(value) ? value : ''
|
|
@@ -96,7 +96,8 @@ export class DuetState {
|
|
|
96
96
|
this.ready = true
|
|
97
97
|
this.connection?.sendState(this.state)
|
|
98
98
|
this.flush()
|
|
99
|
-
} else if (event.type === 'external_message.done'
|
|
99
|
+
} else if (event.type === 'external_message.done' ||
|
|
100
|
+
(event.type === 'external_message.accepted' && this.connection?.ordinaryOnlineResults)) {
|
|
100
101
|
this.pending.delete(event.message_id)
|
|
101
102
|
this.sent.delete(event.message_id)
|
|
102
103
|
this.flush()
|
|
@@ -111,6 +112,13 @@ export class DuetState {
|
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
fail(code, details = {}) {
|
|
115
|
+
if(code==='agent_mode_disabled'){
|
|
116
|
+
this.notice('当前语音服务仅支持输入模式。');void this.setMode('off',{reason:'error',code});return
|
|
117
|
+
}
|
|
118
|
+
if (code === 'duet_agent_backend_upgrade_required' || code === 'duet_agent_unavailable') {
|
|
119
|
+
this.notice('代理模式暂不可用,请检查任务模块与语音服务配置,或在设置中切回输入模式。')
|
|
120
|
+
void this.setMode('off', {reason:'error',code}); return
|
|
121
|
+
}
|
|
114
122
|
const compatibility = compatibilityNotice(code, details, this.mode)
|
|
115
123
|
if (compatibility) {
|
|
116
124
|
this.notice(compatibility, { upgrade: code !== 'client_version_unsupported',
|
|
@@ -119,6 +127,11 @@ export class DuetState {
|
|
|
119
127
|
return
|
|
120
128
|
}
|
|
121
129
|
const policyNotices = {
|
|
130
|
+
work_mode_choice_required:'请先选择输入模式或代理模式。',
|
|
131
|
+
agent_permission_required:'请先在设置中同意代理模式的权限。',
|
|
132
|
+
work_mode_protocol_mismatch:'语音服务与当前工作方式不匹配,请重新连接或在设置中切换工作方式。',
|
|
133
|
+
duet_agent_workspace_in_use:'这个工作区已有代理语音连接,请先关闭另一处连接。',
|
|
134
|
+
workspace_selection_required:'请在设置中选择代理工作区。',
|
|
122
135
|
workspace_required: '请先在 DSH 中创建 workspace,再开启 duet。',
|
|
123
136
|
workspace_loading: '正在加载 workspace,请稍后再试。',
|
|
124
137
|
workspace_unavailable: '无法读取 workspace,请刷新 DSH 后重试。',
|
|
@@ -152,7 +165,7 @@ export class DuetState {
|
|
|
152
165
|
this.state = state
|
|
153
166
|
if (this.ready) this.connection?.sendState(state)
|
|
154
167
|
}
|
|
155
|
-
if (this.mode === 'tts_only') {
|
|
168
|
+
if (this.mode === 'tts_only' || this.connection?.ordinaryOnlineResults) {
|
|
156
169
|
for (const result of results) {
|
|
157
170
|
if (this.pending.size >= 64) { this.fail('external_message_queue_full'); break }
|
|
158
171
|
this.pending.set(result.message_id, result)
|
|
@@ -168,7 +181,7 @@ export class DuetState {
|
|
|
168
181
|
}
|
|
169
182
|
|
|
170
183
|
flush() {
|
|
171
|
-
if (!this.ready || this.mode !== 'tts_only') return
|
|
184
|
+
if (!this.ready || (this.mode !== 'tts_only' && !this.connection?.ordinaryOnlineResults)) return
|
|
172
185
|
// One notification at a time; preserve the next one until generation finishes.
|
|
173
186
|
if (this.sent.size) return
|
|
174
187
|
const result = this.pending.values().next().value
|